diff --git a/vendor/Expectation.php b/vendor/Expectation.php deleted file mode 100644 index d5c2b4ee..00000000 --- a/vendor/Expectation.php +++ /dev/null @@ -1,8 +0,0 @@ -realpath = realpath($opened_path) ?: $opened_path; - $opened_path = $this->realpath; - $this->handle = fopen($this->realpath, $mode); - $this->position = 0; - - return (bool) $this->handle; - } - - public function stream_read($count) - { - $data = fread($this->handle, $count); - - if ($this->position === 0) { - $data = preg_replace('{^#!.*\r?\n}', '', $data); - } - - $this->position += strlen($data); - - return $data; - } - - public function stream_cast($castAs) - { - return $this->handle; - } - - public function stream_close() - { - fclose($this->handle); - } - - public function stream_lock($operation) - { - return $operation ? flock($this->handle, $operation) : true; - } - - public function stream_seek($offset, $whence) - { - if (0 === fseek($this->handle, $offset, $whence)) { - $this->position = ftell($this->handle); - return true; - } - - return false; - } - - public function stream_tell() - { - return $this->position; - } - - public function stream_eof() - { - return feof($this->handle); - } - - public function stream_stat() - { - return array(); - } - - public function stream_set_option($option, $arg1, $arg2) - { - return true; - } - - public function url_stat($path, $flags) - { - $path = substr($path, 17); - if (file_exists($path)) { - return stat($path); - } - - return false; - } - } - } - - if ( - (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) - || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) - ) { - include("phpvfscomposer://" . __DIR__ . '/..'.'/nesbot/carbon/bin/carbon'); - exit(0); - } -} - -include __DIR__ . '/..'.'/nesbot/carbon/bin/carbon'; diff --git a/vendor/bin/patch-type-declarations b/vendor/bin/patch-type-declarations deleted file mode 100755 index 217ab021..00000000 --- a/vendor/bin/patch-type-declarations +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/env php -realpath = realpath($opened_path) ?: $opened_path; - $opened_path = $this->realpath; - $this->handle = fopen($this->realpath, $mode); - $this->position = 0; - - return (bool) $this->handle; - } - - public function stream_read($count) - { - $data = fread($this->handle, $count); - - if ($this->position === 0) { - $data = preg_replace('{^#!.*\r?\n}', '', $data); - } - - $this->position += strlen($data); - - return $data; - } - - public function stream_cast($castAs) - { - return $this->handle; - } - - public function stream_close() - { - fclose($this->handle); - } - - public function stream_lock($operation) - { - return $operation ? flock($this->handle, $operation) : true; - } - - public function stream_seek($offset, $whence) - { - if (0 === fseek($this->handle, $offset, $whence)) { - $this->position = ftell($this->handle); - return true; - } - - return false; - } - - public function stream_tell() - { - return $this->position; - } - - public function stream_eof() - { - return feof($this->handle); - } - - public function stream_stat() - { - return array(); - } - - public function stream_set_option($option, $arg1, $arg2) - { - return true; - } - - public function url_stat($path, $flags) - { - $path = substr($path, 17); - if (file_exists($path)) { - return stat($path); - } - - return false; - } - } - } - - if ( - (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) - || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) - ) { - include("phpvfscomposer://" . __DIR__ . '/..'.'/symfony/error-handler/Resources/bin/patch-type-declarations'); - exit(0); - } -} - -include __DIR__ . '/..'.'/symfony/error-handler/Resources/bin/patch-type-declarations'; diff --git a/vendor/bin/php-parse b/vendor/bin/php-parse deleted file mode 100755 index 1bd2c838..00000000 --- a/vendor/bin/php-parse +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/env php -realpath = realpath($opened_path) ?: $opened_path; - $opened_path = $this->realpath; - $this->handle = fopen($this->realpath, $mode); - $this->position = 0; - - return (bool) $this->handle; - } - - public function stream_read($count) - { - $data = fread($this->handle, $count); - - if ($this->position === 0) { - $data = preg_replace('{^#!.*\r?\n}', '', $data); - } - - $this->position += strlen($data); - - return $data; - } - - public function stream_cast($castAs) - { - return $this->handle; - } - - public function stream_close() - { - fclose($this->handle); - } - - public function stream_lock($operation) - { - return $operation ? flock($this->handle, $operation) : true; - } - - public function stream_seek($offset, $whence) - { - if (0 === fseek($this->handle, $offset, $whence)) { - $this->position = ftell($this->handle); - return true; - } - - return false; - } - - public function stream_tell() - { - return $this->position; - } - - public function stream_eof() - { - return feof($this->handle); - } - - public function stream_stat() - { - return array(); - } - - public function stream_set_option($option, $arg1, $arg2) - { - return true; - } - - public function url_stat($path, $flags) - { - $path = substr($path, 17); - if (file_exists($path)) { - return stat($path); - } - - return false; - } - } - } - - if ( - (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) - || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) - ) { - include("phpvfscomposer://" . __DIR__ . '/..'.'/nikic/php-parser/bin/php-parse'); - exit(0); - } -} - -include __DIR__ . '/..'.'/nikic/php-parser/bin/php-parse'; diff --git a/vendor/bin/phpunit b/vendor/bin/phpunit deleted file mode 100755 index e92cddc5..00000000 --- a/vendor/bin/phpunit +++ /dev/null @@ -1,123 +0,0 @@ -#!/usr/bin/env php -realpath = realpath($opened_path) ?: $opened_path; - $opened_path = 'phpvfscomposer://'.$this->realpath; - $this->handle = fopen($this->realpath, $mode); - $this->position = 0; - - return (bool) $this->handle; - } - - public function stream_read($count) - { - $data = fread($this->handle, $count); - - if ($this->position === 0) { - $data = preg_replace('{^#!.*\r?\n}', '', $data); - } - $data = str_replace('__DIR__', var_export(dirname($this->realpath), true), $data); - $data = str_replace('__FILE__', var_export($this->realpath, true), $data); - - $this->position += strlen($data); - - return $data; - } - - public function stream_cast($castAs) - { - return $this->handle; - } - - public function stream_close() - { - fclose($this->handle); - } - - public function stream_lock($operation) - { - return $operation ? flock($this->handle, $operation) : true; - } - - public function stream_seek($offset, $whence) - { - if (0 === fseek($this->handle, $offset, $whence)) { - $this->position = ftell($this->handle); - return true; - } - - return false; - } - - public function stream_tell() - { - return $this->position; - } - - public function stream_eof() - { - return feof($this->handle); - } - - public function stream_stat() - { - return array(); - } - - public function stream_set_option($option, $arg1, $arg2) - { - return true; - } - - public function url_stat($path, $flags) - { - $path = substr($path, 17); - if (file_exists($path)) { - return stat($path); - } - - return false; - } - } - } - - if ( - (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) - || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) - ) { - include("phpvfscomposer://" . __DIR__ . '/..'.'/phpunit/phpunit/phpunit'); - exit(0); - } -} - -include __DIR__ . '/..'.'/phpunit/phpunit/phpunit'; diff --git a/vendor/bin/pint b/vendor/bin/pint deleted file mode 100755 index 943ad148..00000000 --- a/vendor/bin/pint +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/env php -realpath = realpath($opened_path) ?: $opened_path; - $opened_path = $this->realpath; - $this->handle = fopen($this->realpath, $mode); - $this->position = 0; - - return (bool) $this->handle; - } - - public function stream_read($count) - { - $data = fread($this->handle, $count); - - if ($this->position === 0) { - $data = preg_replace('{^#!.*\r?\n}', '', $data); - } - - $this->position += strlen($data); - - return $data; - } - - public function stream_cast($castAs) - { - return $this->handle; - } - - public function stream_close() - { - fclose($this->handle); - } - - public function stream_lock($operation) - { - return $operation ? flock($this->handle, $operation) : true; - } - - public function stream_seek($offset, $whence) - { - if (0 === fseek($this->handle, $offset, $whence)) { - $this->position = ftell($this->handle); - return true; - } - - return false; - } - - public function stream_tell() - { - return $this->position; - } - - public function stream_eof() - { - return feof($this->handle); - } - - public function stream_stat() - { - return array(); - } - - public function stream_set_option($option, $arg1, $arg2) - { - return true; - } - - public function url_stat($path, $flags) - { - $path = substr($path, 17); - if (file_exists($path)) { - return stat($path); - } - - return false; - } - } - } - - if ( - (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) - || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) - ) { - include("phpvfscomposer://" . __DIR__ . '/..'.'/laravel/pint/builds/pint'); - exit(0); - } -} - -include __DIR__ . '/..'.'/laravel/pint/builds/pint'; diff --git a/vendor/bin/testbench b/vendor/bin/testbench deleted file mode 100755 index ba929022..00000000 --- a/vendor/bin/testbench +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/env php -realpath = realpath($opened_path) ?: $opened_path; - $opened_path = $this->realpath; - $this->handle = fopen($this->realpath, $mode); - $this->position = 0; - - return (bool) $this->handle; - } - - public function stream_read($count) - { - $data = fread($this->handle, $count); - - if ($this->position === 0) { - $data = preg_replace('{^#!.*\r?\n}', '', $data); - } - - $this->position += strlen($data); - - return $data; - } - - public function stream_cast($castAs) - { - return $this->handle; - } - - public function stream_close() - { - fclose($this->handle); - } - - public function stream_lock($operation) - { - return $operation ? flock($this->handle, $operation) : true; - } - - public function stream_seek($offset, $whence) - { - if (0 === fseek($this->handle, $offset, $whence)) { - $this->position = ftell($this->handle); - return true; - } - - return false; - } - - public function stream_tell() - { - return $this->position; - } - - public function stream_eof() - { - return feof($this->handle); - } - - public function stream_stat() - { - return array(); - } - - public function stream_set_option($option, $arg1, $arg2) - { - return true; - } - - public function url_stat($path, $flags) - { - $path = substr($path, 17); - if (file_exists($path)) { - return stat($path); - } - - return false; - } - } - } - - if ( - (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) - || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) - ) { - include("phpvfscomposer://" . __DIR__ . '/..'.'/orchestra/testbench-core/testbench'); - exit(0); - } -} - -include __DIR__ . '/..'.'/orchestra/testbench-core/testbench'; diff --git a/vendor/bin/var-dump-server b/vendor/bin/var-dump-server deleted file mode 100755 index c52c7727..00000000 --- a/vendor/bin/var-dump-server +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/env php -realpath = realpath($opened_path) ?: $opened_path; - $opened_path = $this->realpath; - $this->handle = fopen($this->realpath, $mode); - $this->position = 0; - - return (bool) $this->handle; - } - - public function stream_read($count) - { - $data = fread($this->handle, $count); - - if ($this->position === 0) { - $data = preg_replace('{^#!.*\r?\n}', '', $data); - } - - $this->position += strlen($data); - - return $data; - } - - public function stream_cast($castAs) - { - return $this->handle; - } - - public function stream_close() - { - fclose($this->handle); - } - - public function stream_lock($operation) - { - return $operation ? flock($this->handle, $operation) : true; - } - - public function stream_seek($offset, $whence) - { - if (0 === fseek($this->handle, $offset, $whence)) { - $this->position = ftell($this->handle); - return true; - } - - return false; - } - - public function stream_tell() - { - return $this->position; - } - - public function stream_eof() - { - return feof($this->handle); - } - - public function stream_stat() - { - return array(); - } - - public function stream_set_option($option, $arg1, $arg2) - { - return true; - } - - public function url_stat($path, $flags) - { - $path = substr($path, 17); - if (file_exists($path)) { - return stat($path); - } - - return false; - } - } - } - - if ( - (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) - || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) - ) { - include("phpvfscomposer://" . __DIR__ . '/..'.'/symfony/var-dumper/Resources/bin/var-dump-server'); - exit(0); - } -} - -include __DIR__ . '/..'.'/symfony/var-dumper/Resources/bin/var-dump-server'; diff --git a/vendor/bin/yaml-lint b/vendor/bin/yaml-lint deleted file mode 100755 index b5cdff98..00000000 --- a/vendor/bin/yaml-lint +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/env php -realpath = realpath($opened_path) ?: $opened_path; - $opened_path = $this->realpath; - $this->handle = fopen($this->realpath, $mode); - $this->position = 0; - - return (bool) $this->handle; - } - - public function stream_read($count) - { - $data = fread($this->handle, $count); - - if ($this->position === 0) { - $data = preg_replace('{^#!.*\r?\n}', '', $data); - } - - $this->position += strlen($data); - - return $data; - } - - public function stream_cast($castAs) - { - return $this->handle; - } - - public function stream_close() - { - fclose($this->handle); - } - - public function stream_lock($operation) - { - return $operation ? flock($this->handle, $operation) : true; - } - - public function stream_seek($offset, $whence) - { - if (0 === fseek($this->handle, $offset, $whence)) { - $this->position = ftell($this->handle); - return true; - } - - return false; - } - - public function stream_tell() - { - return $this->position; - } - - public function stream_eof() - { - return feof($this->handle); - } - - public function stream_stat() - { - return array(); - } - - public function stream_set_option($option, $arg1, $arg2) - { - return true; - } - - public function url_stat($path, $flags) - { - $path = substr($path, 17); - if (file_exists($path)) { - return stat($path); - } - - return false; - } - } - } - - if ( - (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) - || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) - ) { - include("phpvfscomposer://" . __DIR__ . '/..'.'/symfony/yaml/Resources/bin/yaml-lint'); - exit(0); - } -} - -include __DIR__ . '/..'.'/symfony/yaml/Resources/bin/yaml-lint'; diff --git a/vendor/brick/math/CHANGELOG.md b/vendor/brick/math/CHANGELOG.md deleted file mode 100644 index c5c5893b..00000000 --- a/vendor/brick/math/CHANGELOG.md +++ /dev/null @@ -1,433 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -## [0.10.2](https://github.com/brick/math/releases/tag/0.10.2) - 2022-08-11 - -👌 **Improvements** - -- `BigRational::toFloat()` now simplifies the fraction before performing division (#73) thanks to @olsavmic - -## [0.10.1](https://github.com/brick/math/releases/tag/0.10.1) - 2022-08-02 - -✨ **New features** - -- `BigInteger::gcdMultiple()` returns the GCD of multiple `BigInteger` numbers - -## [0.10.0](https://github.com/brick/math/releases/tag/0.10.0) - 2022-06-18 - -💥 **Breaking changes** - -- Minimum PHP version is now 7.4 - -## [0.9.3](https://github.com/brick/math/releases/tag/0.9.3) - 2021-08-15 - -🚀 **Compatibility with PHP 8.1** - -- Support for custom object serialization; this removes a warning on PHP 8.1 due to the `Serializable` interface being deprecated (#60) thanks @TRowbotham - -## [0.9.2](https://github.com/brick/math/releases/tag/0.9.2) - 2021-01-20 - -🐛 **Bug fix** - -- Incorrect results could be returned when using the BCMath calculator, with a default scale set with `bcscale()`, on PHP >= 7.2 (#55). - -## [0.9.1](https://github.com/brick/math/releases/tag/0.9.1) - 2020-08-19 - -✨ **New features** - -- `BigInteger::not()` returns the bitwise `NOT` value - -🐛 **Bug fixes** - -- `BigInteger::toBytes()` could return an incorrect binary representation for some numbers -- The bitwise operations `and()`, `or()`, `xor()` on `BigInteger` could return an incorrect result when the GMP extension is not available - -## [0.9.0](https://github.com/brick/math/releases/tag/0.9.0) - 2020-08-18 - -👌 **Improvements** - -- `BigNumber::of()` now accepts `.123` and `123.` formats, both of which return a `BigDecimal` - -💥 **Breaking changes** - -- Deprecated method `BigInteger::powerMod()` has been removed - use `modPow()` instead -- Deprecated method `BigInteger::parse()` has been removed - use `fromBase()` instead - -## [0.8.17](https://github.com/brick/math/releases/tag/0.8.17) - 2020-08-19 - -🐛 **Bug fix** - -- `BigInteger::toBytes()` could return an incorrect binary representation for some numbers -- The bitwise operations `and()`, `or()`, `xor()` on `BigInteger` could return an incorrect result when the GMP extension is not available - -## [0.8.16](https://github.com/brick/math/releases/tag/0.8.16) - 2020-08-18 - -🚑 **Critical fix** - -- This version reintroduces the deprecated `BigInteger::parse()` method, that has been removed by mistake in version `0.8.9` and should have lasted for the whole `0.8` release cycle. - -✨ **New features** - -- `BigInteger::modInverse()` calculates a modular multiplicative inverse -- `BigInteger::fromBytes()` creates a `BigInteger` from a byte string -- `BigInteger::toBytes()` converts a `BigInteger` to a byte string -- `BigInteger::randomBits()` creates a pseudo-random `BigInteger` of a given bit length -- `BigInteger::randomRange()` creates a pseudo-random `BigInteger` between two bounds - -💩 **Deprecations** - -- `BigInteger::powerMod()` is now deprecated in favour of `modPow()` - -## [0.8.15](https://github.com/brick/math/releases/tag/0.8.15) - 2020-04-15 - -🐛 **Fixes** - -- added missing `ext-json` requirement, due to `BigNumber` implementing `JsonSerializable` - -⚡️ **Optimizations** - -- additional optimization in `BigInteger::remainder()` - -## [0.8.14](https://github.com/brick/math/releases/tag/0.8.14) - 2020-02-18 - -✨ **New features** - -- `BigInteger::getLowestSetBit()` returns the index of the rightmost one bit - -## [0.8.13](https://github.com/brick/math/releases/tag/0.8.13) - 2020-02-16 - -✨ **New features** - -- `BigInteger::isEven()` tests whether the number is even -- `BigInteger::isOdd()` tests whether the number is odd -- `BigInteger::testBit()` tests if a bit is set -- `BigInteger::getBitLength()` returns the number of bits in the minimal representation of the number - -## [0.8.12](https://github.com/brick/math/releases/tag/0.8.12) - 2020-02-03 - -🛠️ **Maintenance release** - -Classes are now annotated for better static analysis with [psalm](https://psalm.dev/). - -This is a maintenance release: no bug fixes, no new features, no breaking changes. - -## [0.8.11](https://github.com/brick/math/releases/tag/0.8.11) - 2020-01-23 - -✨ **New feature** - -`BigInteger::powerMod()` performs a power-with-modulo operation. Useful for crypto. - -## [0.8.10](https://github.com/brick/math/releases/tag/0.8.10) - 2020-01-21 - -✨ **New feature** - -`BigInteger::mod()` returns the **modulo** of two numbers. The *modulo* differs from the *remainder* when the signs of the operands are different. - -## [0.8.9](https://github.com/brick/math/releases/tag/0.8.9) - 2020-01-08 - -⚡️ **Performance improvements** - -A few additional optimizations in `BigInteger` and `BigDecimal` when one of the operands can be returned as is. Thanks to @tomtomsen in #24. - -## [0.8.8](https://github.com/brick/math/releases/tag/0.8.8) - 2019-04-25 - -🐛 **Bug fixes** - -- `BigInteger::toBase()` could return an empty string for zero values (BCMath & Native calculators only, GMP calculator unaffected) - -✨ **New features** - -- `BigInteger::toArbitraryBase()` converts a number to an arbitrary base, using a custom alphabet -- `BigInteger::fromArbitraryBase()` converts a string in an arbitrary base, using a custom alphabet, back to a number - -These methods can be used as the foundation to convert strings between different bases/alphabets, using BigInteger as an intermediate representation. - -💩 **Deprecations** - -- `BigInteger::parse()` is now deprecated in favour of `fromBase()` - -`BigInteger::fromBase()` works the same way as `parse()`, with 2 minor differences: - -- the `$base` parameter is required, it does not default to `10` -- it throws a `NumberFormatException` instead of an `InvalidArgumentException` when the number is malformed - -## [0.8.7](https://github.com/brick/math/releases/tag/0.8.7) - 2019-04-20 - -**Improvements** - -- Safer conversion from `float` when using custom locales -- **Much faster** `NativeCalculator` implementation 🚀 - -You can expect **at least a 3x performance improvement** for common arithmetic operations when using the library on systems without GMP or BCMath; it gets exponentially faster on multiplications with a high number of digits. This is due to calculations now being performed on whole blocks of digits (the block size depending on the platform, 32-bit or 64-bit) instead of digit-by-digit as before. - -## [0.8.6](https://github.com/brick/math/releases/tag/0.8.6) - 2019-04-11 - -**New method** - -`BigNumber::sum()` returns the sum of one or more numbers. - -## [0.8.5](https://github.com/brick/math/releases/tag/0.8.5) - 2019-02-12 - -**Bug fix**: `of()` factory methods could fail when passing a `float` in environments using a `LC_NUMERIC` locale with a decimal separator other than `'.'` (#20). - -Thanks @manowark 👍 - -## [0.8.4](https://github.com/brick/math/releases/tag/0.8.4) - 2018-12-07 - -**New method** - -`BigDecimal::sqrt()` calculates the square root of a decimal number, to a given scale. - -## [0.8.3](https://github.com/brick/math/releases/tag/0.8.3) - 2018-12-06 - -**New method** - -`BigInteger::sqrt()` calculates the square root of a number (thanks @peter279k). - -**New exception** - -`NegativeNumberException` is thrown when calling `sqrt()` on a negative number. - -## [0.8.2](https://github.com/brick/math/releases/tag/0.8.2) - 2018-11-08 - -**Performance update** - -- Further improvement of `toInt()` performance -- `NativeCalculator` can now perform some multiplications more efficiently - -## [0.8.1](https://github.com/brick/math/releases/tag/0.8.1) - 2018-11-07 - -Performance optimization of `toInt()` methods. - -## [0.8.0](https://github.com/brick/math/releases/tag/0.8.0) - 2018-10-13 - -**Breaking changes** - -The following deprecated methods have been removed. Use the new method name instead: - -| Method removed | Replacement method | -| --- | --- | -| `BigDecimal::getIntegral()` | `BigDecimal::getIntegralPart()` | -| `BigDecimal::getFraction()` | `BigDecimal::getFractionalPart()` | - ---- - -**New features** - -`BigInteger` has been augmented with 5 new methods for bitwise operations: - -| New method | Description | -| --- | --- | -| `and()` | performs a bitwise `AND` operation on two numbers | -| `or()` | performs a bitwise `OR` operation on two numbers | -| `xor()` | performs a bitwise `XOR` operation on two numbers | -| `shiftedLeft()` | returns the number shifted left by a number of bits | -| `shiftedRight()` | returns the number shifted right by a number of bits | - -Thanks to @DASPRiD 👍 - -## [0.7.3](https://github.com/brick/math/releases/tag/0.7.3) - 2018-08-20 - -**New method:** `BigDecimal::hasNonZeroFractionalPart()` - -**Renamed/deprecated methods:** - -- `BigDecimal::getIntegral()` has been renamed to `getIntegralPart()` and is now deprecated -- `BigDecimal::getFraction()` has been renamed to `getFractionalPart()` and is now deprecated - -## [0.7.2](https://github.com/brick/math/releases/tag/0.7.2) - 2018-07-21 - -**Performance update** - -`BigInteger::parse()` and `toBase()` now use GMP's built-in base conversion features when available. - -## [0.7.1](https://github.com/brick/math/releases/tag/0.7.1) - 2018-03-01 - -This is a maintenance release, no code has been changed. - -- When installed with `--no-dev`, the autoloader does not autoload tests anymore -- Tests and other files unnecessary for production are excluded from the dist package - -This will help make installations more compact. - -## [0.7.0](https://github.com/brick/math/releases/tag/0.7.0) - 2017-10-02 - -Methods renamed: - -- `BigNumber:sign()` has been renamed to `getSign()` -- `BigDecimal::unscaledValue()` has been renamed to `getUnscaledValue()` -- `BigDecimal::scale()` has been renamed to `getScale()` -- `BigDecimal::integral()` has been renamed to `getIntegral()` -- `BigDecimal::fraction()` has been renamed to `getFraction()` -- `BigRational::numerator()` has been renamed to `getNumerator()` -- `BigRational::denominator()` has been renamed to `getDenominator()` - -Classes renamed: - -- `ArithmeticException` has been renamed to `MathException` - -## [0.6.2](https://github.com/brick/math/releases/tag/0.6.2) - 2017-10-02 - -The base class for all exceptions is now `MathException`. -`ArithmeticException` has been deprecated, and will be removed in 0.7.0. - -## [0.6.1](https://github.com/brick/math/releases/tag/0.6.1) - 2017-10-02 - -A number of methods have been renamed: - -- `BigNumber:sign()` is deprecated; use `getSign()` instead -- `BigDecimal::unscaledValue()` is deprecated; use `getUnscaledValue()` instead -- `BigDecimal::scale()` is deprecated; use `getScale()` instead -- `BigDecimal::integral()` is deprecated; use `getIntegral()` instead -- `BigDecimal::fraction()` is deprecated; use `getFraction()` instead -- `BigRational::numerator()` is deprecated; use `getNumerator()` instead -- `BigRational::denominator()` is deprecated; use `getDenominator()` instead - -The old methods will be removed in version 0.7.0. - -## [0.6.0](https://github.com/brick/math/releases/tag/0.6.0) - 2017-08-25 - -- Minimum PHP version is now [7.1](https://gophp71.org/); for PHP 5.6 and PHP 7.0 support, use version `0.5` -- Deprecated method `BigDecimal::withScale()` has been removed; use `toScale()` instead -- Method `BigNumber::toInteger()` has been renamed to `toInt()` - -## [0.5.4](https://github.com/brick/math/releases/tag/0.5.4) - 2016-10-17 - -`BigNumber` classes now implement [JsonSerializable](http://php.net/manual/en/class.jsonserializable.php). -The JSON output is always a string. - -## [0.5.3](https://github.com/brick/math/releases/tag/0.5.3) - 2016-03-31 - -This is a bugfix release. Dividing by a negative power of 1 with the same scale as the dividend could trigger an incorrect optimization which resulted in a wrong result. See #6. - -## [0.5.2](https://github.com/brick/math/releases/tag/0.5.2) - 2015-08-06 - -The `$scale` parameter of `BigDecimal::dividedBy()` is now optional again. - -## [0.5.1](https://github.com/brick/math/releases/tag/0.5.1) - 2015-07-05 - -**New method: `BigNumber::toScale()`** - -This allows to convert any `BigNumber` to a `BigDecimal` with a given scale, using rounding if necessary. - -## [0.5.0](https://github.com/brick/math/releases/tag/0.5.0) - 2015-07-04 - -**New features** -- Common `BigNumber` interface for all classes, with the following methods: - - `sign()` and derived methods (`isZero()`, `isPositive()`, ...) - - `compareTo()` and derived methods (`isEqualTo()`, `isGreaterThan()`, ...) that work across different `BigNumber` types - - `toBigInteger()`, `toBigDecimal()`, `toBigRational`() conversion methods - - `toInteger()` and `toFloat()` conversion methods to native types -- Unified `of()` behaviour: every class now accepts any type of number, provided that it can be safely converted to the current type -- New method: `BigDecimal::exactlyDividedBy()`; this method automatically computes the scale of the result, provided that the division yields a finite number of digits -- New methods: `BigRational::quotient()` and `remainder()` -- Fine-grained exceptions: `DivisionByZeroException`, `RoundingNecessaryException`, `NumberFormatException` -- Factory methods `zero()`, `one()` and `ten()` available in all classes -- Rounding mode reintroduced in `BigInteger::dividedBy()` - -This release also comes with many performance improvements. - ---- - -**Breaking changes** -- `BigInteger`: - - `getSign()` is renamed to `sign()` - - `toString()` is renamed to `toBase()` - - `BigInteger::dividedBy()` now throws an exception by default if the remainder is not zero; use `quotient()` to get the previous behaviour -- `BigDecimal`: - - `getSign()` is renamed to `sign()` - - `getUnscaledValue()` is renamed to `unscaledValue()` - - `getScale()` is renamed to `scale()` - - `getIntegral()` is renamed to `integral()` - - `getFraction()` is renamed to `fraction()` - - `divideAndRemainder()` is renamed to `quotientAndRemainder()` - - `dividedBy()` now takes a **mandatory** `$scale` parameter **before** the rounding mode - - `toBigInteger()` does not accept a `$roundingMode` parameter any more - - `toBigRational()` does not simplify the fraction any more; explicitly add `->simplified()` to get the previous behaviour -- `BigRational`: - - `getSign()` is renamed to `sign()` - - `getNumerator()` is renamed to `numerator()` - - `getDenominator()` is renamed to `denominator()` - - `of()` is renamed to `nd()`, while `parse()` is renamed to `of()` -- Miscellaneous: - - `ArithmeticException` is moved to an `Exception\` sub-namespace - - `of()` factory methods now throw `NumberFormatException` instead of `InvalidArgumentException` - -## [0.4.3](https://github.com/brick/math/releases/tag/0.4.3) - 2016-03-31 - -Backport of two bug fixes from the 0.5 branch: -- `BigInteger::parse()` did not always throw `InvalidArgumentException` as expected -- Dividing by a negative power of 1 with the same scale as the dividend could trigger an incorrect optimization which resulted in a wrong result. See #6. - -## [0.4.2](https://github.com/brick/math/releases/tag/0.4.2) - 2015-06-16 - -New method: `BigDecimal::stripTrailingZeros()` - -## [0.4.1](https://github.com/brick/math/releases/tag/0.4.1) - 2015-06-12 - -Introducing a `BigRational` class, to perform calculations on fractions of any size. - -## [0.4.0](https://github.com/brick/math/releases/tag/0.4.0) - 2015-06-12 - -Rounding modes have been removed from `BigInteger`, and are now a concept specific to `BigDecimal`. - -`BigInteger::dividedBy()` now always returns the quotient of the division. - -## [0.3.5](https://github.com/brick/math/releases/tag/0.3.5) - 2016-03-31 - -Backport of two bug fixes from the 0.5 branch: - -- `BigInteger::parse()` did not always throw `InvalidArgumentException` as expected -- Dividing by a negative power of 1 with the same scale as the dividend could trigger an incorrect optimization which resulted in a wrong result. See #6. - -## [0.3.4](https://github.com/brick/math/releases/tag/0.3.4) - 2015-06-11 - -New methods: -- `BigInteger::remainder()` returns the remainder of a division only -- `BigInteger::gcd()` returns the greatest common divisor of two numbers - -## [0.3.3](https://github.com/brick/math/releases/tag/0.3.3) - 2015-06-07 - -Fix `toString()` not handling negative numbers. - -## [0.3.2](https://github.com/brick/math/releases/tag/0.3.2) - 2015-06-07 - -`BigInteger` and `BigDecimal` now have a `getSign()` method that returns: -- `-1` if the number is negative -- `0` if the number is zero -- `1` if the number is positive - -## [0.3.1](https://github.com/brick/math/releases/tag/0.3.1) - 2015-06-05 - -Minor performance improvements - -## [0.3.0](https://github.com/brick/math/releases/tag/0.3.0) - 2015-06-04 - -The `$roundingMode` and `$scale` parameters have been swapped in `BigDecimal::dividedBy()`. - -## [0.2.2](https://github.com/brick/math/releases/tag/0.2.2) - 2015-06-04 - -Stronger immutability guarantee for `BigInteger` and `BigDecimal`. - -So far, it would have been possible to break immutability of these classes by calling the `unserialize()` internal function. This release fixes that. - -## [0.2.1](https://github.com/brick/math/releases/tag/0.2.1) - 2015-06-02 - -Added `BigDecimal::divideAndRemainder()` - -## [0.2.0](https://github.com/brick/math/releases/tag/0.2.0) - 2015-05-22 - -- `min()` and `max()` do not accept an `array` any more, but a variable number of parameters -- **minimum PHP version is now 5.6** -- continuous integration with PHP 7 - -## [0.1.1](https://github.com/brick/math/releases/tag/0.1.1) - 2014-09-01 - -- Added `BigInteger::power()` -- Added HHVM support - -## [0.1.0](https://github.com/brick/math/releases/tag/0.1.0) - 2014-08-31 - -First beta release. - diff --git a/vendor/brick/math/LICENSE b/vendor/brick/math/LICENSE deleted file mode 100644 index f9b724f0..00000000 --- a/vendor/brick/math/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013-present Benjamin Morel - -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/brick/math/composer.json b/vendor/brick/math/composer.json deleted file mode 100644 index a8124e92..00000000 --- a/vendor/brick/math/composer.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "brick/math", - "description": "Arbitrary-precision arithmetic library", - "type": "library", - "keywords": [ - "Brick", - "Math", - "Arbitrary-precision", - "Arithmetic", - "BigInteger", - "BigDecimal", - "BigRational", - "Bignum" - ], - "license": "MIT", - "require": { - "php": "^7.4 || ^8.0", - "ext-json": "*" - }, - "require-dev": { - "phpunit/phpunit": "^9.0", - "php-coveralls/php-coveralls": "^2.2", - "vimeo/psalm": "4.25.0" - }, - "autoload": { - "psr-4": { - "Brick\\Math\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Brick\\Math\\Tests\\": "tests/" - } - } -} diff --git a/vendor/brick/math/src/BigDecimal.php b/vendor/brick/math/src/BigDecimal.php deleted file mode 100644 index fd2babb8..00000000 --- a/vendor/brick/math/src/BigDecimal.php +++ /dev/null @@ -1,891 +0,0 @@ -value = $value; - $this->scale = $scale; - } - - /** - * Creates a BigDecimal of the given value. - * - * @param BigNumber|int|float|string $value - * - * @return BigDecimal - * - * @throws MathException If the value cannot be converted to a BigDecimal. - * - * @psalm-pure - */ - public static function of($value) : BigNumber - { - return parent::of($value)->toBigDecimal(); - } - - /** - * Creates a BigDecimal from an unscaled value and a scale. - * - * Example: `(12345, 3)` will result in the BigDecimal `12.345`. - * - * @param BigNumber|int|float|string $value The unscaled value. Must be convertible to a BigInteger. - * @param int $scale The scale of the number, positive or zero. - * - * @return BigDecimal - * - * @throws \InvalidArgumentException If the scale is negative. - * - * @psalm-pure - */ - public static function ofUnscaledValue($value, int $scale = 0) : BigDecimal - { - if ($scale < 0) { - throw new \InvalidArgumentException('The scale cannot be negative.'); - } - - return new BigDecimal((string) BigInteger::of($value), $scale); - } - - /** - * Returns a BigDecimal representing zero, with a scale of zero. - * - * @return BigDecimal - * - * @psalm-pure - */ - public static function zero() : BigDecimal - { - /** - * @psalm-suppress ImpureStaticVariable - * @var BigDecimal|null $zero - */ - static $zero; - - if ($zero === null) { - $zero = new BigDecimal('0'); - } - - return $zero; - } - - /** - * Returns a BigDecimal representing one, with a scale of zero. - * - * @return BigDecimal - * - * @psalm-pure - */ - public static function one() : BigDecimal - { - /** - * @psalm-suppress ImpureStaticVariable - * @var BigDecimal|null $one - */ - static $one; - - if ($one === null) { - $one = new BigDecimal('1'); - } - - return $one; - } - - /** - * Returns a BigDecimal representing ten, with a scale of zero. - * - * @return BigDecimal - * - * @psalm-pure - */ - public static function ten() : BigDecimal - { - /** - * @psalm-suppress ImpureStaticVariable - * @var BigDecimal|null $ten - */ - static $ten; - - if ($ten === null) { - $ten = new BigDecimal('10'); - } - - return $ten; - } - - /** - * Returns the sum of this number and the given one. - * - * The result has a scale of `max($this->scale, $that->scale)`. - * - * @param BigNumber|int|float|string $that The number to add. Must be convertible to a BigDecimal. - * - * @return BigDecimal The result. - * - * @throws MathException If the number is not valid, or is not convertible to a BigDecimal. - */ - public function plus($that) : BigDecimal - { - $that = BigDecimal::of($that); - - if ($that->value === '0' && $that->scale <= $this->scale) { - return $this; - } - - if ($this->value === '0' && $this->scale <= $that->scale) { - return $that; - } - - [$a, $b] = $this->scaleValues($this, $that); - - $value = Calculator::get()->add($a, $b); - $scale = $this->scale > $that->scale ? $this->scale : $that->scale; - - return new BigDecimal($value, $scale); - } - - /** - * Returns the difference of this number and the given one. - * - * The result has a scale of `max($this->scale, $that->scale)`. - * - * @param BigNumber|int|float|string $that The number to subtract. Must be convertible to a BigDecimal. - * - * @return BigDecimal The result. - * - * @throws MathException If the number is not valid, or is not convertible to a BigDecimal. - */ - public function minus($that) : BigDecimal - { - $that = BigDecimal::of($that); - - if ($that->value === '0' && $that->scale <= $this->scale) { - return $this; - } - - [$a, $b] = $this->scaleValues($this, $that); - - $value = Calculator::get()->sub($a, $b); - $scale = $this->scale > $that->scale ? $this->scale : $that->scale; - - return new BigDecimal($value, $scale); - } - - /** - * Returns the product of this number and the given one. - * - * The result has a scale of `$this->scale + $that->scale`. - * - * @param BigNumber|int|float|string $that The multiplier. Must be convertible to a BigDecimal. - * - * @return BigDecimal The result. - * - * @throws MathException If the multiplier is not a valid number, or is not convertible to a BigDecimal. - */ - public function multipliedBy($that) : BigDecimal - { - $that = BigDecimal::of($that); - - if ($that->value === '1' && $that->scale === 0) { - return $this; - } - - if ($this->value === '1' && $this->scale === 0) { - return $that; - } - - $value = Calculator::get()->mul($this->value, $that->value); - $scale = $this->scale + $that->scale; - - return new BigDecimal($value, $scale); - } - - /** - * Returns the result of the division of this number by the given one, at the given scale. - * - * @param BigNumber|int|float|string $that The divisor. - * @param int|null $scale The desired scale, or null to use the scale of this number. - * @param int $roundingMode An optional rounding mode. - * - * @return BigDecimal - * - * @throws \InvalidArgumentException If the scale or rounding mode is invalid. - * @throws MathException If the number is invalid, is zero, or rounding was necessary. - */ - public function dividedBy($that, ?int $scale = null, int $roundingMode = RoundingMode::UNNECESSARY) : BigDecimal - { - $that = BigDecimal::of($that); - - if ($that->isZero()) { - throw DivisionByZeroException::divisionByZero(); - } - - if ($scale === null) { - $scale = $this->scale; - } elseif ($scale < 0) { - throw new \InvalidArgumentException('Scale cannot be negative.'); - } - - if ($that->value === '1' && $that->scale === 0 && $scale === $this->scale) { - return $this; - } - - $p = $this->valueWithMinScale($that->scale + $scale); - $q = $that->valueWithMinScale($this->scale - $scale); - - $result = Calculator::get()->divRound($p, $q, $roundingMode); - - return new BigDecimal($result, $scale); - } - - /** - * Returns the exact result of the division of this number by the given one. - * - * The scale of the result is automatically calculated to fit all the fraction digits. - * - * @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigDecimal. - * - * @return BigDecimal The result. - * - * @throws MathException If the divisor is not a valid number, is not convertible to a BigDecimal, is zero, - * or the result yields an infinite number of digits. - */ - public function exactlyDividedBy($that) : BigDecimal - { - $that = BigDecimal::of($that); - - if ($that->value === '0') { - throw DivisionByZeroException::divisionByZero(); - } - - [, $b] = $this->scaleValues($this, $that); - - $d = \rtrim($b, '0'); - $scale = \strlen($b) - \strlen($d); - - $calculator = Calculator::get(); - - foreach ([5, 2] as $prime) { - for (;;) { - $lastDigit = (int) $d[-1]; - - if ($lastDigit % $prime !== 0) { - break; - } - - $d = $calculator->divQ($d, (string) $prime); - $scale++; - } - } - - return $this->dividedBy($that, $scale)->stripTrailingZeros(); - } - - /** - * Returns this number exponentiated to the given value. - * - * The result has a scale of `$this->scale * $exponent`. - * - * @param int $exponent The exponent. - * - * @return BigDecimal The result. - * - * @throws \InvalidArgumentException If the exponent is not in the range 0 to 1,000,000. - */ - public function power(int $exponent) : BigDecimal - { - if ($exponent === 0) { - return BigDecimal::one(); - } - - if ($exponent === 1) { - return $this; - } - - if ($exponent < 0 || $exponent > Calculator::MAX_POWER) { - throw new \InvalidArgumentException(\sprintf( - 'The exponent %d is not in the range 0 to %d.', - $exponent, - Calculator::MAX_POWER - )); - } - - return new BigDecimal(Calculator::get()->pow($this->value, $exponent), $this->scale * $exponent); - } - - /** - * Returns the quotient of the division of this number by this given one. - * - * The quotient has a scale of `0`. - * - * @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigDecimal. - * - * @return BigDecimal The quotient. - * - * @throws MathException If the divisor is not a valid decimal number, or is zero. - */ - public function quotient($that) : BigDecimal - { - $that = BigDecimal::of($that); - - if ($that->isZero()) { - throw DivisionByZeroException::divisionByZero(); - } - - $p = $this->valueWithMinScale($that->scale); - $q = $that->valueWithMinScale($this->scale); - - $quotient = Calculator::get()->divQ($p, $q); - - return new BigDecimal($quotient, 0); - } - - /** - * Returns the remainder of the division of this number by this given one. - * - * The remainder has a scale of `max($this->scale, $that->scale)`. - * - * @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigDecimal. - * - * @return BigDecimal The remainder. - * - * @throws MathException If the divisor is not a valid decimal number, or is zero. - */ - public function remainder($that) : BigDecimal - { - $that = BigDecimal::of($that); - - if ($that->isZero()) { - throw DivisionByZeroException::divisionByZero(); - } - - $p = $this->valueWithMinScale($that->scale); - $q = $that->valueWithMinScale($this->scale); - - $remainder = Calculator::get()->divR($p, $q); - - $scale = $this->scale > $that->scale ? $this->scale : $that->scale; - - return new BigDecimal($remainder, $scale); - } - - /** - * Returns the quotient and remainder of the division of this number by the given one. - * - * The quotient has a scale of `0`, and the remainder has a scale of `max($this->scale, $that->scale)`. - * - * @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigDecimal. - * - * @return BigDecimal[] An array containing the quotient and the remainder. - * - * @throws MathException If the divisor is not a valid decimal number, or is zero. - */ - public function quotientAndRemainder($that) : array - { - $that = BigDecimal::of($that); - - if ($that->isZero()) { - throw DivisionByZeroException::divisionByZero(); - } - - $p = $this->valueWithMinScale($that->scale); - $q = $that->valueWithMinScale($this->scale); - - [$quotient, $remainder] = Calculator::get()->divQR($p, $q); - - $scale = $this->scale > $that->scale ? $this->scale : $that->scale; - - $quotient = new BigDecimal($quotient, 0); - $remainder = new BigDecimal($remainder, $scale); - - return [$quotient, $remainder]; - } - - /** - * Returns the square root of this number, rounded down to the given number of decimals. - * - * @param int $scale - * - * @return BigDecimal - * - * @throws \InvalidArgumentException If the scale is negative. - * @throws NegativeNumberException If this number is negative. - */ - public function sqrt(int $scale) : BigDecimal - { - if ($scale < 0) { - throw new \InvalidArgumentException('Scale cannot be negative.'); - } - - if ($this->value === '0') { - return new BigDecimal('0', $scale); - } - - if ($this->value[0] === '-') { - throw new NegativeNumberException('Cannot calculate the square root of a negative number.'); - } - - $value = $this->value; - $addDigits = 2 * $scale - $this->scale; - - if ($addDigits > 0) { - // add zeros - $value .= \str_repeat('0', $addDigits); - } elseif ($addDigits < 0) { - // trim digits - if (-$addDigits >= \strlen($this->value)) { - // requesting a scale too low, will always yield a zero result - return new BigDecimal('0', $scale); - } - - $value = \substr($value, 0, $addDigits); - } - - $value = Calculator::get()->sqrt($value); - - return new BigDecimal($value, $scale); - } - - /** - * Returns a copy of this BigDecimal with the decimal point moved $n places to the left. - * - * @param int $n - * - * @return BigDecimal - */ - public function withPointMovedLeft(int $n) : BigDecimal - { - if ($n === 0) { - return $this; - } - - if ($n < 0) { - return $this->withPointMovedRight(-$n); - } - - return new BigDecimal($this->value, $this->scale + $n); - } - - /** - * Returns a copy of this BigDecimal with the decimal point moved $n places to the right. - * - * @param int $n - * - * @return BigDecimal - */ - public function withPointMovedRight(int $n) : BigDecimal - { - if ($n === 0) { - return $this; - } - - if ($n < 0) { - return $this->withPointMovedLeft(-$n); - } - - $value = $this->value; - $scale = $this->scale - $n; - - if ($scale < 0) { - if ($value !== '0') { - $value .= \str_repeat('0', -$scale); - } - $scale = 0; - } - - return new BigDecimal($value, $scale); - } - - /** - * Returns a copy of this BigDecimal with any trailing zeros removed from the fractional part. - * - * @return BigDecimal - */ - public function stripTrailingZeros() : BigDecimal - { - if ($this->scale === 0) { - return $this; - } - - $trimmedValue = \rtrim($this->value, '0'); - - if ($trimmedValue === '') { - return BigDecimal::zero(); - } - - $trimmableZeros = \strlen($this->value) - \strlen($trimmedValue); - - if ($trimmableZeros === 0) { - return $this; - } - - if ($trimmableZeros > $this->scale) { - $trimmableZeros = $this->scale; - } - - $value = \substr($this->value, 0, -$trimmableZeros); - $scale = $this->scale - $trimmableZeros; - - return new BigDecimal($value, $scale); - } - - /** - * Returns the absolute value of this number. - * - * @return BigDecimal - */ - public function abs() : BigDecimal - { - return $this->isNegative() ? $this->negated() : $this; - } - - /** - * Returns the negated value of this number. - * - * @return BigDecimal - */ - public function negated() : BigDecimal - { - return new BigDecimal(Calculator::get()->neg($this->value), $this->scale); - } - - /** - * {@inheritdoc} - */ - public function compareTo($that) : int - { - $that = BigNumber::of($that); - - if ($that instanceof BigInteger) { - $that = $that->toBigDecimal(); - } - - if ($that instanceof BigDecimal) { - [$a, $b] = $this->scaleValues($this, $that); - - return Calculator::get()->cmp($a, $b); - } - - return - $that->compareTo($this); - } - - /** - * {@inheritdoc} - */ - public function getSign() : int - { - return ($this->value === '0') ? 0 : (($this->value[0] === '-') ? -1 : 1); - } - - /** - * @return BigInteger - */ - public function getUnscaledValue() : BigInteger - { - return BigInteger::create($this->value); - } - - /** - * @return int - */ - public function getScale() : int - { - return $this->scale; - } - - /** - * Returns a string representing the integral part of this decimal number. - * - * Example: `-123.456` => `-123`. - * - * @return string - */ - public function getIntegralPart() : string - { - if ($this->scale === 0) { - return $this->value; - } - - $value = $this->getUnscaledValueWithLeadingZeros(); - - return \substr($value, 0, -$this->scale); - } - - /** - * Returns a string representing the fractional part of this decimal number. - * - * If the scale is zero, an empty string is returned. - * - * Examples: `-123.456` => '456', `123` => ''. - * - * @return string - */ - public function getFractionalPart() : string - { - if ($this->scale === 0) { - return ''; - } - - $value = $this->getUnscaledValueWithLeadingZeros(); - - return \substr($value, -$this->scale); - } - - /** - * Returns whether this decimal number has a non-zero fractional part. - * - * @return bool - */ - public function hasNonZeroFractionalPart() : bool - { - return $this->getFractionalPart() !== \str_repeat('0', $this->scale); - } - - /** - * {@inheritdoc} - */ - public function toBigInteger() : BigInteger - { - $zeroScaleDecimal = $this->scale === 0 ? $this : $this->dividedBy(1, 0); - - return BigInteger::create($zeroScaleDecimal->value); - } - - /** - * {@inheritdoc} - */ - public function toBigDecimal() : BigDecimal - { - return $this; - } - - /** - * {@inheritdoc} - */ - public function toBigRational() : BigRational - { - $numerator = BigInteger::create($this->value); - $denominator = BigInteger::create('1' . \str_repeat('0', $this->scale)); - - return BigRational::create($numerator, $denominator, false); - } - - /** - * {@inheritdoc} - */ - public function toScale(int $scale, int $roundingMode = RoundingMode::UNNECESSARY) : BigDecimal - { - if ($scale === $this->scale) { - return $this; - } - - return $this->dividedBy(BigDecimal::one(), $scale, $roundingMode); - } - - /** - * {@inheritdoc} - */ - public function toInt() : int - { - return $this->toBigInteger()->toInt(); - } - - /** - * {@inheritdoc} - */ - public function toFloat() : float - { - return (float) (string) $this; - } - - /** - * {@inheritdoc} - */ - public function __toString() : string - { - if ($this->scale === 0) { - return $this->value; - } - - $value = $this->getUnscaledValueWithLeadingZeros(); - - return \substr($value, 0, -$this->scale) . '.' . \substr($value, -$this->scale); - } - - /** - * This method is required for serializing the object and SHOULD NOT be accessed directly. - * - * @internal - * - * @return array{value: string, scale: int} - */ - public function __serialize(): array - { - return ['value' => $this->value, 'scale' => $this->scale]; - } - - /** - * This method is only here to allow unserializing the object and cannot be accessed directly. - * - * @internal - * @psalm-suppress RedundantPropertyInitializationCheck - * - * @param array{value: string, scale: int} $data - * - * @return void - * - * @throws \LogicException - */ - public function __unserialize(array $data): void - { - if (isset($this->value)) { - throw new \LogicException('__unserialize() is an internal function, it must not be called directly.'); - } - - $this->value = $data['value']; - $this->scale = $data['scale']; - } - - /** - * This method is required by interface Serializable and SHOULD NOT be accessed directly. - * - * @internal - * - * @return string - */ - public function serialize() : string - { - return $this->value . ':' . $this->scale; - } - - /** - * This method is only here to implement interface Serializable and cannot be accessed directly. - * - * @internal - * @psalm-suppress RedundantPropertyInitializationCheck - * - * @param string $value - * - * @return void - * - * @throws \LogicException - */ - public function unserialize($value) : void - { - if (isset($this->value)) { - throw new \LogicException('unserialize() is an internal function, it must not be called directly.'); - } - - [$value, $scale] = \explode(':', $value); - - $this->value = $value; - $this->scale = (int) $scale; - } - - /** - * Puts the internal values of the given decimal numbers on the same scale. - * - * @param BigDecimal $x The first decimal number. - * @param BigDecimal $y The second decimal number. - * - * @return array{string, string} The scaled integer values of $x and $y. - */ - private function scaleValues(BigDecimal $x, BigDecimal $y) : array - { - $a = $x->value; - $b = $y->value; - - if ($b !== '0' && $x->scale > $y->scale) { - $b .= \str_repeat('0', $x->scale - $y->scale); - } elseif ($a !== '0' && $x->scale < $y->scale) { - $a .= \str_repeat('0', $y->scale - $x->scale); - } - - return [$a, $b]; - } - - /** - * @param int $scale - * - * @return string - */ - private function valueWithMinScale(int $scale) : string - { - $value = $this->value; - - if ($this->value !== '0' && $scale > $this->scale) { - $value .= \str_repeat('0', $scale - $this->scale); - } - - return $value; - } - - /** - * Adds leading zeros if necessary to the unscaled value to represent the full decimal number. - * - * @return string - */ - private function getUnscaledValueWithLeadingZeros() : string - { - $value = $this->value; - $targetLength = $this->scale + 1; - $negative = ($value[0] === '-'); - $length = \strlen($value); - - if ($negative) { - $length--; - } - - if ($length >= $targetLength) { - return $this->value; - } - - if ($negative) { - $value = \substr($value, 1); - } - - $value = \str_pad($value, $targetLength, '0', STR_PAD_LEFT); - - if ($negative) { - $value = '-' . $value; - } - - return $value; - } -} diff --git a/vendor/brick/math/src/BigInteger.php b/vendor/brick/math/src/BigInteger.php deleted file mode 100644 index f58e1c59..00000000 --- a/vendor/brick/math/src/BigInteger.php +++ /dev/null @@ -1,1197 +0,0 @@ -value = $value; - } - - /** - * Creates a BigInteger of the given value. - * - * @param BigNumber|int|float|string $value - * - * @return BigInteger - * - * @throws MathException If the value cannot be converted to a BigInteger. - * - * @psalm-pure - */ - public static function of($value) : BigNumber - { - return parent::of($value)->toBigInteger(); - } - - /** - * Creates a number from a string in a given base. - * - * The string can optionally be prefixed with the `+` or `-` sign. - * - * Bases greater than 36 are not supported by this method, as there is no clear consensus on which of the lowercase - * or uppercase characters should come first. Instead, this method accepts any base up to 36, and does not - * differentiate lowercase and uppercase characters, which are considered equal. - * - * For bases greater than 36, and/or custom alphabets, use the fromArbitraryBase() method. - * - * @param string $number The number to convert, in the given base. - * @param int $base The base of the number, between 2 and 36. - * - * @return BigInteger - * - * @throws NumberFormatException If the number is empty, or contains invalid chars for the given base. - * @throws \InvalidArgumentException If the base is out of range. - * - * @psalm-pure - */ - public static function fromBase(string $number, int $base) : BigInteger - { - if ($number === '') { - throw new NumberFormatException('The number cannot be empty.'); - } - - if ($base < 2 || $base > 36) { - throw new \InvalidArgumentException(\sprintf('Base %d is not in range 2 to 36.', $base)); - } - - if ($number[0] === '-') { - $sign = '-'; - $number = \substr($number, 1); - } elseif ($number[0] === '+') { - $sign = ''; - $number = \substr($number, 1); - } else { - $sign = ''; - } - - if ($number === '') { - throw new NumberFormatException('The number cannot be empty.'); - } - - $number = \ltrim($number, '0'); - - if ($number === '') { - // The result will be the same in any base, avoid further calculation. - return BigInteger::zero(); - } - - if ($number === '1') { - // The result will be the same in any base, avoid further calculation. - return new BigInteger($sign . '1'); - } - - $pattern = '/[^' . \substr(Calculator::ALPHABET, 0, $base) . ']/'; - - if (\preg_match($pattern, \strtolower($number), $matches) === 1) { - throw new NumberFormatException(\sprintf('"%s" is not a valid character in base %d.', $matches[0], $base)); - } - - if ($base === 10) { - // The number is usable as is, avoid further calculation. - return new BigInteger($sign . $number); - } - - $result = Calculator::get()->fromBase($number, $base); - - return new BigInteger($sign . $result); - } - - /** - * Parses a string containing an integer in an arbitrary base, using a custom alphabet. - * - * Because this method accepts an alphabet with any character, including dash, it does not handle negative numbers. - * - * @param string $number The number to parse. - * @param string $alphabet The alphabet, for example '01' for base 2, or '01234567' for base 8. - * - * @return BigInteger - * - * @throws NumberFormatException If the given number is empty or contains invalid chars for the given alphabet. - * @throws \InvalidArgumentException If the alphabet does not contain at least 2 chars. - * - * @psalm-pure - */ - public static function fromArbitraryBase(string $number, string $alphabet) : BigInteger - { - if ($number === '') { - throw new NumberFormatException('The number cannot be empty.'); - } - - $base = \strlen($alphabet); - - if ($base < 2) { - throw new \InvalidArgumentException('The alphabet must contain at least 2 chars.'); - } - - $pattern = '/[^' . \preg_quote($alphabet, '/') . ']/'; - - if (\preg_match($pattern, $number, $matches) === 1) { - throw NumberFormatException::charNotInAlphabet($matches[0]); - } - - $number = Calculator::get()->fromArbitraryBase($number, $alphabet, $base); - - return new BigInteger($number); - } - - /** - * Translates a string of bytes containing the binary representation of a BigInteger into a BigInteger. - * - * The input string is assumed to be in big-endian byte-order: the most significant byte is in the zeroth element. - * - * If `$signed` is true, the input is assumed to be in two's-complement representation, and the leading bit is - * interpreted as a sign bit. If `$signed` is false, the input is interpreted as an unsigned number, and the - * resulting BigInteger will always be positive or zero. - * - * This method can be used to retrieve a number exported by `toBytes()`, as long as the `$signed` flags match. - * - * @param string $value The byte string. - * @param bool $signed Whether to interpret as a signed number in two's-complement representation with a leading - * sign bit. - * - * @return BigInteger - * - * @throws NumberFormatException If the string is empty. - */ - public static function fromBytes(string $value, bool $signed = true) : BigInteger - { - if ($value === '') { - throw new NumberFormatException('The byte string must not be empty.'); - } - - $twosComplement = false; - - if ($signed) { - $x = \ord($value[0]); - - if (($twosComplement = ($x >= 0x80))) { - $value = ~$value; - } - } - - $number = self::fromBase(\bin2hex($value), 16); - - if ($twosComplement) { - return $number->plus(1)->negated(); - } - - return $number; - } - - /** - * Generates a pseudo-random number in the range 0 to 2^numBits - 1. - * - * Using the default random bytes generator, this method is suitable for cryptographic use. - * - * @psalm-param callable(int): string $randomBytesGenerator - * - * @param int $numBits The number of bits. - * @param callable|null $randomBytesGenerator A function that accepts a number of bytes as an integer, and returns a - * string of random bytes of the given length. Defaults to the - * `random_bytes()` function. - * - * @return BigInteger - * - * @throws \InvalidArgumentException If $numBits is negative. - */ - public static function randomBits(int $numBits, ?callable $randomBytesGenerator = null) : BigInteger - { - if ($numBits < 0) { - throw new \InvalidArgumentException('The number of bits cannot be negative.'); - } - - if ($numBits === 0) { - return BigInteger::zero(); - } - - if ($randomBytesGenerator === null) { - $randomBytesGenerator = 'random_bytes'; - } - - $byteLength = \intdiv($numBits - 1, 8) + 1; - - $extraBits = ($byteLength * 8 - $numBits); - $bitmask = \chr(0xFF >> $extraBits); - - $randomBytes = $randomBytesGenerator($byteLength); - $randomBytes[0] = $randomBytes[0] & $bitmask; - - return self::fromBytes($randomBytes, false); - } - - /** - * Generates a pseudo-random number between `$min` and `$max`. - * - * Using the default random bytes generator, this method is suitable for cryptographic use. - * - * @psalm-param (callable(int): string)|null $randomBytesGenerator - * - * @param BigNumber|int|float|string $min The lower bound. Must be convertible to a BigInteger. - * @param BigNumber|int|float|string $max The upper bound. Must be convertible to a BigInteger. - * @param callable|null $randomBytesGenerator A function that accepts a number of bytes as an integer, - * and returns a string of random bytes of the given length. - * Defaults to the `random_bytes()` function. - * - * @return BigInteger - * - * @throws MathException If one of the parameters cannot be converted to a BigInteger, - * or `$min` is greater than `$max`. - */ - public static function randomRange($min, $max, ?callable $randomBytesGenerator = null) : BigInteger - { - $min = BigInteger::of($min); - $max = BigInteger::of($max); - - if ($min->isGreaterThan($max)) { - throw new MathException('$min cannot be greater than $max.'); - } - - if ($min->isEqualTo($max)) { - return $min; - } - - $diff = $max->minus($min); - $bitLength = $diff->getBitLength(); - - // try until the number is in range (50% to 100% chance of success) - do { - $randomNumber = self::randomBits($bitLength, $randomBytesGenerator); - } while ($randomNumber->isGreaterThan($diff)); - - return $randomNumber->plus($min); - } - - /** - * Returns a BigInteger representing zero. - * - * @return BigInteger - * - * @psalm-pure - */ - public static function zero() : BigInteger - { - /** - * @psalm-suppress ImpureStaticVariable - * @var BigInteger|null $zero - */ - static $zero; - - if ($zero === null) { - $zero = new BigInteger('0'); - } - - return $zero; - } - - /** - * Returns a BigInteger representing one. - * - * @return BigInteger - * - * @psalm-pure - */ - public static function one() : BigInteger - { - /** - * @psalm-suppress ImpureStaticVariable - * @var BigInteger|null $one - */ - static $one; - - if ($one === null) { - $one = new BigInteger('1'); - } - - return $one; - } - - /** - * Returns a BigInteger representing ten. - * - * @return BigInteger - * - * @psalm-pure - */ - public static function ten() : BigInteger - { - /** - * @psalm-suppress ImpureStaticVariable - * @var BigInteger|null $ten - */ - static $ten; - - if ($ten === null) { - $ten = new BigInteger('10'); - } - - return $ten; - } - - public static function gcdMultiple(BigInteger $a, BigInteger ...$n): BigInteger - { - $result = $a; - - foreach ($n as $next) { - $result = $result->gcd($next); - - if ($result->isEqualTo(1)) { - return $result; - } - } - - return $result; - } - - /** - * Returns the sum of this number and the given one. - * - * @param BigNumber|int|float|string $that The number to add. Must be convertible to a BigInteger. - * - * @return BigInteger The result. - * - * @throws MathException If the number is not valid, or is not convertible to a BigInteger. - */ - public function plus($that) : BigInteger - { - $that = BigInteger::of($that); - - if ($that->value === '0') { - return $this; - } - - if ($this->value === '0') { - return $that; - } - - $value = Calculator::get()->add($this->value, $that->value); - - return new BigInteger($value); - } - - /** - * Returns the difference of this number and the given one. - * - * @param BigNumber|int|float|string $that The number to subtract. Must be convertible to a BigInteger. - * - * @return BigInteger The result. - * - * @throws MathException If the number is not valid, or is not convertible to a BigInteger. - */ - public function minus($that) : BigInteger - { - $that = BigInteger::of($that); - - if ($that->value === '0') { - return $this; - } - - $value = Calculator::get()->sub($this->value, $that->value); - - return new BigInteger($value); - } - - /** - * Returns the product of this number and the given one. - * - * @param BigNumber|int|float|string $that The multiplier. Must be convertible to a BigInteger. - * - * @return BigInteger The result. - * - * @throws MathException If the multiplier is not a valid number, or is not convertible to a BigInteger. - */ - public function multipliedBy($that) : BigInteger - { - $that = BigInteger::of($that); - - if ($that->value === '1') { - return $this; - } - - if ($this->value === '1') { - return $that; - } - - $value = Calculator::get()->mul($this->value, $that->value); - - return new BigInteger($value); - } - - /** - * Returns the result of the division of this number by the given one. - * - * @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigInteger. - * @param int $roundingMode An optional rounding mode. - * - * @return BigInteger The result. - * - * @throws MathException If the divisor is not a valid number, is not convertible to a BigInteger, is zero, - * or RoundingMode::UNNECESSARY is used and the remainder is not zero. - */ - public function dividedBy($that, int $roundingMode = RoundingMode::UNNECESSARY) : BigInteger - { - $that = BigInteger::of($that); - - if ($that->value === '1') { - return $this; - } - - if ($that->value === '0') { - throw DivisionByZeroException::divisionByZero(); - } - - $result = Calculator::get()->divRound($this->value, $that->value, $roundingMode); - - return new BigInteger($result); - } - - /** - * Returns this number exponentiated to the given value. - * - * @param int $exponent The exponent. - * - * @return BigInteger The result. - * - * @throws \InvalidArgumentException If the exponent is not in the range 0 to 1,000,000. - */ - public function power(int $exponent) : BigInteger - { - if ($exponent === 0) { - return BigInteger::one(); - } - - if ($exponent === 1) { - return $this; - } - - if ($exponent < 0 || $exponent > Calculator::MAX_POWER) { - throw new \InvalidArgumentException(\sprintf( - 'The exponent %d is not in the range 0 to %d.', - $exponent, - Calculator::MAX_POWER - )); - } - - return new BigInteger(Calculator::get()->pow($this->value, $exponent)); - } - - /** - * Returns the quotient of the division of this number by the given one. - * - * @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigInteger. - * - * @return BigInteger - * - * @throws DivisionByZeroException If the divisor is zero. - */ - public function quotient($that) : BigInteger - { - $that = BigInteger::of($that); - - if ($that->value === '1') { - return $this; - } - - if ($that->value === '0') { - throw DivisionByZeroException::divisionByZero(); - } - - $quotient = Calculator::get()->divQ($this->value, $that->value); - - return new BigInteger($quotient); - } - - /** - * Returns the remainder of the division of this number by the given one. - * - * The remainder, when non-zero, has the same sign as the dividend. - * - * @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigInteger. - * - * @return BigInteger - * - * @throws DivisionByZeroException If the divisor is zero. - */ - public function remainder($that) : BigInteger - { - $that = BigInteger::of($that); - - if ($that->value === '1') { - return BigInteger::zero(); - } - - if ($that->value === '0') { - throw DivisionByZeroException::divisionByZero(); - } - - $remainder = Calculator::get()->divR($this->value, $that->value); - - return new BigInteger($remainder); - } - - /** - * Returns the quotient and remainder of the division of this number by the given one. - * - * @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigInteger. - * - * @return BigInteger[] An array containing the quotient and the remainder. - * - * @throws DivisionByZeroException If the divisor is zero. - */ - public function quotientAndRemainder($that) : array - { - $that = BigInteger::of($that); - - if ($that->value === '0') { - throw DivisionByZeroException::divisionByZero(); - } - - [$quotient, $remainder] = Calculator::get()->divQR($this->value, $that->value); - - return [ - new BigInteger($quotient), - new BigInteger($remainder) - ]; - } - - /** - * Returns the modulo of this number and the given one. - * - * The modulo operation yields the same result as the remainder operation when both operands are of the same sign, - * and may differ when signs are different. - * - * The result of the modulo operation, when non-zero, has the same sign as the divisor. - * - * @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigInteger. - * - * @return BigInteger - * - * @throws DivisionByZeroException If the divisor is zero. - */ - public function mod($that) : BigInteger - { - $that = BigInteger::of($that); - - if ($that->value === '0') { - throw DivisionByZeroException::modulusMustNotBeZero(); - } - - $value = Calculator::get()->mod($this->value, $that->value); - - return new BigInteger($value); - } - - /** - * Returns the modular multiplicative inverse of this BigInteger modulo $m. - * - * @param BigInteger $m - * - * @return BigInteger - * - * @throws DivisionByZeroException If $m is zero. - * @throws NegativeNumberException If $m is negative. - * @throws MathException If this BigInteger has no multiplicative inverse mod m (that is, this BigInteger - * is not relatively prime to m). - */ - public function modInverse(BigInteger $m) : BigInteger - { - if ($m->value === '0') { - throw DivisionByZeroException::modulusMustNotBeZero(); - } - - if ($m->isNegative()) { - throw new NegativeNumberException('Modulus must not be negative.'); - } - - if ($m->value === '1') { - return BigInteger::zero(); - } - - $value = Calculator::get()->modInverse($this->value, $m->value); - - if ($value === null) { - throw new MathException('Unable to compute the modInverse for the given modulus.'); - } - - return new BigInteger($value); - } - - /** - * Returns this number raised into power with modulo. - * - * This operation only works on positive numbers. - * - * @param BigNumber|int|float|string $exp The exponent. Must be positive or zero. - * @param BigNumber|int|float|string $mod The modulus. Must be strictly positive. - * - * @return BigInteger - * - * @throws NegativeNumberException If any of the operands is negative. - * @throws DivisionByZeroException If the modulus is zero. - */ - public function modPow($exp, $mod) : BigInteger - { - $exp = BigInteger::of($exp); - $mod = BigInteger::of($mod); - - if ($this->isNegative() || $exp->isNegative() || $mod->isNegative()) { - throw new NegativeNumberException('The operands cannot be negative.'); - } - - if ($mod->isZero()) { - throw DivisionByZeroException::modulusMustNotBeZero(); - } - - $result = Calculator::get()->modPow($this->value, $exp->value, $mod->value); - - return new BigInteger($result); - } - - /** - * Returns the greatest common divisor of this number and the given one. - * - * The GCD is always positive, unless both operands are zero, in which case it is zero. - * - * @param BigNumber|int|float|string $that The operand. Must be convertible to an integer number. - * - * @return BigInteger - */ - public function gcd($that) : BigInteger - { - $that = BigInteger::of($that); - - if ($that->value === '0' && $this->value[0] !== '-') { - return $this; - } - - if ($this->value === '0' && $that->value[0] !== '-') { - return $that; - } - - $value = Calculator::get()->gcd($this->value, $that->value); - - return new BigInteger($value); - } - - /** - * Returns the integer square root number of this number, rounded down. - * - * The result is the largest x such that x² ≤ n. - * - * @return BigInteger - * - * @throws NegativeNumberException If this number is negative. - */ - public function sqrt() : BigInteger - { - if ($this->value[0] === '-') { - throw new NegativeNumberException('Cannot calculate the square root of a negative number.'); - } - - $value = Calculator::get()->sqrt($this->value); - - return new BigInteger($value); - } - - /** - * Returns the absolute value of this number. - * - * @return BigInteger - */ - public function abs() : BigInteger - { - return $this->isNegative() ? $this->negated() : $this; - } - - /** - * Returns the inverse of this number. - * - * @return BigInteger - */ - public function negated() : BigInteger - { - return new BigInteger(Calculator::get()->neg($this->value)); - } - - /** - * Returns the integer bitwise-and combined with another integer. - * - * This method returns a negative BigInteger if and only if both operands are negative. - * - * @param BigNumber|int|float|string $that The operand. Must be convertible to an integer number. - * - * @return BigInteger - */ - public function and($that) : BigInteger - { - $that = BigInteger::of($that); - - return new BigInteger(Calculator::get()->and($this->value, $that->value)); - } - - /** - * Returns the integer bitwise-or combined with another integer. - * - * This method returns a negative BigInteger if and only if either of the operands is negative. - * - * @param BigNumber|int|float|string $that The operand. Must be convertible to an integer number. - * - * @return BigInteger - */ - public function or($that) : BigInteger - { - $that = BigInteger::of($that); - - return new BigInteger(Calculator::get()->or($this->value, $that->value)); - } - - /** - * Returns the integer bitwise-xor combined with another integer. - * - * This method returns a negative BigInteger if and only if exactly one of the operands is negative. - * - * @param BigNumber|int|float|string $that The operand. Must be convertible to an integer number. - * - * @return BigInteger - */ - public function xor($that) : BigInteger - { - $that = BigInteger::of($that); - - return new BigInteger(Calculator::get()->xor($this->value, $that->value)); - } - - /** - * Returns the bitwise-not of this BigInteger. - * - * @return BigInteger - */ - public function not() : BigInteger - { - return $this->negated()->minus(1); - } - - /** - * Returns the integer left shifted by a given number of bits. - * - * @param int $distance The distance to shift. - * - * @return BigInteger - */ - public function shiftedLeft(int $distance) : BigInteger - { - if ($distance === 0) { - return $this; - } - - if ($distance < 0) { - return $this->shiftedRight(- $distance); - } - - return $this->multipliedBy(BigInteger::of(2)->power($distance)); - } - - /** - * Returns the integer right shifted by a given number of bits. - * - * @param int $distance The distance to shift. - * - * @return BigInteger - */ - public function shiftedRight(int $distance) : BigInteger - { - if ($distance === 0) { - return $this; - } - - if ($distance < 0) { - return $this->shiftedLeft(- $distance); - } - - $operand = BigInteger::of(2)->power($distance); - - if ($this->isPositiveOrZero()) { - return $this->quotient($operand); - } - - return $this->dividedBy($operand, RoundingMode::UP); - } - - /** - * Returns the number of bits in the minimal two's-complement representation of this BigInteger, excluding a sign bit. - * - * For positive BigIntegers, this is equivalent to the number of bits in the ordinary binary representation. - * Computes (ceil(log2(this < 0 ? -this : this+1))). - * - * @return int - */ - public function getBitLength() : int - { - if ($this->value === '0') { - return 0; - } - - if ($this->isNegative()) { - return $this->abs()->minus(1)->getBitLength(); - } - - return \strlen($this->toBase(2)); - } - - /** - * Returns the index of the rightmost (lowest-order) one bit in this BigInteger. - * - * Returns -1 if this BigInteger contains no one bits. - * - * @return int - */ - public function getLowestSetBit() : int - { - $n = $this; - $bitLength = $this->getBitLength(); - - for ($i = 0; $i <= $bitLength; $i++) { - if ($n->isOdd()) { - return $i; - } - - $n = $n->shiftedRight(1); - } - - return -1; - } - - /** - * Returns whether this number is even. - * - * @return bool - */ - public function isEven() : bool - { - return \in_array($this->value[-1], ['0', '2', '4', '6', '8'], true); - } - - /** - * Returns whether this number is odd. - * - * @return bool - */ - public function isOdd() : bool - { - return \in_array($this->value[-1], ['1', '3', '5', '7', '9'], true); - } - - /** - * Returns true if and only if the designated bit is set. - * - * Computes ((this & (1<shiftedRight($n)->isOdd(); - } - - /** - * {@inheritdoc} - */ - public function compareTo($that) : int - { - $that = BigNumber::of($that); - - if ($that instanceof BigInteger) { - return Calculator::get()->cmp($this->value, $that->value); - } - - return - $that->compareTo($this); - } - - /** - * {@inheritdoc} - */ - public function getSign() : int - { - return ($this->value === '0') ? 0 : (($this->value[0] === '-') ? -1 : 1); - } - - /** - * {@inheritdoc} - */ - public function toBigInteger() : BigInteger - { - return $this; - } - - /** - * {@inheritdoc} - */ - public function toBigDecimal() : BigDecimal - { - return BigDecimal::create($this->value); - } - - /** - * {@inheritdoc} - */ - public function toBigRational() : BigRational - { - return BigRational::create($this, BigInteger::one(), false); - } - - /** - * {@inheritdoc} - */ - public function toScale(int $scale, int $roundingMode = RoundingMode::UNNECESSARY) : BigDecimal - { - return $this->toBigDecimal()->toScale($scale, $roundingMode); - } - - /** - * {@inheritdoc} - */ - public function toInt() : int - { - $intValue = (int) $this->value; - - if ($this->value !== (string) $intValue) { - throw IntegerOverflowException::toIntOverflow($this); - } - - return $intValue; - } - - /** - * {@inheritdoc} - */ - public function toFloat() : float - { - return (float) $this->value; - } - - /** - * Returns a string representation of this number in the given base. - * - * The output will always be lowercase for bases greater than 10. - * - * @param int $base - * - * @return string - * - * @throws \InvalidArgumentException If the base is out of range. - */ - public function toBase(int $base) : string - { - if ($base === 10) { - return $this->value; - } - - if ($base < 2 || $base > 36) { - throw new \InvalidArgumentException(\sprintf('Base %d is out of range [2, 36]', $base)); - } - - return Calculator::get()->toBase($this->value, $base); - } - - /** - * Returns a string representation of this number in an arbitrary base with a custom alphabet. - * - * Because this method accepts an alphabet with any character, including dash, it does not handle negative numbers; - * a NegativeNumberException will be thrown when attempting to call this method on a negative number. - * - * @param string $alphabet The alphabet, for example '01' for base 2, or '01234567' for base 8. - * - * @return string - * - * @throws NegativeNumberException If this number is negative. - * @throws \InvalidArgumentException If the given alphabet does not contain at least 2 chars. - */ - public function toArbitraryBase(string $alphabet) : string - { - $base = \strlen($alphabet); - - if ($base < 2) { - throw new \InvalidArgumentException('The alphabet must contain at least 2 chars.'); - } - - if ($this->value[0] === '-') { - throw new NegativeNumberException(__FUNCTION__ . '() does not support negative numbers.'); - } - - return Calculator::get()->toArbitraryBase($this->value, $alphabet, $base); - } - - /** - * Returns a string of bytes containing the binary representation of this BigInteger. - * - * The string is in big-endian byte-order: the most significant byte is in the zeroth element. - * - * If `$signed` is true, the output will be in two's-complement representation, and a sign bit will be prepended to - * the output. If `$signed` is false, no sign bit will be prepended, and this method will throw an exception if the - * number is negative. - * - * The string will contain the minimum number of bytes required to represent this BigInteger, including a sign bit - * if `$signed` is true. - * - * This representation is compatible with the `fromBytes()` factory method, as long as the `$signed` flags match. - * - * @param bool $signed Whether to output a signed number in two's-complement representation with a leading sign bit. - * - * @return string - * - * @throws NegativeNumberException If $signed is false, and the number is negative. - */ - public function toBytes(bool $signed = true) : string - { - if (! $signed && $this->isNegative()) { - throw new NegativeNumberException('Cannot convert a negative number to a byte string when $signed is false.'); - } - - $hex = $this->abs()->toBase(16); - - if (\strlen($hex) % 2 !== 0) { - $hex = '0' . $hex; - } - - $baseHexLength = \strlen($hex); - - if ($signed) { - if ($this->isNegative()) { - $bin = \hex2bin($hex); - assert($bin !== false); - - $hex = \bin2hex(~$bin); - $hex = self::fromBase($hex, 16)->plus(1)->toBase(16); - - $hexLength = \strlen($hex); - - if ($hexLength < $baseHexLength) { - $hex = \str_repeat('0', $baseHexLength - $hexLength) . $hex; - } - - if ($hex[0] < '8') { - $hex = 'FF' . $hex; - } - } else { - if ($hex[0] >= '8') { - $hex = '00' . $hex; - } - } - } - - return \hex2bin($hex); - } - - /** - * {@inheritdoc} - */ - public function __toString() : string - { - return $this->value; - } - - /** - * This method is required for serializing the object and SHOULD NOT be accessed directly. - * - * @internal - * - * @return array{value: string} - */ - public function __serialize(): array - { - return ['value' => $this->value]; - } - - /** - * This method is only here to allow unserializing the object and cannot be accessed directly. - * - * @internal - * @psalm-suppress RedundantPropertyInitializationCheck - * - * @param array{value: string} $data - * - * @return void - * - * @throws \LogicException - */ - public function __unserialize(array $data): void - { - if (isset($this->value)) { - throw new \LogicException('__unserialize() is an internal function, it must not be called directly.'); - } - - $this->value = $data['value']; - } - - /** - * This method is required by interface Serializable and SHOULD NOT be accessed directly. - * - * @internal - * - * @return string - */ - public function serialize() : string - { - return $this->value; - } - - /** - * This method is only here to implement interface Serializable and cannot be accessed directly. - * - * @internal - * @psalm-suppress RedundantPropertyInitializationCheck - * - * @param string $value - * - * @return void - * - * @throws \LogicException - */ - public function unserialize($value) : void - { - if (isset($this->value)) { - throw new \LogicException('unserialize() is an internal function, it must not be called directly.'); - } - - $this->value = $value; - } -} diff --git a/vendor/brick/math/src/BigNumber.php b/vendor/brick/math/src/BigNumber.php deleted file mode 100644 index 44f26e35..00000000 --- a/vendor/brick/math/src/BigNumber.php +++ /dev/null @@ -1,570 +0,0 @@ -[\-\+])?' . - '(?:' . - '(?:' . - '(?[0-9]+)?' . - '(?\.)?' . - '(?[0-9]+)?' . - '(?:[eE](?[\-\+]?[0-9]+))?' . - ')|(?:' . - '(?[0-9]+)' . - '\/?' . - '(?[0-9]+)' . - ')' . - ')' . - '$/'; - - /** - * Creates a BigNumber of the given value. - * - * The concrete return type is dependent on the given value, with the following rules: - * - * - BigNumber instances are returned as is - * - integer numbers are returned as BigInteger - * - floating point numbers are converted to a string then parsed as such - * - strings containing a `/` character are returned as BigRational - * - strings containing a `.` character or using an exponential notation are returned as BigDecimal - * - strings containing only digits with an optional leading `+` or `-` sign are returned as BigInteger - * - * @param BigNumber|int|float|string $value - * - * @return BigNumber - * - * @throws NumberFormatException If the format of the number is not valid. - * @throws DivisionByZeroException If the value represents a rational number with a denominator of zero. - * - * @psalm-pure - */ - public static function of($value) : BigNumber - { - if ($value instanceof BigNumber) { - return $value; - } - - if (\is_int($value)) { - return new BigInteger((string) $value); - } - - /** @psalm-suppress RedundantCastGivenDocblockType We cannot trust the untyped $value here! */ - $value = \is_float($value) ? self::floatToString($value) : (string) $value; - - $throw = static function() use ($value) : void { - throw new NumberFormatException(\sprintf( - 'The given value "%s" does not represent a valid number.', - $value - )); - }; - - if (\preg_match(self::PARSE_REGEXP, $value, $matches) !== 1) { - $throw(); - } - - $getMatch = static fn(string $value): ?string => (($matches[$value] ?? '') !== '') ? $matches[$value] : null; - - $sign = $getMatch('sign'); - $numerator = $getMatch('numerator'); - $denominator = $getMatch('denominator'); - - if ($numerator !== null) { - assert($denominator !== null); - - if ($sign !== null) { - $numerator = $sign . $numerator; - } - - $numerator = self::cleanUp($numerator); - $denominator = self::cleanUp($denominator); - - if ($denominator === '0') { - throw DivisionByZeroException::denominatorMustNotBeZero(); - } - - return new BigRational( - new BigInteger($numerator), - new BigInteger($denominator), - false - ); - } - - $point = $getMatch('point'); - $integral = $getMatch('integral'); - $fractional = $getMatch('fractional'); - $exponent = $getMatch('exponent'); - - if ($integral === null && $fractional === null) { - $throw(); - } - - if ($integral === null) { - $integral = '0'; - } - - if ($point !== null || $exponent !== null) { - $fractional = ($fractional ?? ''); - $exponent = ($exponent !== null) ? (int) $exponent : 0; - - if ($exponent === PHP_INT_MIN || $exponent === PHP_INT_MAX) { - throw new NumberFormatException('Exponent too large.'); - } - - $unscaledValue = self::cleanUp(($sign ?? ''). $integral . $fractional); - - $scale = \strlen($fractional) - $exponent; - - if ($scale < 0) { - if ($unscaledValue !== '0') { - $unscaledValue .= \str_repeat('0', - $scale); - } - $scale = 0; - } - - return new BigDecimal($unscaledValue, $scale); - } - - $integral = self::cleanUp(($sign ?? '') . $integral); - - return new BigInteger($integral); - } - - /** - * Safely converts float to string, avoiding locale-dependent issues. - * - * @see https://github.com/brick/math/pull/20 - * - * @param float $float - * - * @return string - * - * @psalm-pure - * @psalm-suppress ImpureFunctionCall - */ - private static function floatToString(float $float) : string - { - $currentLocale = \setlocale(LC_NUMERIC, '0'); - \setlocale(LC_NUMERIC, 'C'); - - $result = (string) $float; - - \setlocale(LC_NUMERIC, $currentLocale); - - return $result; - } - - /** - * Proxy method to access protected constructors from sibling classes. - * - * @internal - * - * @param mixed ...$args The arguments to the constructor. - * - * @return static - * - * @psalm-pure - * @psalm-suppress TooManyArguments - * @psalm-suppress UnsafeInstantiation - */ - protected static function create(... $args) : BigNumber - { - return new static(... $args); - } - - /** - * Returns the minimum of the given values. - * - * @param BigNumber|int|float|string ...$values The numbers to compare. All the numbers need to be convertible - * to an instance of the class this method is called on. - * - * @return static The minimum value. - * - * @throws \InvalidArgumentException If no values are given. - * @throws MathException If an argument is not valid. - * - * @psalm-suppress LessSpecificReturnStatement - * @psalm-suppress MoreSpecificReturnType - * @psalm-pure - */ - public static function min(...$values) : BigNumber - { - $min = null; - - foreach ($values as $value) { - $value = static::of($value); - - if ($min === null || $value->isLessThan($min)) { - $min = $value; - } - } - - if ($min === null) { - throw new \InvalidArgumentException(__METHOD__ . '() expects at least one value.'); - } - - return $min; - } - - /** - * Returns the maximum of the given values. - * - * @param BigNumber|int|float|string ...$values The numbers to compare. All the numbers need to be convertible - * to an instance of the class this method is called on. - * - * @return static The maximum value. - * - * @throws \InvalidArgumentException If no values are given. - * @throws MathException If an argument is not valid. - * - * @psalm-suppress LessSpecificReturnStatement - * @psalm-suppress MoreSpecificReturnType - * @psalm-pure - */ - public static function max(...$values) : BigNumber - { - $max = null; - - foreach ($values as $value) { - $value = static::of($value); - - if ($max === null || $value->isGreaterThan($max)) { - $max = $value; - } - } - - if ($max === null) { - throw new \InvalidArgumentException(__METHOD__ . '() expects at least one value.'); - } - - return $max; - } - - /** - * Returns the sum of the given values. - * - * @param BigNumber|int|float|string ...$values The numbers to add. All the numbers need to be convertible - * to an instance of the class this method is called on. - * - * @return static The sum. - * - * @throws \InvalidArgumentException If no values are given. - * @throws MathException If an argument is not valid. - * - * @psalm-suppress LessSpecificReturnStatement - * @psalm-suppress MoreSpecificReturnType - * @psalm-pure - */ - public static function sum(...$values) : BigNumber - { - /** @var BigNumber|null $sum */ - $sum = null; - - foreach ($values as $value) { - $value = static::of($value); - - $sum = $sum === null ? $value : self::add($sum, $value); - } - - if ($sum === null) { - throw new \InvalidArgumentException(__METHOD__ . '() expects at least one value.'); - } - - return $sum; - } - - /** - * Adds two BigNumber instances in the correct order to avoid a RoundingNecessaryException. - * - * @todo This could be better resolved by creating an abstract protected method in BigNumber, and leaving to - * concrete classes the responsibility to perform the addition themselves or delegate it to the given number, - * depending on their ability to perform the operation. This will also require a version bump because we're - * potentially breaking custom BigNumber implementations (if any...) - * - * @param BigNumber $a - * @param BigNumber $b - * - * @return BigNumber - * - * @psalm-pure - */ - private static function add(BigNumber $a, BigNumber $b) : BigNumber - { - if ($a instanceof BigRational) { - return $a->plus($b); - } - - if ($b instanceof BigRational) { - return $b->plus($a); - } - - if ($a instanceof BigDecimal) { - return $a->plus($b); - } - - if ($b instanceof BigDecimal) { - return $b->plus($a); - } - - /** @var BigInteger $a */ - - return $a->plus($b); - } - - /** - * Removes optional leading zeros and + sign from the given number. - * - * @param string $number The number, validated as a non-empty string of digits with optional leading sign. - * - * @return string - * - * @psalm-pure - */ - private static function cleanUp(string $number) : string - { - $firstChar = $number[0]; - - if ($firstChar === '+' || $firstChar === '-') { - $number = \substr($number, 1); - } - - $number = \ltrim($number, '0'); - - if ($number === '') { - return '0'; - } - - if ($firstChar === '-') { - return '-' . $number; - } - - return $number; - } - - /** - * Checks if this number is equal to the given one. - * - * @param BigNumber|int|float|string $that - * - * @return bool - */ - public function isEqualTo($that) : bool - { - return $this->compareTo($that) === 0; - } - - /** - * Checks if this number is strictly lower than the given one. - * - * @param BigNumber|int|float|string $that - * - * @return bool - */ - public function isLessThan($that) : bool - { - return $this->compareTo($that) < 0; - } - - /** - * Checks if this number is lower than or equal to the given one. - * - * @param BigNumber|int|float|string $that - * - * @return bool - */ - public function isLessThanOrEqualTo($that) : bool - { - return $this->compareTo($that) <= 0; - } - - /** - * Checks if this number is strictly greater than the given one. - * - * @param BigNumber|int|float|string $that - * - * @return bool - */ - public function isGreaterThan($that) : bool - { - return $this->compareTo($that) > 0; - } - - /** - * Checks if this number is greater than or equal to the given one. - * - * @param BigNumber|int|float|string $that - * - * @return bool - */ - public function isGreaterThanOrEqualTo($that) : bool - { - return $this->compareTo($that) >= 0; - } - - /** - * Checks if this number equals zero. - * - * @return bool - */ - public function isZero() : bool - { - return $this->getSign() === 0; - } - - /** - * Checks if this number is strictly negative. - * - * @return bool - */ - public function isNegative() : bool - { - return $this->getSign() < 0; - } - - /** - * Checks if this number is negative or zero. - * - * @return bool - */ - public function isNegativeOrZero() : bool - { - return $this->getSign() <= 0; - } - - /** - * Checks if this number is strictly positive. - * - * @return bool - */ - public function isPositive() : bool - { - return $this->getSign() > 0; - } - - /** - * Checks if this number is positive or zero. - * - * @return bool - */ - public function isPositiveOrZero() : bool - { - return $this->getSign() >= 0; - } - - /** - * Returns the sign of this number. - * - * @return int -1 if the number is negative, 0 if zero, 1 if positive. - */ - abstract public function getSign() : int; - - /** - * Compares this number to the given one. - * - * @param BigNumber|int|float|string $that - * - * @return int [-1,0,1] If `$this` is lower than, equal to, or greater than `$that`. - * - * @throws MathException If the number is not valid. - */ - abstract public function compareTo($that) : int; - - /** - * Converts this number to a BigInteger. - * - * @return BigInteger The converted number. - * - * @throws RoundingNecessaryException If this number cannot be converted to a BigInteger without rounding. - */ - abstract public function toBigInteger() : BigInteger; - - /** - * Converts this number to a BigDecimal. - * - * @return BigDecimal The converted number. - * - * @throws RoundingNecessaryException If this number cannot be converted to a BigDecimal without rounding. - */ - abstract public function toBigDecimal() : BigDecimal; - - /** - * Converts this number to a BigRational. - * - * @return BigRational The converted number. - */ - abstract public function toBigRational() : BigRational; - - /** - * Converts this number to a BigDecimal with the given scale, using rounding if necessary. - * - * @param int $scale The scale of the resulting `BigDecimal`. - * @param int $roundingMode A `RoundingMode` constant. - * - * @return BigDecimal - * - * @throws RoundingNecessaryException If this number cannot be converted to the given scale without rounding. - * This only applies when RoundingMode::UNNECESSARY is used. - */ - abstract public function toScale(int $scale, int $roundingMode = RoundingMode::UNNECESSARY) : BigDecimal; - - /** - * Returns the exact value of this number as a native integer. - * - * If this number cannot be converted to a native integer without losing precision, an exception is thrown. - * Note that the acceptable range for an integer depends on the platform and differs for 32-bit and 64-bit. - * - * @return int The converted value. - * - * @throws MathException If this number cannot be exactly converted to a native integer. - */ - abstract public function toInt() : int; - - /** - * Returns an approximation of this number as a floating-point value. - * - * Note that this method can discard information as the precision of a floating-point value - * is inherently limited. - * - * If the number is greater than the largest representable floating point number, positive infinity is returned. - * If the number is less than the smallest representable floating point number, negative infinity is returned. - * - * @return float The converted value. - */ - abstract public function toFloat() : float; - - /** - * Returns a string representation of this number. - * - * The output of this method can be parsed by the `of()` factory method; - * this will yield an object equal to this one, without any information loss. - * - * @return string - */ - abstract public function __toString() : string; - - /** - * {@inheritdoc} - */ - public function jsonSerialize() : string - { - return $this->__toString(); - } -} diff --git a/vendor/brick/math/src/BigRational.php b/vendor/brick/math/src/BigRational.php deleted file mode 100644 index 46257814..00000000 --- a/vendor/brick/math/src/BigRational.php +++ /dev/null @@ -1,520 +0,0 @@ -isZero()) { - throw DivisionByZeroException::denominatorMustNotBeZero(); - } - - if ($denominator->isNegative()) { - $numerator = $numerator->negated(); - $denominator = $denominator->negated(); - } - } - - $this->numerator = $numerator; - $this->denominator = $denominator; - } - - /** - * Creates a BigRational of the given value. - * - * @param BigNumber|int|float|string $value - * - * @return BigRational - * - * @throws MathException If the value cannot be converted to a BigRational. - * - * @psalm-pure - */ - public static function of($value) : BigNumber - { - return parent::of($value)->toBigRational(); - } - - /** - * Creates a BigRational out of a numerator and a denominator. - * - * If the denominator is negative, the signs of both the numerator and the denominator - * will be inverted to ensure that the denominator is always positive. - * - * @param BigNumber|int|float|string $numerator The numerator. Must be convertible to a BigInteger. - * @param BigNumber|int|float|string $denominator The denominator. Must be convertible to a BigInteger. - * - * @return BigRational - * - * @throws NumberFormatException If an argument does not represent a valid number. - * @throws RoundingNecessaryException If an argument represents a non-integer number. - * @throws DivisionByZeroException If the denominator is zero. - * - * @psalm-pure - */ - public static function nd($numerator, $denominator) : BigRational - { - $numerator = BigInteger::of($numerator); - $denominator = BigInteger::of($denominator); - - return new BigRational($numerator, $denominator, true); - } - - /** - * Returns a BigRational representing zero. - * - * @return BigRational - * - * @psalm-pure - */ - public static function zero() : BigRational - { - /** - * @psalm-suppress ImpureStaticVariable - * @var BigRational|null $zero - */ - static $zero; - - if ($zero === null) { - $zero = new BigRational(BigInteger::zero(), BigInteger::one(), false); - } - - return $zero; - } - - /** - * Returns a BigRational representing one. - * - * @return BigRational - * - * @psalm-pure - */ - public static function one() : BigRational - { - /** - * @psalm-suppress ImpureStaticVariable - * @var BigRational|null $one - */ - static $one; - - if ($one === null) { - $one = new BigRational(BigInteger::one(), BigInteger::one(), false); - } - - return $one; - } - - /** - * Returns a BigRational representing ten. - * - * @return BigRational - * - * @psalm-pure - */ - public static function ten() : BigRational - { - /** - * @psalm-suppress ImpureStaticVariable - * @var BigRational|null $ten - */ - static $ten; - - if ($ten === null) { - $ten = new BigRational(BigInteger::ten(), BigInteger::one(), false); - } - - return $ten; - } - - /** - * @return BigInteger - */ - public function getNumerator() : BigInteger - { - return $this->numerator; - } - - /** - * @return BigInteger - */ - public function getDenominator() : BigInteger - { - return $this->denominator; - } - - /** - * Returns the quotient of the division of the numerator by the denominator. - * - * @return BigInteger - */ - public function quotient() : BigInteger - { - return $this->numerator->quotient($this->denominator); - } - - /** - * Returns the remainder of the division of the numerator by the denominator. - * - * @return BigInteger - */ - public function remainder() : BigInteger - { - return $this->numerator->remainder($this->denominator); - } - - /** - * Returns the quotient and remainder of the division of the numerator by the denominator. - * - * @return BigInteger[] - */ - public function quotientAndRemainder() : array - { - return $this->numerator->quotientAndRemainder($this->denominator); - } - - /** - * Returns the sum of this number and the given one. - * - * @param BigNumber|int|float|string $that The number to add. - * - * @return BigRational The result. - * - * @throws MathException If the number is not valid. - */ - public function plus($that) : BigRational - { - $that = BigRational::of($that); - - $numerator = $this->numerator->multipliedBy($that->denominator); - $numerator = $numerator->plus($that->numerator->multipliedBy($this->denominator)); - $denominator = $this->denominator->multipliedBy($that->denominator); - - return new BigRational($numerator, $denominator, false); - } - - /** - * Returns the difference of this number and the given one. - * - * @param BigNumber|int|float|string $that The number to subtract. - * - * @return BigRational The result. - * - * @throws MathException If the number is not valid. - */ - public function minus($that) : BigRational - { - $that = BigRational::of($that); - - $numerator = $this->numerator->multipliedBy($that->denominator); - $numerator = $numerator->minus($that->numerator->multipliedBy($this->denominator)); - $denominator = $this->denominator->multipliedBy($that->denominator); - - return new BigRational($numerator, $denominator, false); - } - - /** - * Returns the product of this number and the given one. - * - * @param BigNumber|int|float|string $that The multiplier. - * - * @return BigRational The result. - * - * @throws MathException If the multiplier is not a valid number. - */ - public function multipliedBy($that) : BigRational - { - $that = BigRational::of($that); - - $numerator = $this->numerator->multipliedBy($that->numerator); - $denominator = $this->denominator->multipliedBy($that->denominator); - - return new BigRational($numerator, $denominator, false); - } - - /** - * Returns the result of the division of this number by the given one. - * - * @param BigNumber|int|float|string $that The divisor. - * - * @return BigRational The result. - * - * @throws MathException If the divisor is not a valid number, or is zero. - */ - public function dividedBy($that) : BigRational - { - $that = BigRational::of($that); - - $numerator = $this->numerator->multipliedBy($that->denominator); - $denominator = $this->denominator->multipliedBy($that->numerator); - - return new BigRational($numerator, $denominator, true); - } - - /** - * Returns this number exponentiated to the given value. - * - * @param int $exponent The exponent. - * - * @return BigRational The result. - * - * @throws \InvalidArgumentException If the exponent is not in the range 0 to 1,000,000. - */ - public function power(int $exponent) : BigRational - { - if ($exponent === 0) { - $one = BigInteger::one(); - - return new BigRational($one, $one, false); - } - - if ($exponent === 1) { - return $this; - } - - return new BigRational( - $this->numerator->power($exponent), - $this->denominator->power($exponent), - false - ); - } - - /** - * Returns the reciprocal of this BigRational. - * - * The reciprocal has the numerator and denominator swapped. - * - * @return BigRational - * - * @throws DivisionByZeroException If the numerator is zero. - */ - public function reciprocal() : BigRational - { - return new BigRational($this->denominator, $this->numerator, true); - } - - /** - * Returns the absolute value of this BigRational. - * - * @return BigRational - */ - public function abs() : BigRational - { - return new BigRational($this->numerator->abs(), $this->denominator, false); - } - - /** - * Returns the negated value of this BigRational. - * - * @return BigRational - */ - public function negated() : BigRational - { - return new BigRational($this->numerator->negated(), $this->denominator, false); - } - - /** - * Returns the simplified value of this BigRational. - * - * @return BigRational - */ - public function simplified() : BigRational - { - $gcd = $this->numerator->gcd($this->denominator); - - $numerator = $this->numerator->quotient($gcd); - $denominator = $this->denominator->quotient($gcd); - - return new BigRational($numerator, $denominator, false); - } - - /** - * {@inheritdoc} - */ - public function compareTo($that) : int - { - return $this->minus($that)->getSign(); - } - - /** - * {@inheritdoc} - */ - public function getSign() : int - { - return $this->numerator->getSign(); - } - - /** - * {@inheritdoc} - */ - public function toBigInteger() : BigInteger - { - $simplified = $this->simplified(); - - if (! $simplified->denominator->isEqualTo(1)) { - throw new RoundingNecessaryException('This rational number cannot be represented as an integer value without rounding.'); - } - - return $simplified->numerator; - } - - /** - * {@inheritdoc} - */ - public function toBigDecimal() : BigDecimal - { - return $this->numerator->toBigDecimal()->exactlyDividedBy($this->denominator); - } - - /** - * {@inheritdoc} - */ - public function toBigRational() : BigRational - { - return $this; - } - - /** - * {@inheritdoc} - */ - public function toScale(int $scale, int $roundingMode = RoundingMode::UNNECESSARY) : BigDecimal - { - return $this->numerator->toBigDecimal()->dividedBy($this->denominator, $scale, $roundingMode); - } - - /** - * {@inheritdoc} - */ - public function toInt() : int - { - return $this->toBigInteger()->toInt(); - } - - /** - * {@inheritdoc} - */ - public function toFloat() : float - { - $simplified = $this->simplified(); - return $simplified->numerator->toFloat() / $simplified->denominator->toFloat(); - } - - /** - * {@inheritdoc} - */ - public function __toString() : string - { - $numerator = (string) $this->numerator; - $denominator = (string) $this->denominator; - - if ($denominator === '1') { - return $numerator; - } - - return $this->numerator . '/' . $this->denominator; - } - - /** - * This method is required for serializing the object and SHOULD NOT be accessed directly. - * - * @internal - * - * @return array{numerator: BigInteger, denominator: BigInteger} - */ - public function __serialize(): array - { - return ['numerator' => $this->numerator, 'denominator' => $this->denominator]; - } - - /** - * This method is only here to allow unserializing the object and cannot be accessed directly. - * - * @internal - * @psalm-suppress RedundantPropertyInitializationCheck - * - * @param array{numerator: BigInteger, denominator: BigInteger} $data - * - * @return void - * - * @throws \LogicException - */ - public function __unserialize(array $data): void - { - if (isset($this->numerator)) { - throw new \LogicException('__unserialize() is an internal function, it must not be called directly.'); - } - - $this->numerator = $data['numerator']; - $this->denominator = $data['denominator']; - } - - /** - * This method is required by interface Serializable and SHOULD NOT be accessed directly. - * - * @internal - * - * @return string - */ - public function serialize() : string - { - return $this->numerator . '/' . $this->denominator; - } - - /** - * This method is only here to implement interface Serializable and cannot be accessed directly. - * - * @internal - * @psalm-suppress RedundantPropertyInitializationCheck - * - * @param string $value - * - * @return void - * - * @throws \LogicException - */ - public function unserialize($value) : void - { - if (isset($this->numerator)) { - throw new \LogicException('unserialize() is an internal function, it must not be called directly.'); - } - - [$numerator, $denominator] = \explode('/', $value); - - $this->numerator = BigInteger::of($numerator); - $this->denominator = BigInteger::of($denominator); - } -} diff --git a/vendor/brick/math/src/Exception/DivisionByZeroException.php b/vendor/brick/math/src/Exception/DivisionByZeroException.php deleted file mode 100644 index a4e44317..00000000 --- a/vendor/brick/math/src/Exception/DivisionByZeroException.php +++ /dev/null @@ -1,41 +0,0 @@ - 126) { - $char = \strtoupper(\dechex($ord)); - - if ($ord < 10) { - $char = '0' . $char; - } - } else { - $char = '"' . $char . '"'; - } - - return new self(sprintf('Char %s is not a valid character in the given alphabet.', $char)); - } -} diff --git a/vendor/brick/math/src/Exception/RoundingNecessaryException.php b/vendor/brick/math/src/Exception/RoundingNecessaryException.php deleted file mode 100644 index 1c610056..00000000 --- a/vendor/brick/math/src/Exception/RoundingNecessaryException.php +++ /dev/null @@ -1,21 +0,0 @@ -init($a, $b); - - if ($aNeg && ! $bNeg) { - return -1; - } - - if ($bNeg && ! $aNeg) { - return 1; - } - - $aLen = \strlen($aDig); - $bLen = \strlen($bDig); - - if ($aLen < $bLen) { - $result = -1; - } elseif ($aLen > $bLen) { - $result = 1; - } else { - $result = $aDig <=> $bDig; - } - - return $aNeg ? -$result : $result; - } - - /** - * Adds two numbers. - * - * @param string $a The augend. - * @param string $b The addend. - * - * @return string The sum. - */ - abstract public function add(string $a, string $b) : string; - - /** - * Subtracts two numbers. - * - * @param string $a The minuend. - * @param string $b The subtrahend. - * - * @return string The difference. - */ - abstract public function sub(string $a, string $b) : string; - - /** - * Multiplies two numbers. - * - * @param string $a The multiplicand. - * @param string $b The multiplier. - * - * @return string The product. - */ - abstract public function mul(string $a, string $b) : string; - - /** - * Returns the quotient of the division of two numbers. - * - * @param string $a The dividend. - * @param string $b The divisor, must not be zero. - * - * @return string The quotient. - */ - abstract public function divQ(string $a, string $b) : string; - - /** - * Returns the remainder of the division of two numbers. - * - * @param string $a The dividend. - * @param string $b The divisor, must not be zero. - * - * @return string The remainder. - */ - abstract public function divR(string $a, string $b) : string; - - /** - * Returns the quotient and remainder of the division of two numbers. - * - * @param string $a The dividend. - * @param string $b The divisor, must not be zero. - * - * @return array{string, string} An array containing the quotient and remainder. - */ - abstract public function divQR(string $a, string $b) : array; - - /** - * Exponentiates a number. - * - * @param string $a The base number. - * @param int $e The exponent, validated as an integer between 0 and MAX_POWER. - * - * @return string The power. - */ - abstract public function pow(string $a, int $e) : string; - - /** - * @param string $a - * @param string $b The modulus; must not be zero. - * - * @return string - */ - public function mod(string $a, string $b) : string - { - return $this->divR($this->add($this->divR($a, $b), $b), $b); - } - - /** - * Returns the modular multiplicative inverse of $x modulo $m. - * - * If $x has no multiplicative inverse mod m, this method must return null. - * - * This method can be overridden by the concrete implementation if the underlying library has built-in support. - * - * @param string $x - * @param string $m The modulus; must not be negative or zero. - * - * @return string|null - */ - public function modInverse(string $x, string $m) : ?string - { - if ($m === '1') { - return '0'; - } - - $modVal = $x; - - if ($x[0] === '-' || ($this->cmp($this->abs($x), $m) >= 0)) { - $modVal = $this->mod($x, $m); - } - - [$g, $x] = $this->gcdExtended($modVal, $m); - - if ($g !== '1') { - return null; - } - - return $this->mod($this->add($this->mod($x, $m), $m), $m); - } - - /** - * Raises a number into power with modulo. - * - * @param string $base The base number; must be positive or zero. - * @param string $exp The exponent; must be positive or zero. - * @param string $mod The modulus; must be strictly positive. - * - * @return string The power. - */ - abstract public function modPow(string $base, string $exp, string $mod) : string; - - /** - * Returns the greatest common divisor of the two numbers. - * - * This method can be overridden by the concrete implementation if the underlying library - * has built-in support for GCD calculations. - * - * @param string $a The first number. - * @param string $b The second number. - * - * @return string The GCD, always positive, or zero if both arguments are zero. - */ - public function gcd(string $a, string $b) : string - { - if ($a === '0') { - return $this->abs($b); - } - - if ($b === '0') { - return $this->abs($a); - } - - return $this->gcd($b, $this->divR($a, $b)); - } - - /** - * @return array{string, string, string} GCD, X, Y - */ - private function gcdExtended(string $a, string $b) : array - { - if ($a === '0') { - return [$b, '0', '1']; - } - - [$gcd, $x1, $y1] = $this->gcdExtended($this->mod($b, $a), $a); - - $x = $this->sub($y1, $this->mul($this->divQ($b, $a), $x1)); - $y = $x1; - - return [$gcd, $x, $y]; - } - - /** - * Returns the square root of the given number, rounded down. - * - * The result is the largest x such that x² ≤ n. - * The input MUST NOT be negative. - * - * @param string $n The number. - * - * @return string The square root. - */ - abstract public function sqrt(string $n) : string; - - /** - * Converts a number from an arbitrary base. - * - * This method can be overridden by the concrete implementation if the underlying library - * has built-in support for base conversion. - * - * @param string $number The number, positive or zero, non-empty, case-insensitively validated for the given base. - * @param int $base The base of the number, validated from 2 to 36. - * - * @return string The converted number, following the Calculator conventions. - */ - public function fromBase(string $number, int $base) : string - { - return $this->fromArbitraryBase(\strtolower($number), self::ALPHABET, $base); - } - - /** - * Converts a number to an arbitrary base. - * - * This method can be overridden by the concrete implementation if the underlying library - * has built-in support for base conversion. - * - * @param string $number The number to convert, following the Calculator conventions. - * @param int $base The base to convert to, validated from 2 to 36. - * - * @return string The converted number, lowercase. - */ - public function toBase(string $number, int $base) : string - { - $negative = ($number[0] === '-'); - - if ($negative) { - $number = \substr($number, 1); - } - - $number = $this->toArbitraryBase($number, self::ALPHABET, $base); - - if ($negative) { - return '-' . $number; - } - - return $number; - } - - /** - * Converts a non-negative number in an arbitrary base using a custom alphabet, to base 10. - * - * @param string $number The number to convert, validated as a non-empty string, - * containing only chars in the given alphabet/base. - * @param string $alphabet The alphabet that contains every digit, validated as 2 chars minimum. - * @param int $base The base of the number, validated from 2 to alphabet length. - * - * @return string The number in base 10, following the Calculator conventions. - */ - final public function fromArbitraryBase(string $number, string $alphabet, int $base) : string - { - // remove leading "zeros" - $number = \ltrim($number, $alphabet[0]); - - if ($number === '') { - return '0'; - } - - // optimize for "one" - if ($number === $alphabet[1]) { - return '1'; - } - - $result = '0'; - $power = '1'; - - $base = (string) $base; - - for ($i = \strlen($number) - 1; $i >= 0; $i--) { - $index = \strpos($alphabet, $number[$i]); - - if ($index !== 0) { - $result = $this->add($result, ($index === 1) - ? $power - : $this->mul($power, (string) $index) - ); - } - - if ($i !== 0) { - $power = $this->mul($power, $base); - } - } - - return $result; - } - - /** - * Converts a non-negative number to an arbitrary base using a custom alphabet. - * - * @param string $number The number to convert, positive or zero, following the Calculator conventions. - * @param string $alphabet The alphabet that contains every digit, validated as 2 chars minimum. - * @param int $base The base to convert to, validated from 2 to alphabet length. - * - * @return string The converted number in the given alphabet. - */ - final public function toArbitraryBase(string $number, string $alphabet, int $base) : string - { - if ($number === '0') { - return $alphabet[0]; - } - - $base = (string) $base; - $result = ''; - - while ($number !== '0') { - [$number, $remainder] = $this->divQR($number, $base); - $remainder = (int) $remainder; - - $result .= $alphabet[$remainder]; - } - - return \strrev($result); - } - - /** - * Performs a rounded division. - * - * Rounding is performed when the remainder of the division is not zero. - * - * @param string $a The dividend. - * @param string $b The divisor, must not be zero. - * @param int $roundingMode The rounding mode. - * - * @return string - * - * @throws \InvalidArgumentException If the rounding mode is invalid. - * @throws RoundingNecessaryException If RoundingMode::UNNECESSARY is provided but rounding is necessary. - * - * @psalm-suppress ImpureFunctionCall - */ - final public function divRound(string $a, string $b, int $roundingMode) : string - { - [$quotient, $remainder] = $this->divQR($a, $b); - - $hasDiscardedFraction = ($remainder !== '0'); - $isPositiveOrZero = ($a[0] === '-') === ($b[0] === '-'); - - $discardedFractionSign = function() use ($remainder, $b) : int { - $r = $this->abs($this->mul($remainder, '2')); - $b = $this->abs($b); - - return $this->cmp($r, $b); - }; - - $increment = false; - - switch ($roundingMode) { - case RoundingMode::UNNECESSARY: - if ($hasDiscardedFraction) { - throw RoundingNecessaryException::roundingNecessary(); - } - break; - - case RoundingMode::UP: - $increment = $hasDiscardedFraction; - break; - - case RoundingMode::DOWN: - break; - - case RoundingMode::CEILING: - $increment = $hasDiscardedFraction && $isPositiveOrZero; - break; - - case RoundingMode::FLOOR: - $increment = $hasDiscardedFraction && ! $isPositiveOrZero; - break; - - case RoundingMode::HALF_UP: - $increment = $discardedFractionSign() >= 0; - break; - - case RoundingMode::HALF_DOWN: - $increment = $discardedFractionSign() > 0; - break; - - case RoundingMode::HALF_CEILING: - $increment = $isPositiveOrZero ? $discardedFractionSign() >= 0 : $discardedFractionSign() > 0; - break; - - case RoundingMode::HALF_FLOOR: - $increment = $isPositiveOrZero ? $discardedFractionSign() > 0 : $discardedFractionSign() >= 0; - break; - - case RoundingMode::HALF_EVEN: - $lastDigit = (int) $quotient[-1]; - $lastDigitIsEven = ($lastDigit % 2 === 0); - $increment = $lastDigitIsEven ? $discardedFractionSign() > 0 : $discardedFractionSign() >= 0; - break; - - default: - throw new \InvalidArgumentException('Invalid rounding mode.'); - } - - if ($increment) { - return $this->add($quotient, $isPositiveOrZero ? '1' : '-1'); - } - - return $quotient; - } - - /** - * Calculates bitwise AND of two numbers. - * - * This method can be overridden by the concrete implementation if the underlying library - * has built-in support for bitwise operations. - * - * @param string $a - * @param string $b - * - * @return string - */ - public function and(string $a, string $b) : string - { - return $this->bitwise('and', $a, $b); - } - - /** - * Calculates bitwise OR of two numbers. - * - * This method can be overridden by the concrete implementation if the underlying library - * has built-in support for bitwise operations. - * - * @param string $a - * @param string $b - * - * @return string - */ - public function or(string $a, string $b) : string - { - return $this->bitwise('or', $a, $b); - } - - /** - * Calculates bitwise XOR of two numbers. - * - * This method can be overridden by the concrete implementation if the underlying library - * has built-in support for bitwise operations. - * - * @param string $a - * @param string $b - * - * @return string - */ - public function xor(string $a, string $b) : string - { - return $this->bitwise('xor', $a, $b); - } - - /** - * Performs a bitwise operation on a decimal number. - * - * @param 'and'|'or'|'xor' $operator The operator to use. - * @param string $a The left operand. - * @param string $b The right operand. - * - * @return string - */ - private function bitwise(string $operator, string $a, string $b) : string - { - [$aNeg, $bNeg, $aDig, $bDig] = $this->init($a, $b); - - $aBin = $this->toBinary($aDig); - $bBin = $this->toBinary($bDig); - - $aLen = \strlen($aBin); - $bLen = \strlen($bBin); - - if ($aLen > $bLen) { - $bBin = \str_repeat("\x00", $aLen - $bLen) . $bBin; - } elseif ($bLen > $aLen) { - $aBin = \str_repeat("\x00", $bLen - $aLen) . $aBin; - } - - if ($aNeg) { - $aBin = $this->twosComplement($aBin); - } - if ($bNeg) { - $bBin = $this->twosComplement($bBin); - } - - switch ($operator) { - case 'and': - $value = $aBin & $bBin; - $negative = ($aNeg and $bNeg); - break; - - case 'or': - $value = $aBin | $bBin; - $negative = ($aNeg or $bNeg); - break; - - case 'xor': - $value = $aBin ^ $bBin; - $negative = ($aNeg xor $bNeg); - break; - - // @codeCoverageIgnoreStart - default: - throw new \InvalidArgumentException('Invalid bitwise operator.'); - // @codeCoverageIgnoreEnd - } - - if ($negative) { - $value = $this->twosComplement($value); - } - - $result = $this->toDecimal($value); - - return $negative ? $this->neg($result) : $result; - } - - /** - * @param string $number A positive, binary number. - * - * @return string - */ - private function twosComplement(string $number) : string - { - $xor = \str_repeat("\xff", \strlen($number)); - - $number ^= $xor; - - for ($i = \strlen($number) - 1; $i >= 0; $i--) { - $byte = \ord($number[$i]); - - if (++$byte !== 256) { - $number[$i] = \chr($byte); - break; - } - - $number[$i] = "\x00"; - - if ($i === 0) { - $number = "\x01" . $number; - } - } - - return $number; - } - - /** - * Converts a decimal number to a binary string. - * - * @param string $number The number to convert, positive or zero, only digits. - * - * @return string - */ - private function toBinary(string $number) : string - { - $result = ''; - - while ($number !== '0') { - [$number, $remainder] = $this->divQR($number, '256'); - $result .= \chr((int) $remainder); - } - - return \strrev($result); - } - - /** - * Returns the positive decimal representation of a binary number. - * - * @param string $bytes The bytes representing the number. - * - * @return string - */ - private function toDecimal(string $bytes) : string - { - $result = '0'; - $power = '1'; - - for ($i = \strlen($bytes) - 1; $i >= 0; $i--) { - $index = \ord($bytes[$i]); - - if ($index !== 0) { - $result = $this->add($result, ($index === 1) - ? $power - : $this->mul($power, (string) $index) - ); - } - - if ($i !== 0) { - $power = $this->mul($power, '256'); - } - } - - return $result; - } -} diff --git a/vendor/brick/math/src/Internal/Calculator/BcMathCalculator.php b/vendor/brick/math/src/Internal/Calculator/BcMathCalculator.php deleted file mode 100644 index 34078687..00000000 --- a/vendor/brick/math/src/Internal/Calculator/BcMathCalculator.php +++ /dev/null @@ -1,110 +0,0 @@ -= 0) { - return \bcmod($a, $b, 0); - } - - return \bcmod($a, $b); - } - - /** - * {@inheritdoc} - */ - public function divQR(string $a, string $b) : array - { - $q = \bcdiv($a, $b, 0); - - if (version_compare(PHP_VERSION, '7.2') >= 0) { - $r = \bcmod($a, $b, 0); - } else { - $r = \bcmod($a, $b); - } - - assert($q !== null); - assert($r !== null); - - return [$q, $r]; - } - - /** - * {@inheritdoc} - */ - public function pow(string $a, int $e) : string - { - return \bcpow($a, (string) $e, 0); - } - - /** - * {@inheritdoc} - */ - public function modPow(string $base, string $exp, string $mod) : string - { - return \bcpowmod($base, $exp, $mod, 0); - } - - /** - * {@inheritDoc} - */ - public function sqrt(string $n) : string - { - return \bcsqrt($n, 0); - } -} diff --git a/vendor/brick/math/src/Internal/Calculator/GmpCalculator.php b/vendor/brick/math/src/Internal/Calculator/GmpCalculator.php deleted file mode 100644 index 52d18800..00000000 --- a/vendor/brick/math/src/Internal/Calculator/GmpCalculator.php +++ /dev/null @@ -1,156 +0,0 @@ -maxDigits = 9; - break; - - case 8: - $this->maxDigits = 18; - break; - - default: - throw new \RuntimeException('The platform is not 32-bit or 64-bit as expected.'); - } - } - - /** - * {@inheritdoc} - */ - public function add(string $a, string $b) : string - { - /** - * @psalm-var numeric-string $a - * @psalm-var numeric-string $b - */ - $result = $a + $b; - - if (is_int($result)) { - return (string) $result; - } - - if ($a === '0') { - return $b; - } - - if ($b === '0') { - return $a; - } - - [$aNeg, $bNeg, $aDig, $bDig] = $this->init($a, $b); - - $result = $aNeg === $bNeg ? $this->doAdd($aDig, $bDig) : $this->doSub($aDig, $bDig); - - if ($aNeg) { - $result = $this->neg($result); - } - - return $result; - } - - /** - * {@inheritdoc} - */ - public function sub(string $a, string $b) : string - { - return $this->add($a, $this->neg($b)); - } - - /** - * {@inheritdoc} - */ - public function mul(string $a, string $b) : string - { - /** - * @psalm-var numeric-string $a - * @psalm-var numeric-string $b - */ - $result = $a * $b; - - if (is_int($result)) { - return (string) $result; - } - - if ($a === '0' || $b === '0') { - return '0'; - } - - if ($a === '1') { - return $b; - } - - if ($b === '1') { - return $a; - } - - if ($a === '-1') { - return $this->neg($b); - } - - if ($b === '-1') { - return $this->neg($a); - } - - [$aNeg, $bNeg, $aDig, $bDig] = $this->init($a, $b); - - $result = $this->doMul($aDig, $bDig); - - if ($aNeg !== $bNeg) { - $result = $this->neg($result); - } - - return $result; - } - - /** - * {@inheritdoc} - */ - public function divQ(string $a, string $b) : string - { - return $this->divQR($a, $b)[0]; - } - - /** - * {@inheritdoc} - */ - public function divR(string $a, string $b): string - { - return $this->divQR($a, $b)[1]; - } - - /** - * {@inheritdoc} - */ - public function divQR(string $a, string $b) : array - { - if ($a === '0') { - return ['0', '0']; - } - - if ($a === $b) { - return ['1', '0']; - } - - if ($b === '1') { - return [$a, '0']; - } - - if ($b === '-1') { - return [$this->neg($a), '0']; - } - - /** @psalm-var numeric-string $a */ - $na = $a * 1; // cast to number - - if (is_int($na)) { - /** @psalm-var numeric-string $b */ - $nb = $b * 1; - - if (is_int($nb)) { - // the only division that may overflow is PHP_INT_MIN / -1, - // which cannot happen here as we've already handled a divisor of -1 above. - $r = $na % $nb; - $q = ($na - $r) / $nb; - - assert(is_int($q)); - - return [ - (string) $q, - (string) $r - ]; - } - } - - [$aNeg, $bNeg, $aDig, $bDig] = $this->init($a, $b); - - [$q, $r] = $this->doDiv($aDig, $bDig); - - if ($aNeg !== $bNeg) { - $q = $this->neg($q); - } - - if ($aNeg) { - $r = $this->neg($r); - } - - return [$q, $r]; - } - - /** - * {@inheritdoc} - */ - public function pow(string $a, int $e) : string - { - if ($e === 0) { - return '1'; - } - - if ($e === 1) { - return $a; - } - - $odd = $e % 2; - $e -= $odd; - - $aa = $this->mul($a, $a); - - /** @psalm-suppress PossiblyInvalidArgument We're sure that $e / 2 is an int now */ - $result = $this->pow($aa, $e / 2); - - if ($odd === 1) { - $result = $this->mul($result, $a); - } - - return $result; - } - - /** - * Algorithm from: https://www.geeksforgeeks.org/modular-exponentiation-power-in-modular-arithmetic/ - * - * {@inheritdoc} - */ - public function modPow(string $base, string $exp, string $mod) : string - { - // special case: the algorithm below fails with 0 power 0 mod 1 (returns 1 instead of 0) - if ($base === '0' && $exp === '0' && $mod === '1') { - return '0'; - } - - // special case: the algorithm below fails with power 0 mod 1 (returns 1 instead of 0) - if ($exp === '0' && $mod === '1') { - return '0'; - } - - $x = $base; - - $res = '1'; - - // numbers are positive, so we can use remainder instead of modulo - $x = $this->divR($x, $mod); - - while ($exp !== '0') { - if (in_array($exp[-1], ['1', '3', '5', '7', '9'])) { // odd - $res = $this->divR($this->mul($res, $x), $mod); - } - - $exp = $this->divQ($exp, '2'); - $x = $this->divR($this->mul($x, $x), $mod); - } - - return $res; - } - - /** - * Adapted from https://cp-algorithms.com/num_methods/roots_newton.html - * - * {@inheritDoc} - */ - public function sqrt(string $n) : string - { - if ($n === '0') { - return '0'; - } - - // initial approximation - $x = \str_repeat('9', \intdiv(\strlen($n), 2) ?: 1); - - $decreased = false; - - for (;;) { - $nx = $this->divQ($this->add($x, $this->divQ($n, $x)), '2'); - - if ($x === $nx || $this->cmp($nx, $x) > 0 && $decreased) { - break; - } - - $decreased = $this->cmp($nx, $x) < 0; - $x = $nx; - } - - return $x; - } - - /** - * Performs the addition of two non-signed large integers. - * - * @param string $a The first operand. - * @param string $b The second operand. - * - * @return string - */ - private function doAdd(string $a, string $b) : string - { - [$a, $b, $length] = $this->pad($a, $b); - - $carry = 0; - $result = ''; - - for ($i = $length - $this->maxDigits;; $i -= $this->maxDigits) { - $blockLength = $this->maxDigits; - - if ($i < 0) { - $blockLength += $i; - /** @psalm-suppress LoopInvalidation */ - $i = 0; - } - - /** @psalm-var numeric-string $blockA */ - $blockA = \substr($a, $i, $blockLength); - - /** @psalm-var numeric-string $blockB */ - $blockB = \substr($b, $i, $blockLength); - - $sum = (string) ($blockA + $blockB + $carry); - $sumLength = \strlen($sum); - - if ($sumLength > $blockLength) { - $sum = \substr($sum, 1); - $carry = 1; - } else { - if ($sumLength < $blockLength) { - $sum = \str_repeat('0', $blockLength - $sumLength) . $sum; - } - $carry = 0; - } - - $result = $sum . $result; - - if ($i === 0) { - break; - } - } - - if ($carry === 1) { - $result = '1' . $result; - } - - return $result; - } - - /** - * Performs the subtraction of two non-signed large integers. - * - * @param string $a The first operand. - * @param string $b The second operand. - * - * @return string - */ - private function doSub(string $a, string $b) : string - { - if ($a === $b) { - return '0'; - } - - // Ensure that we always subtract to a positive result: biggest minus smallest. - $cmp = $this->doCmp($a, $b); - - $invert = ($cmp === -1); - - if ($invert) { - $c = $a; - $a = $b; - $b = $c; - } - - [$a, $b, $length] = $this->pad($a, $b); - - $carry = 0; - $result = ''; - - $complement = 10 ** $this->maxDigits; - - for ($i = $length - $this->maxDigits;; $i -= $this->maxDigits) { - $blockLength = $this->maxDigits; - - if ($i < 0) { - $blockLength += $i; - /** @psalm-suppress LoopInvalidation */ - $i = 0; - } - - /** @psalm-var numeric-string $blockA */ - $blockA = \substr($a, $i, $blockLength); - - /** @psalm-var numeric-string $blockB */ - $blockB = \substr($b, $i, $blockLength); - - $sum = $blockA - $blockB - $carry; - - if ($sum < 0) { - $sum += $complement; - $carry = 1; - } else { - $carry = 0; - } - - $sum = (string) $sum; - $sumLength = \strlen($sum); - - if ($sumLength < $blockLength) { - $sum = \str_repeat('0', $blockLength - $sumLength) . $sum; - } - - $result = $sum . $result; - - if ($i === 0) { - break; - } - } - - // Carry cannot be 1 when the loop ends, as a > b - assert($carry === 0); - - $result = \ltrim($result, '0'); - - if ($invert) { - $result = $this->neg($result); - } - - return $result; - } - - /** - * Performs the multiplication of two non-signed large integers. - * - * @param string $a The first operand. - * @param string $b The second operand. - * - * @return string - */ - private function doMul(string $a, string $b) : string - { - $x = \strlen($a); - $y = \strlen($b); - - $maxDigits = \intdiv($this->maxDigits, 2); - $complement = 10 ** $maxDigits; - - $result = '0'; - - for ($i = $x - $maxDigits;; $i -= $maxDigits) { - $blockALength = $maxDigits; - - if ($i < 0) { - $blockALength += $i; - /** @psalm-suppress LoopInvalidation */ - $i = 0; - } - - $blockA = (int) \substr($a, $i, $blockALength); - - $line = ''; - $carry = 0; - - for ($j = $y - $maxDigits;; $j -= $maxDigits) { - $blockBLength = $maxDigits; - - if ($j < 0) { - $blockBLength += $j; - /** @psalm-suppress LoopInvalidation */ - $j = 0; - } - - $blockB = (int) \substr($b, $j, $blockBLength); - - $mul = $blockA * $blockB + $carry; - $value = $mul % $complement; - $carry = ($mul - $value) / $complement; - - $value = (string) $value; - $value = \str_pad($value, $maxDigits, '0', STR_PAD_LEFT); - - $line = $value . $line; - - if ($j === 0) { - break; - } - } - - if ($carry !== 0) { - $line = $carry . $line; - } - - $line = \ltrim($line, '0'); - - if ($line !== '') { - $line .= \str_repeat('0', $x - $blockALength - $i); - $result = $this->add($result, $line); - } - - if ($i === 0) { - break; - } - } - - return $result; - } - - /** - * Performs the division of two non-signed large integers. - * - * @param string $a The first operand. - * @param string $b The second operand. - * - * @return string[] The quotient and remainder. - */ - private function doDiv(string $a, string $b) : array - { - $cmp = $this->doCmp($a, $b); - - if ($cmp === -1) { - return ['0', $a]; - } - - $x = \strlen($a); - $y = \strlen($b); - - // we now know that a >= b && x >= y - - $q = '0'; // quotient - $r = $a; // remainder - $z = $y; // focus length, always $y or $y+1 - - for (;;) { - $focus = \substr($a, 0, $z); - - $cmp = $this->doCmp($focus, $b); - - if ($cmp === -1) { - if ($z === $x) { // remainder < dividend - break; - } - - $z++; - } - - $zeros = \str_repeat('0', $x - $z); - - $q = $this->add($q, '1' . $zeros); - $a = $this->sub($a, $b . $zeros); - - $r = $a; - - if ($r === '0') { // remainder == 0 - break; - } - - $x = \strlen($a); - - if ($x < $y) { // remainder < dividend - break; - } - - $z = $y; - } - - return [$q, $r]; - } - - /** - * Compares two non-signed large numbers. - * - * @param string $a The first operand. - * @param string $b The second operand. - * - * @return int [-1, 0, 1] - */ - private function doCmp(string $a, string $b) : int - { - $x = \strlen($a); - $y = \strlen($b); - - $cmp = $x <=> $y; - - if ($cmp !== 0) { - return $cmp; - } - - return \strcmp($a, $b) <=> 0; // enforce [-1, 0, 1] - } - - /** - * Pads the left of one of the given numbers with zeros if necessary to make both numbers the same length. - * - * The numbers must only consist of digits, without leading minus sign. - * - * @param string $a The first operand. - * @param string $b The second operand. - * - * @return array{string, string, int} - */ - private function pad(string $a, string $b) : array - { - $x = \strlen($a); - $y = \strlen($b); - - if ($x > $y) { - $b = \str_repeat('0', $x - $y) . $b; - - return [$a, $b, $x]; - } - - if ($x < $y) { - $a = \str_repeat('0', $y - $x) . $a; - - return [$a, $b, $y]; - } - - return [$a, $b, $x]; - } -} diff --git a/vendor/brick/math/src/RoundingMode.php b/vendor/brick/math/src/RoundingMode.php deleted file mode 100644 index 06936d8d..00000000 --- a/vendor/brick/math/src/RoundingMode.php +++ /dev/null @@ -1,107 +0,0 @@ -= 0.5; otherwise, behaves as for DOWN. - * Note that this is the rounding mode commonly taught at school. - */ - public const HALF_UP = 5; - - /** - * Rounds towards "nearest neighbor" unless both neighbors are equidistant, in which case round down. - * - * Behaves as for UP if the discarded fraction is > 0.5; otherwise, behaves as for DOWN. - */ - public const HALF_DOWN = 6; - - /** - * Rounds towards "nearest neighbor" unless both neighbors are equidistant, in which case round towards positive infinity. - * - * If the result is positive, behaves as for HALF_UP; if negative, behaves as for HALF_DOWN. - */ - public const HALF_CEILING = 7; - - /** - * Rounds towards "nearest neighbor" unless both neighbors are equidistant, in which case round towards negative infinity. - * - * If the result is positive, behaves as for HALF_DOWN; if negative, behaves as for HALF_UP. - */ - public const HALF_FLOOR = 8; - - /** - * Rounds towards the "nearest neighbor" unless both neighbors are equidistant, in which case rounds towards the even neighbor. - * - * Behaves as for HALF_UP if the digit to the left of the discarded fraction is odd; - * behaves as for HALF_DOWN if it's even. - * - * Note that this is the rounding mode that statistically minimizes - * cumulative error when applied repeatedly over a sequence of calculations. - * It is sometimes known as "Banker's rounding", and is chiefly used in the USA. - */ - public const HALF_EVEN = 9; -} diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php deleted file mode 100644 index fd56bd7d..00000000 --- a/vendor/composer/ClassLoader.php +++ /dev/null @@ -1,581 +0,0 @@ - - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer\Autoload; - -/** - * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. - * - * $loader = new \Composer\Autoload\ClassLoader(); - * - * // register classes with namespaces - * $loader->add('Symfony\Component', __DIR__.'/component'); - * $loader->add('Symfony', __DIR__.'/framework'); - * - * // activate the autoloader - * $loader->register(); - * - * // to enable searching the include path (eg. for PEAR packages) - * $loader->setUseIncludePath(true); - * - * In this example, if you try to use a class in the Symfony\Component - * namespace or one of its children (Symfony\Component\Console for instance), - * the autoloader will first look for the class under the component/ - * directory, and it will then fallback to the framework/ directory if not - * found before giving up. - * - * This class is loosely based on the Symfony UniversalClassLoader. - * - * @author Fabien Potencier - * @author Jordi Boggiano - * @see https://www.php-fig.org/psr/psr-0/ - * @see https://www.php-fig.org/psr/psr-4/ - */ -class ClassLoader -{ - /** @var \Closure(string):void */ - private static $includeFile; - - /** @var ?string */ - private $vendorDir; - - // PSR-4 - /** - * @var array[] - * @psalm-var array> - */ - private $prefixLengthsPsr4 = array(); - /** - * @var array[] - * @psalm-var array> - */ - private $prefixDirsPsr4 = array(); - /** - * @var array[] - * @psalm-var array - */ - private $fallbackDirsPsr4 = array(); - - // PSR-0 - /** - * @var array[] - * @psalm-var array> - */ - private $prefixesPsr0 = array(); - /** - * @var array[] - * @psalm-var array - */ - private $fallbackDirsPsr0 = array(); - - /** @var bool */ - private $useIncludePath = false; - - /** - * @var string[] - * @psalm-var array - */ - private $classMap = array(); - - /** @var bool */ - private $classMapAuthoritative = false; - - /** - * @var bool[] - * @psalm-var array - */ - private $missingClasses = array(); - - /** @var ?string */ - private $apcuPrefix; - - /** - * @var self[] - */ - private static $registeredLoaders = array(); - - /** - * @param ?string $vendorDir - */ - public function __construct($vendorDir = null) - { - $this->vendorDir = $vendorDir; - self::initializeIncludeClosure(); - } - - /** - * @return string[] - */ - public function getPrefixes() - { - if (!empty($this->prefixesPsr0)) { - return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); - } - - return array(); - } - - /** - * @return array[] - * @psalm-return array> - */ - public function getPrefixesPsr4() - { - return $this->prefixDirsPsr4; - } - - /** - * @return array[] - * @psalm-return array - */ - public function getFallbackDirs() - { - return $this->fallbackDirsPsr0; - } - - /** - * @return array[] - * @psalm-return array - */ - public function getFallbackDirsPsr4() - { - return $this->fallbackDirsPsr4; - } - - /** - * @return string[] Array of classname => path - * @psalm-return array - */ - public function getClassMap() - { - return $this->classMap; - } - - /** - * @param string[] $classMap Class to filename map - * @psalm-param array $classMap - * - * @return void - */ - public function addClassMap(array $classMap) - { - if ($this->classMap) { - $this->classMap = array_merge($this->classMap, $classMap); - } else { - $this->classMap = $classMap; - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, either - * appending or prepending to the ones previously set for this prefix. - * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories - * - * @return void - */ - public function add($prefix, $paths, $prepend = false) - { - if (!$prefix) { - if ($prepend) { - $this->fallbackDirsPsr0 = array_merge( - (array) $paths, - $this->fallbackDirsPsr0 - ); - } else { - $this->fallbackDirsPsr0 = array_merge( - $this->fallbackDirsPsr0, - (array) $paths - ); - } - - return; - } - - $first = $prefix[0]; - if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = (array) $paths; - - return; - } - if ($prepend) { - $this->prefixesPsr0[$first][$prefix] = array_merge( - (array) $paths, - $this->prefixesPsr0[$first][$prefix] - ); - } else { - $this->prefixesPsr0[$first][$prefix] = array_merge( - $this->prefixesPsr0[$first][$prefix], - (array) $paths - ); - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, either - * appending or prepending to the ones previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories - * - * @throws \InvalidArgumentException - * - * @return void - */ - public function addPsr4($prefix, $paths, $prepend = false) - { - if (!$prefix) { - // Register directories for the root namespace. - if ($prepend) { - $this->fallbackDirsPsr4 = array_merge( - (array) $paths, - $this->fallbackDirsPsr4 - ); - } else { - $this->fallbackDirsPsr4 = array_merge( - $this->fallbackDirsPsr4, - (array) $paths - ); - } - } elseif (!isset($this->prefixDirsPsr4[$prefix])) { - // Register directories for a new namespace. - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } elseif ($prepend) { - // Prepend directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - (array) $paths, - $this->prefixDirsPsr4[$prefix] - ); - } else { - // Append directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - $this->prefixDirsPsr4[$prefix], - (array) $paths - ); - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, - * replacing any others previously set for this prefix. - * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 base directories - * - * @return void - */ - public function set($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr0 = (array) $paths; - } else { - $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, - * replacing any others previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories - * - * @throws \InvalidArgumentException - * - * @return void - */ - public function setPsr4($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr4 = (array) $paths; - } else { - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } - } - - /** - * Turns on searching the include path for class files. - * - * @param bool $useIncludePath - * - * @return void - */ - public function setUseIncludePath($useIncludePath) - { - $this->useIncludePath = $useIncludePath; - } - - /** - * Can be used to check if the autoloader uses the include path to check - * for classes. - * - * @return bool - */ - public function getUseIncludePath() - { - return $this->useIncludePath; - } - - /** - * Turns off searching the prefix and fallback directories for classes - * that have not been registered with the class map. - * - * @param bool $classMapAuthoritative - * - * @return void - */ - public function setClassMapAuthoritative($classMapAuthoritative) - { - $this->classMapAuthoritative = $classMapAuthoritative; - } - - /** - * Should class lookup fail if not found in the current class map? - * - * @return bool - */ - public function isClassMapAuthoritative() - { - return $this->classMapAuthoritative; - } - - /** - * APCu prefix to use to cache found/not-found classes, if the extension is enabled. - * - * @param string|null $apcuPrefix - * - * @return void - */ - public function setApcuPrefix($apcuPrefix) - { - $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; - } - - /** - * The APCu prefix in use, or null if APCu caching is not enabled. - * - * @return string|null - */ - public function getApcuPrefix() - { - return $this->apcuPrefix; - } - - /** - * Registers this instance as an autoloader. - * - * @param bool $prepend Whether to prepend the autoloader or not - * - * @return void - */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); - - if (null === $this->vendorDir) { - return; - } - - if ($prepend) { - self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; - } else { - unset(self::$registeredLoaders[$this->vendorDir]); - self::$registeredLoaders[$this->vendorDir] = $this; - } - } - - /** - * Unregisters this instance as an autoloader. - * - * @return void - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - - if (null !== $this->vendorDir) { - unset(self::$registeredLoaders[$this->vendorDir]); - } - } - - /** - * Loads the given class or interface. - * - * @param string $class The name of the class - * @return true|null True if loaded, null otherwise - */ - public function loadClass($class) - { - if ($file = $this->findFile($class)) { - (self::$includeFile)($file); - - return true; - } - - return null; - } - - /** - * Finds the path to the file where the class is defined. - * - * @param string $class The name of the class - * - * @return string|false The path if found, false otherwise - */ - public function findFile($class) - { - // class map lookup - if (isset($this->classMap[$class])) { - return $this->classMap[$class]; - } - if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { - return false; - } - if (null !== $this->apcuPrefix) { - $file = apcu_fetch($this->apcuPrefix.$class, $hit); - if ($hit) { - return $file; - } - } - - $file = $this->findFileWithExtension($class, '.php'); - - // Search for Hack files if we are running on HHVM - if (false === $file && defined('HHVM_VERSION')) { - $file = $this->findFileWithExtension($class, '.hh'); - } - - if (null !== $this->apcuPrefix) { - apcu_add($this->apcuPrefix.$class, $file); - } - - if (false === $file) { - // Remember that this class does not exist. - $this->missingClasses[$class] = true; - } - - return $file; - } - - /** - * Returns the currently registered loaders indexed by their corresponding vendor directories. - * - * @return self[] - */ - public static function getRegisteredLoaders() - { - return self::$registeredLoaders; - } - - /** - * @param string $class - * @param string $ext - * @return string|false - */ - private function findFileWithExtension($class, $ext) - { - // PSR-4 lookup - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; - - $first = $class[0]; - if (isset($this->prefixLengthsPsr4[$first])) { - $subPath = $class; - while (false !== $lastPos = strrpos($subPath, '\\')) { - $subPath = substr($subPath, 0, $lastPos); - $search = $subPath . '\\'; - if (isset($this->prefixDirsPsr4[$search])) { - $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); - foreach ($this->prefixDirsPsr4[$search] as $dir) { - if (file_exists($file = $dir . $pathEnd)) { - return $file; - } - } - } - } - } - - // PSR-4 fallback dirs - foreach ($this->fallbackDirsPsr4 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { - return $file; - } - } - - // PSR-0 lookup - if (false !== $pos = strrpos($class, '\\')) { - // namespaced class name - $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) - . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); - } else { - // PEAR-like class name - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; - } - - if (isset($this->prefixesPsr0[$first])) { - foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { - if (0 === strpos($class, $prefix)) { - foreach ($dirs as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - } - } - } - - // PSR-0 fallback dirs - foreach ($this->fallbackDirsPsr0 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - - // PSR-0 include paths. - if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { - return $file; - } - - return false; - } - - private static function initializeIncludeClosure(): void - { - if (self::$includeFile !== null) { - return; - } - - /** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - * - * @param string $file - * @return void - */ - self::$includeFile = static function($file) { - include $file; - }; - } -} diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php deleted file mode 100644 index c6b54af7..00000000 --- a/vendor/composer/InstalledVersions.php +++ /dev/null @@ -1,352 +0,0 @@ - - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer; - -use Composer\Autoload\ClassLoader; -use Composer\Semver\VersionParser; - -/** - * This class is copied in every Composer installed project and available to all - * - * See also https://getcomposer.org/doc/07-runtime.md#installed-versions - * - * To require its presence, you can require `composer-runtime-api ^2.0` - * - * @final - */ -class InstalledVersions -{ - /** - * @var mixed[]|null - * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null - */ - private static $installed; - - /** - * @var bool|null - */ - private static $canGetVendors; - - /** - * @var array[] - * @psalm-var array}> - */ - private static $installedByVendor = array(); - - /** - * Returns a list of all package names which are present, either by being installed, replaced or provided - * - * @return string[] - * @psalm-return list - */ - public static function getInstalledPackages() - { - $packages = array(); - foreach (self::getInstalled() as $installed) { - $packages[] = array_keys($installed['versions']); - } - - if (1 === \count($packages)) { - return $packages[0]; - } - - return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); - } - - /** - * Returns a list of all package names with a specific type e.g. 'library' - * - * @param string $type - * @return string[] - * @psalm-return list - */ - public static function getInstalledPackagesByType($type) - { - $packagesByType = array(); - - foreach (self::getInstalled() as $installed) { - foreach ($installed['versions'] as $name => $package) { - if (isset($package['type']) && $package['type'] === $type) { - $packagesByType[] = $name; - } - } - } - - return $packagesByType; - } - - /** - * Checks whether the given package is installed - * - * This also returns true if the package name is provided or replaced by another package - * - * @param string $packageName - * @param bool $includeDevRequirements - * @return bool - */ - public static function isInstalled($packageName, $includeDevRequirements = true) - { - foreach (self::getInstalled() as $installed) { - if (isset($installed['versions'][$packageName])) { - return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); - } - } - - return false; - } - - /** - * Checks whether the given package satisfies a version constraint - * - * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: - * - * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') - * - * @param VersionParser $parser Install composer/semver to have access to this class and functionality - * @param string $packageName - * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package - * @return bool - */ - public static function satisfies(VersionParser $parser, $packageName, $constraint) - { - $constraint = $parser->parseConstraints($constraint); - $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); - - return $provided->matches($constraint); - } - - /** - * Returns a version constraint representing all the range(s) which are installed for a given package - * - * It is easier to use this via isInstalled() with the $constraint argument if you need to check - * whether a given version of a package is installed, and not just whether it exists - * - * @param string $packageName - * @return string Version constraint usable with composer/semver - */ - public static function getVersionRanges($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - $ranges = array(); - if (isset($installed['versions'][$packageName]['pretty_version'])) { - $ranges[] = $installed['versions'][$packageName]['pretty_version']; - } - if (array_key_exists('aliases', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); - } - if (array_key_exists('replaced', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); - } - if (array_key_exists('provided', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); - } - - return implode(' || ', $ranges); - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present - */ - public static function getVersion($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['version'])) { - return null; - } - - return $installed['versions'][$packageName]['version']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present - */ - public static function getPrettyVersion($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['pretty_version'])) { - return null; - } - - return $installed['versions'][$packageName]['pretty_version']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference - */ - public static function getReference($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['reference'])) { - return null; - } - - return $installed['versions'][$packageName]['reference']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. - */ - public static function getInstallPath($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @return array - * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} - */ - public static function getRootPackage() - { - $installed = self::getInstalled(); - - return $installed[0]['root']; - } - - /** - * Returns the raw installed.php data for custom implementations - * - * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. - * @return array[] - * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} - */ - public static function getRawData() - { - @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); - - if (null === self::$installed) { - // only require the installed.php file if this file is loaded from its dumped location, - // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 - if (substr(__DIR__, -8, 1) !== 'C') { - self::$installed = include __DIR__ . '/installed.php'; - } else { - self::$installed = array(); - } - } - - return self::$installed; - } - - /** - * Returns the raw data of all installed.php which are currently loaded for custom implementations - * - * @return array[] - * @psalm-return list}> - */ - public static function getAllRawData() - { - return self::getInstalled(); - } - - /** - * Lets you reload the static array from another file - * - * This is only useful for complex integrations in which a project needs to use - * this class but then also needs to execute another project's autoloader in process, - * and wants to ensure both projects have access to their version of installed.php. - * - * A typical case would be PHPUnit, where it would need to make sure it reads all - * the data it needs from this class, then call reload() with - * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure - * the project in which it runs can then also use this class safely, without - * interference between PHPUnit's dependencies and the project's dependencies. - * - * @param array[] $data A vendor/composer/installed.php data set - * @return void - * - * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data - */ - public static function reload($data) - { - self::$installed = $data; - self::$installedByVendor = array(); - } - - /** - * @return array[] - * @psalm-return list}> - */ - private static function getInstalled() - { - if (null === self::$canGetVendors) { - self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); - } - - $installed = array(); - - if (self::$canGetVendors) { - foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { - if (isset(self::$installedByVendor[$vendorDir])) { - $installed[] = self::$installedByVendor[$vendorDir]; - } elseif (is_file($vendorDir.'/composer/installed.php')) { - $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; - if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { - self::$installed = $installed[count($installed) - 1]; - } - } - } - } - - if (null === self::$installed) { - // only require the installed.php file if this file is loaded from its dumped location, - // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 - if (substr(__DIR__, -8, 1) !== 'C') { - self::$installed = require __DIR__ . '/installed.php'; - } else { - self::$installed = array(); - } - } - $installed[] = self::$installed; - - return $installed; - } -} diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE deleted file mode 100644 index f27399a0..00000000 --- a/vendor/composer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - -Copyright (c) Nils Adermann, Jordi Boggiano - -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/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php deleted file mode 100644 index 451c2221..00000000 --- a/vendor/composer/autoload_classmap.php +++ /dev/null @@ -1,768 +0,0 @@ - $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', - 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', - 'Hamcrest\\Arrays\\IsArray' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArray.php', - 'Hamcrest\\Arrays\\IsArrayContaining' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContaining.php', - 'Hamcrest\\Arrays\\IsArrayContainingInAnyOrder' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingInAnyOrder.php', - 'Hamcrest\\Arrays\\IsArrayContainingInOrder' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingInOrder.php', - 'Hamcrest\\Arrays\\IsArrayContainingKey' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingKey.php', - 'Hamcrest\\Arrays\\IsArrayContainingKeyValuePair' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingKeyValuePair.php', - 'Hamcrest\\Arrays\\IsArrayWithSize' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayWithSize.php', - 'Hamcrest\\Arrays\\MatchingOnce' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/MatchingOnce.php', - 'Hamcrest\\Arrays\\SeriesMatchingOnce' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/SeriesMatchingOnce.php', - 'Hamcrest\\AssertionError' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/AssertionError.php', - 'Hamcrest\\BaseDescription' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/BaseDescription.php', - 'Hamcrest\\BaseMatcher' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/BaseMatcher.php', - 'Hamcrest\\Collection\\IsEmptyTraversable' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Collection/IsEmptyTraversable.php', - 'Hamcrest\\Collection\\IsTraversableWithSize' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Collection/IsTraversableWithSize.php', - 'Hamcrest\\Core\\AllOf' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/AllOf.php', - 'Hamcrest\\Core\\AnyOf' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/AnyOf.php', - 'Hamcrest\\Core\\CombinableMatcher' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/CombinableMatcher.php', - 'Hamcrest\\Core\\DescribedAs' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/DescribedAs.php', - 'Hamcrest\\Core\\Every' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/Every.php', - 'Hamcrest\\Core\\HasToString' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/HasToString.php', - 'Hamcrest\\Core\\Is' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/Is.php', - 'Hamcrest\\Core\\IsAnything' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsAnything.php', - 'Hamcrest\\Core\\IsCollectionContaining' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsCollectionContaining.php', - 'Hamcrest\\Core\\IsEqual' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsEqual.php', - 'Hamcrest\\Core\\IsIdentical' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsIdentical.php', - 'Hamcrest\\Core\\IsInstanceOf' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsInstanceOf.php', - 'Hamcrest\\Core\\IsNot' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsNot.php', - 'Hamcrest\\Core\\IsNull' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsNull.php', - 'Hamcrest\\Core\\IsSame' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsSame.php', - 'Hamcrest\\Core\\IsTypeOf' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsTypeOf.php', - 'Hamcrest\\Core\\Set' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/Set.php', - 'Hamcrest\\Core\\ShortcutCombination' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/ShortcutCombination.php', - 'Hamcrest\\Description' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Description.php', - 'Hamcrest\\DiagnosingMatcher' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/DiagnosingMatcher.php', - 'Hamcrest\\FeatureMatcher' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/FeatureMatcher.php', - 'Hamcrest\\Internal\\SelfDescribingValue' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Internal/SelfDescribingValue.php', - 'Hamcrest\\Matcher' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Matcher.php', - 'Hamcrest\\MatcherAssert' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/MatcherAssert.php', - 'Hamcrest\\Matchers' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Matchers.php', - 'Hamcrest\\NullDescription' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/NullDescription.php', - 'Hamcrest\\Number\\IsCloseTo' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Number/IsCloseTo.php', - 'Hamcrest\\Number\\OrderingComparison' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Number/OrderingComparison.php', - 'Hamcrest\\SelfDescribing' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/SelfDescribing.php', - 'Hamcrest\\StringDescription' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/StringDescription.php', - 'Hamcrest\\Text\\IsEmptyString' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEmptyString.php', - 'Hamcrest\\Text\\IsEqualIgnoringCase' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEqualIgnoringCase.php', - 'Hamcrest\\Text\\IsEqualIgnoringWhiteSpace' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEqualIgnoringWhiteSpace.php', - 'Hamcrest\\Text\\MatchesPattern' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/MatchesPattern.php', - 'Hamcrest\\Text\\StringContains' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContains.php', - 'Hamcrest\\Text\\StringContainsIgnoringCase' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContainsIgnoringCase.php', - 'Hamcrest\\Text\\StringContainsInOrder' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContainsInOrder.php', - 'Hamcrest\\Text\\StringEndsWith' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringEndsWith.php', - 'Hamcrest\\Text\\StringStartsWith' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringStartsWith.php', - 'Hamcrest\\Text\\SubstringMatcher' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/SubstringMatcher.php', - 'Hamcrest\\TypeSafeDiagnosingMatcher' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/TypeSafeDiagnosingMatcher.php', - 'Hamcrest\\TypeSafeMatcher' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/TypeSafeMatcher.php', - 'Hamcrest\\Type\\IsArray' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsArray.php', - 'Hamcrest\\Type\\IsBoolean' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsBoolean.php', - 'Hamcrest\\Type\\IsCallable' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsCallable.php', - 'Hamcrest\\Type\\IsDouble' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsDouble.php', - 'Hamcrest\\Type\\IsInteger' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsInteger.php', - 'Hamcrest\\Type\\IsNumeric' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsNumeric.php', - 'Hamcrest\\Type\\IsObject' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsObject.php', - 'Hamcrest\\Type\\IsResource' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsResource.php', - 'Hamcrest\\Type\\IsScalar' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsScalar.php', - 'Hamcrest\\Type\\IsString' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsString.php', - 'Hamcrest\\Util' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Util.php', - 'Hamcrest\\Xml\\HasXPath' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Xml/HasXPath.php', - 'Nette\\ArgumentOutOfRangeException' => $vendorDir . '/nette/utils/src/exceptions.php', - 'Nette\\DeprecatedException' => $vendorDir . '/nette/utils/src/exceptions.php', - 'Nette\\DirectoryNotFoundException' => $vendorDir . '/nette/utils/src/exceptions.php', - 'Nette\\FileNotFoundException' => $vendorDir . '/nette/utils/src/exceptions.php', - 'Nette\\HtmlStringable' => $vendorDir . '/nette/utils/src/HtmlStringable.php', - 'Nette\\IOException' => $vendorDir . '/nette/utils/src/exceptions.php', - 'Nette\\InvalidArgumentException' => $vendorDir . '/nette/utils/src/exceptions.php', - 'Nette\\InvalidStateException' => $vendorDir . '/nette/utils/src/exceptions.php', - 'Nette\\Iterators\\CachingIterator' => $vendorDir . '/nette/utils/src/Iterators/CachingIterator.php', - 'Nette\\Iterators\\Mapper' => $vendorDir . '/nette/utils/src/Iterators/Mapper.php', - 'Nette\\Localization\\ITranslator' => $vendorDir . '/nette/utils/src/compatibility.php', - 'Nette\\Localization\\Translator' => $vendorDir . '/nette/utils/src/Translator.php', - 'Nette\\MemberAccessException' => $vendorDir . '/nette/utils/src/exceptions.php', - 'Nette\\NotImplementedException' => $vendorDir . '/nette/utils/src/exceptions.php', - 'Nette\\NotSupportedException' => $vendorDir . '/nette/utils/src/exceptions.php', - 'Nette\\OutOfRangeException' => $vendorDir . '/nette/utils/src/exceptions.php', - 'Nette\\Schema\\Context' => $vendorDir . '/nette/schema/src/Schema/Context.php', - 'Nette\\Schema\\DynamicParameter' => $vendorDir . '/nette/schema/src/Schema/DynamicParameter.php', - 'Nette\\Schema\\Elements\\AnyOf' => $vendorDir . '/nette/schema/src/Schema/Elements/AnyOf.php', - 'Nette\\Schema\\Elements\\Base' => $vendorDir . '/nette/schema/src/Schema/Elements/Base.php', - 'Nette\\Schema\\Elements\\Structure' => $vendorDir . '/nette/schema/src/Schema/Elements/Structure.php', - 'Nette\\Schema\\Elements\\Type' => $vendorDir . '/nette/schema/src/Schema/Elements/Type.php', - 'Nette\\Schema\\Expect' => $vendorDir . '/nette/schema/src/Schema/Expect.php', - 'Nette\\Schema\\Helpers' => $vendorDir . '/nette/schema/src/Schema/Helpers.php', - 'Nette\\Schema\\Message' => $vendorDir . '/nette/schema/src/Schema/Message.php', - 'Nette\\Schema\\Processor' => $vendorDir . '/nette/schema/src/Schema/Processor.php', - 'Nette\\Schema\\Schema' => $vendorDir . '/nette/schema/src/Schema/Schema.php', - 'Nette\\Schema\\ValidationException' => $vendorDir . '/nette/schema/src/Schema/ValidationException.php', - 'Nette\\SmartObject' => $vendorDir . '/nette/utils/src/SmartObject.php', - 'Nette\\StaticClass' => $vendorDir . '/nette/utils/src/StaticClass.php', - 'Nette\\UnexpectedValueException' => $vendorDir . '/nette/utils/src/exceptions.php', - 'Nette\\Utils\\ArrayHash' => $vendorDir . '/nette/utils/src/Utils/ArrayHash.php', - 'Nette\\Utils\\ArrayList' => $vendorDir . '/nette/utils/src/Utils/ArrayList.php', - 'Nette\\Utils\\Arrays' => $vendorDir . '/nette/utils/src/Utils/Arrays.php', - 'Nette\\Utils\\AssertionException' => $vendorDir . '/nette/utils/src/Utils/exceptions.php', - 'Nette\\Utils\\Callback' => $vendorDir . '/nette/utils/src/Utils/Callback.php', - 'Nette\\Utils\\DateTime' => $vendorDir . '/nette/utils/src/Utils/DateTime.php', - 'Nette\\Utils\\FileSystem' => $vendorDir . '/nette/utils/src/Utils/FileSystem.php', - 'Nette\\Utils\\Floats' => $vendorDir . '/nette/utils/src/Utils/Floats.php', - 'Nette\\Utils\\Helpers' => $vendorDir . '/nette/utils/src/Utils/Helpers.php', - 'Nette\\Utils\\Html' => $vendorDir . '/nette/utils/src/Utils/Html.php', - 'Nette\\Utils\\IHtmlString' => $vendorDir . '/nette/utils/src/compatibility.php', - 'Nette\\Utils\\Image' => $vendorDir . '/nette/utils/src/Utils/Image.php', - 'Nette\\Utils\\ImageException' => $vendorDir . '/nette/utils/src/Utils/exceptions.php', - 'Nette\\Utils\\Json' => $vendorDir . '/nette/utils/src/Utils/Json.php', - 'Nette\\Utils\\JsonException' => $vendorDir . '/nette/utils/src/Utils/exceptions.php', - 'Nette\\Utils\\ObjectHelpers' => $vendorDir . '/nette/utils/src/Utils/ObjectHelpers.php', - 'Nette\\Utils\\ObjectMixin' => $vendorDir . '/nette/utils/src/Utils/ObjectMixin.php', - 'Nette\\Utils\\Paginator' => $vendorDir . '/nette/utils/src/Utils/Paginator.php', - 'Nette\\Utils\\Random' => $vendorDir . '/nette/utils/src/Utils/Random.php', - 'Nette\\Utils\\Reflection' => $vendorDir . '/nette/utils/src/Utils/Reflection.php', - 'Nette\\Utils\\RegexpException' => $vendorDir . '/nette/utils/src/Utils/exceptions.php', - 'Nette\\Utils\\Strings' => $vendorDir . '/nette/utils/src/Utils/Strings.php', - 'Nette\\Utils\\Type' => $vendorDir . '/nette/utils/src/Utils/Type.php', - 'Nette\\Utils\\UnknownImageFileException' => $vendorDir . '/nette/utils/src/Utils/exceptions.php', - 'Nette\\Utils\\Validators' => $vendorDir . '/nette/utils/src/Utils/Validators.php', - 'Normalizer' => $vendorDir . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php', - 'PHPUnit\\Exception' => $vendorDir . '/phpunit/phpunit/src/Exception.php', - 'PHPUnit\\Framework\\ActualValueIsNotAnObjectException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/ActualValueIsNotAnObjectException.php', - 'PHPUnit\\Framework\\Assert' => $vendorDir . '/phpunit/phpunit/src/Framework/Assert.php', - 'PHPUnit\\Framework\\AssertionFailedError' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/AssertionFailedError.php', - 'PHPUnit\\Framework\\CodeCoverageException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/CodeCoverageException.php', - 'PHPUnit\\Framework\\ComparisonMethodDoesNotAcceptParameterTypeException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotAcceptParameterTypeException.php', - 'PHPUnit\\Framework\\ComparisonMethodDoesNotDeclareBoolReturnTypeException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareBoolReturnTypeException.php', - 'PHPUnit\\Framework\\ComparisonMethodDoesNotDeclareExactlyOneParameterException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareExactlyOneParameterException.php', - 'PHPUnit\\Framework\\ComparisonMethodDoesNotDeclareParameterTypeException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareParameterTypeException.php', - 'PHPUnit\\Framework\\ComparisonMethodDoesNotExistException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotExistException.php', - 'PHPUnit\\Framework\\Constraint\\ArrayHasKey' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Traversable/ArrayHasKey.php', - 'PHPUnit\\Framework\\Constraint\\BinaryOperator' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Operator/BinaryOperator.php', - 'PHPUnit\\Framework\\Constraint\\Callback' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Callback.php', - 'PHPUnit\\Framework\\Constraint\\ClassHasAttribute' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Object/ClassHasAttribute.php', - 'PHPUnit\\Framework\\Constraint\\ClassHasStaticAttribute' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Object/ClassHasStaticAttribute.php', - 'PHPUnit\\Framework\\Constraint\\Constraint' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Constraint.php', - 'PHPUnit\\Framework\\Constraint\\Count' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Cardinality/Count.php', - 'PHPUnit\\Framework\\Constraint\\DirectoryExists' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Filesystem/DirectoryExists.php', - 'PHPUnit\\Framework\\Constraint\\Exception' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Exception/Exception.php', - 'PHPUnit\\Framework\\Constraint\\ExceptionCode' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionCode.php', - 'PHPUnit\\Framework\\Constraint\\ExceptionMessage' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessage.php', - 'PHPUnit\\Framework\\Constraint\\ExceptionMessageRegularExpression' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessageRegularExpression.php', - 'PHPUnit\\Framework\\Constraint\\FileExists' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Filesystem/FileExists.php', - 'PHPUnit\\Framework\\Constraint\\GreaterThan' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Cardinality/GreaterThan.php', - 'PHPUnit\\Framework\\Constraint\\IsAnything' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/IsAnything.php', - 'PHPUnit\\Framework\\Constraint\\IsEmpty' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Cardinality/IsEmpty.php', - 'PHPUnit\\Framework\\Constraint\\IsEqual' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqual.php', - 'PHPUnit\\Framework\\Constraint\\IsEqualCanonicalizing' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualCanonicalizing.php', - 'PHPUnit\\Framework\\Constraint\\IsEqualIgnoringCase' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualIgnoringCase.php', - 'PHPUnit\\Framework\\Constraint\\IsEqualWithDelta' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualWithDelta.php', - 'PHPUnit\\Framework\\Constraint\\IsFalse' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Boolean/IsFalse.php', - 'PHPUnit\\Framework\\Constraint\\IsFinite' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Math/IsFinite.php', - 'PHPUnit\\Framework\\Constraint\\IsIdentical' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/IsIdentical.php', - 'PHPUnit\\Framework\\Constraint\\IsInfinite' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Math/IsInfinite.php', - 'PHPUnit\\Framework\\Constraint\\IsInstanceOf' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Type/IsInstanceOf.php', - 'PHPUnit\\Framework\\Constraint\\IsJson' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/String/IsJson.php', - 'PHPUnit\\Framework\\Constraint\\IsNan' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Math/IsNan.php', - 'PHPUnit\\Framework\\Constraint\\IsNull' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Type/IsNull.php', - 'PHPUnit\\Framework\\Constraint\\IsReadable' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Filesystem/IsReadable.php', - 'PHPUnit\\Framework\\Constraint\\IsTrue' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Boolean/IsTrue.php', - 'PHPUnit\\Framework\\Constraint\\IsType' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Type/IsType.php', - 'PHPUnit\\Framework\\Constraint\\IsWritable' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Filesystem/IsWritable.php', - 'PHPUnit\\Framework\\Constraint\\JsonMatches' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/JsonMatches.php', - 'PHPUnit\\Framework\\Constraint\\JsonMatchesErrorMessageProvider' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/JsonMatchesErrorMessageProvider.php', - 'PHPUnit\\Framework\\Constraint\\LessThan' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Cardinality/LessThan.php', - 'PHPUnit\\Framework\\Constraint\\LogicalAnd' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalAnd.php', - 'PHPUnit\\Framework\\Constraint\\LogicalNot' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalNot.php', - 'PHPUnit\\Framework\\Constraint\\LogicalOr' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalOr.php', - 'PHPUnit\\Framework\\Constraint\\LogicalXor' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalXor.php', - 'PHPUnit\\Framework\\Constraint\\ObjectEquals' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Object/ObjectEquals.php', - 'PHPUnit\\Framework\\Constraint\\ObjectHasAttribute' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Object/ObjectHasAttribute.php', - 'PHPUnit\\Framework\\Constraint\\Operator' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Operator/Operator.php', - 'PHPUnit\\Framework\\Constraint\\RegularExpression' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/String/RegularExpression.php', - 'PHPUnit\\Framework\\Constraint\\SameSize' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Cardinality/SameSize.php', - 'PHPUnit\\Framework\\Constraint\\StringContains' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/String/StringContains.php', - 'PHPUnit\\Framework\\Constraint\\StringEndsWith' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/String/StringEndsWith.php', - 'PHPUnit\\Framework\\Constraint\\StringMatchesFormatDescription' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/String/StringMatchesFormatDescription.php', - 'PHPUnit\\Framework\\Constraint\\StringStartsWith' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/String/StringStartsWith.php', - 'PHPUnit\\Framework\\Constraint\\TraversableContains' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContains.php', - 'PHPUnit\\Framework\\Constraint\\TraversableContainsEqual' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsEqual.php', - 'PHPUnit\\Framework\\Constraint\\TraversableContainsIdentical' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsIdentical.php', - 'PHPUnit\\Framework\\Constraint\\TraversableContainsOnly' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsOnly.php', - 'PHPUnit\\Framework\\Constraint\\UnaryOperator' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Operator/UnaryOperator.php', - 'PHPUnit\\Framework\\CoveredCodeNotExecutedException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/CoveredCodeNotExecutedException.php', - 'PHPUnit\\Framework\\DataProviderTestSuite' => $vendorDir . '/phpunit/phpunit/src/Framework/DataProviderTestSuite.php', - 'PHPUnit\\Framework\\Error' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/Error.php', - 'PHPUnit\\Framework\\ErrorTestCase' => $vendorDir . '/phpunit/phpunit/src/Framework/ErrorTestCase.php', - 'PHPUnit\\Framework\\Error\\Deprecated' => $vendorDir . '/phpunit/phpunit/src/Framework/Error/Deprecated.php', - 'PHPUnit\\Framework\\Error\\Error' => $vendorDir . '/phpunit/phpunit/src/Framework/Error/Error.php', - 'PHPUnit\\Framework\\Error\\Notice' => $vendorDir . '/phpunit/phpunit/src/Framework/Error/Notice.php', - 'PHPUnit\\Framework\\Error\\Warning' => $vendorDir . '/phpunit/phpunit/src/Framework/Error/Warning.php', - 'PHPUnit\\Framework\\Exception' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/Exception.php', - 'PHPUnit\\Framework\\ExceptionWrapper' => $vendorDir . '/phpunit/phpunit/src/Framework/ExceptionWrapper.php', - 'PHPUnit\\Framework\\ExecutionOrderDependency' => $vendorDir . '/phpunit/phpunit/src/Framework/ExecutionOrderDependency.php', - 'PHPUnit\\Framework\\ExpectationFailedException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/ExpectationFailedException.php', - 'PHPUnit\\Framework\\IncompleteTest' => $vendorDir . '/phpunit/phpunit/src/Framework/IncompleteTest.php', - 'PHPUnit\\Framework\\IncompleteTestCase' => $vendorDir . '/phpunit/phpunit/src/Framework/IncompleteTestCase.php', - 'PHPUnit\\Framework\\IncompleteTestError' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/IncompleteTestError.php', - 'PHPUnit\\Framework\\InvalidArgumentException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/InvalidArgumentException.php', - 'PHPUnit\\Framework\\InvalidCoversTargetException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/InvalidCoversTargetException.php', - 'PHPUnit\\Framework\\InvalidDataProviderException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/InvalidDataProviderException.php', - 'PHPUnit\\Framework\\InvalidParameterGroupException' => $vendorDir . '/phpunit/phpunit/src/Framework/InvalidParameterGroupException.php', - 'PHPUnit\\Framework\\MissingCoversAnnotationException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/MissingCoversAnnotationException.php', - 'PHPUnit\\Framework\\MockObject\\Api' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Api/Api.php', - 'PHPUnit\\Framework\\MockObject\\BadMethodCallException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/BadMethodCallException.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\Identity' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Builder/Identity.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\InvocationMocker' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationMocker.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\InvocationStubber' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationStubber.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\MethodNameMatch' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Builder/MethodNameMatch.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\ParametersMatch' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Builder/ParametersMatch.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\Stub' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Builder/Stub.php', - 'PHPUnit\\Framework\\MockObject\\CannotUseAddMethodsException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseAddMethodsException.php', - 'PHPUnit\\Framework\\MockObject\\CannotUseOnlyMethodsException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseOnlyMethodsException.php', - 'PHPUnit\\Framework\\MockObject\\ClassAlreadyExistsException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/ClassAlreadyExistsException.php', - 'PHPUnit\\Framework\\MockObject\\ClassIsFinalException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsFinalException.php', - 'PHPUnit\\Framework\\MockObject\\ClassIsReadonlyException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsReadonlyException.php', - 'PHPUnit\\Framework\\MockObject\\ConfigurableMethod' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/ConfigurableMethod.php', - 'PHPUnit\\Framework\\MockObject\\ConfigurableMethodsAlreadyInitializedException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/ConfigurableMethodsAlreadyInitializedException.php', - 'PHPUnit\\Framework\\MockObject\\DuplicateMethodException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/DuplicateMethodException.php', - 'PHPUnit\\Framework\\MockObject\\Exception' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/Exception.php', - 'PHPUnit\\Framework\\MockObject\\Generator' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator.php', - 'PHPUnit\\Framework\\MockObject\\IncompatibleReturnValueException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/IncompatibleReturnValueException.php', - 'PHPUnit\\Framework\\MockObject\\InvalidMethodNameException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/InvalidMethodNameException.php', - 'PHPUnit\\Framework\\MockObject\\Invocation' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Invocation.php', - 'PHPUnit\\Framework\\MockObject\\InvocationHandler' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/InvocationHandler.php', - 'PHPUnit\\Framework\\MockObject\\MatchBuilderNotFoundException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/MatchBuilderNotFoundException.php', - 'PHPUnit\\Framework\\MockObject\\Matcher' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Matcher.php', - 'PHPUnit\\Framework\\MockObject\\MatcherAlreadyRegisteredException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/MatcherAlreadyRegisteredException.php', - 'PHPUnit\\Framework\\MockObject\\Method' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Api/Method.php', - 'PHPUnit\\Framework\\MockObject\\MethodCannotBeConfiguredException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/MethodCannotBeConfiguredException.php', - 'PHPUnit\\Framework\\MockObject\\MethodNameAlreadyConfiguredException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/MethodNameAlreadyConfiguredException.php', - 'PHPUnit\\Framework\\MockObject\\MethodNameConstraint' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/MethodNameConstraint.php', - 'PHPUnit\\Framework\\MockObject\\MethodNameNotConfiguredException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/MethodNameNotConfiguredException.php', - 'PHPUnit\\Framework\\MockObject\\MethodParametersAlreadyConfiguredException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/MethodParametersAlreadyConfiguredException.php', - 'PHPUnit\\Framework\\MockObject\\MockBuilder' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/MockBuilder.php', - 'PHPUnit\\Framework\\MockObject\\MockClass' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/MockClass.php', - 'PHPUnit\\Framework\\MockObject\\MockMethod' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/MockMethod.php', - 'PHPUnit\\Framework\\MockObject\\MockMethodSet' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/MockMethodSet.php', - 'PHPUnit\\Framework\\MockObject\\MockObject' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/MockObject.php', - 'PHPUnit\\Framework\\MockObject\\MockTrait' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/MockTrait.php', - 'PHPUnit\\Framework\\MockObject\\MockType' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/MockType.php', - 'PHPUnit\\Framework\\MockObject\\OriginalConstructorInvocationRequiredException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/OriginalConstructorInvocationRequiredException.php', - 'PHPUnit\\Framework\\MockObject\\ReflectionException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/ReflectionException.php', - 'PHPUnit\\Framework\\MockObject\\ReturnValueNotConfiguredException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/ReturnValueNotConfiguredException.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\AnyInvokedCount' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Rule/AnyInvokedCount.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\AnyParameters' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Rule/AnyParameters.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\ConsecutiveParameters' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Rule/ConsecutiveParameters.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\InvocationOrder' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Rule/InvocationOrder.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\InvokedAtIndex' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtIndex.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\InvokedAtLeastCount' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastCount.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\InvokedAtLeastOnce' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastOnce.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\InvokedAtMostCount' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtMostCount.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\InvokedCount' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedCount.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\MethodName' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Rule/MethodName.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\Parameters' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Rule/Parameters.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\ParametersRule' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Rule/ParametersRule.php', - 'PHPUnit\\Framework\\MockObject\\RuntimeException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/RuntimeException.php', - 'PHPUnit\\Framework\\MockObject\\SoapExtensionNotAvailableException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/SoapExtensionNotAvailableException.php', - 'PHPUnit\\Framework\\MockObject\\Stub' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Stub.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ConsecutiveCalls' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Stub/ConsecutiveCalls.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\Exception' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Stub/Exception.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnArgument' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnArgument.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnCallback' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnCallback.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnReference' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnReference.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnSelf' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnSelf.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnStub' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnStub.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnValueMap' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnValueMap.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\Stub' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Stub/Stub.php', - 'PHPUnit\\Framework\\MockObject\\UnknownClassException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownClassException.php', - 'PHPUnit\\Framework\\MockObject\\UnknownTraitException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTraitException.php', - 'PHPUnit\\Framework\\MockObject\\UnknownTypeException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTypeException.php', - 'PHPUnit\\Framework\\MockObject\\Verifiable' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Verifiable.php', - 'PHPUnit\\Framework\\NoChildTestSuiteException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/NoChildTestSuiteException.php', - 'PHPUnit\\Framework\\OutputError' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/OutputError.php', - 'PHPUnit\\Framework\\PHPTAssertionFailedError' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/PHPTAssertionFailedError.php', - 'PHPUnit\\Framework\\Reorderable' => $vendorDir . '/phpunit/phpunit/src/Framework/Reorderable.php', - 'PHPUnit\\Framework\\RiskyTestError' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/RiskyTestError.php', - 'PHPUnit\\Framework\\SelfDescribing' => $vendorDir . '/phpunit/phpunit/src/Framework/SelfDescribing.php', - 'PHPUnit\\Framework\\SkippedTest' => $vendorDir . '/phpunit/phpunit/src/Framework/SkippedTest.php', - 'PHPUnit\\Framework\\SkippedTestCase' => $vendorDir . '/phpunit/phpunit/src/Framework/SkippedTestCase.php', - 'PHPUnit\\Framework\\SkippedTestError' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/SkippedTestError.php', - 'PHPUnit\\Framework\\SkippedTestSuiteError' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/SkippedTestSuiteError.php', - 'PHPUnit\\Framework\\SyntheticError' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/SyntheticError.php', - 'PHPUnit\\Framework\\SyntheticSkippedError' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/SyntheticSkippedError.php', - 'PHPUnit\\Framework\\Test' => $vendorDir . '/phpunit/phpunit/src/Framework/Test.php', - 'PHPUnit\\Framework\\TestBuilder' => $vendorDir . '/phpunit/phpunit/src/Framework/TestBuilder.php', - 'PHPUnit\\Framework\\TestCase' => $vendorDir . '/phpunit/phpunit/src/Framework/TestCase.php', - 'PHPUnit\\Framework\\TestFailure' => $vendorDir . '/phpunit/phpunit/src/Framework/TestFailure.php', - 'PHPUnit\\Framework\\TestListener' => $vendorDir . '/phpunit/phpunit/src/Framework/TestListener.php', - 'PHPUnit\\Framework\\TestListenerDefaultImplementation' => $vendorDir . '/phpunit/phpunit/src/Framework/TestListenerDefaultImplementation.php', - 'PHPUnit\\Framework\\TestResult' => $vendorDir . '/phpunit/phpunit/src/Framework/TestResult.php', - 'PHPUnit\\Framework\\TestSuite' => $vendorDir . '/phpunit/phpunit/src/Framework/TestSuite.php', - 'PHPUnit\\Framework\\TestSuiteIterator' => $vendorDir . '/phpunit/phpunit/src/Framework/TestSuiteIterator.php', - 'PHPUnit\\Framework\\UnintentionallyCoveredCodeError' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/UnintentionallyCoveredCodeError.php', - 'PHPUnit\\Framework\\Warning' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/Warning.php', - 'PHPUnit\\Framework\\WarningTestCase' => $vendorDir . '/phpunit/phpunit/src/Framework/WarningTestCase.php', - 'PHPUnit\\Runner\\AfterIncompleteTestHook' => $vendorDir . '/phpunit/phpunit/src/Runner/Hook/AfterIncompleteTestHook.php', - 'PHPUnit\\Runner\\AfterLastTestHook' => $vendorDir . '/phpunit/phpunit/src/Runner/Hook/AfterLastTestHook.php', - 'PHPUnit\\Runner\\AfterRiskyTestHook' => $vendorDir . '/phpunit/phpunit/src/Runner/Hook/AfterRiskyTestHook.php', - 'PHPUnit\\Runner\\AfterSkippedTestHook' => $vendorDir . '/phpunit/phpunit/src/Runner/Hook/AfterSkippedTestHook.php', - 'PHPUnit\\Runner\\AfterSuccessfulTestHook' => $vendorDir . '/phpunit/phpunit/src/Runner/Hook/AfterSuccessfulTestHook.php', - 'PHPUnit\\Runner\\AfterTestErrorHook' => $vendorDir . '/phpunit/phpunit/src/Runner/Hook/AfterTestErrorHook.php', - 'PHPUnit\\Runner\\AfterTestFailureHook' => $vendorDir . '/phpunit/phpunit/src/Runner/Hook/AfterTestFailureHook.php', - 'PHPUnit\\Runner\\AfterTestHook' => $vendorDir . '/phpunit/phpunit/src/Runner/Hook/AfterTestHook.php', - 'PHPUnit\\Runner\\AfterTestWarningHook' => $vendorDir . '/phpunit/phpunit/src/Runner/Hook/AfterTestWarningHook.php', - 'PHPUnit\\Runner\\BaseTestRunner' => $vendorDir . '/phpunit/phpunit/src/Runner/BaseTestRunner.php', - 'PHPUnit\\Runner\\BeforeFirstTestHook' => $vendorDir . '/phpunit/phpunit/src/Runner/Hook/BeforeFirstTestHook.php', - 'PHPUnit\\Runner\\BeforeTestHook' => $vendorDir . '/phpunit/phpunit/src/Runner/Hook/BeforeTestHook.php', - 'PHPUnit\\Runner\\DefaultTestResultCache' => $vendorDir . '/phpunit/phpunit/src/Runner/DefaultTestResultCache.php', - 'PHPUnit\\Runner\\Exception' => $vendorDir . '/phpunit/phpunit/src/Runner/Exception.php', - 'PHPUnit\\Runner\\Extension\\ExtensionHandler' => $vendorDir . '/phpunit/phpunit/src/Runner/Extension/ExtensionHandler.php', - 'PHPUnit\\Runner\\Extension\\PharLoader' => $vendorDir . '/phpunit/phpunit/src/Runner/Extension/PharLoader.php', - 'PHPUnit\\Runner\\Filter\\ExcludeGroupFilterIterator' => $vendorDir . '/phpunit/phpunit/src/Runner/Filter/ExcludeGroupFilterIterator.php', - 'PHPUnit\\Runner\\Filter\\Factory' => $vendorDir . '/phpunit/phpunit/src/Runner/Filter/Factory.php', - 'PHPUnit\\Runner\\Filter\\GroupFilterIterator' => $vendorDir . '/phpunit/phpunit/src/Runner/Filter/GroupFilterIterator.php', - 'PHPUnit\\Runner\\Filter\\IncludeGroupFilterIterator' => $vendorDir . '/phpunit/phpunit/src/Runner/Filter/IncludeGroupFilterIterator.php', - 'PHPUnit\\Runner\\Filter\\NameFilterIterator' => $vendorDir . '/phpunit/phpunit/src/Runner/Filter/NameFilterIterator.php', - 'PHPUnit\\Runner\\Hook' => $vendorDir . '/phpunit/phpunit/src/Runner/Hook/Hook.php', - 'PHPUnit\\Runner\\NullTestResultCache' => $vendorDir . '/phpunit/phpunit/src/Runner/NullTestResultCache.php', - 'PHPUnit\\Runner\\PhptTestCase' => $vendorDir . '/phpunit/phpunit/src/Runner/PhptTestCase.php', - 'PHPUnit\\Runner\\ResultCacheExtension' => $vendorDir . '/phpunit/phpunit/src/Runner/ResultCacheExtension.php', - 'PHPUnit\\Runner\\StandardTestSuiteLoader' => $vendorDir . '/phpunit/phpunit/src/Runner/StandardTestSuiteLoader.php', - 'PHPUnit\\Runner\\TestHook' => $vendorDir . '/phpunit/phpunit/src/Runner/Hook/TestHook.php', - 'PHPUnit\\Runner\\TestListenerAdapter' => $vendorDir . '/phpunit/phpunit/src/Runner/Hook/TestListenerAdapter.php', - 'PHPUnit\\Runner\\TestResultCache' => $vendorDir . '/phpunit/phpunit/src/Runner/TestResultCache.php', - 'PHPUnit\\Runner\\TestSuiteLoader' => $vendorDir . '/phpunit/phpunit/src/Runner/TestSuiteLoader.php', - 'PHPUnit\\Runner\\TestSuiteSorter' => $vendorDir . '/phpunit/phpunit/src/Runner/TestSuiteSorter.php', - 'PHPUnit\\Runner\\Version' => $vendorDir . '/phpunit/phpunit/src/Runner/Version.php', - 'PHPUnit\\TextUI\\CliArguments\\Builder' => $vendorDir . '/phpunit/phpunit/src/TextUI/CliArguments/Builder.php', - 'PHPUnit\\TextUI\\CliArguments\\Configuration' => $vendorDir . '/phpunit/phpunit/src/TextUI/CliArguments/Configuration.php', - 'PHPUnit\\TextUI\\CliArguments\\Exception' => $vendorDir . '/phpunit/phpunit/src/TextUI/CliArguments/Exception.php', - 'PHPUnit\\TextUI\\CliArguments\\Mapper' => $vendorDir . '/phpunit/phpunit/src/TextUI/CliArguments/Mapper.php', - 'PHPUnit\\TextUI\\Command' => $vendorDir . '/phpunit/phpunit/src/TextUI/Command.php', - 'PHPUnit\\TextUI\\DefaultResultPrinter' => $vendorDir . '/phpunit/phpunit/src/TextUI/DefaultResultPrinter.php', - 'PHPUnit\\TextUI\\Exception' => $vendorDir . '/phpunit/phpunit/src/TextUI/Exception/Exception.php', - 'PHPUnit\\TextUI\\Help' => $vendorDir . '/phpunit/phpunit/src/TextUI/Help.php', - 'PHPUnit\\TextUI\\ReflectionException' => $vendorDir . '/phpunit/phpunit/src/TextUI/Exception/ReflectionException.php', - 'PHPUnit\\TextUI\\ResultPrinter' => $vendorDir . '/phpunit/phpunit/src/TextUI/ResultPrinter.php', - 'PHPUnit\\TextUI\\RuntimeException' => $vendorDir . '/phpunit/phpunit/src/TextUI/Exception/RuntimeException.php', - 'PHPUnit\\TextUI\\TestDirectoryNotFoundException' => $vendorDir . '/phpunit/phpunit/src/TextUI/Exception/TestDirectoryNotFoundException.php', - 'PHPUnit\\TextUI\\TestFileNotFoundException' => $vendorDir . '/phpunit/phpunit/src/TextUI/Exception/TestFileNotFoundException.php', - 'PHPUnit\\TextUI\\TestRunner' => $vendorDir . '/phpunit/phpunit/src/TextUI/TestRunner.php', - 'PHPUnit\\TextUI\\TestSuiteMapper' => $vendorDir . '/phpunit/phpunit/src/TextUI/TestSuiteMapper.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\CodeCoverage' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/CodeCoverage.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\FilterMapper' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/FilterMapper.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Filter\\Directory' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Filter/Directory.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Filter\\DirectoryCollection' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Filter/DirectoryCollection.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Filter\\DirectoryCollectionIterator' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Filter/DirectoryCollectionIterator.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Report\\Clover' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Clover.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Report\\Cobertura' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Cobertura.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Report\\Crap4j' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Crap4j.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Report\\Html' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Html.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Report\\Php' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Php.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Report\\Text' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Text.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Report\\Xml' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Xml.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Configuration' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Configuration.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Constant' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/Constant.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\ConstantCollection' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/ConstantCollection.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\ConstantCollectionIterator' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/ConstantCollectionIterator.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\ConvertLogTypes' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/ConvertLogTypes.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\CoverageCloverToReport' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/CoverageCloverToReport.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\CoverageCrap4jToReport' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/CoverageCrap4jToReport.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\CoverageHtmlToReport' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/CoverageHtmlToReport.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\CoveragePhpToReport' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/CoveragePhpToReport.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\CoverageTextToReport' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/CoverageTextToReport.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\CoverageXmlToReport' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/CoverageXmlToReport.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Directory' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Filesystem/Directory.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\DirectoryCollection' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Filesystem/DirectoryCollection.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\DirectoryCollectionIterator' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Filesystem/DirectoryCollectionIterator.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Exception' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Exception.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Extension' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHPUnit/Extension.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\ExtensionCollection' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHPUnit/ExtensionCollection.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\ExtensionCollectionIterator' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHPUnit/ExtensionCollectionIterator.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\File' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Filesystem/File.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\FileCollection' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Filesystem/FileCollection.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\FileCollectionIterator' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Filesystem/FileCollectionIterator.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Generator' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Generator.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Group' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Group/Group.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\GroupCollection' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Group/GroupCollection.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\GroupCollectionIterator' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Group/GroupCollectionIterator.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Groups' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Group/Groups.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\IniSetting' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/IniSetting.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\IniSettingCollection' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/IniSettingCollection.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\IniSettingCollectionIterator' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/IniSettingCollectionIterator.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\IntroduceCoverageElement' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/IntroduceCoverageElement.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Loader' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Loader.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\LogToReportMigration' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/LogToReportMigration.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Logging\\Junit' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/Junit.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Logging\\Logging' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/Logging.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Logging\\TeamCity' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/TeamCity.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Logging\\TestDox\\Html' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/TestDox/Html.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Logging\\TestDox\\Text' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/TestDox/Text.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Logging\\TestDox\\Xml' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/TestDox/Xml.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Logging\\Text' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/Text.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Migration' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/Migration.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\MigrationBuilder' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/MigrationBuilder.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\MigrationBuilderException' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/MigrationBuilderException.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\MigrationException' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/MigrationException.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Migrator' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrator.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\MoveAttributesFromFilterWhitelistToCoverage' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveAttributesFromFilterWhitelistToCoverage.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\MoveAttributesFromRootToCoverage' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveAttributesFromRootToCoverage.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\MoveWhitelistDirectoriesToCoverage' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistDirectoriesToCoverage.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\MoveWhitelistExcludesToCoverage' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistExcludesToCoverage.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\PHPUnit' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHPUnit/PHPUnit.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Php' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/Php.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\PhpHandler' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/PhpHandler.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\RemoveCacheTokensAttribute' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/RemoveCacheTokensAttribute.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\RemoveEmptyFilter' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/RemoveEmptyFilter.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\RemoveLogTypes' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/RemoveLogTypes.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\TestDirectory' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestDirectory.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\TestDirectoryCollection' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestDirectoryCollection.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\TestDirectoryCollectionIterator' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestDirectoryCollectionIterator.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\TestFile' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestFile.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\TestFileCollection' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestFileCollection.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\TestFileCollectionIterator' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestFileCollectionIterator.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\TestSuite' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestSuite.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\TestSuiteCollection' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestSuiteCollection.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\TestSuiteCollectionIterator' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestSuiteCollectionIterator.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\UpdateSchemaLocationTo93' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/UpdateSchemaLocationTo93.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Variable' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/Variable.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\VariableCollection' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/VariableCollection.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\VariableCollectionIterator' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/VariableCollectionIterator.php', - 'PHPUnit\\Util\\Annotation\\DocBlock' => $vendorDir . '/phpunit/phpunit/src/Util/Annotation/DocBlock.php', - 'PHPUnit\\Util\\Annotation\\Registry' => $vendorDir . '/phpunit/phpunit/src/Util/Annotation/Registry.php', - 'PHPUnit\\Util\\Blacklist' => $vendorDir . '/phpunit/phpunit/src/Util/Blacklist.php', - 'PHPUnit\\Util\\Cloner' => $vendorDir . '/phpunit/phpunit/src/Util/Cloner.php', - 'PHPUnit\\Util\\Color' => $vendorDir . '/phpunit/phpunit/src/Util/Color.php', - 'PHPUnit\\Util\\ErrorHandler' => $vendorDir . '/phpunit/phpunit/src/Util/ErrorHandler.php', - 'PHPUnit\\Util\\Exception' => $vendorDir . '/phpunit/phpunit/src/Util/Exception.php', - 'PHPUnit\\Util\\ExcludeList' => $vendorDir . '/phpunit/phpunit/src/Util/ExcludeList.php', - 'PHPUnit\\Util\\FileLoader' => $vendorDir . '/phpunit/phpunit/src/Util/FileLoader.php', - 'PHPUnit\\Util\\Filesystem' => $vendorDir . '/phpunit/phpunit/src/Util/Filesystem.php', - 'PHPUnit\\Util\\Filter' => $vendorDir . '/phpunit/phpunit/src/Util/Filter.php', - 'PHPUnit\\Util\\GlobalState' => $vendorDir . '/phpunit/phpunit/src/Util/GlobalState.php', - 'PHPUnit\\Util\\InvalidDataSetException' => $vendorDir . '/phpunit/phpunit/src/Util/InvalidDataSetException.php', - 'PHPUnit\\Util\\Json' => $vendorDir . '/phpunit/phpunit/src/Util/Json.php', - 'PHPUnit\\Util\\Log\\JUnit' => $vendorDir . '/phpunit/phpunit/src/Util/Log/JUnit.php', - 'PHPUnit\\Util\\Log\\TeamCity' => $vendorDir . '/phpunit/phpunit/src/Util/Log/TeamCity.php', - 'PHPUnit\\Util\\PHP\\AbstractPhpProcess' => $vendorDir . '/phpunit/phpunit/src/Util/PHP/AbstractPhpProcess.php', - 'PHPUnit\\Util\\PHP\\DefaultPhpProcess' => $vendorDir . '/phpunit/phpunit/src/Util/PHP/DefaultPhpProcess.php', - 'PHPUnit\\Util\\PHP\\WindowsPhpProcess' => $vendorDir . '/phpunit/phpunit/src/Util/PHP/WindowsPhpProcess.php', - 'PHPUnit\\Util\\Printer' => $vendorDir . '/phpunit/phpunit/src/Util/Printer.php', - 'PHPUnit\\Util\\Reflection' => $vendorDir . '/phpunit/phpunit/src/Util/Reflection.php', - 'PHPUnit\\Util\\RegularExpression' => $vendorDir . '/phpunit/phpunit/src/Util/RegularExpression.php', - 'PHPUnit\\Util\\Test' => $vendorDir . '/phpunit/phpunit/src/Util/Test.php', - 'PHPUnit\\Util\\TestDox\\CliTestDoxPrinter' => $vendorDir . '/phpunit/phpunit/src/Util/TestDox/CliTestDoxPrinter.php', - 'PHPUnit\\Util\\TestDox\\HtmlResultPrinter' => $vendorDir . '/phpunit/phpunit/src/Util/TestDox/HtmlResultPrinter.php', - 'PHPUnit\\Util\\TestDox\\NamePrettifier' => $vendorDir . '/phpunit/phpunit/src/Util/TestDox/NamePrettifier.php', - 'PHPUnit\\Util\\TestDox\\ResultPrinter' => $vendorDir . '/phpunit/phpunit/src/Util/TestDox/ResultPrinter.php', - 'PHPUnit\\Util\\TestDox\\TestDoxPrinter' => $vendorDir . '/phpunit/phpunit/src/Util/TestDox/TestDoxPrinter.php', - 'PHPUnit\\Util\\TestDox\\TextResultPrinter' => $vendorDir . '/phpunit/phpunit/src/Util/TestDox/TextResultPrinter.php', - 'PHPUnit\\Util\\TestDox\\XmlResultPrinter' => $vendorDir . '/phpunit/phpunit/src/Util/TestDox/XmlResultPrinter.php', - 'PHPUnit\\Util\\TextTestListRenderer' => $vendorDir . '/phpunit/phpunit/src/Util/TextTestListRenderer.php', - 'PHPUnit\\Util\\Type' => $vendorDir . '/phpunit/phpunit/src/Util/Type.php', - 'PHPUnit\\Util\\VersionComparisonOperator' => $vendorDir . '/phpunit/phpunit/src/Util/VersionComparisonOperator.php', - 'PHPUnit\\Util\\XdebugFilterScriptGenerator' => $vendorDir . '/phpunit/phpunit/src/Util/XdebugFilterScriptGenerator.php', - 'PHPUnit\\Util\\Xml' => $vendorDir . '/phpunit/phpunit/src/Util/Xml.php', - 'PHPUnit\\Util\\XmlTestListRenderer' => $vendorDir . '/phpunit/phpunit/src/Util/XmlTestListRenderer.php', - 'PHPUnit\\Util\\Xml\\Exception' => $vendorDir . '/phpunit/phpunit/src/Util/Xml/Exception.php', - 'PHPUnit\\Util\\Xml\\FailedSchemaDetectionResult' => $vendorDir . '/phpunit/phpunit/src/Util/Xml/FailedSchemaDetectionResult.php', - 'PHPUnit\\Util\\Xml\\Loader' => $vendorDir . '/phpunit/phpunit/src/Util/Xml/Loader.php', - 'PHPUnit\\Util\\Xml\\SchemaDetectionResult' => $vendorDir . '/phpunit/phpunit/src/Util/Xml/SchemaDetectionResult.php', - 'PHPUnit\\Util\\Xml\\SchemaDetector' => $vendorDir . '/phpunit/phpunit/src/Util/Xml/SchemaDetector.php', - 'PHPUnit\\Util\\Xml\\SchemaFinder' => $vendorDir . '/phpunit/phpunit/src/Util/Xml/SchemaFinder.php', - 'PHPUnit\\Util\\Xml\\SnapshotNodeList' => $vendorDir . '/phpunit/phpunit/src/Util/Xml/SnapshotNodeList.php', - 'PHPUnit\\Util\\Xml\\SuccessfulSchemaDetectionResult' => $vendorDir . '/phpunit/phpunit/src/Util/Xml/SuccessfulSchemaDetectionResult.php', - 'PHPUnit\\Util\\Xml\\ValidationResult' => $vendorDir . '/phpunit/phpunit/src/Util/Xml/ValidationResult.php', - 'PHPUnit\\Util\\Xml\\Validator' => $vendorDir . '/phpunit/phpunit/src/Util/Xml/Validator.php', - 'PharIo\\Manifest\\Application' => $vendorDir . '/phar-io/manifest/src/values/Application.php', - 'PharIo\\Manifest\\ApplicationName' => $vendorDir . '/phar-io/manifest/src/values/ApplicationName.php', - 'PharIo\\Manifest\\Author' => $vendorDir . '/phar-io/manifest/src/values/Author.php', - 'PharIo\\Manifest\\AuthorCollection' => $vendorDir . '/phar-io/manifest/src/values/AuthorCollection.php', - 'PharIo\\Manifest\\AuthorCollectionIterator' => $vendorDir . '/phar-io/manifest/src/values/AuthorCollectionIterator.php', - 'PharIo\\Manifest\\AuthorElement' => $vendorDir . '/phar-io/manifest/src/xml/AuthorElement.php', - 'PharIo\\Manifest\\AuthorElementCollection' => $vendorDir . '/phar-io/manifest/src/xml/AuthorElementCollection.php', - 'PharIo\\Manifest\\BundledComponent' => $vendorDir . '/phar-io/manifest/src/values/BundledComponent.php', - 'PharIo\\Manifest\\BundledComponentCollection' => $vendorDir . '/phar-io/manifest/src/values/BundledComponentCollection.php', - 'PharIo\\Manifest\\BundledComponentCollectionIterator' => $vendorDir . '/phar-io/manifest/src/values/BundledComponentCollectionIterator.php', - 'PharIo\\Manifest\\BundlesElement' => $vendorDir . '/phar-io/manifest/src/xml/BundlesElement.php', - 'PharIo\\Manifest\\ComponentElement' => $vendorDir . '/phar-io/manifest/src/xml/ComponentElement.php', - 'PharIo\\Manifest\\ComponentElementCollection' => $vendorDir . '/phar-io/manifest/src/xml/ComponentElementCollection.php', - 'PharIo\\Manifest\\ContainsElement' => $vendorDir . '/phar-io/manifest/src/xml/ContainsElement.php', - 'PharIo\\Manifest\\CopyrightElement' => $vendorDir . '/phar-io/manifest/src/xml/CopyrightElement.php', - 'PharIo\\Manifest\\CopyrightInformation' => $vendorDir . '/phar-io/manifest/src/values/CopyrightInformation.php', - 'PharIo\\Manifest\\ElementCollection' => $vendorDir . '/phar-io/manifest/src/xml/ElementCollection.php', - 'PharIo\\Manifest\\ElementCollectionException' => $vendorDir . '/phar-io/manifest/src/exceptions/ElementCollectionException.php', - 'PharIo\\Manifest\\Email' => $vendorDir . '/phar-io/manifest/src/values/Email.php', - 'PharIo\\Manifest\\Exception' => $vendorDir . '/phar-io/manifest/src/exceptions/Exception.php', - 'PharIo\\Manifest\\ExtElement' => $vendorDir . '/phar-io/manifest/src/xml/ExtElement.php', - 'PharIo\\Manifest\\ExtElementCollection' => $vendorDir . '/phar-io/manifest/src/xml/ExtElementCollection.php', - 'PharIo\\Manifest\\Extension' => $vendorDir . '/phar-io/manifest/src/values/Extension.php', - 'PharIo\\Manifest\\ExtensionElement' => $vendorDir . '/phar-io/manifest/src/xml/ExtensionElement.php', - 'PharIo\\Manifest\\InvalidApplicationNameException' => $vendorDir . '/phar-io/manifest/src/exceptions/InvalidApplicationNameException.php', - 'PharIo\\Manifest\\InvalidEmailException' => $vendorDir . '/phar-io/manifest/src/exceptions/InvalidEmailException.php', - 'PharIo\\Manifest\\InvalidUrlException' => $vendorDir . '/phar-io/manifest/src/exceptions/InvalidUrlException.php', - 'PharIo\\Manifest\\Library' => $vendorDir . '/phar-io/manifest/src/values/Library.php', - 'PharIo\\Manifest\\License' => $vendorDir . '/phar-io/manifest/src/values/License.php', - 'PharIo\\Manifest\\LicenseElement' => $vendorDir . '/phar-io/manifest/src/xml/LicenseElement.php', - 'PharIo\\Manifest\\Manifest' => $vendorDir . '/phar-io/manifest/src/values/Manifest.php', - 'PharIo\\Manifest\\ManifestDocument' => $vendorDir . '/phar-io/manifest/src/xml/ManifestDocument.php', - 'PharIo\\Manifest\\ManifestDocumentException' => $vendorDir . '/phar-io/manifest/src/exceptions/ManifestDocumentException.php', - 'PharIo\\Manifest\\ManifestDocumentLoadingException' => $vendorDir . '/phar-io/manifest/src/exceptions/ManifestDocumentLoadingException.php', - 'PharIo\\Manifest\\ManifestDocumentMapper' => $vendorDir . '/phar-io/manifest/src/ManifestDocumentMapper.php', - 'PharIo\\Manifest\\ManifestDocumentMapperException' => $vendorDir . '/phar-io/manifest/src/exceptions/ManifestDocumentMapperException.php', - 'PharIo\\Manifest\\ManifestElement' => $vendorDir . '/phar-io/manifest/src/xml/ManifestElement.php', - 'PharIo\\Manifest\\ManifestElementException' => $vendorDir . '/phar-io/manifest/src/exceptions/ManifestElementException.php', - 'PharIo\\Manifest\\ManifestLoader' => $vendorDir . '/phar-io/manifest/src/ManifestLoader.php', - 'PharIo\\Manifest\\ManifestLoaderException' => $vendorDir . '/phar-io/manifest/src/exceptions/ManifestLoaderException.php', - 'PharIo\\Manifest\\ManifestSerializer' => $vendorDir . '/phar-io/manifest/src/ManifestSerializer.php', - 'PharIo\\Manifest\\PhpElement' => $vendorDir . '/phar-io/manifest/src/xml/PhpElement.php', - 'PharIo\\Manifest\\PhpExtensionRequirement' => $vendorDir . '/phar-io/manifest/src/values/PhpExtensionRequirement.php', - 'PharIo\\Manifest\\PhpVersionRequirement' => $vendorDir . '/phar-io/manifest/src/values/PhpVersionRequirement.php', - 'PharIo\\Manifest\\Requirement' => $vendorDir . '/phar-io/manifest/src/values/Requirement.php', - 'PharIo\\Manifest\\RequirementCollection' => $vendorDir . '/phar-io/manifest/src/values/RequirementCollection.php', - 'PharIo\\Manifest\\RequirementCollectionIterator' => $vendorDir . '/phar-io/manifest/src/values/RequirementCollectionIterator.php', - 'PharIo\\Manifest\\RequiresElement' => $vendorDir . '/phar-io/manifest/src/xml/RequiresElement.php', - 'PharIo\\Manifest\\Type' => $vendorDir . '/phar-io/manifest/src/values/Type.php', - 'PharIo\\Manifest\\Url' => $vendorDir . '/phar-io/manifest/src/values/Url.php', - 'PharIo\\Version\\AbstractVersionConstraint' => $vendorDir . '/phar-io/version/src/constraints/AbstractVersionConstraint.php', - 'PharIo\\Version\\AndVersionConstraintGroup' => $vendorDir . '/phar-io/version/src/constraints/AndVersionConstraintGroup.php', - 'PharIo\\Version\\AnyVersionConstraint' => $vendorDir . '/phar-io/version/src/constraints/AnyVersionConstraint.php', - 'PharIo\\Version\\BuildMetaData' => $vendorDir . '/phar-io/version/src/BuildMetaData.php', - 'PharIo\\Version\\ExactVersionConstraint' => $vendorDir . '/phar-io/version/src/constraints/ExactVersionConstraint.php', - 'PharIo\\Version\\Exception' => $vendorDir . '/phar-io/version/src/exceptions/Exception.php', - 'PharIo\\Version\\GreaterThanOrEqualToVersionConstraint' => $vendorDir . '/phar-io/version/src/constraints/GreaterThanOrEqualToVersionConstraint.php', - 'PharIo\\Version\\InvalidPreReleaseSuffixException' => $vendorDir . '/phar-io/version/src/exceptions/InvalidPreReleaseSuffixException.php', - 'PharIo\\Version\\InvalidVersionException' => $vendorDir . '/phar-io/version/src/exceptions/InvalidVersionException.php', - 'PharIo\\Version\\NoBuildMetaDataException' => $vendorDir . '/phar-io/version/src/exceptions/NoBuildMetaDataException.php', - 'PharIo\\Version\\NoPreReleaseSuffixException' => $vendorDir . '/phar-io/version/src/exceptions/NoPreReleaseSuffixException.php', - 'PharIo\\Version\\OrVersionConstraintGroup' => $vendorDir . '/phar-io/version/src/constraints/OrVersionConstraintGroup.php', - 'PharIo\\Version\\PreReleaseSuffix' => $vendorDir . '/phar-io/version/src/PreReleaseSuffix.php', - 'PharIo\\Version\\SpecificMajorAndMinorVersionConstraint' => $vendorDir . '/phar-io/version/src/constraints/SpecificMajorAndMinorVersionConstraint.php', - 'PharIo\\Version\\SpecificMajorVersionConstraint' => $vendorDir . '/phar-io/version/src/constraints/SpecificMajorVersionConstraint.php', - 'PharIo\\Version\\UnsupportedVersionConstraintException' => $vendorDir . '/phar-io/version/src/exceptions/UnsupportedVersionConstraintException.php', - 'PharIo\\Version\\Version' => $vendorDir . '/phar-io/version/src/Version.php', - 'PharIo\\Version\\VersionConstraint' => $vendorDir . '/phar-io/version/src/constraints/VersionConstraint.php', - 'PharIo\\Version\\VersionConstraintParser' => $vendorDir . '/phar-io/version/src/VersionConstraintParser.php', - 'PharIo\\Version\\VersionConstraintValue' => $vendorDir . '/phar-io/version/src/VersionConstraintValue.php', - 'PharIo\\Version\\VersionNumber' => $vendorDir . '/phar-io/version/src/VersionNumber.php', - 'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', - 'ReturnTypeWillChange' => $vendorDir . '/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php', - 'SebastianBergmann\\CliParser\\AmbiguousOptionException' => $vendorDir . '/sebastian/cli-parser/src/exceptions/AmbiguousOptionException.php', - 'SebastianBergmann\\CliParser\\Exception' => $vendorDir . '/sebastian/cli-parser/src/exceptions/Exception.php', - 'SebastianBergmann\\CliParser\\OptionDoesNotAllowArgumentException' => $vendorDir . '/sebastian/cli-parser/src/exceptions/OptionDoesNotAllowArgumentException.php', - 'SebastianBergmann\\CliParser\\Parser' => $vendorDir . '/sebastian/cli-parser/src/Parser.php', - 'SebastianBergmann\\CliParser\\RequiredOptionArgumentMissingException' => $vendorDir . '/sebastian/cli-parser/src/exceptions/RequiredOptionArgumentMissingException.php', - 'SebastianBergmann\\CliParser\\UnknownOptionException' => $vendorDir . '/sebastian/cli-parser/src/exceptions/UnknownOptionException.php', - 'SebastianBergmann\\CodeCoverage\\BranchAndPathCoverageNotSupportedException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/BranchAndPathCoverageNotSupportedException.php', - 'SebastianBergmann\\CodeCoverage\\CodeCoverage' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage.php', - 'SebastianBergmann\\CodeCoverage\\DeadCodeDetectionNotSupportedException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/DeadCodeDetectionNotSupportedException.php', - 'SebastianBergmann\\CodeCoverage\\Driver\\Driver' => $vendorDir . '/phpunit/php-code-coverage/src/Driver/Driver.php', - 'SebastianBergmann\\CodeCoverage\\Driver\\PathExistsButIsNotDirectoryException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/PathExistsButIsNotDirectoryException.php', - 'SebastianBergmann\\CodeCoverage\\Driver\\PcovDriver' => $vendorDir . '/phpunit/php-code-coverage/src/Driver/PcovDriver.php', - 'SebastianBergmann\\CodeCoverage\\Driver\\PcovNotAvailableException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/PcovNotAvailableException.php', - 'SebastianBergmann\\CodeCoverage\\Driver\\PhpdbgDriver' => $vendorDir . '/phpunit/php-code-coverage/src/Driver/PhpdbgDriver.php', - 'SebastianBergmann\\CodeCoverage\\Driver\\PhpdbgNotAvailableException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/PhpdbgNotAvailableException.php', - 'SebastianBergmann\\CodeCoverage\\Driver\\Selector' => $vendorDir . '/phpunit/php-code-coverage/src/Driver/Selector.php', - 'SebastianBergmann\\CodeCoverage\\Driver\\WriteOperationFailedException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/WriteOperationFailedException.php', - 'SebastianBergmann\\CodeCoverage\\Driver\\WrongXdebugVersionException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/WrongXdebugVersionException.php', - 'SebastianBergmann\\CodeCoverage\\Driver\\Xdebug2Driver' => $vendorDir . '/phpunit/php-code-coverage/src/Driver/Xdebug2Driver.php', - 'SebastianBergmann\\CodeCoverage\\Driver\\Xdebug2NotEnabledException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/Xdebug2NotEnabledException.php', - 'SebastianBergmann\\CodeCoverage\\Driver\\Xdebug3Driver' => $vendorDir . '/phpunit/php-code-coverage/src/Driver/Xdebug3Driver.php', - 'SebastianBergmann\\CodeCoverage\\Driver\\Xdebug3NotEnabledException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/Xdebug3NotEnabledException.php', - 'SebastianBergmann\\CodeCoverage\\Driver\\XdebugNotAvailableException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/XdebugNotAvailableException.php', - 'SebastianBergmann\\CodeCoverage\\Exception' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/Exception.php', - 'SebastianBergmann\\CodeCoverage\\Filter' => $vendorDir . '/phpunit/php-code-coverage/src/Filter.php', - 'SebastianBergmann\\CodeCoverage\\InvalidArgumentException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/InvalidArgumentException.php', - 'SebastianBergmann\\CodeCoverage\\NoCodeCoverageDriverAvailableException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/NoCodeCoverageDriverAvailableException.php', - 'SebastianBergmann\\CodeCoverage\\NoCodeCoverageDriverWithPathCoverageSupportAvailableException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/NoCodeCoverageDriverWithPathCoverageSupportAvailableException.php', - 'SebastianBergmann\\CodeCoverage\\Node\\AbstractNode' => $vendorDir . '/phpunit/php-code-coverage/src/Node/AbstractNode.php', - 'SebastianBergmann\\CodeCoverage\\Node\\Builder' => $vendorDir . '/phpunit/php-code-coverage/src/Node/Builder.php', - 'SebastianBergmann\\CodeCoverage\\Node\\CrapIndex' => $vendorDir . '/phpunit/php-code-coverage/src/Node/CrapIndex.php', - 'SebastianBergmann\\CodeCoverage\\Node\\Directory' => $vendorDir . '/phpunit/php-code-coverage/src/Node/Directory.php', - 'SebastianBergmann\\CodeCoverage\\Node\\File' => $vendorDir . '/phpunit/php-code-coverage/src/Node/File.php', - 'SebastianBergmann\\CodeCoverage\\Node\\Iterator' => $vendorDir . '/phpunit/php-code-coverage/src/Node/Iterator.php', - 'SebastianBergmann\\CodeCoverage\\ParserException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/ParserException.php', - 'SebastianBergmann\\CodeCoverage\\ProcessedCodeCoverageData' => $vendorDir . '/phpunit/php-code-coverage/src/ProcessedCodeCoverageData.php', - 'SebastianBergmann\\CodeCoverage\\RawCodeCoverageData' => $vendorDir . '/phpunit/php-code-coverage/src/RawCodeCoverageData.php', - 'SebastianBergmann\\CodeCoverage\\ReflectionException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/ReflectionException.php', - 'SebastianBergmann\\CodeCoverage\\ReportAlreadyFinalizedException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/ReportAlreadyFinalizedException.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Clover' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Clover.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Cobertura' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Cobertura.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Crap4j' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Crap4j.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Html\\Dashboard' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Html/Renderer/Dashboard.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Html\\Directory' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Html/Renderer/Directory.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Html\\Facade' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Html/Facade.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Html\\File' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Html/Renderer/File.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Html\\Renderer' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Html/Renderer.php', - 'SebastianBergmann\\CodeCoverage\\Report\\PHP' => $vendorDir . '/phpunit/php-code-coverage/src/Report/PHP.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Text' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Text.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\BuildInformation' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/BuildInformation.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Coverage' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/Coverage.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Directory' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/Directory.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Facade' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/Facade.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\File' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/File.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Method' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/Method.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Node' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/Node.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Project' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/Project.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Report' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/Report.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Source' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/Source.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Tests' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/Tests.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Totals' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/Totals.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Unit' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/Unit.php', - 'SebastianBergmann\\CodeCoverage\\StaticAnalysisCacheNotConfiguredException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/StaticAnalysisCacheNotConfiguredException.php', - 'SebastianBergmann\\CodeCoverage\\StaticAnalysis\\CacheWarmer' => $vendorDir . '/phpunit/php-code-coverage/src/StaticAnalysis/CacheWarmer.php', - 'SebastianBergmann\\CodeCoverage\\StaticAnalysis\\CachingFileAnalyser' => $vendorDir . '/phpunit/php-code-coverage/src/StaticAnalysis/CachingFileAnalyser.php', - 'SebastianBergmann\\CodeCoverage\\StaticAnalysis\\CodeUnitFindingVisitor' => $vendorDir . '/phpunit/php-code-coverage/src/StaticAnalysis/CodeUnitFindingVisitor.php', - 'SebastianBergmann\\CodeCoverage\\StaticAnalysis\\ExecutableLinesFindingVisitor' => $vendorDir . '/phpunit/php-code-coverage/src/StaticAnalysis/ExecutableLinesFindingVisitor.php', - 'SebastianBergmann\\CodeCoverage\\StaticAnalysis\\FileAnalyser' => $vendorDir . '/phpunit/php-code-coverage/src/StaticAnalysis/FileAnalyser.php', - 'SebastianBergmann\\CodeCoverage\\StaticAnalysis\\IgnoredLinesFindingVisitor' => $vendorDir . '/phpunit/php-code-coverage/src/StaticAnalysis/IgnoredLinesFindingVisitor.php', - 'SebastianBergmann\\CodeCoverage\\StaticAnalysis\\ParsingFileAnalyser' => $vendorDir . '/phpunit/php-code-coverage/src/StaticAnalysis/ParsingFileAnalyser.php', - 'SebastianBergmann\\CodeCoverage\\TestIdMissingException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/TestIdMissingException.php', - 'SebastianBergmann\\CodeCoverage\\UnintentionallyCoveredCodeException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/UnintentionallyCoveredCodeException.php', - 'SebastianBergmann\\CodeCoverage\\Util\\DirectoryCouldNotBeCreatedException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/DirectoryCouldNotBeCreatedException.php', - 'SebastianBergmann\\CodeCoverage\\Util\\Filesystem' => $vendorDir . '/phpunit/php-code-coverage/src/Util/Filesystem.php', - 'SebastianBergmann\\CodeCoverage\\Util\\Percentage' => $vendorDir . '/phpunit/php-code-coverage/src/Util/Percentage.php', - 'SebastianBergmann\\CodeCoverage\\Version' => $vendorDir . '/phpunit/php-code-coverage/src/Version.php', - 'SebastianBergmann\\CodeCoverage\\XmlException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/XmlException.php', - 'SebastianBergmann\\CodeUnitReverseLookup\\Wizard' => $vendorDir . '/sebastian/code-unit-reverse-lookup/src/Wizard.php', - 'SebastianBergmann\\CodeUnit\\ClassMethodUnit' => $vendorDir . '/sebastian/code-unit/src/ClassMethodUnit.php', - 'SebastianBergmann\\CodeUnit\\ClassUnit' => $vendorDir . '/sebastian/code-unit/src/ClassUnit.php', - 'SebastianBergmann\\CodeUnit\\CodeUnit' => $vendorDir . '/sebastian/code-unit/src/CodeUnit.php', - 'SebastianBergmann\\CodeUnit\\CodeUnitCollection' => $vendorDir . '/sebastian/code-unit/src/CodeUnitCollection.php', - 'SebastianBergmann\\CodeUnit\\CodeUnitCollectionIterator' => $vendorDir . '/sebastian/code-unit/src/CodeUnitCollectionIterator.php', - 'SebastianBergmann\\CodeUnit\\Exception' => $vendorDir . '/sebastian/code-unit/src/exceptions/Exception.php', - 'SebastianBergmann\\CodeUnit\\FunctionUnit' => $vendorDir . '/sebastian/code-unit/src/FunctionUnit.php', - 'SebastianBergmann\\CodeUnit\\InterfaceMethodUnit' => $vendorDir . '/sebastian/code-unit/src/InterfaceMethodUnit.php', - 'SebastianBergmann\\CodeUnit\\InterfaceUnit' => $vendorDir . '/sebastian/code-unit/src/InterfaceUnit.php', - 'SebastianBergmann\\CodeUnit\\InvalidCodeUnitException' => $vendorDir . '/sebastian/code-unit/src/exceptions/InvalidCodeUnitException.php', - 'SebastianBergmann\\CodeUnit\\Mapper' => $vendorDir . '/sebastian/code-unit/src/Mapper.php', - 'SebastianBergmann\\CodeUnit\\NoTraitException' => $vendorDir . '/sebastian/code-unit/src/exceptions/NoTraitException.php', - 'SebastianBergmann\\CodeUnit\\ReflectionException' => $vendorDir . '/sebastian/code-unit/src/exceptions/ReflectionException.php', - 'SebastianBergmann\\CodeUnit\\TraitMethodUnit' => $vendorDir . '/sebastian/code-unit/src/TraitMethodUnit.php', - 'SebastianBergmann\\CodeUnit\\TraitUnit' => $vendorDir . '/sebastian/code-unit/src/TraitUnit.php', - 'SebastianBergmann\\Comparator\\ArrayComparator' => $vendorDir . '/sebastian/comparator/src/ArrayComparator.php', - 'SebastianBergmann\\Comparator\\Comparator' => $vendorDir . '/sebastian/comparator/src/Comparator.php', - 'SebastianBergmann\\Comparator\\ComparisonFailure' => $vendorDir . '/sebastian/comparator/src/ComparisonFailure.php', - 'SebastianBergmann\\Comparator\\DOMNodeComparator' => $vendorDir . '/sebastian/comparator/src/DOMNodeComparator.php', - 'SebastianBergmann\\Comparator\\DateTimeComparator' => $vendorDir . '/sebastian/comparator/src/DateTimeComparator.php', - 'SebastianBergmann\\Comparator\\DoubleComparator' => $vendorDir . '/sebastian/comparator/src/DoubleComparator.php', - 'SebastianBergmann\\Comparator\\Exception' => $vendorDir . '/sebastian/comparator/src/exceptions/Exception.php', - 'SebastianBergmann\\Comparator\\ExceptionComparator' => $vendorDir . '/sebastian/comparator/src/ExceptionComparator.php', - 'SebastianBergmann\\Comparator\\Factory' => $vendorDir . '/sebastian/comparator/src/Factory.php', - 'SebastianBergmann\\Comparator\\MockObjectComparator' => $vendorDir . '/sebastian/comparator/src/MockObjectComparator.php', - 'SebastianBergmann\\Comparator\\NumericComparator' => $vendorDir . '/sebastian/comparator/src/NumericComparator.php', - 'SebastianBergmann\\Comparator\\ObjectComparator' => $vendorDir . '/sebastian/comparator/src/ObjectComparator.php', - 'SebastianBergmann\\Comparator\\ResourceComparator' => $vendorDir . '/sebastian/comparator/src/ResourceComparator.php', - 'SebastianBergmann\\Comparator\\RuntimeException' => $vendorDir . '/sebastian/comparator/src/exceptions/RuntimeException.php', - 'SebastianBergmann\\Comparator\\ScalarComparator' => $vendorDir . '/sebastian/comparator/src/ScalarComparator.php', - 'SebastianBergmann\\Comparator\\SplObjectStorageComparator' => $vendorDir . '/sebastian/comparator/src/SplObjectStorageComparator.php', - 'SebastianBergmann\\Comparator\\TypeComparator' => $vendorDir . '/sebastian/comparator/src/TypeComparator.php', - 'SebastianBergmann\\Complexity\\Calculator' => $vendorDir . '/sebastian/complexity/src/Calculator.php', - 'SebastianBergmann\\Complexity\\Complexity' => $vendorDir . '/sebastian/complexity/src/Complexity/Complexity.php', - 'SebastianBergmann\\Complexity\\ComplexityCalculatingVisitor' => $vendorDir . '/sebastian/complexity/src/Visitor/ComplexityCalculatingVisitor.php', - 'SebastianBergmann\\Complexity\\ComplexityCollection' => $vendorDir . '/sebastian/complexity/src/Complexity/ComplexityCollection.php', - 'SebastianBergmann\\Complexity\\ComplexityCollectionIterator' => $vendorDir . '/sebastian/complexity/src/Complexity/ComplexityCollectionIterator.php', - 'SebastianBergmann\\Complexity\\CyclomaticComplexityCalculatingVisitor' => $vendorDir . '/sebastian/complexity/src/Visitor/CyclomaticComplexityCalculatingVisitor.php', - 'SebastianBergmann\\Complexity\\Exception' => $vendorDir . '/sebastian/complexity/src/Exception/Exception.php', - 'SebastianBergmann\\Complexity\\RuntimeException' => $vendorDir . '/sebastian/complexity/src/Exception/RuntimeException.php', - 'SebastianBergmann\\Diff\\Chunk' => $vendorDir . '/sebastian/diff/src/Chunk.php', - 'SebastianBergmann\\Diff\\ConfigurationException' => $vendorDir . '/sebastian/diff/src/Exception/ConfigurationException.php', - 'SebastianBergmann\\Diff\\Diff' => $vendorDir . '/sebastian/diff/src/Diff.php', - 'SebastianBergmann\\Diff\\Differ' => $vendorDir . '/sebastian/diff/src/Differ.php', - 'SebastianBergmann\\Diff\\Exception' => $vendorDir . '/sebastian/diff/src/Exception/Exception.php', - 'SebastianBergmann\\Diff\\InvalidArgumentException' => $vendorDir . '/sebastian/diff/src/Exception/InvalidArgumentException.php', - 'SebastianBergmann\\Diff\\Line' => $vendorDir . '/sebastian/diff/src/Line.php', - 'SebastianBergmann\\Diff\\LongestCommonSubsequenceCalculator' => $vendorDir . '/sebastian/diff/src/LongestCommonSubsequenceCalculator.php', - 'SebastianBergmann\\Diff\\MemoryEfficientLongestCommonSubsequenceCalculator' => $vendorDir . '/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php', - 'SebastianBergmann\\Diff\\Output\\AbstractChunkOutputBuilder' => $vendorDir . '/sebastian/diff/src/Output/AbstractChunkOutputBuilder.php', - 'SebastianBergmann\\Diff\\Output\\DiffOnlyOutputBuilder' => $vendorDir . '/sebastian/diff/src/Output/DiffOnlyOutputBuilder.php', - 'SebastianBergmann\\Diff\\Output\\DiffOutputBuilderInterface' => $vendorDir . '/sebastian/diff/src/Output/DiffOutputBuilderInterface.php', - 'SebastianBergmann\\Diff\\Output\\StrictUnifiedDiffOutputBuilder' => $vendorDir . '/sebastian/diff/src/Output/StrictUnifiedDiffOutputBuilder.php', - 'SebastianBergmann\\Diff\\Output\\UnifiedDiffOutputBuilder' => $vendorDir . '/sebastian/diff/src/Output/UnifiedDiffOutputBuilder.php', - 'SebastianBergmann\\Diff\\Parser' => $vendorDir . '/sebastian/diff/src/Parser.php', - 'SebastianBergmann\\Diff\\TimeEfficientLongestCommonSubsequenceCalculator' => $vendorDir . '/sebastian/diff/src/TimeEfficientLongestCommonSubsequenceCalculator.php', - 'SebastianBergmann\\Environment\\Console' => $vendorDir . '/sebastian/environment/src/Console.php', - 'SebastianBergmann\\Environment\\OperatingSystem' => $vendorDir . '/sebastian/environment/src/OperatingSystem.php', - 'SebastianBergmann\\Environment\\Runtime' => $vendorDir . '/sebastian/environment/src/Runtime.php', - 'SebastianBergmann\\Exporter\\Exporter' => $vendorDir . '/sebastian/exporter/src/Exporter.php', - 'SebastianBergmann\\FileIterator\\Facade' => $vendorDir . '/phpunit/php-file-iterator/src/Facade.php', - 'SebastianBergmann\\FileIterator\\Factory' => $vendorDir . '/phpunit/php-file-iterator/src/Factory.php', - 'SebastianBergmann\\FileIterator\\Iterator' => $vendorDir . '/phpunit/php-file-iterator/src/Iterator.php', - 'SebastianBergmann\\GlobalState\\CodeExporter' => $vendorDir . '/sebastian/global-state/src/CodeExporter.php', - 'SebastianBergmann\\GlobalState\\Exception' => $vendorDir . '/sebastian/global-state/src/exceptions/Exception.php', - 'SebastianBergmann\\GlobalState\\ExcludeList' => $vendorDir . '/sebastian/global-state/src/ExcludeList.php', - 'SebastianBergmann\\GlobalState\\Restorer' => $vendorDir . '/sebastian/global-state/src/Restorer.php', - 'SebastianBergmann\\GlobalState\\RuntimeException' => $vendorDir . '/sebastian/global-state/src/exceptions/RuntimeException.php', - 'SebastianBergmann\\GlobalState\\Snapshot' => $vendorDir . '/sebastian/global-state/src/Snapshot.php', - 'SebastianBergmann\\Invoker\\Exception' => $vendorDir . '/phpunit/php-invoker/src/exceptions/Exception.php', - 'SebastianBergmann\\Invoker\\Invoker' => $vendorDir . '/phpunit/php-invoker/src/Invoker.php', - 'SebastianBergmann\\Invoker\\ProcessControlExtensionNotLoadedException' => $vendorDir . '/phpunit/php-invoker/src/exceptions/ProcessControlExtensionNotLoadedException.php', - 'SebastianBergmann\\Invoker\\TimeoutException' => $vendorDir . '/phpunit/php-invoker/src/exceptions/TimeoutException.php', - 'SebastianBergmann\\LinesOfCode\\Counter' => $vendorDir . '/sebastian/lines-of-code/src/Counter.php', - 'SebastianBergmann\\LinesOfCode\\Exception' => $vendorDir . '/sebastian/lines-of-code/src/Exception/Exception.php', - 'SebastianBergmann\\LinesOfCode\\IllogicalValuesException' => $vendorDir . '/sebastian/lines-of-code/src/Exception/IllogicalValuesException.php', - 'SebastianBergmann\\LinesOfCode\\LineCountingVisitor' => $vendorDir . '/sebastian/lines-of-code/src/LineCountingVisitor.php', - 'SebastianBergmann\\LinesOfCode\\LinesOfCode' => $vendorDir . '/sebastian/lines-of-code/src/LinesOfCode.php', - 'SebastianBergmann\\LinesOfCode\\NegativeValueException' => $vendorDir . '/sebastian/lines-of-code/src/Exception/NegativeValueException.php', - 'SebastianBergmann\\LinesOfCode\\RuntimeException' => $vendorDir . '/sebastian/lines-of-code/src/Exception/RuntimeException.php', - 'SebastianBergmann\\ObjectEnumerator\\Enumerator' => $vendorDir . '/sebastian/object-enumerator/src/Enumerator.php', - 'SebastianBergmann\\ObjectEnumerator\\Exception' => $vendorDir . '/sebastian/object-enumerator/src/Exception.php', - 'SebastianBergmann\\ObjectEnumerator\\InvalidArgumentException' => $vendorDir . '/sebastian/object-enumerator/src/InvalidArgumentException.php', - 'SebastianBergmann\\ObjectReflector\\Exception' => $vendorDir . '/sebastian/object-reflector/src/Exception.php', - 'SebastianBergmann\\ObjectReflector\\InvalidArgumentException' => $vendorDir . '/sebastian/object-reflector/src/InvalidArgumentException.php', - 'SebastianBergmann\\ObjectReflector\\ObjectReflector' => $vendorDir . '/sebastian/object-reflector/src/ObjectReflector.php', - 'SebastianBergmann\\RecursionContext\\Context' => $vendorDir . '/sebastian/recursion-context/src/Context.php', - 'SebastianBergmann\\RecursionContext\\Exception' => $vendorDir . '/sebastian/recursion-context/src/Exception.php', - 'SebastianBergmann\\RecursionContext\\InvalidArgumentException' => $vendorDir . '/sebastian/recursion-context/src/InvalidArgumentException.php', - 'SebastianBergmann\\ResourceOperations\\ResourceOperations' => $vendorDir . '/sebastian/resource-operations/src/ResourceOperations.php', - 'SebastianBergmann\\Template\\Exception' => $vendorDir . '/phpunit/php-text-template/src/exceptions/Exception.php', - 'SebastianBergmann\\Template\\InvalidArgumentException' => $vendorDir . '/phpunit/php-text-template/src/exceptions/InvalidArgumentException.php', - 'SebastianBergmann\\Template\\RuntimeException' => $vendorDir . '/phpunit/php-text-template/src/exceptions/RuntimeException.php', - 'SebastianBergmann\\Template\\Template' => $vendorDir . '/phpunit/php-text-template/src/Template.php', - 'SebastianBergmann\\Timer\\Duration' => $vendorDir . '/phpunit/php-timer/src/Duration.php', - 'SebastianBergmann\\Timer\\Exception' => $vendorDir . '/phpunit/php-timer/src/exceptions/Exception.php', - 'SebastianBergmann\\Timer\\NoActiveTimerException' => $vendorDir . '/phpunit/php-timer/src/exceptions/NoActiveTimerException.php', - 'SebastianBergmann\\Timer\\ResourceUsageFormatter' => $vendorDir . '/phpunit/php-timer/src/ResourceUsageFormatter.php', - 'SebastianBergmann\\Timer\\TimeSinceStartOfRequestNotAvailableException' => $vendorDir . '/phpunit/php-timer/src/exceptions/TimeSinceStartOfRequestNotAvailableException.php', - 'SebastianBergmann\\Timer\\Timer' => $vendorDir . '/phpunit/php-timer/src/Timer.php', - 'SebastianBergmann\\Type\\CallableType' => $vendorDir . '/sebastian/type/src/type/CallableType.php', - 'SebastianBergmann\\Type\\Exception' => $vendorDir . '/sebastian/type/src/exception/Exception.php', - 'SebastianBergmann\\Type\\FalseType' => $vendorDir . '/sebastian/type/src/type/FalseType.php', - 'SebastianBergmann\\Type\\GenericObjectType' => $vendorDir . '/sebastian/type/src/type/GenericObjectType.php', - 'SebastianBergmann\\Type\\IntersectionType' => $vendorDir . '/sebastian/type/src/type/IntersectionType.php', - 'SebastianBergmann\\Type\\IterableType' => $vendorDir . '/sebastian/type/src/type/IterableType.php', - 'SebastianBergmann\\Type\\MixedType' => $vendorDir . '/sebastian/type/src/type/MixedType.php', - 'SebastianBergmann\\Type\\NeverType' => $vendorDir . '/sebastian/type/src/type/NeverType.php', - 'SebastianBergmann\\Type\\NullType' => $vendorDir . '/sebastian/type/src/type/NullType.php', - 'SebastianBergmann\\Type\\ObjectType' => $vendorDir . '/sebastian/type/src/type/ObjectType.php', - 'SebastianBergmann\\Type\\Parameter' => $vendorDir . '/sebastian/type/src/Parameter.php', - 'SebastianBergmann\\Type\\ReflectionMapper' => $vendorDir . '/sebastian/type/src/ReflectionMapper.php', - 'SebastianBergmann\\Type\\RuntimeException' => $vendorDir . '/sebastian/type/src/exception/RuntimeException.php', - 'SebastianBergmann\\Type\\SimpleType' => $vendorDir . '/sebastian/type/src/type/SimpleType.php', - 'SebastianBergmann\\Type\\StaticType' => $vendorDir . '/sebastian/type/src/type/StaticType.php', - 'SebastianBergmann\\Type\\TrueType' => $vendorDir . '/sebastian/type/src/type/TrueType.php', - 'SebastianBergmann\\Type\\Type' => $vendorDir . '/sebastian/type/src/type/Type.php', - 'SebastianBergmann\\Type\\TypeName' => $vendorDir . '/sebastian/type/src/TypeName.php', - 'SebastianBergmann\\Type\\UnionType' => $vendorDir . '/sebastian/type/src/type/UnionType.php', - 'SebastianBergmann\\Type\\UnknownType' => $vendorDir . '/sebastian/type/src/type/UnknownType.php', - 'SebastianBergmann\\Type\\VoidType' => $vendorDir . '/sebastian/type/src/type/VoidType.php', - 'SebastianBergmann\\Version' => $vendorDir . '/sebastian/version/src/Version.php', - 'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', - 'TheSeer\\Tokenizer\\Exception' => $vendorDir . '/theseer/tokenizer/src/Exception.php', - 'TheSeer\\Tokenizer\\NamespaceUri' => $vendorDir . '/theseer/tokenizer/src/NamespaceUri.php', - 'TheSeer\\Tokenizer\\NamespaceUriException' => $vendorDir . '/theseer/tokenizer/src/NamespaceUriException.php', - 'TheSeer\\Tokenizer\\Token' => $vendorDir . '/theseer/tokenizer/src/Token.php', - 'TheSeer\\Tokenizer\\TokenCollection' => $vendorDir . '/theseer/tokenizer/src/TokenCollection.php', - 'TheSeer\\Tokenizer\\TokenCollectionException' => $vendorDir . '/theseer/tokenizer/src/TokenCollectionException.php', - 'TheSeer\\Tokenizer\\Tokenizer' => $vendorDir . '/theseer/tokenizer/src/Tokenizer.php', - 'TheSeer\\Tokenizer\\XMLSerializer' => $vendorDir . '/theseer/tokenizer/src/XMLSerializer.php', - 'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', - 'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', -); diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php deleted file mode 100644 index 8e5778a8..00000000 --- a/vendor/composer/autoload_files.php +++ /dev/null @@ -1,34 +0,0 @@ - $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', - '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', - 'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php', - '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', - '25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php', - 'f598d06aa772fa33d905e87be6398fb1' => $vendorDir . '/symfony/polyfill-intl-idn/bootstrap.php', - '667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php', - 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', - '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', - 'def43f6c87e4f8dfd0c9e1b1bab14fe8' => $vendorDir . '/symfony/polyfill-iconv/bootstrap.php', - '8825ede83f2f289127722d4e842cf7e8' => $vendorDir . '/symfony/polyfill-intl-grapheme/bootstrap.php', - '23c18046f52bef3eea034657bafda50f' => $vendorDir . '/symfony/polyfill-php81/bootstrap.php', - 'b6b991a57620e2fb6b2f66f03fe9ddc2' => $vendorDir . '/symfony/string/Resources/functions.php', - 'e39a8b23c42d4e1452234d762b03835a' => $vendorDir . '/ramsey/uuid/src/functions.php', - '09f6b20656683369174dd6fa83b7e5fb' => $vendorDir . '/symfony/polyfill-uuid/bootstrap.php', - 'a1105708a18b76903365ca1c4aa61b02' => $vendorDir . '/symfony/translation/Resources/functions.php', - '6124b4c8570aa390c21fafd04a26c69f' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php', - '35a6ad97d21e794e7e22a17d806652e4' => $vendorDir . '/nunomaduro/termwind/src/Functions.php', - '3074abeef0bacf5811f59e9dee6311d1' => $vendorDir . '/spatie/ray/src/helpers.php', - '265b4faa2b3a9766332744949e83bf97' => $vendorDir . '/laravel/framework/src/Illuminate/Collections/helpers.php', - 'c7a3c339e7e14b60e06a2d7fcce9476b' => $vendorDir . '/laravel/framework/src/Illuminate/Events/functions.php', - 'f0906e6318348a765ffb6eb24e0d0938' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/helpers.php', - '58571171fd5812e6e447dce228f52f4d' => $vendorDir . '/laravel/framework/src/Illuminate/Support/helpers.php', - 'eb46fcca3fbadc07be542e9e42c8b07c' => $vendorDir . '/orchestra/testbench-core/src/helpers.php', - 'ec07570ca5a812141189b1fa81503674' => $vendorDir . '/phpunit/phpunit/src/Framework/Assert/Functions.php', -); diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php deleted file mode 100644 index 6698266a..00000000 --- a/vendor/composer/autoload_namespaces.php +++ /dev/null @@ -1,11 +0,0 @@ - array($vendorDir . '/pimple/pimple/src'), - 'Mockery' => array($vendorDir . '/mockery/mockery/library'), -); diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php deleted file mode 100644 index fb2638c6..00000000 --- a/vendor/composer/autoload_psr4.php +++ /dev/null @@ -1,88 +0,0 @@ - array($vendorDir . '/voku/portable-ascii/src/voku'), - 'ZBateson\\StreamDecorators\\' => array($vendorDir . '/zbateson/stream-decorators/src'), - 'ZBateson\\MbWrapper\\' => array($vendorDir . '/zbateson/mb-wrapper/src'), - 'ZBateson\\MailMimeParser\\' => array($vendorDir . '/zbateson/mail-mime-parser/src'), - 'Webmozart\\Assert\\' => array($vendorDir . '/webmozart/assert/src'), - 'TijsVerkoyen\\CssToInlineStyles\\' => array($vendorDir . '/tijsverkoyen/css-to-inline-styles/src'), - 'Termwind\\' => array($vendorDir . '/nunomaduro/termwind/src'), - 'Symfony\\Polyfill\\Uuid\\' => array($vendorDir . '/symfony/polyfill-uuid'), - 'Symfony\\Polyfill\\Php81\\' => array($vendorDir . '/symfony/polyfill-php81'), - '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\\Polyfill\\Intl\\Normalizer\\' => array($vendorDir . '/symfony/polyfill-intl-normalizer'), - 'Symfony\\Polyfill\\Intl\\Idn\\' => array($vendorDir . '/symfony/polyfill-intl-idn'), - 'Symfony\\Polyfill\\Intl\\Grapheme\\' => array($vendorDir . '/symfony/polyfill-intl-grapheme'), - 'Symfony\\Polyfill\\Iconv\\' => array($vendorDir . '/symfony/polyfill-iconv'), - 'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'), - 'Symfony\\Contracts\\Translation\\' => array($vendorDir . '/symfony/translation-contracts'), - 'Symfony\\Contracts\\Service\\' => array($vendorDir . '/symfony/service-contracts'), - 'Symfony\\Contracts\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher-contracts'), - 'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'), - 'Symfony\\Component\\VarDumper\\' => array($vendorDir . '/symfony/var-dumper'), - 'Symfony\\Component\\Uid\\' => array($vendorDir . '/symfony/uid'), - 'Symfony\\Component\\Translation\\' => array($vendorDir . '/symfony/translation'), - 'Symfony\\Component\\String\\' => array($vendorDir . '/symfony/string'), - 'Symfony\\Component\\Stopwatch\\' => array($vendorDir . '/symfony/stopwatch'), - 'Symfony\\Component\\Routing\\' => array($vendorDir . '/symfony/routing'), - 'Symfony\\Component\\Process\\' => array($vendorDir . '/symfony/process'), - 'Symfony\\Component\\Mime\\' => array($vendorDir . '/symfony/mime'), - 'Symfony\\Component\\Mailer\\' => array($vendorDir . '/symfony/mailer'), - 'Symfony\\Component\\HttpKernel\\' => array($vendorDir . '/symfony/http-kernel'), - 'Symfony\\Component\\HttpFoundation\\' => array($vendorDir . '/symfony/http-foundation'), - 'Symfony\\Component\\Finder\\' => array($vendorDir . '/symfony/finder'), - 'Symfony\\Component\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher'), - 'Symfony\\Component\\ErrorHandler\\' => array($vendorDir . '/symfony/error-handler'), - 'Symfony\\Component\\CssSelector\\' => array($vendorDir . '/symfony/css-selector'), - 'Symfony\\Component\\Console\\' => array($vendorDir . '/symfony/console'), - 'Spatie\\Ray\\' => array($vendorDir . '/spatie/ray/src'), - 'Spatie\\Macroable\\' => array($vendorDir . '/spatie/macroable/src'), - 'Spatie\\LaravelRay\\' => array($vendorDir . '/spatie/laravel-ray/src'), - 'Spatie\\LaravelPackageTools\\' => array($vendorDir . '/spatie/laravel-package-tools/src'), - 'Spatie\\Backtrace\\' => array($vendorDir . '/spatie/backtrace/src'), - 'Ramsey\\Uuid\\' => array($vendorDir . '/ramsey/uuid/src'), - 'Ramsey\\Collection\\' => array($vendorDir . '/ramsey/collection/src'), - 'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'), - 'Psr\\Log\\' => array($vendorDir . '/psr/log/src'), - 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'), - 'Psr\\EventDispatcher\\' => array($vendorDir . '/psr/event-dispatcher/src'), - 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'), - 'PhpParser\\' => array($vendorDir . '/nikic/php-parser/lib/PhpParser'), - 'PhpOption\\' => array($vendorDir . '/phpoption/phpoption/src/PhpOption'), - 'Orchestra\\Testbench\\' => array($vendorDir . '/orchestra/testbench-core/src'), - 'Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'), - 'Leeovery\\LaravelPlaywright\\Tests\\' => array($baseDir . '/tests'), - 'Leeovery\\LaravelPlaywright\\' => array($baseDir . '/src'), - 'League\\MimeTypeDetection\\' => array($vendorDir . '/league/mime-type-detection/src'), - 'League\\Flysystem\\' => array($vendorDir . '/league/flysystem/src'), - 'League\\Config\\' => array($vendorDir . '/league/config/src'), - 'League\\CommonMark\\' => array($vendorDir . '/league/commonmark/src'), - 'Laravel\\SerializableClosure\\' => array($vendorDir . '/laravel/serializable-closure/src'), - 'Illuminate\\Support\\' => array($vendorDir . '/laravel/framework/src/Illuminate/Macroable', $vendorDir . '/laravel/framework/src/Illuminate/Collections', $vendorDir . '/laravel/framework/src/Illuminate/Conditionable'), - 'Illuminate\\' => array($vendorDir . '/laravel/framework/src/Illuminate'), - 'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'), - 'GrahamCampbell\\ResultType\\' => array($vendorDir . '/graham-campbell/result-type/src'), - 'Fruitcake\\Cors\\' => array($vendorDir . '/fruitcake/php-cors/src'), - 'Faker\\' => array($vendorDir . '/fakerphp/faker/src/Faker'), - 'Egulias\\EmailValidator\\' => array($vendorDir . '/egulias/email-validator/src'), - 'Dotenv\\' => array($vendorDir . '/vlucas/phpdotenv/src'), - 'Doctrine\\Instantiator\\' => array($vendorDir . '/doctrine/instantiator/src/Doctrine/Instantiator'), - 'Doctrine\\Inflector\\' => array($vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector'), - 'Doctrine\\Common\\Lexer\\' => array($vendorDir . '/doctrine/lexer/lib/Doctrine/Common/Lexer'), - 'Dflydev\\DotAccessData\\' => array($vendorDir . '/dflydev/dot-access-data/src'), - 'DeepCopy\\' => array($vendorDir . '/myclabs/deep-copy/src/DeepCopy'), - 'Database\\Seeders\\' => array($vendorDir . '/laravel/pint/database/seeders'), - 'Database\\Factories\\' => array($vendorDir . '/laravel/pint/database/factories'), - 'Cron\\' => array($vendorDir . '/dragonmantank/cron-expression/src/Cron'), - 'Carbon\\' => array($vendorDir . '/nesbot/carbon/src/Carbon'), - 'Brick\\Math\\' => array($vendorDir . '/brick/math/src'), - 'App\\' => array($vendorDir . '/laravel/pint/app'), -); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php deleted file mode 100644 index e81ef1e3..00000000 --- a/vendor/composer/autoload_real.php +++ /dev/null @@ -1,50 +0,0 @@ -register(true); - - $filesToLoad = \Composer\Autoload\ComposerStaticInit7ce0b5d2b3ba4805b268758ccd54321b::$files; - $requireFile = static function ($fileIdentifier, $file) { - if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - - require $file; - } - }; - foreach ($filesToLoad as $fileIdentifier => $file) { - ($requireFile)($fileIdentifier, $file); - } - - return $loader; - } -} diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php deleted file mode 100644 index 9679c8f9..00000000 --- a/vendor/composer/autoload_static.php +++ /dev/null @@ -1,1284 +0,0 @@ - __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', - '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', - 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php', - '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', - '25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php', - 'f598d06aa772fa33d905e87be6398fb1' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/bootstrap.php', - '667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php', - 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', - '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', - 'def43f6c87e4f8dfd0c9e1b1bab14fe8' => __DIR__ . '/..' . '/symfony/polyfill-iconv/bootstrap.php', - '8825ede83f2f289127722d4e842cf7e8' => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme/bootstrap.php', - '23c18046f52bef3eea034657bafda50f' => __DIR__ . '/..' . '/symfony/polyfill-php81/bootstrap.php', - 'b6b991a57620e2fb6b2f66f03fe9ddc2' => __DIR__ . '/..' . '/symfony/string/Resources/functions.php', - 'e39a8b23c42d4e1452234d762b03835a' => __DIR__ . '/..' . '/ramsey/uuid/src/functions.php', - '09f6b20656683369174dd6fa83b7e5fb' => __DIR__ . '/..' . '/symfony/polyfill-uuid/bootstrap.php', - 'a1105708a18b76903365ca1c4aa61b02' => __DIR__ . '/..' . '/symfony/translation/Resources/functions.php', - '6124b4c8570aa390c21fafd04a26c69f' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php', - '35a6ad97d21e794e7e22a17d806652e4' => __DIR__ . '/..' . '/nunomaduro/termwind/src/Functions.php', - '3074abeef0bacf5811f59e9dee6311d1' => __DIR__ . '/..' . '/spatie/ray/src/helpers.php', - '265b4faa2b3a9766332744949e83bf97' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Collections/helpers.php', - 'c7a3c339e7e14b60e06a2d7fcce9476b' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Events/functions.php', - 'f0906e6318348a765ffb6eb24e0d0938' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/helpers.php', - '58571171fd5812e6e447dce228f52f4d' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Support/helpers.php', - 'eb46fcca3fbadc07be542e9e42c8b07c' => __DIR__ . '/..' . '/orchestra/testbench-core/src/helpers.php', - 'ec07570ca5a812141189b1fa81503674' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Assert/Functions.php', - ); - - public static $prefixLengthsPsr4 = array ( - 'v' => - array ( - 'voku\\' => 5, - ), - 'Z' => - array ( - 'ZBateson\\StreamDecorators\\' => 26, - 'ZBateson\\MbWrapper\\' => 19, - 'ZBateson\\MailMimeParser\\' => 24, - ), - 'W' => - array ( - 'Webmozart\\Assert\\' => 17, - ), - 'T' => - array ( - 'TijsVerkoyen\\CssToInlineStyles\\' => 31, - 'Termwind\\' => 9, - ), - 'S' => - array ( - 'Symfony\\Polyfill\\Uuid\\' => 22, - 'Symfony\\Polyfill\\Php81\\' => 23, - 'Symfony\\Polyfill\\Php80\\' => 23, - 'Symfony\\Polyfill\\Php72\\' => 23, - 'Symfony\\Polyfill\\Mbstring\\' => 26, - 'Symfony\\Polyfill\\Intl\\Normalizer\\' => 33, - 'Symfony\\Polyfill\\Intl\\Idn\\' => 26, - 'Symfony\\Polyfill\\Intl\\Grapheme\\' => 31, - 'Symfony\\Polyfill\\Iconv\\' => 23, - 'Symfony\\Polyfill\\Ctype\\' => 23, - 'Symfony\\Contracts\\Translation\\' => 30, - 'Symfony\\Contracts\\Service\\' => 26, - 'Symfony\\Contracts\\EventDispatcher\\' => 34, - 'Symfony\\Component\\Yaml\\' => 23, - 'Symfony\\Component\\VarDumper\\' => 28, - 'Symfony\\Component\\Uid\\' => 22, - 'Symfony\\Component\\Translation\\' => 30, - 'Symfony\\Component\\String\\' => 25, - 'Symfony\\Component\\Stopwatch\\' => 28, - 'Symfony\\Component\\Routing\\' => 26, - 'Symfony\\Component\\Process\\' => 26, - 'Symfony\\Component\\Mime\\' => 23, - 'Symfony\\Component\\Mailer\\' => 25, - 'Symfony\\Component\\HttpKernel\\' => 29, - 'Symfony\\Component\\HttpFoundation\\' => 33, - 'Symfony\\Component\\Finder\\' => 25, - 'Symfony\\Component\\EventDispatcher\\' => 34, - 'Symfony\\Component\\ErrorHandler\\' => 31, - 'Symfony\\Component\\CssSelector\\' => 30, - 'Symfony\\Component\\Console\\' => 26, - 'Spatie\\Ray\\' => 11, - 'Spatie\\Macroable\\' => 17, - 'Spatie\\LaravelRay\\' => 18, - 'Spatie\\LaravelPackageTools\\' => 27, - 'Spatie\\Backtrace\\' => 17, - ), - 'R' => - array ( - 'Ramsey\\Uuid\\' => 12, - 'Ramsey\\Collection\\' => 18, - ), - 'P' => - array ( - 'Psr\\SimpleCache\\' => 16, - 'Psr\\Log\\' => 8, - 'Psr\\Http\\Message\\' => 17, - 'Psr\\EventDispatcher\\' => 20, - 'Psr\\Container\\' => 14, - 'PhpParser\\' => 10, - 'PhpOption\\' => 10, - ), - 'O' => - array ( - 'Orchestra\\Testbench\\' => 20, - ), - 'M' => - array ( - 'Monolog\\' => 8, - ), - 'L' => - array ( - 'Leeovery\\LaravelPlaywright\\Tests\\' => 33, - 'Leeovery\\LaravelPlaywright\\' => 27, - 'League\\MimeTypeDetection\\' => 25, - 'League\\Flysystem\\' => 17, - 'League\\Config\\' => 14, - 'League\\CommonMark\\' => 18, - 'Laravel\\SerializableClosure\\' => 28, - ), - 'I' => - array ( - 'Illuminate\\Support\\' => 19, - 'Illuminate\\' => 11, - ), - 'G' => - array ( - 'GuzzleHttp\\Psr7\\' => 16, - 'GrahamCampbell\\ResultType\\' => 26, - ), - 'F' => - array ( - 'Fruitcake\\Cors\\' => 15, - 'Faker\\' => 6, - ), - 'E' => - array ( - 'Egulias\\EmailValidator\\' => 23, - ), - 'D' => - array ( - 'Dotenv\\' => 7, - 'Doctrine\\Instantiator\\' => 22, - 'Doctrine\\Inflector\\' => 19, - 'Doctrine\\Common\\Lexer\\' => 22, - 'Dflydev\\DotAccessData\\' => 22, - 'DeepCopy\\' => 9, - 'Database\\Seeders\\' => 17, - 'Database\\Factories\\' => 19, - ), - 'C' => - array ( - 'Cron\\' => 5, - 'Carbon\\' => 7, - ), - 'B' => - array ( - 'Brick\\Math\\' => 11, - ), - 'A' => - array ( - 'App\\' => 4, - ), - ); - - public static $prefixDirsPsr4 = array ( - 'voku\\' => - array ( - 0 => __DIR__ . '/..' . '/voku/portable-ascii/src/voku', - ), - 'ZBateson\\StreamDecorators\\' => - array ( - 0 => __DIR__ . '/..' . '/zbateson/stream-decorators/src', - ), - 'ZBateson\\MbWrapper\\' => - array ( - 0 => __DIR__ . '/..' . '/zbateson/mb-wrapper/src', - ), - 'ZBateson\\MailMimeParser\\' => - array ( - 0 => __DIR__ . '/..' . '/zbateson/mail-mime-parser/src', - ), - 'Webmozart\\Assert\\' => - array ( - 0 => __DIR__ . '/..' . '/webmozart/assert/src', - ), - 'TijsVerkoyen\\CssToInlineStyles\\' => - array ( - 0 => __DIR__ . '/..' . '/tijsverkoyen/css-to-inline-styles/src', - ), - 'Termwind\\' => - array ( - 0 => __DIR__ . '/..' . '/nunomaduro/termwind/src', - ), - 'Symfony\\Polyfill\\Uuid\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-uuid', - ), - 'Symfony\\Polyfill\\Php81\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-php81', - ), - '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\\Polyfill\\Intl\\Normalizer\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer', - ), - 'Symfony\\Polyfill\\Intl\\Idn\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-intl-idn', - ), - 'Symfony\\Polyfill\\Intl\\Grapheme\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme', - ), - 'Symfony\\Polyfill\\Iconv\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-iconv', - ), - 'Symfony\\Polyfill\\Ctype\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-ctype', - ), - 'Symfony\\Contracts\\Translation\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/translation-contracts', - ), - 'Symfony\\Contracts\\Service\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/service-contracts', - ), - 'Symfony\\Contracts\\EventDispatcher\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/event-dispatcher-contracts', - ), - 'Symfony\\Component\\Yaml\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/yaml', - ), - 'Symfony\\Component\\VarDumper\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/var-dumper', - ), - 'Symfony\\Component\\Uid\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/uid', - ), - 'Symfony\\Component\\Translation\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/translation', - ), - 'Symfony\\Component\\String\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/string', - ), - 'Symfony\\Component\\Stopwatch\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/stopwatch', - ), - 'Symfony\\Component\\Routing\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/routing', - ), - 'Symfony\\Component\\Process\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/process', - ), - 'Symfony\\Component\\Mime\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/mime', - ), - 'Symfony\\Component\\Mailer\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/mailer', - ), - 'Symfony\\Component\\HttpKernel\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/http-kernel', - ), - 'Symfony\\Component\\HttpFoundation\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/http-foundation', - ), - 'Symfony\\Component\\Finder\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/finder', - ), - 'Symfony\\Component\\EventDispatcher\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/event-dispatcher', - ), - 'Symfony\\Component\\ErrorHandler\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/error-handler', - ), - 'Symfony\\Component\\CssSelector\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/css-selector', - ), - 'Symfony\\Component\\Console\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/console', - ), - 'Spatie\\Ray\\' => - array ( - 0 => __DIR__ . '/..' . '/spatie/ray/src', - ), - 'Spatie\\Macroable\\' => - array ( - 0 => __DIR__ . '/..' . '/spatie/macroable/src', - ), - 'Spatie\\LaravelRay\\' => - array ( - 0 => __DIR__ . '/..' . '/spatie/laravel-ray/src', - ), - 'Spatie\\LaravelPackageTools\\' => - array ( - 0 => __DIR__ . '/..' . '/spatie/laravel-package-tools/src', - ), - 'Spatie\\Backtrace\\' => - array ( - 0 => __DIR__ . '/..' . '/spatie/backtrace/src', - ), - 'Ramsey\\Uuid\\' => - array ( - 0 => __DIR__ . '/..' . '/ramsey/uuid/src', - ), - 'Ramsey\\Collection\\' => - array ( - 0 => __DIR__ . '/..' . '/ramsey/collection/src', - ), - 'Psr\\SimpleCache\\' => - array ( - 0 => __DIR__ . '/..' . '/psr/simple-cache/src', - ), - 'Psr\\Log\\' => - array ( - 0 => __DIR__ . '/..' . '/psr/log/src', - ), - 'Psr\\Http\\Message\\' => - array ( - 0 => __DIR__ . '/..' . '/psr/http-factory/src', - 1 => __DIR__ . '/..' . '/psr/http-message/src', - ), - 'Psr\\EventDispatcher\\' => - array ( - 0 => __DIR__ . '/..' . '/psr/event-dispatcher/src', - ), - 'Psr\\Container\\' => - array ( - 0 => __DIR__ . '/..' . '/psr/container/src', - ), - 'PhpParser\\' => - array ( - 0 => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser', - ), - 'PhpOption\\' => - array ( - 0 => __DIR__ . '/..' . '/phpoption/phpoption/src/PhpOption', - ), - 'Orchestra\\Testbench\\' => - array ( - 0 => __DIR__ . '/..' . '/orchestra/testbench-core/src', - ), - 'Monolog\\' => - array ( - 0 => __DIR__ . '/..' . '/monolog/monolog/src/Monolog', - ), - 'Leeovery\\LaravelPlaywright\\Tests\\' => - array ( - 0 => __DIR__ . '/../..' . '/tests', - ), - 'Leeovery\\LaravelPlaywright\\' => - array ( - 0 => __DIR__ . '/../..' . '/src', - ), - 'League\\MimeTypeDetection\\' => - array ( - 0 => __DIR__ . '/..' . '/league/mime-type-detection/src', - ), - 'League\\Flysystem\\' => - array ( - 0 => __DIR__ . '/..' . '/league/flysystem/src', - ), - 'League\\Config\\' => - array ( - 0 => __DIR__ . '/..' . '/league/config/src', - ), - 'League\\CommonMark\\' => - array ( - 0 => __DIR__ . '/..' . '/league/commonmark/src', - ), - 'Laravel\\SerializableClosure\\' => - array ( - 0 => __DIR__ . '/..' . '/laravel/serializable-closure/src', - ), - 'Illuminate\\Support\\' => - array ( - 0 => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Macroable', - 1 => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Collections', - 2 => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Conditionable', - ), - 'Illuminate\\' => - array ( - 0 => __DIR__ . '/..' . '/laravel/framework/src/Illuminate', - ), - 'GuzzleHttp\\Psr7\\' => - array ( - 0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src', - ), - 'GrahamCampbell\\ResultType\\' => - array ( - 0 => __DIR__ . '/..' . '/graham-campbell/result-type/src', - ), - 'Fruitcake\\Cors\\' => - array ( - 0 => __DIR__ . '/..' . '/fruitcake/php-cors/src', - ), - 'Faker\\' => - array ( - 0 => __DIR__ . '/..' . '/fakerphp/faker/src/Faker', - ), - 'Egulias\\EmailValidator\\' => - array ( - 0 => __DIR__ . '/..' . '/egulias/email-validator/src', - ), - 'Dotenv\\' => - array ( - 0 => __DIR__ . '/..' . '/vlucas/phpdotenv/src', - ), - 'Doctrine\\Instantiator\\' => - array ( - 0 => __DIR__ . '/..' . '/doctrine/instantiator/src/Doctrine/Instantiator', - ), - 'Doctrine\\Inflector\\' => - array ( - 0 => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector', - ), - 'Doctrine\\Common\\Lexer\\' => - array ( - 0 => __DIR__ . '/..' . '/doctrine/lexer/lib/Doctrine/Common/Lexer', - ), - 'Dflydev\\DotAccessData\\' => - array ( - 0 => __DIR__ . '/..' . '/dflydev/dot-access-data/src', - ), - 'DeepCopy\\' => - array ( - 0 => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy', - ), - 'Database\\Seeders\\' => - array ( - 0 => __DIR__ . '/..' . '/laravel/pint/database/seeders', - ), - 'Database\\Factories\\' => - array ( - 0 => __DIR__ . '/..' . '/laravel/pint/database/factories', - ), - 'Cron\\' => - array ( - 0 => __DIR__ . '/..' . '/dragonmantank/cron-expression/src/Cron', - ), - 'Carbon\\' => - array ( - 0 => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon', - ), - 'Brick\\Math\\' => - array ( - 0 => __DIR__ . '/..' . '/brick/math/src', - ), - 'App\\' => - array ( - 0 => __DIR__ . '/..' . '/laravel/pint/app', - ), - ); - - public static $prefixesPsr0 = array ( - 'P' => - array ( - 'Pimple' => - array ( - 0 => __DIR__ . '/..' . '/pimple/pimple/src', - ), - ), - 'M' => - array ( - 'Mockery' => - array ( - 0 => __DIR__ . '/..' . '/mockery/mockery/library', - ), - ), - ); - - public static $classMap = array ( - 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', - 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', - 'Hamcrest\\Arrays\\IsArray' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArray.php', - 'Hamcrest\\Arrays\\IsArrayContaining' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContaining.php', - 'Hamcrest\\Arrays\\IsArrayContainingInAnyOrder' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingInAnyOrder.php', - 'Hamcrest\\Arrays\\IsArrayContainingInOrder' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingInOrder.php', - 'Hamcrest\\Arrays\\IsArrayContainingKey' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingKey.php', - 'Hamcrest\\Arrays\\IsArrayContainingKeyValuePair' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingKeyValuePair.php', - 'Hamcrest\\Arrays\\IsArrayWithSize' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayWithSize.php', - 'Hamcrest\\Arrays\\MatchingOnce' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/MatchingOnce.php', - 'Hamcrest\\Arrays\\SeriesMatchingOnce' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/SeriesMatchingOnce.php', - 'Hamcrest\\AssertionError' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/AssertionError.php', - 'Hamcrest\\BaseDescription' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/BaseDescription.php', - 'Hamcrest\\BaseMatcher' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/BaseMatcher.php', - 'Hamcrest\\Collection\\IsEmptyTraversable' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Collection/IsEmptyTraversable.php', - 'Hamcrest\\Collection\\IsTraversableWithSize' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Collection/IsTraversableWithSize.php', - 'Hamcrest\\Core\\AllOf' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/AllOf.php', - 'Hamcrest\\Core\\AnyOf' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/AnyOf.php', - 'Hamcrest\\Core\\CombinableMatcher' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/CombinableMatcher.php', - 'Hamcrest\\Core\\DescribedAs' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/DescribedAs.php', - 'Hamcrest\\Core\\Every' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/Every.php', - 'Hamcrest\\Core\\HasToString' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/HasToString.php', - 'Hamcrest\\Core\\Is' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/Is.php', - 'Hamcrest\\Core\\IsAnything' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsAnything.php', - 'Hamcrest\\Core\\IsCollectionContaining' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsCollectionContaining.php', - 'Hamcrest\\Core\\IsEqual' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsEqual.php', - 'Hamcrest\\Core\\IsIdentical' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsIdentical.php', - 'Hamcrest\\Core\\IsInstanceOf' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsInstanceOf.php', - 'Hamcrest\\Core\\IsNot' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsNot.php', - 'Hamcrest\\Core\\IsNull' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsNull.php', - 'Hamcrest\\Core\\IsSame' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsSame.php', - 'Hamcrest\\Core\\IsTypeOf' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsTypeOf.php', - 'Hamcrest\\Core\\Set' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/Set.php', - 'Hamcrest\\Core\\ShortcutCombination' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/ShortcutCombination.php', - 'Hamcrest\\Description' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Description.php', - 'Hamcrest\\DiagnosingMatcher' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/DiagnosingMatcher.php', - 'Hamcrest\\FeatureMatcher' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/FeatureMatcher.php', - 'Hamcrest\\Internal\\SelfDescribingValue' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Internal/SelfDescribingValue.php', - 'Hamcrest\\Matcher' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Matcher.php', - 'Hamcrest\\MatcherAssert' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/MatcherAssert.php', - 'Hamcrest\\Matchers' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Matchers.php', - 'Hamcrest\\NullDescription' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/NullDescription.php', - 'Hamcrest\\Number\\IsCloseTo' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Number/IsCloseTo.php', - 'Hamcrest\\Number\\OrderingComparison' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Number/OrderingComparison.php', - 'Hamcrest\\SelfDescribing' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/SelfDescribing.php', - 'Hamcrest\\StringDescription' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/StringDescription.php', - 'Hamcrest\\Text\\IsEmptyString' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEmptyString.php', - 'Hamcrest\\Text\\IsEqualIgnoringCase' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEqualIgnoringCase.php', - 'Hamcrest\\Text\\IsEqualIgnoringWhiteSpace' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEqualIgnoringWhiteSpace.php', - 'Hamcrest\\Text\\MatchesPattern' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/MatchesPattern.php', - 'Hamcrest\\Text\\StringContains' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContains.php', - 'Hamcrest\\Text\\StringContainsIgnoringCase' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContainsIgnoringCase.php', - 'Hamcrest\\Text\\StringContainsInOrder' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContainsInOrder.php', - 'Hamcrest\\Text\\StringEndsWith' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringEndsWith.php', - 'Hamcrest\\Text\\StringStartsWith' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringStartsWith.php', - 'Hamcrest\\Text\\SubstringMatcher' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/SubstringMatcher.php', - 'Hamcrest\\TypeSafeDiagnosingMatcher' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/TypeSafeDiagnosingMatcher.php', - 'Hamcrest\\TypeSafeMatcher' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/TypeSafeMatcher.php', - 'Hamcrest\\Type\\IsArray' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsArray.php', - 'Hamcrest\\Type\\IsBoolean' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsBoolean.php', - 'Hamcrest\\Type\\IsCallable' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsCallable.php', - 'Hamcrest\\Type\\IsDouble' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsDouble.php', - 'Hamcrest\\Type\\IsInteger' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsInteger.php', - 'Hamcrest\\Type\\IsNumeric' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsNumeric.php', - 'Hamcrest\\Type\\IsObject' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsObject.php', - 'Hamcrest\\Type\\IsResource' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsResource.php', - 'Hamcrest\\Type\\IsScalar' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsScalar.php', - 'Hamcrest\\Type\\IsString' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsString.php', - 'Hamcrest\\Util' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Util.php', - 'Hamcrest\\Xml\\HasXPath' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Xml/HasXPath.php', - 'Nette\\ArgumentOutOfRangeException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php', - 'Nette\\DeprecatedException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php', - 'Nette\\DirectoryNotFoundException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php', - 'Nette\\FileNotFoundException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php', - 'Nette\\HtmlStringable' => __DIR__ . '/..' . '/nette/utils/src/HtmlStringable.php', - 'Nette\\IOException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php', - 'Nette\\InvalidArgumentException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php', - 'Nette\\InvalidStateException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php', - 'Nette\\Iterators\\CachingIterator' => __DIR__ . '/..' . '/nette/utils/src/Iterators/CachingIterator.php', - 'Nette\\Iterators\\Mapper' => __DIR__ . '/..' . '/nette/utils/src/Iterators/Mapper.php', - 'Nette\\Localization\\ITranslator' => __DIR__ . '/..' . '/nette/utils/src/compatibility.php', - 'Nette\\Localization\\Translator' => __DIR__ . '/..' . '/nette/utils/src/Translator.php', - 'Nette\\MemberAccessException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php', - 'Nette\\NotImplementedException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php', - 'Nette\\NotSupportedException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php', - 'Nette\\OutOfRangeException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php', - 'Nette\\Schema\\Context' => __DIR__ . '/..' . '/nette/schema/src/Schema/Context.php', - 'Nette\\Schema\\DynamicParameter' => __DIR__ . '/..' . '/nette/schema/src/Schema/DynamicParameter.php', - 'Nette\\Schema\\Elements\\AnyOf' => __DIR__ . '/..' . '/nette/schema/src/Schema/Elements/AnyOf.php', - 'Nette\\Schema\\Elements\\Base' => __DIR__ . '/..' . '/nette/schema/src/Schema/Elements/Base.php', - 'Nette\\Schema\\Elements\\Structure' => __DIR__ . '/..' . '/nette/schema/src/Schema/Elements/Structure.php', - 'Nette\\Schema\\Elements\\Type' => __DIR__ . '/..' . '/nette/schema/src/Schema/Elements/Type.php', - 'Nette\\Schema\\Expect' => __DIR__ . '/..' . '/nette/schema/src/Schema/Expect.php', - 'Nette\\Schema\\Helpers' => __DIR__ . '/..' . '/nette/schema/src/Schema/Helpers.php', - 'Nette\\Schema\\Message' => __DIR__ . '/..' . '/nette/schema/src/Schema/Message.php', - 'Nette\\Schema\\Processor' => __DIR__ . '/..' . '/nette/schema/src/Schema/Processor.php', - 'Nette\\Schema\\Schema' => __DIR__ . '/..' . '/nette/schema/src/Schema/Schema.php', - 'Nette\\Schema\\ValidationException' => __DIR__ . '/..' . '/nette/schema/src/Schema/ValidationException.php', - 'Nette\\SmartObject' => __DIR__ . '/..' . '/nette/utils/src/SmartObject.php', - 'Nette\\StaticClass' => __DIR__ . '/..' . '/nette/utils/src/StaticClass.php', - 'Nette\\UnexpectedValueException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php', - 'Nette\\Utils\\ArrayHash' => __DIR__ . '/..' . '/nette/utils/src/Utils/ArrayHash.php', - 'Nette\\Utils\\ArrayList' => __DIR__ . '/..' . '/nette/utils/src/Utils/ArrayList.php', - 'Nette\\Utils\\Arrays' => __DIR__ . '/..' . '/nette/utils/src/Utils/Arrays.php', - 'Nette\\Utils\\AssertionException' => __DIR__ . '/..' . '/nette/utils/src/Utils/exceptions.php', - 'Nette\\Utils\\Callback' => __DIR__ . '/..' . '/nette/utils/src/Utils/Callback.php', - 'Nette\\Utils\\DateTime' => __DIR__ . '/..' . '/nette/utils/src/Utils/DateTime.php', - 'Nette\\Utils\\FileSystem' => __DIR__ . '/..' . '/nette/utils/src/Utils/FileSystem.php', - 'Nette\\Utils\\Floats' => __DIR__ . '/..' . '/nette/utils/src/Utils/Floats.php', - 'Nette\\Utils\\Helpers' => __DIR__ . '/..' . '/nette/utils/src/Utils/Helpers.php', - 'Nette\\Utils\\Html' => __DIR__ . '/..' . '/nette/utils/src/Utils/Html.php', - 'Nette\\Utils\\IHtmlString' => __DIR__ . '/..' . '/nette/utils/src/compatibility.php', - 'Nette\\Utils\\Image' => __DIR__ . '/..' . '/nette/utils/src/Utils/Image.php', - 'Nette\\Utils\\ImageException' => __DIR__ . '/..' . '/nette/utils/src/Utils/exceptions.php', - 'Nette\\Utils\\Json' => __DIR__ . '/..' . '/nette/utils/src/Utils/Json.php', - 'Nette\\Utils\\JsonException' => __DIR__ . '/..' . '/nette/utils/src/Utils/exceptions.php', - 'Nette\\Utils\\ObjectHelpers' => __DIR__ . '/..' . '/nette/utils/src/Utils/ObjectHelpers.php', - 'Nette\\Utils\\ObjectMixin' => __DIR__ . '/..' . '/nette/utils/src/Utils/ObjectMixin.php', - 'Nette\\Utils\\Paginator' => __DIR__ . '/..' . '/nette/utils/src/Utils/Paginator.php', - 'Nette\\Utils\\Random' => __DIR__ . '/..' . '/nette/utils/src/Utils/Random.php', - 'Nette\\Utils\\Reflection' => __DIR__ . '/..' . '/nette/utils/src/Utils/Reflection.php', - 'Nette\\Utils\\RegexpException' => __DIR__ . '/..' . '/nette/utils/src/Utils/exceptions.php', - 'Nette\\Utils\\Strings' => __DIR__ . '/..' . '/nette/utils/src/Utils/Strings.php', - 'Nette\\Utils\\Type' => __DIR__ . '/..' . '/nette/utils/src/Utils/Type.php', - 'Nette\\Utils\\UnknownImageFileException' => __DIR__ . '/..' . '/nette/utils/src/Utils/exceptions.php', - 'Nette\\Utils\\Validators' => __DIR__ . '/..' . '/nette/utils/src/Utils/Validators.php', - 'Normalizer' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php', - 'PHPUnit\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/Exception.php', - 'PHPUnit\\Framework\\ActualValueIsNotAnObjectException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/ActualValueIsNotAnObjectException.php', - 'PHPUnit\\Framework\\Assert' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Assert.php', - 'PHPUnit\\Framework\\AssertionFailedError' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/AssertionFailedError.php', - 'PHPUnit\\Framework\\CodeCoverageException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/CodeCoverageException.php', - 'PHPUnit\\Framework\\ComparisonMethodDoesNotAcceptParameterTypeException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotAcceptParameterTypeException.php', - 'PHPUnit\\Framework\\ComparisonMethodDoesNotDeclareBoolReturnTypeException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareBoolReturnTypeException.php', - 'PHPUnit\\Framework\\ComparisonMethodDoesNotDeclareExactlyOneParameterException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareExactlyOneParameterException.php', - 'PHPUnit\\Framework\\ComparisonMethodDoesNotDeclareParameterTypeException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareParameterTypeException.php', - 'PHPUnit\\Framework\\ComparisonMethodDoesNotExistException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotExistException.php', - 'PHPUnit\\Framework\\Constraint\\ArrayHasKey' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Traversable/ArrayHasKey.php', - 'PHPUnit\\Framework\\Constraint\\BinaryOperator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Operator/BinaryOperator.php', - 'PHPUnit\\Framework\\Constraint\\Callback' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Callback.php', - 'PHPUnit\\Framework\\Constraint\\ClassHasAttribute' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Object/ClassHasAttribute.php', - 'PHPUnit\\Framework\\Constraint\\ClassHasStaticAttribute' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Object/ClassHasStaticAttribute.php', - 'PHPUnit\\Framework\\Constraint\\Constraint' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Constraint.php', - 'PHPUnit\\Framework\\Constraint\\Count' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Cardinality/Count.php', - 'PHPUnit\\Framework\\Constraint\\DirectoryExists' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Filesystem/DirectoryExists.php', - 'PHPUnit\\Framework\\Constraint\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Exception/Exception.php', - 'PHPUnit\\Framework\\Constraint\\ExceptionCode' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionCode.php', - 'PHPUnit\\Framework\\Constraint\\ExceptionMessage' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessage.php', - 'PHPUnit\\Framework\\Constraint\\ExceptionMessageRegularExpression' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessageRegularExpression.php', - 'PHPUnit\\Framework\\Constraint\\FileExists' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Filesystem/FileExists.php', - 'PHPUnit\\Framework\\Constraint\\GreaterThan' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Cardinality/GreaterThan.php', - 'PHPUnit\\Framework\\Constraint\\IsAnything' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/IsAnything.php', - 'PHPUnit\\Framework\\Constraint\\IsEmpty' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Cardinality/IsEmpty.php', - 'PHPUnit\\Framework\\Constraint\\IsEqual' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqual.php', - 'PHPUnit\\Framework\\Constraint\\IsEqualCanonicalizing' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualCanonicalizing.php', - 'PHPUnit\\Framework\\Constraint\\IsEqualIgnoringCase' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualIgnoringCase.php', - 'PHPUnit\\Framework\\Constraint\\IsEqualWithDelta' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualWithDelta.php', - 'PHPUnit\\Framework\\Constraint\\IsFalse' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Boolean/IsFalse.php', - 'PHPUnit\\Framework\\Constraint\\IsFinite' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Math/IsFinite.php', - 'PHPUnit\\Framework\\Constraint\\IsIdentical' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/IsIdentical.php', - 'PHPUnit\\Framework\\Constraint\\IsInfinite' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Math/IsInfinite.php', - 'PHPUnit\\Framework\\Constraint\\IsInstanceOf' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Type/IsInstanceOf.php', - 'PHPUnit\\Framework\\Constraint\\IsJson' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/String/IsJson.php', - 'PHPUnit\\Framework\\Constraint\\IsNan' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Math/IsNan.php', - 'PHPUnit\\Framework\\Constraint\\IsNull' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Type/IsNull.php', - 'PHPUnit\\Framework\\Constraint\\IsReadable' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Filesystem/IsReadable.php', - 'PHPUnit\\Framework\\Constraint\\IsTrue' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Boolean/IsTrue.php', - 'PHPUnit\\Framework\\Constraint\\IsType' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Type/IsType.php', - 'PHPUnit\\Framework\\Constraint\\IsWritable' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Filesystem/IsWritable.php', - 'PHPUnit\\Framework\\Constraint\\JsonMatches' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/JsonMatches.php', - 'PHPUnit\\Framework\\Constraint\\JsonMatchesErrorMessageProvider' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/JsonMatchesErrorMessageProvider.php', - 'PHPUnit\\Framework\\Constraint\\LessThan' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Cardinality/LessThan.php', - 'PHPUnit\\Framework\\Constraint\\LogicalAnd' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalAnd.php', - 'PHPUnit\\Framework\\Constraint\\LogicalNot' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalNot.php', - 'PHPUnit\\Framework\\Constraint\\LogicalOr' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalOr.php', - 'PHPUnit\\Framework\\Constraint\\LogicalXor' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalXor.php', - 'PHPUnit\\Framework\\Constraint\\ObjectEquals' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Object/ObjectEquals.php', - 'PHPUnit\\Framework\\Constraint\\ObjectHasAttribute' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Object/ObjectHasAttribute.php', - 'PHPUnit\\Framework\\Constraint\\Operator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Operator/Operator.php', - 'PHPUnit\\Framework\\Constraint\\RegularExpression' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/String/RegularExpression.php', - 'PHPUnit\\Framework\\Constraint\\SameSize' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Cardinality/SameSize.php', - 'PHPUnit\\Framework\\Constraint\\StringContains' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/String/StringContains.php', - 'PHPUnit\\Framework\\Constraint\\StringEndsWith' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/String/StringEndsWith.php', - 'PHPUnit\\Framework\\Constraint\\StringMatchesFormatDescription' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/String/StringMatchesFormatDescription.php', - 'PHPUnit\\Framework\\Constraint\\StringStartsWith' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/String/StringStartsWith.php', - 'PHPUnit\\Framework\\Constraint\\TraversableContains' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContains.php', - 'PHPUnit\\Framework\\Constraint\\TraversableContainsEqual' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsEqual.php', - 'PHPUnit\\Framework\\Constraint\\TraversableContainsIdentical' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsIdentical.php', - 'PHPUnit\\Framework\\Constraint\\TraversableContainsOnly' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsOnly.php', - 'PHPUnit\\Framework\\Constraint\\UnaryOperator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Operator/UnaryOperator.php', - 'PHPUnit\\Framework\\CoveredCodeNotExecutedException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/CoveredCodeNotExecutedException.php', - 'PHPUnit\\Framework\\DataProviderTestSuite' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/DataProviderTestSuite.php', - 'PHPUnit\\Framework\\Error' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/Error.php', - 'PHPUnit\\Framework\\ErrorTestCase' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/ErrorTestCase.php', - 'PHPUnit\\Framework\\Error\\Deprecated' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Error/Deprecated.php', - 'PHPUnit\\Framework\\Error\\Error' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Error/Error.php', - 'PHPUnit\\Framework\\Error\\Notice' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Error/Notice.php', - 'PHPUnit\\Framework\\Error\\Warning' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Error/Warning.php', - 'PHPUnit\\Framework\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/Exception.php', - 'PHPUnit\\Framework\\ExceptionWrapper' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/ExceptionWrapper.php', - 'PHPUnit\\Framework\\ExecutionOrderDependency' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/ExecutionOrderDependency.php', - 'PHPUnit\\Framework\\ExpectationFailedException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/ExpectationFailedException.php', - 'PHPUnit\\Framework\\IncompleteTest' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/IncompleteTest.php', - 'PHPUnit\\Framework\\IncompleteTestCase' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/IncompleteTestCase.php', - 'PHPUnit\\Framework\\IncompleteTestError' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/IncompleteTestError.php', - 'PHPUnit\\Framework\\InvalidArgumentException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/InvalidArgumentException.php', - 'PHPUnit\\Framework\\InvalidCoversTargetException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/InvalidCoversTargetException.php', - 'PHPUnit\\Framework\\InvalidDataProviderException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/InvalidDataProviderException.php', - 'PHPUnit\\Framework\\InvalidParameterGroupException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/InvalidParameterGroupException.php', - 'PHPUnit\\Framework\\MissingCoversAnnotationException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/MissingCoversAnnotationException.php', - 'PHPUnit\\Framework\\MockObject\\Api' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Api/Api.php', - 'PHPUnit\\Framework\\MockObject\\BadMethodCallException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/BadMethodCallException.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\Identity' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Builder/Identity.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\InvocationMocker' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationMocker.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\InvocationStubber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationStubber.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\MethodNameMatch' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Builder/MethodNameMatch.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\ParametersMatch' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Builder/ParametersMatch.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\Stub' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Builder/Stub.php', - 'PHPUnit\\Framework\\MockObject\\CannotUseAddMethodsException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseAddMethodsException.php', - 'PHPUnit\\Framework\\MockObject\\CannotUseOnlyMethodsException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseOnlyMethodsException.php', - 'PHPUnit\\Framework\\MockObject\\ClassAlreadyExistsException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/ClassAlreadyExistsException.php', - 'PHPUnit\\Framework\\MockObject\\ClassIsFinalException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsFinalException.php', - 'PHPUnit\\Framework\\MockObject\\ClassIsReadonlyException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsReadonlyException.php', - 'PHPUnit\\Framework\\MockObject\\ConfigurableMethod' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/ConfigurableMethod.php', - 'PHPUnit\\Framework\\MockObject\\ConfigurableMethodsAlreadyInitializedException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/ConfigurableMethodsAlreadyInitializedException.php', - 'PHPUnit\\Framework\\MockObject\\DuplicateMethodException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/DuplicateMethodException.php', - 'PHPUnit\\Framework\\MockObject\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/Exception.php', - 'PHPUnit\\Framework\\MockObject\\Generator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator.php', - 'PHPUnit\\Framework\\MockObject\\IncompatibleReturnValueException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/IncompatibleReturnValueException.php', - 'PHPUnit\\Framework\\MockObject\\InvalidMethodNameException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/InvalidMethodNameException.php', - 'PHPUnit\\Framework\\MockObject\\Invocation' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Invocation.php', - 'PHPUnit\\Framework\\MockObject\\InvocationHandler' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/InvocationHandler.php', - 'PHPUnit\\Framework\\MockObject\\MatchBuilderNotFoundException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/MatchBuilderNotFoundException.php', - 'PHPUnit\\Framework\\MockObject\\Matcher' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Matcher.php', - 'PHPUnit\\Framework\\MockObject\\MatcherAlreadyRegisteredException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/MatcherAlreadyRegisteredException.php', - 'PHPUnit\\Framework\\MockObject\\Method' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Api/Method.php', - 'PHPUnit\\Framework\\MockObject\\MethodCannotBeConfiguredException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/MethodCannotBeConfiguredException.php', - 'PHPUnit\\Framework\\MockObject\\MethodNameAlreadyConfiguredException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/MethodNameAlreadyConfiguredException.php', - 'PHPUnit\\Framework\\MockObject\\MethodNameConstraint' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/MethodNameConstraint.php', - 'PHPUnit\\Framework\\MockObject\\MethodNameNotConfiguredException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/MethodNameNotConfiguredException.php', - 'PHPUnit\\Framework\\MockObject\\MethodParametersAlreadyConfiguredException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/MethodParametersAlreadyConfiguredException.php', - 'PHPUnit\\Framework\\MockObject\\MockBuilder' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/MockBuilder.php', - 'PHPUnit\\Framework\\MockObject\\MockClass' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/MockClass.php', - 'PHPUnit\\Framework\\MockObject\\MockMethod' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/MockMethod.php', - 'PHPUnit\\Framework\\MockObject\\MockMethodSet' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/MockMethodSet.php', - 'PHPUnit\\Framework\\MockObject\\MockObject' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/MockObject.php', - 'PHPUnit\\Framework\\MockObject\\MockTrait' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/MockTrait.php', - 'PHPUnit\\Framework\\MockObject\\MockType' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/MockType.php', - 'PHPUnit\\Framework\\MockObject\\OriginalConstructorInvocationRequiredException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/OriginalConstructorInvocationRequiredException.php', - 'PHPUnit\\Framework\\MockObject\\ReflectionException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/ReflectionException.php', - 'PHPUnit\\Framework\\MockObject\\ReturnValueNotConfiguredException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/ReturnValueNotConfiguredException.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\AnyInvokedCount' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Rule/AnyInvokedCount.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\AnyParameters' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Rule/AnyParameters.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\ConsecutiveParameters' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Rule/ConsecutiveParameters.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\InvocationOrder' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Rule/InvocationOrder.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\InvokedAtIndex' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtIndex.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\InvokedAtLeastCount' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastCount.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\InvokedAtLeastOnce' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastOnce.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\InvokedAtMostCount' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtMostCount.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\InvokedCount' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedCount.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\MethodName' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Rule/MethodName.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\Parameters' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Rule/Parameters.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\ParametersRule' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Rule/ParametersRule.php', - 'PHPUnit\\Framework\\MockObject\\RuntimeException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/RuntimeException.php', - 'PHPUnit\\Framework\\MockObject\\SoapExtensionNotAvailableException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/SoapExtensionNotAvailableException.php', - 'PHPUnit\\Framework\\MockObject\\Stub' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Stub.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ConsecutiveCalls' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Stub/ConsecutiveCalls.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Stub/Exception.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnArgument' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnArgument.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnCallback' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnCallback.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnReference' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnReference.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnSelf' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnSelf.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnStub' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnStub.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnValueMap' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnValueMap.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\Stub' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Stub/Stub.php', - 'PHPUnit\\Framework\\MockObject\\UnknownClassException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownClassException.php', - 'PHPUnit\\Framework\\MockObject\\UnknownTraitException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTraitException.php', - 'PHPUnit\\Framework\\MockObject\\UnknownTypeException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTypeException.php', - 'PHPUnit\\Framework\\MockObject\\Verifiable' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Verifiable.php', - 'PHPUnit\\Framework\\NoChildTestSuiteException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/NoChildTestSuiteException.php', - 'PHPUnit\\Framework\\OutputError' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/OutputError.php', - 'PHPUnit\\Framework\\PHPTAssertionFailedError' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/PHPTAssertionFailedError.php', - 'PHPUnit\\Framework\\Reorderable' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Reorderable.php', - 'PHPUnit\\Framework\\RiskyTestError' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/RiskyTestError.php', - 'PHPUnit\\Framework\\SelfDescribing' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/SelfDescribing.php', - 'PHPUnit\\Framework\\SkippedTest' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/SkippedTest.php', - 'PHPUnit\\Framework\\SkippedTestCase' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/SkippedTestCase.php', - 'PHPUnit\\Framework\\SkippedTestError' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/SkippedTestError.php', - 'PHPUnit\\Framework\\SkippedTestSuiteError' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/SkippedTestSuiteError.php', - 'PHPUnit\\Framework\\SyntheticError' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/SyntheticError.php', - 'PHPUnit\\Framework\\SyntheticSkippedError' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/SyntheticSkippedError.php', - 'PHPUnit\\Framework\\Test' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Test.php', - 'PHPUnit\\Framework\\TestBuilder' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/TestBuilder.php', - 'PHPUnit\\Framework\\TestCase' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/TestCase.php', - 'PHPUnit\\Framework\\TestFailure' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/TestFailure.php', - 'PHPUnit\\Framework\\TestListener' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/TestListener.php', - 'PHPUnit\\Framework\\TestListenerDefaultImplementation' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/TestListenerDefaultImplementation.php', - 'PHPUnit\\Framework\\TestResult' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/TestResult.php', - 'PHPUnit\\Framework\\TestSuite' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/TestSuite.php', - 'PHPUnit\\Framework\\TestSuiteIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/TestSuiteIterator.php', - 'PHPUnit\\Framework\\UnintentionallyCoveredCodeError' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/UnintentionallyCoveredCodeError.php', - 'PHPUnit\\Framework\\Warning' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/Warning.php', - 'PHPUnit\\Framework\\WarningTestCase' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/WarningTestCase.php', - 'PHPUnit\\Runner\\AfterIncompleteTestHook' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Hook/AfterIncompleteTestHook.php', - 'PHPUnit\\Runner\\AfterLastTestHook' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Hook/AfterLastTestHook.php', - 'PHPUnit\\Runner\\AfterRiskyTestHook' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Hook/AfterRiskyTestHook.php', - 'PHPUnit\\Runner\\AfterSkippedTestHook' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Hook/AfterSkippedTestHook.php', - 'PHPUnit\\Runner\\AfterSuccessfulTestHook' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Hook/AfterSuccessfulTestHook.php', - 'PHPUnit\\Runner\\AfterTestErrorHook' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Hook/AfterTestErrorHook.php', - 'PHPUnit\\Runner\\AfterTestFailureHook' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Hook/AfterTestFailureHook.php', - 'PHPUnit\\Runner\\AfterTestHook' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Hook/AfterTestHook.php', - 'PHPUnit\\Runner\\AfterTestWarningHook' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Hook/AfterTestWarningHook.php', - 'PHPUnit\\Runner\\BaseTestRunner' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/BaseTestRunner.php', - 'PHPUnit\\Runner\\BeforeFirstTestHook' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Hook/BeforeFirstTestHook.php', - 'PHPUnit\\Runner\\BeforeTestHook' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Hook/BeforeTestHook.php', - 'PHPUnit\\Runner\\DefaultTestResultCache' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/DefaultTestResultCache.php', - 'PHPUnit\\Runner\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Exception.php', - 'PHPUnit\\Runner\\Extension\\ExtensionHandler' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Extension/ExtensionHandler.php', - 'PHPUnit\\Runner\\Extension\\PharLoader' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Extension/PharLoader.php', - 'PHPUnit\\Runner\\Filter\\ExcludeGroupFilterIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Filter/ExcludeGroupFilterIterator.php', - 'PHPUnit\\Runner\\Filter\\Factory' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Filter/Factory.php', - 'PHPUnit\\Runner\\Filter\\GroupFilterIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Filter/GroupFilterIterator.php', - 'PHPUnit\\Runner\\Filter\\IncludeGroupFilterIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Filter/IncludeGroupFilterIterator.php', - 'PHPUnit\\Runner\\Filter\\NameFilterIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Filter/NameFilterIterator.php', - 'PHPUnit\\Runner\\Hook' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Hook/Hook.php', - 'PHPUnit\\Runner\\NullTestResultCache' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/NullTestResultCache.php', - 'PHPUnit\\Runner\\PhptTestCase' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/PhptTestCase.php', - 'PHPUnit\\Runner\\ResultCacheExtension' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/ResultCacheExtension.php', - 'PHPUnit\\Runner\\StandardTestSuiteLoader' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/StandardTestSuiteLoader.php', - 'PHPUnit\\Runner\\TestHook' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Hook/TestHook.php', - 'PHPUnit\\Runner\\TestListenerAdapter' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Hook/TestListenerAdapter.php', - 'PHPUnit\\Runner\\TestResultCache' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/TestResultCache.php', - 'PHPUnit\\Runner\\TestSuiteLoader' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/TestSuiteLoader.php', - 'PHPUnit\\Runner\\TestSuiteSorter' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/TestSuiteSorter.php', - 'PHPUnit\\Runner\\Version' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Version.php', - 'PHPUnit\\TextUI\\CliArguments\\Builder' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/CliArguments/Builder.php', - 'PHPUnit\\TextUI\\CliArguments\\Configuration' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/CliArguments/Configuration.php', - 'PHPUnit\\TextUI\\CliArguments\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/CliArguments/Exception.php', - 'PHPUnit\\TextUI\\CliArguments\\Mapper' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/CliArguments/Mapper.php', - 'PHPUnit\\TextUI\\Command' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Command.php', - 'PHPUnit\\TextUI\\DefaultResultPrinter' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/DefaultResultPrinter.php', - 'PHPUnit\\TextUI\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Exception/Exception.php', - 'PHPUnit\\TextUI\\Help' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Help.php', - 'PHPUnit\\TextUI\\ReflectionException' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Exception/ReflectionException.php', - 'PHPUnit\\TextUI\\ResultPrinter' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/ResultPrinter.php', - 'PHPUnit\\TextUI\\RuntimeException' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Exception/RuntimeException.php', - 'PHPUnit\\TextUI\\TestDirectoryNotFoundException' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Exception/TestDirectoryNotFoundException.php', - 'PHPUnit\\TextUI\\TestFileNotFoundException' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Exception/TestFileNotFoundException.php', - 'PHPUnit\\TextUI\\TestRunner' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/TestRunner.php', - 'PHPUnit\\TextUI\\TestSuiteMapper' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/TestSuiteMapper.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\CodeCoverage' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/CodeCoverage.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\FilterMapper' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/FilterMapper.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Filter\\Directory' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Filter/Directory.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Filter\\DirectoryCollection' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Filter/DirectoryCollection.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Filter\\DirectoryCollectionIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Filter/DirectoryCollectionIterator.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Report\\Clover' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Clover.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Report\\Cobertura' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Cobertura.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Report\\Crap4j' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Crap4j.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Report\\Html' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Html.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Report\\Php' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Php.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Report\\Text' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Text.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Report\\Xml' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Xml.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Configuration' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Configuration.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Constant' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/Constant.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\ConstantCollection' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/ConstantCollection.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\ConstantCollectionIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/ConstantCollectionIterator.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\ConvertLogTypes' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/ConvertLogTypes.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\CoverageCloverToReport' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/CoverageCloverToReport.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\CoverageCrap4jToReport' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/CoverageCrap4jToReport.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\CoverageHtmlToReport' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/CoverageHtmlToReport.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\CoveragePhpToReport' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/CoveragePhpToReport.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\CoverageTextToReport' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/CoverageTextToReport.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\CoverageXmlToReport' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/CoverageXmlToReport.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Directory' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Filesystem/Directory.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\DirectoryCollection' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Filesystem/DirectoryCollection.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\DirectoryCollectionIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Filesystem/DirectoryCollectionIterator.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Exception.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Extension' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHPUnit/Extension.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\ExtensionCollection' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHPUnit/ExtensionCollection.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\ExtensionCollectionIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHPUnit/ExtensionCollectionIterator.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\File' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Filesystem/File.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\FileCollection' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Filesystem/FileCollection.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\FileCollectionIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Filesystem/FileCollectionIterator.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Generator' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Generator.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Group' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Group/Group.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\GroupCollection' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Group/GroupCollection.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\GroupCollectionIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Group/GroupCollectionIterator.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Groups' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Group/Groups.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\IniSetting' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/IniSetting.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\IniSettingCollection' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/IniSettingCollection.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\IniSettingCollectionIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/IniSettingCollectionIterator.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\IntroduceCoverageElement' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/IntroduceCoverageElement.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Loader' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Loader.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\LogToReportMigration' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/LogToReportMigration.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Logging\\Junit' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/Junit.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Logging\\Logging' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/Logging.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Logging\\TeamCity' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/TeamCity.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Logging\\TestDox\\Html' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/TestDox/Html.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Logging\\TestDox\\Text' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/TestDox/Text.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Logging\\TestDox\\Xml' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/TestDox/Xml.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Logging\\Text' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/Text.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Migration' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/Migration.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\MigrationBuilder' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/MigrationBuilder.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\MigrationBuilderException' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/MigrationBuilderException.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\MigrationException' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/MigrationException.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Migrator' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrator.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\MoveAttributesFromFilterWhitelistToCoverage' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveAttributesFromFilterWhitelistToCoverage.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\MoveAttributesFromRootToCoverage' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveAttributesFromRootToCoverage.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\MoveWhitelistDirectoriesToCoverage' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistDirectoriesToCoverage.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\MoveWhitelistExcludesToCoverage' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistExcludesToCoverage.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\PHPUnit' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHPUnit/PHPUnit.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Php' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/Php.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\PhpHandler' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/PhpHandler.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\RemoveCacheTokensAttribute' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/RemoveCacheTokensAttribute.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\RemoveEmptyFilter' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/RemoveEmptyFilter.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\RemoveLogTypes' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/RemoveLogTypes.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\TestDirectory' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestDirectory.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\TestDirectoryCollection' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestDirectoryCollection.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\TestDirectoryCollectionIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestDirectoryCollectionIterator.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\TestFile' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestFile.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\TestFileCollection' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestFileCollection.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\TestFileCollectionIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestFileCollectionIterator.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\TestSuite' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestSuite.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\TestSuiteCollection' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestSuiteCollection.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\TestSuiteCollectionIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestSuiteCollectionIterator.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\UpdateSchemaLocationTo93' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/UpdateSchemaLocationTo93.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\Variable' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/Variable.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\VariableCollection' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/VariableCollection.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\VariableCollectionIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/VariableCollectionIterator.php', - 'PHPUnit\\Util\\Annotation\\DocBlock' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Annotation/DocBlock.php', - 'PHPUnit\\Util\\Annotation\\Registry' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Annotation/Registry.php', - 'PHPUnit\\Util\\Blacklist' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Blacklist.php', - 'PHPUnit\\Util\\Cloner' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Cloner.php', - 'PHPUnit\\Util\\Color' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Color.php', - 'PHPUnit\\Util\\ErrorHandler' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/ErrorHandler.php', - 'PHPUnit\\Util\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Exception.php', - 'PHPUnit\\Util\\ExcludeList' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/ExcludeList.php', - 'PHPUnit\\Util\\FileLoader' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/FileLoader.php', - 'PHPUnit\\Util\\Filesystem' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Filesystem.php', - 'PHPUnit\\Util\\Filter' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Filter.php', - 'PHPUnit\\Util\\GlobalState' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/GlobalState.php', - 'PHPUnit\\Util\\InvalidDataSetException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/InvalidDataSetException.php', - 'PHPUnit\\Util\\Json' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Json.php', - 'PHPUnit\\Util\\Log\\JUnit' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Log/JUnit.php', - 'PHPUnit\\Util\\Log\\TeamCity' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Log/TeamCity.php', - 'PHPUnit\\Util\\PHP\\AbstractPhpProcess' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/PHP/AbstractPhpProcess.php', - 'PHPUnit\\Util\\PHP\\DefaultPhpProcess' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/PHP/DefaultPhpProcess.php', - 'PHPUnit\\Util\\PHP\\WindowsPhpProcess' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/PHP/WindowsPhpProcess.php', - 'PHPUnit\\Util\\Printer' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Printer.php', - 'PHPUnit\\Util\\Reflection' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Reflection.php', - 'PHPUnit\\Util\\RegularExpression' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/RegularExpression.php', - 'PHPUnit\\Util\\Test' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Test.php', - 'PHPUnit\\Util\\TestDox\\CliTestDoxPrinter' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/TestDox/CliTestDoxPrinter.php', - 'PHPUnit\\Util\\TestDox\\HtmlResultPrinter' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/TestDox/HtmlResultPrinter.php', - 'PHPUnit\\Util\\TestDox\\NamePrettifier' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/TestDox/NamePrettifier.php', - 'PHPUnit\\Util\\TestDox\\ResultPrinter' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/TestDox/ResultPrinter.php', - 'PHPUnit\\Util\\TestDox\\TestDoxPrinter' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/TestDox/TestDoxPrinter.php', - 'PHPUnit\\Util\\TestDox\\TextResultPrinter' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/TestDox/TextResultPrinter.php', - 'PHPUnit\\Util\\TestDox\\XmlResultPrinter' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/TestDox/XmlResultPrinter.php', - 'PHPUnit\\Util\\TextTestListRenderer' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/TextTestListRenderer.php', - 'PHPUnit\\Util\\Type' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Type.php', - 'PHPUnit\\Util\\VersionComparisonOperator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/VersionComparisonOperator.php', - 'PHPUnit\\Util\\XdebugFilterScriptGenerator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/XdebugFilterScriptGenerator.php', - 'PHPUnit\\Util\\Xml' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Xml.php', - 'PHPUnit\\Util\\XmlTestListRenderer' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/XmlTestListRenderer.php', - 'PHPUnit\\Util\\Xml\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Xml/Exception.php', - 'PHPUnit\\Util\\Xml\\FailedSchemaDetectionResult' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Xml/FailedSchemaDetectionResult.php', - 'PHPUnit\\Util\\Xml\\Loader' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Xml/Loader.php', - 'PHPUnit\\Util\\Xml\\SchemaDetectionResult' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Xml/SchemaDetectionResult.php', - 'PHPUnit\\Util\\Xml\\SchemaDetector' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Xml/SchemaDetector.php', - 'PHPUnit\\Util\\Xml\\SchemaFinder' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Xml/SchemaFinder.php', - 'PHPUnit\\Util\\Xml\\SnapshotNodeList' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Xml/SnapshotNodeList.php', - 'PHPUnit\\Util\\Xml\\SuccessfulSchemaDetectionResult' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Xml/SuccessfulSchemaDetectionResult.php', - 'PHPUnit\\Util\\Xml\\ValidationResult' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Xml/ValidationResult.php', - 'PHPUnit\\Util\\Xml\\Validator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Xml/Validator.php', - 'PharIo\\Manifest\\Application' => __DIR__ . '/..' . '/phar-io/manifest/src/values/Application.php', - 'PharIo\\Manifest\\ApplicationName' => __DIR__ . '/..' . '/phar-io/manifest/src/values/ApplicationName.php', - 'PharIo\\Manifest\\Author' => __DIR__ . '/..' . '/phar-io/manifest/src/values/Author.php', - 'PharIo\\Manifest\\AuthorCollection' => __DIR__ . '/..' . '/phar-io/manifest/src/values/AuthorCollection.php', - 'PharIo\\Manifest\\AuthorCollectionIterator' => __DIR__ . '/..' . '/phar-io/manifest/src/values/AuthorCollectionIterator.php', - 'PharIo\\Manifest\\AuthorElement' => __DIR__ . '/..' . '/phar-io/manifest/src/xml/AuthorElement.php', - 'PharIo\\Manifest\\AuthorElementCollection' => __DIR__ . '/..' . '/phar-io/manifest/src/xml/AuthorElementCollection.php', - 'PharIo\\Manifest\\BundledComponent' => __DIR__ . '/..' . '/phar-io/manifest/src/values/BundledComponent.php', - 'PharIo\\Manifest\\BundledComponentCollection' => __DIR__ . '/..' . '/phar-io/manifest/src/values/BundledComponentCollection.php', - 'PharIo\\Manifest\\BundledComponentCollectionIterator' => __DIR__ . '/..' . '/phar-io/manifest/src/values/BundledComponentCollectionIterator.php', - 'PharIo\\Manifest\\BundlesElement' => __DIR__ . '/..' . '/phar-io/manifest/src/xml/BundlesElement.php', - 'PharIo\\Manifest\\ComponentElement' => __DIR__ . '/..' . '/phar-io/manifest/src/xml/ComponentElement.php', - 'PharIo\\Manifest\\ComponentElementCollection' => __DIR__ . '/..' . '/phar-io/manifest/src/xml/ComponentElementCollection.php', - 'PharIo\\Manifest\\ContainsElement' => __DIR__ . '/..' . '/phar-io/manifest/src/xml/ContainsElement.php', - 'PharIo\\Manifest\\CopyrightElement' => __DIR__ . '/..' . '/phar-io/manifest/src/xml/CopyrightElement.php', - 'PharIo\\Manifest\\CopyrightInformation' => __DIR__ . '/..' . '/phar-io/manifest/src/values/CopyrightInformation.php', - 'PharIo\\Manifest\\ElementCollection' => __DIR__ . '/..' . '/phar-io/manifest/src/xml/ElementCollection.php', - 'PharIo\\Manifest\\ElementCollectionException' => __DIR__ . '/..' . '/phar-io/manifest/src/exceptions/ElementCollectionException.php', - 'PharIo\\Manifest\\Email' => __DIR__ . '/..' . '/phar-io/manifest/src/values/Email.php', - 'PharIo\\Manifest\\Exception' => __DIR__ . '/..' . '/phar-io/manifest/src/exceptions/Exception.php', - 'PharIo\\Manifest\\ExtElement' => __DIR__ . '/..' . '/phar-io/manifest/src/xml/ExtElement.php', - 'PharIo\\Manifest\\ExtElementCollection' => __DIR__ . '/..' . '/phar-io/manifest/src/xml/ExtElementCollection.php', - 'PharIo\\Manifest\\Extension' => __DIR__ . '/..' . '/phar-io/manifest/src/values/Extension.php', - 'PharIo\\Manifest\\ExtensionElement' => __DIR__ . '/..' . '/phar-io/manifest/src/xml/ExtensionElement.php', - 'PharIo\\Manifest\\InvalidApplicationNameException' => __DIR__ . '/..' . '/phar-io/manifest/src/exceptions/InvalidApplicationNameException.php', - 'PharIo\\Manifest\\InvalidEmailException' => __DIR__ . '/..' . '/phar-io/manifest/src/exceptions/InvalidEmailException.php', - 'PharIo\\Manifest\\InvalidUrlException' => __DIR__ . '/..' . '/phar-io/manifest/src/exceptions/InvalidUrlException.php', - 'PharIo\\Manifest\\Library' => __DIR__ . '/..' . '/phar-io/manifest/src/values/Library.php', - 'PharIo\\Manifest\\License' => __DIR__ . '/..' . '/phar-io/manifest/src/values/License.php', - 'PharIo\\Manifest\\LicenseElement' => __DIR__ . '/..' . '/phar-io/manifest/src/xml/LicenseElement.php', - 'PharIo\\Manifest\\Manifest' => __DIR__ . '/..' . '/phar-io/manifest/src/values/Manifest.php', - 'PharIo\\Manifest\\ManifestDocument' => __DIR__ . '/..' . '/phar-io/manifest/src/xml/ManifestDocument.php', - 'PharIo\\Manifest\\ManifestDocumentException' => __DIR__ . '/..' . '/phar-io/manifest/src/exceptions/ManifestDocumentException.php', - 'PharIo\\Manifest\\ManifestDocumentLoadingException' => __DIR__ . '/..' . '/phar-io/manifest/src/exceptions/ManifestDocumentLoadingException.php', - 'PharIo\\Manifest\\ManifestDocumentMapper' => __DIR__ . '/..' . '/phar-io/manifest/src/ManifestDocumentMapper.php', - 'PharIo\\Manifest\\ManifestDocumentMapperException' => __DIR__ . '/..' . '/phar-io/manifest/src/exceptions/ManifestDocumentMapperException.php', - 'PharIo\\Manifest\\ManifestElement' => __DIR__ . '/..' . '/phar-io/manifest/src/xml/ManifestElement.php', - 'PharIo\\Manifest\\ManifestElementException' => __DIR__ . '/..' . '/phar-io/manifest/src/exceptions/ManifestElementException.php', - 'PharIo\\Manifest\\ManifestLoader' => __DIR__ . '/..' . '/phar-io/manifest/src/ManifestLoader.php', - 'PharIo\\Manifest\\ManifestLoaderException' => __DIR__ . '/..' . '/phar-io/manifest/src/exceptions/ManifestLoaderException.php', - 'PharIo\\Manifest\\ManifestSerializer' => __DIR__ . '/..' . '/phar-io/manifest/src/ManifestSerializer.php', - 'PharIo\\Manifest\\PhpElement' => __DIR__ . '/..' . '/phar-io/manifest/src/xml/PhpElement.php', - 'PharIo\\Manifest\\PhpExtensionRequirement' => __DIR__ . '/..' . '/phar-io/manifest/src/values/PhpExtensionRequirement.php', - 'PharIo\\Manifest\\PhpVersionRequirement' => __DIR__ . '/..' . '/phar-io/manifest/src/values/PhpVersionRequirement.php', - 'PharIo\\Manifest\\Requirement' => __DIR__ . '/..' . '/phar-io/manifest/src/values/Requirement.php', - 'PharIo\\Manifest\\RequirementCollection' => __DIR__ . '/..' . '/phar-io/manifest/src/values/RequirementCollection.php', - 'PharIo\\Manifest\\RequirementCollectionIterator' => __DIR__ . '/..' . '/phar-io/manifest/src/values/RequirementCollectionIterator.php', - 'PharIo\\Manifest\\RequiresElement' => __DIR__ . '/..' . '/phar-io/manifest/src/xml/RequiresElement.php', - 'PharIo\\Manifest\\Type' => __DIR__ . '/..' . '/phar-io/manifest/src/values/Type.php', - 'PharIo\\Manifest\\Url' => __DIR__ . '/..' . '/phar-io/manifest/src/values/Url.php', - 'PharIo\\Version\\AbstractVersionConstraint' => __DIR__ . '/..' . '/phar-io/version/src/constraints/AbstractVersionConstraint.php', - 'PharIo\\Version\\AndVersionConstraintGroup' => __DIR__ . '/..' . '/phar-io/version/src/constraints/AndVersionConstraintGroup.php', - 'PharIo\\Version\\AnyVersionConstraint' => __DIR__ . '/..' . '/phar-io/version/src/constraints/AnyVersionConstraint.php', - 'PharIo\\Version\\BuildMetaData' => __DIR__ . '/..' . '/phar-io/version/src/BuildMetaData.php', - 'PharIo\\Version\\ExactVersionConstraint' => __DIR__ . '/..' . '/phar-io/version/src/constraints/ExactVersionConstraint.php', - 'PharIo\\Version\\Exception' => __DIR__ . '/..' . '/phar-io/version/src/exceptions/Exception.php', - 'PharIo\\Version\\GreaterThanOrEqualToVersionConstraint' => __DIR__ . '/..' . '/phar-io/version/src/constraints/GreaterThanOrEqualToVersionConstraint.php', - 'PharIo\\Version\\InvalidPreReleaseSuffixException' => __DIR__ . '/..' . '/phar-io/version/src/exceptions/InvalidPreReleaseSuffixException.php', - 'PharIo\\Version\\InvalidVersionException' => __DIR__ . '/..' . '/phar-io/version/src/exceptions/InvalidVersionException.php', - 'PharIo\\Version\\NoBuildMetaDataException' => __DIR__ . '/..' . '/phar-io/version/src/exceptions/NoBuildMetaDataException.php', - 'PharIo\\Version\\NoPreReleaseSuffixException' => __DIR__ . '/..' . '/phar-io/version/src/exceptions/NoPreReleaseSuffixException.php', - 'PharIo\\Version\\OrVersionConstraintGroup' => __DIR__ . '/..' . '/phar-io/version/src/constraints/OrVersionConstraintGroup.php', - 'PharIo\\Version\\PreReleaseSuffix' => __DIR__ . '/..' . '/phar-io/version/src/PreReleaseSuffix.php', - 'PharIo\\Version\\SpecificMajorAndMinorVersionConstraint' => __DIR__ . '/..' . '/phar-io/version/src/constraints/SpecificMajorAndMinorVersionConstraint.php', - 'PharIo\\Version\\SpecificMajorVersionConstraint' => __DIR__ . '/..' . '/phar-io/version/src/constraints/SpecificMajorVersionConstraint.php', - 'PharIo\\Version\\UnsupportedVersionConstraintException' => __DIR__ . '/..' . '/phar-io/version/src/exceptions/UnsupportedVersionConstraintException.php', - 'PharIo\\Version\\Version' => __DIR__ . '/..' . '/phar-io/version/src/Version.php', - 'PharIo\\Version\\VersionConstraint' => __DIR__ . '/..' . '/phar-io/version/src/constraints/VersionConstraint.php', - 'PharIo\\Version\\VersionConstraintParser' => __DIR__ . '/..' . '/phar-io/version/src/VersionConstraintParser.php', - 'PharIo\\Version\\VersionConstraintValue' => __DIR__ . '/..' . '/phar-io/version/src/VersionConstraintValue.php', - 'PharIo\\Version\\VersionNumber' => __DIR__ . '/..' . '/phar-io/version/src/VersionNumber.php', - 'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', - 'ReturnTypeWillChange' => __DIR__ . '/..' . '/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php', - 'SebastianBergmann\\CliParser\\AmbiguousOptionException' => __DIR__ . '/..' . '/sebastian/cli-parser/src/exceptions/AmbiguousOptionException.php', - 'SebastianBergmann\\CliParser\\Exception' => __DIR__ . '/..' . '/sebastian/cli-parser/src/exceptions/Exception.php', - 'SebastianBergmann\\CliParser\\OptionDoesNotAllowArgumentException' => __DIR__ . '/..' . '/sebastian/cli-parser/src/exceptions/OptionDoesNotAllowArgumentException.php', - 'SebastianBergmann\\CliParser\\Parser' => __DIR__ . '/..' . '/sebastian/cli-parser/src/Parser.php', - 'SebastianBergmann\\CliParser\\RequiredOptionArgumentMissingException' => __DIR__ . '/..' . '/sebastian/cli-parser/src/exceptions/RequiredOptionArgumentMissingException.php', - 'SebastianBergmann\\CliParser\\UnknownOptionException' => __DIR__ . '/..' . '/sebastian/cli-parser/src/exceptions/UnknownOptionException.php', - 'SebastianBergmann\\CodeCoverage\\BranchAndPathCoverageNotSupportedException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/BranchAndPathCoverageNotSupportedException.php', - 'SebastianBergmann\\CodeCoverage\\CodeCoverage' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage.php', - 'SebastianBergmann\\CodeCoverage\\DeadCodeDetectionNotSupportedException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/DeadCodeDetectionNotSupportedException.php', - 'SebastianBergmann\\CodeCoverage\\Driver\\Driver' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Driver/Driver.php', - 'SebastianBergmann\\CodeCoverage\\Driver\\PathExistsButIsNotDirectoryException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/PathExistsButIsNotDirectoryException.php', - 'SebastianBergmann\\CodeCoverage\\Driver\\PcovDriver' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Driver/PcovDriver.php', - 'SebastianBergmann\\CodeCoverage\\Driver\\PcovNotAvailableException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/PcovNotAvailableException.php', - 'SebastianBergmann\\CodeCoverage\\Driver\\PhpdbgDriver' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Driver/PhpdbgDriver.php', - 'SebastianBergmann\\CodeCoverage\\Driver\\PhpdbgNotAvailableException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/PhpdbgNotAvailableException.php', - 'SebastianBergmann\\CodeCoverage\\Driver\\Selector' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Driver/Selector.php', - 'SebastianBergmann\\CodeCoverage\\Driver\\WriteOperationFailedException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/WriteOperationFailedException.php', - 'SebastianBergmann\\CodeCoverage\\Driver\\WrongXdebugVersionException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/WrongXdebugVersionException.php', - 'SebastianBergmann\\CodeCoverage\\Driver\\Xdebug2Driver' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Driver/Xdebug2Driver.php', - 'SebastianBergmann\\CodeCoverage\\Driver\\Xdebug2NotEnabledException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/Xdebug2NotEnabledException.php', - 'SebastianBergmann\\CodeCoverage\\Driver\\Xdebug3Driver' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Driver/Xdebug3Driver.php', - 'SebastianBergmann\\CodeCoverage\\Driver\\Xdebug3NotEnabledException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/Xdebug3NotEnabledException.php', - 'SebastianBergmann\\CodeCoverage\\Driver\\XdebugNotAvailableException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/XdebugNotAvailableException.php', - 'SebastianBergmann\\CodeCoverage\\Exception' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/Exception.php', - 'SebastianBergmann\\CodeCoverage\\Filter' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Filter.php', - 'SebastianBergmann\\CodeCoverage\\InvalidArgumentException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/InvalidArgumentException.php', - 'SebastianBergmann\\CodeCoverage\\NoCodeCoverageDriverAvailableException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/NoCodeCoverageDriverAvailableException.php', - 'SebastianBergmann\\CodeCoverage\\NoCodeCoverageDriverWithPathCoverageSupportAvailableException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/NoCodeCoverageDriverWithPathCoverageSupportAvailableException.php', - 'SebastianBergmann\\CodeCoverage\\Node\\AbstractNode' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Node/AbstractNode.php', - 'SebastianBergmann\\CodeCoverage\\Node\\Builder' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Node/Builder.php', - 'SebastianBergmann\\CodeCoverage\\Node\\CrapIndex' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Node/CrapIndex.php', - 'SebastianBergmann\\CodeCoverage\\Node\\Directory' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Node/Directory.php', - 'SebastianBergmann\\CodeCoverage\\Node\\File' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Node/File.php', - 'SebastianBergmann\\CodeCoverage\\Node\\Iterator' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Node/Iterator.php', - 'SebastianBergmann\\CodeCoverage\\ParserException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/ParserException.php', - 'SebastianBergmann\\CodeCoverage\\ProcessedCodeCoverageData' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/ProcessedCodeCoverageData.php', - 'SebastianBergmann\\CodeCoverage\\RawCodeCoverageData' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/RawCodeCoverageData.php', - 'SebastianBergmann\\CodeCoverage\\ReflectionException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/ReflectionException.php', - 'SebastianBergmann\\CodeCoverage\\ReportAlreadyFinalizedException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/ReportAlreadyFinalizedException.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Clover' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Clover.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Cobertura' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Cobertura.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Crap4j' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Crap4j.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Html\\Dashboard' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Html/Renderer/Dashboard.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Html\\Directory' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Html/Renderer/Directory.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Html\\Facade' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Html/Facade.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Html\\File' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Html/Renderer/File.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Html\\Renderer' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Html/Renderer.php', - 'SebastianBergmann\\CodeCoverage\\Report\\PHP' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/PHP.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Text' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Text.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\BuildInformation' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/BuildInformation.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Coverage' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/Coverage.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Directory' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/Directory.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Facade' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/Facade.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\File' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/File.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Method' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/Method.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Node' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/Node.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Project' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/Project.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Report' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/Report.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Source' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/Source.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Tests' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/Tests.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Totals' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/Totals.php', - 'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Unit' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/Unit.php', - 'SebastianBergmann\\CodeCoverage\\StaticAnalysisCacheNotConfiguredException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/StaticAnalysisCacheNotConfiguredException.php', - 'SebastianBergmann\\CodeCoverage\\StaticAnalysis\\CacheWarmer' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/StaticAnalysis/CacheWarmer.php', - 'SebastianBergmann\\CodeCoverage\\StaticAnalysis\\CachingFileAnalyser' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/StaticAnalysis/CachingFileAnalyser.php', - 'SebastianBergmann\\CodeCoverage\\StaticAnalysis\\CodeUnitFindingVisitor' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/StaticAnalysis/CodeUnitFindingVisitor.php', - 'SebastianBergmann\\CodeCoverage\\StaticAnalysis\\ExecutableLinesFindingVisitor' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/StaticAnalysis/ExecutableLinesFindingVisitor.php', - 'SebastianBergmann\\CodeCoverage\\StaticAnalysis\\FileAnalyser' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/StaticAnalysis/FileAnalyser.php', - 'SebastianBergmann\\CodeCoverage\\StaticAnalysis\\IgnoredLinesFindingVisitor' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/StaticAnalysis/IgnoredLinesFindingVisitor.php', - 'SebastianBergmann\\CodeCoverage\\StaticAnalysis\\ParsingFileAnalyser' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/StaticAnalysis/ParsingFileAnalyser.php', - 'SebastianBergmann\\CodeCoverage\\TestIdMissingException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/TestIdMissingException.php', - 'SebastianBergmann\\CodeCoverage\\UnintentionallyCoveredCodeException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/UnintentionallyCoveredCodeException.php', - 'SebastianBergmann\\CodeCoverage\\Util\\DirectoryCouldNotBeCreatedException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/DirectoryCouldNotBeCreatedException.php', - 'SebastianBergmann\\CodeCoverage\\Util\\Filesystem' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Util/Filesystem.php', - 'SebastianBergmann\\CodeCoverage\\Util\\Percentage' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Util/Percentage.php', - 'SebastianBergmann\\CodeCoverage\\Version' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Version.php', - 'SebastianBergmann\\CodeCoverage\\XmlException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/XmlException.php', - 'SebastianBergmann\\CodeUnitReverseLookup\\Wizard' => __DIR__ . '/..' . '/sebastian/code-unit-reverse-lookup/src/Wizard.php', - 'SebastianBergmann\\CodeUnit\\ClassMethodUnit' => __DIR__ . '/..' . '/sebastian/code-unit/src/ClassMethodUnit.php', - 'SebastianBergmann\\CodeUnit\\ClassUnit' => __DIR__ . '/..' . '/sebastian/code-unit/src/ClassUnit.php', - 'SebastianBergmann\\CodeUnit\\CodeUnit' => __DIR__ . '/..' . '/sebastian/code-unit/src/CodeUnit.php', - 'SebastianBergmann\\CodeUnit\\CodeUnitCollection' => __DIR__ . '/..' . '/sebastian/code-unit/src/CodeUnitCollection.php', - 'SebastianBergmann\\CodeUnit\\CodeUnitCollectionIterator' => __DIR__ . '/..' . '/sebastian/code-unit/src/CodeUnitCollectionIterator.php', - 'SebastianBergmann\\CodeUnit\\Exception' => __DIR__ . '/..' . '/sebastian/code-unit/src/exceptions/Exception.php', - 'SebastianBergmann\\CodeUnit\\FunctionUnit' => __DIR__ . '/..' . '/sebastian/code-unit/src/FunctionUnit.php', - 'SebastianBergmann\\CodeUnit\\InterfaceMethodUnit' => __DIR__ . '/..' . '/sebastian/code-unit/src/InterfaceMethodUnit.php', - 'SebastianBergmann\\CodeUnit\\InterfaceUnit' => __DIR__ . '/..' . '/sebastian/code-unit/src/InterfaceUnit.php', - 'SebastianBergmann\\CodeUnit\\InvalidCodeUnitException' => __DIR__ . '/..' . '/sebastian/code-unit/src/exceptions/InvalidCodeUnitException.php', - 'SebastianBergmann\\CodeUnit\\Mapper' => __DIR__ . '/..' . '/sebastian/code-unit/src/Mapper.php', - 'SebastianBergmann\\CodeUnit\\NoTraitException' => __DIR__ . '/..' . '/sebastian/code-unit/src/exceptions/NoTraitException.php', - 'SebastianBergmann\\CodeUnit\\ReflectionException' => __DIR__ . '/..' . '/sebastian/code-unit/src/exceptions/ReflectionException.php', - 'SebastianBergmann\\CodeUnit\\TraitMethodUnit' => __DIR__ . '/..' . '/sebastian/code-unit/src/TraitMethodUnit.php', - 'SebastianBergmann\\CodeUnit\\TraitUnit' => __DIR__ . '/..' . '/sebastian/code-unit/src/TraitUnit.php', - 'SebastianBergmann\\Comparator\\ArrayComparator' => __DIR__ . '/..' . '/sebastian/comparator/src/ArrayComparator.php', - 'SebastianBergmann\\Comparator\\Comparator' => __DIR__ . '/..' . '/sebastian/comparator/src/Comparator.php', - 'SebastianBergmann\\Comparator\\ComparisonFailure' => __DIR__ . '/..' . '/sebastian/comparator/src/ComparisonFailure.php', - 'SebastianBergmann\\Comparator\\DOMNodeComparator' => __DIR__ . '/..' . '/sebastian/comparator/src/DOMNodeComparator.php', - 'SebastianBergmann\\Comparator\\DateTimeComparator' => __DIR__ . '/..' . '/sebastian/comparator/src/DateTimeComparator.php', - 'SebastianBergmann\\Comparator\\DoubleComparator' => __DIR__ . '/..' . '/sebastian/comparator/src/DoubleComparator.php', - 'SebastianBergmann\\Comparator\\Exception' => __DIR__ . '/..' . '/sebastian/comparator/src/exceptions/Exception.php', - 'SebastianBergmann\\Comparator\\ExceptionComparator' => __DIR__ . '/..' . '/sebastian/comparator/src/ExceptionComparator.php', - 'SebastianBergmann\\Comparator\\Factory' => __DIR__ . '/..' . '/sebastian/comparator/src/Factory.php', - 'SebastianBergmann\\Comparator\\MockObjectComparator' => __DIR__ . '/..' . '/sebastian/comparator/src/MockObjectComparator.php', - 'SebastianBergmann\\Comparator\\NumericComparator' => __DIR__ . '/..' . '/sebastian/comparator/src/NumericComparator.php', - 'SebastianBergmann\\Comparator\\ObjectComparator' => __DIR__ . '/..' . '/sebastian/comparator/src/ObjectComparator.php', - 'SebastianBergmann\\Comparator\\ResourceComparator' => __DIR__ . '/..' . '/sebastian/comparator/src/ResourceComparator.php', - 'SebastianBergmann\\Comparator\\RuntimeException' => __DIR__ . '/..' . '/sebastian/comparator/src/exceptions/RuntimeException.php', - 'SebastianBergmann\\Comparator\\ScalarComparator' => __DIR__ . '/..' . '/sebastian/comparator/src/ScalarComparator.php', - 'SebastianBergmann\\Comparator\\SplObjectStorageComparator' => __DIR__ . '/..' . '/sebastian/comparator/src/SplObjectStorageComparator.php', - 'SebastianBergmann\\Comparator\\TypeComparator' => __DIR__ . '/..' . '/sebastian/comparator/src/TypeComparator.php', - 'SebastianBergmann\\Complexity\\Calculator' => __DIR__ . '/..' . '/sebastian/complexity/src/Calculator.php', - 'SebastianBergmann\\Complexity\\Complexity' => __DIR__ . '/..' . '/sebastian/complexity/src/Complexity/Complexity.php', - 'SebastianBergmann\\Complexity\\ComplexityCalculatingVisitor' => __DIR__ . '/..' . '/sebastian/complexity/src/Visitor/ComplexityCalculatingVisitor.php', - 'SebastianBergmann\\Complexity\\ComplexityCollection' => __DIR__ . '/..' . '/sebastian/complexity/src/Complexity/ComplexityCollection.php', - 'SebastianBergmann\\Complexity\\ComplexityCollectionIterator' => __DIR__ . '/..' . '/sebastian/complexity/src/Complexity/ComplexityCollectionIterator.php', - 'SebastianBergmann\\Complexity\\CyclomaticComplexityCalculatingVisitor' => __DIR__ . '/..' . '/sebastian/complexity/src/Visitor/CyclomaticComplexityCalculatingVisitor.php', - 'SebastianBergmann\\Complexity\\Exception' => __DIR__ . '/..' . '/sebastian/complexity/src/Exception/Exception.php', - 'SebastianBergmann\\Complexity\\RuntimeException' => __DIR__ . '/..' . '/sebastian/complexity/src/Exception/RuntimeException.php', - 'SebastianBergmann\\Diff\\Chunk' => __DIR__ . '/..' . '/sebastian/diff/src/Chunk.php', - 'SebastianBergmann\\Diff\\ConfigurationException' => __DIR__ . '/..' . '/sebastian/diff/src/Exception/ConfigurationException.php', - 'SebastianBergmann\\Diff\\Diff' => __DIR__ . '/..' . '/sebastian/diff/src/Diff.php', - 'SebastianBergmann\\Diff\\Differ' => __DIR__ . '/..' . '/sebastian/diff/src/Differ.php', - 'SebastianBergmann\\Diff\\Exception' => __DIR__ . '/..' . '/sebastian/diff/src/Exception/Exception.php', - 'SebastianBergmann\\Diff\\InvalidArgumentException' => __DIR__ . '/..' . '/sebastian/diff/src/Exception/InvalidArgumentException.php', - 'SebastianBergmann\\Diff\\Line' => __DIR__ . '/..' . '/sebastian/diff/src/Line.php', - 'SebastianBergmann\\Diff\\LongestCommonSubsequenceCalculator' => __DIR__ . '/..' . '/sebastian/diff/src/LongestCommonSubsequenceCalculator.php', - 'SebastianBergmann\\Diff\\MemoryEfficientLongestCommonSubsequenceCalculator' => __DIR__ . '/..' . '/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php', - 'SebastianBergmann\\Diff\\Output\\AbstractChunkOutputBuilder' => __DIR__ . '/..' . '/sebastian/diff/src/Output/AbstractChunkOutputBuilder.php', - 'SebastianBergmann\\Diff\\Output\\DiffOnlyOutputBuilder' => __DIR__ . '/..' . '/sebastian/diff/src/Output/DiffOnlyOutputBuilder.php', - 'SebastianBergmann\\Diff\\Output\\DiffOutputBuilderInterface' => __DIR__ . '/..' . '/sebastian/diff/src/Output/DiffOutputBuilderInterface.php', - 'SebastianBergmann\\Diff\\Output\\StrictUnifiedDiffOutputBuilder' => __DIR__ . '/..' . '/sebastian/diff/src/Output/StrictUnifiedDiffOutputBuilder.php', - 'SebastianBergmann\\Diff\\Output\\UnifiedDiffOutputBuilder' => __DIR__ . '/..' . '/sebastian/diff/src/Output/UnifiedDiffOutputBuilder.php', - 'SebastianBergmann\\Diff\\Parser' => __DIR__ . '/..' . '/sebastian/diff/src/Parser.php', - 'SebastianBergmann\\Diff\\TimeEfficientLongestCommonSubsequenceCalculator' => __DIR__ . '/..' . '/sebastian/diff/src/TimeEfficientLongestCommonSubsequenceCalculator.php', - 'SebastianBergmann\\Environment\\Console' => __DIR__ . '/..' . '/sebastian/environment/src/Console.php', - 'SebastianBergmann\\Environment\\OperatingSystem' => __DIR__ . '/..' . '/sebastian/environment/src/OperatingSystem.php', - 'SebastianBergmann\\Environment\\Runtime' => __DIR__ . '/..' . '/sebastian/environment/src/Runtime.php', - 'SebastianBergmann\\Exporter\\Exporter' => __DIR__ . '/..' . '/sebastian/exporter/src/Exporter.php', - 'SebastianBergmann\\FileIterator\\Facade' => __DIR__ . '/..' . '/phpunit/php-file-iterator/src/Facade.php', - 'SebastianBergmann\\FileIterator\\Factory' => __DIR__ . '/..' . '/phpunit/php-file-iterator/src/Factory.php', - 'SebastianBergmann\\FileIterator\\Iterator' => __DIR__ . '/..' . '/phpunit/php-file-iterator/src/Iterator.php', - 'SebastianBergmann\\GlobalState\\CodeExporter' => __DIR__ . '/..' . '/sebastian/global-state/src/CodeExporter.php', - 'SebastianBergmann\\GlobalState\\Exception' => __DIR__ . '/..' . '/sebastian/global-state/src/exceptions/Exception.php', - 'SebastianBergmann\\GlobalState\\ExcludeList' => __DIR__ . '/..' . '/sebastian/global-state/src/ExcludeList.php', - 'SebastianBergmann\\GlobalState\\Restorer' => __DIR__ . '/..' . '/sebastian/global-state/src/Restorer.php', - 'SebastianBergmann\\GlobalState\\RuntimeException' => __DIR__ . '/..' . '/sebastian/global-state/src/exceptions/RuntimeException.php', - 'SebastianBergmann\\GlobalState\\Snapshot' => __DIR__ . '/..' . '/sebastian/global-state/src/Snapshot.php', - 'SebastianBergmann\\Invoker\\Exception' => __DIR__ . '/..' . '/phpunit/php-invoker/src/exceptions/Exception.php', - 'SebastianBergmann\\Invoker\\Invoker' => __DIR__ . '/..' . '/phpunit/php-invoker/src/Invoker.php', - 'SebastianBergmann\\Invoker\\ProcessControlExtensionNotLoadedException' => __DIR__ . '/..' . '/phpunit/php-invoker/src/exceptions/ProcessControlExtensionNotLoadedException.php', - 'SebastianBergmann\\Invoker\\TimeoutException' => __DIR__ . '/..' . '/phpunit/php-invoker/src/exceptions/TimeoutException.php', - 'SebastianBergmann\\LinesOfCode\\Counter' => __DIR__ . '/..' . '/sebastian/lines-of-code/src/Counter.php', - 'SebastianBergmann\\LinesOfCode\\Exception' => __DIR__ . '/..' . '/sebastian/lines-of-code/src/Exception/Exception.php', - 'SebastianBergmann\\LinesOfCode\\IllogicalValuesException' => __DIR__ . '/..' . '/sebastian/lines-of-code/src/Exception/IllogicalValuesException.php', - 'SebastianBergmann\\LinesOfCode\\LineCountingVisitor' => __DIR__ . '/..' . '/sebastian/lines-of-code/src/LineCountingVisitor.php', - 'SebastianBergmann\\LinesOfCode\\LinesOfCode' => __DIR__ . '/..' . '/sebastian/lines-of-code/src/LinesOfCode.php', - 'SebastianBergmann\\LinesOfCode\\NegativeValueException' => __DIR__ . '/..' . '/sebastian/lines-of-code/src/Exception/NegativeValueException.php', - 'SebastianBergmann\\LinesOfCode\\RuntimeException' => __DIR__ . '/..' . '/sebastian/lines-of-code/src/Exception/RuntimeException.php', - 'SebastianBergmann\\ObjectEnumerator\\Enumerator' => __DIR__ . '/..' . '/sebastian/object-enumerator/src/Enumerator.php', - 'SebastianBergmann\\ObjectEnumerator\\Exception' => __DIR__ . '/..' . '/sebastian/object-enumerator/src/Exception.php', - 'SebastianBergmann\\ObjectEnumerator\\InvalidArgumentException' => __DIR__ . '/..' . '/sebastian/object-enumerator/src/InvalidArgumentException.php', - 'SebastianBergmann\\ObjectReflector\\Exception' => __DIR__ . '/..' . '/sebastian/object-reflector/src/Exception.php', - 'SebastianBergmann\\ObjectReflector\\InvalidArgumentException' => __DIR__ . '/..' . '/sebastian/object-reflector/src/InvalidArgumentException.php', - 'SebastianBergmann\\ObjectReflector\\ObjectReflector' => __DIR__ . '/..' . '/sebastian/object-reflector/src/ObjectReflector.php', - 'SebastianBergmann\\RecursionContext\\Context' => __DIR__ . '/..' . '/sebastian/recursion-context/src/Context.php', - 'SebastianBergmann\\RecursionContext\\Exception' => __DIR__ . '/..' . '/sebastian/recursion-context/src/Exception.php', - 'SebastianBergmann\\RecursionContext\\InvalidArgumentException' => __DIR__ . '/..' . '/sebastian/recursion-context/src/InvalidArgumentException.php', - 'SebastianBergmann\\ResourceOperations\\ResourceOperations' => __DIR__ . '/..' . '/sebastian/resource-operations/src/ResourceOperations.php', - 'SebastianBergmann\\Template\\Exception' => __DIR__ . '/..' . '/phpunit/php-text-template/src/exceptions/Exception.php', - 'SebastianBergmann\\Template\\InvalidArgumentException' => __DIR__ . '/..' . '/phpunit/php-text-template/src/exceptions/InvalidArgumentException.php', - 'SebastianBergmann\\Template\\RuntimeException' => __DIR__ . '/..' . '/phpunit/php-text-template/src/exceptions/RuntimeException.php', - 'SebastianBergmann\\Template\\Template' => __DIR__ . '/..' . '/phpunit/php-text-template/src/Template.php', - 'SebastianBergmann\\Timer\\Duration' => __DIR__ . '/..' . '/phpunit/php-timer/src/Duration.php', - 'SebastianBergmann\\Timer\\Exception' => __DIR__ . '/..' . '/phpunit/php-timer/src/exceptions/Exception.php', - 'SebastianBergmann\\Timer\\NoActiveTimerException' => __DIR__ . '/..' . '/phpunit/php-timer/src/exceptions/NoActiveTimerException.php', - 'SebastianBergmann\\Timer\\ResourceUsageFormatter' => __DIR__ . '/..' . '/phpunit/php-timer/src/ResourceUsageFormatter.php', - 'SebastianBergmann\\Timer\\TimeSinceStartOfRequestNotAvailableException' => __DIR__ . '/..' . '/phpunit/php-timer/src/exceptions/TimeSinceStartOfRequestNotAvailableException.php', - 'SebastianBergmann\\Timer\\Timer' => __DIR__ . '/..' . '/phpunit/php-timer/src/Timer.php', - 'SebastianBergmann\\Type\\CallableType' => __DIR__ . '/..' . '/sebastian/type/src/type/CallableType.php', - 'SebastianBergmann\\Type\\Exception' => __DIR__ . '/..' . '/sebastian/type/src/exception/Exception.php', - 'SebastianBergmann\\Type\\FalseType' => __DIR__ . '/..' . '/sebastian/type/src/type/FalseType.php', - 'SebastianBergmann\\Type\\GenericObjectType' => __DIR__ . '/..' . '/sebastian/type/src/type/GenericObjectType.php', - 'SebastianBergmann\\Type\\IntersectionType' => __DIR__ . '/..' . '/sebastian/type/src/type/IntersectionType.php', - 'SebastianBergmann\\Type\\IterableType' => __DIR__ . '/..' . '/sebastian/type/src/type/IterableType.php', - 'SebastianBergmann\\Type\\MixedType' => __DIR__ . '/..' . '/sebastian/type/src/type/MixedType.php', - 'SebastianBergmann\\Type\\NeverType' => __DIR__ . '/..' . '/sebastian/type/src/type/NeverType.php', - 'SebastianBergmann\\Type\\NullType' => __DIR__ . '/..' . '/sebastian/type/src/type/NullType.php', - 'SebastianBergmann\\Type\\ObjectType' => __DIR__ . '/..' . '/sebastian/type/src/type/ObjectType.php', - 'SebastianBergmann\\Type\\Parameter' => __DIR__ . '/..' . '/sebastian/type/src/Parameter.php', - 'SebastianBergmann\\Type\\ReflectionMapper' => __DIR__ . '/..' . '/sebastian/type/src/ReflectionMapper.php', - 'SebastianBergmann\\Type\\RuntimeException' => __DIR__ . '/..' . '/sebastian/type/src/exception/RuntimeException.php', - 'SebastianBergmann\\Type\\SimpleType' => __DIR__ . '/..' . '/sebastian/type/src/type/SimpleType.php', - 'SebastianBergmann\\Type\\StaticType' => __DIR__ . '/..' . '/sebastian/type/src/type/StaticType.php', - 'SebastianBergmann\\Type\\TrueType' => __DIR__ . '/..' . '/sebastian/type/src/type/TrueType.php', - 'SebastianBergmann\\Type\\Type' => __DIR__ . '/..' . '/sebastian/type/src/type/Type.php', - 'SebastianBergmann\\Type\\TypeName' => __DIR__ . '/..' . '/sebastian/type/src/TypeName.php', - 'SebastianBergmann\\Type\\UnionType' => __DIR__ . '/..' . '/sebastian/type/src/type/UnionType.php', - 'SebastianBergmann\\Type\\UnknownType' => __DIR__ . '/..' . '/sebastian/type/src/type/UnknownType.php', - 'SebastianBergmann\\Type\\VoidType' => __DIR__ . '/..' . '/sebastian/type/src/type/VoidType.php', - 'SebastianBergmann\\Version' => __DIR__ . '/..' . '/sebastian/version/src/Version.php', - 'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', - 'TheSeer\\Tokenizer\\Exception' => __DIR__ . '/..' . '/theseer/tokenizer/src/Exception.php', - 'TheSeer\\Tokenizer\\NamespaceUri' => __DIR__ . '/..' . '/theseer/tokenizer/src/NamespaceUri.php', - 'TheSeer\\Tokenizer\\NamespaceUriException' => __DIR__ . '/..' . '/theseer/tokenizer/src/NamespaceUriException.php', - 'TheSeer\\Tokenizer\\Token' => __DIR__ . '/..' . '/theseer/tokenizer/src/Token.php', - 'TheSeer\\Tokenizer\\TokenCollection' => __DIR__ . '/..' . '/theseer/tokenizer/src/TokenCollection.php', - 'TheSeer\\Tokenizer\\TokenCollectionException' => __DIR__ . '/..' . '/theseer/tokenizer/src/TokenCollectionException.php', - 'TheSeer\\Tokenizer\\Tokenizer' => __DIR__ . '/..' . '/theseer/tokenizer/src/Tokenizer.php', - 'TheSeer\\Tokenizer\\XMLSerializer' => __DIR__ . '/..' . '/theseer/tokenizer/src/XMLSerializer.php', - 'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', - 'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', - ); - - public static function getInitializer(ClassLoader $loader) - { - return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit7ce0b5d2b3ba4805b268758ccd54321b::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit7ce0b5d2b3ba4805b268758ccd54321b::$prefixDirsPsr4; - $loader->prefixesPsr0 = ComposerStaticInit7ce0b5d2b3ba4805b268758ccd54321b::$prefixesPsr0; - $loader->classMap = ComposerStaticInit7ce0b5d2b3ba4805b268758ccd54321b::$classMap; - - }, null, ClassLoader::class); - } -} diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json deleted file mode 100644 index e94edaae..00000000 --- a/vendor/composer/installed.json +++ /dev/null @@ -1,8159 +0,0 @@ -{ - "packages": [ - { - "name": "brick/math", - "version": "0.10.2", - "version_normalized": "0.10.2.0", - "source": { - "type": "git", - "url": "https://github.com/brick/math.git", - "reference": "459f2781e1a08d52ee56b0b1444086e038561e3f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/brick/math/zipball/459f2781e1a08d52ee56b0b1444086e038561e3f", - "reference": "459f2781e1a08d52ee56b0b1444086e038561e3f", - "shasum": "" - }, - "require": { - "ext-json": "*", - "php": "^7.4 || ^8.0" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.2", - "phpunit/phpunit": "^9.0", - "vimeo/psalm": "4.25.0" - }, - "time": "2022-08-10T22:54:19+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Brick\\Math\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Arbitrary-precision arithmetic library", - "keywords": [ - "Arbitrary-precision", - "BigInteger", - "BigRational", - "arithmetic", - "bigdecimal", - "bignum", - "brick", - "math" - ], - "support": { - "issues": "https://github.com/brick/math/issues", - "source": "https://github.com/brick/math/tree/0.10.2" - }, - "funding": [ - { - "url": "https://github.com/BenMorel", - "type": "github" - } - ], - "install-path": "../brick/math" - }, - { - "name": "dflydev/dot-access-data", - "version": "v3.0.2", - "version_normalized": "3.0.2.0", - "source": { - "type": "git", - "url": "https://github.com/dflydev/dflydev-dot-access-data.git", - "reference": "f41715465d65213d644d3141a6a93081be5d3549" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/f41715465d65213d644d3141a6a93081be5d3549", - "reference": "f41715465d65213d644d3141a6a93081be5d3549", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^0.12.42", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.3", - "scrutinizer/ocular": "1.6.0", - "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "^4.0.0" - }, - "time": "2022-10-27T11:44:00+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Dflydev\\DotAccessData\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Dragonfly Development Inc.", - "email": "info@dflydev.com", - "homepage": "http://dflydev.com" - }, - { - "name": "Beau Simensen", - "email": "beau@dflydev.com", - "homepage": "http://beausimensen.com" - }, - { - "name": "Carlos Frutos", - "email": "carlos@kiwing.it", - "homepage": "https://github.com/cfrutos" - }, - { - "name": "Colin O'Dell", - "email": "colinodell@gmail.com", - "homepage": "https://www.colinodell.com" - } - ], - "description": "Given a deep data structure, access data by dot notation.", - "homepage": "https://github.com/dflydev/dflydev-dot-access-data", - "keywords": [ - "access", - "data", - "dot", - "notation" - ], - "support": { - "issues": "https://github.com/dflydev/dflydev-dot-access-data/issues", - "source": "https://github.com/dflydev/dflydev-dot-access-data/tree/v3.0.2" - }, - "install-path": "../dflydev/dot-access-data" - }, - { - "name": "doctrine/inflector", - "version": "2.0.6", - "version_normalized": "2.0.6.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/inflector.git", - "reference": "d9d313a36c872fd6ee06d9a6cbcf713eaa40f024" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/d9d313a36c872fd6ee06d9a6cbcf713eaa40f024", - "reference": "d9d313a36c872fd6ee06d9a6cbcf713eaa40f024", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^10", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-phpunit": "^1.1", - "phpstan/phpstan-strict-rules": "^1.3", - "phpunit/phpunit": "^8.5 || ^9.5", - "vimeo/psalm": "^4.25" - }, - "time": "2022-10-20T09:10:12+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Doctrine\\Inflector\\": "lib/Doctrine/Inflector" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.", - "homepage": "https://www.doctrine-project.org/projects/inflector.html", - "keywords": [ - "inflection", - "inflector", - "lowercase", - "manipulation", - "php", - "plural", - "singular", - "strings", - "uppercase", - "words" - ], - "support": { - "issues": "https://github.com/doctrine/inflector/issues", - "source": "https://github.com/doctrine/inflector/tree/2.0.6" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finflector", - "type": "tidelift" - } - ], - "install-path": "../doctrine/inflector" - }, - { - "name": "doctrine/instantiator", - "version": "1.4.1", - "version_normalized": "1.4.1.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^9", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^0.16 || ^1", - "phpstan/phpstan": "^1.4", - "phpstan/phpstan-phpunit": "^1", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.22" - }, - "time": "2022-03-03T08:28:38+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], - "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.1" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" - } - ], - "install-path": "../doctrine/instantiator" - }, - { - "name": "doctrine/lexer", - "version": "1.2.3", - "version_normalized": "1.2.3.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/lexer.git", - "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/c268e882d4dbdd85e36e4ad69e02dc284f89d229", - "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^9.0", - "phpstan/phpstan": "^1.3", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.11" - }, - "time": "2022-02-28T11:07:21+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "https://www.doctrine-project.org/projects/lexer.html", - "keywords": [ - "annotations", - "docblock", - "lexer", - "parser", - "php" - ], - "support": { - "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/1.2.3" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", - "type": "tidelift" - } - ], - "install-path": "../doctrine/lexer" - }, - { - "name": "dragonmantank/cron-expression", - "version": "v3.3.2", - "version_normalized": "3.3.2.0", - "source": { - "type": "git", - "url": "https://github.com/dragonmantank/cron-expression.git", - "reference": "782ca5968ab8b954773518e9e49a6f892a34b2a8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/782ca5968ab8b954773518e9e49a6f892a34b2a8", - "reference": "782ca5968ab8b954773518e9e49a6f892a34b2a8", - "shasum": "" - }, - "require": { - "php": "^7.2|^8.0", - "webmozart/assert": "^1.0" - }, - "replace": { - "mtdowling/cron-expression": "^1.0" - }, - "require-dev": { - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^1.0", - "phpstan/phpstan-webmozart-assert": "^1.0", - "phpunit/phpunit": "^7.0|^8.0|^9.0" - }, - "time": "2022-09-10T18:51:20+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Cron\\": "src/Cron/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Chris Tankersley", - "email": "chris@ctankersley.com", - "homepage": "https://github.com/dragonmantank" - } - ], - "description": "CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due", - "keywords": [ - "cron", - "schedule" - ], - "support": { - "issues": "https://github.com/dragonmantank/cron-expression/issues", - "source": "https://github.com/dragonmantank/cron-expression/tree/v3.3.2" - }, - "funding": [ - { - "url": "https://github.com/dragonmantank", - "type": "github" - } - ], - "install-path": "../dragonmantank/cron-expression" - }, - { - "name": "egulias/email-validator", - "version": "3.2.1", - "version_normalized": "3.2.1.0", - "source": { - "type": "git", - "url": "https://github.com/egulias/EmailValidator.git", - "reference": "f88dcf4b14af14a98ad96b14b2b317969eab6715" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/f88dcf4b14af14a98ad96b14b2b317969eab6715", - "reference": "f88dcf4b14af14a98ad96b14b2b317969eab6715", - "shasum": "" - }, - "require": { - "doctrine/lexer": "^1.2", - "php": ">=7.2", - "symfony/polyfill-intl-idn": "^1.15" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.2", - "phpunit/phpunit": "^8.5.8|^9.3.3", - "vimeo/psalm": "^4" - }, - "suggest": { - "ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation" - }, - "time": "2022-06-18T20:57:19+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Egulias\\EmailValidator\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Eduardo Gulias Davis" - } - ], - "description": "A library for validating emails against several RFCs", - "homepage": "https://github.com/egulias/EmailValidator", - "keywords": [ - "email", - "emailvalidation", - "emailvalidator", - "validation", - "validator" - ], - "support": { - "issues": "https://github.com/egulias/EmailValidator/issues", - "source": "https://github.com/egulias/EmailValidator/tree/3.2.1" - }, - "funding": [ - { - "url": "https://github.com/egulias", - "type": "github" - } - ], - "install-path": "../egulias/email-validator" - }, - { - "name": "fakerphp/faker", - "version": "v1.21.0", - "version_normalized": "1.21.0.0", - "source": { - "type": "git", - "url": "https://github.com/FakerPHP/Faker.git", - "reference": "92efad6a967f0b79c499705c69b662f738cc9e4d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/92efad6a967f0b79c499705c69b662f738cc9e4d", - "reference": "92efad6a967f0b79c499705c69b662f738cc9e4d", - "shasum": "" - }, - "require": { - "php": "^7.4 || ^8.0", - "psr/container": "^1.0 || ^2.0", - "symfony/deprecation-contracts": "^2.2 || ^3.0" - }, - "conflict": { - "fzaninotto/faker": "*" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", - "doctrine/persistence": "^1.3 || ^2.0", - "ext-intl": "*", - "phpunit/phpunit": "^9.5.26", - "symfony/phpunit-bridge": "^5.4.16" - }, - "suggest": { - "doctrine/orm": "Required to use Faker\\ORM\\Doctrine", - "ext-curl": "Required by Faker\\Provider\\Image to download images.", - "ext-dom": "Required by Faker\\Provider\\HtmlLorem for generating random HTML.", - "ext-iconv": "Required by Faker\\Provider\\ru_RU\\Text::realText() for generating real Russian text.", - "ext-mbstring": "Required for multibyte Unicode string functionality." - }, - "time": "2022-12-13T13:54:32+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "v1.21-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Faker\\": "src/Faker/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "François Zaninotto" - } - ], - "description": "Faker is a PHP library that generates fake data for you.", - "keywords": [ - "data", - "faker", - "fixtures" - ], - "support": { - "issues": "https://github.com/FakerPHP/Faker/issues", - "source": "https://github.com/FakerPHP/Faker/tree/v1.21.0" - }, - "install-path": "../fakerphp/faker" - }, - { - "name": "fruitcake/php-cors", - "version": "v1.2.0", - "version_normalized": "1.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/fruitcake/php-cors.git", - "reference": "58571acbaa5f9f462c9c77e911700ac66f446d4e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/fruitcake/php-cors/zipball/58571acbaa5f9f462c9c77e911700ac66f446d4e", - "reference": "58571acbaa5f9f462c9c77e911700ac66f446d4e", - "shasum": "" - }, - "require": { - "php": "^7.4|^8.0", - "symfony/http-foundation": "^4.4|^5.4|^6" - }, - "require-dev": { - "phpstan/phpstan": "^1.4", - "phpunit/phpunit": "^9", - "squizlabs/php_codesniffer": "^3.5" - }, - "time": "2022-02-20T15:07:15+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.1-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Fruitcake\\Cors\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fruitcake", - "homepage": "https://fruitcake.nl" - }, - { - "name": "Barryvdh", - "email": "barryvdh@gmail.com" - } - ], - "description": "Cross-origin resource sharing library for the Symfony HttpFoundation", - "homepage": "https://github.com/fruitcake/php-cors", - "keywords": [ - "cors", - "laravel", - "symfony" - ], - "support": { - "issues": "https://github.com/fruitcake/php-cors/issues", - "source": "https://github.com/fruitcake/php-cors/tree/v1.2.0" - }, - "funding": [ - { - "url": "https://fruitcake.nl", - "type": "custom" - }, - { - "url": "https://github.com/barryvdh", - "type": "github" - } - ], - "install-path": "../fruitcake/php-cors" - }, - { - "name": "graham-campbell/result-type", - "version": "v1.1.0", - "version_normalized": "1.1.0.0", - "source": { - "type": "git", - "url": "https://github.com/GrahamCampbell/Result-Type.git", - "reference": "a878d45c1914464426dc94da61c9e1d36ae262a8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/a878d45c1914464426dc94da61c9e1d36ae262a8", - "reference": "a878d45c1914464426dc94da61c9e1d36ae262a8", - "shasum": "" - }, - "require": { - "php": "^7.2.5 || ^8.0", - "phpoption/phpoption": "^1.9" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.28 || ^9.5.21" - }, - "time": "2022-07-30T15:56:11+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "GrahamCampbell\\ResultType\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - } - ], - "description": "An Implementation Of The Result Type", - "keywords": [ - "Graham Campbell", - "GrahamCampbell", - "Result Type", - "Result-Type", - "result" - ], - "support": { - "issues": "https://github.com/GrahamCampbell/Result-Type/issues", - "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.0" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type", - "type": "tidelift" - } - ], - "install-path": "../graham-campbell/result-type" - }, - { - "name": "guzzlehttp/psr7", - "version": "2.4.3", - "version_normalized": "2.4.3.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "67c26b443f348a51926030c83481b85718457d3d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/67c26b443f348a51926030c83481b85718457d3d", - "reference": "67c26b443f348a51926030c83481b85718457d3d", - "shasum": "" - }, - "require": { - "php": "^7.2.5 || ^8.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.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" - }, - "time": "2022-10-26T14:07:24+00:00", - "type": "library", - "extra": { - "bamarni-bin": { - "bin-links": true, - "forward-command": false - }, - "branch-alias": { - "dev-master": "2.4-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "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": "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://github.com/sagikazarmark" - }, - { - "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", - "keywords": [ - "http", - "message", - "psr-7", - "request", - "response", - "stream", - "uri", - "url" - ], - "support": { - "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.4.3" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://github.com/Nyholm", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", - "type": "tidelift" - } - ], - "install-path": "../guzzlehttp/psr7" - }, - { - "name": "hamcrest/hamcrest-php", - "version": "v2.0.1", - "version_normalized": "2.0.1.0", - "source": { - "type": "git", - "url": "https://github.com/hamcrest/hamcrest-php.git", - "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", - "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", - "shasum": "" - }, - "require": { - "php": "^5.3|^7.0|^8.0" - }, - "replace": { - "cordoval/hamcrest-php": "*", - "davedevelopment/hamcrest-php": "*", - "kodova/hamcrest-php": "*" - }, - "require-dev": { - "phpunit/php-file-iterator": "^1.4 || ^2.0", - "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0" - }, - "time": "2020-07-09T08:09:16+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "hamcrest" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "This is the PHP port of Hamcrest Matchers", - "keywords": [ - "test" - ], - "support": { - "issues": "https://github.com/hamcrest/hamcrest-php/issues", - "source": "https://github.com/hamcrest/hamcrest-php/tree/v2.0.1" - }, - "install-path": "../hamcrest/hamcrest-php" - }, - { - "name": "laravel/framework", - "version": "v9.45.1", - "version_normalized": "9.45.1.0", - "source": { - "type": "git", - "url": "https://github.com/laravel/framework.git", - "reference": "faeb20d3fc61b69790068161ab42bcf2d5faccbc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/faeb20d3fc61b69790068161ab42bcf2d5faccbc", - "reference": "faeb20d3fc61b69790068161ab42bcf2d5faccbc", - "shasum": "" - }, - "require": { - "doctrine/inflector": "^2.0", - "dragonmantank/cron-expression": "^3.3.2", - "egulias/email-validator": "^3.2.1", - "ext-mbstring": "*", - "ext-openssl": "*", - "fruitcake/php-cors": "^1.2", - "laravel/serializable-closure": "^1.2.2", - "league/commonmark": "^2.2.1", - "league/flysystem": "^3.8.0", - "monolog/monolog": "^2.0", - "nesbot/carbon": "^2.62.1", - "nunomaduro/termwind": "^1.13", - "php": "^8.0.2", - "psr/container": "^1.1.1|^2.0.1", - "psr/log": "^1.0|^2.0|^3.0", - "psr/simple-cache": "^1.0|^2.0|^3.0", - "ramsey/uuid": "^4.7", - "symfony/console": "^6.0.9", - "symfony/error-handler": "^6.0", - "symfony/finder": "^6.0", - "symfony/http-foundation": "^6.0", - "symfony/http-kernel": "^6.0", - "symfony/mailer": "^6.0", - "symfony/mime": "^6.0", - "symfony/process": "^6.0", - "symfony/routing": "^6.0", - "symfony/uid": "^6.0", - "symfony/var-dumper": "^6.0", - "tijsverkoyen/css-to-inline-styles": "^2.2.5", - "vlucas/phpdotenv": "^5.4.1", - "voku/portable-ascii": "^2.0" - }, - "conflict": { - "tightenco/collect": "<5.5.33" - }, - "provide": { - "psr/container-implementation": "1.1|2.0", - "psr/simple-cache-implementation": "1.0|2.0|3.0" - }, - "replace": { - "illuminate/auth": "self.version", - "illuminate/broadcasting": "self.version", - "illuminate/bus": "self.version", - "illuminate/cache": "self.version", - "illuminate/collections": "self.version", - "illuminate/conditionable": "self.version", - "illuminate/config": "self.version", - "illuminate/console": "self.version", - "illuminate/container": "self.version", - "illuminate/contracts": "self.version", - "illuminate/cookie": "self.version", - "illuminate/database": "self.version", - "illuminate/encryption": "self.version", - "illuminate/events": "self.version", - "illuminate/filesystem": "self.version", - "illuminate/hashing": "self.version", - "illuminate/http": "self.version", - "illuminate/log": "self.version", - "illuminate/macroable": "self.version", - "illuminate/mail": "self.version", - "illuminate/notifications": "self.version", - "illuminate/pagination": "self.version", - "illuminate/pipeline": "self.version", - "illuminate/queue": "self.version", - "illuminate/redis": "self.version", - "illuminate/routing": "self.version", - "illuminate/session": "self.version", - "illuminate/support": "self.version", - "illuminate/testing": "self.version", - "illuminate/translation": "self.version", - "illuminate/validation": "self.version", - "illuminate/view": "self.version" - }, - "require-dev": { - "ably/ably-php": "^1.0", - "aws/aws-sdk-php": "^3.235.5", - "doctrine/dbal": "^2.13.3|^3.1.4", - "fakerphp/faker": "^1.21", - "guzzlehttp/guzzle": "^7.5", - "league/flysystem-aws-s3-v3": "^3.0", - "league/flysystem-ftp": "^3.0", - "league/flysystem-path-prefixing": "^3.3", - "league/flysystem-read-only": "^3.3", - "league/flysystem-sftp-v3": "^3.0", - "mockery/mockery": "^1.5.1", - "orchestra/testbench-core": "^7.16", - "pda/pheanstalk": "^4.0", - "phpstan/phpstan": "^1.4.7", - "phpunit/phpunit": "^9.5.8", - "predis/predis": "^1.1.9|^2.0.2", - "symfony/cache": "^6.0" - }, - "suggest": { - "ably/ably-php": "Required to use the Ably broadcast driver (^1.0).", - "aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage, and SES mail driver (^3.235.5).", - "brianium/paratest": "Required to run tests in parallel (^6.0).", - "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.13.3|^3.1.4).", - "ext-bcmath": "Required to use the multiple_of validation rule.", - "ext-ftp": "Required to use the Flysystem FTP driver.", - "ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory::image().", - "ext-memcached": "Required to use the memcache cache driver.", - "ext-pcntl": "Required to use all features of the queue worker.", - "ext-posix": "Required to use all features of the queue worker.", - "ext-redis": "Required to use the Redis cache and queue drivers (^4.0|^5.0).", - "fakerphp/faker": "Required to use the eloquent factory builder (^1.9.1).", - "filp/whoops": "Required for friendly error pages in development (^2.14.3).", - "guzzlehttp/guzzle": "Required to use the HTTP Client and the ping methods on schedules (^7.5).", - "laravel/tinker": "Required to use the tinker console command (^2.0).", - "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^3.0).", - "league/flysystem-ftp": "Required to use the Flysystem FTP driver (^3.0).", - "league/flysystem-path-prefixing": "Required to use the scoped driver (^3.3).", - "league/flysystem-read-only": "Required to use read-only disks (^3.3)", - "league/flysystem-sftp-v3": "Required to use the Flysystem SFTP driver (^3.0).", - "mockery/mockery": "Required to use mocking (^1.5.1).", - "nyholm/psr7": "Required to use PSR-7 bridging features (^1.2).", - "pda/pheanstalk": "Required to use the beanstalk queue driver (^4.0).", - "phpunit/phpunit": "Required to use assertions and run tests (^9.5.8).", - "predis/predis": "Required to use the predis connector (^1.1.9|^2.0.2).", - "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).", - "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^6.0|^7.0).", - "symfony/cache": "Required to PSR-6 cache bridge (^6.0).", - "symfony/filesystem": "Required to enable support for relative symbolic links (^6.0).", - "symfony/http-client": "Required to enable support for the Symfony API mail transports (^6.0).", - "symfony/mailgun-mailer": "Required to enable support for the Mailgun mail transport (^6.0).", - "symfony/postmark-mailer": "Required to enable support for the Postmark mail transport (^6.0).", - "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^2.0)." - }, - "time": "2022-12-21T19:37:46+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "src/Illuminate/Collections/helpers.php", - "src/Illuminate/Events/functions.php", - "src/Illuminate/Foundation/helpers.php", - "src/Illuminate/Support/helpers.php" - ], - "psr-4": { - "Illuminate\\": "src/Illuminate/", - "Illuminate\\Support\\": [ - "src/Illuminate/Macroable/", - "src/Illuminate/Collections/", - "src/Illuminate/Conditionable/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Laravel Framework.", - "homepage": "https://laravel.com", - "keywords": [ - "framework", - "laravel" - ], - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "install-path": "../laravel/framework" - }, - { - "name": "laravel/pint", - "version": "v1.3.0", - "version_normalized": "1.3.0.0", - "source": { - "type": "git", - "url": "https://github.com/laravel/pint.git", - "reference": "6a2c0927b4f6ad4eadb5a67fe3835fdad108949d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/6a2c0927b4f6ad4eadb5a67fe3835fdad108949d", - "reference": "6a2c0927b4f6ad4eadb5a67fe3835fdad108949d", - "shasum": "" - }, - "require": { - "ext-json": "*", - "ext-mbstring": "*", - "ext-tokenizer": "*", - "ext-xml": "*", - "php": "^8.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "~3.13.1", - "illuminate/view": "^9.32.0", - "laravel-zero/framework": "^9.2.0", - "mockery/mockery": "^1.5.1", - "nunomaduro/larastan": "^2.2.0", - "nunomaduro/termwind": "^1.14.0", - "pestphp/pest": "^1.22.1" - }, - "time": "2022-12-20T17:16:15+00:00", - "bin": [ - "builds/pint" - ], - "type": "project", - "installation-source": "dist", - "autoload": { - "psr-4": { - "App\\": "app/", - "Database\\Seeders\\": "database/seeders/", - "Database\\Factories\\": "database/factories/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nuno Maduro", - "email": "enunomaduro@gmail.com" - } - ], - "description": "An opinionated code formatter for PHP.", - "homepage": "https://laravel.com", - "keywords": [ - "format", - "formatter", - "lint", - "linter", - "php" - ], - "support": { - "issues": "https://github.com/laravel/pint/issues", - "source": "https://github.com/laravel/pint" - }, - "install-path": "../laravel/pint" - }, - { - "name": "laravel/serializable-closure", - "version": "v1.2.2", - "version_normalized": "1.2.2.0", - "source": { - "type": "git", - "url": "https://github.com/laravel/serializable-closure.git", - "reference": "47afb7fae28ed29057fdca37e16a84f90cc62fae" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/47afb7fae28ed29057fdca37e16a84f90cc62fae", - "reference": "47afb7fae28ed29057fdca37e16a84f90cc62fae", - "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": "2022-09-08T13:45:54+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/commonmark", - "version": "2.3.8", - "version_normalized": "2.3.8.0", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/commonmark.git", - "reference": "c493585c130544c4e91d2e0e131e6d35cb0cbc47" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/c493585c130544c4e91d2e0e131e6d35cb0cbc47", - "reference": "c493585c130544c4e91d2e0e131e6d35cb0cbc47", - "shasum": "" - }, - "require": { - "ext-mbstring": "*", - "league/config": "^1.1.1", - "php": "^7.4 || ^8.0", - "psr/event-dispatcher": "^1.0", - "symfony/deprecation-contracts": "^2.1 || ^3.0", - "symfony/polyfill-php80": "^1.16" - }, - "require-dev": { - "cebe/markdown": "^1.0", - "commonmark/cmark": "0.30.0", - "commonmark/commonmark.js": "0.30.0", - "composer/package-versions-deprecated": "^1.8", - "embed/embed": "^4.4", - "erusev/parsedown": "^1.0", - "ext-json": "*", - "github/gfm": "0.29.0", - "michelf/php-markdown": "^1.4 || ^2.0", - "nyholm/psr7": "^1.5", - "phpstan/phpstan": "^1.8.2", - "phpunit/phpunit": "^9.5.21", - "scrutinizer/ocular": "^1.8.1", - "symfony/finder": "^5.3 | ^6.0", - "symfony/yaml": "^2.3 | ^3.0 | ^4.0 | ^5.0 | ^6.0", - "unleashedtech/php-coding-standard": "^3.1.1", - "vimeo/psalm": "^4.24.0 || ^5.0.0" - }, - "suggest": { - "symfony/yaml": "v2.3+ required if using the Front Matter extension" - }, - "time": "2022-12-10T16:02:17+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.4-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "League\\CommonMark\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Colin O'Dell", - "email": "colinodell@gmail.com", - "homepage": "https://www.colinodell.com", - "role": "Lead Developer" - } - ], - "description": "Highly-extensible PHP Markdown parser which fully supports the CommonMark spec and GitHub-Flavored Markdown (GFM)", - "homepage": "https://commonmark.thephpleague.com", - "keywords": [ - "commonmark", - "flavored", - "gfm", - "github", - "github-flavored", - "markdown", - "md", - "parser" - ], - "support": { - "docs": "https://commonmark.thephpleague.com/", - "forum": "https://github.com/thephpleague/commonmark/discussions", - "issues": "https://github.com/thephpleague/commonmark/issues", - "rss": "https://github.com/thephpleague/commonmark/releases.atom", - "source": "https://github.com/thephpleague/commonmark" - }, - "funding": [ - { - "url": "https://www.colinodell.com/sponsor", - "type": "custom" - }, - { - "url": "https://www.paypal.me/colinpodell/10.00", - "type": "custom" - }, - { - "url": "https://github.com/colinodell", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/league/commonmark", - "type": "tidelift" - } - ], - "install-path": "../league/commonmark" - }, - { - "name": "league/config", - "version": "v1.2.0", - "version_normalized": "1.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/config.git", - "reference": "754b3604fb2984c71f4af4a9cbe7b57f346ec1f3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/config/zipball/754b3604fb2984c71f4af4a9cbe7b57f346ec1f3", - "reference": "754b3604fb2984c71f4af4a9cbe7b57f346ec1f3", - "shasum": "" - }, - "require": { - "dflydev/dot-access-data": "^3.0.1", - "nette/schema": "^1.2", - "php": "^7.4 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.8.2", - "phpunit/phpunit": "^9.5.5", - "scrutinizer/ocular": "^1.8.1", - "unleashedtech/php-coding-standard": "^3.1", - "vimeo/psalm": "^4.7.3" - }, - "time": "2022-12-11T20:36:23+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.2-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "League\\Config\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Colin O'Dell", - "email": "colinodell@gmail.com", - "homepage": "https://www.colinodell.com", - "role": "Lead Developer" - } - ], - "description": "Define configuration arrays with strict schemas and access values with dot notation", - "homepage": "https://config.thephpleague.com", - "keywords": [ - "array", - "config", - "configuration", - "dot", - "dot-access", - "nested", - "schema" - ], - "support": { - "docs": "https://config.thephpleague.com/", - "issues": "https://github.com/thephpleague/config/issues", - "rss": "https://github.com/thephpleague/config/releases.atom", - "source": "https://github.com/thephpleague/config" - }, - "funding": [ - { - "url": "https://www.colinodell.com/sponsor", - "type": "custom" - }, - { - "url": "https://www.paypal.me/colinpodell/10.00", - "type": "custom" - }, - { - "url": "https://github.com/colinodell", - "type": "github" - } - ], - "install-path": "../league/config" - }, - { - "name": "league/flysystem", - "version": "3.12.0", - "version_normalized": "3.12.0.0", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/flysystem.git", - "reference": "2aef65a47e44f2d6f9938f720f6dd697e7ba7b76" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/2aef65a47e44f2d6f9938f720f6dd697e7ba7b76", - "reference": "2aef65a47e44f2d6f9938f720f6dd697e7ba7b76", - "shasum": "" - }, - "require": { - "league/mime-type-detection": "^1.0.0", - "php": "^8.0.2" - }, - "conflict": { - "aws/aws-sdk-php": "3.209.31 || 3.210.0", - "guzzlehttp/guzzle": "<7.0", - "guzzlehttp/ringphp": "<1.1.1", - "phpseclib/phpseclib": "3.0.15", - "symfony/http-client": "<5.2" - }, - "require-dev": { - "async-aws/s3": "^1.5", - "async-aws/simple-s3": "^1.1", - "aws/aws-sdk-php": "^3.198.1", - "composer/semver": "^3.0", - "ext-fileinfo": "*", - "ext-ftp": "*", - "ext-zip": "*", - "friendsofphp/php-cs-fixer": "^3.5", - "google/cloud-storage": "^1.23", - "microsoft/azure-storage-blob": "^1.1", - "phpseclib/phpseclib": "^3.0.14", - "phpstan/phpstan": "^0.12.26", - "phpunit/phpunit": "^9.5.11", - "sabre/dav": "^4.3.1" - }, - "time": "2022-12-20T20:21:10+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "League\\Flysystem\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Frank de Jonge", - "email": "info@frankdejonge.nl" - } - ], - "description": "File storage abstraction for PHP", - "keywords": [ - "WebDAV", - "aws", - "cloud", - "file", - "files", - "filesystem", - "filesystems", - "ftp", - "s3", - "sftp", - "storage" - ], - "support": { - "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/3.12.0" - }, - "funding": [ - { - "url": "https://ecologi.com/frankdejonge", - "type": "custom" - }, - { - "url": "https://github.com/frankdejonge", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/league/flysystem", - "type": "tidelift" - } - ], - "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": "mockery/mockery", - "version": "1.5.1", - "version_normalized": "1.5.1.0", - "source": { - "type": "git", - "url": "https://github.com/mockery/mockery.git", - "reference": "e92dcc83d5a51851baf5f5591d32cb2b16e3684e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/e92dcc83d5a51851baf5f5591d32cb2b16e3684e", - "reference": "e92dcc83d5a51851baf5f5591d32cb2b16e3684e", - "shasum": "" - }, - "require": { - "hamcrest/hamcrest-php": "^2.0.1", - "lib-pcre": ">=7.0", - "php": "^7.3 || ^8.0" - }, - "conflict": { - "phpunit/phpunit": "<8.0" - }, - "require-dev": { - "phpunit/phpunit": "^8.5 || ^9.3" - }, - "time": "2022-09-07T15:32:08+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Mockery": "library/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Pádraic Brady", - "email": "padraic.brady@gmail.com", - "homepage": "http://blog.astrumfutura.com" - }, - { - "name": "Dave Marshall", - "email": "dave.marshall@atstsolutions.co.uk", - "homepage": "http://davedevelopment.co.uk" - } - ], - "description": "Mockery is a simple yet flexible PHP mock object framework", - "homepage": "https://github.com/mockery/mockery", - "keywords": [ - "BDD", - "TDD", - "library", - "mock", - "mock objects", - "mockery", - "stub", - "test", - "test double", - "testing" - ], - "support": { - "issues": "https://github.com/mockery/mockery/issues", - "source": "https://github.com/mockery/mockery/tree/1.5.1" - }, - "install-path": "../mockery/mockery" - }, - { - "name": "monolog/monolog", - "version": "2.8.0", - "version_normalized": "2.8.0.0", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/monolog.git", - "reference": "720488632c590286b88b80e62aa3d3d551ad4a50" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/720488632c590286b88b80e62aa3d3d551ad4a50", - "reference": "720488632c590286b88b80e62aa3d3d551ad4a50", - "shasum": "" - }, - "require": { - "php": ">=7.2", - "psr/log": "^1.0.1 || ^2.0 || ^3.0" - }, - "provide": { - "psr/log-implementation": "1.0.0 || 2.0.0 || 3.0.0" - }, - "require-dev": { - "aws/aws-sdk-php": "^2.4.9 || ^3.0", - "doctrine/couchdb": "~1.0@dev", - "elasticsearch/elasticsearch": "^7 || ^8", - "ext-json": "*", - "graylog2/gelf-php": "^1.4.2", - "guzzlehttp/guzzle": "^7.4", - "guzzlehttp/psr7": "^2.2", - "mongodb/mongodb": "^1.8", - "php-amqplib/php-amqplib": "~2.4 || ^3", - "phpspec/prophecy": "^1.15", - "phpstan/phpstan": "^0.12.91", - "phpunit/phpunit": "^8.5.14", - "predis/predis": "^1.1 || ^2.0", - "rollbar/rollbar": "^1.3 || ^2 || ^3", - "ruflin/elastica": "^7", - "swiftmailer/swiftmailer": "^5.3|^6.0", - "symfony/mailer": "^5.4 || ^6", - "symfony/mime": "^5.4 || ^6" - }, - "suggest": { - "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", - "doctrine/couchdb": "Allow sending log messages to a CouchDB server", - "elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client", - "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", - "ext-curl": "Required to send log messages using the IFTTTHandler, the LogglyHandler, the SendGridHandler, the SlackWebhookHandler or the TelegramBotHandler", - "ext-mbstring": "Allow to work properly with unicode symbols", - "ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)", - "ext-openssl": "Required to send log messages using SSL", - "ext-sockets": "Allow sending log messages to a Syslog server (via UDP driver)", - "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", - "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", - "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", - "rollbar/rollbar": "Allow sending log messages to Rollbar", - "ruflin/elastica": "Allow sending log messages to an Elastic Search server" - }, - "time": "2022-07-24T11:55:47+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Monolog\\": "src/Monolog" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "https://seld.be" - } - ], - "description": "Sends your logs to files, sockets, inboxes, databases and various web services", - "homepage": "https://github.com/Seldaek/monolog", - "keywords": [ - "log", - "logging", - "psr-3" - ], - "support": { - "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/2.8.0" - }, - "funding": [ - { - "url": "https://github.com/Seldaek", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", - "type": "tidelift" - } - ], - "install-path": "../monolog/monolog" - }, - { - "name": "myclabs/deep-copy", - "version": "1.11.0", - "version_normalized": "1.11.0.0", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "conflict": { - "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" - }, - "require-dev": { - "doctrine/collections": "^1.6.8", - "doctrine/common": "^2.13.3 || ^3.2.2", - "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" - }, - "time": "2022-03-03T13:19:32+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "files": [ - "src/DeepCopy/deep_copy.php" - ], - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "support": { - "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0" - }, - "funding": [ - { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" - } - ], - "install-path": "../myclabs/deep-copy" - }, - { - "name": "nesbot/carbon", - "version": "2.64.0", - "version_normalized": "2.64.0.0", - "source": { - "type": "git", - "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "889546413c97de2d05063b8cb7b193c2531ea211" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/889546413c97de2d05063b8cb7b193c2531ea211", - "reference": "889546413c97de2d05063b8cb7b193c2531ea211", - "shasum": "" - }, - "require": { - "ext-json": "*", - "php": "^7.1.8 || ^8.0", - "symfony/polyfill-mbstring": "^1.0", - "symfony/polyfill-php80": "^1.16", - "symfony/translation": "^3.4 || ^4.0 || ^5.0 || ^6.0" - }, - "require-dev": { - "doctrine/dbal": "^2.0 || ^3.1.4", - "doctrine/orm": "^2.7", - "friendsofphp/php-cs-fixer": "^3.0", - "kylekatarnls/multi-tester": "^2.0", - "ondrejmirtes/better-reflection": "*", - "phpmd/phpmd": "^2.9", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12.99 || ^1.7.14", - "phpunit/php-file-iterator": "^2.0.5 || ^3.0.6", - "phpunit/phpunit": "^7.5.20 || ^8.5.26 || ^9.5.20", - "squizlabs/php_codesniffer": "^3.4" - }, - "time": "2022-11-26T17:36:00+00:00", - "bin": [ - "bin/carbon" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-3.x": "3.x-dev", - "dev-master": "2.x-dev" - }, - "laravel": { - "providers": [ - "Carbon\\Laravel\\ServiceProvider" - ] - }, - "phpstan": { - "includes": [ - "extension.neon" - ] - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Carbon\\": "src/Carbon/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Brian Nesbitt", - "email": "brian@nesbot.com", - "homepage": "https://markido.com" - }, - { - "name": "kylekatarnls", - "homepage": "https://github.com/kylekatarnls" - } - ], - "description": "An API extension for DateTime that supports 281 different languages.", - "homepage": "https://carbon.nesbot.com", - "keywords": [ - "date", - "datetime", - "time" - ], - "support": { - "docs": "https://carbon.nesbot.com/docs", - "issues": "https://github.com/briannesbitt/Carbon/issues", - "source": "https://github.com/briannesbitt/Carbon" - }, - "funding": [ - { - "url": "https://github.com/sponsors/kylekatarnls", - "type": "github" - }, - { - "url": "https://opencollective.com/Carbon#sponsor", - "type": "opencollective" - }, - { - "url": "https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme", - "type": "tidelift" - } - ], - "install-path": "../nesbot/carbon" - }, - { - "name": "nette/schema", - "version": "v1.2.3", - "version_normalized": "1.2.3.0", - "source": { - "type": "git", - "url": "https://github.com/nette/schema.git", - "reference": "abbdbb70e0245d5f3bf77874cea1dfb0c930d06f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/schema/zipball/abbdbb70e0245d5f3bf77874cea1dfb0c930d06f", - "reference": "abbdbb70e0245d5f3bf77874cea1dfb0c930d06f", - "shasum": "" - }, - "require": { - "nette/utils": "^2.5.7 || ^3.1.5 || ^4.0", - "php": ">=7.1 <8.3" - }, - "require-dev": { - "nette/tester": "^2.3 || ^2.4", - "phpstan/phpstan-nette": "^1.0", - "tracy/tracy": "^2.7" - }, - "time": "2022-10-13T01:24:26+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0-only", - "GPL-3.0-only" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "📐 Nette Schema: validating data structures against a given Schema.", - "homepage": "https://nette.org", - "keywords": [ - "config", - "nette" - ], - "support": { - "issues": "https://github.com/nette/schema/issues", - "source": "https://github.com/nette/schema/tree/v1.2.3" - }, - "install-path": "../nette/schema" - }, - { - "name": "nette/utils", - "version": "v3.2.8", - "version_normalized": "3.2.8.0", - "source": { - "type": "git", - "url": "https://github.com/nette/utils.git", - "reference": "02a54c4c872b99e4ec05c4aec54b5a06eb0f6368" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/02a54c4c872b99e4ec05c4aec54b5a06eb0f6368", - "reference": "02a54c4c872b99e4ec05c4aec54b5a06eb0f6368", - "shasum": "" - }, - "require": { - "php": ">=7.2 <8.3" - }, - "conflict": { - "nette/di": "<3.0.6" - }, - "require-dev": { - "nette/tester": "~2.0", - "phpstan/phpstan": "^1.0", - "tracy/tracy": "^2.3" - }, - "suggest": { - "ext-gd": "to use Image", - "ext-iconv": "to use Strings::webalize(), toAscii(), chr() and reverse()", - "ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()", - "ext-json": "to use Nette\\Utils\\Json", - "ext-mbstring": "to use Strings::lower() etc...", - "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()", - "ext-xml": "to use Strings::length() etc. when mbstring is not available" - }, - "time": "2022-09-12T23:36:20+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0-only", - "GPL-3.0-only" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "🛠 Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.", - "homepage": "https://nette.org", - "keywords": [ - "array", - "core", - "datetime", - "images", - "json", - "nette", - "paginator", - "password", - "slugify", - "string", - "unicode", - "utf-8", - "utility", - "validation" - ], - "support": { - "issues": "https://github.com/nette/utils/issues", - "source": "https://github.com/nette/utils/tree/v3.2.8" - }, - "install-path": "../nette/utils" - }, - { - "name": "nikic/php-parser", - "version": "v4.15.2", - "version_normalized": "4.15.2.0", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc", - "reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=7.0" - }, - "require-dev": { - "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" - }, - "time": "2022-11-12T15:38:23+00:00", - "bin": [ - "bin/php-parse" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.9-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "PhpParser\\": "lib/PhpParser" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov" - } - ], - "description": "A PHP parser written in PHP", - "keywords": [ - "parser", - "php" - ], - "support": { - "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.2" - }, - "install-path": "../nikic/php-parser" - }, - { - "name": "nunomaduro/termwind", - "version": "v1.15.0", - "version_normalized": "1.15.0.0", - "source": { - "type": "git", - "url": "https://github.com/nunomaduro/termwind.git", - "reference": "594ab862396c16ead000de0c3c38f4a5cbe1938d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nunomaduro/termwind/zipball/594ab862396c16ead000de0c3c38f4a5cbe1938d", - "reference": "594ab862396c16ead000de0c3c38f4a5cbe1938d", - "shasum": "" - }, - "require": { - "ext-mbstring": "*", - "php": "^8.0", - "symfony/console": "^5.3.0|^6.0.0" - }, - "require-dev": { - "ergebnis/phpstan-rules": "^1.0.", - "illuminate/console": "^8.0|^9.0", - "illuminate/support": "^8.0|^9.0", - "laravel/pint": "^1.0.0", - "pestphp/pest": "^1.21.0", - "pestphp/pest-plugin-mock": "^1.0", - "phpstan/phpstan": "^1.4.6", - "phpstan/phpstan-strict-rules": "^1.1.0", - "symfony/var-dumper": "^5.2.7|^6.0.0", - "thecodingmachine/phpstan-strict-rules": "^1.0.0" - }, - "time": "2022-12-20T19:00:15+00:00", - "type": "library", - "extra": { - "laravel": { - "providers": [ - "Termwind\\Laravel\\TermwindServiceProvider" - ] - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "src/Functions.php" - ], - "psr-4": { - "Termwind\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nuno Maduro", - "email": "enunomaduro@gmail.com" - } - ], - "description": "Its like Tailwind CSS, but for the console.", - "keywords": [ - "cli", - "console", - "css", - "package", - "php", - "style" - ], - "support": { - "issues": "https://github.com/nunomaduro/termwind/issues", - "source": "https://github.com/nunomaduro/termwind/tree/v1.15.0" - }, - "funding": [ - { - "url": "https://www.paypal.com/paypalme/enunomaduro", - "type": "custom" - }, - { - "url": "https://github.com/nunomaduro", - "type": "github" - }, - { - "url": "https://github.com/xiCO2k", - "type": "github" - } - ], - "install-path": "../nunomaduro/termwind" - }, - { - "name": "orchestra/testbench", - "version": "v7.17.0", - "version_normalized": "7.17.0.0", - "source": { - "type": "git", - "url": "https://github.com/orchestral/testbench.git", - "reference": "ad16d4c73d7027aaf5635fd8315773de05cda06c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/orchestral/testbench/zipball/ad16d4c73d7027aaf5635fd8315773de05cda06c", - "reference": "ad16d4c73d7027aaf5635fd8315773de05cda06c", - "shasum": "" - }, - "require": { - "fakerphp/faker": "^1.21", - "laravel/framework": "^9.45", - "mockery/mockery": "^1.5.1", - "orchestra/testbench-core": "^7.17", - "php": "^8.0", - "phpunit/phpunit": "^9.5.10", - "spatie/laravel-ray": "^1.28", - "symfony/process": "^6.0.9", - "symfony/yaml": "^6.0.9", - "vlucas/phpdotenv": "^5.4.1" - }, - "time": "2022-12-22T02:17:10+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "7.0-dev" - } - }, - "installation-source": "dist", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mior Muhammad Zaki", - "email": "crynobone@gmail.com", - "homepage": "https://github.com/crynobone" - } - ], - "description": "Laravel Testing Helper for Packages Development", - "homepage": "https://packages.tools/testbench/", - "keywords": [ - "BDD", - "TDD", - "laravel", - "orchestra-platform", - "orchestral", - "testing" - ], - "support": { - "issues": "https://github.com/orchestral/testbench/issues", - "source": "https://github.com/orchestral/testbench/tree/v7.17.0" - }, - "install-path": "../orchestra/testbench" - }, - { - "name": "orchestra/testbench-core", - "version": "v7.17.0", - "version_normalized": "7.17.0.0", - "source": { - "type": "git", - "url": "https://github.com/orchestral/testbench-core.git", - "reference": "fb2408561c92cf9ef54a8af36e6d8965a9e15e52" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/orchestral/testbench-core/zipball/fb2408561c92cf9ef54a8af36e6d8965a9e15e52", - "reference": "fb2408561c92cf9ef54a8af36e6d8965a9e15e52", - "shasum": "" - }, - "require": { - "php": "^8.0" - }, - "require-dev": { - "fakerphp/faker": "^1.21", - "laravel/framework": "^9.45", - "laravel/laravel": "9.x-dev", - "laravel/pint": "^1.1", - "mockery/mockery": "^1.5.1", - "orchestra/canvas": "^7.0", - "phpstan/phpstan": "^1.8", - "phpunit/phpunit": "^9.5.10", - "spatie/laravel-ray": "^1.28", - "symfony/process": "^6.0.9", - "symfony/yaml": "^6.0.9", - "vlucas/phpdotenv": "^5.4.1" - }, - "suggest": { - "brianium/paratest": "Allow using parallel tresting (^6.4).", - "fakerphp/faker": "Allow using Faker for testing (^1.21).", - "laravel/framework": "Required for testing (^9.45).", - "mockery/mockery": "Allow using Mockery for testing (^1.5.1).", - "nunomaduro/collision": "Allow using Laravel style tests output and parallel testing (^6.2).", - "orchestra/testbench-browser-kit": "Allow using legacy Laravel BrowserKit for testing (^7.0).", - "orchestra/testbench-dusk": "Allow using Laravel Dusk for testing (^7.0).", - "phpunit/phpunit": "Allow using PHPUnit for testing (^9.5.10).", - "symfony/yaml": "Required for CLI Commander (^6.0.9).", - "vlucas/phpdotenv": "Required for CLI Commander (^5.4.1)." - }, - "time": "2022-12-22T02:11:25+00:00", - "bin": [ - "testbench" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "7.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "src/helpers.php" - ], - "psr-4": { - "Orchestra\\Testbench\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mior Muhammad Zaki", - "email": "crynobone@gmail.com", - "homepage": "https://github.com/crynobone" - } - ], - "description": "Testing Helper for Laravel Development", - "homepage": "https://packages.tools/testbench", - "keywords": [ - "BDD", - "TDD", - "laravel", - "orchestra-platform", - "orchestral", - "testing" - ], - "support": { - "issues": "https://github.com/orchestral/testbench/issues", - "source": "https://github.com/orchestral/testbench-core" - }, - "install-path": "../orchestra/testbench-core" - }, - { - "name": "phar-io/manifest", - "version": "2.0.3", - "version_normalized": "2.0.3.0", - "source": { - "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-phar": "*", - "ext-xmlwriter": "*", - "phar-io/version": "^3.0.1", - "php": "^7.2 || ^8.0" - }, - "time": "2021-07-20T11:28:43+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "support": { - "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.3" - }, - "install-path": "../phar-io/manifest" - }, - { - "name": "phar-io/version", - "version": "3.2.1", - "version_normalized": "3.2.1.0", - "source": { - "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "time": "2022-02-21T01:04:05+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Library for handling version information and constraints", - "support": { - "issues": "https://github.com/phar-io/version/issues", - "source": "https://github.com/phar-io/version/tree/3.2.1" - }, - "install-path": "../phar-io/version" - }, - { - "name": "phpoption/phpoption", - "version": "1.9.0", - "version_normalized": "1.9.0.0", - "source": { - "type": "git", - "url": "https://github.com/schmittjoh/php-option.git", - "reference": "dc5ff11e274a90cc1c743f66c9ad700ce50db9ab" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/dc5ff11e274a90cc1c743f66c9ad700ce50db9ab", - "reference": "dc5ff11e274a90cc1c743f66c9ad700ce50db9ab", - "shasum": "" - }, - "require": { - "php": "^7.2.5 || ^8.0" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.8", - "phpunit/phpunit": "^8.5.28 || ^9.5.21" - }, - "time": "2022-07-30T15:51:26+00:00", - "type": "library", - "extra": { - "bamarni-bin": { - "bin-links": true, - "forward-command": true - }, - "branch-alias": { - "dev-master": "1.9-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "PhpOption\\": "src/PhpOption/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Johannes M. Schmitt", - "email": "schmittjoh@gmail.com", - "homepage": "https://github.com/schmittjoh" - }, - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - } - ], - "description": "Option Type for PHP", - "keywords": [ - "language", - "option", - "php", - "type" - ], - "support": { - "issues": "https://github.com/schmittjoh/php-option/issues", - "source": "https://github.com/schmittjoh/php-option/tree/1.9.0" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption", - "type": "tidelift" - } - ], - "install-path": "../phpoption/phpoption" - }, - { - "name": "phpunit/php-code-coverage", - "version": "9.2.22", - "version_normalized": "9.2.22.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "e4bf60d2220b4baaa0572986b5d69870226b06df" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/e4bf60d2220b4baaa0572986b5d69870226b06df", - "reference": "e4bf60d2220b4baaa0572986b5d69870226b06df", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-libxml": "*", - "ext-xmlwriter": "*", - "nikic/php-parser": "^4.14", - "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.3", - "phpunit/php-text-template": "^2.0.2", - "sebastian/code-unit-reverse-lookup": "^2.0.2", - "sebastian/complexity": "^2.0", - "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0.3", - "sebastian/version": "^3.0.1", - "theseer/tokenizer": "^1.2.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-pcov": "*", - "ext-xdebug": "*" - }, - "time": "2022-12-18T16:40:55+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "9.2-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.22" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../phpunit/php-code-coverage" - }, - { - "name": "phpunit/php-file-iterator", - "version": "3.0.6", - "version_normalized": "3.0.6.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "time": "2021-12-02T12:48:52+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../phpunit/php-file-iterator" - }, - { - "name": "phpunit/php-invoker", - "version": "3.1.1", - "version_normalized": "3.1.1.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "ext-pcntl": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-pcntl": "*" - }, - "time": "2020-09-28T05:58:55+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Invoke callables with a timeout", - "homepage": "https://github.com/sebastianbergmann/php-invoker/", - "keywords": [ - "process" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-invoker/issues", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../phpunit/php-invoker" - }, - { - "name": "phpunit/php-text-template", - "version": "2.0.4", - "version_normalized": "2.0.4.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "time": "2020-10-26T05:33:50+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../phpunit/php-text-template" - }, - { - "name": "phpunit/php-timer", - "version": "5.0.3", - "version_normalized": "5.0.3.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "time": "2020-10-26T13:16:10+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../phpunit/php-timer" - }, - { - "name": "phpunit/phpunit", - "version": "9.5.27", - "version_normalized": "9.5.27.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "a2bc7ffdca99f92d959b3f2270529334030bba38" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a2bc7ffdca99f92d959b3f2270529334030bba38", - "reference": "a2bc7ffdca99f92d959b3f2270529334030bba38", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.3.1", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.1", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", - "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.13", - "phpunit/php-file-iterator": "^3.0.5", - "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.3", - "phpunit/php-timer": "^5.0.2", - "sebastian/cli-parser": "^1.0.1", - "sebastian/code-unit": "^1.0.6", - "sebastian/comparator": "^4.0.8", - "sebastian/diff": "^4.0.3", - "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.5", - "sebastian/global-state": "^5.0.1", - "sebastian/object-enumerator": "^4.0.3", - "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.2", - "sebastian/version": "^3.0.2" - }, - "suggest": { - "ext-soap": "*", - "ext-xdebug": "*" - }, - "time": "2022-12-09T07:31:23+00:00", - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "9.5-dev" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "src/Framework/Assert/Functions.php" - ], - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.27" - }, - "funding": [ - { - "url": "https://phpunit.de/sponsors.html", - "type": "custom" - }, - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", - "type": "tidelift" - } - ], - "install-path": "../phpunit/phpunit" - }, - { - "name": "pimple/pimple", - "version": "v3.5.0", - "version_normalized": "3.5.0.0", - "source": { - "type": "git", - "url": "https://github.com/silexphp/Pimple.git", - "reference": "a94b3a4db7fb774b3d78dad2315ddc07629e1bed" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/silexphp/Pimple/zipball/a94b3a4db7fb774b3d78dad2315ddc07629e1bed", - "reference": "a94b3a4db7fb774b3d78dad2315ddc07629e1bed", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "psr/container": "^1.1 || ^2.0" - }, - "require-dev": { - "symfony/phpunit-bridge": "^5.4@dev" - }, - "time": "2021-10-28T11:13:42+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Pimple": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Pimple, a simple Dependency Injection Container", - "homepage": "https://pimple.symfony.com", - "keywords": [ - "container", - "dependency injection" - ], - "support": { - "source": "https://github.com/silexphp/Pimple/tree/v3.5.0" - }, - "install-path": "../pimple/pimple" - }, - { - "name": "psr/container", - "version": "2.0.2", - "version_normalized": "2.0.2.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "shasum": "" - }, - "require": { - "php": ">=7.4.0" - }, - "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": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "support": { - "issues": "https://github.com/php-fig/container/issues", - "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-factory", - "version": "1.0.1", - "version_normalized": "1.0.1.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-factory.git", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", - "shasum": "" - }, - "require": { - "php": ">=7.0.0", - "psr/http-message": "^1.0" - }, - "time": "2019-04-30T12:38:16+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": "http://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/master" - }, - "install-path": "../psr/http-factory" - }, - { - "name": "psr/http-message", - "version": "1.0.1", - "version_normalized": "1.0.1.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "time": "2016-08-06T14:39:51+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": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "support": { - "source": "https://github.com/php-fig/http-message/tree/master" - }, - "install-path": "../psr/http-message" - }, - { - "name": "psr/log", - "version": "3.0.0", - "version_normalized": "3.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "time": "2021-07-14T16:46:02+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\Log\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "support": { - "source": "https://github.com/php-fig/log/tree/3.0.0" - }, - "install-path": "../psr/log" - }, - { - "name": "psr/simple-cache", - "version": "3.0.0", - "version_normalized": "3.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/simple-cache.git", - "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865", - "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "time": "2021-10-29T13:26:27+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\SimpleCache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interfaces for simple caching", - "keywords": [ - "cache", - "caching", - "psr", - "psr-16", - "simple-cache" - ], - "support": { - "source": "https://github.com/php-fig/simple-cache/tree/3.0.0" - }, - "install-path": "../psr/simple-cache" - }, - { - "name": "ralouphie/getallheaders", - "version": "3.0.3", - "version_normalized": "3.0.3.0", - "source": { - "type": "git", - "url": "https://github.com/ralouphie/getallheaders.git", - "reference": "120b605dfeb996808c31b6477290a714d356e822" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", - "reference": "120b605dfeb996808c31b6477290a714d356e822", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.1", - "phpunit/phpunit": "^5 || ^6.5" - }, - "time": "2019-03-08T08:55:37+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "files": [ - "src/getallheaders.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ralph Khattar", - "email": "ralph.khattar@gmail.com" - } - ], - "description": "A polyfill for getallheaders.", - "support": { - "issues": "https://github.com/ralouphie/getallheaders/issues", - "source": "https://github.com/ralouphie/getallheaders/tree/develop" - }, - "install-path": "../ralouphie/getallheaders" - }, - { - "name": "ramsey/collection", - "version": "1.2.2", - "version_normalized": "1.2.2.0", - "source": { - "type": "git", - "url": "https://github.com/ramsey/collection.git", - "reference": "cccc74ee5e328031b15640b51056ee8d3bb66c0a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ramsey/collection/zipball/cccc74ee5e328031b15640b51056ee8d3bb66c0a", - "reference": "cccc74ee5e328031b15640b51056ee8d3bb66c0a", - "shasum": "" - }, - "require": { - "php": "^7.3 || ^8", - "symfony/polyfill-php81": "^1.23" - }, - "require-dev": { - "captainhook/captainhook": "^5.3", - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "ergebnis/composer-normalize": "^2.6", - "fakerphp/faker": "^1.5", - "hamcrest/hamcrest-php": "^2", - "jangregor/phpstan-prophecy": "^0.8", - "mockery/mockery": "^1.3", - "phpspec/prophecy-phpunit": "^2.0", - "phpstan/extension-installer": "^1", - "phpstan/phpstan": "^0.12.32", - "phpstan/phpstan-mockery": "^0.12.5", - "phpstan/phpstan-phpunit": "^0.12.11", - "phpunit/phpunit": "^8.5 || ^9", - "psy/psysh": "^0.10.4", - "slevomat/coding-standard": "^6.3", - "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "^4.4" - }, - "time": "2021-10-10T03:01:02+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Ramsey\\Collection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ben Ramsey", - "email": "ben@benramsey.com", - "homepage": "https://benramsey.com" - } - ], - "description": "A PHP library for representing and manipulating collections.", - "keywords": [ - "array", - "collection", - "hash", - "map", - "queue", - "set" - ], - "support": { - "issues": "https://github.com/ramsey/collection/issues", - "source": "https://github.com/ramsey/collection/tree/1.2.2" - }, - "funding": [ - { - "url": "https://github.com/ramsey", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/ramsey/collection", - "type": "tidelift" - } - ], - "install-path": "../ramsey/collection" - }, - { - "name": "ramsey/uuid", - "version": "4.7.0", - "version_normalized": "4.7.0.0", - "source": { - "type": "git", - "url": "https://github.com/ramsey/uuid.git", - "reference": "5ed9ad582647bbc3864ef78db34bdc1afdcf9b49" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/5ed9ad582647bbc3864ef78db34bdc1afdcf9b49", - "reference": "5ed9ad582647bbc3864ef78db34bdc1afdcf9b49", - "shasum": "" - }, - "require": { - "brick/math": "^0.8.8 || ^0.9 || ^0.10", - "ext-json": "*", - "php": "^8.0", - "ramsey/collection": "^1.2" - }, - "replace": { - "rhumsaa/uuid": "self.version" - }, - "require-dev": { - "captainhook/captainhook": "^5.10", - "captainhook/plugin-composer": "^5.3", - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "doctrine/annotations": "^1.8", - "ergebnis/composer-normalize": "^2.15", - "mockery/mockery": "^1.3", - "paragonie/random-lib": "^2", - "php-mock/php-mock": "^2.2", - "php-mock/php-mock-mockery": "^1.3", - "php-parallel-lint/php-parallel-lint": "^1.1", - "phpbench/phpbench": "^1.0", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-mockery": "^1.1", - "phpstan/phpstan-phpunit": "^1.1", - "phpunit/phpunit": "^8.5 || ^9", - "ramsey/composer-repl": "^1.4", - "slevomat/coding-standard": "^8.4", - "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "^4.9" - }, - "suggest": { - "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", - "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", - "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", - "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", - "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." - }, - "time": "2022-12-19T22:30:49+00:00", - "type": "library", - "extra": { - "captainhook": { - "force-install": true - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "src/functions.php" - ], - "psr-4": { - "Ramsey\\Uuid\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "A PHP library for generating and working with universally unique identifiers (UUIDs).", - "keywords": [ - "guid", - "identifier", - "uuid" - ], - "support": { - "issues": "https://github.com/ramsey/uuid/issues", - "source": "https://github.com/ramsey/uuid/tree/4.7.0" - }, - "funding": [ - { - "url": "https://github.com/ramsey", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/ramsey/uuid", - "type": "tidelift" - } - ], - "install-path": "../ramsey/uuid" - }, - { - "name": "sebastian/cli-parser", - "version": "1.0.1", - "version_normalized": "1.0.1.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "time": "2020-09-28T06:08:49+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library for parsing CLI options", - "homepage": "https://github.com/sebastianbergmann/cli-parser", - "support": { - "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../sebastian/cli-parser" - }, - { - "name": "sebastian/code-unit", - "version": "1.0.8", - "version_normalized": "1.0.8.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "time": "2020-10-26T13:08:54+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Collection of value objects that represent the PHP code units", - "homepage": "https://github.com/sebastianbergmann/code-unit", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit/issues", - "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../sebastian/code-unit" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "2.0.3", - "version_normalized": "2.0.3.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "time": "2020-09-28T05:30:19+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../sebastian/code-unit-reverse-lookup" - }, - { - "name": "sebastian/comparator", - "version": "4.0.8", - "version_normalized": "4.0.8.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/diff": "^4.0", - "sebastian/exporter": "^4.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "time": "2022-09-14T12:41:17+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "https://github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../sebastian/comparator" - }, - { - "name": "sebastian/complexity", - "version": "2.0.2", - "version_normalized": "2.0.2.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", - "shasum": "" - }, - "require": { - "nikic/php-parser": "^4.7", - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "time": "2020-10-26T15:52:27+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library for calculating the complexity of PHP code units", - "homepage": "https://github.com/sebastianbergmann/complexity", - "support": { - "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../sebastian/complexity" - }, - { - "name": "sebastian/diff", - "version": "4.0.4", - "version_normalized": "4.0.4.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3", - "symfony/process": "^4.2 || ^5" - }, - "time": "2020-10-26T13:10:38+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../sebastian/diff" - }, - { - "name": "sebastian/environment", - "version": "5.1.4", - "version_normalized": "5.1.4.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/1b5dff7bb151a4db11d49d90e5408e4e938270f7", - "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-posix": "*" - }, - "time": "2022-04-03T09:37:03+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../sebastian/environment" - }, - { - "name": "sebastian/exporter", - "version": "4.0.5", - "version_normalized": "4.0.5.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^9.3" - }, - "time": "2022-09-14T06:03:37+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "https://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../sebastian/exporter" - }, - { - "name": "sebastian/global-state", - "version": "5.0.5", - "version_normalized": "5.0.5.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "ext-dom": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-uopz": "*" - }, - "time": "2022-02-14T08:28:10+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../sebastian/global-state" - }, - { - "name": "sebastian/lines-of-code", - "version": "1.0.3", - "version_normalized": "1.0.3.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", - "shasum": "" - }, - "require": { - "nikic/php-parser": "^4.6", - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "time": "2020-11-28T06:42:11+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library for counting the lines of code in PHP source code", - "homepage": "https://github.com/sebastianbergmann/lines-of-code", - "support": { - "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../sebastian/lines-of-code" - }, - { - "name": "sebastian/object-enumerator", - "version": "4.0.4", - "version_normalized": "4.0.4.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "time": "2020-10-26T13:12:34+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../sebastian/object-enumerator" - }, - { - "name": "sebastian/object-reflector", - "version": "2.0.4", - "version_normalized": "2.0.4.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "time": "2020-10-26T13:14:26+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../sebastian/object-reflector" - }, - { - "name": "sebastian/recursion-context", - "version": "4.0.4", - "version_normalized": "4.0.4.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "time": "2020-10-26T13:17:30+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "support": { - "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../sebastian/recursion-context" - }, - { - "name": "sebastian/resource-operations", - "version": "3.0.3", - "version_normalized": "3.0.3.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.0" - }, - "time": "2020-09-28T06:45:17+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../sebastian/resource-operations" - }, - { - "name": "sebastian/type", - "version": "3.2.0", - "version_normalized": "3.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/type.git", - "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", - "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.5" - }, - "time": "2022-09-12T14:47:03+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Collection of value objects that represent the types of the PHP type system", - "homepage": "https://github.com/sebastianbergmann/type", - "support": { - "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.2.0" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../sebastian/type" - }, - { - "name": "sebastian/version", - "version": "3.0.2", - "version_normalized": "3.0.2.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c6c1022351a901512170118436c764e473f6de8c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", - "reference": "c6c1022351a901512170118436c764e473f6de8c", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "time": "2020-09-28T06:39:44+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "support": { - "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "install-path": "../sebastian/version" - }, - { - "name": "spatie/backtrace", - "version": "1.2.1", - "version_normalized": "1.2.1.0", - "source": { - "type": "git", - "url": "https://github.com/spatie/backtrace.git", - "reference": "4ee7d41aa5268107906ea8a4d9ceccde136dbd5b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/spatie/backtrace/zipball/4ee7d41aa5268107906ea8a4d9ceccde136dbd5b", - "reference": "4ee7d41aa5268107906ea8a4d9ceccde136dbd5b", - "shasum": "" - }, - "require": { - "php": "^7.3|^8.0" - }, - "require-dev": { - "ext-json": "*", - "phpunit/phpunit": "^9.3", - "symfony/var-dumper": "^5.1" - }, - "time": "2021-11-09T10:57:15+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Spatie\\Backtrace\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Freek Van de Herten", - "email": "freek@spatie.be", - "homepage": "https://spatie.be", - "role": "Developer" - } - ], - "description": "A better backtrace", - "homepage": "https://github.com/spatie/backtrace", - "keywords": [ - "Backtrace", - "spatie" - ], - "support": { - "issues": "https://github.com/spatie/backtrace/issues", - "source": "https://github.com/spatie/backtrace/tree/1.2.1" - }, - "funding": [ - { - "url": "https://github.com/sponsors/spatie", - "type": "github" - }, - { - "url": "https://spatie.be/open-source/support-us", - "type": "other" - } - ], - "install-path": "../spatie/backtrace" - }, - { - "name": "spatie/laravel-package-tools", - "version": "1.13.8", - "version_normalized": "1.13.8.0", - "source": { - "type": "git", - "url": "https://github.com/spatie/laravel-package-tools.git", - "reference": "781a2f637237e69c277eb401063acf15e2b4156b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-package-tools/zipball/781a2f637237e69c277eb401063acf15e2b4156b", - "reference": "781a2f637237e69c277eb401063acf15e2b4156b", - "shasum": "" - }, - "require": { - "illuminate/contracts": "^9.28", - "php": "^8.0" - }, - "require-dev": { - "mockery/mockery": "^1.5", - "orchestra/testbench": "^7.7", - "pestphp/pest": "^1.22", - "phpunit/phpunit": "^9.5.24", - "spatie/pest-plugin-test-time": "^1.1" - }, - "time": "2022-12-20T14:09:05+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Spatie\\LaravelPackageTools\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "role": "Developer" - } - ], - "description": "Tools for creating Laravel packages", - "homepage": "https://github.com/spatie/laravel-package-tools", - "keywords": [ - "laravel-package-tools", - "spatie" - ], - "support": { - "issues": "https://github.com/spatie/laravel-package-tools/issues", - "source": "https://github.com/spatie/laravel-package-tools/tree/1.13.8" - }, - "funding": [ - { - "url": "https://github.com/spatie", - "type": "github" - } - ], - "install-path": "../spatie/laravel-package-tools" - }, - { - "name": "spatie/laravel-ray", - "version": "1.31.0", - "version_normalized": "1.31.0.0", - "source": { - "type": "git", - "url": "https://github.com/spatie/laravel-ray.git", - "reference": "7394694afd89d05879e7a69c54abab73c1199acd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-ray/zipball/7394694afd89d05879e7a69c54abab73c1199acd", - "reference": "7394694afd89d05879e7a69c54abab73c1199acd", - "shasum": "" - }, - "require": { - "ext-json": "*", - "illuminate/contracts": "^7.20|^8.19|^9.0", - "illuminate/database": "^7.20|^8.19|^9.0", - "illuminate/queue": "^7.20|^8.19|^9.0", - "illuminate/support": "^7.20|^8.19|^9.0", - "php": "^7.3|^8.0", - "spatie/backtrace": "^1.0", - "spatie/ray": "^1.33", - "symfony/stopwatch": "4.2|^5.1|^6.0", - "zbateson/mail-mime-parser": "^1.3.1|^2.0" - }, - "require-dev": { - "guzzlehttp/guzzle": "^7.3", - "laravel/framework": "^7.20|^8.19|^9.0", - "orchestra/testbench-core": "^5.0|^6.0|^7.0", - "phpstan/phpstan": "^0.12.93", - "phpunit/phpunit": "^9.3", - "spatie/phpunit-snapshot-assertions": "^4.2" - }, - "time": "2022-09-20T13:13:22+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.29.x-dev" - }, - "laravel": { - "providers": [ - "Spatie\\LaravelRay\\RayServiceProvider" - ] - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Spatie\\LaravelRay\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "homepage": "https://spatie.be", - "role": "Developer" - } - ], - "description": "Easily debug Laravel apps", - "homepage": "https://github.com/spatie/laravel-ray", - "keywords": [ - "laravel-ray", - "spatie" - ], - "support": { - "issues": "https://github.com/spatie/laravel-ray/issues", - "source": "https://github.com/spatie/laravel-ray/tree/1.31.0" - }, - "funding": [ - { - "url": "https://github.com/sponsors/spatie", - "type": "github" - }, - { - "url": "https://spatie.be/open-source/support-us", - "type": "other" - } - ], - "install-path": "../spatie/laravel-ray" - }, - { - "name": "spatie/macroable", - "version": "2.0.0", - "version_normalized": "2.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/spatie/macroable.git", - "reference": "ec2c320f932e730607aff8052c44183cf3ecb072" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/spatie/macroable/zipball/ec2c320f932e730607aff8052c44183cf3ecb072", - "reference": "ec2c320f932e730607aff8052c44183cf3ecb072", - "shasum": "" - }, - "require": { - "php": "^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^8.0|^9.3" - }, - "time": "2021-03-26T22:39:02+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Spatie\\Macroable\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "homepage": "https://spatie.be", - "role": "Developer" - } - ], - "description": "A trait to dynamically add methods to a class", - "homepage": "https://github.com/spatie/macroable", - "keywords": [ - "macroable", - "spatie" - ], - "support": { - "issues": "https://github.com/spatie/macroable/issues", - "source": "https://github.com/spatie/macroable/tree/2.0.0" - }, - "install-path": "../spatie/macroable" - }, - { - "name": "spatie/ray", - "version": "1.36.0", - "version_normalized": "1.36.0.0", - "source": { - "type": "git", - "url": "https://github.com/spatie/ray.git", - "reference": "4a4def8cda4806218341b8204c98375aa8c34323" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/spatie/ray/zipball/4a4def8cda4806218341b8204c98375aa8c34323", - "reference": "4a4def8cda4806218341b8204c98375aa8c34323", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "ext-json": "*", - "php": "^7.3|^8.0", - "ramsey/uuid": "^3.0|^4.1", - "spatie/backtrace": "^1.1", - "spatie/macroable": "^1.0|^2.0", - "symfony/stopwatch": "^4.0|^5.1|^6.0", - "symfony/var-dumper": "^4.2|^5.1|^6.0" - }, - "require-dev": { - "illuminate/support": "6.x|^8.18|^9.0", - "nesbot/carbon": "^2.43", - "phpstan/phpstan": "^0.12.92", - "phpunit/phpunit": "^9.5", - "spatie/phpunit-snapshot-assertions": "^4.2", - "spatie/test-time": "^1.2" - }, - "time": "2022-08-11T14:04:18+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "files": [ - "src/helpers.php" - ], - "psr-4": { - "Spatie\\Ray\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "homepage": "https://spatie.be", - "role": "Developer" - } - ], - "description": "Debug with Ray to fix problems faster", - "homepage": "https://github.com/spatie/ray", - "keywords": [ - "ray", - "spatie" - ], - "support": { - "issues": "https://github.com/spatie/ray/issues", - "source": "https://github.com/spatie/ray/tree/1.36.0" - }, - "funding": [ - { - "url": "https://github.com/sponsors/spatie", - "type": "github" - }, - { - "url": "https://spatie.be/open-source/support-us", - "type": "other" - } - ], - "install-path": "../spatie/ray" - }, - { - "name": "symfony/console", - "version": "v6.2.2", - "version_normalized": "6.2.2.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "5a9bd5c543f00157c55face973c149957467db31" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/5a9bd5c543f00157c55face973c149957467db31", - "reference": "5a9bd5c543f00157c55face973c149957467db31", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.4|^6.0" - }, - "conflict": { - "symfony/dependency-injection": "<5.4", - "symfony/dotenv": "<5.4", - "symfony/event-dispatcher": "<5.4", - "symfony/lock": "<5.4", - "symfony/process": "<5.4" - }, - "provide": { - "psr/log-implementation": "1.0|2.0|3.0" - }, - "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/lock": "^5.4|^6.0", - "symfony/process": "^5.4|^6.0", - "symfony/var-dumper": "^5.4|^6.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" - }, - "time": "2022-12-16T15:08:36+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Eases the creation of beautiful and testable command line interfaces", - "homepage": "https://symfony.com", - "keywords": [ - "cli", - "command line", - "console", - "terminal" - ], - "support": { - "source": "https://github.com/symfony/console/tree/v6.2.2" - }, - "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/console" - }, - { - "name": "symfony/css-selector", - "version": "v6.2.0", - "version_normalized": "6.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/css-selector.git", - "reference": "91c342ffc99283c43653ed8eb47bc2a94db7f398" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/91c342ffc99283c43653ed8eb47bc2a94db7f398", - "reference": "91c342ffc99283c43653ed8eb47bc2a94db7f398", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "time": "2022-08-26T05:51:22+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\CssSelector\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Jean-François Simon", - "email": "jeanfrancois.simon@sensiolabs.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Converts CSS selectors to XPath expressions", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/css-selector/tree/v6.2.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/css-selector" - }, - { - "name": "symfony/deprecation-contracts", - "version": "v3.2.0", - "version_normalized": "3.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "1ee04c65529dea5d8744774d474e7cbd2f1206d3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/1ee04c65529dea5d8744774d474e7cbd2f1206d3", - "reference": "1ee04c65529dea5d8744774d474e7cbd2f1206d3", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "time": "2022-11-25T10:21:52+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.3-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "function.php" - ] - }, - "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": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.2.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/deprecation-contracts" - }, - { - "name": "symfony/error-handler", - "version": "v6.2.2", - "version_normalized": "6.2.2.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/error-handler.git", - "reference": "12a25d01cc5273b2445e125d62b61d34db42297e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/12a25d01cc5273b2445e125d62b61d34db42297e", - "reference": "12a25d01cc5273b2445e125d62b61d34db42297e", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "psr/log": "^1|^2|^3", - "symfony/var-dumper": "^5.4|^6.0" - }, - "require-dev": { - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/http-kernel": "^5.4|^6.0", - "symfony/serializer": "^5.4|^6.0" - }, - "time": "2022-12-14T16:11:27+00:00", - "bin": [ - "Resources/bin/patch-type-declarations" - ], - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\ErrorHandler\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides tools to manage errors and ease debugging PHP code", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/error-handler/tree/v6.2.2" - }, - "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/error-handler" - }, - { - "name": "symfony/event-dispatcher", - "version": "v6.2.2", - "version_normalized": "6.2.2.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "3ffeb31139b49bf6ef0bc09d1db95eac053388d1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/3ffeb31139b49bf6ef0bc09d1db95eac053388d1", - "reference": "3ffeb31139b49bf6ef0bc09d1db95eac053388d1", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/event-dispatcher-contracts": "^2|^3" - }, - "conflict": { - "symfony/dependency-injection": "<5.4" - }, - "provide": { - "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "2.0|3.0" - }, - "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/error-handler": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/http-foundation": "^5.4|^6.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/stopwatch": "^5.4|^6.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "time": "2022-12-14T16:11:27+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v6.2.2" - }, - "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/event-dispatcher" - }, - { - "name": "symfony/event-dispatcher-contracts", - "version": "v3.2.0", - "version_normalized": "3.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "0782b0b52a737a05b4383d0df35a474303cabdae" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/0782b0b52a737a05b4383d0df35a474303cabdae", - "reference": "0782b0b52a737a05b4383d0df35a474303cabdae", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "psr/event-dispatcher": "^1" - }, - "suggest": { - "symfony/event-dispatcher-implementation": "" - }, - "time": "2022-11-25T10:21:52+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.3-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Contracts\\EventDispatcher\\": "" - } - }, - "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": "Generic abstractions related to dispatching event", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.2.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/event-dispatcher-contracts" - }, - { - "name": "symfony/finder", - "version": "v6.2.0", - "version_normalized": "6.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "eb2355f69519e4ef33f1835bca4c935f5d42e570" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/eb2355f69519e4ef33f1835bca4c935f5d42e570", - "reference": "eb2355f69519e4ef33f1835bca4c935f5d42e570", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "require-dev": { - "symfony/filesystem": "^6.0" - }, - "time": "2022-10-09T08:55:40+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Finds files and directories via an intuitive fluent interface", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/finder/tree/v6.2.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/finder" - }, - { - "name": "symfony/http-foundation", - "version": "v6.2.2", - "version_normalized": "6.2.2.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/http-foundation.git", - "reference": "ddf4dd35de1623e7c02013523e6c2137b67b636f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/ddf4dd35de1623e7c02013523e6c2137b67b636f", - "reference": "ddf4dd35de1623e7c02013523e6c2137b67b636f", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-mbstring": "~1.1" - }, - "conflict": { - "symfony/cache": "<6.2" - }, - "require-dev": { - "predis/predis": "~1.0", - "symfony/cache": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/http-kernel": "^5.4.12|^6.0.12|^6.1.4", - "symfony/mime": "^5.4|^6.0", - "symfony/rate-limiter": "^5.2|^6.0" - }, - "suggest": { - "symfony/mime": "To use the file extension guesser" - }, - "time": "2022-12-14T16:11:27+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\HttpFoundation\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Defines an object-oriented layer for the HTTP specification", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/http-foundation/tree/v6.2.2" - }, - "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/http-foundation" - }, - { - "name": "symfony/http-kernel", - "version": "v6.2.2", - "version_normalized": "6.2.2.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/http-kernel.git", - "reference": "860a0189969b755cd571709bd32313aa8599867a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/860a0189969b755cd571709bd32313aa8599867a", - "reference": "860a0189969b755cd571709bd32313aa8599867a", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "psr/log": "^1|^2|^3", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/error-handler": "^6.1", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/http-foundation": "^5.4|^6.0", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "symfony/browser-kit": "<5.4", - "symfony/cache": "<5.4", - "symfony/config": "<6.1", - "symfony/console": "<5.4", - "symfony/dependency-injection": "<6.2", - "symfony/doctrine-bridge": "<5.4", - "symfony/form": "<5.4", - "symfony/http-client": "<5.4", - "symfony/mailer": "<5.4", - "symfony/messenger": "<5.4", - "symfony/translation": "<5.4", - "symfony/twig-bridge": "<5.4", - "symfony/validator": "<5.4", - "twig/twig": "<2.13" - }, - "provide": { - "psr/log-implementation": "1.0|2.0|3.0" - }, - "require-dev": { - "psr/cache": "^1.0|^2.0|^3.0", - "symfony/browser-kit": "^5.4|^6.0", - "symfony/config": "^6.1", - "symfony/console": "^5.4|^6.0", - "symfony/css-selector": "^5.4|^6.0", - "symfony/dependency-injection": "^6.2", - "symfony/dom-crawler": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/finder": "^5.4|^6.0", - "symfony/http-client-contracts": "^1.1|^2|^3", - "symfony/process": "^5.4|^6.0", - "symfony/routing": "^5.4|^6.0", - "symfony/stopwatch": "^5.4|^6.0", - "symfony/translation": "^5.4|^6.0", - "symfony/translation-contracts": "^1.1|^2|^3", - "symfony/uid": "^5.4|^6.0", - "twig/twig": "^2.13|^3.0.4" - }, - "suggest": { - "symfony/browser-kit": "", - "symfony/config": "", - "symfony/console": "", - "symfony/dependency-injection": "" - }, - "time": "2022-12-16T19:38:34+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\HttpKernel\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides a structured process for converting a Request into a Response", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/http-kernel/tree/v6.2.2" - }, - "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/http-kernel" - }, - { - "name": "symfony/mailer", - "version": "v6.2.2", - "version_normalized": "6.2.2.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/mailer.git", - "reference": "b355ad81f1d2987c47dcd3b04d5dce669e1e62e6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/mailer/zipball/b355ad81f1d2987c47dcd3b04d5dce669e1e62e6", - "reference": "b355ad81f1d2987c47dcd3b04d5dce669e1e62e6", - "shasum": "" - }, - "require": { - "egulias/email-validator": "^2.1.10|^3", - "php": ">=8.1", - "psr/event-dispatcher": "^1", - "psr/log": "^1|^2|^3", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/mime": "^6.2", - "symfony/service-contracts": "^1.1|^2|^3" - }, - "conflict": { - "symfony/http-kernel": "<5.4", - "symfony/messenger": "<6.2", - "symfony/mime": "<6.2", - "symfony/twig-bridge": "<6.2.1" - }, - "require-dev": { - "symfony/console": "^5.4|^6.0", - "symfony/http-client-contracts": "^1.1|^2|^3", - "symfony/messenger": "^6.2", - "symfony/twig-bridge": "^6.2" - }, - "time": "2022-12-14T16:11:27+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Mailer\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Helps sending emails", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/mailer/tree/v6.2.2" - }, - "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/mailer" - }, - { - "name": "symfony/mime", - "version": "v6.2.2", - "version_normalized": "6.2.2.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/mime.git", - "reference": "8c98bf40406e791043890a163f6f6599b9cfa1ed" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/8c98bf40406e791043890a163f6f6599b9cfa1ed", - "reference": "8c98bf40406e791043890a163f6f6599b9cfa1ed", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/polyfill-intl-idn": "^1.10", - "symfony/polyfill-mbstring": "^1.0" - }, - "conflict": { - "egulias/email-validator": "~3.0.0", - "phpdocumentor/reflection-docblock": "<3.2.2", - "phpdocumentor/type-resolver": "<1.4.0", - "symfony/mailer": "<5.4", - "symfony/serializer": "<6.2" - }, - "require-dev": { - "egulias/email-validator": "^2.1.10|^3.1", - "league/html-to-markdown": "^5.0", - "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/property-access": "^5.4|^6.0", - "symfony/property-info": "^5.4|^6.0", - "symfony/serializer": "^6.2" - }, - "time": "2022-12-14T16:38:10+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Mime\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Allows manipulating MIME messages", - "homepage": "https://symfony.com", - "keywords": [ - "mime", - "mime-type" - ], - "support": { - "source": "https://github.com/symfony/mime/tree/v6.2.2" - }, - "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/mime" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-ctype": "*" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "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\\Ctype\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "support": { - "source": "https://github.com/symfony/polyfill-ctype/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-ctype" - }, - { - "name": "symfony/polyfill-iconv", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-iconv.git", - "reference": "927013f3aac555983a5059aada98e1907d842695" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/927013f3aac555983a5059aada98e1907d842695", - "reference": "927013f3aac555983a5059aada98e1907d842695", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-iconv": "*" - }, - "suggest": { - "ext-iconv": "For best performance" - }, - "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\\Iconv\\": "" - } - }, - "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 Iconv extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "iconv", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-iconv/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-iconv" - }, - { - "name": "symfony/polyfill-intl-grapheme", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "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\\Intl\\Grapheme\\": "" - } - }, - "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 intl's grapheme_* functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "grapheme", - "intl", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/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-intl-grapheme" - }, - { - "name": "symfony/polyfill-intl-idn", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "639084e360537a19f9ee352433b84ce831f3d2da" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/639084e360537a19f9ee352433b84ce831f3d2da", - "reference": "639084e360537a19f9ee352433b84ce831f3d2da", - "shasum": "" - }, - "require": { - "php": ">=7.1", - "symfony/polyfill-intl-normalizer": "^1.10", - "symfony/polyfill-php72": "^1.10" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "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\\Intl\\Idn\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Laurent Bassin", - "email": "laurent@bassin.info" - }, - { - "name": "Trevor Rowbotham", - "email": "trevor.rowbotham@pm.me" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "idn", - "intl", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/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-intl-idn" - }, - { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "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\\Intl\\Normalizer\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "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 intl's Normalizer class and related functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "intl", - "normalizer", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/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-intl-normalizer" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-mbstring": "*" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "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\\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": "" - }, - "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": "" - }, - "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/polyfill-php81", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/707403074c8ea6e2edaf8794b0157a0bfa52157a", - "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a", - "shasum": "" - }, - "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\\Php81\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "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 8.1+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php81/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-php81" - }, - { - "name": "symfony/polyfill-uuid", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-uuid.git", - "reference": "f3cf1a645c2734236ed1e2e671e273eeb3586166" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/f3cf1a645c2734236ed1e2e671e273eeb3586166", - "reference": "f3cf1a645c2734236ed1e2e671e273eeb3586166", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-uuid": "*" - }, - "suggest": { - "ext-uuid": "For best performance" - }, - "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\\Uuid\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Grégoire Pineau", - "email": "lyrixx@lyrixx.info" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for uuid functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "uuid" - ], - "support": { - "source": "https://github.com/symfony/polyfill-uuid/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-uuid" - }, - { - "name": "symfony/process", - "version": "v6.2.0", - "version_normalized": "6.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "ba6e55359f8f755fe996c58a81e00eaa67a35877" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/ba6e55359f8f755fe996c58a81e00eaa67a35877", - "reference": "ba6e55359f8f755fe996c58a81e00eaa67a35877", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "time": "2022-11-02T09:08:04+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Executes commands in sub-processes", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/process/tree/v6.2.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/process" - }, - { - "name": "symfony/routing", - "version": "v6.2.0", - "version_normalized": "6.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/routing.git", - "reference": "857ac6f4df371470fbdefa2f5967a2618dbf1852" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/857ac6f4df371470fbdefa2f5967a2618dbf1852", - "reference": "857ac6f4df371470fbdefa2f5967a2618dbf1852", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "conflict": { - "doctrine/annotations": "<1.12", - "symfony/config": "<6.2", - "symfony/dependency-injection": "<5.4", - "symfony/yaml": "<5.4" - }, - "require-dev": { - "doctrine/annotations": "^1.12", - "psr/log": "^1|^2|^3", - "symfony/config": "^6.2", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/http-foundation": "^5.4|^6.0", - "symfony/yaml": "^5.4|^6.0" - }, - "suggest": { - "symfony/config": "For using the all-in-one router or any loader", - "symfony/expression-language": "For using expression matching", - "symfony/http-foundation": "For using a Symfony Request object", - "symfony/yaml": "For using the YAML loader" - }, - "time": "2022-11-09T13:28:29+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Routing\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Maps an HTTP request to a set of configuration variables", - "homepage": "https://symfony.com", - "keywords": [ - "router", - "routing", - "uri", - "url" - ], - "support": { - "source": "https://github.com/symfony/routing/tree/v6.2.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/routing" - }, - { - "name": "symfony/service-contracts", - "version": "v3.2.0", - "version_normalized": "3.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "aac98028c69df04ee77eb69b96b86ee51fbf4b75" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/aac98028c69df04ee77eb69b96b86ee51fbf4b75", - "reference": "aac98028c69df04ee77eb69b96b86ee51fbf4b75", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "psr/container": "^2.0" - }, - "conflict": { - "ext-psr": "<1.1|>=2" - }, - "suggest": { - "symfony/service-implementation": "" - }, - "time": "2022-11-25T10:21:52+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.3-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Service\\": "" - }, - "exclude-from-classmap": [ - "/Test/" - ] - }, - "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": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.2.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/service-contracts" - }, - { - "name": "symfony/stopwatch", - "version": "v6.2.0", - "version_normalized": "6.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/stopwatch.git", - "reference": "266636bb8f3fbdccc302491df7b3a1b9a8c238a7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/266636bb8f3fbdccc302491df7b3a1b9a8c238a7", - "reference": "266636bb8f3fbdccc302491df7b3a1b9a8c238a7", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/service-contracts": "^1|^2|^3" - }, - "time": "2022-09-28T16:00:52+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Stopwatch\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides a way to profile code", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/stopwatch/tree/v6.2.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/stopwatch" - }, - { - "name": "symfony/string", - "version": "v6.2.2", - "version_normalized": "6.2.2.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/string.git", - "reference": "863219fd713fa41cbcd285a79723f94672faff4d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/863219fd713fa41cbcd285a79723f94672faff4d", - "reference": "863219fd713fa41cbcd285a79723f94672faff4d", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.0", - "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/translation-contracts": "<2.0" - }, - "require-dev": { - "symfony/error-handler": "^5.4|^6.0", - "symfony/http-client": "^5.4|^6.0", - "symfony/intl": "^6.2", - "symfony/translation-contracts": "^2.0|^3.0", - "symfony/var-exporter": "^5.4|^6.0" - }, - "time": "2022-12-14T16:11:27+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "files": [ - "Resources/functions.php" - ], - "psr-4": { - "Symfony\\Component\\String\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "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": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", - "homepage": "https://symfony.com", - "keywords": [ - "grapheme", - "i18n", - "string", - "unicode", - "utf-8", - "utf8" - ], - "support": { - "source": "https://github.com/symfony/string/tree/v6.2.2" - }, - "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/string" - }, - { - "name": "symfony/translation", - "version": "v6.2.2", - "version_normalized": "6.2.2.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/translation.git", - "reference": "3294288c335b6267eab14964bf2c46015663d93f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/3294288c335b6267eab14964bf2c46015663d93f", - "reference": "3294288c335b6267eab14964bf2c46015663d93f", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/polyfill-mbstring": "~1.0", - "symfony/translation-contracts": "^2.3|^3.0" - }, - "conflict": { - "symfony/config": "<5.4", - "symfony/console": "<5.4", - "symfony/dependency-injection": "<5.4", - "symfony/http-kernel": "<5.4", - "symfony/twig-bundle": "<5.4", - "symfony/yaml": "<5.4" - }, - "provide": { - "symfony/translation-implementation": "2.3|3.0" - }, - "require-dev": { - "nikic/php-parser": "^4.13", - "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/console": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/finder": "^5.4|^6.0", - "symfony/http-client-contracts": "^1.1|^2.0|^3.0", - "symfony/http-kernel": "^5.4|^6.0", - "symfony/intl": "^5.4|^6.0", - "symfony/polyfill-intl-icu": "^1.21", - "symfony/routing": "^5.4|^6.0", - "symfony/service-contracts": "^1.1.2|^2|^3", - "symfony/yaml": "^5.4|^6.0" - }, - "suggest": { - "nikic/php-parser": "To use PhpAstExtractor", - "psr/log-implementation": "To use logging capability in translator", - "symfony/config": "", - "symfony/yaml": "" - }, - "time": "2022-12-13T18:04:17+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "files": [ - "Resources/functions.php" - ], - "psr-4": { - "Symfony\\Component\\Translation\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides tools to internationalize your application", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/translation/tree/v6.2.2" - }, - "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/translation" - }, - { - "name": "symfony/translation-contracts", - "version": "v3.2.0", - "version_normalized": "3.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/translation-contracts.git", - "reference": "68cce71402305a015f8c1589bfada1280dc64fe7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/68cce71402305a015f8c1589bfada1280dc64fe7", - "reference": "68cce71402305a015f8c1589bfada1280dc64fe7", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "suggest": { - "symfony/translation-implementation": "" - }, - "time": "2022-11-25T10:21:52+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.3-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Translation\\": "" - }, - "exclude-from-classmap": [ - "/Test/" - ] - }, - "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": "Generic abstractions related to translation", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v3.2.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/translation-contracts" - }, - { - "name": "symfony/uid", - "version": "v6.2.0", - "version_normalized": "6.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/uid.git", - "reference": "4f9f537e57261519808a7ce1d941490736522bbc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/uid/zipball/4f9f537e57261519808a7ce1d941490736522bbc", - "reference": "4f9f537e57261519808a7ce1d941490736522bbc", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/polyfill-uuid": "^1.15" - }, - "require-dev": { - "symfony/console": "^5.4|^6.0" - }, - "time": "2022-10-09T08:55:40+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Uid\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Grégoire Pineau", - "email": "lyrixx@lyrixx.info" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides an object-oriented API to generate and represent UIDs", - "homepage": "https://symfony.com", - "keywords": [ - "UID", - "ulid", - "uuid" - ], - "support": { - "source": "https://github.com/symfony/uid/tree/v6.2.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/uid" - }, - { - "name": "symfony/var-dumper", - "version": "v6.2.2", - "version_normalized": "6.2.2.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/var-dumper.git", - "reference": "6168f544827e897f708a684f75072a8c33a5e309" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/6168f544827e897f708a684f75072a8c33a5e309", - "reference": "6168f544827e897f708a684f75072a8c33a5e309", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "phpunit/phpunit": "<5.4.3", - "symfony/console": "<5.4" - }, - "require-dev": { - "ext-iconv": "*", - "symfony/console": "^5.4|^6.0", - "symfony/process": "^5.4|^6.0", - "symfony/uid": "^5.4|^6.0", - "twig/twig": "^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-12-14T16:11:27+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/" - ] - }, - "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": "Provides mechanisms for walking through any arbitrary PHP variable", - "homepage": "https://symfony.com", - "keywords": [ - "debug", - "dump" - ], - "support": { - "source": "https://github.com/symfony/var-dumper/tree/v6.2.2" - }, - "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/var-dumper" - }, - { - "name": "symfony/yaml", - "version": "v6.2.2", - "version_normalized": "6.2.2.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "6ed8243aa5f2cb5a57009f826b5e7fb3c4200cf3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/6ed8243aa5f2cb5a57009f826b5e7fb3c4200cf3", - "reference": "6ed8243aa5f2cb5a57009f826b5e7fb3c4200cf3", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "symfony/console": "<5.4" - }, - "require-dev": { - "symfony/console": "^5.4|^6.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, - "time": "2022-12-14T16:11:27+00:00", - "bin": [ - "Resources/bin/yaml-lint" - ], - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Loads and dumps YAML files", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/yaml/tree/v6.2.2" - }, - "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/yaml" - }, - { - "name": "theseer/tokenizer", - "version": "1.2.1", - "version_normalized": "1.2.1.0", - "source": { - "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.2 || ^8.0" - }, - "time": "2021-07-28T10:34:58+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - } - ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "support": { - "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.1" - }, - "funding": [ - { - "url": "https://github.com/theseer", - "type": "github" - } - ], - "install-path": "../theseer/tokenizer" - }, - { - "name": "tijsverkoyen/css-to-inline-styles", - "version": "2.2.5", - "version_normalized": "2.2.5.0", - "source": { - "type": "git", - "url": "https://github.com/tijsverkoyen/CssToInlineStyles.git", - "reference": "4348a3a06651827a27d989ad1d13efec6bb49b19" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/4348a3a06651827a27d989ad1d13efec6bb49b19", - "reference": "4348a3a06651827a27d989ad1d13efec6bb49b19", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-libxml": "*", - "php": "^5.5 || ^7.0 || ^8.0", - "symfony/css-selector": "^2.7 || ^3.0 || ^4.0 || ^5.0 || ^6.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0 || ^7.5 || ^8.5.21 || ^9.5.10" - }, - "time": "2022-09-12T13:28:28+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "TijsVerkoyen\\CssToInlineStyles\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Tijs Verkoyen", - "email": "css_to_inline_styles@verkoyen.eu", - "role": "Developer" - } - ], - "description": "CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.", - "homepage": "https://github.com/tijsverkoyen/CssToInlineStyles", - "support": { - "issues": "https://github.com/tijsverkoyen/CssToInlineStyles/issues", - "source": "https://github.com/tijsverkoyen/CssToInlineStyles/tree/2.2.5" - }, - "install-path": "../tijsverkoyen/css-to-inline-styles" - }, - { - "name": "vlucas/phpdotenv", - "version": "v5.5.0", - "version_normalized": "5.5.0.0", - "source": { - "type": "git", - "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7", - "reference": "1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7", - "shasum": "" - }, - "require": { - "ext-pcre": "*", - "graham-campbell/result-type": "^1.0.2", - "php": "^7.1.3 || ^8.0", - "phpoption/phpoption": "^1.8", - "symfony/polyfill-ctype": "^1.23", - "symfony/polyfill-mbstring": "^1.23.1", - "symfony/polyfill-php80": "^1.23.1" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", - "ext-filter": "*", - "phpunit/phpunit": "^7.5.20 || ^8.5.30 || ^9.5.25" - }, - "suggest": { - "ext-filter": "Required to use the boolean validator." - }, - "time": "2022-10-16T01:01:54+00:00", - "type": "library", - "extra": { - "bamarni-bin": { - "bin-links": true, - "forward-command": true - }, - "branch-alias": { - "dev-master": "5.5-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Dotenv\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, - { - "name": "Vance Lucas", - "email": "vance@vancelucas.com", - "homepage": "https://github.com/vlucas" - } - ], - "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", - "keywords": [ - "dotenv", - "env", - "environment" - ], - "support": { - "issues": "https://github.com/vlucas/phpdotenv/issues", - "source": "https://github.com/vlucas/phpdotenv/tree/v5.5.0" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv", - "type": "tidelift" - } - ], - "install-path": "../vlucas/phpdotenv" - }, - { - "name": "voku/portable-ascii", - "version": "2.0.1", - "version_normalized": "2.0.1.0", - "source": { - "type": "git", - "url": "https://github.com/voku/portable-ascii.git", - "reference": "b56450eed252f6801410d810c8e1727224ae0743" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/voku/portable-ascii/zipball/b56450eed252f6801410d810c8e1727224ae0743", - "reference": "b56450eed252f6801410d810c8e1727224ae0743", - "shasum": "" - }, - "require": { - "php": ">=7.0.0" - }, - "require-dev": { - "phpunit/phpunit": "~6.0 || ~7.0 || ~9.0" - }, - "suggest": { - "ext-intl": "Use Intl for transliterator_transliterate() support" - }, - "time": "2022-03-08T17:03:00+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "voku\\": "src/voku/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Lars Moelleken", - "homepage": "http://www.moelleken.org/" - } - ], - "description": "Portable ASCII library - performance optimized (ascii) string functions for php.", - "homepage": "https://github.com/voku/portable-ascii", - "keywords": [ - "ascii", - "clean", - "php" - ], - "support": { - "issues": "https://github.com/voku/portable-ascii/issues", - "source": "https://github.com/voku/portable-ascii/tree/2.0.1" - }, - "funding": [ - { - "url": "https://www.paypal.me/moelleken", - "type": "custom" - }, - { - "url": "https://github.com/voku", - "type": "github" - }, - { - "url": "https://opencollective.com/portable-ascii", - "type": "open_collective" - }, - { - "url": "https://www.patreon.com/voku", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/voku/portable-ascii", - "type": "tidelift" - } - ], - "install-path": "../voku/portable-ascii" - }, - { - "name": "webmozart/assert", - "version": "1.11.0", - "version_normalized": "1.11.0.0", - "source": { - "type": "git", - "url": "https://github.com/webmozarts/assert.git", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", - "shasum": "" - }, - "require": { - "ext-ctype": "*", - "php": "^7.2 || ^8.0" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.13" - }, - "time": "2022-06-03T18:03:27+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "support": { - "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.11.0" - }, - "install-path": "../webmozart/assert" - }, - { - "name": "zbateson/mail-mime-parser", - "version": "2.2.3", - "version_normalized": "2.2.3.0", - "source": { - "type": "git", - "url": "https://github.com/zbateson/mail-mime-parser.git", - "reference": "295c7f82a8c44af685680d9df6714beb812e90ff" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zbateson/mail-mime-parser/zipball/295c7f82a8c44af685680d9df6714beb812e90ff", - "reference": "295c7f82a8c44af685680d9df6714beb812e90ff", - "shasum": "" - }, - "require": { - "guzzlehttp/psr7": "^1.7.0|^2.0", - "php": ">=5.4", - "pimple/pimple": "^3.0", - "zbateson/mb-wrapper": "^1.0.1", - "zbateson/stream-decorators": "^1.0.6" - }, - "require-dev": { - "mikey179/vfsstream": "^1.6.0", - "sanmai/phpunit-legacy-adapter": "^6.3 || ^8.2" - }, - "suggest": { - "ext-iconv": "For best support/performance", - "ext-mbstring": "For best support/performance" - }, - "time": "2022-09-28T16:31:49+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "ZBateson\\MailMimeParser\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-2-Clause" - ], - "authors": [ - { - "name": "Zaahid Bateson" - }, - { - "name": "Contributors", - "homepage": "https://github.com/zbateson/mail-mime-parser/graphs/contributors" - } - ], - "description": "MIME email message parser", - "homepage": "https://mail-mime-parser.org", - "keywords": [ - "MimeMailParser", - "email", - "mail", - "mailparse", - "mime", - "mimeparse", - "parser", - "php-imap" - ], - "support": { - "docs": "https://mail-mime-parser.org/#usage-guide", - "issues": "https://github.com/zbateson/mail-mime-parser/issues", - "source": "https://github.com/zbateson/mail-mime-parser" - }, - "funding": [ - { - "url": "https://github.com/zbateson", - "type": "github" - } - ], - "install-path": "../zbateson/mail-mime-parser" - }, - { - "name": "zbateson/mb-wrapper", - "version": "1.1.2", - "version_normalized": "1.1.2.0", - "source": { - "type": "git", - "url": "https://github.com/zbateson/mb-wrapper.git", - "reference": "5d9d190ef18ce6d424e3ac6f5ebe13901f92b74a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zbateson/mb-wrapper/zipball/5d9d190ef18ce6d424e3ac6f5ebe13901f92b74a", - "reference": "5d9d190ef18ce6d424e3ac6f5ebe13901f92b74a", - "shasum": "" - }, - "require": { - "php": ">=5.4", - "symfony/polyfill-iconv": "^1.9", - "symfony/polyfill-mbstring": "^1.9" - }, - "require-dev": { - "sanmai/phpunit-legacy-adapter": "^6.3 || ^8" - }, - "suggest": { - "ext-iconv": "For best support/performance", - "ext-mbstring": "For best support/performance" - }, - "time": "2022-05-26T15:55:05+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "ZBateson\\MbWrapper\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-2-Clause" - ], - "authors": [ - { - "name": "Zaahid Bateson" - } - ], - "description": "Wrapper for mbstring with fallback to iconv for encoding conversion and string manipulation", - "keywords": [ - "charset", - "encoding", - "http", - "iconv", - "mail", - "mb", - "mb_convert_encoding", - "mbstring", - "mime", - "multibyte", - "string" - ], - "support": { - "issues": "https://github.com/zbateson/mb-wrapper/issues", - "source": "https://github.com/zbateson/mb-wrapper/tree/1.1.2" - }, - "funding": [ - { - "url": "https://github.com/zbateson", - "type": "github" - } - ], - "install-path": "../zbateson/mb-wrapper" - }, - { - "name": "zbateson/stream-decorators", - "version": "1.0.7", - "version_normalized": "1.0.7.0", - "source": { - "type": "git", - "url": "https://github.com/zbateson/stream-decorators.git", - "reference": "8f8ca208572963258b7e6d91106181706deacd10" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zbateson/stream-decorators/zipball/8f8ca208572963258b7e6d91106181706deacd10", - "reference": "8f8ca208572963258b7e6d91106181706deacd10", - "shasum": "" - }, - "require": { - "guzzlehttp/psr7": "^1.7.0|^2.0", - "php": ">=5.4", - "zbateson/mb-wrapper": "^1.0.0" - }, - "require-dev": { - "sanmai/phpunit-legacy-adapter": "^6.3 || ^8" - }, - "time": "2022-09-08T15:44:55+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "ZBateson\\StreamDecorators\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-2-Clause" - ], - "authors": [ - { - "name": "Zaahid Bateson" - } - ], - "description": "PHP psr7 stream decorators for mime message part streams", - "keywords": [ - "base64", - "charset", - "decorators", - "mail", - "mime", - "psr7", - "quoted-printable", - "stream", - "uuencode" - ], - "support": { - "issues": "https://github.com/zbateson/stream-decorators/issues", - "source": "https://github.com/zbateson/stream-decorators/tree/1.0.7" - }, - "funding": [ - { - "url": "https://github.com/zbateson", - "type": "github" - } - ], - "install-path": "../zbateson/stream-decorators" - } - ], - "dev": true, - "dev-package-names": [ - "doctrine/instantiator", - "fakerphp/faker", - "guzzlehttp/psr7", - "hamcrest/hamcrest-php", - "laravel/pint", - "mockery/mockery", - "myclabs/deep-copy", - "nikic/php-parser", - "orchestra/testbench", - "orchestra/testbench-core", - "phar-io/manifest", - "phar-io/version", - "phpunit/php-code-coverage", - "phpunit/php-file-iterator", - "phpunit/php-invoker", - "phpunit/php-text-template", - "phpunit/php-timer", - "phpunit/phpunit", - "pimple/pimple", - "psr/http-factory", - "psr/http-message", - "ralouphie/getallheaders", - "sebastian/cli-parser", - "sebastian/code-unit", - "sebastian/code-unit-reverse-lookup", - "sebastian/comparator", - "sebastian/complexity", - "sebastian/diff", - "sebastian/environment", - "sebastian/exporter", - "sebastian/global-state", - "sebastian/lines-of-code", - "sebastian/object-enumerator", - "sebastian/object-reflector", - "sebastian/recursion-context", - "sebastian/resource-operations", - "sebastian/type", - "sebastian/version", - "spatie/backtrace", - "spatie/laravel-ray", - "spatie/macroable", - "spatie/ray", - "symfony/polyfill-iconv", - "symfony/stopwatch", - "symfony/yaml", - "theseer/tokenizer", - "zbateson/mail-mime-parser", - "zbateson/mb-wrapper", - "zbateson/stream-decorators" - ] -} diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php deleted file mode 100644 index 0fa0e5a1..00000000 --- a/vendor/composer/installed.php +++ /dev/null @@ -1,1266 +0,0 @@ - array( - 'name' => 'leeovery/laravel-playwright', - 'pretty_version' => '1.0.0+no-version-set', - 'version' => '1.0.0.0', - 'reference' => NULL, - 'type' => 'library', - 'install_path' => __DIR__ . '/../../', - 'aliases' => array(), - 'dev' => true, - ), - 'versions' => array( - 'brick/math' => array( - 'pretty_version' => '0.10.2', - 'version' => '0.10.2.0', - 'reference' => '459f2781e1a08d52ee56b0b1444086e038561e3f', - 'type' => 'library', - 'install_path' => __DIR__ . '/../brick/math', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'cordoval/hamcrest-php' => array( - 'dev_requirement' => true, - 'replaced' => array( - 0 => '*', - ), - ), - 'davedevelopment/hamcrest-php' => array( - 'dev_requirement' => true, - 'replaced' => array( - 0 => '*', - ), - ), - 'dflydev/dot-access-data' => array( - 'pretty_version' => 'v3.0.2', - 'version' => '3.0.2.0', - 'reference' => 'f41715465d65213d644d3141a6a93081be5d3549', - 'type' => 'library', - 'install_path' => __DIR__ . '/../dflydev/dot-access-data', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'doctrine/inflector' => array( - 'pretty_version' => '2.0.6', - 'version' => '2.0.6.0', - 'reference' => 'd9d313a36c872fd6ee06d9a6cbcf713eaa40f024', - 'type' => 'library', - 'install_path' => __DIR__ . '/../doctrine/inflector', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'doctrine/instantiator' => array( - 'pretty_version' => '1.4.1', - 'version' => '1.4.1.0', - 'reference' => '10dcfce151b967d20fde1b34ae6640712c3891bc', - 'type' => 'library', - 'install_path' => __DIR__ . '/../doctrine/instantiator', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'doctrine/lexer' => array( - 'pretty_version' => '1.2.3', - 'version' => '1.2.3.0', - 'reference' => 'c268e882d4dbdd85e36e4ad69e02dc284f89d229', - 'type' => 'library', - 'install_path' => __DIR__ . '/../doctrine/lexer', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'dragonmantank/cron-expression' => array( - 'pretty_version' => 'v3.3.2', - 'version' => '3.3.2.0', - 'reference' => '782ca5968ab8b954773518e9e49a6f892a34b2a8', - 'type' => 'library', - 'install_path' => __DIR__ . '/../dragonmantank/cron-expression', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'egulias/email-validator' => array( - 'pretty_version' => '3.2.1', - 'version' => '3.2.1.0', - 'reference' => 'f88dcf4b14af14a98ad96b14b2b317969eab6715', - 'type' => 'library', - 'install_path' => __DIR__ . '/../egulias/email-validator', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'fakerphp/faker' => array( - 'pretty_version' => 'v1.21.0', - 'version' => '1.21.0.0', - 'reference' => '92efad6a967f0b79c499705c69b662f738cc9e4d', - 'type' => 'library', - 'install_path' => __DIR__ . '/../fakerphp/faker', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'fruitcake/php-cors' => array( - 'pretty_version' => 'v1.2.0', - 'version' => '1.2.0.0', - 'reference' => '58571acbaa5f9f462c9c77e911700ac66f446d4e', - 'type' => 'library', - 'install_path' => __DIR__ . '/../fruitcake/php-cors', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'graham-campbell/result-type' => array( - 'pretty_version' => 'v1.1.0', - 'version' => '1.1.0.0', - 'reference' => 'a878d45c1914464426dc94da61c9e1d36ae262a8', - 'type' => 'library', - 'install_path' => __DIR__ . '/../graham-campbell/result-type', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'guzzlehttp/psr7' => array( - 'pretty_version' => '2.4.3', - 'version' => '2.4.3.0', - 'reference' => '67c26b443f348a51926030c83481b85718457d3d', - 'type' => 'library', - 'install_path' => __DIR__ . '/../guzzlehttp/psr7', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'hamcrest/hamcrest-php' => array( - 'pretty_version' => 'v2.0.1', - 'version' => '2.0.1.0', - 'reference' => '8c3d0a3f6af734494ad8f6fbbee0ba92422859f3', - 'type' => 'library', - 'install_path' => __DIR__ . '/../hamcrest/hamcrest-php', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'illuminate/auth' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => 'v9.45.1', - ), - ), - 'illuminate/broadcasting' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => 'v9.45.1', - ), - ), - 'illuminate/bus' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => 'v9.45.1', - ), - ), - 'illuminate/cache' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => 'v9.45.1', - ), - ), - 'illuminate/collections' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => 'v9.45.1', - ), - ), - 'illuminate/conditionable' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => 'v9.45.1', - ), - ), - 'illuminate/config' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => 'v9.45.1', - ), - ), - 'illuminate/console' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => 'v9.45.1', - ), - ), - 'illuminate/container' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => 'v9.45.1', - ), - ), - 'illuminate/contracts' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => 'v9.45.1', - ), - ), - 'illuminate/cookie' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => 'v9.45.1', - ), - ), - 'illuminate/database' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => 'v9.45.1', - ), - ), - 'illuminate/encryption' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => 'v9.45.1', - ), - ), - 'illuminate/events' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => 'v9.45.1', - ), - ), - 'illuminate/filesystem' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => 'v9.45.1', - ), - ), - 'illuminate/hashing' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => 'v9.45.1', - ), - ), - 'illuminate/http' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => 'v9.45.1', - ), - ), - 'illuminate/log' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => 'v9.45.1', - ), - ), - 'illuminate/macroable' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => 'v9.45.1', - ), - ), - 'illuminate/mail' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => 'v9.45.1', - ), - ), - 'illuminate/notifications' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => 'v9.45.1', - ), - ), - 'illuminate/pagination' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => 'v9.45.1', - ), - ), - 'illuminate/pipeline' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => 'v9.45.1', - ), - ), - 'illuminate/queue' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => 'v9.45.1', - ), - ), - 'illuminate/redis' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => 'v9.45.1', - ), - ), - 'illuminate/routing' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => 'v9.45.1', - ), - ), - 'illuminate/session' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => 'v9.45.1', - ), - ), - 'illuminate/support' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => 'v9.45.1', - ), - ), - 'illuminate/testing' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => 'v9.45.1', - ), - ), - 'illuminate/translation' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => 'v9.45.1', - ), - ), - 'illuminate/validation' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => 'v9.45.1', - ), - ), - 'illuminate/view' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => 'v9.45.1', - ), - ), - 'kodova/hamcrest-php' => array( - 'dev_requirement' => true, - 'replaced' => array( - 0 => '*', - ), - ), - 'laravel/framework' => array( - 'pretty_version' => 'v9.45.1', - 'version' => '9.45.1.0', - 'reference' => 'faeb20d3fc61b69790068161ab42bcf2d5faccbc', - 'type' => 'library', - 'install_path' => __DIR__ . '/../laravel/framework', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'laravel/pint' => array( - 'pretty_version' => 'v1.3.0', - 'version' => '1.3.0.0', - 'reference' => '6a2c0927b4f6ad4eadb5a67fe3835fdad108949d', - 'type' => 'project', - 'install_path' => __DIR__ . '/../laravel/pint', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'laravel/serializable-closure' => array( - 'pretty_version' => 'v1.2.2', - 'version' => '1.2.2.0', - 'reference' => '47afb7fae28ed29057fdca37e16a84f90cc62fae', - 'type' => 'library', - 'install_path' => __DIR__ . '/../laravel/serializable-closure', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'league/commonmark' => array( - 'pretty_version' => '2.3.8', - 'version' => '2.3.8.0', - 'reference' => 'c493585c130544c4e91d2e0e131e6d35cb0cbc47', - 'type' => 'library', - 'install_path' => __DIR__ . '/../league/commonmark', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'league/config' => array( - 'pretty_version' => 'v1.2.0', - 'version' => '1.2.0.0', - 'reference' => '754b3604fb2984c71f4af4a9cbe7b57f346ec1f3', - 'type' => 'library', - 'install_path' => __DIR__ . '/../league/config', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'league/flysystem' => array( - 'pretty_version' => '3.12.0', - 'version' => '3.12.0.0', - 'reference' => '2aef65a47e44f2d6f9938f720f6dd697e7ba7b76', - '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, - ), - 'leeovery/laravel-playwright' => array( - 'pretty_version' => '1.0.0+no-version-set', - 'version' => '1.0.0.0', - 'reference' => NULL, - 'type' => 'library', - 'install_path' => __DIR__ . '/../../', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'mockery/mockery' => array( - 'pretty_version' => '1.5.1', - 'version' => '1.5.1.0', - 'reference' => 'e92dcc83d5a51851baf5f5591d32cb2b16e3684e', - 'type' => 'library', - 'install_path' => __DIR__ . '/../mockery/mockery', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'monolog/monolog' => array( - 'pretty_version' => '2.8.0', - 'version' => '2.8.0.0', - 'reference' => '720488632c590286b88b80e62aa3d3d551ad4a50', - 'type' => 'library', - 'install_path' => __DIR__ . '/../monolog/monolog', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'mtdowling/cron-expression' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => '^1.0', - ), - ), - 'myclabs/deep-copy' => array( - 'pretty_version' => '1.11.0', - 'version' => '1.11.0.0', - 'reference' => '14daed4296fae74d9e3201d2c4925d1acb7aa614', - 'type' => 'library', - 'install_path' => __DIR__ . '/../myclabs/deep-copy', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'nesbot/carbon' => array( - 'pretty_version' => '2.64.0', - 'version' => '2.64.0.0', - 'reference' => '889546413c97de2d05063b8cb7b193c2531ea211', - 'type' => 'library', - 'install_path' => __DIR__ . '/../nesbot/carbon', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'nette/schema' => array( - 'pretty_version' => 'v1.2.3', - 'version' => '1.2.3.0', - 'reference' => 'abbdbb70e0245d5f3bf77874cea1dfb0c930d06f', - 'type' => 'library', - 'install_path' => __DIR__ . '/../nette/schema', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'nette/utils' => array( - 'pretty_version' => 'v3.2.8', - 'version' => '3.2.8.0', - 'reference' => '02a54c4c872b99e4ec05c4aec54b5a06eb0f6368', - 'type' => 'library', - 'install_path' => __DIR__ . '/../nette/utils', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'nikic/php-parser' => array( - 'pretty_version' => 'v4.15.2', - 'version' => '4.15.2.0', - 'reference' => 'f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc', - 'type' => 'library', - 'install_path' => __DIR__ . '/../nikic/php-parser', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'nunomaduro/termwind' => array( - 'pretty_version' => 'v1.15.0', - 'version' => '1.15.0.0', - 'reference' => '594ab862396c16ead000de0c3c38f4a5cbe1938d', - 'type' => 'library', - 'install_path' => __DIR__ . '/../nunomaduro/termwind', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'orchestra/testbench' => array( - 'pretty_version' => 'v7.17.0', - 'version' => '7.17.0.0', - 'reference' => 'ad16d4c73d7027aaf5635fd8315773de05cda06c', - 'type' => 'library', - 'install_path' => __DIR__ . '/../orchestra/testbench', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'orchestra/testbench-core' => array( - 'pretty_version' => 'v7.17.0', - 'version' => '7.17.0.0', - 'reference' => 'fb2408561c92cf9ef54a8af36e6d8965a9e15e52', - 'type' => 'library', - 'install_path' => __DIR__ . '/../orchestra/testbench-core', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'phar-io/manifest' => array( - 'pretty_version' => '2.0.3', - 'version' => '2.0.3.0', - 'reference' => '97803eca37d319dfa7826cc2437fc020857acb53', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phar-io/manifest', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'phar-io/version' => array( - 'pretty_version' => '3.2.1', - 'version' => '3.2.1.0', - 'reference' => '4f7fd7836c6f332bb2933569e566a0d6c4cbed74', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phar-io/version', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'phpoption/phpoption' => array( - 'pretty_version' => '1.9.0', - 'version' => '1.9.0.0', - 'reference' => 'dc5ff11e274a90cc1c743f66c9ad700ce50db9ab', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phpoption/phpoption', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'phpunit/php-code-coverage' => array( - 'pretty_version' => '9.2.22', - 'version' => '9.2.22.0', - 'reference' => 'e4bf60d2220b4baaa0572986b5d69870226b06df', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phpunit/php-code-coverage', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'phpunit/php-file-iterator' => array( - 'pretty_version' => '3.0.6', - 'version' => '3.0.6.0', - 'reference' => 'cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phpunit/php-file-iterator', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'phpunit/php-invoker' => array( - 'pretty_version' => '3.1.1', - 'version' => '3.1.1.0', - 'reference' => '5a10147d0aaf65b58940a0b72f71c9ac0423cc67', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phpunit/php-invoker', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'phpunit/php-text-template' => array( - 'pretty_version' => '2.0.4', - 'version' => '2.0.4.0', - 'reference' => '5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phpunit/php-text-template', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'phpunit/php-timer' => array( - 'pretty_version' => '5.0.3', - 'version' => '5.0.3.0', - 'reference' => '5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phpunit/php-timer', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'phpunit/phpunit' => array( - 'pretty_version' => '9.5.27', - 'version' => '9.5.27.0', - 'reference' => 'a2bc7ffdca99f92d959b3f2270529334030bba38', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phpunit/phpunit', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'pimple/pimple' => array( - 'pretty_version' => 'v3.5.0', - 'version' => '3.5.0.0', - 'reference' => 'a94b3a4db7fb774b3d78dad2315ddc07629e1bed', - 'type' => 'library', - 'install_path' => __DIR__ . '/../pimple/pimple', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'psr/container' => array( - '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.1|2.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/event-dispatcher-implementation' => array( - 'dev_requirement' => false, - 'provided' => array( - 0 => '1.0', - ), - ), - 'psr/http-factory' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'reference' => '12ac7fcd07e5b077433f5f2bee95b3a771bf61be', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/http-factory', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'psr/http-factory-implementation' => array( - 'dev_requirement' => true, - 'provided' => array( - 0 => '1.0', - ), - ), - 'psr/http-message' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/http-message', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'psr/http-message-implementation' => array( - 'dev_requirement' => true, - 'provided' => array( - 0 => '1.0', - ), - ), - 'psr/log' => array( - '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/log-implementation' => array( - 'dev_requirement' => false, - 'provided' => array( - 0 => '1.0.0 || 2.0.0 || 3.0.0', - 1 => '1.0|2.0|3.0', - ), - ), - 'psr/simple-cache' => array( - '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|2.0|3.0', - ), - ), - 'ralouphie/getallheaders' => array( - 'pretty_version' => '3.0.3', - 'version' => '3.0.3.0', - 'reference' => '120b605dfeb996808c31b6477290a714d356e822', - 'type' => 'library', - 'install_path' => __DIR__ . '/../ralouphie/getallheaders', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'ramsey/collection' => array( - 'pretty_version' => '1.2.2', - 'version' => '1.2.2.0', - 'reference' => 'cccc74ee5e328031b15640b51056ee8d3bb66c0a', - 'type' => 'library', - 'install_path' => __DIR__ . '/../ramsey/collection', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'ramsey/uuid' => array( - 'pretty_version' => '4.7.0', - 'version' => '4.7.0.0', - 'reference' => '5ed9ad582647bbc3864ef78db34bdc1afdcf9b49', - 'type' => 'library', - 'install_path' => __DIR__ . '/../ramsey/uuid', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'rhumsaa/uuid' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => '4.7.0', - ), - ), - 'sebastian/cli-parser' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'reference' => '442e7c7e687e42adc03470c7b668bc4b2402c0b2', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/cli-parser', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'sebastian/code-unit' => array( - 'pretty_version' => '1.0.8', - 'version' => '1.0.8.0', - 'reference' => '1fc9f64c0927627ef78ba436c9b17d967e68e120', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/code-unit', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'sebastian/code-unit-reverse-lookup' => array( - 'pretty_version' => '2.0.3', - 'version' => '2.0.3.0', - 'reference' => 'ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/code-unit-reverse-lookup', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'sebastian/comparator' => array( - 'pretty_version' => '4.0.8', - 'version' => '4.0.8.0', - 'reference' => 'fa0f136dd2334583309d32b62544682ee972b51a', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/comparator', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'sebastian/complexity' => array( - 'pretty_version' => '2.0.2', - 'version' => '2.0.2.0', - 'reference' => '739b35e53379900cc9ac327b2147867b8b6efd88', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/complexity', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'sebastian/diff' => array( - 'pretty_version' => '4.0.4', - 'version' => '4.0.4.0', - 'reference' => '3461e3fccc7cfdfc2720be910d3bd73c69be590d', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/diff', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'sebastian/environment' => array( - 'pretty_version' => '5.1.4', - 'version' => '5.1.4.0', - 'reference' => '1b5dff7bb151a4db11d49d90e5408e4e938270f7', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/environment', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'sebastian/exporter' => array( - 'pretty_version' => '4.0.5', - 'version' => '4.0.5.0', - 'reference' => 'ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/exporter', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'sebastian/global-state' => array( - 'pretty_version' => '5.0.5', - 'version' => '5.0.5.0', - 'reference' => '0ca8db5a5fc9c8646244e629625ac486fa286bf2', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/global-state', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'sebastian/lines-of-code' => array( - 'pretty_version' => '1.0.3', - 'version' => '1.0.3.0', - 'reference' => 'c1c2e997aa3146983ed888ad08b15470a2e22ecc', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/lines-of-code', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'sebastian/object-enumerator' => array( - 'pretty_version' => '4.0.4', - 'version' => '4.0.4.0', - 'reference' => '5c9eeac41b290a3712d88851518825ad78f45c71', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/object-enumerator', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'sebastian/object-reflector' => array( - 'pretty_version' => '2.0.4', - 'version' => '2.0.4.0', - 'reference' => 'b4f479ebdbf63ac605d183ece17d8d7fe49c15c7', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/object-reflector', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'sebastian/recursion-context' => array( - 'pretty_version' => '4.0.4', - 'version' => '4.0.4.0', - 'reference' => 'cd9d8cf3c5804de4341c283ed787f099f5506172', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/recursion-context', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'sebastian/resource-operations' => array( - 'pretty_version' => '3.0.3', - 'version' => '3.0.3.0', - 'reference' => '0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/resource-operations', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'sebastian/type' => array( - 'pretty_version' => '3.2.0', - 'version' => '3.2.0.0', - 'reference' => 'fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/type', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'sebastian/version' => array( - 'pretty_version' => '3.0.2', - 'version' => '3.0.2.0', - 'reference' => 'c6c1022351a901512170118436c764e473f6de8c', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/version', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'spatie/backtrace' => array( - 'pretty_version' => '1.2.1', - 'version' => '1.2.1.0', - 'reference' => '4ee7d41aa5268107906ea8a4d9ceccde136dbd5b', - 'type' => 'library', - 'install_path' => __DIR__ . '/../spatie/backtrace', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'spatie/laravel-package-tools' => array( - 'pretty_version' => '1.13.8', - 'version' => '1.13.8.0', - 'reference' => '781a2f637237e69c277eb401063acf15e2b4156b', - 'type' => 'library', - 'install_path' => __DIR__ . '/../spatie/laravel-package-tools', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'spatie/laravel-ray' => array( - 'pretty_version' => '1.31.0', - 'version' => '1.31.0.0', - 'reference' => '7394694afd89d05879e7a69c54abab73c1199acd', - 'type' => 'library', - 'install_path' => __DIR__ . '/../spatie/laravel-ray', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'spatie/macroable' => array( - 'pretty_version' => '2.0.0', - 'version' => '2.0.0.0', - 'reference' => 'ec2c320f932e730607aff8052c44183cf3ecb072', - 'type' => 'library', - 'install_path' => __DIR__ . '/../spatie/macroable', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'spatie/ray' => array( - 'pretty_version' => '1.36.0', - 'version' => '1.36.0.0', - 'reference' => '4a4def8cda4806218341b8204c98375aa8c34323', - 'type' => 'library', - 'install_path' => __DIR__ . '/../spatie/ray', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'symfony/console' => array( - 'pretty_version' => 'v6.2.2', - 'version' => '6.2.2.0', - 'reference' => '5a9bd5c543f00157c55face973c149957467db31', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/console', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/css-selector' => array( - 'pretty_version' => 'v6.2.0', - 'version' => '6.2.0.0', - 'reference' => '91c342ffc99283c43653ed8eb47bc2a94db7f398', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/css-selector', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/deprecation-contracts' => array( - 'pretty_version' => 'v3.2.0', - 'version' => '3.2.0.0', - 'reference' => '1ee04c65529dea5d8744774d474e7cbd2f1206d3', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/error-handler' => array( - 'pretty_version' => 'v6.2.2', - 'version' => '6.2.2.0', - 'reference' => '12a25d01cc5273b2445e125d62b61d34db42297e', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/error-handler', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/event-dispatcher' => array( - 'pretty_version' => 'v6.2.2', - 'version' => '6.2.2.0', - 'reference' => '3ffeb31139b49bf6ef0bc09d1db95eac053388d1', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/event-dispatcher', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/event-dispatcher-contracts' => array( - 'pretty_version' => 'v3.2.0', - 'version' => '3.2.0.0', - 'reference' => '0782b0b52a737a05b4383d0df35a474303cabdae', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/event-dispatcher-contracts', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/event-dispatcher-implementation' => array( - 'dev_requirement' => false, - 'provided' => array( - 0 => '2.0|3.0', - ), - ), - 'symfony/finder' => array( - 'pretty_version' => 'v6.2.0', - 'version' => '6.2.0.0', - 'reference' => 'eb2355f69519e4ef33f1835bca4c935f5d42e570', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/finder', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/http-foundation' => array( - 'pretty_version' => 'v6.2.2', - 'version' => '6.2.2.0', - 'reference' => 'ddf4dd35de1623e7c02013523e6c2137b67b636f', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/http-foundation', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/http-kernel' => array( - 'pretty_version' => 'v6.2.2', - 'version' => '6.2.2.0', - 'reference' => '860a0189969b755cd571709bd32313aa8599867a', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/http-kernel', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/mailer' => array( - 'pretty_version' => 'v6.2.2', - 'version' => '6.2.2.0', - 'reference' => 'b355ad81f1d2987c47dcd3b04d5dce669e1e62e6', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/mailer', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/mime' => array( - 'pretty_version' => 'v6.2.2', - 'version' => '6.2.2.0', - 'reference' => '8c98bf40406e791043890a163f6f6599b9cfa1ed', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/mime', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/polyfill-ctype' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', - 'reference' => '5bbc823adecdae860bb64756d639ecfec17b050a', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-ctype', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/polyfill-iconv' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', - 'reference' => '927013f3aac555983a5059aada98e1907d842695', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-iconv', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'symfony/polyfill-intl-grapheme' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', - 'reference' => '511a08c03c1960e08a883f4cffcacd219b758354', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-intl-grapheme', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/polyfill-intl-idn' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', - 'reference' => '639084e360537a19f9ee352433b84ce831f3d2da', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-intl-idn', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/polyfill-intl-normalizer' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', - 'reference' => '19bd1e4fcd5b91116f14d8533c57831ed00571b6', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/polyfill-mbstring' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', - 'reference' => '8ad114f6b39e2c98a8b0e3bd907732c207c2b534', - '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/polyfill-php81' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', - 'reference' => '707403074c8ea6e2edaf8794b0157a0bfa52157a', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-php81', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/polyfill-uuid' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', - 'reference' => 'f3cf1a645c2734236ed1e2e671e273eeb3586166', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-uuid', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/process' => array( - 'pretty_version' => 'v6.2.0', - 'version' => '6.2.0.0', - 'reference' => 'ba6e55359f8f755fe996c58a81e00eaa67a35877', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/process', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/routing' => array( - 'pretty_version' => 'v6.2.0', - 'version' => '6.2.0.0', - 'reference' => '857ac6f4df371470fbdefa2f5967a2618dbf1852', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/routing', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/service-contracts' => array( - 'pretty_version' => 'v3.2.0', - 'version' => '3.2.0.0', - 'reference' => 'aac98028c69df04ee77eb69b96b86ee51fbf4b75', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/service-contracts', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/stopwatch' => array( - 'pretty_version' => 'v6.2.0', - 'version' => '6.2.0.0', - 'reference' => '266636bb8f3fbdccc302491df7b3a1b9a8c238a7', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/stopwatch', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'symfony/string' => array( - 'pretty_version' => 'v6.2.2', - 'version' => '6.2.2.0', - 'reference' => '863219fd713fa41cbcd285a79723f94672faff4d', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/string', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/translation' => array( - 'pretty_version' => 'v6.2.2', - 'version' => '6.2.2.0', - 'reference' => '3294288c335b6267eab14964bf2c46015663d93f', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/translation', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/translation-contracts' => array( - 'pretty_version' => 'v3.2.0', - 'version' => '3.2.0.0', - 'reference' => '68cce71402305a015f8c1589bfada1280dc64fe7', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/translation-contracts', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/translation-implementation' => array( - 'dev_requirement' => false, - 'provided' => array( - 0 => '2.3|3.0', - ), - ), - 'symfony/uid' => array( - 'pretty_version' => 'v6.2.0', - 'version' => '6.2.0.0', - 'reference' => '4f9f537e57261519808a7ce1d941490736522bbc', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/uid', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/var-dumper' => array( - 'pretty_version' => 'v6.2.2', - 'version' => '6.2.2.0', - 'reference' => '6168f544827e897f708a684f75072a8c33a5e309', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/var-dumper', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/yaml' => array( - 'pretty_version' => 'v6.2.2', - 'version' => '6.2.2.0', - 'reference' => '6ed8243aa5f2cb5a57009f826b5e7fb3c4200cf3', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/yaml', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'theseer/tokenizer' => array( - 'pretty_version' => '1.2.1', - 'version' => '1.2.1.0', - 'reference' => '34a41e998c2183e22995f158c581e7b5e755ab9e', - 'type' => 'library', - 'install_path' => __DIR__ . '/../theseer/tokenizer', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'tijsverkoyen/css-to-inline-styles' => array( - 'pretty_version' => '2.2.5', - 'version' => '2.2.5.0', - 'reference' => '4348a3a06651827a27d989ad1d13efec6bb49b19', - 'type' => 'library', - 'install_path' => __DIR__ . '/../tijsverkoyen/css-to-inline-styles', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'vlucas/phpdotenv' => array( - 'pretty_version' => 'v5.5.0', - 'version' => '5.5.0.0', - 'reference' => '1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7', - 'type' => 'library', - 'install_path' => __DIR__ . '/../vlucas/phpdotenv', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'voku/portable-ascii' => array( - 'pretty_version' => '2.0.1', - 'version' => '2.0.1.0', - 'reference' => 'b56450eed252f6801410d810c8e1727224ae0743', - 'type' => 'library', - 'install_path' => __DIR__ . '/../voku/portable-ascii', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'webmozart/assert' => array( - 'pretty_version' => '1.11.0', - 'version' => '1.11.0.0', - 'reference' => '11cb2199493b2f8a3b53e7f19068fc6aac760991', - 'type' => 'library', - 'install_path' => __DIR__ . '/../webmozart/assert', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'zbateson/mail-mime-parser' => array( - 'pretty_version' => '2.2.3', - 'version' => '2.2.3.0', - 'reference' => '295c7f82a8c44af685680d9df6714beb812e90ff', - 'type' => 'library', - 'install_path' => __DIR__ . '/../zbateson/mail-mime-parser', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'zbateson/mb-wrapper' => array( - 'pretty_version' => '1.1.2', - 'version' => '1.1.2.0', - 'reference' => '5d9d190ef18ce6d424e3ac6f5ebe13901f92b74a', - 'type' => 'library', - 'install_path' => __DIR__ . '/../zbateson/mb-wrapper', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'zbateson/stream-decorators' => array( - 'pretty_version' => '1.0.7', - 'version' => '1.0.7.0', - 'reference' => '8f8ca208572963258b7e6d91106181706deacd10', - 'type' => 'library', - 'install_path' => __DIR__ . '/../zbateson/stream-decorators', - 'aliases' => array(), - 'dev_requirement' => true, - ), - ), -); diff --git a/vendor/composer/platform_check.php b/vendor/composer/platform_check.php deleted file mode 100644 index 4c3a5d68..00000000 --- a/vendor/composer/platform_check.php +++ /dev/null @@ -1,26 +0,0 @@ -= 80100)) { - $issues[] = 'Your Composer dependencies require a PHP version ">= 8.1.0". You are running ' . PHP_VERSION . '.'; -} - -if ($issues) { - if (!headers_sent()) { - header('HTTP/1.1 500 Internal Server Error'); - } - if (!ini_get('display_errors')) { - if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { - fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); - } elseif (!headers_sent()) { - echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; - } - } - trigger_error( - 'Composer detected issues in your platform: ' . implode(' ', $issues), - E_USER_ERROR - ); -} diff --git a/vendor/dflydev/dot-access-data/CHANGELOG.md b/vendor/dflydev/dot-access-data/CHANGELOG.md deleted file mode 100644 index 8e92c238..00000000 --- a/vendor/dflydev/dot-access-data/CHANGELOG.md +++ /dev/null @@ -1,67 +0,0 @@ -# Changelog - -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] - -## [3.0.2] - 2022-10-27 - -### Fixed - - - Added missing return types to docblocks (#44, #45) - -## [3.0.1] - 2021-08-13 - -### Added - - - Adds ReturnTypeWillChange to suppress PHP 8.1 warnings (#40) - -## [3.0.0] - 2021-01-01 - -### Added - - Added support for both `.` and `/`-delimited key paths (#24) - - Added parameter and return types to everything; enabled strict type checks (#18) - - Added new exception classes to better identify certain types of errors (#20) - - `Data` now implements `ArrayAccess` (#17) - - Added ability to merge non-associative array values (#31, #32) - -### Changed - - All thrown exceptions are now instances or subclasses of `DataException` (#20) - - Calling `get()` on a missing key path without providing a default will throw a `MissingPathException` instead of returning `null` (#29) - - Bumped supported PHP versions to 7.1 - 8.x (#18) - -### Fixed - - Fixed incorrect merging of array values into string values (#32) - - Fixed `get()` method behaving as if keys with `null` values didn't exist - -## [2.0.0] - 2017-12-21 - -### Changed - - Bumped supported PHP versions to 7.0 - 7.4 (#12) - - Switched to PSR-4 autoloading - -## [1.1.0] - 2017-01-20 - -### Added - - Added new `has()` method to check for the existence of the given key (#4, #7) - -## [1.0.1] - 2015-08-12 - -### Added - - Added new optional `$default` parameter to the `get()` method (#2) - -## [1.0.0] - 2012-07-17 - -**Initial release!** - -[Unreleased]: https://github.com/dflydev/dflydev-dot-access-data/compare/v3.0.2...main -[3.0.2]: https://github.com/dflydev/dflydev-dot-access-data/compare/v3.0.1...v3.0.2 -[3.0.1]: https://github.com/dflydev/dflydev-dot-access-data/compare/v3.0.0...v3.0.1 -[3.0.0]: https://github.com/dflydev/dflydev-dot-access-data/compare/v2.0.0...v3.0.0 -[2.0.0]: https://github.com/dflydev/dflydev-dot-access-data/compare/v1.1.0...v2.0.0 -[1.1.0]: https://github.com/dflydev/dflydev-dot-access-data/compare/v1.0.1...v1.1.0 -[1.0.1]: https://github.com/dflydev/dflydev-dot-access-data/compare/v1.0.0...v1.0.1 -[1.0.0]: https://github.com/dflydev/dflydev-dot-access-data/releases/tag/v1.0.0 diff --git a/vendor/dflydev/dot-access-data/LICENSE b/vendor/dflydev/dot-access-data/LICENSE deleted file mode 100644 index b6880d43..00000000 --- a/vendor/dflydev/dot-access-data/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2012 Dragonfly Development Inc. - -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/dflydev/dot-access-data/README.md b/vendor/dflydev/dot-access-data/README.md deleted file mode 100644 index 775fbdf7..00000000 --- a/vendor/dflydev/dot-access-data/README.md +++ /dev/null @@ -1,158 +0,0 @@ -Dot Access Data -=============== - -[![Latest Version](https://img.shields.io/packagist/v/dflydev/dot-access-data.svg?style=flat-square)](https://packagist.org/packages/dflydev/dot-access-data) -[![Total Downloads](https://img.shields.io/packagist/dt/dflydev/dot-access-data.svg?style=flat-square)](https://packagist.org/packages/dflydev/dot-access-data) -[![Software License](https://img.shields.io/badge/License-MIT-brightgreen.svg?style=flat-square)](LICENSE) -[![Build Status](https://img.shields.io/github/workflow/status/dflydev/dflydev-dot-access-data/Tests/main.svg?style=flat-square)](https://github.com/dflydev/dflydev-dot-access-data/actions?query=workflow%3ATests+branch%3Amain) -[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/dflydev/dflydev-dot-access-data.svg?style=flat-square)](https://scrutinizer-ci.com/g/dflydev/dflydev-dot-access-data/code-structure/) -[![Quality Score](https://img.shields.io/scrutinizer/g/dflydev/dflydev-dot-access-data.svg?style=flat-square)](https://scrutinizer-ci.com/g/dflydev/dflydev-dot-access-data) - -Given a deep data structure, access data by dot notation. - - -Requirements ------------- - - * PHP (7.1+) - -> For PHP (5.3+) please refer to version `1.0`. - - -Usage ------ - -Abstract example: - -```php -use Dflydev\DotAccessData\Data; - -$data = new Data; - -$data->set('a.b.c', 'C'); -$data->set('a.b.d', 'D1'); -$data->append('a.b.d', 'D2'); -$data->set('a.b.e', ['E0', 'E1', 'E2']); - -// C -$data->get('a.b.c'); - -// ['D1', 'D2'] -$data->get('a.b.d'); - -// ['E0', 'E1', 'E2'] -$data->get('a.b.e'); - -// true -$data->has('a.b.c'); - -// false -$data->has('a.b.d.j'); - - -// 'some-default-value' -$data->get('some.path.that.does.not.exist', 'some-default-value'); - -// throws a MissingPathException because no default was given -$data->get('some.path.that.does.not.exist'); -``` - -A more concrete example: - -```php -use Dflydev\DotAccessData\Data; - -$data = new Data([ - 'hosts' => [ - 'hewey' => [ - 'username' => 'hman', - 'password' => 'HPASS', - 'roles' => ['web'], - ], - 'dewey' => [ - 'username' => 'dman', - 'password' => 'D---S', - 'roles' => ['web', 'db'], - 'nick' => 'dewey dman', - ], - 'lewey' => [ - 'username' => 'lman', - 'password' => 'LP@$$', - 'roles' => ['db'], - ], - ], -]); - -// hman -$username = $data->get('hosts.hewey.username'); -// HPASS -$password = $data->get('hosts.hewey.password'); -// ['web'] -$roles = $data->get('hosts.hewey.roles'); -// dewey dman -$nick = $data->get('hosts.dewey.nick'); -// Unknown -$nick = $data->get('hosts.lewey.nick', 'Unknown'); - -// DataInterface instance -$dewey = $data->getData('hosts.dewey'); -// dman -$username = $dewey->get('username'); -// D---S -$password = $dewey->get('password'); -// ['web', 'db'] -$roles = $dewey->get('roles'); - -// No more lewey -$data->remove('hosts.lewey'); - -// Add DB to hewey's roles -$data->append('hosts.hewey.roles', 'db'); - -$data->set('hosts.april', [ - 'username' => 'aman', - 'password' => '@---S', - 'roles' => ['web'], -]); - -// Check if a key exists (true to this case) -$hasKey = $data->has('hosts.dewey.username'); -``` - -`Data` may be used as an array, since it implements `ArrayAccess` interface: - -```php -// Get -$data->get('name') === $data['name']; // true - -$data['name'] = 'Dewey'; -// is equivalent to -$data->set($name, 'Dewey'); - -isset($data['name']) === $data->has('name'); - -// Remove key -unset($data['name']); -``` - -`/` can also be used as a path delimiter: - -```php -$data->set('a/b/c', 'd'); -echo $data->get('a/b/c'); // "d" - -$data->get('a/b/c') === $data->get('a.b.c'); // true -``` - -License -------- - -This library is licensed under the MIT License - see the LICENSE file -for details. - - -Community ---------- - -If you have questions or want to help out, join us in the -[#dflydev](irc://irc.freenode.net/#dflydev) channel on irc.freenode.net. diff --git a/vendor/dflydev/dot-access-data/composer.json b/vendor/dflydev/dot-access-data/composer.json deleted file mode 100644 index 44dc5ede..00000000 --- a/vendor/dflydev/dot-access-data/composer.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "dflydev/dot-access-data", - "type": "library", - "description": "Given a deep data structure, access data by dot notation.", - "homepage": "https://github.com/dflydev/dflydev-dot-access-data", - "keywords": ["dot", "access", "data", "notation"], - "license": "MIT", - "authors": [ - { - "name": "Dragonfly Development Inc.", - "email": "info@dflydev.com", - "homepage": "http://dflydev.com" - }, - { - "name": "Beau Simensen", - "email": "beau@dflydev.com", - "homepage": "http://beausimensen.com" - }, - { - "name": "Carlos Frutos", - "email": "carlos@kiwing.it", - "homepage": "https://github.com/cfrutos" - }, - { - "name": "Colin O'Dell", - "email": "colinodell@gmail.com", - "homepage": "https://www.colinodell.com" - } - ], - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^0.12.42", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.3", - "scrutinizer/ocular": "1.6.0", - "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "^4.0.0" - }, - "autoload": { - "psr-4": { - "Dflydev\\DotAccessData\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Dflydev\\DotAccessData\\": "tests/" - } - }, - "extra": { - "branch-alias": { - "dev-main": "3.x-dev" - } - }, - "scripts": { - "phpcs": "phpcs", - "phpstan": "phpstan analyse", - "phpunit": "phpunit --no-coverage", - "psalm": "psalm", - "test": [ - "@phpcs", - "@phpstan", - "@psalm", - "@phpunit" - ] - } -} diff --git a/vendor/dflydev/dot-access-data/src/Data.php b/vendor/dflydev/dot-access-data/src/Data.php deleted file mode 100644 index 3409b8e5..00000000 --- a/vendor/dflydev/dot-access-data/src/Data.php +++ /dev/null @@ -1,286 +0,0 @@ - - */ -class Data implements DataInterface, ArrayAccess -{ - private const DELIMITERS = ['.', '/']; - - /** - * Internal representation of data data - * - * @var array - */ - protected $data; - - /** - * Constructor - * - * @param array $data - */ - public function __construct(array $data = []) - { - $this->data = $data; - } - - /** - * {@inheritdoc} - */ - public function append(string $key, $value = null): void - { - $currentValue =& $this->data; - $keyPath = self::keyToPathArray($key); - - $endKey = array_pop($keyPath); - foreach ($keyPath as $currentKey) { - if (! isset($currentValue[$currentKey])) { - $currentValue[$currentKey] = []; - } - $currentValue =& $currentValue[$currentKey]; - } - - if (!isset($currentValue[$endKey])) { - $currentValue[$endKey] = []; - } - - if (!is_array($currentValue[$endKey])) { - // Promote this key to an array. - // TODO: Is this really what we want to do? - $currentValue[$endKey] = [$currentValue[$endKey]]; - } - - $currentValue[$endKey][] = $value; - } - - /** - * {@inheritdoc} - */ - public function set(string $key, $value = null): void - { - $currentValue =& $this->data; - $keyPath = self::keyToPathArray($key); - - $endKey = array_pop($keyPath); - foreach ($keyPath as $currentKey) { - if (!isset($currentValue[$currentKey])) { - $currentValue[$currentKey] = []; - } - if (!is_array($currentValue[$currentKey])) { - throw new DataException(sprintf('Key path "%s" within "%s" cannot be indexed into (is not an array)', $currentKey, self::formatPath($key))); - } - $currentValue =& $currentValue[$currentKey]; - } - $currentValue[$endKey] = $value; - } - - /** - * {@inheritdoc} - */ - public function remove(string $key): void - { - $currentValue =& $this->data; - $keyPath = self::keyToPathArray($key); - - $endKey = array_pop($keyPath); - foreach ($keyPath as $currentKey) { - if (!isset($currentValue[$currentKey])) { - return; - } - $currentValue =& $currentValue[$currentKey]; - } - unset($currentValue[$endKey]); - } - - /** - * {@inheritdoc} - * - * @psalm-mutation-free - */ - public function get(string $key, $default = null) - { - /** @psalm-suppress ImpureFunctionCall */ - $hasDefault = \func_num_args() > 1; - - $currentValue = $this->data; - $keyPath = self::keyToPathArray($key); - - foreach ($keyPath as $currentKey) { - if (!is_array($currentValue) || !array_key_exists($currentKey, $currentValue)) { - if ($hasDefault) { - return $default; - } - - throw new MissingPathException($key, sprintf('No data exists at the given path: "%s"', self::formatPath($keyPath))); - } - - $currentValue = $currentValue[$currentKey]; - } - - return $currentValue === null ? $default : $currentValue; - } - - /** - * {@inheritdoc} - * - * @psalm-mutation-free - */ - public function has(string $key): bool - { - $currentValue = $this->data; - - foreach (self::keyToPathArray($key) as $currentKey) { - if ( - !is_array($currentValue) || - !array_key_exists($currentKey, $currentValue) - ) { - return false; - } - $currentValue = $currentValue[$currentKey]; - } - - return true; - } - - /** - * {@inheritdoc} - * - * @psalm-mutation-free - */ - public function getData(string $key): DataInterface - { - $value = $this->get($key); - if (is_array($value) && Util::isAssoc($value)) { - return new Data($value); - } - - throw new DataException(sprintf('Value at "%s" could not be represented as a DataInterface', self::formatPath($key))); - } - - /** - * {@inheritdoc} - */ - public function import(array $data, int $mode = self::REPLACE): void - { - $this->data = Util::mergeAssocArray($this->data, $data, $mode); - } - - /** - * {@inheritdoc} - */ - public function importData(DataInterface $data, int $mode = self::REPLACE): void - { - $this->import($data->export(), $mode); - } - - /** - * {@inheritdoc} - * - * @psalm-mutation-free - */ - public function export(): array - { - return $this->data; - } - - /** - * {@inheritdoc} - * - * @return bool - */ - #[\ReturnTypeWillChange] - public function offsetExists($key) - { - return $this->has($key); - } - - /** - * {@inheritdoc} - * - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($key) - { - return $this->get($key, null); - } - - /** - * {@inheritdoc} - * - * @param string $key - * @param mixed $value - * - * @return void - */ - #[\ReturnTypeWillChange] - public function offsetSet($key, $value) - { - $this->set($key, $value); - } - - /** - * {@inheritdoc} - * - * @return void - */ - #[\ReturnTypeWillChange] - public function offsetUnset($key) - { - $this->remove($key); - } - - /** - * @param string $path - * - * @return string[] - * - * @psalm-return non-empty-list - * - * @psalm-pure - */ - protected static function keyToPathArray(string $path): array - { - if (\strlen($path) === 0) { - throw new InvalidPathException('Path cannot be an empty string'); - } - - $path = \str_replace(self::DELIMITERS, '.', $path); - - return \explode('.', $path); - } - - /** - * @param string|string[] $path - * - * @return string - * - * @psalm-pure - */ - protected static function formatPath($path): string - { - if (is_string($path)) { - $path = self::keyToPathArray($path); - } - - return implode(' » ', $path); - } -} diff --git a/vendor/dflydev/dot-access-data/src/DataInterface.php b/vendor/dflydev/dot-access-data/src/DataInterface.php deleted file mode 100644 index 5909a8c6..00000000 --- a/vendor/dflydev/dot-access-data/src/DataInterface.php +++ /dev/null @@ -1,131 +0,0 @@ - $data - * @param self::PRESERVE|self::REPLACE|self::MERGE $mode - */ - public function import(array $data, int $mode = self::REPLACE): void; - - /** - * Import data from an external data into existing data - * - * @param DataInterface $data - * @param self::PRESERVE|self::REPLACE|self::MERGE $mode - */ - public function importData(DataInterface $data, int $mode = self::REPLACE): void; - - /** - * Export data as raw data - * - * @return array - * - * @psalm-mutation-free - */ - public function export(): array; -} diff --git a/vendor/dflydev/dot-access-data/src/Exception/DataException.php b/vendor/dflydev/dot-access-data/src/Exception/DataException.php deleted file mode 100644 index 2faf9f54..00000000 --- a/vendor/dflydev/dot-access-data/src/Exception/DataException.php +++ /dev/null @@ -1,21 +0,0 @@ -path = $path; - - parent::__construct($message, $code, $previous); - } - - public function getPath(): string - { - return $this->path; - } -} diff --git a/vendor/dflydev/dot-access-data/src/Util.php b/vendor/dflydev/dot-access-data/src/Util.php deleted file mode 100644 index 5634c511..00000000 --- a/vendor/dflydev/dot-access-data/src/Util.php +++ /dev/null @@ -1,78 +0,0 @@ - $arr - * - * @return bool - * - * @psalm-pure - */ - public static function isAssoc(array $arr): bool - { - return !count($arr) || count(array_filter(array_keys($arr), 'is_string')) == count($arr); - } - - /** - * Merge contents from one associtative array to another - * - * @param mixed $to - * @param mixed $from - * @param DataInterface::PRESERVE|DataInterface::REPLACE|DataInterface::MERGE $mode - * - * @return mixed - * - * @psalm-pure - */ - public static function mergeAssocArray($to, $from, int $mode = DataInterface::REPLACE) - { - if ($mode === DataInterface::MERGE && self::isList($to) && self::isList($from)) { - return array_merge($to, $from); - } - - if (is_array($from) && is_array($to)) { - foreach ($from as $k => $v) { - if (!isset($to[$k])) { - $to[$k] = $v; - } else { - $to[$k] = self::mergeAssocArray($to[$k], $v, $mode); - } - } - - return $to; - } - - return $mode === DataInterface::PRESERVE ? $to : $from; - } - - /** - * @param mixed $value - * - * @return bool - * - * @psalm-pure - */ - private static function isList($value): bool - { - return is_array($value) && array_values($value) === $value; - } -} diff --git a/vendor/doctrine/inflector/LICENSE b/vendor/doctrine/inflector/LICENSE deleted file mode 100644 index 8c38cc1b..00000000 --- a/vendor/doctrine/inflector/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2006-2015 Doctrine Project - -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/doctrine/inflector/README.md b/vendor/doctrine/inflector/README.md deleted file mode 100644 index 6e3a97f7..00000000 --- a/vendor/doctrine/inflector/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Doctrine Inflector - -Doctrine Inflector is a small library that can perform string manipulations -with regard to uppercase/lowercase and singular/plural forms of words. - -[![Build Status](https://github.com/doctrine/inflector/workflows/Continuous%20Integration/badge.svg)](https://github.com/doctrine/inflector/actions?query=workflow%3A%22Continuous+Integration%22+branch%3A4.0.x) -[![Code Coverage](https://codecov.io/gh/doctrine/inflector/branch/2.0.x/graph/badge.svg)](https://codecov.io/gh/doctrine/inflector/branch/2.0.x) diff --git a/vendor/doctrine/inflector/composer.json b/vendor/doctrine/inflector/composer.json deleted file mode 100644 index 862ea5c3..00000000 --- a/vendor/doctrine/inflector/composer.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "doctrine/inflector", - "type": "library", - "description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.", - "keywords": ["php", "strings", "words", "manipulation", "inflector", "inflection", "uppercase", "lowercase", "singular", "plural"], - "homepage": "https://www.doctrine-project.org/projects/inflector.html", - "license": "MIT", - "authors": [ - {"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"}, - {"name": "Roman Borschel", "email": "roman@code-factory.org"}, - {"name": "Benjamin Eberlei", "email": "kontakt@beberlei.de"}, - {"name": "Jonathan Wage", "email": "jonwage@gmail.com"}, - {"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"} - ], - "require": { - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^10", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-phpunit": "^1.1", - "phpstan/phpstan-strict-rules": "^1.3", - "phpunit/phpunit": "^8.5 || ^9.5", - "vimeo/psalm": "^4.25" - }, - "autoload": { - "psr-4": { - "Doctrine\\Inflector\\": "lib/Doctrine/Inflector" - } - }, - "autoload-dev": { - "psr-4": { - "Doctrine\\Tests\\Inflector\\": "tests/Doctrine/Tests/Inflector" - } - }, - "config": { - "allow-plugins": { - "dealerdirect/phpcodesniffer-composer-installer": true - } - } -} diff --git a/vendor/doctrine/inflector/docs/en/index.rst b/vendor/doctrine/inflector/docs/en/index.rst deleted file mode 100644 index 29866f4d..00000000 --- a/vendor/doctrine/inflector/docs/en/index.rst +++ /dev/null @@ -1,226 +0,0 @@ -Introduction -============ - -The Doctrine Inflector has methods for inflecting text. The features include pluralization, -singularization, converting between camelCase and under_score and capitalizing -words. - -Installation -============ - -You can install the Inflector with composer: - -.. code-block:: console - - $ composer require doctrine/inflector - -Usage -===== - -Using the inflector is easy, you can create a new ``Doctrine\Inflector\Inflector`` instance by using -the ``Doctrine\Inflector\InflectorFactory`` class: - -.. code-block:: php - - use Doctrine\Inflector\InflectorFactory; - - $inflector = InflectorFactory::create()->build(); - -By default it will create an English inflector. If you want to use another language, just pass the language -you want to create an inflector for to the ``createForLanguage()`` method: - -.. code-block:: php - - use Doctrine\Inflector\InflectorFactory; - use Doctrine\Inflector\Language; - - $inflector = InflectorFactory::createForLanguage(Language::SPANISH)->build(); - -The supported languages are as follows: - -- ``Language::ENGLISH`` -- ``Language::FRENCH`` -- ``Language::NORWEGIAN_BOKMAL`` -- ``Language::PORTUGUESE`` -- ``Language::SPANISH`` -- ``Language::TURKISH`` - -If you want to manually construct the inflector instead of using a factory, you can do so like this: - -.. code-block:: php - - use Doctrine\Inflector\CachedWordInflector; - use Doctrine\Inflector\RulesetInflector; - use Doctrine\Inflector\Rules\English; - - $inflector = new Inflector( - new CachedWordInflector(new RulesetInflector( - English\Rules::getSingularRuleset() - )), - new CachedWordInflector(new RulesetInflector( - English\Rules::getPluralRuleset() - )) - ); - -Adding Languages ----------------- - -If you are interested in adding support for your language, take a look at the other languages defined in the -``Doctrine\Inflector\Rules`` namespace and the tests located in ``Doctrine\Tests\Inflector\Rules``. You can copy -one of the languages and update the rules for your language. - -Once you have done this, send a pull request to the ``doctrine/inflector`` repository with the additions. - -Custom Setup -============ - -If you want to setup custom singular and plural rules, you can configure these in the factory: - -.. code-block:: php - - use Doctrine\Inflector\InflectorFactory; - use Doctrine\Inflector\Rules\Pattern; - use Doctrine\Inflector\Rules\Patterns; - use Doctrine\Inflector\Rules\Ruleset; - use Doctrine\Inflector\Rules\Substitution; - use Doctrine\Inflector\Rules\Substitutions; - use Doctrine\Inflector\Rules\Transformation; - use Doctrine\Inflector\Rules\Transformations; - use Doctrine\Inflector\Rules\Word; - - $inflector = InflectorFactory::create() - ->withSingularRules( - new Ruleset( - new Transformations( - new Transformation(new Pattern('/^(bil)er$/i'), '\1'), - new Transformation(new Pattern('/^(inflec|contribu)tors$/i'), '\1ta') - ), - new Patterns(new Pattern('singulars')), - new Substitutions(new Substitution(new Word('spins'), new Word('spinor'))) - ) - ) - ->withPluralRules( - new Ruleset( - new Transformations( - new Transformation(new Pattern('^(bil)er$'), '\1'), - new Transformation(new Pattern('^(inflec|contribu)tors$'), '\1ta') - ), - new Patterns(new Pattern('noflect'), new Pattern('abtuse')), - new Substitutions( - new Substitution(new Word('amaze'), new Word('amazable')), - new Substitution(new Word('phone'), new Word('phonezes')) - ) - ) - ) - ->build(); - -No operation inflector ----------------------- - -The ``Doctrine\Inflector\NoopWordInflector`` may be used to configure an inflector that doesn't perform any operation for -pluralization and/or singularization. If will simply return the input as output. - -This is an implementation of the `Null Object design pattern `_. - -.. code-block:: php - - use Doctrine\Inflector\Inflector; - use Doctrine\Inflector\NoopWordInflector; - - $inflector = new Inflector(new NoopWordInflector(), new NoopWordInflector()); - -Tableize -======== - -Converts ``ModelName`` to ``model_name``: - -.. code-block:: php - - echo $inflector->tableize('ModelName'); // model_name - -Classify -======== - -Converts ``model_name`` to ``ModelName``: - -.. code-block:: php - - echo $inflector->classify('model_name'); // ModelName - -Camelize -======== - -This method uses `Classify`_ and then converts the first character to lowercase: - -.. code-block:: php - - echo $inflector->camelize('model_name'); // modelName - -Capitalize -========== - -Takes a string and capitalizes all of the words, like PHP's built-in -``ucwords`` function. This extends that behavior, however, by allowing the -word delimiters to be configured, rather than only separating on -whitespace. - -Here is an example: - -.. code-block:: php - - $string = 'top-o-the-morning to all_of_you!'; - - echo $inflector->capitalize($string); // Top-O-The-Morning To All_of_you! - - echo $inflector->capitalize($string, '-_ '); // Top-O-The-Morning To All_Of_You! - -Pluralize -========= - -Returns a word in plural form. - -.. code-block:: php - - echo $inflector->pluralize('browser'); // browsers - -Singularize -=========== - -Returns a word in singular form. - -.. code-block:: php - - echo $inflector->singularize('browsers'); // browser - -Urlize -====== - -Generate a URL friendly string from a string of text: - -.. code-block:: php - - echo $inflector->urlize('My first blog post'); // my-first-blog-post - -Unaccent -======== - -You can unaccent a string of text using the ``unaccent()`` method: - -.. code-block:: php - - echo $inflector->unaccent('año'); // ano - -Legacy API -========== - -The API present in Inflector 1.x is still available, but will be deprecated in a future release and dropped for 3.0. -Support for languages other than English is available in the 2.0 API only. - -Acknowledgements -================ - -The language rules in this library have been adapted from several different sources, including but not limited to: - -- `Ruby On Rails Inflector `_ -- `ICanBoogie Inflector `_ -- `CakePHP Inflector `_ diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/CachedWordInflector.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/CachedWordInflector.php deleted file mode 100644 index 2d529087..00000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/CachedWordInflector.php +++ /dev/null @@ -1,24 +0,0 @@ -wordInflector = $wordInflector; - } - - public function inflect(string $word): string - { - return $this->cache[$word] ?? $this->cache[$word] = $this->wordInflector->inflect($word); - } -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/GenericLanguageInflectorFactory.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/GenericLanguageInflectorFactory.php deleted file mode 100644 index 166061d2..00000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/GenericLanguageInflectorFactory.php +++ /dev/null @@ -1,66 +0,0 @@ -singularRulesets[] = $this->getSingularRuleset(); - $this->pluralRulesets[] = $this->getPluralRuleset(); - } - - final public function build(): Inflector - { - return new Inflector( - new CachedWordInflector(new RulesetInflector( - ...$this->singularRulesets - )), - new CachedWordInflector(new RulesetInflector( - ...$this->pluralRulesets - )) - ); - } - - final public function withSingularRules(?Ruleset $singularRules, bool $reset = false): LanguageInflectorFactory - { - if ($reset) { - $this->singularRulesets = []; - } - - if ($singularRules instanceof Ruleset) { - array_unshift($this->singularRulesets, $singularRules); - } - - return $this; - } - - final public function withPluralRules(?Ruleset $pluralRules, bool $reset = false): LanguageInflectorFactory - { - if ($reset) { - $this->pluralRulesets = []; - } - - if ($pluralRules instanceof Ruleset) { - array_unshift($this->pluralRulesets, $pluralRules); - } - - return $this; - } - - abstract protected function getSingularRuleset(): Ruleset; - - abstract protected function getPluralRuleset(): Ruleset; -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Inflector.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Inflector.php deleted file mode 100644 index 610a4cf4..00000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Inflector.php +++ /dev/null @@ -1,507 +0,0 @@ - 'A', - 'Á' => 'A', - 'Â' => 'A', - 'Ã' => 'A', - 'Ä' => 'Ae', - 'Æ' => 'Ae', - 'Å' => 'Aa', - 'æ' => 'a', - 'Ç' => 'C', - 'È' => 'E', - 'É' => 'E', - 'Ê' => 'E', - 'Ë' => 'E', - 'Ì' => 'I', - 'Í' => 'I', - 'Î' => 'I', - 'Ï' => 'I', - 'Ñ' => 'N', - 'Ò' => 'O', - 'Ó' => 'O', - 'Ô' => 'O', - 'Õ' => 'O', - 'Ö' => 'Oe', - 'Ù' => 'U', - 'Ú' => 'U', - 'Û' => 'U', - 'Ü' => 'Ue', - 'Ý' => 'Y', - 'ß' => 'ss', - 'à' => 'a', - 'á' => 'a', - 'â' => 'a', - 'ã' => 'a', - 'ä' => 'ae', - 'å' => 'aa', - 'ç' => 'c', - 'è' => 'e', - 'é' => 'e', - 'ê' => 'e', - 'ë' => 'e', - 'ì' => 'i', - 'í' => 'i', - 'î' => 'i', - 'ï' => 'i', - 'ñ' => 'n', - 'ò' => 'o', - 'ó' => 'o', - 'ô' => 'o', - 'õ' => 'o', - 'ö' => 'oe', - 'ù' => 'u', - 'ú' => 'u', - 'û' => 'u', - 'ü' => 'ue', - 'ý' => 'y', - 'ÿ' => 'y', - 'Ā' => 'A', - 'ā' => 'a', - 'Ă' => 'A', - 'ă' => 'a', - 'Ą' => 'A', - 'ą' => 'a', - 'Ć' => 'C', - 'ć' => 'c', - 'Ĉ' => 'C', - 'ĉ' => 'c', - 'Ċ' => 'C', - 'ċ' => 'c', - 'Č' => 'C', - 'č' => 'c', - 'Ď' => 'D', - 'ď' => 'd', - 'Đ' => 'D', - 'đ' => 'd', - 'Ē' => 'E', - 'ē' => 'e', - 'Ĕ' => 'E', - 'ĕ' => 'e', - 'Ė' => 'E', - 'ė' => 'e', - 'Ę' => 'E', - 'ę' => 'e', - 'Ě' => 'E', - 'ě' => 'e', - 'Ĝ' => 'G', - 'ĝ' => 'g', - 'Ğ' => 'G', - 'ğ' => 'g', - 'Ġ' => 'G', - 'ġ' => 'g', - 'Ģ' => 'G', - 'ģ' => 'g', - 'Ĥ' => 'H', - 'ĥ' => 'h', - 'Ħ' => 'H', - 'ħ' => 'h', - 'Ĩ' => 'I', - 'ĩ' => 'i', - 'Ī' => 'I', - 'ī' => 'i', - 'Ĭ' => 'I', - 'ĭ' => 'i', - 'Į' => 'I', - 'į' => 'i', - 'İ' => 'I', - 'ı' => 'i', - 'IJ' => 'IJ', - 'ij' => 'ij', - 'Ĵ' => 'J', - 'ĵ' => 'j', - 'Ķ' => 'K', - 'ķ' => 'k', - 'ĸ' => 'k', - 'Ĺ' => 'L', - 'ĺ' => 'l', - 'Ļ' => 'L', - 'ļ' => 'l', - 'Ľ' => 'L', - 'ľ' => 'l', - 'Ŀ' => 'L', - 'ŀ' => 'l', - 'Ł' => 'L', - 'ł' => 'l', - 'Ń' => 'N', - 'ń' => 'n', - 'Ņ' => 'N', - 'ņ' => 'n', - 'Ň' => 'N', - 'ň' => 'n', - 'ʼn' => 'N', - 'Ŋ' => 'n', - 'ŋ' => 'N', - 'Ō' => 'O', - 'ō' => 'o', - 'Ŏ' => 'O', - 'ŏ' => 'o', - 'Ő' => 'O', - 'ő' => 'o', - 'Œ' => 'OE', - 'œ' => 'oe', - 'Ø' => 'O', - 'ø' => 'o', - 'Ŕ' => 'R', - 'ŕ' => 'r', - 'Ŗ' => 'R', - 'ŗ' => 'r', - 'Ř' => 'R', - 'ř' => 'r', - 'Ś' => 'S', - 'ś' => 's', - 'Ŝ' => 'S', - 'ŝ' => 's', - 'Ş' => 'S', - 'ş' => 's', - 'Š' => 'S', - 'š' => 's', - 'Ţ' => 'T', - 'ţ' => 't', - 'Ť' => 'T', - 'ť' => 't', - 'Ŧ' => 'T', - 'ŧ' => 't', - 'Ũ' => 'U', - 'ũ' => 'u', - 'Ū' => 'U', - 'ū' => 'u', - 'Ŭ' => 'U', - 'ŭ' => 'u', - 'Ů' => 'U', - 'ů' => 'u', - 'Ű' => 'U', - 'ű' => 'u', - 'Ų' => 'U', - 'ų' => 'u', - 'Ŵ' => 'W', - 'ŵ' => 'w', - 'Ŷ' => 'Y', - 'ŷ' => 'y', - 'Ÿ' => 'Y', - 'Ź' => 'Z', - 'ź' => 'z', - 'Ż' => 'Z', - 'ż' => 'z', - 'Ž' => 'Z', - 'ž' => 'z', - 'ſ' => 's', - '€' => 'E', - '£' => '', - ]; - - /** @var WordInflector */ - private $singularizer; - - /** @var WordInflector */ - private $pluralizer; - - public function __construct(WordInflector $singularizer, WordInflector $pluralizer) - { - $this->singularizer = $singularizer; - $this->pluralizer = $pluralizer; - } - - /** - * Converts a word into the format for a Doctrine table name. Converts 'ModelName' to 'model_name'. - */ - public function tableize(string $word): string - { - $tableized = preg_replace('~(?<=\\w)([A-Z])~u', '_$1', $word); - - if ($tableized === null) { - throw new RuntimeException(sprintf( - 'preg_replace returned null for value "%s"', - $word - )); - } - - return mb_strtolower($tableized); - } - - /** - * Converts a word into the format for a Doctrine class name. Converts 'table_name' to 'TableName'. - */ - public function classify(string $word): string - { - return str_replace([' ', '_', '-'], '', ucwords($word, ' _-')); - } - - /** - * Camelizes a word. This uses the classify() method and turns the first character to lowercase. - */ - public function camelize(string $word): string - { - return lcfirst($this->classify($word)); - } - - /** - * Uppercases words with configurable delimiters between words. - * - * Takes a string and capitalizes all of the words, like PHP's built-in - * ucwords function. This extends that behavior, however, by allowing the - * word delimiters to be configured, rather than only separating on - * whitespace. - * - * Here is an example: - * - * capitalize($string); - * // Top-O-The-Morning To All_of_you! - * - * echo $inflector->capitalize($string, '-_ '); - * // Top-O-The-Morning To All_Of_You! - * ?> - * - * - * @param string $string The string to operate on. - * @param string $delimiters A list of word separators. - * - * @return string The string with all delimiter-separated words capitalized. - */ - public function capitalize(string $string, string $delimiters = " \n\t\r\0\x0B-"): string - { - return ucwords($string, $delimiters); - } - - /** - * Checks if the given string seems like it has utf8 characters in it. - * - * @param string $string The string to check for utf8 characters in. - */ - public function seemsUtf8(string $string): bool - { - for ($i = 0; $i < strlen($string); $i++) { - if (ord($string[$i]) < 0x80) { - continue; // 0bbbbbbb - } - - if ((ord($string[$i]) & 0xE0) === 0xC0) { - $n = 1; // 110bbbbb - } elseif ((ord($string[$i]) & 0xF0) === 0xE0) { - $n = 2; // 1110bbbb - } elseif ((ord($string[$i]) & 0xF8) === 0xF0) { - $n = 3; // 11110bbb - } elseif ((ord($string[$i]) & 0xFC) === 0xF8) { - $n = 4; // 111110bb - } elseif ((ord($string[$i]) & 0xFE) === 0xFC) { - $n = 5; // 1111110b - } else { - return false; // Does not match any model - } - - for ($j = 0; $j < $n; $j++) { // n bytes matching 10bbbbbb follow ? - if (++$i === strlen($string) || ((ord($string[$i]) & 0xC0) !== 0x80)) { - return false; - } - } - } - - return true; - } - - /** - * Remove any illegal characters, accents, etc. - * - * @param string $string String to unaccent - * - * @return string Unaccented string - */ - public function unaccent(string $string): string - { - if (preg_match('/[\x80-\xff]/', $string) === false) { - return $string; - } - - if ($this->seemsUtf8($string)) { - $string = strtr($string, self::ACCENTED_CHARACTERS); - } else { - $characters = []; - - // Assume ISO-8859-1 if not UTF-8 - $characters['in'] = - chr(128) - . chr(131) - . chr(138) - . chr(142) - . chr(154) - . chr(158) - . chr(159) - . chr(162) - . chr(165) - . chr(181) - . chr(192) - . chr(193) - . chr(194) - . chr(195) - . chr(196) - . chr(197) - . chr(199) - . chr(200) - . chr(201) - . chr(202) - . chr(203) - . chr(204) - . chr(205) - . chr(206) - . chr(207) - . chr(209) - . chr(210) - . chr(211) - . chr(212) - . chr(213) - . chr(214) - . chr(216) - . chr(217) - . chr(218) - . chr(219) - . chr(220) - . chr(221) - . chr(224) - . chr(225) - . chr(226) - . chr(227) - . chr(228) - . chr(229) - . chr(231) - . chr(232) - . chr(233) - . chr(234) - . chr(235) - . chr(236) - . chr(237) - . chr(238) - . chr(239) - . chr(241) - . chr(242) - . chr(243) - . chr(244) - . chr(245) - . chr(246) - . chr(248) - . chr(249) - . chr(250) - . chr(251) - . chr(252) - . chr(253) - . chr(255); - - $characters['out'] = 'EfSZszYcYuAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy'; - - $string = strtr($string, $characters['in'], $characters['out']); - - $doubleChars = []; - - $doubleChars['in'] = [ - chr(140), - chr(156), - chr(198), - chr(208), - chr(222), - chr(223), - chr(230), - chr(240), - chr(254), - ]; - - $doubleChars['out'] = ['OE', 'oe', 'AE', 'DH', 'TH', 'ss', 'ae', 'dh', 'th']; - - $string = str_replace($doubleChars['in'], $doubleChars['out'], $string); - } - - return $string; - } - - /** - * Convert any passed string to a url friendly string. - * Converts 'My first blog post' to 'my-first-blog-post' - * - * @param string $string String to urlize. - * - * @return string Urlized string. - */ - public function urlize(string $string): string - { - // Remove all non url friendly characters with the unaccent function - $unaccented = $this->unaccent($string); - - if (function_exists('mb_strtolower')) { - $lowered = mb_strtolower($unaccented); - } else { - $lowered = strtolower($unaccented); - } - - $replacements = [ - '/\W/' => ' ', - '/([A-Z]+)([A-Z][a-z])/' => '\1_\2', - '/([a-z\d])([A-Z])/' => '\1_\2', - '/[^A-Z^a-z^0-9^\/]+/' => '-', - ]; - - $urlized = $lowered; - - foreach ($replacements as $pattern => $replacement) { - $replaced = preg_replace($pattern, $replacement, $urlized); - - if ($replaced === null) { - throw new RuntimeException(sprintf( - 'preg_replace returned null for value "%s"', - $urlized - )); - } - - $urlized = $replaced; - } - - return trim($urlized, '-'); - } - - /** - * Returns a word in singular form. - * - * @param string $word The word in plural form. - * - * @return string The word in singular form. - */ - public function singularize(string $word): string - { - return $this->singularizer->inflect($word); - } - - /** - * Returns a word in plural form. - * - * @param string $word The word in singular form. - * - * @return string The word in plural form. - */ - public function pluralize(string $word): string - { - return $this->pluralizer->inflect($word); - } -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/InflectorFactory.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/InflectorFactory.php deleted file mode 100644 index a0740a74..00000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/InflectorFactory.php +++ /dev/null @@ -1,52 +0,0 @@ -getFlippedSubstitutions() - ); - } - - public static function getPluralRuleset(): Ruleset - { - return new Ruleset( - new Transformations(...Inflectible::getPlural()), - new Patterns(...Uninflected::getPlural()), - new Substitutions(...Inflectible::getIrregular()) - ); - } -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Uninflected.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Uninflected.php deleted file mode 100644 index 02257de1..00000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Uninflected.php +++ /dev/null @@ -1,189 +0,0 @@ -getFlippedSubstitutions() - ); - } - - public static function getPluralRuleset(): Ruleset - { - return new Ruleset( - new Transformations(...Inflectible::getPlural()), - new Patterns(...Uninflected::getPlural()), - new Substitutions(...Inflectible::getIrregular()) - ); - } -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Uninflected.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Uninflected.php deleted file mode 100644 index 9747f919..00000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Uninflected.php +++ /dev/null @@ -1,28 +0,0 @@ -getFlippedSubstitutions() - ); - } - - public static function getPluralRuleset(): Ruleset - { - return new Ruleset( - new Transformations(...Inflectible::getPlural()), - new Patterns(...Uninflected::getPlural()), - new Substitutions(...Inflectible::getIrregular()) - ); - } -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Uninflected.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Uninflected.php deleted file mode 100644 index 5d8d3b3a..00000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Uninflected.php +++ /dev/null @@ -1,30 +0,0 @@ -pattern = $pattern; - - if (isset($this->pattern[0]) && $this->pattern[0] === '/') { - $this->regex = $this->pattern; - } else { - $this->regex = '/' . $this->pattern . '/i'; - } - } - - public function getPattern(): string - { - return $this->pattern; - } - - public function getRegex(): string - { - return $this->regex; - } - - public function matches(string $word): bool - { - return preg_match($this->getRegex(), $word) === 1; - } -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Patterns.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Patterns.php deleted file mode 100644 index e8d45cb7..00000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Patterns.php +++ /dev/null @@ -1,34 +0,0 @@ -patterns = $patterns; - - $patterns = array_map(static function (Pattern $pattern): string { - return $pattern->getPattern(); - }, $this->patterns); - - $this->regex = '/^(?:' . implode('|', $patterns) . ')$/i'; - } - - public function matches(string $word): bool - { - return preg_match($this->regex, $word, $regs) === 1; - } -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Inflectible.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Inflectible.php deleted file mode 100644 index 0d41fe7e..00000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Inflectible.php +++ /dev/null @@ -1,98 +0,0 @@ -getFlippedSubstitutions() - ); - } - - public static function getPluralRuleset(): Ruleset - { - return new Ruleset( - new Transformations(...Inflectible::getPlural()), - new Patterns(...Uninflected::getPlural()), - new Substitutions(...Inflectible::getIrregular()) - ); - } -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Uninflected.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Uninflected.php deleted file mode 100644 index b8e988f8..00000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Uninflected.php +++ /dev/null @@ -1,32 +0,0 @@ -regular = $regular; - $this->uninflected = $uninflected; - $this->irregular = $irregular; - } - - public function getRegular(): Transformations - { - return $this->regular; - } - - public function getUninflected(): Patterns - { - return $this->uninflected; - } - - public function getIrregular(): Substitutions - { - return $this->irregular; - } -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Inflectible.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Inflectible.php deleted file mode 100644 index 91294609..00000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Inflectible.php +++ /dev/null @@ -1,47 +0,0 @@ -getFlippedSubstitutions() - ); - } - - public static function getPluralRuleset(): Ruleset - { - return new Ruleset( - new Transformations(...Inflectible::getPlural()), - new Patterns(...Uninflected::getPlural()), - new Substitutions(...Inflectible::getIrregular()) - ); - } -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Uninflected.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Uninflected.php deleted file mode 100644 index c26ebe9c..00000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Uninflected.php +++ /dev/null @@ -1,30 +0,0 @@ -from = $from; - $this->to = $to; - } - - public function getFrom(): Word - { - return $this->from; - } - - public function getTo(): Word - { - return $this->to; - } -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Substitutions.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Substitutions.php deleted file mode 100644 index 17ee2961..00000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Substitutions.php +++ /dev/null @@ -1,57 +0,0 @@ -substitutions[$substitution->getFrom()->getWord()] = $substitution; - } - } - - public function getFlippedSubstitutions(): Substitutions - { - $substitutions = []; - - foreach ($this->substitutions as $substitution) { - $substitutions[] = new Substitution( - $substitution->getTo(), - $substitution->getFrom() - ); - } - - return new Substitutions(...$substitutions); - } - - public function inflect(string $word): string - { - $lowerWord = strtolower($word); - - if (isset($this->substitutions[$lowerWord])) { - $firstLetterUppercase = $lowerWord[0] !== $word[0]; - - $toWord = $this->substitutions[$lowerWord]->getTo()->getWord(); - - if ($firstLetterUppercase) { - return strtoupper($toWord[0]) . substr($toWord, 1); - } - - return $toWord; - } - - return $word; - } -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformation.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformation.php deleted file mode 100644 index 30dcd594..00000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformation.php +++ /dev/null @@ -1,39 +0,0 @@ -pattern = $pattern; - $this->replacement = $replacement; - } - - public function getPattern(): Pattern - { - return $this->pattern; - } - - public function getReplacement(): string - { - return $this->replacement; - } - - public function inflect(string $word): string - { - return (string) preg_replace($this->pattern->getRegex(), $this->replacement, $word); - } -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformations.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformations.php deleted file mode 100644 index b6a48fa8..00000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformations.php +++ /dev/null @@ -1,29 +0,0 @@ -transformations = $transformations; - } - - public function inflect(string $word): string - { - foreach ($this->transformations as $transformation) { - if ($transformation->getPattern()->matches($word)) { - return $transformation->inflect($word); - } - } - - return $word; - } -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Inflectible.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Inflectible.php deleted file mode 100644 index a2bda0d9..00000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Inflectible.php +++ /dev/null @@ -1,34 +0,0 @@ -getFlippedSubstitutions() - ); - } - - public static function getPluralRuleset(): Ruleset - { - return new Ruleset( - new Transformations(...Inflectible::getPlural()), - new Patterns(...Uninflected::getPlural()), - new Substitutions(...Inflectible::getIrregular()) - ); - } -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Uninflected.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Uninflected.php deleted file mode 100644 index ec1c37dd..00000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Uninflected.php +++ /dev/null @@ -1,30 +0,0 @@ -word = $word; - } - - public function getWord(): string - { - return $this->word; - } -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/RulesetInflector.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/RulesetInflector.php deleted file mode 100644 index 12b2ed5b..00000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/RulesetInflector.php +++ /dev/null @@ -1,56 +0,0 @@ -rulesets = array_merge([$ruleset], $rulesets); - } - - public function inflect(string $word): string - { - if ($word === '') { - return ''; - } - - foreach ($this->rulesets as $ruleset) { - if ($ruleset->getUninflected()->matches($word)) { - return $word; - } - - $inflected = $ruleset->getIrregular()->inflect($word); - - if ($inflected !== $word) { - return $inflected; - } - - $inflected = $ruleset->getRegular()->inflect($word); - - if ($inflected !== $word) { - return $inflected; - } - } - - return $word; - } -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/WordInflector.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/WordInflector.php deleted file mode 100644 index b88b1d69..00000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/WordInflector.php +++ /dev/null @@ -1,10 +0,0 @@ -instantiate(\My\ClassName\Here::class); -``` - -## Contributing - -Please read the [CONTRIBUTING.md](CONTRIBUTING.md) contents if you wish to help out! - -## Credits - -This library was migrated from [ocramius/instantiator](https://github.com/Ocramius/Instantiator), which -has been donated to the doctrine organization, and which is now deprecated in favour of this package. diff --git a/vendor/doctrine/instantiator/composer.json b/vendor/doctrine/instantiator/composer.json deleted file mode 100644 index 4fba95ca..00000000 --- a/vendor/doctrine/instantiator/composer.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "doctrine/instantiator", - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "type": "library", - "license": "MIT", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "instantiate", - "constructor" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" - } - ], - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "ext-phar": "*", - "ext-pdo": "*", - "doctrine/coding-standard": "^9", - "phpbench/phpbench": "^0.16 || ^1", - "phpstan/phpstan": "^1.4", - "phpstan/phpstan-phpunit": "^1", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.22" - }, - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "autoload-dev": { - "psr-0": { - "DoctrineTest\\InstantiatorPerformance\\": "tests", - "DoctrineTest\\InstantiatorTest\\": "tests", - "DoctrineTest\\InstantiatorTestAsset\\": "tests" - } - }, - "config": { - "allow-plugins": { - "dealerdirect/phpcodesniffer-composer-installer": true - } - } -} diff --git a/vendor/doctrine/instantiator/docs/en/index.rst b/vendor/doctrine/instantiator/docs/en/index.rst deleted file mode 100644 index 0c85da0b..00000000 --- a/vendor/doctrine/instantiator/docs/en/index.rst +++ /dev/null @@ -1,68 +0,0 @@ -Introduction -============ - -This library provides a way of avoiding usage of constructors when instantiating PHP classes. - -Installation -============ - -The suggested installation method is via `composer`_: - -.. code-block:: console - - $ composer require doctrine/instantiator - -Usage -===== - -The instantiator is able to create new instances of any class without -using the constructor or any API of the class itself: - -.. code-block:: php - - instantiate(User::class); - -Contributing -============ - -- Follow the `Doctrine Coding Standard`_ -- The project will follow strict `object calisthenics`_ -- Any contribution must provide tests for additional introduced - conditions -- Any un-confirmed issue needs a failing test case before being - accepted -- Pull requests must be sent from a new hotfix/feature branch, not from - ``master``. - -Testing -======= - -The PHPUnit version to be used is the one installed as a dev- dependency -via composer: - -.. code-block:: console - - $ ./vendor/bin/phpunit - -Accepted coverage for new contributions is 80%. Any contribution not -satisfying this requirement won’t be merged. - -Credits -======= - -This library was migrated from `ocramius/instantiator`_, which has been -donated to the doctrine organization, and which is now deprecated in -favour of this package. - -.. _composer: https://getcomposer.org/ -.. _CONTRIBUTING.md: CONTRIBUTING.md -.. _ocramius/instantiator: https://github.com/Ocramius/Instantiator -.. _Doctrine Coding Standard: https://github.com/doctrine/coding-standard -.. _object calisthenics: http://www.slideshare.net/guilhermeblanco/object-calisthenics-applied-to-php diff --git a/vendor/doctrine/instantiator/docs/en/sidebar.rst b/vendor/doctrine/instantiator/docs/en/sidebar.rst deleted file mode 100644 index 0c364791..00000000 --- a/vendor/doctrine/instantiator/docs/en/sidebar.rst +++ /dev/null @@ -1,4 +0,0 @@ -.. toctree:: - :depth: 3 - - index diff --git a/vendor/doctrine/instantiator/psalm.xml b/vendor/doctrine/instantiator/psalm.xml deleted file mode 100644 index e6270c13..00000000 --- a/vendor/doctrine/instantiator/psalm.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - diff --git a/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/ExceptionInterface.php b/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/ExceptionInterface.php deleted file mode 100644 index e6a5195f..00000000 --- a/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/ExceptionInterface.php +++ /dev/null @@ -1,12 +0,0 @@ - $reflectionClass - * - * @template T of object - */ - public static function fromAbstractClass(ReflectionClass $reflectionClass): self - { - return new self(sprintf( - 'The provided class "%s" is abstract, and cannot be instantiated', - $reflectionClass->getName() - )); - } - - public static function fromEnum(string $className): self - { - return new self(sprintf( - 'The provided class "%s" is an enum, and cannot be instantiated', - $className - )); - } -} diff --git a/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/UnexpectedValueException.php b/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/UnexpectedValueException.php deleted file mode 100644 index 4e55ac52..00000000 --- a/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/UnexpectedValueException.php +++ /dev/null @@ -1,59 +0,0 @@ - $reflectionClass - * - * @template T of object - */ - public static function fromSerializationTriggeredException( - ReflectionClass $reflectionClass, - Exception $exception - ): self { - return new self( - sprintf( - 'An exception was raised while trying to instantiate an instance of "%s" via un-serialization', - $reflectionClass->getName() - ), - 0, - $exception - ); - } - - /** - * @phpstan-param ReflectionClass $reflectionClass - * - * @template T of object - */ - public static function fromUncleanUnSerialization( - ReflectionClass $reflectionClass, - string $errorString, - int $errorCode, - string $errorFile, - int $errorLine - ): self { - return new self( - sprintf( - 'Could not produce an instance of "%s" via un-serialization, since an error was triggered ' - . 'in file "%s" at line "%d"', - $reflectionClass->getName(), - $errorFile, - $errorLine - ), - 0, - new Exception($errorString, $errorCode) - ); - } -} diff --git a/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Instantiator.php b/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Instantiator.php deleted file mode 100644 index d616fa4d..00000000 --- a/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Instantiator.php +++ /dev/null @@ -1,260 +0,0 @@ - $className - * - * @return object - * @phpstan-return T - * - * @throws ExceptionInterface - * - * @template T of object - */ - public function instantiate($className) - { - if (isset(self::$cachedCloneables[$className])) { - /** - * @phpstan-var T - */ - $cachedCloneable = self::$cachedCloneables[$className]; - - return clone $cachedCloneable; - } - - if (isset(self::$cachedInstantiators[$className])) { - $factory = self::$cachedInstantiators[$className]; - - return $factory(); - } - - return $this->buildAndCacheFromFactory($className); - } - - /** - * Builds the requested object and caches it in static properties for performance - * - * @phpstan-param class-string $className - * - * @return object - * @phpstan-return T - * - * @template T of object - */ - private function buildAndCacheFromFactory(string $className) - { - $factory = self::$cachedInstantiators[$className] = $this->buildFactory($className); - $instance = $factory(); - - if ($this->isSafeToClone(new ReflectionClass($instance))) { - self::$cachedCloneables[$className] = clone $instance; - } - - return $instance; - } - - /** - * Builds a callable capable of instantiating the given $className without - * invoking its constructor. - * - * @phpstan-param class-string $className - * - * @phpstan-return callable(): T - * - * @throws InvalidArgumentException - * @throws UnexpectedValueException - * @throws ReflectionException - * - * @template T of object - */ - private function buildFactory(string $className): callable - { - $reflectionClass = $this->getReflectionClass($className); - - if ($this->isInstantiableViaReflection($reflectionClass)) { - return [$reflectionClass, 'newInstanceWithoutConstructor']; - } - - $serializedString = sprintf( - '%s:%d:"%s":0:{}', - is_subclass_of($className, Serializable::class) ? self::SERIALIZATION_FORMAT_USE_UNSERIALIZER : self::SERIALIZATION_FORMAT_AVOID_UNSERIALIZER, - strlen($className), - $className - ); - - $this->checkIfUnSerializationIsSupported($reflectionClass, $serializedString); - - return static function () use ($serializedString) { - return unserialize($serializedString); - }; - } - - /** - * @phpstan-param class-string $className - * - * @phpstan-return ReflectionClass - * - * @throws InvalidArgumentException - * @throws ReflectionException - * - * @template T of object - */ - private function getReflectionClass(string $className): ReflectionClass - { - if (! class_exists($className)) { - throw InvalidArgumentException::fromNonExistingClass($className); - } - - if (PHP_VERSION_ID >= 80100 && enum_exists($className, false)) { - throw InvalidArgumentException::fromEnum($className); - } - - $reflection = new ReflectionClass($className); - - if ($reflection->isAbstract()) { - throw InvalidArgumentException::fromAbstractClass($reflection); - } - - return $reflection; - } - - /** - * @phpstan-param ReflectionClass $reflectionClass - * - * @throws UnexpectedValueException - * - * @template T of object - */ - private function checkIfUnSerializationIsSupported(ReflectionClass $reflectionClass, string $serializedString): void - { - set_error_handler(static function (int $code, string $message, string $file, int $line) use ($reflectionClass, &$error): bool { - $error = UnexpectedValueException::fromUncleanUnSerialization( - $reflectionClass, - $message, - $code, - $file, - $line - ); - - return true; - }); - - try { - $this->attemptInstantiationViaUnSerialization($reflectionClass, $serializedString); - } finally { - restore_error_handler(); - } - - if ($error) { - throw $error; - } - } - - /** - * @phpstan-param ReflectionClass $reflectionClass - * - * @throws UnexpectedValueException - * - * @template T of object - */ - private function attemptInstantiationViaUnSerialization(ReflectionClass $reflectionClass, string $serializedString): void - { - try { - unserialize($serializedString); - } catch (Exception $exception) { - throw UnexpectedValueException::fromSerializationTriggeredException($reflectionClass, $exception); - } - } - - /** - * @phpstan-param ReflectionClass $reflectionClass - * - * @template T of object - */ - private function isInstantiableViaReflection(ReflectionClass $reflectionClass): bool - { - return ! ($this->hasInternalAncestors($reflectionClass) && $reflectionClass->isFinal()); - } - - /** - * Verifies whether the given class is to be considered internal - * - * @phpstan-param ReflectionClass $reflectionClass - * - * @template T of object - */ - private function hasInternalAncestors(ReflectionClass $reflectionClass): bool - { - do { - if ($reflectionClass->isInternal()) { - return true; - } - - $reflectionClass = $reflectionClass->getParentClass(); - } while ($reflectionClass); - - return false; - } - - /** - * Checks if a class is cloneable - * - * Classes implementing `__clone` cannot be safely cloned, as that may cause side-effects. - * - * @phpstan-param ReflectionClass $reflectionClass - * - * @template T of object - */ - private function isSafeToClone(ReflectionClass $reflectionClass): bool - { - return $reflectionClass->isCloneable() - && ! $reflectionClass->hasMethod('__clone') - && ! $reflectionClass->isSubclassOf(ArrayIterator::class); - } -} diff --git a/vendor/doctrine/instantiator/src/Doctrine/Instantiator/InstantiatorInterface.php b/vendor/doctrine/instantiator/src/Doctrine/Instantiator/InstantiatorInterface.php deleted file mode 100644 index 10508b56..00000000 --- a/vendor/doctrine/instantiator/src/Doctrine/Instantiator/InstantiatorInterface.php +++ /dev/null @@ -1,24 +0,0 @@ - $className - * - * @return object - * @phpstan-return T - * - * @throws ExceptionInterface - * - * @template T of object - */ - public function instantiate($className); -} diff --git a/vendor/doctrine/lexer/LICENSE b/vendor/doctrine/lexer/LICENSE deleted file mode 100644 index e8fdec4a..00000000 --- a/vendor/doctrine/lexer/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2006-2018 Doctrine Project - -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/doctrine/lexer/README.md b/vendor/doctrine/lexer/README.md deleted file mode 100644 index 784f2a27..00000000 --- a/vendor/doctrine/lexer/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Doctrine Lexer - -[![Build Status](https://github.com/doctrine/lexer/workflows/Continuous%20Integration/badge.svg)](https://github.com/doctrine/lexer/actions) - -Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers. - -This lexer is used in Doctrine Annotations and in Doctrine ORM (DQL). - -https://www.doctrine-project.org/projects/lexer.html diff --git a/vendor/doctrine/lexer/composer.json b/vendor/doctrine/lexer/composer.json deleted file mode 100644 index c4356477..00000000 --- a/vendor/doctrine/lexer/composer.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "doctrine/lexer", - "type": "library", - "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", - "keywords": [ - "php", - "parser", - "lexer", - "annotations", - "docblock" - ], - "homepage": "https://www.doctrine-project.org/projects/lexer.html", - "license": "MIT", - "authors": [ - {"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"}, - {"name": "Roman Borschel", "email": "roman@code-factory.org"}, - {"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"} - ], - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^9.0", - "phpstan/phpstan": "^1.3", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.11" - }, - "autoload": { - "psr-4": { "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" } - }, - "autoload-dev": { - "psr-4": { "Doctrine\\Tests\\": "tests/Doctrine" } - }, - "config": { - "allow-plugins": { - "composer/package-versions-deprecated": true, - "dealerdirect/phpcodesniffer-composer-installer": true - }, - "sort-packages": true - } -} diff --git a/vendor/doctrine/lexer/lib/Doctrine/Common/Lexer/AbstractLexer.php b/vendor/doctrine/lexer/lib/Doctrine/Common/Lexer/AbstractLexer.php deleted file mode 100644 index 7e8a11d4..00000000 --- a/vendor/doctrine/lexer/lib/Doctrine/Common/Lexer/AbstractLexer.php +++ /dev/null @@ -1,337 +0,0 @@ - - */ - private $tokens = []; - - /** - * Current lexer position in input string. - * - * @var int - */ - private $position = 0; - - /** - * Current peek of current lexer position. - * - * @var int - */ - private $peek = 0; - - /** - * The next token in the input. - * - * @var mixed[]|null - * @psalm-var Token|null - */ - public $lookahead; - - /** - * The last matched/seen token. - * - * @var mixed[]|null - * @psalm-var Token|null - */ - public $token; - - /** - * Composed regex for input parsing. - * - * @var string|null - */ - private $regex; - - /** - * Sets the input data to be tokenized. - * - * The Lexer is immediately reset and the new input tokenized. - * Any unprocessed tokens from any previous input are lost. - * - * @param string $input The input to be tokenized. - * - * @return void - */ - public function setInput($input) - { - $this->input = $input; - $this->tokens = []; - - $this->reset(); - $this->scan($input); - } - - /** - * Resets the lexer. - * - * @return void - */ - public function reset() - { - $this->lookahead = null; - $this->token = null; - $this->peek = 0; - $this->position = 0; - } - - /** - * Resets the peek pointer to 0. - * - * @return void - */ - public function resetPeek() - { - $this->peek = 0; - } - - /** - * Resets the lexer position on the input to the given position. - * - * @param int $position Position to place the lexical scanner. - * - * @return void - */ - public function resetPosition($position = 0) - { - $this->position = $position; - } - - /** - * Retrieve the original lexer's input until a given position. - * - * @param int $position - * - * @return string - */ - public function getInputUntilPosition($position) - { - return substr($this->input, 0, $position); - } - - /** - * Checks whether a given token matches the current lookahead. - * - * @param int|string $type - * - * @return bool - */ - public function isNextToken($type) - { - return $this->lookahead !== null && $this->lookahead['type'] === $type; - } - - /** - * Checks whether any of the given tokens matches the current lookahead. - * - * @param list $types - * - * @return bool - */ - public function isNextTokenAny(array $types) - { - return $this->lookahead !== null && in_array($this->lookahead['type'], $types, true); - } - - /** - * Moves to the next token in the input string. - * - * @return bool - */ - public function moveNext() - { - $this->peek = 0; - $this->token = $this->lookahead; - $this->lookahead = isset($this->tokens[$this->position]) - ? $this->tokens[$this->position++] : null; - - return $this->lookahead !== null; - } - - /** - * Tells the lexer to skip input tokens until it sees a token with the given value. - * - * @param string $type The token type to skip until. - * - * @return void - */ - public function skipUntil($type) - { - while ($this->lookahead !== null && $this->lookahead['type'] !== $type) { - $this->moveNext(); - } - } - - /** - * Checks if given value is identical to the given token. - * - * @param mixed $value - * @param int|string $token - * - * @return bool - */ - public function isA($value, $token) - { - return $this->getType($value) === $token; - } - - /** - * Moves the lookahead token forward. - * - * @return mixed[]|null The next token or NULL if there are no more tokens ahead. - * @psalm-return Token|null - */ - public function peek() - { - if (isset($this->tokens[$this->position + $this->peek])) { - return $this->tokens[$this->position + $this->peek++]; - } - - return null; - } - - /** - * Peeks at the next token, returns it and immediately resets the peek. - * - * @return mixed[]|null The next token or NULL if there are no more tokens ahead. - * @psalm-return Token|null - */ - public function glimpse() - { - $peek = $this->peek(); - $this->peek = 0; - - return $peek; - } - - /** - * Scans the input string for tokens. - * - * @param string $input A query string. - * - * @return void - */ - protected function scan($input) - { - if (! isset($this->regex)) { - $this->regex = sprintf( - '/(%s)|%s/%s', - implode(')|(', $this->getCatchablePatterns()), - implode('|', $this->getNonCatchablePatterns()), - $this->getModifiers() - ); - } - - $flags = PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_OFFSET_CAPTURE; - $matches = preg_split($this->regex, $input, -1, $flags); - - if ($matches === false) { - // Work around https://bugs.php.net/78122 - $matches = [[$input, 0]]; - } - - foreach ($matches as $match) { - // Must remain before 'value' assignment since it can change content - $type = $this->getType($match[0]); - - $this->tokens[] = [ - 'value' => $match[0], - 'type' => $type, - 'position' => $match[1], - ]; - } - } - - /** - * Gets the literal for a given token. - * - * @param int|string $token - * - * @return int|string - */ - public function getLiteral($token) - { - $className = static::class; - $reflClass = new ReflectionClass($className); - $constants = $reflClass->getConstants(); - - foreach ($constants as $name => $value) { - if ($value === $token) { - return $className . '::' . $name; - } - } - - return $token; - } - - /** - * Regex modifiers - * - * @return string - */ - protected function getModifiers() - { - return 'iu'; - } - - /** - * Lexical catchable patterns. - * - * @return string[] - */ - abstract protected function getCatchablePatterns(); - - /** - * Lexical non-catchable patterns. - * - * @return string[] - */ - abstract protected function getNonCatchablePatterns(); - - /** - * Retrieve token type. Also processes the token value if necessary. - * - * @param string $value - * - * @return int|string|null - */ - abstract protected function getType(&$value); -} diff --git a/vendor/doctrine/lexer/psalm.xml b/vendor/doctrine/lexer/psalm.xml deleted file mode 100644 index f331e50c..00000000 --- a/vendor/doctrine/lexer/psalm.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - diff --git a/vendor/dragonmantank/cron-expression/CHANGELOG.md b/vendor/dragonmantank/cron-expression/CHANGELOG.md deleted file mode 100644 index 7b6df4b1..00000000 --- a/vendor/dragonmantank/cron-expression/CHANGELOG.md +++ /dev/null @@ -1,228 +0,0 @@ -# Change Log - -## [3.3.2] - 2022-09-19 - -### Added -- N/A - -### Changed -- Skip some daylight savings time tests for PHP 8.1 daylight savings time weirdness (#146) - -### Fixed -- Changed string interpolations to work better with PHP 8.2 (#142) - -## [3.3.1] - 2022-01-18 - -### Added -- N/A - -### Changed -- N/A - -### Fixed -- Fixed issue when timezones had no transition, which can occur over very short timespans (#134) - -## [3.3.0] - 2022-01-13 - -### Added -- Added ability to register your own expression aliases (#132) - -### Changed -- Changed how Day of Week and Day of Month resolve when one or the other is `*` or `?` - -### Fixed -- PHPStan should no longer error out - -## [3.2.4] - 2022-01-12 - -### Added -- N/A - -### Changed -- Changed how Day of Week increment/decrement to help with DST changes (#131) - -### Fixed -- N/A - -## [3.2.3] - 2022-01-05 - -### Added -- N/A - -### Changed -- Changed how minutes and hours increment/decrement to help with DST changes (#131) - -### Fixed -- N/A - -## [3.2.2] - 2022-01-05 - -### Added -- N/A - -### Changed -- Marked some methods `@internal` (#124) - -### Fixed -- Fixed issue with small ranges and large steps that caused an error with `range()` (#88) -- Fixed issue where wraparound logic incorrectly considered high bound on range (#89) - -## [3.2.1] - 2022-01-04 - -### Added -- N/A - -### Changed -- Added PHP 8.1 to testing (#125) - -### Fixed -- Allow better mixture of ranges, steps, and lists (#122) -- Fixed return order when multiple dates are requested and inverted (#121) -- Better handling over DST (#115) -- Fixed PHPStan tests (#130) - -## [3.2.0] - 2022-01-04 - -### Added -- Added alias for `@midnight` (#117) - -### Changed -- Improved testing for instance of field in tests (#105) -- Optimization for determining multiple run dates (#75) -- `CronExpression` properties changed from private to protected (#106) - -### Fixed -- N/A - -## [3.1.0] - 2020-11-24 - -### Added -- Added `CronExpression::getParts()` method to get parts of the expression as an array (#83) - -### Changed -- Changed to Interfaces for some type hints (#97, #86) -- Dropped minimum PHP version to 7.2 -- Few syntax changes for phpstan compatibility (#93) - -### Fixed -- N/A - -### Deprecated -- Deprecated `CronExpression::factory` in favor of the constructor (#56) -- Deprecated `CronExpression::YEAR` as a formality, the functionality is already removed (#87) - -## [3.0.1] - 2020-10-12 -### Added -- Added support for PHP 8 (#92) -### Changed -- N/A -### Fixed -- N/A - -## [3.0.0] - 2020-03-25 - -**MAJOR CHANGE** - In previous versions of this library, setting both a "Day of Month" and a "Day of Week" would be interpreted as an `AND` statement, not an `OR` statement. For example: - -`30 0 1 * 1` - -would evaluate to "Run 30 minutes after the 0 hour when the Day Of Month is 1 AND a Monday" instead of "Run 30 minutes after the 0 hour on Day Of Month 1 OR a Monday", where the latter is more inline with most cron systems. This means that if your cron expression has both of these fields set, you may see your expression fire more often starting with v3.0.0. - -### Added -- Additional docblocks for IDE and documentation -- Added phpstan as a development dependency -- Added a `Cron\FieldFactoryInterface` to make migrations easier (#38) -### Changed -- Changed some DI testing during TravisCI runs -- `\Cron\CronExpression::determineTimezone()` now checks for `\DateTimeInterface` instead of just `\DateTime` -- Errors with fields now report a more human-understandable error and are 1-based instead of 0-based -- Better support for `\DateTimeImmutable` across the library by typehinting for `\DateTimeInterface` now -- Literals should now be less case-sensative across the board -- Changed logic for when both a Day of Week and a Day of Month are supplied to now be an OR statement, not an AND -### Fixed -- Fixed infinite loop when determining last day of week from literals -- Fixed bug where single number ranges were allowed (ex: `1/10`) -- Fixed nullable FieldFactory in CronExpression where no factory could be supplied -- Fixed issue where logic for dropping seconds to 0 could lead to a timezone change - -## [2.3.1] - 2020-10-12 -### Added -- Added support for PHP 8 (#92) -### Changed -- N/A -### Fixed -- N/A - -## [2.3.0] - 2019-03-30 -### Added -- Added support for DateTimeImmutable via DateTimeInterface -- Added support for PHP 7.3 -- Started listing projects that use the library -### Changed -- Errors should now report a human readable position in the cron expression, instead of starting at 0 -### Fixed -- N/A - -## [2.2.0] - 2018-06-05 -### Added -- Added support for steps larger than field ranges (#6) -## Changed -- N/A -### Fixed -- Fixed validation for numbers with leading 0s (#12) - -## [2.1.0] - 2018-04-06 -### Added -- N/A -### Changed -- Upgraded to PHPUnit 6 (#2) -### Fixed -- Refactored timezones to deal with some inconsistent behavior (#3) -- Allow ranges and lists in same expression (#5) -- Fixed regression where literals were not converted to their numerical counterpart (#) - -## [2.0.0] - 2017-10-12 -### Added -- N/A - -### Changed -- Dropped support for PHP 5.x -- Dropped support for the YEAR field, as it was not part of the cron standard - -### Fixed -- Reworked validation for all the field types -- Stepping should now work for 1-indexed fields like Month (#153) - -## [1.2.0] - 2017-01-22 -### Added -- Added IDE, CodeSniffer, and StyleCI.IO support - -### Changed -- Switched to PSR-4 Autoloading - -### Fixed -- 0 step expressions are handled better -- Fixed `DayOfMonth` validation to be more strict -- Typos - -## [1.1.0] - 2016-01-26 -### Added -- Support for non-hourly offset timezones -- Checks for valid expressions - -### Changed -- Max Iterations no longer hardcoded for `getRunDate()` -- Supports DateTimeImmutable for newer PHP verions - -### Fixed -- Fixed looping bug for PHP 7 when determining the last specified weekday of a month - -## [1.0.3] - 2013-11-23 -### Added -- Now supports expressions with any number of extra spaces, tabs, or newlines - -### Changed -- Using static instead of self in `CronExpression::factory` - -### Fixed -- Fixes issue [#28](https://github.com/mtdowling/cron-expression/issues/28) where PHP increments of ranges were failing due to PHP casting hyphens to 0 -- Only set default timezone if the given $currentTime is not a DateTime instance ([#34](https://github.com/mtdowling/cron-expression/issues/34)) diff --git a/vendor/dragonmantank/cron-expression/LICENSE b/vendor/dragonmantank/cron-expression/LICENSE deleted file mode 100644 index 3e38bbc8..00000000 --- a/vendor/dragonmantank/cron-expression/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011 Michael Dowling , 2016 Chris Tankersley , and contributors - -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/dragonmantank/cron-expression/README.md b/vendor/dragonmantank/cron-expression/README.md deleted file mode 100644 index e853ad45..00000000 --- a/vendor/dragonmantank/cron-expression/README.md +++ /dev/null @@ -1,87 +0,0 @@ -PHP Cron Expression Parser -========================== - -[![Latest Stable Version](https://poser.pugx.org/dragonmantank/cron-expression/v/stable.png)](https://packagist.org/packages/dragonmantank/cron-expression) [![Total Downloads](https://poser.pugx.org/dragonmantank/cron-expression/downloads.png)](https://packagist.org/packages/dragonmantank/cron-expression) [![Build Status](https://secure.travis-ci.org/dragonmantank/cron-expression.png)](http://travis-ci.org/dragonmantank/cron-expression) [![StyleCI](https://github.styleci.io/repos/103715337/shield?branch=master)](https://github.styleci.io/repos/103715337) - -The PHP cron expression parser can parse a CRON expression, determine if it is -due to run, calculate the next run date of the expression, and calculate the previous -run date of the expression. You can calculate dates far into the future or past by -skipping **n** number of matching dates. - -The parser can handle increments of ranges (e.g. */12, 2-59/3), intervals (e.g. 0-9), -lists (e.g. 1,2,3), **W** to find the nearest weekday for a given day of the month, **L** to -find the last day of the month, **L** to find the last given weekday of a month, and hash -(#) to find the nth weekday of a given month. - -More information about this fork can be found in the blog post [here](http://ctankersley.com/2017/10/12/cron-expression-update/). tl;dr - v2.0.0 is a major breaking change, and @dragonmantank can better take care of the project in a separate fork. - -Installing -========== - -Add the dependency to your project: - -```bash -composer require dragonmantank/cron-expression -``` - -Usage -===== -```php -isDue(); -echo $cron->getNextRunDate()->format('Y-m-d H:i:s'); -echo $cron->getPreviousRunDate()->format('Y-m-d H:i:s'); - -// Works with complex expressions -$cron = new Cron\CronExpression('3-59/15 6-12 */15 1 2-5'); -echo $cron->getNextRunDate()->format('Y-m-d H:i:s'); - -// Calculate a run date two iterations into the future -$cron = new Cron\CronExpression('@daily'); -echo $cron->getNextRunDate(null, 2)->format('Y-m-d H:i:s'); - -// Calculate a run date relative to a specific time -$cron = new Cron\CronExpression('@monthly'); -echo $cron->getNextRunDate('2010-01-12 00:00:00')->format('Y-m-d H:i:s'); -``` - -CRON Expressions -================ - -A CRON expression is a string representing the schedule for a particular command to execute. The parts of a CRON schedule are as follows: - - * * * * * - - - - - - - | | | | | - | | | | | - | | | | +----- day of week (0 - 7) (Sunday=0 or 7) - | | | +---------- month (1 - 12) - | | +--------------- day of month (1 - 31) - | +-------------------- hour (0 - 23) - +------------------------- min (0 - 59) - -This library also supports a few macros: - -* `@yearly`, `@annually` - Run once a year, midnight, Jan. 1 - `0 0 1 1 *` -* `@monthly` - Run once a month, midnight, first of month - `0 0 1 * *` -* `@weekly` - Run once a week, midnight on Sun - `0 0 * * 0` -* `@daily`, `@midnight` - Run once a day, midnight - `0 0 * * *` -* `@hourly` - Run once an hour, first minute - `0 * * * *` - -Requirements -============ - -- PHP 7.2+ -- PHPUnit is required to run the unit tests -- Composer is required to run the unit tests - -Projects that Use cron-expression -================================= -* Part of the [Laravel Framework](https://github.com/laravel/framework/) -* Available as a [Symfony Bundle - setono/cron-expression-bundle](https://github.com/Setono/CronExpressionBundle) -* Framework agnostic, PHP-based job scheduler - [Crunz](https://github.com/lavary/crunz) diff --git a/vendor/dragonmantank/cron-expression/composer.json b/vendor/dragonmantank/cron-expression/composer.json deleted file mode 100644 index 657a5b47..00000000 --- a/vendor/dragonmantank/cron-expression/composer.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "dragonmantank/cron-expression", - "type": "library", - "description": "CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due", - "keywords": ["cron", "schedule"], - "license": "MIT", - "authors": [ - { - "name": "Chris Tankersley", - "email": "chris@ctankersley.com", - "homepage": "https://github.com/dragonmantank" - } - ], - "require": { - "php": "^7.2|^8.0", - "webmozart/assert": "^1.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.0", - "phpunit/phpunit": "^7.0|^8.0|^9.0", - "phpstan/phpstan-webmozart-assert": "^1.0", - "phpstan/extension-installer": "^1.0" - }, - "autoload": { - "psr-4": { - "Cron\\": "src/Cron/" - } - }, - "autoload-dev": { - "psr-4": { - "Cron\\Tests\\": "tests/Cron/" - } - }, - "replace": { - "mtdowling/cron-expression": "^1.0" - }, - "scripts": { - "phpstan": "./vendor/bin/phpstan analyze", - "test": "phpunit" - }, - "config": { - "allow-plugins": { - "ocramius/package-versions": true, - "phpstan/extension-installer": true - } - } -} diff --git a/vendor/dragonmantank/cron-expression/phpstan.neon b/vendor/dragonmantank/cron-expression/phpstan.neon deleted file mode 100644 index bea9cb0d..00000000 --- a/vendor/dragonmantank/cron-expression/phpstan.neon +++ /dev/null @@ -1,15 +0,0 @@ -parameters: - checkMissingIterableValueType: false - - ignoreErrors: - - '#Call to an undefined method DateTimeInterface::add\(\)#' - - '#Call to an undefined method DateTimeInterface::modify\(\)#' - - '#Call to an undefined method DateTimeInterface::setDate\(\)#' - - '#Call to an undefined method DateTimeInterface::setTime\(\)#' - - '#Call to an undefined method DateTimeInterface::setTimezone\(\)#' - - '#Call to an undefined method DateTimeInterface::sub\(\)#' - - level: max - - paths: - - src/ diff --git a/vendor/dragonmantank/cron-expression/src/Cron/AbstractField.php b/vendor/dragonmantank/cron-expression/src/Cron/AbstractField.php deleted file mode 100644 index df2848df..00000000 --- a/vendor/dragonmantank/cron-expression/src/Cron/AbstractField.php +++ /dev/null @@ -1,346 +0,0 @@ -fullRange = range($this->rangeStart, $this->rangeEnd); - } - - /** - * Check to see if a field is satisfied by a value. - * - * @internal - * @param int $dateValue Date value to check - * @param string $value Value to test - * - * @return bool - */ - public function isSatisfied(int $dateValue, string $value): bool - { - if ($this->isIncrementsOfRanges($value)) { - return $this->isInIncrementsOfRanges($dateValue, $value); - } - - if ($this->isRange($value)) { - return $this->isInRange($dateValue, $value); - } - - return '*' === $value || $dateValue === (int) $value; - } - - /** - * Check if a value is a range. - * - * @internal - * @param string $value Value to test - * - * @return bool - */ - public function isRange(string $value): bool - { - return false !== strpos($value, '-'); - } - - /** - * Check if a value is an increments of ranges. - * - * @internal - * @param string $value Value to test - * - * @return bool - */ - public function isIncrementsOfRanges(string $value): bool - { - return false !== strpos($value, '/'); - } - - /** - * Test if a value is within a range. - * - * @internal - * @param int $dateValue Set date value - * @param string $value Value to test - * - * @return bool - */ - public function isInRange(int $dateValue, $value): bool - { - $parts = array_map( - function ($value) { - $value = trim($value); - - return $this->convertLiterals($value); - }, - explode('-', $value, 2) - ); - - return $dateValue >= $parts[0] && $dateValue <= $parts[1]; - } - - /** - * Test if a value is within an increments of ranges (offset[-to]/step size). - * - * @internal - * @param int $dateValue Set date value - * @param string $value Value to test - * - * @return bool - */ - public function isInIncrementsOfRanges(int $dateValue, string $value): bool - { - $chunks = array_map('trim', explode('/', $value, 2)); - $range = $chunks[0]; - $step = $chunks[1] ?? 0; - - // No step or 0 steps aren't cool - /** @phpstan-ignore-next-line */ - if (null === $step || '0' === $step || 0 === $step) { - return false; - } - - // Expand the * to a full range - if ('*' === $range) { - $range = $this->rangeStart . '-' . $this->rangeEnd; - } - - // Generate the requested small range - $rangeChunks = explode('-', $range, 2); - $rangeStart = (int) $rangeChunks[0]; - $rangeEnd = $rangeChunks[1] ?? $rangeStart; - $rangeEnd = (int) $rangeEnd; - - if ($rangeStart < $this->rangeStart || $rangeStart > $this->rangeEnd || $rangeStart > $rangeEnd) { - throw new \OutOfRangeException('Invalid range start requested'); - } - - if ($rangeEnd < $this->rangeStart || $rangeEnd > $this->rangeEnd || $rangeEnd < $rangeStart) { - throw new \OutOfRangeException('Invalid range end requested'); - } - - // Steps larger than the range need to wrap around and be handled - // slightly differently than smaller steps - - // UPDATE - This is actually false. The C implementation will allow a - // larger step as valid syntax, it never wraps around. It will stop - // once it hits the end. Unfortunately this means in future versions - // we will not wrap around. However, because the logic exists today - // per the above documentation, fixing the bug from #89 - if ($step > $this->rangeEnd) { - $thisRange = [$this->fullRange[$step % \count($this->fullRange)]]; - } else { - if ($step > ($rangeEnd - $rangeStart)) { - $thisRange[$rangeStart] = (int) $rangeStart; - } else { - $thisRange = range($rangeStart, $rangeEnd, (int) $step); - } - } - - return \in_array($dateValue, $thisRange, true); - } - - /** - * Returns a range of values for the given cron expression. - * - * @param string $expression The expression to evaluate - * @param int $max Maximum offset for range - * - * @return array - */ - public function getRangeForExpression(string $expression, int $max): array - { - $values = []; - $expression = $this->convertLiterals($expression); - - if (false !== strpos($expression, ',')) { - $ranges = explode(',', $expression); - $values = []; - foreach ($ranges as $range) { - $expanded = $this->getRangeForExpression($range, $this->rangeEnd); - $values = array_merge($values, $expanded); - } - - return $values; - } - - if ($this->isRange($expression) || $this->isIncrementsOfRanges($expression)) { - if (!$this->isIncrementsOfRanges($expression)) { - [$offset, $to] = explode('-', $expression); - $offset = $this->convertLiterals($offset); - $to = $this->convertLiterals($to); - $stepSize = 1; - } else { - $range = array_map('trim', explode('/', $expression, 2)); - $stepSize = $range[1] ?? 0; - $range = $range[0]; - $range = explode('-', $range, 2); - $offset = $range[0]; - $to = $range[1] ?? $max; - } - $offset = '*' === $offset ? $this->rangeStart : $offset; - if ($stepSize >= $this->rangeEnd) { - $values = [$this->fullRange[$stepSize % \count($this->fullRange)]]; - } else { - for ($i = $offset; $i <= $to; $i += $stepSize) { - $values[] = (int) $i; - } - } - sort($values); - } else { - $values = [$expression]; - } - - return $values; - } - - /** - * Convert literal. - * - * @param string $value - * - * @return string - */ - protected function convertLiterals(string $value): string - { - if (\count($this->literals)) { - $key = array_search(strtoupper($value), $this->literals, true); - if (false !== $key) { - return (string) $key; - } - } - - return $value; - } - - /** - * Checks to see if a value is valid for the field. - * - * @param string $value - * - * @return bool - */ - public function validate(string $value): bool - { - $value = $this->convertLiterals($value); - - // All fields allow * as a valid value - if ('*' === $value) { - return true; - } - - // Validate each chunk of a list individually - if (false !== strpos($value, ',')) { - foreach (explode(',', $value) as $listItem) { - if (!$this->validate($listItem)) { - return false; - } - } - - return true; - } - - if (false !== strpos($value, '/')) { - [$range, $step] = explode('/', $value); - - // Don't allow numeric ranges - if (is_numeric($range)) { - return false; - } - - return $this->validate($range) && filter_var($step, FILTER_VALIDATE_INT); - } - - if (false !== strpos($value, '-')) { - if (substr_count($value, '-') > 1) { - return false; - } - - $chunks = explode('-', $value); - $chunks[0] = $this->convertLiterals($chunks[0]); - $chunks[1] = $this->convertLiterals($chunks[1]); - - if ('*' === $chunks[0] || '*' === $chunks[1]) { - return false; - } - - return $this->validate($chunks[0]) && $this->validate($chunks[1]); - } - - if (!is_numeric($value)) { - return false; - } - - if (false !== strpos($value, '.')) { - return false; - } - - // We should have a numeric by now, so coerce this into an integer - $value = (int) $value; - - return \in_array($value, $this->fullRange, true); - } - - protected function timezoneSafeModify(DateTimeInterface $dt, string $modification): DateTimeInterface - { - $timezone = $dt->getTimezone(); - $dt = $dt->setTimezone(new \DateTimeZone("UTC")); - $dt = $dt->modify($modification); - $dt = $dt->setTimezone($timezone); - return $dt; - } - - protected function setTimeHour(DateTimeInterface $date, bool $invert, int $originalTimestamp): DateTimeInterface - { - $date = $date->setTime((int)$date->format('H'), ($invert ? 59 : 0)); - - // setTime caused the offset to change, moving time in the wrong direction - $actualTimestamp = $date->format('U'); - if ((! $invert) && ($actualTimestamp <= $originalTimestamp)) { - $date = $this->timezoneSafeModify($date, "+1 hour"); - } elseif ($invert && ($actualTimestamp >= $originalTimestamp)) { - $date = $this->timezoneSafeModify($date, "-1 hour"); - } - - return $date; - } -} diff --git a/vendor/dragonmantank/cron-expression/src/Cron/CronExpression.php b/vendor/dragonmantank/cron-expression/src/Cron/CronExpression.php deleted file mode 100644 index d5337cc5..00000000 --- a/vendor/dragonmantank/cron-expression/src/Cron/CronExpression.php +++ /dev/null @@ -1,568 +0,0 @@ - '0 0 1 1 *', - '@annually' => '0 0 1 1 *', - '@monthly' => '0 0 1 * *', - '@weekly' => '0 0 * * 0', - '@daily' => '0 0 * * *', - '@midnight' => '0 0 * * *', - '@hourly' => '0 * * * *', - ]; - - /** - * @var array CRON expression parts - */ - protected $cronParts; - - /** - * @var FieldFactoryInterface CRON field factory - */ - protected $fieldFactory; - - /** - * @var int Max iteration count when searching for next run date - */ - protected $maxIterationCount = 1000; - - /** - * @var array Order in which to test of cron parts - */ - protected static $order = [ - self::YEAR, - self::MONTH, - self::DAY, - self::WEEKDAY, - self::HOUR, - self::MINUTE, - ]; - - /** - * @var array - */ - private static $registeredAliases = self::MAPPINGS; - - /** - * Registered a user defined CRON Expression Alias. - * - * @throws LogicException If the expression or the alias name are invalid - * or if the alias is already registered. - */ - public static function registerAlias(string $alias, string $expression): void - { - try { - new self($expression); - } catch (InvalidArgumentException $exception) { - throw new LogicException("The expression `$expression` is invalid", 0, $exception); - } - - $shortcut = strtolower($alias); - if (1 !== preg_match('/^@\w+$/', $shortcut)) { - throw new LogicException("The alias `$alias` is invalid. It must start with an `@` character and contain alphanumeric (letters, numbers, regardless of case) plus underscore (_)."); - } - - if (isset(self::$registeredAliases[$shortcut])) { - throw new LogicException("The alias `$alias` is already registered."); - } - - self::$registeredAliases[$shortcut] = $expression; - } - - /** - * Unregistered a user defined CRON Expression Alias. - * - * @throws LogicException If the user tries to unregister a built-in alias - */ - public static function unregisterAlias(string $alias): bool - { - $shortcut = strtolower($alias); - if (isset(self::MAPPINGS[$shortcut])) { - throw new LogicException("The alias `$alias` is a built-in alias; it can not be unregistered."); - } - - if (!isset(self::$registeredAliases[$shortcut])) { - return false; - } - - unset(self::$registeredAliases[$shortcut]); - - return true; - } - - /** - * Tells whether a CRON Expression alias is registered. - */ - public static function supportsAlias(string $alias): bool - { - return isset(self::$registeredAliases[strtolower($alias)]); - } - - /** - * Returns all registered aliases as an associated array where the aliases are the key - * and their associated expressions are the values. - * - * @return array - */ - public static function getAliases(): array - { - return self::$registeredAliases; - } - - /** - * @deprecated since version 3.0.2, use __construct instead. - */ - public static function factory(string $expression, FieldFactoryInterface $fieldFactory = null): CronExpression - { - /** @phpstan-ignore-next-line */ - return new static($expression, $fieldFactory); - } - - /** - * Validate a CronExpression. - * - * @param string $expression the CRON expression to validate - * - * @return bool True if a valid CRON expression was passed. False if not. - */ - public static function isValidExpression(string $expression): bool - { - try { - new CronExpression($expression); - } catch (InvalidArgumentException $e) { - return false; - } - - return true; - } - - /** - * Parse a CRON expression. - * - * @param string $expression CRON expression (e.g. '8 * * * *') - * @param null|FieldFactoryInterface $fieldFactory Factory to create cron fields - */ - public function __construct(string $expression, FieldFactoryInterface $fieldFactory = null) - { - $shortcut = strtolower($expression); - $expression = self::$registeredAliases[$shortcut] ?? $expression; - - $this->fieldFactory = $fieldFactory ?: new FieldFactory(); - $this->setExpression($expression); - } - - /** - * Set or change the CRON expression. - * - * @param string $value CRON expression (e.g. 8 * * * *) - * - * @throws \InvalidArgumentException if not a valid CRON expression - * - * @return CronExpression - */ - public function setExpression(string $value): CronExpression - { - $split = preg_split('/\s/', $value, -1, PREG_SPLIT_NO_EMPTY); - Assert::isArray($split); - - $this->cronParts = $split; - if (\count($this->cronParts) < 5) { - throw new InvalidArgumentException( - $value . ' is not a valid CRON expression' - ); - } - - foreach ($this->cronParts as $position => $part) { - $this->setPart($position, $part); - } - - return $this; - } - - /** - * Set part of the CRON expression. - * - * @param int $position The position of the CRON expression to set - * @param string $value The value to set - * - * @throws \InvalidArgumentException if the value is not valid for the part - * - * @return CronExpression - */ - public function setPart(int $position, string $value): CronExpression - { - if (!$this->fieldFactory->getField($position)->validate($value)) { - throw new InvalidArgumentException( - 'Invalid CRON field value ' . $value . ' at position ' . $position - ); - } - - $this->cronParts[$position] = $value; - - return $this; - } - - /** - * Set max iteration count for searching next run dates. - * - * @param int $maxIterationCount Max iteration count when searching for next run date - * - * @return CronExpression - */ - public function setMaxIterationCount(int $maxIterationCount): CronExpression - { - $this->maxIterationCount = $maxIterationCount; - - return $this; - } - - /** - * Get a next run date relative to the current date or a specific date - * - * @param string|\DateTimeInterface $currentTime Relative calculation date - * @param int $nth Number of matches to skip before returning a - * matching next run date. 0, the default, will return the - * current date and time if the next run date falls on the - * current date and time. Setting this value to 1 will - * skip the first match and go to the second match. - * Setting this value to 2 will skip the first 2 - * matches and so on. - * @param bool $allowCurrentDate Set to TRUE to return the current date if - * it matches the cron expression. - * @param null|string $timeZone TimeZone to use instead of the system default - * - * @throws \RuntimeException on too many iterations - * @throws \Exception - * - * @return \DateTime - */ - public function getNextRunDate($currentTime = 'now', int $nth = 0, bool $allowCurrentDate = false, $timeZone = null): DateTime - { - return $this->getRunDate($currentTime, $nth, false, $allowCurrentDate, $timeZone); - } - - /** - * Get a previous run date relative to the current date or a specific date. - * - * @param string|\DateTimeInterface $currentTime Relative calculation date - * @param int $nth Number of matches to skip before returning - * @param bool $allowCurrentDate Set to TRUE to return the - * current date if it matches the cron expression - * @param null|string $timeZone TimeZone to use instead of the system default - * - * @throws \RuntimeException on too many iterations - * @throws \Exception - * - * @return \DateTime - * - * @see \Cron\CronExpression::getNextRunDate - */ - public function getPreviousRunDate($currentTime = 'now', int $nth = 0, bool $allowCurrentDate = false, $timeZone = null): DateTime - { - return $this->getRunDate($currentTime, $nth, true, $allowCurrentDate, $timeZone); - } - - /** - * Get multiple run dates starting at the current date or a specific date. - * - * @param int $total Set the total number of dates to calculate - * @param string|\DateTimeInterface|null $currentTime Relative calculation date - * @param bool $invert Set to TRUE to retrieve previous dates - * @param bool $allowCurrentDate Set to TRUE to return the - * current date if it matches the cron expression - * @param null|string $timeZone TimeZone to use instead of the system default - * - * @return \DateTime[] Returns an array of run dates - */ - public function getMultipleRunDates(int $total, $currentTime = 'now', bool $invert = false, bool $allowCurrentDate = false, $timeZone = null): array - { - $timeZone = $this->determineTimeZone($currentTime, $timeZone); - - if ('now' === $currentTime) { - $currentTime = new DateTime(); - } elseif ($currentTime instanceof DateTime) { - $currentTime = clone $currentTime; - } elseif ($currentTime instanceof DateTimeImmutable) { - $currentTime = DateTime::createFromFormat('U', $currentTime->format('U')); - } elseif (\is_string($currentTime)) { - $currentTime = new DateTime($currentTime); - } - - Assert::isInstanceOf($currentTime, DateTime::class); - $currentTime->setTimezone(new DateTimeZone($timeZone)); - - $matches = []; - for ($i = 0; $i < $total; ++$i) { - try { - $result = $this->getRunDate($currentTime, 0, $invert, $allowCurrentDate, $timeZone); - } catch (RuntimeException $e) { - break; - } - - $allowCurrentDate = false; - $currentTime = clone $result; - $matches[] = $result; - } - - return $matches; - } - - /** - * Get all or part of the CRON expression. - * - * @param int|string|null $part specify the part to retrieve or NULL to get the full - * cron schedule string - * - * @return null|string Returns the CRON expression, a part of the - * CRON expression, or NULL if the part was specified but not found - */ - public function getExpression($part = null): ?string - { - if (null === $part) { - return implode(' ', $this->cronParts); - } - - if (array_key_exists($part, $this->cronParts)) { - return $this->cronParts[$part]; - } - - return null; - } - - /** - * Gets the parts of the cron expression as an array. - * - * @return string[] - * The array of parts that make up this expression. - */ - public function getParts() - { - return $this->cronParts; - } - - /** - * Helper method to output the full expression. - * - * @return string Full CRON expression - */ - public function __toString(): string - { - return (string) $this->getExpression(); - } - - /** - * Determine if the cron is due to run based on the current date or a - * specific date. This method assumes that the current number of - * seconds are irrelevant, and should be called once per minute. - * - * @param string|\DateTimeInterface $currentTime Relative calculation date - * @param null|string $timeZone TimeZone to use instead of the system default - * - * @return bool Returns TRUE if the cron is due to run or FALSE if not - */ - public function isDue($currentTime = 'now', $timeZone = null): bool - { - $timeZone = $this->determineTimeZone($currentTime, $timeZone); - - if ('now' === $currentTime) { - $currentTime = new DateTime(); - } elseif ($currentTime instanceof DateTime) { - $currentTime = clone $currentTime; - } elseif ($currentTime instanceof DateTimeImmutable) { - $currentTime = DateTime::createFromFormat('U', $currentTime->format('U')); - } elseif (\is_string($currentTime)) { - $currentTime = new DateTime($currentTime); - } - - Assert::isInstanceOf($currentTime, DateTime::class); - $currentTime->setTimezone(new DateTimeZone($timeZone)); - - // drop the seconds to 0 - $currentTime->setTime((int) $currentTime->format('H'), (int) $currentTime->format('i'), 0); - - try { - return $this->getNextRunDate($currentTime, 0, true)->getTimestamp() === $currentTime->getTimestamp(); - } catch (Exception $e) { - return false; - } - } - - /** - * Get the next or previous run date of the expression relative to a date. - * - * @param string|\DateTimeInterface|null $currentTime Relative calculation date - * @param int $nth Number of matches to skip before returning - * @param bool $invert Set to TRUE to go backwards in time - * @param bool $allowCurrentDate Set to TRUE to return the - * current date if it matches the cron expression - * @param string|null $timeZone TimeZone to use instead of the system default - * - * @throws \RuntimeException on too many iterations - * @throws Exception - * - * @return \DateTime - */ - protected function getRunDate($currentTime = null, int $nth = 0, bool $invert = false, bool $allowCurrentDate = false, $timeZone = null): DateTime - { - $timeZone = $this->determineTimeZone($currentTime, $timeZone); - - if ($currentTime instanceof DateTime) { - $currentDate = clone $currentTime; - } elseif ($currentTime instanceof DateTimeImmutable) { - $currentDate = DateTime::createFromFormat('U', $currentTime->format('U')); - } elseif (\is_string($currentTime)) { - $currentDate = new DateTime($currentTime); - } else { - $currentDate = new DateTime('now'); - } - - Assert::isInstanceOf($currentDate, DateTime::class); - $currentDate->setTimezone(new DateTimeZone($timeZone)); - // Workaround for setTime causing an offset change: https://bugs.php.net/bug.php?id=81074 - $currentDate = DateTime::createFromFormat("!Y-m-d H:iO", $currentDate->format("Y-m-d H:iP"), $currentDate->getTimezone()); - if ($currentDate === false) { - throw new \RuntimeException('Unable to create date from format'); - } - $currentDate->setTimezone(new DateTimeZone($timeZone)); - - $nextRun = clone $currentDate; - - // We don't have to satisfy * or null fields - $parts = []; - $fields = []; - foreach (self::$order as $position) { - $part = $this->getExpression($position); - if (null === $part || '*' === $part) { - continue; - } - $parts[$position] = $part; - $fields[$position] = $this->fieldFactory->getField($position); - } - - if (isset($parts[self::DAY]) && isset($parts[self::WEEKDAY])) { - $domExpression = sprintf('%s %s %s %s *', $this->getExpression(0), $this->getExpression(1), $this->getExpression(2), $this->getExpression(3)); - $dowExpression = sprintf('%s %s * %s %s', $this->getExpression(0), $this->getExpression(1), $this->getExpression(3), $this->getExpression(4)); - - $domExpression = new self($domExpression); - $dowExpression = new self($dowExpression); - - $domRunDates = $domExpression->getMultipleRunDates($nth + 1, $currentTime, $invert, $allowCurrentDate, $timeZone); - $dowRunDates = $dowExpression->getMultipleRunDates($nth + 1, $currentTime, $invert, $allowCurrentDate, $timeZone); - - if ($parts[self::DAY] === '?' || $parts[self::DAY] === '*') { - $domRunDates = []; - } - - if ($parts[self::WEEKDAY] === '?' || $parts[self::WEEKDAY] === '*') { - $dowRunDates = []; - } - - $combined = array_merge($domRunDates, $dowRunDates); - usort($combined, function ($a, $b) { - return $a->format('Y-m-d H:i:s') <=> $b->format('Y-m-d H:i:s'); - }); - if ($invert) { - $combined = array_reverse($combined); - } - - return $combined[$nth]; - } - - // Set a hard limit to bail on an impossible date - for ($i = 0; $i < $this->maxIterationCount; ++$i) { - foreach ($parts as $position => $part) { - $satisfied = false; - // Get the field object used to validate this part - $field = $fields[$position]; - // Check if this is singular or a list - if (false === strpos($part, ',')) { - $satisfied = $field->isSatisfiedBy($nextRun, $part, $invert); - } else { - foreach (array_map('trim', explode(',', $part)) as $listPart) { - if ($field->isSatisfiedBy($nextRun, $listPart, $invert)) { - $satisfied = true; - - break; - } - } - } - - // If the field is not satisfied, then start over - if (!$satisfied) { - $field->increment($nextRun, $invert, $part); - - continue 2; - } - } - - // Skip this match if needed - if ((!$allowCurrentDate && $nextRun == $currentDate) || --$nth > -1) { - $this->fieldFactory->getField(self::MINUTE)->increment($nextRun, $invert, $parts[self::MINUTE] ?? null); - continue; - } - - return $nextRun; - } - - // @codeCoverageIgnoreStart - throw new RuntimeException('Impossible CRON expression'); - // @codeCoverageIgnoreEnd - } - - /** - * Workout what timeZone should be used. - * - * @param string|\DateTimeInterface|null $currentTime Relative calculation date - * @param string|null $timeZone TimeZone to use instead of the system default - * - * @return string - */ - protected function determineTimeZone($currentTime, ?string $timeZone): string - { - if (null !== $timeZone) { - return $timeZone; - } - - if ($currentTime instanceof DateTimeInterface) { - return $currentTime->getTimezone()->getName(); - } - - return date_default_timezone_get(); - } -} diff --git a/vendor/dragonmantank/cron-expression/src/Cron/DayOfMonthField.php b/vendor/dragonmantank/cron-expression/src/Cron/DayOfMonthField.php deleted file mode 100644 index 39ff5978..00000000 --- a/vendor/dragonmantank/cron-expression/src/Cron/DayOfMonthField.php +++ /dev/null @@ -1,164 +0,0 @@ - - */ -class DayOfMonthField extends AbstractField -{ - /** - * {@inheritdoc} - */ - protected $rangeStart = 1; - - /** - * {@inheritdoc} - */ - protected $rangeEnd = 31; - - /** - * Get the nearest day of the week for a given day in a month. - * - * @param int $currentYear Current year - * @param int $currentMonth Current month - * @param int $targetDay Target day of the month - * - * @return \DateTime|null Returns the nearest date - */ - private static function getNearestWeekday(int $currentYear, int $currentMonth, int $targetDay): ?DateTime - { - $tday = str_pad((string) $targetDay, 2, '0', STR_PAD_LEFT); - $target = DateTime::createFromFormat('Y-m-d', "{$currentYear}-{$currentMonth}-{$tday}"); - - if ($target === false) { - return null; - } - - $currentWeekday = (int) $target->format('N'); - - if ($currentWeekday < 6) { - return $target; - } - - $lastDayOfMonth = $target->format('t'); - foreach ([-1, 1, -2, 2] as $i) { - $adjusted = $targetDay + $i; - if ($adjusted > 0 && $adjusted <= $lastDayOfMonth) { - $target->setDate($currentYear, $currentMonth, $adjusted); - - if ((int) $target->format('N') < 6 && (int) $target->format('m') === $currentMonth) { - return $target; - } - } - } - - return null; - } - - /** - * {@inheritdoc} - */ - public function isSatisfiedBy(DateTimeInterface $date, $value, bool $invert): bool - { - // ? states that the field value is to be skipped - if ('?' === $value) { - return true; - } - - $fieldValue = $date->format('d'); - - // Check to see if this is the last day of the month - if ('L' === $value) { - return $fieldValue === $date->format('t'); - } - - // Check to see if this is the nearest weekday to a particular value - if ($wPosition = strpos($value, 'W')) { - // Parse the target day - $targetDay = (int) substr($value, 0, $wPosition); - // Find out if the current day is the nearest day of the week - $nearest = self::getNearestWeekday( - (int) $date->format('Y'), - (int) $date->format('m'), - $targetDay - ); - if ($nearest) { - return $date->format('j') === $nearest->format('j'); - } - - throw new \RuntimeException('Unable to return nearest weekday'); - } - - return $this->isSatisfied((int) $date->format('d'), $value); - } - - /** - * @inheritDoc - * - * @param \DateTime|\DateTimeImmutable $date - */ - public function increment(DateTimeInterface &$date, $invert = false, $parts = null): FieldInterface - { - if (! $invert) { - $date = $date->add(new \DateInterval('P1D')); - $date = $date->setTime(0, 0); - } else { - $date = $date->sub(new \DateInterval('P1D')); - $date = $date->setTime(23, 59); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function validate(string $value): bool - { - $basicChecks = parent::validate($value); - - // Validate that a list don't have W or L - if (false !== strpos($value, ',') && (false !== strpos($value, 'W') || false !== strpos($value, 'L'))) { - return false; - } - - if (!$basicChecks) { - if ('?' === $value) { - return true; - } - - if ('L' === $value) { - return true; - } - - if (preg_match('/^(.*)W$/', $value, $matches)) { - return $this->validate($matches[1]); - } - - return false; - } - - return $basicChecks; - } -} diff --git a/vendor/dragonmantank/cron-expression/src/Cron/DayOfWeekField.php b/vendor/dragonmantank/cron-expression/src/Cron/DayOfWeekField.php deleted file mode 100644 index b9bbf48b..00000000 --- a/vendor/dragonmantank/cron-expression/src/Cron/DayOfWeekField.php +++ /dev/null @@ -1,194 +0,0 @@ - 'MON', 2 => 'TUE', 3 => 'WED', 4 => 'THU', 5 => 'FRI', 6 => 'SAT', 7 => 'SUN']; - - /** - * Constructor - */ - public function __construct() - { - $this->nthRange = range(1, 5); - parent::__construct(); - } - - /** - * @inheritDoc - */ - public function isSatisfiedBy(DateTimeInterface $date, $value, bool $invert): bool - { - if ('?' === $value) { - return true; - } - - // Convert text day of the week values to integers - $value = $this->convertLiterals($value); - - $currentYear = (int) $date->format('Y'); - $currentMonth = (int) $date->format('m'); - $lastDayOfMonth = (int) $date->format('t'); - - // Find out if this is the last specific weekday of the month - if ($lPosition = strpos($value, 'L')) { - $weekday = $this->convertLiterals(substr($value, 0, $lPosition)); - $weekday %= 7; - - $daysInMonth = (int) $date->format('t'); - $remainingDaysInMonth = $daysInMonth - (int) $date->format('d'); - return (($weekday === (int) $date->format('w')) && ($remainingDaysInMonth < 7)); - } - - // Handle # hash tokens - if (strpos($value, '#')) { - [$weekday, $nth] = explode('#', $value); - - if (!is_numeric($nth)) { - throw new InvalidArgumentException("Hashed weekdays must be numeric, {$nth} given"); - } else { - $nth = (int) $nth; - } - - // 0 and 7 are both Sunday, however 7 matches date('N') format ISO-8601 - if ('0' === $weekday) { - $weekday = 7; - } - - $weekday = (int) $this->convertLiterals((string) $weekday); - - // Validate the hash fields - if ($weekday < 0 || $weekday > 7) { - throw new InvalidArgumentException("Weekday must be a value between 0 and 7. {$weekday} given"); - } - - if (!\in_array($nth, $this->nthRange, true)) { - throw new InvalidArgumentException("There are never more than 5 or less than 1 of a given weekday in a month, {$nth} given"); - } - - // The current weekday must match the targeted weekday to proceed - if ((int) $date->format('N') !== $weekday) { - return false; - } - - $tdate = clone $date; - $tdate = $tdate->setDate($currentYear, $currentMonth, 1); - $dayCount = 0; - $currentDay = 1; - while ($currentDay < $lastDayOfMonth + 1) { - if ((int) $tdate->format('N') === $weekday) { - if (++$dayCount >= $nth) { - break; - } - } - $tdate = $tdate->setDate($currentYear, $currentMonth, ++$currentDay); - } - - return (int) $date->format('j') === $currentDay; - } - - // Handle day of the week values - if (false !== strpos($value, '-')) { - $parts = explode('-', $value); - if ('7' === $parts[0]) { - $parts[0] = 0; - } elseif ('0' === $parts[1]) { - $parts[1] = 7; - } - $value = implode('-', $parts); - } - - // Test to see which Sunday to use -- 0 == 7 == Sunday - $format = \in_array(7, array_map(function ($value) { - return (int) $value; - }, str_split($value)), true) ? 'N' : 'w'; - $fieldValue = (int) $date->format($format); - - return $this->isSatisfied($fieldValue, $value); - } - - /** - * @inheritDoc - */ - public function increment(DateTimeInterface &$date, $invert = false, $parts = null): FieldInterface - { - if (! $invert) { - $date = $date->add(new \DateInterval('P1D')); - $date = $date->setTime(0, 0); - } else { - $date = $date->sub(new \DateInterval('P1D')); - $date = $date->setTime(23, 59); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function validate(string $value): bool - { - $basicChecks = parent::validate($value); - - if (!$basicChecks) { - if ('?' === $value) { - return true; - } - - // Handle the # value - if (false !== strpos($value, '#')) { - $chunks = explode('#', $value); - $chunks[0] = $this->convertLiterals($chunks[0]); - - if (parent::validate($chunks[0]) && is_numeric($chunks[1]) && \in_array((int) $chunks[1], $this->nthRange, true)) { - return true; - } - } - - if (preg_match('/^(.*)L$/', $value, $matches)) { - return $this->validate($matches[1]); - } - - return false; - } - - return $basicChecks; - } -} diff --git a/vendor/dragonmantank/cron-expression/src/Cron/FieldFactory.php b/vendor/dragonmantank/cron-expression/src/Cron/FieldFactory.php deleted file mode 100644 index 839b2757..00000000 --- a/vendor/dragonmantank/cron-expression/src/Cron/FieldFactory.php +++ /dev/null @@ -1,52 +0,0 @@ -fields[$position] ?? $this->fields[$position] = $this->instantiateField($position); - } - - private function instantiateField(int $position): FieldInterface - { - switch ($position) { - case CronExpression::MINUTE: - return new MinutesField(); - case CronExpression::HOUR: - return new HoursField(); - case CronExpression::DAY: - return new DayOfMonthField(); - case CronExpression::MONTH: - return new MonthField(); - case CronExpression::WEEKDAY: - return new DayOfWeekField(); - } - - throw new InvalidArgumentException( - ($position + 1) . ' is not a valid position' - ); - } -} diff --git a/vendor/dragonmantank/cron-expression/src/Cron/FieldFactoryInterface.php b/vendor/dragonmantank/cron-expression/src/Cron/FieldFactoryInterface.php deleted file mode 100644 index 8bd3c658..00000000 --- a/vendor/dragonmantank/cron-expression/src/Cron/FieldFactoryInterface.php +++ /dev/null @@ -1,8 +0,0 @@ -format('H'); - $retval = $this->isSatisfied($checkValue, $value); - if ($retval) { - return $retval; - } - - // Are we on the edge of a transition - $lastTransition = $this->getPastTransition($date); - if (($lastTransition !== null) && ($lastTransition["ts"] > ((int) $date->format('U') - 3600))) { - $dtLastOffset = clone $date; - $this->timezoneSafeModify($dtLastOffset, "-1 hour"); - $lastOffset = $dtLastOffset->getOffset(); - - $dtNextOffset = clone $date; - $this->timezoneSafeModify($dtNextOffset, "+1 hour"); - $nextOffset = $dtNextOffset->getOffset(); - - $offsetChange = $nextOffset - $lastOffset; - if ($offsetChange >= 3600) { - $checkValue -= 1; - return $this->isSatisfied($checkValue, $value); - } - if ((! $invert) && ($offsetChange <= -3600)) { - $checkValue += 1; - return $this->isSatisfied($checkValue, $value); - } - } - - return $retval; - } - - public function getPastTransition(DateTimeInterface $date): ?array - { - $currentTimestamp = (int) $date->format('U'); - if ( - ($this->transitions === null) - || ($this->transitionsStart < ($currentTimestamp + 86400)) - || ($this->transitionsEnd > ($currentTimestamp - 86400)) - ) { - // We start a day before current time so we can differentiate between the first transition entry - // and a change that happens now - $dtLimitStart = clone $date; - $dtLimitStart = $dtLimitStart->modify("-12 months"); - $dtLimitEnd = clone $date; - $dtLimitEnd = $dtLimitEnd->modify('+12 months'); - - $this->transitions = $date->getTimezone()->getTransitions( - $dtLimitStart->getTimestamp(), - $dtLimitEnd->getTimestamp() - ); - if (empty($this->transitions)) { - return null; - } - $this->transitionsStart = $dtLimitStart->getTimestamp(); - $this->transitionsEnd = $dtLimitEnd->getTimestamp(); - } - - $nextTransition = null; - foreach ($this->transitions as $transition) { - if ($transition["ts"] > $currentTimestamp) { - continue; - } - - if (($nextTransition !== null) && ($transition["ts"] < $nextTransition["ts"])) { - continue; - } - - $nextTransition = $transition; - } - - return ($nextTransition ?? null); - } - - /** - * {@inheritdoc} - * - * @param string|null $parts - */ - public function increment(DateTimeInterface &$date, $invert = false, $parts = null): FieldInterface - { - $originalTimestamp = (int) $date->format('U'); - - // Change timezone to UTC temporarily. This will - // allow us to go back or forwards and hour even - // if DST will be changed between the hours. - if (null === $parts || '*' === $parts) { - if ($invert) { - $date = $date->sub(new \DateInterval('PT1H')); - } else { - $date = $date->add(new \DateInterval('PT1H')); - } - - $date = $this->setTimeHour($date, $invert, $originalTimestamp); - return $this; - } - - $parts = false !== strpos($parts, ',') ? explode(',', $parts) : [$parts]; - $hours = []; - foreach ($parts as $part) { - $hours = array_merge($hours, $this->getRangeForExpression($part, 23)); - } - - $current_hour = (int) $date->format('H'); - $position = $invert ? \count($hours) - 1 : 0; - $countHours = \count($hours); - if ($countHours > 1) { - for ($i = 0; $i < $countHours - 1; ++$i) { - if ((!$invert && $current_hour >= $hours[$i] && $current_hour < $hours[$i + 1]) || - ($invert && $current_hour > $hours[$i] && $current_hour <= $hours[$i + 1])) { - $position = $invert ? $i : $i + 1; - - break; - } - } - } - - $target = (int) $hours[$position]; - $originalHour = (int)$date->format('H'); - - $originalDay = (int)$date->format('d'); - $previousOffset = $date->getOffset(); - - if (! $invert) { - if ($originalHour >= $target) { - $distance = 24 - $originalHour; - $date = $this->timezoneSafeModify($date, "+{$distance} hours"); - - $actualDay = (int)$date->format('d'); - $actualHour = (int)$date->format('H'); - if (($actualDay !== ($originalDay + 1)) && ($actualHour !== 0)) { - $offsetChange = ($previousOffset - $date->getOffset()); - $date = $this->timezoneSafeModify($date, "+{$offsetChange} seconds"); - } - - $originalHour = (int)$date->format('H'); - } - - $distance = $target - $originalHour; - $date = $this->timezoneSafeModify($date, "+{$distance} hours"); - } else { - if ($originalHour <= $target) { - $distance = ($originalHour + 1); - $date = $this->timezoneSafeModify($date, "-" . $distance . " hours"); - - $actualDay = (int)$date->format('d'); - $actualHour = (int)$date->format('H'); - if (($actualDay !== ($originalDay - 1)) && ($actualHour !== 23)) { - $offsetChange = ($previousOffset - $date->getOffset()); - $date = $this->timezoneSafeModify($date, "+{$offsetChange} seconds"); - } - - $originalHour = (int)$date->format('H'); - } - - $distance = $originalHour - $target; - $date = $this->timezoneSafeModify($date, "-{$distance} hours"); - } - - $date = $this->setTimeHour($date, $invert, $originalTimestamp); - - $actualHour = (int)$date->format('H'); - if ($invert && ($actualHour === ($target - 1) || (($actualHour === 23) && ($target === 0)))) { - $date = $this->timezoneSafeModify($date, "+1 hour"); - } - - return $this; - } -} diff --git a/vendor/dragonmantank/cron-expression/src/Cron/MinutesField.php b/vendor/dragonmantank/cron-expression/src/Cron/MinutesField.php deleted file mode 100644 index eda91098..00000000 --- a/vendor/dragonmantank/cron-expression/src/Cron/MinutesField.php +++ /dev/null @@ -1,96 +0,0 @@ -isSatisfied((int)$date->format('i'), $value); - } - - /** - * {@inheritdoc} - * {@inheritDoc} - * - * @param string|null $parts - */ - public function increment(DateTimeInterface &$date, $invert = false, $parts = null): FieldInterface - { - if (is_null($parts)) { - $date = $this->timezoneSafeModify($date, ($invert ? "-" : "+") ."1 minute"); - return $this; - } - - $current_minute = (int) $date->format('i'); - - $parts = false !== strpos($parts, ',') ? explode(',', $parts) : [$parts]; - $minutes = []; - foreach ($parts as $part) { - $minutes = array_merge($minutes, $this->getRangeForExpression($part, 59)); - } - - $position = $invert ? \count($minutes) - 1 : 0; - if (\count($minutes) > 1) { - for ($i = 0; $i < \count($minutes) - 1; ++$i) { - if ((!$invert && $current_minute >= $minutes[$i] && $current_minute < $minutes[$i + 1]) || - ($invert && $current_minute > $minutes[$i] && $current_minute <= $minutes[$i + 1])) { - $position = $invert ? $i : $i + 1; - - break; - } - } - } - - $target = (int) $minutes[$position]; - $originalMinute = (int) $date->format("i"); - - if (! $invert) { - if ($originalMinute >= $target) { - $distance = 60 - $originalMinute; - $date = $this->timezoneSafeModify($date, "+{$distance} minutes"); - - $originalMinute = (int) $date->format("i"); - } - - $distance = $target - $originalMinute; - $date = $this->timezoneSafeModify($date, "+{$distance} minutes"); - } else { - if ($originalMinute <= $target) { - $distance = ($originalMinute + 1); - $date = $this->timezoneSafeModify($date, "-{$distance} minutes"); - - $originalMinute = (int) $date->format("i"); - } - - $distance = $originalMinute - $target; - $date = $this->timezoneSafeModify($date, "-{$distance} minutes"); - } - - return $this; - } -} diff --git a/vendor/dragonmantank/cron-expression/src/Cron/MonthField.php b/vendor/dragonmantank/cron-expression/src/Cron/MonthField.php deleted file mode 100644 index 5a15fbb8..00000000 --- a/vendor/dragonmantank/cron-expression/src/Cron/MonthField.php +++ /dev/null @@ -1,61 +0,0 @@ - 'JAN', 2 => 'FEB', 3 => 'MAR', 4 => 'APR', 5 => 'MAY', 6 => 'JUN', 7 => 'JUL', - 8 => 'AUG', 9 => 'SEP', 10 => 'OCT', 11 => 'NOV', 12 => 'DEC', ]; - - /** - * {@inheritdoc} - */ - public function isSatisfiedBy(DateTimeInterface $date, $value, bool $invert): bool - { - if ($value === '?') { - return true; - } - - $value = $this->convertLiterals($value); - - return $this->isSatisfied((int) $date->format('m'), $value); - } - - /** - * @inheritDoc - * - * @param \DateTime|\DateTimeImmutable $date - */ - public function increment(DateTimeInterface &$date, $invert = false, $parts = null): FieldInterface - { - if (! $invert) { - $date = $date->modify('first day of next month'); - $date = $date->setTime(0, 0); - } else { - $date = $date->modify('last day of previous month'); - $date = $date->setTime(23, 59); - } - - return $this; - } -} diff --git a/vendor/egulias/email-validator/CHANGELOG.md b/vendor/egulias/email-validator/CHANGELOG.md deleted file mode 100644 index 83fd62e0..00000000 --- a/vendor/egulias/email-validator/CHANGELOG.md +++ /dev/null @@ -1,33 +0,0 @@ -# EmailValidator v3 Changelog - -## New Features - -* Access to local part and domain part from EmailParser -* Validations outside of the scope of the RFC will be considered "extra" validations, thus opening the door for adding new; will live in their own folder "extra" (as requested in #248, #195, #183). - -## Breacking changes - -* PHP version upgraded to match Symfony's (as of 12/2020). -* DNSCheckValidation now fails for missing MX records. While the RFC argues that the existence of only A records to be valid, starting in v3 they will be considered invalid. -* Emails domain part are now intenteded to be RFC 1035 compliant, rendering previous valid emails (e.g example@examp&) invalid. - -## PHP versions upgrade policy -PHP version upgrade requirement will happen via MINOR (3.x) version upgrades of the library, following the adoption level by major frameworks. - -## Changes -* #235 -* #215 -* #130 -* #258 -* #188 -* #181 -* #217 -* #214 -* #249 -* #236 -* #257 -* #210 - -## Thanks -To contributors, be it with PRs, reporting issues or supporting otherwise. - diff --git a/vendor/egulias/email-validator/CONTRIBUTING.md b/vendor/egulias/email-validator/CONTRIBUTING.md deleted file mode 100644 index 907bc2c9..00000000 --- a/vendor/egulias/email-validator/CONTRIBUTING.md +++ /dev/null @@ -1,153 +0,0 @@ -# Contributing - -When contributing to this repository make sure to follow the Pull request process below. -Reduce to the minimum 3rd party dependencies. - -Please note we have a [code of conduct](#Code of Conduct), please follow it in all your interactions with the project. - -## Pull Request Process - -When doing a PR to v2 remember that you also have to do the PR port to v3, or tests confirming the bug is not reproducible. - -1. Supported version is v3. If you are fixing a bug in v2, please port to v3 -2. Use the title as a brief description of the changes -3. Describe the changes you are proposing - 1. If adding an extra validation state the benefits of adding it and the problem is solving - 2. Document in the readme, by adding it to the list -4. Provide appropriate tests for the code you are submitting: aim to keep the existing coverage percentage. -5. Add your Twitter handle (if you have) so we can thank you there. - -## License -By contributing, you agree that your contributions will be licensed under its MIT License. - -## Code of Conduct - -### Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible 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. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -### Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -* Focusing on what is best not just for us as individuals, but for the - overall community - -Examples of unacceptable behavior include: - -* The use of sexualized language or imagery, and sexual attention or - advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email - address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -### Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders 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, and will communicate reasons for moderation -decisions when appropriate. - -### Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -### Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at . -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -#### Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -#### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -#### 2. Warning - -**Community Impact**: A violation through a single incident or series -of actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or -permanent ban. - -#### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -#### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within -the community. - -### Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.0, available at -[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0]. - -Community Impact Guidelines were inspired by -[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. - -For answers to common questions about this code of conduct, see the FAQ at -[https://www.contributor-covenant.org/faq][FAQ]. Translations are available -at [https://www.contributor-covenant.org/translations][translations]. - -[homepage]: https://www.contributor-covenant.org -[v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html -[Mozilla CoC]: https://github.com/mozilla/diversity -[FAQ]: https://www.contributor-covenant.org/faq -[translations]: https://www.contributor-covenant.org/translations diff --git a/vendor/egulias/email-validator/LICENSE b/vendor/egulias/email-validator/LICENSE deleted file mode 100644 index 1f0f2678..00000000 --- a/vendor/egulias/email-validator/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2013-2021 Eduardo Gulias Davis - -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/egulias/email-validator/composer.json b/vendor/egulias/email-validator/composer.json deleted file mode 100644 index d598d1b6..00000000 --- a/vendor/egulias/email-validator/composer.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "egulias/email-validator", - "description": "A library for validating emails against several RFCs", - "homepage": "https://github.com/egulias/EmailValidator", - "keywords": ["email", "validation", "validator", "emailvalidation", "emailvalidator"], - "license": "MIT", - "authors": [ - {"name": "Eduardo Gulias Davis"} - ], - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "require": { - "php": ">=7.2", - "doctrine/lexer": "^1.2", - "symfony/polyfill-intl-idn": "^1.15" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.2", - "phpunit/phpunit": "^8.5.8|^9.3.3", - "vimeo/psalm": "^4" - }, - "suggest": { - "ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation" - }, - "autoload": { - "psr-4": { - "Egulias\\EmailValidator\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "Egulias\\EmailValidator\\Tests\\": "tests" - } - } -} diff --git a/vendor/egulias/email-validator/composer.lock b/vendor/egulias/email-validator/composer.lock deleted file mode 100644 index 4b918d13..00000000 --- a/vendor/egulias/email-validator/composer.lock +++ /dev/null @@ -1,5028 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "a77d36b64bc1213fecf4d4f92d759c3b", - "packages": [ - { - "name": "doctrine/lexer", - "version": "1.2.3", - "source": { - "type": "git", - "url": "https://github.com/doctrine/lexer.git", - "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/c268e882d4dbdd85e36e4ad69e02dc284f89d229", - "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^9.0", - "phpstan/phpstan": "^1.3", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.11" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "https://www.doctrine-project.org/projects/lexer.html", - "keywords": [ - "annotations", - "docblock", - "lexer", - "parser", - "php" - ], - "support": { - "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/1.2.3" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", - "type": "tidelift" - } - ], - "time": "2022-02-28T11:07:21+00:00" - }, - { - "name": "symfony/polyfill-intl-idn", - "version": "v1.25.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "749045c69efb97c70d25d7463abba812e91f3a44" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/749045c69efb97c70d25d7463abba812e91f3a44", - "reference": "749045c69efb97c70d25d7463abba812e91f3a44", - "shasum": "" - }, - "require": { - "php": ">=7.1", - "symfony/polyfill-intl-normalizer": "^1.10", - "symfony/polyfill-php72": "^1.10" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Idn\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Laurent Bassin", - "email": "laurent@bassin.info" - }, - { - "name": "Trevor Rowbotham", - "email": "trevor.rowbotham@pm.me" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "idn", - "intl", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.25.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" - } - ], - "time": "2021-09-14T14:02:44+00:00" - }, - { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.25.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", - "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "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 intl's Normalizer class and related functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "intl", - "normalizer", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.25.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" - } - ], - "time": "2021-02-19T12:13:01+00:00" - }, - { - "name": "symfony/polyfill-php72", - "version": "v1.25.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "9a142215a36a3888e30d0a9eeea9766764e96976" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9a142215a36a3888e30d0a9eeea9766764e96976", - "reference": "9a142215a36a3888e30d0a9eeea9766764e96976", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "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.25.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" - } - ], - "time": "2021-05-27T09:17:38+00:00" - } - ], - "packages-dev": [ - { - "name": "amphp/amp", - "version": "v2.6.2", - "source": { - "type": "git", - "url": "https://github.com/amphp/amp.git", - "reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/amphp/amp/zipball/9d5100cebffa729aaffecd3ad25dc5aeea4f13bb", - "reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "amphp/php-cs-fixer-config": "dev-master", - "amphp/phpunit-util": "^1", - "ext-json": "*", - "jetbrains/phpstorm-stubs": "^2019.3", - "phpunit/phpunit": "^7 | ^8 | ^9", - "psalm/phar": "^3.11@dev", - "react/promise": "^2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, - "autoload": { - "files": [ - "lib/functions.php", - "lib/Internal/functions.php" - ], - "psr-4": { - "Amp\\": "lib" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Daniel Lowrey", - "email": "rdlowrey@php.net" - }, - { - "name": "Aaron Piotrowski", - "email": "aaron@trowski.com" - }, - { - "name": "Bob Weinand", - "email": "bobwei9@hotmail.com" - }, - { - "name": "Niklas Keller", - "email": "me@kelunik.com" - } - ], - "description": "A non-blocking concurrency framework for PHP applications.", - "homepage": "https://amphp.org/amp", - "keywords": [ - "async", - "asynchronous", - "awaitable", - "concurrency", - "event", - "event-loop", - "future", - "non-blocking", - "promise" - ], - "support": { - "irc": "irc://irc.freenode.org/amphp", - "issues": "https://github.com/amphp/amp/issues", - "source": "https://github.com/amphp/amp/tree/v2.6.2" - }, - "funding": [ - { - "url": "https://github.com/amphp", - "type": "github" - } - ], - "time": "2022-02-20T17:52:18+00:00" - }, - { - "name": "amphp/byte-stream", - "version": "v1.8.1", - "source": { - "type": "git", - "url": "https://github.com/amphp/byte-stream.git", - "reference": "acbd8002b3536485c997c4e019206b3f10ca15bd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/amphp/byte-stream/zipball/acbd8002b3536485c997c4e019206b3f10ca15bd", - "reference": "acbd8002b3536485c997c4e019206b3f10ca15bd", - "shasum": "" - }, - "require": { - "amphp/amp": "^2", - "php": ">=7.1" - }, - "require-dev": { - "amphp/php-cs-fixer-config": "dev-master", - "amphp/phpunit-util": "^1.4", - "friendsofphp/php-cs-fixer": "^2.3", - "jetbrains/phpstorm-stubs": "^2019.3", - "phpunit/phpunit": "^6 || ^7 || ^8", - "psalm/phar": "^3.11.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "files": [ - "lib/functions.php" - ], - "psr-4": { - "Amp\\ByteStream\\": "lib" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Aaron Piotrowski", - "email": "aaron@trowski.com" - }, - { - "name": "Niklas Keller", - "email": "me@kelunik.com" - } - ], - "description": "A stream abstraction to make working with non-blocking I/O simple.", - "homepage": "http://amphp.org/byte-stream", - "keywords": [ - "amp", - "amphp", - "async", - "io", - "non-blocking", - "stream" - ], - "support": { - "irc": "irc://irc.freenode.org/amphp", - "issues": "https://github.com/amphp/byte-stream/issues", - "source": "https://github.com/amphp/byte-stream/tree/v1.8.1" - }, - "funding": [ - { - "url": "https://github.com/amphp", - "type": "github" - } - ], - "time": "2021-03-30T17:13:30+00:00" - }, - { - "name": "composer/package-versions-deprecated", - "version": "1.11.99.5", - "source": { - "type": "git", - "url": "https://github.com/composer/package-versions-deprecated.git", - "reference": "b4f54f74ef3453349c24a845d22392cd31e65f1d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/b4f54f74ef3453349c24a845d22392cd31e65f1d", - "reference": "b4f54f74ef3453349c24a845d22392cd31e65f1d", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.1.0 || ^2.0", - "php": "^7 || ^8" - }, - "replace": { - "ocramius/package-versions": "1.11.99" - }, - "require-dev": { - "composer/composer": "^1.9.3 || ^2.0@dev", - "ext-zip": "^1.13", - "phpunit/phpunit": "^6.5 || ^7" - }, - "type": "composer-plugin", - "extra": { - "class": "PackageVersions\\Installer", - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "PackageVersions\\": "src/PackageVersions" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be" - } - ], - "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", - "support": { - "issues": "https://github.com/composer/package-versions-deprecated/issues", - "source": "https://github.com/composer/package-versions-deprecated/tree/1.11.99.5" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2022-01-17T14:14:24+00:00" - }, - { - "name": "composer/pcre", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/composer/pcre.git", - "reference": "e300eb6c535192decd27a85bc72a9290f0d6b3bd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/e300eb6c535192decd27a85bc72a9290f0d6b3bd", - "reference": "e300eb6c535192decd27a85bc72a9290f0d6b3bd", - "shasum": "" - }, - "require": { - "php": "^7.4 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.3", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Pcre\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "PCRE wrapping library that offers type-safe preg_* replacements.", - "keywords": [ - "PCRE", - "preg", - "regex", - "regular expression" - ], - "support": { - "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.0.0" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2022-02-25T20:21:48+00:00" - }, - { - "name": "composer/semver", - "version": "3.3.2", - "source": { - "type": "git", - "url": "https://github.com/composer/semver.git", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/3953f23262f2bff1919fc82183ad9acb13ff62c9", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.4", - "symfony/phpunit-bridge": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Semver\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" - } - ], - "description": "Semver library that offers utilities, version constraint parsing and validation.", - "keywords": [ - "semantic", - "semver", - "validation", - "versioning" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.3.2" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2022-04-01T19:23:25+00:00" - }, - { - "name": "composer/xdebug-handler", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/composer/xdebug-handler.git", - "reference": "ced299686f41dce890debac69273b47ffe98a40c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", - "reference": "ced299686f41dce890debac69273b47ffe98a40c", - "shasum": "" - }, - "require": { - "composer/pcre": "^1 || ^2 || ^3", - "php": "^7.2.5 || ^8.0", - "psr/log": "^1 || ^2 || ^3" - }, - "require-dev": { - "phpstan/phpstan": "^1.0", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^6.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Composer\\XdebugHandler\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "John Stevenson", - "email": "john-stevenson@blueyonder.co.uk" - } - ], - "description": "Restarts a process without Xdebug.", - "keywords": [ - "Xdebug", - "performance" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2022-02-25T21:32:43+00:00" - }, - { - "name": "dnoegel/php-xdg-base-dir", - "version": "v0.1.1", - "source": { - "type": "git", - "url": "https://github.com/dnoegel/php-xdg-base-dir.git", - "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/dnoegel/php-xdg-base-dir/zipball/8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", - "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "~7.0|~6.0|~5.0|~4.8.35" - }, - "type": "library", - "autoload": { - "psr-4": { - "XdgBaseDir\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "implementation of xdg base directory specification for php", - "support": { - "issues": "https://github.com/dnoegel/php-xdg-base-dir/issues", - "source": "https://github.com/dnoegel/php-xdg-base-dir/tree/v0.1.1" - }, - "time": "2019-12-04T15:06:13+00:00" - }, - { - "name": "doctrine/instantiator", - "version": "1.4.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^9", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^0.16 || ^1", - "phpstan/phpstan": "^1.4", - "phpstan/phpstan-phpunit": "^1", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.22" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], - "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.1" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" - } - ], - "time": "2022-03-03T08:28:38+00:00" - }, - { - "name": "felixfbecker/advanced-json-rpc", - "version": "v3.2.1", - "source": { - "type": "git", - "url": "https://github.com/felixfbecker/php-advanced-json-rpc.git", - "reference": "b5f37dbff9a8ad360ca341f3240dc1c168b45447" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/felixfbecker/php-advanced-json-rpc/zipball/b5f37dbff9a8ad360ca341f3240dc1c168b45447", - "reference": "b5f37dbff9a8ad360ca341f3240dc1c168b45447", - "shasum": "" - }, - "require": { - "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", - "php": "^7.1 || ^8.0", - "phpdocumentor/reflection-docblock": "^4.3.4 || ^5.0.0" - }, - "require-dev": { - "phpunit/phpunit": "^7.0 || ^8.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "AdvancedJsonRpc\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "ISC" - ], - "authors": [ - { - "name": "Felix Becker", - "email": "felix.b@outlook.com" - } - ], - "description": "A more advanced JSONRPC implementation", - "support": { - "issues": "https://github.com/felixfbecker/php-advanced-json-rpc/issues", - "source": "https://github.com/felixfbecker/php-advanced-json-rpc/tree/v3.2.1" - }, - "time": "2021-06-11T22:34:44+00:00" - }, - { - "name": "felixfbecker/language-server-protocol", - "version": "v1.5.2", - "source": { - "type": "git", - "url": "https://github.com/felixfbecker/php-language-server-protocol.git", - "reference": "6e82196ffd7c62f7794d778ca52b69feec9f2842" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/6e82196ffd7c62f7794d778ca52b69feec9f2842", - "reference": "6e82196ffd7c62f7794d778ca52b69feec9f2842", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpstan/phpstan": "*", - "squizlabs/php_codesniffer": "^3.1", - "vimeo/psalm": "^4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "LanguageServerProtocol\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "ISC" - ], - "authors": [ - { - "name": "Felix Becker", - "email": "felix.b@outlook.com" - } - ], - "description": "PHP classes for the Language Server Protocol", - "keywords": [ - "language", - "microsoft", - "php", - "server" - ], - "support": { - "issues": "https://github.com/felixfbecker/php-language-server-protocol/issues", - "source": "https://github.com/felixfbecker/php-language-server-protocol/tree/v1.5.2" - }, - "time": "2022-03-02T22:36:06+00:00" - }, - { - "name": "guzzlehttp/guzzle", - "version": "7.4.3", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "74a8602c6faec9ef74b7a9391ac82c5e65b1cdab" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/74a8602c6faec9ef74b7a9391ac82c5e65b1cdab", - "reference": "74a8602c6faec9ef74b7a9391ac82c5e65b1cdab", - "shasum": "" - }, - "require": { - "ext-json": "*", - "guzzlehttp/promises": "^1.5", - "guzzlehttp/psr7": "^1.8.3 || ^2.1", - "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": { - "bamarni/composer-bin-plugin": "^1.4.1", - "ext-curl": "*", - "php-http/client-integration-tests": "^3.0", - "phpunit/phpunit": "^8.5.5 || ^9.3.5", - "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" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "7.4-dev" - } - }, - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "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://github.com/sagikazarmark" - }, - { - "name": "Tobias Schultze", - "email": "webmaster@tubo-world.de", - "homepage": "https://github.com/Tobion" - } - ], - "description": "Guzzle is a PHP HTTP client library", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "psr-18", - "psr-7", - "rest", - "web service" - ], - "support": { - "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.4.3" - }, - "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" - } - ], - "time": "2022-05-25T13:24:33+00:00" - }, - { - "name": "guzzlehttp/promises", - "version": "1.5.1", - "source": { - "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", - "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", - "shasum": "" - }, - "require": { - "php": ">=5.5" - }, - "require-dev": { - "symfony/phpunit-bridge": "^4.4 || ^5.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.5-dev" - } - }, - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "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": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com", - "homepage": "https://github.com/Nyholm" - }, - { - "name": "Tobias Schultze", - "email": "webmaster@tubo-world.de", - "homepage": "https://github.com/Tobion" - } - ], - "description": "Guzzle promises library", - "keywords": [ - "promise" - ], - "support": { - "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.5.1" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://github.com/Nyholm", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", - "type": "tidelift" - } - ], - "time": "2021-10-22T20:56:57+00:00" - }, - { - "name": "guzzlehttp/psr7", - "version": "2.2.1", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "c94a94f120803a18554c1805ef2e539f8285f9a2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/c94a94f120803a18554c1805ef2e539f8285f9a2", - "reference": "c94a94f120803a18554c1805ef2e539f8285f9a2", - "shasum": "" - }, - "require": { - "php": "^7.2.5 || ^8.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.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.4.1", - "http-interop/http-factory-tests": "^0.9", - "phpunit/phpunit": "^8.5.8 || ^9.3.10" - }, - "suggest": { - "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "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": "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://github.com/sagikazarmark" - }, - { - "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", - "keywords": [ - "http", - "message", - "psr-7", - "request", - "response", - "stream", - "uri", - "url" - ], - "support": { - "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.2.1" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://github.com/Nyholm", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", - "type": "tidelift" - } - ], - "time": "2022-03-20T21:55:58+00:00" - }, - { - "name": "myclabs/deep-copy", - "version": "1.11.0", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "conflict": { - "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" - }, - "require-dev": { - "doctrine/collections": "^1.6.8", - "doctrine/common": "^2.13.3 || ^3.2.2", - "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" - }, - "type": "library", - "autoload": { - "files": [ - "src/DeepCopy/deep_copy.php" - ], - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "support": { - "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0" - }, - "funding": [ - { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" - } - ], - "time": "2022-03-03T13:19:32+00:00" - }, - { - "name": "netresearch/jsonmapper", - "version": "v4.0.0", - "source": { - "type": "git", - "url": "https://github.com/cweiske/jsonmapper.git", - "reference": "8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d", - "reference": "8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d", - "shasum": "" - }, - "require": { - "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "~7.5 || ~8.0 || ~9.0", - "squizlabs/php_codesniffer": "~3.5" - }, - "type": "library", - "autoload": { - "psr-0": { - "JsonMapper": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "OSL-3.0" - ], - "authors": [ - { - "name": "Christian Weiske", - "email": "cweiske@cweiske.de", - "homepage": "http://github.com/cweiske/jsonmapper/", - "role": "Developer" - } - ], - "description": "Map nested JSON structures onto PHP classes", - "support": { - "email": "cweiske@cweiske.de", - "issues": "https://github.com/cweiske/jsonmapper/issues", - "source": "https://github.com/cweiske/jsonmapper/tree/v4.0.0" - }, - "time": "2020-12-01T19:48:11+00:00" - }, - { - "name": "nikic/php-parser", - "version": "v4.13.2", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "210577fe3cf7badcc5814d99455df46564f3c077" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077", - "reference": "210577fe3cf7badcc5814d99455df46564f3c077", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=7.0" - }, - "require-dev": { - "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" - }, - "bin": [ - "bin/php-parse" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.9-dev" - } - }, - "autoload": { - "psr-4": { - "PhpParser\\": "lib/PhpParser" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov" - } - ], - "description": "A PHP parser written in PHP", - "keywords": [ - "parser", - "php" - ], - "support": { - "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.2" - }, - "time": "2021-11-30T19:35:32+00:00" - }, - { - "name": "openlss/lib-array2xml", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/nullivex/lib-array2xml.git", - "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nullivex/lib-array2xml/zipball/a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", - "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "type": "library", - "autoload": { - "psr-0": { - "LSS": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Bryan Tong", - "email": "bryan@nullivex.com", - "homepage": "https://www.nullivex.com" - }, - { - "name": "Tony Butler", - "email": "spudz76@gmail.com", - "homepage": "https://www.nullivex.com" - } - ], - "description": "Array2XML conversion library credit to lalit.org", - "homepage": "https://www.nullivex.com", - "keywords": [ - "array", - "array conversion", - "xml", - "xml conversion" - ], - "support": { - "issues": "https://github.com/nullivex/lib-array2xml/issues", - "source": "https://github.com/nullivex/lib-array2xml/tree/master" - }, - "time": "2019-03-29T20:06:56+00:00" - }, - { - "name": "phar-io/manifest", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-phar": "*", - "ext-xmlwriter": "*", - "phar-io/version": "^3.0.1", - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "support": { - "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.3" - }, - "time": "2021-07-20T11:28:43+00:00" - }, - { - "name": "phar-io/version", - "version": "3.2.1", - "source": { - "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Library for handling version information and constraints", - "support": { - "issues": "https://github.com/phar-io/version/issues", - "source": "https://github.com/phar-io/version/tree/3.2.1" - }, - "time": "2022-02-21T01:04:05+00:00" - }, - { - "name": "php-coveralls/php-coveralls", - "version": "v2.5.2", - "source": { - "type": "git", - "url": "https://github.com/php-coveralls/php-coveralls.git", - "reference": "007e13afdcdba2cd0efcc5f72c3b7efb356a8bd4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-coveralls/php-coveralls/zipball/007e13afdcdba2cd0efcc5f72c3b7efb356a8bd4", - "reference": "007e13afdcdba2cd0efcc5f72c3b7efb356a8bd4", - "shasum": "" - }, - "require": { - "ext-json": "*", - "ext-simplexml": "*", - "guzzlehttp/guzzle": "^6.0 || ^7.0", - "php": "^5.5 || ^7.0 || ^8.0", - "psr/log": "^1.0 || ^2.0", - "symfony/config": "^2.1 || ^3.0 || ^4.0 || ^5.0 || ^6.0", - "symfony/console": "^2.1 || ^3.0 || ^4.0 || ^5.0 || ^6.0", - "symfony/stopwatch": "^2.0 || ^3.0 || ^4.0 || ^5.0 || ^6.0", - "symfony/yaml": "^2.0.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.4.3 || ^6.0 || ^7.0 || ^8.0 || ^9.0", - "sanmai/phpunit-legacy-adapter": "^6.1 || ^8.0" - }, - "suggest": { - "symfony/http-kernel": "Allows Symfony integration" - }, - "bin": [ - "bin/php-coveralls" - ], - "type": "library", - "autoload": { - "psr-4": { - "PhpCoveralls\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kitamura Satoshi", - "email": "with.no.parachute@gmail.com", - "homepage": "https://www.facebook.com/satooshi.jp", - "role": "Original creator" - }, - { - "name": "Takashi Matsuo", - "email": "tmatsuo@google.com" - }, - { - "name": "Google Inc" - }, - { - "name": "Dariusz Ruminski", - "email": "dariusz.ruminski@gmail.com", - "homepage": "https://github.com/keradus" - }, - { - "name": "Contributors", - "homepage": "https://github.com/php-coveralls/php-coveralls/graphs/contributors" - } - ], - "description": "PHP client library for Coveralls API", - "homepage": "https://github.com/php-coveralls/php-coveralls", - "keywords": [ - "ci", - "coverage", - "github", - "test" - ], - "support": { - "issues": "https://github.com/php-coveralls/php-coveralls/issues", - "source": "https://github.com/php-coveralls/php-coveralls/tree/v2.5.2" - }, - "time": "2021-12-06T17:05:08+00:00" - }, - { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" - }, - "time": "2020-06-27T09:03:43+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "5.3.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", - "shasum": "" - }, - "require": { - "ext-filter": "*", - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", - "webmozart/assert": "^1.9.1" - }, - "require-dev": { - "mockery/mockery": "~1.3.2", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - }, - { - "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" - }, - "time": "2021-10-19T17:43:47+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "1.6.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "77a32518733312af16a44300404e945338981de3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/77a32518733312af16a44300404e945338981de3", - "reference": "77a32518733312af16a44300404e945338981de3", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" - }, - "require-dev": { - "ext-tokenizer": "*", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-1.x": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "support": { - "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.1" - }, - "time": "2022-03-15T21:29:03+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "v1.15.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.2", - "phpdocumentor/reflection-docblock": "^5.2", - "sebastian/comparator": "^3.0 || ^4.0", - "sebastian/recursion-context": "^3.0 || ^4.0" - }, - "require-dev": { - "phpspec/phpspec": "^6.0 || ^7.0", - "phpunit/phpunit": "^8.0 || ^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" - }, - "time": "2021-12-08T12:19:24+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "9.2.15", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2e9da11878c4202f97915c1cb4bb1ca318a63f5f", - "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-libxml": "*", - "ext-xmlwriter": "*", - "nikic/php-parser": "^4.13.0", - "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.3", - "phpunit/php-text-template": "^2.0.2", - "sebastian/code-unit-reverse-lookup": "^2.0.2", - "sebastian/complexity": "^2.0", - "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0.3", - "sebastian/version": "^3.0.1", - "theseer/tokenizer": "^1.2.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-pcov": "*", - "ext-xdebug": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "9.2-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.15" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-03-07T09:28:20+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "3.0.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2021-12-02T12:48:52+00:00" - }, - { - "name": "phpunit/php-invoker", - "version": "3.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "ext-pcntl": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-pcntl": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Invoke callables with a timeout", - "homepage": "https://github.com/sebastianbergmann/php-invoker/", - "keywords": [ - "process" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-invoker/issues", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T05:58:55+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "2.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T05:33:50+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "5.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:16:10+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "9.5.20", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "12bc8879fb65aef2138b26fc633cb1e3620cffba" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/12bc8879fb65aef2138b26fc633cb1e3620cffba", - "reference": "12bc8879fb65aef2138b26fc633cb1e3620cffba", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.3.1", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.1", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", - "php": ">=7.3", - "phpspec/prophecy": "^1.12.1", - "phpunit/php-code-coverage": "^9.2.13", - "phpunit/php-file-iterator": "^3.0.5", - "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.3", - "phpunit/php-timer": "^5.0.2", - "sebastian/cli-parser": "^1.0.1", - "sebastian/code-unit": "^1.0.6", - "sebastian/comparator": "^4.0.5", - "sebastian/diff": "^4.0.3", - "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.3", - "sebastian/global-state": "^5.0.1", - "sebastian/object-enumerator": "^4.0.3", - "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.0", - "sebastian/version": "^3.0.2" - }, - "require-dev": { - "ext-pdo": "*", - "phpspec/prophecy-phpunit": "^2.0.1" - }, - "suggest": { - "ext-soap": "*", - "ext-xdebug": "*" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "9.5-dev" - } - }, - "autoload": { - "files": [ - "src/Framework/Assert/Functions.php" - ], - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.20" - }, - "funding": [ - { - "url": "https://phpunit.de/sponsors.html", - "type": "custom" - }, - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-04-01T12:37:26+00:00" - }, - { - "name": "psr/container", - "version": "1.1.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", - "shasum": "" - }, - "require": { - "php": ">=7.4.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.2" - }, - "time": "2021-11-05T16:50:12+00:00" - }, - { - "name": "psr/http-client", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-client.git", - "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", - "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", - "shasum": "" - }, - "require": { - "php": "^7.0 || ^8.0", - "psr/http-message": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Client\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP clients", - "homepage": "https://github.com/php-fig/http-client", - "keywords": [ - "http", - "http-client", - "psr", - "psr-18" - ], - "support": { - "source": "https://github.com/php-fig/http-client/tree/master" - }, - "time": "2020-06-29T06:28:15+00:00" - }, - { - "name": "psr/http-factory", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-factory.git", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", - "shasum": "" - }, - "require": { - "php": ">=7.0.0", - "psr/http-message": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://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/master" - }, - "time": "2019-04-30T12:38:16+00:00" - }, - { - "name": "psr/http-message", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "support": { - "source": "https://github.com/php-fig/http-message/tree/master" - }, - "time": "2016-08-06T14:39:51+00:00" - }, - { - "name": "psr/log", - "version": "1.1.4", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "support": { - "source": "https://github.com/php-fig/log/tree/1.1.4" - }, - "time": "2021-05-03T11:20:27+00:00" - }, - { - "name": "ralouphie/getallheaders", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/ralouphie/getallheaders.git", - "reference": "120b605dfeb996808c31b6477290a714d356e822" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", - "reference": "120b605dfeb996808c31b6477290a714d356e822", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.1", - "phpunit/phpunit": "^5 || ^6.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/getallheaders.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ralph Khattar", - "email": "ralph.khattar@gmail.com" - } - ], - "description": "A polyfill for getallheaders.", - "support": { - "issues": "https://github.com/ralouphie/getallheaders/issues", - "source": "https://github.com/ralouphie/getallheaders/tree/develop" - }, - "time": "2019-03-08T08:55:37+00:00" - }, - { - "name": "sebastian/cli-parser", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library for parsing CLI options", - "homepage": "https://github.com/sebastianbergmann/cli-parser", - "support": { - "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:08:49+00:00" - }, - { - "name": "sebastian/code-unit", - "version": "1.0.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Collection of value objects that represent the PHP code units", - "homepage": "https://github.com/sebastianbergmann/code-unit", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit/issues", - "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:08:54+00:00" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T05:30:19+00:00" - }, - { - "name": "sebastian/comparator", - "version": "4.0.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/diff": "^4.0", - "sebastian/exporter": "^4.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "https://github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T15:49:45+00:00" - }, - { - "name": "sebastian/complexity", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", - "shasum": "" - }, - "require": { - "nikic/php-parser": "^4.7", - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library for calculating the complexity of PHP code units", - "homepage": "https://github.com/sebastianbergmann/complexity", - "support": { - "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T15:52:27+00:00" - }, - { - "name": "sebastian/diff", - "version": "4.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3", - "symfony/process": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:10:38+00:00" - }, - { - "name": "sebastian/environment", - "version": "5.1.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/1b5dff7bb151a4db11d49d90e5408e4e938270f7", - "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-posix": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-04-03T09:37:03+00:00" - }, - { - "name": "sebastian/exporter", - "version": "4.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "https://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2021-11-11T14:18:36+00:00" - }, - { - "name": "sebastian/global-state", - "version": "5.0.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "ext-dom": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-02-14T08:28:10+00:00" - }, - { - "name": "sebastian/lines-of-code", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", - "shasum": "" - }, - "require": { - "nikic/php-parser": "^4.6", - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library for counting the lines of code in PHP source code", - "homepage": "https://github.com/sebastianbergmann/lines-of-code", - "support": { - "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-28T06:42:11+00:00" - }, - { - "name": "sebastian/object-enumerator", - "version": "4.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:12:34+00:00" - }, - { - "name": "sebastian/object-reflector", - "version": "2.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:14:26+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "4.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "support": { - "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:17:30+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:45:17+00:00" - }, - { - "name": "sebastian/type", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/type.git", - "reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b233b84bc4465aff7b57cf1c4bc75c86d00d6dad", - "reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Collection of value objects that represent the types of the PHP type system", - "homepage": "https://github.com/sebastianbergmann/type", - "support": { - "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.0.0" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-03-15T09:54:48+00:00" - }, - { - "name": "sebastian/version", - "version": "3.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c6c1022351a901512170118436c764e473f6de8c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", - "reference": "c6c1022351a901512170118436c764e473f6de8c", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "support": { - "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:39:44+00:00" - }, - { - "name": "symfony/config", - "version": "v5.4.9", - "source": { - "type": "git", - "url": "https://github.com/symfony/config.git", - "reference": "8f551fe22672ac7ab2c95fe46d899f960ed4d979" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/8f551fe22672ac7ab2c95fe46d899f960ed4d979", - "reference": "8f551fe22672ac7ab2c95fe46d899f960ed4d979", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/filesystem": "^4.4|^5.0|^6.0", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-php80": "^1.16", - "symfony/polyfill-php81": "^1.22" - }, - "conflict": { - "symfony/finder": "<4.4" - }, - "require-dev": { - "symfony/event-dispatcher": "^4.4|^5.0|^6.0", - "symfony/finder": "^4.4|^5.0|^6.0", - "symfony/messenger": "^4.4|^5.0|^6.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/yaml": "^4.4|^5.0|^6.0" - }, - "suggest": { - "symfony/yaml": "To use the yaml reference dumper" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Config\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/config/tree/v5.4.9" - }, - "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" - } - ], - "time": "2022-05-17T10:39:36+00:00" - }, - { - "name": "symfony/console", - "version": "v5.4.9", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "829d5d1bf60b2efeb0887b7436873becc71a45eb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/829d5d1bf60b2efeb0887b7436873becc71a45eb", - "reference": "829d5d1bf60b2efeb0887b7436873becc71a45eb", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.9", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.1|^6.0" - }, - "conflict": { - "psr/log": ">=3", - "symfony/dependency-injection": "<4.4", - "symfony/dotenv": "<5.1", - "symfony/event-dispatcher": "<4.4", - "symfony/lock": "<4.4", - "symfony/process": "<4.4" - }, - "provide": { - "psr/log-implementation": "1.0|2.0" - }, - "require-dev": { - "psr/log": "^1|^2", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/event-dispatcher": "^4.4|^5.0|^6.0", - "symfony/lock": "^4.4|^5.0|^6.0", - "symfony/process": "^4.4|^5.0|^6.0", - "symfony/var-dumper": "^4.4|^5.0|^6.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Eases the creation of beautiful and testable command line interfaces", - "homepage": "https://symfony.com", - "keywords": [ - "cli", - "command line", - "console", - "terminal" - ], - "support": { - "source": "https://github.com/symfony/console/tree/v5.4.9" - }, - "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" - } - ], - "time": "2022-05-18T06:17:34+00:00" - }, - { - "name": "symfony/deprecation-contracts", - "version": "v2.5.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "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": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.1" - }, - "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" - } - ], - "time": "2022-01-02T09:53:40+00:00" - }, - { - "name": "symfony/filesystem", - "version": "v5.4.9", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "36a017fa4cce1eff1b8e8129ff53513abcef05ba" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/36a017fa4cce1eff1b8e8129ff53513abcef05ba", - "reference": "36a017fa4cce1eff1b8e8129ff53513abcef05ba", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.8", - "symfony/polyfill-php80": "^1.16" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides basic utilities for the filesystem", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.9" - }, - "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" - } - ], - "time": "2022-05-20T13:55:35+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.25.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "30885182c981ab175d4d034db0f6f469898070ab" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", - "reference": "30885182c981ab175d4d034db0f6f469898070ab", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-ctype": "*" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.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" - } - ], - "time": "2021-10-20T20:35:02+00:00" - }, - { - "name": "symfony/polyfill-intl-grapheme", - "version": "v1.25.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "81b86b50cf841a64252b439e738e97f4a34e2783" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/81b86b50cf841a64252b439e738e97f4a34e2783", - "reference": "81b86b50cf841a64252b439e738e97f4a34e2783", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Grapheme\\": "" - } - }, - "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 intl's grapheme_* functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "grapheme", - "intl", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.25.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" - } - ], - "time": "2021-11-23T21:10:46+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.25.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", - "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-mbstring": "*" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "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.25.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" - } - ], - "time": "2021-11-30T18:21:41+00:00" - }, - { - "name": "symfony/polyfill-php73", - "version": "v1.25.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5", - "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "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.3+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.25.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" - } - ], - "time": "2021-06-05T21:20:04+00:00" - }, - { - "name": "symfony/polyfill-php80", - "version": "v1.25.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c", - "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "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.25.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" - } - ], - "time": "2022-03-04T08:16:47+00:00" - }, - { - "name": "symfony/polyfill-php81", - "version": "v1.25.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", - "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php81\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "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 8.1+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.25.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" - } - ], - "time": "2021-09-13T13:58:11+00:00" - }, - { - "name": "symfony/service-contracts", - "version": "v2.5.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "24d9dc654b83e91aa59f9d167b131bc3b5bea24c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/24d9dc654b83e91aa59f9d167b131bc3b5bea24c", - "reference": "24d9dc654b83e91aa59f9d167b131bc3b5bea24c", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "psr/container": "^1.1", - "symfony/deprecation-contracts": "^2.1|^3" - }, - "conflict": { - "ext-psr": "<1.1|>=2" - }, - "suggest": { - "symfony/service-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Service\\": "" - } - }, - "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": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.5.1" - }, - "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" - } - ], - "time": "2022-03-13T20:07:29+00:00" - }, - { - "name": "symfony/stopwatch", - "version": "v5.4.5", - "source": { - "type": "git", - "url": "https://github.com/symfony/stopwatch.git", - "reference": "4d04b5c24f3c9a1a168a131f6cbe297155bc0d30" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/4d04b5c24f3c9a1a168a131f6cbe297155bc0d30", - "reference": "4d04b5c24f3c9a1a168a131f6cbe297155bc0d30", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/service-contracts": "^1|^2|^3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Stopwatch\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides a way to profile code", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/stopwatch/tree/v5.4.5" - }, - "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" - } - ], - "time": "2022-02-18T16:06:09+00:00" - }, - { - "name": "symfony/string", - "version": "v5.4.9", - "source": { - "type": "git", - "url": "https://github.com/symfony/string.git", - "reference": "985e6a9703ef5ce32ba617c9c7d97873bb7b2a99" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/985e6a9703ef5ce32ba617c9c7d97873bb7b2a99", - "reference": "985e6a9703ef5ce32ba617c9c7d97873bb7b2a99", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.0", - "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "~1.15" - }, - "conflict": { - "symfony/translation-contracts": ">=3.0" - }, - "require-dev": { - "symfony/error-handler": "^4.4|^5.0|^6.0", - "symfony/http-client": "^4.4|^5.0|^6.0", - "symfony/translation-contracts": "^1.1|^2", - "symfony/var-exporter": "^4.4|^5.0|^6.0" - }, - "type": "library", - "autoload": { - "files": [ - "Resources/functions.php" - ], - "psr-4": { - "Symfony\\Component\\String\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "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": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", - "homepage": "https://symfony.com", - "keywords": [ - "grapheme", - "i18n", - "string", - "unicode", - "utf-8", - "utf8" - ], - "support": { - "source": "https://github.com/symfony/string/tree/v5.4.9" - }, - "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" - } - ], - "time": "2022-04-19T10:40:37+00:00" - }, - { - "name": "symfony/yaml", - "version": "v5.4.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "e80f87d2c9495966768310fc531b487ce64237a2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/e80f87d2c9495966768310fc531b487ce64237a2", - "reference": "e80f87d2c9495966768310fc531b487ce64237a2", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "symfony/console": "<5.3" - }, - "require-dev": { - "symfony/console": "^5.3|^6.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, - "bin": [ - "Resources/bin/yaml-lint" - ], - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Loads and dumps YAML files", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/yaml/tree/v5.4.3" - }, - "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" - } - ], - "time": "2022-01-26T16:32:32+00:00" - }, - { - "name": "theseer/tokenizer", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.2 || ^8.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - } - ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "support": { - "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.1" - }, - "funding": [ - { - "url": "https://github.com/theseer", - "type": "github" - } - ], - "time": "2021-07-28T10:34:58+00:00" - }, - { - "name": "vimeo/psalm", - "version": "4.23.0", - "source": { - "type": "git", - "url": "https://github.com/vimeo/psalm.git", - "reference": "f1fe6ff483bf325c803df9f510d09a03fd796f88" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/f1fe6ff483bf325c803df9f510d09a03fd796f88", - "reference": "f1fe6ff483bf325c803df9f510d09a03fd796f88", - "shasum": "" - }, - "require": { - "amphp/amp": "^2.4.2", - "amphp/byte-stream": "^1.5", - "composer/package-versions-deprecated": "^1.8.0", - "composer/semver": "^1.4 || ^2.0 || ^3.0", - "composer/xdebug-handler": "^1.1 || ^2.0 || ^3.0", - "dnoegel/php-xdg-base-dir": "^0.1.1", - "ext-ctype": "*", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-simplexml": "*", - "ext-tokenizer": "*", - "felixfbecker/advanced-json-rpc": "^3.0.3", - "felixfbecker/language-server-protocol": "^1.5", - "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", - "nikic/php-parser": "^4.13", - "openlss/lib-array2xml": "^1.0", - "php": "^7.1|^8", - "sebastian/diff": "^3.0 || ^4.0", - "symfony/console": "^3.4.17 || ^4.1.6 || ^5.0 || ^6.0", - "symfony/polyfill-php80": "^1.25", - "webmozart/path-util": "^2.3" - }, - "provide": { - "psalm/psalm": "self.version" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.2", - "brianium/paratest": "^4.0||^6.0", - "ext-curl": "*", - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpdocumentor/reflection-docblock": "^5", - "phpmyadmin/sql-parser": "5.1.0||dev-master", - "phpspec/prophecy": ">=1.9.0", - "phpunit/phpunit": "^9.0", - "psalm/plugin-phpunit": "^0.16", - "slevomat/coding-standard": "^7.0", - "squizlabs/php_codesniffer": "^3.5", - "symfony/process": "^4.3 || ^5.0 || ^6.0", - "weirdan/prophecy-shim": "^1.0 || ^2.0" - }, - "suggest": { - "ext-curl": "In order to send data to shepherd", - "ext-igbinary": "^2.0.5 is required, used to serialize caching data" - }, - "bin": [ - "psalm", - "psalm-language-server", - "psalm-plugin", - "psalm-refactor", - "psalter" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.x-dev", - "dev-3.x": "3.x-dev", - "dev-2.x": "2.x-dev", - "dev-1.x": "1.x-dev" - } - }, - "autoload": { - "files": [ - "src/functions.php", - "src/spl_object_id.php" - ], - "psr-4": { - "Psalm\\": "src/Psalm/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Matthew Brown" - } - ], - "description": "A static analysis tool for finding errors in PHP applications", - "keywords": [ - "code", - "inspection", - "php" - ], - "support": { - "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/4.23.0" - }, - "time": "2022-04-28T17:35:49+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.10.0", - "source": { - "type": "git", - "url": "https://github.com/webmozarts/assert.git", - "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", - "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.13" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "support": { - "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.10.0" - }, - "time": "2021-03-09T10:59:23+00:00" - }, - { - "name": "webmozart/path-util", - "version": "2.3.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/path-util.git", - "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/path-util/zipball/d939f7edc24c9a1bb9c0dee5cb05d8e859490725", - "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "webmozart/assert": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\PathUtil\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "A robust cross-platform utility for normalizing, comparing and modifying file paths.", - "support": { - "issues": "https://github.com/webmozart/path-util/issues", - "source": "https://github.com/webmozart/path-util/tree/2.3.0" - }, - "abandoned": "symfony/filesystem", - "time": "2015-12-17T08:42:14+00:00" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": ">=7.2" - }, - "platform-dev": [], - "plugin-api-version": "2.0.0" -} diff --git a/vendor/egulias/email-validator/src/EmailLexer.php b/vendor/egulias/email-validator/src/EmailLexer.php deleted file mode 100644 index 7e660b67..00000000 --- a/vendor/egulias/email-validator/src/EmailLexer.php +++ /dev/null @@ -1,339 +0,0 @@ - self::S_OPENCURLYBRACES, - '}' => self::S_CLOSECURLYBRACES, - '(' => self::S_OPENPARENTHESIS, - ')' => self::S_CLOSEPARENTHESIS, - '<' => self::S_LOWERTHAN, - '>' => self::S_GREATERTHAN, - '[' => self::S_OPENBRACKET, - ']' => self::S_CLOSEBRACKET, - ':' => self::S_COLON, - ';' => self::S_SEMICOLON, - '@' => self::S_AT, - '\\' => self::S_BACKSLASH, - '/' => self::S_SLASH, - ',' => self::S_COMMA, - '.' => self::S_DOT, - "'" => self::S_SQUOTE, - "`" => self::S_BACKTICK, - '"' => self::S_DQUOTE, - '-' => self::S_HYPHEN, - '::' => self::S_DOUBLECOLON, - ' ' => self::S_SP, - "\t" => self::S_HTAB, - "\r" => self::S_CR, - "\n" => self::S_LF, - "\r\n" => self::CRLF, - 'IPv6' => self::S_IPV6TAG, - '' => self::S_EMPTY, - '\0' => self::C_NUL, - '*' => self::ASTERISK, - '!' => self::EXCLAMATION, - '&' => self::AMPERSAND, - '^' => self::CARET, - '$' => self::DOLLAR, - '%' => self::PERCENTAGE, - '~' => self::S_TILDE, - '|' => self::S_PIPE, - '_' => self::S_UNDERSCORE, - '=' => self::S_EQUAL, - '+' => self::S_PLUS, - '¿' => self::INVERT_QUESTIONMARK, - '?' => self::QUESTIONMARK, - '#' => self::NUMBER_SIGN, - '¡' => self::INVERT_EXCLAMATION, - ]; - - const INVALID_CHARS_REGEX = "/[^\p{S}\p{C}\p{Cc}]+/iu"; - - const VALID_UTF8_REGEX = '/\p{Cc}+/u'; - - const CATCHABLE_PATTERNS = [ - '[a-zA-Z]+[46]?', //ASCII and domain literal - '[^\x00-\x7F]', //UTF-8 - '[0-9]+', - '\r\n', - '::', - '\s+?', - '.', - ]; - - const NON_CATCHABLE_PATTERNS = [ - '[\xA0-\xff]+', - ]; - - const MODIFIERS = 'iu'; - - /** @var bool */ - protected $hasInvalidTokens = false; - - /** - * @var array - * - * @psalm-var array{value:string, type:null|int, position:int}|array - */ - protected $previous = []; - - /** - * The last matched/seen token. - * - * @var array - * - * @psalm-suppress NonInvariantDocblockPropertyType - * @psalm-var array{value:string, type:null|int, position:int} - * @psalm-suppress NonInvariantDocblockPropertyType - */ - public $token; - - /** - * The next token in the input. - * - * @var array{position: int, type: int|null|string, value: int|string}|null - */ - public $lookahead; - - /** @psalm-var array{value:'', type:null, position:0} */ - private static $nullToken = [ - 'value' => '', - 'type' => null, - 'position' => 0, - ]; - - /** @var string */ - private $accumulator = ''; - - /** @var bool */ - private $hasToRecord = false; - - public function __construct() - { - $this->previous = $this->token = self::$nullToken; - $this->lookahead = null; - } - - public function reset() : void - { - $this->hasInvalidTokens = false; - parent::reset(); - $this->previous = $this->token = self::$nullToken; - } - - /** - * @param int $type - * @throws \UnexpectedValueException - * @return boolean - * - * @psalm-suppress InvalidScalarArgument - */ - public function find($type) : bool - { - $search = clone $this; - $search->skipUntil($type); - - if (!$search->lookahead) { - throw new \UnexpectedValueException($type . ' not found'); - } - return true; - } - - /** - * moveNext - * - * @return boolean - */ - public function moveNext() : bool - { - if ($this->hasToRecord && $this->previous === self::$nullToken) { - $this->accumulator .= $this->token['value']; - } - - $this->previous = $this->token; - - if($this->lookahead === null) { - $this->lookahead = self::$nullToken; - } - - $hasNext = parent::moveNext(); - - if ($this->hasToRecord) { - $this->accumulator .= $this->token['value']; - } - - return $hasNext; - } - - /** - * Retrieve token type. Also processes the token value if necessary. - * - * @param string $value - * @throws \InvalidArgumentException - * @return integer - */ - protected function getType(&$value) - { - $encoded = $value; - - if (mb_detect_encoding($value, 'auto', true) !== 'UTF-8') { - $encoded = mb_convert_encoding($value, 'UTF-8', 'Windows-1252'); - } - - if ($this->isValid($encoded)) { - return $this->charValue[$encoded]; - } - - if ($this->isNullType($encoded)) { - return self::C_NUL; - } - - if ($this->isInvalidChar($encoded)) { - $this->hasInvalidTokens = true; - return self::INVALID; - } - - - return self::GENERIC; - } - - protected function isValid(string $value) : bool - { - return isset($this->charValue[$value]); - } - - protected function isNullType(string $value) : bool - { - return $value === "\0"; - } - - protected function isInvalidChar(string $value) : bool - { - return !preg_match(self::INVALID_CHARS_REGEX, $value); - } - - protected function isUTF8Invalid(string $value) : bool - { - return preg_match(self::VALID_UTF8_REGEX, $value) !== false; - } - - public function hasInvalidTokens() : bool - { - return $this->hasInvalidTokens; - } - - /** - * getPrevious - * - * @return array - */ - public function getPrevious() : array - { - return $this->previous; - } - - /** - * Lexical catchable patterns. - * - * @return string[] - */ - protected function getCatchablePatterns() : array - { - return self::CATCHABLE_PATTERNS; - } - - /** - * Lexical non-catchable patterns. - * - * @return string[] - */ - protected function getNonCatchablePatterns() : array - { - return self::NON_CATCHABLE_PATTERNS; - } - - protected function getModifiers() : string - { - return self::MODIFIERS; - } - - public function getAccumulatedValues() : string - { - return $this->accumulator; - } - - public function startRecording() : void - { - $this->hasToRecord = true; - } - - public function stopRecording() : void - { - $this->hasToRecord = false; - } - - public function clearRecorded() : void - { - $this->accumulator = ''; - } -} diff --git a/vendor/egulias/email-validator/src/EmailParser.php b/vendor/egulias/email-validator/src/EmailParser.php deleted file mode 100644 index c78f74a9..00000000 --- a/vendor/egulias/email-validator/src/EmailParser.php +++ /dev/null @@ -1,91 +0,0 @@ -addLongEmailWarning($this->localPart, $this->domainPart); - - return $result; - } - - protected function preLeftParsing(): Result - { - if (!$this->hasAtToken()) { - return new InvalidEmail(new NoLocalPart(), $this->lexer->token["value"]); - } - return new ValidEmail(); - } - - protected function parseLeftFromAt(): Result - { - return $this->processLocalPart(); - } - - protected function parseRightFromAt(): Result - { - return $this->processDomainPart(); - } - - private function processLocalPart() : Result - { - $localPartParser = new LocalPart($this->lexer); - $localPartResult = $localPartParser->parse(); - $this->localPart = $localPartParser->localPart(); - $this->warnings = array_merge($localPartParser->getWarnings(), $this->warnings); - - return $localPartResult; - } - - private function processDomainPart() : Result - { - $domainPartParser = new DomainPart($this->lexer); - $domainPartResult = $domainPartParser->parse(); - $this->domainPart = $domainPartParser->domainPart(); - $this->warnings = array_merge($domainPartParser->getWarnings(), $this->warnings); - - return $domainPartResult; - } - - public function getDomainPart() : string - { - return $this->domainPart; - } - - public function getLocalPart() : string - { - return $this->localPart; - } - - private function addLongEmailWarning(string $localPart, string $parsedDomainPart) : void - { - if (strlen($localPart . '@' . $parsedDomainPart) > self::EMAIL_MAX_LENGTH) { - $this->warnings[EmailTooLong::CODE] = new EmailTooLong(); - } - } -} diff --git a/vendor/egulias/email-validator/src/EmailValidator.php b/vendor/egulias/email-validator/src/EmailValidator.php deleted file mode 100644 index 5a2e5c82..00000000 --- a/vendor/egulias/email-validator/src/EmailValidator.php +++ /dev/null @@ -1,67 +0,0 @@ -lexer = new EmailLexer(); - } - - /** - * @param string $email - * @param EmailValidation $emailValidation - * @return bool - */ - public function isValid(string $email, EmailValidation $emailValidation) - { - $isValid = $emailValidation->isValid($email, $this->lexer); - $this->warnings = $emailValidation->getWarnings(); - $this->error = $emailValidation->getError(); - - return $isValid; - } - - /** - * @return boolean - */ - public function hasWarnings() - { - return !empty($this->warnings); - } - - /** - * @return array - */ - public function getWarnings() - { - return $this->warnings; - } - - /** - * @return InvalidEmail|null - */ - public function getError() - { - return $this->error; - } -} diff --git a/vendor/egulias/email-validator/src/MessageIDParser.php b/vendor/egulias/email-validator/src/MessageIDParser.php deleted file mode 100644 index fe58b9f4..00000000 --- a/vendor/egulias/email-validator/src/MessageIDParser.php +++ /dev/null @@ -1,92 +0,0 @@ -addLongEmailWarning($this->idLeft, $this->idRight); - - return $result; - } - - protected function preLeftParsing(): Result - { - if (!$this->hasAtToken()) { - return new InvalidEmail(new NoLocalPart(), $this->lexer->token["value"]); - } - return new ValidEmail(); - } - - protected function parseLeftFromAt(): Result - { - return $this->processIDLeft(); - } - - protected function parseRightFromAt(): Result - { - return $this->processIDRight(); - } - - private function processIDLeft() : Result - { - $localPartParser = new IDLeftPart($this->lexer); - $localPartResult = $localPartParser->parse(); - $this->idLeft = $localPartParser->localPart(); - $this->warnings = array_merge($localPartParser->getWarnings(), $this->warnings); - - return $localPartResult; - } - - private function processIDRight() : Result - { - $domainPartParser = new IDRightPart($this->lexer); - $domainPartResult = $domainPartParser->parse(); - $this->idRight = $domainPartParser->domainPart(); - $this->warnings = array_merge($domainPartParser->getWarnings(), $this->warnings); - - return $domainPartResult; - } - - public function getLeftPart() : string - { - return $this->idLeft; - } - - public function getRightPart() : string - { - return $this->idRight; - } - - private function addLongEmailWarning(string $localPart, string $parsedDomainPart) : void - { - if (strlen($localPart . '@' . $parsedDomainPart) > self::EMAILID_MAX_LENGTH) { - $this->warnings[EmailTooLong::CODE] = new EmailTooLong(); - } - } -} \ No newline at end of file diff --git a/vendor/egulias/email-validator/src/Parser.php b/vendor/egulias/email-validator/src/Parser.php deleted file mode 100644 index b1905f9a..00000000 --- a/vendor/egulias/email-validator/src/Parser.php +++ /dev/null @@ -1,78 +0,0 @@ -lexer = $lexer; - } - - public function parse(string $str) : Result - { - $this->lexer->setInput($str); - - if ($this->lexer->hasInvalidTokens()) { - return new InvalidEmail(new ExpectingATEXT("Invalid tokens found"), $this->lexer->token["value"]); - } - - $preParsingResult = $this->preLeftParsing(); - if ($preParsingResult->isInvalid()) { - return $preParsingResult; - } - - $localPartResult = $this->parseLeftFromAt(); - - if ($localPartResult->isInvalid()) { - return $localPartResult; - } - - $domainPartResult = $this->parseRightFromAt(); - - if ($domainPartResult->isInvalid()) { - return $domainPartResult; - } - - return new ValidEmail(); - } - - /** - * @return Warning\Warning[] - */ - public function getWarnings() : array - { - return $this->warnings; - } - - protected function hasAtToken() : bool - { - $this->lexer->moveNext(); - $this->lexer->moveNext(); - - return $this->lexer->token['type'] !== EmailLexer::S_AT; - } -} diff --git a/vendor/egulias/email-validator/src/Parser/Comment.php b/vendor/egulias/email-validator/src/Parser/Comment.php deleted file mode 100644 index ffa61281..00000000 --- a/vendor/egulias/email-validator/src/Parser/Comment.php +++ /dev/null @@ -1,103 +0,0 @@ -lexer = $lexer; - $this->commentStrategy = $commentStrategy; - } - - public function parse() : Result - { - if ($this->lexer->token['type'] === EmailLexer::S_OPENPARENTHESIS) { - $this->openedParenthesis++; - if($this->noClosingParenthesis()) { - return new InvalidEmail(new UnclosedComment(), $this->lexer->token['value']); - } - } - - if ($this->lexer->token['type'] === EmailLexer::S_CLOSEPARENTHESIS) { - return new InvalidEmail(new UnOpenedComment(), $this->lexer->token['value']); - } - - $this->warnings[WarningComment::CODE] = new WarningComment(); - - $moreTokens = true; - while ($this->commentStrategy->exitCondition($this->lexer, $this->openedParenthesis) && $moreTokens){ - - if ($this->lexer->isNextToken(EmailLexer::S_OPENPARENTHESIS)) { - $this->openedParenthesis++; - } - $this->warnEscaping(); - if($this->lexer->isNextToken(EmailLexer::S_CLOSEPARENTHESIS)) { - $this->openedParenthesis--; - } - $moreTokens = $this->lexer->moveNext(); - } - - if($this->openedParenthesis >= 1) { - return new InvalidEmail(new UnclosedComment(), $this->lexer->token['value']); - } else if ($this->openedParenthesis < 0) { - return new InvalidEmail(new UnOpenedComment(), $this->lexer->token['value']); - } - - $finalValidations = $this->commentStrategy->endOfLoopValidations($this->lexer); - - $this->warnings = array_merge($this->warnings, $this->commentStrategy->getWarnings()); - - return $finalValidations; - } - - - /** - * @return bool - */ - private function warnEscaping() : bool - { - //Backslash found - if ($this->lexer->token['type'] !== EmailLexer::S_BACKSLASH) { - return false; - } - - if (!$this->lexer->isNextTokenAny(array(EmailLexer::S_SP, EmailLexer::S_HTAB, EmailLexer::C_DEL))) { - return false; - } - - $this->warnings[QuotedPart::CODE] = - new QuotedPart($this->lexer->getPrevious()['type'], $this->lexer->token['type']); - return true; - - } - - private function noClosingParenthesis() : bool - { - try { - $this->lexer->find(EmailLexer::S_CLOSEPARENTHESIS); - return false; - } catch (\RuntimeException $e) { - return true; - } - } -} \ No newline at end of file diff --git a/vendor/egulias/email-validator/src/Parser/CommentStrategy/CommentStrategy.php b/vendor/egulias/email-validator/src/Parser/CommentStrategy/CommentStrategy.php deleted file mode 100644 index c388efd6..00000000 --- a/vendor/egulias/email-validator/src/Parser/CommentStrategy/CommentStrategy.php +++ /dev/null @@ -1,18 +0,0 @@ -isNextToken(EmailLexer::S_DOT))){ // || !$internalLexer->moveNext()) { - return false; - } - - return true; - } - - public function endOfLoopValidations(EmailLexer $lexer) : Result - { - //test for end of string - if (!$lexer->isNextToken(EmailLexer::S_DOT)) { - return new InvalidEmail(new ExpectingATEXT('DOT not found near CLOSEPARENTHESIS'), $lexer->token['value']); - } - //add warning - //Address is valid within the message but cannot be used unmodified for the envelope - return new ValidEmail(); - } - - public function getWarnings(): array - { - return []; - } -} \ No newline at end of file diff --git a/vendor/egulias/email-validator/src/Parser/CommentStrategy/LocalComment.php b/vendor/egulias/email-validator/src/Parser/CommentStrategy/LocalComment.php deleted file mode 100644 index 73bc7b2b..00000000 --- a/vendor/egulias/email-validator/src/Parser/CommentStrategy/LocalComment.php +++ /dev/null @@ -1,37 +0,0 @@ -isNextToken(EmailLexer::S_AT); - } - - public function endOfLoopValidations(EmailLexer $lexer) : Result - { - if (!$lexer->isNextToken(EmailLexer::S_AT)) { - return new InvalidEmail(new ExpectingATEXT('ATEX is not expected after closing comments'), $lexer->token['value']); - } - $this->warnings[CFWSNearAt::CODE] = new CFWSNearAt(); - return new ValidEmail(); - } - - public function getWarnings(): array - { - return $this->warnings; - } -} \ No newline at end of file diff --git a/vendor/egulias/email-validator/src/Parser/DomainLiteral.php b/vendor/egulias/email-validator/src/Parser/DomainLiteral.php deleted file mode 100644 index 4e5b8bf7..00000000 --- a/vendor/egulias/email-validator/src/Parser/DomainLiteral.php +++ /dev/null @@ -1,211 +0,0 @@ -addTagWarnings(); - - $IPv6TAG = false; - $addressLiteral = ''; - - do { - if ($this->lexer->token['type'] === EmailLexer::C_NUL) { - return new InvalidEmail(new ExpectingDTEXT(), $this->lexer->token['value']); - } - - $this->addObsoleteWarnings(); - - if ($this->lexer->isNextTokenAny(array(EmailLexer::S_OPENBRACKET, EmailLexer::S_OPENBRACKET))) { - return new InvalidEmail(new ExpectingDTEXT(), $this->lexer->token['value']); - } - - if ($this->lexer->isNextTokenAny( - array(EmailLexer::S_HTAB, EmailLexer::S_SP, EmailLexer::CRLF) - )) { - $this->warnings[CFWSWithFWS::CODE] = new CFWSWithFWS(); - $this->parseFWS(); - } - - if ($this->lexer->isNextToken(EmailLexer::S_CR)) { - return new InvalidEmail(new CRNoLF(), $this->lexer->token['value']); - } - - if ($this->lexer->token['type'] === EmailLexer::S_BACKSLASH) { - return new InvalidEmail(new UnusualElements($this->lexer->token['value']), $this->lexer->token['value']); - } - if ($this->lexer->token['type'] === EmailLexer::S_IPV6TAG) { - $IPv6TAG = true; - } - - if ($this->lexer->token['type'] === EmailLexer::S_CLOSEBRACKET) { - break; - } - - $addressLiteral .= $this->lexer->token['value']; - - } while ($this->lexer->moveNext()); - - - //Encapsulate - $addressLiteral = str_replace('[', '', $addressLiteral); - $isAddressLiteralIPv4 = $this->checkIPV4Tag($addressLiteral); - - if (!$isAddressLiteralIPv4) { - return new ValidEmail(); - } else { - $addressLiteral = $this->convertIPv4ToIPv6($addressLiteral); - } - - if (!$IPv6TAG) { - $this->warnings[WarningDomainLiteral::CODE] = new WarningDomainLiteral(); - return new ValidEmail(); - } - - $this->warnings[AddressLiteral::CODE] = new AddressLiteral(); - - $this->checkIPV6Tag($addressLiteral); - - return new ValidEmail(); - } - - /** - * @param string $addressLiteral - * @param int $maxGroups - */ - public function checkIPV6Tag($addressLiteral, $maxGroups = 8) : void - { - $prev = $this->lexer->getPrevious(); - if ($prev['type'] === EmailLexer::S_COLON) { - $this->warnings[IPV6ColonEnd::CODE] = new IPV6ColonEnd(); - } - - $IPv6 = substr($addressLiteral, 5); - //Daniel Marschall's new IPv6 testing strategy - $matchesIP = explode(':', $IPv6); - $groupCount = count($matchesIP); - $colons = strpos($IPv6, '::'); - - if (count(preg_grep('/^[0-9A-Fa-f]{0,4}$/', $matchesIP, PREG_GREP_INVERT)) !== 0) { - $this->warnings[IPV6BadChar::CODE] = new IPV6BadChar(); - } - - if ($colons === false) { - // We need exactly the right number of groups - if ($groupCount !== $maxGroups) { - $this->warnings[IPV6GroupCount::CODE] = new IPV6GroupCount(); - } - return; - } - - if ($colons !== strrpos($IPv6, '::')) { - $this->warnings[IPV6DoubleColon::CODE] = new IPV6DoubleColon(); - return; - } - - if ($colons === 0 || $colons === (strlen($IPv6) - 2)) { - // RFC 4291 allows :: at the start or end of an address - //with 7 other groups in addition - ++$maxGroups; - } - - if ($groupCount > $maxGroups) { - $this->warnings[IPV6MaxGroups::CODE] = new IPV6MaxGroups(); - } elseif ($groupCount === $maxGroups) { - $this->warnings[IPV6Deprecated::CODE] = new IPV6Deprecated(); - } - } - - public function convertIPv4ToIPv6(string $addressLiteralIPv4) : string - { - $matchesIP = []; - $IPv4Match = preg_match(self::IPV4_REGEX, $addressLiteralIPv4, $matchesIP); - - // Extract IPv4 part from the end of the address-literal (if there is one) - if ($IPv4Match > 0) { - $index = (int) strrpos($addressLiteralIPv4, $matchesIP[0]); - //There's a match but it is at the start - if ($index > 0) { - // Convert IPv4 part to IPv6 format for further testing - return substr($addressLiteralIPv4, 0, $index) . '0:0'; - } - } - - return $addressLiteralIPv4; - } - - /** - * @param string $addressLiteral - * - * @return bool - */ - protected function checkIPV4Tag($addressLiteral) : bool - { - $matchesIP = []; - $IPv4Match = preg_match(self::IPV4_REGEX, $addressLiteral, $matchesIP); - - // Extract IPv4 part from the end of the address-literal (if there is one) - - if ($IPv4Match > 0) { - $index = strrpos($addressLiteral, $matchesIP[0]); - //There's a match but it is at the start - if ($index === 0) { - $this->warnings[AddressLiteral::CODE] = new AddressLiteral(); - return false; - } - } - - return true; - } - - private function addObsoleteWarnings() : void - { - if(in_array($this->lexer->token['type'], self::OBSOLETE_WARNINGS)) { - $this->warnings[ObsoleteDTEXT::CODE] = new ObsoleteDTEXT(); - } - } - - private function addTagWarnings() : void - { - if ($this->lexer->isNextToken(EmailLexer::S_COLON)) { - $this->warnings[IPV6ColonStart::CODE] = new IPV6ColonStart(); - } - if ($this->lexer->isNextToken(EmailLexer::S_IPV6TAG)) { - $lexer = clone $this->lexer; - $lexer->moveNext(); - if ($lexer->isNextToken(EmailLexer::S_DOUBLECOLON)) { - $this->warnings[IPV6ColonStart::CODE] = new IPV6ColonStart(); - } - } - } - -} \ No newline at end of file diff --git a/vendor/egulias/email-validator/src/Parser/DomainPart.php b/vendor/egulias/email-validator/src/Parser/DomainPart.php deleted file mode 100644 index f1717409..00000000 --- a/vendor/egulias/email-validator/src/Parser/DomainPart.php +++ /dev/null @@ -1,312 +0,0 @@ -lexer->clearRecorded(); - $this->lexer->startRecording(); - - $this->lexer->moveNext(); - - $domainChecks = $this->performDomainStartChecks(); - if ($domainChecks->isInvalid()) { - return $domainChecks; - } - - if ($this->lexer->token['type'] === EmailLexer::S_AT) { - return new InvalidEmail(new ConsecutiveAt(), $this->lexer->token['value']); - } - - $result = $this->doParseDomainPart(); - if ($result->isInvalid()) { - return $result; - } - - $end = $this->checkEndOfDomain(); - if ($end->isInvalid()) { - return $end; - } - - $this->lexer->stopRecording(); - $this->domainPart = $this->lexer->getAccumulatedValues(); - - $length = strlen($this->domainPart); - if ($length > self::DOMAIN_MAX_LENGTH) { - return new InvalidEmail(new DomainTooLong(), $this->lexer->token['value']); - } - - return new ValidEmail(); - } - - private function checkEndOfDomain() : Result - { - $prev = $this->lexer->getPrevious(); - if ($prev['type'] === EmailLexer::S_DOT) { - return new InvalidEmail(new DotAtEnd(), $this->lexer->token['value']); - } - if ($prev['type'] === EmailLexer::S_HYPHEN) { - return new InvalidEmail(new DomainHyphened('Hypen found at the end of the domain'), $prev['value']); - } - - if ($this->lexer->token['type'] === EmailLexer::S_SP) { - return new InvalidEmail(new CRLFAtTheEnd(), $prev['value']); - } - return new ValidEmail(); - - } - - private function performDomainStartChecks() : Result - { - $invalidTokens = $this->checkInvalidTokensAfterAT(); - if ($invalidTokens->isInvalid()) { - return $invalidTokens; - } - - $missingDomain = $this->checkEmptyDomain(); - if ($missingDomain->isInvalid()) { - return $missingDomain; - } - - if ($this->lexer->token['type'] === EmailLexer::S_OPENPARENTHESIS) { - $this->warnings[DeprecatedComment::CODE] = new DeprecatedComment(); - } - return new ValidEmail(); - } - - private function checkEmptyDomain() : Result - { - $thereIsNoDomain = $this->lexer->token['type'] === EmailLexer::S_EMPTY || - ($this->lexer->token['type'] === EmailLexer::S_SP && - !$this->lexer->isNextToken(EmailLexer::GENERIC)); - - if ($thereIsNoDomain) { - return new InvalidEmail(new NoDomainPart(), $this->lexer->token['value']); - } - - return new ValidEmail(); - } - - private function checkInvalidTokensAfterAT() : Result - { - if ($this->lexer->token['type'] === EmailLexer::S_DOT) { - return new InvalidEmail(new DotAtStart(), $this->lexer->token['value']); - } - if ($this->lexer->token['type'] === EmailLexer::S_HYPHEN) { - return new InvalidEmail(new DomainHyphened('After AT'), $this->lexer->token['value']); - } - return new ValidEmail(); - } - - protected function parseComments(): Result - { - $commentParser = new Comment($this->lexer, new DomainComment()); - $result = $commentParser->parse(); - $this->warnings = array_merge($this->warnings, $commentParser->getWarnings()); - - return $result; - } - - protected function doParseDomainPart() : Result - { - $tldMissing = true; - $hasComments = false; - $domain = ''; - do { - $prev = $this->lexer->getPrevious(); - - $notAllowedChars = $this->checkNotAllowedChars($this->lexer->token); - if ($notAllowedChars->isInvalid()) { - return $notAllowedChars; - } - - if ($this->lexer->token['type'] === EmailLexer::S_OPENPARENTHESIS || - $this->lexer->token['type'] === EmailLexer::S_CLOSEPARENTHESIS ) { - $hasComments = true; - $commentsResult = $this->parseComments(); - - //Invalid comment parsing - if($commentsResult->isInvalid()) { - return $commentsResult; - } - } - - $dotsResult = $this->checkConsecutiveDots(); - if ($dotsResult->isInvalid()) { - return $dotsResult; - } - - if ($this->lexer->token['type'] === EmailLexer::S_OPENBRACKET) { - $literalResult = $this->parseDomainLiteral(); - - $this->addTLDWarnings($tldMissing); - return $literalResult; - } - - $labelCheck = $this->checkLabelLength(); - if ($labelCheck->isInvalid()) { - return $labelCheck; - } - - $FwsResult = $this->parseFWS(); - if($FwsResult->isInvalid()) { - return $FwsResult; - } - - $domain .= $this->lexer->token['value']; - - if ($this->lexer->token['type'] === EmailLexer::S_DOT && $this->lexer->isNextToken(EmailLexer::GENERIC)) { - $tldMissing = false; - } - - $exceptionsResult = $this->checkDomainPartExceptions($prev, $hasComments); - if ($exceptionsResult->isInvalid()) { - return $exceptionsResult; - } - $this->lexer->moveNext(); - - } while (null !== $this->lexer->token['type']); - - $labelCheck = $this->checkLabelLength(true); - if ($labelCheck->isInvalid()) { - return $labelCheck; - } - $this->addTLDWarnings($tldMissing); - - $this->domainPart = $domain; - return new ValidEmail(); - } - - private function checkNotAllowedChars(array $token) : Result - { - $notAllowed = [EmailLexer::S_BACKSLASH => true, EmailLexer::S_SLASH=> true]; - if (isset($notAllowed[$token['type']])) { - return new InvalidEmail(new CharNotAllowed(), $token['value']); - } - return new ValidEmail(); - } - - /** - * @return Result - */ - protected function parseDomainLiteral() : Result - { - try { - $this->lexer->find(EmailLexer::S_CLOSEBRACKET); - } catch (\RuntimeException $e) { - return new InvalidEmail(new ExpectingDomainLiteralClose(), $this->lexer->token['value']); - } - - $domainLiteralParser = new DomainLiteralParser($this->lexer); - $result = $domainLiteralParser->parse(); - $this->warnings = array_merge($this->warnings, $domainLiteralParser->getWarnings()); - return $result; - } - - protected function checkDomainPartExceptions(array $prev, bool $hasComments) : Result - { - if ($this->lexer->token['type'] === EmailLexer::S_OPENBRACKET && $prev['type'] !== EmailLexer::S_AT) { - return new InvalidEmail(new ExpectingATEXT('OPENBRACKET not after AT'), $this->lexer->token['value']); - } - - if ($this->lexer->token['type'] === EmailLexer::S_HYPHEN && $this->lexer->isNextToken(EmailLexer::S_DOT)) { - return new InvalidEmail(new DomainHyphened('Hypen found near DOT'), $this->lexer->token['value']); - } - - if ($this->lexer->token['type'] === EmailLexer::S_BACKSLASH - && $this->lexer->isNextToken(EmailLexer::GENERIC)) { - return new InvalidEmail(new ExpectingATEXT('Escaping following "ATOM"'), $this->lexer->token['value']); - } - - return $this->validateTokens($hasComments); - } - - protected function validateTokens(bool $hasComments) : Result - { - $validDomainTokens = array( - EmailLexer::GENERIC => true, - EmailLexer::S_HYPHEN => true, - EmailLexer::S_DOT => true, - ); - - if ($hasComments) { - $validDomainTokens[EmailLexer::S_OPENPARENTHESIS] = true; - $validDomainTokens[EmailLexer::S_CLOSEPARENTHESIS] = true; - } - - if (!isset($validDomainTokens[$this->lexer->token['type']])) { - return new InvalidEmail(new ExpectingATEXT('Invalid token in domain: ' . $this->lexer->token['value']), $this->lexer->token['value']); - } - - return new ValidEmail(); - } - - private function checkLabelLength(bool $isEndOfDomain = false) : Result - { - if ($this->lexer->token['type'] === EmailLexer::S_DOT || $isEndOfDomain) { - if ($this->isLabelTooLong($this->label)) { - return new InvalidEmail(new LabelTooLong(), $this->lexer->token['value']); - } - $this->label = ''; - } - $this->label .= $this->lexer->token['value']; - return new ValidEmail(); - } - - - private function isLabelTooLong(string $label) : bool - { - if (preg_match('/[^\x00-\x7F]/', $label)) { - idn_to_ascii($label, IDNA_DEFAULT, INTL_IDNA_VARIANT_UTS46, $idnaInfo); - return (bool) ($idnaInfo['errors'] & IDNA_ERROR_LABEL_TOO_LONG); - } - return strlen($label) > self::LABEL_MAX_LENGTH; - } - - private function addTLDWarnings(bool $isTLDMissing) : void - { - if ($isTLDMissing) { - $this->warnings[TLD::CODE] = new TLD(); - } - } - - public function domainPart() : string - { - return $this->domainPart; - } -} diff --git a/vendor/egulias/email-validator/src/Parser/DoubleQuote.php b/vendor/egulias/email-validator/src/Parser/DoubleQuote.php deleted file mode 100644 index 8b832737..00000000 --- a/vendor/egulias/email-validator/src/Parser/DoubleQuote.php +++ /dev/null @@ -1,88 +0,0 @@ -checkDQUOTE(); - if($validQuotedString->isInvalid()) return $validQuotedString; - - $special = [ - EmailLexer::S_CR => true, - EmailLexer::S_HTAB => true, - EmailLexer::S_LF => true - ]; - - $invalid = [ - EmailLexer::C_NUL => true, - EmailLexer::S_HTAB => true, - EmailLexer::S_CR => true, - EmailLexer::S_LF => true - ]; - - $setSpecialsWarning = true; - - $this->lexer->moveNext(); - - while ($this->lexer->token['type'] !== EmailLexer::S_DQUOTE && null !== $this->lexer->token['type']) { - if (isset($special[$this->lexer->token['type']]) && $setSpecialsWarning) { - $this->warnings[CFWSWithFWS::CODE] = new CFWSWithFWS(); - $setSpecialsWarning = false; - } - if ($this->lexer->token['type'] === EmailLexer::S_BACKSLASH && $this->lexer->isNextToken(EmailLexer::S_DQUOTE)) { - $this->lexer->moveNext(); - } - - $this->lexer->moveNext(); - - if (!$this->escaped() && isset($invalid[$this->lexer->token['type']])) { - return new InvalidEmail(new ExpectingATEXT("Expecting ATEXT between DQUOTE"), $this->lexer->token['value']); - } - } - - $prev = $this->lexer->getPrevious(); - - if ($prev['type'] === EmailLexer::S_BACKSLASH) { - $validQuotedString = $this->checkDQUOTE(); - if($validQuotedString->isInvalid()) return $validQuotedString; - } - - if (!$this->lexer->isNextToken(EmailLexer::S_AT) && $prev['type'] !== EmailLexer::S_BACKSLASH) { - return new InvalidEmail(new ExpectingATEXT("Expecting ATEXT between DQUOTE"), $this->lexer->token['value']); - } - - return new ValidEmail(); - } - - protected function checkDQUOTE() : Result - { - $previous = $this->lexer->getPrevious(); - - if ($this->lexer->isNextToken(EmailLexer::GENERIC) && $previous['type'] === EmailLexer::GENERIC) { - $description = 'https://tools.ietf.org/html/rfc5322#section-3.2.4 - quoted string should be a unit'; - return new InvalidEmail(new ExpectingATEXT($description), $this->lexer->token['value']); - } - - try { - $this->lexer->find(EmailLexer::S_DQUOTE); - } catch (\Exception $e) { - return new InvalidEmail(new UnclosedQuotedString(), $this->lexer->token['value']); - } - $this->warnings[QuotedString::CODE] = new QuotedString($previous['value'], $this->lexer->token['value']); - - return new ValidEmail(); - } - -} \ No newline at end of file diff --git a/vendor/egulias/email-validator/src/Parser/FoldingWhiteSpace.php b/vendor/egulias/email-validator/src/Parser/FoldingWhiteSpace.php deleted file mode 100644 index da17d434..00000000 --- a/vendor/egulias/email-validator/src/Parser/FoldingWhiteSpace.php +++ /dev/null @@ -1,86 +0,0 @@ -isFWS()) { - return new ValidEmail(); - } - - $previous = $this->lexer->getPrevious(); - - $resultCRLF = $this->checkCRLFInFWS(); - if ($resultCRLF->isInvalid()) { - return $resultCRLF; - } - - if ($this->lexer->token['type'] === EmailLexer::S_CR) { - return new InvalidEmail(new CRNoLF(), $this->lexer->token['value']); - } - - if ($this->lexer->isNextToken(EmailLexer::GENERIC) && $previous['type'] !== EmailLexer::S_AT) { - return new InvalidEmail(new AtextAfterCFWS(), $this->lexer->token['value']); - } - - if ($this->lexer->token['type'] === EmailLexer::S_LF || $this->lexer->token['type'] === EmailLexer::C_NUL) { - return new InvalidEmail(new ExpectingCTEXT(), $this->lexer->token['value']); - } - - if ($this->lexer->isNextToken(EmailLexer::S_AT) || $previous['type'] === EmailLexer::S_AT) { - $this->warnings[CFWSNearAt::CODE] = new CFWSNearAt(); - } else { - $this->warnings[CFWSWithFWS::CODE] = new CFWSWithFWS(); - } - - return new ValidEmail(); - } - - protected function checkCRLFInFWS() : Result - { - if ($this->lexer->token['type'] !== EmailLexer::CRLF) { - return new ValidEmail(); - } - - if (!$this->lexer->isNextTokenAny(array(EmailLexer::S_SP, EmailLexer::S_HTAB))) { - return new InvalidEmail(new CRLFX2(), $this->lexer->token['value']); - } - - //this has no coverage. Condition is repeated from above one - if (!$this->lexer->isNextTokenAny(array(EmailLexer::S_SP, EmailLexer::S_HTAB))) { - return new InvalidEmail(new CRLFAtTheEnd(), $this->lexer->token['value']); - } - - return new ValidEmail(); - } - - protected function isFWS() : bool - { - if ($this->escaped()) { - return false; - } - - return in_array($this->lexer->token['type'], self::FWS_TYPES); - } -} \ No newline at end of file diff --git a/vendor/egulias/email-validator/src/Parser/IDLeftPart.php b/vendor/egulias/email-validator/src/Parser/IDLeftPart.php deleted file mode 100644 index abb4982b..00000000 --- a/vendor/egulias/email-validator/src/Parser/IDLeftPart.php +++ /dev/null @@ -1,16 +0,0 @@ -lexer->token['value']); - } -} \ No newline at end of file diff --git a/vendor/egulias/email-validator/src/Parser/IDRightPart.php b/vendor/egulias/email-validator/src/Parser/IDRightPart.php deleted file mode 100644 index 24325627..00000000 --- a/vendor/egulias/email-validator/src/Parser/IDRightPart.php +++ /dev/null @@ -1,29 +0,0 @@ - true, - EmailLexer::S_SQUOTE => true, - EmailLexer::S_BACKTICK => true, - EmailLexer::S_SEMICOLON => true, - EmailLexer::S_GREATERTHAN => true, - EmailLexer::S_LOWERTHAN => true, - ]; - - if (isset($invalidDomainTokens[$this->lexer->token['type']])) { - return new InvalidEmail(new ExpectingATEXT('Invalid token in domain: ' . $this->lexer->token['value']), $this->lexer->token['value']); - } - return new ValidEmail(); - } -} \ No newline at end of file diff --git a/vendor/egulias/email-validator/src/Parser/LocalPart.php b/vendor/egulias/email-validator/src/Parser/LocalPart.php deleted file mode 100644 index 90f01a52..00000000 --- a/vendor/egulias/email-validator/src/Parser/LocalPart.php +++ /dev/null @@ -1,165 +0,0 @@ - EmailLexer::S_COMMA, - EmailLexer::S_CLOSEBRACKET => EmailLexer::S_CLOSEBRACKET, - EmailLexer::S_OPENBRACKET => EmailLexer::S_OPENBRACKET, - EmailLexer::S_GREATERTHAN => EmailLexer::S_GREATERTHAN, - EmailLexer::S_LOWERTHAN => EmailLexer::S_LOWERTHAN, - EmailLexer::S_COLON => EmailLexer::S_COLON, - EmailLexer::S_SEMICOLON => EmailLexer::S_SEMICOLON, - EmailLexer::INVALID => EmailLexer::INVALID - ]; - - /** - * @var string - */ - private $localPart = ''; - - - public function parse() : Result - { - $this->lexer->startRecording(); - - while ($this->lexer->token['type'] !== EmailLexer::S_AT && null !== $this->lexer->token['type']) { - if ($this->hasDotAtStart()) { - return new InvalidEmail(new DotAtStart(), $this->lexer->token['value']); - } - - if ($this->lexer->token['type'] === EmailLexer::S_DQUOTE) { - $dquoteParsingResult = $this->parseDoubleQuote(); - - //Invalid double quote parsing - if($dquoteParsingResult->isInvalid()) { - return $dquoteParsingResult; - } - } - - if ($this->lexer->token['type'] === EmailLexer::S_OPENPARENTHESIS || - $this->lexer->token['type'] === EmailLexer::S_CLOSEPARENTHESIS ) { - $commentsResult = $this->parseComments(); - - //Invalid comment parsing - if($commentsResult->isInvalid()) { - return $commentsResult; - } - } - - if ($this->lexer->token['type'] === EmailLexer::S_DOT && $this->lexer->isNextToken(EmailLexer::S_DOT)) { - return new InvalidEmail(new ConsecutiveDot(), $this->lexer->token['value']); - } - - if ($this->lexer->token['type'] === EmailLexer::S_DOT && - $this->lexer->isNextToken(EmailLexer::S_AT) - ) { - return new InvalidEmail(new DotAtEnd(), $this->lexer->token['value']); - } - - $resultEscaping = $this->validateEscaping(); - if ($resultEscaping->isInvalid()) { - return $resultEscaping; - } - - $resultToken = $this->validateTokens(false); - if ($resultToken->isInvalid()) { - return $resultToken; - } - - $resultFWS = $this->parseLocalFWS(); - if($resultFWS->isInvalid()) { - return $resultFWS; - } - - $this->lexer->moveNext(); - } - - $this->lexer->stopRecording(); - $this->localPart = rtrim($this->lexer->getAccumulatedValues(), '@'); - if (strlen($this->localPart) > LocalTooLong::LOCAL_PART_LENGTH) { - $this->warnings[LocalTooLong::CODE] = new LocalTooLong(); - } - - return new ValidEmail(); - } - - protected function validateTokens(bool $hasComments) : Result - { - if (isset(self::INVALID_TOKENS[$this->lexer->token['type']])) { - return new InvalidEmail(new ExpectingATEXT('Invalid token found'), $this->lexer->token['value']); - } - return new ValidEmail(); - } - - public function localPart() : string - { - return $this->localPart; - } - - private function parseLocalFWS() : Result - { - $foldingWS = new FoldingWhiteSpace($this->lexer); - $resultFWS = $foldingWS->parse(); - if ($resultFWS->isValid()) { - $this->warnings = array_merge($this->warnings, $foldingWS->getWarnings()); - } - return $resultFWS; - } - - private function hasDotAtStart() : bool - { - return $this->lexer->token['type'] === EmailLexer::S_DOT && null === $this->lexer->getPrevious()['type']; - } - - private function parseDoubleQuote() : Result - { - $dquoteParser = new DoubleQuote($this->lexer); - $parseAgain = $dquoteParser->parse(); - $this->warnings = array_merge($this->warnings, $dquoteParser->getWarnings()); - - return $parseAgain; - } - - protected function parseComments(): Result - { - $commentParser = new Comment($this->lexer, new LocalComment()); - $result = $commentParser->parse(); - $this->warnings = array_merge($this->warnings, $commentParser->getWarnings()); - if($result->isInvalid()) { - return $result; - } - return $result; - } - - private function validateEscaping() : Result - { - //Backslash found - if ($this->lexer->token['type'] !== EmailLexer::S_BACKSLASH) { - return new ValidEmail(); - } - - if ($this->lexer->isNextToken(EmailLexer::GENERIC)) { - return new InvalidEmail(new ExpectingATEXT('Found ATOM after escaping'), $this->lexer->token['value']); - } - - if (!$this->lexer->isNextTokenAny(array(EmailLexer::S_SP, EmailLexer::S_HTAB, EmailLexer::C_DEL))) { - return new ValidEmail(); - } - - return new ValidEmail(); - } -} \ No newline at end of file diff --git a/vendor/egulias/email-validator/src/Parser/PartParser.php b/vendor/egulias/email-validator/src/Parser/PartParser.php deleted file mode 100644 index fd65fc56..00000000 --- a/vendor/egulias/email-validator/src/Parser/PartParser.php +++ /dev/null @@ -1,63 +0,0 @@ -lexer = $lexer; - } - - abstract public function parse() : Result; - - /** - * @return \Egulias\EmailValidator\Warning\Warning[] - */ - public function getWarnings() - { - return $this->warnings; - } - - protected function parseFWS() : Result - { - $foldingWS = new FoldingWhiteSpace($this->lexer); - $resultFWS = $foldingWS->parse(); - $this->warnings = array_merge($this->warnings, $foldingWS->getWarnings()); - return $resultFWS; - } - - protected function checkConsecutiveDots() : Result - { - if ($this->lexer->token['type'] === EmailLexer::S_DOT && $this->lexer->isNextToken(EmailLexer::S_DOT)) { - return new InvalidEmail(new ConsecutiveDot(), $this->lexer->token['value']); - } - - return new ValidEmail(); - } - - protected function escaped() : bool - { - $previous = $this->lexer->getPrevious(); - - return $previous && $previous['type'] === EmailLexer::S_BACKSLASH - && - $this->lexer->token['type'] !== EmailLexer::GENERIC; - } -} \ No newline at end of file diff --git a/vendor/egulias/email-validator/src/Result/InvalidEmail.php b/vendor/egulias/email-validator/src/Result/InvalidEmail.php deleted file mode 100644 index 3d85e154..00000000 --- a/vendor/egulias/email-validator/src/Result/InvalidEmail.php +++ /dev/null @@ -1,46 +0,0 @@ -token = $token; - $this->reason = $reason; - } - - public function isValid(): bool - { - return false; - } - - public function isInvalid(): bool - { - return true; - } - - public function description(): string - { - return $this->reason->description() . " in char " . $this->token; - } - - public function code(): int - { - return $this->reason->code(); - } - - public function reason() : Reason - { - return $this->reason; - } - -} \ No newline at end of file diff --git a/vendor/egulias/email-validator/src/Result/MultipleErrors.php b/vendor/egulias/email-validator/src/Result/MultipleErrors.php deleted file mode 100644 index 5fa85afc..00000000 --- a/vendor/egulias/email-validator/src/Result/MultipleErrors.php +++ /dev/null @@ -1,56 +0,0 @@ -reasons[$reason->code()] = $reason; - } - - /** - * @return Reason[] - */ - public function getReasons() : array - { - return $this->reasons; - } - - public function reason() : Reason - { - return 0 !== count($this->reasons) - ? current($this->reasons) - : new EmptyReason(); - } - - public function description() : string - { - $description = ''; - foreach($this->reasons as $reason) { - $description .= $reason->description() . PHP_EOL; - } - - return $description; - } - - public function code() : int - { - return 0; - } -} diff --git a/vendor/egulias/email-validator/src/Result/Reason/AtextAfterCFWS.php b/vendor/egulias/email-validator/src/Result/Reason/AtextAfterCFWS.php deleted file mode 100644 index 76015a2d..00000000 --- a/vendor/egulias/email-validator/src/Result/Reason/AtextAfterCFWS.php +++ /dev/null @@ -1,16 +0,0 @@ -detailedDescription = $details; - } -} \ No newline at end of file diff --git a/vendor/egulias/email-validator/src/Result/Reason/DomainAcceptsNoMail.php b/vendor/egulias/email-validator/src/Result/Reason/DomainAcceptsNoMail.php deleted file mode 100644 index 55f44bba..00000000 --- a/vendor/egulias/email-validator/src/Result/Reason/DomainAcceptsNoMail.php +++ /dev/null @@ -1,16 +0,0 @@ -exception = $exception; - - } - public function code() : int - { - return 999; - } - - public function description() : string - { - return $this->exception->getMessage(); - } -} \ No newline at end of file diff --git a/vendor/egulias/email-validator/src/Result/Reason/ExpectingATEXT.php b/vendor/egulias/email-validator/src/Result/Reason/ExpectingATEXT.php deleted file mode 100644 index 07ea8d23..00000000 --- a/vendor/egulias/email-validator/src/Result/Reason/ExpectingATEXT.php +++ /dev/null @@ -1,16 +0,0 @@ -detailedDescription; - } -} diff --git a/vendor/egulias/email-validator/src/Result/Reason/ExpectingCTEXT.php b/vendor/egulias/email-validator/src/Result/Reason/ExpectingCTEXT.php deleted file mode 100644 index 64f5f7c3..00000000 --- a/vendor/egulias/email-validator/src/Result/Reason/ExpectingCTEXT.php +++ /dev/null @@ -1,16 +0,0 @@ -element = $element; - } - - public function code() : int - { - return 201; - } - - public function description() : string - { - return 'Unusual element found, wourld render invalid in majority of cases. Element found: ' . $this->element; - } -} \ No newline at end of file diff --git a/vendor/egulias/email-validator/src/Result/Result.php b/vendor/egulias/email-validator/src/Result/Result.php deleted file mode 100644 index 1e16bcca..00000000 --- a/vendor/egulias/email-validator/src/Result/Result.php +++ /dev/null @@ -1,27 +0,0 @@ -reason = new ReasonSpoofEmail(); - parent::__construct($this->reason, ''); - } -} \ No newline at end of file diff --git a/vendor/egulias/email-validator/src/Result/ValidEmail.php b/vendor/egulias/email-validator/src/Result/ValidEmail.php deleted file mode 100644 index 4f3693a9..00000000 --- a/vendor/egulias/email-validator/src/Result/ValidEmail.php +++ /dev/null @@ -1,27 +0,0 @@ -dnsGetRecord = $dnsGetRecord; - } - - public function isValid(string $email, EmailLexer $emailLexer) : bool - { - // use the input to check DNS if we cannot extract something similar to a domain - $host = $email; - - // Arguable pattern to extract the domain. Not aiming to validate the domain nor the email - if (false !== $lastAtPos = strrpos($email, '@')) { - $host = substr($email, $lastAtPos + 1); - } - - // Get the domain parts - $hostParts = explode('.', $host); - - $isLocalDomain = count($hostParts) <= 1; - $isReservedTopLevel = in_array($hostParts[(count($hostParts) - 1)], self::RESERVED_DNS_TOP_LEVEL_NAMES, true); - - // Exclude reserved top level DNS names - if ($isLocalDomain || $isReservedTopLevel) { - $this->error = new InvalidEmail(new LocalOrReservedDomain(), $host); - return false; - } - - return $this->checkDns($host); - } - - public function getError() : ?InvalidEmail - { - return $this->error; - } - - public function getWarnings() : array - { - return $this->warnings; - } - - /** - * @param string $host - * - * @return bool - */ - protected function checkDns($host) - { - $variant = INTL_IDNA_VARIANT_UTS46; - - $host = rtrim(idn_to_ascii($host, IDNA_DEFAULT, $variant), '.') . '.'; - - return $this->validateDnsRecords($host); - } - - - /** - * Validate the DNS records for given host. - * - * @param string $host A set of DNS records in the format returned by dns_get_record. - * - * @return bool True on success. - */ - private function validateDnsRecords($host) : bool - { - $dnsRecordsResult = $this->dnsGetRecord->getRecords($host, static::DNS_RECORD_TYPES_TO_CHECK); - - if ($dnsRecordsResult->withError()) { - $this->error = new InvalidEmail(new UnableToGetDNSRecord(), ''); - return false; - } - - $dnsRecords = $dnsRecordsResult->getRecords(); - - // No MX, A or AAAA DNS records - if ($dnsRecords === []) { - $this->error = new InvalidEmail(new ReasonNoDNSRecord(), ''); - return false; - } - - // For each DNS record - foreach ($dnsRecords as $dnsRecord) { - if (!$this->validateMXRecord($dnsRecord)) { - // No MX records (fallback to A or AAAA records) - if (empty($this->mxRecords)) { - $this->warnings[NoDNSMXRecord::CODE] = new NoDNSMXRecord(); - } - return false; - } - } - return true; - } - - /** - * Validate an MX record - * - * @param array $dnsRecord Given DNS record. - * - * @return bool True if valid. - */ - private function validateMxRecord($dnsRecord) : bool - { - if (!isset($dnsRecord['type'])) { - $this->error = new InvalidEmail(new ReasonNoDNSRecord(), ''); - return false; - } - - if ($dnsRecord['type'] !== 'MX') { - return true; - } - - // "Null MX" record indicates the domain accepts no mail (https://tools.ietf.org/html/rfc7505) - if (empty($dnsRecord['target']) || $dnsRecord['target'] === '.') { - $this->error = new InvalidEmail(new DomainAcceptsNoMail(), ""); - return false; - } - - $this->mxRecords[] = $dnsRecord; - - return true; - } -} \ No newline at end of file diff --git a/vendor/egulias/email-validator/src/Validation/DNSGetRecordWrapper.php b/vendor/egulias/email-validator/src/Validation/DNSGetRecordWrapper.php deleted file mode 100644 index ec6fe4b6..00000000 --- a/vendor/egulias/email-validator/src/Validation/DNSGetRecordWrapper.php +++ /dev/null @@ -1,28 +0,0 @@ -records = $records; - $this->error = $error; - } - - public function getRecords() : array - { - return $this->records; - } - - public function withError() : bool - { - return $this->error; - } - - -} \ No newline at end of file diff --git a/vendor/egulias/email-validator/src/Validation/EmailValidation.php b/vendor/egulias/email-validator/src/Validation/EmailValidation.php deleted file mode 100644 index 1bcc0a70..00000000 --- a/vendor/egulias/email-validator/src/Validation/EmailValidation.php +++ /dev/null @@ -1,34 +0,0 @@ -setChecks(Spoofchecker::SINGLE_SCRIPT); - - if ($checker->isSuspicious($email)) { - $this->error = new SpoofEmail(); - } - - return $this->error === null; - } - - /** - * @return InvalidEmail - */ - public function getError() : ?InvalidEmail - { - return $this->error; - } - - public function getWarnings() : array - { - return []; - } -} diff --git a/vendor/egulias/email-validator/src/Validation/MessageIDValidation.php b/vendor/egulias/email-validator/src/Validation/MessageIDValidation.php deleted file mode 100644 index 0e020433..00000000 --- a/vendor/egulias/email-validator/src/Validation/MessageIDValidation.php +++ /dev/null @@ -1,51 +0,0 @@ -parse($email); - $this->warnings = $parser->getWarnings(); - if ($result->isInvalid()) { - /** @psalm-suppress PropertyTypeCoercion */ - $this->error = $result; - return false; - } - } catch (\Exception $invalid) { - $this->error = new InvalidEmail(new ExceptionFound($invalid), ''); - return false; - } - - return true; - } - - public function getWarnings(): array - { - return $this->warnings; - } - - public function getError(): ?InvalidEmail - { - return $this->error; - } -} diff --git a/vendor/egulias/email-validator/src/Validation/MultipleValidationWithAnd.php b/vendor/egulias/email-validator/src/Validation/MultipleValidationWithAnd.php deleted file mode 100644 index 90d4f0d0..00000000 --- a/vendor/egulias/email-validator/src/Validation/MultipleValidationWithAnd.php +++ /dev/null @@ -1,117 +0,0 @@ -validations = $validations; - $this->mode = $mode; - } - - /** - * {@inheritdoc} - */ - public function isValid(string $email, EmailLexer $emailLexer) : bool - { - $result = true; - foreach ($this->validations as $validation) { - $emailLexer->reset(); - $validationResult = $validation->isValid($email, $emailLexer); - $result = $result && $validationResult; - $this->warnings = array_merge($this->warnings, $validation->getWarnings()); - if (!$validationResult) { - $this->processError($validation); - } - - if ($this->shouldStop($result)) { - break; - } - } - - return $result; - } - - private function initErrorStorage() : void - { - if (null === $this->error) { - $this->error = new MultipleErrors(); - } - } - - private function processError(EmailValidation $validation) : void - { - if (null !== $validation->getError()) { - $this->initErrorStorage(); - /** @psalm-suppress PossiblyNullReference */ - $this->error->addReason($validation->getError()->reason()); - } - } - - private function shouldStop(bool $result) : bool - { - return !$result && $this->mode === self::STOP_ON_ERROR; - } - - /** - * Returns the validation errors. - */ - public function getError() : ?InvalidEmail - { - return $this->error; - } - - /** - * {@inheritdoc} - */ - public function getWarnings() : array - { - return $this->warnings; - } -} diff --git a/vendor/egulias/email-validator/src/Validation/NoRFCWarningsValidation.php b/vendor/egulias/email-validator/src/Validation/NoRFCWarningsValidation.php deleted file mode 100644 index 06885ed7..00000000 --- a/vendor/egulias/email-validator/src/Validation/NoRFCWarningsValidation.php +++ /dev/null @@ -1,41 +0,0 @@ -getWarnings())) { - return true; - } - - $this->error = new InvalidEmail(new RFCWarnings(), ''); - - return false; - } - - /** - * {@inheritdoc} - */ - public function getError() : ?InvalidEmail - { - return $this->error ?: parent::getError(); - } -} diff --git a/vendor/egulias/email-validator/src/Validation/RFCValidation.php b/vendor/egulias/email-validator/src/Validation/RFCValidation.php deleted file mode 100644 index e2c27bac..00000000 --- a/vendor/egulias/email-validator/src/Validation/RFCValidation.php +++ /dev/null @@ -1,55 +0,0 @@ -parser = new EmailParser($emailLexer); - try { - $result = $this->parser->parse($email); - $this->warnings = $this->parser->getWarnings(); - if ($result->isInvalid()) { - /** @psalm-suppress PropertyTypeCoercion */ - $this->error = $result; - return false; - } - } catch (\Exception $invalid) { - $this->error = new InvalidEmail(new ExceptionFound($invalid), ''); - return false; - } - - return true; - } - - public function getError() : ?InvalidEmail - { - return $this->error; - } - - public function getWarnings() : array - { - return $this->warnings; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/AddressLiteral.php b/vendor/egulias/email-validator/src/Warning/AddressLiteral.php deleted file mode 100644 index 77e70f7f..00000000 --- a/vendor/egulias/email-validator/src/Warning/AddressLiteral.php +++ /dev/null @@ -1,14 +0,0 @@ -message = 'Address literal in domain part'; - $this->rfcNumber = 5321; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/CFWSNearAt.php b/vendor/egulias/email-validator/src/Warning/CFWSNearAt.php deleted file mode 100644 index be43bbe6..00000000 --- a/vendor/egulias/email-validator/src/Warning/CFWSNearAt.php +++ /dev/null @@ -1,13 +0,0 @@ -message = "Deprecated folding white space near @"; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/CFWSWithFWS.php b/vendor/egulias/email-validator/src/Warning/CFWSWithFWS.php deleted file mode 100644 index dea3450e..00000000 --- a/vendor/egulias/email-validator/src/Warning/CFWSWithFWS.php +++ /dev/null @@ -1,13 +0,0 @@ -message = 'Folding whites space followed by folding white space'; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/Comment.php b/vendor/egulias/email-validator/src/Warning/Comment.php deleted file mode 100644 index 704c2908..00000000 --- a/vendor/egulias/email-validator/src/Warning/Comment.php +++ /dev/null @@ -1,13 +0,0 @@ -message = "Comments found in this email"; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/DeprecatedComment.php b/vendor/egulias/email-validator/src/Warning/DeprecatedComment.php deleted file mode 100644 index ad43bd7c..00000000 --- a/vendor/egulias/email-validator/src/Warning/DeprecatedComment.php +++ /dev/null @@ -1,13 +0,0 @@ -message = 'Deprecated comments'; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/DomainLiteral.php b/vendor/egulias/email-validator/src/Warning/DomainLiteral.php deleted file mode 100644 index 6f36b5e2..00000000 --- a/vendor/egulias/email-validator/src/Warning/DomainLiteral.php +++ /dev/null @@ -1,14 +0,0 @@ -message = 'Domain Literal'; - $this->rfcNumber = 5322; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/EmailTooLong.php b/vendor/egulias/email-validator/src/Warning/EmailTooLong.php deleted file mode 100644 index 497309db..00000000 --- a/vendor/egulias/email-validator/src/Warning/EmailTooLong.php +++ /dev/null @@ -1,15 +0,0 @@ -message = 'Email is too long, exceeds ' . EmailParser::EMAIL_MAX_LENGTH; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/IPV6BadChar.php b/vendor/egulias/email-validator/src/Warning/IPV6BadChar.php deleted file mode 100644 index ba2fcc01..00000000 --- a/vendor/egulias/email-validator/src/Warning/IPV6BadChar.php +++ /dev/null @@ -1,14 +0,0 @@ -message = 'Bad char in IPV6 domain literal'; - $this->rfcNumber = 5322; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/IPV6ColonEnd.php b/vendor/egulias/email-validator/src/Warning/IPV6ColonEnd.php deleted file mode 100644 index 41afa78c..00000000 --- a/vendor/egulias/email-validator/src/Warning/IPV6ColonEnd.php +++ /dev/null @@ -1,14 +0,0 @@ -message = ':: found at the end of the domain literal'; - $this->rfcNumber = 5322; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/IPV6ColonStart.php b/vendor/egulias/email-validator/src/Warning/IPV6ColonStart.php deleted file mode 100644 index 1bf754e3..00000000 --- a/vendor/egulias/email-validator/src/Warning/IPV6ColonStart.php +++ /dev/null @@ -1,14 +0,0 @@ -message = ':: found at the start of the domain literal'; - $this->rfcNumber = 5322; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/IPV6Deprecated.php b/vendor/egulias/email-validator/src/Warning/IPV6Deprecated.php deleted file mode 100644 index d752caaa..00000000 --- a/vendor/egulias/email-validator/src/Warning/IPV6Deprecated.php +++ /dev/null @@ -1,14 +0,0 @@ -message = 'Deprecated form of IPV6'; - $this->rfcNumber = 5321; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/IPV6DoubleColon.php b/vendor/egulias/email-validator/src/Warning/IPV6DoubleColon.php deleted file mode 100644 index 4f823949..00000000 --- a/vendor/egulias/email-validator/src/Warning/IPV6DoubleColon.php +++ /dev/null @@ -1,14 +0,0 @@ -message = 'Double colon found after IPV6 tag'; - $this->rfcNumber = 5322; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/IPV6GroupCount.php b/vendor/egulias/email-validator/src/Warning/IPV6GroupCount.php deleted file mode 100644 index a59d317f..00000000 --- a/vendor/egulias/email-validator/src/Warning/IPV6GroupCount.php +++ /dev/null @@ -1,14 +0,0 @@ -message = 'Group count is not IPV6 valid'; - $this->rfcNumber = 5322; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/IPV6MaxGroups.php b/vendor/egulias/email-validator/src/Warning/IPV6MaxGroups.php deleted file mode 100644 index 936274c1..00000000 --- a/vendor/egulias/email-validator/src/Warning/IPV6MaxGroups.php +++ /dev/null @@ -1,14 +0,0 @@ -message = 'Reached the maximum number of IPV6 groups allowed'; - $this->rfcNumber = 5321; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/LocalTooLong.php b/vendor/egulias/email-validator/src/Warning/LocalTooLong.php deleted file mode 100644 index 0d08d8b3..00000000 --- a/vendor/egulias/email-validator/src/Warning/LocalTooLong.php +++ /dev/null @@ -1,15 +0,0 @@ -message = 'Local part is too long, exceeds 64 chars (octets)'; - $this->rfcNumber = 5322; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/NoDNSMXRecord.php b/vendor/egulias/email-validator/src/Warning/NoDNSMXRecord.php deleted file mode 100644 index b3c21a1f..00000000 --- a/vendor/egulias/email-validator/src/Warning/NoDNSMXRecord.php +++ /dev/null @@ -1,14 +0,0 @@ -message = 'No MX DSN record was found for this email'; - $this->rfcNumber = 5321; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/ObsoleteDTEXT.php b/vendor/egulias/email-validator/src/Warning/ObsoleteDTEXT.php deleted file mode 100644 index 10f19e33..00000000 --- a/vendor/egulias/email-validator/src/Warning/ObsoleteDTEXT.php +++ /dev/null @@ -1,14 +0,0 @@ -rfcNumber = 5322; - $this->message = 'Obsolete DTEXT in domain literal'; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/QuotedPart.php b/vendor/egulias/email-validator/src/Warning/QuotedPart.php deleted file mode 100644 index 36a4265a..00000000 --- a/vendor/egulias/email-validator/src/Warning/QuotedPart.php +++ /dev/null @@ -1,17 +0,0 @@ -message = "Deprecated Quoted String found between $prevToken and $postToken"; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/QuotedString.php b/vendor/egulias/email-validator/src/Warning/QuotedString.php deleted file mode 100644 index 817e4e84..00000000 --- a/vendor/egulias/email-validator/src/Warning/QuotedString.php +++ /dev/null @@ -1,17 +0,0 @@ -message = "Quoted String found between $prevToken and $postToken"; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/TLD.php b/vendor/egulias/email-validator/src/Warning/TLD.php deleted file mode 100644 index 2338b9f4..00000000 --- a/vendor/egulias/email-validator/src/Warning/TLD.php +++ /dev/null @@ -1,13 +0,0 @@ -message = "RFC5321, TLD"; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/Warning.php b/vendor/egulias/email-validator/src/Warning/Warning.php deleted file mode 100644 index a0158a2c..00000000 --- a/vendor/egulias/email-validator/src/Warning/Warning.php +++ /dev/null @@ -1,47 +0,0 @@ -message; - } - - /** - * @return int - */ - public function code() - { - return self::CODE; - } - - /** - * @return int - */ - public function RFCNumber() - { - return $this->rfcNumber; - } - - public function __toString() - { - return $this->message() . " rfc: " . $this->rfcNumber . "internal code: " . static::CODE; - } -} diff --git a/vendor/fakerphp/faker/CHANGELOG.md b/vendor/fakerphp/faker/CHANGELOG.md deleted file mode 100644 index 566ad322..00000000 --- a/vendor/fakerphp/faker/CHANGELOG.md +++ /dev/null @@ -1,181 +0,0 @@ -# CHANGELOG - -## [Unreleased](https://github.com/FakerPHP/Faker/compare/v1.20.0...main) - -## [2022-12-13, v1.21.0](https://github.com/FakerPHP/Faker/compare/v1.20.0..v1.21.0) - -- Dropped support for PHP 7.1, 7.2, and 7.3 (#543) -- Added support for PHP 8.2 (#528) - -## [2022-07-20, v1.20.0](https://github.com/FakerPHP/Faker/compare/v1.19.0..v1.20.0) - -- Fixed typo in French phone number (#452) -- Fixed some Hungarian naming bugs (#451) -- Fixed bug where the NL-BE VAT generation was incorrect (#455) -- Improve Turkish phone numbers for E164 and added landline support (#460) -- Add Microsoft Edge User Agent (#464) -- Added option to set image formats on Faker\Provider\Image (#473) -- Added support for French color translations (#466) -- Support filtering timezones by country code (#480) -- Fixed typo in some greek names (#490) -- Marked the Faker\Provider\Image as deprecated - -## [2022-02-02, v1.19.0](https://github.com/FakerPHP/Faker/compare/v1.18.0..v1.19.0) - -- Added color extension to core (#442) -- Added conflict with `doctrine/persistence` below version `1.4` -- Fix for support on different Doctrine ORM versions (#414) -- Fix usage of `Doctrine\Persistence` dependency -- Fix CZ Person birthNumber docblock return type (#437) -- Fix is_IS Person docbock types (#439) -- Fix is_IS Address docbock type (#438) -- Fix regexify escape backslash in character class (#434) -- Removed UUID from Generator to be able to extend it (#441) - -## [2022-01-23, v1.18.0](https://github.com/FakerPHP/Faker/compare/v1.17.0..v1.18.0) - -- Deprecated UUID, use uuid3 to specify version (#427) -- Reset formatters when adding a new provider (#366) -- Helper methods to use our custom generators (#155) -- Set allow-plugins for Composer 2.2 (#405) -- Fix kk_KZ\Person::individualIdentificationNumber generation (#411) -- Allow for -> syntax to be used in parsing (#423) -- Person->name was missing string return type (#424) -- Generate a valid BE TAX number (#415) -- Added the UUID extension to Core (#427) - -## [2021-12-05, v1.17.0](https://github.com/FakerPHP/Faker/compare/v1.16.0..v1.17.0) - -- Partial PHP 8.1 compatibility (#373) -- Add payment provider for `ne_NP` locale (#375) -- Add Egyptian Arabic `ar_EG` locale (#377) -- Updated list of South African TLDs (#383) -- Fixed formatting of E.164 numbers (#380) -- Allow `symfony/deprecation-contracts` `^3.0` (#397) - -## [2021-09-06, v1.16.0](https://github.com/FakerPHP/Faker/compare/v1.15.0..v1.16.0) - -- Add Company extension -- Add Address extension -- Add Person extension -- Add PhoneNumber extension -- Add VersionExtension (#350) -- Stricter types in Extension\Container and Extension\GeneratorAwareExtension (#345) -- Fix deprecated property access in `nl_NL` (#348) -- Add support for `psr/container` >= 2.0 (#354) -- Add missing union types in Faker\Generator (#352) - -## [2021-07-06, v1.15.0](https://github.com/FakerPHP/Faker/compare/v1.14.1..v1.15.0) - -- Updated the generator phpdoc to help identify magic methods (#307) -- Prevent direct access and triggered deprecation warning for "word" (#302) -- Updated length on all global e164 numbers (#301) -- Updated last names from different source (#312) -- Don't generate birth number of '000' for Swedish personal identity (#306) -- Add job list for localization id_ID (#339) - -## [2021-03-30, v1.14.1](https://github.com/FakerPHP/Faker/compare/v1.14.0..v1.14.1) - -- Fix where randomNumber and randomFloat would return a 0 value (#291 / #292) - -## [2021-03-29, v1.14.0](https://github.com/FakerPHP/Faker/compare/v1.13.0..v1.14.0) - -- Fix for realText to ensure the text keeps closer to its boundaries (#152) -- Fix where regexify produces a random character instead of a literal dot (#135 -- Deprecate zh_TW methods that only call base methods (#122) -- Add used extensions to composer.json as suggestion (#120) -- Moved TCNo and INN from calculator to localized providers (#108) -- Fix regex dot/backslash issue where a dot is replaced with a backslash as escape character (#206) -- Deprecate direct property access (#164) -- Added test to assert unique() behaviour (#233) -- Added RUC for the es_PE locale (#244) -- Test IBAN formats for Latin America (AR/PE/VE) (#260) -- Added VAT number for en_GB (#255) -- Added new districts for the ne_NP locale (#258) -- Fix for U.S. Area Code Generation (#261) -- Fix in numerify where a better random numeric value is guaranteed (#256) -- Fix e164PhoneNumber to only generate valid phone numbers with valid country codes (#264) -- Extract fixtures into separate classes (#234) -- Remove french domains that no longer exists (#277) -- Fix error that occurs when getting a polish title (#279) -- Use valid area codes for North America E164 phone numbers (#280) - -- Adding support for extensions and PSR-11 (#154) -- Adding trait for GeneratorAwareExtension (#165) -- Added helper class for extension (#162) -- Added blood extension to core (#232) -- Added barcode extension to core (#252) -- Added number extension (#257) - -- Various code style updates -- Added a note about our breaking change promise (#273) - -## [2020-12-18, v1.13.0](https://github.com/FakerPHP/Faker/compare/v1.12.1..v1.13.0) - -Several fixes and new additions in this release. A lot of cleanup has been done -on the codebase on both tests and consistency. - -- Feature/pl pl license plate (#62) -- Fix greek phone numbers (#16) -- Move AT payment provider logic to de_AT (#72) -- Fix wiktionary links (#73) -- Fix AT person links (#74) -- Fix AT cities (#75) -- Deprecate at_AT providers (#78) -- Add Austrian `ssn()` to `Person` provider (#79) -- Fix typos in id_ID Address (#83) -- Austrian post codes (#86) -- Updated Polish data (#70) -- Improve Austrian social security number generation (#88) -- Move US phone numbers with extension to own method (#91) -- Add UK National Insurance number generator (#89) -- Fix en_SG phone number generator (#100) -- Remove usage of mt_rand (#87) -- Remove whitespace from beginning of el_GR phone numbers (#105) -- Building numbers can not be 0, 00, 000 (#107) -- Add 172.16/12 local IPv4 block (#121) -- Add JCB credit card type (#124) -- Remove json_decode from emoji generation (#123) -- Remove ro street address (#146) - -## [2020-12-11, v1.12.1](https://github.com/FakerPHP/Faker/compare/v1.12.0..v1.12.1) - -This is a security release that prevents a hacker to execute code on the server. - -## [2020-11-23, v1.12.0](https://github.com/FakerPHP/Faker/compare/v1.11.0..v1.12.0) - -- Fix ro_RO first and last day of year calculation offset (#65) -- Fix en_NG locale test namespaces that did not match PSR-4 (#57) -- Added Singapore NRIC/FIN provider (#56) -- Added provider for Lithuanian municipalities (#58) -- Added blood types provider (#61) - -## [2020-11-15, v1.11.0](https://github.com/FakerPHP/Faker/compare/v1.10.1..v1.11.0) - -- Added Provider for Swedish Municipalities -- Updates to person names in pt_BR -- Many code style changes - -## [2020-10-28, v1.10.1](https://github.com/FakerPHP/Faker/compare/v1.10.0..v1.10.1) - -- Updates the Danish addresses in dk_DK -- Removed offense company names in nl_NL -- Clarify changelog with original fork -- Standin replacement for LoremPixel to Placeholder.com (#11) - -## [2020-10-27, v1.10.0](https://github.com/FakerPHP/Faker/compare/v1.9.1..v1.10.0) - -- Support PHP 7.1-8.0 -- Fix typo in de_DE Company Provider -- Fix dateTimeThisYear method -- Fix typo in de_DE jobTitleFormat -- Fix IBAN generation for CR -- Fix typos in greek first names -- Fix US job title typo -- Do not clear entity manager for doctrine orm populator -- Remove persian rude words -- Corrections to RU names - -## 2020-10-27, v1.9.1 - -- Initial version. Same as `fzaninotto/Faker:v1.9.1`. diff --git a/vendor/fakerphp/faker/LICENSE b/vendor/fakerphp/faker/LICENSE deleted file mode 100644 index 99ed0075..00000000 --- a/vendor/fakerphp/faker/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2011 François Zaninotto -Portions Copyright (c) 2008 Caius Durling -Portions Copyright (c) 2008 Adam Royle -Portions Copyright (c) 2008 Fiona Burrows - -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/fakerphp/faker/README.md b/vendor/fakerphp/faker/README.md deleted file mode 100644 index c3c199d5..00000000 --- a/vendor/fakerphp/faker/README.md +++ /dev/null @@ -1,107 +0,0 @@ -

Social card of FakerPHP

- -# Faker - -[![Packagist Downloads](https://img.shields.io/packagist/dm/FakerPHP/Faker)](https://packagist.org/packages/fakerphp/faker) -[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/FakerPHP/Faker/Tests/main)](https://github.com/FakerPHP/Faker/actions) -[![Type Coverage](https://shepherd.dev/github/FakerPHP/Faker/coverage.svg)](https://shepherd.dev/github/FakerPHP/Faker) -[![Code Coverage](https://codecov.io/gh/FakerPHP/Faker/branch/main/graph/badge.svg)](https://codecov.io/gh/FakerPHP/Faker) - -Faker is a PHP library that generates fake data for you. Whether you need to bootstrap your database, create good-looking XML documents, fill-in your persistence to stress test it, or anonymize data taken from a production service, Faker is for you. - -It's heavily inspired by Perl's [Data::Faker](https://metacpan.org/pod/Data::Faker), and by Ruby's [Faker](https://rubygems.org/gems/faker). - -## Getting Started - -### Installation - -Faker requires PHP >= 7.4. - -```shell -composer require fakerphp/faker -``` - -### Documentation - -Full documentation can be found over on [fakerphp.github.io](https://fakerphp.github.io). - -### Basic Usage - -Use `Faker\Factory::create()` to create and initialize a Faker generator, which can generate data by accessing methods named after the type of data you want. - -```php -name(); -// 'Vince Sporer' -echo $faker->email(); -// 'walter.sophia@hotmail.com' -echo $faker->text(); -// 'Numquam ut mollitia at consequuntur inventore dolorem.' -``` - -Each call to `$faker->name()` yields a different (random) result. This is because Faker uses `__call()` magic, and forwards `Faker\Generator->$method()` calls to `Faker\Generator->format($method, $attributes)`. - -```php -name() . "\n"; -} - -// 'Cyrus Boyle' -// 'Alena Cummerata' -// 'Orlo Bergstrom' -``` - -## Automated refactoring - -If you already used this library with its properties, they are now deprecated and needs to be replaced by their equivalent methods. - -You can use the provided [Rector](https://github.com/rectorphp/rector) config file to automate the work. - -Run - -```bash -composer require --dev rector/rector -``` - -to install `rector/rector`. - -Run - -```bash -vendor/bin/rector process src/ --config vendor/fakerphp/faker/rector-migrate.php -``` - -to run `rector/rector`. - -*Note:* do not forget to replace `src/` with the path to your source directory. - -Another way is to use it in your `rector.php` file: - -```php -$rectorConfig->import('vendor/fakerphp/faker/rector-migrate.php'); -$faker($rectorConfig); -``` - -## License - -Faker is released under the MIT License. See [`LICENSE`](LICENSE) for details. - -## Backward compatibility promise - -Faker is using [Semver](https://semver.org/). This means that versions are tagged -with MAJOR.MINOR.PATCH. Only a new major version will be allowed to break backward -compatibility (BC). - -Classes marked as `@experimental` or `@internal` are not included in our backward compatibility promise. -You are also not guaranteed that the value returned from a method is always the -same. You are guaranteed that the data type will not change. - -PHP 8 introduced [named arguments](https://wiki.php.net/rfc/named_params), which -increased the cost and reduces flexibility for package maintainers. The names of the -arguments for methods in Faker is not included in our BC promise. diff --git a/vendor/fakerphp/faker/composer.json b/vendor/fakerphp/faker/composer.json deleted file mode 100644 index 9b85ce9d..00000000 --- a/vendor/fakerphp/faker/composer.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "fakerphp/faker", - "type": "library", - "description": "Faker is a PHP library that generates fake data for you.", - "keywords": [ - "faker", - "fixtures", - "data" - ], - "license": "MIT", - "authors": [ - { - "name": "François Zaninotto" - } - ], - "require": { - "php": "^7.4 || ^8.0", - "psr/container": "^1.0 || ^2.0", - "symfony/deprecation-contracts": "^2.2 || ^3.0" - }, - "require-dev": { - "ext-intl": "*", - "bamarni/composer-bin-plugin": "^1.4.1", - "doctrine/persistence": "^1.3 || ^2.0", - "phpunit/phpunit": "^9.5.26", - "symfony/phpunit-bridge": "^5.4.16" - }, - "autoload": { - "psr-4": { - "Faker\\": "src/Faker/" - } - }, - "autoload-dev": { - "psr-4": { - "Faker\\Test\\": "test/Faker/", - "Faker\\Test\\Fixture\\": "test/Fixture/" - } - }, - "conflict": { - "fzaninotto/faker": "*" - }, - "suggest": { - "ext-curl": "Required by Faker\\Provider\\Image to download images.", - "ext-dom": "Required by Faker\\Provider\\HtmlLorem for generating random HTML.", - "ext-iconv": "Required by Faker\\Provider\\ru_RU\\Text::realText() for generating real Russian text.", - "ext-mbstring": "Required for multibyte Unicode string functionality.", - "doctrine/orm": "Required to use Faker\\ORM\\Doctrine" - }, - "config": { - "allow-plugins": { - "bamarni/composer-bin-plugin": true, - "composer/package-versions-deprecated": true - }, - "sort-packages": true - }, - "extra": { - "branch-alias": { - "dev-main": "v1.21-dev" - } - } -} diff --git a/vendor/fakerphp/faker/psalm.baseline.xml b/vendor/fakerphp/faker/psalm.baseline.xml deleted file mode 100644 index 7c3b4e87..00000000 --- a/vendor/fakerphp/faker/psalm.baseline.xml +++ /dev/null @@ -1,247 +0,0 @@ - - - - - 0 - - - string - - - - - $this->uniqueGenerator - new ChanceGenerator($this, $weight, $default) - new ValidGenerator($this, $validator, $maxRetries) - - - self - self - self - - - - - TableRegistry - - - - - $this->class - \Doctrine\ODM\MongoDB\Mapping\ClassMetadata - \Doctrine\ODM\MongoDB\Mapping\ClassMetadata - \Doctrine\ODM\MongoDB\Mapping\ClassMetadata - \Doctrine\ORM\Mapping\ClassMetadata - \Doctrine\ORM\Mapping\ClassMetadata - - - createQueryBuilder - getAssociationMappings - newInstance - - - - - Mandango - Mandango - - - - - $this->mandango - Mandango - - - - - \ColumnMap - - - - - $columnMap - $columnMap - $columnMap - $columnMap - $columnMap - $columnMap - $columnMap - $columnMap - \ColumnMap - - - - - \Propel - - - PropelPDO - - - - - ColumnMap - - - - - $columnMap - $columnMap - $columnMap - $columnMap - $columnMap - $columnMap - $columnMap - $columnMap - ColumnMap - - - - - Propel - - - PropelPDO - - - - - $this->mapper - - - string - - - $relation - $relation - BelongsTo - Locator - Mapper - - - $locator - $this->mapper - $this->mapper - $this->mapper - $this->mapper - $this->mapper - Locator - Mapper - - - - - $this->locator - Locator - - - Locator - - - - - [static::class, 'randomDigit'] - - - $array - - - Closure - - - - - false - - - - - $element->ownerDocument - $element->ownerDocument - $element->ownerDocument - $element->ownerDocument - $element->ownerDocument - $element->ownerDocument - $element->ownerDocument - $element->ownerDocument - $element->ownerDocument - $element->ownerDocument - $element->ownerDocument - $root->ownerDocument - - - - - $imei - - - int - - - - - static::$cityPrefix - - - - - static::birthNumber(static::GENDER_FEMALE) - static::birthNumber(static::GENDER_MALE) - - - - - $weights[$i] - - - - - $ref[$i] - - - - - static::split($text) - - - - - $multipliers[$i - 1] - - - - - $weights[$i] - $weights[$i] - - - - - $weights[$i] - - - - - $high[$i] - $low[$i] - $result[$i] - $weights[$i + 3] - $weights[$i] - $weights[$i] - - - DateTime - - - - - $multipliers[$i] - - - - - static::lastName() - static::lastName() - - - diff --git a/vendor/fakerphp/faker/rector-migrate.php b/vendor/fakerphp/faker/rector-migrate.php deleted file mode 100644 index 7d99b570..00000000 --- a/vendor/fakerphp/faker/rector-migrate.php +++ /dev/null @@ -1,161 +0,0 @@ -ruleWithConfiguration( - Transform\Rector\Assign\PropertyFetchToMethodCallRector::class, - array_map(static function (string $property): Transform\ValueObject\PropertyFetchToMethodCall { - return new Transform\ValueObject\PropertyFetchToMethodCall( - Generator::class, - $property, - $property, - ); - }, $properties), - ); -}; diff --git a/vendor/fakerphp/faker/src/Faker/Calculator/Ean.php b/vendor/fakerphp/faker/src/Faker/Calculator/Ean.php deleted file mode 100644 index 9c3daf17..00000000 --- a/vendor/fakerphp/faker/src/Faker/Calculator/Ean.php +++ /dev/null @@ -1,52 +0,0 @@ - $digit) { - $sums += ((int) $digit) * $sequence[$n % 2]; - } - - return (10 - $sums % 10) % 10; - } - - /** - * Checks whether the provided number is an EAN compliant number and that - * the checksum is correct. - * - * @param string $ean An EAN number - * - * @return bool - */ - public static function isValid($ean) - { - if (!preg_match(self::PATTERN, $ean)) { - return false; - } - - return self::checksum(substr($ean, 0, -1)) === (int) substr($ean, -1); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Calculator/Iban.php b/vendor/fakerphp/faker/src/Faker/Calculator/Iban.php deleted file mode 100644 index b00b18f0..00000000 --- a/vendor/fakerphp/faker/src/Faker/Calculator/Iban.php +++ /dev/null @@ -1,75 +0,0 @@ -= 0; $i -= 2) { - $sum += $number[$i]; - } - - for ($i = $length - 2; $i >= 0; $i -= 2) { - $sum += array_sum(str_split($number[$i] * 2)); - } - - return $sum % 10; - } - - /** - * @param string $partialNumber - * - * @return string - */ - public static function computeCheckDigit($partialNumber) - { - $checkDigit = self::checksum($partialNumber . '0'); - - if ($checkDigit === 0) { - return 0; - } - - return (string) (10 - $checkDigit); - } - - /** - * Checks whether a number (partial number + check digit) is Luhn compliant - * - * @param string $number - * - * @return bool - */ - public static function isValid($number) - { - return self::checksum($number) === 0; - } - - /** - * Generate a Luhn compliant number. - * - * @param string $partialValue - * - * @return string - */ - public static function generateLuhnNumber($partialValue) - { - if (!preg_match('/^\d+$/', $partialValue)) { - throw new \InvalidArgumentException('Argument should be an integer.'); - } - - return $partialValue . Luhn::computeCheckDigit($partialValue); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Calculator/TCNo.php b/vendor/fakerphp/faker/src/Faker/Calculator/TCNo.php deleted file mode 100644 index a75c93e1..00000000 --- a/vendor/fakerphp/faker/src/Faker/Calculator/TCNo.php +++ /dev/null @@ -1,43 +0,0 @@ -default = $default; - $this->generator = $generator; - $this->weight = $weight; - } - - public function ext(string $id) - { - return new self($this->generator->ext($id), $this->weight, $this->default); - } - - /** - * Catch and proxy all generator calls but return only valid values - * - * @param string $attribute - * - * @deprecated Use a method instead. - */ - public function __get($attribute) - { - trigger_deprecation('fakerphp/faker', '1.14', 'Accessing property "%s" is deprecated, use "%s()" instead.', $attribute, $attribute); - - return $this->__call($attribute, []); - } - - /** - * @param string $name - * @param array $arguments - */ - public function __call($name, $arguments) - { - if (mt_rand(1, 100) <= (100 * $this->weight)) { - return call_user_func_array([$this->generator, $name], $arguments); - } - - return $this->default; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Container/Container.php b/vendor/fakerphp/faker/src/Faker/Container/Container.php deleted file mode 100644 index 2dd2d974..00000000 --- a/vendor/fakerphp/faker/src/Faker/Container/Container.php +++ /dev/null @@ -1,145 +0,0 @@ - - */ - private $definitions; - - private $services = []; - - /** - * Create a container object with a set of definitions. The array value MUST - * produce an object that implements Extension. - * - * @param array $definitions - */ - public function __construct(array $definitions) - { - $this->definitions = $definitions; - } - - /** - * Retrieve a definition from the container. - * - * @param string $id - * - * @throws \InvalidArgumentException - * @throws \RuntimeException - * @throws ContainerException - * @throws NotInContainerException - */ - public function get($id): Extension - { - if (!is_string($id)) { - throw new \InvalidArgumentException(sprintf( - 'First argument of %s::get() must be string', - self::class, - )); - } - - if (array_key_exists($id, $this->services)) { - return $this->services[$id]; - } - - if (!$this->has($id)) { - throw new NotInContainerException(sprintf( - 'There is not service with id "%s" in the container.', - $id, - )); - } - - $definition = $this->definitions[$id]; - - $service = $this->services[$id] = $this->getService($id, $definition); - - if (!$service instanceof Extension) { - throw new \RuntimeException(sprintf( - 'Service resolved for identifier "%s" does not implement the %s" interface.', - $id, - Extension::class, - )); - } - - return $service; - } - - /** - * Get the service from a definition. - * - * @param callable|object|string $definition - */ - private function getService($id, $definition) - { - if (is_callable($definition)) { - try { - return $definition(); - } catch (\Throwable $e) { - throw new ContainerException( - sprintf('Error while invoking callable for "%s"', $id), - 0, - $e, - ); - } - } elseif (is_object($definition)) { - return $definition; - } elseif (is_string($definition)) { - if (class_exists($definition)) { - try { - return new $definition(); - } catch (\Throwable $e) { - throw new ContainerException(sprintf('Could not instantiate class "%s"', $id), 0, $e); - } - } - - throw new ContainerException(sprintf( - 'Could not instantiate class "%s". Class was not found.', - $id, - )); - } else { - throw new ContainerException(sprintf( - 'Invalid type for definition with id "%s"', - $id, - )); - } - } - - /** - * Check if the container contains a given identifier. - * - * @param string $id - * - * @throws \InvalidArgumentException - */ - public function has($id): bool - { - if (!is_string($id)) { - throw new \InvalidArgumentException(sprintf( - 'First argument of %s::get() must be string', - self::class, - )); - } - - return array_key_exists($id, $this->definitions); - } - - /** - * Get the bindings between Extension interfaces and implementations. - */ - public function getDefinitions(): array - { - return $this->definitions; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Container/ContainerBuilder.php b/vendor/fakerphp/faker/src/Faker/Container/ContainerBuilder.php deleted file mode 100644 index 3fb335ff..00000000 --- a/vendor/fakerphp/faker/src/Faker/Container/ContainerBuilder.php +++ /dev/null @@ -1,92 +0,0 @@ - - */ - private $definitions = []; - - /** - * @param callable|object|string $value - * - * @throws \InvalidArgumentException - */ - public function add($value, string $name = null): self - { - if (!is_string($value) && !is_callable($value) && !is_object($value)) { - throw new \InvalidArgumentException(sprintf( - 'First argument to "%s::add()" must be a string, callable or object.', - self::class, - )); - } - - if ($name === null) { - if (is_string($value)) { - $name = $value; - } elseif (is_object($value)) { - $name = get_class($value); - } else { - throw new \InvalidArgumentException(sprintf( - 'Second argument to "%s::add()" is required not passing a string or object as first argument', - self::class, - )); - } - } - - $this->definitions[$name] = $value; - - return $this; - } - - public function build(): ContainerInterface - { - return new Container($this->definitions); - } - - /** - * Get an array with extension that represent the default English - * functionality. - */ - public static function defaultExtensions(): array - { - return [ - BarcodeExtension::class => Core\Barcode::class, - BloodExtension::class => Core\Blood::class, - ColorExtension::class => Core\Color::class, - DateTimeExtension::class => Core\DateTime::class, - FileExtension::class => Core\File::class, - NumberExtension::class => Core\Number::class, - VersionExtension::class => Core\Version::class, - UuidExtension::class => Core\Uuid::class, - ]; - } - - public static function getDefault(): ContainerInterface - { - $instance = new self(); - - foreach (self::defaultExtensions() as $id => $definition) { - $instance->add($definition, $id); - } - - return $instance->build(); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Container/ContainerException.php b/vendor/fakerphp/faker/src/Faker/Container/ContainerException.php deleted file mode 100644 index 12b3caa0..00000000 --- a/vendor/fakerphp/faker/src/Faker/Container/ContainerException.php +++ /dev/null @@ -1,14 +0,0 @@ -ean(); - } - - public function ean8(): string - { - return $this->ean(8); - } - - public function isbn10(): string - { - $code = Extension\Helper::numerify(str_repeat('#', 9)); - - return sprintf('%s%s', $code, Calculator\Isbn::checksum($code)); - } - - public function isbn13(): string - { - $code = '97' . mt_rand(8, 9) . Extension\Helper::numerify(str_repeat('#', 9)); - - return sprintf('%s%s', $code, Calculator\Ean::checksum($code)); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Core/Blood.php b/vendor/fakerphp/faker/src/Faker/Core/Blood.php deleted file mode 100644 index 50a5806c..00000000 --- a/vendor/fakerphp/faker/src/Faker/Core/Blood.php +++ /dev/null @@ -1,42 +0,0 @@ -bloodTypes); - } - - public function bloodRh(): string - { - return Extension\Helper::randomElement($this->bloodRhFactors); - } - - public function bloodGroup(): string - { - return sprintf( - '%s%s', - $this->bloodType(), - $this->bloodRh(), - ); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Core/Color.php b/vendor/fakerphp/faker/src/Faker/Core/Color.php deleted file mode 100644 index 6e4e350e..00000000 --- a/vendor/fakerphp/faker/src/Faker/Core/Color.php +++ /dev/null @@ -1,180 +0,0 @@ -numberBetween(1, 16777215)), 6, '0', STR_PAD_LEFT); - } - - /** - * @example '#ff0044' - */ - public function safeHexColor(): string - { - $number = new Number(); - $color = str_pad(dechex($number->numberBetween(0, 255)), 3, '0', STR_PAD_LEFT); - - return sprintf( - '#%s%s%s%s%s%s', - $color[0], - $color[0], - $color[1], - $color[1], - $color[2], - $color[2], - ); - } - - /** - * @example 'array(0,255,122)' - * - * @return int[] - */ - public function rgbColorAsArray(): array - { - $color = $this->hexColor(); - - return [ - hexdec(substr($color, 1, 2)), - hexdec(substr($color, 3, 2)), - hexdec(substr($color, 5, 2)), - ]; - } - - /** - * @example '0,255,122' - */ - public function rgbColor(): string - { - return implode(',', $this->rgbColorAsArray()); - } - - /** - * @example 'rgb(0,255,122)' - */ - public function rgbCssColor(): string - { - return sprintf( - 'rgb(%s)', - $this->rgbColor(), - ); - } - - /** - * @example 'rgba(0,255,122,0.8)' - */ - public function rgbaCssColor(): string - { - $number = new Number(); - - return sprintf( - 'rgba(%s,%s)', - $this->rgbColor(), - $number->randomFloat(1, 0, 1), - ); - } - - /** - * @example 'blue' - */ - public function safeColorName(): string - { - return Helper::randomElement($this->safeColorNames); - } - - /** - * @example 'NavajoWhite' - */ - public function colorName(): string - { - return Helper::randomElement($this->allColorNames); - } - - /** - * @example '340,50,20' - */ - public function hslColor(): string - { - $number = new Number(); - - return sprintf( - '%s,%s,%s', - $number->numberBetween(0, 360), - $number->numberBetween(0, 100), - $number->numberBetween(0, 100), - ); - } - - /** - * @example array(340, 50, 20) - * - * @return int[] - */ - public function hslColorAsArray(): array - { - $number = new Number(); - - return [ - $number->numberBetween(0, 360), - $number->numberBetween(0, 100), - $number->numberBetween(0, 100), - ]; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Core/Coordinates.php b/vendor/fakerphp/faker/src/Faker/Core/Coordinates.php deleted file mode 100644 index 40a26589..00000000 --- a/vendor/fakerphp/faker/src/Faker/Core/Coordinates.php +++ /dev/null @@ -1,68 +0,0 @@ - 90 || $max > 90) { - throw new \LogicException('Latitude cannot be greater that 90.0'); - } - - return $this->randomFloat(6, $min, $max); - } - - /** - * @example '86.211205' - * - * @return float Uses signed degrees format (returns a float number between -180 and 180) - */ - public function longitude(float $min = -180.0, float $max = 180.0): float - { - if ($min < -180 || $max < -180) { - throw new \LogicException('Longitude cannot be less that -180.0'); - } - - if ($min > 180 || $max > 180) { - throw new \LogicException('Longitude cannot be greater that 180.0'); - } - - return $this->randomFloat(6, $min, $max); - } - - /** - * @example array('77.147489', '86.211205') - * - * @return array{latitude: float, longitude: float} - */ - public function localCoordinates(): array - { - return [ - 'latitude' => static::latitude(), - 'longitude' => static::longitude(), - ]; - } - - private function randomFloat(int $nbMaxDecimals, float $min, float $max): float - { - if ($min > $max) { - throw new \LogicException('Invalid coordinates boundaries'); - } - - return round($min + mt_rand() / mt_getrandmax() * ($max - $min), $nbMaxDecimals); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Core/DateTime.php b/vendor/fakerphp/faker/src/Faker/Core/DateTime.php deleted file mode 100644 index f3d78776..00000000 --- a/vendor/fakerphp/faker/src/Faker/Core/DateTime.php +++ /dev/null @@ -1,230 +0,0 @@ -getTimestamp(); - } - - return strtotime(empty($until) ? 'now' : $until); - } - - /** - * Get a DateTime created based on a POSIX-timestamp. - * - * @param int $timestamp the UNIX / POSIX-compatible timestamp - */ - protected function getTimestampDateTime(int $timestamp): \DateTime - { - return new \DateTime('@' . $timestamp); - } - - protected function setDefaultTimezone(string $timezone = null): void - { - $this->defaultTimezone = $timezone; - } - - protected function getDefaultTimezone(): ?string - { - return $this->defaultTimezone; - } - - protected function resolveTimezone(?string $timezone): string - { - if ($timezone !== null) { - return $timezone; - } - - return null === $this->defaultTimezone ? date_default_timezone_get() : $this->defaultTimezone; - } - - /** - * Internal method to set the timezone on a DateTime object. - */ - protected function setTimezone(\DateTime $dateTime, ?string $timezone): \DateTime - { - $timezone = $this->resolveTimezone($timezone); - - return $dateTime->setTimezone(new \DateTimeZone($timezone)); - } - - public function dateTime($until = 'now', string $timezone = null): \DateTime - { - return $this->setTimezone( - $this->getTimestampDateTime($this->unixTime($until)), - $timezone, - ); - } - - public function dateTimeAD($until = 'now', string $timezone = null): \DateTime - { - $min = (PHP_INT_SIZE > 4) ? -62135597361 : -PHP_INT_MAX; - - return $this->setTimezone( - $this->getTimestampDateTime($this->generator->numberBetween($min, $this->getTimestamp($until))), - $timezone, - ); - } - - public function dateTimeBetween($from = '-30 years', $until = 'now', string $timezone = null): \DateTime - { - $start = $this->getTimestamp($from); - $end = $this->getTimestamp($until); - - if ($start > $end) { - throw new \InvalidArgumentException('"$from" must be anterior to "$until".'); - } - - $timestamp = $this->generator->numberBetween($start, $end); - - return $this->setTimezone( - $this->getTimestampDateTime($timestamp), - $timezone, - ); - } - - public function dateTimeInInterval($from = '-30 years', string $interval = '+5 days', string $timezone = null): \DateTime - { - $intervalObject = \DateInterval::createFromDateString($interval); - $datetime = $from instanceof \DateTime ? $from : new \DateTime($from); - - $other = (clone $datetime)->add($intervalObject); - - $begin = min($datetime, $other); - $end = $datetime === $begin ? $other : $datetime; - - return $this->dateTimeBetween($begin, $end, $timezone); - } - - public function dateTimeThisWeek($until = 'sunday this week', string $timezone = null): \DateTime - { - return $this->dateTimeBetween('monday this week', $until, $timezone); - } - - public function dateTimeThisMonth($until = 'last day of this month', string $timezone = null): \DateTime - { - return $this->dateTimeBetween('first day of this month', $until, $timezone); - } - - public function dateTimeThisYear($until = 'last day of december', string $timezone = null): \DateTime - { - return $this->dateTimeBetween('first day of january', $until, $timezone); - } - - public function dateTimeThisDecade($until = 'now', string $timezone = null): \DateTime - { - $year = floor(date('Y') / 10) * 10; - - return $this->dateTimeBetween("first day of january $year", $until, $timezone); - } - - public function dateTimeThisCentury($until = 'now', string $timezone = null): \DateTime - { - $year = floor(date('Y') / 100) * 100; - - return $this->dateTimeBetween("first day of january $year", $until, $timezone); - } - - public function date(string $format = 'Y-m-d', $until = 'now'): string - { - return $this->dateTime($until)->format($format); - } - - public function time(string $format = 'H:i:s', $until = 'now'): string - { - return $this->date($format, $until); - } - - public function unixTime($until = 'now'): int - { - return $this->generator->numberBetween(0, $this->getTimestamp($until)); - } - - public function iso8601($until = 'now'): string - { - return $this->date(\DateTime::ISO8601, $until); - } - - public function amPm($until = 'now'): string - { - return $this->date('a', $until); - } - - public function dayOfMonth($until = 'now'): string - { - return $this->date('d', $until); - } - - public function dayOfWeek($until = 'now'): string - { - return $this->date('l', $until); - } - - public function month($until = 'now'): string - { - return $this->date('m', $until); - } - - public function monthName($until = 'now'): string - { - return $this->date('F', $until); - } - - public function year($until = 'now'): string - { - return $this->date('Y', $until); - } - - public function century(): string - { - return Helper::randomElement($this->centuries); - } - - public function timezone(string $countryCode = null): string - { - if ($countryCode) { - $timezones = \DateTimeZone::listIdentifiers(\DateTimeZone::PER_COUNTRY, $countryCode); - } else { - $timezones = \DateTimeZone::listIdentifiers(); - } - - return Helper::randomElement($timezones); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Core/File.php b/vendor/fakerphp/faker/src/Faker/Core/File.php deleted file mode 100644 index adddb0cb..00000000 --- a/vendor/fakerphp/faker/src/Faker/Core/File.php +++ /dev/null @@ -1,564 +0,0 @@ - file extension(s) - * - * @see http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types - */ - private $mimeTypes = [ - 'application/atom+xml' => 'atom', - 'application/ecmascript' => 'ecma', - 'application/emma+xml' => 'emma', - 'application/epub+zip' => 'epub', - 'application/java-archive' => 'jar', - 'application/java-vm' => 'class', - 'application/javascript' => 'js', - 'application/json' => 'json', - 'application/jsonml+json' => 'jsonml', - 'application/lost+xml' => 'lostxml', - 'application/mathml+xml' => 'mathml', - 'application/mets+xml' => 'mets', - 'application/mods+xml' => 'mods', - 'application/mp4' => 'mp4s', - 'application/msword' => ['doc', 'dot'], - 'application/octet-stream' => [ - 'bin', - 'dms', - 'lrf', - 'mar', - 'so', - 'dist', - 'distz', - 'pkg', - 'bpk', - 'dump', - 'elc', - 'deploy', - ], - 'application/ogg' => 'ogx', - 'application/omdoc+xml' => 'omdoc', - 'application/pdf' => 'pdf', - 'application/pgp-encrypted' => 'pgp', - 'application/pgp-signature' => ['asc', 'sig'], - 'application/pkix-pkipath' => 'pkipath', - 'application/pkixcmp' => 'pki', - 'application/pls+xml' => 'pls', - 'application/postscript' => ['ai', 'eps', 'ps'], - 'application/pskc+xml' => 'pskcxml', - 'application/rdf+xml' => 'rdf', - 'application/reginfo+xml' => 'rif', - 'application/rss+xml' => 'rss', - 'application/rtf' => 'rtf', - 'application/sbml+xml' => 'sbml', - 'application/vnd.adobe.air-application-installer-package+zip' => 'air', - 'application/vnd.adobe.xdp+xml' => 'xdp', - 'application/vnd.adobe.xfdf' => 'xfdf', - 'application/vnd.ahead.space' => 'ahead', - 'application/vnd.dart' => 'dart', - 'application/vnd.data-vision.rdz' => 'rdz', - 'application/vnd.dece.data' => ['uvf', 'uvvf', 'uvd', 'uvvd'], - 'application/vnd.dece.ttml+xml' => ['uvt', 'uvvt'], - 'application/vnd.dece.unspecified' => ['uvx', 'uvvx'], - 'application/vnd.dece.zip' => ['uvz', 'uvvz'], - 'application/vnd.denovo.fcselayout-link' => 'fe_launch', - 'application/vnd.dna' => 'dna', - 'application/vnd.dolby.mlp' => 'mlp', - 'application/vnd.dpgraph' => 'dpg', - 'application/vnd.dreamfactory' => 'dfac', - 'application/vnd.ds-keypoint' => 'kpxx', - 'application/vnd.dvb.ait' => 'ait', - 'application/vnd.dvb.service' => 'svc', - 'application/vnd.dynageo' => 'geo', - 'application/vnd.ecowin.chart' => 'mag', - 'application/vnd.enliven' => 'nml', - 'application/vnd.epson.esf' => 'esf', - 'application/vnd.epson.msf' => 'msf', - 'application/vnd.epson.quickanime' => 'qam', - 'application/vnd.epson.salt' => 'slt', - 'application/vnd.epson.ssf' => 'ssf', - 'application/vnd.ezpix-album' => 'ez2', - 'application/vnd.ezpix-package' => 'ez3', - 'application/vnd.fdf' => 'fdf', - 'application/vnd.fdsn.mseed' => 'mseed', - 'application/vnd.fdsn.seed' => ['seed', 'dataless'], - 'application/vnd.flographit' => 'gph', - 'application/vnd.fluxtime.clip' => 'ftc', - 'application/vnd.hal+xml' => 'hal', - 'application/vnd.hydrostatix.sof-data' => 'sfd-hdstx', - 'application/vnd.ibm.minipay' => 'mpy', - 'application/vnd.ibm.secure-container' => 'sc', - 'application/vnd.iccprofile' => ['icc', 'icm'], - 'application/vnd.igloader' => 'igl', - 'application/vnd.immervision-ivp' => 'ivp', - 'application/vnd.kde.karbon' => 'karbon', - 'application/vnd.kde.kchart' => 'chrt', - 'application/vnd.kde.kformula' => 'kfo', - 'application/vnd.kde.kivio' => 'flw', - 'application/vnd.kde.kontour' => 'kon', - 'application/vnd.kde.kpresenter' => ['kpr', 'kpt'], - 'application/vnd.kde.kspread' => 'ksp', - 'application/vnd.kde.kword' => ['kwd', 'kwt'], - 'application/vnd.kenameaapp' => 'htke', - 'application/vnd.kidspiration' => 'kia', - 'application/vnd.kinar' => ['kne', 'knp'], - 'application/vnd.koan' => ['skp', 'skd', 'skt', 'skm'], - 'application/vnd.kodak-descriptor' => 'sse', - 'application/vnd.las.las+xml' => 'lasxml', - 'application/vnd.llamagraphics.life-balance.desktop' => 'lbd', - 'application/vnd.llamagraphics.life-balance.exchange+xml' => 'lbe', - 'application/vnd.lotus-1-2-3' => '123', - 'application/vnd.lotus-approach' => 'apr', - 'application/vnd.lotus-freelance' => 'pre', - 'application/vnd.lotus-notes' => 'nsf', - 'application/vnd.lotus-organizer' => 'org', - 'application/vnd.lotus-screencam' => 'scm', - 'application/vnd.mozilla.xul+xml' => 'xul', - 'application/vnd.ms-artgalry' => 'cil', - 'application/vnd.ms-cab-compressed' => 'cab', - 'application/vnd.ms-excel' => [ - 'xls', - 'xlm', - 'xla', - 'xlc', - 'xlt', - 'xlw', - ], - 'application/vnd.ms-excel.addin.macroenabled.12' => 'xlam', - 'application/vnd.ms-excel.sheet.binary.macroenabled.12' => 'xlsb', - 'application/vnd.ms-excel.sheet.macroenabled.12' => 'xlsm', - 'application/vnd.ms-excel.template.macroenabled.12' => 'xltm', - 'application/vnd.ms-fontobject' => 'eot', - 'application/vnd.ms-htmlhelp' => 'chm', - 'application/vnd.ms-ims' => 'ims', - 'application/vnd.ms-lrm' => 'lrm', - 'application/vnd.ms-officetheme' => 'thmx', - 'application/vnd.ms-pki.seccat' => 'cat', - 'application/vnd.ms-pki.stl' => 'stl', - 'application/vnd.ms-powerpoint' => ['ppt', 'pps', 'pot'], - 'application/vnd.ms-powerpoint.addin.macroenabled.12' => 'ppam', - 'application/vnd.ms-powerpoint.presentation.macroenabled.12' => 'pptm', - 'application/vnd.ms-powerpoint.slide.macroenabled.12' => 'sldm', - 'application/vnd.ms-powerpoint.slideshow.macroenabled.12' => 'ppsm', - 'application/vnd.ms-powerpoint.template.macroenabled.12' => 'potm', - 'application/vnd.ms-project' => ['mpp', 'mpt'], - 'application/vnd.ms-word.document.macroenabled.12' => 'docm', - 'application/vnd.ms-word.template.macroenabled.12' => 'dotm', - 'application/vnd.ms-works' => ['wps', 'wks', 'wcm', 'wdb'], - 'application/vnd.ms-wpl' => 'wpl', - 'application/vnd.ms-xpsdocument' => 'xps', - 'application/vnd.mseq' => 'mseq', - 'application/vnd.musician' => 'mus', - 'application/vnd.oasis.opendocument.chart' => 'odc', - 'application/vnd.oasis.opendocument.chart-template' => 'otc', - 'application/vnd.oasis.opendocument.database' => 'odb', - 'application/vnd.oasis.opendocument.formula' => 'odf', - 'application/vnd.oasis.opendocument.formula-template' => 'odft', - 'application/vnd.oasis.opendocument.graphics' => 'odg', - 'application/vnd.oasis.opendocument.graphics-template' => 'otg', - 'application/vnd.oasis.opendocument.image' => 'odi', - 'application/vnd.oasis.opendocument.image-template' => 'oti', - 'application/vnd.oasis.opendocument.presentation' => 'odp', - 'application/vnd.oasis.opendocument.presentation-template' => 'otp', - 'application/vnd.oasis.opendocument.spreadsheet' => 'ods', - 'application/vnd.oasis.opendocument.spreadsheet-template' => 'ots', - 'application/vnd.oasis.opendocument.text' => 'odt', - 'application/vnd.oasis.opendocument.text-master' => 'odm', - 'application/vnd.oasis.opendocument.text-template' => 'ott', - 'application/vnd.oasis.opendocument.text-web' => 'oth', - 'application/vnd.olpc-sugar' => 'xo', - 'application/vnd.oma.dd2+xml' => 'dd2', - 'application/vnd.openofficeorg.extension' => 'oxt', - 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => 'pptx', - 'application/vnd.openxmlformats-officedocument.presentationml.slide' => 'sldx', - 'application/vnd.openxmlformats-officedocument.presentationml.slideshow' => 'ppsx', - 'application/vnd.openxmlformats-officedocument.presentationml.template' => 'potx', - 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => 'xlsx', - 'application/vnd.openxmlformats-officedocument.spreadsheetml.template' => 'xltx', - 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => 'docx', - 'application/vnd.openxmlformats-officedocument.wordprocessingml.template' => 'dotx', - 'application/vnd.pvi.ptid1' => 'ptid', - 'application/vnd.quark.quarkxpress' => [ - 'qxd', - 'qxt', - 'qwd', - 'qwt', - 'qxl', - 'qxb', - ], - 'application/vnd.realvnc.bed' => 'bed', - 'application/vnd.recordare.musicxml' => 'mxl', - 'application/vnd.recordare.musicxml+xml' => 'musicxml', - 'application/vnd.rig.cryptonote' => 'cryptonote', - 'application/vnd.rim.cod' => 'cod', - 'application/vnd.rn-realmedia' => 'rm', - 'application/vnd.rn-realmedia-vbr' => 'rmvb', - 'application/vnd.route66.link66+xml' => 'link66', - 'application/vnd.sailingtracker.track' => 'st', - 'application/vnd.seemail' => 'see', - 'application/vnd.sema' => 'sema', - 'application/vnd.semd' => 'semd', - 'application/vnd.semf' => 'semf', - 'application/vnd.shana.informed.formdata' => 'ifm', - 'application/vnd.shana.informed.formtemplate' => 'itp', - 'application/vnd.shana.informed.interchange' => 'iif', - 'application/vnd.shana.informed.package' => 'ipk', - 'application/vnd.simtech-mindmapper' => ['twd', 'twds'], - 'application/vnd.smaf' => 'mmf', - 'application/vnd.stepmania.stepchart' => 'sm', - 'application/vnd.sun.xml.calc' => 'sxc', - 'application/vnd.sun.xml.calc.template' => 'stc', - 'application/vnd.sun.xml.draw' => 'sxd', - 'application/vnd.sun.xml.draw.template' => 'std', - 'application/vnd.sun.xml.impress' => 'sxi', - 'application/vnd.sun.xml.impress.template' => 'sti', - 'application/vnd.sun.xml.math' => 'sxm', - 'application/vnd.sun.xml.writer' => 'sxw', - 'application/vnd.sun.xml.writer.global' => 'sxg', - 'application/vnd.sun.xml.writer.template' => 'stw', - 'application/vnd.sus-calendar' => ['sus', 'susp'], - 'application/vnd.svd' => 'svd', - 'application/vnd.symbian.install' => ['sis', 'sisx'], - 'application/vnd.syncml+xml' => 'xsm', - 'application/vnd.syncml.dm+wbxml' => 'bdm', - 'application/vnd.syncml.dm+xml' => 'xdm', - 'application/vnd.tao.intent-module-archive' => 'tao', - 'application/vnd.tcpdump.pcap' => ['pcap', 'cap', 'dmp'], - 'application/vnd.tmobile-livetv' => 'tmo', - 'application/vnd.trid.tpt' => 'tpt', - 'application/vnd.triscape.mxs' => 'mxs', - 'application/vnd.trueapp' => 'tra', - 'application/vnd.ufdl' => ['ufd', 'ufdl'], - 'application/vnd.uiq.theme' => 'utz', - 'application/vnd.umajin' => 'umj', - 'application/vnd.unity' => 'unityweb', - 'application/vnd.uoml+xml' => 'uoml', - 'application/vnd.vcx' => 'vcx', - 'application/vnd.visio' => ['vsd', 'vst', 'vss', 'vsw'], - 'application/vnd.visionary' => 'vis', - 'application/vnd.vsf' => 'vsf', - 'application/vnd.wap.wbxml' => 'wbxml', - 'application/vnd.wap.wmlc' => 'wmlc', - 'application/vnd.wap.wmlscriptc' => 'wmlsc', - 'application/vnd.webturbo' => 'wtb', - 'application/vnd.wolfram.player' => 'nbp', - 'application/vnd.wordperfect' => 'wpd', - 'application/vnd.wqd' => 'wqd', - 'application/vnd.wt.stf' => 'stf', - 'application/vnd.xara' => 'xar', - 'application/vnd.xfdl' => 'xfdl', - 'application/voicexml+xml' => 'vxml', - 'application/widget' => 'wgt', - 'application/winhlp' => 'hlp', - 'application/wsdl+xml' => 'wsdl', - 'application/wspolicy+xml' => 'wspolicy', - 'application/x-7z-compressed' => '7z', - 'application/x-bittorrent' => 'torrent', - 'application/x-blorb' => ['blb', 'blorb'], - 'application/x-bzip' => 'bz', - 'application/x-cdlink' => 'vcd', - 'application/x-cfs-compressed' => 'cfs', - 'application/x-chat' => 'chat', - 'application/x-chess-pgn' => 'pgn', - 'application/x-conference' => 'nsc', - 'application/x-cpio' => 'cpio', - 'application/x-csh' => 'csh', - 'application/x-debian-package' => ['deb', 'udeb'], - 'application/x-dgc-compressed' => 'dgc', - 'application/x-director' => [ - 'dir', - 'dcr', - 'dxr', - 'cst', - 'cct', - 'cxt', - 'w3d', - 'fgd', - 'swa', - ], - 'application/x-font-ttf' => ['ttf', 'ttc'], - 'application/x-font-type1' => ['pfa', 'pfb', 'pfm', 'afm'], - 'application/x-font-woff' => 'woff', - 'application/x-freearc' => 'arc', - 'application/x-futuresplash' => 'spl', - 'application/x-gca-compressed' => 'gca', - 'application/x-glulx' => 'ulx', - 'application/x-gnumeric' => 'gnumeric', - 'application/x-gramps-xml' => 'gramps', - 'application/x-gtar' => 'gtar', - 'application/x-hdf' => 'hdf', - 'application/x-install-instructions' => 'install', - 'application/x-iso9660-image' => 'iso', - 'application/x-java-jnlp-file' => 'jnlp', - 'application/x-latex' => 'latex', - 'application/x-lzh-compressed' => ['lzh', 'lha'], - 'application/x-mie' => 'mie', - 'application/x-mobipocket-ebook' => ['prc', 'mobi'], - 'application/x-ms-application' => 'application', - 'application/x-ms-shortcut' => 'lnk', - 'application/x-ms-wmd' => 'wmd', - 'application/x-ms-wmz' => 'wmz', - 'application/x-ms-xbap' => 'xbap', - 'application/x-msaccess' => 'mdb', - 'application/x-msbinder' => 'obd', - 'application/x-mscardfile' => 'crd', - 'application/x-msclip' => 'clp', - 'application/x-msdownload' => ['exe', 'dll', 'com', 'bat', 'msi'], - 'application/x-msmediaview' => [ - 'mvb', - 'm13', - 'm14', - ], - 'application/x-msmetafile' => ['wmf', 'wmz', 'emf', 'emz'], - 'application/x-rar-compressed' => 'rar', - 'application/x-research-info-systems' => 'ris', - 'application/x-sh' => 'sh', - 'application/x-shar' => 'shar', - 'application/x-shockwave-flash' => 'swf', - 'application/x-silverlight-app' => 'xap', - 'application/x-sql' => 'sql', - 'application/x-stuffit' => 'sit', - 'application/x-stuffitx' => 'sitx', - 'application/x-subrip' => 'srt', - 'application/x-sv4cpio' => 'sv4cpio', - 'application/x-sv4crc' => 'sv4crc', - 'application/x-t3vm-image' => 't3', - 'application/x-tads' => 'gam', - 'application/x-tar' => 'tar', - 'application/x-tcl' => 'tcl', - 'application/x-tex' => 'tex', - 'application/x-tex-tfm' => 'tfm', - 'application/x-texinfo' => ['texinfo', 'texi'], - 'application/x-tgif' => 'obj', - 'application/x-ustar' => 'ustar', - 'application/x-wais-source' => 'src', - 'application/x-x509-ca-cert' => ['der', 'crt'], - 'application/x-xfig' => 'fig', - 'application/x-xliff+xml' => 'xlf', - 'application/x-xpinstall' => 'xpi', - 'application/x-xz' => 'xz', - 'application/x-zmachine' => 'z1', - 'application/xaml+xml' => 'xaml', - 'application/xcap-diff+xml' => 'xdf', - 'application/xenc+xml' => 'xenc', - 'application/xhtml+xml' => ['xhtml', 'xht'], - 'application/xml' => ['xml', 'xsl'], - 'application/xml-dtd' => 'dtd', - 'application/xop+xml' => 'xop', - 'application/xproc+xml' => 'xpl', - 'application/xslt+xml' => 'xslt', - 'application/xspf+xml' => 'xspf', - 'application/xv+xml' => ['mxml', 'xhvml', 'xvml', 'xvm'], - 'application/yang' => 'yang', - 'application/yin+xml' => 'yin', - 'application/zip' => 'zip', - 'audio/adpcm' => 'adp', - 'audio/basic' => ['au', 'snd'], - 'audio/midi' => ['mid', 'midi', 'kar', 'rmi'], - 'audio/mp4' => 'mp4a', - 'audio/mpeg' => [ - 'mpga', - 'mp2', - 'mp2a', - 'mp3', - 'm2a', - 'm3a', - ], - 'audio/ogg' => ['oga', 'ogg', 'spx'], - 'audio/vnd.dece.audio' => ['uva', 'uvva'], - 'audio/vnd.rip' => 'rip', - 'audio/webm' => 'weba', - 'audio/x-aac' => 'aac', - 'audio/x-aiff' => ['aif', 'aiff', 'aifc'], - 'audio/x-caf' => 'caf', - 'audio/x-flac' => 'flac', - 'audio/x-matroska' => 'mka', - 'audio/x-mpegurl' => 'm3u', - 'audio/x-ms-wax' => 'wax', - 'audio/x-ms-wma' => 'wma', - 'audio/x-pn-realaudio' => ['ram', 'ra'], - 'audio/x-pn-realaudio-plugin' => 'rmp', - 'audio/x-wav' => 'wav', - 'audio/xm' => 'xm', - 'image/bmp' => 'bmp', - 'image/cgm' => 'cgm', - 'image/g3fax' => 'g3', - 'image/gif' => 'gif', - 'image/ief' => 'ief', - 'image/jpeg' => ['jpeg', 'jpg', 'jpe'], - 'image/ktx' => 'ktx', - 'image/png' => 'png', - 'image/prs.btif' => 'btif', - 'image/sgi' => 'sgi', - 'image/svg+xml' => ['svg', 'svgz'], - 'image/tiff' => ['tiff', 'tif'], - 'image/vnd.adobe.photoshop' => 'psd', - 'image/vnd.dece.graphic' => ['uvi', 'uvvi', 'uvg', 'uvvg'], - 'image/vnd.dvb.subtitle' => 'sub', - 'image/vnd.djvu' => ['djvu', 'djv'], - 'image/vnd.dwg' => 'dwg', - 'image/vnd.dxf' => 'dxf', - 'image/vnd.fastbidsheet' => 'fbs', - 'image/vnd.fpx' => 'fpx', - 'image/vnd.fst' => 'fst', - 'image/vnd.fujixerox.edmics-mmr' => 'mmr', - 'image/vnd.fujixerox.edmics-rlc' => 'rlc', - 'image/vnd.ms-modi' => 'mdi', - 'image/vnd.ms-photo' => 'wdp', - 'image/vnd.net-fpx' => 'npx', - 'image/vnd.wap.wbmp' => 'wbmp', - 'image/vnd.xiff' => 'xif', - 'image/webp' => 'webp', - 'image/x-3ds' => '3ds', - 'image/x-cmu-raster' => 'ras', - 'image/x-cmx' => 'cmx', - 'image/x-freehand' => ['fh', 'fhc', 'fh4', 'fh5', 'fh7'], - 'image/x-icon' => 'ico', - 'image/x-mrsid-image' => 'sid', - 'image/x-pcx' => 'pcx', - 'image/x-pict' => ['pic', 'pct'], - 'image/x-portable-anymap' => 'pnm', - 'image/x-portable-bitmap' => 'pbm', - 'image/x-portable-graymap' => 'pgm', - 'image/x-portable-pixmap' => 'ppm', - 'image/x-rgb' => 'rgb', - 'image/x-tga' => 'tga', - 'image/x-xbitmap' => 'xbm', - 'image/x-xpixmap' => 'xpm', - 'image/x-xwindowdump' => 'xwd', - 'message/rfc822' => ['eml', 'mime'], - 'model/iges' => ['igs', 'iges'], - 'model/mesh' => ['msh', 'mesh', 'silo'], - 'model/vnd.collada+xml' => 'dae', - 'model/vnd.dwf' => 'dwf', - 'model/vnd.gdl' => 'gdl', - 'model/vnd.gtw' => 'gtw', - 'model/vnd.mts' => 'mts', - 'model/vnd.vtu' => 'vtu', - 'model/vrml' => ['wrl', 'vrml'], - 'model/x3d+binary' => 'x3db', - 'model/x3d+vrml' => 'x3dv', - 'model/x3d+xml' => 'x3d', - 'text/cache-manifest' => 'appcache', - 'text/calendar' => ['ics', 'ifb'], - 'text/css' => 'css', - 'text/csv' => 'csv', - 'text/html' => ['html', 'htm'], - 'text/n3' => 'n3', - 'text/plain' => [ - 'txt', - 'text', - 'conf', - 'def', - 'list', - 'log', - 'in', - ], - 'text/prs.lines.tag' => 'dsc', - 'text/richtext' => 'rtx', - 'text/sgml' => ['sgml', 'sgm'], - 'text/tab-separated-values' => 'tsv', - 'text/troff' => [ - 't', - 'tr', - 'roff', - 'man', - 'me', - 'ms', - ], - 'text/turtle' => 'ttl', - 'text/uri-list' => ['uri', 'uris', 'urls'], - 'text/vcard' => 'vcard', - 'text/vnd.curl' => 'curl', - 'text/vnd.curl.dcurl' => 'dcurl', - 'text/vnd.curl.scurl' => 'scurl', - 'text/vnd.curl.mcurl' => 'mcurl', - 'text/vnd.dvb.subtitle' => 'sub', - 'text/vnd.fly' => 'fly', - 'text/vnd.fmi.flexstor' => 'flx', - 'text/vnd.graphviz' => 'gv', - 'text/vnd.in3d.3dml' => '3dml', - 'text/vnd.in3d.spot' => 'spot', - 'text/vnd.sun.j2me.app-descriptor' => 'jad', - 'text/vnd.wap.wml' => 'wml', - 'text/vnd.wap.wmlscript' => 'wmls', - 'text/x-asm' => ['s', 'asm'], - 'text/x-fortran' => ['f', 'for', 'f77', 'f90'], - 'text/x-java-source' => 'java', - 'text/x-opml' => 'opml', - 'text/x-pascal' => ['p', 'pas'], - 'text/x-nfo' => 'nfo', - 'text/x-setext' => 'etx', - 'text/x-sfv' => 'sfv', - 'text/x-uuencode' => 'uu', - 'text/x-vcalendar' => 'vcs', - 'text/x-vcard' => 'vcf', - 'video/3gpp' => '3gp', - 'video/3gpp2' => '3g2', - 'video/h261' => 'h261', - 'video/h263' => 'h263', - 'video/h264' => 'h264', - 'video/jpeg' => 'jpgv', - 'video/jpm' => ['jpm', 'jpgm'], - 'video/mj2' => 'mj2', - 'video/mp4' => 'mp4', - 'video/mpeg' => ['mpeg', 'mpg', 'mpe', 'm1v', 'm2v'], - 'video/ogg' => 'ogv', - 'video/quicktime' => ['qt', 'mov'], - 'video/vnd.dece.hd' => ['uvh', 'uvvh'], - 'video/vnd.dece.mobile' => ['uvm', 'uvvm'], - 'video/vnd.dece.pd' => ['uvp', 'uvvp'], - 'video/vnd.dece.sd' => ['uvs', 'uvvs'], - 'video/vnd.dece.video' => ['uvv', 'uvvv'], - 'video/vnd.dvb.file' => 'dvb', - 'video/vnd.fvt' => 'fvt', - 'video/vnd.mpegurl' => ['mxu', 'm4u'], - 'video/vnd.ms-playready.media.pyv' => 'pyv', - 'video/vnd.uvvu.mp4' => ['uvu', 'uvvu'], - 'video/vnd.vivo' => 'viv', - 'video/webm' => 'webm', - 'video/x-f4v' => 'f4v', - 'video/x-fli' => 'fli', - 'video/x-flv' => 'flv', - 'video/x-m4v' => 'm4v', - 'video/x-matroska' => ['mkv', 'mk3d', 'mks'], - 'video/x-mng' => 'mng', - 'video/x-ms-asf' => ['asf', 'asx'], - 'video/x-ms-vob' => 'vob', - 'video/x-ms-wm' => 'wm', - 'video/x-ms-wmv' => 'wmv', - 'video/x-ms-wmx' => 'wmx', - 'video/x-ms-wvx' => 'wvx', - 'video/x-msvideo' => 'avi', - 'video/x-sgi-movie' => 'movie', - ]; - - public function mimeType(): string - { - return array_rand($this->mimeTypes, 1); - } - - public function extension(): string - { - $extension = $this->mimeTypes[array_rand($this->mimeTypes, 1)]; - - return is_array($extension) ? $extension[array_rand($extension, 1)] : $extension; - } - - public function filePath(): string - { - return tempnam(sys_get_temp_dir(), 'faker'); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Core/Number.php b/vendor/fakerphp/faker/src/Faker/Core/Number.php deleted file mode 100644 index f67c0426..00000000 --- a/vendor/fakerphp/faker/src/Faker/Core/Number.php +++ /dev/null @@ -1,83 +0,0 @@ -= $except) { - ++$result; - } - - return $result; - } - - public function randomDigitNotZero(): int - { - return mt_rand(1, 9); - } - - public function randomFloat(?int $nbMaxDecimals = null, float $min = 0, ?float $max = null): float - { - if (null === $nbMaxDecimals) { - $nbMaxDecimals = $this->randomDigit(); - } - - if (null === $max) { - $max = $this->randomNumber(); - - if ($min > $max) { - $max = $min; - } - } - - if ($min > $max) { - $tmp = $min; - $min = $max; - $max = $tmp; - } - - return round($min + mt_rand() / mt_getrandmax() * ($max - $min), $nbMaxDecimals); - } - - public function randomNumber(int $nbDigits = null, bool $strict = false): int - { - if (null === $nbDigits) { - $nbDigits = $this->randomDigitNotZero(); - } - $max = 10 ** $nbDigits - 1; - - if ($max > mt_getrandmax()) { - throw new \InvalidArgumentException('randomNumber() can only generate numbers up to mt_getrandmax()'); - } - - if ($strict) { - return mt_rand(10 ** ($nbDigits - 1), $max); - } - - return mt_rand(0, $max); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Core/Uuid.php b/vendor/fakerphp/faker/src/Faker/Core/Uuid.php deleted file mode 100644 index 5e3b633a..00000000 --- a/vendor/fakerphp/faker/src/Faker/Core/Uuid.php +++ /dev/null @@ -1,56 +0,0 @@ -numberBetween(0, 2147483647) . '#' . $number->numberBetween(0, 2147483647); - - // Hash the seed and convert to a byte array - $val = md5($seed, true); - $byte = array_values(unpack('C16', $val)); - - // extract fields from byte array - $tLo = ($byte[0] << 24) | ($byte[1] << 16) | ($byte[2] << 8) | $byte[3]; - $tMi = ($byte[4] << 8) | $byte[5]; - $tHi = ($byte[6] << 8) | $byte[7]; - $csLo = $byte[9]; - $csHi = $byte[8] & 0x3f | (1 << 7); - - // correct byte order for big edian architecture - if (pack('L', 0x6162797A) == pack('N', 0x6162797A)) { - $tLo = (($tLo & 0x000000ff) << 24) | (($tLo & 0x0000ff00) << 8) - | (($tLo & 0x00ff0000) >> 8) | (($tLo & 0xff000000) >> 24); - $tMi = (($tMi & 0x00ff) << 8) | (($tMi & 0xff00) >> 8); - $tHi = (($tHi & 0x00ff) << 8) | (($tHi & 0xff00) >> 8); - } - - // apply version number - $tHi &= 0x0fff; - $tHi |= (3 << 12); - - // cast to string - return sprintf( - '%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x', - $tLo, - $tMi, - $tHi, - $csHi, - $csLo, - $byte[10], - $byte[11], - $byte[12], - $byte[13], - $byte[14], - $byte[15], - ); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Core/Version.php b/vendor/fakerphp/faker/src/Faker/Core/Version.php deleted file mode 100644 index ce484e6a..00000000 --- a/vendor/fakerphp/faker/src/Faker/Core/Version.php +++ /dev/null @@ -1,60 +0,0 @@ -semverPreReleaseIdentifier() : '', - $build && mt_rand(0, 1) ? '+' . $this->semverBuildIdentifier() : '', - ); - } - - /** - * Common pre-release identifier - */ - private function semverPreReleaseIdentifier(): string - { - $ident = Helper::randomElement($this->semverCommonPreReleaseIdentifiers); - - if (!mt_rand(0, 1)) { - return $ident; - } - - return $ident . '.' . mt_rand(1, 99); - } - - /** - * Common random build identifier - */ - private function semverBuildIdentifier(): string - { - if (mt_rand(0, 1)) { - // short git revision syntax: https://git-scm.com/book/en/v2/Git-Tools-Revision-Selection - return substr(sha1(Helper::lexify('??????')), 0, 7); - } - - // date syntax - return DateTime::date('YmdHis'); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/DefaultGenerator.php b/vendor/fakerphp/faker/src/Faker/DefaultGenerator.php deleted file mode 100644 index 688f4766..00000000 --- a/vendor/fakerphp/faker/src/Faker/DefaultGenerator.php +++ /dev/null @@ -1,49 +0,0 @@ -default = $default; - } - - public function ext() - { - return $this; - } - - /** - * @param string $attribute - * - * @deprecated Use a method instead. - */ - public function __get($attribute) - { - trigger_deprecation('fakerphp/faker', '1.14', 'Accessing property "%s" is deprecated, use "%s()" instead.', $attribute, $attribute); - - return $this->default; - } - - /** - * @param string $method - * @param array $attributes - */ - public function __call($method, $attributes) - { - return $this->default; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Documentor.php b/vendor/fakerphp/faker/src/Faker/Documentor.php deleted file mode 100644 index 280b8320..00000000 --- a/vendor/fakerphp/faker/src/Faker/Documentor.php +++ /dev/null @@ -1,70 +0,0 @@ -generator = $generator; - } - - /** - * @return array - */ - public function getFormatters() - { - $formatters = []; - $providers = array_reverse($this->generator->getProviders()); - $providers[] = new Provider\Base($this->generator); - - foreach ($providers as $provider) { - $providerClass = get_class($provider); - $formatters[$providerClass] = []; - $refl = new \ReflectionObject($provider); - - foreach ($refl->getMethods(\ReflectionMethod::IS_PUBLIC) as $reflmethod) { - if ($reflmethod->getDeclaringClass()->getName() == 'Faker\Provider\Base' && $providerClass != 'Faker\Provider\Base') { - continue; - } - $methodName = $reflmethod->name; - - if ($reflmethod->isConstructor()) { - continue; - } - $parameters = []; - - foreach ($reflmethod->getParameters() as $reflparameter) { - $parameter = '$' . $reflparameter->getName(); - - if ($reflparameter->isDefaultValueAvailable()) { - $parameter .= ' = ' . var_export($reflparameter->getDefaultValue(), true); - } - $parameters[] = $parameter; - } - $parameters = $parameters ? '(' . implode(', ', $parameters) . ')' : ''; - - try { - $example = $this->generator->format($methodName); - } catch (\InvalidArgumentException $e) { - $example = ''; - } - - if (is_array($example)) { - $example = "array('" . implode("', '", $example) . "')"; - } elseif ($example instanceof \DateTime) { - $example = "DateTime('" . $example->format('Y-m-d H:i:s') . "')"; - } elseif ($example instanceof Generator || $example instanceof UniqueGenerator) { // modifier - $example = ''; - } else { - $example = var_export($example, true); - } - $formatters[$providerClass][$methodName . $parameters] = $example; - } - } - - return $formatters; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Extension/AddressExtension.php b/vendor/fakerphp/faker/src/Faker/Extension/AddressExtension.php deleted file mode 100644 index 568ca377..00000000 --- a/vendor/fakerphp/faker/src/Faker/Extension/AddressExtension.php +++ /dev/null @@ -1,39 +0,0 @@ -generator = $generator; - - return $instance; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Extension/Helper.php b/vendor/fakerphp/faker/src/Faker/Extension/Helper.php deleted file mode 100644 index 27a66143..00000000 --- a/vendor/fakerphp/faker/src/Faker/Extension/Helper.php +++ /dev/null @@ -1,106 +0,0 @@ -addProvider(new $providerClassName($generator)); - } - - return $generator; - } - - /** - * @param string $provider - * @param string $locale - * - * @return string - */ - protected static function getProviderClassname($provider, $locale = '') - { - if ($providerClass = self::findProviderClassname($provider, $locale)) { - return $providerClass; - } - // fallback to default locale - if ($providerClass = self::findProviderClassname($provider, static::DEFAULT_LOCALE)) { - return $providerClass; - } - // fallback to no locale - if ($providerClass = self::findProviderClassname($provider)) { - return $providerClass; - } - - throw new \InvalidArgumentException(sprintf('Unable to find provider "%s" with locale "%s"', $provider, $locale)); - } - - /** - * @param string $provider - * @param string $locale - * - * @return string|null - */ - protected static function findProviderClassname($provider, $locale = '') - { - $providerClass = 'Faker\\' . ($locale ? sprintf('Provider\%s\%s', $locale, $provider) : sprintf('Provider\%s', $provider)); - - if (class_exists($providerClass, true)) { - return $providerClass; - } - - return null; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Generator.php b/vendor/fakerphp/faker/src/Faker/Generator.php deleted file mode 100644 index ec77c087..00000000 --- a/vendor/fakerphp/faker/src/Faker/Generator.php +++ /dev/null @@ -1,973 +0,0 @@ -container = $container ?: Container\ContainerBuilder::getDefault(); - } - - /** - * @template T of Extension\Extension - * - * @param class-string $id - * - * @throws Extension\ExtensionNotFound - * - * @return T - */ - public function ext(string $id): Extension\Extension - { - if (!$this->container->has($id)) { - throw new Extension\ExtensionNotFound(sprintf( - 'No Faker extension with id "%s" was loaded.', - $id, - )); - } - - $extension = $this->container->get($id); - - if ($extension instanceof Extension\GeneratorAwareExtension) { - $extension = $extension->withGenerator($this); - } - - return $extension; - } - - public function addProvider($provider) - { - array_unshift($this->providers, $provider); - - $this->formatters = []; - } - - public function getProviders() - { - return $this->providers; - } - - /** - * With the unique generator you are guaranteed to never get the same two - * values. - * - * - * // will never return twice the same value - * $faker->unique()->randomElement(array(1, 2, 3)); - * - * - * @param bool $reset If set to true, resets the list of existing values - * @param int $maxRetries Maximum number of retries to find a unique value, - * After which an OverflowException is thrown. - * - * @throws \OverflowException When no unique value can be found by iterating $maxRetries times - * - * @return self A proxy class returning only non-existing values - */ - public function unique($reset = false, $maxRetries = 10000) - { - if ($reset || $this->uniqueGenerator === null) { - $this->uniqueGenerator = new UniqueGenerator($this, $maxRetries); - } - - return $this->uniqueGenerator; - } - - /** - * Get a value only some percentage of the time. - * - * @param float $weight A probability between 0 and 1, 0 means that we always get the default value. - * - * @return self - */ - public function optional(float $weight = 0.5, $default = null) - { - if ($weight > 1) { - trigger_deprecation('fakerphp/faker', '1.16', 'First argument ($weight) to method "optional()" must be between 0 and 1. You passed %f, we assume you meant %f.', $weight, $weight / 100); - $weight = $weight / 100; - } - - return new ChanceGenerator($this, $weight, $default); - } - - /** - * To make sure the value meet some criteria, pass a callable that verifies the - * output. If the validator fails, the generator will try again. - * - * The value validity is determined by a function passed as first argument. - * - * - * $values = array(); - * $evenValidator = function ($digit) { - * return $digit % 2 === 0; - * }; - * for ($i=0; $i < 10; $i++) { - * $values []= $faker->valid($evenValidator)->randomDigit; - * } - * print_r($values); // [0, 4, 8, 4, 2, 6, 0, 8, 8, 6] - * - * - * @param ?\Closure $validator A function returning true for valid values - * @param int $maxRetries Maximum number of retries to find a valid value, - * After which an OverflowException is thrown. - * - * @throws \OverflowException When no valid value can be found by iterating $maxRetries times - * - * @return self A proxy class returning only valid values - */ - public function valid(?\Closure $validator = null, int $maxRetries = 10000) - { - return new ValidGenerator($this, $validator, $maxRetries); - } - - public function seed($seed = null) - { - if ($seed === null) { - mt_srand(); - } else { - mt_srand((int) $seed, MT_RAND_PHP); - } - } - - public function format($format, $arguments = []) - { - return call_user_func_array($this->getFormatter($format), $arguments); - } - - /** - * @param string $format - * - * @return callable - */ - public function getFormatter($format) - { - if (isset($this->formatters[$format])) { - return $this->formatters[$format]; - } - - if (method_exists($this, $format)) { - $this->formatters[$format] = [$this, $format]; - - return $this->formatters[$format]; - } - - // "Faker\Core\Barcode->ean13" - if (preg_match('|^([a-zA-Z0-9\\\]+)->([a-zA-Z0-9]+)$|', $format, $matches)) { - $this->formatters[$format] = [$this->ext($matches[1]), $matches[2]]; - - return $this->formatters[$format]; - } - - foreach ($this->providers as $provider) { - if (method_exists($provider, $format)) { - $this->formatters[$format] = [$provider, $format]; - - return $this->formatters[$format]; - } - } - - throw new \InvalidArgumentException(sprintf('Unknown format "%s"', $format)); - } - - /** - * Replaces tokens ('{{ tokenName }}') with the result from the token method call - * - * @param string $string String that needs to bet parsed - * - * @return string - */ - public function parse($string) - { - $callback = function ($matches) { - return $this->format($matches[1]); - }; - - return preg_replace_callback('/{{\s?(\w+|[\w\\\]+->\w+?)\s?}}/u', $callback, $string); - } - - /** - * Get a random MIME type - * - * @example 'video/avi' - */ - public function mimeType() - { - return $this->ext(Extension\FileExtension::class)->mimeType(); - } - - /** - * Get a random file extension (without a dot) - * - * @example avi - */ - public function fileExtension() - { - return $this->ext(Extension\FileExtension::class)->extension(); - } - - /** - * Get a full path to a new real file on the system. - */ - public function filePath() - { - return $this->ext(Extension\FileExtension::class)->filePath(); - } - - /** - * Get an actual blood type - * - * @example 'AB' - */ - public function bloodType(): string - { - return $this->ext(Extension\BloodExtension::class)->bloodType(); - } - - /** - * Get a random resis value - * - * @example '+' - */ - public function bloodRh(): string - { - return $this->ext(Extension\BloodExtension::class)->bloodRh(); - } - - /** - * Get a full blood group - * - * @example 'AB+' - */ - public function bloodGroup(): string - { - return $this->ext(Extension\BloodExtension::class)->bloodGroup(); - } - - /** - * Get a random EAN13 barcode. - * - * @example '4006381333931' - */ - public function ean13(): string - { - return $this->ext(Extension\BarcodeExtension::class)->ean13(); - } - - /** - * Get a random EAN8 barcode. - * - * @example '73513537' - */ - public function ean8(): string - { - return $this->ext(Extension\BarcodeExtension::class)->ean8(); - } - - /** - * Get a random ISBN-10 code - * - * @see http://en.wikipedia.org/wiki/International_Standard_Book_Number - * - * @example '4881416324' - */ - public function isbn10(): string - { - return $this->ext(Extension\BarcodeExtension::class)->isbn10(); - } - - /** - * Get a random ISBN-13 code - * - * @see http://en.wikipedia.org/wiki/International_Standard_Book_Number - * - * @example '9790404436093' - */ - public function isbn13(): string - { - return $this->ext(Extension\BarcodeExtension::class)->isbn13(); - } - - /** - * Returns a random number between $int1 and $int2 (any order) - * - * @example 79907610 - */ - public function numberBetween($int1 = 0, $int2 = 2147483647): int - { - return $this->ext(Extension\NumberExtension::class)->numberBetween((int) $int1, (int) $int2); - } - - /** - * Returns a random number between 0 and 9 - */ - public function randomDigit(): int - { - return $this->ext(Extension\NumberExtension::class)->randomDigit(); - } - - /** - * Generates a random digit, which cannot be $except - */ - public function randomDigitNot($except): int - { - return $this->ext(Extension\NumberExtension::class)->randomDigitNot((int) $except); - } - - /** - * Returns a random number between 1 and 9 - */ - public function randomDigitNotZero(): int - { - return $this->ext(Extension\NumberExtension::class)->randomDigitNotZero(); - } - - /** - * Return a random float number - * - * @example 48.8932 - */ - public function randomFloat($nbMaxDecimals = null, $min = 0, $max = null): float - { - return $this->ext(Extension\NumberExtension::class)->randomFloat( - $nbMaxDecimals !== null ? (int) $nbMaxDecimals : null, - (float) $min, - $max !== null ? (float) $max : null, - ); - } - - /** - * Returns a random integer with 0 to $nbDigits digits. - * - * The maximum value returned is mt_getrandmax() - * - * @param int|null $nbDigits Defaults to a random number between 1 and 9 - * @param bool $strict Whether the returned number should have exactly $nbDigits - * - * @example 79907610 - */ - public function randomNumber($nbDigits = null, $strict = false): int - { - return $this->ext(Extension\NumberExtension::class)->randomNumber( - $nbDigits !== null ? (int) $nbDigits : null, - (bool) $strict, - ); - } - - /** - * Get a version number in semantic versioning syntax 2.0.0. (https://semver.org/spec/v2.0.0.html) - * - * @param bool $preRelease Pre release parts may be randomly included - * @param bool $build Build parts may be randomly included - * - * @example 1.0.0 - * @example 1.0.0-alpha.1 - * @example 1.0.0-alpha.1+b71f04d - */ - public function semver(bool $preRelease = false, bool $build = false): string - { - return $this->ext(Extension\VersionExtension::class)->semver($preRelease, $build); - } - - /** - * @deprecated - */ - protected function callFormatWithMatches($matches) - { - trigger_deprecation('fakerphp/faker', '1.14', 'Protected method "callFormatWithMatches()" is deprecated and will be removed.'); - - return $this->format($matches[1]); - } - - /** - * @param string $attribute - * - * @deprecated Use a method instead. - */ - public function __get($attribute) - { - trigger_deprecation('fakerphp/faker', '1.14', 'Accessing property "%s" is deprecated, use "%s()" instead.', $attribute, $attribute); - - return $this->format($attribute); - } - - /** - * @param string $method - * @param array $attributes - */ - public function __call($method, $attributes) - { - return $this->format($method, $attributes); - } - - public function __destruct() - { - $this->seed(); - } - - public function __wakeup() - { - $this->formatters = []; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Guesser/Name.php b/vendor/fakerphp/faker/src/Faker/Guesser/Name.php deleted file mode 100644 index ddb048bc..00000000 --- a/vendor/fakerphp/faker/src/Faker/Guesser/Name.php +++ /dev/null @@ -1,180 +0,0 @@ -generator = $generator; - } - - /** - * @param string $name - * @param int|null $size Length of field, if known - * - * @return callable|null - */ - public function guessFormat($name, $size = null) - { - $name = Base::toLower($name); - $generator = $this->generator; - - if (preg_match('/^is[_A-Z]/', $name)) { - return static function () use ($generator) { - return $generator->boolean; - }; - } - - if (preg_match('/(_a|A)t$/', $name)) { - return static function () use ($generator) { - return $generator->dateTime; - }; - } - - switch (str_replace('_', '', $name)) { - case 'firstname': - return static function () use ($generator) { - return $generator->firstName; - }; - - case 'lastname': - return static function () use ($generator) { - return $generator->lastName; - }; - - case 'username': - case 'login': - return static function () use ($generator) { - return $generator->userName; - }; - - case 'email': - case 'emailaddress': - return static function () use ($generator) { - return $generator->email; - }; - - case 'phonenumber': - case 'phone': - case 'telephone': - case 'telnumber': - return static function () use ($generator) { - return $generator->phoneNumber; - }; - - case 'address': - return static function () use ($generator) { - return $generator->address; - }; - - case 'city': - case 'town': - return static function () use ($generator) { - return $generator->city; - }; - - case 'streetaddress': - return static function () use ($generator) { - return $generator->streetAddress; - }; - - case 'postcode': - case 'zipcode': - return static function () use ($generator) { - return $generator->postcode; - }; - - case 'state': - return static function () use ($generator) { - return $generator->state; - }; - - case 'county': - if ($this->generator->locale == 'en_US') { - return static function () use ($generator) { - return sprintf('%s County', $generator->city); - }; - } - - return static function () use ($generator) { - return $generator->state; - }; - - case 'country': - switch ($size) { - case 2: - return static function () use ($generator) { - return $generator->countryCode; - }; - - case 3: - return static function () use ($generator) { - return $generator->countryISOAlpha3; - }; - - case 5: - case 6: - return static function () use ($generator) { - return $generator->locale; - }; - - default: - return static function () use ($generator) { - return $generator->country; - }; - } - - break; - - case 'locale': - return static function () use ($generator) { - return $generator->locale; - }; - - case 'currency': - case 'currencycode': - return static function () use ($generator) { - return $generator->currencyCode; - }; - - case 'url': - case 'website': - return static function () use ($generator) { - return $generator->url; - }; - - case 'company': - case 'companyname': - case 'employer': - return static function () use ($generator) { - return $generator->company; - }; - - case 'title': - if ($size !== null && $size <= 10) { - return static function () use ($generator) { - return $generator->title; - }; - } - - return static function () use ($generator) { - return $generator->sentence; - }; - - case 'body': - case 'summary': - case 'article': - case 'description': - return static function () use ($generator) { - return $generator->text; - }; - } - - return null; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/ORM/CakePHP/ColumnTypeGuesser.php b/vendor/fakerphp/faker/src/Faker/ORM/CakePHP/ColumnTypeGuesser.php deleted file mode 100644 index c2a30e67..00000000 --- a/vendor/fakerphp/faker/src/Faker/ORM/CakePHP/ColumnTypeGuesser.php +++ /dev/null @@ -1,79 +0,0 @@ -generator = $generator; - } - - /** - * @return \Closure|null - */ - public function guessFormat($column, $table) - { - $generator = $this->generator; - $schema = $table->schema(); - - switch ($schema->columnType($column)) { - case 'boolean': - return static function () use ($generator) { - return $generator->boolean; - }; - - case 'integer': - return static function () use ($generator) { - return $generator->numberBetween(0, 2147483647); - }; - - case 'biginteger': - return static function () use ($generator) { - return $generator->numberBetween(0, PHP_INT_MAX); - }; - - case 'decimal': - case 'float': - return static function () use ($generator) { - return $generator->randomFloat(); - }; - - case 'uuid': - return static function () use ($generator) { - return $generator->uuid(); - }; - - case 'string': - if (method_exists($schema, 'getColumn')) { - $columnData = $schema->getColumn($column); - } else { - $columnData = $schema->column($column); - } - $length = $columnData['length']; - - return static function () use ($generator, $length) { - return $generator->text($length); - }; - - case 'text': - return static function () use ($generator) { - return $generator->text(); - }; - - case 'date': - case 'datetime': - case 'timestamp': - case 'time': - return static function () use ($generator) { - return $generator->datetime(); - }; - - case 'binary': - default: - return null; - } - } -} diff --git a/vendor/fakerphp/faker/src/Faker/ORM/CakePHP/EntityPopulator.php b/vendor/fakerphp/faker/src/Faker/ORM/CakePHP/EntityPopulator.php deleted file mode 100644 index cd9890bd..00000000 --- a/vendor/fakerphp/faker/src/Faker/ORM/CakePHP/EntityPopulator.php +++ /dev/null @@ -1,173 +0,0 @@ -class = $class; - } - - /** - * @param string $name - */ - public function __get($name) - { - return $this->{$name}; - } - - /** - * @param string $name - */ - public function __set($name, $value) - { - $this->{$name} = $value; - } - - public function mergeColumnFormattersWith($columnFormatters) - { - $this->columnFormatters = array_merge($this->columnFormatters, $columnFormatters); - } - - public function mergeModifiersWith($modifiers) - { - $this->modifiers = array_merge($this->modifiers, $modifiers); - } - - /** - * @return array - */ - public function guessColumnFormatters($populator) - { - $formatters = []; - $class = $this->class; - $table = $this->getTable($class); - $schema = $table->schema(); - $pk = $schema->primaryKey(); - $guessers = $populator->getGuessers() + ['ColumnTypeGuesser' => new ColumnTypeGuesser($populator->getGenerator())]; - $isForeignKey = static function ($column) use ($table) { - foreach ($table->associations()->type('BelongsTo') as $assoc) { - if ($column == $assoc->foreignKey()) { - return true; - } - } - - return false; - }; - - foreach ($schema->columns() as $column) { - if ($column == $pk[0] || $isForeignKey($column)) { - continue; - } - - foreach ($guessers as $guesser) { - if ($formatter = $guesser->guessFormat($column, $table)) { - $formatters[$column] = $formatter; - - break; - } - } - } - - return $formatters; - } - - /** - * @return array - */ - public function guessModifiers() - { - $modifiers = []; - $table = $this->getTable($this->class); - - $belongsTo = $table->associations()->type('BelongsTo'); - - foreach ($belongsTo as $assoc) { - $modifiers['belongsTo' . $assoc->name()] = function ($data, $insertedEntities) use ($assoc) { - $table = $assoc->target(); - $foreignModel = $table->alias(); - - $foreignKeys = []; - - if (!empty($insertedEntities[$foreignModel])) { - $foreignKeys = $insertedEntities[$foreignModel]; - } else { - $foreignKeys = $table->find('all') - ->select(['id']) - ->map(static function ($row) { - return $row->id; - }) - ->toArray(); - } - - if (empty($foreignKeys)) { - throw new \Exception(sprintf('%s belongsTo %s, which seems empty at this point.', $this->getTable($this->class)->table(), $assoc->table())); - } - - $foreignKey = $foreignKeys[array_rand($foreignKeys)]; - $data[$assoc->foreignKey()] = $foreignKey; - - return $data; - }; - } - - // TODO check if TreeBehavior attached to modify lft/rgt cols - - return $modifiers; - } - - /** - * @param array $options - */ - public function execute($class, $insertedEntities, $options = []) - { - $table = $this->getTable($class); - $entity = $table->newEntity(); - - foreach ($this->columnFormatters as $column => $format) { - if (null !== $format) { - $entity->{$column} = is_callable($format) ? $format($insertedEntities, $table) : $format; - } - } - - foreach ($this->modifiers as $modifier) { - $entity = $modifier($entity, $insertedEntities); - } - - if (!$entity = $table->save($entity, $options)) { - throw new \RuntimeException("Failed saving $class record"); - } - - $pk = $table->primaryKey(); - - if (is_string($pk)) { - return $entity->{$pk}; - } - - return $entity->{$pk[0]}; - } - - public function setConnection($name) - { - $this->connectionName = $name; - } - - protected function getTable($class) - { - $options = []; - - if (!empty($this->connectionName)) { - $options['connection'] = $this->connectionName; - } - - return TableRegistry::get($class, $options); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/ORM/CakePHP/Populator.php b/vendor/fakerphp/faker/src/Faker/ORM/CakePHP/Populator.php deleted file mode 100644 index ac195fbd..00000000 --- a/vendor/fakerphp/faker/src/Faker/ORM/CakePHP/Populator.php +++ /dev/null @@ -1,113 +0,0 @@ -generator = $generator; - } - - /** - * @return \Faker\Generator - */ - public function getGenerator() - { - return $this->generator; - } - - /** - * @return array - */ - public function getGuessers() - { - return $this->guessers; - } - - /** - * @return $this - */ - public function removeGuesser($name) - { - if ($this->guessers[$name]) { - unset($this->guessers[$name]); - } - - return $this; - } - - /** - * @throws \Exception - * - * @return $this - */ - public function addGuesser($class) - { - if (!is_object($class)) { - $class = new $class($this->generator); - } - - if (!method_exists($class, 'guessFormat')) { - throw new \Exception('Missing required custom guesser method: ' . get_class($class) . '::guessFormat()'); - } - - $this->guessers[get_class($class)] = $class; - - return $this; - } - - /** - * @param array $customColumnFormatters - * @param array $customModifiers - * - * @return $this - */ - public function addEntity($entity, $number, $customColumnFormatters = [], $customModifiers = []) - { - if (!$entity instanceof EntityPopulator) { - $entity = new EntityPopulator($entity); - } - - $entity->columnFormatters = $entity->guessColumnFormatters($this); - - if ($customColumnFormatters) { - $entity->mergeColumnFormattersWith($customColumnFormatters); - } - - $entity->modifiers = $entity->guessModifiers($this); - - if ($customModifiers) { - $entity->mergeModifiersWith($customModifiers); - } - - $class = $entity->class; - $this->entities[$class] = $entity; - $this->quantities[$class] = $number; - - return $this; - } - - /** - * @param array $options - * - * @return array - */ - public function execute($options = []) - { - $insertedEntities = []; - - foreach ($this->quantities as $class => $number) { - for ($i = 0; $i < $number; ++$i) { - $insertedEntities[$class][] = $this->entities[$class]->execute($class, $insertedEntities, $options); - } - } - - return $insertedEntities; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/ORM/Doctrine/ColumnTypeGuesser.php b/vendor/fakerphp/faker/src/Faker/ORM/Doctrine/ColumnTypeGuesser.php deleted file mode 100644 index 3267fe46..00000000 --- a/vendor/fakerphp/faker/src/Faker/ORM/Doctrine/ColumnTypeGuesser.php +++ /dev/null @@ -1,91 +0,0 @@ -generator = $generator; - } - - /** - * @return \Closure|null - */ - public function guessFormat($fieldName, ClassMetadata $class) - { - $generator = $this->generator; - $type = $class->getTypeOfField($fieldName); - - switch ($type) { - case 'boolean': - return static function () use ($generator) { - return $generator->boolean; - }; - - case 'decimal': - $size = $class->fieldMappings[$fieldName]['precision'] ?? 2; - - return static function () use ($generator, $size) { - return $generator->randomNumber($size + 2) / 100; - }; - - case 'smallint': - return static function () use ($generator) { - return $generator->numberBetween(0, 65535); - }; - - case 'integer': - return static function () use ($generator) { - return $generator->numberBetween(0, 2147483647); - }; - - case 'bigint': - return static function () use ($generator) { - return $generator->numberBetween(0, PHP_INT_MAX); - }; - - case 'float': - return static function () use ($generator) { - return $generator->randomFloat(); - }; - - case 'string': - $size = $class->fieldMappings[$fieldName]['length'] ?? 255; - - return static function () use ($generator, $size) { - return $generator->text($size); - }; - - case 'text': - return static function () use ($generator) { - return $generator->text; - }; - - case 'datetime': - case 'date': - case 'time': - return static function () use ($generator) { - return $generator->datetime; - }; - - case 'datetime_immutable': - case 'date_immutable': - case 'time_immutable': - return static function () use ($generator) { - return \DateTimeImmutable::createFromMutable($generator->datetime); - }; - - default: - // no smart way to guess what the user expects here - return null; - } - } -} diff --git a/vendor/fakerphp/faker/src/Faker/ORM/Doctrine/EntityPopulator.php b/vendor/fakerphp/faker/src/Faker/ORM/Doctrine/EntityPopulator.php deleted file mode 100644 index 47923999..00000000 --- a/vendor/fakerphp/faker/src/Faker/ORM/Doctrine/EntityPopulator.php +++ /dev/null @@ -1,248 +0,0 @@ -class = $class; - } - - /** - * @return string - */ - public function getClass() - { - return $this->class->getName(); - } - - public function setColumnFormatters($columnFormatters) - { - $this->columnFormatters = $columnFormatters; - } - - /** - * @return array - */ - public function getColumnFormatters() - { - return $this->columnFormatters; - } - - public function mergeColumnFormattersWith($columnFormatters) - { - $this->columnFormatters = array_merge($this->columnFormatters, $columnFormatters); - } - - public function setModifiers(array $modifiers) - { - $this->modifiers = $modifiers; - } - - /** - * @return array - */ - public function getModifiers() - { - return $this->modifiers; - } - - public function mergeModifiersWith(array $modifiers) - { - $this->modifiers = array_merge($this->modifiers, $modifiers); - } - - /** - * @return array - */ - public function guessColumnFormatters(\Faker\Generator $generator) - { - $formatters = []; - $nameGuesser = new \Faker\Guesser\Name($generator); - $columnTypeGuesser = new ColumnTypeGuesser($generator); - - foreach ($this->class->getFieldNames() as $fieldName) { - if ($this->class->isIdentifier($fieldName) || !$this->class->hasField($fieldName)) { - continue; - } - - $size = $this->class->fieldMappings[$fieldName]['length'] ?? null; - - if ($formatter = $nameGuesser->guessFormat($fieldName, $size)) { - $formatters[$fieldName] = $formatter; - - continue; - } - - if ($formatter = $columnTypeGuesser->guessFormat($fieldName, $this->class)) { - $formatters[$fieldName] = $formatter; - - continue; - } - } - - foreach ($this->class->getAssociationNames() as $assocName) { - if ($this->class->isCollectionValuedAssociation($assocName)) { - continue; - } - - $relatedClass = $this->class->getAssociationTargetClass($assocName); - - $unique = $optional = false; - - if ($this->class instanceof \Doctrine\ORM\Mapping\ClassMetadata) { - $mappings = $this->class->getAssociationMappings(); - - foreach ($mappings as $mapping) { - if ($mapping['targetEntity'] == $relatedClass) { - if ($mapping['type'] == \Doctrine\ORM\Mapping\ClassMetadata::ONE_TO_ONE) { - $unique = true; - $optional = $mapping['joinColumns'][0]['nullable'] ?? false; - - break; - } - } - } - } elseif ($this->class instanceof \Doctrine\ODM\MongoDB\Mapping\ClassMetadata) { - $mappings = $this->class->associationMappings; - - foreach ($mappings as $mapping) { - if ($mapping['targetDocument'] == $relatedClass) { - if ($mapping['type'] == \Doctrine\ODM\MongoDB\Mapping\ClassMetadata::ONE && $mapping['association'] == \Doctrine\ODM\MongoDB\Mapping\ClassMetadata::REFERENCE_ONE) { - $unique = true; - $optional = $mapping['nullable'] ?? false; - - break; - } - } - } - } - - $index = 0; - $formatters[$assocName] = static function ($inserted) use ($relatedClass, &$index, $unique, $optional, $generator) { - if (isset($inserted[$relatedClass])) { - if ($unique) { - $related = null; - - if (isset($inserted[$relatedClass][$index]) || !$optional) { - $related = $inserted[$relatedClass][$index]; - } - - ++$index; - - return $related; - } - - return $generator->randomElement($inserted[$relatedClass]); - } - - return null; - }; - } - - return $formatters; - } - - /** - * Insert one new record using the Entity class. - * - * @param bool $generateId - * - * @return EntityPopulator - */ - public function execute(ObjectManager $manager, $insertedEntities, $generateId = false) - { - $obj = $this->class->newInstance(); - - $this->fillColumns($obj, $insertedEntities); - $this->callMethods($obj, $insertedEntities); - - if ($generateId) { - $idsName = $this->class->getIdentifier(); - - foreach ($idsName as $idName) { - $id = $this->generateId($obj, $idName, $manager); - $this->class->reflFields[$idName]->setValue($obj, $id); - } - } - - $manager->persist($obj); - - return $obj; - } - - private function fillColumns($obj, $insertedEntities): void - { - foreach ($this->columnFormatters as $field => $format) { - if (null !== $format) { - // Add some extended debugging information to any errors thrown by the formatter - try { - $value = is_callable($format) ? $format($insertedEntities, $obj) : $format; - } catch (\InvalidArgumentException $ex) { - throw new \InvalidArgumentException(sprintf( - 'Failed to generate a value for %s::%s: %s', - get_class($obj), - $field, - $ex->getMessage(), - )); - } - // Try a standard setter if it's available, otherwise fall back on reflection - $setter = sprintf('set%s', ucfirst($field)); - - if (is_callable([$obj, $setter])) { - $obj->$setter($value); - } else { - $this->class->reflFields[$field]->setValue($obj, $value); - } - } - } - } - - private function callMethods($obj, $insertedEntities): void - { - foreach ($this->getModifiers() as $modifier) { - $modifier($obj, $insertedEntities); - } - } - - /** - * @return int - */ - private function generateId($obj, $column, ObjectManager $manager) - { - $repository = $manager->getRepository(get_class($obj)); - $result = $repository->createQueryBuilder('e') - ->select(sprintf('e.%s', $column)) - ->getQuery() - ->execute(); - $ids = array_map('current', $result->toArray()); - - do { - $id = mt_rand(); - } while (in_array($id, $ids, false)); - - return $id; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/ORM/Doctrine/Populator.php b/vendor/fakerphp/faker/src/Faker/ORM/Doctrine/Populator.php deleted file mode 100644 index 1bce6ab4..00000000 --- a/vendor/fakerphp/faker/src/Faker/ORM/Doctrine/Populator.php +++ /dev/null @@ -1,126 +0,0 @@ -generator = $generator; - $this->manager = $manager; - $this->batchSize = $batchSize; - } - - /** - * Add an order for the generation of $number records for $entity. - * - * @param mixed $entity A Doctrine classname, or a \Faker\ORM\Doctrine\EntityPopulator instance - * @param int $number The number of entities to populate - */ - public function addEntity($entity, $number, $customColumnFormatters = [], $customModifiers = [], $generateId = false) - { - if (!$entity instanceof \Faker\ORM\Doctrine\EntityPopulator) { - if (null === $this->manager) { - throw new \InvalidArgumentException('No entity manager passed to Doctrine Populator.'); - } - $entity = new \Faker\ORM\Doctrine\EntityPopulator($this->manager->getClassMetadata($entity)); - } - $entity->setColumnFormatters($entity->guessColumnFormatters($this->generator)); - - if ($customColumnFormatters) { - $entity->mergeColumnFormattersWith($customColumnFormatters); - } - $entity->mergeModifiersWith($customModifiers); - $this->generateId[$entity->getClass()] = $generateId; - - $class = $entity->getClass(); - $this->entities[$class] = $entity; - $this->quantities[$class] = $number; - } - - /** - * Populate the database using all the Entity classes previously added. - * - * Please note that large amounts of data will result in more memory usage since the the Populator will return - * all newly created primary keys after executing. - * - * @param ObjectManager|null $entityManager A Doctrine connection object - * - * @return array A list of the inserted PKs - */ - public function execute($entityManager = null) - { - if (null === $entityManager) { - $entityManager = $this->manager; - } - - if (null === $entityManager) { - throw new \InvalidArgumentException('No entity manager passed to Doctrine Populator.'); - } - - $insertedEntities = []; - - foreach ($this->quantities as $class => $number) { - $generateId = $this->generateId[$class]; - - for ($i = 0; $i < $number; ++$i) { - $insertedEntities[$class][] = $this->entities[$class]->execute( - $entityManager, - $insertedEntities, - $generateId, - ); - - if (count($insertedEntities) % $this->batchSize === 0) { - $entityManager->flush(); - } - } - $entityManager->flush(); - } - - return $insertedEntities; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/ORM/Doctrine/backward-compatibility.php b/vendor/fakerphp/faker/src/Faker/ORM/Doctrine/backward-compatibility.php deleted file mode 100644 index 6f545f87..00000000 --- a/vendor/fakerphp/faker/src/Faker/ORM/Doctrine/backward-compatibility.php +++ /dev/null @@ -1,11 +0,0 @@ -generator = $generator; - } - - /** - * @return \Closure|null - */ - public function guessFormat($field) - { - $generator = $this->generator; - - switch ($field['type']) { - case 'boolean': - return static function () use ($generator) { - return $generator->boolean; - }; - - case 'integer': - return static function () use ($generator) { - return $generator->numberBetween(0, 4294967295); - }; - - case 'float': - return static function () use ($generator) { - return $generator->randomFloat(); - }; - - case 'string': - return static function () use ($generator) { - return $generator->text(255); - }; - - case 'date': - return static function () use ($generator) { - return $generator->dateTime; - }; - - default: - // no smart way to guess what the user expects here - return null; - } - } -} diff --git a/vendor/fakerphp/faker/src/Faker/ORM/Mandango/EntityPopulator.php b/vendor/fakerphp/faker/src/Faker/ORM/Mandango/EntityPopulator.php deleted file mode 100644 index 515ab7b6..00000000 --- a/vendor/fakerphp/faker/src/Faker/ORM/Mandango/EntityPopulator.php +++ /dev/null @@ -1,123 +0,0 @@ -class = $class; - } - - /** - * @return string - */ - public function getClass() - { - return $this->class; - } - - public function setColumnFormatters($columnFormatters) - { - $this->columnFormatters = $columnFormatters; - } - - /** - * @return array - */ - public function getColumnFormatters() - { - return $this->columnFormatters; - } - - public function mergeColumnFormattersWith($columnFormatters) - { - $this->columnFormatters = array_merge($this->columnFormatters, $columnFormatters); - } - - /** - * @return array - */ - public function guessColumnFormatters(\Faker\Generator $generator, Mandango $mandango) - { - $formatters = []; - $nameGuesser = new \Faker\Guesser\Name($generator); - $columnTypeGuesser = new \Faker\ORM\Mandango\ColumnTypeGuesser($generator); - - $metadata = $mandango->getMetadata($this->class); - - // fields - foreach ($metadata['fields'] as $fieldName => $field) { - if ($formatter = $nameGuesser->guessFormat($fieldName)) { - $formatters[$fieldName] = $formatter; - - continue; - } - - if ($formatter = $columnTypeGuesser->guessFormat($field)) { - $formatters[$fieldName] = $formatter; - - continue; - } - } - - // references - foreach (array_merge($metadata['referencesOne'], $metadata['referencesMany']) as $referenceName => $reference) { - if (!isset($reference['class'])) { - continue; - } - $referenceClass = $reference['class']; - - $formatters[$referenceName] = static function ($insertedEntities) use ($referenceClass) { - if (isset($insertedEntities[$referenceClass])) { - return Base::randomElement($insertedEntities[$referenceClass]); - } - - return null; - }; - } - - return $formatters; - } - - /** - * Insert one new record using the Entity class. - */ - public function execute(Mandango $mandango, $insertedEntities) - { - $metadata = $mandango->getMetadata($this->class); - - $obj = $mandango->create($this->class); - - foreach ($this->columnFormatters as $column => $format) { - if (null !== $format) { - $value = is_callable($format) ? $format($insertedEntities, $obj) : $format; - - if (isset($metadata['fields'][$column]) - || isset($metadata['referencesOne'][$column])) { - $obj->set($column, $value); - } - - if (isset($metadata['referencesMany'][$column])) { - $adder = 'add' . ucfirst($column); - $obj->$adder($value); - } - } - } - $mandango->persist($obj); - - return $obj; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/ORM/Mandango/Populator.php b/vendor/fakerphp/faker/src/Faker/ORM/Mandango/Populator.php deleted file mode 100644 index de6c3b81..00000000 --- a/vendor/fakerphp/faker/src/Faker/ORM/Mandango/Populator.php +++ /dev/null @@ -1,63 +0,0 @@ -generator = $generator; - $this->mandango = $mandango; - } - - /** - * Add an order for the generation of $number records for $entity. - * - * @param mixed $entity A Propel ActiveRecord classname, or a \Faker\ORM\Propel\EntityPopulator instance - * @param int $number The number of entities to populate - */ - public function addEntity($entity, $number, $customColumnFormatters = []) - { - if (!$entity instanceof \Faker\ORM\Mandango\EntityPopulator) { - $entity = new \Faker\ORM\Mandango\EntityPopulator($entity); - } - $entity->setColumnFormatters($entity->guessColumnFormatters($this->generator, $this->mandango)); - - if ($customColumnFormatters) { - $entity->mergeColumnFormattersWith($customColumnFormatters); - } - $class = $entity->getClass(); - $this->entities[$class] = $entity; - $this->quantities[$class] = $number; - } - - /** - * Populate the database using all the Entity classes previously added. - * - * @return array A list of the inserted entities. - */ - public function execute() - { - $insertedEntities = []; - - foreach ($this->quantities as $class => $number) { - for ($i = 0; $i < $number; ++$i) { - $insertedEntities[$class][] = $this->entities[$class]->execute($this->mandango, $insertedEntities); - } - } - $this->mandango->flush(); - - return $insertedEntities; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/ORM/Propel/ColumnTypeGuesser.php b/vendor/fakerphp/faker/src/Faker/ORM/Propel/ColumnTypeGuesser.php deleted file mode 100644 index 3d8a9a11..00000000 --- a/vendor/fakerphp/faker/src/Faker/ORM/Propel/ColumnTypeGuesser.php +++ /dev/null @@ -1,109 +0,0 @@ -generator = $generator; - } - - /** - * @return \Closure|null - */ - public function guessFormat(\ColumnMap $column) - { - $generator = $this->generator; - - if ($column->isTemporal()) { - if ($column->isEpochTemporal()) { - return static function () use ($generator) { - return $generator->dateTime; - }; - } - - return static function () use ($generator) { - return $generator->dateTimeAD; - }; - } - $type = $column->getType(); - - switch ($type) { - case \PropelColumnTypes::BOOLEAN: - case \PropelColumnTypes::BOOLEAN_EMU: - return static function () use ($generator) { - return $generator->boolean; - }; - - case \PropelColumnTypes::NUMERIC: - case \PropelColumnTypes::DECIMAL: - $size = $column->getSize(); - - return static function () use ($generator, $size) { - return $generator->randomNumber($size + 2) / 100; - }; - - case \PropelColumnTypes::TINYINT: - return static function () use ($generator) { - return $generator->numberBetween(0, 127); - }; - - case \PropelColumnTypes::SMALLINT: - return static function () use ($generator) { - return $generator->numberBetween(0, 32767); - }; - - case \PropelColumnTypes::INTEGER: - return static function () use ($generator) { - return $generator->numberBetween(0, 2147483647); - }; - - case \PropelColumnTypes::BIGINT: - return static function () use ($generator) { - return $generator->numberBetween(0, PHP_INT_MAX); - }; - - case \PropelColumnTypes::FLOAT: - case \PropelColumnTypes::DOUBLE: - case \PropelColumnTypes::REAL: - return static function () use ($generator) { - return $generator->randomFloat(); - }; - - case \PropelColumnTypes::CHAR: - case \PropelColumnTypes::VARCHAR: - case \PropelColumnTypes::BINARY: - case \PropelColumnTypes::VARBINARY: - $size = $column->getSize(); - - return static function () use ($generator, $size) { - return $generator->text($size); - }; - - case \PropelColumnTypes::LONGVARCHAR: - case \PropelColumnTypes::LONGVARBINARY: - case \PropelColumnTypes::CLOB: - case \PropelColumnTypes::CLOB_EMU: - case \PropelColumnTypes::BLOB: - return static function () use ($generator) { - return $generator->text; - }; - - case \PropelColumnTypes::ENUM: - $valueSet = $column->getValueSet(); - - return static function () use ($generator, $valueSet) { - return $generator->randomElement($valueSet); - }; - - case \PropelColumnTypes::OBJECT: - case \PropelColumnTypes::PHP_ARRAY: - default: - // no smart way to guess what the user expects here - return null; - } - } -} diff --git a/vendor/fakerphp/faker/src/Faker/ORM/Propel/EntityPopulator.php b/vendor/fakerphp/faker/src/Faker/ORM/Propel/EntityPopulator.php deleted file mode 100644 index f5af75c9..00000000 --- a/vendor/fakerphp/faker/src/Faker/ORM/Propel/EntityPopulator.php +++ /dev/null @@ -1,204 +0,0 @@ -class = $class; - } - - /** - * @return string - */ - public function getClass() - { - return $this->class; - } - - public function setColumnFormatters($columnFormatters) - { - $this->columnFormatters = $columnFormatters; - } - - /** - * @return array - */ - public function getColumnFormatters() - { - return $this->columnFormatters; - } - - public function mergeColumnFormattersWith($columnFormatters) - { - $this->columnFormatters = array_merge($this->columnFormatters, $columnFormatters); - } - - /** - * @return array - */ - public function guessColumnFormatters(\Faker\Generator $generator) - { - $formatters = []; - $class = $this->class; - $peerClass = $class::PEER; - $tableMap = $peerClass::getTableMap(); - $nameGuesser = new \Faker\Guesser\Name($generator); - $columnTypeGuesser = new \Faker\ORM\Propel\ColumnTypeGuesser($generator); - - foreach ($tableMap->getColumns() as $columnMap) { - // skip behavior columns, handled by modifiers - if ($this->isColumnBehavior($columnMap)) { - continue; - } - - if ($columnMap->isForeignKey()) { - $relatedClass = $columnMap->getRelation()->getForeignTable()->getClassname(); - $formatters[$columnMap->getPhpName()] = static function ($inserted) use ($relatedClass, $generator) { - return isset($inserted[$relatedClass]) ? $generator->randomElement($inserted[$relatedClass]) : null; - }; - - continue; - } - - if ($columnMap->isPrimaryKey()) { - continue; - } - - if ($formatter = $nameGuesser->guessFormat($columnMap->getPhpName(), $columnMap->getSize())) { - $formatters[$columnMap->getPhpName()] = $formatter; - - continue; - } - - if ($formatter = $columnTypeGuesser->guessFormat($columnMap)) { - $formatters[$columnMap->getPhpName()] = $formatter; - - continue; - } - } - - return $formatters; - } - - /** - * @return bool - */ - protected function isColumnBehavior(\ColumnMap $columnMap) - { - foreach ($columnMap->getTable()->getBehaviors() as $name => $params) { - $columnName = Base::toLower($columnMap->getName()); - - switch ($name) { - case 'nested_set': - $columnNames = [$params['left_column'], $params['right_column'], $params['level_column']]; - - if (in_array($columnName, $columnNames, false)) { - return true; - } - - break; - - case 'timestampable': - $columnNames = [$params['create_column'], $params['update_column']]; - - if (in_array($columnName, $columnNames, false)) { - return true; - } - - break; - } - } - - return false; - } - - public function setModifiers($modifiers) - { - $this->modifiers = $modifiers; - } - - /** - * @return array - */ - public function getModifiers() - { - return $this->modifiers; - } - - public function mergeModifiersWith($modifiers) - { - $this->modifiers = array_merge($this->modifiers, $modifiers); - } - - /** - * @return array - */ - public function guessModifiers(\Faker\Generator $generator) - { - $modifiers = []; - $class = $this->class; - $peerClass = $class::PEER; - $tableMap = $peerClass::getTableMap(); - - foreach ($tableMap->getBehaviors() as $name => $params) { - switch ($name) { - case 'nested_set': - $modifiers['nested_set'] = static function ($obj, $inserted) use ($class, $generator): void { - if (isset($inserted[$class])) { - $queryClass = $class . 'Query'; - $parent = $queryClass::create()->findPk($generator->randomElement($inserted[$class])); - $obj->insertAsLastChildOf($parent); - } else { - $obj->makeRoot(); - } - }; - - break; - - case 'sortable': - $modifiers['sortable'] = static function ($obj, $inserted) use ($class, $generator): void { - $obj->insertAtRank($generator->numberBetween(1, count($inserted[$class] ?? []) + 1)); - }; - - break; - } - } - - return $modifiers; - } - - /** - * Insert one new record using the Entity class. - */ - public function execute($con, $insertedEntities) - { - $obj = new $this->class(); - - foreach ($this->getColumnFormatters() as $column => $format) { - if (null !== $format) { - $obj->setByName($column, is_callable($format) ? $format($insertedEntities, $obj) : $format); - } - } - - foreach ($this->getModifiers() as $modifier) { - $modifier($obj, $insertedEntities); - } - $obj->save($con); - - return $obj->getPrimaryKey(); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/ORM/Propel/Populator.php b/vendor/fakerphp/faker/src/Faker/ORM/Propel/Populator.php deleted file mode 100644 index e3d42981..00000000 --- a/vendor/fakerphp/faker/src/Faker/ORM/Propel/Populator.php +++ /dev/null @@ -1,90 +0,0 @@ -generator = $generator; - } - - /** - * Add an order for the generation of $number records for $entity. - * - * @param mixed $entity A Propel ActiveRecord classname, or a \Faker\ORM\Propel\EntityPopulator instance - * @param int $number The number of entities to populate - */ - public function addEntity($entity, $number, $customColumnFormatters = [], $customModifiers = []) - { - if (!$entity instanceof \Faker\ORM\Propel\EntityPopulator) { - $entity = new \Faker\ORM\Propel\EntityPopulator($entity); - } - $entity->setColumnFormatters($entity->guessColumnFormatters($this->generator)); - - if ($customColumnFormatters) { - $entity->mergeColumnFormattersWith($customColumnFormatters); - } - $entity->setModifiers($entity->guessModifiers($this->generator)); - - if ($customModifiers) { - $entity->mergeModifiersWith($customModifiers); - } - $class = $entity->getClass(); - $this->entities[$class] = $entity; - $this->quantities[$class] = $number; - } - - /** - * Populate the database using all the Entity classes previously added. - * - * @param PropelPDO $con A Propel connection object - * - * @return array A list of the inserted PKs - */ - public function execute($con = null) - { - if (null === $con) { - $con = $this->getConnection(); - } - $isInstancePoolingEnabled = \Propel::isInstancePoolingEnabled(); - \Propel::disableInstancePooling(); - $insertedEntities = []; - $con->beginTransaction(); - - foreach ($this->quantities as $class => $number) { - for ($i = 0; $i < $number; ++$i) { - $insertedEntities[$class][] = $this->entities[$class]->execute($con, $insertedEntities); - } - } - $con->commit(); - - if ($isInstancePoolingEnabled) { - \Propel::enableInstancePooling(); - } - - return $insertedEntities; - } - - protected function getConnection() - { - // use the first connection available - $class = key($this->entities); - - if (!$class) { - throw new \RuntimeException('No class found from entities. Did you add entities to the Populator ?'); - } - - $peer = $class::PEER; - - return \Propel::getConnection($peer::DATABASE_NAME, \Propel::CONNECTION_WRITE); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/ORM/Propel2/ColumnTypeGuesser.php b/vendor/fakerphp/faker/src/Faker/ORM/Propel2/ColumnTypeGuesser.php deleted file mode 100644 index 4c08e0ad..00000000 --- a/vendor/fakerphp/faker/src/Faker/ORM/Propel2/ColumnTypeGuesser.php +++ /dev/null @@ -1,112 +0,0 @@ -generator = $generator; - } - - /** - * @return \Closure|null - */ - public function guessFormat(ColumnMap $column) - { - $generator = $this->generator; - - if ($column->isTemporal()) { - if ($column->getType() == PropelTypes::BU_DATE || $column->getType() == PropelTypes::BU_TIMESTAMP) { - return static function () use ($generator) { - return $generator->dateTime; - }; - } - - return static function () use ($generator) { - return $generator->dateTimeAD; - }; - } - $type = $column->getType(); - - switch ($type) { - case PropelTypes::BOOLEAN: - case PropelTypes::BOOLEAN_EMU: - return static function () use ($generator) { - return $generator->boolean; - }; - - case PropelTypes::NUMERIC: - case PropelTypes::DECIMAL: - $size = $column->getSize(); - - return static function () use ($generator, $size) { - return $generator->randomNumber($size + 2) / 100; - }; - - case PropelTypes::TINYINT: - return static function () use ($generator) { - return $generator->numberBetween(0, 127); - }; - - case PropelTypes::SMALLINT: - return static function () use ($generator) { - return $generator->numberBetween(0, 32767); - }; - - case PropelTypes::INTEGER: - return static function () use ($generator) { - return $generator->numberBetween(0, 2147483647); - }; - - case PropelTypes::BIGINT: - return static function () use ($generator) { - return $generator->numberBetween(0, PHP_INT_MAX); - }; - - case PropelTypes::FLOAT: - case PropelTypes::DOUBLE: - case PropelTypes::REAL: - return static function () use ($generator) { - return $generator->randomFloat(); - }; - - case PropelTypes::CHAR: - case PropelTypes::VARCHAR: - case PropelTypes::BINARY: - case PropelTypes::VARBINARY: - $size = $column->getSize(); - - return static function () use ($generator, $size) { - return $generator->text($size); - }; - - case PropelTypes::LONGVARCHAR: - case PropelTypes::LONGVARBINARY: - case PropelTypes::CLOB: - case PropelTypes::CLOB_EMU: - case PropelTypes::BLOB: - return static function () use ($generator) { - return $generator->text; - }; - - case PropelTypes::ENUM: - $valueSet = $column->getValueSet(); - - return static function () use ($generator, $valueSet) { - return $generator->randomElement($valueSet); - }; - - case PropelTypes::OBJECT: - case PropelTypes::PHP_ARRAY: - default: - // no smart way to guess what the user expects here - return null; - } - } -} diff --git a/vendor/fakerphp/faker/src/Faker/ORM/Propel2/EntityPopulator.php b/vendor/fakerphp/faker/src/Faker/ORM/Propel2/EntityPopulator.php deleted file mode 100644 index 44804e37..00000000 --- a/vendor/fakerphp/faker/src/Faker/ORM/Propel2/EntityPopulator.php +++ /dev/null @@ -1,207 +0,0 @@ -class = $class; - } - - /** - * @return string - */ - public function getClass() - { - return $this->class; - } - - public function setColumnFormatters($columnFormatters) - { - $this->columnFormatters = $columnFormatters; - } - - /** - * @return array - */ - public function getColumnFormatters() - { - return $this->columnFormatters; - } - - public function mergeColumnFormattersWith($columnFormatters) - { - $this->columnFormatters = array_merge($this->columnFormatters, $columnFormatters); - } - - /** - * @return array - */ - public function guessColumnFormatters(\Faker\Generator $generator) - { - $formatters = []; - $class = $this->class; - $peerClass = $class::TABLE_MAP; - $tableMap = $peerClass::getTableMap(); - $nameGuesser = new \Faker\Guesser\Name($generator); - $columnTypeGuesser = new \Faker\ORM\Propel2\ColumnTypeGuesser($generator); - - foreach ($tableMap->getColumns() as $columnMap) { - // skip behavior columns, handled by modifiers - if ($this->isColumnBehavior($columnMap)) { - continue; - } - - if ($columnMap->isForeignKey()) { - $relatedClass = $columnMap->getRelation()->getForeignTable()->getClassname(); - $formatters[$columnMap->getPhpName()] = static function ($inserted) use ($relatedClass, $generator) { - $relatedClass = trim($relatedClass, '\\'); - - return isset($inserted[$relatedClass]) ? $generator->randomElement($inserted[$relatedClass]) : null; - }; - - continue; - } - - if ($columnMap->isPrimaryKey()) { - continue; - } - - if ($formatter = $nameGuesser->guessFormat($columnMap->getPhpName(), $columnMap->getSize())) { - $formatters[$columnMap->getPhpName()] = $formatter; - - continue; - } - - if ($formatter = $columnTypeGuesser->guessFormat($columnMap)) { - $formatters[$columnMap->getPhpName()] = $formatter; - - continue; - } - } - - return $formatters; - } - - /** - * @return bool - */ - protected function isColumnBehavior(ColumnMap $columnMap) - { - foreach ($columnMap->getTable()->getBehaviors() as $name => $params) { - $columnName = Base::toLower($columnMap->getName()); - - switch ($name) { - case 'nested_set': - $columnNames = [$params['left_column'], $params['right_column'], $params['level_column']]; - - if (in_array($columnName, $columnNames, false)) { - return true; - } - - break; - - case 'timestampable': - $columnNames = [$params['create_column'], $params['update_column']]; - - if (in_array($columnName, $columnNames, false)) { - return true; - } - - break; - } - } - - return false; - } - - public function setModifiers($modifiers) - { - $this->modifiers = $modifiers; - } - - /** - * @return array - */ - public function getModifiers() - { - return $this->modifiers; - } - - public function mergeModifiersWith($modifiers) - { - $this->modifiers = array_merge($this->modifiers, $modifiers); - } - - /** - * @return array - */ - public function guessModifiers(\Faker\Generator $generator) - { - $modifiers = []; - $class = $this->class; - $peerClass = $class::TABLE_MAP; - $tableMap = $peerClass::getTableMap(); - - foreach ($tableMap->getBehaviors() as $name => $params) { - switch ($name) { - case 'nested_set': - $modifiers['nested_set'] = static function ($obj, $inserted) use ($class, $generator): void { - if (isset($inserted[$class])) { - $queryClass = $class . 'Query'; - $parent = $queryClass::create()->findPk($generator->randomElement($inserted[$class])); - $obj->insertAsLastChildOf($parent); - } else { - $obj->makeRoot(); - } - }; - - break; - - case 'sortable': - $modifiers['sortable'] = static function ($obj, $inserted) use ($class, $generator): void { - $obj->insertAtRank($generator->numberBetween(1, count($inserted[$class] ?? []) + 1)); - }; - - break; - } - } - - return $modifiers; - } - - /** - * Insert one new record using the Entity class. - */ - public function execute($con, $insertedEntities) - { - $obj = new $this->class(); - - foreach ($this->getColumnFormatters() as $column => $format) { - if (null !== $format) { - $obj->setByName($column, is_callable($format) ? $format($insertedEntities, $obj) : $format); - } - } - - foreach ($this->getModifiers() as $modifier) { - $modifier($obj, $insertedEntities); - } - $obj->save($con); - - return $obj->getPrimaryKey(); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/ORM/Propel2/Populator.php b/vendor/fakerphp/faker/src/Faker/ORM/Propel2/Populator.php deleted file mode 100644 index 7698f80e..00000000 --- a/vendor/fakerphp/faker/src/Faker/ORM/Propel2/Populator.php +++ /dev/null @@ -1,93 +0,0 @@ -generator = $generator; - } - - /** - * Add an order for the generation of $number records for $entity. - * - * @param mixed $entity A Propel ActiveRecord classname, or a \Faker\ORM\Propel2\EntityPopulator instance - * @param int $number The number of entities to populate - */ - public function addEntity($entity, $number, $customColumnFormatters = [], $customModifiers = []) - { - if (!$entity instanceof \Faker\ORM\Propel2\EntityPopulator) { - $entity = new \Faker\ORM\Propel2\EntityPopulator($entity); - } - $entity->setColumnFormatters($entity->guessColumnFormatters($this->generator)); - - if ($customColumnFormatters) { - $entity->mergeColumnFormattersWith($customColumnFormatters); - } - $entity->setModifiers($entity->guessModifiers($this->generator)); - - if ($customModifiers) { - $entity->mergeModifiersWith($customModifiers); - } - $class = $entity->getClass(); - $this->entities[$class] = $entity; - $this->quantities[$class] = $number; - } - - /** - * Populate the database using all the Entity classes previously added. - * - * @param PropelPDO $con A Propel connection object - * - * @return array A list of the inserted PKs - */ - public function execute($con = null) - { - if (null === $con) { - $con = $this->getConnection(); - } - $isInstancePoolingEnabled = Propel::isInstancePoolingEnabled(); - Propel::disableInstancePooling(); - $insertedEntities = []; - $con->beginTransaction(); - - foreach ($this->quantities as $class => $number) { - for ($i = 0; $i < $number; ++$i) { - $insertedEntities[$class][] = $this->entities[$class]->execute($con, $insertedEntities); - } - } - $con->commit(); - - if ($isInstancePoolingEnabled) { - Propel::enableInstancePooling(); - } - - return $insertedEntities; - } - - protected function getConnection() - { - // use the first connection available - $class = key($this->entities); - - if (!$class) { - throw new \RuntimeException('No class found from entities. Did you add entities to the Populator ?'); - } - - $peer = $class::TABLE_MAP; - - return Propel::getConnection($peer::DATABASE_NAME, ServiceContainerInterface::CONNECTION_WRITE); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/ORM/Spot/ColumnTypeGuesser.php b/vendor/fakerphp/faker/src/Faker/ORM/Spot/ColumnTypeGuesser.php deleted file mode 100644 index f06ba048..00000000 --- a/vendor/fakerphp/faker/src/Faker/ORM/Spot/ColumnTypeGuesser.php +++ /dev/null @@ -1,84 +0,0 @@ -generator = $generator; - } - - /** - * @return \Closure|null - */ - public function guessFormat(array $field) - { - $generator = $this->generator; - $type = $field['type']; - - switch ($type) { - case 'boolean': - return static function () use ($generator) { - return $generator->boolean; - }; - - case 'decimal': - $size = $field['precision'] ?? 2; - - return static function () use ($generator, $size) { - return $generator->randomNumber($size + 2) / 100; - }; - - case 'smallint': - return static function () use ($generator) { - return $generator->numberBetween(0, 65535); - }; - - case 'integer': - return static function () use ($generator) { - return $generator->numberBetween(0, 2147483647); - }; - - case 'bigint': - return static function () use ($generator) { - return $generator->numberBetween(0, PHP_INT_MAX); - }; - - case 'float': - return static function () use ($generator) { - return $generator->randomFloat(null, 0, 4294967295); - }; - - case 'string': - $size = $field['length'] ?? 255; - - return static function () use ($generator, $size) { - return $generator->text($size); - }; - - case 'text': - return static function () use ($generator) { - return $generator->text; - }; - - case 'datetime': - case 'date': - case 'time': - return static function () use ($generator) { - return $generator->datetime; - }; - - default: - // no smart way to guess what the user expects here - return null; - } - } -} diff --git a/vendor/fakerphp/faker/src/Faker/ORM/Spot/EntityPopulator.php b/vendor/fakerphp/faker/src/Faker/ORM/Spot/EntityPopulator.php deleted file mode 100644 index b67ae253..00000000 --- a/vendor/fakerphp/faker/src/Faker/ORM/Spot/EntityPopulator.php +++ /dev/null @@ -1,199 +0,0 @@ -mapper = $mapper; - $this->locator = $locator; - $this->useExistingData = $useExistingData; - } - - /** - * @return string - */ - public function getMapper() - { - return $this->mapper; - } - - public function setColumnFormatters($columnFormatters) - { - $this->columnFormatters = $columnFormatters; - } - - /** - * @return array - */ - public function getColumnFormatters() - { - return $this->columnFormatters; - } - - public function mergeColumnFormattersWith($columnFormatters) - { - $this->columnFormatters = array_merge($this->columnFormatters, $columnFormatters); - } - - public function setModifiers(array $modifiers) - { - $this->modifiers = $modifiers; - } - - /** - * @return array - */ - public function getModifiers() - { - return $this->modifiers; - } - - public function mergeModifiersWith(array $modifiers) - { - $this->modifiers = array_merge($this->modifiers, $modifiers); - } - - /** - * @return array - */ - public function guessColumnFormatters(Generator $generator) - { - $formatters = []; - $nameGuesser = new Name($generator); - $columnTypeGuesser = new ColumnTypeGuesser($generator); - $fields = $this->mapper->fields(); - - foreach ($fields as $fieldName => $field) { - if ($field['primary'] === true) { - continue; - } - - if ($formatter = $nameGuesser->guessFormat($fieldName)) { - $formatters[$fieldName] = $formatter; - - continue; - } - - if ($formatter = $columnTypeGuesser->guessFormat($field)) { - $formatters[$fieldName] = $formatter; - - continue; - } - } - $entityName = $this->mapper->entity(); - $entity = $this->mapper->build([]); - $relations = $entityName::relations($this->mapper, $entity); - - foreach ($relations as $relation) { - // We don't need any other relation here. - if ($relation instanceof BelongsTo) { - $fieldName = $relation->localKey(); - $entityName = $relation->entityName(); - $field = $fields[$fieldName]; - $required = $field['required']; - - $locator = $this->locator; - - $formatters[$fieldName] = function ($inserted) use ($required, $entityName, $locator, $generator) { - if (!empty($inserted[$entityName])) { - return $generator->randomElement($inserted[$entityName])->get('id'); - } - - if ($required && $this->useExistingData) { - // We did not add anything like this, but it's required, - // So let's find something existing in DB. - $mapper = $locator->mapper($entityName); - $records = $mapper->all()->limit(self::RELATED_FETCH_COUNT)->toArray(); - - if (empty($records)) { - return null; - } - - return $generator->randomElement($records)['id']; - } - - return null; - }; - } - } - - return $formatters; - } - - /** - * Insert one new record using the Entity class. - * - * @return string - */ - public function execute($insertedEntities) - { - $obj = $this->mapper->build([]); - - $this->fillColumns($obj, $insertedEntities); - $this->callMethods($obj, $insertedEntities); - - $this->mapper->insert($obj); - - return $obj; - } - - private function fillColumns($obj, $insertedEntities): void - { - foreach ($this->columnFormatters as $field => $format) { - if (null !== $format) { - $value = is_callable($format) ? $format($insertedEntities, $obj) : $format; - $obj->set($field, $value); - } - } - } - - private function callMethods($obj, $insertedEntities): void - { - foreach ($this->getModifiers() as $modifier) { - $modifier($obj, $insertedEntities); - } - } -} diff --git a/vendor/fakerphp/faker/src/Faker/ORM/Spot/Populator.php b/vendor/fakerphp/faker/src/Faker/ORM/Spot/Populator.php deleted file mode 100644 index b321f5c5..00000000 --- a/vendor/fakerphp/faker/src/Faker/ORM/Spot/Populator.php +++ /dev/null @@ -1,89 +0,0 @@ -generator = $generator; - $this->locator = $locator; - } - - /** - * Add an order for the generation of $number records for $entity. - * - * @param string $entityName Name of Entity object to generate - * @param int $number The number of entities to populate - * @param array $customColumnFormatters - * @param array $customModifiers - * @param bool $useExistingData Should we use existing rows (e.g. roles) to populate relations? - */ - public function addEntity( - $entityName, - $number, - $customColumnFormatters = [], - $customModifiers = [], - $useExistingData = false - ) { - $mapper = $this->locator->mapper($entityName); - - if (null === $mapper) { - throw new \InvalidArgumentException('No mapper can be found for entity ' . $entityName); - } - $entity = new EntityPopulator($mapper, $this->locator, $useExistingData); - - $entity->setColumnFormatters($entity->guessColumnFormatters($this->generator)); - - if ($customColumnFormatters) { - $entity->mergeColumnFormattersWith($customColumnFormatters); - } - $entity->mergeModifiersWith($customModifiers); - - $this->entities[$entityName] = $entity; - $this->quantities[$entityName] = $number; - } - - /** - * Populate the database using all the Entity classes previously added. - * - * @param Locator $locator A Spot locator - * - * @return array A list of the inserted PKs - */ - public function execute($locator = null) - { - if (null === $locator) { - $locator = $this->locator; - } - - if (null === $locator) { - throw new \InvalidArgumentException('No entity manager passed to Spot Populator.'); - } - - $insertedEntities = []; - - foreach ($this->quantities as $entityName => $number) { - for ($i = 0; $i < $number; ++$i) { - $insertedEntities[$entityName][] = $this->entities[$entityName]->execute( - $insertedEntities, - ); - } - } - - return $insertedEntities; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/Address.php b/vendor/fakerphp/faker/src/Faker/Provider/Address.php deleted file mode 100644 index 9727497b..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/Address.php +++ /dev/null @@ -1,166 +0,0 @@ -generator->parse($format); - } - - /** - * @example 'Crist Parks' - * - * @return string - */ - public function streetName() - { - $format = static::randomElement(static::$streetNameFormats); - - return $this->generator->parse($format); - } - - /** - * @example '791 Crist Parks' - * - * @return string - */ - public function streetAddress() - { - $format = static::randomElement(static::$streetAddressFormats); - - return $this->generator->parse($format); - } - - /** - * @example 86039-9874 - * - * @return string - */ - public static function postcode() - { - return static::toUpper(static::bothify(static::randomElement(static::$postcode))); - } - - /** - * @example '791 Crist Parks, Sashabury, IL 86039-9874' - * - * @return string - */ - public function address() - { - $format = static::randomElement(static::$addressFormats); - - return $this->generator->parse($format); - } - - /** - * @example 'Japan' - * - * @return string - */ - public static function country() - { - return static::randomElement(static::$country); - } - - /** - * Uses signed degrees format (returns a float number between -90 and 90) - * - * @example '77.147489' - * - * @param float|int $min - * @param float|int $max - * - * @return float - */ - public static function latitude($min = -90, $max = 90) - { - return static::randomFloat(6, $min, $max); - } - - /** - * Uses signed degrees format (returns a float number between -180 and 180) - * - * @example '86.211205' - * - * @param float|int $min - * @param float|int $max - * - * @return float - */ - public static function longitude($min = -180, $max = 180) - { - return static::randomFloat(6, $min, $max); - } - - /** - * @example array('77.147489', '86.211205') - * - * @return float[] - */ - public static function localCoordinates() - { - return [ - 'latitude' => static::latitude(), - 'longitude' => static::longitude(), - ]; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/Barcode.php b/vendor/fakerphp/faker/src/Faker/Provider/Barcode.php deleted file mode 100644 index 0d39a61e..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/Barcode.php +++ /dev/null @@ -1,107 +0,0 @@ -ean(13); - } - - /** - * Get a random EAN8 barcode. - * - * @return string - * - * @example '73513537' - */ - public function ean8() - { - return $this->ean(8); - } - - /** - * Get a random ISBN-10 code - * - * @see http://en.wikipedia.org/wiki/International_Standard_Book_Number - * - * @return string - * - * @example '4881416324' - */ - public function isbn10() - { - $code = static::numerify(str_repeat('#', 9)); - - return $code . Isbn::checksum($code); - } - - /** - * Get a random ISBN-13 code - * - * @see http://en.wikipedia.org/wiki/International_Standard_Book_Number - * - * @return string - * - * @example '9790404436093' - */ - public function isbn13() - { - $code = '97' . self::numberBetween(8, 9) . static::numerify(str_repeat('#', 9)); - - return $code . Ean::checksum($code); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/Base.php b/vendor/fakerphp/faker/src/Faker/Provider/Base.php deleted file mode 100644 index e3713ce0..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/Base.php +++ /dev/null @@ -1,661 +0,0 @@ -generator = $generator; - } - - /** - * Returns a random number between 0 and 9 - * - * @return int - */ - public static function randomDigit() - { - return mt_rand(0, 9); - } - - /** - * Returns a random number between 1 and 9 - * - * @return int - */ - public static function randomDigitNotNull() - { - return mt_rand(1, 9); - } - - /** - * Generates a random digit, which cannot be $except - * - * @param int $except - * - * @return int - */ - public static function randomDigitNot($except) - { - $result = self::numberBetween(0, 8); - - if ($result >= $except) { - ++$result; - } - - return $result; - } - - /** - * Returns a random integer with 0 to $nbDigits digits. - * - * The maximum value returned is mt_getrandmax() - * - * @param int $nbDigits Defaults to a random number between 1 and 9 - * @param bool $strict Whether the returned number should have exactly $nbDigits - * - * @example 79907610 - * - * @return int - */ - public static function randomNumber($nbDigits = null, $strict = false) - { - if (!is_bool($strict)) { - throw new \InvalidArgumentException('randomNumber() generates numbers of fixed width. To generate numbers between two boundaries, use numberBetween() instead.'); - } - - if (null === $nbDigits) { - $nbDigits = static::randomDigitNotNull(); - } - $max = 10 ** $nbDigits - 1; - - if ($max > mt_getrandmax()) { - throw new \InvalidArgumentException('randomNumber() can only generate numbers up to mt_getrandmax()'); - } - - if ($strict) { - return mt_rand(10 ** ($nbDigits - 1), $max); - } - - return mt_rand(0, $max); - } - - /** - * Return a random float number - * - * @param int $nbMaxDecimals - * @param float|int $min - * @param float|int $max - * - * @example 48.8932 - * - * @return float - */ - public static function randomFloat($nbMaxDecimals = null, $min = 0, $max = null) - { - if (null === $nbMaxDecimals) { - $nbMaxDecimals = static::randomDigit(); - } - - if (null === $max) { - $max = static::randomNumber(); - - if ($min > $max) { - $max = $min; - } - } - - if ($min > $max) { - $tmp = $min; - $min = $max; - $max = $tmp; - } - - return round($min + mt_rand() / mt_getrandmax() * ($max - $min), $nbMaxDecimals); - } - - /** - * Returns a random number between $int1 and $int2 (any order) - * - * @param int $int1 default to 0 - * @param int $int2 defaults to 32 bit max integer, ie 2147483647 - * - * @example 79907610 - * - * @return int - */ - public static function numberBetween($int1 = 0, $int2 = 2147483647) - { - $min = $int1 < $int2 ? $int1 : $int2; - $max = $int1 < $int2 ? $int2 : $int1; - - return mt_rand($min, $max); - } - - /** - * Returns the passed value - */ - public static function passthrough($value) - { - return $value; - } - - /** - * Returns a random letter from a to z - * - * @return string - */ - public static function randomLetter() - { - return chr(mt_rand(97, 122)); - } - - /** - * Returns a random ASCII character (excluding accents and special chars) - * - * @return string - */ - public static function randomAscii() - { - return chr(mt_rand(33, 126)); - } - - /** - * Returns randomly ordered subsequence of $count elements from a provided array - * - * @param array $array Array to take elements from. Defaults to a-c - * @param int $count Number of elements to take. - * @param bool $allowDuplicates Allow elements to be picked several times. Defaults to false - * - * @throws \LengthException When requesting more elements than provided - * - * @return array New array with $count elements from $array - */ - public static function randomElements($array = ['a', 'b', 'c'], $count = 1, $allowDuplicates = false) - { - $traversables = []; - - if ($array instanceof \Traversable) { - foreach ($array as $element) { - $traversables[] = $element; - } - } - - $arr = count($traversables) ? $traversables : $array; - - $allKeys = array_keys($arr); - $numKeys = count($allKeys); - - if (!$allowDuplicates && $numKeys < $count) { - throw new \LengthException(sprintf('Cannot get %d elements, only %d in array', $count, $numKeys)); - } - - $highKey = $numKeys - 1; - $keys = $elements = []; - $numElements = 0; - - while ($numElements < $count) { - $num = mt_rand(0, $highKey); - - if (!$allowDuplicates) { - if (isset($keys[$num])) { - continue; - } - $keys[$num] = true; - } - - $elements[] = $arr[$allKeys[$num]]; - ++$numElements; - } - - return $elements; - } - - /** - * Returns a random element from a passed array - * - * @param array $array - */ - public static function randomElement($array = ['a', 'b', 'c']) - { - if (!$array || ($array instanceof \Traversable && !count($array))) { - return null; - } - $elements = static::randomElements($array, 1); - - return $elements[0]; - } - - /** - * Returns a random key from a passed associative array - * - * @param array $array - * - * @return int|string|null - */ - public static function randomKey($array = []) - { - if (!$array) { - return null; - } - $keys = array_keys($array); - - return $keys[mt_rand(0, count($keys) - 1)]; - } - - /** - * Returns a shuffled version of the argument. - * - * This function accepts either an array, or a string. - * - * @example $faker->shuffle([1, 2, 3]); // [2, 1, 3] - * @example $faker->shuffle('hello, world'); // 'rlo,h eold!lw' - * - * @see shuffleArray() - * @see shuffleString() - * - * @param array|string $arg The set to shuffle - * - * @return array|string The shuffled set - */ - public static function shuffle($arg = '') - { - if (is_array($arg)) { - return static::shuffleArray($arg); - } - - if (is_string($arg)) { - return static::shuffleString($arg); - } - - throw new \InvalidArgumentException('shuffle() only supports strings or arrays'); - } - - /** - * Returns a shuffled version of the array. - * - * This function does not mutate the original array. It uses the - * Fisher–Yates algorithm, which is unbiased, together with a Mersenne - * twister random generator. This function is therefore more random than - * PHP's shuffle() function, and it is seedable. - * - * @see http://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle - * - * @example $faker->shuffleArray([1, 2, 3]); // [2, 1, 3] - * - * @param array $array The set to shuffle - * - * @return array The shuffled set - */ - public static function shuffleArray($array = []) - { - $shuffledArray = []; - $i = 0; - reset($array); - - foreach ($array as $key => $value) { - if ($i == 0) { - $j = 0; - } else { - $j = mt_rand(0, $i); - } - - if ($j == $i) { - $shuffledArray[] = $value; - } else { - $shuffledArray[] = $shuffledArray[$j]; - $shuffledArray[$j] = $value; - } - ++$i; - } - - return $shuffledArray; - } - - /** - * Returns a shuffled version of the string. - * - * This function does not mutate the original string. It uses the - * Fisher–Yates algorithm, which is unbiased, together with a Mersenne - * twister random generator. This function is therefore more random than - * PHP's shuffle() function, and it is seedable. Additionally, it is - * UTF8 safe if the mb extension is available. - * - * @see http://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle - * - * @example $faker->shuffleString('hello, world'); // 'rlo,h eold!lw' - * - * @param string $string The set to shuffle - * @param string $encoding The string encoding (defaults to UTF-8) - * - * @return string The shuffled set - */ - public static function shuffleString($string = '', $encoding = 'UTF-8') - { - if (function_exists('mb_strlen')) { - // UTF8-safe str_split() - $array = []; - $strlen = mb_strlen($string, $encoding); - - for ($i = 0; $i < $strlen; ++$i) { - $array[] = mb_substr($string, $i, 1, $encoding); - } - } else { - $array = str_split($string, 1); - } - - return implode('', static::shuffleArray($array)); - } - - private static function replaceWildcard($string, $wildcard, $callback) - { - if (($pos = strpos($string, $wildcard)) === false) { - return $string; - } - - for ($i = $pos, $last = strrpos($string, $wildcard, $pos) + 1; $i < $last; ++$i) { - if ($string[$i] === $wildcard) { - $string[$i] = call_user_func($callback); - } - } - - return $string; - } - - /** - * Replaces all hash sign ('#') occurrences with a random number - * Replaces all percentage sign ('%') occurrences with a not null number - * - * @param string $string String that needs to bet parsed - * - * @return string - */ - public static function numerify($string = '###') - { - // instead of using randomDigit() several times, which is slow, - // count the number of hashes and generate once a large number - $toReplace = []; - - if (($pos = strpos($string, '#')) !== false) { - for ($i = $pos, $last = strrpos($string, '#', $pos) + 1; $i < $last; ++$i) { - if ($string[$i] === '#') { - $toReplace[] = $i; - } - } - } - - if ($nbReplacements = count($toReplace)) { - $maxAtOnce = strlen((string) mt_getrandmax()) - 1; - $numbers = ''; - $i = 0; - - while ($i < $nbReplacements) { - $size = min($nbReplacements - $i, $maxAtOnce); - $numbers .= str_pad(static::randomNumber($size), $size, '0', STR_PAD_LEFT); - $i += $size; - } - - for ($i = 0; $i < $nbReplacements; ++$i) { - $string[$toReplace[$i]] = $numbers[$i]; - } - } - $string = self::replaceWildcard($string, '%', [static::class, 'randomDigitNotNull']); - - return $string; - } - - /** - * Replaces all question mark ('?') occurrences with a random letter - * - * @param string $string String that needs to bet parsed - * - * @return string - */ - public static function lexify($string = '????') - { - return self::replaceWildcard($string, '?', [static::class, 'randomLetter']); - } - - /** - * Replaces hash signs ('#') and question marks ('?') with random numbers and letters - * An asterisk ('*') is replaced with either a random number or a random letter - * - * @param string $string String that needs to be parsed - * - * @return string - */ - public static function bothify($string = '## ??') - { - $string = self::replaceWildcard($string, '*', static function () { - return mt_rand(0, 1) ? '#' : '?'; - }); - - return static::lexify(static::numerify($string)); - } - - /** - * Replaces * signs with random numbers and letters and special characters - * - * @example $faker->asciify(''********'); // "s5'G!uC3" - * - * @param string $string String that needs to bet parsed - * - * @return string - */ - public static function asciify($string = '****') - { - return preg_replace_callback('/\*/u', [static::class, 'randomAscii'], $string); - } - - /** - * Transforms a basic regular expression into a random string satisfying the expression. - * - * @example $faker->regexify('[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}'); // sm0@y8k96a.ej - * - * Regex delimiters '/.../' and begin/end markers '^...$' are ignored. - * - * Only supports a small subset of the regex syntax. For instance, - * unicode, negated classes, unbounded ranges, subpatterns, back references, - * assertions, recursive patterns, and comments are not supported. Escaping - * support is extremely fragile. - * - * This method is also VERY slow. Use it only when no other formatter - * can generate the fake data you want. For instance, prefer calling - * `$faker->email` rather than `regexify` with the previous regular - * expression. - * - * Also note than `bothify` can probably do most of what this method does, - * but much faster. For instance, for a dummy email generation, try - * `$faker->bothify('?????????@???.???')`. - * - * @see https://github.com/icomefromthenet/ReverseRegex for a more robust implementation - * - * @param string $regex A regular expression (delimiters are optional) - * - * @return string - */ - public static function regexify($regex = '') - { - // ditch the anchors - $regex = preg_replace('/^\/?\^?/', '', $regex); - $regex = preg_replace('/\$?\/?$/', '', $regex); - // All {2} become {2,2} - $regex = preg_replace('/\{(\d+)\}/', '{\1,\1}', $regex); - // Single-letter quantifiers (?, *, +) become bracket quantifiers ({0,1}, {0,rand}, {1, rand}) - $regex = preg_replace('/(? 0 && $weight < 1 && mt_rand() / mt_getrandmax() <= $weight) { - return $this->generator; - } - - // new system with percentage - if (is_int($weight) && mt_rand(1, 100) <= $weight) { - return $this->generator; - } - - return new DefaultGenerator($default); - } - - /** - * Chainable method for making any formatter unique. - * - * - * // will never return twice the same value - * $faker->unique()->randomElement(array(1, 2, 3)); - * - * - * @param bool $reset If set to true, resets the list of existing values - * @param int $maxRetries Maximum number of retries to find a unique value, - * After which an OverflowException is thrown. - * - * @throws \OverflowException When no unique value can be found by iterating $maxRetries times - * - * @return UniqueGenerator A proxy class returning only non-existing values - */ - public function unique($reset = false, $maxRetries = 10000) - { - if ($reset || !$this->unique) { - $this->unique = new UniqueGenerator($this->generator, $maxRetries); - } - - return $this->unique; - } - - /** - * Chainable method for forcing any formatter to return only valid values. - * - * The value validity is determined by a function passed as first argument. - * - * - * $values = array(); - * $evenValidator = function ($digit) { - * return $digit % 2 === 0; - * }; - * for ($i=0; $i < 10; $i++) { - * $values []= $faker->valid($evenValidator)->randomDigit; - * } - * print_r($values); // [0, 4, 8, 4, 2, 6, 0, 8, 8, 6] - * - * - * @param Closure $validator A function returning true for valid values - * @param int $maxRetries Maximum number of retries to find a unique value, - * After which an OverflowException is thrown. - * - * @throws \OverflowException When no valid value can be found by iterating $maxRetries times - * - * @return ValidGenerator A proxy class returning only valid values - */ - public function valid($validator = null, $maxRetries = 10000) - { - return new ValidGenerator($this->generator, $validator, $maxRetries); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/Biased.php b/vendor/fakerphp/faker/src/Faker/Provider/Biased.php deleted file mode 100644 index 42c70bcc..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/Biased.php +++ /dev/null @@ -1,65 +0,0 @@ -generator->parse($format); - } - - /** - * @example 'Ltd' - * - * @return string - */ - public static function companySuffix() - { - return static::randomElement(static::$companySuffix); - } - - /** - * @example 'Job' - * - * @return string - */ - public function jobTitle() - { - $format = static::randomElement(static::$jobTitleFormat); - - return $this->generator->parse($format); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/DateTime.php b/vendor/fakerphp/faker/src/Faker/Provider/DateTime.php deleted file mode 100644 index 46c3c90f..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/DateTime.php +++ /dev/null @@ -1,383 +0,0 @@ -getTimestamp(); - } - - return strtotime(empty($max) ? 'now' : $max); - } - - /** - * Get a timestamp between January 1, 1970, and now - * - * @param \DateTime|int|string $max maximum timestamp used as random end limit, default to "now" - * - * @return int - * - * @example 1061306726 - */ - public static function unixTime($max = 'now') - { - return self::numberBetween(0, static::getMaxTimestamp($max)); - } - - /** - * Get a datetime object for a date between January 1, 1970 and now - * - * @param \DateTime|int|string $max maximum timestamp used as random end limit, default to "now" - * @param string $timezone time zone in which the date time should be set, default to DateTime::$defaultTimezone, if set, otherwise the result of `date_default_timezone_get` - * - * @return \DateTime - * - * @see http://php.net/manual/en/timezones.php - * @see http://php.net/manual/en/function.date-default-timezone-get.php - * - * @example DateTime('2005-08-16 20:39:21') - */ - public static function dateTime($max = 'now', $timezone = null) - { - return static::setTimezone( - new \DateTime('@' . static::unixTime($max)), - $timezone, - ); - } - - /** - * Get a datetime object for a date between January 1, 001 and now - * - * @param \DateTime|int|string $max maximum timestamp used as random end limit, default to "now" - * @param string|null $timezone time zone in which the date time should be set, default to DateTime::$defaultTimezone, if set, otherwise the result of `date_default_timezone_get` - * - * @return \DateTime - * - * @see http://php.net/manual/en/timezones.php - * @see http://php.net/manual/en/function.date-default-timezone-get.php - * - * @example DateTime('1265-03-22 21:15:52') - */ - public static function dateTimeAD($max = 'now', $timezone = null) - { - $min = (PHP_INT_SIZE > 4 ? -62135597361 : -PHP_INT_MAX); - - return static::setTimezone( - new \DateTime('@' . self::numberBetween($min, static::getMaxTimestamp($max))), - $timezone, - ); - } - - /** - * get a date string formatted with ISO8601 - * - * @param \DateTime|int|string $max maximum timestamp used as random end limit, default to "now" - * - * @return string - * - * @example '2003-10-21T16:05:52+0000' - */ - public static function iso8601($max = 'now') - { - return static::date(\DateTime::ISO8601, $max); - } - - /** - * Get a date string between January 1, 1970 and now - * - * @param string $format - * @param \DateTime|int|string $max maximum timestamp used as random end limit, default to "now" - * - * @return string - * - * @example '2008-11-27' - */ - public static function date($format = 'Y-m-d', $max = 'now') - { - return static::dateTime($max)->format($format); - } - - /** - * Get a time string (24h format by default) - * - * @param string $format - * @param \DateTime|int|string $max maximum timestamp used as random end limit, default to "now" - * - * @return string - * - * @example '15:02:34' - */ - public static function time($format = 'H:i:s', $max = 'now') - { - return static::dateTime($max)->format($format); - } - - /** - * Get a DateTime object based on a random date between two given dates. - * Accepts date strings that can be recognized by strtotime(). - * - * @param \DateTime|string $startDate Defaults to 30 years ago - * @param \DateTime|string $endDate Defaults to "now" - * @param string|null $timezone time zone in which the date time should be set, default to DateTime::$defaultTimezone, if set, otherwise the result of `date_default_timezone_get` - * - * @return \DateTime - * - * @see http://php.net/manual/en/timezones.php - * @see http://php.net/manual/en/function.date-default-timezone-get.php - * - * @example DateTime('1999-02-02 11:42:52') - */ - public static function dateTimeBetween($startDate = '-30 years', $endDate = 'now', $timezone = null) - { - $startTimestamp = $startDate instanceof \DateTime ? $startDate->getTimestamp() : strtotime($startDate); - $endTimestamp = static::getMaxTimestamp($endDate); - - if ($startTimestamp > $endTimestamp) { - throw new \InvalidArgumentException('Start date must be anterior to end date.'); - } - - $timestamp = self::numberBetween($startTimestamp, $endTimestamp); - - return static::setTimezone( - new \DateTime('@' . $timestamp), - $timezone, - ); - } - - /** - * Get a DateTime object based on a random date between one given date and - * an interval - * Accepts date string that can be recognized by strtotime(). - * - * @param \DateTime|string $date Defaults to 30 years ago - * @param string $interval Defaults to 5 days after - * @param string|null $timezone time zone in which the date time should be set, default to DateTime::$defaultTimezone, if set, otherwise the result of `date_default_timezone_get` - * - * @return \DateTime - * - * @example dateTimeInInterval('1999-02-02 11:42:52', '+ 5 days') - * - * @see http://php.net/manual/en/timezones.php - * @see http://php.net/manual/en/function.date-default-timezone-get.php - */ - public static function dateTimeInInterval($date = '-30 years', $interval = '+5 days', $timezone = null) - { - $intervalObject = \DateInterval::createFromDateString($interval); - $datetime = $date instanceof \DateTime ? $date : new \DateTime($date); - $otherDatetime = clone $datetime; - $otherDatetime->add($intervalObject); - - $begin = min($datetime, $otherDatetime); - $end = $datetime === $begin ? $otherDatetime : $datetime; - - return static::dateTimeBetween( - $begin, - $end, - $timezone, - ); - } - - /** - * Get a date time object somewhere within a century. - * - * @param \DateTime|int|string $max maximum timestamp used as random end limit, default to "now" - * @param string|null $timezone time zone in which the date time should be set, default to DateTime::$defaultTimezone, if set, otherwise the result of `date_default_timezone_get` - * - * @return \DateTime - */ - public static function dateTimeThisCentury($max = 'now', $timezone = null) - { - return static::dateTimeBetween('-100 year', $max, $timezone); - } - - /** - * Get a date time object somewhere within a decade. - * - * @param \DateTime|int|string $max maximum timestamp used as random end limit, default to "now" - * @param string|null $timezone time zone in which the date time should be set, default to DateTime::$defaultTimezone, if set, otherwise the result of `date_default_timezone_get` - * - * @return \DateTime - */ - public static function dateTimeThisDecade($max = 'now', $timezone = null) - { - return static::dateTimeBetween('-10 year', $max, $timezone); - } - - /** - * Get a date time object somewhere inside the current year. - * - * @param \DateTime|int|string $max maximum timestamp used as random end limit, default to "now" - * @param string|null $timezone time zone in which the date time should be set, default to DateTime::$defaultTimezone, if set, otherwise the result of `date_default_timezone_get` - * - * @return \DateTime - */ - public static function dateTimeThisYear($max = 'now', $timezone = null) - { - return static::dateTimeBetween('first day of january this year', $max, $timezone); - } - - /** - * Get a date time object somewhere within a month. - * - * @param \DateTime|int|string $max maximum timestamp used as random end limit, default to "now" - * @param string|null $timezone time zone in which the date time should be set, default to DateTime::$defaultTimezone, if set, otherwise the result of `date_default_timezone_get` - * - * @return \DateTime - */ - public static function dateTimeThisMonth($max = 'now', $timezone = null) - { - return static::dateTimeBetween('-1 month', $max, $timezone); - } - - /** - * Get a string containing either "am" or "pm". - * - * @param \DateTime|int|string $max maximum timestamp used as random end limit, default to "now" - * - * @return string - * - * @example 'am' - */ - public static function amPm($max = 'now') - { - return static::dateTime($max)->format('a'); - } - - /** - * @param \DateTime|int|string $max maximum timestamp used as random end limit, default to "now" - * - * @return string - * - * @example '22' - */ - public static function dayOfMonth($max = 'now') - { - return static::dateTime($max)->format('d'); - } - - /** - * @param \DateTime|int|string $max maximum timestamp used as random end limit, default to "now" - * - * @return string - * - * @example 'Tuesday' - */ - public static function dayOfWeek($max = 'now') - { - return static::dateTime($max)->format('l'); - } - - /** - * @param \DateTime|int|string $max maximum timestamp used as random end limit, default to "now" - * - * @return string - * - * @example '7' - */ - public static function month($max = 'now') - { - return static::dateTime($max)->format('m'); - } - - /** - * @param \DateTime|int|string $max maximum timestamp used as random end limit, default to "now" - * - * @return string - * - * @example 'September' - */ - public static function monthName($max = 'now') - { - return static::dateTime($max)->format('F'); - } - - /** - * @param \DateTime|int|string $max maximum timestamp used as random end limit, default to "now" - * - * @return string - * - * @example '1987' - */ - public static function year($max = 'now') - { - return static::dateTime($max)->format('Y'); - } - - /** - * @return string - * - * @example 'XVII' - */ - public static function century() - { - return static::randomElement(static::$century); - } - - /** - * @return string - * - * @example 'Europe/Paris' - */ - public static function timezone() - { - return static::randomElement(\DateTimeZone::listIdentifiers()); - } - - /** - * Internal method to set the time zone on a DateTime. - * - * @param string|null $timezone - * - * @return \DateTime - */ - private static function setTimezone(\DateTime $dt, $timezone) - { - return $dt->setTimezone(new \DateTimeZone(static::resolveTimezone($timezone))); - } - - /** - * Sets default time zone. - * - * @param string $timezone - */ - public static function setDefaultTimezone($timezone = null) - { - static::$defaultTimezone = $timezone; - } - - /** - * Gets default time zone. - * - * @return string|null - */ - public static function getDefaultTimezone() - { - return static::$defaultTimezone; - } - - /** - * @param string|null $timezone - * - * @return string|null - */ - private static function resolveTimezone($timezone) - { - return (null === $timezone) ? ((null === static::$defaultTimezone) ? date_default_timezone_get() : static::$defaultTimezone) : $timezone; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/File.php b/vendor/fakerphp/faker/src/Faker/Provider/File.php deleted file mode 100644 index 3cf3db9f..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/File.php +++ /dev/null @@ -1,610 +0,0 @@ - file extension(s) - * - * @see http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types - */ - protected static $mimeTypes = [ - 'application/atom+xml' => 'atom', - 'application/ecmascript' => 'ecma', - 'application/emma+xml' => 'emma', - 'application/epub+zip' => 'epub', - 'application/java-archive' => 'jar', - 'application/java-vm' => 'class', - 'application/javascript' => 'js', - 'application/json' => 'json', - 'application/jsonml+json' => 'jsonml', - 'application/lost+xml' => 'lostxml', - 'application/mathml+xml' => 'mathml', - 'application/mets+xml' => 'mets', - 'application/mods+xml' => 'mods', - 'application/mp4' => 'mp4s', - 'application/msword' => ['doc', 'dot'], - 'application/octet-stream' => [ - 'bin', - 'dms', - 'lrf', - 'mar', - 'so', - 'dist', - 'distz', - 'pkg', - 'bpk', - 'dump', - 'elc', - 'deploy', - ], - 'application/ogg' => 'ogx', - 'application/omdoc+xml' => 'omdoc', - 'application/pdf' => 'pdf', - 'application/pgp-encrypted' => 'pgp', - 'application/pgp-signature' => ['asc', 'sig'], - 'application/pkix-pkipath' => 'pkipath', - 'application/pkixcmp' => 'pki', - 'application/pls+xml' => 'pls', - 'application/postscript' => ['ai', 'eps', 'ps'], - 'application/pskc+xml' => 'pskcxml', - 'application/rdf+xml' => 'rdf', - 'application/reginfo+xml' => 'rif', - 'application/rss+xml' => 'rss', - 'application/rtf' => 'rtf', - 'application/sbml+xml' => 'sbml', - 'application/vnd.adobe.air-application-installer-package+zip' => 'air', - 'application/vnd.adobe.xdp+xml' => 'xdp', - 'application/vnd.adobe.xfdf' => 'xfdf', - 'application/vnd.ahead.space' => 'ahead', - 'application/vnd.dart' => 'dart', - 'application/vnd.data-vision.rdz' => 'rdz', - 'application/vnd.dece.data' => ['uvf', 'uvvf', 'uvd', 'uvvd'], - 'application/vnd.dece.ttml+xml' => ['uvt', 'uvvt'], - 'application/vnd.dece.unspecified' => ['uvx', 'uvvx'], - 'application/vnd.dece.zip' => ['uvz', 'uvvz'], - 'application/vnd.denovo.fcselayout-link' => 'fe_launch', - 'application/vnd.dna' => 'dna', - 'application/vnd.dolby.mlp' => 'mlp', - 'application/vnd.dpgraph' => 'dpg', - 'application/vnd.dreamfactory' => 'dfac', - 'application/vnd.ds-keypoint' => 'kpxx', - 'application/vnd.dvb.ait' => 'ait', - 'application/vnd.dvb.service' => 'svc', - 'application/vnd.dynageo' => 'geo', - 'application/vnd.ecowin.chart' => 'mag', - 'application/vnd.enliven' => 'nml', - 'application/vnd.epson.esf' => 'esf', - 'application/vnd.epson.msf' => 'msf', - 'application/vnd.epson.quickanime' => 'qam', - 'application/vnd.epson.salt' => 'slt', - 'application/vnd.epson.ssf' => 'ssf', - 'application/vnd.ezpix-album' => 'ez2', - 'application/vnd.ezpix-package' => 'ez3', - 'application/vnd.fdf' => 'fdf', - 'application/vnd.fdsn.mseed' => 'mseed', - 'application/vnd.fdsn.seed' => ['seed', 'dataless'], - 'application/vnd.flographit' => 'gph', - 'application/vnd.fluxtime.clip' => 'ftc', - 'application/vnd.hal+xml' => 'hal', - 'application/vnd.hydrostatix.sof-data' => 'sfd-hdstx', - 'application/vnd.ibm.minipay' => 'mpy', - 'application/vnd.ibm.secure-container' => 'sc', - 'application/vnd.iccprofile' => ['icc', 'icm'], - 'application/vnd.igloader' => 'igl', - 'application/vnd.immervision-ivp' => 'ivp', - 'application/vnd.kde.karbon' => 'karbon', - 'application/vnd.kde.kchart' => 'chrt', - 'application/vnd.kde.kformula' => 'kfo', - 'application/vnd.kde.kivio' => 'flw', - 'application/vnd.kde.kontour' => 'kon', - 'application/vnd.kde.kpresenter' => ['kpr', 'kpt'], - 'application/vnd.kde.kspread' => 'ksp', - 'application/vnd.kde.kword' => ['kwd', 'kwt'], - 'application/vnd.kenameaapp' => 'htke', - 'application/vnd.kidspiration' => 'kia', - 'application/vnd.kinar' => ['kne', 'knp'], - 'application/vnd.koan' => ['skp', 'skd', 'skt', 'skm'], - 'application/vnd.kodak-descriptor' => 'sse', - 'application/vnd.las.las+xml' => 'lasxml', - 'application/vnd.llamagraphics.life-balance.desktop' => 'lbd', - 'application/vnd.llamagraphics.life-balance.exchange+xml' => 'lbe', - 'application/vnd.lotus-1-2-3' => '123', - 'application/vnd.lotus-approach' => 'apr', - 'application/vnd.lotus-freelance' => 'pre', - 'application/vnd.lotus-notes' => 'nsf', - 'application/vnd.lotus-organizer' => 'org', - 'application/vnd.lotus-screencam' => 'scm', - 'application/vnd.mozilla.xul+xml' => 'xul', - 'application/vnd.ms-artgalry' => 'cil', - 'application/vnd.ms-cab-compressed' => 'cab', - 'application/vnd.ms-excel' => [ - 'xls', - 'xlm', - 'xla', - 'xlc', - 'xlt', - 'xlw', - ], - 'application/vnd.ms-excel.addin.macroenabled.12' => 'xlam', - 'application/vnd.ms-excel.sheet.binary.macroenabled.12' => 'xlsb', - 'application/vnd.ms-excel.sheet.macroenabled.12' => 'xlsm', - 'application/vnd.ms-excel.template.macroenabled.12' => 'xltm', - 'application/vnd.ms-fontobject' => 'eot', - 'application/vnd.ms-htmlhelp' => 'chm', - 'application/vnd.ms-ims' => 'ims', - 'application/vnd.ms-lrm' => 'lrm', - 'application/vnd.ms-officetheme' => 'thmx', - 'application/vnd.ms-pki.seccat' => 'cat', - 'application/vnd.ms-pki.stl' => 'stl', - 'application/vnd.ms-powerpoint' => ['ppt', 'pps', 'pot'], - 'application/vnd.ms-powerpoint.addin.macroenabled.12' => 'ppam', - 'application/vnd.ms-powerpoint.presentation.macroenabled.12' => 'pptm', - 'application/vnd.ms-powerpoint.slide.macroenabled.12' => 'sldm', - 'application/vnd.ms-powerpoint.slideshow.macroenabled.12' => 'ppsm', - 'application/vnd.ms-powerpoint.template.macroenabled.12' => 'potm', - 'application/vnd.ms-project' => ['mpp', 'mpt'], - 'application/vnd.ms-word.document.macroenabled.12' => 'docm', - 'application/vnd.ms-word.template.macroenabled.12' => 'dotm', - 'application/vnd.ms-works' => ['wps', 'wks', 'wcm', 'wdb'], - 'application/vnd.ms-wpl' => 'wpl', - 'application/vnd.ms-xpsdocument' => 'xps', - 'application/vnd.mseq' => 'mseq', - 'application/vnd.musician' => 'mus', - 'application/vnd.oasis.opendocument.chart' => 'odc', - 'application/vnd.oasis.opendocument.chart-template' => 'otc', - 'application/vnd.oasis.opendocument.database' => 'odb', - 'application/vnd.oasis.opendocument.formula' => 'odf', - 'application/vnd.oasis.opendocument.formula-template' => 'odft', - 'application/vnd.oasis.opendocument.graphics' => 'odg', - 'application/vnd.oasis.opendocument.graphics-template' => 'otg', - 'application/vnd.oasis.opendocument.image' => 'odi', - 'application/vnd.oasis.opendocument.image-template' => 'oti', - 'application/vnd.oasis.opendocument.presentation' => 'odp', - 'application/vnd.oasis.opendocument.presentation-template' => 'otp', - 'application/vnd.oasis.opendocument.spreadsheet' => 'ods', - 'application/vnd.oasis.opendocument.spreadsheet-template' => 'ots', - 'application/vnd.oasis.opendocument.text' => 'odt', - 'application/vnd.oasis.opendocument.text-master' => 'odm', - 'application/vnd.oasis.opendocument.text-template' => 'ott', - 'application/vnd.oasis.opendocument.text-web' => 'oth', - 'application/vnd.olpc-sugar' => 'xo', - 'application/vnd.oma.dd2+xml' => 'dd2', - 'application/vnd.openofficeorg.extension' => 'oxt', - 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => 'pptx', - 'application/vnd.openxmlformats-officedocument.presentationml.slide' => 'sldx', - 'application/vnd.openxmlformats-officedocument.presentationml.slideshow' => 'ppsx', - 'application/vnd.openxmlformats-officedocument.presentationml.template' => 'potx', - 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => 'xlsx', - 'application/vnd.openxmlformats-officedocument.spreadsheetml.template' => 'xltx', - 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => 'docx', - 'application/vnd.openxmlformats-officedocument.wordprocessingml.template' => 'dotx', - 'application/vnd.pvi.ptid1' => 'ptid', - 'application/vnd.quark.quarkxpress' => [ - 'qxd', - 'qxt', - 'qwd', - 'qwt', - 'qxl', - 'qxb', - ], - 'application/vnd.realvnc.bed' => 'bed', - 'application/vnd.recordare.musicxml' => 'mxl', - 'application/vnd.recordare.musicxml+xml' => 'musicxml', - 'application/vnd.rig.cryptonote' => 'cryptonote', - 'application/vnd.rim.cod' => 'cod', - 'application/vnd.rn-realmedia' => 'rm', - 'application/vnd.rn-realmedia-vbr' => 'rmvb', - 'application/vnd.route66.link66+xml' => 'link66', - 'application/vnd.sailingtracker.track' => 'st', - 'application/vnd.seemail' => 'see', - 'application/vnd.sema' => 'sema', - 'application/vnd.semd' => 'semd', - 'application/vnd.semf' => 'semf', - 'application/vnd.shana.informed.formdata' => 'ifm', - 'application/vnd.shana.informed.formtemplate' => 'itp', - 'application/vnd.shana.informed.interchange' => 'iif', - 'application/vnd.shana.informed.package' => 'ipk', - 'application/vnd.simtech-mindmapper' => ['twd', 'twds'], - 'application/vnd.smaf' => 'mmf', - 'application/vnd.stepmania.stepchart' => 'sm', - 'application/vnd.sun.xml.calc' => 'sxc', - 'application/vnd.sun.xml.calc.template' => 'stc', - 'application/vnd.sun.xml.draw' => 'sxd', - 'application/vnd.sun.xml.draw.template' => 'std', - 'application/vnd.sun.xml.impress' => 'sxi', - 'application/vnd.sun.xml.impress.template' => 'sti', - 'application/vnd.sun.xml.math' => 'sxm', - 'application/vnd.sun.xml.writer' => 'sxw', - 'application/vnd.sun.xml.writer.global' => 'sxg', - 'application/vnd.sun.xml.writer.template' => 'stw', - 'application/vnd.sus-calendar' => ['sus', 'susp'], - 'application/vnd.svd' => 'svd', - 'application/vnd.symbian.install' => ['sis', 'sisx'], - 'application/vnd.syncml+xml' => 'xsm', - 'application/vnd.syncml.dm+wbxml' => 'bdm', - 'application/vnd.syncml.dm+xml' => 'xdm', - 'application/vnd.tao.intent-module-archive' => 'tao', - 'application/vnd.tcpdump.pcap' => ['pcap', 'cap', 'dmp'], - 'application/vnd.tmobile-livetv' => 'tmo', - 'application/vnd.trid.tpt' => 'tpt', - 'application/vnd.triscape.mxs' => 'mxs', - 'application/vnd.trueapp' => 'tra', - 'application/vnd.ufdl' => ['ufd', 'ufdl'], - 'application/vnd.uiq.theme' => 'utz', - 'application/vnd.umajin' => 'umj', - 'application/vnd.unity' => 'unityweb', - 'application/vnd.uoml+xml' => 'uoml', - 'application/vnd.vcx' => 'vcx', - 'application/vnd.visio' => ['vsd', 'vst', 'vss', 'vsw'], - 'application/vnd.visionary' => 'vis', - 'application/vnd.vsf' => 'vsf', - 'application/vnd.wap.wbxml' => 'wbxml', - 'application/vnd.wap.wmlc' => 'wmlc', - 'application/vnd.wap.wmlscriptc' => 'wmlsc', - 'application/vnd.webturbo' => 'wtb', - 'application/vnd.wolfram.player' => 'nbp', - 'application/vnd.wordperfect' => 'wpd', - 'application/vnd.wqd' => 'wqd', - 'application/vnd.wt.stf' => 'stf', - 'application/vnd.xara' => 'xar', - 'application/vnd.xfdl' => 'xfdl', - 'application/voicexml+xml' => 'vxml', - 'application/widget' => 'wgt', - 'application/winhlp' => 'hlp', - 'application/wsdl+xml' => 'wsdl', - 'application/wspolicy+xml' => 'wspolicy', - 'application/x-7z-compressed' => '7z', - 'application/x-bittorrent' => 'torrent', - 'application/x-blorb' => ['blb', 'blorb'], - 'application/x-bzip' => 'bz', - 'application/x-cdlink' => 'vcd', - 'application/x-cfs-compressed' => 'cfs', - 'application/x-chat' => 'chat', - 'application/x-chess-pgn' => 'pgn', - 'application/x-conference' => 'nsc', - 'application/x-cpio' => 'cpio', - 'application/x-csh' => 'csh', - 'application/x-debian-package' => ['deb', 'udeb'], - 'application/x-dgc-compressed' => 'dgc', - 'application/x-director' => [ - 'dir', - 'dcr', - 'dxr', - 'cst', - 'cct', - 'cxt', - 'w3d', - 'fgd', - 'swa', - ], - 'application/x-font-ttf' => ['ttf', 'ttc'], - 'application/x-font-type1' => ['pfa', 'pfb', 'pfm', 'afm'], - 'application/x-font-woff' => 'woff', - 'application/x-freearc' => 'arc', - 'application/x-futuresplash' => 'spl', - 'application/x-gca-compressed' => 'gca', - 'application/x-glulx' => 'ulx', - 'application/x-gnumeric' => 'gnumeric', - 'application/x-gramps-xml' => 'gramps', - 'application/x-gtar' => 'gtar', - 'application/x-hdf' => 'hdf', - 'application/x-install-instructions' => 'install', - 'application/x-iso9660-image' => 'iso', - 'application/x-java-jnlp-file' => 'jnlp', - 'application/x-latex' => 'latex', - 'application/x-lzh-compressed' => ['lzh', 'lha'], - 'application/x-mie' => 'mie', - 'application/x-mobipocket-ebook' => ['prc', 'mobi'], - 'application/x-ms-application' => 'application', - 'application/x-ms-shortcut' => 'lnk', - 'application/x-ms-wmd' => 'wmd', - 'application/x-ms-wmz' => 'wmz', - 'application/x-ms-xbap' => 'xbap', - 'application/x-msaccess' => 'mdb', - 'application/x-msbinder' => 'obd', - 'application/x-mscardfile' => 'crd', - 'application/x-msclip' => 'clp', - 'application/x-msdownload' => ['exe', 'dll', 'com', 'bat', 'msi'], - 'application/x-msmediaview' => [ - 'mvb', - 'm13', - 'm14', - ], - 'application/x-msmetafile' => ['wmf', 'wmz', 'emf', 'emz'], - 'application/x-rar-compressed' => 'rar', - 'application/x-research-info-systems' => 'ris', - 'application/x-sh' => 'sh', - 'application/x-shar' => 'shar', - 'application/x-shockwave-flash' => 'swf', - 'application/x-silverlight-app' => 'xap', - 'application/x-sql' => 'sql', - 'application/x-stuffit' => 'sit', - 'application/x-stuffitx' => 'sitx', - 'application/x-subrip' => 'srt', - 'application/x-sv4cpio' => 'sv4cpio', - 'application/x-sv4crc' => 'sv4crc', - 'application/x-t3vm-image' => 't3', - 'application/x-tads' => 'gam', - 'application/x-tar' => 'tar', - 'application/x-tcl' => 'tcl', - 'application/x-tex' => 'tex', - 'application/x-tex-tfm' => 'tfm', - 'application/x-texinfo' => ['texinfo', 'texi'], - 'application/x-tgif' => 'obj', - 'application/x-ustar' => 'ustar', - 'application/x-wais-source' => 'src', - 'application/x-x509-ca-cert' => ['der', 'crt'], - 'application/x-xfig' => 'fig', - 'application/x-xliff+xml' => 'xlf', - 'application/x-xpinstall' => 'xpi', - 'application/x-xz' => 'xz', - 'application/x-zmachine' => 'z1', - 'application/xaml+xml' => 'xaml', - 'application/xcap-diff+xml' => 'xdf', - 'application/xenc+xml' => 'xenc', - 'application/xhtml+xml' => ['xhtml', 'xht'], - 'application/xml' => ['xml', 'xsl'], - 'application/xml-dtd' => 'dtd', - 'application/xop+xml' => 'xop', - 'application/xproc+xml' => 'xpl', - 'application/xslt+xml' => 'xslt', - 'application/xspf+xml' => 'xspf', - 'application/xv+xml' => ['mxml', 'xhvml', 'xvml', 'xvm'], - 'application/yang' => 'yang', - 'application/yin+xml' => 'yin', - 'application/zip' => 'zip', - 'audio/adpcm' => 'adp', - 'audio/basic' => ['au', 'snd'], - 'audio/midi' => ['mid', 'midi', 'kar', 'rmi'], - 'audio/mp4' => 'mp4a', - 'audio/mpeg' => [ - 'mpga', - 'mp2', - 'mp2a', - 'mp3', - 'm2a', - 'm3a', - ], - 'audio/ogg' => ['oga', 'ogg', 'spx'], - 'audio/vnd.dece.audio' => ['uva', 'uvva'], - 'audio/vnd.rip' => 'rip', - 'audio/webm' => 'weba', - 'audio/x-aac' => 'aac', - 'audio/x-aiff' => ['aif', 'aiff', 'aifc'], - 'audio/x-caf' => 'caf', - 'audio/x-flac' => 'flac', - 'audio/x-matroska' => 'mka', - 'audio/x-mpegurl' => 'm3u', - 'audio/x-ms-wax' => 'wax', - 'audio/x-ms-wma' => 'wma', - 'audio/x-pn-realaudio' => ['ram', 'ra'], - 'audio/x-pn-realaudio-plugin' => 'rmp', - 'audio/x-wav' => 'wav', - 'audio/xm' => 'xm', - 'image/bmp' => 'bmp', - 'image/cgm' => 'cgm', - 'image/g3fax' => 'g3', - 'image/gif' => 'gif', - 'image/ief' => 'ief', - 'image/jpeg' => ['jpeg', 'jpg', 'jpe'], - 'image/ktx' => 'ktx', - 'image/png' => 'png', - 'image/prs.btif' => 'btif', - 'image/sgi' => 'sgi', - 'image/svg+xml' => ['svg', 'svgz'], - 'image/tiff' => ['tiff', 'tif'], - 'image/vnd.adobe.photoshop' => 'psd', - 'image/vnd.dece.graphic' => ['uvi', 'uvvi', 'uvg', 'uvvg'], - 'image/vnd.dvb.subtitle' => 'sub', - 'image/vnd.djvu' => ['djvu', 'djv'], - 'image/vnd.dwg' => 'dwg', - 'image/vnd.dxf' => 'dxf', - 'image/vnd.fastbidsheet' => 'fbs', - 'image/vnd.fpx' => 'fpx', - 'image/vnd.fst' => 'fst', - 'image/vnd.fujixerox.edmics-mmr' => 'mmr', - 'image/vnd.fujixerox.edmics-rlc' => 'rlc', - 'image/vnd.ms-modi' => 'mdi', - 'image/vnd.ms-photo' => 'wdp', - 'image/vnd.net-fpx' => 'npx', - 'image/vnd.wap.wbmp' => 'wbmp', - 'image/vnd.xiff' => 'xif', - 'image/webp' => 'webp', - 'image/x-3ds' => '3ds', - 'image/x-cmu-raster' => 'ras', - 'image/x-cmx' => 'cmx', - 'image/x-freehand' => ['fh', 'fhc', 'fh4', 'fh5', 'fh7'], - 'image/x-icon' => 'ico', - 'image/x-mrsid-image' => 'sid', - 'image/x-pcx' => 'pcx', - 'image/x-pict' => ['pic', 'pct'], - 'image/x-portable-anymap' => 'pnm', - 'image/x-portable-bitmap' => 'pbm', - 'image/x-portable-graymap' => 'pgm', - 'image/x-portable-pixmap' => 'ppm', - 'image/x-rgb' => 'rgb', - 'image/x-tga' => 'tga', - 'image/x-xbitmap' => 'xbm', - 'image/x-xpixmap' => 'xpm', - 'image/x-xwindowdump' => 'xwd', - 'message/rfc822' => ['eml', 'mime'], - 'model/iges' => ['igs', 'iges'], - 'model/mesh' => ['msh', 'mesh', 'silo'], - 'model/vnd.collada+xml' => 'dae', - 'model/vnd.dwf' => 'dwf', - 'model/vnd.gdl' => 'gdl', - 'model/vnd.gtw' => 'gtw', - 'model/vnd.mts' => 'mts', - 'model/vnd.vtu' => 'vtu', - 'model/vrml' => ['wrl', 'vrml'], - 'model/x3d+binary' => 'x3db', - 'model/x3d+vrml' => 'x3dv', - 'model/x3d+xml' => 'x3d', - 'text/cache-manifest' => 'appcache', - 'text/calendar' => ['ics', 'ifb'], - 'text/css' => 'css', - 'text/csv' => 'csv', - 'text/html' => ['html', 'htm'], - 'text/n3' => 'n3', - 'text/plain' => [ - 'txt', - 'text', - 'conf', - 'def', - 'list', - 'log', - 'in', - ], - 'text/prs.lines.tag' => 'dsc', - 'text/richtext' => 'rtx', - 'text/sgml' => ['sgml', 'sgm'], - 'text/tab-separated-values' => 'tsv', - 'text/troff' => [ - 't', - 'tr', - 'roff', - 'man', - 'me', - 'ms', - ], - 'text/turtle' => 'ttl', - 'text/uri-list' => ['uri', 'uris', 'urls'], - 'text/vcard' => 'vcard', - 'text/vnd.curl' => 'curl', - 'text/vnd.curl.dcurl' => 'dcurl', - 'text/vnd.curl.scurl' => 'scurl', - 'text/vnd.curl.mcurl' => 'mcurl', - 'text/vnd.dvb.subtitle' => 'sub', - 'text/vnd.fly' => 'fly', - 'text/vnd.fmi.flexstor' => 'flx', - 'text/vnd.graphviz' => 'gv', - 'text/vnd.in3d.3dml' => '3dml', - 'text/vnd.in3d.spot' => 'spot', - 'text/vnd.sun.j2me.app-descriptor' => 'jad', - 'text/vnd.wap.wml' => 'wml', - 'text/vnd.wap.wmlscript' => 'wmls', - 'text/x-asm' => ['s', 'asm'], - 'text/x-fortran' => ['f', 'for', 'f77', 'f90'], - 'text/x-java-source' => 'java', - 'text/x-opml' => 'opml', - 'text/x-pascal' => ['p', 'pas'], - 'text/x-nfo' => 'nfo', - 'text/x-setext' => 'etx', - 'text/x-sfv' => 'sfv', - 'text/x-uuencode' => 'uu', - 'text/x-vcalendar' => 'vcs', - 'text/x-vcard' => 'vcf', - 'video/3gpp' => '3gp', - 'video/3gpp2' => '3g2', - 'video/h261' => 'h261', - 'video/h263' => 'h263', - 'video/h264' => 'h264', - 'video/jpeg' => 'jpgv', - 'video/jpm' => ['jpm', 'jpgm'], - 'video/mj2' => 'mj2', - 'video/mp4' => 'mp4', - 'video/mpeg' => ['mpeg', 'mpg', 'mpe', 'm1v', 'm2v'], - 'video/ogg' => 'ogv', - 'video/quicktime' => ['qt', 'mov'], - 'video/vnd.dece.hd' => ['uvh', 'uvvh'], - 'video/vnd.dece.mobile' => ['uvm', 'uvvm'], - 'video/vnd.dece.pd' => ['uvp', 'uvvp'], - 'video/vnd.dece.sd' => ['uvs', 'uvvs'], - 'video/vnd.dece.video' => ['uvv', 'uvvv'], - 'video/vnd.dvb.file' => 'dvb', - 'video/vnd.fvt' => 'fvt', - 'video/vnd.mpegurl' => ['mxu', 'm4u'], - 'video/vnd.ms-playready.media.pyv' => 'pyv', - 'video/vnd.uvvu.mp4' => ['uvu', 'uvvu'], - 'video/vnd.vivo' => 'viv', - 'video/webm' => 'webm', - 'video/x-f4v' => 'f4v', - 'video/x-fli' => 'fli', - 'video/x-flv' => 'flv', - 'video/x-m4v' => 'm4v', - 'video/x-matroska' => ['mkv', 'mk3d', 'mks'], - 'video/x-mng' => 'mng', - 'video/x-ms-asf' => ['asf', 'asx'], - 'video/x-ms-vob' => 'vob', - 'video/x-ms-wm' => 'wm', - 'video/x-ms-wmv' => 'wmv', - 'video/x-ms-wmx' => 'wmx', - 'video/x-ms-wvx' => 'wvx', - 'video/x-msvideo' => 'avi', - 'video/x-sgi-movie' => 'movie', - ]; - - /** - * Get a random MIME type - * - * @return string - * - * @example 'video/avi' - */ - public static function mimeType() - { - return static::randomElement(array_keys(static::$mimeTypes)); - } - - /** - * Get a random file extension (without a dot) - * - * @example avi - * - * @return string - */ - public static function fileExtension() - { - $random_extension = static::randomElement(array_values(static::$mimeTypes)); - - return is_array($random_extension) ? static::randomElement($random_extension) : $random_extension; - } - - /** - * Copy a random file from the source directory to the target directory and returns the filename/fullpath - * - * @param string $sourceDirectory The directory to look for random file taking - * @param string $targetDirectory - * @param bool $fullPath Whether to have the full path or just the filename - * - * @return string - */ - public static function file($sourceDirectory = '/tmp', $targetDirectory = '/tmp', $fullPath = true) - { - if (!is_dir($sourceDirectory)) { - throw new \InvalidArgumentException(sprintf('Source directory %s does not exist or is not a directory.', $sourceDirectory)); - } - - if (!is_dir($targetDirectory)) { - throw new \InvalidArgumentException(sprintf('Target directory %s does not exist or is not a directory.', $targetDirectory)); - } - - if ($sourceDirectory == $targetDirectory) { - throw new \InvalidArgumentException('Source and target directories must differ.'); - } - - // Drop . and .. and reset array keys - $files = array_filter(array_values(array_diff(scandir($sourceDirectory), ['.', '..'])), static function ($file) use ($sourceDirectory) { - return is_file($sourceDirectory . DIRECTORY_SEPARATOR . $file) && is_readable($sourceDirectory . DIRECTORY_SEPARATOR . $file); - }); - - if (empty($files)) { - throw new \InvalidArgumentException(sprintf('Source directory %s is empty.', $sourceDirectory)); - } - - $sourceFullPath = $sourceDirectory . DIRECTORY_SEPARATOR . static::randomElement($files); - - $destinationFile = Uuid::uuid() . '.' . pathinfo($sourceFullPath, PATHINFO_EXTENSION); - $destinationFullPath = $targetDirectory . DIRECTORY_SEPARATOR . $destinationFile; - - if (false === copy($sourceFullPath, $destinationFullPath)) { - return false; - } - - return $fullPath ? $destinationFullPath : $destinationFile; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/HtmlLorem.php b/vendor/fakerphp/faker/src/Faker/Provider/HtmlLorem.php deleted file mode 100644 index a8434108..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/HtmlLorem.php +++ /dev/null @@ -1,307 +0,0 @@ -addProvider(new Lorem($generator)); - $generator->addProvider(new Internet($generator)); - } - - /** - * @param int $maxDepth - * @param int $maxWidth - * - * @return string - */ - public function randomHtml($maxDepth = 4, $maxWidth = 4) - { - if (!class_exists(\DOMDocument::class, false)) { - throw new \RuntimeException('ext-dom is required to use randomHtml.'); - } - - $document = new \DOMDocument(); - $this->idGenerator = new UniqueGenerator($this->generator); - - $head = $document->createElement('head'); - $this->addRandomTitle($head); - - $body = $document->createElement('body'); - $this->addLoginForm($body); - $this->addRandomSubTree($body, $maxDepth, $maxWidth); - - $html = $document->createElement('html'); - $html->appendChild($head); - $html->appendChild($body); - - $document->appendChild($html); - - return $document->saveHTML(); - } - - private function addRandomSubTree(\DOMElement $root, $maxDepth, $maxWidth) - { - --$maxDepth; - - if ($maxDepth <= 0) { - return $root; - } - - $siblings = self::numberBetween(1, $maxWidth); - - for ($i = 0; $i < $siblings; ++$i) { - if ($maxDepth == 1) { - $this->addRandomLeaf($root); - } else { - $sibling = $root->ownerDocument->createElement('div'); - $root->appendChild($sibling); - $this->addRandomAttribute($sibling); - $this->addRandomSubTree($sibling, self::numberBetween(0, $maxDepth), $maxWidth); - } - } - - return $root; - } - - private function addRandomLeaf(\DOMElement $node): void - { - $rand = self::numberBetween(1, 10); - - switch ($rand) { - case 1: - $this->addRandomP($node); - - break; - - case 2: - $this->addRandomA($node); - - break; - - case 3: - $this->addRandomSpan($node); - - break; - - case 4: - $this->addRandomUL($node); - - break; - - case 5: - $this->addRandomH($node); - - break; - - case 6: - $this->addRandomB($node); - - break; - - case 7: - $this->addRandomI($node); - - break; - - case 8: - $this->addRandomTable($node); - - break; - - default: - $this->addRandomText($node); - - break; - } - } - - private function addRandomAttribute(\DOMElement $node): void - { - $rand = self::numberBetween(1, 2); - - switch ($rand) { - case 1: - $node->setAttribute('class', $this->generator->word()); - - break; - - case 2: - $node->setAttribute('id', (string) $this->idGenerator->randomNumber(5)); - - break; - } - } - - private function addRandomP(\DOMElement $element, $maxLength = 10): void - { - $node = $element->ownerDocument->createElement(static::P_TAG); - $node->textContent = $this->generator->sentence(self::numberBetween(1, $maxLength)); - $element->appendChild($node); - } - - private function addRandomText(\DOMElement $element, $maxLength = 10): void - { - $text = $element->ownerDocument->createTextNode($this->generator->sentence(self::numberBetween(1, $maxLength))); - $element->appendChild($text); - } - - private function addRandomA(\DOMElement $element, $maxLength = 10): void - { - $text = $element->ownerDocument->createTextNode($this->generator->sentence(self::numberBetween(1, $maxLength))); - $node = $element->ownerDocument->createElement(static::A_TAG); - $node->setAttribute('href', $this->generator->safeEmailDomain()); - $node->appendChild($text); - $element->appendChild($node); - } - - private function addRandomTitle(\DOMElement $element, $maxLength = 10): void - { - $text = $element->ownerDocument->createTextNode($this->generator->sentence(self::numberBetween(1, $maxLength))); - $node = $element->ownerDocument->createElement(static::TITLE_TAG); - $node->appendChild($text); - $element->appendChild($node); - } - - private function addRandomH(\DOMElement $element, $maxLength = 10): void - { - $h = static::H_TAG . (string) self::numberBetween(1, 3); - $text = $element->ownerDocument->createTextNode($this->generator->sentence(self::numberBetween(1, $maxLength))); - $node = $element->ownerDocument->createElement($h); - $node->appendChild($text); - $element->appendChild($node); - } - - private function addRandomB(\DOMElement $element, $maxLength = 10): void - { - $text = $element->ownerDocument->createTextNode($this->generator->sentence(self::numberBetween(1, $maxLength))); - $node = $element->ownerDocument->createElement(static::B_TAG); - $node->appendChild($text); - $element->appendChild($node); - } - - private function addRandomI(\DOMElement $element, $maxLength = 10): void - { - $text = $element->ownerDocument->createTextNode($this->generator->sentence(self::numberBetween(1, $maxLength))); - $node = $element->ownerDocument->createElement(static::I_TAG); - $node->appendChild($text); - $element->appendChild($node); - } - - private function addRandomSpan(\DOMElement $element, $maxLength = 10): void - { - $text = $element->ownerDocument->createTextNode($this->generator->sentence(self::numberBetween(1, $maxLength))); - $node = $element->ownerDocument->createElement(static::SPAN_TAG); - $node->appendChild($text); - $element->appendChild($node); - } - - private function addLoginForm(\DOMElement $element): void - { - $textInput = $element->ownerDocument->createElement(static::INPUT_TAG); - $textInput->setAttribute('type', 'text'); - $textInput->setAttribute('id', 'username'); - - $textLabel = $element->ownerDocument->createElement(static::LABEL_TAG); - $textLabel->setAttribute('for', 'username'); - $textLabel->textContent = $this->generator->word(); - - $passwordInput = $element->ownerDocument->createElement(static::INPUT_TAG); - $passwordInput->setAttribute('type', 'password'); - $passwordInput->setAttribute('id', 'password'); - - $passwordLabel = $element->ownerDocument->createElement(static::LABEL_TAG); - $passwordLabel->setAttribute('for', 'password'); - $passwordLabel->textContent = $this->generator->word(); - - $submit = $element->ownerDocument->createElement(static::INPUT_TAG); - $submit->setAttribute('type', 'submit'); - $submit->setAttribute('value', $this->generator->word()); - - $submit = $element->ownerDocument->createElement(static::FORM_TAG); - $submit->setAttribute('action', $this->generator->safeEmailDomain()); - $submit->setAttribute('method', 'POST'); - $submit->appendChild($textLabel); - $submit->appendChild($textInput); - $submit->appendChild($passwordLabel); - $submit->appendChild($passwordInput); - $element->appendChild($submit); - } - - private function addRandomTable(\DOMElement $element, $maxRows = 10, $maxCols = 6, $maxTitle = 4, $maxLength = 10): void - { - $rows = self::numberBetween(1, $maxRows); - $cols = self::numberBetween(1, $maxCols); - - $table = $element->ownerDocument->createElement(static::TABLE_TAG); - $thead = $element->ownerDocument->createElement(static::THEAD_TAG); - $tbody = $element->ownerDocument->createElement(static::TBODY_TAG); - - $table->appendChild($thead); - $table->appendChild($tbody); - - $tr = $element->ownerDocument->createElement(static::TR_TAG); - $thead->appendChild($tr); - - for ($i = 0; $i < $cols; ++$i) { - $th = $element->ownerDocument->createElement(static::TH_TAG); - $th->textContent = $this->generator->sentence(self::numberBetween(1, $maxTitle)); - $tr->appendChild($th); - } - - for ($i = 0; $i < $rows; ++$i) { - $tr = $element->ownerDocument->createElement(static::TR_TAG); - $tbody->appendChild($tr); - - for ($j = 0; $j < $cols; ++$j) { - $th = $element->ownerDocument->createElement(static::TD_TAG); - $th->textContent = $this->generator->sentence(self::numberBetween(1, $maxLength)); - $tr->appendChild($th); - } - } - $element->appendChild($table); - } - - private function addRandomUL(\DOMElement $element, $maxItems = 11, $maxLength = 4): void - { - $num = self::numberBetween(1, $maxItems); - $ul = $element->ownerDocument->createElement(static::UL_TAG); - - for ($i = 0; $i < $num; ++$i) { - $li = $element->ownerDocument->createElement(static::LI_TAG); - $li->textContent = $this->generator->sentence(self::numberBetween(1, $maxLength)); - $ul->appendChild($li); - } - $element->appendChild($ul); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/Image.php b/vendor/fakerphp/faker/src/Faker/Provider/Image.php deleted file mode 100644 index 53f28dfc..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/Image.php +++ /dev/null @@ -1,195 +0,0 @@ - 0 ? '?text=' . urlencode(implode(' ', $imageParts)) : '', - ); - } - - /** - * Download a remote random image to disk and return its location - * - * Requires curl, or allow_url_fopen to be on in php.ini. - * - * @example '/path/to/dir/13b73edae8443990be1aa8f1a483bc27.png' - * - * @return bool|string - */ - public static function image( - $dir = null, - $width = 640, - $height = 480, - $category = null, - $fullPath = true, - $randomize = true, - $word = null, - $gray = false, - $format = 'png' - ) { - trigger_deprecation( - 'fakerphp/faker', - '1.20', - 'Provider is deprecated and will no longer be available in Faker 2. Please use a custom provider instead', - ); - - $dir = null === $dir ? sys_get_temp_dir() : $dir; // GNU/Linux / OS X / Windows compatible - // Validate directory path - if (!is_dir($dir) || !is_writable($dir)) { - throw new \InvalidArgumentException(sprintf('Cannot write to directory "%s"', $dir)); - } - - // Generate a random filename. Use the server address so that a file - // generated at the same time on a different server won't have a collision. - $name = md5(uniqid(empty($_SERVER['SERVER_ADDR']) ? '' : $_SERVER['SERVER_ADDR'], true)); - $filename = sprintf('%s.%s', $name, $format); - $filepath = $dir . DIRECTORY_SEPARATOR . $filename; - - $url = static::imageUrl($width, $height, $category, $randomize, $word, $gray, $format); - - // save file - if (function_exists('curl_exec')) { - // use cURL - $fp = fopen($filepath, 'w'); - $ch = curl_init($url); - curl_setopt($ch, CURLOPT_FILE, $fp); - $success = curl_exec($ch) && curl_getinfo($ch, CURLINFO_HTTP_CODE) === 200; - fclose($fp); - curl_close($ch); - - if (!$success) { - unlink($filepath); - - // could not contact the distant URL or HTTP error - fail silently. - return false; - } - } elseif (ini_get('allow_url_fopen')) { - // use remote fopen() via copy() - $success = copy($url, $filepath); - - if (!$success) { - // could not contact the distant URL or HTTP error - fail silently. - return false; - } - } else { - return new \RuntimeException('The image formatter downloads an image from a remote HTTP server. Therefore, it requires that PHP can request remote hosts, either via cURL or fopen()'); - } - - return $fullPath ? $filepath : $filename; - } - - public static function getFormats(): array - { - trigger_deprecation( - 'fakerphp/faker', - '1.20', - 'Provider is deprecated and will no longer be available in Faker 2. Please use a custom provider instead', - ); - - return array_keys(static::getFormatConstants()); - } - - public static function getFormatConstants(): array - { - trigger_deprecation( - 'fakerphp/faker', - '1.20', - 'Provider is deprecated and will no longer be available in Faker 2. Please use a custom provider instead', - ); - - return [ - static::FORMAT_JPG => constant('IMAGETYPE_JPEG'), - static::FORMAT_JPEG => constant('IMAGETYPE_JPEG'), - static::FORMAT_PNG => constant('IMAGETYPE_PNG'), - ]; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/Internet.php b/vendor/fakerphp/faker/src/Faker/Provider/Internet.php deleted file mode 100644 index 122d9c0c..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/Internet.php +++ /dev/null @@ -1,407 +0,0 @@ -generator->parse($format); - } - - /** - * @example 'jdoe@example.com' - * - * @return string - */ - final public function safeEmail() - { - return preg_replace('/\s/u', '', $this->userName() . '@' . static::safeEmailDomain()); - } - - /** - * @example 'jdoe@gmail.com' - * - * @return string - */ - public function freeEmail() - { - return preg_replace('/\s/u', '', $this->userName() . '@' . static::freeEmailDomain()); - } - - /** - * @example 'jdoe@dawson.com' - * - * @return string - */ - public function companyEmail() - { - return preg_replace('/\s/u', '', $this->userName() . '@' . $this->domainName()); - } - - /** - * @example 'gmail.com' - * - * @return string - */ - public static function freeEmailDomain() - { - return static::randomElement(static::$freeEmailDomain); - } - - /** - * @example 'example.org' - * - * @return string - */ - final public static function safeEmailDomain() - { - $domains = [ - 'example.com', - 'example.org', - 'example.net', - ]; - - return static::randomElement($domains); - } - - /** - * @example 'jdoe' - * - * @return string - */ - public function userName() - { - $format = static::randomElement(static::$userNameFormats); - $username = static::bothify($this->generator->parse($format)); - - $username = strtolower(static::transliterate($username)); - - // check if transliterate() didn't support the language and removed all letters - if (trim($username, '._') === '') { - throw new \Exception('userName failed with the selected locale. Try a different locale or activate the "intl" PHP extension.'); - } - - // clean possible trailing dots from first/last names - $username = str_replace('..', '.', $username); - $username = rtrim($username, '.'); - - return $username; - } - - /** - * @example 'fY4èHdZv68' - * - * @return string - */ - public function password($minLength = 6, $maxLength = 20) - { - $pattern = str_repeat('*', $this->numberBetween($minLength, $maxLength)); - - return $this->asciify($pattern); - } - - /** - * @example 'tiramisu.com' - * - * @return string - */ - public function domainName() - { - return $this->domainWord() . '.' . $this->tld(); - } - - /** - * @example 'faber' - * - * @return string - */ - public function domainWord() - { - $lastName = $this->generator->format('lastName'); - - $lastName = strtolower(static::transliterate($lastName)); - - // check if transliterate() didn't support the language and removed all letters - if (trim($lastName, '._') === '') { - throw new \Exception('domainWord failed with the selected locale. Try a different locale or activate the "intl" PHP extension.'); - } - - // clean possible trailing dot from last name - $lastName = rtrim($lastName, '.'); - - return $lastName; - } - - /** - * @example 'com' - * - * @return string - */ - public function tld() - { - return static::randomElement(static::$tld); - } - - /** - * @example 'http://www.runolfsdottir.com/' - * - * @return string - */ - public function url() - { - $format = static::randomElement(static::$urlFormats); - - return $this->generator->parse($format); - } - - /** - * @example 'aut-repellat-commodi-vel-itaque-nihil-id-saepe-nostrum' - * - * @return string - */ - public function slug($nbWords = 6, $variableNbWords = true) - { - if ($nbWords <= 0) { - return ''; - } - - if ($variableNbWords) { - $nbWords = (int) ($nbWords * self::numberBetween(60, 140) / 100) + 1; - } - $words = $this->generator->words($nbWords); - - return implode('-', $words); - } - - /** - * @example '237.149.115.38' - * - * @return string - */ - public function ipv4() - { - return long2ip(Miscellaneous::boolean() ? self::numberBetween(-2147483648, -2) : self::numberBetween(16777216, 2147483647)); - } - - /** - * @example '35cd:186d:3e23:2986:ef9f:5b41:42a4:e6f1' - * - * @return string - */ - public function ipv6() - { - $res = []; - - for ($i = 0; $i < 8; ++$i) { - $res[] = dechex(self::numberBetween(0, 65535)); - } - - return implode(':', $res); - } - - /** - * @example '10.1.1.17' - * - * @return string - */ - public static function localIpv4() - { - $ipBlock = self::randomElement(static::$localIpBlocks); - - return long2ip(static::numberBetween(ip2long($ipBlock[0]), ip2long($ipBlock[1]))); - } - - /** - * @example '32:F1:39:2F:D6:18' - * - * @return string - */ - public static function macAddress() - { - $mac = []; - - for ($i = 0; $i < 6; ++$i) { - $mac[] = sprintf('%02X', self::numberBetween(0, 0xff)); - } - - return implode(':', $mac); - } - - protected static function transliterate($string) - { - if (0 === preg_match('/[^A-Za-z0-9_.]/', $string)) { - return $string; - } - - $transId = 'Any-Latin; Latin-ASCII; NFD; [:Nonspacing Mark:] Remove; NFC;'; - - if (class_exists(\Transliterator::class, false) && $transliterator = \Transliterator::create($transId)) { - $transString = $transliterator->transliterate($string); - } else { - $transString = static::toAscii($string); - } - - return preg_replace('/[^A-Za-z0-9_.]/u', '', $transString); - } - - protected static function toAscii($string) - { - static $arrayFrom, $arrayTo; - - if (empty($arrayFrom)) { - $transliterationTable = [ - 'IJ' => 'I', 'Ö' => 'O', 'Œ' => 'O', 'Ü' => 'U', 'ä' => 'a', 'æ' => 'a', - 'ij' => 'i', 'ö' => 'o', 'œ' => 'o', 'ü' => 'u', 'ß' => 's', 'ſ' => 's', - 'À' => 'A', 'Á' => 'A', 'Â' => 'A', 'Ã' => 'A', 'Ä' => 'A', 'Å' => 'A', - 'Æ' => 'A', 'Ā' => 'A', 'Ą' => 'A', 'Ă' => 'A', 'Ç' => 'C', 'Ć' => 'C', - 'Č' => 'C', 'Ĉ' => 'C', 'Ċ' => 'C', 'Ď' => 'D', 'Đ' => 'D', 'È' => 'E', - 'É' => 'E', 'Ê' => 'E', 'Ë' => 'E', 'Ē' => 'E', 'Ę' => 'E', 'Ě' => 'E', - 'Ĕ' => 'E', 'Ė' => 'E', 'Ĝ' => 'G', 'Ğ' => 'G', 'Ġ' => 'G', 'Ģ' => 'G', - 'Ĥ' => 'H', 'Ħ' => 'H', 'Ì' => 'I', 'Í' => 'I', 'Î' => 'I', 'Ï' => 'I', - 'Ī' => 'I', 'Ĩ' => 'I', 'Ĭ' => 'I', 'Į' => 'I', 'İ' => 'I', 'Ĵ' => 'J', - 'Ķ' => 'K', 'Ľ' => 'K', 'Ĺ' => 'K', 'Ļ' => 'K', 'Ŀ' => 'K', 'Ł' => 'L', - 'Ñ' => 'N', 'Ń' => 'N', 'Ň' => 'N', 'Ņ' => 'N', 'Ŋ' => 'N', 'Ò' => 'O', - 'Ó' => 'O', 'Ô' => 'O', 'Õ' => 'O', 'Ø' => 'O', 'Ō' => 'O', 'Ő' => 'O', - 'Ŏ' => 'O', 'Ŕ' => 'R', 'Ř' => 'R', 'Ŗ' => 'R', 'Ś' => 'S', 'Ş' => 'S', - 'Ŝ' => 'S', 'Ș' => 'S', 'Š' => 'S', 'Ť' => 'T', 'Ţ' => 'T', 'Ŧ' => 'T', - 'Ț' => 'T', 'Ù' => 'U', 'Ú' => 'U', 'Û' => 'U', 'Ū' => 'U', 'Ů' => 'U', - 'Ű' => 'U', 'Ŭ' => 'U', 'Ũ' => 'U', 'Ų' => 'U', 'Ŵ' => 'W', 'Ŷ' => 'Y', - 'Ÿ' => 'Y', 'Ý' => 'Y', 'Ź' => 'Z', 'Ż' => 'Z', 'Ž' => 'Z', 'à' => 'a', - 'á' => 'a', 'â' => 'a', 'ã' => 'a', 'ā' => 'a', 'ą' => 'a', 'ă' => 'a', - 'å' => 'a', 'ç' => 'c', 'ć' => 'c', 'č' => 'c', 'ĉ' => 'c', 'ċ' => 'c', - 'ď' => 'd', 'đ' => 'd', 'è' => 'e', 'é' => 'e', 'ê' => 'e', 'ë' => 'e', - 'ē' => 'e', 'ę' => 'e', 'ě' => 'e', 'ĕ' => 'e', 'ė' => 'e', 'ƒ' => 'f', - 'ĝ' => 'g', 'ğ' => 'g', 'ġ' => 'g', 'ģ' => 'g', 'ĥ' => 'h', 'ħ' => 'h', - 'ì' => 'i', 'í' => 'i', 'î' => 'i', 'ï' => 'i', 'ī' => 'i', 'ĩ' => 'i', - 'ĭ' => 'i', 'į' => 'i', 'ı' => 'i', 'ĵ' => 'j', 'ķ' => 'k', 'ĸ' => 'k', - 'ł' => 'l', 'ľ' => 'l', 'ĺ' => 'l', 'ļ' => 'l', 'ŀ' => 'l', 'ñ' => 'n', - 'ń' => 'n', 'ň' => 'n', 'ņ' => 'n', 'ʼn' => 'n', 'ŋ' => 'n', 'ò' => 'o', - 'ó' => 'o', 'ô' => 'o', 'õ' => 'o', 'ø' => 'o', 'ō' => 'o', 'ő' => 'o', - 'ŏ' => 'o', 'ŕ' => 'r', 'ř' => 'r', 'ŗ' => 'r', 'ś' => 's', 'š' => 's', - 'ť' => 't', 'ù' => 'u', 'ú' => 'u', 'û' => 'u', 'ū' => 'u', 'ů' => 'u', - 'ű' => 'u', 'ŭ' => 'u', 'ũ' => 'u', 'ų' => 'u', 'ŵ' => 'w', 'ÿ' => 'y', - 'ý' => 'y', 'ŷ' => 'y', 'ż' => 'z', 'ź' => 'z', 'ž' => 'z', 'Α' => 'A', - 'Ά' => 'A', 'Ἀ' => 'A', 'Ἁ' => 'A', 'Ἂ' => 'A', 'Ἃ' => 'A', 'Ἄ' => 'A', - 'Ἅ' => 'A', 'Ἆ' => 'A', 'Ἇ' => 'A', 'ᾈ' => 'A', 'ᾉ' => 'A', 'ᾊ' => 'A', - 'ᾋ' => 'A', 'ᾌ' => 'A', 'ᾍ' => 'A', 'ᾎ' => 'A', 'ᾏ' => 'A', 'Ᾰ' => 'A', - 'Ᾱ' => 'A', 'Ὰ' => 'A', 'ᾼ' => 'A', 'Β' => 'B', 'Γ' => 'G', 'Δ' => 'D', - 'Ε' => 'E', 'Έ' => 'E', 'Ἐ' => 'E', 'Ἑ' => 'E', 'Ἒ' => 'E', 'Ἓ' => 'E', - 'Ἔ' => 'E', 'Ἕ' => 'E', 'Ὲ' => 'E', 'Ζ' => 'Z', 'Η' => 'I', 'Ή' => 'I', - 'Ἠ' => 'I', 'Ἡ' => 'I', 'Ἢ' => 'I', 'Ἣ' => 'I', 'Ἤ' => 'I', 'Ἥ' => 'I', - 'Ἦ' => 'I', 'Ἧ' => 'I', 'ᾘ' => 'I', 'ᾙ' => 'I', 'ᾚ' => 'I', 'ᾛ' => 'I', - 'ᾜ' => 'I', 'ᾝ' => 'I', 'ᾞ' => 'I', 'ᾟ' => 'I', 'Ὴ' => 'I', 'ῌ' => 'I', - 'Θ' => 'T', 'Ι' => 'I', 'Ί' => 'I', 'Ϊ' => 'I', 'Ἰ' => 'I', 'Ἱ' => 'I', - 'Ἲ' => 'I', 'Ἳ' => 'I', 'Ἴ' => 'I', 'Ἵ' => 'I', 'Ἶ' => 'I', 'Ἷ' => 'I', - 'Ῐ' => 'I', 'Ῑ' => 'I', 'Ὶ' => 'I', 'Κ' => 'K', 'Λ' => 'L', 'Μ' => 'M', - 'Ν' => 'N', 'Ξ' => 'K', 'Ο' => 'O', 'Ό' => 'O', 'Ὀ' => 'O', 'Ὁ' => 'O', - 'Ὂ' => 'O', 'Ὃ' => 'O', 'Ὄ' => 'O', 'Ὅ' => 'O', 'Ὸ' => 'O', 'Π' => 'P', - 'Ρ' => 'R', 'Ῥ' => 'R', 'Σ' => 'S', 'Τ' => 'T', 'Υ' => 'Y', 'Ύ' => 'Y', - 'Ϋ' => 'Y', 'Ὑ' => 'Y', 'Ὓ' => 'Y', 'Ὕ' => 'Y', 'Ὗ' => 'Y', 'Ῠ' => 'Y', - 'Ῡ' => 'Y', 'Ὺ' => 'Y', 'Φ' => 'F', 'Χ' => 'X', 'Ψ' => 'P', 'Ω' => 'O', - 'Ώ' => 'O', 'Ὠ' => 'O', 'Ὡ' => 'O', 'Ὢ' => 'O', 'Ὣ' => 'O', 'Ὤ' => 'O', - 'Ὥ' => 'O', 'Ὦ' => 'O', 'Ὧ' => 'O', 'ᾨ' => 'O', 'ᾩ' => 'O', 'ᾪ' => 'O', - 'ᾫ' => 'O', 'ᾬ' => 'O', 'ᾭ' => 'O', 'ᾮ' => 'O', 'ᾯ' => 'O', 'Ὼ' => 'O', - 'ῼ' => 'O', 'α' => 'a', 'ά' => 'a', 'ἀ' => 'a', 'ἁ' => 'a', 'ἂ' => 'a', - 'ἃ' => 'a', 'ἄ' => 'a', 'ἅ' => 'a', 'ἆ' => 'a', 'ἇ' => 'a', 'ᾀ' => 'a', - 'ᾁ' => 'a', 'ᾂ' => 'a', 'ᾃ' => 'a', 'ᾄ' => 'a', 'ᾅ' => 'a', 'ᾆ' => 'a', - 'ᾇ' => 'a', 'ὰ' => 'a', 'ᾰ' => 'a', 'ᾱ' => 'a', 'ᾲ' => 'a', 'ᾳ' => 'a', - 'ᾴ' => 'a', 'ᾶ' => 'a', 'ᾷ' => 'a', 'β' => 'b', 'γ' => 'g', 'δ' => 'd', - 'ε' => 'e', 'έ' => 'e', 'ἐ' => 'e', 'ἑ' => 'e', 'ἒ' => 'e', 'ἓ' => 'e', - 'ἔ' => 'e', 'ἕ' => 'e', 'ὲ' => 'e', 'ζ' => 'z', 'η' => 'i', 'ή' => 'i', - 'ἠ' => 'i', 'ἡ' => 'i', 'ἢ' => 'i', 'ἣ' => 'i', 'ἤ' => 'i', 'ἥ' => 'i', - 'ἦ' => 'i', 'ἧ' => 'i', 'ᾐ' => 'i', 'ᾑ' => 'i', 'ᾒ' => 'i', 'ᾓ' => 'i', - 'ᾔ' => 'i', 'ᾕ' => 'i', 'ᾖ' => 'i', 'ᾗ' => 'i', 'ὴ' => 'i', 'ῂ' => 'i', - 'ῃ' => 'i', 'ῄ' => 'i', 'ῆ' => 'i', 'ῇ' => 'i', 'θ' => 't', 'ι' => 'i', - 'ί' => 'i', 'ϊ' => 'i', 'ΐ' => 'i', 'ἰ' => 'i', 'ἱ' => 'i', 'ἲ' => 'i', - 'ἳ' => 'i', 'ἴ' => 'i', 'ἵ' => 'i', 'ἶ' => 'i', 'ἷ' => 'i', 'ὶ' => 'i', - 'ῐ' => 'i', 'ῑ' => 'i', 'ῒ' => 'i', 'ῖ' => 'i', 'ῗ' => 'i', 'κ' => 'k', - 'λ' => 'l', 'μ' => 'm', 'ν' => 'n', 'ξ' => 'k', 'ο' => 'o', 'ό' => 'o', - 'ὀ' => 'o', 'ὁ' => 'o', 'ὂ' => 'o', 'ὃ' => 'o', 'ὄ' => 'o', 'ὅ' => 'o', - 'ὸ' => 'o', 'π' => 'p', 'ρ' => 'r', 'ῤ' => 'r', 'ῥ' => 'r', 'σ' => 's', - 'ς' => 's', 'τ' => 't', 'υ' => 'y', 'ύ' => 'y', 'ϋ' => 'y', 'ΰ' => 'y', - 'ὐ' => 'y', 'ὑ' => 'y', 'ὒ' => 'y', 'ὓ' => 'y', 'ὔ' => 'y', 'ὕ' => 'y', - 'ὖ' => 'y', 'ὗ' => 'y', 'ὺ' => 'y', 'ῠ' => 'y', 'ῡ' => 'y', 'ῢ' => 'y', - 'ῦ' => 'y', 'ῧ' => 'y', 'φ' => 'f', 'χ' => 'x', 'ψ' => 'p', 'ω' => 'o', - 'ώ' => 'o', 'ὠ' => 'o', 'ὡ' => 'o', 'ὢ' => 'o', 'ὣ' => 'o', 'ὤ' => 'o', - 'ὥ' => 'o', 'ὦ' => 'o', 'ὧ' => 'o', 'ᾠ' => 'o', 'ᾡ' => 'o', 'ᾢ' => 'o', - 'ᾣ' => 'o', 'ᾤ' => 'o', 'ᾥ' => 'o', 'ᾦ' => 'o', 'ᾧ' => 'o', 'ὼ' => 'o', - 'ῲ' => 'o', 'ῳ' => 'o', 'ῴ' => 'o', 'ῶ' => 'o', 'ῷ' => 'o', 'А' => 'A', - 'Б' => 'B', 'В' => 'V', 'Г' => 'G', 'Д' => 'D', 'Е' => 'E', 'Ё' => 'E', - 'Ж' => 'Z', 'З' => 'Z', 'И' => 'I', 'Й' => 'I', 'К' => 'K', 'Л' => 'L', - 'М' => 'M', 'Н' => 'N', 'О' => 'O', 'П' => 'P', 'Р' => 'R', 'С' => 'S', - 'Т' => 'T', 'У' => 'U', 'Ф' => 'F', 'Х' => 'K', 'Ц' => 'T', 'Ч' => 'C', - 'Ш' => 'S', 'Щ' => 'S', 'Ы' => 'Y', 'Э' => 'E', 'Ю' => 'Y', 'Я' => 'Y', - 'а' => 'A', 'б' => 'B', 'в' => 'V', 'г' => 'G', 'д' => 'D', 'е' => 'E', - 'ё' => 'E', 'ж' => 'Z', 'з' => 'Z', 'и' => 'I', 'й' => 'I', 'к' => 'K', - 'л' => 'L', 'м' => 'M', 'н' => 'N', 'о' => 'O', 'п' => 'P', 'р' => 'R', - 'с' => 'S', 'т' => 'T', 'у' => 'U', 'ф' => 'F', 'х' => 'K', 'ц' => 'T', - 'ч' => 'C', 'ш' => 'S', 'щ' => 'S', 'ы' => 'Y', 'э' => 'E', 'ю' => 'Y', - 'я' => 'Y', 'ð' => 'd', 'Ð' => 'D', 'þ' => 't', 'Þ' => 'T', 'ა' => 'a', - 'ბ' => 'b', 'გ' => 'g', 'დ' => 'd', 'ე' => 'e', 'ვ' => 'v', 'ზ' => 'z', - 'თ' => 't', 'ი' => 'i', 'კ' => 'k', 'ლ' => 'l', 'მ' => 'm', 'ნ' => 'n', - 'ო' => 'o', 'პ' => 'p', 'ჟ' => 'z', 'რ' => 'r', 'ს' => 's', 'ტ' => 't', - 'უ' => 'u', 'ფ' => 'p', 'ქ' => 'k', 'ღ' => 'g', 'ყ' => 'q', 'შ' => 's', - 'ჩ' => 'c', 'ც' => 't', 'ძ' => 'd', 'წ' => 't', 'ჭ' => 'c', 'ხ' => 'k', - 'ჯ' => 'j', 'ჰ' => 'h', 'ţ' => 't', 'ʼ' => "'", '̧' => '', 'ḩ' => 'h', - '‘' => "'", '’' => "'", 'ừ' => 'u', '/' => '', 'ế' => 'e', 'ả' => 'a', - 'ị' => 'i', 'ậ' => 'a', 'ệ' => 'e', 'ỉ' => 'i', 'ồ' => 'o', 'ề' => 'e', - 'ơ' => 'o', 'ạ' => 'a', 'ẵ' => 'a', 'ư' => 'u', 'ằ' => 'a', 'ầ' => 'a', - 'ḑ' => 'd', 'Ḩ' => 'H', 'Ḑ' => 'D', 'ș' => 's', 'ț' => 't', 'ộ' => 'o', - 'ắ' => 'a', 'ş' => 's', "'" => '', 'ու' => 'u', 'ա' => 'a', 'բ' => 'b', - 'գ' => 'g', 'դ' => 'd', 'ե' => 'e', 'զ' => 'z', 'է' => 'e', 'ը' => 'y', - 'թ' => 't', 'ժ' => 'zh', 'ի' => 'i', 'լ' => 'l', 'խ' => 'kh', 'ծ' => 'ts', - 'կ' => 'k', 'հ' => 'h', 'ձ' => 'dz', 'ղ' => 'gh', 'ճ' => 'ch', 'մ' => 'm', - 'յ' => 'y', 'ն' => 'n', 'շ' => 'sh', 'ո' => 'o', 'չ' => 'ch', 'պ' => 'p', - 'ջ' => 'j', 'ռ' => 'r', 'ս' => 's', 'վ' => 'v', 'տ' => 't', 'ր' => 'r', - 'ց' => 'ts', 'փ' => 'p', 'ք' => 'q', 'և' => 'ev', 'օ' => 'o', 'ֆ' => 'f', - ]; - $arrayFrom = array_keys($transliterationTable); - $arrayTo = array_values($transliterationTable); - } - - return str_replace($arrayFrom, $arrayTo, $string); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/Lorem.php b/vendor/fakerphp/faker/src/Faker/Provider/Lorem.php deleted file mode 100644 index a55144a5..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/Lorem.php +++ /dev/null @@ -1,220 +0,0 @@ -generator->parse('{{bloodType}}{{bloodRh}}'); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/Miscellaneous.php b/vendor/fakerphp/faker/src/Faker/Provider/Miscellaneous.php deleted file mode 100644 index 91d992ec..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/Miscellaneous.php +++ /dev/null @@ -1,341 +0,0 @@ - [ - '4539###########', - '4556###########', - '4916###########', - '4532###########', - '4929###########', - '40240071#######', - '4485###########', - '4716###########', - '4##############', - ], - 'Visa Retired' => [ - '4539########', - '4556########', - '4916########', - '4532########', - '4929########', - '40240071####', - '4485########', - '4716########', - '4###########', - ], - 'MasterCard' => [ - '2221###########', - '23#############', - '24#############', - '25#############', - '26#############', - '2720###########', - '51#############', - '52#############', - '53#############', - '54#############', - '55#############', - ], - 'American Express' => [ - '34############', - '37############', - ], - 'Discover Card' => [ - '6011###########', - ], - 'JCB' => [ - '3528###########', - '3589###########', - ], - ]; - - /** - * @var array list of IBAN formats, source: @see https://www.swift.com/standards/data-standards/iban - */ - protected static $ibanFormats = [ - 'AD' => [['n', 4], ['n', 4], ['c', 12]], - 'AE' => [['n', 3], ['n', 16]], - 'AL' => [['n', 8], ['c', 16]], - 'AT' => [['n', 5], ['n', 11]], - 'AZ' => [['a', 4], ['c', 20]], - 'BA' => [['n', 3], ['n', 3], ['n', 8], ['n', 2]], - 'BE' => [['n', 3], ['n', 7], ['n', 2]], - 'BG' => [['a', 4], ['n', 4], ['n', 2], ['c', 8]], - 'BH' => [['a', 4], ['c', 14]], - 'BR' => [['n', 8], ['n', 5], ['n', 10], ['a', 1], ['c', 1]], - 'CH' => [['n', 5], ['c', 12]], - 'CR' => [['n', 4], ['n', 14]], - 'CY' => [['n', 3], ['n', 5], ['c', 16]], - 'CZ' => [['n', 4], ['n', 6], ['n', 10]], - 'DE' => [['n', 8], ['n', 10]], - 'DK' => [['n', 4], ['n', 9], ['n', 1]], - 'DO' => [['c', 4], ['n', 20]], - 'EE' => [['n', 2], ['n', 2], ['n', 11], ['n', 1]], - 'EG' => [['n', 4], ['n', 4], ['n', 17]], - 'ES' => [['n', 4], ['n', 4], ['n', 1], ['n', 1], ['n', 10]], - 'FI' => [['n', 6], ['n', 7], ['n', 1]], - 'FR' => [['n', 5], ['n', 5], ['c', 11], ['n', 2]], - 'GB' => [['a', 4], ['n', 6], ['n', 8]], - 'GE' => [['a', 2], ['n', 16]], - 'GI' => [['a', 4], ['c', 15]], - 'GR' => [['n', 3], ['n', 4], ['c', 16]], - 'GT' => [['c', 4], ['c', 20]], - 'HR' => [['n', 7], ['n', 10]], - 'HU' => [['n', 3], ['n', 4], ['n', 1], ['n', 15], ['n', 1]], - 'IE' => [['a', 4], ['n', 6], ['n', 8]], - 'IL' => [['n', 3], ['n', 3], ['n', 13]], - 'IS' => [['n', 4], ['n', 2], ['n', 6], ['n', 10]], - 'IT' => [['a', 1], ['n', 5], ['n', 5], ['c', 12]], - 'KW' => [['a', 4], ['n', 22]], - 'KZ' => [['n', 3], ['c', 13]], - 'LB' => [['n', 4], ['c', 20]], - 'LI' => [['n', 5], ['c', 12]], - 'LT' => [['n', 5], ['n', 11]], - 'LU' => [['n', 3], ['c', 13]], - 'LV' => [['a', 4], ['c', 13]], - 'MC' => [['n', 5], ['n', 5], ['c', 11], ['n', 2]], - 'MD' => [['c', 2], ['c', 18]], - 'ME' => [['n', 3], ['n', 13], ['n', 2]], - 'MK' => [['n', 3], ['c', 10], ['n', 2]], - 'MR' => [['n', 5], ['n', 5], ['n', 11], ['n', 2]], - 'MT' => [['a', 4], ['n', 5], ['c', 18]], - 'MU' => [['a', 4], ['n', 2], ['n', 2], ['n', 12], ['n', 3], ['a', 3]], - 'NL' => [['a', 4], ['n', 10]], - 'NO' => [['n', 4], ['n', 6], ['n', 1]], - 'PK' => [['a', 4], ['c', 16]], - 'PL' => [['n', 8], ['n', 16]], - 'PS' => [['a', 4], ['c', 21]], - 'PT' => [['n', 4], ['n', 4], ['n', 11], ['n', 2]], - 'RO' => [['a', 4], ['c', 16]], - 'RS' => [['n', 3], ['n', 13], ['n', 2]], - 'SA' => [['n', 2], ['c', 18]], - 'SE' => [['n', 3], ['n', 16], ['n', 1]], - 'SI' => [['n', 5], ['n', 8], ['n', 2]], - 'SK' => [['n', 4], ['n', 6], ['n', 10]], - 'SM' => [['a', 1], ['n', 5], ['n', 5], ['c', 12]], - 'TN' => [['n', 2], ['n', 3], ['n', 13], ['n', 2]], - 'TR' => [['n', 5], ['n', 1], ['c', 16]], - 'VG' => [['a', 4], ['n', 16]], - ]; - - /** - * @return string Returns a credit card vendor name - * - * @example 'MasterCard' - */ - public static function creditCardType() - { - return static::randomElement(static::$cardVendors); - } - - /** - * Returns the String of a credit card number. - * - * @param string $type Supporting any of 'Visa', 'MasterCard', 'American Express', 'Discover' and 'JCB' - * @param bool $formatted Set to true if the output string should contain one separator every 4 digits - * @param string $separator Separator string for formatting card number. Defaults to dash (-). - * - * @return string - * - * @example '4485480221084675' - */ - public static function creditCardNumber($type = null, $formatted = false, $separator = '-') - { - if (null === $type) { - $type = static::creditCardType(); - } - $mask = static::randomElement(static::$cardParams[$type]); - - $number = static::numerify($mask); - $number .= Luhn::computeCheckDigit($number); - - if ($formatted) { - $p1 = substr($number, 0, 4); - $p2 = substr($number, 4, 4); - $p3 = substr($number, 8, 4); - $p4 = substr($number, 12); - $number = $p1 . $separator . $p2 . $separator . $p3 . $separator . $p4; - } - - return $number; - } - - /** - * @param bool $valid True (by default) to get a valid expiration date, false to get a maybe valid date - * - * @return \DateTime - * - * @example 04/13 - */ - public function creditCardExpirationDate($valid = true) - { - if ($valid) { - return $this->generator->dateTimeBetween('now', '36 months'); - } - - return $this->generator->dateTimeBetween('-36 months', '36 months'); - } - - /** - * @param bool $valid True (by default) to get a valid expiration date, false to get a maybe valid date - * @param string $expirationDateFormat - * - * @return string - * - * @example '04/13' - */ - public function creditCardExpirationDateString($valid = true, $expirationDateFormat = null) - { - return $this->creditCardExpirationDate($valid)->format(null === $expirationDateFormat ? static::$expirationDateFormat : $expirationDateFormat); - } - - /** - * @param bool $valid True (by default) to get a valid expiration date, false to get a maybe valid date - * - * @return array - */ - public function creditCardDetails($valid = true) - { - $type = static::creditCardType(); - - return [ - 'type' => $type, - 'number' => static::creditCardNumber($type), - 'name' => $this->generator->name(), - 'expirationDate' => $this->creditCardExpirationDateString($valid), - ]; - } - - /** - * International Bank Account Number (IBAN) - * - * @see http://en.wikipedia.org/wiki/International_Bank_Account_Number - * - * @param string $countryCode ISO 3166-1 alpha-2 country code - * @param string $prefix for generating bank account number of a specific bank - * @param int $length total length without country code and 2 check digits - * - * @return string - */ - public static function iban($countryCode = null, $prefix = '', $length = null) - { - $countryCode = null === $countryCode ? self::randomKey(self::$ibanFormats) : strtoupper($countryCode); - - $format = !isset(static::$ibanFormats[$countryCode]) ? null : static::$ibanFormats[$countryCode]; - - if ($length === null) { - if ($format === null) { - $length = 24; - } else { - $length = 0; - - foreach ($format as $part) { - [$class, $groupCount] = $part; - $length += $groupCount; - } - } - } - - if ($format === null) { - $format = [['n', $length]]; - } - - $expandedFormat = ''; - - foreach ($format as $item) { - [$class, $length] = $item; - $expandedFormat .= str_repeat($class, $length); - } - - $result = $prefix; - $expandedFormat = substr($expandedFormat, strlen($result)); - - foreach (str_split($expandedFormat) as $class) { - switch ($class) { - default: - case 'c': - $result .= Miscellaneous::boolean() ? static::randomDigit() : strtoupper(static::randomLetter()); - - break; - - case 'a': - $result .= strtoupper(static::randomLetter()); - - break; - - case 'n': - $result .= static::randomDigit(); - - break; - } - } - - $checksum = Iban::checksum($countryCode . '00' . $result); - - return $countryCode . $checksum . $result; - } - - /** - * Return the String of a SWIFT/BIC number - * - * @example 'RZTIAT22263' - * - * @see http://en.wikipedia.org/wiki/ISO_9362 - * - * @return string Swift/Bic number - */ - public static function swiftBicNumber() - { - return self::regexify('^([A-Z]){4}([A-Z]){2}([0-9A-Z]){2}([0-9A-Z]{3})?$'); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/Person.php b/vendor/fakerphp/faker/src/Faker/Provider/Person.php deleted file mode 100644 index c11a72bd..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/Person.php +++ /dev/null @@ -1,147 +0,0 @@ -generator->parse($format); - } - - /** - * @param string|null $gender 'male', 'female' or null for any - * - * @return string - * - * @example 'John' - */ - public function firstName($gender = null) - { - if ($gender === static::GENDER_MALE) { - return static::firstNameMale(); - } - - if ($gender === static::GENDER_FEMALE) { - return static::firstNameFemale(); - } - - return $this->generator->parse(static::randomElement(static::$firstNameFormat)); - } - - /** - * @return string - */ - public static function firstNameMale() - { - return static::randomElement(static::$firstNameMale); - } - - /** - * @return string - */ - public static function firstNameFemale() - { - return static::randomElement(static::$firstNameFemale); - } - - /** - * @example 'Doe' - * - * @return string - */ - public function lastName() - { - return static::randomElement(static::$lastName); - } - - /** - * @example 'Mrs.' - * - * @param string|null $gender 'male', 'female' or null for any - * - * @return string - */ - public function title($gender = null) - { - if ($gender === static::GENDER_MALE) { - return static::titleMale(); - } - - if ($gender === static::GENDER_FEMALE) { - return static::titleFemale(); - } - - return $this->generator->parse(static::randomElement(static::$titleFormat)); - } - - /** - * @example 'Mr.' - * - * @return string - */ - public static function titleMale() - { - return static::randomElement(static::$titleMale); - } - - /** - * @example 'Mrs.' - * - * @return string - */ - public static function titleFemale() - { - return static::randomElement(static::$titleFemale); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/PhoneNumber.php b/vendor/fakerphp/faker/src/Faker/Provider/PhoneNumber.php deleted file mode 100644 index 515ef57e..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/PhoneNumber.php +++ /dev/null @@ -1,270 +0,0 @@ -generator->parse(static::randomElement(static::$formats))); - } - - /** - * @example +11134567890 - * - * @return string - */ - public function e164PhoneNumber() - { - return static::numerify($this->generator->parse(static::randomElement(static::$e164Formats))); - } - - /** - * International Mobile Equipment Identity (IMEI) - * - * @see http://en.wikipedia.org/wiki/International_Mobile_Station_Equipment_Identity - * @see http://imei-number.com/imei-validation-check/ - * - * @example '720084494799532' - * - * @return int $imei - */ - public function imei() - { - $imei = (string) static::numerify('##############'); - $imei .= Luhn::computeCheckDigit($imei); - - return $imei; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/Text.php b/vendor/fakerphp/faker/src/Faker/Provider/Text.php deleted file mode 100644 index 585d5b5a..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/Text.php +++ /dev/null @@ -1,202 +0,0 @@ -realTextBetween((int) round($maxNbChars * 0.8), $maxNbChars, $indexSize); - } - - /** - * Generate a text string by the Markov chain algorithm. - * - * Depending on the $maxNbChars, returns a random valid looking text. The algorithm - * generates a weighted table with the specified number of words as the index and the - * possible following words as the value. - * - * @example 'Alice, swallowing down her flamingo, and began by taking the little golden key' - * - * @param int $minNbChars Minimum number of characters the text should contain (maximum: 8) - * @param int $maxNbChars Maximum number of characters the text should contain (minimum: 10) - * @param int $indexSize Determines how many words are considered for the generation of the next word. - * The minimum is 1, and it produces a higher level of randomness, although the - * generated text usually doesn't make sense. Higher index sizes (up to 5) - * produce more correct text, at the price of less randomness. - * - * @return string - */ - public function realTextBetween($minNbChars = 160, $maxNbChars = 200, $indexSize = 2) - { - if ($minNbChars < 1) { - throw new \InvalidArgumentException('minNbChars must be at least 1'); - } - - if ($maxNbChars < 10) { - throw new \InvalidArgumentException('maxNbChars must be at least 10'); - } - - if ($indexSize < 1) { - throw new \InvalidArgumentException('indexSize must be at least 1'); - } - - if ($indexSize > 5) { - throw new \InvalidArgumentException('indexSize must be at most 5'); - } - - if ($minNbChars >= $maxNbChars) { - throw new \InvalidArgumentException('minNbChars must be smaller than maxNbChars'); - } - - $words = $this->getConsecutiveWords($indexSize); - $iterations = 0; - - do { - ++$iterations; - - if ($iterations >= 100) { - throw new \OverflowException(sprintf('Maximum retries of %d reached without finding a valid real text', $iterations)); - } - - $result = $this->generateText($maxNbChars, $words); - } while (static::strlen($result) <= $minNbChars); - - return $result; - } - - /** - * @param int $maxNbChars - * @param array $words - * - * @return string - */ - protected function generateText($maxNbChars, $words) - { - $result = []; - $resultLength = 0; - // take a random starting point - $next = static::randomKey($words); - - while ($resultLength < $maxNbChars && isset($words[$next])) { - // fetch a random word to append - $word = static::randomElement($words[$next]); - - // calculate next index - $currentWords = static::explode($next); - $currentWords[] = $word; - array_shift($currentWords); - $next = static::implode($currentWords); - - // ensure text starts with an uppercase letter - if ($resultLength == 0 && !static::validStart($word)) { - continue; - } - - // append the element - $result[] = $word; - $resultLength += static::strlen($word) + static::$separatorLen; - } - - // remove the element that caused the text to overflow - array_pop($result); - - // build result - $result = static::implode($result); - - return static::appendEnd($result); - } - - protected function getConsecutiveWords($indexSize) - { - if (!isset($this->consecutiveWords[$indexSize])) { - $parts = $this->getExplodedText(); - $words = []; - $index = []; - - for ($i = 0; $i < $indexSize; ++$i) { - $index[] = array_shift($parts); - } - - for ($i = 0, $count = count($parts); $i < $count; ++$i) { - $stringIndex = static::implode($index); - - if (!isset($words[$stringIndex])) { - $words[$stringIndex] = []; - } - $word = $parts[$i]; - $words[$stringIndex][] = $word; - array_shift($index); - $index[] = $word; - } - // cache look up words for performance - $this->consecutiveWords[$indexSize] = $words; - } - - return $this->consecutiveWords[$indexSize]; - } - - protected function getExplodedText() - { - if ($this->explodedText === null) { - $this->explodedText = static::explode(preg_replace('/\s+/u', ' ', static::$baseText)); - } - - return $this->explodedText; - } - - protected static function explode($text) - { - return explode(static::$separator, $text); - } - - protected static function implode($words) - { - return implode(static::$separator, $words); - } - - protected static function strlen($text) - { - return function_exists('mb_strlen') ? mb_strlen($text, 'UTF-8') : strlen($text); - } - - protected static function validStart($word) - { - $isValid = true; - - if (static::$textStartsWithUppercase) { - $isValid = preg_match('/^\p{Lu}/u', $word); - } - - return $isValid; - } - - protected static function appendEnd($text) - { - return preg_replace("/([ ,-:;\x{2013}\x{2014}]+$)/us", '', $text) . '.'; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/UserAgent.php b/vendor/fakerphp/faker/src/Faker/Provider/UserAgent.php deleted file mode 100644 index 752df4d3..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/UserAgent.php +++ /dev/null @@ -1,219 +0,0 @@ -> 8) | (($tLo & 0xff000000) >> 24); - $tMi = (($tMi & 0x00ff) << 8) | (($tMi & 0xff00) >> 8); - $tHi = (($tHi & 0x00ff) << 8) | (($tHi & 0xff00) >> 8); - } - - // apply version number - $tHi &= 0x0fff; - $tHi |= (3 << 12); - - // cast to string - return sprintf( - '%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x', - $tLo, - $tMi, - $tHi, - $csHi, - $csLo, - $byte[10], - $byte[11], - $byte[12], - $byte[13], - $byte[14], - $byte[15], - ); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/ar_EG/Address.php b/vendor/fakerphp/faker/src/Faker/Provider/ar_EG/Address.php deleted file mode 100644 index 8fe73f50..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/ar_EG/Address.php +++ /dev/null @@ -1,207 +0,0 @@ -generator->parse($format)); - } - - /** - * @example 'wewebit.jo' - */ - public function domainName() - { - return static::randomElement(static::$lastNameAscii) . '.' . $this->tld(); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/ar_EG/Payment.php b/vendor/fakerphp/faker/src/Faker/Provider/ar_EG/Payment.php deleted file mode 100644 index 1e2eaaf0..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/ar_EG/Payment.php +++ /dev/null @@ -1,16 +0,0 @@ -generator->parse($format)); - } - - /** - * @example 'wewebit.jo' - */ - public function domainName() - { - return static::randomElement(static::$lastNameAscii) . '.' . $this->tld(); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/ar_JO/Person.php b/vendor/fakerphp/faker/src/Faker/Provider/ar_JO/Person.php deleted file mode 100644 index 27db4e54..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/ar_JO/Person.php +++ /dev/null @@ -1,108 +0,0 @@ -generator->parse($format)); - } - - /** - * @example 'wewebit.jo' - */ - public function domainName() - { - return static::randomElement(static::$lastNameAscii) . '.' . $this->tld(); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/ar_SA/Payment.php b/vendor/fakerphp/faker/src/Faker/Provider/ar_SA/Payment.php deleted file mode 100644 index a09a281d..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/ar_SA/Payment.php +++ /dev/null @@ -1,22 +0,0 @@ -generator->parse(static::randomElement(static::$lastNameFormat)); - } - - public static function lastNameMale() - { - return static::randomElement(static::$lastNameMale); - } - - public static function lastNameFemale() - { - return static::randomElement(static::$lastNameFemale); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/bg_BG/PhoneNumber.php b/vendor/fakerphp/faker/src/Faker/Provider/bg_BG/PhoneNumber.php deleted file mode 100644 index 22051df4..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/bg_BG/PhoneNumber.php +++ /dev/null @@ -1,20 +0,0 @@ -generator->parse($format)); - } - - /** - * Generates valid czech IČO - * - * @see http://phpfashion.com/jak-overit-platne-ic-a-rodne-cislo - * - * @return string - */ - public function ico() - { - $ico = static::numerify('#######'); - $split = str_split($ico); - $prod = 0; - - foreach ([8, 7, 6, 5, 4, 3, 2] as $i => $p) { - $prod += $p * $split[$i]; - } - $mod = $prod % 11; - - if ($mod === 0 || $mod === 10) { - return "{$ico}1"; - } - - if ($mod === 1) { - return "{$ico}0"; - } - - return $ico . (11 - $mod); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/cs_CZ/DateTime.php b/vendor/fakerphp/faker/src/Faker/Provider/cs_CZ/DateTime.php deleted file mode 100644 index e136e651..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/cs_CZ/DateTime.php +++ /dev/null @@ -1,65 +0,0 @@ -format('w')]; - } - - /** - * @param \DateTime|int|string $max maximum timestamp used as random end limit, default to "now" - * - * @return string - * - * @example '2' - */ - public static function dayOfMonth($max = 'now') - { - return static::dateTime($max)->format('j'); - } - - /** - * Full date with inflected month - * - * @return string - * - * @example '16. listopadu 2003' - */ - public function formattedDate() - { - $format = static::randomElement(static::$formattedDateFormat); - - return $this->generator->parse($format); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/cs_CZ/Internet.php b/vendor/fakerphp/faker/src/Faker/Provider/cs_CZ/Internet.php deleted file mode 100644 index ce5b2661..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/cs_CZ/Internet.php +++ /dev/null @@ -1,9 +0,0 @@ -generator->boolean() ? static::GENDER_MALE : static::GENDER_FEMALE; - } - - $startTimestamp = strtotime("-${maxAge} year"); - $endTimestamp = strtotime("-${minAge} year"); - $randTimestamp = self::numberBetween($startTimestamp, $endTimestamp); - - $year = (int) (date('Y', $randTimestamp)); - $month = (int) (date('n', $randTimestamp)); - $day = (int) (date('j', $randTimestamp)); - $suffix = self::numberBetween(0, 999); - - // women has +50 to month - if ($gender == static::GENDER_FEMALE) { - $month += 50; - } - // from year 2004 everyone has +20 to month when birth numbers in one day are exhausted - if ($year >= 2004 && $this->generator->boolean(10)) { - $month += 20; - } - - $birthNumber = sprintf('%02d%02d%02d%03d', $year % 100, $month, $day, $suffix); - - // from year 1954 birth number includes CRC - if ($year >= 1954) { - $crc = intval($birthNumber, 10) % 11; - - if ($crc == 10) { - $crc = 0; - } - $birthNumber .= sprintf('%d', $crc); - } - - // add slash - if ($this->generator->boolean($slashProbability)) { - $birthNumber = substr($birthNumber, 0, 6) . '/' . substr($birthNumber, 6); - } - - return $birthNumber; - } - - public static function birthNumberMale() - { - return static::birthNumber(static::GENDER_MALE); - } - - public static function birthNumberFemale() - { - return static::birthNumber(static::GENDER_FEMALE); - } - - public function title($gender = null) - { - return static::titleMale(); - } - - /** - * replaced by specific unisex Czech title - */ - public static function titleMale() - { - return static::randomElement(static::$title); - } - - /** - * replaced by specific unisex Czech title - */ - public static function titleFemale() - { - return static::titleMale(); - } - - /** - * @param string|null $gender 'male', 'female' or null for any - * - * @example 'Albrecht' - */ - public function lastName($gender = null) - { - if ($gender === static::GENDER_MALE) { - return static::lastNameMale(); - } - - if ($gender === static::GENDER_FEMALE) { - return static::lastNameFemale(); - } - - return $this->generator->parse(static::randomElement(static::$lastNameFormat)); - } - - public static function lastNameMale() - { - return static::randomElement(static::$lastNameMale); - } - - public static function lastNameFemale() - { - return static::randomElement(static::$lastNameFemale); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/cs_CZ/PhoneNumber.php b/vendor/fakerphp/faker/src/Faker/Provider/cs_CZ/PhoneNumber.php deleted file mode 100644 index a527a254..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/cs_CZ/PhoneNumber.php +++ /dev/null @@ -1,14 +0,0 @@ -format('dmy'), static::numerify('%###')); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/da_DK/PhoneNumber.php b/vendor/fakerphp/faker/src/Faker/Provider/da_DK/PhoneNumber.php deleted file mode 100644 index 6e8c28da..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/da_DK/PhoneNumber.php +++ /dev/null @@ -1,18 +0,0 @@ -format('dmy'); - - do { - $consecutiveNumber = (string) self::numberBetween(100, 999); - - $verificationNumber = ( - (int) $consecutiveNumber[0] * 3 - + (int) $consecutiveNumber[1] * 7 - + (int) $consecutiveNumber[2] * 9 - + (int) $birthDateString[0] * 5 - + (int) $birthDateString[1] * 8 - + (int) $birthDateString[2] * 4 - + (int) $birthDateString[3] * 2 - + (int) $birthDateString[4] * 1 - + (int) $birthDateString[5] * 6 - ) % 11; - } while ($verificationNumber == 10); - - return sprintf('%s%s%s', $consecutiveNumber, $verificationNumber, $birthDateString); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/de_AT/PhoneNumber.php b/vendor/fakerphp/faker/src/Faker/Provider/de_AT/PhoneNumber.php deleted file mode 100644 index 00fbe676..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/de_AT/PhoneNumber.php +++ /dev/null @@ -1,23 +0,0 @@ - 'Aargau'], - ['AI' => 'Appenzell Innerrhoden'], - ['AR' => 'Appenzell Ausserrhoden'], - ['BE' => 'Bern'], - ['BL' => 'Basel-Landschaft'], - ['BS' => 'Basel-Stadt'], - ['FR' => 'Freiburg'], - ['GE' => 'Genf'], - ['GL' => 'Glarus'], - ['GR' => 'Graubünden'], - ['JU' => 'Jura'], - ['LU' => 'Luzern'], - ['NE' => 'Neuenburg'], - ['NW' => 'Nidwalden'], - ['OW' => 'Obwalden'], - ['SG' => 'St. Gallen'], - ['SH' => 'Schaffhausen'], - ['SO' => 'Solothurn'], - ['SZ' => 'Schwyz'], - ['TG' => 'Thurgau'], - ['TI' => 'Tessin'], - ['UR' => 'Uri'], - ['VD' => 'Waadt'], - ['VS' => 'Wallis'], - ['ZG' => 'Zug'], - ['ZH' => 'Zürich'], - ]; - - protected static $country = [ - 'Afghanistan', 'Alandinseln', 'Albanien', 'Algerien', 'Amerikanisch-Ozeanien', 'Amerikanisch-Samoa', 'Amerikanische Jungferninseln', 'Andorra', 'Angola', 'Anguilla', 'Antarktis', 'Antigua und Barbuda', 'Argentinien', 'Armenien', 'Aruba', 'Aserbaidschan', 'Australien', 'Ägypten', 'Äquatorialguinea', 'Äthiopien', 'Äusseres Ozeanien', - 'Bahamas', 'Bahrain', 'Bangladesch', 'Barbados', 'Belarus', 'Belgien', 'Belize', 'Benin', 'Bermuda', 'Bhutan', 'Bolivien', 'Bosnien und Herzegowina', 'Botsuana', 'Bouvetinsel', 'Brasilien', 'Britische Jungferninseln', 'Britisches Territorium im Indischen Ozean', 'Brunei Darussalam', 'Bulgarien', 'Burkina Faso', 'Burundi', - 'Chile', 'China', 'Cookinseln', 'Costa Rica', 'Côte d’Ivoire', - 'Demokratische Republik Kongo', 'Demokratische Volksrepublik Korea', 'Deutschland', 'Dominica', 'Dominikanische Republik', 'Dschibuti', 'Dänemark', - 'Ecuador', 'El Salvador', 'Eritrea', 'Estland', 'Europäische Union', - 'Falklandinseln', 'Fidschi', 'Finnland', 'Frankreich', 'Französisch-Guayana', 'Französisch-Polynesien', 'Französische Süd- und Antarktisgebiete', 'Färöer', - 'Gabun', 'Gambia', 'Georgien', 'Ghana', 'Gibraltar', 'Grenada', 'Griechenland', 'Grönland', 'Guadeloupe', 'Guam', 'Guatemala', 'Guernsey', 'Guinea', 'Guinea-Bissau', 'Guyana', - 'Haiti', 'Heard- und McDonald-Inseln', 'Honduras', - 'Indien', 'Indonesien', 'Irak', 'Iran', 'Irland', 'Island', 'Isle of Man', 'Israel', 'Italien', - 'Jamaika', 'Japan', 'Jemen', 'Jersey', 'Jordanien', - 'Kaimaninseln', 'Kambodscha', 'Kamerun', 'Kanada', 'Kap Verde', 'Kasachstan', 'Katar', 'Kenia', 'Kirgisistan', 'Kiribati', 'Kokosinseln', 'Kolumbien', 'Komoren', 'Kongo', 'Kroatien', 'Kuba', 'Kuwait', - 'Laos', 'Lesotho', 'Lettland', 'Libanon', 'Liberia', 'Libyen', 'Liechtenstein', 'Litauen', 'Luxemburg', - 'Madagaskar', 'Malawi', 'Malaysia', 'Malediven', 'Mali', 'Malta', 'Marokko', 'Marshallinseln', 'Martinique', 'Mauretanien', 'Mauritius', 'Mayotte', 'Mazedonien', 'Mexiko', 'Mikronesien', 'Monaco', 'Mongolei', 'Montenegro', 'Montserrat', 'Mosambik', 'Myanmar', - 'Namibia', 'Nauru', 'Nepal', 'Neukaledonien', 'Neuseeland', 'Nicaragua', 'Niederlande', 'Niederländische Antillen', 'Niger', 'Nigeria', 'Niue', 'Norfolkinsel', 'Norwegen', 'Nördliche Marianen', - 'Oman', 'Osttimor', 'Österreich', - 'Pakistan', 'Palau', 'Palästinensische Gebiete', 'Panama', 'Papua-Neuguinea', 'Paraguay', 'Peru', 'Philippinen', 'Pitcairn', 'Polen', 'Portugal', 'Puerto Rico', - 'Republik Korea', 'Republik Moldau', 'Ruanda', 'Rumänien', 'Russische Föderation', 'Réunion', - 'Salomonen', 'Sambia', 'Samoa', 'San Marino', 'Saudi-Arabien', 'Schweden', 'Schweiz', 'Senegal', 'Serbien', 'Serbien und Montenegro', 'Seychellen', 'Sierra Leone', 'Simbabwe', 'Singapur', 'Slowakei', 'Slowenien', 'Somalia', 'Sonderverwaltungszone Hongkong', 'Sonderverwaltungszone Macao', 'Spanien', 'Sri Lanka', 'St. Barthélemy', 'St. Helena', 'St. Kitts und Nevis', 'St. Lucia', 'St. Martin', 'St. Pierre und Miquelon', 'St. Vincent und die Grenadinen', 'Sudan', 'Suriname', 'Svalbard und Jan Mayen', 'Swasiland', 'Syrien', 'São Tomé und Príncipe', 'Südafrika', 'Südgeorgien und die Südlichen Sandwichinseln', - 'Tadschikistan', 'Taiwan', 'Tansania', 'Thailand', 'Togo', 'Tokelau', 'Tonga', 'Trinidad und Tobago', 'Tschad', 'Tschechische Republik', 'Tunesien', 'Turkmenistan', 'Turks- und Caicosinseln', 'Tuvalu', 'Türkei', - 'Uganda', 'Ukraine', 'Unbekannte oder ungültige Region', 'Ungarn', 'Uruguay', 'Usbekistan', - 'Vanuatu', 'Vatikanstadt', 'Venezuela', 'Vereinigte Arabische Emirate', 'Vereinigte Staaten', 'Vereinigtes Königreich', 'Vietnam', - 'Wallis und Futuna', 'Weihnachtsinsel', 'Westsahara', - 'Zentralafrikanische Republik', 'Zypern', - ]; - - protected static $cityFormats = [ - '{{cityName}}', - ]; - - protected static $streetNameFormats = [ - '{{lastName}}{{streetSuffixShort}}', - '{{cityName}}{{streetSuffixShort}}', - '{{firstName}}-{{lastName}}-{{streetSuffixLong}}', - ]; - - protected static $streetAddressFormats = [ - '{{streetName}} {{buildingNumber}}', - ]; - protected static $addressFormats = [ - "{{streetAddress}}\n{{postcode}} {{city}}", - ]; - - /** - * Returns a random city name. - * - * @example Luzern - * - * @return string - */ - public function cityName() - { - return static::randomElement(static::$cityNames); - } - - /** - * Returns a random street suffix. - * - * @example str. - * - * @return string - */ - public function streetSuffixShort() - { - return static::randomElement(static::$streetSuffixShort); - } - - /** - * Returns a random street suffix. - * - * @example Strasse - * - * @return string - */ - public function streetSuffixLong() - { - return static::randomElement(static::$streetSuffixLong); - } - - /** - * Returns a canton - * - * @example array('BE' => 'Bern') - * - * @return array - */ - public static function canton() - { - return static::randomElement(static::$canton); - } - - /** - * Returns the abbreviation of a canton. - * - * @return string - */ - public static function cantonShort() - { - $canton = static::canton(); - - return key($canton); - } - - /** - * Returns the name of canton. - * - * @return string - */ - public static function cantonName() - { - $canton = static::canton(); - - return current($canton); - } - - public static function buildingNumber() - { - return static::regexify(self::numerify(static::randomElement(static::$buildingNumber))); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/de_CH/Company.php b/vendor/fakerphp/faker/src/Faker/Provider/de_CH/Company.php deleted file mode 100644 index ead2781e..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/de_CH/Company.php +++ /dev/null @@ -1,15 +0,0 @@ - - */ - protected static $areaCodeRegexes = [ - 2 => '(0[0-389]|0[4-6][1-68]|1[124]|1[0-9][0-9]|2[18]|2[0-9][1-9]|3[14]|3[0-35-9][0-9]|4[1]|4[02-8][0-9]|5[1]|5[02-9][0-9]|6[1]|6[02-9][0-9]|7[1]|7[2-7][0-9]|8[1]|8[02-7][0-9]|9[1]|9[02-9][0-9])', - 3 => '(0|3[15]|3[02-46-9][1-9]|3[02-46-9][02-9][0-9]|4[015]|4[2-4679][1-8]|4[2-4679][02-9][0-9]|5[15]|5[02-46-9][1-9]|5[02-46-9][02-9][0-9]|6[15]|6[02-46-9][1-9]|6[02-46-9][02-9][0-9]|7[15]|7[2-467][1-7]|7[2-467][02-689][0-9]|8[15]|8[2-46-8][013-9]|8[2-46-8][02-9][0-9]|9[15]|9[02-46-9][1-9]|9[02-46-9][02-9][0-9])', - 4 => '(0|1[02-9][0-9]|2[1]|2[02-9][0-9]|3[1]|3[02-9][0-9]|4[1]|4[0-9][0-9]|5[1]|5[02-6][0-9]|6[1]|6[02-8][0-9]|7[1]|7[02-79][0-9]|8[1]|8[02-9][0-9]|9[1]|9[02-7][0-9])', - 5 => '(0[2-8][0-9]|1[1]|1[02-9][0-9]|2[1]|2[02-9][1-9]|3[1]|3[02-8][0-9]|4[1]|4[02-9][1-9]|5[1]|5[02-9][0-9]|6[1]|6[02-9][0-9]|7[1]|7[02-7][1-9]|8[1]|8[02-8][0-9]|9[1]|9[0-7][1-9])', - 6 => '(0[02-9][0-9]|1[1]|1[02-9][0-9]|2[1]|2[02-9][0-9]|3[1]|3[02-9][0-9]|4[1]|4[0-8][0-9]|5[1]|5[02-9][0-9]|6[1]|6[2-9][0-9]|7[1]|7[02-8][1-9]|8[1]|8[02-9][1-9]|9)', - 7 => '(0[2-8][1-6]|1[1]|1[2-9][0-9]|2[1]|2[0-7][0-9]|3[1]|3[02-9][0-9]|4[1]|4[0-8][0-9]|5[1]|5[02-8][0-9]|6[1]|6[02-8][0-9]|7[1]|7[02-7][0-9]|8[1]|8[02-5][1-9]|9[1]|9[03-7][0-9])', - 8 => '(0[2-9][0-9]|1[1]|1[02-79][0-9]|2[1]|2[02-9][0-9]|3[1]|3[02-9][0-9]|4[1]|4[02-6][0-9]|5[1]|5[02-9][0-9]|6[1]|6[2-8][0-9]|7[1]|7[02-8][1-9]|8[1]|8[02-6][0-9]|9)', - 9 => '(0[6]|0[07-9][0-9]|1[1]|1[02-9][0-9]|2[1]|2[02-9][0-9]|3[1]|3[02-9][0-9]|4[1]|4[02-9][0-9]|5[1]|5[02-7][0-9]|6[1]|6[02-8][1-9]|7[1]|7[02-467][0-9]|8[1]|8[02-7][0-9]|9[1]|9[02-7][0-9])', - ]; - - /** - * @see https://en.wikipedia.org/wiki/National_conventions_for_writing_telephone_numbers#Germany - * @see https://www.itu.int/oth/T0202000051/en - * @see https://en.wikipedia.org/wiki/Telephone_numbers_in_Germany - */ - protected static $formats = [ - // International format - '+49 {{areaCode}} #######', - '+49 {{areaCode}} ### ####', - '+49 (0{{areaCode}}) #######', - '+49 (0{{areaCode}}) ### ####', - '+49{{areaCode}}#######', - '+49{{areaCode}}### ####', - - // Standard formats - '0{{areaCode}} ### ####', - '0{{areaCode}} #######', - '(0{{areaCode}}) ### ####', - '(0{{areaCode}}) #######', - ]; - - protected static $e164Formats = [ - '+49{{areaCode}}#######', - ]; - - /** - * @see https://en.wikipedia.org/wiki/Toll-free_telephone_number - */ - protected static $tollFreeAreaCodes = [ - 800, - ]; - - protected static $tollFreeFormats = [ - // Standard formats - '0{{tollFreeAreaCode}} ### ####', - '(0{{tollFreeAreaCode}}) ### ####', - '+49{{tollFreeAreaCode}} ### ####', - ]; - - public function tollFreeAreaCode() - { - return self::randomElement(static::$tollFreeAreaCodes); - } - - public function tollFreePhoneNumber() - { - $format = self::randomElement(static::$tollFreeFormats); - - return self::numerify($this->generator->parse($format)); - } - - protected static $mobileCodes = [ - 1511, 1512, 1514, 1515, 1516, 1517, - 1520, 1521, 1522, 1523, 1525, 1526, 1529, - 1570, 1573, 1575, 1577, 1578, 1579, - 1590, - ]; - - protected static $mobileFormats = [ - '+49{{mobileCode}}#######', - '+49 {{mobileCode}} ### ####', - '0{{mobileCode}}#######', - '0{{mobileCode}} ### ####', - '0 {{mobileCode}} ### ####', - ]; - - /** - * @see https://en.wikipedia.org/wiki/List_of_dialling_codes_in_Germany - * - * @return string - */ - public static function areaCode() - { - $firstDigit = self::numberBetween(2, 9); - - return $firstDigit . self::regexify(self::$areaCodeRegexes[$firstDigit]); - } - - /** - * Generate a code for a mobile number. - * - * @internal Used to generate mobile numbers. - * - * @return string - */ - public static function mobileCode() - { - return static::randomElement(static::$mobileCodes); - } - - /** - * Generate a mobile number. - * - * @example A mobile number: '015111234567' - * @example A mobile number with spaces: '01511 123 4567' - * @example A mobile number with international code prefix: '+4915111234567' - * @example A mobile number with international code prefix and spaces: '+49 1511 123 4567' - * - * @return string - */ - public function mobileNumber() - { - return ltrim(static::numerify($this->generator->parse( - static::randomElement(static::$mobileFormats), - ))); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/de_DE/Text.php b/vendor/fakerphp/faker/src/Faker/Provider/de_DE/Text.php deleted file mode 100644 index 55ed5a55..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/de_DE/Text.php +++ /dev/null @@ -1,2038 +0,0 @@ -generator->parse(static::randomElement(static::$lastNameFormat)); - } - - /** - * @example 'Θεοδωρόπουλος' - */ - public static function lastNameMale() - { - return static::randomElement(static::$lastNameMale); - } - - /** - * @example 'Κοκκίνου' - */ - public static function lastNameFemale() - { - return static::randomElement(static::$lastNameFemale); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/el_GR/PhoneNumber.php b/vendor/fakerphp/faker/src/Faker/Provider/el_GR/PhoneNumber.php deleted file mode 100644 index 53032487..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/el_GR/PhoneNumber.php +++ /dev/null @@ -1,324 +0,0 @@ -generator->parse( - static::randomElement(static::$fixedLineFormats), - ))); - } - - /** - * Generate a code for a mobile number. - * - * @internal Used to generate mobile numbers. - * - * @return string - */ - public static function mobileCode() - { - return static::randomElement(static::$mobileCodes); - } - - /** - * Generate a mobile number. - * - * @example A mobile number: '6901234567' - * @example A mobile number with spaces: '690 123 4567' - * @example A mobile number with international code prefix: '+306901234567' - * @example A mobile number with international code prefix and spaces: '+30 690 123 4567' - * - * @return string - */ - public function mobileNumber() - { - return ltrim(static::numerify($this->generator->parse( - static::randomElement(static::$mobileFormats), - ))); - } - - /** - * @deprecated Use PhoneNumber::mobileNumber() instead. - */ - public static function mobilePhoneNumber() - { - return static::numerify( - strtr(static::randomElement(static::$mobileFormats), [ - '{{internationalCodePrefix}}' => static::internationalCodePrefix(), - '{{mobileCode}}' => static::mobileCode(), - ]), - ); - } - - /** - * Generate a personal number. - * - * @example A personal number: '7012345678' - * @example A personal number with spaces: '70 1234 5678' - * @example A personal number with international code prefix: '+307012345678' - * @example A personal number with international code prefix and spaces: '+30 70 1234 5678' - * - * @return string - */ - public function personalNumber() - { - return ltrim(static::numerify($this->generator->parse( - static::randomElement(static::$personalFormats), - ))); - } - - /** - * Generate a toll-free number. - * - * @example A toll-free number: '8001234567' - * @example A toll-free number with spaces: '800 123 4567' - * @example A toll-free number with international code prefix: '+308001234567' - * @example A toll-free number with international code prefix and spaces: '+30 800 123 4567' - * - * @return string - */ - public static function tollFreeNumber() - { - return ltrim(static::numerify( - strtr(static::randomElement(static::$tollFreeFormats), [ - '{{internationalCodePrefix}}' => static::internationalCodePrefix(), - ]), - )); - } - - /** - * Generate a code for a shared-cost number. - * - * @internal Used to generate shared-cost numbers. - * - * @return string - */ - public static function sharedCostCode() - { - return static::randomElement(static::$sharedCostCodes); - } - - /** - * Generate a shared-cost number. - * - * @example A shared-cost number: '8011234567' - * @example A shared-cost number with spaces: '801 123 4567' - * @example A shared-cost number with international code prefix: '+308011234567' - * @example A shared-cost number with international code prefix and spaces: '+30 801 123 4567' - * - * @return string - */ - public function sharedCostNumber() - { - return ltrim(static::numerify($this->generator->parse( - static::randomElement(static::$sharedCostFormats), - ))); - } - - /** - * Generate a code for a premium-rate number. - * - * @internal Used to generate premium-rate numbers. - * - * @return string - */ - public static function premiumRateCode() - { - return static::randomElement(static::$premiumRateCodes); - } - - /** - * Generate a premium-rate number. - * - * @example A premium-rate number: '9011234567' - * @example A premium-rate number with spaces: '901 123 4567' - * @example A premium-rate number with international code prefix: '+309011234567' - * @example A premium-rate number with international code prefix and spaces: '+30 901 123 4567' - * - * @return string - */ - public function premiumRateNumber() - { - return ltrim(static::numerify($this->generator->parse( - static::randomElement(static::$premiumRateFormats), - ))); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/el_GR/Text.php b/vendor/fakerphp/faker/src/Faker/Provider/el_GR/Text.php deleted file mode 100644 index f4be7606..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/el_GR/Text.php +++ /dev/null @@ -1,2582 +0,0 @@ - 0) { - $sum -= 97; - } - $sum = $sum * -1; - - return str_pad((string) $sum, 2, '0', STR_PAD_LEFT); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/en_GB/Internet.php b/vendor/fakerphp/faker/src/Faker/Provider/en_GB/Internet.php deleted file mode 100644 index ef5934ab..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/en_GB/Internet.php +++ /dev/null @@ -1,9 +0,0 @@ -generator->parse(static::randomElement(static::$towns)); - } - - public function syllable() - { - return static::randomElement(static::$syllables); - } - - public function direction() - { - return static::randomElement(static::$directions); - } - - public function englishStreetName() - { - return static::randomElement(static::$englishStreetNames); - } - - public function villageSuffix() - { - return static::randomElement(static::$villageSuffixes); - } - - public function estateSuffix() - { - return static::randomElement(static::$estateSuffixes); - } - - public function village() - { - return $this->generator->parse(static::randomElement(static::$villageNameFormats)); - } - - public function estate() - { - return $this->generator->parse(static::randomElement(static::$estateNameFormats)); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/en_HK/Internet.php b/vendor/fakerphp/faker/src/Faker/Provider/en_HK/Internet.php deleted file mode 100644 index 2de48a53..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/en_HK/Internet.php +++ /dev/null @@ -1,14 +0,0 @@ -generator->parse(static::randomElement(static::$societyNameFormat)); - } - - /** - * @example Mumbai - */ - public function city() - { - return static::randomElement(static::$city); - } - - /** - * @example Vaishali Nagar - */ - public function locality() - { - return $this->generator->parse(static::randomElement(static::$localityFormats)); - } - - /** - * @example Kharadi - */ - public function localityName() - { - return $this->generator->parse(static::randomElement(static::$localityName)); - } - - /** - * @example Nagar - */ - public function areaSuffix() - { - return static::randomElement(static::$areaSuffix); - } - - /** - * @example 'Delhi' - */ - public static function state() - { - return static::randomElement(static::$state); - } - - /** - * @example 'DL' - */ - public static function stateAbbr() - { - return static::randomElement(static::$stateAbbr); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/en_IN/Internet.php b/vendor/fakerphp/faker/src/Faker/Provider/en_IN/Internet.php deleted file mode 100644 index a5435352..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/en_IN/Internet.php +++ /dev/null @@ -1,9 +0,0 @@ -format('y'); - $checksumArr = ['J', 'Z', 'I', 'H', 'G', 'F', 'E', 'D', 'C', 'B', 'A']; - } - - $length = count($weights); - - for ($i = strlen($result); $i < $length; ++$i) { - $result .= static::randomDigit(); - } - - $checksum = in_array($prefix, ['G', 'T'], true) ? 4 : 0; - - for ($i = 0; $i < $length; ++$i) { - $checksum += (int) $result[$i] * $weights[$i]; - } - - return $prefix . $result . $checksumArr[$checksum % 11]; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/en_SG/PhoneNumber.php b/vendor/fakerphp/faker/src/Faker/Provider/en_SG/PhoneNumber.php deleted file mode 100644 index f5e3ca6b..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/en_SG/PhoneNumber.php +++ /dev/null @@ -1,105 +0,0 @@ -generator->parse($format)); - } - - public function fixedLineNumber() - { - $format = static::randomElement(static::$fixedLineNumberFormats); - - return static::numerify($this->generator->parse($format)); - } - - public function voipNumber() - { - $format = static::randomElement(static::$voipNumber); - - return static::numerify($this->generator->parse($format)); - } - - public function internationalCodePrefix() - { - return static::randomElement(static::$internationalCodePrefix); - } - - public function zeroToEight() - { - return static::randomElement(static::$zeroToEight); - } - - public function oneToEight() - { - return static::randomElement(static::$oneToEight); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/en_UG/Address.php b/vendor/fakerphp/faker/src/Faker/Provider/en_UG/Address.php deleted file mode 100644 index 9024b8b7..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/en_UG/Address.php +++ /dev/null @@ -1,101 +0,0 @@ - - */ - protected static $areaCodeRegexes = [ - 2 => '(0[1-35-9]|1[02-9]|2[03-589]|3[149]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])', - 3 => '(0[1-57-9]|1[02-9]|2[0135]|3[0-24679]|4[167]|5[12]|6[014]|8[056])', - 4 => '(0[124-9]|1[02-579]|2[3-5]|3[0245]|4[0235]|58|6[39]|7[0589]|8[04])', - 5 => '(0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-47]|7[013-5]|8[056])', - 6 => '(0[1-35-9]|1[024-9]|2[03689]|[34][016]|5[017]|6[0-279]|78|8[0-29])', - 7 => '(0[1-46-8]|1[2-9]|2[04-7]|3[1247]|4[037]|5[47]|6[02359]|7[02-59]|8[156])', - 8 => '(0[1-68]|1[02-8]|2[08]|3[0-28]|4[3578]|5[046-9]|6[02-5]|7[028])', - 9 => '(0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[0179]|5[12469]|7[0-389]|8[04-69])', - ]; - - /** - * @see https://en.wikipedia.org/wiki/National_conventions_for_writing_telephone_numbers#United_States.2C_Canada.2C_and_other_NANP_countries - */ - protected static $formats = [ - // International format - '+1-{{areaCode}}-{{exchangeCode}}-####', - '+1 ({{areaCode}}) {{exchangeCode}}-####', - '+1-{{areaCode}}-{{exchangeCode}}-####', - '+1.{{areaCode}}.{{exchangeCode}}.####', - '+1{{areaCode}}{{exchangeCode}}####', - - // Standard formats - '{{areaCode}}-{{exchangeCode}}-####', - '({{areaCode}}) {{exchangeCode}}-####', - '1-{{areaCode}}-{{exchangeCode}}-####', - '{{areaCode}}.{{exchangeCode}}.####', - - '{{areaCode}}-{{exchangeCode}}-####', - '({{areaCode}}) {{exchangeCode}}-####', - '1-{{areaCode}}-{{exchangeCode}}-####', - '{{areaCode}}.{{exchangeCode}}.####', - ]; - - protected static $formatsWithExtension = [ - '{{areaCode}}-{{exchangeCode}}-#### x###', - '({{areaCode}}) {{exchangeCode}}-#### x###', - '1-{{areaCode}}-{{exchangeCode}}-#### x###', - '{{areaCode}}.{{exchangeCode}}.#### x###', - - '{{areaCode}}-{{exchangeCode}}-#### x####', - '({{areaCode}}) {{exchangeCode}}-#### x####', - '1-{{areaCode}}-{{exchangeCode}}-#### x####', - '{{areaCode}}.{{exchangeCode}}.#### x####', - - '{{areaCode}}-{{exchangeCode}}-#### x#####', - '({{areaCode}}) {{exchangeCode}}-#### x#####', - '1-{{areaCode}}-{{exchangeCode}}-#### x#####', - '{{areaCode}}.{{exchangeCode}}.#### x#####', - ]; - - protected static $e164Formats = [ - '+1{{areaCode}}{{exchangeCode}}####', - ]; - - /** - * @see https://en.wikipedia.org/wiki/Toll-free_telephone_number#United_States - */ - protected static $tollFreeAreaCodes = [ - 800, 844, 855, 866, 877, 888, - ]; - protected static $tollFreeFormats = [ - // Standard formats - '{{tollFreeAreaCode}}-{{exchangeCode}}-####', - '({{tollFreeAreaCode}}) {{exchangeCode}}-####', - '1-{{tollFreeAreaCode}}-{{exchangeCode}}-####', - '{{tollFreeAreaCode}}.{{exchangeCode}}.####', - ]; - - public function tollFreeAreaCode() - { - return self::randomElement(static::$tollFreeAreaCodes); - } - - public function tollFreePhoneNumber() - { - $format = self::randomElement(static::$tollFreeFormats); - - return self::numerify($this->generator->parse($format)); - } - - /** - * @return string - * - * @example '555-123-546 x123' - */ - public function phoneNumberWithExtension() - { - return static::numerify($this->generator->parse(static::randomElement(static::$formatsWithExtension))); - } - - /** - * NPA-format area code - * - * @see https://en.wikipedia.org/wiki/North_American_Numbering_Plan#Numbering_system - * - * @return string - */ - public static function areaCode() - { - $firstDigit = self::numberBetween(2, 9); - - return $firstDigit . self::regexify(self::$areaCodeRegexes[$firstDigit]); - } - - /** - * NXX-format central office exchange code - * - * @see https://en.wikipedia.org/wiki/North_American_Numbering_Plan#Numbering_system - * - * @return string - */ - public static function exchangeCode() - { - $digits[] = self::numberBetween(2, 9); - $digits[] = self::randomDigit(); - - if ($digits[1] === 1) { - $digits[] = self::randomDigitNot(1); - } else { - $digits[] = self::randomDigit(); - } - - return implode('', $digits); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/en_US/Text.php b/vendor/fakerphp/faker/src/Faker/Provider/en_US/Text.php deleted file mode 100644 index c15d89d9..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/en_US/Text.php +++ /dev/null @@ -1,3721 +0,0 @@ -format('Y'), - static::randomNumber(6, true), - static::randomElement(static::$legalEntities), - ); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/en_ZA/Internet.php b/vendor/fakerphp/faker/src/Faker/Provider/en_ZA/Internet.php deleted file mode 100644 index c2222276..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/en_ZA/Internet.php +++ /dev/null @@ -1,23 +0,0 @@ -generator->dateTimeThisCentury(); - } - $birthDateString = $birthdate->format('ymd'); - - switch (strtolower($gender ?: '')) { - case static::GENDER_FEMALE: - $genderDigit = self::numberBetween(0, 4); - - break; - - case static::GENDER_MALE: - $genderDigit = self::numberBetween(5, 9); - - break; - - default: - $genderDigit = self::numberBetween(0, 9); - } - $sequenceDigits = str_pad(self::randomNumber(3), 3, 0, STR_PAD_BOTH); - $citizenDigit = ($citizen === true) ? '0' : '1'; - $raceDigit = self::numberBetween(8, 9); - - $partialIdNumber = $birthDateString . $genderDigit . $sequenceDigits . $citizenDigit . $raceDigit; - - return $partialIdNumber . Luhn::computeCheckDigit($partialIdNumber); - } - - /** - * @see https://en.wikipedia.org/wiki/Driving_licence_in_South_Africa - * - * @return string - */ - public function licenceCode() - { - return static::randomElement(static::$licenceCodes); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/en_ZA/PhoneNumber.php b/vendor/fakerphp/faker/src/Faker/Provider/en_ZA/PhoneNumber.php deleted file mode 100644 index 567631a0..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/en_ZA/PhoneNumber.php +++ /dev/null @@ -1,116 +0,0 @@ -generator->parse($format)); - } - - public function tollFreeNumber() - { - $format = static::randomElement(static::$specialFormats); - - return self::numerify($this->generator->parse($format)); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/es_AR/Address.php b/vendor/fakerphp/faker/src/Faker/Provider/es_AR/Address.php deleted file mode 100644 index 457f8caf..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/es_AR/Address.php +++ /dev/null @@ -1,68 +0,0 @@ -numberBetween(10000, 100000000); - } - - return $id . $separator . $this->numberBetween(80000000, 100000000); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/es_VE/PhoneNumber.php b/vendor/fakerphp/faker/src/Faker/Provider/es_VE/PhoneNumber.php deleted file mode 100644 index cfe6438f..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/es_VE/PhoneNumber.php +++ /dev/null @@ -1,29 +0,0 @@ -generator->parse($format); - } - - /** - * @example 'کد پستی' - */ - public static function postcodePrefix() - { - return static::randomElement(static::$postcodePrefix); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/fa_IR/Company.php b/vendor/fakerphp/faker/src/Faker/Provider/fa_IR/Company.php deleted file mode 100644 index 15da3c5a..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/fa_IR/Company.php +++ /dev/null @@ -1,60 +0,0 @@ -generator->parse($format)); - } - - /** - * @example 'ahmad.ir' - */ - public function domainName() - { - return static::randomElement(static::$lastNameAscii) . '.' . $this->tld(); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/fa_IR/Person.php b/vendor/fakerphp/faker/src/Faker/Provider/fa_IR/Person.php deleted file mode 100644 index 546e2a3f..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/fa_IR/Person.php +++ /dev/null @@ -1,210 +0,0 @@ - 1; --$i) { - $sum += $subNationalCodeString[$count] * ($i); - ++$count; - } - - if (($sum % 11) < 2) { - return $sum % 11; - } - - return 11 - ($sum % 11); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/fa_IR/PhoneNumber.php b/vendor/fakerphp/faker/src/Faker/Provider/fa_IR/PhoneNumber.php deleted file mode 100644 index a9606d02..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/fa_IR/PhoneNumber.php +++ /dev/null @@ -1,76 +0,0 @@ - 5) { - throw new \InvalidArgumentException('indexSize must be at most 5'); - } - - $words = $this->getConsecutiveWords($indexSize); - $result = []; - $resultLength = 0; - // take a random starting point - $next = static::randomKey($words); - - while ($resultLength < $maxNbChars && isset($words[$next])) { - // fetch a random word to append - $word = static::randomElement($words[$next]); - - // calculate next index - $currentWords = explode(' ', $next); - - $currentWords[] = $word; - array_shift($currentWords); - $next = implode(' ', $currentWords); - - if ($resultLength == 0 && !preg_match('/^[\x{0600}-\x{06FF}]/u', $word)) { - continue; - } - // append the element - $result[] = $word; - $resultLength += strlen($word) + 1; - } - - // remove the element that caused the text to overflow - array_pop($result); - - // build result - $result = implode(' ', $result); - - return $result . '.'; - } - - /** - * License: Creative Commons Attribution-ShareAlike License - * - * Title: مدیر مدرسه - * Author: جلال آل‌احمد - * Language: Persian - * - * @see http://fa.wikisource.org/wiki/%D9%85%D8%AF%DB%8C%D8%B1_%D9%85%D8%AF%D8%B1%D8%B3%D9%87 - * - * @var string - */ - protected static $baseText = <<<'EOT' -از در که وارد شدم سیگارم دستم بود. زورم آمد سلام کنم. همین طوری دنگم گرفته بود قد باشم. رئیس فرهنگ که اجازه‌ی نشستن داد، نگاهش لحظه‌ای روی دستم مکث کرد و بعد چیزی را که می‌نوشت، تمام کرد و می‌خواست متوجه من بشود که رونویس حکم را روی میزش گذاشته بودم. حرفی نزدیم. رونویس را با کاغذهای ضمیمه‌اش زیر و رو کرد و بعد غبغب انداخت و آرام و مثلاً خالی از عصبانیت گفت: - -- جا نداریم آقا. این که نمی‌شه! هر روز یه حکم می‌دند دست یکی می‌فرستنش سراغ من... دیروز به آقای مدیر کل... - -حوصله‌ی این اباطیل را نداشتم. حرفش را بریدم که: - -- ممکنه خواهش کنم زیر همین ورقه مرقوم بفرمایید؟ - -و سیگارم را توی زیرسیگاری براق روی میزش تکاندم. روی میز، پاک و مرتب بود. درست مثل اتاق همان مهمان‌خانه‌ی تازه‌عروس‌ها. هر چیز به جای خود و نه یک ذره گرد. فقط خاکستر سیگار من زیادی بود. مثل تفی در صورت تازه تراشیده‌ای.... قلم را برداشت و زیر حکم چیزی نوشت و امضا کرد و من از در آمده بودم بیرون. خلاص. تحمل این یکی را نداشتم. با اداهایش. پیدا بود که تازه رئیس شده. زورکی غبغب می‌انداخت و حرفش را آهسته توی چشم آدم می‌زد. انگار برای شنیدنش گوش لازم نیست. صد و پنجاه تومان در کارگزینی کل مایه گذاشته بودم تا این حکم را به امضا رسانده بودم. توصیه هم برده بودم و تازه دو ماه هم دویده بودم. مو، لای درزش نمی‌رفت. می‌دانستم که چه او بپذیرد، چه نپذیرد، کار تمام است. خودش هم می‌دانست. حتماً هم دستگیرش شد که با این نک و نالی که می‌کرد، خودش را کنف کرده. ولی کاری بود و شده بود. در کارگزینی کل، سفارش کرده بودند که برای خالی نبودن عریضه رونویس را به رؤیت رئیس فرهنگ هم برسانم تازه این طور شد. و گر نه بالی حکم کارگزینی کل چه کسی می‌توانست حرفی بزند؟ یک وزارت خانه بود و یک کارگزینی! شوخی که نبود. ته دلم قرص‌تر از این‌ها بود که محتاج به این استدلال‌ها باشم. اما به نظرم همه‌ی این تقصیرها از این سیگار لعنتی بود که به خیال خودم خواسته بودم خرجش را از محل اضافه حقوق شغل جدیدم در بیاورم. البته از معلمی، هم اُقم نشسته بود. ده سال «الف.ب.» درس دادن و قیافه‌های بهت‌زده‌ی بچه‌های مردم برای مزخرف‌ترین چرندی که می‌گویی... و استغناء با غین و استقراء با قاف و خراسانی و هندی و قدیمی‌ترین شعر دری و صنعت ارسال مثل و ردالعجز... و از این مزخرفات! دیدم دارم خر می‌شوم. گفتم مدیر بشوم. مدیر دبستان! دیگر نه درس خواهم داد و نه مجبور خواهم بود برای فرار از اتلاف وقت، در امتحان تجدیدی به هر احمق بی‌شعوری هفت بدهم تا ایام آخر تابستانم را که لذیذترین تکه‌ی تعطیلات است، نجات داده باشم. این بود که راه افتادم. رفتم و از اهلش پرسیدم. از یک کار چاق کن. دستم را توی دست کارگزینی گذاشت و قول و قرار و طرفین خوش و خرم و یک روز هم نشانی مدرسه را دستم دادند که بروم وارسی، که باب میلم هست یا نه. - -و رفتم. مدرسه دو طبقه بود و نوساز بود و در دامنه‌ی کوه تنها افتاده بود و آفتاب‌رو بود. یک فرهنگ‌دوست خرپول، عمارتش را وسط زمین خودش ساخته بود و بیست و پنج سال هم در اختیار فرهنگ گذاشته بود که مدرسه‌اش کنند و رفت و آمد بشود و جاده‌ها کوبیده بشود و این قدر ازین بشودها بشود، تا دل ننه باباها بسوزد و برای این‌که راه بچه‌هاشان را کوتاه بکنند، بیایند همان اطراف مدرسه را بخرند و خانه بسازند و زمین یارو از متری یک عباسی بشود صد تومان. یارو اسمش را هم روی دیوار مدرسه کاشی‌کاری کرده بود. هنوز در و همسایه پیدا نکرده بودند که حرف‌شان بشود و لنگ و پاچه‌ی سعدی و باباطاهر را بکشند میان و یک ورق دیگر از تاریخ‌الشعرا را بکوبند روی نبش دیوار کوچه‌شان. تابلوی مدرسه هم حسابی و بزرگ و خوانا. از صد متری داد می‌زد که توانا بود هر.... هر چه دلتان بخواهد! با شیر و خورشیدش که آن بالا سر، سه پا ایستاده بود و زورکی تعادل خودش را حفظ می‌کرد و خورشید خانم روی کولش با ابروهای پیوسته و قمچیلی که به دست داشت و تا سه تیر پرتاب، اطراف مدرسه بیابان بود. درندشت و بی آب و آبادانی و آن ته رو به شمال، ردیف کاج‌های درهم فرو رفته‌ای که از سر دیوار گلی یک باغ پیدا بود روی آسمان لکه‌ی دراز و تیره‌ای زده بود. حتماً تا بیست و پنج سال دیگر همه‌ی این اطراف پر می‌شد و بوق ماشین و ونگ ونگ بچه‌ها و فریاد لبویی و زنگ روزنامه‌فروشی و عربده‌ی گل به سر دارم خیار! نان یارو توی روغن بود. - -- راستی شاید متری ده دوازده شاهی بیشتر نخریده باشد؟ شاید هم زمین‌ها را همین جوری به ثبت داده باشد؟ هان؟ - -- احمق به توچه؟!... - -بله این فکرها را همان روزی کردم که ناشناس به مدرسه سر زدم و آخر سر هم به این نتیجه رسیدم که مردم حق دارند جایی بخوابند که آب زیرشان نرود. - -- تو اگر مردی، عرضه داشته باش مدیر همین مدرسه هم بشو. - -و رفته بودم و دنبال کار را گرفته بودم تا رسیده بودم به این‌جا. همان روز وارسی فهمیده بودم که مدیر قبلی مدرسه زندانی است. لابد کله‌اش بوی قرمه‌سبزی می‌داده و باز لابد حالا دارد کفاره‌ی گناهانی را می‌دهد که یا خودش نکرده یا آهنگری در بلخ کرده. جزو پر قیچی‌های رئیس فرهنگ هم کسی نبود که با مدیرشان، اضافه حقوقی نصیبش بشود و ناچار سر و دستی برای این کار بشکند. خارج از مرکز هم نداشت. این معلومات را توی کارگزینی به دست آورده بودم. هنوز «گه خوردم نامه‌نویسی» هم مد نشده بود که بگویم یارو به این زودی‌ها از سولدونی در خواهد آمد. فکر نمی‌کردم که دیگری هم برای این وسط بیابان دلش لک زده باشد با زمستان سختش و با رفت و آمد دشوارش. - -این بود که خیالم راحت بود. از همه‌ی این‌ها گذشته کارگزینی کل موافقت کرده بود! دست است که پیش از بلند شدن بوی اسکناس، آن جا هم دو سه تا عیب شرعی و عرفی گرفته بودند و مثلاً گفته بودن لابد کاسه‌ای زیر نیم کاسه است که فلانی یعنی من، با ده سال سابقه‌ی تدریس، می‌خواهد مدیر دبستان بشود! غرض‌شان این بود که لابد خل شدم که از شغل مهم و محترم دبیری دست می‌شویم. ماهی صد و پنجاه تومان حق مقام در آن روزها پولی نبود که بتوانم نادیده بگیرم. و تازه اگر ندیده می‌گرفتم چه؟ باز باید بر می‌گشتم به این کلاس‌ها و این جور حماقت‌ها. این بود که پیش رئیس فرهنگ، صاف برگشتم به کارگزینی کل، سراغ آن که بفهمی نفهمی، دلال کارم بود. و رونویس حکم را گذاشتم و گفتم که چه طور شد و آمدم بیرون. - -دو روز بعد رفتم سراغش. معلوم شد که حدسم درست بوده است و رئیس فرهنگ گفته بوده: «من از این لیسانسه‌های پر افاده نمی‌خواهم که سیگار به دست توی هر اتاقی سر می‌کنند.» - -و یارو برایش گفته بود که اصلاً وابدا..! فلانی همچین و همچون است و مثقالی هفت صنار با دیگران فرق دارد و این هندوانه‌ها و خیال من راحت باشد و پنج‌شنبه یک هفته‌ی دیگر خودم بروم پهلوی او... و این کار را کردم. این بار رئیس فرهنگ جلوی پایم بلند شد که: «ای آقا... چرا اول نفرمودید؟!...» و از کارمندهایش گله کرد و به قول خودش، مرا «در جریان موقعیت محل» گذاشت و بعد با ماشین خودش مرا به مدرسه رساند و گفت زنگ را زودتر از موعد زدند و در حضور معلم‌ها و ناظم، نطق غرایی در خصائل مدیر جدید – که من باشم – کرد و بعد هم مرا گذاشت و رفت با یک مدرسه‌ی شش کلاسه‌ی «نوبنیاد» و یک ناظم و هفت تا معلم و دویست و سی و پنج تا شاگرد. دیگر حسابی مدیر مدرسه شده بودم! - -ناظم، جوان رشیدی بود که بلند حرف می‌زد و به راحتی امر و نهی می‌کرد و بیا و برویی داشت و با شاگردهای درشت، روی هم ریخته بود که خودشان ترتیب کارها را می‌دادند و پیدا بود که به سر خر احتیاجی ندارد و بی‌مدیر هم می‌تواند گلیم مدرسه را از آب بکشد. معلم کلاس چهار خیلی گنده بود. دو تای یک آدم حسابی. توی دفتر، اولین چیزی که به چشم می‌آمد. از آن‌هایی که اگر توی کوچه ببینی، خیال می‌کنی مدیر کل است. لفظ قلم حرف می‌زد و شاید به همین دلیل بود که وقتی رئیس فرهنگ رفت و تشریفات را با خودش برد، از طرف همکارانش تبریک ورود گفت و اشاره کرد به اینکه «ان‌شاءالله زیر سایه‌ی سرکار، سال دیگر کلاس‌های دبیرستان را هم خواهیم داشت.» پیدا بود که این هیکل کم‌کم دارد از سر دبستان زیادی می‌کند! وقتی حرف می‌زد همه‌اش درین فکر بودم که با نان آقا معلمی چه طور می‌شد چنین هیکلی به هم زد و چنین سر و تیپی داشت؟ و راستش تصمیم گرفتم که از فردا صبح به صبح ریشم را بتراشم و یخه‌ام تمیز باشد و اتوی شلوارم تیز. - -معلم کلاس اول باریکه‌ای بود، سیاه سوخته. با ته ریشی و سر ماشین کرده‌ای و یخه‌ی بسته. بی‌کراوات. شبیه میرزابنویس‌های دم پست‌خانه. حتی نوکر باب می‌نمود. و من آن روز نتوانستم بفهمم وقتی حرف می‌زند کجا را نگاه می‌کند. با هر جیغ کوتاهی که می‌زد هرهر می‌خندید. با این قضیه نمی‌شد کاری کرد. معلم کلاس سه، یک جوان ترکه‌ای بود؛ بلند و با صورت استخوانی و ریش از ته تراشیده و یخه‌ی بلند آهاردار. مثل فرفره می‌جنبید. چشم‌هایش برق عجیبی می‌زد که فقط از هوش نبود، چیزی از ناسلامتی در برق چشم‌هایش بود که مرا واداشت از ناظم بپرسم مبادا مسلول باشد. البته مسلول نبود، تنها بود و در دانشگاه درس می‌خواند. کلاس‌های پنجم و ششم را دو نفر با هم اداره می‌کردند. یکی فارسی و شرعیات و تاریخ، جغرافی و کاردستی و این جور سرگرمی‌ها را می‌گفت، که جوانکی بود بریانتین زده، با شلوار پاچه تنگ و پوشت و کراوات زرد و پهنی که نعش یک لنگر بزرگ آن را روی سینه‌اش نگه داشته بود و دائماً دستش حمایل موهای سرش بود و دم به دم توی شیشه‌ها نگاه می‌کرد. و آن دیگری که حساب و مرابحه و چیزهای دیگر می‌گفت، جوانی بود موقر و سنگین مازندرانی به نظر می‌آمد و به خودش اطمینان داشت. غیر از این‌ها، یک معلم ورزش هم داشتیم که دو هفته بعد دیدمش و اصفهانی بود و از آن قاچاق‌ها. - -رئیس فرهنگ که رفت، گرم و نرم از همه‌شان حال و احوال پرسیدم. بعد به همه سیگار تعارف کردم. سراپا همکاری و همدردی بود. از کار و بار هر کدامشان پرسیدم. فقط همان معلم کلاس سه، دانشگاه می‌رفت. آن که لنگر به سینه انداخته بود، شب‌ها انگلیسی می‌خواند که برود آمریکا. چای و بساطی در کار نبود و ربع ساعت‌های تفریح، فقط توی دفتر جمع می‌شدند و دوباره از نو. و این نمی‌شد. باید همه‌ی سنن را رعایت کرد. دست کردم و یک پنج تومانی روی میز گذاشتم و قرار شد قبل و منقلی تهیه کنند و خودشان چای را راه بیندازند. - -بعد از زنگ قرار شد من سر صف نطقی بکنم. ناظم قضیه را در دو سه کلمه برای بچه‌ها گفت که من رسیدم و همه دست زدند. چیزی نداشتم برایشان بگویم. فقط یادم است اشاره‌ای به این کردم که مدیر خیلی دلش می‌خواست یکی از شما را به جای فرزند داشته باشد و حالا نمی‌داند با این همه فرزند چه بکند؟! که بی‌صدا خندیدند و در میان صف‌های عقب یکی پکی زد به خنده. واهمه برم داشت که «نه بابا. کار ساده‌ای هم نیست!» قبلاً فکر کرده بودم که می‌روم و فارغ از دردسر اداره‌ی کلاس، در اتاق را روی خودم می‌بندم و کار خودم را می‌کنم. اما حالا می‌دیدم به این سادگی‌ها هم نیست. اگر فردا یکی‌شان زد سر اون یکی را شکست، اگر یکی زیر ماشین رفت؛ اگر یکی از ایوان افتاد؛ چه خاکی به سرم خواهم ریخت؟ - -حالا من مانده بودم و ناظم که چیزی از لای در آهسته خزید تو. کسی بود؛ فراش مدرسه با قیافه‌ای دهاتی و ریش نتراشیده و قدی کوتاه و گشاد گشاد راه می‌رفت و دست‌هایش را دور از بدن نگه می‌داشت. آمد و همان کنار در ایستاد. صاف توی چشمم نگاه می‌کرد. حال او را هم پرسیدم. هر چه بود او هم می‌توانست یک گوشه‌ی این بار را بگیرد. در یک دقیقه همه‌ی درد دل‌هایش را کرد و التماس دعاهایش که تمام شد، فرستادمش برایم چای درست کند و بیاورد. بعد از آن من به ناظم پرداختم. سال پیش، از دانشسرای مقدماتی در آمده بود. یک سال گرمسار و کرج کار کرده بود و امسال آمده بود این‌جا. پدرش دو تا زن داشته. از اولی دو تا پسر که هر دو تا چاقوکش از آب در آمده‌اند و از دومی فقط او مانده بود که درس‌خوان شده و سرشناس و نان مادرش را می‌دهد که مریض است و از پدر سال‌هاست که خبری نیست و... یک اتاق گرفته‌اند به پنجاه تومان و صد و پنجاه تومان حقوق به جایی نمی‌رسد و تازه زور که بزند سه سال دیگر می‌تواند از حق فنی نظامت مدرسه استفاده کند - -... بعد بلند شدیم که به کلاس‌ها سرکشی کنیم. بعد با ناظم به تک تک کلاس‌ها سر زدیم در این میان من به یاد دوران دبستان خودم افتادم. در کلاس ششم را باز کردیم «... ت بی پدرو مادر» جوانک بریانتین زده خورد توی صورت‌مان. یکی از بچه‌ها صورتش مثل چغندر قرمز بود. لابد بزک فحش هنوز باقی بود. قرائت فارسی داشتند. معلم دستهایش توی جیبش بود و سینه‌اش را پیش داده بود و زبان به شکایت باز کرد: - -- آقای مدیر! اصلاً دوستی سرشون نمی‌شه. تو سَری می‌خوان. ملاحظه کنید بنده با چه صمیمیتی... - -حرفش را در تشدید «ایت» بریدم که: - -- صحیح می‌فرمایید. این بار به من ببخشید. - -و از در آمدیم بیرون. بعد از آن به اطاقی که در آینده مال من بود سر زدیم. بهتر از این نمی‌شد. بی سر و صدا، آفتاب‌رو، دور افتاده. - -وسط حیاط، یک حوض بزرگ بود و کم‌عمق. تنها قسمت ساختمان بود که رعایت حال بچه‌های قد و نیم قد در آن شده بود. دور حیاط دیوار بلندی بود درست مثل دیوار چین. سد مرتفعی در مقابل فرار احتمالی فرهنگ و ته حیاط مستراح و اتاق فراش بغلش و انبار زغال و بعد هم یک کلاس. به مستراح هم سر کشیدیم. همه بی در و سقف و تیغه‌ای میان آن‌ها. نگاهی به ناظم کردم که پا به پایم می‌آمد. گفت: - -- دردسر عجیبی شده آقا. تا حالا صد تا کاغذ به ادارفردا صبح رفتم مدرسه. بچه‌ها با صف‌هاشان به طرف کلاس‌ها می‌رفتند و ناظم چوب به دست توی ایوان ایستاده بود و توی دفتر دو تا از معلم‌ها بودند. معلوم شد کار هر روزه‌شان است. ناظم را هم فرستادم سر یک کلاس دیگر و خودم آمدم دم در مدرسه به قدم زدن؛ فکر کردم از هر طرف که بیایند مرا این ته، دم در مدرسه خواهند دید و تمام طول راه در این خجالت خواهند ماند و دیگر دیر نخواهند آمد. یک سیاهی از ته جاده‌ی جنوبی پیداشد. جوانک بریانتین زده بود. مسلماً او هم مرا می‌دید، ولی آهسته‌تر از آن می‌آمد که یک معلم تأخیر کرده جلوی مدیرش می‌آمد. جلوتر که آمد حتی شنیدم که سوت می‌زد. اما بی‌انصاف چنان سلانه سلانه می‌آمد که دیدم هیچ جای گذشت نیست. اصلاً محل سگ به من نمی‌گذاشت. داشتم از کوره در می‌رفتم که یک مرتبه احساس کردم تغییری در رفتار خود داد و تند کرد. - -به خیر گذشت و گرنه خدا عالم است چه اتفاقی می‌افتاد. سلام که کرد مثل این که می‌خواست چیزی بگوید که پیش دستی کردم: - -- بفرمایید آقا. بفرمایید، بچه‌ها منتظرند. - -واقعاً به خیر گذشت. شاید اتوبوسش دیر کرده. شاید راه‌بندان بوده؛ جاده قرق بوده و باز یک گردن‌کلفتی از اقصای عالم می‌آمده که ازین سفره‌ی مرتضی علی بی‌نصیب نماند. به هر صورت در دل بخشیدمش. چه خوب شد که بد و بی‌راهی نگفتی! که از دور علم افراشته‌ی هیکل معلم کلاس چهارم نمایان شد. از همان ته مرا دیده بود. تقریباً می‌دوید. تحمل این یکی را نداشتم. «بدکاری می‌کنی. اول بسم‌الله و مته به خشخاش!» رفتم و توی دفتر نشستم و خودم را به کاری مشغول کردم که هن هن کنان رسید. چنان عرق از پیشانی‌اش می‌ریخت که راستی خجالت کشیدم. یک لیوان آب از کوه به دستش دادم و مسخ‌شده‌ی خنده‌اش را با آب به خوردش دادم و بلند که شد برود، گفتم: - -- عوضش دو کیلو لاغر شدید. - -برگشت نگاهی کرد و خنده‌ای و رفت. ناگهان ناظم از در وارد شد و از را ه نرسیده گفت: - -- دیدید آقا! این جوری می‌آند مدرسه. اون قرتی که عین خیالش هم نبود آقا! اما این یکی... - -از او پرسیدم: - -- انگار هنوز دو تا از کلاس‌ها ولند؟ - -- بله آقا. کلاس سه ورزش دارند. گفتم بنشینند دیکته بنویسند آقا. معلم حساب پنج و شش هم که نیومده آقا. - -در همین حین یکی از عکس‌های بزرگ دخمه‌های هخامنشی را که به دیوار کوبیده بود پس زد و: - -- نگاه کنید آقا... - -روی گچ دیوار با مداد قرمز و نه چندان درشت، به عجله و ناشیانه علامت داس کشیده بودند. همچنین دنبال کرد: - -- از آثار دوره‌ی اوناست آقا. کارشون همین چیزها بود. روزنومه بفروشند. تبلیغات کنند و داس چکش بکشند آقا. رئیس‌شون رو که گرفتند چه جونی کندم آقا تا حالی‌شون کنم که دست ور دارند آقا. و از روی میز پرید پایین. - -- گفتم مگه باز هم هستند؟ - -- آره آقا، پس چی! یکی همین آقازاده که هنوز نیومده آقا. هر روز نیم ساعت تأخیر داره آقا. یکی هم مثل کلاس سه. - -- خوب چرا تا حالا پاکش نکردی؟ - -- به! آخه آدم درد دلشو واسه‌ی کی بگه؟ آخه آقا در میان تو روی آدم می‌گند جاسوس، مأمور! باهاش حرفم شده آقا. کتک و کتک‌کاری! - -و بعد یک سخنرانی که چه طور مدرسه را خراب کرده‌اند و اعتماد اهل محله را چه طور از بین برده‌اند که نه انجمنی، نه کمکی به بی‌بضاعت‌ها؛ و از این حرف ها. - -بعد از سخنرانی آقای ناظم دستمالم را دادم که آن عکس‌ها را پاک کند و بعد هم راه افتادم که بروم سراغ اتاق خودم. در اتاقم را که باز کردم، داشتم دماغم با بوی خاک نم کشیده‌اش اخت می‌کرد که آخرین معلم هم آمد. آمدم توی ایوان و با صدای بلند، جوری که در تمام مدرسه بشنوند، ناظم را صدا زدم و گفتم با قلم قرمز برای آقا یک ساعت تأخیر بگذارند.ه‌ی ساختمان نوشتیم آقا. می‌گند نمی‌شه پول دولت رو تو ملک دیگرون خرج کرد. - -- گفتم راست می‌گند. - -دیگه کافی بود. آمدیم بیرون. همان توی حیاط تا نفسی تازه کنیم وضع مالی و بودجه و ازین حرف‌های مدرسه را پرسیدم. هر اتاق ماهی پانزده ریال حق نظافت داشت. لوازم‌التحریر و دفترها را هم اداره‌ی فرهنگ می‌داد. ماهی بیست و پنج تومان هم برای آب خوردن داشتند که هنوز وصول نشده بود. برای نصب هر بخاری سالی سه تومان. ماهی سی تومان هم تنخواه‌گردان مدرسه بود که مثل پول آب سوخت شده بود و حالا هم ماه دوم سال بود. اواخر آبان. حالیش کردم که حوصله‌ی این کارها را ندارم و غرضم را از مدیر شدن برایش خلاصه کردم و گفتم حاضرم همه‌ی اختیارات را به او بدهم. «اصلاً انگار که هنوز مدیر نیامده.» مهر مدرسه هم پهلوی خودش باشد. البته او را هنوز نمی‌شناختم. شنیده بودم که مدیرها قبلاً ناظم خودشان را انتخاب می‌کنند، اما من نه کسی را سراغ داشتم و نه حوصله‌اش را. حکم خودم را هم به زور گرفته بودم. سنگ‌هامان را وا کندیم و به دفتر رفتیم و چایی را که فراش از بساط خانه‌اش درست کرده بود، خوردیم تا زنگ را زدند و باز هم زدند و من نگاهی به پرونده‌های شاگردها کردم که هر کدام عبارت بود از دو برگ کاغذ. از همین دو سه برگ کاغذ دانستم که اولیای بچه‌ها اغلب زارع و باغبان و اویارند و قبل از این‌که زنگ آخر را بزنند و مدرسه تعطیل بشود بیرون آمدم. برای روز اول خیلی زیاد بود. - -فردا صبح رفتم مدرسه. بچه‌ها با صف‌هاشان به طرف کلاس‌ها می‌رفتند و ناظم چوب به دست توی ایوان ایستاده بود و توی دفتر دو تا از معلم‌ها بودند. معلوم شد کار هر روزه‌شان است. ناظم را هم فرستادم سر یک کلاس دیگر و خودم آمدم دم در مدرسه به قدم زدن؛ فکر کردم از هر طرف که بیایند مرا این ته، دم در مدرسه خواهند دید و تمام طول راه در این خجالت خواهند ماند و دیگر دیر نخواهند آمد. یک سیاهی از ته جاده‌ی جنوبی پیداشد. جوانک بریانتین زده بود. مسلماً او هم مرا می‌دید، ولی آهسته‌تر از آن می‌آمد که یک معلم تأخیر کرده جلوی مدیرش می‌آمد. جلوتر که آمد حتی شنیدم که سوت می‌زد. اما بی‌انصاف چنان سلانه سلانه می‌آمد که دیدم هیچ جای گذشت نیست. اصلاً محل سگ به من نمی‌گذاشت. داشتم از کوره در می‌رفتم که یک مرتبه احساس کردم تغییری در رفتار خود داد و تند کرد. - -به خیر گذشت و گرنه خدا عالم است چه اتفاقی می‌افتاد. سلام که کرد مثل این که می‌خواست چیزی بگوید که پیش دستی کردم: - -- بفرمایید آقا. بفرمایید، بچه‌ها منتظرند. - -واقعاً به خیر گذشت. شاید اتوبوسش دیر کرده. شاید راه‌بندان بوده؛ جاده قرق بوده و باز یک گردن‌کلفتی از اقصای عالم می‌آمده که ازین سفره‌ی مرتضی علی بی‌نصیب نماند. به هر صورت در دل بخشیدمش. چه خوب شد که بد و بی‌راهی نگفتی! که از دور علم افراشته‌ی هیکل معلم کلاس چهارم نمایان شد. از همان ته مرا دیده بود. تقریباً می‌دوید. تحمل این یکی را نداشتم. «بدکاری می‌کنی. اول بسم‌الله و مته به خشخاش!» رفتم و توی دفتر نشستم و خودم را به کاری مشغول کردم که هن هن کنان رسید. چنان عرق از پیشانی‌اش می‌ریخت که راستی خجالت کشیدم. یک لیوان آب از کوه به دستش دادم و مسخ‌شده‌ی خنده‌اش را با آب به خوردش دادم و بلند که شد برود، گفتم: - -- عوضش دو کیلو لاغر شدید. - -برگشت نگاهی کرد و خنده‌ای و رفت. ناگهان ناظم از در وارد شد و از را ه نرسیده گفت: - -- دیدید آقا! این جوری می‌آند مدرسه. اون قرتی که عین خیالش هم نبود آقا! اما این یکی... - -از او پرسیدم: - -- انگار هنوز دو تا از کلاس‌ها ولند؟ - -- بله آقا. کلاس سه ورزش دارند. گفتم بنشینند دیکته بنویسند آقا. معلم حساب پنج و شش هم که نیومده آقا. - -در همین حین یکی از عکس‌های بزرگ دخمه‌های هخامنشی را که به دیوار کوبیده بود پس زد و: - -- نگاه کنید آقا... - -روی گچ دیوار با مداد قرمز و نه چندان درشت، به عجله و ناشیانه علامت داس کشیده بودند. همچنین دنبال کرد: - -- از آثار دوره‌ی اوناست آقا. کارشون همین چیزها بود. روزنومه بفروشند. تبلیغات کنند و داس چکش بکشند آقا. رئیس‌شون رو که گرفتند چه جونی کندم آقا تا حالی‌شون کنم که دست ور دارند آقا. و از روی میز پرید پایین. - -- گفتم مگه باز هم هستند؟ - -- آره آقا، پس چی! یکی همین آقازاده که هنوز نیومده آقا. هر روز نیم ساعت تأخیر داره آقا. یکی هم مثل کلاس سه. - -- خوب چرا تا حالا پاکش نکردی؟ - -- به! آخه آدم درد دلشو واسه‌ی کی بگه؟ آخه آقا در میان تو روی آدم می‌گند جاسوس، مأمور! باهاش حرفم شده آقا. کتک و کتک‌کاری! - -و بعد یک سخنرانی که چه طور مدرسه را خراب کرده‌اند و اعتماد اهل محله را چه طور از بین برده‌اند که نه انجمنی، نه کمکی به بی‌بضاعت‌ها؛ و از این حرف ها. - -بعد از سخنرانی آقای ناظم دستمالم را دادم که آن عکس‌ها را پاک کند و بعد هم راه افتادم که بروم سراغ اتاق خودم. در اتاقم را که باز کردم، داشتم دماغم با بوی خاک نم کشیده‌اش اخت می‌کرد که آخرین معلم هم آمد. آمدم توی ایوان و با صدای بلند، جوری که در تمام مدرسه بشنوند، ناظم را صدا زدم و گفتم با قلم قرمز برای آقا یک ساعت تأخیر بگذارند. - -روز سوم باز اول وقت مدرسه بودم. هنوز از پشت دیوار نپیچیده بودم که صدای سوز و بریز بچه‌ها به پیشبازم آمد. تند کردم. پنج تا از بچه‌ها توی ایوان به خودشان می‌پیچیدند و ناظم ترکه‌ای به دست داشت و به نوبت به کف دست‌شان می‌زد. بچه‌ها التماس می‌کردند؛ گریه می‌کردند؛ اما دستشان را هم دراز می‌کردند. نزدیک بود داد بزنم یا با لگد بزنم و ناظم را پرت کنم آن طرف. پشتش به من بود و من را نمی‌دید. ناگهان زمزمه‌ای توی صف‌ها افتاد که یک مرتبه مرا به صرافت انداخت که در مقام مدیریت مدرسه، به سختی می‌شود ناظم را کتک زد. این بود که خشمم را فرو خوردم و آرام از پله‌ها رفتم بالا. ناظم، تازه متوجه من شده بود در همین حین دخالتم را کردم و خواهش کردم این بار همه‌شان را به من ببخشند. - -نمی‌دانم چه کار خطایی از آنها سر زده بود که ناظم را تا این حد عصبانی کرده بود. بچه‌ها سکسکه‌کنان رفتند توی صف‌ها و بعد زنگ را زدند و صف‌ها رفتند به کلاس‌ها و دنبالشان هم معلم‌ها که همه سر وقت حاضر بودند. نگاهی به ناظم انداختم که تازه حالش سر جا آمده بود و گفتم در آن حالی که داشت، ممکن بود گردن یک کدامشان را بشکند. که مرتبه براق شد: - -- اگه یک روز جلوشونو نگیرید سوارتون می‌شند آقا. نمی‌دونید چه قاطرهای چموشی شده‌اند آقا. - -مثل بچه مدرسه‌ای‌ها آقا آقا می‌کرد. موضوع را برگرداندم و احوال مادرش را پرسیدم. خنده، صورتش را از هم باز کرد و صدا زد فراش برایش آب بیاورد. یادم هست آن روز نیم ساعتی برای آقای ناظم صحبت کردم. پیرانه. و او جوان بود و زود می‌شد رامش کرد. بعد ازش خواستم که ترکه‌ها را بشکند و آن وقت من رفتم سراغ اتاق خودم. - -در همان هفته‌ی اول به کارها وارد شدم. فردای زمستان و نه تا بخاری زغال سنگی و روزی چهار بار آب آوردن و آب و جاروی اتاق‌ها با یک فراش جور در نمی‌آید. یک فراش دیگر از اداره ی فرهنگ خواستم که هر روز منتظر ورودش بودیم. بعد از ظهرها را نمی‌رفتم. روزهای اول با دست و دل لرزان، ولی سه چهار روزه جرأت پیدا کردم. احساس می‌کردم که مدرسه زیاد هم محض خاطر من نمی‌گردد. کلاس اول هم یکسره بود و به خاطر بچه‌های جغله دلهره‌ای نداشتم. در بیابان‌های اطراف مدرسه هم ماشینی آمد و رفت نداشت و گرچه پست و بلند بود اما به هر صورت از حیاط مدرسه که بزرگ‌تر بود. معلم ها هم، هر بعد از ظهری دو تاشان به نوبت می‌رفتند یک جوری باهم کنار آمده بودند. و ترسی هم از این نبود که بچه‌ها از علم و فرهنگ ثقل سرد بکنند. یک روز هم بازرس آمد و نیم ساعتی پیزر لای پالان هم گذاشتیم و چای و احترامات متقابل! و در دفتر بازرسی تصدیق کرد که مدرسه «با وجود عدم وسایل» بسیار خوب اداره می‌شود. - -بچه‌ها مدام در مدرسه زمین می‌خوردند، بازی می‌کردند، زمین می‌خوردند. مثل اینکه تاتوله خورده بودند. ساده‌ترین شکل بازی‌هایشان در ربع ساعت‌های تفریح، دعوا بود. فکر می‌کردم علت این همه زمین خوردن شاید این باشد که بیش‌ترشان کفش حسابی ندارند. آن‌ها هم که داشتند، بچه‌ننه بودند و بلد نبودند بدوند و حتی راه بروند. این بود که روزی دو سه بار، دست و پایی خراش بر می‌داشت. پرونده‌ی برق و تلفن مدرسه را از بایگانی بسیار محقر مدرسه بیرون کشیده بودم و خوانده بودم. اگر یک خرده می‌دویدی تا دو سه سال دیگر هم برق مدرسه درست می‌شد و هم تلفنش. دوباره سری به اداره ساختمان زدم و موضوع را تازه کردم و به رفقایی که دورادور در اداره‌ی برق و تلفن داشتم، یکی دو بار رو انداختم که اول خیال می‌کردند کار خودم را می‌خواهم به اسم مدرسه راه بیندازم و ناچار رها کردم. این قدر بود که ادای وظیفه‌ای می‌کرد. مدرسه آب نداشت. نه آب خوراکی و نه آب جاری. با هرزاب بهاره، آب انبار زیر حوض را می‌انباشتند که تلمبه‌ای سرش بود و حوض را با همان پر می‌کردند و خود بچه‌ها. اما برای آب خوردن دو تا منبع صد لیتری داشتیم از آهن سفید که مثل امامزاده‌ای یا سقاخانه‌ای دو قلو، روی چهار پایه کنار حیاط بود و روزی دو بار پر و خالی می‌شد. این آب را از همان باغی می‌آوردیم که ردیف کاج‌هایش روی آسمان، لکه‌ی دراز سیاه انداخته بود. البته فراش می‌آورد. با یک سطل بزرگ و یک آب‌پاش که سوراخ بود و تا به مدرسه می‌رسید، نصف شده بود. هر دو را از جیب خودم دادم تعمیر کردند. - -یک روز هم مالک مدرسه آمد. پیرمردی موقر و سنگین که خیال می‌کرد برای سرکشی به خانه‌ی مستأجرنشینش آمده. از در وارد نشده فریادش بلند شد و فحش را کشید به فراش و به فرهنگ که چرا بچه‌ها دیوار مدرسه را با زغال سیاه کرده‌اند واز همین توپ و تشرش شناختمش. کلی با او صحبت کردیم البته او دو برابر سن من را داشت. برایش چای هم آوردیم و با معلم‌ها آشنا شد و قول‌ها داد و رفت. کنه‌ای بود. درست یک پیرمرد. یک ساعت و نیم درست نشست. ماهی یک بار هم این برنامه را داشتند که بایست پیه‌اش را به تن می‌مالیدم. - -اما معلم‌ها. هر کدام یک ابلاغ بیست و چهار ساعته در دست داشتند، ولی در برنامه به هر کدام‌شان بیست ساعت درس بیشتر نرسیده بود. کم کم قرار شد که یک معلم از فرهنگ بخواهیم و به هر کدام‌شان هجده ساعت درس بدهیم، به شرط آن‌که هیچ بعد از ظهری مدرسه تعطیل نباشد. حتی آن که دانشگاه می‌رفت می‌توانست با هفته‌ای هجده ساعت درس بسازد. و دشوارترین کار همین بود که با کدخدامنشی حل شد و من یک معلم دیگر از فرهنگ خواستم. - -اواخر هفته‌ی دوم، فراش جدید آمد. مرد پنجاه ساله‌ای باریک و زبر و زرنگ که شب‌کلاه می‌گذاشت و لباس آبی می‌پوشید و تسبیح می‌گرداند و از هر کاری سر رشته داشت. آب خوردن را نوبتی می‌آوردند. مدرسه تر و تمیز شد و رونقی گرفت. فراش جدید سرش توی حساب بود. هر دو مستخدم با هم تمام بخاری‌ها را راه انداختند و یک کارگر هم برای کمک به آن‌ها آمد. فراش قدیمی را چهار روز پشت سر هم، سر ظهر می‌فرستادیم اداره‌ی فرهنگ و هر آن منتظر زغال بودیم. هنوز یک هفته از آمدن فراش جدید نگذشته بود که صدای همه‌ی معلم‌ها در آمده بود. نه به هیچ کدامشان سلام می‌کرد و نه به دنبال خرده فرمایش‌هایشان می‌رفت. درست است که به من سلام می‌کرد، اما معلم‌ها هم، لابد هر کدام در حدود من صاحب فضایل و عنوان و معلومات بودند که از یک فراش مدرسه توقع سلام داشته باشند. اما انگار نه انگار. - -بدتر از همه این که سر خر معلم‌ها بود. من که از همان اول، خرجم را سوا کرده بودم و آن‌ها را آزاد گذاشته بودم که در مواقع بیکاری در دفتر را روی خودشان ببندند و هر چه می‌خواهند بگویند و هر کاری می‌خواهند بکنند. اما او در فاصله‌ی ساعات درس، همچه که معلم‌ها می‌آمدند، می‌آمد توی دفتر و همین طوری گوشه‌ی اتاق می‌ایستاد و معلم‌ها کلافه می‌شدند. نه می‌توانستند شلکلک‌های معلمی‌شان را در حضور او کنار بگذارند و نه جرأت می‌کردند به او چیزی بگویند. بدزبان بود و از عهده‌ی همه‌شان بر می‌آمد. یکی دوبار دنبال نخود سیاه فرستاده بودندش. اما زرنگ بود و فوری کار را انجام می‌داد و بر می‌گشت. حسابی موی دماغ شده بود. ده سال تجربه این حداقل را به من آموخته بود که اگر معلم‌ها در ربع ساعت‌های تفریح نتوانند بخندند، سر کلاس، بچه‌های مردم را کتک خواهند زد. این بود که دخالت کردم. یک روز فراش جدید را صدا زدم. اول حال و احوالپرسی و بعد چند سال سابقه دارد و چند تا بچه و چه قدر می‌گیرد... که قضیه حل شد. سی صد و خرده‌ای حقوق می‌گرفت. با بیست و پنج سال سابقه. کار از همین جا خراب بود. پیدا بود که معلم‌ها حق دارند او را غریبه بدانند. نه دیپلمی، نه کاغذپاره‌ای، هر چه باشد یک فراش که بیشتر نبود! و تازه قلدر هم بود و حق هم داشت. اول به اشاره و کنایه و بعد با صراحت بهش فهماندم که گر چه معلم جماعت اجر دنیایی ندارد، اما از او که آدم متدین و فهمیده‌ای است بعید است و از این حرف‌ها... که یک مرتبه پرید توی حرفم که: - -- ای آقا! چه می‌فرمایید؟ شما نه خودتون این کاره‌اید و نه اینارو می‌شناسید. امروز می‌خواند سیگار براشون بخرم، فردا می‌فرستنم سراغ عرق. من این‌ها رو می‌شناسم. - -راست می‌گفت. زودتر از همه، او دندان‌های مرا شمرده بود. فهمیده بود که در مدرسه هیچ‌کاره‌ام. می‌خواستم کوتاه بیایم، ولی مدیر مدرسه بودن و در مقابل یک فراش پررو ساکت ماندن!... که خر خر کامیون زغال به دادم رسید. ترمز که کرد و صدا خوابید گفتم: - -- این حرف‌ها قباحت داره. معلم جماعت کجا پولش به عرق می‌رسه؟ حالا بدو زغال آورده‌اند. - -و همین طور که داشت بیرون می‌رفت، افزودم: - -- دو روز دیگه که محتاجت شدند و ازت قرض خواستند با هم رفیق می‌شید. - -و آمدم توی ایوان. در بزرگ آهنی مدرسه را باز کرده بودند و کامیون آمده بود تو و داشتند بارش را جلوی انبار ته حیاط خالی می‌کردند و راننده، کاغذی به دست ناظم داد که نگاهی به آن انداخت و مرا نشان داد که در ایوان بالا ایستاده بودم و فرستادش بالا. کاغذش را با سلام به دستم داد. بیجک زغال بود. رسید رسمی اداره‌ی فرهنگ بود در سه نسخه و روی آن ورقه‌ی ماشین شده‌ی «باسکول» که می‌گفت کامیون و محتویاتش جمعاً دوازده خروار است. اما رسیدهای رسمی اداری فرهنگ ساکت بودند. جای مقدار زغالی که تحویل مدرسه داده شده بود، در هر سه نسخه خالی بود. پیدا بود که تحویل گیرنده باید پرشان کند. همین کار را کردم. اوراق را بردم توی اتاق و با خودنویسم عدد را روی هر سه ورق نوشتم و امضا کردم و به دست راننده دادم که راه افتاد و از همان بالا به ناظم گفتم: - -- اگر مهر هم بایست زد، خودت بزن بابا. - -و رفتم سراغ کارم که ناگهان در باز شد و ناظم آمد تو؛ بیجک زغال دستش بود و: - -- مگه نفهمیدین آقا؟ مخصوصاً جاش رو خالی گذاشته بودند آقا... - -نفهمیده بودم. اما اگر هم فهمیده بودم، فرقی نمی‌کرد و به هر صورت از چنین کودنی نا به هنگام از جا در رفتم و به شدت گفتم: - -- خوب؟ - -- هیچ چی آقا.... رسم‌شون همینه آقا. اگه باهاشون کنار نیایید کارمونو لنگ می‌گذارند آقا... - -که از جا در رفتم. به چنین صراحتی مرا که مدیر مدرسه بودم در معامله شرکت می‌داد. و فریاد زدم: - -- عجب! حالا سرکار برای من تکلیف هم معین می‌کنید؟... خاک بر سر این فرهنگ با مدیرش که من باشم! برو ورقه رو بده دست‌شون، گورشون رو گم کنند. پدر سوخته‌ها... - -چنان فریاد زده بودم که هیچ کس در مدرسه انتظار نداشت. مدیر سر به زیر و پا به راهی بودم که از همه خواهش می‌کردم و حالا ناظم مدرسه، داشت به من یاد می‌داد که به جای نه خروار زغال مثلا هجده خروار تحویل بگیرم و بعد با اداره‌ی فرهنگ کنار بیایم. هی هی!.... تا ظهر هیچ کاری نتوانستم بکنم، جز این‌که چند بار متن استعفانامه‌ام را بنویسم و پاره کنم... قدم اول را این جور جلوی پای آدم می‌گذارند. - -بارندگی که شروع شد دستور دادم بخاری‌ها را از هفت صبح بسوزانند. بچه‌ها همیشه زود می‌آمدند. حتی روزهای بارانی. مثل این‌که اول آفتاب از خانه بیرون‌شان می‌کنند. یا ناهارنخورده. خیلی سعی کردم یک روز زودتر از بچه‌ها مدرسه باشم. اما عاقبت نشد که مدرسه را خالی از نفسِ به علم‌آلوده‌ی بچه‌ها استنشاق کنم. از راه که می‌رسیدند دور بخاری جمع می‌شدند و گیوه‌هاشان را خشک می‌کردند. و خیلی زود فهمیدم که ظهر در مدرسه ماندن هم مسأله کفش بود. هر که داشت نمی‌ماند.این قاعده در مورد معلم‌ها هم صدق می‌کرد اقلاً یک پول واکس جلو بودند. وقتی که باران می‌بارید تمام کوهپایه و بدتر از آن تمام حیاط مدرسه گل می‌شد. بازی و دویدن متوقف شده بود. مدرسه سوت و کور بود. این جا هم مسأله کفش بود. چشم اغلبشان هم قرمز بود. پیدا بود باز آن روز صبح یک فصل گریه کرده‌اند و در خانه‌شان علم صراطی بوده است. - -مدرسه داشت تخته می‌شد. عده‌ی غایب‌های صبح ده برابر شده بود و ساعت اول هیچ معلمی نمی‌توانست درس بدهد. دست‌های ورم‌کرده و سرمازده کار نمی‌کرد. حتی معلم کلاس اولمان هم می‌دانست که فرهنگ و معلومات مدارس ما صرفاً تابع تمرین است. مشق و تمرین. ده بار بیست بار. دست یخ‌کرده بیل و رنده را هم نمی‌تواند به کار بگیرد که خیلی هم زمخت‌اند و دست پر کن. این بود که به فکر افتادیم. فراش جدید واردتر از همه‌ی ما بود. یک روز در اتاق دفتر، شورامانندی داشتیم که البته او هم بود. خودش را کم‌کم تحمیل کرده بود. گفت حاضر است یکی از دُم‌کلفت‌های همسایه‌ی مدرسه را وادارد که شن برایمان بفرستد به شرط آن که ما هم برویم و از انجمن محلی برای بچه‌ها کفش و لباس بخواهیم. قرار شد خودش قضیه را دنبال کند که هفته‌ی آینده جلسه‌شان کجاست و حتی بخواهد که دعوت‌مانندی از ما بکنند. دو روز بعد سه تا کامیون شن آمد. دوتایش را توی حیاط مدرسه، خالی کردیم و سومی را دم در مدرسه، و خود بچه‌ها نیم ساعته پهنش کردند. با پا و بیل و هر چه که به دست می‌رسید. - -عصر همان روز ما را به انجمن دعوت کردند. خود من و ناظم باید می‌رفتیم. معلم کلاس چهارم را هم با خودمان بردیم. خانه‌ای که محل جلسه‌ی آن شب انجمن بود، درست مثل مدرسه، دور افتاده و تنها بود. قالی‌ها و کناره‌ها را به فرهنگ می‌آلودیم و می‌رفتیم. مثل این‌که سه تا سه تا روی هم انداخته بودند. اولی که کثیف شد دومی. به بالا که رسیدیم یک حاجی آقا در حال نماز خواندن بود. و صاحب‌خانه با لهجه‌ی غلیظ یزدی به استقبال‌مان آمد. همراهانم را معرفی کردم و لابد خودش فهمید مدیر کیست. برای ما چای آوردند. سیگارم را چاق کردم و با صاحب‌خانه از قالی‌هایش حرف زدیم. ناظم به بچه‌هایی می‌ماند که در مجلس بزرگترها خوابشان می‌گیرد و دل‌شان هم نمی‌خواست دست به سر شوند. سر اعضای انجمن باز شده بود. حاجی آقا صندوقدار بود. من و ناظم عین دو طفلان مسلم بودیم و معلم کلاس چهارم عین خولی وسطمان نشسته. اغلب اعضای انجمن به زبان محلی صحبت می‌کردند و رفتار ناشی داشتند. حتی یک کدامشان نمی‌دانستند که دست و پاهای خود را چه جور ضبط و ربط کنند. بلند بلند حرف می‌زدند. درست مثل این‌که وزارتخانه‌ی دواب سه تا حیوان تازه برای باغ وحش محله‌شان وارد کرده. جلسه که رسمی شد، صاحبخانه معرفی‌مان کرد و شروع کردند. مدام از خودشان صحبت می‌کردند از این‌که دزد دیشب فلان جا را گرفته و باید درخواست پاسبان شبانه کنیم و... - -همین طور یک ساعت حرف زدند و به مهام امور رسیدگی کردند و من و معلم کلاس چهارم سیگار کشیدیم. انگار نه انگار که ما هم بودیم. نوکرشان که آمد استکان‌ها را جمع کند، چیزی روی جلد اشنو نوشتم و برای صاحبخانه فرستادم که یک مرتبه به صرافت ما افتاد و اجازه خواست و: - -- آقایان عرضی دارند. بهتر است کارهای خودمان را بگذاریم برای بعد. - -مثلاً می‌خواست بفهماند که نباید همه‌ی حرف‌ها را در حضور ما زده باشند. و اجازه دادند معلم کلاس چهار شروع کرد به نطق و او هم شروع کرد که هر چه باشد ما زیر سایه‌ی آقایانیم و خوش‌آیند نیست که بچه‌هایی باشند که نه لباس داشته باشند و نه کفش درست و حسابی و از این حرف‌ها و مدام حرف می‌زد. ناظم هم از چُرت در آمد چیزهایی را که از حفظ کرده بود گفت و التماس دعا و کار را خراب کرد.تشری به ناظم زدم که گدابازی را بگذارد کنار و حالی‌شان کردم که صحبت از تقاضا نیست و گدایی. بلکه مدرسه دور افتاده است و مستراح بی در و پیکر و از این اباطیل... چه خوب شد که عصبانی نشدم. و قرار شد که پنج نفرشان فردا عصر بیایند که مدرسه را وارسی کنند و تشکر و اظهار خوشحالی و در آمدیم. - -در تاریکی بیابان هفت تا سواری پشت در خانه ردیف بودند و راننده‌ها توی یکی از آن‌ها جمع شده بودند و اسرار ارباب‌هاشان را به هم می‌گفتند. در این حین من مدام به خودم می‌گفتم من چرا رفتم؟ به من چه؟ مگر من در بی کفش و کلاهی‌شان مقصر بودم؟ می‌بینی احمق؟ مدیر مدرسه هم که باشی باید شخصیت و غرورت را لای زرورق بپیچی و طاق کلاهت بگذاری که اقلاً نپوسد. حتی اگر بخواهی یک معلم کوفتی باشی، نه چرا دور می‌زنی؟ حتی اگر یک فراش ماهی نود تومانی باشی، باید تا خرخره توی لجن فرو بروی.در همین حین که من در فکر بودم ناظم گفت: - -- دیدید آقا چه طور باهامون رفتار کردند؟ با یکی از قالی‌هاشون آقا تمام مدرسه رو می‌خرید. - -گفتم: - -- تا سر و کارت با الف.ب است به‌پا قیاس نکنی. خودخوری می‌آره. - -و معلم کلاس چهار گفت: - -- اگه فحشمون هم می‌دادند من باز هم راضی بودم، باید واقع‌بین بود. خدا کنه پشیمون نشند. - -بعد هم مدتی درد دل کردیم و تا اتوبوس برسد و سوار بشیم، معلوم شد که معلم کلاس چهار با زنش متارکه کرده و مادر ناظم را سرطانی تشخیص دادند. و بعد هم شب بخیر... - -دو روز تمام مدرسه نرفتم. خجالت می‌کشیدم توی صورت یک کدام‌شان نگاه کنم. و در همین دو روز حاجی آقا با دو نفر آمده بودند، مدرسه را وارسی و صورت‌برداری و ناظم می‌گفت که حتی بچه‌هایی هم که کفش و کلاهی داشتند پاره و پوره آمده بودند. و برای بچه‌ها کفش و لباس خریدند. روزهای بعد احساس کردم زن‌هایی که سر راهم لب جوی آب ظرف می‌شستند، سلام می‌کنند و یک بار هم دعای خیر یکی‌شان را از عقب سر شنیدم.اما چنان از خودم بدم آمده بود که رغبتم نمی‌شد به کفش و لباس‌هاشان نگاه کنم. قربان همان گیوه‌های پاره! بله، نان گدایی فرهنگ را نو نوار کرده بود. - -تازه از دردسرهای اول کار مدرسه فارغ شده بودم که شنیدم که یک روز صبح، یکی از اولیای اطفال آمد. بعد از سلام و احوالپرسی دست کرد توی جیبش و شش تا عکس در آورد، گذاشت روی میزم. شش تا عکس زن . و هر کدام به یک حالت. یعنی چه؟ نگاه تندی به او کردم. آدم مرتبی بود. اداری مانند. کسر شأن خودم می‌دانستم که این گوشه‌ی از زندگی را طبق دستور عکاس‌باشی فلان خانه‌ی بندری ببینم. اما حالا یک مرد اتو کشیده‌ی مرتب آمده بود و شش تا از همین عکس‌ها را روی میزم پهن کرده بود و به انتظار آن که وقاحت عکس‌ها چشم‌هایم را پر کند داشت سیگار چاق می‌کرد. - -حسابی غافلگیر شده بودم... حتماً تا هر شش تای عکس‌ها را ببینم، بیش از یک دقیقه طول کشید. همه از یک نفر بود. به این فکر گریختم که الان هزار ها یا میلیون ها نسخه‌ی آن، توی جیب چه جور آدم‌هایی است و در کجاها و چه قدر خوب بود که همه‌ی این آدم‌ها را می‌شناختم یا می‌دیدم. بیش ازین نمی‌شد گریخت. یارو به تمام وزنه وقاحتش، جلوی رویم نشسته بود. سیگاری آتش زدم و چشم به او دوختم. کلافه بود و پیدا بود برای کتک‌کاری هم آماده باشد. سرخ شده بود و داشت در دود سیگارش تکیه‌گاهی برای جسارتی که می‌خواست به خرج بدهد می‌جست. عکس‌ها را با یک ورقه از اباطیلی که همان روز سیاه کرده بودم، پوشاندم و بعد با لحنی که دعوا را با آن شروع می‌کنند؛ پرسیدم: - -- خوب، غرض؟ - -و صدایم توی اتاق پیچید. حرکتی از روی بیچارگی به خودش داد و همه‌ی جسارت‌ها را با دستش توی جیبش کرد و آرام‌تر از آن چیزی که با خودش تو آورده بود، گفت: - -- چه عرض کنم؟... از معلم کلاس پنج تون بپرسید. - -که راحت شدم و او شروع کرد به این که «این چه فرهنگی است؟ خراب بشود. پس بچه‌های مردم با چه اطمینانی به مدرسه بیایند؟ - -و از این حرف‌ها... - -خلاصه این آقا معلم کاردستی کلاس پنجم، این عکس‌ها را داده به پسر آقا تا آن‌ها را روی تخته سه لایی بچسباند و دورش را سمباده بکشد و بیاورد. به هر صورت معلم کلاس پنج بی‌گدار به آب زده. و حالا من چه بکنم؟ به او چه جوابی بدهم؟ بگویم معلم را اخراج می‌کنم؟ که نه می‌توانم و نه لزومی دارد. او چه بکند؟ حتماً در این شهر کسی را ندارد که به این عکس‌ها دلخوش کرده. ولی آخر چرا این جور؟ یعنی این قدر احمق است که حتی شاگردهایش را نمی‌شناسد؟... پاشدم ناظم را صدا بزنم که خودش آمده بود بالا، توی ایوان منتظر ایستاده بود. من آخرین کسی بودم که از هر اتفاقی در مدرسه خبردار می‌شدم. حضور این ولی طفل گیجم کرده بود که چنین عکس‌هایی را از توی جیب پسرش، و لابد به همین وقاحتی که آن‌ها را روی میز من ریخت، در آورده بوده. وقتی فهمید هر دو در مانده‌ایم سوار بر اسب شد که اله می‌کنم و بله می‌کنم، در مدرسه را می‌بندم، و از این جفنگیات.... - -حتماً نمی‌دانست که اگر در هر مدرسه بسته بشود، در یک اداره بسته شده است. اما من تا او بود نمی‌توانستم فکرم را جمع کنم. می‌خواست پسرش را بخواهیم تا شهادت بدهد و چه جانی کندیم تا حالیش کنیم که پسرش هر چه خفت کشیده، بس است و وعده‌ها دادیم که معلمش را دم خورشید کباب کنیم و از نان خوردن بیندازیم. یعنی اول ناظم شروع کرد که از دست او دل پری داشت و من هم دنبالش را گرفتم. برای دک کردن او چاره‌ای جز این نبود. و بعد رفت، ما دو نفری ماندیم با شش تا عکس زن . حواسم که جمع شد به ناظم سپردم صدایش را در نیاورد و یک هفته‌ی تمام مطلب را با عکس‌ها، توی کشوی میزم قفل کردم و بعد پسرک را صدا زدم. نه عزیزدُردانه می‌نمود و نه هیچ جور دیگر. داد می‌زد که از خانواده‌ی عیال‌واری است. کم‌خونی و فقر. دیدم معلمش زیاد هم بد تشخیص نداده. یعنی زیاد بی‌گدار به آب نزده. گفتم: - -- خواهر برادر هم داری؟ - -- آ... آ...آقا داریم آقا. - -- چند تا؟ - -- آ... آقا چهار تا آقا. - -- عکس‌ها رو خودت به بابات نشون دادی؟ - -- نه به خدا آقا... به خدا قسم... - -- پس چه طور شد؟ - -و دیدم از ترس دارد قالب تهی می‌کند. گرچه چوب‌های ناظم شکسته بود، اما ترس او از من که مدیر باشم و از ناظم و از مدرسه و از تنبیه سالم مانده بود. - -- نترس بابا. کاریت نداریم. تقصیر آقا معلمه که عکس‌ها رو داده... تو کار بدی نکردی بابا جان. فهمیدی؟ اما می‌خواهم ببینم چه طور شد که عکس‌ها دست بابات افتاد. - -- آ.. آ... آخه آقا... آخه... - -می‌دانستم که باید کمکش کنم تا به حرف بیاید. - -گفتم: - -- می‌دونی بابا؟ عکس‌هام چیز بدی نبود. تو خودت فهمیدی چی بود؟ - -- آخه آقا...نه آقا.... خواهرم آقا... خواهرم می‌گفت... - -- خواهرت؟ از تو کوچک‌تره؟ - -- نه آقا. بزرگ‌تره. می‌گفتش که آقا... می‌گفتش که آقا... هیچ چی سر عکس‌ها دعوامون شد. - -دیگر تمام بود. عکس‌ها را به خواهرش نشان داده بود که لای دفترچه پر بوده از عکس آرتیست‌ها. به او پز داده بوده. اما حاضر نبوده، حتی یکی از آن‌ها را به خواهرش بدهد. آدم مورد اعتماد معلم باشد و چنین خبطی بکند؟ و تازه جواب معلم را چه بدهد؟ ناچار خواهر او را لو داده بوده. بعد از او معلم را احضار کردم. علت احضار را می‌دانست. و داد می‌زد که چیزی ندارد بگوید. پس از یک هفته مهلت، هنوز از وقاحتی که من پیدا کرده بودم، تا از آدم خلع سلاح‌شده‌ای مثل او، دست بر ندارم، در تعجب بود. به او سیگار تعارف کردم و این قصه را برایش تعریف کردم که در اوایل تأسیس وزارت معارف، یک روز به وزیر خبر می‌دهند که فلان معلم با فلان بچه روابطی دارد. وزیر فوراً او را می‌خواهد و حال و احوال او را می‌پرسد و این‌که چرا تا به حال زن نگرفته و ناچار تقصیر گردن بی‌پولی می‌افتد و دستور که فلان قدر به او کمک کنند تا عروسی راه بیندازد و خود او هم دعوت بشود و قضیه به همین سادگی تمام می‌شود. و بعد گفتم که خیلی جوان‌ها هستند که نمی‌توانند زن بگیرند و وزرای فرهنگ هم این روزها گرفتار مصاحبه‌های روزنامه‌ای و رادیویی هستند. اما در نجیب‌خانه‌ها که باز است و ازین مزخرفات... و هم‌دردی و نگذاشتم یک کلمه حرف بزند. بعد هم عکس را که توی پاکت گذاشته بودم، به دستش دادم و وقاحت را با این جمله به حد اعلا رساندم که: - -- اگر به تخته نچسبونید، ضررشون کم‌تره. - -تا حقوقم به لیست اداره‌ی فرهنگ برسه، سه ماه طول کشید. فرهنگی‌های گداگشنه و خزانه‌ی خالی و دست‌های از پا درازتر! اما خوبیش این بود که در مدرسه‌ی ما فراش جدیدمان پولدار بود و به همه‌شان قرض داد. کم کم بانک مدرسه شده بود. از سیصد و خرده‌ای تومان که می‌گرفت، پنجاه تومان را هم خرج نمی‌کرد. نه سیگار می‌کشید و نه اهل سینما بود و نه برج دیگری داشت. از این گذشته، باغبان یکی از دم‌کلفت‌های همان اطراف بود و باغی و دستگاهی و سور و ساتی و لابد آشپزخانه‌ی مرتبی. خیلی زود معلم‌ها فهمیدند که یک فراش پولدار خیلی بیش‌تر به درد می‌خورد تا یک مدیر بی‌بو و خاصیت. - -این از معلم‌ها. حقوق مرا هم هنوز از مرکز می‌دادند. با حقوق ماه بعد هم اسم مرا هم به لیست اداره منتقل کردند. درین مدت خودم برای خودم ورقه انجام کار می‌نوشتم و امضا می‌کردم و می‌رفتم از مدرسه‌ای که قبلاً در آن درس می‌دادم، حقوقم را می‌گرفتم. سر و صدای حقوق که بلند می‌شد معلم‌ها مرتب می‌شدند و کلاس ماهی سه چهار روز کاملاً دایر بود. تا ورقه‌ی انجام کار به دستشان بدهم. غیر از همان یک بار - در اوایل کار- که برای معلم حساب پنج و شش قرمز توی دفتر گذاشتیم، دیگر با مداد قرمز کاری نداشتیم و خیال همه‌شان راحت بود. وقتی برای گرفتن حقوقم به اداره رفتم، چنان شلوغی بود که به خودم گفتم کاش اصلاً حقوقم را منتقل نکرده بودم. نه می‌توانستم سر صف بایستم و نه می‌توانستم از حقوقم بگذرم. تازه مگر مواجب‌بگیر دولت چیزی جز یک انبان گشاده‌ی پای صندوق است؟..... و اگر هم می‌ماندی با آن شلوغی باید تا دو بعداز ظهر سر پا بایستی. همه‌ی جیره‌خوارهای اداره بو برده بودند که مدیرم. و لابد آن‌قدر ساده لوح بودند که فکر کنند روزی گذارشان به مدرسه‌ی ما بیفتد. دنبال سفته‌ها می‌گشتند، به حسابدار قبلی فحش می‌دادند، التماس می‌کردند که این ماه را ندیده بگیرید و همه‌ی حق و حساب‌دان شده بودند و یکی که زودتر از نوبت پولش را می‌گرفت صدای همه در می‌آمد. در لیست مدرسه، بزرگ‌ترین رقم مال من بود. درست مثل بزرگ‌ترین گناه در نامه‌ی عمل. دو برابر فراش جدیدمان حقوق می‌گرفتم. از دیدن رقم‌های مردنی حقوق دیگران چنان خجالت کشیدم که انگار مال آن‌ها را دزدیده‌ام. و تازه خلوت که شد و ده پانزده تا امضا که کردم، صندوق‌دار چشمش به من افتاد و با یک معذرت، شش صد تومان پول دزدی را گذاشت کف دستم... مرده شور! - -هنوز برف اول نباریده بود که یک روز عصر، معلم کلاس چهار رفت زیر ماشین. زیر یک سواری. مثل همه‌ی عصرها من مدرسه نبودم. دم غروب بود که فراش قدیمی مدرسه دم در خونه‌مون، خبرش را آورد. که دویدم به طرف لباسم و تا حاضر بشوم، می‌شنیدم که دارد قضیه را برای زنم تعریف می‌کند. ماشین برای یکی از آمریکایی‌ها بوده. باقیش را از خانه که در آمدیم برایم تعریف کرد. گویا یارو خودش پشت فرمون بوده و بعد هم هول شده و در رفته. بچه‌ها خبر را به مدرسه برگردانده‌اند و تا فراش و زنش برسند، جمعیت و پاسبان‌ها سوارش کرده بودند و فرستاده بوده‌اند مریض‌خانه. به اتوبوس که رسیدم، دیدم لاک پشت است. فراش را مرخص کردم و پریدم توی تاکسی. اول رفتم سراغ پاسگاه جدید کلانتری. تعاریف تکه و پاره‌ای از پرونده مطلع بود. اما پرونده تصریحی نداشت که راننده که بوده. اما هیچ کس نمی‌دانست عاقبت چه بلایی بر سر معلم کلاس چهار ما آمده است. کشیک پاسگاه همین قدر مطلع بود که درین جور موارد «طبق جریان اداری» اول می‌روند سرکلانتری، بعد دایره‌ی تصادفات و بعد بیمارستان. اگر آشنا در نمی‌آمدیم، کشیک پاسگاه مسلماً نمی‌گذاشت به پرونده نگاه چپ بکنم. احساس کردم میان اهل محل کم‌کم دارم سرشناس می‌شوم. و از این احساس خنده‌ام گرفت. - -ساعت ۸ دم در بیمارستان بودم، اگر سالم هم بود حتماً یه چیزیش شده بود. همان طور که من یه چیزیم می‌شد. روی در بیمارستان نوشته شده بود: «از ساعت ۷ به بعد ورود ممنوع». در زدم. از پشت در کسی همین آیه را صادر کرد. دیدم فایده ندارد و باید از یک چیزی کمک بگیرم. از قدرتی، از مقامی، از هیکلی، از یک چیزی. صدایم را کلفت کردم و گفتم:« من...» می‌خواستم بگویم من مدیر مدرسه‌ام. ولی فوراً پشیمان شدم. یارو لابد می‌گفت مدیر مدرسه کدام سگی است؟ این بود با کمی مکث و طمطراق فراوان جمله‌ام را این طور تمام کردم: - -- ...بازرس وزارت فرهنگم. - -که کلون صدایی کرد و لای در باز شد. یارو با چشم‌هایش سلام کرد. رفتم تو و با همان صدا پرسیدم: - -- این معلمه مدرسه که تصادف کرده... - -تا آخرش را خواند. یکی را صدا زد و دنبالم فرستاد که طبقه‌ی فلان، اتاق فلان. از حیاط به راهرو و باز به حیاط دیگر که نصفش را برف پوشانده بود و من چنان می‌دویدم که یارو از عقب سرم هن هن می‌کرد. طبقه‌ی اول و دوم و چهارم. چهار تا پله یکی. راهرو تاریک بود و پر از بوهای مخصوص بود. هن هن کنان دری را نشان داد که هل دادم و رفتم تو. بو تندتر بود و تاریکی بیشتر. تالاری بود پر از تخت و جیرجیر کفش و خرخر یک نفر. دور یک تخت چهار نفر ایستاده بودند. حتماً خودش بود. پای تخت که رسیدم، احساس کردم همه‌ی آنچه از خشونت و تظاهر و ابهت به کمک خواسته بودم آب شد و بر سر و صورتم راه افتاد. و این معلم کلاس چهارم مدرسه‌ام بود. سنگین و با شکم بر آمده دراز کشیده بود. خیلی کوتاه‌تر از زمانی که سر پا بود به نظرم آمد. صورت و سینه‌اش از روپوش چرک‌مُرد بیرون بود. صورتش را که شسته بودند کبود کبود بود، درست به رنگ جای سیلی روی صورت بچه‌ها. مرا که دید، لبخند و چه لبخندی! شاید می‌خواست بگوید مدرسه‌ای که مدیرش عصرها سر کار نباشد، باید همین جورها هم باشد. خنده توی صورت او همین طور لرزید و لرزید تا یخ زد. - -«آخر چرا تصادف کردی؟...» - -مثل این که سوال را ازو کردم. اما وقتی که دیدم نمی‌تواند حرف بزند و به جای هر جوابی همان خنده‌ی یخ‌بسته را روی صورت دارد، خودم را به عنوان او دم چک گرفتم. «آخه چرا؟ چرا این هیکل مدیر کلی را با خودت این قد این ور و آن ور می‌بری تا بزنندت؟ تا زیرت کنند؟ مگر نمی‌دانستی که معلم حق ندارد این قدر خوش‌هیکل باشد؟ آخر چرا تصادف کردی؟» به چنان عتاب و خطابی این‌ها را می‌گفتم که هیچ مطمئن نیستم بلند بلند به خودش نگفته باشم. و یک مرتبه به کله‌ام زد که «مبادا خودت چشمش زده باشی؟» و بعد: «احمق خاک بر سر! بعد از سی و چند سال عمر، تازه خرافاتی شدی!» و چنان از خودم بیزاریم گرفت که می‌خواستم به یکی فحش بدهم، کسی را بزنم. که چشمم به دکتر کشیک افتاد. - -- مرده شور این مملکتو ببره. ساعت چهار تا حالا از تن این مرد خون می‌ره. حیفتون نیومد؟... - -دستی روی شانه‌ام نشست و فریادم را خواباند. برگشتم پدرش بود. او هم می‌خندید. دو نفر دیگر هم با او بودند. همه دهاتی‌وار؛ همه خوش قد و قواره. حظ کردم! آن دو تا پسرهایش بودند یا برادرزاده‌هایش یا کسان دیگرش. تازه داشت گل از گلم می‌شکفت که شنیدم: - -- آقا کی باشند؟ - -این راهم دکتر کشیک گفت که من باز سوار شدم: - -- مرا می‌گید آقا؟ من هیشکی. یک آقا مدیر کوفتی. این هم معلمم. - -که یک مرتبه عقل هی زد و «پسر خفه شو» و خفه شدم. بغض توی گلویم بود. دلم می‌خواست یک کلمه دیگر بگوید. یک کنایه بزند... نسبت به مهارت هیچ دکتری تا کنون نتوانسته‌ام قسم بخورم. دستش را دراز کرد که به اکراه فشار دادم و بعد شیشه‌ی بزرگی را نشانم داد که وارونه بالای تخت آویزان بود و خرفهمم کرد که این جوری غذا به او می‌رسانند و عکس هم گرفته‌اند و تا فردا صبح اگر زخم‌ها چرک نکند، جا خواهند انداخت و گچ خواهند کرد. که یکی دیگر از راه رسید. گوشی به دست و سفید پوش و معطر. با حرکاتی مثل آرتیست سینما. سلامم کرد. صدایش در ته ذهنم چیزی را مختصر تکانی داد. اما احتیاجی به کنجکاوی نبود. یکی از شاگردهای نمی‌دانم چند سال پیشم بود. خودش خودش را معرفی کرد. آقای دکتر...! عجب روزگاری! هر تکه از وجودت را با مزخرفی از انبان مزخرفاتت، مثل ذره‌ای روزی در خاکی ریخته‌ای که حالا سبز کرده. چشم داری احمق. این تویی که روی تخت دراز کشیده‌ای. ده سال آزگار از پلکان ساعات و دقایق عمرت هر لحظه یکی بالا رفته و تو فقط خستگی این بار را هنوز در تن داری. این جوجه‌فکلی و جوجه‌های دیگر که نمی‌شناسی‌شان، همه از تخمی سر در آورده‌اند که روزی حصار جوانی تو بوده و حالا شکسته و خالی مانده. دستش را گرفتم و کشیدمش کناری و در گوشش هر چه بد و بی‌راه می‌دانستم، به او و همکارش و شغلش دادم. مثلاً می‌خواستم سفارش معلم کلاس چهار مدرسه‌ام را کرده باشم. بعد هم سری برای پدر تکان دادم و گریختم. از در که بیرون آمدم، حیاط بود و هوای بارانی. از در بزرگ که بیرون آمدم به این فکر می‌کردم که «اصلا به تو چه؟ اصلاً چرا آمدی؟ می‌خواستی کنجکاوی‌ات را سیرکنی؟» و دست آخر به این نتیجه رسیدم که «طعمه‌ای برای میزنشین‌های شهربانی و دادگستری به دست آمده و تو نه می‌توانی این طعمه را از دستشان بیرون بیاوری و نه هیچ کار دیگری می‌توانی بکنی...» - -و داشتم سوار تاکسی می‌شدم تا برگردم خانه که یک دفعه به صرافت افتادم که اقلاً چرا نپرسیدی چه بلایی به سرش آمده؟» خواستم عقب‌گرد کنم، اما هیکل کبود معلم کلاس چهارم روی تخت بود و دیدم نمی‌توانم. خجالت می‌کشیدم و یا می‌ترسیدم. آن شب تا ساعت دو بیدار بودم و فردا یک گزارش مفصل به امضای مدیر مدرسه و شهادت همه‌ی معلم‌ها برای اداره‌ی فرهنگ و کلانتری محل و بعد هم دوندگی در اداره‌ی بیمه و قرار بر این که روزی نه تومان بودجه برای خرج بیمارستان او بدهند و عصر پس از مدتی رفتم مدرسه و کلاس‌ها را تعطیل کردم و معلم‌ها و بچه‌های ششم را فرستادم عیادتش و دسته گل و ازین بازی‌ها... و یک ساعتی در مدرسه تنها ماندم و فارغ از همه چیز برای خودم خیال بافتم.... و فردا صبح پدرش آمد سلام و احوالپرسی و گفت یک دست و یک پایش شکسته و کمی خونریزی داخل مغز و از طرف یارو آمریکاییه آمده‌اند عیادتش و وعده و وعید که وقتی خوب شد، در اصل چهار استخدامش کنند و با زبان بی‌زبانی حالیم کرد که گزارش را بیخود داده‌ام و حالا هم داده‌ام، دنبالش نکنم و رضایت طرفین و کاسه‌ی از آش داغ‌تر و از این حرف‌ها... خاک بر سر مملکت. - -اوایل امر توجهی به بچه‌ها نداشتم. خیال می‌کردم اختلاف سِنی میان‌مان آن قدر هست که کاری به کار همدیگر نداشته باشیم. همیشه سرم به کار خودم بود. در دفتر را می‌بستم و در گرمای بخاری دولت قلم صد تا یک غاز می‌زدم. اما این کار مرتب سه چهار هفته بیش‌تر دوام نکرد. خسته شدم. ناچار به مدرسه بیشتر می‌رسیدم. یاد روزهای قدیمی با دوستان قدیمی به خیر چه آدم‌های پاک و بی‌آلایشی بودند، چه شخصیت‌های بی‌نام و نشانی و هر کدام با چه زبانی و با چه ادا و اطوارهای مخصوص به خودشان و این جوان‌های چلفته‌ای. چه مقلدهای بی‌دردسری برای فرهنگی‌مابی! نه خبری از دیروزشان داشتند و نه از املاک تازه‌ای که با هفتاد واسطه به دست‌شان داده بودند، چیزی سرشان می‌شد. بدتر از همه بی‌دست و پایی‌شان بود. آرام و مرتب درست مثل واگن شاه عبدالعظیم می‌آمدند و می‌رفتند. فقط بلد بودند روزی ده دقیقه دیرتر بیایند و همین. و از این هم بدتر تنگ‌نظری‌شان بود. - -سه بار شاهد دعواهایی بودم که سر یک گلدان میخک یا شمعدانی بود. بچه‌باغبان‌ها زیاد بودند و هر کدام‌شان حداقل ماهی یک گلدان میخک یا شمعدانی می‌آوردند که در آن برف و سرما نعمتی بود. اول تصمیم گرفتم، مدرسه را با آن‌ها زینت دهم. ولی چه فایده؟ نه کسی آب‌شان می‌داد و نه مواظبتی. و باز بدتر از همه‌ی این‌ها، بی‌شخصیتی معلم‌ها بود که درمانده‌ام کرده بود. دو کلمه نمی‌توانستند حرف بزنند. عجب هیچ‌کاره‌هایی بودند! احساس کردم که روز به روز در کلاس‌ها معلم‌ها به جای دانش‌آموزان جاافتاده‌تر می‌شوند. در نتیجه گفتم بیش‌تر متوجه بچه‌ها باشم. - -آن‌ها که تنها با ناظم سر و کار داشتند و مثل این بود که به من فقط یک سلام نیمه‌جویده بدهکارند. با این همه نومیدکننده نبودند. توی کوچه مواظب‌شان بودم. می‌خواستم حرف و سخن‌ها و درد دل‌ها و افکارشان را از یک فحش نیمه‌کاره یا از یک ادای نیمه‌تمام حدس بزنم، که سلام‌نکرده در می‌رفتند. خیلی کم تنها به مدرسه می‌آمدند. پیدا بود که سر راه همدیگر می‌ایستند یا در خانه‌ی یکدیگر می‌روند. سه چهار نفرشان هم با اسکورت می‌آمدند. از بیست سی نفری که ناهار می‌ماندند، فقط دو نفرشان چلو خورش می‌آوردند؛ فراش اولی مدرسه برایم خبر می‌آورد. بقیه گوشت‌کوبیده، پنیر گردوئی، دم پختکی و از این جور چیزها. دو نفرشان هم بودند که نان سنگک خالی می‌آوردند. برادر بودند. پنجم و سوم. صبح که می‌آمدند، جیب‌هاشان باد کرده بود. سنگک را نصف می‌کردند و توی جیب‌هاشان می‌تپاندند و ظهر می‌شد، مثل آن‌هایی که ناهارشان را در خانه می‌خورند، می‌رفتند بیرون. من فقط بیرون رفتن‌شان را می‌دیدم. اما حتی همین‌ها هر کدام روزی، یکی دو قران از فراش مدرسه خرت و خورت می‌خریدند. از همان فراش قدیمی مدرسه که ماهی پنج تومان سرایداریش را وصول کرده بودم. هر روز که وارد اتاقم می‌شدم پشت سر من می‌آمد بارانی‌ام را بر می‌داشت و شروع می‌کرد به گزارش دادن، که دیروز باز دو نفر از معلم‌ها سر یک گلدان دعوا کرده‌اند یا مأمور فرماندار نظامی آمده یا دفتردار عوض شده و از این اباطیل... پیدا بود که فراش جدید هم در مطالبی که او می‌گفت، سهمی دارد. - -یک روز در حین گزارش دادن، اشاره‌ای کرد به این مطلب که دیروز عصر یکی از بچه‌های کلاس چهار دو تا کله قند به او فروخته است. درست مثل اینکه سر کلاف را به دستم داده باشد پرسیدم: - -- چند؟ - -- دو تومنش دادم آقا. - -- زحمت کشیدی. نگفتی از کجا آورده؟ - -- من که ضامن بهشت و جهنمش نبودم آقا. - -بعد پرسیدم: - -- چرا به آقای ناظم خبر ندادی؟ - -می‌دانستم که هم او و هم فراش جدید، ناظم را هووی خودشان می‌دانند و خیلی چیزهاشان از او مخفی بود. این بود که میان من و ناظم خاصه‌خرجی می‌کردند. در جوابم همین طور مردد مانده بود که در باز شد و فراش جدید آمد تو. که: - -- اگه خبرش می‌کرد آقا بایست سهمش رو می‌داد... - -اخمم را درهم کشیدم و گفتم: - -- تو باز رفتی تو کوک مردم! اونم این جوری سر نزده که نمی‌آیند تو اتاق کسی، پیرمرد! - -و بعد اسم پسرک را ازشان پرسیدم و حالی‌شان کردم که چندان مهم نیست و فرستادمشان برایم چای بیاورند. بعد کارم را زودتر تمام کردم و رفتم به اتاق دفتر احوالی از مادر ناظم پرسیدم و به هوای ورق زدن پرونده‌ها فهمیدم که پسرک شاگرد دوساله است و پدرش تاجر بازار. بعد برگشتم به اتاقم. یادداشتی برای پدر نوشتم که پس فردا صبح، بیاید مدرسه و دادم دست فراش جدید که خودش برساند و رسیدش را بیاورد. - -و پس فردا صبح یارو آمد. باید مدیر مدرسه بود تا دانست که اولیای اطفال چه راحت تن به کوچک‌ترین خرده‌فرمایش‌های مدرسه می‌دهند. حتم دارم که اگر از اجرای ثبت هم دنبال‌شان بفرستی به این زودی‌ها آفتابی نشوند. چهل و پنج ساله مردی بود با یخه‌ی بسته بی‌کراوات و پالتویی که بیش‌تر به قبا می‌ماند. و خجالتی می‌نمود. هنوز ننشسته، پرسیدم: - -- شما دو تا زن دارید آقا؟ - -درباره‌ی پسرش برای خودم پیش‌گویی‌هایی کرده بودم و گفتم این طوری به او رودست می‌زنم. پیدا بود که از سؤالم زیاد یکه نخورده است. گفتم برایش چای آوردند و سیگاری تعارفش کردم که ناشیانه دود کرد از ترس این که مبادا جلویم در بیاید که - به شما چه مربوط است و از این اعتراض‌ها - امانش ندادم و سؤالم را این جور دنبال کردم: - -- البته می‌بخشید. چون لابد به همین علت بچه شما دو سال در یک کلاس مانده. - -شروع کرده بودم برایش یک میتینگ بدهم که پرید وسط حرفم: - -- به سر شما قسم، روزی چهار زار پول تو جیبی داره آقا. پدرسوخته‌ی نمک به حروم...! - -حالیش کردم که علت، پول تو جیبی نیست و خواستم که عصبانی نشود و قول گرفتم که اصلاً به روی پسرش هم نیاورد و آن وقت میتینگم را برایش دادم که لابد پسر در خانه مهر و محبتی نمی‌بیند و غیب‌گویی‌های دیگر... تا عاقبت یارو خجالتش ریخت و سرِ درد دلش باز شد که عفریته زن اولش همچه بوده و همچون بوده و پسرش هم به خودش برده و کی طلاقش داده و از زن دومش چند تا بچه دارد و این نره‌خر حالا باید برای خودش نان‌آور شده باشد و زنش حق دارد که با دو تا بچه‌ی خرده‌پا به او نرسد... من هم کلی برایش صحبت کردم. چایی دومش را هم سر کشید و قول‌هایش را که داد و رفت، من به این فکر افتادم که «نکند علمای تعلیم و تربیت هم، همین جورها تخم دوزرده می‌کنند!» - -یک روز صبح که رسیدم، ناظم هنوز نیامده بود. از این اتفاق‌ها کم می‌افتاد. ده دقیقه‌ای از زنگ می‌گذشت و معلم‌ها در دفتر سرگرم اختلاط بودند. خودم هم وقتی معلم بودم به این مرض دچار بودم. اما وقتی مدیر شدم تازه فهمیدم که معلم‌ها چه لذتی می‌برند. حق هم داشتند. آدم وقتی مجبور باشد شکلکی را به صورت بگذارد که نه دیگران از آن می‌خندند و نه خود آدم لذتی می‌برد، پیداست که رفع تکلیف می‌کند. زنگ را گفتم زدند و بچه‌ها سر کلاس رفتند. دو تا از کلاس‌ها بی‌معلم بود. یکی از ششمی‌ها را فرستادم سر کلاس سوم که برای‌شان دیکته بگوید و خودم رفتم سر کلاس چهار. مدیر هم که باشی، باز باید تمرین کنی که مبادا فوت و فن معلمی از یادت برود. در حال صحبت با بچه‌ها بودم که فراش خبر آورد که خانمی توی دفتر منتظرم است. خیال کردم لابد همان زنکه‌ی بیکاره‌ای است که هفته‌ای یک بار به هوای سرکشی، به وضع درس و مشق بچه‌اش سری می‌زند. زن سفیدرویی بود با چشم‌های درشت محزون و موی بور. بیست و پنج ساله هم نمی‌نمود. اما بچه‌اش کلاس سوم بود. روز اول که دیدمش لباس نارنجی به تن داشت و تن بزک کرده بود. از زیارت من خیلی خوشحال شد و از مراتب فضل و ادبم خبر داشت. - -خیلی ساده آمده بود تا با دو تا مرد حرفی زده باشد. آن طور که ناظم خبر می‌داد، یک سالی طلاق گرفته بود و روی هم رفته آمد و رفتنش به مدرسه باعث دردسر بود. وسط بیابان و مدرسه‌ای پر از معلم‌های عزب و بی‌دست و پا و یک زن زیبا... ناچار جور در نمی‌آمد. این بود که دفعات بعد دست به سرش می‌کردم، اما از رو نمی‌رفت. سراغ ناظم و اتاق دفتر را می‌گرفت و صبر می‌کرد تا زنگ را بزنند و معلم‌ها جمع بشوند و لابد حرف و سخنی و خنده‌ای و بعد از معلم کلاس سوم سراغ کار و بار و بچه‌اش را می‌گرفت و زنگ بعد را که می‌زدند، خداحافظی می‌کرد و می‌رفت. آزاری نداشت. با چشم‌هایش نفس معلم‌ها را می‌برید. و حالا باز هم همان زن بود و آمده بود و من تا از پلکان پایین بروم در ذهنم جملات زننده‌ای ردیف می‌کردم، تا پایش را از مدرسه ببرد که در را باز کردم و سلام... - -عجب! او نبود. دخترک یکی دو ساله‌ای بود با دهان گشاد و موهای زبرش را به زحمت عقب سرش گلوله کرده بود و بفهمی نفهمی دستی توی صورتش برده بود. روی هم رفته زشت نبود. اما داد می‌زد که معلم است. گفتم که مدیر مدرسه‌ام و حکمش را داد دستم که دانشسرا دیده بود و تازه استخدام شده بود. برایمان معلم فرستاده بودند. خواستم بگویم «مگر رئیس فرهنگ نمی‌داند که این جا بیش از حد مرد است» ولی دیدم لزومی ندارد و فکر کردم این هم خودش تنوعی است. - -به هر صورت زنی بود و می‌توانست محیط خشن مدرسه را که به طرز ناشیانه‌ای پسرانه بود، لطافتی بدهد و خوش‌آمد گفتم و چای آوردند که نخورد و بردمش کلاس‌های سوم و چهارم را نشانش دادم که هر کدام را مایل است، قبول کند و صحبت از هجده ساعت درس که در انتظار او بود و برگشتیم به دفتر .پرسید غیر از او هم، معلم زن داریم. گفتم: - -- متأسفانه راه مدرسه‌ی ما را برای پاشنه‌ی کفش خانم‌ها نساخته‌اند. - -که خندید و احساس کردم زورکی می‌خندد. بعد کمی این دست و آن دست کرد و عاقبت: - -- آخه من شنیده بودم شما با معلماتون خیلی خوب تا می‌کنید. - -صدای جذابی داشت. فکر کردم حیف که این صدا را پای تخته سیاه خراب خواهد کرد. و گفتم: - -- اما نه این قدر که مدرسه تعطیل بشود خانم! و لابد به عرض‌تون رسیده که همکارهای شما، خودشون نشسته‌اند و تصمیم گرفته‌اند که هجده ساعت درس بدهند. بنده هیچ‌کاره‌ام. - -- اختیار دارید. - -و نفهمیدم با این «اختیار دارید» چه می‌خواست بگوید. اما پیدا بود که بحث سر ساعات درس نیست. آناً تصمیم گرفتم، امتحانی بکنم: - -- این را هم اطلاع داشته باشید که فقط دو تا از معلم‌های ما متأهل‌اند. - -که قرمز شد و برای این که کار دیگری نکرده باشد، برخاست و حکمش را از روی میز برداشت. پا به پا می‌شد که دیدم باید به دادش برسم. ساعت را از او پرسیدم. وقت زنگ بود. فراش را صدا کردم که زنگ را بزند و بعد به او گفتم، بهتر است مشورت دیگری هم با رئیس فرهنگ بکند و ما به هر صورت خوشحال خواهیم شد که افتخار همکاری با خانمی مثل ایشان را داشته باشیم و خداحافظ شما. از در دفتر که بیرون رفت، صدای زنگ برخاست و معلم‌ها انگار موشان را آتش زده‌اند، به عجله رسیدند و هر کدام از پشت سر، آن قدر او را پاییدند تا از در بزرگ آهنی مدرسه بیرون رفت. - -فردا صبح معلوم شد که ناظم، دنبال کار مادرش بوده است که قرار بود بستری شود، تا جای سرطان گرفته را یک دوره برق بگذارند. کل کار بیمارستان را من به کمک دوستانم انجام دادم و موقع آن رسیده بود که مادرش برود بیمارستان اما وحشتش گرفته بود و حاضر نبود به بیمارستان برود. و ناظم می‌خواست رسماً دخالت کنم و با هم برویم خانه‌شان و با زبان چرب و نرمی که به قول ناظم داشتم مادرش را راضی کنم. چاره‌ای نبود. مدرسه را به معلم‌ها سپردیم و راه افتادیم. بالاخره به خانه‌ی آن‌ها رسیدیم. خانه‌ای بسیار کوچک و اجاره‌ای. مادر با چشم‌های گود نشسته و انگار زغال به صورت مالیده! سیاه نبود اما رنگش چنان تیره بود که وحشتم گرفت. اصلاً صورت نبود. زخم سیاه شده‌ای بود که انگار از جای چشم‌ها و دهان سر باز کرده است. کلی با مادرش صحبت کردم. از پسرش و کلی دروغ و دونگ، و چادرش را روی چارقدش انداختیم و علی... و خلاصه در بیمارستان بستری شدند. - -فردا که به مدرسه آمدم، ناظم سرحال بود و پیدا بود که از شر چیزی خلاص شده است و خبر داد که معلم کلاس سه را گرفته‌اند. یک ماه و خرده‌ای می‌شد که مخفی بود و ما ورقه‌ی انجام کارش را به جانشین غیر رسمی‌اش داده بودیم و حقوقش لنگ نشده بود و تا خبر رسمی بشنود و در روزنامه‌ای بیابد و قضیه به اداره‌ی فرهنگ و لیست حقوق بکشد، باز هم می‌دادیم. اما خبر که رسمی شد، جانشین واجد شرایط هم نمی‌توانست بفرستد و باید طبق مقررات رفتار می‌کردیم و بدیش همین بود. کم کم احساس کردم که مدرسه خلوت شده است و کلاس‌ها اغلب اوقات بی‌کارند. جانشین معلم کلاس چهار هنوز سر و صورتی به کارش نداده بود و حالا یک کلاس دیگر هم بی‌معلم شد. این بود که باز هم به سراغ رئیس فرهنگ رفتم. معلوم شد آن دخترک ترسیده و «نرسیده متلک پیچش کرده‌اید» رئیس فرهنگ این طور می‌گفت. و ترجیح داده بود همان زیر نظر خودش دفترداری کند. و بعد قول و قرار و فردا و پس فردا و عاقبت چهار روز دوندگی تا دو تا معلم گرفتم. یکی جوانکی رشتی که گذاشتیمش کلاس چهار و دیگری باز یکی ازین آقاپسرهای بریانتین‌زده که هر روز کراوات عوض می‌کرد، با نقش‌ها و طرح‌های عجیب. عجب فرهنگ را با قرتی‌ها در آمیخته بودند! باداباد. او را هم گذاشتیم سر کلاس سه. اواخر بهمن، یک روز ناظم آمد اتاقم که بودجه‌ی مدرسه را زنده کرده است. گفتم: - -- مبارکه، چه قدر گرفتی؟ - -- هنوز هیچ چی آقا. قراره فردا سر ظهر بیاند این جا آقا و همین جا قالش رو بکنند. - -و فردا اصلاً مدرسه نرفتم. حتماً می‌خواست من هم باشم و در بده بستان ماهی پانزده قران، حق نظافت هر اتاق نظارت کنم و از مدیریتم مایه بگذارم تا تنخواه‌گردان مدرسه و حق آب و دیگر پول‌های عقب‌افتاده وصول بشود... فردا سه نفری آمده بودند مدرسه. ناهار هم به خرج ناظم خورده بودند. و قرار دیگری برای یک سور حسابی گذاشته بودند و رفته بودند و ناظم با زبان بی‌زبانی حالیم کرد که این بار حتماً باید باشم و آن طور که می‌گفت، جای شکرش باقی بود که مراعات کرده بودند و حق بوقی نخواسته بودند. اولین باری بود که چنین اهمیتی پیدا می‌کردم. این هم یک مزیت دیگر مدیری مدرسه بود! سی صد تومان از بودجه‌ی دولت بسته به این بود که به فلان مجلس بروی یا نروی. تا سه روز دیگر موعد سور بود، اصلاً یادم نیست چه کردم. اما همه‌اش در این فکر بودم که بروم یا نروم؟ یک بار دیگر استعفانامه‌ام را توی جیبم گذاشتم و بی این که صدایش را در بیاورم، روز سور هم نرفتم. - -بعد دیدم این طور که نمی‌شود. گفتم بروم قضایا را برای رئیس فرهنگ بگویم. و رفتم. سلام و احوالپرسی نشستم. اما چه بگویم؟ بگویم چون نمی‌خواستم در خوردن سور شرکت کنم، استعفا می‌دهم؟... دیدم چیزی ندارم که بگویم. و از این گذشته خفت‌آور نبود که به خاطر سیصد تومان جا بزنم و استعفا بدهم؟ و «خداحافظ؛ فقط آمده بودم سلام عرض کنم.» و از این دروغ‌ها و استعفانامه‌ام را توی جوی آب انداختم. اما ناظم؛ یک هفته‌ای مثل سگ بود. عصبانی، پر سر و صدا و شارت و شورت! حتی نرفتم احوال مادرش را بپرسم. یک هفته‌ی تمام می‌رفتم و در اتاقم را می‌بستم و سوراخ‌های گوشم را می‌گرفتم و تا اِز و چِزّ بچه‌ها بخوابد، از این سر تا آن سر اتاق را می‌کوبیدم. ده روز تمام، قلب من و بچه‌ها با هم و به یک اندازه از ترس و وحشت تپید. تا عاقبت پول‌ها وصول شد. منتها به جای سیصد و خرده‌ای، فقط صد و پنجاه تومان. علت هم این بود که در تنظیم صورت حساب‌ها اشتباهاتی رخ داده بود که ناچار اصلاحش کرده بودند! - -غیر از آن زنی که هفته‌ای یک بار به مدرسه سری می‌زد، از اولیای اطفال دو سه نفر دیگر هم بودند که مرتب بودند. یکی همان پاسبانی که با کمربند، پاهای پسرش را بست و فلک کرد. یکی هم کارمند پست و تلگرافی بود که ده روزی یک بار می‌آمد و پدر همان بچه‌ی شیطان. و یک استاد نجار که پسرش کلاس اول بود و خودش سواد داشت و به آن می‌بالید و کارآمد می‌نمود. یک مقنی هم بود درشت استخوان و بلندقد که بچه‌اش کلاس سوم بود و هفته‌ای یک بار می‌آمد و همان توی حیاط، ده پانزده دقیقه‌ای با فراش‌ها اختلاط می‌کرد و بی سر و صدا می‌رفت. نه کاری داشت، نه چیزی از آدم می‌خواست و همان طور که آمده بود چند دقیقه‌ای را با فراش صحبت می‌کرد و بعد می رفت. فقط یک روز نمی‌دانم چرا رفته بود بالای دیوار مدرسه. البته اول فکر کردم مأمور اداره برق است ولی بعد متوجه شدم که همان مرد مقنی است. بچه‌ها جیغ و فریاد می‌کردند و من همه‌اش درین فکر بودم که چه طور به سر دیوار رفته است؟ ماحصل داد و فریادش این بود که چرا اسم پسر او را برای گرفتن کفش و لباس به انجمن ندادیم. وقتی به او رسیدم نگاهی به او انداختم و بعد تشری به ناظم و معلم ها زدم که ولش کردند و بچه‌ها رفتند سر کلاس و بعد بی این که نگاهی به او بکنم، گفتم: - -- خسته نباشی اوستا. - -و همان طور که به طرف دفتر می‌رفتم رو به ناظم و معلم‌ها افزودم: - -- لابد جواب درست و حسابی نشنیده که رفته سر دیوار. - -که پشت سرم گرپ صدایی آمد و از در دفتر که رفتم تو، او و ناظم با هم وارد شدند. گفتم نشست. و به جای این‌که حرفی بزند به گریه افتاد. هرگز گمان نمی‌کردم از چنان قد و قامتی صدای گریه در بیاید. این بود که از اتاق بیرون آمدم و فراش را صدا زدم که آب برایش بیاورد و حالش که جا آمد، بیاوردش پهلوی من. اما دیگر از او خبری نشد که نشد. نه آن روز و نه هیچ روز دیگر. آن روز چند دقیقه‌ای بعد از شیشه‌ی اتاق خودم دیدمش که دمش را لای پایش گذاشته بود از در مدرسه بیرون می‌رفت و فراش جدید آمد که بله می‌گفتند از پسرش پنج تومان خواسته بودند تا اسمش را برای کفش و لباس به انجمن بدهند. پیدا بود باز توی کوک ناظم رفته است. مرخصش کردم و ناظم را خواستم. معلوم شد می‌خواسته ناظم را بزند. همین جوری و بی‌مقدمه. - -اواخر بهمن بود که یکی از روزهای برفی با یکی دیگر از اولیای اطفال آشنا شدم. یارو مرد بسیار کوتاهی بود؛ فرنگ مآب و بزک کرده و اتو کشیده که ننشسته از تحصیلاتش و از سفرهای فرنگش حرف زد. می‌خواست پسرش را آن وقت سال از مدرسه‌ی دیگر به آن جا بیاورد. پسرش از آن بچه‌هایی بود که شیر و مربای صبحانه‌اش را با قربان صدقه توی حلقشان می‌تپانند. کلاس دوم بود و ثلث اول دو تا تجدید آورده بود. می‌گفت در باغ ییلاقی‌اش که نزدیک مدرسه است، باغبانی دارند که پسرش شاگرد ماست و درس‌خوان است و پیدا است که بچه‌ها زیر سایه شما خوب پیشرفت می‌کنند. و از این پیزرها. و حال به خاطر همین بچه، توی این برف و سرما، آمده‌اند ساکن باغ ییلاقی شده‌اند. بلند شدم ناظم را صدا کردم و دست او و بچه‌اش را توی دست ناظم گذاشتم و خداحافظ شما... و نیم ساعت بعد ناظم برگشت که یارو خانه‌ی شهرش را به یک دبیرستان اجاره داده، به ماهی سه هزار و دویست تومان، و التماس دعا داشته، یعنی معلم سرخانه می‌خواسته و حتی بدش نمی‌آمده است که خود مدیر زحمت بکشند و ازین گنده‌گوزی‌ها... احساس کردم که ناظم دهانش آب افتاده است. و من به ناظم حالی کردم خودش برود بهتر است و فقط کاری بکند که نه صدای معلم‌ها در بیاید و نه آخر سال، برای یک معدل ده احتیاجی به من بمیرم و تو بمیری پیدا کند. همان روز عصر ناظم رفته بود و قرار و مدار برای هر روز عصر یک ساعت به ماهی صد و پنجاه تومان. - -دیگر دنیا به کام ناظم بود. حال مادرش هم بهتر بود و از بیمارستان مرخصش کرده بودند و به فکر زن گرفتن افتاده بود. و هر روز هم برای یک نفر نقشه می‌کشید حتی برای من هم. یک روز در آمد که چرا ما خودمان «انجمن خانه و مدرسه» نداشته باشیم؟ نشسته بود و حسابش را کرده بود دیده بود که پنجاه شصت نفری از اولیای مدرسه دستشان به دهان‌شان می‌رسد و از آن هم که به پسرش درس خصوصی می‌داد قول مساعد گرفته بود. حالیش کردم که مواظب حرف و سخن اداره‌ای باشد و هر کار دلش می‌خواهد بکند. کاغذ دعوت را هم برایش نوشتم با آب و تاب و خودش برای اداره‌ی فرهنگ، داد ماشین کردند و به وسیله‌ی خود بچه‌ها فرستاد. و جلسه با حضور بیست و چند نفری از اولیای بچه‌ها رسمی شد. خوبیش این بود که پاسبان کشیک پاسگاه هم آمده بود و دم در برای همه، پاشنه‌هایش را به هم می‌کوبید و معلم‌ها گوش تا گوش نشسته بودند و مجلس ابهتی داشت و ناظم، چای و شیرینی تهیه کرده بود و چراغ زنبوری کرایه کرده بود و باران هم گذاشت پشتش و سالون برای اولین بار در عمرش به نوایی رسید. - -یک سرهنگ بود که رئیسش کردیم و آن زن را که هفته‌ای یک بار می‌آمد نایب رئیس. آن که ناظم به پسرش درس خصوصی می‌داد نیامده بود. اما پاکت سربسته‌ای به اسم مدیر فرستاده بود که فی‌المجلس بازش کردیم. عذرخواهی از این‌که نتوانسته بود بیاید و وجه ناقابلی جوف پاکت. صد و پنجاه تومان. و پول را روی میز صندوق‌دار گذاشتیم که ضبط و ربط کند. نائب رئیس بزک کرده و معطر شیرینی تعارف می‌کرد و معلم‌ها با هر بار که شیرینی بر می‌داشتند، یک بار تا بناگوش سرخ می‌شدند و فراش‌ها دست به دست چای می‌آوردند. - -در فکر بودم که یک مرتبه احساس کردم، سیصد چهارصد تومان پول نقد، روی میز است و هشت صد تومان هم تعهد کرده بودند. پیرزن صندوقدار که کیف پولش را همراهش نیاورده بود ناچار حضار تصویب کردند که پول‌ها فعلاً پیش ناظم باشد. و صورت مجلس مرتب شد و امضاها ردیف پای آن و فردا فهمیدم که ناظم همان شب روی خشت نشسته بوده و به معلم‌ها سور داده بوده است. اولین کاری که کردم رونوشت مجلس آن شب را برای اداره‌ی فرهنگ فرستادم. و بعد همان استاد نجار را صدا کردم و دستور دادم برای مستراح‌ها دو روزه در بسازد که ناظم خیلی به سختی پولش را داد. و بعد در کوچه‌ی مدرسه درخت کاشتیم. تور والیبال را تعویض و تعدادی توپ در اختیار بچه‌ها گذاشتیم برای تمرین در بعد از ظهرها و آمادگی برای مسابقه با دیگر مدارس و در همین حین سر و کله‌ی بازرس تربیت بدنی هم پیدا شد و هر روز سرکشی و بیا و برو. تا یک روز که به مدرسه رسیدم شنیدم که از سالون سر و صدا می‌آید. صدای هالتر بود. ناظم سر خود رفته بود و سرخود دویست سیصد تومان داده بود و هالتر خریده بود و بچه‌های لاغر زیر بار آن گردن خود را خرد می‌کردند. من در این میان حرفی نزدم. می‌توانستم حرفی بزنم؟ من چیکاره بودم؟ اصلاً به من چه ربطی داشت؟ هر کار که دلشان می‌خواهد بکنند. مهم این بود که سالون مدرسه رونقی گرفته بود. ناظم هم راضی بود و معلم‌ها هم. چون نه خبر از حسادتی بود و نه حرف و سخنی پیش آمد. فقط می‌بایست به ناظم سفارش می کردم که فکر فراش‌ها هم باشد. - -کم کم خودمان را برای امتحان‌های ثلث دوم آماده می‌کردیم. این بود که اوایل اسفند، یک روز معلم‌ها را صدا زدم و در شورا مانندی که کردیم بی‌مقدمه برایشان داستان یکی از همکاران سابقم را گفتم که هر وقت بیست می‌داد تا دو روز تب داشت. البته معلم‌ها خندیدند. ناچار تشویق شدم و داستان آخوندی را گفتم که در بچگی معلم شرعیاتمان بود و زیر عبایش نمره می‌داد و دستش چنان می‌لرزید که عبا تکان می‌خورد و درست ده دقیقه طول می‌کشید. و تازه چند؟ بهترین شاگردها دوازده. و البته باز هم خندیدند. که این بار کلافه‌ام کرد. و بعد حالیشان کردم که بد نیست در طرح سؤال‌ها مشورت کنیم و از این حرف‌ها... - -و از شنبه‌ی بعد، امتحانات شروع شد. درست از نیمه‌ی دوم اسفند. سؤال‌ها را سه نفری می‌دیدیم. خودم با معلم هر کلاس و ناظم. در سالون میزها را چیده بودیم البته از وقتی هالتردار شده بود خیلی زیباتر شده بود. در سالون کاردستی‌های بچه‌ها در همه جا به چشم می‌خورد. هر کسی هر چیزی را به عنوان کاردستی درست کرده بودند و آورده بودند. که برای این کاردستی‌ها چه پول‌ها که خرج نشده بود و چه دست‌ها که نبریده بود و چه دعواها که نشده بود و چه عرق‌ها که ریخته نشده بود. پیش از هر امتحان که می‌شد، خودم یک میتینگ برای بچه‌ها می‌دادم که ترس از معلم و امتحان بی‌جا است و باید اعتماد به نفس داشت و ازین مزخرفات....ولی مگر حرف به گوش کسی می‌رفت؟ از در که وارد می‌شدند، چنان هجومی می‌بردند که نگو! به جاهای دور از نظر. یک بار چنان بود که احساس کردم مثل این‌که از ترس، لذت می‌برند. اگر معلم نبودی یا مدیر، به راحتی می‌توانستی حدس بزنی که کی‌ها با هم قرار و مداری دارند و کدام یک پهلو دست کدام یک خواهد نشست. یکی دو بار کوشیدم بالای دست یکی‌شان بایستم و ببینم چه می‌نویسد. ولی چنان مضطرب می‌شدند و دستشان به لرزه می‌افتاد که از نوشتن باز می‌ماندند. می‌دیدم که این مردان آینده، درین کلاس‌ها و امتحان‌ها آن قدر خواهند ترسید که وقتی دیپلمه بشوند یا لیسانسه، اصلاً آدم نوع جدیدی خواهند شد. آدمی انباشته از وحشت، انبانی از ترس و دلهره. به این ترتیب یک روز بیشتر دوام نیاوردم. چون دیدم نمی‌توانم قلب بچگانه‌ای داشته باشم تا با آن ترس و وحشت بچه‌ها را درک کنم و هم‌دردی نشان بدهم.این جور بود که می‌دیدم که معلم مدرسه هم نمی‌توانم باشم. - -دو روز قبل از عید کارنامه‌ها آماده بود و منتظر امضای مدیر. دویست و سی و شش تا امضا اقلاً تا ظهر طول می‌کشید. پیش از آن هم تا می‌توانستم از امضای دفترهای حضور و غیاب می‌گریختم. خیلی از جیره‌خورهای دولت در ادارات دیگر یا در میان همکارانم دیده بودم که در مواقع بیکاری تمرین امضا می‌کنند. پیش از آن نمی‌توانستم بفهمم چه طور از مدیری یک مدرسه یا کارمندی ساده یک اداره می‌شود به وزارت رسید. یا اصلاً آرزویش را داشت. نیم‌قراضه امضای آماده و هر کدام معرف یک شخصیت، بعد نیم‌ذرع زبان چرب و نرم که با آن، مار را از سوراخ بیرون بکشی، یا همه جا را بلیسی و یک دست هم قیافه. نه یک جور. دوازده جور. - -در این فکرها بودم که ناگهان در میان کارنامه‌ها چشمم به یک اسم آشنا افتاد. به اسم پسران جناب سرهنگ که رئیس انجمن بود. رفتم توی نخ نمراتش. همه متوسط بود و جای ایرادی نبود. و یک مرتبه به صرافت افتادم که از اول سال تا به حال بچه‌های مدرسه را فقط به اعتبار وضع مالی پدرشان قضاوت کرده‌ام. درست مثل این پسر سرهنگ که به اعتبار کیابیای پدرش درس نمی‌خواند. دیدم هر کدام که پدرشان فقیرتر است به نظر من باهوش‌تر می‌آمده‌اند. البته ناظم با این حرف‌ها کاری نداشت. مر قانونی را عمل می‌کرد. از یکی چشم می‌پوشید به دیگری سخت می‌گرفت. - -اما من مثل این که قضاوتم را درباره‌ی بچه‌ها از پیش کرده باشم و چه خوب بود که نمره‌ها در اختیار من نبود و آن یکی هم «انظباط» مال آخر سال بود. مسخره‌ترین کارها آن است که کسی به اصلاح وضعی دست بزند، اما در قلمروی که تا سر دماغش بیشتر نیست. و تازه مدرسه‌ی من، این قلمروی فعالیت من، تا سر دماغم هم نبود. به همان توی ذهنم ختم می‌شد. وضعی را که دیگران ترتیب داده بودند. به این ترتیب بعد از پنج شش ماه، می‌فهمیدم که حسابم یک حساب عقلایی نبوده است. احساساتی بوده است. ضعف‌های احساساتی مرا خشونت‌های عملی ناظم جبران می‌کرد و این بود که جمعاً نمی‌توانستم ازو بگذرم. مرد عمل بود. کار را می‌برید و پیش می‌رفت. در زندگی و در هر کاری، هر قدمی بر می‌داشت، برایش هدف بود. و چشم از وجوه دیگر قضیه می‌پوشید. این بود که برش داشت. و من نمی‌توانستم. چرا که اصلاً مدیر نبودم. خلاص... - -و کارنامه‌ی پسر سرهنگ را که زیر دستم عرق کرده بود، به دقت و احتیاج خشک کردم و امضایی زیر آن گذاشتم به قدری بد خط و مسخره بود که به یاد امضای فراش جدیدمان افتادم. حتماً جناب سرهنگ کلافه می‌شد که چرا چنین آدم بی‌سوادی را با این خط و ربط امضا مدیر مدرسه کرده‌اند. آخر یک جناب سرهنگ هم می‌داند که امضای آدم معرف شخصیت آدم است. - -اواخر تعطیلات نوروز رفتم به ملاقات معلم ترکه‌ای کلاس سوم. ناظم که با او میانه‌ی خوشی نداشت. ناچار با معلم حساب کلاس پنج و شش قرار و مداری گذاشته بودم که مختصری علاقه‌ای هم به آن حرف و سخن‌ها داشت. هم به وسیله‌ی او بود که می‌دانستم نشانی‌اش کجا است و توی کدام زندان است. در راه قبل از هر چیز خبر داد که رئیس فرهنگ عوض شده و این طور که شایع است یکی از هم دوره‌ای‌های من، جایش آمده. گفتم: - -- عجب! چرا؟ مگه رئیس قبلی چپش کم بود؟ - -- چه عرض کنم. می‌گند پا تو کفش یکی از نماینده‌ها کرده. شما خبر ندارید؟ - -- چه طور؟ از کجا خبر داشته باشم؟ - -- هیچ چی... می گند دو تا از کارچاق‌کن‌های انتخاباتی یارو از صندوق فرهنگ حقوق می‌گرفته‌اند؛ شب عیدی رئیس فرهنگ حقوق‌شون رو زده. - -- عجب! پس اونم می‌خواسته اصلاحات کنه! بیچاره. - -و بعد از این حرف زدیم که الحمدالله مدرسه مرتب است و آرام و معلم‌ها همکاری می‌کنند و ناظم بیش از اندازه همه‌کاره شده است. و من فهمیدم که باز لابد مشتری خصوصی تازه‌ای پیدا شده است که سر و صدای همه همکارها بلند شده. دم در زندان شلوغ بود. کلاه مخملی‌ها، عم‌قزی گل‌بته‌ها، خاله خانباجی‌ها و... اسم نوشتیم و نوبت گرفتیم و به جای پاها، دست‌هامان زیر بار کوچکی که داشتیم، خسته شد و خواب رفت تا نوبتمان شد. از این اتاق به آن اتاق و عاقبت نرده‌های آهنی و پشت آن معلم کلاس سه و... عجب چاق شده بود!درست مثل یک آدم حسابی شده بود. خوشحال شدیم و احوالپرسی و تشکر؛ و دیگر چه بگویم؟ بگویم چرا خودت را به دردسر انداختی؟ پیدا بود از مدرسه و کلاس به او خوش‌تر می‌گذرد. ایمانی بود و او آن را داشت و خوشبخت بود و دردسری نمی‌دید و زندان حداقل برایش کلاس درس بود. عاقبت پرسیدم: - -- پرونده‌ای هم برات درست کردند یا هنوز بلاتکلیفی؟ - -- امتحانمو دادم آقا مدیر، بد از آب در نیومد. - -- یعنی چه؟ - -- یعنی بی‌تکلیف نیستم. چون اسمم تو لیست جیره‌ی زندون رفته. خیالم راحته. چون سختی‌هاش گذشته. - -دیگر چه بگویم. دیدم چیزی ندارم خداحافظی کردم و او را با معلم حساب تنها گذاشتم و آمدم بیرون و تا مدت ملاقات تمام بشود، دم در زندان قدم زدم و به زندانی فکر کردم که برای خودم ساخته بودم. یعنی آن خرپول فرهنگ‌دوست ساخته بود. و من به میل و رغبت خودم را در آن زندانی کرده بودم. این یکی را به ضرب دگنک این جا آورده بودند. ناچار حق داشت که خیالش راحت باشد. اما من به میل و رغبت رفته بودم و چه بکنم؟ ناظم چه طور؟ راستی اگر رئیس فرهنگ از هم دوره‌ای‌های خودم باشد؛ چه طور است بروم و ازو بخواهم که ناظم را جای من بگذارد، یا همین معلم حساب را؟... که معلم حساب در آمد و راه افتادیم. با او هم دیگر حرفی نداشتم. سر پیچ خداحافظ شما و تاکسی گرفتم و یک سر به اداره‌ی فرهنگ زدم. گرچه دهم عید بود، اما هنوز رفت و آمد سال نو تمام نشده بود. برو و بیا و شیرینی و چای دو جانبه. رفتم تو. سلام و تبریک و همین تعارفات را پراندم. - -بله خودش بود. یکی از پخمه‌های کلاس. که آخر سال سوم کشتیارش شدم دو بیت شعر را حفظ کند، نتوانست که نتوانست. و حالا او رئیس بود و من آقا مدیر. راستی حیف از من، که حتی وزیر چنین رئیس فرهنگ‌هایی باشم! میز همان طور پاک بود و رفته. اما زیرسیگاری انباشته از خاکستر و ته سیگار. بلند شد و چلپ و چولوپ روبوسی کردیم و پهلوی خودش جا باز کرد و گوش تا گوش جیره‌خورهای فرهنگ تبریکات صمیمانه و بدگویی از ماسبق و هندوانه و پیزرها! و دو نفر که قد و قواره‌شان به درد گود زورخانه می‌خورد یا پای صندوق انتخابات شیرینی به مردم می‌دادند. نزدیک بود شیرینی را توی ظرفش بیندازم که دیدم بسیار احمقانه است. سیگارم که تمام شد قضیه‌ی رئیس فرهنگ قبلی و آن دو نفر را در گوشی ازش پرسیدم، حرفی نزد. فقط نگاهی می‌کرد که شبیه التماس بود و من فرصت جستم تا وضع معلم کلاس سوم را برایش روشن کنم و از او بخواهم تا آن جا که می‌تواند جلوی حقوقش را نگیرد. و از در که آمدم بیرون، تازه یادم آمد که برای کار دیگری پیش رئیس فرهنگ بودم. - -باز دیروز افتضاحی به پا شد. معقول یک ماهه‌ی فروردین راحت بودیم. اول اردیبهشت ماه جلالی و کوس رسوایی سر دیوار مدرسه. نزدیک آخر وقت یک جفت پدر و مادر، بچه‌شان در میان، وارد اتاق شدند. یکی بر افروخته و دیگری رنگ و رو باخته و بچه‌شان عیناً مثل این عروسک‌های کوکی. سلام و علیک و نشستند. خدایا دیگر چه اتفاقی افتاده است؟ - -- چه خبر شده که با خانوم سرافرازمون کردید؟ - -مرد اشاره‌ای به زنش کرد که بلند شد و دست بچه را گرفت و رفت بیرون و من ماندم و پدر. اما حرف نمی‌زد. به خودش فرصت می‌داد تا عصبانیتش بپزد. سیگارم را در آوردم و تعارفش کردم. مثل این که مگس مزاحمی را از روی دماغش بپراند، سیگار را رد کرد و من که سیگارم را آتش می‌زدم، فکر کردم لابد دردی دارد که چنین دست و پا بسته و چنین متکی به خانواده به مدرسه آمده. باز پرسیدم: - -- خوب، حالا چه فرمایش داشتید؟ - -که یک مرتبه ترکید: - -- اگه من مدیر مدرسه بودم و هم‌چه اتفاقی می‌افتاد، شیکم خودمو پاره می‌کردم. خجالت بکش مرد! برو استعفا بده. تا اهل محل نریختن تیکه تیکه‌ات کنند، دو تا گوشتو وردار و دررو. بچه‌های مردم می‌آن این جا درس بخونن و حسن اخلاق. نمی‌آن که... - -- این مزخرفات کدومه آقا! حرف حساب سرکار چیه؟ - -و حرکتی کردم که او را از در بیندازم بیرون. اما آخر باید می‌فهمیدم چه مرگش است. «ولی آخر با من چه کار دارد؟» - -- آبروی من رفته. آبروی صد ساله‌ی خونواده‌ام رفته. اگه در مدرسه‌ی تو رو تخته نکنم، تخم بابام نیستم. آخه من دیگه با این بچه چی کار کنم؟ تو این مدرسه ناموس مردم در خطره. کلانتری فهمیده؛ پزشک قانونی فهمیده؛ یک پرونده درست شده پنجاه ورق؛ تازه می‌گی حرف حسابم چیه؟ حرف حسابم اینه که صندلی و این مقام از سر تو زیاده. حرف حسابم اینه که می‌دم محاکمه‌ات کنند و از نون خوردن بندازنت... - -او می‌گفت و من گوش می‌کردم و مثل دو تا سگ هار به جان هم افتاده بودیم که در باز شد و ناظم آمد تو. به دادم رسید. در همان حال که من و پدر بچه در حال دعوا بودیم زن و بچه همان آقا رفته بودند و قضایا را برای ناظم تعریف کرده بودند و او فرستاده بوده فاعل را از کلاس کشیده بودند بیرون... و گفت چه طور است زنگ بزنیم و جلوی بچه‌ها ادبش کنیم و کردیم. یعنی این بار خود من رفتم میدان. پسرک نره‌خری بود از پنجمی‌ها با لباس مرتب و صورت سرخ و سفید و سالکی به گونه. جلوی روی بچه‌ها کشیدمش زیر مشت و لگد و بعد سه تا از ترکه‌ها را که فراش جدید فوری از باغ همسایه آورده بود، به سر و صورتش خرد کردم. چنان وحشی شده بودم که اگر ترکه‌ها نمی‌رسید، پسرک را کشته بودم. این هم بود که ناظم به دادش رسید و وساطت کرد و لاشه‌اش را توی دفتر بردند و بچه‌ها را مرخص کردند و من به اتاقم برگشتم و با حالی زار روی صندلی افتادم، نه از پدر خبری بود و نه از مادر و نه از عروسک‌های کوکی‌شان که ناموسش دست کاری شده بود. و تازه احساس کردم که این کتک‌کاری را باید به او می‌زدم. خیس عرق بودم و دهانم تلخ بود. تمام فحش‌هایی که می‌بایست به آن مردکه‌ی دبنگ می‌دادم و نداده بودم، در دهانم رسوب کرده بود و مثل دم مار تلخ شده بود. اصلاً چرا زدمش؟ چرا نگذاشتم مثل همیشه ناظم میدان‌داری کند که هم کارکشته‌تر بود و هم خونسردتر. لابد پسرک با دخترعمه‌اش هم نمی‌تواند بازی کند. لابد توی خانواده‌شان، دخترها سر ده دوازده سالگی باید از پسرهای هم سن رو بگیرند. نکند عیبی کرده باشد؟ و یک مرتبه به صرافت افتادم که بروم ببینم چه بلایی به سرش آورده‌ام. بلند شدم و یکی از فراش‌ها را صدا کردم که فهمیدم روانه‌اش کرده‌اند. آبی آورد که روی دستم می‌ریخت و صورتم را می‌شستم و می‌کوشیدم که لرزش دست‌هایم را نبیند. و در گوشم آهسته گفت که پسر مدیر شرکت اتوبوسرانی است و بدجوری کتک خورده و آن‌ها خیلی سعی کرده‌اند که تر و تمیزش کنند... - -احمق مثلا داشت توی دل مرا خالی می‌کرد. نمی‌دانست که من اول تصمیم را گرفتم، بعد مثل سگ هار شدم. و تازه می‌فهمیدم کسی را زده‌ام که لیاقتش را داشته. حتماً از این اتفاق‌ها جای دیگر هم می‌افتد. آدم بردارد پایین تنه بچه‌ی خودش را، یا به قول خودش ناموسش را بگذارد سر گذر که کلانتر محل و پزشک معاینه کنند! تا پرونده درست کنند؟ با این پدرو مادرها بچه‌ها حق دارند که قرتی و دزد و دروغگو از آب در بیایند. این مدرسه‌ها را اول برای پدر و مادرها باز کنند... - -با این افکار به خانه رسیدم. زنم در را که باز کرد؛ چشم‌هایش گرد شد. همیشه وقتی می‌ترسد این طور می‌شود. برای اینکه خیال نکند آدم کشته‌ام، زود قضایا را برایش گفتم. و دیدم که در ماند. یعنی ساکت ماند. آب سرد، عرق بیدمشک، سیگار پشت سیگار فایده نداشت، لقمه از گلویم پایین نمی‌رفت و دست‌ها هنوز می‌لرزید. هر کدام به اندازه‌ی یک ماه فعالیت کرده بودند. با سیگار چهارم شروع کردم: - -- می‌دانی زن؟ بابای یارو پول‌داره. مسلماً کار به دادگستری و این جور خنس‌ها می‌کشه. مدیریت که الفاتحه. اما خیلی دلم می‌خواد قضیه به دادگاه برسه. یک سال آزگار رو دل کشیده‌ام و دیگه خسته شده‌ام. دلم می‌خواد یکی بپرسه چرا بچه‌ی مردم رو این طوری زدی، چرا تنبیه بدنی کردی! آخه یک مدیر مدرسه هم حرف‌هایی داره که باید یک جایی بزنه... - -که بلند شد و رفت سراغ تلفن. دو سه تا از دوستانم را که در دادگستری کاره‌ای بودند، گرفت و خودم قضیه را برایشان گفتم که مواظب باشند. فردا پسرک فاعل به مدرسه نیامده بود. و ناظم برایم گفت که قضیه ازین قرار بوده است که دوتایی به هوای دیدن مجموعه تمبرهای فاعل با هم به خانه‌ای می‌روند و قضایا همان جا اتفاق می‌افتد و داد و هوار و دخالت پدر و مادرهای طرفین و خط و نشان و شبانه کلانتری؛ و تمام اهل محل خبر دارند. او هم نظرش این بود که کار به دادگستری خواهد کشید. - -و من یک هفته‌ی تمام به انتظار اخطاریه‌ی دادگستری صبح و عصر به مدرسه رفتم و مثل بخت‌النصر پشت پنجره ایستادم. اما در تمام این مدت نه از فاعل خبری شد، نه از مفعول و نه از پدر و مادر ناموس‌پرست و نه از مدیر شرکت اتوبوسرانی. انگار نه انگار که اتفاقی افتاده. بچه‌ها می‌آمدند و می‌رفتند؛ برای آب خوردن عجله می‌کردند؛ به جای بازی کتک‌کاری می‌کردند و همه چیز مثل قبل بود. فقط من ماندم و یک دنیا حرف و انتظار. تا عاقبت رسید.... احضاریه‌ای با تعیین وقت قبلی برای دو روز بعد، در فلان شعبه و پیش فلان بازپرس دادگستری. آخر کسی پیدا شده بود که به حرفم گوش کند. - -تا دو روز بعد که موعد احضار بود، اصلاً از خانه در نیامدم. نشستم و ماحصل حرف‌هایم را روی کاغذ آوردم. حرف‌هایی که با همه‌ی چرندی هر وزیر فرهنگی می‌توانست با آن یک برنامه‌ی هفت ساله برای کارش بریزد. و سر ساعت معین رفتم دادگستری. اتاق معین و بازپرس معین. در را باز کردم و سلام، و تا آمدم خودم را معرفی کنم و احضاریه را در بیاورم، یارو پیش‌دستی کرد و صندلی آورد و چای سفارش داد و «احتیاجی به این حرف‌ها نیست و قضیه‌ی کوچک بود و حل شد و راضی به زحمت شما نبودیم...» - -که عرق سرد بر بدن من نشست. چایی‌ام را که خوردم، روی همان کاغذ نشان‌دار دادگستری استعفانامه‌ام را نوشتم و به نام هم‌کلاسی پخمه‌ام که تازه رئیس شده بود، دم در پست کردم. -EOT; -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/fi_FI/Address.php b/vendor/fakerphp/faker/src/Faker/Provider/fi_FI/Address.php deleted file mode 100644 index d72951be..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/fi_FI/Address.php +++ /dev/null @@ -1,85 +0,0 @@ -format('dmy'); - - switch ((int) ($birthdate->format('Y') / 100)) { - case 18: - $centurySign = '+'; - - break; - - case 19: - $centurySign = '-'; - - break; - - case 20: - $centurySign = 'A'; - - break; - - default: - throw new \InvalidArgumentException('Year must be between 1800 and 2099 inclusive.'); - } - - $randomDigits = self::numberBetween(0, 89); - - if ($gender && $gender == static::GENDER_MALE) { - if ($randomDigits === 0) { - $randomDigits .= static::randomElement([3, 5, 7, 9]); - } else { - $randomDigits .= static::randomElement([1, 3, 5, 7, 9]); - } - } elseif ($gender && $gender == static::GENDER_FEMALE) { - if ($randomDigits === 0) { - $randomDigits .= static::randomElement([2, 4, 6, 8]); - } else { - $randomDigits .= static::randomElement([0, 2, 4, 6, 8]); - } - } else { - if ($randomDigits === 0) { - $randomDigits .= self::numberBetween(2, 9); - } else { - $randomDigits .= (string) static::numerify('#'); - } - } - $randomDigits = str_pad($randomDigits, 3, '0', STR_PAD_LEFT); - - $checksum = $checksumCharacters[(int) ($datePart . $randomDigits) % strlen($checksumCharacters)]; - - return $datePart . $centurySign . $randomDigits . $checksum; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/fi_FI/PhoneNumber.php b/vendor/fakerphp/faker/src/Faker/Provider/fi_FI/PhoneNumber.php deleted file mode 100644 index db06ce26..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/fi_FI/PhoneNumber.php +++ /dev/null @@ -1,101 +0,0 @@ - 'Argovie'], - ['AI' => 'Appenzell Rhodes-Intérieures'], - ['AR' => 'Appenzell Rhodes-Extérieures'], - ['BE' => 'Berne'], - ['BL' => 'Bâle-Campagne'], - ['BS' => 'Bâle-Ville'], - ['FR' => 'Fribourg'], - ['GE' => 'Genève'], - ['GL' => 'Glaris'], - ['GR' => 'Grisons'], - ['JU' => 'Jura'], - ['LU' => 'Lucerne'], - ['NE' => 'Neuchâtel'], - ['NW' => 'Nidwald'], - ['OW' => 'Obwald'], - ['SG' => 'Saint-Gall'], - ['SH' => 'Schaffhouse'], - ['SO' => 'Soleure'], - ['SZ' => 'Schwytz'], - ['TG' => 'Thurgovie'], - ['TI' => 'Tessin'], - ['UR' => 'Uri'], - ['VD' => 'Vaud'], - ['VS' => 'Valais'], - ['ZG' => 'Zoug'], - ['ZH' => 'Zurich'], - ]; - - protected static $cityFormats = [ - '{{cityName}}', - ]; - - protected static $streetNameFormats = [ - '{{streetPrefix}} {{lastName}}', - '{{streetPrefix}} de {{cityName}}', - '{{streetPrefix}} de {{lastName}}', - ]; - - protected static $streetAddressFormats = [ - '{{streetName}} {{buildingNumber}}', - ]; - protected static $addressFormats = [ - "{{streetAddress}}\n{{postcode}} {{city}}", - ]; - - /** - * Returns a random street prefix - * - * @example Rue - * - * @return string - */ - public static function streetPrefix() - { - return static::randomElement(static::$streetPrefix); - } - - /** - * Returns a random city name. - * - * @example Luzern - * - * @return string - */ - public function cityName() - { - return static::randomElement(static::$cityNames); - } - - /** - * Returns a canton - * - * @example array('BE' => 'Bern') - * - * @return array - */ - public static function canton() - { - return static::randomElement(static::$canton); - } - - /** - * Returns the abbreviation of a canton. - * - * @return string - */ - public static function cantonShort() - { - $canton = static::canton(); - - return key($canton); - } - - /** - * Returns the name of canton. - * - * @return string - */ - public static function cantonName() - { - $canton = static::canton(); - - return current($canton); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/fr_CH/Color.php b/vendor/fakerphp/faker/src/Faker/Provider/fr_CH/Color.php deleted file mode 100644 index 6deb9f83..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/fr_CH/Color.php +++ /dev/null @@ -1,7 +0,0 @@ - 'Ain'], ['02' => 'Aisne'], ['03' => 'Allier'], ['04' => 'Alpes-de-Haute-Provence'], ['05' => 'Hautes-Alpes'], - ['06' => 'Alpes-Maritimes'], ['07' => 'Ardèche'], ['08' => 'Ardennes'], ['09' => 'Ariège'], ['10' => 'Aube'], - ['11' => 'Aude'], ['12' => 'Aveyron'], ['13' => 'Bouches-du-Rhône'], ['14' => 'Calvados'], ['15' => 'Cantal'], - ['16' => 'Charente'], ['17' => 'Charente-Maritime'], ['18' => 'Cher'], ['19' => 'Corrèze'], ['2A' => 'Corse-du-Sud'], - ['2B' => 'Haute-Corse'], ['21' => "Côte-d'Or"], ['22' => "Côtes-d'Armor"], ['23' => 'Creuse'], ['24' => 'Dordogne'], - ['25' => 'Doubs'], ['26' => 'Drôme'], ['27' => 'Eure'], ['28' => 'Eure-et-Loir'], ['29' => 'Finistère'], ['30' => 'Gard'], - ['31' => 'Haute-Garonne'], ['32' => 'Gers'], ['33' => 'Gironde'], ['34' => 'Hérault'], ['35' => 'Ille-et-Vilaine'], - ['36' => 'Indre'], ['37' => 'Indre-et-Loire'], ['38' => 'Isère'], ['39' => 'Jura'], ['40' => 'Landes'], ['41' => 'Loir-et-Cher'], - ['42' => 'Loire'], ['43' => 'Haute-Loire'], ['44' => 'Loire-Atlantique'], ['45' => 'Loiret'], ['46' => 'Lot'], - ['47' => 'Lot-et-Garonne'], ['48' => 'Lozère'], ['49' => 'Maine-et-Loire'], ['50' => 'Manche'], ['51' => 'Marne'], - ['52' => 'Haute-Marne'], ['53' => 'Mayenne'], ['54' => 'Meurthe-et-Moselle'], ['55' => 'Meuse'], ['56' => 'Morbihan'], - ['57' => 'Moselle'], ['58' => 'Nièvre'], ['59' => 'Nord'], ['60' => 'Oise'], ['61' => 'Orne'], ['62' => 'Pas-de-Calais'], - ['63' => 'Puy-de-Dôme'], ['64' => 'Pyrénées-Atlantiques'], ['65' => 'Hautes-Pyrénées'], ['66' => 'Pyrénées-Orientales'], - ['67' => 'Bas-Rhin'], ['68' => 'Haut-Rhin'], ['69' => 'Rhône'], ['70' => 'Haute-Saône'], ['71' => 'Saône-et-Loire'], - ['72' => 'Sarthe'], ['73' => 'Savoie'], ['74' => 'Haute-Savoie'], ['75' => 'Paris'], ['76' => 'Seine-Maritime'], - ['77' => 'Seine-et-Marne'], ['78' => 'Yvelines'], ['79' => 'Deux-Sèvres'], ['80' => 'Somme'], ['81' => 'Tarn'], - ['82' => 'Tarn-et-Garonne'], ['83' => 'Var'], ['84' => 'Vaucluse'], ['85' => 'Vendée'], ['86' => 'Vienne'], - ['87' => 'Haute-Vienne'], ['88' => 'Vosges'], ['89' => 'Yonne'], ['90' => 'Territoire de Belfort'], ['91' => 'Essonne'], - ['92' => 'Hauts-de-Seine'], ['93' => 'Seine-Saint-Denis'], ['94' => 'Val-de-Marne'], ['95' => "Val-d'Oise"], - ['971' => 'Guadeloupe'], ['972' => 'Martinique'], ['973' => 'Guyane'], ['974' => 'La Réunion'], ['976' => 'Mayotte'], - ]; - - protected static $secondaryAddressFormats = ['Apt. ###', 'Suite ###', 'Étage ###', 'Bât. ###', 'Chambre ###']; - - /** - * @example 'Appt. 350' - */ - public static function secondaryAddress() - { - return static::numerify(static::randomElement(static::$secondaryAddressFormats)); - } - - /** - * @example 'rue' - */ - public static function streetPrefix() - { - return static::randomElement(static::$streetPrefix); - } - - /** - * Randomly returns a french region. - * - * @example 'Guadeloupe' - * - * @return string - */ - public static function region() - { - return static::randomElement(static::$regions); - } - - /** - * Randomly returns a french department ('departmentNumber' => 'departmentName'). - * - * @example array('2B' => 'Haute-Corse') - * - * @return array - */ - public static function department() - { - return static::randomElement(static::$departments); - } - - /** - * Randomly returns a french department name. - * - * @example 'Ardèche' - * - * @return string - */ - public static function departmentName() - { - $randomDepartmentName = array_values(static::department()); - - return $randomDepartmentName[0]; - } - - /** - * Randomly returns a french department number. - * - * @example '59' - * - * @return string - */ - public static function departmentNumber() - { - $randomDepartmentNumber = array_keys(static::department()); - - return $randomDepartmentNumber[0]; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/fr_FR/Color.php b/vendor/fakerphp/faker/src/Faker/Provider/fr_FR/Color.php deleted file mode 100644 index a0048ac4..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/fr_FR/Color.php +++ /dev/null @@ -1,40 +0,0 @@ -generator->parse($format)); - - if ($this->isCatchPhraseValid($catchPhrase)) { - break; - } - } while (true); - - return $catchPhrase; - } - - /** - * Generates a siret number (14 digits) that passes the Luhn check. - * - * @see http://fr.wikipedia.org/wiki/Syst%C3%A8me_d'identification_du_r%C3%A9pertoire_des_%C3%A9tablissements - * - * @return string - */ - public function siret($formatted = true) - { - $siret = self::siren(false); - $nicFormat = static::randomElement(static::$siretNicFormats); - $siret .= $this->numerify($nicFormat); - $siret .= Luhn::computeCheckDigit($siret); - - if ($formatted) { - $siret = substr($siret, 0, 3) . ' ' . substr($siret, 3, 3) . ' ' . substr($siret, 6, 3) . ' ' . substr($siret, 9, 5); - } - - return $siret; - } - - /** - * Generates a siren number (9 digits) that passes the Luhn check. - * - * @see http://fr.wikipedia.org/wiki/Syst%C3%A8me_d%27identification_du_r%C3%A9pertoire_des_entreprises - * - * @return string - */ - public static function siren($formatted = true) - { - $siren = self::numerify('%#######'); - $siren .= Luhn::computeCheckDigit($siren); - - if ($formatted) { - $siren = substr($siren, 0, 3) . ' ' . substr($siren, 3, 3) . ' ' . substr($siren, 6, 3); - } - - return $siren; - } - - /** - * @var array An array containing string which should not appear twice in a catch phrase. - */ - protected static $wordsWhichShouldNotAppearTwice = ['sécurité', 'simpl']; - - /** - * Validates a french catch phrase. - * - * @param string $catchPhrase The catch phrase to validate. - * - * @return bool (true if valid, false otherwise) - */ - protected static function isCatchPhraseValid($catchPhrase) - { - foreach (static::$wordsWhichShouldNotAppearTwice as $word) { - // Fastest way to check if a piece of word does not appear twice. - $beginPos = strpos($catchPhrase, $word); - $endPos = strrpos($catchPhrase, $word); - - if ($beginPos !== false && $beginPos != $endPos) { - return false; - } - } - - return true; - } - - /** - * @see http://www.pole-emploi.fr/candidat/le-code-rome-et-les-fiches-metiers-@/article.jspz?id=60702 - * - * @note Randomly took 300 from this list - */ - protected static $jobTitleFormat = [ - 'Agent d\'accueil', - 'Agent d\'enquêtes', - 'Agent d\'entreposage', - 'Agent de curage', - 'Agro-économiste', - 'Aide couvreur', - 'Aide à domicile', - 'Aide-déménageur', - 'Ambassadeur', - 'Analyste télématique', - 'Animateur d\'écomusée', - 'Animateur web', - 'Appareilleur-gazier', - 'Archéologue', - 'Armurier d\'art', - 'Armurier spectacle', - 'Artificier spectacle', - 'Artiste dramatique', - 'Aspigiculteur', - 'Assistant de justice', - 'Assistant des ventes', - 'Assistant logistique', - 'Assistant styliste', - 'Assurance', - 'Auteur-adaptateur', - 'Billettiste voyages', - 'Brigadier', - 'Bruiteur', - 'Bâtonnier d\'art', - 'Bûcheron', - 'Cameraman', - 'Capitaine de pêche', - 'Carrier', - 'Caviste', - 'Chansonnier', - 'Chanteur', - 'Chargé de recherche', - 'Chasseur-bagagiste', - 'Chef de fabrication', - 'Chef de scierie', - 'Chef des ventes', - 'Chef du personnel', - 'Chef géographe', - 'Chef monteur son', - 'Chef porion', - 'Chiropraticien', - 'Choréologue', - 'Chromiste', - 'Cintrier-machiniste', - 'Clerc hors rang', - 'Coach sportif', - 'Coffreur béton armé', - 'Coffreur-ferrailleur', - 'Commandant de police', - 'Commandant marine', - 'Commis de coupe', - 'Comptable unique', - 'Conception et études', - 'Conducteur de jumbo', - 'Conseiller culinaire', - 'Conseiller funéraire', - 'Conseiller relooking', - 'Consultant ergonome', - 'Contrebassiste', - 'Convoyeur garde', - 'Copiste offset', - 'Corniste', - 'Costumier-habilleur', - 'Coutelier d\'art', - 'Cueilleur de cerises', - 'Céramiste concepteur', - 'Danse', - 'Danseur', - 'Data manager', - 'Dee-jay', - 'Designer produit', - 'Diététicien conseil', - 'Diététique', - 'Doreur sur métaux', - 'Décorateur-costumier', - 'Défloqueur d\'amiante', - 'Dégustateur', - 'Délégué vétérinaire', - 'Délégué à la tutelle', - 'Désamianteur', - 'Détective', - 'Développeur web', - 'Ecotoxicologue', - 'Elagueur-botteur', - 'Elagueur-grimpeur', - 'Elastiqueur', - 'Eleveur d\'insectes', - 'Eleveur de chats', - 'Eleveur de volailles', - 'Embouteilleur', - 'Employé d\'accueil', - 'Employé d\'étage', - 'Employé de snack-bar', - 'Endivier', - 'Endocrinologue', - 'Epithésiste', - 'Essayeur-retoucheur', - 'Etainier', - 'Etancheur', - 'Etancheur-bardeur', - 'Etiqueteur', - 'Expert back-office', - 'Exploitant de tennis', - 'Extraction', - 'Facteur', - 'Facteur de clavecins', - 'Facteur de secteur', - 'Fantaisiste', - 'Façadier-bardeur', - 'Façadier-ravaleur', - 'Feutier', - 'Finance', - 'Flaconneur', - 'Foreur pétrole', - 'Formateur d\'italien', - 'Fossoyeur', - 'Fraiseur', - 'Fraiseur mouliste', - 'Frigoriste maritime', - 'Fromager', - 'Galeriste', - 'Gardien de résidence', - 'Garçon de chenil', - 'Garçon de hall', - 'Gendarme mobile', - 'Guitariste', - 'Gynécologue', - 'Géodésien', - 'Géologue prospecteur', - 'Géomètre', - 'Géomètre du cadastre', - 'Gérant d\'hôtel', - 'Gérant de tutelle', - 'Gériatre', - 'Hydrothérapie', - 'Hématologue', - 'Hôte de caisse', - 'Ingénieur bâtiment', - 'Ingénieur du son', - 'Ingénieur géologue', - 'Ingénieur géomètre', - 'Ingénieur halieute', - 'Ingénieur logistique', - 'Instituteur', - 'Jointeur de placage', - 'Juge des enfants', - 'Juriste financier', - 'Kiwiculteur', - 'Lexicographe', - 'Liftier', - 'Litigeur transport', - 'Logistique', - 'Logopède', - 'Magicien', - 'Manager d\'artiste', - 'Mannequin détail', - 'Maquilleur spectacle', - 'Marbrier-poseur', - 'Marin grande pêche', - 'Matelassier', - 'Maçon', - 'Maçon-fumiste', - 'Maçonnerie', - 'Maître de ballet', - 'Maïeuticien', - 'Menuisier', - 'Miroitier', - 'Modéliste industriel', - 'Moellonneur', - 'Moniteur de sport', - 'Monteur audiovisuel', - 'Monteur de fermettes', - 'Monteur de palettes', - 'Monteur en siège', - 'Monteur prototypiste', - 'Monteur-frigoriste', - 'Monteur-truquiste', - 'Mouleur sable', - 'Mouliste drapeur', - 'Mécanicien-armurier', - 'Médecin du sport', - 'Médecin scolaire', - 'Médiateur judiciaire', - 'Médiathécaire', - 'Net surfeur surfeuse', - 'Oenologue', - 'Opérateur de plateau', - 'Opérateur du son', - 'Opérateur géomètre', - 'Opérateur piquage', - 'Opérateur vidéo', - 'Ouvrier d\'abattoir', - 'Ouvrier serriste', - 'Ouvrier sidérurgiste', - 'Palefrenier', - 'Paléontologue', - 'Pareur en abattoir', - 'Parfumeur', - 'Parqueteur', - 'Percepteur', - 'Photographe d\'art', - 'Pilote automobile', - 'Pilote de soutireuse', - 'Pilote fluvial', - 'Piqueur en ganterie', - 'Pisteur secouriste', - 'Pizzaïolo', - 'Plaquiste enduiseur', - 'Plasticien', - 'Plisseur', - 'Poissonnier-traiteur', - 'Pontonnier', - 'Porion', - 'Porteur de hottes', - 'Porteur de journaux', - 'Portier', - 'Poseur de granit', - 'Posticheur spectacle', - 'Potier', - 'Praticien dentaire', - 'Praticiens médicaux', - 'Premier clerc', - 'Preneur de son', - 'Primeuriste', - 'Professeur d\'italien', - 'Projeteur béton armé', - 'Promotion des ventes', - 'Présentateur radio', - 'Pyrotechnicien', - 'Pédicure pour bovin', - 'Pédologue', - 'Pédopsychiatre', - 'Quincaillier', - 'Radio chargeur', - 'Ramasseur d\'asperges', - 'Ramasseur d\'endives', - 'Ravaleur-ragréeur', - 'Recherche', - 'Recuiseur', - 'Relieur-doreur', - 'Responsable de salle', - 'Responsable télécoms', - 'Revenue Manager', - 'Rippeur spectacle', - 'Rogneur', - 'Récupérateur', - 'Rédacteur des débats', - 'Régleur funéraire', - 'Régleur sur tour', - 'Sapeur-pompier', - 'Scannériste', - 'Scripte télévision', - 'Sculpteur sur verre', - 'Scénariste', - 'Second de cuisine', - 'Secrétaire juridique', - 'Semencier', - 'Sertisseur', - 'Services funéraires', - 'Solier-moquettiste', - 'Sommelier', - 'Sophrologue', - 'Staffeur', - 'Story boarder', - 'Stratifieur', - 'Stucateur', - 'Styliste graphiste', - 'Surjeteur-raseur', - 'Séismologue', - 'Technicien agricole', - 'Technicien bovin', - 'Technicien géomètre', - 'Technicien plateau', - 'Technicien énergie', - 'Terminologue', - 'Testeur informatique', - 'Toiliste', - 'Topographe', - 'Toréro', - 'Traducteur d\'édition', - 'Traffic manager', - 'Trieur de métaux', - 'Turbinier', - 'Téléconseiller', - 'Tôlier-traceur', - 'Vendeur carreau', - 'Vendeur en lingerie', - 'Vendeur en meubles', - 'Vendeur en épicerie', - 'Verrier d\'art', - 'Verrier à la calotte', - 'Verrier à la main', - 'Verrier à main levée', - 'Vidéo-jockey', - 'Vitrier', - ]; -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/fr_FR/Internet.php b/vendor/fakerphp/faker/src/Faker/Provider/fr_FR/Internet.php deleted file mode 100644 index 679919da..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/fr_FR/Internet.php +++ /dev/null @@ -1,9 +0,0 @@ -numberBetween(1, 2); - } - - $nir .= - // Year of birth (aa) - $this->numerify('##') . - // Mont of birth (mm) - sprintf('%02d', $this->numberBetween(1, 12)); - - // Department - $department = key(Address::department()); - $nir .= $department; - - // Town number, depends on department length - if (strlen($department) === 2) { - $nir .= $this->numerify('###'); - } elseif (strlen($department) === 3) { - $nir .= $this->numerify('##'); - } - - // Born number (depending of town and month of birth) - $nir .= $this->numerify('###'); - - /** - * The key for a given NIR is `97 - 97 % NIR` - * NIR has to be an integer, so we have to do a little replacment - * for departments 2A and 2B - */ - if ($department === '2A') { - $nirInteger = str_replace('2A', '19', $nir); - } elseif ($department === '2B') { - $nirInteger = str_replace('2B', '18', $nir); - } else { - $nirInteger = $nir; - } - $nir .= sprintf('%02d', 97 - $nirInteger % 97); - - // Format is x xx xx xx xxx xxx xx - if ($formatted) { - $nir = substr($nir, 0, 1) . ' ' . substr($nir, 1, 2) . ' ' . substr($nir, 3, 2) . ' ' . substr($nir, 5, 2) . ' ' . substr($nir, 7, 3) . ' ' . substr($nir, 10, 3) . ' ' . substr($nir, 13, 2); - } - - return $nir; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/fr_FR/PhoneNumber.php b/vendor/fakerphp/faker/src/Faker/Provider/fr_FR/PhoneNumber.php deleted file mode 100644 index 69c681d9..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/fr_FR/PhoneNumber.php +++ /dev/null @@ -1,148 +0,0 @@ -phoneNumber07WithSeparator(); - - return str_replace(' ', '', $phoneNumber); - } - - /** - * Only 073 to 079 are acceptable prefixes with 07 - * - * @see http://www.arcep.fr/index.php?id=8146 - */ - public function phoneNumber07WithSeparator() - { - $phoneNumber = $this->generator->numberBetween(3, 9); - $phoneNumber .= $this->numerify('# ## ## ##'); - - return $phoneNumber; - } - - public function phoneNumber08() - { - $phoneNumber = $this->phoneNumber08WithSeparator(); - - return str_replace(' ', '', $phoneNumber); - } - - /** - * Valid formats for 08: - * - * 0# ## ## ## - * 1# ## ## ## - * 2# ## ## ## - * 91 ## ## ## - * 92 ## ## ## - * 93 ## ## ## - * 97 ## ## ## - * 98 ## ## ## - * 99 ## ## ## - * - * Formats 089(4|6)## ## ## are valid, but will be - * attributed when other 089 resource ranges are exhausted. - * - * @see https://www.arcep.fr/index.php?id=8146#c9625 - * @see https://issuetracker.google.com/u/1/issues/73269839 - */ - public function phoneNumber08WithSeparator() - { - $regex = '([012]{1}\d{1}|(9[1-357-9])( \d{2}){3}'; - - return $this->regexify($regex); - } - - /** - * @example '0601020304' - */ - public function mobileNumber() - { - $format = static::randomElement(static::$mobileFormats); - - return static::numerify($this->generator->parse($format)); - } - - /** - * @example '0891951357' - */ - public function serviceNumber() - { - $format = static::randomElement(static::$serviceFormats); - - return static::numerify($this->generator->parse($format)); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/fr_FR/Text.php b/vendor/fakerphp/faker/src/Faker/Provider/fr_FR/Text.php deleted file mode 100644 index bcd3167a..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/fr_FR/Text.php +++ /dev/null @@ -1,15532 +0,0 @@ - static::latitude(46.262740, 47.564721), - 'longitude' => static::longitude(17.077949, 20.604560), - ]; - } - - protected static $streetSuffix = [ - 'árok', 'átjáró', 'dűlősor', 'dűlőút', 'erdősor', 'fasor', 'forduló', 'gát', 'határsor', 'határút', 'híd', 'játszótér', 'kert', 'körönd', 'körtér', 'körút', 'köz', 'lakótelep', 'lejáró', 'lejtő', 'lépcső', 'liget', 'mélyút', 'orom', 'országút', 'ösvény', 'park', 'part', 'pincesor', 'rakpart', 'sétány', 'sétaút', 'sor', 'sugárút', 'tér', 'tere', 'turistaút', 'udvar', 'út', 'útja', 'utca', 'üdülőpart', - ]; - protected static $postcode = ['####']; - protected static $state = [ - 'Budapest', 'Bács-Kiskun', 'Baranya', 'Békés', 'Borsod-Abaúj-Zemplén', 'Csongrád', 'Fejér', 'Győr-Moson-Sopron', 'Hajdú-Bihar', 'Heves', 'Jász-Nagykun-Szolnok', 'Komárom-Esztergom', 'Nógrád', 'Pest', 'Somogy', 'Szabolcs-Szatmár-Bereg', 'Tolna', 'Vas', 'Veszprém', 'Zala', - ]; - protected static $country = [ - 'Afganisztán', 'Albánia', 'Algéria', 'Amerikai Egyesült Államok', 'Andorra', 'Angola', 'Antigua és Barbuda', 'Argentína', 'Ausztria', 'Ausztrália', 'Azerbajdzsán', - 'Bahama-szigetek', 'Bahrein', 'Banglades', 'Barbados', 'Belgium', 'Belize', 'Benin', 'Bhután', 'Bolívia', 'Bosznia-Hercegovina', 'Botswana', 'Brazília', 'Brunei', 'Bulgária', 'Burkina Faso', 'Burma', 'Burundi', - 'Chile', 'Ciprus', 'Costa Rica', 'Csehország', 'Csád', - 'Dominikai Köztársaság', 'Dominikai Közösség', 'Dzsibuti', 'Dánia', 'Dél-Afrika', 'Dél-Korea', 'Dél-Szudán', - 'Ecuador', 'Egyenlítői-Guinea', 'Egyesült Arab Emírségek', 'Egyesült Királyság', 'Egyiptom', 'Elefántcsontpart', 'Eritrea', 'Etiópia', - 'Fehéroroszország', 'Fidzsi-szigetek', 'Finnország', 'Franciaország', 'Fülöp-szigetek', - 'Gabon', 'Gambia', 'Ghána', 'Grenada', 'Grúzia', 'Guatemala', 'Guinea', 'Guyana', 'Görögország', - 'Haiti', 'Hollandia', 'Horvátország', - 'India', 'Indonézia', 'Irak', 'Irán', 'Izland', 'Izrael', - 'Japán', 'Jemen', 'Jordánia', - 'Kambodzsa', 'Kamerun', 'Kanada', 'Katar', 'Kazahsztán', 'Kelet-Timor', 'Kenya', 'Kirgizisztán', 'Kiribati', 'Kolumbia', 'Kongói Demokratikus Köztársaság', 'Kongói Köztársaság', 'Kuba', 'Kuvait', 'Kína', 'Közép-Afrika', - 'Laosz', 'Lengyelország', 'Lesotho', 'Lettország', 'Libanon', 'Libéria', 'Liechtenstein', 'Litvánia', 'Luxemburg', 'Líbia', - 'Macedónia', 'Madagaszkár', 'Magyarország', 'Malawi', 'Maldív-szigetek', 'Mali', 'Malájzia', 'Marokkó', 'Marshall-szigetek', 'Mauritánia', 'Mexikó', 'Mikronézia', 'Moldova', 'Monaco', 'Mongólia', 'Montenegró', 'Mozambik', 'Málta', - 'Namíbia', 'Nauru', 'Nepál', 'Nicaragua', 'Niger', 'Nigéria', 'Norvégia', 'Németország', - 'Olaszország', 'Omán', 'Oroszország', - 'Pakisztán', 'Palau', 'Panama', 'Paraguay', 'Peru', 'Portugália', 'Pápua Új-Guinea', - 'Románia', 'Ruanda', - 'Saint Kitts és Nevis', 'Saint Vincent', 'Salamon-szigetek', 'Salvador', 'San Marino', 'Seychelle-szigetek', 'Spanyolország', 'Srí Lanka', 'Suriname', 'Svájc', 'Svédország', 'Szamoa', 'Szaúd-Arábia', 'Szenegál', 'Szerbia', 'Szingapúr', 'Szlovákia', 'Szlovénia', 'Szomália', 'Szudán', 'Szváziföld', 'Szíria', 'São Tomé és Príncipe', - 'Tadzsikisztán', 'Tanzánia', 'Thaiföld', 'Togo', 'Tonga', 'Trinidad és Tobago', 'Tunézia', 'Tuvalu', 'Törökország', 'Türkmenisztán', - 'Uganda', 'Ukrajna', 'Uruguay', - 'Vanuatu', 'Venezuela', 'Vietnám', - 'Zambia', 'Zimbabwe', 'Zöld-foki-szigetek', - 'Észak-Korea', 'Észtország', 'Írország', 'Örményország', 'Új-Zéland', 'Üzbegisztán', - ]; - - /** - * Source: https://hu.wikipedia.org/wiki/Magyarorsz%C3%A1g_v%C3%A1rosainak_list%C3%A1ja - */ - protected static $capitals = ['Budapest']; - protected static $bigCities = [ - 'Békéscsaba', 'Debrecen', 'Dunaújváros', 'Eger', 'Érd', 'Győr', 'Hódmezővásárhely', 'Kaposvár', 'Kecskemét', 'Miskolc', 'Nagykanizsa', 'Nyíregyháza', 'Pécs', 'Salgótarján', 'Sopron', 'Szeged', 'Székesfehérvár', 'Szekszárd', 'Szolnok', 'Szombathely', 'Tatabánya', 'Veszprém', 'Zalaegerszeg', - ]; - protected static $smallerCities = [ - 'Ajka', 'Aszód', 'Bácsalmás', - 'Baja', 'Baktalórántháza', 'Balassagyarmat', 'Balatonalmádi', 'Balatonfüred', 'Balmazújváros', 'Barcs', 'Bátonyterenye', 'Békés', 'Bélapátfalva', 'Berettyóújfalu', 'Bicske', 'Bóly', 'Bonyhád', 'Budakeszi', - 'Cegléd', 'Celldömölk', 'Cigánd', 'Csenger', 'Csongrád', 'Csorna', 'Csurgó', - 'Dabas', 'Derecske', 'Devecser', 'Dombóvár', 'Dunakeszi', - 'Edelény', 'Encs', 'Enying', 'Esztergom', - 'Fehérgyarmat', 'Fonyód', 'Füzesabony', - 'Gárdony', 'Gödöllő', 'Gönc', 'Gyál', 'Gyomaendrőd', 'Gyöngyös', 'Gyula', - 'Hajdúböszörmény', 'Hajdúhadház', 'Hajdúnánás', 'Hajdúszoboszló', 'Hatvan', 'Heves', - 'Ibrány', - 'Jánoshalma', 'Jászapáti', 'Jászberény', - 'Kalocsa', 'Kapuvár', 'Karcag', 'Kazincbarcika', 'Kemecse', 'Keszthely', 'Kisbér', 'Kiskőrös', 'Kiskunfélegyháza', 'Kiskunhalas', 'Kiskunmajsa', 'Kistelek', 'Kisvárda', 'Komárom', 'Komló', 'Körmend', 'Kőszeg', 'Kunhegyes', 'Kunszentmárton', 'Kunszentmiklós', - 'Lenti', 'Letenye', - 'Makó', 'Marcali', 'Martonvásár', 'Mátészalka', 'Mezőcsát', 'Mezőkovácsháza', 'Mezőkövesd', 'Mezőtúr', 'Mohács', 'Monor', 'Mór', 'Mórahalom', 'Mosonmagyaróvár', - 'Nagyatád', 'Nagykálló', 'Nagykáta', 'Nagykőrös', 'Nyíradony', 'Nyírbátor', - 'Orosháza', 'Oroszlány', 'Ózd', - 'Paks', 'Pannonhalma', 'Pápa', 'Pásztó', 'Pécsvárad', 'Pétervására', 'Pilisvörösvár', 'Polgárdi', 'Püspökladány', 'Putnok', - 'Ráckeve', 'Rétság', - 'Sárbogárd', 'Sarkad', 'Sárospatak', 'Sárvár', 'Sásd', 'Sátoraljaújhely', 'Sellye', 'Siklós', 'Siófok', 'Sümeg', 'Szarvas', 'Szécsény', 'Szeghalom', 'Szentendre', 'Szentes', 'Szentgotthárd', 'Szentlőrinc', 'Szerencs', 'Szigetszentmiklós', 'Szigetvár', 'Szikszó', 'Szob', - 'Tab', 'Tamási', 'Tapolca', 'Tata', 'Tét', 'Tiszafüred', 'Tiszakécske', 'Tiszaújváros', 'Tiszavasvári', 'Tokaj', 'Tolna', 'Törökszentmiklós', - 'Vác', 'Várpalota', 'Vásárosnamény', 'Vasvár', 'Vecsés', - 'Záhony', 'Zalaszentgrót', 'Zirc', - ]; -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/hu_HU/Company.php b/vendor/fakerphp/faker/src/Faker/Provider/hu_HU/Company.php deleted file mode 100644 index 75931991..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/hu_HU/Company.php +++ /dev/null @@ -1,13 +0,0 @@ -generator->parse($format); - } - - public static function country() - { - return static::randomElement(static::$country); - } - - public static function postcode() - { - return static::toUpper(static::bothify(static::randomElement(static::$postcode))); - } - - public static function regionSuffix() - { - return static::randomElement(static::$regionSuffix); - } - - public static function region() - { - return static::randomElement(static::$region); - } - - public static function cityPrefix() - { - return static::randomElement(static::$cityPrefix); - } - - public function city() - { - return static::randomElement(static::$city); - } - - public function streetPrefix() - { - return static::randomElement(static::$streetPrefix); - } - - public static function street() - { - return static::randomElement(static::$street); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/hy_AM/Color.php b/vendor/fakerphp/faker/src/Faker/Provider/hy_AM/Color.php deleted file mode 100644 index ebdda0da..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/hy_AM/Color.php +++ /dev/null @@ -1,12 +0,0 @@ -generator->parse(static::randomElement(static::$formats))); - } - - public function code() - { - return static::randomElement(static::$codes); - } - - public function numberFormat() - { - return static::randomElement(static::$numberFormats); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/id_ID/Address.php b/vendor/fakerphp/faker/src/Faker/Provider/id_ID/Address.php deleted file mode 100644 index 28dd845c..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/id_ID/Address.php +++ /dev/null @@ -1,319 +0,0 @@ -generator->parse($format); - } - - public static function street() - { - return static::randomElement(static::$street); - } - - public static function buildingNumber() - { - return (string) self::numberBetween(1, 999); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/id_ID/Color.php b/vendor/fakerphp/faker/src/Faker/Provider/id_ID/Color.php deleted file mode 100644 index 14995b62..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/id_ID/Color.php +++ /dev/null @@ -1,40 +0,0 @@ -generator->parse($lastNameRandomElement); - } - - /** - * Return last name for male - * - * @return string last name - */ - public static function lastNameMale() - { - return static::randomElement(static::$lastNameMale); - } - - /** - * Return last name for female - * - * @return string last name - */ - public static function lastNameFemale() - { - return static::randomElement(static::$lastNameFemale); - } - - /** - * For academic title - * - * @return string suffix - */ - public static function suffix() - { - return static::randomElement(static::$suffix); - } - - /** - * Generates Nomor Induk Kependudukan (NIK) - * - * @see https://en.wikipedia.org/wiki/National_identification_number#Indonesia - * - * @param string|null $gender - * @param \DateTime|null $birthDate - * - * @return string - */ - public function nik($gender = null, $birthDate = null) - { - // generate first numbers (region data) - $nik = $this->birthPlaceCode(); - $nik .= $this->generator->numerify('##'); - - if (!$birthDate) { - $birthDate = $this->generator->dateTimeBetween(); - } - - if (!$gender) { - $gender = $this->generator->randomElement([self::GENDER_MALE, self::GENDER_FEMALE]); - } - - // if gender is female, add 40 to days - if ($gender == self::GENDER_FEMALE) { - $nik .= $birthDate->format('d') + 40; - } else { - $nik .= $birthDate->format('d'); - } - - $nik .= $birthDate->format('my'); - - // add last random digits - $nik .= $this->generator->numerify('####'); - - return $nik; - } - - /** - * Generates birth place code for NIK - * - * @see https://id.wikipedia.org/wiki/Nomor_Induk_Kependudukan - * @see http://informasipedia.com/wilayah-indonesia/daftar-kabupaten-kota-di-indonesia/ - */ - protected function birthPlaceCode() - { - return static::randomElement(static::$birthPlaceCode); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/id_ID/PhoneNumber.php b/vendor/fakerphp/faker/src/Faker/Provider/id_ID/PhoneNumber.php deleted file mode 100644 index c0bfaf5b..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/id_ID/PhoneNumber.php +++ /dev/null @@ -1,55 +0,0 @@ - Icelandic names for women. - */ - protected static $firstNameFemale = ['Aagot', 'Abela', 'Abigael', 'Ada', 'Adda', 'Addý', 'Adela', 'Adelía', 'Adríana', 'Aðalbjörg', 'Aðalbjört', 'Aðalborg', 'Aðaldís', 'Aðalfríður', 'Aðalheiður', 'Aðalrós', 'Aðalsteina', 'Aðalsteinunn', 'Aðalveig', 'Agata', 'Agatha', 'Agða', 'Agla', 'Agnea', 'Agnes', 'Agneta', 'Alanta', 'Alba', 'Alberta', 'Albína', 'Alda', 'Aldís', 'Aldný', 'Aleta', 'Aletta', 'Alexa', 'Alexandra', 'Alexandría', 'Alexis', 'Alexía', 'Alfa', 'Alfífa', 'Alice', 'Alida', 'Alída', 'Alína', 'Alís', 'Alísa', 'Alla', 'Allý', 'Alma', 'Alrún', 'Alva', 'Alvilda', 'Amadea', 'Amal', 'Amalía', 'Amanda', 'Amelía', 'Amilía', 'Amíra', 'Amy', 'Amý', 'Analía', 'Anastasía', 'Andra', 'Andrá', 'Andrea', 'Anetta', 'Angela', 'Angelíka', 'Anika', 'Anita', 'Aníka', 'Anína', 'Aníta', 'Anja', 'Ann', 'Anna', 'Annabella', 'Annalísa', 'Anne', 'Annelí', 'Annetta', 'Anney', 'Annika', 'Annía', 'Anný', 'Antonía', 'Apríl', 'Ardís', 'Arey', 'Arinbjörg', 'Aris', 'Arisa', 'Aría', 'Aríanna', 'Aríella', 'Arín', 'Arína', 'Arís', 'Armenía', 'Arna', 'Arnbjörg', 'Arnborg', 'Arndís', 'Arney', 'Arnfinna', 'Arnfríður', 'Arngerður', 'Arngunnur', 'Arnheiður', 'Arnhildur', 'Arnika', 'Arnkatla', 'Arnlaug', 'Arnleif', 'Arnlín', 'Arnljót', 'Arnóra', 'Arnrós', 'Arnrún', 'Arnþóra', 'Arnþrúður', 'Asírí', 'Askja', 'Assa', 'Astrid', 'Atalía', 'Atena', 'Athena', 'Atla', 'Atlanta', 'Auðbjörg', 'Auðbjört', 'Auðdís', 'Auðlín', 'Auðna', 'Auðný', 'Auðrún', 'Auður', 'Aurora', 'Axelía', 'Axelma', 'Aþena', 'Ágústa', 'Ágústína', 'Álfdís', 'Álfey', 'Álfgerður', 'Álfheiður', 'Álfhildur', 'Álfrós', 'Álfrún', 'Álfsól', 'Árbjörg', 'Árbjört', 'Árdís', 'Árelía', 'Árlaug', 'Ármey', 'Árna', 'Árndís', 'Árney', 'Árnheiður', 'Árnína', 'Árný', 'Áróra', 'Ársól', 'Ársæl', 'Árún', 'Árveig', 'Árvök', 'Árþóra', 'Ása', 'Ásbjörg', 'Ásborg', 'Ásdís', 'Ásfríður', 'Ásgerður', 'Áshildur', 'Áskatla', 'Ásla', 'Áslaug', 'Ásleif', 'Ásný', 'Ásrós', 'Ásrún', 'Ást', 'Ásta', 'Ástbjörg', 'Ástbjört', 'Ástdís', 'Ástfríður', 'Ástgerður', 'Ástheiður', 'Ásthildur', 'Ástríður', 'Ástrós', 'Ástrún', 'Ástveig', 'Ástþóra', 'Ástþrúður', 'Ásvör', 'Baldey', 'Baldrún', 'Baldvina', 'Barbara', 'Barbára', 'Bassí', 'Bára', 'Bebba', 'Begga', 'Belinda', 'Bella', 'Benedikta', 'Bengta', 'Benidikta', 'Benía', 'Beníta', 'Benna', 'Benney', 'Benný', 'Benta', 'Bentey', 'Bentína', 'Bera', 'Bergdís', 'Bergey', 'Bergfríður', 'Bergheiður', 'Berghildur', 'Berglaug', 'Berglind', 'Berglín', 'Bergljót', 'Bergmannía', 'Bergný', 'Bergrán', 'Bergrín', 'Bergrós', 'Bergrún', 'Bergþóra', 'Berit', 'Bernódía', 'Berta', 'Bertha', 'Bessí', 'Bestla', 'Beta', 'Betanía', 'Betsý', 'Bettý', 'Bil', 'Birgit', 'Birgitta', 'Birna', 'Birta', 'Birtna', 'Bíbí', 'Bína', 'Bjargdís', 'Bjargey', 'Bjargheiður', 'Bjarghildur', 'Bjarglind', 'Bjarkey', 'Bjarklind', 'Bjarma', 'Bjarndís', 'Bjarney', 'Bjarnfríður', 'Bjarngerður', 'Bjarnheiður', 'Bjarnhildur', 'Bjarnlaug', 'Bjarnrún', 'Bjarnveig', 'Bjarný', 'Bjarnþóra', 'Bjarnþrúður', 'Bjartey', 'Bjartmey', 'Björg', 'Björgey', 'Björgheiður', 'Björghildur', 'Björk', 'Björney', 'Björnfríður', 'Björt', 'Bláey', 'Blíða', 'Blín', 'Blómey', 'Blædís', 'Blær', 'Bobba', 'Boga', 'Bogdís', 'Bogey', 'Bogga', 'Boghildur', 'Borg', 'Borgdís', 'Borghildur', 'Borgný', 'Borgrún', 'Borgþóra', 'Botnía', 'Bóel', 'Bót', 'Bóthildur', 'Braga', 'Braghildur', 'Branddís', 'Brá', 'Brák', 'Brigitta', 'Brimdís', 'Brimhildur', 'Brimrún', 'Brit', 'Britt', 'Britta', 'Bríana', 'Bríanna', 'Bríet', 'Bryndís', 'Brynfríður', 'Bryngerður', 'Brynheiður', 'Brynhildur', 'Brynja', 'Brynný', 'Burkney', 'Bylgja', 'Camilla', 'Carla', 'Carmen', 'Cecilia', 'Cecilía', 'Charlotta', 'Charlotte', 'Christina', 'Christine', 'Clara', 'Daðey', 'Daðína', 'Dagbjörg', 'Dagbjört', 'Dagfríður', 'Daggrós', 'Dagheiður', 'Dagmar', 'Dagmey', 'Dagný', 'Dagrún', 'Daldís', 'Daley', 'Dalía', 'Dalla', 'Dallilja', 'Dalrós', 'Dana', 'Daney', 'Danfríður', 'Danheiður', 'Danhildur', 'Danía', 'Daníela', 'Daníella', 'Dara', 'Debora', 'Debóra', 'Dendý', 'Didda', 'Dilja', 'Diljá', 'Dimmblá', 'Dimmey', 'Día', 'Díana', 'Díanna', 'Díma', 'Dís', 'Dísa', 'Dísella', 'Donna', 'Doris', 'Dorothea', 'Dóa', 'Dómhildur', 'Dóra', 'Dórey', 'Dóris', 'Dórothea', 'Dórótea', 'Dóróthea', 'Drauma', 'Draumey', 'Drífa', 'Droplaug', 'Drótt', 'Dröfn', 'Dúa', 'Dúfa', 'Dúna', 'Dýrborg', 'Dýrfinna', 'Dýrleif', 'Dýrley', 'Dýrunn', 'Dæja', 'Dögg', 'Dögun', 'Ebba', 'Ebonney', 'Edda', 'Edel', 'Edil', 'Edit', 'Edith', 'Eðna', 'Efemía', 'Egedía', 'Eggrún', 'Egla', 'Eiðný', 'Eiðunn', 'Eik', 'Einbjörg', 'Eindís', 'Einey', 'Einfríður', 'Einhildur', 'Einína', 'Einrún', 'Eir', 'Eirdís', 'Eirfinna', 'Eiríka', 'Eirný', 'Eirún', 'Elba', 'Eldbjörg', 'Eldey', 'Eldlilja', 'Eldrún', 'Eleina', 'Elektra', 'Elena', 'Elenborg', 'Elfa', 'Elfur', 'Elina', 'Elinborg', 'Elisabeth', 'Elía', 'Elíana', 'Elín', 'Elína', 'Elíná', 'Elínbet', 'Elínbjörg', 'Elínbjört', 'Elínborg', 'Elíndís', 'Elíngunnur', 'Elínheiður', 'Elínrós', 'Elírós', 'Elísa', 'Elísabet', 'Elísabeth', 'Elka', 'Ella', 'Ellen', 'Elley', 'Ellisif', 'Ellín', 'Elly', 'Ellý', 'Elma', 'Elna', 'Elsa', 'Elsabet', 'Elsie', 'Elsí', 'Elsý', 'Elva', 'Elvi', 'Elvíra', 'Elvý', 'Embla', 'Emelía', 'Emelíana', 'Emelína', 'Emeralda', 'Emilía', 'Emilíana', 'Emilíanna', 'Emilý', 'Emma', 'Emmý', 'Emý', 'Enea', 'Eneka', 'Engilbjört', 'Engilráð', 'Engilrós', 'Engla', 'Enika', 'Enja', 'Enóla', 'Eres', 'Erika', 'Erin', 'Erla', 'Erlen', 'Erlín', 'Erna', 'Esja', 'Esmeralda', 'Ester', 'Esther', 'Estiva', 'Ethel', 'Etna', 'Eufemía', 'Eva', 'Evelyn', 'Evey', 'Evfemía', 'Evgenía', 'Evíta', 'Evlalía', 'Ey', 'Eybjörg', 'Eybjört', 'Eydís', 'Eyfríður', 'Eygerður', 'Eygló', 'Eyhildur', 'Eyja', 'Eyjalín', 'Eyleif', 'Eylín', 'Eyrós', 'Eyrún', 'Eyveig', 'Eyvör', 'Eyþóra', 'Eyþrúður', 'Fanndís', 'Fanney', 'Fannlaug', 'Fanny', 'Fanný', 'Febrún', 'Fema', 'Filipía', 'Filippa', 'Filippía', 'Finna', 'Finnbjörg', 'Finnbjörk', 'Finnboga', 'Finnborg', 'Finndís', 'Finney', 'Finnfríður', 'Finnlaug', 'Finnrós', 'Fía', 'Fídes', 'Fífa', 'Fjalldís', 'Fjóla', 'Flóra', 'Folda', 'Fransiska', 'Franziska', 'Frán', 'Fregn', 'Freydís', 'Freygerður', 'Freyja', 'Freylaug', 'Freyleif', 'Friðbjörg', 'Friðbjört', 'Friðborg', 'Friðdís', 'Friðdóra', 'Friðey', 'Friðfinna', 'Friðgerður', 'Friðjóna', 'Friðlaug', 'Friðleif', 'Friðlín', 'Friðmey', 'Friðný', 'Friðrika', 'Friðrikka', 'Friðrós', 'Friðrún', 'Friðsemd', 'Friðveig', 'Friðþóra', 'Frigg', 'Fríða', 'Fríður', 'Frostrós', 'Fróðný', 'Fura', 'Fönn', 'Gabríela', 'Gabríella', 'Gauja', 'Gauthildur', 'Gefjun', 'Gefn', 'Geira', 'Geirbjörg', 'Geirdís', 'Geirfinna', 'Geirfríður', 'Geirhildur', 'Geirlaug', 'Geirlöð', 'Geirný', 'Geirríður', 'Geirrún', 'Geirþrúður', 'Georgía', 'Gerða', 'Gerður', 'Gestheiður', 'Gestný', 'Gestrún', 'Gillý', 'Gilslaug', 'Gissunn', 'Gía', 'Gígja', 'Gísela', 'Gísla', 'Gísley', 'Gíslína', 'Gíslný', 'Gíslrún', 'Gíslunn', 'Gíta', 'Gjaflaug', 'Gloría', 'Gló', 'Glóa', 'Glóbjört', 'Glódís', 'Glóð', 'Glóey', 'Gná', 'Góa', 'Gógó', 'Grein', 'Gret', 'Greta', 'Grélöð', 'Grét', 'Gréta', 'Gríma', 'Grímey', 'Grímheiður', 'Grímhildur', 'Gróa', 'Guðbjörg', 'Guðbjört', 'Guðborg', 'Guðdís', 'Guðfinna', 'Guðfríður', 'Guðjóna', 'Guðlaug', 'Guðleif', 'Guðlín', 'Guðmey', 'Guðmunda', 'Guðmundína', 'Guðný', 'Guðríður', 'Guðrún', 'Guðsteina', 'Guðveig', 'Gullbrá', 'Gullveig', 'Gullý', 'Gumma', 'Gunnbjörg', 'Gunnbjört', 'Gunnborg', 'Gunndís', 'Gunndóra', 'Gunnella', 'Gunnfinna', 'Gunnfríður', 'Gunnharða', 'Gunnheiður', 'Gunnhildur', 'Gunnjóna', 'Gunnlaug', 'Gunnleif', 'Gunnlöð', 'Gunnrún', 'Gunnur', 'Gunnveig', 'Gunnvör', 'Gunný', 'Gunnþóra', 'Gunnþórunn', 'Gurrý', 'Gúa', 'Gyða', 'Gyðja', 'Gyðríður', 'Gytta', 'Gæfa', 'Gæflaug', 'Hadda', 'Haddý', 'Hafbjörg', 'Hafborg', 'Hafdís', 'Hafey', 'Hafliða', 'Haflína', 'Hafný', 'Hafrós', 'Hafrún', 'Hafsteina', 'Hafþóra', 'Halla', 'Hallbera', 'Hallbjörg', 'Hallborg', 'Halldís', 'Halldóra', 'Halley', 'Hallfríður', 'Hallgerður', 'Hallgunnur', 'Hallkatla', 'Hallný', 'Hallrún', 'Hallveig', 'Hallvör', 'Hanna', 'Hanney', 'Hansa', 'Hansína', 'Harpa', 'Hauður', 'Hákonía', 'Heba', 'Hedda', 'Hedí', 'Heiða', 'Heiðbjörg', 'Heiðbjörk', 'Heiðbjört', 'Heiðbrá', 'Heiðdís', 'Heiðlaug', 'Heiðlóa', 'Heiðný', 'Heiðrós', 'Heiðrún', 'Heiður', 'Heiðveig', 'Hekla', 'Helen', 'Helena', 'Helga', 'Hella', 'Helma', 'Hendrikka', 'Henný', 'Henrietta', 'Henrika', 'Henríetta', 'Hera', 'Herbjörg', 'Herbjört', 'Herborg', 'Herdís', 'Herfríður', 'Hergerður', 'Herlaug', 'Hermína', 'Hersilía', 'Herta', 'Hertha', 'Hervör', 'Herþrúður', 'Hilda', 'Hildegard', 'Hildibjörg', 'Hildigerður', 'Hildigunnur', 'Hildiríður', 'Hildisif', 'Hildur', 'Hilma', 'Himinbjörg', 'Hind', 'Hinrika', 'Hinrikka', 'Hjalta', 'Hjaltey', 'Hjálmdís', 'Hjálmey', 'Hjálmfríður', 'Hjálmgerður', 'Hjálmrós', 'Hjálmrún', 'Hjálmveig', 'Hjördís', 'Hjörfríður', 'Hjörleif', 'Hjörný', 'Hjörtfríður', 'Hlaðgerður', 'Hlédís', 'Hlíf', 'Hlín', 'Hlökk', 'Hólmbjörg', 'Hólmdís', 'Hólmfríður', 'Hrafna', 'Hrafnborg', 'Hrafndís', 'Hrafney', 'Hrafngerður', 'Hrafnheiður', 'Hrafnhildur', 'Hrafnkatla', 'Hrafnlaug', 'Hrafntinna', 'Hraundís', 'Hrefna', 'Hreindís', 'Hróðný', 'Hrólfdís', 'Hrund', 'Hrönn', 'Hugbjörg', 'Hugbjört', 'Hugborg', 'Hugdís', 'Hugljúf', 'Hugrún', 'Huld', 'Hulda', 'Huldís', 'Huldrún', 'Húnbjörg', 'Húndís', 'Húngerður', 'Hvönn', 'Hödd', 'Högna', 'Hörn', 'Ida', 'Idda', 'Iða', 'Iðunn', 'Ilmur', 'Immý', 'Ina', 'Inda', 'India', 'Indiana', 'Indía', 'Indíana', 'Indíra', 'Indra', 'Inga', 'Ingdís', 'Ingeborg', 'Inger', 'Ingey', 'Ingheiður', 'Inghildur', 'Ingibjörg', 'Ingibjört', 'Ingiborg', 'Ingifinna', 'Ingifríður', 'Ingigerður', 'Ingilaug', 'Ingileif', 'Ingilín', 'Ingimaría', 'Ingimunda', 'Ingiríður', 'Ingirós', 'Ingisól', 'Ingiveig', 'Ingrid', 'Ingrún', 'Ingunn', 'Ingveldur', 'Inna', 'Irena', 'Irene', 'Irja', 'Irma', 'Irmý', 'Irpa', 'Isabel', 'Isabella', 'Ída', 'Íma', 'Ína', 'Ír', 'Íren', 'Írena', 'Íris', 'Írunn', 'Ísabel', 'Ísabella', 'Ísadóra', 'Ísafold', 'Ísalind', 'Ísbjörg', 'Ísdís', 'Ísey', 'Ísfold', 'Ísgerður', 'Íshildur', 'Ísis', 'Íslaug', 'Ísleif', 'Ísmey', 'Ísold', 'Ísól', 'Ísrún', 'Íssól', 'Ísveig', 'Íunn', 'Íva', 'Jakobína', 'Jana', 'Jane', 'Janetta', 'Jannika', 'Jara', 'Jarún', 'Jarþrúður', 'Jasmín', 'Járnbrá', 'Járngerður', 'Jenetta', 'Jenna', 'Jenný', 'Jensína', 'Jessý', 'Jovina', 'Jóa', 'Jóanna', 'Jódís', 'Jófríður', 'Jóhanna', 'Jólín', 'Jóna', 'Jónanna', 'Jónasína', 'Jónbjörg', 'Jónbjört', 'Jóndís', 'Jóndóra', 'Jóney', 'Jónfríður', 'Jóngerð', 'Jónheiður', 'Jónhildur', 'Jóninna', 'Jónída', 'Jónína', 'Jónný', 'Jóný', 'Jóra', 'Jóríður', 'Jórlaug', 'Jórunn', 'Jósebína', 'Jósefín', 'Jósefína', 'Judith', 'Júdea', 'Júdit', 'Júlía', 'Júlíana', 'Júlíanna', 'Júlíetta', 'Júlírós', 'Júnía', 'Júníana', 'Jökla', 'Jökulrós', 'Jörgína', 'Kaðlín', 'Kaja', 'Kalla', 'Kamilla', 'Kamí', 'Kamma', 'Kapitola', 'Kapítóla', 'Kara', 'Karen', 'Karin', 'Karitas', 'Karí', 'Karín', 'Karína', 'Karítas', 'Karla', 'Karlinna', 'Karlína', 'Karlotta', 'Karolína', 'Karó', 'Karólín', 'Karólína', 'Kassandra', 'Kata', 'Katarína', 'Katerína', 'Katharina', 'Kathinka', 'Katinka', 'Katla', 'Katrín', 'Katrína', 'Katý', 'Kára', 'Kellý', 'Kendra', 'Ketilbjörg', 'Ketilfríður', 'Ketilríður', 'Kiddý', 'Kira', 'Kirsten', 'Kirstín', 'Kittý', 'Kjalvör', 'Klara', 'Kládía', 'Klementína', 'Kleópatra', 'Kolbjörg', 'Kolbrá', 'Kolbrún', 'Koldís', 'Kolfinna', 'Kolfreyja', 'Kolgríma', 'Kolka', 'Konkordía', 'Konný', 'Korka', 'Kormlöð', 'Kornelía', 'Kókó', 'Krista', 'Kristbjörg', 'Kristborg', 'Kristel', 'Kristensa', 'Kristey', 'Kristfríður', 'Kristgerður', 'Kristin', 'Kristine', 'Kristíana', 'Kristíanna', 'Kristín', 'Kristína', 'Kristjana', 'Kristjóna', 'Kristlaug', 'Kristlind', 'Kristlín', 'Kristný', 'Kristólína', 'Kristrós', 'Kristrún', 'Kristveig', 'Kristvina', 'Kristþóra', 'Kría', 'Kæja', 'Laila', 'Laíla', 'Lana', 'Lara', 'Laufey', 'Laufheiður', 'Laufhildur', 'Lauga', 'Laugey', 'Laugheiður', 'Lára', 'Lárensína', 'Láretta', 'Lárey', 'Lea', 'Leikný', 'Leila', 'Lena', 'Leonóra', 'Leóna', 'Leónóra', 'Lilja', 'Liljá', 'Liljurós', 'Lill', 'Lilla', 'Lillian', 'Lillý', 'Lily', 'Lilý', 'Lind', 'Linda', 'Linddís', 'Lingný', 'Lisbeth', 'Listalín', 'Liv', 'Líba', 'Líf', 'Lífdís', 'Lín', 'Lína', 'Línbjörg', 'Líndís', 'Líneik', 'Líney', 'Línhildur', 'Lísa', 'Lísabet', 'Lísandra', 'Lísbet', 'Lísebet', 'Lív', 'Ljósbjörg', 'Ljósbrá', 'Ljótunn', 'Lofn', 'Loftveig', 'Logey', 'Lokbrá', 'Lotta', 'Louisa', 'Lousie', 'Lovísa', 'Lóa', 'Lóreley', 'Lukka', 'Lúcía', 'Lúðvíka', 'Lúísa', 'Lúna', 'Lúsinda', 'Lúsía', 'Lúvísa', 'Lydia', 'Lydía', 'Lyngheiður', 'Lýdía', 'Læla', 'Maddý', 'Magda', 'Magdalena', 'Magðalena', 'Magga', 'Maggey', 'Maggý', 'Magna', 'Magndís', 'Magnea', 'Magnes', 'Magney', 'Magnfríður', 'Magnheiður', 'Magnhildur', 'Magnúsína', 'Magný', 'Magnþóra', 'Maía', 'Maídís', 'Maísól', 'Maj', 'Maja', 'Malen', 'Malena', 'Malía', 'Malín', 'Malla', 'Manda', 'Manúela', 'Mara', 'Mardís', 'Marela', 'Marella', 'Maren', 'Marey', 'Marfríður', 'Margit', 'Margot', 'Margret', 'Margrét', 'Margrjet', 'Margunnur', 'Marheiður', 'Maria', 'Marie', 'Marikó', 'Marinella', 'Marit', 'Marí', 'María', 'Maríam', 'Marían', 'Maríana', 'Maríanna', 'Marín', 'Marína', 'Marínella', 'Maríon', 'Marísa', 'Marísól', 'Marít', 'Maríuerla', 'Marja', 'Markrún', 'Marlaug', 'Marlena', 'Marlín', 'Marlís', 'Marólína', 'Marsa', 'Marselía', 'Marselína', 'Marsibil', 'Marsilía', 'Marsý', 'Marta', 'Martha', 'Martína', 'Mary', 'Marý', 'Matta', 'Mattea', 'Matthea', 'Matthilda', 'Matthildur', 'Matthía', 'Mattíana', 'Mattína', 'Mattý', 'Maxima', 'Mábil', 'Málfríður', 'Málhildur', 'Málmfríður', 'Mánadís', 'Máney', 'Mára', 'Meda', 'Mekkin', 'Mekkín', 'Melinda', 'Melissa', 'Melkorka', 'Melrós', 'Messíana', 'Metta', 'Mey', 'Mikaela', 'Mikaelína', 'Mikkalína', 'Milda', 'Mildríður', 'Milla', 'Millý', 'Minerva', 'Minna', 'Minney', 'Minný', 'Miriam', 'Mirja', 'Mirjam', 'Mirra', 'Mist', 'Mía', 'Mínerva', 'Míra', 'Míranda', 'Mítra', 'Mjaðveig', 'Mjalldís', 'Mjallhvít', 'Mjöll', 'Mona', 'Monika', 'Módís', 'Móeiður', 'Móey', 'Móheiður', 'Móna', 'Mónika', 'Móníka', 'Munda', 'Mundheiður', 'Mundhildur', 'Mundína', 'Myrra', 'Mýr', 'Mýra', 'Mýrún', 'Mörk', 'Nadia', 'Nadía', 'Nadja', 'Nana', 'Nanna', 'Nanný', 'Nansý', 'Naomí', 'Naómí', 'Natalie', 'Natalía', 'Náttsól', 'Nella', 'Nellý', 'Nenna', 'Nicole', 'Niðbjörg', 'Nikíta', 'Nikoletta', 'Nikólína', 'Ninja', 'Ninna', 'Nína', 'Níní', 'Njála', 'Njóla', 'Norma', 'Nóa', 'Nóra', 'Nótt', 'Nýbjörg', 'Odda', 'Oddbjörg', 'Oddfreyja', 'Oddfríður', 'Oddgerður', 'Oddhildur', 'Oddlaug', 'Oddleif', 'Oddný', 'Oddrún', 'Oddveig', 'Oddvör', 'Oktavía', 'Októvía', 'Olga', 'Ollý', 'Ora', 'Orka', 'Ormheiður', 'Ormhildur', 'Otkatla', 'Otta', 'Óda', 'Ófelía', 'Óla', 'Ólafía', 'Ólafína', 'Ólavía', 'Ólivía', 'Ólína', 'Ólöf', 'Ósa', 'Ósk', 'Ótta', 'Pamela', 'París', 'Patricia', 'Patrisía', 'Pála', 'Páldís', 'Páley', 'Pálfríður', 'Pálhanna', 'Pálheiður', 'Pálhildur', 'Pálín', 'Pálína', 'Pálmey', 'Pálmfríður', 'Pálrún', 'Perla', 'Peta', 'Petra', 'Petrea', 'Petrína', 'Petronella', 'Petrónella', 'Petrós', 'Petrún', 'Petrúnella', 'Pétrína', 'Pétrún', 'Pía', 'Polly', 'Pollý', 'Pría', 'Rafney', 'Rafnhildur', 'Ragna', 'Ragnbjörg', 'Ragney', 'Ragnfríður', 'Ragnheiður', 'Ragnhildur', 'Rakel', 'Ramóna', 'Randalín', 'Randíður', 'Randý', 'Ranka', 'Rannva', 'Rannveig', 'Ráðhildur', 'Rán', 'Rebekka', 'Reginbjörg', 'Regína', 'Rein', 'Renata', 'Reyn', 'Reyndís', 'Reynheiður', 'Reynhildur', 'Rikka', 'Ripley', 'Rita', 'Ríkey', 'Rín', 'Ríta', 'Ronja', 'Rorí', 'Roxanna', 'Róberta', 'Róbjörg', 'Rós', 'Rósa', 'Rósalind', 'Rósanna', 'Rósbjörg', 'Rósborg', 'Róselía', 'Rósey', 'Rósfríður', 'Róshildur', 'Rósinkara', 'Rósinkransa', 'Róska', 'Róslaug', 'Róslind', 'Róslinda', 'Róslín', 'Rósmary', 'Rósmarý', 'Rósmunda', 'Rósný', 'Runný', 'Rut', 'Ruth', 'Rúbý', 'Rún', 'Rúna', 'Rúndís', 'Rúnhildur', 'Rúrí', 'Röfn', 'Rögn', 'Röskva', 'Sabína', 'Sabrína', 'Saga', 'Salbjörg', 'Saldís', 'Salgerður', 'Salín', 'Salína', 'Salka', 'Salma', 'Salný', 'Salome', 'Salóme', 'Salvör', 'Sandra', 'Sanna', 'Santía', 'Sara', 'Sarína', 'Sefanía', 'Selja', 'Selka', 'Selma', 'Senía', 'Septíma', 'Sera', 'Serena', 'Seselía', 'Sesilía', 'Sesselía', 'Sesselja', 'Sessilía', 'Sif', 'Sigdís', 'Sigdóra', 'Sigfríð', 'Sigfríður', 'Sigga', 'Siggerður', 'Sigmunda', 'Signa', 'Signhildur', 'Signý', 'Sigríður', 'Sigrún', 'Sigurást', 'Sigurásta', 'Sigurbára', 'Sigurbirna', 'Sigurbjörg', 'Sigurbjört', 'Sigurborg', 'Sigurdís', 'Sigurdóra', 'Sigurdríf', 'Sigurdrífa', 'Sigurða', 'Sigurey', 'Sigurfinna', 'Sigurfljóð', 'Sigurgeira', 'Sigurhanna', 'Sigurhelga', 'Sigurhildur', 'Sigurjóna', 'Sigurlaug', 'Sigurleif', 'Sigurlilja', 'Sigurlinn', 'Sigurlín', 'Sigurlína', 'Sigurmunda', 'Sigurnanna', 'Sigurósk', 'Sigurrós', 'Sigursteina', 'Sigurunn', 'Sigurveig', 'Sigurvina', 'Sigurþóra', 'Sigyn', 'Sigþóra', 'Sigþrúður', 'Silfa', 'Silfá', 'Silfrún', 'Silja', 'Silka', 'Silla', 'Silva', 'Silvana', 'Silvía', 'Sirra', 'Sirrý', 'Siv', 'Sía', 'Símonía', 'Sísí', 'Síta', 'Sjöfn', 'Skarpheiður', 'Skugga', 'Skuld', 'Skúla', 'Skúlína', 'Snjáfríður', 'Snjáka', 'Snjófríður', 'Snjólaug', 'Snorra', 'Snót', 'Snæbjörg', 'Snæbjört', 'Snæborg', 'Snæbrá', 'Snædís', 'Snæfríður', 'Snælaug', 'Snærós', 'Snærún', 'Soffía', 'Sofie', 'Sofía', 'Solveig', 'Sonja', 'Sonný', 'Sophia', 'Sophie', 'Sól', 'Sóla', 'Sólbjörg', 'Sólbjört', 'Sólborg', 'Sólbrá', 'Sólbrún', 'Sóldís', 'Sóldögg', 'Sóley', 'Sólfríður', 'Sólgerður', 'Sólhildur', 'Sólín', 'Sólkatla', 'Sóllilja', 'Sólný', 'Sólrós', 'Sólrún', 'Sólveig', 'Sólvör', 'Sónata', 'Stefana', 'Stefanía', 'Stefánný', 'Steina', 'Steinbjörg', 'Steinborg', 'Steindís', 'Steindóra', 'Steiney', 'Steinfríður', 'Steingerður', 'Steinhildur', 'Steinlaug', 'Steinrós', 'Steinrún', 'Steinunn', 'Steinvör', 'Steinþóra', 'Stella', 'Stígheiður', 'Stígrún', 'Stína', 'Stjarna', 'Styrgerður', 'Sumarlína', 'Sumarrós', 'Sunna', 'Sunnefa', 'Sunneva', 'Sunniva', 'Sunníva', 'Susan', 'Súla', 'Súsan', 'Súsanna', 'Svafa', 'Svala', 'Svalrún', 'Svana', 'Svanbjörg', 'Svanbjört', 'Svanborg', 'Svandís', 'Svaney', 'Svanfríður', 'Svanheiður', 'Svanhildur', 'Svanhvít', 'Svanlaug', 'Svanrós', 'Svanþrúður', 'Svava', 'Svea', 'Sveina', 'Sveinbjörg', 'Sveinborg', 'Sveindís', 'Sveiney', 'Sveinfríður', 'Sveingerður', 'Sveinhildur', 'Sveinlaug', 'Sveinrós', 'Sveinrún', 'Sveinsína', 'Sveinveig', 'Sylgja', 'Sylva', 'Sylvía', 'Sæbjörg', 'Sæbjört', 'Sæborg', 'Sædís', 'Sæfinna', 'Sæfríður', 'Sæhildur', 'Sælaug', 'Sæmunda', 'Sæný', 'Særós', 'Særún', 'Sæsól', 'Sæunn', 'Sævör', 'Sölva', 'Sölvey', 'Sölvína', 'Tala', 'Talía', 'Tamar', 'Tamara', 'Tanía', 'Tanja', 'Tanya', 'Tanya', 'Tara', 'Tea', 'Teitný', 'Tekla', 'Telma', 'Tera', 'Teresa', 'Teresía', 'Thea', 'Thelma', 'Theodóra', 'Theódóra', 'Theresa', 'Tindra', 'Tinna', 'Tirsa', 'Tía', 'Tíbrá', 'Tína', 'Todda', 'Torbjörg', 'Torfey', 'Torfheiður', 'Torfhildur', 'Tóbý', 'Tóka', 'Tóta', 'Tristana', 'Trú', 'Tryggva', 'Tryggvína', 'Týra', 'Ugla', 'Una', 'Undína', 'Unna', 'Unnbjörg', 'Unndís', 'Unnur', 'Urður', 'Úa', 'Úlfa', 'Úlfdís', 'Úlfey', 'Úlfheiður', 'Úlfhildur', 'Úlfrún', 'Úlla', 'Úna', 'Úndína', 'Úranía', 'Úrsúla', 'Vagna', 'Vagnbjörg', 'Vagnfríður', 'Vaka', 'Vala', 'Valbjörg', 'Valbjörk', 'Valbjört', 'Valborg', 'Valdheiður', 'Valdís', 'Valentína', 'Valería', 'Valey', 'Valfríður', 'Valgerða', 'Valgerður', 'Valhildur', 'Valka', 'Vallý', 'Valný', 'Valrós', 'Valrún', 'Valva', 'Valý', 'Valþrúður', 'Vanda', 'Vár', 'Veig', 'Veiga', 'Venus', 'Vera', 'Veronika', 'Verónika', 'Veróníka', 'Vetrarrós', 'Vébjörg', 'Védís', 'Végerður', 'Vélaug', 'Véný', 'Vibeka', 'Victoría', 'Viðja', 'Vigdís', 'Vigný', 'Viktoria', 'Viktoría', 'Vilborg', 'Vildís', 'Vilfríður', 'Vilgerður', 'Vilhelmína', 'Villa', 'Villimey', 'Vilma', 'Vilný', 'Vinbjörg', 'Vinný', 'Vinsý', 'Virginía', 'Víbekka', 'Víf', 'Vígdögg', 'Víggunnur', 'Víóla', 'Víóletta', 'Vísa', 'Von', 'Von', 'Voney', 'Vordís', 'Ylfa', 'Ylfur', 'Ylja', 'Ylva', 'Ynja', 'Yrja', 'Yrsa', 'Ýja', 'Ýma', 'Ýr', 'Ýrr', 'Þalía', 'Þeba', 'Þeódís', 'Þeódóra', 'Þjóðbjörg', 'Þjóðhildur', 'Þoka', 'Þorbjörg', 'Þorfinna', 'Þorgerður', 'Þorgríma', 'Þorkatla', 'Þorlaug', 'Þorleif', 'Þorsteina', 'Þorstína', 'Þóra', 'Þóranna', 'Þórarna', 'Þórbjörg', 'Þórdís', 'Þórða', 'Þórelfa', 'Þórelfur', 'Þórey', 'Þórfríður', 'Þórgunna', 'Þórgunnur', 'Þórhalla', 'Þórhanna', 'Þórheiður', 'Þórhildur', 'Þórkatla', 'Þórlaug', 'Þórleif', 'Þórný', 'Þórodda', 'Þórsteina', 'Þórsteinunn', 'Þórstína', 'Þórunn', 'Þórveig', 'Þórvör', 'Þrá', 'Þrúða', 'Þrúður', 'Þula', 'Þura', 'Þurí', 'Þuríður', 'Þurý', 'Þúfa', 'Þyri', 'Þyrí', 'Þöll', 'Ægileif', 'Æsa', 'Æsgerður', 'Ögmunda', 'Ögn', 'Ölrún', 'Ölveig', 'Örbrún', 'Örk', 'Ösp']; - - /** - * @var array Icelandic names for men. - */ - protected static $firstNameMale = ['Aage', 'Abel', 'Abraham', 'Adam', 'Addi', 'Adel', 'Adíel', 'Adólf', 'Adrían', 'Adríel', 'Aðalberg', 'Aðalbergur', 'Aðalbert', 'Aðalbjörn', 'Aðalborgar', 'Aðalgeir', 'Aðalmundur', 'Aðalráður', 'Aðalsteinn', 'Aðólf', 'Agnar', 'Agni', 'Albert', 'Aldar', 'Alex', 'Alexander', 'Alexíus', 'Alfons', 'Alfred', 'Alfreð', 'Ali', 'Allan', 'Alli', 'Almar', 'Alrekur', 'Alvar', 'Alvin', 'Amír', 'Amos', 'Anders', 'Andreas', 'André', 'Andrés', 'Andri', 'Anes', 'Anfinn', 'Angantýr', 'Angi', 'Annar', 'Annarr', 'Annas', 'Annel', 'Annes', 'Anthony', 'Anton', 'Antoníus', 'Aran', 'Arent', 'Ares', 'Ari', 'Arilíus', 'Arinbjörn', 'Aríel', 'Aríus', 'Arnald', 'Arnaldur', 'Arnar', 'Arnberg', 'Arnbergur', 'Arnbjörn', 'Arndór', 'Arnes', 'Arnfinnur', 'Arnfreyr', 'Arngeir', 'Arngils', 'Arngrímur', 'Arnkell', 'Arnlaugur', 'Arnleifur', 'Arnljótur', 'Arnmóður', 'Arnmundur', 'Arnoddur', 'Arnold', 'Arnór', 'Arnsteinn', 'Arnúlfur', 'Arnviður', 'Arnþór', 'Aron', 'Arthur', 'Arthúr', 'Artúr', 'Asael', 'Askur', 'Aspar', 'Atlas', 'Atli', 'Auðbergur', 'Auðbert', 'Auðbjörn', 'Auðgeir', 'Auðkell', 'Auðmundur', 'Auðólfur', 'Auðun', 'Auðunn', 'Austar', 'Austmann', 'Austmar', 'Austri', 'Axel', 'Ágúst', 'Áki', 'Álfar', 'Álfgeir', 'Álfgrímur', 'Álfur', 'Álfþór', 'Ámundi', 'Árbjartur', 'Árbjörn', 'Árelíus', 'Árgeir', 'Árgils', 'Ármann', 'Árni', 'Ársæll', 'Ás', 'Ásberg', 'Ásbergur', 'Ásbjörn', 'Ásgautur', 'Ásgeir', 'Ásgils', 'Ásgrímur', 'Ási', 'Áskell', 'Áslaugur', 'Áslákur', 'Ásmar', 'Ásmundur', 'Ásólfur', 'Ásröður', 'Ástbjörn', 'Ástgeir', 'Ástmar', 'Ástmundur', 'Ástráður', 'Ástríkur', 'Ástvald', 'Ástvaldur', 'Ástvar', 'Ástvin', 'Ástþór', 'Ásvaldur', 'Ásvarður', 'Ásþór', 'Baldur', 'Baldvin', 'Baldwin', 'Baltasar', 'Bambi', 'Barði', 'Barri', 'Bassi', 'Bastían', 'Baugur', 'Bárður', 'Beinir', 'Beinteinn', 'Beitir', 'Bekan', 'Benedikt', 'Benidikt', 'Benjamín', 'Benoný', 'Benóní', 'Benóný', 'Bent', 'Berent', 'Berg', 'Bergfinnur', 'Berghreinn', 'Bergjón', 'Bergmann', 'Bergmar', 'Bergmundur', 'Bergsteinn', 'Bergsveinn', 'Bergur', 'Bergvin', 'Bergþór', 'Bernhard', 'Bernharð', 'Bernharður', 'Berni', 'Bernódus', 'Bersi', 'Bertel', 'Bertram', 'Bessi', 'Betúel', 'Bill', 'Birgir', 'Birkir', 'Birnir', 'Birtingur', 'Birtir', 'Bjargar', 'Bjargmundur', 'Bjargþór', 'Bjarkan', 'Bjarkar', 'Bjarki', 'Bjarmar', 'Bjarmi', 'Bjarnar', 'Bjarnfinnur', 'Bjarnfreður', 'Bjarnharður', 'Bjarnhéðinn', 'Bjarni', 'Bjarnlaugur', 'Bjarnleifur', 'Bjarnólfur', 'Bjarnsteinn', 'Bjarnþór', 'Bjartmann', 'Bjartmar', 'Bjartur', 'Bjartþór', 'Bjólan', 'Bjólfur', 'Björgmundur', 'Björgólfur', 'Björgúlfur', 'Björgvin', 'Björn', 'Björnólfur', 'Blængur', 'Blær', 'Blævar', 'Boði', 'Bogi', 'Bolli', 'Borgar', 'Borgúlfur', 'Borgþór', 'Bóas', 'Bói', 'Bótólfur', 'Bragi', 'Brandur', 'Breki', 'Bresi', 'Brestir', 'Brimar', 'Brimi', 'Brimir', 'Brími', 'Brjánn', 'Broddi', 'Bruno', 'Bryngeir', 'Brynjar', 'Brynjólfur', 'Brynjúlfur', 'Brynleifur', 'Brynsteinn', 'Bryntýr', 'Brynþór', 'Burkni', 'Búi', 'Búri', 'Bæring', 'Bæringur', 'Bæron', 'Böðvar', 'Börkur', 'Carl', 'Cecil', 'Christian', 'Christopher', 'Cýrus', 'Daði', 'Dagbjartur', 'Dagfari', 'Dagfinnur', 'Daggeir', 'Dagmann', 'Dagnýr', 'Dagur', 'Dagþór', 'Dalbert', 'Dalli', 'Dalmann', 'Dalmar', 'Dalvin', 'Damjan', 'Dan', 'Danelíus', 'Daniel', 'Danival', 'Daníel', 'Daníval', 'Dante', 'Daríus', 'Darri', 'Davíð', 'Demus', 'Deníel', 'Dennis', 'Diðrik', 'Díómedes', 'Dofri', 'Dolli', 'Dominik', 'Dómald', 'Dómaldi', 'Dómaldur', 'Dónald', 'Dónaldur', 'Dór', 'Dóri', 'Dósóþeus', 'Draupnir', 'Dreki', 'Drengur', 'Dufgus', 'Dufþakur', 'Dugfús', 'Dúi', 'Dúnn', 'Dvalinn', 'Dýri', 'Dýrmundur', 'Ebbi', 'Ebeneser', 'Ebenezer', 'Eberg', 'Edgar', 'Edilon', 'Edílon', 'Edvard', 'Edvin', 'Edward', 'Eðvald', 'Eðvar', 'Eðvarð', 'Efraím', 'Eggert', 'Eggþór', 'Egill', 'Eiðar', 'Eiður', 'Eikar', 'Eilífur', 'Einar', 'Einir', 'Einvarður', 'Einþór', 'Eiríkur', 'Eivin', 'Elberg', 'Elbert', 'Eldar', 'Eldgrímur', 'Eldjárn', 'Eldmar', 'Eldon', 'Eldór', 'Eldur', 'Elentínus', 'Elfar', 'Elfráður', 'Elimar', 'Elinór', 'Elis', 'Elí', 'Elías', 'Elíeser', 'Elímar', 'Elínbergur', 'Elínmundur', 'Elínór', 'Elís', 'Ellert', 'Elli', 'Elliði', 'Ellís', 'Elmar', 'Elvar', 'Elvin', 'Elvis', 'Emanúel', 'Embrek', 'Emerald', 'Emil', 'Emmanúel', 'Engilbert', 'Engilbjartur', 'Engiljón', 'Engill', 'Enok', 'Eric', 'Erik', 'Erlar', 'Erlendur', 'Erling', 'Erlingur', 'Ernestó', 'Ernir', 'Ernst', 'Eron', 'Erpur', 'Esekíel', 'Esjar', 'Esra', 'Estefan', 'Evald', 'Evan', 'Evert', 'Eyberg', 'Eyjólfur', 'Eylaugur', 'Eyleifur', 'Eymar', 'Eymundur', 'Eyríkur', 'Eysteinn', 'Eyvar', 'Eyvindur', 'Eyþór', 'Fabrisíus', 'Falgeir', 'Falur', 'Fannar', 'Fannberg', 'Fanngeir', 'Fáfnir', 'Fálki', 'Felix', 'Fengur', 'Fenrir', 'Ferdinand', 'Ferdínand', 'Fertram', 'Feykir', 'Filip', 'Filippus', 'Finn', 'Finnbjörn', 'Finnbogi', 'Finngeir', 'Finnjón', 'Finnlaugur', 'Finnur', 'Finnvarður', 'Fífill', 'Fjalar', 'Fjarki', 'Fjólar', 'Fjólmundur', 'Fjölnir', 'Fjölvar', 'Fjörnir', 'Flemming', 'Flosi', 'Flóki', 'Flórent', 'Flóvent', 'Forni', 'Fossmar', 'Fólki', 'Francis', 'Frank', 'Franklín', 'Frans', 'Franz', 'Fránn', 'Frár', 'Freybjörn', 'Freygarður', 'Freymar', 'Freymóður', 'Freymundur', 'Freyr', 'Freysteinn', 'Freyviður', 'Freyþór', 'Friðberg', 'Friðbergur', 'Friðbert', 'Friðbjörn', 'Friðfinnur', 'Friðgeir', 'Friðjón', 'Friðlaugur', 'Friðleifur', 'Friðmann', 'Friðmar', 'Friðmundur', 'Friðrik', 'Friðsteinn', 'Friður', 'Friðvin', 'Friðþjófur', 'Friðþór', 'Friedrich', 'Fritz', 'Frímann', 'Frosti', 'Fróði', 'Fróðmar', 'Funi', 'Fúsi', 'Fylkir', 'Gabriel', 'Gabríel', 'Gael', 'Galdur', 'Gamalíel', 'Garðar', 'Garibaldi', 'Garpur', 'Garri', 'Gaui', 'Gaukur', 'Gauti', 'Gautrekur', 'Gautur', 'Gautviður', 'Geir', 'Geirarður', 'Geirfinnur', 'Geirharður', 'Geirhjörtur', 'Geirhvatur', 'Geiri', 'Geirlaugur', 'Geirleifur', 'Geirmundur', 'Geirólfur', 'Geirröður', 'Geirtryggur', 'Geirvaldur', 'Geirþjófur', 'Geisli', 'Gellir', 'Georg', 'Gerald', 'Gerðar', 'Geri', 'Gestur', 'Gilbert', 'Gilmar', 'Gils', 'Gissur', 'Gizur', 'Gídeon', 'Gígjar', 'Gísli', 'Gjúki', 'Glói', 'Glúmur', 'Gneisti', 'Gnúpur', 'Gnýr', 'Goði', 'Goðmundur', 'Gottskálk', 'Gottsveinn', 'Gói', 'Grani', 'Grankell', 'Gregor', 'Greipur', 'Greppur', 'Gretar', 'Grettir', 'Grétar', 'Grímar', 'Grímkell', 'Grímlaugur', 'Grímnir', 'Grímólfur', 'Grímur', 'Grímúlfur', 'Guðberg', 'Guðbergur', 'Guðbjarni', 'Guðbjartur', 'Guðbjörn', 'Guðbrandur', 'Guðfinnur', 'Guðfreður', 'Guðgeir', 'Guðjón', 'Guðlaugur', 'Guðleifur', 'Guðleikur', 'Guðmann', 'Guðmar', 'Guðmon', 'Guðmundur', 'Guðni', 'Guðráður', 'Guðröður', 'Guðsteinn', 'Guðvarður', 'Guðveigur', 'Guðvin', 'Guðþór', 'Gumi', 'Gunnar', 'Gunnberg', 'Gunnbjörn', 'Gunndór', 'Gunngeir', 'Gunnhallur', 'Gunnlaugur', 'Gunnleifur', 'Gunnólfur', 'Gunnóli', 'Gunnröður', 'Gunnsteinn', 'Gunnvaldur', 'Gunnþór', 'Gustav', 'Gutti', 'Guttormur', 'Gústaf', 'Gústav', 'Gylfi', 'Gyrðir', 'Gýgjar', 'Gýmir', 'Haddi', 'Haddur', 'Hafberg', 'Hafgrímur', 'Hafliði', 'Hafnar', 'Hafni', 'Hafsteinn', 'Hafþór', 'Hagalín', 'Hagbarður', 'Hagbert', 'Haki', 'Hallberg', 'Hallbjörn', 'Halldór', 'Hallfreður', 'Hallgarður', 'Hallgeir', 'Hallgils', 'Hallgrímur', 'Hallkell', 'Hallmann', 'Hallmar', 'Hallmundur', 'Hallsteinn', 'Hallur', 'Hallvarður', 'Hallþór', 'Hamar', 'Hannes', 'Hannibal', 'Hans', 'Harald', 'Haraldur', 'Harri', 'Harry', 'Harrý', 'Hartmann', 'Hartvig', 'Hauksteinn', 'Haukur', 'Haukvaldur', 'Hákon', 'Háleygur', 'Hálfdan', 'Hálfdán', 'Hámundur', 'Hárekur', 'Hárlaugur', 'Hásteinn', 'Hávar', 'Hávarður', 'Hávarr', 'Hávarr', 'Heiðar', 'Heiðarr', 'Heiðberg', 'Heiðbert', 'Heiðlindur', 'Heiðmann', 'Heiðmar', 'Heiðmundur', 'Heiðrekur', 'Heikir', 'Heilmóður', 'Heimir', 'Heinrekur', 'Heisi', 'Hektor', 'Helgi', 'Helmút', 'Hemmert', 'Hendrik', 'Henning', 'Henrik', 'Henry', 'Henrý', 'Herbert', 'Herbjörn', 'Herfinnur', 'Hergeir', 'Hergill', 'Hergils', 'Herjólfur', 'Herlaugur', 'Herleifur', 'Herluf', 'Hermann', 'Hermóður', 'Hermundur', 'Hersir', 'Hersteinn', 'Hersveinn', 'Hervar', 'Hervarður', 'Hervin', 'Héðinn', 'Hilaríus', 'Hilbert', 'Hildar', 'Hildibergur', 'Hildibrandur', 'Hildigeir', 'Hildiglúmur', 'Hildimar', 'Hildimundur', 'Hildingur', 'Hildir', 'Hildiþór', 'Hilmar', 'Hilmir', 'Himri', 'Hinrik', 'Híram', 'Hjallkár', 'Hjalti', 'Hjarnar', 'Hjálmar', 'Hjálmgeir', 'Hjálmtýr', 'Hjálmur', 'Hjálmþór', 'Hjörleifur', 'Hjörtur', 'Hjörtþór', 'Hjörvar', 'Hleiðar', 'Hlégestur', 'Hlér', 'Hlini', 'Hlíðar', 'Hlíðberg', 'Hlífar', 'Hljómur', 'Hlynur', 'Hlöðmundur', 'Hlöður', 'Hlöðvarður', 'Hlöðver', 'Hnefill', 'Hnikar', 'Hnikarr', 'Holgeir', 'Holger', 'Holti', 'Hólm', 'Hólmar', 'Hólmbert', 'Hólmfastur', 'Hólmgeir', 'Hólmgrímur', 'Hólmkell', 'Hólmsteinn', 'Hólmþór', 'Hóseas', 'Hrafn', 'Hrafnar', 'Hrafnbergur', 'Hrafnkell', 'Hrafntýr', 'Hrannar', 'Hrappur', 'Hraunar', 'Hreggviður', 'Hreiðar', 'Hreiðmar', 'Hreimur', 'Hreinn', 'Hringur', 'Hrímnir', 'Hrollaugur', 'Hrolleifur', 'Hróaldur', 'Hróar', 'Hróbjartur', 'Hróðgeir', 'Hróðmar', 'Hróðólfur', 'Hróðvar', 'Hrói', 'Hrólfur', 'Hrómundur', 'Hrútur', 'Hrærekur', 'Hugberg', 'Hugi', 'Huginn', 'Hugleikur', 'Hugo', 'Hugó', 'Huldar', 'Huxley', 'Húbert', 'Húgó', 'Húmi', 'Húnbogi', 'Húni', 'Húnn', 'Húnröður', 'Hvannar', 'Hyltir', 'Hylur', 'Hængur', 'Hænir', 'Höður', 'Högni', 'Hörður', 'Höskuldur', 'Illugi', 'Immanúel', 'Indriði', 'Ingberg', 'Ingi', 'Ingiberg', 'Ingibergur', 'Ingibert', 'Ingibjartur', 'Ingibjörn', 'Ingileifur', 'Ingimagn', 'Ingimar', 'Ingimundur', 'Ingivaldur', 'Ingiþór', 'Ingjaldur', 'Ingmar', 'Ingólfur', 'Ingvaldur', 'Ingvar', 'Ingvi', 'Ingþór', 'Ismael', 'Issi', 'Ían', 'Ígor', 'Ími', 'Ísak', 'Ísar', 'Ísarr', 'Ísbjörn', 'Íseldur', 'Ísgeir', 'Ísidór', 'Ísleifur', 'Ísmael', 'Ísmar', 'Ísólfur', 'Ísrael', 'Ívan', 'Ívar', 'Jack', 'Jafet', 'Jaki', 'Jakob', 'Jakop', 'Jamil', 'Jan', 'Janus', 'Jarl', 'Jason', 'Járngrímur', 'Játgeir', 'Játmundur', 'Játvarður', 'Jenni', 'Jens', 'Jeremías', 'Jes', 'Jesper', 'Jochum', 'Johan', 'John', 'Joshua', 'Jóakim', 'Jóann', 'Jóel', 'Jóhann', 'Jóhannes', 'Jói', 'Jómar', 'Jómundur', 'Jón', 'Jónar', 'Jónas', 'Jónatan', 'Jónbjörn', 'Jóndór', 'Jóngeir', 'Jónmundur', 'Jónsteinn', 'Jónþór', 'Jósafat', 'Jósavin', 'Jósef', 'Jósep', 'Jósteinn', 'Jósúa', 'Jóvin', 'Julian', 'Júlí', 'Júlían', 'Júlíus', 'Júní', 'Júníus', 'Júrek', 'Jökull', 'Jörfi', 'Jörgen', 'Jörmundur', 'Jörri', 'Jörundur', 'Jörvar', 'Jörvi', 'Kaj', 'Kakali', 'Kaktus', 'Kaldi', 'Kaleb', 'Kali', 'Kalman', 'Kalmann', 'Kalmar', 'Kaprasíus', 'Karel', 'Karim', 'Karkur', 'Karl', 'Karles', 'Karli', 'Karvel', 'Kaspar', 'Kasper', 'Kastíel', 'Katarínus', 'Kató', 'Kár', 'Kári', 'Keran', 'Ketilbjörn', 'Ketill', 'Kilían', 'Kiljan', 'Kjalar', 'Kjallakur', 'Kjaran', 'Kjartan', 'Kjarval', 'Kjárr', 'Kjói', 'Klemens', 'Klemenz', 'Klængur', 'Knútur', 'Knörr', 'Koðrán', 'Koggi', 'Kolbeinn', 'Kolbjörn', 'Kolfinnur', 'Kolgrímur', 'Kolmar', 'Kolskeggur', 'Kolur', 'Kolviður', 'Konráð', 'Konstantínus', 'Kormákur', 'Kornelíus', 'Kort', 'Kópur', 'Kraki', 'Kris', 'Kristall', 'Kristberg', 'Kristbergur', 'Kristbjörn', 'Kristdór', 'Kristens', 'Krister', 'Kristfinnur', 'Kristgeir', 'Kristian', 'Kristinn', 'Kristján', 'Kristjón', 'Kristlaugur', 'Kristleifur', 'Kristmann', 'Kristmar', 'Kristmundur', 'Kristofer', 'Kristófer', 'Kristvaldur', 'Kristvarður', 'Kristvin', 'Kristþór', 'Krummi', 'Kveldúlfur', 'Lambert', 'Lars', 'Laufar', 'Laugi', 'Lauritz', 'Lár', 'Lárent', 'Lárentíus', 'Lárus', 'Leiðólfur', 'Leif', 'Leifur', 'Leiknir', 'Leo', 'Leon', 'Leonard', 'Leonhard', 'Leó', 'Leópold', 'Leví', 'Lér', 'Liljar', 'Lindar', 'Lindberg', 'Línberg', 'Líni', 'Ljósálfur', 'Ljótur', 'Ljúfur', 'Loðmundur', 'Loftur', 'Logi', 'Loki', 'Lórens', 'Lórenz', 'Ludvig', 'Lundi', 'Lúðvíg', 'Lúðvík', 'Lúkas', 'Lúter', 'Lúther', 'Lyngar', 'Lýður', 'Lýtingur', 'Maggi', 'Magngeir', 'Magni', 'Magnús', 'Magnþór', 'Makan', 'Manfred', 'Manfreð', 'Manúel', 'Mar', 'Marbjörn', 'Marel', 'Margeir', 'Margrímur', 'Mari', 'Marijón', 'Marinó', 'Marías', 'Marínó', 'Marís', 'Maríus', 'Marjón', 'Markó', 'Markús', 'Markþór', 'Maron', 'Marri', 'Mars', 'Marsellíus', 'Marteinn', 'Marten', 'Marthen', 'Martin', 'Marvin', 'Mathías', 'Matthías', 'Matti', 'Mattías', 'Max', 'Maximus', 'Máni', 'Már', 'Márus', 'Mekkinó', 'Melkíor', 'Melkólmur', 'Melrakki', 'Mensalder', 'Merkúr', 'Methúsalem', 'Metúsalem', 'Meyvant', 'Michael', 'Mikael', 'Mikjáll', 'Mikkael', 'Mikkel', 'Mildinberg', 'Mías', 'Mímir', 'Míó', 'Mír', 'Mjöllnir', 'Mjölnir', 'Moli', 'Morgan', 'Moritz', 'Mosi', 'Móði', 'Móri', 'Mórits', 'Móses', 'Muggur', 'Muni', 'Muninn', 'Múli', 'Myrkvi', 'Mýrkjartan', 'Mörður', 'Narfi', 'Natan', 'Natanael', 'Nataníel', 'Náttmörður', 'Náttúlfur', 'Neisti', 'Nenni', 'Neptúnus', 'Nicolas', 'Nikanor', 'Nikolai', 'Nikolas', 'Nikulás', 'Nils', 'Níels', 'Níls', 'Njáll', 'Njörður', 'Nonni', 'Norbert', 'Norðmann', 'Normann', 'Nóam', 'Nóel', 'Nói', 'Nóni', 'Nóri', 'Nóvember', 'Númi', 'Nývarð', 'Nökkvi', 'Oddbergur', 'Oddbjörn', 'Oddfreyr', 'Oddgeir', 'Oddi', 'Oddkell', 'Oddleifur', 'Oddmar', 'Oddsteinn', 'Oddur', 'Oddvar', 'Oddþór', 'Oktavíus', 'Októ', 'Októvíus', 'Olaf', 'Olav', 'Olgeir', 'Oliver', 'Olivert', 'Orfeus', 'Ormar', 'Ormur', 'Orri', 'Orvar', 'Otkell', 'Otri', 'Otti', 'Ottó', 'Otur', 'Óðinn', 'Ófeigur', 'Ólafur', 'Óli', 'Óliver', 'Ólíver', 'Ómar', 'Ómi', 'Óskar', 'Ósvald', 'Ósvaldur', 'Ósvífur', 'Óttar', 'Óttarr', 'Parmes', 'Patrek', 'Patrekur', 'Patrick', 'Patrik', 'Páll', 'Pálmar', 'Pálmi', 'Pedró', 'Per', 'Peter', 'Pétur', 'Pjetur', 'Príor', 'Rafael', 'Rafn', 'Rafnar', 'Rafnkell', 'Ragnar', 'Ragúel', 'Randver', 'Rannver', 'Rasmus', 'Ráðgeir', 'Ráðvarður', 'Refur', 'Reginbaldur', 'Reginn', 'Reidar', 'Reifnir', 'Reimar', 'Reinar', 'Reinhart', 'Reinhold', 'Reynald', 'Reynar', 'Reynir', 'Reyr', 'Richard', 'Rikharð', 'Rikharður', 'Ríkarður', 'Ríkharð', 'Ríkharður', 'Ríó', 'Robert', 'Rolf', 'Ronald', 'Róbert', 'Rólant', 'Róman', 'Rómeó', 'Rósant', 'Rósar', 'Rósberg', 'Rósenberg', 'Rósi', 'Rósinberg', 'Rósinkar', 'Rósinkrans', 'Rósmann', 'Rósmundur', 'Rudolf', 'Runi', 'Runólfur', 'Rúbar', 'Rúben', 'Rúdólf', 'Rúnar', 'Rúrik', 'Rútur', 'Röðull', 'Rögnvald', 'Rögnvaldur', 'Rögnvar', 'Rökkvi', 'Safír', 'Sakarías', 'Salmann', 'Salmar', 'Salómon', 'Salvar', 'Samson', 'Samúel', 'Sandel', 'Sandri', 'Sandur', 'Saxi', 'Sebastian', 'Sebastían', 'Seifur', 'Seimur', 'Sesar', 'Sesil', 'Sigbergur', 'Sigbert', 'Sigbjartur', 'Sigbjörn', 'Sigdór', 'Sigfastur', 'Sigfinnur', 'Sigfreður', 'Sigfús', 'Siggeir', 'Sighvatur', 'Sigjón', 'Siglaugur', 'Sigmann', 'Sigmar', 'Sigmundur', 'Signar', 'Sigri', 'Sigríkur', 'Sigsteinn', 'Sigtryggur', 'Sigtýr', 'Sigur', 'Sigurbaldur', 'Sigurberg', 'Sigurbergur', 'Sigurbjarni', 'Sigurbjartur', 'Sigurbjörn', 'Sigurbrandur', 'Sigurdór', 'Sigurður', 'Sigurfinnur', 'Sigurgeir', 'Sigurgestur', 'Sigurgísli', 'Sigurgrímur', 'Sigurhans', 'Sigurhjörtur', 'Sigurjón', 'Sigurkarl', 'Sigurlaugur', 'Sigurlás', 'Sigurleifur', 'Sigurliði', 'Sigurlinni', 'Sigurmann', 'Sigurmar', 'Sigurmon', 'Sigurmundur', 'Sigurnýas', 'Sigurnýjas', 'Siguroddur', 'Siguróli', 'Sigurpáll', 'Sigursteinn', 'Sigursveinn', 'Sigurvaldi', 'Sigurvin', 'Sigurþór', 'Sigvaldi', 'Sigvarður', 'Sigþór', 'Silli', 'Sindri', 'Símon', 'Sírnir', 'Sírus', 'Sívar', 'Sjafnar', 'Skafti', 'Skapti', 'Skarphéðinn', 'Skefill', 'Skeggi', 'Skíði', 'Skírnir', 'Skjöldur', 'Skorri', 'Skuggi', 'Skúli', 'Skúta', 'Skær', 'Skæringur', 'Smári', 'Smiður', 'Smyrill', 'Snjóki', 'Snjólaugur', 'Snjólfur', 'Snorri', 'Snæbjartur', 'Snæbjörn', 'Snæhólm', 'Snælaugur', 'Snær', 'Snæringur', 'Snævar', 'Snævarr', 'Snæþór', 'Soffanías', 'Sophanías', 'Sophus', 'Sófónías', 'Sófus', 'Sókrates', 'Sólberg', 'Sólbergur', 'Sólbjartur', 'Sólbjörn', 'Sólimann', 'Sólmar', 'Sólmundur', 'Sólon', 'Sólver', 'Sólvin', 'Spartakus', 'Sporði', 'Spói', 'Stanley', 'Stapi', 'Starkaður', 'Starri', 'Stefan', 'Stefán', 'Stefnir', 'Steinar', 'Steinarr', 'Steinberg', 'Steinbergur', 'Steinbjörn', 'Steindór', 'Steinfinnur', 'Steingrímur', 'Steini', 'Steinkell', 'Steinmann', 'Steinmar', 'Steinmóður', 'Steinn', 'Steinólfur', 'Steinröður', 'Steinvarður', 'Steinþór', 'Stirnir', 'Stígur', 'Stormur', 'Stórólfur', 'Sturla', 'Sturlaugur', 'Sturri', 'Styr', 'Styrbjörn', 'Styrkár', 'Styrmir', 'Styrr', 'Sumarliði', 'Svafar', 'Svali', 'Svan', 'Svanberg', 'Svanbergur', 'Svanbjörn', 'Svangeir', 'Svanhólm', 'Svani', 'Svanlaugur', 'Svanmundur', 'Svanur', 'Svanþór', 'Svavar', 'Sváfnir', 'Sveinar', 'Sveinberg', 'Sveinbjartur', 'Sveinbjörn', 'Sveinjón', 'Sveinlaugur', 'Sveinmar', 'Sveinn', 'Sveinungi', 'Sveinþór', 'Svend', 'Sverre', 'Sverrir', 'Svölnir', 'Svörfuður', 'Sýrus', 'Sæberg', 'Sæbergur', 'Sæbjörn', 'Sæi', 'Sælaugur', 'Sæmann', 'Sæmundur', 'Sær', 'Sævald', 'Sævaldur', 'Sævar', 'Sævarr', 'Sævin', 'Sæþór', 'Sölmundur', 'Sölvar', 'Sölvi', 'Sören', 'Sörli', 'Tandri', 'Tarfur', 'Teitur', 'Theodór', 'Theódór', 'Thomas', 'Thor', 'Thorberg', 'Thór', 'Tindar', 'Tindri', 'Tindur', 'Tinni', 'Tími', 'Tímon', 'Tímoteus', 'Tímóteus', 'Tístran', 'Tjaldur', 'Tjörfi', 'Tjörvi', 'Tobías', 'Tolli', 'Tonni', 'Torfi', 'Tóbías', 'Tói', 'Tóki', 'Tómas', 'Tór', 'Trausti', 'Tristan', 'Trostan', 'Trúmann', 'Tryggvi', 'Tumas', 'Tumi', 'Tyrfingur', 'Týr', 'Ubbi', 'Uggi', 'Ulrich', 'Uni', 'Unnar', 'Unnbjörn', 'Unndór', 'Unnsteinn', 'Unnþór', 'Urðar', 'Uxi', 'Úddi', 'Úlfar', 'Úlfgeir', 'Úlfhéðinn', 'Úlfkell', 'Úlfljótur', 'Úlftýr', 'Úlfur', 'Úlrik', 'Úranus', 'Vagn', 'Vakur', 'Valberg', 'Valbergur', 'Valbjörn', 'Valbrandur', 'Valdemar', 'Valdi', 'Valdimar', 'Valdór', 'Valentín', 'Valentínus', 'Valgarð', 'Valgarður', 'Valgeir', 'Valíant', 'Vallaður', 'Valmar', 'Valmundur', 'Valsteinn', 'Valter', 'Valtýr', 'Valur', 'Valves', 'Valþór', 'Varmar', 'Vatnar', 'Váli', 'Vápni', 'Veigar', 'Veigur', 'Ver', 'Vermundur', 'Vernharð', 'Vernharður', 'Vestar', 'Vestmar', 'Veturliði', 'Vébjörn', 'Végeir', 'Vékell', 'Vélaugur', 'Vémundur', 'Vésteinn', 'Victor', 'Viðar', 'Vigfús', 'Viggó', 'Vignir', 'Vigri', 'Vigtýr', 'Vigur', 'Vikar', 'Viktor', 'Vilberg', 'Vilbergur', 'Vilbert', 'Vilbjörn', 'Vilbogi', 'Vilbrandur', 'Vilgeir', 'Vilhelm', 'Vilhjálmur', 'Vili', 'Viljar', 'Vilji', 'Villi', 'Vilmar', 'Vilmundur', 'Vincent', 'Vinjar', 'Virgill', 'Víðar', 'Víðir', 'Vífill', 'Víglundur', 'Vígmar', 'Vígmundur', 'Vígsteinn', 'Vígþór', 'Víkingur', 'Vopni', 'Vorm', 'Vöggur', 'Völundur', 'Vörður', 'Vöttur', 'Walter', 'Werner', 'Wilhelm', 'Willard', 'William', 'Willum', 'Ylur', 'Ymir', 'Yngvar', 'Yngvi', 'Yrkill', 'Ýmir', 'Ýrar', 'Zakaría', 'Zakarías', 'Zophanías', 'Zophonías', 'Zóphanías', 'Zóphonías', 'Þangbrandur', 'Þengill', 'Þeyr', 'Þiðrandi', 'Þiðrik', 'Þinur', 'Þjálfi', 'Þjóðann', 'Þjóðbjörn', 'Þjóðgeir', 'Þjóðleifur', 'Þjóðmar', 'Þjóðólfur', 'Þjóðrekur', 'Þjóðvarður', 'Þjóstar', 'Þjóstólfur', 'Þorberg', 'Þorbergur', 'Þorbjörn', 'Þorbrandur', 'Þorfinnur', 'Þorgarður', 'Þorgautur', 'Þorgeir', 'Þorgestur', 'Þorgils', 'Þorgísl', 'Þorgnýr', 'Þorgrímur', 'Þorkell', 'Þorlaugur', 'Þorlákur', 'Þorleifur', 'Þorleikur', 'Þormar', 'Þormóður', 'Þormundur', 'Þorri', 'Þorsteinn', 'Þorvaldur', 'Þorvar', 'Þorvarður', 'Þór', 'Þórar', 'Þórarinn', 'Þórbergur', 'Þórbjörn', 'Þórður', 'Þórgnýr', 'Þórgrímur', 'Þórhaddur', 'Þórhalli', 'Þórhallur', 'Þórir', 'Þórlaugur', 'Þórleifur', 'Þórlindur', 'Þórmar', 'Þórmundur', 'Þóroddur', 'Þórormur', 'Þórólfur', 'Þórsteinn', 'Þórörn', 'Þrastar', 'Þráinn', 'Þrándur', 'Þróttur', 'Þrúðmar', 'Þrymur', 'Þröstur', 'Þyrnir', 'Ægir', 'Æsir', 'Ævar', 'Ævarr', 'Ögmundur', 'Ögri', 'Ölnir', 'Ölver', 'Ölvir', 'Öndólfur', 'Önundur', 'Örlaugur', 'Örlygur', 'Örn', 'Örnólfur', 'Örvar', 'Össur', 'Öxar']; - - /** - * @var array Icelandic middle names. - */ - protected static $middleName = [ - 'Aðaldal', 'Aldan', 'Arnberg', 'Arnfjörð', 'Austan', 'Austdal', 'Austfjörð', 'Áss', 'Bakkdal', 'Bakkmann', 'Bald', 'Ben', 'Bergholt', 'Bergland', 'Bíldsfells', 'Bjarg', 'Bjarndal', 'Bjarnfjörð', 'Bláfeld', 'Blómkvist', 'Borgdal', 'Brekkmann', 'Brim', 'Brúnsteð', 'Dalhoff', 'Dan', 'Diljan', 'Ektavon', 'Eldberg', 'Elísberg', 'Elvan', 'Espólín', 'Eyhlíð', 'Eyvík', 'Falk', 'Finndal', 'Fossberg', 'Freydal', 'Friðhólm', 'Giljan', 'Gilsfjörð', 'Gnarr', 'Gnurr', 'Grendal', 'Grindvík', 'Gull', 'Haffjörð', 'Hafnes', 'Hafnfjörð', 'Har', 'Heimdal', 'Heimsberg', 'Helgfell', 'Herberg', 'Hildiberg', 'Hjaltdal', 'Hlíðkvist', 'Hnappdal', 'Hnífsdal', 'Hofland', 'Hofteig', 'Hornfjörð', 'Hólmberg', 'Hrafnan', 'Hrafndal', 'Hraunberg', 'Hreinberg', 'Hreindal', 'Hrútfjörð', 'Hvammdal', 'Hvítfeld', 'Höfðdal', 'Hörðdal', 'Íshólm', 'Júl', 'Kjarrval', 'Knaran', 'Knarran', 'Krossdal', 'Laufkvist', 'Laufland', 'Laugdal', 'Laxfoss', 'Liljan', 'Linddal', 'Línberg', 'Ljós', 'Loðmfjörð', 'Lyngberg', 'Magdal', 'Magg', 'Matt', 'Miðdal', 'Miðvík', 'Mjófjörð', 'Móberg', 'Mýrmann', 'Nesmann', 'Norðland', 'Núpdal', 'Ólfjörð', 'Ósland', 'Ósmann', 'Reginbald', 'Reykfell', 'Reykfjörð', 'Reynholt', 'Salberg', 'Sandhólm', 'Seljan', 'Sigurhólm', 'Skagalín', 'Skíðdal', 'Snæberg', 'Snædahl', 'Sólan', 'Stardal', 'Stein', 'Steinbekk', 'Steinberg', 'Storm', 'Straumberg', 'Svanhild', 'Svarfdal', 'Sædal', 'Val', 'Valagils', 'Vald', 'Varmdal', 'Vatnsfjörð', 'Vattar', 'Vattnes', 'Viðfjörð', 'Vídalín', 'Víking', 'Vopnfjörð', 'Yngling', 'Þor', 'Önfjörð', 'Örbekk', 'Öxdal', 'Öxndal', - ]; - - /** - * Randomly return an Icelandic middle name. - * - * @return string - */ - public static function middleName() - { - return static::randomElement(static::$middleName); - } - - /** - * Generate prepared last name for further processing. - * - * @return string - */ - public function lastName() - { - $name = static::firstNameMale(); - - if (substr($name, -2) === 'ur') { - $name = substr($name, 0, strlen($name) - 2); - } - - if (substr($name, -1) !== 's') { - $name .= 's'; - } - - return $name; - } - - /** - * Randomly return an Icelandic last name for a woman. - * - * @return string - */ - public function lastNameMale() - { - return $this->lastName() . 'son'; - } - - /** - * Randomly return an Icelandic last name for a man. - * - * @return string - */ - public function lastNameFemale() - { - return $this->lastName() . 'dóttir'; - } - - /** - * Return a random Icelandic Kennitala (Social Security number). - * - * @see http://en.wikipedia.org/wiki/Kennitala - * - * @return string - */ - public static function ssn() - { - // random birth date - $birthdate = DateTime::dateTimeThisCentury(); - - // last four buffer - $lastFour = null; - - // security variable reference - $ref = '32765432'; - - // valid flag - $valid = false; - - while (!$valid) { - // make two random numbers - $rand = static::randomDigit() . static::randomDigit(); - - // 8 char string with birth date and two random numbers - $tmp = $birthdate->format('dmy') . $rand; - - // loop through temp string - for ($i = 7, $sum = 0; $i >= 0; --$i) { - // calculate security variable - $sum += ($tmp[$i] * $ref[$i]); - } - - // subtract 11 if not 11 - $chk = ($sum % 11 === 0) ? 0 : (11 - ($sum % 11)); - - if ($chk < 10) { - $lastFour = $rand . $chk . substr($birthdate->format('Y'), 1, 1); - - $valid = true; - } - } - - return sprintf('%s-%s', $birthdate->format('dmy'), $lastFour); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/is_IS/PhoneNumber.php b/vendor/fakerphp/faker/src/Faker/Provider/is_IS/PhoneNumber.php deleted file mode 100644 index 7118666e..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/is_IS/PhoneNumber.php +++ /dev/null @@ -1,17 +0,0 @@ - 'Argovia'], - ['AI' => 'Appenzello Interno'], - ['AR' => 'Appenzello Esterno'], - ['BE' => 'Berna'], - ['BL' => 'Basilea Campagna'], - ['BS' => 'Basilea Città'], - ['FR' => 'Friburgo'], - ['GE' => 'Ginevra'], - ['GL' => 'Glarona'], - ['GR' => 'Grigioni'], - ['JU' => 'Giura'], - ['LU' => 'Lucerna'], - ['NE' => 'Neuchâtel'], - ['NW' => 'Nidvaldo'], - ['OW' => 'Obvaldo'], - ['SG' => 'San Gallo'], - ['SH' => 'Sciaffusa'], - ['SO' => 'Soletta'], - ['SZ' => 'Svitto'], - ['TG' => 'Turgovia'], - ['TI' => 'Ticino'], - ['UR' => 'Uri'], - ['VD' => 'Vaud'], - ['VS' => 'Vallese'], - ['ZG' => 'Zugo'], - ['ZH' => 'Zurigo'], - ]; - - protected static $cityFormats = [ - '{{cityName}}', - ]; - - protected static $streetNameFormats = [ - '{{streetSuffix}} {{firstName}}', - '{{streetSuffix}} {{lastName}}', - ]; - - protected static $streetAddressFormats = [ - '{{streetName}} {{buildingNumber}}', - ]; - protected static $addressFormats = [ - "{{streetAddress}}\n{{postcode}} {{city}}", - ]; - - /** - * Returns a random street prefix - * - * @example Via - * - * @return string - */ - public static function streetPrefix() - { - return static::randomElement(static::$streetPrefix); - } - - /** - * Returns a random city name. - * - * @example Luzern - * - * @return string - */ - public function cityName() - { - return static::randomElement(static::$cityNames); - } - - /** - * Returns a canton - * - * @example array('BE' => 'Bern') - * - * @return array - */ - public static function canton() - { - return static::randomElement(static::$canton); - } - - /** - * Returns the abbreviation of a canton. - * - * @return string - */ - public static function cantonShort() - { - $canton = static::canton(); - - return key($canton); - } - - /** - * Returns the name of canton. - * - * @return string - */ - public static function cantonName() - { - $canton = static::canton(); - - return current($canton); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/it_CH/Company.php b/vendor/fakerphp/faker/src/Faker/Provider/it_CH/Company.php deleted file mode 100644 index bb5f9460..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/it_CH/Company.php +++ /dev/null @@ -1,15 +0,0 @@ -generator->parse($format); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/ja_JP/Company.php b/vendor/fakerphp/faker/src/Faker/Provider/ja_JP/Company.php deleted file mode 100644 index 0e4b88df..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/ja_JP/Company.php +++ /dev/null @@ -1,17 +0,0 @@ -generator->parse($format)); - } - - /** - * @example 'yamada.jp' - */ - public function domainName() - { - return static::randomElement(static::$lastNameAscii) . '.' . $this->tld(); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/ja_JP/Person.php b/vendor/fakerphp/faker/src/Faker/Provider/ja_JP/Person.php deleted file mode 100644 index 399e5595..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/ja_JP/Person.php +++ /dev/null @@ -1,147 +0,0 @@ -generator->parse($format); - } - - /** - * @param string|null $gender 'male', 'female' or null for any - * - * @return string - * - * @example 'アキラ' - */ - public function firstKanaName($gender = null) - { - if ($gender === static::GENDER_MALE) { - return static::firstKanaNameMale(); - } - - if ($gender === static::GENDER_FEMALE) { - return static::firstKanaNameFemale(); - } - - return $this->generator->parse(static::randomElement(static::$firstKanaNameFormat)); - } - - /** - * @example 'アキラ' - */ - public static function firstKanaNameMale() - { - return static::randomElement(static::$firstKanaNameMale); - } - - /** - * @example 'アケミ' - */ - public static function firstKanaNameFemale() - { - return static::randomElement(static::$firstKanaNameFemale); - } - - /** - * @example 'アオタ' - */ - public static function lastKanaName() - { - return static::randomElement(static::$lastKanaName); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/ja_JP/PhoneNumber.php b/vendor/fakerphp/faker/src/Faker/Provider/ja_JP/PhoneNumber.php deleted file mode 100644 index 1e0595e0..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/ja_JP/PhoneNumber.php +++ /dev/null @@ -1,19 +0,0 @@ -generator->parse($format); - } - - public static function companyPrefix() - { - return static::randomElement(static::$companyPrefixes); - } - - public static function companyNameElement() - { - return static::randomElement(static::$companyElements); - } - - public static function companyNameSuffix() - { - return static::randomElement(static::$companyNameSuffixes); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/ka_GE/DateTime.php b/vendor/fakerphp/faker/src/Faker/Provider/ka_GE/DateTime.php deleted file mode 100644 index 375c32a7..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/ka_GE/DateTime.php +++ /dev/null @@ -1,43 +0,0 @@ - 'კვირა', - 'Monday' => 'ორშაბათი', - 'Tuesday' => 'სამშაბათი', - 'Wednesday' => 'ოთხშაბათი', - 'Thursday' => 'ხუთშაბათი', - 'Friday' => 'პარასკევი', - 'Saturday' => 'შაბათი', - ]; - $week = static::dateTime($max)->format('l'); - - return $map[$week] ?? $week; - } - - public static function monthName($max = 'now') - { - $map = [ - 'January' => 'იანვარი', - 'February' => 'თებერვალი', - 'March' => 'მარტი', - 'April' => 'აპრილი', - 'May' => 'მაისი', - 'June' => 'ივნისი', - 'July' => 'ივლისი', - 'August' => 'აგვისტო', - 'September' => 'სექტემბერი', - 'October' => 'ოქტომბერი', - 'November' => 'ნოემბერი', - 'December' => 'დეკემბერი', - ]; - $month = static::dateTime($max)->format('F'); - - return $map[$month] ?? $month; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/ka_GE/Internet.php b/vendor/fakerphp/faker/src/Faker/Provider/ka_GE/Internet.php deleted file mode 100644 index d07e41cc..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/ka_GE/Internet.php +++ /dev/null @@ -1,15 +0,0 @@ -generator->parse($format); - } - - public static function companyPrefix() - { - return static::randomElement(static::$companyPrefixes); - } - - public static function companyNameElement() - { - return static::randomElement(static::$companyElements); - } - - public static function companyNameSuffix() - { - return static::randomElement(static::$companyNameSuffixes); - } - - /** - * National Business Identification Numbers - * - * @see http://egov.kz/wps/portal/Content?contentPath=%2Fegovcontent%2Fbus_business%2Ffor_businessmen%2Farticle%2Fbusiness_identification_number&lang=en - * - * @param \DateTime $registrationDate - * - * @return string 12 digits, like 150140000019 - */ - public static function businessIdentificationNumber(\DateTime $registrationDate = null) - { - if (!$registrationDate) { - $registrationDate = \Faker\Provider\DateTime::dateTimeThisYear(); - } - - $dateAsString = $registrationDate->format('ym'); - $legalEntityType = (string) self::numberBetween(4, 6); - $legalEntityAdditionalType = (string) self::numberBetween(0, 3); - $randomDigits = (string) static::numerify('######'); - - return $dateAsString . $legalEntityType . $legalEntityAdditionalType . $randomDigits; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/kk_KZ/Internet.php b/vendor/fakerphp/faker/src/Faker/Provider/kk_KZ/Internet.php deleted file mode 100644 index 0328da09..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/kk_KZ/Internet.php +++ /dev/null @@ -1,9 +0,0 @@ - [ - self::CENTURY_19TH => self::MALE_CENTURY_19TH, - self::CENTURY_20TH => self::MALE_CENTURY_20TH, - self::CENTURY_21ST => self::MALE_CENTURY_21ST, - ], - self::GENDER_FEMALE => [ - self::CENTURY_19TH => self::FEMALE_CENTURY_19TH, - self::CENTURY_20TH => self::FEMALE_CENTURY_20TH, - self::CENTURY_21ST => self::FEMALE_CENTURY_21ST, - ], - ]; - - /** - * @see https://ru.wikipedia.org/wiki/%D0%9A%D0%B0%D0%B7%D0%B0%D1%85%D1%81%D0%BA%D0%B0%D1%8F_%D1%84%D0%B0%D0%BC%D0%B8%D0%BB%D0%B8%D1%8F - * - * @var array - */ - protected static $maleNameFormats = [ - '{{lastName}}ұлы {{firstNameMale}}', - ]; - - /** - * @see https://ru.wikipedia.org/wiki/%D0%9A%D0%B0%D0%B7%D0%B0%D1%85%D1%81%D0%BA%D0%B0%D1%8F_%D1%84%D0%B0%D0%BC%D0%B8%D0%BB%D0%B8%D1%8F - * - * @var array - */ - protected static $femaleNameFormats = [ - '{{lastName}}қызы {{firstNameFemale}}', - ]; - - /** - * @see http://koshpendi.kz/index.php/nomad/imena/ - * - * @var array - */ - protected static $firstNameMale = [ - 'Аылғазы', - 'Әбдіқадыр', - 'Бабағожа', - 'Ғайса', - 'Дәмен', - 'Егізбек', - 'Жазылбек', - 'Зұлпықар', - 'Игісін', - 'Кәдіржан', - 'Қадырқан', - 'Латиф', - 'Мағаз', - 'Нармағамбет', - 'Оңалбай', - 'Өндіріс', - 'Пердебек', - 'Рақат', - 'Сағындық', - 'Танабай', - 'Уайыс', - 'Ұйықбай', - 'Үрімбай', - 'Файзрахман', - 'Хангелді', - 'Шаттық', - 'Ыстамбақы', - 'Ібни', - ]; - - /** - * @see http://koshpendi.kz/index.php/nomad/imena/ - * - * @var array - */ - protected static $firstNameFemale = [ - 'Асылтас', - 'Әужа', - 'Бүлдіршін', - 'Гүлшаш', - 'Ғафура', - 'Ділдә', - 'Еркежан', - 'Жібек', - 'Зылиқа', - 'Ирада', - 'Күнсұлу', - 'Қырмызы', - 'Ләтипа', - 'Мүштәри', - 'Нұршара', - 'Орынша', - 'Өрзия', - 'Перизат', - 'Рухия', - 'Сындыбала', - 'Тұрсынай', - 'Уәсима', - 'Ұрқия', - 'Үрия', - 'Фируза', - 'Хафиза', - 'Шырынгүл', - 'Ырысты', - 'Іңкәр', - ]; - - /** - * @see http://koshpendi.kz/index.php/nomad/imena/ - * @see https://ru.wikipedia.org/wiki/%D0%9A%D0%B0%D0%B7%D0%B0%D1%85%D1%81%D0%BA%D0%B0%D1%8F_%D1%84%D0%B0%D0%BC%D0%B8%D0%BB%D0%B8%D1%8F - * - * @var array - */ - protected static $lastName = [ - 'Адырбай', - 'Әжібай', - 'Байбөрі', - 'Ғизат', - 'Ділдабек', - 'Ешмұхамбет', - 'Жігер', - 'Зікірия', - 'Иса', - 'Кунту', - 'Қыдыр', - 'Лұқпан', - 'Мышырбай', - 'Нысынбай', - 'Ошақбай', - 'Өтетілеу', - 'Пірәлі', - 'Рүстем', - 'Сырмұхамбет', - 'Тілеміс', - 'Уәлі', - 'Ұлықбек', - 'Үстем', - 'Фахир', - 'Хұсайын', - 'Шілдебай', - 'Ыстамбақы', - 'Ісмет', - ]; - - /** - * Note! When calculating individual identification number - * 2000-01-01 - 2000-12-31 counts as 21th century - * 1900-01-01 - 1900-12-31 counts as 20th century - * - * @param int $year - * - * @return int - */ - private static function getCenturyByYear($year) - { - if (($year >= 2100) || ($year < 1800)) { - throw new \InvalidArgumentException('Unexpected century'); - } - - if ($year >= 2000) { - return self::CENTURY_21ST; - } - - if ($year >= 1900) { - return self::CENTURY_20TH; - } - - return self::CENTURY_19TH; - } - - /** - * National Individual Identification Numbers - * - * @see http://egov.kz/wps/portal/Content?contentPath=%2Fegovcontent%2Fcitizen_migration%2Fpassport_id_card%2Farticle%2Fiin_info&lang=en - * @see https://ru.wikipedia.org/wiki/%D0%98%D0%BD%D0%B4%D0%B8%D0%B2%D0%B8%D0%B4%D1%83%D0%B0%D0%BB%D1%8C%D0%BD%D1%8B%D0%B9_%D0%B8%D0%B4%D0%B5%D0%BD%D1%82%D0%B8%D1%84%D0%B8%D0%BA%D0%B0%D1%86%D0%B8%D0%BE%D0%BD%D0%BD%D1%8B%D0%B9_%D0%BD%D0%BE%D0%BC%D0%B5%D1%80 - * - * @param \DateTime $birthDate - * @param int $gender - * - * @return string 12 digits, like 780322300455 - */ - public static function individualIdentificationNumber(\DateTime $birthDate = null, $gender = self::GENDER_MALE) - { - if (!$birthDate) { - $birthDate = DateTime::dateTimeBetween(); - } - - do { - $population = self::numberBetween(1000, 2000); - $century = self::getCenturyByYear((int) $birthDate->format('Y')); - - $iin = $birthDate->format('ymd'); - $iin .= (string) self::$genderCenturyMap[$gender][$century]; - $iin .= (string) $population; - $checksum = self::checkSum($iin); - } while ($checksum === 10); - - return $iin . (string) $checksum; - } - - /** - * @param string $iinValue - * - * @return int - */ - public static function checkSum($iinValue) - { - $controlDigit = self::getControlDigit($iinValue, self::$firstSequenceBitWeights); - - if ($controlDigit === 10) { - return self::getControlDigit($iinValue, self::$secondSequenceBitWeights); - } - - return $controlDigit; - } - - /** - * @param string $iinValue - * @param array $sequence - * - * @return int - */ - protected static function getControlDigit($iinValue, $sequence) - { - $sum = 0; - - for ($i = 0; $i <= 10; ++$i) { - $sum += (int) $iinValue[$i] * $sequence[$i]; - } - - return $sum % 11; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/kk_KZ/PhoneNumber.php b/vendor/fakerphp/faker/src/Faker/Provider/kk_KZ/PhoneNumber.php deleted file mode 100644 index c5d6440d..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/kk_KZ/PhoneNumber.php +++ /dev/null @@ -1,16 +0,0 @@ -generator->parse($format)); - } - - /** - * @example 'kim.kr' - */ - public function domainName() - { - return static::randomElement(static::$lastNameAscii) . '.' . $this->tld(); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/ko_KR/Person.php b/vendor/fakerphp/faker/src/Faker/Provider/ko_KR/Person.php deleted file mode 100644 index 71f6175b..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/ko_KR/Person.php +++ /dev/null @@ -1,54 +0,0 @@ -generator->parse($format)); - } - - public function cellPhoneNumber() - { - $format = self::randomElement(array_slice(static::$formats, 6, 1)); - - return self::numerify($this->generator->parse($format)); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/ko_KR/Text.php b/vendor/fakerphp/faker/src/Faker/Provider/ko_KR/Text.php deleted file mode 100644 index 8182f899..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/ko_KR/Text.php +++ /dev/null @@ -1,1725 +0,0 @@ -에 나오는 요귀의 불빛 모양으로 푸르무레 하게 허공을 비추오. 동경의 불바다는 내 마음을 더욱 음침하게 하였소. -이 때에 뒤에서, -"모시모시(여보세요)." -하는 소리가 들렸소. 그것은 흰 저고리를 입은 호텔 보이였소. -"왜?" -하고 나는 고개만 돌렸소. -"손님이 오셨습니다." -"손님?" -하고 나는 보이에게로 한 걸음 가까이 갔소. 나를 찾을 손님이 어디 있나 하고 나는 놀란 것이오. -"따님께서 오셨습니다. 방으로 모셨습니다." -하고 보이는 들어가 버리고 말았소. -"따님?" -하고 나는 더욱 놀랐소. 순임이가 서울서 나를 따라왔나? 그것은 안 될 말이오. 순임이가 내 뒤를 따라 떠났더라도 아무리 빨리 와도 내일이 아니면 못 왔을 것이오. 그러면 누군가. 정임인가. 정임이가 병원에서 뛰어온 것인가. -나는 두근거리는 가슴을 억지로 진정하면서 내 방문을 열었소. -그것은 정임이었소. 정임은 내가 쓰다가 둔 편지를 보고 있다가 벌떡 일어나 내게 달려들어 안겨 버렸소. 나는 얼빠진 듯이 정임이가 하라는 대로 내버려두었소. 그 편지는 부치려고 쓴 것도 아닌데 그 편지를 정임이가 본 것이 안되었다고 생각하였소. -형! 나를 책망하시오. 심히 부끄러운 말이지마는 나는 정임을 힘껏 껴안아 주고 싶었소. 나는 몇 번이나 정임의 등을 굽어 보면서 내 팔에 힘을 넣으려고 하였소. 정임은 심히 귀여웠소. 정임이가 그처럼 나를 사모하는 것이 심히 기뻤소. 나는 감정이 재우쳐서 눈이 안 보이고 정신이 몽롱하여짐을 깨달았소. 나는 아프고 쓰린 듯한 기쁨을 깨달았소. 영어로 엑스터시라든지, 한문으로 무아의 경지란 이런 것이 아닌가 하였소. 나는 사십 평생에 이러한 경험을 처음 한 것이오. -형! 형이 아시다시피 나는 내 아내 이외에 젊은 여성에게 이렇게 안겨 본 일이 없소. 물론 안아 본 일도 없소. -그러나 형! 나는 나를 눌렀소. 내 타오르는 애욕을 차디찬 이지의 입김으로 불어서 끄려고 애를 썼소. -"글쎄 웬일이냐. 앓는 것이 이 밤중에 비를 맞고 왜 나온단 말이냐. 철없는 것 같으니." -하고 나는 아버지의 위엄으로 정임의 두 어깨를 붙들어 암체어에 앉혔소. 그리고 나도 테이블을 하나 세워 두고 맞은편에 앉았소. -정임은 부끄러운 듯이 두 손으로 낯을 가리우고 제 무릎에 엎드려 울기를 시작하오. -정임은 누런 갈색의 외투를 입었소. 무엇을 타고 왔는지 모르지마는 구두에는 꽤 많이 물이 묻고 모자에는 빗방울 얼룩이 보이오. -"네가 이러다가 다시 병이 더치면 어찌한단 말이냐. 아이가 왜 그렇게 철이 없니?" -하고 나는 더욱 냉정한 어조로 책망하고 데스크 위에 놓인 내 편지 초를 집어 박박 찢어 버렸소. 종이 찢는 소리에 정임은 잠깐 고개를 들어서 처음에는 내 손을 보고 다음에는 내 얼굴을 보았소. 그러나 나는 모르는 체하고 도로 교의에 돌아와 앉아서 가만히 눈을 감았소. 그리고 도무지 흥분되지 아니한 모양을 꾸몄소. -형! 어떻게나 힘드는 일이오? 참으면 참을수록 내 이빨이 마주 부딪고, 얼굴의 근육은 씰룩거리고 손은 불끈불끈 쥐어지오. -"정말 내일 가세요?" -하고 아마 오 분 동안이나 침묵을 지키다가 정임이가 고개를 들고 물었소. -"그럼, 가야지." -하고 나는 빙그레 웃어 보였소. -"저도 데리고 가세요!" -하는 정임의 말은 마치 서릿발이 날리는 칼날과 같았소. 나는 깜짝 놀라서 정임을 바라보았소. 그의 눈은 빛나고 입은 꼭 다물고 얼굴의 근육은 팽팽하게 켕겼소. 정임의 얼굴에는 찬바람이 도는 무서운 기운이 있었소. -나는 즉각적으로 죽기를 결심한 여자의 모양이라고 생각하였소. 열정으로 불덩어리가 되었던 정임은 내가 보이는 냉랭한 태도로 말미암아 갑자기 얼어 버린 것 같았소. -"어디를?" -하고 나는 정임의 `저도 데리고 가세요.' 하는 담대한 말에 놀라면서 물었소. -"어디든지, 아버지 가시는 데면 어디든지 저를 데리고 가세요. 저는 아버지를 떠나서는 혼자서는 못 살 것을 지나간 반 달 동안에 잘 알았습니다. 아까 아버지 오셨다 가신 뒤에 생각해 보니깐 암만해도 아버지는 다시 저에게 와 보시지 아니하고 가실 것만 같애요. 그리고 저로 해서 아버지께서는 무슨 큰 타격을 당하신 것만 같으셔요. 처음 뵈올 적에 벌써 가슴이 뜨끔했습니다. 그리고 여행을 떠나신다는 말씀을 듣고는 반드시 무슨 큰일이 나셨느니라고만 생각했습니다. 그리고 저어, 저로 해서 그러신 것만 같고, 저를 버리시고 혼자 가시려는 것만 같고, 그래서 달려왔더니 여기 써 놓으신 편지를 보고 그 편지에 다른 말씀은 어찌 됐든지, 네 일기를 보았다 하신 말씀을 보고는 다 알았습니다. 저와 한 방에 있는 애가 암만해도 어머니 스파인가봐요. 제가 입원하기 전에도 제 눈치를 슬슬 보고 또 책상 서랍도 뒤지는 눈치가 보이길래 일기책은 늘 쇠 잠그는 서랍에 넣어 두었는데 아마 제가 정신 없이 앓고 누웠는 동안에 제 핸드백에서 쇳대를 훔쳐 갔던가봐요. 그래서는 그 일기책을 꺼내서 서울로 보냈나봐요. 그걸루 해서 아버지께서는 불명예스러운 누명을 쓰시고 학교일도 내놓으시게 되고 집도 떠나시게 되셨나봐요. 다시는 집에 안 돌아오실 양으로 결심을 하셨나봐요. 아까 병원에서도 하시는 말씀이 모두 유언하시는 것만 같아서 퍽 의심을 가졌었는데 지금 그 쓰시던 편지를 보고는 다 알았습니다. 그렇지만 그렇지만." -하고 웅변으로 내려 말하던 정임은 갑자기 복받치는 열정을 이기지 못하는 듯이, 한 번 한숨을 지우고, -"그렇지만 저는 아버지를 따라가요. 절루 해서 아버지께서는 집도 잃으시고 명예도 잃으시고 사업도 잃으시고 인생의 모든 것을 다 잃으셨으니 저는 아버지를 따라가요. 어디를 가시든지 저는 어린 딸로 아버지를 따라다니다가 아버지께서 먼저 돌아가시면 저도 따라 죽어서 아버지 발 밑에 묻힐 테야요. 제가 먼저 죽거든 제가 병이 있으니깐 물론 제가 먼저 죽지요. 죽어도 좋습니다. 병원에서 앓다가 혼자 죽는 건 싫어요. 아버지 곁에서 죽으면 아버지께서, 오 내 딸 정임아 하시고 귀해 주시고 불쌍히 여겨 주시겠지요. 그리고 제 몸을 어디든지 땅에 묻으시고 `사랑하는 내 딸 정임의 무덤'이라고 패라도 손수 쓰셔서 세워 주시지 않겠습니까." -하고 정임은 비쭉비쭉하다가 그만 무릎 위에 엎더져 울고 마오. -나는 다만 죽은 사람 모양으로 반쯤 눈을 감고 앉아 있었소. 가슴 속에는 정임의 곁에서 지지 않는 열정을 품으면서도 정임의 말대로 정임을 데리고 아무도 모르는 곳으로 가 버리고 싶으면서도 나는 이 열정의 불길을 내 입김으로 꺼 버리지 아니하면 아니 되는 것이었소. -"아아, 제가 왜 났어요? 왜 하나님께서 저를 세상에 보내셨어요? 아버지의 일생을 파멸시키려 난 것이지요? 제가 지금 죽어 버려서 아버지의 명예를 회복할 수 있다면 저는 죽어 버릴 터이야요. 기쁘게 죽어 버리겠습니다. 제가 여덟 살부터 오늘날까지 받은 은혜를 제 목숨 하나로 갚을 수가 있다면 저는 지금으로 죽어 버리겠습니다. 그렇지만 그렇지만……. -그렇지만 그렇지만 저는 다만 얼마라도 다만 하루라도 아버지 곁에서 살고 싶어요 다만 하루만이라도, 아버지! 제가 왜 이렇습니까, 네? 제가 어려서 이렇습니까. 미친 년이 되어서 이렇습니까. 아버지께서는 아실 테니 말씀해 주세요. 하루만이라도 아버지를 모시고 아버지 곁에서 살았으면 죽어도 한이 없겠습니다. 제 생각이 잘못이야요? 제 생각이 죄야요? 왜 죄입니까? 아버지, 저를 버리시고 혼자 가시지 마세요, 네? `정임아, 너를 데리고 가마.' 하고 약속해 주세요, 네." -정임은 아주 담대하게 제가 하고자 하는 말을 다 하오. 그 얌전한, 수삽한정임의 속에 어디 그러한 용기가 있었던가, 참 이상한 일이오. 나는 귀여운 어린 계집애 정임의 속에 엉큼한 여자가 들어앉은 것을 발견하였소. 그가 몇 가지 재료(내가 여행을 떠난다는 것과 제 일기를 보았다는 것)를 종합하여 나와 저와의 새에, 또 그 때문에 어떠한 일이 일어난 것을 추측하는 그 상상력도 놀랍거니와 그렇게 내 앞에서는 별로 입도 벌리지 아니하던 그가 이처럼 담대하게 제 속에 있는 말을 거리낌없이 다 해 버리는 용기를 아니 놀랄 수 없었소. 내가, 사내요 어른인 내가 도리어 정임에게 리드를 받고 놀림을 받음을 깨달았소. -그러나 정임을 위해서든지, 중년 남자의 위신을 위해서든지 나는 의지력으로, 도덕력으로, 정임을 누르고 훈계하지 아니하면 아니 되겠다고 생각하였소. -"정임아." -하고 나는 비로소 입을 열어서 불렀소. 내 어성은 장중하였소. 나는 할 수 있는 위엄을 다하여 `정임아.' 하고 부른 것이오. -"정임아, 네 속은 다 알았다. 네 마음 네 뜻은 그만하면 다 알았다. 네가 나를 그처럼 생각해 주는 것을 고맙게 생각한다. 기쁘게도 생각한다. 그러나 정임아." -하고 나는 일층 태도와 소리를 엄숙하게 하여, -"네가 청하는 말은 절대로 들을 수 없는 말이다. 내가 너를 친딸같이 사랑하기 때문에 나는 너를 데리고 가지 못하는 것이다. 나는 세상에서 죽고 조선에서 죽더라도 너는 죽어서 아니 된다. 차마 너까지는 죽이고 싶지 아니하단 말이다. 내가 어디 가서 없어져 버리면 세상은 네게 씌운 누명이 애매한 줄을 알게 될 것이 아니냐. 그리되면 너는 조선의 좋은 일꾼이 되어서 일도 많이 하고 또 사랑하는 남편을 맞아서 행복된 생활도 할 수 있을 것이 아니냐. 그것이 내가 네게 바라는 것이다. 내가 어디 가 있든지, 내가 살아 있는 동안 나는 네가 잘되는 것만, 행복되게 사는 것만 바라보고 혼자 기뻐할 것이 아니냐. -네가 다 옳게 알았다. 나는 네 말대로 조선을 영원히 떠나기로 하였다. 그렇지마는 나는 이렇게 된 것을 조금도 슬퍼하지 아니한다. 너를 위해서 내가 무슨 희생을 한다고 하면 내게는 그것이 큰 기쁨이다. 그뿐 아니라, 나는 인제는 세상이 싫어졌다. 더 살기가 싫어졌다. 내가 십여 년 동안 전생명을 바쳐서 교육한 학생들에게까지 배척을 받을 때에는 나는 지금까지 살아온 것을 생각만 하여도 진저리가 난다. 그렇지마는 나는 이것이 다 내가 부족한 때문인 줄을 잘 안다. 나는 조선을 원망한다든가, 내 동포를 원망한다든가, 그럴 생각은 없다. 원망을 한다면 나 자신의 부족을 원망할 뿐이다. 내가 원체 교육을 한다든지 남의 지도자가 된다든지 할 자격이 없음을 원망한다면 원망할까, 내가 어떻게 조선이나 조선 사람을 원망하느냐. 그러니까 인제 내게 남은 일은 나를 조선에서 없애 버리는 것이다. 감히 십여 년 간 교육가라고 자처해 오던 거짓되고 외람된 생활을 끊어 버리는 것이다. 남편 노릇도 못 하고 아버지 노릇도 못 하는 사람이 남의 스승은 어떻게 되고 지도자는 어떻게 되느냐. 하니까 나는 이제 세상을 떠나 버리는 것이 조금도 슬프지 아니하고 도리어 몸이 가뜬하고 유쾌해지는 것 같다. -오직 하나 마음에 걸리는 것은 내 선배요 사랑하는 동지이던 남 선생의 유일한 혈육이던 네게다가 누명을 씌우고 가는 것이다." -"그게 어디 아버지 잘못입니까?" -하고 정임은 입술을 깨물었소. -"모두 제가 철이 없어서 저 때문에……." -하고 정임은 몸을 떨고 울었소. -"아니! 그렇게 생각하지 마라. 내가 지금 세상을 버릴 때에 무슨 기쁨이 한 가지 남는 것이 있다고 하면 너 하나가, 이 세상에서 오직 너 하나가 나를 따라 주는 것이다. 아마 너도 나를 잘못 알고 따라 주는 것이겠지마는 세상이 다 나를 버리고, 처자까지도 다 나를 버릴 때에 오직 너 하나가 나를 소중히 알아 주니 어찌 고맙지 않겠느냐. 그러니까 정임아 너는 몸을 조심하여서 건강을 회복하여서 오래 잘 살고, 그리고 나를 생각해 다오." -하고 나도 울었소. -형! 내가 정임에게 이런 말을 한 것이 잘못이지요. 그러나 나는 그 때에 이런 말을 아니 할 수 없었소. 왜 그런고 하니, 그것이 내 진정이니까. 나도 학교 선생으로, 교장으로, 또 주제넘게 지사로의 일생을 보내노라고 마치 오직 얼음 같은 의지력만 가진 사람 모양으로 사십 평생을 살아 왔지마는 내 속에도 열정은 있었던 것이오. 다만 그 열정을 누르고 죽이고 있었을 뿐이오. 물론 나는 아마 일생에 이 열정의 고삐를 놓아 줄 날이 없겠지요. 만일 내가 이 열정의 고삐를 놓아서 자유로 달리게 한다고 하면 나는 이 경우에 정임을 안고, 내 열정으로 정임을 태워 버렸을는지도 모르오. 그러나 나는 정임이가 열정으로 탈수록 나는 내 열정의 고삐를 두 손으로 꽉 붙들고 이를 악물고 매달릴 결심을 한 것이오. -열한 시! -"정임아. 인제 병원으로 가거라." -하고 나는 엄연하게 명령하였소. -"내일 저를 보시고 떠나시지요?" -하고 정임은 눈물을 씻고 물었소. -"그럼, J조교수도 만나고 너도 보고 떠나지." -하고 나는 거짓말을 하였소. 이 경우에 내가 거짓말쟁이라는 큰 죄인이 되는 것이 정임에게 대하여 정임을 위하여 가장 옳은 일이라고 생각한 까닭이오. -정임은, 무서운 직각력과 상상력을 가진 정임은 내 말의 진실성을 의심하는 듯이 나를 뚫어지게 바라보았소. 나는 차마 정임의 시선을 마주 보지 못하여 외면하여 버렸소. -정임은 수건으로 눈물을 씻고 체경 앞에 가서 화장을 고치고 그리고, -"저는 가요." -하고 내 앞에 허리를 굽혀서 작별 인사를 하였소. -"오, 가 자거라." -하고 나는 극히 범연하게 대답하였소. 나는 자리옷을 입었기 때문에 현관까지 작별할 수도 없어서 보이를 불러 자동차를 하나 준비하라고 명하고 내 방에서 작별할 생각을 하였소. -"내일 병원에 오세요?" -하고 정임은 고개를 숙이고 낙루하였소. -"오, 가마." -하고 나는 또 거짓말을 하였소. 세상을 버리기로 결심한 사람의 거짓말은 하나님께서도 용서하시겠지요. 설사 내가 거짓말을 한 죄로 지옥에 간다 하더라도 이 경우에 정임을 위하여 거짓말을 아니 할 수가 없지 않소? 내가 거짓말을 아니 하면 정임은 아니 갈 것이 분명하였소. -"전 가요." -하고 정임은 또 한 번 절을 하였으나 소리를 내어서 울었소. -"울지 마라! 몸 상한다." -하고 나는 정임에게 대한 최후의 친절을 정임의 곁에 한 걸음 가까이 가서 어깨를 또닥또닥하여 주고, 외투를 입혀 주었소. -"안녕히 주무세요." -하고 정임은 문을 열고 나가 버렸소. -정임의 걸어가는 소리가 차차 멀어졌소. -나는 얼빠진 사람 모양으로 그 자리에 우두커니 서 있었소. -창에 부딪히는 빗발 소리가 들리고 자동차 소리가 먼 나라에서 오는 것같이 들리오. 이것이 정임이가 타고 가는 자동차 소리인가. 나는 정임을 따라가서 붙들어 오고 싶었소. 내 몸과 마음은 정임을 따라서 허공에 떠가는 것 같았소. -아아 이렇게 나는 정임을 곁에 두고 싶을까. 이렇게 내가 정임의 곁에 있고 싶을까. 그러하건마는 나는 정임을 떼어 버리고 가지 아니하면 아니 된다! 그것은 애끓는 일이다. 기막히는 일이다! 그러나 내 도덕적 책임은 엄정하게 그렇게 명령하지 않느냐. 나는 이 도덕적 책임의 명령 그것은 더위가 없는 명령이다 을 털끝만치라도 휘어서는 아니 된다. -그러나 정임이가 호텔 현관까지 자동차를 타기 전에 한 번만 더 바라보는 것도 못 할 일일까. 한 번만, 잠깐만 더 바라보는 것도 못 할 일일까. 잠깐만 일 분만 아니 일 초만 한 시그마라는 극히 짧은 동안만 바라보는 것도 못 할 일일까. 아니, 정임을 한 시그마 동안만 더 보고 싶다 나는 이렇게 생각하고 벌떡 일어나서 도어의 핸들에 손을 대었소. -`안 된다! 옳잖다!' -하고 나는 내 소파에 돌아와서 털썩 몸을 던졌소. -`최후의 순간이 아니냐. 최후의 순간에 용감히 이겨야 할 것이 아니냐. 아서라! 아서라!' -하고 나는 혼자 주먹을 불끈불끈 쥐었소. -이 때에 짜박짜박 하고 걸어오는 소리가 들리오. 내 가슴은 쌍방망이로 두들기는 것같이 뛰었소. -`설마 정임일까.' -하면서도 나는 숨을 죽이고 귀를 기울였소. -그 발자국 소리는 분명 내 문 밖에 와서 그쳤소. 그리고는 소리가 없었소. -`내 귀의 환각인가.' -하고 나는 한숨을 내쉬었소. -그러나 다음 순간 또 두어 번 문을 두드리는 소리가 들렸소. -"이에스." -하고 나는 대답하고 문을 바라보았소. -문이 열렸소. -들어오는 이는 정임이었소. -"웬일이냐." -하고 나는 엄숙한 태도를 지었소. 그것으로 일 초의 일천분지 일이라도 다시 한 번 보고 싶던 정임을 보고 기쁨을 카무플라주한 것이오. -정임은 서슴지 않고 내 뒤에 와서 내 교의에 몸을 기대며, -"암만해도 오늘이 마지막인 것만 같아서, 다시 뵈올 기약은 없는 것만 같아서 가다가 도로 왔습니다. 한 번만 더 뵙고 갈 양으로요. 그래 도로 와서도 들어올까 말까 하고 주저주저하다가 이것이 마지막인데 하고 용기를 내어서 들어왔습니다. 내일 저를 보시고 가신다는 것이 부러 하신 말씀만 같고, 마지막 뵈옵고, 뵈온대도 그래도 한 번 더 뵈옵기만 해도……." -하고 정임의 말은 끝을 아물지 못하였소. 그는 내 등 뒤에 서 있기 때문에 그가 어떠한 표정을 하고 있는지는 볼 수가 없었소. 나는 다만 아버지의 위엄으로 정면을 바라보고 있었을 뿐이오. -`정임아, 나도 네가 보고 싶었다. 네 뒤를 따라가고 싶었다. 내 몸과 마음은 네 뒤를 따라서 허공으로 날았다. 나는 너를 한 초라도 한 초의 천분지 일 동안이라도 한 번 더 보고 싶었다. 정임아, 내 진정은 너를 언제든지 내 곁에 두고 싶다. 정임아, 지금 내 생명이 가진 것은 오직 너뿐이다.' -이런 말이라도 하고 싶었소. 그러나 이런 말을 하여서는 아니 되오! 만일 내가 이런 말을 하여 준다면 정임이가 기뻐하겠지요. 그러나 나는 정임이에게 이런 기쁨을 주어서는 아니 되오! -나는 어디까지든지 아버지의 위엄, 아버지의 냉정함을 아니 지켜서는 아니 되오. -그렇지마는 내 가슴에 타오르는 이름지을 수 없는 열정의 불길은 내 이성과 의지력을 태워 버리려 하오. 나는 눈이 아뜩아뜩함을 깨닫소. 나는 내 생명의 불길이 깜박깜박함을 깨닫소. -그렇지마는! 아아 그렇지마는 나는 이 도덕적 책임의 무상 명령의 발령자인 쓴 잔을 마시지 아니하여서는 아니 되는 것이오. -`산! 바위!' -나는 정신을 가다듬어서 이것을 염하였소. -그러나 열정의 파도가 치는 곳에 산은 움직이지 아니하오? 바위는 흔들리지 아니하오? 태산과 반석이 그 흰 불길에 타서 재가 되지는 아니하오? 인생의 모든 힘 가운데 열정보다 더 폭력적인 것이 어디 있소? 아마도 우주의 모든 힘 가운데 사람의 열정과 같이 폭력적, 불가항력적인 것은 없으리라. 뇌성, 벽력, 글쎄 그것에나 비길까. 차라리 천체와 천체가 수학적으로 계산할 수 없는 비상한 속력을 가지고 마주 달려들어서 우리의 귀로 들을 수 없는 큰 소리와 우리가 굳다고 일컫는 금강석이라도 증기를 만들고야 말 만한 열을 발하는 충돌의 순간에나 비길까. 형. 사람이라는 존재가 우주의 모든 존재 중에 가장 비상한 존재인 것 모양으로 사람의 열정의 힘은 우주의 모든 신비한 힘 가운데 가장 신비한 힘이 아니겠소? 대체 우주의 모든 힘은 그것이 아무리 큰 힘이라고 하더라도 저 자신을 깨뜨리는 것은 없소. 그렇지마는 사람이라는 존재의 열정은 능히 제 생명을 깨뜨려 가루를 만들고 제 생명을 살라서 소지를 올리지 아니하오? 여보, 대체 이에서 더 폭력이요, 신비적인 것이 어디 있단 말이오. -이 때 내 상태, 어깨 뒤에서 열정으로 타고 섰는 정임을 느끼는 내 상태는 바야흐로 대폭발, 대충돌을 기다리는 아슬아슬한 때가 아니었소. 만일 조금만이라도 내가 내 열정의 고삐에 늦춤을 준다고 하면 무서운 대폭발이 일어났을 것이오. -"정임아!" -하고 나는 충분히 마음을 진정해 가지고 고개를 옆으로 돌려 정임의 얼굴을 찾았소. -"네에." -하고 정임은 입을 약간 내 귀 가까이로 가져와서 그 씨근거리는 소리가 분명히 내 귀에 들리고 그 후끈후끈하는 뜨거운 입김이 내 목과 뺨에 감각되었소. -억지로 진정하였던 내 가슴은 다시 설레기를 시작하였소. 그 불규칙한 숨소리와 뜨거운 입김 때문이었을까. -"시간 늦는다. 어서 가거라. 이 아버지는 언제까지든지 너를 사랑하는 딸 로 소중히 소중히 가슴에 품고 있으마. 또 후일에 다시 만날 때도 있을지 아느냐. 설사 다시 만날 때가 없다기로니 그것이 무엇이 그리 대수냐. 나이 많은 사람은 먼저 죽고 젊은 사람은 오래 살아서 인생의 일을 많이 하는 것이 순서가 아니냐. 너는 몸이 아직 약하니 마음을 잘 안정해서 어서 건강을 회복하여라. 그리고 굳세게 굳세게, 힘있게 힘있게 살아 다오. 조선은 사람을 구한다. 나 같은 사람은 인제 조선서 더 일할 자격을 잃어버린 사람이지마는 네야 어떠냐. 설사 누가 무슨 말을 해서 학교에서 학비를 아니 준다거든 내가 네게 준 재산을 가지고 네 마음대로 공부를 하려무나. 네가 그렇게 해 주어야 나를 위하는 것이다. 자 인제 가거라. 네 앞길이 양양하지 아니하냐. 자 인제 가거라. 나는 내일 아침 동경을 떠날란다. 자 어서." -하고 나는 화평하게 웃는 낯으로 일어섰소. -정임은 울먹울먹하고 고개를 숙이오. -밖에서는 바람이 점점 강해져서 소리를 하고 유리창을 흔드오. -"그럼, 전 가요." -하고 정임은 고개를 들었소. -"그래. 어서 가거라. 벌써 열한시 반이다. 병원 문은 아니 닫니!" -정임은 대답이 없소. -"어서!" -하고 나는 보이를 불러 자동차를 하나 준비하라고 일렀소. -"갈랍니다." -하고 정임은 고개를 숙여서 내게 인사를 하고 문을 향하여 한 걸음 걷다가 잠깐 주저하더니, 다시 돌아서서, -"저를 한 번만 안아 주셔요. 아버지가 어린 딸을 안듯이 한 번만 안아 주셔요." -하고 내 앞으로 가까이 와 서오. -나는 팔을 벌려 주었소. 정임은 내 가슴을 향하고 몸을 던졌소. 그리고 제 이뺨 저뺨을 내 가슴에 대고 비볐소. 나는 두 팔을 정임의 어깨 위에 가벼이 놓았소. -이러한 지 몇 분이 지났소. 아마 일 분도 다 못 되었는지 모르오. -정임은 내 가슴에서 고개를 들어 나를 뚫어지게 우러러보더니, 다시 내 가슴에 낯을 대더니 아마 내 심장이 무섭게 뛰는 소리를 정임은 들었을 것이오 정임은 다시 고개를 들고, -"어디를 가시든지 편지나 주셔요." -하고 굵은 눈물을 떨구고는 내게서 물러서서 또 한 번 절하고, -"안녕히 가셔요. 만주든지 아령이든지 조선 사람 많이 사는 곳에 가셔서 일하고 사셔요. 돌아가실 생각은 마셔요. 제가, 아버지 말씀대로 혼자 떨어져 있으니 아버지도 제 말씀대로 돌아가실 생각은 마셔요, 네, 그렇다고 대답하셔요!" -하고는 또 한 번 내 가슴에 몸을 기대오. -죽기를 결심한 나는 `오냐, 그러마.' 하는 대답을 할 수는 없었소. 그래서, -"오, 내 살도록 힘쓰마." -하는 약속을 주어서 정임을 돌려보냈소. -정임의 발자국 소리가 안 들리게 된 때에 나는 빠른 걸음으로 옥상 정원으로 나갔소. 비가 막 뿌리오. -나는 정임이가 타고 나가는 자동차라도 볼 양으로 호텔 현관 앞이 보이는 꼭대기로 올라갔소. 현관을 떠난 자동차 하나가 전찻길로 나서서는 북을 향하고 달아나서 순식간에 그 꽁무니에 달린 붉은 불조차 스러져 버리고 말았소. -나는 미친 사람 모양으로, -"정임아, 정임아!" -하고 수없이 불렀소. 나는 사 층이나 되는 이 꼭대기에서 뛰어내려서 정임이가 타고 간 자동차의 뒤를 따르고 싶었소. -"아아 영원한 인생의 이별!" -나는 그 옥상에 얼마나 오래 섰던지를 모르오. 내 머리와 낯과 배스로브에서는 물이 흐르오. 방에 들어오니 정임이가 끼치고 간 향기와 추억만 남았소. -나는 방 안 구석구석에 정임의 모양이 보이는 것을 깨달았소. 특별히 정임이가 고개를 숙이고 서 있던 내 교의 뒤에는 분명히 갈색 외투를 입은 정임의 모양이 완연하오. -"정임아!" -하고 나는 그 곳으로 따라가오. 그러나 가면 거기는 정임은 없소. -나는 교의에 앉소. 그러면 정임의 씨근씨근하는 숨소리와 더운 입김이 분명 내 오른편에 감각이 되오. 아아 무서운 환각이여! -나는 자리에 눕소. 그리고 정임의 환각을 피하려고 불을 끄오. 그러면 정임이가 내게 안기던 자리쯤에 환하게 정임의 모양이 나타나오. -나는 불을 켜오. 또 불을 끄오. -날이 밝자 나는 비가 갠 것을 다행으로 비행장에 달려가서 비행기를 얻어 탔소. -나는 다시 조선의 하늘을 통과하기가 싫어서 북강에서 비행기에서 내려서 문사에 와서 대련으로 가는 배를 탔소. -나는 대련에서 내려서 하룻밤을 여관에서 자고는 곧 장춘 가는 급행을 탔소. 물론 아무에게도 엽서 한 장 한 일 없었소. 그것은 인연을 끊은 세상에 대하여 연연한 마음을 가지는 것을 부끄럽게 생각한 까닭이오. -차가 옛날에는 우리 조상네가 살고 문화를 짓던 옛 터전인 만주의 벌판을 달릴 때에는 감회도 없지 아니하였소. 그러나 나는 지금 그런 한가한 감상을 쓸 겨를이 없소. -내가 믿고 가는 곳은 하얼빈에 있는 어떤 친구요. 그는 R라는 사람으로서 경술년에 A씨 등의 망명객을 따라 나갔다가 아라사에서 무관 학교를 졸업하고 아라사 사관으로서 구주 대전에도 출정을 하였다가, 혁명 후에도 이내 적위군에 머물러서 지금까지 소비에트 장교로 있는 사람이오. 지금은 육군 소장이라던가. -나는 하얼빈에 그 사람을 찾아가는 것이오. 그 사람을 찾아야 아라사에 들어갈 여행권을 얻을 것이요, 여행권을 얻어야 내가 평소에 이상하게도 그리워하던 바이칼 호를 볼 것이오. -하얼빈에 내린 것은 해가 뉘엿뉘엿 넘어가는 석양이었소. -나는 안중근이 이등박문(伊藤博文:이토 히로부미)을 쏜 곳이 어딘가 하고 벌판과 같이 넓은 플랫폼에 내렸소. 과연 국제 도시라 서양 사람, 중국 사람, 일본 사람이 각기 제 말로 지껄이오. 아아 조선 사람도 있을 것이오마는 다들 양복을 입거나 청복을 입거나 하고 또 사람이 많은 곳에서는 말도 잘 하지 아니하여 아무쪼록 조선 사람인 것을 표시하지 아니하는 판이라 그 골격과 표정을 살피기 전에는 어느 것이 조선 사람인지 알 길이 없소. 아마 허름하게 차리고 기운 없이, 비창한 빛을 띠고 사람의 눈을 슬슬 피하는 저 순하게 생긴 사람들이 조선 사람이겠지요. 언제나 한 번 가는 곳마다 동양이든지, 서양이든지, -`나는 조선 사람이오!' -하고 뽐내고 다닐 날이 있을까 하면 눈물이 나오. 더구나, 하얼빈과 같은 각색 인종이 모여서 생존 경쟁을 하는 마당에 서서 이런 비감이 간절하오. 아아 이 불쌍한 유랑의 무리 중에 나도 하나를 더 보태는가 하면 눈물을 씻지 아니할 수 없었소. -나는 역에서 나와서 어떤 아라사 병정 하나를 붙들고 R의 아라사 이름을 불렀소. 그리고 아느냐고 영어로 물었소. -그 병정은 내 말을 잘못 알아들었는지, 또는 R를 모르는지 무엇이라고 아라사말로 지껄이는 모양이나 나는 물론 그것을 알아들을 수가 없었소. 그러나 나는 그 병정의 표정에서 내게 호의를 가진 것을 짐작하고 한 번 더 분명히, -"요십 알렉산드로비치 리가이." -라고 불러 보았소. -그 병정은 빙그레 웃고 고개를 흔드오. 이 두 외국 사람의 이상한 교섭에 흥미를 가지고 여러 아라사 병정과 동양 사람들이 십여 인이나 우리 주위에 모여드오. -그 병정이 나를 바라보고 또 한 번 그 이름을 불러 보라는 모양 같기로 나는 이번에는 R의 아라사 이름에 `제너럴'이라는 말을 붙여 불러 보았소. -그랬더니 어떤 다른 병정이 뛰어들며, -"게네라우 리가이!" -하고 안다는 표정을 하오. `게네라우'라는 것이 아마 아라사말로 장군이란 말인가 하였소. -"예스. 예스." -하고 나는 기쁘게 대답하였소. 그리고는 아라사 병정들끼리 무에라고 지껄이더니, 그 중에 한 병정이 나서면서 고개를 끄덕끄덕하고, 제가 마차 하나를 불러서 나를 태우고 저도 타고 어디로 달려가오. -그 아라사 병정은 친절히 알지도 못하는 말로 이것저것을 가리키면서 설명을 하더니 내가 못 알아듣는 줄을 생각하고 내 어깨를 툭 치고 웃소. 어린애와 같이 순한 사람들이구나 하고 나는 고맙다는 표로 고개만 끄덕끄덕하였소. -어디로 어떻게 가는지 서양 시가로 달려가다가 어떤 큰 저택 앞에 이르러서 마차를 그 현관 앞으로 들이몰았소. -현관에서는 종졸이 나왔소. 내가 명함을 들여보냈더니 부관인 듯한 아라사 장교가 나와서 나를 으리으리한 응접실로 인도하였소. 얼마 있노라니 중년이 넘은 어떤 대장이 나오는데 군복에 칼끈만 늘였소. -"이게 누구요." -하고 그 대장은 달려들어서 나를 껴안았소. 이십오 년 만에 만나는 우리는 서로 알아본 것이오. -이윽고 나는 그의 부인과 자녀들도 만났소. 그들은 다 아라사 사람이오. -저녁이 끝난 뒤에 나는 R의 부인과 딸의 음악과 그림 구경과 기타의 관대를 받고 단둘이 이야기할 기회를 얻었소. 경술년 당시 이야기도 나오고, A씨의 이야기도 나오고, R의 신세 타령도 나오고, 내 이십오 년 간의 생활 이야기도 나오고, 소비에트 혁명 이야기도 나오고, 하얼빈 이야기도 나오고, 우리네가 어려서 서로 사귀던 회구담도 나오고 이야기가 그칠 바를 몰랐소. "조선은 그립지 않은가." -하는 내 말에 쾌활하던 R는 고개를 숙이고 추연한 빛을 보였소. -나는 R의 추연한 태도를 아마 고국을 그리워하는 것으로만 여겼소. 그래서 나는 그리 침음하는 것을 보고, -"얼마나 고국이 그립겠나. 나는 고국을 떠난 지가 일 주일도 안 되건마는 못 견디게 그리운데." -하고 동정하는 말을 하였소. -했더니, 이 말 보시오. 그는 침음을 깨뜨리고 고개를 번쩍 들며, -"아니! 나는 고국이 조금도 그립지 아니하이. 내가 지금 생각한 것은 자네 말을 듣고 고국이 그리운가 그리워할 것이 있는가를 생각해 본 것일세. 그랬더니 아무리 생각하여도 나는 고국이 그립다는 생각을 가질 수가 없어. 그야 어려서 자라날 때에 보던 강산이라든지 내 기억에 남은 아는 사람들이라든지, 보고 싶다 하는 생각도 없지 아니하지마는 그것이 고국이 그리운 것이라고 할 수가 있을까. 그 밖에는 나는 아무리 생각하여도 고국이 그리운 것을 찾을 길이 없네. 나도 지금 자네를 보고 또 자네 말을 듣고 오래 잊어버렸던 고국을 좀 그립게, 그립다 하게 생각하려고 해 보았지마는 도무지 나는 고국이 그립다는 생각이 나지 않네." -이 말에 나는 깜짝 놀랐소. 몸서리치게 무서웠소. 나는 해외에 오래 표랑하는 사람은 으레 고국을 그리워할 것으로 믿고 있었소. 그런데 이 사람이, 일찍은 고국을 사랑하여 목숨까지도 바치려던 이 사람이 도무지 이처럼 고국을 잊어버린다는 것은 놀라운 정도를 지나서 괘씸하기 그지없었소. 나도 비록 조선을 떠난다고, 영원히 버린다고 나서기는 했지마는 나로는 죽기 전에는 아니 비록 죽더라도 잊어버리지 못할 고국을 잊어버린 R의 심사가 난측하고 원망스러웠소. -"고국이 그립지가 않아?" -하고 R에게 묻는 내 어성에는 격분한 빛이 있었소. -"이상하게 생각하시겠지. 하지만 고국에 무슨 그리울 것이 있단 말인가. 그 빈대 끓는 오막살이가 그립단 말인가. 나무 한 개 없는 산이 그립단 말인가. 물보다도 모래가 많은 다 늙어빠진 개천이 그립단 말인가. 그 무기력하고 가난한, 시기 많고 싸우고 하는 그 백성을 그리워한단 말인가. 그렇지 아니하면 무슨 그리워할 음악이 있단 말인가, 미술이 있단 말인가, 문학이 있단 말인가, 사상이 있단 말인가, 사모할 만한 인물이 있단 말인가! 날더러 고국의 무엇을 그리워하란 말인가. 나는 조국이 없는 사람일세. 내가 소비에트 군인으로 있으니 소비에트가 내 조국이겠지. 그러나 진심으로 내 조국이라는 생각은 나지 아니하네." -하고 저녁 먹을 때에 약간 붉었던 R의 얼굴은 이상한 흥분으로 더욱 붉어지오.유 정유 정 -R는 먹던 담배를 화나는 듯이 재떨이에 집어던지며, -"내가 하얼빈에 온 지가 인제 겨우 삼사 년밖에 안 되지마는 조선 사람 때문에 나는 견딜 수가 없어. 와서 달라는 것도 달라는 것이지마는 조선 사람이 또 어찌하였느니 또 어찌하였느니 하는 불명예한 말을 들을 때에는 나는 금시에 죽어 버리고 싶단 말일세. 내게 가장 불쾌한 것이 있다고 하면 그것은 고국이라는 기억과 조선 사람의 존잴세. 내가 만일 어느 나라의 독재자가 된다고 하면 나는 첫째로 조선인 입국 금지를 단행하려네. 만일 조선이라는 것을 잊어버릴 약이 있다고 하면 나는 생명과 바꾸어서라도 사 먹고 싶어." -하고 R는 약간 흥분된 어조를 늦추어서, -"나도 모스크바에 있다가 처음 원동에 나왔을 적에는 길을 다녀도 혹시 동포가 눈에 뜨이지나 아니하나 하고 찾았네. 그래서 어디서든지 동포를 만나면 반가이 손을 잡았지. 했지만 점점 그들은 오직 귀찮은 존재에 지나지 못하다는 것을 알았단 말일세. 인제는 조선 사람이라고만 하면 만나기가 무섭고 끔찍끔찍하고 진저리가 나는 걸 어떡허나. 자네 명함이 들어온 때에도 조선 사람인가 하고 가슴이 뜨끔했네." -하고 R는 웃지도 아니하오. 그의 얼굴에는, 군인다운 기운찬 얼굴에는 증오와 분노의 빛이 넘쳤소. -"나도 자네 집에 환영받는 나그네는 아닐세그려." -하고 나는 이 견디기 어려운 불쾌하고 무서운 공기를 완화하기 위하여 농담삼아 한 마디를 던지고 웃었소. -나는 R의 말이 과격함에 놀랐지마는, 또 생각하면 R가 한 말 가운데는 들을 만한 이유도 없지 아니하오. 그것을 생각할 때에 나는 R를 괘씸하게 생각하기 전에 내가 버린다는 조선을 위하여서 가슴이 아팠소. 그렇지만 이제 나 따위가 가슴을 아파한대야 무슨 소용이 있소. 조선에 남아 계신 형이나 R의 말을 참고삼아 쓰시기 바라오. 어쨌으나 나는 R에게서 목적한 여행권을 얻었소. R에게는 다만, -`나는 피곤한 몸을 좀 정양하고 싶다. 나는 내가 평소에 즐겨하는 바이칼 호반에서 눈과 얼음의 한겨울을 지내고 싶다.' -는 것을 여행의 이유로 삼았소. -R는 나의 초췌한 모양을 짐작하고 내 핑계를 그럴듯하게 아는 모양이었소. 그리고 나더러, `이왕 정양하려거든 카프카 지방으로 가거라. 거기는 기후 풍경도 좋고 또 요양원의 설비도 있다.'는 것을 말하였소. 나도 톨스토이의 소설에서, 기타의 여행기 등속에서 이 지방에 관한 말을 못 들은 것이 아니나 지금 내 처지에는 그런 따뜻하고 경치 좋은 지방을 가릴 여유도 없고 또 그러한 지방보다도 눈과 얼음과 바람의 시베리아의 겨울이 합당한 듯하였소. -그러나 나는 R의 호의를 굳이 사양할 필요도 없어서 그가 써 주는 대로 소개장을 다 받아 넣었소. 그는 나를 처남 매부 간이라고 소개해 주었소. -나는 모스크바 가는 다음 급행을 기다리는 사흘 동안 R의 집의 손이 되어서 R부처의 친절한 대우를 받았소. -그 후에는 나는 R와 조선에 관한 토론을 한 일은 없지마는 R가 이름지어 말을 할 때에는 조선을 잊었노라, 그리워할 것이 없노라, 하지마는 무의식적으로 말을 할 때에는 조선을 못 잊고 또 조선을 여러 점으로 그리워하는 양을 보았소. 나는 그것으로써 만족하게 여겼소. -나는 금요일 오후 세시 모스크바 가는 급행으로 하얼빈을 떠났소. 역두에는 R와 R의 가족이 나와서 꽃과 과일과 여러 가지 선물로 나를 전송하였소. R와 R의 가족은 나를 정말 형제의 예로 대우하여 차가 떠나려 할 때에 포옹과 키스로 작별하여 주었소. -이 날은 퍽 따뜻하고 일기가 좋은 날이었소. 하늘에 구름 한 점, 땅에 바람 한 점 없이 마치 늦은 봄날과 같이 따뜻한 날이었소. -차는 떠났소. 판다는 둥 안 판다는 둥 말썽 많은 동중로(지금은 북만 철로라고 하오.)의 국제 열차에 몸을 의탁한 것이오. -송화강(松花江:쑹화 강)의 철교를 건너오. 아아 그리도 낯익은 송화강! 송화강이 왜 낯이 익소. 이 송화강은 불함산(장백산)에 근원을 발하여 광막한 북만주의 사람도 없는 벌판을 혼자 소리도 없이 흘러가는 것이 내 신세와 같소. 이 북만주의 벌판을 만든 자가 송화강이지마는 나는 그만한 힘이 없는 것이 부끄러울 뿐이오. 이 광막한 북만의 벌판을 내 손으로 개척하여서 조선 사람의 낙원을 만들자 하고 뽐내어 볼까. 그것은 형이 하시오. 내 어린것이 자라거든 그놈에게나 그러한 생각을 넣어 주시오. -동양의 국제적 괴물인 하얼빈 시가도 까맣게 안개에서 스러져 버리고 말았소. 그러나 그 시가를 싼 까만 기운이 국제적 풍운을 포장한 것이라고 할까요. -가도가도 벌판. 서리맞은 마른 풀바다. 실개천 하나도 없는 메마른 사막. 어디를 보아도 산 하나 없으니 하늘과 땅이 착 달라붙은 듯한 천지. 구름 한 점 없건만도 그 큰 태양 가지고도 미처 다 비추지 못하여 지평선 호를 그린 지평선 위에는 항상 황혼이 떠도는 듯한 세계. 이 속으로 내가 몸을 담은 열차는 서쪽으로 서쪽으로 해가 가는 걸음을 따라서 달리고 있소. 열차가 달리는 바퀴 소리도 반향할 곳이 없어 힘없는 한숨같이 스러지고 마오. -기쁨 가진 사람이 지루해서 못 견딜 이 풍경은 나같이 수심 가진 사람에게는 가장 공상의 말을 달리기에 합당한 곳이오. -이 곳에도 산도 있고 냇물도 있고 삼림도 있고 꽃도 피고 날짐승, 길짐승이 날고 기던 때도 있었겠지요. 그러던 것이 몇만 년 지나는 동안에 산은 낮아지고 골은 높아져서 마침내 이 꼴이 된 것인가 하오. 만일 큰 힘이 있어 이 광야를 파낸다 하면 물 흐르고 고기 놀던 강과, 울고 웃던 생물이 살던 자취가 있을 것이오. 아아 이 모든 기억을 꽉 품고 죽은 듯이 잠잠한 광야에! -내가 탄 차가 F역에 도착하였을 때에는 북만주 광야의 석양의 아름다움은 그 극도에 달한 것 같았소. 둥긋한 지평선 위에 거의 걸린 커다란 해! 아마 그 신비하고 장엄함이 내 경험으로는 이 곳에서밖에는 볼 수 없는 것이라고생각하오. 이글이글 이글이글 그러면서도 둥글다는 체모를 변치 아니하는 그 지는 해! -게다가 먼 지평선으로부터 기어드는 황혼은 인제는 대지를 거의 다 덮어 버려서 마른 풀로 된 지면은 가뭇가뭇한 빛을 띠고 사막의 가는 모래를 머금은 지는 해의 광선을 반사하여서 대기는 짙은 자줏빛을 바탕으로 한 가지각색의 명암을 가진, 오색이 영롱한, 도무지 내가 일찍 경험해 보지 못한 색채의 세계를 이루었소. 아 좋다! -그 속에 수은같이 빛나는, 수없는 작고 큰 호수들의 빛! 그 속으로 날아오는 수없고 이름 모를 새들의 떼도 이 세상의 것이라고는 생각하지 아니하오. -나는 거의 무의식적으로 차에서 뛰어내렸소. 거의 떠날 시간이 다 되어서 짐의 일부분은 미처 가지지도 못하고 뛰어내렸소. 반쯤 미친 것이오. -정거장 앞 조그마한 아라사 사람의 여관에다가 짐을 맡겨 버리고 나는 단장을 끌고 철도 선로를 뛰어 건너서 호수의 수은빛 나는 곳을 찾아서 지향 없이 걸었소. -한 호수를 가서 보면 또 저 편 호수가 더 아름다워 보이오. 원컨대 저 지는 해가 다 지기 전에 이 광야에 있는 호수를 다 돌아보고 싶소. -내가 호숫 가에 섰을 때에 그 거울같이 잔잔한 호수면에 비치는 내 그림자의 외로움이여, 그러나 아름다움이여! 그 호수는 영원한 우주의 신비를 품고 하늘이 오면 하늘을, 새가 오면 새를, 구름이 오면 구름을, 그리고 내가 오면 나를 비추지 아니하오. 나는 호수가 되고 싶소. 그러나 형! 나는 이 호수면에서 얼마나 정임의 얼굴을 찾았겠소. 그것은 물리학적으로 불가능한 일이겠지요. 동경의 병실에 누워 있는 정임의 모양이 몽고 사막의 호수면에 비칠 리야 있겠소. 없겠지마는 나는 호수마다 정임의 그림자를 찾았소. 그러나 보이는 것은 외로운 내 그림자뿐이오. -`가자. 끝없는 사막으로 한없이 가자. 가다가 내 기운이 진하는 자리에 나는 내 손으로 모래를 파고 그 속에 내 몸을 묻고 죽어 버리자. 살아서 다시 볼 수 없는 정임의 「이데아」를 안고 이 깨끗한 광야에서 죽어 버리 자.' -하고 나는 지는 해를 향하고 한정 없이 걸었소. 사막이 받았던 따뜻한 기운은 아직도 다 식지는 아니하였소. 사막에는 바람 한 점도 없소. 소리 하나도 없소. 발자국 밑에서 우는 마른 풀과 모래의 바스락거리는 소리가 들릴 뿐이오. -나는 허리를 지평선에 걸었소. 그 신비한 광선은 내 가슴으로부터 위에만을 비추고 있소. -문득 나는 해를 따라가는 별 두 개를 보았소. 하나는 앞을 서고 하나는 뒤를 섰소. 앞의 별은 좀 크고 뒤의 별은 좀 작소. 이런 별들은 산 많은 나라 다시 말하면 서쪽 지평선을 보기 어려운 나라에서만 생장한 나로서는 보지 못하던 별이오. 나는 그 별의 이름을 모르오. `두 별'이오. -해가 지평선에서 뚝 떨어지자 대기의 자줏빛은 남빛으로 변하였소. 오직 해가 금시 들어간 자리에만 주홍빛의 여광이 있을 뿐이오. 내 눈앞에서는 남빛 안개가 피어오르는 듯하였소. 앞에 보이는 호수만이 유난히 빛나오. 또 한 떼의 이름 모를 새들이 수면을 스치며 날 저문 것을 놀라는 듯이 어지러이 날아 지나가오. 그들은 소리도 아니 하오. 날개치는 소리도 아니 들리오. 그것들은 사막의 황혼의 허깨비인 것 같소. -나는 자꾸 걷소. 해를 따르던 나는 두 별을 따라서 자꾸 걷소. -별들은 진 해를 따라서 바삐 걷는 것도 같고, 헤매는 나를 어떤 나라로 끄는 것도 같소. -아니 두 별 중에 앞선 별이 한 번 반짝하고는 최후로 한 번 반짝하고는 지평선 밑에 숨어 버리고 마오. 뒤에 남은 외별의 외로움이여! 나는 울고 싶었소. 그러나 나는 하나만 남은 작은 별 외로운 작은 별을 따라서 더 빨리 걸음을 걸었소. 그 한 별마저 넘어가 버리면 나는 어찌하오. -내가 웬일이오. 나는 시인도 아니요, 예술가도 아니오. 나는 정으로 행동한 일은 없다고 믿는 사람이오. 그러나 형! 이 때에 미친 것이 아니요, 내 가슴에는 무엇인지 모를 것을 따를 요샛말로 이른바 동경으로 찼소. -`아아 저 작은 별!' -그것도 지평선에 닿았소. -`아아 저 작은 별. 저것마저 넘어가면 나는 어찌하나.' -인제는 어둡소. 광야의 황혼은 명색뿐이요, 순식간이요, 해지자 신비하다고 할 만한 극히 짧은 동안에 아름다운 황혼을 조금 보이고는 곧 칠과 같은 암흑이오. 호수의 물만이 어디서 은빛을 받았는지 뿌옇게 나만이 유일한 존재다, 나만이 유일한 빛이다 하는 듯이 인제는 수은빛이 아니라 남빛을 발하고 있을 뿐이오. -나는 그 중 빛을 많이 받은, 그 중 환해 보이는 호수면을 찾아 두리번거리며, 그러나 빠른 걸음으로 헤매었소. 그러나 내가 좀더 맑은 호수면을 찾는 동안에 이 광야의 어둠은 더욱더욱 짙어지오. -나는 어떤 조그마한 호숫 가에 펄썩 앉았소. 내 앞에는 짙은 남빛의 수면에 조그마한 거울만한 밝은 데가 있소. 마치 내 눈에서 무슨 빛이 나와서, 아마 정임을 그리워하는 빛이 나와서 그 수면에 반사하는 듯이. 나는 허겁지겁 그 빤한 수면을 들여다보았소. 혹시나 정임의 모양이 거기 나타나지나 아니할까 하고. 세상에는 그러한 기적도 있지 아니한가 하고. -물에는 정임의 얼굴이 어른거리는 것 같았소. 이따금 정임의 눈도 어른거리고 코도 번뜻거리고 입도 번뜻거리는 것 같소. 그러나 수면은 점점 어두워 가서 그 환영조차 더욱 희미해지오. -나는 호수면에 빤하던 한 조각조차 캄캄해지는 것을 보고 숨이 막힐 듯함을 깨달으면서 고개를 들었소. -고개를 들려고 할 때에, 형이여, 이상한 일도 다 있소. 그 수면에 정임의 모양이, 얼굴만 아니라, 그 몸 온통이 그 어깨, 가슴, 팔, 다리까지도, 그 눈과 입까지도, 그 얼굴의 흰 것과 입술이 불그레한 것까지도, 마치 환한 대낮에 실물을 대한 모양으로 소상하게 나타났소. -"정임이!" -하고 나는 소리를 지르며 물로 뛰어들려 하였소. 그러나 형, 그 순간에 정임의 모양은 사라져 버리고 말았소. -나는 이 어둠 속에 어디 정임이가 나를 따라온 것같이 생각했소. 혹시나 정임이가 죽어서 그 몸은 동경의 대학 병원에 벗어 내어던지고 혼이 빠져 나와서 물에 비치었던 것이 아닐까, 나는 가슴이 울렁거림을 진정치 못하면서 호숫 가에서 벌떡 일어나서 어둠 속에 정임을 만져보려는 듯이, 어두워서 눈에 보지는 못하더라도 자꾸 헤매노라면 몸에 부딪히기라도 할 것 같아서 함부로 헤매었소. 그리고는 눈앞에 번뜻거리는 정임의 환영을 팔을 벌려서 안고 소리를 내어서 불렀소. -"정임이, 정임이." -하고 나는 수없이 정임을 부르면서 헤매었소. -그러나 형, 이것도 죄지요. 이것도 하나님께서 금하시는 일이지요. 그러길래 광야에 아주 어둠이 덮이고 새까만 하늘에 별이 총총하게 나고는 영 정임의 헛그림자조차 아니 보이지요. 나는 죄를 피해서 정임을 떠나서 멀리 온 것이니 정임의 헛그림자를 따라다니는 것도 옳지 않지요. -그렇지만 내가 이렇게 혼자서 정임을 생각만 하는 것이야 무슨 죄 될 것이 있을까요. 내가 정임을 만 리나 떠나서 이렇게 헛그림자나 그리며 그리워하는 것이야 무슨 죄가 될까요. 설사 죄가 되기로서니 낸들 이것까지야 어찌하오. 내가 내 혼을 죽여 버리기 전에야 내 힘으로 어찌하오. 설사 죄가 되어서 내가 지옥의 꺼지지 않는 유황불 속에서 영원한 형벌을 받게 되기로서니 그것을 어찌하오. 형, 이것, 이것도 말아야 옳은가요. 정임의 헛그림자까지도 끊어 버려야 옳은가요. -이 때요. 바로 이 때요. 내 앞 수십 보나 될까(캄캄한 밤이라 먼지 가까운지 분명히 알 수 없지마는) 하는 곳에 난데없는 등불 하나가 나서오. 나는 깜짝 놀라서 우뚝 섰소. 이 무인지경, 이 밤중에 갑자기 보이는 등불 그것은 마치 이 세상 같지 아니하였소. -저 등불이 어떤 등불일까, 그 등불이 몇 걸음 가까이 오니, 그 등불 뒤에 사람의 다리가 보이오. -"누구요?" -하는 것은 귀에 익은 조선말이오. 어떻게 이 몽고의 광야에서 조선말을 들을까 하고 나는 등불을 처음 볼 때보다 더욱 놀랐소. -"나는 지나가던 사람이오." -하고 나도 등불을 향하여 마주 걸어갔소. -그 사람은 등불을 들어서 내 얼굴을 비추어 보더니, -"당신 조선 사람이오?" -하고 묻소. -"네, 나는 조선 사람이오. 당신도 음성을 들으니 조선 사람인데, 어떻게 이런 광야에, 아닌 밤중에, 여기 계시단 말이오." -하고 나는 놀라는 표정 그대로 대답하였소. -"나는 이 근방에 사는 사람이니까 여기 오는 것도 있을 일이지마는 당신이야말로 이 아닌 밤중에." -하고 육혈포를 집어넣고, 손을 내밀어서 내게 악수를 구하오. -나는 반갑게 그의 손을 잡았소. 그러나 나는 `죽을 지경에 어떻게 오셨단 말이오.' 하고, 그가 내가 무슨 악의를 가진 흉한이 아닌 줄을 알고 손에 빼어들었던 육혈포로 시기를 잠깐이라도 노린 것을 불쾌하게 생각하였던 것이오. -그도 내 이름도 묻지 아니하고 또 나도 그의 이름을 묻지 아니하고 나는 그에게 끌려서 그가 인도하는 곳으로 갔소. 그 곳이란 것은 아까 등불이 처음 나타나던 곳인 듯한데, 거기서 또 한 번 놀란 것은 어떤 부인이 있는 것이오. 남자는 아라사식 양복을 입었으나 부인은 중국 옷 비슷한 옷을 입었소. 남자는 나를 끌어서 그 부인에게 인사하게 하고, -"이는 내 아내요." -하고 또 그 아내라는 부인에게는, -"이 이는 조선 양반이오. 성함이 뉘시죠?" -하고 그는 나를 바라보오. 나는, -"최석입니다." -하고 바로 대답하였소. -"최석 씨?" -하고 그 남자는 소개하던 것도 잊어버리고 내 얼굴을 들여다보오. -"네, 최석입니다." -"아 ●●학교 교장으로 계신 최석 씨." -하고 그 남자는 더욱 놀라오. -"네, 어떻게 내 이름을 아세요?" -하고 나도 그가 혹시 아는 사람이나 아닌가 하고 등불 빛에 얼굴을 들여다 보았으나 도무지 그 얼굴이 본 기억이 없소. -"최 선생을 내가 압니다. 남 선생한테 말씀을 많이 들었지요. 그런데 남 선생도 돌아가신 지가 벌써 몇 핸가." -하고 감개무량한 듯이 그 아내를 돌아보오. -"십오 년이지요." -하고 곁에 섰던 부인이 말하오. -"벌써 십오 년인가." -하고 그 남자는 나를 보고, -"정임이 잘 자랍니까? 벌써 이십이 넘었지." -하고 또 부인을 돌아보오. -"스물세 살이지." -하고 부인이 확실치 아니한 듯이 대답하오. -"네, 스물세 살입니다. 지금 동경에 있습니다. 병이 나서 입원한 것을 보고 왔는데." -하고 나는 번개같이 정임의 병실과 정임의 호텔 장면 등을 생각하고 가슴이 설렘을 깨달았소. 의외인 곳에서 의외인 사람들을 만나서 정임의 말을 하게 된 것을 기뻐하였소. -"무슨 병입니까. 정임이가 본래 몸이 약해서." -하고 부인이 직접 내게 묻소. -"네. 몸이 좀 약합니다. 병이 좀 나은 것을 보고 떠났습니다마는 염려가 됩니다." -하고 나는 무의식중에 고개를 동경이 있는 방향으로 돌렸소. 마치 고개를 동으로 돌리면 정임이가 보이기나 할 것같이. -"자, 우리 집으로 갑시다." -하고 나는 아직 그의 성명도 모르는 남자는, 그의 아내를 재촉하더니, -"우리가 조선 동포를 만난 것이 십여 년 만이오. 그런데 최 선생, 이것을 좀 보시고 가시지요." -하고 그는 빙그레 웃으면서 나를 서너 걸음 끌고 가오. 거기는 조그마한 무덤이 있고 그 앞에는 석 자 높이나 되는 목패를 세웠는데 그 목패에는 `두 별 무덤'이라는 넉 자를 썼소. -내가 이상한 눈으로 그 무덤과 목패를 보고 있는 것을 보고 그는, -"이게 무슨 무덤인지 아십니까?" -하고 유쾌하게 묻소. -"두 별 무덤이라니 무슨 뜻인가요?" -하고 나도 그의 유쾌한 표정에 전염이 되어서 웃고 물었소. -"이것은 우리 둘의 무덤이외다." -하고 그는 아내의 어깨를 치며 유쾌하게 웃었소. 부인은 부끄러운 듯이 웃고 고개를 숙이오. -도무지 모두 꿈 같고 환영 같소. -"자 갑시다. 자세한 말은 우리 집에 가서 합시다." -하고 서너 걸음 어떤 방향으로 걸어가니 거기는 말을 세 필이나 맨 마차가 있소. 몽고 사람들이 가족을 싣고 수초를 따라 돌아다니는 그러한 마차요. 삿자리로 홍예형의 지붕을 만들고 그 속에 들어가 앉게 되었소. 그의 부인과 나와는 이 지붕 속에 들어앉고 그는 손수 어자대에 앉아서 입으로 쮸쮸쮸쮸 하고 말을 모오. 등불도 꺼 버리고 캄캄한 속으로 달리오. -"불이 있으면 군대에서 의심을 하지요. 도적놈이 엿보지요. 게다가 불이 있으면 도리어 앞이 안 보인단 말요. 쯧쯧쯧쯧!" -하는 소리가 들리오. -대체 이 사람은 무슨 사람인가. 또 이 부인은 무슨 사람인가 하고 나는 어두운 속에서 혼자 생각하였소. 다만 잠시 본 인상으로 보아서 그들은 행복된 부부인 것 같았소. 그들이 무엇 하러 이 아닌 밤중에 광야에 나왔던가. 또 그 이상야릇한 두 별 무덤이란 무엇인가. -나는 불현듯 집을 생각하였소. 내 아내와 어린것들을 생각하였소. 가정과 사회에서 쫓겨난 내가 아니오. 쫓겨난 자의 생각은 언제나 슬픔뿐이었소. -나는 내 아내를 원망치 아니하오. 그는 결코 악한 여자가 아니오. 다만 보통 여자요. 그는 질투 때문에 이성의 힘을 잃은 것이오. 여자가 질투 때문에 이성을 잃는 것이 천직이 아닐까요. 그가 나를 사랑하길래 나를 위해서 질투를 가지는 것이 아니오. -설사 질투가 그로 하여금 칼을 들어 내 가슴을 찌르게 하였다 하더라도 나는 감사한 생각을 가지고 눈을 감을 것이오. 사랑하는 자는 질투한다고 하오. 질투를 누르는 것도 아름다운 일이지마는 질투에 타는 것도 아름다운 일이 아닐까요. -덜크럭덜크럭 하고 차바퀴가 철로길을 넘어가는 소리가 나더니 이윽고 마차는 섰소. -앞에 빨갛게 불이 비치오. -"자 이게 우리 집이오." -하고 그가 마차에서 뛰어내리는 양이 보이오. 내려 보니까 달이 올라오오. 굉장히 큰 달이, 붉은 달이 지평선으로서 넘석하고 올라오오. -달빛에 비추인 바를 보면 네모나게 담 담이라기보다는 성을 둘러쌓은 달 뜨는 곳으로 열린 대문을 들어서서 넓은 마당에 내린 것을 발견하였소. -"아버지!" -"엄마!" -하고 아이들이 뛰어나오오. 말만큼이나 큰 개가 네 놈이나 꼬리를 치고 나오오. 그놈들이 주인집 마차 소리를 알아듣고 짖지 아니한 모양이오. -큰 아이는 계집애로 여남은 살, 작은 아이는 사내로 육칠 세, 모두 중국 옷을 입었소. -우리는 방으로 들어갔소. 방은 아라사식 절반, 중국식 절반으로 세간이 놓여 있고 벽에는 조선 지도와 단군의 초상이 걸려 있소. -그들 부처는 지도와 단군 초상 앞에 허리를 굽혀 배례하오. 나도 무의식적으로 그대로 하였소. -그는 차를 마시며 이렇게 말하오. -"우리는 자식들을 이 흥안령 가까운 무변 광야에서 기르는 것으로 낙을 삼고 있지요. 조선 사람들은 하도 마음이 작아서 걱정이니 이런 호호탕탕한 넓은 벌판에서 길러나면 마음이 좀 커질까 하지요. 또 흥안령 밑에서 지나 중원을 통일한 제왕이 많이 났으니 혹시나 그 정기가 남아 있을까 하지요. 우리 부처의 자손이 몇 대를 두고 퍼지는 동안에는 행여나 마음 큰 인물이 하나 둘 날는지 알겠어요, 하하하하." -하고 그는 제 말을 제가 비웃는 듯이 한바탕 웃고 나서, -"그러나 이건 내 진정이외다. 우리도 이렇게 고국을 떠나 있지마는 그래도 고국 소식이 궁금해서 신문 하나는 늘 보지요. 하지만 어디 시원한 소식이 있어요. 그저 조리복소니가 되어가는 것이 아니면 조그마한 생각을 가지고, 눈곱만한 야심을 가지고, 서 푼어치 안 되는 이상을 가지고 찧고 까불고 싸우고 하는 것밖에 안 보이니 이거 어디 살 수가 있나. 그래서 나는 마음 큰 자손을 낳아서 길러 볼까 하고 이를테면 새 민족을 하나 만들어 볼까 하고, 둘째 단군, 둘째 아브라함이나 하나 낳아 볼까 하고 하하하하앗하." -하고 유쾌하게, 그러나 비통하게 웃소. -나는 저녁을 굶어서 배가 고프고, 밤길을 걸어서 몸이 곤한 것도 잊고 그의 말을 들었소. -부인이 김이 무럭무럭 나는 호떡을 큰 뚝배기에 담고 김치를 작은 뚝배기에 담고, 또 돼지고기 삶은 것을 한 접시 담아다가 탁자 위에 놓소. -건넌방이라고 할 만한 방에서 젖먹이 우는 소리가 들리오. 부인은 삼십이나 되었을까, 남편은 서른댓 되었을 듯한 키가 훨쩍 크고 눈과 코가 크고 손도 큰 건장한 대장부요, 음성이 부드러운 것이 체격에 어울리지 아니하나 그것이 아마 그의 정신 생활이 높은 표겠지요. -"신문에서 최 선생이 학교를 고만두시게 되었다는 말도 보았지요. 그러나 나는 그것이 다 최 선생에게 대한 중상인 줄을 짐작하였고, 또 오늘 이렇게 만나 보니까 더구나 그것이 다 중상인 줄을 알지요." -하고 그는 확신 있는 어조로 말하오. -"고맙습니다." -나는 이렇게밖에 대답할 말이 없었소. -"아, 머, 고맙다고 하실 것도 없지요." -하고 그는 머리를 뒤로 젖히고 한참이나 생각을 하더니 우선 껄껄 한바탕 웃고 나서, -"내가 최 선생이 당하신 경우와 꼭 같은 경우를 당하였거든요. 이를테면 과부 설움은 동무 과부가 안다는 것이지요." -하고 그는 자기의 내력을 말하기 시작하오. -"내 집은 본래 서울입니다. 내가 어렸을 적에 내 선친께서 시국에 대해서 불평을 품고 당신 삼 형제의 가족을 끌고 재산을 모두 팔아 가지고 간도에를 건너오셨지요. 간도에 맨 먼저 ●●학교를 세운 이가 내 선친이지요." -여기까지 하는 말을 듣고 나는 그가 누구인지를 알았소. 그는 R씨라고 간도 개척자요, 간도에 조선인 문화를 세운 이로 유명한 이의 아들인 것이 분명하오. 나는 그의 이름이 누구인지도 물어 볼 것 없이 알았소. -"아 그러십니까. 네, 그러세요." -하고 나는 감탄하였소. -"네, 내 선친을 혹 아실는지요. 선친의 말씀이 노 그러신단 말씀야요. 조선 사람은 속이 좁아서 못쓴다고 <정감록>에도 그런 말이 있다고 조선은 산이 많고 들이 좁아서 사람의 마음이 작아서 큰일하기가 어렵고, 큰사람이 나기가 어렵다고. 웬만치 큰사람이 나면 서로 시기해서 큰일할 새가 없이 한다고 그렇게 <정감록>에도 있다더군요. 그래서 선친께서 자손에게나 희망을 붙이고 간도로 오신 모양이지요. 거기서 자라났다는 것이 내 꼴입니다마는, 아하하. -내가 자라서 아버지께서 세우신 K여학교의 교사로 있을 때 일입니다. 지금 내 아내는 그 때 학생으로 있었구. 그러자 내 아버지께서 재산이 다 없어져서 학교를 독담하실 수가 없고, 또 얼마 아니해서 아버지께서 돌아가시고 보니 학교에는 세력 다툼이 생겨서 아버지의 후계자로 추정되는 나를 배척하게 되었단 말씀이오. 거기서 나를 배척하는 자료를 삼은 것이 나와 지금 내 아내가 된 학생의 관계란 것인데 이것은 전연 무근지설인 것은 말할 것도 없소. 나도 총각이요, 그는 처녀니까 혼인을 하자면 못 할 것도 없지마는 그것이 사제 관계라면 중대 문제거든. 그래서 나는 단연히 사직을 하고 내가 사직한 것은 제 죄를 승인한 것이라 하여서 그 학생 지금 내 아내도 출교 처분을 당한 것이오. 그러고 보니, 그 여자의 아버지 내 장인이지요 그 여자의 아버지는 나를 죽일 놈같이 원망을 하고 그 딸을 죽일 년이라고 감금을 하고 어쨌으나 조그마한 간도 사회에서 큰 파문을 일으켰단 말이오. -이 문제를 더 크게 만든 것은 지금 내 아내인, 그 딸의 자백이오. 무어라고 했는고 하니, 나는 그 사람을 사랑하오, 그 사람한테가 아니면 시집을 안 가오, 하고 뻗댔단 말요. -나는 이 여자가 이렇게 나를 생각하는가 할 때 의분심이 나서 나는 어떻게 해서든지 이 여자와 혼인하리라고 결심을 하였소. 나는 마침내 정식으로 K장로라는 내 장인에게 청혼을 하였으나 단박에 거절을 당하고 말았지요. K장로는 그 딸을 간도에 두는 것이 옳지 않다고 해서 서울로 보내기로 하였단 말을 들었소. 그래서 나는 최후의 결심으로 그 여자 지금 내 아내 된 사람을 데리고 간도에서 도망하였소. 하하하하. 밤중에 단둘이서. -지금 같으면야 사제간에 결혼을 하기로 그리 큰 문제가 될 것이 없지마는 그 때에 어디 그랬나요. 사제간에 혼인이란 것은 부녀간에 혼인한다는 것과 같이 생각하였지요. 더구나 그 때 간도 사회에는 청교도적 사상과 열렬한 애국심이 있어서 도덕 표준이 여간 높지 아니하였지요. 그런 시대니까 내가 내 제자인 여학생을 데리고 달아난다는 것은 살인 강도를 하는 이상으로 무서운 일이었지요. 지금도 나는 그렇게 생각합니다마는. -그래서 우리 두 사람은 우리 두 사람이라는 것보다도 내 생각에는 어찌하였으나 나를 위해서 제 목숨을 버리려는 그에게 사실 나도 마음 속으로는 그를 사랑하였지요. 다만 사제간이니까 영원히 달할 수는 없는 사랑이라고 단념하였을 뿐이지요. 그러니까 비록 부처 생활은 못 하더라도 내가 그의 사랑을 안다는 것과 나도 그를 이만큼 사랑한다는 것만을 보여 주자는 것이지요. -때는 마침 가을이지마는, 몸에 지닌 돈도 얼마 없고 천신만고로 길림까지를 나와 가지고는 배를 타고 송화강을 내려서 하얼빈에 가 가지고 거 기서 간신히 치타까지의 여비와 여행권을 얻어 가지고 차를 타고 떠나지 않았어요. 그것이 바로 십여 년 전 오늘이란 말이오." -이 때에 부인이 옥수수로 만든 국수와 감자 삶은 것을 가지고 들어오오. -나는 R의 말을 듣던 끝이라 유심히 부인을 바라보았소. 그는 중키나 되는 둥근 얼굴이 혈색이 좋고 통통하여 미인이라기보다는 씩씩한 여자요. 그런 중에 조선 여자만이 가지는 아담하고 점잖은 맛이 있소. -"앉으시지요. 지금 두 분께서 처음 사랑하시던 말씀을 듣고 있습니다." -하고 나는 부인에게 교의를 권하였소. -"아이, 그런 말씀은 왜 하시오." -하고 부인은 갑자기 십 년이나 어려지는 모양으로 수삽한 빛을 보이고 고개를 숙이고 달아나오. -"그래서요. 그래 오늘이 기념일이외다그려." -하고 나도 웃었소. -"그렇지요. 우리는 해마다 오늘이 오면 우리 무덤에 성묘를 가서 하룻밤을 새우지요. 오늘은 손님이 오셔서 중간에 돌아왔지만, 하하하하." -하고 그는 유쾌하게 웃소. -"성묘라니?" -하고 나는 물었소. -"아까 보신 두 별 무덤 말이오. 그것이 우리 내외의 무덤이지요. 하하하하." -"…………." -나는 영문을 모르고 가만히 앉았소. -"내 이야기를 들으시지요. 그래 둘이서 차를 타고 오지 않았겠어요. 물론 여전히 선생님과 제자지요. 그렇지만 워낙 여러 날 단둘이서 같이 고생을 하고 여행을 했으니 사랑의 불길이 탈 것이야 물론 아니겠어요. 다만 사제라는 굳은 의리가 그것을 겉에 나오지 못하도록 누른 것이지요. ……그런데 꼭 오늘같이 좋은 날인데 여기는 대개 일기가 일정합니다. 좀체로 비가 오는 일도 없고 흐리는 날도 없지요. 헌데 F역에를 오니까 참 석양 경치가 좋단 말이오. 그 때에 불현듯, 에라 여기서 내려서 이 석양 속에 저 호숫 가에 둘이서 헤매다가 깨끗이 사제의 몸으로 이 깨끗한 광야에 묻혀 버리자 하는 생각이 나겠지요. 그래 그 때 말을 내 아내 그 때에는 아직 아내가 아니지요 내 아내에게 그런 말을 하였더니 참 좋다고 박장을 하고 내 어깨에 매달리는구려. 그래서 우리 둘은 차가 거의 떠날 임박해서 차에서 뛰어내렸지요." -하고 그는 그때 광경을 눈앞에 그리는 모양으로 말을 끊고 우두커니 허공을 바라보오. 그러나 그의 입 언저리에는 유쾌한 회고에서 나오는 웃음이었소. -"이야기 다 끝났어요?" -하고 부인이 크바스라는 청량 음료를 들고 들어오오. -"아니오. 이제부터가 정통이니 당신도 거기 앉으시오. 지금 차에서 내린 데까지 왔는데 당신도 앉아서 한 파트를 맡으시오." -하고 R는 부인의 손을 잡아서 자리에 앉히오. 부인도 웃으면서 앉소. -"최 선생 처지가 꼭 나와 같단 말요. 정임의 처지가 당신과 같고." -하고 그는 말을 계속하오. -"그래 차에서 내려서 나는 이 양반하고 물을 찾아 헤매었지요. 아따, 석양이 어떻게 좋은지 이 양반은 박장을 하고 노래를 부르고 우리 둘은 마치 유쾌하게 산보하는 사람 같았지요." -"참 좋았어요. 그 때에는 참 좋았어요. 그 석양에 비친 광야와 호수라는 건 어떻게 좋은지 그 수은 같은 물 속에 텀벙 뛰어들고 싶었어요. 그 후엔 해마다 보아도 그만 못해." -하고 부인이 참견을 하오. -아이들은 다 자는 모양이오. -"그래 지향없이 헤매는데 해는 뉘엿뉘엿 넘어가구, 어스름은 기어들고 그 때 마침 하늘에는 별 둘이 나타났단 말이야. 그것을 이 여학생이 먼저 보고서 갑자기 추연해지면서 선생님 저 별 보셔요, 앞선 큰 별은 선생님이 구 따라가는 작은 별은 저야요, 하겠지요. 그 말이, 또 그 태도가 어떻게 가련한지. 그래서 나는 하늘을 바라보니깐 과연 별 두 개가 지는 해를 따르는 듯이 따라간다 말요. 말을 듣고 보니 과연 우리 신세와도 같지 않아요? -그리고는 이 사람이 또 이럽니다그려 `선생님, 앞선 큰 별은 아무리 따라도 저 작은 별은 영원히 따라잡지 못하겠지요. 영원히 영원히 따라가다가 따라가다가 못 해서 마침내는 저 작은 별은 죽어서 검은 재가 되고 말겠지요? 저 작은 별이 제 신세와 어쩌면 그리 같을까.' 하고 한탄을 하겠지요. 그 때에 한탄을 하고 눈물을 흘리고 섰는 어린 처녀의 석양빛에 비췬 모양을 상상해 보세요, 하하하하. 그 때에는 당신도 미인이었소. 하하하하." -하고 내외가 유쾌하게 웃는 것을 보니 나는 더욱 적막하여짐을 깨달았소. 어쩌면 그 석양, 그 두 별이 이들에게와 내게 꼭 같은 인상을 주었을까 하니 참으로 이상하다 하였소. -"그래 인제." -하고 R는 다시 이야기를 계속하오. -"그래 인제 둘이서 그야말로 감개무량하게 두 별을 바라보며 걸었지요. 그러다가 해가 넘어가고 앞선 큰 별이 넘어가고 그리고는 혼자서 깜빡깜빡하고 가던 작은 별이 넘어가니 우리는 그만 땅에 주저앉았소. 거기가 어딘고 하니 그 두 별 무덤이 있는 곳이지요. `선생님 저를 여기다가 파묻어 주시고 가셔요. 선생님 손수 저를 여기다가 묻어 놓고 가 주셔요.' 하고 이 사람이 조르지요." -하는 것을 부인은, -"내가 언제." -하고 남편을 흘겨보오. -"그럼 무에라고 했소? 어디 본인이 한 번 옮겨 보오." -하고 R가 말을 끊소. -"간도를 떠난 지가 한 달이 되도록 단둘이 다녀도 요만큼도 귀해 주는 점이 안 뵈니 그럼 파묻어 달라고 안 해요?" -하고 부인은 웃소. -"흥흥." -하고 R는 부인의 말에 웃고 나서, -"그 자리에 묻어 달란 말을 들으니까, 어떻게 측은한지, 그럼 나도 함께 묻히자고 그랬지요. 나는 그 때에 참말 그 자리에 함께 묻히고 싶었어요. 그래서 나는 손으로 곧 구덩이를 팠지요. 떡가루 같은 모래판이니까 파기는 힘이 아니 들겠지요. 이이도 물끄러미 내가 땅을 파는 것을 보고 섰더니만 자기도 파기를 시작하겠지요." -하고 내외가 다 웃소. -"그래 순식간에……." -하고 R는 이야기를 계속하오. -"순식간에 둘이 드러누울 만한 구덩이를 아마 두 자 깊이나 되게, 네모나게 파 놓고는 내가 들어가 누워 보고 그러고는 또 파고 하여 아주 편안한 구덩이를 파고 나서는 나는 아주 세상을 하직할 셈으로 사방을 둘러보 고 사방이래야 컴컴한 어둠밖에 없지만 사방을 둘러보고, 이를테면 세상과 작별을 하고 드러누웠지요. 지금 이렇게 회고담을 할 때에는 우습기도 하지마는 그 때에는 참으로 종교적이라 할 만한 엄숙이었소. 그때 우리 둘의 처지는 앞도 절벽, 뒤도 절벽이어서 죽는 길밖에 없었지요. 또 그뿐 아니라 인생의 가장 깨끗하고 가장 사랑의 맑은 정이 타고 가장 기쁘고도 슬프고도 이를테면 모든 감정이 절정에 달하고, 그러한 순간에 목숨을 끊어 버리는 것이 가장 좋은 일이요, 가장 마땅한 일같이 생각하였지요. 광야에 아름다운 황혼이 순간에 스러지는 모양으로 우리 두 생명의 아름다움도 순간에 스러지자는 우리는 철학자도 시인도 아니지마는 우리들의 환경이 우리 둘에게 그러한 생각을 넣어 준 것이지요. -그래서 내가 가만히 드러누워 있는 것을 저이가 물끄러미 보고 있더니 자기도 내 곁에 들어와 눕겠지요. 그런 뒤에는 황혼에 남은 빛도 다 스러지고 아주 캄캄한 암흑 세계가 되어 버렸지요. 하늘에 어떻게 그렇게 별이 많은지. 가만히 하늘을 바라보노라면 참 별이 많아요. 우주란 참 커요. 그런데 이 끝없이 큰 우주에 한없이 많은 별들이 다 제자리를 지키고 제 길을 지켜서 서로 부딪지도 아니하고 끝없이 긴 시간에 질서를 유지하고 있는 것을 보면 우주에는 어떤 주재하는 뜻, 섭리하는 뜻이 있다 하는 생각이 나겠지요. 나도 예수교인의 가정에서 자라났지마는 이 때처럼 하나님이라 할까 이름은 무엇이라고 하든지 간에 우주의 섭리자의 존재를 강렬하게 의식한 일은 없었지요. -그렇지만 `사람의 마음에 비기면 저까짓 별들이 다 무엇이오?' 하고 그때 겨우 열여덟 살밖에 안 된 이이가 내 귀에 입을 대고 말할 때에는 나도 참으로 놀랐습니다. 나이는 나보다 오륙 년 상관밖에 안 되지마는 이십 세 내외에 오륙 년 상관이 적은 것인가요? 게다가 나는 선생이요 자기는 학생이니까 어린애로만 알았던 것이 그런 말을 하니 놀랍지 않아요? 어째서 사람의 마음이 하늘보다도 더 이상할까 하고 내가 물으니까, 그 대답이 `나는 무엇이라고 설명할 수가 없지마는 내 마음 속에 일어나는 것이 하늘이나 땅에 일어나는 모든 것보다도 더 아름답고 더 알 수 없고 더 뜨겁고 그런 것 같아요.' 그러겠지요. 생명이란 모든 아름다운 것 중에 가장 아름다운 것이라는 것을 나는 깨달았어요. 그 말에, `그렇다 하면 이 아름답고 신비한 생명을 내는 우주는 더 아름다운 것이 아니오?' 하고 내가 반문하니까, 당신(부인을 향하여) 말이, `전 모르겠어요, 어쨌으나 전 행복합니다. 저는 이 행복을 깨뜨리고 싶지 않습니다. 놓쳐 버리고 싶지 않습니다. 이 행복 선생님 곁에 있는 이 행복을 꽉 안고 죽고 싶어요.' 그러지 않았소?" -"누가 그랬어요? 아이 난 다 잊어버렸어요." -하고 부인은 차를 따르오. R는 인제는 하하하 하는 웃음조차 잊어버리고, 부인에게 농담을 붙이는 것조차 잊어버리고, 그야말로 종교적 엄숙 그대로말을 이어, -"`자 저는 약을 먹어요.' 하고 손을 입으로 가져가는 동작이 감행되겠지요. 약이란 것은 하얼빈에서 준비한 아편이지요. 하얼빈서 치타까지 가는 동안에 흥안령이나 어느 삼림지대나 어디서나 죽을 자리를 찾자고 준비한 것이니까. 나는 입 근처로 가는 그의 손을 붙들었어요. 붙들면서 나는 `잠깐만 기다리오. 오늘 밤 안으로 그 약을 먹으면 고만이 아니오? 이 행복된 순간을 잠깐이라도 늘립시다. 달 올라올 때까지만.' 나는 이렇게 말했지요. `선생님도 행복되셔요? 선생님은 불행이시지. 저 때문에 불행이시지. 저만 이곳에 묻어 주시구는 선생님은 세상에 돌아가 사셔요, 오래오래 사셔요, 일 많이 하고 사셔요.' 하고 울지 않겠어요. 나는 그 때에 내 아내가 하던 말을 한 마디도 잊지 아니합니다. 그 말을 듣던 때의 내 인상은 아마 일생 두고 잊히지 아니하겠지요. -나는 자백합니다. 그 순간에 나는 처음으로 내 아내를 안고 키스를 하였지요. 내 속에 눌리고 눌리고 쌓이고 하였던 열정이 그만 일시에 폭발되었던 것이오. 아아 이것이 최초의 것이요, 동시에 최후의 것이로구나 할 때에 내 눈에서는 끓는 듯한 눈물이 흘렀소이다. 두 사람의 심장이 뛰는 소리, 두 사람의 풀무 불길 같은 숨소리. -이윽고 달이 떠올라 왔습니다. 가이없는 벌판이니까 달이 뜨니까 갑자기 천지가 환해지고 우리 둘이 손으로 파서 쌓아 놓은 흙무더기가 이 산 없는 세상에 산이나 되는 것같이 조그마한 검은 그림자를 지고 있겠지요. `자 우리 달빛을 띠고 좀 돌아다닐까.' 하고 나는 아내를 안아 일으켰지요. 내 팔에 안겨서 고개를 뒤로 젖힌 내 아내의 얼굴이 달빛에 비친 양을 나는 잘 기억합니다. 실신한 듯한, 만족한 듯한, 그리고도 절망한 듯한 그 표정을 무엇으로 그릴지 모릅니다. 그림도 그릴 줄 모르고 조각도 할 줄 모르고 글도 쓸 줄 모르는 내가 그것을 어떻게 그립니까. 그저 가슴 속에 품고 이렇게 오늘의 내 아내를 바라볼 뿐이지요. -나는 내 아내를 팔에 걸고 네, 걸었다고 하는 것이 가장 합당하지 요 이렇게 팔에다 걸고 달빛을 받은 황량한 벌판, 아무리 하여도 환하게 밝아지지는 아니하는 벌판을 헤매었습니다. 이따금 내 아내가, `어서 죽고 싶어요, 전 죽고만 싶어요.' 하는 말에는 대답도 아니 하고. 죽고 싶다는 그 말은 물론 진정일 것이지요. 아무리 맑은 일기라 하더라도 오후가 되면 흐려지는 법이니까 오래 살아가는 동안에 늘 한 모양으로 이 순간같이 깨끗하고 뜨거운 기분으로 갈 수는 없지 않아요? 불쾌한 일도 생기고, 보기 흉한 일도 생길는지 모르거든. 그러니까 이 완전한 깨끗과 완전한 사랑과 완전한 행복 속에 죽어 버리자는 뜻을 나는 잘 알지요. 더구나 우리들이 살아 남는대야 앞길이 기구하지 평탄할 리는 없지 아니해요? 그래서 나는 `죽지, 우리 이 달밤에 실컷 돌아다니다가, 더 돌아다니기가 싫거든 그 구덩에 돌아가서 약을 먹읍시다.' 이렇게 말하고 우리 둘은 헤맸지요. 낮에 보면 어디까지나 평평한 벌판인 것만 같지마는 달밤에 보면 이 사막에도 아직 채 스러지지 아니한 산의 형적이 남아 있어서 군데군데 거뭇거뭇한 그림자가 있겠지요. 그 그림자 속에는 걸어 들어가면 어떤 데는 우리 허리만큼 그림자에 가리우고 어떤 데는 우리 둘을 다 가리워 버리는 데도 있단 말야요. 죽음의 그림자라는 생각이 나면 그래도 몸에 소름이 끼쳐요. -차차 달이 높아지고 추위가 심해져서 바람결이 지나갈 때에는 눈에서 눈물이 날 지경이지요. 원체 대기 중에 수분이 적으니까 서리도 많지 않지마는, 그래도 대기 중에 있는 수분은 다 얼어 버려서 얼음가루가 되었는 게지요. 공중에는 반짝반짝하는 수정가루 같은 것이 보입니다. 낮에는 땀이 흐르리만큼 덥던 사막도 밤이 되면 이렇게 기온이 내려가지요. 춥다고 생각은 하면서도 춥다는 말은 아니 하고 우리는 어떤 때에는 달을 따라서, 어떤 때에는 달을 등지고, 어떤 때에는 호수에 비친 달을 굽어보고, 이 모양으로 한없이 말도 없이 돌아다녔지요. 이 세상 생명의 마지막 순간을 힘껏 의식하려는 듯이. -마침내 `나는 더 못 걸어요.' 하고 이이가 내 어깨에 매달려 버리고 말았지요." -하고 R가 부인을 돌아보니 부인은 편물하던 손을 쉬고, -"다리가 아픈 줄은 모르겠는데 다리가 이리 뉘구 저리 뉘구 해서 걸음을 걸을 수가 없었어요. 춥기는 하구." -하고 소리를 내어서 웃소. -"그럴 만도 하지." -하고 R는 긴장한 표정을 약간 풀고 앉은 자세를 잠깐 고치며, -"그 후에 그 날 밤 돌아다닌 곳을 더듬어 보니까, 자세히는 알 수 없지마는 삼십 리는 더 되는 것 같거든. 다리가 아프지 아니할 리가 있나." -하고 차를 한 모금 마시고 나서 말을 계속하오. -"그래서 나는 내 외투를 벗어서, 이이(부인)를 싸서 어린애 안듯이 안고 걸었지요. 외투로 쌌으니 자기도 춥지 않구, 나는 또 무거운 짐을 안았으니 땀이 날 지경이구, 그뿐 아니라 내가 제게 주는 최후의 서비스라 하니 기쁘고, 말하자면 일거 삼득이지요. 하하하하. 지난 일이니 웃지마는 그 때 사정을 생각해 보세요, 어떠했겠나." -하고 R는 약간 처참한 빛을 띠면서, -"그러니 그 구덩이를 어디 찾을 수가 있나. 얼마를 찾아 돌아다니다가 아무 데서나 죽을 생각도 해 보았지마는 몸뚱이를 그냥 벌판에 내놓고 죽고 싶지는 아니하고 또 그 구덩이가 우리 두 사람에게 특별한 의미가 있는 것 같아서 기어코 그것을 찾아 내고야 말았지요. 그 때는 벌써 새벽이 가까웠던 모양이오. 열 시나 넘어서 뜬 하현달이 낮이 기울었으니 그렇지 않겠어요. 그 구덩이에 와서 우리는 한 번 더 하늘과 달과 별과, 그리고 마음 속에 떠오른 사람들과 하직하고 약 먹을 준비를 했지요. -약을 검은 고약과 같은 아편을 맛이 쓰다는 아편을 물도 없이 먹으려 들었지요. -우리 둘은 아까 모양으로 가지런히 누워서 하늘을 바라보았는데 달이 밝으니까 보이던 별들 중에 숨은 별이 많고 또 별들의 위치 우리에게 낯익은 북두칠성 자리도 변했을 것 아니야요. 이상한 생각이 나요. 우리가 벌판으로 헤매는 동안에 천지가 모두 변한 것 같아요. 사실 변하였지요. 그 변한 것이 우스워서 나는 껄껄 웃었지요. 워낙 내가 웃음이 좀 헤프지만 이 때처럼 헤프게 실컷 웃어 본 일은 없습니다. -왜 웃느냐고 아내가 좀 성을 낸 듯이 묻기로, `천지와 인생이 변하는 것이 우스워서 웃었소.' 그랬지요. 그랬더니, `천지와 인생은 변할는지 몰라도 내 마음은 안 변해요!' 하고 소리를 지르겠지요. 퍽 분개했던 모양이야." -하고 R는 그 아내를 보오. -"그럼 분개 안 해요? 남은 죽을 결심을 하고 발발 떨구 있는데 곁에서 껄껄거리고 웃으니, 어째 분하지가 않아요. 나는 분해서 달아나려고 했어요." -하고 부인은 아직도 분함이 남은 것같이 말하오. -"그래 달아나지 않았소?" -하고 R는 부인이 벌떡 일어나서 비틀거리고 달아나는 흉내를 팔과 다리로 내고 나서, -"이래서 죽는 시간이 지체가 되었지요. 그래서 내가 빌고 달래고 해서 가까스로 안정을 시키고 나니 손에 쥐었던 아편이 땀에 푹 젖었겠지요. 내가 웃은 것은 죽기 전 한 번 천지와 인생을 웃어 버린 것인데 그렇게 야단이니…… 하하하하." -R는 식은 차를 한 모금 더 마시며, -"참 목도 마르기도 하더니. 입에는 침 한 방울 없고. 그러나 못물을 먹을 생각도 없고. 나중에는 말을 하려고 해도 혀가 안 돌아가겠지요. -이러는 동안에 달빛이 희미해지길래 웬일인가 하고 고개를 번쩍 들었더니 해가 떠오릅니다그려. 어떻게 붉고 둥글고 씩씩한지. `저 해 보오.' 하고 나는 기계적으로 벌떡 일어나서 구덩이에서 뛰어나왔지요." -하고 빙그레 웃소. R의 빙그레 웃는 양이 참 좋았소. -"내가 뛰어나오는 것을 보고 이이도 뿌시시 일어났지요. 그 해! 그 해의 새 빛을 받는 하늘과 땅의 빛! 나는 그것을 형용할 말을 가지지 못합니다. 다만 힘껏 소리치고 싶고 기운껏 달음박질치고 싶은 생각이 날 뿐이어요. -`우리 삽시다, 죽지 말고 삽시다, 살아서 새 세상을 하나 만들어 봅시다.' 이렇게 말하였지요. 하니까 이이가 처음에는 깜짝 놀라는 것 같아요. 그러나 마침내 아내도 죽을 뜻을 변하였지요. 그래서 남 선생을 청하여다가 그 말씀을 여쭈었더니 남 선생께서 고개를 끄덕끄덕하시고 우리 둘의 혼인 주례를 하셨지요. 그 후 십여 년에 우리는 밭 갈고 아이 기르고 이런 생활을 하고 있는데 언제나 여기 새 민족이 생기고 누가 새 단군이 될는지요. 하하하하, 아하하하. 피곤하시겠습니다. 이야기가 너무 길어서." -하고 R는 말을 끊소. -나는 R부처가 만류하는 것도 다 뿌리치고 여관으로 돌아왔소. R와 함께 달빛 속, 개 짖는 소리 속을 지나서 아라사 사람의 조그마한 여관으로 돌아왔소. 여관 주인도 R를 아는 모양이어서 반갑게 인사하고 또 내게 대한 부탁도 하는 모양인가 보오. -R는 내 방에 올라와서 내일 하루 지날 일도 이야기하고 또 남 선생과 정임에게 관한 이야기도 하였으나, 나는 그가 무슨 이야기를 하는지 잘 들을 만한 마음의 여유도 없어서 마음 없는 대답을 할 뿐이었소. -R가 돌아간 뒤에 나는 옷도 벗지 아니하고 침대에 드러누웠소. 페치카를 때기는 한 모양이나 방이 써늘하기 그지없소. -`그 두 별 무덤이 정말 R와 그 여학생과 두 사람이 영원히 달치 못할 꿈을 안은 채로 깨끗하게 죽어서 묻힌 무덤이었으면 얼마나 좋을까. 만일 그렇다 하면 내일 한 번 더 가서 보토라도 하고 오련마는.' -하고 나는 R부처의 생활에 대하여 일종의 불만과 환멸을 느꼈소. -그리고 내가 정임을 여기나 시베리아나 어떤 곳으로 불러다가 만일 R와 같은 흉내를 낸다 하면, 하고 생각해 보고는 나는 진저리를 쳤소. 나는 내머리 속에 다시 그러한 생각이 한 조각이라도 들어올 것을 두려워하였소. -급행을 기다리자면 또 사흘을 기다리지 아니하면 아니 되기로 나는 이튿날 새벽에 떠나는 구간차를 타고 F역을 떠나 버렸소. R에게는 고맙다는 편지 한 장만을 써 놓고. 나는 R를 더 보기를 원치 아니하였소. 그것은 반드시 R를 죄인으로 보아서 그런 것은 아니오마는 그저 나는 다시 R를 대면하기를 원치 아니한 것이오. -나는 차가 R의 집 앞을 지날 때에도 R의 집에 대하여서는 외면하였소. -이 모양으로 나는 흥안령을 넘고, 하일라르의 솔밭을 지나서 마침내 이 곳에 온 것이오. -형! 나는 인제는 이 편지를 끝내오. 더 쓸 말도 없거니와 인제는 이것을 쓰기도 싫증이 났소. -이 편지를 쓰기 시작할 때에는 바이칼에 물결이 흉용하더니 이 편지를 끝내는 지금에는 가의 가까운 물에는 얼음이 얼었소. 그리고 저 멀리 푸른 물이 늠실늠실 하얗게 눈 덮인 산 빛과 어울리게 되었소. -사흘이나 이어서 오던 눈이 밤새에 개고 오늘 아침에는 칼날 같은 바람이 눈을 날리고 있소. -나는 이 얼음 위로 걸어서 저 푸른 물 있는 곳까지 가고 싶은 유혹을 금할 수 없소. 더구나 이 편지도 다 쓰고 나니, 인제는 내가 이 세상에서 할 마지막 일까지 다 한 것 같소. -내가 이 앞에 어디로 가서 어찌 될는지는 나도 모르지마는 희미한 소원을 말하면 눈 덮인 시베리아의 인적 없는 삼림 지대로 한정 없이 헤매다가 기운 진하는 곳에서 이 목숨을 마치고 싶소. -최석 군은 `끝'이라는 글자를 썼다가 지워 버리고 딴 종이에다가 이런 말을 썼다 -다 쓰고 나니 이런 편지도 다 부질없는 일이오. 내가 이런 말을 한대야 세상이 믿어 줄 리도 없지 않소. 말이란 소용 없는 것이오. 내가 아무리 내 아내에게 말을 했어도 아니 믿었거든 내 아내도 내 말을 아니 믿었거든 하물며 세상이 내 말을 믿을 리가 있소. 믿지 아니할 뿐 아니라 내 말 중에서 자기네 목적에 필요한 부분만은 믿고, 또 자기네 목적에 필요한 부분은 마음대로 고치고 뒤집고 보태고 할 것이니까, 나는 이 편지를 쓴 것이 한 무익하고 어리석은 일인 줄을 깨달았소. -형이야 이 편지를 아니 보기로니 나를 안 믿겠소? 그 중에는 혹 형이 지금까지 모르던 자료도 없지 아니하니, 형만 혼자 보시고 형만 혼자 내 사정을 알아 주시면 다행이겠소. 세상에 한 믿는 친구를 가지는 것이 저마다 하는 일이겠소? -나는 이 쓸데없는 편지를 몇 번이나 불살라 버리려고 하였으나 그래도 거기도 일종의 애착심이 생기고 미련이 생기는구려. 형 한 분이라도 보여 드리고 싶은 마음이 생기는구려. 내가 S형무소에 입감해 있을 적에 형무소 벽에 죄수가 손톱으로 성명을 새긴 것을 보았소. 뒤에 물었더니 그것은 흔히 사형수가 하는 짓이라고. 사형수가 교수대에 끌려 나가기 바로 전에 흔히 손톱으로 담벼락이나 마룻바닥에 제 이름을 새기는 일이 있다고 하는 말을 들었소. 내가 형에게 쓰는 이 편지도 그 심리와 비슷한 것일까요? -형! 나는 보통 사람보다는, 정보다는 지로, 상식보다는 이론으로, 이해보다는 의리로 살아 왔다고 자신하오. 이를테면 논리학적으로 윤리학적으로 살아온 것이라고 할까. 나는 엄격한 교사요, 교장이었소. 내게는 의지력과 이지력밖에 없는 것 같았소. 그러한 생활을 수십 년 해 오지 아니하였소? 나는 이 앞에 몇십 년을 더 살더라도 내 이 성격이나 생활 태도에는 변함이 없으리라고 자신하였소. 불혹지년이 지났으니 그렇게 생각하였을 것이 아니오? -그런데 형! 참 이상한 일이 있소. 그것은 내가 지금까지 처해 있던 환경을벗어나서 호호 탕탕하게 넓은 세계에 알몸을 내어던짐을 당하니 내 마음 속에는 무서운 여러 가지 변화가 일어나는구려. 나는 이 말도 형에게 아니 하려고 생각하였소. 노여워하지 마시오, 내게까지도 숨기느냐고. 그런 것이 아니오, 형은커녕 나 자신에게까지도 숨기려고 하였던 것이오. 혹시 그런 기다리지 아니 하였던 원, 그런 생각이 내 마음의 하늘에 일어나리라고 상상도 아니하였던, 그런 생각이 일어날 때에는 나는 스스로 놀라고 스스로 슬퍼하였소. 그래서 스스로 숨기기로 하였소. -그 숨긴다는 것이 무엇이냐 하면 그것은 열정이요, 정의 불길이요, 정의 광풍이요, 정의 물결이오. 만일 내 의식이 세계를 평화로운 풀 있고, 꽃 있고, 나무 있는 벌판이라고 하면 거기 난데없는 미친 짐승들이 불을 뿜고 소리를 지르고 싸우고, 영각을 하고 날쳐서, 이 동산의 평화의 화초를 다 짓밟아 버리고 마는 그러한 모양과 같소. -형! 그 이상야릇한 짐승들이 여태껏, 사십 년 간을 어느 구석에 숨어 있었소? 그러다가 인제 뛰어나와 각각 제 권리를 주장하오? -지금 내 가슴 속은 끓소. 내 몸은 바짝 여위었소. 그것은 생리학적으로나 심리학적으로나 타는 것이요, 연소하는 것이오. 그래서 다만 내 몸의 지방만이 타는 것이 아니라, 골수까지 타고, 몸이 탈 뿐이 아니라 생명 그 물건이 타고 있는 것이오. 그러면 어찌할까. -지위, 명성, 습관, 시대 사조 등등으로 일생에 눌리고 눌렸던 내 자아의 일부분이 혁명을 일으킨 것이오? 한 번도 자유로 권세를 부려 보지 못한 본능과 감정들이 내 생명이 끝나기 전에 한 번 날뛰어 보려는 것이오. 이것이 선이오? 악이오? -그들은 내가 지금까지 옳다고 여기고 신성하다고 여기던 모든 권위를 모조리 둘러엎으려고 드오. 그러나 형! 나는 도저히 이 혁명을 용인할 수가 없소. 나는 죽기까지 버티기로 결정을 하였소. 내 속에서 두 세력이 싸우다가 싸우다가 승부가 결정이 못 된다면 나는 승부의 결정을 기다리지 아니하고 살기를 그만두려오. -나는 눈 덮인 삼림 속으로 들어가려오. 나는 V라는 대삼림 지대가 어디인 줄도 알고 거기를 가려면 어느 정거장에서 내릴 것도 다 알아 놓았소. -만일 단순히 죽는다 하면 구태여 멀리 찾아갈 필요도 없지마는 그래도 나 혼자로는 내 사상과 감정의 청산을 하고 싶소. 살 수 있는 날까지 세상을 떠난 곳에서 살다가 완전한 해결을 얻는 날 나는 혹은 승리의, 혹은 패배의 종막을 닫칠 것이오. 만일 해결이 안 되면 안 되는 대로 그치면 그만이지요. -나는 이 붓을 놓기 전에 어젯밤에 꾼 꿈 이야기 하나는 하려오. 꿈이 하도 수상해서 마치 내 전도에 대한 신의 계시와도 같기로 하는 말이오. 그 꿈은 이러하였소. -내가 꽁이깨(꼬이까라는 아라사말로 침대라는 말이 조선 동포의 입으로 변한 말이오.) 짐을 지고 삽을 메고 눈이 덮인 삼림 속을 혼자 걸었소. 이 꽁이깨 짐이란 것은 금점꾼들이 그 여행 중에 소용품, 마른 빵, 소금, 내복 등속을 침대 매트리스에 넣어서 지고 다니는 것이오. 이 짐하고 삽 한 개, 도끼 한 개, 그것이 시베리아로 금을 찾아 헤매는 조선 동포들의 행색이오. 내가 이르쿠츠크에서 이러한 동포를 만났던 것이 꿈으로 되어 나온 모양이오. -나는 꿈에는 세상을 다 잊어버린, 아주 깨끗하고 침착한 사람으로 이 꽁이깨 짐을 지고 삽을 메고 밤인지 낮인지 알 수 없으나 땅은 눈빛으로 희고, 하늘은 구름빛으로 회색인 삼림 지대를 허덕허덕 걸었소. 길도 없는 데를, 인적도 없는 데를. -꿈에도 내 몸은 퍽 피곤해서 쉴 자리를 찾는 마음이었소. -나는 마침내 어떤 언덕 밑 한 군데를 골랐소. 그리고 상시에 이야기에서 들은 대로 삽으로 내가 누울 자리만한 눈을 치고, 그리고는 도끼로 곁에 선 나무 몇 개를 찍어 누이고 거기다가 불을 놓고 그 불김에 녹은 땅을 두어 자나 파내고 그 속에 드러누웠소. 훈훈한 것이 아주 편안하였소. -하늘에는 별이 반짝거렸소. F역에서 보던 바와 같이 큰 별 작은 별도 보이고 평시에 보지 못하던 붉은 별, 푸른 별 들도 보였소. 나는 이 이상한 하늘, 이상한 별들이 있는 하늘을 보고 드러누워 있노라니까 문득 어디서 발자국 소리가 들렸소. 퉁퉁퉁퉁 우루루루…… 나는 벌떡 일어나려 하였으나 몸이 천 근이나 되어서 움직일 수가 없었소. 가까스로 고개를 조금 들고 보니 뿔이 길다랗고 눈이 불같이 붉은 사슴의 떼가 무엇에 놀랐는지 껑충껑충 뛰어 지나가오. 이것은 아마 크로포트킨의 <상호 부조론> 속에 말한 시베리아의 사슴의 떼가 꿈이 되어 나온 모양이오. -그러더니 그 사슴의 떼가 다 지나간 뒤에, 그 사슴의 떼가 오던 방향으로서 정임이가 걸어오는 것이 아니라 스르륵 하고 미끄러져 오오. 마치 인형을 밀어 주는 것같이. -"정임아!" -하고 나는 소리를 치고 몸을 일으키려 하였소. -정임의 모양은 나를 잠깐 보고는 미끄러지는 듯이 흘러가 버리오. -나는 정임아, 정임아를 부르고 팔다리를 부둥거렸소. 그러다가 마침내 내 몸이 번쩍 일으켜짐을 깨달았소. 나는 정임의 뒤를 따랐소. -나는 눈 위로 삼림 속으로 정임의 그림자를 따랐소. 보일 듯 안 보일 듯, 잡힐 듯 안 잡힐 듯, 나는 무거운 다리를 끌고 정임을 따랐소. -정임은 이 추운 날이언만 눈과 같이 흰 옷을 입었소. 그 옷은 옛날 로마 여인의 옷과 같이 바람결에 펄렁거렸소. -"오지 마세요. 저를 따라오지 못하십니다." -하고 정임은 눈보라 속에 가리워 버리고 말았소. 암만 불러도 대답이 없고 눈보라가 다 지나간 뒤에도 붉은 별, 푸른 별과 뿔 긴 사슴의 떼뿐이오. 정임은 보이지 아니하였소. 나는 미칠 듯이 정임을 찾고 부르다가 잠을 깨었소. -꿈은 이것뿐이오. 꿈을 깨어서 창 밖을 바라보니 얼음과 눈에 덮인 바이칼호 위에는 새벽의 겨울 달이 비치어 있었소. 저 멀리 검푸르게 보이는 것이 채 얼어붙지 아니한 물이겠지요. 오늘 밤에 바람이 없고 기온이 내리면 그것마저 얼어붙을는지 모르지요. 벌써 살얼음이 잡혔는지도 모르지요. 아아, 그 속은 얼마나 깊을까. 나는 바이칼의 물 속이 관심이 되어서 못 견디겠소. -형! 나는 자백하지 아니할 수 없소. 이 꿈은 내 마음의 어떤 부분을 설명한 것이라고. 그러나 형! 나는 이것을 부정하려오. 굳세게 부정하려오. 나는 이 꿈을 부정하려오. 억지로라도 부정하려오. 나는 결코 내 속에 일어난 혁명을 용인하지 아니하려오. 나는 그것을 혁명으로 인정하지 아니하려오. 아니오! 아니오! 그것은 반란이오! 내 인격의 통일에 대한 반란이오. 단연코 무단적으로 진정하지 아니하면 아니 될 반란이오. 보시오! 나는 굳게 서서 한 걸음도 뒤로 물러서지 아니할 것이오. 만일에 형이 광야에 구르는 내 시체나 해골을 본다든지, 또는 무슨 인연으로 내 무덤을 발견하는 날이 있다고 하면 그 때에 형은 내가 이 모든 반란을 진정한 개선의 군주로 죽은 것을 알아 주시오. -인제 바이칼에 겨울의 석양이 비치었소. 눈을 인 나지막한 산들이 지는 햇빛에 자줏빛을 발하고 있소. 극히 깨끗하고 싸늘한 광경이오. 아디유! -이 편지를 우편에 부치고는 나는 최후의 방랑의 길을 떠나오. 찾을 수도 없고, 편지 받을 수도 없는 곳으로. -부디 평안히 계시오. 일 많이 하시오. 부인께 문안 드리오. 내 가족과 정임의 일 맡기오. 아디유! -이것으로 최석 군의 편지는 끝났다. -나는 이 편지를 받고 울었다. 이것이 일 편의 소설이라 하더라도 슬픈 일이어든, 하물며 내가 가장 믿고 사랑하는 친구의 일임에야. -이 편지를 받고 나는 곧 최석 군의 집을 찾았다. 주인을 잃은 이 집에서는아이들이 마당에서 떠들고 있었다. -"삼청동 아자씨 오셨수. 어머니, 삼청동 아자씨." -하고 최석 군의 작은딸이 나를 보고 뛰어들어갔다. -최석의 부인이 나와 나를 맞았다. -부인은 머리도 빗지 아니하고, 얼굴에는 조금도 화장을 아니하고, 매무시도 흘러내릴 지경으로 정돈되지 못하였다. 일 주일이나 못 만난 동안에 부인의 모양은 더욱 초췌하였다. -"노석헌테서 무슨 기별이나 있습니까." -하고 나는 무슨 말로 말을 시작할지 몰라서 이런 말을 하였다. -"아니오. 왜 그이가 집에 편지하나요?" -하고 부인은 성난 빛을 보이며, -"집을 떠난 지가 근 사십 일이 되건만 엽서 한 장 있나요. 집안 식구가 다 죽기로 눈이나 깜짝할 인가요. 그저 정임이헌테만 미쳐서 죽을지 살지를 모르지요." -하고 울먹울먹한다. -"잘못 아십니다. 부인께서 노석의 마음을 잘못 아십니다. 그런 것이 아닙니다." -하고 나는 확신 있는 듯이 말을 시작하였다. -"노석의 생각을 부인께서 오해하신 줄은 벌써부터 알았지마는 오늘 노석의 편지를 받아보고 더욱 분명히 알았습니다." -하고 나는 부인의 표정의 변화를 엿보았다. -"편지가 왔어요?" -하고 부인은 놀라면서, -"지금 어디 있어요? 일본 있지요?" -하고 질투의 불길을 눈으로 토하였다. -"일본이 아닙니다. 노석은 지금 아라사에 있습니다." -"아라사요?" -하고 부인은 놀라는 빛을 보이더니, -"그럼 정임이를 데리고 아주 아라사로 가케오치를 하였군요." -하고 히스테리컬한 웃음을 보이고는 몸을 한 번 떨었다. -부인은 남편과 정임의 관계를 말할 때마다 이렇게 경련적인 웃음을 웃고 몸을 떠는 것이 버릇이었다. -"아닙니다. 노석은 혼자 가 있습니다. 그렇게 오해를 마세요." -하고 나는 보에 싼 최석의 편지를 내어서 부인의 앞으로 밀어 놓으며, -"이것을 보시면 다 아실 줄 압니다. 어쨌으나 노석은 결코 정임이를 데리고 간 것이 아니요, 도리어 정임이를 멀리 떠나서 간 것입니다. 그러나 그보다도 중대 문제가 있습니다. 노석은 이 편지를 보면 죽을 결심을 한 모양입니다." -하고 부인의 주의를 질투로부터 그 남편에게 대한 동정에 끌어 보려 하였다. -"흥. 왜요? 시체 정사를 하나요? 좋겠습니다. 머리가 허연 것이 딸자식 같은 계집애허구 정사를 한다면 그 꼴 좋겠습니다. 죽으라지요. 죽으래요. 죽는 것이 낫지요. 그리구 살아서 무엇 해요?" -내 뜻은 틀려 버렸다. 부인의 표정과 말에서는 더욱더욱 독한 질투의 안개와 싸늘한 얼음가루가 날았다. -나는 부인의 이 태도에 반감을 느꼈다. 아무리 질투의 감정이 강하다 하기로, 사람의 생명이 제 남편의 생명이 위태함에도 불구하고 오직 제 질투의 감정에만 충실하려 하는 그 태도가 불쾌하였다. 그래서 나는, -"나는 그만큼 말씀해 드렸으니 더 할 말씀은 없습니다. 아무려나 좀더 냉정하게 생각해 보세요. 그리고 이것을 읽어 보세요." -하고 일어나서 집으로 돌아와 버리고 말았다. -도무지 불쾌하기 그지없는 날이다. 최석의 태도까지도 불쾌하다. 달아나긴 왜 달아나? 죽기는 왜 죽어? 못난 것! 기운 없는 것! 하고 나는 최석이가 곁에 섰기나 한 것처럼 눈을 흘기고 중얼거렸다. -최석의 말대로 최석의 부인은 악한 사람이 아니요, 그저 보통인 여성일는지 모른다. 그렇다 하면 여자의 마음이란 너무도 질투의 종이 아닐까. 설사 남편 되는 최석의 사랑이 아내로부터 정임에게로 옮아 갔다고 하더라도 그것을 질투로 회복하려는 것은 어리석은 일이다. 이미 사랑이 떠난 남편을 네 마음대로 가거라 하고 자발적으로 내어버릴 것이지마는 그것을 못 할 사정이 있다고 하면 모르는 체하고 내버려 둘 것이 아닌가. 그래도 이것은 우리네 남자의 이론이요, 여자로는 이런 경우에 질투라는 반응밖에 없도록 생긴 것일까 나는 이런 생각을 하고 있었다. -시계가 아홉시를 친다. -남대문 밖 정거장을 떠나는 열차의 기적 소리가 들린다. -나는 만주를 생각하고, 시베리아를 생각하고 최석을 생각하였다. 마음으로는 정임을 사랑하면서 그 사랑을 발표할 수 없어서 시베리아의 눈 덮인 삼림 속으로 방황하는 최석의 모양이 최석의 꿈 이야기에 있는 대로 눈앞에 선하게 떠나온다. -`사랑은 목숨을 빼앗는다.' -하고 나는 사랑일래 일어나는 인생의 비극을 생각하였다. 그러나 최석의 경우는 보통 있는 공식과는 달라서 사랑을 죽이기 위해서 제 목숨을 죽이는 것이었다. 그렇다 하더라도, -`사랑은 목숨을 빼앗는다.' -는 데에는 다름이 없다. -나는 불쾌도 하고 몸도 으스스하여 얼른 자리에 누웠다. 며느리가 들어온 뒤부터 사랑 생활을 하는 지가 벌써 오 년이나 되었다. 우리 부처란 인제는 한 역사적 존재요, 윤리적 관계에 불과하였다. 오래 사귄 친구와 같은 익숙함이 있고, 집에 없지 못할 사람이라는 필요감도 있지마는 젊은 부처가 가지는 듯한 그런 정은 벌써 없는 지 오래였다. 아내도 나를 대하면 본체만체, 나도 아내를 대하면 본체만체, 무슨 필요가 있어서 말을 붙이더라도 아무쪼록 듣기 싫기를 원하는 듯이 톡톡 내던졌다. 아내도 근래에 와서는 옷도 아무렇게나, 머리도 아무렇게나, 어디 출입할 때밖에는 도무지 화장을 아니 하였다. -그러나 그렇다고 우리 부처의 새가 좋지 못한 것도 아니었다. 서로 소중히 여기는 마음도 있었다. 아내가 안에 있다고 생각하면 마음이 든든하고 또 아내의 말에 의하건대 내가 사랑에 있거니 하면 마음이 든든하다고 한다. -우리 부처의 관계는 이러한 관계다. -나는 한 방에서 혼자 잠을 자는 것이 습관이 되어서 누가 곁에 있으면 잠이 잘 들지 아니하였다. 혹시 어린것들이 매를 얻어맞고 사랑으로 피난을 와서 울다가 내 자리에서 잠이 들면 귀엽기는 귀여워도 잠자리는 편안치 아니하였다. 나는 책을 보고 글을 쓰고 공상을 하고 있으면 족하였다. 내게는 아무 애욕적 요구도 없었다. 이것은 내 정력이 쇠모한 까닭인지 모른다. -그러나 최석의 편지를 본 그 날 밤에는 도무지 잠이 잘 들지 아니하였다. 최석의 편지가 최석의 고민이 내 졸던 의식에 무슨 자극을 준 듯하였다. 적막한 듯하였다. 허전한 듯하였다. 무엇인지 모르나 그리운 것이 있는 것 같았다. -"어, 이거 안되었군." -하고 나는 벌떡 일어나 담배를 피워 물었다. -"나으리 주무셔 곕시오?" -하고 아범이 전보를 가지고 왔다. -"명조 경성 착 남정임" -이라는 것이었다. -"정임이가 와?" -하고 나는 전보를 다시 읽었다. -최석의 그 편지를 보면 최석 부인에게는 어떤 반응이 일어나고 정임에게는 어떤 반응이 일어날까, 하고 생각하면 자못 마음이 편하지 못하였다. -이튿날 아침에 나는 부산서 오는 차를 맞으려고 정거장에를 나갔다. -차는 제 시간에 들어왔다. 남정임은 슈트케이스 하나를 들고 차에서 내렸다. 검은 외투에 검은 모자를 쓴 그의 얼굴은 더욱 해쓱해 보였다. -"선생님!" -하고 정임은 나를 보고 손에 들었던 짐을 땅바닥에 내려놓고, 내 앞으로 왔다. -"풍랑이나 없었나?" -하고 나는 내 손에 잡힌 정임의 손이 싸늘한 것을 근심하였다. -"네. 아주 잔잔했습니다. 저같이 약한 사람도 밖에 나와서 바다 경치를 구경하였습니다." -하고 정임은 사교적인 웃음을 웃었다. 그러나 그의 눈에는 눈물이 있는 것 같았다. -"최 선생님 어디 계신지 아세요?" -하고 정임은 나를 따라 서면서 물었다. -"나도 지금까지 몰랐는데 어제 편지를 하나 받았지." -하는 것이 내 대답이었다. -"네? 편지 받으셨어요? 어디 계십니까?" -하고 정임은 걸음을 멈추었다. -"나도 몰라." -하고 나도 정임과 같이 걸음을 멈추고, -"그 편지를 쓴 곳도 알고 부친 곳도 알지마는 지금 어디로 갔는지 그것은 모르지. 찾을 생각도 말고 편지할 생각도 말라고 했으니까." -하고 사실대로 대답하였다. -"어디야요? 그 편지 부치신 곳이 어디야요? 저 이 차로 따라갈 테야요." -하고 정임은 조급하였다. -"갈 때에는 가더라도 이 차에야 갈 수가 있나." -하고 나는 겨우 정임을 끌고 들어왔다. -정임을 집으로 데리고 와서 대강 말을 하고, 이튿날 새벽 차로 떠난다는 것을, -"가만 있어. 어떻게 계획을 세워 가지고 해야지." -하여 가까스로 붙들어 놓았다. -아침을 먹고 나서 최석 집에를 가 보려고 할 즈음에 순임이가 와서 마루 끝에 선 채로, -"선생님, 어머니가 잠깐만 오십시사구요." -하였다. -"정임이가 왔다." -하고 내가 그러니까, -"정임이가요?" -하고 순임은 깜짝 놀라면서, -"정임이는 아버지 계신 데를 알아요?" -하고 물었다. -"정임이도 모른단다. 너 아버지는 시베리아에 계시고 정임이는 동경 있다가 왔는데 알 리가 있니?" -하고 나는 순임의 생각을 깨뜨리려 하였다. 순임은, -"정임이가 어디 있어요?" -하고 방들 있는 곳을 둘러보며, -"언제 왔어요?" -하고는 그제야 정임에게 대한 반가운 정이 발하는 듯이, -"정임아!" -하고 불러 본다. -"언니요? 여기 있수." -하고 정임이가 머릿방 문을 열고 옷을 갈아입던 채로 고개를 내어민다. -순임은 구두를 차내버리듯이 벗어 놓고 정임의 방으로 뛰어들어간다. -나는 최석의 집에를 가느라고 외투를 입고 모자를 쓰고 정임의 방문을 열어 보았다. 두 처녀는 울고 있었다. -"정임이도 가지. 아주머니 뵈러 안 가?" -하고 나는 정임을 재촉하였다. -"선생님 먼저 가 계셔요." -하고 순임이가 눈물을 씻고 일어나면서, -"이따가 제가 정임이허구 갑니다." -하고 내게 눈을 끔쩍거려 보였다. 갑자기 정임이가 가면 어머니와 정임이와 사이에 어떠한 파란이 일어나지나 아니할까 하고 순임이가 염려하는 것이었다. 순임도 인제는 노성하여졌다고 나는 생각하였다. -"선생님 이 편지가 다 참말일까요?" -하고 나를 보는 길로 최석 부인이 물었다. 최석 부인은 히스테리를 일으킨 사람 모양으로 머리와 손을 떨었다. -나는 참말이냐 하는 것이 무엇을 가리키는 말인지 분명하지 아니하여서, -"노석이 거짓말할 사람입니까?" -하고 대체론으로 대답하였다. -"앉으십쇼. 앉으시란 말씀도 안 하고." -하고 부인은 침착한 모양을 보이려고 빙그레 웃었으나, 그것은 실패였다. -"그게 참말일까요? 정임이가 아기를 뗀 것이 아니라, 폐가 나빠서 피를 토하고 입원하였다는 것이?" -하고 부인은 중대하다는 표정을 가지고 묻는다. -"그럼 그것이 참말이 아니구요. 아직도 그런 의심을 가지고 계십니까. 정임이와 한 방에 있는 학생이 모함한 것이라고 안 그랬어요? 그게 말이 됩니까." -하고 언성을 높여서 대답하였다. -"그럼 왜 정임이가 호텔에서 왜 아버지한테 한 번 안아 달라고 그래요? 그 편지에 쓴 대로 한 번 안아만 보았을까요?" -이것은 부인의 둘째 물음이었다. -"나는 그뿐이라고 믿습니다. 그것이 도리어 깨끗하다는 표라고 믿습니다. 안 그렇습니까?" -하고 나는 딱하다는 표정을 하였다. -"글쎄요." -하고 부인은 한참이나 생각하고 있다가, -"정말 애 아버지가 혼자 달아났을까요? 정임이를 데리고 가케오치한 것이 아닐까요? 꼭 그랬을 것만 같은데." -하고 부인은 괴로운 표정을 감추려는 듯이 고개를 숙인다. -나는 남편에게 대한 아내의 의심이 어떻게 깊은가에 아니 놀랄 수가 없어서, -"허." -하고 한 마디 웃고, -"그렇게 수십 년 동안 부부 생활을 하시고도 그렇게 노석의 인격을 몰라 주십니까. 나는 부인께서 하시는 말씀이 부러 하시는 농담으로밖에 아니 들립니다. 정임이가 지금 서울 있습니다." -하고 또 한 번 웃었다. 정말 기막힌 웃음이었다. -"정임이가 서울 있어요?" -하고 부인은 펄쩍 뛰면서, -"어디 있다가 언제 왔습니까? 그게 정말입니까?" -하고 의아한 빛을 보인다. 꼭 최석이하고 함께 달아났을 정임이가 서울에 있을 리가 없는 것이었다. -"동경서 오늘 아침에 왔습니다. 지금 우리 집에서 순임이허구 이야기를 하고 있으니까 조금 있으면 뵈오러 올 것입니다." -하고 나는 정임이가 분명히 서울 있는 것을 일일이 증거를 들어서 증명하였다. 그리고 우스운 것을 속으로 참았다. 그러나 다음 순간에는 이 병들고 늙은 아내의 질투와 의심으로 괴로워서 덜덜덜덜 떨고 앉았는 것을 가엾게 생각하였다. -정임이가 지금 서울에 있는 것이 더 의심할 여지가 없는 사실임이 판명되매, 부인은 도리어 낙망하는 듯하였다. 그가 제 마음대로 그려 놓고 믿고 하던 모든 철학의 계통이 무너진 것이었다. -한참이나 흩어진 정신을 못 수습하는 듯이 앉아 있더니 아주 기운 없는 어조로, -"선생님 애 아버지가 정말 죽을까요? 정말 영영 집에를 안 돌아올까요?" -하고 묻는다. 그 눈에는 벌써 눈물이 어리었다. -"글쎄요. 내 생각 같아서는 다시는 집에 돌아오지 아니할 것 같습니다. 또 그만치 망신을 했으니, 이제 무슨 낯으로 돌아옵니까. 내라도 다시 집에 돌아올 생각은 아니 내겠습니다." -하고 나는 의식적으로 악의를 가지고 부인의 가슴에 칼을 하나 박았다. -그 칼은 분명히 부인의 가슴에 아프게 박힌 모양이었다. -"선생님. 어떡하면 좋습니까. 애 아버지가 죽지 않게 해 주세요. 그렇지 않아도 순임이년이 제가 걔 아버지를 달아나게나 한 것처럼 원망을 하는데요. 그러다가 정녕 죽으면 어떻게 합니까. 제일 딴 자식들의 원망을 들을까봐 겁이 납니다. 선생님, 어떻게 애 아버지를 붙들어다 주세요." -하고 마침내 참을 수 없이 울었다. 말은 비록 자식들의 원망이 두렵다고 하지마는 질투의 감정이 스러질 때에 그에게는 남편에게 대한 아내의 애정이 막혔던 물과 같이 터져 나온 것이라고 나는 해석하였다. -"글쎄, 어디 있는 줄 알고 찾습니까. 노석의 성미에 한번 아니 한다고 했으면 다시 편지할 리는 만무하다고 믿습니다." -하여 나는 부인의 가슴에 둘째 칼날을 박았다. -나는 비록 최석의 부인이 청하지 아니하더라도 최석을 찾으러 떠나지 아니하면 아니 될 의무를 진다. 산 최석을 못 찾더라도 최석의 시체라도, 무덤이라도, 죽은 자리라도, 마지막 있던 곳이라도 찾아보지 아니하면 아니 될 의무를 깨닫는다. -그러나 시국이 변하여 그 때에는 아라사에 가는 것은 여간 곤란한 일이 아니었다. 그 때에는 북만의 풍운이 급박하여 만주리를 통과하기는 사실상 불가능에 가까웠다. 마점산(馬占山) 일파의 군대가 흥안령, 하일라르 등지에 웅거하여 언제 대충돌이 폭발될는지 모르던 때였다. 이 때문에 시베리아에 들어가기는 거의 절망 상태라고 하겠고, 또 관헌도 아라사에 들어가는 여행권을 잘 교부할 것 같지 아니하였다. -부인은 울고, 나는 이런 생각 저런 생각 하고 있는 동안에 문 밖에는 순임이, 정임이가 들어오는 소리가 들렸다. -"아이, 정임이냐." -하고 부인은 반갑게 허리 굽혀 인사하는 정임의 어깨에 손을 대고, -"자 앉아라. 그래 인제 병이 좀 나으냐…… 수척했구나. 더 노성해지구 반 년도 못 되었는데." -하고 정임에게 대하여 애정을 표하는 것을 보고 나는 의외지마는 다행으로 생각하였다. 나는 정임이가 오면 보기 싫은 한 신을 연출하지 않나 하고 근심하였던 것이다. -"희 잘 자라요?" -하고 정임은 한참이나 있다가 비로소 입을 열었다. -"응, 잘 있단다. 컸나 가 보아라." -하고 부인은 더욱 반가운 표정을 보인다. -"어느 방이야?" -하고 정임은 선물 보퉁이를 들고 순임과 함께 나가 버린다. 여자인 정임은 희와 순임과 부인과 또 순임의 다른 동생에게 선물 사 오는 것을 잊어버리지 아니하였다. -정임과 순임은 한 이삼 분 있다가 돌아왔다. 밖에서 희가 무엇이라고 지절대는 소리가 들린다. 아마 정임이가 사다 준 선물을 받고 좋아하는 모양이다. -정임은 들고 온 보퉁이에서 여자용 배스로브 하나를 내어서 부인에게주며, -"맞으실까?" -하였다. -"아이 그건 무어라고 사 왔니?" -하고 부인은 좋아라고 입어 보고, 이리 보고 저리 보고 하면서, -"난 이런 거 처음 입어 본다." -하고 자꾸 끈을 동여맨다. -"정임이가 난 파자마를 사다 주었어." -하고 순임은 따로 쌌던 굵은 줄 있는 융 파자마를 내어서 경매장 사람 모양으로 흔들어 보이며, -"어머니 그 배스로브 나 주우. 어머닌 늙은이가 그건 입어서 무엇 하우?" -하고 부인이 입은 배스로브를 벗겨서 제가 입고 두 호주머니에 손을 넣고 어기죽어기죽하고 서양 부인네 흉내를 낸다. -"저런 말괄량이가 너도 정임이처럼 좀 얌전해 보아라." -하고 부인은 순임을 향하여 눈을 흘긴다. -이 모양으로 부인과 정임과의 대면은 가장 원만하게 되었다. -그러나 부인은 정임에게 최석의 편지를 보이기를 원치 아니하였다. 편지가 왔다는 말조차 입 밖에 내지 아니하였다. 그러나 순임이가 정임에게 대하여 표하는 애정은 여간 깊지 아니하였다. 그 둘은 하루 종일 같이 있었다. 정임은 그 날 저녁에 나를 보고, -"순임이헌테 최 선생님 편지 사연은 다 들었어요. 순임이가 그 편지를 훔쳐다가 얼른얼른 몇 군데 읽어도 보았습니다. 순임이가 저를 퍽 동정하면서 절더러 최 선생을 따라가 보라고 그래요. 혼자 가기가 어려우면 자기허구 같이 가자고. 가서 최 선생을 데리고 오자고. 어머니가 못 가게 하거든 몰래 둘이 도망해 가자고. 그래서 그러자고 그랬습니다. 안됐지요. 선생님?" -하고 저희끼리 작정은 다 해 놓고는 슬쩍 내 의향을 물었다. -"젊은 여자 단둘이서 먼 여행을 어떻게 한단 말이냐? 게다가 지금 북만주 형세가 대단히 위급한 모양인데. 또 정임이는 그 건강 가지고 어디를 가, 이 추운 겨울에?" -하고 나는 이런 말이 다 쓸데없는 말인 줄 알면서도 어른으로서 한 마디 안 할 수 없어서 하였다. 정임은 더 제 뜻을 주장하지도 아니하였다. -그 날 저녁에 정임은 순임의 집에서 잤는지 집에 오지를 아니하였다. -나는 이 일을 어찌하면 좋은가, 이 두 여자의 행동을 어찌하면 좋은가 하고 혼자 끙끙 생각하고 있었다. -이튿날 나는 궁금해서 최석의 집에를 갔더니 부인이, -"우리 순임이 댁에 갔어요?" -하고 의외의 질문을 하였다. -"아니오." -하고 나는 놀랐다. -"그럼, 이것들이 어딜 갔어요? 난 정임이허구 댁에서 잔 줄만 알았는데." -하고 부인은 무슨 불길한 것이나 본 듯이 몸을 떤다. 히스테리가 일어난 것이었다. -나는 입맛을 다시었다. 분명히 이 두 여자가 시베리아를 향하고 떠났구나 하였다. -그 날은 소식이 없이 지났다. 그 이튿날도 소식이 없이 지났다. -최석 부인은 딸까지 잃어버리고 미친 듯이 울고 애통하다가 머리를 싸매고 누워 버리고 말았다. -정임이와 순임이가 없어진 지 사흘 만에 아침 우편에 편지 한 장을 받았다. 그 봉투는 봉천 야마도 호텔 것이었다. 그 속에는 편지 두 장이 들어 있었다. 한 장은 , -선생님! 저는 아버지를 위하여, 정임을 위하여 정임과 같이 집을 떠났습니다. -어머님께서 슬퍼하실 줄은 알지마는 저희들이 다행히 아버지를 찾아서 모시고 오면 어머니께서도 기뻐하실 것을 믿습니다. 저희들이 가지 아니하고는 아버지는 살아서 돌아오실 것 같지 아니합니다. 아버지를 이처럼 불행하시게 한 죄는 절반은 어머니께 있고, 절반은 제게 있습니다. 저는 아버지 일을 생각하면 가슴이 미어지고 이가 갈립니다. 저는 아무리 해서라도 아버지를 찾아내어야겠습니다. -저는 정임을 무한히 동정합니다. 저는 어려서 정임을 미워하고 아버지를 미워하였지마는 지금은 아버지의 마음과 정임의 마음을 알아볼 만치 자랐습니다. -선생님! 저희들은 둘이 손을 잡고 어디를 가서든지 아버지를 찾아내겠습니다. 하나님의 사자가 낮에는 구름이 되고 밤에는 별이 되어서 반드시 저희들의 앞길을 인도할 줄 믿습니다. -선생님, 저희 어린것들의 뜻을 불쌍히 여기셔서 돈 천 원만 전보로 보내 주시기를 바랍니다. -만일 만주리로 가는 길이 끊어지면 몽고로 자동차로라도 가려고 합니다. 아버지 편지에 적힌 F역의 R씨를 찾고, 그리고 바이칼 호반의 바이칼리스코에를 찾아, 이 모양으로 찾으면 반드시 아버지를 찾아 내고야 말 것을 믿습니다. -선생님, 돈 천 원만 봉천 야마도 호텔 최순임 이름으로 부쳐 주세요. 그리고 어머니헌테는 아직 말씀 말아 주세요. -선생님. 이렇게 걱정하시게 해서 미안합니다. 용서하세요. -순임 상서 -이렇게 써 있다. 또 한 장에는, -선생님! 저는 마침내 돌아오지 못할 길을 떠나나이다. 어디든지 최 선생님을 뵈옵는 곳에서 이 몸을 묻어 버리려 하나이다. 지금 또 몸에 열이 나는 모양이요, 혈담도 보이오나 최 선생을 뵈올 때까지는 아무리 하여서라도 이 목숨을 부지하려 하오며, 최 선생을 뵈옵고 제가 진 은혜를 감사하는 한 말씀만 사뢰면 고대 죽사와도 여한이 없을까 하나이다. -순임 언니가 제게 주시는 사랑과 동정은 오직 눈물과 감격밖에 더 표할 말씀이 없나이다. 순임 언니가 저를 보호하여 주니 마음이 든든하여이다……. -이라고 하였다. -편지를 보아야 별로 놀랄 것은 없었다. 다만 말괄량이로만 알았던 순임의 속에 어느새에 그러한 감정이 발달하였나 하는 것을 놀랄 뿐이었다. -그러나 걱정은 이것이다. 순임이나 정임이나 다 내가 감독해야 할 처지에 있거늘 그들이 만리 긴 여행을 떠난다고 하니 감독자인 내 태도를 어떻게 할까 하는 것이다. -나는 편지를 받는 길로 우선 돈 천 원을 은행에 가서 찾아다 놓았다. -암만해도 내가 서울에 가만히 앉아서 두 아이에게 돈만 부쳐 주는 것이 인정에 어그러지는 것 같아서 나는 여러 가지로 주선을 하여서 여행의 양해를 얻어 가지고 봉천을 향하여 떠났다. -내가 봉천에 도착한 것은 밤 열시가 지나서였다. 순임과 정임은 자리옷 바람으로 내 방으로 달려와서 반가워하였다. 그들이 반가워하는 양은 실로 눈물이 흐를 만하였다. -"아이구 선생님!" -"아이구 어쩌면!" -하는 것이 그들의 내게 대한 인사의 전부였다. -"정임이 어떠오?" -하고 나는 순임의 편지에 정임이가 열이 있단 말을 생각하였다. -"무어요. 괜찮습니다." -하고 정임은 웃었다. -전등빛에 보이는 정임의 얼굴은 그야말로 대리석으로 깎은 듯하였다. 여위고 핏기가 없는 것이 더욱 정임의 용모에 엄숙한 맛을 주었다. -"돈 가져오셨어요?" -하고 순임이가 어리광 절반으로 묻다가 내가 웃고 대답이 없음을 보고, -"우리를 붙들러 오셨어요?" -하고 성내는 양을 보인다. -"그래 둘이서들 간다니 어떻게 간단 말인가. 시베리아가 어떤 곳에 붙었는지 알지도 못하면서." -하고 나는 두 사람이 그리 슬퍼하지 아니하는 순간을 보는 것이 다행하여서 농담삼아 물었다. -"왜 몰라요? 시베리아가 저기 아니야요?" -하고 순임이가 산해관 쪽을 가리키며, -"우리도 지리에서 배워서 다 알아요. 어저께 하루 종일 지도를 사다 놓고 연구를 하였답니다. 봉천서 신경, 신경서 하얼빈, 하얼빈에서 만주리, 만주리에서 이르쿠츠크, 보세요, 잘 알지 않습니까. 또 만일 중동 철도가 불통이면 어떻게 가는고 하니 여기서 산해관을 가고, 산해관서 북경을 가지요. 그리고는 북경서 장가구를 가지 않습니까. 장가구서 자동차를 타고 몽고를 통과해서 가거든요. 잘 알지 않습니까." -하고 정임의 허리를 안으며, -"그렇지이?" -하고 자신 있는 듯이 웃는다. -"또 몽고로도 못 가게 되어서 구라파를 돌게 되면?" -하고 나는 교사가 생도에게 묻는 모양으로 물었다. -"네, 저 인도양으로 해서 지중해로 해서 프랑스로 해서 그렇게 가지요." -"허, 잘 아는구나." -하고 나는 웃었다. -"그렇게만 알아요? 또 해삼위로 해서 가는 길도 알아요. 저희를 어린애로 아시네." -"잘못했소." -"하하." -"후후." -사실 그들은 벌써 어린애들은 아니었다. 순임도 벌써 그 아버지의 말할 수 없는 사정에 동정할 나이가 되었다. 순임이가 기어다닌 것은 본 나로는 이것도 이상하게 보였다. 나는 벌써 나이 많았구나 하는 생각이 나지 아니할 수 없었다. -나는 잠 안 드는 하룻밤을 지내면서 옆방에서 정임이가 기침을 짓는 소리를 들었다. 그 소리는 내 가슴을 아프게 하였다. -이튿날 나는 두 사람에게 돈 천 원을 주어서 신경 가는 급행차를 태워 주었다. 대륙의 이 건조하고 추운 기후에 정임의 병든 폐가 견디어 날까 하고 마음이 놓이지 아니하였다. 그러나 나는 그들을 가라고 권할 수는 있어도 가지 말라고 붙들 수는 없었다. 다만 제 아버지, 제 애인을 죽기 전에 만날 수 있기만 빌 뿐이었다. -나는 두 아이를 북쪽으로 떠나 보내고 혼자 여관에 들어와서 도무지 정신을 진정하지 못하여 술을 먹고 잊으려 하였다. 그러다가 그 날 밤차로 서울로 돌아왔다. -이튿날 아침에 나는 최석 부인을 찾아서 순임과 정임이가 시베리아로 갔단 말을 전하였다. -그 때에 최 부인은 거의 아무 정신이 없는 듯하였다. 아무 말도 하지 아니하고 울고만 있었다. -얼마 있다가 부인은, -"그것들이 저희들끼리 가서 괜찮을까요?" -하는 한 마디를 할 뿐이었다. -며칠 후에 순임에게서 편지가 왔다. 그것은 하얼빈에서 부친 것이었다. -하얼빈을 오늘 떠납니다. 하얼빈에 와서 아버지 친구 되시는 R소장을 만나뵈옵고 아버지 일을 물어 보았습니다. 그리고 저희 둘이서 찾아 떠났다는 말씀을 하였더니 R소장이 대단히 동정하여서 여행권도 준비해 주시기로 저희는 아버지를 찾아서 오늘 오후 모스크바 가는 급행으로 떠납니다. 가다가 F역에 내리기는 어려울 듯합니다. 정임의 건강이 대단히 좋지 못합니다. 일기가 갑자기 추워지는 관계인지 정임의 신열이 오후면 삼십팔 도를 넘고 기침도 대단합니다. 저는 염려가 되어서 정임더러 하얼빈에서 입원하여 조리를 하라고 권하였지마는 도무지 듣지를 아니합니다. 어디까지든지 가는 대로 가다가 더 못 가게 되면 그 곳에서 죽는다고 합니다. -저는 그 동안 며칠 정임과 같이 있는 중에 정임이가 어떻게 아름답고 높고 굳세게 깨끗한 여자인 것을 발견하였습니다. 저는 지금까지 정임을 몰라본 것을 부끄럽게 생각합니다. 그리고 또 제 아버지께서 어떻게 갸륵한 어른이신 것을 인제야 깨달았습니다. 자식 된 저까지도 아버지와 정임과의 관계를 의심하였습니다. 의심하는 것보다는 세상에서 말하는 대로 믿고 있었습니다. 그러나 정임을 만나 보고 정임의 말을 듣고 아버지께서 선생님께 드린 편지가 모두 참인 것을 깨달았습니다. 아버지께서는 친구의 의지 없는 딸인 정임을 당신의 친혈육인 저와 꼭 같이 사랑하려고 하신 것이었습니다. 그것이 얼마나 갸륵한 일입니까. 그런데 제 어머니와 저는 그 갸륵하신 정신을 몰라보고 오해하였습니다. 어머니는 질투하시고 저는 시기하였습니다. 이것이 얼마나 아버지를 그렇게 갸륵하신 아버지를 몰라뵈온 것입니다. 이것이 얼마나 부끄럽고 원통한 일입니까. -선생님께서도 여러 번 아버지의 인격이 높다는 것을 저희 모녀에게 설명해 주셨습니다마는 마음이 막힌 저는 선생님의 말씀도 믿지 아니하였습니다. -선생님, 정임은 참으로 아버지를 사랑합니다. 정임에게는 이 세상에 아버지밖에는 사랑하는 아무것도 없이, 그렇게 외●으로, 그렇게 열렬하게 아버지를 사모하고 사랑합니다. 저는 잘 압니다. 정임이가 처음에는 아버지로 사랑하였던 것을, 그러나 어느 새에 정임의 아버지에게 대한 사랑이 무엇인지 모를 사랑으로 변한 것을, 그것이 연애냐 하고 물으면 정임은 아니라고 할 것입니다. 정임의 그 대답은 결코 거짓이 아닙니다. 정임은 숙성하지마는 아직도 극히 순결합니다. 정임은 부모를 잃은 후에 아버지밖에 사랑한 사람이 없습니다. 또 아버지에게밖에 사랑받던 일도 없습니다. 그러니깐 정임은 아버지를 그저 사랑합니다 전적으로 사랑합니다. 선생님, 정임의 사랑에는 아버지에 대한 자식의 사랑, 오라비에 대한 누이의 사랑, 사내 친구에 대한 여자 친구의 사랑, 애인에 대한 애인의 사랑, 이 밖에 존경하고 숭배하는 선생에 대한 제자의 사랑까지, 사랑의 모든 종류가 포함되어 있는 것을 저는 발견하였습니다. -선생님, 정임의 정상은 차마 볼 수가 없습니다. 아버지의 안부를 근심하는 양은 제 몇십 배나 되는지 모르게 간절합니다. 정임은 저 때문에 아버지가 불행하게 되셨다고 해서 차마 볼 수 없게 애통하고 있습니다. 진정을 말씀하오면 저는 지금 아버지보다도 어머니보다도 정임에게 가장 동정이 끌립니다. 선생님, 저는 아버지를 찾아가는 것이 아니라 정임을 돕기 위하여 간호하기 위하여 가는 것 같습니다. -선생님, 저는 아직 사랑이란 것이 무엇인지를 모릅니다. 그러나 정임을 보고 사랑이란 것이 어떻게 신비하고 열렬하고 놀라운 것인가를 안 것 같습니다. -순임의 편지는 계속된다. -선생님, 하얼빈에 오는 길에 송화강 굽이를 볼 때에는 정임이가 어떻게나 울었는지, 그것은 차마 볼 수가 없었습니다. 아버지께서 송화강을 보시고 감상이 깊으셨더란 것을 생각한 것입니다. 무인지경으로, 허옇게 눈이 덮인 벌판으로 흘러가는 송화강 굽이, 그것은 슬픈 풍경입니다. 아버지께서 여기를 지나실 때에는 마른 풀만 있는 광야였을 것이니 그 때에는 더욱 황량하였을 것이라고 정임은 말하고 웁니다. -정임은 제가 아버지를 아는 것보다 아버지를 잘 아는 것 같습니다. 평소에 아버지와는 그리 접촉이 없건마는 정임은 아버지의 의지력, 아버지의 숨은 열정, 아버지의 성미까지 잘 압니다. 저는 정임의 말을 듣고야 비로소 참 그래, 하는 감탄을 발한 일이 여러 번 있습니다. -정임의 말을 듣고야 비로소 아버지가 남보다 뛰어나신 인물인 것을 깨달았습니다. 아버지는 정의감이 굳세고 겉으로는 싸늘하도록 이지적이지마는 속에는 불 같은 열정이 있으시고, 아버지는 쇠 같은 의지력과 칼날 같은 판단력이 있어서 언제나 주저하심이 없고 또 흔들리심이 없다는 것, 아버지께서는 모든 것을 용서하고 모든 것을 호의로 해석하여서 누구를 미워하거나 원망하심이 없는 등, 정임은 아버지의 마음의 목록과 설명서를 따로 외우는 것처럼 아버지의 성격을 설명합니다. 듣고 보아서 비로소 아버지의 딸인 저는 내 아버지가 어떤 아버지인가를 알았습니다. -선생님, 이해가 사랑을 낳는단 말씀이 있지마는 저는 정임을 보아서 사랑이 이해를 낳는 것이 아닌가 합니다. -어쩌면 어머니와 저는 평생을 아버지를 모시고 있으면서도 아버지를 몰랐습니까. 이성이 무디고 양심이 흐려서 그랬습니까. 정임은 진실로 존경할 여자입니다. 제가 남자라 하더라도 정임을 아니 사랑하고는 못 견디겠습니다. -아버지는 분명 정임을 사랑하신 것입니다. 처음에는 친구의 딸로, 다음에는 친딸과 같이, 또 다음에는 무엇인지 모르게 뜨거운 사랑이 생겼으리라고 믿습니다. 그것을 아버지는 죽인 것입니다. 그것을 죽이려고 이 달할 수 없는 사랑을 죽이려고 시베리아로 달아나신 것입니다. 인제야 아버지께서 선생님께 하신 편지의 뜻이 알아진 것 같습니다. 백설이 덮인 시베리아의 삼림 속으로 혼자 헤매며 정임에게로 향하는 사랑을 죽이려고 무진 애를 쓰시는 그 심정이 알아지는 것 같습니다. -선생님 이것이 얼마나 비참한 일입니까. 저는 정임의 짐에 지니고 온 일기를 보다가 이러한 구절을 발견하였습니다. -선생님. 저는 세인트 오거스틴의 <참회록>을 절반이나 다 보고 나도 잠이 들지 아니합니다. 잠이 들기 전에 제가 항상 즐겨하는 아베마리아의 노래를 유성기로 듣고 나서 오늘 일기를 쓰려고 하니 슬픈 소리만 나옵니다. -사랑하는 어른이여. 저는 멀리서 당신을 존경하고 신뢰하는 마음에서만 살아야 할 것을 잘 압니다. 여기에서 영원한 정지를 하지 아니하면 아니 됩니다. 비록 제 생명이 괴로움으로 끊어지고 제 혼이 피어 보지 못하고 스러져 버리더라도 저는 이 멀리서 바라보는 존경과 신뢰의 심경에서 한 발자국이라도 옮기지 않아야 할 것을 잘 압니다. 나를 위하여 놓여진 생의 궤도는 나의 생명을 부인하는 억지의 길입니다. 제가 몇 년 전 기숙사 베드에서 이런 밤에 내다보면 즐겁고 아름답던 내 생의 꿈은 다 깨어졌습니다. -제 영혼의 한 조각이 먼 세상 알지 못할 세계로 떠다니고 있습니다. 잃어버린 마음 조각 어찌하다가 제가 이렇게 되었는지 모릅니다. -피어 오르는 생명의 광채를 스스로 사형에 처하지 아니하면 아니 될 때 어찌 슬픔이 없겠습니까. 이것은 현실로 사람의 생명을 죽이는 것보다 더 무서운 죄가 아니오리까. 나의 세계에서 처음이요 마지막으로 발견한 빛을 어둠 속에 소멸해 버리라는 이 일이 얼마나 떨리는 직무오리까. 이 허깨비의 형의 사람이 살기 위하여 내 손으로 칼을 들어 내 영혼의 환희를 쳐야 옳습니까. 저는 하나님을 원망합니다. -이렇게 씌어 있습니다. 선생님 이것이 얼마나 피 흐르는 고백입니까. -선생님, 저는 정임의 이 고백을 보고 무조건으로 정임의 사랑을 시인합니다. 선생님, 제 목숨을 바쳐서 하는 일에 누가 시비를 하겠습니까. 더구나 그 동기에 티끌만큼도 불순한 것이 없음에야 무조건으로 시인하지 아니하고 어찌합니까. -바라기는 정임의 병이 크게 되지 아니하고 아버지께서 무사히 계셔서 속히 만나뵙게 되는 것입니다마는 앞길이 망망하여 가슴이 두근거림을 금치 못합니다. 게다가 오늘은 함박눈이 퍼부어서 천지가 온통 회색으로 한 빛이 되었으니 더욱 전도가 막막합니다. 그러나 선생님 저는 앓는 정임을 데리고 용감하게 시베리아 길을 떠납니다. -한 일 주일 후에 또 편지 한 장이 왔다. 그것도 순임의 편지여서 이러한 말이 있었다. -……오늘 새벽에 흥안령을 지났습니다. 플랫폼의 한란계는 영하 이십삼 도를 가리켰습니다. 사람들의 얼굴은 솜털에 성에가 슬어서 남녀 노소 할 것 없이 하얗게 분을 바른 것 같습니다. 유리에 비친 내 얼굴도 그와 같이 흰 것을 보고 놀랐습니다. 숨을 들이쉴 때에는 코털이 얼어서 숨이 끊기고 바람결이 지나가면 눈물이 얼어서 눈썹이 마주 붙습니다. 사람들은 털과 가죽에 싸여서 곰같이 보입니다. -또 이런 말도 있었다. -아라사 계집애들이 우유병들을 품에 품고 서서 손님이 사기를 기다리고 있습니다. 저도 두 병을 사서 정임이와 나누어 먹었습니다. 우유는 따뜻합니다. 그것을 식히지 아니할 양으로 품에 품고 섰던 것입니다. -또 이러한 구절도 있었다. -정거장에 닿을 때마다 저희들은 밖을 내다봅니다. 행여나 아버지가 거기 계시지나 아니할까 하고요. 차가 어길 때에는 더구나 마음이 조입니다. 아버지가 그 차를 타고 지나가시지나 아니하는가 하고요. 그리고는 정임은 웁니다. 꼭 뵈올 어른을 놓쳐나 버린 듯이. -그리고는 이 주일 동안이나 소식이 없다가 편지 한 장이 왔다. 그것은 정임의 글씨였다. -선생님, 저는 지금 최 선생께서 계시던 바이칼 호반의 그 집에 와서 홀로 누웠습니다. 순임은 주인 노파와 함께 F역으로 최 선생을 찾아서 오늘 아침에 떠나고 병든 저만 혼자 누워서 얼음에 싸인 바이칼 호의 눈보라치는 바람 소리를 듣고 있습니다. 열은 삼십팔 도로부터 구 도 사이를 오르내리고 기침은 나고 몸의 괴로움을 견딜 수 없습니다. 그러하오나 선생님, 저는 하나님을 불러서 축원합니다. 이 실낱 같은 생명이 다 타 버리기 전에 최 선생의 낯을 다만 일 초 동안이라도 보여지이라고. 그러하오나 선생님, 이 축원이 이루어지겠습니까. -저는 한사코 F역까지 가려 하였사오나 순임 형이 울고 막사오며 또 주인 노파가 본래 미국 사람과 살던 사람으로 영어를 알아서 순임 형의 도움이 되겠기로 저는 이 곳에 누워 있습니다. 순임 형은 기어코 아버지를 찾아 모시고 오마고 약속하였사오나 이 넓은 시베리아에서 어디 가서 찾겠습니까. -선생님, 저는 죽음을 봅니다. 죽음이 바로 제 앞에 와서 선 것을 봅니다. 그의 손은 제 여윈 손을 잡으려고 들먹거림을 봅니다. -선생님, 죽은 뒤에도 의식이 남습니까. 만일 의식이 남는다 하면 죽은 뒤에도 이 아픔과 괴로움을 계속하지 아니하면 아니 됩니까. 죽은 뒤에는 오직 영원한 어둠과 잊어버림이 있습니까. 죽은 뒤에는 혹시나 생전에 먹었던 마음을 자유로 펼 도리가 있습니까. 이 세상에서 그립고 사모하던 이를 죽은 뒤에는 자유로 만나 보고 언제나 마음껏 같이할 수가 있습니까. 그런 일도 있습니까. 이런 일을 바라는 것도 죄가 됩니까. -정임의 편지는 더욱 절망적인 어조로 찬다. -저는 처음 병이 났을 때에는 죽는 것이 싫고 무서웠습니다. 그러나 지금은 죽는 것이 조금도 무섭지 아니합니다. 다만 차마 죽지 못하는 것이 한. -하고는 `다만 차마' 이하를 박박 지워 버렸다. 그리고는 새로 시작하여 나와내 가족에게 대한 문안을 하고는 끝을 막았다. -나는 이 편지를 받고 울었다. 무슨 큰 비극이 가까운 것을 예상하게 하였다. -그 후 한 십여 일이나 지나서 전보가 왔다. 그것은 영문으로 씌었는데, -"아버지 병이 급하다. 나로는 어쩔 수 없다. 돈 가지고 곧 오기를 바란다." -하고 그 끝에 B호텔이라고 주소를 적었다. 전보 발신국이 이르쿠츠크인 것을 보니 B호텔이라 함은 이르쿠츠크인 것이 분명하였다. -나는 최석 부인에게 최석이가 아직 살아 있다는 것을 전하고 곧 여행권 수속을 하였다. 절망으로 알았던 여행권은 사정이 사정인만큼 곧 발부되었다. -나는 비행기로 여의도를 떠났다. 백설에 개개한 땅을, 남빛으로 푸른 바다를 굽어보는 동안에 대련을 들러 거기서 다른 비행기를 갈아타고 봉천, 신경, 하얼빈을 거쳐, 치치하얼에 들렀다가 만주리로 급행하였다. -웅대한 대륙의 설경도 나에게 아무러한 인상도 주지 못하였다. 다만 푸른 하늘과 희고 평평한 땅과의 사이로 한량 없이 허공을 날아간다는 생각밖에 없었다. 그것은 사랑하는 두 친구가 목숨이 경각에 달린 것을 생각할 때에 마음에 아무 여유도 없는 까닭이었다. -만주리에서도 비행기를 타려 하였으나 소비에트 관헌이 허락을 아니 하여 열차로 갈 수밖에 없었다. -초조한 몇 밤을 지나고 이르쿠츠크에 내린 것이 오전 두시. 나는 B호텔로 이스보스치카라는 마차를 몰았다. 죽음과 같이 고요하게 눈 속에 자는 시간에는 여기저기 전등이 반짝거릴 뿐, 이따금 밤의 시가를 경계하는 병정들의 눈이 무섭게 빛나는 것이 보였다. -B호텔에서 미스 초이(최 양)를 찾았으나 순임은 없고 어떤 서양 노파가 나와서, -"유 미스터 Y?" -하고 의심스러운 눈으로 나를 보았다. -그렇다는 내 대답을 듣고는 노파는 반갑게 손을 내밀어서 내 손을 잡았다. -나는 넉넉하지 못한 영어로 그 노파에게서 최석이가 아직 살았다는 말과 정임의 소식은 들은 지 오래라는 말과 최석과 순임은 여기서 삼십 마일이나 떨어진 F역에서도 썰매로 더 가는 삼림 속에 있다는 말을 들었다. -나는 그 밤을 여기서 지내고 이튿날 아침에 떠나는 완행차로 그 노파와 함께 이르쿠츠크를 떠났다. -이 날도 천지는 오직 눈뿐이었다. 차는 가끔 삼림 중으로 가는 모양이나 모두 회색빛에 가리워서 분명히 보이지를 아니하였다. -F역이라는 것은 삼림 속에 있는 조그마한 정거장으로 집이라고는 정거장 집밖에 없었다. 역부 두엇이 털옷에 하얗게 눈을 뒤쓰고 졸리는 듯이 오락가락할 뿐이었다. -우리는 썰매 하나를 얻어 타고 어디가 길인지 분명치도 아니한 눈 속으로 말을 몰았다. -바람은 없는 듯하지마는 그래도 눈발을 한편으로 비끼는 모양이어서 아름드리 나무들의 한쪽은 하얗게 눈으로 쌓이고 한쪽은 검은 빛이 더욱 돋보였다. 백 척은 넘을 듯한 꼿꼿한 침엽수(전나무 따윈가)들이 어디까지든지, 하늘에서 곧 내려박은 못 모양으로, 수없이 서 있는 사이로 우리 썰매는 간다. 땅에 덮인 눈은 새로 피워 놓은 솜같이 희지마는 하늘에서 내리는 눈은 구름빛과 공기빛과 어울려서 밥 잦힐 때에 굴뚝에서 나오는 연기와 같이 연회색이다. -바람도 불지 아니하고 새도 날지 아니하건마는 나무 높은 가지에 쌓인 눈이 이따금 덩치로 떨어져서는 고요한 수풀 속에 작은 동요를 일으킨다. -우리 썰매가 가는 길이 자연스러운 복잡한 커브를 도는 것을 보면 필시 얼음 언 개천 위로 달리는 모양이었다. -한 시간이나 달린 뒤에 우리 썰매는 늦은 경사지를 올랐다. 말을 어거하는 아라사 사람은 쭈쭈쭈쭈, 후르르 하고 주문을 외우듯이 입으로 말을 재촉하고 고삐를 이리 들고 저리 들어 말에게 방향을 가리킬 뿐이요, 채찍은 보이기만하고 한 번도 쓰지 아니하였다. 그와 말과는 완전히 뜻과 정이 맞는 동지인 듯하였다. -처음에는 몰랐으나 차차 추워짐을 깨달았다. 발과 무르팍이 시렸다. -"얼마나 머오?" -하고 나는 오래간만에 입을 열어서 노파에게 물었다. 노파는 털수건으로 머리를 싸매고 깊숙한 눈만 남겨 가지고 실신한 사람 모양으로 허공만 바라보고 있다가, 내가 묻는 말에 비로소 잠이나 깬 듯이, -"멀지 않소. 인젠 한 십오 마일." -하고는 나를 바라보았다. 그 눈은 아마 웃는 모양이었다. -그 얼굴, 그 눈, 그 음성이 모두 이 노파가 인생 풍파의 슬픈 일 괴로운 일에 부대끼고 지친 것을 표하였다. 그리고 죽는 날까지 살아간다 하는 듯하였다. -경사지를 올라서서 보니 그것은 한 산등성이였다. 방향은 알 수 없으나 우리가 가는 방향에는 더 높은 등성이가 있는 모양이나 다른 곳은 다 이보다 낮은 것 같아서 하얀 눈바다가 끝없이 보이는 듯하였다. 그 눈보라는 들쑹날쑹이 있는 것을 보면 삼림의 꼭대기인 것이 분명하였다. 더구나 여기저기 뾰족뾰족 눈송이 붙을 수 없는 마른 나뭇가지가 거뭇거뭇 보이는 것을 보아서 그러하였다. 만일 눈이 걷혀 주었으면 얼마나 안계가 넓으랴, 최석 군이 고민하는 가슴을 안고 이리로 헤매었구나 하면서 나는 목을 둘러서 사방을 바라보았다. -우리는 그 등성이를 내려갔다. 말이 미처 발을 땅에 놓을 수가 없는 정도로 빨리 내려갔다. 여기는 산불이 났던 자리인 듯하여 거뭇거뭇 불탄 자국 있는 마른 나무들이 드문드문 서 있었다. 그 나무들은 찍어 가는 사람도 없으매 저절로 썩어서 없어지기를 기다릴 수밖에 없었다. 그들은 나서 아주 썩어 버리기까지 천 년 이상은 걸린다고 하니 또한 장한 일이다. -이 대삼림에 불이 붙는다 하면 그것은 장관일 것이다. 달밤에 높은 곳에서 이 경치를 내려다본다 하면 그도 장관일 것이요, 여름에 한창 기운을 펼 때도 장관일 것이다. 나는 오뉴월경에 시베리아를 여행하는 이들이 끝없는 꽃바다를 보았다는 기록을 생각하였다. -"저기요!" -하는 노파의 말에 나는 생각의 줄을 끊었다. 저기라고 가리키는 곳을 보니 거기는 집이라고 생각되는 물건이 나무 사이로 보였다. 창이 있으니 분명 집이었다. -우리 이스보스치카가 가까이 오는 것을 보았는지, 그 집 같은 물건의 문 같은 것이 열리며 검은 외투 입은 여자 하나가 팔을 허우적거리며 뛰어나온다. 아마 소리도 치는 모양이겠지마는 그 소리는 아니 들렸다. 나는 그것이 순임인 줄을 얼른 알았다. 또 순임이밖에 될 사람도 없었다. -순임은 한참 달음박질로 오다가 눈이 깊어서 걸음을 걷기가 힘이 드는지 멈칫 섰다. 그의 검은 외투는 어느덧 흰 점으로 얼려져 가지고 어깨는 희게 되는 것이 보였다. -순임의 갸름한 얼굴이 보였다. -"선생님!" -하고 순임도 나를 알아보고는 또 팔을 허우적거리며 소리를 질렀다. -나도 반가워서 모자를 벗어 둘렀다. -"아이 선생님!" -하고 순임은 내가 썰매에서 일어서기도 전에 내게 와서 매달리며 울었다. -"아버지 어떠시냐?" -하고 나는 순임의 등을 두드렸다. 나는 다리가 마비가 되어서 곧 일어설 수가 없었다. -"아버지 어떠시냐?" -하고 나는 한 번 더 물었다. -순임은 벌떡 일어나 두 주먹으로 흐르는 눈물을 쳐내 버리며, -"대단하셔요." -하고도 울음을 금치 못하였다. -노파는 벌써 썰매에서 내려서 기운 없는 걸음으로 비틀비틀 걷기를 시작하였다. -나는 순임을 따라서 언덕을 오르며, -"그래 무슨 병환이시냐?" -하고 물었다. -"몰라요. 신열이 대단하셔요." -"정신은 차리시든?" -"처음 제가 여기 왔을 적에는 그렇지 않더니 요새에는 가끔 혼수 상태에 빠지시는 모양이야요." -이만한 지식을 가지고 나는 최석이가 누워 있는 집 앞에 다다랐다. -이 집은 통나무를 댓 개 우물 정자로 가로놓고 지붕은 무엇으로 했는지 모르나 눈이 덮이고, 문 하나 창 하나를 내었는데 문은 나무껍질인 모양이나 창은 젖빛 나는 유리창인 줄 알았더니 뒤에 알아본즉 그것은 유리가 아니요, 양목을 바르고 물을 뿜어서 얼려 놓은 것이었다. 그리고 통나무와 통나무 틈바구니에는 쇠털과 같은 마른 풀을 꼭꼭 박아서 바람을 막았다. -문을 열고 들어서니 부엌에 들어서는 모양으로 쑥 빠졌는데 화끈화끈하는 것이 한증과 같다. 그렇지 않아도 침침한 날에 언 눈으로 광선 부족한 방에 들어오니, 캄캄 절벽이어서 아무것도 보이지 아니하였다. -순임이가 앞서서 양초에 불을 켠다. 촛불 빛은 방 한편 쪽 침대라고 할 만한 높은 곳에 담요를 덮고 누운 최석의 시체와 같은 흰 얼굴을 비춘다. -"아버지, 아버지 샌전 아저씨 오셨어요." -하고 순임은 최석의 귀에 입을 대고 가만히 불렀다. -그러나 대답이 없었다. -나는 최석의 이마를 만져 보았다. 축축하게 땀이 흘렀다. 그러나 그리 더운 줄은 몰랐다. -방 안의 공기는 숨이 막힐 듯하였다. 그 난방 장치는 삼굿의 원리를 이용한 것이었다. 돌멩이로 아궁이를 쌓고 그 위에 큰 돌멩이들을 많이 쌓고 거기다가 불을 때어서 달게 한 뒤에 거기 눈을 부어 뜨거운 증기를 발하는 것이었다. -이 건축법은 조선 동포들이 시베리아로 금광을 찾아다니면서 하는 법이란 말을 들었으나 최석이가 누구에게서 배워 가지고 어떤 모양으로 지었는지는 최석의 말을 듣기 전에는 알 수 없는 일이다. -나는 내 힘이 미치는 데까지 최석의 병 치료에 대한 손을 쓰고 어떻게 해서든지 이르쿠츠크의 병원으로 최석을 데려다가 입원시킬 도리를 궁리하였다. 그러나 냉정하게 생각하면 최석은 살아날 가망이 없는 것만 같았다. -내가 간 지 사흘 만에 최석은 처음으로 정신을 차려서 눈을 뜨고 나를 알아보았다. -그는 반가운 표정을 하고 빙그레 웃기까지 하였다. -"다 일없나?" -이런 말도 알아들을 수가 있었다. -그러나 심히 기운이 없는 모양이기로 나는 많이 말을 하지 아니하였다. -최석은 한참이나 눈을 감고 있더니, -"정임이 소식 들었나?" -하였다. -"괜찮대요." -하고 곁에서 순임이가 말하였다. -그리고는 또 혼몽하는 듯하였다. -그 날 또 한 번 최석은 정신을 차리고 순임더러는 저리로 가라는 뜻을 표하고 나더러 귀를 가까이 대라는 뜻을 보이기로 그대로 하였더니, -"내 가방 속에 일기가 있으니 그걸 자네만 보고는 불살라 버려. 내가 죽은 뒤에라도 그것이 세상 사람의 눈에 들면 안 되지. 순임이가 볼까 걱정이 되지마는 내가 몸을 꼼짝할 수가 있나." -하는 뜻을 말하였다. -"그러지." -하고 나는 고개를 끄덕여 보였다. -그러고 난 뒤에 나는 최석이가 시킨 대로 가방을 열고 책들을 뒤져서 그 일기책이라는 공책을 꺼내었다. -"순임이 너 이거 보았니?" -하고 나는 곁에서 내가 책 찾는 것을 보고 섰던 순임에게 물었다. -"아니오. 그게 무어여요?" -하고 순임은 내 손에 든 책을 빼앗으려는 듯이 손을 내밀었다. -나는 순임의 손이 닿지 않도록 책을 한편으로 비키며, -"이것이 네 아버지 일기인 모양인데 너는 보이지 말고 나만 보라고 하셨다. 네 아버지가 네가 이것을 보았을까 해서 염려를 하시는데 안 보았으면 다행이다." -하고 나는 그 책을 들고 밖으로 나왔다. -날이 밝다. 해는 중천에 있다. 중천이래야 저 남쪽 지평선 가까운 데다. 밤이 열여덟 시간, 낮이 대여섯 시간밖에 안 되는 북쪽 나라다. 멀건 햇빛이다. -나는 볕이 잘 드는 곳을 골라서 나무에 몸을 기대고 최석의 일기를 읽기 시작하였다. 읽은 중에서 몇 구절을 골라 볼까. -"집이 다 되었다. 이 집은 내가 생전 살고 그 속에서 이 세상을 마칠 집이다. 마음이 기쁘다. 시끄러운 세상은 여기서 멀지 아니하냐. 내가 여기 홀로 있기로 누가 찾을 사람도 없을 것이다. 내가 여기서 죽기로 누가 슬퍼해 줄 사람도 없을 것이다. 때로 곰이나 찾아올까. 지나가던 사슴이나 들여다볼까. -이것이 내 소원이 아니냐. 세상의 시끄러움을 떠나는 것이 내 소원이 아니냐. 이 속에서 나는 나를 이기기를 공부하자." -첫날은 이런 평범한 소리를 썼다. -그 이튿날에는. -"어떻게나 나는 약한 사람인고. 제 마음을 제가 지배하지 못하는 사람인고. 밤새도록 나는 정임을 생각하였다. 어두운 허공을 향하여 정임을 불렀다. 정임이가 나를 찾아서 동경을 떠나서 이리로 오지나 아니하나 하고 생각하였다. 어떻게나 부끄러운 일인고? 어떻게나 가증한 일인고? -나는 아내를 생각하려 하였다. 아이들을 생각하려 하였다. 아내와 아이들을 생각함으로 정임의 생각을 이기려 하였다. -최석아, 너는 남편이 아니냐. 아버지가 아니냐. 정임은 네 딸이 아니냐. 이런 생각을 하였다. -그래도 정임의 일류전은 아내와 아이들의 생각을 밀치고 달려오는 절대 위력을 가진 듯하였다. -아, 나는 어떻게나 파렴치한 사람인고. 나이 사십이 넘어 오십을 바라보는 놈이 아니냐. 사십에 불혹이라고 아니 하느냐. 교육가로 깨끗한 교인으로 일생을 살아 왔다고 자처하는 내가 아니냐 하고 나는 내 입으로 내 손가락을 물어서 두 군데나 피를 내었다." -최석의 둘째 날 일기는 계속된다. -"내 손가락에서 피가 날 때에 나는 유쾌하였다. 나는 승첩의 기쁨을 깨달았다. -그러나 아아 그러나 그 빨간, 참회의 핏방울 속에서도 애욕의 불길이 일지 아니하는가. 나는 마침내 제도할 수 없는 인생인가." -이 집에 든 지 둘째날에 벌써 이러한 비관적 말을 하였다. -또 며칠을 지난 뒤 일기에, -"나는 동경으로 돌아가고 싶다. 정임의 곁으로 가고 싶다. 시베리아의광야의 유혹도 아무 힘이 없다. 어젯밤은 삼림의 좋은 달을 보았으나 그 달을 아름답게 보려 하였으나 아무리 하여도 아름답게 보이지를 아니하였다. -하늘이나 달이나 삼림이나 모두 무의미한 존재다. 이처럼 무의미한 존재를 나는 경험한 일이 없다. 그것은 다만 기쁨을 자아내지 아니할 뿐더러 슬픔도 자아내지 못하였다. 그것은 잿더미였다. 아무도 듣는 이 없는 데서 내 진정을 말하라면 그것은 이 천지에 내게 의미 있는 것은 정임이밖에 없다는 것이다. -나는 정임의 곁에 있고 싶다. 정임을 내 곁에 두고 싶다. 왜? 그것은 나도 모른다. -만일 이 움 속에라도 정임이가 있다 하면 얼마나 이것이 즐거운 곳이 될까. -그러나 이것은 불가능한 일이다. 이 일이 있어서는 아니 된다. 나는 이 생각을 죽여야 한다. 다시 거두를 못 하도록 목숨을 끊어 버려야 한다. -이것을 나는 원한다. 원하지마는 내게는 그 힘이 없는 모양이다. -나는 종교를 생각하여 본다. 철학을 생각하여 본다. 인류를 생각하여 본다. 나라를 생각하여 본다. 이것을 가지고 내 애욕과 바꾸려고 애써 본다. 그렇지마는 내게 그러한 힘이 없다. 나는 완전히 헬플리스함을 깨닫는다. -아아 나는 어찌할꼬? -나는 못생긴 사람이다. 그까짓 것을 못 이겨? 그까짓 것을 못 이겨? -나는 예수의 광야에서의 유혹을 생각한다. 천하를 주마 하는 유혹을 생각한다. 나는 싯다르타 태자가 왕궁을 버리고 나온 것을 생각하고, 또 스토아 철학자의 의지력을 생각하였다. -그러나 나는 그러한 생각으로도 이 생각을 이길 수가 없는 것 같다. -나는 혁명가를 생각하였다. 모든 것 사랑도 목숨도 다 헌신짝같이 집어던지고 피 흐르는 마당으로 뛰어나가는 용사를 생각하였다. 나는 이끝없는 삼림 속으로 혁명의 용사 모양으로 달음박질치다가 기운이 진한 곳에서 죽어 버리는 것이 소원이었다. 그러나 거기까지도 이 생각은 따르지 아니할까. -나는 지금 곧 죽어 버릴까. 나는 육혈포를 손에 들어 보았다. 이 방아쇠를 한 번만 튕기면 내 생명은 없어지는 것이 아닌가. 그리 되면 모든 이 마음의 움직임은 소멸되는 것이 아닌가. 이것으로 만사가 해결되는 것이 아닌가. -아 하나님이시여, 힘을 주시옵소서. 천하를 이기는 힘보다도 나 자신을 이기는 힘을 주시옵소서. 이 죄인으로 하여금 하나님의 눈에 의롭고 깨끗한 사람으로 이 일생을 마치게 하여 주시옵소서, 이렇게 나는 기도를 한다. -그러나 하나님께서는 나를 버리셨다. 하나님께서는 내게 힘을 주시지 아니하시었다. 나를 이 비참한 자리에서 썩어져 죽게 하시었다." -최석은 어떤 날 일기에 또 이런 것도 썼다. 그것은 예전 내게 보낸 편지에 있던 꿈 이야기를 연상시키는 것이었다. 그것은 이러하다. -"오늘 밤은 달이 좋다. 시베리아의 겨울 해는 참 못생긴 사람과도 같이 기운이 없지마는 하얀 땅, 검푸른 하늘에 저쪽 지평선을 향하고 흘러가는 반달은 참으로 맑음 그것이었다. -나는 평생 처음 시 비슷한 것을 지었다. -임과 이별하던 날 밤에는 남쪽 나라에 바람비가 쳤네 -임 타신 자동차의 뒷불이 빨간 뒷불이 빗발에 찢겼네 -임 떠나 혼자 헤매는 시베리아의 오늘 밤에는 -지려는 쪽달이 눈 덮인 삼림에 걸렸구나 -아아 저 쪽달이여 -억지로 반을 갈겨진 것도 같아라 -아아 저 쪽달이여 -잃어진 짝을 찾아 -차디찬 허공 속을 영원히 헤매는 것도 같구나 -나도 저 달과 같이 잃어버린 반쪽을 찾아 무궁한 시간과 공간에서 헤매는 것만 같다. -에익. 내가 왜 이리 약한가. 어찌하여 크나큰 많은 일을 돌아보지 못하고 요만한 애욕의 포로가 되는가. -그러나 나는 차마 그 달을 버리고 들어올 수가 없었다. 내가 왜 이렇게 센티멘털하게 되었는고. 내 쇠 같은 의지력이 어디로 갔는고. 내 누를 수 없는 자존심이 어디로 갔는고. 나는 마치 유모의 손에 달린 젖먹이와도 같다. 내 일신은 도시 애욕 덩어리로 화해 버린 것 같다. -이른바 사랑 사랑이란 말은 종교적 의미인 것 이외에도 입에 담기도 싫어하던 말이다 이런 것은 내 의지력과 자존심을 녹여 버렸는가. 또 이 부자연한 고독의 생활이 나를 이렇게 내 인격을 이렇게 파괴하였는가. -그렇지 아니하면 내 자존심이라는 것이나, 의지력이라는 것이나, 인격이라는 것이 모두 세상의 습관과 사조에 휩쓸리던 것인가. 남들이 그러니까 남들이 옳다니까 남들이 무서우니까 이 애욕의 무덤에 회를 발랐던 것인가. 그러다가 고독과 반성의 기회를 얻으매 모든 회칠과 가면을 떼어 버리고 빨가벗은 애욕의 뭉텅이가 나온 것인가. -그렇다 하면, 이것이 참된 나인가. 이것이 하나님께서 지어 주신 대로의 나인가. 가슴에 타오르는 애욕의 불길 이 불길이 곧 내 영혼의 불길인가. -어쩌면 그 모든 높은 이상들 인류에 대한, 민족에 대한, 도덕에 대한, 신앙에 대한 그 높은 이상들이 이렇게도 만만하게 마치 바람에 불리는 재 모양으로 자취도 없이 흩어져 버리고 말까. 그리고 그 뒤에는 평소에그렇게도 미워하고 천히 여기던 애욕의 검은 흙만 남고 말까. -아아 저 눈 덮인 땅이여, 차고 맑은 달이여, 허공이여! 나는 너희들을 부러워하노라. -불교도들의 해탈이라는 것이 이러한 애욕이 불붙는 지옥에서 눈과 같이 싸늘하고 허공과 같이 빈 곳으로 들어감을 이름인가. -석가의 팔 년 간 설산 고행이 이 애욕의 뿌리를 끊으려 함이라 하고 예수의 사십 일 광야의 고행과 겟세마네의 고민도 이 애욕의 뿌리 때문이었던가. -그러나 그것을 이기어 낸 사람이 천지 개벽 이래에 몇몇이나 되었는고? 나 같은 것이 그 중에 한 사람 되기를 바랄 수가 있을까. -나 같아서는 마침내 이 애욕의 불길에 다 타서 재가 되어 버릴 것만 같다. 아아 어떻게나 힘있고 무서운 불길인고." -이러한 고민의 자백도 있었다. -또 어떤 날 일기에는 최석은 이런 말을 썼다. -"나는 단연히 동경으로 돌아가기를 결심하였다." -그리고는 그 이튿날은, -"나는 단연히 동경으로 돌아가리란 결심을 한 것을 굳세게 취소한다. 나는 이러한 결심을 하는 나 자신을 굳세게 부인한다." -또 이런 말도 있다. -"나는 정임을 시베리아로 부르련다." -또 그 다음에는, -"아아 나는 하루바삐 죽어야 한다. 이 목숨을 연장하였다가는 무슨 일을 저지를는지 모른다. 나는 깨끗하게 나를 이기는 도덕적 인격으로 이 일생을 마쳐야 한다. 이 밖에 내 사업이 무엇이냐." -또 어떤 곳에는, -"아아 무서운 하룻밤이었다. 나는 지난 하룻밤을 누를 수 없는 애욕의 불길에 탔다. 나는 내 주먹으로 내 가슴을 두드리고 머리를 벽에 부딪쳤다. 나는 주먹으로 담벽을 두드려 손등이 터져서 피가 흘렀다. 나는 내 머리카락을 쥐어뜯었다. 나는 수없이 발을 굴렀다. 나는 이 무서운 유혹을 이기려고 내 몸을 아프게 하였다. 나는 견디다 못하여 문을 박차고 뛰어나갔다. 밖에는 달이 있고 눈이 있었다. 그러나 눈은 핏빛이요, 달은 찌그러진 것 같았다. 나는 눈 속으로 달음박질쳤다. 달을 따라서 엎드러지며 자빠지며 달음질쳤다. 나는 소리를 질렀다. 나는 미친 사람 같았다." -그러고는 어디까지 갔다가 어느 때에 어떠한 심경의 변화를 얻어 가지고 돌아왔다는 말은 쓰이지 아니하였으나 최석의 병의 원인을 설명하는 것 같았다. -"열이 나고 기침이 난다. 가슴이 아프다. 이것이 폐렴이 되어서 혼자 깨끗하게 이 생명을 마치게 하여 주소서 하고 빈다. 나는 오늘부터 먹고 마시기를 그치련다." -이러한 말을 썼다. 그러고는, -"정임, 정임, 정임, 정임." -하고 정임의 이름을 수없이 쓴 것도 있고, 어떤 데는, -"Overcome, Overcome." -하고 영어로 쓴 것도 있었다. -그리고 마지막에, -"나는 죽음과 대면하였다. 사흘째 굶고 앓은 오늘에 나는 극히 맑고 침착한 정신으로 죽음과 대면하였다. 죽음은 검은 옷을 입었으나 그 얼굴에는 자비의 표정이 있었다. 죽음은 곧 검은 옷을 입은 구원의 손이었다. 죽음은 아름다운 그림자였다. 죽음은 반가운 애인이요, 결코 무서운 원수가 아니었다. 나는 죽음의 손을 잡노라. 감사하는 마음으로 죽음의 품에 안기노라. 아멘." -이것을 쓴 뒤에는 다시는 일기가 없었다. 이것으로 최석이가 그 동안 지난 일을 적어도 심리적 변화만은 대강 추측할 수가 있었다. -다행히 최석의 병은 점점 돌리는 듯하였다. 열도 내리고 식은땀도 덜 흘렸다. 안 먹는다고 고집하던 음식도 먹기를 시작하였다. -정임에게로 갔던 노파에게서는 정임도 열이 내리고 일어나 앉을 만하다는 편지가 왔다. -나는 노파의 편지를 최석에게 읽어 주었다. 최석은 그 편지를 듣고 매우 흥분하는 모양이었으나 곧 안심하는 빛을 보였다. -나는 최석의 병이 돌리는 것을 보고 정임을 찾아볼 양으로 떠나려 하였으나 순임이가 듣지 아니하였다. 혼자서 앓는 아버지를 맡아 가지고 있을 수는 없다는 것이었다. 그래서 노파가 오기를 기다리기로 하였다. -나는 최석이가 먹을 음식도 살 겸 우편국에도 들를 겸 시가까지 가기로 하고 이 곳 온 지 일 주일이나 지나서 처음으로 산에서 나왔다. -나는 이르쿠츠크에 가서 최석을 위하여 약품과 먹을 것을 사고 또 순임을 위해서도 먹을 것과 의복과 또 하모니카와 손풍금도 사 가지고 정거장에 나와서 돌아올 차를 기다리고 있었다. -나는 순후해 보이는 아라사 사람들이 정거장에서 오락가락하는 것을 보고 속으로는 최석이가 병이 좀 나은 것을 다행으로 생각하고, 또 최석과 정임의 장래가 어찌 될까 하는 것도 생각하면서 뷔페(식당)에서 뜨거운 차이(차)를 마시고 있었다. -이 때에 밖을 바라보고 있던 내 눈은 문득 이상한 것을 보았다. 그것은 그 노파가 이리로 향하고 걸어오는 것인데 그 노파와 팔을 걸은 젊은 여자가 있는 것이다. 머리를 검은 수건으로 싸매고 입과 코를 가리웠으니 분명히 알 수 없으나 혹은 정임이나 아닌가 할 수밖에 없었다. 정임이가 몸만 기동하게 되면 최석을 보러 올 것은 정임의 열정적인 성격으로 보아서 당연한 일이기 때문이었다. -나는 반쯤 먹던 차를 놓고 뷔페 밖으로 뛰어나갔다. -"오 미시즈 체스터필드?" -하고 나는 노파 앞에 손을 내어밀었다. 노파는 체스터필드라는 미국 남편의 성을 따라서 부르는 것을 기억하였다. -"선생님!" -하는 것은 정임이었다. 그 소리만은 변치 아니하였다. 나는 검은 장갑을 낀 정임의 손을 잡았다. 나는 여러 말 아니하고 노파와 정임을 뷔페로 끌고 들어왔다. -늙은 뷔페 보이는 번쩍번쩍하는 사모바르에서 차 두 잔을 따라다가 노파와 정임의 앞에 놓았다. -노파는 어린애에게 하는 모양으로 정임의 수건을 벗겨 주었다. 그 속에서는 해쓱하게 여윈 정임의 얼굴이 나왔다. 두 볼에 불그레하게 홍훈이 도는 것도 병 때문인가. -"어때? 신열은 없나?" -하고 나는 정임에게 물었다. -"괜찮아요." -하고 정임은 웃으며, -"최 선생님께서는 어떠세요?" -하고 묻는다. -"좀 나으신 모양이야. 그래서 나는 오늘 정임을 좀 보러 가려고 했는데 이 체스터필드 부인께서 아니 오시면 순임이가 혼자 있을 수가 없다고 해서, 그래 이렇게 최 선생 자실 것을 사 가지고 가는 길이야." -하고 말을 하면서도 나는 정임의 눈과 입과 목에서 그의 병과 마음을 알아보려고 애를 썼다. -중병을 앓은 깐 해서는 한 달 전 남대문서 볼 때보다 얼마 더 초췌한 것 같지는 아니하였다. -"네에." -하고 정임은 고개를 숙였다. 그의 안경알에는 이슬이 맺혔다. -"선생님 댁은 다 안녕하셔요?" -"응, 내가 떠날 때에는 괜찮았어." -"최 선생님 댁도?" -"응." -"선생님 퍽은 애를 쓰셨어요." -하고 정임은 울음인지 웃음인지 모를 웃음을 웃는다. -말을 모르는 노파는 우리가 하는 말을 눈치나 채려는 듯이 멀거니 보고 있다가 서투른 영어로, -"아직 미스 남은 신열이 있답니다. 그래도 가 본다고, 죽어도 가 본다고 내 말을 안 듣고 따라왔지요." -하고 정임에게 애정 있는 눈흘김을 주며, -"유 노티 차일드(말썽꾼이)." -하고 입을 씰룩하며 정임을 안경 위로 본다. -"니체워, 마뚜슈까(괜찮아요, 어머니)." -하고 정임은 노파를 보고 웃었다. 정임의 서양 사람에게 대한 행동은 서양식으로 째었다고 생각하였다. -정임은 도리어 유쾌한 빛을 보였다. 다만 그의 붉은빛 띤 눈과 마른 입술이 그의 몸에 열이 있음을 보였다. 나는 그의 손끝과 발끝이 싸늘하게 얼었을 것을 상상하였다. -마침 이 날은 날이 온화하였다. 엷은 햇빛도 오늘은 두꺼워진 듯하였다. -우리 세 사람은 F역에서 내려서 썰매 하나를 얻어 타고 산으로 향하였다. 산도 아니지마는 산 있는 나라에서 살던 우리는 최석이가 사는 곳을 산이라고 부르는 습관을 지었다. 삼림이 있으니 산같이 생각된 까닭이었다. -노파가 오른편 끝에 앉고, 가운데다가 정임을 앉히고 왼편 끝에 내가 앉았다. -쩟쩟쩟 하는 소리에 말은 달리기 시작하였다. 한 필은 키 큰 말이요, 한 필은 키가 작은 말인데 키 큰 말은 아마 늙은 군마 퇴물인가 싶게 허우대는 좋으나 몸이 여위고 털에는 윤이 없었다. 조금만 올라가는 길이 되어도 고개를 숙이고 애를 썼다. 작은 말은 까불어서 가끔 채찍으로 얻어맞았다. -"아이 삼림이 좋아요." -하고 정임은 정말 기쁜 듯이 나를 돌아보았다. -"좋아?" -하고 나는 멋없이 대꾸하고 나서, 후회되는 듯이, -"밤낮 삼림 속에서만 사니까 지루한데." -하는 말을 붙였다. -"저는 저 눈 있는 삼림 속으로 한정 없이 가고 싶어요. 그러나 저는 인제 기운이 없으니깐 웬걸 그래 보겠어요?" -하고 한숨을 쉬었다. -"왜 그런 소릴 해. 인제 나을걸." -하고 나는 정임의 눈을 들여다보았다. 마치 슬픈 눈물 방울이나 찾으려는 듯이. -"제가 지금도 열이 삼십팔 도가 넘습니다. 정신이 흐릿해지는 것을 보니까 아마 더 올라가나 봐요. 그래도 괜찮아요. 오늘 하루야 못 살라고요. 오늘 하루만 살면 괜찮아요. 최 선생님만 한 번 뵙고 죽으면 괜찮아요." -"왜 그런 소릴 해?" -하고 나는 책망하는 듯이 언성을 높였다. -정임은 기침을 시작하였다. 한바탕 기침을 하고는 기운이 진한 듯이 노파에게 기대며 조선말로, -"추워요." -하였다. 이 여행이 어떻게 정임의 병에 좋지 못할 것은 의사가 아닌 나로도 짐작할 수가 있었다. 그러나 나로는 더 어찌할 수가 없었다. -나는 외투를 벗어서 정임에게 입혀 주고 노파는 정임을 안아서 몸이 덜 흔들리도록 또 춥지 않도록 하였다. -나는 정임의 모양을 애처로워서 차마 볼 수가 없었다. 그러나 이것은 하나님밖에는 어찌할 도리가 없는 일이었다. -얼마를 지나서 정임은 갑자기 고개를 들고 일어나며, -"인제 몸이 좀 녹았습니다. 선생님 추우시겠어요. 이 외투 입으셔요." -하고 그의 입만 웃는 웃음을 웃었다. -"난 춥지 않아. 어서 입고 있어." -하고 나는 정임이가 외투를 벗는 것을 막았다. 정임은 더 고집하려고도 아니하고, -"선생님 시베리아의 삼림은 참 좋아요. 눈 덮인 것이 더 좋은 것 같아요. 저는 이 인적 없고 자유로운 삼림 속으로 헤매어 보고 싶어요." -하고 아까 하던 것과 같은 말을 또 하였다. -"며칠 잘 정양하여서, 날이나 따뜻하거든 한 번 산보나 해 보지." -하고 나는 정임의 말 뜻이 다른 데 있는 줄을 알면서도 부러 평범하게 대답하였다. -정임은 대답이 없었다. -"여기서도 아직 멀어요?" -하고 정임은 몸이 흔들리는 것을 심히 괴로워하는 모양으로 두 손을 자리에 짚어 몸을 버티면서 말하였다. -"고대야, 최 선생이 반가워할 터이지. 오죽이나 반갑겠나." -하고 나는 정임을 위로하는 뜻으로 말하였다. -"아이 참 미안해요. 제가 죄인이야요. 저 때문에 애매한 누명을 쓰시고 저렇게 사업도 버리시고 병환까지 나시니 저는 어떡허면 이 죄를 씻습니까?" -하고 눈물 고인 눈으로 정임은 나를 쳐다보았다. -나는 정임과 최석을 이 자유로운 시베리아의 삼림 속에 단둘이 살게 하고 싶었다. 그러나 최석은 살아나가겠지마는 정임이가 살아날 수가 있을까, 하고 나는 정임의 어깨를 바라보았다. 그의 목숨은 실낱 같은 것 같았다. 바람받이에 놓인 등잔불과만 같은 것 같았다. 이 목숨이 끊어지기 전에 사랑하는 이의 얼굴을 한 번 대하겠다는 것밖에 아무 소원이 없는 정임은 참으로 가엾어서 가슴이 미어지는 것 같았다. -"염려 말어. 무슨 걱정이야? 최 선생도 병이 돌리고 정임도 인제 얼마 정양하면 나을 것 아닌가. 아무 염려 말아요." -하고 나는 더욱 최석과 정임과 두 사람의 사랑을 달하게 할 결심을 하였다. 하나님께서 계시다면 이 가엾은 간절한 두 사람의 마음을 가슴 미어지게 아니 생각할 리가 없다고 생각하였다. 우주의 모든 일 중에 정임의 정경보다 더 슬프고 불쌍한 정경이 또 있을까 하였다. 차디찬 눈으로 덮인 시베리아의 광야에 병든 정임의 사랑으로 타는 불똥과 같이 날아가는 이 정경은 인생이 가질 수 있는 최대한 비극인 것 같았다. -정임은 지쳐서 고개를 숙이고 있다가도 가끔 고개를 들어서는 기운 나는 양을 보이려고, 유쾌한 양을 보이려고 애를 썼다. -"저 나무 보셔요. 오백 년은 살았겠지요?" -이런 말도 하였다. 그러나 그것은 다 억지로 지어서 하는 것이었다. 그러다가는 또 기운이 지쳐서는 고개를 숙이고, 혹은 노파의 어깨에 혹은 내 어깨에 쓰러졌다. -마침내 우리가 향하고 가는 움집이 보였다. -"정임이, 저기야." -하고 나는 움집을 가리켰다. -"네에?" -하고 정임은 내 손가락 가는 곳을 보고 다음에는 내 얼굴을 보았다. 잘 보이지 않는 모양이다. -"저기 저것 말야. 저기 저 고작 큰 전나무 두 개가 있지 않아? 그 사이로 보이는 저, 저거 말야. 옳지 옳지, 순임이 지금 나오지 않아?" -하였다. -순임이가 무엇을 가지러 나오는지 문을 열고 나와서는 밥 짓느라고 지어 놓은 이를테면 부엌에를 들어갔다가 나오는 길에 이 쪽을 바라보다가 우리를 발견하였는지 몇 걸음 빨리 오다가는 서서 보고 오다가는 서서 보더니 내가 모자를 내두르는 것을 보고야 우리 일행인 것을 확실히 알고 달음박질을 쳐서 나온다. -우리 썰매를 만나자, -"정임이야? 어쩌면 이 추운데." -하고 순임은 정임을 안고 그 안경으로 정임의 눈을 들여다본다. -"어쩌면 앓으면서 이렇게 와?" -하고 순임은 노파와 나를 책망하는 듯이 돌아보았다. -"아버지 어떠시냐?" -하고 나는 짐을 들고 앞서서 오면서 뒤따르는 순임에게 물었다. -"아버지요?" -하고 순임은 어른에게 대한 경의를 표하노라고 내 곁에 와서 걸으며, -"아버지께서 오늘은 말씀을 많이 하셨어요. 순임이가 고생하는구나 고맙다, 이런 말씀도 하시고, 지금 같아서는 일어날 것도 같은데 기운이 없어서, 이런 말씀도 하시고, 또 선생님이 이르쿠츠크에를 들어가셨으니 무엇을 사 오실 듯싶으냐, 알아맞혀 보아라, 이런 농담도 하시고, 정임이가 어떤가 한 번 보았으면, 이런 말씀도 하시겠지요. 또 순임아, 내가 죽더라도 정임을 네 친동생으로 알아서 부디 잘 사랑해 주어라, 정임은 불쌍한 애다, 참 정임은 불쌍해! 이런 말씀도 하시겠지요. 그렇게 여러 가지 말씀을 많이 하시더니, 순임아 내가 죽거든 선생님을 아버지로 알고 그 지도를 받아라, 그러시길래 제가 아버지 안 돌아가셔요! 그랬더니 아버지께서 웃으시면서, 죽지 말까, 하시고는 어째 가슴이 좀 거북한가, 하시더니 잠이 드셨어요. 한 시간이나 되었을까, 온." -집 앞에 거의 다 가서는 순임은 정임의 팔을 꼈던 것을 놓고 빨리 집으로 뛰어들어갔다. -치마폭을 펄럭거리고 뛰는 양에는 어렸을 적 말괄량이 순임의 모습이 남아 있어서 나는 혼자 웃었다. 순임은 정임이가 왔다는 기쁜 소식을 한 시각이라도 빨리 아버지께 전하고 싶었던 것이다. -"아버지, 주무시우? 정임이가 왔어요. 정임이가 왔습니다." -하고 부르는 소리가 밖에서도 들렸다. -나도 방에 들어서고, 정임도 뒤따라 들어서고, 노파는 부엌으로 물건을 두러 들어갔다. -방은 절벽같이 어두웠다. -"순임아, 불을 좀 켜려무나." -하고 최석의 얼굴을 찾느라고 눈을 크게 뜨고 고개를 숙이며, -"자나? 정임이가 왔네." -하고 불렀다. -정임도 곁에 와서 선다. -최석은 대답이 없었다. -순임이가 촛불을 켜자 최석의 얼굴이 환하게 보였다. -"여보게, 여봐. 자나?" -하고 나는 무서운 예감을 가지면서 최석의 어깨를 흔들었다. -그것이 무엇인지 모르지마는 최석은 시체라 하는 것을 나는 내 손을 통해서 깨달았다. -나는 깜짝 놀라서 이불을 벗기고 최석의 팔을 잡아 맥을 짚어 보았다. 거기는 맥이 없었다. -나는 최석의 자리옷 가슴을 헤치고 귀를 가슴에 대었다. 그 살은 얼음과 같이 차고 그 가슴은 고요하였다. 심장은 뛰기를 그친 것이었다. -나는 최석의 가슴에서 귀를 떼고 일어서면서, -"네 아버지는 돌아가셨다. 네 손으로 눈이나 감겨 드려라." -하였다. 내 눈에서는 눈물이 흘렀다. -"선생님!" -하고 정임은 전연히 절제할 힘을 잃어버린 듯이 최석의 가슴에 엎어졌다. 그러고는 소리를 내어 울었다. 순임은, -"아버지, 아버지!" -하고 최석의 베개 곁에 이마를 대고 울었다. -아라사 노파도 울었다. -방 안에는 오직 울음 소리뿐이요, 말이 없었다. 최석은 벌써 이 슬픈 광경도 몰라보는 사람이었다. -최석이가 자기의 싸움을 이기고 죽었는지, 또는 끝까지 지다가 죽었는지 그것은 영원한 비밀이어서 알 도리가 없었다. 그러나 이것만은 확실하다 그의 의식이 마지막으로 끝나는 순간에 그의 의식기에 떠오르던 오직 하나가 정임이었으리라는 것만은. -지금 정임이가 그의 가슴에 엎어져 울지마는, 정임의 뜨거운 눈물이 그의 가슴을 적시건마는 최석의 가슴은 뛸 줄을 모른다. 이것이 죽음이란 것이다. -뒤에 경찰의가 와서 검사한 결과에 의하면, 최석은 폐렴으로 앓던 결과로 심장마비를 일으킨 것이라고 하였다. -나는 최석의 장례를 끝내고 순임과 정임을 데리고 오려 하였으나 정임은 듣지 아니하고 노파와 같이 바이칼 촌으로 가 버렸다. -그런 뒤로는 정임에게서는 일체 음신이 없다. 때때로 노파에게서 편지가 오는데 정임은 최석이가 있던 방에 가만히 있다고만 하였다. -서투른 영어가 뜻을 충분히 발표하지 못하는 것이었다. -나는 정임에게 안심하고 병을 치료하라는 편지도 하고 돈이 필요하거든 청구하라는 편지도 하나 영 답장이 없다. -만일 정임이가 죽었다는 기별이 오면 나는 한 번 더 시베리아에 가서 둘을 가지런히 묻고 `두 별 무덤'이라는 비를 세워 줄 생각이다. 그러나 나는 정임이가 조선으로 오기를 바란다. -여러분은 최석과 정임에게 대한 이 기록을 믿고 그 두 사람에게 대한 오해를 풀라. -EOT; -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/lt_LT/Address.php b/vendor/fakerphp/faker/src/Faker/Provider/lt_LT/Address.php deleted file mode 100644 index f8967ffe..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/lt_LT/Address.php +++ /dev/null @@ -1,209 +0,0 @@ -generator->parse($format); - } - - public static function country() - { - return static::randomElement(static::$country); - } - - public static function postcode() - { - return static::toUpper(static::bothify(static::randomElement(static::$postcode))); - } - - public static function regionSuffix() - { - return static::randomElement(static::$regionSuffix); - } - - public static function region() - { - return static::randomElement(static::$region); - } - - public static function citySuffix() - { - return static::randomElement(static::$citySuffix); - } - - public function city() - { - return static::randomElement(static::$city); - } - - public static function streetSuffix() - { - return static::randomElement(static::$streetSuffix); - } - - public static function street() - { - return static::randomElement(static::$street); - } - - /** - * Lithuania municipality - * - * @see https://en.wikipedia.org/wiki/Municipality - * - * @return string - */ - public function municipality() - { - return static::randomElement(static::$municipality); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/lt_LT/Company.php b/vendor/fakerphp/faker/src/Faker/Provider/lt_LT/Company.php deleted file mode 100644 index 89370b3d..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/lt_LT/Company.php +++ /dev/null @@ -1,15 +0,0 @@ -generator->parse(static::randomElement(static::$lastNameFormat)); - } - - /** - * Return male last name - * - * @return string - * - * @example 'Vasiliauskas' - */ - public function lastNameMale() - { - return static::randomElement(static::$lastNameMale); - } - - /** - * Return female last name - * - * @return string - * - * @example 'Žukauskaitė' - */ - public function lastNameFemale() - { - return static::randomElement(static::$lastNameFemale); - } - - /** - * Return driver license number - * - * @return string - * - * @example 12345678 - */ - public function driverLicence() - { - return $this->bothify('########'); - } - - /** - * Return passport number - * - * @return string - * - * @example 12345678 - */ - public function passportNumber() - { - return $this->bothify('########'); - } - - /** - * National Personal Identity number (asmens kodas) - * - * @see https://en.wikipedia.org/wiki/National_identification_number#Lithuania - * @see https://lt.wikipedia.org/wiki/Asmens_kodas - * - * @param string $gender [male|female] - * @param \DateTime $birthdate - * @param string $randomNumber three integers - * - * @return string on format XXXXXXXXXXX - */ - public function personalIdentityNumber($gender = 'male', \DateTime $birthdate = null, $randomNumber = '') - { - if (!$birthdate) { - $birthdate = \Faker\Provider\DateTime::dateTimeThisCentury(); - } - - $genderNumber = ($gender == 'male') ? 1 : 0; - $firstNumber = (int) floor($birthdate->format('Y') / 100) * 2 - 34 - $genderNumber; - - $datePart = $birthdate->format('ymd'); - $randomDigits = (string) (!$randomNumber || strlen($randomNumber) < 3) ? static::numerify('###') : substr($randomNumber, 0, 3); - $partOfPerosnalCode = $firstNumber . $datePart . $randomDigits; - - $sum = self::calculateSum($partOfPerosnalCode, 1); - $liekana = $sum % 11; - - if ($liekana !== 10) { - $lastNumber = $liekana; - - return $firstNumber . $datePart . $randomDigits . $lastNumber; - } - - $sum = self::calculateSum($partOfPerosnalCode, 2); - $liekana = $sum % 11; - - $lastNumber = ($liekana !== 10) ? $liekana : 0; - - return $firstNumber . $datePart . $randomDigits . $lastNumber; - } - - /** - * Calculate the sum of personal code - * - * @see https://en.wikipedia.org/wiki/National_identification_number#Lithuania - * @see https://lt.wikipedia.org/wiki/Asmens_kodas - * - * @param string $numbers - * @param int $time [1|2] - * - * @return int - */ - private static function calculateSum($numbers, $time = 1) - { - if ($time == 1) { - $multipliers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 1]; - } else { - $multipliers = [3, 4, 5, 6, 7, 8, 9, 1, 2, 3]; - } - - $sum = 0; - - for ($i = 1; $i <= 10; ++$i) { - $sum += ((int) $numbers[$i - 1]) * $multipliers[$i - 1]; - } - - return (int) $sum; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/lt_LT/PhoneNumber.php b/vendor/fakerphp/faker/src/Faker/Provider/lt_LT/PhoneNumber.php deleted file mode 100644 index 05e32d31..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/lt_LT/PhoneNumber.php +++ /dev/null @@ -1,17 +0,0 @@ -generator->parse($format); - } - - public static function country() - { - return static::randomElement(static::$country); - } - - public static function postcode() - { - return static::toUpper(static::bothify(static::randomElement(static::$postcode))); - } - - public static function regionSuffix() - { - return static::randomElement(static::$regionSuffix); - } - - public static function region() - { - return static::randomElement(static::$region); - } - - public static function cityPrefix() - { - return static::randomElement(static::$cityPrefix); - } - - public function city() - { - return static::randomElement(static::$city); - } - - public static function streetPrefix() - { - return static::randomElement(static::$streetPrefix); - } - - public static function street() - { - return static::randomElement(static::$street); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/lv_LV/Color.php b/vendor/fakerphp/faker/src/Faker/Provider/lv_LV/Color.php deleted file mode 100644 index 04c895fb..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/lv_LV/Color.php +++ /dev/null @@ -1,19 +0,0 @@ -format('dmy'); - $randomDigits = (string) static::numerify('####'); - - $checksum = Luhn::computeCheckDigit($datePart . $randomDigits); - - return $datePart . '-' . $randomDigits . $checksum; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/lv_LV/PhoneNumber.php b/vendor/fakerphp/faker/src/Faker/Provider/lv_LV/PhoneNumber.php deleted file mode 100644 index 2cfdcb5a..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/lv_LV/PhoneNumber.php +++ /dev/null @@ -1,15 +0,0 @@ - static::latitude(42.43, 42.45), - 'longitude' => static::longitude(19.16, 19.27), - ]; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/me_ME/Company.php b/vendor/fakerphp/faker/src/Faker/Provider/me_ME/Company.php deleted file mode 100644 index 2483c20f..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/me_ME/Company.php +++ /dev/null @@ -1,49 +0,0 @@ -generator->parse(static::$idNumberFormat)); - } - - /** - * @return string - * - * @example 'Ф' - */ - public function alphabet() - { - return static::randomElement(static::$alphabet); - } - - /** - * @return string - * - * @example 'Э' - */ - public function namePrefix() - { - return static::randomElement(static::$namePrefix); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/mn_MN/PhoneNumber.php b/vendor/fakerphp/faker/src/Faker/Provider/mn_MN/PhoneNumber.php deleted file mode 100644 index b6706f3f..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/mn_MN/PhoneNumber.php +++ /dev/null @@ -1,13 +0,0 @@ - Townships - * @see https://en.wikipedia.org/wiki/Template:Johor > Townships - * @see https://en.wikipedia.org/wiki/Template:Kedah > Townships - * @see https://en.wikipedia.org/wiki/Template:Kelantan > Townships - * @see https://en.wikipedia.org/wiki/Template:Melaka > Townships - * @see https://en.wikipedia.org/wiki/Template:Negeri_Sembilan > Townships - * @see https://en.wikipedia.org/wiki/Template:Perak > Townships - * @see https://en.wikipedia.org/wiki/Template:Penang > Townships - * @see https://en.wikipedia.org/wiki/Template:Selangor > Townships - * @see https://en.wikipedia.org/wiki/Template:Terengganu > Townships - */ - protected static $townshipPrefix = [ - 'Alam', 'Apartment', 'Ara', - 'Bandar', 'Bandar', 'Bandar', 'Bandar', 'Bandar', 'Bandar', - 'Bandar Bukit', 'Bandar Seri', 'Bandar Sri', 'Bandar Baru', 'Batu', 'Bukit', - 'Desa', 'Damansara', - 'Kampung', 'Kampung Baru', 'Kampung Baru', 'Kondominium', 'Kota', - 'Laman', 'Lembah', - 'Medan', - 'Pandan', 'Pangsapuri', 'Petaling', 'Puncak', - 'Seri', 'Sri', - 'Taman', 'Taman', 'Taman', 'Taman', 'Taman', 'Taman', - 'Taman Desa', - ]; - protected static $townshipSuffix = [ - 'Aman', 'Amanjaya', 'Anggerik', 'Angkasa', 'Antarabangsa', 'Awan', - 'Bahagia', 'Bangsar', 'Baru', 'Belakong', 'Bendahara', 'Bestari', 'Bintang', 'Brickfields', - 'Casa', 'Changkat', 'Country Heights', - 'Damansara', 'Damai', 'Dato Harun', 'Delima', 'Duta', - 'Flora', - 'Gembira', 'Genting', - 'Harmoni', 'Hartamas', - 'Impian', 'Indah', 'Intan', - 'Jasa', 'Jaya', - 'Keramat', 'Kerinchi', 'Kiara', 'Kinrara', 'Kuchai', - 'Laksamana', - 'Mahkota', 'Maluri', 'Manggis', 'Maxwell', 'Medan', 'Melawati', 'Menjalara', 'Meru', 'Mulia', 'Mutiara', - 'Pahlawan', 'Perdana', 'Pertama', 'Permai', 'Pelangi', 'Petaling', 'Pinang', 'Puchong', 'Puteri', 'Putra', - 'Rahman', 'Rahmat', 'Raya', 'Razak', 'Ria', - 'Saujana', 'Segambut', 'Selamat', 'Selatan', 'Semarak', 'Sentosa', 'Seputeh', 'Setapak', 'Setia Jaya', 'Sinar', 'Sungai Besi', 'Sungai Buaya', 'Sungai Long', 'Suria', - 'Tasik Puteri', 'Tengah', 'Timur', 'Tinggi', 'Tropika', 'Tun Hussein Onn', 'Tun Perak', 'Tunku', - 'Ulu', 'Utama', 'Utara', - 'Wangi', - ]; - - /** - * @see https://en.wikipedia.org/wiki/Template:Greater_Kuala_Lumpur - * @see https://en.wikipedia.org/wiki/Template:Johor - * @see https://en.wikipedia.org/wiki/Template:Kedah - * @see https://en.wikipedia.org/wiki/Template:Kelantan - * @see https://en.wikipedia.org/wiki/Template:Labuan - * @see https://en.wikipedia.org/wiki/Template:Melaka - * @see https://en.wikipedia.org/wiki/Template:Negeri_Sembilan - * @see https://en.wikipedia.org/wiki/Template:Pahang - * @see https://en.wikipedia.org/wiki/Template:Perak - * @see https://en.wikipedia.org/wiki/Template:Perlis - * @see https://en.wikipedia.org/wiki/Template:Penang - * @see https://en.wikipedia.org/wiki/Template:Sabah - * @see https://en.wikipedia.org/wiki/Template:Sarawak - * @see https://en.wikipedia.org/wiki/Template:Selangor - * @see https://en.wikipedia.org/wiki/Template:Terengganu - */ - protected static $towns = [ - 'johor' => [ - 'Ayer Hitam', - 'Batu Pahat', 'Bukit Gambir', 'Bukit Kepong', 'Bukit Naning', - 'Desaru', - 'Endau', - 'Gelang Patah', 'Gemas Baharu', - 'Iskandar Puteri', - 'Jementah', 'Johor Lama', 'Johor Bahru', - 'Kempas', 'Kluang', 'Kota Iskandar', 'Kota Tinggi', 'Kukup', 'Kulai', - 'Labis ', 'Larkin', 'Layang-Layang', - 'Mersing', 'Muar', - 'Pagoh', 'Paloh', 'Parit Jawa', 'Pasir Gudang', 'Pekan Nanas', 'Permas Jaya', 'Pontian Kechil', - 'Renggam', - 'Segamat', 'Senai', 'Simpang Renggam', 'Skudai', 'Sri Gading', - 'Tangkak', 'Tebrau', - 'Ulu Tiram', - 'Yong Peng', - ], - 'kedah' => [ - 'Alor Setar', - 'Baling', 'Bukit Kayu Hitam', - 'Changlun', - 'Durian Burung', - 'Gurun', - 'Jitra', - 'Kepala Batas', 'Kuah', 'Kuala Kedah', 'Kuala Ketil', 'Kulim', - 'Langgar', 'Lunas', - 'Merbok', - 'Padang Serai', 'Pendang', - 'Serdang', 'Sintok', 'Sungai Petani', - 'Tawar, Baling', - 'Yan', - ], - 'kelantan' => [ - 'Bachok', 'Bunut Payong', - 'Dabong', - 'Gua Musang', - 'Jeli', - 'Ketereh', 'Kota Bharu', 'Kuala Krai', - 'Lojing', - 'Machang', - 'Pasir Mas', 'Pasir Puteh', - 'Rantau Panjang', - 'Salor', - 'Tok Bali', - 'Wakaf Bharu', 'Wakaf Che Yeh', - ], - 'kl' => [ - 'Ampang', - 'Bandar Tasik Selatan', 'Bandar Tun Razak', 'Bangsar', 'Batu', 'Brickfields', 'Bukit Bintang', 'Bukit Jalil', 'Bukit Tunku', - 'Cheras', 'Chow Kit', - 'Damansara Town Centre', 'Dang Wangi', 'Desa Petaling', 'Desa Tun Hussein Onn', - 'Jinjang', - 'Kampung Baru', 'Kampung Kasipillay', 'Kampung Pandan', 'Kampung Sungai Penchala', 'Kepong', 'KLCC', 'Kuchai Lama', - 'Lake Gardens', 'Lembah Pantai', - 'Medan Tuanku', 'Mid Valley City', 'Mont Kiara', - 'Pantai Dalam', 'Pudu', - 'Salak South', 'Segambut', 'Semarak', 'Sentul', 'Setapak', 'Setiawangsa', 'Seputeh', 'Sri Hartamas', 'Sri Petaling', 'Sungai Besi', - 'Taman Desa', 'Taman Melawati', 'Taman OUG', 'Taman Tun Dr Ismail', 'Taman U-Thant', 'Taman Wahyu', 'Titiwangsa', 'Tun Razak Exchange', - 'Wangsa Maju', - ], - 'labuan' => [ - 'Batu Manikar', - 'Kiamsam', - 'Layang-Layang', - 'Rancha-Rancha', - ], - 'melaka' => [ - 'Alor Gajah', - 'Bandaraya Melaka', 'Batu Berendam', 'Bukit Beruang', 'Bukit Katil', - 'Cheng', - 'Durian Tunggal', - 'Hang Tuah Jaya', - 'Jasin', - 'Klebang', - 'Lubuk China', - 'Masjid Tanah', - 'Naning', - 'Pekan Asahan', - 'Ramuan China', - 'Simpang Ampat', - 'Tanjung Bidara', 'Telok Mas', - 'Umbai', - ], - 'nsembilan' => [ - 'Ayer Kuning', 'Ampangan', - 'Bahau', 'Batang Benar', - 'Chembong', - 'Dangi', - 'Gemas', - 'Juasseh', - 'Kuala Pilah', - 'Labu', 'Lenggeng', 'Linggi', - 'Mantin', - 'Nilai', - 'Pajam', 'Pedas', 'Pengkalan Kempas', 'Port Dickson', - 'Rantau', 'Rompin', - 'Senawang', 'Seremban', 'Sungai Gadut', - 'Tampin', 'Tiroi', - ], - 'pahang' => [ - 'Bandar Tun Razak', 'Bentong', 'Brinchang', 'Bukit Fraser', 'Bukit Tinggi', - 'Chendor', - 'Gambang', 'Genting Highlands', 'Genting Sempah', - 'Jerantut', - 'Karak', 'Kemayan', 'Kota Shahbandar', 'Kuala Lipis', 'Kuala Pahang', 'Kuala Rompin', 'Kuantan', - 'Lanchang', 'Lubuk Paku', - 'Maran', 'Mengkuang', 'Mentakab', - 'Nenasi', - 'Panching', - 'Pekan', 'Penor', - 'Raub', - 'Sebertak', 'Sungai Lembing', - 'Tanah Rata', 'Tanjung Sepat', 'Tasik Chini', 'Temerloh', 'Teriang', 'Tringkap', - ], - 'penang' => [ - 'Air Itam', - 'Balik Pulau', 'Batu Ferringhi', 'Batu Kawan', 'Bayan Lepas', 'Bukit Mertajam', 'Butterworth', - 'Gelugor', 'George Town', - 'Jelutong', - 'Kepala Batas', - 'Nibong Tebal', - 'Permatang Pauh', 'Pulau Tikus', - 'Simpang Ampat', - 'Tanjung Bungah', 'Tanjung Tokong', - ], - 'perak' => [ - 'Ayer Tawar', - 'Bagan Serai', 'Batu Gajah', 'Behrang', 'Bidor', 'Bukit Gantang', 'Bukit Merah', - 'Changkat Jering', 'Chemor', 'Chenderiang', - 'Damar Laut', - 'Gerik', 'Gopeng', 'Gua Tempurung', - 'Hutan Melintang', - 'Ipoh', - 'Jelapang', - 'Kamunting', 'Kampar', 'Kuala Kangsar', - 'Lekir', 'Lenggong', 'Lumut', - 'Malim Nawar', 'Manong', 'Menglembu', - 'Pantai Remis', 'Parit', 'Parit Buntar', 'Pasir Salak', 'Proton City', - 'Simpang Pulai', 'Sitiawan', 'Slim River', 'Sungai Siput', 'Sungkai', - 'Taiping', 'Tambun', 'Tanjung Malim', 'Tanjung Rambutan', 'Tapah', 'Teluk Intan', - 'Ulu Bernam', - ], - 'perlis' => [ - 'Arau', - 'Beseri', - 'Chuping', - 'Kaki Bukit', 'Kangar', 'Kuala Perlis', - 'Mata Ayer', - 'Padang Besar', - 'Sanglang', 'Simpang Empat', - 'Wang Kelian', - ], - 'putrajaya' => [ - 'Precinct 1', 'Precinct 4', 'Precinct 5', - 'Precinct 6', 'Precinct 8', 'Precinct 10', - 'Precinct 11', 'Precinct 12', 'Precinct 13', - 'Precinct 16', 'Precinct 18', 'Precinct 19', - ], - 'sabah' => [ - 'Beaufort', 'Bingkor', - 'Donggongon', - 'Inanam', - 'Kinabatangan', 'Kota Belud', 'Kota Kinabalu', 'Kuala Penyu', 'Kimanis', 'Kundasang', - 'Lahad Datu', 'Likas', 'Lok Kawi', - 'Manggatal', - 'Nabawan', - 'Papar', 'Pitas', - 'Ranau', - 'Sandakan', 'Sapulut', 'Semporna', 'Sepanggar', - 'Tambunan', 'Tanjung Aru', 'Tawau', 'Tenom', 'Tuaran', - 'Weston', - ], - 'sarawak' => [ - 'Asajaya', - 'Ba\'kelalan', 'Bario', 'Batu Kawa', 'Batu Niah', 'Betong', 'Bintulu', - 'Dalat', 'Daro', - 'Engkilili', - 'Julau', - 'Kapit', 'Kota Samarahan', 'Kuching', - 'Lawas', 'Limbang', 'Lubok Antu', - 'Marudi', 'Matu', 'Miri', - 'Oya', - 'Pakan', - 'Sadong Jaya', 'Sematan', 'Sibu', 'Siburan', 'Song', 'Sri Aman', 'Sungai Tujoh', - 'Tanjung Kidurong', 'Tanjung Manis', 'Tatau', - ], - 'selangor' => [ - 'Ampang', 'Assam Jawa', - 'Balakong', 'Bandar Baru Bangi', 'Bandar Baru Selayang', 'Bandar Sunway', 'Bangi', 'Banting', 'Batang Kali', 'Batu Caves', 'Bestari Jaya', 'Bukit Lanjan', - 'Cheras', 'Cyberjaya', - 'Damansara', 'Dengkil', - 'Ijok', - 'Jenjarom', - 'Kajang', 'Kelana Jaya', 'Klang', 'Kuala Kubu Bharu', 'Kuala Selangor', 'Kuang', - 'Lagong', - 'Morib', - 'Pandamaran', 'Paya Jaras', 'Petaling Jaya', 'Port Klang', 'Puchong', - 'Rasa', 'Rawang', - 'Salak Tinggi', 'Sekinchan', 'Selayang', 'Semenyih', 'Sepang', 'Serendah', 'Seri Kembangan', 'Shah Alam', 'Subang', 'Subang Jaya', 'Sungai Buloh', - 'Tanjung Karang', 'Tanjung Sepat', - 'Ulu Klang', 'Ulu Yam', - ], - 'terengganu' => [ - 'Ajil', - 'Bandar Ketengah Jaya', 'Bandar Permaisuri', 'Bukit Besi', 'Bukit Payong', - 'Chukai', - 'Jerteh', - 'Kampung Raja', 'Kerteh', 'Kijal', 'Kuala Besut', 'Kuala Berang', 'Kuala Dungun', 'Kuala Terengganu', - 'Marang', 'Merchang', - 'Pasir Raja', - 'Rantau Abang', - 'Teluk Kalung', - 'Wakaf Tapai', - ], - ]; - - /** - * @see https://en.wikipedia.org/wiki/States_and_federal_territories_of_Malaysia - */ - protected static $states = [ - 'johor' => [ - 'Johor Darul Ta\'zim', - 'Johor', - ], - 'kedah' => [ - 'Kedah Darul Aman', - 'Kedah', - ], - 'kelantan' => [ - 'Kelantan Darul Naim', - 'Kelantan', - ], - 'kl' => [ - 'KL', - 'Kuala Lumpur', - 'WP Kuala Lumpur', - ], - 'labuan' => [ - 'Labuan', - ], - 'melaka' => [ - 'Malacca', - 'Melaka', - ], - 'nsembilan' => [ - 'Negeri Sembilan Darul Khusus', - 'Negeri Sembilan', - ], - 'pahang' => [ - 'Pahang Darul Makmur', - 'Pahang', - ], - 'penang' => [ - 'Penang', - 'Pulau Pinang', - ], - 'perak' => [ - 'Perak Darul Ridzuan', - 'Perak', - ], - 'perlis' => [ - 'Perlis Indera Kayangan', - 'Perlis', - ], - 'putrajaya' => [ - 'Putrajaya', - ], - 'sabah' => [ - 'Sabah', - ], - 'sarawak' => [ - 'Sarawak', - ], - 'selangor' => [ - 'Selangor Darul Ehsan', - 'Selangor', - ], - 'terengganu' => [ - 'Terengganu Darul Iman', - 'Terengganu', - ], - ]; - - /** - * @see https://ms.wikipedia.org/wiki/Senarai_negara_berdaulat - */ - protected static $country = [ - 'Abkhazia', 'Afghanistan', 'Afrika Selatan', 'Republik Afrika Tengah', 'Akrotiri dan Dhekelia', 'Albania', 'Algeria', 'Amerika Syarikat', 'Andorra', 'Angola', 'Antigua dan Barbuda', 'Arab Saudi', 'Argentina', 'Armenia', 'Australia', 'Austria', 'Azerbaijan', - 'Bahamas', 'Bahrain', 'Bangladesh', 'Barbados', 'Belanda', 'Belarus', 'Belgium', 'Belize', 'Benin', 'Bhutan', 'Bolivia', 'Bonaire', 'Bosnia dan Herzegovina', 'Botswana', 'Brazil', 'Brunei Darussalam', 'Bulgaria', 'Burkina Faso', 'Burundi', - 'Cameroon', 'Chad', 'Chile', 'Republik Rakyat China', 'Republik China di Taiwan', 'Colombia', 'Comoros', 'Republik Demokratik Congo', 'Republik Congo', 'Kepulauan Cook', 'Costa Rica', 'Côte d\'Ivoire (Ivory Coast)', 'Croatia', 'Cuba', 'Curaçao', 'Cyprus', 'Republik Turki Cyprus Utara', 'Republik Czech', - 'Denmark', 'Djibouti', 'Dominika', 'Republik Dominika', - 'Ecuador', 'El Salvador', 'Emiriah Arab Bersatu', 'Eritrea', 'Estonia', - 'Kepulauan Faroe', 'Fiji', 'Filipina', 'Finland', - 'Gabon', 'Gambia', 'Georgia', 'Ghana', 'Grenada', 'Greece (Yunani)', 'Guatemala', 'Guinea', 'Guinea-Bissau', 'Guinea Khatulistiwa', 'Guiana Perancis', 'Guyana', - 'Habsyah (Etiopia)', 'Haiti', 'Honduras', 'Hungary', - 'Iceland', 'India', 'Indonesia', 'Iran', 'Iraq', 'Ireland', 'Israel', 'Itali', - 'Jamaika', 'Jepun', 'Jerman', 'Jordan', - 'Kanada', 'Kazakhstan', 'Kemboja', 'Kenya', 'Kiribati', 'Korea Selatan', 'Korea Utara', 'Kosovo', 'Kuwait', 'Kyrgyzstan', - 'Laos', 'Latvia', 'Lesotho', 'Liberia', 'Libya', 'Liechtenstein', 'Lithuania', 'Lubnan', 'Luxembourg', - 'Macedonia', 'Madagaskar', 'Maghribi', 'Malawi', 'Malaysia', 'Maldives', 'Mali', 'Malta', 'Kepulauan Marshall', 'Mauritania', 'Mauritius', 'Mesir', 'Mexico', 'Persekutuan Micronesia', 'Moldova', 'Monaco', 'Montenegro', 'Mongolia', 'Mozambique', 'Myanmar', - 'Namibia', 'Nauru', 'Nepal', 'New Zealand', 'Nicaragua', 'Niger', 'Nigeria', 'Niue', 'Norway', - 'Oman', 'Ossetia Selatan', - 'Pakistan', 'Palau', 'Palestin', 'Panama', 'Papua New Guinea', 'Paraguay', 'Perancis', 'Peru', 'Poland', 'Portugal', - 'Qatar', - 'Romania', 'Russia', 'Rwanda', - 'Sahara Barat', 'Saint Kitts dan Nevis', 'Saint Lucia', 'Saint Vincent dan Grenadines', 'Samoa', 'San Marino', 'São Tomé dan Príncipe', 'Scotland', 'Senegal', 'Sepanyol', 'Serbia', 'Seychelles', 'Sierra Leone', 'Singapura', 'Slovakia', 'Slovenia', 'Kepulauan Solomon', 'Somalia', 'Somaliland', 'Sri Lanka', 'Sudan', 'Sudan Selatan', 'Suriname', 'Swaziland', 'Sweden', 'Switzerland', 'Syria', - 'Tajikistan', 'Tanjung Verde', 'Tanzania', 'Thailand', 'Timor Leste', 'Togo', 'Tonga', 'Transnistria', 'Trinidad dan Tobago', 'Tunisia', 'Turki', 'Turkmenistan', 'Tuvalu', - 'Uganda', 'Ukraine', 'United Kingdom', 'Uruguay', 'Uzbekistan', - 'Vanuatu', 'Kota Vatican', 'Venezuela', 'Vietnam', - 'Yaman', - 'Zambia', 'Zimbabwe', - ]; - - /** - * Return a building prefix - * - * @example 'No.' - * - * @return string - */ - public static function buildingPrefix() - { - return static::randomElement(static::$buildingPrefix); - } - - /** - * Return a building number - * - * @example '123' - * - * @return string - */ - public static function buildingNumber() - { - return static::toUpper(static::lexify(static::numerify(static::randomElement(static::$buildingNumber)))); - } - - /** - * Return a street prefix - * - * @example 'Jalan' - */ - public function streetPrefix() - { - $format = static::randomElement(static::$streetPrefix); - - return $this->generator->parse($format); - } - - /** - * Return a complete streename - * - * @example 'Jalan Utama 7' - * - * @return string - */ - public function streetName() - { - $format = static::toUpper(static::lexify(static::numerify(static::randomElement(static::$streetNameFormats)))); - - return $this->generator->parse($format); - } - - /** - * Return a randown township - * - * @example Taman Bahagia - * - * @return string - */ - public function township() - { - $format = static::toUpper(static::lexify(static::numerify(static::randomElement(static::$townshipFormats)))); - - return $this->generator->parse($format); - } - - /** - * Return a township prefix abbreviation - * - * @example 'USJ' - * - * @return string - */ - public function townshipPrefixAbbr() - { - return static::randomElement(static::$townshipPrefixAbbr); - } - - /** - * Return a township prefix - * - * @example 'Taman' - * - * @return string - */ - public function townshipPrefix() - { - return static::randomElement(static::$townshipPrefix); - } - - /** - * Return a township suffix - * - * @example 'Bahagia' - */ - public function townshipSuffix() - { - return static::randomElement(static::$townshipSuffix); - } - - /** - * Return a postcode based on state - * - * @example '55100' - * - * @see https://en.wikipedia.org/wiki/Postal_codes_in_Malaysia#States - * - * @param string|null $state 'state' or null - * - * @return string - */ - public static function postcode($state = null) - { - $format = [ - 'perlis' => [ // (01000 - 02800) - '0' . self::numberBetween(1000, 2800), - ], - 'kedah' => [ // (05000 - 09810) - '0' . self::numberBetween(5000, 9810), - ], - 'penang' => [ // (10000 - 14400) - self::numberBetween(10000, 14400), - ], - 'kelantan' => [ // (15000 - 18500) - self::numberBetween(15000, 18500), - ], - 'terengganu' => [ // (20000 - 24300) - self::numberBetween(20000, 24300), - ], - 'pahang' => [ // (25000 - 28800 | 39000 - 39200 | 49000, 69000) - self::numberBetween(25000, 28800), - self::numberBetween(39000, 39200), - self::numberBetween(49000, 69000), - ], - 'perak' => [ // (30000 - 36810) - self::numberBetween(30000, 36810), - ], - 'selangor' => [ // (40000 - 48300 | 63000 - 68100) - self::numberBetween(40000, 48300), - self::numberBetween(63000, 68100), - ], - 'kl' => [ // (50000 - 60000) - self::numberBetween(50000, 60000), - ], - 'putrajaya' => [ // (62000 - 62988) - self::numberBetween(62000, 62988), - ], - 'nsembilan' => [ // (70000 - 73509) - self::numberBetween(70000, 73509), - ], - 'melaka' => [ // (75000 - 78309) - self::numberBetween(75000, 78309), - ], - 'johor' => [ // (79000 - 86900) - self::numberBetween(79000, 86900), - ], - 'labuan' => [ // (87000 - 87033) - self::numberBetween(87000, 87033), - ], - 'sabah' => [ // (88000 - 91309) - self::numberBetween(88000, 91309), - ], - 'sarawak' => [ // (93000 - 98859) - self::numberBetween(93000, 98859), - ], - ]; - - $postcode = null === $state ? static::randomElement($format) : $format[$state]; - - return (string) static::randomElement($postcode); - } - - /** - * Return the complete town address with matching postcode and state - * - * @example 55100 Bukit Bintang, Kuala Lumpur - * - * @return string - */ - public function townState() - { - $state = static::randomElement(array_keys(static::$states)); - $postcode = static::postcode($state); - $town = static::randomElement(static::$towns[$state]); - $state = static::randomElement(static::$states[$state]); - - return $postcode . ' ' . $town . ', ' . $state; - } - - /** - * Return a random city (town) - * - * @example 'Ampang' - * - * @return string - */ - public function city() - { - $state = static::randomElement(array_keys(static::$towns)); - - return static::randomElement(static::$towns[$state]); - } - - /** - * Return a random state - * - * @example 'Johor' - * - * @return string - */ - public function state() - { - $state = static::randomElement(array_keys(static::$states)); - - return static::randomElement(static::$states[$state]); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/ms_MY/Company.php b/vendor/fakerphp/faker/src/Faker/Provider/ms_MY/Company.php deleted file mode 100644 index 4dc8b2cb..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/ms_MY/Company.php +++ /dev/null @@ -1,105 +0,0 @@ -generator->parse($formats); - } - - /** - * Return Peninsular prefix alphabet - * - * @example 'W' - * - * @return string - */ - public static function peninsularPrefix() - { - return static::randomElement(static::$peninsularPrefix); - } - - /** - * Return Sarawak state prefix alphabet - * - * @example 'QA' - * - * @return string - */ - public static function sarawakPrefix() - { - return static::randomElement(static::$sarawakPrefix); - } - - /** - * Return Sabah state prefix alphabet - * - * @example 'SA' - * - * @return string - */ - public static function sabahPrefix() - { - return static::randomElement(static::$sabahPrefix); - } - - /** - * Return specialty licence plate prefix - * - * @example 'G1M' - * - * @return string - */ - public static function specialPrefix() - { - return static::randomElement(static::$specialPrefix); - } - - /** - * Return a valid license plate alphabet - * - * @example 'A' - * - * @return string - */ - public static function validAlphabet() - { - return static::randomElement(static::$validAlphabets); - } - - /** - * Return a valid number sequence between 1 and 9999 - * - * @example '1234' - * - * @return int - */ - public static function numberSequence() - { - return self::numberBetween(1, 9999); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/ms_MY/Payment.php b/vendor/fakerphp/faker/src/Faker/Provider/ms_MY/Payment.php deleted file mode 100644 index b64c2bbd..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/ms_MY/Payment.php +++ /dev/null @@ -1,244 +0,0 @@ -generator->parse($formats); - } - - /** - * Return a Malaysian Bank account number - * - * @example '1234567890123456' - * - * @return string - */ - public function bankAccountNumber() - { - $formats = static::randomElement(static::$bankAccountNumberFormats); - - return static::numerify($formats); - } - - /** - * Return a Malaysian Local Bank - * - * @example 'Public Bank' - * - * @return string - */ - public static function localBank() - { - return static::randomElement(static::$localBanks); - } - - /** - * Return a Malaysian Foreign Bank - * - * @example 'Citibank Berhad' - * - * @return string - */ - public static function foreignBank() - { - return static::randomElement(static::$foreignBanks); - } - - /** - * Return a Malaysian Government Bank - * - * @example 'Bank Simpanan Nasional' - * - * @return string - */ - public static function governmentBank() - { - return static::randomElement(static::$governmentBanks); - } - - /** - * Return a Malaysian insurance company - * - * @example 'AIA Malaysia' - * - * @return string - */ - public static function insurance() - { - return static::randomElement(static::$insuranceCompanies); - } - - /** - * Return a Malaysian Bank SWIFT Code - * - * @example 'MBBEMYKLXXX' - * - * @return string - */ - public static function swiftCode() - { - return static::toUpper(static::lexify(static::randomElement(static::$swiftCodes))); - } - - /** - * Return the Malaysian currency symbol - * - * @example 'RM' - * - * @return string - */ - public static function currencySymbol() - { - return static::randomElement(static::$currencySymbol); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/ms_MY/Person.php b/vendor/fakerphp/faker/src/Faker/Provider/ms_MY/Person.php deleted file mode 100644 index 1cd011bf..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/ms_MY/Person.php +++ /dev/null @@ -1,811 +0,0 @@ -generator->parse(static::randomElement($formats)); - } - - /** - * Return a Malaysian I.C. No. - * - * @example '890123-45-6789' - * - * @see https://en.wikipedia.org/wiki/Malaysian_identity_card#Structure_of_the_National_Registration_Identity_Card_Number_(NRIC) - * - * @param string|null $gender 'male', 'female' or null for any - * @param bool|string|null $hyphen true, false, or any separator characters - * - * @return string - */ - public static function myKadNumber($gender = null, $hyphen = false) - { - // year of birth - $yy = self::numberBetween(0, 99); - - // month of birth - $mm = DateTime::month(); - - // day of birth - $dd = DateTime::dayOfMonth(); - - // place of birth (1-59 except 17-20) - while (in_array($pb = self::numberBetween(1, 59), [17, 18, 19, 20], false)) { - } - - // random number - $nnn = self::numberBetween(0, 999); - - // gender digit. Odd = MALE, Even = FEMALE - $g = self::numberBetween(0, 9); - //Credit: https://gist.github.com/mauris/3629548 - if ($gender === static::GENDER_MALE) { - $g = $g | 1; - } elseif ($gender === static::GENDER_FEMALE) { - $g = $g & ~1; - } - - // formatting with hyphen - if ($hyphen === true) { - $hyphen = '-'; - } elseif ($hyphen === false) { - $hyphen = ''; - } - - return sprintf('%02d%02d%02d%s%02d%s%03d%01d', $yy, $mm, $dd, $hyphen, $pb, $hyphen, $nnn, $g); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/ms_MY/PhoneNumber.php b/vendor/fakerphp/faker/src/Faker/Provider/ms_MY/PhoneNumber.php deleted file mode 100644 index 7cce02fa..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/ms_MY/PhoneNumber.php +++ /dev/null @@ -1,217 +0,0 @@ -generator->parse($format)); - } - - return static::numerify($this->generator->parse($format)); - } - - /** - * Return prefix digits for 011 numbers - * - * @example '10' - * - * @return string - */ - public static function zeroOneOnePrefix() - { - return static::numerify(static::randomElement(static::$zeroOneOnePrefix)); - } - - /** - * Return prefix digits for 014 numbers - * - * @example '2' - * - * @return string - */ - public static function zeroOneFourPrefix() - { - return static::numerify(static::randomElement(static::$zeroOneFourPrefix)); - } - - /** - * Return prefix digits for 015 numbers - * - * @example '1' - * - * @return string - */ - public static function zeroOneFivePrefix() - { - return static::numerify(static::randomElement(static::$zeroOneFivePrefix)); - } - - /** - * Return a Malaysian Fixed Line Phone Number. - * - * @example '+603-4567-8912' - * - * @param bool $countryCodePrefix true, false - * @param bool $formatting true, false - * - * @return string - */ - public function fixedLineNumber($countryCodePrefix = true, $formatting = true) - { - if ($formatting) { - $format = static::randomElement(static::$fixedLineNumberFormatsWithFormatting); - } else { - $format = static::randomElement(static::$fixedLineNumberFormats); - } - - if ($countryCodePrefix) { - return static::countryCodePrefix($formatting) . static::numerify($this->generator->parse($format)); - } - - return static::numerify($this->generator->parse($format)); - } - - /** - * Return a Malaysian VoIP Phone Number. - * - * @example '+6015-678-9234' - * - * @param bool $countryCodePrefix true, false - * @param bool $formatting true, false - * - * @return string - */ - public function voipNumber($countryCodePrefix = true, $formatting = true) - { - if ($formatting) { - $format = static::randomElement(static::$voipNumberWithFormatting); - } else { - $format = static::randomElement(static::$voipNumber); - } - - if ($countryCodePrefix) { - return static::countryCodePrefix($formatting) . static::numerify($this->generator->parse($format)); - } - - return static::numerify($this->generator->parse($format)); - } - - /** - * Return a Malaysian Country Code Prefix. - * - * @example '+6' - * - * @param bool $formatting true, false - * - * @return string - */ - public static function countryCodePrefix($formatting = true) - { - if ($formatting) { - return static::randomElement(static::$plusSymbol) . static::randomElement(static::$countryCodePrefix); - } - - return static::randomElement(static::$countryCodePrefix); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/nb_NO/Address.php b/vendor/fakerphp/faker/src/Faker/Provider/nb_NO/Address.php deleted file mode 100644 index cbc39d7b..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/nb_NO/Address.php +++ /dev/null @@ -1,197 +0,0 @@ -format('dmy'); - - /** - * @todo These number should be random based on birth year - * - * @see http://no.wikipedia.org/wiki/F%C3%B8dselsnummer - */ - $randomDigits = (string) static::numerify('##'); - - switch ($gender) { - case static::GENDER_MALE: - $genderDigit = static::randomElement([1, 3, 5, 7, 9]); - - break; - - case static::GENDER_FEMALE: - $genderDigit = static::randomElement([0, 2, 4, 6, 8]); - - break; - - default: - $genderDigit = (string) static::numerify('#'); - } - - $digits = $datePart . $randomDigits . $genderDigit; - - /** - * @todo Calculate modulo 11 of $digits - * - * @see http://no.wikipedia.org/wiki/F%C3%B8dselsnummer - */ - $checksum = (string) static::numerify('##'); - - return $digits . $checksum; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/nb_NO/PhoneNumber.php b/vendor/fakerphp/faker/src/Faker/Provider/nb_NO/PhoneNumber.php deleted file mode 100644 index 4767db48..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/nb_NO/PhoneNumber.php +++ /dev/null @@ -1,41 +0,0 @@ -generator->parse($format)); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/ne_NP/Address.php b/vendor/fakerphp/faker/src/Faker/Provider/ne_NP/Address.php deleted file mode 100644 index 59b31de4..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/ne_NP/Address.php +++ /dev/null @@ -1,131 +0,0 @@ -format('ymd')); - $help = $date->format('Y') >= 2000 ? 2 : null; - - $check = (int) ($help . $dob . $middle); - $rest = sprintf('%02d', 97 - ($check % 97)); - - return $dob . $middle . $rest; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/nl_BE/PhoneNumber.php b/vendor/fakerphp/faker/src/Faker/Provider/nl_BE/PhoneNumber.php deleted file mode 100644 index 9e4a3917..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/nl_BE/PhoneNumber.php +++ /dev/null @@ -1,20 +0,0 @@ -generator->lastName(); - - break; - } - - if (Miscellaneous::boolean()) { - return $companyName . ' ' . static::randomElement(static::$companySuffix); - } - - return $companyName; - } - - /** - * Belasting Toegevoegde Waarde (BTW) = VAT - * - * @example 'NL123456789B01' - * - * @see https://www.belastingdienst.nl/wps/wcm/connect/bldcontentnl/belastingdienst/zakelijk/btw/administratie_bijhouden/btw_nummers_controleren/uw_btw_nummer - * - * @return string VAT Number - */ - public static function vat() - { - return sprintf('%s%d%s%d', 'NL', self::randomNumber(9, true), 'B', self::randomNumber(2, true)); - } - - /** - * Alias dutch vat number format - * - * @return string - */ - public static function btw() - { - return self::vat(); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/nl_NL/Internet.php b/vendor/fakerphp/faker/src/Faker/Provider/nl_NL/Internet.php deleted file mode 100644 index bf30e795..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/nl_NL/Internet.php +++ /dev/null @@ -1,9 +0,0 @@ - 9) { - if ($nr[1] > 0) { - $nr[0] = 8; - --$nr[1]; - } else { - $nr[0] = 1; - ++$nr[1]; - } - } - - return implode('', array_reverse($nr)); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/nl_NL/PhoneNumber.php b/vendor/fakerphp/faker/src/Faker/Provider/nl_NL/PhoneNumber.php deleted file mode 100644 index 5d4163a0..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/nl_NL/PhoneNumber.php +++ /dev/null @@ -1,39 +0,0 @@ - 'D', - 'kujawsko-pomorskie' => 'C', - 'lubelskie' => 'L', - 'lubuskie' => 'F', - 'łódzkie' => 'E', - 'małopolskie' => 'K', - 'mazowieckie' => 'W', - 'opolskie' => 'O', - 'podkarpackie' => 'R', - 'podlaskie' => 'B', - 'pomorskie' => 'G', - 'śląskie' => 'S', - 'świętokrzyskie' => 'T', - 'warmińsko-mazurskie' => 'N', - 'wielkopolskie' => 'P', - 'zachodniopomorskie' => 'Z', - ]; - - /** - * @var array list of special vehicle registration number prefixes. - */ - protected static $specials = [ - 'army' => 'U', - 'services' => 'H', - ]; - - /** - * @var array list of Polish counties and respective vehicle registration number prefixes. - */ - protected static $counties = [ - 'D' => [ - 'Jelenia Góra' => ['J'], - 'Legnica' => ['L'], - 'Wałbrzych' => ['B'], - 'Wrocław' => ['W', 'X'], - 'bolesławiecki' => ['BL'], - 'dzierżoniowski' => ['DZ'], - 'głogowski' => ['GL'], - 'górowski' => ['GR'], - 'jaworski' => ['JA'], - 'jeleniogórski' => ['JE'], - 'kamiennogórski' => ['KA'], - 'kłodzki' => ['KL'], - 'legnicki' => ['LE'], - 'lubański' => ['LB'], - 'lubiński' => ['LU'], - 'lwówecki' => ['LW'], - 'milicki' => ['MI'], - 'oleśnicki' => ['OL'], - 'oławski' => ['OA'], - 'polkowicki' => ['PL'], - 'strzeliński' => ['ST'], - 'średzki' => ['SR'], - 'świdnicki' => ['SW'], - 'trzebnicki' => ['TR'], - 'wałbrzyski' => ['BA'], - 'wołowski' => ['WL'], - 'wrocławski' => ['WR'], - 'ząbkowicki' => ['ZA'], - 'zgorzelecki' => ['ZG'], - 'złotoryjski' => ['ZL'], - ], - 'C' => [ - 'Bydgoszcz' => ['B'], - 'Grudziądz' => ['G'], - 'Toruń' => ['T'], - 'Włocławek' => ['W'], - 'aleksandrowski' => ['AL'], - 'brodnicki' => ['BR'], - 'bydgoski' => ['BY'], - 'chełmiński' => ['CH'], - 'golubsko-dobrzyński' => ['GD'], - 'grudziądzki' => ['GR'], - 'inowrocławski' => ['IN'], - 'lipnowski' => ['LI'], - 'mogileński' => ['MG'], - 'nakielski' => ['NA'], - 'radziejowski' => ['RA'], - 'rypiński' => ['RY'], - 'sępoleński' => ['SE'], - 'świecki' => ['SW'], - 'toruński' => ['TR'], - 'tucholski' => ['TU'], - 'wąbrzeski' => ['WA'], - 'włocławski' => ['WL'], - 'żniński' => ['ZN'], - ], - 'L' => [ - 'Biała Podlaska' => ['B'], - 'Chełm' => ['C'], - 'Lublin' => ['U'], - 'Zamość' => ['Z'], - 'bialski' => ['BI'], - 'biłgorajski' => ['BL'], - 'chełmski' => ['CH'], - 'hrubieszowski' => ['HR'], - 'janowski' => ['JA'], - 'krasnostawski' => ['KS'], - 'kraśnicki' => ['KR'], - 'lubartowski' => ['LB'], - 'lubelski' => ['UB'], - 'łęczyński' => ['LE'], - 'łukowski' => ['LU'], - 'opolski' => ['OP'], - 'parczewski' => ['PA'], - 'puławski' => ['PU'], - 'radzyński' => ['RA'], - 'rycki' => ['RY'], - 'świdnicki' => ['SW'], - 'tomaszowski' => ['TM'], - 'włodawski' => ['WL'], - 'zamojski' => ['ZA'], - ], - 'F' => [ - 'Gorzów Wielkopolski' => ['G'], - 'Zielona Góra' => ['Z'], - 'gorzowski' => ['GW'], - 'krośnieński' => ['KR'], - 'międzyrzecki' => ['MI'], - 'nowosolski' => ['NW'], - 'słubicki' => ['SL'], - 'strzelecko-drezdenecki' => ['SD'], - 'sulęciński' => ['SU'], - 'świebodziński' => ['SW'], - 'wschowski' => ['WS'], - 'zielonogórski' => ['ZI'], - 'żagański' => ['ZG'], - 'żarski' => ['ZA'], - ], - 'E' => [ - 'Łódź' => ['L'], - 'Piotrków Trybunalski' => ['P'], - 'Skierniewice' => ['S'], - 'brzeziński' => ['BR'], - 'bełchatowski' => ['BE'], - 'kutnowski' => ['KU'], - 'łaski' => ['LA'], - 'łęczycki' => ['LE'], - 'łowicki' => ['LC'], - 'łódzki wschodni' => ['LW'], - 'opoczyński' => ['OP'], - 'pabianicki' => ['PA'], - 'pajęczański' => ['PJ'], - 'piotrkowski' => ['PI'], - 'poddębicki' => ['PD'], - 'radomszczański' => ['RA'], - 'rawski' => ['RW'], - 'sieradzki' => ['SI'], - 'skierniewicki' => ['SK'], - 'tomaszowski' => ['TM'], - 'wieluński' => ['WI'], - 'wieruszowski' => ['WE'], - 'zduńskowolski' => ['ZD'], - 'zgierski' => ['ZG'], - ], - 'K' => [ - 'Kraków' => ['R'], - 'Nowy Sącz' => ['N'], - 'Tarnów' => ['T'], - 'bocheński' => ['BA', 'BC'], - 'brzeski' => ['BR'], - 'chrzanowski' => ['CH'], - 'dąbrowski' => ['DA'], - 'gorlicki' => ['GR'], - 'krakowski' => ['RA'], - 'limanowski' => ['LI'], - 'miechowski' => ['MI'], - 'myślenicki' => ['MY'], - 'nowosądecki' => ['NS'], - 'nowotarski' => ['NT'], - 'olkuski' => ['OL'], - 'oświęcimski' => ['OS'], - 'proszowicki' => ['PR'], - 'suski' => ['SU'], - 'tarnowski' => ['TA'], - 'tatrzański' => ['TT'], - 'wadowicki' => ['WA'], - 'wielicki' => ['WI'], - ], - 'W' => [ - 'Ostrołęka' => ['O'], - 'Płock' => ['P'], - 'Radom' => ['R'], - 'Siedlce' => ['S'], - 'białobrzeski' => ['BR'], - 'ciechanowski' => ['CI'], - 'garwoliński' => ['G'], - 'gostyniński' => ['GS'], - 'grodziski' => ['GM'], - 'grójecki' => ['GR'], - 'kozienicki' => ['KZ'], - 'legionowski' => ['L'], - 'lipski' => ['LI'], - 'łosicki' => ['LS'], - 'makowski' => ['MA'], - 'miński' => ['M'], - 'mławski' => ['ML'], - 'nowodworski' => ['ND'], - 'ostrołęcki' => ['OS'], - 'ostrowski' => ['OR'], - 'otwocki' => ['OT'], - 'piaseczyński' => ['PA', 'PI'], - 'płocki' => ['PL'], - 'płoński' => ['PN'], - 'pruszkowski' => ['PP', 'PR', 'PS'], - 'przasnyski' => ['PZ'], - 'przysuski' => ['PY'], - 'pułtuski' => ['PU'], - 'radomski' => ['RA'], - 'siedlecki' => ['SI'], - 'sierpecki' => ['SE'], - 'sochaczewski' => ['SC'], - 'sokołowski' => ['SK'], - 'szydłowiecki' => ['SZ'], - 'warszawski' => ['A', 'B', 'D', 'E', 'F', 'H', 'I', 'J', 'K', 'N', 'T', 'U', 'W', 'X', 'Y'], - 'warszawski zachodni' => ['Z'], - 'węgrowski' => ['WE'], - 'wołomiński' => ['WL', 'V'], - 'wyszkowski' => ['WY'], - 'zwoleński' => ['ZW'], - 'żuromiński' => ['ZU'], - 'żyrardowski' => ['ZY'], - ], - 'O' => [ - 'Opole' => ['P'], - 'brzeski' => ['B'], - 'głubczycki' => ['GL'], - 'kędzierzyńsko-kozielski' => ['K'], - 'kluczborski' => ['KL'], - 'krapkowicki' => ['KR'], - 'namysłowski' => ['NA'], - 'nyski' => ['NY'], - 'oleski' => ['OL'], - 'opolski' => ['PO'], - 'prudnicki' => ['PR'], - 'strzelecki' => ['ST'], - ], - 'R' => [ - 'Krosno' => ['K'], - 'Przemyśl' => ['P'], - 'Rzeszów' => ['Z'], - 'Tarnobrzeg' => ['T'], - 'bieszczadzki' => ['BI'], - 'brzozowski' => ['BR'], - 'dębicki' => ['DE'], - 'jarosławski' => ['JA'], - 'jasielski' => ['JS'], - 'kolbuszowski' => ['KL'], - 'krośnieński' => ['KR'], - 'leski' => ['LS'], - 'leżajski' => ['LE'], - 'lubaczowski' => ['LU'], - 'łańcucki' => ['LA'], - 'mielecki' => ['MI'], - 'niżański' => ['NI'], - 'przemyski' => ['PR'], - 'przeworski' => ['PZ'], - 'ropczycko-sędziszowski' => ['RS'], - 'rzeszowski' => ['ZE'], - 'sanocki' => ['SA'], - 'stalowowolski' => ['ST'], - 'strzyżowski' => ['SR'], - 'tarnobrzeski' => ['TA'], - ], - 'B' => [ - 'Białystok' => ['I'], - 'Łomża' => ['L'], - 'Suwałki' => ['S'], - 'augustowski' => ['AU'], - 'białostocki' => ['IA'], - 'bielski' => ['BI'], - 'grajewski' => ['GR'], - 'hajnowski' => ['HA'], - 'kolneński' => ['KL'], - 'łomżyński' => ['LM'], - 'moniecki' => ['MN'], - 'sejneński' => ['SE'], - 'siemiatycki' => ['SI'], - 'sokólski' => ['SK'], - 'suwalski' => ['SU'], - 'wysokomazowiecki' => ['WM'], - 'zambrowski' => ['ZA'], - ], - 'G' => [ - 'Gdańsk' => ['D'], - 'Gdynia' => ['A'], - 'Słupsk' => ['S'], - 'Sopot' => ['SP'], - 'bytowski' => ['BY'], - 'chojnicki' => ['CH'], - 'człuchowski' => ['CZ'], - 'gdański' => ['DA'], - 'kartuski' => ['KY', 'KA'], - 'kościerski' => ['KS'], - 'kwidzyński' => ['KW'], - 'lęborski' => ['LE'], - 'malborski' => ['MB'], - 'nowodworski' => ['ND'], - 'pucki' => ['PU'], - 'słupski' => ['SL'], - 'starogardzki' => ['ST'], - 'sztumski' => ['SZ'], - 'tczewski' => ['TC'], - 'wejherowski' => ['WE', 'WO'], - ], - 'S' => [ - 'Bielsko-Biała' => ['B'], - 'Bytom' => ['Y'], - 'Chorzów' => ['H'], - 'Częstochowa' => ['C'], - 'Dąbrowa Górnicza' => ['D'], - 'Gliwice' => ['G'], - 'Jastrzębie-Zdrój' => ['JZ'], - 'Jaworzno' => ['J'], - 'Katowice' => ['K'], - 'Mysłowice' => ['M'], - 'Piekary Śląskie' => ['PI'], - 'Ruda Śląska,' => ['L', 'RS'], - 'Rybnik' => ['R'], - 'Siemianowice Śląskie' => ['I'], - 'Sosnowiec' => ['O'], - 'Świętochłowice' => ['W'], - 'Tychy' => ['T'], - 'Zabrze' => ['Z'], - 'Żory' => ['ZO'], - 'będziński' => ['BE'], - 'bielski' => ['BI'], - 'cieszyński' => ['CN', 'CI'], - 'częstochowski' => ['CZ'], - 'gliwicki' => ['GL'], - 'kłobucki' => ['KL'], - 'lubliniecki' => ['LU'], - 'mikołowski' => ['MI'], - 'myszkowski' => ['MY'], - 'pszczyński' => ['PS'], - 'raciborski' => ['RC'], - 'rybnicki' => ['RB'], - 'tarnogórski' => ['TA'], - 'bieruńsko - lędziński' => ['BL'], - 'wodzisławski' => ['WD', 'WZ'], - 'zawierciański' => ['ZA'], - 'żywiecki' => ['ZY'], - ], - 'T' => [ - 'Kielce' => ['K'], - 'buski' => ['BU'], - 'jędrzejowski' => ['JE'], - 'kazimierski' => ['KA'], - 'kielecki' => ['KI'], - 'konecki' => ['KN'], - 'opatowski' => ['OP'], - 'ostrowiecki' => ['OS'], - 'pińczowski' => ['PI'], - 'sandomierski' => ['SA'], - 'skarżyski' => ['SK'], - 'starachowicki' => ['ST'], - 'staszowski' => ['SZ'], - 'włoszczowski' => ['LW'], - ], - 'N' => [ - 'Elbląg' => ['E'], - 'Olsztyn' => ['O'], - 'bartoszycki' => ['BA'], - 'braniewski' => ['BR'], - 'działdowski' => ['DZ'], - 'elbląski' => ['EB'], - 'ełcki' => ['EL'], - 'giżycki' => ['GI'], - 'iławski' => ['IL'], - 'kętrzyński' => ['KE'], - 'lidzbarski' => ['LI'], - 'mrągowski' => ['MR'], - 'nidzicki' => ['NI'], - 'nowomiejski' => ['NM'], - 'olecki' => ['OE'], - 'gołdapski' => ['GO'], - 'olsztyński' => ['OL'], - 'ostródzki' => ['OS'], - 'piski' => ['PI'], - 'szczycieński' => ['SZ'], - 'węgorzewski' => ['WE'], - ], - 'P' => [ - 'Kalisz' => ['A', 'K'], - 'Konin' => ['KO', 'N'], - 'Leszno' => ['L'], - 'Poznań' => ['O', 'Y'], - 'chodzieski' => ['CH'], - 'czarnkowsko-trzcianecki' => ['CT'], - 'gnieźnieński' => ['GN'], - 'gostyński' => ['GS'], - 'grodziski' => ['GO'], - 'jarociński' => ['JA'], - 'kaliski' => ['KA'], - 'kępiński' => ['KE'], - 'kolski' => ['KL'], - 'koniński' => ['KN'], - 'kościański' => ['KS'], - 'krotoszyński' => ['KR'], - 'leszczyński' => ['LE'], - 'międzychodzki' => ['MI'], - 'nowotomyski' => ['NT'], - 'obornicki' => ['OB'], - 'ostrowski' => ['OS'], - 'ostrzeszowski' => ['OT'], - 'pilski' => ['P'], - 'pleszewski' => ['PL'], - 'poznański' => ['OZ', 'Z'], - 'rawicki' => ['RA'], - 'słupecki' => ['SL'], - 'szamotulski' => ['SZ'], - 'średzki' => ['SR'], - 'śremski' => ['SE'], - 'turecki' => ['TU'], - 'wągrowiecki' => ['WA'], - 'wolsztyński' => ['WL'], - 'wrzesiński' => ['WR'], - 'złotowski' => ['ZL'], - ], - 'Z' => [ - 'Koszalin' => ['K'], - 'Szczecin' => ['S', 'Z'], - 'Świnoujście' => ['SW'], - 'białogardzki' => ['BI'], - 'choszczeński' => ['CH'], - 'drawski' => ['DR'], - 'goleniowski' => ['GL'], - 'gryficki' => ['GY'], - 'gryfiński' => ['GR'], - 'kamieński' => ['KA'], - 'kołobrzeski' => ['KL'], - 'koszaliński' => ['KO'], - 'łobeski' => ['LO'], - 'myśliborski' => ['MY'], - 'policki' => ['PL'], - 'pyrzycki' => ['PY'], - 'sławieński' => ['SL'], - 'stargardzki' => ['ST'], - 'szczecinecki' => ['SZ'], - 'świdwiński' => ['SD'], - 'wałecki' => ['WA'], - ], - 'U' => [ - 'Siły Zbrojne Rzeczypospolitej Polskiej' => ['A', 'B', 'C', 'D', 'E', 'G', 'I', 'J', 'K', 'L'], - ], - 'H' => [ - 'Centralne Biuro Antykorupcyjne' => ['A'], - 'Służba Ochrony Państwa' => ['BA', 'BB', 'BE', 'BF', 'BG'], - 'Służba Celno-Skarbowa' => ['CA', 'CB', 'CC', 'CD', 'CE', 'CF', 'CG', 'CH', 'CJ', 'CK', 'CL', 'CM', 'CN', 'CO', 'CP', 'CR'], - 'Agencja Bezpieczeństwa Wewnętrznego' => ['K'], - 'Agencja Wywiadu' => ['K'], - 'Służba Kontrwywiadu Wojskowego' => ['M'], - 'Służba Wywiadu Wojskowego' => ['M'], - 'Policja' => ['PA', 'PB', 'PC', 'PD', 'PE', 'PF', 'PG', 'PH', 'PJ', 'PK', 'PL', 'PL', 'PL', 'PL', 'PL', 'PM', 'PN', 'PP', 'PS', 'PT', 'PU', 'PW', 'PZ'], - 'Straż Graniczna' => ['WA', 'WK'], - ], - ]; - - /** - * @var array list of regex expressions matching Polish license plate suffixess when county code is 1 character long. - */ - protected static $plateSuffixesGroup1 = [ - '\d{5}', - '\d{4}[A-PR-Z]', - '\d{3}[A-PR-Z]{2}', - '[1-9][A-PR-Z]\d{3}', - '[1-9][A-PR-Z]{2}\d{2}', - ]; - - /** - * @var array list of regex expressions matching Polish license plate suffixess when county code is 2 characters long. - */ - protected static $plateSuffixesGroup2 = [ - '[A-PR-Z]\d{3}', - '\d{2}[A-PR-Z]{2}', - '[1-9][A-PR-Z]\d{2}', - '\d{2}[A-PR-Z][1-9]', - '[1-9][A-PR-Z]{2}[1-9]', - '[A-PR-Z]{2}\d{2}', - '\d{5}', - '\d{4}[A-PR-Z]', - '\d{3}[A-PR-Z]{2}', - '[A-PR-Z]\d{2}[A-PR-Z]', - '[A-PR-Z][1-9][A-PR-Z]{2}', - ]; - - /** - * Generates random license plate. - * - * @param bool $special whether special license plates should be included - * @param array|null $voivodeships list of voivodeships license plate should be generated from - * @param array|null $counties list of counties license plate should be generated from - */ - public static function licensePlate( - bool $special = false, - ?array $voivodeships = null, - ?array $counties = null - ): string { - $voivodeshipsAvailable = static::$voivodeships + ($special ? static::$specials : []); - $voivodeshipCode = static::selectRandomArea($voivodeshipsAvailable, $voivodeships); - - $countiesAvailable = static::$counties[$voivodeshipCode]; - $countySelected = self::selectRandomArea($countiesAvailable, $counties); - - $countyCode = static::randomElement($countySelected); - - $suffix = static::regexify(static::randomElement(strlen($countyCode) === 1 ? static::$plateSuffixesGroup1 : static::$plateSuffixesGroup2)); - - return "{$voivodeshipCode}{$countyCode} {$suffix}"; - } - - /** - * Selects random area from the list of available and requested. - */ - protected static function selectRandomArea(array $available, ?array $requested) - { - $requested = array_intersect(array_keys($available), $requested ?? []); - - if (empty($requested)) { - $requested = array_keys($available); - } - - return $available[static::randomElement($requested)]; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/pl_PL/Payment.php b/vendor/fakerphp/faker/src/Faker/Provider/pl_PL/Payment.php deleted file mode 100644 index f2a60307..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/pl_PL/Payment.php +++ /dev/null @@ -1,120 +0,0 @@ - 'Narodowy Bank Polski', - '102' => 'Powszechna Kasa Oszczędności Bank Polski Spółka Akcyjna', - '103' => 'Bank Handlowy w Warszawie Spółka Akcyjna', - '105' => 'ING Bank Śląski Spółka Akcyjna', - '106' => 'Bank BPH Spółka Akcyjna', - '109' => 'Santander Bank Polska Spółka Akcyjna', - '113' => 'Bank Gospodarstwa Krajowego', - '114' => 'mBank Spółka Akcyjna', - '116' => 'Bank Millennium Spółka Akcyjna', - '122' => 'Bank Handlowo-Kredytowy Spółka Akcyjna w Katowicach w likwidacji', - '124' => 'Bank Polska Kasa Opieki Spółka Akcyjna', - '132' => 'Bank Pocztowy Spółka Akcyjna', - '154' => 'Bank Ochrony Środowiska Spółka Akcyjna', - '158' => 'Mercedes-Benz Bank Polska Spółka Akcyjna', - '161' => 'SGB-Bank Spółka Akcyjna', - '168' => 'PLUS BANK Spółka Akcyjna', - '184' => 'Société Générale Spółka Akcyjna Oddział w Polsce', - '187' => 'Nest Bank Spółka Akcyjna', - '189' => 'Pekao Bank Hipoteczny Spółka Akcyjna', - '191' => 'Deutsche Bank Polska Spółka Akcyjna', - '193' => 'BANK POLSKIEJ SPÓŁDZIELCZOŚCI SPÓŁKA AKCYJNA', - '194' => 'Credit Agricole Bank Polska Spółka Akcyjna', - '195' => 'Idea Bank Spółka Akcyjna', - '203' => 'BNP Paribas Bank Polska Spółka Akcyjna', - '212' => 'Santander Consumer Bank Spółka Akcyjna', - '215' => 'mBank Hipoteczny Spółka Akcyjna', - '216' => 'Toyota Bank Polska Spółka Akcyjna', - '219' => 'DNB Bank Polska Spółka Akcyjna', - '224' => 'Banque PSA Finance Spółka Akcyjna Oddział w Polsce', - '225' => 'Svenska Handelsbanken AB Spółka Akcyjna Oddział w Polsce', - '235' => 'BNP Paribas S.A. Oddział w Polsce ', - '236' => 'Danske Bank A/S Spółka Akcyjna Oddział w Polsce', - '237' => 'Skandinaviska Enskilda Banken AB (Spółka Akcyjna) - Oddział w Polsce', - '239' => 'CAIXABANK, S.A. (SPÓŁKA AKCYJNA) ODDZIAŁ W POLSCE', - '241' => 'Elavon Financial Services Designated Activity Company (Spółka z O.O. o Wyznaczonym Przedmiocie Działalności) Oddział w Polsce', - '243' => 'BNP Paribas Securities Services Spółka Komandytowo - Akcyjna Oddział w Polsce', - '247' => 'HAITONG BANK, S.A. Spółka Akcyjna Oddział w Polsce', - '248' => 'Getin Noble Bank Spółka Akcyjna', - '249' => 'Alior Bank Spółka Akcyjna', - '251' => 'Aareal Bank Aktiengesellschaft (Spółka Akcyjna) - Oddział w Polsce', - '254' => 'Citibank Europe plc (Publiczna Spółka Akcyjna) Oddział w Polsce', - '255' => 'Ikano Bank AB (publ) Spółka Akcyjna Oddział w Polsce', - '256' => 'Nordea Bank Abp Spółka Akcyjna Oddział w Polsce', - '258' => 'J.P. Morgan Europe Limited Spółka z ograniczoną odpowiedzialnością Oddział w Polsce', - '260' => 'Bank of China (Luxembourg) S.A. Spółka Akcyjna Oddział w Polsce', - '262' => 'Industrial and Commercial Bank of China (Europe) S.A. (Spółka Akcyjna) Oddział w Polsce', - '264' => 'RCI Banque Spółka Akcyjna Oddział w Polsce', - '265' => 'EUROCLEAR Bank SA/NV (Spółka Akcyjna) - Oddział w Polsce', - '266' => 'Intesa Sanpaolo S.p.A. Spółka Akcyjna Oddział w Polsce', - '267' => 'Western Union International Bank GmbH, Sp. z o.o. Oddział w Polsce', - '269' => 'PKO Bank Hipoteczny Spółka Akcyjna', - '270' => 'TF BANK AB (Spółka z ograniczoną odpowiedzialnością) Oddział w Polsce', - '271' => 'FCE Bank Spółka Akcyjna Oddział w Polsce', - '272' => 'AS Inbank Spółka Akcyjna - Oddział w Polsce', - '273' => 'China Construction Bank (Europe) S.A. (Spółka Akcyjna) Oddział w Polsce', - '274' => 'MUFG Bank (Europe) N.V. S.A. Oddział w Polsce', - '275' => 'John Deere Bank S.A. Spółka Akcyjna Oddział w Polsce ', - '277' => 'Volkswagen Bank GmbH Spółka z ograniczoną odpowiedzialnością Oddział w Polsce', - '278' => 'ING Bank Hipoteczny Spółka Akcyjna', - '279' => 'Raiffeisen Bank International AG (Spółka Akcyjna) Oddział w Polsce', - '280' => 'HSBC France (Spółka Akcyjna) Oddział w Polsce', - '281' => 'Goldman Sachs Bank Europe SE Spółka Europejska Oddział w Polsce', - '283' => 'J.P. Morgan AG (Spółka Akcyjna) Oddział w Polsce', - '284' => 'UBS Europe SE (Spółka Europejska) Oddział w Polsce', - '285' => 'Banca Farmafactoring S.p.A. Spółka Akcyjna Oddział w Polsce', - '286' => 'FCA Bank S.p.A. Spółka Akcyjna Oddział w Polsce', - '287' => 'Bank Nowy BFG Spółka Akcyjna', - '288' => 'ALLFUNDS BANK S.A.U. (SPÓŁKA AKCYJNA) ODDZIAŁ W POLSCE', - ]; - - /** - * @example 'Euro Bank SA' - */ - public static function bank() - { - return static::randomElement(static::$banks); - } - - /** - * International Bank Account Number (IBAN) - * - * @see http://en.wikipedia.org/wiki/International_Bank_Account_Number - * - * @param string $prefix for generating bank account number of a specific bank - * @param string $countryCode ISO 3166-1 alpha-2 country code - * @param int $length total length without country code and 2 check digits - * - * @return string - */ - public static function bankAccountNumber($prefix = '', $countryCode = 'PL', $length = null) - { - return static::iban($countryCode, $prefix, $length); - } - - protected static function addBankCodeChecksum($iban, $countryCode = 'PL') - { - if ($countryCode != 'PL' || strlen($iban) <= 8) { - return $iban; - } - $checksum = 0; - $weights = [7, 1, 3, 9, 7, 1, 3]; - - for ($i = 0; $i < 7; ++$i) { - $checksum += $weights[$i] * (int) $iban[$i]; - } - $checksum = $checksum % 10; - - return substr($iban, 0, 7) . $checksum . substr($iban, 8); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/pl_PL/Person.php b/vendor/fakerphp/faker/src/Faker/Provider/pl_PL/Person.php deleted file mode 100644 index 6d7312db..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/pl_PL/Person.php +++ /dev/null @@ -1,243 +0,0 @@ -generator->parse(static::randomElement(static::$lastNameFormat)); - } - - public static function lastNameMale() - { - return static::randomElement(static::$lastNameMale); - } - - public static function lastNameFemale() - { - return static::randomElement(static::$lastNameFemale); - } - - public function title($gender = null) - { - return static::randomElement(static::$title); - } - - /** - * replaced by specific unisex Polish title - */ - public static function titleMale() - { - return static::randomElement(static::$title); - } - - /** - * replaced by specific unisex Polish title - */ - public static function titleFemale() - { - return static::randomElement(static::$title); - } - - /** - * PESEL - Universal Electronic System for Registration of the Population - * - * @see http://en.wikipedia.org/wiki/PESEL - * - * @param DateTime $birthdate - * @param string $sex M for male or F for female - * - * @return string 11 digit number, like 44051401358 - */ - public static function pesel($birthdate = null, $sex = null) - { - if ($birthdate === null) { - $birthdate = \Faker\Provider\DateTime::dateTimeThisCentury(); - } - - $weights = [1, 3, 7, 9, 1, 3, 7, 9, 1, 3]; - $length = count($weights); - - $fullYear = (int) $birthdate->format('Y'); - $year = (int) $birthdate->format('y'); - $month = $birthdate->format('m') + (((int) ($fullYear / 100) - 14) % 5) * 20; - $day = $birthdate->format('d'); - - $result = [(int) ($year / 10), $year % 10, (int) ($month / 10), $month % 10, (int) ($day / 10), $day % 10]; - - for ($i = 6; $i < $length; ++$i) { - $result[$i] = static::randomDigit(); - } - - $result[$length - 1] |= 1; - - if ($sex == 'F') { - $result[$length - 1] -= 1; - } - - $checksum = 0; - - for ($i = 0; $i < $length; ++$i) { - $checksum += $weights[$i] * $result[$i]; - } - $checksum = (10 - ($checksum % 10)) % 10; - $result[] = $checksum; - - return implode('', $result); - } - - /** - * National Identity Card number - * - * @see http://en.wikipedia.org/wiki/Polish_National_Identity_Card - * - * @return string 3 letters and 6 digits, like ABA300000 - */ - public static function personalIdentityNumber() - { - $range = str_split('ABCDEFGHIJKLMNPRSTUVWXYZ'); - $low = ['A', static::randomElement($range), static::randomElement($range)]; - $high = [static::randomDigit(), static::randomDigit(), static::randomDigit(), static::randomDigit(), static::randomDigit()]; - $weights = [7, 3, 1, 7, 3, 1, 7, 3]; - $checksum = 0; - - for ($i = 0, $size = count($low); $i < $size; ++$i) { - $checksum += $weights[$i] * (ord($low[$i]) - 55); - } - - for ($i = 0, $size = count($high); $i < $size; ++$i) { - $checksum += $weights[$i + 3] * $high[$i]; - } - $checksum %= 10; - - return implode('', $low) . $checksum . implode('', $high); - } - - /** - * Taxpayer Identification Number (NIP in Polish) - * - * @see http://en.wikipedia.org/wiki/PESEL#Other_identifiers - * @see http://pl.wikipedia.org/wiki/NIP - * - * @return string 10 digit number - */ - public static function taxpayerIdentificationNumber() - { - $weights = [6, 5, 7, 2, 3, 4, 5, 6, 7]; - $result = []; - - do { - $result = [ - static::randomDigitNotNull(), static::randomDigitNotNull(), static::randomDigitNotNull(), - static::randomDigit(), static::randomDigit(), static::randomDigit(), - static::randomDigit(), static::randomDigit(), static::randomDigit(), - ]; - $checksum = 0; - - for ($i = 0, $size = count($result); $i < $size; ++$i) { - $checksum += $weights[$i] * $result[$i]; - } - $checksum %= 11; - } while ($checksum == 10); - $result[] = $checksum; - - return implode('', $result); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/pl_PL/PhoneNumber.php b/vendor/fakerphp/faker/src/Faker/Provider/pl_PL/PhoneNumber.php deleted file mode 100644 index d421539b..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/pl_PL/PhoneNumber.php +++ /dev/null @@ -1,18 +0,0 @@ - - - Prof. Hart will answer or forward your message. - - We would prefer to send you information by email. - - - **The Legal Small Print** - - - (Three Pages) - - ***START**THE SMALL PRINT!**FOR PUBLIC DOMAIN EBOOKS**START*** - Why is this "Small Print!" statement here? You know: lawyers. - They tell us you might sue us if there is something wrong with - your copy of this eBook, even if you got it for free from - someone other than us, and even if what's wrong is not our - fault. So, among other things, this "Small Print!" statement - disclaims most of our liability to you. It also tells you how - you may distribute copies of this eBook if you want to. - - *BEFORE!* YOU USE OR READ THIS EBOOK - By using or reading any part of this PROJECT GUTENBERG-tm - eBook, you indicate that you understand, agree to and accept - this "Small Print!" statement. If you do not, you can receive - a refund of the money (if any) you paid for this eBook by - sending a request within 30 days of receiving it to the person - you got it from. If you received this eBook on a physical - medium (such as a disk), you must return it with your request. - - ABOUT PROJECT GUTENBERG-TM EBOOKS - This PROJECT GUTENBERG-tm eBook, like most PROJECT GUTENBERG-tm eBooks, - is a "public domain" work distributed by Professor Michael S. Hart - through the Project Gutenberg Association (the "Project"). - Among other things, this means that no one owns a United States copyright - on or for this work, so the Project (and you!) can copy and - distribute it in the United States without permission and - without paying copyright royalties. Special rules, set forth - below, apply if you wish to copy and distribute this eBook - under the "PROJECT GUTENBERG" trademark. - - Please do not use the "PROJECT GUTENBERG" trademark to market - any commercial products without permission. - - To create these eBooks, the Project expends considerable - efforts to identify, transcribe and proofread public domain - works. Despite these efforts, the Project's eBooks and any - medium they may be on may contain "Defects". Among other - things, Defects may take the form of incomplete, inaccurate or - corrupt data, transcription errors, a copyright or other - intellectual property infringement, a defective or damaged - disk or other eBook medium, a computer virus, or computer - codes that damage or cannot be read by your equipment. - - LIMITED WARRANTY; DISCLAIMER OF DAMAGES - But for the "Right of Replacement or Refund" described below, - [1] Michael Hart and the Foundation (and any other party you may - receive this eBook from as a PROJECT GUTENBERG-tm eBook) disclaims - all liability to you for damages, costs and expenses, including - legal fees, and [2] YOU HAVE NO REMEDIES FOR NEGLIGENCE OR - UNDER STRICT LIABILITY, OR FOR BREACH OF WARRANTY OR CONTRACT, - INCLUDING BUT NOT LIMITED TO INDIRECT, CONSEQUENTIAL, PUNITIVE - OR INCIDENTAL DAMAGES, EVEN IF YOU GIVE NOTICE OF THE - POSSIBILITY OF SUCH DAMAGES. - - If you discover a Defect in this eBook within 90 days of - receiving it, you can receive a refund of the money (if any) - you paid for it by sending an explanatory note within that - time to the person you received it from. If you received it - on a physical medium, you must return it with your note, and - such person may choose to alternatively give you a replacement - copy. If you received it electronically, such person may - choose to alternatively give you a second opportunity to - receive it electronically. - - THIS EBOOK IS OTHERWISE PROVIDED TO YOU "AS-IS". NO OTHER - WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, ARE MADE TO YOU AS - TO THE EBOOK OR ANY MEDIUM IT MAY BE ON, INCLUDING BUT NOT - LIMITED TO WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A - PARTICULAR PURPOSE. - - Some states do not allow disclaimers of implied warranties or - the exclusion or limitation of consequential damages, so the - above disclaimers and exclusions may not apply to you, and you - may have other legal rights. - - INDEMNITY - You will indemnify and hold Michael Hart, the Foundation, - and its trustees and agents, and any volunteers associated - with the production and distribution of Project Gutenberg-tm - texts harmless, from all liability, cost and expense, including - legal fees, that arise directly or indirectly from any of the - following that you do or cause: [1] distribution of this eBook, - [2] alteration, modification, or addition to the eBook, - or [3] any Defect. - - DISTRIBUTION UNDER "PROJECT GUTENBERG-tm" - You may distribute copies of this eBook electronically, or by - disk, book or any other medium if you either delete this - "Small Print!" and all other references to Project Gutenberg, - or: - - [1] Only give exact copies of it. Among other things, this - requires that you do not remove, alter or modify the - eBook or this "small print!" statement. You may however, - if you wish, distribute this eBook in machine readable - binary, compressed, mark-up, or proprietary form, - including any form resulting from conversion by word - processing or hypertext software, but only so long as - *EITHER*: - - [*] The eBook, when displayed, is clearly readable, and - does *not* contain characters other than those - intended by the author of the work, although tilde - (~), asterisk (*) and underline (_) characters may - be used to convey punctuation intended by the - author, and additional characters may be used to - indicate hypertext links; OR - - [*] The eBook may be readily converted by the reader at - no expense into plain ASCII, EBCDIC or equivalent - form by the program that displays the eBook (as is - the case, for instance, with most word processors); - OR - - [*] You provide, or agree to also provide on request at - no additional cost, fee or expense, a copy of the - eBook in its original plain ASCII form (or in EBCDIC - or other equivalent proprietary form). - - [2] Honor the eBook refund and replacement provisions of this - "Small Print!" statement. - - [3] Pay a trademark license fee to the Foundation of 20% of the - gross profits you derive calculated using the method you - already use to calculate your applicable taxes. If you - don't derive profits, no royalty is due. Royalties are - payable to "Project Gutenberg Literary Archive Foundation" - the 60 days following each date you prepare (or were - legally required to prepare) your annual (or equivalent - periodic) tax return. Please contact us beforehand to - let us know your plans and to work out the details. - - WHAT IF YOU *WANT* TO SEND MONEY EVEN IF YOU DON'T HAVE TO? - Project Gutenberg is dedicated to increasing the number of - public domain and licensed works that can be freely distributed - in machine readable form. - - The Project gratefully accepts contributions of money, time, - public domain materials, or royalty free copyright licenses. - Money should be paid to the: - "Project Gutenberg Literary Archive Foundation." - - If you are interested in contributing scanning equipment or - software or other items, please contact Michael Hart at: - hart@pobox.com - - [Portions of this eBook's header and trailer may be reprinted only - when distributed free of all fees. Copyright (C) 2001, 2002 by - Michael S. Hart. Project Gutenberg is a TradeMark and may not be - used in any sales of Project Gutenberg eBooks or other materials be - they hardware or software or any other related product without - express permission.] - - *END THE SMALL PRINT! FOR PUBLIC DOMAIN EBOOKS*Ver.02/11/02*END* - - */ -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/pt_BR/Address.php b/vendor/fakerphp/faker/src/Faker/Provider/pt_BR/Address.php deleted file mode 100644 index 10bdd571..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/pt_BR/Address.php +++ /dev/null @@ -1,154 +0,0 @@ -generator->numerify('########0001'); - $n .= check_digit($n); - $n .= check_digit($n); - - return $formatted ? vsprintf('%d%d.%d%d%d.%d%d%d/%d%d%d%d-%d%d', str_split($n)) : $n; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/pt_BR/Internet.php b/vendor/fakerphp/faker/src/Faker/Provider/pt_BR/Internet.php deleted file mode 100644 index fc68ae66..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/pt_BR/Internet.php +++ /dev/null @@ -1,9 +0,0 @@ - [ - '4##############', - ], - 'MasterCard' => [ - '5##############', - ], - 'American Express' => [ - '34############', - '37############', - ], - 'Discover Card' => [ - '6011###########', - '622############', - '64#############', - '65#############', - ], - 'Diners' => [ - '301############', - '301##########', - '305############', - '305##########', - '36#############', - '36###########', - '38#############', - '38###########', - ], - 'Elo' => [ - '636368#########', - '438935#########', - '504175#########', - '451416#########', - '636297#########', - '5067###########', - '4576###########', - '4011###########', - ], - 'Hipercard' => [ - '38#############', - '60#############', - ], - 'Aura' => [ - '50#############', - ], - ]; - - /** - * International Bank Account Number (IBAN) - * - * @see http://en.wikipedia.org/wiki/International_Bank_Account_Number - * - * @param string $prefix for generating bank account number of a specific bank - * @param string $countryCode ISO 3166-1 alpha-2 country code - * @param int $length total length without country code and 2 check digits - * - * @return string - */ - public static function bankAccountNumber($prefix = '', $countryCode = 'BR', $length = null) - { - return static::iban($countryCode, $prefix, $length); - } - - /** - * @see list of Brazilians banks (2018-02-15), source: https://pt.wikipedia.org/wiki/Lista_de_bancos_do_Brasil - */ - protected static $banks = [ - 'BADESUL Desenvolvimento S.A. – Agência de Fomento/RS', - 'Banco Central do Brasil', - 'Banco da Amazônia', - 'Banco de Brasília', - 'Banco de Desenvolvimento de Minas Gerais', - 'Banco de Desenvolvimento do Espírito Santo', - 'Banco de Desenvolvimento do Paraná', - 'Banco do Brasil', - 'Banco do Estado de Sergipe Banese Estadual', - 'Banco do Estado do Espírito Santo Banestes', - 'Banco do Estado do Pará', - 'Banco do Estado do Rio Grande do Sul', - 'Banco do Nordeste do Brasil', - 'Banco Nacional de Desenvolvimento Econômico e Social', - 'Banco Regional de Desenvolvimento do Extremo Sul', - 'Caixa Econômica Federal', - 'Banco ABN Amro S.A.', - 'Banco Alfa', - 'Banco Banif', - 'Banco BBM', - 'Banco BMG', - 'Banco Bonsucesso', - 'Banco BTG Pactual', - 'Banco Cacique', - 'Banco Caixa Geral - Brasil', - 'Banco Citibank', - 'Banco Credibel', - 'Banco Credit Suisse', - 'Góis Monteiro & Co', - 'Banco Fator', - 'Banco Fibra', - 'Agibank', - 'Banco Guanabara', - 'Banco Industrial do Brasil', - 'Banco Industrial e Comercial', - 'Banco Indusval', - 'Banco Inter', - 'Banco Itaú BBA', - 'Banco ItaúBank', - 'Banco Itaucred Financiamentos', - 'Banco Mercantil do Brasil', - 'Banco Modal Modal', - 'Banco Morada', - 'Banco Pan', - 'Banco Paulista', - 'Banco Pine', - 'Banco Renner', - 'Banco Ribeirão Preto', - 'Banco Safra', - 'Banco Santander', - 'Banco Sofisa', - 'Banco Topázio', - 'Banco Votorantim', - 'Bradesco Bradesco', - 'Itaú Unibanco', - 'Banco Original', - 'Banco Neon', - 'Nu Pagamentos S.A', - 'XP Investimentos Corretora de Câmbio Títulos e Valores Mobiliários S.A', - ]; - - /** - * @example 'Banco Neon' - */ - public static function bank() - { - return static::randomElement(static::$banks); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/pt_BR/Person.php b/vendor/fakerphp/faker/src/Faker/Provider/pt_BR/Person.php deleted file mode 100644 index 6331e7ba..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/pt_BR/Person.php +++ /dev/null @@ -1,159 +0,0 @@ -generator->numerify('#########'); - $n .= check_digit($n); - $n .= check_digit($n); - - return $formatted ? vsprintf('%d%d%d.%d%d%d.%d%d%d-%d%d', str_split($n)) : $n; - } - - /** - * A random RG number, following Sao Paulo state's rules. - * - * @see http://pt.wikipedia.org/wiki/C%C3%A9dula_de_identidade - * - * @param bool $formatted If the number should have dots/dashes or not. - * - * @return string - */ - public function rg($formatted = true) - { - $n = $this->generator->numerify('########'); - $n .= check_digit($n); - - return $formatted ? vsprintf('%d%d.%d%d%d.%d%d%d-%s', str_split($n)) : $n; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/pt_BR/PhoneNumber.php b/vendor/fakerphp/faker/src/Faker/Provider/pt_BR/PhoneNumber.php deleted file mode 100644 index 6717def5..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/pt_BR/PhoneNumber.php +++ /dev/null @@ -1,150 +0,0 @@ - '']); - } - - return $number; - } - - /** - * Generates an 9-digit landline number without formatting characters. - * - * @param bool $formatted [def: true] If it should return a formatted number or not. - * - * @return string - */ - public static function landline($formatted = true) - { - $number = static::numerify(static::randomElement(static::$landlineFormats)); - - if (!$formatted) { - $number = strtr($number, ['-' => '']); - } - - return $number; - } - - /** - * Randomizes between cellphone and landline numbers. - * - * @param bool $formatted [def: true] If it should return a formatted number or not. - */ - public static function phone($formatted = true) - { - $options = static::randomElement([ - ['cellphone', false], - ['cellphone', true], - ['landline', null], - ]); - - return call_user_func("static::{$options[0]}", $formatted, $options[1]); - } - - /** - * Generates a complete phone number. - * - * @param string $type [def: landline] One of "landline" or "cellphone". Defaults to "landline" on invalid values. - * @param bool $formatted [def: true] If the number should be formatted or not. - * - * @return string - */ - protected static function anyPhoneNumber($type, $formatted = true) - { - $area = static::areaCode(); - $number = ($type == 'cellphone') ? - static::cellphone($formatted) : - static::landline($formatted); - - return $formatted ? "($area) $number" : $area . $number; - } - - /** - * Concatenates {@link areaCode} and {@link cellphone} into a national cellphone number. - * - * @param bool $formatted [def: true] If it should return a formatted number or not. - * - * @return string - */ - public static function cellphoneNumber($formatted = true) - { - return static::anyPhoneNumber('cellphone', $formatted); - } - - /** - * Concatenates {@link areaCode} and {@link landline} into a national landline number. - * - * @param bool $formatted [def: true] If it should return a formatted number or not. - * - * @return string - */ - public static function landlineNumber($formatted = true) - { - return static::anyPhoneNumber('landline', $formatted); - } - - /** - * Randomizes between complete cellphone and landline numbers. - */ - public function phoneNumber() - { - $method = static::randomElement(['cellphoneNumber', 'landlineNumber']); - - return call_user_func("static::$method", true); - } - - /** - * Randomizes between complete cellphone and landline numbers, cleared from formatting symbols. - */ - public static function phoneNumberCleared() - { - $method = static::randomElement(['cellphoneNumber', 'landlineNumber']); - - return call_user_func("static::$method", false); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/pt_BR/Text.php b/vendor/fakerphp/faker/src/Faker/Provider/pt_BR/Text.php deleted file mode 100644 index d177c872..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/pt_BR/Text.php +++ /dev/null @@ -1,3427 +0,0 @@ -= 12; - $verifier = 0; - - for ($i = 1; $i <= $length; ++$i) { - if (!$second_algorithm) { - $multiplier = $i + 1; - } else { - $multiplier = ($i >= 9) ? $i - 7 : $i + 1; - } - $verifier += $numbers[$length - $i] * $multiplier; - } - - $verifier = 11 - ($verifier % 11); - - if ($verifier >= 10) { - $verifier = 0; - } - - return $verifier; -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/pt_PT/Address.php b/vendor/fakerphp/faker/src/Faker/Provider/pt_PT/Address.php deleted file mode 100644 index 0d3f8508..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/pt_PT/Address.php +++ /dev/null @@ -1,130 +0,0 @@ - 0; --$i) { - $numbers[$i] = substr($number, $i - 1, 1); - $partial[$i] = $numbers[$i] * $factor; - $sum += $partial[$i]; - - if ($factor == $base) { - $factor = 1; - } - ++$factor; - } - $res = $sum % 11; - - if ($res == 0 || $res == 1) { - $digit = 0; - } else { - $digit = 11 - $res; - } - - return $digit; - } - - /** - * @see http://nomesportugueses.blogspot.pt/2012/01/lista-dos-cem-nomes-mais-usados-em.html - */ - protected static $firstNameMale = [ - 'Rodrigo', 'João', 'Martim', 'Afonso', 'Tomás', 'Gonçalo', 'Francisco', 'Tiago', - 'Diogo', 'Guilherme', 'Pedro', 'Miguel', 'Rafael', 'Gabriel', 'Santiago', 'Dinis', - 'David', 'Duarte', 'José', 'Simão', 'Daniel', 'Lucas', 'Gustavo', 'André', 'Denis', - 'Salvador', 'António', 'Vasco', 'Henrique', 'Lourenço', 'Manuel', 'Eduardo', 'Bernardo', - 'Leandro', 'Luís', 'Diego', 'Leonardo', 'Alexandre', 'Rúben', 'Mateus', 'Ricardo', - 'Vicente', 'Filipe', 'Bruno', 'Nuno', 'Carlos', 'Rui', 'Hugo', 'Samuel', 'Álvaro', - 'Matias', 'Fábio', 'Ivo', 'Paulo', 'Jorge', 'Xavier', 'Marco', 'Isaac', 'Raúl', 'Benjamim', - 'Renato', 'Artur', 'Mário', 'Frederico', 'Cristiano', 'Ivan', 'Sérgio', 'Micael', - 'Vítor', 'Edgar', 'Kevin', 'Joaquim', 'Igor', 'Ângelo', 'Enzo', 'Valentim', 'Flávio', - 'Joel', 'Fernando', 'Sebastião', 'Tomé', 'César', 'Cláudio', 'Nelson', 'Lisandro', 'Jaime', - 'Gil', 'Mauro', 'Sandro', 'Hélder', 'Matheus', 'William', 'Gaspar', 'Márcio', - 'Martinho', 'Emanuel', 'Marcos', 'Telmo', 'Davi', 'Wilson', - ]; - - protected static $firstNameFemale = [ - 'Maria', 'Leonor', 'Matilde', 'Mariana', 'Ana', 'Beatriz', 'Inês', 'Lara', 'Carolina', 'Margarida', - 'Joana', 'Sofia', 'Diana', 'Francisca', 'Laura', 'Sara', 'Madalena', 'Rita', 'Mafalda', 'Catarina', - 'Luana', 'Marta', 'Íris', 'Alice', 'Bianca', 'Constança', 'Gabriela', 'Eva', 'Clara', 'Bruna', 'Daniela', - 'Iara', 'Filipa', 'Vitória', 'Ariana', 'Letícia', 'Bárbara', 'Camila', 'Rafaela', 'Carlota', 'Yara', - 'Núria', 'Raquel', 'Ema', 'Helena', 'Benedita', 'Érica', 'Isabel', 'Nicole', 'Lia', 'Alícia', 'Mara', - 'Jéssica', 'Soraia', 'Júlia', 'Luna', 'Victória', 'Luísa', 'Teresa', 'Miriam', 'Adriana', 'Melissa', - 'Andreia', 'Juliana', 'Alexandra', 'Yasmin', 'Tatiana', 'Leticia', 'Luciana', 'Eduarda', 'Cláudia', - 'Débora', 'Fabiana', 'Renata', 'Kyara', 'Kelly', 'Irina', 'Mélanie', 'Nádia', 'Cristiana', 'Liliana', - 'Patrícia', 'Vera', 'Doriana', 'Ângela', 'Mia', 'Erica', 'Mónica', 'Isabela', 'Salomé', 'Cátia', - 'Verónica', 'Violeta', 'Lorena', 'Érika', 'Vanessa', 'Iris', 'Anna', 'Viviane', 'Rebeca', 'Neuza', - ]; - - protected static $lastName = [ - 'Abreu', 'Almeida', 'Alves', 'Amaral', 'Amorim', 'Andrade', 'Anjos', 'Antunes', 'Araújo', 'Assunção', - 'Azevedo', 'Baptista', 'Barbosa', 'Barros', 'Batista', 'Borges', 'Branco', 'Brito', 'Campos', 'Cardoso', - 'Carneiro', 'Carvalho', 'Castro', 'Coelho', 'Correia', 'Costa', 'Cruz', 'Cunha', 'Domingues', 'Esteves', - 'Faria', 'Fernandes', 'Ferreira', 'Figueiredo', 'Fonseca', 'Freitas', 'Garcia', 'Gaspar', 'Gomes', - 'Gonçalves', 'Guerreiro', 'Henriques', 'Jesus', 'Leal', 'Leite', 'Lima', 'Lopes', 'Loureiro', 'Lourenço', - 'Macedo', 'Machado', 'Magalhães', 'Maia', 'Marques', 'Martins', 'Matias', 'Matos', 'Melo', 'Mendes', - 'Miranda', 'Monteiro', 'Morais', 'Moreira', 'Mota', 'Moura', 'Nascimento', 'Neto', 'Neves', 'Nogueira', - 'Nunes', 'Oliveira', 'Pacheco', 'Paiva', 'Pereira', 'Pinheiro', 'Pinho', 'Pinto', 'Pires', 'Ramos', - 'Reis', 'Ribeiro', 'Rocha', 'Rodrigues', 'Santos', 'Silva', 'Simões', 'Soares', 'Sousa', - 'Sá', 'Tavares', 'Teixeira', 'Torres', 'Valente', 'Vaz', 'Vicente', 'Vieira', - ]; -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/pt_PT/PhoneNumber.php b/vendor/fakerphp/faker/src/Faker/Provider/pt_PT/PhoneNumber.php deleted file mode 100644 index 948ba94d..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/pt_PT/PhoneNumber.php +++ /dev/null @@ -1,50 +0,0 @@ - '01', 'AR' => '02', 'AG' => '03', 'B' => '40', 'BC' => '04', 'BH' => '05', - 'BN' => '06', 'BT' => '07', 'BV' => '08', 'BR' => '09', 'BZ' => '10', 'CS' => '11', - 'CL' => '51', 'CJ' => '12', 'CT' => '13', 'CV' => '14', 'DB' => '15', 'DJ' => '16', - 'GL' => '17', 'GR' => '52', 'GJ' => '18', 'HR' => '19', 'HD' => '20', 'IL' => '21', - 'IS' => '22', 'IF' => '23', 'MM' => '24', 'MH' => '25', 'MS' => '26', 'NT' => '27', - 'OT' => '28', 'PH' => '29', 'SM' => '30', 'SJ' => '31', 'SB' => '32', 'SV' => '33', - 'TR' => '34', 'TM' => '35', 'TL' => '36', 'VS' => '37', 'VL' => '38', 'VN' => '39', - - 'B1' => '41', 'B2' => '42', 'B3' => '43', 'B4' => '44', 'B5' => '45', 'B6' => '46', - ]; - - /** - * Personal Numerical Code (CNP) - * - * @see http://ro.wikipedia.org/wiki/Cod_numeric_personal - * - * @example 1111111111118 - * - * @param string|null $gender Person::GENDER_MALE or Person::GENDER_FEMALE - * @param string|null $dateOfBirth (1800-2099) 'Y-m-d', 'Y-m', 'Y' I.E. '1981-06-16', '2085-03', '1900' - * @param string|null $county county code where the CNP was issued - * @param bool|null $isResident flag if the person resides in Romania - * - * @return string 13 digits CNP code - */ - public function cnp($gender = null, $dateOfBirth = null, $county = null, $isResident = true) - { - $genders = [Person::GENDER_MALE, Person::GENDER_FEMALE]; - - if (empty($gender)) { - $gender = static::randomElement($genders); - } elseif (!in_array($gender, $genders, false)) { - throw new \InvalidArgumentException("Gender must be '{Person::GENDER_MALE}' or '{Person::GENDER_FEMALE}'"); - } - - $date = $this->getDateOfBirth($dateOfBirth); - - if (null === $county) { - $countyCode = static::randomElement(array_values(static::$cnpCountyCodes)); - } elseif (!array_key_exists($county, static::$cnpCountyCodes)) { - throw new \InvalidArgumentException("Invalid county code '{$county}' received"); - } else { - $countyCode = static::$cnpCountyCodes[$county]; - } - - $cnp = (string) $this->getGenderDigit($date, $gender, $isResident) - . $date->format('ymd') - . $countyCode - . static::numerify('##%') - ; - - $checksum = $this->getChecksumDigit($cnp); - - return $cnp . $checksum; - } - - /** - * @param string|null $dateOfBirth - * - * @return \DateTime - */ - protected function getDateOfBirth($dateOfBirth) - { - if (empty($dateOfBirth)) { - $dateOfBirthParts = [self::numberBetween(1800, 2099)]; - } else { - $dateOfBirthParts = explode('-', $dateOfBirth); - } - $baseDate = \Faker\Provider\DateTime::dateTimeBetween("first day of January {$dateOfBirthParts[0]}", "last day of December {$dateOfBirthParts[0]}"); - - switch (count($dateOfBirthParts)) { - case 1: - $dateOfBirthParts[] = $baseDate->format('m'); - //don't break, we need the day also - // no break - case 2: - $dateOfBirthParts[] = $baseDate->format('d'); - //don't break, next line will - // no break - case 3: - break; - - default: - throw new \InvalidArgumentException("Invalid date of birth - must be null or in the 'Y-m-d', 'Y-m', 'Y' format"); - } - - if ($dateOfBirthParts[0] < 1800 || $dateOfBirthParts[0] > 2099) { - throw new \InvalidArgumentException("Invalid date of birth - year must be between 1800 and 2099, '{$dateOfBirthParts[0]}' received"); - } - - $dateOfBirthFinal = implode('-', $dateOfBirthParts); - $date = \DateTime::createFromFormat('Y-m-d', $dateOfBirthFinal); - //a full (invalid) date might have been supplied, check if it converts - if ($date->format('Y-m-d') !== $dateOfBirthFinal) { - throw new \InvalidArgumentException("Invalid date of birth - '{$date->format('Y-m-d')}' generated based on '{$dateOfBirth}' received"); - } - - return $date; - } - - /** - * https://ro.wikipedia.org/wiki/Cod_numeric_personal#S - * - * @param bool $isResident - * @param string $gender - * - * @return int - */ - protected static function getGenderDigit(\DateTime $dateOfBirth, $gender, $isResident) - { - if (!$isResident) { - return 9; - } - - if ($dateOfBirth->format('Y') < 1900) { - if ($gender == Person::GENDER_MALE) { - return 3; - } - - return 4; - } - - if ($dateOfBirth->format('Y') < 2000) { - if ($gender == Person::GENDER_MALE) { - return 1; - } - - return 2; - } - - if ($gender == Person::GENDER_MALE) { - return 5; - } - - return 6; - } - - /** - * Calculates a checksum for the Personal Numerical Code (CNP). - * - * @param string $value 12 digit CNP - * - * @return int checksum digit - */ - protected function getChecksumDigit($value) - { - $checkNumber = 279146358279; - - $checksum = 0; - - foreach (range(0, 11) as $digit) { - $checksum += (int) substr($value, $digit, 1) * (int) substr($checkNumber, $digit, 1); - } - $checksum = $checksum % 11; - - return $checksum == 10 ? 1 : $checksum; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/ro_RO/PhoneNumber.php b/vendor/fakerphp/faker/src/Faker/Provider/ro_RO/PhoneNumber.php deleted file mode 100644 index 01c58591..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/ro_RO/PhoneNumber.php +++ /dev/null @@ -1,62 +0,0 @@ - [ - '021#######', // Bucharest - '023#######', - '024#######', - '025#######', - '026#######', - '027#######', // non-geographic - '031#######', // Bucharest - '033#######', - '034#######', - '035#######', - '036#######', - '037#######', // non-geographic - ], - 'mobile' => [ - '07########', - ], - ]; - - protected static $specialFormats = [ - 'toll-free' => [ - '0800######', - '0801######', // shared-cost numbers - '0802######', // personal numbering - '0806######', // virtual cards - '0807######', // pre-paid cards - '0870######', // internet dial-up - ], - 'premium-rate' => [ - '0900######', - '0903######', // financial information - '0906######', // adult entertainment - ], - ]; - - /** - * @see http://en.wikipedia.org/wiki/Telephone_numbers_in_Romania#Last_years - */ - public function phoneNumber() - { - $type = static::randomElement(array_keys(static::$normalFormats)); - - return static::numerify(static::randomElement(static::$normalFormats[$type])); - } - - public static function tollFreePhoneNumber() - { - return static::numerify(static::randomElement(static::$specialFormats['toll-free'])); - } - - public static function premiumRatePhoneNumber() - { - return static::numerify(static::randomElement(static::$specialFormats['premium-rate'])); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/ro_RO/Text.php b/vendor/fakerphp/faker/src/Faker/Provider/ro_RO/Text.php deleted file mode 100644 index 1e40597c..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/ro_RO/Text.php +++ /dev/null @@ -1,155 +0,0 @@ -generator->parse($format); - } - - public static function country() - { - return static::randomElement(static::$country); - } - - public static function postcode() - { - return static::toUpper(static::bothify(static::randomElement(static::$postcode))); - } - - public static function regionSuffix() - { - return static::randomElement(static::$regionSuffix); - } - - public static function region() - { - return static::randomElement(static::$region); - } - - public static function cityPrefix() - { - return static::randomElement(static::$cityPrefix); - } - - public function city() - { - return static::randomElement(static::$city); - } - - public static function streetPrefix() - { - return static::randomElement(static::$streetPrefix); - } - - public static function street() - { - return static::randomElement(static::$street); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/ru_RU/Color.php b/vendor/fakerphp/faker/src/Faker/Provider/ru_RU/Color.php deleted file mode 100644 index d31d1208..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/ru_RU/Color.php +++ /dev/null @@ -1,23 +0,0 @@ -generator->parse($format); - } - - public static function companyPrefix() - { - return static::randomElement(static::$companyPrefixes); - } - - public static function companyNameElement() - { - return static::randomElement(static::$companyElements); - } - - public static function companyNameSuffix() - { - return static::randomElement(static::$companyNameSuffixes); - } - - /** - * Generates a Russian Taxpayer Personal Identification Number - * - * @param string $area_code - * - * @return string - * - * @deprecated use {@link \Faker\Provider\ru_RU\Company::inn10()} instead - * @see \Faker\Provider\ru_RU\Company::inn10() - */ - public static function inn($area_code = '') - { - return self::inn10($area_code); - } - - /** - * Generates a Russian Taxpayer Personal Identification Number - * - * @param string $area_code - * - * @return string - */ - public static function inn10($area_code = '') - { - if ($area_code === '' || (int) $area_code === 0) { - //Simple generation code for areas in Russian without check for valid - $area_code = self::numberBetween(1, 91); - } else { - $area_code = (int) $area_code; - } - $area_code = str_pad($area_code, 2, '0', STR_PAD_LEFT); - $inn_base = $area_code . static::numerify('#######'); - - return $inn_base . self::inn10Checksum($inn_base); - } - - public static function kpp($inn = '') - { - if ($inn === '' || strlen($inn) < 4) { - $inn = self::inn10(); - } - - return substr($inn, 0, 4) . '01001'; - } - - /** - * Generates INN Checksum - * - * @see https://ru.wikipedia.org/wiki/%D0%98%D0%B4%D0%B5%D0%BD%D1%82%D0%B8%D1%84%D0%B8%D0%BA%D0%B0%D1%86%D0%B8%D0%BE%D0%BD%D0%BD%D1%8B%D0%B9_%D0%BD%D0%BE%D0%BC%D0%B5%D1%80_%D0%BD%D0%B0%D0%BB%D0%BE%D0%B3%D0%BE%D0%BF%D0%BB%D0%B0%D1%82%D0%B5%D0%BB%D1%8C%D1%89%D0%B8%D0%BA%D0%B0 - * - * @param string $inn - * - * @return string Checksum (one digit) - */ - public static function inn10Checksum($inn) - { - $multipliers = [2, 4, 10, 3, 5, 9, 4, 6, 8]; - $sum = 0; - - for ($i = 0; $i < 9; ++$i) { - $sum += (int) $inn[$i] * $multipliers[$i]; - } - - return (string) (($sum % 11) % 10); - } - - /** - * Checks whether an INN has a valid checksum - * - * @param string $inn - * - * @return bool - */ - public static function inn10IsValid($inn) - { - return strlen($inn) === 10 && self::inn10Checksum($inn) === $inn[9]; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/ru_RU/Internet.php b/vendor/fakerphp/faker/src/Faker/Provider/ru_RU/Internet.php deleted file mode 100644 index 195ef5f4..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/ru_RU/Internet.php +++ /dev/null @@ -1,9 +0,0 @@ -.*<' | \ - * sed -r 's/—//' | sed -r 's/[\<\>]//g' | sed -r "s/(^|$)/'/g" | sed -r 's/$/,/' | sed -r 's/\&(laquo|raquo);/"/g' | \ - * sed -r 's/\s+/ /g'" - */ - protected static $banks = [ - 'Новый Промышленный Банк', - 'Новый Символ', - 'Нокссбанк', - 'Ноосфера', - 'Нордеа Банк', - 'Нота-Банк', - 'НС Банк', - 'НСТ-Банк', - 'Нэклис-Банк', - 'Образование', - 'Объединенный Банк Промышленных Инвестиций', - 'Объединенный Банк Республики', - 'Объединенный Капитал', - 'Объединенный Кредитный Банк', - 'Объединенный Кредитный Банк Московский филиал', - 'Объединенный Национальный Банк', - 'Объединенный Резервный Банк', - 'Океан Банк', - 'ОЛМА-Банк', - 'Онего', - 'Оней Банк', - 'ОПМ-Банк', - 'Оргбанк', - 'Оренбург', - 'ОТП Банк', - 'ОФК Банк', - 'Охабанк', - 'Первобанк', - 'Первомайский', - 'Первоуральскбанк', - 'Первый Дортрансбанк', - 'Первый Инвестиционный банк', - 'Первый Клиентский Банк', - 'Первый Чешско-Российский Банк', - 'Пересвет', - 'Пермь', - 'Петербургский Социальный Коммерческий Банк', - 'Петрокоммерц', - 'ПИР Банк', - 'Платина', - 'Плато-Банк', - 'Плюс Банк', - 'Пойдем!', - 'Почтобанк', - 'Прайм Финанс', - 'Преодоление', - 'Приморье', - 'Примсоцбанк', - 'Примтеркомбанк', - 'Прио-Внешторгбанк', - 'Приобье', - 'Приполярный', - 'Приско Капитал Банк', - 'Пробизнесбанк', - 'Проинвестбанк', - 'Прокоммерцбанк', - 'Проминвестбанк', - 'Промрегионбанк', - 'Промсвязьбанк', - 'Промсвязьинвестбанк', - 'Промсельхозбанк', - 'Промтрансбанк', - 'Промышленно-Финансовое Сотрудничество', - 'Промэнергобанк', - 'Профессионал Банк', - 'Профит Банк', - 'Прохладный', - 'Пульс Столицы', - 'Радиотехбанк', - 'Развитие', - 'Развитие-Столица', - 'Райффайзенбанк', - 'Расчетно-Кредитный Банк', - 'Расчетный Дом', - 'РБА', - 'Региональный Банк Развития', - 'Региональный Банк Сбережений', - 'Региональный Коммерческий Банк', - 'Региональный Кредит', - 'Регионфинансбанк', - 'Регнум', - 'Резерв', - 'Ренессанс', - 'Ренессанс Кредит', - 'Рента-Банк', - 'РЕСО Кредит', - 'Республиканский Кредитный Альянс', - 'Ресурс-Траст', - 'Риабанк', - 'Риал-Кредит', - 'Ринвестбанк', - 'Ринвестбанк Московский офис', - 'РИТ-Банк', - 'РН Банк', - 'Росавтобанк', - 'Росбанк', - 'Росбизнесбанк', - 'Росгосстрах Банк', - 'Росдорбанк', - 'РосЕвроБанк', - 'РосинтерБанк', - 'Роспромбанк', - 'Россельхозбанк', - 'Российская Финансовая Корпорация', - 'Российский Капитал', - 'Российский Кредит', - 'Российский Национальный Коммерческий Банк', - 'Россита-Банк', - 'Россия', - 'Рост Банк', - 'Ростфинанс', - 'Росэксимбанк', - 'Росэнергобанк', - 'Роял Кредит Банк', - 'РСКБ', - 'РТС-Банк', - 'РУБанк', - 'Рублев', - 'Руна-Банк', - 'Рунэтбанк', - 'Рускобанк', - 'Руснарбанк', - 'Русский Банк Сбережений', - 'Русский Ипотечный Банк', - 'Русский Международный Банк', - 'Русский Национальный Банк', - 'Русский Стандарт', - 'Русский Торговый Банк', - 'Русский Трастовый Банк', - 'Русский Финансовый Альянс', - 'Русский Элитарный Банк', - 'Русславбанк', - 'Руссобанк', - 'Русстройбанк', - 'Русфинанс Банк', - 'Русь', - 'РусьРегионБанк', - 'Русьуниверсалбанк', - 'РусЮгбанк', - 'РФИ Банк', - 'Саммит Банк', - 'Санкт-Петербургский Банк Инвестиций', - 'Саратов', - 'Саровбизнесбанк', - 'Сбербанк России', - 'Связной Банк', - 'Связь-Банк', - 'СДМ-Банк', - 'Севастопольский Морской банк', - 'Северный Кредит', - 'Северный Народный Банк', - 'Северо-Восточный Альянс', - 'Северо-Западный 1 Альянс Банк', - 'Северстройбанк', - 'Севзапинвестпромбанк', - 'Сельмашбанк', - 'Сервис-Резерв', - 'Сетелем Банк', - 'СИАБ', - 'Сибирский Банк Реконструкции и Развития', - 'Сибнефтебанк', - 'Сибсоцбанк', - 'Сибэс', - 'Сибэс Московский офис', - 'Синергия', - 'Синко-Банк', - 'Система', - 'Сити Инвест Банк', - 'Ситибанк', - 'СКА-Банк', - 'СКБ-Банк', - 'Славия', - 'Славянбанк', - 'Славянский Кредит', - 'Смартбанк', - 'СМБ-Банк', - 'Смолевич', - 'СМП Банк', - 'Снежинский', - 'Собинбанк', - 'Соверен Банк', - 'Советский', - 'Совкомбанк', - 'Современные Стандарты Бизнеса', - 'Содружество', - 'Соколовский', - 'Солид Банк', - 'Солидарность (Москва)', - 'Солидарность (Самара)', - 'Социнвестбанк', - 'Социнвестбанк Московский филиал', - 'Социум-Банк', - 'Союз', - 'Союзный', - 'Спецстройбанк', - 'Спиритбанк', - 'Спурт Банк', - 'Спутник', - 'Ставропольпромстройбанк', - 'Сталь Банк', - 'Стандарт-Кредит', - 'Стар Альянс', - 'СтарБанк', - 'Старооскольский Агропромбанк', - 'Старый Кремль', - 'Стелла-Банк', - 'Столичный Кредит', - 'Стратегия', - 'Строительно-Коммерческий Банк', - 'Стройлесбанк', - 'Сумитомо Мицуи', - 'Сургутнефтегазбанк', - 'СЭБ Банк', - 'Таатта', - 'Таврический', - 'Таганрогбанк', - 'Тагилбанк', - 'Тайдон', - 'Тайм Банк', - 'Тальменка-Банк', - 'Тальменка-Банк Московский филиал', - 'Тамбовкредитпромбанк', - 'Татагропромбанк', - 'Татсоцбанк', - 'Татфондбанк', - 'Таурус Банк', - 'ТверьУниверсалБанк', - 'Тексбанк', - 'Темпбанк', - 'Тендер-Банк', - 'Терра', - 'Тетраполис', - 'Тимер Банк', - 'Тинькофф Банк', - 'Тихоокеанский Внешторгбанк', - 'Тойота Банк', - 'Тольяттихимбанк', - 'Томскпромстройбанк', - 'Торгово-Промышленный Банк Китая', - 'Торговый Городской Банк', - 'Торжокуниверсалбанк', - 'Транскапиталбанк', - 'Транснациональный Банк', - 'Транспортный', - 'Трансстройбанк', - 'Траст Капитал Банк', - 'Тройка-Д Банк', - 'Тульский Промышленник', - 'Тульский Промышленник Московский офис', - 'Тульский Расчетный Центр', - 'Турбобанк', - 'Тусар', - 'ТЭМБР-Банк', - 'ТЭСТ', - 'Углеметбанк', - 'Уздан', - 'Унифин', - 'Унифондбанк', - 'Уралкапиталбанк', - 'Уралприватбанк', - 'Уралпромбанк', - 'Уралсиб', - 'Уралтрансбанк', - 'Уралфинанс', - 'Уральский Банк Реконструкции и Развития', - 'Уральский Межрегиональный Банк', - 'Уральский Финансовый Дом', - 'Ури Банк', - 'Уссури', - 'ФДБ', - 'ФИА-Банк', - 'Финам Банк', - 'Финанс Бизнес Банк', - 'Финансово-Промышленный Капитал', - 'Финансовый Капитал', - 'Финансовый Стандарт', - 'Финарс Банк', - 'Финпромбанк (ФПБ Банк)', - 'Финтрастбанк', - 'ФК Открытие (бывш. НОМОС-Банк)', - 'Флора-Москва', - 'Фольксваген Банк Рус', - 'Фондсервисбанк', - 'Фора-Банк', - 'Форбанк', - 'Форус Банк', - 'Форштадт', - 'Фьючер', - 'Хакасский Муниципальный Банк', - 'Ханты-Мансийский банк Открытие', - 'Химик', - 'Хлынов', - 'Хованский', - 'Холдинвестбанк', - 'Холмск', - 'Хоум Кредит Банк', - 'Центр-инвест', - 'Центрально-Азиатский', - 'Центрально-Европейский Банк', - 'Центркомбанк', - 'ЦентроКредит', - 'Церих', - 'Чайна Констракшн', - 'Чайнасельхозбанк', - 'Челиндбанк', - 'Челябинвестбанк', - 'Черноморский банк развития и реконструкции', - 'Чувашкредитпромбанк', - 'Эйч-Эс-Би-Си Банк (HSBC)', - 'Эко-Инвест', - 'Экономбанк', - 'Экономикс-Банк', - 'Экси-Банк', - 'Эксперт Банк', - 'Экспобанк', - 'Экспресс-Волга', - 'Экспресс-Кредит', - 'Эл Банк', - 'Элита', - 'Эльбин', - 'Энергобанк', - 'Энергомашбанк', - 'Энерготрансбанк', - 'Эно', - 'Энтузиастбанк', - 'Эргобанк', - 'Ю Би Эс Банк', - 'ЮГ-Инвестбанк', - 'Югра', - 'Южный Региональный Банк', - 'ЮМК', - 'Юниаструм Банк', - 'ЮниКредит Банк', - 'Юнистрим', - 'Япы Креди Банк Москва', - 'ЯР-Банк', - 'Яринтербанк', - 'Ярославич', - 'K2 Банк', - 'АББ', - 'Абсолют Банк', - 'Авангард', - 'Аверс', - 'Автоградбанк', - 'АвтоКредитБанк', - 'Автоторгбанк', - 'Агроинкомбанк', - 'Агропромкредит', - 'Агророс', - 'Агросоюз', - 'Адамон Банк', - 'Адамон Банк Московский филиал', - 'Аделантбанк', - 'Адмиралтейский', - 'Азиатско-Тихоокеанский Банк', - 'Азимут', - 'Азия Банк', - 'Азия-Инвест Банк', - 'Ай-Си-Ай-Си-Ай Банк (ICICI)', - 'Айви Банк', - 'АйМаниБанк', - 'Ак Барс', - 'Акибанк', - 'Аккобанк', - 'Акрополь', - 'Аксонбанк', - 'Актив Банк', - 'АктивКапитал Банк', - 'АктивКапитал Банк Московский филиал', - 'АктивКапитал Банк Санкт-Петербургский филиал', - 'Акцент', - 'Акцепт', - 'Акция', - 'Алданзолотобанк', - 'Александровский', - 'Алеф-Банк', - 'Алжан', - 'Алмазэргиэнбанк', - 'АлтайБизнес-Банк', - 'Алтайкапиталбанк', - 'Алтынбанк', - 'Альба Альянс', - 'Альта-Банк', - 'Альтернатива', - 'Альфа-Банк', - 'АМБ Банк', - 'Америкэн Экспресс Банк', - 'Анелик РУ', - 'Анкор Банк', - 'Анталбанк', - 'Апабанк', - 'Аресбанк', - 'Арзамас', - 'Арксбанк', - 'Арсенал', - 'Аспект', - 'Ассоциация', - 'БайкалБанк', - 'БайкалИнвестБанк', - 'Байкалкредобанк', - 'Балаково-Банк', - 'Балтийский Банк', - 'Балтика', - 'Балтинвестбанк', - 'Банк "Акцент" Московский филиал', - 'Банк "МБА-Москва"', - 'Банк "Санкт-Петербург"', - 'Банк АВБ', - 'Банк БКФ', - 'Банк БФА', - 'Банк БЦК-Москва', - 'Банк Город', - 'Банк Жилищного Финансирования', - 'Банк Инноваций и Развития', - 'Банк Интеза', - 'Банк ИТБ', - 'Банк Казани', - 'Банк Китая (Элос)', - 'Банк Кредит Свисс', - 'Банк МБФИ', - 'Банк Москвы', - 'Банк на Красных Воротах', - 'Банк Оранжевый (бывш. Промсервисбанк)', - 'Банк оф Токио-Мицубиси', - 'Банк Премьер Кредит', - 'Банк ПСА Финанс Рус', - 'Банк Развития Технологий', - 'Банк Расчетов и Сбережений', - 'Банк Раунд', - 'Банк РСИ', - 'Банк Сберегательно-кредитного сервиса', - 'Банк СГБ', - 'Банк Торгового Финансирования', - 'Банк Финсервис', - 'Банк Экономический Союз', - 'Банкирский Дом', - 'Банкхаус Эрбе', - 'Башкомснаббанк', - 'Башпромбанк', - 'ББР Банк', - 'Белгородсоцбанк', - 'Бенифит-Банк', - 'Берейт', - 'Бест Эффортс Банк', - 'Бизнес для Бизнеса', - 'Бинбанк', - 'БИНБАНК кредитные карты', - 'Бинбанк Мурманск', - 'БКС Инвестиционный Банк', - 'БМВ Банк', - 'БНП Париба Банк', - 'Богородский', - 'Богородский Муниципальный Банк', - 'Братский АНКБ', - 'БСТ-Банк', - 'Булгар Банк', - 'Бум-Банк', - 'Бумеранг', - 'БФГ-Кредит', - 'БыстроБанк', - 'Вакобанк', - 'Вега-Банк', - 'Век', - 'Великие Луки Банк', - 'Венец', - 'Верхневолжский', - 'Верхневолжский Крымский филиал', - 'Верхневолжский Московский филиал', - 'Верхневолжский Невский филиал', - 'Верхневолжский Таврический филиал', - 'Верхневолжский Ярославский филиал', - 'Веста', - 'Вестинтербанк', - 'Взаимодействие', - 'Викинг', - 'Витабанк', - 'Витязь', - 'Вкабанк', - 'Владбизнесбанк', - 'Владпромбанк', - 'Внешпромбанк', - 'Внешфинбанк', - 'Внешэкономбанк', - 'Военно-Промышленный Банк', - 'Возрождение', - 'Вокбанк', - 'Вологдабанк', - 'Вологжанин', - 'Воронеж', - 'Восточно-Европейский Трастовый Банк', - 'Восточный Экспресс Банк', - 'ВостСибтранскомбанк', - 'ВРБ Москва', - 'Всероссийский Банк Развития Регионов', - 'ВТБ', - 'ВТБ 24', - 'ВУЗ-Банк', - 'Выборг-Банк', - 'Выборг-Банк Московский филиал', - 'Вэлтон Банк', - 'Вятич', - 'Вятка-Банк', - 'Гагаринский', - 'Газбанк', - 'Газнефтьбанк', - 'Газпромбанк', - 'Газстройбанк', - 'Газтрансбанк', - 'Газэнергобанк', - 'Ганзакомбанк', - 'Гарант-Инвест', - 'Гаранти Банк Москва', - 'Геленджик-Банк', - 'Генбанк', - 'Геобанк', - 'Гефест', - 'Глобус', - 'Глобэкс', - 'Голдман Сакс Банк', - 'Горбанк', - 'ГПБ-Ипотека', - 'Гранд Инвест Банк', - 'Гринкомбанк', - 'Гринфилдбанк', - 'Грис-Банк', - 'Гута-Банк', - 'Далена', - 'Далетбанк', - 'Далта-Банк', - 'Дальневосточный Банк', - 'Данске Банк', - 'Девон-Кредит', - 'ДельтаКредит', - 'Денизбанк Москва', - 'Держава', - 'Дж. П. Морган Банк', - 'Джаст Банк', - 'Джей энд Ти Банк', - 'Дил-Банк', - 'Динамичные Системы', - 'Дойче Банк', - 'Долинск', - 'Дом-Банк', - 'Дон-Тексбанк', - 'Донкомбанк', - 'Донхлеббанк', - 'Дорис Банк', - 'Дружба', - 'ЕАТП Банк', - 'Евразийский Банк', - 'Евроазиатский Инвестиционный Банк', - 'ЕвроАксис Банк', - 'Евроальянс', - 'Еврокапитал-Альянс', - 'Еврокоммерц', - 'Еврокредит', - 'Евромет', - 'Европейский Стандарт', - 'Европлан Банк', - 'ЕвроситиБанк', - 'Еврофинанс Моснарбанк', - 'Единственный', - 'Единый Строительный Банк', - 'Екатеринбург', - 'Екатерининский', - 'Енисей', - 'Енисейский Объединенный Банк', - 'Ермак', - 'Живаго-Банк', - 'Жилкредит', - 'Жилстройбанк', - 'Запсибкомбанк', - 'Заречье', - 'Заубер Банк', - 'Земкомбанк', - 'Земский Банк', - 'Зенит', - 'Зенит Сочи', - 'Зернобанк', - 'Зираат Банк', - 'Златкомбанк', - 'И.Д.Е.А. Банк', - 'Иваново', - 'Идеалбанк', - 'Ижкомбанк', - 'ИК Банк', - 'Икано Банк', - 'Инбанк', - 'Инвест-Экобанк', - 'Инвестиционный Банк Кубани', - 'Инвестиционный Республиканский Банк', - 'Инвестиционный Союз', - 'Инвесткапиталбанк', - 'Инвестсоцбанк', - 'Инвестторгбанк', - 'ИНГ Банк', - 'Индустриальный Сберегательный Банк', - 'Инкаробанк', - 'Интерактивный Банк', - 'Интеркоммерц Банк', - 'Интеркоопбанк', - 'Интеркредит', - 'Интернациональный Торговый Банк', - 'Интерпрогрессбанк', - 'Интерпромбанк', - 'Интехбанк', - 'Информпрогресс', - 'Ипозембанк', - 'ИпоТек Банк', - 'Иронбанк', - 'ИРС', - 'Итуруп', - 'Ишбанк', - 'Йошкар-Ола', - 'Калуга', - 'Камский Горизонт', - 'Камский Коммерческий Банк', - 'Камчаткомагропромбанк', - 'Канский', - 'Капитал', - 'Капиталбанк', - 'Кедр', - 'Кемсоцинбанк', - 'Кетовский Коммерческий Банк', - 'Киви Банк', - 'Классик Эконом Банк', - 'Клиентский', - 'Кольцо Урала', - 'Коммерцбанк (Евразия)', - 'Коммерческий Банк Развития', - 'Коммерческий Индо Банк', - 'Консервативный Коммерческий Банк', - 'Констанс-Банк', - 'Континенталь', - 'Конфидэнс Банк', - 'Кор', - 'Кореа Эксчендж Банк Рус', - 'Королевский Банк Шотландии', - 'Космос', - 'Костромаселькомбанк', - 'Кошелев-Банк', - 'Крайинвестбанк', - 'Кранбанк', - 'Креди Агриколь КИБ', - 'Кредит Европа Банк', - 'Кредит Урал Банк', - 'Кредит Экспресс', - 'Кредит-Москва', - 'Кредитинвест', - 'Кредо Финанс', - 'Кредпромбанк', - 'Кремлевский', - 'Крокус-Банк', - 'Крона-Банк', - 'Кросна-Банк', - 'Кроссинвестбанк', - 'Крыловский', - 'КС Банк', - 'Кубанский Универсальный Банк', - 'Кубань Кредит', - 'Кубаньторгбанк', - 'Кузбассхимбанк', - 'Кузнецкбизнесбанк', - 'Кузнецкий', - 'Кузнецкий Мост', - 'Курган', - 'Курскпромбанк', - 'Лада-Кредит', - 'Лайтбанк', - 'Ланта-Банк', - 'Левобережный', - 'Легион', - 'Леноблбанк', - 'Лесбанк', - 'Лето Банк', - 'Липецккомбанк', - 'Логос', - 'Локо-Банк', - 'Лэнд-Банк', - 'М2М Прайвет Банк', - 'Майкопбанк', - 'Майский', - 'МАК-Банк', - 'Максима', - 'Максимум', - 'МАСТ-Банк', - 'Мастер-Капитал', - 'МВС Банк', - 'МДМ Банк', - 'Мегаполис', - 'Международный Акционерный Банк', - 'Международный Банк Развития', - 'Международный Банк Санкт-Петербурга (МБСП)', - 'Международный Коммерческий Банк', - 'Международный Расчетный Банк', - 'Международный Строительный Банк', - 'Международный Финансовый Клуб', - 'Межотраслевая Банковская Корпорация', - 'Межрегиональный Банк Реконструкции', - 'Межрегиональный Клиринговый Банк', - 'Межрегиональный Почтовый Банк', - 'Межрегиональный промышленно-строительный банк', - 'Межрегионбанк', - 'Межтопэнергобанк', - 'Межтрастбанк', - 'Мерседес-Бенц Банк Рус', - 'Металлинвестбанк', - 'Металлург', - 'Меткомбанк (Каменск-Уральский)', - 'Меткомбанк (Череповец)', - 'Метробанк', - 'Метрополь', - 'Мидзухо Банк', - 'Мико-Банк', - 'Милбанк', - 'Миллениум Банк', - 'Мир Бизнес Банк', - 'Мираф-Банк', - 'Мираф-Банк Московский филиал', - 'Миръ', - 'Михайловский ПЖСБ', - 'Морган Стэнли Банк', - 'Морской Банк', - 'Мосводоканалбанк', - 'Москва', - 'Москва-Сити', - 'Московский Вексельный Банк', - 'Московский Индустриальный Банк', - 'Московский Коммерческий Банк', - 'Московский Кредитный Банк', - 'Московский Национальный Инвестиционный Банк', - 'Московский Нефтехимический Банк', - 'Московский Областной Банк', - 'Московско-Парижский Банк', - 'Московское Ипотечное Агентство', - 'Москоммерцбанк', - 'Мосстройэкономбанк (М Банк)', - 'Мострансбанк', - 'Мосуралбанк', - 'МС Банк Рус', - 'МСП Банк', - 'МТИ-Банк', - 'МТС Банк', - 'Муниципальный Камчатпрофитбанк', - 'Мурманский Социальный Коммерческий Банк', - 'МФБанк', - 'Н-Банк', - 'Нальчик', - 'Наратбанк', - 'Народный Банк', - 'Народный Банк Республики Тыва', - 'Народный Доверительный Банк', - 'Народный Земельно-Промышленный Банк', - 'Народный Инвестиционный Банк', - 'Натиксис Банк', - 'Нацинвестпромбанк', - 'Национальная Факторинговая Компания', - 'Национальный Банк "Траст"', - 'Национальный Банк Взаимного Кредита', - 'Национальный Банк Сбережений', - 'Национальный Залоговый Банк', - 'Национальный Клиринговый Банк', - 'Национальный Клиринговый Центр', - 'Национальный Корпоративный Банк', - 'Национальный Резервный Банк', - 'Национальный Стандарт', - 'Наш Дом', - 'НБД-Банк', - 'НБК-Банк', - 'Невастройинвест', - 'Невский Банк', - 'Нейва', - 'Нерюнгрибанк', - 'Нефтепромбанк', - 'Нефтяной Альянс', - 'Нижневолжский Коммерческий Банк', - 'Нико-Банк', - 'НК Банк', - 'НоваховКапиталБанк', - 'Новация', - 'Новикомбанк', - 'Новобанк', - 'Новое Время', - 'Новокиб', - 'Новопокровский', - 'Новый Век', - 'Новый Кредитный Союз', - 'Новый Московский Банк', - ]; - - /** - * @example 'Новый Московский Банк' - */ - public static function bank() - { - return static::randomElement(static::$banks); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/ru_RU/Person.php b/vendor/fakerphp/faker/src/Faker/Provider/ru_RU/Person.php deleted file mode 100644 index 95ec8069..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/ru_RU/Person.php +++ /dev/null @@ -1,180 +0,0 @@ -middleNameMale(); - } - - if ($gender === static::GENDER_FEMALE) { - return $this->middleNameFemale(); - } - - return $this->middleName(static::randomElement([ - static::GENDER_MALE, - static::GENDER_FEMALE, - ])); - } - - /** - * Return last name for the specified gender. - * - * @param string|null $gender A gender of the last name should be generated - * for. If the argument is skipped a random gender will be used. - * - * @return string Last name - */ - public function lastName($gender = null) - { - $lastName = static::randomElement(static::$lastName); - - if (static::GENDER_FEMALE === $gender) { - return $lastName . 'а'; - } - - if (static::GENDER_MALE === $gender) { - return $lastName; - } - - return $lastName . static::randomElement(static::$lastNameSuffix); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/ru_RU/PhoneNumber.php b/vendor/fakerphp/faker/src/Faker/Provider/ru_RU/PhoneNumber.php deleted file mode 100644 index 06f63373..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/ru_RU/PhoneNumber.php +++ /dev/null @@ -1,14 +0,0 @@ -generator->parse(static::randomElement(static::$lastNameFormat)); - } - - public static function lastNameMale() - { - return static::randomElement(static::$lastNameMale); - } - - public static function lastNameFemale() - { - return static::randomElement(static::$lastNameFemale); - } - - /** - * @example 'PhD' - */ - public static function suffix() - { - return static::randomElement(static::$suffix); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/sk_SK/PhoneNumber.php b/vendor/fakerphp/faker/src/Faker/Provider/sk_SK/PhoneNumber.php deleted file mode 100644 index bd195e4f..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/sk_SK/PhoneNumber.php +++ /dev/null @@ -1,15 +0,0 @@ -format('ymd'); - $randomDigits = $this->getBirthNumber($gender); - - $checksum = Luhn::computeCheckDigit($datePart . $randomDigits); - - return $datePart . '-' . $randomDigits . $checksum; - } - - /** - * @param string $gender Person::GENDER_MALE || Person::GENDER_FEMALE - * - * @return string of three digits - */ - protected function getBirthNumber($gender = null) - { - if ($gender && $gender === static::GENDER_MALE) { - return (string) static::numerify('##') . static::randomElement([1, 3, 5, 7, 9]); - } - - $zeroCheck = static function ($callback) { - do { - $randomDigits = $callback(); - } while ($randomDigits === '000'); - - return $randomDigits; - }; - - if ($gender && $gender === static::GENDER_FEMALE) { - return $zeroCheck(static function () { - return (string) static::numerify('##') . static::randomElement([0, 2, 4, 6, 8]); - }); - } - - return $zeroCheck(static function () { - return (string) static::numerify('###'); - }); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/sv_SE/PhoneNumber.php b/vendor/fakerphp/faker/src/Faker/Provider/sv_SE/PhoneNumber.php deleted file mode 100644 index 2d5c5882..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/sv_SE/PhoneNumber.php +++ /dev/null @@ -1,64 +0,0 @@ - Swedish mobile number formats - */ - protected static array $mobileFormats = [ - '+467########', - '+46(0)7########', - '+46 (0)7## ## ## ##', - '+46 (0)7## ### ###', - '07## ## ## ##', - '07## ### ###', - '07##-## ## ##', - '07##-### ###', - '07# ### ## ##', - '07#-### ## ##', - '07#-#######', - ]; - - public function mobileNumber(): string - { - $format = static::randomElement(static::$mobileFormats); - - return self::numerify($this->generator->parse($format)); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/th_TH/Address.php b/vendor/fakerphp/faker/src/Faker/Provider/th_TH/Address.php deleted file mode 100644 index 49182816..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/th_TH/Address.php +++ /dev/null @@ -1,141 +0,0 @@ -format('a') === 'am' ? 'öö' : 'ös'; - } - - public static function dayOfWeek($max = 'now') - { - $map = [ - 'Sunday' => 'Pazar', - 'Monday' => 'Pazartesi', - 'Tuesday' => 'Salı', - 'Wednesday' => 'Çarşamba', - 'Thursday' => 'Perşembe', - 'Friday' => 'Cuma', - 'Saturday' => 'Cumartesi', - ]; - $week = static::dateTime($max)->format('l'); - - return $map[$week] ?? $week; - } - - public static function monthName($max = 'now') - { - $map = [ - 'January' => 'Ocak', - 'February' => 'Şubat', - 'March' => 'Mart', - 'April' => 'Nisan', - 'May' => 'Mayıs', - 'June' => 'Haziran', - 'July' => 'Temmuz', - 'August' => 'Ağustos', - 'September' => 'Eylül', - 'October' => 'Ekim', - 'November' => 'Kasım', - 'December' => 'Aralık', - ]; - $month = static::dateTime($max)->format('F'); - - return $map[$month] ?? $month; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/tr_TR/Internet.php b/vendor/fakerphp/faker/src/Faker/Provider/tr_TR/Internet.php deleted file mode 100644 index 9d821119..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/tr_TR/Internet.php +++ /dev/null @@ -1,9 +0,0 @@ - $digit) { - if ($index % 2 === 0) { - $evenSum += $digit; - } else { - $oddSum += $digit; - } - } - - $tenthDigit = (7 * $evenSum - $oddSum) % 10; - $eleventhDigit = ($evenSum + $oddSum + $tenthDigit) % 10; - - return $tenthDigit . $eleventhDigit; - } - - /** - * Checks whether a TCNo has a valid checksum - * - * @param string $tcNo - * - * @return bool - */ - public static function tcNoIsValid($tcNo) - { - return self::tcNoChecksum(substr($tcNo, 0, -2)) === substr($tcNo, -2, 2); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/tr_TR/PhoneNumber.php b/vendor/fakerphp/faker/src/Faker/Provider/tr_TR/PhoneNumber.php deleted file mode 100644 index 3103c77e..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/tr_TR/PhoneNumber.php +++ /dev/null @@ -1,186 +0,0 @@ -generator->parse($format); - } - - public static function streetPrefix() - { - return static::randomElement(static::$streetPrefix); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/uk_UA/Color.php b/vendor/fakerphp/faker/src/Faker/Provider/uk_UA/Color.php deleted file mode 100644 index 502161ce..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/uk_UA/Color.php +++ /dev/null @@ -1,23 +0,0 @@ -generator->parse($format); - } - - public static function companyPrefix() - { - return static::randomElement(static::$companyPrefix); - } - - public static function companyName() - { - return static::randomElement(static::$companyName); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/uk_UA/Internet.php b/vendor/fakerphp/faker/src/Faker/Provider/uk_UA/Internet.php deleted file mode 100644 index 61193547..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/uk_UA/Internet.php +++ /dev/null @@ -1,9 +0,0 @@ -middleNameMale(); - } - - if ($gender === static::GENDER_FEMALE) { - return $this->middleNameFemale(); - } - - return $this->middleName(static::randomElement([ - static::GENDER_MALE, - static::GENDER_FEMALE, - ])); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/uk_UA/PhoneNumber.php b/vendor/fakerphp/faker/src/Faker/Provider/uk_UA/PhoneNumber.php deleted file mode 100644 index 15b443f3..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/uk_UA/PhoneNumber.php +++ /dev/null @@ -1,72 +0,0 @@ -generator->parse($format)); - } - - public function hamletPrefix() - { - return static::randomElement(static::$hamletPrefix); - } - - public function wardName() - { - $format = static::randomElement(static::$wardNameFormats); - - return static::bothify($this->generator->parse($format)); - } - - public function wardPrefix() - { - return static::randomElement(static::$wardPrefix); - } - - public function districtName() - { - $format = static::randomElement(static::$districtNameFormats); - - return static::bothify($this->generator->parse($format)); - } - - public function districtPrefix() - { - return static::randomElement(static::$districtPrefix); - } - - /** - * @example 'Hà Nội' - */ - public function city() - { - return static::randomElement(static::$city); - } - - /** - * @example 'Bắc Giang' - */ - public static function province() - { - return static::randomElement(static::$province); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/vi_VN/Color.php b/vendor/fakerphp/faker/src/Faker/Provider/vi_VN/Color.php deleted file mode 100644 index df788550..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/vi_VN/Color.php +++ /dev/null @@ -1,36 +0,0 @@ -generator->parse(static::randomElement(static::$middleNameFormat)); - } - - public static function middleNameMale() - { - return static::randomElement(static::$middleNameMale); - } - - public static function middleNameFemale() - { - return static::randomElement(static::$middleNameFemale); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/vi_VN/PhoneNumber.php b/vendor/fakerphp/faker/src/Faker/Provider/vi_VN/PhoneNumber.php deleted file mode 100644 index a6f47f15..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/vi_VN/PhoneNumber.php +++ /dev/null @@ -1,61 +0,0 @@ - [ - '0[a] ### ####', - '(0[a]) ### ####', - '0[a]-###-####', - '(0[a])###-####', - '84-[a]-###-####', - '(84)([a])###-####', - '+84-[a]-###-####', - ], - '8' => [ - '0[a] #### ####', - '(0[a]) #### ####', - '0[a]-####-####', - '(0[a])####-####', - '84-[a]-####-####', - '(84)([a])####-####', - '+84-[a]-####-####', - ], - ]; - - public function phoneNumber() - { - $areaCode = static::randomElement(static::$areaCodes); - $areaCodeLength = strlen($areaCode); - $digits = 7; - - if ($areaCodeLength < 2) { - $digits = 8; - } - - return static::numerify(str_replace('[a]', $areaCode, static::randomElement(static::$formats[$digits]))); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/zh_CN/Address.php b/vendor/fakerphp/faker/src/Faker/Provider/zh_CN/Address.php deleted file mode 100644 index d67e1497..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/zh_CN/Address.php +++ /dev/null @@ -1,148 +0,0 @@ -city() . static::area(); - } - - public static function postcode() - { - $prefix = str_pad(self::numberBetween(1, 85), 2, 0, STR_PAD_LEFT); - $suffix = '00'; - - return $prefix . self::numberBetween(10, 88) . $suffix; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/zh_CN/Color.php b/vendor/fakerphp/faker/src/Faker/Provider/zh_CN/Color.php deleted file mode 100644 index 254fd071..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/zh_CN/Color.php +++ /dev/null @@ -1,66 +0,0 @@ -format('a') === 'am' ? '上午' : '下午'; - } - - public static function dayOfWeek($max = 'now') - { - $map = [ - 'Sunday' => '星期日', - 'Monday' => '星期一', - 'Tuesday' => '星期二', - 'Wednesday' => '星期三', - 'Thursday' => '星期四', - 'Friday' => '星期五', - 'Saturday' => '星期六', - ]; - $week = static::dateTime($max)->format('l'); - - return $map[$week] ?? $week; - } - - public static function monthName($max = 'now') - { - $map = [ - 'January' => '一月', - 'February' => '二月', - 'March' => '三月', - 'April' => '四月', - 'May' => '五月', - 'June' => '六月', - 'July' => '七月', - 'August' => '八月', - 'September' => '九月', - 'October' => '十月', - 'November' => '十一月', - 'December' => '十二月', - ]; - $month = static::dateTime($max)->format('F'); - - return $map[$month] ?? $month; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/zh_CN/Internet.php b/vendor/fakerphp/faker/src/Faker/Provider/zh_CN/Internet.php deleted file mode 100644 index e1a87964..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/zh_CN/Internet.php +++ /dev/null @@ -1,24 +0,0 @@ - [ - '板橋區', '三重區', '中和區', '永和區', - '新莊區', '新店區', '樹林區', '鶯歌區', - '三峽區', '淡水區', '汐止區', '瑞芳區', - '土城區', '蘆洲區', '五股區', '泰山區', - '林口區', '深坑區', '石碇區', '坪林區', - '三芝區', '石門區', '八里區', '平溪區', - '雙溪區', '貢寮區', '金山區', '萬里區', - '烏來區', - ], - '宜蘭縣' => [ - '宜蘭市', '羅東鎮', '蘇澳鎮', '頭城鎮', '礁溪鄉', - '壯圍鄉', '員山鄉', '冬山鄉', '五結鄉', '三星鄉', - '大同鄉', '南澳鄉', - ], - '桃園市' => [ - '桃園區', '中壢區', '大溪區', '楊梅區', '蘆竹區', - '大園區', '龜山區', '八德區', '龍潭區', '平鎮區', - '新屋區', '觀音區', '復興區', - ], - '新竹縣' => [ - '竹北市', '竹東鎮', '新埔鎮', '關西鎮', '湖口鄉', - '新豐鄉', '芎林鄉', '橫山鄉', '北埔鄉', '寶山鄉', - '峨眉鄉', '尖石鄉', '五峰鄉', - ], - '苗栗縣' => [ - '苗栗市', '苑裡鎮', '通霄鎮', '竹南鎮', '頭份鎮', - '後龍鎮', '卓蘭鎮', '大湖鄉', '公館鄉', '銅鑼鄉', - '南庄鄉', '頭屋鄉', '三義鄉', '西湖鄉', '造橋鄉', - '三灣鄉', '獅潭鄉', '泰安鄉', - ], - '臺中市' => [ - '豐原區', '東勢區', '大甲區', '清水區', '沙鹿區', - '梧棲區', '后里區', '神岡區', '潭子區', '大雅區', - '新社區', '石岡區', '外埔區', '大安區', '烏日區', - '大肚區', '龍井區', '霧峰區', '太平區', '大里區', - '和平區', '中區', '東區', '南區', '西區', '北區', - '西屯區', '南屯區', '北屯區', - ], - '彰化縣' => [ - '彰化市', '鹿港鎮', '和美鎮', '線西鄉', '伸港鄉', - '福興鄉', '秀水鄉', '花壇鄉', '芬園鄉', '員林鎮', - '溪湖鎮', '田中鎮', '大村鄉', '埔鹽鄉', '埔心鄉', - '永靖鄉', '社頭鄉', '二水鄉', '北斗鎮', '二林鎮', - '田尾鄉', '埤頭鄉', '芳苑鄉', '大城鄉', '竹塘鄉', - '溪州鄉', - ], - '南投縣' => [ - '南投市', '埔里鎮', '草屯鎮', '竹山鎮', '集集鎮', - '名間鄉', '鹿谷鄉', '中寮鄉', '魚池鄉', '國姓鄉', - '水里鄉', '信義鄉', '仁愛鄉', - ], - '雲林縣' => [ - '斗六市', '斗南鎮', '虎尾鎮', '西螺鎮', '土庫鎮', - '北港鎮', '古坑鄉', '大埤鄉', '莿桐鄉', '林內鄉', - '二崙鄉', '崙背鄉', '麥寮鄉', '東勢鄉', '褒忠鄉', - '臺西鄉', '元長鄉', '四湖鄉', '口湖鄉', '水林鄉', - ], - '嘉義縣' => [ - '太保市', '朴子市', '布袋鎮', '大林鎮', '民雄鄉', - '溪口鄉', '新港鄉', '六腳鄉', '東石鄉', '義竹鄉', - '鹿草鄉', '水上鄉', '中埔鄉', '竹崎鄉', '梅山鄉', - '番路鄉', '大埔鄉', '阿里山鄉', - ], - '臺南市' => [ - '新營區', '鹽水區', '白河區', '柳營區', '後壁區', - '東山區', '麻豆區', '下營區', '六甲區', '官田區', - '大內區', '佳里區', '學甲區', '西港區', '七股區', - '將軍區', '北門區', '新化區', '善化區', '新市區', - '安定區', '山上區', '玉井區', '楠西區', '南化區', - '左鎮區', '仁德區', '歸仁區', '關廟區', '龍崎區', - '永康區', '東區', '南區', '西區', '北區', '中區', - '安南區', '安平區', - ], - '高雄市' => [ - '鳳山區', '林園區', '大寮區', '大樹區', '大社區', - '仁武區', '鳥松區', '岡山區', '橋頭區', '燕巢區', - '田寮區', '阿蓮區', '路竹區', '湖內區', '茄萣區', - '永安區', '彌陀區', '梓官區', '旗山區', '美濃區', - '六龜區', '甲仙區', '杉林區', '內門區', '茂林區', - '桃源區', '三民區', '鹽埕區', '鼓山區', '左營區', - '楠梓區', '三民區', '新興區', '前金區', '苓雅區', - '前鎮區', '旗津區', '小港區', - ], - '屏東縣' => [ - '屏東市', '潮州鎮', '東港鎮', '恆春鎮', '萬丹鄉', - '長治鄉', '麟洛鄉', '九如鄉', '里港鄉', '鹽埔鄉', - '高樹鄉', '萬巒鄉', '內埔鄉', '竹田鄉', '新埤鄉', - '枋寮鄉', '新園鄉', '崁頂鄉', '林邊鄉', '南州鄉', - '佳冬鄉', '琉球鄉', '車城鄉', '滿州鄉', '枋山鄉', - '三地門鄉', '霧臺鄉', '瑪家鄉', '泰武鄉', '來義鄉', - '春日鄉', '獅子鄉', '牡丹鄉', - ], - '臺東縣' => [ - '臺東市', '成功鎮', '關山鎮', '卑南鄉', '鹿野鄉', - '池上鄉', '東河鄉', '長濱鄉', '太麻里鄉', '大武鄉', - '綠島鄉', '海端鄉', '延平鄉', '金峰鄉', '達仁鄉', - '蘭嶼鄉', - ], - '花蓮縣' => [ - '花蓮市', '鳳林鎮', '玉里鎮', '新城鄉', '吉安鄉', - '壽豐鄉', '光復鄉', '豐濱鄉', '瑞穗鄉', '富里鄉', - '秀林鄉', '萬榮鄉', '卓溪鄉', - ], - '澎湖縣' => [ - '馬公市', '湖西鄉', '白沙鄉', '西嶼鄉', '望安鄉', - '七美鄉', - ], - '基隆市' => [ - '中正區', '七堵區', '暖暖區', '仁愛區', '中山區', - '安樂區', '信義區', - ], - '新竹市' => [ - '東區', '北區', '香山區', - ], - '嘉義市' => [ - '東區', '西區', - ], - '臺北市' => [ - '松山區', '信義區', '大安區', '中山區', '中正區', - '大同區', '萬華區', '文山區', '南港區', '內湖區', - '士林區', '北投區', - ], - '連江縣' => [ - '南竿鄉', '北竿鄉', '莒光鄉', '東引鄉', - ], - '金門縣' => [ - '金城鎮', '金沙鎮', '金湖鎮', '金寧鄉', '烈嶼鄉', '烏坵鄉', - ], - ]; - - /** - * @see http://terms.naer.edu.tw/download/287/ - */ - protected static $country = [ - '不丹', '中非', '丹麥', '伊朗', '冰島', '剛果', - '加彭', '北韓', '南非', '卡達', '印尼', '印度', - '古巴', '哥德', '埃及', '多哥', '寮國', '尼日', - '巴曼', '巴林', '巴紐', '巴西', '希臘', '帛琉', - '德國', '挪威', '捷克', '教廷', '斐濟', '日本', - '智利', '東加', '查德', '汶萊', '法國', '波蘭', - '波赫', '泰國', '海地', '瑞典', '瑞士', '祕魯', - '秘魯', '約旦', '紐埃', '緬甸', '美國', '聖尼', - '聖普', '肯亞', '芬蘭', '英國', '荷蘭', '葉門', - '蘇丹', '諾魯', '貝南', '越南', '迦彭', - '迦納', '阿曼', '阿聯', '韓國', '馬利', - '以色列', '以色利', '伊拉克', '俄羅斯', - '利比亞', '加拿大', '匈牙利', '南極洲', - '南蘇丹', '厄瓜多', '吉布地', '吐瓦魯', - '哈撒克', '哈薩克', '喀麥隆', '喬治亞', - '土庫曼', '土耳其', '塔吉克', '塞席爾', - '墨西哥', '大西洋', '奧地利', '孟加拉', - '安哥拉', '安地卡', '安道爾', '尚比亞', - '尼伯爾', '尼泊爾', '巴哈馬', '巴拉圭', - '巴拿馬', '巴貝多', '幾內亞', '愛爾蘭', - '所在國', '摩洛哥', '摩納哥', '敍利亞', - '敘利亞', '新加坡', '東帝汶', '柬埔寨', - '比利時', '波扎那', '波札那', '烏克蘭', - '烏干達', '烏拉圭', '牙買加', '獅子山', - '甘比亞', '盧安達', '盧森堡', '科威特', - '科索夫', '科索沃', '立陶宛', '紐西蘭', - '維德角', '義大利', '聖文森', '艾塞亞', - '菲律賓', '萬那杜', '葡萄牙', '蒲隆地', - '蓋亞納', '薩摩亞', '蘇利南', '西班牙', - '貝里斯', '賴索托', '辛巴威', '阿富汗', - '阿根廷', '馬其頓', '馬拉威', '馬爾他', - '黎巴嫩', '亞塞拜然', '亞美尼亞', '保加利亞', - '南斯拉夫', '厄利垂亞', '史瓦濟蘭', '吉爾吉斯', - '吉里巴斯', '哥倫比亞', '坦尚尼亞', '塞內加爾', - '塞内加爾', '塞爾維亞', '多明尼加', '多米尼克', - '奈及利亞', '委內瑞拉', '宏都拉斯', '尼加拉瓜', - '巴基斯坦', '庫克群島', '愛沙尼亞', '拉脫維亞', - '摩爾多瓦', '摩里西斯', '斯洛伐克', '斯里蘭卡', - '格瑞那達', '模里西斯', '波多黎各', '澳大利亞', - '烏茲別克', '玻利維亞', '瓜地馬拉', '白俄羅斯', - '突尼西亞', '納米比亞', '索馬利亞', '索馬尼亞', - '羅馬尼亞', '聖露西亞', '聖馬利諾', '莫三比克', - '莫三鼻克', '葛摩聯盟', '薩爾瓦多', '衣索比亞', - '西薩摩亞', '象牙海岸', '賴比瑞亞', '賽普勒斯', - '馬來西亞', '馬爾地夫', '克羅埃西亞', - '列支敦斯登', '哥斯大黎加', '布吉納法索', - '布吉那法索', '幾內亞比索', '幾內亞比紹', - '斯洛維尼亞', '索羅門群島', '茅利塔尼亞', - '蒙特內哥羅', '赤道幾內亞', '阿爾及利亞', - '阿爾及尼亞', '阿爾巴尼亞', '馬紹爾群島', - '馬達加斯加', '密克羅尼西亞', '沙烏地阿拉伯', - '千里達及托巴哥', - ]; - - protected static $postcode = ['###-##', '###']; - - public function street() - { - return static::randomElement(static::$street); - } - - public static function randomChineseNumber() - { - $digits = [ - '', '一', '二', '三', '四', '五', '六', '七', '八', '九', - ]; - - return $digits[static::randomDigitNotNull()]; - } - - public static function randomNumber2() - { - return static::randomNumber(2) + 1; - } - - public static function randomNumber3() - { - return static::randomNumber(3) + 1; - } - - public static function localLatitude() - { - return static::randomFloat(6, 22, 25); - } - - public static function localLongitude() - { - return static::randomFloat(6, 120, 122); - } - - public function city() - { - $county = static::randomElement(array_keys(static::$city)); - $city = static::randomElement(static::$city[$county]); - - return $county . $city; - } - - public function state() - { - return '臺灣省'; - } - - public static function stateAbbr() - { - return '臺'; - } - - public static function cityPrefix() - { - return ''; - } - - public static function citySuffix() - { - return ''; - } - - public static function secondaryAddress() - { - return (static::randomNumber(2) + 1) . static::randomElement(static::$secondaryAddressSuffix); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/zh_TW/Color.php b/vendor/fakerphp/faker/src/Faker/Provider/zh_TW/Color.php deleted file mode 100644 index 19fa6d87..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/zh_TW/Color.php +++ /dev/null @@ -1,66 +0,0 @@ -generator->parse($format); - } - - public static function companyModifier() - { - return static::randomElement(static::$companyModifier); - } - - public static function companyPrefix() - { - return static::randomElement(static::$companyPrefix); - } - - public function catchPhrase() - { - return static::randomElement(static::$catchPhrase); - } - - public function bs() - { - $result = ''; - - foreach (static::$bsWords as &$word) { - $result .= static::randomElement($word); - } - - return $result; - } - - /** - * return standard VAT / Tax ID / Uniform Serial Number - * - * @example 28263822 - * - * @return int - */ - public function VAT() - { - return static::randomNumber(8, true); - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/zh_TW/DateTime.php b/vendor/fakerphp/faker/src/Faker/Provider/zh_TW/DateTime.php deleted file mode 100644 index 102a716c..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/zh_TW/DateTime.php +++ /dev/null @@ -1,48 +0,0 @@ -format('a') === 'am' ? '上午' : '下午'; - } - - public static function dayOfWeek($max = 'now') - { - $map = [ - 'Sunday' => '星期日', - 'Monday' => '星期一', - 'Tuesday' => '星期二', - 'Wednesday' => '星期三', - 'Thursday' => '星期四', - 'Friday' => '星期五', - 'Saturday' => '星期六', - ]; - $week = static::dateTime($max)->format('l'); - - return $map[$week] ?? $week; - } - - public static function monthName($max = 'now') - { - $map = [ - 'January' => '一月', - 'February' => '二月', - 'March' => '三月', - 'April' => '四月', - 'May' => '五月', - 'June' => '六月', - 'July' => '七月', - 'August' => '八月', - 'September' => '九月', - 'October' => '十月', - 'November' => '十一月', - 'December' => '十二月', - ]; - $month = static::dateTime($max)->format('F'); - - return $map[$month] ?? $month; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/zh_TW/Internet.php b/vendor/fakerphp/faker/src/Faker/Provider/zh_TW/Internet.php deleted file mode 100644 index c3fb5fff..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/zh_TW/Internet.php +++ /dev/null @@ -1,28 +0,0 @@ - 10, - 'B' => 11, - 'C' => 12, - 'D' => 13, - 'E' => 14, - 'F' => 15, - 'G' => 16, - 'H' => 17, - 'I' => 34, - 'J' => 18, - 'K' => 19, - 'M' => 21, - 'N' => 22, - 'O' => 35, - 'P' => 23, - 'Q' => 24, - 'T' => 27, - 'U' => 28, - 'V' => 29, - 'W' => 32, - 'X' => 30, - 'Z' => 33, - ]; - - /** - * @see https://zh.wikipedia.org/wiki/%E4%B8%AD%E8%8F%AF%E6%B0%91%E5%9C%8B%E5%9C%8B%E6%B0%91%E8%BA%AB%E5%88%86%E8%AD%89 - */ - public static $idDigitValidator = [1, 9, 8, 7, 6, 5, 4, 3, 2, 1, 1]; - - protected static $maleNameFormats = [ - '{{lastName}}{{firstNameMale}}', - ]; - - protected static $femaleNameFormats = [ - '{{lastName}}{{firstNameFemale}}', - ]; - - protected static $titleMale = ['先生', '博士', '教授']; - protected static $titleFemale = ['小姐', '太太', '博士', '教授']; - - /** - * @see http://zh.wikipedia.org/wiki/%E7%99%BE%E5%AE%B6%E5%A7%93 - */ - protected static $lastName = [ - '趙', '錢', '孫', '李', '周', '吳', '鄭', '王', '馮', - '陳', '褚', '衛', '蔣', '沈', '韓', '楊', '朱', '秦', - '尤', '許', '何', '呂', '施', '張', '孔', '曹', '嚴', - '華', '金', '魏', '陶', '姜', '戚', '謝', '鄒', '喻', - '柏', '水', '竇', '章', '雲', '蘇', '潘', '葛', - '奚', '范', '彭', '郎', '魯', '韋', '昌', '馬', - '苗', '鳳', '花', '方', '俞', '任', '袁', '柳', - '酆', '鮑', '史', '唐', '費', '廉', '岑', '薛', - '雷', '賀', '倪', '湯', '滕', '殷', '羅', '畢', - '郝', '鄔', '安', '常', '樂', '于', '時', '傅', - '皮', '卞', '齊', '康', '伍', '余', '元', '卜', - '顧', '孟', '平', '黃', '和', '穆', '蕭', '尹', - '姚', '邵', '湛', '汪', '祁', '毛', '禹', '狄', - '米', '貝', '明', '臧', '計', '伏', '成', '戴', - '談', '宋', '茅', '龐', '熊', '紀', '舒', '屈', - '項', '祝', '董', '梁', '杜', '阮', '藍', '閔', - '席', '季', '麻', '強', '賈', '路', '婁', '危', - '江', '童', '顏', '郭', '梅', '盛', '林', '刁', - '鍾', '徐', '丘', '駱', '高', '夏', '蔡', '田', - '樊', '胡', '凌', '霍', '虞', '萬', '支', '柯', - '昝', '管', '盧', '莫', '經', '房', '裘', '繆', - '干', '解', '應', '宗', '丁', '宣', '賁', '鄧', - '郁', '單', '杭', '洪', '包', '諸', '左', '石', - '崔', '吉', '鈕', '龔', '程', '嵇', '邢', '滑', - '裴', '陸', '榮', '翁', '荀', '羊', '於', '惠', - '甄', '麴', '家', '封', '芮', '羿', '儲', '靳', - '汲', '邴', '糜', '松', '井', '段', '富', '巫', - '烏', '焦', '巴', '弓', '牧', '隗', '山', '谷', - '車', '侯', '宓', '蓬', '全', '郗', '班', '仰', - '秋', '仲', '伊', '宮', '甯', '仇', '欒', '暴', - '甘', '鈄', '厲', '戎', '祖', '武', '符', '劉', - '景', '詹', '束', '龍', '葉', '幸', '司', '韶', - '郜', '黎', '薊', '薄', '印', '宿', '白', '懷', - '蒲', '邰', '從', '鄂', '索', '咸', '籍', '賴', - '卓', '藺', '屠', '蒙', '池', '喬', '陰', '鬱', - '胥', '能', '蒼', '雙', '聞', '莘', '黨', '翟', - '譚', '貢', '勞', '逄', '姬', '申', '扶', '堵', - '冉', '宰', '酈', '雍', '郤', '璩', '桑', '桂', - '濮', '牛', '壽', '通', '邊', '扈', '燕', '冀', - '郟', '浦', '尚', '農', '溫', '別', '莊', '晏', - '柴', '瞿', '閻', '充', '慕', '連', '茹', '習', - '宦', '艾', '魚', '容', '向', '古', '易', '慎', - '戈', '廖', '庾', '終', '暨', '居', '衡', '步', - '都', '耿', '滿', '弘', '匡', '國', '文', '寇', - '廣', '祿', '闕', '東', '歐', '殳', '沃', '利', - '蔚', '越', '夔', '隆', '師', '鞏', '厙', '聶', - '晁', '勾', '敖', '融', '冷', '訾', '辛', '闞', - '那', '簡', '饒', '空', '曾', '毋', '沙', '乜', - '養', '鞠', '須', '豐', '巢', '關', '蒯', '相', - '查', '后', '荊', '紅', '游', '竺', '權', '逯', - '蓋', '益', '桓', '公', '万俟', '司馬', '上官', - '歐陽', '夏侯', '諸葛', '聞人', '東方', '赫連', - '皇甫', '尉遲', '公羊', '澹臺', '公冶', '宗政', - '濮陽', '淳于', '單于', '太叔', '申屠', '公孫', - '仲孫', '軒轅', '令狐', '鍾離', '宇文', '長孫', - '慕容', '鮮于', '閭丘', '司徒', '司空', '亓官', - '司寇', '仉', '督', '子車', '顓孫', '端木', '巫馬', - '公西', '漆雕', '樂正', '壤駟', '公良', '拓跋', - '夾谷', '宰父', '穀梁', '晉', '楚', '閆', '法', - '汝', '鄢', '涂', '欽', '段干', '百里', '東郭', - '南門', '呼延', '歸', '海', '羊舌', '微生', '岳', - '帥', '緱', '亢', '況', '後', '有', '琴', '梁丘', - '左丘', '東門', '西門', '商', '牟', '佘', '佴', - '伯', '賞', '南宮', '墨', '哈', '譙', '笪', '年', - '愛', '陽', '佟', '第五', '言', '福', - ]; - - /** - * @see http://technology.chtsai.org/namefreq/ - */ - protected static $characterMale = [ - '佳', '俊', '信', '偉', '傑', '冠', '君', '哲', - '嘉', '威', '宇', '安', '宏', '宗', '宜', '家', - '庭', '廷', '建', '彥', '心', '志', '思', '承', - '文', '柏', '樺', '瑋', '穎', '美', '翰', '華', - '詩', '豪', '賢', '軒', '銘', '霖', - ]; - - protected static $characterFemale = [ - '伶', '佩', '佳', '依', '儀', '冠', '君', '嘉', - '如', '娟', '婉', '婷', '安', '宜', '家', '庭', - '心', '思', '怡', '惠', '慧', '文', '欣', '涵', - '淑', '玲', '珊', '琪', '琬', '瑜', '穎', '筑', - '筱', '美', '芬', '芳', '華', '萍', '萱', '蓉', - '詩', '貞', '郁', '鈺', '雅', '雯', '靜', '馨', - ]; - - public static function randomName($pool, $n) - { - $name = ''; - - for ($i = 0; $i < $n; ++$i) { - $name .= static::randomElement($pool); - } - - return $name; - } - - public static function firstNameMale() - { - return static::randomName(static::$characterMale, self::numberBetween(1, 2)); - } - - public static function firstNameFemale() - { - return static::randomName(static::$characterFemale, self::numberBetween(1, 2)); - } - - public static function suffix() - { - return ''; - } - - /** - * @param string $gender Person::GENDER_MALE || Person::GENDER_FEMALE - * - * @see https://en.wikipedia.org/wiki/National_Identification_Card_(Republic_of_China) - * - * @return string Length 10 alphanumeric characters, begins with 1 latin character (birthplace), - * 1 number (gender) and then 8 numbers (the last one is check digit). - */ - public function personalIdentityNumber($gender = null) - { - $birthPlace = self::randomKey(self::$idBirthplaceCode); - $birthPlaceCode = self::$idBirthplaceCode[$birthPlace]; - - $gender = ($gender != null) ? $gender : self::randomElement([self::GENDER_FEMALE, self::GENDER_MALE]); - $genderCode = ($gender === self::GENDER_MALE) ? 1 : 2; - - $randomNumberCode = self::randomNumber(7, true); - - $codes = str_split($birthPlaceCode . $genderCode . $randomNumberCode); - $total = 0; - - foreach ($codes as $key => $code) { - $total += $code * self::$idDigitValidator[$key]; - } - - $checkSumDigit = 10 - ($total % 10); - - if ($checkSumDigit == 10) { - $checkSumDigit = 0; - } - - return $birthPlace . $genderCode . $randomNumberCode . $checkSumDigit; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/Provider/zh_TW/PhoneNumber.php b/vendor/fakerphp/faker/src/Faker/Provider/zh_TW/PhoneNumber.php deleted file mode 100644 index db9ac327..00000000 --- a/vendor/fakerphp/faker/src/Faker/Provider/zh_TW/PhoneNumber.php +++ /dev/null @@ -1,19 +0,0 @@ - 251: - $temp .= $chars[++$i]; - // no break - case $ord > 247: - $temp .= $chars[++$i]; - // no break - case $ord > 239: - $temp .= $chars[++$i]; - // no break - case $ord > 223: - $temp .= $chars[++$i]; - // no break - case $ord > 191: - $temp .= $chars[++$i]; - } - - $encoding[] = $temp; - } - - return $encoding; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/UniqueGenerator.php b/vendor/fakerphp/faker/src/Faker/UniqueGenerator.php deleted file mode 100644 index fef167b6..00000000 --- a/vendor/fakerphp/faker/src/Faker/UniqueGenerator.php +++ /dev/null @@ -1,87 +0,0 @@ - ['0123' => null], - * 'city' => ['London' => null, 'Tokyo' => null], - * ] - * - * @var array> - */ - protected $uniques = []; - - /** - * @param Extension|Generator $generator - * @param int $maxRetries - * @param array> $uniques - */ - public function __construct($generator, $maxRetries = 10000, &$uniques = []) - { - $this->generator = $generator; - $this->maxRetries = $maxRetries; - $this->uniques = &$uniques; - } - - public function ext(string $id) - { - return new self($this->generator->ext($id), $this->maxRetries, $this->uniques); - } - - /** - * Catch and proxy all generator calls but return only unique values - * - * @param string $attribute - * - * @deprecated Use a method instead. - */ - public function __get($attribute) - { - trigger_deprecation('fakerphp/faker', '1.14', 'Accessing property "%s" is deprecated, use "%s()" instead.', $attribute, $attribute); - - return $this->__call($attribute, []); - } - - /** - * Catch and proxy all generator calls with arguments but return only unique values - * - * @param string $name - * @param array $arguments - */ - public function __call($name, $arguments) - { - if (!isset($this->uniques[$name])) { - $this->uniques[$name] = []; - } - $i = 0; - - do { - $res = call_user_func_array([$this->generator, $name], $arguments); - ++$i; - - if ($i > $this->maxRetries) { - throw new \OverflowException(sprintf('Maximum retries of %d reached without finding a unique value', $this->maxRetries)); - } - } while (array_key_exists(serialize($res), $this->uniques[$name])); - $this->uniques[$name][serialize($res)] = null; - - return $res; - } -} diff --git a/vendor/fakerphp/faker/src/Faker/ValidGenerator.php b/vendor/fakerphp/faker/src/Faker/ValidGenerator.php deleted file mode 100644 index bf409456..00000000 --- a/vendor/fakerphp/faker/src/Faker/ValidGenerator.php +++ /dev/null @@ -1,78 +0,0 @@ -valid() - * - * @mixin Generator - */ -class ValidGenerator -{ - protected $generator; - protected $validator; - protected $maxRetries; - - /** - * @param Extension|Generator $generator - * @param callable|null $validator - * @param int $maxRetries - */ - public function __construct($generator, $validator = null, $maxRetries = 10000) - { - if (null === $validator) { - $validator = static function () { - return true; - }; - } elseif (!is_callable($validator)) { - throw new \InvalidArgumentException('valid() only accepts callables as first argument'); - } - $this->generator = $generator; - $this->validator = $validator; - $this->maxRetries = $maxRetries; - } - - public function ext(string $id) - { - return new self($this->generator->ext($id), $this->validator, $this->maxRetries); - } - - /** - * Catch and proxy all generator calls but return only valid values - * - * @param string $attribute - * - * @deprecated Use a method instead. - */ - public function __get($attribute) - { - trigger_deprecation('fakerphp/faker', '1.14', 'Accessing property "%s" is deprecated, use "%s()" instead.', $attribute, $attribute); - - return $this->__call($attribute, []); - } - - /** - * Catch and proxy all generator calls with arguments but return only valid values - * - * @param string $name - * @param array $arguments - */ - public function __call($name, $arguments) - { - $i = 0; - - do { - $res = call_user_func_array([$this->generator, $name], $arguments); - ++$i; - - if ($i > $this->maxRetries) { - throw new \OverflowException(sprintf('Maximum retries of %d reached without finding a valid value', $this->maxRetries)); - } - } while (!call_user_func($this->validator, $res)); - - return $res; - } -} diff --git a/vendor/fakerphp/faker/src/autoload.php b/vendor/fakerphp/faker/src/autoload.php deleted file mode 100644 index a4dfa9ec..00000000 --- a/vendor/fakerphp/faker/src/autoload.php +++ /dev/null @@ -1,29 +0,0 @@ - -Copyright (c) 2017-2022 Barryvdh - -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/fruitcake/php-cors/README.md b/vendor/fruitcake/php-cors/README.md deleted file mode 100644 index 6effc74f..00000000 --- a/vendor/fruitcake/php-cors/README.md +++ /dev/null @@ -1,78 +0,0 @@ -# CORS for PHP (using the Symfony HttpFoundation) - -[![Unit Tests](https://github.com/fruitcake/php-cors/actions/workflows/run-tests.yml/badge.svg)](https://github.com/fruitcake/php-cors/actions) -[![PHPStan Level 9](https://img.shields.io/badge/PHPStan-Level%209-blue)](https://github.com/fruitcake/php-cors/actions) -[![Code Coverage](https://img.shields.io/badge/CodeCoverage-100%25-brightgreen)](https://github.com/fruitcake/php-cors/actions/workflows/run-coverage.yml) -[![Packagist License](https://poser.pugx.org/fruitcake/php-cors/license.png)](http://choosealicense.com/licenses/mit/) -[![Latest Stable Version](https://poser.pugx.org/fruitcake/php-cors/version.png)](https://packagist.org/packages/fruitcake/php-cors) -[![Total Downloads](https://poser.pugx.org/fruitcake/php-cors/d/total.png)](https://packagist.org/packages/fruitcake/php-cors) -[![Fruitcake](https://img.shields.io/badge/Powered%20By-Fruitcake-b2bc35.svg)](https://fruitcake.nl/) - -Library and middleware enabling cross-origin resource sharing for your -http-{foundation,kernel} using application. It attempts to implement the -[W3C Recommendation] for cross-origin resource sharing. - -[W3C Recommendation]: http://www.w3.org/TR/cors/ - -> Note: This is a standalone fork of https://github.com/asm89/stack-cors and is compatible with the options for CorsService. -## Installation - -Require `fruitcake/php-cors` using composer. - -## Usage - -This package can be used as a library. You can use it in your framework using: - - - [Stack middleware](http://stackphp.com/): https://github.com/asm89/stack-cors - - [Laravel](https://laravel.com): https://github.com/fruitcake/laravel-cors - - -### Options - -| Option | Description | Default value | -|------------------------|------------------------------------------------------------|---------------| -| allowedMethods | Matches the request method. | `[]` | -| allowedOrigins | Matches the request origin. | `[]` | -| allowedOriginsPatterns | Matches the request origin with `preg_match`. | `[]` | -| allowedHeaders | Sets the Access-Control-Allow-Headers response header. | `[]` | -| exposedHeaders | Sets the Access-Control-Expose-Headers response header. | `[]` | -| maxAge | Sets the Access-Control-Max-Age response header. | `0` | -| supportsCredentials | Sets the Access-Control-Allow-Credentials header. | `false` | - -The _allowedMethods_ and _allowedHeaders_ options are case-insensitive. - -You don't need to provide both _allowedOrigins_ and _allowedOriginsPatterns_. If one of the strings passed matches, it is considered a valid origin. A wildcard in allowedOrigins will be converted to a pattern. - -If `['*']` is provided to _allowedMethods_, _allowedOrigins_ or _allowedHeaders_ all methods / origins / headers are allowed. - -> Note: Allowing a single static origin will improve cacheability. - -### Example: using the library - -```php - ['x-allowed-header', 'x-other-allowed-header'], - 'allowedMethods' => ['DELETE', 'GET', 'POST', 'PUT'], - 'allowedOrigins' => ['http://localhost', 'https://*.example.com'], - 'allowedOriginsPatterns' => ['/localhost:\d/'], - 'exposedHeaders' => ['Content-Encoding'], - 'maxAge' => false, - 'supportsCredentials' => false, -]); - -$cors->addActualRequestHeaders(Response $response, $origin); -$cors->handlePreflightRequest(Request $request); -$cors->isActualRequestAllowed(Request $request); -$cors->isCorsRequest(Request $request); -$cors->isPreflightRequest(Request $request); -``` - -## License - -Released under the MIT License, see [LICENSE](LICENSE). - -> This package is split-off from https://github.com/asm89/stack-cors and developed as stand-alone library since 2022 diff --git a/vendor/fruitcake/php-cors/composer.json b/vendor/fruitcake/php-cors/composer.json deleted file mode 100644 index dc40cccb..00000000 --- a/vendor/fruitcake/php-cors/composer.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "fruitcake/php-cors", - "description": "Cross-origin resource sharing library for the Symfony HttpFoundation", - "keywords": ["cors", "symfony", "laravel"], - "homepage": "https://github.com/fruitcake/php-cors", - "type": "library", - "license": "MIT", - "authors": [ - { - "name": "Fruitcake", - "homepage": "https://fruitcake.nl" - }, - { - "name": "Barryvdh", - "email": "barryvdh@gmail.com" - } - ], - "require": { - "php": "^7.4|^8.0", - "symfony/http-foundation": "^4.4|^5.4|^6" - }, - "require-dev": { - "phpunit/phpunit": "^9", - "squizlabs/php_codesniffer": "^3.5", - "phpstan/phpstan": "^1.4" - }, - "autoload": { - "psr-4": { - "Fruitcake\\Cors\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Fruitcake\\Cors\\Tests\\": "tests/" - } - }, - "scripts": { - "actions": "composer test && composer analyse && composer check-style", - "test": "phpunit", - "analyse": "phpstan analyse src tests --level=9", - "check-style": "phpcs -p --standard=PSR12 --exclude=Generic.Files.LineLength --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1 src tests", - "fix-style": "phpcbf -p --standard=PSR12 --exclude=Generic.Files.LineLength --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1 src tests" - }, - "extra": { - "branch-alias": { - "dev-main": "1.1-dev" - } - } -} diff --git a/vendor/fruitcake/php-cors/src/CorsService.php b/vendor/fruitcake/php-cors/src/CorsService.php deleted file mode 100644 index 35a3f738..00000000 --- a/vendor/fruitcake/php-cors/src/CorsService.php +++ /dev/null @@ -1,285 +0,0 @@ - - * (c) Barryvdh - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Fruitcake\Cors; - -use Fruitcake\Cors\Exceptions\InvalidOptionException; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; - -/** - * @phpstan-type CorsInputOptions array{ - * 'allowedOrigins'?: string[], - * 'allowedOriginsPatterns'?: string[], - * 'supportsCredentials'?: bool, - * 'allowedHeaders'?: string[], - * 'allowedMethods'?: string[], - * 'exposedHeaders'?: string[]|false, - * 'maxAge'?: int|bool|null, - * 'allowed_origins'?: string[], - * 'allowed_origins_patterns'?: string[], - * 'supports_credentials'?: bool, - * 'allowed_headers'?: string[], - * 'allowed_methods'?: string[], - * 'exposed_headers'?: string[]|false, - * 'max_age'?: int|bool|null - * } - * - */ -class CorsService -{ - /** @var string[] */ - private array $allowedOrigins = []; - /** @var string[] */ - private array $allowedOriginsPatterns = []; - /** @var string[] */ - private array $allowedMethods = []; - /** @var string[] */ - private array $allowedHeaders = []; - /** @var string[] */ - private array $exposedHeaders = []; - private bool $supportsCredentials = false; - private ?int $maxAge = 0; - - private bool $allowAllOrigins = false; - private bool $allowAllMethods = false; - private bool $allowAllHeaders = false; - - /** - * @param CorsInputOptions $options - */ - public function __construct(array $options = []) - { - if ($options) { - $this->setOptions($options); - } - } - - /** - * @param CorsInputOptions $options - */ - public function setOptions(array $options): void - { - $this->allowedOrigins = $options['allowedOrigins'] ?? $options['allowed_origins'] ?? $this->allowedOrigins; - $this->allowedOriginsPatterns = - $options['allowedOriginsPatterns'] ?? $options['allowed_origins_patterns'] ?? $this->allowedOriginsPatterns; - $this->allowedMethods = $options['allowedMethods'] ?? $options['allowed_methods'] ?? $this->allowedMethods; - $this->allowedHeaders = $options['allowedHeaders'] ?? $options['allowed_headers'] ?? $this->allowedHeaders; - $this->supportsCredentials = - $options['supportsCredentials'] ?? $options['supports_credentials'] ?? $this->supportsCredentials; - - $maxAge = $this->maxAge; - if (array_key_exists('maxAge', $options)) { - $maxAge = $options['maxAge']; - } elseif (array_key_exists('max_age', $options)) { - $maxAge = $options['max_age']; - } - $this->maxAge = $maxAge === null ? null : (int)$maxAge; - - $exposedHeaders = $options['exposedHeaders'] ?? $options['exposed_headers'] ?? $this->exposedHeaders; - $this->exposedHeaders = $exposedHeaders === false ? [] : $exposedHeaders; - - $this->normalizeOptions(); - } - - private function normalizeOptions(): void - { - // Normalize case - $this->allowedHeaders = array_map('strtolower', $this->allowedHeaders); - $this->allowedMethods = array_map('strtoupper', $this->allowedMethods); - - // Normalize ['*'] to true - $this->allowAllOrigins = in_array('*', $this->allowedOrigins); - $this->allowAllHeaders = in_array('*', $this->allowedHeaders); - $this->allowAllMethods = in_array('*', $this->allowedMethods); - - // Transform wildcard pattern - if (!$this->allowAllOrigins) { - foreach ($this->allowedOrigins as $origin) { - if (strpos($origin, '*') !== false) { - $this->allowedOriginsPatterns[] = $this->convertWildcardToPattern($origin); - } - } - } - } - - /** - * Create a pattern for a wildcard, based on Str::is() from Laravel - * - * @see https://github.com/laravel/framework/blob/5.5/src/Illuminate/Support/Str.php - * @param string $pattern - * @return string - */ - private function convertWildcardToPattern($pattern) - { - $pattern = preg_quote($pattern, '#'); - - // Asterisks are translated into zero-or-more regular expression wildcards - // to make it convenient to check if the strings starts with the given - // pattern such as "*.example.com", making any string check convenient. - $pattern = str_replace('\*', '.*', $pattern); - - return '#^' . $pattern . '\z#u'; - } - - public function isCorsRequest(Request $request): bool - { - return $request->headers->has('Origin'); - } - - public function isPreflightRequest(Request $request): bool - { - return $request->getMethod() === 'OPTIONS' && $request->headers->has('Access-Control-Request-Method'); - } - - public function handlePreflightRequest(Request $request): Response - { - $response = new Response(); - - $response->setStatusCode(204); - - return $this->addPreflightRequestHeaders($response, $request); - } - - public function addPreflightRequestHeaders(Response $response, Request $request): Response - { - $this->configureAllowedOrigin($response, $request); - - if ($response->headers->has('Access-Control-Allow-Origin')) { - $this->configureAllowCredentials($response, $request); - - $this->configureAllowedMethods($response, $request); - - $this->configureAllowedHeaders($response, $request); - - $this->configureMaxAge($response, $request); - } - - return $response; - } - - public function isOriginAllowed(Request $request): bool - { - if ($this->allowAllOrigins === true) { - return true; - } - - $origin = (string) $request->headers->get('Origin'); - - if (in_array($origin, $this->allowedOrigins)) { - return true; - } - - foreach ($this->allowedOriginsPatterns as $pattern) { - if (preg_match($pattern, $origin)) { - return true; - } - } - - return false; - } - - public function addActualRequestHeaders(Response $response, Request $request): Response - { - $this->configureAllowedOrigin($response, $request); - - if ($response->headers->has('Access-Control-Allow-Origin')) { - $this->configureAllowCredentials($response, $request); - - $this->configureExposedHeaders($response, $request); - } - - return $response; - } - - private function configureAllowedOrigin(Response $response, Request $request): void - { - if ($this->allowAllOrigins === true && !$this->supportsCredentials) { - // Safe+cacheable, allow everything - $response->headers->set('Access-Control-Allow-Origin', '*'); - } elseif ($this->isSingleOriginAllowed()) { - // Single origins can be safely set - $response->headers->set('Access-Control-Allow-Origin', array_values($this->allowedOrigins)[0]); - } else { - // For dynamic headers, set the requested Origin header when set and allowed - if ($this->isCorsRequest($request) && $this->isOriginAllowed($request)) { - $response->headers->set('Access-Control-Allow-Origin', (string) $request->headers->get('Origin')); - } - - $this->varyHeader($response, 'Origin'); - } - } - - private function isSingleOriginAllowed(): bool - { - if ($this->allowAllOrigins === true || count($this->allowedOriginsPatterns) > 0) { - return false; - } - - return count($this->allowedOrigins) === 1; - } - - private function configureAllowedMethods(Response $response, Request $request): void - { - if ($this->allowAllMethods === true) { - $allowMethods = strtoupper((string) $request->headers->get('Access-Control-Request-Method')); - $this->varyHeader($response, 'Access-Control-Request-Method'); - } else { - $allowMethods = implode(', ', $this->allowedMethods); - } - - $response->headers->set('Access-Control-Allow-Methods', $allowMethods); - } - - private function configureAllowedHeaders(Response $response, Request $request): void - { - if ($this->allowAllHeaders === true) { - $allowHeaders = (string) $request->headers->get('Access-Control-Request-Headers'); - $this->varyHeader($response, 'Access-Control-Request-Headers'); - } else { - $allowHeaders = implode(', ', $this->allowedHeaders); - } - $response->headers->set('Access-Control-Allow-Headers', $allowHeaders); - } - - private function configureAllowCredentials(Response $response, Request $request): void - { - if ($this->supportsCredentials) { - $response->headers->set('Access-Control-Allow-Credentials', 'true'); - } - } - - private function configureExposedHeaders(Response $response, Request $request): void - { - if ($this->exposedHeaders) { - $response->headers->set('Access-Control-Expose-Headers', implode(', ', $this->exposedHeaders)); - } - } - - private function configureMaxAge(Response $response, Request $request): void - { - if ($this->maxAge !== null) { - $response->headers->set('Access-Control-Max-Age', (string) $this->maxAge); - } - } - - public function varyHeader(Response $response, string $header): Response - { - if (!$response->headers->has('Vary')) { - $response->headers->set('Vary', $header); - } elseif (!in_array($header, explode(', ', (string) $response->headers->get('Vary')))) { - $response->headers->set('Vary', ((string) $response->headers->get('Vary')) . ', ' . $header); - } - - return $response; - } -} diff --git a/vendor/fruitcake/php-cors/src/Exceptions/InvalidOptionException.php b/vendor/fruitcake/php-cors/src/Exceptions/InvalidOptionException.php deleted file mode 100644 index eba6f466..00000000 --- a/vendor/fruitcake/php-cors/src/Exceptions/InvalidOptionException.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. - */ - -namespace Fruitcake\Cors\Exceptions; - -class InvalidOptionException extends \RuntimeException -{ -} diff --git a/vendor/graham-campbell/result-type/LICENSE b/vendor/graham-campbell/result-type/LICENSE deleted file mode 100644 index 9a8accb9..00000000 --- a/vendor/graham-campbell/result-type/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2020-2022 Graham Campbell - -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/graham-campbell/result-type/composer.json b/vendor/graham-campbell/result-type/composer.json deleted file mode 100644 index f85e1d13..00000000 --- a/vendor/graham-campbell/result-type/composer.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "graham-campbell/result-type", - "description": "An Implementation Of The Result Type", - "keywords": ["result", "result-type", "Result", "Result Type", "Result-Type", "Graham Campbell", "GrahamCampbell"], - "license": "MIT", - "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - } - ], - "require": { - "php": "^7.2.5 || ^8.0", - "phpoption/phpoption": "^1.9" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.28 || ^9.5.21" - }, - "autoload": { - "psr-4": { - "GrahamCampbell\\ResultType\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "GrahamCampbell\\Tests\\ResultType\\": "tests/" - } - }, - "config": { - "preferred-install": "dist" - } -} diff --git a/vendor/graham-campbell/result-type/src/Error.php b/vendor/graham-campbell/result-type/src/Error.php deleted file mode 100644 index add9b2d7..00000000 --- a/vendor/graham-campbell/result-type/src/Error.php +++ /dev/null @@ -1,120 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace GrahamCampbell\ResultType; - -use PhpOption\None; -use PhpOption\Some; - -/** - * @template T - * @template E - * @extends \GrahamCampbell\ResultType\Result - */ -final class Error extends Result -{ - /** - * @var E - */ - private $value; - - /** - * Internal constructor for an error value. - * - * @param E $value - * - * @return void - */ - private function __construct($value) - { - $this->value = $value; - } - - /** - * Create a new error value. - * - * @template F - * - * @param F $value - * - * @return \GrahamCampbell\ResultType\Result - */ - public static function create($value) - { - return new self($value); - } - - /** - * Get the success option value. - * - * @return \PhpOption\Option - */ - public function success() - { - return None::create(); - } - - /** - * Map over the success value. - * - * @template S - * - * @param callable(T):S $f - * - * @return \GrahamCampbell\ResultType\Result - */ - public function map(callable $f) - { - return self::create($this->value); - } - - /** - * Flat map over the success value. - * - * @template S - * @template F - * - * @param callable(T):\GrahamCampbell\ResultType\Result $f - * - * @return \GrahamCampbell\ResultType\Result - */ - public function flatMap(callable $f) - { - /** @var \GrahamCampbell\ResultType\Result */ - return self::create($this->value); - } - - /** - * Get the error option value. - * - * @return \PhpOption\Option - */ - public function error() - { - return Some::create($this->value); - } - - /** - * Map over the error value. - * - * @template F - * - * @param callable(E):F $f - * - * @return \GrahamCampbell\ResultType\Result - */ - public function mapError(callable $f) - { - return self::create($f($this->value)); - } -} diff --git a/vendor/graham-campbell/result-type/src/Result.php b/vendor/graham-campbell/result-type/src/Result.php deleted file mode 100644 index 8c67bcdd..00000000 --- a/vendor/graham-campbell/result-type/src/Result.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 GrahamCampbell\ResultType; - -/** - * @template T - * @template E - */ -abstract class Result -{ - /** - * Get the success option value. - * - * @return \PhpOption\Option - */ - abstract public function success(); - - /** - * Map over the success value. - * - * @template S - * - * @param callable(T):S $f - * - * @return \GrahamCampbell\ResultType\Result - */ - abstract public function map(callable $f); - - /** - * Flat map over the success value. - * - * @template S - * @template F - * - * @param callable(T):\GrahamCampbell\ResultType\Result $f - * - * @return \GrahamCampbell\ResultType\Result - */ - abstract public function flatMap(callable $f); - - /** - * Get the error option value. - * - * @return \PhpOption\Option - */ - abstract public function error(); - - /** - * Map over the error value. - * - * @template F - * - * @param callable(E):F $f - * - * @return \GrahamCampbell\ResultType\Result - */ - abstract public function mapError(callable $f); -} diff --git a/vendor/graham-campbell/result-type/src/Success.php b/vendor/graham-campbell/result-type/src/Success.php deleted file mode 100644 index b68ad57e..00000000 --- a/vendor/graham-campbell/result-type/src/Success.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 GrahamCampbell\ResultType; - -use PhpOption\None; -use PhpOption\Some; - -/** - * @template T - * @template E - * @extends \GrahamCampbell\ResultType\Result - */ -final class Success extends Result -{ - /** - * @var T - */ - private $value; - - /** - * Internal constructor for a success value. - * - * @param T $value - * - * @return void - */ - private function __construct($value) - { - $this->value = $value; - } - - /** - * Create a new error value. - * - * @template S - * - * @param S $value - * - * @return \GrahamCampbell\ResultType\Result - */ - public static function create($value) - { - return new self($value); - } - - /** - * Get the success option value. - * - * @return \PhpOption\Option - */ - public function success() - { - return Some::create($this->value); - } - - /** - * Map over the success value. - * - * @template S - * - * @param callable(T):S $f - * - * @return \GrahamCampbell\ResultType\Result - */ - public function map(callable $f) - { - return self::create($f($this->value)); - } - - /** - * Flat map over the success value. - * - * @template S - * @template F - * - * @param callable(T):\GrahamCampbell\ResultType\Result $f - * - * @return \GrahamCampbell\ResultType\Result - */ - public function flatMap(callable $f) - { - return $f($this->value); - } - - /** - * Get the error option value. - * - * @return \PhpOption\Option - */ - public function error() - { - return None::create(); - } - - /** - * Map over the error value. - * - * @template F - * - * @param callable(E):F $f - * - * @return \GrahamCampbell\ResultType\Result - */ - public function mapError(callable $f) - { - return self::create($this->value); - } -} diff --git a/vendor/guzzlehttp/psr7/CHANGELOG.md b/vendor/guzzlehttp/psr7/CHANGELOG.md deleted file mode 100644 index 3fcf18a5..00000000 --- a/vendor/guzzlehttp/psr7/CHANGELOG.md +++ /dev/null @@ -1,396 +0,0 @@ -# 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 - -## 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 - -## 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 - -## 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 - -## 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` - -## 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 - -- Issue parsing IPv6 URLs -- Issue modifying ServerRequest lost all its attributes - -## 1.8.0 - 2021-03-21 - -### Added - -- Locale independent URL parsing -- Most classes got a `@final` annotation to prepare for 2.0 - -### Fixed - -- Issue when creating stream from `php://input` and curl-ext is not installed -- Broken `Utils::tryFopen()` on PHP 8 - -## 1.7.0 - 2020-09-30 - -### Added - -- Replaced functions by static methods - -### Fixed - -- Converting a non-seekable stream to a string -- Handle multiple Set-Cookie correctly -- Ignore array keys in header values when merging -- Allow multibyte characters to be parsed in `Message:bodySummary()` - -### Changed - -- Restored partial HHVM 3 support - - -## [1.6.1] - 2019-07-02 - -### Fixed - -- Accept null and bool header values again - - -## [1.6.0] - 2019-06-30 - -### Added - -- Allowed version `^3.0` of `ralouphie/getallheaders` dependency (#244) -- Added MIME type for WEBP image format (#246) -- Added more validation of values according to PSR-7 and RFC standards, e.g. status code range (#250, #272) - -### Changed - -- Tests don't pass with HHVM 4.0, so HHVM support got dropped. Other libraries like composer have done the same. (#262) -- Accept port number 0 to be valid (#270) - -### Fixed - -- Fixed subsequent reads from `php://input` in ServerRequest (#247) -- Fixed readable/writable detection for certain stream modes (#248) -- Fixed encoding of special characters in the `userInfo` component of an URI (#253) - - -## [1.5.2] - 2018-12-04 - -### Fixed - -- Check body size when getting the message summary - - -## [1.5.1] - 2018-12-04 - -### Fixed - -- Get the summary of a body only if it is readable - - -## [1.5.0] - 2018-12-03 - -### Added - -- Response first-line to response string exception (fixes #145) -- A test for #129 behavior -- `get_message_body_summary` function in order to get the message summary -- `3gp` and `mkv` mime types - -### Changed - -- Clarify exception message when stream is detached - -### Deprecated - -- Deprecated parsing folded header lines as per RFC 7230 - -### Fixed - -- Fix `AppendStream::detach` to not close streams -- `InflateStream` preserves `isSeekable` attribute of the underlying stream -- `ServerRequest::getUriFromGlobals` to support URLs in query parameters - - -Several other fixes and improvements. - - -## [1.4.2] - 2017-03-20 - -### Fixed - -- Reverted BC break to `Uri::resolve` and `Uri::removeDotSegments` by removing - calls to `trigger_error` when deprecated methods are invoked. - - -## [1.4.1] - 2017-02-27 - -### Added - -- Rriggering of silenced deprecation warnings. - -### Fixed - -- Reverted BC break by reintroducing behavior to automagically fix a URI with a - relative path and an authority by adding a leading slash to the path. It's only - deprecated now. - - -## [1.4.0] - 2017-02-21 - -### Added - -- Added common URI utility methods based on RFC 3986 (see documentation in the readme): - - `Uri::isDefaultPort` - - `Uri::isAbsolute` - - `Uri::isNetworkPathReference` - - `Uri::isAbsolutePathReference` - - `Uri::isRelativePathReference` - - `Uri::isSameDocumentReference` - - `Uri::composeComponents` - - `UriNormalizer::normalize` - - `UriNormalizer::isEquivalent` - - `UriResolver::relativize` - -### Changed - -- Ensure `ServerRequest::getUriFromGlobals` returns a URI in absolute form. -- Allow `parse_response` to parse a response without delimiting space and reason. -- Ensure each URI modification results in a valid URI according to PSR-7 discussions. - Invalid modifications will throw an exception instead of returning a wrong URI or - doing some magic. - - `(new Uri)->withPath('foo')->withHost('example.com')` will throw an exception - because the path of a URI with an authority must start with a slash "/" or be empty - - `(new Uri())->withScheme('http')` will return `'http://localhost'` - -### Deprecated - -- `Uri::resolve` in favor of `UriResolver::resolve` -- `Uri::removeDotSegments` in favor of `UriResolver::removeDotSegments` - -### Fixed - -- `Stream::read` when length parameter <= 0. -- `copy_to_stream` reads bytes in chunks instead of `maxLen` into memory. -- `ServerRequest::getUriFromGlobals` when `Host` header contains port. -- Compatibility of URIs with `file` scheme and empty host. - - -## [1.3.1] - 2016-06-25 - -### Fixed - -- `Uri::__toString` for network path references, e.g. `//example.org`. -- Missing lowercase normalization for host. -- Handling of URI components in case they are `'0'` in a lot of places, - e.g. as a user info password. -- `Uri::withAddedHeader` to correctly merge headers with different case. -- Trimming of header values in `Uri::withAddedHeader`. Header values may - be surrounded by whitespace which should be ignored according to RFC 7230 - Section 3.2.4. This does not apply to header names. -- `Uri::withAddedHeader` with an array of header values. -- `Uri::resolve` when base path has no slash and handling of fragment. -- Handling of encoding in `Uri::with(out)QueryValue` so one can pass the - key/value both in encoded as well as decoded form to those methods. This is - consistent with withPath, withQuery etc. -- `ServerRequest::withoutAttribute` when attribute value is null. - - -## [1.3.0] - 2016-04-13 - -### Added - -- Remaining interfaces needed for full PSR7 compatibility - (ServerRequestInterface, UploadedFileInterface, etc.). -- Support for stream_for from scalars. - -### Changed - -- Can now extend Uri. - -### Fixed -- A bug in validating request methods by making it more permissive. - - -## [1.2.3] - 2016-02-18 - -### Fixed - -- Support in `GuzzleHttp\Psr7\CachingStream` for seeking forward on remote - streams, which can sometimes return fewer bytes than requested with `fread`. -- Handling of gzipped responses with FNAME headers. - - -## [1.2.2] - 2016-01-22 - -### Added - -- Support for URIs without any authority. -- Support for HTTP 451 'Unavailable For Legal Reasons.' -- Support for using '0' as a filename. -- Support for including non-standard ports in Host headers. - - -## [1.2.1] - 2015-11-02 - -### Changes - -- Now supporting negative offsets when seeking to SEEK_END. - - -## [1.2.0] - 2015-08-15 - -### Changed - -- Body as `"0"` is now properly added to a response. -- Now allowing forward seeking in CachingStream. -- Now properly parsing HTTP requests that contain proxy targets in - `parse_request`. -- functions.php is now conditionally required. -- user-info is no longer dropped when resolving URIs. - - -## [1.1.0] - 2015-06-24 - -### Changed - -- URIs can now be relative. -- `multipart/form-data` headers are now overridden case-insensitively. -- URI paths no longer encode the following characters because they are allowed - in URIs: "(", ")", "*", "!", "'" -- A port is no longer added to a URI when the scheme is missing and no port is - present. - - -## 1.0.0 - 2015-05-19 - -Initial release. - -Currently unsupported: - -- `Psr\Http\Message\ServerRequestInterface` -- `Psr\Http\Message\UploadedFileInterface` - - - -[1.6.0]: https://github.com/guzzle/psr7/compare/1.5.2...1.6.0 -[1.5.2]: https://github.com/guzzle/psr7/compare/1.5.1...1.5.2 -[1.5.1]: https://github.com/guzzle/psr7/compare/1.5.0...1.5.1 -[1.5.0]: https://github.com/guzzle/psr7/compare/1.4.2...1.5.0 -[1.4.2]: https://github.com/guzzle/psr7/compare/1.4.1...1.4.2 -[1.4.1]: https://github.com/guzzle/psr7/compare/1.4.0...1.4.1 -[1.4.0]: https://github.com/guzzle/psr7/compare/1.3.1...1.4.0 -[1.3.1]: https://github.com/guzzle/psr7/compare/1.3.0...1.3.1 -[1.3.0]: https://github.com/guzzle/psr7/compare/1.2.3...1.3.0 -[1.2.3]: https://github.com/guzzle/psr7/compare/1.2.2...1.2.3 -[1.2.2]: https://github.com/guzzle/psr7/compare/1.2.1...1.2.2 -[1.2.1]: https://github.com/guzzle/psr7/compare/1.2.0...1.2.1 -[1.2.0]: https://github.com/guzzle/psr7/compare/1.1.0...1.2.0 -[1.1.0]: https://github.com/guzzle/psr7/compare/1.0.0...1.1.0 diff --git a/vendor/guzzlehttp/psr7/LICENSE b/vendor/guzzlehttp/psr7/LICENSE deleted file mode 100644 index 51c7ec81..00000000 --- a/vendor/guzzlehttp/psr7/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Michael Dowling -Copyright (c) 2015 Márk Sági-Kazár -Copyright (c) 2015 Graham Campbell -Copyright (c) 2016 Tobias Schultze -Copyright (c) 2016 George Mponos -Copyright (c) 2018 Tobias Nyholm - -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/guzzlehttp/psr7/README.md b/vendor/guzzlehttp/psr7/README.md deleted file mode 100644 index 8b9929a1..00000000 --- a/vendor/guzzlehttp/psr7/README.md +++ /dev/null @@ -1,872 +0,0 @@ -# PSR-7 Message Implementation - -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. - -![CI](https://github.com/guzzle/psr7/workflows/CI/badge.svg) -![Static analysis](https://github.com/guzzle/psr7/workflows/Static%20analysis/badge.svg) - - -# Stream implementation - -This package comes with a number of stream implementations and stream -decorators. - - -## AppendStream - -`GuzzleHttp\Psr7\AppendStream` - -Reads from multiple streams, one after the other. - -```php -use GuzzleHttp\Psr7; - -$a = Psr7\Utils::streamFor('abc, '); -$b = Psr7\Utils::streamFor('123.'); -$composed = new Psr7\AppendStream([$a, $b]); - -$composed->addStream(Psr7\Utils::streamFor(' Above all listen to me')); - -echo $composed; // abc, 123. Above all listen to me. -``` - - -## BufferStream - -`GuzzleHttp\Psr7\BufferStream` - -Provides a buffer stream that can be written to fill a buffer, and read -from to remove bytes from the buffer. - -This stream returns a "hwm" metadata value that tells upstream consumers -what the configured high water mark of the stream is, or the maximum -preferred size of the buffer. - -```php -use GuzzleHttp\Psr7; - -// When more than 1024 bytes are in the buffer, it will begin returning -// false to writes. This is an indication that writers should slow down. -$buffer = new Psr7\BufferStream(1024); -``` - - -## CachingStream - -The CachingStream is used to allow seeking over previously read bytes on -non-seekable streams. This can be useful when transferring a non-seekable -entity body fails due to needing to rewind the stream (for example, resulting -from a redirect). Data that is read from the remote stream will be buffered in -a PHP temp stream so that previously read bytes are cached first in memory, -then on disk. - -```php -use GuzzleHttp\Psr7; - -$original = Psr7\Utils::streamFor(fopen('http://www.google.com', 'r')); -$stream = new Psr7\CachingStream($original); - -$stream->read(1024); -echo $stream->tell(); -// 1024 - -$stream->seek(0); -echo $stream->tell(); -// 0 -``` - - -## DroppingStream - -`GuzzleHttp\Psr7\DroppingStream` - -Stream decorator that begins dropping data once the size of the underlying -stream becomes too full. - -```php -use GuzzleHttp\Psr7; - -// Create an empty stream -$stream = Psr7\Utils::streamFor(); - -// Start dropping data when the stream has more than 10 bytes -$dropping = new Psr7\DroppingStream($stream, 10); - -$dropping->write('01234567890123456789'); -echo $stream; // 0123456789 -``` - - -## FnStream - -`GuzzleHttp\Psr7\FnStream` - -Compose stream implementations based on a hash of functions. - -Allows for easy testing and extension of a provided stream without needing -to create a concrete class for a simple extension point. - -```php - -use GuzzleHttp\Psr7; - -$stream = Psr7\Utils::streamFor('hi'); -$fnStream = Psr7\FnStream::decorate($stream, [ - 'rewind' => function () use ($stream) { - echo 'About to rewind - '; - $stream->rewind(); - echo 'rewound!'; - } -]); - -$fnStream->rewind(); -// Outputs: About to rewind - rewound! -``` - - -## InflateStream - -`GuzzleHttp\Psr7\InflateStream` - -Uses PHP's zlib.inflate filter to inflate zlib (HTTP deflate, RFC1950) or gzipped (RFC1952) content. - -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. - - -## LazyOpenStream - -`GuzzleHttp\Psr7\LazyOpenStream` - -Lazily reads or writes to a file that is opened only after an IO operation -take place on the stream. - -```php -use GuzzleHttp\Psr7; - -$stream = new Psr7\LazyOpenStream('/path/to/file', 'r'); -// The file has not yet been opened... - -echo $stream->read(10); -// The file is opened and read from only when needed. -``` - - -## LimitStream - -`GuzzleHttp\Psr7\LimitStream` - -LimitStream can be used to read a subset or slice of an existing stream object. -This can be useful for breaking a large file into smaller pieces to be sent in -chunks (e.g. Amazon S3's multipart upload API). - -```php -use GuzzleHttp\Psr7; - -$original = Psr7\Utils::streamFor(fopen('/tmp/test.txt', 'r+')); -echo $original->getSize(); -// >>> 1048576 - -// Limit the size of the body to 1024 bytes and start reading from byte 2048 -$stream = new Psr7\LimitStream($original, 1024, 2048); -echo $stream->getSize(); -// >>> 1024 -echo $stream->tell(); -// >>> 0 -``` - - -## MultipartStream - -`GuzzleHttp\Psr7\MultipartStream` - -Stream that when read returns bytes for a streaming multipart or -multipart/form-data stream. - - -## NoSeekStream - -`GuzzleHttp\Psr7\NoSeekStream` - -NoSeekStream wraps a stream and does not allow seeking. - -```php -use GuzzleHttp\Psr7; - -$original = Psr7\Utils::streamFor('foo'); -$noSeek = new Psr7\NoSeekStream($original); - -echo $noSeek->read(3); -// foo -var_export($noSeek->isSeekable()); -// false -$noSeek->seek(0); -var_export($noSeek->read(3)); -// NULL -``` - - -## PumpStream - -`GuzzleHttp\Psr7\PumpStream` - -Provides a read only stream that pumps data from a PHP callable. - -When invoking the provided callable, the PumpStream will pass the amount of -data requested to read to the callable. The callable can choose to ignore -this value and return fewer or more bytes than requested. Any extra data -returned by the provided callable is buffered internally until drained using -the read() function of the PumpStream. The provided callable MUST return -false when there is no more data to read. - - -## Implementing stream decorators - -Creating a stream decorator is very easy thanks to the -`GuzzleHttp\Psr7\StreamDecoratorTrait`. This trait provides methods that -implement `Psr\Http\Message\StreamInterface` by proxying to an underlying -stream. Just `use` the `StreamDecoratorTrait` and implement your custom -methods. - -For example, let's say we wanted to call a specific function each time the last -byte is read from a stream. This could be implemented by overriding the -`read()` method. - -```php -use Psr\Http\Message\StreamInterface; -use GuzzleHttp\Psr7\StreamDecoratorTrait; - -class EofCallbackStream implements StreamInterface -{ - use StreamDecoratorTrait; - - private $callback; - - public function __construct(StreamInterface $stream, callable $cb) - { - $this->stream = $stream; - $this->callback = $cb; - } - - public function read($length) - { - $result = $this->stream->read($length); - - // Invoke the callback when EOF is hit. - if ($this->eof()) { - call_user_func($this->callback); - } - - return $result; - } -} -``` - -This decorator could be added to any existing stream and used like so: - -```php -use GuzzleHttp\Psr7; - -$original = Psr7\Utils::streamFor('foo'); - -$eofStream = new EofCallbackStream($original, function () { - echo 'EOF!'; -}); - -$eofStream->read(2); -$eofStream->read(1); -// echoes "EOF!" -$eofStream->seek(0); -$eofStream->read(3); -// echoes "EOF!" -``` - - -## PHP StreamWrapper - -You can use the `GuzzleHttp\Psr7\StreamWrapper` class if you need to use a -PSR-7 stream as a PHP stream resource. - -Use the `GuzzleHttp\Psr7\StreamWrapper::getResource()` method to create a PHP -stream from a PSR-7 stream. - -```php -use GuzzleHttp\Psr7\StreamWrapper; - -$stream = GuzzleHttp\Psr7\Utils::streamFor('hello!'); -$resource = StreamWrapper::getResource($stream); -echo fread($resource, 6); // outputs hello! -``` - - -# Static API - -There are various static methods available under the `GuzzleHttp\Psr7` namespace. - - -## `GuzzleHttp\Psr7\Message::toString` - -`public static function toString(MessageInterface $message): string` - -Returns the string representation of an HTTP message. - -```php -$request = new GuzzleHttp\Psr7\Request('GET', 'http://example.com'); -echo GuzzleHttp\Psr7\Message::toString($request); -``` - - -## `GuzzleHttp\Psr7\Message::bodySummary` - -`public static function bodySummary(MessageInterface $message, int $truncateAt = 120): string|null` - -Get a short summary of the message body. - -Will return `null` if the response is not printable. - - -## `GuzzleHttp\Psr7\Message::rewindBody` - -`public static function rewindBody(MessageInterface $message): void` - -Attempts to rewind a message body and throws an exception on failure. - -The body of the message will only be rewound if a call to `tell()` -returns a value other than `0`. - - -## `GuzzleHttp\Psr7\Message::parseMessage` - -`public static function parseMessage(string $message): array` - -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. - - -## `GuzzleHttp\Psr7\Message::parseRequestUri` - -`public static function parseRequestUri(string $path, array $headers): string` - -Constructs a URI for an HTTP request message. - - -## `GuzzleHttp\Psr7\Message::parseRequest` - -`public static function parseRequest(string $message): Request` - -Parses a request message string into a request object. - - -## `GuzzleHttp\Psr7\Message::parseResponse` - -`public static function parseResponse(string $message): Response` - -Parses a response message string into a response object. - - -## `GuzzleHttp\Psr7\Header::parse` - -`public static function parse(string|array $header): array` - -Parse an array of header values containing ";" separated data into an -array of associative arrays representing the header key value pair data -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::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. - - -## `GuzzleHttp\Psr7\Query::parse` - -`public static function parse(string $str, int|bool $urlEncoding = true): array` - -Parse a query string into an associative array. - -If multiple values are found for the same key, the value of that key -value pair will become an array. This function does not parse nested -PHP style arrays into an associative array (e.g., `foo[a]=1&foo[b]=2` -will be parsed into `['foo[a]' => '1', 'foo[b]' => '2'])`. - - -## `GuzzleHttp\Psr7\Query::build` - -`public static function build(array $params, int|false $encoding = PHP_QUERY_RFC3986): string` - -Build a query string from an array of key value pairs. - -This function can use the return value of `parse()` to build a query -string. This function does not modify the provided keys when an array is -encountered (like `http_build_query()` would). - - -## `GuzzleHttp\Psr7\Utils::caselessRemove` - -`public static function caselessRemove(iterable $keys, $keys, array $data): array` - -Remove the items given by the keys, case insensitively from the data. - - -## `GuzzleHttp\Psr7\Utils::copyToStream` - -`public static function copyToStream(StreamInterface $source, StreamInterface $dest, int $maxLen = -1): void` - -Copy the contents of a stream into another stream until the given number -of bytes have been read. - - -## `GuzzleHttp\Psr7\Utils::copyToString` - -`public static function copyToString(StreamInterface $stream, int $maxLen = -1): string` - -Copy the contents of a stream into a string until the given number of -bytes have been read. - - -## `GuzzleHttp\Psr7\Utils::hash` - -`public static function hash(StreamInterface $stream, string $algo, bool $rawOutput = false): string` - -Calculate a hash of a stream. - -This method reads the entire stream to calculate a rolling hash, based on -PHP's `hash_init` functions. - - -## `GuzzleHttp\Psr7\Utils::modifyRequest` - -`public static function modifyRequest(RequestInterface $request, array $changes): RequestInterface` - -Clone and modify a request with the given changes. - -This method is useful for reducing the number of clones needed to mutate -a message. - -- method: (string) Changes the HTTP method. -- set_headers: (array) Sets the given headers. -- remove_headers: (array) Remove the given headers. -- body: (mixed) Sets the given body. -- uri: (UriInterface) Set the URI. -- query: (string) Set the query string value of the URI. -- version: (string) Set the protocol version. - - -## `GuzzleHttp\Psr7\Utils::readLine` - -`public static function readLine(StreamInterface $stream, int $maxLength = null): string` - -Read a line from the stream up to the maximum allowed buffer length. - - -## `GuzzleHttp\Psr7\Utils::streamFor` - -`public static function streamFor(resource|string|null|int|float|bool|StreamInterface|callable|\Iterator $resource = '', array $options = []): StreamInterface` - -Create a new stream based on the input type. - -Options is an associative array that can contain the following keys: - -- metadata: Array of custom metadata. -- size: Size of the stream. - -This method accepts the following `$resource` types: - -- `Psr\Http\Message\StreamInterface`: Returns the value as-is. -- `string`: Creates a stream object that uses the given string as the contents. -- `resource`: Creates a stream object that wraps the given PHP stream resource. -- `Iterator`: If the provided value implements `Iterator`, then a read-only - stream object will be created that wraps the given iterable. Each time the - stream is read from, data from the iterator will fill a buffer and will be - continuously called until the buffer is equal to the requested read size. - Subsequent read calls will first read from the buffer and then call `next` - on the underlying iterator until it is exhausted. -- `object` with `__toString()`: If the object has the `__toString()` method, - the object will be cast to a string and then a stream will be returned that - uses the string value. -- `NULL`: When `null` is passed, an empty stream object is returned. -- `callable` When a callable is passed, a read-only stream object will be - created that invokes the given callable. The callable is invoked with the - number of suggested bytes to read. The callable can return any number of - bytes, but MUST return `false` when there is no more data to return. The - stream object that wraps the callable will invoke the callable until the - number of requested bytes are available. Any additional bytes will be - buffered and used in subsequent reads. - -```php -$stream = GuzzleHttp\Psr7\Utils::streamFor('foo'); -$stream = GuzzleHttp\Psr7\Utils::streamFor(fopen('/path/to/file', 'r')); - -$generator = function ($bytes) { - for ($i = 0; $i < $bytes; $i++) { - yield ' '; - } -} - -$stream = GuzzleHttp\Psr7\Utils::streamFor($generator(100)); -``` - - -## `GuzzleHttp\Psr7\Utils::tryFopen` - -`public static function tryFopen(string $filename, string $mode): resource` - -Safely opens a PHP stream resource using a filename. - -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` - -Returns a UriInterface for the given value. - -This function accepts a string or UriInterface and returns a -UriInterface for the given value. If the value is already a -UriInterface, it is returned as-is. - - -## `GuzzleHttp\Psr7\MimeType::fromFilename` - -`public static function fromFilename(string $filename): string|null` - -Determines the mimetype of a file by looking at its extension. - - -## `GuzzleHttp\Psr7\MimeType::fromExtension` - -`public static function fromExtension(string $extension): string|null` - -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 was removed in 2.0.0. A migration table has been provided here for your convenience: - -| Original Function | Replacement Method | -|----------------|----------------| -| `str` | `Message::toString` | -| `uri_for` | `Utils::uriFor` | -| `stream_for` | `Utils::streamFor` | -| `parse_header` | `Header::parse` | -| `normalize_header` | `Header::normalize` | -| `modify_request` | `Utils::modifyRequest` | -| `rewind_body` | `Message::rewindBody` | -| `try_fopen` | `Utils::tryFopen` | -| `copy_to_string` | `Utils::copyToString` | -| `copy_to_stream` | `Utils::copyToStream` | -| `hash` | `Utils::hash` | -| `readline` | `Utils::readLine` | -| `parse_request` | `Message::parseRequest` | -| `parse_response` | `Message::parseResponse` | -| `parse_query` | `Query::parse` | -| `build_query` | `Query::build` | -| `mimetype_from_filename` | `MimeType::fromFilename` | -| `mimetype_from_extension` | `MimeType::fromExtension` | -| `_parse_message` | `Message::parseMessage` | -| `_parse_request_uri` | `Message::parseRequestUri` | -| `get_message_body_summary` | `Message::bodySummary` | -| `_caseless_remove` | `Utils::caselessRemove` | - - -# Additional URI Methods - -Aside from the standard `Psr\Http\Message\UriInterface` implementation in form of the `GuzzleHttp\Psr7\Uri` class, -this library also provides additional functionality when working with URIs as static methods. - -## URI Types - -An instance of `Psr\Http\Message\UriInterface` can either be an absolute URI or a relative reference. -An absolute URI has a scheme. A relative reference is used to express a URI relative to another URI, -the base URI. Relative references can be divided into several forms according to -[RFC 3986 Section 4.2](https://tools.ietf.org/html/rfc3986#section-4.2): - -- network-path references, e.g. `//example.com/path` -- absolute-path references, e.g. `/path` -- relative-path references, e.g. `subpath` - -The following methods can be used to identify the type of the URI. - -### `GuzzleHttp\Psr7\Uri::isAbsolute` - -`public static function isAbsolute(UriInterface $uri): bool` - -Whether the URI is absolute, i.e. it has a scheme. - -### `GuzzleHttp\Psr7\Uri::isNetworkPathReference` - -`public static function isNetworkPathReference(UriInterface $uri): bool` - -Whether the URI is a network-path reference. A relative reference that begins with two slash characters is -termed an network-path reference. - -### `GuzzleHttp\Psr7\Uri::isAbsolutePathReference` - -`public static function isAbsolutePathReference(UriInterface $uri): bool` - -Whether the URI is a absolute-path reference. A relative reference that begins with a single slash character is -termed an absolute-path reference. - -### `GuzzleHttp\Psr7\Uri::isRelativePathReference` - -`public static function isRelativePathReference(UriInterface $uri): bool` - -Whether the URI is a relative-path reference. A relative reference that does not begin with a slash character is -termed a relative-path reference. - -### `GuzzleHttp\Psr7\Uri::isSameDocumentReference` - -`public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null): bool` - -Whether the URI is a same-document reference. A same-document reference refers to a URI that is, aside from its -fragment component, identical to the base URI. When no base URI is given, only an empty URI reference -(apart from its fragment) is considered a same-document reference. - -## URI Components - -Additional methods to work with URI components. - -### `GuzzleHttp\Psr7\Uri::isDefaultPort` - -`public static function isDefaultPort(UriInterface $uri): bool` - -Whether the URI has the default port of the current scheme. `Psr\Http\Message\UriInterface::getPort` may return null -or the standard port. This method can be used independently of the implementation. - -### `GuzzleHttp\Psr7\Uri::composeComponents` - -`public static function composeComponents($scheme, $authority, $path, $query, $fragment): string` - -Composes a URI reference string from its various components according to -[RFC 3986 Section 5.3](https://tools.ietf.org/html/rfc3986#section-5.3). Usually this method does not need to be called -manually but instead is used indirectly via `Psr\Http\Message\UriInterface::__toString`. - -### `GuzzleHttp\Psr7\Uri::fromParts` - -`public static function fromParts(array $parts): UriInterface` - -Creates a URI from a hash of [`parse_url`](https://www.php.net/manual/en/function.parse-url.php) components. - - -### `GuzzleHttp\Psr7\Uri::withQueryValue` - -`public static function withQueryValue(UriInterface $uri, $key, $value): UriInterface` - -Creates a new URI with a specific query string value. Any existing query string values that exactly match the -provided key are removed and replaced with the given key value pair. A value of null will set the query string -key without a value, e.g. "key" instead of "key=value". - -### `GuzzleHttp\Psr7\Uri::withQueryValues` - -`public static function withQueryValues(UriInterface $uri, array $keyValueArray): UriInterface` - -Creates a new URI with multiple query string values. It has the same behavior as `withQueryValue()` but for an -associative array of key => value. - -### `GuzzleHttp\Psr7\Uri::withoutQueryValue` - -`public static function withoutQueryValue(UriInterface $uri, $key): UriInterface` - -Creates a new URI with a specific query string value removed. Any existing query string values that exactly match the -provided key are removed. - -## Cross-Origin Detection - -`GuzzleHttp\Psr7\UriComparator` provides methods to determine if a modified URL should be considered cross-origin. - -### `GuzzleHttp\Psr7\UriComparator::isCrossOrigin` - -`public static function isCrossOrigin(UriInterface $original, UriInterface $modified): bool` - -Determines if a modified URL should be considered cross-origin with respect to an original URL. - -## Reference Resolution - -`GuzzleHttp\Psr7\UriResolver` provides methods to resolve a URI reference in the context of a base URI according -to [RFC 3986 Section 5](https://tools.ietf.org/html/rfc3986#section-5). This is for example also what web browsers -do when resolving a link in a website based on the current request URI. - -### `GuzzleHttp\Psr7\UriResolver::resolve` - -`public static function resolve(UriInterface $base, UriInterface $rel): UriInterface` - -Converts the relative URI into a new URI that is resolved against the base URI. - -### `GuzzleHttp\Psr7\UriResolver::removeDotSegments` - -`public static function removeDotSegments(string $path): string` - -Removes dot segments from a path and returns the new path according to -[RFC 3986 Section 5.2.4](https://tools.ietf.org/html/rfc3986#section-5.2.4). - -### `GuzzleHttp\Psr7\UriResolver::relativize` - -`public static function relativize(UriInterface $base, UriInterface $target): UriInterface` - -Returns the target URI as a relative reference from the base URI. This method is the counterpart to resolve(): - -```php -(string) $target === (string) UriResolver::resolve($base, UriResolver::relativize($base, $target)) -``` - -One use-case is to use the current request URI as base URI and then generate relative links in your documents -to reduce the document size or offer self-contained downloadable document archives. - -```php -$base = new Uri('http://example.com/a/b/'); -echo UriResolver::relativize($base, new Uri('http://example.com/a/b/c')); // prints 'c'. -echo UriResolver::relativize($base, new Uri('http://example.com/a/x/y')); // prints '../x/y'. -echo UriResolver::relativize($base, new Uri('http://example.com/a/b/?q')); // prints '?q'. -echo UriResolver::relativize($base, new Uri('http://example.org/a/b/')); // prints '//example.org/a/b/'. -``` - -## Normalization and Comparison - -`GuzzleHttp\Psr7\UriNormalizer` provides methods to normalize and compare URIs according to -[RFC 3986 Section 6](https://tools.ietf.org/html/rfc3986#section-6). - -### `GuzzleHttp\Psr7\UriNormalizer::normalize` - -`public static function normalize(UriInterface $uri, $flags = self::PRESERVING_NORMALIZATIONS): UriInterface` - -Returns a normalized URI. The scheme and host component are already normalized to lowercase per PSR-7 UriInterface. -This methods adds additional normalizations that can be configured with the `$flags` parameter which is a bitmask -of normalizations to apply. The following normalizations are available: - -- `UriNormalizer::PRESERVING_NORMALIZATIONS` - - Default normalizations which only include the ones that preserve semantics. - -- `UriNormalizer::CAPITALIZE_PERCENT_ENCODING` - - All letters within a percent-encoding triplet (e.g., "%3A") are case-insensitive, and should be capitalized. - - Example: `http://example.org/a%c2%b1b` → `http://example.org/a%C2%B1b` - -- `UriNormalizer::DECODE_UNRESERVED_CHARACTERS` - - Decodes percent-encoded octets of unreserved characters. For consistency, percent-encoded octets in the ranges of - ALPHA (%41–%5A and %61–%7A), DIGIT (%30–%39), hyphen (%2D), period (%2E), underscore (%5F), or tilde (%7E) should - not be created by URI producers and, when found in a URI, should be decoded to their corresponding unreserved - characters by URI normalizers. - - Example: `http://example.org/%7Eusern%61me/` → `http://example.org/~username/` - -- `UriNormalizer::CONVERT_EMPTY_PATH` - - Converts the empty path to "/" for http and https URIs. - - Example: `http://example.org` → `http://example.org/` - -- `UriNormalizer::REMOVE_DEFAULT_HOST` - - Removes the default host of the given URI scheme from the URI. Only the "file" scheme defines the default host - "localhost". All of `file:/myfile`, `file:///myfile`, and `file://localhost/myfile` are equivalent according to - RFC 3986. - - Example: `file://localhost/myfile` → `file:///myfile` - -- `UriNormalizer::REMOVE_DEFAULT_PORT` - - Removes the default port of the given URI scheme from the URI. - - Example: `http://example.org:80/` → `http://example.org/` - -- `UriNormalizer::REMOVE_DOT_SEGMENTS` - - Removes unnecessary dot-segments. Dot-segments in relative-path references are not removed as it would - change the semantics of the URI reference. - - Example: `http://example.org/../a/b/../c/./d.html` → `http://example.org/a/c/d.html` - -- `UriNormalizer::REMOVE_DUPLICATE_SLASHES` - - Paths which include two or more adjacent slashes are converted to one. Webservers usually ignore duplicate slashes - and treat those URIs equivalent. But in theory those URIs do not need to be equivalent. So this normalization - may change the semantics. Encoded slashes (%2F) are not removed. - - Example: `http://example.org//foo///bar.html` → `http://example.org/foo/bar.html` - -- `UriNormalizer::SORT_QUERY_PARAMETERS` - - Sort query parameters with their values in alphabetical order. However, the order of parameters in a URI may be - significant (this is not defined by the standard). So this normalization is not safe and may change the semantics - of the URI. - - Example: `?lang=en&article=fred` → `?article=fred&lang=en` - -### `GuzzleHttp\Psr7\UriNormalizer::isEquivalent` - -`public static function isEquivalent(UriInterface $uri1, UriInterface $uri2, $normalizations = self::PRESERVING_NORMALIZATIONS): bool` - -Whether two URIs can be considered equivalent. Both URIs are normalized automatically before comparison with the given -`$normalizations` bitmask. The method also accepts relative URI references and returns true when they are equivalent. -This of course assumes they will be resolved against the same base URI. If this is not the case, determination of -equivalence or difference of relative references does not mean anything. - - -## Version Guidance - -| Version | Status | PHP Version | -|---------|----------------|------------------| -| 1.x | Security fixes | >=5.4,<8.1 | -| 2.x | Latest | ^7.2.5 \|\| ^8.0 | - - -## 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/psr7/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-psr7?utm_source=packagist-guzzlehttp-psr7&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/vendor/guzzlehttp/psr7/composer.json b/vendor/guzzlehttp/psr7/composer.json deleted file mode 100644 index cd91040c..00000000 --- a/vendor/guzzlehttp/psr7/composer.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "name": "guzzlehttp/psr7", - "description": "PSR-7 message implementation that also provides common utility methods", - "keywords": [ - "request", - "response", - "message", - "stream", - "http", - "uri", - "url", - "psr-7" - ], - "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": "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://github.com/sagikazarmark" - }, - { - "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": "^7.2.5 || ^8.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.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/" - } - }, - "autoload-dev": { - "psr-4": { - "GuzzleHttp\\Tests\\Psr7\\": "tests/" - } - }, - "extra": { - "bamarni-bin": { - "bin-links": true, - "forward-command": false - }, - "branch-alias": { - "dev-master": "2.4-dev" - } - }, - "config": { - "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 deleted file mode 100644 index cbcfaee6..00000000 --- a/vendor/guzzlehttp/psr7/src/AppendStream.php +++ /dev/null @@ -1,248 +0,0 @@ -addStream($stream); - } - } - - public function __toString(): string - { - try { - $this->rewind(); - return $this->getContents(); - } 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 ''; - } - } - - /** - * Add a stream to the AppendStream - * - * @param StreamInterface $stream Stream to append. Must be readable. - * - * @throws \InvalidArgumentException if the stream is not readable - */ - public function addStream(StreamInterface $stream): void - { - if (!$stream->isReadable()) { - throw new \InvalidArgumentException('Each stream must be readable'); - } - - // The stream is only seekable if all streams are seekable - if (!$stream->isSeekable()) { - $this->seekable = false; - } - - $this->streams[] = $stream; - } - - public function getContents(): string - { - return Utils::copyToString($this); - } - - /** - * Closes each attached stream. - */ - public function close(): void - { - $this->pos = $this->current = 0; - $this->seekable = true; - - foreach ($this->streams as $stream) { - $stream->close(); - } - - $this->streams = []; - } - - /** - * Detaches each attached stream. - * - * Returns null as it's not clear which underlying stream resource to return. - */ - public function detach() - { - $this->pos = $this->current = 0; - $this->seekable = true; - - foreach ($this->streams as $stream) { - $stream->detach(); - } - - $this->streams = []; - - return null; - } - - public function tell(): int - { - return $this->pos; - } - - /** - * Tries to calculate the size by adding the size of each stream. - * - * 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. - */ - public function getSize(): ?int - { - $size = 0; - - foreach ($this->streams as $stream) { - $s = $stream->getSize(); - if ($s === null) { - return null; - } - $size += $s; - } - - return $size; - } - - public function eof(): bool - { - return !$this->streams || - ($this->current >= count($this->streams) - 1 && - $this->streams[$this->current]->eof()); - } - - public function rewind(): void - { - $this->seek(0); - } - - /** - * Attempts to seek to the given position. Only supports SEEK_SET. - */ - public function seek($offset, $whence = SEEK_SET): void - { - if (!$this->seekable) { - throw new \RuntimeException('This AppendStream is not seekable'); - } elseif ($whence !== SEEK_SET) { - throw new \RuntimeException('The AppendStream can only seek with SEEK_SET'); - } - - $this->pos = $this->current = 0; - - // Rewind each stream - foreach ($this->streams as $i => $stream) { - try { - $stream->rewind(); - } catch (\Exception $e) { - throw new \RuntimeException('Unable to seek stream ' - . $i . ' of the AppendStream', 0, $e); - } - } - - // Seek to the actual position by reading from each stream - while ($this->pos < $offset && !$this->eof()) { - $result = $this->read(min(8096, $offset - $this->pos)); - if ($result === '') { - break; - } - } - } - - /** - * Reads from all of the appended streams until the length is met or EOF. - */ - public function read($length): string - { - $buffer = ''; - $total = count($this->streams) - 1; - $remaining = $length; - $progressToNext = false; - - while ($remaining > 0) { - // Progress to the next stream if needed. - if ($progressToNext || $this->streams[$this->current]->eof()) { - $progressToNext = false; - if ($this->current === $total) { - break; - } - $this->current++; - } - - $result = $this->streams[$this->current]->read($remaining); - - if ($result === '') { - $progressToNext = true; - continue; - } - - $buffer .= $result; - $remaining = $length - strlen($buffer); - } - - $this->pos += strlen($buffer); - - return $buffer; - } - - public function isReadable(): bool - { - return true; - } - - public function isWritable(): bool - { - return false; - } - - public function isSeekable(): bool - { - return $this->seekable; - } - - 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 deleted file mode 100644 index 21be8c0a..00000000 --- a/vendor/guzzlehttp/psr7/src/BufferStream.php +++ /dev/null @@ -1,149 +0,0 @@ -hwm = $hwm; - } - - public function __toString(): string - { - return $this->getContents(); - } - - public function getContents(): string - { - $buffer = $this->buffer; - $this->buffer = ''; - - return $buffer; - } - - public function close(): void - { - $this->buffer = ''; - } - - public function detach() - { - $this->close(); - - return null; - } - - public function getSize(): ?int - { - return strlen($this->buffer); - } - - public function isReadable(): bool - { - return true; - } - - public function isWritable(): bool - { - return true; - } - - public function isSeekable(): bool - { - return false; - } - - public function rewind(): void - { - $this->seek(0); - } - - public function seek($offset, $whence = SEEK_SET): void - { - throw new \RuntimeException('Cannot seek a BufferStream'); - } - - public function eof(): bool - { - return strlen($this->buffer) === 0; - } - - public function tell(): int - { - throw new \RuntimeException('Cannot determine the position of a BufferStream'); - } - - /** - * Reads data from the buffer. - */ - public function read($length): string - { - $currentLength = strlen($this->buffer); - - if ($length >= $currentLength) { - // No need to slice the buffer because we don't have enough data. - $result = $this->buffer; - $this->buffer = ''; - } else { - // Slice up the result to provide a subset of the buffer. - $result = substr($this->buffer, 0, $length); - $this->buffer = substr($this->buffer, $length); - } - - return $result; - } - - /** - * Writes data to the buffer. - */ - public function write($string): int - { - $this->buffer .= $string; - - if (strlen($this->buffer) >= $this->hwm) { - return 0; - } - - return strlen($string); - } - - /** - * {@inheritdoc} - * - * @return mixed - */ - public function getMetadata($key = null) - { - if ($key === 'hwm') { - return $this->hwm; - } - - return $key ? null : []; - } -} diff --git a/vendor/guzzlehttp/psr7/src/CachingStream.php b/vendor/guzzlehttp/psr7/src/CachingStream.php deleted file mode 100644 index f34722cf..00000000 --- a/vendor/guzzlehttp/psr7/src/CachingStream.php +++ /dev/null @@ -1,153 +0,0 @@ -remoteStream = $stream; - $this->stream = $target ?: new Stream(Utils::tryFopen('php://temp', 'r+')); - } - - public function getSize(): ?int - { - $remoteSize = $this->remoteStream->getSize(); - - if (null === $remoteSize) { - return null; - } - - return max($this->stream->getSize(), $remoteSize); - } - - public function rewind(): void - { - $this->seek(0); - } - - public function seek($offset, $whence = SEEK_SET): void - { - if ($whence === SEEK_SET) { - $byte = $offset; - } elseif ($whence === SEEK_CUR) { - $byte = $offset + $this->tell(); - } elseif ($whence === SEEK_END) { - $size = $this->remoteStream->getSize(); - if ($size === null) { - $size = $this->cacheEntireStream(); - } - $byte = $size + $offset; - } else { - throw new \InvalidArgumentException('Invalid whence'); - } - - $diff = $byte - $this->stream->getSize(); - - if ($diff > 0) { - // Read the remoteStream until we have read in at least the amount - // of bytes requested, or we reach the end of the file. - while ($diff > 0 && !$this->remoteStream->eof()) { - $this->read($diff); - $diff = $byte - $this->stream->getSize(); - } - } else { - // We can just do a normal seek since we've already seen this byte. - $this->stream->seek($byte); - } - } - - public function read($length): string - { - // Perform a regular read on any previously read data from the buffer - $data = $this->stream->read($length); - $remaining = $length - strlen($data); - - // More data was requested so read from the remote stream - if ($remaining) { - // If data was written to the buffer in a position that would have - // been filled from the remote stream, then we must skip bytes on - // the remote stream to emulate overwriting bytes from that - // position. This mimics the behavior of other PHP stream wrappers. - $remoteData = $this->remoteStream->read( - $remaining + $this->skipReadBytes - ); - - if ($this->skipReadBytes) { - $len = strlen($remoteData); - $remoteData = substr($remoteData, $this->skipReadBytes); - $this->skipReadBytes = max(0, $this->skipReadBytes - $len); - } - - $data .= $remoteData; - $this->stream->write($remoteData); - } - - return $data; - } - - 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 - // other stream wrappers. Basically replacing bytes of data of a fixed - // length. - $overflow = (strlen($string) + $this->tell()) - $this->remoteStream->tell(); - if ($overflow > 0) { - $this->skipReadBytes += $overflow; - } - - return $this->stream->write($string); - } - - public function eof(): bool - { - return $this->stream->eof() && $this->remoteStream->eof(); - } - - /** - * Close both the remote stream and buffer stream - */ - public function close(): void - { - $this->remoteStream->close(); - $this->stream->close(); - } - - private function cacheEntireStream(): int - { - $target = new FnStream(['write' => 'strlen']); - Utils::copyToStream($this, $target); - - return $this->tell(); - } -} diff --git a/vendor/guzzlehttp/psr7/src/DroppingStream.php b/vendor/guzzlehttp/psr7/src/DroppingStream.php deleted file mode 100644 index 6e3d209d..00000000 --- a/vendor/guzzlehttp/psr7/src/DroppingStream.php +++ /dev/null @@ -1,49 +0,0 @@ -stream = $stream; - $this->maxLength = $maxLength; - } - - public function write($string): int - { - $diff = $this->maxLength - $this->stream->getSize(); - - // Begin returning 0 when the underlying stream is too large. - if ($diff <= 0) { - return 0; - } - - // Write the stream or a subset of the stream if needed. - if (strlen($string) < $diff) { - return $this->stream->write($string); - } - - return $this->stream->write(substr($string, 0, $diff)); - } -} diff --git a/vendor/guzzlehttp/psr7/src/Exception/MalformedUriException.php b/vendor/guzzlehttp/psr7/src/Exception/MalformedUriException.php deleted file mode 100644 index 3a084779..00000000 --- a/vendor/guzzlehttp/psr7/src/Exception/MalformedUriException.php +++ /dev/null @@ -1,14 +0,0 @@ - */ - private $methods; - - /** - * @param array $methods Hash of method name to a callable. - */ - public function __construct(array $methods) - { - $this->methods = $methods; - - // Create the functions on the class - foreach ($methods as $name => $fn) { - $this->{'_fn_' . $name} = $fn; - } - } - - /** - * Lazily determine which methods are not implemented. - * - * @throws \BadMethodCallException - */ - public function __get(string $name): void - { - throw new \BadMethodCallException(str_replace('_fn_', '', $name) - . '() is not implemented in the FnStream'); - } - - /** - * The close method is called on the underlying stream only if possible. - */ - public function __destruct() - { - if (isset($this->_fn_close)) { - call_user_func($this->_fn_close); - } - } - - /** - * An unserialize would allow the __destruct to run when the unserialized value goes out of scope. - * - * @throws \LogicException - */ - public function __wakeup(): void - { - throw new \LogicException('FnStream should never be unserialized'); - } - - /** - * 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 - * - * @return FnStream - */ - public static function decorate(StreamInterface $stream, array $methods) - { - // 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) { - /** @var callable $callable */ - $callable = [$stream, $diff]; - $methods[$diff] = $callable; - } - - return new self($methods); - } - - public function __toString(): string - { - 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(): void - { - call_user_func($this->_fn_close); - } - - public function detach() - { - return call_user_func($this->_fn_detach); - } - - public function getSize(): ?int - { - return call_user_func($this->_fn_getSize); - } - - public function tell(): int - { - return call_user_func($this->_fn_tell); - } - - public function eof(): bool - { - return call_user_func($this->_fn_eof); - } - - public function isSeekable(): bool - { - return call_user_func($this->_fn_isSeekable); - } - - public function rewind(): void - { - call_user_func($this->_fn_rewind); - } - - public function seek($offset, $whence = SEEK_SET): void - { - call_user_func($this->_fn_seek, $offset, $whence); - } - - public function isWritable(): bool - { - return call_user_func($this->_fn_isWritable); - } - - public function write($string): int - { - return call_user_func($this->_fn_write, $string); - } - - public function isReadable(): bool - { - return call_user_func($this->_fn_isReadable); - } - - public function read($length): string - { - return call_user_func($this->_fn_read, $length); - } - - 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 deleted file mode 100644 index 4d7005b2..00000000 --- a/vendor/guzzlehttp/psr7/src/Header.php +++ /dev/null @@ -1,134 +0,0 @@ -]+>|[^=]+/', $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; - } - } - } - - return $params; - } - - /** - * Converts an array of header values that may contain comma separated - * headers into an array of headers with no comma separated values. - * - * @param string|array $header Header to normalize. - * - * @deprecated Use self::splitList() instead. - */ - public static function normalize($header): array - { - $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 ($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; - } - - 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; - } - } - - return $result; - } -} diff --git a/vendor/guzzlehttp/psr7/src/HttpFactory.php b/vendor/guzzlehttp/psr7/src/HttpFactory.php deleted file mode 100644 index 30be222f..00000000 --- a/vendor/guzzlehttp/psr7/src/HttpFactory.php +++ /dev/null @@ -1,100 +0,0 @@ -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 deleted file mode 100644 index 8e00f1c3..00000000 --- a/vendor/guzzlehttp/psr7/src/InflateStream.php +++ /dev/null @@ -1,37 +0,0 @@ - 15 + 32]); - $this->stream = $stream->isSeekable() ? new Stream($resource) : new NoSeekStream(new Stream($resource)); - } -} diff --git a/vendor/guzzlehttp/psr7/src/LazyOpenStream.php b/vendor/guzzlehttp/psr7/src/LazyOpenStream.php deleted file mode 100644 index 5618331f..00000000 --- a/vendor/guzzlehttp/psr7/src/LazyOpenStream.php +++ /dev/null @@ -1,41 +0,0 @@ -filename = $filename; - $this->mode = $mode; - } - - /** - * Creates the underlying stream lazily when required. - */ - 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 deleted file mode 100644 index fb223255..00000000 --- a/vendor/guzzlehttp/psr7/src/LimitStream.php +++ /dev/null @@ -1,157 +0,0 @@ -stream = $stream; - $this->setLimit($limit); - $this->setOffset($offset); - } - - public function eof(): bool - { - // Always return true if the underlying stream is EOF - if ($this->stream->eof()) { - return true; - } - - // No limit and the underlying stream is not at EOF - if ($this->limit === -1) { - return false; - } - - return $this->stream->tell() >= $this->offset + $this->limit; - } - - /** - * Returns the size of the limited subset of data - */ - public function getSize(): ?int - { - if (null === ($length = $this->stream->getSize())) { - return null; - } elseif ($this->limit === -1) { - return $length - $this->offset; - } else { - return min($this->limit, $length - $this->offset); - } - } - - /** - * Allow for a bounded seek on the read limited stream - */ - public function seek($offset, $whence = SEEK_SET): void - { - if ($whence !== SEEK_SET || $offset < 0) { - throw new \RuntimeException(sprintf( - 'Cannot seek to offset %s with whence %s', - $offset, - $whence - )); - } - - $offset += $this->offset; - - if ($this->limit !== -1) { - if ($offset > $this->offset + $this->limit) { - $offset = $this->offset + $this->limit; - } - } - - $this->stream->seek($offset); - } - - /** - * Give a relative tell() - */ - public function tell(): int - { - return $this->stream->tell() - $this->offset; - } - - /** - * Set the offset to start limiting from - * - * @param int $offset Offset to seek to and begin byte limiting from - * - * @throws \RuntimeException if the stream cannot be seeked. - */ - public function setOffset(int $offset): void - { - $current = $this->stream->tell(); - - if ($current !== $offset) { - // If the stream cannot seek to the offset position, then read to it - if ($this->stream->isSeekable()) { - $this->stream->seek($offset); - } elseif ($current > $offset) { - throw new \RuntimeException("Could not seek to stream offset $offset"); - } else { - $this->stream->read($offset - $current); - } - } - - $this->offset = $offset; - } - - /** - * Set the limit of bytes that the decorator allows to be read from the - * stream. - * - * @param int $limit Number of bytes to allow to be read from the stream. - * Use -1 for no limit. - */ - public function setLimit(int $limit): void - { - $this->limit = $limit; - } - - public function read($length): string - { - if ($this->limit === -1) { - return $this->stream->read($length); - } - - // Check if the current position is less than the total allowed - // bytes + original offset - $remaining = ($this->offset + $this->limit) - $this->stream->tell(); - if ($remaining > 0) { - // Only return the amount of requested data, ensuring that the byte - // limit is not exceeded - return $this->stream->read(min($remaining, $length)); - } - - return ''; - } -} diff --git a/vendor/guzzlehttp/psr7/src/Message.php b/vendor/guzzlehttp/psr7/src/Message.php deleted file mode 100644 index 61c1a5dc..00000000 --- a/vendor/guzzlehttp/psr7/src/Message.php +++ /dev/null @@ -1,246 +0,0 @@ -getMethod() . ' ' - . $message->getRequestTarget()) - . ' HTTP/' . $message->getProtocolVersion(); - if (!$message->hasHeader('host')) { - $msg .= "\r\nHost: " . $message->getUri()->getHost(); - } - } elseif ($message instanceof ResponseInterface) { - $msg = 'HTTP/' . $message->getProtocolVersion() . ' ' - . $message->getStatusCode() . ' ' - . $message->getReasonPhrase(); - } else { - throw new \InvalidArgumentException('Unknown message type'); - } - - foreach ($message->getHeaders() as $name => $values) { - if (strtolower($name) === 'set-cookie') { - foreach ($values as $value) { - $msg .= "\r\n{$name}: " . $value; - } - } else { - $msg .= "\r\n{$name}: " . implode(', ', $values); - } - } - - return "{$msg}\r\n\r\n" . $message->getBody(); - } - - /** - * 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 - */ - public static function bodySummary(MessageInterface $message, int $truncateAt = 120): ?string - { - $body = $message->getBody(); - - if (!$body->isSeekable() || !$body->isReadable()) { - return null; - } - - $size = $body->getSize(); - - if ($size === 0) { - return null; - } - - $body->rewind(); - $summary = $body->read($truncateAt); - $body->rewind(); - - if ($size > $truncateAt) { - $summary .= ' (truncated...)'; - } - - // 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)) { - return null; - } - - return $summary; - } - - /** - * Attempts to rewind a message body and throws an exception on failure. - * - * The body of the message will only be rewound if a call to `tell()` - * returns a value other than `0`. - * - * @param MessageInterface $message Message to rewind - * - * @throws \RuntimeException - */ - public static function rewindBody(MessageInterface $message): void - { - $body = $message->getBody(); - - if ($body->tell()) { - $body->rewind(); - } - } - - /** - * 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. - */ - public static function parseMessage(string $message): array - { - if (!$message) { - throw new \InvalidArgumentException('Invalid message'); - } - - $message = ltrim($message, "\r\n"); - - $messageParts = preg_split("/\r?\n\r?\n/", $message, 2); - - if ($messageParts === false || count($messageParts) !== 2) { - throw new \InvalidArgumentException('Invalid message: Missing header delimiter'); - } - - [$rawHeaders, $body] = $messageParts; - $rawHeaders .= "\r\n"; // Put back the delimiter we split previously - $headerParts = preg_split("/\r?\n/", $rawHeaders, 2); - - if ($headerParts === false || count($headerParts) !== 2) { - throw new \InvalidArgumentException('Invalid message: Missing status line'); - } - - [$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 - $rawHeaders = preg_replace(Rfc7230::HEADER_FOLD_REGEX, ' ', $rawHeaders); - } - - /** @var array[] $headerLines */ - $count = preg_match_all(Rfc7230::HEADER_REGEX, $rawHeaders, $headerLines, PREG_SET_ORDER); - - // If these aren't the same, then one line didn't match and there's an invalid header. - if ($count !== substr_count($rawHeaders, "\n")) { - // Folding is deprecated, see https://tools.ietf.org/html/rfc7230#section-3.2.4 - if (preg_match(Rfc7230::HEADER_FOLD_REGEX, $rawHeaders)) { - throw new \InvalidArgumentException('Invalid header syntax: Obsolete line folding'); - } - - throw new \InvalidArgumentException('Invalid header syntax'); - } - - $headers = []; - - foreach ($headerLines as $headerLine) { - $headers[$headerLine[1]][] = $headerLine[2]; - } - - return [ - 'start-line' => $startLine, - 'headers' => $headers, - 'body' => $body, - ]; - } - - /** - * 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). - */ - 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'; - }); - - // If no host is found, then a full URI cannot be constructed. - if (!$hostKey) { - return $path; - } - - $host = $headers[reset($hostKey)][0]; - $scheme = substr($host, -4) === ':443' ? 'https' : 'http'; - - return $scheme . '://' . $host . '/' . ltrim($path, '/'); - } - - /** - * Parses a request message string into a request object. - * - * @param string $message Request message string. - */ - public static function parseRequest(string $message): RequestInterface - { - $data = self::parseMessage($message); - $matches = []; - if (!preg_match('/^[\S]+\s+([a-zA-Z]+:\/\/|\/).*/', $data['start-line'], $matches)) { - throw new \InvalidArgumentException('Invalid request string'); - } - $parts = explode(' ', $data['start-line'], 3); - $version = isset($parts[2]) ? explode('/', $parts[2])[1] : '1.1'; - - $request = new Request( - $parts[0], - $matches[1] === '/' ? self::parseRequestUri($parts[1], $data['headers']) : $parts[1], - $data['headers'], - $data['body'], - $version - ); - - return $matches[1] === '/' ? $request : $request->withRequestTarget($parts[1]); - } - - /** - * Parses a response message string into a response object. - * - * @param string $message Response message string. - */ - 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 - // between status-code and reason-phrase is required. But browsers accept - // responses without space and reason as well. - if (!preg_match('/^HTTP\/.* [0-9]{3}( .*|$)/', $data['start-line'])) { - throw new \InvalidArgumentException('Invalid response string: ' . $data['start-line']); - } - $parts = explode(' ', $data['start-line'], 3); - - return new Response( - (int) $parts[1], - $data['headers'], - $data['body'], - explode('/', $parts[0])[1], - $parts[2] ?? null - ); - } -} diff --git a/vendor/guzzlehttp/psr7/src/MessageTrait.php b/vendor/guzzlehttp/psr7/src/MessageTrait.php deleted file mode 100644 index d2dc28b6..00000000 --- a/vendor/guzzlehttp/psr7/src/MessageTrait.php +++ /dev/null @@ -1,264 +0,0 @@ - Map of all registered headers, as original name => array of values */ - private $headers = []; - - /** @var array Map of lowercase header name => original name at registration */ - private $headerNames = []; - - /** @var string */ - private $protocol = '1.1'; - - /** @var StreamInterface|null */ - private $stream; - - public function getProtocolVersion(): string - { - return $this->protocol; - } - - public function withProtocolVersion($version): MessageInterface - { - if ($this->protocol === $version) { - return $this; - } - - $new = clone $this; - $new->protocol = $version; - return $new; - } - - public function getHeaders(): array - { - return $this->headers; - } - - public function hasHeader($header): bool - { - return isset($this->headerNames[strtolower($header)]); - } - - public function getHeader($header): array - { - $header = strtolower($header); - - if (!isset($this->headerNames[$header])) { - return []; - } - - $header = $this->headerNames[$header]; - - return $this->headers[$header]; - } - - public function getHeaderLine($header): string - { - return implode(', ', $this->getHeader($header)); - } - - public function withHeader($header, $value): MessageInterface - { - $this->assertHeader($header); - $value = $this->normalizeHeaderValue($value); - $normalized = strtolower($header); - - $new = clone $this; - if (isset($new->headerNames[$normalized])) { - unset($new->headers[$new->headerNames[$normalized]]); - } - $new->headerNames[$normalized] = $header; - $new->headers[$header] = $value; - - return $new; - } - - public function withAddedHeader($header, $value): MessageInterface - { - $this->assertHeader($header); - $value = $this->normalizeHeaderValue($value); - $normalized = strtolower($header); - - $new = clone $this; - if (isset($new->headerNames[$normalized])) { - $header = $this->headerNames[$normalized]; - $new->headers[$header] = array_merge($this->headers[$header], $value); - } else { - $new->headerNames[$normalized] = $header; - $new->headers[$header] = $value; - } - - return $new; - } - - public function withoutHeader($header): MessageInterface - { - $normalized = strtolower($header); - - if (!isset($this->headerNames[$normalized])) { - return $this; - } - - $header = $this->headerNames[$normalized]; - - $new = clone $this; - unset($new->headers[$header], $new->headerNames[$normalized]); - - return $new; - } - - public function getBody(): StreamInterface - { - if (!$this->stream) { - $this->stream = Utils::streamFor(''); - } - - return $this->stream; - } - - public function withBody(StreamInterface $body): MessageInterface - { - if ($body === $this->stream) { - return $this; - } - - $new = clone $this; - $new->stream = $body; - return $new; - } - - /** - * @param array $headers - */ - private function setHeaders(array $headers): void - { - $this->headerNames = $this->headers = []; - foreach ($headers as $header => $value) { - // Numeric array keys are converted to int by PHP. - $header = (string) $header; - - $this->assertHeader($header); - $value = $this->normalizeHeaderValue($value); - $normalized = strtolower($header); - if (isset($this->headerNames[$normalized])) { - $header = $this->headerNames[$normalized]; - $this->headers[$header] = array_merge($this->headers[$header], $value); - } else { - $this->headerNames[$normalized] = $header; - $this->headers[$header] = $value; - } - } - } - - /** - * @param mixed $value - * - * @return string[] - */ - private function normalizeHeaderValue($value): array - { - if (!is_array($value)) { - return $this->trimAndValidateHeaderValues([$value]); - } - - if (count($value) === 0) { - throw new \InvalidArgumentException('Header value can not be an empty array.'); - } - - return $this->trimAndValidateHeaderValues($value); - } - - /** - * Trims whitespace from the header values. - * - * Spaces and tabs ought to be excluded by parsers when extracting the field value from a header field. - * - * header-field = field-name ":" OWS field-value OWS - * OWS = *( SP / HTAB ) - * - * @param mixed[] $values Header values - * - * @return string[] Trimmed header values - * - * @see https://tools.ietf.org/html/rfc7230#section-3.2.4 - */ - private function trimAndValidateHeaderValues(array $values): array - { - return array_map(function ($value) { - if (!is_scalar($value) && null !== $value) { - throw new \InvalidArgumentException(sprintf( - 'Header value must be scalar or null but %s provided.', - is_object($value) ? get_class($value) : gettype($value) - )); - } - - $trimmed = trim((string) $value, " \t"); - $this->assertValue($trimmed); - - return $trimmed; - }, array_values($values)); - } - - /** - * @see https://tools.ietf.org/html/rfc7230#section-3.2 - * - * @param mixed $header - */ - private function assertHeader($header): void - { - if (!is_string($header)) { - throw new \InvalidArgumentException(sprintf( - 'Header name must be a string but %s provided.', - is_object($header) ? get_class($header) : gettype($header) - )); - } - - if (! preg_match('/^[a-zA-Z0-9\'`#$%&*+.^_|~!-]+$/', $header)) { - throw new \InvalidArgumentException( - sprintf( - '"%s" is not valid header name', - $header - ) - ); - } - } - - /** - * @see https://tools.ietf.org/html/rfc7230#section-3.2 - * - * field-value = *( field-content / obs-fold ) - * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ] - * field-vchar = VCHAR / obs-text - * VCHAR = %x21-7E - * obs-text = %x80-FF - * obs-fold = CRLF 1*( SP / HTAB ) - */ - 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: - // - // A sender MUST NOT generate a message that includes - // line folding (i.e., that has any field-value that contains a match to - // the obs-fold rule) unless the message is intended for packaging - // within the message/http media type. - // - // Clients must not send a request with line folding and a server sending folded headers is - // likely very rare. Line folding is a fairly obscure feature of HTTP/1.1 and thus not accepting - // folding is not likely to break any legitimate use case. - if (! preg_match('/^[\x20\x09\x21-\x7E\x80-\xFF]*$/', $value)) { - throw new \InvalidArgumentException(sprintf('"%s" is not valid header value', $value)); - } - } -} diff --git a/vendor/guzzlehttp/psr7/src/MimeType.php b/vendor/guzzlehttp/psr7/src/MimeType.php deleted file mode 100644 index 0debbd18..00000000 --- a/vendor/guzzlehttp/psr7/src/MimeType.php +++ /dev/null @@ -1,1237 +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', - ]; - - /** - * Determines the mimetype of a file by looking at its extension. - * - * @link https://raw.githubusercontent.com/jshttp/mime-db/master/db.json - */ - public static function fromFilename(string $filename): ?string - { - return self::fromExtension(pathinfo($filename, PATHINFO_EXTENSION)); - } - - /** - * Maps a file extensions to a mimetype. - * - * @link https://raw.githubusercontent.com/jshttp/mime-db/master/db.json - */ - public static function fromExtension(string $extension): ?string - { - return self::MIME_TYPES[strtolower($extension)] ?? null; - } -} diff --git a/vendor/guzzlehttp/psr7/src/MultipartStream.php b/vendor/guzzlehttp/psr7/src/MultipartStream.php deleted file mode 100644 index 3e12b74d..00000000 --- a/vendor/guzzlehttp/psr7/src/MultipartStream.php +++ /dev/null @@ -1,159 +0,0 @@ -boundary = $boundary ?: bin2hex(random_bytes(20)); - $this->stream = $this->createStream($elements); - } - - public function getBoundary(): string - { - return $this->boundary; - } - - 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): string - { - $str = ''; - foreach ($headers as $key => $value) { - $str .= "{$key}: {$value}\r\n"; - } - - return "--{$this->boundary}\r\n" . trim($str) . "\r\n\r\n"; - } - - /** - * Create the aggregate stream that will be used to upload the POST data - */ - 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); - } - - // Add the trailing boundary with CRLF - $stream->addStream(Utils::streamFor("--{$this->boundary}--\r\n")); - - return $stream; - } - - private function addElement(AppendStream $stream, array $element): void - { - foreach (['contents', 'name'] as $key) { - if (!array_key_exists($key, $element)) { - throw new \InvalidArgumentException("A '{$key}' key is required"); - } - } - - $element['contents'] = Utils::streamFor($element['contents']); - - if (empty($element['filename'])) { - $uri = $element['contents']->getMetadata('uri'); - if ($uri && \is_string($uri) && \substr($uri, 0, 6) !== 'php://' && \substr($uri, 0, 7) !== 'data://') { - $element['filename'] = $uri; - } - } - - [$body, $headers] = $this->createElement( - $element['name'], - $element['contents'], - $element['filename'] ?? null, - $element['headers'] ?? [] - ); - - $stream->addStream(Utils::streamFor($this->getHeaders($headers))); - $stream->addStream($body); - $stream->addStream(Utils::streamFor("\r\n")); - } - - 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'); - if (!$disposition) { - $headers['Content-Disposition'] = ($filename === '0' || $filename) - ? sprintf( - 'form-data; name="%s"; filename="%s"', - $name, - basename($filename) - ) - : "form-data; name=\"{$name}\""; - } - - // Set a default content-length header if one was no provided - $length = $this->getHeader($headers, 'content-length'); - if (!$length) { - if ($length = $stream->getSize()) { - $headers['Content-Length'] = (string) $length; - } - } - - // Set a default Content-Type if one was not supplied - $type = $this->getHeader($headers, 'content-type'); - if (!$type && ($filename === '0' || $filename)) { - if ($type = MimeType::fromFilename($filename)) { - $headers['Content-Type'] = $type; - } - } - - return [$stream, $headers]; - } - - private function getHeader(array $headers, string $key) - { - $lowercaseHeader = strtolower($key); - foreach ($headers as $k => $v) { - if (strtolower($k) === $lowercaseHeader) { - return $v; - } - } - - return null; - } -} diff --git a/vendor/guzzlehttp/psr7/src/NoSeekStream.php b/vendor/guzzlehttp/psr7/src/NoSeekStream.php deleted file mode 100644 index 161a224f..00000000 --- a/vendor/guzzlehttp/psr7/src/NoSeekStream.php +++ /dev/null @@ -1,28 +0,0 @@ -source = $source; - $this->size = $options['size'] ?? null; - $this->metadata = $options['metadata'] ?? []; - $this->buffer = new BufferStream(); - } - - public function __toString(): string - { - try { - return Utils::copyToString($this); - } 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(): void - { - $this->detach(); - } - - public function detach() - { - $this->tellPos = 0; - $this->source = null; - - return null; - } - - public function getSize(): ?int - { - return $this->size; - } - - public function tell(): int - { - return $this->tellPos; - } - - public function eof(): bool - { - return $this->source === null; - } - - public function isSeekable(): bool - { - return false; - } - - public function rewind(): void - { - $this->seek(0); - } - - public function seek($offset, $whence = SEEK_SET): void - { - throw new \RuntimeException('Cannot seek a PumpStream'); - } - - public function isWritable(): bool - { - return false; - } - - public function write($string): int - { - throw new \RuntimeException('Cannot write to a PumpStream'); - } - - public function isReadable(): bool - { - return true; - } - - public function read($length): string - { - $data = $this->buffer->read($length); - $readLen = strlen($data); - $this->tellPos += $readLen; - $remaining = $length - $readLen; - - if ($remaining) { - $this->pump($remaining); - $data .= $this->buffer->read($remaining); - $this->tellPos += strlen($data) - $readLen; - } - - return $data; - } - - public function getContents(): string - { - $result = ''; - while (!$this->eof()) { - $result .= $this->read(1000000); - } - - return $result; - } - - /** - * {@inheritdoc} - * - * @return mixed - */ - public function getMetadata($key = null) - { - if (!$key) { - return $this->metadata; - } - - return $this->metadata[$key] ?? null; - } - - private function pump(int $length): void - { - if ($this->source) { - do { - $data = call_user_func($this->source, $length); - if ($data === false || $data === null) { - $this->source = null; - return; - } - $this->buffer->write($data); - $length -= strlen($data); - } while ($length > 0); - } - } -} diff --git a/vendor/guzzlehttp/psr7/src/Query.php b/vendor/guzzlehttp/psr7/src/Query.php deleted file mode 100644 index 2faab3a8..00000000 --- a/vendor/guzzlehttp/psr7/src/Query.php +++ /dev/null @@ -1,113 +0,0 @@ - '1', 'foo[b]' => '2'])`. - * - * @param string $str Query string to parse - * @param int|bool $urlEncoding How the query string is encoded - */ - public static function parse(string $str, $urlEncoding = true): array - { - $result = []; - - if ($str === '') { - return $result; - } - - if ($urlEncoding === true) { - $decoder = function ($value) { - return rawurldecode(str_replace('+', ' ', (string) $value)); - }; - } elseif ($urlEncoding === PHP_QUERY_RFC3986) { - $decoder = 'rawurldecode'; - } elseif ($urlEncoding === PHP_QUERY_RFC1738) { - $decoder = 'urldecode'; - } else { - $decoder = function ($str) { - return $str; - }; - } - - foreach (explode('&', $str) as $kvp) { - $parts = explode('=', $kvp, 2); - $key = $decoder($parts[0]); - $value = isset($parts[1]) ? $decoder($parts[1]) : null; - if (!array_key_exists($key, $result)) { - $result[$key] = $value; - } else { - if (!is_array($result[$key])) { - $result[$key] = [$result[$key]]; - } - $result[$key][] = $value; - } - } - - return $result; - } - - /** - * Build a query string from an array of key value pairs. - * - * This function can use the return value of `parse()` 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. - */ - public static function build(array $params, $encoding = PHP_QUERY_RFC3986): string - { - if (!$params) { - return ''; - } - - if ($encoding === false) { - $encoder = function (string $str): string { - return $str; - }; - } elseif ($encoding === PHP_QUERY_RFC3986) { - $encoder = 'rawurlencode'; - } elseif ($encoding === PHP_QUERY_RFC1738) { - $encoder = 'urlencode'; - } else { - throw new \InvalidArgumentException('Invalid type'); - } - - $qs = ''; - foreach ($params as $k => $v) { - $k = $encoder((string) $k); - if (!is_array($v)) { - $qs .= $k; - $v = is_bool($v) ? (int) $v : $v; - if ($v !== null) { - $qs .= '=' . $encoder((string) $v); - } - $qs .= '&'; - } else { - foreach ($v as $vv) { - $qs .= $k; - $vv = is_bool($vv) ? (int) $vv : $vv; - if ($vv !== null) { - $qs .= '=' . $encoder((string) $vv); - } - $qs .= '&'; - } - } - } - - return $qs ? (string) substr($qs, 0, -1) : ''; - } -} diff --git a/vendor/guzzlehttp/psr7/src/Request.php b/vendor/guzzlehttp/psr7/src/Request.php deleted file mode 100644 index b17af66a..00000000 --- a/vendor/guzzlehttp/psr7/src/Request.php +++ /dev/null @@ -1,157 +0,0 @@ - $headers Request headers - * @param string|resource|StreamInterface|null $body Request body - * @param string $version Protocol version - */ - public function __construct( - string $method, - $uri, - array $headers = [], - $body = null, - string $version = '1.1' - ) { - $this->assertMethod($method); - if (!($uri instanceof UriInterface)) { - $uri = new Uri($uri); - } - - $this->method = strtoupper($method); - $this->uri = $uri; - $this->setHeaders($headers); - $this->protocol = $version; - - if (!isset($this->headerNames['host'])) { - $this->updateHostFromUri(); - } - - if ($body !== '' && $body !== null) { - $this->stream = Utils::streamFor($body); - } - } - - public function getRequestTarget(): string - { - if ($this->requestTarget !== null) { - return $this->requestTarget; - } - - $target = $this->uri->getPath(); - if ($target === '') { - $target = '/'; - } - if ($this->uri->getQuery() != '') { - $target .= '?' . $this->uri->getQuery(); - } - - return $target; - } - - public function withRequestTarget($requestTarget): RequestInterface - { - if (preg_match('#\s#', $requestTarget)) { - throw new InvalidArgumentException( - 'Invalid request target provided; cannot contain whitespace' - ); - } - - $new = clone $this; - $new->requestTarget = $requestTarget; - return $new; - } - - public function getMethod(): string - { - return $this->method; - } - - public function withMethod($method): RequestInterface - { - $this->assertMethod($method); - $new = clone $this; - $new->method = strtoupper($method); - return $new; - } - - public function getUri(): UriInterface - { - return $this->uri; - } - - public function withUri(UriInterface $uri, $preserveHost = false): RequestInterface - { - if ($uri === $this->uri) { - return $this; - } - - $new = clone $this; - $new->uri = $uri; - - if (!$preserveHost || !isset($this->headerNames['host'])) { - $new->updateHostFromUri(); - } - - return $new; - } - - private function updateHostFromUri(): void - { - $host = $this->uri->getHost(); - - if ($host == '') { - return; - } - - if (($port = $this->uri->getPort()) !== null) { - $host .= ':' . $port; - } - - if (isset($this->headerNames['host'])) { - $header = $this->headerNames['host']; - } else { - $header = 'Host'; - $this->headerNames['host'] = 'Host'; - } - // Ensure Host is the first header. - // See: http://tools.ietf.org/html/rfc7230#section-5.4 - $this->headers = [$header => [$host]] + $this->headers; - } - - /** - * @param mixed $method - */ - private function assertMethod($method): void - { - if (!is_string($method) || $method === '') { - 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 deleted file mode 100644 index 4c6ee6f0..00000000 --- a/vendor/guzzlehttp/psr7/src/Response.php +++ /dev/null @@ -1,160 +0,0 @@ - 'Continue', - 101 => 'Switching Protocols', - 102 => 'Processing', - 200 => 'OK', - 201 => 'Created', - 202 => 'Accepted', - 203 => 'Non-Authoritative Information', - 204 => 'No Content', - 205 => 'Reset Content', - 206 => 'Partial Content', - 207 => 'Multi-status', - 208 => 'Already Reported', - 300 => 'Multiple Choices', - 301 => 'Moved Permanently', - 302 => 'Found', - 303 => 'See Other', - 304 => 'Not Modified', - 305 => 'Use Proxy', - 306 => 'Switch Proxy', - 307 => 'Temporary Redirect', - 308 => 'Permanent Redirect', - 400 => 'Bad Request', - 401 => 'Unauthorized', - 402 => 'Payment Required', - 403 => 'Forbidden', - 404 => 'Not Found', - 405 => 'Method Not Allowed', - 406 => 'Not Acceptable', - 407 => 'Proxy Authentication Required', - 408 => 'Request Time-out', - 409 => 'Conflict', - 410 => 'Gone', - 411 => 'Length Required', - 412 => 'Precondition Failed', - 413 => 'Request Entity Too Large', - 414 => 'Request-URI Too Large', - 415 => 'Unsupported Media Type', - 416 => 'Requested range not satisfiable', - 417 => 'Expectation Failed', - 418 => 'I\'m a teapot', - 422 => 'Unprocessable Entity', - 423 => 'Locked', - 424 => 'Failed Dependency', - 425 => 'Unordered Collection', - 426 => 'Upgrade Required', - 428 => 'Precondition Required', - 429 => 'Too Many Requests', - 431 => 'Request Header Fields Too Large', - 451 => 'Unavailable For Legal Reasons', - 500 => 'Internal Server Error', - 501 => 'Not Implemented', - 502 => 'Bad Gateway', - 503 => 'Service Unavailable', - 504 => 'Gateway Time-out', - 505 => 'HTTP Version not supported', - 506 => 'Variant Also Negotiates', - 507 => 'Insufficient Storage', - 508 => 'Loop Detected', - 510 => 'Not Extended', - 511 => 'Network Authentication Required', - ]; - - /** @var string */ - private $reasonPhrase; - - /** @var int */ - private $statusCode; - - /** - * @param int $status Status code - * @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( - int $status = 200, - array $headers = [], - $body = null, - string $version = '1.1', - string $reason = null - ) { - $this->assertStatusCodeRange($status); - - $this->statusCode = $status; - - if ($body !== '' && $body !== null) { - $this->stream = Utils::streamFor($body); - } - - $this->setHeaders($headers); - if ($reason == '' && isset(self::PHRASES[$this->statusCode])) { - $this->reasonPhrase = self::PHRASES[$this->statusCode]; - } else { - $this->reasonPhrase = (string) $reason; - } - - $this->protocol = $version; - } - - public function getStatusCode(): int - { - return $this->statusCode; - } - - public function getReasonPhrase(): string - { - return $this->reasonPhrase; - } - - public function withStatus($code, $reasonPhrase = ''): ResponseInterface - { - $this->assertStatusCodeIsInteger($code); - $code = (int) $code; - $this->assertStatusCodeRange($code); - - $new = clone $this; - $new->statusCode = $code; - if ($reasonPhrase == '' && isset(self::PHRASES[$new->statusCode])) { - $reasonPhrase = self::PHRASES[$new->statusCode]; - } - $new->reasonPhrase = (string) $reasonPhrase; - return $new; - } - - /** - * @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(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 deleted file mode 100644 index 30224018..00000000 --- a/vendor/guzzlehttp/psr7/src/Rfc7230.php +++ /dev/null @@ -1,23 +0,0 @@ -@,;:\\\"/[\]?={}\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 deleted file mode 100644 index 43cbb502..00000000 --- a/vendor/guzzlehttp/psr7/src/ServerRequest.php +++ /dev/null @@ -1,344 +0,0 @@ - $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( - string $method, - $uri, - array $headers = [], - $body = null, - string $version = '1.1', - array $serverParams = [] - ) { - $this->serverParams = $serverParams; - - parent::__construct($method, $uri, $headers, $body, $version); - } - - /** - * Return an UploadedFile instance array. - * - * @param array $files An array which respect $_FILES structure - * - * @throws InvalidArgumentException for unrecognized values - */ - public static function normalizeFiles(array $files): array - { - $normalized = []; - - foreach ($files as $key => $value) { - if ($value instanceof UploadedFileInterface) { - $normalized[$key] = $value; - } elseif (is_array($value) && isset($value['tmp_name'])) { - $normalized[$key] = self::createUploadedFileFromSpec($value); - } elseif (is_array($value)) { - $normalized[$key] = self::normalizeFiles($value); - continue; - } else { - throw new InvalidArgumentException('Invalid value in files specification'); - } - } - - return $normalized; - } - - /** - * Create and return an UploadedFile instance from a $_FILES specification. - * - * If the specification represents an array of values, this method will - * delegate to normalizeNestedFileSpec() and return that return value. - * - * @param array $value $_FILES struct - * - * @return UploadedFileInterface|UploadedFileInterface[] - */ - private static function createUploadedFileFromSpec(array $value) - { - if (is_array($value['tmp_name'])) { - return self::normalizeNestedFileSpec($value); - } - - return new UploadedFile( - $value['tmp_name'], - (int) $value['size'], - (int) $value['error'], - $value['name'], - $value['type'] - ); - } - - /** - * Normalize an array of file specifications. - * - * Loops through all nested files and returns a normalized array of - * UploadedFileInterface instances. - * - * @return UploadedFileInterface[] - */ - 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], - ]; - $normalizedFiles[$key] = self::createUploadedFileFromSpec($spec); - } - - return $normalizedFiles; - } - - /** - * Return a ServerRequest populated with superglobals: - * $_GET - * $_POST - * $_COOKIE - * $_FILES - * $_SERVER - */ - public static function fromGlobals(): ServerRequestInterface - { - $method = $_SERVER['REQUEST_METHOD'] ?? 'GET'; - $headers = getallheaders(); - $uri = self::getUriFromGlobals(); - $body = new CachingStream(new LazyOpenStream('php://input', 'r+')); - $protocol = isset($_SERVER['SERVER_PROTOCOL']) ? str_replace('HTTP/', '', $_SERVER['SERVER_PROTOCOL']) : '1.1'; - - $serverRequest = new ServerRequest($method, $uri, $headers, $body, $protocol, $_SERVER); - - return $serverRequest - ->withCookieParams($_COOKIE) - ->withQueryParams($_GET) - ->withParsedBody($_POST) - ->withUploadedFiles(self::normalizeFiles($_FILES)); - } - - private static function extractHostAndPortFromAuthority(string $authority): array - { - $uri = 'http://' . $authority; - $parts = parse_url($uri); - if (false === $parts) { - return [null, null]; - } - - $host = $parts['host'] ?? null; - $port = $parts['port'] ?? null; - - return [$host, $port]; - } - - /** - * Get a Uri populated with values from $_SERVER. - */ - public static function getUriFromGlobals(): UriInterface - { - $uri = new Uri(''); - - $uri = $uri->withScheme(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' ? 'https' : 'http'); - - $hasPort = false; - if (isset($_SERVER['HTTP_HOST'])) { - [$host, $port] = self::extractHostAndPortFromAuthority($_SERVER['HTTP_HOST']); - if ($host !== null) { - $uri = $uri->withHost($host); - } - - if ($port !== null) { - $hasPort = true; - $uri = $uri->withPort($port); - } - } elseif (isset($_SERVER['SERVER_NAME'])) { - $uri = $uri->withHost($_SERVER['SERVER_NAME']); - } elseif (isset($_SERVER['SERVER_ADDR'])) { - $uri = $uri->withHost($_SERVER['SERVER_ADDR']); - } - - if (!$hasPort && isset($_SERVER['SERVER_PORT'])) { - $uri = $uri->withPort($_SERVER['SERVER_PORT']); - } - - $hasQuery = false; - if (isset($_SERVER['REQUEST_URI'])) { - $requestUriParts = explode('?', $_SERVER['REQUEST_URI'], 2); - $uri = $uri->withPath($requestUriParts[0]); - if (isset($requestUriParts[1])) { - $hasQuery = true; - $uri = $uri->withQuery($requestUriParts[1]); - } - } - - if (!$hasQuery && isset($_SERVER['QUERY_STRING'])) { - $uri = $uri->withQuery($_SERVER['QUERY_STRING']); - } - - return $uri; - } - - public function getServerParams(): array - { - return $this->serverParams; - } - - public function getUploadedFiles(): array - { - return $this->uploadedFiles; - } - - public function withUploadedFiles(array $uploadedFiles): ServerRequestInterface - { - $new = clone $this; - $new->uploadedFiles = $uploadedFiles; - - return $new; - } - - public function getCookieParams(): array - { - return $this->cookieParams; - } - - public function withCookieParams(array $cookies): ServerRequestInterface - { - $new = clone $this; - $new->cookieParams = $cookies; - - return $new; - } - - public function getQueryParams(): array - { - return $this->queryParams; - } - - public function withQueryParams(array $query): ServerRequestInterface - { - $new = clone $this; - $new->queryParams = $query; - - return $new; - } - - /** - * {@inheritdoc} - * - * @return array|object|null - */ - public function getParsedBody() - { - return $this->parsedBody; - } - - public function withParsedBody($data): ServerRequestInterface - { - $new = clone $this; - $new->parsedBody = $data; - - return $new; - } - - public function getAttributes(): array - { - return $this->attributes; - } - - /** - * {@inheritdoc} - * - * @return mixed - */ - public function getAttribute($attribute, $default = null) - { - if (false === array_key_exists($attribute, $this->attributes)) { - return $default; - } - - return $this->attributes[$attribute]; - } - - public function withAttribute($attribute, $value): ServerRequestInterface - { - $new = clone $this; - $new->attributes[$attribute] = $value; - - return $new; - } - - public function withoutAttribute($attribute): ServerRequestInterface - { - if (false === array_key_exists($attribute, $this->attributes)) { - return $this; - } - - $new = clone $this; - unset($new->attributes[$attribute]); - - return $new; - } -} diff --git a/vendor/guzzlehttp/psr7/src/Stream.php b/vendor/guzzlehttp/psr7/src/Stream.php deleted file mode 100644 index ecd31861..00000000 --- a/vendor/guzzlehttp/psr7/src/Stream.php +++ /dev/null @@ -1,282 +0,0 @@ -size = $options['size']; - } - - $this->customMetadata = $options['metadata'] ?? []; - $this->stream = $stream; - $meta = stream_get_meta_data($this->stream); - $this->seekable = $meta['seekable']; - $this->readable = (bool)preg_match(self::READABLE_MODES, $meta['mode']); - $this->writable = (bool)preg_match(self::WRITABLE_MODES, $meta['mode']); - $this->uri = $this->getMetadata('uri'); - } - - /** - * Closes the stream when the destructed - */ - public function __destruct() - { - $this->close(); - } - - public function __toString(): string - { - try { - if ($this->isSeekable()) { - $this->seek(0); - } - return $this->getContents(); - } 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(): string - { - if (!isset($this->stream)) { - throw new \RuntimeException('Stream is detached'); - } - - if (!$this->readable) { - throw new \RuntimeException('Cannot read from non-readable stream'); - } - - return Utils::tryGetContents($this->stream); - } - - public function close(): void - { - if (isset($this->stream)) { - if (is_resource($this->stream)) { - fclose($this->stream); - } - $this->detach(); - } - } - - public function detach() - { - if (!isset($this->stream)) { - return null; - } - - $result = $this->stream; - unset($this->stream); - $this->size = $this->uri = null; - $this->readable = $this->writable = $this->seekable = false; - - return $result; - } - - public function getSize(): ?int - { - if ($this->size !== null) { - return $this->size; - } - - if (!isset($this->stream)) { - return null; - } - - // Clear the stat cache if the stream has a URI - if ($this->uri) { - clearstatcache(true, $this->uri); - } - - $stats = fstat($this->stream); - if (is_array($stats) && isset($stats['size'])) { - $this->size = $stats['size']; - return $this->size; - } - - return null; - } - - public function isReadable(): bool - { - return $this->readable; - } - - public function isWritable(): bool - { - return $this->writable; - } - - public function isSeekable(): bool - { - return $this->seekable; - } - - public function eof(): bool - { - if (!isset($this->stream)) { - throw new \RuntimeException('Stream is detached'); - } - - return feof($this->stream); - } - - public function tell(): int - { - if (!isset($this->stream)) { - throw new \RuntimeException('Stream is detached'); - } - - $result = ftell($this->stream); - - if ($result === false) { - throw new \RuntimeException('Unable to determine stream position'); - } - - return $result; - } - - public function rewind(): void - { - $this->seek(0); - } - - public function seek($offset, $whence = SEEK_SET): void - { - $whence = (int) $whence; - - if (!isset($this->stream)) { - throw new \RuntimeException('Stream is detached'); - } - if (!$this->seekable) { - throw new \RuntimeException('Stream is not seekable'); - } - if (fseek($this->stream, $offset, $whence) === -1) { - throw new \RuntimeException('Unable to seek to stream position ' - . $offset . ' with whence ' . var_export($whence, true)); - } - } - - public function read($length): string - { - if (!isset($this->stream)) { - throw new \RuntimeException('Stream is detached'); - } - if (!$this->readable) { - throw new \RuntimeException('Cannot read from non-readable stream'); - } - if ($length < 0) { - throw new \RuntimeException('Length parameter cannot be negative'); - } - - if (0 === $length) { - return ''; - } - - 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'); - } - - return $string; - } - - public function write($string): int - { - if (!isset($this->stream)) { - throw new \RuntimeException('Stream is detached'); - } - if (!$this->writable) { - throw new \RuntimeException('Cannot write to a non-writable stream'); - } - - // We can't know the size after writing anything - $this->size = null; - $result = fwrite($this->stream, $string); - - if ($result === false) { - throw new \RuntimeException('Unable to write to stream'); - } - - return $result; - } - - /** - * {@inheritdoc} - * - * @return mixed - */ - public function getMetadata($key = null) - { - if (!isset($this->stream)) { - return $key ? null : []; - } elseif (!$key) { - return $this->customMetadata + stream_get_meta_data($this->stream); - } elseif (isset($this->customMetadata[$key])) { - return $this->customMetadata[$key]; - } - - $meta = stream_get_meta_data($this->stream); - - return $meta[$key] ?? null; - } -} diff --git a/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php b/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php deleted file mode 100644 index 56d4104d..00000000 --- a/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php +++ /dev/null @@ -1,155 +0,0 @@ -stream = $stream; - } - - /** - * Magic method used to create a new stream if streams are not added in - * the constructor of a decorator (e.g., LazyOpenStream). - * - * @return StreamInterface - */ - public function __get(string $name) - { - if ($name === 'stream') { - $this->stream = $this->createStream(); - return $this->stream; - } - - throw new \UnexpectedValueException("$name not found on class"); - } - - public function __toString(): string - { - try { - if ($this->isSeekable()) { - $this->seek(0); - } - return $this->getContents(); - } 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(): string - { - return Utils::copyToString($this); - } - - /** - * Allow decorators to implement custom methods - * - * @return mixed - */ - public function __call(string $method, array $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(): void - { - $this->stream->close(); - } - - /** - * {@inheritdoc} - * - * @return mixed - */ - public function getMetadata($key = null) - { - return $this->stream->getMetadata($key); - } - - public function detach() - { - return $this->stream->detach(); - } - - public function getSize(): ?int - { - return $this->stream->getSize(); - } - - public function eof(): bool - { - return $this->stream->eof(); - } - - public function tell(): int - { - return $this->stream->tell(); - } - - public function isReadable(): bool - { - return $this->stream->isReadable(); - } - - public function isWritable(): bool - { - return $this->stream->isWritable(); - } - - public function isSeekable(): bool - { - return $this->stream->isSeekable(); - } - - public function rewind(): void - { - $this->seek(0); - } - - public function seek($offset, $whence = SEEK_SET): void - { - $this->stream->seek($offset, $whence); - } - - public function read($length): string - { - return $this->stream->read($length); - } - - public function write($string): int - { - return $this->stream->write($string); - } - - /** - * Implement in subclasses to dynamically create streams when requested. - * - * @throws \BadMethodCallException - */ - 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 deleted file mode 100644 index 2a934640..00000000 --- a/vendor/guzzlehttp/psr7/src/StreamWrapper.php +++ /dev/null @@ -1,175 +0,0 @@ -isReadable()) { - $mode = $stream->isWritable() ? 'r+' : 'r'; - } elseif ($stream->isWritable()) { - $mode = 'w'; - } else { - throw new \InvalidArgumentException('The stream must be readable, ' - . 'writable, or both.'); - } - - return fopen('guzzle://stream', $mode, false, self::createStreamContext($stream)); - } - - /** - * Creates a stream context that can be used to open a stream as a php stream resource. - * - * @return resource - */ - public static function createStreamContext(StreamInterface $stream) - { - return stream_context_create([ - 'guzzle' => ['stream' => $stream] - ]); - } - - /** - * Registers the stream wrapper if needed - */ - public static function register(): void - { - if (!in_array('guzzle', stream_get_wrappers())) { - stream_wrapper_register('guzzle', __CLASS__); - } - } - - public function stream_open(string $path, string $mode, int $options, string &$opened_path = null): bool - { - $options = stream_context_get_options($this->context); - - if (!isset($options['guzzle']['stream'])) { - return false; - } - - $this->mode = $mode; - $this->stream = $options['guzzle']['stream']; - - return true; - } - - public function stream_read(int $count): string - { - return $this->stream->read($count); - } - - public function stream_write(string $data): int - { - return $this->stream->write($data); - } - - public function stream_tell(): int - { - return $this->stream->tell(); - } - - public function stream_eof(): bool - { - return $this->stream->eof(); - } - - public function stream_seek(int $offset, int $whence): bool - { - $this->stream->seek($offset, $whence); - - return true; - } - - /** - * @return resource|false - */ - public function stream_cast(int $cast_as) - { - $stream = clone($this->stream); - $resource = $stream->detach(); - - return $resource ?? false; - } - - /** - * @return array - */ - public function stream_stat(): array - { - static $modeMap = [ - 'r' => 33060, - 'rb' => 33060, - 'r+' => 33206, - 'w' => 33188, - 'wb' => 33188 - ]; - - return [ - 'dev' => 0, - 'ino' => 0, - 'mode' => $modeMap[$this->mode], - 'nlink' => 0, - 'uid' => 0, - 'gid' => 0, - 'rdev' => 0, - 'size' => $this->stream->getSize() ?: 0, - 'atime' => 0, - 'mtime' => 0, - 'ctime' => 0, - 'blksize' => 0, - 'blocks' => 0 - ]; - } - - /** - * @return array - */ - public function url_stat(string $path, int $flags): array - { - return [ - 'dev' => 0, - 'ino' => 0, - 'mode' => 0, - 'nlink' => 0, - 'uid' => 0, - 'gid' => 0, - 'rdev' => 0, - 'size' => 0, - 'atime' => 0, - 'mtime' => 0, - 'ctime' => 0, - 'blksize' => 0, - 'blocks' => 0 - ]; - } -} diff --git a/vendor/guzzlehttp/psr7/src/UploadedFile.php b/vendor/guzzlehttp/psr7/src/UploadedFile.php deleted file mode 100644 index b1521bcf..00000000 --- a/vendor/guzzlehttp/psr7/src/UploadedFile.php +++ /dev/null @@ -1,211 +0,0 @@ -setError($errorStatus); - $this->size = $size; - $this->clientFilename = $clientFilename; - $this->clientMediaType = $clientMediaType; - - if ($this->isOk()) { - $this->setStreamOrFile($streamOrFile); - } - } - - /** - * Depending on the value set file or stream variable - * - * @param StreamInterface|string|resource $streamOrFile - * - * @throws InvalidArgumentException - */ - private function setStreamOrFile($streamOrFile): void - { - if (is_string($streamOrFile)) { - $this->file = $streamOrFile; - } elseif (is_resource($streamOrFile)) { - $this->stream = new Stream($streamOrFile); - } elseif ($streamOrFile instanceof StreamInterface) { - $this->stream = $streamOrFile; - } else { - throw new InvalidArgumentException( - 'Invalid stream or file provided for UploadedFile' - ); - } - } - - /** - * @throws InvalidArgumentException - */ - private function setError(int $error): void - { - if (false === in_array($error, UploadedFile::ERRORS, true)) { - throw new InvalidArgumentException( - 'Invalid error status for UploadedFile' - ); - } - - $this->error = $error; - } - - private function isStringNotEmpty($param): bool - { - return is_string($param) && false === empty($param); - } - - /** - * Return true if there is no upload error - */ - private function isOk(): bool - { - return $this->error === UPLOAD_ERR_OK; - } - - public function isMoved(): bool - { - return $this->moved; - } - - /** - * @throws RuntimeException if is moved or not ok - */ - private function validateActive(): void - { - if (false === $this->isOk()) { - throw new RuntimeException('Cannot retrieve stream due to upload error'); - } - - if ($this->isMoved()) { - throw new RuntimeException('Cannot retrieve stream after it has already been moved'); - } - } - - public function getStream(): StreamInterface - { - $this->validateActive(); - - if ($this->stream instanceof StreamInterface) { - return $this->stream; - } - - /** @var string $file */ - $file = $this->file; - - return new LazyOpenStream($file, 'r+'); - } - - public function moveTo($targetPath): void - { - $this->validateActive(); - - if (false === $this->isStringNotEmpty($targetPath)) { - throw new InvalidArgumentException( - 'Invalid path provided for move operation; must be a non-empty string' - ); - } - - if ($this->file) { - $this->moved = PHP_SAPI === 'cli' - ? rename($this->file, $targetPath) - : move_uploaded_file($this->file, $targetPath); - } else { - Utils::copyToStream( - $this->getStream(), - new LazyOpenStream($targetPath, 'w') - ); - - $this->moved = true; - } - - if (false === $this->moved) { - throw new RuntimeException( - sprintf('Uploaded file could not be moved to %s', $targetPath) - ); - } - } - - public function getSize(): ?int - { - return $this->size; - } - - public function getError(): int - { - return $this->error; - } - - public function getClientFilename(): ?string - { - return $this->clientFilename; - } - - public function getClientMediaType(): ?string - { - return $this->clientMediaType; - } -} diff --git a/vendor/guzzlehttp/psr7/src/Uri.php b/vendor/guzzlehttp/psr7/src/Uri.php deleted file mode 100644 index 09e878d3..00000000 --- a/vendor/guzzlehttp/psr7/src/Uri.php +++ /dev/null @@ -1,740 +0,0 @@ - 80, - 'https' => 443, - 'ftp' => 21, - 'gopher' => 70, - 'nntp' => 119, - 'news' => 119, - 'telnet' => 23, - 'tn3270' => 23, - 'imap' => 143, - 'pop' => 110, - 'ldap' => 389, - ]; - - /** - * 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 = ''; - - /** @var string Uri user info. */ - private $userInfo = ''; - - /** @var string Uri host. */ - private $host = ''; - - /** @var int|null Uri port. */ - private $port; - - /** @var string Uri path. */ - private $path = ''; - - /** @var string Uri query string. */ - private $query = ''; - - /** @var string Uri fragment. */ - private $fragment = ''; - - /** @var string|null String representation */ - private $composedComponents; - - public function __construct(string $uri = '') - { - if ($uri !== '') { - $parts = self::parse($uri); - if ($parts === false) { - throw new MalformedUriException("Unable to parse URI: $uri"); - } - $this->applyParts($parts); - } - } - /** - * UTF-8 aware \parse_url() replacement. - * - * The internal function produces broken output for non ASCII domain names - * (IDN) when used with locales other than "C". - * - * On the other hand, cURL understands IDN correctly only when UTF-8 locale - * is configured ("C.UTF-8", "en_US.UTF-8", etc.). - * - * @see https://bugs.php.net/bug.php?id=52923 - * @see https://www.php.net/manual/en/function.parse-url.php#114817 - * @see https://curl.haxx.se/libcurl/c/CURLOPT_URL.html#ENCODING - * - * @return array|false - */ - 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) { - return urlencode($matches[0]); - }, - $url - ); - - $result = parse_url($prefix . $encodedUrl); - - if ($result === false) { - return false; - } - - return array_map('urldecode', $result); - } - - public function __toString(): string - { - if ($this->composedComponents === null) { - $this->composedComponents = self::composeComponents( - $this->scheme, - $this->getAuthority(), - $this->path, - $this->query, - $this->fragment - ); - } - - return $this->composedComponents; - } - - /** - * Composes a URI reference string from its various components. - * - * Usually this method does not need to be called manually but instead is used indirectly via - * `Psr\Http\Message\UriInterface::__toString`. - * - * PSR-7 UriInterface treats an empty component the same as a missing component as - * getQuery(), getFragment() etc. always return a string. This explains the slight - * difference to RFC 3986 Section 5.3. - * - * Another adjustment is that the authority separator is added even when the authority is missing/empty - * for the "file" scheme. This is because PHP stream functions like `file_get_contents` only work with - * `file:///myfile` but not with `file:/myfile` although they are equivalent according to RFC 3986. But - * `file:///` is the more common syntax for the file scheme anyway (Chrome for example redirects to - * that format). - * - * @link https://tools.ietf.org/html/rfc3986#section-5.3 - */ - public static function composeComponents(?string $scheme, ?string $authority, string $path, ?string $query, ?string $fragment): string - { - $uri = ''; - - // weak type checks to also accept null until we can add scalar type hints - if ($scheme != '') { - $uri .= $scheme . ':'; - } - - if ($authority != '' || $scheme === 'file') { - $uri .= '//' . $authority; - } - - if ($authority != '' && $path != '' && $path[0] != '/') { - $path = '/' . $path; - } - - $uri .= $path; - - if ($query != '') { - $uri .= '?' . $query; - } - - if ($fragment != '') { - $uri .= '#' . $fragment; - } - - return $uri; - } - - /** - * Whether the URI has the default port of the current scheme. - * - * `Psr\Http\Message\UriInterface::getPort` may return null or the standard port. This method can be used - * independently of the implementation. - */ - public static function isDefaultPort(UriInterface $uri): bool - { - return $uri->getPort() === null - || (isset(self::DEFAULT_PORTS[$uri->getScheme()]) && $uri->getPort() === self::DEFAULT_PORTS[$uri->getScheme()]); - } - - /** - * Whether the URI is absolute, i.e. it has a scheme. - * - * An instance of UriInterface can either be an absolute URI or a relative reference. This method returns true - * if it is the former. An absolute URI has a scheme. A relative reference is used to express a URI relative - * to another URI, the base URI. Relative references can be divided into several forms: - * - network-path references, e.g. '//example.com/path' - * - absolute-path references, e.g. '/path' - * - relative-path references, e.g. 'subpath' - * - * @see Uri::isNetworkPathReference - * @see Uri::isAbsolutePathReference - * @see Uri::isRelativePathReference - * @link https://tools.ietf.org/html/rfc3986#section-4 - */ - public static function isAbsolute(UriInterface $uri): bool - { - return $uri->getScheme() !== ''; - } - - /** - * Whether the URI is a network-path reference. - * - * A relative reference that begins with two slash characters is termed an network-path reference. - * - * @link https://tools.ietf.org/html/rfc3986#section-4.2 - */ - public static function isNetworkPathReference(UriInterface $uri): bool - { - return $uri->getScheme() === '' && $uri->getAuthority() !== ''; - } - - /** - * Whether the URI is a absolute-path reference. - * - * A relative reference that begins with a single slash character is termed an absolute-path reference. - * - * @link https://tools.ietf.org/html/rfc3986#section-4.2 - */ - public static function isAbsolutePathReference(UriInterface $uri): bool - { - return $uri->getScheme() === '' - && $uri->getAuthority() === '' - && isset($uri->getPath()[0]) - && $uri->getPath()[0] === '/'; - } - - /** - * Whether the URI is a relative-path reference. - * - * A relative reference that does not begin with a slash character is termed a relative-path reference. - * - * @link https://tools.ietf.org/html/rfc3986#section-4.2 - */ - public static function isRelativePathReference(UriInterface $uri): bool - { - return $uri->getScheme() === '' - && $uri->getAuthority() === '' - && (!isset($uri->getPath()[0]) || $uri->getPath()[0] !== '/'); - } - - /** - * Whether the URI is a same-document reference. - * - * A same-document reference refers to a URI that is, aside from its fragment - * component, identical to the base URI. When no base URI is given, only an empty - * URI reference (apart from its fragment) is considered a same-document reference. - * - * @param UriInterface $uri The URI to check - * @param UriInterface|null $base An optional base URI to compare against - * - * @link https://tools.ietf.org/html/rfc3986#section-4.4 - */ - public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null): bool - { - if ($base !== null) { - $uri = UriResolver::resolve($base, $uri); - - return ($uri->getScheme() === $base->getScheme()) - && ($uri->getAuthority() === $base->getAuthority()) - && ($uri->getPath() === $base->getPath()) - && ($uri->getQuery() === $base->getQuery()); - } - - return $uri->getScheme() === '' && $uri->getAuthority() === '' && $uri->getPath() === '' && $uri->getQuery() === ''; - } - - /** - * Creates a new URI with a specific query string value removed. - * - * Any existing query string values that exactly match the provided key are - * removed. - * - * @param UriInterface $uri URI to use as a base. - * @param string $key Query string key to remove. - */ - public static function withoutQueryValue(UriInterface $uri, string $key): UriInterface - { - $result = self::getFilteredQueryString($uri, [$key]); - - return $uri->withQuery(implode('&', $result)); - } - - /** - * Creates a new URI with a specific query string value. - * - * Any existing query string values that exactly match the provided key are - * removed and replaced with the given key value pair. - * - * A value of null will set the query string key without a value, e.g. "key" - * instead of "key=value". - * - * @param UriInterface $uri URI to use as a base. - * @param string $key Key to set. - * @param string|null $value Value to set - */ - public static function withQueryValue(UriInterface $uri, string $key, ?string $value): UriInterface - { - $result = self::getFilteredQueryString($uri, [$key]); - - $result[] = self::generateQueryString($key, $value); - - return $uri->withQuery(implode('&', $result)); - } - - /** - * Creates a new URI with multiple specific query string values. - * - * 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 - */ - public static function withQueryValues(UriInterface $uri, array $keyValueArray): UriInterface - { - $result = self::getFilteredQueryString($uri, array_keys($keyValueArray)); - - foreach ($keyValueArray as $key => $value) { - $result[] = self::generateQueryString((string) $key, $value !== null ? (string) $value : null); - } - - return $uri->withQuery(implode('&', $result)); - } - - /** - * Creates a URI from a hash of `parse_url` components. - * - * @link http://php.net/manual/en/function.parse-url.php - * - * @throws MalformedUriException If the components do not form a valid URI. - */ - public static function fromParts(array $parts): UriInterface - { - $uri = new self(); - $uri->applyParts($parts); - $uri->validateState(); - - return $uri; - } - - public function getScheme(): string - { - return $this->scheme; - } - - public function getAuthority(): string - { - $authority = $this->host; - if ($this->userInfo !== '') { - $authority = $this->userInfo . '@' . $authority; - } - - if ($this->port !== null) { - $authority .= ':' . $this->port; - } - - return $authority; - } - - public function getUserInfo(): string - { - return $this->userInfo; - } - - public function getHost(): string - { - return $this->host; - } - - public function getPort(): ?int - { - return $this->port; - } - - public function getPath(): string - { - return $this->path; - } - - public function getQuery(): string - { - return $this->query; - } - - public function getFragment(): string - { - return $this->fragment; - } - - public function withScheme($scheme): UriInterface - { - $scheme = $this->filterScheme($scheme); - - if ($this->scheme === $scheme) { - return $this; - } - - $new = clone $this; - $new->scheme = $scheme; - $new->composedComponents = null; - $new->removeDefaultPort(); - $new->validateState(); - - return $new; - } - - public function withUserInfo($user, $password = null): UriInterface - { - $info = $this->filterUserInfoComponent($user); - if ($password !== null) { - $info .= ':' . $this->filterUserInfoComponent($password); - } - - if ($this->userInfo === $info) { - return $this; - } - - $new = clone $this; - $new->userInfo = $info; - $new->composedComponents = null; - $new->validateState(); - - return $new; - } - - public function withHost($host): UriInterface - { - $host = $this->filterHost($host); - - if ($this->host === $host) { - return $this; - } - - $new = clone $this; - $new->host = $host; - $new->composedComponents = null; - $new->validateState(); - - return $new; - } - - public function withPort($port): UriInterface - { - $port = $this->filterPort($port); - - if ($this->port === $port) { - return $this; - } - - $new = clone $this; - $new->port = $port; - $new->composedComponents = null; - $new->removeDefaultPort(); - $new->validateState(); - - return $new; - } - - public function withPath($path): UriInterface - { - $path = $this->filterPath($path); - - if ($this->path === $path) { - return $this; - } - - $new = clone $this; - $new->path = $path; - $new->composedComponents = null; - $new->validateState(); - - return $new; - } - - public function withQuery($query): UriInterface - { - $query = $this->filterQueryAndFragment($query); - - if ($this->query === $query) { - return $this; - } - - $new = clone $this; - $new->query = $query; - $new->composedComponents = null; - - return $new; - } - - public function withFragment($fragment): UriInterface - { - $fragment = $this->filterQueryAndFragment($fragment); - - if ($this->fragment === $fragment) { - return $this; - } - - $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): void - { - $this->scheme = isset($parts['scheme']) - ? $this->filterScheme($parts['scheme']) - : ''; - $this->userInfo = isset($parts['user']) - ? $this->filterUserInfoComponent($parts['user']) - : ''; - $this->host = isset($parts['host']) - ? $this->filterHost($parts['host']) - : ''; - $this->port = isset($parts['port']) - ? $this->filterPort($parts['port']) - : null; - $this->path = isset($parts['path']) - ? $this->filterPath($parts['path']) - : ''; - $this->query = isset($parts['query']) - ? $this->filterQueryAndFragment($parts['query']) - : ''; - $this->fragment = isset($parts['fragment']) - ? $this->filterQueryAndFragment($parts['fragment']) - : ''; - if (isset($parts['pass'])) { - $this->userInfo .= ':' . $this->filterUserInfoComponent($parts['pass']); - } - - $this->removeDefaultPort(); - } - - /** - * @param mixed $scheme - * - * @throws \InvalidArgumentException If the scheme is invalid. - */ - private function filterScheme($scheme): string - { - if (!is_string($scheme)) { - throw new \InvalidArgumentException('Scheme must be a string'); - } - - return \strtr($scheme, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); - } - - /** - * @param mixed $component - * - * @throws \InvalidArgumentException If the user info is invalid. - */ - private function filterUserInfoComponent($component): string - { - if (!is_string($component)) { - throw new \InvalidArgumentException('User info must be a string'); - } - - return preg_replace_callback( - '/(?:[^%' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . ']+|%(?![A-Fa-f0-9]{2}))/', - [$this, 'rawurlencodeMatchZero'], - $component - ); - } - - /** - * @param mixed $host - * - * @throws \InvalidArgumentException If the host is invalid. - */ - private function filterHost($host): string - { - if (!is_string($host)) { - throw new \InvalidArgumentException('Host must be a string'); - } - - return \strtr($host, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); - } - - /** - * @param mixed $port - * - * @throws \InvalidArgumentException If the port is invalid. - */ - private function filterPort($port): ?int - { - if ($port === null) { - return null; - } - - $port = (int) $port; - if (0 > $port || 0xffff < $port) { - throw new \InvalidArgumentException( - sprintf('Invalid port: %d. Must be between 0 and 65535', $port) - ); - } - - return $port; - } - - /** - * @param string[] $keys - * - * @return string[] - */ - private static function getFilteredQueryString(UriInterface $uri, array $keys): array - { - $current = $uri->getQuery(); - - if ($current === '') { - return []; - } - - $decodedKeys = array_map('rawurldecode', $keys); - - return array_filter(explode('&', $current), function ($part) use ($decodedKeys) { - return !in_array(rawurldecode(explode('=', $part)[0]), $decodedKeys, true); - }); - } - - 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::QUERY_SEPARATORS_REPLACEMENT); - - if ($value !== null) { - $queryString .= '=' . strtr($value, self::QUERY_SEPARATORS_REPLACEMENT); - } - - return $queryString; - } - - private function removeDefaultPort(): void - { - if ($this->port !== null && self::isDefaultPort($this)) { - $this->port = null; - } - } - - /** - * Filters the path of a URI - * - * @param mixed $path - * - * @throws \InvalidArgumentException If the path is invalid. - */ - private function filterPath($path): string - { - if (!is_string($path)) { - throw new \InvalidArgumentException('Path must be a string'); - } - - return preg_replace_callback( - '/(?:[^' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . '%:@\/]++|%(?![A-Fa-f0-9]{2}))/', - [$this, 'rawurlencodeMatchZero'], - $path - ); - } - - /** - * Filters the query string or fragment of a URI. - * - * @param mixed $str - * - * @throws \InvalidArgumentException If the query or fragment is invalid. - */ - private function filterQueryAndFragment($str): string - { - if (!is_string($str)) { - throw new \InvalidArgumentException('Query and fragment must be a string'); - } - - return preg_replace_callback( - '/(?:[^' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . '%:@\/\?]++|%(?![A-Fa-f0-9]{2}))/', - [$this, 'rawurlencodeMatchZero'], - $str - ); - } - - private function rawurlencodeMatchZero(array $match): string - { - return rawurlencode($match[0]); - } - - private function validateState(): void - { - if ($this->host === '' && ($this->scheme === 'http' || $this->scheme === 'https')) { - $this->host = self::HTTP_DEFAULT_HOST; - } - - if ($this->getAuthority() === '') { - if (0 === strpos($this->path, '//')) { - 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 MalformedUriException('A relative URI must not have a path beginning with a segment containing a colon'); - } - } - } -} diff --git a/vendor/guzzlehttp/psr7/src/UriComparator.php b/vendor/guzzlehttp/psr7/src/UriComparator.php deleted file mode 100644 index 70c582aa..00000000 --- a/vendor/guzzlehttp/psr7/src/UriComparator.php +++ /dev/null @@ -1,52 +0,0 @@ -getHost(), $modified->getHost()) !== 0) { - return true; - } - - if ($original->getScheme() !== $modified->getScheme()) { - return true; - } - - if (self::computePort($original) !== self::computePort($modified)) { - return true; - } - - return false; - } - - private static function computePort(UriInterface $uri): int - { - $port = $uri->getPort(); - - if (null !== $port) { - return $port; - } - - return 'https' === $uri->getScheme() ? 443 : 80; - } - - private function __construct() - { - // cannot be instantiated - } -} diff --git a/vendor/guzzlehttp/psr7/src/UriNormalizer.php b/vendor/guzzlehttp/psr7/src/UriNormalizer.php deleted file mode 100644 index e12971ed..00000000 --- a/vendor/guzzlehttp/psr7/src/UriNormalizer.php +++ /dev/null @@ -1,220 +0,0 @@ -getPath() === '' && - ($uri->getScheme() === 'http' || $uri->getScheme() === 'https') - ) { - $uri = $uri->withPath('/'); - } - - if ($flags & self::REMOVE_DEFAULT_HOST && $uri->getScheme() === 'file' && $uri->getHost() === 'localhost') { - $uri = $uri->withHost(''); - } - - if ($flags & self::REMOVE_DEFAULT_PORT && $uri->getPort() !== null && Uri::isDefaultPort($uri)) { - $uri = $uri->withPort(null); - } - - if ($flags & self::REMOVE_DOT_SEGMENTS && !Uri::isRelativePathReference($uri)) { - $uri = $uri->withPath(UriResolver::removeDotSegments($uri->getPath())); - } - - if ($flags & self::REMOVE_DUPLICATE_SLASHES) { - $uri = $uri->withPath(preg_replace('#//++#', '/', $uri->getPath())); - } - - if ($flags & self::SORT_QUERY_PARAMETERS && $uri->getQuery() !== '') { - $queryKeyValues = explode('&', $uri->getQuery()); - sort($queryKeyValues); - $uri = $uri->withQuery(implode('&', $queryKeyValues)); - } - - return $uri; - } - - /** - * Whether two URIs can be considered equivalent. - * - * Both URIs are normalized automatically before comparison with the given $normalizations bitmask. The method also - * accepts relative URI references and returns true when they are equivalent. This of course assumes they will be - * resolved against the same base URI. If this is not the case, determination of equivalence or difference of - * relative references does not mean anything. - * - * @param UriInterface $uri1 An URI to compare - * @param UriInterface $uri2 An URI to compare - * @param int $normalizations A bitmask of normalizations to apply, see constants - * - * @link https://tools.ietf.org/html/rfc3986#section-6.1 - */ - public static function isEquivalent(UriInterface $uri1, UriInterface $uri2, int $normalizations = self::PRESERVING_NORMALIZATIONS): bool - { - return (string) self::normalize($uri1, $normalizations) === (string) self::normalize($uri2, $normalizations); - } - - private static function capitalizePercentEncoding(UriInterface $uri): UriInterface - { - $regex = '/(?:%[A-Fa-f0-9]{2})++/'; - - $callback = function (array $match) { - return strtoupper($match[0]); - }; - - return - $uri->withPath( - preg_replace_callback($regex, $callback, $uri->getPath()) - )->withQuery( - preg_replace_callback($regex, $callback, $uri->getQuery()) - ); - } - - private static function decodeUnreservedCharacters(UriInterface $uri): UriInterface - { - $regex = '/%(?:2D|2E|5F|7E|3[0-9]|[46][1-9A-F]|[57][0-9A])/i'; - - $callback = function (array $match) { - return rawurldecode($match[0]); - }; - - return - $uri->withPath( - preg_replace_callback($regex, $callback, $uri->getPath()) - )->withQuery( - preg_replace_callback($regex, $callback, $uri->getQuery()) - ); - } - - private function __construct() - { - // cannot be instantiated - } -} diff --git a/vendor/guzzlehttp/psr7/src/UriResolver.php b/vendor/guzzlehttp/psr7/src/UriResolver.php deleted file mode 100644 index 426e5c9a..00000000 --- a/vendor/guzzlehttp/psr7/src/UriResolver.php +++ /dev/null @@ -1,211 +0,0 @@ -getScheme() != '') { - return $rel->withPath(self::removeDotSegments($rel->getPath())); - } - - if ($rel->getAuthority() != '') { - $targetAuthority = $rel->getAuthority(); - $targetPath = self::removeDotSegments($rel->getPath()); - $targetQuery = $rel->getQuery(); - } else { - $targetAuthority = $base->getAuthority(); - if ($rel->getPath() === '') { - $targetPath = $base->getPath(); - $targetQuery = $rel->getQuery() != '' ? $rel->getQuery() : $base->getQuery(); - } else { - if ($rel->getPath()[0] === '/') { - $targetPath = $rel->getPath(); - } else { - if ($targetAuthority != '' && $base->getPath() === '') { - $targetPath = '/' . $rel->getPath(); - } else { - $lastSlashPos = strrpos($base->getPath(), '/'); - if ($lastSlashPos === false) { - $targetPath = $rel->getPath(); - } else { - $targetPath = substr($base->getPath(), 0, $lastSlashPos + 1) . $rel->getPath(); - } - } - } - $targetPath = self::removeDotSegments($targetPath); - $targetQuery = $rel->getQuery(); - } - } - - return new Uri(Uri::composeComponents( - $base->getScheme(), - $targetAuthority, - $targetPath, - $targetQuery, - $rel->getFragment() - )); - } - - /** - * Returns the target URI as a relative reference from the base URI. - * - * This method is the counterpart to resolve(): - * - * (string) $target === (string) UriResolver::resolve($base, UriResolver::relativize($base, $target)) - * - * One use-case is to use the current request URI as base URI and then generate relative links in your documents - * to reduce the document size or offer self-contained downloadable document archives. - * - * $base = new Uri('http://example.com/a/b/'); - * echo UriResolver::relativize($base, new Uri('http://example.com/a/b/c')); // prints 'c'. - * echo UriResolver::relativize($base, new Uri('http://example.com/a/x/y')); // prints '../x/y'. - * echo UriResolver::relativize($base, new Uri('http://example.com/a/b/?q')); // prints '?q'. - * echo UriResolver::relativize($base, new Uri('http://example.org/a/b/')); // prints '//example.org/a/b/'. - * - * This method also accepts a target that is already relative and will try to relativize it further. Only a - * relative-path reference will be returned as-is. - * - * echo UriResolver::relativize($base, new Uri('/a/b/c')); // prints 'c' as well - */ - public static function relativize(UriInterface $base, UriInterface $target): UriInterface - { - if ($target->getScheme() !== '' && - ($base->getScheme() !== $target->getScheme() || $target->getAuthority() === '' && $base->getAuthority() !== '') - ) { - return $target; - } - - if (Uri::isRelativePathReference($target)) { - // As the target is already highly relative we return it as-is. It would be possible to resolve - // the target with `$target = self::resolve($base, $target);` and then try make it more relative - // by removing a duplicate query. But let's not do that automatically. - return $target; - } - - if ($target->getAuthority() !== '' && $base->getAuthority() !== $target->getAuthority()) { - return $target->withScheme(''); - } - - // We must remove the path before removing the authority because if the path starts with two slashes, the URI - // would turn invalid. And we also cannot set a relative path before removing the authority, as that is also - // invalid. - $emptyPathUri = $target->withScheme('')->withPath('')->withUserInfo('')->withPort(null)->withHost(''); - - if ($base->getPath() !== $target->getPath()) { - return $emptyPathUri->withPath(self::getRelativePath($base, $target)); - } - - if ($base->getQuery() === $target->getQuery()) { - // Only the target fragment is left. And it must be returned even if base and target fragment are the same. - return $emptyPathUri->withQuery(''); - } - - // If the base URI has a query but the target has none, we cannot return an empty path reference as it would - // 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); - } - - return $emptyPathUri; - } - - private static function getRelativePath(UriInterface $base, UriInterface $target): string - { - $sourceSegments = explode('/', $base->getPath()); - $targetSegments = explode('/', $target->getPath()); - array_pop($sourceSegments); - $targetLastSegment = array_pop($targetSegments); - foreach ($sourceSegments as $i => $segment) { - if (isset($targetSegments[$i]) && $segment === $targetSegments[$i]) { - unset($sourceSegments[$i], $targetSegments[$i]); - } else { - break; - } - } - $targetSegments[] = $targetLastSegment; - $relativePath = str_repeat('../', count($sourceSegments)) . implode('/', $targetSegments); - - // A reference to am empty last segment or an empty first sub-segment must be prefixed with "./". - // This also applies to a segment with a colon character (e.g., "file:colon") that cannot be used - // as the first segment of a relative-path reference, as it would be mistaken for a scheme name. - if ('' === $relativePath || false !== strpos(explode('/', $relativePath, 2)[0], ':')) { - $relativePath = "./$relativePath"; - } elseif ('/' === $relativePath[0]) { - if ($base->getAuthority() != '' && $base->getPath() === '') { - // In this case an extra slash is added by resolve() automatically. So we must not add one here. - $relativePath = ".$relativePath"; - } else { - $relativePath = "./$relativePath"; - } - } - - return $relativePath; - } - - private function __construct() - { - // cannot be instantiated - } -} diff --git a/vendor/guzzlehttp/psr7/src/Utils.php b/vendor/guzzlehttp/psr7/src/Utils.php deleted file mode 100644 index 3a4cf394..00000000 --- a/vendor/guzzlehttp/psr7/src/Utils.php +++ /dev/null @@ -1,459 +0,0 @@ - $v) { - if (!is_string($k) || !in_array(strtolower($k), $keys)) { - $result[$k] = $v; - } - } - - return $result; - } - - /** - * Copy the contents of a stream into another stream until the given number - * of bytes have been read. - * - * @param StreamInterface $source Stream to read from - * @param StreamInterface $dest Stream to write to - * @param int $maxLen Maximum number of bytes to read. Pass -1 - * to read the entire stream. - * - * @throws \RuntimeException on error. - */ - public static function copyToStream(StreamInterface $source, StreamInterface $dest, int $maxLen = -1): void - { - $bufferSize = 8192; - - if ($maxLen === -1) { - while (!$source->eof()) { - if (!$dest->write($source->read($bufferSize))) { - break; - } - } - } else { - $remaining = $maxLen; - while ($remaining > 0 && !$source->eof()) { - $buf = $source->read(min($bufferSize, $remaining)); - $len = strlen($buf); - if (!$len) { - break; - } - $remaining -= $len; - $dest->write($buf); - } - } - } - - /** - * Copy the contents of a stream into a string until the given number of - * bytes have been read. - * - * @param StreamInterface $stream Stream to read - * @param int $maxLen Maximum number of bytes to read. Pass -1 - * to read the entire stream. - * - * @throws \RuntimeException on error. - */ - public static function copyToString(StreamInterface $stream, int $maxLen = -1): string - { - $buffer = ''; - - if ($maxLen === -1) { - while (!$stream->eof()) { - $buf = $stream->read(1048576); - if ($buf === '') { - break; - } - $buffer .= $buf; - } - return $buffer; - } - - $len = 0; - while (!$stream->eof() && $len < $maxLen) { - $buf = $stream->read($maxLen - $len); - if ($buf === '') { - break; - } - $buffer .= $buf; - $len = strlen($buffer); - } - - return $buffer; - } - - /** - * Calculate a hash of a stream. - * - * This method reads the entire stream to calculate a rolling hash, based - * on PHP's `hash_init` functions. - * - * @param StreamInterface $stream Stream to calculate the hash for - * @param string $algo Hash algorithm (e.g. md5, crc32, etc) - * @param bool $rawOutput Whether or not to use raw output - * - * @throws \RuntimeException on error. - */ - public static function hash(StreamInterface $stream, string $algo, bool $rawOutput = false): string - { - $pos = $stream->tell(); - - if ($pos > 0) { - $stream->rewind(); - } - - $ctx = hash_init($algo); - while (!$stream->eof()) { - hash_update($ctx, $stream->read(1048576)); - } - - $out = hash_final($ctx, $rawOutput); - $stream->seek($pos); - - return $out; - } - - /** - * Clone and modify a request with the given changes. - * - * This method is useful for reducing the number of clones needed to mutate - * a message. - * - * The changes can be one of: - * - method: (string) Changes the HTTP method. - * - set_headers: (array) Sets the given headers. - * - remove_headers: (array) Remove the given headers. - * - body: (mixed) Sets the given body. - * - uri: (UriInterface) Set the URI. - * - query: (string) Set the query string value of the URI. - * - version: (string) Set the protocol version. - * - * @param RequestInterface $request Request to clone and modify. - * @param array $changes Changes to apply. - */ - public static function modifyRequest(RequestInterface $request, array $changes): RequestInterface - { - if (!$changes) { - return $request; - } - - $headers = $request->getHeaders(); - - if (!isset($changes['uri'])) { - $uri = $request->getUri(); - } else { - // Remove the host header if one is on the URI - if ($host = $changes['uri']->getHost()) { - $changes['set_headers']['Host'] = $host; - - if ($port = $changes['uri']->getPort()) { - $standardPorts = ['http' => 80, 'https' => 443]; - $scheme = $changes['uri']->getScheme(); - if (isset($standardPorts[$scheme]) && $port != $standardPorts[$scheme]) { - $changes['set_headers']['Host'] .= ':' . $port; - } - } - } - $uri = $changes['uri']; - } - - if (!empty($changes['remove_headers'])) { - $headers = self::caselessRemove($changes['remove_headers'], $headers); - } - - if (!empty($changes['set_headers'])) { - $headers = self::caselessRemove(array_keys($changes['set_headers']), $headers); - $headers = $changes['set_headers'] + $headers; - } - - if (isset($changes['query'])) { - $uri = $uri->withQuery($changes['query']); - } - - if ($request instanceof ServerRequestInterface) { - $new = (new ServerRequest( - $changes['method'] ?? $request->getMethod(), - $uri, - $headers, - $changes['body'] ?? $request->getBody(), - $changes['version'] ?? $request->getProtocolVersion(), - $request->getServerParams() - )) - ->withParsedBody($request->getParsedBody()) - ->withQueryParams($request->getQueryParams()) - ->withCookieParams($request->getCookieParams()) - ->withUploadedFiles($request->getUploadedFiles()); - - foreach ($request->getAttributes() as $key => $value) { - $new = $new->withAttribute($key, $value); - } - - return $new; - } - - return new Request( - $changes['method'] ?? $request->getMethod(), - $uri, - $headers, - $changes['body'] ?? $request->getBody(), - $changes['version'] ?? $request->getProtocolVersion() - ); - } - - /** - * Read a line from the stream up to the maximum allowed buffer length. - * - * @param StreamInterface $stream Stream to read from - * @param int|null $maxLength Maximum buffer length - */ - public static function readLine(StreamInterface $stream, ?int $maxLength = null): string - { - $buffer = ''; - $size = 0; - - while (!$stream->eof()) { - if ('' === ($byte = $stream->read(1))) { - return $buffer; - } - $buffer .= $byte; - // Break when a new line is found or the max length - 1 is reached - if ($byte === "\n" || ++$size === $maxLength - 1) { - break; - } - } - - return $buffer; - } - - /** - * Create a new stream based on the input type. - * - * Options is an associative array that can contain the following keys: - * - metadata: Array of custom metadata. - * - size: Size of the stream. - * - * This method accepts the following `$resource` types: - * - `Psr\Http\Message\StreamInterface`: Returns the value as-is. - * - `string`: Creates a stream object that uses the given string as the contents. - * - `resource`: Creates a stream object that wraps the given PHP stream resource. - * - `Iterator`: If the provided value implements `Iterator`, then a read-only - * stream object will be created that wraps the given iterable. Each time the - * stream is read from, data from the iterator will fill a buffer and will be - * continuously called until the buffer is equal to the requested read size. - * Subsequent read calls will first read from the buffer and then call `next` - * on the underlying iterator until it is exhausted. - * - `object` with `__toString()`: If the object has the `__toString()` method, - * the object will be cast to a string and then a stream will be returned that - * uses the string value. - * - `NULL`: When `null` is passed, an empty stream object is returned. - * - `callable` When a callable is passed, a read-only stream object will be - * created that invokes the given callable. The callable is invoked with the - * number of suggested bytes to read. The callable can return any number of - * bytes, but MUST return `false` when there is no more data to return. The - * stream object that wraps the callable will invoke the callable until the - * number of requested bytes are available. Any additional bytes will be - * buffered and used in subsequent reads. - * - * @param resource|string|int|float|bool|StreamInterface|callable|\Iterator|null $resource Entity body data - * @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 = []): StreamInterface - { - if (is_scalar($resource)) { - $stream = self::tryFopen('php://temp', 'r+'); - if ($resource !== '') { - fwrite($stream, (string) $resource); - fseek($stream, 0); - } - return new Stream($stream, $options); - } - - switch (gettype($resource)) { - case 'resource': - /* - * The 'php://input' is a special stream with quirks and inconsistencies. - * We avoid using that stream by reading it into php://temp - */ - - /** @var resource $resource */ - if ((\stream_get_meta_data($resource)['uri'] ?? '') === 'php://input') { - $stream = self::tryFopen('php://temp', 'w+'); - 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) { - return new PumpStream(function () use ($resource) { - if (!$resource->valid()) { - return false; - } - $result = $resource->current(); - $resource->next(); - return $result; - }, $options); - } elseif (method_exists($resource, '__toString')) { - return self::streamFor((string) $resource, $options); - } - break; - case 'NULL': - return new Stream(self::tryFopen('php://temp', 'r+'), $options); - } - - if (is_callable($resource)) { - return new PumpStream($resource, $options); - } - - throw new \InvalidArgumentException('Invalid resource type: ' . gettype($resource)); - } - - /** - * Safely opens a PHP stream resource using a filename. - * - * When fopen fails, PHP normally raises a warning. This function adds an - * error handler that checks for errors and throws an exception instead. - * - * @param string $filename File to open - * @param string $mode Mode used to open the file - * - * @return resource - * - * @throws \RuntimeException if the file cannot be opened - */ - public static function tryFopen(string $filename, string $mode) - { - $ex = null; - 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, - $errstr - )); - - return true; - }); - - try { - /** @var resource $handle */ - $handle = fopen($filename, $mode); - } catch (\Throwable $e) { - $ex = new \RuntimeException(sprintf( - 'Unable to open "%s" using mode "%s": %s', - $filename, - $mode, - $e->getMessage() - ), 0, $e); - } - - restore_error_handler(); - - if ($ex) { - /** @var $ex \RuntimeException */ - throw $ex; - } - - 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. - * - * This function accepts a string or UriInterface and returns a - * UriInterface for the given value. If the value is already a - * UriInterface, it is returned as-is. - * - * @param string|UriInterface $uri - * - * @throws \InvalidArgumentException - */ - public static function uriFor($uri): UriInterface - { - if ($uri instanceof UriInterface) { - return $uri; - } - - if (is_string($uri)) { - return new Uri($uri); - } - - throw new \InvalidArgumentException('URI must be a string or UriInterface'); - } -} diff --git a/vendor/hamcrest/hamcrest-php/.coveralls.yml b/vendor/hamcrest/hamcrest-php/.coveralls.yml deleted file mode 100644 index f2f9ed58..00000000 --- a/vendor/hamcrest/hamcrest-php/.coveralls.yml +++ /dev/null @@ -1 +0,0 @@ -src_dir: hamcrest diff --git a/vendor/hamcrest/hamcrest-php/.github/workflows/tests.yml b/vendor/hamcrest/hamcrest-php/.github/workflows/tests.yml deleted file mode 100644 index 06255a1b..00000000 --- a/vendor/hamcrest/hamcrest-php/.github/workflows/tests.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: tests - -on: - push: - pull_request: - -jobs: - tests: - - runs-on: ubuntu-latest - strategy: - matrix: - php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0'] - - name: PHP ${{ matrix.php }} - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: curl - tools: composer:v2 - coverage: none - - - name: Install PHP 7 dependencies - run: composer update --prefer-dist --no-interaction --no-progress - if: "matrix.php != '8.0'" - - - name: Install PHP 8 dependencies - run: composer update --prefer-dist --no-interaction --no-progress --ignore-platform-reqs - if: "matrix.php == '8.0'" - - - name: Execute tests - run: vendor/bin/phpunit -c tests/phpunit.xml.dist diff --git a/vendor/hamcrest/hamcrest-php/.gitignore b/vendor/hamcrest/hamcrest-php/.gitignore deleted file mode 100644 index 987e2a25..00000000 --- a/vendor/hamcrest/hamcrest-php/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -composer.lock -vendor diff --git a/vendor/hamcrest/hamcrest-php/.gush.yml b/vendor/hamcrest/hamcrest-php/.gush.yml deleted file mode 100644 index b7c226d5..00000000 --- a/vendor/hamcrest/hamcrest-php/.gush.yml +++ /dev/null @@ -1,7 +0,0 @@ -adapter: github -issue_tracker: github -meta-header: "Copyright (c) 2009-2015 hamcrest.org" -table-pr: - fixed_tickets: ['Fixed Tickets', ''] - license: ['License', MIT] -base: master diff --git a/vendor/hamcrest/hamcrest-php/.travis.yml b/vendor/hamcrest/hamcrest-php/.travis.yml deleted file mode 100644 index 3b5651fa..00000000 --- a/vendor/hamcrest/hamcrest-php/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: php - -dist: trusty - -matrix: - include: - - name: PHP 5.3 - php: 5.3 - dist: precise - - name: PHP 5.4 - php: 5.4 - - name: PHP 5.5 - php: 5.5 - - name: PHP 5.6 - php: 5.6 - - name: HHVM 3.18 - php: hhvm-3.18 - -install: - - travis_retry composer update --prefer-dist --no-progress - -script: - - vendor/bin/phpunit -c tests/phpunit.xml.dist diff --git a/vendor/hamcrest/hamcrest-php/CHANGES.txt b/vendor/hamcrest/hamcrest-php/CHANGES.txt deleted file mode 100644 index bad8bcfe..00000000 --- a/vendor/hamcrest/hamcrest-php/CHANGES.txt +++ /dev/null @@ -1,173 +0,0 @@ -== Version 2.0.1: Released Jul 09 2020 == - -* Added support for PHP 8 - - -== Version 2.0: Released Feb 26 2016 == - -* Removed automatic loading of global functions - - -== Version 1.1.0: Released Feb 2 2012 == - -Issues Fixed: 121, 138, 147 - -* Added non-empty matchers to complement the emptiness-matching forms. - - - nonEmptyString() - - nonEmptyArray() - - nonEmptyTraversable() - -* Added ability to pass variable arguments to several array-based matcher - factory methods so they work like allOf() et al. - - - anArray() - - arrayContainingInAnyOrder(), containsInAnyOrder() - - arrayContaining(), contains() - - stringContainsInOrder() - -* Matchers that accept an array of matchers now also accept variable arguments. - Any non-matcher arguments are wrapped by IsEqual. - -* Added noneOf() as a shortcut for not(anyOf()). - - -== Version 1.0.0: Released Jan 20 2012 == - -Issues Fixed: 119, 136, 139, 141, 148, 149, 172 - -* Moved hamcrest.php into Hamcrest folder and renamed to Hamcrest.php. - This is more in line with PEAR packaging standards. - -* Renamed callable() to callableValue() for compatibility with PHP 5.4. - -* Added Hamcrest_Text_StringContainsIgnoringCase to assert using stripos(). - - assertThat('fOObAr', containsStringIgnoringCase('oba')); - assertThat('fOObAr', containsString('oba')->ignoringCase()); - -* Fixed Hamcrest_Core_IsInstanceOf to return false for native types. - -* Moved string-based matchers to Hamcrest_Text package. - StringContains, StringEndsWith, StringStartsWith, and SubstringMatcher - -* Hamcrest.php and Hamcrest_Matchers.php are now built from @factory doctags. - Added @factory doctag to every static factory method. - -* Hamcrest_Matchers and Hamcrest.php now import each matcher as-needed - and Hamcrest.php calls the matchers directly instead of Hamcrest_Matchers. - - -== Version 0.3.0: Released Jul 26 2010 == - -* Added running count to Hamcrest_MatcherAssert with methods to get and reset it. - This can be used by unit testing frameworks for reporting. - -* Added Hamcrest_Core_HasToString to assert return value of toString() or __toString(). - - assertThat($anObject, hasToString('foo')); - -* Added Hamcrest_Type_IsScalar to assert is_scalar(). - Matches values of type bool, int, float, double, and string. - - assertThat($count, scalarValue()); - assertThat('foo', scalarValue()); - -* Added Hamcrest_Collection package. - - - IsEmptyTraversable - - IsTraversableWithSize - - assertThat($iterator, emptyTraversable()); - assertThat($iterator, traversableWithSize(5)); - -* Added Hamcrest_Xml_HasXPath to assert XPath expressions or the content of nodes in an XML/HTML DOM. - - assertThat($dom, hasXPath('books/book/title')); - assertThat($dom, hasXPath('books/book[contains(title, "Alice")]', 3)); - assertThat($dom, hasXPath('books/book/title', 'Alice in Wonderland')); - assertThat($dom, hasXPath('count(books/book)', greaterThan(10))); - -* Added aliases to match the Java API. - - hasEntry() -> hasKeyValuePair() - hasValue() -> hasItemInArray() - contains() -> arrayContaining() - containsInAnyOrder() -> arrayContainingInAnyOrder() - -* Added optional subtype to Hamcrest_TypeSafeMatcher to enforce object class or resource type. - -* Hamcrest_TypeSafeDiagnosingMatcher now extends Hamcrest_TypeSafeMatcher. - - -== Version 0.2.0: Released Jul 14 2010 == - -Issues Fixed: 109, 111, 114, 115 - -* Description::appendValues() and appendValueList() accept Iterator and IteratorAggregate. [111] - BaseDescription::appendValue() handles IteratorAggregate. - -* assertThat() accepts a single boolean parameter and - wraps any non-Matcher third parameter with equalTo(). - -* Removed null return value from assertThat(). [114] - -* Fixed wrong variable name in contains(). [109] - -* Added Hamcrest_Core_IsSet to assert isset(). - - assertThat(array('foo' => 'bar'), set('foo')); - assertThat(array('foo' => 'bar'), notSet('bar')); - -* Added Hamcrest_Core_IsTypeOf to assert built-in types with gettype(). [115] - Types: array, boolean, double, integer, null, object, resource, and string. - Note that gettype() returns "double" for float values. - - assertThat($count, typeOf('integer')); - assertThat(3.14159, typeOf('double')); - assertThat(array('foo', 'bar'), typeOf('array')); - assertThat(new stdClass(), typeOf('object')); - -* Added type-specific matchers in new Hamcrest_Type package. - - - IsArray - - IsBoolean - - IsDouble (includes float values) - - IsInteger - - IsObject - - IsResource - - IsString - - assertThat($count, integerValue()); - assertThat(3.14159, floatValue()); - assertThat('foo', stringValue()); - -* Added Hamcrest_Type_IsNumeric to assert is_numeric(). - Matches values of type int and float/double or strings that are formatted as numbers. - - assertThat(5, numericValue()); - assertThat('-5e+3', numericValue()); - -* Added Hamcrest_Type_IsCallable to assert is_callable(). - - assertThat('preg_match', callable()); - assertThat(array('SomeClass', 'SomeMethod'), callable()); - assertThat(array($object, 'SomeMethod'), callable()); - assertThat($object, callable()); - assertThat(function ($x, $y) { return $x + $y; }, callable()); - -* Added Hamcrest_Text_MatchesPattern for regex matching with preg_match(). - - assertThat('foobar', matchesPattern('/o+b/')); - -* Added aliases: - - atLeast() for greaterThanOrEqualTo() - - atMost() for lessThanOrEqualTo() - - -== Version 0.1.0: Released Jul 7 2010 == - -* Created PEAR package - -* Core matchers - diff --git a/vendor/hamcrest/hamcrest-php/LICENSE.txt b/vendor/hamcrest/hamcrest-php/LICENSE.txt deleted file mode 100644 index 91cd329a..00000000 --- a/vendor/hamcrest/hamcrest-php/LICENSE.txt +++ /dev/null @@ -1,27 +0,0 @@ -BSD License - -Copyright (c) 2000-2014, www.hamcrest.org -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 Hamcrest nor the names of its 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/hamcrest/hamcrest-php/README.md b/vendor/hamcrest/hamcrest-php/README.md deleted file mode 100644 index 52e20413..00000000 --- a/vendor/hamcrest/hamcrest-php/README.md +++ /dev/null @@ -1,488 +0,0 @@ -This is the PHP port of Hamcrest Matchers -========================================= - -[![Build Status](https://travis-ci.org/hamcrest/hamcrest-php.png?branch=master)](https://travis-ci.org/hamcrest/hamcrest-php) - -Hamcrest is a matching library originally written for Java, but -subsequently ported to many other languages. hamcrest-php is the -official PHP port of Hamcrest and essentially follows a literal -translation of the original Java API for Hamcrest, with a few -Exceptions, mostly down to PHP language barriers: - - 1. `instanceOf($theClass)` is actually `anInstanceOf($theClass)` - - 2. `both(containsString('a'))->and(containsString('b'))` - is actually `both(containsString('a'))->andAlso(containsString('b'))` - - 3. `either(containsString('a'))->or(containsString('b'))` - is actually `either(containsString('a'))->orElse(containsString('b'))` - - 4. Unless it would be non-semantic for a matcher to do so, hamcrest-php - allows dynamic typing for it's input, in "the PHP way". Exception are - where semantics surrounding the type itself would suggest otherwise, - such as stringContains() and greaterThan(). - - 5. Several official matchers have not been ported because they don't - make sense or don't apply in PHP: - - - `typeCompatibleWith($theClass)` - - `eventFrom($source)` - - `hasProperty($name)` ** - - `samePropertyValuesAs($obj)` ** - - 6. When most of the collections matchers are finally ported, PHP-specific - aliases will probably be created due to a difference in naming - conventions between Java's Arrays, Collections, Sets and Maps compared - with PHP's Arrays. - ---- -** [Unless we consider POPO's (Plain Old PHP Objects) akin to JavaBeans] - - The POPO thing is a joke. Java devs coin the term POJO's (Plain Old - Java Objects). - - -Usage ------ - -Hamcrest matchers are easy to use as: - -```php -Hamcrest_MatcherAssert::assertThat('a', Hamcrest_Matchers::equalToIgnoringCase('A')); -``` - -Alternatively, you can use the global proxy-functions: - -```php -$result = true; -// with an identifier -assertThat("result should be true", $result, equalTo(true)); - -// without an identifier -assertThat($result, equalTo(true)); - -// evaluate a boolean expression -assertThat($result === true); - -// with syntactic sugar is() -assertThat(true, is(true)); -``` - -:warning: **NOTE:** the global proxy-functions aren't autoloaded by default, so you will need to load them first: - -```php -\Hamcrest\Util::registerGlobalFunctions(); -``` - -For brevity, all of the examples below use the proxy-functions. - - -Documentation -------------- -A tutorial can be found on the [Hamcrest site](https://code.google.com/archive/p/hamcrest/wikis/TutorialPHP.wiki). - - -Available Matchers ------------------- -* [Array](../master/README.md#array) -* [Collection](../master/README.md#collection) -* [Object](../master/README.md#object) -* [Numbers](../master/README.md#numbers) -* [Type checking](../master/README.md#type-checking) -* [XML](../master/README.md#xml) - - -### Array - -* `anArray` - evaluates an array -```php -assertThat([], anArray()); -``` - -* `hasItemInArray` - check if item exists in array -```php -$list = range(2, 7, 2); -$item = 4; -assertThat($list, hasItemInArray($item)); -``` - -* `hasValue` - alias of hasItemInArray - -* `arrayContainingInAnyOrder` - check if array contains elements in any order -```php -assertThat([2, 4, 6], arrayContainingInAnyOrder([6, 4, 2])); -assertThat([2, 4, 6], arrayContainingInAnyOrder([4, 2, 6])); -``` - -* `containsInAnyOrder` - alias of arrayContainingInAnyOrder - -* `arrayContaining` - An array with elements that match the given matchers in the same order. -```php -assertThat([2, 4, 6], arrayContaining([2, 4, 6])); -assertthat([2, 4, 6], not(arrayContaining([6, 4, 2]))); -``` - -* `contains` - check array in same order -```php -assertThat([2, 4, 6], contains([2, 4, 6])); -``` - -* `hasKeyInArray` - check if array has given key -```php -assertThat(['name'=> 'foobar'], hasKeyInArray('name')); -``` - -* `hasKey` - alias of hasKeyInArray - -* `hasKeyValuePair` - check if arary has given key, value pair -```php -assertThat(['name'=> 'foobar'], hasKeyValuePair('name', 'foobar')); -``` -* `hasEntry` - same as hasKeyValuePair - -* `arrayWithSize` - check array has given size -```php -assertthat([2, 4, 6], arrayWithSize(3)); -``` -* `emptyArray` - check if array is emtpy -```php -assertThat([], emptyArray()); -``` - -* `nonEmptyArray` -```php -assertThat([1], nonEmptyArray()); -``` - -### Collection - -* `emptyTraversable` - check if traversable is empty -```php -$empty_it = new EmptyIterator; -assertThat($empty_it, emptyTraversable()); -``` - -* `nonEmptyTraversable` - check if traversable isn't empty -```php -$non_empty_it = new ArrayIterator(range(1, 10)); -assertThat($non_empty_it, nonEmptyTraversable()); -a -``` - -* `traversableWithSize` -```php -$non_empty_it = new ArrayIterator(range(1, 10)); -assertThat($non_empty_it, traversableWithSize(count(range(1, 10)))); -` -``` - -### Core - -* `allOf` - Evaluates to true only if ALL of the passed in matchers evaluate to true. -```php -assertThat([2,4,6], allOf(hasValue(2), arrayWithSize(3))); -``` - -* `anyOf` - Evaluates to true if ANY of the passed in matchers evaluate to true. -```php -assertThat([2, 4, 6], anyOf(hasValue(8), hasValue(2))); -``` - -* `noneOf` - Evaluates to false if ANY of the passed in matchers evaluate to true. -```php -assertThat([2, 4, 6], noneOf(hasValue(1), hasValue(3))); -``` - -* `both` + `andAlso` - This is useful for fluently combining matchers that must both pass. -```php -assertThat([2, 4, 6], both(hasValue(2))->andAlso(hasValue(4))); -``` - -* `either` + `orElse` - This is useful for fluently combining matchers where either may pass, -```php -assertThat([2, 4, 6], either(hasValue(2))->orElse(hasValue(4))); -``` - -* `describedAs` - Wraps an existing matcher and overrides the description when it fails. -```php -$expected = "Dog"; -$found = null; -// this assertion would result error message as Expected: is not null but: was null -//assertThat("Expected {$expected}, got {$found}", $found, is(notNullValue())); -// and this assertion would result error message as Expected: Dog but: was null -//assertThat($found, describedAs($expected, notNullValue())); -``` - -* `everyItem` - A matcher to apply to every element in an array. -```php -assertThat([2, 4, 6], everyItem(notNullValue())); -``` - -* `hasItem` - check array has given item, it can take a matcher argument -```php -assertThat([2, 4, 6], hasItem(equalTo(2))); -``` - -* `hasItems` - check array has givem items, it can take multiple matcher as arguments -```php -assertThat([1, 3, 5], hasItems(equalTo(1), equalTo(3))); -``` - -### Object - -* `hasToString` - check `__toString` or `toString` method -```php -class Foo { - public $name = null; - - public function __toString() { - return "[Foo]Instance"; - } -} -$foo = new Foo; -assertThat($foo, hasToString(equalTo("[Foo]Instance"))); -``` - -* `equalTo` - compares two instances using comparison operator '==' -```php -$foo = new Foo; -$foo2 = new Foo; -assertThat($foo, equalTo($foo2)); -``` - -* `identicalTo` - compares two instances using identity operator '===' -```php -assertThat($foo, is(not(identicalTo($foo2)))); -``` - -* `anInstanceOf` - check instance is an instance|sub-class of given class -```php -assertThat($foo, anInstanceOf(Foo::class)); -``` - -* `any` - alias of `anInstanceOf` - -* `nullValue` check null -```php -assertThat(null, is(nullValue())); -``` - -* `notNullValue` check not null -```php -assertThat("", notNullValue()); -``` - -* `sameInstance` - check for same instance -```php -assertThat($foo, is(not(sameInstance($foo2)))); -assertThat($foo, is(sameInstance($foo))); -``` - -* `typeOf`- check type -```php -assertThat(1, typeOf("integer")); -``` - -* `notSet` - check if instance property is not set -```php -assertThat($foo, notSet("name")); -``` - -* `set` - check if instance property is set -```php -$foo->name = "bar"; -assertThat($foo, set("name")); -``` - -### Numbers - -* `closeTo` - check value close to a range -```php -assertThat(3, closeTo(3, 0.5)); -``` - -* `comparesEqualTo` - check with '==' -```php -assertThat(2, comparesEqualTo(2)); -``` - -* `greaterThan` - check '>' -``` -assertThat(2, greaterThan(1)); -``` - -* `greaterThanOrEqualTo` -```php -assertThat(2, greaterThanOrEqualTo(2)); -``` - -* `atLeast` - The value is >= given value -```php -assertThat(3, atLeast(2)); -``` -* `lessThan` -```php -assertThat(2, lessThan(3)); -``` - -* `lessThanOrEqualTo` -```php -assertThat(2, lessThanOrEqualTo(3)); -``` - -* `atMost` - The value is <= given value -```php -assertThat(2, atMost(3)); -``` - -### String - -* `emptyString` - check for empty string -```php -assertThat("", emptyString()); -``` - -* `isEmptyOrNullString` -```php -assertThat(null, isEmptyOrNullString()); -``` - -* `nullOrEmptyString` -```php -assertThat("", nullOrEmptyString()); -``` - -* `isNonEmptyString` -```php -assertThat("foo", isNonEmptyString()); -``` - -* `nonEmptyString` -```php -assertThat("foo", nonEmptyString()); -``` - -* `equalToIgnoringCase` -```php -assertThat("Foo", equalToIgnoringCase("foo")); -``` -* `equalToIgnoringWhiteSpace` -```php -assertThat(" Foo ", equalToIgnoringWhiteSpace("Foo")); -``` - -* `matchesPattern` - matches with regex pattern -```php -assertThat("foobarbaz", matchesPattern('/(foo)(bar)(baz)/')); -``` - -* `containsString` - check for substring -```php -assertThat("foobar", containsString("foo")); -``` - -* `containsStringIgnoringCase` -```php -assertThat("fooBar", containsStringIgnoringCase("bar")); -``` - -* `stringContainsInOrder` -```php -assertThat("foo", stringContainsInOrder("foo")); -``` - -* `endsWith` - check string that ends with given value -```php -assertThat("foo", endsWith("oo")); -``` - -* `startsWith` - check string that starts with given value -```php -assertThat("bar", startsWith("ba")); -``` - -### Type-checking - -* `arrayValue` - check array type -```php -assertThat([], arrayValue()); -``` - -* `booleanValue` -```php -assertThat(true, booleanValue()); -``` -* `boolValue` - alias of booleanValue - -* `callableValue` - check if value is callable -```php -$func = function () {}; -assertThat($func, callableValue()); -``` -* `doubleValue` -```php -assertThat(3.14, doubleValue()); -``` - -* `floatValue` -```php -assertThat(3.14, floatValue()); -``` - -* `integerValue` -```php -assertThat(1, integerValue()); -``` - -* `intValue` - alias of `integerValue` - -* `numericValue` - check if value is numeric -```php -assertThat("123", numericValue()); -``` - -* `objectValue` - check for object -```php -$obj = new stdClass; -assertThat($obj, objectValue()); -``` -* `anObject` -```php -assertThat($obj, anObject()); -``` - -* `resourceValue` - check resource type -```php -$fp = fopen("/tmp/foo", "w+"); -assertThat($fp, resourceValue()); -``` - -* `scalarValue` - check for scaler value -```php -assertThat(1, scalarValue()); -``` - -* `stringValue` -```php -assertThat("", stringValue()); -``` - -### XML - -* `hasXPath` - check xml with a xpath -```php -$xml = << - - 1 - - - 2 - - -XML; - -$doc = new DOMDocument; -$doc->loadXML($xml); -assertThat($doc, hasXPath("book", 2)); -``` - diff --git a/vendor/hamcrest/hamcrest-php/composer.json b/vendor/hamcrest/hamcrest-php/composer.json deleted file mode 100644 index 712ad965..00000000 --- a/vendor/hamcrest/hamcrest-php/composer.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "hamcrest/hamcrest-php", - "type": "library", - "description": "This is the PHP port of Hamcrest Matchers", - "keywords": ["test"], - "license": "BSD-3-Clause", - "authors": [ - ], - - "autoload": { - "classmap": ["hamcrest"] - }, - "autoload-dev": { - "classmap": ["tests", "generator"] - }, - - "require": { - "php": "^5.3|^7.0|^8.0" - }, - - "require-dev": { - "phpunit/php-file-iterator": "^1.4 || ^2.0", - "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0" - }, - - "replace": { - "kodova/hamcrest-php": "*", - "davedevelopment/hamcrest-php": "*", - "cordoval/hamcrest-php": "*" - }, - - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - } -} diff --git a/vendor/hamcrest/hamcrest-php/generator/FactoryCall.php b/vendor/hamcrest/hamcrest-php/generator/FactoryCall.php deleted file mode 100644 index 83965b2a..00000000 --- a/vendor/hamcrest/hamcrest-php/generator/FactoryCall.php +++ /dev/null @@ -1,41 +0,0 @@ -method = $method; - $this->name = $name; - } - - public function getMethod() - { - return $this->method; - } - - public function getName() - { - return $this->name; - } -} diff --git a/vendor/hamcrest/hamcrest-php/generator/FactoryClass.php b/vendor/hamcrest/hamcrest-php/generator/FactoryClass.php deleted file mode 100644 index a09cb73c..00000000 --- a/vendor/hamcrest/hamcrest-php/generator/FactoryClass.php +++ /dev/null @@ -1,71 +0,0 @@ -file = $file; - $this->reflector = $class; - $this->extractFactoryMethods(); - } - - public function extractFactoryMethods() - { - $this->methods = array(); - foreach ($this->getPublicStaticMethods() as $method) { - if ($method->isFactory()) { - $this->methods[] = $method; - } - } - } - - public function getPublicStaticMethods() - { - $methods = array(); - foreach ($this->reflector->getMethods(ReflectionMethod::IS_STATIC) as $method) { - if ($method->isPublic() && $method->getDeclaringClass() == $this->reflector) { - $methods[] = new FactoryMethod($this, $method); - } - } - return $methods; - } - - public function getFile() - { - return $this->file; - } - - public function getName() - { - return $this->reflector->name; - } - - public function isFactory() - { - return !empty($this->methods); - } - - public function getMethods() - { - return $this->methods; - } -} diff --git a/vendor/hamcrest/hamcrest-php/generator/FactoryFile.php b/vendor/hamcrest/hamcrest-php/generator/FactoryFile.php deleted file mode 100644 index dd6109b1..00000000 --- a/vendor/hamcrest/hamcrest-php/generator/FactoryFile.php +++ /dev/null @@ -1,121 +0,0 @@ -file = $file; - $this->indent = $indent; - } - - abstract public function addCall(FactoryCall $call); - - abstract public function build(); - - public function addFileHeader() - { - $this->code = ''; - $this->addPart('file_header'); - } - - public function addPart($name) - { - $this->addCode($this->readPart($name)); - } - - public function addCode($code) - { - $this->code .= $code; - } - - public function readPart($name) - { - return file_get_contents(__DIR__ . "/parts/$name.txt"); - } - - public function generateFactoryCall(FactoryCall $call) - { - $method = $call->getMethod(); - $code = $method->getComment($this->indent) . "\n"; - $code .= $this->generateDeclaration($call->getName(), $method); - $code .= $this->generateCall($method); - $code .= $this->generateClosing(); - return $code; - } - - public function generateDeclaration($name, FactoryMethod $method) - { - $code = $this->indent . $this->getDeclarationModifiers() - . 'function ' . $name . '(' - . $this->generateDeclarationArguments($method) - . ')' . "\n" . $this->indent . '{' . "\n"; - return $code; - } - - public function getDeclarationModifiers() - { - return ''; - } - - public function generateDeclarationArguments(FactoryMethod $method) - { - if ($method->acceptsVariableArguments()) { - return '/* args... */'; - } else { - return $method->getParameterDeclarations(); - } - } - - public function generateImport(FactoryMethod $method) - { - return $this->indent . self::INDENT . "require_once '" . $method->getClass()->getFile() . "';" . "\n"; - } - - public function generateCall(FactoryMethod $method) - { - $code = ''; - if ($method->acceptsVariableArguments()) { - $code .= $this->indent . self::INDENT . '$args = func_get_args();' . "\n"; - } - - $code .= $this->indent . self::INDENT . 'return '; - if ($method->acceptsVariableArguments()) { - $code .= 'call_user_func_array(array(\'' - . '\\' . $method->getClassName() . '\', \'' - . $method->getName() . '\'), $args);' . "\n"; - } else { - $code .= '\\' . $method->getClassName() . '::' - . $method->getName() . '(' - . $method->getParameterInvocations() . ');' . "\n"; - } - - return $code; - } - - public function generateClosing() - { - return $this->indent . '}' . "\n"; - } - - public function write() - { - file_put_contents($this->file, $this->code); - } -} diff --git a/vendor/hamcrest/hamcrest-php/generator/FactoryGenerator.php b/vendor/hamcrest/hamcrest-php/generator/FactoryGenerator.php deleted file mode 100644 index 242875a0..00000000 --- a/vendor/hamcrest/hamcrest-php/generator/FactoryGenerator.php +++ /dev/null @@ -1,124 +0,0 @@ -path = $path; - $this->factoryFiles = array(); - } - - public function addFactoryFile(FactoryFile $factoryFile) - { - $this->factoryFiles[] = $factoryFile; - } - - public function generate() - { - $classes = $this->getClassesWithFactoryMethods(); - foreach ($classes as $class) { - foreach ($class->getMethods() as $method) { - foreach ($method->getCalls() as $call) { - foreach ($this->factoryFiles as $file) { - $file->addCall($call); - } - } - } - } - } - - public function write() - { - foreach ($this->factoryFiles as $file) { - $file->build(); - $file->write(); - } - } - - public function getClassesWithFactoryMethods() - { - $classes = array(); - $files = $this->getSortedFiles(); - foreach ($files as $file) { - $class = $this->getFactoryClass($file); - if ($class !== null) { - $classes[] = $class; - } - } - - return $classes; - } - - public function getSortedFiles() - { - $iter = $this->getFileIterator(); - $files = array(); - foreach ($iter as $file) { - $files[] = $file; - } - sort($files, SORT_STRING); - - return $files; - } - - private function getFileIterator() - { - $factoryClass = class_exists('File_Iterator_Factory') ? 'File_Iterator_Factory' : 'SebastianBergmann\FileIterator\Factory'; - - $factory = new $factoryClass(); - - return $factory->getFileIterator($this->path, '.php'); - } - - public function getFactoryClass($file) - { - $name = $this->getFactoryClassName($file); - if ($name !== null) { - require_once $file; - - if (class_exists($name)) { - $class = new FactoryClass(substr($file, strpos($file, 'Hamcrest/')), new ReflectionClass($name)); - if ($class->isFactory()) { - return $class; - } - } - } - - return null; - } - - public function getFactoryClassName($file) - { - $content = file_get_contents($file); - if (preg_match('/namespace\s+(.+);/', $content, $namespace) - && preg_match('/\n\s*class\s+(\w+)\s+extends\b/', $content, $className) - && preg_match('/@factory\b/', $content) - ) { - return $namespace[1] . '\\' . $className[1]; - } - - return null; - } -} diff --git a/vendor/hamcrest/hamcrest-php/generator/FactoryMethod.php b/vendor/hamcrest/hamcrest-php/generator/FactoryMethod.php deleted file mode 100644 index 8a05371b..00000000 --- a/vendor/hamcrest/hamcrest-php/generator/FactoryMethod.php +++ /dev/null @@ -1,231 +0,0 @@ -class = $class; - $this->reflector = $reflector; - $this->extractCommentWithoutLeadingShashesAndStars(); - $this->extractFactoryNamesFromComment(); - $this->extractParameters(); - } - - public function extractCommentWithoutLeadingShashesAndStars() - { - $this->comment = explode("\n", $this->reflector->getDocComment()); - foreach ($this->comment as &$line) { - $line = preg_replace('#^\s*(/\\*+|\\*+/|\\*)\s?#', '', $line); - } - $this->trimLeadingBlankLinesFromComment(); - $this->trimTrailingBlankLinesFromComment(); - } - - public function trimLeadingBlankLinesFromComment() - { - while (count($this->comment) > 0) { - $line = array_shift($this->comment); - if (trim($line) != '') { - array_unshift($this->comment, $line); - break; - } - } - } - - public function trimTrailingBlankLinesFromComment() - { - while (count($this->comment) > 0) { - $line = array_pop($this->comment); - if (trim($line) != '') { - array_push($this->comment, $line); - break; - } - } - } - - public function extractFactoryNamesFromComment() - { - $this->calls = array(); - for ($i = 0; $i < count($this->comment); $i++) { - if ($this->extractFactoryNamesFromLine($this->comment[$i])) { - unset($this->comment[$i]); - } - } - $this->trimTrailingBlankLinesFromComment(); - } - - public function extractFactoryNamesFromLine($line) - { - if (preg_match('/^\s*@factory(\s+(.+))?$/', $line, $match)) { - $this->createCalls( - $this->extractFactoryNamesFromAnnotation( - isset($match[2]) ? trim($match[2]) : null - ) - ); - return true; - } - return false; - } - - public function extractFactoryNamesFromAnnotation($value) - { - $primaryName = $this->reflector->getName(); - if (empty($value)) { - return array($primaryName); - } - preg_match_all('/(\.{3}|-|[a-zA-Z_][a-zA-Z_0-9]*)/', $value, $match); - $names = $match[0]; - if (in_array('...', $names)) { - $this->isVarArgs = true; - } - if (!in_array('-', $names) && !in_array($primaryName, $names)) { - array_unshift($names, $primaryName); - } - return $names; - } - - public function createCalls(array $names) - { - $names = array_unique($names); - foreach ($names as $name) { - if ($name != '-' && $name != '...') { - $this->calls[] = new FactoryCall($this, $name); - } - } - } - - public function extractParameters() - { - $this->parameters = array(); - if (!$this->isVarArgs) { - foreach ($this->reflector->getParameters() as $parameter) { - $this->parameters[] = new FactoryParameter($this, $parameter); - } - } - } - - public function getParameterDeclarations() - { - if ($this->isVarArgs || !$this->hasParameters()) { - return ''; - } - $params = array(); - foreach ($this->parameters as /** @var $parameter FactoryParameter */ - $parameter) { - $params[] = $parameter->getDeclaration(); - } - return implode(', ', $params); - } - - public function getParameterInvocations() - { - if ($this->isVarArgs) { - return ''; - } - $params = array(); - foreach ($this->parameters as $parameter) { - $params[] = $parameter->getInvocation(); - } - return implode(', ', $params); - } - - - public function getClass() - { - return $this->class; - } - - public function getClassName() - { - return $this->class->getName(); - } - - public function getName() - { - return $this->reflector->name; - } - - public function isFactory() - { - return count($this->calls) > 0; - } - - public function getCalls() - { - return $this->calls; - } - - public function acceptsVariableArguments() - { - return $this->isVarArgs; - } - - public function hasParameters() - { - return !empty($this->parameters); - } - - public function getParameters() - { - return $this->parameters; - } - - public function getFullName() - { - return $this->getClassName() . '::' . $this->getName(); - } - - public function getCommentText() - { - return implode("\n", $this->comment); - } - - public function getComment($indent = '') - { - $comment = $indent . '/**'; - foreach ($this->comment as $line) { - $comment .= "\n" . rtrim($indent . ' * ' . $line); - } - $comment .= "\n" . $indent . ' */'; - return $comment; - } -} diff --git a/vendor/hamcrest/hamcrest-php/generator/FactoryParameter.php b/vendor/hamcrest/hamcrest-php/generator/FactoryParameter.php deleted file mode 100644 index 82b707ac..00000000 --- a/vendor/hamcrest/hamcrest-php/generator/FactoryParameter.php +++ /dev/null @@ -1,131 +0,0 @@ -method = $method; - $this->reflector = $reflector; - } - - /** - * Compute the declaration code. - * - * @return string - */ - public function getDeclaration() - { - $code = $this->getTypeCode() . $this->getInvocation(); - - if ($this->reflector->isOptional()) { - $default = $this->reflector->getDefaultValue(); - if (is_null($default)) { - $default = 'null'; - } elseif (is_bool($default)) { - $default = $default ? 'true' : 'false'; - } elseif (is_string($default)) { - $default = "'" . $default . "'"; - } elseif (is_numeric($default)) { - $default = strval($default); - } elseif (is_array($default)) { - $default = 'array()'; - } else { - echo 'Warning: unknown default type for ' . $this->getMethod()->getFullName() . "\n"; - var_dump($default); - $default = 'null'; - } - $code .= ' = ' . $default; - } - return $code; - } - - /** - * Compute the type code for the paramater. - * - * @return string - */ - private function getTypeCode() - { - // Handle PHP 5 separately - if (PHP_VERSION_ID < 70000) { - if ($this->reflector->isArray()) { - return 'array'; - } - - $class = $this->reflector->getClass(); - - return $class ? sprintf('\\%s ', $class->getName()) : ''; - } - - if (!$this->reflector->hasType()) { - return ''; - } - - $type = $this->reflector->getType(); - $name = self::getQualifiedName($type); - - // PHP 7.1+ supports nullable types via a leading question mark - return (PHP_VERSION_ID >= 70100 && $type->allowsNull()) ? sprintf('?%s ', $name) : sprintf('%s ', $name); - } - - /** - * Compute qualified name for the given type. - * - * This function knows how to prefix class names with a leading slash and - * also how to handle PHP 8's union types. - * - * @param ReflectionType $type - * - * @return string - */ - private static function getQualifiedName(ReflectionType $type) - { - // PHP 8 union types can be recursively processed - if ($type instanceof ReflectionUnionType) { - return implode('|', array_map(function (ReflectionType $type) { - // The "self::" call within a Closure is fine here because this - // code will only ever be executed on PHP 7.0+ - return self::getQualifiedName($type); - }, $type->getTypes())); - } - - // PHP 7.0 doesn't have named types, but 7.1+ does - $name = $type instanceof ReflectionNamedType ? $type->getName() : (string) $type; - - return $type->isBuiltin() ? $name : sprintf('\\%s', $name); - } - - /** - * Compute the invocation code. - * - * @return string - */ - public function getInvocation() - { - return sprintf('$%s', $this->reflector->getName()); - } - - /** - * Compute the method name. - * - * @return string - */ - public function getMethod() - { - return $this->method; - } -} diff --git a/vendor/hamcrest/hamcrest-php/generator/GlobalFunctionFile.php b/vendor/hamcrest/hamcrest-php/generator/GlobalFunctionFile.php deleted file mode 100644 index ec8b1b39..00000000 --- a/vendor/hamcrest/hamcrest-php/generator/GlobalFunctionFile.php +++ /dev/null @@ -1,42 +0,0 @@ -functions = ''; - } - - public function addCall(FactoryCall $call) - { - $this->functions .= "\n" . $this->generateFactoryCall($call); - } - - public function build() - { - $this->addFileHeader(); - $this->addPart('functions_imports'); - $this->addPart('functions_header'); - $this->addCode($this->functions); - $this->addPart('functions_footer'); - } - - public function generateFactoryCall(FactoryCall $call) - { - $code = "if (!function_exists('{$call->getName()}')) {\n"; - $code.= parent::generateFactoryCall($call); - $code.= "}\n"; - - return $code; - } -} diff --git a/vendor/hamcrest/hamcrest-php/generator/StaticMethodFile.php b/vendor/hamcrest/hamcrest-php/generator/StaticMethodFile.php deleted file mode 100644 index 44cec02f..00000000 --- a/vendor/hamcrest/hamcrest-php/generator/StaticMethodFile.php +++ /dev/null @@ -1,38 +0,0 @@ -methods = ''; - } - - public function addCall(FactoryCall $call) - { - $this->methods .= PHP_EOL . $this->generateFactoryCall($call); - } - - public function getDeclarationModifiers() - { - return 'public static '; - } - - public function build() - { - $this->addFileHeader(); - $this->addPart('matchers_imports'); - $this->addPart('matchers_header'); - $this->addCode($this->methods); - $this->addPart('matchers_footer'); - } -} diff --git a/vendor/hamcrest/hamcrest-php/generator/parts/file_header.txt b/vendor/hamcrest/hamcrest-php/generator/parts/file_header.txt deleted file mode 100644 index 7b352e44..00000000 --- a/vendor/hamcrest/hamcrest-php/generator/parts/file_header.txt +++ /dev/null @@ -1,7 +0,0 @@ - - * //With an identifier - * assertThat("assertion identifier", $apple->flavour(), equalTo("tasty")); - * //Without an identifier - * assertThat($apple->flavour(), equalTo("tasty")); - * //Evaluating a boolean expression - * assertThat("some error", $a > $b); - * - */ - function assertThat() - { - $args = func_get_args(); - call_user_func_array( - array('Hamcrest\MatcherAssert', 'assertThat'), - $args - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/generator/parts/functions_imports.txt b/vendor/hamcrest/hamcrest-php/generator/parts/functions_imports.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/vendor/hamcrest/hamcrest-php/generator/parts/matchers_footer.txt b/vendor/hamcrest/hamcrest-php/generator/parts/matchers_footer.txt deleted file mode 100644 index 5c34318c..00000000 --- a/vendor/hamcrest/hamcrest-php/generator/parts/matchers_footer.txt +++ /dev/null @@ -1 +0,0 @@ -} diff --git a/vendor/hamcrest/hamcrest-php/generator/parts/matchers_header.txt b/vendor/hamcrest/hamcrest-php/generator/parts/matchers_header.txt deleted file mode 100644 index 4f8bb2b7..00000000 --- a/vendor/hamcrest/hamcrest-php/generator/parts/matchers_header.txt +++ /dev/null @@ -1,7 +0,0 @@ - - -/** - * A series of static factories for all hamcrest matchers. - */ -class Matchers -{ diff --git a/vendor/hamcrest/hamcrest-php/generator/parts/matchers_imports.txt b/vendor/hamcrest/hamcrest-php/generator/parts/matchers_imports.txt deleted file mode 100644 index 7dd68495..00000000 --- a/vendor/hamcrest/hamcrest-php/generator/parts/matchers_imports.txt +++ /dev/null @@ -1,2 +0,0 @@ - -namespace Hamcrest; \ No newline at end of file diff --git a/vendor/hamcrest/hamcrest-php/generator/run.php b/vendor/hamcrest/hamcrest-php/generator/run.php deleted file mode 100644 index 924d752f..00000000 --- a/vendor/hamcrest/hamcrest-php/generator/run.php +++ /dev/null @@ -1,37 +0,0 @@ -addFactoryFile(new StaticMethodFile(STATIC_MATCHERS_FILE)); -$generator->addFactoryFile(new GlobalFunctionFile(GLOBAL_FUNCTIONS_FILE)); -$generator->generate(); -$generator->write(); diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php deleted file mode 100644 index 55a2dd8c..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php +++ /dev/null @@ -1,882 +0,0 @@ - - * //With an identifier - * assertThat("assertion identifier", $apple->flavour(), equalTo("tasty")); - * //Without an identifier - * assertThat($apple->flavour(), equalTo("tasty")); - * //Evaluating a boolean expression - * assertThat("some error", $a > $b); - * - */ - function assertThat() - { - $args = func_get_args(); - call_user_func_array( - array('Hamcrest\MatcherAssert', 'assertThat'), - $args - ); - } -} - -if (!function_exists('anArray')) { - /** - * Evaluates to true only if each $matcher[$i] is satisfied by $array[$i]. - */ - function anArray(/* args... */) - { - $args = func_get_args(); - return call_user_func_array(array('\Hamcrest\Arrays\IsArray', 'anArray'), $args); - } -} - -if (!function_exists('hasItemInArray')) { - /** - * Evaluates to true if any item in an array satisfies the given matcher. - * - * @param mixed $item as a {@link Hamcrest\Matcher} or a value. - * - * @return \Hamcrest\Arrays\IsArrayContaining - */ - function hasItemInArray($item) - { - return \Hamcrest\Arrays\IsArrayContaining::hasItemInArray($item); - } -} - -if (!function_exists('hasValue')) { - /** - * Evaluates to true if any item in an array satisfies the given matcher. - * - * @param mixed $item as a {@link Hamcrest\Matcher} or a value. - * - * @return \Hamcrest\Arrays\IsArrayContaining - */ - function hasValue($item) - { - return \Hamcrest\Arrays\IsArrayContaining::hasItemInArray($item); - } -} - -if (!function_exists('arrayContainingInAnyOrder')) { - /** - * An array with elements that match the given matchers. - */ - function arrayContainingInAnyOrder(/* args... */) - { - $args = func_get_args(); - return call_user_func_array(array('\Hamcrest\Arrays\IsArrayContainingInAnyOrder', 'arrayContainingInAnyOrder'), $args); - } -} - -if (!function_exists('containsInAnyOrder')) { - /** - * An array with elements that match the given matchers. - */ - function containsInAnyOrder(/* args... */) - { - $args = func_get_args(); - return call_user_func_array(array('\Hamcrest\Arrays\IsArrayContainingInAnyOrder', 'arrayContainingInAnyOrder'), $args); - } -} - -if (!function_exists('arrayContaining')) { - /** - * An array with elements that match the given matchers in the same order. - */ - function arrayContaining(/* args... */) - { - $args = func_get_args(); - return call_user_func_array(array('\Hamcrest\Arrays\IsArrayContainingInOrder', 'arrayContaining'), $args); - } -} - -if (!function_exists('contains')) { - /** - * An array with elements that match the given matchers in the same order. - */ - function contains(/* args... */) - { - $args = func_get_args(); - return call_user_func_array(array('\Hamcrest\Arrays\IsArrayContainingInOrder', 'arrayContaining'), $args); - } -} - -if (!function_exists('hasKeyInArray')) { - /** - * Evaluates to true if any key in an array matches the given matcher. - * - * @param mixed $key as a {@link Hamcrest\Matcher} or a value. - * - * @return \Hamcrest\Arrays\IsArrayContainingKey - */ - function hasKeyInArray($key) - { - return \Hamcrest\Arrays\IsArrayContainingKey::hasKeyInArray($key); - } -} - -if (!function_exists('hasKey')) { - /** - * Evaluates to true if any key in an array matches the given matcher. - * - * @param mixed $key as a {@link Hamcrest\Matcher} or a value. - * - * @return \Hamcrest\Arrays\IsArrayContainingKey - */ - function hasKey($key) - { - return \Hamcrest\Arrays\IsArrayContainingKey::hasKeyInArray($key); - } -} - -if (!function_exists('hasKeyValuePair')) { - /** - * Test if an array has both an key and value in parity with each other. - */ - function hasKeyValuePair($key, $value) - { - return \Hamcrest\Arrays\IsArrayContainingKeyValuePair::hasKeyValuePair($key, $value); - } -} - -if (!function_exists('hasEntry')) { - /** - * Test if an array has both an key and value in parity with each other. - */ - function hasEntry($key, $value) - { - return \Hamcrest\Arrays\IsArrayContainingKeyValuePair::hasKeyValuePair($key, $value); - } -} - -if (!function_exists('arrayWithSize')) { - /** - * Does array size satisfy a given matcher? - * - * @param \Hamcrest\Matcher|int $size as a {@link Hamcrest\Matcher} or a value. - * - * @return \Hamcrest\Arrays\IsArrayWithSize - */ - function arrayWithSize($size) - { - return \Hamcrest\Arrays\IsArrayWithSize::arrayWithSize($size); - } -} - -if (!function_exists('emptyArray')) { - /** - * Matches an empty array. - */ - function emptyArray() - { - return \Hamcrest\Arrays\IsArrayWithSize::emptyArray(); - } -} - -if (!function_exists('nonEmptyArray')) { - /** - * Matches an empty array. - */ - function nonEmptyArray() - { - return \Hamcrest\Arrays\IsArrayWithSize::nonEmptyArray(); - } -} - -if (!function_exists('emptyTraversable')) { - /** - * Returns true if traversable is empty. - */ - function emptyTraversable() - { - return \Hamcrest\Collection\IsEmptyTraversable::emptyTraversable(); - } -} - -if (!function_exists('nonEmptyTraversable')) { - /** - * Returns true if traversable is not empty. - */ - function nonEmptyTraversable() - { - return \Hamcrest\Collection\IsEmptyTraversable::nonEmptyTraversable(); - } -} - -if (!function_exists('traversableWithSize')) { - /** - * Does traversable size satisfy a given matcher? - */ - function traversableWithSize($size) - { - return \Hamcrest\Collection\IsTraversableWithSize::traversableWithSize($size); - } -} - -if (!function_exists('allOf')) { - /** - * Evaluates to true only if ALL of the passed in matchers evaluate to true. - */ - function allOf(/* args... */) - { - $args = func_get_args(); - return call_user_func_array(array('\Hamcrest\Core\AllOf', 'allOf'), $args); - } -} - -if (!function_exists('anyOf')) { - /** - * Evaluates to true if ANY of the passed in matchers evaluate to true. - */ - function anyOf(/* args... */) - { - $args = func_get_args(); - return call_user_func_array(array('\Hamcrest\Core\AnyOf', 'anyOf'), $args); - } -} - -if (!function_exists('noneOf')) { - /** - * Evaluates to false if ANY of the passed in matchers evaluate to true. - */ - function noneOf(/* args... */) - { - $args = func_get_args(); - return call_user_func_array(array('\Hamcrest\Core\AnyOf', 'noneOf'), $args); - } -} - -if (!function_exists('both')) { - /** - * This is useful for fluently combining matchers that must both pass. - * For example: - *
-     *   assertThat($string, both(containsString("a"))->andAlso(containsString("b")));
-     * 
- */ - function both(\Hamcrest\Matcher $matcher) - { - return \Hamcrest\Core\CombinableMatcher::both($matcher); - } -} - -if (!function_exists('either')) { - /** - * This is useful for fluently combining matchers where either may pass, - * for example: - *
-     *   assertThat($string, either(containsString("a"))->orElse(containsString("b")));
-     * 
- */ - function either(\Hamcrest\Matcher $matcher) - { - return \Hamcrest\Core\CombinableMatcher::either($matcher); - } -} - -if (!function_exists('describedAs')) { - /** - * Wraps an existing matcher and overrides the description when it fails. - */ - function describedAs(/* args... */) - { - $args = func_get_args(); - return call_user_func_array(array('\Hamcrest\Core\DescribedAs', 'describedAs'), $args); - } -} - -if (!function_exists('everyItem')) { - /** - * @param Matcher $itemMatcher - * A matcher to apply to every element in an array. - * - * @return \Hamcrest\Core\Every - * Evaluates to TRUE for a collection in which every item matches $itemMatcher - */ - function everyItem(\Hamcrest\Matcher $itemMatcher) - { - return \Hamcrest\Core\Every::everyItem($itemMatcher); - } -} - -if (!function_exists('hasToString')) { - /** - * Does array size satisfy a given matcher? - */ - function hasToString($matcher) - { - return \Hamcrest\Core\HasToString::hasToString($matcher); - } -} - -if (!function_exists('is')) { - /** - * Decorates another Matcher, retaining the behavior but allowing tests - * to be slightly more expressive. - * - * For example: assertThat($cheese, equalTo($smelly)) - * vs. assertThat($cheese, is(equalTo($smelly))) - */ - function is($value) - { - return \Hamcrest\Core\Is::is($value); - } -} - -if (!function_exists('anything')) { - /** - * This matcher always evaluates to true. - * - * @param string $description A meaningful string used when describing itself. - * - * @return \Hamcrest\Core\IsAnything - */ - function anything($description = 'ANYTHING') - { - return \Hamcrest\Core\IsAnything::anything($description); - } -} - -if (!function_exists('hasItem')) { - /** - * Test if the value is an array containing this matcher. - * - * Example: - *
-     * assertThat(array('a', 'b'), hasItem(equalTo('b')));
-     * //Convenience defaults to equalTo()
-     * assertThat(array('a', 'b'), hasItem('b'));
-     * 
- */ - function hasItem(/* args... */) - { - $args = func_get_args(); - return call_user_func_array(array('\Hamcrest\Core\IsCollectionContaining', 'hasItem'), $args); - } -} - -if (!function_exists('hasItems')) { - /** - * Test if the value is an array containing elements that match all of these - * matchers. - * - * Example: - *
-     * assertThat(array('a', 'b', 'c'), hasItems(equalTo('a'), equalTo('b')));
-     * 
- */ - function hasItems(/* args... */) - { - $args = func_get_args(); - return call_user_func_array(array('\Hamcrest\Core\IsCollectionContaining', 'hasItems'), $args); - } -} - -if (!function_exists('equalTo')) { - /** - * Is the value equal to another value, as tested by the use of the "==" - * comparison operator? - */ - function equalTo($item) - { - return \Hamcrest\Core\IsEqual::equalTo($item); - } -} - -if (!function_exists('identicalTo')) { - /** - * Tests of the value is identical to $value as tested by the "===" operator. - */ - function identicalTo($value) - { - return \Hamcrest\Core\IsIdentical::identicalTo($value); - } -} - -if (!function_exists('anInstanceOf')) { - /** - * Is the value an instance of a particular type? - * This version assumes no relationship between the required type and - * the signature of the method that sets it up, for example in - * assertThat($anObject, anInstanceOf('Thing')); - */ - function anInstanceOf($theClass) - { - return \Hamcrest\Core\IsInstanceOf::anInstanceOf($theClass); - } -} - -if (!function_exists('any')) { - /** - * Is the value an instance of a particular type? - * This version assumes no relationship between the required type and - * the signature of the method that sets it up, for example in - * assertThat($anObject, anInstanceOf('Thing')); - */ - function any($theClass) - { - return \Hamcrest\Core\IsInstanceOf::anInstanceOf($theClass); - } -} - -if (!function_exists('not')) { - /** - * Matches if value does not match $value. - */ - function not($value) - { - return \Hamcrest\Core\IsNot::not($value); - } -} - -if (!function_exists('nullValue')) { - /** - * Matches if value is null. - */ - function nullValue() - { - return \Hamcrest\Core\IsNull::nullValue(); - } -} - -if (!function_exists('notNullValue')) { - /** - * Matches if value is not null. - */ - function notNullValue() - { - return \Hamcrest\Core\IsNull::notNullValue(); - } -} - -if (!function_exists('sameInstance')) { - /** - * Creates a new instance of IsSame. - * - * @param mixed $object - * The predicate evaluates to true only when the argument is - * this object. - * - * @return \Hamcrest\Core\IsSame - */ - function sameInstance($object) - { - return \Hamcrest\Core\IsSame::sameInstance($object); - } -} - -if (!function_exists('typeOf')) { - /** - * Is the value a particular built-in type? - */ - function typeOf($theType) - { - return \Hamcrest\Core\IsTypeOf::typeOf($theType); - } -} - -if (!function_exists('set')) { - /** - * Matches if value (class, object, or array) has named $property. - */ - function set($property) - { - return \Hamcrest\Core\Set::set($property); - } -} - -if (!function_exists('notSet')) { - /** - * Matches if value (class, object, or array) does not have named $property. - */ - function notSet($property) - { - return \Hamcrest\Core\Set::notSet($property); - } -} - -if (!function_exists('closeTo')) { - /** - * Matches if value is a number equal to $value within some range of - * acceptable error $delta. - */ - function closeTo($value, $delta) - { - return \Hamcrest\Number\IsCloseTo::closeTo($value, $delta); - } -} - -if (!function_exists('comparesEqualTo')) { - /** - * The value is not > $value, nor < $value. - */ - function comparesEqualTo($value) - { - return \Hamcrest\Number\OrderingComparison::comparesEqualTo($value); - } -} - -if (!function_exists('greaterThan')) { - /** - * The value is > $value. - */ - function greaterThan($value) - { - return \Hamcrest\Number\OrderingComparison::greaterThan($value); - } -} - -if (!function_exists('greaterThanOrEqualTo')) { - /** - * The value is >= $value. - */ - function greaterThanOrEqualTo($value) - { - return \Hamcrest\Number\OrderingComparison::greaterThanOrEqualTo($value); - } -} - -if (!function_exists('atLeast')) { - /** - * The value is >= $value. - */ - function atLeast($value) - { - return \Hamcrest\Number\OrderingComparison::greaterThanOrEqualTo($value); - } -} - -if (!function_exists('lessThan')) { - /** - * The value is < $value. - */ - function lessThan($value) - { - return \Hamcrest\Number\OrderingComparison::lessThan($value); - } -} - -if (!function_exists('lessThanOrEqualTo')) { - /** - * The value is <= $value. - */ - function lessThanOrEqualTo($value) - { - return \Hamcrest\Number\OrderingComparison::lessThanOrEqualTo($value); - } -} - -if (!function_exists('atMost')) { - /** - * The value is <= $value. - */ - function atMost($value) - { - return \Hamcrest\Number\OrderingComparison::lessThanOrEqualTo($value); - } -} - -if (!function_exists('isEmptyString')) { - /** - * Matches if value is a zero-length string. - */ - function isEmptyString() - { - return \Hamcrest\Text\IsEmptyString::isEmptyString(); - } -} - -if (!function_exists('emptyString')) { - /** - * Matches if value is a zero-length string. - */ - function emptyString() - { - return \Hamcrest\Text\IsEmptyString::isEmptyString(); - } -} - -if (!function_exists('isEmptyOrNullString')) { - /** - * Matches if value is null or a zero-length string. - */ - function isEmptyOrNullString() - { - return \Hamcrest\Text\IsEmptyString::isEmptyOrNullString(); - } -} - -if (!function_exists('nullOrEmptyString')) { - /** - * Matches if value is null or a zero-length string. - */ - function nullOrEmptyString() - { - return \Hamcrest\Text\IsEmptyString::isEmptyOrNullString(); - } -} - -if (!function_exists('isNonEmptyString')) { - /** - * Matches if value is a non-zero-length string. - */ - function isNonEmptyString() - { - return \Hamcrest\Text\IsEmptyString::isNonEmptyString(); - } -} - -if (!function_exists('nonEmptyString')) { - /** - * Matches if value is a non-zero-length string. - */ - function nonEmptyString() - { - return \Hamcrest\Text\IsEmptyString::isNonEmptyString(); - } -} - -if (!function_exists('equalToIgnoringCase')) { - /** - * Matches if value is a string equal to $string, regardless of the case. - */ - function equalToIgnoringCase($string) - { - return \Hamcrest\Text\IsEqualIgnoringCase::equalToIgnoringCase($string); - } -} - -if (!function_exists('equalToIgnoringWhiteSpace')) { - /** - * Matches if value is a string equal to $string, regardless of whitespace. - */ - function equalToIgnoringWhiteSpace($string) - { - return \Hamcrest\Text\IsEqualIgnoringWhiteSpace::equalToIgnoringWhiteSpace($string); - } -} - -if (!function_exists('matchesPattern')) { - /** - * Matches if value is a string that matches regular expression $pattern. - */ - function matchesPattern($pattern) - { - return \Hamcrest\Text\MatchesPattern::matchesPattern($pattern); - } -} - -if (!function_exists('containsString')) { - /** - * Matches if value is a string that contains $substring. - */ - function containsString($substring) - { - return \Hamcrest\Text\StringContains::containsString($substring); - } -} - -if (!function_exists('containsStringIgnoringCase')) { - /** - * Matches if value is a string that contains $substring regardless of the case. - */ - function containsStringIgnoringCase($substring) - { - return \Hamcrest\Text\StringContainsIgnoringCase::containsStringIgnoringCase($substring); - } -} - -if (!function_exists('stringContainsInOrder')) { - /** - * Matches if value contains $substrings in a constrained order. - */ - function stringContainsInOrder(/* args... */) - { - $args = func_get_args(); - return call_user_func_array(array('\Hamcrest\Text\StringContainsInOrder', 'stringContainsInOrder'), $args); - } -} - -if (!function_exists('endsWith')) { - /** - * Matches if value is a string that ends with $substring. - */ - function endsWith($substring) - { - return \Hamcrest\Text\StringEndsWith::endsWith($substring); - } -} - -if (!function_exists('startsWith')) { - /** - * Matches if value is a string that starts with $substring. - */ - function startsWith($substring) - { - return \Hamcrest\Text\StringStartsWith::startsWith($substring); - } -} - -if (!function_exists('arrayValue')) { - /** - * Is the value an array? - */ - function arrayValue() - { - return \Hamcrest\Type\IsArray::arrayValue(); - } -} - -if (!function_exists('booleanValue')) { - /** - * Is the value a boolean? - */ - function booleanValue() - { - return \Hamcrest\Type\IsBoolean::booleanValue(); - } -} - -if (!function_exists('boolValue')) { - /** - * Is the value a boolean? - */ - function boolValue() - { - return \Hamcrest\Type\IsBoolean::booleanValue(); - } -} - -if (!function_exists('callableValue')) { - /** - * Is the value callable? - */ - function callableValue() - { - return \Hamcrest\Type\IsCallable::callableValue(); - } -} - -if (!function_exists('doubleValue')) { - /** - * Is the value a float/double? - */ - function doubleValue() - { - return \Hamcrest\Type\IsDouble::doubleValue(); - } -} - -if (!function_exists('floatValue')) { - /** - * Is the value a float/double? - */ - function floatValue() - { - return \Hamcrest\Type\IsDouble::doubleValue(); - } -} - -if (!function_exists('integerValue')) { - /** - * Is the value an integer? - */ - function integerValue() - { - return \Hamcrest\Type\IsInteger::integerValue(); - } -} - -if (!function_exists('intValue')) { - /** - * Is the value an integer? - */ - function intValue() - { - return \Hamcrest\Type\IsInteger::integerValue(); - } -} - -if (!function_exists('numericValue')) { - /** - * Is the value a numeric? - */ - function numericValue() - { - return \Hamcrest\Type\IsNumeric::numericValue(); - } -} - -if (!function_exists('objectValue')) { - /** - * Is the value an object? - */ - function objectValue() - { - return \Hamcrest\Type\IsObject::objectValue(); - } -} - -if (!function_exists('anObject')) { - /** - * Is the value an object? - */ - function anObject() - { - return \Hamcrest\Type\IsObject::objectValue(); - } -} - -if (!function_exists('resourceValue')) { - /** - * Is the value a resource? - */ - function resourceValue() - { - return \Hamcrest\Type\IsResource::resourceValue(); - } -} - -if (!function_exists('scalarValue')) { - /** - * Is the value a scalar (boolean, integer, double, or string)? - */ - function scalarValue() - { - return \Hamcrest\Type\IsScalar::scalarValue(); - } -} - -if (!function_exists('stringValue')) { - /** - * Is the value a string? - */ - function stringValue() - { - return \Hamcrest\Type\IsString::stringValue(); - } -} - -if (!function_exists('hasXPath')) { - /** - * Wraps $matcher with {@link Hamcrest\Core\IsEqual) - * if it's not a matcher and the XPath in count() - * if it's an integer. - */ - function hasXPath($xpath, $matcher = null) - { - return \Hamcrest\Xml\HasXPath::hasXPath($xpath, $matcher); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArray.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArray.php deleted file mode 100644 index 9ea56970..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArray.php +++ /dev/null @@ -1,118 +0,0 @@ -_elementMatchers = $elementMatchers; - } - - protected function matchesSafely($array) - { - if (array_keys($array) != array_keys($this->_elementMatchers)) { - return false; - } - - /** @var $matcher \Hamcrest\Matcher */ - foreach ($this->_elementMatchers as $k => $matcher) { - if (!$matcher->matches($array[$k])) { - return false; - } - } - - return true; - } - - protected function describeMismatchSafely($actual, Description $mismatchDescription) - { - if (count($actual) != count($this->_elementMatchers)) { - $mismatchDescription->appendText('array length was ' . count($actual)); - - return; - } elseif (array_keys($actual) != array_keys($this->_elementMatchers)) { - $mismatchDescription->appendText('array keys were ') - ->appendValueList( - $this->descriptionStart(), - $this->descriptionSeparator(), - $this->descriptionEnd(), - array_keys($actual) - ) - ; - - return; - } - - /** @var $matcher \Hamcrest\Matcher */ - foreach ($this->_elementMatchers as $k => $matcher) { - if (!$matcher->matches($actual[$k])) { - $mismatchDescription->appendText('element ')->appendValue($k) - ->appendText(' was ')->appendValue($actual[$k]); - - return; - } - } - } - - public function describeTo(Description $description) - { - $description->appendList( - $this->descriptionStart(), - $this->descriptionSeparator(), - $this->descriptionEnd(), - $this->_elementMatchers - ); - } - - /** - * Evaluates to true only if each $matcher[$i] is satisfied by $array[$i]. - * - * @factory ... - */ - public static function anArray(/* args... */) - { - $args = func_get_args(); - - return new self(Util::createMatcherArray($args)); - } - - // -- Protected Methods - - protected function descriptionStart() - { - return '['; - } - - protected function descriptionSeparator() - { - return ', '; - } - - protected function descriptionEnd() - { - return ']'; - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContaining.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContaining.php deleted file mode 100644 index 0e4a1eda..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContaining.php +++ /dev/null @@ -1,63 +0,0 @@ -_elementMatcher = $elementMatcher; - } - - protected function matchesSafely($array) - { - foreach ($array as $element) { - if ($this->_elementMatcher->matches($element)) { - return true; - } - } - - return false; - } - - protected function describeMismatchSafely($array, Description $mismatchDescription) - { - $mismatchDescription->appendText('was ')->appendValue($array); - } - - public function describeTo(Description $description) - { - $description - ->appendText('an array containing ') - ->appendDescriptionOf($this->_elementMatcher) - ; - } - - /** - * Evaluates to true if any item in an array satisfies the given matcher. - * - * @param mixed $item as a {@link Hamcrest\Matcher} or a value. - * - * @return \Hamcrest\Arrays\IsArrayContaining - * @factory hasValue - */ - public static function hasItemInArray($item) - { - return new self(Util::wrapValueWithIsEqual($item)); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingInAnyOrder.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingInAnyOrder.php deleted file mode 100644 index 9009026b..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingInAnyOrder.php +++ /dev/null @@ -1,59 +0,0 @@ -_elementMatchers = $elementMatchers; - } - - protected function matchesSafelyWithDiagnosticDescription($array, Description $mismatchDescription) - { - $matching = new MatchingOnce($this->_elementMatchers, $mismatchDescription); - - foreach ($array as $element) { - if (!$matching->matches($element)) { - return false; - } - } - - return $matching->isFinished($array); - } - - public function describeTo(Description $description) - { - $description->appendList('[', ', ', ']', $this->_elementMatchers) - ->appendText(' in any order') - ; - } - - /** - * An array with elements that match the given matchers. - * - * @factory containsInAnyOrder ... - */ - public static function arrayContainingInAnyOrder(/* args... */) - { - $args = func_get_args(); - - return new self(Util::createMatcherArray($args)); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingInOrder.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingInOrder.php deleted file mode 100644 index 61157404..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingInOrder.php +++ /dev/null @@ -1,57 +0,0 @@ -_elementMatchers = $elementMatchers; - } - - protected function matchesSafelyWithDiagnosticDescription($array, Description $mismatchDescription) - { - $series = new SeriesMatchingOnce($this->_elementMatchers, $mismatchDescription); - - foreach ($array as $element) { - if (!$series->matches($element)) { - return false; - } - } - - return $series->isFinished(); - } - - public function describeTo(Description $description) - { - $description->appendList('[', ', ', ']', $this->_elementMatchers); - } - - /** - * An array with elements that match the given matchers in the same order. - * - * @factory contains ... - */ - public static function arrayContaining(/* args... */) - { - $args = func_get_args(); - - return new self(Util::createMatcherArray($args)); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingKey.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingKey.php deleted file mode 100644 index 523477e7..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingKey.php +++ /dev/null @@ -1,75 +0,0 @@ -_keyMatcher = $keyMatcher; - } - - protected function matchesSafely($array) - { - foreach ($array as $key => $element) { - if ($this->_keyMatcher->matches($key)) { - return true; - } - } - - return false; - } - - protected function describeMismatchSafely($array, Description $mismatchDescription) - { - //Not using appendValueList() so that keys can be shown - $mismatchDescription->appendText('array was ') - ->appendText('[') - ; - $loop = false; - foreach ($array as $key => $value) { - if ($loop) { - $mismatchDescription->appendText(', '); - } - $mismatchDescription->appendValue($key)->appendText(' => ')->appendValue($value); - $loop = true; - } - $mismatchDescription->appendText(']'); - } - - public function describeTo(Description $description) - { - $description - ->appendText('array with key ') - ->appendDescriptionOf($this->_keyMatcher) - ; - } - - /** - * Evaluates to true if any key in an array matches the given matcher. - * - * @param mixed $key as a {@link Hamcrest\Matcher} or a value. - * - * @return \Hamcrest\Arrays\IsArrayContainingKey - * @factory hasKey - */ - public static function hasKeyInArray($key) - { - return new self(Util::wrapValueWithIsEqual($key)); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingKeyValuePair.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingKeyValuePair.php deleted file mode 100644 index 9ac3eba8..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayContainingKeyValuePair.php +++ /dev/null @@ -1,80 +0,0 @@ -_keyMatcher = $keyMatcher; - $this->_valueMatcher = $valueMatcher; - } - - protected function matchesSafely($array) - { - foreach ($array as $key => $value) { - if ($this->_keyMatcher->matches($key) && $this->_valueMatcher->matches($value)) { - return true; - } - } - - return false; - } - - protected function describeMismatchSafely($array, Description $mismatchDescription) - { - //Not using appendValueList() so that keys can be shown - $mismatchDescription->appendText('array was ') - ->appendText('[') - ; - $loop = false; - foreach ($array as $key => $value) { - if ($loop) { - $mismatchDescription->appendText(', '); - } - $mismatchDescription->appendValue($key)->appendText(' => ')->appendValue($value); - $loop = true; - } - $mismatchDescription->appendText(']'); - } - - public function describeTo(Description $description) - { - $description->appendText('array containing [') - ->appendDescriptionOf($this->_keyMatcher) - ->appendText(' => ') - ->appendDescriptionOf($this->_valueMatcher) - ->appendText(']') - ; - } - - /** - * Test if an array has both an key and value in parity with each other. - * - * @factory hasEntry - */ - public static function hasKeyValuePair($key, $value) - { - return new self( - Util::wrapValueWithIsEqual($key), - Util::wrapValueWithIsEqual($value) - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayWithSize.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayWithSize.php deleted file mode 100644 index 074375ce..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/IsArrayWithSize.php +++ /dev/null @@ -1,73 +0,0 @@ -_elementMatchers = $elementMatchers; - $this->_mismatchDescription = $mismatchDescription; - } - - public function matches($item) - { - return $this->_isNotSurplus($item) && $this->_isMatched($item); - } - - public function isFinished($items) - { - if (empty($this->_elementMatchers)) { - return true; - } - - $this->_mismatchDescription - ->appendText('No item matches: ')->appendList('', ', ', '', $this->_elementMatchers) - ->appendText(' in ')->appendValueList('[', ', ', ']', $items) - ; - - return false; - } - - // -- Private Methods - - private function _isNotSurplus($item) - { - if (empty($this->_elementMatchers)) { - $this->_mismatchDescription->appendText('Not matched: ')->appendValue($item); - - return false; - } - - return true; - } - - private function _isMatched($item) - { - /** @var $matcher \Hamcrest\Matcher */ - foreach ($this->_elementMatchers as $i => $matcher) { - if ($matcher->matches($item)) { - unset($this->_elementMatchers[$i]); - - return true; - } - } - - $this->_mismatchDescription->appendText('Not matched: ')->appendValue($item); - - return false; - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/SeriesMatchingOnce.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/SeriesMatchingOnce.php deleted file mode 100644 index 12a912d8..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Arrays/SeriesMatchingOnce.php +++ /dev/null @@ -1,75 +0,0 @@ -_elementMatchers = $elementMatchers; - $this->_keys = array_keys($elementMatchers); - $this->_mismatchDescription = $mismatchDescription; - } - - public function matches($item) - { - return $this->_isNotSurplus($item) && $this->_isMatched($item); - } - - public function isFinished() - { - if (!empty($this->_elementMatchers)) { - $nextMatcher = current($this->_elementMatchers); - $this->_mismatchDescription->appendText('No item matched: ')->appendDescriptionOf($nextMatcher); - - return false; - } - - return true; - } - - // -- Private Methods - - private function _isNotSurplus($item) - { - if (empty($this->_elementMatchers)) { - $this->_mismatchDescription->appendText('Not matched: ')->appendValue($item); - - return false; - } - - return true; - } - - private function _isMatched($item) - { - $this->_nextMatchKey = array_shift($this->_keys); - $nextMatcher = array_shift($this->_elementMatchers); - - if (!$nextMatcher->matches($item)) { - $this->_describeMismatch($nextMatcher, $item); - - return false; - } - - return true; - } - - private function _describeMismatch(Matcher $matcher, $item) - { - $this->_mismatchDescription->appendText('item with key ' . $this->_nextMatchKey . ': '); - $matcher->describeMismatch($item, $this->_mismatchDescription); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/AssertionError.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/AssertionError.php deleted file mode 100644 index 3a2a0e7c..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/AssertionError.php +++ /dev/null @@ -1,10 +0,0 @@ -append($text); - - return $this; - } - - public function appendDescriptionOf(SelfDescribing $value) - { - $value->describeTo($this); - - return $this; - } - - public function appendValue($value) - { - if (is_null($value)) { - $this->append('null'); - } elseif (is_string($value)) { - $this->_toPhpSyntax($value); - } elseif (is_float($value)) { - $this->append('<'); - $this->append($value); - $this->append('F>'); - } elseif (is_bool($value)) { - $this->append('<'); - $this->append($value ? 'true' : 'false'); - $this->append('>'); - } elseif (is_array($value) || $value instanceof \Iterator || $value instanceof \IteratorAggregate) { - $this->appendValueList('[', ', ', ']', $value); - } elseif (is_object($value) && !method_exists($value, '__toString')) { - $this->append('<'); - $this->append(get_class($value)); - $this->append('>'); - } else { - $this->append('<'); - $this->append($value); - $this->append('>'); - } - - return $this; - } - - public function appendValueList($start, $separator, $end, $values) - { - $list = array(); - foreach ($values as $v) { - $list[] = new SelfDescribingValue($v); - } - - $this->appendList($start, $separator, $end, $list); - - return $this; - } - - public function appendList($start, $separator, $end, $values) - { - $this->append($start); - - $separate = false; - - foreach ($values as $value) { - /*if (!($value instanceof Hamcrest\SelfDescribing)) { - $value = new Hamcrest\Internal\SelfDescribingValue($value); - }*/ - - if ($separate) { - $this->append($separator); - } - - $this->appendDescriptionOf($value); - - $separate = true; - } - - $this->append($end); - - return $this; - } - - // -- Protected Methods - - /** - * Append the String $str to the description. - */ - abstract protected function append($str); - - // -- Private Methods - - private function _toPhpSyntax($value) - { - $str = '"'; - for ($i = 0, $len = strlen($value); $i < $len; ++$i) { - switch ($value[$i]) { - case '"': - $str .= '\\"'; - break; - - case "\t": - $str .= '\\t'; - break; - - case "\r": - $str .= '\\r'; - break; - - case "\n": - $str .= '\\n'; - break; - - default: - $str .= $value[$i]; - } - } - $str .= '"'; - $this->append($str); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/BaseMatcher.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/BaseMatcher.php deleted file mode 100644 index 06055698..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/BaseMatcher.php +++ /dev/null @@ -1,30 +0,0 @@ -appendText('was ')->appendValue($item); - } - - public function __toString() - { - return StringDescription::toString($this); - } - - public function __invoke() - { - return call_user_func_array(array($this, 'matches'), func_get_args()); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Collection/IsEmptyTraversable.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Collection/IsEmptyTraversable.php deleted file mode 100644 index 8ab58ea5..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Collection/IsEmptyTraversable.php +++ /dev/null @@ -1,71 +0,0 @@ -_empty = $empty; - } - - public function matches($item) - { - if (!$item instanceof \Traversable) { - return false; - } - - foreach ($item as $value) { - return !$this->_empty; - } - - return $this->_empty; - } - - public function describeTo(Description $description) - { - $description->appendText($this->_empty ? 'an empty traversable' : 'a non-empty traversable'); - } - - /** - * Returns true if traversable is empty. - * - * @factory - */ - public static function emptyTraversable() - { - if (!self::$_INSTANCE) { - self::$_INSTANCE = new self; - } - - return self::$_INSTANCE; - } - - /** - * Returns true if traversable is not empty. - * - * @factory - */ - public static function nonEmptyTraversable() - { - if (!self::$_NOT_INSTANCE) { - self::$_NOT_INSTANCE = new self(false); - } - - return self::$_NOT_INSTANCE; - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Collection/IsTraversableWithSize.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Collection/IsTraversableWithSize.php deleted file mode 100644 index c95edc5c..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Collection/IsTraversableWithSize.php +++ /dev/null @@ -1,47 +0,0 @@ -false. - */ -class AllOf extends DiagnosingMatcher -{ - - private $_matchers; - - public function __construct(array $matchers) - { - Util::checkAllAreMatchers($matchers); - - $this->_matchers = $matchers; - } - - public function matchesWithDiagnosticDescription($item, Description $mismatchDescription) - { - /** @var $matcher \Hamcrest\Matcher */ - foreach ($this->_matchers as $matcher) { - if (!$matcher->matches($item)) { - $mismatchDescription->appendDescriptionOf($matcher)->appendText(' '); - $matcher->describeMismatch($item, $mismatchDescription); - - return false; - } - } - - return true; - } - - public function describeTo(Description $description) - { - $description->appendList('(', ' and ', ')', $this->_matchers); - } - - /** - * Evaluates to true only if ALL of the passed in matchers evaluate to true. - * - * @factory ... - */ - public static function allOf(/* args... */) - { - $args = func_get_args(); - - return new self(Util::createMatcherArray($args)); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/AnyOf.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/AnyOf.php deleted file mode 100644 index 4504279f..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/AnyOf.php +++ /dev/null @@ -1,58 +0,0 @@ -true. - */ -class AnyOf extends ShortcutCombination -{ - - public function __construct(array $matchers) - { - parent::__construct($matchers); - } - - public function matches($item) - { - return $this->matchesWithShortcut($item, true); - } - - public function describeTo(Description $description) - { - $this->describeToWithOperator($description, 'or'); - } - - /** - * Evaluates to true if ANY of the passed in matchers evaluate to true. - * - * @factory ... - */ - public static function anyOf(/* args... */) - { - $args = func_get_args(); - - return new self(Util::createMatcherArray($args)); - } - - /** - * Evaluates to false if ANY of the passed in matchers evaluate to true. - * - * @factory ... - */ - public static function noneOf(/* args... */) - { - $args = func_get_args(); - - return IsNot::not( - new self(Util::createMatcherArray($args)) - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/CombinableMatcher.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/CombinableMatcher.php deleted file mode 100644 index e3b4aa78..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/CombinableMatcher.php +++ /dev/null @@ -1,78 +0,0 @@ -_matcher = $matcher; - } - - public function matches($item) - { - return $this->_matcher->matches($item); - } - - public function describeTo(Description $description) - { - $description->appendDescriptionOf($this->_matcher); - } - - /** Diversion from Hamcrest-Java... Logical "and" not permitted */ - public function andAlso(Matcher $other) - { - return new self(new AllOf($this->_templatedListWith($other))); - } - - /** Diversion from Hamcrest-Java... Logical "or" not permitted */ - public function orElse(Matcher $other) - { - return new self(new AnyOf($this->_templatedListWith($other))); - } - - /** - * This is useful for fluently combining matchers that must both pass. - * For example: - *
-     *   assertThat($string, both(containsString("a"))->andAlso(containsString("b")));
-     * 
- * - * @factory - */ - public static function both(Matcher $matcher) - { - return new self($matcher); - } - - /** - * This is useful for fluently combining matchers where either may pass, - * for example: - *
-     *   assertThat($string, either(containsString("a"))->orElse(containsString("b")));
-     * 
- * - * @factory - */ - public static function either(Matcher $matcher) - { - return new self($matcher); - } - - // -- Private Methods - - private function _templatedListWith(Matcher $other) - { - return array($this->_matcher, $other); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/DescribedAs.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/DescribedAs.php deleted file mode 100644 index 5b2583fa..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/DescribedAs.php +++ /dev/null @@ -1,68 +0,0 @@ -_descriptionTemplate = $descriptionTemplate; - $this->_matcher = $matcher; - $this->_values = $values; - } - - public function matches($item) - { - return $this->_matcher->matches($item); - } - - public function describeTo(Description $description) - { - $textStart = 0; - while (preg_match(self::ARG_PATTERN, $this->_descriptionTemplate, $matches, PREG_OFFSET_CAPTURE, $textStart)) { - $text = $matches[0][0]; - $index = $matches[1][0]; - $offset = $matches[0][1]; - - $description->appendText(substr($this->_descriptionTemplate, $textStart, $offset - $textStart)); - $description->appendValue($this->_values[$index]); - - $textStart = $offset + strlen($text); - } - - if ($textStart < strlen($this->_descriptionTemplate)) { - $description->appendText(substr($this->_descriptionTemplate, $textStart)); - } - } - - /** - * Wraps an existing matcher and overrides the description when it fails. - * - * @factory ... - */ - public static function describedAs(/* $description, Hamcrest\Matcher $matcher, $values... */) - { - $args = func_get_args(); - $description = array_shift($args); - $matcher = array_shift($args); - $values = $args; - - return new self($description, $matcher, $values); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/Every.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/Every.php deleted file mode 100644 index d686f8da..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/Every.php +++ /dev/null @@ -1,56 +0,0 @@ -_matcher = $matcher; - } - - protected function matchesSafelyWithDiagnosticDescription($items, Description $mismatchDescription) - { - foreach ($items as $item) { - if (!$this->_matcher->matches($item)) { - $mismatchDescription->appendText('an item '); - $this->_matcher->describeMismatch($item, $mismatchDescription); - - return false; - } - } - - return true; - } - - public function describeTo(Description $description) - { - $description->appendText('every item is ')->appendDescriptionOf($this->_matcher); - } - - /** - * @param Matcher $itemMatcher - * A matcher to apply to every element in an array. - * - * @return \Hamcrest\Core\Every - * Evaluates to TRUE for a collection in which every item matches $itemMatcher - * - * @factory - */ - public static function everyItem(Matcher $itemMatcher) - { - return new self($itemMatcher); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/HasToString.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/HasToString.php deleted file mode 100644 index 45bd9102..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/HasToString.php +++ /dev/null @@ -1,56 +0,0 @@ -toString(); - } - - return (string) $actual; - } - - /** - * Does array size satisfy a given matcher? - * - * @factory - */ - public static function hasToString($matcher) - { - return new self(Util::wrapValueWithIsEqual($matcher)); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/Is.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/Is.php deleted file mode 100644 index 41266dc1..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/Is.php +++ /dev/null @@ -1,57 +0,0 @@ -_matcher = $matcher; - } - - public function matches($arg) - { - return $this->_matcher->matches($arg); - } - - public function describeTo(Description $description) - { - $description->appendText('is ')->appendDescriptionOf($this->_matcher); - } - - public function describeMismatch($item, Description $mismatchDescription) - { - $this->_matcher->describeMismatch($item, $mismatchDescription); - } - - /** - * Decorates another Matcher, retaining the behavior but allowing tests - * to be slightly more expressive. - * - * For example: assertThat($cheese, equalTo($smelly)) - * vs. assertThat($cheese, is(equalTo($smelly))) - * - * @factory - */ - public static function is($value) - { - return new self(Util::wrapValueWithIsEqual($value)); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsAnything.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsAnything.php deleted file mode 100644 index f20e6c0d..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsAnything.php +++ /dev/null @@ -1,45 +0,0 @@ -true. - */ -class IsAnything extends BaseMatcher -{ - - private $_message; - - public function __construct($message = 'ANYTHING') - { - $this->_message = $message; - } - - public function matches($item) - { - return true; - } - - public function describeTo(Description $description) - { - $description->appendText($this->_message); - } - - /** - * This matcher always evaluates to true. - * - * @param string $description A meaningful string used when describing itself. - * - * @return \Hamcrest\Core\IsAnything - * @factory - */ - public static function anything($description = 'ANYTHING') - { - return new self($description); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsCollectionContaining.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsCollectionContaining.php deleted file mode 100644 index 5e60426d..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsCollectionContaining.php +++ /dev/null @@ -1,93 +0,0 @@ -_elementMatcher = $elementMatcher; - } - - protected function matchesSafely($items) - { - foreach ($items as $item) { - if ($this->_elementMatcher->matches($item)) { - return true; - } - } - - return false; - } - - protected function describeMismatchSafely($items, Description $mismatchDescription) - { - $mismatchDescription->appendText('was ')->appendValue($items); - } - - public function describeTo(Description $description) - { - $description - ->appendText('a collection containing ') - ->appendDescriptionOf($this->_elementMatcher) - ; - } - - /** - * Test if the value is an array containing this matcher. - * - * Example: - *
-     * assertThat(array('a', 'b'), hasItem(equalTo('b')));
-     * //Convenience defaults to equalTo()
-     * assertThat(array('a', 'b'), hasItem('b'));
-     * 
- * - * @factory ... - */ - public static function hasItem() - { - $args = func_get_args(); - $firstArg = array_shift($args); - - return new self(Util::wrapValueWithIsEqual($firstArg)); - } - - /** - * Test if the value is an array containing elements that match all of these - * matchers. - * - * Example: - *
-     * assertThat(array('a', 'b', 'c'), hasItems(equalTo('a'), equalTo('b')));
-     * 
- * - * @factory ... - */ - public static function hasItems(/* args... */) - { - $args = func_get_args(); - $matchers = array(); - - foreach ($args as $arg) { - $matchers[] = self::hasItem($arg); - } - - return AllOf::allOf($matchers); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsEqual.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsEqual.php deleted file mode 100644 index 523fba0b..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsEqual.php +++ /dev/null @@ -1,44 +0,0 @@ -_item = $item; - } - - public function matches($arg) - { - return (($arg == $this->_item) && ($this->_item == $arg)); - } - - public function describeTo(Description $description) - { - $description->appendValue($this->_item); - } - - /** - * Is the value equal to another value, as tested by the use of the "==" - * comparison operator? - * - * @factory - */ - public static function equalTo($item) - { - return new self($item); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsIdentical.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsIdentical.php deleted file mode 100644 index 28f7b36e..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsIdentical.php +++ /dev/null @@ -1,38 +0,0 @@ -_value = $value; - } - - public function describeTo(Description $description) - { - $description->appendValue($this->_value); - } - - /** - * Tests of the value is identical to $value as tested by the "===" operator. - * - * @factory - */ - public static function identicalTo($value) - { - return new self($value); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsInstanceOf.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsInstanceOf.php deleted file mode 100644 index 7a5c92a6..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsInstanceOf.php +++ /dev/null @@ -1,67 +0,0 @@ -_theClass = $theClass; - } - - protected function matchesWithDiagnosticDescription($item, Description $mismatchDescription) - { - if (!is_object($item)) { - $mismatchDescription->appendText('was ')->appendValue($item); - - return false; - } - - if (!($item instanceof $this->_theClass)) { - $mismatchDescription->appendText('[' . get_class($item) . '] ') - ->appendValue($item); - - return false; - } - - return true; - } - - public function describeTo(Description $description) - { - $description->appendText('an instance of ') - ->appendText($this->_theClass) - ; - } - - /** - * Is the value an instance of a particular type? - * This version assumes no relationship between the required type and - * the signature of the method that sets it up, for example in - * assertThat($anObject, anInstanceOf('Thing')); - * - * @factory any - */ - public static function anInstanceOf($theClass) - { - return new self($theClass); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsNot.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsNot.php deleted file mode 100644 index 167f0d06..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsNot.php +++ /dev/null @@ -1,44 +0,0 @@ -_matcher = $matcher; - } - - public function matches($arg) - { - return !$this->_matcher->matches($arg); - } - - public function describeTo(Description $description) - { - $description->appendText('not ')->appendDescriptionOf($this->_matcher); - } - - /** - * Matches if value does not match $value. - * - * @factory - */ - public static function not($value) - { - return new self(Util::wrapValueWithIsEqual($value)); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsNull.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsNull.php deleted file mode 100644 index 91a454c1..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsNull.php +++ /dev/null @@ -1,56 +0,0 @@ -appendText('null'); - } - - /** - * Matches if value is null. - * - * @factory - */ - public static function nullValue() - { - if (!self::$_INSTANCE) { - self::$_INSTANCE = new self(); - } - - return self::$_INSTANCE; - } - - /** - * Matches if value is not null. - * - * @factory - */ - public static function notNullValue() - { - if (!self::$_NOT_INSTANCE) { - self::$_NOT_INSTANCE = IsNot::not(self::nullValue()); - } - - return self::$_NOT_INSTANCE; - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsSame.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsSame.php deleted file mode 100644 index 81078705..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsSame.php +++ /dev/null @@ -1,51 +0,0 @@ -_object = $object; - } - - public function matches($object) - { - return ($object === $this->_object) && ($this->_object === $object); - } - - public function describeTo(Description $description) - { - $description->appendText('sameInstance(') - ->appendValue($this->_object) - ->appendText(')') - ; - } - - /** - * Creates a new instance of IsSame. - * - * @param mixed $object - * The predicate evaluates to true only when the argument is - * this object. - * - * @return \Hamcrest\Core\IsSame - * @factory - */ - public static function sameInstance($object) - { - return new self($object); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsTypeOf.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsTypeOf.php deleted file mode 100644 index d24f0f94..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsTypeOf.php +++ /dev/null @@ -1,71 +0,0 @@ -_theType = strtolower($theType); - } - - public function matches($item) - { - return strtolower(gettype($item)) == $this->_theType; - } - - public function describeTo(Description $description) - { - $description->appendText(self::getTypeDescription($this->_theType)); - } - - public function describeMismatch($item, Description $description) - { - if ($item === null) { - $description->appendText('was null'); - } else { - $description->appendText('was ') - ->appendText(self::getTypeDescription(strtolower(gettype($item)))) - ->appendText(' ') - ->appendValue($item) - ; - } - } - - public static function getTypeDescription($type) - { - if ($type == 'null') { - return 'null'; - } - - return (strpos('aeiou', substr($type, 0, 1)) === false ? 'a ' : 'an ') - . $type; - } - - /** - * Is the value a particular built-in type? - * - * @factory - */ - public static function typeOf($theType) - { - return new self($theType); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/Set.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/Set.php deleted file mode 100644 index cdc45d53..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/Set.php +++ /dev/null @@ -1,95 +0,0 @@ - - * assertThat(array('a', 'b'), set('b')); - * assertThat($foo, set('bar')); - * assertThat('Server', notSet('defaultPort')); - * - * - * @todo Replace $property with a matcher and iterate all property names. - */ -class Set extends BaseMatcher -{ - - private $_property; - private $_not; - - public function __construct($property, $not = false) - { - $this->_property = $property; - $this->_not = $not; - } - - public function matches($item) - { - if ($item === null) { - return false; - } - $property = $this->_property; - if (is_array($item)) { - $result = isset($item[$property]); - } elseif (is_object($item)) { - $result = isset($item->$property); - } elseif (is_string($item)) { - $result = isset($item::$$property); - } else { - throw new \InvalidArgumentException('Must pass an object, array, or class name'); - } - - return $this->_not ? !$result : $result; - } - - public function describeTo(Description $description) - { - $description->appendText($this->_not ? 'unset property ' : 'set property ')->appendText($this->_property); - } - - public function describeMismatch($item, Description $description) - { - $value = ''; - if (!$this->_not) { - $description->appendText('was not set'); - } else { - $property = $this->_property; - if (is_array($item)) { - $value = $item[$property]; - } elseif (is_object($item)) { - $value = $item->$property; - } elseif (is_string($item)) { - $value = $item::$$property; - } - parent::describeMismatch($value, $description); - } - } - - /** - * Matches if value (class, object, or array) has named $property. - * - * @factory - */ - public static function set($property) - { - return new self($property); - } - - /** - * Matches if value (class, object, or array) does not have named $property. - * - * @factory - */ - public static function notSet($property) - { - return new self($property, true); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/ShortcutCombination.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/ShortcutCombination.php deleted file mode 100644 index d93db74f..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/ShortcutCombination.php +++ /dev/null @@ -1,43 +0,0 @@ - - */ - private $_matchers; - - public function __construct(array $matchers) - { - Util::checkAllAreMatchers($matchers); - - $this->_matchers = $matchers; - } - - protected function matchesWithShortcut($item, $shortcut) - { - /** @var $matcher \Hamcrest\Matcher */ - foreach ($this->_matchers as $matcher) { - if ($matcher->matches($item) == $shortcut) { - return $shortcut; - } - } - - return !$shortcut; - } - - public function describeToWithOperator(Description $description, $operator) - { - $description->appendList('(', ' ' . $operator . ' ', ')', $this->_matchers); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Description.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Description.php deleted file mode 100644 index 9a482dbf..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Description.php +++ /dev/null @@ -1,70 +0,0 @@ -matchesWithDiagnosticDescription($item, new NullDescription()); - } - - public function describeMismatch($item, Description $mismatchDescription) - { - $this->matchesWithDiagnosticDescription($item, $mismatchDescription); - } - - abstract protected function matchesWithDiagnosticDescription($item, Description $mismatchDescription); -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/FeatureMatcher.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/FeatureMatcher.php deleted file mode 100644 index 59f6cc73..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/FeatureMatcher.php +++ /dev/null @@ -1,67 +0,0 @@ -featureValueOf() in a subclass to pull out the feature to be - * matched against. - */ -abstract class FeatureMatcher extends TypeSafeDiagnosingMatcher -{ - - private $_subMatcher; - private $_featureDescription; - private $_featureName; - - /** - * Constructor. - * - * @param string $type - * @param string $subtype - * @param \Hamcrest\Matcher $subMatcher The matcher to apply to the feature - * @param string $featureDescription Descriptive text to use in describeTo - * @param string $featureName Identifying text for mismatch message - */ - public function __construct($type, $subtype, Matcher $subMatcher, $featureDescription, $featureName) - { - parent::__construct($type, $subtype); - - $this->_subMatcher = $subMatcher; - $this->_featureDescription = $featureDescription; - $this->_featureName = $featureName; - } - - /** - * Implement this to extract the interesting feature. - * - * @param mixed $actual the target object - * - * @return mixed the feature to be matched - */ - abstract protected function featureValueOf($actual); - - public function matchesSafelyWithDiagnosticDescription($actual, Description $mismatchDescription) - { - $featureValue = $this->featureValueOf($actual); - - if (!$this->_subMatcher->matches($featureValue)) { - $mismatchDescription->appendText($this->_featureName) - ->appendText(' was ')->appendValue($featureValue); - - return false; - } - - return true; - } - - final public function describeTo(Description $description) - { - $description->appendText($this->_featureDescription)->appendText(' ') - ->appendDescriptionOf($this->_subMatcher) - ; - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Internal/SelfDescribingValue.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Internal/SelfDescribingValue.php deleted file mode 100644 index 995da71d..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Internal/SelfDescribingValue.php +++ /dev/null @@ -1,27 +0,0 @@ -_value = $value; - } - - public function describeTo(Description $description) - { - $description->appendValue($this->_value); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Matcher.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Matcher.php deleted file mode 100644 index e5dcf093..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Matcher.php +++ /dev/null @@ -1,50 +0,0 @@ - - * Matcher implementations should NOT directly implement this interface. - * Instead, extend the {@link Hamcrest\BaseMatcher} abstract class, - * which will ensure that the Matcher API can grow to support - * new features and remain compatible with all Matcher implementations. - *

- * For easy access to common Matcher implementations, use the static factory - * methods in {@link Hamcrest\CoreMatchers}. - * - * @see Hamcrest\CoreMatchers - * @see Hamcrest\BaseMatcher - */ -interface Matcher extends SelfDescribing -{ - - /** - * Evaluates the matcher for argument $item. - * - * @param mixed $item the object against which the matcher is evaluated. - * - * @return boolean true if $item matches, - * otherwise false. - * - * @see Hamcrest\BaseMatcher - */ - public function matches($item); - - /** - * Generate a description of why the matcher has not accepted the item. - * The description will be part of a larger description of why a matching - * failed, so it should be concise. - * This method assumes that matches($item) is false, but - * will not check this. - * - * @param mixed $item The item that the Matcher has rejected. - * @param Description $description - * @return - */ - public function describeMismatch($item, Description $description); -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/MatcherAssert.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/MatcherAssert.php deleted file mode 100644 index d546dbee..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/MatcherAssert.php +++ /dev/null @@ -1,118 +0,0 @@ - - * // With an identifier - * assertThat("apple flavour", $apple->flavour(), equalTo("tasty")); - * // Without an identifier - * assertThat($apple->flavour(), equalTo("tasty")); - * // Evaluating a boolean expression - * assertThat("some error", $a > $b); - * assertThat($a > $b); - * - */ - public static function assertThat(/* $args ... */) - { - $args = func_get_args(); - switch (count($args)) { - case 1: - self::$_count++; - if (!$args[0]) { - throw new AssertionError(); - } - break; - - case 2: - self::$_count++; - if ($args[1] instanceof Matcher) { - self::doAssert('', $args[0], $args[1]); - } elseif (!$args[1]) { - throw new AssertionError($args[0]); - } - break; - - case 3: - self::$_count++; - self::doAssert( - $args[0], - $args[1], - Util::wrapValueWithIsEqual($args[2]) - ); - break; - - default: - throw new \InvalidArgumentException('assertThat() requires one to three arguments'); - } - } - - /** - * Returns the number of assertions performed. - * - * @return int - */ - public static function getCount() - { - return self::$_count; - } - - /** - * Resets the number of assertions performed to zero. - */ - public static function resetCount() - { - self::$_count = 0; - } - - /** - * Performs the actual assertion logic. - * - * If $matcher doesn't match $actual, - * throws a {@link Hamcrest\AssertionError} with a description - * of the failure along with the optional $identifier. - * - * @param string $identifier added to the message upon failure - * @param mixed $actual value to compare against $matcher - * @param \Hamcrest\Matcher $matcher applied to $actual - * @throws AssertionError - */ - private static function doAssert($identifier, $actual, Matcher $matcher) - { - if (!$matcher->matches($actual)) { - $description = new StringDescription(); - if (!empty($identifier)) { - $description->appendText($identifier . PHP_EOL); - } - $description->appendText('Expected: ') - ->appendDescriptionOf($matcher) - ->appendText(PHP_EOL . ' but: '); - - $matcher->describeMismatch($actual, $description); - - throw new AssertionError((string) $description); - } - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Matchers.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Matchers.php deleted file mode 100644 index 23232e45..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Matchers.php +++ /dev/null @@ -1,713 +0,0 @@ - - * assertThat($string, both(containsString("a"))->andAlso(containsString("b"))); - * - */ - public static function both(\Hamcrest\Matcher $matcher) - { - return \Hamcrest\Core\CombinableMatcher::both($matcher); - } - - /** - * This is useful for fluently combining matchers where either may pass, - * for example: - *

-     *   assertThat($string, either(containsString("a"))->orElse(containsString("b")));
-     * 
- */ - public static function either(\Hamcrest\Matcher $matcher) - { - return \Hamcrest\Core\CombinableMatcher::either($matcher); - } - - /** - * Wraps an existing matcher and overrides the description when it fails. - */ - public static function describedAs(/* args... */) - { - $args = func_get_args(); - return call_user_func_array(array('\Hamcrest\Core\DescribedAs', 'describedAs'), $args); - } - - /** - * @param Matcher $itemMatcher - * A matcher to apply to every element in an array. - * - * @return \Hamcrest\Core\Every - * Evaluates to TRUE for a collection in which every item matches $itemMatcher - */ - public static function everyItem(\Hamcrest\Matcher $itemMatcher) - { - return \Hamcrest\Core\Every::everyItem($itemMatcher); - } - - /** - * Does array size satisfy a given matcher? - */ - public static function hasToString($matcher) - { - return \Hamcrest\Core\HasToString::hasToString($matcher); - } - - /** - * Decorates another Matcher, retaining the behavior but allowing tests - * to be slightly more expressive. - * - * For example: assertThat($cheese, equalTo($smelly)) - * vs. assertThat($cheese, is(equalTo($smelly))) - */ - public static function is($value) - { - return \Hamcrest\Core\Is::is($value); - } - - /** - * This matcher always evaluates to true. - * - * @param string $description A meaningful string used when describing itself. - * - * @return \Hamcrest\Core\IsAnything - */ - public static function anything($description = 'ANYTHING') - { - return \Hamcrest\Core\IsAnything::anything($description); - } - - /** - * Test if the value is an array containing this matcher. - * - * Example: - *
-     * assertThat(array('a', 'b'), hasItem(equalTo('b')));
-     * //Convenience defaults to equalTo()
-     * assertThat(array('a', 'b'), hasItem('b'));
-     * 
- */ - public static function hasItem(/* args... */) - { - $args = func_get_args(); - return call_user_func_array(array('\Hamcrest\Core\IsCollectionContaining', 'hasItem'), $args); - } - - /** - * Test if the value is an array containing elements that match all of these - * matchers. - * - * Example: - *
-     * assertThat(array('a', 'b', 'c'), hasItems(equalTo('a'), equalTo('b')));
-     * 
- */ - public static function hasItems(/* args... */) - { - $args = func_get_args(); - return call_user_func_array(array('\Hamcrest\Core\IsCollectionContaining', 'hasItems'), $args); - } - - /** - * Is the value equal to another value, as tested by the use of the "==" - * comparison operator? - */ - public static function equalTo($item) - { - return \Hamcrest\Core\IsEqual::equalTo($item); - } - - /** - * Tests of the value is identical to $value as tested by the "===" operator. - */ - public static function identicalTo($value) - { - return \Hamcrest\Core\IsIdentical::identicalTo($value); - } - - /** - * Is the value an instance of a particular type? - * This version assumes no relationship between the required type and - * the signature of the method that sets it up, for example in - * assertThat($anObject, anInstanceOf('Thing')); - */ - public static function anInstanceOf($theClass) - { - return \Hamcrest\Core\IsInstanceOf::anInstanceOf($theClass); - } - - /** - * Is the value an instance of a particular type? - * This version assumes no relationship between the required type and - * the signature of the method that sets it up, for example in - * assertThat($anObject, anInstanceOf('Thing')); - */ - public static function any($theClass) - { - return \Hamcrest\Core\IsInstanceOf::anInstanceOf($theClass); - } - - /** - * Matches if value does not match $value. - */ - public static function not($value) - { - return \Hamcrest\Core\IsNot::not($value); - } - - /** - * Matches if value is null. - */ - public static function nullValue() - { - return \Hamcrest\Core\IsNull::nullValue(); - } - - /** - * Matches if value is not null. - */ - public static function notNullValue() - { - return \Hamcrest\Core\IsNull::notNullValue(); - } - - /** - * Creates a new instance of IsSame. - * - * @param mixed $object - * The predicate evaluates to true only when the argument is - * this object. - * - * @return \Hamcrest\Core\IsSame - */ - public static function sameInstance($object) - { - return \Hamcrest\Core\IsSame::sameInstance($object); - } - - /** - * Is the value a particular built-in type? - */ - public static function typeOf($theType) - { - return \Hamcrest\Core\IsTypeOf::typeOf($theType); - } - - /** - * Matches if value (class, object, or array) has named $property. - */ - public static function set($property) - { - return \Hamcrest\Core\Set::set($property); - } - - /** - * Matches if value (class, object, or array) does not have named $property. - */ - public static function notSet($property) - { - return \Hamcrest\Core\Set::notSet($property); - } - - /** - * Matches if value is a number equal to $value within some range of - * acceptable error $delta. - */ - public static function closeTo($value, $delta) - { - return \Hamcrest\Number\IsCloseTo::closeTo($value, $delta); - } - - /** - * The value is not > $value, nor < $value. - */ - public static function comparesEqualTo($value) - { - return \Hamcrest\Number\OrderingComparison::comparesEqualTo($value); - } - - /** - * The value is > $value. - */ - public static function greaterThan($value) - { - return \Hamcrest\Number\OrderingComparison::greaterThan($value); - } - - /** - * The value is >= $value. - */ - public static function greaterThanOrEqualTo($value) - { - return \Hamcrest\Number\OrderingComparison::greaterThanOrEqualTo($value); - } - - /** - * The value is >= $value. - */ - public static function atLeast($value) - { - return \Hamcrest\Number\OrderingComparison::greaterThanOrEqualTo($value); - } - - /** - * The value is < $value. - */ - public static function lessThan($value) - { - return \Hamcrest\Number\OrderingComparison::lessThan($value); - } - - /** - * The value is <= $value. - */ - public static function lessThanOrEqualTo($value) - { - return \Hamcrest\Number\OrderingComparison::lessThanOrEqualTo($value); - } - - /** - * The value is <= $value. - */ - public static function atMost($value) - { - return \Hamcrest\Number\OrderingComparison::lessThanOrEqualTo($value); - } - - /** - * Matches if value is a zero-length string. - */ - public static function isEmptyString() - { - return \Hamcrest\Text\IsEmptyString::isEmptyString(); - } - - /** - * Matches if value is a zero-length string. - */ - public static function emptyString() - { - return \Hamcrest\Text\IsEmptyString::isEmptyString(); - } - - /** - * Matches if value is null or a zero-length string. - */ - public static function isEmptyOrNullString() - { - return \Hamcrest\Text\IsEmptyString::isEmptyOrNullString(); - } - - /** - * Matches if value is null or a zero-length string. - */ - public static function nullOrEmptyString() - { - return \Hamcrest\Text\IsEmptyString::isEmptyOrNullString(); - } - - /** - * Matches if value is a non-zero-length string. - */ - public static function isNonEmptyString() - { - return \Hamcrest\Text\IsEmptyString::isNonEmptyString(); - } - - /** - * Matches if value is a non-zero-length string. - */ - public static function nonEmptyString() - { - return \Hamcrest\Text\IsEmptyString::isNonEmptyString(); - } - - /** - * Matches if value is a string equal to $string, regardless of the case. - */ - public static function equalToIgnoringCase($string) - { - return \Hamcrest\Text\IsEqualIgnoringCase::equalToIgnoringCase($string); - } - - /** - * Matches if value is a string equal to $string, regardless of whitespace. - */ - public static function equalToIgnoringWhiteSpace($string) - { - return \Hamcrest\Text\IsEqualIgnoringWhiteSpace::equalToIgnoringWhiteSpace($string); - } - - /** - * Matches if value is a string that matches regular expression $pattern. - */ - public static function matchesPattern($pattern) - { - return \Hamcrest\Text\MatchesPattern::matchesPattern($pattern); - } - - /** - * Matches if value is a string that contains $substring. - */ - public static function containsString($substring) - { - return \Hamcrest\Text\StringContains::containsString($substring); - } - - /** - * Matches if value is a string that contains $substring regardless of the case. - */ - public static function containsStringIgnoringCase($substring) - { - return \Hamcrest\Text\StringContainsIgnoringCase::containsStringIgnoringCase($substring); - } - - /** - * Matches if value contains $substrings in a constrained order. - */ - public static function stringContainsInOrder(/* args... */) - { - $args = func_get_args(); - return call_user_func_array(array('\Hamcrest\Text\StringContainsInOrder', 'stringContainsInOrder'), $args); - } - - /** - * Matches if value is a string that ends with $substring. - */ - public static function endsWith($substring) - { - return \Hamcrest\Text\StringEndsWith::endsWith($substring); - } - - /** - * Matches if value is a string that starts with $substring. - */ - public static function startsWith($substring) - { - return \Hamcrest\Text\StringStartsWith::startsWith($substring); - } - - /** - * Is the value an array? - */ - public static function arrayValue() - { - return \Hamcrest\Type\IsArray::arrayValue(); - } - - /** - * Is the value a boolean? - */ - public static function booleanValue() - { - return \Hamcrest\Type\IsBoolean::booleanValue(); - } - - /** - * Is the value a boolean? - */ - public static function boolValue() - { - return \Hamcrest\Type\IsBoolean::booleanValue(); - } - - /** - * Is the value callable? - */ - public static function callableValue() - { - return \Hamcrest\Type\IsCallable::callableValue(); - } - - /** - * Is the value a float/double? - */ - public static function doubleValue() - { - return \Hamcrest\Type\IsDouble::doubleValue(); - } - - /** - * Is the value a float/double? - */ - public static function floatValue() - { - return \Hamcrest\Type\IsDouble::doubleValue(); - } - - /** - * Is the value an integer? - */ - public static function integerValue() - { - return \Hamcrest\Type\IsInteger::integerValue(); - } - - /** - * Is the value an integer? - */ - public static function intValue() - { - return \Hamcrest\Type\IsInteger::integerValue(); - } - - /** - * Is the value a numeric? - */ - public static function numericValue() - { - return \Hamcrest\Type\IsNumeric::numericValue(); - } - - /** - * Is the value an object? - */ - public static function objectValue() - { - return \Hamcrest\Type\IsObject::objectValue(); - } - - /** - * Is the value an object? - */ - public static function anObject() - { - return \Hamcrest\Type\IsObject::objectValue(); - } - - /** - * Is the value a resource? - */ - public static function resourceValue() - { - return \Hamcrest\Type\IsResource::resourceValue(); - } - - /** - * Is the value a scalar (boolean, integer, double, or string)? - */ - public static function scalarValue() - { - return \Hamcrest\Type\IsScalar::scalarValue(); - } - - /** - * Is the value a string? - */ - public static function stringValue() - { - return \Hamcrest\Type\IsString::stringValue(); - } - - /** - * Wraps $matcher with {@link Hamcrest\Core\IsEqual) - * if it's not a matcher and the XPath in count() - * if it's an integer. - */ - public static function hasXPath($xpath, $matcher = null) - { - return \Hamcrest\Xml\HasXPath::hasXPath($xpath, $matcher); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/NullDescription.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/NullDescription.php deleted file mode 100644 index aae8e461..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/NullDescription.php +++ /dev/null @@ -1,43 +0,0 @@ -_value = $value; - $this->_delta = $delta; - } - - protected function matchesSafely($item) - { - return $this->_actualDelta($item) <= 0.0; - } - - protected function describeMismatchSafely($item, Description $mismatchDescription) - { - $mismatchDescription->appendValue($item) - ->appendText(' differed by ') - ->appendValue($this->_actualDelta($item)) - ; - } - - public function describeTo(Description $description) - { - $description->appendText('a numeric value within ') - ->appendValue($this->_delta) - ->appendText(' of ') - ->appendValue($this->_value) - ; - } - - /** - * Matches if value is a number equal to $value within some range of - * acceptable error $delta. - * - * @factory - */ - public static function closeTo($value, $delta) - { - return new self($value, $delta); - } - - // -- Private Methods - - private function _actualDelta($item) - { - return (abs(($item - $this->_value)) - $this->_delta); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Number/OrderingComparison.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Number/OrderingComparison.php deleted file mode 100644 index 369d0cfa..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Number/OrderingComparison.php +++ /dev/null @@ -1,132 +0,0 @@ -_value = $value; - $this->_minCompare = $minCompare; - $this->_maxCompare = $maxCompare; - } - - protected function matchesSafely($other) - { - $compare = $this->_compare($this->_value, $other); - - return ($this->_minCompare <= $compare) && ($compare <= $this->_maxCompare); - } - - protected function describeMismatchSafely($item, Description $mismatchDescription) - { - $mismatchDescription - ->appendValue($item)->appendText(' was ') - ->appendText($this->_comparison($this->_compare($this->_value, $item))) - ->appendText(' ')->appendValue($this->_value) - ; - } - - public function describeTo(Description $description) - { - $description->appendText('a value ') - ->appendText($this->_comparison($this->_minCompare)) - ; - if ($this->_minCompare != $this->_maxCompare) { - $description->appendText(' or ') - ->appendText($this->_comparison($this->_maxCompare)) - ; - } - $description->appendText(' ')->appendValue($this->_value); - } - - /** - * The value is not > $value, nor < $value. - * - * @factory - */ - public static function comparesEqualTo($value) - { - return new self($value, 0, 0); - } - - /** - * The value is > $value. - * - * @factory - */ - public static function greaterThan($value) - { - return new self($value, -1, -1); - } - - /** - * The value is >= $value. - * - * @factory atLeast - */ - public static function greaterThanOrEqualTo($value) - { - return new self($value, -1, 0); - } - - /** - * The value is < $value. - * - * @factory - */ - public static function lessThan($value) - { - return new self($value, 1, 1); - } - - /** - * The value is <= $value. - * - * @factory atMost - */ - public static function lessThanOrEqualTo($value) - { - return new self($value, 0, 1); - } - - // -- Private Methods - - private function _compare($left, $right) - { - $a = $left; - $b = $right; - - if ($a < $b) { - return -1; - } elseif ($a == $b) { - return 0; - } else { - return 1; - } - } - - private function _comparison($compare) - { - if ($compare > 0) { - return 'less than'; - } elseif ($compare == 0) { - return 'equal to'; - } else { - return 'greater than'; - } - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/SelfDescribing.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/SelfDescribing.php deleted file mode 100644 index 872fdf9c..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/SelfDescribing.php +++ /dev/null @@ -1,23 +0,0 @@ -_out = (string) $out; - } - - public function __toString() - { - return $this->_out; - } - - /** - * Return the description of a {@link Hamcrest\SelfDescribing} object as a - * String. - * - * @param \Hamcrest\SelfDescribing $selfDescribing - * The object to be described. - * - * @return string - * The description of the object. - */ - public static function toString(SelfDescribing $selfDescribing) - { - $self = new self(); - - return (string) $self->appendDescriptionOf($selfDescribing); - } - - /** - * Alias for {@link toString()}. - */ - public static function asString(SelfDescribing $selfDescribing) - { - return self::toString($selfDescribing); - } - - // -- Protected Methods - - protected function append($str) - { - $this->_out .= $str; - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEmptyString.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEmptyString.php deleted file mode 100644 index 2ae61b96..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEmptyString.php +++ /dev/null @@ -1,85 +0,0 @@ -_empty = $empty; - } - - public function matches($item) - { - return $this->_empty - ? ($item === '') - : is_string($item) && $item !== ''; - } - - public function describeTo(Description $description) - { - $description->appendText($this->_empty ? 'an empty string' : 'a non-empty string'); - } - - /** - * Matches if value is a zero-length string. - * - * @factory emptyString - */ - public static function isEmptyString() - { - if (!self::$_INSTANCE) { - self::$_INSTANCE = new self(true); - } - - return self::$_INSTANCE; - } - - /** - * Matches if value is null or a zero-length string. - * - * @factory nullOrEmptyString - */ - public static function isEmptyOrNullString() - { - if (!self::$_NULL_OR_EMPTY_INSTANCE) { - self::$_NULL_OR_EMPTY_INSTANCE = AnyOf::anyOf( - IsNull::nullvalue(), - self::isEmptyString() - ); - } - - return self::$_NULL_OR_EMPTY_INSTANCE; - } - - /** - * Matches if value is a non-zero-length string. - * - * @factory nonEmptyString - */ - public static function isNonEmptyString() - { - if (!self::$_NOT_INSTANCE) { - self::$_NOT_INSTANCE = new self(false); - } - - return self::$_NOT_INSTANCE; - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEqualIgnoringCase.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEqualIgnoringCase.php deleted file mode 100644 index 3836a8c3..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEqualIgnoringCase.php +++ /dev/null @@ -1,52 +0,0 @@ -_string = $string; - } - - protected function matchesSafely($item) - { - return strtolower($this->_string) === strtolower($item); - } - - protected function describeMismatchSafely($item, Description $mismatchDescription) - { - $mismatchDescription->appendText('was ')->appendText($item); - } - - public function describeTo(Description $description) - { - $description->appendText('equalToIgnoringCase(') - ->appendValue($this->_string) - ->appendText(')') - ; - } - - /** - * Matches if value is a string equal to $string, regardless of the case. - * - * @factory - */ - public static function equalToIgnoringCase($string) - { - return new self($string); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEqualIgnoringWhiteSpace.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEqualIgnoringWhiteSpace.php deleted file mode 100644 index 853692b0..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/IsEqualIgnoringWhiteSpace.php +++ /dev/null @@ -1,66 +0,0 @@ -_string = $string; - } - - protected function matchesSafely($item) - { - return (strtolower($this->_stripSpace($item)) - === strtolower($this->_stripSpace($this->_string))); - } - - protected function describeMismatchSafely($item, Description $mismatchDescription) - { - $mismatchDescription->appendText('was ')->appendText($item); - } - - public function describeTo(Description $description) - { - $description->appendText('equalToIgnoringWhiteSpace(') - ->appendValue($this->_string) - ->appendText(')') - ; - } - - /** - * Matches if value is a string equal to $string, regardless of whitespace. - * - * @factory - */ - public static function equalToIgnoringWhiteSpace($string) - { - return new self($string); - } - - // -- Private Methods - - private function _stripSpace($string) - { - $parts = preg_split("/[\r\n\t ]+/", $string); - foreach ($parts as $i => $part) { - $parts[$i] = trim($part, " \r\n\t"); - } - - return trim(implode(' ', $parts), " \r\n\t"); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/MatchesPattern.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/MatchesPattern.php deleted file mode 100644 index fa0d68ee..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/MatchesPattern.php +++ /dev/null @@ -1,40 +0,0 @@ -_substring, (string) $item) >= 1; - } - - protected function relationship() - { - return 'matching'; - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContains.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContains.php deleted file mode 100644 index b92786b6..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContains.php +++ /dev/null @@ -1,45 +0,0 @@ -_substring); - } - - /** - * Matches if value is a string that contains $substring. - * - * @factory - */ - public static function containsString($substring) - { - return new self($substring); - } - - // -- Protected Methods - - protected function evalSubstringOf($item) - { - return (false !== strpos((string) $item, $this->_substring)); - } - - protected function relationship() - { - return 'containing'; - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContainsIgnoringCase.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContainsIgnoringCase.php deleted file mode 100644 index 69f37c25..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContainsIgnoringCase.php +++ /dev/null @@ -1,40 +0,0 @@ -_substring)); - } - - protected function relationship() - { - return 'containing in any case'; - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContainsInOrder.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContainsInOrder.php deleted file mode 100644 index e75de65d..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringContainsInOrder.php +++ /dev/null @@ -1,66 +0,0 @@ -_substrings = $substrings; - } - - protected function matchesSafely($item) - { - $fromIndex = 0; - - foreach ($this->_substrings as $substring) { - if (false === $fromIndex = strpos($item, $substring, $fromIndex)) { - return false; - } - } - - return true; - } - - protected function describeMismatchSafely($item, Description $mismatchDescription) - { - $mismatchDescription->appendText('was ')->appendText($item); - } - - public function describeTo(Description $description) - { - $description->appendText('a string containing ') - ->appendValueList('', ', ', '', $this->_substrings) - ->appendText(' in order') - ; - } - - /** - * Matches if value contains $substrings in a constrained order. - * - * @factory ... - */ - public static function stringContainsInOrder(/* args... */) - { - $args = func_get_args(); - - if (isset($args[0]) && is_array($args[0])) { - $args = $args[0]; - } - - return new self($args); - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringEndsWith.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringEndsWith.php deleted file mode 100644 index f802ee4d..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringEndsWith.php +++ /dev/null @@ -1,40 +0,0 @@ -_substring))) === $this->_substring); - } - - protected function relationship() - { - return 'ending with'; - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringStartsWith.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringStartsWith.php deleted file mode 100644 index 79c95656..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringStartsWith.php +++ /dev/null @@ -1,40 +0,0 @@ -_substring)) === $this->_substring); - } - - protected function relationship() - { - return 'starting with'; - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/SubstringMatcher.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/SubstringMatcher.php deleted file mode 100644 index e560ad62..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/SubstringMatcher.php +++ /dev/null @@ -1,45 +0,0 @@ -_substring = $substring; - } - - protected function matchesSafely($item) - { - return $this->evalSubstringOf($item); - } - - protected function describeMismatchSafely($item, Description $mismatchDescription) - { - $mismatchDescription->appendText('was "')->appendText($item)->appendText('"'); - } - - public function describeTo(Description $description) - { - $description->appendText('a string ') - ->appendText($this->relationship()) - ->appendText(' ') - ->appendValue($this->_substring) - ; - } - - abstract protected function evalSubstringOf($string); - - abstract protected function relationship(); -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsArray.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsArray.php deleted file mode 100644 index 9179102f..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsArray.php +++ /dev/null @@ -1,32 +0,0 @@ -isHexadecimal($item)) { - return true; - } - - return is_numeric($item); - } - - /** - * Return if the string passed is a valid hexadecimal number. - * This check is necessary because PHP 7 doesn't recognize hexadecimal string as numeric anymore. - * - * @param mixed $item - * @return boolean - */ - private function isHexadecimal($item) - { - if (is_string($item) && preg_match('/^0x(.*)$/', $item, $matches)) { - return ctype_xdigit($matches[1]); - } - - return false; - } - - /** - * Is the value a numeric? - * - * @factory - */ - public static function numericValue() - { - return new self; - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsObject.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsObject.php deleted file mode 100644 index 65918fcf..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsObject.php +++ /dev/null @@ -1,32 +0,0 @@ -matchesSafelyWithDiagnosticDescription($item, new NullDescription()); - } - - final public function describeMismatchSafely($item, Description $mismatchDescription) - { - $this->matchesSafelyWithDiagnosticDescription($item, $mismatchDescription); - } - - // -- Protected Methods - - /** - * Subclasses should implement these. The item will already have been checked for - * the specific type. - */ - abstract protected function matchesSafelyWithDiagnosticDescription($item, Description $mismatchDescription); -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/TypeSafeMatcher.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/TypeSafeMatcher.php deleted file mode 100644 index 56e299a9..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/TypeSafeMatcher.php +++ /dev/null @@ -1,107 +0,0 @@ -_expectedType = $expectedType; - $this->_expectedSubtype = $expectedSubtype; - } - - final public function matches($item) - { - return $this->_isSafeType($item) && $this->matchesSafely($item); - } - - final public function describeMismatch($item, Description $mismatchDescription) - { - if (!$this->_isSafeType($item)) { - parent::describeMismatch($item, $mismatchDescription); - } else { - $this->describeMismatchSafely($item, $mismatchDescription); - } - } - - // -- Protected Methods - - /** - * The item will already have been checked for the specific type and subtype. - */ - abstract protected function matchesSafely($item); - - /** - * The item will already have been checked for the specific type and subtype. - */ - abstract protected function describeMismatchSafely($item, Description $mismatchDescription); - - // -- Private Methods - - private function _isSafeType($value) - { - switch ($this->_expectedType) { - - case self::TYPE_ANY: - return true; - - case self::TYPE_STRING: - return is_string($value) || is_numeric($value); - - case self::TYPE_NUMERIC: - return is_numeric($value) || is_string($value); - - case self::TYPE_ARRAY: - return is_array($value); - - case self::TYPE_OBJECT: - return is_object($value) - && ($this->_expectedSubtype === null - || $value instanceof $this->_expectedSubtype); - - case self::TYPE_RESOURCE: - return is_resource($value) - && ($this->_expectedSubtype === null - || get_resource_type($value) == $this->_expectedSubtype); - - case self::TYPE_BOOLEAN: - return true; - - default: - return true; - - } - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Util.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Util.php deleted file mode 100644 index 169b0366..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Util.php +++ /dev/null @@ -1,76 +0,0 @@ - all items are - */ - public static function createMatcherArray(array $items) - { - //Extract single array item - if (count($items) == 1 && is_array($items[0])) { - $items = $items[0]; - } - - //Replace non-matchers - foreach ($items as &$item) { - if (!($item instanceof Matcher)) { - $item = Core\IsEqual::equalTo($item); - } - } - - return $items; - } -} diff --git a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Xml/HasXPath.php b/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Xml/HasXPath.php deleted file mode 100644 index d9764e45..00000000 --- a/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Xml/HasXPath.php +++ /dev/null @@ -1,195 +0,0 @@ -_xpath = $xpath; - $this->_matcher = $matcher; - } - - /** - * Matches if the XPath matches against the DOM node and the matcher. - * - * @param string|\DOMNode $actual - * @param Description $mismatchDescription - * @return bool - */ - protected function matchesWithDiagnosticDescription($actual, Description $mismatchDescription) - { - if (is_string($actual)) { - $actual = $this->createDocument($actual); - } elseif (!$actual instanceof \DOMNode) { - $mismatchDescription->appendText('was ')->appendValue($actual); - - return false; - } - $result = $this->evaluate($actual); - if ($result instanceof \DOMNodeList) { - return $this->matchesContent($result, $mismatchDescription); - } else { - return $this->matchesExpression($result, $mismatchDescription); - } - } - - /** - * Creates and returns a DOMDocument from the given - * XML or HTML string. - * - * @param string $text - * @return \DOMDocument built from $text - * @throws \InvalidArgumentException if the document is not valid - */ - protected function createDocument($text) - { - $document = new \DOMDocument(); - if (preg_match('/^\s*<\?xml/', $text)) { - if (!@$document->loadXML($text)) { - throw new \InvalidArgumentException('Must pass a valid XML document'); - } - } else { - if (!@$document->loadHTML($text)) { - throw new \InvalidArgumentException('Must pass a valid HTML or XHTML document'); - } - } - - return $document; - } - - /** - * Applies the configured XPath to the DOM node and returns either - * the result if it's an expression or the node list if it's a query. - * - * @param \DOMNode $node context from which to issue query - * @return mixed result of expression or DOMNodeList from query - */ - protected function evaluate(\DOMNode $node) - { - if ($node instanceof \DOMDocument) { - $xpathDocument = new \DOMXPath($node); - - return $xpathDocument->evaluate($this->_xpath); - } else { - $xpathDocument = new \DOMXPath($node->ownerDocument); - - return $xpathDocument->evaluate($this->_xpath, $node); - } - } - - /** - * Matches if the list of nodes is not empty and the content of at least - * one node matches the configured matcher, if supplied. - * - * @param \DOMNodeList $nodes selected by the XPath query - * @param Description $mismatchDescription - * @return bool - */ - protected function matchesContent(\DOMNodeList $nodes, Description $mismatchDescription) - { - if ($nodes->length == 0) { - $mismatchDescription->appendText('XPath returned no results'); - } elseif ($this->_matcher === null) { - return true; - } else { - foreach ($nodes as $node) { - if ($this->_matcher->matches($node->textContent)) { - return true; - } - } - $content = array(); - foreach ($nodes as $node) { - $content[] = $node->textContent; - } - $mismatchDescription->appendText('XPath returned ') - ->appendValue($content); - } - - return false; - } - - /** - * Matches if the result of the XPath expression matches the configured - * matcher or evaluates to true if there is none. - * - * @param mixed $result result of the XPath expression - * @param Description $mismatchDescription - * @return bool - */ - protected function matchesExpression($result, Description $mismatchDescription) - { - if ($this->_matcher === null) { - if ($result) { - return true; - } - $mismatchDescription->appendText('XPath expression result was ') - ->appendValue($result); - } else { - if ($this->_matcher->matches($result)) { - return true; - } - $mismatchDescription->appendText('XPath expression result '); - $this->_matcher->describeMismatch($result, $mismatchDescription); - } - - return false; - } - - public function describeTo(Description $description) - { - $description->appendText('XML or HTML document with XPath "') - ->appendText($this->_xpath) - ->appendText('"'); - if ($this->_matcher !== null) { - $description->appendText(' '); - $this->_matcher->describeTo($description); - } - } - - /** - * Wraps $matcher with {@link Hamcrest\Core\IsEqual) - * if it's not a matcher and the XPath in count() - * if it's an integer. - * - * @factory - */ - public static function hasXPath($xpath, $matcher = null) - { - if ($matcher === null || $matcher instanceof Matcher) { - return new self($xpath, $matcher); - } elseif (is_int($matcher) && strpos($xpath, 'count(') !== 0) { - $xpath = 'count(' . $xpath . ')'; - } - - return new self($xpath, IsEqual::equalTo($matcher)); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/AbstractMatcherTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/AbstractMatcherTest.php deleted file mode 100644 index 8a1fb2a9..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/AbstractMatcherTest.php +++ /dev/null @@ -1,68 +0,0 @@ -assertTrue($matcher->matches($arg), $message); - } - - public function assertDoesNotMatch(\Hamcrest\Matcher $matcher, $arg, $message) - { - $this->assertFalse($matcher->matches($arg), $message); - } - - public function assertDescription($expected, \Hamcrest\Matcher $matcher) - { - $description = new \Hamcrest\StringDescription(); - $description->appendDescriptionOf($matcher); - $this->assertEquals($expected, (string) $description, 'Expected description'); - } - - public function assertMismatchDescription($expected, \Hamcrest\Matcher $matcher, $arg) - { - $description = new \Hamcrest\StringDescription(); - $this->assertFalse( - $matcher->matches($arg), - 'Precondtion: Matcher should not match item' - ); - $matcher->describeMismatch($arg, $description); - $this->assertEquals( - $expected, - (string) $description, - 'Expected mismatch description' - ); - } - - public function testIsNullSafe() - { - //Should not generate any notices - $this->createMatcher()->matches(null); - $this->createMatcher()->describeMismatch( - null, - new \Hamcrest\NullDescription() - ); - } - - public function testCopesWithUnknownTypes() - { - //Should not generate any notices - $this->createMatcher()->matches(new UnknownType()); - $this->createMatcher()->describeMismatch( - new UnknownType(), - new NullDescription() - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingInAnyOrderTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingInAnyOrderTest.php deleted file mode 100644 index 45d9f138..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingInAnyOrderTest.php +++ /dev/null @@ -1,54 +0,0 @@ -assertDescription('[<1>, <2>] in any order', containsInAnyOrder(array(1, 2))); - } - - public function testMatchesItemsInAnyOrder() - { - $this->assertMatches(containsInAnyOrder(array(1, 2, 3)), array(1, 2, 3), 'in order'); - $this->assertMatches(containsInAnyOrder(array(1, 2, 3)), array(3, 2, 1), 'out of order'); - $this->assertMatches(containsInAnyOrder(array(1)), array(1), 'single'); - } - - public function testAppliesMatchersInAnyOrder() - { - $this->assertMatches( - containsInAnyOrder(array(1, 2, 3)), - array(1, 2, 3), - 'in order' - ); - $this->assertMatches( - containsInAnyOrder(array(1, 2, 3)), - array(3, 2, 1), - 'out of order' - ); - $this->assertMatches( - containsInAnyOrder(array(1)), - array(1), - 'single' - ); - } - - public function testMismatchesItemsInAnyOrder() - { - $matcher = containsInAnyOrder(array(1, 2, 3)); - - $this->assertMismatchDescription('was null', $matcher, null); - $this->assertMismatchDescription('No item matches: <1>, <2>, <3> in []', $matcher, array()); - $this->assertMismatchDescription('No item matches: <2>, <3> in [<1>]', $matcher, array(1)); - $this->assertMismatchDescription('Not matched: <4>', $matcher, array(4, 3, 2, 1)); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingInOrderTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingInOrderTest.php deleted file mode 100644 index a9e4e5b0..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingInOrderTest.php +++ /dev/null @@ -1,48 +0,0 @@ -assertDescription('[<1>, <2>]', arrayContaining(array(1, 2))); - } - - public function testMatchesItemsInOrder() - { - $this->assertMatches(arrayContaining(array(1, 2, 3)), array(1, 2, 3), 'in order'); - $this->assertMatches(arrayContaining(array(1)), array(1), 'single'); - } - - public function testAppliesMatchersInOrder() - { - $this->assertMatches( - arrayContaining(array(1, 2, 3)), - array(1, 2, 3), - 'in order' - ); - $this->assertMatches(arrayContaining(array(1)), array(1), 'single'); - } - - public function testMismatchesItemsInAnyOrder() - { - if (defined('HHVM_VERSION')) { - $this->markTestSkipped('Broken on HHVM.'); - } - - $matcher = arrayContaining(array(1, 2, 3)); - $this->assertMismatchDescription('was null', $matcher, null); - $this->assertMismatchDescription('No item matched: <1>', $matcher, array()); - $this->assertMismatchDescription('No item matched: <2>', $matcher, array(1)); - $this->assertMismatchDescription('item with key 0: was <4>', $matcher, array(4, 3, 2, 1)); - $this->assertMismatchDescription('item with key 2: was <4>', $matcher, array(1, 2, 4)); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingKeyTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingKeyTest.php deleted file mode 100644 index 31770d8d..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingKeyTest.php +++ /dev/null @@ -1,62 +0,0 @@ -1); - - $this->assertMatches(hasKey('a'), $array, 'Matches single key'); - } - - public function testMatchesArrayContainingKey() - { - $array = array('a'=>1, 'b'=>2, 'c'=>3); - - $this->assertMatches(hasKey('a'), $array, 'Matches a'); - $this->assertMatches(hasKey('c'), $array, 'Matches c'); - } - - public function testMatchesArrayContainingKeyWithIntegerKeys() - { - $array = array(1=>'A', 2=>'B'); - - assertThat($array, hasKey(1)); - } - - public function testMatchesArrayContainingKeyWithNumberKeys() - { - $array = array(1=>'A', 2=>'B'); - - assertThat($array, hasKey(1)); - - // very ugly version! - assertThat($array, IsArrayContainingKey::hasKeyInArray(2)); - } - - public function testHasReadableDescription() - { - $this->assertDescription('array with key "a"', hasKey('a')); - } - - public function testDoesNotMatchEmptyArray() - { - $this->assertMismatchDescription('array was []', hasKey('Foo'), array()); - } - - public function testDoesNotMatchArrayMissingKey() - { - $array = array('a'=>1, 'b'=>2, 'c'=>3); - - $this->assertMismatchDescription('array was ["a" => <1>, "b" => <2>, "c" => <3>]', hasKey('d'), $array); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingKeyValuePairTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingKeyValuePairTest.php deleted file mode 100644 index a415f9f7..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingKeyValuePairTest.php +++ /dev/null @@ -1,36 +0,0 @@ -1, 'b'=>2); - - $this->assertMatches(hasKeyValuePair(equalTo('a'), equalTo(1)), $array, 'matcherA'); - $this->assertMatches(hasKeyValuePair(equalTo('b'), equalTo(2)), $array, 'matcherB'); - $this->assertMismatchDescription( - 'array was ["a" => <1>, "b" => <2>]', - hasKeyValuePair(equalTo('c'), equalTo(3)), - $array - ); - } - - public function testDoesNotMatchNull() - { - $this->assertMismatchDescription('was null', hasKeyValuePair(anything(), anything()), null); - } - - public function testHasReadableDescription() - { - $this->assertDescription('array containing ["a" => <2>]', hasKeyValuePair(equalTo('a'), equalTo(2))); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingTest.php deleted file mode 100644 index 8d5bd810..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayContainingTest.php +++ /dev/null @@ -1,50 +0,0 @@ -assertMatches( - hasItemInArray('a'), - array('a', 'b', 'c'), - "should matches array that contains 'a'" - ); - } - - public function testDoesNotMatchAnArrayThatDoesntContainAnElementMatchingTheGivenMatcher() - { - $this->assertDoesNotMatch( - hasItemInArray('a'), - array('b', 'c'), - "should not matches array that doesn't contain 'a'" - ); - $this->assertDoesNotMatch( - hasItemInArray('a'), - array(), - 'should not match empty array' - ); - } - - public function testDoesNotMatchNull() - { - $this->assertDoesNotMatch( - hasItemInArray('a'), - null, - 'should not match null' - ); - } - - public function testHasAReadableDescription() - { - $this->assertDescription('an array containing "a"', hasItemInArray('a')); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayTest.php deleted file mode 100644 index e4db53e7..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayTest.php +++ /dev/null @@ -1,89 +0,0 @@ -assertMatches( - anArray(array(equalTo('a'), equalTo('b'), equalTo('c'))), - array('a', 'b', 'c'), - 'should match array with matching elements' - ); - } - - public function testDoesNotMatchAnArrayWhenElementsDoNotMatch() - { - $this->assertDoesNotMatch( - anArray(array(equalTo('a'), equalTo('b'))), - array('b', 'c'), - 'should not match array with different elements' - ); - } - - public function testDoesNotMatchAnArrayOfDifferentSize() - { - $this->assertDoesNotMatch( - anArray(array(equalTo('a'), equalTo('b'))), - array('a', 'b', 'c'), - 'should not match larger array' - ); - $this->assertDoesNotMatch( - anArray(array(equalTo('a'), equalTo('b'))), - array('a'), - 'should not match smaller array' - ); - } - - public function testDoesNotMatchNull() - { - $this->assertDoesNotMatch( - anArray(array(equalTo('a'))), - null, - 'should not match null' - ); - } - - public function testHasAReadableDescription() - { - $this->assertDescription( - '["a", "b"]', - anArray(array(equalTo('a'), equalTo('b'))) - ); - } - - public function testHasAReadableMismatchDescriptionWhenKeysDontMatch() - { - $this->assertMismatchDescription( - 'array keys were [<1>, <2>]', - anArray(array(equalTo('a'), equalTo('b'))), - array(1 => 'a', 2 => 'b') - ); - } - - public function testSupportsMatchesAssociativeArrays() - { - $this->assertMatches( - anArray(array('x'=>equalTo('a'), 'y'=>equalTo('b'), 'z'=>equalTo('c'))), - array('x'=>'a', 'y'=>'b', 'z'=>'c'), - 'should match associative array with matching elements' - ); - } - - public function testDoesNotMatchAnAssociativeArrayWhenKeysDoNotMatch() - { - $this->assertDoesNotMatch( - anArray(array('x'=>equalTo('a'), 'y'=>equalTo('b'))), - array('x'=>'b', 'z'=>'c'), - 'should not match array with different keys' - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayWithSizeTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayWithSizeTest.php deleted file mode 100644 index 8413c896..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Array/IsArrayWithSizeTest.php +++ /dev/null @@ -1,37 +0,0 @@ -assertMatches(arrayWithSize(equalTo(3)), array(1, 2, 3), 'correct size'); - $this->assertDoesNotMatch(arrayWithSize(equalTo(2)), array(1, 2, 3), 'incorrect size'); - } - - public function testProvidesConvenientShortcutForArrayWithSizeEqualTo() - { - $this->assertMatches(arrayWithSize(3), array(1, 2, 3), 'correct size'); - $this->assertDoesNotMatch(arrayWithSize(2), array(1, 2, 3), 'incorrect size'); - } - - public function testEmptyArray() - { - $this->assertMatches(emptyArray(), array(), 'correct size'); - $this->assertDoesNotMatch(emptyArray(), array(1), 'incorrect size'); - } - - public function testHasAReadableDescription() - { - $this->assertDescription('an array with size <3>', arrayWithSize(equalTo(3))); - $this->assertDescription('an empty array', emptyArray()); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/BaseMatcherTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/BaseMatcherTest.php deleted file mode 100644 index 833e2c3e..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/BaseMatcherTest.php +++ /dev/null @@ -1,23 +0,0 @@ -appendText('SOME DESCRIPTION'); - } - - public function testDescribesItselfWithToStringMethod() - { - $someMatcher = new \Hamcrest\SomeMatcher(); - $this->assertEquals('SOME DESCRIPTION', (string) $someMatcher); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Collection/IsEmptyTraversableTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Collection/IsEmptyTraversableTest.php deleted file mode 100644 index 2f15fb49..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Collection/IsEmptyTraversableTest.php +++ /dev/null @@ -1,77 +0,0 @@ -assertMatches( - emptyTraversable(), - new \ArrayObject(array()), - 'an empty traversable' - ); - } - - public function testEmptyMatcherDoesNotMatchWhenNotEmpty() - { - $this->assertDoesNotMatch( - emptyTraversable(), - new \ArrayObject(array(1, 2, 3)), - 'a non-empty traversable' - ); - } - - public function testEmptyMatcherDoesNotMatchNull() - { - $this->assertDoesNotMatch( - emptyTraversable(), - null, - 'should not match null' - ); - } - - public function testEmptyMatcherHasAReadableDescription() - { - $this->assertDescription('an empty traversable', emptyTraversable()); - } - - public function testNonEmptyDoesNotMatchNull() - { - $this->assertDoesNotMatch( - nonEmptyTraversable(), - null, - 'should not match null' - ); - } - - public function testNonEmptyDoesNotMatchWhenEmpty() - { - $this->assertDoesNotMatch( - nonEmptyTraversable(), - new \ArrayObject(array()), - 'an empty traversable' - ); - } - - public function testNonEmptyMatchesWhenNotEmpty() - { - $this->assertMatches( - nonEmptyTraversable(), - new \ArrayObject(array(1, 2, 3)), - 'a non-empty traversable' - ); - } - - public function testNonEmptyNonEmptyMatcherHasAReadableDescription() - { - $this->assertDescription('a non-empty traversable', nonEmptyTraversable()); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Collection/IsTraversableWithSizeTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Collection/IsTraversableWithSizeTest.php deleted file mode 100644 index c1c67a7a..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Collection/IsTraversableWithSizeTest.php +++ /dev/null @@ -1,57 +0,0 @@ -assertMatches( - traversableWithSize(equalTo(3)), - new \ArrayObject(array(1, 2, 3)), - 'correct size' - ); - } - - public function testDoesNotMatchWhenSizeIsIncorrect() - { - $this->assertDoesNotMatch( - traversableWithSize(equalTo(2)), - new \ArrayObject(array(1, 2, 3)), - 'incorrect size' - ); - } - - public function testDoesNotMatchNull() - { - $this->assertDoesNotMatch( - traversableWithSize(3), - null, - 'should not match null' - ); - } - - public function testProvidesConvenientShortcutForTraversableWithSizeEqualTo() - { - $this->assertMatches( - traversableWithSize(3), - new \ArrayObject(array(1, 2, 3)), - 'correct size' - ); - } - - public function testHasAReadableDescription() - { - $this->assertDescription( - 'a traversable with size <3>', - traversableWithSize(equalTo(3)) - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/AllOfTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/AllOfTest.php deleted file mode 100644 index 86b8c277..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/AllOfTest.php +++ /dev/null @@ -1,56 +0,0 @@ -assertDescription( - '("good" and "bad" and "ugly")', - allOf('good', 'bad', 'ugly') - ); - } - - public function testMismatchDescriptionDescribesFirstFailingMatch() - { - $this->assertMismatchDescription( - '"good" was "bad"', - allOf('bad', 'good'), - 'bad' - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/AnyOfTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/AnyOfTest.php deleted file mode 100644 index 3d62b935..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/AnyOfTest.php +++ /dev/null @@ -1,79 +0,0 @@ -assertDescription( - '("good" or "bad" or "ugly")', - anyOf('good', 'bad', 'ugly') - ); - } - - public function testNoneOfEvaluatesToTheLogicalDisjunctionOfTwoOtherMatchers() - { - assertThat('good', not(noneOf('bad', 'good'))); - assertThat('good', not(noneOf('good', 'good'))); - assertThat('good', not(noneOf('good', 'bad'))); - - assertThat('good', noneOf('bad', startsWith('b'))); - } - - public function testNoneOfEvaluatesToTheLogicalDisjunctionOfManyOtherMatchers() - { - assertThat('good', not(noneOf('bad', 'good', 'bad', 'bad', 'bad'))); - assertThat('good', noneOf('bad', 'bad', 'bad', 'bad', 'bad')); - } - - public function testNoneOfSupportsMixedTypes() - { - $combined = noneOf( - equalTo(new \Hamcrest\Core\SampleBaseClass('good')), - equalTo(new \Hamcrest\Core\SampleBaseClass('ugly')), - equalTo(new \Hamcrest\Core\SampleSubClass('good')) - ); - - assertThat(new \Hamcrest\Core\SampleSubClass('bad'), $combined); - } - - public function testNoneOfHasAReadableDescription() - { - $this->assertDescription( - 'not ("good" or "bad" or "ugly")', - noneOf('good', 'bad', 'ugly') - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/CombinableMatcherTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/CombinableMatcherTest.php deleted file mode 100644 index 463c7543..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/CombinableMatcherTest.php +++ /dev/null @@ -1,59 +0,0 @@ -_either_3_or_4 = \Hamcrest\Core\CombinableMatcher::either(equalTo(3))->orElse(equalTo(4)); - $this->_not_3_and_not_4 = \Hamcrest\Core\CombinableMatcher::both(not(equalTo(3)))->andAlso(not(equalTo(4))); - } - - protected function createMatcher() - { - return \Hamcrest\Core\CombinableMatcher::either(equalTo('irrelevant'))->orElse(equalTo('ignored')); - } - - public function testBothAcceptsAndRejects() - { - assertThat(2, $this->_not_3_and_not_4); - assertThat(3, not($this->_not_3_and_not_4)); - } - - public function testAcceptsAndRejectsThreeAnds() - { - $tripleAnd = $this->_not_3_and_not_4->andAlso(equalTo(2)); - assertThat(2, $tripleAnd); - assertThat(3, not($tripleAnd)); - } - - public function testBothDescribesItself() - { - $this->assertEquals('(not <3> and not <4>)', (string) $this->_not_3_and_not_4); - $this->assertMismatchDescription('was <3>', $this->_not_3_and_not_4, 3); - } - - public function testEitherAcceptsAndRejects() - { - assertThat(3, $this->_either_3_or_4); - assertThat(6, not($this->_either_3_or_4)); - } - - public function testAcceptsAndRejectsThreeOrs() - { - $orTriple = $this->_either_3_or_4->orElse(greaterThan(10)); - - assertThat(11, $orTriple); - assertThat(9, not($orTriple)); - } - - public function testEitherDescribesItself() - { - $this->assertEquals('(<3> or <4>)', (string) $this->_either_3_or_4); - $this->assertMismatchDescription('was <6>', $this->_either_3_or_4, 6); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/DescribedAsTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/DescribedAsTest.php deleted file mode 100644 index 673ab41e..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/DescribedAsTest.php +++ /dev/null @@ -1,36 +0,0 @@ -assertDescription('m1 description', $m1); - $this->assertDescription('m2 description', $m2); - } - - public function testAppendsValuesToDescription() - { - $m = describedAs('value 1 = %0, value 2 = %1', anything(), 33, 97); - - $this->assertDescription('value 1 = <33>, value 2 = <97>', $m); - } - - public function testDelegatesMatchingToAnotherMatcher() - { - $m1 = describedAs('irrelevant', anything()); - $m2 = describedAs('irrelevant', not(anything())); - - $this->assertTrue($m1->matches(new \stdClass())); - $this->assertFalse($m2->matches('hi')); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/EveryTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/EveryTest.php deleted file mode 100644 index 5eb153c5..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/EveryTest.php +++ /dev/null @@ -1,30 +0,0 @@ -assertEquals('every item is a string containing "a"', (string) $each); - - $this->assertMismatchDescription('an item was "BbB"', $each, array('BbB')); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/HasToStringTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/HasToStringTest.php deleted file mode 100644 index e2e136dc..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/HasToStringTest.php +++ /dev/null @@ -1,108 +0,0 @@ -assertMatches( - hasToString(equalTo('php')), - new \Hamcrest\Core\PhpForm(), - 'correct __toString' - ); - $this->assertMatches( - hasToString(equalTo('java')), - new \Hamcrest\Core\JavaForm(), - 'correct toString' - ); - } - - public function testPicksJavaOverPhpToString() - { - $this->assertMatches( - hasToString(equalTo('java')), - new \Hamcrest\Core\BothForms(), - 'correct toString' - ); - } - - public function testDoesNotMatchWhenToStringDoesNotMatch() - { - $this->assertDoesNotMatch( - hasToString(equalTo('mismatch')), - new \Hamcrest\Core\PhpForm(), - 'incorrect __toString' - ); - $this->assertDoesNotMatch( - hasToString(equalTo('mismatch')), - new \Hamcrest\Core\JavaForm(), - 'incorrect toString' - ); - $this->assertDoesNotMatch( - hasToString(equalTo('mismatch')), - new \Hamcrest\Core\BothForms(), - 'incorrect __toString' - ); - } - - public function testDoesNotMatchNull() - { - $this->assertDoesNotMatch( - hasToString(equalTo('a')), - null, - 'should not match null' - ); - } - - public function testProvidesConvenientShortcutForTraversableWithSizeEqualTo() - { - $this->assertMatches( - hasToString(equalTo('php')), - new \Hamcrest\Core\PhpForm(), - 'correct __toString' - ); - } - - public function testHasAReadableDescription() - { - $this->assertDescription( - 'an object with toString() "php"', - hasToString(equalTo('php')) - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsAnythingTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsAnythingTest.php deleted file mode 100644 index f68032e5..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsAnythingTest.php +++ /dev/null @@ -1,29 +0,0 @@ -assertDescription('ANYTHING', anything()); - } - - public function testCanOverrideDescription() - { - $description = 'description'; - $this->assertDescription($description, anything($description)); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsCollectionContainingTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsCollectionContainingTest.php deleted file mode 100644 index a3929b54..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsCollectionContainingTest.php +++ /dev/null @@ -1,91 +0,0 @@ -assertMatches( - $itemMatcher, - array('a', 'b', 'c'), - "should match list that contains 'a'" - ); - } - - public function testDoesNotMatchCollectionThatDoesntContainAnElementMatchingTheGivenMatcher() - { - $matcher1 = hasItem(equalTo('a')); - $this->assertDoesNotMatch( - $matcher1, - array('b', 'c'), - "should not match list that doesn't contain 'a'" - ); - - $matcher2 = hasItem(equalTo('a')); - $this->assertDoesNotMatch( - $matcher2, - array(), - 'should not match the empty list' - ); - } - - public function testDoesNotMatchNull() - { - $this->assertDoesNotMatch( - hasItem(equalTo('a')), - null, - 'should not match null' - ); - } - - public function testHasAReadableDescription() - { - $this->assertDescription('a collection containing "a"', hasItem(equalTo('a'))); - } - - public function testMatchesAllItemsInCollection() - { - $matcher1 = hasItems(equalTo('a'), equalTo('b'), equalTo('c')); - $this->assertMatches( - $matcher1, - array('a', 'b', 'c'), - 'should match list containing all items' - ); - - $matcher2 = hasItems('a', 'b', 'c'); - $this->assertMatches( - $matcher2, - array('a', 'b', 'c'), - 'should match list containing all items (without matchers)' - ); - - $matcher3 = hasItems(equalTo('a'), equalTo('b'), equalTo('c')); - $this->assertMatches( - $matcher3, - array('c', 'b', 'a'), - 'should match list containing all items in any order' - ); - - $matcher4 = hasItems(equalTo('a'), equalTo('b'), equalTo('c')); - $this->assertMatches( - $matcher4, - array('e', 'c', 'b', 'a', 'd'), - 'should match list containing all items plus others' - ); - - $matcher5 = hasItems(equalTo('a'), equalTo('b'), equalTo('c')); - $this->assertDoesNotMatch( - $matcher5, - array('e', 'c', 'b', 'd'), // 'a' missing - 'should not match list unless it contains all items' - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsEqualTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsEqualTest.php deleted file mode 100644 index 73e3ff07..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsEqualTest.php +++ /dev/null @@ -1,102 +0,0 @@ -_arg = $arg; - } - - public function __toString() - { - return $this->_arg; - } -} - -class IsEqualTest extends \Hamcrest\AbstractMatcherTest -{ - - protected function createMatcher() - { - return \Hamcrest\Core\IsEqual::equalTo('irrelevant'); - } - - public function testComparesObjectsUsingEqualityOperator() - { - assertThat("hi", equalTo("hi")); - assertThat("bye", not(equalTo("hi"))); - - assertThat(1, equalTo(1)); - assertThat(1, not(equalTo(2))); - - assertThat("2", equalTo(2)); - } - - public function testCanCompareNullValues() - { - assertThat(null, equalTo(null)); - - assertThat(null, not(equalTo('hi'))); - assertThat('hi', not(equalTo(null))); - } - - public function testComparesTheElementsOfAnArray() - { - $s1 = array('a', 'b'); - $s2 = array('a', 'b'); - $s3 = array('c', 'd'); - $s4 = array('a', 'b', 'c', 'd'); - - assertThat($s1, equalTo($s1)); - assertThat($s2, equalTo($s1)); - assertThat($s3, not(equalTo($s1))); - assertThat($s4, not(equalTo($s1))); - } - - public function testComparesTheElementsOfAnArrayOfPrimitiveTypes() - { - $i1 = array(1, 2); - $i2 = array(1, 2); - $i3 = array(3, 4); - $i4 = array(1, 2, 3, 4); - - assertThat($i1, equalTo($i1)); - assertThat($i2, equalTo($i1)); - assertThat($i3, not(equalTo($i1))); - assertThat($i4, not(equalTo($i1))); - } - - public function testRecursivelyTestsElementsOfArrays() - { - $i1 = array(array(1, 2), array(3, 4)); - $i2 = array(array(1, 2), array(3, 4)); - $i3 = array(array(5, 6), array(7, 8)); - $i4 = array(array(1, 2, 3, 4), array(3, 4)); - - assertThat($i1, equalTo($i1)); - assertThat($i2, equalTo($i1)); - assertThat($i3, not(equalTo($i1))); - assertThat($i4, not(equalTo($i1))); - } - - public function testIncludesTheResultOfCallingToStringOnItsArgumentInTheDescription() - { - $argumentDescription = 'ARGUMENT DESCRIPTION'; - $argument = new \Hamcrest\Core\DummyToStringClass($argumentDescription); - $this->assertDescription('<' . $argumentDescription . '>', equalTo($argument)); - } - - public function testReturnsAnObviousDescriptionIfCreatedWithANestedMatcherByMistake() - { - $innerMatcher = equalTo('NestedMatcher'); - $this->assertDescription('<' . (string) $innerMatcher . '>', equalTo($innerMatcher)); - } - - public function testReturnsGoodDescriptionIfCreatedWithNullReference() - { - $this->assertDescription('null', equalTo(null)); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsIdenticalTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsIdenticalTest.php deleted file mode 100644 index 9cc27946..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsIdenticalTest.php +++ /dev/null @@ -1,30 +0,0 @@ -assertDescription('"ARG"', identicalTo('ARG')); - } - - public function testReturnsReadableDescriptionFromToStringWhenInitialisedWithNull() - { - $this->assertDescription('null', identicalTo(null)); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsInstanceOfTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsInstanceOfTest.php deleted file mode 100644 index f74cfdb5..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsInstanceOfTest.php +++ /dev/null @@ -1,51 +0,0 @@ -_baseClassInstance = new \Hamcrest\Core\SampleBaseClass('good'); - $this->_subClassInstance = new \Hamcrest\Core\SampleSubClass('good'); - } - - protected function createMatcher() - { - return \Hamcrest\Core\IsInstanceOf::anInstanceOf('stdClass'); - } - - public function testEvaluatesToTrueIfArgumentIsInstanceOfASpecificClass() - { - assertThat($this->_baseClassInstance, anInstanceOf('Hamcrest\Core\SampleBaseClass')); - assertThat($this->_subClassInstance, anInstanceOf('Hamcrest\Core\SampleSubClass')); - assertThat(null, not(anInstanceOf('Hamcrest\Core\SampleBaseClass'))); - assertThat(new \stdClass(), not(anInstanceOf('Hamcrest\Core\SampleBaseClass'))); - } - - public function testEvaluatesToFalseIfArgumentIsNotAnObject() - { - assertThat(null, not(anInstanceOf('Hamcrest\Core\SampleBaseClass'))); - assertThat(false, not(anInstanceOf('Hamcrest\Core\SampleBaseClass'))); - assertThat(5, not(anInstanceOf('Hamcrest\Core\SampleBaseClass'))); - assertThat('foo', not(anInstanceOf('Hamcrest\Core\SampleBaseClass'))); - assertThat(array(1, 2, 3), not(anInstanceOf('Hamcrest\Core\SampleBaseClass'))); - } - - public function testHasAReadableDescription() - { - $this->assertDescription('an instance of stdClass', anInstanceOf('stdClass')); - } - - public function testDecribesActualClassInMismatchMessage() - { - $this->assertMismatchDescription( - '[Hamcrest\Core\SampleBaseClass] ', - anInstanceOf('Hamcrest\Core\SampleSubClass'), - $this->_baseClassInstance - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsNotTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsNotTest.php deleted file mode 100644 index 09d4a652..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsNotTest.php +++ /dev/null @@ -1,31 +0,0 @@ -assertMatches(not(equalTo('A')), 'B', 'should match'); - $this->assertDoesNotMatch(not(equalTo('B')), 'B', 'should not match'); - } - - public function testProvidesConvenientShortcutForNotEqualTo() - { - $this->assertMatches(not('A'), 'B', 'should match'); - $this->assertMatches(not('B'), 'A', 'should match'); - $this->assertDoesNotMatch(not('A'), 'A', 'should not match'); - $this->assertDoesNotMatch(not('B'), 'B', 'should not match'); - } - - public function testUsesDescriptionOfNegatedMatcherWithPrefix() - { - $this->assertDescription('not a value greater than <2>', not(greaterThan(2))); - $this->assertDescription('not "A"', not('A')); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsNullTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsNullTest.php deleted file mode 100644 index bfa42554..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsNullTest.php +++ /dev/null @@ -1,20 +0,0 @@ -assertDescription('sameInstance("ARG")', sameInstance('ARG')); - } - - public function testReturnsReadableDescriptionFromToStringWhenInitialisedWithNull() - { - $this->assertDescription('sameInstance(null)', sameInstance(null)); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsTest.php deleted file mode 100644 index bbd848b9..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsTest.php +++ /dev/null @@ -1,33 +0,0 @@ -assertMatches(is(equalTo(true)), true, 'should match'); - $this->assertMatches(is(equalTo(false)), false, 'should match'); - $this->assertDoesNotMatch(is(equalTo(true)), false, 'should not match'); - $this->assertDoesNotMatch(is(equalTo(false)), true, 'should not match'); - } - - public function testGeneratesIsPrefixInDescription() - { - $this->assertDescription('is ', is(equalTo(true))); - } - - public function testProvidesConvenientShortcutForIsEqualTo() - { - $this->assertMatches(is('A'), 'A', 'should match'); - $this->assertMatches(is('B'), 'B', 'should match'); - $this->assertDoesNotMatch(is('A'), 'B', 'should not match'); - $this->assertDoesNotMatch(is('B'), 'A', 'should not match'); - $this->assertDescription('is "A"', is('A')); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsTypeOfTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsTypeOfTest.php deleted file mode 100644 index 3f48dea7..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/IsTypeOfTest.php +++ /dev/null @@ -1,45 +0,0 @@ -assertDescription('a double', typeOf('double')); - $this->assertDescription('an integer', typeOf('integer')); - } - - public function testDecribesActualTypeInMismatchMessage() - { - $this->assertMismatchDescription('was null', typeOf('boolean'), null); - $this->assertMismatchDescription('was an integer <5>', typeOf('float'), 5); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/SampleBaseClass.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/SampleBaseClass.php deleted file mode 100644 index c953e7cd..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/SampleBaseClass.php +++ /dev/null @@ -1,18 +0,0 @@ -_arg = $arg; - } - - public function __toString() - { - return $this->_arg; - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/SampleSubClass.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/SampleSubClass.php deleted file mode 100644 index 822f1b64..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/SampleSubClass.php +++ /dev/null @@ -1,6 +0,0 @@ -_instanceProperty); - } - - protected function createMatcher() - { - return \Hamcrest\Core\Set::set('property_name'); - } - - public function testEvaluatesToTrueIfArrayPropertyIsSet() - { - assertThat(array('foo' => 'bar'), set('foo')); - } - - public function testNegatedEvaluatesToFalseIfArrayPropertyIsSet() - { - assertThat(array('foo' => 'bar'), not(notSet('foo'))); - } - - public function testEvaluatesToTrueIfClassPropertyIsSet() - { - self::$_classProperty = 'bar'; - assertThat('Hamcrest\Core\SetTest', set('_classProperty')); - } - - public function testNegatedEvaluatesToFalseIfClassPropertyIsSet() - { - self::$_classProperty = 'bar'; - assertThat('Hamcrest\Core\SetTest', not(notSet('_classProperty'))); - } - - public function testEvaluatesToTrueIfObjectPropertyIsSet() - { - $this->_instanceProperty = 'bar'; - assertThat($this, set('_instanceProperty')); - } - - public function testNegatedEvaluatesToFalseIfObjectPropertyIsSet() - { - $this->_instanceProperty = 'bar'; - assertThat($this, not(notSet('_instanceProperty'))); - } - - public function testEvaluatesToFalseIfArrayPropertyIsNotSet() - { - assertThat(array('foo' => 'bar'), not(set('baz'))); - } - - public function testNegatedEvaluatesToTrueIfArrayPropertyIsNotSet() - { - assertThat(array('foo' => 'bar'), notSet('baz')); - } - - public function testEvaluatesToFalseIfClassPropertyIsNotSet() - { - assertThat('Hamcrest\Core\SetTest', not(set('_classProperty'))); - } - - public function testNegatedEvaluatesToTrueIfClassPropertyIsNotSet() - { - assertThat('Hamcrest\Core\SetTest', notSet('_classProperty')); - } - - public function testEvaluatesToFalseIfObjectPropertyIsNotSet() - { - assertThat($this, not(set('_instanceProperty'))); - } - - public function testNegatedEvaluatesToTrueIfObjectPropertyIsNotSet() - { - assertThat($this, notSet('_instanceProperty')); - } - - public function testHasAReadableDescription() - { - $this->assertDescription('set property foo', set('foo')); - $this->assertDescription('unset property bar', notSet('bar')); - } - - public function testDecribesPropertySettingInMismatchMessage() - { - $this->assertMismatchDescription( - 'was not set', - set('bar'), - array('foo' => 'bar') - ); - $this->assertMismatchDescription( - 'was "bar"', - notSet('foo'), - array('foo' => 'bar') - ); - self::$_classProperty = 'bar'; - $this->assertMismatchDescription( - 'was "bar"', - notSet('_classProperty'), - 'Hamcrest\Core\SetTest' - ); - $this->_instanceProperty = 'bar'; - $this->assertMismatchDescription( - 'was "bar"', - notSet('_instanceProperty'), - $this - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/FeatureMatcherTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/FeatureMatcherTest.php deleted file mode 100644 index 1b023049..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/FeatureMatcherTest.php +++ /dev/null @@ -1,73 +0,0 @@ -_result = $result; - } - public function getResult() - { - return $this->_result; - } -} - -/* Test-specific subclass only */ -class ResultMatcher extends \Hamcrest\FeatureMatcher -{ - public function __construct() - { - parent::__construct(self::TYPE_ANY, null, equalTo('bar'), 'Thingy with result', 'result'); - } - public function featureValueOf($actual) - { - if ($actual instanceof \Hamcrest\Thingy) { - return $actual->getResult(); - } - } -} - -class FeatureMatcherTest extends \Hamcrest\AbstractMatcherTest -{ - - private $_resultMatcher; - - protected function setUp() - { - $this->_resultMatcher = $this->_resultMatcher(); - } - - protected function createMatcher() - { - return $this->_resultMatcher(); - } - - public function testMatchesPartOfAnObject() - { - $this->assertMatches($this->_resultMatcher, new \Hamcrest\Thingy('bar'), 'feature'); - $this->assertDescription('Thingy with result "bar"', $this->_resultMatcher); - } - - public function testMismatchesPartOfAnObject() - { - $this->assertMismatchDescription( - 'result was "foo"', - $this->_resultMatcher, - new \Hamcrest\Thingy('foo') - ); - } - - public function testDoesNotGenerateNoticesForNull() - { - $this->assertMismatchDescription('result was null', $this->_resultMatcher, null); - } - - // -- Creation Methods - - private function _resultMatcher() - { - return new \Hamcrest\ResultMatcher(); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/InvokedMatcherTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/InvokedMatcherTest.php deleted file mode 100644 index dfa77006..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/InvokedMatcherTest.php +++ /dev/null @@ -1,31 +0,0 @@ -matchAgainst = $matchAgainst; - } - - public function matches($item) - { - return $item == $this->matchAgainst; - } - -} - -class InvokedMatcherTest extends TestCase -{ - public function testInvokedMatchersCallMatches() - { - $sampleMatcher = new SampleInvokeMatcher('foo'); - - $this->assertTrue($sampleMatcher('foo')); - $this->assertFalse($sampleMatcher('bar')); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/MatcherAssertTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/MatcherAssertTest.php deleted file mode 100644 index dc12fba5..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/MatcherAssertTest.php +++ /dev/null @@ -1,192 +0,0 @@ -getMessage()); - } - try { - \Hamcrest\MatcherAssert::assertThat(null); - self::fail('expected assertion failure'); - } catch (\Hamcrest\AssertionError $ex) { - self::assertEquals('', $ex->getMessage()); - } - try { - \Hamcrest\MatcherAssert::assertThat(''); - self::fail('expected assertion failure'); - } catch (\Hamcrest\AssertionError $ex) { - self::assertEquals('', $ex->getMessage()); - } - try { - \Hamcrest\MatcherAssert::assertThat(0); - self::fail('expected assertion failure'); - } catch (\Hamcrest\AssertionError $ex) { - self::assertEquals('', $ex->getMessage()); - } - try { - \Hamcrest\MatcherAssert::assertThat(0.0); - self::fail('expected assertion failure'); - } catch (\Hamcrest\AssertionError $ex) { - self::assertEquals('', $ex->getMessage()); - } - try { - \Hamcrest\MatcherAssert::assertThat(array()); - self::fail('expected assertion failure'); - } catch (\Hamcrest\AssertionError $ex) { - self::assertEquals('', $ex->getMessage()); - } - self::assertEquals(6, \Hamcrest\MatcherAssert::getCount(), 'assertion count'); - } - - public function testAssertThatWithIdentifierAndTrueArgPasses() - { - \Hamcrest\MatcherAssert::assertThat('identifier', true); - \Hamcrest\MatcherAssert::assertThat('identifier', 'non-empty'); - \Hamcrest\MatcherAssert::assertThat('identifier', 1); - \Hamcrest\MatcherAssert::assertThat('identifier', 3.14159); - \Hamcrest\MatcherAssert::assertThat('identifier', array(true)); - self::assertEquals(5, \Hamcrest\MatcherAssert::getCount(), 'assertion count'); - } - - public function testAssertThatWithIdentifierAndFalseArgFails() - { - try { - \Hamcrest\MatcherAssert::assertThat('identifier', false); - self::fail('expected assertion failure'); - } catch (\Hamcrest\AssertionError $ex) { - self::assertEquals('identifier', $ex->getMessage()); - } - try { - \Hamcrest\MatcherAssert::assertThat('identifier', null); - self::fail('expected assertion failure'); - } catch (\Hamcrest\AssertionError $ex) { - self::assertEquals('identifier', $ex->getMessage()); - } - try { - \Hamcrest\MatcherAssert::assertThat('identifier', ''); - self::fail('expected assertion failure'); - } catch (\Hamcrest\AssertionError $ex) { - self::assertEquals('identifier', $ex->getMessage()); - } - try { - \Hamcrest\MatcherAssert::assertThat('identifier', 0); - self::fail('expected assertion failure'); - } catch (\Hamcrest\AssertionError $ex) { - self::assertEquals('identifier', $ex->getMessage()); - } - try { - \Hamcrest\MatcherAssert::assertThat('identifier', 0.0); - self::fail('expected assertion failure'); - } catch (\Hamcrest\AssertionError $ex) { - self::assertEquals('identifier', $ex->getMessage()); - } - try { - \Hamcrest\MatcherAssert::assertThat('identifier', array()); - self::fail('expected assertion failure'); - } catch (\Hamcrest\AssertionError $ex) { - self::assertEquals('identifier', $ex->getMessage()); - } - self::assertEquals(6, \Hamcrest\MatcherAssert::getCount(), 'assertion count'); - } - - public function testAssertThatWithActualValueAndMatcherArgsThatMatchPasses() - { - \Hamcrest\MatcherAssert::assertThat(true, is(true)); - self::assertEquals(1, \Hamcrest\MatcherAssert::getCount(), 'assertion count'); - } - - public function testAssertThatWithActualValueAndMatcherArgsThatDontMatchFails() - { - $expected = 'expected'; - $actual = 'actual'; - - $expectedMessage = - 'Expected: "expected"' . PHP_EOL . - ' but: was "actual"'; - - try { - \Hamcrest\MatcherAssert::assertThat($actual, equalTo($expected)); - self::fail('expected assertion failure'); - } catch (\Hamcrest\AssertionError $ex) { - self::assertEquals($expectedMessage, $ex->getMessage()); - self::assertEquals(1, \Hamcrest\MatcherAssert::getCount(), 'assertion count'); - } - } - - public function testAssertThatWithIdentifierAndActualValueAndMatcherArgsThatMatchPasses() - { - \Hamcrest\MatcherAssert::assertThat('identifier', true, is(true)); - self::assertEquals(1, \Hamcrest\MatcherAssert::getCount(), 'assertion count'); - } - - public function testAssertThatWithIdentifierAndActualValueAndMatcherArgsThatDontMatchFails() - { - $expected = 'expected'; - $actual = 'actual'; - - $expectedMessage = - 'identifier' . PHP_EOL . - 'Expected: "expected"' . PHP_EOL . - ' but: was "actual"'; - - try { - \Hamcrest\MatcherAssert::assertThat('identifier', $actual, equalTo($expected)); - self::fail('expected assertion failure'); - } catch (\Hamcrest\AssertionError $ex) { - self::assertEquals($expectedMessage, $ex->getMessage()); - self::assertEquals(1, \Hamcrest\MatcherAssert::getCount(), 'assertion count'); - } - } - - public function testAssertThatWithNoArgsThrowsErrorAndDoesntIncrementCount() - { - try { - \Hamcrest\MatcherAssert::assertThat(); - self::fail('expected invalid argument exception'); - } catch (\InvalidArgumentException $ex) { - self::assertEquals(0, \Hamcrest\MatcherAssert::getCount(), 'assertion count'); - } - } - - public function testAssertThatWithFourArgsThrowsErrorAndDoesntIncrementCount() - { - try { - \Hamcrest\MatcherAssert::assertThat(1, 2, 3, 4); - self::fail('expected invalid argument exception'); - } catch (\InvalidArgumentException $ex) { - self::assertEquals(0, \Hamcrest\MatcherAssert::getCount(), 'assertion count'); - } - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Number/IsCloseToTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Number/IsCloseToTest.php deleted file mode 100644 index 987d5526..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Number/IsCloseToTest.php +++ /dev/null @@ -1,27 +0,0 @@ -assertTrue($p->matches(1.0)); - $this->assertTrue($p->matches(0.5)); - $this->assertTrue($p->matches(1.5)); - - $this->assertDoesNotMatch($p, 2.0, 'too large'); - $this->assertMismatchDescription('<2F> differed by <0.5F>', $p, 2.0); - $this->assertDoesNotMatch($p, 0.0, 'number too small'); - $this->assertMismatchDescription('<0F> differed by <0.5F>', $p, 0.0); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Number/OrderingComparisonTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Number/OrderingComparisonTest.php deleted file mode 100644 index a4c94d37..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Number/OrderingComparisonTest.php +++ /dev/null @@ -1,41 +0,0 @@ -_text = $text; - } - - public function describeTo(\Hamcrest\Description $description) - { - $description->appendText($this->_text); - } -} - -class StringDescriptionTest extends TestCase -{ - - private $_description; - - protected function setUp() - { - $this->_description = new \Hamcrest\StringDescription(); - } - - public function testAppendTextAppendsTextInformation() - { - $this->_description->appendText('foo')->appendText('bar'); - $this->assertEquals('foobar', (string) $this->_description); - } - - public function testAppendValueCanAppendTextTypes() - { - $this->_description->appendValue('foo'); - $this->assertEquals('"foo"', (string) $this->_description); - } - - public function testSpecialCharactersAreEscapedForStringTypes() - { - $this->_description->appendValue("foo\\bar\"zip\r\n"); - $this->assertEquals('"foo\\bar\\"zip\r\n"', (string) $this->_description); - } - - public function testIntegerValuesCanBeAppended() - { - $this->_description->appendValue(42); - $this->assertEquals('<42>', (string) $this->_description); - } - - public function testFloatValuesCanBeAppended() - { - $this->_description->appendValue(42.78); - $this->assertEquals('<42.78F>', (string) $this->_description); - } - - public function testNullValuesCanBeAppended() - { - $this->_description->appendValue(null); - $this->assertEquals('null', (string) $this->_description); - } - - public function testArraysCanBeAppended() - { - $this->_description->appendValue(array('foo', 42.78)); - $this->assertEquals('["foo", <42.78F>]', (string) $this->_description); - } - - public function testObjectsCanBeAppended() - { - $this->_description->appendValue(new \stdClass()); - $this->assertEquals('', (string) $this->_description); - } - - public function testBooleanValuesCanBeAppended() - { - $this->_description->appendValue(false); - $this->assertEquals('', (string) $this->_description); - } - - public function testListsOfvaluesCanBeAppended() - { - $this->_description->appendValue(array('foo', 42.78)); - $this->assertEquals('["foo", <42.78F>]', (string) $this->_description); - } - - public function testIterableOfvaluesCanBeAppended() - { - $items = new \ArrayObject(array('foo', 42.78)); - $this->_description->appendValue($items); - $this->assertEquals('["foo", <42.78F>]', (string) $this->_description); - } - - public function testIteratorOfvaluesCanBeAppended() - { - $items = new \ArrayObject(array('foo', 42.78)); - $this->_description->appendValue($items->getIterator()); - $this->assertEquals('["foo", <42.78F>]', (string) $this->_description); - } - - public function testListsOfvaluesCanBeAppendedManually() - { - $this->_description->appendValueList('@start@', '@sep@ ', '@end@', array('foo', 42.78)); - $this->assertEquals('@start@"foo"@sep@ <42.78F>@end@', (string) $this->_description); - } - - public function testIterableOfvaluesCanBeAppendedManually() - { - $items = new \ArrayObject(array('foo', 42.78)); - $this->_description->appendValueList('@start@', '@sep@ ', '@end@', $items); - $this->assertEquals('@start@"foo"@sep@ <42.78F>@end@', (string) $this->_description); - } - - public function testIteratorOfvaluesCanBeAppendedManually() - { - $items = new \ArrayObject(array('foo', 42.78)); - $this->_description->appendValueList('@start@', '@sep@ ', '@end@', $items->getIterator()); - $this->assertEquals('@start@"foo"@sep@ <42.78F>@end@', (string) $this->_description); - } - - public function testSelfDescribingObjectsCanBeAppended() - { - $this->_description - ->appendDescriptionOf(new \Hamcrest\SampleSelfDescriber('foo')) - ->appendDescriptionOf(new \Hamcrest\SampleSelfDescriber('bar')) - ; - $this->assertEquals('foobar', (string) $this->_description); - } - - public function testSelfDescribingObjectsCanBeAppendedAsLists() - { - $this->_description->appendList('@start@', '@sep@ ', '@end@', array( - new \Hamcrest\SampleSelfDescriber('foo'), - new \Hamcrest\SampleSelfDescriber('bar') - )); - $this->assertEquals('@start@foo@sep@ bar@end@', (string) $this->_description); - } - - public function testSelfDescribingObjectsCanBeAppendedAsIteratedLists() - { - $items = new \ArrayObject(array( - new \Hamcrest\SampleSelfDescriber('foo'), - new \Hamcrest\SampleSelfDescriber('bar') - )); - $this->_description->appendList('@start@', '@sep@ ', '@end@', $items); - $this->assertEquals('@start@foo@sep@ bar@end@', (string) $this->_description); - } - - public function testSelfDescribingObjectsCanBeAppendedAsIterators() - { - $items = new \ArrayObject(array( - new \Hamcrest\SampleSelfDescriber('foo'), - new \Hamcrest\SampleSelfDescriber('bar') - )); - $this->_description->appendList('@start@', '@sep@ ', '@end@', $items->getIterator()); - $this->assertEquals('@start@foo@sep@ bar@end@', (string) $this->_description); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/IsEmptyStringTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/IsEmptyStringTest.php deleted file mode 100644 index 8d5c56be..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/IsEmptyStringTest.php +++ /dev/null @@ -1,86 +0,0 @@ -assertDoesNotMatch(emptyString(), null, 'null'); - } - - public function testEmptyDoesNotMatchZero() - { - $this->assertDoesNotMatch(emptyString(), 0, 'zero'); - } - - public function testEmptyDoesNotMatchFalse() - { - $this->assertDoesNotMatch(emptyString(), false, 'false'); - } - - public function testEmptyDoesNotMatchEmptyArray() - { - $this->assertDoesNotMatch(emptyString(), array(), 'empty array'); - } - - public function testEmptyMatchesEmptyString() - { - $this->assertMatches(emptyString(), '', 'empty string'); - } - - public function testEmptyDoesNotMatchNonEmptyString() - { - $this->assertDoesNotMatch(emptyString(), 'foo', 'non-empty string'); - } - - public function testEmptyHasAReadableDescription() - { - $this->assertDescription('an empty string', emptyString()); - } - - public function testEmptyOrNullMatchesNull() - { - $this->assertMatches(nullOrEmptyString(), null, 'null'); - } - - public function testEmptyOrNullMatchesEmptyString() - { - $this->assertMatches(nullOrEmptyString(), '', 'empty string'); - } - - public function testEmptyOrNullDoesNotMatchNonEmptyString() - { - $this->assertDoesNotMatch(nullOrEmptyString(), 'foo', 'non-empty string'); - } - - public function testEmptyOrNullHasAReadableDescription() - { - $this->assertDescription('(null or an empty string)', nullOrEmptyString()); - } - - public function testNonEmptyDoesNotMatchNull() - { - $this->assertDoesNotMatch(nonEmptyString(), null, 'null'); - } - - public function testNonEmptyDoesNotMatchEmptyString() - { - $this->assertDoesNotMatch(nonEmptyString(), '', 'empty string'); - } - - public function testNonEmptyMatchesNonEmptyString() - { - $this->assertMatches(nonEmptyString(), 'foo', 'non-empty string'); - } - - public function testNonEmptyHasAReadableDescription() - { - $this->assertDescription('a non-empty string', nonEmptyString()); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/IsEqualIgnoringCaseTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/IsEqualIgnoringCaseTest.php deleted file mode 100644 index 0539fd5c..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/IsEqualIgnoringCaseTest.php +++ /dev/null @@ -1,40 +0,0 @@ -assertDescription( - 'equalToIgnoringCase("heLLo")', - equalToIgnoringCase('heLLo') - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/IsEqualIgnoringWhiteSpaceTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/IsEqualIgnoringWhiteSpaceTest.php deleted file mode 100644 index 27ad338b..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/IsEqualIgnoringWhiteSpaceTest.php +++ /dev/null @@ -1,51 +0,0 @@ -_matcher = \Hamcrest\Text\IsEqualIgnoringWhiteSpace::equalToIgnoringWhiteSpace( - "Hello World how\n are we? " - ); - } - - protected function createMatcher() - { - return $this->_matcher; - } - - public function testPassesIfWordsAreSameButWhitespaceDiffers() - { - assertThat('Hello World how are we?', $this->_matcher); - assertThat(" Hello \rWorld \t how are\nwe?", $this->_matcher); - } - - public function testFailsIfTextOtherThanWhitespaceDiffers() - { - assertThat('Hello PLANET how are we?', not($this->_matcher)); - assertThat('Hello World how are we', not($this->_matcher)); - } - - public function testFailsIfWhitespaceIsAddedOrRemovedInMidWord() - { - assertThat('HelloWorld how are we?', not($this->_matcher)); - assertThat('Hello Wo rld how are we?', not($this->_matcher)); - } - - public function testFailsIfMatchingAgainstNull() - { - assertThat(null, not($this->_matcher)); - } - - public function testHasAReadableDescription() - { - $this->assertDescription( - "equalToIgnoringWhiteSpace(\"Hello World how\\n are we? \")", - $this->_matcher - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/MatchesPatternTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/MatchesPatternTest.php deleted file mode 100644 index 4891598f..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/MatchesPatternTest.php +++ /dev/null @@ -1,30 +0,0 @@ -assertDescription('a string matching "pattern"', matchesPattern('pattern')); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringContainsIgnoringCaseTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringContainsIgnoringCaseTest.php deleted file mode 100644 index 73023007..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringContainsIgnoringCaseTest.php +++ /dev/null @@ -1,80 +0,0 @@ -_stringContains = \Hamcrest\Text\StringContainsIgnoringCase::containsStringIgnoringCase( - strtolower(self::EXCERPT) - ); - } - - protected function createMatcher() - { - return $this->_stringContains; - } - - public function testEvaluatesToTrueIfArgumentContainsSpecifiedSubstring() - { - $this->assertTrue( - $this->_stringContains->matches(self::EXCERPT . 'END'), - 'should be true if excerpt at beginning' - ); - $this->assertTrue( - $this->_stringContains->matches('START' . self::EXCERPT), - 'should be true if excerpt at end' - ); - $this->assertTrue( - $this->_stringContains->matches('START' . self::EXCERPT . 'END'), - 'should be true if excerpt in middle' - ); - $this->assertTrue( - $this->_stringContains->matches(self::EXCERPT . self::EXCERPT), - 'should be true if excerpt is repeated' - ); - - $this->assertFalse( - $this->_stringContains->matches('Something else'), - 'should not be true if excerpt is not in string' - ); - $this->assertFalse( - $this->_stringContains->matches(substr(self::EXCERPT, 1)), - 'should not be true if part of excerpt is in string' - ); - } - - public function testEvaluatesToTrueIfArgumentIsEqualToSubstring() - { - $this->assertTrue( - $this->_stringContains->matches(self::EXCERPT), - 'should be true if excerpt is entire string' - ); - } - - public function testEvaluatesToTrueIfArgumentContainsExactSubstring() - { - $this->assertTrue( - $this->_stringContains->matches(strtolower(self::EXCERPT)), - 'should be false if excerpt is entire string ignoring case' - ); - $this->assertTrue( - $this->_stringContains->matches('START' . strtolower(self::EXCERPT) . 'END'), - 'should be false if excerpt is contained in string ignoring case' - ); - } - - public function testHasAReadableDescription() - { - $this->assertDescription( - 'a string containing in any case "' - . strtolower(self::EXCERPT) . '"', - $this->_stringContains - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringContainsInOrderTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringContainsInOrderTest.php deleted file mode 100644 index 4c465b29..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringContainsInOrderTest.php +++ /dev/null @@ -1,42 +0,0 @@ -_m = \Hamcrest\Text\StringContainsInOrder::stringContainsInOrder(array('a', 'b', 'c')); - } - - protected function createMatcher() - { - return $this->_m; - } - - public function testMatchesOnlyIfStringContainsGivenSubstringsInTheSameOrder() - { - $this->assertMatches($this->_m, 'abc', 'substrings in order'); - $this->assertMatches($this->_m, '1a2b3c4', 'substrings separated'); - - $this->assertDoesNotMatch($this->_m, 'cab', 'substrings out of order'); - $this->assertDoesNotMatch($this->_m, 'xyz', 'no substrings in string'); - $this->assertDoesNotMatch($this->_m, 'ac', 'substring missing'); - $this->assertDoesNotMatch($this->_m, '', 'empty string'); - } - - public function testAcceptsVariableArguments() - { - $this->assertMatches(stringContainsInOrder('a', 'b', 'c'), 'abc', 'substrings as variable arguments'); - } - - public function testHasAReadableDescription() - { - $this->assertDescription( - 'a string containing "a", "b", "c" in order', - $this->_m - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringContainsTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringContainsTest.php deleted file mode 100644 index bf4afa3c..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringContainsTest.php +++ /dev/null @@ -1,86 +0,0 @@ -_stringContains = \Hamcrest\Text\StringContains::containsString(self::EXCERPT); - } - - protected function createMatcher() - { - return $this->_stringContains; - } - - public function testEvaluatesToTrueIfArgumentContainsSubstring() - { - $this->assertTrue( - $this->_stringContains->matches(self::EXCERPT . 'END'), - 'should be true if excerpt at beginning' - ); - $this->assertTrue( - $this->_stringContains->matches('START' . self::EXCERPT), - 'should be true if excerpt at end' - ); - $this->assertTrue( - $this->_stringContains->matches('START' . self::EXCERPT . 'END'), - 'should be true if excerpt in middle' - ); - $this->assertTrue( - $this->_stringContains->matches(self::EXCERPT . self::EXCERPT), - 'should be true if excerpt is repeated' - ); - - $this->assertFalse( - $this->_stringContains->matches('Something else'), - 'should not be true if excerpt is not in string' - ); - $this->assertFalse( - $this->_stringContains->matches(substr(self::EXCERPT, 1)), - 'should not be true if part of excerpt is in string' - ); - } - - public function testEvaluatesToTrueIfArgumentIsEqualToSubstring() - { - $this->assertTrue( - $this->_stringContains->matches(self::EXCERPT), - 'should be true if excerpt is entire string' - ); - } - - public function testEvaluatesToFalseIfArgumentContainsSubstringIgnoringCase() - { - $this->assertFalse( - $this->_stringContains->matches(strtolower(self::EXCERPT)), - 'should be false if excerpt is entire string ignoring case' - ); - $this->assertFalse( - $this->_stringContains->matches('START' . strtolower(self::EXCERPT) . 'END'), - 'should be false if excerpt is contained in string ignoring case' - ); - } - - public function testIgnoringCaseReturnsCorrectMatcher() - { - $this->assertTrue( - $this->_stringContains->ignoringCase()->matches('EXceRpT'), - 'should be true if excerpt is entire string ignoring case' - ); - } - - public function testHasAReadableDescription() - { - $this->assertDescription( - 'a string containing "' - . self::EXCERPT . '"', - $this->_stringContains - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringEndsWithTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringEndsWithTest.php deleted file mode 100644 index 9a30f952..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringEndsWithTest.php +++ /dev/null @@ -1,62 +0,0 @@ -_stringEndsWith = \Hamcrest\Text\StringEndsWith::endsWith(self::EXCERPT); - } - - protected function createMatcher() - { - return $this->_stringEndsWith; - } - - public function testEvaluatesToTrueIfArgumentContainsSpecifiedSubstring() - { - $this->assertFalse( - $this->_stringEndsWith->matches(self::EXCERPT . 'END'), - 'should be false if excerpt at beginning' - ); - $this->assertTrue( - $this->_stringEndsWith->matches('START' . self::EXCERPT), - 'should be true if excerpt at end' - ); - $this->assertFalse( - $this->_stringEndsWith->matches('START' . self::EXCERPT . 'END'), - 'should be false if excerpt in middle' - ); - $this->assertTrue( - $this->_stringEndsWith->matches(self::EXCERPT . self::EXCERPT), - 'should be true if excerpt is at end and repeated' - ); - - $this->assertFalse( - $this->_stringEndsWith->matches('Something else'), - 'should be false if excerpt is not in string' - ); - $this->assertFalse( - $this->_stringEndsWith->matches(substr(self::EXCERPT, 0, strlen(self::EXCERPT) - 2)), - 'should be false if part of excerpt is at end of string' - ); - } - - public function testEvaluatesToTrueIfArgumentIsEqualToSubstring() - { - $this->assertTrue( - $this->_stringEndsWith->matches(self::EXCERPT), - 'should be true if excerpt is entire string' - ); - } - - public function testHasAReadableDescription() - { - $this->assertDescription('a string ending with "EXCERPT"', $this->_stringEndsWith); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringStartsWithTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringStartsWithTest.php deleted file mode 100644 index 3be201f1..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringStartsWithTest.php +++ /dev/null @@ -1,62 +0,0 @@ -_stringStartsWith = \Hamcrest\Text\StringStartsWith::startsWith(self::EXCERPT); - } - - protected function createMatcher() - { - return $this->_stringStartsWith; - } - - public function testEvaluatesToTrueIfArgumentContainsSpecifiedSubstring() - { - $this->assertTrue( - $this->_stringStartsWith->matches(self::EXCERPT . 'END'), - 'should be true if excerpt at beginning' - ); - $this->assertFalse( - $this->_stringStartsWith->matches('START' . self::EXCERPT), - 'should be false if excerpt at end' - ); - $this->assertFalse( - $this->_stringStartsWith->matches('START' . self::EXCERPT . 'END'), - 'should be false if excerpt in middle' - ); - $this->assertTrue( - $this->_stringStartsWith->matches(self::EXCERPT . self::EXCERPT), - 'should be true if excerpt is at beginning and repeated' - ); - - $this->assertFalse( - $this->_stringStartsWith->matches('Something else'), - 'should be false if excerpt is not in string' - ); - $this->assertFalse( - $this->_stringStartsWith->matches(substr(self::EXCERPT, 1)), - 'should be false if part of excerpt is at start of string' - ); - } - - public function testEvaluatesToTrueIfArgumentIsEqualToSubstring() - { - $this->assertTrue( - $this->_stringStartsWith->matches(self::EXCERPT), - 'should be true if excerpt is entire string' - ); - } - - public function testHasAReadableDescription() - { - $this->assertDescription('a string starting with "EXCERPT"', $this->_stringStartsWith); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsArrayTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsArrayTest.php deleted file mode 100644 index d13c24d2..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsArrayTest.php +++ /dev/null @@ -1,35 +0,0 @@ -assertDescription('an array', arrayValue()); - } - - public function testDecribesActualTypeInMismatchMessage() - { - $this->assertMismatchDescription('was null', arrayValue(), null); - $this->assertMismatchDescription('was a string "foo"', arrayValue(), 'foo'); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsBooleanTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsBooleanTest.php deleted file mode 100644 index 24309fc0..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsBooleanTest.php +++ /dev/null @@ -1,35 +0,0 @@ -assertDescription('a boolean', booleanValue()); - } - - public function testDecribesActualTypeInMismatchMessage() - { - $this->assertMismatchDescription('was null', booleanValue(), null); - $this->assertMismatchDescription('was a string "foo"', booleanValue(), 'foo'); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsCallableTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsCallableTest.php deleted file mode 100644 index 5098e21b..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsCallableTest.php +++ /dev/null @@ -1,103 +0,0 @@ -=')) { - $this->markTestSkipped('Closures require php 5.3'); - } - eval('assertThat(function () {}, callableValue());'); - } - - public function testEvaluatesToTrueIfArgumentImplementsInvoke() - { - if (!version_compare(PHP_VERSION, '5.3', '>=')) { - $this->markTestSkipped('Magic method __invoke() requires php 5.3'); - } - assertThat($this, callableValue()); - } - - public function testEvaluatesToFalseIfArgumentIsInvalidFunctionName() - { - if (function_exists('not_a_Hamcrest_function')) { - $this->markTestSkipped('Function "not_a_Hamcrest_function" must not exist'); - } - - assertThat('not_a_Hamcrest_function', not(callableValue())); - } - - public function testEvaluatesToFalseIfArgumentIsInvalidStaticMethodCallback() - { - assertThat( - array('Hamcrest\Type\IsCallableTest', 'noMethod'), - not(callableValue()) - ); - } - - public function testEvaluatesToFalseIfArgumentIsInvalidInstanceMethodCallback() - { - assertThat(array($this, 'noMethod'), not(callableValue())); - } - - public function testEvaluatesToFalseIfArgumentDoesntImplementInvoke() - { - assertThat(new \stdClass(), not(callableValue())); - } - - public function testEvaluatesToFalseIfArgumentDoesntMatchType() - { - assertThat(false, not(callableValue())); - assertThat(5.2, not(callableValue())); - } - - public function testHasAReadableDescription() - { - $this->assertDescription('a callable', callableValue()); - } - - public function testDecribesActualTypeInMismatchMessage() - { - $this->assertMismatchDescription( - 'was a string "invalid-function"', - callableValue(), - 'invalid-function' - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsDoubleTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsDoubleTest.php deleted file mode 100644 index 85c2a963..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsDoubleTest.php +++ /dev/null @@ -1,35 +0,0 @@ -assertDescription('a double', doubleValue()); - } - - public function testDecribesActualTypeInMismatchMessage() - { - $this->assertMismatchDescription('was null', doubleValue(), null); - $this->assertMismatchDescription('was a string "foo"', doubleValue(), 'foo'); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsIntegerTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsIntegerTest.php deleted file mode 100644 index ce5a51a9..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsIntegerTest.php +++ /dev/null @@ -1,36 +0,0 @@ -assertDescription('an integer', integerValue()); - } - - public function testDecribesActualTypeInMismatchMessage() - { - $this->assertMismatchDescription('was null', integerValue(), null); - $this->assertMismatchDescription('was a string "foo"', integerValue(), 'foo'); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsNumericTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsNumericTest.php deleted file mode 100644 index 1fd83efe..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsNumericTest.php +++ /dev/null @@ -1,53 +0,0 @@ -assertDescription('a number', numericValue()); - } - - public function testDecribesActualTypeInMismatchMessage() - { - $this->assertMismatchDescription('was null', numericValue(), null); - $this->assertMismatchDescription('was a string "foo"', numericValue(), 'foo'); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsObjectTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsObjectTest.php deleted file mode 100644 index a3b617c2..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsObjectTest.php +++ /dev/null @@ -1,34 +0,0 @@ -assertDescription('an object', objectValue()); - } - - public function testDecribesActualTypeInMismatchMessage() - { - $this->assertMismatchDescription('was null', objectValue(), null); - $this->assertMismatchDescription('was a string "foo"', objectValue(), 'foo'); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsResourceTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsResourceTest.php deleted file mode 100644 index d6ea5348..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsResourceTest.php +++ /dev/null @@ -1,34 +0,0 @@ -assertDescription('a resource', resourceValue()); - } - - public function testDecribesActualTypeInMismatchMessage() - { - $this->assertMismatchDescription('was null', resourceValue(), null); - $this->assertMismatchDescription('was a string "foo"', resourceValue(), 'foo'); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsScalarTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsScalarTest.php deleted file mode 100644 index 72a188d6..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsScalarTest.php +++ /dev/null @@ -1,39 +0,0 @@ -assertDescription('a scalar', scalarValue()); - } - - public function testDecribesActualTypeInMismatchMessage() - { - $this->assertMismatchDescription('was null', scalarValue(), null); - $this->assertMismatchDescription('was an array ["foo"]', scalarValue(), array('foo')); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsStringTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsStringTest.php deleted file mode 100644 index 557d5913..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Type/IsStringTest.php +++ /dev/null @@ -1,35 +0,0 @@ -assertDescription('a string', stringValue()); - } - - public function testDecribesActualTypeInMismatchMessage() - { - $this->assertMismatchDescription('was null', stringValue(), null); - $this->assertMismatchDescription('was a double <5.2F>', stringValue(), 5.2); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/UtilTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/UtilTest.php deleted file mode 100644 index 7248978c..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/UtilTest.php +++ /dev/null @@ -1,82 +0,0 @@ -assertSame($matcher, $newMatcher); - } - - public function testWrapValueWithIsEqualWrapsPrimitive() - { - $matcher = \Hamcrest\Util::wrapValueWithIsEqual('foo'); - $this->assertInstanceOf('Hamcrest\Core\IsEqual', $matcher); - $this->assertTrue($matcher->matches('foo')); - } - - public function testCheckAllAreMatchersAcceptsMatchers() - { - \Hamcrest\Util::checkAllAreMatchers(array( - new \Hamcrest\Text\MatchesPattern('/fo+/'), - new \Hamcrest\Core\IsEqual('foo'), - )); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testCheckAllAreMatchersFailsForPrimitive() - { - \Hamcrest\Util::checkAllAreMatchers(array( - new \Hamcrest\Text\MatchesPattern('/fo+/'), - 'foo', - )); - } - - private function callAndAssertCreateMatcherArray($items) - { - $matchers = \Hamcrest\Util::createMatcherArray($items); - $this->assertInternalType('array', $matchers); - $this->assertSameSize($items, $matchers); - foreach ($matchers as $matcher) { - $this->assertInstanceOf('\Hamcrest\Matcher', $matcher); - } - - return $matchers; - } - - public function testCreateMatcherArrayLeavesMatchersUntouched() - { - $matcher = new \Hamcrest\Text\MatchesPattern('/fo+/'); - $items = array($matcher); - $matchers = $this->callAndAssertCreateMatcherArray($items); - $this->assertSame($matcher, $matchers[0]); - } - - public function testCreateMatcherArrayWrapsPrimitiveWithIsEqualMatcher() - { - $matchers = $this->callAndAssertCreateMatcherArray(array('foo')); - $this->assertInstanceOf('Hamcrest\Core\IsEqual', $matchers[0]); - $this->assertTrue($matchers[0]->matches('foo')); - } - - public function testCreateMatcherArrayDoesntModifyOriginalArray() - { - $items = array('foo'); - $this->callAndAssertCreateMatcherArray($items); - $this->assertSame('foo', $items[0]); - } - - public function testCreateMatcherArrayUnwrapsSingleArrayElement() - { - $matchers = $this->callAndAssertCreateMatcherArray(array(array('foo'))); - $this->assertInstanceOf('Hamcrest\Core\IsEqual', $matchers[0]); - $this->assertTrue($matchers[0]->matches('foo')); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Xml/HasXPathTest.php b/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Xml/HasXPathTest.php deleted file mode 100644 index 67748871..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Xml/HasXPathTest.php +++ /dev/null @@ -1,198 +0,0 @@ - - - - alice - Alice Frankel - admin - - - bob - Bob Frankel - user - - - charlie - Charlie Chan - user - - -XML; - self::$doc = new \DOMDocument(); - self::$doc->loadXML(self::$xml); - - self::$html = << - - Home Page - - -

Heading

-

Some text

- - -HTML; - } - - protected function createMatcher() - { - return \Hamcrest\Xml\HasXPath::hasXPath('/users/user'); - } - - public function testMatchesWhenXPathIsFound() - { - assertThat('one match', self::$doc, hasXPath('user[id = "bob"]')); - assertThat('two matches', self::$doc, hasXPath('user[role = "user"]')); - } - - public function testDoesNotMatchWhenXPathIsNotFound() - { - assertThat( - 'no match', - self::$doc, - not(hasXPath('user[contains(id, "frank")]')) - ); - } - - public function testMatchesWhenExpressionWithoutMatcherEvaluatesToTrue() - { - assertThat( - 'one match', - self::$doc, - hasXPath('count(user[id = "bob"])') - ); - } - - public function testDoesNotMatchWhenExpressionWithoutMatcherEvaluatesToFalse() - { - assertThat( - 'no matches', - self::$doc, - not(hasXPath('count(user[id = "frank"])')) - ); - } - - public function testMatchesWhenExpressionIsEqual() - { - assertThat( - 'one match', - self::$doc, - hasXPath('count(user[id = "bob"])', 1) - ); - assertThat( - 'two matches', - self::$doc, - hasXPath('count(user[role = "user"])', 2) - ); - } - - public function testDoesNotMatchWhenExpressionIsNotEqual() - { - assertThat( - 'no match', - self::$doc, - not(hasXPath('count(user[id = "frank"])', 2)) - ); - assertThat( - 'one match', - self::$doc, - not(hasXPath('count(user[role = "admin"])', 2)) - ); - } - - public function testMatchesWhenContentMatches() - { - assertThat( - 'one match', - self::$doc, - hasXPath('user/name', containsString('ice')) - ); - assertThat( - 'two matches', - self::$doc, - hasXPath('user/role', equalTo('user')) - ); - } - - public function testDoesNotMatchWhenContentDoesNotMatch() - { - assertThat( - 'no match', - self::$doc, - not(hasXPath('user/name', containsString('Bobby'))) - ); - assertThat( - 'no matches', - self::$doc, - not(hasXPath('user/role', equalTo('owner'))) - ); - } - - public function testProvidesConvenientShortcutForHasXPathEqualTo() - { - assertThat('matches', self::$doc, hasXPath('count(user)', 3)); - assertThat('matches', self::$doc, hasXPath('user[2]/id', 'bob')); - } - - public function testProvidesConvenientShortcutForHasXPathCountEqualTo() - { - assertThat('matches', self::$doc, hasXPath('user[id = "charlie"]', 1)); - } - - public function testMatchesAcceptsXmlString() - { - assertThat('accepts XML string', self::$xml, hasXPath('user')); - } - - public function testMatchesAcceptsHtmlString() - { - assertThat('accepts HTML string', self::$html, hasXPath('body/h1', 'Heading')); - } - - public function testHasAReadableDescription() - { - $this->assertDescription( - 'XML or HTML document with XPath "/users/user"', - hasXPath('/users/user') - ); - $this->assertDescription( - 'XML or HTML document with XPath "count(/users/user)" <2>', - hasXPath('/users/user', 2) - ); - $this->assertDescription( - 'XML or HTML document with XPath "/users/user/name"' - . ' a string starting with "Alice"', - hasXPath('/users/user/name', startsWith('Alice')) - ); - } - - public function testHasAReadableMismatchDescription() - { - $this->assertMismatchDescription( - 'XPath returned no results', - hasXPath('/users/name'), - self::$doc - ); - $this->assertMismatchDescription( - 'XPath expression result was <3F>', - hasXPath('/users/user', 2), - self::$doc - ); - $this->assertMismatchDescription( - 'XPath returned ["alice", "bob", "charlie"]', - hasXPath('/users/user/id', 'Frank'), - self::$doc - ); - } -} diff --git a/vendor/hamcrest/hamcrest-php/tests/bootstrap.php b/vendor/hamcrest/hamcrest-php/tests/bootstrap.php deleted file mode 100644 index bc4958d1..00000000 --- a/vendor/hamcrest/hamcrest-php/tests/bootstrap.php +++ /dev/null @@ -1,11 +0,0 @@ - - - - . - - - - - - ../hamcrest - - - diff --git a/vendor/laravel/framework/CHANGELOG.md b/vendor/laravel/framework/CHANGELOG.md deleted file mode 100644 index 3d87325f..00000000 --- a/vendor/laravel/framework/CHANGELOG.md +++ /dev/null @@ -1,1416 +0,0 @@ -# Release Notes for 9.x - -## [Unreleased](https://github.com/laravel/framework/compare/v9.45.0...9.x) - - -## [v9.45.0](https://github.com/laravel/framework/compare/v9.44.0...v9.45.0) - 2022-12-20 - -### Added -- Allows the registration of custom, root-level anonymous component search paths. ([#45338](https://github.com/laravel/framework/pull/45338), [1ff0379](https://github.com/laravel/framework/commit/1ff0379d203ac836c3eeae567cc07b99c352b1e7)) -- Added decimal validation rule ([#45356](https://github.com/laravel/framework/pull/45356), [e89b2b0](https://github.com/laravel/framework/commit/e89b2b0bd0e43b8aecd72a55c546288576bb0370)) -- Added align property to button mail component ([#45362](https://github.com/laravel/framework/pull/45362)) -- Added whereUlid(param) support for routing ([#45372](https://github.com/laravel/framework/pull/45372)) - -### Fixed -- Fixed single line @php statements to not be parsed as php blocks in BladeCompiler ([#45333](https://github.com/laravel/framework/pull/45333)) -- Added missing code to set locale from model preferred locale in Maillable ([#45308](https://github.com/laravel/framework/pull/45308)) - -### Changed -- Vite: ability to prevent preload tag generation from attribute resolver callback ([#45283](https://github.com/laravel/framework/pull/45283)) -- Deprecation Test Improvements ([#45317](https://github.com/laravel/framework/pull/45317)) -- Do not allow nested arrays in whereIn method ([140c3a8](https://github.com/laravel/framework/commit/140c3a81d261669d0785aebe2599aed99991e890)) -- Bump ramsey/uuid ([#45367](https://github.com/laravel/framework/pull/45367)) - - -## [v9.44.0](https://github.com/laravel/framework/compare/v9.43.0...v9.44.0) - 2022-12-15 - -### Added -- Added `Illuminate/Auth/GuardHelpers::forgetUser()` ([#45208](https://github.com/laravel/framework/pull/45208)) -- Added sort option for schedule:list ([#45198](https://github.com/laravel/framework/pull/45198)) -- Added `ascii` and `ulid` validation rules ([#45218](https://github.com/laravel/framework/pull/45218)) -- Http client - allow to provide closure as "throwif" condition ([#45251](https://github.com/laravel/framework/pull/45251)) -- Support '/' as a possible column name in database ([#45268](https://github.com/laravel/framework/pull/45268)) -- Added Granular notifications queue connections ([#45264](https://github.com/laravel/framework/pull/45264)) -- Add support for native rename/drop column commands ([#45258](https://github.com/laravel/framework/pull/45258)) -- Add $encoding parameter to substr method ([#45300](https://github.com/laravel/framework/pull/45300)) -- Use Macroable in Session facade ([#45310](https://github.com/laravel/framework/pull/45310)) - -### Fixed -- Fixed aliasing with cursor pagination ([#45188](https://github.com/laravel/framework/pull/45188)) -- Fixed email verification request ([#45227](https://github.com/laravel/framework/pull/45227)) -- Return 500 http error, instead of 200, when dotenv fails to load ([#45235](https://github.com/laravel/framework/pull/45235)) -- Fixed bug on Job Batchs Table ([#45263](https://github.com/laravel/framework/pull/45263)) -- Fixed schedule:list crash when call() is given class-string ([#45306](https://github.com/laravel/framework/pull/45306)) -- Fixed Lack of Memory when failing a job with wrong variable passed on the method fail() ([#45291](https://github.com/laravel/framework/pull/45291)) -- Fixed errors occurring when encrypted cookies has been tampered with ([#45313](https://github.com/laravel/framework/pull/45313)) -- bug fix, change array_merge to array_replace to prevent reindex ([#45309](https://github.com/laravel/framework/pull/45309)) - -### Changed -- Allow BusFake to use custom BusRepository ([#45202](https://github.com/laravel/framework/pull/45202)) -- Improved error logging for unmatched routes and route not found ([#45206](https://github.com/laravel/framework/pull/45206)) -- Improve assertSeeText and assertDontSeeText test methods ([#45274](https://github.com/laravel/framework/pull/45274)) -- Improved `Illuminate/Auth/SessionGuard::clearUserDataFromStorage()` ([#45305](https://github.com/laravel/framework/pull/45305)) -- Allows shouldIgnoresDeprecationError() to be overriden ([#45299](https://github.com/laravel/framework/pull/45299)) - - -## [v9.43.0](https://github.com/laravel/framework/compare/v9.42.2...v9.43.0) - 2022-12-06 - -### Added -- Add support for eager loading specific columns to withWhereHas ([#45168](https://github.com/laravel/framework/pull/45168)) -- Add Policies to Model Show Command ([#45153](https://github.com/laravel/framework/pull/45153)) -- Added `Illuminate/Support/Stringable::whenIsUlid()` ([#45183](https://github.com/laravel/framework/pull/45183)) - -### Fixed -- Added missing reserved names in GeneratorCommand ([#45149](https://github.com/laravel/framework/pull/45149)) - -### Changed -- Allow to pass base64 key to env:encrypt command ([#45157](https://github.com/laravel/framework/pull/45157)) -- Replace model:show searched value with correct FQCN ([#45160](https://github.com/laravel/framework/pull/45160)) - - -## [v9.42.2](https://github.com/laravel/framework/compare/v9.42.1...v9.42.2) - 2022-11-30 - -### Changed -- Improved stubs and `Illuminate/Routing/ResourceRegistrar::getResourceMethods()` ([6ddf3b0](https://github.com/laravel/framework/commit/6ddf3b017ccb8486c8dc5ff5a09d051a40e094ca)) - - -## [v9.42.1](https://github.com/laravel/framework/compare/v9.42.0...v9.42.1) - 2022-11-30 - -### Revert -- Revert "[9.x] Create new Json ParameterBag Instance when cloning Request" ([#45147](https://github.com/laravel/framework/pull/45147)) - -### Fixed -- Mailable : fixes strict comparison with int value ([#45138](https://github.com/laravel/framework/pull/45138)) -- Address Dynamic Relation Resolver inconsiency issue with extended Models ([#45122](https://github.com/laravel/framework/pull/45122)) - - -## [v9.42.0](https://github.com/laravel/framework/compare/v9.41.0...v9.42.0) - 2022-11-29 - -### Added -- Added --rest option to queue:listen ([00a12e2](https://github.com/laravel/framework/commit/00a12e256f897d215012bddf76b6b6c0d66f7f67), [82fde9e](https://github.com/laravel/framework/commit/82fde9e0dc4f08f4c4db254b9449fd87652c40a6)) -- Added `Illuminate/Support/Stringable::isUlid()` ([#45100](https://github.com/laravel/framework/pull/45100)) -- Add news report_if and report_unless helpers functions ([#45093](https://github.com/laravel/framework/pull/45093)) -- Add callback to resolve custom mutex name of schedule events ([#45126](https://github.com/laravel/framework/pull/45126)) -- Add WorkOptions to WorkerStopping Event ([#45120](https://github.com/laravel/framework/pull/45120)) -- Added `singleton` and `creatable` options to `Illuminate/Routing/Console/ControllerMakeCommand` ([#44872](https://github.com/laravel/framework/pull/44872)) - -### Fixed -- Fix pure enums validation ([#45121](https://github.com/laravel/framework/pull/45121)) -- Prevent test issues with relations with the $touches property ([#45118](https://github.com/laravel/framework/pull/45118)) -- Fix factory breaking when trying to determine whether a relation is empty ([#45135](https://github.com/laravel/framework/pull/45135)) - -### Changed -- Allow set command description via AsCommand attribute ([#45117](https://github.com/laravel/framework/pull/45117)) -- Updated Mailable to prevent duplicated recipients ([#45119](https://github.com/laravel/framework/pull/45119)) - - -## [v9.41.0](https://github.com/laravel/framework/compare/v9.40.1...v9.41.0) - 2022-11-22 - -### Added -- Added `Illuminate/Validation/Rules/DatabaseRule::onlyTrashed()` ([#44989](https://github.com/laravel/framework/pull/44989)) -- Add some class rules in class Rule ([#44998](https://github.com/laravel/framework/pull/44998)) -- Added `Illuminate/View/ComponentAttributeBag::missing()` ([#45016](https://github.com/laravel/framework/pull/45016)) -- Added `Illuminate/Http/Concerns/InteractsWithInput::whenMissing()` ([#45019](https://github.com/laravel/framework/pull/45019)) -- Add isolation levels to SQL Server Connector ([#45023](https://github.com/laravel/framework/pull/45023)) -- Fix php artisan serve with PHP_CLI_SERVER_WORKERS > 1 ([#45041](https://github.com/laravel/framework/pull/45041)) -- Add ability to prune cancelled job batches ([#45034](https://github.com/laravel/framework/pull/45034)) -- Adding option for custom manifest filename on Vite Facade ([#45007](https://github.com/laravel/framework/pull/45007)) - -### Fixed -- Fix deprecation warning when comparing a password against a NULL database password ([#44986](https://github.com/laravel/framework/pull/44986), [206e465](https://github.com/laravel/framework/commit/206e465f9680ef4618009ddfeafa672f8015a511)) -- Outlook web dark mode email layout fix ([#45024](https://github.com/laravel/framework/pull/45024)) - -### Changed -- Improves queue:work command output ([#44971](https://github.com/laravel/framework/pull/44971)) -- Optimize Collection::containsStrict ([#44970](https://github.com/laravel/framework/pull/44970)) -- Make name required in `Illuminate/Testing/TestResponse::assertRedirectToRoute()` ([98a0301](https://github.com/laravel/framework/commit/98a03013ed74925f68040beee0937203b632f57d)) -- Strip key, secret and token from root config options on aws clients ([#44979](https://github.com/laravel/framework/pull/44979)) -- Allow customised implementation of the SendQueuedMailable job ([#45040](https://github.com/laravel/framework/pull/45040)) -- Validate uuid before route binding query ([#44945](https://github.com/laravel/framework/pull/44945)) - - -## [v9.40.1](https://github.com/laravel/framework/compare/v9.40.0...v9.40.1) - 2022-11-15 - -### Added -- `Illuminate/Support/Lottery::fix()` ([7bade4f](https://github.com/laravel/framework/commit/7bade4f486e7b600cc9a5d527fcfd85ead1e17db)) - - -## [v9.40.0](https://github.com/laravel/framework/compare/v9.39.0...v9.40.0) - 2022-11-15 - -### Added -- Include Eloquent Model Observers in model:show command ([#44884](https://github.com/laravel/framework/pull/44884)) -- Added "lowercase" validation rule ([#44883](https://github.com/laravel/framework/pull/44883)) -- Introduce `Lottery` class ([#44894](https://github.com/laravel/framework/pull/44894)) -- Added `/Illuminate/Testing/TestResponse::assertRedirectToRoute()` ([#44926](https://github.com/laravel/framework/pull/44926)) -- Add uppercase validation rule ([#44918](https://github.com/laravel/framework/pull/44918)) -- Added saveManyQuietly to the hasOneOrMany and belongsToMany relations ([#44913](https://github.com/laravel/framework/pull/44913)) - -### Fixed -- Fix HasAttributes::getMutatedAttributes for classes with constructor args ([#44829](https://github.com/laravel/framework/pull/44829)) - -### Changed -- Remove argument assignment for console ([#44888](https://github.com/laravel/framework/pull/44888)) -- Pass $maxExceptions from mailable to underlying job when queuing ([#44903](https://github.com/laravel/framework/pull/44903)) -- Make Vite::isRunningHot public ([#44900](https://github.com/laravel/framework/pull/44900)) -- Add method to be able to override the exception context format ([#44895](https://github.com/laravel/framework/pull/44895)) -- Add zero-width space to trimmed characters in TrimStrings middleware ([#44906](https://github.com/laravel/framework/pull/44906)) -- Show error if key:generate artisan command fails ([#44927](https://github.com/laravel/framework/pull/44927)) -- Update database version check for lock popping for PlanetScale ([#44925](https://github.com/laravel/framework/pull/44925)) -- Move function withoutTrashed into DatabaseRule ([#44938](https://github.com/laravel/framework/pull/44938)) -- Use write connection on Schema::getColumnListing() and Schema::hasTable() for MySQL and PostgreSQL ([#44946](https://github.com/laravel/framework/pull/44946)) - - -## [v9.39.0](https://github.com/laravel/framework/compare/v9.38.0...v9.39.0) - 2022-11-08 - -### Added -- Added template fragments to Blade ([#44774](https://github.com/laravel/framework/pull/44774)) -- Added source file to Collection's dd method output ([#44793](https://github.com/laravel/framework/pull/44793), [d2e0e85](https://github.com/laravel/framework/commit/d2e0e859f00579aeb2600fce2fe9fc3cca933f41)) -- Added `Illuminate/Support/Testing/Fakes/PendingBatchFake::dispatchAfterResponse()` ([#44815](https://github.com/laravel/framework/pull/44815)) -- Added `Illuminate/Foundation/Testing/Concerns/InteractsWithDatabase::assertDatabaseEmpty()` ([#44810](https://github.com/laravel/framework/pull/44810)) - -### Fixed -- Fixed `InteractsWithContainer::withoutMix()` ([#44822](https://github.com/laravel/framework/pull/44822)) - -### Changed -- Update `UpCommand::handle` that must return int ([#44807](https://github.com/laravel/framework/pull/44807)) -- Decouple database component from console component ([#44798](https://github.com/laravel/framework/pull/44798)) -- Improve input argument parsing for commands ([#44662](https://github.com/laravel/framework/pull/44662), [#44826](https://github.com/laravel/framework/pull/44826)) -- Added DatabaseBatchRepository to provides() in BusServiceProvider ([#44833](https://github.com/laravel/framework/pull/44833)) -- Move reusable onNotSuccessfulTest functionality to TestResponse ([#44827](https://github.com/laravel/framework/pull/44827)) -- Add CSP nonce to Vite reactRefresh inline script ([#44816](https://github.com/laravel/framework/pull/44816)) -- Allow route group method to be chained ([#44825](https://github.com/laravel/framework/pull/44825)) -- Remove __sleep() & __wakeup() from SerializesModels trait. ([#44847](https://github.com/laravel/framework/pull/44847)) -- Handle SQLite without ENABLE_DBSTAT_VTAB enabled in `Illuminate/Database/Console/DatabaseInspectionCommand::getSqliteTableSize()` ([#44867](https://github.com/laravel/framework/pull/44867)) -- Apply force flag when necessary in `Illuminate/Queue/Listener` ([#44862](https://github.com/laravel/framework/pull/44862)) -- De-couple Console component from framework ([#44864](https://github.com/laravel/framework/pull/44864)) -- Update Vite mock to return empty array for preloadedAssets ([#44858](https://github.com/laravel/framework/pull/44858)) - - -## [v9.38.0](https://github.com/laravel/framework/compare/v9.37.0...v9.38.0) - 2022-11-01 - -### Added -- Added `Illuminate/Routing/Route::flushController()` ([#44393](https://github.com/laravel/framework/pull/44393)) -- Added `Illuminate/Session/Store::setHandler()` ([#44736](https://github.com/laravel/framework/pull/44736)) -- Added dictionary to slug helper ([#44730](https://github.com/laravel/framework/pull/44730)) -- Added ability to set middleware based on notifiable instance and channel ([#44767](https://github.com/laravel/framework/pull/44767)) -- Added touchQuietly convenience method to Model ([#44722](https://github.com/laravel/framework/pull/44722)) -- Added `Illuminate/Routing/Router::removeMiddlewareFromGroup()` ([#44780](https://github.com/laravel/framework/pull/44780)) -- Allow queueable notifications to set maxExceptions ([#44773](https://github.com/laravel/framework/pull/44773)) -- Make migrate command isolated ([#44743](https://github.com/laravel/framework/pull/44743), [ac3252a](https://github.com/laravel/framework/commit/ac3252a4c2a4c94724cd5aeaf6268427d21f9e97)) - -### Fixed -- Fixed whenPivotLoaded(As) api resource methods when using Eloquent strict mode ([#44792](https://github.com/laravel/framework/pull/44792)) -- Fixed components view error when using $attributes in parent view ([#44778](https://github.com/laravel/framework/pull/44778)) -- Fixed problem with disregarding global scopes when using existOr and doesntExistOr methods on model query ([#44795](https://github.com/laravel/framework/pull/44795)) - -### Changed -- Recompiles views when necessary ([#44737](https://github.com/laravel/framework/pull/44737)) -- Throw meaningful exception when broadcast connection not configured ([#44745](https://github.com/laravel/framework/pull/44745)) -- Prevents booting of providers when running env:encrypt ([#44758](https://github.com/laravel/framework/pull/44758)) -- Added nonce for preloaded assets ([#44747](https://github.com/laravel/framework/pull/44747)) -- Inherit crossorigin attributes while preloading view ([#44800](https://github.com/laravel/framework/pull/44800)) - - -## [v9.37.0](https://github.com/laravel/framework/compare/v9.36.4...v9.37.0) - 2022-10-25 - -### Added -- Added optional verbose output when view caching ([#44673](https://github.com/laravel/framework/pull/44673)) -- Allow passing closure to rescue $report parameter ([#44710](https://github.com/laravel/framework/pull/44710)) -- Support preloading assets with Vite ([#44096](https://github.com/laravel/framework/pull/44096)) -- Added `Illuminate/Mail/Mailables/Content::htmlString()` ([#44703](https://github.com/laravel/framework/pull/44703)) - -### Fixed -- Fixed model:show registering getAttribute() as a null accessor ([#44683](https://github.com/laravel/framework/pull/44683)) -- Fix expectations for output assertions in PendingCommand ([#44723](https://github.com/laravel/framework/pull/44723)) - - -## [v9.36.4](https://github.com/laravel/framework/compare/v9.36.3...v9.36.4) - 2022-10-20 - -### Added -- Added rawValue to Database Query Builder (and Eloquent as wrapper) ([#44631](https://github.com/laravel/framework/pull/44631)) -- Added TransactionCommitting ([#44608](https://github.com/laravel/framework/pull/44608)) -- Added dontIncludeSource to CliDumper and HtmlDumper ([#44623](https://github.com/laravel/framework/pull/44623)) -- Added `Illuminate/Filesystem/FilesystemAdapter::checksum()` ([#44660](https://github.com/laravel/framework/pull/44660)) -- Added handlers for silently discarded and missing attribute violations ([#44664](https://github.com/laravel/framework/pull/44664)) - -### Reverted -- Reverted ["Let MustVerifyEmail to be used on models without id as primary key"](https://github.com/laravel/framework/pull/44613) ([#44672](https://github.com/laravel/framework/pull/44672)) - -### Changed -- Create new Json ParameterBag Instance when cloning Request ([#44671](https://github.com/laravel/framework/pull/44671)) -- Prevents booting providers when running env:decrypt ([#44654](https://github.com/laravel/framework/pull/44654)) - - -## [v9.36.3](https://github.com/laravel/framework/compare/v9.36.2...v9.36.3) - 2022-10-19 - -### Reverted -- Reverts micro-optimization on view events ([#44653](https://github.com/laravel/framework/pull/44653)) - -### Fixed -- Fixes blade not forgetting compiled views on view:clear ([#44643](https://github.com/laravel/framework/pull/44643)) -- Fixed `Illuminate/Database/Eloquent/Model::offsetExists()` ([#44642](https://github.com/laravel/framework/pull/44642)) -- Forget component's cache and factory between tests ([#44648](https://github.com/laravel/framework/pull/44648)) - -### Changed -- Bump Testbench dependencies ([#44651](https://github.com/laravel/framework/pull/44651)) - - -## [v9.36.2](https://github.com/laravel/framework/compare/v9.36.1...v9.36.2) - 2022-10-18 - -### Fixed -- Ensures view creators and composers are called when * is present ([#44636](https://github.com/laravel/framework/pull/44636)) - - -## [v9.36.1](https://github.com/laravel/framework/compare/v9.36.0...v9.36.1) - 2022-10-18 - -### Fixed -- Fixes livewire components that were using createBladeViewFromString ([#pull](https://github.com/laravel/framework/pull)) - - -## [v9.36.0](https://github.com/laravel/framework/compare/v9.35.1...v9.36.0) - 2022-10-18 - -### Added -- Added mailable assertions ([#44563](https://github.com/laravel/framework/pull/44563)) -- Added `Illuminate/Testing/TestResponse::assertContent()` ([#44580](https://github.com/laravel/framework/pull/44580)) -- Added to `Illuminate/Console/Concerns/InteractsWithIO::alert()` `$verbosity` param ([#44614](https://github.com/laravel/framework/pull/44614)) - -### Optimization -- Makes blade components blazing fast ([#44487](https://github.com/laravel/framework/pull/44487)) - -### Fixed -- Fixed `Illuminate/Filesystem/Filesystem::relativeLink()` ([#44519](https://github.com/laravel/framework/pull/44519)) -- Fixed for `model:show` failing with models that have null timestamp columns ([#44576](https://github.com/laravel/framework/pull/44576)) -- Allow Model::shouldBeStrict(false) to disable "strict mode" ([#44627](https://github.com/laravel/framework/pull/44627)) - -### Changed -- Dont require a host for sqlite connections in php artisan db ([#44585](https://github.com/laravel/framework/pull/44585)) -- Let MustVerifyEmail to be used on models without id as primary key ([#44613](https://github.com/laravel/framework/pull/44613)) -- Changed `Illuminate/Routing/Route::controllerMiddleware()` ([#44590](https://github.com/laravel/framework/pull/44590)) - - -## [v9.35.1](https://github.com/laravel/framework/compare/v9.35.0...v9.35.1) - 2022-10-11 - -### Fixed -- Remove check for `$viewFactory->exists($component)` in `Illuminate/View/Compilers/ComponentTagCompiler::componentClass` ([7c6db00](https://github.com/laravel/framework/commit/7c6db000928be240dfc6996537a0fed5b8c68ebb)) - - -## [v9.35.0](https://github.com/laravel/framework/compare/v9.34.0...v9.35.0) - 2022-10-11 - -### Added -- Allow loading trashed models for resource routes ([#44405](https://github.com/laravel/framework/pull/44405)) -- Added `Illuminate/Database/Eloquent/Model::shouldBeStrict()` and other ([#44283](https://github.com/laravel/framework/pull/44283)) -- Controller middleware without resolving controller ([#44516](https://github.com/laravel/framework/pull/44516)) -- Alternative Mailable Syntax ([#44462](https://github.com/laravel/framework/pull/44462)) - -### Fixed -- Fix issue with aggregates (withSum, etc.) for pivot columns on self-referencing many-to-many relations ([#44286](https://github.com/laravel/framework/pull/44286)) -- Fixes issue using static class properties as blade attributes ([#44473](https://github.com/laravel/framework/pull/44473)) -- Traversable should have priority over JsonSerializable in EnumerateValues ([#44456](https://github.com/laravel/framework/pull/44456)) -- Fixed `make:cast --inbound` so it's a boolean option, not value ([#44505](https://github.com/laravel/framework/pull/44505)) - -### Changed -- Testing methods. Making error messages with json_encode more readable ([#44397](https://github.com/laravel/framework/pull/44397)) -- Have 'Model::withoutTimestamps()' return the callback's return value ([#44457](https://github.com/laravel/framework/pull/44457)) -- only load trashed models on relevant routes ([#44478](https://github.com/laravel/framework/pull/44478)) -- Adding additional PHP extensions to shouldBlockPhpUpload Function ([#44512](https://github.com/laravel/framework/pull/44512)) -- Register cutInternals casters for particularly noisy objects ([#44514](https://github.com/laravel/framework/pull/44514)) -- Use get methods to access application locale ([#44521](https://github.com/laravel/framework/pull/44521)) -- return only on non empty response from channels ([09d53ee](https://github.com/laravel/framework/commit/09d53eea674db7daa8bb65aa8fa7f2ca95e62b8d), [3944a3e](https://github.com/laravel/framework/commit/3944a3e34fe860633c77b574bbfbbcdabcf7d1e7)) -- Correct channel matching ([#44531](https://github.com/laravel/framework/pull/44531)) -- Migrate mail components ([#44527](https://github.com/laravel/framework/pull/44527)) - - -## [v9.34.0](https://github.com/laravel/framework/compare/v9.33.0...v9.34.0) - 2022-10-04 - -### Added -- Short attribute syntax for Self Closing Blade Components ([#44413](https://github.com/laravel/framework/pull/44413)) -- Adds support for PHP's BackedEnum to be "rendered" on blade views ([#44445](https://github.com/laravel/framework/pull/44445)) - -### Fixed -- Fixed Precognition headers for Symfony responses ([#44424](https://github.com/laravel/framework/pull/44424)) -- Allow to create databases with dots ([#44436](https://github.com/laravel/framework/pull/44436)) -- Fixes dd source on windows ([#44451](https://github.com/laravel/framework/pull/44451)) - -### Changed -- Adds error output to db command when missing host ([#44394](https://github.com/laravel/framework/pull/44394)) -- Changed `Illuminate/Database/Schema/ForeignIdColumnDefinition::constrained()` ([#44425](https://github.com/laravel/framework/pull/44425)) -- Allow maintenance mode events to be listened to in closure based listeners ([#44417](https://github.com/laravel/framework/pull/44417)) -- Allow factories to recycle multiple models of a given typ ([#44328](https://github.com/laravel/framework/pull/44328)) -- Improves dd clickable link on multiple editors and docker environments ([#44406](https://github.com/laravel/framework/pull/44406)) - - -## [v9.33.0](https://github.com/laravel/framework/compare/v9.32.0...v9.33.0) - 2022-09-30 - -### Added -- Added `Illuminate/Support/Testing/Fakes/MailFake::cc()` ([#44319](https://github.com/laravel/framework/pull/44319)) -- Added Ignore Case of Str::contains and Str::containsAll to Stringable contains and containsAll ([#44369](https://github.com/laravel/framework/pull/44369)) -- Added missing morphs methods for the ULID support ([#44364](https://github.com/laravel/framework/pull/44364)) -- Introduce Laravel Precognition ([#44339](https://github.com/laravel/framework/pull/44339)) -- Added `Illuminate/Routing/Route::flushController()` ([#44386](https://github.com/laravel/framework/pull/44386)) - -### Fixed -- Fixes memory leak on PHPUnit's Annotations registry ([#44324](https://github.com/laravel/framework/pull/44324), [#44336](https://github.com/laravel/framework/pull/44336)) -- Fixed `Illuminate/Filesystem/FilesystemAdapter::url()` with config `prefix` ([#44330](https://github.com/laravel/framework/pull/44330)) -- Fixed the "Implicit conversion from float to int loses precision" error in Timebox Class ([#44357](https://github.com/laravel/framework/pull/44357)) - -### Changed -- Improves dd source on compiled views ([#44347](https://github.com/laravel/framework/pull/44347)) -- Only prints source on dd calls from dump.php ([#44367](https://github.com/laravel/framework/pull/44367)) -- Ensures a Carbon version that supports PHP 8.2 ([#44374](https://github.com/laravel/framework/pull/44374)) - - -## [v9.32.0](https://github.com/laravel/framework/compare/v9.31.0...v9.32.0) - 2022-09-27 - -### Added -- New env:encrypt and env:decrypt commands ([#44034](https://github.com/laravel/framework/pull/44034)) -- Share WithoutOverlapping key across jobs ([#44227](https://github.com/laravel/framework/pull/44227)) -- Add missing citext type mapping to `Illuminate/Database/Console/DatabaseInspectionCommand::$typeMappings` ([#44237](https://github.com/laravel/framework/pull/44237)) -- Short attribute syntax for Blade Components ([#44217](https://github.com/laravel/framework/pull/44217)) -- Adds source file to dd function output ([#44211](https://github.com/laravel/framework/pull/44211)) -- Add methods to get request data as integer or float ([#44239](https://github.com/laravel/framework/pull/44239)) -- Adds Eloquent User Provider query handler ([#44226](https://github.com/laravel/framework/pull/44226)) -- Added `Illuminate/Support/Testing/Fakes/BusFake::dispatchFakeBatch()` ([#44176](https://github.com/laravel/framework/pull/44176)) -- Added methods to cast Stringables ([#44238](https://github.com/laravel/framework/pull/44238)) -- Added `Illuminate/Routing/UrlGenerator::withKeyResolver()` ([#44254](https://github.com/laravel/framework/pull/44254)) -- Add a hook to the serialisation of collections ([#44272](https://github.com/laravel/framework/pull/44272)) -- Allow enum route bindings to have default values ([#44255](https://github.com/laravel/framework/pull/44255)) -- Added benchmark utility class ([b4293d7](https://github.com/laravel/framework/commit/b4293d7c18b08b363ac0af64ec04fb1d559b4698), [#44297](https://github.com/laravel/framework/pull/44297)) -- Added `Illuminate/Console/Scheduling/ManagesFrequencies::everyOddHour()` ([#44288](https://github.com/laravel/framework/pull/44288)) - -### Fixed -- Fix incrementing string keys ([#44247](https://github.com/laravel/framework/pull/44247)) -- Fix bug in Fluent Class with named arguments in migrations ([#44251](https://github.com/laravel/framework/pull/44251)) -- Fix "about" command caching report ([#44305](https://github.com/laravel/framework/pull/44305)) -- Fixes memory leaks ([#44306](https://github.com/laravel/framework/pull/44306), [#44307](https://github.com/laravel/framework/pull/44307)) - -### Changed -- Patch for timeless timing attack vulnerability in user login ([#44069](https://github.com/laravel/framework/pull/44069)) -- Refactor: register commands in artisan service ([#44257](https://github.com/laravel/framework/pull/44257)) -- Allow factories to recycle models with for method ([#44265](https://github.com/laravel/framework/pull/44265)) -- Use dedicated method for placeholder replacement in validator ([#44296](https://github.com/laravel/framework/pull/44296)) - - -## [v9.31.0](https://github.com/laravel/framework/compare/v9.30.1...v9.31.0) - 2022-09-20 - -### Added -- Added unique deferrable initially deferred constants for PostgreSQL ([#44127](https://github.com/laravel/framework/pull/44127)) -- Request lifecycle duration handler ([#44122](https://github.com/laravel/framework/pull/44122)) -- Added Model::withoutTimestamps(...) ([#44138](https://github.com/laravel/framework/pull/44138)) -- Added manifestHash function to Illuminate\Foundation\Vite ([#44136](https://github.com/laravel/framework/pull/44136)) -- Added support for operator <=> in `/Illuminate/Collections/Traits/EnumeratesValues::operatorForWhere()` ([#44154](https://github.com/laravel/framework/pull/44154)) -- Added that Illuminate/Database/Connection::registerDoctrineType() can accept object as well as classname for new doctrine type ([#44149](https://github.com/laravel/framework/pull/44149)) -- Added Fake Batches ([#44104](https://github.com/laravel/framework/pull/44104), [#44173](https://github.com/laravel/framework/pull/44173)) -- Added `Model::getAppends()` ([#44180](https://github.com/laravel/framework/pull/44180)) -- Added missing Str::wrap() static method ([#44207](https://github.com/laravel/framework/pull/44207)) -- Added require `symfony/uid` ([#44202](https://github.com/laravel/framework/pull/44202)) -- Make Vite macroable ([#44198](https://github.com/laravel/framework/pull/44198)) - -### Fixed -- Async fix in `Illuminate/Http/Client/PendingRequest` ([#44179](https://github.com/laravel/framework/pull/44179)) -- Fixes artisan serve command with PHP_CLI_SERVER_WORKERS environment variable ([#44204](https://github.com/laravel/framework/pull/44204)) -- Fixed `InteractsWithDatabase::castAsJson($value)` incorrectly handles SQLite Database ([#44196](https://github.com/laravel/framework/pull/44196)) - -### Changed -- Improve Blade compilation exception messages ([#44134](https://github.com/laravel/framework/pull/44134)) -- Improve test failure output ([#43943](https://github.com/laravel/framework/pull/43943)) -- Prompt to create MySQL db when migrating ([#44153](https://github.com/laravel/framework/pull/44153)) -- Improve UUID and ULID support for Eloquent ([#44146](https://github.com/laravel/framework/pull/44146)) - - -## [v9.30.1](https://github.com/laravel/framework/compare/v9.30.0...v9.30.1) - 2022-09-15 - -### Added -- Allow using a model instance in place of nested model factories ([#44107](https://github.com/laravel/framework/pull/44107)) -- Added UUID and ULID support for Eloquent ([#44074](https://github.com/laravel/framework/pull/44074)) -- Implement except method for fake classes to define what should not be faked ([#44117](https://github.com/laravel/framework/pull/44117)) -- Added interacts with queue middleware to send queued mailable ([#44124](https://github.com/laravel/framework/pull/44124)) -- Added new exception string to `Illuminate/Database/DetectsLostConnections` ([#44121](https://github.com/laravel/framework/pull/44121)) - -### Fixed -- Fixed BC from [Passing event into viaQueue and viaConnection of Queued Listener](https://github.com/laravel/framework/pull/44080) ([#44137](https://github.com/laravel/framework/pull/44137)) - -### Changed -- Enhance column modifying ([#44101](https://github.com/laravel/framework/pull/44101)) -- Allow to define which jobs should be actually dispatched when using Bus::fake ([#44106](https://github.com/laravel/framework/pull/44106)) - - -## [v9.30.0](https://github.com/laravel/framework/compare/v9.29.0...v9.30.0) - 2022-09-13 - -### Added -- Added stop_buffering config option to logger ([#44071](https://github.com/laravel/framework/pull/44071)) -- Added read-only filesystem adapter decoration as a config option ([#44079](https://github.com/laravel/framework/pull/44079)) -- Added scoped filesystem driver ([#44105](https://github.com/laravel/framework/pull/44105)) -- Add force option to all make commands ([#44100](https://github.com/laravel/framework/pull/44100)) - -### Fixed -- Fixed QueryBuilder whereNot with array conditions ([#44083](https://github.com/laravel/framework/pull/44083)) - -### Changed -- Passing event into viaQueue and viaConnection of Queued Listener ([#44080](https://github.com/laravel/framework/pull/44080)) -- Improve testability of batched jobs ([#44075](https://github.com/laravel/framework/pull/44075)) -- Allow any kind of whitespace in cron expression ([#44110](https://github.com/laravel/framework/pull/44110)) - - -## [v9.29.0](https://github.com/laravel/framework/compare/v9.28.0...v9.29.0) - 2022-09-09 - -### Added -- Added RequiredIfAccepted validation rule ([#44035](https://github.com/laravel/framework/pull/44035)) -- Added `Illuminate/Foundation/Vite::assetPath()` ([#44037](https://github.com/laravel/framework/pull/44037)) -- Added ability to discard Eloquent Model changes ([#43772](https://github.com/laravel/framework/pull/43772)) -- Added ability to determine if attachments exist to `Illuminate/Mail/Mailable` ([#43967](https://github.com/laravel/framework/pull/43967)) -- Added `Illuminate/Support/Testing/Fakes/BusFake::assertNothingBatched()` ([#44056](https://github.com/laravel/framework/pull/44056)) - -### Reverted -- Reverted [Fixed RoueGroup::merge to format merged prefixes correctly](https://github.com/laravel/framework/pull/44011). ([#44072](https://github.com/laravel/framework/pull/44072)) - -### Fixed -- Avoid Passing null to parameter exception on PHP 8.1 ([#43951](https://github.com/laravel/framework/pull/43951)) -- Align Remember Me Cookie Duration with CookieJar expiration ([#44026](https://github.com/laravel/framework/pull/44026)) -- Fix Stringable typehints with Enumerable ([#44030](https://github.com/laravel/framework/pull/44030)) -- Fixed middleware "SetCacheHeaders" with file responses ([#44063](https://github.com/laravel/framework/pull/44063)) - -### Changed -- Don't use locks for queue job popping for PlanetScale's MySQL-compatible Vitess engine ([#44027](https://github.com/laravel/framework/pull/44027)) -- Avoid matching 'use' in custom Stub templates in `Illuminate/Console/GeneratorCommand.php` ([#44049](https://github.com/laravel/framework/pull/44049)) - - -## [v9.28.0](https://github.com/laravel/framework/compare/v9.27.0...v9.28.0) - 2022-09-06 - -### Added -- Added view data assertions to TestView ([#43923](https://github.com/laravel/framework/pull/43923)) -- Added `Illuminate/Routing/Redirector::getIntendedUrl()` ([#43938](https://github.com/laravel/framework/pull/43938)) -- Added Eloquent mode to prevent prevently silently discarding fills for attributes not in $fillable ([#43893](https://github.com/laravel/framework/pull/43893)) -- Added `Illuminate/Testing/PendingCommand::assertOk()` ([#43968](https://github.com/laravel/framework/pull/43968)) -- Make Application macroable ([#43966](https://github.com/laravel/framework/pull/43966)) -- Introducing Signal Traps ([#43933](https://github.com/laravel/framework/pull/43933)) -- Allow registering instances of commands ([#43986](https://github.com/laravel/framework/pull/43986)) -- Support Enumerable in Stringable ([#44012](https://github.com/laravel/framework/pull/44012)) - -### Fixed -- Fixed RoueGroup::merge to format merged prefixes correctly. ([#44011](https://github.com/laravel/framework/pull/44011)) -- Fixes providesTemporaryUrls on AwsS3V3Adapter ([#44009](https://github.com/laravel/framework/pull/44009)) -- Fix ordering of stylesheets when using @vite ([#43962](https://github.com/laravel/framework/pull/43962)) - -### Changed -- Allow invokable rules to specify custom messsages ([#43925](https://github.com/laravel/framework/pull/43925)) -- Support objects like GMP for custom Model casts ([#43959](https://github.com/laravel/framework/pull/43959)) -- Default 404 message on denyAsNotFound ([#43901](https://github.com/laravel/framework/pull/43901)) -- Changed `Illuminate/Container/Container::resolvePrimitive()` for isVariadic() ([#43985](https://github.com/laravel/framework/pull/43985)) -- Allow validator messages to use nested arrays ([#43981](https://github.com/laravel/framework/pull/43981)) -- Ensure freezeUuids always resets UUID creation after exception in callback ([#44018](https://github.com/laravel/framework/pull/44018)) - - -## [v9.27.0](https://github.com/laravel/framework/compare/v9.26.1...v9.27.0) - 2022-08-30 - -### Added -- Add getter and setter for connection in the DatabaseBatchRepository class ([#43869](https://github.com/laravel/framework/pull/43869)) - -### Fixed -- Fix for potential bug with non-backed enums ([#43842](https://github.com/laravel/framework/pull/43842)) -- Patch nested array validation rule regression bug ([#43897](https://github.com/laravel/framework/pull/43897)) -- Fix registering event listeners with array callback ([#43890](https://github.com/laravel/framework/pull/43890)) - -### Changed -- Explicitly add column name to SQLite query in `Illuminate/Database/Console/DatabaseInspectionCommand::getSqliteTableSize()` ([#43832](https://github.com/laravel/framework/pull/43832)) -- Allow broadcast on demand notifications ([d2b1446](https://github.com/laravel/framework/commit/d2b14466c27a3d62219256cea27088e6ecd9d32f)) -- Make Vite::hotFile() public ([#43875](https://github.com/laravel/framework/pull/43875)) -- Prompt to create sqlite db when migrating ([#43867](https://github.com/laravel/framework/pull/43867)) -- Call prepare() on HttpException responses ([#43895](https://github.com/laravel/framework/pull/43895)) -- Make the model:prune command easier to extend ([#43919](https://github.com/laravel/framework/pull/43919)) - - -## [v9.26.1](https://github.com/laravel/framework/compare/v9.26.0...v9.26.1) - 2022-08-23 - -### Revert -- Revert "[9.x] Add statusText for an assertion message" ([#43831](https://github.com/laravel/framework/pull/43831)) - -### Fixed -- Fixed `withoutVite` ([#43826](https://github.com/laravel/framework/pull/43826)) - - -## [v9.26.0](https://github.com/laravel/framework/compare/v9.25.1...v9.26.0) - 2022-08-23 - -### Added -- Adding support for non-backed enums in Models ([#43728](https://github.com/laravel/framework/pull/43728)) -- Added vite asset url helpers ([#43702](https://github.com/laravel/framework/pull/43702)) -- Added Authentication keyword for SqlServerConnector.php ([#43757](https://github.com/laravel/framework/pull/43757)) -- Added support for additional where* methods to route groups ([#43731](https://github.com/laravel/framework/pull/43731)) -- Added min_digits and max_digits validation ([#43797](https://github.com/laravel/framework/pull/43797)) -- Added closure support to dispatch conditionals in bus ([#43784](https://github.com/laravel/framework/pull/43784)) -- Added configurable paths to Vite ([#43620](https://github.com/laravel/framework/pull/43620)) - -### Fixed -- Fix unique lock release for broadcast events ([#43738](https://github.com/laravel/framework/pull/43738)) -- Fix empty collection class serialization ([#43758](https://github.com/laravel/framework/pull/43758)) -- Fixes creation of deprecations channel ([#43812](https://github.com/laravel/framework/pull/43812)) - -### Changed -- Improve display of failures for assertDatabaseHas ([#43736](https://github.com/laravel/framework/pull/43736)) -- Always use the write PDO connection to read the just stored pending batch in bus ([#43737](https://github.com/laravel/framework/pull/43737)) -- Move unique lock release to method ([#43740](https://github.com/laravel/framework/pull/43740)) -- Remove timeoutAt fallback from Job base class ([#43749](https://github.com/laravel/framework/pull/43749)) -- Convert closures to arrow functions ([#43778](https://github.com/laravel/framework/pull/43778)) -- Use except also in `Illuminate/Routing/Middleware/ValidateSignature::handle()` ([e554d47](https://github.com/laravel/framework/commit/e554d471daab568877c039e955a01cb2f06a2e7b)) -- Adjust forever time for cookies ([#43806](https://github.com/laravel/framework/pull/43806)) -- Make string padding UTF-8 safe ([f1762ed](https://github.com/laravel/framework/commit/f1762ed1660f2a71189f1a32efe5b410ec428268)) - - -## [v9.25.1](https://github.com/laravel/framework/compare/v9.25.0...v9.25.1) - 2022-08-16 - -### Fixes -- [Fixed typos](https://github.com/laravel/framework/compare/v9.25.0...v9.25.1) - - -## [v9.25.0](https://github.com/laravel/framework/compare/v9.24.0...v9.25.0) - 2022-08-16 - -### Added -- Added whenNotExactly to Stringable ([#43700](https://github.com/laravel/framework/pull/43700)) -- Added ability to Model::query()->touch() to mass update timestamps ([#43665](https://github.com/laravel/framework/pull/43665)) - -### Fixed -- Prevent error in db/model commands when using unsupported columns ([#43635](https://github.com/laravel/framework/pull/43635)) -- Fixes ensureDependenciesExist runtime error ([#43626](https://github.com/laravel/framework/pull/43626)) -- Null value for auto-cast field caused deprication warning in php 8.1 ([#43706](https://github.com/laravel/framework/pull/43706)) -- db:table command properly handle table who doesn't exist ([#43669](https://github.com/laravel/framework/pull/43669)) - -### Changed -- Handle assoc mode within db commands ([#43636](https://github.com/laravel/framework/pull/43636)) -- Allow chunkById on Arrays, as well as Models ([#43666](https://github.com/laravel/framework/pull/43666)) -- Allow for int value parameters to whereMonth() and whereDay() ([#43668](https://github.com/laravel/framework/pull/43668)) -- Cleaning up old if-else statement ([#43712](https://github.com/laravel/framework/pull/43712)) -- Ensure correct 'integrity' value is used for css assets ([#43714](https://github.com/laravel/framework/pull/43714)) - - -## [v9.24.0](https://github.com/laravel/framework/compare/v9.23.0...v9.24.0) - 2022-08-09 - -### Added -- New db:show, db:table and db:monitor commands ([#43367](https://github.com/laravel/framework/pull/43367)) -- Added validation doesnt_end_with rule ([#43518](https://github.com/laravel/framework/pull/43518)) -- Added `Illuminate/Database/Eloquent/SoftDeletes::restoreQuietly()` ([#43550](https://github.com/laravel/framework/pull/43550)) -- Added mergeUnless to resource ConditionallyLoadsAttributes trait ([#43567](https://github.com/laravel/framework/pull/43567)) -- Added `Illuminate/Support/Testing/Fakes/NotificationFake::sentNotifications()` ([#43558](https://github.com/laravel/framework/pull/43558)) -- Added `implode` to `Passthru` in `Illuminate/Database/Eloquent/Builder.php` ([#43574](https://github.com/laravel/framework/pull/43574)) -- Make Config repository macroable ([#43598](https://github.com/laravel/framework/pull/43598)) -- Add whenNull to ConditionallyLoadsAtrribute trait ([#43600](https://github.com/laravel/framework/pull/43600)) -- Extract child route model relationship name into a method ([#43597](https://github.com/laravel/framework/pull/43597)) - -### Revert -- Reverted [Added `whereIn` to `Illuminate/Routing/RouteRegistrar::allowedAttributes`](https://github.com/laravel/framework/pull/43509) ([#43523](https://github.com/laravel/framework/pull/43523)) - -### Fixed -- Fix unique locking on broadcast events ([#43516](https://github.com/laravel/framework/pull/43516)) -- Fixes the issue of running docs command on windows ([#43566](https://github.com/laravel/framework/pull/43566), [#43585](https://github.com/laravel/framework/pull/43585)) -- Fixes output when running db:seed or using --seed in migrate commands ([#43593](https://github.com/laravel/framework/pull/43593)) - -### Changed -- Gracefully fail when unable to locate expected binary on the system for artisan docs command ([#43521](https://github.com/laravel/framework/pull/43521)) -- Improve output for some Artisan commands ([#43547](https://github.com/laravel/framework/pull/43547)) -- Alternative database name in Postgres DSN, allow pgbouncer aliased databases to continue working on 9.x ([#43542](https://github.com/laravel/framework/pull/43542)) -- Allow @class() for component tags ([#43140](https://github.com/laravel/framework/pull/43140)) -- Attribute Cast Performance Improvements ([#43554](https://github.com/laravel/framework/pull/43554)) -- Queue worker daemon should also listen for SIGQUIT ([#43607](https://github.com/laravel/framework/pull/43607)) -- Keep original keys when using Collection->sortBy() with an array of sort operations ([#43609](https://github.com/laravel/framework/pull/43609)) - - -## [v9.23.0](https://github.com/laravel/framework/compare/v9.22.1...v9.23.0) - 2022-08-02 - -### Added -- Added whereNot method to Fluent JSON testing matchers ([#43383](https://github.com/laravel/framework/pull/43383)) -- Added deleteQuietly method to Model and use arrow func for related methods ([#43447](https://github.com/laravel/framework/pull/43447)) -- Added conditionable trait to Filesystem adapters ([#43450](https://github.com/laravel/framework/pull/43450)) -- Introduce artisan docs command ([#43357](https://github.com/laravel/framework/pull/43357)) -- Added Support CSP nonce, SRI, and arbitrary attributes with Vite ([#43442](https://github.com/laravel/framework/pull/43442)) -- Support conditionables that get condition from target object ([#43449](https://github.com/laravel/framework/pull/43449)) -- Added `whereIn` to `Illuminate/Routing/RouteRegistrar::allowedAttributes` ([#43509](https://github.com/laravel/framework/pull/43509)) - -### Fixed -- Prevent redis crash when large number of jobs are scheduled for a specific time ([#43310](https://github.com/laravel/framework/pull/43310)) - -### Changed -- Make Command components Factory extensible ([#43439](https://github.com/laravel/framework/pull/43439)) -- Solve Blade component showing quote formatted for the console ([#43446](https://github.com/laravel/framework/pull/43446)) -- Improves output capture from serve command ([#43461](https://github.com/laravel/framework/pull/43461)) -- Allow terser singleton bindings ([#43469](https://github.com/laravel/framework/pull/43469)) - - -## [v9.22.1](https://github.com/laravel/framework/compare/v9.22.0...v9.22.1) - 2022-07-26 - -### Added -- Added unique locking to broadcast events ([#43416](https://github.com/laravel/framework/pull/43416)) - -### Fixed -- Fixes Artisan serve command on Windows ([#43437](https://github.com/laravel/framework/pull/43437)) - - -## [v9.22.0](https://github.com/laravel/framework/compare/v9.21.6...v9.22.0) - 2022-07-26 - -### Added -- Added ability to attach an array of files in MailMessage ([#43080](https://github.com/laravel/framework/pull/43080)) -- Added conditional lines to MailMessage ([#43387](https://github.com/laravel/framework/pull/43387)) -- Add support for multiple hash algorithms to `Illuminate/Filesystem/Filesystem::hash()` ([#43407](https://github.com/laravel/framework/pull/43407)) - -### Fixed -- Fixes for model:show when attribute default is an enum ([#43370](https://github.com/laravel/framework/pull/43370)) -- Fixed DynamoDB locks with 0 seconds duration ([#43365](https://github.com/laravel/framework/pull/43365)) -- Fixed overriding global locale ([#43426](https://github.com/laravel/framework/pull/43426)) - -### Changed -- Round milliseconds in console output runtime ([#43400](https://github.com/laravel/framework/pull/43400)) -- Improves serve Artisan command ([#43375](https://github.com/laravel/framework/pull/43375)) - - -## [v9.21.6](https://github.com/laravel/framework/compare/v9.21.5...v9.21.6) - 2022-07-22 - -### Revert -- Revert ["Protect against ambiguous columns"](https://github.com/laravel/framework/pull/43278) ([#43362](https://github.com/laravel/framework/pull/43362)) - -### Fixed -- Fixes default attribute value when using enums on model:show ([#43360](https://github.com/laravel/framework/pull/43360)) - - -## [v9.21.5](https://github.com/laravel/framework/compare/v9.21.4...v9.21.5) - 2022-07-21 - -### Added -- Adds fluent File validation rule ([#43271](https://github.com/laravel/framework/pull/43271)) - -### Revert -- Revert ["Prevent double throwing chained exception on sync queue"](https://github.com/laravel/framework/pull/42950) ([#43354](https://github.com/laravel/framework/pull/43354)) - - -### Changed -- Allow section payload to be lazy in the "about" command ([#43329](https://github.com/laravel/framework/pull/43329)) - - -## [v9.21.4](https://github.com/laravel/framework/compare/v9.21.3...v9.21.4) - 2022-07-21 - -### Added -- Added `Illuminate/Filesystem/FilesystemAdapter::supportsTemporaryUrl()` ([#43317](https://github.com/laravel/framework/pull/43317)) - -### Fixed -- Fixes confirm component default value ([#43334](https://github.com/laravel/framework/pull/43334)) - -### Changed -- Improves console output when command not found ([#43323](https://github.com/laravel/framework/pull/43323)) - - -## [v9.21.3](https://github.com/laravel/framework/compare/v9.21.2...v9.21.3) - 2022-07-20 - -### Fixed -- Fixes usage of Migrator without output ([#43326](https://github.com/laravel/framework/pull/43326)) - - -## [v9.21.2](https://github.com/laravel/framework/compare/v9.21.1...v9.21.2) - 2022-07-20 - -### Fixed -- Fixes queue:monitor command dispatching QueueBusy ([#43320](https://github.com/laravel/framework/pull/43320)) -- Ensure relation names are properly "snaked" in JsonResource::whenCounted() method ([#43322](https://github.com/laravel/framework/pull/43322)) -- Fixed Bootstrap 5 pagination ([#43319](https://github.com/laravel/framework/pull/43319)) - - -## [v9.21.1](https://github.com/laravel/framework/compare/v9.21.0...v9.21.1) - 2022-07-20 - -### Added -- Added "Logs" driver to the about command ([#43307](https://github.com/laravel/framework/pull/43307)) -- Allows to install doctrine/dbal from model:show command ([#43288](https://github.com/laravel/framework/pull/43288)) -- Added to stub publish command flag that restricts to only existing files ([#43314](https://github.com/laravel/framework/pull/43314)) - -### Fixed -- Fixes for model:show command ([#43301](https://github.com/laravel/framework/pull/43301)) - -### Changed -- Handle varying composer -V output ([#43286](https://github.com/laravel/framework/pull/43286)) -- Replace resolve() with app() for Lumen compatible ([#43312](https://github.com/laravel/framework/pull/43312)) -- Allow using backed enums as route parameters ([#43294](https://github.com/laravel/framework/pull/43294)) - - -## [v9.21.0](https://github.com/laravel/framework/compare/v9.20.0...v9.21.0) - 2022-07-19 - -### Added -- Added inspiring quote ([#43180](https://github.com/laravel/framework/pull/43180), [#43189](https://github.com/laravel/framework/pull/43189)) -- Introducing a fresh new look for Artisan ([#43065](https://github.com/laravel/framework/pull/43065)) -- Added whenCounted to JsonResource ([#43101](https://github.com/laravel/framework/pull/43101)) -- Artisan model:show command ([#43156](https://github.com/laravel/framework/pull/43156)) -- Artisan `about` Command ([#43147](https://github.com/laravel/framework/pull/43147), [51b5eda](https://github.com/laravel/framework/commit/51b5edaa2f8dfb0acb520ecb394706ade2200a35), [#43225](https://github.com/laravel/framework/pull/43225), [#43276](https://github.com/laravel/framework/pull/43276)) -- Adds enum casting to Request ([#43239](https://github.com/laravel/framework/pull/43239)) - -### Revert -- Revert ["Fix default parameter bug in routes"](https://github.com/laravel/framework/pull/42942) ([#43208](https://github.com/laravel/framework/pull/43208)) -- Revert route change PR ([#43255](https://github.com/laravel/framework/pull/43255)) - -### Fixed -- Fix transaction attempts counter for sqlsrv ([#43176](https://github.com/laravel/framework/pull/43176)) - -### Changed -- Make assertDatabaseHas failureDescription more multibyte character friendly ([#43181](https://github.com/laravel/framework/pull/43181)) -- ValidationException summarize only when use strings ([#43177](https://github.com/laravel/framework/pull/43177)) -- Improve mode function in collection ([#43240](https://github.com/laravel/framework/pull/43240)) -- clear Facade resolvedInstances in queue worker resetScope callback ([#43215](https://github.com/laravel/framework/pull/43215)) -- Improves queue:work command ([#43252](https://github.com/laravel/framework/pull/43252)) -- Remove null default attributes names when UPDATED_AT or CREATED_AT is null at Model::replicate ([#43279](https://github.com/laravel/framework/pull/43279)) -- Protect against ambiguous columns ([#43278](https://github.com/laravel/framework/pull/43278)) -- Use readpast query hint instead of holdlock for sqlsrv database queue ([#43259](https://github.com/laravel/framework/pull/43259)) -- Vendor publish flag that restricts to only existing files ([#43212](https://github.com/laravel/framework/pull/43212)) - - -## [v9.20.0](https://github.com/laravel/framework/compare/v9.19.0...v9.20.0) - 2022-07-13 - -### Added -- Added quote from Mustafa Kemal Atatürk ([#43022](https://github.com/laravel/framework/pull/43022)) -- Allow Collection random() to accept a callable ([#43028](https://github.com/laravel/framework/pull/43028)) -- Added `Str::inlineMarkdown()` ([#43126](https://github.com/laravel/framework/pull/43126)) -- Allow authorization responses to specify HTTP status codes ([#43097](https://github.com/laravel/framework/pull/43097)) -- Added required directive ([#43103](https://github.com/laravel/framework/pull/43103)) -- Added replicateQuietly to Model ([#43141](https://github.com/laravel/framework/pull/43141)) -- Added ignore param to ValidateSignature middleware ([#43160](https://github.com/laravel/framework/pull/43160)) - -### Fixed -- Fixed forceCreate on MorphMany not returning newly created object ([#42996](https://github.com/laravel/framework/pull/42996)) -- Fixed missing return in `Illuminate/Mail/Attachment::fromStorageDisk()` ([#43023](https://github.com/laravel/framework/pull/43023)) -- Fixed inconsistent content type when using ResponseSequence ([#43051](https://github.com/laravel/framework/pull/43051)) -- Prevent double throwing chained exception on sync queue ([#42950](https://github.com/laravel/framework/pull/42950)) -- Avoid matching multi-line imports in GenerateCommand stub templates ([#43093](https://github.com/laravel/framework/pull/43093)) - -### Changed -- Disable Column Statistics for php artisan schema:dump on MariaDB ([#43027](https://github.com/laravel/framework/pull/43027)) -- Bind a Vite Null Object to the Container instead of a Closure in `Illuminate/Foundation/Testing/Concerns/InteractsWithContainer::withoutVite()` ([#43040](https://github.com/laravel/framework/pull/43040)) -- Early return when message format is the default in `Illuminate/Support/MessageBag::transform()` ([#43149](https://github.com/laravel/framework/pull/43149)) - - -## [v9.19.0](https://github.com/laravel/framework/compare/v9.18.0...v9.19.0) - 2022-06-28 - -### Added -- Add new allowMaxRedirects method to PendingRequest ([#42902](https://github.com/laravel/framework/pull/42902)) -- Add support to detect dirty encrypted model attributes ([#42888](https://github.com/laravel/framework/pull/42888)) -- Added Vite ([#42785](https://github.com/laravel/framework/pull/42785)) - -### Fixed -- Fixed bug on forceCreate on a MorphMay relationship not including morph type ([#42929](https://github.com/laravel/framework/pull/42929)) -- Fix default parameter bug in routes ([#42942](https://github.com/laravel/framework/pull/42942)) -- Handle cursor paginator when no items are found ([#42963](https://github.com/laravel/framework/pull/42963)) -- Fix undefined constant error when use slot name as key of object ([#42943](https://github.com/laravel/framework/pull/42943)) -- Fix BC break for Log feature tests ([#42987](https://github.com/laravel/framework/pull/42987)) - -### Changed -- Allow instance of Enum pass Enum Rule ([#42906](https://github.com/laravel/framework/pull/42906)) - - -## [v9.18.0](https://github.com/laravel/framework/compare/v9.17.0...v9.18.0) - 2022-06-21 - -### Added -- Improve file attachment for mail and notifications ([#42563](https://github.com/laravel/framework/pull/42563)) -- Introduce Invokable validation classes ([#42689](https://github.com/laravel/framework/pull/42689)) -- Predis v2.0 ([#42577](https://github.com/laravel/framework/pull/42577)) -- Added `Illuminate/View/Compilers/Concerns/CompilesConditionals::compileReadonly()` ([#42717](https://github.com/laravel/framework/pull/42717)) -- Apply where's from union query builder in cursor pagination ([#42651](https://github.com/laravel/framework/pull/42651)) -- Added ability to define "with" relations as a nested array ([#42690](https://github.com/laravel/framework/pull/42690)) -- Added ability to set backoff in broadcast events ([#42737](https://github.com/laravel/framework/pull/42737)) -- Added host(), httpHost(), schemeAndHttpHost() to Request ([#42797](https://github.com/laravel/framework/pull/42797)) -- Allow invokable rules to push messages to nested (or other) attributes ([#42801](https://github.com/laravel/framework/pull/42801)) -- Adds compilePushIf and compileEndpushIf functions to View compiler ([#42762](https://github.com/laravel/framework/pull/42762)) -- Added: Allow removing token during tests ([#42841](https://github.com/laravel/framework/pull/42841)) -- Added predefined_constants to reservedNames array in `Illuminate/Console/GeneratorCommand` ([#42832](https://github.com/laravel/framework/pull/42832)) -- Handle collection creation around a single enum ([#42839](https://github.com/laravel/framework/pull/42839)) -- Allow for nullable morphs in whereNotMorphedT ([#42878](https://github.com/laravel/framework/pull/42878)) -- Introduce a fake() helper to resolve faker singletons, per locale ([#42844](https://github.com/laravel/framework/pull/42844)) -- Allow handling cumulative query duration limit per DB connection ([#42744](https://github.com/laravel/framework/pull/42744)) -- Add invokable option to make rule command ([#42742](https://github.com/laravel/framework/pull/42742)) - -### Fixed -- Fix deprecation error in the route:list command ([#42704](https://github.com/laravel/framework/pull/42704)) -- Fixed Request offsetExists without routeResolver ([#42754](https://github.com/laravel/framework/pull/42754)) -- Fixed: Loose comparison causes the value not to be saved ([#42793](https://github.com/laravel/framework/pull/42793)) -- Fixed: Fix database session driver keeps resetting CSRF token ([#42782](https://github.com/laravel/framework/pull/42782)) -- Fixed: Arr::map - Fix map-by-reference w/ built-ins ([#42815](https://github.com/laravel/framework/pull/42815)) -- Fixed league/flysystem suggest ([#42872](https://github.com/laravel/framework/pull/42872)) - -### Changed -- Start session in TestResponse to allow marshalling of error bag from JSON ([#42710](https://github.com/laravel/framework/pull/42710)) -- Rename methods in `Illuminate/Broadcasting/BroadcastManager` ([753e9fd](https://github.com/laravel/framework/commit/753e9fd8843c043938e20b038999fe0a26de6e16)) -- Avoid throwing on invalid mime-type in `Illuminate/Filesystem/FilesystemAdapter::mimeType()` ([#42761](https://github.com/laravel/framework/pull/42761)) -- Do not resolve already set headers in `Illuminate/Filesystem/FilesystemAdapter` ([#42760](https://github.com/laravel/framework/pull/42760)) -- Standardise invokable rule translation functionality ([#42873](https://github.com/laravel/framework/pull/42873)) -- Clear cast cache when setting attributes using arrow ([#42852](https://github.com/laravel/framework/pull/42852)) - - -## [v9.17.0](https://github.com/laravel/framework/compare/v9.16.0...v9.17.0) - 2022-06-07 - -### Added -- Added Illuminate/Database/Eloquent/Builder::withoutEagerLoad() ([#42641](https://github.com/laravel/framework/pull/42641)) -- Allow random string generation to be controlled ([#42669](https://github.com/laravel/framework/pull/42669)) -- Adds doesnt_start_with validation ([#42683](https://github.com/laravel/framework/pull/42683), [de35bf2](https://github.com/laravel/framework/commit/de35bf2a8ab40013d997c62b5a80cdb907c73b99)) -- Added quarterlyOn cron schedule frequency command ([#42692](https://github.com/laravel/framework/pull/42692)) - -### Fixed -- Free reserved memory before handling fatal errors ([#42630](https://github.com/laravel/framework/pull/42630), [#42646](https://github.com/laravel/framework/pull/42646)) -- Prevent $mailer being reset when testing mailables that implement ShouldQueue ([#42695](https://github.com/laravel/framework/pull/42695)) -- Added checks for Pusher 7.1 preps ([#42632](https://github.com/laravel/framework/pull/42632)) -- Fixed grouping for user authorization ([#42664](https://github.com/laravel/framework/pull/42664)) - -### Changed -- Allow assertions against pushed string based pushed jobs ([#42676](https://github.com/laravel/framework/pull/42676)) - - -## [v9.16.0](https://github.com/laravel/framework/compare/v9.15.0...v9.16.0) - 2022-06-02 - -### Added -- Added Eloquent withWhereHas method ([#42597](https://github.com/laravel/framework/pull/42597)) -- User authentication for Pusher ([#42531](https://github.com/laravel/framework/pull/42531)) -- Added additional uuid testing helpers ([#42619](https://github.com/laravel/framework/pull/42619)) - -### Fixed -- Fix queueable notification's ID overwritten ([#42581](https://github.com/laravel/framework/pull/42581)) -- Handle undefined array key error in route ([#42606](https://github.com/laravel/framework/pull/42606)) - -### Deprecated -- Illuminate/Routing/Redirector::home() ([#42600](https://github.com/laravel/framework/pull/42600)) - - -## [v9.15.0](https://github.com/laravel/framework/compare/v9.14.1...v9.15.0) - 2022-05-31 - -### Added -- Added --only-vendor option to route:list command ([#42549](https://github.com/laravel/framework/pull/42549)) -- Added `Illuminate/Http/Client/PendingRequest::throwUnless()` ([#42556](https://github.com/laravel/framework/pull/42556)) -- Added `Illuminate/Support/Str::isJson()` ([#42545](https://github.com/laravel/framework/pull/42545)) -- Added `Illuminate/Filesystem/Filesystem::isEmptyDirectory()` ([#42559](https://github.com/laravel/framework/pull/42559)) -- Added `Add counts to route:list command` ([#42551](https://github.com/laravel/framework/pull/42551)) -- Support kebab case for slot name shortcut ([#42574](https://github.com/laravel/framework/pull/42574)) - -### Revered -- Revert digits changes in validation ([c113768](https://github.com/laravel/framework/commit/c113768dbd47de7466d703108eaf8155916d5666), [#42562](https://github.com/laravel/framework/pull/42562)) - -### Fixed -- Fix getting '0' from route parameter in Authorize middleware ([#42582](https://github.com/laravel/framework/pull/42582)) - -### Changed -- Retain the original attribute value during validation of an array key with a dot for correct failure message ([#42395](https://github.com/laravel/framework/pull/42395)) -- Allow bootable test traits to teardown ([#42521](https://github.com/laravel/framework/pull/42521)) -- Pass thrown exception to $sleepMilliseconds closure in retry helper ([#42532](https://github.com/laravel/framework/pull/42532)) -- Make HasTimestamps::updateTimestamps chainable ([#42533](https://github.com/laravel/framework/pull/42533)) -- Remove meaningless parameter in `Illuminate/View/Concerns/ManagesEvents` ([#42546](https://github.com/laravel/framework/pull/42546)) -- Map integer parameter to parameter name when resolving binding field ([#42571](https://github.com/laravel/framework/pull/42571)) -- Conditionable should return HigherOrderWhenProxy only when the args number is exactly 1 ([#42555](https://github.com/laravel/framework/pull/42555)) - - -## [v9.14.1](https://github.com/laravel/framework/compare/v9.14.0...v9.14.1) - 2022-05-25 - -### Added -- Model::whereRelation add callback function ([#42491](https://github.com/laravel/framework/pull/42491)) -- Add Conditionable Trait to Illuminate\Support\Carbon ([#42500](https://github.com/laravel/framework/pull/42500)) - -### Fixed -- Fix afterCommit and DatabaseTransactions ([#42502](https://github.com/laravel/framework/pull/42502)) -- Fixed regression when only some route parameters are scoped ([#42517](https://github.com/laravel/framework/pull/42517)) - - -## [v9.14.0](https://github.com/laravel/framework/compare/v9.13.0...v9.14.0) - 2022-05-24 - -### Added -- Added ability to add table comments for MySQL and Postgres ([#42401](https://github.com/laravel/framework/pull/42401)) -- Added dynamic trashed factory state ([#42414](https://github.com/laravel/framework/pull/42414)) -- Added Illuminate/Collections/Arr::prependKeysWith() ([#42448](https://github.com/laravel/framework/pull/42448)) -- Added bootable traits to TestCase ([#42394](https://github.com/laravel/framework/pull/42394)) - -### Fixed -- Fix clone issue on updateOrCreate and firstOrCreate ([#42434](https://github.com/laravel/framework/pull/42434)) -- Prevent double sanitized key in RateLimiter@tooManyAttempts ([#42462](https://github.com/laravel/framework/pull/42462)) -- Add flush handler to output buffer for streamed test response (bugfix) ([#42481](https://github.com/laravel/framework/pull/42481)) - -### Changed -- Adds attaches a concise error message to SES exceptions ([#42426](https://github.com/laravel/framework/pull/42426)) -- Use duplicate instead of createFromBase to clone request when routes are cached ([#42420](https://github.com/laravel/framework/pull/42420)) -- Use model route key when route parameter does not specifiy custom binding field but a different parameter does ([#42425](https://github.com/laravel/framework/pull/42425)) -- Adds ability to have paginate() $perPage parameter as callable with access to $total ([#42429](https://github.com/laravel/framework/pull/42429)) -- Extract ServeCommand env list to static property ([#42444](https://github.com/laravel/framework/pull/42444)) -- Use route parameters in view ([#42461](https://github.com/laravel/framework/pull/42461)) - - -## [v9.13.0](https://github.com/laravel/framework/compare/v9.12.2...v9.13.0) - 2022-05-17 - -### Added -- Added Illuminate/Collections/Traits/EnumeratesValues::value() ([#42257](https://github.com/laravel/framework/pull/42257)) -- Added new TestResponse helper: assertJsonMissingPath ([#42361](https://github.com/laravel/framework/pull/42361)) -- Added Illuminate/Support/Testing/Fakes/NotificationFake::assertCount() ([#42366](https://github.com/laravel/framework/pull/42366)) -- Added new DetectLostConnections ([#42377](https://github.com/laravel/framework/pull/42377), [#42382](https://github.com/laravel/framework/pull/42382)) -- Added Illuminate/Testing/TestResponse::collect() ([#42384](https://github.com/laravel/framework/pull/42384)) -- Added full callable support to schedule:list ([#42400](https://github.com/laravel/framework/pull/42400)) -- Added `Illuminate/Collections/Arr::map()` ([#42398](https://github.com/laravel/framework/pull/42398)) - -### Fixed -- Fixed PruneCommand finding its usage within other traits ([#42350](https://github.com/laravel/framework/pull/42350)) -- Fix assert that exception is thrown without message ([#42360](https://github.com/laravel/framework/pull/42360)) - -### Changed -- Skip parameter parsing for raw post body in HTTP Client ([#42364](https://github.com/laravel/framework/pull/42364)) -- Consistency between digits and digits_between validation rules ([#42358](https://github.com/laravel/framework/pull/42358)) -- Corrects the use of "failed_jobs" instead of "job_batches" in BatchedTableCommand ([#42389](https://github.com/laravel/framework/pull/42389)) -- Update email.blade.php ([#42388](https://github.com/laravel/framework/pull/42388)) -- Remove old monolog 1.x compat code ([#42392](https://github.com/laravel/framework/pull/42392)) -- SesTransport: use correct Tags argument ([#42390](https://github.com/laravel/framework/pull/42390)) -- Implement robust handling of forwarding of exception codes ([#42393](https://github.com/laravel/framework/pull/42393)) - - -## [v9.12.2](https://github.com/laravel/framework/compare/v9.12.1...v9.12.2) - 2022-05-11 - -### Fixed -- Factory fails to eval models and factories when returned from closure ([#42344](https://github.com/laravel/framework/pull/42344)) - -### Changed -- Added is_string check to QueriesRelationships@requalifyWhereTables ([#42341](https://github.com/laravel/framework/pull/42341)) - - -## [v9.12.1](https://github.com/laravel/framework/compare/v9.12.0...v9.12.1) - 2022-05-10 - -### Fixed -- Fix TypeError in DeadlockException ([#42337](https://github.com/laravel/framework/pull/42337)) -- Fixed type mismatch on Pusher::validate_channels() ([#42340](https://github.com/laravel/framework/pull/42340)) - -### Changed -- Add custom segments on "remember me" for session rebuild ([#42316](https://github.com/laravel/framework/pull/42316)) - - -## [v9.12.0](https://github.com/laravel/framework/compare/v9.11.0...v9.12.0) - 2022-05-10 - -### Added - -- Added closure based exceptions testing ([#42155](https://github.com/laravel/framework/pull/42155)) -- Allow forcing requests made via the Http client to be faked ([#42230](https://github.com/laravel/framework/pull/42230)) -- Added 'throwIf' method to PendingRequest ([#42260](https://github.com/laravel/framework/pull/42260)) -- Allow passing key/value arrays to getArguments and getOptions ([#42268](https://github.com/laravel/framework/pull/42268)) -- Add whereNotMorphedTo, orWhereNotMorphedTo ([#42264](https://github.com/laravel/framework/pull/42264)) -- Add method to extend localeArray generation ([#42275](https://github.com/laravel/framework/pull/42275)) -- Added ability to set delay per channel based on notifiable instance ([#42239](https://github.com/laravel/framework/pull/42239)) -- Added Illuminate/Pagination/CursorPaginator::onLastPage() ([#42301](https://github.com/laravel/framework/pull/42301)) -- Added findOr method to Query/Builder ([#42290](https://github.com/laravel/framework/pull/42290)) - -### Fixed - -- Fix too many channels with pusher broadcasting ([#42287](https://github.com/laravel/framework/pull/42287)) -- Fix Str::Mask() for repeating chars ([#42295](https://github.com/laravel/framework/pull/42295)) -- Fix EventFake::assertListening() for asserting string-based observer listeners ([#42289](https://github.com/laravel/framework/pull/42289)) -- Fixed Loose comparison causes the value not to be saved ([#41337](https://github.com/laravel/framework/pull/41337)) -- Fix multiple dots for digits_between rule ([#42330](https://github.com/laravel/framework/pull/42330)) - -### Changed - -- Enable to modify HTTP Client request headers when using beforeSending() callback ([#42244](https://github.com/laravel/framework/pull/42244)) -- Make throttle lock acquisition retry configurable for concurrency limiter ([#42242](https://github.com/laravel/framework/pull/42242)) -- Defers expanding callables on Factories ([#42241](https://github.com/laravel/framework/pull/42241)) -- Add wherehas soft deleting scopes ([#42100](https://github.com/laravel/framework/pull/42100)) -- Improve password checks ([#42248](https://github.com/laravel/framework/pull/42248)) -- Set relation parent key when using forceCreate on HasOne and HasMany relations ([#42281](https://github.com/laravel/framework/pull/42281)) -- Make sure the prefix override behaviours are the same between phpredis and predis drivers ([#42279](https://github.com/laravel/framework/pull/42279)) -- Share logging context across channels and stacks ([#42276](https://github.com/laravel/framework/pull/42276)) - -## [v9.11.0](https://github.com/laravel/framework/compare/v9.10.1...v9.11.0) - 2022-05-03 - -### Added - -- Added Illuminate/Collections/Arr::join() ([#42197](https://github.com/laravel/framework/pull/42197)) -- Added has and missing methods to ValidatedInput ([#42184](https://github.com/laravel/framework/pull/42184)) -- Added deprecation stack trace config option ([#42235](https://github.com/laravel/framework/pull/42235)) - -### Fixed - -- Fix deprecation issue with translator and empty rules ([#42216](https://github.com/laravel/framework/pull/42216), [#42213](https://github.com/laravel/framework/pull/42213)) - -### Changed - -- Improve EventFake::assertListening() support for subscribers ([#42193](https://github.com/laravel/framework/pull/42193)) - -## [v9.10.1](https://github.com/laravel/framework/compare/v9.10.0...v9.10.1) - 2022-04-28 - -### Revert - -- Revert of ["Illuminate/Routing/Router::middlewareGroup() will support array of the middlewares"](https://github.com/laravel/framework/pull/42004) ([7563912](https://github.com/laravel/framework/commit/75639121cc55d4390fd75a0f422c7f0a626ece1e)) - -## [v9.10.0](https://github.com/laravel/framework/compare/v9.9.0...v9.10.0) - 2022-04-27 - -### Added - -- Add the ability to use alias when performing upsert via MySQL ([#42053](https://github.com/laravel/framework/pull/42053)) -- Illuminate/Routing/Router::middlewareGroup() will support array of the middlewares ([#42004](https://github.com/laravel/framework/pull/42004), [e6b84fb](https://github.com/laravel/framework/commit/e6b84fb0f1f1c82ce1a486643e2b20974522cda6)) -- Added Missing AsCommand attribute on schedule:list ([#42069](https://github.com/laravel/framework/pull/42069)) -- Add the beforeRefreshingDatabase function to the Testing/RefreshDatabase trait ([#42073](https://github.com/laravel/framework/pull/42073)) -- Added doesntExpectOutputToContain assertion method ([#42096](https://github.com/laravel/framework/pull/42096)) -- Added a findOr method to Eloquent ([#42092](https://github.com/laravel/framework/pull/42092)) -- Allow extension in `Illuminate/View/Compilers/Compiler.php` ([68e41fd](https://github.com/laravel/framework/commit/68e41fd3691b9aa5548e07c5caf38696c4082513)) -- Support 'IS' and 'IS NOT' PostgreSQL operators ([#42123](https://github.com/laravel/framework/pull/42123)) -- Added `str` and `string` methods to Illuminate/Http/Concerns/InteractsWithInput ([c9d34b7](https://github.com/laravel/framework/commit/c9d34b7be0611d26f3e46669934cf542cc5e9e21)) -- Added methods to append and prepend jobs to existing chain ([#42138](https://github.com/laravel/framework/pull/42138)) - -### Fixes - -- Make it so non-existent jobs run down the failed path instead of crashing ([#42079](https://github.com/laravel/framework/pull/42079)) -- Fix schedule:work command Artisan binary name ([#42083](https://github.com/laravel/framework/pull/42083)) -- Fix TrimStrings middleware with non-UTF8 characters ([#42065](https://github.com/laravel/framework/pull/42065)) -- Copy locale and defaultLocale from original request in Request::createFrom() ([#42080](https://github.com/laravel/framework/pull/42080)) -- Fix ViewErrorBag for JSON session serialization ([#42090](https://github.com/laravel/framework/pull/42090)) -- Fix array keys from cached routes in CompiledRouteCollection::getRoutesByMethod() ([#42078](https://github.com/laravel/framework/pull/42078)) -- Fix json_last_error issue with JsonResponse::setData ([#42125](https://github.com/laravel/framework/pull/42125)) -- Fix bug in BelongsToMany where non-related rows are returned ([#42087](https://github.com/laravel/framework/pull/42087)) -- Fix HasAttributes::mutateAttributeForArray when accessing non-cached attribute ([#42130](https://github.com/laravel/framework/pull/42130)) - -### Changed - -- Make password rule errors translatable ([#42060](https://github.com/laravel/framework/pull/42060)) -- Redesign of the event:list Command. ([#42068](https://github.com/laravel/framework/pull/42068)) -- Changed event:list command ([#42084](https://github.com/laravel/framework/pull/42084)) -- Throw LostDbConnectionException instead of LogicException ([#42102](https://github.com/laravel/framework/pull/42102)) -- Throw deadlock exception ([#42129](https://github.com/laravel/framework/pull/42129)) -- Support Arr::forget() for nested ArrayAccess objects ([#42142](https://github.com/laravel/framework/pull/42142)) -- Allow Illuminate/Collections/Enumerable::jsonSerialize() to return other types ([#42133](https://github.com/laravel/framework/pull/42133)) -- Update schedule:list colouring output ([#42153](%5B#42153%5D(https://github.com/laravel/framework/pull/42153)) - -## [v9.9.0](https://github.com/laravel/framework/compare/v9.8.1...v9.9.0) - 2022-04-19 - -### Added - -- Add getAllTables support for SQLite and SQLServer schema builders ([#41896](https://github.com/laravel/framework/pull/41896)) -- Added withoutEagerLoads() method to Builder ([#41950](https://github.com/laravel/framework/pull/41950)) -- Added 'throw' method to PendingRequest ([#41953](https://github.com/laravel/framework/pull/41953)) -- Configurable pluralizer language and uncountables ([#41941](https://github.com/laravel/framework/pull/41941)) - -### Fixed - -- Fixed Error in Illuminate/Routing/Exceptions/StreamedResponseException ([#41955](https://github.com/laravel/framework/pull/41955)) -- Fix PHP warnings when rendering long blade string ([#41956](https://github.com/laravel/framework/pull/41956)) -- Fix ExcludeIf regression to use Closure over is_callable() ([#41969](https://github.com/laravel/framework/pull/41969)) -- Fixes applying replacements to multi-level localization arrays ([#42022](https://github.com/laravel/framework/pull/42022)) - -### Changed - -- Improved Illuminate/Foundation/Http/Middleware/TrimStrings.php and Str::squish() ([#41949](https://github.com/laravel/framework/pull/41949), [#41971](https://github.com/laravel/framework/pull/41971)) -- Use config session domain for maintenance cookie ([#41961](https://github.com/laravel/framework/pull/41961)) -- Revert lazy command forcing ([#41982](https://github.com/laravel/framework/pull/41982)) - -## [v9.8.1](https://github.com/laravel/framework/compare/v9.8.0...v9.8.1) - 2022-04-12 - -### Reverted - -- Revert "Standardize withCount() & withExists() eager loading aggregates ([#41943](https://github.com/laravel/framework/pull/41943)) - -## [v9.8.0](https://github.com/laravel/framework/compare/v9.7.0...v9.8.0) - 2022-04-12 - -### Added - -- Added inbound option to CastMakeCommand ([#41838](https://github.com/laravel/framework/pull/41838)) -- Added a way to retrieve the first column of the first row from a query ([#41858](https://github.com/laravel/framework/pull/41858)) -- Make DatabaseManager Macroable ([#41868](https://github.com/laravel/framework/pull/41868)) -- Improve Str::squish() ([#41877](https://github.com/laravel/framework/pull/41877), [#41924](https://github.com/laravel/framework/pull/41924)) -- Added option to disable cached view ([#41859](https://github.com/laravel/framework/pull/41859)) -- Make Connection Class Macroable ([#41865](https://github.com/laravel/framework/pull/41865)) -- Added possibility to discover anonymous Blade components in other folders ([#41637](https://github.com/laravel/framework/pull/41637)) -- Added `Illuminate/Database/Eloquent/Factories/Factory::set()` ([#41890](https://github.com/laravel/framework/pull/41890)) -- Added multibyte support to string padding helper functions ([#41899](https://github.com/laravel/framework/pull/41899)) -- Allow to use custom log level in exception handler reporting ([#41925](https://github.com/laravel/framework/pull/41925)) - -### Fixed - -- Illuminate/Support/Stringable::exactly() with Stringable value ([#41846](https://github.com/laravel/framework/pull/41846)) -- Fixed afterCommit and RefreshDatabase ([#41782](https://github.com/laravel/framework/pull/41782)) -- Fix null name for email address in `Illuminate/Mail/Message` ([#41870](https://github.com/laravel/framework/pull/41870)) -- Fix seeder property for in-memory tests ([#41869](https://github.com/laravel/framework/pull/41869)) -- Fix empty paths for server.php ([#41933](https://github.com/laravel/framework/pull/41933)) -- Fix ExcludeIf constructor ([#41931](https://github.com/laravel/framework/pull/41931)) - -### Changed - -- Set custom host to the serve command with environment variable ([#41831](https://github.com/laravel/framework/pull/41831)) -- Add handling of object being passed into old method in Model ([#41842](https://github.com/laravel/framework/pull/41842)) -- Catch permission exception when creating directory ([#41871](https://github.com/laravel/framework/pull/41871)) -- Restore v8 behaviour of base query for relations ([#41918](https://github.com/laravel/framework/pull/41918), [#41923](https://github.com/laravel/framework/pull/41923)) -- Standardize withCount() & withExists() eager loading aggregates ([#41914](https://github.com/laravel/framework/pull/41914)) - -## [v9.7.0](https://github.com/laravel/framework/compare/v9.6.0...v9.7.0) - 2022-04-05 - -### Added - -- Make whereBelongsTo accept Collection ([#41733](https://github.com/laravel/framework/pull/41733)) -- Database queries containing JSON paths support array index braces ([#41767](https://github.com/laravel/framework/pull/41767)) -- Fire event before route matched ([#41765](https://github.com/laravel/framework/pull/41765)) -- Added to `Illuminate/Http/Resources/ConditionallyLoadsAttributes::whenNotNull` method ([#41769](https://github.com/laravel/framework/pull/41769)) -- Added "whereIn" route parameter constraint method ([#41794](https://github.com/laravel/framework/pull/41794)) -- Added `Illuminate/Queue/BeanstalkdQueue::bulk()` ([#41789](https://github.com/laravel/framework/pull/41789)) -- Added `Illuminate/Queue/SqsQueue::bulk()` ([#41788](https://github.com/laravel/framework/pull/41788)) -- Added String::squish() helper ([#41791](https://github.com/laravel/framework/pull/41791)) -- Added query builder method whereJsonContainsKey() ([#41802](https://github.com/laravel/framework/pull/41802)) -- Enable dispatchAfterResponse for batch ([#41787](https://github.com/laravel/framework/pull/41787)) - -### Fixed - -- Factory generation fixes ([#41688](https://github.com/laravel/framework/pull/41688)) -- Fixed Http Client throw boolean parameter of retry method ([#41762](https://github.com/laravel/framework/pull/41762), [#41792](https://github.com/laravel/framework/pull/41792)) -- Ignore empty redis username string in PhpRedisConnector ([#41773](https://github.com/laravel/framework/pull/41773)) -- Fixed support of nullable type for AsArrayObject/AsCollection ([#41797](https://github.com/laravel/framework/pull/41797), [05846e7](https://github.com/laravel/framework/commit/05846e7ba5cecc12a3ab8a3238272e9c1dd4e07f)) -- Fixed adding jobs from iterable to the pending batch ([#41786](https://github.com/laravel/framework/pull/41786)) -- Http client: fix retry handling of connection exception ([#41811](https://github.com/laravel/framework/pull/41811)) - -### Changed - -- Enable batch jobs delay for database queue ([#41758](https://github.com/laravel/framework/pull/41758)) -- Enable batch jobs delay for redis queue ([#41783](https://github.com/laravel/framework/pull/41783)) -- Http client: dispatch "response received" event for every retry attempt ([#41793](https://github.com/laravel/framework/pull/41793)) -- Http Client: provide pending request to retry callback ([#41779](https://github.com/laravel/framework/pull/41779)) -- Allow non length limited strings and char for postgresql ([#41800](https://github.com/laravel/framework/pull/41800)) -- Revert some Carbon::setTestNow() removals ([#41810](https://github.com/laravel/framework/pull/41810)) -- Allow cleanup of databases when using parallel tests ([#41806](https://github.com/laravel/framework/pull/41806)) - -## [v9.6.0](https://github.com/laravel/framework/compare/v9.5.1...v9.6.0) - 2022-03-29 - -### Added - -- Added whenTableHasColumn and whenTableDoesntHaveColumn on Schema Builder ([#41517](https://github.com/laravel/framework/pull/41517)) -- Added Illuminate/Mail/Mailable::hasSubject() ([#41575](https://github.com/laravel/framework/pull/41575)) -- Added `Illuminate/Filesystem/Filesystem::hasSameHash()` ([#41586](https://github.com/laravel/framework/pull/41586)) - -### Fixed - -- Fixed deprecation warning in `Str::exists()` ([d39d92d](https://github.com/laravel/framework/commit/d39d92df9b3c509d40b971207f03eb7f04087370)) -- Fix artisan make:seeder command nested namespace and class name problem ([#41534](https://github.com/laravel/framework/pull/41534)) -- Fixed Illuminate/Redis/Connections/PhpRedisConnection::handle() ([#41546](https://github.com/laravel/framework/pull/41546)) -- Stop throwing LazyLoadingViolationException for recently created model instances ([#41549](https://github.com/laravel/framework/pull/41549)) -- Close doctrineConnection on disconnect ([#41584](https://github.com/laravel/framework/pull/41584)) - -### Changed - -- Make throttle lock acquisition retry time configurable ([#41516](https://github.com/laravel/framework/pull/41516)) -- Allows object instead of array when adding to PendingBatch ([#41475](https://github.com/laravel/framework/pull/41475)) -- Exactly match scheduled command --name in schedule:test ([#41528](https://github.com/laravel/framework/pull/41528)) -- Handle Symfony defaultName deprecation ([#41555](https://github.com/laravel/framework/pull/41555), [#41595](https://github.com/laravel/framework/pull/41595)) -- Improve ScheduleListCommand ([#41552](https://github.com/laravel/framework/pull/41552), [#41535](https://github.com/laravel/framework/pull/41535), [#41494](https://github.com/laravel/framework/pull/41494)) -- Remove useless if statement in Str::mask() ([#41570](https://github.com/laravel/framework/pull/41570)) - -## [v9.5.1](https://github.com/laravel/framework/compare/v9.5.0...v9.5.1) - 2022-03-15 - -### Reverted - -- Revert "Fix the guard instance used." ([#41491](https://github.com/laravel/framework/pull/41491)) - -## [v9.5.0](https://github.com/laravel/framework/compare/v9.4.1...v9.5.0) - 2022-03-15 - -### Added - -- Added callback support on implode Collection method. ([#41405](https://github.com/laravel/framework/pull/41405)) -- Added `Illuminate/Filesystem/FilesystemAdapter::assertDirectoryEmpty()` ([#41398](https://github.com/laravel/framework/pull/41398)) -- Implement email "metadata" for SesTransport ([#41422](https://github.com/laravel/framework/pull/41422)) -- Make assertPath() accepts Closure ([#41409](https://github.com/laravel/framework/pull/41409)) -- Added callable support to operatorForWhere on Collection ([#41414](https://github.com/laravel/framework/pull/41414), [#41424](https://github.com/laravel/framework/pull/41424)) -- Added partial queue faking ([#41425](https://github.com/laravel/framework/pull/41425)) -- Added --name option to schedule:test command ([#41439](https://github.com/laravel/framework/pull/41439)) -- Define `Illuminate/Database/Eloquent/Concerns/HasRelationships::newRelatedThroughInstance()` ([#41444](https://github.com/laravel/framework/pull/41444)) -- Added `Illuminate/Support/Stringable::wrap()` ([#41455](https://github.com/laravel/framework/pull/41455)) -- Adds "freezeTime" helper for tests ([#41460](https://github.com/laravel/framework/pull/41460)) -- Allow for callables with beforeSending in`Illuminate/Http/Client/PendingRequest.php::runBeforeSendingCallbacks()` ([#41489](https://github.com/laravel/framework/pull/41489)) - -### Fixed - -- Fixed deprecation warnings from route:list when filtering on name or domain ([#41421](https://github.com/laravel/framework/pull/41421)) -- Fixes HTTP::pool response when a URL returns a null status code ([#41412](https://github.com/laravel/framework/pull/41412)) -- Fixed recaller name resolution in `Illuminate/Session/Middleware/AuthenticateSession.php` ([#41429](https://github.com/laravel/framework/pull/41429)) -- Fixed the guard instance used in /Illuminate/Session/Middleware/AuthenticateSession.php ([#41447](https://github.com/laravel/framework/pull/41447)) -- Fixed route:list --except-vendor hiding Route::view() & Route::redirect() ([#41465](https://github.com/laravel/framework/pull/41465)) - -### Changed - -- Add null typing to connection property in \Illuminate\Database\Eloquent\Factories\Factory ([#41418](https://github.com/laravel/framework/pull/41418)) -- Update reserved names in GeneratorCommand ([#41441](https://github.com/laravel/framework/pull/41441)) -- Redesign php artisan schedule:list Command ([#41445](https://github.com/laravel/framework/pull/41445)) -- Extend eloquent higher order proxy properties ([#41449](https://github.com/laravel/framework/pull/41449)) -- Allow passing named arguments to dynamic scopes ([#41478](https://github.com/laravel/framework/pull/41478)) -- Throw if tag is passed but is not supported in `Illuminate/Encryption/Encrypter.php` ([#41479](https://github.com/laravel/framework/pull/41479)) -- Update PackageManifest::$vendorPath initialisation for cases, when composer vendor dir is not in project director ([#41463](https://github.com/laravel/framework/pull/41463)) - -## [v9.4.1](https://github.com/laravel/framework/compare/v9.4.0...v9.4.1) - 2022-03-08 - -### Fixed - -- Fixed version of laravel - -## [v9.4.0](https://github.com/laravel/framework/compare/v9.4.0...v9.4.0) - 2022-03-08 - -### Added - -- Support modifying a char column type ([#41320](https://github.com/laravel/framework/pull/41320)) -- Add "Mutex" column to 'schedule:list' command ([#41338](https://github.com/laravel/framework/pull/41338)) -- Allow eloquent whereNot() and orWhereNot() to work on column and value ([#41296](https://github.com/laravel/framework/pull/41296)) -- Allow VerifyCsrfToken's CSRF cookie to be extended ([#41342](https://github.com/laravel/framework/pull/41342)) -- Added `soleValue()` to query builder ([#41368](https://github.com/laravel/framework/pull/41368)) -- Added `lcfirst()` to `Str` and `Stringable` ([#41384](https://github.com/laravel/framework/pull/41384)) -- Added retryUntil method to queued mailables ([#41393](https://github.com/laravel/framework/pull/41393)) - -### Fixed - -- Fixed middleware sorting for authenticating sessions ([50b46db](https://github.com/laravel/framework/commit/50b46db563e11ba52a53e3046c23e92878aed395)) -- Fixed takeUntilTimeout method of LazyCollection ([#41354](https://github.com/laravel/framework/pull/41354), [#41370](https://github.com/laravel/framework/pull/41370)) -- Fixed directory for nested markdown files for mailables ([#41366](https://github.com/laravel/framework/pull/41366)) -- Prevent serializing default values of queued jobs ([#41348](https://github.com/laravel/framework/pull/41348)) -- Fixed get() and head() in `Illuminate/Http/Client/PendingRequest.php` ([a54f481](https://github.com/laravel/framework/commit/a54f48102deea2864071e510172fe0b22a1c1d5a)) - -### Changed - -- Don't use global tap helper ([#41326](https://github.com/laravel/framework/pull/41326)) -- Allow chaining of `Illuminate/Console/Concerns/InteractsWithIO::newLine` ([#41327](https://github.com/laravel/framework/pull/41327)) -- set destinations since bcc missing from raw message in Mail SesTransport ([8ca43f4](https://github.com/laravel/framework/commit/8ca43f4c2a531ff9d28b86a7e366eef8adf8de84)) - -## [v9.3.1](https://github.com/laravel/framework/compare/v9.3.0...v9.3.1) - 2022-03-03 - -### Added - -- Optionally cascade thrown Flysystem exceptions by @driesvints in https://github.com/laravel/framework/pull/41308 - -### Changed - -- Allow overriding transport type on Mailgun transporter by @jnoordsij in https://github.com/laravel/framework/pull/41309 -- Change how Laravel handles strict morph map with pivot classes by @crynobone in https://github.com/laravel/framework/pull/41304 - -### Fixed - -- $job can be an object in some methods by @villfa in https://github.com/laravel/framework/pull/41244 -- Fix docblock on Batch class by @yoeriboven in https://github.com/laravel/framework/pull/41295 -- Correct `giveConfig` param doc by @Neol3108 in https://github.com/laravel/framework/pull/41314 -- Fix MySqlSchemaState does not add --ssl-ca to mysql cli by @DeepDiver1975 in https://github.com/laravel/framework/pull/41315 -- Do not prepend baseUrl to absolute urls by @JaZo in https://github.com/laravel/framework/pull/41307 -- Fixes getting the trusted proxies IPs from the configuration file by @nunomaduro in https://github.com/laravel/framework/pull/41322 - -## [v9.3.0 (2022-03-02)](https://github.com/laravel/framework/compare/v9.2.0...v9.3.0) - -### Added - -- Add NotificationFake::assertNothingSentTo() by @axlon ([#41232](https://github.com/laravel/framework/pull/41232)) -- Support --ssl-ca on schema load and dump by @DeepDiver1975 ([#40931](https://github.com/laravel/framework/pull/40931)) -- Add whereNot() to Query Builder and Eloquent Builder by @marcovo ([#41096](https://github.com/laravel/framework/pull/41096)) -- Added support for index and position placeholders in array validation messages by @Bird87ZA ([#41123](https://github.com/laravel/framework/pull/41123)) -- Add resource binding by @aedart ([#41233](https://github.com/laravel/framework/pull/41233)) -- Add ability to push additional pipes onto a pipeline via chain($pipes) by @stevebauman ([#41256](https://github.com/laravel/framework/pull/41256)) -- Add option to filter out routes defined in vendor packages in route:list command by @amiranagram ([#41254](https://github.com/laravel/framework/pull/41254)) - -### Fixed - -- Query PostgresBuilder fixes for renamed config 'search_path' by @derekmd ([#41215](https://github.com/laravel/framework/pull/41215)) -- Improve doctypes for Eloquent Factory guessing methods by @bastien-phi ([#41245](https://github.com/laravel/framework/pull/41245)) -- Fix Conditional::when and Conditional::unless when called with invokable by @bastien-phi ([#41270](https://github.com/laravel/framework/pull/41270)) -- Improves Support\Collection reduce method type definition by @fdalcin ([#41272](https://github.com/laravel/framework/pull/41272)) -- Fix inconsistent results of firstOrNew() when using withCasts() by @Attia-Ahmed ([#41257](https://github.com/laravel/framework/pull/41257)) -- Fix implicitBinding and withTrashed route with child with no SoftDeletes trait by @stein-j ([#41282](https://github.com/laravel/framework/pull/41282)) - -### Changed - -- Unset Connection Resolver extended callback by @emrancu ([#41216](https://github.com/laravel/framework/pull/41216)) -- Update Mailgun transport type by @driesvints ([#41255](https://github.com/laravel/framework/pull/41255)) - -## [v9.2.0 (2022-02-22)](https://github.com/laravel/framework/compare/v9.1.0...v9.2.0) - -### Added - -- Added `Illuminate/Database/Eloquent/Casts/Attribute::make()` ([#41014](https://github.com/laravel/framework/pull/41014)) -- Added `Illuminate/Collections/Arr::keyBy()` ([#41029](https://github.com/laravel/framework/pull/41029)) -- Added expectsOutputToContain to the PendingCommand. ([#40984](https://github.com/laravel/framework/pull/40984)) -- Added ability to supply HTTP client methods with JsonSerializable instances ([#41055](https://github.com/laravel/framework/pull/41055)) -- Added `Illuminate/Filesystem/AwsS3V3Adapter::getClient()` ([#41079](https://github.com/laravel/framework/pull/41079)) -- Added Support for enum in Builder::whereRelation ([#41091](https://github.com/laravel/framework/pull/41091)) -- Added X headers when using Mail::alwaysTo ([#41101](https://github.com/laravel/framework/pull/41101)) -- Added of support Bitwise operators in query ([#41112](https://github.com/laravel/framework/pull/41112)) -- Integrate Laravel CORS into framework ([#41137](https://github.com/laravel/framework/pull/41137)) -- Added `Illuminate/Support/Str::betweenFirst()` ([#41144](https://github.com/laravel/framework/pull/41144)) -- Allow specifiying custom messages for Rule objects ([#41145](https://github.com/laravel/framework/pull/41145)) - -### Fixed - -- Fixed Queue Failed_jobs insert issue with Exception contain UNICODE ([#41020](https://github.com/laravel/framework/pull/41020)) -- Fixes attempt to log deprecations on mocks ([#41057](https://github.com/laravel/framework/pull/41057)) -- Fixed loadAggregate not correctly applying casts ([#41050](https://github.com/laravel/framework/pull/41050)) -- Do not transform JsonSerializable instances to array in HTTP client methods ([#41077](https://github.com/laravel/framework/pull/41077)) -- Fix parsing config('database.connections.pgsql.search_path') ([#41088](https://github.com/laravel/framework/pull/41088)) -- Eloquent: firstWhere returns Object instead of NULL ([#41099](https://github.com/laravel/framework/pull/41099)) -- Fixed updated with provided qualified updated_at ([#41133](https://github.com/laravel/framework/pull/41133)) -- Fix setPriority Call for MailChannel ([#41120](https://github.com/laravel/framework/pull/41120)) -- Fixed route:list command output ([#41177](https://github.com/laravel/framework/pull/41177)) -- Fix database migrations $connection property ([#41161](https://github.com/laravel/framework/pull/41161)) - -### Changed - -- Cursor pagination: convert original column to expression ([#41003](https://github.com/laravel/framework/pull/41003)) -- Cast $perPage to integer on Paginator ([#41073](https://github.com/laravel/framework/pull/41073)) -- Restore S3 client extra options ([#41097](https://github.com/laravel/framework/pull/41097)) -- Use `latest()` within `notifications()` in `Illuminate/Notifications/HasDatabaseNotifications.php` ([#41095](https://github.com/laravel/framework/pull/41095)) -- Remove duplicate queries to find batch ([#41121](https://github.com/laravel/framework/pull/41121)) -- Remove redundant check in FormRequest::validated() ([#41115](https://github.com/laravel/framework/pull/41115)) -- Illuminate/Support/Facades/Storage::fake() changed ([#41113](https://github.com/laravel/framework/pull/41113)) -- Use coalesce equal as provided by PHP >= 7.4 ([#41174](https://github.com/laravel/framework/pull/41174)) -- Simplify some conditions with is_countable() ([#41168](https://github.com/laravel/framework/pull/41168)) -- Pass AWS temporary URL options to createPresignedRequest method ([#41156](https://github.com/laravel/framework/pull/41156)) -- Let Multiple* exceptions hold the number of records and items found ([#41164](https://github.com/laravel/framework/pull/41164)) - -## [v9.1.0 (2022-02-15)](https://github.com/laravel/framework/compare/v9.0.2...v9.1.0) - -### Added - -- Added the ability to use the uniqueFor method for Jobs by @andrey-helldar in https://github.com/laravel/framework/pull/40974 -- Add filtering of route:list by domain by @Synchro in https://github.com/laravel/framework/pull/40970 -- Added dropForeignIdFor method to match foreignIdFor method by @bretto36 in https://github.com/laravel/framework/pull/40950 -- Adds `Str::excerpt` by @nunomaduro in https://github.com/laravel/framework/pull/41000 -- Make:model --morph flag to generate MorphPivot model by @michael-rubel in https://github.com/laravel/framework/pull/41011 -- Add doesntContain to higher order proxies by @edemots in https://github.com/laravel/framework/pull/41034 - -### Changed - -- Improve types on model factory methods by @axlon in https://github.com/laravel/framework/pull/40902 -- Add support for passing array as the second parameter for the group method. by @hossein-zare in https://github.com/laravel/framework/pull/40945 -- Makes `ExceptionHandler::renderForConsole` internal on contract by @nunomaduro in https://github.com/laravel/framework/pull/40956 -- Put the error message at the bottom of the exceptions by @nshiro in https://github.com/laravel/framework/pull/40886 -- Expose next and previous cursor of cursor paginator by @gdebrauwer in https://github.com/laravel/framework/pull/41001 - -### Fixed - -- Fix FTP root config by @driesvints in https://github.com/laravel/framework/pull/40939 -- Allows tls encryption to be used with port different than 465 with starttls by @nicolalazzaro in https://github.com/laravel/framework/pull/40943 -- Catch suppressed deprecation logs by @nunomaduro in https://github.com/laravel/framework/pull/40942 -- Fix typo in method documentation by @shadman-ahmed in https://github.com/laravel/framework/pull/40951 -- Patch regex rule parsing due to `Rule::forEach()` by @stevebauman in https://github.com/laravel/framework/pull/40941 -- Fix replacing request options by @driesvints in https://github.com/laravel/framework/pull/40954 -- Fix `MessageSent` event by @driesvints in https://github.com/laravel/framework/pull/40963 -- Add firstOr() function to BelongsToMany relation by @r-kujawa in https://github.com/laravel/framework/pull/40828 -- Fix `isRelation()` failing to check an `Attribute` by @rodrigopedra in https://github.com/laravel/framework/pull/40967 -- Fix default pivot attributes by @iamgergo in https://github.com/laravel/framework/pull/40947 -- Fix enum casts arrayable behaviour by @diegotibi in https://github.com/laravel/framework/pull/40885 -- Solve exception error: Undefined array key "", in artisan route:list command by @manuglopez in https://github.com/laravel/framework/pull/41031 -- Fix Duplicate Route Namespace by @moisish in https://github.com/laravel/framework/pull/41021 -- Fix the error message when no routes are detected by @LukeTowers in https://github.com/laravel/framework/pull/41017 -- Fix mails with tags and metadata are not queuable by @joostdebruijn in https://github.com/laravel/framework/pull/41028 - -## [v9.0.2 (2022-02-10)](https://github.com/laravel/framework/compare/v9.0.1...v9.0.2) - -### Added - -- Add disabled directive by @belzaaron in https://github.com/laravel/framework/pull/40900 - -### Changed - -- Widen the type of `Collection::unique` `$key` parameter by @NiclasvanEyk in https://github.com/laravel/framework/pull/40903 -- Makes `ExceptionHandler::renderForConsole` internal by @nunomaduro in https://github.com/laravel/framework/pull/40936 -- Removal of Google Font integration from default exception templates by @bashgeek in https://github.com/laravel/framework/pull/40926 -- Allow base JsonResource class to be collected by @jwohlfert23 in https://github.com/laravel/framework/pull/40896 - -### Fixed - -- Fix Support\Collection reject method type definition by @joecampo in https://github.com/laravel/framework/pull/40899 -- Fix SpoofCheckValidation namespace change by @eduardor2k in https://github.com/laravel/framework/pull/40923 -- Fix notification email recipient by @driesvints in https://github.com/laravel/framework/pull/40921 -- Fix publishing visibility by @driesvints in https://github.com/laravel/framework/pull/40918 -- Fix Mailable->priority() by @giggsey in https://github.com/laravel/framework/pull/40917 - -## [v9.0.1 (2022-02-09)](https://github.com/laravel/framework/compare/v9.0.0...v9.0.1) - -### Changed - -- Improves `Support\Collection` each method type definition by @zingimmick in https://github.com/laravel/framework/pull/40879 - -### Fixed - -- Update Mailable.php by @rentalhost in https://github.com/laravel/framework/pull/40868 -- Switch to null coalescing operator in Conditionable by @inxilpro in https://github.com/laravel/framework/pull/40888 -- Bring back old return behaviour by @ankurk91 in https://github.com/laravel/framework/pull/40880 - -## [v9.0.0 (2022-02-08)](https://github.com/laravel/framework/compare/8.x...v9.0.0) - -Check the upgrade guide in the [Official Laravel Upgrade Documentation](https://laravel.com/docs/9.x/upgrade). Also you can see some release notes in the [Official Laravel Release Documentation](https://laravel.com/docs/9.x/releases). diff --git a/vendor/laravel/framework/LICENSE.md b/vendor/laravel/framework/LICENSE.md deleted file mode 100644 index 79810c84..00000000 --- a/vendor/laravel/framework/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Taylor Otwell - -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/laravel/framework/README.md b/vendor/laravel/framework/README.md deleted file mode 100644 index df935e86..00000000 --- a/vendor/laravel/framework/README.md +++ /dev/null @@ -1,47 +0,0 @@ -

- -

-Build Status -Total Downloads -Latest Stable Version -License -

- -## About Laravel - -> **Note:** This repository contains the core code of the Laravel framework. If you want to build an application using Laravel, visit the main [Laravel repository](https://github.com/laravel/laravel). - -Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable, creative experience to be truly fulfilling. Laravel attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as: - -- [Simple, fast routing engine](https://laravel.com/docs/routing). -- [Powerful dependency injection container](https://laravel.com/docs/container). -- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage. -- Database agnostic [schema migrations](https://laravel.com/docs/migrations). -- [Robust background job processing](https://laravel.com/docs/queues). -- [Real-time event broadcasting](https://laravel.com/docs/broadcasting). - -Laravel is accessible, yet powerful, providing tools needed for large, robust applications. A superb combination of simplicity, elegance, and innovation gives you a complete toolset required to build any application with which you are tasked. - -## Learning Laravel - -Laravel has the most extensive and thorough documentation and video tutorial library of any modern web application framework. The [Laravel documentation](https://laravel.com/docs) is in-depth and complete, making it a breeze to get started learning the framework. - -You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch. - -If you're not in the mood to read, [Laracasts](https://laracasts.com) contains over 1100 video tutorials covering a range of topics including Laravel, modern PHP, unit testing, JavaScript, and more. Boost the skill level of yourself and your entire team by digging into our comprehensive video library. - -## Contributing - -Thank you for considering contributing to the Laravel framework! 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/framework/security/policy) on how to report security vulnerabilities. - -## License - -The Laravel framework is open-sourced software licensed under the [MIT license](LICENSE.md). diff --git a/vendor/laravel/framework/composer.json b/vendor/laravel/framework/composer.json deleted file mode 100644 index dd7d4fe2..00000000 --- a/vendor/laravel/framework/composer.json +++ /dev/null @@ -1,182 +0,0 @@ -{ - "name": "laravel/framework", - "description": "The Laravel Framework.", - "keywords": ["framework", "laravel"], - "license": "MIT", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "require": { - "php": "^8.0.2", - "ext-mbstring": "*", - "ext-openssl": "*", - "doctrine/inflector": "^2.0", - "dragonmantank/cron-expression": "^3.3.2", - "egulias/email-validator": "^3.2.1", - "fruitcake/php-cors": "^1.2", - "laravel/serializable-closure": "^1.2.2", - "league/commonmark": "^2.2.1", - "league/flysystem": "^3.8.0", - "monolog/monolog": "^2.0", - "nesbot/carbon": "^2.62.1", - "nunomaduro/termwind": "^1.13", - "psr/container": "^1.1.1|^2.0.1", - "psr/log": "^1.0|^2.0|^3.0", - "psr/simple-cache": "^1.0|^2.0|^3.0", - "ramsey/uuid": "^4.7", - "symfony/console": "^6.0.9", - "symfony/error-handler": "^6.0", - "symfony/finder": "^6.0", - "symfony/http-foundation": "^6.0", - "symfony/http-kernel": "^6.0", - "symfony/mailer": "^6.0", - "symfony/mime": "^6.0", - "symfony/process": "^6.0", - "symfony/routing": "^6.0", - "symfony/uid": "^6.0", - "symfony/var-dumper": "^6.0", - "tijsverkoyen/css-to-inline-styles": "^2.2.5", - "vlucas/phpdotenv": "^5.4.1", - "voku/portable-ascii": "^2.0" - }, - "replace": { - "illuminate/auth": "self.version", - "illuminate/broadcasting": "self.version", - "illuminate/bus": "self.version", - "illuminate/cache": "self.version", - "illuminate/collections": "self.version", - "illuminate/conditionable": "self.version", - "illuminate/config": "self.version", - "illuminate/console": "self.version", - "illuminate/container": "self.version", - "illuminate/contracts": "self.version", - "illuminate/cookie": "self.version", - "illuminate/database": "self.version", - "illuminate/encryption": "self.version", - "illuminate/events": "self.version", - "illuminate/filesystem": "self.version", - "illuminate/hashing": "self.version", - "illuminate/http": "self.version", - "illuminate/log": "self.version", - "illuminate/macroable": "self.version", - "illuminate/mail": "self.version", - "illuminate/notifications": "self.version", - "illuminate/pagination": "self.version", - "illuminate/pipeline": "self.version", - "illuminate/queue": "self.version", - "illuminate/redis": "self.version", - "illuminate/routing": "self.version", - "illuminate/session": "self.version", - "illuminate/support": "self.version", - "illuminate/testing": "self.version", - "illuminate/translation": "self.version", - "illuminate/validation": "self.version", - "illuminate/view": "self.version" - }, - "require-dev": { - "ably/ably-php": "^1.0", - "aws/aws-sdk-php": "^3.235.5", - "doctrine/dbal": "^2.13.3|^3.1.4", - "fakerphp/faker": "^1.21", - "guzzlehttp/guzzle": "^7.5", - "league/flysystem-aws-s3-v3": "^3.0", - "league/flysystem-ftp": "^3.0", - "league/flysystem-path-prefixing": "^3.3", - "league/flysystem-read-only": "^3.3", - "league/flysystem-sftp-v3": "^3.0", - "mockery/mockery": "^1.5.1", - "orchestra/testbench-core": "^7.16", - "pda/pheanstalk": "^4.0", - "phpstan/phpstan": "^1.4.7", - "phpunit/phpunit": "^9.5.8", - "predis/predis": "^1.1.9|^2.0.2", - "symfony/cache": "^6.0" - }, - "provide": { - "psr/container-implementation": "1.1|2.0", - "psr/simple-cache-implementation": "1.0|2.0|3.0" - }, - "conflict": { - "tightenco/collect": "<5.5.33" - }, - "autoload": { - "files": [ - "src/Illuminate/Collections/helpers.php", - "src/Illuminate/Events/functions.php", - "src/Illuminate/Foundation/helpers.php", - "src/Illuminate/Support/helpers.php" - ], - "psr-4": { - "Illuminate\\": "src/Illuminate/", - "Illuminate\\Support\\": [ - "src/Illuminate/Macroable/", - "src/Illuminate/Collections/", - "src/Illuminate/Conditionable/" - ] - } - }, - "autoload-dev": { - "files": [ - "tests/Database/stubs/MigrationCreatorFakeMigration.php" - ], - "psr-4": { - "Illuminate\\Tests\\": "tests/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "suggest": { - "ext-bcmath": "Required to use the multiple_of validation rule.", - "ext-ftp": "Required to use the Flysystem FTP driver.", - "ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory::image().", - "ext-memcached": "Required to use the memcache cache driver.", - "ext-pcntl": "Required to use all features of the queue worker.", - "ext-posix": "Required to use all features of the queue worker.", - "ext-redis": "Required to use the Redis cache and queue drivers (^4.0|^5.0).", - "ably/ably-php": "Required to use the Ably broadcast driver (^1.0).", - "aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage, and SES mail driver (^3.235.5).", - "brianium/paratest": "Required to run tests in parallel (^6.0).", - "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.13.3|^3.1.4).", - "fakerphp/faker": "Required to use the eloquent factory builder (^1.9.1).", - "filp/whoops": "Required for friendly error pages in development (^2.14.3).", - "guzzlehttp/guzzle": "Required to use the HTTP Client and the ping methods on schedules (^7.5).", - "laravel/tinker": "Required to use the tinker console command (^2.0).", - "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^3.0).", - "league/flysystem-ftp": "Required to use the Flysystem FTP driver (^3.0).", - "league/flysystem-path-prefixing": "Required to use the scoped driver (^3.3).", - "league/flysystem-read-only": "Required to use read-only disks (^3.3)", - "league/flysystem-sftp-v3": "Required to use the Flysystem SFTP driver (^3.0).", - "mockery/mockery": "Required to use mocking (^1.5.1).", - "nyholm/psr7": "Required to use PSR-7 bridging features (^1.2).", - "pda/pheanstalk": "Required to use the beanstalk queue driver (^4.0).", - "phpunit/phpunit": "Required to use assertions and run tests (^9.5.8).", - "predis/predis": "Required to use the predis connector (^1.1.9|^2.0.2).", - "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).", - "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^6.0|^7.0).", - "symfony/cache": "Required to PSR-6 cache bridge (^6.0).", - "symfony/filesystem": "Required to enable support for relative symbolic links (^6.0).", - "symfony/http-client": "Required to enable support for the Symfony API mail transports (^6.0).", - "symfony/mailgun-mailer": "Required to enable support for the Mailgun mail transport (^6.0).", - "symfony/postmark-mailer": "Required to enable support for the Postmark mail transport (^6.0).", - "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^2.0)." - }, - "config": { - "sort-packages": true, - "allow-plugins": { - "composer/package-versions-deprecated": true - } - }, - "minimum-stability": "dev", - "prefer-stable": true -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/Access/AuthorizationException.php b/vendor/laravel/framework/src/Illuminate/Auth/Access/AuthorizationException.php deleted file mode 100644 index 17101b4d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/Access/AuthorizationException.php +++ /dev/null @@ -1,114 +0,0 @@ -code = $code ?: 0; - } - - /** - * Get the response from the gate. - * - * @return \Illuminate\Auth\Access\Response - */ - public function response() - { - return $this->response; - } - - /** - * Set the response from the gate. - * - * @param \Illuminate\Auth\Access\Response $response - * @return $this - */ - public function setResponse($response) - { - $this->response = $response; - - return $this; - } - - /** - * Set the HTTP response status code. - * - * @param int|null $status - * @return $this - */ - public function withStatus($status) - { - $this->status = $status; - - return $this; - } - - /** - * Set the HTTP response status code to 404. - * - * @return $this - */ - public function asNotFound() - { - return $this->withStatus(404); - } - - /** - * Determine if the HTTP status code has been set. - * - * @return bool - */ - public function hasStatus() - { - return $this->status !== null; - } - - /** - * Get the HTTP status code. - * - * @return int|null - */ - public function status() - { - return $this->status; - } - - /** - * Create a deny response object from this exception. - * - * @return \Illuminate\Auth\Access\Response - */ - public function toResponse() - { - return Response::deny($this->message, $this->code)->withStatus($this->status); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/Access/Events/GateEvaluated.php b/vendor/laravel/framework/src/Illuminate/Auth/Access/Events/GateEvaluated.php deleted file mode 100644 index f77a9c84..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/Access/Events/GateEvaluated.php +++ /dev/null @@ -1,51 +0,0 @@ -user = $user; - $this->ability = $ability; - $this->result = $result; - $this->arguments = $arguments; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/Access/Gate.php b/vendor/laravel/framework/src/Illuminate/Auth/Access/Gate.php deleted file mode 100644 index 1694607f..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/Access/Gate.php +++ /dev/null @@ -1,872 +0,0 @@ -policies = $policies; - $this->container = $container; - $this->abilities = $abilities; - $this->userResolver = $userResolver; - $this->afterCallbacks = $afterCallbacks; - $this->beforeCallbacks = $beforeCallbacks; - $this->guessPolicyNamesUsingCallback = $guessPolicyNamesUsingCallback; - } - - /** - * Determine if a given ability has been defined. - * - * @param string|array $ability - * @return bool - */ - public function has($ability) - { - $abilities = is_array($ability) ? $ability : func_get_args(); - - foreach ($abilities as $ability) { - if (! isset($this->abilities[$ability])) { - return false; - } - } - - return true; - } - - /** - * Perform an on-demand authorization check. Throw an authorization exception if the condition or callback is false. - * - * @param \Illuminate\Auth\Access\Response|\Closure|bool $condition - * @param string|null $message - * @param string|null $code - * @return \Illuminate\Auth\Access\Response - * - * @throws \Illuminate\Auth\Access\AuthorizationException - */ - public function allowIf($condition, $message = null, $code = null) - { - return $this->authorizeOnDemand($condition, $message, $code, true); - } - - /** - * Perform an on-demand authorization check. Throw an authorization exception if the condition or callback is true. - * - * @param \Illuminate\Auth\Access\Response|\Closure|bool $condition - * @param string|null $message - * @param string|null $code - * @return \Illuminate\Auth\Access\Response - * - * @throws \Illuminate\Auth\Access\AuthorizationException - */ - public function denyIf($condition, $message = null, $code = null) - { - return $this->authorizeOnDemand($condition, $message, $code, false); - } - - /** - * Authorize a given condition or callback. - * - * @param \Illuminate\Auth\Access\Response|\Closure|bool $condition - * @param string|null $message - * @param string|null $code - * @param bool $allowWhenResponseIs - * @return \Illuminate\Auth\Access\Response - * - * @throws \Illuminate\Auth\Access\AuthorizationException - */ - protected function authorizeOnDemand($condition, $message, $code, $allowWhenResponseIs) - { - $user = $this->resolveUser(); - - if ($condition instanceof Closure) { - $response = $this->canBeCalledWithUser($user, $condition) - ? $condition($user) - : new Response(false, $message, $code); - } else { - $response = $condition; - } - - return with($response instanceof Response ? $response : new Response( - (bool) $response === $allowWhenResponseIs, $message, $code - ))->authorize(); - } - - /** - * Define a new ability. - * - * @param string $ability - * @param callable|array|string $callback - * @return $this - * - * @throws \InvalidArgumentException - */ - public function define($ability, $callback) - { - if (is_array($callback) && isset($callback[0]) && is_string($callback[0])) { - $callback = $callback[0].'@'.$callback[1]; - } - - if (is_callable($callback)) { - $this->abilities[$ability] = $callback; - } elseif (is_string($callback)) { - $this->stringCallbacks[$ability] = $callback; - - $this->abilities[$ability] = $this->buildAbilityCallback($ability, $callback); - } else { - throw new InvalidArgumentException("Callback must be a callable, callback array, or a 'Class@method' string."); - } - - return $this; - } - - /** - * Define abilities for a resource. - * - * @param string $name - * @param string $class - * @param array|null $abilities - * @return $this - */ - public function resource($name, $class, array $abilities = null) - { - $abilities = $abilities ?: [ - 'viewAny' => 'viewAny', - 'view' => 'view', - 'create' => 'create', - 'update' => 'update', - 'delete' => 'delete', - ]; - - foreach ($abilities as $ability => $method) { - $this->define($name.'.'.$ability, $class.'@'.$method); - } - - return $this; - } - - /** - * Create the ability callback for a callback string. - * - * @param string $ability - * @param string $callback - * @return \Closure - */ - protected function buildAbilityCallback($ability, $callback) - { - return function () use ($ability, $callback) { - if (str_contains($callback, '@')) { - [$class, $method] = Str::parseCallback($callback); - } else { - $class = $callback; - } - - $policy = $this->resolvePolicy($class); - - $arguments = func_get_args(); - - $user = array_shift($arguments); - - $result = $this->callPolicyBefore( - $policy, $user, $ability, $arguments - ); - - if (! is_null($result)) { - return $result; - } - - return isset($method) - ? $policy->{$method}(...func_get_args()) - : $policy(...func_get_args()); - }; - } - - /** - * Define a policy class for a given class type. - * - * @param string $class - * @param string $policy - * @return $this - */ - public function policy($class, $policy) - { - $this->policies[$class] = $policy; - - return $this; - } - - /** - * Register a callback to run before all Gate checks. - * - * @param callable $callback - * @return $this - */ - public function before(callable $callback) - { - $this->beforeCallbacks[] = $callback; - - return $this; - } - - /** - * Register a callback to run after all Gate checks. - * - * @param callable $callback - * @return $this - */ - public function after(callable $callback) - { - $this->afterCallbacks[] = $callback; - - return $this; - } - - /** - * Determine if the given ability should be granted for the current user. - * - * @param string $ability - * @param array|mixed $arguments - * @return bool - */ - public function allows($ability, $arguments = []) - { - return $this->check($ability, $arguments); - } - - /** - * Determine if the given ability should be denied for the current user. - * - * @param string $ability - * @param array|mixed $arguments - * @return bool - */ - public function denies($ability, $arguments = []) - { - return ! $this->allows($ability, $arguments); - } - - /** - * Determine if all of the given abilities should be granted for the current user. - * - * @param iterable|string $abilities - * @param array|mixed $arguments - * @return bool - */ - public function check($abilities, $arguments = []) - { - return collect($abilities)->every( - fn ($ability) => $this->inspect($ability, $arguments)->allowed() - ); - } - - /** - * Determine if any one of the given abilities should be granted for the current user. - * - * @param iterable|string $abilities - * @param array|mixed $arguments - * @return bool - */ - public function any($abilities, $arguments = []) - { - return collect($abilities)->contains(fn ($ability) => $this->check($ability, $arguments)); - } - - /** - * Determine if all of the given abilities should be denied for the current user. - * - * @param iterable|string $abilities - * @param array|mixed $arguments - * @return bool - */ - public function none($abilities, $arguments = []) - { - return ! $this->any($abilities, $arguments); - } - - /** - * Determine if the given ability should be granted for the current user. - * - * @param string $ability - * @param array|mixed $arguments - * @return \Illuminate\Auth\Access\Response - * - * @throws \Illuminate\Auth\Access\AuthorizationException - */ - public function authorize($ability, $arguments = []) - { - return $this->inspect($ability, $arguments)->authorize(); - } - - /** - * Inspect the user for the given ability. - * - * @param string $ability - * @param array|mixed $arguments - * @return \Illuminate\Auth\Access\Response - */ - public function inspect($ability, $arguments = []) - { - try { - $result = $this->raw($ability, $arguments); - - if ($result instanceof Response) { - return $result; - } - - return $result ? Response::allow() : Response::deny(); - } catch (AuthorizationException $e) { - return $e->toResponse(); - } - } - - /** - * Get the raw result from the authorization callback. - * - * @param string $ability - * @param array|mixed $arguments - * @return mixed - * - * @throws \Illuminate\Auth\Access\AuthorizationException - */ - public function raw($ability, $arguments = []) - { - $arguments = Arr::wrap($arguments); - - $user = $this->resolveUser(); - - // First we will call the "before" callbacks for the Gate. If any of these give - // back a non-null response, we will immediately return that result in order - // to let the developers override all checks for some authorization cases. - $result = $this->callBeforeCallbacks( - $user, $ability, $arguments - ); - - if (is_null($result)) { - $result = $this->callAuthCallback($user, $ability, $arguments); - } - - // After calling the authorization callback, we will call the "after" callbacks - // that are registered with the Gate, which allows a developer to do logging - // if that is required for this application. Then we'll return the result. - return tap($this->callAfterCallbacks( - $user, $ability, $arguments, $result - ), function ($result) use ($user, $ability, $arguments) { - $this->dispatchGateEvaluatedEvent($user, $ability, $arguments, $result); - }); - } - - /** - * Determine whether the callback/method can be called with the given user. - * - * @param \Illuminate\Contracts\Auth\Authenticatable|null $user - * @param \Closure|string|array $class - * @param string|null $method - * @return bool - */ - protected function canBeCalledWithUser($user, $class, $method = null) - { - if (! is_null($user)) { - return true; - } - - if (! is_null($method)) { - return $this->methodAllowsGuests($class, $method); - } - - if (is_array($class)) { - $className = is_string($class[0]) ? $class[0] : get_class($class[0]); - - return $this->methodAllowsGuests($className, $class[1]); - } - - return $this->callbackAllowsGuests($class); - } - - /** - * Determine if the given class method allows guests. - * - * @param string $class - * @param string $method - * @return bool - */ - protected function methodAllowsGuests($class, $method) - { - try { - $reflection = new ReflectionClass($class); - - $method = $reflection->getMethod($method); - } catch (Exception $e) { - return false; - } - - if ($method) { - $parameters = $method->getParameters(); - - return isset($parameters[0]) && $this->parameterAllowsGuests($parameters[0]); - } - - return false; - } - - /** - * Determine if the callback allows guests. - * - * @param callable $callback - * @return bool - * - * @throws \ReflectionException - */ - protected function callbackAllowsGuests($callback) - { - $parameters = (new ReflectionFunction($callback))->getParameters(); - - return isset($parameters[0]) && $this->parameterAllowsGuests($parameters[0]); - } - - /** - * Determine if the given parameter allows guests. - * - * @param \ReflectionParameter $parameter - * @return bool - */ - protected function parameterAllowsGuests($parameter) - { - return ($parameter->hasType() && $parameter->allowsNull()) || - ($parameter->isDefaultValueAvailable() && is_null($parameter->getDefaultValue())); - } - - /** - * Resolve and call the appropriate authorization callback. - * - * @param \Illuminate\Contracts\Auth\Authenticatable|null $user - * @param string $ability - * @param array $arguments - * @return bool - */ - protected function callAuthCallback($user, $ability, array $arguments) - { - $callback = $this->resolveAuthCallback($user, $ability, $arguments); - - return $callback($user, ...$arguments); - } - - /** - * Call all of the before callbacks and return if a result is given. - * - * @param \Illuminate\Contracts\Auth\Authenticatable|null $user - * @param string $ability - * @param array $arguments - * @return bool|null - */ - protected function callBeforeCallbacks($user, $ability, array $arguments) - { - foreach ($this->beforeCallbacks as $before) { - if (! $this->canBeCalledWithUser($user, $before)) { - continue; - } - - if (! is_null($result = $before($user, $ability, $arguments))) { - return $result; - } - } - } - - /** - * Call all of the after callbacks with check result. - * - * @param \Illuminate\Contracts\Auth\Authenticatable $user - * @param string $ability - * @param array $arguments - * @param bool $result - * @return bool|null - */ - protected function callAfterCallbacks($user, $ability, array $arguments, $result) - { - foreach ($this->afterCallbacks as $after) { - if (! $this->canBeCalledWithUser($user, $after)) { - continue; - } - - $afterResult = $after($user, $ability, $result, $arguments); - - $result ??= $afterResult; - } - - return $result; - } - - /** - * Dispatch a gate evaluation event. - * - * @param \Illuminate\Contracts\Auth\Authenticatable|null $user - * @param string $ability - * @param array $arguments - * @param bool|null $result - * @return void - */ - protected function dispatchGateEvaluatedEvent($user, $ability, array $arguments, $result) - { - if ($this->container->bound(Dispatcher::class)) { - $this->container->make(Dispatcher::class)->dispatch( - new GateEvaluated($user, $ability, $result, $arguments) - ); - } - } - - /** - * Resolve the callable for the given ability and arguments. - * - * @param \Illuminate\Contracts\Auth\Authenticatable|null $user - * @param string $ability - * @param array $arguments - * @return callable - */ - protected function resolveAuthCallback($user, $ability, array $arguments) - { - if (isset($arguments[0]) && - ! is_null($policy = $this->getPolicyFor($arguments[0])) && - $callback = $this->resolvePolicyCallback($user, $ability, $arguments, $policy)) { - return $callback; - } - - if (isset($this->stringCallbacks[$ability])) { - [$class, $method] = Str::parseCallback($this->stringCallbacks[$ability]); - - if ($this->canBeCalledWithUser($user, $class, $method ?: '__invoke')) { - return $this->abilities[$ability]; - } - } - - if (isset($this->abilities[$ability]) && - $this->canBeCalledWithUser($user, $this->abilities[$ability])) { - return $this->abilities[$ability]; - } - - return function () { - // - }; - } - - /** - * Get a policy instance for a given class. - * - * @param object|string $class - * @return mixed - */ - public function getPolicyFor($class) - { - if (is_object($class)) { - $class = get_class($class); - } - - if (! is_string($class)) { - return; - } - - if (isset($this->policies[$class])) { - return $this->resolvePolicy($this->policies[$class]); - } - - foreach ($this->guessPolicyName($class) as $guessedPolicy) { - if (class_exists($guessedPolicy)) { - return $this->resolvePolicy($guessedPolicy); - } - } - - foreach ($this->policies as $expected => $policy) { - if (is_subclass_of($class, $expected)) { - return $this->resolvePolicy($policy); - } - } - } - - /** - * Guess the policy name for the given class. - * - * @param string $class - * @return array - */ - protected function guessPolicyName($class) - { - if ($this->guessPolicyNamesUsingCallback) { - return Arr::wrap(call_user_func($this->guessPolicyNamesUsingCallback, $class)); - } - - $classDirname = str_replace('/', '\\', dirname(str_replace('\\', '/', $class))); - - $classDirnameSegments = explode('\\', $classDirname); - - return Arr::wrap(Collection::times(count($classDirnameSegments), function ($index) use ($class, $classDirnameSegments) { - $classDirname = implode('\\', array_slice($classDirnameSegments, 0, $index)); - - return $classDirname.'\\Policies\\'.class_basename($class).'Policy'; - })->reverse()->values()->first(function ($class) { - return class_exists($class); - }) ?: [$classDirname.'\\Policies\\'.class_basename($class).'Policy']); - } - - /** - * Specify a callback to be used to guess policy names. - * - * @param callable $callback - * @return $this - */ - public function guessPolicyNamesUsing(callable $callback) - { - $this->guessPolicyNamesUsingCallback = $callback; - - return $this; - } - - /** - * Build a policy class instance of the given type. - * - * @param object|string $class - * @return mixed - * - * @throws \Illuminate\Contracts\Container\BindingResolutionException - */ - public function resolvePolicy($class) - { - return $this->container->make($class); - } - - /** - * Resolve the callback for a policy check. - * - * @param \Illuminate\Contracts\Auth\Authenticatable $user - * @param string $ability - * @param array $arguments - * @param mixed $policy - * @return bool|callable - */ - protected function resolvePolicyCallback($user, $ability, array $arguments, $policy) - { - if (! is_callable([$policy, $this->formatAbilityToMethod($ability)])) { - return false; - } - - return function () use ($user, $ability, $arguments, $policy) { - // This callback will be responsible for calling the policy's before method and - // running this policy method if necessary. This is used to when objects are - // mapped to policy objects in the user's configurations or on this class. - $result = $this->callPolicyBefore( - $policy, $user, $ability, $arguments - ); - - // When we receive a non-null result from this before method, we will return it - // as the "final" results. This will allow developers to override the checks - // in this policy to return the result for all rules defined in the class. - if (! is_null($result)) { - return $result; - } - - $method = $this->formatAbilityToMethod($ability); - - return $this->callPolicyMethod($policy, $method, $user, $arguments); - }; - } - - /** - * Call the "before" method on the given policy, if applicable. - * - * @param mixed $policy - * @param \Illuminate\Contracts\Auth\Authenticatable $user - * @param string $ability - * @param array $arguments - * @return mixed - */ - protected function callPolicyBefore($policy, $user, $ability, $arguments) - { - if (! method_exists($policy, 'before')) { - return; - } - - if ($this->canBeCalledWithUser($user, $policy, 'before')) { - return $policy->before($user, $ability, ...$arguments); - } - } - - /** - * Call the appropriate method on the given policy. - * - * @param mixed $policy - * @param string $method - * @param \Illuminate\Contracts\Auth\Authenticatable|null $user - * @param array $arguments - * @return mixed - */ - protected function callPolicyMethod($policy, $method, $user, array $arguments) - { - // If this first argument is a string, that means they are passing a class name - // to the policy. We will remove the first argument from this argument array - // because this policy already knows what type of models it can authorize. - if (isset($arguments[0]) && is_string($arguments[0])) { - array_shift($arguments); - } - - if (! is_callable([$policy, $method])) { - return; - } - - if ($this->canBeCalledWithUser($user, $policy, $method)) { - return $policy->{$method}($user, ...$arguments); - } - } - - /** - * Format the policy ability into a method name. - * - * @param string $ability - * @return string - */ - protected function formatAbilityToMethod($ability) - { - return str_contains($ability, '-') ? Str::camel($ability) : $ability; - } - - /** - * Get a gate instance for the given user. - * - * @param \Illuminate\Contracts\Auth\Authenticatable|mixed $user - * @return static - */ - public function forUser($user) - { - $callback = fn () => $user; - - return new static( - $this->container, $callback, $this->abilities, - $this->policies, $this->beforeCallbacks, $this->afterCallbacks, - $this->guessPolicyNamesUsingCallback - ); - } - - /** - * Resolve the user from the user resolver. - * - * @return mixed - */ - protected function resolveUser() - { - return call_user_func($this->userResolver); - } - - /** - * Get all of the defined abilities. - * - * @return array - */ - public function abilities() - { - return $this->abilities; - } - - /** - * Get all of the defined policies. - * - * @return array - */ - public function policies() - { - return $this->policies; - } - - /** - * Set the container instance used by the gate. - * - * @param \Illuminate\Contracts\Container\Container $container - * @return $this - */ - public function setContainer(Container $container) - { - $this->container = $container; - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/Access/HandlesAuthorization.php b/vendor/laravel/framework/src/Illuminate/Auth/Access/HandlesAuthorization.php deleted file mode 100644 index fc71cf15..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/Access/HandlesAuthorization.php +++ /dev/null @@ -1,55 +0,0 @@ -code = $code; - $this->allowed = $allowed; - $this->message = $message; - } - - /** - * Create a new "allow" Response. - * - * @param string|null $message - * @param mixed $code - * @return \Illuminate\Auth\Access\Response - */ - public static function allow($message = null, $code = null) - { - return new static(true, $message, $code); - } - - /** - * Create a new "deny" Response. - * - * @param string|null $message - * @param mixed $code - * @return \Illuminate\Auth\Access\Response - */ - public static function deny($message = null, $code = null) - { - return new static(false, $message, $code); - } - - /** - * Create a new "deny" Response with a HTTP status code. - * - * @param int $status - * @param string|null $message - * @param mixed $code - * @return \Illuminate\Auth\Access\Response - */ - public static function denyWithStatus($status, $message = null, $code = null) - { - return static::deny($message, $code)->withStatus($status); - } - - /** - * Create a new "deny" Response with a 404 HTTP status code. - * - * @param string|null $message - * @param mixed $code - * @return \Illuminate\Auth\Access\Response - */ - public static function denyAsNotFound($message = null, $code = null) - { - return static::denyWithStatus(404, $message, $code); - } - - /** - * Determine if the response was allowed. - * - * @return bool - */ - public function allowed() - { - return $this->allowed; - } - - /** - * Determine if the response was denied. - * - * @return bool - */ - public function denied() - { - return ! $this->allowed(); - } - - /** - * Get the response message. - * - * @return string|null - */ - public function message() - { - return $this->message; - } - - /** - * Get the response code / reason. - * - * @return mixed - */ - public function code() - { - return $this->code; - } - - /** - * Throw authorization exception if response was denied. - * - * @return \Illuminate\Auth\Access\Response - * - * @throws \Illuminate\Auth\Access\AuthorizationException - */ - public function authorize() - { - if ($this->denied()) { - throw (new AuthorizationException($this->message(), $this->code())) - ->setResponse($this) - ->withStatus($this->status); - } - - return $this; - } - - /** - * Set the HTTP response status code. - * - * @param null|int $status - * @return $this - */ - public function withStatus($status) - { - $this->status = $status; - - return $this; - } - - /** - * Set the HTTP response status code to 404. - * - * @return $this - */ - public function asNotFound() - { - return $this->withStatus(404); - } - - /** - * Get the HTTP status code. - * - * @return int|null - */ - public function status() - { - return $this->status; - } - - /** - * Convert the response to an array. - * - * @return array - */ - public function toArray() - { - return [ - 'allowed' => $this->allowed(), - 'message' => $this->message(), - 'code' => $this->code(), - ]; - } - - /** - * Get the string representation of the message. - * - * @return string - */ - public function __toString() - { - return (string) $this->message(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php b/vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php deleted file mode 100755 index e95da5ec..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php +++ /dev/null @@ -1,342 +0,0 @@ -app = $app; - - $this->userResolver = fn ($guard = null) => $this->guard($guard)->user(); - } - - /** - * Attempt to get the guard from the local cache. - * - * @param string|null $name - * @return \Illuminate\Contracts\Auth\Guard|\Illuminate\Contracts\Auth\StatefulGuard - */ - public function guard($name = null) - { - $name = $name ?: $this->getDefaultDriver(); - - return $this->guards[$name] ?? $this->guards[$name] = $this->resolve($name); - } - - /** - * Resolve the given guard. - * - * @param string $name - * @return \Illuminate\Contracts\Auth\Guard|\Illuminate\Contracts\Auth\StatefulGuard - * - * @throws \InvalidArgumentException - */ - protected function resolve($name) - { - $config = $this->getConfig($name); - - if (is_null($config)) { - throw new InvalidArgumentException("Auth guard [{$name}] is not defined."); - } - - if (isset($this->customCreators[$config['driver']])) { - return $this->callCustomCreator($name, $config); - } - - $driverMethod = 'create'.ucfirst($config['driver']).'Driver'; - - if (method_exists($this, $driverMethod)) { - return $this->{$driverMethod}($name, $config); - } - - throw new InvalidArgumentException( - "Auth driver [{$config['driver']}] for guard [{$name}] is not defined." - ); - } - - /** - * Call a custom driver creator. - * - * @param string $name - * @param array $config - * @return mixed - */ - protected function callCustomCreator($name, array $config) - { - return $this->customCreators[$config['driver']]($this->app, $name, $config); - } - - /** - * Create a session based authentication guard. - * - * @param string $name - * @param array $config - * @return \Illuminate\Auth\SessionGuard - */ - public function createSessionDriver($name, $config) - { - $provider = $this->createUserProvider($config['provider'] ?? null); - - $guard = new SessionGuard( - $name, - $provider, - $this->app['session.store'], - ); - - // When using the remember me functionality of the authentication services we - // will need to be set the encryption instance of the guard, which allows - // secure, encrypted cookie values to get generated for those cookies. - if (method_exists($guard, 'setCookieJar')) { - $guard->setCookieJar($this->app['cookie']); - } - - if (method_exists($guard, 'setDispatcher')) { - $guard->setDispatcher($this->app['events']); - } - - if (method_exists($guard, 'setRequest')) { - $guard->setRequest($this->app->refresh('request', $guard, 'setRequest')); - } - - if (isset($config['remember'])) { - $guard->setRememberDuration($config['remember']); - } - - return $guard; - } - - /** - * Create a token based authentication guard. - * - * @param string $name - * @param array $config - * @return \Illuminate\Auth\TokenGuard - */ - public function createTokenDriver($name, $config) - { - // The token guard implements a basic API token based guard implementation - // that takes an API token field from the request and matches it to the - // user in the database or another persistence layer where users are. - $guard = new TokenGuard( - $this->createUserProvider($config['provider'] ?? null), - $this->app['request'], - $config['input_key'] ?? 'api_token', - $config['storage_key'] ?? 'api_token', - $config['hash'] ?? false - ); - - $this->app->refresh('request', $guard, 'setRequest'); - - return $guard; - } - - /** - * Get the guard configuration. - * - * @param string $name - * @return array - */ - protected function getConfig($name) - { - return $this->app['config']["auth.guards.{$name}"]; - } - - /** - * Get the default authentication driver name. - * - * @return string - */ - public function getDefaultDriver() - { - return $this->app['config']['auth.defaults.guard']; - } - - /** - * Set the default guard driver the factory should serve. - * - * @param string $name - * @return void - */ - public function shouldUse($name) - { - $name = $name ?: $this->getDefaultDriver(); - - $this->setDefaultDriver($name); - - $this->userResolver = fn ($name = null) => $this->guard($name)->user(); - } - - /** - * Set the default authentication driver name. - * - * @param string $name - * @return void - */ - public function setDefaultDriver($name) - { - $this->app['config']['auth.defaults.guard'] = $name; - } - - /** - * Register a new callback based request guard. - * - * @param string $driver - * @param callable $callback - * @return $this - */ - public function viaRequest($driver, callable $callback) - { - return $this->extend($driver, function () use ($callback) { - $guard = new RequestGuard($callback, $this->app['request'], $this->createUserProvider()); - - $this->app->refresh('request', $guard, 'setRequest'); - - return $guard; - }); - } - - /** - * Get the user resolver callback. - * - * @return \Closure - */ - public function userResolver() - { - return $this->userResolver; - } - - /** - * Set the callback to be used to resolve users. - * - * @param \Closure $userResolver - * @return $this - */ - public function resolveUsersUsing(Closure $userResolver) - { - $this->userResolver = $userResolver; - - return $this; - } - - /** - * Register a custom driver creator Closure. - * - * @param string $driver - * @param \Closure $callback - * @return $this - */ - public function extend($driver, Closure $callback) - { - $this->customCreators[$driver] = $callback; - - return $this; - } - - /** - * Register a custom provider creator Closure. - * - * @param string $name - * @param \Closure $callback - * @return $this - */ - public function provider($name, Closure $callback) - { - $this->customProviderCreators[$name] = $callback; - - return $this; - } - - /** - * Determines if any guards have already been resolved. - * - * @return bool - */ - public function hasResolvedGuards() - { - return count($this->guards) > 0; - } - - /** - * Forget all of the resolved guard instances. - * - * @return $this - */ - public function forgetGuards() - { - $this->guards = []; - - return $this; - } - - /** - * Set the application instance used by the manager. - * - * @param \Illuminate\Contracts\Foundation\Application $app - * @return $this - */ - public function setApplication($app) - { - $this->app = $app; - - return $this; - } - - /** - * Dynamically call the default driver instance. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - return $this->guard()->{$method}(...$parameters); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/AuthServiceProvider.php b/vendor/laravel/framework/src/Illuminate/Auth/AuthServiceProvider.php deleted file mode 100755 index 2f4dfb6f..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/AuthServiceProvider.php +++ /dev/null @@ -1,112 +0,0 @@ -registerAuthenticator(); - $this->registerUserResolver(); - $this->registerAccessGate(); - $this->registerRequirePassword(); - $this->registerRequestRebindHandler(); - $this->registerEventRebindHandler(); - } - - /** - * Register the authenticator services. - * - * @return void - */ - protected function registerAuthenticator() - { - $this->app->singleton('auth', fn ($app) => new AuthManager($app)); - - $this->app->singleton('auth.driver', fn ($app) => $app['auth']->guard()); - } - - /** - * Register a resolver for the authenticated user. - * - * @return void - */ - protected function registerUserResolver() - { - $this->app->bind(AuthenticatableContract::class, fn ($app) => call_user_func($app['auth']->userResolver())); - } - - /** - * Register the access gate service. - * - * @return void - */ - protected function registerAccessGate() - { - $this->app->singleton(GateContract::class, function ($app) { - return new Gate($app, fn () => call_user_func($app['auth']->userResolver())); - }); - } - - /** - * Register a resolver for the authenticated user. - * - * @return void - */ - protected function registerRequirePassword() - { - $this->app->bind(RequirePassword::class, function ($app) { - return new RequirePassword( - $app[ResponseFactory::class], - $app[UrlGenerator::class], - $app['config']->get('auth.password_timeout') - ); - }); - } - - /** - * Handle the re-binding of the request binding. - * - * @return void - */ - protected function registerRequestRebindHandler() - { - $this->app->rebinding('request', function ($app, $request) { - $request->setUserResolver(function ($guard = null) use ($app) { - return call_user_func($app['auth']->userResolver(), $guard); - }); - }); - } - - /** - * Handle the re-binding of the event dispatcher binding. - * - * @return void - */ - protected function registerEventRebindHandler() - { - $this->app->rebinding('events', function ($app, $dispatcher) { - if (! $app->resolved('auth') || - $app['auth']->hasResolvedGuards() === false) { - return; - } - - if (method_exists($guard = $app['auth']->guard(), 'setDispatcher')) { - $guard->setDispatcher($dispatcher); - } - }); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/Authenticatable.php b/vendor/laravel/framework/src/Illuminate/Auth/Authenticatable.php deleted file mode 100644 index f1c01159..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/Authenticatable.php +++ /dev/null @@ -1,88 +0,0 @@ -getKeyName(); - } - - /** - * Get the unique identifier for the user. - * - * @return mixed - */ - public function getAuthIdentifier() - { - return $this->{$this->getAuthIdentifierName()}; - } - - /** - * Get the unique broadcast identifier for the user. - * - * @return mixed - */ - public function getAuthIdentifierForBroadcasting() - { - return $this->getAuthIdentifier(); - } - - /** - * Get the password for the user. - * - * @return string - */ - public function getAuthPassword() - { - return $this->password; - } - - /** - * Get the token value for the "remember me" session. - * - * @return string|null - */ - public function getRememberToken() - { - if (! empty($this->getRememberTokenName())) { - return (string) $this->{$this->getRememberTokenName()}; - } - } - - /** - * Set the token value for the "remember me" session. - * - * @param string $value - * @return void - */ - public function setRememberToken($value) - { - if (! empty($this->getRememberTokenName())) { - $this->{$this->getRememberTokenName()} = $value; - } - } - - /** - * Get the column name for the "remember me" token. - * - * @return string - */ - public function getRememberTokenName() - { - return $this->rememberTokenName; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/AuthenticationException.php b/vendor/laravel/framework/src/Illuminate/Auth/AuthenticationException.php deleted file mode 100644 index 66808c3b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/AuthenticationException.php +++ /dev/null @@ -1,58 +0,0 @@ -guards = $guards; - $this->redirectTo = $redirectTo; - } - - /** - * Get the guards that were checked. - * - * @return array - */ - public function guards() - { - return $this->guards; - } - - /** - * Get the path the user should be redirected to. - * - * @return string|null - */ - public function redirectTo() - { - return $this->redirectTo; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/Console/ClearResetsCommand.php b/vendor/laravel/framework/src/Illuminate/Auth/Console/ClearResetsCommand.php deleted file mode 100644 index 2ea96681..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/Console/ClearResetsCommand.php +++ /dev/null @@ -1,47 +0,0 @@ -laravel['auth.password']->broker($this->argument('name'))->getRepository()->deleteExpired(); - - $this->components->info('Expired reset tokens cleared successfully.'); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/Console/stubs/make/views/layouts/app.stub b/vendor/laravel/framework/src/Illuminate/Auth/Console/stubs/make/views/layouts/app.stub deleted file mode 100644 index 2f2986d3..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/Console/stubs/make/views/layouts/app.stub +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - {{ config('app.name', 'Laravel') }} - - - - - - - - -
- - -
- @yield('content') -
-
- - diff --git a/vendor/laravel/framework/src/Illuminate/Auth/CreatesUserProviders.php b/vendor/laravel/framework/src/Illuminate/Auth/CreatesUserProviders.php deleted file mode 100644 index 761a4276..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/CreatesUserProviders.php +++ /dev/null @@ -1,91 +0,0 @@ -getProviderConfiguration($provider))) { - return; - } - - if (isset($this->customProviderCreators[$driver = ($config['driver'] ?? null)])) { - return call_user_func( - $this->customProviderCreators[$driver], $this->app, $config - ); - } - - return match ($driver) { - 'database' => $this->createDatabaseProvider($config), - 'eloquent' => $this->createEloquentProvider($config), - default => throw new InvalidArgumentException( - "Authentication user provider [{$driver}] is not defined." - ), - }; - } - - /** - * Get the user provider configuration. - * - * @param string|null $provider - * @return array|null - */ - protected function getProviderConfiguration($provider) - { - if ($provider = $provider ?: $this->getDefaultUserProvider()) { - return $this->app['config']['auth.providers.'.$provider]; - } - } - - /** - * Create an instance of the database user provider. - * - * @param array $config - * @return \Illuminate\Auth\DatabaseUserProvider - */ - protected function createDatabaseProvider($config) - { - $connection = $this->app['db']->connection($config['connection'] ?? null); - - return new DatabaseUserProvider($connection, $this->app['hash'], $config['table']); - } - - /** - * Create an instance of the Eloquent user provider. - * - * @param array $config - * @return \Illuminate\Auth\EloquentUserProvider - */ - protected function createEloquentProvider($config) - { - return new EloquentUserProvider($this->app['hash'], $config['model']); - } - - /** - * Get the default user provider name. - * - * @return string - */ - public function getDefaultUserProvider() - { - return $this->app['config']['auth.defaults.provider']; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/DatabaseUserProvider.php b/vendor/laravel/framework/src/Illuminate/Auth/DatabaseUserProvider.php deleted file mode 100755 index 16b70ee9..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/DatabaseUserProvider.php +++ /dev/null @@ -1,161 +0,0 @@ -connection = $connection; - $this->table = $table; - $this->hasher = $hasher; - } - - /** - * Retrieve a user by their unique identifier. - * - * @param mixed $identifier - * @return \Illuminate\Contracts\Auth\Authenticatable|null - */ - public function retrieveById($identifier) - { - $user = $this->connection->table($this->table)->find($identifier); - - return $this->getGenericUser($user); - } - - /** - * Retrieve a user by their unique identifier and "remember me" token. - * - * @param mixed $identifier - * @param string $token - * @return \Illuminate\Contracts\Auth\Authenticatable|null - */ - public function retrieveByToken($identifier, $token) - { - $user = $this->getGenericUser( - $this->connection->table($this->table)->find($identifier) - ); - - return $user && $user->getRememberToken() && hash_equals($user->getRememberToken(), $token) - ? $user : null; - } - - /** - * Update the "remember me" token for the given user in storage. - * - * @param \Illuminate\Contracts\Auth\Authenticatable $user - * @param string $token - * @return void - */ - public function updateRememberToken(UserContract $user, $token) - { - $this->connection->table($this->table) - ->where($user->getAuthIdentifierName(), $user->getAuthIdentifier()) - ->update([$user->getRememberTokenName() => $token]); - } - - /** - * Retrieve a user by the given credentials. - * - * @param array $credentials - * @return \Illuminate\Contracts\Auth\Authenticatable|null - */ - public function retrieveByCredentials(array $credentials) - { - $credentials = array_filter( - $credentials, - fn ($key) => ! str_contains($key, 'password'), - ARRAY_FILTER_USE_KEY - ); - - if (empty($credentials)) { - return; - } - - // First we will add each credential element to the query as a where clause. - // Then we can execute the query and, if we found a user, return it in a - // generic "user" object that will be utilized by the Guard instances. - $query = $this->connection->table($this->table); - - foreach ($credentials as $key => $value) { - if (is_array($value) || $value instanceof Arrayable) { - $query->whereIn($key, $value); - } elseif ($value instanceof Closure) { - $value($query); - } else { - $query->where($key, $value); - } - } - - // Now we are ready to execute the query to see if we have a user matching - // the given credentials. If not, we will just return null and indicate - // that there are no matching users from the given credential arrays. - $user = $query->first(); - - return $this->getGenericUser($user); - } - - /** - * Get the generic user. - * - * @param mixed $user - * @return \Illuminate\Auth\GenericUser|null - */ - protected function getGenericUser($user) - { - if (! is_null($user)) { - return new GenericUser((array) $user); - } - } - - /** - * Validate a user against the given credentials. - * - * @param \Illuminate\Contracts\Auth\Authenticatable $user - * @param array $credentials - * @return bool - */ - public function validateCredentials(UserContract $user, array $credentials) - { - return $this->hasher->check( - $credentials['password'], $user->getAuthPassword() - ); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/EloquentUserProvider.php b/vendor/laravel/framework/src/Illuminate/Auth/EloquentUserProvider.php deleted file mode 100755 index 69ffea72..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/EloquentUserProvider.php +++ /dev/null @@ -1,253 +0,0 @@ -model = $model; - $this->hasher = $hasher; - } - - /** - * Retrieve a user by their unique identifier. - * - * @param mixed $identifier - * @return \Illuminate\Contracts\Auth\Authenticatable|null - */ - public function retrieveById($identifier) - { - $model = $this->createModel(); - - return $this->newModelQuery($model) - ->where($model->getAuthIdentifierName(), $identifier) - ->first(); - } - - /** - * Retrieve a user by their unique identifier and "remember me" token. - * - * @param mixed $identifier - * @param string $token - * @return \Illuminate\Contracts\Auth\Authenticatable|null - */ - public function retrieveByToken($identifier, $token) - { - $model = $this->createModel(); - - $retrievedModel = $this->newModelQuery($model)->where( - $model->getAuthIdentifierName(), $identifier - )->first(); - - if (! $retrievedModel) { - return; - } - - $rememberToken = $retrievedModel->getRememberToken(); - - return $rememberToken && hash_equals($rememberToken, $token) ? $retrievedModel : null; - } - - /** - * Update the "remember me" token for the given user in storage. - * - * @param \Illuminate\Contracts\Auth\Authenticatable $user - * @param string $token - * @return void - */ - public function updateRememberToken(UserContract $user, $token) - { - $user->setRememberToken($token); - - $timestamps = $user->timestamps; - - $user->timestamps = false; - - $user->save(); - - $user->timestamps = $timestamps; - } - - /** - * Retrieve a user by the given credentials. - * - * @param array $credentials - * @return \Illuminate\Contracts\Auth\Authenticatable|null - */ - public function retrieveByCredentials(array $credentials) - { - $credentials = array_filter( - $credentials, - fn ($key) => ! str_contains($key, 'password'), - ARRAY_FILTER_USE_KEY - ); - - if (empty($credentials)) { - return; - } - - // First we will add each credential element to the query as a where clause. - // Then we can execute the query and, if we found a user, return it in a - // Eloquent User "model" that will be utilized by the Guard instances. - $query = $this->newModelQuery(); - - foreach ($credentials as $key => $value) { - if (is_array($value) || $value instanceof Arrayable) { - $query->whereIn($key, $value); - } elseif ($value instanceof Closure) { - $value($query); - } else { - $query->where($key, $value); - } - } - - return $query->first(); - } - - /** - * Validate a user against the given credentials. - * - * @param \Illuminate\Contracts\Auth\Authenticatable $user - * @param array $credentials - * @return bool - */ - public function validateCredentials(UserContract $user, array $credentials) - { - $plain = $credentials['password']; - - return $this->hasher->check($plain, $user->getAuthPassword()); - } - - /** - * Get a new query builder for the model instance. - * - * @param \Illuminate\Database\Eloquent\Model|null $model - * @return \Illuminate\Database\Eloquent\Builder - */ - protected function newModelQuery($model = null) - { - $query = is_null($model) - ? $this->createModel()->newQuery() - : $model->newQuery(); - - with($query, $this->queryCallback); - - return $query; - } - - /** - * Create a new instance of the model. - * - * @return \Illuminate\Database\Eloquent\Model - */ - public function createModel() - { - $class = '\\'.ltrim($this->model, '\\'); - - return new $class; - } - - /** - * Gets the hasher implementation. - * - * @return \Illuminate\Contracts\Hashing\Hasher - */ - public function getHasher() - { - return $this->hasher; - } - - /** - * Sets the hasher implementation. - * - * @param \Illuminate\Contracts\Hashing\Hasher $hasher - * @return $this - */ - public function setHasher(HasherContract $hasher) - { - $this->hasher = $hasher; - - return $this; - } - - /** - * Gets the name of the Eloquent user model. - * - * @return string - */ - public function getModel() - { - return $this->model; - } - - /** - * Sets the name of the Eloquent user model. - * - * @param string $model - * @return $this - */ - public function setModel($model) - { - $this->model = $model; - - return $this; - } - - /** - * Get the callback that modifies the query before retrieving users. - * - * @return \Closure|null - */ - public function getQueryCallback() - { - return $this->queryCallback; - } - - /** - * Sets the callback to modify the query before retrieving users. - * - * @param (\Closure(\Illuminate\Database\Eloquent\Builder):mixed)|null $queryCallback - * @return $this - */ - public function withQuery($queryCallback = null) - { - $this->queryCallback = $queryCallback; - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/Events/Attempting.php b/vendor/laravel/framework/src/Illuminate/Auth/Events/Attempting.php deleted file mode 100644 index 3f911bac..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/Events/Attempting.php +++ /dev/null @@ -1,42 +0,0 @@ -guard = $guard; - $this->remember = $remember; - $this->credentials = $credentials; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/Events/Authenticated.php b/vendor/laravel/framework/src/Illuminate/Auth/Events/Authenticated.php deleted file mode 100644 index faefcbec..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/Events/Authenticated.php +++ /dev/null @@ -1,37 +0,0 @@ -user = $user; - $this->guard = $guard; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/Events/CurrentDeviceLogout.php b/vendor/laravel/framework/src/Illuminate/Auth/Events/CurrentDeviceLogout.php deleted file mode 100644 index 32d31faf..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/Events/CurrentDeviceLogout.php +++ /dev/null @@ -1,37 +0,0 @@ -user = $user; - $this->guard = $guard; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/Events/Failed.php b/vendor/laravel/framework/src/Illuminate/Auth/Events/Failed.php deleted file mode 100644 index 34f81248..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/Events/Failed.php +++ /dev/null @@ -1,42 +0,0 @@ -user = $user; - $this->guard = $guard; - $this->credentials = $credentials; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/Events/Lockout.php b/vendor/laravel/framework/src/Illuminate/Auth/Events/Lockout.php deleted file mode 100644 index 347943fe..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/Events/Lockout.php +++ /dev/null @@ -1,26 +0,0 @@ -request = $request; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/Events/Login.php b/vendor/laravel/framework/src/Illuminate/Auth/Events/Login.php deleted file mode 100644 index 87a399ea..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/Events/Login.php +++ /dev/null @@ -1,46 +0,0 @@ -user = $user; - $this->guard = $guard; - $this->remember = $remember; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/Events/Logout.php b/vendor/laravel/framework/src/Illuminate/Auth/Events/Logout.php deleted file mode 100644 index c47341dc..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/Events/Logout.php +++ /dev/null @@ -1,37 +0,0 @@ -user = $user; - $this->guard = $guard; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/Events/OtherDeviceLogout.php b/vendor/laravel/framework/src/Illuminate/Auth/Events/OtherDeviceLogout.php deleted file mode 100644 index ea139a7b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/Events/OtherDeviceLogout.php +++ /dev/null @@ -1,37 +0,0 @@ -user = $user; - $this->guard = $guard; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/Events/PasswordReset.php b/vendor/laravel/framework/src/Illuminate/Auth/Events/PasswordReset.php deleted file mode 100644 index f57b3c94..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/Events/PasswordReset.php +++ /dev/null @@ -1,28 +0,0 @@ -user = $user; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/Events/Registered.php b/vendor/laravel/framework/src/Illuminate/Auth/Events/Registered.php deleted file mode 100644 index f84058cf..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/Events/Registered.php +++ /dev/null @@ -1,28 +0,0 @@ -user = $user; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/Events/Validated.php b/vendor/laravel/framework/src/Illuminate/Auth/Events/Validated.php deleted file mode 100644 index ebc3b2ce..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/Events/Validated.php +++ /dev/null @@ -1,37 +0,0 @@ -user = $user; - $this->guard = $guard; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/Events/Verified.php b/vendor/laravel/framework/src/Illuminate/Auth/Events/Verified.php deleted file mode 100644 index 1d6e4c0f..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/Events/Verified.php +++ /dev/null @@ -1,28 +0,0 @@ -user = $user; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/GenericUser.php b/vendor/laravel/framework/src/Illuminate/Auth/GenericUser.php deleted file mode 100755 index c87bc238..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/GenericUser.php +++ /dev/null @@ -1,132 +0,0 @@ -attributes = $attributes; - } - - /** - * Get the name of the unique identifier for the user. - * - * @return string - */ - public function getAuthIdentifierName() - { - return 'id'; - } - - /** - * Get the unique identifier for the user. - * - * @return mixed - */ - public function getAuthIdentifier() - { - return $this->attributes[$this->getAuthIdentifierName()]; - } - - /** - * Get the password for the user. - * - * @return string - */ - public function getAuthPassword() - { - return $this->attributes['password']; - } - - /** - * Get the "remember me" token value. - * - * @return string - */ - public function getRememberToken() - { - return $this->attributes[$this->getRememberTokenName()]; - } - - /** - * Set the "remember me" token value. - * - * @param string $value - * @return void - */ - public function setRememberToken($value) - { - $this->attributes[$this->getRememberTokenName()] = $value; - } - - /** - * Get the column name for the "remember me" token. - * - * @return string - */ - public function getRememberTokenName() - { - return 'remember_token'; - } - - /** - * Dynamically access the user's attributes. - * - * @param string $key - * @return mixed - */ - public function __get($key) - { - return $this->attributes[$key]; - } - - /** - * Dynamically set an attribute on the user. - * - * @param string $key - * @param mixed $value - * @return void - */ - public function __set($key, $value) - { - $this->attributes[$key] = $value; - } - - /** - * Dynamically check if a value is set on the user. - * - * @param string $key - * @return bool - */ - public function __isset($key) - { - return isset($this->attributes[$key]); - } - - /** - * Dynamically unset a value on the user. - * - * @param string $key - * @return void - */ - public function __unset($key) - { - unset($this->attributes[$key]); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/GuardHelpers.php b/vendor/laravel/framework/src/Illuminate/Auth/GuardHelpers.php deleted file mode 100644 index ee98e8ac..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/GuardHelpers.php +++ /dev/null @@ -1,130 +0,0 @@ -user())) { - return $user; - } - - throw new AuthenticationException; - } - - /** - * Determine if the guard has a user instance. - * - * @return bool - */ - public function hasUser() - { - return ! is_null($this->user); - } - - /** - * Determine if the current user is authenticated. - * - * @return bool - */ - public function check() - { - return ! is_null($this->user()); - } - - /** - * Determine if the current user is a guest. - * - * @return bool - */ - public function guest() - { - return ! $this->check(); - } - - /** - * Get the ID for the currently authenticated user. - * - * @return int|string|null - */ - public function id() - { - if ($this->user()) { - return $this->user()->getAuthIdentifier(); - } - } - - /** - * Set the current user. - * - * @param \Illuminate\Contracts\Auth\Authenticatable $user - * @return $this - */ - public function setUser(AuthenticatableContract $user) - { - $this->user = $user; - - return $this; - } - - /** - * Forget the current user. - * - * @return $this - */ - public function forgetUser() - { - $this->user = null; - - return $this; - } - - /** - * Get the user provider used by the guard. - * - * @return \Illuminate\Contracts\Auth\UserProvider - */ - public function getProvider() - { - return $this->provider; - } - - /** - * Set the user provider used by the guard. - * - * @param \Illuminate\Contracts\Auth\UserProvider $provider - * @return void - */ - public function setProvider(UserProvider $provider) - { - $this->provider = $provider; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/LICENSE.md b/vendor/laravel/framework/src/Illuminate/Auth/LICENSE.md deleted file mode 100644 index 79810c84..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Taylor Otwell - -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/laravel/framework/src/Illuminate/Auth/Listeners/SendEmailVerificationNotification.php b/vendor/laravel/framework/src/Illuminate/Auth/Listeners/SendEmailVerificationNotification.php deleted file mode 100644 index 12dfa697..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/Listeners/SendEmailVerificationNotification.php +++ /dev/null @@ -1,22 +0,0 @@ -user instanceof MustVerifyEmail && ! $event->user->hasVerifiedEmail()) { - $event->user->sendEmailVerificationNotification(); - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php b/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php deleted file mode 100644 index 7eda342d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php +++ /dev/null @@ -1,97 +0,0 @@ -auth = $auth; - } - - /** - * Handle an incoming request. - * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @param string[] ...$guards - * @return mixed - * - * @throws \Illuminate\Auth\AuthenticationException - */ - public function handle($request, Closure $next, ...$guards) - { - $this->authenticate($request, $guards); - - return $next($request); - } - - /** - * Determine if the user is logged in to any of the given guards. - * - * @param \Illuminate\Http\Request $request - * @param array $guards - * @return void - * - * @throws \Illuminate\Auth\AuthenticationException - */ - protected function authenticate($request, array $guards) - { - if (empty($guards)) { - $guards = [null]; - } - - foreach ($guards as $guard) { - if ($this->auth->guard($guard)->check()) { - return $this->auth->shouldUse($guard); - } - } - - $this->unauthenticated($request, $guards); - } - - /** - * Handle an unauthenticated user. - * - * @param \Illuminate\Http\Request $request - * @param array $guards - * @return void - * - * @throws \Illuminate\Auth\AuthenticationException - */ - protected function unauthenticated($request, array $guards) - { - throw new AuthenticationException( - 'Unauthenticated.', $guards, $this->redirectTo($request) - ); - } - - /** - * Get the path the user should be redirected to when they are not authenticated. - * - * @param \Illuminate\Http\Request $request - * @return string|null - */ - protected function redirectTo($request) - { - // - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/Middleware/AuthenticateWithBasicAuth.php b/vendor/laravel/framework/src/Illuminate/Auth/Middleware/AuthenticateWithBasicAuth.php deleted file mode 100644 index 92c81e68..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/Middleware/AuthenticateWithBasicAuth.php +++ /dev/null @@ -1,45 +0,0 @@ -auth = $auth; - } - - /** - * Handle an incoming request. - * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @param string|null $guard - * @param string|null $field - * @return mixed - * - * @throws \Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException - */ - public function handle($request, Closure $next, $guard = null, $field = null) - { - $this->auth->guard($guard)->basic($field ?: 'email'); - - return $next($request); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authorize.php b/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authorize.php deleted file mode 100644 index 1af05beb..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authorize.php +++ /dev/null @@ -1,93 +0,0 @@ -gate = $gate; - } - - /** - * Handle an incoming request. - * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @param string $ability - * @param array|null ...$models - * @return mixed - * - * @throws \Illuminate\Auth\AuthenticationException - * @throws \Illuminate\Auth\Access\AuthorizationException - */ - public function handle($request, Closure $next, $ability, ...$models) - { - $this->gate->authorize($ability, $this->getGateArguments($request, $models)); - - return $next($request); - } - - /** - * Get the arguments parameter for the gate. - * - * @param \Illuminate\Http\Request $request - * @param array|null $models - * @return \Illuminate\Database\Eloquent\Model|array|string - */ - protected function getGateArguments($request, $models) - { - if (is_null($models)) { - return []; - } - - return collect($models)->map(function ($model) use ($request) { - return $model instanceof Model ? $model : $this->getModel($request, $model); - })->all(); - } - - /** - * Get the model to authorize. - * - * @param \Illuminate\Http\Request $request - * @param string $model - * @return \Illuminate\Database\Eloquent\Model|string - */ - protected function getModel($request, $model) - { - if ($this->isClassName($model)) { - return trim($model); - } else { - return $request->route($model, null) ?? - ((preg_match("/^['\"](.*)['\"]$/", trim($model), $matches)) ? $matches[1] : null); - } - } - - /** - * Checks if the given string looks like a fully qualified class name. - * - * @param string $value - * @return bool - */ - protected function isClassName($value) - { - return str_contains($value, '\\'); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/Middleware/EnsureEmailIsVerified.php b/vendor/laravel/framework/src/Illuminate/Auth/Middleware/EnsureEmailIsVerified.php deleted file mode 100644 index 8f2b33ae..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/Middleware/EnsureEmailIsVerified.php +++ /dev/null @@ -1,32 +0,0 @@ -user() || - ($request->user() instanceof MustVerifyEmail && - ! $request->user()->hasVerifiedEmail())) { - return $request->expectsJson() - ? abort(403, 'Your email address is not verified.') - : Redirect::guest(URL::route($redirectToRoute ?: 'verification.notice')); - } - - return $next($request); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/Middleware/RequirePassword.php b/vendor/laravel/framework/src/Illuminate/Auth/Middleware/RequirePassword.php deleted file mode 100644 index 4ed43954..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/Middleware/RequirePassword.php +++ /dev/null @@ -1,86 +0,0 @@ -responseFactory = $responseFactory; - $this->urlGenerator = $urlGenerator; - $this->passwordTimeout = $passwordTimeout ?: 10800; - } - - /** - * Handle an incoming request. - * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @param string|null $redirectToRoute - * @param int|null $passwordTimeoutSeconds - * @return mixed - */ - public function handle($request, Closure $next, $redirectToRoute = null, $passwordTimeoutSeconds = null) - { - if ($this->shouldConfirmPassword($request, $passwordTimeoutSeconds)) { - if ($request->expectsJson()) { - return $this->responseFactory->json([ - 'message' => 'Password confirmation required.', - ], 423); - } - - return $this->responseFactory->redirectGuest( - $this->urlGenerator->route($redirectToRoute ?? 'password.confirm') - ); - } - - return $next($request); - } - - /** - * Determine if the confirmation timeout has expired. - * - * @param \Illuminate\Http\Request $request - * @param int|null $passwordTimeoutSeconds - * @return bool - */ - protected function shouldConfirmPassword($request, $passwordTimeoutSeconds = null) - { - $confirmedAt = time() - $request->session()->get('auth.password_confirmed_at', 0); - - return $confirmedAt > ($passwordTimeoutSeconds ?? $this->passwordTimeout); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/MustVerifyEmail.php b/vendor/laravel/framework/src/Illuminate/Auth/MustVerifyEmail.php deleted file mode 100644 index 8e1ce33f..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/MustVerifyEmail.php +++ /dev/null @@ -1,50 +0,0 @@ -email_verified_at); - } - - /** - * Mark the given user's email as verified. - * - * @return bool - */ - public function markEmailAsVerified() - { - return $this->forceFill([ - 'email_verified_at' => $this->freshTimestamp(), - ])->save(); - } - - /** - * Send the email verification notification. - * - * @return void - */ - public function sendEmailVerificationNotification() - { - $this->notify(new VerifyEmail); - } - - /** - * Get the email address that should be used for verification. - * - * @return string - */ - public function getEmailForVerification() - { - return $this->email; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/Notifications/ResetPassword.php b/vendor/laravel/framework/src/Illuminate/Auth/Notifications/ResetPassword.php deleted file mode 100644 index 1d8da41b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/Notifications/ResetPassword.php +++ /dev/null @@ -1,124 +0,0 @@ -token = $token; - } - - /** - * Get the notification's channels. - * - * @param mixed $notifiable - * @return array|string - */ - public function via($notifiable) - { - return ['mail']; - } - - /** - * Build the mail representation of the notification. - * - * @param mixed $notifiable - * @return \Illuminate\Notifications\Messages\MailMessage - */ - public function toMail($notifiable) - { - if (static::$toMailCallback) { - return call_user_func(static::$toMailCallback, $notifiable, $this->token); - } - - return $this->buildMailMessage($this->resetUrl($notifiable)); - } - - /** - * Get the reset password notification mail message for the given URL. - * - * @param string $url - * @return \Illuminate\Notifications\Messages\MailMessage - */ - protected function buildMailMessage($url) - { - return (new MailMessage) - ->subject(Lang::get('Reset Password Notification')) - ->line(Lang::get('You are receiving this email because we received a password reset request for your account.')) - ->action(Lang::get('Reset Password'), $url) - ->line(Lang::get('This password reset link will expire in :count minutes.', ['count' => config('auth.passwords.'.config('auth.defaults.passwords').'.expire')])) - ->line(Lang::get('If you did not request a password reset, no further action is required.')); - } - - /** - * Get the reset URL for the given notifiable. - * - * @param mixed $notifiable - * @return string - */ - protected function resetUrl($notifiable) - { - if (static::$createUrlCallback) { - return call_user_func(static::$createUrlCallback, $notifiable, $this->token); - } - - return url(route('password.reset', [ - 'token' => $this->token, - 'email' => $notifiable->getEmailForPasswordReset(), - ], false)); - } - - /** - * Set a callback that should be used when creating the reset password button URL. - * - * @param \Closure(mixed, string): string $callback - * @return void - */ - public static function createUrlUsing($callback) - { - static::$createUrlCallback = $callback; - } - - /** - * Set a callback that should be used when building the notification mail message. - * - * @param \Closure(mixed, string): \Illuminate\Notifications\Messages\MailMessage $callback - * @return void - */ - public static function toMailUsing($callback) - { - static::$toMailCallback = $callback; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/Notifications/VerifyEmail.php b/vendor/laravel/framework/src/Illuminate/Auth/Notifications/VerifyEmail.php deleted file mode 100644 index 7a5cf916..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/Notifications/VerifyEmail.php +++ /dev/null @@ -1,114 +0,0 @@ -verificationUrl($notifiable); - - if (static::$toMailCallback) { - return call_user_func(static::$toMailCallback, $notifiable, $verificationUrl); - } - - return $this->buildMailMessage($verificationUrl); - } - - /** - * Get the verify email notification mail message for the given URL. - * - * @param string $url - * @return \Illuminate\Notifications\Messages\MailMessage - */ - protected function buildMailMessage($url) - { - return (new MailMessage) - ->subject(Lang::get('Verify Email Address')) - ->line(Lang::get('Please click the button below to verify your email address.')) - ->action(Lang::get('Verify Email Address'), $url) - ->line(Lang::get('If you did not create an account, no further action is required.')); - } - - /** - * Get the verification URL for the given notifiable. - * - * @param mixed $notifiable - * @return string - */ - protected function verificationUrl($notifiable) - { - if (static::$createUrlCallback) { - return call_user_func(static::$createUrlCallback, $notifiable); - } - - return URL::temporarySignedRoute( - 'verification.verify', - Carbon::now()->addMinutes(Config::get('auth.verification.expire', 60)), - [ - 'id' => $notifiable->getKey(), - 'hash' => sha1($notifiable->getEmailForVerification()), - ] - ); - } - - /** - * Set a callback that should be used when creating the email verification URL. - * - * @param \Closure $callback - * @return void - */ - public static function createUrlUsing($callback) - { - static::$createUrlCallback = $callback; - } - - /** - * Set a callback that should be used when building the notification mail message. - * - * @param \Closure $callback - * @return void - */ - public static function toMailUsing($callback) - { - static::$toMailCallback = $callback; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/Passwords/CanResetPassword.php b/vendor/laravel/framework/src/Illuminate/Auth/Passwords/CanResetPassword.php deleted file mode 100644 index 918a288f..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/Passwords/CanResetPassword.php +++ /dev/null @@ -1,29 +0,0 @@ -email; - } - - /** - * Send the password reset notification. - * - * @param string $token - * @return void - */ - public function sendPasswordResetNotification($token) - { - $this->notify(new ResetPasswordNotification($token)); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/Passwords/DatabaseTokenRepository.php b/vendor/laravel/framework/src/Illuminate/Auth/Passwords/DatabaseTokenRepository.php deleted file mode 100755 index fe5f54b7..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/Passwords/DatabaseTokenRepository.php +++ /dev/null @@ -1,246 +0,0 @@ -table = $table; - $this->hasher = $hasher; - $this->hashKey = $hashKey; - $this->expires = $expires * 60; - $this->connection = $connection; - $this->throttle = $throttle; - } - - /** - * Create a new token record. - * - * @param \Illuminate\Contracts\Auth\CanResetPassword $user - * @return string - */ - public function create(CanResetPasswordContract $user) - { - $email = $user->getEmailForPasswordReset(); - - $this->deleteExisting($user); - - // We will create a new, random token for the user so that we can e-mail them - // a safe link to the password reset form. Then we will insert a record in - // the database so that we can verify the token within the actual reset. - $token = $this->createNewToken(); - - $this->getTable()->insert($this->getPayload($email, $token)); - - return $token; - } - - /** - * Delete all existing reset tokens from the database. - * - * @param \Illuminate\Contracts\Auth\CanResetPassword $user - * @return int - */ - protected function deleteExisting(CanResetPasswordContract $user) - { - return $this->getTable()->where('email', $user->getEmailForPasswordReset())->delete(); - } - - /** - * Build the record payload for the table. - * - * @param string $email - * @param string $token - * @return array - */ - protected function getPayload($email, $token) - { - return ['email' => $email, 'token' => $this->hasher->make($token), 'created_at' => new Carbon]; - } - - /** - * Determine if a token record exists and is valid. - * - * @param \Illuminate\Contracts\Auth\CanResetPassword $user - * @param string $token - * @return bool - */ - public function exists(CanResetPasswordContract $user, $token) - { - $record = (array) $this->getTable()->where( - 'email', $user->getEmailForPasswordReset() - )->first(); - - return $record && - ! $this->tokenExpired($record['created_at']) && - $this->hasher->check($token, $record['token']); - } - - /** - * Determine if the token has expired. - * - * @param string $createdAt - * @return bool - */ - protected function tokenExpired($createdAt) - { - return Carbon::parse($createdAt)->addSeconds($this->expires)->isPast(); - } - - /** - * Determine if the given user recently created a password reset token. - * - * @param \Illuminate\Contracts\Auth\CanResetPassword $user - * @return bool - */ - public function recentlyCreatedToken(CanResetPasswordContract $user) - { - $record = (array) $this->getTable()->where( - 'email', $user->getEmailForPasswordReset() - )->first(); - - return $record && $this->tokenRecentlyCreated($record['created_at']); - } - - /** - * Determine if the token was recently created. - * - * @param string $createdAt - * @return bool - */ - protected function tokenRecentlyCreated($createdAt) - { - if ($this->throttle <= 0) { - return false; - } - - return Carbon::parse($createdAt)->addSeconds( - $this->throttle - )->isFuture(); - } - - /** - * Delete a token record by user. - * - * @param \Illuminate\Contracts\Auth\CanResetPassword $user - * @return void - */ - public function delete(CanResetPasswordContract $user) - { - $this->deleteExisting($user); - } - - /** - * Delete expired tokens. - * - * @return void - */ - public function deleteExpired() - { - $expiredAt = Carbon::now()->subSeconds($this->expires); - - $this->getTable()->where('created_at', '<', $expiredAt)->delete(); - } - - /** - * Create a new token for the user. - * - * @return string - */ - public function createNewToken() - { - return hash_hmac('sha256', Str::random(40), $this->hashKey); - } - - /** - * Get the database connection instance. - * - * @return \Illuminate\Database\ConnectionInterface - */ - public function getConnection() - { - return $this->connection; - } - - /** - * Begin a new database query against the table. - * - * @return \Illuminate\Database\Query\Builder - */ - protected function getTable() - { - return $this->connection->table($this->table); - } - - /** - * Get the hasher instance. - * - * @return \Illuminate\Contracts\Hashing\Hasher - */ - public function getHasher() - { - return $this->hasher; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/Passwords/PasswordBroker.php b/vendor/laravel/framework/src/Illuminate/Auth/Passwords/PasswordBroker.php deleted file mode 100755 index cbbc897a..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/Passwords/PasswordBroker.php +++ /dev/null @@ -1,190 +0,0 @@ -users = $users; - $this->tokens = $tokens; - } - - /** - * Send a password reset link to a user. - * - * @param array $credentials - * @param \Closure|null $callback - * @return string - */ - public function sendResetLink(array $credentials, Closure $callback = null) - { - // First we will check to see if we found a user at the given credentials and - // if we did not we will redirect back to this current URI with a piece of - // "flash" data in the session to indicate to the developers the errors. - $user = $this->getUser($credentials); - - if (is_null($user)) { - return static::INVALID_USER; - } - - if ($this->tokens->recentlyCreatedToken($user)) { - return static::RESET_THROTTLED; - } - - $token = $this->tokens->create($user); - - if ($callback) { - $callback($user, $token); - } else { - // Once we have the reset token, we are ready to send the message out to this - // user with a link to reset their password. We will then redirect back to - // the current URI having nothing set in the session to indicate errors. - $user->sendPasswordResetNotification($token); - } - - return static::RESET_LINK_SENT; - } - - /** - * Reset the password for the given token. - * - * @param array $credentials - * @param \Closure $callback - * @return mixed - */ - public function reset(array $credentials, Closure $callback) - { - $user = $this->validateReset($credentials); - - // If the responses from the validate method is not a user instance, we will - // assume that it is a redirect and simply return it from this method and - // the user is properly redirected having an error message on the post. - if (! $user instanceof CanResetPasswordContract) { - return $user; - } - - $password = $credentials['password']; - - // Once the reset has been validated, we'll call the given callback with the - // new password. This gives the user an opportunity to store the password - // in their persistent storage. Then we'll delete the token and return. - $callback($user, $password); - - $this->tokens->delete($user); - - return static::PASSWORD_RESET; - } - - /** - * Validate a password reset for the given credentials. - * - * @param array $credentials - * @return \Illuminate\Contracts\Auth\CanResetPassword|string - */ - protected function validateReset(array $credentials) - { - if (is_null($user = $this->getUser($credentials))) { - return static::INVALID_USER; - } - - if (! $this->tokens->exists($user, $credentials['token'])) { - return static::INVALID_TOKEN; - } - - return $user; - } - - /** - * Get the user for the given credentials. - * - * @param array $credentials - * @return \Illuminate\Contracts\Auth\CanResetPassword|null - * - * @throws \UnexpectedValueException - */ - public function getUser(array $credentials) - { - $credentials = Arr::except($credentials, ['token']); - - $user = $this->users->retrieveByCredentials($credentials); - - if ($user && ! $user instanceof CanResetPasswordContract) { - throw new UnexpectedValueException('User must implement CanResetPassword interface.'); - } - - return $user; - } - - /** - * Create a new password reset token for the given user. - * - * @param \Illuminate\Contracts\Auth\CanResetPassword $user - * @return string - */ - public function createToken(CanResetPasswordContract $user) - { - return $this->tokens->create($user); - } - - /** - * Delete password reset tokens of the given user. - * - * @param \Illuminate\Contracts\Auth\CanResetPassword $user - * @return void - */ - public function deleteToken(CanResetPasswordContract $user) - { - $this->tokens->delete($user); - } - - /** - * Validate the given password reset token. - * - * @param \Illuminate\Contracts\Auth\CanResetPassword $user - * @param string $token - * @return bool - */ - public function tokenExists(CanResetPasswordContract $user, $token) - { - return $this->tokens->exists($user, $token); - } - - /** - * Get the password reset token repository implementation. - * - * @return \Illuminate\Auth\Passwords\TokenRepositoryInterface - */ - public function getRepository() - { - return $this->tokens; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/Passwords/PasswordBrokerManager.php b/vendor/laravel/framework/src/Illuminate/Auth/Passwords/PasswordBrokerManager.php deleted file mode 100644 index 01cffe8e..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/Passwords/PasswordBrokerManager.php +++ /dev/null @@ -1,145 +0,0 @@ -app = $app; - } - - /** - * Attempt to get the broker from the local cache. - * - * @param string|null $name - * @return \Illuminate\Contracts\Auth\PasswordBroker - */ - public function broker($name = null) - { - $name = $name ?: $this->getDefaultDriver(); - - return $this->brokers[$name] ?? ($this->brokers[$name] = $this->resolve($name)); - } - - /** - * Resolve the given broker. - * - * @param string $name - * @return \Illuminate\Contracts\Auth\PasswordBroker - * - * @throws \InvalidArgumentException - */ - protected function resolve($name) - { - $config = $this->getConfig($name); - - if (is_null($config)) { - throw new InvalidArgumentException("Password resetter [{$name}] is not defined."); - } - - // The password broker uses a token repository to validate tokens and send user - // password e-mails, as well as validating that password reset process as an - // aggregate service of sorts providing a convenient interface for resets. - return new PasswordBroker( - $this->createTokenRepository($config), - $this->app['auth']->createUserProvider($config['provider'] ?? null) - ); - } - - /** - * Create a token repository instance based on the given configuration. - * - * @param array $config - * @return \Illuminate\Auth\Passwords\TokenRepositoryInterface - */ - protected function createTokenRepository(array $config) - { - $key = $this->app['config']['app.key']; - - if (str_starts_with($key, 'base64:')) { - $key = base64_decode(substr($key, 7)); - } - - $connection = $config['connection'] ?? null; - - return new DatabaseTokenRepository( - $this->app['db']->connection($connection), - $this->app['hash'], - $config['table'], - $key, - $config['expire'], - $config['throttle'] ?? 0 - ); - } - - /** - * Get the password broker configuration. - * - * @param string $name - * @return array - */ - protected function getConfig($name) - { - return $this->app['config']["auth.passwords.{$name}"]; - } - - /** - * Get the default password broker name. - * - * @return string - */ - public function getDefaultDriver() - { - return $this->app['config']['auth.defaults.passwords']; - } - - /** - * Set the default password broker name. - * - * @param string $name - * @return void - */ - public function setDefaultDriver($name) - { - $this->app['config']['auth.defaults.passwords'] = $name; - } - - /** - * Dynamically call the default driver instance. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - return $this->broker()->{$method}(...$parameters); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/Passwords/PasswordResetServiceProvider.php b/vendor/laravel/framework/src/Illuminate/Auth/Passwords/PasswordResetServiceProvider.php deleted file mode 100755 index a26b7e6e..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/Passwords/PasswordResetServiceProvider.php +++ /dev/null @@ -1,45 +0,0 @@ -registerPasswordBroker(); - } - - /** - * Register the password broker instance. - * - * @return void - */ - protected function registerPasswordBroker() - { - $this->app->singleton('auth.password', function ($app) { - return new PasswordBrokerManager($app); - }); - - $this->app->bind('auth.password.broker', function ($app) { - return $app->make('auth.password')->broker(); - }); - } - - /** - * Get the services provided by the provider. - * - * @return array - */ - public function provides() - { - return ['auth.password', 'auth.password.broker']; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/Passwords/TokenRepositoryInterface.php b/vendor/laravel/framework/src/Illuminate/Auth/Passwords/TokenRepositoryInterface.php deleted file mode 100755 index 47c17581..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/Passwords/TokenRepositoryInterface.php +++ /dev/null @@ -1,48 +0,0 @@ -recaller = @unserialize($recaller, ['allowed_classes' => false]) ?: $recaller; - } - - /** - * Get the user ID from the recaller. - * - * @return string - */ - public function id() - { - return explode('|', $this->recaller, 3)[0]; - } - - /** - * Get the "remember token" token from the recaller. - * - * @return string - */ - public function token() - { - return explode('|', $this->recaller, 3)[1]; - } - - /** - * Get the password from the recaller. - * - * @return string - */ - public function hash() - { - return explode('|', $this->recaller, 4)[2]; - } - - /** - * Determine if the recaller is valid. - * - * @return bool - */ - public function valid() - { - return $this->properString() && $this->hasAllSegments(); - } - - /** - * Determine if the recaller is an invalid string. - * - * @return bool - */ - protected function properString() - { - return is_string($this->recaller) && str_contains($this->recaller, '|'); - } - - /** - * Determine if the recaller has all segments. - * - * @return bool - */ - protected function hasAllSegments() - { - $segments = explode('|', $this->recaller); - - return count($segments) >= 3 && trim($segments[0]) !== '' && trim($segments[1]) !== ''; - } - - /** - * Get the recaller's segments. - * - * @return array - */ - public function segments() - { - return explode('|', $this->recaller); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/RequestGuard.php b/vendor/laravel/framework/src/Illuminate/Auth/RequestGuard.php deleted file mode 100644 index d0af83cb..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/RequestGuard.php +++ /dev/null @@ -1,87 +0,0 @@ -request = $request; - $this->callback = $callback; - $this->provider = $provider; - } - - /** - * Get the currently authenticated user. - * - * @return \Illuminate\Contracts\Auth\Authenticatable|null - */ - public function user() - { - // If we've already retrieved the user for the current request we can just - // return it back immediately. We do not want to fetch the user data on - // every call to this method because that would be tremendously slow. - if (! is_null($this->user)) { - return $this->user; - } - - return $this->user = call_user_func( - $this->callback, $this->request, $this->getProvider() - ); - } - - /** - * Validate a user's credentials. - * - * @param array $credentials - * @return bool - */ - public function validate(array $credentials = []) - { - return ! is_null((new static( - $this->callback, $credentials['request'], $this->getProvider() - ))->user()); - } - - /** - * Set the current request instance. - * - * @param \Illuminate\Http\Request $request - * @return $this - */ - public function setRequest(Request $request) - { - $this->request = $request; - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/SessionGuard.php b/vendor/laravel/framework/src/Illuminate/Auth/SessionGuard.php deleted file mode 100644 index 8b799217..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/SessionGuard.php +++ /dev/null @@ -1,962 +0,0 @@ -name = $name; - $this->session = $session; - $this->request = $request; - $this->provider = $provider; - $this->timebox = $timebox ?: new Timebox; - } - - /** - * Get the currently authenticated user. - * - * @return \Illuminate\Contracts\Auth\Authenticatable|null - */ - public function user() - { - if ($this->loggedOut) { - return; - } - - // If we've already retrieved the user for the current request we can just - // return it back immediately. We do not want to fetch the user data on - // every call to this method because that would be tremendously slow. - if (! is_null($this->user)) { - return $this->user; - } - - $id = $this->session->get($this->getName()); - - // First we will try to load the user using the identifier in the session if - // one exists. Otherwise we will check for a "remember me" cookie in this - // request, and if one exists, attempt to retrieve the user using that. - if (! is_null($id) && $this->user = $this->provider->retrieveById($id)) { - $this->fireAuthenticatedEvent($this->user); - } - - // If the user is null, but we decrypt a "recaller" cookie we can attempt to - // pull the user data on that cookie which serves as a remember cookie on - // the application. Once we have a user we can return it to the caller. - if (is_null($this->user) && ! is_null($recaller = $this->recaller())) { - $this->user = $this->userFromRecaller($recaller); - - if ($this->user) { - $this->updateSession($this->user->getAuthIdentifier()); - - $this->fireLoginEvent($this->user, true); - } - } - - return $this->user; - } - - /** - * Pull a user from the repository by its "remember me" cookie token. - * - * @param \Illuminate\Auth\Recaller $recaller - * @return mixed - */ - protected function userFromRecaller($recaller) - { - if (! $recaller->valid() || $this->recallAttempted) { - return; - } - - // If the user is null, but we decrypt a "recaller" cookie we can attempt to - // pull the user data on that cookie which serves as a remember cookie on - // the application. Once we have a user we can return it to the caller. - $this->recallAttempted = true; - - $this->viaRemember = ! is_null($user = $this->provider->retrieveByToken( - $recaller->id(), $recaller->token() - )); - - return $user; - } - - /** - * Get the decrypted recaller cookie for the request. - * - * @return \Illuminate\Auth\Recaller|null - */ - protected function recaller() - { - if (is_null($this->request)) { - return; - } - - if ($recaller = $this->request->cookies->get($this->getRecallerName())) { - return new Recaller($recaller); - } - } - - /** - * Get the ID for the currently authenticated user. - * - * @return int|string|null - */ - public function id() - { - if ($this->loggedOut) { - return; - } - - return $this->user() - ? $this->user()->getAuthIdentifier() - : $this->session->get($this->getName()); - } - - /** - * Log a user into the application without sessions or cookies. - * - * @param array $credentials - * @return bool - */ - public function once(array $credentials = []) - { - $this->fireAttemptEvent($credentials); - - if ($this->validate($credentials)) { - $this->setUser($this->lastAttempted); - - return true; - } - - return false; - } - - /** - * Log the given user ID into the application without sessions or cookies. - * - * @param mixed $id - * @return \Illuminate\Contracts\Auth\Authenticatable|false - */ - public function onceUsingId($id) - { - if (! is_null($user = $this->provider->retrieveById($id))) { - $this->setUser($user); - - return $user; - } - - return false; - } - - /** - * Validate a user's credentials. - * - * @param array $credentials - * @return bool - */ - public function validate(array $credentials = []) - { - $this->lastAttempted = $user = $this->provider->retrieveByCredentials($credentials); - - return $this->hasValidCredentials($user, $credentials); - } - - /** - * Attempt to authenticate using HTTP Basic Auth. - * - * @param string $field - * @param array $extraConditions - * @return \Symfony\Component\HttpFoundation\Response|null - * - * @throws \Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException - */ - public function basic($field = 'email', $extraConditions = []) - { - if ($this->check()) { - return; - } - - // If a username is set on the HTTP basic request, we will return out without - // interrupting the request lifecycle. Otherwise, we'll need to generate a - // request indicating that the given credentials were invalid for login. - if ($this->attemptBasic($this->getRequest(), $field, $extraConditions)) { - return; - } - - return $this->failedBasicResponse(); - } - - /** - * Perform a stateless HTTP Basic login attempt. - * - * @param string $field - * @param array $extraConditions - * @return \Symfony\Component\HttpFoundation\Response|null - * - * @throws \Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException - */ - public function onceBasic($field = 'email', $extraConditions = []) - { - $credentials = $this->basicCredentials($this->getRequest(), $field); - - if (! $this->once(array_merge($credentials, $extraConditions))) { - return $this->failedBasicResponse(); - } - } - - /** - * Attempt to authenticate using basic authentication. - * - * @param \Symfony\Component\HttpFoundation\Request $request - * @param string $field - * @param array $extraConditions - * @return bool - */ - protected function attemptBasic(Request $request, $field, $extraConditions = []) - { - if (! $request->getUser()) { - return false; - } - - return $this->attempt(array_merge( - $this->basicCredentials($request, $field), $extraConditions - )); - } - - /** - * Get the credential array for an HTTP Basic request. - * - * @param \Symfony\Component\HttpFoundation\Request $request - * @param string $field - * @return array - */ - protected function basicCredentials(Request $request, $field) - { - return [$field => $request->getUser(), 'password' => $request->getPassword()]; - } - - /** - * Get the response for basic authentication. - * - * @return void - * - * @throws \Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException - */ - protected function failedBasicResponse() - { - throw new UnauthorizedHttpException('Basic', 'Invalid credentials.'); - } - - /** - * Attempt to authenticate a user using the given credentials. - * - * @param array $credentials - * @param bool $remember - * @return bool - */ - public function attempt(array $credentials = [], $remember = false) - { - $this->fireAttemptEvent($credentials, $remember); - - $this->lastAttempted = $user = $this->provider->retrieveByCredentials($credentials); - - // If an implementation of UserInterface was returned, we'll ask the provider - // to validate the user against the given credentials, and if they are in - // fact valid we'll log the users into the application and return true. - if ($this->hasValidCredentials($user, $credentials)) { - $this->login($user, $remember); - - return true; - } - - // If the authentication attempt fails we will fire an event so that the user - // may be notified of any suspicious attempts to access their account from - // an unrecognized user. A developer may listen to this event as needed. - $this->fireFailedEvent($user, $credentials); - - return false; - } - - /** - * Attempt to authenticate a user with credentials and additional callbacks. - * - * @param array $credentials - * @param array|callable|null $callbacks - * @param bool $remember - * @return bool - */ - public function attemptWhen(array $credentials = [], $callbacks = null, $remember = false) - { - $this->fireAttemptEvent($credentials, $remember); - - $this->lastAttempted = $user = $this->provider->retrieveByCredentials($credentials); - - // This method does the exact same thing as attempt, but also executes callbacks after - // the user is retrieved and validated. If one of the callbacks returns falsy we do - // not login the user. Instead, we will fail the specific authentication attempt. - if ($this->hasValidCredentials($user, $credentials) && $this->shouldLogin($callbacks, $user)) { - $this->login($user, $remember); - - return true; - } - - $this->fireFailedEvent($user, $credentials); - - return false; - } - - /** - * Determine if the user matches the credentials. - * - * @param mixed $user - * @param array $credentials - * @return bool - */ - protected function hasValidCredentials($user, $credentials) - { - return $this->timebox->call(function ($timebox) use ($user, $credentials) { - $validated = ! is_null($user) && $this->provider->validateCredentials($user, $credentials); - - if ($validated) { - $timebox->returnEarly(); - - $this->fireValidatedEvent($user); - } - - return $validated; - }, 200 * 1000); - } - - /** - * Determine if the user should login by executing the given callbacks. - * - * @param array|callable|null $callbacks - * @param \Illuminate\Contracts\Auth\Authenticatable $user - * @return bool - */ - protected function shouldLogin($callbacks, AuthenticatableContract $user) - { - foreach (Arr::wrap($callbacks) as $callback) { - if (! $callback($user, $this)) { - return false; - } - } - - return true; - } - - /** - * Log the given user ID into the application. - * - * @param mixed $id - * @param bool $remember - * @return \Illuminate\Contracts\Auth\Authenticatable|false - */ - public function loginUsingId($id, $remember = false) - { - if (! is_null($user = $this->provider->retrieveById($id))) { - $this->login($user, $remember); - - return $user; - } - - return false; - } - - /** - * Log a user into the application. - * - * @param \Illuminate\Contracts\Auth\Authenticatable $user - * @param bool $remember - * @return void - */ - public function login(AuthenticatableContract $user, $remember = false) - { - $this->updateSession($user->getAuthIdentifier()); - - // If the user should be permanently "remembered" by the application we will - // queue a permanent cookie that contains the encrypted copy of the user - // identifier. We will then decrypt this later to retrieve the users. - if ($remember) { - $this->ensureRememberTokenIsSet($user); - - $this->queueRecallerCookie($user); - } - - // If we have an event dispatcher instance set we will fire an event so that - // any listeners will hook into the authentication events and run actions - // based on the login and logout events fired from the guard instances. - $this->fireLoginEvent($user, $remember); - - $this->setUser($user); - } - - /** - * Update the session with the given ID. - * - * @param string $id - * @return void - */ - protected function updateSession($id) - { - $this->session->put($this->getName(), $id); - - $this->session->migrate(true); - } - - /** - * Create a new "remember me" token for the user if one doesn't already exist. - * - * @param \Illuminate\Contracts\Auth\Authenticatable $user - * @return void - */ - protected function ensureRememberTokenIsSet(AuthenticatableContract $user) - { - if (empty($user->getRememberToken())) { - $this->cycleRememberToken($user); - } - } - - /** - * Queue the recaller cookie into the cookie jar. - * - * @param \Illuminate\Contracts\Auth\Authenticatable $user - * @return void - */ - protected function queueRecallerCookie(AuthenticatableContract $user) - { - $this->getCookieJar()->queue($this->createRecaller( - $user->getAuthIdentifier().'|'.$user->getRememberToken().'|'.$user->getAuthPassword() - )); - } - - /** - * Create a "remember me" cookie for a given ID. - * - * @param string $value - * @return \Symfony\Component\HttpFoundation\Cookie - */ - protected function createRecaller($value) - { - return $this->getCookieJar()->make($this->getRecallerName(), $value, $this->getRememberDuration()); - } - - /** - * Log the user out of the application. - * - * @return void - */ - public function logout() - { - $user = $this->user(); - - $this->clearUserDataFromStorage(); - - if (! is_null($this->user) && ! empty($user->getRememberToken())) { - $this->cycleRememberToken($user); - } - - // If we have an event dispatcher instance, we can fire off the logout event - // so any further processing can be done. This allows the developer to be - // listening for anytime a user signs out of this application manually. - if (isset($this->events)) { - $this->events->dispatch(new Logout($this->name, $user)); - } - - // Once we have fired the logout event we will clear the users out of memory - // so they are no longer available as the user is no longer considered as - // being signed into this application and should not be available here. - $this->user = null; - - $this->loggedOut = true; - } - - /** - * Log the user out of the application on their current device only. - * - * This method does not cycle the "remember" token. - * - * @return void - */ - public function logoutCurrentDevice() - { - $user = $this->user(); - - $this->clearUserDataFromStorage(); - - // If we have an event dispatcher instance, we can fire off the logout event - // so any further processing can be done. This allows the developer to be - // listening for anytime a user signs out of this application manually. - if (isset($this->events)) { - $this->events->dispatch(new CurrentDeviceLogout($this->name, $user)); - } - - // Once we have fired the logout event we will clear the users out of memory - // so they are no longer available as the user is no longer considered as - // being signed into this application and should not be available here. - $this->user = null; - - $this->loggedOut = true; - } - - /** - * Remove the user data from the session and cookies. - * - * @return void - */ - protected function clearUserDataFromStorage() - { - $this->session->remove($this->getName()); - - $this->getCookieJar()->unqueue($this->getRecallerName()); - - if (! is_null($this->recaller())) { - $this->getCookieJar()->queue( - $this->getCookieJar()->forget($this->getRecallerName()) - ); - } - } - - /** - * Refresh the "remember me" token for the user. - * - * @param \Illuminate\Contracts\Auth\Authenticatable $user - * @return void - */ - protected function cycleRememberToken(AuthenticatableContract $user) - { - $user->setRememberToken($token = Str::random(60)); - - $this->provider->updateRememberToken($user, $token); - } - - /** - * Invalidate other sessions for the current user. - * - * The application must be using the AuthenticateSession middleware. - * - * @param string $password - * @param string $attribute - * @return \Illuminate\Contracts\Auth\Authenticatable|null - * - * @throws \Illuminate\Auth\AuthenticationException - */ - public function logoutOtherDevices($password, $attribute = 'password') - { - if (! $this->user()) { - return; - } - - $result = $this->rehashUserPassword($password, $attribute); - - if ($this->recaller() || - $this->getCookieJar()->hasQueued($this->getRecallerName())) { - $this->queueRecallerCookie($this->user()); - } - - $this->fireOtherDeviceLogoutEvent($this->user()); - - return $result; - } - - /** - * Rehash the current user's password. - * - * @param string $password - * @param string $attribute - * @return \Illuminate\Contracts\Auth\Authenticatable|null - * - * @throws \InvalidArgumentException - */ - protected function rehashUserPassword($password, $attribute) - { - if (! Hash::check($password, $this->user()->{$attribute})) { - throw new InvalidArgumentException('The given password does not match the current password.'); - } - - return tap($this->user()->forceFill([ - $attribute => Hash::make($password), - ]))->save(); - } - - /** - * Register an authentication attempt event listener. - * - * @param mixed $callback - * @return void - */ - public function attempting($callback) - { - $this->events?->listen(Events\Attempting::class, $callback); - } - - /** - * Fire the attempt event with the arguments. - * - * @param array $credentials - * @param bool $remember - * @return void - */ - protected function fireAttemptEvent(array $credentials, $remember = false) - { - $this->events?->dispatch(new Attempting($this->name, $credentials, $remember)); - } - - /** - * Fires the validated event if the dispatcher is set. - * - * @param \Illuminate\Contracts\Auth\Authenticatable $user - * @return void - */ - protected function fireValidatedEvent($user) - { - $this->events?->dispatch(new Validated($this->name, $user)); - } - - /** - * Fire the login event if the dispatcher is set. - * - * @param \Illuminate\Contracts\Auth\Authenticatable $user - * @param bool $remember - * @return void - */ - protected function fireLoginEvent($user, $remember = false) - { - $this->events?->dispatch(new Login($this->name, $user, $remember)); - } - - /** - * Fire the authenticated event if the dispatcher is set. - * - * @param \Illuminate\Contracts\Auth\Authenticatable $user - * @return void - */ - protected function fireAuthenticatedEvent($user) - { - $this->events?->dispatch(new Authenticated($this->name, $user)); - } - - /** - * Fire the other device logout event if the dispatcher is set. - * - * @param \Illuminate\Contracts\Auth\Authenticatable $user - * @return void - */ - protected function fireOtherDeviceLogoutEvent($user) - { - $this->events?->dispatch(new OtherDeviceLogout($this->name, $user)); - } - - /** - * Fire the failed authentication attempt event with the given arguments. - * - * @param \Illuminate\Contracts\Auth\Authenticatable|null $user - * @param array $credentials - * @return void - */ - protected function fireFailedEvent($user, array $credentials) - { - $this->events?->dispatch(new Failed($this->name, $user, $credentials)); - } - - /** - * Get the last user we attempted to authenticate. - * - * @return \Illuminate\Contracts\Auth\Authenticatable - */ - public function getLastAttempted() - { - return $this->lastAttempted; - } - - /** - * Get a unique identifier for the auth session value. - * - * @return string - */ - public function getName() - { - return 'login_'.$this->name.'_'.sha1(static::class); - } - - /** - * Get the name of the cookie used to store the "recaller". - * - * @return string - */ - public function getRecallerName() - { - return 'remember_'.$this->name.'_'.sha1(static::class); - } - - /** - * Determine if the user was authenticated via "remember me" cookie. - * - * @return bool - */ - public function viaRemember() - { - return $this->viaRemember; - } - - /** - * Get the number of minutes the remember me cookie should be valid for. - * - * @return int - */ - protected function getRememberDuration() - { - return $this->rememberDuration; - } - - /** - * Set the number of minutes the remember me cookie should be valid for. - * - * @param int $minutes - * @return $this - */ - public function setRememberDuration($minutes) - { - $this->rememberDuration = $minutes; - - return $this; - } - - /** - * Get the cookie creator instance used by the guard. - * - * @return \Illuminate\Contracts\Cookie\QueueingFactory - * - * @throws \RuntimeException - */ - public function getCookieJar() - { - if (! isset($this->cookie)) { - throw new RuntimeException('Cookie jar has not been set.'); - } - - return $this->cookie; - } - - /** - * Set the cookie creator instance used by the guard. - * - * @param \Illuminate\Contracts\Cookie\QueueingFactory $cookie - * @return void - */ - public function setCookieJar(CookieJar $cookie) - { - $this->cookie = $cookie; - } - - /** - * Get the event dispatcher instance. - * - * @return \Illuminate\Contracts\Events\Dispatcher - */ - public function getDispatcher() - { - return $this->events; - } - - /** - * Set the event dispatcher instance. - * - * @param \Illuminate\Contracts\Events\Dispatcher $events - * @return void - */ - public function setDispatcher(Dispatcher $events) - { - $this->events = $events; - } - - /** - * Get the session store used by the guard. - * - * @return \Illuminate\Contracts\Session\Session - */ - public function getSession() - { - return $this->session; - } - - /** - * Return the currently cached user. - * - * @return \Illuminate\Contracts\Auth\Authenticatable|null - */ - public function getUser() - { - return $this->user; - } - - /** - * Set the current user. - * - * @param \Illuminate\Contracts\Auth\Authenticatable $user - * @return $this - */ - public function setUser(AuthenticatableContract $user) - { - $this->user = $user; - - $this->loggedOut = false; - - $this->fireAuthenticatedEvent($user); - - return $this; - } - - /** - * Get the current request instance. - * - * @return \Symfony\Component\HttpFoundation\Request - */ - public function getRequest() - { - return $this->request ?: Request::createFromGlobals(); - } - - /** - * Set the current request instance. - * - * @param \Symfony\Component\HttpFoundation\Request $request - * @return $this - */ - public function setRequest(Request $request) - { - $this->request = $request; - - return $this; - } - - /** - * Get the timebox instance used by the guard. - * - * @return \Illuminate\Support\Timebox - */ - public function getTimebox() - { - return $this->timebox; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/TokenGuard.php b/vendor/laravel/framework/src/Illuminate/Auth/TokenGuard.php deleted file mode 100644 index b1aa7a7e..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/TokenGuard.php +++ /dev/null @@ -1,149 +0,0 @@ -hash = $hash; - $this->request = $request; - $this->provider = $provider; - $this->inputKey = $inputKey; - $this->storageKey = $storageKey; - } - - /** - * Get the currently authenticated user. - * - * @return \Illuminate\Contracts\Auth\Authenticatable|null - */ - public function user() - { - // If we've already retrieved the user for the current request we can just - // return it back immediately. We do not want to fetch the user data on - // every call to this method because that would be tremendously slow. - if (! is_null($this->user)) { - return $this->user; - } - - $user = null; - - $token = $this->getTokenForRequest(); - - if (! empty($token)) { - $user = $this->provider->retrieveByCredentials([ - $this->storageKey => $this->hash ? hash('sha256', $token) : $token, - ]); - } - - return $this->user = $user; - } - - /** - * Get the token for the current request. - * - * @return string - */ - public function getTokenForRequest() - { - $token = $this->request->query($this->inputKey); - - if (empty($token)) { - $token = $this->request->input($this->inputKey); - } - - if (empty($token)) { - $token = $this->request->bearerToken(); - } - - if (empty($token)) { - $token = $this->request->getPassword(); - } - - return $token; - } - - /** - * Validate a user's credentials. - * - * @param array $credentials - * @return bool - */ - public function validate(array $credentials = []) - { - if (empty($credentials[$this->inputKey])) { - return false; - } - - $credentials = [$this->storageKey => $credentials[$this->inputKey]]; - - if ($this->provider->retrieveByCredentials($credentials)) { - return true; - } - - return false; - } - - /** - * Set the current request instance. - * - * @param \Illuminate\Http\Request $request - * @return $this - */ - public function setRequest(Request $request) - { - $this->request = $request; - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Auth/composer.json b/vendor/laravel/framework/src/Illuminate/Auth/composer.json deleted file mode 100644 index ae928a33..00000000 --- a/vendor/laravel/framework/src/Illuminate/Auth/composer.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "illuminate/auth", - "description": "The Illuminate Auth package.", - "license": "MIT", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "require": { - "php": "^8.0.2", - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/http": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/queue": "^9.0", - "illuminate/support": "^9.0" - }, - "autoload": { - "psr-4": { - "Illuminate\\Auth\\": "" - } - }, - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "suggest": { - "illuminate/console": "Required to use the auth:clear-resets command (^9.0).", - "illuminate/queue": "Required to fire login / logout events (^9.0).", - "illuminate/session": "Required to use the session based guard (^9.0)." - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev" -} diff --git a/vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastController.php b/vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastController.php deleted file mode 100644 index 69274b7c..00000000 --- a/vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastController.php +++ /dev/null @@ -1,44 +0,0 @@ -hasSession()) { - $request->session()->reflash(); - } - - return Broadcast::auth($request); - } - - /** - * Authenticate the current user. - * - * See: https://pusher.com/docs/channels/server_api/authenticating-users/#user-authentication. - * - * @param \Illuminate\Http\Request $request - * @return \Illuminate\Http\Response - */ - public function authenticateUser(Request $request) - { - if ($request->hasSession()) { - $request->session()->reflash(); - } - - return Broadcast::resolveAuthenticatedUser($request) - ?? throw new AccessDeniedHttpException; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastEvent.php b/vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastEvent.php deleted file mode 100644 index fef5423d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastEvent.php +++ /dev/null @@ -1,148 +0,0 @@ -event = $event; - $this->tries = property_exists($event, 'tries') ? $event->tries : null; - $this->timeout = property_exists($event, 'timeout') ? $event->timeout : null; - $this->backoff = property_exists($event, 'backoff') ? $event->backoff : null; - $this->afterCommit = property_exists($event, 'afterCommit') ? $event->afterCommit : null; - } - - /** - * Handle the queued job. - * - * @param \Illuminate\Contracts\Broadcasting\Factory $manager - * @return void - */ - public function handle(BroadcastingFactory $manager) - { - $name = method_exists($this->event, 'broadcastAs') - ? $this->event->broadcastAs() : get_class($this->event); - - $channels = Arr::wrap($this->event->broadcastOn()); - - if (empty($channels)) { - return; - } - - $connections = method_exists($this->event, 'broadcastConnections') - ? $this->event->broadcastConnections() - : [null]; - - $payload = $this->getPayloadFromEvent($this->event); - - foreach ($connections as $connection) { - $manager->connection($connection)->broadcast( - $channels, $name, $payload - ); - } - } - - /** - * Get the payload for the given event. - * - * @param mixed $event - * @return array - */ - protected function getPayloadFromEvent($event) - { - if (method_exists($event, 'broadcastWith') && - ! is_null($payload = $event->broadcastWith())) { - return array_merge($payload, ['socket' => data_get($event, 'socket')]); - } - - $payload = []; - - foreach ((new ReflectionClass($event))->getProperties(ReflectionProperty::IS_PUBLIC) as $property) { - $payload[$property->getName()] = $this->formatProperty($property->getValue($event)); - } - - unset($payload['broadcastQueue']); - - return $payload; - } - - /** - * Format the given value for a property. - * - * @param mixed $value - * @return mixed - */ - protected function formatProperty($value) - { - if ($value instanceof Arrayable) { - return $value->toArray(); - } - - return $value; - } - - /** - * Get the display name for the queued job. - * - * @return string - */ - public function displayName() - { - return get_class($this->event); - } - - /** - * Prepare the instance for cloning. - * - * @return void - */ - public function __clone() - { - $this->event = clone $this->event; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastException.php b/vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastException.php deleted file mode 100644 index 8fd55f7c..00000000 --- a/vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastException.php +++ /dev/null @@ -1,10 +0,0 @@ -app = $app; - } - - /** - * Register the routes for handling broadcast channel authentication and sockets. - * - * @param array|null $attributes - * @return void - */ - public function routes(array $attributes = null) - { - if ($this->app instanceof CachesRoutes && $this->app->routesAreCached()) { - return; - } - - $attributes = $attributes ?: ['middleware' => ['web']]; - - $this->app['router']->group($attributes, function ($router) { - $router->match( - ['get', 'post'], '/broadcasting/auth', - '\\'.BroadcastController::class.'@authenticate' - )->withoutMiddleware([\Illuminate\Foundation\Http\Middleware\VerifyCsrfToken::class]); - }); - } - - /** - * Register the routes for handling broadcast user authentication. - * - * @param array|null $attributes - * @return void - */ - public function userRoutes(array $attributes = null) - { - if ($this->app instanceof CachesRoutes && $this->app->routesAreCached()) { - return; - } - - $attributes = $attributes ?: ['middleware' => ['web']]; - - $this->app['router']->group($attributes, function ($router) { - $router->match( - ['get', 'post'], '/broadcasting/user-auth', - '\\'.BroadcastController::class.'@authenticateUser' - )->withoutMiddleware([\Illuminate\Foundation\Http\Middleware\VerifyCsrfToken::class]); - }); - } - - /** - * Register the routes for handling broadcast authentication and sockets. - * - * Alias of "routes" method. - * - * @param array|null $attributes - * @return void - */ - public function channelRoutes(array $attributes = null) - { - return $this->routes($attributes); - } - - /** - * Get the socket ID for the given request. - * - * @param \Illuminate\Http\Request|null $request - * @return string|null - */ - public function socket($request = null) - { - if (! $request && ! $this->app->bound('request')) { - return; - } - - $request = $request ?: $this->app['request']; - - return $request->header('X-Socket-ID'); - } - - /** - * Begin broadcasting an event. - * - * @param mixed|null $event - * @return \Illuminate\Broadcasting\PendingBroadcast - */ - public function event($event = null) - { - return new PendingBroadcast($this->app->make('events'), $event); - } - - /** - * Queue the given event for broadcast. - * - * @param mixed $event - * @return void - */ - public function queue($event) - { - if ($event instanceof ShouldBroadcastNow || - (is_object($event) && - method_exists($event, 'shouldBroadcastNow') && - $event->shouldBroadcastNow())) { - return $this->app->make(BusDispatcherContract::class)->dispatchNow(new BroadcastEvent(clone $event)); - } - - $queue = null; - - if (method_exists($event, 'broadcastQueue')) { - $queue = $event->broadcastQueue(); - } elseif (isset($event->broadcastQueue)) { - $queue = $event->broadcastQueue; - } elseif (isset($event->queue)) { - $queue = $event->queue; - } - - $broadcastEvent = new BroadcastEvent(clone $event); - - if ($event instanceof ShouldBeUnique) { - $broadcastEvent = new UniqueBroadcastEvent(clone $event); - - if ($this->mustBeUniqueAndCannotAcquireLock($broadcastEvent)) { - return; - } - } - - $this->app->make('queue') - ->connection($event->connection ?? null) - ->pushOn($queue, $broadcastEvent); - } - - /** - * Determine if the broadcastable event must be unique and determine if we can acquire the necessary lock. - * - * @param mixed $event - * @return bool - */ - protected function mustBeUniqueAndCannotAcquireLock($event) - { - return ! (new UniqueLock( - method_exists($event, 'uniqueVia') - ? $event->uniqueVia() - : $this->app->make(Cache::class) - ))->acquire($event); - } - - /** - * Get a driver instance. - * - * @param string|null $driver - * @return mixed - */ - public function connection($driver = null) - { - return $this->driver($driver); - } - - /** - * Get a driver instance. - * - * @param string|null $name - * @return mixed - */ - public function driver($name = null) - { - $name = $name ?: $this->getDefaultDriver(); - - return $this->drivers[$name] = $this->get($name); - } - - /** - * Attempt to get the connection from the local cache. - * - * @param string $name - * @return \Illuminate\Contracts\Broadcasting\Broadcaster - */ - protected function get($name) - { - return $this->drivers[$name] ?? $this->resolve($name); - } - - /** - * Resolve the given broadcaster. - * - * @param string $name - * @return \Illuminate\Contracts\Broadcasting\Broadcaster - * - * @throws \InvalidArgumentException - */ - protected function resolve($name) - { - $config = $this->getConfig($name); - - if (is_null($config)) { - throw new InvalidArgumentException("Broadcast connection [{$name}] is not defined."); - } - - if (isset($this->customCreators[$config['driver']])) { - return $this->callCustomCreator($config); - } - - $driverMethod = 'create'.ucfirst($config['driver']).'Driver'; - - if (! method_exists($this, $driverMethod)) { - throw new InvalidArgumentException("Driver [{$config['driver']}] is not supported."); - } - - return $this->{$driverMethod}($config); - } - - /** - * Call a custom driver creator. - * - * @param array $config - * @return mixed - */ - protected function callCustomCreator(array $config) - { - return $this->customCreators[$config['driver']]($this->app, $config); - } - - /** - * Create an instance of the driver. - * - * @param array $config - * @return \Illuminate\Contracts\Broadcasting\Broadcaster - */ - protected function createPusherDriver(array $config) - { - return new PusherBroadcaster($this->pusher($config)); - } - - /** - * Get a Pusher instance for the given configuration. - * - * @param array $config - * @return \Pusher\Pusher - */ - public function pusher(array $config) - { - $pusher = new Pusher( - $config['key'], - $config['secret'], - $config['app_id'], - $config['options'] ?? [], - isset($config['client_options']) && ! empty($config['client_options']) - ? new GuzzleClient($config['client_options']) - : null, - ); - - if ($config['log'] ?? false) { - $pusher->setLogger($this->app->make(LoggerInterface::class)); - } - - return $pusher; - } - - /** - * Create an instance of the driver. - * - * @param array $config - * @return \Illuminate\Contracts\Broadcasting\Broadcaster - */ - protected function createAblyDriver(array $config) - { - return new AblyBroadcaster($this->ably($config)); - } - - /** - * Get an Ably instance for the given configuration. - * - * @param array $config - * @return \Ably\AblyRest - */ - public function ably(array $config) - { - return new AblyRest($config); - } - - /** - * Create an instance of the driver. - * - * @param array $config - * @return \Illuminate\Contracts\Broadcasting\Broadcaster - */ - protected function createRedisDriver(array $config) - { - return new RedisBroadcaster( - $this->app->make('redis'), $config['connection'] ?? null, - $this->app['config']->get('database.redis.options.prefix', '') - ); - } - - /** - * Create an instance of the driver. - * - * @param array $config - * @return \Illuminate\Contracts\Broadcasting\Broadcaster - */ - protected function createLogDriver(array $config) - { - return new LogBroadcaster( - $this->app->make(LoggerInterface::class) - ); - } - - /** - * Create an instance of the driver. - * - * @param array $config - * @return \Illuminate\Contracts\Broadcasting\Broadcaster - */ - protected function createNullDriver(array $config) - { - return new NullBroadcaster; - } - - /** - * Get the connection configuration. - * - * @param string $name - * @return array - */ - protected function getConfig($name) - { - if (! is_null($name) && $name !== 'null') { - return $this->app['config']["broadcasting.connections.{$name}"]; - } - - return ['driver' => 'null']; - } - - /** - * Get the default driver name. - * - * @return string - */ - public function getDefaultDriver() - { - return $this->app['config']['broadcasting.default']; - } - - /** - * Set the default driver name. - * - * @param string $name - * @return void - */ - public function setDefaultDriver($name) - { - $this->app['config']['broadcasting.default'] = $name; - } - - /** - * Disconnect the given disk and remove from local cache. - * - * @param string|null $name - * @return void - */ - public function purge($name = null) - { - $name ??= $this->getDefaultDriver(); - - unset($this->drivers[$name]); - } - - /** - * Register a custom driver creator Closure. - * - * @param string $driver - * @param \Closure $callback - * @return $this - */ - public function extend($driver, Closure $callback) - { - $this->customCreators[$driver] = $callback; - - return $this; - } - - /** - * Get the application instance used by the manager. - * - * @return \Illuminate\Contracts\Foundation\Application - */ - public function getApplication() - { - return $this->app; - } - - /** - * Set the application instance used by the manager. - * - * @param \Illuminate\Contracts\Foundation\Application $app - * @return $this - */ - public function setApplication($app) - { - $this->app = $app; - - return $this; - } - - /** - * Forget all of the resolved driver instances. - * - * @return $this - */ - public function forgetDrivers() - { - $this->drivers = []; - - return $this; - } - - /** - * Dynamically call the default driver instance. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - return $this->driver()->$method(...$parameters); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastServiceProvider.php b/vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastServiceProvider.php deleted file mode 100644 index e6897e2d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastServiceProvider.php +++ /dev/null @@ -1,45 +0,0 @@ -app->singleton(BroadcastManager::class, function ($app) { - return new BroadcastManager($app); - }); - - $this->app->singleton(BroadcasterContract::class, function ($app) { - return $app->make(BroadcastManager::class)->connection(); - }); - - $this->app->alias( - BroadcastManager::class, BroadcastingFactory::class - ); - } - - /** - * Get the services provided by the provider. - * - * @return array - */ - public function provides() - { - return [ - BroadcastManager::class, - BroadcastingFactory::class, - BroadcasterContract::class, - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/AblyBroadcaster.php b/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/AblyBroadcaster.php deleted file mode 100644 index 3a6db783..00000000 --- a/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/AblyBroadcaster.php +++ /dev/null @@ -1,235 +0,0 @@ -ably = $ably; - } - - /** - * Authenticate the incoming request for a given channel. - * - * @param \Illuminate\Http\Request $request - * @return mixed - * - * @throws \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException - */ - public function auth($request) - { - $channelName = $this->normalizeChannelName($request->channel_name); - - if (empty($request->channel_name) || - ($this->isGuardedChannel($request->channel_name) && - ! $this->retrieveUser($request, $channelName))) { - throw new AccessDeniedHttpException; - } - - return parent::verifyUserCanAccessChannel( - $request, $channelName - ); - } - - /** - * Return the valid authentication response. - * - * @param \Illuminate\Http\Request $request - * @param mixed $result - * @return mixed - */ - public function validAuthenticationResponse($request, $result) - { - if (str_starts_with($request->channel_name, 'private')) { - $signature = $this->generateAblySignature( - $request->channel_name, $request->socket_id - ); - - return ['auth' => $this->getPublicToken().':'.$signature]; - } - - $channelName = $this->normalizeChannelName($request->channel_name); - - $user = $this->retrieveUser($request, $channelName); - - $broadcastIdentifier = method_exists($user, 'getAuthIdentifierForBroadcasting') - ? $user->getAuthIdentifierForBroadcasting() - : $user->getAuthIdentifier(); - - $signature = $this->generateAblySignature( - $request->channel_name, - $request->socket_id, - $userData = array_filter([ - 'user_id' => (string) $broadcastIdentifier, - 'user_info' => $result, - ]) - ); - - return [ - 'auth' => $this->getPublicToken().':'.$signature, - 'channel_data' => json_encode($userData), - ]; - } - - /** - * Generate the signature needed for Ably authentication headers. - * - * @param string $channelName - * @param string $socketId - * @param array|null $userData - * @return string - */ - public function generateAblySignature($channelName, $socketId, $userData = null) - { - return hash_hmac( - 'sha256', - sprintf('%s:%s%s', $socketId, $channelName, $userData ? ':'.json_encode($userData) : ''), - $this->getPrivateToken(), - ); - } - - /** - * Broadcast the given event. - * - * @param array $channels - * @param string $event - * @param array $payload - * @return void - * - * @throws \Illuminate\Broadcasting\BroadcastException - */ - public function broadcast(array $channels, $event, array $payload = []) - { - try { - foreach ($this->formatChannels($channels) as $channel) { - $this->ably->channels->get($channel)->publish( - $this->buildAblyMessage($event, $payload) - ); - } - } catch (AblyException $e) { - throw new BroadcastException( - sprintf('Ably error: %s', $e->getMessage()) - ); - } - } - - /** - * Build an Ably message object for broadcasting. - * - * @param string $event - * @param array $payload - * @return \Ably\Models\Message - */ - protected function buildAblyMessage($event, array $payload = []) - { - return tap(new AblyMessage, function ($message) use ($event, $payload) { - $message->name = $event; - $message->data = $payload; - $message->connectionKey = data_get($payload, 'socket'); - }); - } - - /** - * Return true if the channel is protected by authentication. - * - * @param string $channel - * @return bool - */ - public function isGuardedChannel($channel) - { - return Str::startsWith($channel, ['private-', 'presence-']); - } - - /** - * Remove prefix from channel name. - * - * @param string $channel - * @return string - */ - public function normalizeChannelName($channel) - { - if ($this->isGuardedChannel($channel)) { - return str_starts_with($channel, 'private-') - ? Str::replaceFirst('private-', '', $channel) - : Str::replaceFirst('presence-', '', $channel); - } - - return $channel; - } - - /** - * Format the channel array into an array of strings. - * - * @param array $channels - * @return array - */ - protected function formatChannels(array $channels) - { - return array_map(function ($channel) { - $channel = (string) $channel; - - if (Str::startsWith($channel, ['private-', 'presence-'])) { - return str_starts_with($channel, 'private-') - ? Str::replaceFirst('private-', 'private:', $channel) - : Str::replaceFirst('presence-', 'presence:', $channel); - } - - return 'public:'.$channel; - }, $channels); - } - - /** - * Get the public token value from the Ably key. - * - * @return mixed - */ - protected function getPublicToken() - { - return Str::before($this->ably->options->key, ':'); - } - - /** - * Get the private token value from the Ably key. - * - * @return mixed - */ - protected function getPrivateToken() - { - return Str::after($this->ably->options->key, ':'); - } - - /** - * Get the underlying Ably SDK instance. - * - * @return \Ably\AblyRest - */ - public function getAbly() - { - return $this->ably; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/Broadcaster.php b/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/Broadcaster.php deleted file mode 100644 index 9ca985a7..00000000 --- a/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/Broadcaster.php +++ /dev/null @@ -1,376 +0,0 @@ -authenticatedUserCallback) { - return $this->authenticatedUserCallback->__invoke($request); - } - } - - /** - * Register the user retrieval callback used to authenticate connections. - * - * See: https://pusher.com/docs/channels/library_auth_reference/auth-signatures/#user-authentication. - * - * @param \Closure $callback - * @return void - */ - public function resolveAuthenticatedUserUsing(Closure $callback) - { - $this->authenticatedUserCallback = $callback; - } - - /** - * Register a channel authenticator. - * - * @param \Illuminate\Contracts\Broadcasting\HasBroadcastChannel|string $channel - * @param callable|string $callback - * @param array $options - * @return $this - */ - public function channel($channel, $callback, $options = []) - { - if ($channel instanceof HasBroadcastChannel) { - $channel = $channel->broadcastChannelRoute(); - } elseif (is_string($channel) && class_exists($channel) && is_a($channel, HasBroadcastChannel::class, true)) { - $channel = (new $channel)->broadcastChannelRoute(); - } - - $this->channels[$channel] = $callback; - - $this->channelOptions[$channel] = $options; - - return $this; - } - - /** - * Authenticate the incoming request for a given channel. - * - * @param \Illuminate\Http\Request $request - * @param string $channel - * @return mixed - * - * @throws \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException - */ - protected function verifyUserCanAccessChannel($request, $channel) - { - foreach ($this->channels as $pattern => $callback) { - if (! $this->channelNameMatchesPattern($channel, $pattern)) { - continue; - } - - $parameters = $this->extractAuthParameters($pattern, $channel, $callback); - - $handler = $this->normalizeChannelHandlerToCallable($callback); - - $result = $handler($this->retrieveUser($request, $channel), ...$parameters); - - if ($result === false) { - throw new AccessDeniedHttpException; - } elseif ($result) { - return $this->validAuthenticationResponse($request, $result); - } - } - - throw new AccessDeniedHttpException; - } - - /** - * Extract the parameters from the given pattern and channel. - * - * @param string $pattern - * @param string $channel - * @param callable|string $callback - * @return array - */ - protected function extractAuthParameters($pattern, $channel, $callback) - { - $callbackParameters = $this->extractParameters($callback); - - return collect($this->extractChannelKeys($pattern, $channel))->reject(function ($value, $key) { - return is_numeric($key); - })->map(function ($value, $key) use ($callbackParameters) { - return $this->resolveBinding($key, $value, $callbackParameters); - })->values()->all(); - } - - /** - * Extracts the parameters out of what the user passed to handle the channel authentication. - * - * @param callable|string $callback - * @return \ReflectionParameter[] - * - * @throws \Exception - */ - protected function extractParameters($callback) - { - if (is_callable($callback)) { - return (new ReflectionFunction($callback))->getParameters(); - } elseif (is_string($callback)) { - return $this->extractParametersFromClass($callback); - } - - throw new Exception('Given channel handler is an unknown type.'); - } - - /** - * Extracts the parameters out of a class channel's "join" method. - * - * @param string $callback - * @return \ReflectionParameter[] - * - * @throws \Exception - */ - protected function extractParametersFromClass($callback) - { - $reflection = new ReflectionClass($callback); - - if (! $reflection->hasMethod('join')) { - throw new Exception('Class based channel must define a "join" method.'); - } - - return $reflection->getMethod('join')->getParameters(); - } - - /** - * Extract the channel keys from the incoming channel name. - * - * @param string $pattern - * @param string $channel - * @return array - */ - protected function extractChannelKeys($pattern, $channel) - { - preg_match('/^'.preg_replace('/\{(.*?)\}/', '(?<$1>[^\.]+)', $pattern).'/', $channel, $keys); - - return $keys; - } - - /** - * Resolve the given parameter binding. - * - * @param string $key - * @param string $value - * @param array $callbackParameters - * @return mixed - */ - protected function resolveBinding($key, $value, $callbackParameters) - { - $newValue = $this->resolveExplicitBindingIfPossible($key, $value); - - return $newValue === $value ? $this->resolveImplicitBindingIfPossible( - $key, $value, $callbackParameters - ) : $newValue; - } - - /** - * Resolve an explicit parameter binding if applicable. - * - * @param string $key - * @param mixed $value - * @return mixed - */ - protected function resolveExplicitBindingIfPossible($key, $value) - { - $binder = $this->binder(); - - if ($binder && $binder->getBindingCallback($key)) { - return call_user_func($binder->getBindingCallback($key), $value); - } - - return $value; - } - - /** - * Resolve an implicit parameter binding if applicable. - * - * @param string $key - * @param mixed $value - * @param array $callbackParameters - * @return mixed - * - * @throws \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException - */ - protected function resolveImplicitBindingIfPossible($key, $value, $callbackParameters) - { - foreach ($callbackParameters as $parameter) { - if (! $this->isImplicitlyBindable($key, $parameter)) { - continue; - } - - $className = Reflector::getParameterClassName($parameter); - - if (is_null($model = (new $className)->resolveRouteBinding($value))) { - throw new AccessDeniedHttpException; - } - - return $model; - } - - return $value; - } - - /** - * Determine if a given key and parameter is implicitly bindable. - * - * @param string $key - * @param \ReflectionParameter $parameter - * @return bool - */ - protected function isImplicitlyBindable($key, $parameter) - { - return $parameter->getName() === $key && - Reflector::isParameterSubclassOf($parameter, UrlRoutable::class); - } - - /** - * Format the channel array into an array of strings. - * - * @param array $channels - * @return array - */ - protected function formatChannels(array $channels) - { - return array_map(function ($channel) { - return (string) $channel; - }, $channels); - } - - /** - * Get the model binding registrar instance. - * - * @return \Illuminate\Contracts\Routing\BindingRegistrar - */ - protected function binder() - { - if (! $this->bindingRegistrar) { - $this->bindingRegistrar = Container::getInstance()->bound(BindingRegistrar::class) - ? Container::getInstance()->make(BindingRegistrar::class) : null; - } - - return $this->bindingRegistrar; - } - - /** - * Normalize the given callback into a callable. - * - * @param mixed $callback - * @return callable - */ - protected function normalizeChannelHandlerToCallable($callback) - { - return is_callable($callback) ? $callback : function (...$args) use ($callback) { - return Container::getInstance() - ->make($callback) - ->join(...$args); - }; - } - - /** - * Retrieve the authenticated user using the configured guard (if any). - * - * @param \Illuminate\Http\Request $request - * @param string $channel - * @return mixed - */ - protected function retrieveUser($request, $channel) - { - $options = $this->retrieveChannelOptions($channel); - - $guards = $options['guards'] ?? null; - - if (is_null($guards)) { - return $request->user(); - } - - foreach (Arr::wrap($guards) as $guard) { - if ($user = $request->user($guard)) { - return $user; - } - } - } - - /** - * Retrieve options for a certain channel. - * - * @param string $channel - * @return array - */ - protected function retrieveChannelOptions($channel) - { - foreach ($this->channelOptions as $pattern => $options) { - if (! $this->channelNameMatchesPattern($channel, $pattern)) { - continue; - } - - return $options; - } - - return []; - } - - /** - * Check if the channel name from the request matches a pattern from registered channels. - * - * @param string $channel - * @param string $pattern - * @return bool - */ - protected function channelNameMatchesPattern($channel, $pattern) - { - return preg_match('/'.preg_replace('/\{(.*?)\}/', '([^\.]+)', $pattern).'$/', $channel); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/LogBroadcaster.php b/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/LogBroadcaster.php deleted file mode 100644 index 50877dc9..00000000 --- a/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/LogBroadcaster.php +++ /dev/null @@ -1,54 +0,0 @@ -logger = $logger; - } - - /** - * {@inheritdoc} - */ - public function auth($request) - { - // - } - - /** - * {@inheritdoc} - */ - public function validAuthenticationResponse($request, $result) - { - // - } - - /** - * {@inheritdoc} - */ - public function broadcast(array $channels, $event, array $payload = []) - { - $channels = implode(', ', $this->formatChannels($channels)); - - $payload = json_encode($payload, JSON_PRETTY_PRINT); - - $this->logger->info('Broadcasting ['.$event.'] on channels ['.$channels.'] with payload:'.PHP_EOL.$payload); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/NullBroadcaster.php b/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/NullBroadcaster.php deleted file mode 100644 index 6205c90c..00000000 --- a/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/NullBroadcaster.php +++ /dev/null @@ -1,30 +0,0 @@ -pusher = $pusher; - } - - /** - * Resolve the authenticated user payload for an incoming connection request. - * - * See: https://pusher.com/docs/channels/library_auth_reference/auth-signatures/#user-authentication - * See: https://pusher.com/docs/channels/server_api/authenticating-users/#response - * - * @param \Illuminate\Http\Request $request - * @return array|null - */ - public function resolveAuthenticatedUser($request) - { - if (! $user = parent::resolveAuthenticatedUser($request)) { - return; - } - - if (method_exists($this->pusher, 'authenticateUser')) { - return $this->pusher->authenticateUser($request->socket_id, $user); - } - - $settings = $this->pusher->getSettings(); - $encodedUser = json_encode($user); - $decodedString = "{$request->socket_id}::user::{$encodedUser}"; - - $auth = $settings['auth_key'].':'.hash_hmac( - 'sha256', $decodedString, $settings['secret'] - ); - - return [ - 'auth' => $auth, - 'user_data' => $encodedUser, - ]; - } - - /** - * Authenticate the incoming request for a given channel. - * - * @param \Illuminate\Http\Request $request - * @return mixed - * - * @throws \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException - */ - public function auth($request) - { - $channelName = $this->normalizeChannelName($request->channel_name); - - if (empty($request->channel_name) || - ($this->isGuardedChannel($request->channel_name) && - ! $this->retrieveUser($request, $channelName))) { - throw new AccessDeniedHttpException; - } - - return parent::verifyUserCanAccessChannel( - $request, $channelName - ); - } - - /** - * Return the valid authentication response. - * - * @param \Illuminate\Http\Request $request - * @param mixed $result - * @return mixed - */ - public function validAuthenticationResponse($request, $result) - { - if (str_starts_with($request->channel_name, 'private')) { - return $this->decodePusherResponse( - $request, - method_exists($this->pusher, 'authorizeChannel') - ? $this->pusher->authorizeChannel($request->channel_name, $request->socket_id) - : $this->pusher->socket_auth($request->channel_name, $request->socket_id) - ); - } - - $channelName = $this->normalizeChannelName($request->channel_name); - - $user = $this->retrieveUser($request, $channelName); - - $broadcastIdentifier = method_exists($user, 'getAuthIdentifierForBroadcasting') - ? $user->getAuthIdentifierForBroadcasting() - : $user->getAuthIdentifier(); - - return $this->decodePusherResponse( - $request, - method_exists($this->pusher, 'authorizePresenceChannel') - ? $this->pusher->authorizePresenceChannel($request->channel_name, $request->socket_id, $broadcastIdentifier, $result) - : $this->pusher->presence_auth($request->channel_name, $request->socket_id, $broadcastIdentifier, $result) - ); - } - - /** - * Decode the given Pusher response. - * - * @param \Illuminate\Http\Request $request - * @param mixed $response - * @return array - */ - protected function decodePusherResponse($request, $response) - { - if (! $request->input('callback', false)) { - return json_decode($response, true); - } - - return response()->json(json_decode($response, true)) - ->withCallback($request->callback); - } - - /** - * Broadcast the given event. - * - * @param array $channels - * @param string $event - * @param array $payload - * @return void - * - * @throws \Illuminate\Broadcasting\BroadcastException - */ - public function broadcast(array $channels, $event, array $payload = []) - { - $socket = Arr::pull($payload, 'socket'); - - $parameters = $socket !== null ? ['socket_id' => $socket] : []; - - $channels = Collection::make($this->formatChannels($channels)); - - try { - $channels->chunk(100)->each(function ($channels) use ($event, $payload, $parameters) { - $this->pusher->trigger($channels->toArray(), $event, $payload, $parameters); - }); - } catch (ApiErrorException $e) { - throw new BroadcastException( - sprintf('Pusher error: %s.', $e->getMessage()) - ); - } - } - - /** - * Get the Pusher SDK instance. - * - * @return \Pusher\Pusher - */ - public function getPusher() - { - return $this->pusher; - } - - /** - * Set the Pusher SDK instance. - * - * @param \Pusher\Pusher $pusher - * @return void - */ - public function setPusher($pusher) - { - $this->pusher = $pusher; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/RedisBroadcaster.php b/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/RedisBroadcaster.php deleted file mode 100644 index 5ae2e03c..00000000 --- a/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/RedisBroadcaster.php +++ /dev/null @@ -1,169 +0,0 @@ -redis = $redis; - $this->prefix = $prefix; - $this->connection = $connection; - } - - /** - * Authenticate the incoming request for a given channel. - * - * @param \Illuminate\Http\Request $request - * @return mixed - * - * @throws \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException - */ - public function auth($request) - { - $channelName = $this->normalizeChannelName( - str_replace($this->prefix, '', $request->channel_name) - ); - - if (empty($request->channel_name) || - ($this->isGuardedChannel($request->channel_name) && - ! $this->retrieveUser($request, $channelName))) { - throw new AccessDeniedHttpException; - } - - return parent::verifyUserCanAccessChannel( - $request, $channelName - ); - } - - /** - * Return the valid authentication response. - * - * @param \Illuminate\Http\Request $request - * @param mixed $result - * @return mixed - */ - public function validAuthenticationResponse($request, $result) - { - if (is_bool($result)) { - return json_encode($result); - } - - $channelName = $this->normalizeChannelName($request->channel_name); - - $user = $this->retrieveUser($request, $channelName); - - $broadcastIdentifier = method_exists($user, 'getAuthIdentifierForBroadcasting') - ? $user->getAuthIdentifierForBroadcasting() - : $user->getAuthIdentifier(); - - return json_encode(['channel_data' => [ - 'user_id' => $broadcastIdentifier, - 'user_info' => $result, - ]]); - } - - /** - * Broadcast the given event. - * - * @param array $channels - * @param string $event - * @param array $payload - * @return void - * - * @throws \Illuminate\Broadcasting\BroadcastException - */ - public function broadcast(array $channels, $event, array $payload = []) - { - if (empty($channels)) { - return; - } - - $connection = $this->redis->connection($this->connection); - - $payload = json_encode([ - 'event' => $event, - 'data' => $payload, - 'socket' => Arr::pull($payload, 'socket'), - ]); - - try { - $connection->eval( - $this->broadcastMultipleChannelsScript(), - 0, $payload, ...$this->formatChannels($channels) - ); - } catch (ConnectionException|RedisException $e) { - throw new BroadcastException( - sprintf('Redis error: %s.', $e->getMessage()) - ); - } - } - - /** - * Get the Lua script for broadcasting to multiple channels. - * - * ARGV[1] - The payload - * ARGV[2...] - The channels - * - * @return string - */ - protected function broadcastMultipleChannelsScript() - { - return <<<'LUA' -for i = 2, #ARGV do - redis.call('publish', ARGV[i], ARGV[1]) -end -LUA; - } - - /** - * Format the channel array into an array of strings. - * - * @param array $channels - * @return array - */ - protected function formatChannels(array $channels) - { - return array_map(function ($channel) { - return $this->prefix.$channel; - }, parent::formatChannels($channels)); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/UsePusherChannelConventions.php b/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/UsePusherChannelConventions.php deleted file mode 100644 index 690cf3d4..00000000 --- a/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/UsePusherChannelConventions.php +++ /dev/null @@ -1,36 +0,0 @@ -name = $name instanceof HasBroadcastChannel ? $name->broadcastChannel() : $name; - } - - /** - * Convert the channel instance to a string. - * - * @return string - */ - public function __toString() - { - return $this->name; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Broadcasting/EncryptedPrivateChannel.php b/vendor/laravel/framework/src/Illuminate/Broadcasting/EncryptedPrivateChannel.php deleted file mode 100644 index 76977c15..00000000 --- a/vendor/laravel/framework/src/Illuminate/Broadcasting/EncryptedPrivateChannel.php +++ /dev/null @@ -1,17 +0,0 @@ -broadcastConnection = is_null($connection) - ? [null] - : Arr::wrap($connection); - - return $this; - } - - /** - * Get the broadcaster connections the event should be broadcast on. - * - * @return array - */ - public function broadcastConnections() - { - return $this->broadcastConnection; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Broadcasting/InteractsWithSockets.php b/vendor/laravel/framework/src/Illuminate/Broadcasting/InteractsWithSockets.php deleted file mode 100644 index 6be0791a..00000000 --- a/vendor/laravel/framework/src/Illuminate/Broadcasting/InteractsWithSockets.php +++ /dev/null @@ -1,39 +0,0 @@ -socket = Broadcast::socket(); - - return $this; - } - - /** - * Broadcast the event to everyone. - * - * @return $this - */ - public function broadcastToEveryone() - { - $this->socket = null; - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Broadcasting/LICENSE.md b/vendor/laravel/framework/src/Illuminate/Broadcasting/LICENSE.md deleted file mode 100644 index 79810c84..00000000 --- a/vendor/laravel/framework/src/Illuminate/Broadcasting/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Taylor Otwell - -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/laravel/framework/src/Illuminate/Broadcasting/PendingBroadcast.php b/vendor/laravel/framework/src/Illuminate/Broadcasting/PendingBroadcast.php deleted file mode 100644 index 191b905f..00000000 --- a/vendor/laravel/framework/src/Illuminate/Broadcasting/PendingBroadcast.php +++ /dev/null @@ -1,74 +0,0 @@ -event = $event; - $this->events = $events; - } - - /** - * Broadcast the event using a specific broadcaster. - * - * @param string|null $connection - * @return $this - */ - public function via($connection = null) - { - if (method_exists($this->event, 'broadcastVia')) { - $this->event->broadcastVia($connection); - } - - return $this; - } - - /** - * Broadcast the event to everyone except the current user. - * - * @return $this - */ - public function toOthers() - { - if (method_exists($this->event, 'dontBroadcastToCurrentUser')) { - $this->event->dontBroadcastToCurrentUser(); - } - - return $this; - } - - /** - * Handle the object's destruction. - * - * @return void - */ - public function __destruct() - { - $this->events->dispatch($this->event); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Broadcasting/PresenceChannel.php b/vendor/laravel/framework/src/Illuminate/Broadcasting/PresenceChannel.php deleted file mode 100644 index 22de12d3..00000000 --- a/vendor/laravel/framework/src/Illuminate/Broadcasting/PresenceChannel.php +++ /dev/null @@ -1,17 +0,0 @@ -broadcastChannel() : $name; - - parent::__construct('private-'.$name); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Broadcasting/UniqueBroadcastEvent.php b/vendor/laravel/framework/src/Illuminate/Broadcasting/UniqueBroadcastEvent.php deleted file mode 100644 index 83c752df..00000000 --- a/vendor/laravel/framework/src/Illuminate/Broadcasting/UniqueBroadcastEvent.php +++ /dev/null @@ -1,61 +0,0 @@ -uniqueId = get_class($event); - - if (method_exists($event, 'uniqueId')) { - $this->uniqueId .= $event->uniqueId(); - } elseif (property_exists($event, 'uniqueId')) { - $this->uniqueId .= $event->uniqueId; - } - - if (method_exists($event, 'uniqueFor')) { - $this->uniqueFor = $event->uniqueFor(); - } elseif (property_exists($event, 'uniqueFor')) { - $this->uniqueFor = $event->uniqueFor; - } - - parent::__construct($event); - } - - /** - * Resolve the cache implementation that should manage the event's uniqueness. - * - * @return \Illuminate\Contracts\Cache\Repository - */ - public function uniqueVia() - { - return method_exists($this->event, 'uniqueVia') - ? $this->event->uniqueVia() - : Container::getInstance()->make(Repository::class); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Broadcasting/composer.json b/vendor/laravel/framework/src/Illuminate/Broadcasting/composer.json deleted file mode 100644 index 1f38b07a..00000000 --- a/vendor/laravel/framework/src/Illuminate/Broadcasting/composer.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "illuminate/broadcasting", - "description": "The Illuminate Broadcasting package.", - "license": "MIT", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "require": { - "php": "^8.0.2", - "ext-json": "*", - "psr/log": "^1.0|^2.0|^3.0", - "illuminate/bus": "^9.0", - "illuminate/collections": "^9.0", - "illuminate/container": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/queue": "^9.0", - "illuminate/support": "^9.0" - }, - "autoload": { - "psr-4": { - "Illuminate\\Broadcasting\\": "" - } - }, - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "suggest": { - "ably/ably-php": "Required to use the Ably broadcast driver (^1.0).", - "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^6.0|^7.0)." - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev" -} diff --git a/vendor/laravel/framework/src/Illuminate/Bus/Batch.php b/vendor/laravel/framework/src/Illuminate/Bus/Batch.php deleted file mode 100644 index 644bfbce..00000000 --- a/vendor/laravel/framework/src/Illuminate/Bus/Batch.php +++ /dev/null @@ -1,480 +0,0 @@ -queue = $queue; - $this->repository = $repository; - $this->id = $id; - $this->name = $name; - $this->totalJobs = $totalJobs; - $this->pendingJobs = $pendingJobs; - $this->failedJobs = $failedJobs; - $this->failedJobIds = $failedJobIds; - $this->options = $options; - $this->createdAt = $createdAt; - $this->cancelledAt = $cancelledAt; - $this->finishedAt = $finishedAt; - } - - /** - * Get a fresh instance of the batch represented by this ID. - * - * @return self - */ - public function fresh() - { - return $this->repository->find($this->id); - } - - /** - * Add additional jobs to the batch. - * - * @param \Illuminate\Support\Enumerable|object|array $jobs - * @return self - */ - public function add($jobs) - { - $count = 0; - - $jobs = Collection::wrap($jobs)->map(function ($job) use (&$count) { - $job = $job instanceof Closure ? CallQueuedClosure::create($job) : $job; - - if (is_array($job)) { - $count += count($job); - - return with($this->prepareBatchedChain($job), function ($chain) { - return $chain->first() - ->allOnQueue($this->options['queue'] ?? null) - ->allOnConnection($this->options['connection'] ?? null) - ->chain($chain->slice(1)->values()->all()); - }); - } else { - $job->withBatchId($this->id); - - $count++; - } - - return $job; - }); - - $this->repository->transaction(function () use ($jobs, $count) { - $this->repository->incrementTotalJobs($this->id, $count); - - $this->queue->connection($this->options['connection'] ?? null)->bulk( - $jobs->all(), - $data = '', - $this->options['queue'] ?? null - ); - }); - - return $this->fresh(); - } - - /** - * Prepare a chain that exists within the jobs being added. - * - * @param array $chain - * @return \Illuminate\Support\Collection - */ - protected function prepareBatchedChain(array $chain) - { - return collect($chain)->map(function ($job) { - $job = $job instanceof Closure ? CallQueuedClosure::create($job) : $job; - - return $job->withBatchId($this->id); - }); - } - - /** - * Get the total number of jobs that have been processed by the batch thus far. - * - * @return int - */ - public function processedJobs() - { - return $this->totalJobs - $this->pendingJobs; - } - - /** - * Get the percentage of jobs that have been processed (between 0-100). - * - * @return int - */ - public function progress() - { - return $this->totalJobs > 0 ? round(($this->processedJobs() / $this->totalJobs) * 100) : 0; - } - - /** - * Record that a job within the batch finished successfully, executing any callbacks if necessary. - * - * @param string $jobId - * @return void - */ - public function recordSuccessfulJob(string $jobId) - { - $counts = $this->decrementPendingJobs($jobId); - - if ($counts->pendingJobs === 0) { - $this->repository->markAsFinished($this->id); - } - - if ($counts->pendingJobs === 0 && $this->hasThenCallbacks()) { - $batch = $this->fresh(); - - collect($this->options['then'])->each(function ($handler) use ($batch) { - $this->invokeHandlerCallback($handler, $batch); - }); - } - - if ($counts->allJobsHaveRanExactlyOnce() && $this->hasFinallyCallbacks()) { - $batch = $this->fresh(); - - collect($this->options['finally'])->each(function ($handler) use ($batch) { - $this->invokeHandlerCallback($handler, $batch); - }); - } - } - - /** - * Decrement the pending jobs for the batch. - * - * @param string $jobId - * @return \Illuminate\Bus\UpdatedBatchJobCounts - */ - public function decrementPendingJobs(string $jobId) - { - return $this->repository->decrementPendingJobs($this->id, $jobId); - } - - /** - * Determine if the batch has finished executing. - * - * @return bool - */ - public function finished() - { - return ! is_null($this->finishedAt); - } - - /** - * Determine if the batch has "success" callbacks. - * - * @return bool - */ - public function hasThenCallbacks() - { - return isset($this->options['then']) && ! empty($this->options['then']); - } - - /** - * Determine if the batch allows jobs to fail without cancelling the batch. - * - * @return bool - */ - public function allowsFailures() - { - return Arr::get($this->options, 'allowFailures', false) === true; - } - - /** - * Determine if the batch has job failures. - * - * @return bool - */ - public function hasFailures() - { - return $this->failedJobs > 0; - } - - /** - * Record that a job within the batch failed to finish successfully, executing any callbacks if necessary. - * - * @param string $jobId - * @param \Throwable $e - * @return void - */ - public function recordFailedJob(string $jobId, $e) - { - $counts = $this->incrementFailedJobs($jobId); - - if ($counts->failedJobs === 1 && ! $this->allowsFailures()) { - $this->cancel(); - } - - if ($counts->failedJobs === 1 && $this->hasCatchCallbacks()) { - $batch = $this->fresh(); - - collect($this->options['catch'])->each(function ($handler) use ($batch, $e) { - $this->invokeHandlerCallback($handler, $batch, $e); - }); - } - - if ($counts->allJobsHaveRanExactlyOnce() && $this->hasFinallyCallbacks()) { - $batch = $this->fresh(); - - collect($this->options['finally'])->each(function ($handler) use ($batch, $e) { - $this->invokeHandlerCallback($handler, $batch, $e); - }); - } - } - - /** - * Increment the failed jobs for the batch. - * - * @param string $jobId - * @return \Illuminate\Bus\UpdatedBatchJobCounts - */ - public function incrementFailedJobs(string $jobId) - { - return $this->repository->incrementFailedJobs($this->id, $jobId); - } - - /** - * Determine if the batch has "catch" callbacks. - * - * @return bool - */ - public function hasCatchCallbacks() - { - return isset($this->options['catch']) && ! empty($this->options['catch']); - } - - /** - * Determine if the batch has "finally" callbacks. - * - * @return bool - */ - public function hasFinallyCallbacks() - { - return isset($this->options['finally']) && ! empty($this->options['finally']); - } - - /** - * Cancel the batch. - * - * @return void - */ - public function cancel() - { - $this->repository->cancel($this->id); - } - - /** - * Determine if the batch has been cancelled. - * - * @return bool - */ - public function canceled() - { - return $this->cancelled(); - } - - /** - * Determine if the batch has been cancelled. - * - * @return bool - */ - public function cancelled() - { - return ! is_null($this->cancelledAt); - } - - /** - * Delete the batch from storage. - * - * @return void - */ - public function delete() - { - $this->repository->delete($this->id); - } - - /** - * Invoke a batch callback handler. - * - * @param callable $handler - * @param \Illuminate\Bus\Batch $batch - * @param \Throwable|null $e - * @return void - */ - protected function invokeHandlerCallback($handler, Batch $batch, Throwable $e = null) - { - try { - return $handler($batch, $e); - } catch (Throwable $e) { - if (function_exists('report')) { - report($e); - } - } - } - - /** - * Convert the batch to an array. - * - * @return array - */ - public function toArray() - { - return [ - 'id' => $this->id, - 'name' => $this->name, - 'totalJobs' => $this->totalJobs, - 'pendingJobs' => $this->pendingJobs, - 'processedJobs' => $this->processedJobs(), - 'progress' => $this->progress(), - 'failedJobs' => $this->failedJobs, - 'options' => $this->options, - 'createdAt' => $this->createdAt, - 'cancelledAt' => $this->cancelledAt, - 'finishedAt' => $this->finishedAt, - ]; - } - - /** - * Get the JSON serializable representation of the object. - * - * @return array - */ - public function jsonSerialize(): array - { - return $this->toArray(); - } - - /** - * Dynamically access the batch's "options" via properties. - * - * @param string $key - * @return mixed - */ - public function __get($key) - { - return $this->options[$key] ?? null; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Bus/BatchFactory.php b/vendor/laravel/framework/src/Illuminate/Bus/BatchFactory.php deleted file mode 100644 index 2c3a4e96..00000000 --- a/vendor/laravel/framework/src/Illuminate/Bus/BatchFactory.php +++ /dev/null @@ -1,58 +0,0 @@ -queue = $queue; - } - - /** - * Create a new batch instance. - * - * @param \Illuminate\Bus\BatchRepository $repository - * @param string $id - * @param string $name - * @param int $totalJobs - * @param int $pendingJobs - * @param int $failedJobs - * @param array $failedJobIds - * @param array $options - * @param \Carbon\CarbonImmutable $createdAt - * @param \Carbon\CarbonImmutable|null $cancelledAt - * @param \Carbon\CarbonImmutable|null $finishedAt - * @return \Illuminate\Bus\Batch - */ - public function make(BatchRepository $repository, - string $id, - string $name, - int $totalJobs, - int $pendingJobs, - int $failedJobs, - array $failedJobIds, - array $options, - CarbonImmutable $createdAt, - ?CarbonImmutable $cancelledAt, - ?CarbonImmutable $finishedAt) - { - return new Batch($this->queue, $repository, $id, $name, $totalJobs, $pendingJobs, $failedJobs, $failedJobIds, $options, $createdAt, $cancelledAt, $finishedAt); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Bus/BatchRepository.php b/vendor/laravel/framework/src/Illuminate/Bus/BatchRepository.php deleted file mode 100644 index 098ccef2..00000000 --- a/vendor/laravel/framework/src/Illuminate/Bus/BatchRepository.php +++ /dev/null @@ -1,92 +0,0 @@ -fakeBatch) { - return $this->fakeBatch; - } - - if ($this->batchId) { - return Container::getInstance()->make(BatchRepository::class)->find($this->batchId); - } - } - - /** - * Determine if the batch is still active and processing. - * - * @return bool - */ - public function batching() - { - $batch = $this->batch(); - - return $batch && ! $batch->cancelled(); - } - - /** - * Set the batch ID on the job. - * - * @param string $batchId - * @return $this - */ - public function withBatchId(string $batchId) - { - $this->batchId = $batchId; - - return $this; - } - - /** - * Indicate that the job should use a fake batch. - * - * @param string $id - * @param string $name - * @param int $totalJobs - * @param int $pendingJobs - * @param int $failedJobs - * @param array $failedJobIds - * @param array $options - * @param \Carbon\CarbonImmutable $createdAt - * @param \Carbon\CarbonImmutable|null $cancelledAt - * @param \Carbon\CarbonImmutable|null $finishedAt - * @return array{0: $this, 1: \Illuminate\Support\Testing\BatchFake} - */ - public function withFakeBatch(string $id = '', - string $name = '', - int $totalJobs = 0, - int $pendingJobs = 0, - int $failedJobs = 0, - array $failedJobIds = [], - array $options = [], - CarbonImmutable $createdAt = null, - ?CarbonImmutable $cancelledAt = null, - ?CarbonImmutable $finishedAt = null) - { - $this->fakeBatch = new BatchFake( - empty($id) ? (string) Str::uuid() : $id, - $name, - $totalJobs, - $pendingJobs, - $failedJobs, - $failedJobIds, - $options, - $createdAt ?? CarbonImmutable::now(), - $cancelledAt, - $finishedAt, - ); - - return [$this, $this->fakeBatch]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Bus/BusServiceProvider.php b/vendor/laravel/framework/src/Illuminate/Bus/BusServiceProvider.php deleted file mode 100644 index bd6192d0..00000000 --- a/vendor/laravel/framework/src/Illuminate/Bus/BusServiceProvider.php +++ /dev/null @@ -1,70 +0,0 @@ -app->singleton(Dispatcher::class, function ($app) { - return new Dispatcher($app, function ($connection = null) use ($app) { - return $app[QueueFactoryContract::class]->connection($connection); - }); - }); - - $this->registerBatchServices(); - - $this->app->alias( - Dispatcher::class, DispatcherContract::class - ); - - $this->app->alias( - Dispatcher::class, QueueingDispatcherContract::class - ); - } - - /** - * Register the batch handling services. - * - * @return void - */ - protected function registerBatchServices() - { - $this->app->singleton(BatchRepository::class, DatabaseBatchRepository::class); - - $this->app->singleton(DatabaseBatchRepository::class, function ($app) { - return new DatabaseBatchRepository( - $app->make(BatchFactory::class), - $app->make('db')->connection($app->config->get('queue.batching.database')), - $app->config->get('queue.batching.table', 'job_batches') - ); - }); - } - - /** - * Get the services provided by the provider. - * - * @return array - */ - public function provides() - { - return [ - Dispatcher::class, - DispatcherContract::class, - QueueingDispatcherContract::class, - BatchRepository::class, - DatabaseBatchRepository::class, - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Bus/DatabaseBatchRepository.php b/vendor/laravel/framework/src/Illuminate/Bus/DatabaseBatchRepository.php deleted file mode 100644 index 624da19a..00000000 --- a/vendor/laravel/framework/src/Illuminate/Bus/DatabaseBatchRepository.php +++ /dev/null @@ -1,388 +0,0 @@ -factory = $factory; - $this->connection = $connection; - $this->table = $table; - } - - /** - * Retrieve a list of batches. - * - * @param int $limit - * @param mixed $before - * @return \Illuminate\Bus\Batch[] - */ - public function get($limit = 50, $before = null) - { - return $this->connection->table($this->table) - ->orderByDesc('id') - ->take($limit) - ->when($before, fn ($q) => $q->where('id', '<', $before)) - ->get() - ->map(function ($batch) { - return $this->toBatch($batch); - }) - ->all(); - } - - /** - * Retrieve information about an existing batch. - * - * @param string $batchId - * @return \Illuminate\Bus\Batch|null - */ - public function find(string $batchId) - { - $batch = $this->connection->table($this->table) - ->useWritePdo() - ->where('id', $batchId) - ->first(); - - if ($batch) { - return $this->toBatch($batch); - } - } - - /** - * Store a new pending batch. - * - * @param \Illuminate\Bus\PendingBatch $batch - * @return \Illuminate\Bus\Batch - */ - public function store(PendingBatch $batch) - { - $id = (string) Str::orderedUuid(); - - $this->connection->table($this->table)->insert([ - 'id' => $id, - 'name' => $batch->name, - 'total_jobs' => 0, - 'pending_jobs' => 0, - 'failed_jobs' => 0, - 'failed_job_ids' => '[]', - 'options' => $this->serialize($batch->options), - 'created_at' => time(), - 'cancelled_at' => null, - 'finished_at' => null, - ]); - - return $this->find($id); - } - - /** - * Increment the total number of jobs within the batch. - * - * @param string $batchId - * @param int $amount - * @return void - */ - public function incrementTotalJobs(string $batchId, int $amount) - { - $this->connection->table($this->table)->where('id', $batchId)->update([ - 'total_jobs' => new Expression('total_jobs + '.$amount), - 'pending_jobs' => new Expression('pending_jobs + '.$amount), - 'finished_at' => null, - ]); - } - - /** - * Decrement the total number of pending jobs for the batch. - * - * @param string $batchId - * @param string $jobId - * @return \Illuminate\Bus\UpdatedBatchJobCounts - */ - public function decrementPendingJobs(string $batchId, string $jobId) - { - $values = $this->updateAtomicValues($batchId, function ($batch) use ($jobId) { - return [ - 'pending_jobs' => $batch->pending_jobs - 1, - 'failed_jobs' => $batch->failed_jobs, - 'failed_job_ids' => json_encode(array_values(array_diff(json_decode($batch->failed_job_ids, true), [$jobId]))), - ]; - }); - - return new UpdatedBatchJobCounts( - $values['pending_jobs'], - $values['failed_jobs'] - ); - } - - /** - * Increment the total number of failed jobs for the batch. - * - * @param string $batchId - * @param string $jobId - * @return \Illuminate\Bus\UpdatedBatchJobCounts - */ - public function incrementFailedJobs(string $batchId, string $jobId) - { - $values = $this->updateAtomicValues($batchId, function ($batch) use ($jobId) { - return [ - 'pending_jobs' => $batch->pending_jobs, - 'failed_jobs' => $batch->failed_jobs + 1, - 'failed_job_ids' => json_encode(array_values(array_unique(array_merge(json_decode($batch->failed_job_ids, true), [$jobId])))), - ]; - }); - - return new UpdatedBatchJobCounts( - $values['pending_jobs'], - $values['failed_jobs'] - ); - } - - /** - * Update an atomic value within the batch. - * - * @param string $batchId - * @param \Closure $callback - * @return int|null - */ - protected function updateAtomicValues(string $batchId, Closure $callback) - { - return $this->connection->transaction(function () use ($batchId, $callback) { - $batch = $this->connection->table($this->table)->where('id', $batchId) - ->lockForUpdate() - ->first(); - - return is_null($batch) ? [] : tap($callback($batch), function ($values) use ($batchId) { - $this->connection->table($this->table)->where('id', $batchId)->update($values); - }); - }); - } - - /** - * Mark the batch that has the given ID as finished. - * - * @param string $batchId - * @return void - */ - public function markAsFinished(string $batchId) - { - $this->connection->table($this->table)->where('id', $batchId)->update([ - 'finished_at' => time(), - ]); - } - - /** - * Cancel the batch that has the given ID. - * - * @param string $batchId - * @return void - */ - public function cancel(string $batchId) - { - $this->connection->table($this->table)->where('id', $batchId)->update([ - 'cancelled_at' => time(), - 'finished_at' => time(), - ]); - } - - /** - * Delete the batch that has the given ID. - * - * @param string $batchId - * @return void - */ - public function delete(string $batchId) - { - $this->connection->table($this->table)->where('id', $batchId)->delete(); - } - - /** - * Prune all of the entries older than the given date. - * - * @param \DateTimeInterface $before - * @return int - */ - public function prune(DateTimeInterface $before) - { - $query = $this->connection->table($this->table) - ->whereNotNull('finished_at') - ->where('finished_at', '<', $before->getTimestamp()); - - $totalDeleted = 0; - - do { - $deleted = $query->take(1000)->delete(); - - $totalDeleted += $deleted; - } while ($deleted !== 0); - - return $totalDeleted; - } - - /** - * Prune all of the unfinished entries older than the given date. - * - * @param \DateTimeInterface $before - * @return int - */ - public function pruneUnfinished(DateTimeInterface $before) - { - $query = $this->connection->table($this->table) - ->whereNull('finished_at') - ->where('created_at', '<', $before->getTimestamp()); - - $totalDeleted = 0; - - do { - $deleted = $query->take(1000)->delete(); - - $totalDeleted += $deleted; - } while ($deleted !== 0); - - return $totalDeleted; - } - - /** - * Prune all of the cancelled entries older than the given date. - * - * @param \DateTimeInterface $before - * @return int - */ - public function pruneCancelled(DateTimeInterface $before) - { - $query = $this->connection->table($this->table) - ->whereNotNull('cancelled_at') - ->where('created_at', '<', $before->getTimestamp()); - - $totalDeleted = 0; - - do { - $deleted = $query->take(1000)->delete(); - - $totalDeleted += $deleted; - } while ($deleted !== 0); - - return $totalDeleted; - } - - /** - * Execute the given Closure within a storage specific transaction. - * - * @param \Closure $callback - * @return mixed - */ - public function transaction(Closure $callback) - { - return $this->connection->transaction(fn () => $callback()); - } - - /** - * Serialize the given value. - * - * @param mixed $value - * @return string - */ - protected function serialize($value) - { - $serialized = serialize($value); - - return $this->connection instanceof PostgresConnection - ? base64_encode($serialized) - : $serialized; - } - - /** - * Unserialize the given value. - * - * @param string $serialized - * @return mixed - */ - protected function unserialize($serialized) - { - if ($this->connection instanceof PostgresConnection && - ! Str::contains($serialized, [':', ';'])) { - $serialized = base64_decode($serialized); - } - - return unserialize($serialized); - } - - /** - * Convert the given raw batch to a Batch object. - * - * @param object $batch - * @return \Illuminate\Bus\Batch - */ - protected function toBatch($batch) - { - return $this->factory->make( - $this, - $batch->id, - $batch->name, - (int) $batch->total_jobs, - (int) $batch->pending_jobs, - (int) $batch->failed_jobs, - json_decode($batch->failed_job_ids, true), - $this->unserialize($batch->options), - CarbonImmutable::createFromTimestamp($batch->created_at), - $batch->cancelled_at ? CarbonImmutable::createFromTimestamp($batch->cancelled_at) : $batch->cancelled_at, - $batch->finished_at ? CarbonImmutable::createFromTimestamp($batch->finished_at) : $batch->finished_at - ); - } - - /** - * Get the underlying database connection. - * - * @return \Illuminate\Database\Connection - */ - public function getConnection() - { - return $this->connection; - } - - /** - * Set the underlying database connection. - * - * @param \Illuminate\Database\Connection $connection - * @return void - */ - public function setConnection(Connection $connection) - { - $this->connection = $connection; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php b/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php deleted file mode 100644 index 4dc390e6..00000000 --- a/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php +++ /dev/null @@ -1,295 +0,0 @@ -container = $container; - $this->queueResolver = $queueResolver; - $this->pipeline = new Pipeline($container); - } - - /** - * Dispatch a command to its appropriate handler. - * - * @param mixed $command - * @return mixed - */ - public function dispatch($command) - { - return $this->queueResolver && $this->commandShouldBeQueued($command) - ? $this->dispatchToQueue($command) - : $this->dispatchNow($command); - } - - /** - * Dispatch a command to its appropriate handler in the current process. - * - * Queueable jobs will be dispatched to the "sync" queue. - * - * @param mixed $command - * @param mixed $handler - * @return mixed - */ - public function dispatchSync($command, $handler = null) - { - if ($this->queueResolver && - $this->commandShouldBeQueued($command) && - method_exists($command, 'onConnection')) { - return $this->dispatchToQueue($command->onConnection('sync')); - } - - return $this->dispatchNow($command, $handler); - } - - /** - * Dispatch a command to its appropriate handler in the current process without using the synchronous queue. - * - * @param mixed $command - * @param mixed $handler - * @return mixed - */ - public function dispatchNow($command, $handler = null) - { - $uses = class_uses_recursive($command); - - if (in_array(InteractsWithQueue::class, $uses) && - in_array(Queueable::class, $uses) && - ! $command->job) { - $command->setJob(new SyncJob($this->container, json_encode([]), 'sync', 'sync')); - } - - if ($handler || $handler = $this->getCommandHandler($command)) { - $callback = function ($command) use ($handler) { - $method = method_exists($handler, 'handle') ? 'handle' : '__invoke'; - - return $handler->{$method}($command); - }; - } else { - $callback = function ($command) { - $method = method_exists($command, 'handle') ? 'handle' : '__invoke'; - - return $this->container->call([$command, $method]); - }; - } - - return $this->pipeline->send($command)->through($this->pipes)->then($callback); - } - - /** - * Attempt to find the batch with the given ID. - * - * @param string $batchId - * @return \Illuminate\Bus\Batch|null - */ - public function findBatch(string $batchId) - { - return $this->container->make(BatchRepository::class)->find($batchId); - } - - /** - * Create a new batch of queueable jobs. - * - * @param \Illuminate\Support\Collection|array|mixed $jobs - * @return \Illuminate\Bus\PendingBatch - */ - public function batch($jobs) - { - return new PendingBatch($this->container, Collection::wrap($jobs)); - } - - /** - * Create a new chain of queueable jobs. - * - * @param \Illuminate\Support\Collection|array $jobs - * @return \Illuminate\Foundation\Bus\PendingChain - */ - public function chain($jobs) - { - $jobs = Collection::wrap($jobs); - - return new PendingChain($jobs->shift(), $jobs->toArray()); - } - - /** - * Determine if the given command has a handler. - * - * @param mixed $command - * @return bool - */ - public function hasCommandHandler($command) - { - return array_key_exists(get_class($command), $this->handlers); - } - - /** - * Retrieve the handler for a command. - * - * @param mixed $command - * @return bool|mixed - */ - public function getCommandHandler($command) - { - if ($this->hasCommandHandler($command)) { - return $this->container->make($this->handlers[get_class($command)]); - } - - return false; - } - - /** - * Determine if the given command should be queued. - * - * @param mixed $command - * @return bool - */ - protected function commandShouldBeQueued($command) - { - return $command instanceof ShouldQueue; - } - - /** - * Dispatch a command to its appropriate handler behind a queue. - * - * @param mixed $command - * @return mixed - * - * @throws \RuntimeException - */ - public function dispatchToQueue($command) - { - $connection = $command->connection ?? null; - - $queue = call_user_func($this->queueResolver, $connection); - - if (! $queue instanceof Queue) { - throw new RuntimeException('Queue resolver did not return a Queue implementation.'); - } - - if (method_exists($command, 'queue')) { - return $command->queue($queue, $command); - } - - return $this->pushCommandToQueue($queue, $command); - } - - /** - * Push the command onto the given queue instance. - * - * @param \Illuminate\Contracts\Queue\Queue $queue - * @param mixed $command - * @return mixed - */ - protected function pushCommandToQueue($queue, $command) - { - if (isset($command->queue, $command->delay)) { - return $queue->laterOn($command->queue, $command->delay, $command); - } - - if (isset($command->queue)) { - return $queue->pushOn($command->queue, $command); - } - - if (isset($command->delay)) { - return $queue->later($command->delay, $command); - } - - return $queue->push($command); - } - - /** - * Dispatch a command to its appropriate handler after the current process. - * - * @param mixed $command - * @param mixed $handler - * @return void - */ - public function dispatchAfterResponse($command, $handler = null) - { - $this->container->terminating(function () use ($command, $handler) { - $this->dispatchNow($command, $handler); - }); - } - - /** - * Set the pipes through which commands should be piped before dispatching. - * - * @param array $pipes - * @return $this - */ - public function pipeThrough(array $pipes) - { - $this->pipes = $pipes; - - return $this; - } - - /** - * Map a command to a handler. - * - * @param array $map - * @return $this - */ - public function map(array $map) - { - $this->handlers = array_merge($this->handlers, $map); - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Bus/Events/BatchDispatched.php b/vendor/laravel/framework/src/Illuminate/Bus/Events/BatchDispatched.php deleted file mode 100644 index b9a161ad..00000000 --- a/vendor/laravel/framework/src/Illuminate/Bus/Events/BatchDispatched.php +++ /dev/null @@ -1,26 +0,0 @@ -batch = $batch; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Bus/LICENSE.md b/vendor/laravel/framework/src/Illuminate/Bus/LICENSE.md deleted file mode 100644 index 79810c84..00000000 --- a/vendor/laravel/framework/src/Illuminate/Bus/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Taylor Otwell - -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/laravel/framework/src/Illuminate/Bus/PendingBatch.php b/vendor/laravel/framework/src/Illuminate/Bus/PendingBatch.php deleted file mode 100644 index 6cd51831..00000000 --- a/vendor/laravel/framework/src/Illuminate/Bus/PendingBatch.php +++ /dev/null @@ -1,319 +0,0 @@ -container = $container; - $this->jobs = $jobs; - } - - /** - * Add jobs to the batch. - * - * @param iterable|object|array $jobs - * @return $this - */ - public function add($jobs) - { - $jobs = is_iterable($jobs) ? $jobs : Arr::wrap($jobs); - - foreach ($jobs as $job) { - $this->jobs->push($job); - } - - return $this; - } - - /** - * Add a callback to be executed after all jobs in the batch have executed successfully. - * - * @param callable $callback - * @return $this - */ - public function then($callback) - { - $this->options['then'][] = $callback instanceof Closure - ? new SerializableClosure($callback) - : $callback; - - return $this; - } - - /** - * Get the "then" callbacks that have been registered with the pending batch. - * - * @return array - */ - public function thenCallbacks() - { - return $this->options['then'] ?? []; - } - - /** - * Add a callback to be executed after the first failing job in the batch. - * - * @param callable $callback - * @return $this - */ - public function catch($callback) - { - $this->options['catch'][] = $callback instanceof Closure - ? new SerializableClosure($callback) - : $callback; - - return $this; - } - - /** - * Get the "catch" callbacks that have been registered with the pending batch. - * - * @return array - */ - public function catchCallbacks() - { - return $this->options['catch'] ?? []; - } - - /** - * Add a callback to be executed after the batch has finished executing. - * - * @param callable $callback - * @return $this - */ - public function finally($callback) - { - $this->options['finally'][] = $callback instanceof Closure - ? new SerializableClosure($callback) - : $callback; - - return $this; - } - - /** - * Get the "finally" callbacks that have been registered with the pending batch. - * - * @return array - */ - public function finallyCallbacks() - { - return $this->options['finally'] ?? []; - } - - /** - * Indicate that the batch should not be cancelled when a job within the batch fails. - * - * @param bool $allowFailures - * @return $this - */ - public function allowFailures($allowFailures = true) - { - $this->options['allowFailures'] = $allowFailures; - - return $this; - } - - /** - * Determine if the pending batch allows jobs to fail without cancelling the batch. - * - * @return bool - */ - public function allowsFailures() - { - return Arr::get($this->options, 'allowFailures', false) === true; - } - - /** - * Set the name for the batch. - * - * @param string $name - * @return $this - */ - public function name(string $name) - { - $this->name = $name; - - return $this; - } - - /** - * Specify the queue connection that the batched jobs should run on. - * - * @param string $connection - * @return $this - */ - public function onConnection(string $connection) - { - $this->options['connection'] = $connection; - - return $this; - } - - /** - * Get the connection used by the pending batch. - * - * @return string|null - */ - public function connection() - { - return $this->options['connection'] ?? null; - } - - /** - * Specify the queue that the batched jobs should run on. - * - * @param string $queue - * @return $this - */ - public function onQueue(string $queue) - { - $this->options['queue'] = $queue; - - return $this; - } - - /** - * Get the queue used by the pending batch. - * - * @return string|null - */ - public function queue() - { - return $this->options['queue'] ?? null; - } - - /** - * Add additional data into the batch's options array. - * - * @param string $key - * @param mixed $value - * @return $this - */ - public function withOption(string $key, $value) - { - $this->options[$key] = $value; - - return $this; - } - - /** - * Dispatch the batch. - * - * @return \Illuminate\Bus\Batch - * - * @throws \Throwable - */ - public function dispatch() - { - $repository = $this->container->make(BatchRepository::class); - - try { - $batch = $repository->store($this); - - $batch = $batch->add($this->jobs); - } catch (Throwable $e) { - if (isset($batch)) { - $repository->delete($batch->id); - } - - throw $e; - } - - $this->container->make(EventDispatcher::class)->dispatch( - new BatchDispatched($batch) - ); - - return $batch; - } - - /** - * Dispatch the batch after the response is sent to the browser. - * - * @return \Illuminate\Bus\Batch - */ - public function dispatchAfterResponse() - { - $repository = $this->container->make(BatchRepository::class); - - $batch = $repository->store($this); - - if ($batch) { - $this->container->terminating(function () use ($batch) { - $this->dispatchExistingBatch($batch); - }); - } - - return $batch; - } - - /** - * Dispatch an existing batch. - * - * @param \Illuminate\Bus\Batch $batch - * @return void - * - * @throws \Throwable - */ - protected function dispatchExistingBatch($batch) - { - try { - $batch = $batch->add($this->jobs); - } catch (Throwable $e) { - if (isset($batch)) { - $batch->delete(); - } - - throw $e; - } - - $this->container->make(EventDispatcher::class)->dispatch( - new BatchDispatched($batch) - ); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Bus/PrunableBatchRepository.php b/vendor/laravel/framework/src/Illuminate/Bus/PrunableBatchRepository.php deleted file mode 100644 index 3f972553..00000000 --- a/vendor/laravel/framework/src/Illuminate/Bus/PrunableBatchRepository.php +++ /dev/null @@ -1,16 +0,0 @@ -connection = $connection; - - return $this; - } - - /** - * Set the desired queue for the job. - * - * @param string|null $queue - * @return $this - */ - public function onQueue($queue) - { - $this->queue = $queue; - - return $this; - } - - /** - * Set the desired connection for the chain. - * - * @param string|null $connection - * @return $this - */ - public function allOnConnection($connection) - { - $this->chainConnection = $connection; - $this->connection = $connection; - - return $this; - } - - /** - * Set the desired queue for the chain. - * - * @param string|null $queue - * @return $this - */ - public function allOnQueue($queue) - { - $this->chainQueue = $queue; - $this->queue = $queue; - - return $this; - } - - /** - * Set the desired delay in seconds for the job. - * - * @param \DateTimeInterface|\DateInterval|array|int|null $delay - * @return $this - */ - public function delay($delay) - { - $this->delay = $delay; - - return $this; - } - - /** - * Indicate that the job should be dispatched after all database transactions have committed. - * - * @return $this - */ - public function afterCommit() - { - $this->afterCommit = true; - - return $this; - } - - /** - * Indicate that the job should not wait until database transactions have been committed before dispatching. - * - * @return $this - */ - public function beforeCommit() - { - $this->afterCommit = false; - - return $this; - } - - /** - * Specify the middleware the job should be dispatched through. - * - * @param array|object $middleware - * @return $this - */ - public function through($middleware) - { - $this->middleware = Arr::wrap($middleware); - - return $this; - } - - /** - * Set the jobs that should run if this job is successful. - * - * @param array $chain - * @return $this - */ - public function chain($chain) - { - $this->chained = collect($chain)->map(function ($job) { - return $this->serializeJob($job); - })->all(); - - return $this; - } - - /** - * Prepend a job to the current chain so that it is run after the currently running job. - * - * @param mixed $job - * @return $this - */ - public function prependToChain($job) - { - $this->chained = Arr::prepend($this->chained, $this->serializeJob($job)); - - return $this; - } - - /** - * Append a job to the end of the current chain. - * - * @param mixed $job - * @return $this - */ - public function appendToChain($job) - { - $this->chained = array_merge($this->chained, [$this->serializeJob($job)]); - - return $this; - } - - /** - * Serialize a job for queuing. - * - * @param mixed $job - * @return string - * - * @throws \RuntimeException - */ - protected function serializeJob($job) - { - if ($job instanceof Closure) { - if (! class_exists(CallQueuedClosure::class)) { - throw new RuntimeException( - 'To enable support for closure jobs, please install the illuminate/queue package.' - ); - } - - $job = CallQueuedClosure::create($job); - } - - return serialize($job); - } - - /** - * Dispatch the next job on the chain. - * - * @return void - */ - public function dispatchNextJobInChain() - { - if (! empty($this->chained)) { - dispatch(tap(unserialize(array_shift($this->chained)), function ($next) { - $next->chained = $this->chained; - - $next->onConnection($next->connection ?: $this->chainConnection); - $next->onQueue($next->queue ?: $this->chainQueue); - - $next->chainConnection = $this->chainConnection; - $next->chainQueue = $this->chainQueue; - $next->chainCatchCallbacks = $this->chainCatchCallbacks; - })); - } - } - - /** - * Invoke all of the chain's failed job callbacks. - * - * @param \Throwable $e - * @return void - */ - public function invokeChainCatchCallbacks($e) - { - collect($this->chainCatchCallbacks)->each(function ($callback) use ($e) { - $callback($e); - }); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Bus/UniqueLock.php b/vendor/laravel/framework/src/Illuminate/Bus/UniqueLock.php deleted file mode 100644 index a4066b77..00000000 --- a/vendor/laravel/framework/src/Illuminate/Bus/UniqueLock.php +++ /dev/null @@ -1,75 +0,0 @@ -cache = $cache; - } - - /** - * Attempt to acquire a lock for the given job. - * - * @param mixed $job - * @return bool - */ - public function acquire($job) - { - $uniqueFor = method_exists($job, 'uniqueFor') - ? $job->uniqueFor() - : ($job->uniqueFor ?? 0); - - $cache = method_exists($job, 'uniqueVia') - ? $job->uniqueVia() - : $this->cache; - - return (bool) $cache->lock($this->getKey($job), $uniqueFor)->get(); - } - - /** - * Release the lock for the given job. - * - * @param mixed $job - * @return void - */ - public function release($job) - { - $cache = method_exists($job, 'uniqueVia') - ? $job->uniqueVia() - : $this->cache; - - $cache->lock($this->getKey($job))->forceRelease(); - } - - /** - * Generate the lock key for the given job. - * - * @param mixed $job - * @return string - */ - protected function getKey($job) - { - $uniqueId = method_exists($job, 'uniqueId') - ? $job->uniqueId() - : ($job->uniqueId ?? ''); - - return 'laravel_unique_job:'.get_class($job).$uniqueId; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Bus/UpdatedBatchJobCounts.php b/vendor/laravel/framework/src/Illuminate/Bus/UpdatedBatchJobCounts.php deleted file mode 100644 index 83d33a44..00000000 --- a/vendor/laravel/framework/src/Illuminate/Bus/UpdatedBatchJobCounts.php +++ /dev/null @@ -1,43 +0,0 @@ -pendingJobs = $pendingJobs; - $this->failedJobs = $failedJobs; - } - - /** - * Determine if all jobs have run exactly once. - * - * @return bool - */ - public function allJobsHaveRanExactlyOnce() - { - return ($this->pendingJobs - $this->failedJobs) === 0; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Bus/composer.json b/vendor/laravel/framework/src/Illuminate/Bus/composer.json deleted file mode 100644 index 44e795a4..00000000 --- a/vendor/laravel/framework/src/Illuminate/Bus/composer.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "illuminate/bus", - "description": "The Illuminate Bus package.", - "license": "MIT", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "require": { - "php": "^8.0.2", - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/pipeline": "^9.0", - "illuminate/support": "^9.0" - }, - "autoload": { - "psr-4": { - "Illuminate\\Bus\\": "" - } - }, - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "suggest": { - "illuminate/queue": "Required to use closures when chaining jobs (^7.0)." - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev" -} diff --git a/vendor/laravel/framework/src/Illuminate/Cache/ApcStore.php b/vendor/laravel/framework/src/Illuminate/Cache/ApcStore.php deleted file mode 100755 index 90132c16..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/ApcStore.php +++ /dev/null @@ -1,130 +0,0 @@ -apc = $apc; - $this->prefix = $prefix; - } - - /** - * Retrieve an item from the cache by key. - * - * @param string|array $key - * @return mixed - */ - public function get($key) - { - $value = $this->apc->get($this->prefix.$key); - - if ($value !== false) { - return $value; - } - } - - /** - * Store an item in the cache for a given number of seconds. - * - * @param string $key - * @param mixed $value - * @param int $seconds - * @return bool - */ - public function put($key, $value, $seconds) - { - return $this->apc->put($this->prefix.$key, $value, $seconds); - } - - /** - * Increment the value of an item in the cache. - * - * @param string $key - * @param mixed $value - * @return int|bool - */ - public function increment($key, $value = 1) - { - return $this->apc->increment($this->prefix.$key, $value); - } - - /** - * Decrement the value of an item in the cache. - * - * @param string $key - * @param mixed $value - * @return int|bool - */ - public function decrement($key, $value = 1) - { - return $this->apc->decrement($this->prefix.$key, $value); - } - - /** - * Store an item in the cache indefinitely. - * - * @param string $key - * @param mixed $value - * @return bool - */ - public function forever($key, $value) - { - return $this->put($key, $value, 0); - } - - /** - * Remove an item from the cache. - * - * @param string $key - * @return bool - */ - public function forget($key) - { - return $this->apc->delete($this->prefix.$key); - } - - /** - * Remove all items from the cache. - * - * @return bool - */ - public function flush() - { - return $this->apc->flush(); - } - - /** - * Get the cache key prefix. - * - * @return string - */ - public function getPrefix() - { - return $this->prefix; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cache/ApcWrapper.php b/vendor/laravel/framework/src/Illuminate/Cache/ApcWrapper.php deleted file mode 100755 index 6c129c63..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/ApcWrapper.php +++ /dev/null @@ -1,92 +0,0 @@ -apcu = function_exists('apcu_fetch'); - } - - /** - * Get an item from the cache. - * - * @param string $key - * @return mixed - */ - public function get($key) - { - return $this->apcu ? apcu_fetch($key) : apc_fetch($key); - } - - /** - * Store an item in the cache. - * - * @param string $key - * @param mixed $value - * @param int $seconds - * @return array|bool - */ - public function put($key, $value, $seconds) - { - return $this->apcu ? apcu_store($key, $value, $seconds) : apc_store($key, $value, $seconds); - } - - /** - * Increment the value of an item in the cache. - * - * @param string $key - * @param mixed $value - * @return int|bool - */ - public function increment($key, $value) - { - return $this->apcu ? apcu_inc($key, $value) : apc_inc($key, $value); - } - - /** - * Decrement the value of an item in the cache. - * - * @param string $key - * @param mixed $value - * @return int|bool - */ - public function decrement($key, $value) - { - return $this->apcu ? apcu_dec($key, $value) : apc_dec($key, $value); - } - - /** - * Remove an item from the cache. - * - * @param string $key - * @return bool - */ - public function delete($key) - { - return $this->apcu ? apcu_delete($key) : apc_delete($key); - } - - /** - * Remove all items from the cache. - * - * @return bool - */ - public function flush() - { - return $this->apcu ? apcu_clear_cache() : apc_clear_cache('user'); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cache/ArrayLock.php b/vendor/laravel/framework/src/Illuminate/Cache/ArrayLock.php deleted file mode 100644 index 4c20783b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/ArrayLock.php +++ /dev/null @@ -1,102 +0,0 @@ -store = $store; - } - - /** - * Attempt to acquire the lock. - * - * @return bool - */ - public function acquire() - { - $expiration = $this->store->locks[$this->name]['expiresAt'] ?? Carbon::now()->addSecond(); - - if ($this->exists() && $expiration->isFuture()) { - return false; - } - - $this->store->locks[$this->name] = [ - 'owner' => $this->owner, - 'expiresAt' => $this->seconds === 0 ? null : Carbon::now()->addSeconds($this->seconds), - ]; - - return true; - } - - /** - * Determine if the current lock exists. - * - * @return bool - */ - protected function exists() - { - return isset($this->store->locks[$this->name]); - } - - /** - * Release the lock. - * - * @return bool - */ - public function release() - { - if (! $this->exists()) { - return false; - } - - if (! $this->isOwnedByCurrentProcess()) { - return false; - } - - $this->forceRelease(); - - return true; - } - - /** - * Returns the owner value written into the driver for this lock. - * - * @return string - */ - protected function getCurrentOwner() - { - return $this->store->locks[$this->name]['owner']; - } - - /** - * Releases this lock in disregard of ownership. - * - * @return void - */ - public function forceRelease() - { - unset($this->store->locks[$this->name]); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cache/ArrayStore.php b/vendor/laravel/framework/src/Illuminate/Cache/ArrayStore.php deleted file mode 100644 index 22b42ba5..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/ArrayStore.php +++ /dev/null @@ -1,218 +0,0 @@ -serializesValues = $serializesValues; - } - - /** - * Retrieve an item from the cache by key. - * - * @param string|array $key - * @return mixed - */ - public function get($key) - { - if (! isset($this->storage[$key])) { - return; - } - - $item = $this->storage[$key]; - - $expiresAt = $item['expiresAt'] ?? 0; - - if ($expiresAt !== 0 && $this->currentTime() > $expiresAt) { - $this->forget($key); - - return; - } - - return $this->serializesValues ? unserialize($item['value']) : $item['value']; - } - - /** - * Store an item in the cache for a given number of seconds. - * - * @param string $key - * @param mixed $value - * @param int $seconds - * @return bool - */ - public function put($key, $value, $seconds) - { - $this->storage[$key] = [ - 'value' => $this->serializesValues ? serialize($value) : $value, - 'expiresAt' => $this->calculateExpiration($seconds), - ]; - - return true; - } - - /** - * Increment the value of an item in the cache. - * - * @param string $key - * @param mixed $value - * @return int - */ - public function increment($key, $value = 1) - { - if (! is_null($existing = $this->get($key))) { - return tap(((int) $existing) + $value, function ($incremented) use ($key) { - $value = $this->serializesValues ? serialize($incremented) : $incremented; - - $this->storage[$key]['value'] = $value; - }); - } - - $this->forever($key, $value); - - return $value; - } - - /** - * Decrement the value of an item in the cache. - * - * @param string $key - * @param mixed $value - * @return int - */ - public function decrement($key, $value = 1) - { - return $this->increment($key, $value * -1); - } - - /** - * Store an item in the cache indefinitely. - * - * @param string $key - * @param mixed $value - * @return bool - */ - public function forever($key, $value) - { - return $this->put($key, $value, 0); - } - - /** - * Remove an item from the cache. - * - * @param string $key - * @return bool - */ - public function forget($key) - { - if (array_key_exists($key, $this->storage)) { - unset($this->storage[$key]); - - return true; - } - - return false; - } - - /** - * Remove all items from the cache. - * - * @return bool - */ - public function flush() - { - $this->storage = []; - - return true; - } - - /** - * Get the cache key prefix. - * - * @return string - */ - public function getPrefix() - { - return ''; - } - - /** - * Get the expiration time of the key. - * - * @param int $seconds - * @return int - */ - protected function calculateExpiration($seconds) - { - return $this->toTimestamp($seconds); - } - - /** - * Get the UNIX timestamp for the given number of seconds. - * - * @param int $seconds - * @return int - */ - protected function toTimestamp($seconds) - { - return $seconds > 0 ? $this->availableAt($seconds) : 0; - } - - /** - * Get a lock instance. - * - * @param string $name - * @param int $seconds - * @param string|null $owner - * @return \Illuminate\Contracts\Cache\Lock - */ - public function lock($name, $seconds = 0, $owner = null) - { - return new ArrayLock($this, $name, $seconds, $owner); - } - - /** - * Restore a lock instance using the owner identifier. - * - * @param string $name - * @param string $owner - * @return \Illuminate\Contracts\Cache\Lock - */ - public function restoreLock($name, $owner) - { - return $this->lock($name, 0, $owner); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cache/CacheLock.php b/vendor/laravel/framework/src/Illuminate/Cache/CacheLock.php deleted file mode 100644 index 5cc4eeaf..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/CacheLock.php +++ /dev/null @@ -1,85 +0,0 @@ -store = $store; - } - - /** - * Attempt to acquire the lock. - * - * @return bool - */ - public function acquire() - { - if (method_exists($this->store, 'add') && $this->seconds > 0) { - return $this->store->add( - $this->name, $this->owner, $this->seconds - ); - } - - if (! is_null($this->store->get($this->name))) { - return false; - } - - return ($this->seconds > 0) - ? $this->store->put($this->name, $this->owner, $this->seconds) - : $this->store->forever($this->name, $this->owner); - } - - /** - * Release the lock. - * - * @return bool - */ - public function release() - { - if ($this->isOwnedByCurrentProcess()) { - return $this->store->forget($this->name); - } - - return false; - } - - /** - * Releases this lock regardless of ownership. - * - * @return void - */ - public function forceRelease() - { - $this->store->forget($this->name); - } - - /** - * Returns the owner value written into the driver for this lock. - * - * @return mixed - */ - protected function getCurrentOwner() - { - return $this->store->get($this->name); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php b/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php deleted file mode 100755 index d945db96..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php +++ /dev/null @@ -1,421 +0,0 @@ -app = $app; - } - - /** - * Get a cache store instance by name, wrapped in a repository. - * - * @param string|null $name - * @return \Illuminate\Contracts\Cache\Repository - */ - public function store($name = null) - { - $name = $name ?: $this->getDefaultDriver(); - - return $this->stores[$name] = $this->get($name); - } - - /** - * Get a cache driver instance. - * - * @param string|null $driver - * @return \Illuminate\Contracts\Cache\Repository - */ - public function driver($driver = null) - { - return $this->store($driver); - } - - /** - * Attempt to get the store from the local cache. - * - * @param string $name - * @return \Illuminate\Contracts\Cache\Repository - */ - protected function get($name) - { - return $this->stores[$name] ?? $this->resolve($name); - } - - /** - * Resolve the given store. - * - * @param string $name - * @return \Illuminate\Contracts\Cache\Repository - * - * @throws \InvalidArgumentException - */ - protected function resolve($name) - { - $config = $this->getConfig($name); - - if (is_null($config)) { - throw new InvalidArgumentException("Cache store [{$name}] is not defined."); - } - - if (isset($this->customCreators[$config['driver']])) { - return $this->callCustomCreator($config); - } else { - $driverMethod = 'create'.ucfirst($config['driver']).'Driver'; - - if (method_exists($this, $driverMethod)) { - return $this->{$driverMethod}($config); - } else { - throw new InvalidArgumentException("Driver [{$config['driver']}] is not supported."); - } - } - } - - /** - * Call a custom driver creator. - * - * @param array $config - * @return mixed - */ - protected function callCustomCreator(array $config) - { - return $this->customCreators[$config['driver']]($this->app, $config); - } - - /** - * Create an instance of the APC cache driver. - * - * @param array $config - * @return \Illuminate\Cache\Repository - */ - protected function createApcDriver(array $config) - { - $prefix = $this->getPrefix($config); - - return $this->repository(new ApcStore(new ApcWrapper, $prefix)); - } - - /** - * Create an instance of the array cache driver. - * - * @param array $config - * @return \Illuminate\Cache\Repository - */ - protected function createArrayDriver(array $config) - { - return $this->repository(new ArrayStore($config['serialize'] ?? false)); - } - - /** - * Create an instance of the file cache driver. - * - * @param array $config - * @return \Illuminate\Cache\Repository - */ - protected function createFileDriver(array $config) - { - return $this->repository(new FileStore($this->app['files'], $config['path'], $config['permission'] ?? null)); - } - - /** - * Create an instance of the Memcached cache driver. - * - * @param array $config - * @return \Illuminate\Cache\Repository - */ - protected function createMemcachedDriver(array $config) - { - $prefix = $this->getPrefix($config); - - $memcached = $this->app['memcached.connector']->connect( - $config['servers'], - $config['persistent_id'] ?? null, - $config['options'] ?? [], - array_filter($config['sasl'] ?? []) - ); - - return $this->repository(new MemcachedStore($memcached, $prefix)); - } - - /** - * Create an instance of the Null cache driver. - * - * @return \Illuminate\Cache\Repository - */ - protected function createNullDriver() - { - return $this->repository(new NullStore); - } - - /** - * Create an instance of the Redis cache driver. - * - * @param array $config - * @return \Illuminate\Cache\Repository - */ - protected function createRedisDriver(array $config) - { - $redis = $this->app['redis']; - - $connection = $config['connection'] ?? 'default'; - - $store = new RedisStore($redis, $this->getPrefix($config), $connection); - - return $this->repository( - $store->setLockConnection($config['lock_connection'] ?? $connection) - ); - } - - /** - * Create an instance of the database cache driver. - * - * @param array $config - * @return \Illuminate\Cache\Repository - */ - protected function createDatabaseDriver(array $config) - { - $connection = $this->app['db']->connection($config['connection'] ?? null); - - $store = new DatabaseStore( - $connection, - $config['table'], - $this->getPrefix($config), - $config['lock_table'] ?? 'cache_locks', - $config['lock_lottery'] ?? [2, 100] - ); - - return $this->repository($store->setLockConnection( - $this->app['db']->connection($config['lock_connection'] ?? $config['connection'] ?? null) - )); - } - - /** - * Create an instance of the DynamoDB cache driver. - * - * @param array $config - * @return \Illuminate\Cache\Repository - */ - protected function createDynamodbDriver(array $config) - { - $client = $this->newDynamodbClient($config); - - return $this->repository( - new DynamoDbStore( - $client, - $config['table'], - $config['attributes']['key'] ?? 'key', - $config['attributes']['value'] ?? 'value', - $config['attributes']['expiration'] ?? 'expires_at', - $this->getPrefix($config) - ) - ); - } - - /** - * Create new DynamoDb Client instance. - * - * @return \Aws\DynamoDb\DynamoDbClient - */ - protected function newDynamodbClient(array $config) - { - $dynamoConfig = [ - 'region' => $config['region'], - 'version' => 'latest', - 'endpoint' => $config['endpoint'] ?? null, - ]; - - if (isset($config['key'], $config['secret'])) { - $dynamoConfig['credentials'] = Arr::only( - $config, ['key', 'secret', 'token'] - ); - } - - return new DynamoDbClient($dynamoConfig); - } - - /** - * Create a new cache repository with the given implementation. - * - * @param \Illuminate\Contracts\Cache\Store $store - * @return \Illuminate\Cache\Repository - */ - public function repository(Store $store) - { - return tap(new Repository($store), function ($repository) { - $this->setEventDispatcher($repository); - }); - } - - /** - * Set the event dispatcher on the given repository instance. - * - * @param \Illuminate\Cache\Repository $repository - * @return void - */ - protected function setEventDispatcher(Repository $repository) - { - if (! $this->app->bound(DispatcherContract::class)) { - return; - } - - $repository->setEventDispatcher( - $this->app[DispatcherContract::class] - ); - } - - /** - * Re-set the event dispatcher on all resolved cache repositories. - * - * @return void - */ - public function refreshEventDispatcher() - { - array_map([$this, 'setEventDispatcher'], $this->stores); - } - - /** - * Get the cache prefix. - * - * @param array $config - * @return string - */ - protected function getPrefix(array $config) - { - return $config['prefix'] ?? $this->app['config']['cache.prefix']; - } - - /** - * Get the cache connection configuration. - * - * @param string $name - * @return array|null - */ - protected function getConfig($name) - { - if (! is_null($name) && $name !== 'null') { - return $this->app['config']["cache.stores.{$name}"]; - } - - return ['driver' => 'null']; - } - - /** - * Get the default cache driver name. - * - * @return string - */ - public function getDefaultDriver() - { - return $this->app['config']['cache.default']; - } - - /** - * Set the default cache driver name. - * - * @param string $name - * @return void - */ - public function setDefaultDriver($name) - { - $this->app['config']['cache.default'] = $name; - } - - /** - * Unset the given driver instances. - * - * @param array|string|null $name - * @return $this - */ - public function forgetDriver($name = null) - { - $name ??= $this->getDefaultDriver(); - - foreach ((array) $name as $cacheName) { - if (isset($this->stores[$cacheName])) { - unset($this->stores[$cacheName]); - } - } - - return $this; - } - - /** - * Disconnect the given driver and remove from local cache. - * - * @param string|null $name - * @return void - */ - public function purge($name = null) - { - $name ??= $this->getDefaultDriver(); - - unset($this->stores[$name]); - } - - /** - * Register a custom driver creator Closure. - * - * @param string $driver - * @param \Closure $callback - * @return $this - */ - public function extend($driver, Closure $callback) - { - $this->customCreators[$driver] = $callback->bindTo($this, $this); - - return $this; - } - - /** - * Dynamically call the default driver instance. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - return $this->store()->$method(...$parameters); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cache/CacheServiceProvider.php b/vendor/laravel/framework/src/Illuminate/Cache/CacheServiceProvider.php deleted file mode 100755 index 662d556a..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/CacheServiceProvider.php +++ /dev/null @@ -1,52 +0,0 @@ -app->singleton('cache', function ($app) { - return new CacheManager($app); - }); - - $this->app->singleton('cache.store', function ($app) { - return $app['cache']->driver(); - }); - - $this->app->singleton('cache.psr6', function ($app) { - return new Psr16Adapter($app['cache.store']); - }); - - $this->app->singleton('memcached.connector', function () { - return new MemcachedConnector; - }); - - $this->app->singleton(RateLimiter::class, function ($app) { - return new RateLimiter($app->make('cache')->driver( - $app['config']->get('cache.limiter') - )); - }); - } - - /** - * Get the services provided by the provider. - * - * @return array - */ - public function provides() - { - return [ - 'cache', 'cache.store', 'cache.psr6', 'memcached.connector', RateLimiter::class, - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cache/Console/CacheTableCommand.php b/vendor/laravel/framework/src/Illuminate/Cache/Console/CacheTableCommand.php deleted file mode 100644 index 19b591bd..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/Console/CacheTableCommand.php +++ /dev/null @@ -1,94 +0,0 @@ -files = $files; - $this->composer = $composer; - } - - /** - * Execute the console command. - * - * @return void - */ - public function handle() - { - $fullPath = $this->createBaseMigration(); - - $this->files->put($fullPath, $this->files->get(__DIR__.'/stubs/cache.stub')); - - $this->components->info('Migration created successfully.'); - - $this->composer->dumpAutoloads(); - } - - /** - * Create a base migration file for the table. - * - * @return string - */ - protected function createBaseMigration() - { - $name = 'create_cache_table'; - - $path = $this->laravel->databasePath().'/migrations'; - - return $this->laravel['migration.creator']->create($name, $path); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cache/Console/ClearCommand.php b/vendor/laravel/framework/src/Illuminate/Cache/Console/ClearCommand.php deleted file mode 100755 index 7d3336c7..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/Console/ClearCommand.php +++ /dev/null @@ -1,158 +0,0 @@ -cache = $cache; - $this->files = $files; - } - - /** - * Execute the console command. - * - * @return void - */ - public function handle() - { - $this->laravel['events']->dispatch( - 'cache:clearing', [$this->argument('store'), $this->tags()] - ); - - $successful = $this->cache()->flush(); - - $this->flushFacades(); - - if (! $successful) { - return $this->components->error('Failed to clear cache. Make sure you have the appropriate permissions.'); - } - - $this->laravel['events']->dispatch( - 'cache:cleared', [$this->argument('store'), $this->tags()] - ); - - $this->components->info('Application cache cleared successfully.'); - } - - /** - * Flush the real-time facades stored in the cache directory. - * - * @return void - */ - public function flushFacades() - { - if (! $this->files->exists($storagePath = storage_path('framework/cache'))) { - return; - } - - foreach ($this->files->files($storagePath) as $file) { - if (preg_match('/facade-.*\.php$/', $file)) { - $this->files->delete($file); - } - } - } - - /** - * Get the cache instance for the command. - * - * @return \Illuminate\Cache\Repository - */ - protected function cache() - { - $cache = $this->cache->store($this->argument('store')); - - return empty($this->tags()) ? $cache : $cache->tags($this->tags()); - } - - /** - * Get the tags passed to the command. - * - * @return array - */ - protected function tags() - { - return array_filter(explode(',', $this->option('tags') ?? '')); - } - - /** - * Get the console command arguments. - * - * @return array - */ - protected function getArguments() - { - return [ - ['store', InputArgument::OPTIONAL, 'The name of the store you would like to clear'], - ]; - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['tags', null, InputOption::VALUE_OPTIONAL, 'The cache tags you would like to clear', null], - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cache/Console/ForgetCommand.php b/vendor/laravel/framework/src/Illuminate/Cache/Console/ForgetCommand.php deleted file mode 100755 index c7fc830c..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/Console/ForgetCommand.php +++ /dev/null @@ -1,70 +0,0 @@ -cache = $cache; - } - - /** - * Execute the console command. - * - * @return void - */ - public function handle() - { - $this->cache->store($this->argument('store'))->forget( - $this->argument('key') - ); - - $this->components->info('The ['.$this->argument('key').'] key has been removed from the cache.'); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cache/Console/stubs/cache.stub b/vendor/laravel/framework/src/Illuminate/Cache/Console/stubs/cache.stub deleted file mode 100644 index eee35e94..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/Console/stubs/cache.stub +++ /dev/null @@ -1,39 +0,0 @@ -string('key')->primary(); - $table->mediumText('value'); - $table->integer('expiration'); - }); - - Schema::create('cache_locks', function (Blueprint $table) { - $table->string('key')->primary(); - $table->string('owner'); - $table->integer('expiration'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('cache'); - Schema::dropIfExists('cache_locks'); - } -}; diff --git a/vendor/laravel/framework/src/Illuminate/Cache/DatabaseLock.php b/vendor/laravel/framework/src/Illuminate/Cache/DatabaseLock.php deleted file mode 100644 index c8db07ac..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/DatabaseLock.php +++ /dev/null @@ -1,147 +0,0 @@ -connection = $connection; - $this->table = $table; - $this->lottery = $lottery; - } - - /** - * Attempt to acquire the lock. - * - * @return bool - */ - public function acquire() - { - try { - $this->connection->table($this->table)->insert([ - 'key' => $this->name, - 'owner' => $this->owner, - 'expiration' => $this->expiresAt(), - ]); - - $acquired = true; - } catch (QueryException $e) { - $updated = $this->connection->table($this->table) - ->where('key', $this->name) - ->where(function ($query) { - return $query->where('owner', $this->owner)->orWhere('expiration', '<=', time()); - })->update([ - 'owner' => $this->owner, - 'expiration' => $this->expiresAt(), - ]); - - $acquired = $updated >= 1; - } - - if (random_int(1, $this->lottery[1]) <= $this->lottery[0]) { - $this->connection->table($this->table)->where('expiration', '<=', time())->delete(); - } - - return $acquired; - } - - /** - * Get the UNIX timestamp indicating when the lock should expire. - * - * @return int - */ - protected function expiresAt() - { - return $this->seconds > 0 ? time() + $this->seconds : Carbon::now()->addDays(1)->getTimestamp(); - } - - /** - * Release the lock. - * - * @return bool - */ - public function release() - { - if ($this->isOwnedByCurrentProcess()) { - $this->connection->table($this->table) - ->where('key', $this->name) - ->where('owner', $this->owner) - ->delete(); - - return true; - } - - return false; - } - - /** - * Releases this lock in disregard of ownership. - * - * @return void - */ - public function forceRelease() - { - $this->connection->table($this->table) - ->where('key', $this->name) - ->delete(); - } - - /** - * Returns the owner value written into the driver for this lock. - * - * @return string - */ - protected function getCurrentOwner() - { - return optional($this->connection->table($this->table)->where('key', $this->name)->first())->owner; - } - - /** - * Get the name of the database connection being used to manage the lock. - * - * @return string - */ - public function getConnectionName() - { - return $this->connection->getName(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cache/DatabaseStore.php b/vendor/laravel/framework/src/Illuminate/Cache/DatabaseStore.php deleted file mode 100755 index b43761b1..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/DatabaseStore.php +++ /dev/null @@ -1,395 +0,0 @@ -table = $table; - $this->prefix = $prefix; - $this->connection = $connection; - $this->lockTable = $lockTable; - $this->lockLottery = $lockLottery; - } - - /** - * Retrieve an item from the cache by key. - * - * @param string|array $key - * @return mixed - */ - public function get($key) - { - $prefixed = $this->prefix.$key; - - $cache = $this->table()->where('key', '=', $prefixed)->first(); - - // If we have a cache record we will check the expiration time against current - // time on the system and see if the record has expired. If it has, we will - // remove the records from the database table so it isn't returned again. - if (is_null($cache)) { - return; - } - - $cache = is_array($cache) ? (object) $cache : $cache; - - // If this cache expiration date is past the current time, we will remove this - // item from the cache. Then we will return a null value since the cache is - // expired. We will use "Carbon" to make this comparison with the column. - if ($this->currentTime() >= $cache->expiration) { - $this->forget($key); - - return; - } - - return $this->unserialize($cache->value); - } - - /** - * Store an item in the cache for a given number of seconds. - * - * @param string $key - * @param mixed $value - * @param int $seconds - * @return bool - */ - public function put($key, $value, $seconds) - { - $key = $this->prefix.$key; - $value = $this->serialize($value); - $expiration = $this->getTime() + $seconds; - - try { - return $this->table()->insert(compact('key', 'value', 'expiration')); - } catch (Exception $e) { - $result = $this->table()->where('key', $key)->update(compact('value', 'expiration')); - - return $result > 0; - } - } - - /** - * Store an item in the cache if the key doesn't exist. - * - * @param string $key - * @param mixed $value - * @param int $seconds - * @return bool - */ - public function add($key, $value, $seconds) - { - $key = $this->prefix.$key; - $value = $this->serialize($value); - $expiration = $this->getTime() + $seconds; - - try { - return $this->table()->insert(compact('key', 'value', 'expiration')); - } catch (QueryException $e) { - return $this->table() - ->where('key', $key) - ->where('expiration', '<=', $this->getTime()) - ->update([ - 'value' => $value, - 'expiration' => $expiration, - ]) >= 1; - } - } - - /** - * Increment the value of an item in the cache. - * - * @param string $key - * @param mixed $value - * @return int|bool - */ - public function increment($key, $value = 1) - { - return $this->incrementOrDecrement($key, $value, function ($current, $value) { - return $current + $value; - }); - } - - /** - * Decrement the value of an item in the cache. - * - * @param string $key - * @param mixed $value - * @return int|bool - */ - public function decrement($key, $value = 1) - { - return $this->incrementOrDecrement($key, $value, function ($current, $value) { - return $current - $value; - }); - } - - /** - * Increment or decrement an item in the cache. - * - * @param string $key - * @param mixed $value - * @param \Closure $callback - * @return int|bool - */ - protected function incrementOrDecrement($key, $value, Closure $callback) - { - return $this->connection->transaction(function () use ($key, $value, $callback) { - $prefixed = $this->prefix.$key; - - $cache = $this->table()->where('key', $prefixed) - ->lockForUpdate()->first(); - - // If there is no value in the cache, we will return false here. Otherwise the - // value will be decrypted and we will proceed with this function to either - // increment or decrement this value based on the given action callbacks. - if (is_null($cache)) { - return false; - } - - $cache = is_array($cache) ? (object) $cache : $cache; - - $current = $this->unserialize($cache->value); - - // Here we'll call this callback function that was given to the function which - // is used to either increment or decrement the function. We use a callback - // so we do not have to recreate all this logic in each of the functions. - $new = $callback((int) $current, $value); - - if (! is_numeric($current)) { - return false; - } - - // Here we will update the values in the table. We will also encrypt the value - // since database cache values are encrypted by default with secure storage - // that can't be easily read. We will return the new value after storing. - $this->table()->where('key', $prefixed)->update([ - 'value' => $this->serialize($new), - ]); - - return $new; - }); - } - - /** - * Get the current system time. - * - * @return int - */ - protected function getTime() - { - return $this->currentTime(); - } - - /** - * Store an item in the cache indefinitely. - * - * @param string $key - * @param mixed $value - * @return bool - */ - public function forever($key, $value) - { - return $this->put($key, $value, 315360000); - } - - /** - * Get a lock instance. - * - * @param string $name - * @param int $seconds - * @param string|null $owner - * @return \Illuminate\Contracts\Cache\Lock - */ - public function lock($name, $seconds = 0, $owner = null) - { - return new DatabaseLock( - $this->lockConnection ?? $this->connection, - $this->lockTable, - $this->prefix.$name, - $seconds, - $owner, - $this->lockLottery - ); - } - - /** - * Restore a lock instance using the owner identifier. - * - * @param string $name - * @param string $owner - * @return \Illuminate\Contracts\Cache\Lock - */ - public function restoreLock($name, $owner) - { - return $this->lock($name, 0, $owner); - } - - /** - * Remove an item from the cache. - * - * @param string $key - * @return bool - */ - public function forget($key) - { - $this->table()->where('key', '=', $this->prefix.$key)->delete(); - - return true; - } - - /** - * Remove all items from the cache. - * - * @return bool - */ - public function flush() - { - $this->table()->delete(); - - return true; - } - - /** - * Get a query builder for the cache table. - * - * @return \Illuminate\Database\Query\Builder - */ - protected function table() - { - return $this->connection->table($this->table); - } - - /** - * Get the underlying database connection. - * - * @return \Illuminate\Database\ConnectionInterface - */ - public function getConnection() - { - return $this->connection; - } - - /** - * Specify the name of the connection that should be used to manage locks. - * - * @param \Illuminate\Database\ConnectionInterface $connection - * @return $this - */ - public function setLockConnection($connection) - { - $this->lockConnection = $connection; - - return $this; - } - - /** - * Get the cache key prefix. - * - * @return string - */ - public function getPrefix() - { - return $this->prefix; - } - - /** - * Serialize the given value. - * - * @param mixed $value - * @return string - */ - protected function serialize($value) - { - $result = serialize($value); - - if ($this->connection instanceof PostgresConnection && str_contains($result, "\0")) { - $result = base64_encode($result); - } - - return $result; - } - - /** - * Unserialize the given value. - * - * @param string $value - * @return mixed - */ - protected function unserialize($value) - { - if ($this->connection instanceof PostgresConnection && ! Str::contains($value, [':', ';'])) { - $value = base64_decode($value); - } - - return unserialize($value); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cache/DynamoDbLock.php b/vendor/laravel/framework/src/Illuminate/Cache/DynamoDbLock.php deleted file mode 100644 index 92226079..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/DynamoDbLock.php +++ /dev/null @@ -1,77 +0,0 @@ -dynamo = $dynamo; - } - - /** - * Attempt to acquire the lock. - * - * @return bool - */ - public function acquire() - { - if ($this->seconds > 0) { - return $this->dynamo->add($this->name, $this->owner, $this->seconds); - } else { - return $this->dynamo->add($this->name, $this->owner, 86400); - } - } - - /** - * Release the lock. - * - * @return bool - */ - public function release() - { - if ($this->isOwnedByCurrentProcess()) { - return $this->dynamo->forget($this->name); - } - - return false; - } - - /** - * Release this lock in disregard of ownership. - * - * @return void - */ - public function forceRelease() - { - $this->dynamo->forget($this->name); - } - - /** - * Returns the owner value written into the driver for this lock. - * - * @return mixed - */ - protected function getCurrentOwner() - { - return $this->dynamo->get($this->name); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cache/DynamoDbStore.php b/vendor/laravel/framework/src/Illuminate/Cache/DynamoDbStore.php deleted file mode 100644 index 30e175ac..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/DynamoDbStore.php +++ /dev/null @@ -1,538 +0,0 @@ -table = $table; - $this->dynamo = $dynamo; - $this->keyAttribute = $keyAttribute; - $this->valueAttribute = $valueAttribute; - $this->expirationAttribute = $expirationAttribute; - - $this->setPrefix($prefix); - } - - /** - * Retrieve an item from the cache by key. - * - * @param string $key - * @return mixed - */ - public function get($key) - { - $response = $this->dynamo->getItem([ - 'TableName' => $this->table, - 'ConsistentRead' => false, - 'Key' => [ - $this->keyAttribute => [ - 'S' => $this->prefix.$key, - ], - ], - ]); - - if (! isset($response['Item'])) { - return; - } - - if ($this->isExpired($response['Item'])) { - return; - } - - if (isset($response['Item'][$this->valueAttribute])) { - return $this->unserialize( - $response['Item'][$this->valueAttribute]['S'] ?? - $response['Item'][$this->valueAttribute]['N'] ?? - null - ); - } - } - - /** - * Retrieve multiple items from the cache by key. - * - * Items not found in the cache will have a null value. - * - * @param array $keys - * @return array - */ - public function many(array $keys) - { - $prefixedKeys = array_map(function ($key) { - return $this->prefix.$key; - }, $keys); - - $response = $this->dynamo->batchGetItem([ - 'RequestItems' => [ - $this->table => [ - 'ConsistentRead' => false, - 'Keys' => collect($prefixedKeys)->map(function ($key) { - return [ - $this->keyAttribute => [ - 'S' => $key, - ], - ]; - })->all(), - ], - ], - ]); - - $now = Carbon::now(); - - return array_merge(collect(array_flip($keys))->map(function () { - // - })->all(), collect($response['Responses'][$this->table])->mapWithKeys(function ($response) use ($now) { - if ($this->isExpired($response, $now)) { - $value = null; - } else { - $value = $this->unserialize( - $response[$this->valueAttribute]['S'] ?? - $response[$this->valueAttribute]['N'] ?? - null - ); - } - - return [Str::replaceFirst($this->prefix, '', $response[$this->keyAttribute]['S']) => $value]; - })->all()); - } - - /** - * Determine if the given item is expired. - * - * @param array $item - * @param \DateTimeInterface|null $expiration - * @return bool - */ - protected function isExpired(array $item, $expiration = null) - { - $expiration = $expiration ?: Carbon::now(); - - return isset($item[$this->expirationAttribute]) && - $expiration->getTimestamp() >= $item[$this->expirationAttribute]['N']; - } - - /** - * Store an item in the cache for a given number of seconds. - * - * @param string $key - * @param mixed $value - * @param int $seconds - * @return bool - */ - public function put($key, $value, $seconds) - { - $this->dynamo->putItem([ - 'TableName' => $this->table, - 'Item' => [ - $this->keyAttribute => [ - 'S' => $this->prefix.$key, - ], - $this->valueAttribute => [ - $this->type($value) => $this->serialize($value), - ], - $this->expirationAttribute => [ - 'N' => (string) $this->toTimestamp($seconds), - ], - ], - ]); - - return true; - } - - /** - * Store multiple items in the cache for a given number of seconds. - * - * @param array $values - * @param int $seconds - * @return bool - */ - public function putMany(array $values, $seconds) - { - $expiration = $this->toTimestamp($seconds); - - $this->dynamo->batchWriteItem([ - 'RequestItems' => [ - $this->table => collect($values)->map(function ($value, $key) use ($expiration) { - return [ - 'PutRequest' => [ - 'Item' => [ - $this->keyAttribute => [ - 'S' => $this->prefix.$key, - ], - $this->valueAttribute => [ - $this->type($value) => $this->serialize($value), - ], - $this->expirationAttribute => [ - 'N' => (string) $expiration, - ], - ], - ], - ]; - })->values()->all(), - ], - ]); - - return true; - } - - /** - * Store an item in the cache if the key doesn't exist. - * - * @param string $key - * @param mixed $value - * @param int $seconds - * @return bool - */ - public function add($key, $value, $seconds) - { - try { - $this->dynamo->putItem([ - 'TableName' => $this->table, - 'Item' => [ - $this->keyAttribute => [ - 'S' => $this->prefix.$key, - ], - $this->valueAttribute => [ - $this->type($value) => $this->serialize($value), - ], - $this->expirationAttribute => [ - 'N' => (string) $this->toTimestamp($seconds), - ], - ], - 'ConditionExpression' => 'attribute_not_exists(#key) OR #expires_at < :now', - 'ExpressionAttributeNames' => [ - '#key' => $this->keyAttribute, - '#expires_at' => $this->expirationAttribute, - ], - 'ExpressionAttributeValues' => [ - ':now' => [ - 'N' => (string) Carbon::now()->getTimestamp(), - ], - ], - ]); - - return true; - } catch (DynamoDbException $e) { - if (str_contains($e->getMessage(), 'ConditionalCheckFailed')) { - return false; - } - - throw $e; - } - } - - /** - * Increment the value of an item in the cache. - * - * @param string $key - * @param mixed $value - * @return int|bool - */ - public function increment($key, $value = 1) - { - try { - $response = $this->dynamo->updateItem([ - 'TableName' => $this->table, - 'Key' => [ - $this->keyAttribute => [ - 'S' => $this->prefix.$key, - ], - ], - 'ConditionExpression' => 'attribute_exists(#key) AND #expires_at > :now', - 'UpdateExpression' => 'SET #value = #value + :amount', - 'ExpressionAttributeNames' => [ - '#key' => $this->keyAttribute, - '#value' => $this->valueAttribute, - '#expires_at' => $this->expirationAttribute, - ], - 'ExpressionAttributeValues' => [ - ':now' => [ - 'N' => (string) Carbon::now()->getTimestamp(), - ], - ':amount' => [ - 'N' => (string) $value, - ], - ], - 'ReturnValues' => 'UPDATED_NEW', - ]); - - return (int) $response['Attributes'][$this->valueAttribute]['N']; - } catch (DynamoDbException $e) { - if (str_contains($e->getMessage(), 'ConditionalCheckFailed')) { - return false; - } - - throw $e; - } - } - - /** - * Decrement the value of an item in the cache. - * - * @param string $key - * @param mixed $value - * @return int|bool - */ - public function decrement($key, $value = 1) - { - try { - $response = $this->dynamo->updateItem([ - 'TableName' => $this->table, - 'Key' => [ - $this->keyAttribute => [ - 'S' => $this->prefix.$key, - ], - ], - 'ConditionExpression' => 'attribute_exists(#key) AND #expires_at > :now', - 'UpdateExpression' => 'SET #value = #value - :amount', - 'ExpressionAttributeNames' => [ - '#key' => $this->keyAttribute, - '#value' => $this->valueAttribute, - '#expires_at' => $this->expirationAttribute, - ], - 'ExpressionAttributeValues' => [ - ':now' => [ - 'N' => (string) Carbon::now()->getTimestamp(), - ], - ':amount' => [ - 'N' => (string) $value, - ], - ], - 'ReturnValues' => 'UPDATED_NEW', - ]); - - return (int) $response['Attributes'][$this->valueAttribute]['N']; - } catch (DynamoDbException $e) { - if (str_contains($e->getMessage(), 'ConditionalCheckFailed')) { - return false; - } - - throw $e; - } - } - - /** - * Store an item in the cache indefinitely. - * - * @param string $key - * @param mixed $value - * @return bool - */ - public function forever($key, $value) - { - return $this->put($key, $value, Carbon::now()->addYears(5)->getTimestamp()); - } - - /** - * Get a lock instance. - * - * @param string $name - * @param int $seconds - * @param string|null $owner - * @return \Illuminate\Contracts\Cache\Lock - */ - public function lock($name, $seconds = 0, $owner = null) - { - return new DynamoDbLock($this, $this->prefix.$name, $seconds, $owner); - } - - /** - * Restore a lock instance using the owner identifier. - * - * @param string $name - * @param string $owner - * @return \Illuminate\Contracts\Cache\Lock - */ - public function restoreLock($name, $owner) - { - return $this->lock($name, 0, $owner); - } - - /** - * Remove an item from the cache. - * - * @param string $key - * @return bool - */ - public function forget($key) - { - $this->dynamo->deleteItem([ - 'TableName' => $this->table, - 'Key' => [ - $this->keyAttribute => [ - 'S' => $this->prefix.$key, - ], - ], - ]); - - return true; - } - - /** - * Remove all items from the cache. - * - * @return bool - * - * @throws \RuntimeException - */ - public function flush() - { - throw new RuntimeException('DynamoDb does not support flushing an entire table. Please create a new table.'); - } - - /** - * Get the UNIX timestamp for the given number of seconds. - * - * @param int $seconds - * @return int - */ - protected function toTimestamp($seconds) - { - return $seconds > 0 - ? $this->availableAt($seconds) - : Carbon::now()->getTimestamp(); - } - - /** - * Serialize the value. - * - * @param mixed $value - * @return mixed - */ - protected function serialize($value) - { - return is_numeric($value) ? (string) $value : serialize($value); - } - - /** - * Unserialize the value. - * - * @param mixed $value - * @return mixed - */ - protected function unserialize($value) - { - if (filter_var($value, FILTER_VALIDATE_INT) !== false) { - return (int) $value; - } - - if (is_numeric($value)) { - return (float) $value; - } - - return unserialize($value); - } - - /** - * Get the DynamoDB type for the given value. - * - * @param mixed $value - * @return string - */ - protected function type($value) - { - return is_numeric($value) ? 'N' : 'S'; - } - - /** - * Get the cache key prefix. - * - * @return string - */ - public function getPrefix() - { - return $this->prefix; - } - - /** - * Set the cache key prefix. - * - * @param string $prefix - * @return void - */ - public function setPrefix($prefix) - { - $this->prefix = ! empty($prefix) ? $prefix.':' : ''; - } - - /** - * Get the DynamoDb Client instance. - * - * @return \Aws\DynamoDb\DynamoDbClient - */ - public function getClient() - { - return $this->dynamo; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cache/Events/CacheEvent.php b/vendor/laravel/framework/src/Illuminate/Cache/Events/CacheEvent.php deleted file mode 100644 index 6c9d42c5..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/Events/CacheEvent.php +++ /dev/null @@ -1,46 +0,0 @@ -key = $key; - $this->tags = $tags; - } - - /** - * Set the tags for the cache event. - * - * @param array $tags - * @return $this - */ - public function setTags($tags) - { - $this->tags = $tags; - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cache/Events/CacheHit.php b/vendor/laravel/framework/src/Illuminate/Cache/Events/CacheHit.php deleted file mode 100644 index 976c9e4f..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/Events/CacheHit.php +++ /dev/null @@ -1,28 +0,0 @@ -value = $value; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cache/Events/CacheMissed.php b/vendor/laravel/framework/src/Illuminate/Cache/Events/CacheMissed.php deleted file mode 100644 index d2a5c9f9..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/Events/CacheMissed.php +++ /dev/null @@ -1,8 +0,0 @@ -value = $value; - $this->seconds = $seconds; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cache/FileStore.php b/vendor/laravel/framework/src/Illuminate/Cache/FileStore.php deleted file mode 100755 index 42292295..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/FileStore.php +++ /dev/null @@ -1,351 +0,0 @@ -files = $files; - $this->directory = $directory; - $this->filePermission = $filePermission; - } - - /** - * Retrieve an item from the cache by key. - * - * @param string|array $key - * @return mixed - */ - public function get($key) - { - return $this->getPayload($key)['data'] ?? null; - } - - /** - * Store an item in the cache for a given number of seconds. - * - * @param string $key - * @param mixed $value - * @param int $seconds - * @return bool - */ - public function put($key, $value, $seconds) - { - $this->ensureCacheDirectoryExists($path = $this->path($key)); - - $result = $this->files->put( - $path, $this->expiration($seconds).serialize($value), true - ); - - if ($result !== false && $result > 0) { - $this->ensurePermissionsAreCorrect($path); - - return true; - } - - return false; - } - - /** - * Store an item in the cache if the key doesn't exist. - * - * @param string $key - * @param mixed $value - * @param int $seconds - * @return bool - */ - public function add($key, $value, $seconds) - { - $this->ensureCacheDirectoryExists($path = $this->path($key)); - - $file = new LockableFile($path, 'c+'); - - try { - $file->getExclusiveLock(); - } catch (LockTimeoutException $e) { - $file->close(); - - return false; - } - - $expire = $file->read(10); - - if (empty($expire) || $this->currentTime() >= $expire) { - $file->truncate() - ->write($this->expiration($seconds).serialize($value)) - ->close(); - - $this->ensurePermissionsAreCorrect($path); - - return true; - } - - $file->close(); - - return false; - } - - /** - * Create the file cache directory if necessary. - * - * @param string $path - * @return void - */ - protected function ensureCacheDirectoryExists($path) - { - $directory = dirname($path); - - if (! $this->files->exists($directory)) { - $this->files->makeDirectory($directory, 0777, true, true); - - // We're creating two levels of directories (e.g. 7e/24), so we check them both... - $this->ensurePermissionsAreCorrect($directory); - $this->ensurePermissionsAreCorrect(dirname($directory)); - } - } - - /** - * Ensure the created node has the correct permissions. - * - * @param string $path - * @return void - */ - protected function ensurePermissionsAreCorrect($path) - { - if (is_null($this->filePermission) || - intval($this->files->chmod($path), 8) == $this->filePermission) { - return; - } - - $this->files->chmod($path, $this->filePermission); - } - - /** - * Increment the value of an item in the cache. - * - * @param string $key - * @param mixed $value - * @return int - */ - public function increment($key, $value = 1) - { - $raw = $this->getPayload($key); - - return tap(((int) $raw['data']) + $value, function ($newValue) use ($key, $raw) { - $this->put($key, $newValue, $raw['time'] ?? 0); - }); - } - - /** - * Decrement the value of an item in the cache. - * - * @param string $key - * @param mixed $value - * @return int - */ - public function decrement($key, $value = 1) - { - return $this->increment($key, $value * -1); - } - - /** - * Store an item in the cache indefinitely. - * - * @param string $key - * @param mixed $value - * @return bool - */ - public function forever($key, $value) - { - return $this->put($key, $value, 0); - } - - /** - * Remove an item from the cache. - * - * @param string $key - * @return bool - */ - public function forget($key) - { - if ($this->files->exists($file = $this->path($key))) { - return $this->files->delete($file); - } - - return false; - } - - /** - * Remove all items from the cache. - * - * @return bool - */ - public function flush() - { - if (! $this->files->isDirectory($this->directory)) { - return false; - } - - foreach ($this->files->directories($this->directory) as $directory) { - $deleted = $this->files->deleteDirectory($directory); - - if (! $deleted || $this->files->exists($directory)) { - return false; - } - } - - return true; - } - - /** - * Retrieve an item and expiry time from the cache by key. - * - * @param string $key - * @return array - */ - protected function getPayload($key) - { - $path = $this->path($key); - - // If the file doesn't exist, we obviously cannot return the cache so we will - // just return null. Otherwise, we'll get the contents of the file and get - // the expiration UNIX timestamps from the start of the file's contents. - try { - $expire = substr( - $contents = $this->files->get($path, true), 0, 10 - ); - } catch (Exception $e) { - return $this->emptyPayload(); - } - - // If the current time is greater than expiration timestamps we will delete - // the file and return null. This helps clean up the old files and keeps - // this directory much cleaner for us as old files aren't hanging out. - if ($this->currentTime() >= $expire) { - $this->forget($key); - - return $this->emptyPayload(); - } - - try { - $data = unserialize(substr($contents, 10)); - } catch (Exception $e) { - $this->forget($key); - - return $this->emptyPayload(); - } - - // Next, we'll extract the number of seconds that are remaining for a cache - // so that we can properly retain the time for things like the increment - // operation that may be performed on this cache on a later operation. - $time = $expire - $this->currentTime(); - - return compact('data', 'time'); - } - - /** - * Get a default empty payload for the cache. - * - * @return array - */ - protected function emptyPayload() - { - return ['data' => null, 'time' => null]; - } - - /** - * Get the full path for the given cache key. - * - * @param string $key - * @return string - */ - protected function path($key) - { - $parts = array_slice(str_split($hash = sha1($key), 2), 0, 2); - - return $this->directory.'/'.implode('/', $parts).'/'.$hash; - } - - /** - * Get the expiration time based on the given seconds. - * - * @param int $seconds - * @return int - */ - protected function expiration($seconds) - { - $time = $this->availableAt($seconds); - - return $seconds === 0 || $time > 9999999999 ? 9999999999 : $time; - } - - /** - * Get the Filesystem instance. - * - * @return \Illuminate\Filesystem\Filesystem - */ - public function getFilesystem() - { - return $this->files; - } - - /** - * Get the working directory of the cache. - * - * @return string - */ - public function getDirectory() - { - return $this->directory; - } - - /** - * Get the cache key prefix. - * - * @return string - */ - public function getPrefix() - { - return ''; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cache/HasCacheLock.php b/vendor/laravel/framework/src/Illuminate/Cache/HasCacheLock.php deleted file mode 100644 index 82ad9c2b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/HasCacheLock.php +++ /dev/null @@ -1,31 +0,0 @@ -lock($name, 0, $owner); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cache/LICENSE.md b/vendor/laravel/framework/src/Illuminate/Cache/LICENSE.md deleted file mode 100644 index 79810c84..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Taylor Otwell - -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/laravel/framework/src/Illuminate/Cache/Lock.php b/vendor/laravel/framework/src/Illuminate/Cache/Lock.php deleted file mode 100644 index bed17050..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/Lock.php +++ /dev/null @@ -1,167 +0,0 @@ -name = $name; - $this->owner = $owner; - $this->seconds = $seconds; - } - - /** - * Attempt to acquire the lock. - * - * @return bool - */ - abstract public function acquire(); - - /** - * Release the lock. - * - * @return bool - */ - abstract public function release(); - - /** - * Returns the owner value written into the driver for this lock. - * - * @return string - */ - abstract protected function getCurrentOwner(); - - /** - * Attempt to acquire the lock. - * - * @param callable|null $callback - * @return mixed - */ - public function get($callback = null) - { - $result = $this->acquire(); - - if ($result && is_callable($callback)) { - try { - return $callback(); - } finally { - $this->release(); - } - } - - return $result; - } - - /** - * Attempt to acquire the lock for the given number of seconds. - * - * @param int $seconds - * @param callable|null $callback - * @return mixed - * - * @throws \Illuminate\Contracts\Cache\LockTimeoutException - */ - public function block($seconds, $callback = null) - { - $starting = $this->currentTime(); - - while (! $this->acquire()) { - usleep($this->sleepMilliseconds * 1000); - - if ($this->currentTime() - $seconds >= $starting) { - throw new LockTimeoutException; - } - } - - if (is_callable($callback)) { - try { - return $callback(); - } finally { - $this->release(); - } - } - - return true; - } - - /** - * Returns the current owner of the lock. - * - * @return string - */ - public function owner() - { - return $this->owner; - } - - /** - * Determines whether this lock is allowed to release the lock in the driver. - * - * @return bool - */ - protected function isOwnedByCurrentProcess() - { - return $this->getCurrentOwner() === $this->owner; - } - - /** - * Specify the number of milliseconds to sleep in between blocked lock acquisition attempts. - * - * @param int $milliseconds - * @return $this - */ - public function betweenBlockedAttemptsSleepFor($milliseconds) - { - $this->sleepMilliseconds = $milliseconds; - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cache/LuaScripts.php b/vendor/laravel/framework/src/Illuminate/Cache/LuaScripts.php deleted file mode 100644 index 6d22fcd4..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/LuaScripts.php +++ /dev/null @@ -1,25 +0,0 @@ -getMemcached( - $connectionId, $credentials, $options - ); - - if (! $memcached->getServerList()) { - // For each server in the array, we'll just extract the configuration and add - // the server to the Memcached connection. Once we have added all of these - // servers we'll verify the connection is successful and return it back. - foreach ($servers as $server) { - $memcached->addServer( - $server['host'], $server['port'], $server['weight'] - ); - } - } - - return $memcached; - } - - /** - * Get a new Memcached instance. - * - * @param string|null $connectionId - * @param array $credentials - * @param array $options - * @return \Memcached - */ - protected function getMemcached($connectionId, array $credentials, array $options) - { - $memcached = $this->createMemcachedInstance($connectionId); - - if (count($credentials) === 2) { - $this->setCredentials($memcached, $credentials); - } - - if (count($options)) { - $memcached->setOptions($options); - } - - return $memcached; - } - - /** - * Create the Memcached instance. - * - * @param string|null $connectionId - * @return \Memcached - */ - protected function createMemcachedInstance($connectionId) - { - return empty($connectionId) ? new Memcached : new Memcached($connectionId); - } - - /** - * Set the SASL credentials on the Memcached connection. - * - * @param \Memcached $memcached - * @param array $credentials - * @return void - */ - protected function setCredentials($memcached, $credentials) - { - [$username, $password] = $credentials; - - $memcached->setOption(Memcached::OPT_BINARY_PROTOCOL, true); - - $memcached->setSaslAuthData($username, $password); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cache/MemcachedLock.php b/vendor/laravel/framework/src/Illuminate/Cache/MemcachedLock.php deleted file mode 100644 index 0078a09e..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/MemcachedLock.php +++ /dev/null @@ -1,75 +0,0 @@ -memcached = $memcached; - } - - /** - * Attempt to acquire the lock. - * - * @return bool - */ - public function acquire() - { - return $this->memcached->add( - $this->name, $this->owner, $this->seconds - ); - } - - /** - * Release the lock. - * - * @return bool - */ - public function release() - { - if ($this->isOwnedByCurrentProcess()) { - return $this->memcached->delete($this->name); - } - - return false; - } - - /** - * Releases this lock in disregard of ownership. - * - * @return void - */ - public function forceRelease() - { - $this->memcached->delete($this->name); - } - - /** - * Returns the owner value written into the driver for this lock. - * - * @return mixed - */ - protected function getCurrentOwner() - { - return $this->memcached->get($this->name); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cache/MemcachedStore.php b/vendor/laravel/framework/src/Illuminate/Cache/MemcachedStore.php deleted file mode 100755 index 299dab9a..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/MemcachedStore.php +++ /dev/null @@ -1,279 +0,0 @@ -= 3.0.0. - * - * @var bool - */ - protected $onVersionThree; - - /** - * Create a new Memcached store. - * - * @param \Memcached $memcached - * @param string $prefix - * @return void - */ - public function __construct($memcached, $prefix = '') - { - $this->setPrefix($prefix); - $this->memcached = $memcached; - - $this->onVersionThree = (new ReflectionMethod('Memcached', 'getMulti')) - ->getNumberOfParameters() == 2; - } - - /** - * Retrieve an item from the cache by key. - * - * @param string $key - * @return mixed - */ - public function get($key) - { - $value = $this->memcached->get($this->prefix.$key); - - if ($this->memcached->getResultCode() == 0) { - return $value; - } - } - - /** - * Retrieve multiple items from the cache by key. - * - * Items not found in the cache will have a null value. - * - * @param array $keys - * @return array - */ - public function many(array $keys) - { - $prefixedKeys = array_map(function ($key) { - return $this->prefix.$key; - }, $keys); - - if ($this->onVersionThree) { - $values = $this->memcached->getMulti($prefixedKeys, Memcached::GET_PRESERVE_ORDER); - } else { - $null = null; - - $values = $this->memcached->getMulti($prefixedKeys, $null, Memcached::GET_PRESERVE_ORDER); - } - - if ($this->memcached->getResultCode() != 0) { - return array_fill_keys($keys, null); - } - - return array_combine($keys, $values); - } - - /** - * Store an item in the cache for a given number of seconds. - * - * @param string $key - * @param mixed $value - * @param int $seconds - * @return bool - */ - public function put($key, $value, $seconds) - { - return $this->memcached->set( - $this->prefix.$key, $value, $this->calculateExpiration($seconds) - ); - } - - /** - * Store multiple items in the cache for a given number of seconds. - * - * @param array $values - * @param int $seconds - * @return bool - */ - public function putMany(array $values, $seconds) - { - $prefixedValues = []; - - foreach ($values as $key => $value) { - $prefixedValues[$this->prefix.$key] = $value; - } - - return $this->memcached->setMulti( - $prefixedValues, $this->calculateExpiration($seconds) - ); - } - - /** - * Store an item in the cache if the key doesn't exist. - * - * @param string $key - * @param mixed $value - * @param int $seconds - * @return bool - */ - public function add($key, $value, $seconds) - { - return $this->memcached->add( - $this->prefix.$key, $value, $this->calculateExpiration($seconds) - ); - } - - /** - * Increment the value of an item in the cache. - * - * @param string $key - * @param mixed $value - * @return int|bool - */ - public function increment($key, $value = 1) - { - return $this->memcached->increment($this->prefix.$key, $value); - } - - /** - * Decrement the value of an item in the cache. - * - * @param string $key - * @param mixed $value - * @return int|bool - */ - public function decrement($key, $value = 1) - { - return $this->memcached->decrement($this->prefix.$key, $value); - } - - /** - * Store an item in the cache indefinitely. - * - * @param string $key - * @param mixed $value - * @return bool - */ - public function forever($key, $value) - { - return $this->put($key, $value, 0); - } - - /** - * Get a lock instance. - * - * @param string $name - * @param int $seconds - * @param string|null $owner - * @return \Illuminate\Contracts\Cache\Lock - */ - public function lock($name, $seconds = 0, $owner = null) - { - return new MemcachedLock($this->memcached, $this->prefix.$name, $seconds, $owner); - } - - /** - * Restore a lock instance using the owner identifier. - * - * @param string $name - * @param string $owner - * @return \Illuminate\Contracts\Cache\Lock - */ - public function restoreLock($name, $owner) - { - return $this->lock($name, 0, $owner); - } - - /** - * Remove an item from the cache. - * - * @param string $key - * @return bool - */ - public function forget($key) - { - return $this->memcached->delete($this->prefix.$key); - } - - /** - * Remove all items from the cache. - * - * @return bool - */ - public function flush() - { - return $this->memcached->flush(); - } - - /** - * Get the expiration time of the key. - * - * @param int $seconds - * @return int - */ - protected function calculateExpiration($seconds) - { - return $this->toTimestamp($seconds); - } - - /** - * Get the UNIX timestamp for the given number of seconds. - * - * @param int $seconds - * @return int - */ - protected function toTimestamp($seconds) - { - return $seconds > 0 ? $this->availableAt($seconds) : 0; - } - - /** - * Get the underlying Memcached connection. - * - * @return \Memcached - */ - public function getMemcached() - { - return $this->memcached; - } - - /** - * Get the cache key prefix. - * - * @return string - */ - public function getPrefix() - { - return $this->prefix; - } - - /** - * Set the cache key prefix. - * - * @param string $prefix - * @return void - */ - public function setPrefix($prefix) - { - $this->prefix = ! empty($prefix) ? $prefix.':' : ''; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cache/NoLock.php b/vendor/laravel/framework/src/Illuminate/Cache/NoLock.php deleted file mode 100644 index 68560f8f..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/NoLock.php +++ /dev/null @@ -1,46 +0,0 @@ -owner; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cache/NullStore.php b/vendor/laravel/framework/src/Illuminate/Cache/NullStore.php deleted file mode 100755 index 5694e6c6..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/NullStore.php +++ /dev/null @@ -1,126 +0,0 @@ -lock($name, 0, $owner); - } - - /** - * Remove an item from the cache. - * - * @param string $key - * @return bool - */ - public function forget($key) - { - return true; - } - - /** - * Remove all items from the cache. - * - * @return bool - */ - public function flush() - { - return true; - } - - /** - * Get the cache key prefix. - * - * @return string - */ - public function getPrefix() - { - return ''; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cache/PhpRedisLock.php b/vendor/laravel/framework/src/Illuminate/Cache/PhpRedisLock.php deleted file mode 100644 index 6cfce793..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/PhpRedisLock.php +++ /dev/null @@ -1,35 +0,0 @@ -redis->eval( - LuaScripts::releaseLock(), - 1, - $this->name, - ...$this->redis->pack([$this->owner]) - ); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cache/RateLimiter.php b/vendor/laravel/framework/src/Illuminate/Cache/RateLimiter.php deleted file mode 100644 index 32e4b343..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/RateLimiter.php +++ /dev/null @@ -1,221 +0,0 @@ -cache = $cache; - } - - /** - * Register a named limiter configuration. - * - * @param string $name - * @param \Closure $callback - * @return $this - */ - public function for(string $name, Closure $callback) - { - $this->limiters[$name] = $callback; - - return $this; - } - - /** - * Get the given named rate limiter. - * - * @param string $name - * @return \Closure - */ - public function limiter(string $name) - { - return $this->limiters[$name] ?? null; - } - - /** - * Attempts to execute a callback if it's not limited. - * - * @param string $key - * @param int $maxAttempts - * @param \Closure $callback - * @param int $decaySeconds - * @return mixed - */ - public function attempt($key, $maxAttempts, Closure $callback, $decaySeconds = 60) - { - if ($this->tooManyAttempts($key, $maxAttempts)) { - return false; - } - - return tap($callback() ?: true, function () use ($key, $decaySeconds) { - $this->hit($key, $decaySeconds); - }); - } - - /** - * Determine if the given key has been "accessed" too many times. - * - * @param string $key - * @param int $maxAttempts - * @return bool - */ - public function tooManyAttempts($key, $maxAttempts) - { - if ($this->attempts($key) >= $maxAttempts) { - if ($this->cache->has($this->cleanRateLimiterKey($key).':timer')) { - return true; - } - - $this->resetAttempts($key); - } - - return false; - } - - /** - * Increment the counter for a given key for a given decay time. - * - * @param string $key - * @param int $decaySeconds - * @return int - */ - public function hit($key, $decaySeconds = 60) - { - $key = $this->cleanRateLimiterKey($key); - - $this->cache->add( - $key.':timer', $this->availableAt($decaySeconds), $decaySeconds - ); - - $added = $this->cache->add($key, 0, $decaySeconds); - - $hits = (int) $this->cache->increment($key); - - if (! $added && $hits == 1) { - $this->cache->put($key, 1, $decaySeconds); - } - - return $hits; - } - - /** - * Get the number of attempts for the given key. - * - * @param string $key - * @return mixed - */ - public function attempts($key) - { - $key = $this->cleanRateLimiterKey($key); - - return $this->cache->get($key, 0); - } - - /** - * Reset the number of attempts for the given key. - * - * @param string $key - * @return mixed - */ - public function resetAttempts($key) - { - $key = $this->cleanRateLimiterKey($key); - - return $this->cache->forget($key); - } - - /** - * Get the number of retries left for the given key. - * - * @param string $key - * @param int $maxAttempts - * @return int - */ - public function remaining($key, $maxAttempts) - { - $key = $this->cleanRateLimiterKey($key); - - $attempts = $this->attempts($key); - - return $maxAttempts - $attempts; - } - - /** - * Get the number of retries left for the given key. - * - * @param string $key - * @param int $maxAttempts - * @return int - */ - public function retriesLeft($key, $maxAttempts) - { - return $this->remaining($key, $maxAttempts); - } - - /** - * Clear the hits and lockout timer for the given key. - * - * @param string $key - * @return void - */ - public function clear($key) - { - $key = $this->cleanRateLimiterKey($key); - - $this->resetAttempts($key); - - $this->cache->forget($key.':timer'); - } - - /** - * Get the number of seconds until the "key" is accessible again. - * - * @param string $key - * @return int - */ - public function availableIn($key) - { - $key = $this->cleanRateLimiterKey($key); - - return max(0, $this->cache->get($key.':timer') - $this->currentTime()); - } - - /** - * Clean the rate limiter key from unicode characters. - * - * @param string $key - * @return string - */ - public function cleanRateLimiterKey($key) - { - return preg_replace('/&([a-z])[a-z]+;/i', '$1', htmlentities($key)); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cache/RateLimiting/GlobalLimit.php b/vendor/laravel/framework/src/Illuminate/Cache/RateLimiting/GlobalLimit.php deleted file mode 100644 index 4f084eb1..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/RateLimiting/GlobalLimit.php +++ /dev/null @@ -1,18 +0,0 @@ -key = $key; - $this->maxAttempts = $maxAttempts; - $this->decayMinutes = $decayMinutes; - } - - /** - * Create a new rate limit. - * - * @param int $maxAttempts - * @return static - */ - public static function perMinute($maxAttempts) - { - return new static('', $maxAttempts); - } - - /** - * Create a new rate limit using minutes as decay time. - * - * @param int $decayMinutes - * @param int $maxAttempts - * @return static - */ - public static function perMinutes($decayMinutes, $maxAttempts) - { - return new static('', $maxAttempts, $decayMinutes); - } - - /** - * Create a new rate limit using hours as decay time. - * - * @param int $maxAttempts - * @param int $decayHours - * @return static - */ - public static function perHour($maxAttempts, $decayHours = 1) - { - return new static('', $maxAttempts, 60 * $decayHours); - } - - /** - * Create a new rate limit using days as decay time. - * - * @param int $maxAttempts - * @param int $decayDays - * @return static - */ - public static function perDay($maxAttempts, $decayDays = 1) - { - return new static('', $maxAttempts, 60 * 24 * $decayDays); - } - - /** - * Create a new unlimited rate limit. - * - * @return static - */ - public static function none() - { - return new Unlimited; - } - - /** - * Set the key of the rate limit. - * - * @param mixed $key - * @return $this - */ - public function by($key) - { - $this->key = $key; - - return $this; - } - - /** - * Set the callback that should generate the response when the limit is exceeded. - * - * @param callable $callback - * @return $this - */ - public function response(callable $callback) - { - $this->responseCallback = $callback; - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cache/RateLimiting/Unlimited.php b/vendor/laravel/framework/src/Illuminate/Cache/RateLimiting/Unlimited.php deleted file mode 100644 index fcfaa317..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/RateLimiting/Unlimited.php +++ /dev/null @@ -1,16 +0,0 @@ -redis = $redis; - } - - /** - * Attempt to acquire the lock. - * - * @return bool - */ - public function acquire() - { - if ($this->seconds > 0) { - return $this->redis->set($this->name, $this->owner, 'EX', $this->seconds, 'NX') == true; - } else { - return $this->redis->setnx($this->name, $this->owner) === 1; - } - } - - /** - * Release the lock. - * - * @return bool - */ - public function release() - { - return (bool) $this->redis->eval(LuaScripts::releaseLock(), 1, $this->name, $this->owner); - } - - /** - * Releases this lock in disregard of ownership. - * - * @return void - */ - public function forceRelease() - { - $this->redis->del($this->name); - } - - /** - * Returns the owner value written into the driver for this lock. - * - * @return string - */ - protected function getCurrentOwner() - { - return $this->redis->get($this->name); - } - - /** - * Get the name of the Redis connection being used to manage the lock. - * - * @return string - */ - public function getConnectionName() - { - return $this->redis->getName(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cache/RedisStore.php b/vendor/laravel/framework/src/Illuminate/Cache/RedisStore.php deleted file mode 100755 index 4896c918..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/RedisStore.php +++ /dev/null @@ -1,347 +0,0 @@ -redis = $redis; - $this->setPrefix($prefix); - $this->setConnection($connection); - } - - /** - * Retrieve an item from the cache by key. - * - * @param string|array $key - * @return mixed - */ - public function get($key) - { - $value = $this->connection()->get($this->prefix.$key); - - return ! is_null($value) ? $this->unserialize($value) : null; - } - - /** - * Retrieve multiple items from the cache by key. - * - * Items not found in the cache will have a null value. - * - * @param array $keys - * @return array - */ - public function many(array $keys) - { - $results = []; - - $values = $this->connection()->mget(array_map(function ($key) { - return $this->prefix.$key; - }, $keys)); - - foreach ($values as $index => $value) { - $results[$keys[$index]] = ! is_null($value) ? $this->unserialize($value) : null; - } - - return $results; - } - - /** - * Store an item in the cache for a given number of seconds. - * - * @param string $key - * @param mixed $value - * @param int $seconds - * @return bool - */ - public function put($key, $value, $seconds) - { - return (bool) $this->connection()->setex( - $this->prefix.$key, (int) max(1, $seconds), $this->serialize($value) - ); - } - - /** - * Store multiple items in the cache for a given number of seconds. - * - * @param array $values - * @param int $seconds - * @return bool - */ - public function putMany(array $values, $seconds) - { - $this->connection()->multi(); - - $manyResult = null; - - foreach ($values as $key => $value) { - $result = $this->put($key, $value, $seconds); - - $manyResult = is_null($manyResult) ? $result : $result && $manyResult; - } - - $this->connection()->exec(); - - return $manyResult ?: false; - } - - /** - * Store an item in the cache if the key doesn't exist. - * - * @param string $key - * @param mixed $value - * @param int $seconds - * @return bool - */ - public function add($key, $value, $seconds) - { - $lua = "return redis.call('exists',KEYS[1])<1 and redis.call('setex',KEYS[1],ARGV[2],ARGV[1])"; - - return (bool) $this->connection()->eval( - $lua, 1, $this->prefix.$key, $this->serialize($value), (int) max(1, $seconds) - ); - } - - /** - * Increment the value of an item in the cache. - * - * @param string $key - * @param mixed $value - * @return int - */ - public function increment($key, $value = 1) - { - return $this->connection()->incrby($this->prefix.$key, $value); - } - - /** - * Decrement the value of an item in the cache. - * - * @param string $key - * @param mixed $value - * @return int - */ - public function decrement($key, $value = 1) - { - return $this->connection()->decrby($this->prefix.$key, $value); - } - - /** - * Store an item in the cache indefinitely. - * - * @param string $key - * @param mixed $value - * @return bool - */ - public function forever($key, $value) - { - return (bool) $this->connection()->set($this->prefix.$key, $this->serialize($value)); - } - - /** - * Get a lock instance. - * - * @param string $name - * @param int $seconds - * @param string|null $owner - * @return \Illuminate\Contracts\Cache\Lock - */ - public function lock($name, $seconds = 0, $owner = null) - { - $lockName = $this->prefix.$name; - - $lockConnection = $this->lockConnection(); - - if ($lockConnection instanceof PhpRedisConnection) { - return new PhpRedisLock($lockConnection, $lockName, $seconds, $owner); - } - - return new RedisLock($lockConnection, $lockName, $seconds, $owner); - } - - /** - * Restore a lock instance using the owner identifier. - * - * @param string $name - * @param string $owner - * @return \Illuminate\Contracts\Cache\Lock - */ - public function restoreLock($name, $owner) - { - return $this->lock($name, 0, $owner); - } - - /** - * Remove an item from the cache. - * - * @param string $key - * @return bool - */ - public function forget($key) - { - return (bool) $this->connection()->del($this->prefix.$key); - } - - /** - * Remove all items from the cache. - * - * @return bool - */ - public function flush() - { - $this->connection()->flushdb(); - - return true; - } - - /** - * Begin executing a new tags operation. - * - * @param array|mixed $names - * @return \Illuminate\Cache\RedisTaggedCache - */ - public function tags($names) - { - return new RedisTaggedCache( - $this, new TagSet($this, is_array($names) ? $names : func_get_args()) - ); - } - - /** - * Get the Redis connection instance. - * - * @return \Illuminate\Redis\Connections\Connection - */ - public function connection() - { - return $this->redis->connection($this->connection); - } - - /** - * Get the Redis connection instance that should be used to manage locks. - * - * @return \Illuminate\Redis\Connections\Connection - */ - public function lockConnection() - { - return $this->redis->connection($this->lockConnection ?? $this->connection); - } - - /** - * Specify the name of the connection that should be used to store data. - * - * @param string $connection - * @return void - */ - public function setConnection($connection) - { - $this->connection = $connection; - } - - /** - * Specify the name of the connection that should be used to manage locks. - * - * @param string $connection - * @return $this - */ - public function setLockConnection($connection) - { - $this->lockConnection = $connection; - - return $this; - } - - /** - * Get the Redis database instance. - * - * @return \Illuminate\Contracts\Redis\Factory - */ - public function getRedis() - { - return $this->redis; - } - - /** - * Get the cache key prefix. - * - * @return string - */ - public function getPrefix() - { - return $this->prefix; - } - - /** - * Set the cache key prefix. - * - * @param string $prefix - * @return void - */ - public function setPrefix($prefix) - { - $this->prefix = ! empty($prefix) ? $prefix.':' : ''; - } - - /** - * Serialize the value. - * - * @param mixed $value - * @return mixed - */ - protected function serialize($value) - { - return is_numeric($value) && ! in_array($value, [INF, -INF]) && ! is_nan($value) ? $value : serialize($value); - } - - /** - * Unserialize the value. - * - * @param mixed $value - * @return mixed - */ - protected function unserialize($value) - { - return is_numeric($value) ? $value : unserialize($value); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cache/RedisTaggedCache.php b/vendor/laravel/framework/src/Illuminate/Cache/RedisTaggedCache.php deleted file mode 100644 index 7863dbc0..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/RedisTaggedCache.php +++ /dev/null @@ -1,214 +0,0 @@ -forever($key, $value); - } - - $this->pushStandardKeys($this->tags->getNamespace(), $key); - - return parent::put($key, $value, $ttl); - } - - /** - * Increment the value of an item in the cache. - * - * @param string $key - * @param mixed $value - * @return int|bool - */ - public function increment($key, $value = 1) - { - $this->pushStandardKeys($this->tags->getNamespace(), $key); - - return parent::increment($key, $value); - } - - /** - * Decrement the value of an item in the cache. - * - * @param string $key - * @param mixed $value - * @return int|bool - */ - public function decrement($key, $value = 1) - { - $this->pushStandardKeys($this->tags->getNamespace(), $key); - - return parent::decrement($key, $value); - } - - /** - * Store an item in the cache indefinitely. - * - * @param string $key - * @param mixed $value - * @return bool - */ - public function forever($key, $value) - { - $this->pushForeverKeys($this->tags->getNamespace(), $key); - - return parent::forever($key, $value); - } - - /** - * Remove all items from the cache. - * - * @return bool - */ - public function flush() - { - $this->deleteForeverKeys(); - $this->deleteStandardKeys(); - - $this->tags->flush(); - - return true; - } - - /** - * Store standard key references into store. - * - * @param string $namespace - * @param string $key - * @return void - */ - protected function pushStandardKeys($namespace, $key) - { - $this->pushKeys($namespace, $key, self::REFERENCE_KEY_STANDARD); - } - - /** - * Store forever key references into store. - * - * @param string $namespace - * @param string $key - * @return void - */ - protected function pushForeverKeys($namespace, $key) - { - $this->pushKeys($namespace, $key, self::REFERENCE_KEY_FOREVER); - } - - /** - * Store a reference to the cache key against the reference key. - * - * @param string $namespace - * @param string $key - * @param string $reference - * @return void - */ - protected function pushKeys($namespace, $key, $reference) - { - $fullKey = $this->store->getPrefix().sha1($namespace).':'.$key; - - foreach (explode('|', $namespace) as $segment) { - $this->store->connection()->sadd($this->referenceKey($segment, $reference), $fullKey); - } - } - - /** - * Delete all of the items that were stored forever. - * - * @return void - */ - protected function deleteForeverKeys() - { - $this->deleteKeysByReference(self::REFERENCE_KEY_FOREVER); - } - - /** - * Delete all standard items. - * - * @return void - */ - protected function deleteStandardKeys() - { - $this->deleteKeysByReference(self::REFERENCE_KEY_STANDARD); - } - - /** - * Find and delete all of the items that were stored against a reference. - * - * @param string $reference - * @return void - */ - protected function deleteKeysByReference($reference) - { - foreach (explode('|', $this->tags->getNamespace()) as $segment) { - $this->deleteValues($segment = $this->referenceKey($segment, $reference)); - - $this->store->connection()->del($segment); - } - } - - /** - * Delete item keys that have been stored against a reference. - * - * @param string $referenceKey - * @return void - */ - protected function deleteValues($referenceKey) - { - $cursor = $defaultCursorValue = '0'; - - do { - [$cursor, $valuesChunk] = $this->store->connection()->sscan( - $referenceKey, $cursor, ['match' => '*', 'count' => 1000] - ); - - // PhpRedis client returns false if set does not exist or empty. Array destruction - // on false stores null in each variable. If valuesChunk is null, it means that - // there were not results from the previously executed "sscan" Redis command. - if (is_null($valuesChunk)) { - break; - } - - $valuesChunk = array_unique($valuesChunk); - - if (count($valuesChunk) > 0) { - $this->store->connection()->del(...$valuesChunk); - } - } while (((string) $cursor) !== $defaultCursorValue); - } - - /** - * Get the reference key for the segment. - * - * @param string $segment - * @param string $suffix - * @return string - */ - protected function referenceKey($segment, $suffix) - { - return $this->store->getPrefix().$segment.':'.$suffix; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cache/Repository.php b/vendor/laravel/framework/src/Illuminate/Cache/Repository.php deleted file mode 100755 index a9a1aa9d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/Repository.php +++ /dev/null @@ -1,680 +0,0 @@ -store = $store; - } - - /** - * Determine if an item exists in the cache. - * - * @param string $key - * @return bool - */ - public function has($key): bool - { - return ! is_null($this->get($key)); - } - - /** - * Determine if an item doesn't exist in the cache. - * - * @param string $key - * @return bool - */ - public function missing($key) - { - return ! $this->has($key); - } - - /** - * Retrieve an item from the cache by key. - * - * @param array|string $key - * @param mixed $default - * @return mixed - */ - public function get($key, $default = null): mixed - { - if (is_array($key)) { - return $this->many($key); - } - - $value = $this->store->get($this->itemKey($key)); - - // If we could not find the cache value, we will fire the missed event and get - // the default value for this cache value. This default could be a callback - // so we will execute the value function which will resolve it if needed. - if (is_null($value)) { - $this->event(new CacheMissed($key)); - - $value = value($default); - } else { - $this->event(new CacheHit($key, $value)); - } - - return $value; - } - - /** - * Retrieve multiple items from the cache by key. - * - * Items not found in the cache will have a null value. - * - * @param array $keys - * @return array - */ - public function many(array $keys) - { - $values = $this->store->many(collect($keys)->map(function ($value, $key) { - return is_string($key) ? $key : $value; - })->values()->all()); - - return collect($values)->map(function ($value, $key) use ($keys) { - return $this->handleManyResult($keys, $key, $value); - })->all(); - } - - /** - * {@inheritdoc} - * - * @return iterable - */ - public function getMultiple($keys, $default = null): iterable - { - $defaults = []; - - foreach ($keys as $key) { - $defaults[$key] = $default; - } - - return $this->many($defaults); - } - - /** - * Handle a result for the "many" method. - * - * @param array $keys - * @param string $key - * @param mixed $value - * @return mixed - */ - protected function handleManyResult($keys, $key, $value) - { - // If we could not find the cache value, we will fire the missed event and get - // the default value for this cache value. This default could be a callback - // so we will execute the value function which will resolve it if needed. - if (is_null($value)) { - $this->event(new CacheMissed($key)); - - return isset($keys[$key]) ? value($keys[$key]) : null; - } - - // If we found a valid value we will fire the "hit" event and return the value - // back from this function. The "hit" event gives developers an opportunity - // to listen for every possible cache "hit" throughout this applications. - $this->event(new CacheHit($key, $value)); - - return $value; - } - - /** - * Retrieve an item from the cache and delete it. - * - * @param string $key - * @param mixed $default - * @return mixed - */ - public function pull($key, $default = null) - { - return tap($this->get($key, $default), function () use ($key) { - $this->forget($key); - }); - } - - /** - * Store an item in the cache. - * - * @param array|string $key - * @param mixed $value - * @param \DateTimeInterface|\DateInterval|int|null $ttl - * @return bool - */ - public function put($key, $value, $ttl = null) - { - if (is_array($key)) { - return $this->putMany($key, $value); - } - - if ($ttl === null) { - return $this->forever($key, $value); - } - - $seconds = $this->getSeconds($ttl); - - if ($seconds <= 0) { - return $this->forget($key); - } - - $result = $this->store->put($this->itemKey($key), $value, $seconds); - - if ($result) { - $this->event(new KeyWritten($key, $value, $seconds)); - } - - return $result; - } - - /** - * {@inheritdoc} - * - * @return bool - */ - public function set($key, $value, $ttl = null): bool - { - return $this->put($key, $value, $ttl); - } - - /** - * Store multiple items in the cache for a given number of seconds. - * - * @param array $values - * @param \DateTimeInterface|\DateInterval|int|null $ttl - * @return bool - */ - public function putMany(array $values, $ttl = null) - { - if ($ttl === null) { - return $this->putManyForever($values); - } - - $seconds = $this->getSeconds($ttl); - - if ($seconds <= 0) { - return $this->deleteMultiple(array_keys($values)); - } - - $result = $this->store->putMany($values, $seconds); - - if ($result) { - foreach ($values as $key => $value) { - $this->event(new KeyWritten($key, $value, $seconds)); - } - } - - return $result; - } - - /** - * Store multiple items in the cache indefinitely. - * - * @param array $values - * @return bool - */ - protected function putManyForever(array $values) - { - $result = true; - - foreach ($values as $key => $value) { - if (! $this->forever($key, $value)) { - $result = false; - } - } - - return $result; - } - - /** - * {@inheritdoc} - * - * @return bool - */ - public function setMultiple($values, $ttl = null): bool - { - return $this->putMany(is_array($values) ? $values : iterator_to_array($values), $ttl); - } - - /** - * Store an item in the cache if the key does not exist. - * - * @param string $key - * @param mixed $value - * @param \DateTimeInterface|\DateInterval|int|null $ttl - * @return bool - */ - public function add($key, $value, $ttl = null) - { - $seconds = null; - - if ($ttl !== null) { - $seconds = $this->getSeconds($ttl); - - if ($seconds <= 0) { - return false; - } - - // If the store has an "add" method we will call the method on the store so it - // has a chance to override this logic. Some drivers better support the way - // this operation should work with a total "atomic" implementation of it. - if (method_exists($this->store, 'add')) { - return $this->store->add( - $this->itemKey($key), $value, $seconds - ); - } - } - - // If the value did not exist in the cache, we will put the value in the cache - // so it exists for subsequent requests. Then, we will return true so it is - // easy to know if the value gets added. Otherwise, we will return false. - if (is_null($this->get($key))) { - return $this->put($key, $value, $seconds); - } - - return false; - } - - /** - * Increment the value of an item in the cache. - * - * @param string $key - * @param mixed $value - * @return int|bool - */ - public function increment($key, $value = 1) - { - return $this->store->increment($key, $value); - } - - /** - * Decrement the value of an item in the cache. - * - * @param string $key - * @param mixed $value - * @return int|bool - */ - public function decrement($key, $value = 1) - { - return $this->store->decrement($key, $value); - } - - /** - * Store an item in the cache indefinitely. - * - * @param string $key - * @param mixed $value - * @return bool - */ - public function forever($key, $value) - { - $result = $this->store->forever($this->itemKey($key), $value); - - if ($result) { - $this->event(new KeyWritten($key, $value)); - } - - return $result; - } - - /** - * Get an item from the cache, or execute the given Closure and store the result. - * - * @param string $key - * @param \Closure|\DateTimeInterface|\DateInterval|int|null $ttl - * @param \Closure $callback - * @return mixed - */ - public function remember($key, $ttl, Closure $callback) - { - $value = $this->get($key); - - // If the item exists in the cache we will just return this immediately and if - // not we will execute the given Closure and cache the result of that for a - // given number of seconds so it's available for all subsequent requests. - if (! is_null($value)) { - return $value; - } - - $this->put($key, $value = $callback(), value($ttl)); - - return $value; - } - - /** - * Get an item from the cache, or execute the given Closure and store the result forever. - * - * @param string $key - * @param \Closure $callback - * @return mixed - */ - public function sear($key, Closure $callback) - { - return $this->rememberForever($key, $callback); - } - - /** - * Get an item from the cache, or execute the given Closure and store the result forever. - * - * @param string $key - * @param \Closure $callback - * @return mixed - */ - public function rememberForever($key, Closure $callback) - { - $value = $this->get($key); - - // If the item exists in the cache we will just return this immediately - // and if not we will execute the given Closure and cache the result - // of that forever so it is available for all subsequent requests. - if (! is_null($value)) { - return $value; - } - - $this->forever($key, $value = $callback()); - - return $value; - } - - /** - * Remove an item from the cache. - * - * @param string $key - * @return bool - */ - public function forget($key) - { - return tap($this->store->forget($this->itemKey($key)), function ($result) use ($key) { - if ($result) { - $this->event(new KeyForgotten($key)); - } - }); - } - - /** - * {@inheritdoc} - * - * @return bool - */ - public function delete($key): bool - { - return $this->forget($key); - } - - /** - * {@inheritdoc} - * - * @return bool - */ - public function deleteMultiple($keys): bool - { - $result = true; - - foreach ($keys as $key) { - if (! $this->forget($key)) { - $result = false; - } - } - - return $result; - } - - /** - * {@inheritdoc} - * - * @return bool - */ - public function clear(): bool - { - return $this->store->flush(); - } - - /** - * Begin executing a new tags operation if the store supports it. - * - * @param array|mixed $names - * @return \Illuminate\Cache\TaggedCache - * - * @throws \BadMethodCallException - */ - public function tags($names) - { - if (! $this->supportsTags()) { - throw new BadMethodCallException('This cache store does not support tagging.'); - } - - $cache = $this->store->tags(is_array($names) ? $names : func_get_args()); - - if (! is_null($this->events)) { - $cache->setEventDispatcher($this->events); - } - - return $cache->setDefaultCacheTime($this->default); - } - - /** - * Format the key for a cache item. - * - * @param string $key - * @return string - */ - protected function itemKey($key) - { - return $key; - } - - /** - * Calculate the number of seconds for the given TTL. - * - * @param \DateTimeInterface|\DateInterval|int $ttl - * @return int - */ - protected function getSeconds($ttl) - { - $duration = $this->parseDateInterval($ttl); - - if ($duration instanceof DateTimeInterface) { - $duration = Carbon::now()->diffInRealSeconds($duration, false); - } - - return (int) ($duration > 0 ? $duration : 0); - } - - /** - * Determine if the current store supports tags. - * - * @return bool - */ - public function supportsTags() - { - return method_exists($this->store, 'tags'); - } - - /** - * Get the default cache time. - * - * @return int|null - */ - public function getDefaultCacheTime() - { - return $this->default; - } - - /** - * Set the default cache time in seconds. - * - * @param int|null $seconds - * @return $this - */ - public function setDefaultCacheTime($seconds) - { - $this->default = $seconds; - - return $this; - } - - /** - * Get the cache store implementation. - * - * @return \Illuminate\Contracts\Cache\Store - */ - public function getStore() - { - return $this->store; - } - - /** - * Fire an event for this cache instance. - * - * @param object|string $event - * @return void - */ - protected function event($event) - { - $this->events?->dispatch($event); - } - - /** - * Get the event dispatcher instance. - * - * @return \Illuminate\Contracts\Events\Dispatcher - */ - public function getEventDispatcher() - { - return $this->events; - } - - /** - * Set the event dispatcher instance. - * - * @param \Illuminate\Contracts\Events\Dispatcher $events - * @return void - */ - public function setEventDispatcher(Dispatcher $events) - { - $this->events = $events; - } - - /** - * Determine if a cached value exists. - * - * @param string $key - * @return bool - */ - public function offsetExists($key): bool - { - return $this->has($key); - } - - /** - * Retrieve an item from the cache by key. - * - * @param string $key - * @return mixed - */ - public function offsetGet($key): mixed - { - return $this->get($key); - } - - /** - * Store an item in the cache for the default time. - * - * @param string $key - * @param mixed $value - * @return void - */ - public function offsetSet($key, $value): void - { - $this->put($key, $value, $this->default); - } - - /** - * Remove an item from the cache. - * - * @param string $key - * @return void - */ - public function offsetUnset($key): void - { - $this->forget($key); - } - - /** - * Handle dynamic calls into macros or pass missing methods to the store. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - if (static::hasMacro($method)) { - return $this->macroCall($method, $parameters); - } - - return $this->store->$method(...$parameters); - } - - /** - * Clone cache repository instance. - * - * @return void - */ - public function __clone() - { - $this->store = clone $this->store; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cache/RetrievesMultipleKeys.php b/vendor/laravel/framework/src/Illuminate/Cache/RetrievesMultipleKeys.php deleted file mode 100644 index 7db7a0aa..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/RetrievesMultipleKeys.php +++ /dev/null @@ -1,49 +0,0 @@ -mapWithKeys(function ($value, $key) { - return [is_string($key) ? $key : $value => is_string($key) ? $value : null]; - })->all(); - - foreach ($keys as $key => $default) { - $return[$key] = $this->get($key, $default); - } - - return $return; - } - - /** - * Store multiple items in the cache for a given number of seconds. - * - * @param array $values - * @param int $seconds - * @return bool - */ - public function putMany(array $values, $seconds) - { - $manyResult = null; - - foreach ($values as $key => $value) { - $result = $this->put($key, $value, $seconds); - - $manyResult = is_null($manyResult) ? $result : $result && $manyResult; - } - - return $manyResult ?: false; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cache/TagSet.php b/vendor/laravel/framework/src/Illuminate/Cache/TagSet.php deleted file mode 100644 index 471dc679..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/TagSet.php +++ /dev/null @@ -1,130 +0,0 @@ -store = $store; - $this->names = $names; - } - - /** - * Reset all tags in the set. - * - * @return void - */ - public function reset() - { - array_walk($this->names, [$this, 'resetTag']); - } - - /** - * Reset the tag and return the new tag identifier. - * - * @param string $name - * @return string - */ - public function resetTag($name) - { - $this->store->forever($this->tagKey($name), $id = str_replace('.', '', uniqid('', true))); - - return $id; - } - - /** - * Flush all the tags in the set. - * - * @return void - */ - public function flush() - { - array_walk($this->names, [$this, 'flushTag']); - } - - /** - * Flush the tag from the cache. - * - * @param string $name - */ - public function flushTag($name) - { - $this->store->forget($this->tagKey($name)); - } - - /** - * Get a unique namespace that changes when any of the tags are flushed. - * - * @return string - */ - public function getNamespace() - { - return implode('|', $this->tagIds()); - } - - /** - * Get an array of tag identifiers for all of the tags in the set. - * - * @return array - */ - protected function tagIds() - { - return array_map([$this, 'tagId'], $this->names); - } - - /** - * Get the unique tag identifier for a given tag. - * - * @param string $name - * @return string - */ - public function tagId($name) - { - return $this->store->get($this->tagKey($name)) ?: $this->resetTag($name); - } - - /** - * Get the tag identifier key for a given tag. - * - * @param string $name - * @return string - */ - public function tagKey($name) - { - return 'tag:'.$name.':key'; - } - - /** - * Get all of the tag names in the set. - * - * @return array - */ - public function getNames() - { - return $this->names; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cache/TaggableStore.php b/vendor/laravel/framework/src/Illuminate/Cache/TaggableStore.php deleted file mode 100644 index 6a12b45d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/TaggableStore.php +++ /dev/null @@ -1,19 +0,0 @@ -tags = $tags; - } - - /** - * Store multiple items in the cache for a given number of seconds. - * - * @param array $values - * @param int|null $ttl - * @return bool - */ - public function putMany(array $values, $ttl = null) - { - if ($ttl === null) { - return $this->putManyForever($values); - } - - return $this->putManyAlias($values, $ttl); - } - - /** - * Increment the value of an item in the cache. - * - * @param string $key - * @param mixed $value - * @return int|bool - */ - public function increment($key, $value = 1) - { - return $this->store->increment($this->itemKey($key), $value); - } - - /** - * Decrement the value of an item in the cache. - * - * @param string $key - * @param mixed $value - * @return int|bool - */ - public function decrement($key, $value = 1) - { - return $this->store->decrement($this->itemKey($key), $value); - } - - /** - * Remove all items from the cache. - * - * @return bool - */ - public function flush() - { - $this->tags->reset(); - - return true; - } - - /** - * {@inheritdoc} - */ - protected function itemKey($key) - { - return $this->taggedItemKey($key); - } - - /** - * Get a fully qualified key for a tagged item. - * - * @param string $key - * @return string - */ - public function taggedItemKey($key) - { - return sha1($this->tags->getNamespace()).':'.$key; - } - - /** - * Fire an event for this cache instance. - * - * @param \Illuminate\Cache\Events\CacheEvent $event - * @return void - */ - protected function event($event) - { - parent::event($event->setTags($this->tags->getNames())); - } - - /** - * Get the tag set instance. - * - * @return \Illuminate\Cache\TagSet - */ - public function getTags() - { - return $this->tags; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cache/composer.json b/vendor/laravel/framework/src/Illuminate/Cache/composer.json deleted file mode 100755 index 92dd4fb0..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cache/composer.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "illuminate/cache", - "description": "The Illuminate Cache package.", - "license": "MIT", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "require": { - "php": "^8.0.2", - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0" - }, - "provide": { - "psr/simple-cache-implementation": "1.0|2.0|3.0" - }, - "autoload": { - "psr-4": { - "Illuminate\\Cache\\": "" - } - }, - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "suggest": { - "ext-memcached": "Required to use the memcache cache driver.", - "illuminate/database": "Required to use the database cache driver (^9.0).", - "illuminate/filesystem": "Required to use the file cache driver (^9.0).", - "illuminate/redis": "Required to use the redis cache driver (^9.0).", - "symfony/cache": "Required to use PSR-6 cache bridge (^6.0)." - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev" -} diff --git a/vendor/laravel/framework/src/Illuminate/Collections/Arr.php b/vendor/laravel/framework/src/Illuminate/Collections/Arr.php deleted file mode 100644 index afda8def..00000000 --- a/vendor/laravel/framework/src/Illuminate/Collections/Arr.php +++ /dev/null @@ -1,825 +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|int|float $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); - } - - if (is_float($key)) { - $key = (string) $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|int|float $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]) && static::accessible($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 (! str_contains($key, '.')) { - 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); - } - - /** - * Join all items using a string. The final items can use a separate glue string. - * - * @param array $array - * @param string $glue - * @param string $finalGlue - * @return string - */ - public static function join($array, $glue, $finalGlue = '') - { - if ($finalGlue === '') { - return implode($glue, $array); - } - - if (count($array) === 0) { - return ''; - } - - if (count($array) === 1) { - return end($array); - } - - $finalItem = array_pop($array); - - return implode($glue, $array).$finalGlue.$finalItem; - } - - /** - * Key an associative array by a field or using a callback. - * - * @param array $array - * @param callable|array|string $keyBy - * @return array - */ - public static function keyBy($array, $keyBy) - { - return Collection::make($array)->keyBy($keyBy)->all(); - } - - /** - * Prepend the key names of an associative array. - * - * @param array $array - * @param string $prependWith - * @return array - */ - public static function prependKeysWith($array, $prependWith) - { - return Collection::make($array)->mapWithKeys(function ($item, $key) use ($prependWith) { - return [$prependWith.$key => $item]; - })->all(); - } - - /** - * 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]; - } - - /** - * Run a map over each of the items in the array. - * - * @param array $array - * @param callable $callback - * @return array - */ - public static function map(array $array, callable $callback) - { - $keys = array_keys($array); - - try { - $items = array_map($callback, $array, $keys); - } catch (ArgumentCountError) { - $items = array_map($callback, $array); - } - - return array_combine($keys, $items); - } - - /** - * 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|int|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/laravel/framework/src/Illuminate/Collections/Collection.php b/vendor/laravel/framework/src/Illuminate/Collections/Collection.php deleted file mode 100644 index 9c7f7848..00000000 --- a/vendor/laravel/framework/src/Illuminate/Collections/Collection.php +++ /dev/null @@ -1,1728 +0,0 @@ - - * @implements \Illuminate\Support\Enumerable - */ -class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerable -{ - /** - * @use \Illuminate\Support\Traits\EnumeratesValues - */ - use EnumeratesValues, Macroable; - - /** - * The items contained in the collection. - * - * @var array - */ - protected $items = []; - - /** - * Create a new collection. - * - * @param \Illuminate\Contracts\Support\Arrayable|iterable|null $items - * @return void - */ - public function __construct($items = []) - { - $this->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 \Illuminate\Support\LazyCollection - */ - public function lazy() - { - return new LazyCollection($this->items); - } - - /** - * Get the average value of a given key. - * - * @param (callable(TValue): float|int)|string|null $callback - * @return float|int|null - */ - 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 float|int|null - */ - public function median($key = null) - { - $values = (isset($key) ? $this->pluck($key) : $this) - ->filter(fn ($item) => ! 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(fn ($value) => $counts[$value] = isset($counts[$value]) ? $counts[$value] + 1 : 1); - - $sorted = $counts->sort(); - - $highestValue = $sorted->last(); - - return $sorted->filter(fn ($value) => $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 (callable(TValue, TKey): bool)|TValue|string $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 exists, using strict comparison. - * - * @param (callable(TValue): bool)|TValue|array-key $key - * @param TValue|null $value - * @return bool - */ - public function containsStrict($key, $value = null) - { - if (func_num_args() === 2) { - return $this->contains(fn ($item) => data_get($item, $key) === $value); - } - - if ($this->useAsCallable($key)) { - return ! is_null($this->first($key)); - } - - return in_array($key, $this->items, true); - } - - /** - * 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. - * - * @template TCrossJoinKey - * @template TCrossJoinValue - * - * @param \Illuminate\Contracts\Support\Arrayable|iterable ...$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 \Illuminate\Contracts\Support\Arrayable|iterable $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 \Illuminate\Contracts\Support\Arrayable|iterable $items - * @param callable(TValue, TValue): int $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 \Illuminate\Contracts\Support\Arrayable|iterable $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 \Illuminate\Contracts\Support\Arrayable|iterable $items - * @param callable(TKey, TKey): int $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 \Illuminate\Contracts\Support\Arrayable|iterable $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 \Illuminate\Contracts\Support\Arrayable|iterable $items - * @param callable(TKey, TKey): int $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(TValue): bool)|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(TValue): bool)|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 callable(TValue, TValue): bool - */ - 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 \Illuminate\Support\Enumerable|array $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(TValue, TKey): bool)|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. - * - * @template TFirstDefault - * - * @param (callable(TValue, TKey): bool)|null $callback - * @param TFirstDefault|(\Closure(): TFirstDefault) $default - * @return TValue|TFirstDefault - */ - 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 TKey|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. - * - * @template TGetDefault - * - * @param TKey $key - * @param TGetDefault|(\Closure(): TGetDefault) $default - * @return TValue|TGetDefault - */ - 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 (callable(TValue, TKey): array-key)|array|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 = match (true) { - is_bool($groupKey) => (int) $groupKey, - $groupKey instanceof \Stringable => (string) $groupKey, - default => $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(TValue, TKey): array-key)|array|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 TKey|array $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 callable|string $value - * @param string|null $glue - * @return string - */ - public function implode($value, $glue = null) - { - if ($this->useAsCallable($value)) { - return implode($glue ?? '', $this->map($value)->all()); - } - - $first = $this->first(); - - if (is_array($first) || (is_object($first) && ! $first instanceof Stringable)) { - return implode($glue ?? '', $this->pluck($value)->all()); - } - - return implode($value ?? '', $this->items); - } - - /** - * Intersect the collection with the given items. - * - * @param \Illuminate\Contracts\Support\Arrayable|iterable $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 \Illuminate\Contracts\Support\Arrayable|iterable $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. - * - * @template TLastDefault - * - * @param (callable(TValue, TKey): bool)|null $callback - * @param TLastDefault|(\Closure(): TLastDefault) $default - * @return TValue|TLastDefault - */ - public function last(callable $callback = null, $default = null) - { - return Arr::last($this->items, $callback, $default); - } - - /** - * Get the values of a given key. - * - * @param string|int|array $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. - * - * @template TMapValue - * - * @param callable(TValue, TKey): TMapValue $callback - * @return static - */ - public function map(callable $callback) - { - return new static(Arr::map($this->items, $callback)); - } - - /** - * Run a dictionary map over the items. - * - * The callback should return an associative array with a single key/value pair. - * - * @template TMapToDictionaryKey of array-key - * @template TMapToDictionaryValue - * - * @param callable(TValue, TKey): array $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. - * - * @template TMapWithKeysKey of array-key - * @template TMapWithKeysValue - * - * @param callable(TValue, TKey): array $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 \Illuminate\Contracts\Support\Arrayable|iterable $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. - * - * @template TMergeRecursiveValue - * - * @param \Illuminate\Contracts\Support\Arrayable|iterable $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. - * - * @template TCombineValue - * - * @param \Illuminate\Contracts\Support\Arrayable|iterable $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 \Illuminate\Contracts\Support\Arrayable|iterable $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 \Illuminate\Support\Enumerable|array|string $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 static|TValue|null - */ - 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 TValue $value - * @param TKey $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 TValue ...$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. - * - * @template TPullDefault - * - * @param TKey $key - * @param TPullDefault|(\Closure(): TPullDefault) $default - * @return TValue|TPullDefault - */ - public function pull($key, $default = null) - { - return Arr::pull($this->items, $key, $default); - } - - /** - * Put an item in the collection by key. - * - * @param TKey $key - * @param TValue $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 (callable(self): int)|int|null $number - * @return static|TValue - * - * @throws \InvalidArgumentException - */ - public function random($number = null) - { - if (is_null($number)) { - return Arr::random($this->items); - } - - if (is_callable($number)) { - return new static(Arr::random($this->items, $number($this))); - } - - return new static(Arr::random($this->items, $number)); - } - - /** - * Replace the collection items with the given items. - * - * @param \Illuminate\Contracts\Support\Arrayable|iterable $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 \Illuminate\Contracts\Support\Arrayable|iterable $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 TValue|(callable(TValue,TKey): bool) $value - * @param bool $strict - * @return TKey|bool - */ - 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 static|TValue|null - */ - 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 TValue|callable(TValue,TKey): bool $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 TValue|callable(TValue,TKey): bool $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 (callable(TValue, TKey): bool)|string $key - * @param mixed $operator - * @param mixed $value - * @return TValue - * - * @throws \Illuminate\Support\ItemNotFoundException - * @throws \Illuminate\Support\MultipleItemsFoundException - */ - public function sole($key = null, $operator = null, $value = null) - { - $filter = func_num_args() > 1 - ? $this->operatorForWhere(...func_get_args()) - : $key; - - $items = $this->unless($filter == null)->filter($filter); - - $count = $items->count(); - - if ($count === 0) { - throw new ItemNotFoundException; - } - - if ($count > 1) { - throw new MultipleItemsFoundException($count); - } - - return $items->first(); - } - - /** - * Get the first item in the collection but throw an exception if no matching items exist. - * - * @param (callable(TValue, TKey): bool)|string $key - * @param mixed $operator - * @param mixed $value - * @return TValue - * - * @throws \Illuminate\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(TValue, TKey, static): bool $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(TValue, TValue): int)|null|int $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 array|(callable(TValue, TKey): mixed)|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; - - uasort($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'; - - 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 array|(callable(TValue, TKey): mixed)|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(TKey, TKey): int $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 array $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 TValue|callable(TValue,TKey): bool $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 TValue|callable(TValue,TKey): bool $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(TValue, TKey): TValue $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 (callable(TValue, TKey): mixed)|string|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]] - * - * @template TZipValue - * - * @param \Illuminate\Contracts\Support\Arrayable|iterable ...$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. - * - * @template TPadValue - * - * @param int $size - * @param TPadValue $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 - */ - public function getIterator(): Traversable - { - return new ArrayIterator($this->items); - } - - /** - * Count the number of items in the collection. - * - * @return int - */ - public function count(): int - { - return count($this->items); - } - - /** - * Count the number of items in the collection by a field or using a callback. - * - * @param (callable(TValue, TKey): mixed)|string|null $countBy - * @return static - */ - public function countBy($countBy = null) - { - return new static($this->lazy()->countBy($countBy)->all()); - } - - /** - * Add an item to the collection. - * - * @param TValue $item - * @return $this - */ - public function add($item) - { - $this->items[] = $item; - - return $this; - } - - /** - * Get a base Support collection instance from this collection. - * - * @return \Illuminate\Support\Collection - */ - public function toBase() - { - return new self($this); - } - - /** - * Determine if an item exists at an offset. - * - * @param TKey $key - * @return bool - */ - public function offsetExists($key): bool - { - return isset($this->items[$key]); - } - - /** - * Get an item at a given offset. - * - * @param TKey $key - * @return TValue - */ - public function offsetGet($key): mixed - { - return $this->items[$key]; - } - - /** - * Set the item at a given offset. - * - * @param TKey|null $key - * @param TValue $value - * @return void - */ - public function offsetSet($key, $value): void - { - if (is_null($key)) { - $this->items[] = $value; - } else { - $this->items[$key] = $value; - } - } - - /** - * Unset the item at a given offset. - * - * @param TKey $key - * @return void - */ - public function offsetUnset($key): void - { - unset($this->items[$key]); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Collections/Enumerable.php b/vendor/laravel/framework/src/Illuminate/Collections/Enumerable.php deleted file mode 100644 index c9d82ca4..00000000 --- a/vendor/laravel/framework/src/Illuminate/Collections/Enumerable.php +++ /dev/null @@ -1,1258 +0,0 @@ - - * @extends \IteratorAggregate - */ -interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, JsonSerializable -{ - /** - * Create a new collection instance if the value isn't one already. - * - * @template TMakeKey of array-key - * @template TMakeValue - * - * @param \Illuminate\Contracts\Support\Arrayable|iterable|null $items - * @return static - */ - public static function make($items = []); - - /** - * Create a new instance 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); - - /** - * Create a collection with the given range. - * - * @param int $from - * @param int $to - * @return static - */ - public static function range($from, $to); - - /** - * Wrap the given value in a collection if applicable. - * - * @template TWrapKey of array-key - * @template TWrapValue - * - * @param iterable $value - * @return static - */ - public static function wrap($value); - - /** - * Get the underlying items from the given collection if applicable. - * - * @template TUnwrapKey of array-key - * @template TUnwrapValue - * - * @param array|static $value - * @return array - */ - public static function unwrap($value); - - /** - * Create a new instance with no items. - * - * @return static - */ - public static function empty(); - - /** - * Get all items in the enumerable. - * - * @return array - */ - public function all(); - - /** - * Alias for the "avg" method. - * - * @param (callable(TValue): float|int)|string|null $callback - * @return float|int|null - */ - public function average($callback = null); - - /** - * Get the median of a given key. - * - * @param string|array|null $key - * @return float|int|null - */ - public function median($key = null); - - /** - * Get the mode of a given key. - * - * @param string|array|null $key - * @return array|null - */ - public function mode($key = null); - - /** - * Collapse the items into a single enumerable. - * - * @return static - */ - public function collapse(); - - /** - * Alias for the "contains" method. - * - * @param (callable(TValue, TKey): bool)|TValue|string $key - * @param mixed $operator - * @param mixed $value - * @return bool - */ - public function some($key, $operator = null, $value = null); - - /** - * Determine if an item exists, using strict comparison. - * - * @param (callable(TValue): bool)|TValue|array-key $key - * @param TValue|null $value - * @return bool - */ - public function containsStrict($key, $value = null); - - /** - * Get the average value of a given key. - * - * @param (callable(TValue): float|int)|string|null $callback - * @return float|int|null - */ - public function avg($callback = null); - - /** - * Determine if an item exists in the enumerable. - * - * @param (callable(TValue, TKey): bool)|TValue|string $key - * @param mixed $operator - * @param mixed $value - * @return bool - */ - public function contains($key, $operator = null, $value = null); - - /** - * 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); - - /** - * Cross join with the given lists, returning all possible permutations. - * - * @template TCrossJoinKey - * @template TCrossJoinValue - * - * @param \Illuminate\Contracts\Support\Arrayable|iterable ...$lists - * @return static> - */ - public function crossJoin(...$lists); - - /** - * Dump the collection and end the script. - * - * @param mixed ...$args - * @return never - */ - public function dd(...$args); - - /** - * Dump the collection. - * - * @return $this - */ - public function dump(); - - /** - * Get the items that are not present in the given items. - * - * @param \Illuminate\Contracts\Support\Arrayable|iterable $items - * @return static - */ - public function diff($items); - - /** - * Get the items that are not present in the given items, using the callback. - * - * @param \Illuminate\Contracts\Support\Arrayable|iterable $items - * @param callable(TValue, TValue): int $callback - * @return static - */ - public function diffUsing($items, callable $callback); - - /** - * Get the items whose keys and values are not present in the given items. - * - * @param \Illuminate\Contracts\Support\Arrayable|iterable $items - * @return static - */ - public function diffAssoc($items); - - /** - * Get the items whose keys and values are not present in the given items, using the callback. - * - * @param \Illuminate\Contracts\Support\Arrayable|iterable $items - * @param callable(TKey, TKey): int $callback - * @return static - */ - public function diffAssocUsing($items, callable $callback); - - /** - * Get the items whose keys are not present in the given items. - * - * @param \Illuminate\Contracts\Support\Arrayable|iterable $items - * @return static - */ - public function diffKeys($items); - - /** - * Get the items whose keys are not present in the given items, using the callback. - * - * @param \Illuminate\Contracts\Support\Arrayable|iterable $items - * @param callable(TKey, TKey): int $callback - * @return static - */ - public function diffKeysUsing($items, callable $callback); - - /** - * Retrieve duplicate items. - * - * @param (callable(TValue): bool)|string|null $callback - * @param bool $strict - * @return static - */ - public function duplicates($callback = null, $strict = false); - - /** - * Retrieve duplicate items using strict comparison. - * - * @param (callable(TValue): bool)|string|null $callback - * @return static - */ - public function duplicatesStrict($callback = null); - - /** - * Execute a callback over each item. - * - * @param callable(TValue, TKey): mixed $callback - * @return $this - */ - public function each(callable $callback); - - /** - * Execute a callback over each nested chunk of items. - * - * @param callable $callback - * @return static - */ - public function eachSpread(callable $callback); - - /** - * Determine if all items pass the given truth test. - * - * @param (callable(TValue, TKey): bool)|TValue|string $key - * @param mixed $operator - * @param mixed $value - * @return bool - */ - public function every($key, $operator = null, $value = null); - - /** - * Get all items except for those with the specified keys. - * - * @param \Illuminate\Support\Enumerable|array $keys - * @return static - */ - public function except($keys); - - /** - * Run a filter over each of the items. - * - * @param (callable(TValue): bool)|null $callback - * @return static - */ - public function filter(callable $callback = null); - - /** - * Apply the callback if the given "value" is (or resolves to) truthy. - * - * @template TWhenReturnType as null - * - * @param bool $value - * @param (callable($this): TWhenReturnType)|null $callback - * @param (callable($this): TWhenReturnType)|null $default - * @return $this|TWhenReturnType - */ - public function when($value, callable $callback = null, callable $default = null); - - /** - * Apply the callback if the collection is empty. - * - * @template TWhenEmptyReturnType - * - * @param (callable($this): TWhenEmptyReturnType) $callback - * @param (callable($this): TWhenEmptyReturnType)|null $default - * @return $this|TWhenEmptyReturnType - */ - public function whenEmpty(callable $callback, callable $default = null); - - /** - * Apply the callback if the collection is not empty. - * - * @template TWhenNotEmptyReturnType - * - * @param callable($this): TWhenNotEmptyReturnType $callback - * @param (callable($this): TWhenNotEmptyReturnType)|null $default - * @return $this|TWhenNotEmptyReturnType - */ - public function whenNotEmpty(callable $callback, callable $default = null); - - /** - * Apply the callback if the given "value" is (or resolves to) truthy. - * - * @template TUnlessReturnType - * - * @param bool $value - * @param (callable($this): TUnlessReturnType) $callback - * @param (callable($this): TUnlessReturnType)|null $default - * @return $this|TUnlessReturnType - */ - public function unless($value, callable $callback, callable $default = null); - - /** - * Apply the callback unless the collection is empty. - * - * @template TUnlessEmptyReturnType - * - * @param callable($this): TUnlessEmptyReturnType $callback - * @param (callable($this): TUnlessEmptyReturnType)|null $default - * @return $this|TUnlessEmptyReturnType - */ - public function unlessEmpty(callable $callback, callable $default = null); - - /** - * Apply the callback unless the collection is not empty. - * - * @template TUnlessNotEmptyReturnType - * - * @param callable($this): TUnlessNotEmptyReturnType $callback - * @param (callable($this): TUnlessNotEmptyReturnType)|null $default - * @return $this|TUnlessNotEmptyReturnType - */ - public function unlessNotEmpty(callable $callback, callable $default = null); - - /** - * 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); - - /** - * Filter items where the value for the given key is null. - * - * @param string|null $key - * @return static - */ - public function whereNull($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); - - /** - * Filter items by the given key value pair using strict comparison. - * - * @param string $key - * @param mixed $value - * @return static - */ - public function whereStrict($key, $value); - - /** - * Filter items by the given key value pair. - * - * @param string $key - * @param \Illuminate\Contracts\Support\Arrayable|iterable $values - * @param bool $strict - * @return static - */ - public function whereIn($key, $values, $strict = false); - - /** - * Filter items by the given key value pair using strict comparison. - * - * @param string $key - * @param \Illuminate\Contracts\Support\Arrayable|iterable $values - * @return static - */ - public function whereInStrict($key, $values); - - /** - * Filter items such that the value of the given key is between the given values. - * - * @param string $key - * @param \Illuminate\Contracts\Support\Arrayable|iterable $values - * @return static - */ - public function whereBetween($key, $values); - - /** - * Filter items such that the value of the given key is not between the given values. - * - * @param string $key - * @param \Illuminate\Contracts\Support\Arrayable|iterable $values - * @return static - */ - public function whereNotBetween($key, $values); - - /** - * Filter items by the given key value pair. - * - * @param string $key - * @param \Illuminate\Contracts\Support\Arrayable|iterable $values - * @param bool $strict - * @return static - */ - public function whereNotIn($key, $values, $strict = false); - - /** - * Filter items by the given key value pair using strict comparison. - * - * @param string $key - * @param \Illuminate\Contracts\Support\Arrayable|iterable $values - * @return static - */ - public function whereNotInStrict($key, $values); - - /** - * Filter the items, removing any items that don't match the given type(s). - * - * @template TWhereInstanceOf - * - * @param class-string|array> $type - * @return static - */ - public function whereInstanceOf($type); - - /** - * Get the first item from the enumerable passing the given truth test. - * - * @template TFirstDefault - * - * @param (callable(TValue,TKey): bool)|null $callback - * @param TFirstDefault|(\Closure(): TFirstDefault) $default - * @return TValue|TFirstDefault - */ - public function first(callable $callback = null, $default = null); - - /** - * Get the first item by the given key value pair. - * - * @param string $key - * @param mixed $operator - * @param mixed $value - * @return TValue|null - */ - public function firstWhere($key, $operator = null, $value = null); - - /** - * Get a flattened array of the items in the collection. - * - * @param int $depth - * @return static - */ - public function flatten($depth = INF); - - /** - * Flip the values with their keys. - * - * @return static - */ - public function flip(); - - /** - * Get an item from the collection by key. - * - * @template TGetDefault - * - * @param TKey $key - * @param TGetDefault|(\Closure(): TGetDefault) $default - * @return TValue|TGetDefault - */ - public function get($key, $default = null); - - /** - * Group an associative array by a field or using a callback. - * - * @param (callable(TValue, TKey): array-key)|array|string $groupBy - * @param bool $preserveKeys - * @return static> - */ - public function groupBy($groupBy, $preserveKeys = false); - - /** - * Key an associative array by a field or using a callback. - * - * @param (callable(TValue, TKey): array-key)|array|string $keyBy - * @return static - */ - public function keyBy($keyBy); - - /** - * Determine if an item exists in the collection by key. - * - * @param TKey|array $key - * @return bool - */ - public function has($key); - - /** - * Determine if any of the keys exist in the collection. - * - * @param mixed $key - * @return bool - */ - public function hasAny($key); - - /** - * Concatenate values of a given key as a string. - * - * @param string $value - * @param string|null $glue - * @return string - */ - public function implode($value, $glue = null); - - /** - * Intersect the collection with the given items. - * - * @param \Illuminate\Contracts\Support\Arrayable|iterable $items - * @return static - */ - public function intersect($items); - - /** - * Intersect the collection with the given items by key. - * - * @param \Illuminate\Contracts\Support\Arrayable|iterable $items - * @return static - */ - public function intersectByKeys($items); - - /** - * Determine if the collection is empty or not. - * - * @return bool - */ - public function isEmpty(); - - /** - * Determine if the collection is not empty. - * - * @return bool - */ - public function isNotEmpty(); - - /** - * Determine if the collection contains a single item. - * - * @return bool - */ - public function containsOneItem(); - - /** - * 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 = ''); - - /** - * Get the keys of the collection items. - * - * @return static - */ - public function keys(); - - /** - * Get the last item from the collection. - * - * @template TLastDefault - * - * @param (callable(TValue, TKey): bool)|null $callback - * @param TLastDefault|(\Closure(): TLastDefault) $default - * @return TValue|TLastDefault - */ - public function last(callable $callback = null, $default = null); - - /** - * Run a map over each of the items. - * - * @template TMapValue - * - * @param callable(TValue, TKey): TMapValue $callback - * @return static - */ - public function map(callable $callback); - - /** - * Run a map over each nested chunk of items. - * - * @param callable $callback - * @return static - */ - public function mapSpread(callable $callback); - - /** - * Run a dictionary map over the items. - * - * The callback should return an associative array with a single key/value pair. - * - * @template TMapToDictionaryKey of array-key - * @template TMapToDictionaryValue - * - * @param callable(TValue, TKey): array $callback - * @return static> - */ - public function mapToDictionary(callable $callback); - - /** - * Run a grouping map over the items. - * - * The callback should return an associative array with a single key/value pair. - * - * @template TMapToGroupsKey of array-key - * @template TMapToGroupsValue - * - * @param callable(TValue, TKey): array $callback - * @return static> - */ - public function mapToGroups(callable $callback); - - /** - * Run an associative map over each of the items. - * - * The callback should return an associative array with a single key/value pair. - * - * @template TMapWithKeysKey of array-key - * @template TMapWithKeysValue - * - * @param callable(TValue, TKey): array $callback - * @return static - */ - public function mapWithKeys(callable $callback); - - /** - * Map a collection and flatten the result by a single level. - * - * @template TFlatMapKey of array-key - * @template TFlatMapValue - * - * @param callable(TValue, TKey): (\Illuminate\Support\Collection|array) $callback - * @return static - */ - public function flatMap(callable $callback); - - /** - * Map the values into a new class. - * - * @template TMapIntoValue - * - * @param class-string $class - * @return static - */ - public function mapInto($class); - - /** - * Merge the collection with the given items. - * - * @param \Illuminate\Contracts\Support\Arrayable|iterable $items - * @return static - */ - public function merge($items); - - /** - * Recursively merge the collection with the given items. - * - * @template TMergeRecursiveValue - * - * @param \Illuminate\Contracts\Support\Arrayable|iterable $items - * @return static - */ - public function mergeRecursive($items); - - /** - * Create a collection by using this collection for keys and another for its values. - * - * @template TCombineValue - * - * @param \Illuminate\Contracts\Support\Arrayable|iterable $values - * @return static - */ - public function combine($values); - - /** - * Union the collection with the given items. - * - * @param \Illuminate\Contracts\Support\Arrayable|iterable $items - * @return static - */ - public function union($items); - - /** - * Get the min value of a given key. - * - * @param (callable(TValue):mixed)|string|null $callback - * @return mixed - */ - public function min($callback = null); - - /** - * Get the max value of a given key. - * - * @param (callable(TValue):mixed)|string|null $callback - * @return mixed - */ - public function max($callback = null); - - /** - * Create a new collection consisting of every n-th element. - * - * @param int $step - * @param int $offset - * @return static - */ - public function nth($step, $offset = 0); - - /** - * Get the items with the specified keys. - * - * @param \Illuminate\Support\Enumerable|array|string $keys - * @return static - */ - public function only($keys); - - /** - * "Paginate" the collection by slicing it into a smaller collection. - * - * @param int $page - * @param int $perPage - * @return static - */ - public function forPage($page, $perPage); - - /** - * Partition the collection into two arrays using the given callback or key. - * - * @param (callable(TValue, TKey): bool)|TValue|string $key - * @param mixed $operator - * @param mixed $value - * @return static, static> - */ - public function partition($key, $operator = null, $value = null); - - /** - * Push all of the given items onto the collection. - * - * @param iterable $source - * @return static - */ - public function concat($source); - - /** - * Get one or a specified number of items randomly from the collection. - * - * @param int|null $number - * @return static|TValue - * - * @throws \InvalidArgumentException - */ - public function random($number = null); - - /** - * Reduce the collection to a single value. - * - * @template TReduceInitial - * @template TReduceReturnType - * - * @param callable(TReduceInitial|TReduceReturnType, TValue, TKey): TReduceReturnType $callback - * @param TReduceInitial $initial - * @return TReduceReturnType - */ - public function reduce(callable $callback, $initial = null); - - /** - * Reduce the collection to multiple aggregate values. - * - * @param callable $callback - * @param mixed ...$initial - * @return array - * - * @throws \UnexpectedValueException - */ - public function reduceSpread(callable $callback, ...$initial); - - /** - * Replace the collection items with the given items. - * - * @param \Illuminate\Contracts\Support\Arrayable|iterable $items - * @return static - */ - public function replace($items); - - /** - * Recursively replace the collection items with the given items. - * - * @param \Illuminate\Contracts\Support\Arrayable|iterable $items - * @return static - */ - public function replaceRecursive($items); - - /** - * Reverse items order. - * - * @return static - */ - public function reverse(); - - /** - * Search the collection for a given value and return the corresponding key if successful. - * - * @param TValue|callable(TValue,TKey): bool $value - * @param bool $strict - * @return TKey|bool - */ - public function search($value, $strict = false); - - /** - * Shuffle the items in the collection. - * - * @param int|null $seed - * @return static - */ - public function shuffle($seed = null); - - /** - * 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); - - /** - * Skip the first {$count} items. - * - * @param int $count - * @return static - */ - public function skip($count); - - /** - * Skip items in the collection until the given condition is met. - * - * @param TValue|callable(TValue,TKey): bool $value - * @return static - */ - public function skipUntil($value); - - /** - * Skip items in the collection while the given condition is met. - * - * @param TValue|callable(TValue,TKey): bool $value - * @return static - */ - public function skipWhile($value); - - /** - * Get a slice of items from the enumerable. - * - * @param int $offset - * @param int|null $length - * @return static - */ - public function slice($offset, $length = null); - - /** - * Split a collection into a certain number of groups. - * - * @param int $numberOfGroups - * @return static - */ - public function split($numberOfGroups); - - /** - * Get the first item in the collection, but only if exactly one item exists. Otherwise, throw an exception. - * - * @param (callable(TValue, TKey): bool)|string $key - * @param mixed $operator - * @param mixed $value - * @return TValue - * - * @throws \Illuminate\Support\ItemNotFoundException - * @throws \Illuminate\Support\MultipleItemsFoundException - */ - public function sole($key = null, $operator = null, $value = null); - - /** - * Get the first item in the collection but throw an exception if no matching items exist. - * - * @param (callable(TValue, TKey): bool)|string $key - * @param mixed $operator - * @param mixed $value - * @return TValue - * - * @throws \Illuminate\Support\ItemNotFoundException - */ - public function firstOrFail($key = null, $operator = null, $value = null); - - /** - * Chunk the collection into chunks of the given size. - * - * @param int $size - * @return static - */ - public function chunk($size); - - /** - * Chunk the collection into chunks with a callback. - * - * @param callable(TValue, TKey, static): bool $callback - * @return static> - */ - public function chunkWhile(callable $callback); - - /** - * Split a collection into a certain number of groups, and fill the first groups completely. - * - * @param int $numberOfGroups - * @return static - */ - public function splitIn($numberOfGroups); - - /** - * Sort through each item with a callback. - * - * @param (callable(TValue, TValue): int)|null|int $callback - * @return static - */ - public function sort($callback = null); - - /** - * Sort items in descending order. - * - * @param int $options - * @return static - */ - public function sortDesc($options = SORT_REGULAR); - - /** - * Sort the collection using the given callback. - * - * @param array|(callable(TValue, TKey): mixed)|string $callback - * @param int $options - * @param bool $descending - * @return static - */ - public function sortBy($callback, $options = SORT_REGULAR, $descending = false); - - /** - * Sort the collection in descending order using the given callback. - * - * @param array|(callable(TValue, TKey): mixed)|string $callback - * @param int $options - * @return static - */ - public function sortByDesc($callback, $options = SORT_REGULAR); - - /** - * Sort the collection keys. - * - * @param int $options - * @param bool $descending - * @return static - */ - public function sortKeys($options = SORT_REGULAR, $descending = false); - - /** - * Sort the collection keys in descending order. - * - * @param int $options - * @return static - */ - public function sortKeysDesc($options = SORT_REGULAR); - - /** - * Sort the collection keys using a callback. - * - * @param callable(TKey, TKey): int $callback - * @return static - */ - public function sortKeysUsing(callable $callback); - - /** - * Get the sum of the given values. - * - * @param (callable(TValue): mixed)|string|null $callback - * @return mixed - */ - public function sum($callback = null); - - /** - * Take the first or last {$limit} items. - * - * @param int $limit - * @return static - */ - public function take($limit); - - /** - * Take items in the collection until the given condition is met. - * - * @param TValue|callable(TValue,TKey): bool $value - * @return static - */ - public function takeUntil($value); - - /** - * Take items in the collection while the given condition is met. - * - * @param TValue|callable(TValue,TKey): bool $value - * @return static - */ - public function takeWhile($value); - - /** - * Pass the collection to the given callback and then return it. - * - * @param callable(TValue): mixed $callback - * @return $this - */ - public function tap(callable $callback); - - /** - * Pass the enumerable to the given callback and return the result. - * - * @template TPipeReturnType - * - * @param callable($this): TPipeReturnType $callback - * @return TPipeReturnType - */ - public function pipe(callable $callback); - - /** - * Pass the collection into a new class. - * - * @param class-string $class - * @return mixed - */ - public function pipeInto($class); - - /** - * Pass the collection through a series of callable pipes and return the result. - * - * @param array $pipes - * @return mixed - */ - public function pipeThrough($pipes); - - /** - * Get the values of a given key. - * - * @param string|array $value - * @param string|null $key - * @return static - */ - public function pluck($value, $key = null); - - /** - * Create a collection of all elements that do not pass a given truth test. - * - * @param (callable(TValue, TKey): bool)|bool|TValue $callback - * @return static - */ - public function reject($callback = true); - - /** - * Convert a flatten "dot" notation array into an expanded array. - * - * @return static - */ - public function undot(); - - /** - * Return only unique items from the collection array. - * - * @param (callable(TValue, TKey): mixed)|string|null $key - * @param bool $strict - * @return static - */ - public function unique($key = null, $strict = false); - - /** - * Return only unique items from the collection array using strict comparison. - * - * @param (callable(TValue, TKey): mixed)|string|null $key - * @return static - */ - public function uniqueStrict($key = null); - - /** - * Reset the keys on the underlying array. - * - * @return static - */ - public function values(); - - /** - * Pad collection to the specified length with a value. - * - * @template TPadValue - * - * @param int $size - * @param TPadValue $value - * @return static - */ - public function pad($size, $value); - - /** - * Get the values iterator. - * - * @return \Traversable - */ - public function getIterator(): Traversable; - - /** - * Count the number of items in the collection. - * - * @return int - */ - public function count(): int; - - /** - * Count the number of items in the collection by a field or using a callback. - * - * @param (callable(TValue, TKey): mixed)|string|null $countBy - * @return static - */ - public function countBy($countBy = null); - - /** - * 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]] - * - * @template TZipValue - * - * @param \Illuminate\Contracts\Support\Arrayable|iterable ...$items - * @return static> - */ - public function zip($items); - - /** - * Collect the values into a collection. - * - * @return \Illuminate\Support\Collection - */ - public function collect(); - - /** - * Get the collection of items as a plain array. - * - * @return array - */ - public function toArray(); - - /** - * Convert the object into something JSON serializable. - * - * @return mixed - */ - public function jsonSerialize(): mixed; - - /** - * Get the collection of items as JSON. - * - * @param int $options - * @return string - */ - public function toJson($options = 0); - - /** - * Get a CachingIterator instance. - * - * @param int $flags - * @return \CachingIterator - */ - public function getCachingIterator($flags = CachingIterator::CALL_TOSTRING); - - /** - * Convert the collection to its string representation. - * - * @return string - */ - public function __toString(); - - /** - * Indicate that the model's string representation should be escaped when __toString is invoked. - * - * @param bool $escape - * @return $this - */ - public function escapeWhenCastingToString($escape = true); - - /** - * 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/laravel/framework/src/Illuminate/Collections/HigherOrderCollectionProxy.php b/vendor/laravel/framework/src/Illuminate/Collections/HigherOrderCollectionProxy.php deleted file mode 100644 index 106356c3..00000000 --- a/vendor/laravel/framework/src/Illuminate/Collections/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/laravel/framework/src/Illuminate/Collections/ItemNotFoundException.php b/vendor/laravel/framework/src/Illuminate/Collections/ItemNotFoundException.php deleted file mode 100644 index 05a51d95..00000000 --- a/vendor/laravel/framework/src/Illuminate/Collections/ItemNotFoundException.php +++ /dev/null @@ -1,9 +0,0 @@ - - */ -class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable -{ - /** - * @use \Illuminate\Support\Traits\EnumeratesValues - */ - use EnumeratesValues, Macroable; - - /** - * The source from which to generate items. - * - * @var (Closure(): \Generator)|static|array - */ - public $source; - - /** - * Create a new lazy collection instance. - * - * @param \Illuminate\Contracts\Support\Arrayable|iterable|(Closure(): \Generator)|self|array|null $source - * @return void - */ - public function __construct($source = null) - { - if ($source instanceof Closure || $source instanceof self) { - $this->source = $source; - } elseif (is_null($source)) { - $this->source = static::empty(); - } elseif ($source instanceof Generator) { - throw new InvalidArgumentException( - 'Generators should not be passed directly to LazyCollection. Instead, pass a generator function.' - ); - } else { - $this->source = $this->getArrayableItems($source); - } - } - - /** - * Create a new collection instance if the value isn't one already. - * - * @template TMakeKey of array-key - * @template TMakeValue - * - * @param \Illuminate\Contracts\Support\Arrayable|iterable|(Closure(): \Generator)|self|array|null $items - * @return static - */ - public static function make($items = []) - { - return new static($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(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(TValue): float|int)|string|null $callback - * @return float|int|null - */ - public function avg($callback = null) - { - return $this->collect()->avg($callback); - } - - /** - * Get the median of a given key. - * - * @param string|array|null $key - * @return float|int|null - */ - 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 (callable(TValue, TKey): bool)|TValue|string $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; - - /** @var callable $key */ - 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 exists, using strict comparison. - * - * @param (callable(TValue): bool)|TValue|array-key $key - * @param TValue|null $value - * @return bool - */ - public function containsStrict($key, $value = null) - { - if (func_num_args() === 2) { - return $this->contains(fn ($item) => 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; - } - - /** - * 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. - * - * @template TCrossJoinKey - * @template TCrossJoinValue - * - * @param \Illuminate\Contracts\Support\Arrayable|iterable ...$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(TValue, TKey): mixed)|string|null $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 \Illuminate\Contracts\Support\Arrayable|iterable $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 \Illuminate\Contracts\Support\Arrayable|iterable $items - * @param callable(TValue, TValue): int $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 \Illuminate\Contracts\Support\Arrayable|iterable $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 \Illuminate\Contracts\Support\Arrayable|iterable $items - * @param callable(TKey, TKey): int $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 \Illuminate\Contracts\Support\Arrayable|iterable $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 \Illuminate\Contracts\Support\Arrayable|iterable $items - * @param callable(TKey, TKey): int $callback - * @return static - */ - public function diffKeysUsing($items, callable $callback) - { - return $this->passthru('diffKeysUsing', func_get_args()); - } - - /** - * Retrieve duplicate items. - * - * @param (callable(TValue): bool)|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(TValue): bool)|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 \Illuminate\Support\Enumerable|array $keys - * @return static - */ - public function except($keys) - { - return $this->passthru('except', func_get_args()); - } - - /** - * Run a filter over each of the items. - * - * @param (callable(TValue, TKey): bool)|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. - * - * @template TFirstDefault - * - * @param (callable(TValue): bool)|null $callback - * @param TFirstDefault|(\Closure(): TFirstDefault) $default - * @return TValue|TFirstDefault - */ - 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. - * - * @template TGetDefault - * - * @param TKey|null $key - * @param TGetDefault|(\Closure(): TGetDefault) $default - * @return TValue|TGetDefault - */ - 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 (callable(TValue, TKey): array-key)|array|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(TValue, TKey): array-key)|array|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 callable|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 \Illuminate\Contracts\Support\Arrayable|iterable $items - * @return static - */ - public function intersect($items) - { - return $this->passthru('intersect', func_get_args()); - } - - /** - * Intersect the collection with the given items by key. - * - * @param \Illuminate\Contracts\Support\Arrayable|iterable $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. - * - * @template TLastDefault - * - * @param (callable(TValue, TKey): bool)|null $callback - * @param TLastDefault|(\Closure(): TLastDefault) $default - * @return TValue|TLastDefault - */ - 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. - * - * @template TMapValue - * - * @param callable(TValue, TKey): TMapValue $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. - * - * @template TMapToDictionaryKey of array-key - * @template TMapToDictionaryValue - * - * @param callable(TValue, TKey): array $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. - * - * @template TMapWithKeysKey of array-key - * @template TMapWithKeysValue - * - * @param callable(TValue, TKey): array $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 \Illuminate\Contracts\Support\Arrayable|iterable $items - * @return static - */ - public function merge($items) - { - return $this->passthru('merge', func_get_args()); - } - - /** - * Recursively merge the collection with the given items. - * - * @template TMergeRecursiveValue - * - * @param \Illuminate\Contracts\Support\Arrayable|iterable $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. - * - * @template TCombineValue - * - * @param \IteratorAggregate|array|(callable(): \Generator) $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 \Illuminate\Contracts\Support\Arrayable|iterable $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 \Illuminate\Support\Enumerable|array|string $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|TValue - * - * @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 \Illuminate\Contracts\Support\Arrayable|iterable $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 \Illuminate\Contracts\Support\Arrayable|iterable $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 TValue|(callable(TValue,TKey): bool) $value - * @param bool $strict - * @return TKey|bool - */ - public function search($value, $strict = false) - { - /** @var (callable(TValue,TKey): bool) $predicate */ - $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 (new static($chunk))->tap(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 TValue|callable(TValue,TKey): bool $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 TValue|callable(TValue,TKey): bool $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 (callable(TValue, TKey): bool)|string $key - * @param mixed $operator - * @param mixed $value - * @return TValue - * - * @throws \Illuminate\Support\ItemNotFoundException - * @throws \Illuminate\Support\MultipleItemsFoundException - */ - public function sole($key = null, $operator = null, $value = null) - { - $filter = func_num_args() > 1 - ? $this->operatorForWhere(...func_get_args()) - : $key; - - return $this - ->unless($filter == null) - ->filter($filter) - ->take(2) - ->collect() - ->sole(); - } - - /** - * Get the first item in the collection but throw an exception if no matching items exist. - * - * @param (callable(TValue, TKey): bool)|string $key - * @param mixed $operator - * @param mixed $value - * @return TValue - * - * @throws \Illuminate\Support\ItemNotFoundException - */ - public function firstOrFail($key = null, $operator = null, $value = null) - { - $filter = func_num_args() > 1 - ? $this->operatorForWhere(...func_get_args()) - : $key; - - return $this - ->unless($filter == null) - ->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(TValue, TKey, Collection): bool $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(TValue, TValue): int)|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 array|(callable(TValue, TKey): mixed)|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 array|(callable(TValue, TKey): mixed)|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(TKey, TKey): int $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 TValue|callable(TValue,TKey): bool $value - * @return static - */ - public function takeUntil($value) - { - /** @var callable(TValue, TKey): bool $callback */ - $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 new static(function () use ($timeout) { - if ($this->now() >= $timeout) { - return; - } - - foreach ($this as $key => $value) { - yield $key => $value; - - if ($this->now() >= $timeout) { - break; - } - } - }); - } - - /** - * Take items in the collection while the given condition is met. - * - * @param TValue|callable(TValue,TKey): bool $value - * @return static - */ - public function takeWhile($value) - { - /** @var callable(TValue, TKey): bool $callback */ - $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(TValue, TKey): mixed $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 (callable(TValue, TKey): mixed)|string|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]] - * - * @template TZipValue - * - * @param \Illuminate\Contracts\Support\Arrayable|iterable ...$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. - * - * @template TPadValue - * - * @param int $size - * @param TPadValue $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 - */ - public function getIterator(): Traversable - { - return $this->makeIterator($this->source); - } - - /** - * Count the number of items in the collection. - * - * @return int - */ - public function count(): int - { - if (is_array($this->source)) { - return count($this->source); - } - - return iterator_count($this->getIterator()); - } - - /** - * Make an iterator from the given source. - * - * @template TIteratorKey of array-key - * @template TIteratorValue - * - * @param \IteratorAggregate|array|(callable(): \Generator) $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|string[] $value - * @param string|string[]|null $key - * @return array{string[],string[]|null} - */ - 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/laravel/framework/src/Illuminate/Collections/MultipleItemsFoundException.php b/vendor/laravel/framework/src/Illuminate/Collections/MultipleItemsFoundException.php deleted file mode 100644 index d90d835b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Collections/MultipleItemsFoundException.php +++ /dev/null @@ -1,40 +0,0 @@ -count = $count; - - parent::__construct("$count items were found.", $code, $previous); - } - - /** - * Get the number of items found. - * - * @return int - */ - public function getCount() - { - return $this->count; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Collections/Traits/EnumeratesValues.php b/vendor/laravel/framework/src/Illuminate/Collections/Traits/EnumeratesValues.php deleted file mode 100644 index c7803bf8..00000000 --- a/vendor/laravel/framework/src/Illuminate/Collections/Traits/EnumeratesValues.php +++ /dev/null @@ -1,1084 +0,0 @@ - - */ - protected static $proxies = [ - 'average', - 'avg', - 'contains', - 'doesntContain', - 'each', - 'every', - 'filter', - 'first', - 'flatMap', - 'groupBy', - 'keyBy', - 'map', - 'max', - 'min', - 'partition', - 'reject', - 'skipUntil', - 'skipWhile', - 'some', - 'sortBy', - 'sortByDesc', - 'sum', - 'takeUntil', - 'takeWhile', - 'unique', - 'unless', - 'until', - 'when', - ]; - - /** - * Create a new collection instance if the value isn't one already. - * - * @template TMakeKey of array-key - * @template TMakeValue - * - * @param \Illuminate\Contracts\Support\Arrayable|iterable|null $items - * @return static - */ - public static function make($items = []) - { - return new static($items); - } - - /** - * Wrap the given value in a collection if applicable. - * - * @template TWrapKey of array-key - * @template TWrapValue - * - * @param iterable $value - * @return static - */ - public static function wrap($value) - { - return $value instanceof Enumerable - ? new static($value) - : new static(Arr::wrap($value)); - } - - /** - * Get the underlying items from the given collection if applicable. - * - * @template TUnwrapKey of array-key - * @template TUnwrapValue - * - * @param array|static $value - * @return array - */ - public static function unwrap($value) - { - return $value instanceof Enumerable ? $value->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. - * - * @template TTimesValue - * - * @param int $number - * @param (callable(int): TTimesValue)|null $callback - * @return static - */ - public static function times($number, callable $callback = null) - { - if ($number < 1) { - return new static; - } - - return static::range(1, $number) - ->unless($callback == null) - ->map($callback); - } - - /** - * Alias for the "avg" method. - * - * @param (callable(TValue): float|int)|string|null $callback - * @return float|int|null - */ - public function average($callback = null) - { - return $this->avg($callback); - } - - /** - * Alias for the "contains" method. - * - * @param (callable(TValue, TKey): bool)|TValue|string $key - * @param mixed $operator - * @param mixed $value - * @return bool - */ - public function some($key, $operator = null, $value = null) - { - return $this->contains(...func_get_args()); - } - - /** - * Dump the items and end the script. - * - * @param mixed ...$args - * @return never - */ - 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(TValue, TKey): mixed $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(...mixed): mixed $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 (callable(TValue, TKey): bool)|TValue|string $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 callable|string $key - * @param mixed $operator - * @param mixed $value - * @return TValue|null - */ - public function firstWhere($key, $operator = null, $value = null) - { - return $this->first($this->operatorForWhere(...func_get_args())); - } - - /** - * Get a single key's value from the first matching item in the collection. - * - * @param string $key - * @param mixed $default - * @return mixed - */ - public function value($key, $default = null) - { - if ($value = $this->firstWhere($key)) { - return data_get($value, $key, $default); - } - - return value($default); - } - - /** - * Determine if the collection is not empty. - * - * @return bool - */ - public function isNotEmpty() - { - return ! $this->isEmpty(); - } - - /** - * Run a map over each nested chunk of items. - * - * @template TMapSpreadValue - * - * @param callable(mixed): TMapSpreadValue $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. - * - * @template TMapToGroupsKey of array-key - * @template TMapToGroupsValue - * - * @param callable(TValue, TKey): array $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. - * - * @template TFlatMapKey of array-key - * @template TFlatMapValue - * - * @param callable(TValue, TKey): (\Illuminate\Support\Collection|array) $callback - * @return static - */ - public function flatMap(callable $callback) - { - return $this->map($callback)->collapse(); - } - - /** - * Map the values into a new class. - * - * @template TMapIntoValue - * - * @param class-string $class - * @return static - */ - public function mapInto($class) - { - return $this->map(fn ($value, $key) => new $class($value, $key)); - } - - /** - * Get the min value of a given key. - * - * @param (callable(TValue):mixed)|string|null $callback - * @return mixed - */ - public function min($callback = null) - { - $callback = $this->valueRetriever($callback); - - return $this->map(fn ($value) => $callback($value)) - ->filter(fn ($value) => ! is_null($value)) - ->reduce(fn ($result, $value) => is_null($result) || $value < $result ? $value : $result); - } - - /** - * Get the max value of a given key. - * - * @param (callable(TValue):mixed)|string|null $callback - * @return mixed - */ - public function max($callback = null) - { - $callback = $this->valueRetriever($callback); - - return $this->filter(fn ($value) => ! 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(TValue, TKey): bool)|TValue|string $key - * @param TValue|string|null $operator - * @param TValue|null $value - * @return static, 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(TValue): mixed)|string|null $callback - * @return mixed - */ - public function sum($callback = null) - { - $callback = is_null($callback) - ? $this->identity() - : $this->valueRetriever($callback); - - return $this->reduce(fn ($result, $item) => $result + $callback($item), 0); - } - - /** - * Apply the callback if the collection is empty. - * - * @template TWhenEmptyReturnType - * - * @param (callable($this): TWhenEmptyReturnType) $callback - * @param (callable($this): TWhenEmptyReturnType)|null $default - * @return $this|TWhenEmptyReturnType - */ - public function whenEmpty(callable $callback, callable $default = null) - { - return $this->when($this->isEmpty(), $callback, $default); - } - - /** - * Apply the callback if the collection is not empty. - * - * @template TWhenNotEmptyReturnType - * - * @param callable($this): TWhenNotEmptyReturnType $callback - * @param (callable($this): TWhenNotEmptyReturnType)|null $default - * @return $this|TWhenNotEmptyReturnType - */ - public function whenNotEmpty(callable $callback, callable $default = null) - { - return $this->when($this->isNotEmpty(), $callback, $default); - } - - /** - * Apply the callback unless the collection is empty. - * - * @template TUnlessEmptyReturnType - * - * @param callable($this): TUnlessEmptyReturnType $callback - * @param (callable($this): TUnlessEmptyReturnType)|null $default - * @return $this|TUnlessEmptyReturnType - */ - public function unlessEmpty(callable $callback, callable $default = null) - { - return $this->whenNotEmpty($callback, $default); - } - - /** - * Apply the callback unless the collection is not empty. - * - * @template TUnlessNotEmptyReturnType - * - * @param callable($this): TUnlessNotEmptyReturnType $callback - * @param (callable($this): TUnlessNotEmptyReturnType)|null $default - * @return $this|TUnlessNotEmptyReturnType - */ - public function unlessNotEmpty(callable $callback, callable $default = null) - { - return $this->whenEmpty($callback, $default); - } - - /** - * Filter items by the given key value pair. - * - * @param callable|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 \Illuminate\Contracts\Support\Arrayable|iterable $values - * @param bool $strict - * @return static - */ - public function whereIn($key, $values, $strict = false) - { - $values = $this->getArrayableItems($values); - - return $this->filter(fn ($item) => in_array(data_get($item, $key), $values, $strict)); - } - - /** - * Filter items by the given key value pair using strict comparison. - * - * @param string $key - * @param \Illuminate\Contracts\Support\Arrayable|iterable $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 \Illuminate\Contracts\Support\Arrayable|iterable $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 \Illuminate\Contracts\Support\Arrayable|iterable $values - * @return static - */ - public function whereNotBetween($key, $values) - { - return $this->filter( - fn ($item) => data_get($item, $key) < reset($values) || data_get($item, $key) > end($values) - ); - } - - /** - * Filter items by the given key value pair. - * - * @param string $key - * @param \Illuminate\Contracts\Support\Arrayable|iterable $values - * @param bool $strict - * @return static - */ - public function whereNotIn($key, $values, $strict = false) - { - $values = $this->getArrayableItems($values); - - return $this->reject(fn ($item) => in_array(data_get($item, $key), $values, $strict)); - } - - /** - * Filter items by the given key value pair using strict comparison. - * - * @param string $key - * @param \Illuminate\Contracts\Support\Arrayable|iterable $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). - * - * @template TWhereInstanceOf - * - * @param class-string|array> $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. - * - * @template TPipeReturnType - * - * @param callable($this): TPipeReturnType $callback - * @return TPipeReturnType - */ - public function pipe(callable $callback) - { - return $callback($this); - } - - /** - * Pass the collection into a new class. - * - * @param class-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 $callbacks - * @return mixed - */ - public function pipeThrough($callbacks) - { - return Collection::make($callbacks)->reduce( - fn ($carry, $callback) => $callback($carry), - $this, - ); - } - - /** - * Reduce the collection to a single value. - * - * @template TReduceInitial - * @template TReduceReturnType - * - * @param callable(TReduceInitial|TReduceReturnType, TValue, TKey): TReduceReturnType $callback - * @param TReduceInitial $initial - * @return TReduceReturnType - */ - 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 - * - * @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::reduceSpread expects reducer to return an array, but got a '%s' instead.", - class_basename(static::class), gettype($result) - )); - } - } - - return $result; - } - - /** - * Create a collection of all elements that do not pass a given truth test. - * - * @param (callable(TValue, TKey): bool)|bool|TValue $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; - }); - } - - /** - * Pass the collection to the given callback and then return it. - * - * @param callable($this): mixed $callback - * @return $this - */ - public function tap(callable $callback) - { - $callback($this); - - return $this; - } - - /** - * Return only unique items from the collection array. - * - * @param (callable(TValue, TKey): mixed)|string|null $key - * @param bool $strict - * @return static - */ - public function unique($key = null, $strict = false) - { - $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; - }); - } - - /** - * Return only unique items from the collection array using strict comparison. - * - * @param (callable(TValue, TKey): mixed)|string|null $key - * @return static - */ - public function uniqueStrict($key = null) - { - return $this->unique($key, true); - } - - /** - * Collect the values into a collection. - * - * @return \Illuminate\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(fn ($value) => $value instanceof Arrayable ? $value->toArray() : $value)->all(); - } - - /** - * Convert the object into something JSON serializable. - * - * @return array - */ - public function jsonSerialize(): array - { - 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 Traversable) { - return iterator_to_array($items); - } elseif ($items instanceof Jsonable) { - return json_decode($items->toJson(), true); - } elseif ($items instanceof JsonSerializable) { - return (array) $items->jsonSerialize(); - } elseif ($items instanceof UnitEnum) { - return [$items]; - } - - return (array) $items; - } - - /** - * Get an operator checker callback. - * - * @param callable|string $key - * @param string|null $operator - * @param mixed $value - * @return \Closure - */ - protected function operatorForWhere($key, $operator = null, $value = null) - { - if ($this->useAsCallable($key)) { - return $key; - } - - 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; - 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 fn ($item) => data_get($item, $value); - } - - /** - * Make a function to check an item's equality. - * - * @param mixed $value - * @return \Closure(mixed): bool - */ - protected function equality($value) - { - return fn ($item) => $item === $value; - } - - /** - * Make a function using another function, by negating its result. - * - * @param \Closure $callback - * @return \Closure - */ - protected function negate(Closure $callback) - { - return fn (...$params) => ! $callback(...$params); - } - - /** - * Make a function that returns what's passed to it. - * - * @return \Closure(TValue): TValue - */ - protected function identity() - { - return fn ($value) => $value; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Collections/composer.json b/vendor/laravel/framework/src/Illuminate/Collections/composer.json deleted file mode 100644 index cc9aad34..00000000 --- a/vendor/laravel/framework/src/Illuminate/Collections/composer.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "illuminate/collections", - "description": "The Illuminate Collections package.", - "license": "MIT", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "require": { - "php": "^8.0.2", - "illuminate/conditionable": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0" - }, - "autoload": { - "psr-4": { - "Illuminate\\Support\\": "" - }, - "files": [ - "helpers.php" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "suggest": { - "symfony/var-dumper": "Required to use the dump method (^6.0)." - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev" -} diff --git a/vendor/laravel/framework/src/Illuminate/Collections/helpers.php b/vendor/laravel/framework/src/Illuminate/Collections/helpers.php deleted file mode 100644 index 5776fead..00000000 --- a/vendor/laravel/framework/src/Illuminate/Collections/helpers.php +++ /dev/null @@ -1,190 +0,0 @@ -|iterable|null $value - * @return \Illuminate\Support\Collection - */ - function collect($value = null) - { - return new Collection($value); - } -} - -if (! function_exists('data_fill')) { - /** - * Fill in data where it's missing. - * - * @param mixed $target - * @param string|array $key - * @param mixed $value - * @return mixed - */ - function data_fill(&$target, $key, $value) - { - return data_set($target, $key, $value, false); - } -} - -if (! function_exists('data_get')) { - /** - * Get an item from an array or object using "dot" notation. - * - * @param mixed $target - * @param string|array|int|null $key - * @param mixed $default - * @return mixed - */ - function data_get($target, $key, $default = null) - { - if (is_null($key)) { - return $target; - } - - $key = is_array($key) ? $key : explode('.', $key); - - foreach ($key as $i => $segment) { - unset($key[$i]); - - if (is_null($segment)) { - return $target; - } - - if ($segment === '*') { - if ($target instanceof Collection) { - $target = $target->all(); - } elseif (! is_iterable($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('data_set')) { - /** - * Set an item on an array or object using dot notation. - * - * @param mixed $target - * @param string|array $key - * @param mixed $value - * @param bool $overwrite - * @return mixed - */ - function data_set(&$target, $key, $value, $overwrite = true) - { - $segments = is_array($key) ? $key : explode('.', $key); - - if (($segment = array_shift($segments)) === '*') { - if (! Arr::accessible($target)) { - $target = []; - } - - if ($segments) { - foreach ($target as &$inner) { - data_set($inner, $segments, $value, $overwrite); - } - } elseif ($overwrite) { - foreach ($target as &$inner) { - $inner = $value; - } - } - } elseif (Arr::accessible($target)) { - if ($segments) { - if (! Arr::exists($target, $segment)) { - $target[$segment] = []; - } - - data_set($target[$segment], $segments, $value, $overwrite); - } elseif ($overwrite || ! Arr::exists($target, $segment)) { - $target[$segment] = $value; - } - } elseif (is_object($target)) { - if ($segments) { - if (! isset($target->{$segment})) { - $target->{$segment} = []; - } - - data_set($target->{$segment}, $segments, $value, $overwrite); - } elseif ($overwrite || ! isset($target->{$segment})) { - $target->{$segment} = $value; - } - } else { - $target = []; - - if ($segments) { - data_set($target[$segment], $segments, $value, $overwrite); - } elseif ($overwrite) { - $target[$segment] = $value; - } - } - - return $target; - } -} - -if (! function_exists('head')) { - /** - * Get the first element of an array. Useful for method chaining. - * - * @param array $array - * @return mixed - */ - function head($array) - { - return reset($array); - } -} - -if (! function_exists('last')) { - /** - * Get the last element from an array. - * - * @param array $array - * @return mixed - */ - function last($array) - { - return end($array); - } -} - -if (! function_exists('value')) { - /** - * Return the default value of the given value. - * - * @param mixed $value - * @param mixed $args - * @return mixed - */ - function value($value, ...$args) - { - return $value instanceof Closure ? $value(...$args) : $value; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Conditionable/HigherOrderWhenProxy.php b/vendor/laravel/framework/src/Illuminate/Conditionable/HigherOrderWhenProxy.php deleted file mode 100644 index 579114cf..00000000 --- a/vendor/laravel/framework/src/Illuminate/Conditionable/HigherOrderWhenProxy.php +++ /dev/null @@ -1,109 +0,0 @@ -target = $target; - } - - /** - * Set the condition on the proxy. - * - * @param bool $condition - * @return $this - */ - public function condition($condition) - { - [$this->condition, $this->hasCondition] = [$condition, true]; - - return $this; - } - - /** - * Indicate that the condition should be negated. - * - * @return $this - */ - public function negateConditionOnCapture() - { - $this->negateConditionOnCapture = true; - - return $this; - } - - /** - * Proxy accessing an attribute onto the target. - * - * @param string $key - * @return mixed - */ - public function __get($key) - { - if (! $this->hasCondition) { - $condition = $this->target->{$key}; - - return $this->condition($this->negateConditionOnCapture ? ! $condition : $condition); - } - - return $this->condition - ? $this->target->{$key} - : $this->target; - } - - /** - * Proxy a method call on the target. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - if (! $this->hasCondition) { - $condition = $this->target->{$method}(...$parameters); - - return $this->condition($this->negateConditionOnCapture ? ! $condition : $condition); - } - - return $this->condition - ? $this->target->{$method}(...$parameters) - : $this->target; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Conditionable/LICENSE.md b/vendor/laravel/framework/src/Illuminate/Conditionable/LICENSE.md deleted file mode 100644 index 79810c84..00000000 --- a/vendor/laravel/framework/src/Illuminate/Conditionable/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Taylor Otwell - -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/laravel/framework/src/Illuminate/Conditionable/Traits/Conditionable.php b/vendor/laravel/framework/src/Illuminate/Conditionable/Traits/Conditionable.php deleted file mode 100644 index dcd25469..00000000 --- a/vendor/laravel/framework/src/Illuminate/Conditionable/Traits/Conditionable.php +++ /dev/null @@ -1,73 +0,0 @@ -condition($value); - } - - if ($value) { - return $callback($this, $value) ?? $this; - } elseif ($default) { - return $default($this, $value) ?? $this; - } - - return $this; - } - - /** - * Apply the callback if the given "value" is (or resolves to) falsy. - * - * @template TUnlessParameter - * @template TUnlessReturnType - * - * @param (\Closure($this): TUnlessParameter)|TUnlessParameter|null $value - * @param (callable($this, TUnlessParameter): TUnlessReturnType)|null $callback - * @param (callable($this, TUnlessParameter): TUnlessReturnType)|null $default - * @return $this|TUnlessReturnType - */ - public function unless($value = null, callable $callback = null, callable $default = null) - { - $value = $value instanceof Closure ? $value($this) : $value; - - if (func_num_args() === 0) { - return (new HigherOrderWhenProxy($this))->negateConditionOnCapture(); - } - - if (func_num_args() === 1) { - return (new HigherOrderWhenProxy($this))->condition(! $value); - } - - if (! $value) { - return $callback($this, $value) ?? $this; - } elseif ($default) { - return $default($this, $value) ?? $this; - } - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Conditionable/composer.json b/vendor/laravel/framework/src/Illuminate/Conditionable/composer.json deleted file mode 100644 index a423aad1..00000000 --- a/vendor/laravel/framework/src/Illuminate/Conditionable/composer.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "illuminate/conditionable", - "description": "The Illuminate Conditionable package.", - "license": "MIT", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "require": { - "php": "^8.0.2" - }, - "autoload": { - "psr-4": { - "Illuminate\\Support\\": "" - } - }, - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev" -} diff --git a/vendor/laravel/framework/src/Illuminate/Config/LICENSE.md b/vendor/laravel/framework/src/Illuminate/Config/LICENSE.md deleted file mode 100644 index 79810c84..00000000 --- a/vendor/laravel/framework/src/Illuminate/Config/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Taylor Otwell - -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/laravel/framework/src/Illuminate/Config/Repository.php b/vendor/laravel/framework/src/Illuminate/Config/Repository.php deleted file mode 100644 index 640d6731..00000000 --- a/vendor/laravel/framework/src/Illuminate/Config/Repository.php +++ /dev/null @@ -1,182 +0,0 @@ -items = $items; - } - - /** - * Determine if the given configuration value exists. - * - * @param string $key - * @return bool - */ - public function has($key) - { - return Arr::has($this->items, $key); - } - - /** - * Get the specified configuration value. - * - * @param array|string $key - * @param mixed $default - * @return mixed - */ - public function get($key, $default = null) - { - if (is_array($key)) { - return $this->getMany($key); - } - - return Arr::get($this->items, $key, $default); - } - - /** - * Get many configuration values. - * - * @param array $keys - * @return array - */ - public function getMany($keys) - { - $config = []; - - foreach ($keys as $key => $default) { - if (is_numeric($key)) { - [$key, $default] = [$default, null]; - } - - $config[$key] = Arr::get($this->items, $key, $default); - } - - return $config; - } - - /** - * Set a given configuration value. - * - * @param array|string $key - * @param mixed $value - * @return void - */ - public function set($key, $value = null) - { - $keys = is_array($key) ? $key : [$key => $value]; - - foreach ($keys as $key => $value) { - Arr::set($this->items, $key, $value); - } - } - - /** - * Prepend a value onto an array configuration value. - * - * @param string $key - * @param mixed $value - * @return void - */ - public function prepend($key, $value) - { - $array = $this->get($key, []); - - array_unshift($array, $value); - - $this->set($key, $array); - } - - /** - * Push a value onto an array configuration value. - * - * @param string $key - * @param mixed $value - * @return void - */ - public function push($key, $value) - { - $array = $this->get($key, []); - - $array[] = $value; - - $this->set($key, $array); - } - - /** - * Get all of the configuration items for the application. - * - * @return array - */ - public function all() - { - return $this->items; - } - - /** - * Determine if the given configuration option exists. - * - * @param string $key - * @return bool - */ - public function offsetExists($key): bool - { - return $this->has($key); - } - - /** - * Get a configuration option. - * - * @param string $key - * @return mixed - */ - public function offsetGet($key): mixed - { - return $this->get($key); - } - - /** - * Set a configuration option. - * - * @param string $key - * @param mixed $value - * @return void - */ - public function offsetSet($key, $value): void - { - $this->set($key, $value); - } - - /** - * Unset a configuration option. - * - * @param string $key - * @return void - */ - public function offsetUnset($key): void - { - $this->set($key, null); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Config/composer.json b/vendor/laravel/framework/src/Illuminate/Config/composer.json deleted file mode 100755 index bc2e8e5c..00000000 --- a/vendor/laravel/framework/src/Illuminate/Config/composer.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "illuminate/config", - "description": "The Illuminate Config package.", - "license": "MIT", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "require": { - "php": "^8.0.2", - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0" - }, - "autoload": { - "psr-4": { - "Illuminate\\Config\\": "" - } - }, - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev" -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/Application.php b/vendor/laravel/framework/src/Illuminate/Console/Application.php deleted file mode 100755 index 78a8c046..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/Application.php +++ /dev/null @@ -1,347 +0,0 @@ -laravel = $laravel; - $this->events = $events; - $this->setAutoExit(false); - $this->setCatchExceptions(false); - - $this->events->dispatch(new ArtisanStarting($this)); - - $this->bootstrap(); - } - - /** - * {@inheritdoc} - * - * @return int - */ - public function run(InputInterface $input = null, OutputInterface $output = null): int - { - $commandName = $this->getCommandName( - $input = $input ?: new ArgvInput - ); - - $this->events->dispatch( - new CommandStarting( - $commandName, $input, $output = $output ?: new BufferedConsoleOutput - ) - ); - - $exitCode = parent::run($input, $output); - - $this->events->dispatch( - new CommandFinished($commandName, $input, $output, $exitCode) - ); - - return $exitCode; - } - - /** - * Determine the proper PHP executable. - * - * @return string - */ - public static function phpBinary() - { - return ProcessUtils::escapeArgument((new PhpExecutableFinder)->find(false)); - } - - /** - * Determine the proper Artisan executable. - * - * @return string - */ - public static function artisanBinary() - { - return ProcessUtils::escapeArgument(defined('ARTISAN_BINARY') ? ARTISAN_BINARY : 'artisan'); - } - - /** - * Format the given command as a fully-qualified executable command. - * - * @param string $string - * @return string - */ - public static function formatCommandString($string) - { - return sprintf('%s %s %s', static::phpBinary(), static::artisanBinary(), $string); - } - - /** - * Register a console "starting" bootstrapper. - * - * @param \Closure $callback - * @return void - */ - public static function starting(Closure $callback) - { - static::$bootstrappers[] = $callback; - } - - /** - * Bootstrap the console application. - * - * @return void - */ - protected function bootstrap() - { - foreach (static::$bootstrappers as $bootstrapper) { - $bootstrapper($this); - } - } - - /** - * Clear the console application bootstrappers. - * - * @return void - */ - public static function forgetBootstrappers() - { - static::$bootstrappers = []; - } - - /** - * Run an Artisan console command by name. - * - * @param string $command - * @param array $parameters - * @param \Symfony\Component\Console\Output\OutputInterface|null $outputBuffer - * @return int - * - * @throws \Symfony\Component\Console\Exception\CommandNotFoundException - */ - public function call($command, array $parameters = [], $outputBuffer = null) - { - [$command, $input] = $this->parseCommand($command, $parameters); - - if (! $this->has($command)) { - throw new CommandNotFoundException(sprintf('The command "%s" does not exist.', $command)); - } - - return $this->run( - $input, $this->lastOutput = $outputBuffer ?: new BufferedOutput - ); - } - - /** - * Parse the incoming Artisan command and its input. - * - * @param string $command - * @param array $parameters - * @return array - */ - protected function parseCommand($command, $parameters) - { - if (is_subclass_of($command, SymfonyCommand::class)) { - $callingClass = true; - - $command = $this->laravel->make($command)->getName(); - } - - if (! isset($callingClass) && empty($parameters)) { - $command = $this->getCommandName($input = new StringInput($command)); - } else { - array_unshift($parameters, $command); - - $input = new ArrayInput($parameters); - } - - return [$command, $input]; - } - - /** - * Get the output for the last run command. - * - * @return string - */ - public function output() - { - return $this->lastOutput && method_exists($this->lastOutput, 'fetch') - ? $this->lastOutput->fetch() - : ''; - } - - /** - * Add a command to the console. - * - * @param \Symfony\Component\Console\Command\Command $command - * @return \Symfony\Component\Console\Command\Command - */ - public function add(SymfonyCommand $command) - { - if ($command instanceof Command) { - $command->setLaravel($this->laravel); - } - - return $this->addToParent($command); - } - - /** - * Add the command to the parent instance. - * - * @param \Symfony\Component\Console\Command\Command $command - * @return \Symfony\Component\Console\Command\Command - */ - protected function addToParent(SymfonyCommand $command) - { - return parent::add($command); - } - - /** - * Add a command, resolving through the application. - * - * @param \Illuminate\Console\Command|string $command - * @return \Symfony\Component\Console\Command\Command|null - */ - public function resolve($command) - { - if (is_subclass_of($command, SymfonyCommand::class) && ($commandName = $command::getDefaultName())) { - $this->commandMap[$commandName] = $command; - - return null; - } - - if ($command instanceof Command) { - return $this->add($command); - } - - return $this->add($this->laravel->make($command)); - } - - /** - * Resolve an array of commands through the application. - * - * @param array|mixed $commands - * @return $this - */ - public function resolveCommands($commands) - { - $commands = is_array($commands) ? $commands : func_get_args(); - - foreach ($commands as $command) { - $this->resolve($command); - } - - return $this; - } - - /** - * Set the container command loader for lazy resolution. - * - * @return $this - */ - public function setContainerCommandLoader() - { - $this->setCommandLoader(new ContainerCommandLoader($this->laravel, $this->commandMap)); - - return $this; - } - - /** - * Get the default input definition for the application. - * - * This is used to add the --env option to every available command. - * - * @return \Symfony\Component\Console\Input\InputDefinition - */ - protected function getDefaultInputDefinition(): InputDefinition - { - return tap(parent::getDefaultInputDefinition(), function ($definition) { - $definition->addOption($this->getEnvironmentOption()); - }); - } - - /** - * Get the global environment option for the definition. - * - * @return \Symfony\Component\Console\Input\InputOption - */ - protected function getEnvironmentOption() - { - $message = 'The environment the command should run under'; - - return new InputOption('--env', null, InputOption::VALUE_OPTIONAL, $message); - } - - /** - * Get the Laravel application instance. - * - * @return \Illuminate\Contracts\Foundation\Application - */ - public function getLaravel() - { - return $this->laravel; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/BufferedConsoleOutput.php b/vendor/laravel/framework/src/Illuminate/Console/BufferedConsoleOutput.php deleted file mode 100644 index 4bb5ca22..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/BufferedConsoleOutput.php +++ /dev/null @@ -1,41 +0,0 @@ -buffer, function () { - $this->buffer = ''; - }); - } - - /** - * {@inheritdoc} - */ - protected function doWrite(string $message, bool $newline) - { - $this->buffer .= $message; - - if ($newline) { - $this->buffer .= \PHP_EOL; - } - - return parent::doWrite($message, $newline); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/CacheCommandMutex.php b/vendor/laravel/framework/src/Illuminate/Console/CacheCommandMutex.php deleted file mode 100644 index 223174c3..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/CacheCommandMutex.php +++ /dev/null @@ -1,98 +0,0 @@ -cache = $cache; - } - - /** - * Attempt to obtain a command mutex for the given command. - * - * @param \Illuminate\Console\Command $command - * @return bool - */ - public function create($command) - { - return $this->cache->store($this->store)->add( - $this->commandMutexName($command), - true, - method_exists($command, 'isolationLockExpiresAt') - ? $command->isolationLockExpiresAt() - : CarbonInterval::hour(), - ); - } - - /** - * Determine if a command mutex exists for the given command. - * - * @param \Illuminate\Console\Command $command - * @return bool - */ - public function exists($command) - { - return $this->cache->store($this->store)->has( - $this->commandMutexName($command) - ); - } - - /** - * Release the mutex for the given command. - * - * @param \Illuminate\Console\Command $command - * @return bool - */ - public function forget($command) - { - return $this->cache->store($this->store)->forget( - $this->commandMutexName($command) - ); - } - - /** - * @param \Illuminate\Console\Command $command - * @return string - */ - protected function commandMutexName($command) - { - return 'framework'.DIRECTORY_SEPARATOR.'command-'.$command->getName(); - } - - /** - * Specify the cache store that should be used. - * - * @param string|null $store - * @return $this - */ - public function useStore($store) - { - $this->store = $store; - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/Command.php b/vendor/laravel/framework/src/Illuminate/Console/Command.php deleted file mode 100755 index 8b4001cb..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/Command.php +++ /dev/null @@ -1,267 +0,0 @@ -signature)) { - $this->configureUsingFluentDefinition(); - } else { - parent::__construct($this->name); - } - - // Once we have constructed the command, we'll set the description and other - // related properties of the command. If a signature wasn't used to build - // the command we'll set the arguments and the options on this command. - if (! isset($this->description)) { - $this->setDescription((string) static::getDefaultDescription()); - } else { - $this->setDescription((string) $this->description); - } - - $this->setHelp((string) $this->help); - - $this->setHidden($this->isHidden()); - - if (! isset($this->signature)) { - $this->specifyParameters(); - } - - if ($this instanceof Isolatable) { - $this->configureIsolation(); - } - } - - /** - * Configure the console command using a fluent definition. - * - * @return void - */ - protected function configureUsingFluentDefinition() - { - [$name, $arguments, $options] = Parser::parse($this->signature); - - parent::__construct($this->name = $name); - - // After parsing the signature we will spin through the arguments and options - // and set them on this command. These will already be changed into proper - // instances of these "InputArgument" and "InputOption" Symfony classes. - $this->getDefinition()->addArguments($arguments); - $this->getDefinition()->addOptions($options); - } - - /** - * Configure the console command for isolation. - * - * @return void - */ - protected function configureIsolation() - { - $this->getDefinition()->addOption(new InputOption( - 'isolated', - null, - InputOption::VALUE_OPTIONAL, - 'Do not run the command if another instance of the command is already running', - false - )); - } - - /** - * Run the console command. - * - * @param \Symfony\Component\Console\Input\InputInterface $input - * @param \Symfony\Component\Console\Output\OutputInterface $output - * @return int - */ - public function run(InputInterface $input, OutputInterface $output): int - { - $this->output = $this->laravel->make( - OutputStyle::class, ['input' => $input, 'output' => $output] - ); - - $this->components = $this->laravel->make(Factory::class, ['output' => $this->output]); - - try { - return parent::run( - $this->input = $input, $this->output - ); - } finally { - $this->untrap(); - } - } - - /** - * Execute the console command. - * - * @param \Symfony\Component\Console\Input\InputInterface $input - * @param \Symfony\Component\Console\Output\OutputInterface $output - * @return int - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - if ($this instanceof Isolatable && $this->option('isolated') !== false && - ! $this->commandIsolationMutex()->create($this)) { - $this->comment(sprintf( - 'The [%s] command is already running.', $this->getName() - )); - - return (int) (is_numeric($this->option('isolated')) - ? $this->option('isolated') - : self::SUCCESS); - } - - $method = method_exists($this, 'handle') ? 'handle' : '__invoke'; - - try { - return (int) $this->laravel->call([$this, $method]); - } finally { - if ($this instanceof Isolatable && $this->option('isolated') !== false) { - $this->commandIsolationMutex()->forget($this); - } - } - } - - /** - * Get a command isolation mutex instance for the command. - * - * @return \Illuminate\Console\CommandMutex - */ - protected function commandIsolationMutex() - { - return $this->laravel->bound(CommandMutex::class) - ? $this->laravel->make(CommandMutex::class) - : $this->laravel->make(CacheCommandMutex::class); - } - - /** - * Resolve the console command instance for the given command. - * - * @param \Symfony\Component\Console\Command\Command|string $command - * @return \Symfony\Component\Console\Command\Command - */ - protected function resolveCommand($command) - { - if (! class_exists($command)) { - return $this->getApplication()->find($command); - } - - $command = $this->laravel->make($command); - - if ($command instanceof SymfonyCommand) { - $command->setApplication($this->getApplication()); - } - - if ($command instanceof self) { - $command->setLaravel($this->getLaravel()); - } - - return $command; - } - - /** - * {@inheritdoc} - * - * @return bool - */ - public function isHidden(): bool - { - return $this->hidden; - } - - /** - * {@inheritdoc} - */ - public function setHidden(bool $hidden = true): static - { - parent::setHidden($this->hidden = $hidden); - - return $this; - } - - /** - * Get the Laravel application instance. - * - * @return \Illuminate\Contracts\Foundation\Application - */ - public function getLaravel() - { - return $this->laravel; - } - - /** - * Set the Laravel application instance. - * - * @param \Illuminate\Contracts\Container\Container $laravel - * @return void - */ - public function setLaravel($laravel) - { - $this->laravel = $laravel; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/CommandMutex.php b/vendor/laravel/framework/src/Illuminate/Console/CommandMutex.php deleted file mode 100644 index 71961281..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/CommandMutex.php +++ /dev/null @@ -1,30 +0,0 @@ -runCommand($command, $arguments, $this->output); - } - - /** - * Call another console command without output. - * - * @param \Symfony\Component\Console\Command\Command|string $command - * @param array $arguments - * @return int - */ - public function callSilent($command, array $arguments = []) - { - return $this->runCommand($command, $arguments, new NullOutput); - } - - /** - * Call another console command without output. - * - * @param \Symfony\Component\Console\Command\Command|string $command - * @param array $arguments - * @return int - */ - public function callSilently($command, array $arguments = []) - { - return $this->callSilent($command, $arguments); - } - - /** - * Run the given the console command. - * - * @param \Symfony\Component\Console\Command\Command|string $command - * @param array $arguments - * @param \Symfony\Component\Console\Output\OutputInterface $output - * @return int - */ - protected function runCommand($command, array $arguments, OutputInterface $output) - { - $arguments['command'] = $command; - - return $this->resolveCommand($command)->run( - $this->createInputFromArguments($arguments), $output - ); - } - - /** - * Create an input instance from the given arguments. - * - * @param array $arguments - * @return \Symfony\Component\Console\Input\ArrayInput - */ - protected function createInputFromArguments(array $arguments) - { - return tap(new ArrayInput(array_merge($this->context(), $arguments)), function ($input) { - if ($input->getParameterOption('--no-interaction')) { - $input->setInteractive(false); - } - }); - } - - /** - * Get all of the context passed to the command. - * - * @return array - */ - protected function context() - { - return collect($this->option())->only([ - 'ansi', - 'no-ansi', - 'no-interaction', - 'quiet', - 'verbose', - ])->filter()->mapWithKeys(function ($value, $key) { - return ["--{$key}" => $value]; - })->all(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/Concerns/CreatesMatchingTest.php b/vendor/laravel/framework/src/Illuminate/Console/Concerns/CreatesMatchingTest.php deleted file mode 100644 index 4182a007..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/Concerns/CreatesMatchingTest.php +++ /dev/null @@ -1,44 +0,0 @@ - 'PHPUnit', 'pest' => 'Pest'] as $option => $name) { - $this->getDefinition()->addOption(new InputOption( - $option, - null, - InputOption::VALUE_NONE, - "Generate an accompanying {$name} test for the {$this->type}" - )); - } - } - - /** - * Create the matching test case if requested. - * - * @param string $path - * @return bool - */ - protected function handleTestCreation($path) - { - if (! $this->option('test') && ! $this->option('pest')) { - return false; - } - - return $this->callSilent('make:test', [ - 'name' => Str::of($path)->after($this->laravel['path'])->beforeLast('.php')->append('Test')->replace('\\', '/'), - '--pest' => $this->option('pest'), - ]) == 0; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/Concerns/HasParameters.php b/vendor/laravel/framework/src/Illuminate/Console/Concerns/HasParameters.php deleted file mode 100644 index 157cb190..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/Concerns/HasParameters.php +++ /dev/null @@ -1,56 +0,0 @@ -getArguments() as $arguments) { - if ($arguments instanceof InputArgument) { - $this->getDefinition()->addArgument($arguments); - } else { - $this->addArgument(...$arguments); - } - } - - foreach ($this->getOptions() as $options) { - if ($options instanceof InputOption) { - $this->getDefinition()->addOption($options); - } else { - $this->addOption(...$options); - } - } - } - - /** - * Get the console command arguments. - * - * @return array - */ - protected function getArguments() - { - return []; - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return []; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/Concerns/InteractsWithIO.php b/vendor/laravel/framework/src/Illuminate/Console/Concerns/InteractsWithIO.php deleted file mode 100644 index 13f61975..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/Concerns/InteractsWithIO.php +++ /dev/null @@ -1,453 +0,0 @@ - OutputInterface::VERBOSITY_VERBOSE, - 'vv' => OutputInterface::VERBOSITY_VERY_VERBOSE, - 'vvv' => OutputInterface::VERBOSITY_DEBUG, - 'quiet' => OutputInterface::VERBOSITY_QUIET, - 'normal' => OutputInterface::VERBOSITY_NORMAL, - ]; - - /** - * Determine if the given argument is present. - * - * @param string|int $name - * @return bool - */ - public function hasArgument($name) - { - return $this->input->hasArgument($name); - } - - /** - * Get the value of a command argument. - * - * @param string|null $key - * @return array|string|bool|null - */ - public function argument($key = null) - { - if (is_null($key)) { - return $this->input->getArguments(); - } - - return $this->input->getArgument($key); - } - - /** - * Get all of the arguments passed to the command. - * - * @return array - */ - public function arguments() - { - return $this->argument(); - } - - /** - * Determine if the given option is present. - * - * @param string $name - * @return bool - */ - public function hasOption($name) - { - return $this->input->hasOption($name); - } - - /** - * Get the value of a command option. - * - * @param string|null $key - * @return string|array|bool|null - */ - public function option($key = null) - { - if (is_null($key)) { - return $this->input->getOptions(); - } - - return $this->input->getOption($key); - } - - /** - * Get all of the options passed to the command. - * - * @return array - */ - public function options() - { - return $this->option(); - } - - /** - * Confirm a question with the user. - * - * @param string $question - * @param bool $default - * @return bool - */ - public function confirm($question, $default = false) - { - return $this->output->confirm($question, $default); - } - - /** - * Prompt the user for input. - * - * @param string $question - * @param string|null $default - * @return mixed - */ - public function ask($question, $default = null) - { - return $this->output->ask($question, $default); - } - - /** - * Prompt the user for input with auto completion. - * - * @param string $question - * @param array|callable $choices - * @param string|null $default - * @return mixed - */ - public function anticipate($question, $choices, $default = null) - { - return $this->askWithCompletion($question, $choices, $default); - } - - /** - * Prompt the user for input with auto completion. - * - * @param string $question - * @param array|callable $choices - * @param string|null $default - * @return mixed - */ - public function askWithCompletion($question, $choices, $default = null) - { - $question = new Question($question, $default); - - is_callable($choices) - ? $question->setAutocompleterCallback($choices) - : $question->setAutocompleterValues($choices); - - return $this->output->askQuestion($question); - } - - /** - * Prompt the user for input but hide the answer from the console. - * - * @param string $question - * @param bool $fallback - * @return mixed - */ - public function secret($question, $fallback = true) - { - $question = new Question($question); - - $question->setHidden(true)->setHiddenFallback($fallback); - - return $this->output->askQuestion($question); - } - - /** - * Give the user a single choice from an array of answers. - * - * @param string $question - * @param array $choices - * @param string|int|null $default - * @param mixed|null $attempts - * @param bool $multiple - * @return string|array - */ - public function choice($question, array $choices, $default = null, $attempts = null, $multiple = false) - { - $question = new ChoiceQuestion($question, $choices, $default); - - $question->setMaxAttempts($attempts)->setMultiselect($multiple); - - return $this->output->askQuestion($question); - } - - /** - * Format input to textual table. - * - * @param array $headers - * @param \Illuminate\Contracts\Support\Arrayable|array $rows - * @param \Symfony\Component\Console\Helper\TableStyle|string $tableStyle - * @param array $columnStyles - * @return void - */ - public function table($headers, $rows, $tableStyle = 'default', array $columnStyles = []) - { - $table = new Table($this->output); - - if ($rows instanceof Arrayable) { - $rows = $rows->toArray(); - } - - $table->setHeaders((array) $headers)->setRows($rows)->setStyle($tableStyle); - - foreach ($columnStyles as $columnIndex => $columnStyle) { - $table->setColumnStyle($columnIndex, $columnStyle); - } - - $table->render(); - } - - /** - * Execute a given callback while advancing a progress bar. - * - * @param iterable|int $totalSteps - * @param \Closure $callback - * @return mixed|void - */ - public function withProgressBar($totalSteps, Closure $callback) - { - $bar = $this->output->createProgressBar( - is_iterable($totalSteps) ? count($totalSteps) : $totalSteps - ); - - $bar->start(); - - if (is_iterable($totalSteps)) { - foreach ($totalSteps as $value) { - $callback($value, $bar); - - $bar->advance(); - } - } else { - $callback($bar); - } - - $bar->finish(); - - if (is_iterable($totalSteps)) { - return $totalSteps; - } - } - - /** - * Write a string as information output. - * - * @param string $string - * @param int|string|null $verbosity - * @return void - */ - public function info($string, $verbosity = null) - { - $this->line($string, 'info', $verbosity); - } - - /** - * Write a string as standard output. - * - * @param string $string - * @param string|null $style - * @param int|string|null $verbosity - * @return void - */ - public function line($string, $style = null, $verbosity = null) - { - $styled = $style ? "<$style>$string" : $string; - - $this->output->writeln($styled, $this->parseVerbosity($verbosity)); - } - - /** - * Write a string as comment output. - * - * @param string $string - * @param int|string|null $verbosity - * @return void - */ - public function comment($string, $verbosity = null) - { - $this->line($string, 'comment', $verbosity); - } - - /** - * Write a string as question output. - * - * @param string $string - * @param int|string|null $verbosity - * @return void - */ - public function question($string, $verbosity = null) - { - $this->line($string, 'question', $verbosity); - } - - /** - * Write a string as error output. - * - * @param string $string - * @param int|string|null $verbosity - * @return void - */ - public function error($string, $verbosity = null) - { - $this->line($string, 'error', $verbosity); - } - - /** - * Write a string as warning output. - * - * @param string $string - * @param int|string|null $verbosity - * @return void - */ - public function warn($string, $verbosity = null) - { - if (! $this->output->getFormatter()->hasStyle('warning')) { - $style = new OutputFormatterStyle('yellow'); - - $this->output->getFormatter()->setStyle('warning', $style); - } - - $this->line($string, 'warning', $verbosity); - } - - /** - * Write a string in an alert box. - * - * @param string $string - * @param int|string|null $verbosity - * @return void - */ - public function alert($string, $verbosity = null) - { - $length = Str::length(strip_tags($string)) + 12; - - $this->comment(str_repeat('*', $length), $verbosity); - $this->comment('* '.$string.' *', $verbosity); - $this->comment(str_repeat('*', $length), $verbosity); - - $this->comment('', $verbosity); - } - - /** - * Write a blank line. - * - * @param int $count - * @return $this - */ - public function newLine($count = 1) - { - $this->output->newLine($count); - - return $this; - } - - /** - * Set the input interface implementation. - * - * @param \Symfony\Component\Console\Input\InputInterface $input - * @return void - */ - public function setInput(InputInterface $input) - { - $this->input = $input; - } - - /** - * Set the output interface implementation. - * - * @param \Illuminate\Console\OutputStyle $output - * @return void - */ - public function setOutput(OutputStyle $output) - { - $this->output = $output; - } - - /** - * Set the verbosity level. - * - * @param string|int $level - * @return void - */ - protected function setVerbosity($level) - { - $this->verbosity = $this->parseVerbosity($level); - } - - /** - * Get the verbosity level in terms of Symfony's OutputInterface level. - * - * @param string|int|null $level - * @return int - */ - protected function parseVerbosity($level = null) - { - if (isset($this->verbosityMap[$level])) { - $level = $this->verbosityMap[$level]; - } elseif (! is_int($level)) { - $level = $this->verbosity; - } - - return $level; - } - - /** - * Get the output implementation. - * - * @return \Illuminate\Console\OutputStyle - */ - public function getOutput() - { - return $this->output; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/Concerns/InteractsWithSignals.php b/vendor/laravel/framework/src/Illuminate/Console/Concerns/InteractsWithSignals.php deleted file mode 100644 index 895072c1..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/Concerns/InteractsWithSignals.php +++ /dev/null @@ -1,51 +0,0 @@ -|int $signals - * @param callable(int $signal): void $callback - * @return void - */ - public function trap($signals, $callback) - { - Signals::whenAvailable(function () use ($signals, $callback) { - $this->signals ??= new Signals( - $this->getApplication()->getSignalRegistry(), - ); - - collect(Arr::wrap($signals)) - ->each(fn ($signal) => $this->signals->register($signal, $callback)); - }); - } - - /** - * Untrap signal handlers set within the command's handler. - * - * @return void - * - * @internal - */ - public function untrap() - { - if (! is_null($this->signals)) { - $this->signals->unregister(); - - $this->signals = null; - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/ConfirmableTrait.php b/vendor/laravel/framework/src/Illuminate/Console/ConfirmableTrait.php deleted file mode 100644 index bf639706..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/ConfirmableTrait.php +++ /dev/null @@ -1,54 +0,0 @@ -getDefaultConfirmCallback() : $callback; - - $shouldConfirm = value($callback); - - if ($shouldConfirm) { - if ($this->hasOption('force') && $this->option('force')) { - return true; - } - - $this->components->alert($warning); - - $confirmed = $this->components->confirm('Do you really wish to run this command?'); - - if (! $confirmed) { - $this->newLine(); - - $this->components->warn('Command canceled.'); - - return false; - } - } - - return true; - } - - /** - * Get the default confirmation callback. - * - * @return \Closure - */ - protected function getDefaultConfirmCallback() - { - return function () { - return $this->getLaravel()->environment() === 'production'; - }; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/ContainerCommandLoader.php b/vendor/laravel/framework/src/Illuminate/Console/ContainerCommandLoader.php deleted file mode 100644 index f770f6c7..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/ContainerCommandLoader.php +++ /dev/null @@ -1,76 +0,0 @@ -container = $container; - $this->commandMap = $commandMap; - } - - /** - * Resolve a command from the container. - * - * @param string $name - * @return \Symfony\Component\Console\Command\Command - * - * @throws \Symfony\Component\Console\Exception\CommandNotFoundException - */ - public function get(string $name): Command - { - if (! $this->has($name)) { - throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name)); - } - - return $this->container->get($this->commandMap[$name]); - } - - /** - * Determines if a command exists. - * - * @param string $name - * @return bool - */ - public function has(string $name): bool - { - return $name && isset($this->commandMap[$name]); - } - - /** - * Get the command names. - * - * @return string[] - */ - public function getNames(): array - { - return array_keys($this->commandMap); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/Contracts/NewLineAware.php b/vendor/laravel/framework/src/Illuminate/Console/Contracts/NewLineAware.php deleted file mode 100644 index 135cecba..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/Contracts/NewLineAware.php +++ /dev/null @@ -1,13 +0,0 @@ -artisan = $artisan; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/Events/CommandFinished.php b/vendor/laravel/framework/src/Illuminate/Console/Events/CommandFinished.php deleted file mode 100644 index ef066af3..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/Events/CommandFinished.php +++ /dev/null @@ -1,54 +0,0 @@ -input = $input; - $this->output = $output; - $this->command = $command; - $this->exitCode = $exitCode; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/Events/CommandStarting.php b/vendor/laravel/framework/src/Illuminate/Console/Events/CommandStarting.php deleted file mode 100644 index c6238b5d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/Events/CommandStarting.php +++ /dev/null @@ -1,45 +0,0 @@ -input = $input; - $this->output = $output; - $this->command = $command; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/Events/ScheduledBackgroundTaskFinished.php b/vendor/laravel/framework/src/Illuminate/Console/Events/ScheduledBackgroundTaskFinished.php deleted file mode 100644 index d9e63c2e..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/Events/ScheduledBackgroundTaskFinished.php +++ /dev/null @@ -1,26 +0,0 @@ -task = $task; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/Events/ScheduledTaskFailed.php b/vendor/laravel/framework/src/Illuminate/Console/Events/ScheduledTaskFailed.php deleted file mode 100644 index 46857ad8..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/Events/ScheduledTaskFailed.php +++ /dev/null @@ -1,36 +0,0 @@ -task = $task; - $this->exception = $exception; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/Events/ScheduledTaskFinished.php b/vendor/laravel/framework/src/Illuminate/Console/Events/ScheduledTaskFinished.php deleted file mode 100644 index 61469662..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/Events/ScheduledTaskFinished.php +++ /dev/null @@ -1,35 +0,0 @@ -task = $task; - $this->runtime = $runtime; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/Events/ScheduledTaskSkipped.php b/vendor/laravel/framework/src/Illuminate/Console/Events/ScheduledTaskSkipped.php deleted file mode 100644 index cfa7141d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/Events/ScheduledTaskSkipped.php +++ /dev/null @@ -1,26 +0,0 @@ -task = $task; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/Events/ScheduledTaskStarting.php b/vendor/laravel/framework/src/Illuminate/Console/Events/ScheduledTaskStarting.php deleted file mode 100644 index 66aaaa4c..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/Events/ScheduledTaskStarting.php +++ /dev/null @@ -1,26 +0,0 @@ -task = $task; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/GeneratorCommand.php b/vendor/laravel/framework/src/Illuminate/Console/GeneratorCommand.php deleted file mode 100644 index 1beebcbd..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/GeneratorCommand.php +++ /dev/null @@ -1,442 +0,0 @@ -addTestOptions(); - } - - $this->files = $files; - } - - /** - * Get the stub file for the generator. - * - * @return string - */ - abstract protected function getStub(); - - /** - * Execute the console command. - * - * @return bool|null - * - * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException - */ - public function handle() - { - // First we need to ensure that the given name is not a reserved word within the PHP - // language and that the class name will actually be valid. If it is not valid we - // can error now and prevent from polluting the filesystem using invalid files. - if ($this->isReservedName($this->getNameInput())) { - $this->components->error('The name "'.$this->getNameInput().'" is reserved by PHP.'); - - return false; - } - - $name = $this->qualifyClass($this->getNameInput()); - - $path = $this->getPath($name); - - // Next, We will check to see if the class already exists. If it does, we don't want - // to create the class and overwrite the user's code. So, we will bail out so the - // code is untouched. Otherwise, we will continue generating this class' files. - if ((! $this->hasOption('force') || - ! $this->option('force')) && - $this->alreadyExists($this->getNameInput())) { - $this->components->error($this->type.' already exists.'); - - return false; - } - - // Next, we will generate the path to the location where this class' file should get - // written. Then, we will build the class and make the proper replacements on the - // stub files so that it gets the correctly formatted namespace and class name. - $this->makeDirectory($path); - - $this->files->put($path, $this->sortImports($this->buildClass($name))); - - $info = $this->type; - - if (in_array(CreatesMatchingTest::class, class_uses_recursive($this))) { - if ($this->handleTestCreation($path)) { - $info .= ' and test'; - } - } - - $this->components->info(sprintf('%s [%s] created successfully.', $info, $path)); - } - - /** - * Parse the class name and format according to the root namespace. - * - * @param string $name - * @return string - */ - protected function qualifyClass($name) - { - $name = ltrim($name, '\\/'); - - $name = str_replace('/', '\\', $name); - - $rootNamespace = $this->rootNamespace(); - - if (Str::startsWith($name, $rootNamespace)) { - return $name; - } - - return $this->qualifyClass( - $this->getDefaultNamespace(trim($rootNamespace, '\\')).'\\'.$name - ); - } - - /** - * Qualify the given model class base name. - * - * @param string $model - * @return string - */ - protected function qualifyModel(string $model) - { - $model = ltrim($model, '\\/'); - - $model = str_replace('/', '\\', $model); - - $rootNamespace = $this->rootNamespace(); - - if (Str::startsWith($model, $rootNamespace)) { - return $model; - } - - return is_dir(app_path('Models')) - ? $rootNamespace.'Models\\'.$model - : $rootNamespace.$model; - } - - /** - * Get the default namespace for the class. - * - * @param string $rootNamespace - * @return string - */ - protected function getDefaultNamespace($rootNamespace) - { - return $rootNamespace; - } - - /** - * Determine if the class already exists. - * - * @param string $rawName - * @return bool - */ - protected function alreadyExists($rawName) - { - return $this->files->exists($this->getPath($this->qualifyClass($rawName))); - } - - /** - * Get the destination class path. - * - * @param string $name - * @return string - */ - protected function getPath($name) - { - $name = Str::replaceFirst($this->rootNamespace(), '', $name); - - return $this->laravel['path'].'/'.str_replace('\\', '/', $name).'.php'; - } - - /** - * Build the directory for the class if necessary. - * - * @param string $path - * @return string - */ - protected function makeDirectory($path) - { - if (! $this->files->isDirectory(dirname($path))) { - $this->files->makeDirectory(dirname($path), 0777, true, true); - } - - return $path; - } - - /** - * Build the class with the given name. - * - * @param string $name - * @return string - * - * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException - */ - protected function buildClass($name) - { - $stub = $this->files->get($this->getStub()); - - return $this->replaceNamespace($stub, $name)->replaceClass($stub, $name); - } - - /** - * Replace the namespace for the given stub. - * - * @param string $stub - * @param string $name - * @return $this - */ - protected function replaceNamespace(&$stub, $name) - { - $searches = [ - ['DummyNamespace', 'DummyRootNamespace', 'NamespacedDummyUserModel'], - ['{{ namespace }}', '{{ rootNamespace }}', '{{ namespacedUserModel }}'], - ['{{namespace}}', '{{rootNamespace}}', '{{namespacedUserModel}}'], - ]; - - foreach ($searches as $search) { - $stub = str_replace( - $search, - [$this->getNamespace($name), $this->rootNamespace(), $this->userProviderModel()], - $stub - ); - } - - return $this; - } - - /** - * Get the full namespace for a given class, without the class name. - * - * @param string $name - * @return string - */ - protected function getNamespace($name) - { - return trim(implode('\\', array_slice(explode('\\', $name), 0, -1)), '\\'); - } - - /** - * Replace the class name for the given stub. - * - * @param string $stub - * @param string $name - * @return string - */ - protected function replaceClass($stub, $name) - { - $class = str_replace($this->getNamespace($name).'\\', '', $name); - - return str_replace(['DummyClass', '{{ class }}', '{{class}}'], $class, $stub); - } - - /** - * Alphabetically sorts the imports for the given stub. - * - * @param string $stub - * @return string - */ - protected function sortImports($stub) - { - if (preg_match('/(?P(?:^use [^;{]+;$\n?)+)/m', $stub, $match)) { - $imports = explode("\n", trim($match['imports'])); - - sort($imports); - - return str_replace(trim($match['imports']), implode("\n", $imports), $stub); - } - - return $stub; - } - - /** - * Get the desired class name from the input. - * - * @return string - */ - protected function getNameInput() - { - return trim($this->argument('name')); - } - - /** - * Get the root namespace for the class. - * - * @return string - */ - protected function rootNamespace() - { - return $this->laravel->getNamespace(); - } - - /** - * Get the model for the default guard's user provider. - * - * @return string|null - */ - protected function userProviderModel() - { - $config = $this->laravel['config']; - - $provider = $config->get('auth.guards.'.$config->get('auth.defaults.guard').'.provider'); - - return $config->get("auth.providers.{$provider}.model"); - } - - /** - * Checks whether the given name is reserved. - * - * @param string $name - * @return bool - */ - protected function isReservedName($name) - { - $name = strtolower($name); - - return in_array($name, $this->reservedNames); - } - - /** - * Get the first view directory path from the application configuration. - * - * @param string $path - * @return string - */ - protected function viewPath($path = '') - { - $views = $this->laravel['config']['view.paths'][0] ?? resource_path('views'); - - return $views.($path ? DIRECTORY_SEPARATOR.$path : $path); - } - - /** - * Get the console command arguments. - * - * @return array - */ - protected function getArguments() - { - return [ - ['name', InputArgument::REQUIRED, 'The name of the class'], - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/LICENSE.md b/vendor/laravel/framework/src/Illuminate/Console/LICENSE.md deleted file mode 100644 index 79810c84..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Taylor Otwell - -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/laravel/framework/src/Illuminate/Console/OutputStyle.php b/vendor/laravel/framework/src/Illuminate/Console/OutputStyle.php deleted file mode 100644 index 06eeef18..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/OutputStyle.php +++ /dev/null @@ -1,131 +0,0 @@ -output = $output; - - parent::__construct($input, $output); - } - - /** - * {@inheritdoc} - */ - public function write(string|iterable $messages, bool $newline = false, int $options = 0) - { - $this->newLineWritten = $newline; - - parent::write($messages, $newline, $options); - } - - /** - * {@inheritdoc} - */ - public function writeln(string|iterable $messages, int $type = self::OUTPUT_NORMAL) - { - $this->newLineWritten = true; - - parent::writeln($messages, $type); - } - - /** - * {@inheritdoc} - */ - public function newLine(int $count = 1) - { - $this->newLineWritten = $count > 0; - - parent::newLine($count); - } - - /** - * {@inheritdoc} - */ - public function newLineWritten() - { - if ($this->output instanceof static && $this->output->newLineWritten()) { - return true; - } - - return $this->newLineWritten; - } - - /** - * Returns whether verbosity is quiet (-q). - * - * @return bool - */ - public function isQuiet(): bool - { - return $this->output->isQuiet(); - } - - /** - * Returns whether verbosity is verbose (-v). - * - * @return bool - */ - public function isVerbose(): bool - { - return $this->output->isVerbose(); - } - - /** - * Returns whether verbosity is very verbose (-vv). - * - * @return bool - */ - public function isVeryVerbose(): bool - { - return $this->output->isVeryVerbose(); - } - - /** - * Returns whether verbosity is debug (-vvv). - * - * @return bool - */ - public function isDebug(): bool - { - return $this->output->isDebug(); - } - - /** - * Get the underlying Symfony output implementation. - * - * @return \Symfony\Component\Console\Output\OutputInterface - */ - public function getOutput() - { - return $this->output; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/Parser.php b/vendor/laravel/framework/src/Illuminate/Console/Parser.php deleted file mode 100644 index 552400d7..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/Parser.php +++ /dev/null @@ -1,141 +0,0 @@ -getQuestion()); - - $text = $this->ensureEndsWithPunctuation($text); - - $text = " $text"; - - $default = $question->getDefault(); - - if ($question->isMultiline()) { - $text .= sprintf(' (press %s to continue)', 'Windows' == PHP_OS_FAMILY - ? 'Ctrl+Z then Enter' - : 'Ctrl+D'); - } - - switch (true) { - case null === $default: - $text = sprintf('%s', $text); - - break; - - case $question instanceof ConfirmationQuestion: - $text = sprintf('%s (yes/no) [%s]', $text, $default ? 'yes' : 'no'); - - break; - - case $question instanceof ChoiceQuestion: - $choices = $question->getChoices(); - $text = sprintf('%s [%s]', $text, OutputFormatter::escape($choices[$default] ?? $default)); - - break; - } - - $output->writeln($text); - - if ($question instanceof ChoiceQuestion) { - foreach ($question->getChoices() as $key => $value) { - with(new TwoColumnDetail($output))->render($value, $key); - } - } - - $output->write('❯ '); - } - - /** - * Ensures the given string ends with punctuation. - * - * @param string $string - * @return string - */ - protected function ensureEndsWithPunctuation($string) - { - if (! str($string)->endsWith(['?', ':', '!', '.'])) { - return "$string:"; - } - - return $string; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/Scheduling/CacheAware.php b/vendor/laravel/framework/src/Illuminate/Console/Scheduling/CacheAware.php deleted file mode 100644 index 862c47f5..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/Scheduling/CacheAware.php +++ /dev/null @@ -1,14 +0,0 @@ -cache = $cache; - } - - /** - * Attempt to obtain an event mutex for the given event. - * - * @param \Illuminate\Console\Scheduling\Event $event - * @return bool - */ - public function create(Event $event) - { - return $this->cache->store($this->store)->add( - $event->mutexName(), true, $event->expiresAt * 60 - ); - } - - /** - * Determine if an event mutex exists for the given event. - * - * @param \Illuminate\Console\Scheduling\Event $event - * @return bool - */ - public function exists(Event $event) - { - return $this->cache->store($this->store)->has($event->mutexName()); - } - - /** - * Clear the event mutex for the given event. - * - * @param \Illuminate\Console\Scheduling\Event $event - * @return void - */ - public function forget(Event $event) - { - $this->cache->store($this->store)->forget($event->mutexName()); - } - - /** - * Specify the cache store that should be used. - * - * @param string $store - * @return $this - */ - public function useStore($store) - { - $this->store = $store; - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/Scheduling/CacheSchedulingMutex.php b/vendor/laravel/framework/src/Illuminate/Console/Scheduling/CacheSchedulingMutex.php deleted file mode 100644 index ca8e2cb8..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/Scheduling/CacheSchedulingMutex.php +++ /dev/null @@ -1,75 +0,0 @@ -cache = $cache; - } - - /** - * Attempt to obtain a scheduling mutex for the given event. - * - * @param \Illuminate\Console\Scheduling\Event $event - * @param \DateTimeInterface $time - * @return bool - */ - public function create(Event $event, DateTimeInterface $time) - { - return $this->cache->store($this->store)->add( - $event->mutexName().$time->format('Hi'), true, 3600 - ); - } - - /** - * Determine if a scheduling mutex exists for the given event. - * - * @param \Illuminate\Console\Scheduling\Event $event - * @param \DateTimeInterface $time - * @return bool - */ - public function exists(Event $event, DateTimeInterface $time) - { - return $this->cache->store($this->store)->has( - $event->mutexName().$time->format('Hi') - ); - } - - /** - * Specify the cache store that should be used. - * - * @param string $store - * @return $this - */ - public function useStore($store) - { - $this->store = $store; - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/Scheduling/CallbackEvent.php b/vendor/laravel/framework/src/Illuminate/Console/Scheduling/CallbackEvent.php deleted file mode 100644 index db5e0297..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/Scheduling/CallbackEvent.php +++ /dev/null @@ -1,201 +0,0 @@ -mutex = $mutex; - $this->callback = $callback; - $this->parameters = $parameters; - $this->timezone = $timezone; - } - - /** - * Run the callback event. - * - * @param \Illuminate\Contracts\Container\Container $container - * @return mixed - * - * @throws \Throwable - */ - public function run(Container $container) - { - parent::run($container); - - if ($this->exception) { - throw $this->exception; - } - - return $this->result; - } - - /** - * Determine if the event should skip because another process is overlapping. - * - * @return bool - */ - public function shouldSkipDueToOverlapping() - { - return $this->description && parent::shouldSkipDueToOverlapping(); - } - - /** - * Indicate that the callback should run in the background. - * - * @return void - * - * @throws \RuntimeException - */ - public function runInBackground() - { - throw new RuntimeException('Scheduled closures can not be run in the background.'); - } - - /** - * Run the callback. - * - * @param \Illuminate\Contracts\Container\Container $container - * @return int - */ - protected function execute($container) - { - try { - $this->result = is_object($this->callback) - ? $container->call([$this->callback, '__invoke'], $this->parameters) - : $container->call($this->callback, $this->parameters); - - return $this->result === false ? 1 : 0; - } catch (Throwable $e) { - $this->exception = $e; - - return 1; - } - } - - /** - * Do not allow the event to overlap each other. - * - * @param int $expiresAt - * @return $this - * - * @throws \LogicException - */ - public function withoutOverlapping($expiresAt = 1440) - { - if (! isset($this->description)) { - throw new LogicException( - "A scheduled event name is required to prevent overlapping. Use the 'name' method before 'withoutOverlapping'." - ); - } - - return parent::withoutOverlapping($expiresAt); - } - - /** - * Allow the event to only run on one server for each cron expression. - * - * @return $this - * - * @throws \LogicException - */ - public function onOneServer() - { - if (! isset($this->description)) { - throw new LogicException( - "A scheduled event name is required to only run on one server. Use the 'name' method before 'onOneServer'." - ); - } - - return parent::onOneServer(); - } - - /** - * Get the summary of the event for display. - * - * @return string - */ - public function getSummaryForDisplay() - { - if (is_string($this->description)) { - return $this->description; - } - - return is_string($this->callback) ? $this->callback : 'Callback'; - } - - /** - * Get the mutex name for the scheduled command. - * - * @return string - */ - public function mutexName() - { - return 'framework/schedule-'.sha1($this->description ?? ''); - } - - /** - * Clear the mutex for the event. - * - * @return void - */ - protected function removeMutex() - { - if ($this->description) { - parent::removeMutex(); - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/Scheduling/CommandBuilder.php b/vendor/laravel/framework/src/Illuminate/Console/Scheduling/CommandBuilder.php deleted file mode 100644 index ee13c5ee..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/Scheduling/CommandBuilder.php +++ /dev/null @@ -1,75 +0,0 @@ -runInBackground) { - return $this->buildBackgroundCommand($event); - } - - return $this->buildForegroundCommand($event); - } - - /** - * Build the command for running the event in the foreground. - * - * @param \Illuminate\Console\Scheduling\Event $event - * @return string - */ - protected function buildForegroundCommand(Event $event) - { - $output = ProcessUtils::escapeArgument($event->output); - - return $this->ensureCorrectUser( - $event, $event->command.($event->shouldAppendOutput ? ' >> ' : ' > ').$output.' 2>&1' - ); - } - - /** - * Build the command for running the event in the background. - * - * @param \Illuminate\Console\Scheduling\Event $event - * @return string - */ - protected function buildBackgroundCommand(Event $event) - { - $output = ProcessUtils::escapeArgument($event->output); - - $redirect = $event->shouldAppendOutput ? ' >> ' : ' > '; - - $finished = Application::formatCommandString('schedule:finish').' "'.$event->mutexName().'"'; - - if (windows_os()) { - return 'start /b cmd /v:on /c "('.$event->command.' & '.$finished.' ^!ERRORLEVEL^!)'.$redirect.$output.' 2>&1"'; - } - - return $this->ensureCorrectUser($event, - '('.$event->command.$redirect.$output.' 2>&1 ; '.$finished.' "$?") > ' - .ProcessUtils::escapeArgument($event->getDefaultOutput()).' 2>&1 &' - ); - } - - /** - * Finalize the event's command syntax with the correct user. - * - * @param \Illuminate\Console\Scheduling\Event $event - * @param string $command - * @return string - */ - protected function ensureCorrectUser(Event $event, $command) - { - return $event->user && ! windows_os() ? 'sudo -u '.$event->user.' -- sh -c \''.$command.'\'' : $command; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/Scheduling/Event.php b/vendor/laravel/framework/src/Illuminate/Console/Scheduling/Event.php deleted file mode 100644 index 36c180b9..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/Scheduling/Event.php +++ /dev/null @@ -1,978 +0,0 @@ -mutex = $mutex; - $this->command = $command; - $this->timezone = $timezone; - - $this->output = $this->getDefaultOutput(); - } - - /** - * Get the default output depending on the OS. - * - * @return string - */ - public function getDefaultOutput() - { - return (DIRECTORY_SEPARATOR === '\\') ? 'NUL' : '/dev/null'; - } - - /** - * Run the given event. - * - * @param \Illuminate\Contracts\Container\Container $container - * @return void - * - * @throws \Throwable - */ - public function run(Container $container) - { - if ($this->shouldSkipDueToOverlapping()) { - return; - } - - $exitCode = $this->start($container); - - if (! $this->runInBackground) { - $this->finish($container, $exitCode); - } - } - - /** - * Determine if the event should skip because another process is overlapping. - * - * @return bool - */ - public function shouldSkipDueToOverlapping() - { - return $this->withoutOverlapping && ! $this->mutex->create($this); - } - - /** - * Run the command process. - * - * @param \Illuminate\Contracts\Container\Container $container - * @return int - * - * @throws \Throwable - */ - protected function start($container) - { - try { - $this->callBeforeCallbacks($container); - - return $this->execute($container); - } catch (Throwable $exception) { - $this->removeMutex(); - - throw $exception; - } - } - - /** - * Run the command process. - * - * @param \Illuminate\Contracts\Container\Container $container - * @return int - */ - protected function execute($container) - { - return Process::fromShellCommandline( - $this->buildCommand(), base_path(), null, null, null - )->run(); - } - - /** - * Mark the command process as finished and run callbacks/cleanup. - * - * @param \Illuminate\Contracts\Container\Container $container - * @param int $exitCode - * @return void - */ - public function finish(Container $container, $exitCode) - { - $this->exitCode = (int) $exitCode; - - try { - $this->callAfterCallbacks($container); - } finally { - $this->removeMutex(); - } - } - - /** - * Call all of the "before" callbacks for the event. - * - * @param \Illuminate\Contracts\Container\Container $container - * @return void - */ - public function callBeforeCallbacks(Container $container) - { - foreach ($this->beforeCallbacks as $callback) { - $container->call($callback); - } - } - - /** - * Call all of the "after" callbacks for the event. - * - * @param \Illuminate\Contracts\Container\Container $container - * @return void - */ - public function callAfterCallbacks(Container $container) - { - foreach ($this->afterCallbacks as $callback) { - $container->call($callback); - } - } - - /** - * Build the command string. - * - * @return string - */ - public function buildCommand() - { - return (new CommandBuilder)->buildCommand($this); - } - - /** - * Determine if the given event should run based on the Cron expression. - * - * @param \Illuminate\Contracts\Foundation\Application $app - * @return bool - */ - public function isDue($app) - { - if (! $this->runsInMaintenanceMode() && $app->isDownForMaintenance()) { - return false; - } - - return $this->expressionPasses() && - $this->runsInEnvironment($app->environment()); - } - - /** - * Determine if the event runs in maintenance mode. - * - * @return bool - */ - public function runsInMaintenanceMode() - { - return $this->evenInMaintenanceMode; - } - - /** - * Determine if the Cron expression passes. - * - * @return bool - */ - protected function expressionPasses() - { - $date = Date::now(); - - if ($this->timezone) { - $date = $date->setTimezone($this->timezone); - } - - return (new CronExpression($this->expression))->isDue($date->toDateTimeString()); - } - - /** - * Determine if the event runs in the given environment. - * - * @param string $environment - * @return bool - */ - public function runsInEnvironment($environment) - { - return empty($this->environments) || in_array($environment, $this->environments); - } - - /** - * Determine if the filters pass for the event. - * - * @param \Illuminate\Contracts\Foundation\Application $app - * @return bool - */ - public function filtersPass($app) - { - foreach ($this->filters as $callback) { - if (! $app->call($callback)) { - return false; - } - } - - foreach ($this->rejects as $callback) { - if ($app->call($callback)) { - return false; - } - } - - return true; - } - - /** - * Ensure that the output is stored on disk in a log file. - * - * @return $this - */ - public function storeOutput() - { - $this->ensureOutputIsBeingCaptured(); - - return $this; - } - - /** - * Send the output of the command to a given location. - * - * @param string $location - * @param bool $append - * @return $this - */ - public function sendOutputTo($location, $append = false) - { - $this->output = $location; - - $this->shouldAppendOutput = $append; - - return $this; - } - - /** - * Append the output of the command to a given location. - * - * @param string $location - * @return $this - */ - public function appendOutputTo($location) - { - return $this->sendOutputTo($location, true); - } - - /** - * E-mail the results of the scheduled operation. - * - * @param array|mixed $addresses - * @param bool $onlyIfOutputExists - * @return $this - * - * @throws \LogicException - */ - public function emailOutputTo($addresses, $onlyIfOutputExists = false) - { - $this->ensureOutputIsBeingCaptured(); - - $addresses = Arr::wrap($addresses); - - return $this->then(function (Mailer $mailer) use ($addresses, $onlyIfOutputExists) { - $this->emailOutput($mailer, $addresses, $onlyIfOutputExists); - }); - } - - /** - * E-mail the results of the scheduled operation if it produces output. - * - * @param array|mixed $addresses - * @return $this - * - * @throws \LogicException - */ - public function emailWrittenOutputTo($addresses) - { - return $this->emailOutputTo($addresses, true); - } - - /** - * E-mail the results of the scheduled operation if it fails. - * - * @param array|mixed $addresses - * @return $this - */ - public function emailOutputOnFailure($addresses) - { - $this->ensureOutputIsBeingCaptured(); - - $addresses = Arr::wrap($addresses); - - return $this->onFailure(function (Mailer $mailer) use ($addresses) { - $this->emailOutput($mailer, $addresses, false); - }); - } - - /** - * Ensure that the command output is being captured. - * - * @return void - */ - protected function ensureOutputIsBeingCaptured() - { - if (is_null($this->output) || $this->output == $this->getDefaultOutput()) { - $this->sendOutputTo(storage_path('logs/schedule-'.sha1($this->mutexName()).'.log')); - } - } - - /** - * E-mail the output of the event to the recipients. - * - * @param \Illuminate\Contracts\Mail\Mailer $mailer - * @param array $addresses - * @param bool $onlyIfOutputExists - * @return void - */ - protected function emailOutput(Mailer $mailer, $addresses, $onlyIfOutputExists = false) - { - $text = is_file($this->output) ? file_get_contents($this->output) : ''; - - if ($onlyIfOutputExists && empty($text)) { - return; - } - - $mailer->raw($text, function ($m) use ($addresses) { - $m->to($addresses)->subject($this->getEmailSubject()); - }); - } - - /** - * Get the e-mail subject line for output results. - * - * @return string - */ - protected function getEmailSubject() - { - if ($this->description) { - return $this->description; - } - - return "Scheduled Job Output For [{$this->command}]"; - } - - /** - * Register a callback to ping a given URL before the job runs. - * - * @param string $url - * @return $this - */ - public function pingBefore($url) - { - return $this->before($this->pingCallback($url)); - } - - /** - * Register a callback to ping a given URL before the job runs if the given condition is true. - * - * @param bool $value - * @param string $url - * @return $this - */ - public function pingBeforeIf($value, $url) - { - return $value ? $this->pingBefore($url) : $this; - } - - /** - * Register a callback to ping a given URL after the job runs. - * - * @param string $url - * @return $this - */ - public function thenPing($url) - { - return $this->then($this->pingCallback($url)); - } - - /** - * Register a callback to ping a given URL after the job runs if the given condition is true. - * - * @param bool $value - * @param string $url - * @return $this - */ - public function thenPingIf($value, $url) - { - return $value ? $this->thenPing($url) : $this; - } - - /** - * Register a callback to ping a given URL if the operation succeeds. - * - * @param string $url - * @return $this - */ - public function pingOnSuccess($url) - { - return $this->onSuccess($this->pingCallback($url)); - } - - /** - * Register a callback to ping a given URL if the operation fails. - * - * @param string $url - * @return $this - */ - public function pingOnFailure($url) - { - return $this->onFailure($this->pingCallback($url)); - } - - /** - * Get the callback that pings the given URL. - * - * @param string $url - * @return \Closure - */ - protected function pingCallback($url) - { - return function (Container $container, HttpClient $http) use ($url) { - try { - $http->request('GET', $url); - } catch (ClientExceptionInterface|TransferException $e) { - $container->make(ExceptionHandler::class)->report($e); - } - }; - } - - /** - * State that the command should run in the background. - * - * @return $this - */ - public function runInBackground() - { - $this->runInBackground = true; - - return $this; - } - - /** - * Set which user the command should run as. - * - * @param string $user - * @return $this - */ - public function user($user) - { - $this->user = $user; - - return $this; - } - - /** - * Limit the environments the command should run in. - * - * @param array|mixed $environments - * @return $this - */ - public function environments($environments) - { - $this->environments = is_array($environments) ? $environments : func_get_args(); - - return $this; - } - - /** - * State that the command should run even in maintenance mode. - * - * @return $this - */ - public function evenInMaintenanceMode() - { - $this->evenInMaintenanceMode = true; - - return $this; - } - - /** - * Do not allow the event to overlap each other. - * - * @param int $expiresAt - * @return $this - */ - public function withoutOverlapping($expiresAt = 1440) - { - $this->withoutOverlapping = true; - - $this->expiresAt = $expiresAt; - - return $this->skip(function () { - return $this->mutex->exists($this); - }); - } - - /** - * Allow the event to only run on one server for each cron expression. - * - * @return $this - */ - public function onOneServer() - { - $this->onOneServer = true; - - return $this; - } - - /** - * Register a callback to further filter the schedule. - * - * @param \Closure|bool $callback - * @return $this - */ - public function when($callback) - { - $this->filters[] = Reflector::isCallable($callback) ? $callback : function () use ($callback) { - return $callback; - }; - - return $this; - } - - /** - * Register a callback to further filter the schedule. - * - * @param \Closure|bool $callback - * @return $this - */ - public function skip($callback) - { - $this->rejects[] = Reflector::isCallable($callback) ? $callback : function () use ($callback) { - return $callback; - }; - - return $this; - } - - /** - * Register a callback to be called before the operation. - * - * @param \Closure $callback - * @return $this - */ - public function before(Closure $callback) - { - $this->beforeCallbacks[] = $callback; - - return $this; - } - - /** - * Register a callback to be called after the operation. - * - * @param \Closure $callback - * @return $this - */ - public function after(Closure $callback) - { - return $this->then($callback); - } - - /** - * Register a callback to be called after the operation. - * - * @param \Closure $callback - * @return $this - */ - public function then(Closure $callback) - { - $parameters = $this->closureParameterTypes($callback); - - if (Arr::get($parameters, 'output') === Stringable::class) { - return $this->thenWithOutput($callback); - } - - $this->afterCallbacks[] = $callback; - - return $this; - } - - /** - * Register a callback that uses the output after the job runs. - * - * @param \Closure $callback - * @param bool $onlyIfOutputExists - * @return $this - */ - public function thenWithOutput(Closure $callback, $onlyIfOutputExists = false) - { - $this->ensureOutputIsBeingCaptured(); - - return $this->then($this->withOutputCallback($callback, $onlyIfOutputExists)); - } - - /** - * Register a callback to be called if the operation succeeds. - * - * @param \Closure $callback - * @return $this - */ - public function onSuccess(Closure $callback) - { - $parameters = $this->closureParameterTypes($callback); - - if (Arr::get($parameters, 'output') === Stringable::class) { - return $this->onSuccessWithOutput($callback); - } - - return $this->then(function (Container $container) use ($callback) { - if ($this->exitCode === 0) { - $container->call($callback); - } - }); - } - - /** - * Register a callback that uses the output if the operation succeeds. - * - * @param \Closure $callback - * @param bool $onlyIfOutputExists - * @return $this - */ - public function onSuccessWithOutput(Closure $callback, $onlyIfOutputExists = false) - { - $this->ensureOutputIsBeingCaptured(); - - return $this->onSuccess($this->withOutputCallback($callback, $onlyIfOutputExists)); - } - - /** - * Register a callback to be called if the operation fails. - * - * @param \Closure $callback - * @return $this - */ - public function onFailure(Closure $callback) - { - $parameters = $this->closureParameterTypes($callback); - - if (Arr::get($parameters, 'output') === Stringable::class) { - return $this->onFailureWithOutput($callback); - } - - return $this->then(function (Container $container) use ($callback) { - if ($this->exitCode !== 0) { - $container->call($callback); - } - }); - } - - /** - * Register a callback that uses the output if the operation fails. - * - * @param \Closure $callback - * @param bool $onlyIfOutputExists - * @return $this - */ - public function onFailureWithOutput(Closure $callback, $onlyIfOutputExists = false) - { - $this->ensureOutputIsBeingCaptured(); - - return $this->onFailure($this->withOutputCallback($callback, $onlyIfOutputExists)); - } - - /** - * Get a callback that provides output. - * - * @param \Closure $callback - * @param bool $onlyIfOutputExists - * @return \Closure - */ - protected function withOutputCallback(Closure $callback, $onlyIfOutputExists = false) - { - return function (Container $container) use ($callback, $onlyIfOutputExists) { - $output = $this->output && is_file($this->output) ? file_get_contents($this->output) : ''; - - return $onlyIfOutputExists && empty($output) - ? null - : $container->call($callback, ['output' => new Stringable($output)]); - }; - } - - /** - * Set the human-friendly description of the event. - * - * @param string $description - * @return $this - */ - public function name($description) - { - return $this->description($description); - } - - /** - * Set the human-friendly description of the event. - * - * @param string $description - * @return $this - */ - public function description($description) - { - $this->description = $description; - - return $this; - } - - /** - * Get the summary of the event for display. - * - * @return string - */ - public function getSummaryForDisplay() - { - if (is_string($this->description)) { - return $this->description; - } - - return $this->buildCommand(); - } - - /** - * Determine the next due date for an event. - * - * @param \DateTimeInterface|string $currentTime - * @param int $nth - * @param bool $allowCurrentDate - * @return \Illuminate\Support\Carbon - */ - public function nextRunDate($currentTime = 'now', $nth = 0, $allowCurrentDate = false) - { - return Date::instance((new CronExpression($this->getExpression())) - ->getNextRunDate($currentTime, $nth, $allowCurrentDate, $this->timezone)); - } - - /** - * Get the Cron expression for the event. - * - * @return string - */ - public function getExpression() - { - return $this->expression; - } - - /** - * Set the event mutex implementation to be used. - * - * @param \Illuminate\Console\Scheduling\EventMutex $mutex - * @return $this - */ - public function preventOverlapsUsing(EventMutex $mutex) - { - $this->mutex = $mutex; - - return $this; - } - - /** - * Get the mutex name for the scheduled command. - * - * @return string - */ - public function mutexName() - { - $mutexNameResolver = $this->mutexNameResolver; - - if (! is_null($mutexNameResolver) && is_callable($mutexNameResolver)) { - return $mutexNameResolver($this); - } - - return 'framework'.DIRECTORY_SEPARATOR.'schedule-'.sha1($this->expression.$this->command); - } - - /** - * Set the mutex name or name resolver callback. - * - * @param \Closure|string $mutexName - * @return $this - */ - public function createMutexNameUsing(Closure|string $mutexName) - { - $this->mutexNameResolver = is_string($mutexName) ? fn () => $mutexName : $mutexName; - - return $this; - } - - /** - * Delete the mutex for the event. - * - * @return void - */ - protected function removeMutex() - { - if ($this->withoutOverlapping) { - $this->mutex->forget($this); - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/Scheduling/EventMutex.php b/vendor/laravel/framework/src/Illuminate/Console/Scheduling/EventMutex.php deleted file mode 100644 index 1840e242..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/Scheduling/EventMutex.php +++ /dev/null @@ -1,30 +0,0 @@ -expression = $expression; - - return $this; - } - - /** - * Schedule the event to run between start and end time. - * - * @param string $startTime - * @param string $endTime - * @return $this - */ - public function between($startTime, $endTime) - { - return $this->when($this->inTimeInterval($startTime, $endTime)); - } - - /** - * Schedule the event to not run between start and end time. - * - * @param string $startTime - * @param string $endTime - * @return $this - */ - public function unlessBetween($startTime, $endTime) - { - return $this->skip($this->inTimeInterval($startTime, $endTime)); - } - - /** - * Schedule the event to run between start and end time. - * - * @param string $startTime - * @param string $endTime - * @return \Closure - */ - private function inTimeInterval($startTime, $endTime) - { - [$now, $startTime, $endTime] = [ - Carbon::now($this->timezone), - Carbon::parse($startTime, $this->timezone), - Carbon::parse($endTime, $this->timezone), - ]; - - if ($endTime->lessThan($startTime)) { - if ($startTime->greaterThan($now)) { - $startTime = $startTime->subDay(1); - } else { - $endTime = $endTime->addDay(1); - } - } - - return function () use ($now, $startTime, $endTime) { - return $now->between($startTime, $endTime); - }; - } - - /** - * Schedule the event to run every minute. - * - * @return $this - */ - public function everyMinute() - { - return $this->spliceIntoPosition(1, '*'); - } - - /** - * Schedule the event to run every two minutes. - * - * @return $this - */ - public function everyTwoMinutes() - { - return $this->spliceIntoPosition(1, '*/2'); - } - - /** - * Schedule the event to run every three minutes. - * - * @return $this - */ - public function everyThreeMinutes() - { - return $this->spliceIntoPosition(1, '*/3'); - } - - /** - * Schedule the event to run every four minutes. - * - * @return $this - */ - public function everyFourMinutes() - { - return $this->spliceIntoPosition(1, '*/4'); - } - - /** - * Schedule the event to run every five minutes. - * - * @return $this - */ - public function everyFiveMinutes() - { - return $this->spliceIntoPosition(1, '*/5'); - } - - /** - * Schedule the event to run every ten minutes. - * - * @return $this - */ - public function everyTenMinutes() - { - return $this->spliceIntoPosition(1, '*/10'); - } - - /** - * Schedule the event to run every fifteen minutes. - * - * @return $this - */ - public function everyFifteenMinutes() - { - return $this->spliceIntoPosition(1, '*/15'); - } - - /** - * Schedule the event to run every thirty minutes. - * - * @return $this - */ - public function everyThirtyMinutes() - { - return $this->spliceIntoPosition(1, '0,30'); - } - - /** - * Schedule the event to run hourly. - * - * @return $this - */ - public function hourly() - { - return $this->spliceIntoPosition(1, 0); - } - - /** - * Schedule the event to run hourly at a given offset in the hour. - * - * @param array|int $offset - * @return $this - */ - public function hourlyAt($offset) - { - $offset = is_array($offset) ? implode(',', $offset) : $offset; - - return $this->spliceIntoPosition(1, $offset); - } - - /** - * Schedule the event to run every odd hour. - * - * @return $this - */ - public function everyOddHour() - { - return $this->spliceIntoPosition(1, 0)->spliceIntoPosition(2, '1-23/2'); - } - - /** - * Schedule the event to run every two hours. - * - * @return $this - */ - public function everyTwoHours() - { - return $this->spliceIntoPosition(1, 0) - ->spliceIntoPosition(2, '*/2'); - } - - /** - * Schedule the event to run every three hours. - * - * @return $this - */ - public function everyThreeHours() - { - return $this->spliceIntoPosition(1, 0) - ->spliceIntoPosition(2, '*/3'); - } - - /** - * Schedule the event to run every four hours. - * - * @return $this - */ - public function everyFourHours() - { - return $this->spliceIntoPosition(1, 0) - ->spliceIntoPosition(2, '*/4'); - } - - /** - * Schedule the event to run every six hours. - * - * @return $this - */ - public function everySixHours() - { - return $this->spliceIntoPosition(1, 0) - ->spliceIntoPosition(2, '*/6'); - } - - /** - * Schedule the event to run daily. - * - * @return $this - */ - public function daily() - { - return $this->spliceIntoPosition(1, 0) - ->spliceIntoPosition(2, 0); - } - - /** - * Schedule the command at a given time. - * - * @param string $time - * @return $this - */ - public function at($time) - { - return $this->dailyAt($time); - } - - /** - * Schedule the event to run daily at a given time (10:00, 19:30, etc). - * - * @param string $time - * @return $this - */ - public function dailyAt($time) - { - $segments = explode(':', $time); - - return $this->spliceIntoPosition(2, (int) $segments[0]) - ->spliceIntoPosition(1, count($segments) === 2 ? (int) $segments[1] : '0'); - } - - /** - * Schedule the event to run twice daily. - * - * @param int $first - * @param int $second - * @return $this - */ - public function twiceDaily($first = 1, $second = 13) - { - return $this->twiceDailyAt($first, $second, 0); - } - - /** - * Schedule the event to run twice daily at a given offset. - * - * @param int $first - * @param int $second - * @param int $offset - * @return $this - */ - public function twiceDailyAt($first = 1, $second = 13, $offset = 0) - { - $hours = $first.','.$second; - - return $this->spliceIntoPosition(1, $offset) - ->spliceIntoPosition(2, $hours); - } - - /** - * Schedule the event to run only on weekdays. - * - * @return $this - */ - public function weekdays() - { - return $this->days(Schedule::MONDAY.'-'.Schedule::FRIDAY); - } - - /** - * Schedule the event to run only on weekends. - * - * @return $this - */ - public function weekends() - { - return $this->days(Schedule::SATURDAY.','.Schedule::SUNDAY); - } - - /** - * Schedule the event to run only on Mondays. - * - * @return $this - */ - public function mondays() - { - return $this->days(Schedule::MONDAY); - } - - /** - * Schedule the event to run only on Tuesdays. - * - * @return $this - */ - public function tuesdays() - { - return $this->days(Schedule::TUESDAY); - } - - /** - * Schedule the event to run only on Wednesdays. - * - * @return $this - */ - public function wednesdays() - { - return $this->days(Schedule::WEDNESDAY); - } - - /** - * Schedule the event to run only on Thursdays. - * - * @return $this - */ - public function thursdays() - { - return $this->days(Schedule::THURSDAY); - } - - /** - * Schedule the event to run only on Fridays. - * - * @return $this - */ - public function fridays() - { - return $this->days(Schedule::FRIDAY); - } - - /** - * Schedule the event to run only on Saturdays. - * - * @return $this - */ - public function saturdays() - { - return $this->days(Schedule::SATURDAY); - } - - /** - * Schedule the event to run only on Sundays. - * - * @return $this - */ - public function sundays() - { - return $this->days(Schedule::SUNDAY); - } - - /** - * Schedule the event to run weekly. - * - * @return $this - */ - public function weekly() - { - return $this->spliceIntoPosition(1, 0) - ->spliceIntoPosition(2, 0) - ->spliceIntoPosition(5, 0); - } - - /** - * Schedule the event to run weekly on a given day and time. - * - * @param array|mixed $dayOfWeek - * @param string $time - * @return $this - */ - public function weeklyOn($dayOfWeek, $time = '0:0') - { - $this->dailyAt($time); - - return $this->days($dayOfWeek); - } - - /** - * Schedule the event to run monthly. - * - * @return $this - */ - public function monthly() - { - return $this->spliceIntoPosition(1, 0) - ->spliceIntoPosition(2, 0) - ->spliceIntoPosition(3, 1); - } - - /** - * Schedule the event to run monthly on a given day and time. - * - * @param int $dayOfMonth - * @param string $time - * @return $this - */ - public function monthlyOn($dayOfMonth = 1, $time = '0:0') - { - $this->dailyAt($time); - - return $this->spliceIntoPosition(3, $dayOfMonth); - } - - /** - * Schedule the event to run twice monthly at a given time. - * - * @param int $first - * @param int $second - * @param string $time - * @return $this - */ - public function twiceMonthly($first = 1, $second = 16, $time = '0:0') - { - $daysOfMonth = $first.','.$second; - - $this->dailyAt($time); - - return $this->spliceIntoPosition(3, $daysOfMonth); - } - - /** - * Schedule the event to run on the last day of the month. - * - * @param string $time - * @return $this - */ - public function lastDayOfMonth($time = '0:0') - { - $this->dailyAt($time); - - return $this->spliceIntoPosition(3, Carbon::now()->endOfMonth()->day); - } - - /** - * Schedule the event to run quarterly. - * - * @return $this - */ - public function quarterly() - { - return $this->spliceIntoPosition(1, 0) - ->spliceIntoPosition(2, 0) - ->spliceIntoPosition(3, 1) - ->spliceIntoPosition(4, '1-12/3'); - } - - /** - * Schedule the event to run quarterly on a given day and time. - * - * @param int $dayOfQuarter - * @param int $time - * @return $this - */ - public function quarterlyOn($dayOfQuarter = 1, $time = '0:0') - { - $this->dailyAt($time); - - return $this->spliceIntoPosition(3, $dayOfQuarter) - ->spliceIntoPosition(4, '1-12/3'); - } - - /** - * Schedule the event to run yearly. - * - * @return $this - */ - public function yearly() - { - return $this->spliceIntoPosition(1, 0) - ->spliceIntoPosition(2, 0) - ->spliceIntoPosition(3, 1) - ->spliceIntoPosition(4, 1); - } - - /** - * Schedule the event to run yearly on a given month, day, and time. - * - * @param int $month - * @param int|string $dayOfMonth - * @param string $time - * @return $this - */ - public function yearlyOn($month = 1, $dayOfMonth = 1, $time = '0:0') - { - $this->dailyAt($time); - - return $this->spliceIntoPosition(3, $dayOfMonth) - ->spliceIntoPosition(4, $month); - } - - /** - * Set the days of the week the command should run on. - * - * @param array|mixed $days - * @return $this - */ - public function days($days) - { - $days = is_array($days) ? $days : func_get_args(); - - return $this->spliceIntoPosition(5, implode(',', $days)); - } - - /** - * Set the timezone the date should be evaluated on. - * - * @param \DateTimeZone|string $timezone - * @return $this - */ - public function timezone($timezone) - { - $this->timezone = $timezone; - - return $this; - } - - /** - * Splice the given value into the given position of the expression. - * - * @param int $position - * @param string $value - * @return $this - */ - protected function spliceIntoPosition($position, $value) - { - $segments = preg_split("/\s+/", $this->expression); - - $segments[$position - 1] = $value; - - return $this->cron(implode(' ', $segments)); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/Scheduling/Schedule.php b/vendor/laravel/framework/src/Illuminate/Console/Scheduling/Schedule.php deleted file mode 100644 index 2f62bf9e..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/Scheduling/Schedule.php +++ /dev/null @@ -1,367 +0,0 @@ -timezone = $timezone; - - if (! class_exists(Container::class)) { - throw new RuntimeException( - 'A container implementation is required to use the scheduler. Please install the illuminate/container package.' - ); - } - - $container = Container::getInstance(); - - $this->eventMutex = $container->bound(EventMutex::class) - ? $container->make(EventMutex::class) - : $container->make(CacheEventMutex::class); - - $this->schedulingMutex = $container->bound(SchedulingMutex::class) - ? $container->make(SchedulingMutex::class) - : $container->make(CacheSchedulingMutex::class); - } - - /** - * Add a new callback event to the schedule. - * - * @param string|callable $callback - * @param array $parameters - * @return \Illuminate\Console\Scheduling\CallbackEvent - */ - public function call($callback, array $parameters = []) - { - $this->events[] = $event = new CallbackEvent( - $this->eventMutex, $callback, $parameters, $this->timezone - ); - - return $event; - } - - /** - * Add a new Artisan command event to the schedule. - * - * @param string $command - * @param array $parameters - * @return \Illuminate\Console\Scheduling\Event - */ - public function command($command, array $parameters = []) - { - if (class_exists($command)) { - $command = Container::getInstance()->make($command); - - return $this->exec( - Application::formatCommandString($command->getName()), $parameters, - )->description($command->getDescription()); - } - - return $this->exec( - Application::formatCommandString($command), $parameters - ); - } - - /** - * Add a new job callback event to the schedule. - * - * @param object|string $job - * @param string|null $queue - * @param string|null $connection - * @return \Illuminate\Console\Scheduling\CallbackEvent - */ - public function job($job, $queue = null, $connection = null) - { - return $this->call(function () use ($job, $queue, $connection) { - $job = is_string($job) ? Container::getInstance()->make($job) : $job; - - if ($job instanceof ShouldQueue) { - $this->dispatchToQueue($job, $queue ?? $job->queue, $connection ?? $job->connection); - } else { - $this->dispatchNow($job); - } - })->name(is_string($job) ? $job : get_class($job)); - } - - /** - * Dispatch the given job to the queue. - * - * @param object $job - * @param string|null $queue - * @param string|null $connection - * @return void - * - * @throws \RuntimeException - */ - protected function dispatchToQueue($job, $queue, $connection) - { - if ($job instanceof Closure) { - if (! class_exists(CallQueuedClosure::class)) { - throw new RuntimeException( - 'To enable support for closure jobs, please install the illuminate/queue package.' - ); - } - - $job = CallQueuedClosure::create($job); - } - - if ($job instanceof ShouldBeUnique) { - return $this->dispatchUniqueJobToQueue($job, $queue, $connection); - } - - $this->getDispatcher()->dispatch( - $job->onConnection($connection)->onQueue($queue) - ); - } - - /** - * Dispatch the given unique job to the queue. - * - * @param object $job - * @param string|null $queue - * @param string|null $connection - * @return void - * - * @throws \RuntimeException - */ - protected function dispatchUniqueJobToQueue($job, $queue, $connection) - { - if (! Container::getInstance()->bound(Cache::class)) { - throw new RuntimeException('Cache driver not available. Scheduling unique jobs not supported.'); - } - - if (! (new UniqueLock(Container::getInstance()->make(Cache::class)))->acquire($job)) { - return; - } - - $this->getDispatcher()->dispatch( - $job->onConnection($connection)->onQueue($queue) - ); - } - - /** - * Dispatch the given job right now. - * - * @param object $job - * @return void - */ - protected function dispatchNow($job) - { - $this->getDispatcher()->dispatchNow($job); - } - - /** - * Add a new command event to the schedule. - * - * @param string $command - * @param array $parameters - * @return \Illuminate\Console\Scheduling\Event - */ - public function exec($command, array $parameters = []) - { - if (count($parameters)) { - $command .= ' '.$this->compileParameters($parameters); - } - - $this->events[] = $event = new Event($this->eventMutex, $command, $this->timezone); - - return $event; - } - - /** - * Compile parameters for a command. - * - * @param array $parameters - * @return string - */ - protected function compileParameters(array $parameters) - { - return collect($parameters)->map(function ($value, $key) { - if (is_array($value)) { - return $this->compileArrayInput($key, $value); - } - - if (! is_numeric($value) && ! preg_match('/^(-.$|--.*)/i', $value)) { - $value = ProcessUtils::escapeArgument($value); - } - - return is_numeric($key) ? $value : "{$key}={$value}"; - })->implode(' '); - } - - /** - * Compile array input for a command. - * - * @param string|int $key - * @param array $value - * @return string - */ - public function compileArrayInput($key, $value) - { - $value = collect($value)->map(function ($value) { - return ProcessUtils::escapeArgument($value); - }); - - if (str_starts_with($key, '--')) { - $value = $value->map(function ($value) use ($key) { - return "{$key}={$value}"; - }); - } elseif (str_starts_with($key, '-')) { - $value = $value->map(function ($value) use ($key) { - return "{$key} {$value}"; - }); - } - - return $value->implode(' '); - } - - /** - * Determine if the server is allowed to run this event. - * - * @param \Illuminate\Console\Scheduling\Event $event - * @param \DateTimeInterface $time - * @return bool - */ - public function serverShouldRun(Event $event, DateTimeInterface $time) - { - return $this->schedulingMutex->create($event, $time); - } - - /** - * Get all of the events on the schedule that are due. - * - * @param \Illuminate\Contracts\Foundation\Application $app - * @return \Illuminate\Support\Collection - */ - public function dueEvents($app) - { - return collect($this->events)->filter->isDue($app); - } - - /** - * Get all of the events on the schedule. - * - * @return \Illuminate\Console\Scheduling\Event[] - */ - public function events() - { - return $this->events; - } - - /** - * Specify the cache store that should be used to store mutexes. - * - * @param string $store - * @return $this - */ - public function useCache($store) - { - if ($this->eventMutex instanceof CacheAware) { - $this->eventMutex->useStore($store); - } - - if ($this->schedulingMutex instanceof CacheAware) { - $this->schedulingMutex->useStore($store); - } - - return $this; - } - - /** - * Get the job dispatcher, if available. - * - * @return \Illuminate\Contracts\Bus\Dispatcher - * - * @throws \RuntimeException - */ - protected function getDispatcher() - { - if ($this->dispatcher === null) { - try { - $this->dispatcher = Container::getInstance()->make(Dispatcher::class); - } catch (BindingResolutionException $e) { - throw new RuntimeException( - 'Unable to resolve the dispatcher from the service container. Please bind it or install the illuminate/bus package.', - is_int($e->getCode()) ? $e->getCode() : 0, $e - ); - } - } - - return $this->dispatcher; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleClearCacheCommand.php b/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleClearCacheCommand.php deleted file mode 100644 index 3deb1c6b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleClearCacheCommand.php +++ /dev/null @@ -1,47 +0,0 @@ -events($this->laravel) as $event) { - if ($event->mutex->exists($event)) { - $this->components->info(sprintf('Deleting mutex for [%s]', $event->command)); - - $event->mutex->forget($event); - - $mutexCleared = true; - } - } - - if (! $mutexCleared) { - $this->components->info('No mutex files were found.'); - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleFinishCommand.php b/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleFinishCommand.php deleted file mode 100644 index 54943537..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleFinishCommand.php +++ /dev/null @@ -1,61 +0,0 @@ -events())->filter(function ($value) { - return $value->mutexName() == $this->argument('id'); - })->each(function ($event) { - $event->finish($this->laravel, $this->argument('code')); - - $this->laravel->make(Dispatcher::class)->dispatch(new ScheduledBackgroundTaskFinished($event)); - }); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleListCommand.php b/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleListCommand.php deleted file mode 100644 index 9f26f09c..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleListCommand.php +++ /dev/null @@ -1,259 +0,0 @@ -events()); - - if ($events->isEmpty()) { - $this->components->info('No scheduled tasks have been defined.'); - - return; - } - - $terminalWidth = self::getTerminalWidth(); - - $expressionSpacing = $this->getCronExpressionSpacing($events); - - $timezone = new DateTimeZone($this->option('timezone') ?? config('app.timezone')); - - $events = $this->sortEvents($events, $timezone); - - $events = $events->map(function ($event) use ($terminalWidth, $expressionSpacing, $timezone) { - $expression = $this->formatCronExpression($event->expression, $expressionSpacing); - - $command = $event->command ?? ''; - - $description = $event->description ?? ''; - - if (! $this->output->isVerbose()) { - $command = str_replace([Application::phpBinary(), Application::artisanBinary()], [ - 'php', - preg_replace("#['\"]#", '', Application::artisanBinary()), - ], $command); - } - - if ($event instanceof CallbackEvent) { - if (class_exists($description)) { - $command = $description; - $description = ''; - } else { - $command = 'Closure at: '.$this->getClosureLocation($event); - } - } - - $command = mb_strlen($command) > 1 ? "{$command} " : ''; - - $nextDueDateLabel = 'Next Due:'; - - $nextDueDate = $this->getNextDueDateForEvent($event, $timezone); - - $nextDueDate = $this->output->isVerbose() - ? $nextDueDate->format('Y-m-d H:i:s P') - : $nextDueDate->diffForHumans(); - - $hasMutex = $event->mutex->exists($event) ? 'Has Mutex › ' : ''; - - $dots = str_repeat('.', max( - $terminalWidth - mb_strlen($expression.$command.$nextDueDateLabel.$nextDueDate.$hasMutex) - 8, 0 - )); - - // Highlight the parameters... - $command = preg_replace("#(php artisan [\w\-:]+) (.+)#", '$1 $2', $command); - - return [sprintf( - ' %s %s%s %s%s %s', - $expression, - $command, - $dots, - $hasMutex, - $nextDueDateLabel, - $nextDueDate - ), $this->output->isVerbose() && mb_strlen($description) > 1 ? sprintf( - ' %s%s %s', - str_repeat(' ', mb_strlen($expression) + 2), - '⇁', - $description - ) : '']; - }); - - $this->line( - $events->flatten()->filter()->prepend('')->push('')->toArray() - ); - } - - /** - * Gets the spacing to be used on each event row. - * - * @param \Illuminate\Support\Collection $events - * @return array - */ - private function getCronExpressionSpacing($events) - { - $rows = $events->map(fn ($event) => array_map('mb_strlen', preg_split("/\s+/", $event->expression))); - - return collect($rows[0] ?? [])->keys()->map(fn ($key) => $rows->max($key))->all(); - } - - /** - * Sorts the events by due date if option set. - * - * @param \Illuminate\Support\Collection $events - * @param \DateTimeZone $timezone - * @return \Illuminate\Support\Collection - */ - private function sortEvents(\Illuminate\Support\Collection $events, DateTimeZone $timezone) - { - return $this->option('next') - ? $events->sortBy(fn ($event) => $this->getNextDueDateForEvent($event, $timezone)) - : $events; - } - - /** - * Get the next due date for an event. - * - * @param \Illuminate\Console\Scheduling\Event $event - * @param \DateTimeZone $timezone - * @return \Illuminate\Support\Carbon - */ - private function getNextDueDateForEvent($event, DateTimeZone $timezone) - { - return Carbon::instance( - (new CronExpression($event->expression)) - ->getNextRunDate(Carbon::now()->setTimezone($event->timezone)) - ->setTimezone($timezone) - ); - } - - /** - * Formats the cron expression based on the spacing provided. - * - * @param string $expression - * @param array $spacing - * @return string - */ - private function formatCronExpression($expression, $spacing) - { - $expressions = preg_split("/\s+/", $expression); - - return collect($spacing) - ->map(fn ($length, $index) => str_pad($expressions[$index], $length)) - ->implode(' '); - } - - /** - * Get the file and line number for the event closure. - * - * @param \Illuminate\Console\Scheduling\CallbackEvent $event - * @return string - */ - private function getClosureLocation(CallbackEvent $event) - { - $callback = tap((new ReflectionClass($event))->getProperty('callback')) - ->setAccessible(true) - ->getValue($event); - - if ($callback instanceof Closure) { - $function = new ReflectionFunction($callback); - - return sprintf( - '%s:%s', - str_replace($this->laravel->basePath().DIRECTORY_SEPARATOR, '', $function->getFileName() ?: ''), - $function->getStartLine() - ); - } - - if (is_string($callback)) { - return $callback; - } - - if (is_array($callback)) { - $className = is_string($callback[0]) ? $callback[0] : $callback[0]::class; - - return sprintf('%s::%s', $className, $callback[1]); - } - - return sprintf('%s::__invoke', $callback::class); - } - - /** - * Get the terminal width. - * - * @return int - */ - public static function getTerminalWidth() - { - return is_null(static::$terminalWidthResolver) - ? (new Terminal)->getWidth() - : call_user_func(static::$terminalWidthResolver); - } - - /** - * Set a callback that should be used when resolving the terminal width. - * - * @param \Closure|null $resolver - * @return void - */ - public static function resolveTerminalWidthUsing($resolver) - { - static::$terminalWidthResolver = $resolver; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php b/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php deleted file mode 100644 index 067aebd0..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php +++ /dev/null @@ -1,207 +0,0 @@ -startedAt = Date::now(); - - parent::__construct(); - } - - /** - * Execute the console command. - * - * @param \Illuminate\Console\Scheduling\Schedule $schedule - * @param \Illuminate\Contracts\Events\Dispatcher $dispatcher - * @param \Illuminate\Contracts\Debug\ExceptionHandler $handler - * @return void - */ - public function handle(Schedule $schedule, Dispatcher $dispatcher, ExceptionHandler $handler) - { - $this->schedule = $schedule; - $this->dispatcher = $dispatcher; - $this->handler = $handler; - $this->phpBinary = Application::phpBinary(); - - $this->newLine(); - - foreach ($this->schedule->dueEvents($this->laravel) as $event) { - if (! $event->filtersPass($this->laravel)) { - $this->dispatcher->dispatch(new ScheduledTaskSkipped($event)); - - continue; - } - - if ($event->onOneServer) { - $this->runSingleServerEvent($event); - } else { - $this->runEvent($event); - } - - $this->eventsRan = true; - } - - if (! $this->eventsRan) { - $this->components->info('No scheduled commands are ready to run.'); - } else { - $this->newLine(); - } - } - - /** - * Run the given single server event. - * - * @param \Illuminate\Console\Scheduling\Event $event - * @return void - */ - protected function runSingleServerEvent($event) - { - if ($this->schedule->serverShouldRun($event, $this->startedAt)) { - $this->runEvent($event); - } else { - $this->components->info(sprintf( - 'Skipping [%s], as command already run on another server.', $event->getSummaryForDisplay() - )); - } - } - - /** - * Run the given event. - * - * @param \Illuminate\Console\Scheduling\Event $event - * @return void - */ - protected function runEvent($event) - { - $summary = $event->getSummaryForDisplay(); - - $command = $event instanceof CallbackEvent - ? $summary - : trim(str_replace($this->phpBinary, '', $event->command)); - - $description = sprintf( - '%s Running [%s]%s', - Carbon::now()->format('Y-m-d H:i:s'), - $command, - $event->runInBackground ? ' in background' : '', - ); - - $this->components->task($description, function () use ($event) { - $this->dispatcher->dispatch(new ScheduledTaskStarting($event)); - - $start = microtime(true); - - try { - $event->run($this->laravel); - - $this->dispatcher->dispatch(new ScheduledTaskFinished( - $event, - round(microtime(true) - $start, 2) - )); - - $this->eventsRan = true; - } catch (Throwable $e) { - $this->dispatcher->dispatch(new ScheduledTaskFailed($event, $e)); - - $this->handler->report($e); - } - - return $event->exitCode == 0; - }); - - if (! $event instanceof CallbackEvent) { - $this->components->bulletList([ - $event->getSummaryForDisplay(), - ]); - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleTestCommand.php b/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleTestCommand.php deleted file mode 100644 index a8a1a596..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleTestCommand.php +++ /dev/null @@ -1,99 +0,0 @@ -events(); - - $commandNames = []; - - foreach ($commands as $command) { - $commandNames[] = $command->command ?? $command->getSummaryForDisplay(); - } - - if (empty($commandNames)) { - return $this->components->info('No scheduled commands have been defined.'); - } - - if (! empty($name = $this->option('name'))) { - $commandBinary = $phpBinary.' '.Application::artisanBinary(); - - $matches = array_filter($commandNames, function ($commandName) use ($commandBinary, $name) { - return trim(str_replace($commandBinary, '', $commandName)) === $name; - }); - - if (count($matches) !== 1) { - $this->components->info('No matching scheduled command found.'); - - return; - } - - $index = key($matches); - } else { - $index = array_search($this->components->choice('Which command would you like to run?', $commandNames), $commandNames); - } - - $event = $commands[$index]; - - $summary = $event->getSummaryForDisplay(); - - $command = $event instanceof CallbackEvent - ? $summary - : trim(str_replace($phpBinary, '', $event->command)); - - $description = sprintf( - 'Running [%s]%s', - $command, - $event->runInBackground ? ' in background' : '', - ); - - $this->components->task($description, fn () => $event->run($this->laravel)); - - if (! $event instanceof CallbackEvent) { - $this->components->bulletList([$event->getSummaryForDisplay()]); - } - - $this->newLine(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleWorkCommand.php b/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleWorkCommand.php deleted file mode 100644 index de3ce944..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleWorkCommand.php +++ /dev/null @@ -1,77 +0,0 @@ -components->info('Running schedule tasks every minute.'); - - [$lastExecutionStartedAt, $executions] = [null, []]; - - while (true) { - usleep(100 * 1000); - - if (Carbon::now()->second === 0 && - ! Carbon::now()->startOfMinute()->equalTo($lastExecutionStartedAt)) { - $executions[] = $execution = new Process([ - PHP_BINARY, - defined('ARTISAN_BINARY') ? ARTISAN_BINARY : 'artisan', - 'schedule:run', - ]); - - $execution->start(); - - $lastExecutionStartedAt = Carbon::now()->startOfMinute(); - } - - foreach ($executions as $key => $execution) { - $output = $execution->getIncrementalOutput(). - $execution->getIncrementalErrorOutput(); - - $this->output->write(ltrim($output, "\n")); - - if (! $execution->isRunning()) { - unset($executions[$key]); - } - } - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/Scheduling/SchedulingMutex.php b/vendor/laravel/framework/src/Illuminate/Console/Scheduling/SchedulingMutex.php deleted file mode 100644 index ab4e87da..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/Scheduling/SchedulingMutex.php +++ /dev/null @@ -1,26 +0,0 @@ ->|null - */ - protected $previousHandlers; - - /** - * The current availability resolver, if any. - * - * @var (callable(): bool)|null - */ - protected static $availabilityResolver; - - /** - * Create a new signal registrar instance. - * - * @param \Symfony\Component\Console\SignalRegistry\SignalRegistry $registry - * @return void - */ - public function __construct($registry) - { - $this->registry = $registry; - - $this->previousHandlers = $this->getHandlers(); - } - - /** - * Register a new signal handler. - * - * @param int $signal - * @param callable(int $signal): void $callback - * @return void - */ - public function register($signal, $callback) - { - $this->previousHandlers[$signal] ??= $this->initializeSignal($signal); - - with($this->getHandlers(), function ($handlers) use ($signal) { - $handlers[$signal] ??= $this->initializeSignal($signal); - - $this->setHandlers($handlers); - }); - - $this->registry->register($signal, $callback); - - with($this->getHandlers(), function ($handlers) use ($signal) { - $lastHandlerInserted = array_pop($handlers[$signal]); - - array_unshift($handlers[$signal], $lastHandlerInserted); - - $this->setHandlers($handlers); - }); - } - - /** - * Gets the signal's existing handler in array format. - * - * @return array - */ - protected function initializeSignal($signal) - { - return is_callable($existingHandler = pcntl_signal_get_handler($signal)) - ? [$existingHandler] - : null; - } - - /** - * Unregister the current signal handlers. - * - * @return array> - */ - public function unregister() - { - $previousHandlers = $this->previousHandlers; - - foreach ($previousHandlers as $signal => $handler) { - if (is_null($handler)) { - pcntl_signal($signal, SIG_DFL); - - unset($previousHandlers[$signal]); - } - } - - $this->setHandlers($previousHandlers); - } - - /** - * Execute the given callback if "signals" should be used and are available. - * - * @param callable $callback - * @return void - */ - public static function whenAvailable($callback) - { - $resolver = static::$availabilityResolver; - - if ($resolver()) { - $callback(); - } - } - - /** - * Get the registry's handlers. - * - * @return array> - */ - protected function getHandlers() - { - return (fn () => $this->signalHandlers) - ->call($this->registry); - } - - /** - * Set the registry's handlers. - * - * @param array> $handlers - * @return void - */ - protected function setHandlers($handlers) - { - (fn () => $this->signalHandlers = $handlers) - ->call($this->registry); - } - - /** - * Set the availability resolver. - * - * @param callable(): bool - * @return void - */ - public static function resolveAvailabilityUsing($resolver) - { - static::$availabilityResolver = $resolver; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/View/Components/Alert.php b/vendor/laravel/framework/src/Illuminate/Console/View/Components/Alert.php deleted file mode 100644 index a975aaf8..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/View/Components/Alert.php +++ /dev/null @@ -1,28 +0,0 @@ -mutate($string, [ - Mutators\EnsureDynamicContentIsHighlighted::class, - Mutators\EnsurePunctuation::class, - Mutators\EnsureRelativePaths::class, - ]); - - $this->renderView('alert', [ - 'content' => $string, - ], $verbosity); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/View/Components/BulletList.php b/vendor/laravel/framework/src/Illuminate/Console/View/Components/BulletList.php deleted file mode 100644 index da3d8817..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/View/Components/BulletList.php +++ /dev/null @@ -1,28 +0,0 @@ - $elements - * @param int $verbosity - * @return void - */ - public function render($elements, $verbosity = OutputInterface::VERBOSITY_NORMAL) - { - $elements = $this->mutate($elements, [ - Mutators\EnsureDynamicContentIsHighlighted::class, - Mutators\EnsureNoPunctuation::class, - Mutators\EnsureRelativePaths::class, - ]); - - $this->renderView('bullet-list', [ - 'elements' => $elements, - ], $verbosity); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/View/Components/Choice.php b/vendor/laravel/framework/src/Illuminate/Console/View/Components/Choice.php deleted file mode 100644 index 6a669b94..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/View/Components/Choice.php +++ /dev/null @@ -1,25 +0,0 @@ - $choices - * @param mixed $default - * @return mixed - */ - public function render($question, $choices, $default = null) - { - return $this->usingQuestionHelper( - fn () => $this->output->askQuestion( - new ChoiceQuestion($question, $choices, $default) - ), - ); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/View/Components/Component.php b/vendor/laravel/framework/src/Illuminate/Console/View/Components/Component.php deleted file mode 100644 index 263d0034..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/View/Components/Component.php +++ /dev/null @@ -1,124 +0,0 @@ - - */ - protected $mutators; - - /** - * Creates a new component instance. - * - * @param \Illuminate\Console\OutputStyle $output - * @return void - */ - public function __construct($output) - { - $this->output = $output; - } - - /** - * Renders the given view. - * - * @param string $view - * @param \Illuminate\Contracts\Support\Arrayable|array $data - * @param int $verbosity - * @return void - */ - protected function renderView($view, $data, $verbosity) - { - renderUsing($this->output); - - render((string) $this->compile($view, $data), $verbosity); - } - - /** - * Compile the given view contents. - * - * @param string $view - * @param array $data - * @return void - */ - protected function compile($view, $data) - { - extract($data); - - ob_start(); - - include __DIR__."/../../resources/views/components/$view.php"; - - return tap(ob_get_contents(), function () { - ob_end_clean(); - }); - } - - /** - * Mutates the given data with the given set of mutators. - * - * @param array|string $data - * @param array $mutators - * @return array|string - */ - protected function mutate($data, $mutators) - { - foreach ($mutators as $mutator) { - $mutator = new $mutator; - - if (is_iterable($data)) { - foreach ($data as $key => $value) { - $data[$key] = $mutator($value); - } - } else { - $data = $mutator($data); - } - } - - return $data; - } - - /** - * Eventually performs a question using the component's question helper. - * - * @param callable $callable - * @return mixed - */ - protected function usingQuestionHelper($callable) - { - $property = with(new ReflectionClass(OutputStyle::class)) - ->getParentClass() - ->getProperty('questionHelper'); - - $property->setAccessible(true); - - $currentHelper = $property->isInitialized($this->output) - ? $property->getValue($this->output) - : new SymfonyQuestionHelper(); - - $property->setValue($this->output, new QuestionHelper); - - try { - return $callable(); - } finally { - $property->setValue($this->output, $currentHelper); - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/View/Components/Confirm.php b/vendor/laravel/framework/src/Illuminate/Console/View/Components/Confirm.php deleted file mode 100644 index 1e98c1e2..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/View/Components/Confirm.php +++ /dev/null @@ -1,20 +0,0 @@ -usingQuestionHelper( - fn () => $this->output->confirm($question, $default), - ); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/View/Components/Error.php b/vendor/laravel/framework/src/Illuminate/Console/View/Components/Error.php deleted file mode 100644 index 73196cc8..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/View/Components/Error.php +++ /dev/null @@ -1,20 +0,0 @@ -output))->render('error', $string, $verbosity); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/View/Components/Factory.php b/vendor/laravel/framework/src/Illuminate/Console/View/Components/Factory.php deleted file mode 100644 index f544ea32..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/View/Components/Factory.php +++ /dev/null @@ -1,58 +0,0 @@ -output = $output; - } - - /** - * Dynamically handle calls into the component instance. - * - * @param string $method - * @param array $parameters - * @return mixed - * - * @throws \InvalidArgumentException - */ - public function __call($method, $parameters) - { - $component = '\Illuminate\Console\View\Components\\'.ucfirst($method); - - throw_unless(class_exists($component), new InvalidArgumentException(sprintf( - 'Console component [%s] not found.', $method - ))); - - return with(new $component($this->output))->render(...$parameters); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/View/Components/Info.php b/vendor/laravel/framework/src/Illuminate/Console/View/Components/Info.php deleted file mode 100644 index 76514224..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/View/Components/Info.php +++ /dev/null @@ -1,20 +0,0 @@ -output))->render('info', $string, $verbosity); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/View/Components/Line.php b/vendor/laravel/framework/src/Illuminate/Console/View/Components/Line.php deleted file mode 100644 index 5c701ee5..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/View/Components/Line.php +++ /dev/null @@ -1,54 +0,0 @@ -> - */ - protected static $styles = [ - 'info' => [ - 'bgColor' => 'blue', - 'fgColor' => 'white', - 'title' => 'info', - ], - 'warn' => [ - 'bgColor' => 'yellow', - 'fgColor' => 'black', - 'title' => 'warn', - ], - 'error' => [ - 'bgColor' => 'red', - 'fgColor' => 'white', - 'title' => 'error', - ], - ]; - - /** - * Renders the component using the given arguments. - * - * @param string $style - * @param string $string - * @param int $verbosity - * @return void - */ - public function render($style, $string, $verbosity = OutputInterface::VERBOSITY_NORMAL) - { - $string = $this->mutate($string, [ - Mutators\EnsureDynamicContentIsHighlighted::class, - Mutators\EnsurePunctuation::class, - Mutators\EnsureRelativePaths::class, - ]); - - $this->renderView('line', array_merge(static::$styles[$style], [ - 'marginTop' => ($this->output instanceof NewLineAware && $this->output->newLineWritten()) ? 0 : 1, - 'content' => $string, - ]), $verbosity); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/View/Components/Mutators/EnsureDynamicContentIsHighlighted.php b/vendor/laravel/framework/src/Illuminate/Console/View/Components/Mutators/EnsureDynamicContentIsHighlighted.php deleted file mode 100644 index 225e9f02..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/View/Components/Mutators/EnsureDynamicContentIsHighlighted.php +++ /dev/null @@ -1,17 +0,0 @@ -[$1]', (string) $string); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/View/Components/Mutators/EnsureNoPunctuation.php b/vendor/laravel/framework/src/Illuminate/Console/View/Components/Mutators/EnsureNoPunctuation.php deleted file mode 100644 index 5f349362..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/View/Components/Mutators/EnsureNoPunctuation.php +++ /dev/null @@ -1,21 +0,0 @@ -endsWith(['.', '?', '!', ':'])) { - return substr_replace($string, '', -1); - } - - return $string; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/View/Components/Mutators/EnsurePunctuation.php b/vendor/laravel/framework/src/Illuminate/Console/View/Components/Mutators/EnsurePunctuation.php deleted file mode 100644 index c99fecff..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/View/Components/Mutators/EnsurePunctuation.php +++ /dev/null @@ -1,21 +0,0 @@ -endsWith(['.', '?', '!', ':'])) { - return "$string."; - } - - return $string; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/View/Components/Mutators/EnsureRelativePaths.php b/vendor/laravel/framework/src/Illuminate/Console/View/Components/Mutators/EnsureRelativePaths.php deleted file mode 100644 index babd0343..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/View/Components/Mutators/EnsureRelativePaths.php +++ /dev/null @@ -1,21 +0,0 @@ -has('path.base')) { - $string = str_replace(base_path().'/', '', $string); - } - - return $string; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/View/Components/Task.php b/vendor/laravel/framework/src/Illuminate/Console/View/Components/Task.php deleted file mode 100644 index cac979db..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/View/Components/Task.php +++ /dev/null @@ -1,57 +0,0 @@ -mutate($description, [ - Mutators\EnsureDynamicContentIsHighlighted::class, - Mutators\EnsureNoPunctuation::class, - Mutators\EnsureRelativePaths::class, - ]); - - $descriptionWidth = mb_strlen(preg_replace("/\<[\w=#\/\;,:.&,%?]+\>|\\e\[\d+m/", '$1', $description) ?? ''); - - $this->output->write(" $description ", false, $verbosity); - - $startTime = microtime(true); - - $result = false; - - try { - $result = ($task ?: fn () => true)(); - } catch (Throwable $e) { - throw $e; - } finally { - $runTime = $task - ? (' '.number_format((microtime(true) - $startTime) * 1000).'ms') - : ''; - - $runTimeWidth = mb_strlen($runTime); - $width = min(terminal()->width(), 150); - $dots = max($width - $descriptionWidth - $runTimeWidth - 10, 0); - - $this->output->write(str_repeat('.', $dots), false, $verbosity); - $this->output->write("$runTime", false, $verbosity); - - $this->output->writeln( - $result !== false ? ' DONE' : ' FAIL', - $verbosity, - ); - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/View/Components/TwoColumnDetail.php b/vendor/laravel/framework/src/Illuminate/Console/View/Components/TwoColumnDetail.php deleted file mode 100644 index 1ffa0893..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/View/Components/TwoColumnDetail.php +++ /dev/null @@ -1,36 +0,0 @@ -mutate($first, [ - Mutators\EnsureDynamicContentIsHighlighted::class, - Mutators\EnsureNoPunctuation::class, - Mutators\EnsureRelativePaths::class, - ]); - - $second = $this->mutate($second, [ - Mutators\EnsureDynamicContentIsHighlighted::class, - Mutators\EnsureNoPunctuation::class, - Mutators\EnsureRelativePaths::class, - ]); - - $this->renderView('two-column-detail', [ - 'first' => $first, - 'second' => $second, - ], $verbosity); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/View/Components/Warn.php b/vendor/laravel/framework/src/Illuminate/Console/View/Components/Warn.php deleted file mode 100644 index 20adb1f2..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/View/Components/Warn.php +++ /dev/null @@ -1,21 +0,0 @@ -output)) - ->render('warn', $string, $verbosity); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/composer.json b/vendor/laravel/framework/src/Illuminate/Console/composer.json deleted file mode 100755 index 93b8b57a..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/composer.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "illuminate/console", - "description": "The Illuminate Console package.", - "license": "MIT", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "require": { - "php": "^8.0.2", - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0", - "illuminate/view": "^9.0", - "nunomaduro/termwind": "^1.13", - "symfony/console": "^6.0.9", - "symfony/process": "^6.0" - }, - "autoload": { - "psr-4": { - "Illuminate\\Console\\": "" - } - }, - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "suggest": { - "dragonmantank/cron-expression": "Required to use scheduler (^3.3.2).", - "guzzlehttp/guzzle": "Required to use the ping methods on schedules (^7.5).", - "illuminate/bus": "Required to use the scheduled job dispatcher (^9.0).", - "illuminate/container": "Required to use the scheduler (^9.0).", - "illuminate/filesystem": "Required to use the generator command (^9.0).", - "illuminate/queue": "Required to use closures for scheduled jobs (^9.0)." - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev" -} diff --git a/vendor/laravel/framework/src/Illuminate/Console/resources/views/components/alert.php b/vendor/laravel/framework/src/Illuminate/Console/resources/views/components/alert.php deleted file mode 100644 index bddcb213..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/resources/views/components/alert.php +++ /dev/null @@ -1,3 +0,0 @@ -
- -
diff --git a/vendor/laravel/framework/src/Illuminate/Console/resources/views/components/bullet-list.php b/vendor/laravel/framework/src/Illuminate/Console/resources/views/components/bullet-list.php deleted file mode 100644 index a016a910..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/resources/views/components/bullet-list.php +++ /dev/null @@ -1,7 +0,0 @@ -
- -
- ⇂ -
- -
diff --git a/vendor/laravel/framework/src/Illuminate/Console/resources/views/components/line.php b/vendor/laravel/framework/src/Illuminate/Console/resources/views/components/line.php deleted file mode 100644 index a6c38cfa..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/resources/views/components/line.php +++ /dev/null @@ -1,8 +0,0 @@ -
- - - - -
diff --git a/vendor/laravel/framework/src/Illuminate/Console/resources/views/components/two-column-detail.php b/vendor/laravel/framework/src/Illuminate/Console/resources/views/components/two-column-detail.php deleted file mode 100644 index 1aeed496..00000000 --- a/vendor/laravel/framework/src/Illuminate/Console/resources/views/components/two-column-detail.php +++ /dev/null @@ -1,11 +0,0 @@ -
- - - - - - - - - -
diff --git a/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php b/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php deleted file mode 100644 index 0bac7fae..00000000 --- a/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php +++ /dev/null @@ -1,202 +0,0 @@ -make($segments[0]), $method], $parameters - ); - } - - /** - * Call a method that has been bound to the container. - * - * @param \Illuminate\Container\Container $container - * @param callable $callback - * @param mixed $default - * @return mixed - */ - protected static function callBoundMethod($container, $callback, $default) - { - if (! is_array($callback)) { - return Util::unwrapIfClosure($default); - } - - // Here we need to turn the array callable into a Class@method string we can use to - // examine the container and see if there are any method bindings for this given - // method. If there are, we can call this method binding callback immediately. - $method = static::normalizeMethod($callback); - - if ($container->hasMethodBinding($method)) { - return $container->callMethodBinding($method, $callback[0]); - } - - return Util::unwrapIfClosure($default); - } - - /** - * Normalize the given callback into a Class@method string. - * - * @param callable $callback - * @return string - */ - protected static function normalizeMethod($callback) - { - $class = is_string($callback[0]) ? $callback[0] : get_class($callback[0]); - - return "{$class}@{$callback[1]}"; - } - - /** - * Get all dependencies for a given method. - * - * @param \Illuminate\Container\Container $container - * @param callable|string $callback - * @param array $parameters - * @return array - * - * @throws \ReflectionException - */ - protected static function getMethodDependencies($container, $callback, array $parameters = []) - { - $dependencies = []; - - foreach (static::getCallReflector($callback)->getParameters() as $parameter) { - static::addDependencyForCallParameter($container, $parameter, $parameters, $dependencies); - } - - return array_merge($dependencies, array_values($parameters)); - } - - /** - * Get the proper reflection instance for the given callback. - * - * @param callable|string $callback - * @return \ReflectionFunctionAbstract - * - * @throws \ReflectionException - */ - protected static function getCallReflector($callback) - { - if (is_string($callback) && str_contains($callback, '::')) { - $callback = explode('::', $callback); - } elseif (is_object($callback) && ! $callback instanceof Closure) { - $callback = [$callback, '__invoke']; - } - - return is_array($callback) - ? new ReflectionMethod($callback[0], $callback[1]) - : new ReflectionFunction($callback); - } - - /** - * Get the dependency for the given call parameter. - * - * @param \Illuminate\Container\Container $container - * @param \ReflectionParameter $parameter - * @param array $parameters - * @param array $dependencies - * @return void - * - * @throws \Illuminate\Contracts\Container\BindingResolutionException - */ - protected static function addDependencyForCallParameter($container, $parameter, - array &$parameters, &$dependencies) - { - if (array_key_exists($paramName = $parameter->getName(), $parameters)) { - $dependencies[] = $parameters[$paramName]; - - unset($parameters[$paramName]); - } elseif (! is_null($className = Util::getParameterClassName($parameter))) { - if (array_key_exists($className, $parameters)) { - $dependencies[] = $parameters[$className]; - - unset($parameters[$className]); - } elseif ($parameter->isVariadic()) { - $variadicDependencies = $container->make($className); - - $dependencies = array_merge($dependencies, is_array($variadicDependencies) - ? $variadicDependencies - : [$variadicDependencies]); - } else { - $dependencies[] = $container->make($className); - } - } elseif ($parameter->isDefaultValueAvailable()) { - $dependencies[] = $parameter->getDefaultValue(); - } elseif (! $parameter->isOptional() && ! array_key_exists($paramName, $parameters)) { - $message = "Unable to resolve dependency [{$parameter}] in class {$parameter->getDeclaringClass()->getName()}"; - - throw new BindingResolutionException($message); - } - } - - /** - * Determine if the given string is in Class@method syntax. - * - * @param mixed $callback - * @return bool - */ - protected static function isCallableWithAtSign($callback) - { - return is_string($callback) && str_contains($callback, '@'); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Container/Container.php b/vendor/laravel/framework/src/Illuminate/Container/Container.php deleted file mode 100755 index 0f2f2995..00000000 --- a/vendor/laravel/framework/src/Illuminate/Container/Container.php +++ /dev/null @@ -1,1469 +0,0 @@ -getAlias($c); - } - - return new ContextualBindingBuilder($this, $aliases); - } - - /** - * Determine if the given abstract type has been bound. - * - * @param string $abstract - * @return bool - */ - public function bound($abstract) - { - return isset($this->bindings[$abstract]) || - isset($this->instances[$abstract]) || - $this->isAlias($abstract); - } - - /** - * {@inheritdoc} - * - * @return bool - */ - public function has(string $id): bool - { - return $this->bound($id); - } - - /** - * Determine if the given abstract type has been resolved. - * - * @param string $abstract - * @return bool - */ - public function resolved($abstract) - { - if ($this->isAlias($abstract)) { - $abstract = $this->getAlias($abstract); - } - - return isset($this->resolved[$abstract]) || - isset($this->instances[$abstract]); - } - - /** - * Determine if a given type is shared. - * - * @param string $abstract - * @return bool - */ - public function isShared($abstract) - { - return isset($this->instances[$abstract]) || - (isset($this->bindings[$abstract]['shared']) && - $this->bindings[$abstract]['shared'] === true); - } - - /** - * Determine if a given string is an alias. - * - * @param string $name - * @return bool - */ - public function isAlias($name) - { - return isset($this->aliases[$name]); - } - - /** - * Register a binding with the container. - * - * @param string $abstract - * @param \Closure|string|null $concrete - * @param bool $shared - * @return void - * - * @throws \TypeError - */ - public function bind($abstract, $concrete = null, $shared = false) - { - $this->dropStaleInstances($abstract); - - // If no concrete type was given, we will simply set the concrete type to the - // abstract type. After that, the concrete type to be registered as shared - // without being forced to state their classes in both of the parameters. - if (is_null($concrete)) { - $concrete = $abstract; - } - - // If the factory is not a Closure, it means it is just a class name which is - // bound into this container to the abstract type and we will just wrap it - // up inside its own Closure to give us more convenience when extending. - if (! $concrete instanceof Closure) { - if (! is_string($concrete)) { - throw new TypeError(self::class.'::bind(): Argument #2 ($concrete) must be of type Closure|string|null'); - } - - $concrete = $this->getClosure($abstract, $concrete); - } - - $this->bindings[$abstract] = compact('concrete', 'shared'); - - // If the abstract type was already resolved in this container we'll fire the - // rebound listener so that any objects which have already gotten resolved - // can have their copy of the object updated via the listener callbacks. - if ($this->resolved($abstract)) { - $this->rebound($abstract); - } - } - - /** - * Get the Closure to be used when building a type. - * - * @param string $abstract - * @param string $concrete - * @return \Closure - */ - protected function getClosure($abstract, $concrete) - { - return function ($container, $parameters = []) use ($abstract, $concrete) { - if ($abstract == $concrete) { - return $container->build($concrete); - } - - return $container->resolve( - $concrete, $parameters, $raiseEvents = false - ); - }; - } - - /** - * Determine if the container has a method binding. - * - * @param string $method - * @return bool - */ - public function hasMethodBinding($method) - { - return isset($this->methodBindings[$method]); - } - - /** - * Bind a callback to resolve with Container::call. - * - * @param array|string $method - * @param \Closure $callback - * @return void - */ - public function bindMethod($method, $callback) - { - $this->methodBindings[$this->parseBindMethod($method)] = $callback; - } - - /** - * Get the method to be bound in class@method format. - * - * @param array|string $method - * @return string - */ - protected function parseBindMethod($method) - { - if (is_array($method)) { - return $method[0].'@'.$method[1]; - } - - return $method; - } - - /** - * Get the method binding for the given method. - * - * @param string $method - * @param mixed $instance - * @return mixed - */ - public function callMethodBinding($method, $instance) - { - return call_user_func($this->methodBindings[$method], $instance, $this); - } - - /** - * Add a contextual binding to the container. - * - * @param string $concrete - * @param string $abstract - * @param \Closure|string $implementation - * @return void - */ - public function addContextualBinding($concrete, $abstract, $implementation) - { - $this->contextual[$concrete][$this->getAlias($abstract)] = $implementation; - } - - /** - * Register a binding if it hasn't already been registered. - * - * @param string $abstract - * @param \Closure|string|null $concrete - * @param bool $shared - * @return void - */ - public function bindIf($abstract, $concrete = null, $shared = false) - { - if (! $this->bound($abstract)) { - $this->bind($abstract, $concrete, $shared); - } - } - - /** - * Register a shared binding in the container. - * - * @param string $abstract - * @param \Closure|string|null $concrete - * @return void - */ - public function singleton($abstract, $concrete = null) - { - $this->bind($abstract, $concrete, true); - } - - /** - * Register a shared binding if it hasn't already been registered. - * - * @param string $abstract - * @param \Closure|string|null $concrete - * @return void - */ - public function singletonIf($abstract, $concrete = null) - { - if (! $this->bound($abstract)) { - $this->singleton($abstract, $concrete); - } - } - - /** - * Register a scoped binding in the container. - * - * @param string $abstract - * @param \Closure|string|null $concrete - * @return void - */ - public function scoped($abstract, $concrete = null) - { - $this->scopedInstances[] = $abstract; - - $this->singleton($abstract, $concrete); - } - - /** - * Register a scoped binding if it hasn't already been registered. - * - * @param string $abstract - * @param \Closure|string|null $concrete - * @return void - */ - public function scopedIf($abstract, $concrete = null) - { - if (! $this->bound($abstract)) { - $this->scoped($abstract, $concrete); - } - } - - /** - * "Extend" an abstract type in the container. - * - * @param string $abstract - * @param \Closure $closure - * @return void - * - * @throws \InvalidArgumentException - */ - public function extend($abstract, Closure $closure) - { - $abstract = $this->getAlias($abstract); - - if (isset($this->instances[$abstract])) { - $this->instances[$abstract] = $closure($this->instances[$abstract], $this); - - $this->rebound($abstract); - } else { - $this->extenders[$abstract][] = $closure; - - if ($this->resolved($abstract)) { - $this->rebound($abstract); - } - } - } - - /** - * Register an existing instance as shared in the container. - * - * @param string $abstract - * @param mixed $instance - * @return mixed - */ - public function instance($abstract, $instance) - { - $this->removeAbstractAlias($abstract); - - $isBound = $this->bound($abstract); - - unset($this->aliases[$abstract]); - - // We'll check to determine if this type has been bound before, and if it has - // we will fire the rebound callbacks registered with the container and it - // can be updated with consuming classes that have gotten resolved here. - $this->instances[$abstract] = $instance; - - if ($isBound) { - $this->rebound($abstract); - } - - return $instance; - } - - /** - * Remove an alias from the contextual binding alias cache. - * - * @param string $searched - * @return void - */ - protected function removeAbstractAlias($searched) - { - if (! isset($this->aliases[$searched])) { - return; - } - - foreach ($this->abstractAliases as $abstract => $aliases) { - foreach ($aliases as $index => $alias) { - if ($alias == $searched) { - unset($this->abstractAliases[$abstract][$index]); - } - } - } - } - - /** - * Assign a set of tags to a given binding. - * - * @param array|string $abstracts - * @param array|mixed ...$tags - * @return void - */ - public function tag($abstracts, $tags) - { - $tags = is_array($tags) ? $tags : array_slice(func_get_args(), 1); - - foreach ($tags as $tag) { - if (! isset($this->tags[$tag])) { - $this->tags[$tag] = []; - } - - foreach ((array) $abstracts as $abstract) { - $this->tags[$tag][] = $abstract; - } - } - } - - /** - * Resolve all of the bindings for a given tag. - * - * @param string $tag - * @return iterable - */ - public function tagged($tag) - { - if (! isset($this->tags[$tag])) { - return []; - } - - return new RewindableGenerator(function () use ($tag) { - foreach ($this->tags[$tag] as $abstract) { - yield $this->make($abstract); - } - }, count($this->tags[$tag])); - } - - /** - * Alias a type to a different name. - * - * @param string $abstract - * @param string $alias - * @return void - * - * @throws \LogicException - */ - public function alias($abstract, $alias) - { - if ($alias === $abstract) { - throw new LogicException("[{$abstract}] is aliased to itself."); - } - - $this->aliases[$alias] = $abstract; - - $this->abstractAliases[$abstract][] = $alias; - } - - /** - * Bind a new callback to an abstract's rebind event. - * - * @param string $abstract - * @param \Closure $callback - * @return mixed - */ - public function rebinding($abstract, Closure $callback) - { - $this->reboundCallbacks[$abstract = $this->getAlias($abstract)][] = $callback; - - if ($this->bound($abstract)) { - return $this->make($abstract); - } - } - - /** - * Refresh an instance on the given target and method. - * - * @param string $abstract - * @param mixed $target - * @param string $method - * @return mixed - */ - public function refresh($abstract, $target, $method) - { - return $this->rebinding($abstract, function ($app, $instance) use ($target, $method) { - $target->{$method}($instance); - }); - } - - /** - * Fire the "rebound" callbacks for the given abstract type. - * - * @param string $abstract - * @return void - */ - protected function rebound($abstract) - { - $instance = $this->make($abstract); - - foreach ($this->getReboundCallbacks($abstract) as $callback) { - $callback($this, $instance); - } - } - - /** - * Get the rebound callbacks for a given type. - * - * @param string $abstract - * @return array - */ - protected function getReboundCallbacks($abstract) - { - return $this->reboundCallbacks[$abstract] ?? []; - } - - /** - * Wrap the given closure such that its dependencies will be injected when executed. - * - * @param \Closure $callback - * @param array $parameters - * @return \Closure - */ - public function wrap(Closure $callback, array $parameters = []) - { - return function () use ($callback, $parameters) { - return $this->call($callback, $parameters); - }; - } - - /** - * Call the given Closure / class@method and inject its dependencies. - * - * @param callable|string $callback - * @param array $parameters - * @param string|null $defaultMethod - * @return mixed - * - * @throws \InvalidArgumentException - */ - public function call($callback, array $parameters = [], $defaultMethod = null) - { - return BoundMethod::call($this, $callback, $parameters, $defaultMethod); - } - - /** - * Get a closure to resolve the given type from the container. - * - * @param string $abstract - * @return \Closure - */ - public function factory($abstract) - { - return function () use ($abstract) { - return $this->make($abstract); - }; - } - - /** - * An alias function name for make(). - * - * @param string|callable $abstract - * @param array $parameters - * @return mixed - * - * @throws \Illuminate\Contracts\Container\BindingResolutionException - */ - public function makeWith($abstract, array $parameters = []) - { - return $this->make($abstract, $parameters); - } - - /** - * Resolve the given type from the container. - * - * @param string|callable $abstract - * @param array $parameters - * @return mixed - * - * @throws \Illuminate\Contracts\Container\BindingResolutionException - */ - public function make($abstract, array $parameters = []) - { - return $this->resolve($abstract, $parameters); - } - - /** - * {@inheritdoc} - * - * @return mixed - */ - public function get(string $id) - { - try { - return $this->resolve($id); - } catch (Exception $e) { - if ($this->has($id) || $e instanceof CircularDependencyException) { - throw $e; - } - - throw new EntryNotFoundException($id, is_int($e->getCode()) ? $e->getCode() : 0, $e); - } - } - - /** - * Resolve the given type from the container. - * - * @param string|callable $abstract - * @param array $parameters - * @param bool $raiseEvents - * @return mixed - * - * @throws \Illuminate\Contracts\Container\BindingResolutionException - * @throws \Illuminate\Contracts\Container\CircularDependencyException - */ - protected function resolve($abstract, $parameters = [], $raiseEvents = true) - { - $abstract = $this->getAlias($abstract); - - // First we'll fire any event handlers which handle the "before" resolving of - // specific types. This gives some hooks the chance to add various extends - // calls to change the resolution of objects that they're interested in. - if ($raiseEvents) { - $this->fireBeforeResolvingCallbacks($abstract, $parameters); - } - - $concrete = $this->getContextualConcrete($abstract); - - $needsContextualBuild = ! empty($parameters) || ! is_null($concrete); - - // If an instance of the type is currently being managed as a singleton we'll - // just return an existing instance instead of instantiating new instances - // so the developer can keep using the same objects instance every time. - if (isset($this->instances[$abstract]) && ! $needsContextualBuild) { - return $this->instances[$abstract]; - } - - $this->with[] = $parameters; - - if (is_null($concrete)) { - $concrete = $this->getConcrete($abstract); - } - - // We're ready to instantiate an instance of the concrete type registered for - // the binding. This will instantiate the types, as well as resolve any of - // its "nested" dependencies recursively until all have gotten resolved. - if ($this->isBuildable($concrete, $abstract)) { - $object = $this->build($concrete); - } else { - $object = $this->make($concrete); - } - - // If we defined any extenders for this type, we'll need to spin through them - // and apply them to the object being built. This allows for the extension - // of services, such as changing configuration or decorating the object. - foreach ($this->getExtenders($abstract) as $extender) { - $object = $extender($object, $this); - } - - // If the requested type is registered as a singleton we'll want to cache off - // the instances in "memory" so we can return it later without creating an - // entirely new instance of an object on each subsequent request for it. - if ($this->isShared($abstract) && ! $needsContextualBuild) { - $this->instances[$abstract] = $object; - } - - if ($raiseEvents) { - $this->fireResolvingCallbacks($abstract, $object); - } - - // Before returning, we will also set the resolved flag to "true" and pop off - // the parameter overrides for this build. After those two things are done - // we will be ready to return back the fully constructed class instance. - $this->resolved[$abstract] = true; - - array_pop($this->with); - - return $object; - } - - /** - * Get the concrete type for a given abstract. - * - * @param string|callable $abstract - * @return mixed - */ - protected function getConcrete($abstract) - { - // If we don't have a registered resolver or concrete for the type, we'll just - // assume each type is a concrete name and will attempt to resolve it as is - // since the container should be able to resolve concretes automatically. - if (isset($this->bindings[$abstract])) { - return $this->bindings[$abstract]['concrete']; - } - - return $abstract; - } - - /** - * Get the contextual concrete binding for the given abstract. - * - * @param string|callable $abstract - * @return \Closure|string|array|null - */ - protected function getContextualConcrete($abstract) - { - if (! is_null($binding = $this->findInContextualBindings($abstract))) { - return $binding; - } - - // Next we need to see if a contextual binding might be bound under an alias of the - // given abstract type. So, we will need to check if any aliases exist with this - // type and then spin through them and check for contextual bindings on these. - if (empty($this->abstractAliases[$abstract])) { - return; - } - - foreach ($this->abstractAliases[$abstract] as $alias) { - if (! is_null($binding = $this->findInContextualBindings($alias))) { - return $binding; - } - } - } - - /** - * Find the concrete binding for the given abstract in the contextual binding array. - * - * @param string|callable $abstract - * @return \Closure|string|null - */ - protected function findInContextualBindings($abstract) - { - return $this->contextual[end($this->buildStack)][$abstract] ?? null; - } - - /** - * Determine if the given concrete is buildable. - * - * @param mixed $concrete - * @param string $abstract - * @return bool - */ - protected function isBuildable($concrete, $abstract) - { - return $concrete === $abstract || $concrete instanceof Closure; - } - - /** - * Instantiate a concrete instance of the given type. - * - * @param \Closure|string $concrete - * @return mixed - * - * @throws \Illuminate\Contracts\Container\BindingResolutionException - * @throws \Illuminate\Contracts\Container\CircularDependencyException - */ - public function build($concrete) - { - // If the concrete type is actually a Closure, we will just execute it and - // hand back the results of the functions, which allows functions to be - // used as resolvers for more fine-tuned resolution of these objects. - if ($concrete instanceof Closure) { - return $concrete($this, $this->getLastParameterOverride()); - } - - try { - $reflector = new ReflectionClass($concrete); - } catch (ReflectionException $e) { - throw new BindingResolutionException("Target class [$concrete] does not exist.", 0, $e); - } - - // If the type is not instantiable, the developer is attempting to resolve - // an abstract type such as an Interface or Abstract Class and there is - // no binding registered for the abstractions so we need to bail out. - if (! $reflector->isInstantiable()) { - return $this->notInstantiable($concrete); - } - - $this->buildStack[] = $concrete; - - $constructor = $reflector->getConstructor(); - - // If there are no constructors, that means there are no dependencies then - // we can just resolve the instances of the objects right away, without - // resolving any other types or dependencies out of these containers. - if (is_null($constructor)) { - array_pop($this->buildStack); - - return new $concrete; - } - - $dependencies = $constructor->getParameters(); - - // Once we have all the constructor's parameters we can create each of the - // dependency instances and then use the reflection instances to make a - // new instance of this class, injecting the created dependencies in. - try { - $instances = $this->resolveDependencies($dependencies); - } catch (BindingResolutionException $e) { - array_pop($this->buildStack); - - throw $e; - } - - array_pop($this->buildStack); - - return $reflector->newInstanceArgs($instances); - } - - /** - * Resolve all of the dependencies from the ReflectionParameters. - * - * @param \ReflectionParameter[] $dependencies - * @return array - * - * @throws \Illuminate\Contracts\Container\BindingResolutionException - */ - protected function resolveDependencies(array $dependencies) - { - $results = []; - - foreach ($dependencies as $dependency) { - // If the dependency has an override for this particular build we will use - // that instead as the value. Otherwise, we will continue with this run - // of resolutions and let reflection attempt to determine the result. - if ($this->hasParameterOverride($dependency)) { - $results[] = $this->getParameterOverride($dependency); - - continue; - } - - // If the class is null, it means the dependency is a string or some other - // primitive type which we can not resolve since it is not a class and - // we will just bomb out with an error since we have no-where to go. - $result = is_null(Util::getParameterClassName($dependency)) - ? $this->resolvePrimitive($dependency) - : $this->resolveClass($dependency); - - if ($dependency->isVariadic()) { - $results = array_merge($results, $result); - } else { - $results[] = $result; - } - } - - return $results; - } - - /** - * Determine if the given dependency has a parameter override. - * - * @param \ReflectionParameter $dependency - * @return bool - */ - protected function hasParameterOverride($dependency) - { - return array_key_exists( - $dependency->name, $this->getLastParameterOverride() - ); - } - - /** - * Get a parameter override for a dependency. - * - * @param \ReflectionParameter $dependency - * @return mixed - */ - protected function getParameterOverride($dependency) - { - return $this->getLastParameterOverride()[$dependency->name]; - } - - /** - * Get the last parameter override. - * - * @return array - */ - protected function getLastParameterOverride() - { - return count($this->with) ? end($this->with) : []; - } - - /** - * Resolve a non-class hinted primitive dependency. - * - * @param \ReflectionParameter $parameter - * @return mixed - * - * @throws \Illuminate\Contracts\Container\BindingResolutionException - */ - protected function resolvePrimitive(ReflectionParameter $parameter) - { - if (! is_null($concrete = $this->getContextualConcrete('$'.$parameter->getName()))) { - return Util::unwrapIfClosure($concrete, $this); - } - - if ($parameter->isDefaultValueAvailable()) { - return $parameter->getDefaultValue(); - } - - if ($parameter->isVariadic()) { - return []; - } - - $this->unresolvablePrimitive($parameter); - } - - /** - * Resolve a class based dependency from the container. - * - * @param \ReflectionParameter $parameter - * @return mixed - * - * @throws \Illuminate\Contracts\Container\BindingResolutionException - */ - protected function resolveClass(ReflectionParameter $parameter) - { - try { - return $parameter->isVariadic() - ? $this->resolveVariadicClass($parameter) - : $this->make(Util::getParameterClassName($parameter)); - } - - // If we can not resolve the class instance, we will check to see if the value - // is optional, and if it is we will return the optional parameter value as - // the value of the dependency, similarly to how we do this with scalars. - catch (BindingResolutionException $e) { - if ($parameter->isDefaultValueAvailable()) { - array_pop($this->with); - - return $parameter->getDefaultValue(); - } - - if ($parameter->isVariadic()) { - array_pop($this->with); - - return []; - } - - throw $e; - } - } - - /** - * Resolve a class based variadic dependency from the container. - * - * @param \ReflectionParameter $parameter - * @return mixed - */ - protected function resolveVariadicClass(ReflectionParameter $parameter) - { - $className = Util::getParameterClassName($parameter); - - $abstract = $this->getAlias($className); - - if (! is_array($concrete = $this->getContextualConcrete($abstract))) { - return $this->make($className); - } - - return array_map(function ($abstract) { - return $this->resolve($abstract); - }, $concrete); - } - - /** - * Throw an exception that the concrete is not instantiable. - * - * @param string $concrete - * @return void - * - * @throws \Illuminate\Contracts\Container\BindingResolutionException - */ - protected function notInstantiable($concrete) - { - if (! empty($this->buildStack)) { - $previous = implode(', ', $this->buildStack); - - $message = "Target [$concrete] is not instantiable while building [$previous]."; - } else { - $message = "Target [$concrete] is not instantiable."; - } - - throw new BindingResolutionException($message); - } - - /** - * Throw an exception for an unresolvable primitive. - * - * @param \ReflectionParameter $parameter - * @return void - * - * @throws \Illuminate\Contracts\Container\BindingResolutionException - */ - protected function unresolvablePrimitive(ReflectionParameter $parameter) - { - $message = "Unresolvable dependency resolving [$parameter] in class {$parameter->getDeclaringClass()->getName()}"; - - throw new BindingResolutionException($message); - } - - /** - * Register a new before resolving callback for all types. - * - * @param \Closure|string $abstract - * @param \Closure|null $callback - * @return void - */ - public function beforeResolving($abstract, Closure $callback = null) - { - if (is_string($abstract)) { - $abstract = $this->getAlias($abstract); - } - - if ($abstract instanceof Closure && is_null($callback)) { - $this->globalBeforeResolvingCallbacks[] = $abstract; - } else { - $this->beforeResolvingCallbacks[$abstract][] = $callback; - } - } - - /** - * Register a new resolving callback. - * - * @param \Closure|string $abstract - * @param \Closure|null $callback - * @return void - */ - public function resolving($abstract, Closure $callback = null) - { - if (is_string($abstract)) { - $abstract = $this->getAlias($abstract); - } - - if (is_null($callback) && $abstract instanceof Closure) { - $this->globalResolvingCallbacks[] = $abstract; - } else { - $this->resolvingCallbacks[$abstract][] = $callback; - } - } - - /** - * Register a new after resolving callback for all types. - * - * @param \Closure|string $abstract - * @param \Closure|null $callback - * @return void - */ - public function afterResolving($abstract, Closure $callback = null) - { - if (is_string($abstract)) { - $abstract = $this->getAlias($abstract); - } - - if ($abstract instanceof Closure && is_null($callback)) { - $this->globalAfterResolvingCallbacks[] = $abstract; - } else { - $this->afterResolvingCallbacks[$abstract][] = $callback; - } - } - - /** - * Fire all of the before resolving callbacks. - * - * @param string $abstract - * @param array $parameters - * @return void - */ - protected function fireBeforeResolvingCallbacks($abstract, $parameters = []) - { - $this->fireBeforeCallbackArray($abstract, $parameters, $this->globalBeforeResolvingCallbacks); - - foreach ($this->beforeResolvingCallbacks as $type => $callbacks) { - if ($type === $abstract || is_subclass_of($abstract, $type)) { - $this->fireBeforeCallbackArray($abstract, $parameters, $callbacks); - } - } - } - - /** - * Fire an array of callbacks with an object. - * - * @param string $abstract - * @param array $parameters - * @param array $callbacks - * @return void - */ - protected function fireBeforeCallbackArray($abstract, $parameters, array $callbacks) - { - foreach ($callbacks as $callback) { - $callback($abstract, $parameters, $this); - } - } - - /** - * Fire all of the resolving callbacks. - * - * @param string $abstract - * @param mixed $object - * @return void - */ - protected function fireResolvingCallbacks($abstract, $object) - { - $this->fireCallbackArray($object, $this->globalResolvingCallbacks); - - $this->fireCallbackArray( - $object, $this->getCallbacksForType($abstract, $object, $this->resolvingCallbacks) - ); - - $this->fireAfterResolvingCallbacks($abstract, $object); - } - - /** - * Fire all of the after resolving callbacks. - * - * @param string $abstract - * @param mixed $object - * @return void - */ - protected function fireAfterResolvingCallbacks($abstract, $object) - { - $this->fireCallbackArray($object, $this->globalAfterResolvingCallbacks); - - $this->fireCallbackArray( - $object, $this->getCallbacksForType($abstract, $object, $this->afterResolvingCallbacks) - ); - } - - /** - * Get all callbacks for a given type. - * - * @param string $abstract - * @param object $object - * @param array $callbacksPerType - * @return array - */ - protected function getCallbacksForType($abstract, $object, array $callbacksPerType) - { - $results = []; - - foreach ($callbacksPerType as $type => $callbacks) { - if ($type === $abstract || $object instanceof $type) { - $results = array_merge($results, $callbacks); - } - } - - return $results; - } - - /** - * Fire an array of callbacks with an object. - * - * @param mixed $object - * @param array $callbacks - * @return void - */ - protected function fireCallbackArray($object, array $callbacks) - { - foreach ($callbacks as $callback) { - $callback($object, $this); - } - } - - /** - * Get the container's bindings. - * - * @return array - */ - public function getBindings() - { - return $this->bindings; - } - - /** - * Get the alias for an abstract if available. - * - * @param string $abstract - * @return string - */ - public function getAlias($abstract) - { - return isset($this->aliases[$abstract]) - ? $this->getAlias($this->aliases[$abstract]) - : $abstract; - } - - /** - * Get the extender callbacks for a given type. - * - * @param string $abstract - * @return array - */ - protected function getExtenders($abstract) - { - return $this->extenders[$this->getAlias($abstract)] ?? []; - } - - /** - * Remove all of the extender callbacks for a given type. - * - * @param string $abstract - * @return void - */ - public function forgetExtenders($abstract) - { - unset($this->extenders[$this->getAlias($abstract)]); - } - - /** - * Drop all of the stale instances and aliases. - * - * @param string $abstract - * @return void - */ - protected function dropStaleInstances($abstract) - { - unset($this->instances[$abstract], $this->aliases[$abstract]); - } - - /** - * Remove a resolved instance from the instance cache. - * - * @param string $abstract - * @return void - */ - public function forgetInstance($abstract) - { - unset($this->instances[$abstract]); - } - - /** - * Clear all of the instances from the container. - * - * @return void - */ - public function forgetInstances() - { - $this->instances = []; - } - - /** - * Clear all of the scoped instances from the container. - * - * @return void - */ - public function forgetScopedInstances() - { - foreach ($this->scopedInstances as $scoped) { - unset($this->instances[$scoped]); - } - } - - /** - * Flush the container of all bindings and resolved instances. - * - * @return void - */ - public function flush() - { - $this->aliases = []; - $this->resolved = []; - $this->bindings = []; - $this->instances = []; - $this->abstractAliases = []; - $this->scopedInstances = []; - } - - /** - * Get the globally available instance of the container. - * - * @return static - */ - public static function getInstance() - { - if (is_null(static::$instance)) { - static::$instance = new static; - } - - return static::$instance; - } - - /** - * Set the shared instance of the container. - * - * @param \Illuminate\Contracts\Container\Container|null $container - * @return \Illuminate\Contracts\Container\Container|static - */ - public static function setInstance(ContainerContract $container = null) - { - return static::$instance = $container; - } - - /** - * Determine if a given offset exists. - * - * @param string $key - * @return bool - */ - public function offsetExists($key): bool - { - return $this->bound($key); - } - - /** - * Get the value at a given offset. - * - * @param string $key - * @return mixed - */ - public function offsetGet($key): mixed - { - return $this->make($key); - } - - /** - * Set the value at a given offset. - * - * @param string $key - * @param mixed $value - * @return void - */ - public function offsetSet($key, $value): void - { - $this->bind($key, $value instanceof Closure ? $value : function () use ($value) { - return $value; - }); - } - - /** - * Unset the value at a given offset. - * - * @param string $key - * @return void - */ - public function offsetUnset($key): void - { - unset($this->bindings[$key], $this->instances[$key], $this->resolved[$key]); - } - - /** - * Dynamically access container services. - * - * @param string $key - * @return mixed - */ - public function __get($key) - { - return $this[$key]; - } - - /** - * Dynamically set container services. - * - * @param string $key - * @param mixed $value - * @return void - */ - public function __set($key, $value) - { - $this[$key] = $value; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Container/ContextualBindingBuilder.php b/vendor/laravel/framework/src/Illuminate/Container/ContextualBindingBuilder.php deleted file mode 100644 index 707b74c7..00000000 --- a/vendor/laravel/framework/src/Illuminate/Container/ContextualBindingBuilder.php +++ /dev/null @@ -1,96 +0,0 @@ -concrete = $concrete; - $this->container = $container; - } - - /** - * Define the abstract target that depends on the context. - * - * @param string $abstract - * @return $this - */ - public function needs($abstract) - { - $this->needs = $abstract; - - return $this; - } - - /** - * Define the implementation for the contextual binding. - * - * @param \Closure|string|array $implementation - * @return void - */ - public function give($implementation) - { - foreach (Util::arrayWrap($this->concrete) as $concrete) { - $this->container->addContextualBinding($concrete, $this->needs, $implementation); - } - } - - /** - * Define tagged services to be used as the implementation for the contextual binding. - * - * @param string $tag - * @return void - */ - public function giveTagged($tag) - { - $this->give(function ($container) use ($tag) { - $taggedServices = $container->tagged($tag); - - return is_array($taggedServices) ? $taggedServices : iterator_to_array($taggedServices); - }); - } - - /** - * Specify the configuration item to bind as a primitive. - * - * @param string $key - * @param mixed $default - * @return void - */ - public function giveConfig($key, $default = null) - { - $this->give(fn ($container) => $container->get('config')->get($key, $default)); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Container/EntryNotFoundException.php b/vendor/laravel/framework/src/Illuminate/Container/EntryNotFoundException.php deleted file mode 100644 index 42669214..00000000 --- a/vendor/laravel/framework/src/Illuminate/Container/EntryNotFoundException.php +++ /dev/null @@ -1,11 +0,0 @@ -count = $count; - $this->generator = $generator; - } - - /** - * Get an iterator from the generator. - * - * @return \Traversable - */ - public function getIterator(): Traversable - { - return ($this->generator)(); - } - - /** - * Get the total number of tagged services. - * - * @return int - */ - public function count(): int - { - if (is_callable($count = $this->count)) { - $this->count = $count(); - } - - return $this->count; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Container/Util.php b/vendor/laravel/framework/src/Illuminate/Container/Util.php deleted file mode 100644 index 8d5023b4..00000000 --- a/vendor/laravel/framework/src/Illuminate/Container/Util.php +++ /dev/null @@ -1,74 +0,0 @@ -getType(); - - if (! $type instanceof ReflectionNamedType || $type->isBuiltin()) { - return null; - } - - $name = $type->getName(); - - if (! is_null($class = $parameter->getDeclaringClass())) { - if ($name === 'self') { - return $class->getName(); - } - - if ($name === 'parent' && $parent = $class->getParentClass()) { - return $parent->getName(); - } - } - - return $name; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Container/composer.json b/vendor/laravel/framework/src/Illuminate/Container/composer.json deleted file mode 100755 index 8944b5bc..00000000 --- a/vendor/laravel/framework/src/Illuminate/Container/composer.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "illuminate/container", - "description": "The Illuminate Container package.", - "license": "MIT", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "require": { - "php": "^8.0.2", - "illuminate/contracts": "^9.0", - "psr/container": "^1.1.1|^2.0.1" - }, - "provide": { - "psr/container-implementation": "1.1|2.0" - }, - "autoload": { - "psr-4": { - "Illuminate\\Container\\": "" - } - }, - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev" -} diff --git a/vendor/laravel/framework/src/Illuminate/Contracts/Auth/Access/Authorizable.php b/vendor/laravel/framework/src/Illuminate/Contracts/Auth/Access/Authorizable.php deleted file mode 100644 index cedeb6ea..00000000 --- a/vendor/laravel/framework/src/Illuminate/Contracts/Auth/Access/Authorizable.php +++ /dev/null @@ -1,15 +0,0 @@ -id = $id; - $this->class = $class; - $this->relations = $relations; - $this->connection = $connection; - } - - /** - * Specify the collection class that should be used when serializing / restoring collections. - * - * @param string|null $collectionClass - * @return $this - */ - public function useCollectionClass(?string $collectionClass) - { - $this->collectionClass = $collectionClass; - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Contracts/Database/Query/Builder.php b/vendor/laravel/framework/src/Illuminate/Contracts/Database/Query/Builder.php deleted file mode 100644 index e116ebf4..00000000 --- a/vendor/laravel/framework/src/Illuminate/Contracts/Database/Query/Builder.php +++ /dev/null @@ -1,12 +0,0 @@ - - */ - public function getQueueableIds(); - - /** - * Get the relationships of the entities being queued. - * - * @return array - */ - public function getQueueableRelations(); - - /** - * Get the connection of the entities being queued. - * - * @return string|null - */ - public function getQueueableConnection(); -} diff --git a/vendor/laravel/framework/src/Illuminate/Contracts/Queue/QueueableEntity.php b/vendor/laravel/framework/src/Illuminate/Contracts/Queue/QueueableEntity.php deleted file mode 100644 index 366f0c84..00000000 --- a/vendor/laravel/framework/src/Illuminate/Contracts/Queue/QueueableEntity.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - public function toArray(); -} diff --git a/vendor/laravel/framework/src/Illuminate/Contracts/Support/CanBeEscapedWhenCastToString.php b/vendor/laravel/framework/src/Illuminate/Contracts/Support/CanBeEscapedWhenCastToString.php deleted file mode 100644 index e1be6fef..00000000 --- a/vendor/laravel/framework/src/Illuminate/Contracts/Support/CanBeEscapedWhenCastToString.php +++ /dev/null @@ -1,14 +0,0 @@ -getPathAndDomain($path, $domain, $secure, $sameSite); - - $time = ($minutes == 0) ? 0 : $this->availableAt($minutes * 60); - - return new Cookie($name, $value, $time, $path, $domain, $secure, $httpOnly, $raw, $sameSite); - } - - /** - * Create a cookie that lasts "forever" (400 days). - * - * @param string $name - * @param string $value - * @param string|null $path - * @param string|null $domain - * @param bool|null $secure - * @param bool $httpOnly - * @param bool $raw - * @param string|null $sameSite - * @return \Symfony\Component\HttpFoundation\Cookie - */ - public function forever($name, $value, $path = null, $domain = null, $secure = null, $httpOnly = true, $raw = false, $sameSite = null) - { - return $this->make($name, $value, 576000, $path, $domain, $secure, $httpOnly, $raw, $sameSite); - } - - /** - * Expire the given cookie. - * - * @param string $name - * @param string|null $path - * @param string|null $domain - * @return \Symfony\Component\HttpFoundation\Cookie - */ - public function forget($name, $path = null, $domain = null) - { - return $this->make($name, null, -2628000, $path, $domain); - } - - /** - * Determine if a cookie has been queued. - * - * @param string $key - * @param string|null $path - * @return bool - */ - public function hasQueued($key, $path = null) - { - return ! is_null($this->queued($key, null, $path)); - } - - /** - * Get a queued cookie instance. - * - * @param string $key - * @param mixed $default - * @param string|null $path - * @return \Symfony\Component\HttpFoundation\Cookie|null - */ - public function queued($key, $default = null, $path = null) - { - $queued = Arr::get($this->queued, $key, $default); - - if ($path === null) { - return Arr::last($queued, null, $default); - } - - return Arr::get($queued, $path, $default); - } - - /** - * Queue a cookie to send with the next response. - * - * @param array $parameters - * @return void - */ - public function queue(...$parameters) - { - if (isset($parameters[0]) && $parameters[0] instanceof Cookie) { - $cookie = $parameters[0]; - } else { - $cookie = $this->make(...array_values($parameters)); - } - - if (! isset($this->queued[$cookie->getName()])) { - $this->queued[$cookie->getName()] = []; - } - - $this->queued[$cookie->getName()][$cookie->getPath()] = $cookie; - } - - /** - * Queue a cookie to expire with the next response. - * - * @param string $name - * @param string|null $path - * @param string|null $domain - * @return void - */ - public function expire($name, $path = null, $domain = null) - { - $this->queue($this->forget($name, $path, $domain)); - } - - /** - * Remove a cookie from the queue. - * - * @param string $name - * @param string|null $path - * @return void - */ - public function unqueue($name, $path = null) - { - if ($path === null) { - unset($this->queued[$name]); - - return; - } - - unset($this->queued[$name][$path]); - - if (empty($this->queued[$name])) { - unset($this->queued[$name]); - } - } - - /** - * Get the path and domain, or the default values. - * - * @param string $path - * @param string $domain - * @param bool|null $secure - * @param string|null $sameSite - * @return array - */ - protected function getPathAndDomain($path, $domain, $secure = null, $sameSite = null) - { - return [$path ?: $this->path, $domain ?: $this->domain, is_bool($secure) ? $secure : $this->secure, $sameSite ?: $this->sameSite]; - } - - /** - * Set the default path and domain for the jar. - * - * @param string $path - * @param string $domain - * @param bool $secure - * @param string|null $sameSite - * @return $this - */ - public function setDefaultPathAndDomain($path, $domain, $secure = false, $sameSite = null) - { - [$this->path, $this->domain, $this->secure, $this->sameSite] = [$path, $domain, $secure, $sameSite]; - - return $this; - } - - /** - * Get the cookies which have been queued for the next request. - * - * @return \Symfony\Component\HttpFoundation\Cookie[] - */ - public function getQueuedCookies() - { - return Arr::flatten($this->queued); - } - - /** - * Flush the cookies which have been queued for the next request. - * - * @return $this - */ - public function flushQueuedCookies() - { - $this->queued = []; - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cookie/CookieServiceProvider.php b/vendor/laravel/framework/src/Illuminate/Cookie/CookieServiceProvider.php deleted file mode 100755 index 7c82dc14..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cookie/CookieServiceProvider.php +++ /dev/null @@ -1,24 +0,0 @@ -app->singleton('cookie', function ($app) { - $config = $app->make('config')->get('session'); - - return (new CookieJar)->setDefaultPathAndDomain( - $config['path'], $config['domain'], $config['secure'], $config['same_site'] ?? null - ); - }); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cookie/CookieValuePrefix.php b/vendor/laravel/framework/src/Illuminate/Cookie/CookieValuePrefix.php deleted file mode 100644 index 3f4eb22e..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cookie/CookieValuePrefix.php +++ /dev/null @@ -1,44 +0,0 @@ -cookies = $cookies; - } - - /** - * Handle an incoming request. - * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @return mixed - */ - public function handle($request, Closure $next) - { - $response = $next($request); - - foreach ($this->cookies->getQueuedCookies() as $cookie) { - $response->headers->setCookie($cookie); - } - - return $response; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php b/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php deleted file mode 100644 index 4d6c626e..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php +++ /dev/null @@ -1,226 +0,0 @@ -encrypter = $encrypter; - } - - /** - * Disable encryption for the given cookie name(s). - * - * @param string|array $name - * @return void - */ - public function disableFor($name) - { - $this->except = array_merge($this->except, (array) $name); - } - - /** - * Handle an incoming request. - * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @return \Symfony\Component\HttpFoundation\Response - */ - public function handle($request, Closure $next) - { - return $this->encrypt($next($this->decrypt($request))); - } - - /** - * Decrypt the cookies on the request. - * - * @param \Symfony\Component\HttpFoundation\Request $request - * @return \Symfony\Component\HttpFoundation\Request - */ - protected function decrypt(Request $request) - { - foreach ($request->cookies as $key => $cookie) { - if ($this->isDisabled($key)) { - continue; - } - - try { - $value = $this->decryptCookie($key, $cookie); - - $request->cookies->set($key, $this->validateValue($key, $value)); - } catch (DecryptException $e) { - $request->cookies->set($key, null); - } - } - - return $request; - } - - /** - * Validate and remove the cookie value prefix from the value. - * - * @param string $key - * @param string $value - * @return string|array|null - */ - protected function validateValue(string $key, $value) - { - return is_array($value) - ? $this->validateArray($key, $value) - : CookieValuePrefix::validate($key, $value, $this->encrypter->getKey()); - } - - /** - * Validate and remove the cookie value prefix from all values of an array. - * - * @param string $key - * @param array $value - * @return array - */ - protected function validateArray(string $key, array $value) - { - $validated = []; - - foreach ($value as $index => $subValue) { - $validated[$index] = $this->validateValue("{$key}[{$index}]", $subValue); - } - - return $validated; - } - - /** - * Decrypt the given cookie and return the value. - * - * @param string $name - * @param string|array $cookie - * @return string|array - */ - protected function decryptCookie($name, $cookie) - { - return is_array($cookie) - ? $this->decryptArray($cookie) - : $this->encrypter->decrypt($cookie, static::serialized($name)); - } - - /** - * Decrypt an array based cookie. - * - * @param array $cookie - * @return array - */ - protected function decryptArray(array $cookie) - { - $decrypted = []; - - foreach ($cookie as $key => $value) { - if (is_string($value)) { - $decrypted[$key] = $this->encrypter->decrypt($value, static::serialized($key)); - } - - if (is_array($value)) { - $decrypted[$key] = $this->decryptArray($value); - } - } - - return $decrypted; - } - - /** - * Encrypt the cookies on an outgoing response. - * - * @param \Symfony\Component\HttpFoundation\Response $response - * @return \Symfony\Component\HttpFoundation\Response - */ - protected function encrypt(Response $response) - { - foreach ($response->headers->getCookies() as $cookie) { - if ($this->isDisabled($cookie->getName())) { - continue; - } - - $response->headers->setCookie($this->duplicate( - $cookie, - $this->encrypter->encrypt( - CookieValuePrefix::create($cookie->getName(), $this->encrypter->getKey()).$cookie->getValue(), - static::serialized($cookie->getName()) - ) - )); - } - - return $response; - } - - /** - * Duplicate a cookie with a new value. - * - * @param \Symfony\Component\HttpFoundation\Cookie $cookie - * @param mixed $value - * @return \Symfony\Component\HttpFoundation\Cookie - */ - protected function duplicate(Cookie $cookie, $value) - { - return new Cookie( - $cookie->getName(), $value, $cookie->getExpiresTime(), - $cookie->getPath(), $cookie->getDomain(), $cookie->isSecure(), - $cookie->isHttpOnly(), $cookie->isRaw(), $cookie->getSameSite() - ); - } - - /** - * Determine whether encryption has been disabled for the given cookie. - * - * @param string $name - * @return bool - */ - public function isDisabled($name) - { - return in_array($name, $this->except); - } - - /** - * Determine if the cookie contents should be serialized. - * - * @param string $name - * @return bool - */ - public static function serialized($name) - { - return static::$serialize; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Cookie/composer.json b/vendor/laravel/framework/src/Illuminate/Cookie/composer.json deleted file mode 100755 index a7a444cc..00000000 --- a/vendor/laravel/framework/src/Illuminate/Cookie/composer.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "illuminate/cookie", - "description": "The Illuminate Cookie package.", - "license": "MIT", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "require": { - "php": "^8.0.2", - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0", - "symfony/http-foundation": "^6.0", - "symfony/http-kernel": "^6.0" - }, - "autoload": { - "psr-4": { - "Illuminate\\Cookie\\": "" - } - }, - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev" -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Capsule/Manager.php b/vendor/laravel/framework/src/Illuminate/Database/Capsule/Manager.php deleted file mode 100755 index b877e7c6..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Capsule/Manager.php +++ /dev/null @@ -1,202 +0,0 @@ -setupContainer($container ?: new Container); - - // Once we have the container setup, we will setup the default configuration - // options in the container "config" binding. This will make the database - // manager work correctly out of the box without extreme configuration. - $this->setupDefaultConfiguration(); - - $this->setupManager(); - } - - /** - * Setup the default database configuration options. - * - * @return void - */ - protected function setupDefaultConfiguration() - { - $this->container['config']['database.fetch'] = PDO::FETCH_OBJ; - - $this->container['config']['database.default'] = 'default'; - } - - /** - * Build the database manager instance. - * - * @return void - */ - protected function setupManager() - { - $factory = new ConnectionFactory($this->container); - - $this->manager = new DatabaseManager($this->container, $factory); - } - - /** - * Get a connection instance from the global manager. - * - * @param string|null $connection - * @return \Illuminate\Database\Connection - */ - public static function connection($connection = null) - { - return static::$instance->getConnection($connection); - } - - /** - * Get a fluent query builder instance. - * - * @param \Closure|\Illuminate\Database\Query\Builder|string $table - * @param string|null $as - * @param string|null $connection - * @return \Illuminate\Database\Query\Builder - */ - public static function table($table, $as = null, $connection = null) - { - return static::$instance->connection($connection)->table($table, $as); - } - - /** - * Get a schema builder instance. - * - * @param string|null $connection - * @return \Illuminate\Database\Schema\Builder - */ - public static function schema($connection = null) - { - return static::$instance->connection($connection)->getSchemaBuilder(); - } - - /** - * Get a registered connection instance. - * - * @param string|null $name - * @return \Illuminate\Database\Connection - */ - public function getConnection($name = null) - { - return $this->manager->connection($name); - } - - /** - * Register a connection with the manager. - * - * @param array $config - * @param string $name - * @return void - */ - public function addConnection(array $config, $name = 'default') - { - $connections = $this->container['config']['database.connections']; - - $connections[$name] = $config; - - $this->container['config']['database.connections'] = $connections; - } - - /** - * Bootstrap Eloquent so it is ready for usage. - * - * @return void - */ - public function bootEloquent() - { - Eloquent::setConnectionResolver($this->manager); - - // If we have an event dispatcher instance, we will go ahead and register it - // with the Eloquent ORM, allowing for model callbacks while creating and - // updating "model" instances; however, it is not necessary to operate. - if ($dispatcher = $this->getEventDispatcher()) { - Eloquent::setEventDispatcher($dispatcher); - } - } - - /** - * Set the fetch mode for the database connections. - * - * @param int $fetchMode - * @return $this - */ - public function setFetchMode($fetchMode) - { - $this->container['config']['database.fetch'] = $fetchMode; - - return $this; - } - - /** - * Get the database manager instance. - * - * @return \Illuminate\Database\DatabaseManager - */ - public function getDatabaseManager() - { - return $this->manager; - } - - /** - * Get the current event dispatcher instance. - * - * @return \Illuminate\Contracts\Events\Dispatcher|null - */ - public function getEventDispatcher() - { - if ($this->container->bound('events')) { - return $this->container['events']; - } - } - - /** - * Set the event dispatcher instance to be used by connections. - * - * @param \Illuminate\Contracts\Events\Dispatcher $dispatcher - * @return void - */ - public function setEventDispatcher(Dispatcher $dispatcher) - { - $this->container->instance('events', $dispatcher); - } - - /** - * Dynamically pass methods to the default connection. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public static function __callStatic($method, $parameters) - { - return static::connection()->$method(...$parameters); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/ClassMorphViolationException.php b/vendor/laravel/framework/src/Illuminate/Database/ClassMorphViolationException.php deleted file mode 100644 index 6594d2d9..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/ClassMorphViolationException.php +++ /dev/null @@ -1,29 +0,0 @@ -model = $class; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Concerns/BuildsQueries.php b/vendor/laravel/framework/src/Illuminate/Database/Concerns/BuildsQueries.php deleted file mode 100644 index 16dc024f..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Concerns/BuildsQueries.php +++ /dev/null @@ -1,506 +0,0 @@ -enforceOrderBy(); - - $page = 1; - - do { - // We'll execute the query for the given page and get the results. If there are - // no results we can just break and return from here. When there are results - // we will call the callback with the current chunk of these results here. - $results = $this->forPage($page, $count)->get(); - - $countResults = $results->count(); - - if ($countResults == 0) { - break; - } - - // On each chunk result set, we will pass them to the callback and then let the - // developer take care of everything within the callback, which allows us to - // keep the memory low for spinning through large result sets for working. - if ($callback($results, $page) === false) { - return false; - } - - unset($results); - - $page++; - } while ($countResults == $count); - - return true; - } - - /** - * Run a map over each item while chunking. - * - * @param callable $callback - * @param int $count - * @return \Illuminate\Support\Collection - */ - public function chunkMap(callable $callback, $count = 1000) - { - $collection = Collection::make(); - - $this->chunk($count, function ($items) use ($collection, $callback) { - $items->each(function ($item) use ($collection, $callback) { - $collection->push($callback($item)); - }); - }); - - return $collection; - } - - /** - * Execute a callback over each item while chunking. - * - * @param callable $callback - * @param int $count - * @return bool - * - * @throws \RuntimeException - */ - public function each(callable $callback, $count = 1000) - { - return $this->chunk($count, function ($results) use ($callback) { - foreach ($results as $key => $value) { - if ($callback($value, $key) === false) { - return false; - } - } - }); - } - - /** - * Chunk the results of a query by comparing IDs. - * - * @param int $count - * @param callable $callback - * @param string|null $column - * @param string|null $alias - * @return bool - */ - public function chunkById($count, callable $callback, $column = null, $alias = null) - { - $column ??= $this->defaultKeyName(); - - $alias ??= $column; - - $lastId = null; - - $page = 1; - - do { - $clone = clone $this; - - // We'll execute the query for the given page and get the results. If there are - // no results we can just break and return from here. When there are results - // we will call the callback with the current chunk of these results here. - $results = $clone->forPageAfterId($count, $lastId, $column)->get(); - - $countResults = $results->count(); - - if ($countResults == 0) { - break; - } - - // On each chunk result set, we will pass them to the callback and then let the - // developer take care of everything within the callback, which allows us to - // keep the memory low for spinning through large result sets for working. - if ($callback($results, $page) === false) { - return false; - } - - $lastId = data_get($results->last(), $alias); - - if ($lastId === null) { - throw new RuntimeException("The chunkById operation was aborted because the [{$alias}] column is not present in the query result."); - } - - unset($results); - - $page++; - } while ($countResults == $count); - - return true; - } - - /** - * Execute a callback over each item while chunking by ID. - * - * @param callable $callback - * @param int $count - * @param string|null $column - * @param string|null $alias - * @return bool - */ - public function eachById(callable $callback, $count = 1000, $column = null, $alias = null) - { - return $this->chunkById($count, function ($results, $page) use ($callback, $count) { - foreach ($results as $key => $value) { - if ($callback($value, (($page - 1) * $count) + $key) === false) { - return false; - } - } - }, $column, $alias); - } - - /** - * Query lazily, by chunks of the given size. - * - * @param int $chunkSize - * @return \Illuminate\Support\LazyCollection - * - * @throws \InvalidArgumentException - */ - public function lazy($chunkSize = 1000) - { - if ($chunkSize < 1) { - throw new InvalidArgumentException('The chunk size should be at least 1'); - } - - $this->enforceOrderBy(); - - return LazyCollection::make(function () use ($chunkSize) { - $page = 1; - - while (true) { - $results = $this->forPage($page++, $chunkSize)->get(); - - foreach ($results as $result) { - yield $result; - } - - if ($results->count() < $chunkSize) { - return; - } - } - }); - } - - /** - * Query lazily, by chunking the results of a query by comparing IDs. - * - * @param int $chunkSize - * @param string|null $column - * @param string|null $alias - * @return \Illuminate\Support\LazyCollection - * - * @throws \InvalidArgumentException - */ - public function lazyById($chunkSize = 1000, $column = null, $alias = null) - { - return $this->orderedLazyById($chunkSize, $column, $alias); - } - - /** - * Query lazily, by chunking the results of a query by comparing IDs in descending order. - * - * @param int $chunkSize - * @param string|null $column - * @param string|null $alias - * @return \Illuminate\Support\LazyCollection - * - * @throws \InvalidArgumentException - */ - public function lazyByIdDesc($chunkSize = 1000, $column = null, $alias = null) - { - return $this->orderedLazyById($chunkSize, $column, $alias, true); - } - - /** - * Query lazily, by chunking the results of a query by comparing IDs in a given order. - * - * @param int $chunkSize - * @param string|null $column - * @param string|null $alias - * @param bool $descending - * @return \Illuminate\Support\LazyCollection - * - * @throws \InvalidArgumentException - */ - protected function orderedLazyById($chunkSize = 1000, $column = null, $alias = null, $descending = false) - { - if ($chunkSize < 1) { - throw new InvalidArgumentException('The chunk size should be at least 1'); - } - - $column ??= $this->defaultKeyName(); - - $alias ??= $column; - - return LazyCollection::make(function () use ($chunkSize, $column, $alias, $descending) { - $lastId = null; - - while (true) { - $clone = clone $this; - - if ($descending) { - $results = $clone->forPageBeforeId($chunkSize, $lastId, $column)->get(); - } else { - $results = $clone->forPageAfterId($chunkSize, $lastId, $column)->get(); - } - - foreach ($results as $result) { - yield $result; - } - - if ($results->count() < $chunkSize) { - return; - } - - $lastId = $results->last()->{$alias}; - } - }); - } - - /** - * Execute the query and get the first result. - * - * @param array|string $columns - * @return \Illuminate\Database\Eloquent\Model|object|static|null - */ - public function first($columns = ['*']) - { - return $this->take(1)->get($columns)->first(); - } - - /** - * Execute the query and get the first result if it's the sole matching record. - * - * @param array|string $columns - * @return \Illuminate\Database\Eloquent\Model|object|static|null - * - * @throws \Illuminate\Database\RecordsNotFoundException - * @throws \Illuminate\Database\MultipleRecordsFoundException - */ - public function sole($columns = ['*']) - { - $result = $this->take(2)->get($columns); - - $count = $result->count(); - - if ($count === 0) { - throw new RecordsNotFoundException; - } - - if ($count > 1) { - throw new MultipleRecordsFoundException($count); - } - - return $result->first(); - } - - /** - * Paginate the given query using a cursor paginator. - * - * @param int $perPage - * @param array|string $columns - * @param string $cursorName - * @param \Illuminate\Pagination\Cursor|string|null $cursor - * @return \Illuminate\Contracts\Pagination\CursorPaginator - */ - protected function paginateUsingCursor($perPage, $columns = ['*'], $cursorName = 'cursor', $cursor = null) - { - if (! $cursor instanceof Cursor) { - $cursor = is_string($cursor) - ? Cursor::fromEncoded($cursor) - : CursorPaginator::resolveCurrentCursor($cursorName, $cursor); - } - - $orders = $this->ensureOrderForCursorPagination(! is_null($cursor) && $cursor->pointsToPreviousItems()); - - if (! is_null($cursor)) { - $addCursorConditions = function (self $builder, $previousColumn, $i) use (&$addCursorConditions, $cursor, $orders) { - $unionBuilders = isset($builder->unions) ? collect($builder->unions)->pluck('query') : collect(); - - if (! is_null($previousColumn)) { - $originalColumn = $this->getOriginalColumnNameForCursorPagination($this, $previousColumn); - - $builder->where( - Str::contains($originalColumn, ['(', ')']) ? new Expression($originalColumn) : $originalColumn, - '=', - $cursor->parameter($previousColumn) - ); - - $unionBuilders->each(function ($unionBuilder) use ($previousColumn, $cursor) { - $unionBuilder->where( - $this->getOriginalColumnNameForCursorPagination($this, $previousColumn), - '=', - $cursor->parameter($previousColumn) - ); - - $this->addBinding($unionBuilder->getRawBindings()['where'], 'union'); - }); - } - - $builder->where(function (self $builder) use ($addCursorConditions, $cursor, $orders, $i, $unionBuilders) { - ['column' => $column, 'direction' => $direction] = $orders[$i]; - - $originalColumn = $this->getOriginalColumnNameForCursorPagination($this, $column); - - $builder->where( - Str::contains($originalColumn, ['(', ')']) ? new Expression($originalColumn) : $originalColumn, - $direction === 'asc' ? '>' : '<', - $cursor->parameter($column) - ); - - if ($i < $orders->count() - 1) { - $builder->orWhere(function (self $builder) use ($addCursorConditions, $column, $i) { - $addCursorConditions($builder, $column, $i + 1); - }); - } - - $unionBuilders->each(function ($unionBuilder) use ($column, $direction, $cursor, $i, $orders, $addCursorConditions) { - $unionBuilder->where(function ($unionBuilder) use ($column, $direction, $cursor, $i, $orders, $addCursorConditions) { - $unionBuilder->where( - $this->getOriginalColumnNameForCursorPagination($this, $column), - $direction === 'asc' ? '>' : '<', - $cursor->parameter($column) - ); - - if ($i < $orders->count() - 1) { - $unionBuilder->orWhere(function (self $builder) use ($addCursorConditions, $column, $i) { - $addCursorConditions($builder, $column, $i + 1); - }); - } - - $this->addBinding($unionBuilder->getRawBindings()['where'], 'union'); - }); - }); - }); - }; - - $addCursorConditions($this, null, 0); - } - - $this->limit($perPage + 1); - - return $this->cursorPaginator($this->get($columns), $perPage, $cursor, [ - 'path' => Paginator::resolveCurrentPath(), - 'cursorName' => $cursorName, - 'parameters' => $orders->pluck('column')->toArray(), - ]); - } - - /** - * Get the original column name of the given column, without any aliasing. - * - * @param \Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder $builder - * @param string $parameter - * @return string - */ - protected function getOriginalColumnNameForCursorPagination($builder, string $parameter) - { - $columns = $builder instanceof Builder ? $builder->getQuery()->columns : $builder->columns; - - if (! is_null($columns)) { - foreach ($columns as $column) { - if (($position = strripos($column, ' as ')) !== false) { - $original = substr($column, 0, $position); - - $alias = substr($column, $position + 4); - - if ($parameter === $alias || $builder->getGrammar()->wrap($parameter) === $alias) { - return $original; - } - } - } - } - - return $parameter; - } - - /** - * Create a new length-aware paginator instance. - * - * @param \Illuminate\Support\Collection $items - * @param int $total - * @param int $perPage - * @param int $currentPage - * @param array $options - * @return \Illuminate\Pagination\LengthAwarePaginator - */ - protected function paginator($items, $total, $perPage, $currentPage, $options) - { - return Container::getInstance()->makeWith(LengthAwarePaginator::class, compact( - 'items', 'total', 'perPage', 'currentPage', 'options' - )); - } - - /** - * Create a new simple paginator instance. - * - * @param \Illuminate\Support\Collection $items - * @param int $perPage - * @param int $currentPage - * @param array $options - * @return \Illuminate\Pagination\Paginator - */ - protected function simplePaginator($items, $perPage, $currentPage, $options) - { - return Container::getInstance()->makeWith(Paginator::class, compact( - 'items', 'perPage', 'currentPage', 'options' - )); - } - - /** - * Create a new cursor paginator instance. - * - * @param \Illuminate\Support\Collection $items - * @param int $perPage - * @param \Illuminate\Pagination\Cursor $cursor - * @param array $options - * @return \Illuminate\Pagination\CursorPaginator - */ - protected function cursorPaginator($items, $perPage, $cursor, $options) - { - return Container::getInstance()->makeWith(CursorPaginator::class, compact( - 'items', 'perPage', 'cursor', 'options' - )); - } - - /** - * Pass the query to a given callback. - * - * @param callable $callback - * @return $this - */ - public function tap($callback) - { - $callback($this); - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Concerns/CompilesJsonPaths.php b/vendor/laravel/framework/src/Illuminate/Database/Concerns/CompilesJsonPaths.php deleted file mode 100644 index ade54615..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Concerns/CompilesJsonPaths.php +++ /dev/null @@ -1,64 +0,0 @@ -', $column, 2); - - $field = $this->wrap($parts[0]); - - $path = count($parts) > 1 ? ', '.$this->wrapJsonPath($parts[1], '->') : ''; - - return [$field, $path]; - } - - /** - * Wrap the given JSON path. - * - * @param string $value - * @param string $delimiter - * @return string - */ - protected function wrapJsonPath($value, $delimiter = '->') - { - $value = preg_replace("/([\\\\]+)?\\'/", "''", $value); - - $jsonPath = collect(explode($delimiter, $value)) - ->map(fn ($segment) => $this->wrapJsonPathSegment($segment)) - ->join('.'); - - return "'$".(str_starts_with($jsonPath, '[') ? '' : '.').$jsonPath."'"; - } - - /** - * Wrap the given JSON path segment. - * - * @param string $segment - * @return string - */ - protected function wrapJsonPathSegment($segment) - { - if (preg_match('/(\[[^\]]+\])+$/', $segment, $parts)) { - $key = Str::beforeLast($segment, $parts[0]); - - if (! empty($key)) { - return '"'.$key.'"'.$parts[0]; - } - - return $parts[0]; - } - - return '"'.$segment.'"'; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Concerns/ExplainsQueries.php b/vendor/laravel/framework/src/Illuminate/Database/Concerns/ExplainsQueries.php deleted file mode 100644 index 7168de1e..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Concerns/ExplainsQueries.php +++ /dev/null @@ -1,24 +0,0 @@ -toSql(); - - $bindings = $this->getBindings(); - - $explanation = $this->getConnection()->select('EXPLAIN '.$sql, $bindings); - - return new Collection($explanation); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Concerns/ManagesTransactions.php b/vendor/laravel/framework/src/Illuminate/Database/Concerns/ManagesTransactions.php deleted file mode 100644 index 2f316a39..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Concerns/ManagesTransactions.php +++ /dev/null @@ -1,348 +0,0 @@ -beginTransaction(); - - // We'll simply execute the given callback within a try / catch block and if we - // catch any exception we can rollback this transaction so that none of this - // gets actually persisted to a database or stored in a permanent fashion. - try { - $callbackResult = $callback($this); - } - - // If we catch an exception we'll rollback this transaction and try again if we - // are not out of attempts. If we are out of attempts we will just throw the - // exception back out, and let the developer handle an uncaught exception. - catch (Throwable $e) { - $this->handleTransactionException( - $e, $currentAttempt, $attempts - ); - - continue; - } - - try { - if ($this->transactions == 1) { - $this->fireConnectionEvent('committing'); - $this->getPdo()->commit(); - } - - $this->transactions = max(0, $this->transactions - 1); - - if ($this->afterCommitCallbacksShouldBeExecuted()) { - $this->transactionsManager?->commit($this->getName()); - } - } catch (Throwable $e) { - $this->handleCommitTransactionException( - $e, $currentAttempt, $attempts - ); - - continue; - } - - $this->fireConnectionEvent('committed'); - - return $callbackResult; - } - } - - /** - * Handle an exception encountered when running a transacted statement. - * - * @param \Throwable $e - * @param int $currentAttempt - * @param int $maxAttempts - * @return void - * - * @throws \Throwable - */ - protected function handleTransactionException(Throwable $e, $currentAttempt, $maxAttempts) - { - // On a deadlock, MySQL rolls back the entire transaction so we can't just - // retry the query. We have to throw this exception all the way out and - // let the developer handle it in another way. We will decrement too. - if ($this->causedByConcurrencyError($e) && - $this->transactions > 1) { - $this->transactions--; - - $this->transactionsManager?->rollback( - $this->getName(), $this->transactions - ); - - throw new DeadlockException($e->getMessage(), is_int($e->getCode()) ? $e->getCode() : 0, $e); - } - - // If there was an exception we will rollback this transaction and then we - // can check if we have exceeded the maximum attempt count for this and - // if we haven't we will return and try this query again in our loop. - $this->rollBack(); - - if ($this->causedByConcurrencyError($e) && - $currentAttempt < $maxAttempts) { - return; - } - - throw $e; - } - - /** - * Start a new database transaction. - * - * @return void - * - * @throws \Throwable - */ - public function beginTransaction() - { - $this->createTransaction(); - - $this->transactions++; - - $this->transactionsManager?->begin( - $this->getName(), $this->transactions - ); - - $this->fireConnectionEvent('beganTransaction'); - } - - /** - * Create a transaction within the database. - * - * @return void - * - * @throws \Throwable - */ - protected function createTransaction() - { - if ($this->transactions == 0) { - $this->reconnectIfMissingConnection(); - - try { - $this->getPdo()->beginTransaction(); - } catch (Throwable $e) { - $this->handleBeginTransactionException($e); - } - } elseif ($this->transactions >= 1 && $this->queryGrammar->supportsSavepoints()) { - $this->createSavepoint(); - } - } - - /** - * Create a save point within the database. - * - * @return void - * - * @throws \Throwable - */ - protected function createSavepoint() - { - $this->getPdo()->exec( - $this->queryGrammar->compileSavepoint('trans'.($this->transactions + 1)) - ); - } - - /** - * Handle an exception from a transaction beginning. - * - * @param \Throwable $e - * @return void - * - * @throws \Throwable - */ - protected function handleBeginTransactionException(Throwable $e) - { - if ($this->causedByLostConnection($e)) { - $this->reconnect(); - - $this->getPdo()->beginTransaction(); - } else { - throw $e; - } - } - - /** - * Commit the active database transaction. - * - * @return void - * - * @throws \Throwable - */ - public function commit() - { - if ($this->transactionLevel() == 1) { - $this->fireConnectionEvent('committing'); - $this->getPdo()->commit(); - } - - $this->transactions = max(0, $this->transactions - 1); - - if ($this->afterCommitCallbacksShouldBeExecuted()) { - $this->transactionsManager?->commit($this->getName()); - } - - $this->fireConnectionEvent('committed'); - } - - /** - * Determine if after commit callbacks should be executed. - * - * @return bool - */ - protected function afterCommitCallbacksShouldBeExecuted() - { - return $this->transactions == 0 || - ($this->transactionsManager && - $this->transactionsManager->callbackApplicableTransactions()->count() === 1); - } - - /** - * Handle an exception encountered when committing a transaction. - * - * @param \Throwable $e - * @param int $currentAttempt - * @param int $maxAttempts - * @return void - * - * @throws \Throwable - */ - protected function handleCommitTransactionException(Throwable $e, $currentAttempt, $maxAttempts) - { - $this->transactions = max(0, $this->transactions - 1); - - if ($this->causedByConcurrencyError($e) && $currentAttempt < $maxAttempts) { - return; - } - - if ($this->causedByLostConnection($e)) { - $this->transactions = 0; - } - - throw $e; - } - - /** - * Rollback the active database transaction. - * - * @param int|null $toLevel - * @return void - * - * @throws \Throwable - */ - public function rollBack($toLevel = null) - { - // We allow developers to rollback to a certain transaction level. We will verify - // that this given transaction level is valid before attempting to rollback to - // that level. If it's not we will just return out and not attempt anything. - $toLevel = is_null($toLevel) - ? $this->transactions - 1 - : $toLevel; - - if ($toLevel < 0 || $toLevel >= $this->transactions) { - return; - } - - // Next, we will actually perform this rollback within this database and fire the - // rollback event. We will also set the current transaction level to the given - // level that was passed into this method so it will be right from here out. - try { - $this->performRollBack($toLevel); - } catch (Throwable $e) { - $this->handleRollBackException($e); - } - - $this->transactions = $toLevel; - - $this->transactionsManager?->rollback( - $this->getName(), $this->transactions - ); - - $this->fireConnectionEvent('rollingBack'); - } - - /** - * Perform a rollback within the database. - * - * @param int $toLevel - * @return void - * - * @throws \Throwable - */ - protected function performRollBack($toLevel) - { - if ($toLevel == 0) { - $this->getPdo()->rollBack(); - } elseif ($this->queryGrammar->supportsSavepoints()) { - $this->getPdo()->exec( - $this->queryGrammar->compileSavepointRollBack('trans'.($toLevel + 1)) - ); - } - } - - /** - * Handle an exception from a rollback. - * - * @param \Throwable $e - * @return void - * - * @throws \Throwable - */ - protected function handleRollBackException(Throwable $e) - { - if ($this->causedByLostConnection($e)) { - $this->transactions = 0; - - $this->transactionsManager?->rollback( - $this->getName(), $this->transactions - ); - } - - throw $e; - } - - /** - * Get the number of active transactions. - * - * @return int - */ - public function transactionLevel() - { - return $this->transactions; - } - - /** - * Execute the callback after a transaction commits. - * - * @param callable $callback - * @return void - * - * @throws \RuntimeException - */ - public function afterCommit($callback) - { - if ($this->transactionsManager) { - return $this->transactionsManager->addCallback($callback); - } - - throw new RuntimeException('Transactions Manager has not been set.'); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Concerns/ParsesSearchPath.php b/vendor/laravel/framework/src/Illuminate/Database/Concerns/ParsesSearchPath.php deleted file mode 100644 index e822c722..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Concerns/ParsesSearchPath.php +++ /dev/null @@ -1,25 +0,0 @@ - - */ - protected $doctrineTypeMappings = []; - - /** - * The connection resolvers. - * - * @var \Closure[] - */ - protected static $resolvers = []; - - /** - * Create a new database connection instance. - * - * @param \PDO|\Closure $pdo - * @param string $database - * @param string $tablePrefix - * @param array $config - * @return void - */ - public function __construct($pdo, $database = '', $tablePrefix = '', array $config = []) - { - $this->pdo = $pdo; - - // First we will setup the default properties. We keep track of the DB - // name we are connected to since it is needed when some reflective - // type commands are run such as checking whether a table exists. - $this->database = $database; - - $this->tablePrefix = $tablePrefix; - - $this->config = $config; - - // We need to initialize a query grammar and the query post processors - // which are both very important parts of the database abstractions - // so we initialize these to their default values while starting. - $this->useDefaultQueryGrammar(); - - $this->useDefaultPostProcessor(); - } - - /** - * Set the query grammar to the default implementation. - * - * @return void - */ - public function useDefaultQueryGrammar() - { - $this->queryGrammar = $this->getDefaultQueryGrammar(); - } - - /** - * Get the default query grammar instance. - * - * @return \Illuminate\Database\Query\Grammars\Grammar - */ - protected function getDefaultQueryGrammar() - { - return new QueryGrammar; - } - - /** - * Set the schema grammar to the default implementation. - * - * @return void - */ - public function useDefaultSchemaGrammar() - { - $this->schemaGrammar = $this->getDefaultSchemaGrammar(); - } - - /** - * Get the default schema grammar instance. - * - * @return \Illuminate\Database\Schema\Grammars\Grammar - */ - protected function getDefaultSchemaGrammar() - { - // - } - - /** - * Set the query post processor to the default implementation. - * - * @return void - */ - public function useDefaultPostProcessor() - { - $this->postProcessor = $this->getDefaultPostProcessor(); - } - - /** - * Get the default post processor instance. - * - * @return \Illuminate\Database\Query\Processors\Processor - */ - protected function getDefaultPostProcessor() - { - return new Processor; - } - - /** - * Get a schema builder instance for the connection. - * - * @return \Illuminate\Database\Schema\Builder - */ - public function getSchemaBuilder() - { - if (is_null($this->schemaGrammar)) { - $this->useDefaultSchemaGrammar(); - } - - return new SchemaBuilder($this); - } - - /** - * Begin a fluent query against a database table. - * - * @param \Closure|\Illuminate\Database\Query\Builder|string $table - * @param string|null $as - * @return \Illuminate\Database\Query\Builder - */ - public function table($table, $as = null) - { - return $this->query()->from($table, $as); - } - - /** - * Get a new query builder instance. - * - * @return \Illuminate\Database\Query\Builder - */ - public function query() - { - return new QueryBuilder( - $this, $this->getQueryGrammar(), $this->getPostProcessor() - ); - } - - /** - * Run a select statement and return a single result. - * - * @param string $query - * @param array $bindings - * @param bool $useReadPdo - * @return mixed - */ - public function selectOne($query, $bindings = [], $useReadPdo = true) - { - $records = $this->select($query, $bindings, $useReadPdo); - - return array_shift($records); - } - - /** - * Run a select statement and return the first column of the first row. - * - * @param string $query - * @param array $bindings - * @param bool $useReadPdo - * @return mixed - * - * @throws \Illuminate\Database\MultipleColumnsSelectedException - */ - public function scalar($query, $bindings = [], $useReadPdo = true) - { - $record = $this->selectOne($query, $bindings, $useReadPdo); - - if (is_null($record)) { - return null; - } - - $record = (array) $record; - - if (count($record) > 1) { - throw new MultipleColumnsSelectedException; - } - - return reset($record); - } - - /** - * Run a select statement against the database. - * - * @param string $query - * @param array $bindings - * @return array - */ - public function selectFromWriteConnection($query, $bindings = []) - { - return $this->select($query, $bindings, false); - } - - /** - * Run a select statement against the database. - * - * @param string $query - * @param array $bindings - * @param bool $useReadPdo - * @return array - */ - public function select($query, $bindings = [], $useReadPdo = true) - { - return $this->run($query, $bindings, function ($query, $bindings) use ($useReadPdo) { - if ($this->pretending()) { - return []; - } - - // For select statements, we'll simply execute the query and return an array - // of the database result set. Each element in the array will be a single - // row from the database table, and will either be an array or objects. - $statement = $this->prepared( - $this->getPdoForSelect($useReadPdo)->prepare($query) - ); - - $this->bindValues($statement, $this->prepareBindings($bindings)); - - $statement->execute(); - - return $statement->fetchAll(); - }); - } - - /** - * Run a select statement against the database and returns a generator. - * - * @param string $query - * @param array $bindings - * @param bool $useReadPdo - * @return \Generator - */ - public function cursor($query, $bindings = [], $useReadPdo = true) - { - $statement = $this->run($query, $bindings, function ($query, $bindings) use ($useReadPdo) { - if ($this->pretending()) { - return []; - } - - // First we will create a statement for the query. Then, we will set the fetch - // mode and prepare the bindings for the query. Once that's done we will be - // ready to execute the query against the database and return the cursor. - $statement = $this->prepared($this->getPdoForSelect($useReadPdo) - ->prepare($query)); - - $this->bindValues( - $statement, $this->prepareBindings($bindings) - ); - - // Next, we'll execute the query against the database and return the statement - // so we can return the cursor. The cursor will use a PHP generator to give - // back one row at a time without using a bunch of memory to render them. - $statement->execute(); - - return $statement; - }); - - while ($record = $statement->fetch()) { - yield $record; - } - } - - /** - * Configure the PDO prepared statement. - * - * @param \PDOStatement $statement - * @return \PDOStatement - */ - protected function prepared(PDOStatement $statement) - { - $statement->setFetchMode($this->fetchMode); - - $this->event(new StatementPrepared($this, $statement)); - - return $statement; - } - - /** - * Get the PDO connection to use for a select query. - * - * @param bool $useReadPdo - * @return \PDO - */ - protected function getPdoForSelect($useReadPdo = true) - { - return $useReadPdo ? $this->getReadPdo() : $this->getPdo(); - } - - /** - * Run an insert statement against the database. - * - * @param string $query - * @param array $bindings - * @return bool - */ - public function insert($query, $bindings = []) - { - return $this->statement($query, $bindings); - } - - /** - * Run an update statement against the database. - * - * @param string $query - * @param array $bindings - * @return int - */ - public function update($query, $bindings = []) - { - return $this->affectingStatement($query, $bindings); - } - - /** - * Run a delete statement against the database. - * - * @param string $query - * @param array $bindings - * @return int - */ - public function delete($query, $bindings = []) - { - return $this->affectingStatement($query, $bindings); - } - - /** - * Execute an SQL statement and return the boolean result. - * - * @param string $query - * @param array $bindings - * @return bool - */ - public function statement($query, $bindings = []) - { - return $this->run($query, $bindings, function ($query, $bindings) { - if ($this->pretending()) { - return true; - } - - $statement = $this->getPdo()->prepare($query); - - $this->bindValues($statement, $this->prepareBindings($bindings)); - - $this->recordsHaveBeenModified(); - - return $statement->execute(); - }); - } - - /** - * Run an SQL statement and get the number of rows affected. - * - * @param string $query - * @param array $bindings - * @return int - */ - public function affectingStatement($query, $bindings = []) - { - return $this->run($query, $bindings, function ($query, $bindings) { - if ($this->pretending()) { - return 0; - } - - // For update or delete statements, we want to get the number of rows affected - // by the statement and return that back to the developer. We'll first need - // to execute the statement and then we'll use PDO to fetch the affected. - $statement = $this->getPdo()->prepare($query); - - $this->bindValues($statement, $this->prepareBindings($bindings)); - - $statement->execute(); - - $this->recordsHaveBeenModified( - ($count = $statement->rowCount()) > 0 - ); - - return $count; - }); - } - - /** - * Run a raw, unprepared query against the PDO connection. - * - * @param string $query - * @return bool - */ - public function unprepared($query) - { - return $this->run($query, [], function ($query) { - if ($this->pretending()) { - return true; - } - - $this->recordsHaveBeenModified( - $change = $this->getPdo()->exec($query) !== false - ); - - return $change; - }); - } - - /** - * Execute the given callback in "dry run" mode. - * - * @param \Closure $callback - * @return array - */ - public function pretend(Closure $callback) - { - return $this->withFreshQueryLog(function () use ($callback) { - $this->pretending = true; - - // Basically to make the database connection "pretend", we will just return - // the default values for all the query methods, then we will return an - // array of queries that were "executed" within the Closure callback. - $callback($this); - - $this->pretending = false; - - return $this->queryLog; - }); - } - - /** - * Execute the given callback in "dry run" mode. - * - * @param \Closure $callback - * @return array - */ - protected function withFreshQueryLog($callback) - { - $loggingQueries = $this->loggingQueries; - - // First we will back up the value of the logging queries property and then - // we'll be ready to run callbacks. This query log will also get cleared - // so we will have a new log of all the queries that are executed now. - $this->enableQueryLog(); - - $this->queryLog = []; - - // Now we'll execute this callback and capture the result. Once it has been - // executed we will restore the value of query logging and give back the - // value of the callback so the original callers can have the results. - $result = $callback(); - - $this->loggingQueries = $loggingQueries; - - return $result; - } - - /** - * Bind values to their parameters in the given statement. - * - * @param \PDOStatement $statement - * @param array $bindings - * @return void - */ - public function bindValues($statement, $bindings) - { - foreach ($bindings as $key => $value) { - $statement->bindValue( - is_string($key) ? $key : $key + 1, - $value, - match (true) { - is_int($value) => PDO::PARAM_INT, - is_resource($value) => PDO::PARAM_LOB, - default => PDO::PARAM_STR - }, - ); - } - } - - /** - * Prepare the query bindings for execution. - * - * @param array $bindings - * @return array - */ - public function prepareBindings(array $bindings) - { - $grammar = $this->getQueryGrammar(); - - foreach ($bindings as $key => $value) { - // We need to transform all instances of DateTimeInterface into the actual - // date string. Each query grammar maintains its own date string format - // so we'll just ask the grammar for the format to get from the date. - if ($value instanceof DateTimeInterface) { - $bindings[$key] = $value->format($grammar->getDateFormat()); - } elseif (is_bool($value)) { - $bindings[$key] = (int) $value; - } - } - - return $bindings; - } - - /** - * Run a SQL statement and log its execution context. - * - * @param string $query - * @param array $bindings - * @param \Closure $callback - * @return mixed - * - * @throws \Illuminate\Database\QueryException - */ - protected function run($query, $bindings, Closure $callback) - { - foreach ($this->beforeExecutingCallbacks as $beforeExecutingCallback) { - $beforeExecutingCallback($query, $bindings, $this); - } - - $this->reconnectIfMissingConnection(); - - $start = microtime(true); - - // Here we will run this query. If an exception occurs we'll determine if it was - // caused by a connection that has been lost. If that is the cause, we'll try - // to re-establish connection and re-run the query with a fresh connection. - try { - $result = $this->runQueryCallback($query, $bindings, $callback); - } catch (QueryException $e) { - $result = $this->handleQueryException( - $e, $query, $bindings, $callback - ); - } - - // Once we have run the query we will calculate the time that it took to run and - // then log the query, bindings, and execution time so we will report them on - // the event that the developer needs them. We'll log time in milliseconds. - $this->logQuery( - $query, $bindings, $this->getElapsedTime($start) - ); - - return $result; - } - - /** - * Run a SQL statement. - * - * @param string $query - * @param array $bindings - * @param \Closure $callback - * @return mixed - * - * @throws \Illuminate\Database\QueryException - */ - protected function runQueryCallback($query, $bindings, Closure $callback) - { - // To execute the statement, we'll simply call the callback, which will actually - // run the SQL against the PDO connection. Then we can calculate the time it - // took to execute and log the query SQL, bindings and time in our memory. - try { - return $callback($query, $bindings); - } - - // If an exception occurs when attempting to run a query, we'll format the error - // message to include the bindings with SQL, which will make this exception a - // lot more helpful to the developer instead of just the database's errors. - catch (Exception $e) { - throw new QueryException( - $query, $this->prepareBindings($bindings), $e - ); - } - } - - /** - * Log a query in the connection's query log. - * - * @param string $query - * @param array $bindings - * @param float|null $time - * @return void - */ - public function logQuery($query, $bindings, $time = null) - { - $this->totalQueryDuration += $time ?? 0.0; - - $this->event(new QueryExecuted($query, $bindings, $time, $this)); - - if ($this->loggingQueries) { - $this->queryLog[] = compact('query', 'bindings', 'time'); - } - } - - /** - * Get the elapsed time since a given starting point. - * - * @param int $start - * @return float - */ - protected function getElapsedTime($start) - { - return round((microtime(true) - $start) * 1000, 2); - } - - /** - * Register a callback to be invoked when the connection queries for longer than a given amount of time. - * - * @param \DateTimeInterface|\Carbon\CarbonInterval|float|int $threshold - * @param callable $handler - * @return void - */ - public function whenQueryingForLongerThan($threshold, $handler) - { - $threshold = $threshold instanceof DateTimeInterface - ? $this->secondsUntil($threshold) * 1000 - : $threshold; - - $threshold = $threshold instanceof CarbonInterval - ? $threshold->totalMilliseconds - : $threshold; - - $this->queryDurationHandlers[] = [ - 'has_run' => false, - 'handler' => $handler, - ]; - - $key = count($this->queryDurationHandlers) - 1; - - $this->listen(function ($event) use ($threshold, $handler, $key) { - if (! $this->queryDurationHandlers[$key]['has_run'] && $this->totalQueryDuration() > $threshold) { - $handler($this, $event); - - $this->queryDurationHandlers[$key]['has_run'] = true; - } - }); - } - - /** - * Allow all the query duration handlers to run again, even if they have already run. - * - * @return void - */ - public function allowQueryDurationHandlersToRunAgain() - { - foreach ($this->queryDurationHandlers as $key => $queryDurationHandler) { - $this->queryDurationHandlers[$key]['has_run'] = false; - } - } - - /** - * Get the duration of all run queries in milliseconds. - * - * @return float - */ - public function totalQueryDuration() - { - return $this->totalQueryDuration; - } - - /** - * Reset the duration of all run queries. - * - * @return void - */ - public function resetTotalQueryDuration() - { - $this->totalQueryDuration = 0.0; - } - - /** - * Handle a query exception. - * - * @param \Illuminate\Database\QueryException $e - * @param string $query - * @param array $bindings - * @param \Closure $callback - * @return mixed - * - * @throws \Illuminate\Database\QueryException - */ - protected function handleQueryException(QueryException $e, $query, $bindings, Closure $callback) - { - if ($this->transactions >= 1) { - throw $e; - } - - return $this->tryAgainIfCausedByLostConnection( - $e, $query, $bindings, $callback - ); - } - - /** - * Handle a query exception that occurred during query execution. - * - * @param \Illuminate\Database\QueryException $e - * @param string $query - * @param array $bindings - * @param \Closure $callback - * @return mixed - * - * @throws \Illuminate\Database\QueryException - */ - protected function tryAgainIfCausedByLostConnection(QueryException $e, $query, $bindings, Closure $callback) - { - if ($this->causedByLostConnection($e->getPrevious())) { - $this->reconnect(); - - return $this->runQueryCallback($query, $bindings, $callback); - } - - throw $e; - } - - /** - * Reconnect to the database. - * - * @return mixed|false - * - * @throws \Illuminate\Database\LostConnectionException - */ - public function reconnect() - { - if (is_callable($this->reconnector)) { - $this->doctrineConnection = null; - - return call_user_func($this->reconnector, $this); - } - - throw new LostConnectionException('Lost connection and no reconnector available.'); - } - - /** - * Reconnect to the database if a PDO connection is missing. - * - * @return void - */ - protected function reconnectIfMissingConnection() - { - if (is_null($this->pdo)) { - $this->reconnect(); - } - } - - /** - * Disconnect from the underlying PDO connection. - * - * @return void - */ - public function disconnect() - { - $this->setPdo(null)->setReadPdo(null); - - $this->doctrineConnection = null; - } - - /** - * Register a hook to be run just before a database query is executed. - * - * @param \Closure $callback - * @return $this - */ - public function beforeExecuting(Closure $callback) - { - $this->beforeExecutingCallbacks[] = $callback; - - return $this; - } - - /** - * Register a database query listener with the connection. - * - * @param \Closure $callback - * @return void - */ - public function listen(Closure $callback) - { - $this->events?->listen(Events\QueryExecuted::class, $callback); - } - - /** - * Fire an event for this connection. - * - * @param string $event - * @return array|null - */ - protected function fireConnectionEvent($event) - { - return $this->events?->dispatch(match ($event) { - 'beganTransaction' => new TransactionBeginning($this), - 'committed' => new TransactionCommitted($this), - 'committing' => new TransactionCommitting($this), - 'rollingBack' => new TransactionRolledBack($this), - default => null, - }); - } - - /** - * Fire the given event if possible. - * - * @param mixed $event - * @return void - */ - protected function event($event) - { - $this->events?->dispatch($event); - } - - /** - * Get a new raw query expression. - * - * @param mixed $value - * @return \Illuminate\Database\Query\Expression - */ - public function raw($value) - { - return new Expression($value); - } - - /** - * Determine if the database connection has modified any database records. - * - * @return bool - */ - public function hasModifiedRecords() - { - return $this->recordsModified; - } - - /** - * Indicate if any records have been modified. - * - * @param bool $value - * @return void - */ - public function recordsHaveBeenModified($value = true) - { - if (! $this->recordsModified) { - $this->recordsModified = $value; - } - } - - /** - * Set the record modification state. - * - * @param bool $value - * @return $this - */ - public function setRecordModificationState(bool $value) - { - $this->recordsModified = $value; - - return $this; - } - - /** - * Reset the record modification state. - * - * @return void - */ - public function forgetRecordModificationState() - { - $this->recordsModified = false; - } - - /** - * Indicate that the connection should use the write PDO connection for reads. - * - * @param bool $value - * @return $this - */ - public function useWriteConnectionWhenReading($value = true) - { - $this->readOnWriteConnection = $value; - - return $this; - } - - /** - * Is Doctrine available? - * - * @return bool - */ - public function isDoctrineAvailable() - { - return class_exists('Doctrine\DBAL\Connection'); - } - - /** - * Indicates whether native alter operations will be used when dropping or renaming columns, even if Doctrine DBAL is installed. - * - * @return bool - */ - public function usingNativeSchemaOperations() - { - return ! $this->isDoctrineAvailable() || SchemaBuilder::$alwaysUsesNativeSchemaOperationsIfPossible; - } - - /** - * Get a Doctrine Schema Column instance. - * - * @param string $table - * @param string $column - * @return \Doctrine\DBAL\Schema\Column - */ - public function getDoctrineColumn($table, $column) - { - $schema = $this->getDoctrineSchemaManager(); - - return $schema->listTableDetails($table)->getColumn($column); - } - - /** - * Get the Doctrine DBAL schema manager for the connection. - * - * @return \Doctrine\DBAL\Schema\AbstractSchemaManager - */ - public function getDoctrineSchemaManager() - { - $connection = $this->getDoctrineConnection(); - - // Doctrine v2 expects one parameter while v3 expects two. 2nd will be ignored on v2... - return $this->getDoctrineDriver()->getSchemaManager( - $connection, - $connection->getDatabasePlatform() - ); - } - - /** - * Get the Doctrine DBAL database connection instance. - * - * @return \Doctrine\DBAL\Connection - */ - public function getDoctrineConnection() - { - if (is_null($this->doctrineConnection)) { - $driver = $this->getDoctrineDriver(); - - $this->doctrineConnection = new DoctrineConnection(array_filter([ - 'pdo' => $this->getPdo(), - 'dbname' => $this->getDatabaseName(), - 'driver' => $driver->getName(), - 'serverVersion' => $this->getConfig('server_version'), - ]), $driver); - - foreach ($this->doctrineTypeMappings as $name => $type) { - $this->doctrineConnection - ->getDatabasePlatform() - ->registerDoctrineTypeMapping($type, $name); - } - } - - return $this->doctrineConnection; - } - - /** - * Register a custom Doctrine mapping type. - * - * @param Type|class-string $class - * @param string $name - * @param string $type - * @return void - * - * @throws \Doctrine\DBAL\DBALException - * @throws \RuntimeException - */ - public function registerDoctrineType(Type|string $class, string $name, string $type): void - { - if (! $this->isDoctrineAvailable()) { - throw new RuntimeException( - 'Registering a custom Doctrine type requires Doctrine DBAL (doctrine/dbal).' - ); - } - - if (! Type::hasType($name)) { - Type::getTypeRegistry() - ->register($name, is_string($class) ? new $class() : $class); - } - - $this->doctrineTypeMappings[$name] = $type; - } - - /** - * Get the current PDO connection. - * - * @return \PDO - */ - public function getPdo() - { - if ($this->pdo instanceof Closure) { - return $this->pdo = call_user_func($this->pdo); - } - - return $this->pdo; - } - - /** - * Get the current PDO connection parameter without executing any reconnect logic. - * - * @return \PDO|\Closure|null - */ - public function getRawPdo() - { - return $this->pdo; - } - - /** - * Get the current PDO connection used for reading. - * - * @return \PDO - */ - public function getReadPdo() - { - if ($this->transactions > 0) { - return $this->getPdo(); - } - - if ($this->readOnWriteConnection || - ($this->recordsModified && $this->getConfig('sticky'))) { - return $this->getPdo(); - } - - if ($this->readPdo instanceof Closure) { - return $this->readPdo = call_user_func($this->readPdo); - } - - return $this->readPdo ?: $this->getPdo(); - } - - /** - * Get the current read PDO connection parameter without executing any reconnect logic. - * - * @return \PDO|\Closure|null - */ - public function getRawReadPdo() - { - return $this->readPdo; - } - - /** - * Set the PDO connection. - * - * @param \PDO|\Closure|null $pdo - * @return $this - */ - public function setPdo($pdo) - { - $this->transactions = 0; - - $this->pdo = $pdo; - - return $this; - } - - /** - * Set the PDO connection used for reading. - * - * @param \PDO|\Closure|null $pdo - * @return $this - */ - public function setReadPdo($pdo) - { - $this->readPdo = $pdo; - - return $this; - } - - /** - * Set the reconnect instance on the connection. - * - * @param callable $reconnector - * @return $this - */ - public function setReconnector(callable $reconnector) - { - $this->reconnector = $reconnector; - - return $this; - } - - /** - * Get the database connection name. - * - * @return string|null - */ - public function getName() - { - return $this->getConfig('name'); - } - - /** - * Get the database connection full name. - * - * @return string|null - */ - public function getNameWithReadWriteType() - { - return $this->getName().($this->readWriteType ? '::'.$this->readWriteType : ''); - } - - /** - * Get an option from the configuration options. - * - * @param string|null $option - * @return mixed - */ - public function getConfig($option = null) - { - return Arr::get($this->config, $option); - } - - /** - * Get the PDO driver name. - * - * @return string - */ - public function getDriverName() - { - return $this->getConfig('driver'); - } - - /** - * Get the query grammar used by the connection. - * - * @return \Illuminate\Database\Query\Grammars\Grammar - */ - public function getQueryGrammar() - { - return $this->queryGrammar; - } - - /** - * Set the query grammar used by the connection. - * - * @param \Illuminate\Database\Query\Grammars\Grammar $grammar - * @return $this - */ - public function setQueryGrammar(Query\Grammars\Grammar $grammar) - { - $this->queryGrammar = $grammar; - - return $this; - } - - /** - * Get the schema grammar used by the connection. - * - * @return \Illuminate\Database\Schema\Grammars\Grammar - */ - public function getSchemaGrammar() - { - return $this->schemaGrammar; - } - - /** - * Set the schema grammar used by the connection. - * - * @param \Illuminate\Database\Schema\Grammars\Grammar $grammar - * @return $this - */ - public function setSchemaGrammar(Schema\Grammars\Grammar $grammar) - { - $this->schemaGrammar = $grammar; - - return $this; - } - - /** - * Get the query post processor used by the connection. - * - * @return \Illuminate\Database\Query\Processors\Processor - */ - public function getPostProcessor() - { - return $this->postProcessor; - } - - /** - * Set the query post processor used by the connection. - * - * @param \Illuminate\Database\Query\Processors\Processor $processor - * @return $this - */ - public function setPostProcessor(Processor $processor) - { - $this->postProcessor = $processor; - - return $this; - } - - /** - * Get the event dispatcher used by the connection. - * - * @return \Illuminate\Contracts\Events\Dispatcher - */ - public function getEventDispatcher() - { - return $this->events; - } - - /** - * Set the event dispatcher instance on the connection. - * - * @param \Illuminate\Contracts\Events\Dispatcher $events - * @return $this - */ - public function setEventDispatcher(Dispatcher $events) - { - $this->events = $events; - - return $this; - } - - /** - * Unset the event dispatcher for this connection. - * - * @return void - */ - public function unsetEventDispatcher() - { - $this->events = null; - } - - /** - * Set the transaction manager instance on the connection. - * - * @param \Illuminate\Database\DatabaseTransactionsManager $manager - * @return $this - */ - public function setTransactionManager($manager) - { - $this->transactionsManager = $manager; - - return $this; - } - - /** - * Unset the transaction manager for this connection. - * - * @return void - */ - public function unsetTransactionManager() - { - $this->transactionsManager = null; - } - - /** - * Determine if the connection is in a "dry run". - * - * @return bool - */ - public function pretending() - { - return $this->pretending === true; - } - - /** - * Get the connection query log. - * - * @return array - */ - public function getQueryLog() - { - return $this->queryLog; - } - - /** - * Clear the query log. - * - * @return void - */ - public function flushQueryLog() - { - $this->queryLog = []; - } - - /** - * Enable the query log on the connection. - * - * @return void - */ - public function enableQueryLog() - { - $this->loggingQueries = true; - } - - /** - * Disable the query log on the connection. - * - * @return void - */ - public function disableQueryLog() - { - $this->loggingQueries = false; - } - - /** - * Determine whether we're logging queries. - * - * @return bool - */ - public function logging() - { - return $this->loggingQueries; - } - - /** - * Get the name of the connected database. - * - * @return string - */ - public function getDatabaseName() - { - return $this->database; - } - - /** - * Set the name of the connected database. - * - * @param string $database - * @return $this - */ - public function setDatabaseName($database) - { - $this->database = $database; - - return $this; - } - - /** - * Set the read / write type of the connection. - * - * @param string|null $readWriteType - * @return $this - */ - public function setReadWriteType($readWriteType) - { - $this->readWriteType = $readWriteType; - - return $this; - } - - /** - * Get the table prefix for the connection. - * - * @return string - */ - public function getTablePrefix() - { - return $this->tablePrefix; - } - - /** - * Set the table prefix in use by the connection. - * - * @param string $prefix - * @return $this - */ - public function setTablePrefix($prefix) - { - $this->tablePrefix = $prefix; - - $this->getQueryGrammar()->setTablePrefix($prefix); - - return $this; - } - - /** - * Set the table prefix and return the grammar. - * - * @param \Illuminate\Database\Grammar $grammar - * @return \Illuminate\Database\Grammar - */ - public function withTablePrefix(Grammar $grammar) - { - $grammar->setTablePrefix($this->tablePrefix); - - return $grammar; - } - - /** - * Register a connection resolver. - * - * @param string $driver - * @param \Closure $callback - * @return void - */ - public static function resolverFor($driver, Closure $callback) - { - static::$resolvers[$driver] = $callback; - } - - /** - * Get the connection resolver for the given driver. - * - * @param string $driver - * @return mixed - */ - public static function getResolver($driver) - { - return static::$resolvers[$driver] ?? null; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/ConnectionInterface.php b/vendor/laravel/framework/src/Illuminate/Database/ConnectionInterface.php deleted file mode 100755 index 00b23952..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/ConnectionInterface.php +++ /dev/null @@ -1,170 +0,0 @@ - $connections - * @return void - */ - public function __construct(array $connections = []) - { - foreach ($connections as $name => $connection) { - $this->addConnection($name, $connection); - } - } - - /** - * Get a database connection instance. - * - * @param string|null $name - * @return \Illuminate\Database\ConnectionInterface - */ - public function connection($name = null) - { - if (is_null($name)) { - $name = $this->getDefaultConnection(); - } - - return $this->connections[$name]; - } - - /** - * Add a connection to the resolver. - * - * @param string $name - * @param \Illuminate\Database\ConnectionInterface $connection - * @return void - */ - public function addConnection($name, ConnectionInterface $connection) - { - $this->connections[$name] = $connection; - } - - /** - * Check if a connection has been registered. - * - * @param string $name - * @return bool - */ - public function hasConnection($name) - { - return isset($this->connections[$name]); - } - - /** - * Get the default connection name. - * - * @return string - */ - public function getDefaultConnection() - { - return $this->default; - } - - /** - * Set the default connection name. - * - * @param string $name - * @return void - */ - public function setDefaultConnection($name) - { - $this->default = $name; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/ConnectionResolverInterface.php b/vendor/laravel/framework/src/Illuminate/Database/ConnectionResolverInterface.php deleted file mode 100755 index b31e5a79..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/ConnectionResolverInterface.php +++ /dev/null @@ -1,29 +0,0 @@ -container = $container; - } - - /** - * Establish a PDO connection based on the configuration. - * - * @param array $config - * @param string|null $name - * @return \Illuminate\Database\Connection - */ - public function make(array $config, $name = null) - { - $config = $this->parseConfig($config, $name); - - if (isset($config['read'])) { - return $this->createReadWriteConnection($config); - } - - return $this->createSingleConnection($config); - } - - /** - * Parse and prepare the database configuration. - * - * @param array $config - * @param string $name - * @return array - */ - protected function parseConfig(array $config, $name) - { - return Arr::add(Arr::add($config, 'prefix', ''), 'name', $name); - } - - /** - * Create a single database connection instance. - * - * @param array $config - * @return \Illuminate\Database\Connection - */ - protected function createSingleConnection(array $config) - { - $pdo = $this->createPdoResolver($config); - - return $this->createConnection( - $config['driver'], $pdo, $config['database'], $config['prefix'], $config - ); - } - - /** - * Create a read / write database connection instance. - * - * @param array $config - * @return \Illuminate\Database\Connection - */ - protected function createReadWriteConnection(array $config) - { - $connection = $this->createSingleConnection($this->getWriteConfig($config)); - - return $connection->setReadPdo($this->createReadPdo($config)); - } - - /** - * Create a new PDO instance for reading. - * - * @param array $config - * @return \Closure - */ - protected function createReadPdo(array $config) - { - return $this->createPdoResolver($this->getReadConfig($config)); - } - - /** - * Get the read configuration for a read / write connection. - * - * @param array $config - * @return array - */ - protected function getReadConfig(array $config) - { - return $this->mergeReadWriteConfig( - $config, $this->getReadWriteConfig($config, 'read') - ); - } - - /** - * Get the write configuration for a read / write connection. - * - * @param array $config - * @return array - */ - protected function getWriteConfig(array $config) - { - return $this->mergeReadWriteConfig( - $config, $this->getReadWriteConfig($config, 'write') - ); - } - - /** - * Get a read / write level configuration. - * - * @param array $config - * @param string $type - * @return array - */ - protected function getReadWriteConfig(array $config, $type) - { - return isset($config[$type][0]) - ? Arr::random($config[$type]) - : $config[$type]; - } - - /** - * Merge a configuration for a read / write connection. - * - * @param array $config - * @param array $merge - * @return array - */ - protected function mergeReadWriteConfig(array $config, array $merge) - { - return Arr::except(array_merge($config, $merge), ['read', 'write']); - } - - /** - * Create a new Closure that resolves to a PDO instance. - * - * @param array $config - * @return \Closure - */ - protected function createPdoResolver(array $config) - { - return array_key_exists('host', $config) - ? $this->createPdoResolverWithHosts($config) - : $this->createPdoResolverWithoutHosts($config); - } - - /** - * Create a new Closure that resolves to a PDO instance with a specific host or an array of hosts. - * - * @param array $config - * @return \Closure - * - * @throws \PDOException - */ - protected function createPdoResolverWithHosts(array $config) - { - return function () use ($config) { - foreach (Arr::shuffle($this->parseHosts($config)) as $host) { - $config['host'] = $host; - - try { - return $this->createConnector($config)->connect($config); - } catch (PDOException $e) { - continue; - } - } - - throw $e; - }; - } - - /** - * Parse the hosts configuration item into an array. - * - * @param array $config - * @return array - * - * @throws \InvalidArgumentException - */ - protected function parseHosts(array $config) - { - $hosts = Arr::wrap($config['host']); - - if (empty($hosts)) { - throw new InvalidArgumentException('Database hosts array is empty.'); - } - - return $hosts; - } - - /** - * Create a new Closure that resolves to a PDO instance where there is no configured host. - * - * @param array $config - * @return \Closure - */ - protected function createPdoResolverWithoutHosts(array $config) - { - return fn () => $this->createConnector($config)->connect($config); - } - - /** - * Create a connector instance based on the configuration. - * - * @param array $config - * @return \Illuminate\Database\Connectors\ConnectorInterface - * - * @throws \InvalidArgumentException - */ - public function createConnector(array $config) - { - if (! isset($config['driver'])) { - throw new InvalidArgumentException('A driver must be specified.'); - } - - if ($this->container->bound($key = "db.connector.{$config['driver']}")) { - return $this->container->make($key); - } - - return match ($config['driver']) { - 'mysql' => new MySqlConnector, - 'pgsql' => new PostgresConnector, - 'sqlite' => new SQLiteConnector, - 'sqlsrv' => new SqlServerConnector, - default => throw new InvalidArgumentException("Unsupported driver [{$config['driver']}]."), - }; - } - - /** - * Create a new connection instance. - * - * @param string $driver - * @param \PDO|\Closure $connection - * @param string $database - * @param string $prefix - * @param array $config - * @return \Illuminate\Database\Connection - * - * @throws \InvalidArgumentException - */ - protected function createConnection($driver, $connection, $database, $prefix = '', array $config = []) - { - if ($resolver = Connection::getResolver($driver)) { - return $resolver($connection, $database, $prefix, $config); - } - - return match ($driver) { - 'mysql' => new MySqlConnection($connection, $database, $prefix, $config), - 'pgsql' => new PostgresConnection($connection, $database, $prefix, $config), - 'sqlite' => new SQLiteConnection($connection, $database, $prefix, $config), - 'sqlsrv' => new SqlServerConnection($connection, $database, $prefix, $config), - default => throw new InvalidArgumentException("Unsupported driver [{$driver}]."), - }; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php b/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php deleted file mode 100755 index 0fecfb5e..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php +++ /dev/null @@ -1,139 +0,0 @@ - PDO::CASE_NATURAL, - PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, - PDO::ATTR_ORACLE_NULLS => PDO::NULL_NATURAL, - PDO::ATTR_STRINGIFY_FETCHES => false, - PDO::ATTR_EMULATE_PREPARES => false, - ]; - - /** - * Create a new PDO connection. - * - * @param string $dsn - * @param array $config - * @param array $options - * @return \PDO - * - * @throws \Exception - */ - public function createConnection($dsn, array $config, array $options) - { - [$username, $password] = [ - $config['username'] ?? null, $config['password'] ?? null, - ]; - - try { - return $this->createPdoConnection( - $dsn, $username, $password, $options - ); - } catch (Exception $e) { - return $this->tryAgainIfCausedByLostConnection( - $e, $dsn, $username, $password, $options - ); - } - } - - /** - * Create a new PDO connection instance. - * - * @param string $dsn - * @param string $username - * @param string $password - * @param array $options - * @return \PDO - */ - protected function createPdoConnection($dsn, $username, $password, $options) - { - if (class_exists(PDOConnection::class) && ! $this->isPersistentConnection($options)) { - return new PDOConnection($dsn, $username, $password, $options); - } - - return new PDO($dsn, $username, $password, $options); - } - - /** - * Determine if the connection is persistent. - * - * @param array $options - * @return bool - */ - protected function isPersistentConnection($options) - { - return isset($options[PDO::ATTR_PERSISTENT]) && - $options[PDO::ATTR_PERSISTENT]; - } - - /** - * Handle an exception that occurred during connect execution. - * - * @param \Throwable $e - * @param string $dsn - * @param string $username - * @param string $password - * @param array $options - * @return \PDO - * - * @throws \Exception - */ - protected function tryAgainIfCausedByLostConnection(Throwable $e, $dsn, $username, $password, $options) - { - if ($this->causedByLostConnection($e)) { - return $this->createPdoConnection($dsn, $username, $password, $options); - } - - throw $e; - } - - /** - * Get the PDO options based on the configuration. - * - * @param array $config - * @return array - */ - public function getOptions(array $config) - { - $options = $config['options'] ?? []; - - return array_diff_key($this->options, $options) + $options; - } - - /** - * Get the default PDO connection options. - * - * @return array - */ - public function getDefaultOptions() - { - return $this->options; - } - - /** - * Set the default PDO connection options. - * - * @param array $options - * @return void - */ - public function setDefaultOptions(array $options) - { - $this->options = $options; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectorInterface.php b/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectorInterface.php deleted file mode 100755 index 08597ac0..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectorInterface.php +++ /dev/null @@ -1,14 +0,0 @@ -getDsn($config); - - $options = $this->getOptions($config); - - // We need to grab the PDO options that should be used while making the brand - // new connection instance. The PDO options control various aspects of the - // connection's behavior, and some might be specified by the developers. - $connection = $this->createConnection($dsn, $config, $options); - - if (! empty($config['database'])) { - $connection->exec("use `{$config['database']}`;"); - } - - $this->configureIsolationLevel($connection, $config); - - $this->configureEncoding($connection, $config); - - // Next, we will check to see if a timezone has been specified in this config - // and if it has we will issue a statement to modify the timezone with the - // database. Setting this DB timezone is an optional configuration item. - $this->configureTimezone($connection, $config); - - $this->setModes($connection, $config); - - return $connection; - } - - /** - * Set the connection transaction isolation level. - * - * @param \PDO $connection - * @param array $config - * @return void - */ - protected function configureIsolationLevel($connection, array $config) - { - if (! isset($config['isolation_level'])) { - return; - } - - $connection->prepare( - "SET SESSION TRANSACTION ISOLATION LEVEL {$config['isolation_level']}" - )->execute(); - } - - /** - * Set the connection character set and collation. - * - * @param \PDO $connection - * @param array $config - * @return void|\PDO - */ - protected function configureEncoding($connection, array $config) - { - if (! isset($config['charset'])) { - return $connection; - } - - $connection->prepare( - "set names '{$config['charset']}'".$this->getCollation($config) - )->execute(); - } - - /** - * Get the collation for the configuration. - * - * @param array $config - * @return string - */ - protected function getCollation(array $config) - { - return isset($config['collation']) ? " collate '{$config['collation']}'" : ''; - } - - /** - * Set the timezone on the connection. - * - * @param \PDO $connection - * @param array $config - * @return void - */ - protected function configureTimezone($connection, array $config) - { - if (isset($config['timezone'])) { - $connection->prepare('set time_zone="'.$config['timezone'].'"')->execute(); - } - } - - /** - * Create a DSN string from a configuration. - * - * Chooses socket or host/port based on the 'unix_socket' config value. - * - * @param array $config - * @return string - */ - protected function getDsn(array $config) - { - return $this->hasSocket($config) - ? $this->getSocketDsn($config) - : $this->getHostDsn($config); - } - - /** - * Determine if the given configuration array has a UNIX socket value. - * - * @param array $config - * @return bool - */ - protected function hasSocket(array $config) - { - return isset($config['unix_socket']) && ! empty($config['unix_socket']); - } - - /** - * Get the DSN string for a socket configuration. - * - * @param array $config - * @return string - */ - protected function getSocketDsn(array $config) - { - return "mysql:unix_socket={$config['unix_socket']};dbname={$config['database']}"; - } - - /** - * Get the DSN string for a host / port configuration. - * - * @param array $config - * @return string - */ - protected function getHostDsn(array $config) - { - extract($config, EXTR_SKIP); - - return isset($port) - ? "mysql:host={$host};port={$port};dbname={$database}" - : "mysql:host={$host};dbname={$database}"; - } - - /** - * Set the modes for the connection. - * - * @param \PDO $connection - * @param array $config - * @return void - */ - protected function setModes(PDO $connection, array $config) - { - if (isset($config['modes'])) { - $this->setCustomModes($connection, $config); - } elseif (isset($config['strict'])) { - if ($config['strict']) { - $connection->prepare($this->strictMode($connection, $config))->execute(); - } else { - $connection->prepare("set session sql_mode='NO_ENGINE_SUBSTITUTION'")->execute(); - } - } - } - - /** - * Set the custom modes on the connection. - * - * @param \PDO $connection - * @param array $config - * @return void - */ - protected function setCustomModes(PDO $connection, array $config) - { - $modes = implode(',', $config['modes']); - - $connection->prepare("set session sql_mode='{$modes}'")->execute(); - } - - /** - * Get the query to enable strict mode. - * - * @param \PDO $connection - * @param array $config - * @return string - */ - protected function strictMode(PDO $connection, $config) - { - $version = $config['version'] ?? $connection->getAttribute(PDO::ATTR_SERVER_VERSION); - - if (version_compare($version, '8.0.11') >= 0) { - return "set session sql_mode='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'"; - } - - return "set session sql_mode='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'"; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Connectors/PostgresConnector.php b/vendor/laravel/framework/src/Illuminate/Database/Connectors/PostgresConnector.php deleted file mode 100755 index c54163f9..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Connectors/PostgresConnector.php +++ /dev/null @@ -1,216 +0,0 @@ - PDO::CASE_NATURAL, - PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, - PDO::ATTR_ORACLE_NULLS => PDO::NULL_NATURAL, - PDO::ATTR_STRINGIFY_FETCHES => false, - ]; - - /** - * Establish a database connection. - * - * @param array $config - * @return \PDO - */ - public function connect(array $config) - { - // First we'll create the basic DSN and connection instance connecting to the - // using the configuration option specified by the developer. We will also - // set the default character set on the connections to UTF-8 by default. - $connection = $this->createConnection( - $this->getDsn($config), $config, $this->getOptions($config) - ); - - $this->configureIsolationLevel($connection, $config); - - $this->configureEncoding($connection, $config); - - // Next, we will check to see if a timezone has been specified in this config - // and if it has we will issue a statement to modify the timezone with the - // database. Setting this DB timezone is an optional configuration item. - $this->configureTimezone($connection, $config); - - $this->configureSearchPath($connection, $config); - - // Postgres allows an application_name to be set by the user and this name is - // used to when monitoring the application with pg_stat_activity. So we'll - // determine if the option has been specified and run a statement if so. - $this->configureApplicationName($connection, $config); - - $this->configureSynchronousCommit($connection, $config); - - return $connection; - } - - /** - * Set the connection transaction isolation level. - * - * @param \PDO $connection - * @param array $config - * @return void - */ - protected function configureIsolationLevel($connection, array $config) - { - if (isset($config['isolation_level'])) { - $connection->prepare("set session characteristics as transaction isolation level {$config['isolation_level']}")->execute(); - } - } - - /** - * Set the connection character set and collation. - * - * @param \PDO $connection - * @param array $config - * @return void - */ - protected function configureEncoding($connection, $config) - { - if (! isset($config['charset'])) { - return; - } - - $connection->prepare("set names '{$config['charset']}'")->execute(); - } - - /** - * Set the timezone on the connection. - * - * @param \PDO $connection - * @param array $config - * @return void - */ - protected function configureTimezone($connection, array $config) - { - if (isset($config['timezone'])) { - $timezone = $config['timezone']; - - $connection->prepare("set time zone '{$timezone}'")->execute(); - } - } - - /** - * Set the "search_path" on the database connection. - * - * @param \PDO $connection - * @param array $config - * @return void - */ - protected function configureSearchPath($connection, $config) - { - if (isset($config['search_path']) || isset($config['schema'])) { - $searchPath = $this->quoteSearchPath( - $this->parseSearchPath($config['search_path'] ?? $config['schema']) - ); - - $connection->prepare("set search_path to {$searchPath}")->execute(); - } - } - - /** - * Format the search path for the DSN. - * - * @param array $searchPath - * @return string - */ - protected function quoteSearchPath($searchPath) - { - return count($searchPath) === 1 ? '"'.$searchPath[0].'"' : '"'.implode('", "', $searchPath).'"'; - } - - /** - * Set the application name on the connection. - * - * @param \PDO $connection - * @param array $config - * @return void - */ - protected function configureApplicationName($connection, $config) - { - if (isset($config['application_name'])) { - $applicationName = $config['application_name']; - - $connection->prepare("set application_name to '$applicationName'")->execute(); - } - } - - /** - * Create a DSN string from a configuration. - * - * @param array $config - * @return string - */ - protected function getDsn(array $config) - { - // First we will create the basic DSN setup as well as the port if it is in - // in the configuration options. This will give us the basic DSN we will - // need to establish the PDO connections and return them back for use. - extract($config, EXTR_SKIP); - - $host = isset($host) ? "host={$host};" : ''; - - // Sometimes - users may need to connect to a database that has a different - // name than the database used for "information_schema" queries. This is - // typically the case if using "pgbouncer" type software when pooling. - $database = $connect_via_database ?? $database; - - $dsn = "pgsql:{$host}dbname='{$database}'"; - - // If a port was specified, we will add it to this Postgres DSN connections - // format. Once we have done that we are ready to return this connection - // string back out for usage, as this has been fully constructed here. - if (isset($config['port'])) { - $dsn .= ";port={$port}"; - } - - return $this->addSslOptions($dsn, $config); - } - - /** - * Add the SSL options to the DSN. - * - * @param string $dsn - * @param array $config - * @return string - */ - protected function addSslOptions($dsn, array $config) - { - foreach (['sslmode', 'sslcert', 'sslkey', 'sslrootcert'] as $option) { - if (isset($config[$option])) { - $dsn .= ";{$option}={$config[$option]}"; - } - } - - return $dsn; - } - - /** - * Configure the synchronous_commit setting. - * - * @param \PDO $connection - * @param array $config - * @return void - */ - protected function configureSynchronousCommit($connection, array $config) - { - if (! isset($config['synchronous_commit'])) { - return; - } - - $connection->prepare("set synchronous_commit to '{$config['synchronous_commit']}'")->execute(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Connectors/SQLiteConnector.php b/vendor/laravel/framework/src/Illuminate/Database/Connectors/SQLiteConnector.php deleted file mode 100755 index ddedfbf9..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Connectors/SQLiteConnector.php +++ /dev/null @@ -1,39 +0,0 @@ -getOptions($config); - - // SQLite supports "in-memory" databases that only last as long as the owning - // connection does. These are useful for tests or for short lifetime store - // querying. In-memory databases may only have a single open connection. - if ($config['database'] === ':memory:') { - return $this->createConnection('sqlite::memory:', $config, $options); - } - - $path = realpath($config['database']); - - // Here we'll verify that the SQLite database exists before going any further - // as the developer probably wants to know if the database exists and this - // SQLite driver will not throw any exception if it does not by default. - if ($path === false) { - throw new SQLiteDatabaseDoesNotExistException($config['database']); - } - - return $this->createConnection("sqlite:{$path}", $config, $options); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Connectors/SqlServerConnector.php b/vendor/laravel/framework/src/Illuminate/Database/Connectors/SqlServerConnector.php deleted file mode 100755 index b6ed47d1..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Connectors/SqlServerConnector.php +++ /dev/null @@ -1,233 +0,0 @@ - PDO::CASE_NATURAL, - PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, - PDO::ATTR_ORACLE_NULLS => PDO::NULL_NATURAL, - PDO::ATTR_STRINGIFY_FETCHES => false, - ]; - - /** - * Establish a database connection. - * - * @param array $config - * @return \PDO - */ - public function connect(array $config) - { - $options = $this->getOptions($config); - - $connection = $this->createConnection($this->getDsn($config), $config, $options); - - $this->configureIsolationLevel($connection, $config); - - return $connection; - } - - /** - * Set the connection transaction isolation level. - * - * https://learn.microsoft.com/en-us/sql/t-sql/statements/set-transaction-isolation-level-transact-sql - * - * @param \PDO $connection - * @param array $config - * @return void - */ - protected function configureIsolationLevel($connection, array $config) - { - if (! isset($config['isolation_level'])) { - return; - } - - $connection->prepare( - "SET TRANSACTION ISOLATION LEVEL {$config['isolation_level']}" - )->execute(); - } - - /** - * Create a DSN string from a configuration. - * - * @param array $config - * @return string - */ - protected function getDsn(array $config) - { - // First we will create the basic DSN setup as well as the port if it is in - // in the configuration options. This will give us the basic DSN we will - // need to establish the PDO connections and return them back for use. - if ($this->prefersOdbc($config)) { - return $this->getOdbcDsn($config); - } - - if (in_array('sqlsrv', $this->getAvailableDrivers())) { - return $this->getSqlSrvDsn($config); - } else { - return $this->getDblibDsn($config); - } - } - - /** - * Determine if the database configuration prefers ODBC. - * - * @param array $config - * @return bool - */ - protected function prefersOdbc(array $config) - { - return in_array('odbc', $this->getAvailableDrivers()) && - ($config['odbc'] ?? null) === true; - } - - /** - * Get the DSN string for a DbLib connection. - * - * @param array $config - * @return string - */ - protected function getDblibDsn(array $config) - { - return $this->buildConnectString('dblib', array_merge([ - 'host' => $this->buildHostString($config, ':'), - 'dbname' => $config['database'], - ], Arr::only($config, ['appname', 'charset', 'version']))); - } - - /** - * Get the DSN string for an ODBC connection. - * - * @param array $config - * @return string - */ - protected function getOdbcDsn(array $config) - { - return isset($config['odbc_datasource_name']) - ? 'odbc:'.$config['odbc_datasource_name'] : ''; - } - - /** - * Get the DSN string for a SqlSrv connection. - * - * @param array $config - * @return string - */ - protected function getSqlSrvDsn(array $config) - { - $arguments = [ - 'Server' => $this->buildHostString($config, ','), - ]; - - if (isset($config['database'])) { - $arguments['Database'] = $config['database']; - } - - if (isset($config['readonly'])) { - $arguments['ApplicationIntent'] = 'ReadOnly'; - } - - if (isset($config['pooling']) && $config['pooling'] === false) { - $arguments['ConnectionPooling'] = '0'; - } - - if (isset($config['appname'])) { - $arguments['APP'] = $config['appname']; - } - - if (isset($config['encrypt'])) { - $arguments['Encrypt'] = $config['encrypt']; - } - - if (isset($config['trust_server_certificate'])) { - $arguments['TrustServerCertificate'] = $config['trust_server_certificate']; - } - - if (isset($config['multiple_active_result_sets']) && $config['multiple_active_result_sets'] === false) { - $arguments['MultipleActiveResultSets'] = 'false'; - } - - if (isset($config['transaction_isolation'])) { - $arguments['TransactionIsolation'] = $config['transaction_isolation']; - } - - if (isset($config['multi_subnet_failover'])) { - $arguments['MultiSubnetFailover'] = $config['multi_subnet_failover']; - } - - if (isset($config['column_encryption'])) { - $arguments['ColumnEncryption'] = $config['column_encryption']; - } - - if (isset($config['key_store_authentication'])) { - $arguments['KeyStoreAuthentication'] = $config['key_store_authentication']; - } - - if (isset($config['key_store_principal_id'])) { - $arguments['KeyStorePrincipalId'] = $config['key_store_principal_id']; - } - - if (isset($config['key_store_secret'])) { - $arguments['KeyStoreSecret'] = $config['key_store_secret']; - } - - if (isset($config['login_timeout'])) { - $arguments['LoginTimeout'] = $config['login_timeout']; - } - - if (isset($config['authentication'])) { - $arguments['Authentication'] = $config['authentication']; - } - - return $this->buildConnectString('sqlsrv', $arguments); - } - - /** - * Build a connection string from the given arguments. - * - * @param string $driver - * @param array $arguments - * @return string - */ - protected function buildConnectString($driver, array $arguments) - { - return $driver.':'.implode(';', array_map(function ($key) use ($arguments) { - return sprintf('%s=%s', $key, $arguments[$key]); - }, array_keys($arguments))); - } - - /** - * Build a host string from the given configuration. - * - * @param array $config - * @param string $separator - * @return string - */ - protected function buildHostString(array $config, $separator) - { - if (empty($config['port'])) { - return $config['host']; - } - - return $config['host'].$separator.$config['port']; - } - - /** - * Get the available PDO drivers. - * - * @return array - */ - protected function getAvailableDrivers() - { - return PDO::getAvailableDrivers(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Console/DatabaseInspectionCommand.php b/vendor/laravel/framework/src/Illuminate/Database/Console/DatabaseInspectionCommand.php deleted file mode 100644 index e3391a09..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Console/DatabaseInspectionCommand.php +++ /dev/null @@ -1,246 +0,0 @@ - 'string', - 'citext' => 'string', - 'enum' => 'string', - 'geometry' => 'string', - 'geomcollection' => 'string', - 'linestring' => 'string', - 'ltree' => 'string', - 'multilinestring' => 'string', - 'multipoint' => 'string', - 'multipolygon' => 'string', - 'point' => 'string', - 'polygon' => 'string', - 'sysname' => 'string', - ]; - - /** - * The Composer instance. - * - * @var \Illuminate\Support\Composer - */ - protected $composer; - - /** - * Create a new command instance. - * - * @param \Illuminate\Support\Composer|null $composer - * @return void - */ - public function __construct(Composer $composer = null) - { - parent::__construct(); - - $this->composer = $composer ?? $this->laravel->make(Composer::class); - } - - /** - * Register the custom Doctrine type mappings for inspection commands. - * - * @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform - * @return void - */ - protected function registerTypeMappings(AbstractPlatform $platform) - { - foreach ($this->typeMappings as $type => $value) { - $platform->registerDoctrineTypeMapping($type, $value); - } - } - - /** - * Get a human-readable platform name for the given platform. - * - * @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform - * @param string $database - * @return string - */ - protected function getPlatformName(AbstractPlatform $platform, $database) - { - return match (class_basename($platform)) { - 'MySQLPlatform' => 'MySQL <= 5', - 'MySQL57Platform' => 'MySQL 5.7', - 'MySQL80Platform' => 'MySQL 8', - 'PostgreSQL100Platform', 'PostgreSQLPlatform' => 'Postgres', - 'SqlitePlatform' => 'SQLite', - 'SQLServerPlatform' => 'SQL Server', - 'SQLServer2012Platform' => 'SQL Server 2012', - default => $database, - }; - } - - /** - * Get the size of a table in bytes. - * - * @param \Illuminate\Database\ConnectionInterface $connection - * @param string $table - * @return int|null - */ - protected function getTableSize(ConnectionInterface $connection, string $table) - { - return match (true) { - $connection instanceof MySqlConnection => $this->getMySQLTableSize($connection, $table), - $connection instanceof PostgresConnection => $this->getPostgresTableSize($connection, $table), - $connection instanceof SQLiteConnection => $this->getSqliteTableSize($connection, $table), - default => null, - }; - } - - /** - * Get the size of a MySQL table in bytes. - * - * @param \Illuminate\Database\ConnectionInterface $connection - * @param string $table - * @return mixed - */ - protected function getMySQLTableSize(ConnectionInterface $connection, string $table) - { - $result = $connection->selectOne('SELECT (data_length + index_length) AS size FROM information_schema.TABLES WHERE table_schema = ? AND table_name = ?', [ - $connection->getDatabaseName(), - $table, - ]); - - return Arr::wrap((array) $result)['size']; - } - - /** - * Get the size of a Postgres table in bytes. - * - * @param \Illuminate\Database\ConnectionInterface $connection - * @param string $table - * @return mixed - */ - protected function getPostgresTableSize(ConnectionInterface $connection, string $table) - { - $result = $connection->selectOne('SELECT pg_total_relation_size(?) AS size;', [ - $table, - ]); - - return Arr::wrap((array) $result)['size']; - } - - /** - * Get the size of a SQLite table in bytes. - * - * @param \Illuminate\Database\ConnectionInterface $connection - * @param string $table - * @return mixed - */ - protected function getSqliteTableSize(ConnectionInterface $connection, string $table) - { - try { - $result = $connection->selectOne('SELECT SUM(pgsize) AS size FROM dbstat WHERE name=?', [ - $table, - ]); - - return Arr::wrap((array) $result)['size']; - } catch (QueryException $e) { - return null; - } - } - - /** - * Get the number of open connections for a database. - * - * @param \Illuminate\Database\ConnectionInterface $connection - * @return int|null - */ - protected function getConnectionCount(ConnectionInterface $connection) - { - $result = match (true) { - $connection instanceof MySqlConnection => $connection->selectOne('show status where variable_name = "threads_connected"'), - $connection instanceof PostgresConnection => $connection->selectOne('select count(*) AS "Value" from pg_stat_activity'), - $connection instanceof SqlServerConnection => $connection->selectOne('SELECT COUNT(*) Value FROM sys.dm_exec_sessions WHERE status = ?', ['running']), - default => null, - }; - - if (! $result) { - return null; - } - - return Arr::wrap((array) $result)['Value']; - } - - /** - * Get the connection configuration details for the given connection. - * - * @param string $database - * @return array - */ - protected function getConfigFromDatabase($database) - { - $database ??= config('database.default'); - - return Arr::except(config('database.connections.'.$database), ['password']); - } - - /** - * Ensure the dependencies for the database commands are available. - * - * @return bool - */ - protected function ensureDependenciesExist() - { - return tap(interface_exists('Doctrine\DBAL\Driver'), function ($dependenciesExist) { - if (! $dependenciesExist && $this->components->confirm('Inspecting database information requires the Doctrine DBAL (doctrine/dbal) package. Would you like to install it?')) { - $this->installDependencies(); - } - }); - } - - /** - * Install the command's dependencies. - * - * @return void - * - * @throws \Symfony\Component\Process\Exception\ProcessSignaledException - */ - protected function installDependencies() - { - $command = collect($this->composer->findComposer()) - ->push('require doctrine/dbal') - ->implode(' '); - - $process = Process::fromShellCommandline($command, null, null, null, null); - - if ('\\' !== DIRECTORY_SEPARATOR && file_exists('/dev/tty') && is_readable('/dev/tty')) { - try { - $process->setTty(true); - } catch (RuntimeException $e) { - $this->components->warn($e->getMessage()); - } - } - - try { - $process->run(fn ($type, $line) => $this->output->write($line)); - } catch (ProcessSignaledException $e) { - if (extension_loaded('pcntl') && $e->getSignal() !== SIGINT) { - throw $e; - } - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Console/DbCommand.php b/vendor/laravel/framework/src/Illuminate/Database/Console/DbCommand.php deleted file mode 100644 index caecafe3..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Console/DbCommand.php +++ /dev/null @@ -1,227 +0,0 @@ -getConnection(); - - if (! isset($connection['host']) && $connection['driver'] !== 'sqlite') { - $this->components->error('No host specified for this database connection.'); - $this->line(' Use the [--read] and [--write] options to specify a read or write connection.'); - $this->newLine(); - - return Command::FAILURE; - } - - (new Process( - array_merge([$this->getCommand($connection)], $this->commandArguments($connection)), - null, - $this->commandEnvironment($connection) - ))->setTimeout(null)->setTty(true)->mustRun(function ($type, $buffer) { - $this->output->write($buffer); - }); - - return 0; - } - - /** - * Get the database connection configuration. - * - * @return array - * - * @throws \UnexpectedValueException - */ - public function getConnection() - { - $connection = $this->laravel['config']['database.connections.'. - (($db = $this->argument('connection')) ?? $this->laravel['config']['database.default']) - ]; - - if (empty($connection)) { - throw new UnexpectedValueException("Invalid database connection [{$db}]."); - } - - if (! empty($connection['url'])) { - $connection = (new ConfigurationUrlParser)->parseConfiguration($connection); - } - - if ($this->option('read')) { - if (is_array($connection['read']['host'])) { - $connection['read']['host'] = $connection['read']['host'][0]; - } - - $connection = array_merge($connection, $connection['read']); - } elseif ($this->option('write')) { - if (is_array($connection['write']['host'])) { - $connection['write']['host'] = $connection['write']['host'][0]; - } - - $connection = array_merge($connection, $connection['write']); - } - - return $connection; - } - - /** - * Get the arguments for the database client command. - * - * @param array $connection - * @return array - */ - public function commandArguments(array $connection) - { - $driver = ucfirst($connection['driver']); - - return $this->{"get{$driver}Arguments"}($connection); - } - - /** - * Get the environment variables for the database client command. - * - * @param array $connection - * @return array|null - */ - public function commandEnvironment(array $connection) - { - $driver = ucfirst($connection['driver']); - - if (method_exists($this, "get{$driver}Environment")) { - return $this->{"get{$driver}Environment"}($connection); - } - - return null; - } - - /** - * Get the database client command to run. - * - * @param array $connection - * @return string - */ - public function getCommand(array $connection) - { - return [ - 'mysql' => 'mysql', - 'pgsql' => 'psql', - 'sqlite' => 'sqlite3', - 'sqlsrv' => 'sqlcmd', - ][$connection['driver']]; - } - - /** - * Get the arguments for the MySQL CLI. - * - * @param array $connection - * @return array - */ - protected function getMysqlArguments(array $connection) - { - return array_merge([ - '--host='.$connection['host'], - '--port='.$connection['port'], - '--user='.$connection['username'], - ], $this->getOptionalArguments([ - 'password' => '--password='.$connection['password'], - 'unix_socket' => '--socket='.($connection['unix_socket'] ?? ''), - 'charset' => '--default-character-set='.($connection['charset'] ?? ''), - ], $connection), [$connection['database']]); - } - - /** - * Get the arguments for the Postgres CLI. - * - * @param array $connection - * @return array - */ - protected function getPgsqlArguments(array $connection) - { - return [$connection['database']]; - } - - /** - * Get the arguments for the SQLite CLI. - * - * @param array $connection - * @return array - */ - protected function getSqliteArguments(array $connection) - { - return [$connection['database']]; - } - - /** - * Get the arguments for the SQL Server CLI. - * - * @param array $connection - * @return array - */ - protected function getSqlsrvArguments(array $connection) - { - return array_merge(...$this->getOptionalArguments([ - 'database' => ['-d', $connection['database']], - 'username' => ['-U', $connection['username']], - 'password' => ['-P', $connection['password']], - 'host' => ['-S', 'tcp:'.$connection['host'] - .($connection['port'] ? ','.$connection['port'] : ''), ], - ], $connection)); - } - - /** - * Get the environment variables for the Postgres CLI. - * - * @param array $connection - * @return array|null - */ - protected function getPgsqlEnvironment(array $connection) - { - return array_merge(...$this->getOptionalArguments([ - 'username' => ['PGUSER' => $connection['username']], - 'host' => ['PGHOST' => $connection['host']], - 'port' => ['PGPORT' => $connection['port']], - 'password' => ['PGPASSWORD' => $connection['password']], - ], $connection)); - } - - /** - * Get the optional arguments based on the connection configuration. - * - * @param array $args - * @param array $connection - * @return array - */ - protected function getOptionalArguments(array $args, array $connection) - { - return array_values(array_filter($args, function ($key) use ($connection) { - return ! empty($connection[$key]); - }, ARRAY_FILTER_USE_KEY)); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Console/DumpCommand.php b/vendor/laravel/framework/src/Illuminate/Database/Console/DumpCommand.php deleted file mode 100644 index 50a6ad07..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Console/DumpCommand.php +++ /dev/null @@ -1,101 +0,0 @@ -connection($database = $this->input->getOption('database')); - - $this->schemaState($connection)->dump( - $connection, $path = $this->path($connection) - ); - - $dispatcher->dispatch(new SchemaDumped($connection, $path)); - - $info = 'Database schema dumped'; - - if ($this->option('prune')) { - (new Filesystem)->deleteDirectory( - database_path('migrations'), $preserve = false - ); - - $info .= ' and pruned'; - } - - $this->components->info($info.' successfully.'); - } - - /** - * Create a schema state instance for the given connection. - * - * @param \Illuminate\Database\Connection $connection - * @return mixed - */ - protected function schemaState(Connection $connection) - { - return $connection->getSchemaState() - ->withMigrationTable($connection->getTablePrefix().Config::get('database.migrations', 'migrations')) - ->handleOutputUsing(function ($type, $buffer) { - $this->output->write($buffer); - }); - } - - /** - * Get the path that the dump should be written to. - * - * @param \Illuminate\Database\Connection $connection - */ - protected function path(Connection $connection) - { - return tap($this->option('path') ?: database_path('schema/'.$connection->getName().'-schema.dump'), function ($path) { - (new Filesystem)->ensureDirectoryExists(dirname($path)); - }); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Console/Factories/FactoryMakeCommand.php b/vendor/laravel/framework/src/Illuminate/Database/Console/Factories/FactoryMakeCommand.php deleted file mode 100644 index 48c43759..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Console/Factories/FactoryMakeCommand.php +++ /dev/null @@ -1,154 +0,0 @@ -resolveStubPath('/stubs/factory.stub'); - } - - /** - * Resolve the fully-qualified path to the stub. - * - * @param string $stub - * @return string - */ - protected function resolveStubPath($stub) - { - return file_exists($customPath = $this->laravel->basePath(trim($stub, '/'))) - ? $customPath - : __DIR__.$stub; - } - - /** - * Build the class with the given name. - * - * @param string $name - * @return string - */ - protected function buildClass($name) - { - $factory = class_basename(Str::ucfirst(str_replace('Factory', '', $name))); - - $namespaceModel = $this->option('model') - ? $this->qualifyModel($this->option('model')) - : $this->qualifyModel($this->guessModelName($name)); - - $model = class_basename($namespaceModel); - - $namespace = $this->getNamespace( - Str::replaceFirst($this->rootNamespace(), 'Database\\Factories\\', $this->qualifyClass($this->getNameInput())) - ); - - $replace = [ - '{{ factoryNamespace }}' => $namespace, - 'NamespacedDummyModel' => $namespaceModel, - '{{ namespacedModel }}' => $namespaceModel, - '{{namespacedModel}}' => $namespaceModel, - 'DummyModel' => $model, - '{{ model }}' => $model, - '{{model}}' => $model, - '{{ factory }}' => $factory, - '{{factory}}' => $factory, - ]; - - return str_replace( - array_keys($replace), array_values($replace), parent::buildClass($name) - ); - } - - /** - * Get the destination class path. - * - * @param string $name - * @return string - */ - protected function getPath($name) - { - $name = (string) Str::of($name)->replaceFirst($this->rootNamespace(), '')->finish('Factory'); - - return $this->laravel->databasePath().'/factories/'.str_replace('\\', '/', $name).'.php'; - } - - /** - * Guess the model name from the Factory name or return a default model name. - * - * @param string $name - * @return string - */ - protected function guessModelName($name) - { - if (str_ends_with($name, 'Factory')) { - $name = substr($name, 0, -7); - } - - $modelName = $this->qualifyModel(Str::after($name, $this->rootNamespace())); - - if (class_exists($modelName)) { - return $modelName; - } - - if (is_dir(app_path('Models/'))) { - return $this->rootNamespace().'Models\Model'; - } - - return $this->rootNamespace().'Model'; - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['model', 'm', InputOption::VALUE_OPTIONAL, 'The name of the model'], - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Console/Factories/stubs/factory.stub b/vendor/laravel/framework/src/Illuminate/Database/Console/Factories/stubs/factory.stub deleted file mode 100644 index 0759b5d2..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Console/Factories/stubs/factory.stub +++ /dev/null @@ -1,23 +0,0 @@ - - */ -class {{ factory }}Factory extends Factory -{ - /** - * Define the model's default state. - * - * @return array - */ - public function definition() - { - return [ - // - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/BaseCommand.php b/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/BaseCommand.php deleted file mode 100755 index 6c4f2550..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/BaseCommand.php +++ /dev/null @@ -1,51 +0,0 @@ -input->hasOption('path') && $this->option('path')) { - return collect($this->option('path'))->map(function ($path) { - return ! $this->usingRealPath() - ? $this->laravel->basePath().'/'.$path - : $path; - })->all(); - } - - return array_merge( - $this->migrator->paths(), [$this->getMigrationPath()] - ); - } - - /** - * Determine if the given path(s) are pre-resolved "real" paths. - * - * @return bool - */ - protected function usingRealPath() - { - return $this->input->hasOption('realpath') && $this->option('realpath'); - } - - /** - * Get the path to the migration directory. - * - * @return string - */ - protected function getMigrationPath() - { - return $this->laravel->databasePath().DIRECTORY_SEPARATOR.'migrations'; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/FreshCommand.php b/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/FreshCommand.php deleted file mode 100644 index e319e74b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/FreshCommand.php +++ /dev/null @@ -1,120 +0,0 @@ -confirmToProceed()) { - return 1; - } - - $database = $this->input->getOption('database'); - - $this->newLine(); - - $this->components->task('Dropping all tables', fn () => $this->callSilent('db:wipe', array_filter([ - '--database' => $database, - '--drop-views' => $this->option('drop-views'), - '--drop-types' => $this->option('drop-types'), - '--force' => true, - ])) == 0); - - $this->newLine(); - - $this->call('migrate', array_filter([ - '--database' => $database, - '--path' => $this->input->getOption('path'), - '--realpath' => $this->input->getOption('realpath'), - '--schema-path' => $this->input->getOption('schema-path'), - '--force' => true, - '--step' => $this->option('step'), - ])); - - if ($this->laravel->bound(Dispatcher::class)) { - $this->laravel[Dispatcher::class]->dispatch( - new DatabaseRefreshed - ); - } - - if ($this->needsSeeding()) { - $this->runSeeder($database); - } - - return 0; - } - - /** - * Determine if the developer has requested database seeding. - * - * @return bool - */ - protected function needsSeeding() - { - return $this->option('seed') || $this->option('seeder'); - } - - /** - * Run the database seeder command. - * - * @param string $database - * @return void - */ - protected function runSeeder($database) - { - $this->call('db:seed', array_filter([ - '--database' => $database, - '--class' => $this->option('seeder') ?: 'Database\\Seeders\\DatabaseSeeder', - '--force' => true, - ])); - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['database', null, InputOption::VALUE_OPTIONAL, 'The database connection to use'], - ['drop-views', null, InputOption::VALUE_NONE, 'Drop all tables and views'], - ['drop-types', null, InputOption::VALUE_NONE, 'Drop all tables and types (Postgres only)'], - ['force', null, InputOption::VALUE_NONE, 'Force the operation to run when in production'], - ['path', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'The path(s) to the migrations files to be executed'], - ['realpath', null, InputOption::VALUE_NONE, 'Indicate any provided migration file paths are pre-resolved absolute paths'], - ['schema-path', null, InputOption::VALUE_OPTIONAL, 'The path to a schema dump file'], - ['seed', null, InputOption::VALUE_NONE, 'Indicates if the seed task should be re-run'], - ['seeder', null, InputOption::VALUE_OPTIONAL, 'The class name of the root seeder'], - ['step', null, InputOption::VALUE_NONE, 'Force the migrations to be run so they can be rolled back individually'], - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/InstallCommand.php b/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/InstallCommand.php deleted file mode 100755 index 901a83ba..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/InstallCommand.php +++ /dev/null @@ -1,70 +0,0 @@ -repository = $repository; - } - - /** - * Execute the console command. - * - * @return void - */ - public function handle() - { - $this->repository->setSource($this->input->getOption('database')); - - $this->repository->createRepository(); - - $this->components->info('Migration table created successfully.'); - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['database', null, InputOption::VALUE_OPTIONAL, 'The database connection to use'], - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php b/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php deleted file mode 100755 index fc43bf52..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php +++ /dev/null @@ -1,281 +0,0 @@ -migrator = $migrator; - $this->dispatcher = $dispatcher; - } - - /** - * Execute the console command. - * - * @return int - */ - public function handle() - { - if (! $this->confirmToProceed()) { - return 1; - } - - $this->migrator->usingConnection($this->option('database'), function () { - $this->prepareDatabase(); - - // Next, we will check to see if a path option has been defined. If it has - // we will use the path relative to the root of this installation folder - // so that migrations may be run for any path within the applications. - $migrations = $this->migrator->setOutput($this->output) - ->run($this->getMigrationPaths(), [ - 'pretend' => $this->option('pretend'), - 'step' => $this->option('step'), - ]); - - // Finally, if the "seed" option has been given, we will re-run the database - // seed task to re-populate the database, which is convenient when adding - // a migration and a seed at the same time, as it is only this command. - if ($this->option('seed') && ! $this->option('pretend')) { - $this->call('db:seed', [ - '--class' => $this->option('seeder') ?: 'Database\\Seeders\\DatabaseSeeder', - '--force' => true, - ]); - } - }); - - return 0; - } - - /** - * Prepare the migration database for running. - * - * @return void - */ - protected function prepareDatabase() - { - if (! $this->repositoryExists()) { - $this->components->info('Preparing database.'); - - $this->components->task('Creating migration table', function () { - return $this->callSilent('migrate:install', array_filter([ - '--database' => $this->option('database'), - ])) == 0; - }); - - $this->newLine(); - } - - if (! $this->migrator->hasRunAnyMigrations() && ! $this->option('pretend')) { - $this->loadSchemaState(); - } - } - - /** - * Determine if the migrator repository exists. - * - * @return bool - */ - protected function repositoryExists() - { - return retry(2, fn () => $this->migrator->repositoryExists(), 0, function ($e) { - try { - if ($e->getPrevious() instanceof SQLiteDatabaseDoesNotExistException) { - return $this->createMissingSqliteDatbase($e->getPrevious()->path); - } - - $connection = $this->migrator->resolveConnection($this->option('database')); - - if ( - $e->getPrevious() instanceof PDOException && - $e->getPrevious()->getCode() === 1049 && - $connection->getDriverName() === 'mysql') { - return $this->createMissingMysqlDatabase($connection); - } - - return false; - } catch (Throwable) { - return false; - } - }); - } - - /** - * Create a missing SQLite database. - * - * @param string $path - * @return bool - */ - protected function createMissingSqliteDatbase($path) - { - if ($this->option('force')) { - return touch($path); - } - - if ($this->option('no-interaction')) { - return false; - } - - $this->components->warn('The SQLite database does not exist: '.$path); - - if (! $this->components->confirm('Would you like to create it?')) { - return false; - } - - return touch($path); - } - - /** - * Create a missing MySQL database. - * - * @return bool - */ - protected function createMissingMysqlDatabase($connection) - { - if ($this->laravel['config']->get("database.connections.{$connection->getName()}.database") !== $connection->getDatabaseName()) { - return false; - } - - if (! $this->option('force') && $this->option('no-interaction')) { - return false; - } - - if (! $this->option('force') && ! $this->option('no-interaction')) { - $this->components->warn("The database '{$connection->getDatabaseName()}' does not exist on the '{$connection->getName()}' connection."); - - if (! $this->components->confirm('Would you like to create it?')) { - return false; - } - } - - try { - $this->laravel['config']->set("database.connections.{$connection->getName()}.database", null); - - $this->laravel['db']->purge(); - - $freshConnection = $this->migrator->resolveConnection($this->option('database')); - - return tap($freshConnection->unprepared("CREATE DATABASE IF NOT EXISTS `{$connection->getDatabaseName()}`"), function () { - $this->laravel['db']->purge(); - }); - } finally { - $this->laravel['config']->set("database.connections.{$connection->getName()}.database", $connection->getDatabaseName()); - } - } - - /** - * Load the schema state to seed the initial database schema structure. - * - * @return void - */ - protected function loadSchemaState() - { - $connection = $this->migrator->resolveConnection($this->option('database')); - - // First, we will make sure that the connection supports schema loading and that - // the schema file exists before we proceed any further. If not, we will just - // continue with the standard migration operation as normal without errors. - if ($connection instanceof SqlServerConnection || - ! is_file($path = $this->schemaPath($connection))) { - return; - } - - $this->components->info('Loading stored database schemas.'); - - $this->components->task($path, function () use ($connection, $path) { - // Since the schema file will create the "migrations" table and reload it to its - // proper state, we need to delete it here so we don't get an error that this - // table already exists when the stored database schema file gets executed. - $this->migrator->deleteRepository(); - - $connection->getSchemaState()->handleOutputUsing(function ($type, $buffer) { - $this->output->write($buffer); - })->load($path); - }); - - $this->newLine(); - - // Finally, we will fire an event that this schema has been loaded so developers - // can perform any post schema load tasks that are necessary in listeners for - // this event, which may seed the database tables with some necessary data. - $this->dispatcher->dispatch( - new SchemaLoaded($connection, $path) - ); - } - - /** - * Get the path to the stored schema for the given connection. - * - * @param \Illuminate\Database\Connection $connection - * @return string - */ - protected function schemaPath($connection) - { - if ($this->option('schema-path')) { - return $this->option('schema-path'); - } - - if (file_exists($path = database_path('schema/'.$connection->getName().'-schema.dump'))) { - return $path; - } - - return database_path('schema/'.$connection->getName().'-schema.sql'); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateMakeCommand.php b/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateMakeCommand.php deleted file mode 100644 index 94a19322..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateMakeCommand.php +++ /dev/null @@ -1,135 +0,0 @@ -creator = $creator; - $this->composer = $composer; - } - - /** - * Execute the console command. - * - * @return void - */ - public function handle() - { - // It's possible for the developer to specify the tables to modify in this - // schema operation. The developer may also specify if this table needs - // to be freshly created so we can create the appropriate migrations. - $name = Str::snake(trim($this->input->getArgument('name'))); - - $table = $this->input->getOption('table'); - - $create = $this->input->getOption('create') ?: false; - - // If no table was given as an option but a create option is given then we - // will use the "create" option as the table name. This allows the devs - // to pass a table name into this option as a short-cut for creating. - if (! $table && is_string($create)) { - $table = $create; - - $create = true; - } - - // Next, we will attempt to guess the table name if this the migration has - // "create" in the name. This will allow us to provide a convenient way - // of creating migrations that create new tables for the application. - if (! $table) { - [$table, $create] = TableGuesser::guess($name); - } - - // Now we are ready to write the migration out to disk. Once we've written - // the migration out, we will dump-autoload for the entire framework to - // make sure that the migrations are registered by the class loaders. - $this->writeMigration($name, $table, $create); - - $this->composer->dumpAutoloads(); - } - - /** - * Write the migration file to disk. - * - * @param string $name - * @param string $table - * @param bool $create - * @return string - */ - protected function writeMigration($name, $table, $create) - { - $file = $this->creator->create( - $name, $this->getMigrationPath(), $table, $create - ); - - if (! $this->option('fullpath')) { - $file = pathinfo($file, PATHINFO_FILENAME); - } - - $this->components->info(sprintf('Migration [%s] created successfully.', $file)); - } - - /** - * Get migration path (either specified by '--path' option or default location). - * - * @return string - */ - protected function getMigrationPath() - { - if (! is_null($targetPath = $this->input->getOption('path'))) { - return ! $this->usingRealPath() - ? $this->laravel->basePath().'/'.$targetPath - : $targetPath; - } - - return parent::getMigrationPath(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/RefreshCommand.php b/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/RefreshCommand.php deleted file mode 100755 index 2073cd99..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/RefreshCommand.php +++ /dev/null @@ -1,159 +0,0 @@ -confirmToProceed()) { - return 1; - } - - // Next we'll gather some of the options so that we can have the right options - // to pass to the commands. This includes options such as which database to - // use and the path to use for the migration. Then we'll run the command. - $database = $this->input->getOption('database'); - - $path = $this->input->getOption('path'); - - // If the "step" option is specified it means we only want to rollback a small - // number of migrations before migrating again. For example, the user might - // only rollback and remigrate the latest four migrations instead of all. - $step = $this->input->getOption('step') ?: 0; - - if ($step > 0) { - $this->runRollback($database, $path, $step); - } else { - $this->runReset($database, $path); - } - - // The refresh command is essentially just a brief aggregate of a few other of - // the migration commands and just provides a convenient wrapper to execute - // them in succession. We'll also see if we need to re-seed the database. - $this->call('migrate', array_filter([ - '--database' => $database, - '--path' => $path, - '--realpath' => $this->input->getOption('realpath'), - '--force' => true, - ])); - - if ($this->laravel->bound(Dispatcher::class)) { - $this->laravel[Dispatcher::class]->dispatch( - new DatabaseRefreshed - ); - } - - if ($this->needsSeeding()) { - $this->runSeeder($database); - } - - return 0; - } - - /** - * Run the rollback command. - * - * @param string $database - * @param string $path - * @param int $step - * @return void - */ - protected function runRollback($database, $path, $step) - { - $this->call('migrate:rollback', array_filter([ - '--database' => $database, - '--path' => $path, - '--realpath' => $this->input->getOption('realpath'), - '--step' => $step, - '--force' => true, - ])); - } - - /** - * Run the reset command. - * - * @param string $database - * @param string $path - * @return void - */ - protected function runReset($database, $path) - { - $this->call('migrate:reset', array_filter([ - '--database' => $database, - '--path' => $path, - '--realpath' => $this->input->getOption('realpath'), - '--force' => true, - ])); - } - - /** - * Determine if the developer has requested database seeding. - * - * @return bool - */ - protected function needsSeeding() - { - return $this->option('seed') || $this->option('seeder'); - } - - /** - * Run the database seeder command. - * - * @param string $database - * @return void - */ - protected function runSeeder($database) - { - $this->call('db:seed', array_filter([ - '--database' => $database, - '--class' => $this->option('seeder') ?: 'Database\\Seeders\\DatabaseSeeder', - '--force' => true, - ])); - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['database', null, InputOption::VALUE_OPTIONAL, 'The database connection to use'], - ['force', null, InputOption::VALUE_NONE, 'Force the operation to run when in production'], - ['path', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'The path(s) to the migrations files to be executed'], - ['realpath', null, InputOption::VALUE_NONE, 'Indicate any provided migration file paths are pre-resolved absolute paths'], - ['seed', null, InputOption::VALUE_NONE, 'Indicates if the seed task should be re-run'], - ['seeder', null, InputOption::VALUE_OPTIONAL, 'The class name of the root seeder'], - ['step', null, InputOption::VALUE_OPTIONAL, 'The number of migrations to be reverted & re-run'], - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/ResetCommand.php b/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/ResetCommand.php deleted file mode 100755 index c5952fa0..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/ResetCommand.php +++ /dev/null @@ -1,91 +0,0 @@ -migrator = $migrator; - } - - /** - * Execute the console command. - * - * @return int - */ - public function handle() - { - if (! $this->confirmToProceed()) { - return 1; - } - - return $this->migrator->usingConnection($this->option('database'), function () { - // First, we'll make sure that the migration table actually exists before we - // start trying to rollback and re-run all of the migrations. If it's not - // present we'll just bail out with an info message for the developers. - if (! $this->migrator->repositoryExists()) { - return $this->components->warn('Migration table not found.'); - } - - $this->migrator->setOutput($this->output)->reset( - $this->getMigrationPaths(), $this->option('pretend') - ); - }); - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['database', null, InputOption::VALUE_OPTIONAL, 'The database connection to use'], - - ['force', null, InputOption::VALUE_NONE, 'Force the operation to run when in production'], - - ['path', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'The path(s) to the migrations files to be executed'], - - ['realpath', null, InputOption::VALUE_NONE, 'Indicate any provided migration file paths are pre-resolved absolute paths'], - - ['pretend', null, InputOption::VALUE_NONE, 'Dump the SQL queries that would be run'], - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/RollbackCommand.php b/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/RollbackCommand.php deleted file mode 100755 index c851360f..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/RollbackCommand.php +++ /dev/null @@ -1,91 +0,0 @@ -migrator = $migrator; - } - - /** - * Execute the console command. - * - * @return int - */ - public function handle() - { - if (! $this->confirmToProceed()) { - return 1; - } - - $this->migrator->usingConnection($this->option('database'), function () { - $this->migrator->setOutput($this->output)->rollback( - $this->getMigrationPaths(), [ - 'pretend' => $this->option('pretend'), - 'step' => (int) $this->option('step'), - ] - ); - }); - - return 0; - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['database', null, InputOption::VALUE_OPTIONAL, 'The database connection to use'], - - ['force', null, InputOption::VALUE_NONE, 'Force the operation to run when in production'], - - ['path', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'The path(s) to the migrations files to be executed'], - - ['realpath', null, InputOption::VALUE_NONE, 'Indicate any provided migration file paths are pre-resolved absolute paths'], - - ['pretend', null, InputOption::VALUE_NONE, 'Dump the SQL queries that would be run'], - - ['step', null, InputOption::VALUE_OPTIONAL, 'The number of migrations to be reverted'], - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/StatusCommand.php b/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/StatusCommand.php deleted file mode 100644 index 60ad9dc1..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/StatusCommand.php +++ /dev/null @@ -1,129 +0,0 @@ -migrator = $migrator; - } - - /** - * Execute the console command. - * - * @return int|null - */ - public function handle() - { - return $this->migrator->usingConnection($this->option('database'), function () { - if (! $this->migrator->repositoryExists()) { - $this->components->error('Migration table not found.'); - - return 1; - } - - $ran = $this->migrator->getRepository()->getRan(); - - $batches = $this->migrator->getRepository()->getMigrationBatches(); - - if (count($migrations = $this->getStatusFor($ran, $batches)) > 0) { - $this->newLine(); - - $this->components->twoColumnDetail('Migration name', 'Batch / Status'); - - $migrations->each( - fn ($migration) => $this->components->twoColumnDetail($migration[0], $migration[1]) - ); - - $this->newLine(); - } else { - $this->components->info('No migrations found'); - } - }); - } - - /** - * Get the status for the given run migrations. - * - * @param array $ran - * @param array $batches - * @return \Illuminate\Support\Collection - */ - protected function getStatusFor(array $ran, array $batches) - { - return Collection::make($this->getAllMigrationFiles()) - ->map(function ($migration) use ($ran, $batches) { - $migrationName = $this->migrator->getMigrationName($migration); - - $status = in_array($migrationName, $ran) - ? 'Ran' - : 'Pending'; - - if (in_array($migrationName, $ran)) { - $status = '['.$batches[$migrationName].'] '.$status; - } - - return [$migrationName, $status]; - }); - } - - /** - * Get an array of all of the migration files. - * - * @return array - */ - protected function getAllMigrationFiles() - { - return $this->migrator->getMigrationFiles($this->getMigrationPaths()); - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['database', null, InputOption::VALUE_OPTIONAL, 'The database connection to use'], - - ['path', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'The path(s) to the migrations files to use'], - - ['realpath', null, InputOption::VALUE_NONE, 'Indicate any provided migration file paths are pre-resolved absolute paths'], - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/TableGuesser.php b/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/TableGuesser.php deleted file mode 100644 index 82dfbddb..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/TableGuesser.php +++ /dev/null @@ -1,37 +0,0 @@ -connection = $connection; - $this->events = $events; - } - - /** - * Execute the console command. - * - * @return void - */ - public function handle() - { - $databases = $this->parseDatabases($this->option('databases')); - - $this->displayConnections($databases); - - if ($this->option('max')) { - $this->dispatchEvents($databases); - } - } - - /** - * Parse the database into an array of the connections. - * - * @param string $databases - * @return \Illuminate\Support\Collection - */ - protected function parseDatabases($databases) - { - return collect(explode(',', $databases))->map(function ($database) { - if (! $database) { - $database = $this->laravel['config']['database.default']; - } - - $maxConnections = $this->option('max'); - - return [ - 'database' => $database, - 'connections' => $connections = $this->getConnectionCount($this->connection->connection($database)), - 'status' => $maxConnections && $connections >= $maxConnections ? 'ALERT' : 'OK', - ]; - }); - } - - /** - * Display the databases and their connection counts in the console. - * - * @param \Illuminate\Support\Collection $databases - * @return void - */ - protected function displayConnections($databases) - { - $this->newLine(); - - $this->components->twoColumnDetail('Database name', 'Connections'); - - $databases->each(function ($database) { - $status = '['.$database['connections'].'] '.$database['status']; - - $this->components->twoColumnDetail($database['database'], $status); - }); - - $this->newLine(); - } - - /** - * Dispatch the database monitoring events. - * - * @param \Illuminate\Support\Collection $databases - * @return void - */ - protected function dispatchEvents($databases) - { - $databases->each(function ($database) { - if ($database['status'] === 'OK') { - return; - } - - $this->events->dispatch( - new DatabaseBusy( - $database['database'], - $database['connections'] - ) - ); - }); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Console/PruneCommand.php b/vendor/laravel/framework/src/Illuminate/Database/Console/PruneCommand.php deleted file mode 100644 index 7ea6cecd..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Console/PruneCommand.php +++ /dev/null @@ -1,186 +0,0 @@ -models(); - - if ($models->isEmpty()) { - $this->components->info('No prunable models found.'); - - return; - } - - if ($this->option('pretend')) { - $models->each(function ($model) { - $this->pretendToPrune($model); - }); - - return; - } - - $pruning = []; - - $events->listen(ModelsPruned::class, function ($event) use (&$pruning) { - if (! in_array($event->model, $pruning)) { - $pruning[] = $event->model; - - $this->newLine(); - - $this->components->info(sprintf('Pruning [%s] records.', $event->model)); - } - - $this->components->twoColumnDetail($event->model, "{$event->count} records"); - }); - - $models->each(function ($model) { - $this->pruneModel($model); - }); - - $events->forget(ModelsPruned::class); - } - - /** - * Prune the given model. - * - * @param string $model - * @return void - */ - protected function pruneModel(string $model) - { - $instance = new $model; - - $chunkSize = property_exists($instance, 'prunableChunkSize') - ? $instance->prunableChunkSize - : $this->option('chunk'); - - $total = $this->isPrunable($model) - ? $instance->pruneAll($chunkSize) - : 0; - - if ($total == 0) { - $this->components->info("No prunable [$model] records found."); - } - } - - /** - * Determine the models that should be pruned. - * - * @return \Illuminate\Support\Collection - */ - protected function models() - { - if (! empty($models = $this->option('model'))) { - return collect($models)->filter(function ($model) { - return class_exists($model); - })->values(); - } - - $except = $this->option('except'); - - if (! empty($models) && ! empty($except)) { - throw new InvalidArgumentException('The --models and --except options cannot be combined.'); - } - - return collect((new Finder)->in($this->getDefaultPath())->files()->name('*.php')) - ->map(function ($model) { - $namespace = $this->laravel->getNamespace(); - - return $namespace.str_replace( - ['/', '.php'], - ['\\', ''], - Str::after($model->getRealPath(), realpath(app_path()).DIRECTORY_SEPARATOR) - ); - })->when(! empty($except), function ($models) use ($except) { - return $models->reject(function ($model) use ($except) { - return in_array($model, $except); - }); - })->filter(function ($model) { - return $this->isPrunable($model); - })->filter(function ($model) { - return class_exists($model); - })->values(); - } - - /** - * Get the default path where models are located. - * - * @return string|string[] - */ - protected function getDefaultPath() - { - return app_path('Models'); - } - - /** - * Determine if the given model class is prunable. - * - * @param string $model - * @return bool - */ - protected function isPrunable($model) - { - $uses = class_uses_recursive($model); - - return in_array(Prunable::class, $uses) || in_array(MassPrunable::class, $uses); - } - - /** - * Display how many models will be pruned. - * - * @param string $model - * @return void - */ - protected function pretendToPrune($model) - { - $instance = new $model; - - $count = $instance->prunable() - ->when(in_array(SoftDeletes::class, class_uses_recursive(get_class($instance))), function ($query) { - $query->withTrashed(); - })->count(); - - if ($count === 0) { - $this->components->info("No prunable [$model] records found."); - } else { - $this->components->info("{$count} [{$model}] records will be pruned."); - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Console/Seeds/SeedCommand.php b/vendor/laravel/framework/src/Illuminate/Database/Console/Seeds/SeedCommand.php deleted file mode 100644 index 23595864..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Console/Seeds/SeedCommand.php +++ /dev/null @@ -1,151 +0,0 @@ -resolver = $resolver; - } - - /** - * Execute the console command. - * - * @return int - */ - public function handle() - { - if (! $this->confirmToProceed()) { - return 1; - } - - $this->components->info('Seeding database.'); - - $previousConnection = $this->resolver->getDefaultConnection(); - - $this->resolver->setDefaultConnection($this->getDatabase()); - - Model::unguarded(function () { - $this->getSeeder()->__invoke(); - }); - - if ($previousConnection) { - $this->resolver->setDefaultConnection($previousConnection); - } - - return 0; - } - - /** - * Get a seeder instance from the container. - * - * @return \Illuminate\Database\Seeder - */ - protected function getSeeder() - { - $class = $this->input->getArgument('class') ?? $this->input->getOption('class'); - - if (! str_contains($class, '\\')) { - $class = 'Database\\Seeders\\'.$class; - } - - if ($class === 'Database\\Seeders\\DatabaseSeeder' && - ! class_exists($class)) { - $class = 'DatabaseSeeder'; - } - - return $this->laravel->make($class) - ->setContainer($this->laravel) - ->setCommand($this); - } - - /** - * Get the name of the database connection to use. - * - * @return string - */ - protected function getDatabase() - { - $database = $this->input->getOption('database'); - - return $database ?: $this->laravel['config']['database.default']; - } - - /** - * Get the console command arguments. - * - * @return array - */ - protected function getArguments() - { - return [ - ['class', InputArgument::OPTIONAL, 'The class name of the root seeder', null], - ]; - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['class', null, InputOption::VALUE_OPTIONAL, 'The class name of the root seeder', 'Database\\Seeders\\DatabaseSeeder'], - ['database', null, InputOption::VALUE_OPTIONAL, 'The database connection to seed'], - ['force', null, InputOption::VALUE_NONE, 'Force the operation to run when in production'], - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Console/Seeds/SeederMakeCommand.php b/vendor/laravel/framework/src/Illuminate/Database/Console/Seeds/SeederMakeCommand.php deleted file mode 100644 index 8ba01cb0..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Console/Seeds/SeederMakeCommand.php +++ /dev/null @@ -1,103 +0,0 @@ -resolveStubPath('/stubs/seeder.stub'); - } - - /** - * Resolve the fully-qualified path to the stub. - * - * @param string $stub - * @return string - */ - protected function resolveStubPath($stub) - { - return is_file($customPath = $this->laravel->basePath(trim($stub, '/'))) - ? $customPath - : __DIR__.$stub; - } - - /** - * Get the destination class path. - * - * @param string $name - * @return string - */ - protected function getPath($name) - { - $name = str_replace('\\', '/', Str::replaceFirst($this->rootNamespace(), '', $name)); - - if (is_dir($this->laravel->databasePath().'/seeds')) { - return $this->laravel->databasePath().'/seeds/'.$name.'.php'; - } - - return $this->laravel->databasePath().'/seeders/'.$name.'.php'; - } - - /** - * Get the root namespace for the class. - * - * @return string - */ - protected function rootNamespace() - { - return 'Database\Seeders\\'; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Console/Seeds/WithoutModelEvents.php b/vendor/laravel/framework/src/Illuminate/Database/Console/Seeds/WithoutModelEvents.php deleted file mode 100644 index acd9ec3f..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Console/Seeds/WithoutModelEvents.php +++ /dev/null @@ -1,19 +0,0 @@ - Model::withoutEvents($callback); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Console/Seeds/stubs/seeder.stub b/vendor/laravel/framework/src/Illuminate/Database/Console/Seeds/stubs/seeder.stub deleted file mode 100644 index 19ae5f5e..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Console/Seeds/stubs/seeder.stub +++ /dev/null @@ -1,19 +0,0 @@ - Note: This can be slow on large databases }; - {--views : Show the database views Note: This can be slow on large databases }'; - - /** - * The console command description. - * - * @var string - */ - protected $description = 'Display information about the given database'; - - /** - * Execute the console command. - * - * @param \Illuminate\Database\ConnectionResolverInterface $connections - * @return int - */ - public function handle(ConnectionResolverInterface $connections) - { - if (! $this->ensureDependenciesExist()) { - return 1; - } - - $connection = $connections->connection($database = $this->input->getOption('database')); - - $schema = $connection->getDoctrineSchemaManager(); - - $this->registerTypeMappings($schema->getDatabasePlatform()); - - $data = [ - 'platform' => [ - 'config' => $this->getConfigFromDatabase($database), - 'name' => $this->getPlatformName($schema->getDatabasePlatform(), $database), - 'open_connections' => $this->getConnectionCount($connection), - ], - 'tables' => $this->tables($connection, $schema), - ]; - - if ($this->option('views')) { - $data['views'] = $this->collectViews($connection, $schema); - } - - $this->display($data); - - return 0; - } - - /** - * Get information regarding the tables within the database. - * - * @param \Illuminate\Database\ConnectionInterface $connection - * @param \Doctrine\DBAL\Schema\AbstractSchemaManager $schema - * @return \Illuminate\Support\Collection - */ - protected function tables(ConnectionInterface $connection, AbstractSchemaManager $schema) - { - return collect($schema->listTables())->map(fn (Table $table, $index) => [ - 'table' => $table->getName(), - 'size' => $this->getTableSize($connection, $table->getName()), - 'rows' => $this->option('counts') ? $connection->table($table->getName())->count() : null, - 'engine' => rescue(fn () => $table->getOption('engine'), null, false), - 'comment' => $table->getComment(), - ]); - } - - /** - * Get information regarding the views within the database. - * - * @param \Illuminate\Database\ConnectionInterface $connection - * @param \Doctrine\DBAL\Schema\AbstractSchemaManager $schema - * @return \Illuminate\Support\Collection - */ - protected function collectViews(ConnectionInterface $connection, AbstractSchemaManager $schema) - { - return collect($schema->listViews()) - ->reject(fn (View $view) => str($view->getName()) - ->startsWith(['pg_catalog', 'information_schema', 'spt_'])) - ->map(fn (View $view) => [ - 'view' => $view->getName(), - 'rows' => $connection->table($view->getName())->count(), - ]); - } - - /** - * Render the database information. - * - * @param array $data - * @return void - */ - protected function display(array $data) - { - $this->option('json') ? $this->displayJson($data) : $this->displayForCli($data); - } - - /** - * Render the database information as JSON. - * - * @param array $data - * @return void - */ - protected function displayJson(array $data) - { - $this->output->writeln(json_encode($data)); - } - - /** - * Render the database information formatted for the CLI. - * - * @param array $data - * @return void - */ - protected function displayForCli(array $data) - { - $platform = $data['platform']; - $tables = $data['tables']; - $views = $data['views'] ?? null; - - $this->newLine(); - - $this->components->twoColumnDetail(''.$platform['name'].''); - $this->components->twoColumnDetail('Database', Arr::get($platform['config'], 'database')); - $this->components->twoColumnDetail('Host', Arr::get($platform['config'], 'host')); - $this->components->twoColumnDetail('Port', Arr::get($platform['config'], 'port')); - $this->components->twoColumnDetail('Username', Arr::get($platform['config'], 'username')); - $this->components->twoColumnDetail('URL', Arr::get($platform['config'], 'url')); - $this->components->twoColumnDetail('Open Connections', $platform['open_connections']); - $this->components->twoColumnDetail('Tables', $tables->count()); - - if ($tableSizeSum = $tables->sum('size')) { - $this->components->twoColumnDetail('Total Size', number_format($tableSizeSum / 1024 / 1024, 2).'MiB'); - } - - $this->newLine(); - - if ($tables->isNotEmpty()) { - $this->components->twoColumnDetail('Table', 'Size (MiB)'.($this->option('counts') ? ' / Rows' : '')); - - $tables->each(function ($table) { - if ($tableSize = $table['size']) { - $tableSize = number_format($tableSize / 1024 / 1024, 2); - } - - $this->components->twoColumnDetail( - $table['table'].($this->output->isVerbose() ? ' '.$table['engine'].'' : null), - ($tableSize ? $tableSize : '—').($this->option('counts') ? ' / '.number_format($table['rows']).'' : '') - ); - - if ($this->output->isVerbose()) { - if ($table['comment']) { - $this->components->bulletList([ - $table['comment'], - ]); - } - } - }); - - $this->newLine(); - } - - if ($views && $views->isNotEmpty()) { - $this->components->twoColumnDetail('View', 'Rows'); - - $views->each(fn ($view) => $this->components->twoColumnDetail($view['view'], number_format($view['rows']))); - - $this->newLine(); - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Console/TableCommand.php b/vendor/laravel/framework/src/Illuminate/Database/Console/TableCommand.php deleted file mode 100644 index 3b08bde0..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Console/TableCommand.php +++ /dev/null @@ -1,246 +0,0 @@ -ensureDependenciesExist()) { - return 1; - } - - $connection = $connections->connection($this->input->getOption('database')); - - $schema = $connection->getDoctrineSchemaManager(); - - $this->registerTypeMappings($schema->getDatabasePlatform()); - - $table = $this->argument('table') ?: $this->components->choice( - 'Which table would you like to inspect?', - collect($schema->listTables())->flatMap(fn (Table $table) => [$table->getName()])->toArray() - ); - - if (! $schema->tablesExist([$table])) { - return $this->components->warn("Table [{$table}] doesn't exist."); - } - - $table = $schema->listTableDetails($table); - - $columns = $this->columns($table); - $indexes = $this->indexes($table); - $foreignKeys = $this->foreignKeys($table); - - $data = [ - 'table' => [ - 'name' => $table->getName(), - 'columns' => $columns->count(), - 'size' => $this->getTableSize($connection, $table->getName()), - ], - 'columns' => $columns, - 'indexes' => $indexes, - 'foreign_keys' => $foreignKeys, - ]; - - $this->display($data); - - return 0; - } - - /** - * Get the information regarding the table's columns. - * - * @param \Doctrine\DBAL\Schema\Table $table - * @return \Illuminate\Support\Collection - */ - protected function columns(Table $table) - { - return collect($table->getColumns())->map(fn (Column $column) => [ - 'column' => $column->getName(), - 'attributes' => $this->getAttributesForColumn($column), - 'default' => $column->getDefault(), - 'type' => $column->getType()->getName(), - ]); - } - - /** - * Get the attributes for a table column. - * - * @param \Doctrine\DBAL\Schema\Column $column - * @return \Illuminate\Support\Collection - */ - protected function getAttributesForColumn(Column $column) - { - return collect([ - $column->getAutoincrement() ? 'autoincrement' : null, - 'type' => $column->getType()->getName(), - $column->getUnsigned() ? 'unsigned' : null, - ! $column->getNotNull() ? 'nullable' : null, - ])->filter(); - } - - /** - * Get the information regarding the table's indexes. - * - * @param \Doctrine\DBAL\Schema\Table $table - * @return \Illuminate\Support\Collection - */ - protected function indexes(Table $table) - { - return collect($table->getIndexes())->map(fn (Index $index) => [ - 'name' => $index->getName(), - 'columns' => collect($index->getColumns()), - 'attributes' => $this->getAttributesForIndex($index), - ]); - } - - /** - * Get the attributes for a table index. - * - * @param \Doctrine\DBAL\Schema\Index $index - * @return \Illuminate\Support\Collection - */ - protected function getAttributesForIndex(Index $index) - { - return collect([ - 'compound' => count($index->getColumns()) > 1, - 'unique' => $index->isUnique(), - 'primary' => $index->isPrimary(), - ])->filter()->keys()->map(fn ($attribute) => Str::lower($attribute)); - } - - /** - * Get the information regarding the table's foreign keys. - * - * @param \Doctrine\DBAL\Schema\Table $table - * @return \Illuminate\Support\Collection - */ - protected function foreignKeys(Table $table) - { - return collect($table->getForeignKeys())->map(fn (ForeignKeyConstraint $foreignKey) => [ - 'name' => $foreignKey->getName(), - 'local_table' => $table->getName(), - 'local_columns' => collect($foreignKey->getLocalColumns()), - 'foreign_table' => $foreignKey->getForeignTableName(), - 'foreign_columns' => collect($foreignKey->getForeignColumns()), - 'on_update' => Str::lower(rescue(fn () => $foreignKey->getOption('onUpdate'), 'N/A')), - 'on_delete' => Str::lower(rescue(fn () => $foreignKey->getOption('onDelete'), 'N/A')), - ]); - } - - /** - * Render the table information. - * - * @param array $data - * @return void - */ - protected function display(array $data) - { - $this->option('json') ? $this->displayJson($data) : $this->displayForCli($data); - } - - /** - * Render the table information as JSON. - * - * @param array $data - * @return void - */ - protected function displayJson(array $data) - { - $this->output->writeln(json_encode($data)); - } - - /** - * Render the table information formatted for the CLI. - * - * @param array $data - * @return void - */ - protected function displayForCli(array $data) - { - [$table, $columns, $indexes, $foreignKeys] = [ - $data['table'], $data['columns'], $data['indexes'], $data['foreign_keys'], - ]; - - $this->newLine(); - - $this->components->twoColumnDetail(''.$table['name'].''); - $this->components->twoColumnDetail('Columns', $table['columns']); - - if ($size = $table['size']) { - $this->components->twoColumnDetail('Size', number_format($size / 1024 / 1024, 2).'MiB'); - } - - $this->newLine(); - - if ($columns->isNotEmpty()) { - $this->components->twoColumnDetail('Column', 'Type'); - - $columns->each(function ($column) { - $this->components->twoColumnDetail( - $column['column'].' '.$column['attributes']->implode(', ').'', - ($column['default'] ? ''.$column['default'].' ' : '').''.$column['type'].'' - ); - }); - - $this->newLine(); - } - - if ($indexes->isNotEmpty()) { - $this->components->twoColumnDetail('Index'); - - $indexes->each(function ($index) { - $this->components->twoColumnDetail( - $index['name'].' '.$index['columns']->implode(', ').'', - $index['attributes']->implode(', ') - ); - }); - - $this->newLine(); - } - - if ($foreignKeys->isNotEmpty()) { - $this->components->twoColumnDetail('Foreign Key', 'On Update / On Delete'); - - $foreignKeys->each(function ($foreignKey) { - $this->components->twoColumnDetail( - $foreignKey['name'].' '.$foreignKey['local_columns']->implode(', ').' references '.$foreignKey['foreign_columns']->implode(', ').' on '.$foreignKey['foreign_table'].'', - $foreignKey['on_update'].' / '.$foreignKey['on_delete'], - ); - }); - - $this->newLine(); - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Console/WipeCommand.php b/vendor/laravel/framework/src/Illuminate/Database/Console/WipeCommand.php deleted file mode 100644 index cb269229..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Console/WipeCommand.php +++ /dev/null @@ -1,125 +0,0 @@ -confirmToProceed()) { - return 1; - } - - $database = $this->input->getOption('database'); - - if ($this->option('drop-views')) { - $this->dropAllViews($database); - - $this->components->info('Dropped all views successfully.'); - } - - $this->dropAllTables($database); - - $this->components->info('Dropped all tables successfully.'); - - if ($this->option('drop-types')) { - $this->dropAllTypes($database); - - $this->components->info('Dropped all types successfully.'); - } - - return 0; - } - - /** - * Drop all of the database tables. - * - * @param string $database - * @return void - */ - protected function dropAllTables($database) - { - $this->laravel['db']->connection($database) - ->getSchemaBuilder() - ->dropAllTables(); - } - - /** - * Drop all of the database views. - * - * @param string $database - * @return void - */ - protected function dropAllViews($database) - { - $this->laravel['db']->connection($database) - ->getSchemaBuilder() - ->dropAllViews(); - } - - /** - * Drop all of the database types. - * - * @param string $database - * @return void - */ - protected function dropAllTypes($database) - { - $this->laravel['db']->connection($database) - ->getSchemaBuilder() - ->dropAllTypes(); - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['database', null, InputOption::VALUE_OPTIONAL, 'The database connection to use'], - ['drop-views', null, InputOption::VALUE_NONE, 'Drop all tables and views'], - ['drop-types', null, InputOption::VALUE_NONE, 'Drop all tables and types (Postgres only)'], - ['force', null, InputOption::VALUE_NONE, 'Force the operation to run when in production'], - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/DBAL/TimestampType.php b/vendor/laravel/framework/src/Illuminate/Database/DBAL/TimestampType.php deleted file mode 100644 index 4fa98515..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/DBAL/TimestampType.php +++ /dev/null @@ -1,95 +0,0 @@ -getName()) { - 'mysql', - 'mysql2' => $this->getMySqlPlatformSQLDeclaration($fieldDeclaration), - 'postgresql', - 'pgsql', - 'postgres' => $this->getPostgresPlatformSQLDeclaration($fieldDeclaration), - 'mssql' => $this->getSqlServerPlatformSQLDeclaration($fieldDeclaration), - 'sqlite', - 'sqlite3' => $this->getSQLitePlatformSQLDeclaration($fieldDeclaration), - default => throw new DBALException('Invalid platform: '.$name), - }; - } - - /** - * Get the SQL declaration for MySQL. - * - * @param array $fieldDeclaration - * @return string - */ - protected function getMySqlPlatformSQLDeclaration(array $fieldDeclaration) - { - $columnType = 'TIMESTAMP'; - - if ($fieldDeclaration['precision']) { - $columnType = 'TIMESTAMP('.$fieldDeclaration['precision'].')'; - } - - $notNull = $fieldDeclaration['notnull'] ?? false; - - if (! $notNull) { - return $columnType.' NULL'; - } - - return $columnType; - } - - /** - * Get the SQL declaration for PostgreSQL. - * - * @param array $fieldDeclaration - * @return string - */ - protected function getPostgresPlatformSQLDeclaration(array $fieldDeclaration) - { - return 'TIMESTAMP('.(int) $fieldDeclaration['precision'].')'; - } - - /** - * Get the SQL declaration for SQL Server. - * - * @param array $fieldDeclaration - * @return string - */ - protected function getSqlServerPlatformSQLDeclaration(array $fieldDeclaration) - { - return $fieldDeclaration['precision'] ?? false - ? 'DATETIME2('.$fieldDeclaration['precision'].')' - : 'DATETIME'; - } - - /** - * Get the SQL declaration for SQLite. - * - * @param array $fieldDeclaration - * @return string - */ - protected function getSQLitePlatformSQLDeclaration(array $fieldDeclaration) - { - return 'DATETIME'; - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'timestamp'; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php b/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php deleted file mode 100755 index 4f990711..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php +++ /dev/null @@ -1,464 +0,0 @@ - - */ - protected $connections = []; - - /** - * The custom connection resolvers. - * - * @var array - */ - protected $extensions = []; - - /** - * The callback to be executed to reconnect to a database. - * - * @var callable - */ - protected $reconnector; - - /** - * The custom Doctrine column types. - * - * @var array - */ - protected $doctrineTypes = []; - - /** - * Create a new database manager instance. - * - * @param \Illuminate\Contracts\Foundation\Application $app - * @param \Illuminate\Database\Connectors\ConnectionFactory $factory - * @return void - */ - public function __construct($app, ConnectionFactory $factory) - { - $this->app = $app; - $this->factory = $factory; - - $this->reconnector = function ($connection) { - $this->reconnect($connection->getNameWithReadWriteType()); - }; - } - - /** - * Get a database connection instance. - * - * @param string|null $name - * @return \Illuminate\Database\Connection - */ - public function connection($name = null) - { - [$database, $type] = $this->parseConnectionName($name); - - $name = $name ?: $database; - - // If we haven't created this connection, we'll create it based on the config - // provided in the application. Once we've created the connections we will - // set the "fetch mode" for PDO which determines the query return types. - if (! isset($this->connections[$name])) { - $this->connections[$name] = $this->configure( - $this->makeConnection($database), $type - ); - } - - return $this->connections[$name]; - } - - /** - * Parse the connection into an array of the name and read / write type. - * - * @param string $name - * @return array - */ - protected function parseConnectionName($name) - { - $name = $name ?: $this->getDefaultConnection(); - - return Str::endsWith($name, ['::read', '::write']) - ? explode('::', $name, 2) : [$name, null]; - } - - /** - * Make the database connection instance. - * - * @param string $name - * @return \Illuminate\Database\Connection - */ - protected function makeConnection($name) - { - $config = $this->configuration($name); - - // First we will check by the connection name to see if an extension has been - // registered specifically for that connection. If it has we will call the - // Closure and pass it the config allowing it to resolve the connection. - if (isset($this->extensions[$name])) { - return call_user_func($this->extensions[$name], $config, $name); - } - - // Next we will check to see if an extension has been registered for a driver - // and will call the Closure if so, which allows us to have a more generic - // resolver for the drivers themselves which applies to all connections. - if (isset($this->extensions[$driver = $config['driver']])) { - return call_user_func($this->extensions[$driver], $config, $name); - } - - return $this->factory->make($config, $name); - } - - /** - * Get the configuration for a connection. - * - * @param string $name - * @return array - * - * @throws \InvalidArgumentException - */ - protected function configuration($name) - { - $name = $name ?: $this->getDefaultConnection(); - - // To get the database connection configuration, we will just pull each of the - // connection configurations and get the configurations for the given name. - // If the configuration doesn't exist, we'll throw an exception and bail. - $connections = $this->app['config']['database.connections']; - - if (is_null($config = Arr::get($connections, $name))) { - throw new InvalidArgumentException("Database connection [{$name}] not configured."); - } - - return (new ConfigurationUrlParser) - ->parseConfiguration($config); - } - - /** - * Prepare the database connection instance. - * - * @param \Illuminate\Database\Connection $connection - * @param string $type - * @return \Illuminate\Database\Connection - */ - protected function configure(Connection $connection, $type) - { - $connection = $this->setPdoForType($connection, $type)->setReadWriteType($type); - - // First we'll set the fetch mode and a few other dependencies of the database - // connection. This method basically just configures and prepares it to get - // used by the application. Once we're finished we'll return it back out. - if ($this->app->bound('events')) { - $connection->setEventDispatcher($this->app['events']); - } - - if ($this->app->bound('db.transactions')) { - $connection->setTransactionManager($this->app['db.transactions']); - } - - // Here we'll set a reconnector callback. This reconnector can be any callable - // so we will set a Closure to reconnect from this manager with the name of - // the connection, which will allow us to reconnect from the connections. - $connection->setReconnector($this->reconnector); - - $this->registerConfiguredDoctrineTypes($connection); - - return $connection; - } - - /** - * Prepare the read / write mode for database connection instance. - * - * @param \Illuminate\Database\Connection $connection - * @param string|null $type - * @return \Illuminate\Database\Connection - */ - protected function setPdoForType(Connection $connection, $type = null) - { - if ($type === 'read') { - $connection->setPdo($connection->getReadPdo()); - } elseif ($type === 'write') { - $connection->setReadPdo($connection->getPdo()); - } - - return $connection; - } - - /** - * Register custom Doctrine types with the connection. - * - * @param \Illuminate\Database\Connection $connection - * @return void - */ - protected function registerConfiguredDoctrineTypes(Connection $connection): void - { - foreach ($this->app['config']->get('database.dbal.types', []) as $name => $class) { - $this->registerDoctrineType($class, $name, $name); - } - - foreach ($this->doctrineTypes as $name => [$type, $class]) { - $connection->registerDoctrineType($class, $name, $type); - } - } - - /** - * Register a custom Doctrine type. - * - * @param string $class - * @param string $name - * @param string $type - * @return void - * - * @throws \Doctrine\DBAL\DBALException - * @throws \RuntimeException - */ - public function registerDoctrineType(string $class, string $name, string $type): void - { - if (! class_exists('Doctrine\DBAL\Connection')) { - throw new RuntimeException( - 'Registering a custom Doctrine type requires Doctrine DBAL (doctrine/dbal).' - ); - } - - if (! Type::hasType($name)) { - Type::addType($name, $class); - } - - $this->doctrineTypes[$name] = [$type, $class]; - } - - /** - * Disconnect from the given database and remove from local cache. - * - * @param string|null $name - * @return void - */ - public function purge($name = null) - { - $name = $name ?: $this->getDefaultConnection(); - - $this->disconnect($name); - - unset($this->connections[$name]); - } - - /** - * Disconnect from the given database. - * - * @param string|null $name - * @return void - */ - public function disconnect($name = null) - { - if (isset($this->connections[$name = $name ?: $this->getDefaultConnection()])) { - $this->connections[$name]->disconnect(); - } - } - - /** - * Reconnect to the given database. - * - * @param string|null $name - * @return \Illuminate\Database\Connection - */ - public function reconnect($name = null) - { - $this->disconnect($name = $name ?: $this->getDefaultConnection()); - - if (! isset($this->connections[$name])) { - return $this->connection($name); - } - - return $this->refreshPdoConnections($name); - } - - /** - * Set the default database connection for the callback execution. - * - * @param string $name - * @param callable $callback - * @return mixed - */ - public function usingConnection($name, callable $callback) - { - $previousName = $this->getDefaultConnection(); - - $this->setDefaultConnection($name); - - return tap($callback(), function () use ($previousName) { - $this->setDefaultConnection($previousName); - }); - } - - /** - * Refresh the PDO connections on a given connection. - * - * @param string $name - * @return \Illuminate\Database\Connection - */ - protected function refreshPdoConnections($name) - { - [$database, $type] = $this->parseConnectionName($name); - - $fresh = $this->configure( - $this->makeConnection($database), $type - ); - - return $this->connections[$name] - ->setPdo($fresh->getRawPdo()) - ->setReadPdo($fresh->getRawReadPdo()); - } - - /** - * Get the default connection name. - * - * @return string - */ - public function getDefaultConnection() - { - return $this->app['config']['database.default']; - } - - /** - * Set the default connection name. - * - * @param string $name - * @return void - */ - public function setDefaultConnection($name) - { - $this->app['config']['database.default'] = $name; - } - - /** - * Get all of the support drivers. - * - * @return string[] - */ - public function supportedDrivers() - { - return ['mysql', 'pgsql', 'sqlite', 'sqlsrv']; - } - - /** - * Get all of the drivers that are actually available. - * - * @return string[] - */ - public function availableDrivers() - { - return array_intersect( - $this->supportedDrivers(), - str_replace('dblib', 'sqlsrv', PDO::getAvailableDrivers()) - ); - } - - /** - * Register an extension connection resolver. - * - * @param string $name - * @param callable $resolver - * @return void - */ - public function extend($name, callable $resolver) - { - $this->extensions[$name] = $resolver; - } - - /** - * Remove an extension connection resolver. - * - * @param string $name - * @return void - */ - public function forgetExtension($name) - { - unset($this->extensions[$name]); - } - - /** - * Return all of the created connections. - * - * @return array - */ - public function getConnections() - { - return $this->connections; - } - - /** - * Set the database reconnector callback. - * - * @param callable $reconnector - * @return void - */ - public function setReconnector(callable $reconnector) - { - $this->reconnector = $reconnector; - } - - /** - * Set the application instance used by the manager. - * - * @param \Illuminate\Contracts\Foundation\Application $app - * @return $this - */ - public function setApplication($app) - { - $this->app = $app; - - return $this; - } - - /** - * Dynamically pass methods to the default connection. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - if (static::hasMacro($method)) { - return $this->macroCall($method, $parameters); - } - - return $this->connection()->$method(...$parameters); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/DatabaseServiceProvider.php b/vendor/laravel/framework/src/Illuminate/Database/DatabaseServiceProvider.php deleted file mode 100755 index 9a2f47d1..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/DatabaseServiceProvider.php +++ /dev/null @@ -1,113 +0,0 @@ -app['db']); - - Model::setEventDispatcher($this->app['events']); - } - - /** - * Register the service provider. - * - * @return void - */ - public function register() - { - Model::clearBootedModels(); - - $this->registerConnectionServices(); - $this->registerEloquentFactory(); - $this->registerQueueableEntityResolver(); - } - - /** - * Register the primary database bindings. - * - * @return void - */ - protected function registerConnectionServices() - { - // The connection factory is used to create the actual connection instances on - // the database. We will inject the factory into the manager so that it may - // make the connections while they are actually needed and not of before. - $this->app->singleton('db.factory', function ($app) { - return new ConnectionFactory($app); - }); - - // The database manager is used to resolve various connections, since multiple - // connections might be managed. It also implements the connection resolver - // interface which may be used by other components requiring connections. - $this->app->singleton('db', function ($app) { - return new DatabaseManager($app, $app['db.factory']); - }); - - $this->app->bind('db.connection', function ($app) { - return $app['db']->connection(); - }); - - $this->app->bind('db.schema', function ($app) { - return $app['db']->connection()->getSchemaBuilder(); - }); - - $this->app->singleton('db.transactions', function ($app) { - return new DatabaseTransactionsManager; - }); - } - - /** - * Register the Eloquent factory instance in the container. - * - * @return void - */ - protected function registerEloquentFactory() - { - $this->app->singleton(FakerGenerator::class, function ($app, $parameters) { - $locale = $parameters['locale'] ?? $app['config']->get('app.faker_locale', 'en_US'); - - if (! isset(static::$fakers[$locale])) { - static::$fakers[$locale] = FakerFactory::create($locale); - } - - static::$fakers[$locale]->unique(true); - - return static::$fakers[$locale]; - }); - } - - /** - * Register the queueable entity resolver implementation. - * - * @return void - */ - protected function registerQueueableEntityResolver() - { - $this->app->singleton(EntityResolver::class, function () { - return new QueueEntityResolver; - }); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/DatabaseTransactionRecord.php b/vendor/laravel/framework/src/Illuminate/Database/DatabaseTransactionRecord.php deleted file mode 100755 index 4736ee92..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/DatabaseTransactionRecord.php +++ /dev/null @@ -1,73 +0,0 @@ -connection = $connection; - $this->level = $level; - } - - /** - * Register a callback to be executed after committing. - * - * @param callable $callback - * @return void - */ - public function addCallback($callback) - { - $this->callbacks[] = $callback; - } - - /** - * Execute all of the callbacks. - * - * @return void - */ - public function executeCallbacks() - { - foreach ($this->callbacks as $callback) { - $callback(); - } - } - - /** - * Get all of the callbacks. - * - * @return array - */ - public function getCallbacks() - { - return $this->callbacks; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/DatabaseTransactionsManager.php b/vendor/laravel/framework/src/Illuminate/Database/DatabaseTransactionsManager.php deleted file mode 100755 index 8d145188..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/DatabaseTransactionsManager.php +++ /dev/null @@ -1,133 +0,0 @@ -transactions = collect(); - } - - /** - * Start a new database transaction. - * - * @param string $connection - * @param int $level - * @return void - */ - public function begin($connection, $level) - { - $this->transactions->push( - new DatabaseTransactionRecord($connection, $level) - ); - } - - /** - * Rollback the active database transaction. - * - * @param string $connection - * @param int $level - * @return void - */ - public function rollback($connection, $level) - { - $this->transactions = $this->transactions->reject( - fn ($transaction) => $transaction->connection == $connection && $transaction->level > $level - )->values(); - - if ($this->transactions->isEmpty()) { - $this->callbacksShouldIgnore = null; - } - } - - /** - * Commit the active database transaction. - * - * @param string $connection - * @return void - */ - public function commit($connection) - { - [$forThisConnection, $forOtherConnections] = $this->transactions->partition( - fn ($transaction) => $transaction->connection == $connection - ); - - $this->transactions = $forOtherConnections->values(); - - $forThisConnection->map->executeCallbacks(); - - if ($this->transactions->isEmpty()) { - $this->callbacksShouldIgnore = null; - } - } - - /** - * Register a transaction callback. - * - * @param callable $callback - * @return void - */ - public function addCallback($callback) - { - if ($current = $this->callbackApplicableTransactions()->last()) { - return $current->addCallback($callback); - } - - $callback(); - } - - /** - * Specify that callbacks should ignore the given transaction when determining if they should be executed. - * - * @param \Illuminate\Database\DatabaseTransactionRecord $transaction - * @return $this - */ - public function callbacksShouldIgnore(DatabaseTransactionRecord $transaction) - { - $this->callbacksShouldIgnore = $transaction; - - return $this; - } - - /** - * Get the transactions that are applicable to callbacks. - * - * @return \Illuminate\Support\Collection - */ - public function callbackApplicableTransactions() - { - return $this->transactions->reject(function ($transaction) { - return $transaction === $this->callbacksShouldIgnore; - })->values(); - } - - /** - * Get all the transactions. - * - * @return \Illuminate\Support\Collection - */ - public function getTransactions() - { - return $this->transactions; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/DeadlockException.php b/vendor/laravel/framework/src/Illuminate/Database/DeadlockException.php deleted file mode 100644 index 375a39bc..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/DeadlockException.php +++ /dev/null @@ -1,10 +0,0 @@ -getCode() === 40001 || $e->getCode() === '40001')) { - return true; - } - - $message = $e->getMessage(); - - return Str::contains($message, [ - 'Deadlock found when trying to get lock', - 'deadlock detected', - 'The database file is locked', - 'database is locked', - 'database table is locked', - 'A table in the database is locked', - 'has been chosen as the deadlock victim', - 'Lock wait timeout exceeded; try restarting transaction', - 'WSREP detected deadlock/conflict and aborted the transaction. Try restarting the transaction', - ]); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/DetectsLostConnections.php b/vendor/laravel/framework/src/Illuminate/Database/DetectsLostConnections.php deleted file mode 100644 index f0c216fe..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/DetectsLostConnections.php +++ /dev/null @@ -1,66 +0,0 @@ -getMessage(); - - return Str::contains($message, [ - 'server has gone away', - 'no connection to the server', - 'Lost connection', - 'is dead or not enabled', - 'Error while sending', - 'decryption failed or bad record mac', - 'server closed the connection unexpectedly', - 'SSL connection has been closed unexpectedly', - 'Error writing data to the connection', - 'Resource deadlock avoided', - 'Transaction() on null', - 'child connection forced to terminate due to client_idle_limit', - 'query_wait_timeout', - 'reset by peer', - 'Physical connection is not usable', - 'TCP Provider: Error code 0x68', - 'ORA-03114', - 'Packets out of order. Expected', - 'Adaptive Server connection failed', - 'Communication link failure', - 'connection is no longer usable', - 'Login timeout expired', - 'SQLSTATE[HY000] [2002] Connection refused', - 'running with the --read-only option so it cannot execute this statement', - 'The connection is broken and recovery is not possible. The connection is marked by the client driver as unrecoverable. No attempt was made to restore the connection.', - 'SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Try again', - 'SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known', - 'SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for', - 'SQLSTATE[HY000]: General error: 7 SSL SYSCALL error: EOF detected', - 'SQLSTATE[HY000] [2002] Connection timed out', - 'SSL: Connection timed out', - 'SQLSTATE[HY000]: General error: 1105 The last transaction was aborted due to Seamless Scaling. Please retry.', - 'Temporary failure in name resolution', - 'SSL: Broken pipe', - 'SQLSTATE[08S01]: Communication link failure', - 'SQLSTATE[08006] [7] could not connect to server: Connection refused Is the server running on host', - 'SQLSTATE[HY000]: General error: 7 SSL SYSCALL error: No route to host', - 'The client was disconnected by the server because of inactivity. See wait_timeout and interactive_timeout for configuring this behavior.', - 'SQLSTATE[08006] [7] could not translate host name', - 'TCP Provider: Error code 0x274C', - 'SQLSTATE[HY000] [2002] No such file or directory', - 'SSL: Operation timed out', - 'Reason: Server is in script upgrade mode. Only administrator can connect at this time.', - ]); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/BroadcastableModelEventOccurred.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/BroadcastableModelEventOccurred.php deleted file mode 100644 index 249b1830..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/BroadcastableModelEventOccurred.php +++ /dev/null @@ -1,144 +0,0 @@ -model = $model; - $this->event = $event; - } - - /** - * The channels the event should broadcast on. - * - * @return array - */ - public function broadcastOn() - { - $channels = empty($this->channels) - ? ($this->model->broadcastOn($this->event) ?: []) - : $this->channels; - - return collect($channels)->map(function ($channel) { - return $channel instanceof Model ? new PrivateChannel($channel) : $channel; - })->all(); - } - - /** - * The name the event should broadcast as. - * - * @return string - */ - public function broadcastAs() - { - $default = class_basename($this->model).ucfirst($this->event); - - return method_exists($this->model, 'broadcastAs') - ? ($this->model->broadcastAs($this->event) ?: $default) - : $default; - } - - /** - * Get the data that should be sent with the broadcasted event. - * - * @return array|null - */ - public function broadcastWith() - { - return method_exists($this->model, 'broadcastWith') - ? $this->model->broadcastWith($this->event) - : null; - } - - /** - * Manually specify the channels the event should broadcast on. - * - * @param array $channels - * @return $this - */ - public function onChannels(array $channels) - { - $this->channels = $channels; - - return $this; - } - - /** - * Determine if the event should be broadcast synchronously. - * - * @return bool - */ - public function shouldBroadcastNow() - { - return $this->event === 'deleted' && - ! method_exists($this->model, 'bootSoftDeletes'); - } - - /** - * Get the event name. - * - * @return string - */ - public function event() - { - return $this->event; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/BroadcastsEvents.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/BroadcastsEvents.php deleted file mode 100644 index 79dc02d8..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/BroadcastsEvents.php +++ /dev/null @@ -1,197 +0,0 @@ -broadcastCreated(); - }); - - static::updated(function ($model) { - $model->broadcastUpdated(); - }); - - if (method_exists(static::class, 'bootSoftDeletes')) { - static::softDeleted(function ($model) { - $model->broadcastTrashed(); - }); - - static::restored(function ($model) { - $model->broadcastRestored(); - }); - } - - static::deleted(function ($model) { - $model->broadcastDeleted(); - }); - } - - /** - * Broadcast that the model was created. - * - * @param \Illuminate\Broadcasting\Channel|\Illuminate\Contracts\Broadcasting\HasBroadcastChannel|array|null $channels - * @return \Illuminate\Broadcasting\PendingBroadcast - */ - public function broadcastCreated($channels = null) - { - return $this->broadcastIfBroadcastChannelsExistForEvent( - $this->newBroadcastableModelEvent('created'), 'created', $channels - ); - } - - /** - * Broadcast that the model was updated. - * - * @param \Illuminate\Broadcasting\Channel|\Illuminate\Contracts\Broadcasting\HasBroadcastChannel|array|null $channels - * @return \Illuminate\Broadcasting\PendingBroadcast - */ - public function broadcastUpdated($channels = null) - { - return $this->broadcastIfBroadcastChannelsExistForEvent( - $this->newBroadcastableModelEvent('updated'), 'updated', $channels - ); - } - - /** - * Broadcast that the model was trashed. - * - * @param \Illuminate\Broadcasting\Channel|\Illuminate\Contracts\Broadcasting\HasBroadcastChannel|array|null $channels - * @return \Illuminate\Broadcasting\PendingBroadcast - */ - public function broadcastTrashed($channels = null) - { - return $this->broadcastIfBroadcastChannelsExistForEvent( - $this->newBroadcastableModelEvent('trashed'), 'trashed', $channels - ); - } - - /** - * Broadcast that the model was restored. - * - * @param \Illuminate\Broadcasting\Channel|\Illuminate\Contracts\Broadcasting\HasBroadcastChannel|array|null $channels - * @return \Illuminate\Broadcasting\PendingBroadcast - */ - public function broadcastRestored($channels = null) - { - return $this->broadcastIfBroadcastChannelsExistForEvent( - $this->newBroadcastableModelEvent('restored'), 'restored', $channels - ); - } - - /** - * Broadcast that the model was deleted. - * - * @param \Illuminate\Broadcasting\Channel|\Illuminate\Contracts\Broadcasting\HasBroadcastChannel|array|null $channels - * @return \Illuminate\Broadcasting\PendingBroadcast - */ - public function broadcastDeleted($channels = null) - { - return $this->broadcastIfBroadcastChannelsExistForEvent( - $this->newBroadcastableModelEvent('deleted'), 'deleted', $channels - ); - } - - /** - * Broadcast the given event instance if channels are configured for the model event. - * - * @param mixed $instance - * @param string $event - * @param mixed $channels - * @return \Illuminate\Broadcasting\PendingBroadcast|null - */ - protected function broadcastIfBroadcastChannelsExistForEvent($instance, $event, $channels = null) - { - if (! static::$isBroadcasting) { - return; - } - - if (! empty($this->broadcastOn($event)) || ! empty($channels)) { - return broadcast($instance->onChannels(Arr::wrap($channels))); - } - } - - /** - * Create a new broadcastable model event event. - * - * @param string $event - * @return mixed - */ - public function newBroadcastableModelEvent($event) - { - return tap($this->newBroadcastableEvent($event), function ($event) { - $event->connection = property_exists($this, 'broadcastConnection') - ? $this->broadcastConnection - : $this->broadcastConnection(); - - $event->queue = property_exists($this, 'broadcastQueue') - ? $this->broadcastQueue - : $this->broadcastQueue(); - - $event->afterCommit = property_exists($this, 'broadcastAfterCommit') - ? $this->broadcastAfterCommit - : $this->broadcastAfterCommit(); - }); - } - - /** - * Create a new broadcastable model event for the model. - * - * @param string $event - * @return \Illuminate\Database\Eloquent\BroadcastableModelEventOccurred - */ - protected function newBroadcastableEvent($event) - { - return new BroadcastableModelEventOccurred($this, $event); - } - - /** - * Get the channels that model events should broadcast on. - * - * @param string $event - * @return \Illuminate\Broadcasting\Channel|array - */ - public function broadcastOn($event) - { - return [$this]; - } - - /** - * Get the queue connection that should be used to broadcast model events. - * - * @return string|null - */ - public function broadcastConnection() - { - // - } - - /** - * Get the queue that should be used to broadcast model events. - * - * @return string|null - */ - public function broadcastQueue() - { - // - } - - /** - * Determine if the model event broadcast queued job should be dispatched after all transactions are committed. - * - * @return bool - */ - public function broadcastAfterCommit() - { - return false; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php deleted file mode 100755 index a5f67146..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php +++ /dev/null @@ -1,1944 +0,0 @@ -query = $query; - } - - /** - * Create and return an un-saved model instance. - * - * @param array $attributes - * @return \Illuminate\Database\Eloquent\Model|static - */ - public function make(array $attributes = []) - { - return $this->newModelInstance($attributes); - } - - /** - * Register a new global scope. - * - * @param string $identifier - * @param \Illuminate\Database\Eloquent\Scope|\Closure $scope - * @return $this - */ - public function withGlobalScope($identifier, $scope) - { - $this->scopes[$identifier] = $scope; - - if (method_exists($scope, 'extend')) { - $scope->extend($this); - } - - return $this; - } - - /** - * Remove a registered global scope. - * - * @param \Illuminate\Database\Eloquent\Scope|string $scope - * @return $this - */ - public function withoutGlobalScope($scope) - { - if (! is_string($scope)) { - $scope = get_class($scope); - } - - unset($this->scopes[$scope]); - - $this->removedScopes[] = $scope; - - return $this; - } - - /** - * Remove all or passed registered global scopes. - * - * @param array|null $scopes - * @return $this - */ - public function withoutGlobalScopes(array $scopes = null) - { - if (! is_array($scopes)) { - $scopes = array_keys($this->scopes); - } - - foreach ($scopes as $scope) { - $this->withoutGlobalScope($scope); - } - - return $this; - } - - /** - * Get an array of global scopes that were removed from the query. - * - * @return array - */ - public function removedScopes() - { - return $this->removedScopes; - } - - /** - * Add a where clause on the primary key to the query. - * - * @param mixed $id - * @return $this - */ - public function whereKey($id) - { - if ($id instanceof Model) { - $id = $id->getKey(); - } - - if (is_array($id) || $id instanceof Arrayable) { - $this->query->whereIn($this->model->getQualifiedKeyName(), $id); - - return $this; - } - - if ($id !== null && $this->model->getKeyType() === 'string') { - $id = (string) $id; - } - - return $this->where($this->model->getQualifiedKeyName(), '=', $id); - } - - /** - * Add a where clause on the primary key to the query. - * - * @param mixed $id - * @return $this - */ - public function whereKeyNot($id) - { - if ($id instanceof Model) { - $id = $id->getKey(); - } - - if (is_array($id) || $id instanceof Arrayable) { - $this->query->whereNotIn($this->model->getQualifiedKeyName(), $id); - - return $this; - } - - if ($id !== null && $this->model->getKeyType() === 'string') { - $id = (string) $id; - } - - return $this->where($this->model->getQualifiedKeyName(), '!=', $id); - } - - /** - * Add a basic where clause to the query. - * - * @param \Closure|string|array|\Illuminate\Database\Query\Expression $column - * @param mixed $operator - * @param mixed $value - * @param string $boolean - * @return $this - */ - public function where($column, $operator = null, $value = null, $boolean = 'and') - { - if ($column instanceof Closure && is_null($operator)) { - $column($query = $this->model->newQueryWithoutRelationships()); - - $this->query->addNestedWhereQuery($query->getQuery(), $boolean); - } else { - $this->query->where(...func_get_args()); - } - - return $this; - } - - /** - * Add a basic where clause to the query, and return the first result. - * - * @param \Closure|string|array|\Illuminate\Database\Query\Expression $column - * @param mixed $operator - * @param mixed $value - * @param string $boolean - * @return \Illuminate\Database\Eloquent\Model|static|null - */ - public function firstWhere($column, $operator = null, $value = null, $boolean = 'and') - { - return $this->where(...func_get_args())->first(); - } - - /** - * Add an "or where" clause to the query. - * - * @param \Closure|array|string|\Illuminate\Database\Query\Expression $column - * @param mixed $operator - * @param mixed $value - * @return $this - */ - public function orWhere($column, $operator = null, $value = null) - { - [$value, $operator] = $this->query->prepareValueAndOperator( - $value, $operator, func_num_args() === 2 - ); - - return $this->where($column, $operator, $value, 'or'); - } - - /** - * Add a basic "where not" clause to the query. - * - * @param \Closure|string|array|\Illuminate\Database\Query\Expression $column - * @param mixed $operator - * @param mixed $value - * @param string $boolean - * @return $this - */ - public function whereNot($column, $operator = null, $value = null, $boolean = 'and') - { - return $this->where($column, $operator, $value, $boolean.' not'); - } - - /** - * Add an "or where not" clause to the query. - * - * @param \Closure|array|string|\Illuminate\Database\Query\Expression $column - * @param mixed $operator - * @param mixed $value - * @return $this - */ - public function orWhereNot($column, $operator = null, $value = null) - { - return $this->whereNot($column, $operator, $value, 'or'); - } - - /** - * Add an "order by" clause for a timestamp to the query. - * - * @param string|\Illuminate\Database\Query\Expression $column - * @return $this - */ - public function latest($column = null) - { - if (is_null($column)) { - $column = $this->model->getCreatedAtColumn() ?? 'created_at'; - } - - $this->query->latest($column); - - return $this; - } - - /** - * Add an "order by" clause for a timestamp to the query. - * - * @param string|\Illuminate\Database\Query\Expression $column - * @return $this - */ - public function oldest($column = null) - { - if (is_null($column)) { - $column = $this->model->getCreatedAtColumn() ?? 'created_at'; - } - - $this->query->oldest($column); - - return $this; - } - - /** - * Create a collection of models from plain arrays. - * - * @param array $items - * @return \Illuminate\Database\Eloquent\Collection - */ - public function hydrate(array $items) - { - $instance = $this->newModelInstance(); - - return $instance->newCollection(array_map(function ($item) use ($items, $instance) { - $model = $instance->newFromBuilder($item); - - if (count($items) > 1) { - $model->preventsLazyLoading = Model::preventsLazyLoading(); - } - - return $model; - }, $items)); - } - - /** - * Create a collection of models from a raw query. - * - * @param string $query - * @param array $bindings - * @return \Illuminate\Database\Eloquent\Collection - */ - public function fromQuery($query, $bindings = []) - { - return $this->hydrate( - $this->query->getConnection()->select($query, $bindings) - ); - } - - /** - * Find a model by its primary key. - * - * @param mixed $id - * @param array|string $columns - * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection|static[]|static|null - */ - public function find($id, $columns = ['*']) - { - if (is_array($id) || $id instanceof Arrayable) { - return $this->findMany($id, $columns); - } - - return $this->whereKey($id)->first($columns); - } - - /** - * Find multiple models by their primary keys. - * - * @param \Illuminate\Contracts\Support\Arrayable|array $ids - * @param array|string $columns - * @return \Illuminate\Database\Eloquent\Collection - */ - public function findMany($ids, $columns = ['*']) - { - $ids = $ids instanceof Arrayable ? $ids->toArray() : $ids; - - if (empty($ids)) { - return $this->model->newCollection(); - } - - return $this->whereKey($ids)->get($columns); - } - - /** - * Find a model by its primary key or throw an exception. - * - * @param mixed $id - * @param array|string $columns - * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection|static|static[] - * - * @throws \Illuminate\Database\Eloquent\ModelNotFoundException<\Illuminate\Database\Eloquent\Model> - */ - public function findOrFail($id, $columns = ['*']) - { - $result = $this->find($id, $columns); - - $id = $id instanceof Arrayable ? $id->toArray() : $id; - - if (is_array($id)) { - if (count($result) !== count(array_unique($id))) { - throw (new ModelNotFoundException)->setModel( - get_class($this->model), array_diff($id, $result->modelKeys()) - ); - } - - return $result; - } - - if (is_null($result)) { - throw (new ModelNotFoundException)->setModel( - get_class($this->model), $id - ); - } - - return $result; - } - - /** - * Find a model by its primary key or return fresh model instance. - * - * @param mixed $id - * @param array|string $columns - * @return \Illuminate\Database\Eloquent\Model|static - */ - public function findOrNew($id, $columns = ['*']) - { - if (! is_null($model = $this->find($id, $columns))) { - return $model; - } - - return $this->newModelInstance(); - } - - /** - * Find a model by its primary key or call a callback. - * - * @param mixed $id - * @param \Closure|array|string $columns - * @param \Closure|null $callback - * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection|static[]|static|mixed - */ - public function findOr($id, $columns = ['*'], Closure $callback = null) - { - if ($columns instanceof Closure) { - $callback = $columns; - - $columns = ['*']; - } - - if (! is_null($model = $this->find($id, $columns))) { - return $model; - } - - return $callback(); - } - - /** - * Get the first record matching the attributes or instantiate it. - * - * @param array $attributes - * @param array $values - * @return \Illuminate\Database\Eloquent\Model|static - */ - public function firstOrNew(array $attributes = [], array $values = []) - { - if (! is_null($instance = $this->where($attributes)->first())) { - return $instance; - } - - return $this->newModelInstance(array_merge($attributes, $values)); - } - - /** - * Get the first record matching the attributes or create it. - * - * @param array $attributes - * @param array $values - * @return \Illuminate\Database\Eloquent\Model|static - */ - public function firstOrCreate(array $attributes = [], array $values = []) - { - if (! is_null($instance = $this->where($attributes)->first())) { - return $instance; - } - - return tap($this->newModelInstance(array_merge($attributes, $values)), function ($instance) { - $instance->save(); - }); - } - - /** - * Create or update a record matching the attributes, and fill it with values. - * - * @param array $attributes - * @param array $values - * @return \Illuminate\Database\Eloquent\Model|static - */ - public function updateOrCreate(array $attributes, array $values = []) - { - return tap($this->firstOrNew($attributes), function ($instance) use ($values) { - $instance->fill($values)->save(); - }); - } - - /** - * Execute the query and get the first result or throw an exception. - * - * @param array|string $columns - * @return \Illuminate\Database\Eloquent\Model|static - * - * @throws \Illuminate\Database\Eloquent\ModelNotFoundException<\Illuminate\Database\Eloquent\Model> - */ - public function firstOrFail($columns = ['*']) - { - if (! is_null($model = $this->first($columns))) { - return $model; - } - - throw (new ModelNotFoundException)->setModel(get_class($this->model)); - } - - /** - * Execute the query and get the first result or call a callback. - * - * @param \Closure|array|string $columns - * @param \Closure|null $callback - * @return \Illuminate\Database\Eloquent\Model|static|mixed - */ - public function firstOr($columns = ['*'], Closure $callback = null) - { - if ($columns instanceof Closure) { - $callback = $columns; - - $columns = ['*']; - } - - if (! is_null($model = $this->first($columns))) { - return $model; - } - - return $callback(); - } - - /** - * Execute the query and get the first result if it's the sole matching record. - * - * @param array|string $columns - * @return \Illuminate\Database\Eloquent\Model - * - * @throws \Illuminate\Database\Eloquent\ModelNotFoundException<\Illuminate\Database\Eloquent\Model> - * @throws \Illuminate\Database\MultipleRecordsFoundException - */ - public function sole($columns = ['*']) - { - try { - return $this->baseSole($columns); - } catch (RecordsNotFoundException $exception) { - throw (new ModelNotFoundException)->setModel(get_class($this->model)); - } - } - - /** - * Get a single column's value from the first result of a query. - * - * @param string|\Illuminate\Database\Query\Expression $column - * @return mixed - */ - public function value($column) - { - if ($result = $this->first([$column])) { - return $result->{Str::afterLast($column, '.')}; - } - } - - /** - * Get a single column's value from the first result of a query if it's the sole matching record. - * - * @param string|\Illuminate\Database\Query\Expression $column - * @return mixed - * - * @throws \Illuminate\Database\Eloquent\ModelNotFoundException<\Illuminate\Database\Eloquent\Model> - * @throws \Illuminate\Database\MultipleRecordsFoundException - */ - public function soleValue($column) - { - return $this->sole([$column])->{Str::afterLast($column, '.')}; - } - - /** - * Get a single column's value from the first result of the query or throw an exception. - * - * @param string|\Illuminate\Database\Query\Expression $column - * @return mixed - * - * @throws \Illuminate\Database\Eloquent\ModelNotFoundException<\Illuminate\Database\Eloquent\Model> - */ - public function valueOrFail($column) - { - return $this->firstOrFail([$column])->{Str::afterLast($column, '.')}; - } - - /** - * Execute the query as a "select" statement. - * - * @param array|string $columns - * @return \Illuminate\Database\Eloquent\Collection|static[] - */ - public function get($columns = ['*']) - { - $builder = $this->applyScopes(); - - // If we actually found models we will also eager load any relationships that - // have been specified as needing to be eager loaded, which will solve the - // n+1 query issue for the developers to avoid running a lot of queries. - if (count($models = $builder->getModels($columns)) > 0) { - $models = $builder->eagerLoadRelations($models); - } - - return $builder->getModel()->newCollection($models); - } - - /** - * Get the hydrated models without eager loading. - * - * @param array|string $columns - * @return \Illuminate\Database\Eloquent\Model[]|static[] - */ - public function getModels($columns = ['*']) - { - return $this->model->hydrate( - $this->query->get($columns)->all() - )->all(); - } - - /** - * Eager load the relationships for the models. - * - * @param array $models - * @return array - */ - public function eagerLoadRelations(array $models) - { - foreach ($this->eagerLoad as $name => $constraints) { - // For nested eager loads we'll skip loading them here and they will be set as an - // eager load on the query to retrieve the relation so that they will be eager - // loaded on that query, because that is where they get hydrated as models. - if (! str_contains($name, '.')) { - $models = $this->eagerLoadRelation($models, $name, $constraints); - } - } - - return $models; - } - - /** - * Eagerly load the relationship on a set of models. - * - * @param array $models - * @param string $name - * @param \Closure $constraints - * @return array - */ - protected function eagerLoadRelation(array $models, $name, Closure $constraints) - { - // First we will "back up" the existing where conditions on the query so we can - // add our eager constraints. Then we will merge the wheres that were on the - // query back to it in order that any where conditions might be specified. - $relation = $this->getRelation($name); - - $relation->addEagerConstraints($models); - - $constraints($relation); - - // Once we have the results, we just match those back up to their parent models - // using the relationship instance. Then we just return the finished arrays - // of models which have been eagerly hydrated and are readied for return. - return $relation->match( - $relation->initRelation($models, $name), - $relation->getEager(), $name - ); - } - - /** - * Get the relation instance for the given relation name. - * - * @param string $name - * @return \Illuminate\Database\Eloquent\Relations\Relation - */ - public function getRelation($name) - { - // We want to run a relationship query without any constrains so that we will - // not have to remove these where clauses manually which gets really hacky - // and error prone. We don't want constraints because we add eager ones. - $relation = Relation::noConstraints(function () use ($name) { - try { - return $this->getModel()->newInstance()->$name(); - } catch (BadMethodCallException $e) { - throw RelationNotFoundException::make($this->getModel(), $name); - } - }); - - $nested = $this->relationsNestedUnder($name); - - // If there are nested relationships set on the query, we will put those onto - // the query instances so that they can be handled after this relationship - // is loaded. In this way they will all trickle down as they are loaded. - if (count($nested) > 0) { - $relation->getQuery()->with($nested); - } - - return $relation; - } - - /** - * Get the deeply nested relations for a given top-level relation. - * - * @param string $relation - * @return array - */ - protected function relationsNestedUnder($relation) - { - $nested = []; - - // We are basically looking for any relationships that are nested deeper than - // the given top-level relationship. We will just check for any relations - // that start with the given top relations and adds them to our arrays. - foreach ($this->eagerLoad as $name => $constraints) { - if ($this->isNestedUnder($relation, $name)) { - $nested[substr($name, strlen($relation.'.'))] = $constraints; - } - } - - return $nested; - } - - /** - * Determine if the relationship is nested. - * - * @param string $relation - * @param string $name - * @return bool - */ - protected function isNestedUnder($relation, $name) - { - return str_contains($name, '.') && str_starts_with($name, $relation.'.'); - } - - /** - * Get a lazy collection for the given query. - * - * @return \Illuminate\Support\LazyCollection - */ - public function cursor() - { - return $this->applyScopes()->query->cursor()->map(function ($record) { - return $this->newModelInstance()->newFromBuilder($record); - }); - } - - /** - * Add a generic "order by" clause if the query doesn't already have one. - * - * @return void - */ - protected function enforceOrderBy() - { - if (empty($this->query->orders) && empty($this->query->unionOrders)) { - $this->orderBy($this->model->getQualifiedKeyName(), 'asc'); - } - } - - /** - * Get an array with the values of a given column. - * - * @param string|\Illuminate\Database\Query\Expression $column - * @param string|null $key - * @return \Illuminate\Support\Collection - */ - public function pluck($column, $key = null) - { - $results = $this->toBase()->pluck($column, $key); - - // If the model has a mutator for the requested column, we will spin through - // the results and mutate the values so that the mutated version of these - // columns are returned as you would expect from these Eloquent models. - if (! $this->model->hasGetMutator($column) && - ! $this->model->hasCast($column) && - ! in_array($column, $this->model->getDates())) { - return $results; - } - - return $results->map(function ($value) use ($column) { - return $this->model->newFromBuilder([$column => $value])->{$column}; - }); - } - - /** - * Paginate the given query. - * - * @param int|null|\Closure $perPage - * @param array|string $columns - * @param string $pageName - * @param int|null $page - * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator - * - * @throws \InvalidArgumentException - */ - public function paginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) - { - $page = $page ?: Paginator::resolveCurrentPage($pageName); - - $total = $this->toBase()->getCountForPagination(); - - $perPage = ($perPage instanceof Closure - ? $perPage($total) - : $perPage - ) ?: $this->model->getPerPage(); - - $results = $total - ? $this->forPage($page, $perPage)->get($columns) - : $this->model->newCollection(); - - return $this->paginator($results, $total, $perPage, $page, [ - 'path' => Paginator::resolveCurrentPath(), - 'pageName' => $pageName, - ]); - } - - /** - * Paginate the given query into a simple paginator. - * - * @param int|null $perPage - * @param array|string $columns - * @param string $pageName - * @param int|null $page - * @return \Illuminate\Contracts\Pagination\Paginator - */ - public function simplePaginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) - { - $page = $page ?: Paginator::resolveCurrentPage($pageName); - - $perPage = $perPage ?: $this->model->getPerPage(); - - // Next we will set the limit and offset for this query so that when we get the - // results we get the proper section of results. Then, we'll create the full - // paginator instances for these results with the given page and per page. - $this->skip(($page - 1) * $perPage)->take($perPage + 1); - - return $this->simplePaginator($this->get($columns), $perPage, $page, [ - 'path' => Paginator::resolveCurrentPath(), - 'pageName' => $pageName, - ]); - } - - /** - * Paginate the given query into a cursor paginator. - * - * @param int|null $perPage - * @param array|string $columns - * @param string $cursorName - * @param \Illuminate\Pagination\Cursor|string|null $cursor - * @return \Illuminate\Contracts\Pagination\CursorPaginator - */ - public function cursorPaginate($perPage = null, $columns = ['*'], $cursorName = 'cursor', $cursor = null) - { - $perPage = $perPage ?: $this->model->getPerPage(); - - return $this->paginateUsingCursor($perPage, $columns, $cursorName, $cursor); - } - - /** - * Ensure the proper order by required for cursor pagination. - * - * @param bool $shouldReverse - * @return \Illuminate\Support\Collection - */ - protected function ensureOrderForCursorPagination($shouldReverse = false) - { - if (empty($this->query->orders) && empty($this->query->unionOrders)) { - $this->enforceOrderBy(); - } - - if ($shouldReverse) { - $this->query->orders = collect($this->query->orders)->map(function ($order) { - $order['direction'] = $order['direction'] === 'asc' ? 'desc' : 'asc'; - - return $order; - })->toArray(); - } - - if ($this->query->unionOrders) { - return collect($this->query->unionOrders); - } - - return collect($this->query->orders); - } - - /** - * Save a new model and return the instance. - * - * @param array $attributes - * @return \Illuminate\Database\Eloquent\Model|$this - */ - public function create(array $attributes = []) - { - return tap($this->newModelInstance($attributes), function ($instance) { - $instance->save(); - }); - } - - /** - * Save a new model and return the instance. Allow mass-assignment. - * - * @param array $attributes - * @return \Illuminate\Database\Eloquent\Model|$this - */ - public function forceCreate(array $attributes) - { - return $this->model->unguarded(function () use ($attributes) { - return $this->newModelInstance()->create($attributes); - }); - } - - /** - * Update records in the database. - * - * @param array $values - * @return int - */ - public function update(array $values) - { - return $this->toBase()->update($this->addUpdatedAtColumn($values)); - } - - /** - * Insert new records or update the existing ones. - * - * @param array $values - * @param array|string $uniqueBy - * @param array|null $update - * @return int - */ - public function upsert(array $values, $uniqueBy, $update = null) - { - if (empty($values)) { - return 0; - } - - if (! is_array(reset($values))) { - $values = [$values]; - } - - if (is_null($update)) { - $update = array_keys(reset($values)); - } - - return $this->toBase()->upsert( - $this->addTimestampsToUpsertValues($values), - $uniqueBy, - $this->addUpdatedAtToUpsertColumns($update) - ); - } - - /** - * Update the column's update timestamp. - * - * @param string|null $column - * @return int|false - */ - public function touch($column = null) - { - $time = $this->model->freshTimestamp(); - - if ($column) { - return $this->toBase()->update([$column => $time]); - } - - $column = $this->model->getUpdatedAtColumn(); - - if (! $this->model->usesTimestamps() || is_null($column)) { - return false; - } - - return $this->toBase()->update([$column => $time]); - } - - /** - * Increment a column's value by a given amount. - * - * @param string|\Illuminate\Database\Query\Expression $column - * @param float|int $amount - * @param array $extra - * @return int - */ - public function increment($column, $amount = 1, array $extra = []) - { - return $this->toBase()->increment( - $column, $amount, $this->addUpdatedAtColumn($extra) - ); - } - - /** - * Decrement a column's value by a given amount. - * - * @param string|\Illuminate\Database\Query\Expression $column - * @param float|int $amount - * @param array $extra - * @return int - */ - public function decrement($column, $amount = 1, array $extra = []) - { - return $this->toBase()->decrement( - $column, $amount, $this->addUpdatedAtColumn($extra) - ); - } - - /** - * Add the "updated at" column to an array of values. - * - * @param array $values - * @return array - */ - protected function addUpdatedAtColumn(array $values) - { - if (! $this->model->usesTimestamps() || - is_null($this->model->getUpdatedAtColumn())) { - return $values; - } - - $column = $this->model->getUpdatedAtColumn(); - - $values = array_merge( - [$column => $this->model->freshTimestampString()], - $values - ); - - $segments = preg_split('/\s+as\s+/i', $this->query->from); - - $qualifiedColumn = end($segments).'.'.$column; - - $values[$qualifiedColumn] = Arr::get($values, $qualifiedColumn, $values[$column]); - - unset($values[$column]); - - return $values; - } - - /** - * Add timestamps to the inserted values. - * - * @param array $values - * @return array - */ - protected function addTimestampsToUpsertValues(array $values) - { - if (! $this->model->usesTimestamps()) { - return $values; - } - - $timestamp = $this->model->freshTimestampString(); - - $columns = array_filter([ - $this->model->getCreatedAtColumn(), - $this->model->getUpdatedAtColumn(), - ]); - - foreach ($columns as $column) { - foreach ($values as &$row) { - $row = array_merge([$column => $timestamp], $row); - } - } - - return $values; - } - - /** - * Add the "updated at" column to the updated columns. - * - * @param array $update - * @return array - */ - protected function addUpdatedAtToUpsertColumns(array $update) - { - if (! $this->model->usesTimestamps()) { - return $update; - } - - $column = $this->model->getUpdatedAtColumn(); - - if (! is_null($column) && - ! array_key_exists($column, $update) && - ! in_array($column, $update)) { - $update[] = $column; - } - - return $update; - } - - /** - * Delete records from the database. - * - * @return mixed - */ - public function delete() - { - if (isset($this->onDelete)) { - return call_user_func($this->onDelete, $this); - } - - return $this->toBase()->delete(); - } - - /** - * Run the default delete function on the builder. - * - * Since we do not apply scopes here, the row will actually be deleted. - * - * @return mixed - */ - public function forceDelete() - { - return $this->query->delete(); - } - - /** - * Register a replacement for the default delete function. - * - * @param \Closure $callback - * @return void - */ - public function onDelete(Closure $callback) - { - $this->onDelete = $callback; - } - - /** - * Determine if the given model has a scope. - * - * @param string $scope - * @return bool - */ - public function hasNamedScope($scope) - { - return $this->model && $this->model->hasNamedScope($scope); - } - - /** - * Call the given local model scopes. - * - * @param array|string $scopes - * @return static|mixed - */ - public function scopes($scopes) - { - $builder = $this; - - foreach (Arr::wrap($scopes) as $scope => $parameters) { - // If the scope key is an integer, then the scope was passed as the value and - // the parameter list is empty, so we will format the scope name and these - // parameters here. Then, we'll be ready to call the scope on the model. - if (is_int($scope)) { - [$scope, $parameters] = [$parameters, []]; - } - - // Next we'll pass the scope callback to the callScope method which will take - // care of grouping the "wheres" properly so the logical order doesn't get - // messed up when adding scopes. Then we'll return back out the builder. - $builder = $builder->callNamedScope( - $scope, Arr::wrap($parameters) - ); - } - - return $builder; - } - - /** - * Apply the scopes to the Eloquent builder instance and return it. - * - * @return static - */ - public function applyScopes() - { - if (! $this->scopes) { - return $this; - } - - $builder = clone $this; - - foreach ($this->scopes as $identifier => $scope) { - if (! isset($builder->scopes[$identifier])) { - continue; - } - - $builder->callScope(function (self $builder) use ($scope) { - // If the scope is a Closure we will just go ahead and call the scope with the - // builder instance. The "callScope" method will properly group the clauses - // that are added to this query so "where" clauses maintain proper logic. - if ($scope instanceof Closure) { - $scope($builder); - } - - // If the scope is a scope object, we will call the apply method on this scope - // passing in the builder and the model instance. After we run all of these - // scopes we will return back the builder instance to the outside caller. - if ($scope instanceof Scope) { - $scope->apply($builder, $this->getModel()); - } - }); - } - - return $builder; - } - - /** - * Apply the given scope on the current builder instance. - * - * @param callable $scope - * @param array $parameters - * @return mixed - */ - protected function callScope(callable $scope, array $parameters = []) - { - array_unshift($parameters, $this); - - $query = $this->getQuery(); - - // We will keep track of how many wheres are on the query before running the - // scope so that we can properly group the added scope constraints in the - // query as their own isolated nested where statement and avoid issues. - $originalWhereCount = is_null($query->wheres) - ? 0 : count($query->wheres); - - $result = $scope(...$parameters) ?? $this; - - if (count((array) $query->wheres) > $originalWhereCount) { - $this->addNewWheresWithinGroup($query, $originalWhereCount); - } - - return $result; - } - - /** - * Apply the given named scope on the current builder instance. - * - * @param string $scope - * @param array $parameters - * @return mixed - */ - protected function callNamedScope($scope, array $parameters = []) - { - return $this->callScope(function (...$parameters) use ($scope) { - return $this->model->callNamedScope($scope, $parameters); - }, $parameters); - } - - /** - * Nest where conditions by slicing them at the given where count. - * - * @param \Illuminate\Database\Query\Builder $query - * @param int $originalWhereCount - * @return void - */ - protected function addNewWheresWithinGroup(QueryBuilder $query, $originalWhereCount) - { - // Here, we totally remove all of the where clauses since we are going to - // rebuild them as nested queries by slicing the groups of wheres into - // their own sections. This is to prevent any confusing logic order. - $allWheres = $query->wheres; - - $query->wheres = []; - - $this->groupWhereSliceForScope( - $query, array_slice($allWheres, 0, $originalWhereCount) - ); - - $this->groupWhereSliceForScope( - $query, array_slice($allWheres, $originalWhereCount) - ); - } - - /** - * Slice where conditions at the given offset and add them to the query as a nested condition. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $whereSlice - * @return void - */ - protected function groupWhereSliceForScope(QueryBuilder $query, $whereSlice) - { - $whereBooleans = collect($whereSlice)->pluck('boolean'); - - // Here we'll check if the given subset of where clauses contains any "or" - // booleans and in this case create a nested where expression. That way - // we don't add any unnecessary nesting thus keeping the query clean. - if ($whereBooleans->contains('or')) { - $query->wheres[] = $this->createNestedWhere( - $whereSlice, $whereBooleans->first() - ); - } else { - $query->wheres = array_merge($query->wheres, $whereSlice); - } - } - - /** - * Create a where array with nested where conditions. - * - * @param array $whereSlice - * @param string $boolean - * @return array - */ - protected function createNestedWhere($whereSlice, $boolean = 'and') - { - $whereGroup = $this->getQuery()->forNestedWhere(); - - $whereGroup->wheres = $whereSlice; - - return ['type' => 'Nested', 'query' => $whereGroup, 'boolean' => $boolean]; - } - - /** - * Set the relationships that should be eager loaded. - * - * @param string|array $relations - * @param string|\Closure|null $callback - * @return $this - */ - public function with($relations, $callback = null) - { - if ($callback instanceof Closure) { - $eagerLoad = $this->parseWithRelations([$relations => $callback]); - } else { - $eagerLoad = $this->parseWithRelations(is_string($relations) ? func_get_args() : $relations); - } - - $this->eagerLoad = array_merge($this->eagerLoad, $eagerLoad); - - return $this; - } - - /** - * Prevent the specified relations from being eager loaded. - * - * @param mixed $relations - * @return $this - */ - public function without($relations) - { - $this->eagerLoad = array_diff_key($this->eagerLoad, array_flip( - is_string($relations) ? func_get_args() : $relations - )); - - return $this; - } - - /** - * Set the relationships that should be eager loaded while removing any previously added eager loading specifications. - * - * @param mixed $relations - * @return $this - */ - public function withOnly($relations) - { - $this->eagerLoad = []; - - return $this->with($relations); - } - - /** - * Create a new instance of the model being queried. - * - * @param array $attributes - * @return \Illuminate\Database\Eloquent\Model|static - */ - public function newModelInstance($attributes = []) - { - return $this->model->newInstance($attributes)->setConnection( - $this->query->getConnection()->getName() - ); - } - - /** - * Parse a list of relations into individuals. - * - * @param array $relations - * @return array - */ - protected function parseWithRelations(array $relations) - { - if ($relations === []) { - return []; - } - - $results = []; - - foreach ($this->prepareNestedWithRelationships($relations) as $name => $constraints) { - // We need to separate out any nested includes, which allows the developers - // to load deep relationships using "dots" without stating each level of - // the relationship with its own key in the array of eager-load names. - $results = $this->addNestedWiths($name, $results); - - $results[$name] = $constraints; - } - - return $results; - } - - /** - * Prepare nested with relationships. - * - * @param array $relations - * @param string $prefix - * @return array - */ - protected function prepareNestedWithRelationships($relations, $prefix = '') - { - $preparedRelationships = []; - - if ($prefix !== '') { - $prefix .= '.'; - } - - // If any of the relationships are formatted with the [$attribute => array()] - // syntax, we shall loop over the nested relations and prepend each key of - // this array while flattening into the traditional dot notation format. - foreach ($relations as $key => $value) { - if (! is_string($key) || ! is_array($value)) { - continue; - } - - [$attribute, $attributeSelectConstraint] = $this->parseNameAndAttributeSelectionConstraint($key); - - $preparedRelationships = array_merge( - $preparedRelationships, - ["{$prefix}{$attribute}" => $attributeSelectConstraint], - $this->prepareNestedWithRelationships($value, "{$prefix}{$attribute}"), - ); - - unset($relations[$key]); - } - - // We now know that the remaining relationships are in a dot notation format - // and may be a string or Closure. We'll loop over them and ensure all of - // the present Closures are merged + strings are made into constraints. - foreach ($relations as $key => $value) { - if (is_numeric($key) && is_string($value)) { - [$key, $value] = $this->parseNameAndAttributeSelectionConstraint($value); - } - - $preparedRelationships[$prefix.$key] = $this->combineConstraints([ - $value, - $preparedRelationships[$prefix.$key] ?? static function () { - // - }, - ]); - } - - return $preparedRelationships; - } - - /** - * Combine an array of constraints into a single constraint. - * - * @param array $constraints - * @return \Closure - */ - protected function combineConstraints(array $constraints) - { - return function ($builder) use ($constraints) { - foreach ($constraints as $constraint) { - $builder = $constraint($builder) ?? $builder; - } - - return $builder; - }; - } - - /** - * Parse the attribute select constraints from the name. - * - * @param string $name - * @return array - */ - protected function parseNameAndAttributeSelectionConstraint($name) - { - return str_contains($name, ':') - ? $this->createSelectWithConstraint($name) - : [$name, static function () { - // - }]; - } - - /** - * Create a constraint to select the given columns for the relation. - * - * @param string $name - * @return array - */ - protected function createSelectWithConstraint($name) - { - return [explode(':', $name)[0], static function ($query) use ($name) { - $query->select(array_map(static function ($column) use ($query) { - if (str_contains($column, '.')) { - return $column; - } - - return $query instanceof BelongsToMany - ? $query->getRelated()->getTable().'.'.$column - : $column; - }, explode(',', explode(':', $name)[1]))); - }]; - } - - /** - * Parse the nested relationships in a relation. - * - * @param string $name - * @param array $results - * @return array - */ - protected function addNestedWiths($name, $results) - { - $progress = []; - - // If the relation has already been set on the result array, we will not set it - // again, since that would override any constraints that were already placed - // on the relationships. We will only set the ones that are not specified. - foreach (explode('.', $name) as $segment) { - $progress[] = $segment; - - if (! isset($results[$last = implode('.', $progress)])) { - $results[$last] = static function () { - // - }; - } - } - - return $results; - } - - /** - * Apply query-time casts to the model instance. - * - * @param array $casts - * @return $this - */ - public function withCasts($casts) - { - $this->model->mergeCasts($casts); - - return $this; - } - - /** - * Get the underlying query builder instance. - * - * @return \Illuminate\Database\Query\Builder - */ - public function getQuery() - { - return $this->query; - } - - /** - * Set the underlying query builder instance. - * - * @param \Illuminate\Database\Query\Builder $query - * @return $this - */ - public function setQuery($query) - { - $this->query = $query; - - return $this; - } - - /** - * Get a base query builder instance. - * - * @return \Illuminate\Database\Query\Builder - */ - public function toBase() - { - return $this->applyScopes()->getQuery(); - } - - /** - * Get the relationships being eagerly loaded. - * - * @return array - */ - public function getEagerLoads() - { - return $this->eagerLoad; - } - - /** - * Set the relationships being eagerly loaded. - * - * @param array $eagerLoad - * @return $this - */ - public function setEagerLoads(array $eagerLoad) - { - $this->eagerLoad = $eagerLoad; - - return $this; - } - - /** - * Indicate that the given relationships should not be eagerly loaded. - * - * @param array $relations - * @return $this - */ - public function withoutEagerLoad(array $relations) - { - $relations = array_diff(array_keys($this->model->getRelations()), $relations); - - return $this->with($relations); - } - - /** - * Flush the relationships being eagerly loaded. - * - * @return $this - */ - public function withoutEagerLoads() - { - return $this->setEagerLoads([]); - } - - /** - * Get the default key name of the table. - * - * @return string - */ - protected function defaultKeyName() - { - return $this->getModel()->getKeyName(); - } - - /** - * Get the model instance being queried. - * - * @return \Illuminate\Database\Eloquent\Model|static - */ - public function getModel() - { - return $this->model; - } - - /** - * Set a model instance for the model being queried. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @return $this - */ - public function setModel(Model $model) - { - $this->model = $model; - - $this->query->from($model->getTable()); - - return $this; - } - - /** - * Qualify the given column name by the model's table. - * - * @param string|\Illuminate\Database\Query\Expression $column - * @return string - */ - public function qualifyColumn($column) - { - return $this->model->qualifyColumn($column); - } - - /** - * Qualify the given columns with the model's table. - * - * @param array|\Illuminate\Database\Query\Expression $columns - * @return array - */ - public function qualifyColumns($columns) - { - return $this->model->qualifyColumns($columns); - } - - /** - * Get the given macro by name. - * - * @param string $name - * @return \Closure - */ - public function getMacro($name) - { - return Arr::get($this->localMacros, $name); - } - - /** - * Checks if a macro is registered. - * - * @param string $name - * @return bool - */ - public function hasMacro($name) - { - return isset($this->localMacros[$name]); - } - - /** - * Get the given global macro by name. - * - * @param string $name - * @return \Closure - */ - public static function getGlobalMacro($name) - { - return Arr::get(static::$macros, $name); - } - - /** - * Checks if a global macro is registered. - * - * @param string $name - * @return bool - */ - public static function hasGlobalMacro($name) - { - return isset(static::$macros[$name]); - } - - /** - * Dynamically access builder proxies. - * - * @param string $key - * @return mixed - * - * @throws \Exception - */ - public function __get($key) - { - if (in_array($key, ['orWhere', 'whereNot', 'orWhereNot'])) { - return new HigherOrderBuilderProxy($this, $key); - } - - if (in_array($key, $this->propertyPassthru)) { - return $this->toBase()->{$key}; - } - - throw new Exception("Property [{$key}] does not exist on the Eloquent builder instance."); - } - - /** - * Dynamically handle calls into the query instance. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - if ($method === 'macro') { - $this->localMacros[$parameters[0]] = $parameters[1]; - - return; - } - - if ($this->hasMacro($method)) { - array_unshift($parameters, $this); - - return $this->localMacros[$method](...$parameters); - } - - if (static::hasGlobalMacro($method)) { - $callable = static::$macros[$method]; - - if ($callable instanceof Closure) { - $callable = $callable->bindTo($this, static::class); - } - - return $callable(...$parameters); - } - - if ($this->hasNamedScope($method)) { - return $this->callNamedScope($method, $parameters); - } - - if (in_array($method, $this->passthru)) { - return $this->toBase()->{$method}(...$parameters); - } - - $this->forwardCallTo($this->query, $method, $parameters); - - return $this; - } - - /** - * Dynamically handle calls into the query instance. - * - * @param string $method - * @param array $parameters - * @return mixed - * - * @throws \BadMethodCallException - */ - public static function __callStatic($method, $parameters) - { - if ($method === 'macro') { - static::$macros[$parameters[0]] = $parameters[1]; - - return; - } - - if ($method === 'mixin') { - return static::registerMixin($parameters[0], $parameters[1] ?? true); - } - - if (! static::hasGlobalMacro($method)) { - static::throwBadMethodCallException($method); - } - - $callable = static::$macros[$method]; - - if ($callable instanceof Closure) { - $callable = $callable->bindTo(null, static::class); - } - - return $callable(...$parameters); - } - - /** - * Register the given mixin with the builder. - * - * @param string $mixin - * @param bool $replace - * @return void - */ - protected static function registerMixin($mixin, $replace) - { - $methods = (new ReflectionClass($mixin))->getMethods( - ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PROTECTED - ); - - foreach ($methods as $method) { - if ($replace || ! static::hasGlobalMacro($method->name)) { - $method->setAccessible(true); - - static::macro($method->name, $method->invoke($mixin)); - } - } - } - - /** - * Clone the Eloquent query builder. - * - * @return static - */ - public function clone() - { - return clone $this; - } - - /** - * Force a clone of the underlying query builder when cloning. - * - * @return void - */ - public function __clone() - { - $this->query = clone $this->query; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Casts/ArrayObject.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Casts/ArrayObject.php deleted file mode 100644 index 2da92c33..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Casts/ArrayObject.php +++ /dev/null @@ -1,40 +0,0 @@ -getArrayCopy()); - } - - /** - * Get the instance as an array. - * - * @return array - */ - public function toArray() - { - return $this->getArrayCopy(); - } - - /** - * Get the array that should be JSON serialized. - * - * @return array - */ - public function jsonSerialize(): array - { - return $this->getArrayCopy(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Casts/AsArrayObject.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Casts/AsArrayObject.php deleted file mode 100644 index 34865b15..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Casts/AsArrayObject.php +++ /dev/null @@ -1,42 +0,0 @@ - json_encode($value)]; - } - - public function serialize($model, string $key, $value, array $attributes) - { - return $value->getArrayCopy(); - } - }; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Casts/AsCollection.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Casts/AsCollection.php deleted file mode 100644 index 3456767d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Casts/AsCollection.php +++ /dev/null @@ -1,38 +0,0 @@ - json_encode($value)]; - } - }; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Casts/AsEncryptedArrayObject.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Casts/AsEncryptedArrayObject.php deleted file mode 100644 index cd656246..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Casts/AsEncryptedArrayObject.php +++ /dev/null @@ -1,45 +0,0 @@ - Crypt::encryptString(json_encode($value))]; - } - - return null; - } - - public function serialize($model, string $key, $value, array $attributes) - { - return ! is_null($value) ? $value->getArrayCopy() : null; - } - }; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Casts/AsEncryptedCollection.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Casts/AsEncryptedCollection.php deleted file mode 100644 index 4d9fee7e..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Casts/AsEncryptedCollection.php +++ /dev/null @@ -1,41 +0,0 @@ - Crypt::encryptString(json_encode($value))]; - } - - return null; - } - }; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Casts/AsStringable.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Casts/AsStringable.php deleted file mode 100644 index 912659f3..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Casts/AsStringable.php +++ /dev/null @@ -1,32 +0,0 @@ -get = $get; - $this->set = $set; - } - - /** - * Create a new attribute accessor / mutator. - * - * @param callable|null $get - * @param callable|null $set - * @return static - */ - public static function make(callable $get = null, callable $set = null): static - { - return new static($get, $set); - } - - /** - * Create a new attribute accessor. - * - * @param callable $get - * @return static - */ - public static function get(callable $get) - { - return new static($get); - } - - /** - * Create a new attribute mutator. - * - * @param callable $set - * @return static - */ - public static function set(callable $set) - { - return new static(null, $set); - } - - /** - * Disable object caching for the attribute. - * - * @return static - */ - public function withoutObjectCaching() - { - $this->withObjectCaching = false; - - return $this; - } - - /** - * Enable caching for the attribute. - * - * @return static - */ - public function shouldCache() - { - $this->withCaching = true; - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Collection.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Collection.php deleted file mode 100755 index 8f205aa3..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Collection.php +++ /dev/null @@ -1,779 +0,0 @@ - - */ -class Collection extends BaseCollection implements QueueableCollection -{ - /** - * Find a model in the collection by key. - * - * @template TFindDefault - * - * @param mixed $key - * @param TFindDefault $default - * @return static|TModel|TFindDefault - */ - public function find($key, $default = null) - { - if ($key instanceof Model) { - $key = $key->getKey(); - } - - if ($key instanceof Arrayable) { - $key = $key->toArray(); - } - - if (is_array($key)) { - if ($this->isEmpty()) { - return new static; - } - - return $this->whereIn($this->first()->getKeyName(), $key); - } - - return Arr::first($this->items, function ($model) use ($key) { - return $model->getKey() == $key; - }, $default); - } - - /** - * Load a set of relationships onto the collection. - * - * @param array|string $relations - * @return $this - */ - public function load($relations) - { - if ($this->isNotEmpty()) { - if (is_string($relations)) { - $relations = func_get_args(); - } - - $query = $this->first()->newQueryWithoutRelationships()->with($relations); - - $this->items = $query->eagerLoadRelations($this->items); - } - - return $this; - } - - /** - * Load a set of aggregations over relationship's column onto the collection. - * - * @param array|string $relations - * @param string $column - * @param string|null $function - * @return $this - */ - public function loadAggregate($relations, $column, $function = null) - { - if ($this->isEmpty()) { - return $this; - } - - $models = $this->first()->newModelQuery() - ->whereKey($this->modelKeys()) - ->select($this->first()->getKeyName()) - ->withAggregate($relations, $column, $function) - ->get() - ->keyBy($this->first()->getKeyName()); - - $attributes = Arr::except( - array_keys($models->first()->getAttributes()), - $models->first()->getKeyName() - ); - - $this->each(function ($model) use ($models, $attributes) { - $extraAttributes = Arr::only($models->get($model->getKey())->getAttributes(), $attributes); - - $model->forceFill($extraAttributes) - ->syncOriginalAttributes($attributes) - ->mergeCasts($models->get($model->getKey())->getCasts()); - }); - - return $this; - } - - /** - * Load a set of relationship counts onto the collection. - * - * @param array|string $relations - * @return $this - */ - public function loadCount($relations) - { - return $this->loadAggregate($relations, '*', 'count'); - } - - /** - * Load a set of relationship's max column values onto the collection. - * - * @param array|string $relations - * @param string $column - * @return $this - */ - public function loadMax($relations, $column) - { - return $this->loadAggregate($relations, $column, 'max'); - } - - /** - * Load a set of relationship's min column values onto the collection. - * - * @param array|string $relations - * @param string $column - * @return $this - */ - public function loadMin($relations, $column) - { - return $this->loadAggregate($relations, $column, 'min'); - } - - /** - * Load a set of relationship's column summations onto the collection. - * - * @param array|string $relations - * @param string $column - * @return $this - */ - public function loadSum($relations, $column) - { - return $this->loadAggregate($relations, $column, 'sum'); - } - - /** - * Load a set of relationship's average column values onto the collection. - * - * @param array|string $relations - * @param string $column - * @return $this - */ - public function loadAvg($relations, $column) - { - return $this->loadAggregate($relations, $column, 'avg'); - } - - /** - * Load a set of related existences onto the collection. - * - * @param array|string $relations - * @return $this - */ - public function loadExists($relations) - { - return $this->loadAggregate($relations, '*', 'exists'); - } - - /** - * Load a set of relationships onto the collection if they are not already eager loaded. - * - * @param array|string $relations - * @return $this - */ - public function loadMissing($relations) - { - if (is_string($relations)) { - $relations = func_get_args(); - } - - foreach ($relations as $key => $value) { - if (is_numeric($key)) { - $key = $value; - } - - $segments = explode('.', explode(':', $key)[0]); - - if (str_contains($key, ':')) { - $segments[count($segments) - 1] .= ':'.explode(':', $key)[1]; - } - - $path = []; - - foreach ($segments as $segment) { - $path[] = [$segment => $segment]; - } - - if (is_callable($value)) { - $path[count($segments) - 1][end($segments)] = $value; - } - - $this->loadMissingRelation($this, $path); - } - - return $this; - } - - /** - * Load a relationship path if it is not already eager loaded. - * - * @param \Illuminate\Database\Eloquent\Collection $models - * @param array $path - * @return void - */ - protected function loadMissingRelation(self $models, array $path) - { - $relation = array_shift($path); - - $name = explode(':', key($relation))[0]; - - if (is_string(reset($relation))) { - $relation = reset($relation); - } - - $models->filter(function ($model) use ($name) { - return ! is_null($model) && ! $model->relationLoaded($name); - })->load($relation); - - if (empty($path)) { - return; - } - - $models = $models->pluck($name)->whereNotNull(); - - if ($models->first() instanceof BaseCollection) { - $models = $models->collapse(); - } - - $this->loadMissingRelation(new static($models), $path); - } - - /** - * Load a set of relationships onto the mixed relationship collection. - * - * @param string $relation - * @param array $relations - * @return $this - */ - public function loadMorph($relation, $relations) - { - $this->pluck($relation) - ->filter() - ->groupBy(function ($model) { - return get_class($model); - }) - ->each(function ($models, $className) use ($relations) { - static::make($models)->load($relations[$className] ?? []); - }); - - return $this; - } - - /** - * Load a set of relationship counts onto the mixed relationship collection. - * - * @param string $relation - * @param array $relations - * @return $this - */ - public function loadMorphCount($relation, $relations) - { - $this->pluck($relation) - ->filter() - ->groupBy(function ($model) { - return get_class($model); - }) - ->each(function ($models, $className) use ($relations) { - static::make($models)->loadCount($relations[$className] ?? []); - }); - - return $this; - } - - /** - * Determine if a key exists in the collection. - * - * @param (callable(TModel, TKey): bool)|TModel|string|int $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)) { - return parent::contains(...func_get_args()); - } - - if ($key instanceof Model) { - return parent::contains(function ($model) use ($key) { - return $model->is($key); - }); - } - - return parent::contains(function ($model) use ($key) { - return $model->getKey() == $key; - }); - } - - /** - * Get the array of primary keys. - * - * @return array - */ - public function modelKeys() - { - return array_map(function ($model) { - return $model->getKey(); - }, $this->items); - } - - /** - * Merge the collection with the given items. - * - * @param iterable $items - * @return static - */ - public function merge($items) - { - $dictionary = $this->getDictionary(); - - foreach ($items as $item) { - $dictionary[$item->getKey()] = $item; - } - - return new static(array_values($dictionary)); - } - - /** - * Run a map over each of the items. - * - * @template TMapValue - * - * @param callable(TModel, TKey): TMapValue $callback - * @return \Illuminate\Support\Collection|static - */ - public function map(callable $callback) - { - $result = parent::map($callback); - - return $result->contains(function ($item) { - return ! $item instanceof Model; - }) ? $result->toBase() : $result; - } - - /** - * Run an associative map over each of the items. - * - * The callback should return an associative array with a single key / value pair. - * - * @template TMapWithKeysKey of array-key - * @template TMapWithKeysValue - * - * @param callable(TModel, TKey): array $callback - * @return \Illuminate\Support\Collection|static - */ - public function mapWithKeys(callable $callback) - { - $result = parent::mapWithKeys($callback); - - return $result->contains(function ($item) { - return ! $item instanceof Model; - }) ? $result->toBase() : $result; - } - - /** - * Reload a fresh model instance from the database for all the entities. - * - * @param array|string $with - * @return static - */ - public function fresh($with = []) - { - if ($this->isEmpty()) { - return new static; - } - - $model = $this->first(); - - $freshModels = $model->newQueryWithoutScopes() - ->with(is_string($with) ? func_get_args() : $with) - ->whereIn($model->getKeyName(), $this->modelKeys()) - ->get() - ->getDictionary(); - - return $this->filter(function ($model) use ($freshModels) { - return $model->exists && isset($freshModels[$model->getKey()]); - }) - ->map(function ($model) use ($freshModels) { - return $freshModels[$model->getKey()]; - }); - } - - /** - * Diff the collection with the given items. - * - * @param iterable $items - * @return static - */ - public function diff($items) - { - $diff = new static; - - $dictionary = $this->getDictionary($items); - - foreach ($this->items as $item) { - if (! isset($dictionary[$item->getKey()])) { - $diff->add($item); - } - } - - return $diff; - } - - /** - * Intersect the collection with the given items. - * - * @param iterable $items - * @return static - */ - public function intersect($items) - { - $intersect = new static; - - if (empty($items)) { - return $intersect; - } - - $dictionary = $this->getDictionary($items); - - foreach ($this->items as $item) { - if (isset($dictionary[$item->getKey()])) { - $intersect->add($item); - } - } - - return $intersect; - } - - /** - * Return only unique items from the collection. - * - * @param (callable(TModel, TKey): mixed)|string|null $key - * @param bool $strict - * @return static - */ - public function unique($key = null, $strict = false) - { - if (! is_null($key)) { - return parent::unique($key, $strict); - } - - return new static(array_values($this->getDictionary())); - } - - /** - * Returns only the models from the collection with the specified keys. - * - * @param array|null $keys - * @return static - */ - public function only($keys) - { - if (is_null($keys)) { - return new static($this->items); - } - - $dictionary = Arr::only($this->getDictionary(), $keys); - - return new static(array_values($dictionary)); - } - - /** - * Returns all models in the collection except the models with specified keys. - * - * @param array|null $keys - * @return static - */ - public function except($keys) - { - $dictionary = Arr::except($this->getDictionary(), $keys); - - return new static(array_values($dictionary)); - } - - /** - * Make the given, typically visible, attributes hidden across the entire collection. - * - * @param array|string $attributes - * @return $this - */ - public function makeHidden($attributes) - { - return $this->each->makeHidden($attributes); - } - - /** - * Make the given, typically hidden, attributes visible across the entire collection. - * - * @param array|string $attributes - * @return $this - */ - public function makeVisible($attributes) - { - return $this->each->makeVisible($attributes); - } - - /** - * Append an attribute across the entire collection. - * - * @param array|string $attributes - * @return $this - */ - public function append($attributes) - { - return $this->each->append($attributes); - } - - /** - * Get a dictionary keyed by primary keys. - * - * @param iterable|null $items - * @return array - */ - public function getDictionary($items = null) - { - $items = is_null($items) ? $this->items : $items; - - $dictionary = []; - - foreach ($items as $value) { - $dictionary[$value->getKey()] = $value; - } - - return $dictionary; - } - - /** - * The following methods are intercepted to always return base collections. - */ - - /** - * Get an array with the values of a given key. - * - * @param string|array $value - * @param string|null $key - * @return \Illuminate\Support\Collection - */ - public function pluck($value, $key = null) - { - return $this->toBase()->pluck($value, $key); - } - - /** - * Get the keys of the collection items. - * - * @return \Illuminate\Support\Collection - */ - public function keys() - { - return $this->toBase()->keys(); - } - - /** - * Zip the collection together with one or more arrays. - * - * @template TZipValue - * - * @param \Illuminate\Contracts\Support\Arrayable|iterable ...$items - * @return \Illuminate\Support\Collection> - */ - public function zip($items) - { - return $this->toBase()->zip(...func_get_args()); - } - - /** - * Collapse the collection of items into a single array. - * - * @return \Illuminate\Support\Collection - */ - public function collapse() - { - return $this->toBase()->collapse(); - } - - /** - * Get a flattened array of the items in the collection. - * - * @param int $depth - * @return \Illuminate\Support\Collection - */ - public function flatten($depth = INF) - { - return $this->toBase()->flatten($depth); - } - - /** - * Flip the items in the collection. - * - * @return \Illuminate\Support\Collection - */ - public function flip() - { - return $this->toBase()->flip(); - } - - /** - * Pad collection to the specified length with a value. - * - * @template TPadValue - * - * @param int $size - * @param TPadValue $value - * @return \Illuminate\Support\Collection - */ - public function pad($size, $value) - { - return $this->toBase()->pad($size, $value); - } - - /** - * Get the comparison function to detect duplicates. - * - * @param bool $strict - * @return callable(TValue, TValue): bool - */ - protected function duplicateComparator($strict) - { - return function ($a, $b) { - return $a->is($b); - }; - } - - /** - * Get the type of the entities being queued. - * - * @return string|null - * - * @throws \LogicException - */ - public function getQueueableClass() - { - if ($this->isEmpty()) { - return; - } - - $class = $this->getQueueableModelClass($this->first()); - - $this->each(function ($model) use ($class) { - if ($this->getQueueableModelClass($model) !== $class) { - throw new LogicException('Queueing collections with multiple model types is not supported.'); - } - }); - - return $class; - } - - /** - * Get the queueable class name for the given model. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @return string - */ - protected function getQueueableModelClass($model) - { - return method_exists($model, 'getQueueableClassName') - ? $model->getQueueableClassName() - : get_class($model); - } - - /** - * Get the identifiers for all of the entities. - * - * @return array - */ - public function getQueueableIds() - { - if ($this->isEmpty()) { - return []; - } - - return $this->first() instanceof QueueableEntity - ? $this->map->getQueueableId()->all() - : $this->modelKeys(); - } - - /** - * Get the relationships of the entities being queued. - * - * @return array - */ - public function getQueueableRelations() - { - if ($this->isEmpty()) { - return []; - } - - $relations = $this->map->getQueueableRelations()->all(); - - if (count($relations) === 0 || $relations === [[]]) { - return []; - } elseif (count($relations) === 1) { - return reset($relations); - } else { - return array_intersect(...array_values($relations)); - } - } - - /** - * Get the connection of the entities being queued. - * - * @return string|null - * - * @throws \LogicException - */ - public function getQueueableConnection() - { - if ($this->isEmpty()) { - return; - } - - $connection = $this->first()->getConnectionName(); - - $this->each(function ($model) use ($connection) { - if ($model->getConnectionName() !== $connection) { - throw new LogicException('Queueing collections with multiple model connections is not supported.'); - } - }); - - return $connection; - } - - /** - * Get the Eloquent query builder from the collection. - * - * @return \Illuminate\Database\Eloquent\Builder - * - * @throws \LogicException - */ - public function toQuery() - { - $model = $this->first(); - - if (! $model) { - throw new LogicException('Unable to create query for empty collection.'); - } - - $class = get_class($model); - - if ($this->filter(function ($model) use ($class) { - return ! $model instanceof $class; - })->isNotEmpty()) { - throw new LogicException('Unable to create query for collection with mixed types.'); - } - - return $model->newModelQuery()->whereKey($this->modelKeys()); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php deleted file mode 100644 index bfb67754..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php +++ /dev/null @@ -1,255 +0,0 @@ - - */ - protected $fillable = []; - - /** - * The attributes that aren't mass assignable. - * - * @var array|bool - */ - protected $guarded = ['*']; - - /** - * Indicates if all mass assignment is enabled. - * - * @var bool - */ - protected static $unguarded = false; - - /** - * The actual columns that exist on the database and can be guarded. - * - * @var array - */ - protected static $guardableColumns = []; - - /** - * Get the fillable attributes for the model. - * - * @return array - */ - public function getFillable() - { - return $this->fillable; - } - - /** - * Set the fillable attributes for the model. - * - * @param array $fillable - * @return $this - */ - public function fillable(array $fillable) - { - $this->fillable = $fillable; - - return $this; - } - - /** - * Merge new fillable attributes with existing fillable attributes on the model. - * - * @param array $fillable - * @return $this - */ - public function mergeFillable(array $fillable) - { - $this->fillable = array_merge($this->fillable, $fillable); - - return $this; - } - - /** - * Get the guarded attributes for the model. - * - * @return array - */ - public function getGuarded() - { - return $this->guarded === false - ? [] - : $this->guarded; - } - - /** - * Set the guarded attributes for the model. - * - * @param array $guarded - * @return $this - */ - public function guard(array $guarded) - { - $this->guarded = $guarded; - - return $this; - } - - /** - * Merge new guarded attributes with existing guarded attributes on the model. - * - * @param array $guarded - * @return $this - */ - public function mergeGuarded(array $guarded) - { - $this->guarded = array_merge($this->guarded, $guarded); - - return $this; - } - - /** - * Disable all mass assignable restrictions. - * - * @param bool $state - * @return void - */ - public static function unguard($state = true) - { - static::$unguarded = $state; - } - - /** - * Enable the mass assignment restrictions. - * - * @return void - */ - public static function reguard() - { - static::$unguarded = false; - } - - /** - * Determine if the current state is "unguarded". - * - * @return bool - */ - public static function isUnguarded() - { - return static::$unguarded; - } - - /** - * Run the given callable while being unguarded. - * - * @param callable $callback - * @return mixed - */ - public static function unguarded(callable $callback) - { - if (static::$unguarded) { - return $callback(); - } - - static::unguard(); - - try { - return $callback(); - } finally { - static::reguard(); - } - } - - /** - * Determine if the given attribute may be mass assigned. - * - * @param string $key - * @return bool - */ - public function isFillable($key) - { - if (static::$unguarded) { - return true; - } - - // If the key is in the "fillable" array, we can of course assume that it's - // a fillable attribute. Otherwise, we will check the guarded array when - // we need to determine if the attribute is black-listed on the model. - if (in_array($key, $this->getFillable())) { - return true; - } - - // If the attribute is explicitly listed in the "guarded" array then we can - // return false immediately. This means this attribute is definitely not - // fillable and there is no point in going any further in this method. - if ($this->isGuarded($key)) { - return false; - } - - return empty($this->getFillable()) && - ! str_contains($key, '.') && - ! str_starts_with($key, '_'); - } - - /** - * Determine if the given key is guarded. - * - * @param string $key - * @return bool - */ - public function isGuarded($key) - { - if (empty($this->getGuarded())) { - return false; - } - - return $this->getGuarded() == ['*'] || - ! empty(preg_grep('/^'.preg_quote($key, '/').'$/i', $this->getGuarded())) || - ! $this->isGuardableColumn($key); - } - - /** - * Determine if the given column is a valid, guardable column. - * - * @param string $key - * @return bool - */ - protected function isGuardableColumn($key) - { - if (! isset(static::$guardableColumns[get_class($this)])) { - $columns = $this->getConnection() - ->getSchemaBuilder() - ->getColumnListing($this->getTable()); - - if (empty($columns)) { - return true; - } - static::$guardableColumns[get_class($this)] = $columns; - } - - return in_array($key, static::$guardableColumns[get_class($this)]); - } - - /** - * Determine if the model is totally guarded. - * - * @return bool - */ - public function totallyGuarded() - { - return count($this->getFillable()) === 0 && $this->getGuarded() == ['*']; - } - - /** - * Get the fillable attributes of a given array. - * - * @param array $attributes - * @return array - */ - protected function fillableFromArray(array $attributes) - { - if (count($this->getFillable()) > 0 && ! static::$unguarded) { - return array_intersect_key($attributes, array_flip($this->getFillable())); - } - - return $attributes; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php deleted file mode 100644 index 4b787352..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php +++ /dev/null @@ -1,2218 +0,0 @@ -addDateAttributesToArray( - $attributes = $this->getArrayableAttributes() - ); - - $attributes = $this->addMutatedAttributesToArray( - $attributes, $mutatedAttributes = $this->getMutatedAttributes() - ); - - // Next we will handle any casts that have been setup for this model and cast - // the values to their appropriate type. If the attribute has a mutator we - // will not perform the cast on those attributes to avoid any confusion. - $attributes = $this->addCastAttributesToArray( - $attributes, $mutatedAttributes - ); - - // Here we will grab all of the appended, calculated attributes to this model - // as these attributes are not really in the attributes array, but are run - // when we need to array or JSON the model for convenience to the coder. - foreach ($this->getArrayableAppends() as $key) { - $attributes[$key] = $this->mutateAttributeForArray($key, null); - } - - return $attributes; - } - - /** - * Add the date attributes to the attributes array. - * - * @param array $attributes - * @return array - */ - protected function addDateAttributesToArray(array $attributes) - { - foreach ($this->getDates() as $key) { - if (! isset($attributes[$key])) { - continue; - } - - $attributes[$key] = $this->serializeDate( - $this->asDateTime($attributes[$key]) - ); - } - - return $attributes; - } - - /** - * Add the mutated attributes to the attributes array. - * - * @param array $attributes - * @param array $mutatedAttributes - * @return array - */ - protected function addMutatedAttributesToArray(array $attributes, array $mutatedAttributes) - { - foreach ($mutatedAttributes as $key) { - // We want to spin through all the mutated attributes for this model and call - // the mutator for the attribute. We cache off every mutated attributes so - // we don't have to constantly check on attributes that actually change. - if (! array_key_exists($key, $attributes)) { - continue; - } - - // Next, we will call the mutator for this attribute so that we can get these - // mutated attribute's actual values. After we finish mutating each of the - // attributes we will return this final array of the mutated attributes. - $attributes[$key] = $this->mutateAttributeForArray( - $key, $attributes[$key] - ); - } - - return $attributes; - } - - /** - * Add the casted attributes to the attributes array. - * - * @param array $attributes - * @param array $mutatedAttributes - * @return array - */ - protected function addCastAttributesToArray(array $attributes, array $mutatedAttributes) - { - foreach ($this->getCasts() as $key => $value) { - if (! array_key_exists($key, $attributes) || - in_array($key, $mutatedAttributes)) { - continue; - } - - // Here we will cast the attribute. Then, if the cast is a date or datetime cast - // then we will serialize the date for the array. This will convert the dates - // to strings based on the date format specified for these Eloquent models. - $attributes[$key] = $this->castAttribute( - $key, $attributes[$key] - ); - - // If the attribute cast was a date or a datetime, we will serialize the date as - // a string. This allows the developers to customize how dates are serialized - // into an array without affecting how they are persisted into the storage. - if (isset($attributes[$key]) && in_array($value, ['date', 'datetime', 'immutable_date', 'immutable_datetime'])) { - $attributes[$key] = $this->serializeDate($attributes[$key]); - } - - if (isset($attributes[$key]) && ($this->isCustomDateTimeCast($value) || - $this->isImmutableCustomDateTimeCast($value))) { - $attributes[$key] = $attributes[$key]->format(explode(':', $value, 2)[1]); - } - - if ($attributes[$key] instanceof DateTimeInterface && - $this->isClassCastable($key)) { - $attributes[$key] = $this->serializeDate($attributes[$key]); - } - - if (isset($attributes[$key]) && $this->isClassSerializable($key)) { - $attributes[$key] = $this->serializeClassCastableAttribute($key, $attributes[$key]); - } - - if ($this->isEnumCastable($key) && (! ($attributes[$key] ?? null) instanceof Arrayable)) { - $attributes[$key] = isset($attributes[$key]) ? $this->getStorableEnumValue($attributes[$key]) : null; - } - - if ($attributes[$key] instanceof Arrayable) { - $attributes[$key] = $attributes[$key]->toArray(); - } - } - - return $attributes; - } - - /** - * Get an attribute array of all arrayable attributes. - * - * @return array - */ - protected function getArrayableAttributes() - { - return $this->getArrayableItems($this->getAttributes()); - } - - /** - * Get all of the appendable values that are arrayable. - * - * @return array - */ - protected function getArrayableAppends() - { - if (! count($this->appends)) { - return []; - } - - return $this->getArrayableItems( - array_combine($this->appends, $this->appends) - ); - } - - /** - * Get the model's relationships in array form. - * - * @return array - */ - public function relationsToArray() - { - $attributes = []; - - foreach ($this->getArrayableRelations() as $key => $value) { - // If the values implement the Arrayable interface we can just call this - // toArray method on the instances which will convert both models and - // collections to their proper array form and we'll set the values. - if ($value instanceof Arrayable) { - $relation = $value->toArray(); - } - - // If the value is null, we'll still go ahead and set it in this list of - // attributes, since null is used to represent empty relationships if - // it has a has one or belongs to type relationships on the models. - elseif (is_null($value)) { - $relation = $value; - } - - // If the relationships snake-casing is enabled, we will snake case this - // key so that the relation attribute is snake cased in this returned - // array to the developers, making this consistent with attributes. - if (static::$snakeAttributes) { - $key = Str::snake($key); - } - - // If the relation value has been set, we will set it on this attributes - // list for returning. If it was not arrayable or null, we'll not set - // the value on the array because it is some type of invalid value. - if (isset($relation) || is_null($value)) { - $attributes[$key] = $relation; - } - - unset($relation); - } - - return $attributes; - } - - /** - * Get an attribute array of all arrayable relations. - * - * @return array - */ - protected function getArrayableRelations() - { - return $this->getArrayableItems($this->relations); - } - - /** - * Get an attribute array of all arrayable values. - * - * @param array $values - * @return array - */ - protected function getArrayableItems(array $values) - { - if (count($this->getVisible()) > 0) { - $values = array_intersect_key($values, array_flip($this->getVisible())); - } - - if (count($this->getHidden()) > 0) { - $values = array_diff_key($values, array_flip($this->getHidden())); - } - - return $values; - } - - /** - * Get an attribute from the model. - * - * @param string $key - * @return mixed - */ - public function getAttribute($key) - { - if (! $key) { - return; - } - - // If the attribute exists in the attribute array or has a "get" mutator we will - // get the attribute's value. Otherwise, we will proceed as if the developers - // are asking for a relationship's value. This covers both types of values. - if (array_key_exists($key, $this->attributes) || - array_key_exists($key, $this->casts) || - $this->hasGetMutator($key) || - $this->hasAttributeMutator($key) || - $this->isClassCastable($key)) { - return $this->getAttributeValue($key); - } - - // Here we will determine if the model base class itself contains this given key - // since we don't want to treat any of those methods as relationships because - // they are all intended as helper methods and none of these are relations. - if (method_exists(self::class, $key)) { - return $this->throwMissingAttributeExceptionIfApplicable($key); - } - - return $this->isRelation($key) || $this->relationLoaded($key) - ? $this->getRelationValue($key) - : $this->throwMissingAttributeExceptionIfApplicable($key); - } - - /** - * Either throw a missing attribute exception or return null depending on Eloquent's configuration. - * - * @param string $key - * @return null - * - * @throws \Illuminate\Database\Eloquent\MissingAttributeException - */ - protected function throwMissingAttributeExceptionIfApplicable($key) - { - if ($this->exists && - ! $this->wasRecentlyCreated && - static::preventsAccessingMissingAttributes()) { - if (isset(static::$missingAttributeViolationCallback)) { - return call_user_func(static::$missingAttributeViolationCallback, $this, $key); - } - - throw new MissingAttributeException($this, $key); - } - - return null; - } - - /** - * Get a plain attribute (not a relationship). - * - * @param string $key - * @return mixed - */ - public function getAttributeValue($key) - { - return $this->transformModelValue($key, $this->getAttributeFromArray($key)); - } - - /** - * Get an attribute from the $attributes array. - * - * @param string $key - * @return mixed - */ - protected function getAttributeFromArray($key) - { - return $this->getAttributes()[$key] ?? null; - } - - /** - * Get a relationship. - * - * @param string $key - * @return mixed - */ - public function getRelationValue($key) - { - // If the key already exists in the relationships array, it just means the - // relationship has already been loaded, so we'll just return it out of - // here because there is no need to query within the relations twice. - if ($this->relationLoaded($key)) { - return $this->relations[$key]; - } - - if (! $this->isRelation($key)) { - return; - } - - if ($this->preventsLazyLoading) { - $this->handleLazyLoadingViolation($key); - } - - // If the "attribute" exists as a method on the model, we will just assume - // it is a relationship and will load and return results from the query - // and hydrate the relationship's value on the "relationships" array. - return $this->getRelationshipFromMethod($key); - } - - /** - * Determine if the given key is a relationship method on the model. - * - * @param string $key - * @return bool - */ - public function isRelation($key) - { - if ($this->hasAttributeMutator($key)) { - return false; - } - - return method_exists($this, $key) || - $this->relationResolver(static::class, $key); - } - - /** - * Handle a lazy loading violation. - * - * @param string $key - * @return mixed - */ - protected function handleLazyLoadingViolation($key) - { - if (isset(static::$lazyLoadingViolationCallback)) { - return call_user_func(static::$lazyLoadingViolationCallback, $this, $key); - } - - if (! $this->exists || $this->wasRecentlyCreated) { - return; - } - - throw new LazyLoadingViolationException($this, $key); - } - - /** - * Get a relationship value from a method. - * - * @param string $method - * @return mixed - * - * @throws \LogicException - */ - protected function getRelationshipFromMethod($method) - { - $relation = $this->$method(); - - if (! $relation instanceof Relation) { - if (is_null($relation)) { - throw new LogicException(sprintf( - '%s::%s must return a relationship instance, but "null" was returned. Was the "return" keyword used?', static::class, $method - )); - } - - throw new LogicException(sprintf( - '%s::%s must return a relationship instance.', static::class, $method - )); - } - - return tap($relation->getResults(), function ($results) use ($method) { - $this->setRelation($method, $results); - }); - } - - /** - * Determine if a get mutator exists for an attribute. - * - * @param string $key - * @return bool - */ - public function hasGetMutator($key) - { - return method_exists($this, 'get'.Str::studly($key).'Attribute'); - } - - /** - * Determine if a "Attribute" return type marked mutator exists for an attribute. - * - * @param string $key - * @return bool - */ - public function hasAttributeMutator($key) - { - if (isset(static::$attributeMutatorCache[get_class($this)][$key])) { - return static::$attributeMutatorCache[get_class($this)][$key]; - } - - if (! method_exists($this, $method = Str::camel($key))) { - return static::$attributeMutatorCache[get_class($this)][$key] = false; - } - - $returnType = (new ReflectionMethod($this, $method))->getReturnType(); - - return static::$attributeMutatorCache[get_class($this)][$key] = - $returnType instanceof ReflectionNamedType && - $returnType->getName() === Attribute::class; - } - - /** - * Determine if a "Attribute" return type marked get mutator exists for an attribute. - * - * @param string $key - * @return bool - */ - public function hasAttributeGetMutator($key) - { - if (isset(static::$getAttributeMutatorCache[get_class($this)][$key])) { - return static::$getAttributeMutatorCache[get_class($this)][$key]; - } - - if (! $this->hasAttributeMutator($key)) { - return static::$getAttributeMutatorCache[get_class($this)][$key] = false; - } - - return static::$getAttributeMutatorCache[get_class($this)][$key] = is_callable($this->{Str::camel($key)}()->get); - } - - /** - * Get the value of an attribute using its mutator. - * - * @param string $key - * @param mixed $value - * @return mixed - */ - protected function mutateAttribute($key, $value) - { - return $this->{'get'.Str::studly($key).'Attribute'}($value); - } - - /** - * Get the value of an "Attribute" return type marked attribute using its mutator. - * - * @param string $key - * @param mixed $value - * @return mixed - */ - protected function mutateAttributeMarkedAttribute($key, $value) - { - if (array_key_exists($key, $this->attributeCastCache)) { - return $this->attributeCastCache[$key]; - } - - $attribute = $this->{Str::camel($key)}(); - - $value = call_user_func($attribute->get ?: function ($value) { - return $value; - }, $value, $this->attributes); - - if ($attribute->withCaching || (is_object($value) && $attribute->withObjectCaching)) { - $this->attributeCastCache[$key] = $value; - } else { - unset($this->attributeCastCache[$key]); - } - - return $value; - } - - /** - * Get the value of an attribute using its mutator for array conversion. - * - * @param string $key - * @param mixed $value - * @return mixed - */ - protected function mutateAttributeForArray($key, $value) - { - if ($this->isClassCastable($key)) { - $value = $this->getClassCastableAttributeValue($key, $value); - } elseif (isset(static::$getAttributeMutatorCache[get_class($this)][$key]) && - static::$getAttributeMutatorCache[get_class($this)][$key] === true) { - $value = $this->mutateAttributeMarkedAttribute($key, $value); - - $value = $value instanceof DateTimeInterface - ? $this->serializeDate($value) - : $value; - } else { - $value = $this->mutateAttribute($key, $value); - } - - return $value instanceof Arrayable ? $value->toArray() : $value; - } - - /** - * Merge new casts with existing casts on the model. - * - * @param array $casts - * @return $this - */ - public function mergeCasts($casts) - { - $this->casts = array_merge($this->casts, $casts); - - return $this; - } - - /** - * Cast an attribute to a native PHP type. - * - * @param string $key - * @param mixed $value - * @return mixed - */ - protected function castAttribute($key, $value) - { - $castType = $this->getCastType($key); - - if (is_null($value) && in_array($castType, static::$primitiveCastTypes)) { - return $value; - } - - // If the key is one of the encrypted castable types, we'll first decrypt - // the value and update the cast type so we may leverage the following - // logic for casting this value to any additionally specified types. - if ($this->isEncryptedCastable($key)) { - $value = $this->fromEncryptedString($value); - - $castType = Str::after($castType, 'encrypted:'); - } - - switch ($castType) { - case 'int': - case 'integer': - return (int) $value; - case 'real': - case 'float': - case 'double': - return $this->fromFloat($value); - case 'decimal': - return $this->asDecimal($value, explode(':', $this->getCasts()[$key], 2)[1]); - case 'string': - return (string) $value; - case 'bool': - case 'boolean': - return (bool) $value; - case 'object': - return $this->fromJson($value, true); - case 'array': - case 'json': - return $this->fromJson($value); - case 'collection': - return new BaseCollection($this->fromJson($value)); - case 'date': - return $this->asDate($value); - case 'datetime': - case 'custom_datetime': - return $this->asDateTime($value); - case 'immutable_date': - return $this->asDate($value)->toImmutable(); - case 'immutable_custom_datetime': - case 'immutable_datetime': - return $this->asDateTime($value)->toImmutable(); - case 'timestamp': - return $this->asTimestamp($value); - } - - if ($this->isEnumCastable($key)) { - return $this->getEnumCastableAttributeValue($key, $value); - } - - if ($this->isClassCastable($key)) { - return $this->getClassCastableAttributeValue($key, $value); - } - - return $value; - } - - /** - * Cast the given attribute using a custom cast class. - * - * @param string $key - * @param mixed $value - * @return mixed - */ - protected function getClassCastableAttributeValue($key, $value) - { - if (isset($this->classCastCache[$key])) { - return $this->classCastCache[$key]; - } else { - $caster = $this->resolveCasterClass($key); - - $value = $caster instanceof CastsInboundAttributes - ? $value - : $caster->get($this, $key, $value, $this->attributes); - - if ($caster instanceof CastsInboundAttributes || ! is_object($value)) { - unset($this->classCastCache[$key]); - } else { - $this->classCastCache[$key] = $value; - } - - return $value; - } - } - - /** - * Cast the given attribute to an enum. - * - * @param string $key - * @param mixed $value - * @return mixed - */ - protected function getEnumCastableAttributeValue($key, $value) - { - if (is_null($value)) { - return; - } - - $castType = $this->getCasts()[$key]; - - if ($value instanceof $castType) { - return $value; - } - - return $this->getEnumCaseFromValue($castType, $value); - } - - /** - * Get the type of cast for a model attribute. - * - * @param string $key - * @return string - */ - protected function getCastType($key) - { - $castType = $this->getCasts()[$key]; - - if (isset(static::$castTypeCache[$castType])) { - return static::$castTypeCache[$castType]; - } - - if ($this->isCustomDateTimeCast($castType)) { - $convertedCastType = 'custom_datetime'; - } elseif ($this->isImmutableCustomDateTimeCast($castType)) { - $convertedCastType = 'immutable_custom_datetime'; - } elseif ($this->isDecimalCast($castType)) { - $convertedCastType = 'decimal'; - } else { - $convertedCastType = trim(strtolower($castType)); - } - - return static::$castTypeCache[$castType] = $convertedCastType; - } - - /** - * Increment or decrement the given attribute using the custom cast class. - * - * @param string $method - * @param string $key - * @param mixed $value - * @return mixed - */ - protected function deviateClassCastableAttribute($method, $key, $value) - { - return $this->resolveCasterClass($key)->{$method}( - $this, $key, $value, $this->attributes - ); - } - - /** - * Serialize the given attribute using the custom cast class. - * - * @param string $key - * @param mixed $value - * @return mixed - */ - protected function serializeClassCastableAttribute($key, $value) - { - return $this->resolveCasterClass($key)->serialize( - $this, $key, $value, $this->attributes - ); - } - - /** - * Determine if the cast type is a custom date time cast. - * - * @param string $cast - * @return bool - */ - protected function isCustomDateTimeCast($cast) - { - return str_starts_with($cast, 'date:') || - str_starts_with($cast, 'datetime:'); - } - - /** - * Determine if the cast type is an immutable custom date time cast. - * - * @param string $cast - * @return bool - */ - protected function isImmutableCustomDateTimeCast($cast) - { - return str_starts_with($cast, 'immutable_date:') || - str_starts_with($cast, 'immutable_datetime:'); - } - - /** - * Determine if the cast type is a decimal cast. - * - * @param string $cast - * @return bool - */ - protected function isDecimalCast($cast) - { - return str_starts_with($cast, 'decimal:'); - } - - /** - * Set a given attribute on the model. - * - * @param string $key - * @param mixed $value - * @return mixed - */ - public function setAttribute($key, $value) - { - // First we will check for the presence of a mutator for the set operation - // which simply lets the developers tweak the attribute as it is set on - // this model, such as "json_encoding" a listing of data for storage. - if ($this->hasSetMutator($key)) { - return $this->setMutatedAttributeValue($key, $value); - } elseif ($this->hasAttributeSetMutator($key)) { - return $this->setAttributeMarkedMutatedAttributeValue($key, $value); - } - - // If an attribute is listed as a "date", we'll convert it from a DateTime - // instance into a form proper for storage on the database tables using - // the connection grammar's date format. We will auto set the values. - elseif (! is_null($value) && $this->isDateAttribute($key)) { - $value = $this->fromDateTime($value); - } - - if ($this->isEnumCastable($key)) { - $this->setEnumCastableAttribute($key, $value); - - return $this; - } - - if ($this->isClassCastable($key)) { - $this->setClassCastableAttribute($key, $value); - - return $this; - } - - if (! is_null($value) && $this->isJsonCastable($key)) { - $value = $this->castAttributeAsJson($key, $value); - } - - // If this attribute contains a JSON ->, we'll set the proper value in the - // attribute's underlying array. This takes care of properly nesting an - // attribute in the array's value in the case of deeply nested items. - if (str_contains($key, '->')) { - return $this->fillJsonAttribute($key, $value); - } - - if (! is_null($value) && $this->isEncryptedCastable($key)) { - $value = $this->castAttributeAsEncryptedString($key, $value); - } - - $this->attributes[$key] = $value; - - return $this; - } - - /** - * Determine if a set mutator exists for an attribute. - * - * @param string $key - * @return bool - */ - public function hasSetMutator($key) - { - return method_exists($this, 'set'.Str::studly($key).'Attribute'); - } - - /** - * Determine if an "Attribute" return type marked set mutator exists for an attribute. - * - * @param string $key - * @return bool - */ - public function hasAttributeSetMutator($key) - { - $class = get_class($this); - - if (isset(static::$setAttributeMutatorCache[$class][$key])) { - return static::$setAttributeMutatorCache[$class][$key]; - } - - if (! method_exists($this, $method = Str::camel($key))) { - return static::$setAttributeMutatorCache[$class][$key] = false; - } - - $returnType = (new ReflectionMethod($this, $method))->getReturnType(); - - return static::$setAttributeMutatorCache[$class][$key] = - $returnType instanceof ReflectionNamedType && - $returnType->getName() === Attribute::class && - is_callable($this->{$method}()->set); - } - - /** - * Set the value of an attribute using its mutator. - * - * @param string $key - * @param mixed $value - * @return mixed - */ - protected function setMutatedAttributeValue($key, $value) - { - return $this->{'set'.Str::studly($key).'Attribute'}($value); - } - - /** - * Set the value of a "Attribute" return type marked attribute using its mutator. - * - * @param string $key - * @param mixed $value - * @return mixed - */ - protected function setAttributeMarkedMutatedAttributeValue($key, $value) - { - $attribute = $this->{Str::camel($key)}(); - - $callback = $attribute->set ?: function ($value) use ($key) { - $this->attributes[$key] = $value; - }; - - $this->attributes = array_merge( - $this->attributes, - $this->normalizeCastClassResponse( - $key, $callback($value, $this->attributes) - ) - ); - - if ($attribute->withCaching || (is_object($value) && $attribute->withObjectCaching)) { - $this->attributeCastCache[$key] = $value; - } else { - unset($this->attributeCastCache[$key]); - } - } - - /** - * Determine if the given attribute is a date or date castable. - * - * @param string $key - * @return bool - */ - protected function isDateAttribute($key) - { - return in_array($key, $this->getDates(), true) || - $this->isDateCastable($key); - } - - /** - * Set a given JSON attribute on the model. - * - * @param string $key - * @param mixed $value - * @return $this - */ - public function fillJsonAttribute($key, $value) - { - [$key, $path] = explode('->', $key, 2); - - $value = $this->asJson($this->getArrayAttributeWithValue( - $path, $key, $value - )); - - $this->attributes[$key] = $this->isEncryptedCastable($key) - ? $this->castAttributeAsEncryptedString($key, $value) - : $value; - - if ($this->isClassCastable($key)) { - unset($this->classCastCache[$key]); - } - - return $this; - } - - /** - * Set the value of a class castable attribute. - * - * @param string $key - * @param mixed $value - * @return void - */ - protected function setClassCastableAttribute($key, $value) - { - $caster = $this->resolveCasterClass($key); - - $this->attributes = array_replace( - $this->attributes, - $this->normalizeCastClassResponse($key, $caster->set( - $this, $key, $value, $this->attributes - )) - ); - - if ($caster instanceof CastsInboundAttributes || ! is_object($value)) { - unset($this->classCastCache[$key]); - } else { - $this->classCastCache[$key] = $value; - } - } - - /** - * Set the value of an enum castable attribute. - * - * @param string $key - * @param \UnitEnum|string|int $value - * @return void - */ - protected function setEnumCastableAttribute($key, $value) - { - $enumClass = $this->getCasts()[$key]; - - if (! isset($value)) { - $this->attributes[$key] = null; - } elseif (is_object($value)) { - $this->attributes[$key] = $this->getStorableEnumValue($value); - } else { - $this->attributes[$key] = $this->getStorableEnumValue( - $this->getEnumCaseFromValue($enumClass, $value) - ); - } - } - - /** - * Get an enum case instance from a given class and value. - * - * @param string $enumClass - * @param string|int $value - * @return \UnitEnum|\BackedEnum - */ - protected function getEnumCaseFromValue($enumClass, $value) - { - return is_subclass_of($enumClass, BackedEnum::class) - ? $enumClass::from($value) - : constant($enumClass.'::'.$value); - } - - /** - * Get the storable value from the given enum. - * - * @param \UnitEnum|\BackedEnum $value - * @return string|int - */ - protected function getStorableEnumValue($value) - { - return $value instanceof BackedEnum - ? $value->value - : $value->name; - } - - /** - * Get an array attribute with the given key and value set. - * - * @param string $path - * @param string $key - * @param mixed $value - * @return $this - */ - protected function getArrayAttributeWithValue($path, $key, $value) - { - return tap($this->getArrayAttributeByKey($key), function (&$array) use ($path, $value) { - Arr::set($array, str_replace('->', '.', $path), $value); - }); - } - - /** - * Get an array attribute or return an empty array if it is not set. - * - * @param string $key - * @return array - */ - protected function getArrayAttributeByKey($key) - { - if (! isset($this->attributes[$key])) { - return []; - } - - return $this->fromJson( - $this->isEncryptedCastable($key) - ? $this->fromEncryptedString($this->attributes[$key]) - : $this->attributes[$key] - ); - } - - /** - * Cast the given attribute to JSON. - * - * @param string $key - * @param mixed $value - * @return string - */ - protected function castAttributeAsJson($key, $value) - { - $value = $this->asJson($value); - - if ($value === false) { - throw JsonEncodingException::forAttribute( - $this, $key, json_last_error_msg() - ); - } - - return $value; - } - - /** - * Encode the given value as JSON. - * - * @param mixed $value - * @return string - */ - protected function asJson($value) - { - return json_encode($value); - } - - /** - * Decode the given JSON back into an array or object. - * - * @param string $value - * @param bool $asObject - * @return mixed - */ - public function fromJson($value, $asObject = false) - { - return json_decode($value ?? '', ! $asObject); - } - - /** - * Decrypt the given encrypted string. - * - * @param string $value - * @return mixed - */ - public function fromEncryptedString($value) - { - return (static::$encrypter ?? Crypt::getFacadeRoot())->decrypt($value, false); - } - - /** - * Cast the given attribute to an encrypted string. - * - * @param string $key - * @param mixed $value - * @return string - */ - protected function castAttributeAsEncryptedString($key, $value) - { - return (static::$encrypter ?? Crypt::getFacadeRoot())->encrypt($value, false); - } - - /** - * Set the encrypter instance that will be used to encrypt attributes. - * - * @param \Illuminate\Contracts\Encryption\Encrypter $encrypter - * @return void - */ - public static function encryptUsing($encrypter) - { - static::$encrypter = $encrypter; - } - - /** - * Decode the given float. - * - * @param mixed $value - * @return mixed - */ - public function fromFloat($value) - { - return match ((string) $value) { - 'Infinity' => INF, - '-Infinity' => -INF, - 'NaN' => NAN, - default => (float) $value, - }; - } - - /** - * Return a decimal as string. - * - * @param float $value - * @param int $decimals - * @return string - */ - protected function asDecimal($value, $decimals) - { - return number_format($value, $decimals, '.', ''); - } - - /** - * Return a timestamp as DateTime object with time set to 00:00:00. - * - * @param mixed $value - * @return \Illuminate\Support\Carbon - */ - protected function asDate($value) - { - return $this->asDateTime($value)->startOfDay(); - } - - /** - * Return a timestamp as DateTime object. - * - * @param mixed $value - * @return \Illuminate\Support\Carbon - */ - protected function asDateTime($value) - { - // If this value is already a Carbon instance, we shall just return it as is. - // This prevents us having to re-instantiate a Carbon instance when we know - // it already is one, which wouldn't be fulfilled by the DateTime check. - if ($value instanceof CarbonInterface) { - return Date::instance($value); - } - - // If the value is already a DateTime instance, we will just skip the rest of - // these checks since they will be a waste of time, and hinder performance - // when checking the field. We will just return the DateTime right away. - if ($value instanceof DateTimeInterface) { - return Date::parse( - $value->format('Y-m-d H:i:s.u'), $value->getTimezone() - ); - } - - // If this value is an integer, we will assume it is a UNIX timestamp's value - // and format a Carbon object from this timestamp. This allows flexibility - // when defining your date fields as they might be UNIX timestamps here. - if (is_numeric($value)) { - return Date::createFromTimestamp($value); - } - - // If the value is in simply year, month, day format, we will instantiate the - // Carbon instances from that format. Again, this provides for simple date - // fields on the database, while still supporting Carbonized conversion. - if ($this->isStandardDateFormat($value)) { - return Date::instance(Carbon::createFromFormat('Y-m-d', $value)->startOfDay()); - } - - $format = $this->getDateFormat(); - - // Finally, we will just assume this date is in the format used by default on - // the database connection and use that format to create the Carbon object - // that is returned back out to the developers after we convert it here. - try { - $date = Date::createFromFormat($format, $value); - } catch (InvalidArgumentException $e) { - $date = false; - } - - return $date ?: Date::parse($value); - } - - /** - * Determine if the given value is a standard date format. - * - * @param string $value - * @return bool - */ - protected function isStandardDateFormat($value) - { - return preg_match('/^(\d{4})-(\d{1,2})-(\d{1,2})$/', $value); - } - - /** - * Convert a DateTime to a storable string. - * - * @param mixed $value - * @return string|null - */ - public function fromDateTime($value) - { - return empty($value) ? $value : $this->asDateTime($value)->format( - $this->getDateFormat() - ); - } - - /** - * Return a timestamp as unix timestamp. - * - * @param mixed $value - * @return int - */ - protected function asTimestamp($value) - { - return $this->asDateTime($value)->getTimestamp(); - } - - /** - * Prepare a date for array / JSON serialization. - * - * @param \DateTimeInterface $date - * @return string - */ - protected function serializeDate(DateTimeInterface $date) - { - return $date instanceof DateTimeImmutable ? - CarbonImmutable::instance($date)->toJSON() : - Carbon::instance($date)->toJSON(); - } - - /** - * Get the attributes that should be converted to dates. - * - * @return array - */ - public function getDates() - { - if (! $this->usesTimestamps()) { - return $this->dates; - } - - $defaults = [ - $this->getCreatedAtColumn(), - $this->getUpdatedAtColumn(), - ]; - - return array_unique(array_merge($this->dates, $defaults)); - } - - /** - * Get the format for database stored dates. - * - * @return string - */ - public function getDateFormat() - { - return $this->dateFormat ?: $this->getConnection()->getQueryGrammar()->getDateFormat(); - } - - /** - * Set the date format used by the model. - * - * @param string $format - * @return $this - */ - public function setDateFormat($format) - { - $this->dateFormat = $format; - - return $this; - } - - /** - * Determine whether an attribute should be cast to a native type. - * - * @param string $key - * @param array|string|null $types - * @return bool - */ - public function hasCast($key, $types = null) - { - if (array_key_exists($key, $this->getCasts())) { - return $types ? in_array($this->getCastType($key), (array) $types, true) : true; - } - - return false; - } - - /** - * Get the casts array. - * - * @return array - */ - public function getCasts() - { - if ($this->getIncrementing()) { - return array_merge([$this->getKeyName() => $this->getKeyType()], $this->casts); - } - - return $this->casts; - } - - /** - * Determine whether a value is Date / DateTime castable for inbound manipulation. - * - * @param string $key - * @return bool - */ - protected function isDateCastable($key) - { - return $this->hasCast($key, ['date', 'datetime', 'immutable_date', 'immutable_datetime']); - } - - /** - * Determine whether a value is Date / DateTime custom-castable for inbound manipulation. - * - * @param string $key - * @return bool - */ - protected function isDateCastableWithCustomFormat($key) - { - return $this->hasCast($key, ['custom_datetime', 'immutable_custom_datetime']); - } - - /** - * Determine whether a value is JSON castable for inbound manipulation. - * - * @param string $key - * @return bool - */ - protected function isJsonCastable($key) - { - return $this->hasCast($key, ['array', 'json', 'object', 'collection', 'encrypted:array', 'encrypted:collection', 'encrypted:json', 'encrypted:object']); - } - - /** - * Determine whether a value is an encrypted castable for inbound manipulation. - * - * @param string $key - * @return bool - */ - protected function isEncryptedCastable($key) - { - return $this->hasCast($key, ['encrypted', 'encrypted:array', 'encrypted:collection', 'encrypted:json', 'encrypted:object']); - } - - /** - * Determine if the given key is cast using a custom class. - * - * @param string $key - * @return bool - * - * @throws \Illuminate\Database\Eloquent\InvalidCastException - */ - protected function isClassCastable($key) - { - $casts = $this->getCasts(); - - if (! array_key_exists($key, $casts)) { - return false; - } - - $castType = $this->parseCasterClass($casts[$key]); - - if (in_array($castType, static::$primitiveCastTypes)) { - return false; - } - - if (class_exists($castType)) { - return true; - } - - throw new InvalidCastException($this->getModel(), $key, $castType); - } - - /** - * Determine if the given key is cast using an enum. - * - * @param string $key - * @return bool - */ - protected function isEnumCastable($key) - { - $casts = $this->getCasts(); - - if (! array_key_exists($key, $casts)) { - return false; - } - - $castType = $casts[$key]; - - if (in_array($castType, static::$primitiveCastTypes)) { - return false; - } - - if (function_exists('enum_exists') && enum_exists($castType)) { - return true; - } - } - - /** - * Determine if the key is deviable using a custom class. - * - * @param string $key - * @return bool - * - * @throws \Illuminate\Database\Eloquent\InvalidCastException - */ - protected function isClassDeviable($key) - { - return $this->isClassCastable($key) && - method_exists($castType = $this->parseCasterClass($this->getCasts()[$key]), 'increment') && - method_exists($castType, 'decrement'); - } - - /** - * Determine if the key is serializable using a custom class. - * - * @param string $key - * @return bool - * - * @throws \Illuminate\Database\Eloquent\InvalidCastException - */ - protected function isClassSerializable($key) - { - return ! $this->isEnumCastable($key) && - $this->isClassCastable($key) && - method_exists($this->resolveCasterClass($key), 'serialize'); - } - - /** - * Resolve the custom caster class for a given key. - * - * @param string $key - * @return mixed - */ - protected function resolveCasterClass($key) - { - $castType = $this->getCasts()[$key]; - - $arguments = []; - - if (is_string($castType) && str_contains($castType, ':')) { - $segments = explode(':', $castType, 2); - - $castType = $segments[0]; - $arguments = explode(',', $segments[1]); - } - - if (is_subclass_of($castType, Castable::class)) { - $castType = $castType::castUsing($arguments); - } - - if (is_object($castType)) { - return $castType; - } - - return new $castType(...$arguments); - } - - /** - * Parse the given caster class, removing any arguments. - * - * @param string $class - * @return string - */ - protected function parseCasterClass($class) - { - return ! str_contains($class, ':') - ? $class - : explode(':', $class, 2)[0]; - } - - /** - * Merge the cast class and attribute cast attributes back into the model. - * - * @return void - */ - protected function mergeAttributesFromCachedCasts() - { - $this->mergeAttributesFromClassCasts(); - $this->mergeAttributesFromAttributeCasts(); - } - - /** - * Merge the cast class attributes back into the model. - * - * @return void - */ - protected function mergeAttributesFromClassCasts() - { - foreach ($this->classCastCache as $key => $value) { - $caster = $this->resolveCasterClass($key); - - $this->attributes = array_merge( - $this->attributes, - $caster instanceof CastsInboundAttributes - ? [$key => $value] - : $this->normalizeCastClassResponse($key, $caster->set($this, $key, $value, $this->attributes)) - ); - } - } - - /** - * Merge the cast class attributes back into the model. - * - * @return void - */ - protected function mergeAttributesFromAttributeCasts() - { - foreach ($this->attributeCastCache as $key => $value) { - $attribute = $this->{Str::camel($key)}(); - - if ($attribute->get && ! $attribute->set) { - continue; - } - - $callback = $attribute->set ?: function ($value) use ($key) { - $this->attributes[$key] = $value; - }; - - $this->attributes = array_merge( - $this->attributes, - $this->normalizeCastClassResponse( - $key, $callback($value, $this->attributes) - ) - ); - } - } - - /** - * Normalize the response from a custom class caster. - * - * @param string $key - * @param mixed $value - * @return array - */ - protected function normalizeCastClassResponse($key, $value) - { - return is_array($value) ? $value : [$key => $value]; - } - - /** - * Get all of the current attributes on the model. - * - * @return array - */ - public function getAttributes() - { - $this->mergeAttributesFromCachedCasts(); - - return $this->attributes; - } - - /** - * Get all of the current attributes on the model for an insert operation. - * - * @return array - */ - protected function getAttributesForInsert() - { - return $this->getAttributes(); - } - - /** - * Set the array of model attributes. No checking is done. - * - * @param array $attributes - * @param bool $sync - * @return $this - */ - public function setRawAttributes(array $attributes, $sync = false) - { - $this->attributes = $attributes; - - if ($sync) { - $this->syncOriginal(); - } - - $this->classCastCache = []; - $this->attributeCastCache = []; - - return $this; - } - - /** - * Get the model's original attribute values. - * - * @param string|null $key - * @param mixed $default - * @return mixed|array - */ - public function getOriginal($key = null, $default = null) - { - return (new static)->setRawAttributes( - $this->original, $sync = true - )->getOriginalWithoutRewindingModel($key, $default); - } - - /** - * Get the model's original attribute values. - * - * @param string|null $key - * @param mixed $default - * @return mixed|array - */ - protected function getOriginalWithoutRewindingModel($key = null, $default = null) - { - if ($key) { - return $this->transformModelValue( - $key, Arr::get($this->original, $key, $default) - ); - } - - return collect($this->original)->mapWithKeys(function ($value, $key) { - return [$key => $this->transformModelValue($key, $value)]; - })->all(); - } - - /** - * Get the model's raw original attribute values. - * - * @param string|null $key - * @param mixed $default - * @return mixed|array - */ - public function getRawOriginal($key = null, $default = null) - { - return Arr::get($this->original, $key, $default); - } - - /** - * Get a subset of the model's attributes. - * - * @param array|mixed $attributes - * @return array - */ - public function only($attributes) - { - $results = []; - - foreach (is_array($attributes) ? $attributes : func_get_args() as $attribute) { - $results[$attribute] = $this->getAttribute($attribute); - } - - return $results; - } - - /** - * Sync the original attributes with the current. - * - * @return $this - */ - public function syncOriginal() - { - $this->original = $this->getAttributes(); - - return $this; - } - - /** - * Sync a single original attribute with its current value. - * - * @param string $attribute - * @return $this - */ - public function syncOriginalAttribute($attribute) - { - return $this->syncOriginalAttributes($attribute); - } - - /** - * Sync multiple original attribute with their current values. - * - * @param array|string $attributes - * @return $this - */ - public function syncOriginalAttributes($attributes) - { - $attributes = is_array($attributes) ? $attributes : func_get_args(); - - $modelAttributes = $this->getAttributes(); - - foreach ($attributes as $attribute) { - $this->original[$attribute] = $modelAttributes[$attribute]; - } - - return $this; - } - - /** - * Sync the changed attributes. - * - * @return $this - */ - public function syncChanges() - { - $this->changes = $this->getDirty(); - - return $this; - } - - /** - * Determine if the model or any of the given attribute(s) have been modified. - * - * @param array|string|null $attributes - * @return bool - */ - public function isDirty($attributes = null) - { - return $this->hasChanges( - $this->getDirty(), is_array($attributes) ? $attributes : func_get_args() - ); - } - - /** - * Determine if the model or all the given attribute(s) have remained the same. - * - * @param array|string|null $attributes - * @return bool - */ - public function isClean($attributes = null) - { - return ! $this->isDirty(...func_get_args()); - } - - /** - * Discard attribute changes and reset the attributes to their original state. - * - * @return $this - */ - public function discardChanges() - { - [$this->attributes, $this->changes] = [$this->original, []]; - - return $this; - } - - /** - * Determine if the model or any of the given attribute(s) were changed when the model was last saved. - * - * @param array|string|null $attributes - * @return bool - */ - public function wasChanged($attributes = null) - { - return $this->hasChanges( - $this->getChanges(), is_array($attributes) ? $attributes : func_get_args() - ); - } - - /** - * Determine if any of the given attributes were changed when the model was last saved. - * - * @param array $changes - * @param array|string|null $attributes - * @return bool - */ - protected function hasChanges($changes, $attributes = null) - { - // If no specific attributes were provided, we will just see if the dirty array - // already contains any attributes. If it does we will just return that this - // count is greater than zero. Else, we need to check specific attributes. - if (empty($attributes)) { - return count($changes) > 0; - } - - // Here we will spin through every attribute and see if this is in the array of - // dirty attributes. If it is, we will return true and if we make it through - // all of the attributes for the entire array we will return false at end. - foreach (Arr::wrap($attributes) as $attribute) { - if (array_key_exists($attribute, $changes)) { - return true; - } - } - - return false; - } - - /** - * Get the attributes that have been changed since the last sync. - * - * @return array - */ - public function getDirty() - { - $dirty = []; - - foreach ($this->getAttributes() as $key => $value) { - if (! $this->originalIsEquivalent($key)) { - $dirty[$key] = $value; - } - } - - return $dirty; - } - - /** - * Get the attributes that were changed when the model was last saved. - * - * @return array - */ - public function getChanges() - { - return $this->changes; - } - - /** - * Determine if the new and old values for a given key are equivalent. - * - * @param string $key - * @return bool - */ - public function originalIsEquivalent($key) - { - if (! array_key_exists($key, $this->original)) { - return false; - } - - $attribute = Arr::get($this->attributes, $key); - $original = Arr::get($this->original, $key); - - if ($attribute === $original) { - return true; - } elseif (is_null($attribute)) { - return false; - } elseif ($this->isDateAttribute($key) || $this->isDateCastableWithCustomFormat($key)) { - return $this->fromDateTime($attribute) === - $this->fromDateTime($original); - } elseif ($this->hasCast($key, ['object', 'collection'])) { - return $this->fromJson($attribute) === - $this->fromJson($original); - } elseif ($this->hasCast($key, ['real', 'float', 'double'])) { - if ($original === null) { - return false; - } - - return abs($this->castAttribute($key, $attribute) - $this->castAttribute($key, $original)) < PHP_FLOAT_EPSILON * 4; - } elseif ($this->hasCast($key, static::$primitiveCastTypes)) { - return $this->castAttribute($key, $attribute) === - $this->castAttribute($key, $original); - } elseif ($this->isClassCastable($key) && in_array($this->getCasts()[$key], [AsArrayObject::class, AsCollection::class])) { - return $this->fromJson($attribute) === $this->fromJson($original); - } elseif ($this->isClassCastable($key) && $original !== null && in_array($this->getCasts()[$key], [AsEncryptedArrayObject::class, AsEncryptedCollection::class])) { - return $this->fromEncryptedString($attribute) === $this->fromEncryptedString($original); - } - - return is_numeric($attribute) && is_numeric($original) - && strcmp((string) $attribute, (string) $original) === 0; - } - - /** - * Transform a raw model value using mutators, casts, etc. - * - * @param string $key - * @param mixed $value - * @return mixed - */ - protected function transformModelValue($key, $value) - { - // If the attribute has a get mutator, we will call that then return what - // it returns as the value, which is useful for transforming values on - // retrieval from the model to a form that is more useful for usage. - if ($this->hasGetMutator($key)) { - return $this->mutateAttribute($key, $value); - } elseif ($this->hasAttributeGetMutator($key)) { - return $this->mutateAttributeMarkedAttribute($key, $value); - } - - // If the attribute exists within the cast array, we will convert it to - // an appropriate native PHP type dependent upon the associated value - // given with the key in the pair. Dayle made this comment line up. - if ($this->hasCast($key)) { - return $this->castAttribute($key, $value); - } - - // If the attribute is listed as a date, we will convert it to a DateTime - // instance on retrieval, which makes it quite convenient to work with - // date fields without having to create a mutator for each property. - if ($value !== null - && \in_array($key, $this->getDates(), false)) { - return $this->asDateTime($value); - } - - return $value; - } - - /** - * Append attributes to query when building a query. - * - * @param array|string $attributes - * @return $this - */ - public function append($attributes) - { - $this->appends = array_unique( - array_merge($this->appends, is_string($attributes) ? func_get_args() : $attributes) - ); - - return $this; - } - - /** - * Get the accessors that are being appended to model arrays. - * - * @return array - */ - public function getAppends() - { - return $this->appends; - } - - /** - * Set the accessors to append to model arrays. - * - * @param array $appends - * @return $this - */ - public function setAppends(array $appends) - { - $this->appends = $appends; - - return $this; - } - - /** - * Return whether the accessor attribute has been appended. - * - * @param string $attribute - * @return bool - */ - public function hasAppended($attribute) - { - return in_array($attribute, $this->appends); - } - - /** - * Get the mutated attributes for a given instance. - * - * @return array - */ - public function getMutatedAttributes() - { - if (! isset(static::$mutatorCache[static::class])) { - static::cacheMutatedAttributes($this); - } - - return static::$mutatorCache[static::class]; - } - - /** - * Extract and cache all the mutated attributes of a class. - * - * @param object|string $classOrInstance - * @return void - */ - public static function cacheMutatedAttributes($classOrInstance) - { - $reflection = new ReflectionClass($classOrInstance); - - $class = $reflection->getName(); - - static::$getAttributeMutatorCache[$class] = - collect($attributeMutatorMethods = static::getAttributeMarkedMutatorMethods($classOrInstance)) - ->mapWithKeys(function ($match) { - return [lcfirst(static::$snakeAttributes ? Str::snake($match) : $match) => true]; - })->all(); - - static::$mutatorCache[$class] = collect(static::getMutatorMethods($class)) - ->merge($attributeMutatorMethods) - ->map(function ($match) { - return lcfirst(static::$snakeAttributes ? Str::snake($match) : $match); - })->all(); - } - - /** - * Get all of the attribute mutator methods. - * - * @param mixed $class - * @return array - */ - protected static function getMutatorMethods($class) - { - preg_match_all('/(?<=^|;)get([^;]+?)Attribute(;|$)/', implode(';', get_class_methods($class)), $matches); - - return $matches[1]; - } - - /** - * Get all of the "Attribute" return typed attribute mutator methods. - * - * @param mixed $class - * @return array - */ - protected static function getAttributeMarkedMutatorMethods($class) - { - $instance = is_object($class) ? $class : new $class; - - return collect((new ReflectionClass($instance))->getMethods())->filter(function ($method) use ($instance) { - $returnType = $method->getReturnType(); - - if ($returnType instanceof ReflectionNamedType && - $returnType->getName() === Attribute::class) { - $method->setAccessible(true); - - if (is_callable($method->invoke($instance)->get)) { - return true; - } - } - - return false; - })->map->name->values()->all(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php deleted file mode 100644 index 7d65cdc2..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php +++ /dev/null @@ -1,415 +0,0 @@ -registerObserver($class); - } - } - - /** - * Register a single observer with the model. - * - * @param object|string $class - * @return void - * - * @throws \RuntimeException - */ - protected function registerObserver($class) - { - $className = $this->resolveObserverClassName($class); - - // When registering a model observer, we will spin through the possible events - // and determine if this observer has that method. If it does, we will hook - // it into the model's event system, making it convenient to watch these. - foreach ($this->getObservableEvents() as $event) { - if (method_exists($class, $event)) { - static::registerModelEvent($event, $className.'@'.$event); - } - } - } - - /** - * Resolve the observer's class name from an object or string. - * - * @param object|string $class - * @return string - * - * @throws \InvalidArgumentException - */ - private function resolveObserverClassName($class) - { - if (is_object($class)) { - return get_class($class); - } - - if (class_exists($class)) { - return $class; - } - - throw new InvalidArgumentException('Unable to find observer: '.$class); - } - - /** - * Get the observable event names. - * - * @return array - */ - public function getObservableEvents() - { - return array_merge( - [ - 'retrieved', 'creating', 'created', 'updating', 'updated', - 'saving', 'saved', 'restoring', 'restored', 'replicating', - 'deleting', 'deleted', 'forceDeleted', - ], - $this->observables - ); - } - - /** - * Set the observable event names. - * - * @param array $observables - * @return $this - */ - public function setObservableEvents(array $observables) - { - $this->observables = $observables; - - return $this; - } - - /** - * Add an observable event name. - * - * @param array|mixed $observables - * @return void - */ - public function addObservableEvents($observables) - { - $this->observables = array_unique(array_merge( - $this->observables, is_array($observables) ? $observables : func_get_args() - )); - } - - /** - * Remove an observable event name. - * - * @param array|mixed $observables - * @return void - */ - public function removeObservableEvents($observables) - { - $this->observables = array_diff( - $this->observables, is_array($observables) ? $observables : func_get_args() - ); - } - - /** - * Register a model event with the dispatcher. - * - * @param string $event - * @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback - * @return void - */ - protected static function registerModelEvent($event, $callback) - { - if (isset(static::$dispatcher)) { - $name = static::class; - - static::$dispatcher->listen("eloquent.{$event}: {$name}", $callback); - } - } - - /** - * Fire the given event for the model. - * - * @param string $event - * @param bool $halt - * @return mixed - */ - protected function fireModelEvent($event, $halt = true) - { - if (! isset(static::$dispatcher)) { - return true; - } - - // First, we will get the proper method to call on the event dispatcher, and then we - // will attempt to fire a custom, object based event for the given event. If that - // returns a result we can return that result, or we'll call the string events. - $method = $halt ? 'until' : 'dispatch'; - - $result = $this->filterModelEventResults( - $this->fireCustomModelEvent($event, $method) - ); - - if ($result === false) { - return false; - } - - return ! empty($result) ? $result : static::$dispatcher->{$method}( - "eloquent.{$event}: ".static::class, $this - ); - } - - /** - * Fire a custom model event for the given event. - * - * @param string $event - * @param string $method - * @return mixed|null - */ - protected function fireCustomModelEvent($event, $method) - { - if (! isset($this->dispatchesEvents[$event])) { - return; - } - - $result = static::$dispatcher->$method(new $this->dispatchesEvents[$event]($this)); - - if (! is_null($result)) { - return $result; - } - } - - /** - * Filter the model event results. - * - * @param mixed $result - * @return mixed - */ - protected function filterModelEventResults($result) - { - if (is_array($result)) { - $result = array_filter($result, function ($response) { - return ! is_null($response); - }); - } - - return $result; - } - - /** - * Register a retrieved model event with the dispatcher. - * - * @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback - * @return void - */ - public static function retrieved($callback) - { - static::registerModelEvent('retrieved', $callback); - } - - /** - * Register a saving model event with the dispatcher. - * - * @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback - * @return void - */ - public static function saving($callback) - { - static::registerModelEvent('saving', $callback); - } - - /** - * Register a saved model event with the dispatcher. - * - * @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback - * @return void - */ - public static function saved($callback) - { - static::registerModelEvent('saved', $callback); - } - - /** - * Register an updating model event with the dispatcher. - * - * @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback - * @return void - */ - public static function updating($callback) - { - static::registerModelEvent('updating', $callback); - } - - /** - * Register an updated model event with the dispatcher. - * - * @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback - * @return void - */ - public static function updated($callback) - { - static::registerModelEvent('updated', $callback); - } - - /** - * Register a creating model event with the dispatcher. - * - * @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback - * @return void - */ - public static function creating($callback) - { - static::registerModelEvent('creating', $callback); - } - - /** - * Register a created model event with the dispatcher. - * - * @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback - * @return void - */ - public static function created($callback) - { - static::registerModelEvent('created', $callback); - } - - /** - * Register a replicating model event with the dispatcher. - * - * @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback - * @return void - */ - public static function replicating($callback) - { - static::registerModelEvent('replicating', $callback); - } - - /** - * Register a deleting model event with the dispatcher. - * - * @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback - * @return void - */ - public static function deleting($callback) - { - static::registerModelEvent('deleting', $callback); - } - - /** - * Register a deleted model event with the dispatcher. - * - * @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback - * @return void - */ - public static function deleted($callback) - { - static::registerModelEvent('deleted', $callback); - } - - /** - * Remove all the event listeners for the model. - * - * @return void - */ - public static function flushEventListeners() - { - if (! isset(static::$dispatcher)) { - return; - } - - $instance = new static; - - foreach ($instance->getObservableEvents() as $event) { - static::$dispatcher->forget("eloquent.{$event}: ".static::class); - } - - foreach (array_values($instance->dispatchesEvents) as $event) { - static::$dispatcher->forget($event); - } - } - - /** - * Get the event dispatcher instance. - * - * @return \Illuminate\Contracts\Events\Dispatcher - */ - public static function getEventDispatcher() - { - return static::$dispatcher; - } - - /** - * Set the event dispatcher instance. - * - * @param \Illuminate\Contracts\Events\Dispatcher $dispatcher - * @return void - */ - public static function setEventDispatcher(Dispatcher $dispatcher) - { - static::$dispatcher = $dispatcher; - } - - /** - * Unset the event dispatcher for models. - * - * @return void - */ - public static function unsetEventDispatcher() - { - static::$dispatcher = null; - } - - /** - * Execute a callback without firing any model events for any model type. - * - * @param callable $callback - * @return mixed - */ - public static function withoutEvents(callable $callback) - { - $dispatcher = static::getEventDispatcher(); - - if ($dispatcher) { - static::setEventDispatcher(new NullDispatcher($dispatcher)); - } - - try { - return $callback(); - } finally { - if ($dispatcher) { - static::setEventDispatcher($dispatcher); - } - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasGlobalScopes.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasGlobalScopes.php deleted file mode 100644 index 72afb178..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasGlobalScopes.php +++ /dev/null @@ -1,71 +0,0 @@ -relationResolver($parent, $key); - } - - return null; - } - - /** - * Define a dynamic relation resolver. - * - * @param string $name - * @param \Closure $callback - * @return void - */ - public static function resolveRelationUsing($name, Closure $callback) - { - static::$relationResolvers = array_replace_recursive( - static::$relationResolvers, - [static::class => [$name => $callback]] - ); - } - - /** - * Define a one-to-one relationship. - * - * @param string $related - * @param string|null $foreignKey - * @param string|null $localKey - * @return \Illuminate\Database\Eloquent\Relations\HasOne - */ - public function hasOne($related, $foreignKey = null, $localKey = null) - { - $instance = $this->newRelatedInstance($related); - - $foreignKey = $foreignKey ?: $this->getForeignKey(); - - $localKey = $localKey ?: $this->getKeyName(); - - return $this->newHasOne($instance->newQuery(), $this, $instance->getTable().'.'.$foreignKey, $localKey); - } - - /** - * Instantiate a new HasOne relationship. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Model $parent - * @param string $foreignKey - * @param string $localKey - * @return \Illuminate\Database\Eloquent\Relations\HasOne - */ - protected function newHasOne(Builder $query, Model $parent, $foreignKey, $localKey) - { - return new HasOne($query, $parent, $foreignKey, $localKey); - } - - /** - * Define a has-one-through relationship. - * - * @param string $related - * @param string $through - * @param string|null $firstKey - * @param string|null $secondKey - * @param string|null $localKey - * @param string|null $secondLocalKey - * @return \Illuminate\Database\Eloquent\Relations\HasOneThrough - */ - public function hasOneThrough($related, $through, $firstKey = null, $secondKey = null, $localKey = null, $secondLocalKey = null) - { - $through = $this->newRelatedThroughInstance($through); - - $firstKey = $firstKey ?: $this->getForeignKey(); - - $secondKey = $secondKey ?: $through->getForeignKey(); - - return $this->newHasOneThrough( - $this->newRelatedInstance($related)->newQuery(), $this, $through, - $firstKey, $secondKey, $localKey ?: $this->getKeyName(), - $secondLocalKey ?: $through->getKeyName() - ); - } - - /** - * Instantiate a new HasOneThrough relationship. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Model $farParent - * @param \Illuminate\Database\Eloquent\Model $throughParent - * @param string $firstKey - * @param string $secondKey - * @param string $localKey - * @param string $secondLocalKey - * @return \Illuminate\Database\Eloquent\Relations\HasOneThrough - */ - protected function newHasOneThrough(Builder $query, Model $farParent, Model $throughParent, $firstKey, $secondKey, $localKey, $secondLocalKey) - { - return new HasOneThrough($query, $farParent, $throughParent, $firstKey, $secondKey, $localKey, $secondLocalKey); - } - - /** - * Define a polymorphic one-to-one relationship. - * - * @param string $related - * @param string $name - * @param string|null $type - * @param string|null $id - * @param string|null $localKey - * @return \Illuminate\Database\Eloquent\Relations\MorphOne - */ - public function morphOne($related, $name, $type = null, $id = null, $localKey = null) - { - $instance = $this->newRelatedInstance($related); - - [$type, $id] = $this->getMorphs($name, $type, $id); - - $table = $instance->getTable(); - - $localKey = $localKey ?: $this->getKeyName(); - - return $this->newMorphOne($instance->newQuery(), $this, $table.'.'.$type, $table.'.'.$id, $localKey); - } - - /** - * Instantiate a new MorphOne relationship. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Model $parent - * @param string $type - * @param string $id - * @param string $localKey - * @return \Illuminate\Database\Eloquent\Relations\MorphOne - */ - protected function newMorphOne(Builder $query, Model $parent, $type, $id, $localKey) - { - return new MorphOne($query, $parent, $type, $id, $localKey); - } - - /** - * Define an inverse one-to-one or many relationship. - * - * @param string $related - * @param string|null $foreignKey - * @param string|null $ownerKey - * @param string|null $relation - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo - */ - public function belongsTo($related, $foreignKey = null, $ownerKey = null, $relation = null) - { - // If no relation name was given, we will use this debug backtrace to extract - // the calling method's name and use that as the relationship name as most - // of the time this will be what we desire to use for the relationships. - if (is_null($relation)) { - $relation = $this->guessBelongsToRelation(); - } - - $instance = $this->newRelatedInstance($related); - - // If no foreign key was supplied, we can use a backtrace to guess the proper - // foreign key name by using the name of the relationship function, which - // when combined with an "_id" should conventionally match the columns. - if (is_null($foreignKey)) { - $foreignKey = Str::snake($relation).'_'.$instance->getKeyName(); - } - - // Once we have the foreign key names we'll just create a new Eloquent query - // for the related models and return the relationship instance which will - // actually be responsible for retrieving and hydrating every relation. - $ownerKey = $ownerKey ?: $instance->getKeyName(); - - return $this->newBelongsTo( - $instance->newQuery(), $this, $foreignKey, $ownerKey, $relation - ); - } - - /** - * Instantiate a new BelongsTo relationship. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Model $child - * @param string $foreignKey - * @param string $ownerKey - * @param string $relation - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo - */ - protected function newBelongsTo(Builder $query, Model $child, $foreignKey, $ownerKey, $relation) - { - return new BelongsTo($query, $child, $foreignKey, $ownerKey, $relation); - } - - /** - * Define a polymorphic, inverse one-to-one or many relationship. - * - * @param string|null $name - * @param string|null $type - * @param string|null $id - * @param string|null $ownerKey - * @return \Illuminate\Database\Eloquent\Relations\MorphTo - */ - public function morphTo($name = null, $type = null, $id = null, $ownerKey = null) - { - // If no name is provided, we will use the backtrace to get the function name - // since that is most likely the name of the polymorphic interface. We can - // use that to get both the class and foreign key that will be utilized. - $name = $name ?: $this->guessBelongsToRelation(); - - [$type, $id] = $this->getMorphs( - Str::snake($name), $type, $id - ); - - // If the type value is null it is probably safe to assume we're eager loading - // the relationship. In this case we'll just pass in a dummy query where we - // need to remove any eager loads that may already be defined on a model. - return is_null($class = $this->getAttributeFromArray($type)) || $class === '' - ? $this->morphEagerTo($name, $type, $id, $ownerKey) - : $this->morphInstanceTo($class, $name, $type, $id, $ownerKey); - } - - /** - * Define a polymorphic, inverse one-to-one or many relationship. - * - * @param string $name - * @param string $type - * @param string $id - * @param string $ownerKey - * @return \Illuminate\Database\Eloquent\Relations\MorphTo - */ - protected function morphEagerTo($name, $type, $id, $ownerKey) - { - return $this->newMorphTo( - $this->newQuery()->setEagerLoads([]), $this, $id, $ownerKey, $type, $name - ); - } - - /** - * Define a polymorphic, inverse one-to-one or many relationship. - * - * @param string $target - * @param string $name - * @param string $type - * @param string $id - * @param string $ownerKey - * @return \Illuminate\Database\Eloquent\Relations\MorphTo - */ - protected function morphInstanceTo($target, $name, $type, $id, $ownerKey) - { - $instance = $this->newRelatedInstance( - static::getActualClassNameForMorph($target) - ); - - return $this->newMorphTo( - $instance->newQuery(), $this, $id, $ownerKey ?? $instance->getKeyName(), $type, $name - ); - } - - /** - * Instantiate a new MorphTo relationship. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Model $parent - * @param string $foreignKey - * @param string $ownerKey - * @param string $type - * @param string $relation - * @return \Illuminate\Database\Eloquent\Relations\MorphTo - */ - protected function newMorphTo(Builder $query, Model $parent, $foreignKey, $ownerKey, $type, $relation) - { - return new MorphTo($query, $parent, $foreignKey, $ownerKey, $type, $relation); - } - - /** - * Retrieve the actual class name for a given morph class. - * - * @param string $class - * @return string - */ - public static function getActualClassNameForMorph($class) - { - return Arr::get(Relation::morphMap() ?: [], $class, $class); - } - - /** - * Guess the "belongs to" relationship name. - * - * @return string - */ - protected function guessBelongsToRelation() - { - [$one, $two, $caller] = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3); - - return $caller['function']; - } - - /** - * Define a one-to-many relationship. - * - * @param string $related - * @param string|null $foreignKey - * @param string|null $localKey - * @return \Illuminate\Database\Eloquent\Relations\HasMany - */ - public function hasMany($related, $foreignKey = null, $localKey = null) - { - $instance = $this->newRelatedInstance($related); - - $foreignKey = $foreignKey ?: $this->getForeignKey(); - - $localKey = $localKey ?: $this->getKeyName(); - - return $this->newHasMany( - $instance->newQuery(), $this, $instance->getTable().'.'.$foreignKey, $localKey - ); - } - - /** - * Instantiate a new HasMany relationship. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Model $parent - * @param string $foreignKey - * @param string $localKey - * @return \Illuminate\Database\Eloquent\Relations\HasMany - */ - protected function newHasMany(Builder $query, Model $parent, $foreignKey, $localKey) - { - return new HasMany($query, $parent, $foreignKey, $localKey); - } - - /** - * Define a has-many-through relationship. - * - * @param string $related - * @param string $through - * @param string|null $firstKey - * @param string|null $secondKey - * @param string|null $localKey - * @param string|null $secondLocalKey - * @return \Illuminate\Database\Eloquent\Relations\HasManyThrough - */ - public function hasManyThrough($related, $through, $firstKey = null, $secondKey = null, $localKey = null, $secondLocalKey = null) - { - $through = $this->newRelatedThroughInstance($through); - - $firstKey = $firstKey ?: $this->getForeignKey(); - - $secondKey = $secondKey ?: $through->getForeignKey(); - - return $this->newHasManyThrough( - $this->newRelatedInstance($related)->newQuery(), - $this, - $through, - $firstKey, - $secondKey, - $localKey ?: $this->getKeyName(), - $secondLocalKey ?: $through->getKeyName() - ); - } - - /** - * Instantiate a new HasManyThrough relationship. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Model $farParent - * @param \Illuminate\Database\Eloquent\Model $throughParent - * @param string $firstKey - * @param string $secondKey - * @param string $localKey - * @param string $secondLocalKey - * @return \Illuminate\Database\Eloquent\Relations\HasManyThrough - */ - protected function newHasManyThrough(Builder $query, Model $farParent, Model $throughParent, $firstKey, $secondKey, $localKey, $secondLocalKey) - { - return new HasManyThrough($query, $farParent, $throughParent, $firstKey, $secondKey, $localKey, $secondLocalKey); - } - - /** - * Define a polymorphic one-to-many relationship. - * - * @param string $related - * @param string $name - * @param string|null $type - * @param string|null $id - * @param string|null $localKey - * @return \Illuminate\Database\Eloquent\Relations\MorphMany - */ - public function morphMany($related, $name, $type = null, $id = null, $localKey = null) - { - $instance = $this->newRelatedInstance($related); - - // Here we will gather up the morph type and ID for the relationship so that we - // can properly query the intermediate table of a relation. Finally, we will - // get the table and create the relationship instances for the developers. - [$type, $id] = $this->getMorphs($name, $type, $id); - - $table = $instance->getTable(); - - $localKey = $localKey ?: $this->getKeyName(); - - return $this->newMorphMany($instance->newQuery(), $this, $table.'.'.$type, $table.'.'.$id, $localKey); - } - - /** - * Instantiate a new MorphMany relationship. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Model $parent - * @param string $type - * @param string $id - * @param string $localKey - * @return \Illuminate\Database\Eloquent\Relations\MorphMany - */ - protected function newMorphMany(Builder $query, Model $parent, $type, $id, $localKey) - { - return new MorphMany($query, $parent, $type, $id, $localKey); - } - - /** - * Define a many-to-many relationship. - * - * @param string $related - * @param string|null $table - * @param string|null $foreignPivotKey - * @param string|null $relatedPivotKey - * @param string|null $parentKey - * @param string|null $relatedKey - * @param string|null $relation - * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany - */ - public function belongsToMany($related, $table = null, $foreignPivotKey = null, $relatedPivotKey = null, - $parentKey = null, $relatedKey = null, $relation = null) - { - // If no relationship name was passed, we will pull backtraces to get the - // name of the calling function. We will use that function name as the - // title of this relation since that is a great convention to apply. - if (is_null($relation)) { - $relation = $this->guessBelongsToManyRelation(); - } - - // First, we'll need to determine the foreign key and "other key" for the - // relationship. Once we have determined the keys we'll make the query - // instances as well as the relationship instances we need for this. - $instance = $this->newRelatedInstance($related); - - $foreignPivotKey = $foreignPivotKey ?: $this->getForeignKey(); - - $relatedPivotKey = $relatedPivotKey ?: $instance->getForeignKey(); - - // If no table name was provided, we can guess it by concatenating the two - // models using underscores in alphabetical order. The two model names - // are transformed to snake case from their default CamelCase also. - if (is_null($table)) { - $table = $this->joiningTable($related, $instance); - } - - return $this->newBelongsToMany( - $instance->newQuery(), $this, $table, $foreignPivotKey, - $relatedPivotKey, $parentKey ?: $this->getKeyName(), - $relatedKey ?: $instance->getKeyName(), $relation - ); - } - - /** - * Instantiate a new BelongsToMany relationship. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Model $parent - * @param string $table - * @param string $foreignPivotKey - * @param string $relatedPivotKey - * @param string $parentKey - * @param string $relatedKey - * @param string|null $relationName - * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany - */ - protected function newBelongsToMany(Builder $query, Model $parent, $table, $foreignPivotKey, $relatedPivotKey, - $parentKey, $relatedKey, $relationName = null) - { - return new BelongsToMany($query, $parent, $table, $foreignPivotKey, $relatedPivotKey, $parentKey, $relatedKey, $relationName); - } - - /** - * Define a polymorphic many-to-many relationship. - * - * @param string $related - * @param string $name - * @param string|null $table - * @param string|null $foreignPivotKey - * @param string|null $relatedPivotKey - * @param string|null $parentKey - * @param string|null $relatedKey - * @param bool $inverse - * @return \Illuminate\Database\Eloquent\Relations\MorphToMany - */ - public function morphToMany($related, $name, $table = null, $foreignPivotKey = null, - $relatedPivotKey = null, $parentKey = null, - $relatedKey = null, $inverse = false) - { - $caller = $this->guessBelongsToManyRelation(); - - // First, we will need to determine the foreign key and "other key" for the - // relationship. Once we have determined the keys we will make the query - // instances, as well as the relationship instances we need for these. - $instance = $this->newRelatedInstance($related); - - $foreignPivotKey = $foreignPivotKey ?: $name.'_id'; - - $relatedPivotKey = $relatedPivotKey ?: $instance->getForeignKey(); - - // Now we're ready to create a new query builder for the related model and - // the relationship instances for this relation. This relation will set - // appropriate query constraints then entirely manage the hydrations. - if (! $table) { - $words = preg_split('/(_)/u', $name, -1, PREG_SPLIT_DELIM_CAPTURE); - - $lastWord = array_pop($words); - - $table = implode('', $words).Str::plural($lastWord); - } - - return $this->newMorphToMany( - $instance->newQuery(), $this, $name, $table, - $foreignPivotKey, $relatedPivotKey, $parentKey ?: $this->getKeyName(), - $relatedKey ?: $instance->getKeyName(), $caller, $inverse - ); - } - - /** - * Instantiate a new MorphToMany relationship. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Model $parent - * @param string $name - * @param string $table - * @param string $foreignPivotKey - * @param string $relatedPivotKey - * @param string $parentKey - * @param string $relatedKey - * @param string|null $relationName - * @param bool $inverse - * @return \Illuminate\Database\Eloquent\Relations\MorphToMany - */ - protected function newMorphToMany(Builder $query, Model $parent, $name, $table, $foreignPivotKey, - $relatedPivotKey, $parentKey, $relatedKey, - $relationName = null, $inverse = false) - { - return new MorphToMany($query, $parent, $name, $table, $foreignPivotKey, $relatedPivotKey, $parentKey, $relatedKey, - $relationName, $inverse); - } - - /** - * Define a polymorphic, inverse many-to-many relationship. - * - * @param string $related - * @param string $name - * @param string|null $table - * @param string|null $foreignPivotKey - * @param string|null $relatedPivotKey - * @param string|null $parentKey - * @param string|null $relatedKey - * @return \Illuminate\Database\Eloquent\Relations\MorphToMany - */ - public function morphedByMany($related, $name, $table = null, $foreignPivotKey = null, - $relatedPivotKey = null, $parentKey = null, $relatedKey = null) - { - $foreignPivotKey = $foreignPivotKey ?: $this->getForeignKey(); - - // For the inverse of the polymorphic many-to-many relations, we will change - // the way we determine the foreign and other keys, as it is the opposite - // of the morph-to-many method since we're figuring out these inverses. - $relatedPivotKey = $relatedPivotKey ?: $name.'_id'; - - return $this->morphToMany( - $related, $name, $table, $foreignPivotKey, - $relatedPivotKey, $parentKey, $relatedKey, true - ); - } - - /** - * Get the relationship name of the belongsToMany relationship. - * - * @return string|null - */ - protected function guessBelongsToManyRelation() - { - $caller = Arr::first(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS), function ($trace) { - return ! in_array( - $trace['function'], - array_merge(static::$manyMethods, ['guessBelongsToManyRelation']) - ); - }); - - return ! is_null($caller) ? $caller['function'] : null; - } - - /** - * Get the joining table name for a many-to-many relation. - * - * @param string $related - * @param \Illuminate\Database\Eloquent\Model|null $instance - * @return string - */ - public function joiningTable($related, $instance = null) - { - // The joining table name, by convention, is simply the snake cased models - // sorted alphabetically and concatenated with an underscore, so we can - // just sort the models and join them together to get the table name. - $segments = [ - $instance ? $instance->joiningTableSegment() - : Str::snake(class_basename($related)), - $this->joiningTableSegment(), - ]; - - // Now that we have the model names in an array we can just sort them and - // use the implode function to join them together with an underscores, - // which is typically used by convention within the database system. - sort($segments); - - return strtolower(implode('_', $segments)); - } - - /** - * Get this model's half of the intermediate table name for belongsToMany relationships. - * - * @return string - */ - public function joiningTableSegment() - { - return Str::snake(class_basename($this)); - } - - /** - * Determine if the model touches a given relation. - * - * @param string $relation - * @return bool - */ - public function touches($relation) - { - return in_array($relation, $this->getTouchedRelations()); - } - - /** - * Touch the owning relations of the model. - * - * @return void - */ - public function touchOwners() - { - foreach ($this->getTouchedRelations() as $relation) { - $this->$relation()->touch(); - - if ($this->$relation instanceof self) { - $this->$relation->fireModelEvent('saved', false); - - $this->$relation->touchOwners(); - } elseif ($this->$relation instanceof Collection) { - $this->$relation->each->touchOwners(); - } - } - } - - /** - * Get the polymorphic relationship columns. - * - * @param string $name - * @param string $type - * @param string $id - * @return array - */ - protected function getMorphs($name, $type, $id) - { - return [$type ?: $name.'_type', $id ?: $name.'_id']; - } - - /** - * Get the class name for polymorphic relations. - * - * @return string - */ - public function getMorphClass() - { - $morphMap = Relation::morphMap(); - - if (! empty($morphMap) && in_array(static::class, $morphMap)) { - return array_search(static::class, $morphMap, true); - } - - if (static::class === Pivot::class) { - return static::class; - } - - if (Relation::requiresMorphMap()) { - throw new ClassMorphViolationException($this); - } - - return static::class; - } - - /** - * Create a new model instance for a related model. - * - * @param string $class - * @return mixed - */ - protected function newRelatedInstance($class) - { - return tap(new $class, function ($instance) { - if (! $instance->getConnectionName()) { - $instance->setConnection($this->connection); - } - }); - } - - /** - * Create a new model instance for a related "through" model. - * - * @param string $class - * @return mixed - */ - protected function newRelatedThroughInstance($class) - { - return new $class; - } - - /** - * Get all the loaded relations for the instance. - * - * @return array - */ - public function getRelations() - { - return $this->relations; - } - - /** - * Get a specified relationship. - * - * @param string $relation - * @return mixed - */ - public function getRelation($relation) - { - return $this->relations[$relation]; - } - - /** - * Determine if the given relation is loaded. - * - * @param string $key - * @return bool - */ - public function relationLoaded($key) - { - return array_key_exists($key, $this->relations); - } - - /** - * Set the given relationship on the model. - * - * @param string $relation - * @param mixed $value - * @return $this - */ - public function setRelation($relation, $value) - { - $this->relations[$relation] = $value; - - return $this; - } - - /** - * Unset a loaded relationship. - * - * @param string $relation - * @return $this - */ - public function unsetRelation($relation) - { - unset($this->relations[$relation]); - - return $this; - } - - /** - * Set the entire relations array on the model. - * - * @param array $relations - * @return $this - */ - public function setRelations(array $relations) - { - $this->relations = $relations; - - return $this; - } - - /** - * Duplicate the instance and unset all the loaded relations. - * - * @return $this - */ - public function withoutRelations() - { - $model = clone $this; - - return $model->unsetRelations(); - } - - /** - * Unset all the loaded relations for the instance. - * - * @return $this - */ - public function unsetRelations() - { - $this->relations = []; - - return $this; - } - - /** - * Get the relationships that are touched on save. - * - * @return array - */ - public function getTouchedRelations() - { - return $this->touches; - } - - /** - * Set the relationships that are touched on save. - * - * @param array $touches - * @return $this - */ - public function setTouchedRelations(array $touches) - { - $this->touches = $touches; - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasTimestamps.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasTimestamps.php deleted file mode 100644 index 2b6dfab6..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasTimestamps.php +++ /dev/null @@ -1,224 +0,0 @@ -$attribute = $this->freshTimestamp(); - - return $this->save(); - } - - if (! $this->usesTimestamps()) { - return false; - } - - $this->updateTimestamps(); - - return $this->save(); - } - - /** - * Update the model's update timestamp without raising any events. - * - * @param string|null $attribute - * @return bool - */ - public function touchQuietly($attribute = null) - { - return static::withoutEvents(fn () => $this->touch($attribute)); - } - - /** - * Update the creation and update timestamps. - * - * @return $this - */ - public function updateTimestamps() - { - $time = $this->freshTimestamp(); - - $updatedAtColumn = $this->getUpdatedAtColumn(); - - if (! is_null($updatedAtColumn) && ! $this->isDirty($updatedAtColumn)) { - $this->setUpdatedAt($time); - } - - $createdAtColumn = $this->getCreatedAtColumn(); - - if (! $this->exists && ! is_null($createdAtColumn) && ! $this->isDirty($createdAtColumn)) { - $this->setCreatedAt($time); - } - - return $this; - } - - /** - * Set the value of the "created at" attribute. - * - * @param mixed $value - * @return $this - */ - public function setCreatedAt($value) - { - $this->{$this->getCreatedAtColumn()} = $value; - - return $this; - } - - /** - * Set the value of the "updated at" attribute. - * - * @param mixed $value - * @return $this - */ - public function setUpdatedAt($value) - { - $this->{$this->getUpdatedAtColumn()} = $value; - - return $this; - } - - /** - * Get a fresh timestamp for the model. - * - * @return \Illuminate\Support\Carbon - */ - public function freshTimestamp() - { - return Date::now(); - } - - /** - * Get a fresh timestamp for the model. - * - * @return string - */ - public function freshTimestampString() - { - return $this->fromDateTime($this->freshTimestamp()); - } - - /** - * Determine if the model uses timestamps. - * - * @return bool - */ - public function usesTimestamps() - { - return $this->timestamps && ! static::isIgnoringTimestamps($this::class); - } - - /** - * Get the name of the "created at" column. - * - * @return string|null - */ - public function getCreatedAtColumn() - { - return static::CREATED_AT; - } - - /** - * Get the name of the "updated at" column. - * - * @return string|null - */ - public function getUpdatedAtColumn() - { - return static::UPDATED_AT; - } - - /** - * Get the fully qualified "created at" column. - * - * @return string|null - */ - public function getQualifiedCreatedAtColumn() - { - return $this->qualifyColumn($this->getCreatedAtColumn()); - } - - /** - * Get the fully qualified "updated at" column. - * - * @return string|null - */ - public function getQualifiedUpdatedAtColumn() - { - return $this->qualifyColumn($this->getUpdatedAtColumn()); - } - - /** - * Disable timestamps for the current class during the given callback scope. - * - * @param callable $callback - * @return mixed - */ - public static function withoutTimestamps(callable $callback) - { - return static::withoutTimestampsOn([static::class], $callback); - } - - /** - * Disable timestamps for the given model classes during the given callback scope. - * - * @param array $models - * @param callable $callback - * @return mixed - */ - public static function withoutTimestampsOn($models, $callback) - { - static::$ignoreTimestampsOn = array_values(array_merge(static::$ignoreTimestampsOn, $models)); - - try { - return $callback(); - } finally { - static::$ignoreTimestampsOn = array_values(array_diff(static::$ignoreTimestampsOn, $models)); - } - } - - /** - * Determine if the given model is ignoring timestamps / touches. - * - * @param string|null $class - * @return bool - */ - public static function isIgnoringTimestamps($class = null) - { - $class ??= static::class; - - foreach (static::$ignoreTimestampsOn as $ignoredClass) { - if ($class === $ignoredClass || is_subclass_of($class, $ignoredClass)) { - return true; - } - } - - return false; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasUlids.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasUlids.php deleted file mode 100644 index b944c5d6..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasUlids.php +++ /dev/null @@ -1,96 +0,0 @@ -uniqueIds() as $column) { - if (empty($model->{$column})) { - $model->{$column} = $model->newUniqueId(); - } - } - }); - } - - /** - * Generate a new ULID for the model. - * - * @return string - */ - public function newUniqueId() - { - return strtolower((string) Str::ulid()); - } - - /** - * Retrieve the model for a bound value. - * - * @param \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Relations\Relation $query - * @param mixed $value - * @param string|null $field - * @return \Illuminate\Database\Eloquent\Relations\Relation - * - * @throws \Illuminate\Database\Eloquent\ModelNotFoundException - */ - public function resolveRouteBindingQuery($query, $value, $field = null) - { - if ($field && in_array($field, $this->uniqueIds()) && ! Str::isUlid($value)) { - throw (new ModelNotFoundException)->setModel(get_class($this), $value); - } - - if (! $field && in_array($this->getRouteKeyName(), $this->uniqueIds()) && ! Str::isUlid($value)) { - throw (new ModelNotFoundException)->setModel(get_class($this), $value); - } - - return parent::resolveRouteBindingQuery($query, $value, $field); - } - - /** - * Get the columns that should receive a unique identifier. - * - * @return array - */ - public function uniqueIds() - { - return [$this->getKeyName()]; - } - - /** - * Get the auto-incrementing key type. - * - * @return string - */ - public function getKeyType() - { - if (in_array($this->getKeyName(), $this->uniqueIds())) { - return 'string'; - } - - return $this->keyType; - } - - /** - * Get the value indicating whether the IDs are incrementing. - * - * @return bool - */ - public function getIncrementing() - { - if (in_array($this->getKeyName(), $this->uniqueIds())) { - return false; - } - - return $this->incrementing; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasUuids.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasUuids.php deleted file mode 100644 index 96a08b66..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasUuids.php +++ /dev/null @@ -1,96 +0,0 @@ -uniqueIds() as $column) { - if (empty($model->{$column})) { - $model->{$column} = $model->newUniqueId(); - } - } - }); - } - - /** - * Generate a new UUID for the model. - * - * @return string - */ - public function newUniqueId() - { - return (string) Str::orderedUuid(); - } - - /** - * Get the columns that should receive a unique identifier. - * - * @return array - */ - public function uniqueIds() - { - return [$this->getKeyName()]; - } - - /** - * Retrieve the model for a bound value. - * - * @param \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Relations\Relation $query - * @param mixed $value - * @param string|null $field - * @return \Illuminate\Database\Eloquent\Relations\Relation - * - * @throws \Illuminate\Database\Eloquent\ModelNotFoundException - */ - public function resolveRouteBindingQuery($query, $value, $field = null) - { - if ($field && in_array($field, $this->uniqueIds()) && ! Str::isUuid($value)) { - throw (new ModelNotFoundException)->setModel(get_class($this), $value); - } - - if (! $field && in_array($this->getRouteKeyName(), $this->uniqueIds()) && ! Str::isUuid($value)) { - throw (new ModelNotFoundException)->setModel(get_class($this), $value); - } - - return parent::resolveRouteBindingQuery($query, $value, $field); - } - - /** - * Get the auto-incrementing key type. - * - * @return string - */ - public function getKeyType() - { - if (in_array($this->getKeyName(), $this->uniqueIds())) { - return 'string'; - } - - return $this->keyType; - } - - /** - * Get the value indicating whether the IDs are incrementing. - * - * @return bool - */ - public function getIncrementing() - { - if (in_array($this->getKeyName(), $this->uniqueIds())) { - return false; - } - - return $this->incrementing; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HidesAttributes.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HidesAttributes.php deleted file mode 100644 index 5a7e3ba3..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HidesAttributes.php +++ /dev/null @@ -1,124 +0,0 @@ - - */ - protected $hidden = []; - - /** - * The attributes that should be visible in serialization. - * - * @var array - */ - protected $visible = []; - - /** - * Get the hidden attributes for the model. - * - * @return array - */ - public function getHidden() - { - return $this->hidden; - } - - /** - * Set the hidden attributes for the model. - * - * @param array $hidden - * @return $this - */ - public function setHidden(array $hidden) - { - $this->hidden = $hidden; - - return $this; - } - - /** - * Get the visible attributes for the model. - * - * @return array - */ - public function getVisible() - { - return $this->visible; - } - - /** - * Set the visible attributes for the model. - * - * @param array $visible - * @return $this - */ - public function setVisible(array $visible) - { - $this->visible = $visible; - - return $this; - } - - /** - * Make the given, typically hidden, attributes visible. - * - * @param array|string|null $attributes - * @return $this - */ - public function makeVisible($attributes) - { - $attributes = is_array($attributes) ? $attributes : func_get_args(); - - $this->hidden = array_diff($this->hidden, $attributes); - - if (! empty($this->visible)) { - $this->visible = array_merge($this->visible, $attributes); - } - - return $this; - } - - /** - * Make the given, typically hidden, attributes visible if the given truth test passes. - * - * @param bool|\Closure $condition - * @param array|string|null $attributes - * @return $this - */ - public function makeVisibleIf($condition, $attributes) - { - return value($condition, $this) ? $this->makeVisible($attributes) : $this; - } - - /** - * Make the given, typically visible, attributes hidden. - * - * @param array|string|null $attributes - * @return $this - */ - public function makeHidden($attributes) - { - $this->hidden = array_merge( - $this->hidden, is_array($attributes) ? $attributes : func_get_args() - ); - - return $this; - } - - /** - * Make the given, typically visible, attributes hidden if the given truth test passes. - * - * @param bool|\Closure $condition - * @param array|string|null $attributes - * @return $this - */ - public function makeHiddenIf($condition, $attributes) - { - return value($condition, $this) ? $this->makeHidden($attributes) : $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/QueriesRelationships.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/QueriesRelationships.php deleted file mode 100644 index 6f64884e..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/QueriesRelationships.php +++ /dev/null @@ -1,879 +0,0 @@ -=', $count = 1, $boolean = 'and', Closure $callback = null) - { - if (is_string($relation)) { - if (str_contains($relation, '.')) { - return $this->hasNested($relation, $operator, $count, $boolean, $callback); - } - - $relation = $this->getRelationWithoutConstraints($relation); - } - - if ($relation instanceof MorphTo) { - return $this->hasMorph($relation, ['*'], $operator, $count, $boolean, $callback); - } - - // If we only need to check for the existence of the relation, then we can optimize - // the subquery to only run a "where exists" clause instead of this full "count" - // clause. This will make these queries run much faster compared with a count. - $method = $this->canUseExistsForExistenceCheck($operator, $count) - ? 'getRelationExistenceQuery' - : 'getRelationExistenceCountQuery'; - - $hasQuery = $relation->{$method}( - $relation->getRelated()->newQueryWithoutRelationships(), $this - ); - - // Next we will call any given callback as an "anonymous" scope so they can get the - // proper logical grouping of the where clauses if needed by this Eloquent query - // builder. Then, we will be ready to finalize and return this query instance. - if ($callback) { - $hasQuery->callScope($callback); - } - - return $this->addHasWhere( - $hasQuery, $relation, $operator, $count, $boolean - ); - } - - /** - * Add nested relationship count / exists conditions to the query. - * - * Sets up recursive call to whereHas until we finish the nested relation. - * - * @param string $relations - * @param string $operator - * @param int $count - * @param string $boolean - * @param \Closure|null $callback - * @return \Illuminate\Database\Eloquent\Builder|static - */ - protected function hasNested($relations, $operator = '>=', $count = 1, $boolean = 'and', $callback = null) - { - $relations = explode('.', $relations); - - $doesntHave = $operator === '<' && $count === 1; - - if ($doesntHave) { - $operator = '>='; - $count = 1; - } - - $closure = function ($q) use (&$closure, &$relations, $operator, $count, $callback) { - // In order to nest "has", we need to add count relation constraints on the - // callback Closure. We'll do this by simply passing the Closure its own - // reference to itself so it calls itself recursively on each segment. - count($relations) > 1 - ? $q->whereHas(array_shift($relations), $closure) - : $q->has(array_shift($relations), $operator, $count, 'and', $callback); - }; - - return $this->has(array_shift($relations), $doesntHave ? '<' : '>=', 1, $boolean, $closure); - } - - /** - * Add a relationship count / exists condition to the query with an "or". - * - * @param string $relation - * @param string $operator - * @param int $count - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function orHas($relation, $operator = '>=', $count = 1) - { - return $this->has($relation, $operator, $count, 'or'); - } - - /** - * Add a relationship count / exists condition to the query. - * - * @param string $relation - * @param string $boolean - * @param \Closure|null $callback - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function doesntHave($relation, $boolean = 'and', Closure $callback = null) - { - return $this->has($relation, '<', 1, $boolean, $callback); - } - - /** - * Add a relationship count / exists condition to the query with an "or". - * - * @param string $relation - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function orDoesntHave($relation) - { - return $this->doesntHave($relation, 'or'); - } - - /** - * Add a relationship count / exists condition to the query with where clauses. - * - * @param string $relation - * @param \Closure|null $callback - * @param string $operator - * @param int $count - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function whereHas($relation, Closure $callback = null, $operator = '>=', $count = 1) - { - return $this->has($relation, $operator, $count, 'and', $callback); - } - - /** - * Add a relationship count / exists condition to the query with where clauses. - * - * Also load the relationship with same condition. - * - * @param string $relation - * @param \Closure|null $callback - * @param string $operator - * @param int $count - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function withWhereHas($relation, Closure $callback = null, $operator = '>=', $count = 1) - { - return $this->whereHas(Str::before($relation, ':'), $callback, $operator, $count) - ->with($callback ? [$relation => fn ($query) => $callback($query)] : $relation); - } - - /** - * Add a relationship count / exists condition to the query with where clauses and an "or". - * - * @param string $relation - * @param \Closure|null $callback - * @param string $operator - * @param int $count - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function orWhereHas($relation, Closure $callback = null, $operator = '>=', $count = 1) - { - return $this->has($relation, $operator, $count, 'or', $callback); - } - - /** - * Add a relationship count / exists condition to the query with where clauses. - * - * @param string $relation - * @param \Closure|null $callback - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function whereDoesntHave($relation, Closure $callback = null) - { - return $this->doesntHave($relation, 'and', $callback); - } - - /** - * Add a relationship count / exists condition to the query with where clauses and an "or". - * - * @param string $relation - * @param \Closure|null $callback - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function orWhereDoesntHave($relation, Closure $callback = null) - { - return $this->doesntHave($relation, 'or', $callback); - } - - /** - * Add a polymorphic relationship count / exists condition to the query. - * - * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation - * @param string|array $types - * @param string $operator - * @param int $count - * @param string $boolean - * @param \Closure|null $callback - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function hasMorph($relation, $types, $operator = '>=', $count = 1, $boolean = 'and', Closure $callback = null) - { - if (is_string($relation)) { - $relation = $this->getRelationWithoutConstraints($relation); - } - - $types = (array) $types; - - if ($types === ['*']) { - $types = $this->model->newModelQuery()->distinct()->pluck($relation->getMorphType())->filter()->all(); - } - - foreach ($types as &$type) { - $type = Relation::getMorphedModel($type) ?? $type; - } - - return $this->where(function ($query) use ($relation, $callback, $operator, $count, $types) { - foreach ($types as $type) { - $query->orWhere(function ($query) use ($relation, $callback, $operator, $count, $type) { - $belongsTo = $this->getBelongsToRelation($relation, $type); - - if ($callback) { - $callback = function ($query) use ($callback, $type) { - return $callback($query, $type); - }; - } - - $query->where($this->qualifyColumn($relation->getMorphType()), '=', (new $type)->getMorphClass()) - ->whereHas($belongsTo, $callback, $operator, $count); - }); - } - }, null, null, $boolean); - } - - /** - * Get the BelongsTo relationship for a single polymorphic type. - * - * @param \Illuminate\Database\Eloquent\Relations\MorphTo $relation - * @param string $type - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo - */ - protected function getBelongsToRelation(MorphTo $relation, $type) - { - $belongsTo = Relation::noConstraints(function () use ($relation, $type) { - return $this->model->belongsTo( - $type, - $relation->getForeignKeyName(), - $relation->getOwnerKeyName() - ); - }); - - $belongsTo->getQuery()->mergeConstraintsFrom($relation->getQuery()); - - return $belongsTo; - } - - /** - * Add a polymorphic relationship count / exists condition to the query with an "or". - * - * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation - * @param string|array $types - * @param string $operator - * @param int $count - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function orHasMorph($relation, $types, $operator = '>=', $count = 1) - { - return $this->hasMorph($relation, $types, $operator, $count, 'or'); - } - - /** - * Add a polymorphic relationship count / exists condition to the query. - * - * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation - * @param string|array $types - * @param string $boolean - * @param \Closure|null $callback - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function doesntHaveMorph($relation, $types, $boolean = 'and', Closure $callback = null) - { - return $this->hasMorph($relation, $types, '<', 1, $boolean, $callback); - } - - /** - * Add a polymorphic relationship count / exists condition to the query with an "or". - * - * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation - * @param string|array $types - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function orDoesntHaveMorph($relation, $types) - { - return $this->doesntHaveMorph($relation, $types, 'or'); - } - - /** - * Add a polymorphic relationship count / exists condition to the query with where clauses. - * - * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation - * @param string|array $types - * @param \Closure|null $callback - * @param string $operator - * @param int $count - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function whereHasMorph($relation, $types, Closure $callback = null, $operator = '>=', $count = 1) - { - return $this->hasMorph($relation, $types, $operator, $count, 'and', $callback); - } - - /** - * Add a polymorphic relationship count / exists condition to the query with where clauses and an "or". - * - * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation - * @param string|array $types - * @param \Closure|null $callback - * @param string $operator - * @param int $count - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function orWhereHasMorph($relation, $types, Closure $callback = null, $operator = '>=', $count = 1) - { - return $this->hasMorph($relation, $types, $operator, $count, 'or', $callback); - } - - /** - * Add a polymorphic relationship count / exists condition to the query with where clauses. - * - * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation - * @param string|array $types - * @param \Closure|null $callback - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function whereDoesntHaveMorph($relation, $types, Closure $callback = null) - { - return $this->doesntHaveMorph($relation, $types, 'and', $callback); - } - - /** - * Add a polymorphic relationship count / exists condition to the query with where clauses and an "or". - * - * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation - * @param string|array $types - * @param \Closure|null $callback - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function orWhereDoesntHaveMorph($relation, $types, Closure $callback = null) - { - return $this->doesntHaveMorph($relation, $types, 'or', $callback); - } - - /** - * Add a basic where clause to a relationship query. - * - * @param string $relation - * @param \Closure|string|array|\Illuminate\Database\Query\Expression $column - * @param mixed $operator - * @param mixed $value - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function whereRelation($relation, $column, $operator = null, $value = null) - { - return $this->whereHas($relation, function ($query) use ($column, $operator, $value) { - if ($column instanceof Closure) { - $column($query); - } else { - $query->where($column, $operator, $value); - } - }); - } - - /** - * Add an "or where" clause to a relationship query. - * - * @param string $relation - * @param \Closure|string|array|\Illuminate\Database\Query\Expression $column - * @param mixed $operator - * @param mixed $value - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function orWhereRelation($relation, $column, $operator = null, $value = null) - { - return $this->orWhereHas($relation, function ($query) use ($column, $operator, $value) { - if ($column instanceof Closure) { - $column($query); - } else { - $query->where($column, $operator, $value); - } - }); - } - - /** - * Add a polymorphic relationship condition to the query with a where clause. - * - * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation - * @param string|array $types - * @param \Closure|string|array|\Illuminate\Database\Query\Expression $column - * @param mixed $operator - * @param mixed $value - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function whereMorphRelation($relation, $types, $column, $operator = null, $value = null) - { - return $this->whereHasMorph($relation, $types, function ($query) use ($column, $operator, $value) { - $query->where($column, $operator, $value); - }); - } - - /** - * Add a polymorphic relationship condition to the query with an "or where" clause. - * - * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation - * @param string|array $types - * @param \Closure|string|array|\Illuminate\Database\Query\Expression $column - * @param mixed $operator - * @param mixed $value - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function orWhereMorphRelation($relation, $types, $column, $operator = null, $value = null) - { - return $this->orWhereHasMorph($relation, $types, function ($query) use ($column, $operator, $value) { - $query->where($column, $operator, $value); - }); - } - - /** - * Add a morph-to relationship condition to the query. - * - * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation - * @param \Illuminate\Database\Eloquent\Model|string $model - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function whereMorphedTo($relation, $model, $boolean = 'and') - { - if (is_string($relation)) { - $relation = $this->getRelationWithoutConstraints($relation); - } - - if (is_string($model)) { - $morphMap = Relation::morphMap(); - - if (! empty($morphMap) && in_array($model, $morphMap)) { - $model = array_search($model, $morphMap, true); - } - - return $this->where($relation->getMorphType(), $model, null, $boolean); - } - - return $this->where(function ($query) use ($relation, $model) { - $query->where($relation->getMorphType(), $model->getMorphClass()) - ->where($relation->getForeignKeyName(), $model->getKey()); - }, null, null, $boolean); - } - - /** - * Add a not morph-to relationship condition to the query. - * - * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation - * @param \Illuminate\Database\Eloquent\Model|string $model - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function whereNotMorphedTo($relation, $model, $boolean = 'and') - { - if (is_string($relation)) { - $relation = $this->getRelationWithoutConstraints($relation); - } - - if (is_string($model)) { - $morphMap = Relation::morphMap(); - - if (! empty($morphMap) && in_array($model, $morphMap)) { - $model = array_search($model, $morphMap, true); - } - - return $this->whereNot($relation->getMorphType(), '<=>', $model, $boolean); - } - - return $this->whereNot(function ($query) use ($relation, $model) { - $query->where($relation->getMorphType(), '<=>', $model->getMorphClass()) - ->where($relation->getForeignKeyName(), '<=>', $model->getKey()); - }, null, null, $boolean); - } - - /** - * Add a morph-to relationship condition to the query with an "or where" clause. - * - * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation - * @param \Illuminate\Database\Eloquent\Model|string $model - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function orWhereMorphedTo($relation, $model) - { - return $this->whereMorphedTo($relation, $model, 'or'); - } - - /** - * Add a not morph-to relationship condition to the query with an "or where" clause. - * - * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation - * @param \Illuminate\Database\Eloquent\Model|string $model - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function orWhereNotMorphedTo($relation, $model) - { - return $this->whereNotMorphedTo($relation, $model, 'or'); - } - - /** - * Add a "belongs to" relationship where clause to the query. - * - * @param \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection<\Illuminate\Database\Eloquent\Model> $related - * @param string|null $relationshipName - * @param string $boolean - * @return $this - * - * @throws \Illuminate\Database\Eloquent\RelationNotFoundException - */ - public function whereBelongsTo($related, $relationshipName = null, $boolean = 'and') - { - if (! $related instanceof Collection) { - $relatedCollection = $related->newCollection([$related]); - } else { - $relatedCollection = $related; - - $related = $relatedCollection->first(); - } - - if ($relatedCollection->isEmpty()) { - throw new InvalidArgumentException('Collection given to whereBelongsTo method may not be empty.'); - } - - if ($relationshipName === null) { - $relationshipName = Str::camel(class_basename($related)); - } - - try { - $relationship = $this->model->{$relationshipName}(); - } catch (BadMethodCallException $exception) { - throw RelationNotFoundException::make($this->model, $relationshipName); - } - - if (! $relationship instanceof BelongsTo) { - throw RelationNotFoundException::make($this->model, $relationshipName, BelongsTo::class); - } - - $this->whereIn( - $relationship->getQualifiedForeignKeyName(), - $relatedCollection->pluck($relationship->getOwnerKeyName())->toArray(), - $boolean, - ); - - return $this; - } - - /** - * Add an "BelongsTo" relationship with an "or where" clause to the query. - * - * @param \Illuminate\Database\Eloquent\Model $related - * @param string|null $relationshipName - * @return $this - * - * @throws \RuntimeException - */ - public function orWhereBelongsTo($related, $relationshipName = null) - { - return $this->whereBelongsTo($related, $relationshipName, 'or'); - } - - /** - * Add subselect queries to include an aggregate value for a relationship. - * - * @param mixed $relations - * @param string $column - * @param string $function - * @return $this - */ - public function withAggregate($relations, $column, $function = null) - { - if (empty($relations)) { - return $this; - } - - if (is_null($this->query->columns)) { - $this->query->select([$this->query->from.'.*']); - } - - $relations = is_array($relations) ? $relations : [$relations]; - - foreach ($this->parseWithRelations($relations) as $name => $constraints) { - // First we will determine if the name has been aliased using an "as" clause on the name - // and if it has we will extract the actual relationship name and the desired name of - // the resulting column. This allows multiple aggregates on the same relationships. - $segments = explode(' ', $name); - - unset($alias); - - if (count($segments) === 3 && Str::lower($segments[1]) === 'as') { - [$name, $alias] = [$segments[0], $segments[2]]; - } - - $relation = $this->getRelationWithoutConstraints($name); - - if ($function) { - $hashedColumn = $this->getRelationHashedColumn($column, $relation); - - $wrappedColumn = $this->getQuery()->getGrammar()->wrap( - $column === '*' ? $column : $relation->getRelated()->qualifyColumn($hashedColumn) - ); - - $expression = $function === 'exists' ? $wrappedColumn : sprintf('%s(%s)', $function, $wrappedColumn); - } else { - $expression = $column; - } - - // Here, we will grab the relationship sub-query and prepare to add it to the main query - // as a sub-select. First, we'll get the "has" query and use that to get the relation - // sub-query. We'll format this relationship name and append this column if needed. - $query = $relation->getRelationExistenceQuery( - $relation->getRelated()->newQuery(), $this, new Expression($expression) - )->setBindings([], 'select'); - - $query->callScope($constraints); - - $query = $query->mergeConstraintsFrom($relation->getQuery())->toBase(); - - // If the query contains certain elements like orderings / more than one column selected - // then we will remove those elements from the query so that it will execute properly - // when given to the database. Otherwise, we may receive SQL errors or poor syntax. - $query->orders = null; - $query->setBindings([], 'order'); - - if (count($query->columns) > 1) { - $query->columns = [$query->columns[0]]; - $query->bindings['select'] = []; - } - - // Finally, we will make the proper column alias to the query and run this sub-select on - // the query builder. Then, we will return the builder instance back to the developer - // for further constraint chaining that needs to take place on the query as needed. - $alias ??= Str::snake( - preg_replace('/[^[:alnum:][:space:]_]/u', '', "$name $function $column") - ); - - if ($function === 'exists') { - $this->selectRaw( - sprintf('exists(%s) as %s', $query->toSql(), $this->getQuery()->grammar->wrap($alias)), - $query->getBindings() - )->withCasts([$alias => 'bool']); - } else { - $this->selectSub( - $function ? $query : $query->limit(1), - $alias - ); - } - } - - return $this; - } - - /** - * Get the relation hashed column name for the given column and relation. - * - * @param string $column - * @param \Illuminate\Database\Eloquent\Relations\Relationship $relation - * @return string - */ - protected function getRelationHashedColumn($column, $relation) - { - if (str_contains($column, '.')) { - return $column; - } - - return $this->getQuery()->from === $relation->getQuery()->getQuery()->from - ? "{$relation->getRelationCountHash(false)}.$column" - : $column; - } - - /** - * Add subselect queries to count the relations. - * - * @param mixed $relations - * @return $this - */ - public function withCount($relations) - { - return $this->withAggregate(is_array($relations) ? $relations : func_get_args(), '*', 'count'); - } - - /** - * Add subselect queries to include the max of the relation's column. - * - * @param string|array $relation - * @param string $column - * @return $this - */ - public function withMax($relation, $column) - { - return $this->withAggregate($relation, $column, 'max'); - } - - /** - * Add subselect queries to include the min of the relation's column. - * - * @param string|array $relation - * @param string $column - * @return $this - */ - public function withMin($relation, $column) - { - return $this->withAggregate($relation, $column, 'min'); - } - - /** - * Add subselect queries to include the sum of the relation's column. - * - * @param string|array $relation - * @param string $column - * @return $this - */ - public function withSum($relation, $column) - { - return $this->withAggregate($relation, $column, 'sum'); - } - - /** - * Add subselect queries to include the average of the relation's column. - * - * @param string|array $relation - * @param string $column - * @return $this - */ - public function withAvg($relation, $column) - { - return $this->withAggregate($relation, $column, 'avg'); - } - - /** - * Add subselect queries to include the existence of related models. - * - * @param string|array $relation - * @return $this - */ - public function withExists($relation) - { - return $this->withAggregate($relation, '*', 'exists'); - } - - /** - * Add the "has" condition where clause to the query. - * - * @param \Illuminate\Database\Eloquent\Builder $hasQuery - * @param \Illuminate\Database\Eloquent\Relations\Relation $relation - * @param string $operator - * @param int $count - * @param string $boolean - * @return \Illuminate\Database\Eloquent\Builder|static - */ - protected function addHasWhere(Builder $hasQuery, Relation $relation, $operator, $count, $boolean) - { - $hasQuery->mergeConstraintsFrom($relation->getQuery()); - - return $this->canUseExistsForExistenceCheck($operator, $count) - ? $this->addWhereExistsQuery($hasQuery->toBase(), $boolean, $operator === '<' && $count === 1) - : $this->addWhereCountQuery($hasQuery->toBase(), $operator, $count, $boolean); - } - - /** - * Merge the where constraints from another query to the current query. - * - * @param \Illuminate\Database\Eloquent\Builder $from - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function mergeConstraintsFrom(Builder $from) - { - $whereBindings = $from->getQuery()->getRawBindings()['where'] ?? []; - - $wheres = $from->getQuery()->from !== $this->getQuery()->from - ? $this->requalifyWhereTables( - $from->getQuery()->wheres, - $from->getQuery()->from, - $this->getModel()->getTable() - ) : $from->getQuery()->wheres; - - // Here we have some other query that we want to merge the where constraints from. We will - // copy over any where constraints on the query as well as remove any global scopes the - // query might have removed. Then we will return ourselves with the finished merging. - return $this->withoutGlobalScopes( - $from->removedScopes() - )->mergeWheres( - $wheres, $whereBindings - ); - } - - /** - * Updates the table name for any columns with a new qualified name. - * - * @param array $wheres - * @param string $from - * @param string $to - * @return array - */ - protected function requalifyWhereTables(array $wheres, string $from, string $to): array - { - return collect($wheres)->map(function ($where) use ($from, $to) { - return collect($where)->map(function ($value) use ($from, $to) { - return is_string($value) && str_starts_with($value, $from.'.') - ? $to.'.'.Str::afterLast($value, '.') - : $value; - }); - })->toArray(); - } - - /** - * Add a sub-query count clause to this query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param string $operator - * @param int $count - * @param string $boolean - * @return $this - */ - protected function addWhereCountQuery(QueryBuilder $query, $operator = '>=', $count = 1, $boolean = 'and') - { - $this->query->addBinding($query->getBindings(), 'where'); - - return $this->where( - new Expression('('.$query->toSql().')'), - $operator, - is_numeric($count) ? new Expression($count) : $count, - $boolean - ); - } - - /** - * Get the "has relation" base query instance. - * - * @param string $relation - * @return \Illuminate\Database\Eloquent\Relations\Relation - */ - protected function getRelationWithoutConstraints($relation) - { - return Relation::noConstraints(function () use ($relation) { - return $this->getModel()->{$relation}(); - }); - } - - /** - * Check if we can run an "exists" query to optimize performance. - * - * @param string $operator - * @param int $count - * @return bool - */ - protected function canUseExistsForExistenceCheck($operator, $count) - { - return ($operator === '>=' || $operator === '<') && $count === 1; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Factories/BelongsToManyRelationship.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Factories/BelongsToManyRelationship.php deleted file mode 100644 index 8e402610..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Factories/BelongsToManyRelationship.php +++ /dev/null @@ -1,76 +0,0 @@ -factory = $factory; - $this->pivot = $pivot; - $this->relationship = $relationship; - } - - /** - * Create the attached relationship for the given model. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @return void - */ - public function createFor(Model $model) - { - Collection::wrap($this->factory instanceof Factory ? $this->factory->create([], $model) : $this->factory)->each(function ($attachable) use ($model) { - $model->{$this->relationship}()->attach( - $attachable, - is_callable($this->pivot) ? call_user_func($this->pivot, $model) : $this->pivot - ); - }); - } - - /** - * Specify the model instances to always use when creating relationships. - * - * @param \Illuminate\Support\Collection $recycle - * @return $this - */ - public function recycle($recycle) - { - if ($this->factory instanceof Factory) { - $this->factory = $this->factory->recycle($recycle); - } - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Factories/BelongsToRelationship.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Factories/BelongsToRelationship.php deleted file mode 100644 index b2fb1b25..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Factories/BelongsToRelationship.php +++ /dev/null @@ -1,97 +0,0 @@ -factory = $factory; - $this->relationship = $relationship; - } - - /** - * Get the parent model attributes and resolvers for the given child model. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @return array - */ - public function attributesFor(Model $model) - { - $relationship = $model->{$this->relationship}(); - - return $relationship instanceof MorphTo ? [ - $relationship->getMorphType() => $this->factory instanceof Factory ? $this->factory->newModel()->getMorphClass() : $this->factory->getMorphClass(), - $relationship->getForeignKeyName() => $this->resolver($relationship->getOwnerKeyName()), - ] : [ - $relationship->getForeignKeyName() => $this->resolver($relationship->getOwnerKeyName()), - ]; - } - - /** - * Get the deferred resolver for this relationship's parent ID. - * - * @param string|null $key - * @return \Closure - */ - protected function resolver($key) - { - return function () use ($key) { - if (! $this->resolved) { - $instance = $this->factory instanceof Factory - ? ($this->factory->getRandomRecycledModel($this->factory->modelName()) ?? $this->factory->create()) - : $this->factory; - - return $this->resolved = $key ? $instance->{$key} : $instance->getKey(); - } - - return $this->resolved; - }; - } - - /** - * Specify the model instances to always use when creating relationships. - * - * @param \Illuminate\Support\Collection $recycle - * @return $this - */ - public function recycle($recycle) - { - if ($this->factory instanceof Factory) { - $this->factory = $this->factory->recycle($recycle); - } - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Factories/CrossJoinSequence.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Factories/CrossJoinSequence.php deleted file mode 100644 index b0efbd0c..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Factories/CrossJoinSequence.php +++ /dev/null @@ -1,26 +0,0 @@ - - */ - protected $model; - - /** - * The number of models that should be generated. - * - * @var int|null - */ - protected $count; - - /** - * The state transformations that will be applied to the model. - * - * @var \Illuminate\Support\Collection - */ - protected $states; - - /** - * The parent relationships that will be applied to the model. - * - * @var \Illuminate\Support\Collection - */ - protected $has; - - /** - * The child relationships that will be applied to the model. - * - * @var \Illuminate\Support\Collection - */ - protected $for; - - /** - * The model instances to always use when creating relationships. - * - * @var \Illuminate\Support\Collection - */ - protected $recycle; - - /** - * The "after making" callbacks that will be applied to the model. - * - * @var \Illuminate\Support\Collection - */ - protected $afterMaking; - - /** - * The "after creating" callbacks that will be applied to the model. - * - * @var \Illuminate\Support\Collection - */ - protected $afterCreating; - - /** - * The name of the database connection that will be used to create the models. - * - * @var string|null - */ - protected $connection; - - /** - * The current Faker instance. - * - * @var \Faker\Generator - */ - protected $faker; - - /** - * The default namespace where factories reside. - * - * @var string - */ - protected static $namespace = 'Database\\Factories\\'; - - /** - * The default model name resolver. - * - * @var callable - */ - protected static $modelNameResolver; - - /** - * The factory name resolver. - * - * @var callable - */ - protected static $factoryNameResolver; - - /** - * Create a new factory instance. - * - * @param int|null $count - * @param \Illuminate\Support\Collection|null $states - * @param \Illuminate\Support\Collection|null $has - * @param \Illuminate\Support\Collection|null $for - * @param \Illuminate\Support\Collection|null $afterMaking - * @param \Illuminate\Support\Collection|null $afterCreating - * @param string|null $connection - * @param \Illuminate\Support\Collection|null $recycle - * @return void - */ - public function __construct($count = null, - ?Collection $states = null, - ?Collection $has = null, - ?Collection $for = null, - ?Collection $afterMaking = null, - ?Collection $afterCreating = null, - $connection = null, - ?Collection $recycle = null) - { - $this->count = $count; - $this->states = $states ?? new Collection; - $this->has = $has ?? new Collection; - $this->for = $for ?? new Collection; - $this->afterMaking = $afterMaking ?? new Collection; - $this->afterCreating = $afterCreating ?? new Collection; - $this->connection = $connection; - $this->recycle = $recycle ?? new Collection; - $this->faker = $this->withFaker(); - } - - /** - * Define the model's default state. - * - * @return array - */ - abstract public function definition(); - - /** - * Get a new factory instance for the given attributes. - * - * @param (callable(array): array)|array $attributes - * @return static - */ - public static function new($attributes = []) - { - return (new static)->state($attributes)->configure(); - } - - /** - * Get a new factory instance for the given number of models. - * - * @param int $count - * @return static - */ - public static function times(int $count) - { - return static::new()->count($count); - } - - /** - * Configure the factory. - * - * @return $this - */ - public function configure() - { - return $this; - } - - /** - * Get the raw attributes generated by the factory. - * - * @param (callable(array): array)|array $attributes - * @param \Illuminate\Database\Eloquent\Model|null $parent - * @return array - */ - public function raw($attributes = [], ?Model $parent = null) - { - if ($this->count === null) { - return $this->state($attributes)->getExpandedAttributes($parent); - } - - return array_map(function () use ($attributes, $parent) { - return $this->state($attributes)->getExpandedAttributes($parent); - }, range(1, $this->count)); - } - - /** - * Create a single model and persist it to the database. - * - * @param (callable(array): array)|array $attributes - * @return \Illuminate\Database\Eloquent\Model|TModel - */ - public function createOne($attributes = []) - { - return $this->count(null)->create($attributes); - } - - /** - * Create a single model and persist it to the database without dispatching any model events. - * - * @param (callable(array): array)|array $attributes - * @return \Illuminate\Database\Eloquent\Model|TModel - */ - public function createOneQuietly($attributes = []) - { - return $this->count(null)->createQuietly($attributes); - } - - /** - * Create a collection of models and persist them to the database. - * - * @param iterable> $records - * @return \Illuminate\Database\Eloquent\Collection - */ - public function createMany(iterable $records) - { - return new EloquentCollection( - collect($records)->map(function ($record) { - return $this->state($record)->create(); - }) - ); - } - - /** - * Create a collection of models and persist them to the database without dispatching any model events. - * - * @param iterable> $records - * @return \Illuminate\Database\Eloquent\Collection - */ - public function createManyQuietly(iterable $records) - { - return Model::withoutEvents(function () use ($records) { - return $this->createMany($records); - }); - } - - /** - * Create a collection of models and persist them to the database. - * - * @param (callable(array): array)|array $attributes - * @param \Illuminate\Database\Eloquent\Model|null $parent - * @return \Illuminate\Database\Eloquent\Collection|\Illuminate\Database\Eloquent\Model|TModel - */ - public function create($attributes = [], ?Model $parent = null) - { - if (! empty($attributes)) { - return $this->state($attributes)->create([], $parent); - } - - $results = $this->make($attributes, $parent); - - if ($results instanceof Model) { - $this->store(collect([$results])); - - $this->callAfterCreating(collect([$results]), $parent); - } else { - $this->store($results); - - $this->callAfterCreating($results, $parent); - } - - return $results; - } - - /** - * Create a collection of models and persist them to the database without dispatching any model events. - * - * @param (callable(array): array)|array $attributes - * @param \Illuminate\Database\Eloquent\Model|null $parent - * @return \Illuminate\Database\Eloquent\Collection|\Illuminate\Database\Eloquent\Model|TModel - */ - public function createQuietly($attributes = [], ?Model $parent = null) - { - return Model::withoutEvents(function () use ($attributes, $parent) { - return $this->create($attributes, $parent); - }); - } - - /** - * Create a callback that persists a model in the database when invoked. - * - * @param array $attributes - * @param \Illuminate\Database\Eloquent\Model|null $parent - * @return \Closure(): (\Illuminate\Database\Eloquent\Collection|\Illuminate\Database\Eloquent\Model|TModel) - */ - public function lazy(array $attributes = [], ?Model $parent = null) - { - return fn () => $this->create($attributes, $parent); - } - - /** - * Set the connection name on the results and store them. - * - * @param \Illuminate\Support\Collection $results - * @return void - */ - protected function store(Collection $results) - { - $results->each(function ($model) { - if (! isset($this->connection)) { - $model->setConnection($model->newQueryWithoutScopes()->getConnection()->getName()); - } - - $model->save(); - - foreach ($model->getRelations() as $name => $items) { - if ($items instanceof Enumerable && $items->isEmpty()) { - $model->unsetRelation($name); - } - } - - $this->createChildren($model); - }); - } - - /** - * Create the children for the given model. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @return void - */ - protected function createChildren(Model $model) - { - Model::unguarded(function () use ($model) { - $this->has->each(function ($has) use ($model) { - $has->recycle($this->recycle)->createFor($model); - }); - }); - } - - /** - * Make a single instance of the model. - * - * @param (callable(array): array)|array $attributes - * @return \Illuminate\Database\Eloquent\Model|TModel - */ - public function makeOne($attributes = []) - { - return $this->count(null)->make($attributes); - } - - /** - * Create a collection of models. - * - * @param (callable(array): array)|array $attributes - * @param \Illuminate\Database\Eloquent\Model|null $parent - * @return \Illuminate\Database\Eloquent\Collection|\Illuminate\Database\Eloquent\Model|TModel - */ - public function make($attributes = [], ?Model $parent = null) - { - if (! empty($attributes)) { - return $this->state($attributes)->make([], $parent); - } - - if ($this->count === null) { - return tap($this->makeInstance($parent), function ($instance) { - $this->callAfterMaking(collect([$instance])); - }); - } - - if ($this->count < 1) { - return $this->newModel()->newCollection(); - } - - $instances = $this->newModel()->newCollection(array_map(function () use ($parent) { - return $this->makeInstance($parent); - }, range(1, $this->count))); - - $this->callAfterMaking($instances); - - return $instances; - } - - /** - * Make an instance of the model with the given attributes. - * - * @param \Illuminate\Database\Eloquent\Model|null $parent - * @return \Illuminate\Database\Eloquent\Model - */ - protected function makeInstance(?Model $parent) - { - return Model::unguarded(function () use ($parent) { - return tap($this->newModel($this->getExpandedAttributes($parent)), function ($instance) { - if (isset($this->connection)) { - $instance->setConnection($this->connection); - } - }); - }); - } - - /** - * Get a raw attributes array for the model. - * - * @param \Illuminate\Database\Eloquent\Model|null $parent - * @return mixed - */ - protected function getExpandedAttributes(?Model $parent) - { - return $this->expandAttributes($this->getRawAttributes($parent)); - } - - /** - * Get the raw attributes for the model as an array. - * - * @param \Illuminate\Database\Eloquent\Model|null $parent - * @return array - */ - protected function getRawAttributes(?Model $parent) - { - return $this->states->pipe(function ($states) { - return $this->for->isEmpty() ? $states : new Collection(array_merge([function () { - return $this->parentResolvers(); - }], $states->all())); - })->reduce(function ($carry, $state) use ($parent) { - if ($state instanceof Closure) { - $state = $state->bindTo($this); - } - - return array_merge($carry, $state($carry, $parent)); - }, $this->definition()); - } - - /** - * Create the parent relationship resolvers (as deferred Closures). - * - * @return array - */ - protected function parentResolvers() - { - $model = $this->newModel(); - - return $this->for->map(function (BelongsToRelationship $for) use ($model) { - return $for->recycle($this->recycle)->attributesFor($model); - })->collapse()->all(); - } - - /** - * Expand all attributes to their underlying values. - * - * @param array $definition - * @return array - */ - protected function expandAttributes(array $definition) - { - return collect($definition) - ->map($evaluateRelations = function ($attribute) { - if ($attribute instanceof self) { - $attribute = $this->getRandomRecycledModel($attribute->modelName()) - ?? $attribute->recycle($this->recycle)->create()->getKey(); - } elseif ($attribute instanceof Model) { - $attribute = $attribute->getKey(); - } - - return $attribute; - }) - ->map(function ($attribute, $key) use (&$definition, $evaluateRelations) { - if (is_callable($attribute) && ! is_string($attribute) && ! is_array($attribute)) { - $attribute = $attribute($definition); - } - - $attribute = $evaluateRelations($attribute); - - $definition[$key] = $attribute; - - return $attribute; - }) - ->all(); - } - - /** - * Add a new state transformation to the model definition. - * - * @param (callable(array, \Illuminate\Database\Eloquent\Model|null): array)|array $state - * @return static - */ - public function state($state) - { - return $this->newInstance([ - 'states' => $this->states->concat([ - is_callable($state) ? $state : function () use ($state) { - return $state; - }, - ]), - ]); - } - - /** - * Set a single model attribute. - * - * @param string|int $key - * @param mixed $value - * @return static - */ - public function set($key, $value) - { - return $this->state([$key => $value]); - } - - /** - * Add a new sequenced state transformation to the model definition. - * - * @param array $sequence - * @return static - */ - public function sequence(...$sequence) - { - return $this->state(new Sequence(...$sequence)); - } - - /** - * Add a new sequenced state transformation to the model definition and update the pending creation count to the size of the sequence. - * - * @param array $sequence - * @return static - */ - public function forEachSequence(...$sequence) - { - return $this->state(new Sequence(...$sequence))->count(count($sequence)); - } - - /** - * Add a new cross joined sequenced state transformation to the model definition. - * - * @param array $sequence - * @return static - */ - public function crossJoinSequence(...$sequence) - { - return $this->state(new CrossJoinSequence(...$sequence)); - } - - /** - * Define a child relationship for the model. - * - * @param \Illuminate\Database\Eloquent\Factories\Factory $factory - * @param string|null $relationship - * @return static - */ - public function has(self $factory, $relationship = null) - { - return $this->newInstance([ - 'has' => $this->has->concat([new Relationship( - $factory, $relationship ?? $this->guessRelationship($factory->modelName()) - )]), - ]); - } - - /** - * Attempt to guess the relationship name for a "has" relationship. - * - * @param string $related - * @return string - */ - protected function guessRelationship(string $related) - { - $guess = Str::camel(Str::plural(class_basename($related))); - - return method_exists($this->modelName(), $guess) ? $guess : Str::singular($guess); - } - - /** - * Define an attached relationship for the model. - * - * @param \Illuminate\Database\Eloquent\Factories\Factory|\Illuminate\Support\Collection|\Illuminate\Database\Eloquent\Model|array $factory - * @param (callable(): array)|array $pivot - * @param string|null $relationship - * @return static - */ - public function hasAttached($factory, $pivot = [], $relationship = null) - { - return $this->newInstance([ - 'has' => $this->has->concat([new BelongsToManyRelationship( - $factory, - $pivot, - $relationship ?? Str::camel(Str::plural(class_basename( - $factory instanceof Factory - ? $factory->modelName() - : Collection::wrap($factory)->first() - ))) - )]), - ]); - } - - /** - * Define a parent relationship for the model. - * - * @param \Illuminate\Database\Eloquent\Factories\Factory|\Illuminate\Database\Eloquent\Model $factory - * @param string|null $relationship - * @return static - */ - public function for($factory, $relationship = null) - { - return $this->newInstance(['for' => $this->for->concat([new BelongsToRelationship( - $factory, - $relationship ?? Str::camel(class_basename( - $factory instanceof Factory ? $factory->modelName() : $factory - )) - )])]); - } - - /** - * Provide model instances to use instead of any nested factory calls when creating relationships. - * - * @param \Illuminate\Database\Eloquent\Model|\Illuminate\Support\Collection|array $model - * @return static - */ - public function recycle($model) - { - // Group provided models by the type and merge them into existing recycle collection - return $this->newInstance([ - 'recycle' => $this->recycle - ->flatten() - ->merge( - Collection::wrap($model instanceof Model ? func_get_args() : $model) - ->flatten() - )->groupBy(fn ($model) => get_class($model)), - ]); - } - - /** - * Retrieve a random model of a given type from previously provided models to recycle. - * - * @param string $modelClassName - * @return \Illuminate\Database\Eloquent\Model|null - */ - public function getRandomRecycledModel($modelClassName) - { - return $this->recycle->get($modelClassName)?->random(); - } - - /** - * Add a new "after making" callback to the model definition. - * - * @param \Closure(\Illuminate\Database\Eloquent\Model|TModel): mixed $callback - * @return static - */ - public function afterMaking(Closure $callback) - { - return $this->newInstance(['afterMaking' => $this->afterMaking->concat([$callback])]); - } - - /** - * Add a new "after creating" callback to the model definition. - * - * @param \Closure(\Illuminate\Database\Eloquent\Model|TModel): mixed $callback - * @return static - */ - public function afterCreating(Closure $callback) - { - return $this->newInstance(['afterCreating' => $this->afterCreating->concat([$callback])]); - } - - /** - * Call the "after making" callbacks for the given model instances. - * - * @param \Illuminate\Support\Collection $instances - * @return void - */ - protected function callAfterMaking(Collection $instances) - { - $instances->each(function ($model) { - $this->afterMaking->each(function ($callback) use ($model) { - $callback($model); - }); - }); - } - - /** - * Call the "after creating" callbacks for the given model instances. - * - * @param \Illuminate\Support\Collection $instances - * @param \Illuminate\Database\Eloquent\Model|null $parent - * @return void - */ - protected function callAfterCreating(Collection $instances, ?Model $parent = null) - { - $instances->each(function ($model) use ($parent) { - $this->afterCreating->each(function ($callback) use ($model, $parent) { - $callback($model, $parent); - }); - }); - } - - /** - * Specify how many models should be generated. - * - * @param int|null $count - * @return static - */ - public function count(?int $count) - { - return $this->newInstance(['count' => $count]); - } - - /** - * Specify the database connection that should be used to generate models. - * - * @param string $connection - * @return static - */ - public function connection(string $connection) - { - return $this->newInstance(['connection' => $connection]); - } - - /** - * Create a new instance of the factory builder with the given mutated properties. - * - * @param array $arguments - * @return static - */ - protected function newInstance(array $arguments = []) - { - return new static(...array_values(array_merge([ - 'count' => $this->count, - 'states' => $this->states, - 'has' => $this->has, - 'for' => $this->for, - 'afterMaking' => $this->afterMaking, - 'afterCreating' => $this->afterCreating, - 'connection' => $this->connection, - 'recycle' => $this->recycle, - ], $arguments))); - } - - /** - * Get a new model instance. - * - * @param array $attributes - * @return \Illuminate\Database\Eloquent\Model|TModel - */ - public function newModel(array $attributes = []) - { - $model = $this->modelName(); - - return new $model($attributes); - } - - /** - * Get the name of the model that is generated by the factory. - * - * @return class-string<\Illuminate\Database\Eloquent\Model|TModel> - */ - public function modelName() - { - $resolver = static::$modelNameResolver ?? function (self $factory) { - $namespacedFactoryBasename = Str::replaceLast( - 'Factory', '', Str::replaceFirst(static::$namespace, '', get_class($factory)) - ); - - $factoryBasename = Str::replaceLast('Factory', '', class_basename($factory)); - - $appNamespace = static::appNamespace(); - - return class_exists($appNamespace.'Models\\'.$namespacedFactoryBasename) - ? $appNamespace.'Models\\'.$namespacedFactoryBasename - : $appNamespace.$factoryBasename; - }; - - return $this->model ?? $resolver($this); - } - - /** - * Specify the callback that should be invoked to guess model names based on factory names. - * - * @param callable(self): class-string<\Illuminate\Database\Eloquent\Model|TModel> $callback - * @return void - */ - public static function guessModelNamesUsing(callable $callback) - { - static::$modelNameResolver = $callback; - } - - /** - * Specify the default namespace that contains the application's model factories. - * - * @param string $namespace - * @return void - */ - public static function useNamespace(string $namespace) - { - static::$namespace = $namespace; - } - - /** - * Get a new factory instance for the given model name. - * - * @param class-string<\Illuminate\Database\Eloquent\Model> $modelName - * @return \Illuminate\Database\Eloquent\Factories\Factory - */ - public static function factoryForModel(string $modelName) - { - $factory = static::resolveFactoryName($modelName); - - return $factory::new(); - } - - /** - * Specify the callback that should be invoked to guess factory names based on dynamic relationship names. - * - * @param callable(class-string<\Illuminate\Database\Eloquent\Model>): class-string<\Illuminate\Database\Eloquent\Factories\Factory> $callback - * @return void - */ - public static function guessFactoryNamesUsing(callable $callback) - { - static::$factoryNameResolver = $callback; - } - - /** - * Get a new Faker instance. - * - * @return \Faker\Generator - */ - protected function withFaker() - { - return Container::getInstance()->make(Generator::class); - } - - /** - * Get the factory name for the given model name. - * - * @param class-string<\Illuminate\Database\Eloquent\Model> $modelName - * @return class-string<\Illuminate\Database\Eloquent\Factories\Factory> - */ - public static function resolveFactoryName(string $modelName) - { - $resolver = static::$factoryNameResolver ?? function (string $modelName) { - $appNamespace = static::appNamespace(); - - $modelName = Str::startsWith($modelName, $appNamespace.'Models\\') - ? Str::after($modelName, $appNamespace.'Models\\') - : Str::after($modelName, $appNamespace); - - return static::$namespace.$modelName.'Factory'; - }; - - return $resolver($modelName); - } - - /** - * Get the application namespace for the application. - * - * @return string - */ - protected static function appNamespace() - { - try { - return Container::getInstance() - ->make(Application::class) - ->getNamespace(); - } catch (Throwable $e) { - return 'App\\'; - } - } - - /** - * Proxy dynamic factory methods onto their proper methods. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - if (static::hasMacro($method)) { - return $this->macroCall($method, $parameters); - } - - if ($method === 'trashed' && in_array(SoftDeletes::class, class_uses_recursive($this->modelName()))) { - return $this->state([ - $this->newModel()->getDeletedAtColumn() => $parameters[0] ?? Carbon::now()->subDay(), - ]); - } - - if (! Str::startsWith($method, ['for', 'has'])) { - static::throwBadMethodCallException($method); - } - - $relationship = Str::camel(Str::substr($method, 3)); - - $relatedModel = get_class($this->newModel()->{$relationship}()->getRelated()); - - if (method_exists($relatedModel, 'newFactory')) { - $factory = $relatedModel::newFactory() ?? static::factoryForModel($relatedModel); - } else { - $factory = static::factoryForModel($relatedModel); - } - - if (str_starts_with($method, 'for')) { - return $this->for($factory->state($parameters[0] ?? []), $relationship); - } elseif (str_starts_with($method, 'has')) { - return $this->has( - $factory - ->count(is_numeric($parameters[0] ?? null) ? $parameters[0] : 1) - ->state((is_callable($parameters[0] ?? null) || is_array($parameters[0] ?? null)) ? $parameters[0] : ($parameters[1] ?? [])), - $relationship - ); - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Factories/HasFactory.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Factories/HasFactory.php deleted file mode 100644 index f10281d1..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Factories/HasFactory.php +++ /dev/null @@ -1,32 +0,0 @@ - - */ - public static function factory($count = null, $state = []) - { - $factory = static::newFactory() ?: Factory::factoryForModel(get_called_class()); - - return $factory - ->count(is_numeric($count) ? $count : null) - ->state(is_callable($count) || is_array($count) ? $count : $state); - } - - /** - * Create a new factory instance for the model. - * - * @return \Illuminate\Database\Eloquent\Factories\Factory - */ - protected static function newFactory() - { - // - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Factories/Relationship.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Factories/Relationship.php deleted file mode 100644 index 3eb62da3..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Factories/Relationship.php +++ /dev/null @@ -1,75 +0,0 @@ -factory = $factory; - $this->relationship = $relationship; - } - - /** - * Create the child relationship for the given parent model. - * - * @param \Illuminate\Database\Eloquent\Model $parent - * @return void - */ - public function createFor(Model $parent) - { - $relationship = $parent->{$this->relationship}(); - - if ($relationship instanceof MorphOneOrMany) { - $this->factory->state([ - $relationship->getMorphType() => $relationship->getMorphClass(), - $relationship->getForeignKeyName() => $relationship->getParentKey(), - ])->create([], $parent); - } elseif ($relationship instanceof HasOneOrMany) { - $this->factory->state([ - $relationship->getForeignKeyName() => $relationship->getParentKey(), - ])->create([], $parent); - } elseif ($relationship instanceof BelongsToMany) { - $relationship->attach($this->factory->create([], $parent)); - } - } - - /** - * Specify the model instances to always use when creating relationships. - * - * @param \Illuminate\Support\Collection $recycle - * @return $this - */ - public function recycle($recycle) - { - $this->factory = $this->factory->recycle($recycle); - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Factories/Sequence.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Factories/Sequence.php deleted file mode 100644 index 064cc4a4..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Factories/Sequence.php +++ /dev/null @@ -1,63 +0,0 @@ -sequence = $sequence; - $this->count = count($sequence); - } - - /** - * Get the current count of the sequence items. - * - * @return int - */ - public function count(): int - { - return $this->count; - } - - /** - * Get the next value in the sequence. - * - * @return mixed - */ - public function __invoke() - { - return tap(value($this->sequence[$this->index % $this->count], $this), function () { - $this->index = $this->index + 1; - }); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/HigherOrderBuilderProxy.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/HigherOrderBuilderProxy.php deleted file mode 100644 index 16b49a1b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/HigherOrderBuilderProxy.php +++ /dev/null @@ -1,50 +0,0 @@ -method = $method; - $this->builder = $builder; - } - - /** - * Proxy a scope call onto the query builder. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - return $this->builder->{$this->method}(function ($value) use ($method, $parameters) { - return $value->{$method}(...$parameters); - }); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/InvalidCastException.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/InvalidCastException.php deleted file mode 100644 index 9d00eb3e..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/InvalidCastException.php +++ /dev/null @@ -1,48 +0,0 @@ -model = $class; - $this->column = $column; - $this->castType = $castType; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/JsonEncodingException.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/JsonEncodingException.php deleted file mode 100644 index f62abd46..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/JsonEncodingException.php +++ /dev/null @@ -1,49 +0,0 @@ -getKey().'] to JSON: '.$message); - } - - /** - * Create a new JSON encoding exception for the resource. - * - * @param \Illuminate\Http\Resources\Json\JsonResource $resource - * @param string $message - * @return static - */ - public static function forResource($resource, $message) - { - $model = $resource->resource; - - return new static('Error encoding resource ['.get_class($resource).'] with model ['.get_class($model).'] with ID ['.$model->getKey().'] to JSON: '.$message); - } - - /** - * Create a new JSON encoding exception for an attribute. - * - * @param mixed $model - * @param mixed $key - * @param string $message - * @return static - */ - public static function forAttribute($model, $key, $message) - { - $class = get_class($model); - - return new static("Unable to encode attribute [{$key}] for model [{$class}] to JSON: {$message}."); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/MassAssignmentException.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/MassAssignmentException.php deleted file mode 100755 index 7c81aae5..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/MassAssignmentException.php +++ /dev/null @@ -1,10 +0,0 @@ -prunable(), function ($query) use ($chunkSize) { - $query->when(! $query->getQuery()->limit, function ($query) use ($chunkSize) { - $query->limit($chunkSize); - }); - }); - - $total = 0; - - do { - $total += $count = in_array(SoftDeletes::class, class_uses_recursive(get_class($this))) - ? $query->forceDelete() - : $query->delete(); - - if ($count > 0) { - event(new ModelsPruned(static::class, $total)); - } - } while ($count > 0); - - return $total; - } - - /** - * Get the prunable model query. - * - * @return \Illuminate\Database\Eloquent\Builder - */ - public function prunable() - { - throw new LogicException('Please implement the prunable method on your model.'); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/MissingAttributeException.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/MissingAttributeException.php deleted file mode 100755 index 87935c14..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/MissingAttributeException.php +++ /dev/null @@ -1,23 +0,0 @@ -bootIfNotBooted(); - - $this->initializeTraits(); - - $this->syncOriginal(); - - $this->fill($attributes); - } - - /** - * Check if the model needs to be booted and if so, do it. - * - * @return void - */ - protected function bootIfNotBooted() - { - if (! isset(static::$booted[static::class])) { - static::$booted[static::class] = true; - - $this->fireModelEvent('booting', false); - - static::booting(); - static::boot(); - static::booted(); - - $this->fireModelEvent('booted', false); - } - } - - /** - * Perform any actions required before the model boots. - * - * @return void - */ - protected static function booting() - { - // - } - - /** - * Bootstrap the model and its traits. - * - * @return void - */ - protected static function boot() - { - static::bootTraits(); - } - - /** - * Boot all of the bootable traits on the model. - * - * @return void - */ - protected static function bootTraits() - { - $class = static::class; - - $booted = []; - - static::$traitInitializers[$class] = []; - - foreach (class_uses_recursive($class) as $trait) { - $method = 'boot'.class_basename($trait); - - if (method_exists($class, $method) && ! in_array($method, $booted)) { - forward_static_call([$class, $method]); - - $booted[] = $method; - } - - if (method_exists($class, $method = 'initialize'.class_basename($trait))) { - static::$traitInitializers[$class][] = $method; - - static::$traitInitializers[$class] = array_unique( - static::$traitInitializers[$class] - ); - } - } - } - - /** - * Initialize any initializable traits on the model. - * - * @return void - */ - protected function initializeTraits() - { - foreach (static::$traitInitializers[static::class] as $method) { - $this->{$method}(); - } - } - - /** - * Perform any actions required after the model boots. - * - * @return void - */ - protected static function booted() - { - // - } - - /** - * Clear the list of booted models so they will be re-booted. - * - * @return void - */ - public static function clearBootedModels() - { - static::$booted = []; - - static::$globalScopes = []; - } - - /** - * Disables relationship model touching for the current class during given callback scope. - * - * @param callable $callback - * @return void - */ - public static function withoutTouching(callable $callback) - { - static::withoutTouchingOn([static::class], $callback); - } - - /** - * Disables relationship model touching for the given model classes during given callback scope. - * - * @param array $models - * @param callable $callback - * @return void - */ - public static function withoutTouchingOn(array $models, callable $callback) - { - static::$ignoreOnTouch = array_values(array_merge(static::$ignoreOnTouch, $models)); - - try { - $callback(); - } finally { - static::$ignoreOnTouch = array_values(array_diff(static::$ignoreOnTouch, $models)); - } - } - - /** - * Determine if the given model is ignoring touches. - * - * @param string|null $class - * @return bool - */ - public static function isIgnoringTouch($class = null) - { - $class = $class ?: static::class; - - if (! get_class_vars($class)['timestamps'] || ! $class::UPDATED_AT) { - return true; - } - - foreach (static::$ignoreOnTouch as $ignoredClass) { - if ($class === $ignoredClass || is_subclass_of($class, $ignoredClass)) { - return true; - } - } - - return false; - } - - /** - * Indicate that models should prevent lazy loading, silently discarding attributes, and accessing missing attributes. - * - * @param bool $shouldBeStrict - * @return void - */ - public static function shouldBeStrict(bool $shouldBeStrict = true) - { - static::preventLazyLoading($shouldBeStrict); - static::preventSilentlyDiscardingAttributes($shouldBeStrict); - static::preventAccessingMissingAttributes($shouldBeStrict); - } - - /** - * Prevent model relationships from being lazy loaded. - * - * @param bool $value - * @return void - */ - public static function preventLazyLoading($value = true) - { - static::$modelsShouldPreventLazyLoading = $value; - } - - /** - * Register a callback that is responsible for handling lazy loading violations. - * - * @param callable|null $callback - * @return void - */ - public static function handleLazyLoadingViolationUsing(?callable $callback) - { - static::$lazyLoadingViolationCallback = $callback; - } - - /** - * Prevent non-fillable attributes from being silently discarded. - * - * @param bool $value - * @return void - */ - public static function preventSilentlyDiscardingAttributes($value = true) - { - static::$modelsShouldPreventSilentlyDiscardingAttributes = $value; - } - - /** - * Register a callback that is responsible for handling discarded attribute violations. - * - * @param callable|null $callback - * @return void - */ - public static function handleDiscardedAttributeViolationUsing(?callable $callback) - { - static::$discardedAttributeViolationCallback = $callback; - } - - /** - * Prevent accessing missing attributes on retrieved models. - * - * @param bool $value - * @return void - */ - public static function preventAccessingMissingAttributes($value = true) - { - static::$modelsShouldPreventAccessingMissingAttributes = $value; - } - - /** - * Register a callback that is responsible for handling lazy loading violations. - * - * @param callable|null $callback - * @return void - */ - public static function handleMissingAttributeViolationUsing(?callable $callback) - { - static::$missingAttributeViolationCallback = $callback; - } - - /** - * Execute a callback without broadcasting any model events for all model types. - * - * @param callable $callback - * @return mixed - */ - public static function withoutBroadcasting(callable $callback) - { - $isBroadcasting = static::$isBroadcasting; - - static::$isBroadcasting = false; - - try { - return $callback(); - } finally { - static::$isBroadcasting = $isBroadcasting; - } - } - - /** - * Fill the model with an array of attributes. - * - * @param array $attributes - * @return $this - * - * @throws \Illuminate\Database\Eloquent\MassAssignmentException - */ - public function fill(array $attributes) - { - $totallyGuarded = $this->totallyGuarded(); - - $fillable = $this->fillableFromArray($attributes); - - foreach ($fillable as $key => $value) { - // The developers may choose to place some attributes in the "fillable" array - // which means only those attributes may be set through mass assignment to - // the model, and all others will just get ignored for security reasons. - if ($this->isFillable($key)) { - $this->setAttribute($key, $value); - } elseif ($totallyGuarded || static::preventsSilentlyDiscardingAttributes()) { - if (isset(static::$discardedAttributeViolationCallback)) { - call_user_func(static::$discardedAttributeViolationCallback, $this, [$key]); - } else { - throw new MassAssignmentException(sprintf( - 'Add [%s] to fillable property to allow mass assignment on [%s].', - $key, get_class($this) - )); - } - } - } - - if (count($attributes) !== count($fillable) && - static::preventsSilentlyDiscardingAttributes()) { - $keys = array_diff(array_keys($attributes), array_keys($fillable)); - - if (isset(static::$discardedAttributeViolationCallback)) { - call_user_func(static::$discardedAttributeViolationCallback, $this, $keys); - } else { - throw new MassAssignmentException(sprintf( - 'Add fillable property [%s] to allow mass assignment on [%s].', - implode(', ', $keys), - get_class($this) - )); - } - } - - return $this; - } - - /** - * Fill the model with an array of attributes. Force mass assignment. - * - * @param array $attributes - * @return $this - */ - public function forceFill(array $attributes) - { - return static::unguarded(fn () => $this->fill($attributes)); - } - - /** - * Qualify the given column name by the model's table. - * - * @param string $column - * @return string - */ - public function qualifyColumn($column) - { - if (str_contains($column, '.')) { - return $column; - } - - return $this->getTable().'.'.$column; - } - - /** - * Qualify the given columns with the model's table. - * - * @param array $columns - * @return array - */ - public function qualifyColumns($columns) - { - return collect($columns)->map(function ($column) { - return $this->qualifyColumn($column); - })->all(); - } - - /** - * Create a new instance of the given model. - * - * @param array $attributes - * @param bool $exists - * @return static - */ - public function newInstance($attributes = [], $exists = false) - { - // This method just provides a convenient way for us to generate fresh model - // instances of this current model. It is particularly useful during the - // hydration of new objects via the Eloquent query builder instances. - $model = new static; - - $model->exists = $exists; - - $model->setConnection( - $this->getConnectionName() - ); - - $model->setTable($this->getTable()); - - $model->mergeCasts($this->casts); - - $model->fill((array) $attributes); - - return $model; - } - - /** - * Create a new model instance that is existing. - * - * @param array $attributes - * @param string|null $connection - * @return static - */ - public function newFromBuilder($attributes = [], $connection = null) - { - $model = $this->newInstance([], true); - - $model->setRawAttributes((array) $attributes, true); - - $model->setConnection($connection ?: $this->getConnectionName()); - - $model->fireModelEvent('retrieved', false); - - return $model; - } - - /** - * Begin querying the model on a given connection. - * - * @param string|null $connection - * @return \Illuminate\Database\Eloquent\Builder - */ - public static function on($connection = null) - { - // First we will just create a fresh instance of this model, and then we can set the - // connection on the model so that it is used for the queries we execute, as well - // as being set on every relation we retrieve without a custom connection name. - $instance = new static; - - $instance->setConnection($connection); - - return $instance->newQuery(); - } - - /** - * Begin querying the model on the write connection. - * - * @return \Illuminate\Database\Eloquent\Builder - */ - public static function onWriteConnection() - { - return static::query()->useWritePdo(); - } - - /** - * Get all of the models from the database. - * - * @param array|string $columns - * @return \Illuminate\Database\Eloquent\Collection - */ - public static function all($columns = ['*']) - { - return static::query()->get( - is_array($columns) ? $columns : func_get_args() - ); - } - - /** - * Begin querying a model with eager loading. - * - * @param array|string $relations - * @return \Illuminate\Database\Eloquent\Builder - */ - public static function with($relations) - { - return static::query()->with( - is_string($relations) ? func_get_args() : $relations - ); - } - - /** - * Eager load relations on the model. - * - * @param array|string $relations - * @return $this - */ - public function load($relations) - { - $query = $this->newQueryWithoutRelationships()->with( - is_string($relations) ? func_get_args() : $relations - ); - - $query->eagerLoadRelations([$this]); - - return $this; - } - - /** - * Eager load relationships on the polymorphic relation of a model. - * - * @param string $relation - * @param array $relations - * @return $this - */ - public function loadMorph($relation, $relations) - { - if (! $this->{$relation}) { - return $this; - } - - $className = get_class($this->{$relation}); - - $this->{$relation}->load($relations[$className] ?? []); - - return $this; - } - - /** - * Eager load relations on the model if they are not already eager loaded. - * - * @param array|string $relations - * @return $this - */ - public function loadMissing($relations) - { - $relations = is_string($relations) ? func_get_args() : $relations; - - $this->newCollection([$this])->loadMissing($relations); - - return $this; - } - - /** - * Eager load relation's column aggregations on the model. - * - * @param array|string $relations - * @param string $column - * @param string $function - * @return $this - */ - public function loadAggregate($relations, $column, $function = null) - { - $this->newCollection([$this])->loadAggregate($relations, $column, $function); - - return $this; - } - - /** - * Eager load relation counts on the model. - * - * @param array|string $relations - * @return $this - */ - public function loadCount($relations) - { - $relations = is_string($relations) ? func_get_args() : $relations; - - return $this->loadAggregate($relations, '*', 'count'); - } - - /** - * Eager load relation max column values on the model. - * - * @param array|string $relations - * @param string $column - * @return $this - */ - public function loadMax($relations, $column) - { - return $this->loadAggregate($relations, $column, 'max'); - } - - /** - * Eager load relation min column values on the model. - * - * @param array|string $relations - * @param string $column - * @return $this - */ - public function loadMin($relations, $column) - { - return $this->loadAggregate($relations, $column, 'min'); - } - - /** - * Eager load relation's column summations on the model. - * - * @param array|string $relations - * @param string $column - * @return $this - */ - public function loadSum($relations, $column) - { - return $this->loadAggregate($relations, $column, 'sum'); - } - - /** - * Eager load relation average column values on the model. - * - * @param array|string $relations - * @param string $column - * @return $this - */ - public function loadAvg($relations, $column) - { - return $this->loadAggregate($relations, $column, 'avg'); - } - - /** - * Eager load related model existence values on the model. - * - * @param array|string $relations - * @return $this - */ - public function loadExists($relations) - { - return $this->loadAggregate($relations, '*', 'exists'); - } - - /** - * Eager load relationship column aggregation on the polymorphic relation of a model. - * - * @param string $relation - * @param array $relations - * @param string $column - * @param string $function - * @return $this - */ - public function loadMorphAggregate($relation, $relations, $column, $function = null) - { - if (! $this->{$relation}) { - return $this; - } - - $className = get_class($this->{$relation}); - - $this->{$relation}->loadAggregate($relations[$className] ?? [], $column, $function); - - return $this; - } - - /** - * Eager load relationship counts on the polymorphic relation of a model. - * - * @param string $relation - * @param array $relations - * @return $this - */ - public function loadMorphCount($relation, $relations) - { - return $this->loadMorphAggregate($relation, $relations, '*', 'count'); - } - - /** - * Eager load relationship max column values on the polymorphic relation of a model. - * - * @param string $relation - * @param array $relations - * @param string $column - * @return $this - */ - public function loadMorphMax($relation, $relations, $column) - { - return $this->loadMorphAggregate($relation, $relations, $column, 'max'); - } - - /** - * Eager load relationship min column values on the polymorphic relation of a model. - * - * @param string $relation - * @param array $relations - * @param string $column - * @return $this - */ - public function loadMorphMin($relation, $relations, $column) - { - return $this->loadMorphAggregate($relation, $relations, $column, 'min'); - } - - /** - * Eager load relationship column summations on the polymorphic relation of a model. - * - * @param string $relation - * @param array $relations - * @param string $column - * @return $this - */ - public function loadMorphSum($relation, $relations, $column) - { - return $this->loadMorphAggregate($relation, $relations, $column, 'sum'); - } - - /** - * Eager load relationship average column values on the polymorphic relation of a model. - * - * @param string $relation - * @param array $relations - * @param string $column - * @return $this - */ - public function loadMorphAvg($relation, $relations, $column) - { - return $this->loadMorphAggregate($relation, $relations, $column, 'avg'); - } - - /** - * Increment a column's value by a given amount. - * - * @param string $column - * @param float|int $amount - * @param array $extra - * @return int - */ - protected function increment($column, $amount = 1, array $extra = []) - { - return $this->incrementOrDecrement($column, $amount, $extra, 'increment'); - } - - /** - * Decrement a column's value by a given amount. - * - * @param string $column - * @param float|int $amount - * @param array $extra - * @return int - */ - protected function decrement($column, $amount = 1, array $extra = []) - { - return $this->incrementOrDecrement($column, $amount, $extra, 'decrement'); - } - - /** - * Run the increment or decrement method on the model. - * - * @param string $column - * @param float|int $amount - * @param array $extra - * @param string $method - * @return int - */ - protected function incrementOrDecrement($column, $amount, $extra, $method) - { - $query = $this->newQueryWithoutRelationships(); - - if (! $this->exists) { - return $query->{$method}($column, $amount, $extra); - } - - $this->{$column} = $this->isClassDeviable($column) - ? $this->deviateClassCastableAttribute($method, $column, $amount) - : $this->{$column} + ($method === 'increment' ? $amount : $amount * -1); - - $this->forceFill($extra); - - if ($this->fireModelEvent('updating') === false) { - return false; - } - - return tap($this->setKeysForSaveQuery($query)->{$method}($column, $amount, $extra), function () use ($column) { - $this->syncChanges(); - - $this->fireModelEvent('updated', false); - - $this->syncOriginalAttribute($column); - }); - } - - /** - * Update the model in the database. - * - * @param array $attributes - * @param array $options - * @return bool - */ - public function update(array $attributes = [], array $options = []) - { - if (! $this->exists) { - return false; - } - - return $this->fill($attributes)->save($options); - } - - /** - * Update the model in the database within a transaction. - * - * @param array $attributes - * @param array $options - * @return bool - * - * @throws \Throwable - */ - public function updateOrFail(array $attributes = [], array $options = []) - { - if (! $this->exists) { - return false; - } - - return $this->fill($attributes)->saveOrFail($options); - } - - /** - * Update the model in the database without raising any events. - * - * @param array $attributes - * @param array $options - * @return bool - */ - public function updateQuietly(array $attributes = [], array $options = []) - { - if (! $this->exists) { - return false; - } - - return $this->fill($attributes)->saveQuietly($options); - } - - /** - * Increment a column's value by a given amount without raising any events. - * - * @param string $column - * @param float|int $amount - * @param array $extra - * @return int - */ - protected function incrementQuietly($column, $amount = 1, array $extra = []) - { - return static::withoutEvents(function () use ($column, $amount, $extra) { - return $this->incrementOrDecrement($column, $amount, $extra, 'increment'); - }); - } - - /** - * Decrement a column's value by a given amount without raising any events. - * - * @param string $column - * @param float|int $amount - * @param array $extra - * @return int - */ - protected function decrementQuietly($column, $amount = 1, array $extra = []) - { - return static::withoutEvents(function () use ($column, $amount, $extra) { - return $this->incrementOrDecrement($column, $amount, $extra, 'decrement'); - }); - } - - /** - * Save the model and all of its relationships. - * - * @return bool - */ - public function push() - { - if (! $this->save()) { - return false; - } - - // To sync all of the relationships to the database, we will simply spin through - // the relationships and save each model via this "push" method, which allows - // us to recurse into all of these nested relations for the model instance. - foreach ($this->relations as $models) { - $models = $models instanceof Collection - ? $models->all() : [$models]; - - foreach (array_filter($models) as $model) { - if (! $model->push()) { - return false; - } - } - } - - return true; - } - - /** - * Save the model to the database without raising any events. - * - * @param array $options - * @return bool - */ - public function saveQuietly(array $options = []) - { - return static::withoutEvents(fn () => $this->save($options)); - } - - /** - * Save the model to the database. - * - * @param array $options - * @return bool - */ - public function save(array $options = []) - { - $this->mergeAttributesFromCachedCasts(); - - $query = $this->newModelQuery(); - - // If the "saving" event returns false we'll bail out of the save and return - // false, indicating that the save failed. This provides a chance for any - // listeners to cancel save operations if validations fail or whatever. - if ($this->fireModelEvent('saving') === false) { - return false; - } - - // If the model already exists in the database we can just update our record - // that is already in this database using the current IDs in this "where" - // clause to only update this model. Otherwise, we'll just insert them. - if ($this->exists) { - $saved = $this->isDirty() ? - $this->performUpdate($query) : true; - } - - // If the model is brand new, we'll insert it into our database and set the - // ID attribute on the model to the value of the newly inserted row's ID - // which is typically an auto-increment value managed by the database. - else { - $saved = $this->performInsert($query); - - if (! $this->getConnectionName() && - $connection = $query->getConnection()) { - $this->setConnection($connection->getName()); - } - } - - // If the model is successfully saved, we need to do a few more things once - // that is done. We will call the "saved" method here to run any actions - // we need to happen after a model gets successfully saved right here. - if ($saved) { - $this->finishSave($options); - } - - return $saved; - } - - /** - * Save the model to the database within a transaction. - * - * @param array $options - * @return bool - * - * @throws \Throwable - */ - public function saveOrFail(array $options = []) - { - return $this->getConnection()->transaction(function () use ($options) { - return $this->save($options); - }); - } - - /** - * Perform any actions that are necessary after the model is saved. - * - * @param array $options - * @return void - */ - protected function finishSave(array $options) - { - $this->fireModelEvent('saved', false); - - if ($this->isDirty() && ($options['touch'] ?? true)) { - $this->touchOwners(); - } - - $this->syncOriginal(); - } - - /** - * Perform a model update operation. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @return bool - */ - protected function performUpdate(Builder $query) - { - // If the updating event returns false, we will cancel the update operation so - // developers can hook Validation systems into their models and cancel this - // operation if the model does not pass validation. Otherwise, we update. - if ($this->fireModelEvent('updating') === false) { - return false; - } - - // First we need to create a fresh query instance and touch the creation and - // update timestamp on the model which are maintained by us for developer - // convenience. Then we will just continue saving the model instances. - if ($this->usesTimestamps()) { - $this->updateTimestamps(); - } - - // Once we have run the update operation, we will fire the "updated" event for - // this model instance. This will allow developers to hook into these after - // models are updated, giving them a chance to do any special processing. - $dirty = $this->getDirty(); - - if (count($dirty) > 0) { - $this->setKeysForSaveQuery($query)->update($dirty); - - $this->syncChanges(); - - $this->fireModelEvent('updated', false); - } - - return true; - } - - /** - * Set the keys for a select query. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @return \Illuminate\Database\Eloquent\Builder - */ - protected function setKeysForSelectQuery($query) - { - $query->where($this->getKeyName(), '=', $this->getKeyForSelectQuery()); - - return $query; - } - - /** - * Get the primary key value for a select query. - * - * @return mixed - */ - protected function getKeyForSelectQuery() - { - return $this->original[$this->getKeyName()] ?? $this->getKey(); - } - - /** - * Set the keys for a save update query. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @return \Illuminate\Database\Eloquent\Builder - */ - protected function setKeysForSaveQuery($query) - { - $query->where($this->getKeyName(), '=', $this->getKeyForSaveQuery()); - - return $query; - } - - /** - * Get the primary key value for a save query. - * - * @return mixed - */ - protected function getKeyForSaveQuery() - { - return $this->original[$this->getKeyName()] ?? $this->getKey(); - } - - /** - * Perform a model insert operation. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @return bool - */ - protected function performInsert(Builder $query) - { - if ($this->fireModelEvent('creating') === false) { - return false; - } - - // First we'll need to create a fresh query instance and touch the creation and - // update timestamps on this model, which are maintained by us for developer - // convenience. After, we will just continue saving these model instances. - if ($this->usesTimestamps()) { - $this->updateTimestamps(); - } - - // If the model has an incrementing key, we can use the "insertGetId" method on - // the query builder, which will give us back the final inserted ID for this - // table from the database. Not all tables have to be incrementing though. - $attributes = $this->getAttributesForInsert(); - - if ($this->getIncrementing()) { - $this->insertAndSetId($query, $attributes); - } - - // If the table isn't incrementing we'll simply insert these attributes as they - // are. These attribute arrays must contain an "id" column previously placed - // there by the developer as the manually determined key for these models. - else { - if (empty($attributes)) { - return true; - } - - $query->insert($attributes); - } - - // We will go ahead and set the exists property to true, so that it is set when - // the created event is fired, just in case the developer tries to update it - // during the event. This will allow them to do so and run an update here. - $this->exists = true; - - $this->wasRecentlyCreated = true; - - $this->fireModelEvent('created', false); - - return true; - } - - /** - * Insert the given attributes and set the ID on the model. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param array $attributes - * @return void - */ - protected function insertAndSetId(Builder $query, $attributes) - { - $id = $query->insertGetId($attributes, $keyName = $this->getKeyName()); - - $this->setAttribute($keyName, $id); - } - - /** - * Destroy the models for the given IDs. - * - * @param \Illuminate\Support\Collection|array|int|string $ids - * @return int - */ - public static function destroy($ids) - { - if ($ids instanceof EloquentCollection) { - $ids = $ids->modelKeys(); - } - - if ($ids instanceof BaseCollection) { - $ids = $ids->all(); - } - - $ids = is_array($ids) ? $ids : func_get_args(); - - if (count($ids) === 0) { - return 0; - } - - // We will actually pull the models from the database table and call delete on - // each of them individually so that their events get fired properly with a - // correct set of attributes in case the developers wants to check these. - $key = ($instance = new static)->getKeyName(); - - $count = 0; - - foreach ($instance->whereIn($key, $ids)->get() as $model) { - if ($model->delete()) { - $count++; - } - } - - return $count; - } - - /** - * Delete the model from the database. - * - * @return bool|null - * - * @throws \LogicException - */ - public function delete() - { - $this->mergeAttributesFromCachedCasts(); - - if (is_null($this->getKeyName())) { - throw new LogicException('No primary key defined on model.'); - } - - // If the model doesn't exist, there is nothing to delete so we'll just return - // immediately and not do anything else. Otherwise, we will continue with a - // deletion process on the model, firing the proper events, and so forth. - if (! $this->exists) { - return; - } - - if ($this->fireModelEvent('deleting') === false) { - return false; - } - - // Here, we'll touch the owning models, verifying these timestamps get updated - // for the models. This will allow any caching to get broken on the parents - // by the timestamp. Then we will go ahead and delete the model instance. - $this->touchOwners(); - - $this->performDeleteOnModel(); - - // Once the model has been deleted, we will fire off the deleted event so that - // the developers may hook into post-delete operations. We will then return - // a boolean true as the delete is presumably successful on the database. - $this->fireModelEvent('deleted', false); - - return true; - } - - /** - * Delete the model from the database without raising any events. - * - * @return bool - */ - public function deleteQuietly() - { - return static::withoutEvents(fn () => $this->delete()); - } - - /** - * Delete the model from the database within a transaction. - * - * @return bool|null - * - * @throws \Throwable - */ - public function deleteOrFail() - { - if (! $this->exists) { - return false; - } - - return $this->getConnection()->transaction(function () { - return $this->delete(); - }); - } - - /** - * Force a hard delete on a soft deleted model. - * - * This method protects developers from running forceDelete when the trait is missing. - * - * @return bool|null - */ - public function forceDelete() - { - return $this->delete(); - } - - /** - * Perform the actual delete query on this model instance. - * - * @return void - */ - protected function performDeleteOnModel() - { - $this->setKeysForSaveQuery($this->newModelQuery())->delete(); - - $this->exists = false; - } - - /** - * Begin querying the model. - * - * @return \Illuminate\Database\Eloquent\Builder - */ - public static function query() - { - return (new static)->newQuery(); - } - - /** - * Get a new query builder for the model's table. - * - * @return \Illuminate\Database\Eloquent\Builder - */ - public function newQuery() - { - return $this->registerGlobalScopes($this->newQueryWithoutScopes()); - } - - /** - * Get a new query builder that doesn't have any global scopes or eager loading. - * - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function newModelQuery() - { - return $this->newEloquentBuilder( - $this->newBaseQueryBuilder() - )->setModel($this); - } - - /** - * Get a new query builder with no relationships loaded. - * - * @return \Illuminate\Database\Eloquent\Builder - */ - public function newQueryWithoutRelationships() - { - return $this->registerGlobalScopes($this->newModelQuery()); - } - - /** - * Register the global scopes for this builder instance. - * - * @param \Illuminate\Database\Eloquent\Builder $builder - * @return \Illuminate\Database\Eloquent\Builder - */ - public function registerGlobalScopes($builder) - { - foreach ($this->getGlobalScopes() as $identifier => $scope) { - $builder->withGlobalScope($identifier, $scope); - } - - return $builder; - } - - /** - * Get a new query builder that doesn't have any global scopes. - * - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function newQueryWithoutScopes() - { - return $this->newModelQuery() - ->with($this->with) - ->withCount($this->withCount); - } - - /** - * Get a new query instance without a given scope. - * - * @param \Illuminate\Database\Eloquent\Scope|string $scope - * @return \Illuminate\Database\Eloquent\Builder - */ - public function newQueryWithoutScope($scope) - { - return $this->newQuery()->withoutGlobalScope($scope); - } - - /** - * Get a new query to restore one or more models by their queueable IDs. - * - * @param array|int $ids - * @return \Illuminate\Database\Eloquent\Builder - */ - public function newQueryForRestoration($ids) - { - return is_array($ids) - ? $this->newQueryWithoutScopes()->whereIn($this->getQualifiedKeyName(), $ids) - : $this->newQueryWithoutScopes()->whereKey($ids); - } - - /** - * Create a new Eloquent query builder for the model. - * - * @param \Illuminate\Database\Query\Builder $query - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function newEloquentBuilder($query) - { - return new Builder($query); - } - - /** - * Get a new query builder instance for the connection. - * - * @return \Illuminate\Database\Query\Builder - */ - protected function newBaseQueryBuilder() - { - return $this->getConnection()->query(); - } - - /** - * Create a new Eloquent Collection instance. - * - * @param array $models - * @return \Illuminate\Database\Eloquent\Collection - */ - public function newCollection(array $models = []) - { - return new Collection($models); - } - - /** - * Create a new pivot model instance. - * - * @param \Illuminate\Database\Eloquent\Model $parent - * @param array $attributes - * @param string $table - * @param bool $exists - * @param string|null $using - * @return \Illuminate\Database\Eloquent\Relations\Pivot - */ - public function newPivot(self $parent, array $attributes, $table, $exists, $using = null) - { - return $using ? $using::fromRawAttributes($parent, $attributes, $table, $exists) - : Pivot::fromAttributes($parent, $attributes, $table, $exists); - } - - /** - * Determine if the model has a given scope. - * - * @param string $scope - * @return bool - */ - public function hasNamedScope($scope) - { - return method_exists($this, 'scope'.ucfirst($scope)); - } - - /** - * Apply the given named scope if possible. - * - * @param string $scope - * @param array $parameters - * @return mixed - */ - public function callNamedScope($scope, array $parameters = []) - { - return $this->{'scope'.ucfirst($scope)}(...$parameters); - } - - /** - * Convert the model instance to an array. - * - * @return array - */ - public function toArray() - { - return array_merge($this->attributesToArray(), $this->relationsToArray()); - } - - /** - * Convert the model instance to JSON. - * - * @param int $options - * @return string - * - * @throws \Illuminate\Database\Eloquent\JsonEncodingException - */ - public function toJson($options = 0) - { - $json = json_encode($this->jsonSerialize(), $options); - - if (json_last_error() !== JSON_ERROR_NONE) { - throw JsonEncodingException::forModel($this, json_last_error_msg()); - } - - return $json; - } - - /** - * Convert the object into something JSON serializable. - * - * @return mixed - */ - public function jsonSerialize(): mixed - { - return $this->toArray(); - } - - /** - * Reload a fresh model instance from the database. - * - * @param array|string $with - * @return static|null - */ - public function fresh($with = []) - { - if (! $this->exists) { - return; - } - - return $this->setKeysForSelectQuery($this->newQueryWithoutScopes()) - ->useWritePdo() - ->with(is_string($with) ? func_get_args() : $with) - ->first(); - } - - /** - * Reload the current model instance with fresh attributes from the database. - * - * @return $this - */ - public function refresh() - { - if (! $this->exists) { - return $this; - } - - $this->setRawAttributes( - $this->setKeysForSelectQuery($this->newQueryWithoutScopes()) - ->useWritePdo() - ->firstOrFail() - ->attributes - ); - - $this->load(collect($this->relations)->reject(function ($relation) { - return $relation instanceof Pivot - || (is_object($relation) && in_array(AsPivot::class, class_uses_recursive($relation), true)); - })->keys()->all()); - - $this->syncOriginal(); - - return $this; - } - - /** - * Clone the model into a new, non-existing instance. - * - * @param array|null $except - * @return static - */ - public function replicate(array $except = null) - { - $defaults = array_values(array_filter([ - $this->getKeyName(), - $this->getCreatedAtColumn(), - $this->getUpdatedAtColumn(), - ])); - - $attributes = Arr::except( - $this->getAttributes(), $except ? array_unique(array_merge($except, $defaults)) : $defaults - ); - - return tap(new static, function ($instance) use ($attributes) { - $instance->setRawAttributes($attributes); - - $instance->setRelations($this->relations); - - $instance->fireModelEvent('replicating', false); - }); - } - - /** - * Clone the model into a new, non-existing instance without raising any events. - * - * @param array|null $except - * @return static - */ - public function replicateQuietly(array $except = null) - { - return static::withoutEvents(fn () => $this->replicate($except)); - } - - /** - * Determine if two models have the same ID and belong to the same table. - * - * @param \Illuminate\Database\Eloquent\Model|null $model - * @return bool - */ - public function is($model) - { - return ! is_null($model) && - $this->getKey() === $model->getKey() && - $this->getTable() === $model->getTable() && - $this->getConnectionName() === $model->getConnectionName(); - } - - /** - * Determine if two models are not the same. - * - * @param \Illuminate\Database\Eloquent\Model|null $model - * @return bool - */ - public function isNot($model) - { - return ! $this->is($model); - } - - /** - * Get the database connection for the model. - * - * @return \Illuminate\Database\Connection - */ - public function getConnection() - { - return static::resolveConnection($this->getConnectionName()); - } - - /** - * Get the current connection name for the model. - * - * @return string|null - */ - public function getConnectionName() - { - return $this->connection; - } - - /** - * Set the connection associated with the model. - * - * @param string|null $name - * @return $this - */ - public function setConnection($name) - { - $this->connection = $name; - - return $this; - } - - /** - * Resolve a connection instance. - * - * @param string|null $connection - * @return \Illuminate\Database\Connection - */ - public static function resolveConnection($connection = null) - { - return static::$resolver->connection($connection); - } - - /** - * Get the connection resolver instance. - * - * @return \Illuminate\Database\ConnectionResolverInterface - */ - public static function getConnectionResolver() - { - return static::$resolver; - } - - /** - * Set the connection resolver instance. - * - * @param \Illuminate\Database\ConnectionResolverInterface $resolver - * @return void - */ - public static function setConnectionResolver(Resolver $resolver) - { - static::$resolver = $resolver; - } - - /** - * Unset the connection resolver for models. - * - * @return void - */ - public static function unsetConnectionResolver() - { - static::$resolver = null; - } - - /** - * Get the table associated with the model. - * - * @return string - */ - public function getTable() - { - return $this->table ?? Str::snake(Str::pluralStudly(class_basename($this))); - } - - /** - * Set the table associated with the model. - * - * @param string $table - * @return $this - */ - public function setTable($table) - { - $this->table = $table; - - return $this; - } - - /** - * Get the primary key for the model. - * - * @return string - */ - public function getKeyName() - { - return $this->primaryKey; - } - - /** - * Set the primary key for the model. - * - * @param string $key - * @return $this - */ - public function setKeyName($key) - { - $this->primaryKey = $key; - - return $this; - } - - /** - * Get the table qualified key name. - * - * @return string - */ - public function getQualifiedKeyName() - { - return $this->qualifyColumn($this->getKeyName()); - } - - /** - * Get the auto-incrementing key type. - * - * @return string - */ - public function getKeyType() - { - return $this->keyType; - } - - /** - * Set the data type for the primary key. - * - * @param string $type - * @return $this - */ - public function setKeyType($type) - { - $this->keyType = $type; - - return $this; - } - - /** - * Get the value indicating whether the IDs are incrementing. - * - * @return bool - */ - public function getIncrementing() - { - return $this->incrementing; - } - - /** - * Set whether IDs are incrementing. - * - * @param bool $value - * @return $this - */ - public function setIncrementing($value) - { - $this->incrementing = $value; - - return $this; - } - - /** - * Get the value of the model's primary key. - * - * @return mixed - */ - public function getKey() - { - return $this->getAttribute($this->getKeyName()); - } - - /** - * Get the queueable identity for the entity. - * - * @return mixed - */ - public function getQueueableId() - { - return $this->getKey(); - } - - /** - * Get the queueable relationships for the entity. - * - * @return array - */ - public function getQueueableRelations() - { - $relations = []; - - foreach ($this->getRelations() as $key => $relation) { - if (! method_exists($this, $key)) { - continue; - } - - $relations[] = $key; - - if ($relation instanceof QueueableCollection) { - foreach ($relation->getQueueableRelations() as $collectionValue) { - $relations[] = $key.'.'.$collectionValue; - } - } - - if ($relation instanceof QueueableEntity) { - foreach ($relation->getQueueableRelations() as $entityValue) { - $relations[] = $key.'.'.$entityValue; - } - } - } - - return array_unique($relations); - } - - /** - * Get the queueable connection for the entity. - * - * @return string|null - */ - public function getQueueableConnection() - { - return $this->getConnectionName(); - } - - /** - * Get the value of the model's route key. - * - * @return mixed - */ - public function getRouteKey() - { - return $this->getAttribute($this->getRouteKeyName()); - } - - /** - * Get the route key for the model. - * - * @return string - */ - public function getRouteKeyName() - { - return $this->getKeyName(); - } - - /** - * Retrieve the model for a bound value. - * - * @param mixed $value - * @param string|null $field - * @return \Illuminate\Database\Eloquent\Model|null - */ - public function resolveRouteBinding($value, $field = null) - { - return $this->resolveRouteBindingQuery($this, $value, $field)->first(); - } - - /** - * Retrieve the model for a bound value. - * - * @param mixed $value - * @param string|null $field - * @return \Illuminate\Database\Eloquent\Model|null - */ - public function resolveSoftDeletableRouteBinding($value, $field = null) - { - return $this->resolveRouteBindingQuery($this, $value, $field)->withTrashed()->first(); - } - - /** - * Retrieve the child model for a bound value. - * - * @param string $childType - * @param mixed $value - * @param string|null $field - * @return \Illuminate\Database\Eloquent\Model|null - */ - public function resolveChildRouteBinding($childType, $value, $field) - { - return $this->resolveChildRouteBindingQuery($childType, $value, $field)->first(); - } - - /** - * Retrieve the child model for a bound value. - * - * @param string $childType - * @param mixed $value - * @param string|null $field - * @return \Illuminate\Database\Eloquent\Model|null - */ - public function resolveSoftDeletableChildRouteBinding($childType, $value, $field) - { - return $this->resolveChildRouteBindingQuery($childType, $value, $field)->withTrashed()->first(); - } - - /** - * Retrieve the child model query for a bound value. - * - * @param string $childType - * @param mixed $value - * @param string|null $field - * @return \Illuminate\Database\Eloquent\Relations\Relation - */ - protected function resolveChildRouteBindingQuery($childType, $value, $field) - { - $relationship = $this->{$this->childRouteBindingRelationshipName($childType)}(); - - $field = $field ?: $relationship->getRelated()->getRouteKeyName(); - - if ($relationship instanceof HasManyThrough || - $relationship instanceof BelongsToMany) { - $field = $relationship->getRelated()->getTable().'.'.$field; - } - - return $relationship instanceof Model - ? $relationship->resolveRouteBindingQuery($relationship, $value, $field) - : $relationship->getRelated()->resolveRouteBindingQuery($relationship, $value, $field); - } - - /** - * Retrieve the child route model binding relationship name for the given child type. - * - * @param string $childType - * @return string - */ - protected function childRouteBindingRelationshipName($childType) - { - return Str::plural(Str::camel($childType)); - } - - /** - * Retrieve the model for a bound value. - * - * @param \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Relations\Relation $query - * @param mixed $value - * @param string|null $field - * @return \Illuminate\Database\Eloquent\Relations\Relation - */ - public function resolveRouteBindingQuery($query, $value, $field = null) - { - return $query->where($field ?? $this->getRouteKeyName(), $value); - } - - /** - * Get the default foreign key name for the model. - * - * @return string - */ - public function getForeignKey() - { - return Str::snake(class_basename($this)).'_'.$this->getKeyName(); - } - - /** - * Get the number of models to return per page. - * - * @return int - */ - public function getPerPage() - { - return $this->perPage; - } - - /** - * Set the number of models to return per page. - * - * @param int $perPage - * @return $this - */ - public function setPerPage($perPage) - { - $this->perPage = $perPage; - - return $this; - } - - /** - * Determine if lazy loading is disabled. - * - * @return bool - */ - public static function preventsLazyLoading() - { - return static::$modelsShouldPreventLazyLoading; - } - - /** - * Determine if discarding guarded attribute fills is disabled. - * - * @return bool - */ - public static function preventsSilentlyDiscardingAttributes() - { - return static::$modelsShouldPreventSilentlyDiscardingAttributes; - } - - /** - * Determine if accessing missing attributes is disabled. - * - * @return bool - */ - public static function preventsAccessingMissingAttributes() - { - return static::$modelsShouldPreventAccessingMissingAttributes; - } - - /** - * Get the broadcast channel route definition that is associated with the given entity. - * - * @return string - */ - public function broadcastChannelRoute() - { - return str_replace('\\', '.', get_class($this)).'.{'.Str::camel(class_basename($this)).'}'; - } - - /** - * Get the broadcast channel name that is associated with the given entity. - * - * @return string - */ - public function broadcastChannel() - { - return str_replace('\\', '.', get_class($this)).'.'.$this->getKey(); - } - - /** - * Dynamically retrieve attributes on the model. - * - * @param string $key - * @return mixed - */ - public function __get($key) - { - return $this->getAttribute($key); - } - - /** - * Dynamically set attributes on the model. - * - * @param string $key - * @param mixed $value - * @return void - */ - public function __set($key, $value) - { - $this->setAttribute($key, $value); - } - - /** - * Determine if the given attribute exists. - * - * @param mixed $offset - * @return bool - */ - public function offsetExists($offset): bool - { - try { - return ! is_null($this->getAttribute($offset)); - } catch (MissingAttributeException) { - return false; - } - } - - /** - * Get the value for a given offset. - * - * @param mixed $offset - * @return mixed - */ - public function offsetGet($offset): mixed - { - return $this->getAttribute($offset); - } - - /** - * Set the value for a given offset. - * - * @param mixed $offset - * @param mixed $value - * @return void - */ - public function offsetSet($offset, $value): void - { - $this->setAttribute($offset, $value); - } - - /** - * Unset the value for a given offset. - * - * @param mixed $offset - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->attributes[$offset], $this->relations[$offset]); - } - - /** - * Determine if an attribute or relation exists on the model. - * - * @param string $key - * @return bool - */ - public function __isset($key) - { - return $this->offsetExists($key); - } - - /** - * Unset an attribute on the model. - * - * @param string $key - * @return void - */ - public function __unset($key) - { - $this->offsetUnset($key); - } - - /** - * Handle dynamic method calls into the model. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - if (in_array($method, ['increment', 'decrement'])) { - return $this->$method(...$parameters); - } - - if ($resolver = ($this->relationResolver(static::class, $method))) { - return $resolver($this); - } - - return $this->forwardCallTo($this->newQuery(), $method, $parameters); - } - - /** - * Handle dynamic static method calls into the model. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public static function __callStatic($method, $parameters) - { - return (new static)->$method(...$parameters); - } - - /** - * Convert the model to its string representation. - * - * @return string - */ - public function __toString() - { - return $this->escapeWhenCastingToString - ? e($this->toJson()) - : $this->toJson(); - } - - /** - * Indicate that the object'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; - } - - /** - * Prepare the object for serialization. - * - * @return array - */ - public function __sleep() - { - $this->mergeAttributesFromCachedCasts(); - - $this->classCastCache = []; - $this->attributeCastCache = []; - - return array_keys(get_object_vars($this)); - } - - /** - * When a model is being unserialized, check if it needs to be booted. - * - * @return void - */ - public function __wakeup() - { - $this->bootIfNotBooted(); - - $this->initializeTraits(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/ModelNotFoundException.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/ModelNotFoundException.php deleted file mode 100755 index 79ae8a39..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/ModelNotFoundException.php +++ /dev/null @@ -1,69 +0,0 @@ - - */ - protected $model; - - /** - * The affected model IDs. - * - * @var array - */ - protected $ids; - - /** - * Set the affected Eloquent model and instance ids. - * - * @param class-string $model - * @param array|int|string $ids - * @return $this - */ - public function setModel($model, $ids = []) - { - $this->model = $model; - $this->ids = Arr::wrap($ids); - - $this->message = "No query results for model [{$model}]"; - - if (count($this->ids) > 0) { - $this->message .= ' '.implode(', ', $this->ids); - } else { - $this->message .= '.'; - } - - return $this; - } - - /** - * Get the affected Eloquent model. - * - * @return class-string - */ - public function getModel() - { - return $this->model; - } - - /** - * Get the affected Eloquent model IDs. - * - * @return array - */ - public function getIds() - { - return $this->ids; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Prunable.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Prunable.php deleted file mode 100644 index b4ce1b03..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Prunable.php +++ /dev/null @@ -1,67 +0,0 @@ -prunable() - ->when(in_array(SoftDeletes::class, class_uses_recursive(get_class($this))), function ($query) { - $query->withTrashed(); - })->chunkById($chunkSize, function ($models) use (&$total) { - $models->each->prune(); - - $total += $models->count(); - - event(new ModelsPruned(static::class, $total)); - }); - - return $total; - } - - /** - * Get the prunable model query. - * - * @return \Illuminate\Database\Eloquent\Builder - */ - public function prunable() - { - throw new LogicException('Please implement the prunable method on your model.'); - } - - /** - * Prune the model in the database. - * - * @return bool|null - */ - public function prune() - { - $this->pruning(); - - return in_array(SoftDeletes::class, class_uses_recursive(get_class($this))) - ? $this->forceDelete() - : $this->delete(); - } - - /** - * Prepare the model for pruning. - * - * @return void - */ - protected function pruning() - { - // - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/QueueEntityResolver.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/QueueEntityResolver.php deleted file mode 100644 index 22fccf24..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/QueueEntityResolver.php +++ /dev/null @@ -1,29 +0,0 @@ -find($id); - - if ($instance) { - return $instance; - } - - throw new EntityNotFoundException($type, $id); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/RelationNotFoundException.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/RelationNotFoundException.php deleted file mode 100755 index 73257bb1..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/RelationNotFoundException.php +++ /dev/null @@ -1,46 +0,0 @@ -model = $class; - $instance->relation = $relation; - - return $instance; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/BelongsTo.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/BelongsTo.php deleted file mode 100755 index c17b733a..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/BelongsTo.php +++ /dev/null @@ -1,383 +0,0 @@ -ownerKey = $ownerKey; - $this->relationName = $relationName; - $this->foreignKey = $foreignKey; - - // In the underlying base relationship class, this variable is referred to as - // the "parent" since most relationships are not inversed. But, since this - // one is we will create a "child" variable for much better readability. - $this->child = $child; - - parent::__construct($query, $child); - } - - /** - * Get the results of the relationship. - * - * @return mixed - */ - public function getResults() - { - if (is_null($this->child->{$this->foreignKey})) { - return $this->getDefaultFor($this->parent); - } - - return $this->query->first() ?: $this->getDefaultFor($this->parent); - } - - /** - * Set the base constraints on the relation query. - * - * @return void - */ - public function addConstraints() - { - if (static::$constraints) { - // For belongs to relationships, which are essentially the inverse of has one - // or has many relationships, we need to actually query on the primary key - // of the related models matching on the foreign key that's on a parent. - $table = $this->related->getTable(); - - $this->query->where($table.'.'.$this->ownerKey, '=', $this->child->{$this->foreignKey}); - } - } - - /** - * Set the constraints for an eager load of the relation. - * - * @param array $models - * @return void - */ - public function addEagerConstraints(array $models) - { - // We'll grab the primary key name of the related models since it could be set to - // a non-standard name and not "id". We will then construct the constraint for - // our eagerly loading query so it returns the proper models from execution. - $key = $this->related->getTable().'.'.$this->ownerKey; - - $whereIn = $this->whereInMethod($this->related, $this->ownerKey); - - $this->query->{$whereIn}($key, $this->getEagerModelKeys($models)); - } - - /** - * Gather the keys from an array of related models. - * - * @param array $models - * @return array - */ - protected function getEagerModelKeys(array $models) - { - $keys = []; - - // First we need to gather all of the keys from the parent models so we know what - // to query for via the eager loading query. We will add them to an array then - // execute a "where in" statement to gather up all of those related records. - foreach ($models as $model) { - if (! is_null($value = $model->{$this->foreignKey})) { - $keys[] = $value; - } - } - - sort($keys); - - return array_values(array_unique($keys)); - } - - /** - * Initialize the relation on a set of models. - * - * @param array $models - * @param string $relation - * @return array - */ - public function initRelation(array $models, $relation) - { - foreach ($models as $model) { - $model->setRelation($relation, $this->getDefaultFor($model)); - } - - return $models; - } - - /** - * Match the eagerly loaded results to their parents. - * - * @param array $models - * @param \Illuminate\Database\Eloquent\Collection $results - * @param string $relation - * @return array - */ - public function match(array $models, Collection $results, $relation) - { - $foreign = $this->foreignKey; - - $owner = $this->ownerKey; - - // First we will get to build a dictionary of the child models by their primary - // key of the relationship, then we can easily match the children back onto - // the parents using that dictionary and the primary key of the children. - $dictionary = []; - - foreach ($results as $result) { - $attribute = $this->getDictionaryKey($result->getAttribute($owner)); - - $dictionary[$attribute] = $result; - } - - // Once we have the dictionary constructed, we can loop through all the parents - // and match back onto their children using these keys of the dictionary and - // the primary key of the children to map them onto the correct instances. - foreach ($models as $model) { - $attribute = $this->getDictionaryKey($model->{$foreign}); - - if (isset($dictionary[$attribute])) { - $model->setRelation($relation, $dictionary[$attribute]); - } - } - - return $models; - } - - /** - * Associate the model instance to the given parent. - * - * @param \Illuminate\Database\Eloquent\Model|int|string|null $model - * @return \Illuminate\Database\Eloquent\Model - */ - public function associate($model) - { - $ownerKey = $model instanceof Model ? $model->getAttribute($this->ownerKey) : $model; - - $this->child->setAttribute($this->foreignKey, $ownerKey); - - if ($model instanceof Model) { - $this->child->setRelation($this->relationName, $model); - } else { - $this->child->unsetRelation($this->relationName); - } - - return $this->child; - } - - /** - * Dissociate previously associated model from the given parent. - * - * @return \Illuminate\Database\Eloquent\Model - */ - public function dissociate() - { - $this->child->setAttribute($this->foreignKey, null); - - return $this->child->setRelation($this->relationName, null); - } - - /** - * Alias of "dissociate" method. - * - * @return \Illuminate\Database\Eloquent\Model - */ - public function disassociate() - { - return $this->dissociate(); - } - - /** - * Add the constraints for a relationship query. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Builder $parentQuery - * @param array|mixed $columns - * @return \Illuminate\Database\Eloquent\Builder - */ - public function getRelationExistenceQuery(Builder $query, Builder $parentQuery, $columns = ['*']) - { - if ($parentQuery->getQuery()->from == $query->getQuery()->from) { - return $this->getRelationExistenceQueryForSelfRelation($query, $parentQuery, $columns); - } - - return $query->select($columns)->whereColumn( - $this->getQualifiedForeignKeyName(), '=', $query->qualifyColumn($this->ownerKey) - ); - } - - /** - * Add the constraints for a relationship query on the same table. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Builder $parentQuery - * @param array|mixed $columns - * @return \Illuminate\Database\Eloquent\Builder - */ - public function getRelationExistenceQueryForSelfRelation(Builder $query, Builder $parentQuery, $columns = ['*']) - { - $query->select($columns)->from( - $query->getModel()->getTable().' as '.$hash = $this->getRelationCountHash() - ); - - $query->getModel()->setTable($hash); - - return $query->whereColumn( - $hash.'.'.$this->ownerKey, '=', $this->getQualifiedForeignKeyName() - ); - } - - /** - * Determine if the related model has an auto-incrementing ID. - * - * @return bool - */ - protected function relationHasIncrementingId() - { - return $this->related->getIncrementing() && - in_array($this->related->getKeyType(), ['int', 'integer']); - } - - /** - * Make a new related instance for the given model. - * - * @param \Illuminate\Database\Eloquent\Model $parent - * @return \Illuminate\Database\Eloquent\Model - */ - protected function newRelatedInstanceFor(Model $parent) - { - return $this->related->newInstance(); - } - - /** - * Get the child of the relationship. - * - * @return \Illuminate\Database\Eloquent\Model - */ - public function getChild() - { - return $this->child; - } - - /** - * Get the foreign key of the relationship. - * - * @return string - */ - public function getForeignKeyName() - { - return $this->foreignKey; - } - - /** - * Get the fully qualified foreign key of the relationship. - * - * @return string - */ - public function getQualifiedForeignKeyName() - { - return $this->child->qualifyColumn($this->foreignKey); - } - - /** - * Get the key value of the child's foreign key. - * - * @return mixed - */ - public function getParentKey() - { - return $this->child->{$this->foreignKey}; - } - - /** - * Get the associated key of the relationship. - * - * @return string - */ - public function getOwnerKeyName() - { - return $this->ownerKey; - } - - /** - * Get the fully qualified associated key of the relationship. - * - * @return string - */ - public function getQualifiedOwnerKeyName() - { - return $this->related->qualifyColumn($this->ownerKey); - } - - /** - * Get the value of the model's associated key. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @return mixed - */ - protected function getRelatedKeyFrom(Model $model) - { - return $model->{$this->ownerKey}; - } - - /** - * Get the name of the relationship. - * - * @return string - */ - public function getRelationName() - { - return $this->relationName; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php deleted file mode 100755 index 62241578..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php +++ /dev/null @@ -1,1505 +0,0 @@ -parentKey = $parentKey; - $this->relatedKey = $relatedKey; - $this->relationName = $relationName; - $this->relatedPivotKey = $relatedPivotKey; - $this->foreignPivotKey = $foreignPivotKey; - $this->table = $this->resolveTableName($table); - - parent::__construct($query, $parent); - } - - /** - * Attempt to resolve the intermediate table name from the given string. - * - * @param string $table - * @return string - */ - protected function resolveTableName($table) - { - if (! str_contains($table, '\\') || ! class_exists($table)) { - return $table; - } - - $model = new $table; - - if (! $model instanceof Model) { - return $table; - } - - if (in_array(AsPivot::class, class_uses_recursive($model))) { - $this->using($table); - } - - return $model->getTable(); - } - - /** - * Set the base constraints on the relation query. - * - * @return void - */ - public function addConstraints() - { - $this->performJoin(); - - if (static::$constraints) { - $this->addWhereConstraints(); - } - } - - /** - * Set the join clause for the relation query. - * - * @param \Illuminate\Database\Eloquent\Builder|null $query - * @return $this - */ - protected function performJoin($query = null) - { - $query = $query ?: $this->query; - - // We need to join to the intermediate table on the related model's primary - // key column with the intermediate table's foreign key for the related - // model instance. Then we can set the "where" for the parent models. - $query->join( - $this->table, - $this->getQualifiedRelatedKeyName(), - '=', - $this->getQualifiedRelatedPivotKeyName() - ); - - return $this; - } - - /** - * Set the where clause for the relation query. - * - * @return $this - */ - protected function addWhereConstraints() - { - $this->query->where( - $this->getQualifiedForeignPivotKeyName(), '=', $this->parent->{$this->parentKey} - ); - - return $this; - } - - /** - * Set the constraints for an eager load of the relation. - * - * @param array $models - * @return void - */ - public function addEagerConstraints(array $models) - { - $whereIn = $this->whereInMethod($this->parent, $this->parentKey); - - $this->query->{$whereIn}( - $this->getQualifiedForeignPivotKeyName(), - $this->getKeys($models, $this->parentKey) - ); - } - - /** - * Initialize the relation on a set of models. - * - * @param array $models - * @param string $relation - * @return array - */ - public function initRelation(array $models, $relation) - { - foreach ($models as $model) { - $model->setRelation($relation, $this->related->newCollection()); - } - - return $models; - } - - /** - * Match the eagerly loaded results to their parents. - * - * @param array $models - * @param \Illuminate\Database\Eloquent\Collection $results - * @param string $relation - * @return array - */ - public function match(array $models, Collection $results, $relation) - { - $dictionary = $this->buildDictionary($results); - - // Once we have an array dictionary of child objects we can easily match the - // children back to their parent using the dictionary and the keys on the - // parent models. Then we should return these hydrated models back out. - foreach ($models as $model) { - $key = $this->getDictionaryKey($model->{$this->parentKey}); - - if (isset($dictionary[$key])) { - $model->setRelation( - $relation, $this->related->newCollection($dictionary[$key]) - ); - } - } - - return $models; - } - - /** - * Build model dictionary keyed by the relation's foreign key. - * - * @param \Illuminate\Database\Eloquent\Collection $results - * @return array - */ - protected function buildDictionary(Collection $results) - { - // First we'll build a dictionary of child models keyed by the foreign key - // of the relation so that we will easily and quickly match them to the - // parents without having a possibly slow inner loop for every model. - $dictionary = []; - - foreach ($results as $result) { - $value = $this->getDictionaryKey($result->{$this->accessor}->{$this->foreignPivotKey}); - - $dictionary[$value][] = $result; - } - - return $dictionary; - } - - /** - * Get the class being used for pivot models. - * - * @return string - */ - public function getPivotClass() - { - return $this->using ?? Pivot::class; - } - - /** - * Specify the custom pivot model to use for the relationship. - * - * @param string $class - * @return $this - */ - public function using($class) - { - $this->using = $class; - - return $this; - } - - /** - * Specify the custom pivot accessor to use for the relationship. - * - * @param string $accessor - * @return $this - */ - public function as($accessor) - { - $this->accessor = $accessor; - - return $this; - } - - /** - * Set a where clause for a pivot table column. - * - * @param string $column - * @param mixed $operator - * @param mixed $value - * @param string $boolean - * @return $this - */ - public function wherePivot($column, $operator = null, $value = null, $boolean = 'and') - { - $this->pivotWheres[] = func_get_args(); - - return $this->where($this->qualifyPivotColumn($column), $operator, $value, $boolean); - } - - /** - * Set a "where between" clause for a pivot table column. - * - * @param string $column - * @param array $values - * @param string $boolean - * @param bool $not - * @return $this - */ - public function wherePivotBetween($column, array $values, $boolean = 'and', $not = false) - { - return $this->whereBetween($this->qualifyPivotColumn($column), $values, $boolean, $not); - } - - /** - * Set a "or where between" clause for a pivot table column. - * - * @param string $column - * @param array $values - * @return $this - */ - public function orWherePivotBetween($column, array $values) - { - return $this->wherePivotBetween($column, $values, 'or'); - } - - /** - * Set a "where pivot not between" clause for a pivot table column. - * - * @param string $column - * @param array $values - * @param string $boolean - * @return $this - */ - public function wherePivotNotBetween($column, array $values, $boolean = 'and') - { - return $this->wherePivotBetween($column, $values, $boolean, true); - } - - /** - * Set a "or where not between" clause for a pivot table column. - * - * @param string $column - * @param array $values - * @return $this - */ - public function orWherePivotNotBetween($column, array $values) - { - return $this->wherePivotBetween($column, $values, 'or', true); - } - - /** - * Set a "where in" clause for a pivot table column. - * - * @param string $column - * @param mixed $values - * @param string $boolean - * @param bool $not - * @return $this - */ - public function wherePivotIn($column, $values, $boolean = 'and', $not = false) - { - $this->pivotWhereIns[] = func_get_args(); - - return $this->whereIn($this->qualifyPivotColumn($column), $values, $boolean, $not); - } - - /** - * Set an "or where" clause for a pivot table column. - * - * @param string $column - * @param mixed $operator - * @param mixed $value - * @return $this - */ - public function orWherePivot($column, $operator = null, $value = null) - { - return $this->wherePivot($column, $operator, $value, 'or'); - } - - /** - * Set a where clause for a pivot table column. - * - * In addition, new pivot records will receive this value. - * - * @param string|array $column - * @param mixed $value - * @return $this - * - * @throws \InvalidArgumentException - */ - public function withPivotValue($column, $value = null) - { - if (is_array($column)) { - foreach ($column as $name => $value) { - $this->withPivotValue($name, $value); - } - - return $this; - } - - if (is_null($value)) { - throw new InvalidArgumentException('The provided value may not be null.'); - } - - $this->pivotValues[] = compact('column', 'value'); - - return $this->wherePivot($column, '=', $value); - } - - /** - * Set an "or where in" clause for a pivot table column. - * - * @param string $column - * @param mixed $values - * @return $this - */ - public function orWherePivotIn($column, $values) - { - return $this->wherePivotIn($column, $values, 'or'); - } - - /** - * Set a "where not in" clause for a pivot table column. - * - * @param string $column - * @param mixed $values - * @param string $boolean - * @return $this - */ - public function wherePivotNotIn($column, $values, $boolean = 'and') - { - return $this->wherePivotIn($column, $values, $boolean, true); - } - - /** - * Set an "or where not in" clause for a pivot table column. - * - * @param string $column - * @param mixed $values - * @return $this - */ - public function orWherePivotNotIn($column, $values) - { - return $this->wherePivotNotIn($column, $values, 'or'); - } - - /** - * Set a "where null" clause for a pivot table column. - * - * @param string $column - * @param string $boolean - * @param bool $not - * @return $this - */ - public function wherePivotNull($column, $boolean = 'and', $not = false) - { - $this->pivotWhereNulls[] = func_get_args(); - - return $this->whereNull($this->qualifyPivotColumn($column), $boolean, $not); - } - - /** - * Set a "where not null" clause for a pivot table column. - * - * @param string $column - * @param string $boolean - * @return $this - */ - public function wherePivotNotNull($column, $boolean = 'and') - { - return $this->wherePivotNull($column, $boolean, true); - } - - /** - * Set a "or where null" clause for a pivot table column. - * - * @param string $column - * @param bool $not - * @return $this - */ - public function orWherePivotNull($column, $not = false) - { - return $this->wherePivotNull($column, 'or', $not); - } - - /** - * Set a "or where not null" clause for a pivot table column. - * - * @param string $column - * @return $this - */ - public function orWherePivotNotNull($column) - { - return $this->orWherePivotNull($column, true); - } - - /** - * Add an "order by" clause for a pivot table column. - * - * @param string $column - * @param string $direction - * @return $this - */ - public function orderByPivot($column, $direction = 'asc') - { - return $this->orderBy($this->qualifyPivotColumn($column), $direction); - } - - /** - * Find a related model by its primary key or return a new instance of the related model. - * - * @param mixed $id - * @param array $columns - * @return \Illuminate\Support\Collection|\Illuminate\Database\Eloquent\Model - */ - public function findOrNew($id, $columns = ['*']) - { - if (is_null($instance = $this->find($id, $columns))) { - $instance = $this->related->newInstance(); - } - - return $instance; - } - - /** - * Get the first related model record matching the attributes or instantiate it. - * - * @param array $attributes - * @param array $values - * @return \Illuminate\Database\Eloquent\Model - */ - public function firstOrNew(array $attributes = [], array $values = []) - { - if (is_null($instance = $this->related->where($attributes)->first())) { - $instance = $this->related->newInstance(array_merge($attributes, $values)); - } - - return $instance; - } - - /** - * Get the first related record matching the attributes or create it. - * - * @param array $attributes - * @param array $values - * @param array $joining - * @param bool $touch - * @return \Illuminate\Database\Eloquent\Model - */ - public function firstOrCreate(array $attributes = [], array $values = [], array $joining = [], $touch = true) - { - if (is_null($instance = (clone $this)->where($attributes)->first())) { - if (is_null($instance = $this->related->where($attributes)->first())) { - $instance = $this->create(array_merge($attributes, $values), $joining, $touch); - } else { - $this->attach($instance, $joining, $touch); - } - } - - return $instance; - } - - /** - * Create or update a related record matching the attributes, and fill it with values. - * - * @param array $attributes - * @param array $values - * @param array $joining - * @param bool $touch - * @return \Illuminate\Database\Eloquent\Model - */ - public function updateOrCreate(array $attributes, array $values = [], array $joining = [], $touch = true) - { - if (is_null($instance = (clone $this)->where($attributes)->first())) { - if (is_null($instance = $this->related->where($attributes)->first())) { - return $this->create(array_merge($attributes, $values), $joining, $touch); - } else { - $this->attach($instance, $joining, $touch); - } - } - - $instance->fill($values); - - $instance->save(['touch' => false]); - - return $instance; - } - - /** - * Find a related model by its primary key. - * - * @param mixed $id - * @param array $columns - * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection|null - */ - public function find($id, $columns = ['*']) - { - if (! $id instanceof Model && (is_array($id) || $id instanceof Arrayable)) { - return $this->findMany($id, $columns); - } - - return $this->where( - $this->getRelated()->getQualifiedKeyName(), '=', $this->parseId($id) - )->first($columns); - } - - /** - * Find multiple related models by their primary keys. - * - * @param \Illuminate\Contracts\Support\Arrayable|array $ids - * @param array $columns - * @return \Illuminate\Database\Eloquent\Collection - */ - public function findMany($ids, $columns = ['*']) - { - $ids = $ids instanceof Arrayable ? $ids->toArray() : $ids; - - if (empty($ids)) { - return $this->getRelated()->newCollection(); - } - - return $this->whereIn( - $this->getRelated()->getQualifiedKeyName(), $this->parseIds($ids) - )->get($columns); - } - - /** - * Find a related model by its primary key or throw an exception. - * - * @param mixed $id - * @param array $columns - * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection - * - * @throws \Illuminate\Database\Eloquent\ModelNotFoundException<\Illuminate\Database\Eloquent\Model> - */ - public function findOrFail($id, $columns = ['*']) - { - $result = $this->find($id, $columns); - - $id = $id instanceof Arrayable ? $id->toArray() : $id; - - if (is_array($id)) { - if (count($result) === count(array_unique($id))) { - return $result; - } - } elseif (! is_null($result)) { - return $result; - } - - throw (new ModelNotFoundException)->setModel(get_class($this->related), $id); - } - - /** - * Find a related model by its primary key or call a callback. - * - * @param mixed $id - * @param \Closure|array $columns - * @param \Closure|null $callback - * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection|mixed - */ - public function findOr($id, $columns = ['*'], Closure $callback = null) - { - if ($columns instanceof Closure) { - $callback = $columns; - - $columns = ['*']; - } - - $result = $this->find($id, $columns); - - $id = $id instanceof Arrayable ? $id->toArray() : $id; - - if (is_array($id)) { - if (count($result) === count(array_unique($id))) { - return $result; - } - } elseif (! is_null($result)) { - return $result; - } - - return $callback(); - } - - /** - * Add a basic where clause to the query, and return the first result. - * - * @param \Closure|string|array $column - * @param mixed $operator - * @param mixed $value - * @param string $boolean - * @return \Illuminate\Database\Eloquent\Model|static - */ - public function firstWhere($column, $operator = null, $value = null, $boolean = 'and') - { - return $this->where($column, $operator, $value, $boolean)->first(); - } - - /** - * Execute the query and get the first result. - * - * @param array $columns - * @return mixed - */ - public function first($columns = ['*']) - { - $results = $this->take(1)->get($columns); - - return count($results) > 0 ? $results->first() : null; - } - - /** - * Execute the query and get the first result or throw an exception. - * - * @param array $columns - * @return \Illuminate\Database\Eloquent\Model|static - * - * @throws \Illuminate\Database\Eloquent\ModelNotFoundException<\Illuminate\Database\Eloquent\Model> - */ - public function firstOrFail($columns = ['*']) - { - if (! is_null($model = $this->first($columns))) { - return $model; - } - - throw (new ModelNotFoundException)->setModel(get_class($this->related)); - } - - /** - * Execute the query and get the first result or call a callback. - * - * @param \Closure|array $columns - * @param \Closure|null $callback - * @return \Illuminate\Database\Eloquent\Model|static|mixed - */ - public function firstOr($columns = ['*'], Closure $callback = null) - { - if ($columns instanceof Closure) { - $callback = $columns; - - $columns = ['*']; - } - - if (! is_null($model = $this->first($columns))) { - return $model; - } - - return $callback(); - } - - /** - * Get the results of the relationship. - * - * @return mixed - */ - public function getResults() - { - return ! is_null($this->parent->{$this->parentKey}) - ? $this->get() - : $this->related->newCollection(); - } - - /** - * Execute the query as a "select" statement. - * - * @param array $columns - * @return \Illuminate\Database\Eloquent\Collection - */ - public function get($columns = ['*']) - { - // First we'll add the proper select columns onto the query so it is run with - // the proper columns. Then, we will get the results and hydrate our pivot - // models with the result of those columns as a separate model relation. - $builder = $this->query->applyScopes(); - - $columns = $builder->getQuery()->columns ? [] : $columns; - - $models = $builder->addSelect( - $this->shouldSelect($columns) - )->getModels(); - - $this->hydratePivotRelation($models); - - // If we actually found models we will also eager load any relationships that - // have been specified as needing to be eager loaded. This will solve the - // n + 1 query problem for the developer and also increase performance. - if (count($models) > 0) { - $models = $builder->eagerLoadRelations($models); - } - - return $this->related->newCollection($models); - } - - /** - * Get the select columns for the relation query. - * - * @param array $columns - * @return array - */ - protected function shouldSelect(array $columns = ['*']) - { - if ($columns == ['*']) { - $columns = [$this->related->getTable().'.*']; - } - - return array_merge($columns, $this->aliasedPivotColumns()); - } - - /** - * Get the pivot columns for the relation. - * - * "pivot_" is prefixed at each column for easy removal later. - * - * @return array - */ - protected function aliasedPivotColumns() - { - $defaults = [$this->foreignPivotKey, $this->relatedPivotKey]; - - return collect(array_merge($defaults, $this->pivotColumns))->map(function ($column) { - return $this->qualifyPivotColumn($column).' as pivot_'.$column; - })->unique()->all(); - } - - /** - * Get a paginator for the "select" statement. - * - * @param int|null $perPage - * @param array $columns - * @param string $pageName - * @param int|null $page - * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator - */ - public function paginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) - { - $this->query->addSelect($this->shouldSelect($columns)); - - return tap($this->query->paginate($perPage, $columns, $pageName, $page), function ($paginator) { - $this->hydratePivotRelation($paginator->items()); - }); - } - - /** - * Paginate the given query into a simple paginator. - * - * @param int|null $perPage - * @param array $columns - * @param string $pageName - * @param int|null $page - * @return \Illuminate\Contracts\Pagination\Paginator - */ - public function simplePaginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) - { - $this->query->addSelect($this->shouldSelect($columns)); - - return tap($this->query->simplePaginate($perPage, $columns, $pageName, $page), function ($paginator) { - $this->hydratePivotRelation($paginator->items()); - }); - } - - /** - * Paginate the given query into a cursor paginator. - * - * @param int|null $perPage - * @param array $columns - * @param string $cursorName - * @param string|null $cursor - * @return \Illuminate\Contracts\Pagination\CursorPaginator - */ - public function cursorPaginate($perPage = null, $columns = ['*'], $cursorName = 'cursor', $cursor = null) - { - $this->query->addSelect($this->shouldSelect($columns)); - - return tap($this->query->cursorPaginate($perPage, $columns, $cursorName, $cursor), function ($paginator) { - $this->hydratePivotRelation($paginator->items()); - }); - } - - /** - * Chunk the results of the query. - * - * @param int $count - * @param callable $callback - * @return bool - */ - public function chunk($count, callable $callback) - { - return $this->prepareQueryBuilder()->chunk($count, function ($results, $page) use ($callback) { - $this->hydratePivotRelation($results->all()); - - return $callback($results, $page); - }); - } - - /** - * Chunk the results of a query by comparing numeric IDs. - * - * @param int $count - * @param callable $callback - * @param string|null $column - * @param string|null $alias - * @return bool - */ - public function chunkById($count, callable $callback, $column = null, $alias = null) - { - $this->prepareQueryBuilder(); - - $column ??= $this->getRelated()->qualifyColumn( - $this->getRelatedKeyName() - ); - - $alias ??= $this->getRelatedKeyName(); - - return $this->query->chunkById($count, function ($results) use ($callback) { - $this->hydratePivotRelation($results->all()); - - return $callback($results); - }, $column, $alias); - } - - /** - * Execute a callback over each item while chunking. - * - * @param callable $callback - * @param int $count - * @return bool - */ - public function each(callable $callback, $count = 1000) - { - return $this->chunk($count, function ($results) use ($callback) { - foreach ($results as $key => $value) { - if ($callback($value, $key) === false) { - return false; - } - } - }); - } - - /** - * Query lazily, by chunks of the given size. - * - * @param int $chunkSize - * @return \Illuminate\Support\LazyCollection - */ - public function lazy($chunkSize = 1000) - { - return $this->prepareQueryBuilder()->lazy($chunkSize)->map(function ($model) { - $this->hydratePivotRelation([$model]); - - return $model; - }); - } - - /** - * Query lazily, by chunking the results of a query by comparing IDs. - * - * @param int $chunkSize - * @param string|null $column - * @param string|null $alias - * @return \Illuminate\Support\LazyCollection - */ - public function lazyById($chunkSize = 1000, $column = null, $alias = null) - { - $column ??= $this->getRelated()->qualifyColumn( - $this->getRelatedKeyName() - ); - - $alias ??= $this->getRelatedKeyName(); - - return $this->prepareQueryBuilder()->lazyById($chunkSize, $column, $alias)->map(function ($model) { - $this->hydratePivotRelation([$model]); - - return $model; - }); - } - - /** - * Get a lazy collection for the given query. - * - * @return \Illuminate\Support\LazyCollection - */ - public function cursor() - { - return $this->prepareQueryBuilder()->cursor()->map(function ($model) { - $this->hydratePivotRelation([$model]); - - return $model; - }); - } - - /** - * Prepare the query builder for query execution. - * - * @return \Illuminate\Database\Eloquent\Builder - */ - protected function prepareQueryBuilder() - { - return $this->query->addSelect($this->shouldSelect()); - } - - /** - * Hydrate the pivot table relationship on the models. - * - * @param array $models - * @return void - */ - protected function hydratePivotRelation(array $models) - { - // To hydrate the pivot relationship, we will just gather the pivot attributes - // and create a new Pivot model, which is basically a dynamic model that we - // will set the attributes, table, and connections on it so it will work. - foreach ($models as $model) { - $model->setRelation($this->accessor, $this->newExistingPivot( - $this->migratePivotAttributes($model) - )); - } - } - - /** - * Get the pivot attributes from a model. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @return array - */ - protected function migratePivotAttributes(Model $model) - { - $values = []; - - foreach ($model->getAttributes() as $key => $value) { - // To get the pivots attributes we will just take any of the attributes which - // begin with "pivot_" and add those to this arrays, as well as unsetting - // them from the parent's models since they exist in a different table. - if (str_starts_with($key, 'pivot_')) { - $values[substr($key, 6)] = $value; - - unset($model->$key); - } - } - - return $values; - } - - /** - * If we're touching the parent model, touch. - * - * @return void - */ - public function touchIfTouching() - { - if ($this->touchingParent()) { - $this->getParent()->touch(); - } - - if ($this->getParent()->touches($this->relationName)) { - $this->touch(); - } - } - - /** - * Determine if we should touch the parent on sync. - * - * @return bool - */ - protected function touchingParent() - { - return $this->getRelated()->touches($this->guessInverseRelation()); - } - - /** - * Attempt to guess the name of the inverse of the relation. - * - * @return string - */ - protected function guessInverseRelation() - { - return Str::camel(Str::pluralStudly(class_basename($this->getParent()))); - } - - /** - * Touch all of the related models for the relationship. - * - * E.g.: Touch all roles associated with this user. - * - * @return void - */ - public function touch() - { - $key = $this->getRelated()->getKeyName(); - - $columns = [ - $this->related->getUpdatedAtColumn() => $this->related->freshTimestampString(), - ]; - - // If we actually have IDs for the relation, we will run the query to update all - // the related model's timestamps, to make sure these all reflect the changes - // to the parent models. This will help us keep any caching synced up here. - if (count($ids = $this->allRelatedIds()) > 0) { - $this->getRelated()->newQueryWithoutRelationships()->whereIn($key, $ids)->update($columns); - } - } - - /** - * Get all of the IDs for the related models. - * - * @return \Illuminate\Support\Collection - */ - public function allRelatedIds() - { - return $this->newPivotQuery()->pluck($this->relatedPivotKey); - } - - /** - * Save a new model and attach it to the parent model. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @param array $pivotAttributes - * @param bool $touch - * @return \Illuminate\Database\Eloquent\Model - */ - public function save(Model $model, array $pivotAttributes = [], $touch = true) - { - $model->save(['touch' => false]); - - $this->attach($model, $pivotAttributes, $touch); - - return $model; - } - - /** - * Save a new model without raising any events and attach it to the parent model. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @param array $pivotAttributes - * @param bool $touch - * @return \Illuminate\Database\Eloquent\Model - */ - public function saveQuietly(Model $model, array $pivotAttributes = [], $touch = true) - { - return Model::withoutEvents(function () use ($model, $pivotAttributes, $touch) { - return $this->save($model, $pivotAttributes, $touch); - }); - } - - /** - * Save an array of new models and attach them to the parent model. - * - * @param \Illuminate\Support\Collection|array $models - * @param array $pivotAttributes - * @return array - */ - public function saveMany($models, array $pivotAttributes = []) - { - foreach ($models as $key => $model) { - $this->save($model, (array) ($pivotAttributes[$key] ?? []), false); - } - - $this->touchIfTouching(); - - return $models; - } - - /** - * Save an array of new models without raising any events and attach them to the parent model. - * - * @param \Illuminate\Support\Collection|array $models - * @param array $pivotAttributes - * @return array - */ - public function saveManyQuietly($models, array $pivotAttributes = []) - { - return Model::withoutEvents(function () use ($models, $pivotAttributes) { - return $this->saveMany($models, $pivotAttributes); - }); - } - - /** - * Create a new instance of the related model. - * - * @param array $attributes - * @param array $joining - * @param bool $touch - * @return \Illuminate\Database\Eloquent\Model - */ - public function create(array $attributes = [], array $joining = [], $touch = true) - { - $instance = $this->related->newInstance($attributes); - - // Once we save the related model, we need to attach it to the base model via - // through intermediate table so we'll use the existing "attach" method to - // accomplish this which will insert the record and any more attributes. - $instance->save(['touch' => false]); - - $this->attach($instance, $joining, $touch); - - return $instance; - } - - /** - * Create an array of new instances of the related models. - * - * @param iterable $records - * @param array $joinings - * @return array - */ - public function createMany(iterable $records, array $joinings = []) - { - $instances = []; - - foreach ($records as $key => $record) { - $instances[] = $this->create($record, (array) ($joinings[$key] ?? []), false); - } - - $this->touchIfTouching(); - - return $instances; - } - - /** - * Add the constraints for a relationship query. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Builder $parentQuery - * @param array|mixed $columns - * @return \Illuminate\Database\Eloquent\Builder - */ - public function getRelationExistenceQuery(Builder $query, Builder $parentQuery, $columns = ['*']) - { - if ($parentQuery->getQuery()->from == $query->getQuery()->from) { - return $this->getRelationExistenceQueryForSelfJoin($query, $parentQuery, $columns); - } - - $this->performJoin($query); - - return parent::getRelationExistenceQuery($query, $parentQuery, $columns); - } - - /** - * Add the constraints for a relationship query on the same table. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Builder $parentQuery - * @param array|mixed $columns - * @return \Illuminate\Database\Eloquent\Builder - */ - public function getRelationExistenceQueryForSelfJoin(Builder $query, Builder $parentQuery, $columns = ['*']) - { - $query->select($columns); - - $query->from($this->related->getTable().' as '.$hash = $this->getRelationCountHash()); - - $this->related->setTable($hash); - - $this->performJoin($query); - - return parent::getRelationExistenceQuery($query, $parentQuery, $columns); - } - - /** - * Get the key for comparing against the parent key in "has" query. - * - * @return string - */ - public function getExistenceCompareKey() - { - return $this->getQualifiedForeignPivotKeyName(); - } - - /** - * Specify that the pivot table has creation and update timestamps. - * - * @param mixed $createdAt - * @param mixed $updatedAt - * @return $this - */ - public function withTimestamps($createdAt = null, $updatedAt = null) - { - $this->withTimestamps = true; - - $this->pivotCreatedAt = $createdAt; - $this->pivotUpdatedAt = $updatedAt; - - return $this->withPivot($this->createdAt(), $this->updatedAt()); - } - - /** - * Get the name of the "created at" column. - * - * @return string - */ - public function createdAt() - { - return $this->pivotCreatedAt ?: $this->parent->getCreatedAtColumn(); - } - - /** - * Get the name of the "updated at" column. - * - * @return string - */ - public function updatedAt() - { - return $this->pivotUpdatedAt ?: $this->parent->getUpdatedAtColumn(); - } - - /** - * Get the foreign key for the relation. - * - * @return string - */ - public function getForeignPivotKeyName() - { - return $this->foreignPivotKey; - } - - /** - * Get the fully qualified foreign key for the relation. - * - * @return string - */ - public function getQualifiedForeignPivotKeyName() - { - return $this->qualifyPivotColumn($this->foreignPivotKey); - } - - /** - * Get the "related key" for the relation. - * - * @return string - */ - public function getRelatedPivotKeyName() - { - return $this->relatedPivotKey; - } - - /** - * Get the fully qualified "related key" for the relation. - * - * @return string - */ - public function getQualifiedRelatedPivotKeyName() - { - return $this->qualifyPivotColumn($this->relatedPivotKey); - } - - /** - * Get the parent key for the relationship. - * - * @return string - */ - public function getParentKeyName() - { - return $this->parentKey; - } - - /** - * Get the fully qualified parent key name for the relation. - * - * @return string - */ - public function getQualifiedParentKeyName() - { - return $this->parent->qualifyColumn($this->parentKey); - } - - /** - * Get the related key for the relationship. - * - * @return string - */ - public function getRelatedKeyName() - { - return $this->relatedKey; - } - - /** - * Get the fully qualified related key name for the relation. - * - * @return string - */ - public function getQualifiedRelatedKeyName() - { - return $this->related->qualifyColumn($this->relatedKey); - } - - /** - * Get the intermediate table for the relationship. - * - * @return string - */ - public function getTable() - { - return $this->table; - } - - /** - * Get the relationship name for the relationship. - * - * @return string - */ - public function getRelationName() - { - return $this->relationName; - } - - /** - * Get the name of the pivot accessor for this relationship. - * - * @return string - */ - public function getPivotAccessor() - { - return $this->accessor; - } - - /** - * Get the pivot columns for this relationship. - * - * @return array - */ - public function getPivotColumns() - { - return $this->pivotColumns; - } - - /** - * Qualify the given column name by the pivot table. - * - * @param string $column - * @return string - */ - public function qualifyPivotColumn($column) - { - return str_contains($column, '.') - ? $column - : $this->table.'.'.$column; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Concerns/AsPivot.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Concerns/AsPivot.php deleted file mode 100644 index e6f9f230..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Concerns/AsPivot.php +++ /dev/null @@ -1,333 +0,0 @@ -timestamps = $instance->hasTimestampAttributes($attributes); - - // The pivot model is a "dynamic" model since we will set the tables dynamically - // for the instance. This allows it work for any intermediate tables for the - // many to many relationship that are defined by this developer's classes. - $instance->setConnection($parent->getConnectionName()) - ->setTable($table) - ->forceFill($attributes) - ->syncOriginal(); - - // We store off the parent instance so we will access the timestamp column names - // for the model, since the pivot model timestamps aren't easily configurable - // from the developer's point of view. We can use the parents to get these. - $instance->pivotParent = $parent; - - $instance->exists = $exists; - - return $instance; - } - - /** - * Create a new pivot model from raw values returned from a query. - * - * @param \Illuminate\Database\Eloquent\Model $parent - * @param array $attributes - * @param string $table - * @param bool $exists - * @return static - */ - public static function fromRawAttributes(Model $parent, $attributes, $table, $exists = false) - { - $instance = static::fromAttributes($parent, [], $table, $exists); - - $instance->timestamps = $instance->hasTimestampAttributes($attributes); - - $instance->setRawAttributes( - array_merge($instance->getRawOriginal(), $attributes), $exists - ); - - return $instance; - } - - /** - * Set the keys for a select query. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @return \Illuminate\Database\Eloquent\Builder - */ - protected function setKeysForSelectQuery($query) - { - if (isset($this->attributes[$this->getKeyName()])) { - return parent::setKeysForSelectQuery($query); - } - - $query->where($this->foreignKey, $this->getOriginal( - $this->foreignKey, $this->getAttribute($this->foreignKey) - )); - - return $query->where($this->relatedKey, $this->getOriginal( - $this->relatedKey, $this->getAttribute($this->relatedKey) - )); - } - - /** - * Set the keys for a save update query. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @return \Illuminate\Database\Eloquent\Builder - */ - protected function setKeysForSaveQuery($query) - { - return $this->setKeysForSelectQuery($query); - } - - /** - * Delete the pivot model record from the database. - * - * @return int - */ - public function delete() - { - if (isset($this->attributes[$this->getKeyName()])) { - return (int) parent::delete(); - } - - if ($this->fireModelEvent('deleting') === false) { - return 0; - } - - $this->touchOwners(); - - return tap($this->getDeleteQuery()->delete(), function () { - $this->exists = false; - - $this->fireModelEvent('deleted', false); - }); - } - - /** - * Get the query builder for a delete operation on the pivot. - * - * @return \Illuminate\Database\Eloquent\Builder - */ - protected function getDeleteQuery() - { - return $this->newQueryWithoutRelationships()->where([ - $this->foreignKey => $this->getOriginal($this->foreignKey, $this->getAttribute($this->foreignKey)), - $this->relatedKey => $this->getOriginal($this->relatedKey, $this->getAttribute($this->relatedKey)), - ]); - } - - /** - * Get the table associated with the model. - * - * @return string - */ - public function getTable() - { - if (! isset($this->table)) { - $this->setTable(str_replace( - '\\', '', Str::snake(Str::singular(class_basename($this))) - )); - } - - return $this->table; - } - - /** - * Get the foreign key column name. - * - * @return string - */ - public function getForeignKey() - { - return $this->foreignKey; - } - - /** - * Get the "related key" column name. - * - * @return string - */ - public function getRelatedKey() - { - return $this->relatedKey; - } - - /** - * Get the "related key" column name. - * - * @return string - */ - public function getOtherKey() - { - return $this->getRelatedKey(); - } - - /** - * Set the key names for the pivot model instance. - * - * @param string $foreignKey - * @param string $relatedKey - * @return $this - */ - public function setPivotKeys($foreignKey, $relatedKey) - { - $this->foreignKey = $foreignKey; - - $this->relatedKey = $relatedKey; - - return $this; - } - - /** - * Determine if the pivot model or given attributes has timestamp attributes. - * - * @param array|null $attributes - * @return bool - */ - public function hasTimestampAttributes($attributes = null) - { - return array_key_exists($this->getCreatedAtColumn(), $attributes ?? $this->attributes); - } - - /** - * Get the name of the "created at" column. - * - * @return string - */ - public function getCreatedAtColumn() - { - return $this->pivotParent - ? $this->pivotParent->getCreatedAtColumn() - : parent::getCreatedAtColumn(); - } - - /** - * Get the name of the "updated at" column. - * - * @return string - */ - public function getUpdatedAtColumn() - { - return $this->pivotParent - ? $this->pivotParent->getUpdatedAtColumn() - : parent::getUpdatedAtColumn(); - } - - /** - * Get the queueable identity for the entity. - * - * @return mixed - */ - public function getQueueableId() - { - if (isset($this->attributes[$this->getKeyName()])) { - return $this->getKey(); - } - - return sprintf( - '%s:%s:%s:%s', - $this->foreignKey, $this->getAttribute($this->foreignKey), - $this->relatedKey, $this->getAttribute($this->relatedKey) - ); - } - - /** - * Get a new query to restore one or more models by their queueable IDs. - * - * @param int[]|string[]|string $ids - * @return \Illuminate\Database\Eloquent\Builder - */ - public function newQueryForRestoration($ids) - { - if (is_array($ids)) { - return $this->newQueryForCollectionRestoration($ids); - } - - if (! str_contains($ids, ':')) { - return parent::newQueryForRestoration($ids); - } - - $segments = explode(':', $ids); - - return $this->newQueryWithoutScopes() - ->where($segments[0], $segments[1]) - ->where($segments[2], $segments[3]); - } - - /** - * Get a new query to restore multiple models by their queueable IDs. - * - * @param int[]|string[] $ids - * @return \Illuminate\Database\Eloquent\Builder - */ - protected function newQueryForCollectionRestoration(array $ids) - { - $ids = array_values($ids); - - if (! str_contains($ids[0], ':')) { - return parent::newQueryForRestoration($ids); - } - - $query = $this->newQueryWithoutScopes(); - - foreach ($ids as $id) { - $segments = explode(':', $id); - - $query->orWhere(function ($query) use ($segments) { - return $query->where($segments[0], $segments[1]) - ->where($segments[2], $segments[3]); - }); - } - - return $query; - } - - /** - * Unset all the loaded relations for the instance. - * - * @return $this - */ - public function unsetRelations() - { - $this->pivotParent = null; - $this->relations = []; - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Concerns/CanBeOneOfMany.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Concerns/CanBeOneOfMany.php deleted file mode 100644 index 25b9a583..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Concerns/CanBeOneOfMany.php +++ /dev/null @@ -1,310 +0,0 @@ -isOneOfMany = true; - - $this->relationName = $relation ?: $this->getDefaultOneOfManyJoinAlias( - $this->guessRelationship() - ); - - $keyName = $this->query->getModel()->getKeyName(); - - $columns = is_string($columns = $column) ? [ - $column => $aggregate, - $keyName => $aggregate, - ] : $column; - - if (! array_key_exists($keyName, $columns)) { - $columns[$keyName] = 'MAX'; - } - - if ($aggregate instanceof Closure) { - $closure = $aggregate; - } - - foreach ($columns as $column => $aggregate) { - if (! in_array(strtolower($aggregate), ['min', 'max'])) { - throw new InvalidArgumentException("Invalid aggregate [{$aggregate}] used within ofMany relation. Available aggregates: MIN, MAX"); - } - - $subQuery = $this->newOneOfManySubQuery( - $this->getOneOfManySubQuerySelectColumns(), - $column, $aggregate - ); - - if (isset($previous)) { - $this->addOneOfManyJoinSubQuery($subQuery, $previous['subQuery'], $previous['column']); - } - - if (isset($closure)) { - $closure($subQuery); - } - - if (! isset($previous)) { - $this->oneOfManySubQuery = $subQuery; - } - - if (array_key_last($columns) == $column) { - $this->addOneOfManyJoinSubQuery($this->query, $subQuery, $column); - } - - $previous = [ - 'subQuery' => $subQuery, - 'column' => $column, - ]; - } - - $this->addConstraints(); - - $columns = $this->query->getQuery()->columns; - - if (is_null($columns) || $columns === ['*']) { - $this->select([$this->qualifyColumn('*')]); - } - - return $this; - } - - /** - * Indicate that the relation is the latest single result of a larger one-to-many relationship. - * - * @param string|array|null $column - * @param string|null $relation - * @return $this - */ - public function latestOfMany($column = 'id', $relation = null) - { - return $this->ofMany(collect(Arr::wrap($column))->mapWithKeys(function ($column) { - return [$column => 'MAX']; - })->all(), 'MAX', $relation); - } - - /** - * Indicate that the relation is the oldest single result of a larger one-to-many relationship. - * - * @param string|array|null $column - * @param string|null $relation - * @return $this - */ - public function oldestOfMany($column = 'id', $relation = null) - { - return $this->ofMany(collect(Arr::wrap($column))->mapWithKeys(function ($column) { - return [$column => 'MIN']; - })->all(), 'MIN', $relation); - } - - /** - * Get the default alias for the one of many inner join clause. - * - * @param string $relation - * @return string - */ - protected function getDefaultOneOfManyJoinAlias($relation) - { - return $relation == $this->query->getModel()->getTable() - ? $relation.'_of_many' - : $relation; - } - - /** - * Get a new query for the related model, grouping the query by the given column, often the foreign key of the relationship. - * - * @param string|array $groupBy - * @param string|null $column - * @param string|null $aggregate - * @return \Illuminate\Database\Eloquent\Builder - */ - protected function newOneOfManySubQuery($groupBy, $column = null, $aggregate = null) - { - $subQuery = $this->query->getModel() - ->newQuery() - ->withoutGlobalScopes($this->removedScopes()); - - foreach (Arr::wrap($groupBy) as $group) { - $subQuery->groupBy($this->qualifyRelatedColumn($group)); - } - - if (! is_null($column)) { - $subQuery->selectRaw($aggregate.'('.$subQuery->getQuery()->grammar->wrap($subQuery->qualifyColumn($column)).') as '.$subQuery->getQuery()->grammar->wrap($column.'_aggregate')); - } - - $this->addOneOfManySubQueryConstraints($subQuery, $groupBy, $column, $aggregate); - - return $subQuery; - } - - /** - * Add the join subquery to the given query on the given column and the relationship's foreign key. - * - * @param \Illuminate\Database\Eloquent\Builder $parent - * @param \Illuminate\Database\Eloquent\Builder $subQuery - * @param string $on - * @return void - */ - protected function addOneOfManyJoinSubQuery(Builder $parent, Builder $subQuery, $on) - { - $parent->beforeQuery(function ($parent) use ($subQuery, $on) { - $subQuery->applyBeforeQueryCallbacks(); - - $parent->joinSub($subQuery, $this->relationName, function ($join) use ($on) { - $join->on($this->qualifySubSelectColumn($on.'_aggregate'), '=', $this->qualifyRelatedColumn($on)); - - $this->addOneOfManyJoinSubQueryConstraints($join, $on); - }); - }); - } - - /** - * Merge the relationship query joins to the given query builder. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @return void - */ - protected function mergeOneOfManyJoinsTo(Builder $query) - { - $query->getQuery()->beforeQueryCallbacks = $this->query->getQuery()->beforeQueryCallbacks; - - $query->applyBeforeQueryCallbacks(); - } - - /** - * Get the query builder that will contain the relationship constraints. - * - * @return \Illuminate\Database\Eloquent\Builder - */ - protected function getRelationQuery() - { - return $this->isOneOfMany() - ? $this->oneOfManySubQuery - : $this->query; - } - - /** - * Get the one of many inner join subselect builder instance. - * - * @return \Illuminate\Database\Eloquent\Builder|void - */ - public function getOneOfManySubQuery() - { - return $this->oneOfManySubQuery; - } - - /** - * Get the qualified column name for the one-of-many relationship using the subselect join query's alias. - * - * @param string $column - * @return string - */ - public function qualifySubSelectColumn($column) - { - return $this->getRelationName().'.'.last(explode('.', $column)); - } - - /** - * Qualify related column using the related table name if it is not already qualified. - * - * @param string $column - * @return string - */ - protected function qualifyRelatedColumn($column) - { - return str_contains($column, '.') ? $column : $this->query->getModel()->getTable().'.'.$column; - } - - /** - * Guess the "hasOne" relationship's name via backtrace. - * - * @return string - */ - protected function guessRelationship() - { - return debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3)[2]['function']; - } - - /** - * Determine whether the relationship is a one-of-many relationship. - * - * @return bool - */ - public function isOneOfMany() - { - return $this->isOneOfMany; - } - - /** - * Get the name of the relationship. - * - * @return string - */ - public function getRelationName() - { - return $this->relationName; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Concerns/ComparesRelatedModels.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Concerns/ComparesRelatedModels.php deleted file mode 100644 index ca066988..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Concerns/ComparesRelatedModels.php +++ /dev/null @@ -1,77 +0,0 @@ -compareKeys($this->getParentKey(), $this->getRelatedKeyFrom($model)) && - $this->related->getTable() === $model->getTable() && - $this->related->getConnectionName() === $model->getConnectionName(); - - if ($match && $this instanceof SupportsPartialRelations && $this->isOneOfMany()) { - return $this->query - ->whereKey($model->getKey()) - ->exists(); - } - - return $match; - } - - /** - * Determine if the model is not the related instance of the relationship. - * - * @param \Illuminate\Database\Eloquent\Model|null $model - * @return bool - */ - public function isNot($model) - { - return ! $this->is($model); - } - - /** - * Get the value of the parent model's key. - * - * @return mixed - */ - abstract public function getParentKey(); - - /** - * Get the value of the model's related key. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @return mixed - */ - abstract protected function getRelatedKeyFrom(Model $model); - - /** - * Compare the parent key with the related key. - * - * @param mixed $parentKey - * @param mixed $relatedKey - * @return bool - */ - protected function compareKeys($parentKey, $relatedKey) - { - if (empty($parentKey) || empty($relatedKey)) { - return false; - } - - if (is_int($parentKey) || is_int($relatedKey)) { - return (int) $parentKey === (int) $relatedKey; - } - - return $parentKey === $relatedKey; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithDictionary.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithDictionary.php deleted file mode 100644 index 91b3bf5b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithDictionary.php +++ /dev/null @@ -1,36 +0,0 @@ -__toString(); - } - - if (function_exists('enum_exists') && - $attribute instanceof UnitEnum) { - return $attribute instanceof BackedEnum ? $attribute->value : $attribute->name; - } - - throw new InvalidArgumentException('Model attribute value is an object but does not have a __toString method.'); - } - - return $attribute; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php deleted file mode 100644 index 2241719b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php +++ /dev/null @@ -1,681 +0,0 @@ - [], 'detached' => [], - ]; - - $records = $this->formatRecordsList($this->parseIds($ids)); - - // Next, we will determine which IDs should get removed from the join table by - // checking which of the given ID/records is in the list of current records - // and removing all of those rows from this "intermediate" joining table. - $detach = array_values(array_intersect( - $this->newPivotQuery()->pluck($this->relatedPivotKey)->all(), - array_keys($records) - )); - - if (count($detach) > 0) { - $this->detach($detach, false); - - $changes['detached'] = $this->castKeys($detach); - } - - // Finally, for all of the records which were not "detached", we'll attach the - // records into the intermediate table. Then, we will add those attaches to - // this change list and get ready to return these results to the callers. - $attach = array_diff_key($records, array_flip($detach)); - - if (count($attach) > 0) { - $this->attach($attach, [], false); - - $changes['attached'] = array_keys($attach); - } - - // Once we have finished attaching or detaching the records, we will see if we - // have done any attaching or detaching, and if we have we will touch these - // relationships if they are configured to touch on any database updates. - if ($touch && (count($changes['attached']) || - count($changes['detached']))) { - $this->touchIfTouching(); - } - - return $changes; - } - - /** - * Sync the intermediate tables with a list of IDs without detaching. - * - * @param \Illuminate\Support\Collection|\Illuminate\Database\Eloquent\Model|array $ids - * @return array - */ - public function syncWithoutDetaching($ids) - { - return $this->sync($ids, false); - } - - /** - * Sync the intermediate tables with a list of IDs or collection of models. - * - * @param \Illuminate\Support\Collection|\Illuminate\Database\Eloquent\Model|array $ids - * @param bool $detaching - * @return array - */ - public function sync($ids, $detaching = true) - { - $changes = [ - 'attached' => [], 'detached' => [], 'updated' => [], - ]; - - // First we need to attach any of the associated models that are not currently - // in this joining table. We'll spin through the given IDs, checking to see - // if they exist in the array of current ones, and if not we will insert. - $current = $this->getCurrentlyAttachedPivots() - ->pluck($this->relatedPivotKey)->all(); - - $records = $this->formatRecordsList($this->parseIds($ids)); - - // Next, we will take the differences of the currents and given IDs and detach - // all of the entities that exist in the "current" array but are not in the - // array of the new IDs given to the method which will complete the sync. - if ($detaching) { - $detach = array_diff($current, array_keys($records)); - - if (count($detach) > 0) { - $this->detach($detach); - - $changes['detached'] = $this->castKeys($detach); - } - } - - // Now we are finally ready to attach the new records. Note that we'll disable - // touching until after the entire operation is complete so we don't fire a - // ton of touch operations until we are totally done syncing the records. - $changes = array_merge( - $changes, $this->attachNew($records, $current, false) - ); - - // Once we have finished attaching or detaching the records, we will see if we - // have done any attaching or detaching, and if we have we will touch these - // relationships if they are configured to touch on any database updates. - if (count($changes['attached']) || - count($changes['updated']) || - count($changes['detached'])) { - $this->touchIfTouching(); - } - - return $changes; - } - - /** - * Sync the intermediate tables with a list of IDs or collection of models with the given pivot values. - * - * @param \Illuminate\Support\Collection|\Illuminate\Database\Eloquent\Model|array $ids - * @param array $values - * @param bool $detaching - * @return array - */ - public function syncWithPivotValues($ids, array $values, bool $detaching = true) - { - return $this->sync(collect($this->parseIds($ids))->mapWithKeys(function ($id) use ($values) { - return [$id => $values]; - }), $detaching); - } - - /** - * Format the sync / toggle record list so that it is keyed by ID. - * - * @param array $records - * @return array - */ - protected function formatRecordsList(array $records) - { - return collect($records)->mapWithKeys(function ($attributes, $id) { - if (! is_array($attributes)) { - [$id, $attributes] = [$attributes, []]; - } - - return [$id => $attributes]; - })->all(); - } - - /** - * Attach all of the records that aren't in the given current records. - * - * @param array $records - * @param array $current - * @param bool $touch - * @return array - */ - protected function attachNew(array $records, array $current, $touch = true) - { - $changes = ['attached' => [], 'updated' => []]; - - foreach ($records as $id => $attributes) { - // If the ID is not in the list of existing pivot IDs, we will insert a new pivot - // record, otherwise, we will just update this existing record on this joining - // table, so that the developers will easily update these records pain free. - if (! in_array($id, $current)) { - $this->attach($id, $attributes, $touch); - - $changes['attached'][] = $this->castKey($id); - } - - // Now we'll try to update an existing pivot record with the attributes that were - // given to the method. If the model is actually updated we will add it to the - // list of updated pivot records so we return them back out to the consumer. - elseif (count($attributes) > 0 && - $this->updateExistingPivot($id, $attributes, $touch)) { - $changes['updated'][] = $this->castKey($id); - } - } - - return $changes; - } - - /** - * Update an existing pivot record on the table. - * - * @param mixed $id - * @param array $attributes - * @param bool $touch - * @return int - */ - public function updateExistingPivot($id, array $attributes, $touch = true) - { - if ($this->using && - empty($this->pivotWheres) && - empty($this->pivotWhereIns) && - empty($this->pivotWhereNulls)) { - return $this->updateExistingPivotUsingCustomClass($id, $attributes, $touch); - } - - if ($this->hasPivotColumn($this->updatedAt())) { - $attributes = $this->addTimestampsToAttachment($attributes, true); - } - - $updated = $this->newPivotStatementForId($this->parseId($id))->update( - $this->castAttributes($attributes) - ); - - if ($touch) { - $this->touchIfTouching(); - } - - return $updated; - } - - /** - * Update an existing pivot record on the table via a custom class. - * - * @param mixed $id - * @param array $attributes - * @param bool $touch - * @return int - */ - protected function updateExistingPivotUsingCustomClass($id, array $attributes, $touch) - { - $pivot = $this->getCurrentlyAttachedPivots() - ->where($this->foreignPivotKey, $this->parent->{$this->parentKey}) - ->where($this->relatedPivotKey, $this->parseId($id)) - ->first(); - - $updated = $pivot ? $pivot->fill($attributes)->isDirty() : false; - - if ($updated) { - $pivot->save(); - } - - if ($touch) { - $this->touchIfTouching(); - } - - return (int) $updated; - } - - /** - * Attach a model to the parent. - * - * @param mixed $id - * @param array $attributes - * @param bool $touch - * @return void - */ - public function attach($id, array $attributes = [], $touch = true) - { - if ($this->using) { - $this->attachUsingCustomClass($id, $attributes); - } else { - // Here we will insert the attachment records into the pivot table. Once we have - // inserted the records, we will touch the relationships if necessary and the - // function will return. We can parse the IDs before inserting the records. - $this->newPivotStatement()->insert($this->formatAttachRecords( - $this->parseIds($id), $attributes - )); - } - - if ($touch) { - $this->touchIfTouching(); - } - } - - /** - * Attach a model to the parent using a custom class. - * - * @param mixed $id - * @param array $attributes - * @return void - */ - protected function attachUsingCustomClass($id, array $attributes) - { - $records = $this->formatAttachRecords( - $this->parseIds($id), $attributes - ); - - foreach ($records as $record) { - $this->newPivot($record, false)->save(); - } - } - - /** - * Create an array of records to insert into the pivot table. - * - * @param array $ids - * @param array $attributes - * @return array - */ - protected function formatAttachRecords($ids, array $attributes) - { - $records = []; - - $hasTimestamps = ($this->hasPivotColumn($this->createdAt()) || - $this->hasPivotColumn($this->updatedAt())); - - // To create the attachment records, we will simply spin through the IDs given - // and create a new record to insert for each ID. Each ID may actually be a - // key in the array, with extra attributes to be placed in other columns. - foreach ($ids as $key => $value) { - $records[] = $this->formatAttachRecord( - $key, $value, $attributes, $hasTimestamps - ); - } - - return $records; - } - - /** - * Create a full attachment record payload. - * - * @param int $key - * @param mixed $value - * @param array $attributes - * @param bool $hasTimestamps - * @return array - */ - protected function formatAttachRecord($key, $value, $attributes, $hasTimestamps) - { - [$id, $attributes] = $this->extractAttachIdAndAttributes($key, $value, $attributes); - - return array_merge( - $this->baseAttachRecord($id, $hasTimestamps), $this->castAttributes($attributes) - ); - } - - /** - * Get the attach record ID and extra attributes. - * - * @param mixed $key - * @param mixed $value - * @param array $attributes - * @return array - */ - protected function extractAttachIdAndAttributes($key, $value, array $attributes) - { - return is_array($value) - ? [$key, array_merge($value, $attributes)] - : [$value, $attributes]; - } - - /** - * Create a new pivot attachment record. - * - * @param int $id - * @param bool $timed - * @return array - */ - protected function baseAttachRecord($id, $timed) - { - $record[$this->relatedPivotKey] = $id; - - $record[$this->foreignPivotKey] = $this->parent->{$this->parentKey}; - - // If the record needs to have creation and update timestamps, we will make - // them by calling the parent model's "freshTimestamp" method which will - // provide us with a fresh timestamp in this model's preferred format. - if ($timed) { - $record = $this->addTimestampsToAttachment($record); - } - - foreach ($this->pivotValues as $value) { - $record[$value['column']] = $value['value']; - } - - return $record; - } - - /** - * Set the creation and update timestamps on an attach record. - * - * @param array $record - * @param bool $exists - * @return array - */ - protected function addTimestampsToAttachment(array $record, $exists = false) - { - $fresh = $this->parent->freshTimestamp(); - - if ($this->using) { - $pivotModel = new $this->using; - - $fresh = $fresh->format($pivotModel->getDateFormat()); - } - - if (! $exists && $this->hasPivotColumn($this->createdAt())) { - $record[$this->createdAt()] = $fresh; - } - - if ($this->hasPivotColumn($this->updatedAt())) { - $record[$this->updatedAt()] = $fresh; - } - - return $record; - } - - /** - * Determine whether the given column is defined as a pivot column. - * - * @param string $column - * @return bool - */ - public function hasPivotColumn($column) - { - return in_array($column, $this->pivotColumns); - } - - /** - * Detach models from the relationship. - * - * @param mixed $ids - * @param bool $touch - * @return int - */ - public function detach($ids = null, $touch = true) - { - if ($this->using && - ! empty($ids) && - empty($this->pivotWheres) && - empty($this->pivotWhereIns) && - empty($this->pivotWhereNulls)) { - $results = $this->detachUsingCustomClass($ids); - } else { - $query = $this->newPivotQuery(); - - // If associated IDs were passed to the method we will only delete those - // associations, otherwise all of the association ties will be broken. - // We'll return the numbers of affected rows when we do the deletes. - if (! is_null($ids)) { - $ids = $this->parseIds($ids); - - if (empty($ids)) { - return 0; - } - - $query->whereIn($this->getQualifiedRelatedPivotKeyName(), (array) $ids); - } - - // Once we have all of the conditions set on the statement, we are ready - // to run the delete on the pivot table. Then, if the touch parameter - // is true, we will go ahead and touch all related models to sync. - $results = $query->delete(); - } - - if ($touch) { - $this->touchIfTouching(); - } - - return $results; - } - - /** - * Detach models from the relationship using a custom class. - * - * @param mixed $ids - * @return int - */ - protected function detachUsingCustomClass($ids) - { - $results = 0; - - foreach ($this->parseIds($ids) as $id) { - $results += $this->newPivot([ - $this->foreignPivotKey => $this->parent->{$this->parentKey}, - $this->relatedPivotKey => $id, - ], true)->delete(); - } - - return $results; - } - - /** - * Get the pivot models that are currently attached. - * - * @return \Illuminate\Support\Collection - */ - protected function getCurrentlyAttachedPivots() - { - return $this->newPivotQuery()->get()->map(function ($record) { - $class = $this->using ?: Pivot::class; - - $pivot = $class::fromRawAttributes($this->parent, (array) $record, $this->getTable(), true); - - return $pivot->setPivotKeys($this->foreignPivotKey, $this->relatedPivotKey); - }); - } - - /** - * Create a new pivot model instance. - * - * @param array $attributes - * @param bool $exists - * @return \Illuminate\Database\Eloquent\Relations\Pivot - */ - public function newPivot(array $attributes = [], $exists = false) - { - $pivot = $this->related->newPivot( - $this->parent, $attributes, $this->table, $exists, $this->using - ); - - return $pivot->setPivotKeys($this->foreignPivotKey, $this->relatedPivotKey); - } - - /** - * Create a new existing pivot model instance. - * - * @param array $attributes - * @return \Illuminate\Database\Eloquent\Relations\Pivot - */ - public function newExistingPivot(array $attributes = []) - { - return $this->newPivot($attributes, true); - } - - /** - * Get a new plain query builder for the pivot table. - * - * @return \Illuminate\Database\Query\Builder - */ - public function newPivotStatement() - { - return $this->query->getQuery()->newQuery()->from($this->table); - } - - /** - * Get a new pivot statement for a given "other" ID. - * - * @param mixed $id - * @return \Illuminate\Database\Query\Builder - */ - public function newPivotStatementForId($id) - { - return $this->newPivotQuery()->whereIn($this->relatedPivotKey, $this->parseIds($id)); - } - - /** - * Create a new query builder for the pivot table. - * - * @return \Illuminate\Database\Query\Builder - */ - public function newPivotQuery() - { - $query = $this->newPivotStatement(); - - foreach ($this->pivotWheres as $arguments) { - $query->where(...$arguments); - } - - foreach ($this->pivotWhereIns as $arguments) { - $query->whereIn(...$arguments); - } - - foreach ($this->pivotWhereNulls as $arguments) { - $query->whereNull(...$arguments); - } - - return $query->where($this->getQualifiedForeignPivotKeyName(), $this->parent->{$this->parentKey}); - } - - /** - * Set the columns on the pivot table to retrieve. - * - * @param array|mixed $columns - * @return $this - */ - public function withPivot($columns) - { - $this->pivotColumns = array_merge( - $this->pivotColumns, is_array($columns) ? $columns : func_get_args() - ); - - return $this; - } - - /** - * Get all of the IDs from the given mixed value. - * - * @param mixed $value - * @return array - */ - protected function parseIds($value) - { - if ($value instanceof Model) { - return [$value->{$this->relatedKey}]; - } - - if ($value instanceof Collection) { - return $value->pluck($this->relatedKey)->all(); - } - - if ($value instanceof BaseCollection) { - return $value->toArray(); - } - - return (array) $value; - } - - /** - * Get the ID from the given mixed value. - * - * @param mixed $value - * @return mixed - */ - protected function parseId($value) - { - return $value instanceof Model ? $value->{$this->relatedKey} : $value; - } - - /** - * Cast the given keys to integers if they are numeric and string otherwise. - * - * @param array $keys - * @return array - */ - protected function castKeys(array $keys) - { - return array_map(function ($v) { - return $this->castKey($v); - }, $keys); - } - - /** - * Cast the given key to convert to primary key type. - * - * @param mixed $key - * @return mixed - */ - protected function castKey($key) - { - return $this->getTypeSwapValue( - $this->related->getKeyType(), - $key - ); - } - - /** - * Cast the given pivot attributes. - * - * @param array $attributes - * @return array - */ - protected function castAttributes($attributes) - { - return $this->using - ? $this->newPivot()->fill($attributes)->getAttributes() - : $attributes; - } - - /** - * Converts a given value to a given type value. - * - * @param string $type - * @param mixed $value - * @return mixed - */ - protected function getTypeSwapValue($type, $value) - { - return match (strtolower($type)) { - 'int', 'integer' => (int) $value, - 'real', 'float', 'double' => (float) $value, - 'string' => (string) $value, - default => $value, - }; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Concerns/SupportsDefaultModels.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Concerns/SupportsDefaultModels.php deleted file mode 100644 index 74e758f5..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Concerns/SupportsDefaultModels.php +++ /dev/null @@ -1,63 +0,0 @@ -withDefault = $callback; - - return $this; - } - - /** - * Get the default value for this relation. - * - * @param \Illuminate\Database\Eloquent\Model $parent - * @return \Illuminate\Database\Eloquent\Model|null - */ - protected function getDefaultFor(Model $parent) - { - if (! $this->withDefault) { - return; - } - - $instance = $this->newRelatedInstanceFor($parent); - - if (is_callable($this->withDefault)) { - return call_user_func($this->withDefault, $instance, $parent) ?: $instance; - } - - if (is_array($this->withDefault)) { - $instance->forceFill($this->withDefault); - } - - return $instance; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/HasMany.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/HasMany.php deleted file mode 100755 index b005d4ff..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/HasMany.php +++ /dev/null @@ -1,49 +0,0 @@ -getParentKey()) - ? $this->query->get() - : $this->related->newCollection(); - } - - /** - * Initialize the relation on a set of models. - * - * @param array $models - * @param string $relation - * @return array - */ - public function initRelation(array $models, $relation) - { - foreach ($models as $model) { - $model->setRelation($relation, $this->related->newCollection()); - } - - return $models; - } - - /** - * Match the eagerly loaded results to their parents. - * - * @param array $models - * @param \Illuminate\Database\Eloquent\Collection $results - * @param string $relation - * @return array - */ - public function match(array $models, Collection $results, $relation) - { - return $this->matchMany($models, $results, $relation); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php deleted file mode 100644 index 893d5fab..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php +++ /dev/null @@ -1,772 +0,0 @@ -localKey = $localKey; - $this->firstKey = $firstKey; - $this->secondKey = $secondKey; - $this->farParent = $farParent; - $this->throughParent = $throughParent; - $this->secondLocalKey = $secondLocalKey; - - parent::__construct($query, $throughParent); - } - - /** - * Set the base constraints on the relation query. - * - * @return void - */ - public function addConstraints() - { - $localValue = $this->farParent[$this->localKey]; - - $this->performJoin(); - - if (static::$constraints) { - $this->query->where($this->getQualifiedFirstKeyName(), '=', $localValue); - } - } - - /** - * Set the join clause on the query. - * - * @param \Illuminate\Database\Eloquent\Builder|null $query - * @return void - */ - protected function performJoin(Builder $query = null) - { - $query = $query ?: $this->query; - - $farKey = $this->getQualifiedFarKeyName(); - - $query->join($this->throughParent->getTable(), $this->getQualifiedParentKeyName(), '=', $farKey); - - if ($this->throughParentSoftDeletes()) { - $query->withGlobalScope('SoftDeletableHasManyThrough', function ($query) { - $query->whereNull($this->throughParent->getQualifiedDeletedAtColumn()); - }); - } - } - - /** - * Get the fully qualified parent key name. - * - * @return string - */ - public function getQualifiedParentKeyName() - { - return $this->parent->qualifyColumn($this->secondLocalKey); - } - - /** - * Determine whether "through" parent of the relation uses Soft Deletes. - * - * @return bool - */ - public function throughParentSoftDeletes() - { - return in_array(SoftDeletes::class, class_uses_recursive($this->throughParent)); - } - - /** - * Indicate that trashed "through" parents should be included in the query. - * - * @return $this - */ - public function withTrashedParents() - { - $this->query->withoutGlobalScope('SoftDeletableHasManyThrough'); - - return $this; - } - - /** - * Set the constraints for an eager load of the relation. - * - * @param array $models - * @return void - */ - public function addEagerConstraints(array $models) - { - $whereIn = $this->whereInMethod($this->farParent, $this->localKey); - - $this->query->{$whereIn}( - $this->getQualifiedFirstKeyName(), $this->getKeys($models, $this->localKey) - ); - } - - /** - * Initialize the relation on a set of models. - * - * @param array $models - * @param string $relation - * @return array - */ - public function initRelation(array $models, $relation) - { - foreach ($models as $model) { - $model->setRelation($relation, $this->related->newCollection()); - } - - return $models; - } - - /** - * Match the eagerly loaded results to their parents. - * - * @param array $models - * @param \Illuminate\Database\Eloquent\Collection $results - * @param string $relation - * @return array - */ - public function match(array $models, Collection $results, $relation) - { - $dictionary = $this->buildDictionary($results); - - // Once we have the dictionary we can simply spin through the parent models to - // link them up with their children using the keyed dictionary to make the - // matching very convenient and easy work. Then we'll just return them. - foreach ($models as $model) { - if (isset($dictionary[$key = $this->getDictionaryKey($model->getAttribute($this->localKey))])) { - $model->setRelation( - $relation, $this->related->newCollection($dictionary[$key]) - ); - } - } - - return $models; - } - - /** - * Build model dictionary keyed by the relation's foreign key. - * - * @param \Illuminate\Database\Eloquent\Collection $results - * @return array - */ - protected function buildDictionary(Collection $results) - { - $dictionary = []; - - // First we will create a dictionary of models keyed by the foreign key of the - // relationship as this will allow us to quickly access all of the related - // models without having to do nested looping which will be quite slow. - foreach ($results as $result) { - $dictionary[$result->laravel_through_key][] = $result; - } - - return $dictionary; - } - - /** - * Get the first related model record matching the attributes or instantiate it. - * - * @param array $attributes - * @return \Illuminate\Database\Eloquent\Model - */ - public function firstOrNew(array $attributes) - { - if (is_null($instance = $this->where($attributes)->first())) { - $instance = $this->related->newInstance($attributes); - } - - return $instance; - } - - /** - * Create or update a related record matching the attributes, and fill it with values. - * - * @param array $attributes - * @param array $values - * @return \Illuminate\Database\Eloquent\Model - */ - public function updateOrCreate(array $attributes, array $values = []) - { - $instance = $this->firstOrNew($attributes); - - $instance->fill($values)->save(); - - return $instance; - } - - /** - * Add a basic where clause to the query, and return the first result. - * - * @param \Closure|string|array $column - * @param mixed $operator - * @param mixed $value - * @param string $boolean - * @return \Illuminate\Database\Eloquent\Model|static - */ - public function firstWhere($column, $operator = null, $value = null, $boolean = 'and') - { - return $this->where($column, $operator, $value, $boolean)->first(); - } - - /** - * Execute the query and get the first related model. - * - * @param array $columns - * @return mixed - */ - public function first($columns = ['*']) - { - $results = $this->take(1)->get($columns); - - return count($results) > 0 ? $results->first() : null; - } - - /** - * Execute the query and get the first result or throw an exception. - * - * @param array $columns - * @return \Illuminate\Database\Eloquent\Model|static - * - * @throws \Illuminate\Database\Eloquent\ModelNotFoundException<\Illuminate\Database\Eloquent\Model> - */ - public function firstOrFail($columns = ['*']) - { - if (! is_null($model = $this->first($columns))) { - return $model; - } - - throw (new ModelNotFoundException)->setModel(get_class($this->related)); - } - - /** - * Execute the query and get the first result or call a callback. - * - * @param \Closure|array $columns - * @param \Closure|null $callback - * @return \Illuminate\Database\Eloquent\Model|static|mixed - */ - public function firstOr($columns = ['*'], Closure $callback = null) - { - if ($columns instanceof Closure) { - $callback = $columns; - - $columns = ['*']; - } - - if (! is_null($model = $this->first($columns))) { - return $model; - } - - return $callback(); - } - - /** - * Find a related model by its primary key. - * - * @param mixed $id - * @param array $columns - * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection|null - */ - public function find($id, $columns = ['*']) - { - if (is_array($id) || $id instanceof Arrayable) { - return $this->findMany($id, $columns); - } - - return $this->where( - $this->getRelated()->getQualifiedKeyName(), '=', $id - )->first($columns); - } - - /** - * Find multiple related models by their primary keys. - * - * @param \Illuminate\Contracts\Support\Arrayable|array $ids - * @param array $columns - * @return \Illuminate\Database\Eloquent\Collection - */ - public function findMany($ids, $columns = ['*']) - { - $ids = $ids instanceof Arrayable ? $ids->toArray() : $ids; - - if (empty($ids)) { - return $this->getRelated()->newCollection(); - } - - return $this->whereIn( - $this->getRelated()->getQualifiedKeyName(), $ids - )->get($columns); - } - - /** - * Find a related model by its primary key or throw an exception. - * - * @param mixed $id - * @param array $columns - * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection - * - * @throws \Illuminate\Database\Eloquent\ModelNotFoundException<\Illuminate\Database\Eloquent\Model> - */ - public function findOrFail($id, $columns = ['*']) - { - $result = $this->find($id, $columns); - - $id = $id instanceof Arrayable ? $id->toArray() : $id; - - if (is_array($id)) { - if (count($result) === count(array_unique($id))) { - return $result; - } - } elseif (! is_null($result)) { - return $result; - } - - throw (new ModelNotFoundException)->setModel(get_class($this->related), $id); - } - - /** - * Find a related model by its primary key or call a callback. - * - * @param mixed $id - * @param \Closure|array $columns - * @param \Closure|null $callback - * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection|mixed - */ - public function findOr($id, $columns = ['*'], Closure $callback = null) - { - if ($columns instanceof Closure) { - $callback = $columns; - - $columns = ['*']; - } - - $result = $this->find($id, $columns); - - $id = $id instanceof Arrayable ? $id->toArray() : $id; - - if (is_array($id)) { - if (count($result) === count(array_unique($id))) { - return $result; - } - } elseif (! is_null($result)) { - return $result; - } - - return $callback(); - } - - /** - * Get the results of the relationship. - * - * @return mixed - */ - public function getResults() - { - return ! is_null($this->farParent->{$this->localKey}) - ? $this->get() - : $this->related->newCollection(); - } - - /** - * Execute the query as a "select" statement. - * - * @param array $columns - * @return \Illuminate\Database\Eloquent\Collection - */ - public function get($columns = ['*']) - { - $builder = $this->prepareQueryBuilder($columns); - - $models = $builder->getModels(); - - // If we actually found models we will also eager load any relationships that - // have been specified as needing to be eager loaded. This will solve the - // n + 1 query problem for the developer and also increase performance. - if (count($models) > 0) { - $models = $builder->eagerLoadRelations($models); - } - - return $this->related->newCollection($models); - } - - /** - * Get a paginator for the "select" statement. - * - * @param int|null $perPage - * @param array $columns - * @param string $pageName - * @param int $page - * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator - */ - public function paginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) - { - $this->query->addSelect($this->shouldSelect($columns)); - - return $this->query->paginate($perPage, $columns, $pageName, $page); - } - - /** - * Paginate the given query into a simple paginator. - * - * @param int|null $perPage - * @param array $columns - * @param string $pageName - * @param int|null $page - * @return \Illuminate\Contracts\Pagination\Paginator - */ - public function simplePaginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) - { - $this->query->addSelect($this->shouldSelect($columns)); - - return $this->query->simplePaginate($perPage, $columns, $pageName, $page); - } - - /** - * Paginate the given query into a cursor paginator. - * - * @param int|null $perPage - * @param array $columns - * @param string $cursorName - * @param string|null $cursor - * @return \Illuminate\Contracts\Pagination\CursorPaginator - */ - public function cursorPaginate($perPage = null, $columns = ['*'], $cursorName = 'cursor', $cursor = null) - { - $this->query->addSelect($this->shouldSelect($columns)); - - return $this->query->cursorPaginate($perPage, $columns, $cursorName, $cursor); - } - - /** - * Set the select clause for the relation query. - * - * @param array $columns - * @return array - */ - protected function shouldSelect(array $columns = ['*']) - { - if ($columns == ['*']) { - $columns = [$this->related->getTable().'.*']; - } - - return array_merge($columns, [$this->getQualifiedFirstKeyName().' as laravel_through_key']); - } - - /** - * Chunk the results of the query. - * - * @param int $count - * @param callable $callback - * @return bool - */ - public function chunk($count, callable $callback) - { - return $this->prepareQueryBuilder()->chunk($count, $callback); - } - - /** - * Chunk the results of a query by comparing numeric IDs. - * - * @param int $count - * @param callable $callback - * @param string|null $column - * @param string|null $alias - * @return bool - */ - public function chunkById($count, callable $callback, $column = null, $alias = null) - { - $column ??= $this->getRelated()->getQualifiedKeyName(); - - $alias ??= $this->getRelated()->getKeyName(); - - return $this->prepareQueryBuilder()->chunkById($count, $callback, $column, $alias); - } - - /** - * Get a generator for the given query. - * - * @return \Generator - */ - public function cursor() - { - return $this->prepareQueryBuilder()->cursor(); - } - - /** - * Execute a callback over each item while chunking. - * - * @param callable $callback - * @param int $count - * @return bool - */ - public function each(callable $callback, $count = 1000) - { - return $this->chunk($count, function ($results) use ($callback) { - foreach ($results as $key => $value) { - if ($callback($value, $key) === false) { - return false; - } - } - }); - } - - /** - * Query lazily, by chunks of the given size. - * - * @param int $chunkSize - * @return \Illuminate\Support\LazyCollection - */ - public function lazy($chunkSize = 1000) - { - return $this->prepareQueryBuilder()->lazy($chunkSize); - } - - /** - * Query lazily, by chunking the results of a query by comparing IDs. - * - * @param int $chunkSize - * @param string|null $column - * @param string|null $alias - * @return \Illuminate\Support\LazyCollection - */ - public function lazyById($chunkSize = 1000, $column = null, $alias = null) - { - $column ??= $this->getRelated()->getQualifiedKeyName(); - - $alias ??= $this->getRelated()->getKeyName(); - - return $this->prepareQueryBuilder()->lazyById($chunkSize, $column, $alias); - } - - /** - * Prepare the query builder for query execution. - * - * @param array $columns - * @return \Illuminate\Database\Eloquent\Builder - */ - protected function prepareQueryBuilder($columns = ['*']) - { - $builder = $this->query->applyScopes(); - - return $builder->addSelect( - $this->shouldSelect($builder->getQuery()->columns ? [] : $columns) - ); - } - - /** - * Add the constraints for a relationship query. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Builder $parentQuery - * @param array|mixed $columns - * @return \Illuminate\Database\Eloquent\Builder - */ - public function getRelationExistenceQuery(Builder $query, Builder $parentQuery, $columns = ['*']) - { - if ($parentQuery->getQuery()->from === $query->getQuery()->from) { - return $this->getRelationExistenceQueryForSelfRelation($query, $parentQuery, $columns); - } - - if ($parentQuery->getQuery()->from === $this->throughParent->getTable()) { - return $this->getRelationExistenceQueryForThroughSelfRelation($query, $parentQuery, $columns); - } - - $this->performJoin($query); - - return $query->select($columns)->whereColumn( - $this->getQualifiedLocalKeyName(), '=', $this->getQualifiedFirstKeyName() - ); - } - - /** - * Add the constraints for a relationship query on the same table. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Builder $parentQuery - * @param array|mixed $columns - * @return \Illuminate\Database\Eloquent\Builder - */ - public function getRelationExistenceQueryForSelfRelation(Builder $query, Builder $parentQuery, $columns = ['*']) - { - $query->from($query->getModel()->getTable().' as '.$hash = $this->getRelationCountHash()); - - $query->join($this->throughParent->getTable(), $this->getQualifiedParentKeyName(), '=', $hash.'.'.$this->secondKey); - - if ($this->throughParentSoftDeletes()) { - $query->whereNull($this->throughParent->getQualifiedDeletedAtColumn()); - } - - $query->getModel()->setTable($hash); - - return $query->select($columns)->whereColumn( - $parentQuery->getQuery()->from.'.'.$this->localKey, '=', $this->getQualifiedFirstKeyName() - ); - } - - /** - * Add the constraints for a relationship query on the same table as the through parent. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Builder $parentQuery - * @param array|mixed $columns - * @return \Illuminate\Database\Eloquent\Builder - */ - public function getRelationExistenceQueryForThroughSelfRelation(Builder $query, Builder $parentQuery, $columns = ['*']) - { - $table = $this->throughParent->getTable().' as '.$hash = $this->getRelationCountHash(); - - $query->join($table, $hash.'.'.$this->secondLocalKey, '=', $this->getQualifiedFarKeyName()); - - if ($this->throughParentSoftDeletes()) { - $query->whereNull($hash.'.'.$this->throughParent->getDeletedAtColumn()); - } - - return $query->select($columns)->whereColumn( - $parentQuery->getQuery()->from.'.'.$this->localKey, '=', $hash.'.'.$this->firstKey - ); - } - - /** - * Get the qualified foreign key on the related model. - * - * @return string - */ - public function getQualifiedFarKeyName() - { - return $this->getQualifiedForeignKeyName(); - } - - /** - * Get the foreign key on the "through" model. - * - * @return string - */ - public function getFirstKeyName() - { - return $this->firstKey; - } - - /** - * Get the qualified foreign key on the "through" model. - * - * @return string - */ - public function getQualifiedFirstKeyName() - { - return $this->throughParent->qualifyColumn($this->firstKey); - } - - /** - * Get the foreign key on the related model. - * - * @return string - */ - public function getForeignKeyName() - { - return $this->secondKey; - } - - /** - * Get the qualified foreign key on the related model. - * - * @return string - */ - public function getQualifiedForeignKeyName() - { - return $this->related->qualifyColumn($this->secondKey); - } - - /** - * Get the local key on the far parent model. - * - * @return string - */ - public function getLocalKeyName() - { - return $this->localKey; - } - - /** - * Get the qualified local key on the far parent model. - * - * @return string - */ - public function getQualifiedLocalKeyName() - { - return $this->farParent->qualifyColumn($this->localKey); - } - - /** - * Get the local key on the intermediary model. - * - * @return string - */ - public function getSecondLocalKeyName() - { - return $this->secondLocalKey; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/HasOne.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/HasOne.php deleted file mode 100755 index ed85f1e9..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/HasOne.php +++ /dev/null @@ -1,137 +0,0 @@ -getParentKey())) { - return $this->getDefaultFor($this->parent); - } - - return $this->query->first() ?: $this->getDefaultFor($this->parent); - } - - /** - * Initialize the relation on a set of models. - * - * @param array $models - * @param string $relation - * @return array - */ - public function initRelation(array $models, $relation) - { - foreach ($models as $model) { - $model->setRelation($relation, $this->getDefaultFor($model)); - } - - return $models; - } - - /** - * Match the eagerly loaded results to their parents. - * - * @param array $models - * @param \Illuminate\Database\Eloquent\Collection $results - * @param string $relation - * @return array - */ - public function match(array $models, Collection $results, $relation) - { - return $this->matchOne($models, $results, $relation); - } - - /** - * Add the constraints for an internal relationship existence query. - * - * Essentially, these queries compare on column names like "whereColumn". - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Builder $parentQuery - * @param array|mixed $columns - * @return \Illuminate\Database\Eloquent\Builder - */ - public function getRelationExistenceQuery(Builder $query, Builder $parentQuery, $columns = ['*']) - { - if ($this->isOneOfMany()) { - $this->mergeOneOfManyJoinsTo($query); - } - - return parent::getRelationExistenceQuery($query, $parentQuery, $columns); - } - - /** - * Add constraints for inner join subselect for one of many relationships. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param string|null $column - * @param string|null $aggregate - * @return void - */ - public function addOneOfManySubQueryConstraints(Builder $query, $column = null, $aggregate = null) - { - $query->addSelect($this->foreignKey); - } - - /** - * Get the columns that should be selected by the one of many subquery. - * - * @return array|string - */ - public function getOneOfManySubQuerySelectColumns() - { - return $this->foreignKey; - } - - /** - * Add join query constraints for one of many relationships. - * - * @param \Illuminate\Database\Query\JoinClause $join - * @return void - */ - public function addOneOfManyJoinSubQueryConstraints(JoinClause $join) - { - $join->on($this->qualifySubSelectColumn($this->foreignKey), '=', $this->qualifyRelatedColumn($this->foreignKey)); - } - - /** - * Make a new related instance for the given model. - * - * @param \Illuminate\Database\Eloquent\Model $parent - * @return \Illuminate\Database\Eloquent\Model - */ - public function newRelatedInstanceFor(Model $parent) - { - return $this->related->newInstance()->setAttribute( - $this->getForeignKeyName(), $parent->{$this->localKey} - ); - } - - /** - * Get the value of the model's foreign key. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @return mixed - */ - protected function getRelatedKeyFrom(Model $model) - { - return $model->getAttribute($this->getForeignKeyName()); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/HasOneOrMany.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/HasOneOrMany.php deleted file mode 100755 index d1a76c18..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/HasOneOrMany.php +++ /dev/null @@ -1,464 +0,0 @@ -localKey = $localKey; - $this->foreignKey = $foreignKey; - - parent::__construct($query, $parent); - } - - /** - * Create and return an un-saved instance of the related model. - * - * @param array $attributes - * @return \Illuminate\Database\Eloquent\Model - */ - public function make(array $attributes = []) - { - return tap($this->related->newInstance($attributes), function ($instance) { - $this->setForeignAttributesForCreate($instance); - }); - } - - /** - * Create and return an un-saved instance of the related models. - * - * @param iterable $records - * @return \Illuminate\Database\Eloquent\Collection - */ - public function makeMany($records) - { - $instances = $this->related->newCollection(); - - foreach ($records as $record) { - $instances->push($this->make($record)); - } - - return $instances; - } - - /** - * Set the base constraints on the relation query. - * - * @return void - */ - public function addConstraints() - { - if (static::$constraints) { - $query = $this->getRelationQuery(); - - $query->where($this->foreignKey, '=', $this->getParentKey()); - - $query->whereNotNull($this->foreignKey); - } - } - - /** - * Set the constraints for an eager load of the relation. - * - * @param array $models - * @return void - */ - public function addEagerConstraints(array $models) - { - $whereIn = $this->whereInMethod($this->parent, $this->localKey); - - $this->getRelationQuery()->{$whereIn}( - $this->foreignKey, $this->getKeys($models, $this->localKey) - ); - } - - /** - * Match the eagerly loaded results to their single parents. - * - * @param array $models - * @param \Illuminate\Database\Eloquent\Collection $results - * @param string $relation - * @return array - */ - public function matchOne(array $models, Collection $results, $relation) - { - return $this->matchOneOrMany($models, $results, $relation, 'one'); - } - - /** - * Match the eagerly loaded results to their many parents. - * - * @param array $models - * @param \Illuminate\Database\Eloquent\Collection $results - * @param string $relation - * @return array - */ - public function matchMany(array $models, Collection $results, $relation) - { - return $this->matchOneOrMany($models, $results, $relation, 'many'); - } - - /** - * Match the eagerly loaded results to their many parents. - * - * @param array $models - * @param \Illuminate\Database\Eloquent\Collection $results - * @param string $relation - * @param string $type - * @return array - */ - protected function matchOneOrMany(array $models, Collection $results, $relation, $type) - { - $dictionary = $this->buildDictionary($results); - - // Once we have the dictionary we can simply spin through the parent models to - // link them up with their children using the keyed dictionary to make the - // matching very convenient and easy work. Then we'll just return them. - foreach ($models as $model) { - if (isset($dictionary[$key = $this->getDictionaryKey($model->getAttribute($this->localKey))])) { - $model->setRelation( - $relation, $this->getRelationValue($dictionary, $key, $type) - ); - } - } - - return $models; - } - - /** - * Get the value of a relationship by one or many type. - * - * @param array $dictionary - * @param string $key - * @param string $type - * @return mixed - */ - protected function getRelationValue(array $dictionary, $key, $type) - { - $value = $dictionary[$key]; - - return $type === 'one' ? reset($value) : $this->related->newCollection($value); - } - - /** - * Build model dictionary keyed by the relation's foreign key. - * - * @param \Illuminate\Database\Eloquent\Collection $results - * @return array - */ - protected function buildDictionary(Collection $results) - { - $foreign = $this->getForeignKeyName(); - - return $results->mapToDictionary(function ($result) use ($foreign) { - return [$this->getDictionaryKey($result->{$foreign}) => $result]; - })->all(); - } - - /** - * Find a model by its primary key or return a new instance of the related model. - * - * @param mixed $id - * @param array $columns - * @return \Illuminate\Support\Collection|\Illuminate\Database\Eloquent\Model - */ - public function findOrNew($id, $columns = ['*']) - { - if (is_null($instance = $this->find($id, $columns))) { - $instance = $this->related->newInstance(); - - $this->setForeignAttributesForCreate($instance); - } - - return $instance; - } - - /** - * Get the first related model record matching the attributes or instantiate it. - * - * @param array $attributes - * @param array $values - * @return \Illuminate\Database\Eloquent\Model - */ - public function firstOrNew(array $attributes = [], array $values = []) - { - if (is_null($instance = $this->where($attributes)->first())) { - $instance = $this->related->newInstance(array_merge($attributes, $values)); - - $this->setForeignAttributesForCreate($instance); - } - - return $instance; - } - - /** - * Get the first related record matching the attributes or create it. - * - * @param array $attributes - * @param array $values - * @return \Illuminate\Database\Eloquent\Model - */ - public function firstOrCreate(array $attributes = [], array $values = []) - { - if (is_null($instance = $this->where($attributes)->first())) { - $instance = $this->create(array_merge($attributes, $values)); - } - - return $instance; - } - - /** - * Create or update a related record matching the attributes, and fill it with values. - * - * @param array $attributes - * @param array $values - * @return \Illuminate\Database\Eloquent\Model - */ - public function updateOrCreate(array $attributes, array $values = []) - { - return tap($this->firstOrNew($attributes), function ($instance) use ($values) { - $instance->fill($values); - - $instance->save(); - }); - } - - /** - * Attach a model instance to the parent model. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @return \Illuminate\Database\Eloquent\Model|false - */ - public function save(Model $model) - { - $this->setForeignAttributesForCreate($model); - - return $model->save() ? $model : false; - } - - /** - * Attach a model instance without raising any events to the parent model. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @return \Illuminate\Database\Eloquent\Model|false - */ - public function saveQuietly(Model $model) - { - return Model::withoutEvents(function () use ($model) { - return $this->save($model); - }); - } - - /** - * Attach a collection of models to the parent instance. - * - * @param iterable $models - * @return iterable - */ - public function saveMany($models) - { - foreach ($models as $model) { - $this->save($model); - } - - return $models; - } - - /** - * Attach a collection of models to the parent instance without raising any events to the parent model. - * - * @param iterable $models - * @return iterable - */ - public function saveManyQuietly($models) - { - return Model::withoutEvents(function () use ($models) { - return $this->saveMany($models); - }); - } - - /** - * Create a new instance of the related model. - * - * @param array $attributes - * @return \Illuminate\Database\Eloquent\Model - */ - public function create(array $attributes = []) - { - return tap($this->related->newInstance($attributes), function ($instance) { - $this->setForeignAttributesForCreate($instance); - - $instance->save(); - }); - } - - /** - * Create a new instance of the related model. Allow mass-assignment. - * - * @param array $attributes - * @return \Illuminate\Database\Eloquent\Model - */ - public function forceCreate(array $attributes = []) - { - $attributes[$this->getForeignKeyName()] = $this->getParentKey(); - - return $this->related->forceCreate($attributes); - } - - /** - * Create a Collection of new instances of the related model. - * - * @param iterable $records - * @return \Illuminate\Database\Eloquent\Collection - */ - public function createMany(iterable $records) - { - $instances = $this->related->newCollection(); - - foreach ($records as $record) { - $instances->push($this->create($record)); - } - - return $instances; - } - - /** - * Set the foreign ID for creating a related model. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @return void - */ - protected function setForeignAttributesForCreate(Model $model) - { - $model->setAttribute($this->getForeignKeyName(), $this->getParentKey()); - } - - /** - * Add the constraints for a relationship query. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Builder $parentQuery - * @param array|mixed $columns - * @return \Illuminate\Database\Eloquent\Builder - */ - public function getRelationExistenceQuery(Builder $query, Builder $parentQuery, $columns = ['*']) - { - if ($query->getQuery()->from == $parentQuery->getQuery()->from) { - return $this->getRelationExistenceQueryForSelfRelation($query, $parentQuery, $columns); - } - - return parent::getRelationExistenceQuery($query, $parentQuery, $columns); - } - - /** - * Add the constraints for a relationship query on the same table. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Builder $parentQuery - * @param array|mixed $columns - * @return \Illuminate\Database\Eloquent\Builder - */ - public function getRelationExistenceQueryForSelfRelation(Builder $query, Builder $parentQuery, $columns = ['*']) - { - $query->from($query->getModel()->getTable().' as '.$hash = $this->getRelationCountHash()); - - $query->getModel()->setTable($hash); - - return $query->select($columns)->whereColumn( - $this->getQualifiedParentKeyName(), '=', $hash.'.'.$this->getForeignKeyName() - ); - } - - /** - * Get the key for comparing against the parent key in "has" query. - * - * @return string - */ - public function getExistenceCompareKey() - { - return $this->getQualifiedForeignKeyName(); - } - - /** - * Get the key value of the parent's local key. - * - * @return mixed - */ - public function getParentKey() - { - return $this->parent->getAttribute($this->localKey); - } - - /** - * Get the fully qualified parent key name. - * - * @return string - */ - public function getQualifiedParentKeyName() - { - return $this->parent->qualifyColumn($this->localKey); - } - - /** - * Get the plain foreign key. - * - * @return string - */ - public function getForeignKeyName() - { - $segments = explode('.', $this->getQualifiedForeignKeyName()); - - return end($segments); - } - - /** - * Get the foreign key for the relationship. - * - * @return string - */ - public function getQualifiedForeignKeyName() - { - return $this->foreignKey; - } - - /** - * Get the local key for the relationship. - * - * @return string - */ - public function getLocalKeyName() - { - return $this->localKey; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/HasOneThrough.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/HasOneThrough.php deleted file mode 100644 index ed9c7baa..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/HasOneThrough.php +++ /dev/null @@ -1,77 +0,0 @@ -first() ?: $this->getDefaultFor($this->farParent); - } - - /** - * Initialize the relation on a set of models. - * - * @param array $models - * @param string $relation - * @return array - */ - public function initRelation(array $models, $relation) - { - foreach ($models as $model) { - $model->setRelation($relation, $this->getDefaultFor($model)); - } - - return $models; - } - - /** - * Match the eagerly loaded results to their parents. - * - * @param array $models - * @param \Illuminate\Database\Eloquent\Collection $results - * @param string $relation - * @return array - */ - public function match(array $models, Collection $results, $relation) - { - $dictionary = $this->buildDictionary($results); - - // Once we have the dictionary we can simply spin through the parent models to - // link them up with their children using the keyed dictionary to make the - // matching very convenient and easy work. Then we'll just return them. - foreach ($models as $model) { - if (isset($dictionary[$key = $this->getDictionaryKey($model->getAttribute($this->localKey))])) { - $value = $dictionary[$key]; - $model->setRelation( - $relation, reset($value) - ); - } - } - - return $models; - } - - /** - * Make a new related instance for the given model. - * - * @param \Illuminate\Database\Eloquent\Model $parent - * @return \Illuminate\Database\Eloquent\Model - */ - public function newRelatedInstanceFor(Model $parent) - { - return $this->related->newInstance(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphMany.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphMany.php deleted file mode 100755 index 282ba2e8..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphMany.php +++ /dev/null @@ -1,62 +0,0 @@ -getParentKey()) - ? $this->query->get() - : $this->related->newCollection(); - } - - /** - * Initialize the relation on a set of models. - * - * @param array $models - * @param string $relation - * @return array - */ - public function initRelation(array $models, $relation) - { - foreach ($models as $model) { - $model->setRelation($relation, $this->related->newCollection()); - } - - return $models; - } - - /** - * Match the eagerly loaded results to their parents. - * - * @param array $models - * @param \Illuminate\Database\Eloquent\Collection $results - * @param string $relation - * @return array - */ - public function match(array $models, Collection $results, $relation) - { - return $this->matchMany($models, $results, $relation); - } - - /** - * Create a new instance of the related model. Allow mass-assignment. - * - * @param array $attributes - * @return \Illuminate\Database\Eloquent\Model - */ - public function forceCreate(array $attributes = []) - { - $attributes[$this->getMorphType()] = $this->morphClass; - - return parent::forceCreate($attributes); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphOne.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphOne.php deleted file mode 100755 index fc8f4dc8..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphOne.php +++ /dev/null @@ -1,137 +0,0 @@ -getParentKey())) { - return $this->getDefaultFor($this->parent); - } - - return $this->query->first() ?: $this->getDefaultFor($this->parent); - } - - /** - * Initialize the relation on a set of models. - * - * @param array $models - * @param string $relation - * @return array - */ - public function initRelation(array $models, $relation) - { - foreach ($models as $model) { - $model->setRelation($relation, $this->getDefaultFor($model)); - } - - return $models; - } - - /** - * Match the eagerly loaded results to their parents. - * - * @param array $models - * @param \Illuminate\Database\Eloquent\Collection $results - * @param string $relation - * @return array - */ - public function match(array $models, Collection $results, $relation) - { - return $this->matchOne($models, $results, $relation); - } - - /** - * Get the relationship query. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Builder $parentQuery - * @param array|mixed $columns - * @return \Illuminate\Database\Eloquent\Builder - */ - public function getRelationExistenceQuery(Builder $query, Builder $parentQuery, $columns = ['*']) - { - if ($this->isOneOfMany()) { - $this->mergeOneOfManyJoinsTo($query); - } - - return parent::getRelationExistenceQuery($query, $parentQuery, $columns); - } - - /** - * Add constraints for inner join subselect for one of many relationships. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param string|null $column - * @param string|null $aggregate - * @return void - */ - public function addOneOfManySubQueryConstraints(Builder $query, $column = null, $aggregate = null) - { - $query->addSelect($this->foreignKey, $this->morphType); - } - - /** - * Get the columns that should be selected by the one of many subquery. - * - * @return array|string - */ - public function getOneOfManySubQuerySelectColumns() - { - return [$this->foreignKey, $this->morphType]; - } - - /** - * Add join query constraints for one of many relationships. - * - * @param \Illuminate\Database\Query\JoinClause $join - * @return void - */ - public function addOneOfManyJoinSubQueryConstraints(JoinClause $join) - { - $join - ->on($this->qualifySubSelectColumn($this->morphType), '=', $this->qualifyRelatedColumn($this->morphType)) - ->on($this->qualifySubSelectColumn($this->foreignKey), '=', $this->qualifyRelatedColumn($this->foreignKey)); - } - - /** - * Make a new related instance for the given model. - * - * @param \Illuminate\Database\Eloquent\Model $parent - * @return \Illuminate\Database\Eloquent\Model - */ - public function newRelatedInstanceFor(Model $parent) - { - return $this->related->newInstance() - ->setAttribute($this->getForeignKeyName(), $parent->{$this->localKey}) - ->setAttribute($this->getMorphType(), $this->morphClass); - } - - /** - * Get the value of the model's foreign key. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @return mixed - */ - protected function getRelatedKeyFrom(Model $model) - { - return $model->getAttribute($this->getForeignKeyName()); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphOneOrMany.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphOneOrMany.php deleted file mode 100755 index 6e2297fc..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphOneOrMany.php +++ /dev/null @@ -1,127 +0,0 @@ -morphType = $type; - - $this->morphClass = $parent->getMorphClass(); - - parent::__construct($query, $parent, $id, $localKey); - } - - /** - * Set the base constraints on the relation query. - * - * @return void - */ - public function addConstraints() - { - if (static::$constraints) { - $this->getRelationQuery()->where($this->morphType, $this->morphClass); - - parent::addConstraints(); - } - } - - /** - * Set the constraints for an eager load of the relation. - * - * @param array $models - * @return void - */ - public function addEagerConstraints(array $models) - { - parent::addEagerConstraints($models); - - $this->getRelationQuery()->where($this->morphType, $this->morphClass); - } - - /** - * Set the foreign ID and type for creating a related model. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @return void - */ - protected function setForeignAttributesForCreate(Model $model) - { - $model->{$this->getForeignKeyName()} = $this->getParentKey(); - - $model->{$this->getMorphType()} = $this->morphClass; - } - - /** - * Get the relationship query. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Builder $parentQuery - * @param array|mixed $columns - * @return \Illuminate\Database\Eloquent\Builder - */ - public function getRelationExistenceQuery(Builder $query, Builder $parentQuery, $columns = ['*']) - { - return parent::getRelationExistenceQuery($query, $parentQuery, $columns)->where( - $query->qualifyColumn($this->getMorphType()), $this->morphClass - ); - } - - /** - * Get the foreign key "type" name. - * - * @return string - */ - public function getQualifiedMorphType() - { - return $this->morphType; - } - - /** - * Get the plain morph type name without the table. - * - * @return string - */ - public function getMorphType() - { - return last(explode('.', $this->morphType)); - } - - /** - * Get the class name of the parent model. - * - * @return string - */ - public function getMorphClass() - { - return $this->morphClass; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphPivot.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphPivot.php deleted file mode 100644 index 5ca8b48b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphPivot.php +++ /dev/null @@ -1,182 +0,0 @@ -where($this->morphType, $this->morphClass); - - return parent::setKeysForSaveQuery($query); - } - - /** - * Set the keys for a select query. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @return \Illuminate\Database\Eloquent\Builder - */ - protected function setKeysForSelectQuery($query) - { - $query->where($this->morphType, $this->morphClass); - - return parent::setKeysForSelectQuery($query); - } - - /** - * Delete the pivot model record from the database. - * - * @return int - */ - public function delete() - { - if (isset($this->attributes[$this->getKeyName()])) { - return (int) parent::delete(); - } - - if ($this->fireModelEvent('deleting') === false) { - return 0; - } - - $query = $this->getDeleteQuery(); - - $query->where($this->morphType, $this->morphClass); - - return tap($query->delete(), function () { - $this->fireModelEvent('deleted', false); - }); - } - - /** - * Get the morph type for the pivot. - * - * @return string - */ - public function getMorphType() - { - return $this->morphType; - } - - /** - * Set the morph type for the pivot. - * - * @param string $morphType - * @return $this - */ - public function setMorphType($morphType) - { - $this->morphType = $morphType; - - return $this; - } - - /** - * Set the morph class for the pivot. - * - * @param string $morphClass - * @return \Illuminate\Database\Eloquent\Relations\MorphPivot - */ - public function setMorphClass($morphClass) - { - $this->morphClass = $morphClass; - - return $this; - } - - /** - * Get the queueable identity for the entity. - * - * @return mixed - */ - public function getQueueableId() - { - if (isset($this->attributes[$this->getKeyName()])) { - return $this->getKey(); - } - - return sprintf( - '%s:%s:%s:%s:%s:%s', - $this->foreignKey, $this->getAttribute($this->foreignKey), - $this->relatedKey, $this->getAttribute($this->relatedKey), - $this->morphType, $this->morphClass - ); - } - - /** - * Get a new query to restore one or more models by their queueable IDs. - * - * @param array|int $ids - * @return \Illuminate\Database\Eloquent\Builder - */ - public function newQueryForRestoration($ids) - { - if (is_array($ids)) { - return $this->newQueryForCollectionRestoration($ids); - } - - if (! str_contains($ids, ':')) { - return parent::newQueryForRestoration($ids); - } - - $segments = explode(':', $ids); - - return $this->newQueryWithoutScopes() - ->where($segments[0], $segments[1]) - ->where($segments[2], $segments[3]) - ->where($segments[4], $segments[5]); - } - - /** - * Get a new query to restore multiple models by their queueable IDs. - * - * @param array $ids - * @return \Illuminate\Database\Eloquent\Builder - */ - protected function newQueryForCollectionRestoration(array $ids) - { - $ids = array_values($ids); - - if (! str_contains($ids[0], ':')) { - return parent::newQueryForRestoration($ids); - } - - $query = $this->newQueryWithoutScopes(); - - foreach ($ids as $id) { - $segments = explode(':', $id); - - $query->orWhere(function ($query) use ($segments) { - return $query->where($segments[0], $segments[1]) - ->where($segments[2], $segments[3]) - ->where($segments[4], $segments[5]); - }); - } - - return $query; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphTo.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphTo.php deleted file mode 100644 index 262741f3..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphTo.php +++ /dev/null @@ -1,396 +0,0 @@ -morphType = $type; - - parent::__construct($query, $parent, $foreignKey, $ownerKey, $relation); - } - - /** - * Set the constraints for an eager load of the relation. - * - * @param array $models - * @return void - */ - public function addEagerConstraints(array $models) - { - $this->buildDictionary($this->models = Collection::make($models)); - } - - /** - * Build a dictionary with the models. - * - * @param \Illuminate\Database\Eloquent\Collection $models - * @return void - */ - protected function buildDictionary(Collection $models) - { - foreach ($models as $model) { - if ($model->{$this->morphType}) { - $morphTypeKey = $this->getDictionaryKey($model->{$this->morphType}); - $foreignKeyKey = $this->getDictionaryKey($model->{$this->foreignKey}); - - $this->dictionary[$morphTypeKey][$foreignKeyKey][] = $model; - } - } - } - - /** - * Get the results of the relationship. - * - * Called via eager load method of Eloquent query builder. - * - * @return mixed - */ - public function getEager() - { - foreach (array_keys($this->dictionary) as $type) { - $this->matchToMorphParents($type, $this->getResultsByType($type)); - } - - return $this->models; - } - - /** - * Get all of the relation results for a type. - * - * @param string $type - * @return \Illuminate\Database\Eloquent\Collection - */ - protected function getResultsByType($type) - { - $instance = $this->createModelByType($type); - - $ownerKey = $this->ownerKey ?? $instance->getKeyName(); - - $query = $this->replayMacros($instance->newQuery()) - ->mergeConstraintsFrom($this->getQuery()) - ->with(array_merge( - $this->getQuery()->getEagerLoads(), - (array) ($this->morphableEagerLoads[get_class($instance)] ?? []) - )) - ->withCount( - (array) ($this->morphableEagerLoadCounts[get_class($instance)] ?? []) - ); - - if ($callback = ($this->morphableConstraints[get_class($instance)] ?? null)) { - $callback($query); - } - - $whereIn = $this->whereInMethod($instance, $ownerKey); - - return $query->{$whereIn}( - $instance->getTable().'.'.$ownerKey, $this->gatherKeysByType($type, $instance->getKeyType()) - )->get(); - } - - /** - * Gather all of the foreign keys for a given type. - * - * @param string $type - * @param string $keyType - * @return array - */ - protected function gatherKeysByType($type, $keyType) - { - return $keyType !== 'string' - ? array_keys($this->dictionary[$type]) - : array_map(function ($modelId) { - return (string) $modelId; - }, array_filter(array_keys($this->dictionary[$type]))); - } - - /** - * Create a new model instance by type. - * - * @param string $type - * @return \Illuminate\Database\Eloquent\Model - */ - public function createModelByType($type) - { - $class = Model::getActualClassNameForMorph($type); - - return tap(new $class, function ($instance) { - if (! $instance->getConnectionName()) { - $instance->setConnection($this->getConnection()->getName()); - } - }); - } - - /** - * Match the eagerly loaded results to their parents. - * - * @param array $models - * @param \Illuminate\Database\Eloquent\Collection $results - * @param string $relation - * @return array - */ - public function match(array $models, Collection $results, $relation) - { - return $models; - } - - /** - * Match the results for a given type to their parents. - * - * @param string $type - * @param \Illuminate\Database\Eloquent\Collection $results - * @return void - */ - protected function matchToMorphParents($type, Collection $results) - { - foreach ($results as $result) { - $ownerKey = ! is_null($this->ownerKey) ? $this->getDictionaryKey($result->{$this->ownerKey}) : $result->getKey(); - - if (isset($this->dictionary[$type][$ownerKey])) { - foreach ($this->dictionary[$type][$ownerKey] as $model) { - $model->setRelation($this->relationName, $result); - } - } - } - } - - /** - * Associate the model instance to the given parent. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @return \Illuminate\Database\Eloquent\Model - */ - public function associate($model) - { - if ($model instanceof Model) { - $foreignKey = $this->ownerKey && $model->{$this->ownerKey} - ? $this->ownerKey - : $model->getKeyName(); - } - - $this->parent->setAttribute( - $this->foreignKey, $model instanceof Model ? $model->{$foreignKey} : null - ); - - $this->parent->setAttribute( - $this->morphType, $model instanceof Model ? $model->getMorphClass() : null - ); - - return $this->parent->setRelation($this->relationName, $model); - } - - /** - * Dissociate previously associated model from the given parent. - * - * @return \Illuminate\Database\Eloquent\Model - */ - public function dissociate() - { - $this->parent->setAttribute($this->foreignKey, null); - - $this->parent->setAttribute($this->morphType, null); - - return $this->parent->setRelation($this->relationName, null); - } - - /** - * Touch all of the related models for the relationship. - * - * @return void - */ - public function touch() - { - if (! is_null($this->child->{$this->foreignKey})) { - parent::touch(); - } - } - - /** - * Make a new related instance for the given model. - * - * @param \Illuminate\Database\Eloquent\Model $parent - * @return \Illuminate\Database\Eloquent\Model - */ - protected function newRelatedInstanceFor(Model $parent) - { - return $parent->{$this->getRelationName()}()->getRelated()->newInstance(); - } - - /** - * Get the foreign key "type" name. - * - * @return string - */ - public function getMorphType() - { - return $this->morphType; - } - - /** - * Get the dictionary used by the relationship. - * - * @return array - */ - public function getDictionary() - { - return $this->dictionary; - } - - /** - * Specify which relations to load for a given morph type. - * - * @param array $with - * @return \Illuminate\Database\Eloquent\Relations\MorphTo - */ - public function morphWith(array $with) - { - $this->morphableEagerLoads = array_merge( - $this->morphableEagerLoads, $with - ); - - return $this; - } - - /** - * Specify which relationship counts to load for a given morph type. - * - * @param array $withCount - * @return \Illuminate\Database\Eloquent\Relations\MorphTo - */ - public function morphWithCount(array $withCount) - { - $this->morphableEagerLoadCounts = array_merge( - $this->morphableEagerLoadCounts, $withCount - ); - - return $this; - } - - /** - * Specify constraints on the query for a given morph type. - * - * @param array $callbacks - * @return \Illuminate\Database\Eloquent\Relations\MorphTo - */ - public function constrain(array $callbacks) - { - $this->morphableConstraints = array_merge( - $this->morphableConstraints, $callbacks - ); - - return $this; - } - - /** - * Replay stored macro calls on the actual related instance. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @return \Illuminate\Database\Eloquent\Builder - */ - protected function replayMacros(Builder $query) - { - foreach ($this->macroBuffer as $macro) { - $query->{$macro['method']}(...$macro['parameters']); - } - - return $query; - } - - /** - * Handle dynamic method calls to the relationship. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - try { - $result = parent::__call($method, $parameters); - - if (in_array($method, ['select', 'selectRaw', 'selectSub', 'addSelect', 'withoutGlobalScopes'])) { - $this->macroBuffer[] = compact('method', 'parameters'); - } - - return $result; - } - - // If we tried to call a method that does not exist on the parent Builder instance, - // we'll assume that we want to call a query macro (e.g. withTrashed) that only - // exists on related models. We will just store the call and replay it later. - catch (BadMethodCallException $e) { - $this->macroBuffer[] = compact('method', 'parameters'); - - return $this; - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphToMany.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphToMany.php deleted file mode 100644 index c2d57455..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphToMany.php +++ /dev/null @@ -1,209 +0,0 @@ -inverse = $inverse; - $this->morphType = $name.'_type'; - $this->morphClass = $inverse ? $query->getModel()->getMorphClass() : $parent->getMorphClass(); - - parent::__construct( - $query, $parent, $table, $foreignPivotKey, - $relatedPivotKey, $parentKey, $relatedKey, $relationName - ); - } - - /** - * Set the where clause for the relation query. - * - * @return $this - */ - protected function addWhereConstraints() - { - parent::addWhereConstraints(); - - $this->query->where($this->qualifyPivotColumn($this->morphType), $this->morphClass); - - return $this; - } - - /** - * Set the constraints for an eager load of the relation. - * - * @param array $models - * @return void - */ - public function addEagerConstraints(array $models) - { - parent::addEagerConstraints($models); - - $this->query->where($this->qualifyPivotColumn($this->morphType), $this->morphClass); - } - - /** - * Create a new pivot attachment record. - * - * @param int $id - * @param bool $timed - * @return array - */ - protected function baseAttachRecord($id, $timed) - { - return Arr::add( - parent::baseAttachRecord($id, $timed), $this->morphType, $this->morphClass - ); - } - - /** - * Add the constraints for a relationship count query. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Builder $parentQuery - * @param array|mixed $columns - * @return \Illuminate\Database\Eloquent\Builder - */ - public function getRelationExistenceQuery(Builder $query, Builder $parentQuery, $columns = ['*']) - { - return parent::getRelationExistenceQuery($query, $parentQuery, $columns)->where( - $this->qualifyPivotColumn($this->morphType), $this->morphClass - ); - } - - /** - * Get the pivot models that are currently attached. - * - * @return \Illuminate\Support\Collection - */ - protected function getCurrentlyAttachedPivots() - { - return parent::getCurrentlyAttachedPivots()->map(function ($record) { - return $record instanceof MorphPivot - ? $record->setMorphType($this->morphType) - ->setMorphClass($this->morphClass) - : $record; - }); - } - - /** - * Create a new query builder for the pivot table. - * - * @return \Illuminate\Database\Query\Builder - */ - public function newPivotQuery() - { - return parent::newPivotQuery()->where($this->morphType, $this->morphClass); - } - - /** - * Create a new pivot model instance. - * - * @param array $attributes - * @param bool $exists - * @return \Illuminate\Database\Eloquent\Relations\Pivot - */ - public function newPivot(array $attributes = [], $exists = false) - { - $using = $this->using; - - $pivot = $using ? $using::fromRawAttributes($this->parent, $attributes, $this->table, $exists) - : MorphPivot::fromAttributes($this->parent, $attributes, $this->table, $exists); - - $pivot->setPivotKeys($this->foreignPivotKey, $this->relatedPivotKey) - ->setMorphType($this->morphType) - ->setMorphClass($this->morphClass); - - return $pivot; - } - - /** - * Get the pivot columns for the relation. - * - * "pivot_" is prefixed at each column for easy removal later. - * - * @return array - */ - protected function aliasedPivotColumns() - { - $defaults = [$this->foreignPivotKey, $this->relatedPivotKey, $this->morphType]; - - return collect(array_merge($defaults, $this->pivotColumns))->map(function ($column) { - return $this->qualifyPivotColumn($column).' as pivot_'.$column; - })->unique()->all(); - } - - /** - * Get the foreign key "type" name. - * - * @return string - */ - public function getMorphType() - { - return $this->morphType; - } - - /** - * Get the class name of the parent model. - * - * @return string - */ - public function getMorphClass() - { - return $this->morphClass; - } - - /** - * Get the indicator for a reverse relationship. - * - * @return bool - */ - public function getInverse() - { - return $this->inverse; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Pivot.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Pivot.php deleted file mode 100755 index a65ecdea..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Pivot.php +++ /dev/null @@ -1,25 +0,0 @@ -query = $query; - $this->parent = $parent; - $this->related = $query->getModel(); - - $this->addConstraints(); - } - - /** - * Run a callback with constraints disabled on the relation. - * - * @param \Closure $callback - * @return mixed - */ - public static function noConstraints(Closure $callback) - { - $previous = static::$constraints; - - static::$constraints = false; - - // When resetting the relation where clause, we want to shift the first element - // off of the bindings, leaving only the constraints that the developers put - // as "extra" on the relationships, and not original relation constraints. - try { - return $callback(); - } finally { - static::$constraints = $previous; - } - } - - /** - * Set the base constraints on the relation query. - * - * @return void - */ - abstract public function addConstraints(); - - /** - * Set the constraints for an eager load of the relation. - * - * @param array $models - * @return void - */ - abstract public function addEagerConstraints(array $models); - - /** - * Initialize the relation on a set of models. - * - * @param array $models - * @param string $relation - * @return array - */ - abstract public function initRelation(array $models, $relation); - - /** - * Match the eagerly loaded results to their parents. - * - * @param array $models - * @param \Illuminate\Database\Eloquent\Collection $results - * @param string $relation - * @return array - */ - abstract public function match(array $models, Collection $results, $relation); - - /** - * Get the results of the relationship. - * - * @return mixed - */ - abstract public function getResults(); - - /** - * Get the relationship for eager loading. - * - * @return \Illuminate\Database\Eloquent\Collection - */ - public function getEager() - { - return $this->get(); - } - - /** - * Execute the query and get the first result if it's the sole matching record. - * - * @param array|string $columns - * @return \Illuminate\Database\Eloquent\Model - * - * @throws \Illuminate\Database\Eloquent\ModelNotFoundException<\Illuminate\Database\Eloquent\Model> - * @throws \Illuminate\Database\MultipleRecordsFoundException - */ - public function sole($columns = ['*']) - { - $result = $this->take(2)->get($columns); - - $count = $result->count(); - - if ($count === 0) { - throw (new ModelNotFoundException)->setModel(get_class($this->related)); - } - - if ($count > 1) { - throw new MultipleRecordsFoundException($count); - } - - return $result->first(); - } - - /** - * Execute the query as a "select" statement. - * - * @param array $columns - * @return \Illuminate\Database\Eloquent\Collection - */ - public function get($columns = ['*']) - { - return $this->query->get($columns); - } - - /** - * Touch all of the related models for the relationship. - * - * @return void - */ - public function touch() - { - $model = $this->getRelated(); - - if (! $model::isIgnoringTouch()) { - $this->rawUpdate([ - $model->getUpdatedAtColumn() => $model->freshTimestampString(), - ]); - } - } - - /** - * Run a raw update against the base query. - * - * @param array $attributes - * @return int - */ - public function rawUpdate(array $attributes = []) - { - return $this->query->withoutGlobalScopes()->update($attributes); - } - - /** - * Add the constraints for a relationship count query. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Builder $parentQuery - * @return \Illuminate\Database\Eloquent\Builder - */ - public function getRelationExistenceCountQuery(Builder $query, Builder $parentQuery) - { - return $this->getRelationExistenceQuery( - $query, $parentQuery, new Expression('count(*)') - )->setBindings([], 'select'); - } - - /** - * Add the constraints for an internal relationship existence query. - * - * Essentially, these queries compare on column names like whereColumn. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Builder $parentQuery - * @param array|mixed $columns - * @return \Illuminate\Database\Eloquent\Builder - */ - public function getRelationExistenceQuery(Builder $query, Builder $parentQuery, $columns = ['*']) - { - return $query->select($columns)->whereColumn( - $this->getQualifiedParentKeyName(), '=', $this->getExistenceCompareKey() - ); - } - - /** - * Get a relationship join table hash. - * - * @param bool $incrementJoinCount - * @return string - */ - public function getRelationCountHash($incrementJoinCount = true) - { - return 'laravel_reserved_'.($incrementJoinCount ? static::$selfJoinCount++ : static::$selfJoinCount); - } - - /** - * Get all of the primary keys for an array of models. - * - * @param array $models - * @param string|null $key - * @return array - */ - protected function getKeys(array $models, $key = null) - { - return collect($models)->map(function ($value) use ($key) { - return $key ? $value->getAttribute($key) : $value->getKey(); - })->values()->unique(null, true)->sort()->all(); - } - - /** - * Get the query builder that will contain the relationship constraints. - * - * @return \Illuminate\Database\Eloquent\Builder - */ - protected function getRelationQuery() - { - return $this->query; - } - - /** - * Get the underlying query for the relation. - * - * @return \Illuminate\Database\Eloquent\Builder - */ - public function getQuery() - { - return $this->query; - } - - /** - * Get the base query builder driving the Eloquent builder. - * - * @return \Illuminate\Database\Query\Builder - */ - public function getBaseQuery() - { - return $this->query->getQuery(); - } - - /** - * Get a base query builder instance. - * - * @return \Illuminate\Database\Query\Builder - */ - public function toBase() - { - return $this->query->toBase(); - } - - /** - * Get the parent model of the relation. - * - * @return \Illuminate\Database\Eloquent\Model - */ - public function getParent() - { - return $this->parent; - } - - /** - * Get the fully qualified parent key name. - * - * @return string - */ - public function getQualifiedParentKeyName() - { - return $this->parent->getQualifiedKeyName(); - } - - /** - * Get the related model of the relation. - * - * @return \Illuminate\Database\Eloquent\Model - */ - public function getRelated() - { - return $this->related; - } - - /** - * Get the name of the "created at" column. - * - * @return string - */ - public function createdAt() - { - return $this->parent->getCreatedAtColumn(); - } - - /** - * Get the name of the "updated at" column. - * - * @return string - */ - public function updatedAt() - { - return $this->parent->getUpdatedAtColumn(); - } - - /** - * Get the name of the related model's "updated at" column. - * - * @return string - */ - public function relatedUpdatedAt() - { - return $this->related->getUpdatedAtColumn(); - } - - /** - * Get the name of the "where in" method for eager loading. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @param string $key - * @return string - */ - protected function whereInMethod(Model $model, $key) - { - return $model->getKeyName() === last(explode('.', $key)) - && in_array($model->getKeyType(), ['int', 'integer']) - ? 'whereIntegerInRaw' - : 'whereIn'; - } - - /** - * Prevent polymorphic relationships from being used without model mappings. - * - * @param bool $requireMorphMap - * @return void - */ - public static function requireMorphMap($requireMorphMap = true) - { - static::$requireMorphMap = $requireMorphMap; - } - - /** - * Determine if polymorphic relationships require explicit model mapping. - * - * @return bool - */ - public static function requiresMorphMap() - { - return static::$requireMorphMap; - } - - /** - * Define the morph map for polymorphic relations and require all morphed models to be explicitly mapped. - * - * @param array $map - * @param bool $merge - * @return array - */ - public static function enforceMorphMap(array $map, $merge = true) - { - static::requireMorphMap(); - - return static::morphMap($map, $merge); - } - - /** - * Set or get the morph map for polymorphic relations. - * - * @param array|null $map - * @param bool $merge - * @return array - */ - public static function morphMap(array $map = null, $merge = true) - { - $map = static::buildMorphMapFromModels($map); - - if (is_array($map)) { - static::$morphMap = $merge && static::$morphMap - ? $map + static::$morphMap : $map; - } - - return static::$morphMap; - } - - /** - * Builds a table-keyed array from model class names. - * - * @param string[]|null $models - * @return array|null - */ - protected static function buildMorphMapFromModels(array $models = null) - { - if (is_null($models) || Arr::isAssoc($models)) { - return $models; - } - - return array_combine(array_map(function ($model) { - return (new $model)->getTable(); - }, $models), $models); - } - - /** - * Get the model associated with a custom polymorphic type. - * - * @param string $alias - * @return string|null - */ - public static function getMorphedModel($alias) - { - return static::$morphMap[$alias] ?? null; - } - - /** - * Handle dynamic method calls to the relationship. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - if (static::hasMacro($method)) { - return $this->macroCall($method, $parameters); - } - - return $this->forwardDecoratedCallTo($this->query, $method, $parameters); - } - - /** - * Force a clone of the underlying query builder when cloning. - * - * @return void - */ - public function __clone() - { - $this->query = clone $this->query; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Scope.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Scope.php deleted file mode 100644 index 63cba6a5..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Scope.php +++ /dev/null @@ -1,15 +0,0 @@ -casts[$this->getDeletedAtColumn()])) { - $this->casts[$this->getDeletedAtColumn()] = 'datetime'; - } - } - - /** - * Force a hard delete on a soft deleted model. - * - * @return bool|null - */ - public function forceDelete() - { - $this->forceDeleting = true; - - return tap($this->delete(), function ($deleted) { - $this->forceDeleting = false; - - if ($deleted) { - $this->fireModelEvent('forceDeleted', false); - } - }); - } - - /** - * Perform the actual delete query on this model instance. - * - * @return mixed - */ - protected function performDeleteOnModel() - { - if ($this->forceDeleting) { - return tap($this->setKeysForSaveQuery($this->newModelQuery())->forceDelete(), function () { - $this->exists = false; - }); - } - - return $this->runSoftDelete(); - } - - /** - * Perform the actual delete query on this model instance. - * - * @return void - */ - protected function runSoftDelete() - { - $query = $this->setKeysForSaveQuery($this->newModelQuery()); - - $time = $this->freshTimestamp(); - - $columns = [$this->getDeletedAtColumn() => $this->fromDateTime($time)]; - - $this->{$this->getDeletedAtColumn()} = $time; - - if ($this->usesTimestamps() && ! is_null($this->getUpdatedAtColumn())) { - $this->{$this->getUpdatedAtColumn()} = $time; - - $columns[$this->getUpdatedAtColumn()] = $this->fromDateTime($time); - } - - $query->update($columns); - - $this->syncOriginalAttributes(array_keys($columns)); - - $this->fireModelEvent('trashed', false); - } - - /** - * Restore a soft-deleted model instance. - * - * @return bool|null - */ - public function restore() - { - // If the restoring event does not return false, we will proceed with this - // restore operation. Otherwise, we bail out so the developer will stop - // the restore totally. We will clear the deleted timestamp and save. - if ($this->fireModelEvent('restoring') === false) { - return false; - } - - $this->{$this->getDeletedAtColumn()} = null; - - // Once we have saved the model, we will fire the "restored" event so this - // developer will do anything they need to after a restore operation is - // totally finished. Then we will return the result of the save call. - $this->exists = true; - - $result = $this->save(); - - $this->fireModelEvent('restored', false); - - return $result; - } - - /** - * Restore a soft-deleted model instance without raising any events. - * - * @return bool|null - */ - public function restoreQuietly() - { - return static::withoutEvents(fn () => $this->restore()); - } - - /** - * Determine if the model instance has been soft-deleted. - * - * @return bool - */ - public function trashed() - { - return ! is_null($this->{$this->getDeletedAtColumn()}); - } - - /** - * Register a "softDeleted" model event callback with the dispatcher. - * - * @param \Closure|string $callback - * @return void - */ - public static function softDeleted($callback) - { - static::registerModelEvent('trashed', $callback); - } - - /** - * Register a "restoring" model event callback with the dispatcher. - * - * @param \Closure|string $callback - * @return void - */ - public static function restoring($callback) - { - static::registerModelEvent('restoring', $callback); - } - - /** - * Register a "restored" model event callback with the dispatcher. - * - * @param \Closure|string $callback - * @return void - */ - public static function restored($callback) - { - static::registerModelEvent('restored', $callback); - } - - /** - * Register a "forceDeleted" model event callback with the dispatcher. - * - * @param \Closure|string $callback - * @return void - */ - public static function forceDeleted($callback) - { - static::registerModelEvent('forceDeleted', $callback); - } - - /** - * Determine if the model is currently force deleting. - * - * @return bool - */ - public function isForceDeleting() - { - return $this->forceDeleting; - } - - /** - * Get the name of the "deleted at" column. - * - * @return string - */ - public function getDeletedAtColumn() - { - return defined(static::class.'::DELETED_AT') ? static::DELETED_AT : 'deleted_at'; - } - - /** - * Get the fully qualified "deleted at" column. - * - * @return string - */ - public function getQualifiedDeletedAtColumn() - { - return $this->qualifyColumn($this->getDeletedAtColumn()); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/SoftDeletingScope.php b/vendor/laravel/framework/src/Illuminate/Database/Eloquent/SoftDeletingScope.php deleted file mode 100644 index 7528964c..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Eloquent/SoftDeletingScope.php +++ /dev/null @@ -1,131 +0,0 @@ -whereNull($model->getQualifiedDeletedAtColumn()); - } - - /** - * Extend the query builder with the needed functions. - * - * @param \Illuminate\Database\Eloquent\Builder $builder - * @return void - */ - public function extend(Builder $builder) - { - foreach ($this->extensions as $extension) { - $this->{"add{$extension}"}($builder); - } - - $builder->onDelete(function (Builder $builder) { - $column = $this->getDeletedAtColumn($builder); - - return $builder->update([ - $column => $builder->getModel()->freshTimestampString(), - ]); - }); - } - - /** - * Get the "deleted at" column for the builder. - * - * @param \Illuminate\Database\Eloquent\Builder $builder - * @return string - */ - protected function getDeletedAtColumn(Builder $builder) - { - if (count((array) $builder->getQuery()->joins) > 0) { - return $builder->getModel()->getQualifiedDeletedAtColumn(); - } - - return $builder->getModel()->getDeletedAtColumn(); - } - - /** - * Add the restore extension to the builder. - * - * @param \Illuminate\Database\Eloquent\Builder $builder - * @return void - */ - protected function addRestore(Builder $builder) - { - $builder->macro('restore', function (Builder $builder) { - $builder->withTrashed(); - - return $builder->update([$builder->getModel()->getDeletedAtColumn() => null]); - }); - } - - /** - * Add the with-trashed extension to the builder. - * - * @param \Illuminate\Database\Eloquent\Builder $builder - * @return void - */ - protected function addWithTrashed(Builder $builder) - { - $builder->macro('withTrashed', function (Builder $builder, $withTrashed = true) { - if (! $withTrashed) { - return $builder->withoutTrashed(); - } - - return $builder->withoutGlobalScope($this); - }); - } - - /** - * Add the without-trashed extension to the builder. - * - * @param \Illuminate\Database\Eloquent\Builder $builder - * @return void - */ - protected function addWithoutTrashed(Builder $builder) - { - $builder->macro('withoutTrashed', function (Builder $builder) { - $model = $builder->getModel(); - - $builder->withoutGlobalScope($this)->whereNull( - $model->getQualifiedDeletedAtColumn() - ); - - return $builder; - }); - } - - /** - * Add the only-trashed extension to the builder. - * - * @param \Illuminate\Database\Eloquent\Builder $builder - * @return void - */ - protected function addOnlyTrashed(Builder $builder) - { - $builder->macro('onlyTrashed', function (Builder $builder) { - $model = $builder->getModel(); - - $builder->withoutGlobalScope($this)->whereNotNull( - $model->getQualifiedDeletedAtColumn() - ); - - return $builder; - }); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Events/ConnectionEvent.php b/vendor/laravel/framework/src/Illuminate/Database/Events/ConnectionEvent.php deleted file mode 100644 index 818c7850..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Events/ConnectionEvent.php +++ /dev/null @@ -1,32 +0,0 @@ -connection = $connection; - $this->connectionName = $connection->getName(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Events/DatabaseBusy.php b/vendor/laravel/framework/src/Illuminate/Database/Events/DatabaseBusy.php deleted file mode 100644 index 8e903a90..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Events/DatabaseBusy.php +++ /dev/null @@ -1,32 +0,0 @@ -connectionName = $connectionName; - $this->connections = $connections; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Events/DatabaseRefreshed.php b/vendor/laravel/framework/src/Illuminate/Database/Events/DatabaseRefreshed.php deleted file mode 100644 index 5b1fb458..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Events/DatabaseRefreshed.php +++ /dev/null @@ -1,10 +0,0 @@ -method = $method; - $this->migration = $migration; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Events/MigrationStarted.php b/vendor/laravel/framework/src/Illuminate/Database/Events/MigrationStarted.php deleted file mode 100644 index 3f206b4c..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Events/MigrationStarted.php +++ /dev/null @@ -1,8 +0,0 @@ -method = $method; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Events/MigrationsStarted.php b/vendor/laravel/framework/src/Illuminate/Database/Events/MigrationsStarted.php deleted file mode 100644 index 5283b499..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Events/MigrationsStarted.php +++ /dev/null @@ -1,8 +0,0 @@ -model = $model; - $this->count = $count; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Events/NoPendingMigrations.php b/vendor/laravel/framework/src/Illuminate/Database/Events/NoPendingMigrations.php deleted file mode 100644 index 100f7866..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Events/NoPendingMigrations.php +++ /dev/null @@ -1,24 +0,0 @@ -method = $method; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Events/QueryExecuted.php b/vendor/laravel/framework/src/Illuminate/Database/Events/QueryExecuted.php deleted file mode 100644 index 833a21e6..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Events/QueryExecuted.php +++ /dev/null @@ -1,59 +0,0 @@ -sql = $sql; - $this->time = $time; - $this->bindings = $bindings; - $this->connection = $connection; - $this->connectionName = $connection->getName(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Events/SchemaDumped.php b/vendor/laravel/framework/src/Illuminate/Database/Events/SchemaDumped.php deleted file mode 100644 index 1cbbfff9..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Events/SchemaDumped.php +++ /dev/null @@ -1,41 +0,0 @@ -connection = $connection; - $this->connectionName = $connection->getName(); - $this->path = $path; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Events/SchemaLoaded.php b/vendor/laravel/framework/src/Illuminate/Database/Events/SchemaLoaded.php deleted file mode 100644 index 061a079a..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Events/SchemaLoaded.php +++ /dev/null @@ -1,41 +0,0 @@ -connection = $connection; - $this->connectionName = $connection->getName(); - $this->path = $path; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Events/StatementPrepared.php b/vendor/laravel/framework/src/Illuminate/Database/Events/StatementPrepared.php deleted file mode 100644 index 2f603235..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Events/StatementPrepared.php +++ /dev/null @@ -1,33 +0,0 @@ -statement = $statement; - $this->connection = $connection; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Events/TransactionBeginning.php b/vendor/laravel/framework/src/Illuminate/Database/Events/TransactionBeginning.php deleted file mode 100644 index 3287b5c8..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Events/TransactionBeginning.php +++ /dev/null @@ -1,8 +0,0 @@ -isExpression($table)) { - return $this->wrap($this->tablePrefix.$table, true); - } - - return $this->getValue($table); - } - - /** - * Wrap a value in keyword identifiers. - * - * @param \Illuminate\Database\Query\Expression|string $value - * @param bool $prefixAlias - * @return string - */ - public function wrap($value, $prefixAlias = false) - { - if ($this->isExpression($value)) { - return $this->getValue($value); - } - - // If the value being wrapped has a column alias we will need to separate out - // the pieces so we can wrap each of the segments of the expression on its - // own, and then join these both back together using the "as" connector. - if (stripos($value, ' as ') !== false) { - return $this->wrapAliasedValue($value, $prefixAlias); - } - - // If the given value is a JSON selector we will wrap it differently than a - // traditional value. We will need to split this path and wrap each part - // wrapped, etc. Otherwise, we will simply wrap the value as a string. - if ($this->isJsonSelector($value)) { - return $this->wrapJsonSelector($value); - } - - return $this->wrapSegments(explode('.', $value)); - } - - /** - * Wrap a value that has an alias. - * - * @param string $value - * @param bool $prefixAlias - * @return string - */ - protected function wrapAliasedValue($value, $prefixAlias = false) - { - $segments = preg_split('/\s+as\s+/i', $value); - - // If we are wrapping a table we need to prefix the alias with the table prefix - // as well in order to generate proper syntax. If this is a column of course - // no prefix is necessary. The condition will be true when from wrapTable. - if ($prefixAlias) { - $segments[1] = $this->tablePrefix.$segments[1]; - } - - return $this->wrap($segments[0]).' as '.$this->wrapValue($segments[1]); - } - - /** - * Wrap the given value segments. - * - * @param array $segments - * @return string - */ - protected function wrapSegments($segments) - { - return collect($segments)->map(function ($segment, $key) use ($segments) { - return $key == 0 && count($segments) > 1 - ? $this->wrapTable($segment) - : $this->wrapValue($segment); - })->implode('.'); - } - - /** - * Wrap a single string in keyword identifiers. - * - * @param string $value - * @return string - */ - protected function wrapValue($value) - { - if ($value !== '*') { - return '"'.str_replace('"', '""', $value).'"'; - } - - return $value; - } - - /** - * Wrap the given JSON selector. - * - * @param string $value - * @return string - * - * @throws \RuntimeException - */ - protected function wrapJsonSelector($value) - { - throw new RuntimeException('This database engine does not support JSON operations.'); - } - - /** - * Determine if the given string is a JSON selector. - * - * @param string $value - * @return bool - */ - protected function isJsonSelector($value) - { - return str_contains($value, '->'); - } - - /** - * Convert an array of column names into a delimited string. - * - * @param array $columns - * @return string - */ - public function columnize(array $columns) - { - return implode(', ', array_map([$this, 'wrap'], $columns)); - } - - /** - * Create query parameter place-holders for an array. - * - * @param array $values - * @return string - */ - public function parameterize(array $values) - { - return implode(', ', array_map([$this, 'parameter'], $values)); - } - - /** - * Get the appropriate query parameter place-holder for a value. - * - * @param mixed $value - * @return string - */ - public function parameter($value) - { - return $this->isExpression($value) ? $this->getValue($value) : '?'; - } - - /** - * Quote the given string literal. - * - * @param string|array $value - * @return string - */ - public function quoteString($value) - { - if (is_array($value)) { - return implode(', ', array_map([$this, __FUNCTION__], $value)); - } - - return "'$value'"; - } - - /** - * Determine if the given value is a raw expression. - * - * @param mixed $value - * @return bool - */ - public function isExpression($value) - { - return $value instanceof Expression; - } - - /** - * Get the value of a raw expression. - * - * @param \Illuminate\Database\Query\Expression $expression - * @return mixed - */ - public function getValue($expression) - { - return $expression->getValue(); - } - - /** - * Get the format for database stored dates. - * - * @return string - */ - public function getDateFormat() - { - return 'Y-m-d H:i:s'; - } - - /** - * Get the grammar's table prefix. - * - * @return string - */ - public function getTablePrefix() - { - return $this->tablePrefix; - } - - /** - * Set the grammar's table prefix. - * - * @param string $prefix - * @return $this - */ - public function setTablePrefix($prefix) - { - $this->tablePrefix = $prefix; - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/LICENSE.md b/vendor/laravel/framework/src/Illuminate/Database/LICENSE.md deleted file mode 100644 index 79810c84..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Taylor Otwell - -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/laravel/framework/src/Illuminate/Database/LazyLoadingViolationException.php b/vendor/laravel/framework/src/Illuminate/Database/LazyLoadingViolationException.php deleted file mode 100644 index 1bcd40c9..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/LazyLoadingViolationException.php +++ /dev/null @@ -1,39 +0,0 @@ -model = $class; - $this->relation = $relation; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/LostConnectionException.php b/vendor/laravel/framework/src/Illuminate/Database/LostConnectionException.php deleted file mode 100644 index c8e57e36..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/LostConnectionException.php +++ /dev/null @@ -1,10 +0,0 @@ - MigrateCommand::class, - 'MigrateFresh' => FreshCommand::class, - 'MigrateInstall' => InstallCommand::class, - 'MigrateRefresh' => RefreshCommand::class, - 'MigrateReset' => ResetCommand::class, - 'MigrateRollback' => RollbackCommand::class, - 'MigrateStatus' => StatusCommand::class, - 'MigrateMake' => MigrateMakeCommand::class, - ]; - - /** - * Register the service provider. - * - * @return void - */ - public function register() - { - $this->registerRepository(); - - $this->registerMigrator(); - - $this->registerCreator(); - - $this->registerCommands($this->commands); - } - - /** - * Register the migration repository service. - * - * @return void - */ - protected function registerRepository() - { - $this->app->singleton('migration.repository', function ($app) { - $table = $app['config']['database.migrations']; - - return new DatabaseMigrationRepository($app['db'], $table); - }); - } - - /** - * Register the migrator service. - * - * @return void - */ - protected function registerMigrator() - { - // The migrator is responsible for actually running and rollback the migration - // files in the application. We'll pass in our database connection resolver - // so the migrator can resolve any of these connections when it needs to. - $this->app->singleton('migrator', function ($app) { - $repository = $app['migration.repository']; - - return new Migrator($repository, $app['db'], $app['files'], $app['events']); - }); - } - - /** - * Register the migration creator. - * - * @return void - */ - protected function registerCreator() - { - $this->app->singleton('migration.creator', function ($app) { - return new MigrationCreator($app['files'], $app->basePath('stubs')); - }); - } - - /** - * Register the given commands. - * - * @param array $commands - * @return void - */ - protected function registerCommands(array $commands) - { - foreach (array_keys($commands) as $command) { - $this->{"register{$command}Command"}(); - } - - $this->commands(array_values($commands)); - } - - /** - * Register the command. - * - * @return void - */ - protected function registerMigrateCommand() - { - $this->app->singleton(MigrateCommand::class, function ($app) { - return new MigrateCommand($app['migrator'], $app[Dispatcher::class]); - }); - } - - /** - * Register the command. - * - * @return void - */ - protected function registerMigrateFreshCommand() - { - $this->app->singleton(FreshCommand::class); - } - - /** - * Register the command. - * - * @return void - */ - protected function registerMigrateInstallCommand() - { - $this->app->singleton(InstallCommand::class, function ($app) { - return new InstallCommand($app['migration.repository']); - }); - } - - /** - * Register the command. - * - * @return void - */ - protected function registerMigrateMakeCommand() - { - $this->app->singleton(MigrateMakeCommand::class, function ($app) { - // Once we have the migration creator registered, we will create the command - // and inject the creator. The creator is responsible for the actual file - // creation of the migrations, and may be extended by these developers. - $creator = $app['migration.creator']; - - $composer = $app['composer']; - - return new MigrateMakeCommand($creator, $composer); - }); - } - - /** - * Register the command. - * - * @return void - */ - protected function registerMigrateRefreshCommand() - { - $this->app->singleton(RefreshCommand::class); - } - - /** - * Register the command. - * - * @return void - */ - protected function registerMigrateResetCommand() - { - $this->app->singleton(ResetCommand::class, function ($app) { - return new ResetCommand($app['migrator']); - }); - } - - /** - * Register the command. - * - * @return void - */ - protected function registerMigrateRollbackCommand() - { - $this->app->singleton(RollbackCommand::class, function ($app) { - return new RollbackCommand($app['migrator']); - }); - } - - /** - * Register the command. - * - * @return void - */ - protected function registerMigrateStatusCommand() - { - $this->app->singleton(StatusCommand::class, function ($app) { - return new StatusCommand($app['migrator']); - }); - } - - /** - * Get the services provided by the provider. - * - * @return array - */ - public function provides() - { - return array_merge([ - 'migrator', 'migration.repository', 'migration.creator', - ], array_values($this->commands)); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php b/vendor/laravel/framework/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php deleted file mode 100755 index ed4ebfb7..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php +++ /dev/null @@ -1,224 +0,0 @@ -table = $table; - $this->resolver = $resolver; - } - - /** - * Get the completed migrations. - * - * @return array - */ - public function getRan() - { - return $this->table() - ->orderBy('batch', 'asc') - ->orderBy('migration', 'asc') - ->pluck('migration')->all(); - } - - /** - * Get the list of migrations. - * - * @param int $steps - * @return array - */ - public function getMigrations($steps) - { - $query = $this->table()->where('batch', '>=', '1'); - - return $query->orderBy('batch', 'desc') - ->orderBy('migration', 'desc') - ->take($steps)->get()->all(); - } - - /** - * Get the last migration batch. - * - * @return array - */ - public function getLast() - { - $query = $this->table()->where('batch', $this->getLastBatchNumber()); - - return $query->orderBy('migration', 'desc')->get()->all(); - } - - /** - * Get the completed migrations with their batch numbers. - * - * @return array - */ - public function getMigrationBatches() - { - return $this->table() - ->orderBy('batch', 'asc') - ->orderBy('migration', 'asc') - ->pluck('batch', 'migration')->all(); - } - - /** - * Log that a migration was run. - * - * @param string $file - * @param int $batch - * @return void - */ - public function log($file, $batch) - { - $record = ['migration' => $file, 'batch' => $batch]; - - $this->table()->insert($record); - } - - /** - * Remove a migration from the log. - * - * @param object $migration - * @return void - */ - public function delete($migration) - { - $this->table()->where('migration', $migration->migration)->delete(); - } - - /** - * Get the next migration batch number. - * - * @return int - */ - public function getNextBatchNumber() - { - return $this->getLastBatchNumber() + 1; - } - - /** - * Get the last migration batch number. - * - * @return int - */ - public function getLastBatchNumber() - { - return $this->table()->max('batch'); - } - - /** - * Create the migration repository data store. - * - * @return void - */ - public function createRepository() - { - $schema = $this->getConnection()->getSchemaBuilder(); - - $schema->create($this->table, function ($table) { - // The migrations table is responsible for keeping track of which of the - // migrations have actually run for the application. We'll create the - // table to hold the migration file's path as well as the batch ID. - $table->increments('id'); - $table->string('migration'); - $table->integer('batch'); - }); - } - - /** - * Determine if the migration repository exists. - * - * @return bool - */ - public function repositoryExists() - { - $schema = $this->getConnection()->getSchemaBuilder(); - - return $schema->hasTable($this->table); - } - - /** - * Delete the migration repository data store. - * - * @return void - */ - public function deleteRepository() - { - $schema = $this->getConnection()->getSchemaBuilder(); - - $schema->drop($this->table); - } - - /** - * Get a query builder for the migration table. - * - * @return \Illuminate\Database\Query\Builder - */ - protected function table() - { - return $this->getConnection()->table($this->table)->useWritePdo(); - } - - /** - * Get the connection resolver instance. - * - * @return \Illuminate\Database\ConnectionResolverInterface - */ - public function getConnectionResolver() - { - return $this->resolver; - } - - /** - * Resolve the database connection instance. - * - * @return \Illuminate\Database\Connection - */ - public function getConnection() - { - return $this->resolver->connection($this->connection); - } - - /** - * Set the information source to gather data. - * - * @param string $name - * @return void - */ - public function setSource($name) - { - $this->connection = $name; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migration.php b/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migration.php deleted file mode 100755 index a58f7848..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migration.php +++ /dev/null @@ -1,30 +0,0 @@ -connection; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Migrations/MigrationCreator.php b/vendor/laravel/framework/src/Illuminate/Database/Migrations/MigrationCreator.php deleted file mode 100755 index d8f1ce9d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Migrations/MigrationCreator.php +++ /dev/null @@ -1,231 +0,0 @@ -files = $files; - $this->customStubPath = $customStubPath; - } - - /** - * Create a new migration at the given path. - * - * @param string $name - * @param string $path - * @param string|null $table - * @param bool $create - * @return string - * - * @throws \Exception - */ - public function create($name, $path, $table = null, $create = false) - { - $this->ensureMigrationDoesntAlreadyExist($name, $path); - - // First we will get the stub file for the migration, which serves as a type - // of template for the migration. Once we have those we will populate the - // various place-holders, save the file, and run the post create event. - $stub = $this->getStub($table, $create); - - $path = $this->getPath($name, $path); - - $this->files->ensureDirectoryExists(dirname($path)); - - $this->files->put( - $path, $this->populateStub($stub, $table) - ); - - // Next, we will fire any hooks that are supposed to fire after a migration is - // created. Once that is done we'll be ready to return the full path to the - // migration file so it can be used however it's needed by the developer. - $this->firePostCreateHooks($table, $path); - - return $path; - } - - /** - * Ensure that a migration with the given name doesn't already exist. - * - * @param string $name - * @param string $migrationPath - * @return void - * - * @throws \InvalidArgumentException - */ - protected function ensureMigrationDoesntAlreadyExist($name, $migrationPath = null) - { - if (! empty($migrationPath)) { - $migrationFiles = $this->files->glob($migrationPath.'/*.php'); - - foreach ($migrationFiles as $migrationFile) { - $this->files->requireOnce($migrationFile); - } - } - - if (class_exists($className = $this->getClassName($name))) { - throw new InvalidArgumentException("A {$className} class already exists."); - } - } - - /** - * Get the migration stub file. - * - * @param string|null $table - * @param bool $create - * @return string - */ - protected function getStub($table, $create) - { - if (is_null($table)) { - $stub = $this->files->exists($customPath = $this->customStubPath.'/migration.stub') - ? $customPath - : $this->stubPath().'/migration.stub'; - } elseif ($create) { - $stub = $this->files->exists($customPath = $this->customStubPath.'/migration.create.stub') - ? $customPath - : $this->stubPath().'/migration.create.stub'; - } else { - $stub = $this->files->exists($customPath = $this->customStubPath.'/migration.update.stub') - ? $customPath - : $this->stubPath().'/migration.update.stub'; - } - - return $this->files->get($stub); - } - - /** - * Populate the place-holders in the migration stub. - * - * @param string $stub - * @param string|null $table - * @return string - */ - protected function populateStub($stub, $table) - { - // Here we will replace the table place-holders with the table specified by - // the developer, which is useful for quickly creating a tables creation - // or update migration from the console instead of typing it manually. - if (! is_null($table)) { - $stub = str_replace( - ['DummyTable', '{{ table }}', '{{table}}'], - $table, $stub - ); - } - - return $stub; - } - - /** - * Get the class name of a migration name. - * - * @param string $name - * @return string - */ - protected function getClassName($name) - { - return Str::studly($name); - } - - /** - * Get the full path to the migration. - * - * @param string $name - * @param string $path - * @return string - */ - protected function getPath($name, $path) - { - return $path.'/'.$this->getDatePrefix().'_'.$name.'.php'; - } - - /** - * Fire the registered post create hooks. - * - * @param string|null $table - * @param string $path - * @return void - */ - protected function firePostCreateHooks($table, $path) - { - foreach ($this->postCreate as $callback) { - $callback($table, $path); - } - } - - /** - * Register a post migration create hook. - * - * @param \Closure $callback - * @return void - */ - public function afterCreate(Closure $callback) - { - $this->postCreate[] = $callback; - } - - /** - * Get the date prefix for the migration. - * - * @return string - */ - protected function getDatePrefix() - { - return date('Y_m_d_His'); - } - - /** - * Get the path to the stubs. - * - * @return string - */ - public function stubPath() - { - return __DIR__.'/stubs'; - } - - /** - * Get the filesystem instance. - * - * @return \Illuminate\Filesystem\Filesystem - */ - public function getFilesystem() - { - return $this->files; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Migrations/MigrationRepositoryInterface.php b/vendor/laravel/framework/src/Illuminate/Database/Migrations/MigrationRepositoryInterface.php deleted file mode 100755 index 840a5e1d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Migrations/MigrationRepositoryInterface.php +++ /dev/null @@ -1,88 +0,0 @@ -files = $files; - $this->events = $dispatcher; - $this->resolver = $resolver; - $this->repository = $repository; - } - - /** - * Run the pending migrations at a given path. - * - * @param array|string $paths - * @param array $options - * @return array - */ - public function run($paths = [], array $options = []) - { - // Once we grab all of the migration files for the path, we will compare them - // against the migrations that have already been run for this package then - // run each of the outstanding migrations against a database connection. - $files = $this->getMigrationFiles($paths); - - $this->requireFiles($migrations = $this->pendingMigrations( - $files, $this->repository->getRan() - )); - - // Once we have all these migrations that are outstanding we are ready to run - // we will go ahead and run them "up". This will execute each migration as - // an operation against a database. Then we'll return this list of them. - $this->runPending($migrations, $options); - - return $migrations; - } - - /** - * Get the migration files that have not yet run. - * - * @param array $files - * @param array $ran - * @return array - */ - protected function pendingMigrations($files, $ran) - { - return Collection::make($files) - ->reject(function ($file) use ($ran) { - return in_array($this->getMigrationName($file), $ran); - })->values()->all(); - } - - /** - * Run an array of migrations. - * - * @param array $migrations - * @param array $options - * @return void - */ - public function runPending(array $migrations, array $options = []) - { - // First we will just make sure that there are any migrations to run. If there - // aren't, we will just make a note of it to the developer so they're aware - // that all of the migrations have been run against this database system. - if (count($migrations) === 0) { - $this->fireMigrationEvent(new NoPendingMigrations('up')); - - $this->write(Info::class, 'Nothing to migrate'); - - return; - } - - // Next, we will get the next batch number for the migrations so we can insert - // correct batch number in the database migrations repository when we store - // each migration's execution. We will also extract a few of the options. - $batch = $this->repository->getNextBatchNumber(); - - $pretend = $options['pretend'] ?? false; - - $step = $options['step'] ?? false; - - $this->fireMigrationEvent(new MigrationsStarted('up')); - - $this->write(Info::class, 'Running migrations.'); - - // Once we have the array of migrations, we will spin through them and run the - // migrations "up" so the changes are made to the databases. We'll then log - // that the migration was run so we don't repeat it next time we execute. - foreach ($migrations as $file) { - $this->runUp($file, $batch, $pretend); - - if ($step) { - $batch++; - } - } - - $this->fireMigrationEvent(new MigrationsEnded('up')); - - if ($this->output) { - $this->output->writeln(''); - } - } - - /** - * Run "up" a migration instance. - * - * @param string $file - * @param int $batch - * @param bool $pretend - * @return void - */ - protected function runUp($file, $batch, $pretend) - { - // First we will resolve a "real" instance of the migration class from this - // migration file name. Once we have the instances we can run the actual - // command such as "up" or "down", or we can just simulate the action. - $migration = $this->resolvePath($file); - - $name = $this->getMigrationName($file); - - if ($pretend) { - return $this->pretendToRun($migration, 'up'); - } - - $this->write(Task::class, $name, fn () => $this->runMigration($migration, 'up')); - - // Once we have run a migrations class, we will log that it was run in this - // repository so that we don't try to run it next time we do a migration - // in the application. A migration repository keeps the migrate order. - $this->repository->log($name, $batch); - } - - /** - * Rollback the last migration operation. - * - * @param array|string $paths - * @param array $options - * @return array - */ - public function rollback($paths = [], array $options = []) - { - // We want to pull in the last batch of migrations that ran on the previous - // migration operation. We'll then reverse those migrations and run each - // of them "down" to reverse the last migration "operation" which ran. - $migrations = $this->getMigrationsForRollback($options); - - if (count($migrations) === 0) { - $this->fireMigrationEvent(new NoPendingMigrations('down')); - - $this->write(Info::class, 'Nothing to rollback.'); - - return []; - } - - return tap($this->rollbackMigrations($migrations, $paths, $options), function () { - if ($this->output) { - $this->output->writeln(''); - } - }); - } - - /** - * Get the migrations for a rollback operation. - * - * @param array $options - * @return array - */ - protected function getMigrationsForRollback(array $options) - { - if (($steps = $options['step'] ?? 0) > 0) { - return $this->repository->getMigrations($steps); - } - - return $this->repository->getLast(); - } - - /** - * Rollback the given migrations. - * - * @param array $migrations - * @param array|string $paths - * @param array $options - * @return array - */ - protected function rollbackMigrations(array $migrations, $paths, array $options) - { - $rolledBack = []; - - $this->requireFiles($files = $this->getMigrationFiles($paths)); - - $this->fireMigrationEvent(new MigrationsStarted('down')); - - $this->write(Info::class, 'Rolling back migrations.'); - - // Next we will run through all of the migrations and call the "down" method - // which will reverse each migration in order. This getLast method on the - // repository already returns these migration's names in reverse order. - foreach ($migrations as $migration) { - $migration = (object) $migration; - - if (! $file = Arr::get($files, $migration->migration)) { - $this->write(TwoColumnDetail::class, $migration->migration, 'Migration not found'); - - continue; - } - - $rolledBack[] = $file; - - $this->runDown( - $file, $migration, - $options['pretend'] ?? false - ); - } - - $this->fireMigrationEvent(new MigrationsEnded('down')); - - return $rolledBack; - } - - /** - * Rolls all of the currently applied migrations back. - * - * @param array|string $paths - * @param bool $pretend - * @return array - */ - public function reset($paths = [], $pretend = false) - { - // Next, we will reverse the migration list so we can run them back in the - // correct order for resetting this database. This will allow us to get - // the database back into its "empty" state ready for the migrations. - $migrations = array_reverse($this->repository->getRan()); - - if (count($migrations) === 0) { - $this->write(Info::class, 'Nothing to rollback.'); - - return []; - } - - return tap($this->resetMigrations($migrations, $paths, $pretend), function () { - if ($this->output) { - $this->output->writeln(''); - } - }); - } - - /** - * Reset the given migrations. - * - * @param array $migrations - * @param array $paths - * @param bool $pretend - * @return array - */ - protected function resetMigrations(array $migrations, array $paths, $pretend = false) - { - // Since the getRan method that retrieves the migration name just gives us the - // migration name, we will format the names into objects with the name as a - // property on the objects so that we can pass it to the rollback method. - $migrations = collect($migrations)->map(function ($m) { - return (object) ['migration' => $m]; - })->all(); - - return $this->rollbackMigrations( - $migrations, $paths, compact('pretend') - ); - } - - /** - * Run "down" a migration instance. - * - * @param string $file - * @param object $migration - * @param bool $pretend - * @return void - */ - protected function runDown($file, $migration, $pretend) - { - // First we will get the file name of the migration so we can resolve out an - // instance of the migration. Once we get an instance we can either run a - // pretend execution of the migration or we can run the real migration. - $instance = $this->resolvePath($file); - - $name = $this->getMigrationName($file); - - if ($pretend) { - return $this->pretendToRun($instance, 'down'); - } - - $this->write(Task::class, $name, fn () => $this->runMigration($instance, 'down')); - - // Once we have successfully run the migration "down" we will remove it from - // the migration repository so it will be considered to have not been run - // by the application then will be able to fire by any later operation. - $this->repository->delete($migration); - } - - /** - * Run a migration inside a transaction if the database supports it. - * - * @param object $migration - * @param string $method - * @return void - */ - protected function runMigration($migration, $method) - { - $connection = $this->resolveConnection( - $migration->getConnection() - ); - - $callback = function () use ($connection, $migration, $method) { - if (method_exists($migration, $method)) { - $this->fireMigrationEvent(new MigrationStarted($migration, $method)); - - $this->runMethod($connection, $migration, $method); - - $this->fireMigrationEvent(new MigrationEnded($migration, $method)); - } - }; - - $this->getSchemaGrammar($connection)->supportsSchemaTransactions() - && $migration->withinTransaction - ? $connection->transaction($callback) - : $callback(); - } - - /** - * Pretend to run the migrations. - * - * @param object $migration - * @param string $method - * @return void - */ - protected function pretendToRun($migration, $method) - { - try { - $name = get_class($migration); - - $reflectionClass = new ReflectionClass($migration); - - if ($reflectionClass->isAnonymous()) { - $name = $this->getMigrationName($reflectionClass->getFileName()); - } - - $this->write(TwoColumnDetail::class, $name); - $this->write(BulletList::class, collect($this->getQueries($migration, $method))->map(function ($query) { - return $query['query']; - })); - } catch (SchemaException $e) { - $name = get_class($migration); - - $this->write(Error::class, sprintf( - '[%s] failed to dump queries. This may be due to changing database columns using Doctrine, which is not supported while pretending to run migrations.', - $name, - )); - } - } - - /** - * Get all of the queries that would be run for a migration. - * - * @param object $migration - * @param string $method - * @return array - */ - protected function getQueries($migration, $method) - { - // Now that we have the connections we can resolve it and pretend to run the - // queries against the database returning the array of raw SQL statements - // that would get fired against the database system for this migration. - $db = $this->resolveConnection( - $migration->getConnection() - ); - - return $db->pretend(function () use ($db, $migration, $method) { - if (method_exists($migration, $method)) { - $this->runMethod($db, $migration, $method); - } - }); - } - - /** - * Run a migration method on the given connection. - * - * @param \Illuminate\Database\Connection $connection - * @param object $migration - * @param string $method - * @return void - */ - protected function runMethod($connection, $migration, $method) - { - $previousConnection = $this->resolver->getDefaultConnection(); - - try { - $this->resolver->setDefaultConnection($connection->getName()); - - $migration->{$method}(); - } finally { - $this->resolver->setDefaultConnection($previousConnection); - } - } - - /** - * Resolve a migration instance from a file. - * - * @param string $file - * @return object - */ - public function resolve($file) - { - $class = $this->getMigrationClass($file); - - return new $class; - } - - /** - * Resolve a migration instance from a migration path. - * - * @param string $path - * @return object - */ - protected function resolvePath(string $path) - { - $class = $this->getMigrationClass($this->getMigrationName($path)); - - if (class_exists($class) && realpath($path) == (new ReflectionClass($class))->getFileName()) { - return new $class; - } - - $migration = $this->files->getRequire($path); - - return is_object($migration) ? $migration : new $class; - } - - /** - * Generate a migration class name based on the migration file name. - * - * @param string $migrationName - * @return string - */ - protected function getMigrationClass(string $migrationName): string - { - return Str::studly(implode('_', array_slice(explode('_', $migrationName), 4))); - } - - /** - * Get all of the migration files in a given path. - * - * @param string|array $paths - * @return array - */ - public function getMigrationFiles($paths) - { - return Collection::make($paths)->flatMap(function ($path) { - return str_ends_with($path, '.php') ? [$path] : $this->files->glob($path.'/*_*.php'); - })->filter()->values()->keyBy(function ($file) { - return $this->getMigrationName($file); - })->sortBy(function ($file, $key) { - return $key; - })->all(); - } - - /** - * Require in all the migration files in a given path. - * - * @param array $files - * @return void - */ - public function requireFiles(array $files) - { - foreach ($files as $file) { - $this->files->requireOnce($file); - } - } - - /** - * Get the name of the migration. - * - * @param string $path - * @return string - */ - public function getMigrationName($path) - { - return str_replace('.php', '', basename($path)); - } - - /** - * Register a custom migration path. - * - * @param string $path - * @return void - */ - public function path($path) - { - $this->paths = array_unique(array_merge($this->paths, [$path])); - } - - /** - * Get all of the custom migration paths. - * - * @return array - */ - public function paths() - { - return $this->paths; - } - - /** - * Get the default connection name. - * - * @return string - */ - public function getConnection() - { - return $this->connection; - } - - /** - * Execute the given callback using the given connection as the default connection. - * - * @param string $name - * @param callable $callback - * @return mixed - */ - public function usingConnection($name, callable $callback) - { - $previousConnection = $this->resolver->getDefaultConnection(); - - $this->setConnection($name); - - return tap($callback(), function () use ($previousConnection) { - $this->setConnection($previousConnection); - }); - } - - /** - * Set the default connection name. - * - * @param string $name - * @return void - */ - public function setConnection($name) - { - if (! is_null($name)) { - $this->resolver->setDefaultConnection($name); - } - - $this->repository->setSource($name); - - $this->connection = $name; - } - - /** - * Resolve the database connection instance. - * - * @param string $connection - * @return \Illuminate\Database\Connection - */ - public function resolveConnection($connection) - { - return $this->resolver->connection($connection ?: $this->connection); - } - - /** - * Get the schema grammar out of a migration connection. - * - * @param \Illuminate\Database\Connection $connection - * @return \Illuminate\Database\Schema\Grammars\Grammar - */ - protected function getSchemaGrammar($connection) - { - if (is_null($grammar = $connection->getSchemaGrammar())) { - $connection->useDefaultSchemaGrammar(); - - $grammar = $connection->getSchemaGrammar(); - } - - return $grammar; - } - - /** - * Get the migration repository instance. - * - * @return \Illuminate\Database\Migrations\MigrationRepositoryInterface - */ - public function getRepository() - { - return $this->repository; - } - - /** - * Determine if the migration repository exists. - * - * @return bool - */ - public function repositoryExists() - { - return $this->repository->repositoryExists(); - } - - /** - * Determine if any migrations have been run. - * - * @return bool - */ - public function hasRunAnyMigrations() - { - return $this->repositoryExists() && count($this->repository->getRan()) > 0; - } - - /** - * Delete the migration repository data store. - * - * @return void - */ - public function deleteRepository() - { - return $this->repository->deleteRepository(); - } - - /** - * Get the file system instance. - * - * @return \Illuminate\Filesystem\Filesystem - */ - public function getFilesystem() - { - return $this->files; - } - - /** - * Set the output implementation that should be used by the console. - * - * @param \Symfony\Component\Console\Output\OutputInterface $output - * @return $this - */ - public function setOutput(OutputInterface $output) - { - $this->output = $output; - - return $this; - } - - /** - * Write to the console's output. - * - * @param string $component - * @param array|string $arguments - * @return void - */ - protected function write($component, ...$arguments) - { - if ($this->output && class_exists($component)) { - (new $component($this->output))->render(...$arguments); - } else { - foreach ($arguments as $argument) { - if (is_callable($argument)) { - $argument(); - } - } - } - } - - /** - * Fire the given event for the migration. - * - * @param \Illuminate\Contracts\Database\Events\MigrationEvent $event - * @return void - */ - public function fireMigrationEvent($event) - { - if ($this->events) { - $this->events->dispatch($event); - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Migrations/stubs/migration.create.stub b/vendor/laravel/framework/src/Illuminate/Database/Migrations/stubs/migration.create.stub deleted file mode 100755 index 0e0ec22b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Migrations/stubs/migration.create.stub +++ /dev/null @@ -1,31 +0,0 @@ -id(); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('{{ table }}'); - } -}; diff --git a/vendor/laravel/framework/src/Illuminate/Database/Migrations/stubs/migration.stub b/vendor/laravel/framework/src/Illuminate/Database/Migrations/stubs/migration.stub deleted file mode 100755 index 41dd1c8e..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Migrations/stubs/migration.stub +++ /dev/null @@ -1,28 +0,0 @@ -count = $count; - - parent::__construct("$count records were found.", $code, $previous); - } - - /** - * Get the number of records found. - * - * @return int - */ - public function getCount() - { - return $this->count; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/MySqlConnection.php b/vendor/laravel/framework/src/Illuminate/Database/MySqlConnection.php deleted file mode 100755 index 54e3d473..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/MySqlConnection.php +++ /dev/null @@ -1,91 +0,0 @@ -getPdo()->getAttribute(PDO::ATTR_SERVER_VERSION), 'MariaDB'); - } - - /** - * Get the default query grammar instance. - * - * @return \Illuminate\Database\Query\Grammars\MySqlGrammar - */ - protected function getDefaultQueryGrammar() - { - return $this->withTablePrefix(new QueryGrammar); - } - - /** - * Get a schema builder instance for the connection. - * - * @return \Illuminate\Database\Schema\MySqlBuilder - */ - public function getSchemaBuilder() - { - if (is_null($this->schemaGrammar)) { - $this->useDefaultSchemaGrammar(); - } - - return new MySqlBuilder($this); - } - - /** - * Get the default schema grammar instance. - * - * @return \Illuminate\Database\Schema\Grammars\MySqlGrammar - */ - protected function getDefaultSchemaGrammar() - { - return $this->withTablePrefix(new SchemaGrammar); - } - - /** - * Get the schema state for the connection. - * - * @param \Illuminate\Filesystem\Filesystem|null $files - * @param callable|null $processFactory - * @return \Illuminate\Database\Schema\MySqlSchemaState - */ - public function getSchemaState(Filesystem $files = null, callable $processFactory = null) - { - return new MySqlSchemaState($this, $files, $processFactory); - } - - /** - * Get the default post processor instance. - * - * @return \Illuminate\Database\Query\Processors\MySqlProcessor - */ - protected function getDefaultPostProcessor() - { - return new MySqlProcessor; - } - - /** - * Get the Doctrine DBAL driver. - * - * @return \Illuminate\Database\PDO\MySqlDriver - */ - protected function getDoctrineDriver() - { - return new MySqlDriver; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/PDO/Concerns/ConnectsToDatabase.php b/vendor/laravel/framework/src/Illuminate/Database/PDO/Concerns/ConnectsToDatabase.php deleted file mode 100644 index d2a8d600..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/PDO/Concerns/ConnectsToDatabase.php +++ /dev/null @@ -1,30 +0,0 @@ -connection = $connection; - } - - /** - * Execute an SQL statement. - * - * @param string $statement - * @return int - */ - public function exec(string $statement): int - { - try { - $result = $this->connection->exec($statement); - - \assert($result !== false); - - return $result; - } catch (PDOException $exception) { - throw Exception::new($exception); - } - } - - /** - * Prepare a new SQL statement. - * - * @param string $sql - * @return \Doctrine\DBAL\Driver\Statement - */ - public function prepare(string $sql): StatementInterface - { - try { - return $this->createStatement( - $this->connection->prepare($sql) - ); - } catch (PDOException $exception) { - throw Exception::new($exception); - } - } - - /** - * Execute a new query against the connection. - * - * @param string $sql - * @return \Doctrine\DBAL\Driver\Result - */ - public function query(string $sql): ResultInterface - { - try { - $stmt = $this->connection->query($sql); - - \assert($stmt instanceof PDOStatement); - - return new Result($stmt); - } catch (PDOException $exception) { - throw Exception::new($exception); - } - } - - /** - * Get the last insert ID. - * - * @param string|null $name - * @return mixed - */ - public function lastInsertId($name = null) - { - try { - if ($name === null) { - return $this->connection->lastInsertId(); - } - - return $this->connection->lastInsertId($name); - } catch (PDOException $exception) { - throw Exception::new($exception); - } - } - - /** - * Create a new statement instance. - * - * @param \PDOStatement $stmt - * @return \Doctrine\DBAL\Driver\PDO\Statement - */ - protected function createStatement(PDOStatement $stmt): Statement - { - return new Statement($stmt); - } - - /** - * Begin a new database transaction. - * - * @return void - */ - public function beginTransaction() - { - return $this->connection->beginTransaction(); - } - - /** - * Commit a database transaction. - * - * @return void - */ - public function commit() - { - return $this->connection->commit(); - } - - /** - * Rollback a database transaction. - * - * @return void - */ - public function rollBack() - { - return $this->connection->rollBack(); - } - - /** - * Wrap quotes around the given input. - * - * @param string $input - * @param string $type - * @return string - */ - public function quote($input, $type = ParameterType::STRING) - { - return $this->connection->quote($input, $type); - } - - /** - * Get the server version for the connection. - * - * @return string - */ - public function getServerVersion() - { - return $this->connection->getAttribute(PDO::ATTR_SERVER_VERSION); - } - - /** - * Get the wrapped PDO connection. - * - * @return \PDO - */ - public function getWrappedConnection(): PDO - { - return $this->connection; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/PDO/MySqlDriver.php b/vendor/laravel/framework/src/Illuminate/Database/PDO/MySqlDriver.php deleted file mode 100644 index 54ac3753..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/PDO/MySqlDriver.php +++ /dev/null @@ -1,19 +0,0 @@ -connection = $connection; - } - - /** - * Prepare a new SQL statement. - * - * @param string $sql - * @return \Doctrine\DBAL\Driver\Statement - */ - public function prepare(string $sql): StatementInterface - { - return new Statement( - $this->connection->prepare($sql) - ); - } - - /** - * Execute a new query against the connection. - * - * @param string $sql - * @return \Doctrine\DBAL\Driver\Result - */ - public function query(string $sql): Result - { - return $this->connection->query($sql); - } - - /** - * Execute an SQL statement. - * - * @param string $statement - * @return int - */ - public function exec(string $statement): int - { - return $this->connection->exec($statement); - } - - /** - * Get the last insert ID. - * - * @param string|null $name - * @return mixed - */ - public function lastInsertId($name = null) - { - if ($name === null) { - return $this->connection->lastInsertId($name); - } - - return $this->prepare('SELECT CONVERT(VARCHAR(MAX), current_value) FROM sys.sequences WHERE name = ?') - ->execute([$name]) - ->fetchOne(); - } - - /** - * Begin a new database transaction. - * - * @return void - */ - public function beginTransaction() - { - return $this->connection->beginTransaction(); - } - - /** - * Commit a database transaction. - * - * @return void - */ - public function commit() - { - return $this->connection->commit(); - } - - /** - * Rollback a database transaction. - * - * @return void - */ - public function rollBack() - { - return $this->connection->rollBack(); - } - - /** - * Wrap quotes around the given input. - * - * @param string $value - * @param int $type - * @return string - */ - public function quote($value, $type = ParameterType::STRING) - { - $val = $this->connection->quote($value, $type); - - // Fix for a driver version terminating all values with null byte... - if (\is_string($val) && str_contains($val, "\0")) { - $val = \substr($val, 0, -1); - } - - return $val; - } - - /** - * Get the server version for the connection. - * - * @return string - */ - public function getServerVersion() - { - return $this->connection->getServerVersion(); - } - - /** - * Get the wrapped PDO connection. - * - * @return \PDO - */ - public function getWrappedConnection(): PDO - { - return $this->connection->getWrappedConnection(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/PDO/SqlServerDriver.php b/vendor/laravel/framework/src/Illuminate/Database/PDO/SqlServerDriver.php deleted file mode 100644 index 1b0d9574..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/PDO/SqlServerDriver.php +++ /dev/null @@ -1,32 +0,0 @@ -withTablePrefix(new QueryGrammar); - } - - /** - * Get a schema builder instance for the connection. - * - * @return \Illuminate\Database\Schema\PostgresBuilder - */ - public function getSchemaBuilder() - { - if (is_null($this->schemaGrammar)) { - $this->useDefaultSchemaGrammar(); - } - - return new PostgresBuilder($this); - } - - /** - * Get the default schema grammar instance. - * - * @return \Illuminate\Database\Schema\Grammars\PostgresGrammar - */ - protected function getDefaultSchemaGrammar() - { - return $this->withTablePrefix(new SchemaGrammar); - } - - /** - * Get the schema state for the connection. - * - * @param \Illuminate\Filesystem\Filesystem|null $files - * @param callable|null $processFactory - * @return \Illuminate\Database\Schema\PostgresSchemaState - */ - public function getSchemaState(Filesystem $files = null, callable $processFactory = null) - { - return new PostgresSchemaState($this, $files, $processFactory); - } - - /** - * Get the default post processor instance. - * - * @return \Illuminate\Database\Query\Processors\PostgresProcessor - */ - protected function getDefaultPostProcessor() - { - return new PostgresProcessor; - } - - /** - * Get the Doctrine DBAL driver. - * - * @return \Illuminate\Database\PDO\PostgresDriver - */ - protected function getDoctrineDriver() - { - return new PostgresDriver; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php b/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php deleted file mode 100755 index ce63d88d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php +++ /dev/null @@ -1,3782 +0,0 @@ - [], - 'from' => [], - 'join' => [], - 'where' => [], - 'groupBy' => [], - 'having' => [], - 'order' => [], - 'union' => [], - 'unionOrder' => [], - ]; - - /** - * An aggregate function and column to be run. - * - * @var array - */ - public $aggregate; - - /** - * The columns that should be returned. - * - * @var array - */ - public $columns; - - /** - * Indicates if the query returns distinct results. - * - * Occasionally contains the columns that should be distinct. - * - * @var bool|array - */ - public $distinct = false; - - /** - * The table which the query is targeting. - * - * @var string - */ - public $from; - - /** - * The table joins for the query. - * - * @var array - */ - public $joins; - - /** - * The where constraints for the query. - * - * @var array - */ - public $wheres = []; - - /** - * The groupings for the query. - * - * @var array - */ - public $groups; - - /** - * The having constraints for the query. - * - * @var array - */ - public $havings; - - /** - * The orderings for the query. - * - * @var array - */ - public $orders; - - /** - * The maximum number of records to return. - * - * @var int - */ - public $limit; - - /** - * The number of records to skip. - * - * @var int - */ - public $offset; - - /** - * The query union statements. - * - * @var array - */ - public $unions; - - /** - * The maximum number of union records to return. - * - * @var int - */ - public $unionLimit; - - /** - * The number of union records to skip. - * - * @var int - */ - public $unionOffset; - - /** - * The orderings for the union query. - * - * @var array - */ - public $unionOrders; - - /** - * Indicates whether row locking is being used. - * - * @var string|bool - */ - public $lock; - - /** - * The callbacks that should be invoked before the query is executed. - * - * @var array - */ - public $beforeQueryCallbacks = []; - - /** - * All of the available clause operators. - * - * @var string[] - */ - public $operators = [ - '=', '<', '>', '<=', '>=', '<>', '!=', '<=>', - 'like', 'like binary', 'not like', 'ilike', - '&', '|', '^', '<<', '>>', '&~', 'is', 'is not', - 'rlike', 'not rlike', 'regexp', 'not regexp', - '~', '~*', '!~', '!~*', 'similar to', - 'not similar to', 'not ilike', '~~*', '!~~*', - ]; - - /** - * All of the available bitwise operators. - * - * @var string[] - */ - public $bitwiseOperators = [ - '&', '|', '^', '<<', '>>', '&~', - ]; - - /** - * Whether to use write pdo for the select. - * - * @var bool - */ - public $useWritePdo = false; - - /** - * Create a new query builder instance. - * - * @param \Illuminate\Database\ConnectionInterface $connection - * @param \Illuminate\Database\Query\Grammars\Grammar|null $grammar - * @param \Illuminate\Database\Query\Processors\Processor|null $processor - * @return void - */ - public function __construct(ConnectionInterface $connection, - Grammar $grammar = null, - Processor $processor = null) - { - $this->connection = $connection; - $this->grammar = $grammar ?: $connection->getQueryGrammar(); - $this->processor = $processor ?: $connection->getPostProcessor(); - } - - /** - * Set the columns to be selected. - * - * @param array|mixed $columns - * @return $this - */ - public function select($columns = ['*']) - { - $this->columns = []; - $this->bindings['select'] = []; - - $columns = is_array($columns) ? $columns : func_get_args(); - - foreach ($columns as $as => $column) { - if (is_string($as) && $this->isQueryable($column)) { - $this->selectSub($column, $as); - } else { - $this->columns[] = $column; - } - } - - return $this; - } - - /** - * Add a subselect expression to the query. - * - * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder|string $query - * @param string $as - * @return $this - * - * @throws \InvalidArgumentException - */ - public function selectSub($query, $as) - { - [$query, $bindings] = $this->createSub($query); - - return $this->selectRaw( - '('.$query.') as '.$this->grammar->wrap($as), $bindings - ); - } - - /** - * Add a new "raw" select expression to the query. - * - * @param string $expression - * @param array $bindings - * @return $this - */ - public function selectRaw($expression, array $bindings = []) - { - $this->addSelect(new Expression($expression)); - - if ($bindings) { - $this->addBinding($bindings, 'select'); - } - - return $this; - } - - /** - * Makes "from" fetch from a subquery. - * - * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder|string $query - * @param string $as - * @return $this - * - * @throws \InvalidArgumentException - */ - public function fromSub($query, $as) - { - [$query, $bindings] = $this->createSub($query); - - return $this->fromRaw('('.$query.') as '.$this->grammar->wrapTable($as), $bindings); - } - - /** - * Add a raw from clause to the query. - * - * @param string $expression - * @param mixed $bindings - * @return $this - */ - public function fromRaw($expression, $bindings = []) - { - $this->from = new Expression($expression); - - $this->addBinding($bindings, 'from'); - - return $this; - } - - /** - * Creates a subquery and parse it. - * - * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder|string $query - * @return array - */ - protected function createSub($query) - { - // If the given query is a Closure, we will execute it while passing in a new - // query instance to the Closure. This will give the developer a chance to - // format and work with the query before we cast it to a raw SQL string. - if ($query instanceof Closure) { - $callback = $query; - - $callback($query = $this->forSubQuery()); - } - - return $this->parseSub($query); - } - - /** - * Parse the subquery into SQL and bindings. - * - * @param mixed $query - * @return array - * - * @throws \InvalidArgumentException - */ - protected function parseSub($query) - { - if ($query instanceof self || $query instanceof EloquentBuilder || $query instanceof Relation) { - $query = $this->prependDatabaseNameIfCrossDatabaseQuery($query); - - return [$query->toSql(), $query->getBindings()]; - } elseif (is_string($query)) { - return [$query, []]; - } else { - throw new InvalidArgumentException( - 'A subquery must be a query builder instance, a Closure, or a string.' - ); - } - } - - /** - * Prepend the database name if the given query is on another database. - * - * @param mixed $query - * @return mixed - */ - protected function prependDatabaseNameIfCrossDatabaseQuery($query) - { - if ($query->getConnection()->getDatabaseName() !== - $this->getConnection()->getDatabaseName()) { - $databaseName = $query->getConnection()->getDatabaseName(); - - if (! str_starts_with($query->from, $databaseName) && ! str_contains($query->from, '.')) { - $query->from($databaseName.'.'.$query->from); - } - } - - return $query; - } - - /** - * Add a new select column to the query. - * - * @param array|mixed $column - * @return $this - */ - public function addSelect($column) - { - $columns = is_array($column) ? $column : func_get_args(); - - foreach ($columns as $as => $column) { - if (is_string($as) && $this->isQueryable($column)) { - if (is_null($this->columns)) { - $this->select($this->from.'.*'); - } - - $this->selectSub($column, $as); - } else { - $this->columns[] = $column; - } - } - - return $this; - } - - /** - * Force the query to only return distinct results. - * - * @return $this - */ - public function distinct() - { - $columns = func_get_args(); - - if (count($columns) > 0) { - $this->distinct = is_array($columns[0]) || is_bool($columns[0]) ? $columns[0] : $columns; - } else { - $this->distinct = true; - } - - return $this; - } - - /** - * Set the table which the query is targeting. - * - * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder|string $table - * @param string|null $as - * @return $this - */ - public function from($table, $as = null) - { - if ($this->isQueryable($table)) { - return $this->fromSub($table, $as); - } - - $this->from = $as ? "{$table} as {$as}" : $table; - - return $this; - } - - /** - * Add a join clause to the query. - * - * @param string $table - * @param \Closure|string $first - * @param string|null $operator - * @param string|null $second - * @param string $type - * @param bool $where - * @return $this - */ - public function join($table, $first, $operator = null, $second = null, $type = 'inner', $where = false) - { - $join = $this->newJoinClause($this, $type, $table); - - // If the first "column" of the join is really a Closure instance the developer - // is trying to build a join with a complex "on" clause containing more than - // one condition, so we'll add the join and call a Closure with the query. - if ($first instanceof Closure) { - $first($join); - - $this->joins[] = $join; - - $this->addBinding($join->getBindings(), 'join'); - } - - // If the column is simply a string, we can assume the join simply has a basic - // "on" clause with a single condition. So we will just build the join with - // this simple join clauses attached to it. There is not a join callback. - else { - $method = $where ? 'where' : 'on'; - - $this->joins[] = $join->$method($first, $operator, $second); - - $this->addBinding($join->getBindings(), 'join'); - } - - return $this; - } - - /** - * Add a "join where" clause to the query. - * - * @param string $table - * @param \Closure|string $first - * @param string $operator - * @param string $second - * @param string $type - * @return $this - */ - public function joinWhere($table, $first, $operator, $second, $type = 'inner') - { - return $this->join($table, $first, $operator, $second, $type, true); - } - - /** - * Add a subquery join clause to the query. - * - * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder|string $query - * @param string $as - * @param \Closure|string $first - * @param string|null $operator - * @param string|null $second - * @param string $type - * @param bool $where - * @return $this - * - * @throws \InvalidArgumentException - */ - public function joinSub($query, $as, $first, $operator = null, $second = null, $type = 'inner', $where = false) - { - [$query, $bindings] = $this->createSub($query); - - $expression = '('.$query.') as '.$this->grammar->wrapTable($as); - - $this->addBinding($bindings, 'join'); - - return $this->join(new Expression($expression), $first, $operator, $second, $type, $where); - } - - /** - * Add a left join to the query. - * - * @param string $table - * @param \Closure|string $first - * @param string|null $operator - * @param string|null $second - * @return $this - */ - public function leftJoin($table, $first, $operator = null, $second = null) - { - return $this->join($table, $first, $operator, $second, 'left'); - } - - /** - * Add a "join where" clause to the query. - * - * @param string $table - * @param \Closure|string $first - * @param string $operator - * @param string $second - * @return $this - */ - public function leftJoinWhere($table, $first, $operator, $second) - { - return $this->joinWhere($table, $first, $operator, $second, 'left'); - } - - /** - * Add a subquery left join to the query. - * - * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder|string $query - * @param string $as - * @param \Closure|string $first - * @param string|null $operator - * @param string|null $second - * @return $this - */ - public function leftJoinSub($query, $as, $first, $operator = null, $second = null) - { - return $this->joinSub($query, $as, $first, $operator, $second, 'left'); - } - - /** - * Add a right join to the query. - * - * @param string $table - * @param \Closure|string $first - * @param string|null $operator - * @param string|null $second - * @return $this - */ - public function rightJoin($table, $first, $operator = null, $second = null) - { - return $this->join($table, $first, $operator, $second, 'right'); - } - - /** - * Add a "right join where" clause to the query. - * - * @param string $table - * @param \Closure|string $first - * @param string $operator - * @param string $second - * @return $this - */ - public function rightJoinWhere($table, $first, $operator, $second) - { - return $this->joinWhere($table, $first, $operator, $second, 'right'); - } - - /** - * Add a subquery right join to the query. - * - * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder|string $query - * @param string $as - * @param \Closure|string $first - * @param string|null $operator - * @param string|null $second - * @return $this - */ - public function rightJoinSub($query, $as, $first, $operator = null, $second = null) - { - return $this->joinSub($query, $as, $first, $operator, $second, 'right'); - } - - /** - * Add a "cross join" clause to the query. - * - * @param string $table - * @param \Closure|string|null $first - * @param string|null $operator - * @param string|null $second - * @return $this - */ - public function crossJoin($table, $first = null, $operator = null, $second = null) - { - if ($first) { - return $this->join($table, $first, $operator, $second, 'cross'); - } - - $this->joins[] = $this->newJoinClause($this, 'cross', $table); - - return $this; - } - - /** - * Add a subquery cross join to the query. - * - * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder|string $query - * @param string $as - * @return $this - */ - public function crossJoinSub($query, $as) - { - [$query, $bindings] = $this->createSub($query); - - $expression = '('.$query.') as '.$this->grammar->wrapTable($as); - - $this->addBinding($bindings, 'join'); - - $this->joins[] = $this->newJoinClause($this, 'cross', new Expression($expression)); - - return $this; - } - - /** - * Get a new join clause. - * - * @param \Illuminate\Database\Query\Builder $parentQuery - * @param string $type - * @param string $table - * @return \Illuminate\Database\Query\JoinClause - */ - protected function newJoinClause(self $parentQuery, $type, $table) - { - return new JoinClause($parentQuery, $type, $table); - } - - /** - * Merge an array of where clauses and bindings. - * - * @param array $wheres - * @param array $bindings - * @return $this - */ - public function mergeWheres($wheres, $bindings) - { - $this->wheres = array_merge($this->wheres, (array) $wheres); - - $this->bindings['where'] = array_values( - array_merge($this->bindings['where'], (array) $bindings) - ); - - return $this; - } - - /** - * Add a basic where clause to the query. - * - * @param \Closure|string|array $column - * @param mixed $operator - * @param mixed $value - * @param string $boolean - * @return $this - */ - public function where($column, $operator = null, $value = null, $boolean = 'and') - { - // If the column is an array, we will assume it is an array of key-value pairs - // and can add them each as a where clause. We will maintain the boolean we - // received when the method was called and pass it into the nested where. - if (is_array($column)) { - return $this->addArrayOfWheres($column, $boolean); - } - - // Here we will make some assumptions about the operator. If only 2 values are - // passed to the method, we will assume that the operator is an equals sign - // and keep going. Otherwise, we'll require the operator to be passed in. - [$value, $operator] = $this->prepareValueAndOperator( - $value, $operator, func_num_args() === 2 - ); - - // If the column is actually a Closure instance, we will assume the developer - // wants to begin a nested where statement which is wrapped in parentheses. - // We will add that Closure to the query and return back out immediately. - if ($column instanceof Closure && is_null($operator)) { - return $this->whereNested($column, $boolean); - } - - // If the column is a Closure instance and there is an operator value, we will - // assume the developer wants to run a subquery and then compare the result - // of that subquery with the given value that was provided to the method. - if ($this->isQueryable($column) && ! is_null($operator)) { - [$sub, $bindings] = $this->createSub($column); - - return $this->addBinding($bindings, 'where') - ->where(new Expression('('.$sub.')'), $operator, $value, $boolean); - } - - // If the given operator is not found in the list of valid operators we will - // assume that the developer is just short-cutting the '=' operators and - // we will set the operators to '=' and set the values appropriately. - if ($this->invalidOperator($operator)) { - [$value, $operator] = [$operator, '=']; - } - - // If the value is a Closure, it means the developer is performing an entire - // sub-select within the query and we will need to compile the sub-select - // within the where clause to get the appropriate query record results. - if ($value instanceof Closure) { - return $this->whereSub($column, $operator, $value, $boolean); - } - - // If the value is "null", we will just assume the developer wants to add a - // where null clause to the query. So, we will allow a short-cut here to - // that method for convenience so the developer doesn't have to check. - if (is_null($value)) { - return $this->whereNull($column, $boolean, $operator !== '='); - } - - $type = 'Basic'; - - // If the column is making a JSON reference we'll check to see if the value - // is a boolean. If it is, we'll add the raw boolean string as an actual - // value to the query to ensure this is properly handled by the query. - if (str_contains($column, '->') && is_bool($value)) { - $value = new Expression($value ? 'true' : 'false'); - - if (is_string($column)) { - $type = 'JsonBoolean'; - } - } - - if ($this->isBitwiseOperator($operator)) { - $type = 'Bitwise'; - } - - // Now that we are working with just a simple query we can put the elements - // in our array and add the query binding to our array of bindings that - // will be bound to each SQL statements when it is finally executed. - $this->wheres[] = compact( - 'type', 'column', 'operator', 'value', 'boolean' - ); - - if (! $value instanceof Expression) { - $this->addBinding($this->flattenValue($value), 'where'); - } - - return $this; - } - - /** - * Add an array of where clauses to the query. - * - * @param array $column - * @param string $boolean - * @param string $method - * @return $this - */ - protected function addArrayOfWheres($column, $boolean, $method = 'where') - { - return $this->whereNested(function ($query) use ($column, $method, $boolean) { - foreach ($column as $key => $value) { - if (is_numeric($key) && is_array($value)) { - $query->{$method}(...array_values($value)); - } else { - $query->{$method}($key, '=', $value, $boolean); - } - } - }, $boolean); - } - - /** - * Prepare the value and operator for a where clause. - * - * @param string $value - * @param string $operator - * @param bool $useDefault - * @return array - * - * @throws \InvalidArgumentException - */ - public function prepareValueAndOperator($value, $operator, $useDefault = false) - { - if ($useDefault) { - return [$operator, '=']; - } elseif ($this->invalidOperatorAndValue($operator, $value)) { - throw new InvalidArgumentException('Illegal operator and value combination.'); - } - - return [$value, $operator]; - } - - /** - * Determine if the given operator and value combination is legal. - * - * Prevents using Null values with invalid operators. - * - * @param string $operator - * @param mixed $value - * @return bool - */ - protected function invalidOperatorAndValue($operator, $value) - { - return is_null($value) && in_array($operator, $this->operators) && - ! in_array($operator, ['=', '<>', '!=']); - } - - /** - * Determine if the given operator is supported. - * - * @param string $operator - * @return bool - */ - protected function invalidOperator($operator) - { - return ! is_string($operator) || (! in_array(strtolower($operator), $this->operators, true) && - ! in_array(strtolower($operator), $this->grammar->getOperators(), true)); - } - - /** - * Determine if the operator is a bitwise operator. - * - * @param string $operator - * @return bool - */ - protected function isBitwiseOperator($operator) - { - return in_array(strtolower($operator), $this->bitwiseOperators, true) || - in_array(strtolower($operator), $this->grammar->getBitwiseOperators(), true); - } - - /** - * Add an "or where" clause to the query. - * - * @param \Closure|string|array $column - * @param mixed $operator - * @param mixed $value - * @return $this - */ - public function orWhere($column, $operator = null, $value = null) - { - [$value, $operator] = $this->prepareValueAndOperator( - $value, $operator, func_num_args() === 2 - ); - - return $this->where($column, $operator, $value, 'or'); - } - - /** - * Add a basic "where not" clause to the query. - * - * @param \Closure|string|array $column - * @param mixed $operator - * @param mixed $value - * @param string $boolean - * @return $this - */ - public function whereNot($column, $operator = null, $value = null, $boolean = 'and') - { - if (is_array($column)) { - return $this->whereNested(function ($query) use ($column, $operator, $value, $boolean) { - $query->where($column, $operator, $value, $boolean); - }, $boolean.' not'); - } - - return $this->where($column, $operator, $value, $boolean.' not'); - } - - /** - * Add an "or where not" clause to the query. - * - * @param \Closure|string|array $column - * @param mixed $operator - * @param mixed $value - * @return $this - */ - public function orWhereNot($column, $operator = null, $value = null) - { - return $this->whereNot($column, $operator, $value, 'or'); - } - - /** - * Add a "where" clause comparing two columns to the query. - * - * @param string|array $first - * @param string|null $operator - * @param string|null $second - * @param string|null $boolean - * @return $this - */ - public function whereColumn($first, $operator = null, $second = null, $boolean = 'and') - { - // If the column is an array, we will assume it is an array of key-value pairs - // and can add them each as a where clause. We will maintain the boolean we - // received when the method was called and pass it into the nested where. - if (is_array($first)) { - return $this->addArrayOfWheres($first, $boolean, 'whereColumn'); - } - - // If the given operator is not found in the list of valid operators we will - // assume that the developer is just short-cutting the '=' operators and - // we will set the operators to '=' and set the values appropriately. - if ($this->invalidOperator($operator)) { - [$second, $operator] = [$operator, '=']; - } - - // Finally, we will add this where clause into this array of clauses that we - // are building for the query. All of them will be compiled via a grammar - // once the query is about to be executed and run against the database. - $type = 'Column'; - - $this->wheres[] = compact( - 'type', 'first', 'operator', 'second', 'boolean' - ); - - return $this; - } - - /** - * Add an "or where" clause comparing two columns to the query. - * - * @param string|array $first - * @param string|null $operator - * @param string|null $second - * @return $this - */ - public function orWhereColumn($first, $operator = null, $second = null) - { - return $this->whereColumn($first, $operator, $second, 'or'); - } - - /** - * Add a raw where clause to the query. - * - * @param string $sql - * @param mixed $bindings - * @param string $boolean - * @return $this - */ - public function whereRaw($sql, $bindings = [], $boolean = 'and') - { - $this->wheres[] = ['type' => 'raw', 'sql' => $sql, 'boolean' => $boolean]; - - $this->addBinding((array) $bindings, 'where'); - - return $this; - } - - /** - * Add a raw or where clause to the query. - * - * @param string $sql - * @param mixed $bindings - * @return $this - */ - public function orWhereRaw($sql, $bindings = []) - { - return $this->whereRaw($sql, $bindings, 'or'); - } - - /** - * Add a "where in" clause to the query. - * - * @param string $column - * @param mixed $values - * @param string $boolean - * @param bool $not - * @return $this - */ - public function whereIn($column, $values, $boolean = 'and', $not = false) - { - $type = $not ? 'NotIn' : 'In'; - - // If the value is a query builder instance we will assume the developer wants to - // look for any values that exist within this given query. So, we will add the - // query accordingly so that this query is properly executed when it is run. - if ($this->isQueryable($values)) { - [$query, $bindings] = $this->createSub($values); - - $values = [new Expression($query)]; - - $this->addBinding($bindings, 'where'); - } - - // Next, if the value is Arrayable we need to cast it to its raw array form so we - // have the underlying array value instead of an Arrayable object which is not - // able to be added as a binding, etc. We will then add to the wheres array. - if ($values instanceof Arrayable) { - $values = $values->toArray(); - } - - $this->wheres[] = compact('type', 'column', 'values', 'boolean'); - - if (count($values) !== count(Arr::flatten($values, 1))) { - throw new InvalidArgumentException('Nested arrays may not be passed to whereIn method.'); - } - - // Finally, we'll add a binding for each value unless that value is an expression - // in which case we will just skip over it since it will be the query as a raw - // string and not as a parameterized place-holder to be replaced by the PDO. - $this->addBinding($this->cleanBindings($values), 'where'); - - return $this; - } - - /** - * Add an "or where in" clause to the query. - * - * @param string $column - * @param mixed $values - * @return $this - */ - public function orWhereIn($column, $values) - { - return $this->whereIn($column, $values, 'or'); - } - - /** - * Add a "where not in" clause to the query. - * - * @param string $column - * @param mixed $values - * @param string $boolean - * @return $this - */ - public function whereNotIn($column, $values, $boolean = 'and') - { - return $this->whereIn($column, $values, $boolean, true); - } - - /** - * Add an "or where not in" clause to the query. - * - * @param string $column - * @param mixed $values - * @return $this - */ - public function orWhereNotIn($column, $values) - { - return $this->whereNotIn($column, $values, 'or'); - } - - /** - * Add a "where in raw" clause for integer values to the query. - * - * @param string $column - * @param \Illuminate\Contracts\Support\Arrayable|array $values - * @param string $boolean - * @param bool $not - * @return $this - */ - public function whereIntegerInRaw($column, $values, $boolean = 'and', $not = false) - { - $type = $not ? 'NotInRaw' : 'InRaw'; - - if ($values instanceof Arrayable) { - $values = $values->toArray(); - } - - foreach ($values as &$value) { - $value = (int) $value; - } - - $this->wheres[] = compact('type', 'column', 'values', 'boolean'); - - return $this; - } - - /** - * Add an "or where in raw" clause for integer values to the query. - * - * @param string $column - * @param \Illuminate\Contracts\Support\Arrayable|array $values - * @return $this - */ - public function orWhereIntegerInRaw($column, $values) - { - return $this->whereIntegerInRaw($column, $values, 'or'); - } - - /** - * Add a "where not in raw" clause for integer values to the query. - * - * @param string $column - * @param \Illuminate\Contracts\Support\Arrayable|array $values - * @param string $boolean - * @return $this - */ - public function whereIntegerNotInRaw($column, $values, $boolean = 'and') - { - return $this->whereIntegerInRaw($column, $values, $boolean, true); - } - - /** - * Add an "or where not in raw" clause for integer values to the query. - * - * @param string $column - * @param \Illuminate\Contracts\Support\Arrayable|array $values - * @return $this - */ - public function orWhereIntegerNotInRaw($column, $values) - { - return $this->whereIntegerNotInRaw($column, $values, 'or'); - } - - /** - * Add a "where null" clause to the query. - * - * @param string|array $columns - * @param string $boolean - * @param bool $not - * @return $this - */ - public function whereNull($columns, $boolean = 'and', $not = false) - { - $type = $not ? 'NotNull' : 'Null'; - - foreach (Arr::wrap($columns) as $column) { - $this->wheres[] = compact('type', 'column', 'boolean'); - } - - return $this; - } - - /** - * Add an "or where null" clause to the query. - * - * @param string|array $column - * @return $this - */ - public function orWhereNull($column) - { - return $this->whereNull($column, 'or'); - } - - /** - * Add a "where not null" clause to the query. - * - * @param string|array $columns - * @param string $boolean - * @return $this - */ - public function whereNotNull($columns, $boolean = 'and') - { - return $this->whereNull($columns, $boolean, true); - } - - /** - * Add a where between statement to the query. - * - * @param string|\Illuminate\Database\Query\Expression $column - * @param iterable $values - * @param string $boolean - * @param bool $not - * @return $this - */ - public function whereBetween($column, iterable $values, $boolean = 'and', $not = false) - { - $type = 'between'; - - if ($values instanceof CarbonPeriod) { - $values = $values->toArray(); - } - - $this->wheres[] = compact('type', 'column', 'values', 'boolean', 'not'); - - $this->addBinding(array_slice($this->cleanBindings(Arr::flatten($values)), 0, 2), 'where'); - - return $this; - } - - /** - * Add a where between statement using columns to the query. - * - * @param string $column - * @param array $values - * @param string $boolean - * @param bool $not - * @return $this - */ - public function whereBetweenColumns($column, array $values, $boolean = 'and', $not = false) - { - $type = 'betweenColumns'; - - $this->wheres[] = compact('type', 'column', 'values', 'boolean', 'not'); - - return $this; - } - - /** - * Add an or where between statement to the query. - * - * @param string $column - * @param iterable $values - * @return $this - */ - public function orWhereBetween($column, iterable $values) - { - return $this->whereBetween($column, $values, 'or'); - } - - /** - * Add an or where between statement using columns to the query. - * - * @param string $column - * @param array $values - * @return $this - */ - public function orWhereBetweenColumns($column, array $values) - { - return $this->whereBetweenColumns($column, $values, 'or'); - } - - /** - * Add a where not between statement to the query. - * - * @param string $column - * @param iterable $values - * @param string $boolean - * @return $this - */ - public function whereNotBetween($column, iterable $values, $boolean = 'and') - { - return $this->whereBetween($column, $values, $boolean, true); - } - - /** - * Add a where not between statement using columns to the query. - * - * @param string $column - * @param array $values - * @param string $boolean - * @return $this - */ - public function whereNotBetweenColumns($column, array $values, $boolean = 'and') - { - return $this->whereBetweenColumns($column, $values, $boolean, true); - } - - /** - * Add an or where not between statement to the query. - * - * @param string $column - * @param iterable $values - * @return $this - */ - public function orWhereNotBetween($column, iterable $values) - { - return $this->whereNotBetween($column, $values, 'or'); - } - - /** - * Add an or where not between statement using columns to the query. - * - * @param string $column - * @param array $values - * @return $this - */ - public function orWhereNotBetweenColumns($column, array $values) - { - return $this->whereNotBetweenColumns($column, $values, 'or'); - } - - /** - * Add an "or where not null" clause to the query. - * - * @param string $column - * @return $this - */ - public function orWhereNotNull($column) - { - return $this->whereNotNull($column, 'or'); - } - - /** - * Add a "where date" statement to the query. - * - * @param string $column - * @param string $operator - * @param \DateTimeInterface|string|null $value - * @param string $boolean - * @return $this - */ - public function whereDate($column, $operator, $value = null, $boolean = 'and') - { - [$value, $operator] = $this->prepareValueAndOperator( - $value, $operator, func_num_args() === 2 - ); - - $value = $this->flattenValue($value); - - if ($value instanceof DateTimeInterface) { - $value = $value->format('Y-m-d'); - } - - return $this->addDateBasedWhere('Date', $column, $operator, $value, $boolean); - } - - /** - * Add an "or where date" statement to the query. - * - * @param string $column - * @param string $operator - * @param \DateTimeInterface|string|null $value - * @return $this - */ - public function orWhereDate($column, $operator, $value = null) - { - [$value, $operator] = $this->prepareValueAndOperator( - $value, $operator, func_num_args() === 2 - ); - - return $this->whereDate($column, $operator, $value, 'or'); - } - - /** - * Add a "where time" statement to the query. - * - * @param string $column - * @param string $operator - * @param \DateTimeInterface|string|null $value - * @param string $boolean - * @return $this - */ - public function whereTime($column, $operator, $value = null, $boolean = 'and') - { - [$value, $operator] = $this->prepareValueAndOperator( - $value, $operator, func_num_args() === 2 - ); - - $value = $this->flattenValue($value); - - if ($value instanceof DateTimeInterface) { - $value = $value->format('H:i:s'); - } - - return $this->addDateBasedWhere('Time', $column, $operator, $value, $boolean); - } - - /** - * Add an "or where time" statement to the query. - * - * @param string $column - * @param string $operator - * @param \DateTimeInterface|string|null $value - * @return $this - */ - public function orWhereTime($column, $operator, $value = null) - { - [$value, $operator] = $this->prepareValueAndOperator( - $value, $operator, func_num_args() === 2 - ); - - return $this->whereTime($column, $operator, $value, 'or'); - } - - /** - * Add a "where day" statement to the query. - * - * @param string $column - * @param string $operator - * @param \DateTimeInterface|string|int|null $value - * @param string $boolean - * @return $this - */ - public function whereDay($column, $operator, $value = null, $boolean = 'and') - { - [$value, $operator] = $this->prepareValueAndOperator( - $value, $operator, func_num_args() === 2 - ); - - $value = $this->flattenValue($value); - - if ($value instanceof DateTimeInterface) { - $value = $value->format('d'); - } - - if (! $value instanceof Expression) { - $value = sprintf('%02d', $value); - } - - return $this->addDateBasedWhere('Day', $column, $operator, $value, $boolean); - } - - /** - * Add an "or where day" statement to the query. - * - * @param string $column - * @param string $operator - * @param \DateTimeInterface|string|int|null $value - * @return $this - */ - public function orWhereDay($column, $operator, $value = null) - { - [$value, $operator] = $this->prepareValueAndOperator( - $value, $operator, func_num_args() === 2 - ); - - return $this->whereDay($column, $operator, $value, 'or'); - } - - /** - * Add a "where month" statement to the query. - * - * @param string $column - * @param string $operator - * @param \DateTimeInterface|string|int|null $value - * @param string $boolean - * @return $this - */ - public function whereMonth($column, $operator, $value = null, $boolean = 'and') - { - [$value, $operator] = $this->prepareValueAndOperator( - $value, $operator, func_num_args() === 2 - ); - - $value = $this->flattenValue($value); - - if ($value instanceof DateTimeInterface) { - $value = $value->format('m'); - } - - if (! $value instanceof Expression) { - $value = sprintf('%02d', $value); - } - - return $this->addDateBasedWhere('Month', $column, $operator, $value, $boolean); - } - - /** - * Add an "or where month" statement to the query. - * - * @param string $column - * @param string $operator - * @param \DateTimeInterface|string|int|null $value - * @return $this - */ - public function orWhereMonth($column, $operator, $value = null) - { - [$value, $operator] = $this->prepareValueAndOperator( - $value, $operator, func_num_args() === 2 - ); - - return $this->whereMonth($column, $operator, $value, 'or'); - } - - /** - * Add a "where year" statement to the query. - * - * @param string $column - * @param string $operator - * @param \DateTimeInterface|string|int|null $value - * @param string $boolean - * @return $this - */ - public function whereYear($column, $operator, $value = null, $boolean = 'and') - { - [$value, $operator] = $this->prepareValueAndOperator( - $value, $operator, func_num_args() === 2 - ); - - $value = $this->flattenValue($value); - - if ($value instanceof DateTimeInterface) { - $value = $value->format('Y'); - } - - return $this->addDateBasedWhere('Year', $column, $operator, $value, $boolean); - } - - /** - * Add an "or where year" statement to the query. - * - * @param string $column - * @param string $operator - * @param \DateTimeInterface|string|int|null $value - * @return $this - */ - public function orWhereYear($column, $operator, $value = null) - { - [$value, $operator] = $this->prepareValueAndOperator( - $value, $operator, func_num_args() === 2 - ); - - return $this->whereYear($column, $operator, $value, 'or'); - } - - /** - * Add a date based (year, month, day, time) statement to the query. - * - * @param string $type - * @param string $column - * @param string $operator - * @param mixed $value - * @param string $boolean - * @return $this - */ - protected function addDateBasedWhere($type, $column, $operator, $value, $boolean = 'and') - { - $this->wheres[] = compact('column', 'type', 'boolean', 'operator', 'value'); - - if (! $value instanceof Expression) { - $this->addBinding($value, 'where'); - } - - return $this; - } - - /** - * Add a nested where statement to the query. - * - * @param \Closure $callback - * @param string $boolean - * @return $this - */ - public function whereNested(Closure $callback, $boolean = 'and') - { - $callback($query = $this->forNestedWhere()); - - return $this->addNestedWhereQuery($query, $boolean); - } - - /** - * Create a new query instance for nested where condition. - * - * @return \Illuminate\Database\Query\Builder - */ - public function forNestedWhere() - { - return $this->newQuery()->from($this->from); - } - - /** - * Add another query builder as a nested where to the query builder. - * - * @param \Illuminate\Database\Query\Builder $query - * @param string $boolean - * @return $this - */ - public function addNestedWhereQuery($query, $boolean = 'and') - { - if (count($query->wheres)) { - $type = 'Nested'; - - $this->wheres[] = compact('type', 'query', 'boolean'); - - $this->addBinding($query->getRawBindings()['where'], 'where'); - } - - return $this; - } - - /** - * Add a full sub-select to the query. - * - * @param string $column - * @param string $operator - * @param \Closure $callback - * @param string $boolean - * @return $this - */ - protected function whereSub($column, $operator, Closure $callback, $boolean) - { - $type = 'Sub'; - - // Once we have the query instance we can simply execute it so it can add all - // of the sub-select's conditions to itself, and then we can cache it off - // in the array of where clauses for the "main" parent query instance. - $callback($query = $this->forSubQuery()); - - $this->wheres[] = compact( - 'type', 'column', 'operator', 'query', 'boolean' - ); - - $this->addBinding($query->getBindings(), 'where'); - - return $this; - } - - /** - * Add an exists clause to the query. - * - * @param \Closure $callback - * @param string $boolean - * @param bool $not - * @return $this - */ - public function whereExists(Closure $callback, $boolean = 'and', $not = false) - { - $query = $this->forSubQuery(); - - // Similar to the sub-select clause, we will create a new query instance so - // the developer may cleanly specify the entire exists query and we will - // compile the whole thing in the grammar and insert it into the SQL. - $callback($query); - - return $this->addWhereExistsQuery($query, $boolean, $not); - } - - /** - * Add an or exists clause to the query. - * - * @param \Closure $callback - * @param bool $not - * @return $this - */ - public function orWhereExists(Closure $callback, $not = false) - { - return $this->whereExists($callback, 'or', $not); - } - - /** - * Add a where not exists clause to the query. - * - * @param \Closure $callback - * @param string $boolean - * @return $this - */ - public function whereNotExists(Closure $callback, $boolean = 'and') - { - return $this->whereExists($callback, $boolean, true); - } - - /** - * Add a where not exists clause to the query. - * - * @param \Closure $callback - * @return $this - */ - public function orWhereNotExists(Closure $callback) - { - return $this->orWhereExists($callback, true); - } - - /** - * Add an exists clause to the query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param string $boolean - * @param bool $not - * @return $this - */ - public function addWhereExistsQuery(self $query, $boolean = 'and', $not = false) - { - $type = $not ? 'NotExists' : 'Exists'; - - $this->wheres[] = compact('type', 'query', 'boolean'); - - $this->addBinding($query->getBindings(), 'where'); - - return $this; - } - - /** - * Adds a where condition using row values. - * - * @param array $columns - * @param string $operator - * @param array $values - * @param string $boolean - * @return $this - * - * @throws \InvalidArgumentException - */ - public function whereRowValues($columns, $operator, $values, $boolean = 'and') - { - if (count($columns) !== count($values)) { - throw new InvalidArgumentException('The number of columns must match the number of values'); - } - - $type = 'RowValues'; - - $this->wheres[] = compact('type', 'columns', 'operator', 'values', 'boolean'); - - $this->addBinding($this->cleanBindings($values)); - - return $this; - } - - /** - * Adds an or where condition using row values. - * - * @param array $columns - * @param string $operator - * @param array $values - * @return $this - */ - public function orWhereRowValues($columns, $operator, $values) - { - return $this->whereRowValues($columns, $operator, $values, 'or'); - } - - /** - * Add a "where JSON contains" clause to the query. - * - * @param string $column - * @param mixed $value - * @param string $boolean - * @param bool $not - * @return $this - */ - public function whereJsonContains($column, $value, $boolean = 'and', $not = false) - { - $type = 'JsonContains'; - - $this->wheres[] = compact('type', 'column', 'value', 'boolean', 'not'); - - if (! $value instanceof Expression) { - $this->addBinding($this->grammar->prepareBindingForJsonContains($value)); - } - - return $this; - } - - /** - * Add an "or where JSON contains" clause to the query. - * - * @param string $column - * @param mixed $value - * @return $this - */ - public function orWhereJsonContains($column, $value) - { - return $this->whereJsonContains($column, $value, 'or'); - } - - /** - * Add a "where JSON not contains" clause to the query. - * - * @param string $column - * @param mixed $value - * @param string $boolean - * @return $this - */ - public function whereJsonDoesntContain($column, $value, $boolean = 'and') - { - return $this->whereJsonContains($column, $value, $boolean, true); - } - - /** - * Add an "or where JSON not contains" clause to the query. - * - * @param string $column - * @param mixed $value - * @return $this - */ - public function orWhereJsonDoesntContain($column, $value) - { - return $this->whereJsonDoesntContain($column, $value, 'or'); - } - - /** - * Add a clause that determines if a JSON path exists to the query. - * - * @param string $column - * @param string $boolean - * @param bool $not - * @return $this - */ - public function whereJsonContainsKey($column, $boolean = 'and', $not = false) - { - $type = 'JsonContainsKey'; - - $this->wheres[] = compact('type', 'column', 'boolean', 'not'); - - return $this; - } - - /** - * Add an "or" clause that determines if a JSON path exists to the query. - * - * @param string $column - * @return $this - */ - public function orWhereJsonContainsKey($column) - { - return $this->whereJsonContainsKey($column, 'or'); - } - - /** - * Add a clause that determines if a JSON path does not exist to the query. - * - * @param string $column - * @param string $boolean - * @return $this - */ - public function whereJsonDoesntContainKey($column, $boolean = 'and') - { - return $this->whereJsonContainsKey($column, $boolean, true); - } - - /** - * Add an "or" clause that determines if a JSON path does not exist to the query. - * - * @param string $column - * @return $this - */ - public function orWhereJsonDoesntContainKey($column) - { - return $this->whereJsonDoesntContainKey($column, 'or'); - } - - /** - * Add a "where JSON length" clause to the query. - * - * @param string $column - * @param mixed $operator - * @param mixed $value - * @param string $boolean - * @return $this - */ - public function whereJsonLength($column, $operator, $value = null, $boolean = 'and') - { - $type = 'JsonLength'; - - [$value, $operator] = $this->prepareValueAndOperator( - $value, $operator, func_num_args() === 2 - ); - - $this->wheres[] = compact('type', 'column', 'operator', 'value', 'boolean'); - - if (! $value instanceof Expression) { - $this->addBinding((int) $this->flattenValue($value)); - } - - return $this; - } - - /** - * Add an "or where JSON length" clause to the query. - * - * @param string $column - * @param mixed $operator - * @param mixed $value - * @return $this - */ - public function orWhereJsonLength($column, $operator, $value = null) - { - [$value, $operator] = $this->prepareValueAndOperator( - $value, $operator, func_num_args() === 2 - ); - - return $this->whereJsonLength($column, $operator, $value, 'or'); - } - - /** - * Handles dynamic "where" clauses to the query. - * - * @param string $method - * @param array $parameters - * @return $this - */ - public function dynamicWhere($method, $parameters) - { - $finder = substr($method, 5); - - $segments = preg_split( - '/(And|Or)(?=[A-Z])/', $finder, -1, PREG_SPLIT_DELIM_CAPTURE - ); - - // The connector variable will determine which connector will be used for the - // query condition. We will change it as we come across new boolean values - // in the dynamic method strings, which could contain a number of these. - $connector = 'and'; - - $index = 0; - - foreach ($segments as $segment) { - // If the segment is not a boolean connector, we can assume it is a column's name - // and we will add it to the query as a new constraint as a where clause, then - // we can keep iterating through the dynamic method string's segments again. - if ($segment !== 'And' && $segment !== 'Or') { - $this->addDynamic($segment, $connector, $parameters, $index); - - $index++; - } - - // Otherwise, we will store the connector so we know how the next where clause we - // find in the query should be connected to the previous ones, meaning we will - // have the proper boolean connector to connect the next where clause found. - else { - $connector = $segment; - } - } - - return $this; - } - - /** - * Add a single dynamic where clause statement to the query. - * - * @param string $segment - * @param string $connector - * @param array $parameters - * @param int $index - * @return void - */ - protected function addDynamic($segment, $connector, $parameters, $index) - { - // Once we have parsed out the columns and formatted the boolean operators we - // are ready to add it to this query as a where clause just like any other - // clause on the query. Then we'll increment the parameter index values. - $bool = strtolower($connector); - - $this->where(Str::snake($segment), '=', $parameters[$index], $bool); - } - - /** - * Add a "where fulltext" clause to the query. - * - * @param string|string[] $columns - * @param string $value - * @param string $boolean - * @return $this - */ - public function whereFullText($columns, $value, array $options = [], $boolean = 'and') - { - $type = 'Fulltext'; - - $columns = (array) $columns; - - $this->wheres[] = compact('type', 'columns', 'value', 'options', 'boolean'); - - $this->addBinding($value); - - return $this; - } - - /** - * Add a "or where fulltext" clause to the query. - * - * @param string|string[] $columns - * @param string $value - * @return $this - */ - public function orWhereFullText($columns, $value, array $options = []) - { - return $this->whereFulltext($columns, $value, $options, 'or'); - } - - /** - * Add a "group by" clause to the query. - * - * @param array|string ...$groups - * @return $this - */ - public function groupBy(...$groups) - { - foreach ($groups as $group) { - $this->groups = array_merge( - (array) $this->groups, - Arr::wrap($group) - ); - } - - return $this; - } - - /** - * Add a raw groupBy clause to the query. - * - * @param string $sql - * @param array $bindings - * @return $this - */ - public function groupByRaw($sql, array $bindings = []) - { - $this->groups[] = new Expression($sql); - - $this->addBinding($bindings, 'groupBy'); - - return $this; - } - - /** - * Add a "having" clause to the query. - * - * @param \Closure|string $column - * @param string|int|float|null $operator - * @param string|int|float|null $value - * @param string $boolean - * @return $this - */ - public function having($column, $operator = null, $value = null, $boolean = 'and') - { - $type = 'Basic'; - - // Here we will make some assumptions about the operator. If only 2 values are - // passed to the method, we will assume that the operator is an equals sign - // and keep going. Otherwise, we'll require the operator to be passed in. - [$value, $operator] = $this->prepareValueAndOperator( - $value, $operator, func_num_args() === 2 - ); - - if ($column instanceof Closure && is_null($operator)) { - return $this->havingNested($column, $boolean); - } - - // If the given operator is not found in the list of valid operators we will - // assume that the developer is just short-cutting the '=' operators and - // we will set the operators to '=' and set the values appropriately. - if ($this->invalidOperator($operator)) { - [$value, $operator] = [$operator, '=']; - } - - if ($this->isBitwiseOperator($operator)) { - $type = 'Bitwise'; - } - - $this->havings[] = compact('type', 'column', 'operator', 'value', 'boolean'); - - if (! $value instanceof Expression) { - $this->addBinding($this->flattenValue($value), 'having'); - } - - return $this; - } - - /** - * Add an "or having" clause to the query. - * - * @param \Closure|string $column - * @param string|int|float|null $operator - * @param string|int|float|null $value - * @return $this - */ - public function orHaving($column, $operator = null, $value = null) - { - [$value, $operator] = $this->prepareValueAndOperator( - $value, $operator, func_num_args() === 2 - ); - - return $this->having($column, $operator, $value, 'or'); - } - - /** - * Add a nested having statement to the query. - * - * @param \Closure $callback - * @param string $boolean - * @return $this - */ - public function havingNested(Closure $callback, $boolean = 'and') - { - $callback($query = $this->forNestedWhere()); - - return $this->addNestedHavingQuery($query, $boolean); - } - - /** - * Add another query builder as a nested having to the query builder. - * - * @param \Illuminate\Database\Query\Builder $query - * @param string $boolean - * @return $this - */ - public function addNestedHavingQuery($query, $boolean = 'and') - { - if (count($query->havings)) { - $type = 'Nested'; - - $this->havings[] = compact('type', 'query', 'boolean'); - - $this->addBinding($query->getRawBindings()['having'], 'having'); - } - - return $this; - } - - /** - * Add a "having null" clause to the query. - * - * @param string|array $columns - * @param string $boolean - * @param bool $not - * @return $this - */ - public function havingNull($columns, $boolean = 'and', $not = false) - { - $type = $not ? 'NotNull' : 'Null'; - - foreach (Arr::wrap($columns) as $column) { - $this->havings[] = compact('type', 'column', 'boolean'); - } - - return $this; - } - - /** - * Add an "or having null" clause to the query. - * - * @param string $column - * @return $this - */ - public function orHavingNull($column) - { - return $this->havingNull($column, 'or'); - } - - /** - * Add a "having not null" clause to the query. - * - * @param string|array $columns - * @param string $boolean - * @return $this - */ - public function havingNotNull($columns, $boolean = 'and') - { - return $this->havingNull($columns, $boolean, true); - } - - /** - * Add an "or having not null" clause to the query. - * - * @param string $column - * @return $this - */ - public function orHavingNotNull($column) - { - return $this->havingNotNull($column, 'or'); - } - - /** - * Add a "having between " clause to the query. - * - * @param string $column - * @param array $values - * @param string $boolean - * @param bool $not - * @return $this - */ - public function havingBetween($column, array $values, $boolean = 'and', $not = false) - { - $type = 'between'; - - $this->havings[] = compact('type', 'column', 'values', 'boolean', 'not'); - - $this->addBinding(array_slice($this->cleanBindings(Arr::flatten($values)), 0, 2), 'having'); - - return $this; - } - - /** - * Add a raw having clause to the query. - * - * @param string $sql - * @param array $bindings - * @param string $boolean - * @return $this - */ - public function havingRaw($sql, array $bindings = [], $boolean = 'and') - { - $type = 'Raw'; - - $this->havings[] = compact('type', 'sql', 'boolean'); - - $this->addBinding($bindings, 'having'); - - return $this; - } - - /** - * Add a raw or having clause to the query. - * - * @param string $sql - * @param array $bindings - * @return $this - */ - public function orHavingRaw($sql, array $bindings = []) - { - return $this->havingRaw($sql, $bindings, 'or'); - } - - /** - * Add an "order by" clause to the query. - * - * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Expression|string $column - * @param string $direction - * @return $this - * - * @throws \InvalidArgumentException - */ - public function orderBy($column, $direction = 'asc') - { - if ($this->isQueryable($column)) { - [$query, $bindings] = $this->createSub($column); - - $column = new Expression('('.$query.')'); - - $this->addBinding($bindings, $this->unions ? 'unionOrder' : 'order'); - } - - $direction = strtolower($direction); - - if (! in_array($direction, ['asc', 'desc'], true)) { - throw new InvalidArgumentException('Order direction must be "asc" or "desc".'); - } - - $this->{$this->unions ? 'unionOrders' : 'orders'}[] = [ - 'column' => $column, - 'direction' => $direction, - ]; - - return $this; - } - - /** - * Add a descending "order by" clause to the query. - * - * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Expression|string $column - * @return $this - */ - public function orderByDesc($column) - { - return $this->orderBy($column, 'desc'); - } - - /** - * Add an "order by" clause for a timestamp to the query. - * - * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Query\Expression|string $column - * @return $this - */ - public function latest($column = 'created_at') - { - return $this->orderBy($column, 'desc'); - } - - /** - * Add an "order by" clause for a timestamp to the query. - * - * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Query\Expression|string $column - * @return $this - */ - public function oldest($column = 'created_at') - { - return $this->orderBy($column, 'asc'); - } - - /** - * Put the query's results in random order. - * - * @param string $seed - * @return $this - */ - public function inRandomOrder($seed = '') - { - return $this->orderByRaw($this->grammar->compileRandom($seed)); - } - - /** - * Add a raw "order by" clause to the query. - * - * @param string $sql - * @param array $bindings - * @return $this - */ - public function orderByRaw($sql, $bindings = []) - { - $type = 'Raw'; - - $this->{$this->unions ? 'unionOrders' : 'orders'}[] = compact('type', 'sql'); - - $this->addBinding($bindings, $this->unions ? 'unionOrder' : 'order'); - - return $this; - } - - /** - * Alias to set the "offset" value of the query. - * - * @param int $value - * @return $this - */ - public function skip($value) - { - return $this->offset($value); - } - - /** - * Set the "offset" value of the query. - * - * @param int $value - * @return $this - */ - public function offset($value) - { - $property = $this->unions ? 'unionOffset' : 'offset'; - - $this->$property = max(0, (int) $value); - - return $this; - } - - /** - * Alias to set the "limit" value of the query. - * - * @param int $value - * @return $this - */ - public function take($value) - { - return $this->limit($value); - } - - /** - * Set the "limit" value of the query. - * - * @param int $value - * @return $this - */ - public function limit($value) - { - $property = $this->unions ? 'unionLimit' : 'limit'; - - if ($value >= 0) { - $this->$property = ! is_null($value) ? (int) $value : null; - } - - return $this; - } - - /** - * Set the limit and offset for a given page. - * - * @param int $page - * @param int $perPage - * @return $this - */ - public function forPage($page, $perPage = 15) - { - return $this->offset(($page - 1) * $perPage)->limit($perPage); - } - - /** - * Constrain the query to the previous "page" of results before a given ID. - * - * @param int $perPage - * @param int|null $lastId - * @param string $column - * @return $this - */ - public function forPageBeforeId($perPage = 15, $lastId = 0, $column = 'id') - { - $this->orders = $this->removeExistingOrdersFor($column); - - if (! is_null($lastId)) { - $this->where($column, '<', $lastId); - } - - return $this->orderBy($column, 'desc') - ->limit($perPage); - } - - /** - * Constrain the query to the next "page" of results after a given ID. - * - * @param int $perPage - * @param int|null $lastId - * @param string $column - * @return $this - */ - public function forPageAfterId($perPage = 15, $lastId = 0, $column = 'id') - { - $this->orders = $this->removeExistingOrdersFor($column); - - if (! is_null($lastId)) { - $this->where($column, '>', $lastId); - } - - return $this->orderBy($column, 'asc') - ->limit($perPage); - } - - /** - * Remove all existing orders and optionally add a new order. - * - * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Query\Expression|string|null $column - * @param string $direction - * @return $this - */ - public function reorder($column = null, $direction = 'asc') - { - $this->orders = null; - $this->unionOrders = null; - $this->bindings['order'] = []; - $this->bindings['unionOrder'] = []; - - if ($column) { - return $this->orderBy($column, $direction); - } - - return $this; - } - - /** - * Get an array with all orders with a given column removed. - * - * @param string $column - * @return array - */ - protected function removeExistingOrdersFor($column) - { - return Collection::make($this->orders) - ->reject(function ($order) use ($column) { - return isset($order['column']) - ? $order['column'] === $column : false; - })->values()->all(); - } - - /** - * Add a union statement to the query. - * - * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder $query - * @param bool $all - * @return $this - */ - public function union($query, $all = false) - { - if ($query instanceof Closure) { - $query($query = $this->newQuery()); - } - - $this->unions[] = compact('query', 'all'); - - $this->addBinding($query->getBindings(), 'union'); - - return $this; - } - - /** - * Add a union all statement to the query. - * - * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder $query - * @return $this - */ - public function unionAll($query) - { - return $this->union($query, true); - } - - /** - * Lock the selected rows in the table. - * - * @param string|bool $value - * @return $this - */ - public function lock($value = true) - { - $this->lock = $value; - - if (! is_null($this->lock)) { - $this->useWritePdo(); - } - - return $this; - } - - /** - * Lock the selected rows in the table for updating. - * - * @return \Illuminate\Database\Query\Builder - */ - public function lockForUpdate() - { - return $this->lock(true); - } - - /** - * Share lock the selected rows in the table. - * - * @return \Illuminate\Database\Query\Builder - */ - public function sharedLock() - { - return $this->lock(false); - } - - /** - * Register a closure to be invoked before the query is executed. - * - * @param callable $callback - * @return $this - */ - public function beforeQuery(callable $callback) - { - $this->beforeQueryCallbacks[] = $callback; - - return $this; - } - - /** - * Invoke the "before query" modification callbacks. - * - * @return void - */ - public function applyBeforeQueryCallbacks() - { - foreach ($this->beforeQueryCallbacks as $callback) { - $callback($this); - } - - $this->beforeQueryCallbacks = []; - } - - /** - * Get the SQL representation of the query. - * - * @return string - */ - public function toSql() - { - $this->applyBeforeQueryCallbacks(); - - return $this->grammar->compileSelect($this); - } - - /** - * Execute a query for a single record by ID. - * - * @param int|string $id - * @param array|string $columns - * @return mixed|static - */ - public function find($id, $columns = ['*']) - { - return $this->where('id', '=', $id)->first($columns); - } - - /** - * Execute a query for a single record by ID or call a callback. - * - * @param mixed $id - * @param \Closure|array|string $columns - * @param \Closure|null $callback - * @return mixed|static - */ - public function findOr($id, $columns = ['*'], Closure $callback = null) - { - if ($columns instanceof Closure) { - $callback = $columns; - - $columns = ['*']; - } - - if (! is_null($data = $this->find($id, $columns))) { - return $data; - } - - return $callback(); - } - - /** - * Get a single column's value from the first result of a query. - * - * @param string $column - * @return mixed - */ - public function value($column) - { - $result = (array) $this->first([$column]); - - return count($result) > 0 ? reset($result) : null; - } - - /** - * Get a single expression value from the first result of a query. - * - * @param string $expression - * @param array $bindings - * @return mixed - */ - public function rawValue(string $expression, array $bindings = []) - { - $result = (array) $this->selectRaw($expression, $bindings)->first(); - - return count($result) > 0 ? reset($result) : null; - } - - /** - * Get a single column's value from the first result of a query if it's the sole matching record. - * - * @param string $column - * @return mixed - * - * @throws \Illuminate\Database\RecordsNotFoundException - * @throws \Illuminate\Database\MultipleRecordsFoundException - */ - public function soleValue($column) - { - $result = (array) $this->sole([$column]); - - return reset($result); - } - - /** - * Execute the query as a "select" statement. - * - * @param array|string $columns - * @return \Illuminate\Support\Collection - */ - public function get($columns = ['*']) - { - return collect($this->onceWithColumns(Arr::wrap($columns), function () { - return $this->processor->processSelect($this, $this->runSelect()); - })); - } - - /** - * Run the query as a "select" statement against the connection. - * - * @return array - */ - protected function runSelect() - { - return $this->connection->select( - $this->toSql(), $this->getBindings(), ! $this->useWritePdo - ); - } - - /** - * Paginate the given query into a simple paginator. - * - * @param int|\Closure $perPage - * @param array|string $columns - * @param string $pageName - * @param int|null $page - * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator - */ - public function paginate($perPage = 15, $columns = ['*'], $pageName = 'page', $page = null) - { - $page = $page ?: Paginator::resolveCurrentPage($pageName); - - $total = $this->getCountForPagination(); - - $perPage = $perPage instanceof Closure ? $perPage($total) : $perPage; - - $results = $total ? $this->forPage($page, $perPage)->get($columns) : collect(); - - return $this->paginator($results, $total, $perPage, $page, [ - 'path' => Paginator::resolveCurrentPath(), - 'pageName' => $pageName, - ]); - } - - /** - * Get a paginator only supporting simple next and previous links. - * - * This is more efficient on larger data-sets, etc. - * - * @param int $perPage - * @param array|string $columns - * @param string $pageName - * @param int|null $page - * @return \Illuminate\Contracts\Pagination\Paginator - */ - public function simplePaginate($perPage = 15, $columns = ['*'], $pageName = 'page', $page = null) - { - $page = $page ?: Paginator::resolveCurrentPage($pageName); - - $this->offset(($page - 1) * $perPage)->limit($perPage + 1); - - return $this->simplePaginator($this->get($columns), $perPage, $page, [ - 'path' => Paginator::resolveCurrentPath(), - 'pageName' => $pageName, - ]); - } - - /** - * Get a paginator only supporting simple next and previous links. - * - * This is more efficient on larger data-sets, etc. - * - * @param int|null $perPage - * @param array|string $columns - * @param string $cursorName - * @param \Illuminate\Pagination\Cursor|string|null $cursor - * @return \Illuminate\Contracts\Pagination\CursorPaginator - */ - public function cursorPaginate($perPage = 15, $columns = ['*'], $cursorName = 'cursor', $cursor = null) - { - return $this->paginateUsingCursor($perPage, $columns, $cursorName, $cursor); - } - - /** - * Ensure the proper order by required for cursor pagination. - * - * @param bool $shouldReverse - * @return \Illuminate\Support\Collection - */ - protected function ensureOrderForCursorPagination($shouldReverse = false) - { - $this->enforceOrderBy(); - - return collect($this->orders ?? $this->unionOrders ?? [])->filter(function ($order) { - return Arr::has($order, 'direction'); - })->when($shouldReverse, function (Collection $orders) { - return $orders->map(function ($order) { - $order['direction'] = $order['direction'] === 'asc' ? 'desc' : 'asc'; - - return $order; - }); - })->values(); - } - - /** - * Get the count of the total records for the paginator. - * - * @param array $columns - * @return int - */ - public function getCountForPagination($columns = ['*']) - { - $results = $this->runPaginationCountQuery($columns); - - // Once we have run the pagination count query, we will get the resulting count and - // take into account what type of query it was. When there is a group by we will - // just return the count of the entire results set since that will be correct. - if (! isset($results[0])) { - return 0; - } elseif (is_object($results[0])) { - return (int) $results[0]->aggregate; - } - - return (int) array_change_key_case((array) $results[0])['aggregate']; - } - - /** - * Run a pagination count query. - * - * @param array $columns - * @return array - */ - protected function runPaginationCountQuery($columns = ['*']) - { - if ($this->groups || $this->havings) { - $clone = $this->cloneForPaginationCount(); - - if (is_null($clone->columns) && ! empty($this->joins)) { - $clone->select($this->from.'.*'); - } - - return $this->newQuery() - ->from(new Expression('('.$clone->toSql().') as '.$this->grammar->wrap('aggregate_table'))) - ->mergeBindings($clone) - ->setAggregate('count', $this->withoutSelectAliases($columns)) - ->get()->all(); - } - - $without = $this->unions ? ['orders', 'limit', 'offset'] : ['columns', 'orders', 'limit', 'offset']; - - return $this->cloneWithout($without) - ->cloneWithoutBindings($this->unions ? ['order'] : ['select', 'order']) - ->setAggregate('count', $this->withoutSelectAliases($columns)) - ->get()->all(); - } - - /** - * Clone the existing query instance for usage in a pagination subquery. - * - * @return self - */ - protected function cloneForPaginationCount() - { - return $this->cloneWithout(['orders', 'limit', 'offset']) - ->cloneWithoutBindings(['order']); - } - - /** - * Remove the column aliases since they will break count queries. - * - * @param array $columns - * @return array - */ - protected function withoutSelectAliases(array $columns) - { - return array_map(function ($column) { - return is_string($column) && ($aliasPosition = stripos($column, ' as ')) !== false - ? substr($column, 0, $aliasPosition) : $column; - }, $columns); - } - - /** - * Get a lazy collection for the given query. - * - * @return \Illuminate\Support\LazyCollection - */ - public function cursor() - { - if (is_null($this->columns)) { - $this->columns = ['*']; - } - - return new LazyCollection(function () { - yield from $this->connection->cursor( - $this->toSql(), $this->getBindings(), ! $this->useWritePdo - ); - }); - } - - /** - * Throw an exception if the query doesn't have an orderBy clause. - * - * @return void - * - * @throws \RuntimeException - */ - protected function enforceOrderBy() - { - if (empty($this->orders) && empty($this->unionOrders)) { - throw new RuntimeException('You must specify an orderBy clause when using this function.'); - } - } - - /** - * Get a collection instance containing the values of a given column. - * - * @param string $column - * @param string|null $key - * @return \Illuminate\Support\Collection - */ - public function pluck($column, $key = null) - { - // First, we will need to select the results of the query accounting for the - // given columns / key. Once we have the results, we will be able to take - // the results and get the exact data that was requested for the query. - $queryResult = $this->onceWithColumns( - is_null($key) ? [$column] : [$column, $key], - function () { - return $this->processor->processSelect( - $this, $this->runSelect() - ); - } - ); - - if (empty($queryResult)) { - return collect(); - } - - // If the columns are qualified with a table or have an alias, we cannot use - // those directly in the "pluck" operations since the results from the DB - // are only keyed by the column itself. We'll strip the table out here. - $column = $this->stripTableForPluck($column); - - $key = $this->stripTableForPluck($key); - - return is_array($queryResult[0]) - ? $this->pluckFromArrayColumn($queryResult, $column, $key) - : $this->pluckFromObjectColumn($queryResult, $column, $key); - } - - /** - * Strip off the table name or alias from a column identifier. - * - * @param string $column - * @return string|null - */ - protected function stripTableForPluck($column) - { - if (is_null($column)) { - return $column; - } - - $separator = str_contains(strtolower($column), ' as ') ? ' as ' : '\.'; - - return last(preg_split('~'.$separator.'~i', $column)); - } - - /** - * Retrieve column values from rows represented as objects. - * - * @param array $queryResult - * @param string $column - * @param string $key - * @return \Illuminate\Support\Collection - */ - protected function pluckFromObjectColumn($queryResult, $column, $key) - { - $results = []; - - if (is_null($key)) { - foreach ($queryResult as $row) { - $results[] = $row->$column; - } - } else { - foreach ($queryResult as $row) { - $results[$row->$key] = $row->$column; - } - } - - return collect($results); - } - - /** - * Retrieve column values from rows represented as arrays. - * - * @param array $queryResult - * @param string $column - * @param string $key - * @return \Illuminate\Support\Collection - */ - protected function pluckFromArrayColumn($queryResult, $column, $key) - { - $results = []; - - if (is_null($key)) { - foreach ($queryResult as $row) { - $results[] = $row[$column]; - } - } else { - foreach ($queryResult as $row) { - $results[$row[$key]] = $row[$column]; - } - } - - return collect($results); - } - - /** - * Concatenate values of a given column as a string. - * - * @param string $column - * @param string $glue - * @return string - */ - public function implode($column, $glue = '') - { - return $this->pluck($column)->implode($glue); - } - - /** - * Determine if any rows exist for the current query. - * - * @return bool - */ - public function exists() - { - $this->applyBeforeQueryCallbacks(); - - $results = $this->connection->select( - $this->grammar->compileExists($this), $this->getBindings(), ! $this->useWritePdo - ); - - // If the results have rows, we will get the row and see if the exists column is a - // boolean true. If there are no results for this query we will return false as - // there are no rows for this query at all, and we can return that info here. - if (isset($results[0])) { - $results = (array) $results[0]; - - return (bool) $results['exists']; - } - - return false; - } - - /** - * Determine if no rows exist for the current query. - * - * @return bool - */ - public function doesntExist() - { - return ! $this->exists(); - } - - /** - * Execute the given callback if no rows exist for the current query. - * - * @param \Closure $callback - * @return mixed - */ - public function existsOr(Closure $callback) - { - return $this->exists() ? true : $callback(); - } - - /** - * Execute the given callback if rows exist for the current query. - * - * @param \Closure $callback - * @return mixed - */ - public function doesntExistOr(Closure $callback) - { - return $this->doesntExist() ? true : $callback(); - } - - /** - * Retrieve the "count" result of the query. - * - * @param string $columns - * @return int - */ - public function count($columns = '*') - { - return (int) $this->aggregate(__FUNCTION__, Arr::wrap($columns)); - } - - /** - * Retrieve the minimum value of a given column. - * - * @param string $column - * @return mixed - */ - public function min($column) - { - return $this->aggregate(__FUNCTION__, [$column]); - } - - /** - * Retrieve the maximum value of a given column. - * - * @param string $column - * @return mixed - */ - public function max($column) - { - return $this->aggregate(__FUNCTION__, [$column]); - } - - /** - * Retrieve the sum of the values of a given column. - * - * @param string $column - * @return mixed - */ - public function sum($column) - { - $result = $this->aggregate(__FUNCTION__, [$column]); - - return $result ?: 0; - } - - /** - * Retrieve the average of the values of a given column. - * - * @param string $column - * @return mixed - */ - public function avg($column) - { - return $this->aggregate(__FUNCTION__, [$column]); - } - - /** - * Alias for the "avg" method. - * - * @param string $column - * @return mixed - */ - public function average($column) - { - return $this->avg($column); - } - - /** - * Execute an aggregate function on the database. - * - * @param string $function - * @param array $columns - * @return mixed - */ - public function aggregate($function, $columns = ['*']) - { - $results = $this->cloneWithout($this->unions || $this->havings ? [] : ['columns']) - ->cloneWithoutBindings($this->unions || $this->havings ? [] : ['select']) - ->setAggregate($function, $columns) - ->get($columns); - - if (! $results->isEmpty()) { - return array_change_key_case((array) $results[0])['aggregate']; - } - } - - /** - * Execute a numeric aggregate function on the database. - * - * @param string $function - * @param array $columns - * @return float|int - */ - public function numericAggregate($function, $columns = ['*']) - { - $result = $this->aggregate($function, $columns); - - // If there is no result, we can obviously just return 0 here. Next, we will check - // if the result is an integer or float. If it is already one of these two data - // types we can just return the result as-is, otherwise we will convert this. - if (! $result) { - return 0; - } - - if (is_int($result) || is_float($result)) { - return $result; - } - - // If the result doesn't contain a decimal place, we will assume it is an int then - // cast it to one. When it does we will cast it to a float since it needs to be - // cast to the expected data type for the developers out of pure convenience. - return ! str_contains((string) $result, '.') - ? (int) $result : (float) $result; - } - - /** - * Set the aggregate property without running the query. - * - * @param string $function - * @param array $columns - * @return $this - */ - protected function setAggregate($function, $columns) - { - $this->aggregate = compact('function', 'columns'); - - if (empty($this->groups)) { - $this->orders = null; - - $this->bindings['order'] = []; - } - - return $this; - } - - /** - * Execute the given callback while selecting the given columns. - * - * After running the callback, the columns are reset to the original value. - * - * @param array $columns - * @param callable $callback - * @return mixed - */ - protected function onceWithColumns($columns, $callback) - { - $original = $this->columns; - - if (is_null($original)) { - $this->columns = $columns; - } - - $result = $callback(); - - $this->columns = $original; - - return $result; - } - - /** - * Insert new records into the database. - * - * @param array $values - * @return bool - */ - public function insert(array $values) - { - // Since every insert gets treated like a batch insert, we will make sure the - // bindings are structured in a way that is convenient when building these - // inserts statements by verifying these elements are actually an array. - if (empty($values)) { - return true; - } - - if (! is_array(reset($values))) { - $values = [$values]; - } - - // Here, we will sort the insert keys for every record so that each insert is - // in the same order for the record. We need to make sure this is the case - // so there are not any errors or problems when inserting these records. - else { - foreach ($values as $key => $value) { - ksort($value); - - $values[$key] = $value; - } - } - - $this->applyBeforeQueryCallbacks(); - - // Finally, we will run this query against the database connection and return - // the results. We will need to also flatten these bindings before running - // the query so they are all in one huge, flattened array for execution. - return $this->connection->insert( - $this->grammar->compileInsert($this, $values), - $this->cleanBindings(Arr::flatten($values, 1)) - ); - } - - /** - * Insert new records into the database while ignoring errors. - * - * @param array $values - * @return int - */ - public function insertOrIgnore(array $values) - { - if (empty($values)) { - return 0; - } - - if (! is_array(reset($values))) { - $values = [$values]; - } else { - foreach ($values as $key => $value) { - ksort($value); - $values[$key] = $value; - } - } - - $this->applyBeforeQueryCallbacks(); - - return $this->connection->affectingStatement( - $this->grammar->compileInsertOrIgnore($this, $values), - $this->cleanBindings(Arr::flatten($values, 1)) - ); - } - - /** - * Insert a new record and get the value of the primary key. - * - * @param array $values - * @param string|null $sequence - * @return int - */ - public function insertGetId(array $values, $sequence = null) - { - $this->applyBeforeQueryCallbacks(); - - $sql = $this->grammar->compileInsertGetId($this, $values, $sequence); - - $values = $this->cleanBindings($values); - - return $this->processor->processInsertGetId($this, $sql, $values, $sequence); - } - - /** - * Insert new records into the table using a subquery. - * - * @param array $columns - * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder|string $query - * @return int - */ - public function insertUsing(array $columns, $query) - { - $this->applyBeforeQueryCallbacks(); - - [$sql, $bindings] = $this->createSub($query); - - return $this->connection->affectingStatement( - $this->grammar->compileInsertUsing($this, $columns, $sql), - $this->cleanBindings($bindings) - ); - } - - /** - * Update records in the database. - * - * @param array $values - * @return int - */ - public function update(array $values) - { - $this->applyBeforeQueryCallbacks(); - - $sql = $this->grammar->compileUpdate($this, $values); - - return $this->connection->update($sql, $this->cleanBindings( - $this->grammar->prepareBindingsForUpdate($this->bindings, $values) - )); - } - - /** - * Update records in a PostgreSQL database using the update from syntax. - * - * @param array $values - * @return int - */ - public function updateFrom(array $values) - { - if (! method_exists($this->grammar, 'compileUpdateFrom')) { - throw new LogicException('This database engine does not support the updateFrom method.'); - } - - $this->applyBeforeQueryCallbacks(); - - $sql = $this->grammar->compileUpdateFrom($this, $values); - - return $this->connection->update($sql, $this->cleanBindings( - $this->grammar->prepareBindingsForUpdateFrom($this->bindings, $values) - )); - } - - /** - * Insert or update a record matching the attributes, and fill it with values. - * - * @param array $attributes - * @param array $values - * @return bool - */ - public function updateOrInsert(array $attributes, array $values = []) - { - if (! $this->where($attributes)->exists()) { - return $this->insert(array_merge($attributes, $values)); - } - - if (empty($values)) { - return true; - } - - return (bool) $this->limit(1)->update($values); - } - - /** - * Insert new records or update the existing ones. - * - * @param array $values - * @param array|string $uniqueBy - * @param array|null $update - * @return int - */ - public function upsert(array $values, $uniqueBy, $update = null) - { - if (empty($values)) { - return 0; - } elseif ($update === []) { - return (int) $this->insert($values); - } - - if (! is_array(reset($values))) { - $values = [$values]; - } else { - foreach ($values as $key => $value) { - ksort($value); - - $values[$key] = $value; - } - } - - if (is_null($update)) { - $update = array_keys(reset($values)); - } - - $this->applyBeforeQueryCallbacks(); - - $bindings = $this->cleanBindings(array_merge( - Arr::flatten($values, 1), - collect($update)->reject(function ($value, $key) { - return is_int($key); - })->all() - )); - - return $this->connection->affectingStatement( - $this->grammar->compileUpsert($this, $values, (array) $uniqueBy, $update), - $bindings - ); - } - - /** - * Increment a column's value by a given amount. - * - * @param string $column - * @param float|int $amount - * @param array $extra - * @return int - * - * @throws \InvalidArgumentException - */ - public function increment($column, $amount = 1, array $extra = []) - { - if (! is_numeric($amount)) { - throw new InvalidArgumentException('Non-numeric value passed to increment method.'); - } - - $wrapped = $this->grammar->wrap($column); - - $columns = array_merge([$column => $this->raw("$wrapped + $amount")], $extra); - - return $this->update($columns); - } - - /** - * Decrement a column's value by a given amount. - * - * @param string $column - * @param float|int $amount - * @param array $extra - * @return int - * - * @throws \InvalidArgumentException - */ - public function decrement($column, $amount = 1, array $extra = []) - { - if (! is_numeric($amount)) { - throw new InvalidArgumentException('Non-numeric value passed to decrement method.'); - } - - $wrapped = $this->grammar->wrap($column); - - $columns = array_merge([$column => $this->raw("$wrapped - $amount")], $extra); - - return $this->update($columns); - } - - /** - * Delete records from the database. - * - * @param mixed $id - * @return int - */ - public function delete($id = null) - { - // If an ID is passed to the method, we will set the where clause to check the - // ID to let developers to simply and quickly remove a single row from this - // database without manually specifying the "where" clauses on the query. - if (! is_null($id)) { - $this->where($this->from.'.id', '=', $id); - } - - $this->applyBeforeQueryCallbacks(); - - return $this->connection->delete( - $this->grammar->compileDelete($this), $this->cleanBindings( - $this->grammar->prepareBindingsForDelete($this->bindings) - ) - ); - } - - /** - * Run a truncate statement on the table. - * - * @return void - */ - public function truncate() - { - $this->applyBeforeQueryCallbacks(); - - foreach ($this->grammar->compileTruncate($this) as $sql => $bindings) { - $this->connection->statement($sql, $bindings); - } - } - - /** - * Get a new instance of the query builder. - * - * @return \Illuminate\Database\Query\Builder - */ - public function newQuery() - { - return new static($this->connection, $this->grammar, $this->processor); - } - - /** - * Create a new query instance for a sub-query. - * - * @return \Illuminate\Database\Query\Builder - */ - protected function forSubQuery() - { - return $this->newQuery(); - } - - /** - * Create a raw database expression. - * - * @param mixed $value - * @return \Illuminate\Database\Query\Expression - */ - public function raw($value) - { - return $this->connection->raw($value); - } - - /** - * Get the current query value bindings in a flattened array. - * - * @return array - */ - public function getBindings() - { - return Arr::flatten($this->bindings); - } - - /** - * Get the raw array of bindings. - * - * @return array - */ - public function getRawBindings() - { - return $this->bindings; - } - - /** - * Set the bindings on the query builder. - * - * @param array $bindings - * @param string $type - * @return $this - * - * @throws \InvalidArgumentException - */ - public function setBindings(array $bindings, $type = 'where') - { - if (! array_key_exists($type, $this->bindings)) { - throw new InvalidArgumentException("Invalid binding type: {$type}."); - } - - $this->bindings[$type] = $bindings; - - return $this; - } - - /** - * Add a binding to the query. - * - * @param mixed $value - * @param string $type - * @return $this - * - * @throws \InvalidArgumentException - */ - public function addBinding($value, $type = 'where') - { - if (! array_key_exists($type, $this->bindings)) { - throw new InvalidArgumentException("Invalid binding type: {$type}."); - } - - if (is_array($value)) { - $this->bindings[$type] = array_values(array_map( - [$this, 'castBinding'], - array_merge($this->bindings[$type], $value), - )); - } else { - $this->bindings[$type][] = $this->castBinding($value); - } - - return $this; - } - - /** - * Cast the given binding value. - * - * @param mixed $value - * @return mixed - */ - public function castBinding($value) - { - if (function_exists('enum_exists') && $value instanceof BackedEnum) { - return $value->value; - } - - return $value; - } - - /** - * Merge an array of bindings into our bindings. - * - * @param \Illuminate\Database\Query\Builder $query - * @return $this - */ - public function mergeBindings(self $query) - { - $this->bindings = array_merge_recursive($this->bindings, $query->bindings); - - return $this; - } - - /** - * Remove all of the expressions from a list of bindings. - * - * @param array $bindings - * @return array - */ - public function cleanBindings(array $bindings) - { - return collect($bindings) - ->reject(function ($binding) { - return $binding instanceof Expression; - }) - ->map([$this, 'castBinding']) - ->values() - ->all(); - } - - /** - * Get a scalar type value from an unknown type of input. - * - * @param mixed $value - * @return mixed - */ - protected function flattenValue($value) - { - return is_array($value) ? head(Arr::flatten($value)) : $value; - } - - /** - * Get the default key name of the table. - * - * @return string - */ - protected function defaultKeyName() - { - return 'id'; - } - - /** - * Get the database connection instance. - * - * @return \Illuminate\Database\ConnectionInterface - */ - public function getConnection() - { - return $this->connection; - } - - /** - * Get the database query processor instance. - * - * @return \Illuminate\Database\Query\Processors\Processor - */ - public function getProcessor() - { - return $this->processor; - } - - /** - * Get the query grammar instance. - * - * @return \Illuminate\Database\Query\Grammars\Grammar - */ - public function getGrammar() - { - return $this->grammar; - } - - /** - * Use the "write" PDO connection when executing the query. - * - * @return $this - */ - public function useWritePdo() - { - $this->useWritePdo = true; - - return $this; - } - - /** - * Determine if the value is a query builder instance or a Closure. - * - * @param mixed $value - * @return bool - */ - protected function isQueryable($value) - { - return $value instanceof self || - $value instanceof EloquentBuilder || - $value instanceof Relation || - $value instanceof Closure; - } - - /** - * Clone the query. - * - * @return static - */ - public function clone() - { - return clone $this; - } - - /** - * Clone the query without the given properties. - * - * @param array $properties - * @return static - */ - public function cloneWithout(array $properties) - { - return tap($this->clone(), function ($clone) use ($properties) { - foreach ($properties as $property) { - $clone->{$property} = null; - } - }); - } - - /** - * Clone the query without the given bindings. - * - * @param array $except - * @return static - */ - public function cloneWithoutBindings(array $except) - { - return tap($this->clone(), function ($clone) use ($except) { - foreach ($except as $type) { - $clone->bindings[$type] = []; - } - }); - } - - /** - * Dump the current SQL and bindings. - * - * @return $this - */ - public function dump() - { - dump($this->toSql(), $this->getBindings()); - - return $this; - } - - /** - * Die and dump the current SQL and bindings. - * - * @return never - */ - public function dd() - { - dd($this->toSql(), $this->getBindings()); - } - - /** - * Handle dynamic method calls into the method. - * - * @param string $method - * @param array $parameters - * @return mixed - * - * @throws \BadMethodCallException - */ - public function __call($method, $parameters) - { - if (static::hasMacro($method)) { - return $this->macroCall($method, $parameters); - } - - if (str_starts_with($method, 'where')) { - return $this->dynamicWhere($method, $parameters); - } - - static::throwBadMethodCallException($method); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Query/Expression.php b/vendor/laravel/framework/src/Illuminate/Database/Query/Expression.php deleted file mode 100755 index de690299..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Query/Expression.php +++ /dev/null @@ -1,44 +0,0 @@ -value = $value; - } - - /** - * Get the value of the expression. - * - * @return mixed - */ - public function getValue() - { - return $this->value; - } - - /** - * Get the value of the expression. - * - * @return string - */ - public function __toString() - { - return (string) $this->getValue(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/Grammar.php b/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/Grammar.php deleted file mode 100755 index 46fae45a..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/Grammar.php +++ /dev/null @@ -1,1347 +0,0 @@ -unions || $query->havings) && $query->aggregate) { - return $this->compileUnionAggregate($query); - } - - // If the query does not have any columns set, we'll set the columns to the - // * character to just get all of the columns from the database. Then we - // can build the query and concatenate all the pieces together as one. - $original = $query->columns; - - if (is_null($query->columns)) { - $query->columns = ['*']; - } - - // To compile the query, we'll spin through each component of the query and - // see if that component exists. If it does we'll just call the compiler - // function for the component which is responsible for making the SQL. - $sql = trim($this->concatenate( - $this->compileComponents($query)) - ); - - if ($query->unions) { - $sql = $this->wrapUnion($sql).' '.$this->compileUnions($query); - } - - $query->columns = $original; - - return $sql; - } - - /** - * Compile the components necessary for a select clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @return array - */ - protected function compileComponents(Builder $query) - { - $sql = []; - - foreach ($this->selectComponents as $component) { - if (isset($query->$component)) { - $method = 'compile'.ucfirst($component); - - $sql[$component] = $this->$method($query, $query->$component); - } - } - - return $sql; - } - - /** - * Compile an aggregated select clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $aggregate - * @return string - */ - protected function compileAggregate(Builder $query, $aggregate) - { - $column = $this->columnize($aggregate['columns']); - - // If the query has a "distinct" constraint and we're not asking for all columns - // we need to prepend "distinct" onto the column name so that the query takes - // it into account when it performs the aggregating operations on the data. - if (is_array($query->distinct)) { - $column = 'distinct '.$this->columnize($query->distinct); - } elseif ($query->distinct && $column !== '*') { - $column = 'distinct '.$column; - } - - return 'select '.$aggregate['function'].'('.$column.') as aggregate'; - } - - /** - * Compile the "select *" portion of the query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $columns - * @return string|null - */ - protected function compileColumns(Builder $query, $columns) - { - // If the query is actually performing an aggregating select, we will let that - // compiler handle the building of the select clauses, as it will need some - // more syntax that is best handled by that function to keep things neat. - if (! is_null($query->aggregate)) { - return; - } - - if ($query->distinct) { - $select = 'select distinct '; - } else { - $select = 'select '; - } - - return $select.$this->columnize($columns); - } - - /** - * Compile the "from" portion of the query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param string $table - * @return string - */ - protected function compileFrom(Builder $query, $table) - { - return 'from '.$this->wrapTable($table); - } - - /** - * Compile the "join" portions of the query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $joins - * @return string - */ - protected function compileJoins(Builder $query, $joins) - { - return collect($joins)->map(function ($join) use ($query) { - $table = $this->wrapTable($join->table); - - $nestedJoins = is_null($join->joins) ? '' : ' '.$this->compileJoins($query, $join->joins); - - $tableAndNestedJoins = is_null($join->joins) ? $table : '('.$table.$nestedJoins.')'; - - return trim("{$join->type} join {$tableAndNestedJoins} {$this->compileWheres($join)}"); - })->implode(' '); - } - - /** - * Compile the "where" portions of the query. - * - * @param \Illuminate\Database\Query\Builder $query - * @return string - */ - public function compileWheres(Builder $query) - { - // Each type of where clause has its own compiler function, which is responsible - // for actually creating the where clauses SQL. This helps keep the code nice - // and maintainable since each clause has a very small method that it uses. - if (is_null($query->wheres)) { - return ''; - } - - // If we actually have some where clauses, we will strip off the first boolean - // operator, which is added by the query builders for convenience so we can - // avoid checking for the first clauses in each of the compilers methods. - if (count($sql = $this->compileWheresToArray($query)) > 0) { - return $this->concatenateWhereClauses($query, $sql); - } - - return ''; - } - - /** - * Get an array of all the where clauses for the query. - * - * @param \Illuminate\Database\Query\Builder $query - * @return array - */ - protected function compileWheresToArray($query) - { - return collect($query->wheres)->map(function ($where) use ($query) { - return $where['boolean'].' '.$this->{"where{$where['type']}"}($query, $where); - })->all(); - } - - /** - * Format the where clause statements into one string. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $sql - * @return string - */ - protected function concatenateWhereClauses($query, $sql) - { - $conjunction = $query instanceof JoinClause ? 'on' : 'where'; - - return $conjunction.' '.$this->removeLeadingBoolean(implode(' ', $sql)); - } - - /** - * Compile a raw where clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereRaw(Builder $query, $where) - { - return $where['sql']; - } - - /** - * Compile a basic where clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereBasic(Builder $query, $where) - { - $value = $this->parameter($where['value']); - - $operator = str_replace('?', '??', $where['operator']); - - return $this->wrap($where['column']).' '.$operator.' '.$value; - } - - /** - * Compile a bitwise operator where clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereBitwise(Builder $query, $where) - { - return $this->whereBasic($query, $where); - } - - /** - * Compile a "where in" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereIn(Builder $query, $where) - { - if (! empty($where['values'])) { - return $this->wrap($where['column']).' in ('.$this->parameterize($where['values']).')'; - } - - return '0 = 1'; - } - - /** - * Compile a "where not in" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereNotIn(Builder $query, $where) - { - if (! empty($where['values'])) { - return $this->wrap($where['column']).' not in ('.$this->parameterize($where['values']).')'; - } - - return '1 = 1'; - } - - /** - * Compile a "where not in raw" clause. - * - * For safety, whereIntegerInRaw ensures this method is only used with integer values. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereNotInRaw(Builder $query, $where) - { - if (! empty($where['values'])) { - return $this->wrap($where['column']).' not in ('.implode(', ', $where['values']).')'; - } - - return '1 = 1'; - } - - /** - * Compile a "where in raw" clause. - * - * For safety, whereIntegerInRaw ensures this method is only used with integer values. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereInRaw(Builder $query, $where) - { - if (! empty($where['values'])) { - return $this->wrap($where['column']).' in ('.implode(', ', $where['values']).')'; - } - - return '0 = 1'; - } - - /** - * Compile a "where null" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereNull(Builder $query, $where) - { - return $this->wrap($where['column']).' is null'; - } - - /** - * Compile a "where not null" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereNotNull(Builder $query, $where) - { - return $this->wrap($where['column']).' is not null'; - } - - /** - * Compile a "between" where clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereBetween(Builder $query, $where) - { - $between = $where['not'] ? 'not between' : 'between'; - - $min = $this->parameter(is_array($where['values']) ? reset($where['values']) : $where['values'][0]); - - $max = $this->parameter(is_array($where['values']) ? end($where['values']) : $where['values'][1]); - - return $this->wrap($where['column']).' '.$between.' '.$min.' and '.$max; - } - - /** - * Compile a "between" where clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereBetweenColumns(Builder $query, $where) - { - $between = $where['not'] ? 'not between' : 'between'; - - $min = $this->wrap(is_array($where['values']) ? reset($where['values']) : $where['values'][0]); - - $max = $this->wrap(is_array($where['values']) ? end($where['values']) : $where['values'][1]); - - return $this->wrap($where['column']).' '.$between.' '.$min.' and '.$max; - } - - /** - * Compile a "where date" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereDate(Builder $query, $where) - { - return $this->dateBasedWhere('date', $query, $where); - } - - /** - * Compile a "where time" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereTime(Builder $query, $where) - { - return $this->dateBasedWhere('time', $query, $where); - } - - /** - * Compile a "where day" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereDay(Builder $query, $where) - { - return $this->dateBasedWhere('day', $query, $where); - } - - /** - * Compile a "where month" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereMonth(Builder $query, $where) - { - return $this->dateBasedWhere('month', $query, $where); - } - - /** - * Compile a "where year" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereYear(Builder $query, $where) - { - return $this->dateBasedWhere('year', $query, $where); - } - - /** - * Compile a date based where clause. - * - * @param string $type - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function dateBasedWhere($type, Builder $query, $where) - { - $value = $this->parameter($where['value']); - - return $type.'('.$this->wrap($where['column']).') '.$where['operator'].' '.$value; - } - - /** - * Compile a where clause comparing two columns. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereColumn(Builder $query, $where) - { - return $this->wrap($where['first']).' '.$where['operator'].' '.$this->wrap($where['second']); - } - - /** - * Compile a nested where clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereNested(Builder $query, $where) - { - // Here we will calculate what portion of the string we need to remove. If this - // is a join clause query, we need to remove the "on" portion of the SQL and - // if it is a normal query we need to take the leading "where" of queries. - $offset = $query instanceof JoinClause ? 3 : 6; - - return '('.substr($this->compileWheres($where['query']), $offset).')'; - } - - /** - * Compile a where condition with a sub-select. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereSub(Builder $query, $where) - { - $select = $this->compileSelect($where['query']); - - return $this->wrap($where['column']).' '.$where['operator']." ($select)"; - } - - /** - * Compile a where exists clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereExists(Builder $query, $where) - { - return 'exists ('.$this->compileSelect($where['query']).')'; - } - - /** - * Compile a where exists clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereNotExists(Builder $query, $where) - { - return 'not exists ('.$this->compileSelect($where['query']).')'; - } - - /** - * Compile a where row values condition. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereRowValues(Builder $query, $where) - { - $columns = $this->columnize($where['columns']); - - $values = $this->parameterize($where['values']); - - return '('.$columns.') '.$where['operator'].' ('.$values.')'; - } - - /** - * Compile a "where JSON boolean" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereJsonBoolean(Builder $query, $where) - { - $column = $this->wrapJsonBooleanSelector($where['column']); - - $value = $this->wrapJsonBooleanValue( - $this->parameter($where['value']) - ); - - return $column.' '.$where['operator'].' '.$value; - } - - /** - * Compile a "where JSON contains" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereJsonContains(Builder $query, $where) - { - $not = $where['not'] ? 'not ' : ''; - - return $not.$this->compileJsonContains( - $where['column'], - $this->parameter($where['value']) - ); - } - - /** - * Compile a "JSON contains" statement into SQL. - * - * @param string $column - * @param string $value - * @return string - * - * @throws \RuntimeException - */ - protected function compileJsonContains($column, $value) - { - throw new RuntimeException('This database engine does not support JSON contains operations.'); - } - - /** - * Prepare the binding for a "JSON contains" statement. - * - * @param mixed $binding - * @return string - */ - public function prepareBindingForJsonContains($binding) - { - return json_encode($binding); - } - - /** - * Compile a "where JSON contains key" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereJsonContainsKey(Builder $query, $where) - { - $not = $where['not'] ? 'not ' : ''; - - return $not.$this->compileJsonContainsKey( - $where['column'] - ); - } - - /** - * Compile a "JSON contains key" statement into SQL. - * - * @param string $column - * @return string - * - * @throws \RuntimeException - */ - protected function compileJsonContainsKey($column) - { - throw new RuntimeException('This database engine does not support JSON contains key operations.'); - } - - /** - * Compile a "where JSON length" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereJsonLength(Builder $query, $where) - { - return $this->compileJsonLength( - $where['column'], - $where['operator'], - $this->parameter($where['value']) - ); - } - - /** - * Compile a "JSON length" statement into SQL. - * - * @param string $column - * @param string $operator - * @param string $value - * @return string - * - * @throws \RuntimeException - */ - protected function compileJsonLength($column, $operator, $value) - { - throw new RuntimeException('This database engine does not support JSON length operations.'); - } - - /** - * Compile a "JSON value cast" statement into SQL. - * - * @param string $value - * @return string - */ - public function compileJsonValueCast($value) - { - return $value; - } - - /** - * Compile a "where fulltext" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - public function whereFullText(Builder $query, $where) - { - throw new RuntimeException('This database engine does not support fulltext search operations.'); - } - - /** - * Compile the "group by" portions of the query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $groups - * @return string - */ - protected function compileGroups(Builder $query, $groups) - { - return 'group by '.$this->columnize($groups); - } - - /** - * Compile the "having" portions of the query. - * - * @param \Illuminate\Database\Query\Builder $query - * @return string - */ - protected function compileHavings(Builder $query) - { - return 'having '.$this->removeLeadingBoolean(collect($query->havings)->map(function ($having) { - return $having['boolean'].' '.$this->compileHaving($having); - })->implode(' ')); - } - - /** - * Compile a single having clause. - * - * @param array $having - * @return string - */ - protected function compileHaving(array $having) - { - // If the having clause is "raw", we can just return the clause straight away - // without doing any more processing on it. Otherwise, we will compile the - // clause into SQL based on the components that make it up from builder. - if ($having['type'] === 'Raw') { - return $having['sql']; - } elseif ($having['type'] === 'between') { - return $this->compileHavingBetween($having); - } elseif ($having['type'] === 'Null') { - return $this->compileHavingNull($having); - } elseif ($having['type'] === 'NotNull') { - return $this->compileHavingNotNull($having); - } elseif ($having['type'] === 'bit') { - return $this->compileHavingBit($having); - } elseif ($having['type'] === 'Nested') { - return $this->compileNestedHavings($having); - } - - return $this->compileBasicHaving($having); - } - - /** - * Compile a basic having clause. - * - * @param array $having - * @return string - */ - protected function compileBasicHaving($having) - { - $column = $this->wrap($having['column']); - - $parameter = $this->parameter($having['value']); - - return $column.' '.$having['operator'].' '.$parameter; - } - - /** - * Compile a "between" having clause. - * - * @param array $having - * @return string - */ - protected function compileHavingBetween($having) - { - $between = $having['not'] ? 'not between' : 'between'; - - $column = $this->wrap($having['column']); - - $min = $this->parameter(head($having['values'])); - - $max = $this->parameter(last($having['values'])); - - return $column.' '.$between.' '.$min.' and '.$max; - } - - /** - * Compile a having null clause. - * - * @param array $having - * @return string - */ - protected function compileHavingNull($having) - { - $column = $this->wrap($having['column']); - - return $column.' is null'; - } - - /** - * Compile a having not null clause. - * - * @param array $having - * @return string - */ - protected function compileHavingNotNull($having) - { - $column = $this->wrap($having['column']); - - return $column.' is not null'; - } - - /** - * Compile a having clause involving a bit operator. - * - * @param array $having - * @return string - */ - protected function compileHavingBit($having) - { - $column = $this->wrap($having['column']); - - $parameter = $this->parameter($having['value']); - - return '('.$column.' '.$having['operator'].' '.$parameter.') != 0'; - } - - /** - * Compile a nested having clause. - * - * @param array $having - * @return string - */ - protected function compileNestedHavings($having) - { - return '('.substr($this->compileHavings($having['query']), 7).')'; - } - - /** - * Compile the "order by" portions of the query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $orders - * @return string - */ - protected function compileOrders(Builder $query, $orders) - { - if (! empty($orders)) { - return 'order by '.implode(', ', $this->compileOrdersToArray($query, $orders)); - } - - return ''; - } - - /** - * Compile the query orders to an array. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $orders - * @return array - */ - protected function compileOrdersToArray(Builder $query, $orders) - { - return array_map(function ($order) { - return $order['sql'] ?? $this->wrap($order['column']).' '.$order['direction']; - }, $orders); - } - - /** - * Compile the random statement into SQL. - * - * @param string $seed - * @return string - */ - public function compileRandom($seed) - { - return 'RANDOM()'; - } - - /** - * Compile the "limit" portions of the query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param int $limit - * @return string - */ - protected function compileLimit(Builder $query, $limit) - { - return 'limit '.(int) $limit; - } - - /** - * Compile the "offset" portions of the query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param int $offset - * @return string - */ - protected function compileOffset(Builder $query, $offset) - { - return 'offset '.(int) $offset; - } - - /** - * Compile the "union" queries attached to the main query. - * - * @param \Illuminate\Database\Query\Builder $query - * @return string - */ - protected function compileUnions(Builder $query) - { - $sql = ''; - - foreach ($query->unions as $union) { - $sql .= $this->compileUnion($union); - } - - if (! empty($query->unionOrders)) { - $sql .= ' '.$this->compileOrders($query, $query->unionOrders); - } - - if (isset($query->unionLimit)) { - $sql .= ' '.$this->compileLimit($query, $query->unionLimit); - } - - if (isset($query->unionOffset)) { - $sql .= ' '.$this->compileOffset($query, $query->unionOffset); - } - - return ltrim($sql); - } - - /** - * Compile a single union statement. - * - * @param array $union - * @return string - */ - protected function compileUnion(array $union) - { - $conjunction = $union['all'] ? ' union all ' : ' union '; - - return $conjunction.$this->wrapUnion($union['query']->toSql()); - } - - /** - * Wrap a union subquery in parentheses. - * - * @param string $sql - * @return string - */ - protected function wrapUnion($sql) - { - return '('.$sql.')'; - } - - /** - * Compile a union aggregate query into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @return string - */ - protected function compileUnionAggregate(Builder $query) - { - $sql = $this->compileAggregate($query, $query->aggregate); - - $query->aggregate = null; - - return $sql.' from ('.$this->compileSelect($query).') as '.$this->wrapTable('temp_table'); - } - - /** - * Compile an exists statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @return string - */ - public function compileExists(Builder $query) - { - $select = $this->compileSelect($query); - - return "select exists({$select}) as {$this->wrap('exists')}"; - } - - /** - * Compile an insert statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $values - * @return string - */ - public function compileInsert(Builder $query, array $values) - { - // Essentially we will force every insert to be treated as a batch insert which - // simply makes creating the SQL easier for us since we can utilize the same - // basic routine regardless of an amount of records given to us to insert. - $table = $this->wrapTable($query->from); - - if (empty($values)) { - return "insert into {$table} default values"; - } - - if (! is_array(reset($values))) { - $values = [$values]; - } - - $columns = $this->columnize(array_keys(reset($values))); - - // We need to build a list of parameter place-holders of values that are bound - // to the query. Each insert should have the exact same number of parameter - // bindings so we will loop through the record and parameterize them all. - $parameters = collect($values)->map(function ($record) { - return '('.$this->parameterize($record).')'; - })->implode(', '); - - return "insert into $table ($columns) values $parameters"; - } - - /** - * Compile an insert ignore statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $values - * @return string - * - * @throws \RuntimeException - */ - public function compileInsertOrIgnore(Builder $query, array $values) - { - throw new RuntimeException('This database engine does not support inserting while ignoring errors.'); - } - - /** - * Compile an insert and get ID statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $values - * @param string $sequence - * @return string - */ - public function compileInsertGetId(Builder $query, $values, $sequence) - { - return $this->compileInsert($query, $values); - } - - /** - * Compile an insert statement using a subquery into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $columns - * @param string $sql - * @return string - */ - public function compileInsertUsing(Builder $query, array $columns, string $sql) - { - return "insert into {$this->wrapTable($query->from)} ({$this->columnize($columns)}) $sql"; - } - - /** - * Compile an update statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $values - * @return string - */ - public function compileUpdate(Builder $query, array $values) - { - $table = $this->wrapTable($query->from); - - $columns = $this->compileUpdateColumns($query, $values); - - $where = $this->compileWheres($query); - - return trim( - isset($query->joins) - ? $this->compileUpdateWithJoins($query, $table, $columns, $where) - : $this->compileUpdateWithoutJoins($query, $table, $columns, $where) - ); - } - - /** - * Compile the columns for an update statement. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $values - * @return string - */ - protected function compileUpdateColumns(Builder $query, array $values) - { - return collect($values)->map(function ($value, $key) { - return $this->wrap($key).' = '.$this->parameter($value); - })->implode(', '); - } - - /** - * Compile an update statement without joins into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param string $table - * @param string $columns - * @param string $where - * @return string - */ - protected function compileUpdateWithoutJoins(Builder $query, $table, $columns, $where) - { - return "update {$table} set {$columns} {$where}"; - } - - /** - * Compile an update statement with joins into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param string $table - * @param string $columns - * @param string $where - * @return string - */ - protected function compileUpdateWithJoins(Builder $query, $table, $columns, $where) - { - $joins = $this->compileJoins($query, $query->joins); - - return "update {$table} {$joins} set {$columns} {$where}"; - } - - /** - * Compile an "upsert" statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $values - * @param array $uniqueBy - * @param array $update - * @return string - * - * @throws \RuntimeException - */ - public function compileUpsert(Builder $query, array $values, array $uniqueBy, array $update) - { - throw new RuntimeException('This database engine does not support upserts.'); - } - - /** - * Prepare the bindings for an update statement. - * - * @param array $bindings - * @param array $values - * @return array - */ - public function prepareBindingsForUpdate(array $bindings, array $values) - { - $cleanBindings = Arr::except($bindings, ['select', 'join']); - - return array_values( - array_merge($bindings['join'], $values, Arr::flatten($cleanBindings)) - ); - } - - /** - * Compile a delete statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @return string - */ - public function compileDelete(Builder $query) - { - $table = $this->wrapTable($query->from); - - $where = $this->compileWheres($query); - - return trim( - isset($query->joins) - ? $this->compileDeleteWithJoins($query, $table, $where) - : $this->compileDeleteWithoutJoins($query, $table, $where) - ); - } - - /** - * Compile a delete statement without joins into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param string $table - * @param string $where - * @return string - */ - protected function compileDeleteWithoutJoins(Builder $query, $table, $where) - { - return "delete from {$table} {$where}"; - } - - /** - * Compile a delete statement with joins into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param string $table - * @param string $where - * @return string - */ - protected function compileDeleteWithJoins(Builder $query, $table, $where) - { - $alias = last(explode(' as ', $table)); - - $joins = $this->compileJoins($query, $query->joins); - - return "delete {$alias} from {$table} {$joins} {$where}"; - } - - /** - * Prepare the bindings for a delete statement. - * - * @param array $bindings - * @return array - */ - public function prepareBindingsForDelete(array $bindings) - { - return Arr::flatten( - Arr::except($bindings, 'select') - ); - } - - /** - * Compile a truncate table statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @return array - */ - public function compileTruncate(Builder $query) - { - return ['truncate table '.$this->wrapTable($query->from) => []]; - } - - /** - * Compile the lock into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param bool|string $value - * @return string - */ - protected function compileLock(Builder $query, $value) - { - return is_string($value) ? $value : ''; - } - - /** - * Determine if the grammar supports savepoints. - * - * @return bool - */ - public function supportsSavepoints() - { - return true; - } - - /** - * Compile the SQL statement to define a savepoint. - * - * @param string $name - * @return string - */ - public function compileSavepoint($name) - { - return 'SAVEPOINT '.$name; - } - - /** - * Compile the SQL statement to execute a savepoint rollback. - * - * @param string $name - * @return string - */ - public function compileSavepointRollBack($name) - { - return 'ROLLBACK TO SAVEPOINT '.$name; - } - - /** - * Wrap the given JSON selector for boolean values. - * - * @param string $value - * @return string - */ - protected function wrapJsonBooleanSelector($value) - { - return $this->wrapJsonSelector($value); - } - - /** - * Wrap the given JSON boolean value. - * - * @param string $value - * @return string - */ - protected function wrapJsonBooleanValue($value) - { - return $value; - } - - /** - * Concatenate an array of segments, removing empties. - * - * @param array $segments - * @return string - */ - protected function concatenate($segments) - { - return implode(' ', array_filter($segments, function ($value) { - return (string) $value !== ''; - })); - } - - /** - * Remove the leading boolean from a statement. - * - * @param string $value - * @return string - */ - protected function removeLeadingBoolean($value) - { - return preg_replace('/and |or /i', '', $value, 1); - } - - /** - * Get the grammar specific operators. - * - * @return array - */ - public function getOperators() - { - return $this->operators; - } - - /** - * Get the grammar specific bitwise operators. - * - * @return array - */ - public function getBitwiseOperators() - { - return $this->bitwiseOperators; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/MySqlGrammar.php b/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/MySqlGrammar.php deleted file mode 100755 index 3e4f06a2..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/MySqlGrammar.php +++ /dev/null @@ -1,365 +0,0 @@ -isJsonSelector($where['column'])) { - [$field, $path] = $this->wrapJsonFieldAndPath($where['column']); - - return '(json_extract('.$field.$path.') is null OR json_type(json_extract('.$field.$path.')) = \'NULL\')'; - } - - return parent::whereNull($query, $where); - } - - /** - * Add a "where not null" clause to the query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereNotNull(Builder $query, $where) - { - if ($this->isJsonSelector($where['column'])) { - [$field, $path] = $this->wrapJsonFieldAndPath($where['column']); - - return '(json_extract('.$field.$path.') is not null AND json_type(json_extract('.$field.$path.')) != \'NULL\')'; - } - - return parent::whereNotNull($query, $where); - } - - /** - * Compile a "where fulltext" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - public function whereFullText(Builder $query, $where) - { - $columns = $this->columnize($where['columns']); - - $value = $this->parameter($where['value']); - - $mode = ($where['options']['mode'] ?? []) === 'boolean' - ? ' in boolean mode' - : ' in natural language mode'; - - $expanded = ($where['options']['expanded'] ?? []) && ($where['options']['mode'] ?? []) !== 'boolean' - ? ' with query expansion' - : ''; - - return "match ({$columns}) against (".$value."{$mode}{$expanded})"; - } - - /** - * Compile an insert ignore statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $values - * @return string - */ - public function compileInsertOrIgnore(Builder $query, array $values) - { - return Str::replaceFirst('insert', 'insert ignore', $this->compileInsert($query, $values)); - } - - /** - * Compile a "JSON contains" statement into SQL. - * - * @param string $column - * @param string $value - * @return string - */ - protected function compileJsonContains($column, $value) - { - [$field, $path] = $this->wrapJsonFieldAndPath($column); - - return 'json_contains('.$field.', '.$value.$path.')'; - } - - /** - * Compile a "JSON contains key" statement into SQL. - * - * @param string $column - * @return string - */ - protected function compileJsonContainsKey($column) - { - [$field, $path] = $this->wrapJsonFieldAndPath($column); - - return 'ifnull(json_contains_path('.$field.', \'one\''.$path.'), 0)'; - } - - /** - * Compile a "JSON length" statement into SQL. - * - * @param string $column - * @param string $operator - * @param string $value - * @return string - */ - protected function compileJsonLength($column, $operator, $value) - { - [$field, $path] = $this->wrapJsonFieldAndPath($column); - - return 'json_length('.$field.$path.') '.$operator.' '.$value; - } - - /** - * Compile a "JSON value cast" statement into SQL. - * - * @param string $value - * @return string - */ - public function compileJsonValueCast($value) - { - return 'cast('.$value.' as json)'; - } - - /** - * Compile the random statement into SQL. - * - * @param string $seed - * @return string - */ - public function compileRandom($seed) - { - return 'RAND('.$seed.')'; - } - - /** - * Compile the lock into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param bool|string $value - * @return string - */ - protected function compileLock(Builder $query, $value) - { - if (! is_string($value)) { - return $value ? 'for update' : 'lock in share mode'; - } - - return $value; - } - - /** - * Compile an insert statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $values - * @return string - */ - public function compileInsert(Builder $query, array $values) - { - if (empty($values)) { - $values = [[]]; - } - - return parent::compileInsert($query, $values); - } - - /** - * Compile the columns for an update statement. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $values - * @return string - */ - protected function compileUpdateColumns(Builder $query, array $values) - { - return collect($values)->map(function ($value, $key) { - if ($this->isJsonSelector($key)) { - return $this->compileJsonUpdateColumn($key, $value); - } - - return $this->wrap($key).' = '.$this->parameter($value); - })->implode(', '); - } - - /** - * Compile an "upsert" statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $values - * @param array $uniqueBy - * @param array $update - * @return string - */ - public function compileUpsert(Builder $query, array $values, array $uniqueBy, array $update) - { - $useUpsertAlias = $query->connection->getConfig('use_upsert_alias'); - - $sql = $this->compileInsert($query, $values); - - if ($useUpsertAlias) { - $sql .= ' as laravel_upsert_alias'; - } - - $sql .= ' on duplicate key update '; - - $columns = collect($update)->map(function ($value, $key) use ($useUpsertAlias) { - if (! is_numeric($key)) { - return $this->wrap($key).' = '.$this->parameter($value); - } - - return $useUpsertAlias - ? $this->wrap($value).' = '.$this->wrap('laravel_upsert_alias').'.'.$this->wrap($value) - : $this->wrap($value).' = values('.$this->wrap($value).')'; - })->implode(', '); - - return $sql.$columns; - } - - /** - * Prepare a JSON column being updated using the JSON_SET function. - * - * @param string $key - * @param mixed $value - * @return string - */ - protected function compileJsonUpdateColumn($key, $value) - { - if (is_bool($value)) { - $value = $value ? 'true' : 'false'; - } elseif (is_array($value)) { - $value = 'cast(? as json)'; - } else { - $value = $this->parameter($value); - } - - [$field, $path] = $this->wrapJsonFieldAndPath($key); - - return "{$field} = json_set({$field}{$path}, {$value})"; - } - - /** - * Compile an update statement without joins into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param string $table - * @param string $columns - * @param string $where - * @return string - */ - protected function compileUpdateWithoutJoins(Builder $query, $table, $columns, $where) - { - $sql = parent::compileUpdateWithoutJoins($query, $table, $columns, $where); - - if (! empty($query->orders)) { - $sql .= ' '.$this->compileOrders($query, $query->orders); - } - - if (isset($query->limit)) { - $sql .= ' '.$this->compileLimit($query, $query->limit); - } - - return $sql; - } - - /** - * Prepare the bindings for an update statement. - * - * Booleans, integers, and doubles are inserted into JSON updates as raw values. - * - * @param array $bindings - * @param array $values - * @return array - */ - public function prepareBindingsForUpdate(array $bindings, array $values) - { - $values = collect($values)->reject(function ($value, $column) { - return $this->isJsonSelector($column) && is_bool($value); - })->map(function ($value) { - return is_array($value) ? json_encode($value) : $value; - })->all(); - - return parent::prepareBindingsForUpdate($bindings, $values); - } - - /** - * Compile a delete query that does not use joins. - * - * @param \Illuminate\Database\Query\Builder $query - * @param string $table - * @param string $where - * @return string - */ - protected function compileDeleteWithoutJoins(Builder $query, $table, $where) - { - $sql = parent::compileDeleteWithoutJoins($query, $table, $where); - - // When using MySQL, delete statements may contain order by statements and limits - // so we will compile both of those here. Once we have finished compiling this - // we will return the completed SQL statement so it will be executed for us. - if (! empty($query->orders)) { - $sql .= ' '.$this->compileOrders($query, $query->orders); - } - - if (isset($query->limit)) { - $sql .= ' '.$this->compileLimit($query, $query->limit); - } - - return $sql; - } - - /** - * Wrap a single string in keyword identifiers. - * - * @param string $value - * @return string - */ - protected function wrapValue($value) - { - return $value === '*' ? $value : '`'.str_replace('`', '``', $value).'`'; - } - - /** - * Wrap the given JSON selector. - * - * @param string $value - * @return string - */ - protected function wrapJsonSelector($value) - { - [$field, $path] = $this->wrapJsonFieldAndPath($value); - - return 'json_unquote(json_extract('.$field.$path.'))'; - } - - /** - * Wrap the given JSON selector for boolean values. - * - * @param string $value - * @return string - */ - protected function wrapJsonBooleanSelector($value) - { - [$field, $path] = $this->wrapJsonFieldAndPath($value); - - return 'json_extract('.$field.$path.')'; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/PostgresGrammar.php b/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/PostgresGrammar.php deleted file mode 100755 index ad4678b0..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/PostgresGrammar.php +++ /dev/null @@ -1,701 +0,0 @@ -', '<=', '>=', '<>', '!=', - 'like', 'not like', 'between', 'ilike', 'not ilike', - '~', '&', '|', '#', '<<', '>>', '<<=', '>>=', - '&&', '@>', '<@', '?', '?|', '?&', '||', '-', '@?', '@@', '#-', - 'is distinct from', 'is not distinct from', - ]; - - /** - * The grammar specific bitwise operators. - * - * @var array - */ - protected $bitwiseOperators = [ - '~', '&', '|', '#', '<<', '>>', '<<=', '>>=', - ]; - - /** - * Compile a basic where clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereBasic(Builder $query, $where) - { - if (str_contains(strtolower($where['operator']), 'like')) { - return sprintf( - '%s::text %s %s', - $this->wrap($where['column']), - $where['operator'], - $this->parameter($where['value']) - ); - } - - return parent::whereBasic($query, $where); - } - - /** - * Compile a bitwise operator where clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereBitwise(Builder $query, $where) - { - $value = $this->parameter($where['value']); - - $operator = str_replace('?', '??', $where['operator']); - - return '('.$this->wrap($where['column']).' '.$operator.' '.$value.')::bool'; - } - - /** - * Compile a "where date" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereDate(Builder $query, $where) - { - $value = $this->parameter($where['value']); - - return $this->wrap($where['column']).'::date '.$where['operator'].' '.$value; - } - - /** - * Compile a "where time" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereTime(Builder $query, $where) - { - $value = $this->parameter($where['value']); - - return $this->wrap($where['column']).'::time '.$where['operator'].' '.$value; - } - - /** - * Compile a date based where clause. - * - * @param string $type - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function dateBasedWhere($type, Builder $query, $where) - { - $value = $this->parameter($where['value']); - - return 'extract('.$type.' from '.$this->wrap($where['column']).') '.$where['operator'].' '.$value; - } - - /** - * Compile a "where fulltext" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - public function whereFullText(Builder $query, $where) - { - $language = $where['options']['language'] ?? 'english'; - - if (! in_array($language, $this->validFullTextLanguages())) { - $language = 'english'; - } - - $columns = collect($where['columns'])->map(function ($column) use ($language) { - return "to_tsvector('{$language}', {$this->wrap($column)})"; - })->implode(' || '); - - $mode = 'plainto_tsquery'; - - if (($where['options']['mode'] ?? []) === 'phrase') { - $mode = 'phraseto_tsquery'; - } - - if (($where['options']['mode'] ?? []) === 'websearch') { - $mode = 'websearch_to_tsquery'; - } - - return "({$columns}) @@ {$mode}('{$language}', {$this->parameter($where['value'])})"; - } - - /** - * Get an array of valid full text languages. - * - * @return array - */ - protected function validFullTextLanguages() - { - return [ - 'simple', - 'arabic', - 'danish', - 'dutch', - 'english', - 'finnish', - 'french', - 'german', - 'hungarian', - 'indonesian', - 'irish', - 'italian', - 'lithuanian', - 'nepali', - 'norwegian', - 'portuguese', - 'romanian', - 'russian', - 'spanish', - 'swedish', - 'tamil', - 'turkish', - ]; - } - - /** - * Compile the "select *" portion of the query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $columns - * @return string|null - */ - protected function compileColumns(Builder $query, $columns) - { - // If the query is actually performing an aggregating select, we will let that - // compiler handle the building of the select clauses, as it will need some - // more syntax that is best handled by that function to keep things neat. - if (! is_null($query->aggregate)) { - return; - } - - if (is_array($query->distinct)) { - $select = 'select distinct on ('.$this->columnize($query->distinct).') '; - } elseif ($query->distinct) { - $select = 'select distinct '; - } else { - $select = 'select '; - } - - return $select.$this->columnize($columns); - } - - /** - * Compile a "JSON contains" statement into SQL. - * - * @param string $column - * @param string $value - * @return string - */ - protected function compileJsonContains($column, $value) - { - $column = str_replace('->>', '->', $this->wrap($column)); - - return '('.$column.')::jsonb @> '.$value; - } - - /** - * Compile a "JSON contains key" statement into SQL. - * - * @param string $column - * @return string - */ - protected function compileJsonContainsKey($column) - { - $segments = explode('->', $column); - - $lastSegment = array_pop($segments); - - if (filter_var($lastSegment, FILTER_VALIDATE_INT) !== false) { - $i = $lastSegment; - } elseif (preg_match('/\[(-?[0-9]+)\]$/', $lastSegment, $matches)) { - $segments[] = Str::beforeLast($lastSegment, $matches[0]); - - $i = $matches[1]; - } - - $column = str_replace('->>', '->', $this->wrap(implode('->', $segments))); - - if (isset($i)) { - return vsprintf('case when %s then %s else false end', [ - 'jsonb_typeof(('.$column.")::jsonb) = 'array'", - 'jsonb_array_length(('.$column.')::jsonb) >= '.($i < 0 ? abs($i) : $i + 1), - ]); - } - - $key = "'".str_replace("'", "''", $lastSegment)."'"; - - return 'coalesce(('.$column.')::jsonb ?? '.$key.', false)'; - } - - /** - * Compile a "JSON length" statement into SQL. - * - * @param string $column - * @param string $operator - * @param string $value - * @return string - */ - protected function compileJsonLength($column, $operator, $value) - { - $column = str_replace('->>', '->', $this->wrap($column)); - - return 'jsonb_array_length(('.$column.')::jsonb) '.$operator.' '.$value; - } - - /** - * Compile a single having clause. - * - * @param array $having - * @return string - */ - protected function compileHaving(array $having) - { - if ($having['type'] === 'Bitwise') { - return $this->compileHavingBitwise($having); - } - - return parent::compileHaving($having); - } - - /** - * Compile a having clause involving a bitwise operator. - * - * @param array $having - * @return string - */ - protected function compileHavingBitwise($having) - { - $column = $this->wrap($having['column']); - - $parameter = $this->parameter($having['value']); - - return '('.$column.' '.$having['operator'].' '.$parameter.')::bool'; - } - - /** - * Compile the lock into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param bool|string $value - * @return string - */ - protected function compileLock(Builder $query, $value) - { - if (! is_string($value)) { - return $value ? 'for update' : 'for share'; - } - - return $value; - } - - /** - * Compile an insert ignore statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $values - * @return string - */ - public function compileInsertOrIgnore(Builder $query, array $values) - { - return $this->compileInsert($query, $values).' on conflict do nothing'; - } - - /** - * Compile an insert and get ID statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $values - * @param string $sequence - * @return string - */ - public function compileInsertGetId(Builder $query, $values, $sequence) - { - return $this->compileInsert($query, $values).' returning '.$this->wrap($sequence ?: 'id'); - } - - /** - * Compile an update statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $values - * @return string - */ - public function compileUpdate(Builder $query, array $values) - { - if (isset($query->joins) || isset($query->limit)) { - return $this->compileUpdateWithJoinsOrLimit($query, $values); - } - - return parent::compileUpdate($query, $values); - } - - /** - * Compile the columns for an update statement. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $values - * @return string - */ - protected function compileUpdateColumns(Builder $query, array $values) - { - return collect($values)->map(function ($value, $key) { - $column = last(explode('.', $key)); - - if ($this->isJsonSelector($key)) { - return $this->compileJsonUpdateColumn($column, $value); - } - - return $this->wrap($column).' = '.$this->parameter($value); - })->implode(', '); - } - - /** - * Compile an "upsert" statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $values - * @param array $uniqueBy - * @param array $update - * @return string - */ - public function compileUpsert(Builder $query, array $values, array $uniqueBy, array $update) - { - $sql = $this->compileInsert($query, $values); - - $sql .= ' on conflict ('.$this->columnize($uniqueBy).') do update set '; - - $columns = collect($update)->map(function ($value, $key) { - return is_numeric($key) - ? $this->wrap($value).' = '.$this->wrapValue('excluded').'.'.$this->wrap($value) - : $this->wrap($key).' = '.$this->parameter($value); - })->implode(', '); - - return $sql.$columns; - } - - /** - * Prepares a JSON column being updated using the JSONB_SET function. - * - * @param string $key - * @param mixed $value - * @return string - */ - protected function compileJsonUpdateColumn($key, $value) - { - $segments = explode('->', $key); - - $field = $this->wrap(array_shift($segments)); - - $path = "'{".implode(',', $this->wrapJsonPathAttributes($segments, '"'))."}'"; - - return "{$field} = jsonb_set({$field}::jsonb, {$path}, {$this->parameter($value)})"; - } - - /** - * Compile an update from statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $values - * @return string - */ - public function compileUpdateFrom(Builder $query, $values) - { - $table = $this->wrapTable($query->from); - - // Each one of the columns in the update statements needs to be wrapped in the - // keyword identifiers, also a place-holder needs to be created for each of - // the values in the list of bindings so we can make the sets statements. - $columns = $this->compileUpdateColumns($query, $values); - - $from = ''; - - if (isset($query->joins)) { - // When using Postgres, updates with joins list the joined tables in the from - // clause, which is different than other systems like MySQL. Here, we will - // compile out the tables that are joined and add them to a from clause. - $froms = collect($query->joins)->map(function ($join) { - return $this->wrapTable($join->table); - })->all(); - - if (count($froms) > 0) { - $from = ' from '.implode(', ', $froms); - } - } - - $where = $this->compileUpdateWheres($query); - - return trim("update {$table} set {$columns}{$from} {$where}"); - } - - /** - * Compile the additional where clauses for updates with joins. - * - * @param \Illuminate\Database\Query\Builder $query - * @return string - */ - protected function compileUpdateWheres(Builder $query) - { - $baseWheres = $this->compileWheres($query); - - if (! isset($query->joins)) { - return $baseWheres; - } - - // Once we compile the join constraints, we will either use them as the where - // clause or append them to the existing base where clauses. If we need to - // strip the leading boolean we will do so when using as the only where. - $joinWheres = $this->compileUpdateJoinWheres($query); - - if (trim($baseWheres) == '') { - return 'where '.$this->removeLeadingBoolean($joinWheres); - } - - return $baseWheres.' '.$joinWheres; - } - - /** - * Compile the "join" clause where clauses for an update. - * - * @param \Illuminate\Database\Query\Builder $query - * @return string - */ - protected function compileUpdateJoinWheres(Builder $query) - { - $joinWheres = []; - - // Here we will just loop through all of the join constraints and compile them - // all out then implode them. This should give us "where" like syntax after - // everything has been built and then we will join it to the real wheres. - foreach ($query->joins as $join) { - foreach ($join->wheres as $where) { - $method = "where{$where['type']}"; - - $joinWheres[] = $where['boolean'].' '.$this->$method($query, $where); - } - } - - return implode(' ', $joinWheres); - } - - /** - * Prepare the bindings for an update statement. - * - * @param array $bindings - * @param array $values - * @return array - */ - public function prepareBindingsForUpdateFrom(array $bindings, array $values) - { - $values = collect($values)->map(function ($value, $column) { - return is_array($value) || ($this->isJsonSelector($column) && ! $this->isExpression($value)) - ? json_encode($value) - : $value; - })->all(); - - $bindingsWithoutWhere = Arr::except($bindings, ['select', 'where']); - - return array_values( - array_merge($values, $bindings['where'], Arr::flatten($bindingsWithoutWhere)) - ); - } - - /** - * Compile an update statement with joins or limit into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $values - * @return string - */ - protected function compileUpdateWithJoinsOrLimit(Builder $query, array $values) - { - $table = $this->wrapTable($query->from); - - $columns = $this->compileUpdateColumns($query, $values); - - $alias = last(preg_split('/\s+as\s+/i', $query->from)); - - $selectSql = $this->compileSelect($query->select($alias.'.ctid')); - - return "update {$table} set {$columns} where {$this->wrap('ctid')} in ({$selectSql})"; - } - - /** - * Prepare the bindings for an update statement. - * - * @param array $bindings - * @param array $values - * @return array - */ - public function prepareBindingsForUpdate(array $bindings, array $values) - { - $values = collect($values)->map(function ($value, $column) { - return is_array($value) || ($this->isJsonSelector($column) && ! $this->isExpression($value)) - ? json_encode($value) - : $value; - })->all(); - - $cleanBindings = Arr::except($bindings, 'select'); - - return array_values( - array_merge($values, Arr::flatten($cleanBindings)) - ); - } - - /** - * Compile a delete statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @return string - */ - public function compileDelete(Builder $query) - { - if (isset($query->joins) || isset($query->limit)) { - return $this->compileDeleteWithJoinsOrLimit($query); - } - - return parent::compileDelete($query); - } - - /** - * Compile a delete statement with joins or limit into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @return string - */ - protected function compileDeleteWithJoinsOrLimit(Builder $query) - { - $table = $this->wrapTable($query->from); - - $alias = last(preg_split('/\s+as\s+/i', $query->from)); - - $selectSql = $this->compileSelect($query->select($alias.'.ctid')); - - return "delete from {$table} where {$this->wrap('ctid')} in ({$selectSql})"; - } - - /** - * Compile a truncate table statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @return array - */ - public function compileTruncate(Builder $query) - { - return ['truncate '.$this->wrapTable($query->from).' restart identity cascade' => []]; - } - - /** - * Wrap the given JSON selector. - * - * @param string $value - * @return string - */ - protected function wrapJsonSelector($value) - { - $path = explode('->', $value); - - $field = $this->wrapSegments(explode('.', array_shift($path))); - - $wrappedPath = $this->wrapJsonPathAttributes($path); - - $attribute = array_pop($wrappedPath); - - if (! empty($wrappedPath)) { - return $field.'->'.implode('->', $wrappedPath).'->>'.$attribute; - } - - return $field.'->>'.$attribute; - } - - /** - * Wrap the given JSON selector for boolean values. - * - * @param string $value - * @return string - */ - protected function wrapJsonBooleanSelector($value) - { - $selector = str_replace( - '->>', '->', - $this->wrapJsonSelector($value) - ); - - return '('.$selector.')::jsonb'; - } - - /** - * Wrap the given JSON boolean value. - * - * @param string $value - * @return string - */ - protected function wrapJsonBooleanValue($value) - { - return "'".$value."'::jsonb"; - } - - /** - * Wrap the attributes of the given JSON path. - * - * @param array $path - * @return array - */ - protected function wrapJsonPathAttributes($path) - { - $quote = func_num_args() === 2 ? func_get_arg(1) : "'"; - - return collect($path)->map(function ($attribute) { - return $this->parseJsonPathArrayKeys($attribute); - })->collapse()->map(function ($attribute) use ($quote) { - return filter_var($attribute, FILTER_VALIDATE_INT) !== false - ? $attribute - : $quote.$attribute.$quote; - })->all(); - } - - /** - * Parse the given JSON path attribute for array keys. - * - * @param string $attribute - * @return array - */ - protected function parseJsonPathArrayKeys($attribute) - { - if (preg_match('/(\[[^\]]+\])+$/', $attribute, $parts)) { - $key = Str::beforeLast($attribute, $parts[0]); - - preg_match_all('/\[([^\]]+)\]/', $parts[0], $keys); - - return collect([$key]) - ->merge($keys[1]) - ->diff('') - ->values() - ->all(); - } - - return [$attribute]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/SQLiteGrammar.php b/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/SQLiteGrammar.php deleted file mode 100755 index 81b890b8..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/SQLiteGrammar.php +++ /dev/null @@ -1,355 +0,0 @@ -', '<=', '>=', '<>', '!=', - 'like', 'not like', 'ilike', - '&', '|', '<<', '>>', - ]; - - /** - * Compile the lock into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param bool|string $value - * @return string - */ - protected function compileLock(Builder $query, $value) - { - return ''; - } - - /** - * Wrap a union subquery in parentheses. - * - * @param string $sql - * @return string - */ - protected function wrapUnion($sql) - { - return 'select * from ('.$sql.')'; - } - - /** - * Compile a "where date" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereDate(Builder $query, $where) - { - return $this->dateBasedWhere('%Y-%m-%d', $query, $where); - } - - /** - * Compile a "where day" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereDay(Builder $query, $where) - { - return $this->dateBasedWhere('%d', $query, $where); - } - - /** - * Compile a "where month" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereMonth(Builder $query, $where) - { - return $this->dateBasedWhere('%m', $query, $where); - } - - /** - * Compile a "where year" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereYear(Builder $query, $where) - { - return $this->dateBasedWhere('%Y', $query, $where); - } - - /** - * Compile a "where time" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereTime(Builder $query, $where) - { - return $this->dateBasedWhere('%H:%M:%S', $query, $where); - } - - /** - * Compile a date based where clause. - * - * @param string $type - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function dateBasedWhere($type, Builder $query, $where) - { - $value = $this->parameter($where['value']); - - return "strftime('{$type}', {$this->wrap($where['column'])}) {$where['operator']} cast({$value} as text)"; - } - - /** - * Compile a "JSON length" statement into SQL. - * - * @param string $column - * @param string $operator - * @param string $value - * @return string - */ - protected function compileJsonLength($column, $operator, $value) - { - [$field, $path] = $this->wrapJsonFieldAndPath($column); - - return 'json_array_length('.$field.$path.') '.$operator.' '.$value; - } - - /** - * Compile a "JSON contains key" statement into SQL. - * - * @param string $column - * @return string - */ - protected function compileJsonContainsKey($column) - { - [$field, $path] = $this->wrapJsonFieldAndPath($column); - - return 'json_type('.$field.$path.') is not null'; - } - - /** - * Compile an update statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $values - * @return string - */ - public function compileUpdate(Builder $query, array $values) - { - if (isset($query->joins) || isset($query->limit)) { - return $this->compileUpdateWithJoinsOrLimit($query, $values); - } - - return parent::compileUpdate($query, $values); - } - - /** - * Compile an insert ignore statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $values - * @return string - */ - public function compileInsertOrIgnore(Builder $query, array $values) - { - return Str::replaceFirst('insert', 'insert or ignore', $this->compileInsert($query, $values)); - } - - /** - * Compile the columns for an update statement. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $values - * @return string - */ - protected function compileUpdateColumns(Builder $query, array $values) - { - $jsonGroups = $this->groupJsonColumnsForUpdate($values); - - return collect($values)->reject(function ($value, $key) { - return $this->isJsonSelector($key); - })->merge($jsonGroups)->map(function ($value, $key) use ($jsonGroups) { - $column = last(explode('.', $key)); - - $value = isset($jsonGroups[$key]) ? $this->compileJsonPatch($column, $value) : $this->parameter($value); - - return $this->wrap($column).' = '.$value; - })->implode(', '); - } - - /** - * Compile an "upsert" statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $values - * @param array $uniqueBy - * @param array $update - * @return string - */ - public function compileUpsert(Builder $query, array $values, array $uniqueBy, array $update) - { - $sql = $this->compileInsert($query, $values); - - $sql .= ' on conflict ('.$this->columnize($uniqueBy).') do update set '; - - $columns = collect($update)->map(function ($value, $key) { - return is_numeric($key) - ? $this->wrap($value).' = '.$this->wrapValue('excluded').'.'.$this->wrap($value) - : $this->wrap($key).' = '.$this->parameter($value); - })->implode(', '); - - return $sql.$columns; - } - - /** - * Group the nested JSON columns. - * - * @param array $values - * @return array - */ - protected function groupJsonColumnsForUpdate(array $values) - { - $groups = []; - - foreach ($values as $key => $value) { - if ($this->isJsonSelector($key)) { - Arr::set($groups, str_replace('->', '.', Str::after($key, '.')), $value); - } - } - - return $groups; - } - - /** - * Compile a "JSON" patch statement into SQL. - * - * @param string $column - * @param mixed $value - * @return string - */ - protected function compileJsonPatch($column, $value) - { - return "json_patch(ifnull({$this->wrap($column)}, json('{}')), json({$this->parameter($value)}))"; - } - - /** - * Compile an update statement with joins or limit into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $values - * @return string - */ - protected function compileUpdateWithJoinsOrLimit(Builder $query, array $values) - { - $table = $this->wrapTable($query->from); - - $columns = $this->compileUpdateColumns($query, $values); - - $alias = last(preg_split('/\s+as\s+/i', $query->from)); - - $selectSql = $this->compileSelect($query->select($alias.'.rowid')); - - return "update {$table} set {$columns} where {$this->wrap('rowid')} in ({$selectSql})"; - } - - /** - * Prepare the bindings for an update statement. - * - * @param array $bindings - * @param array $values - * @return array - */ - public function prepareBindingsForUpdate(array $bindings, array $values) - { - $groups = $this->groupJsonColumnsForUpdate($values); - - $values = collect($values)->reject(function ($value, $key) { - return $this->isJsonSelector($key); - })->merge($groups)->map(function ($value) { - return is_array($value) ? json_encode($value) : $value; - })->all(); - - $cleanBindings = Arr::except($bindings, 'select'); - - return array_values( - array_merge($values, Arr::flatten($cleanBindings)) - ); - } - - /** - * Compile a delete statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @return string - */ - public function compileDelete(Builder $query) - { - if (isset($query->joins) || isset($query->limit)) { - return $this->compileDeleteWithJoinsOrLimit($query); - } - - return parent::compileDelete($query); - } - - /** - * Compile a delete statement with joins or limit into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @return string - */ - protected function compileDeleteWithJoinsOrLimit(Builder $query) - { - $table = $this->wrapTable($query->from); - - $alias = last(preg_split('/\s+as\s+/i', $query->from)); - - $selectSql = $this->compileSelect($query->select($alias.'.rowid')); - - return "delete from {$table} where {$this->wrap('rowid')} in ({$selectSql})"; - } - - /** - * Compile a truncate table statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @return array - */ - public function compileTruncate(Builder $query) - { - return [ - 'delete from sqlite_sequence where name = ?' => [$query->from], - 'delete from '.$this->wrapTable($query->from) => [], - ]; - } - - /** - * Wrap the given JSON selector. - * - * @param string $value - * @return string - */ - protected function wrapJsonSelector($value) - { - [$field, $path] = $this->wrapJsonFieldAndPath($value); - - return 'json_extract('.$field.$path.')'; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php b/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php deleted file mode 100755 index 97dff1aa..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php +++ /dev/null @@ -1,620 +0,0 @@ -', '<=', '>=', '!<', '!>', '<>', '!=', - 'like', 'not like', 'ilike', - '&', '&=', '|', '|=', '^', '^=', - ]; - - /** - * Compile a select query into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @return string - */ - public function compileSelect(Builder $query) - { - if (! $query->offset) { - return parent::compileSelect($query); - } - - if (is_null($query->columns)) { - $query->columns = ['*']; - } - - $components = $this->compileComponents($query); - - if (! empty($components['orders'])) { - return parent::compileSelect($query)." offset {$query->offset} rows fetch next {$query->limit} rows only"; - } - - // If an offset is present on the query, we will need to wrap the query in - // a big "ANSI" offset syntax block. This is very nasty compared to the - // other database systems but is necessary for implementing features. - return $this->compileAnsiOffset( - $query, $components - ); - } - - /** - * Compile the "select *" portion of the query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $columns - * @return string|null - */ - protected function compileColumns(Builder $query, $columns) - { - if (! is_null($query->aggregate)) { - return; - } - - $select = $query->distinct ? 'select distinct ' : 'select '; - - // If there is a limit on the query, but not an offset, we will add the top - // clause to the query, which serves as a "limit" type clause within the - // SQL Server system similar to the limit keywords available in MySQL. - if (is_numeric($query->limit) && $query->limit > 0 && $query->offset <= 0) { - $select .= 'top '.((int) $query->limit).' '; - } - - return $select.$this->columnize($columns); - } - - /** - * Compile the "from" portion of the query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param string $table - * @return string - */ - protected function compileFrom(Builder $query, $table) - { - $from = parent::compileFrom($query, $table); - - if (is_string($query->lock)) { - return $from.' '.$query->lock; - } - - if (! is_null($query->lock)) { - return $from.' with(rowlock,'.($query->lock ? 'updlock,' : '').'holdlock)'; - } - - return $from; - } - - /** - * {@inheritdoc} - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereBitwise(Builder $query, $where) - { - $value = $this->parameter($where['value']); - - $operator = str_replace('?', '??', $where['operator']); - - return '('.$this->wrap($where['column']).' '.$operator.' '.$value.') != 0'; - } - - /** - * Compile a "where date" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereDate(Builder $query, $where) - { - $value = $this->parameter($where['value']); - - return 'cast('.$this->wrap($where['column']).' as date) '.$where['operator'].' '.$value; - } - - /** - * Compile a "where time" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereTime(Builder $query, $where) - { - $value = $this->parameter($where['value']); - - return 'cast('.$this->wrap($where['column']).' as time) '.$where['operator'].' '.$value; - } - - /** - * Compile a "JSON contains" statement into SQL. - * - * @param string $column - * @param string $value - * @return string - */ - protected function compileJsonContains($column, $value) - { - [$field, $path] = $this->wrapJsonFieldAndPath($column); - - return $value.' in (select [value] from openjson('.$field.$path.'))'; - } - - /** - * Prepare the binding for a "JSON contains" statement. - * - * @param mixed $binding - * @return string - */ - public function prepareBindingForJsonContains($binding) - { - return is_bool($binding) ? json_encode($binding) : $binding; - } - - /** - * Compile a "JSON contains key" statement into SQL. - * - * @param string $column - * @return string - */ - protected function compileJsonContainsKey($column) - { - $segments = explode('->', $column); - - $lastSegment = array_pop($segments); - - if (preg_match('/\[([0-9]+)\]$/', $lastSegment, $matches)) { - $segments[] = Str::beforeLast($lastSegment, $matches[0]); - - $key = $matches[1]; - } else { - $key = "'".str_replace("'", "''", $lastSegment)."'"; - } - - [$field, $path] = $this->wrapJsonFieldAndPath(implode('->', $segments)); - - return $key.' in (select [key] from openjson('.$field.$path.'))'; - } - - /** - * Compile a "JSON length" statement into SQL. - * - * @param string $column - * @param string $operator - * @param string $value - * @return string - */ - protected function compileJsonLength($column, $operator, $value) - { - [$field, $path] = $this->wrapJsonFieldAndPath($column); - - return '(select count(*) from openjson('.$field.$path.')) '.$operator.' '.$value; - } - - /** - * Compile a "JSON value cast" statement into SQL. - * - * @param string $value - * @return string - */ - public function compileJsonValueCast($value) - { - return 'json_query('.$value.')'; - } - - /** - * Compile a single having clause. - * - * @param array $having - * @return string - */ - protected function compileHaving(array $having) - { - if ($having['type'] === 'Bitwise') { - return $this->compileHavingBitwise($having); - } - - return parent::compileHaving($having); - } - - /** - * Compile a having clause involving a bitwise operator. - * - * @param array $having - * @return string - */ - protected function compileHavingBitwise($having) - { - $column = $this->wrap($having['column']); - - $parameter = $this->parameter($having['value']); - - return '('.$column.' '.$having['operator'].' '.$parameter.') != 0'; - } - - /** - * Create a full ANSI offset clause for the query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $components - * @return string - */ - protected function compileAnsiOffset(Builder $query, $components) - { - // An ORDER BY clause is required to make this offset query work, so if one does - // not exist we'll just create a dummy clause to trick the database and so it - // does not complain about the queries for not having an "order by" clause. - if (empty($components['orders'])) { - $components['orders'] = 'order by (select 0)'; - } - - // We need to add the row number to the query so we can compare it to the offset - // and limit values given for the statements. So we will add an expression to - // the "select" that will give back the row numbers on each of the records. - $components['columns'] .= $this->compileOver($components['orders']); - - unset($components['orders']); - - if ($this->queryOrderContainsSubquery($query)) { - $query->bindings = $this->sortBindingsForSubqueryOrderBy($query); - } - - // Next we need to calculate the constraints that should be placed on the query - // to get the right offset and limit from our query but if there is no limit - // set we will just handle the offset only since that is all that matters. - $sql = $this->concatenate($components); - - return $this->compileTableExpression($sql, $query); - } - - /** - * Compile the over statement for a table expression. - * - * @param string $orderings - * @return string - */ - protected function compileOver($orderings) - { - return ", row_number() over ({$orderings}) as row_num"; - } - - /** - * Determine if the query's order by clauses contain a subquery. - * - * @param \Illuminate\Database\Query\Builder $query - * @return bool - */ - protected function queryOrderContainsSubquery($query) - { - if (! is_array($query->orders)) { - return false; - } - - return Arr::first($query->orders, function ($value) { - return $this->isExpression($value['column'] ?? null); - }, false) !== false; - } - - /** - * Move the order bindings to be after the "select" statement to account for an order by subquery. - * - * @param \Illuminate\Database\Query\Builder $query - * @return array - */ - protected function sortBindingsForSubqueryOrderBy($query) - { - return Arr::sort($query->bindings, function ($bindings, $key) { - return array_search($key, ['select', 'order', 'from', 'join', 'where', 'groupBy', 'having', 'union', 'unionOrder']); - }); - } - - /** - * Compile a common table expression for a query. - * - * @param string $sql - * @param \Illuminate\Database\Query\Builder $query - * @return string - */ - protected function compileTableExpression($sql, $query) - { - $constraint = $this->compileRowConstraint($query); - - return "select * from ({$sql}) as temp_table where row_num {$constraint} order by row_num"; - } - - /** - * Compile the limit / offset row constraint for a query. - * - * @param \Illuminate\Database\Query\Builder $query - * @return string - */ - protected function compileRowConstraint($query) - { - $start = (int) $query->offset + 1; - - if ($query->limit > 0) { - $finish = (int) $query->offset + (int) $query->limit; - - return "between {$start} and {$finish}"; - } - - return ">= {$start}"; - } - - /** - * Compile a delete statement without joins into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param string $table - * @param string $where - * @return string - */ - protected function compileDeleteWithoutJoins(Builder $query, $table, $where) - { - $sql = parent::compileDeleteWithoutJoins($query, $table, $where); - - return ! is_null($query->limit) && $query->limit > 0 && $query->offset <= 0 - ? Str::replaceFirst('delete', 'delete top ('.$query->limit.')', $sql) - : $sql; - } - - /** - * Compile the random statement into SQL. - * - * @param string $seed - * @return string - */ - public function compileRandom($seed) - { - return 'NEWID()'; - } - - /** - * Compile the "limit" portions of the query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param int $limit - * @return string - */ - protected function compileLimit(Builder $query, $limit) - { - return ''; - } - - /** - * Compile the "offset" portions of the query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param int $offset - * @return string - */ - protected function compileOffset(Builder $query, $offset) - { - return ''; - } - - /** - * Compile the lock into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param bool|string $value - * @return string - */ - protected function compileLock(Builder $query, $value) - { - return ''; - } - - /** - * Wrap a union subquery in parentheses. - * - * @param string $sql - * @return string - */ - protected function wrapUnion($sql) - { - return 'select * from ('.$sql.') as '.$this->wrapTable('temp_table'); - } - - /** - * Compile an exists statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @return string - */ - public function compileExists(Builder $query) - { - $existsQuery = clone $query; - - $existsQuery->columns = []; - - return $this->compileSelect($existsQuery->selectRaw('1 [exists]')->limit(1)); - } - - /** - * Compile an update statement with joins into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param string $table - * @param string $columns - * @param string $where - * @return string - */ - protected function compileUpdateWithJoins(Builder $query, $table, $columns, $where) - { - $alias = last(explode(' as ', $table)); - - $joins = $this->compileJoins($query, $query->joins); - - return "update {$alias} set {$columns} from {$table} {$joins} {$where}"; - } - - /** - * Compile an "upsert" statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $values - * @param array $uniqueBy - * @param array $update - * @return string - */ - public function compileUpsert(Builder $query, array $values, array $uniqueBy, array $update) - { - $columns = $this->columnize(array_keys(reset($values))); - - $sql = 'merge '.$this->wrapTable($query->from).' '; - - $parameters = collect($values)->map(function ($record) { - return '('.$this->parameterize($record).')'; - })->implode(', '); - - $sql .= 'using (values '.$parameters.') '.$this->wrapTable('laravel_source').' ('.$columns.') '; - - $on = collect($uniqueBy)->map(function ($column) use ($query) { - return $this->wrap('laravel_source.'.$column).' = '.$this->wrap($query->from.'.'.$column); - })->implode(' and '); - - $sql .= 'on '.$on.' '; - - if ($update) { - $update = collect($update)->map(function ($value, $key) { - return is_numeric($key) - ? $this->wrap($value).' = '.$this->wrap('laravel_source.'.$value) - : $this->wrap($key).' = '.$this->parameter($value); - })->implode(', '); - - $sql .= 'when matched then update set '.$update.' '; - } - - $sql .= 'when not matched then insert ('.$columns.') values ('.$columns.');'; - - return $sql; - } - - /** - * Prepare the bindings for an update statement. - * - * @param array $bindings - * @param array $values - * @return array - */ - public function prepareBindingsForUpdate(array $bindings, array $values) - { - $cleanBindings = Arr::except($bindings, 'select'); - - return array_values( - array_merge($values, Arr::flatten($cleanBindings)) - ); - } - - /** - * Compile the SQL statement to define a savepoint. - * - * @param string $name - * @return string - */ - public function compileSavepoint($name) - { - return 'SAVE TRANSACTION '.$name; - } - - /** - * Compile the SQL statement to execute a savepoint rollback. - * - * @param string $name - * @return string - */ - public function compileSavepointRollBack($name) - { - return 'ROLLBACK TRANSACTION '.$name; - } - - /** - * Get the format for database stored dates. - * - * @return string - */ - public function getDateFormat() - { - return 'Y-m-d H:i:s.v'; - } - - /** - * Wrap a single string in keyword identifiers. - * - * @param string $value - * @return string - */ - protected function wrapValue($value) - { - return $value === '*' ? $value : '['.str_replace(']', ']]', $value).']'; - } - - /** - * Wrap the given JSON selector. - * - * @param string $value - * @return string - */ - protected function wrapJsonSelector($value) - { - [$field, $path] = $this->wrapJsonFieldAndPath($value); - - return 'json_value('.$field.$path.')'; - } - - /** - * Wrap the given JSON boolean value. - * - * @param string $value - * @return string - */ - protected function wrapJsonBooleanValue($value) - { - return "'".$value."'"; - } - - /** - * Wrap a table in keyword identifiers. - * - * @param \Illuminate\Database\Query\Expression|string $table - * @return string - */ - public function wrapTable($table) - { - if (! $this->isExpression($table)) { - return $this->wrapTableValuedFunction(parent::wrapTable($table)); - } - - return $this->getValue($table); - } - - /** - * Wrap a table in keyword identifiers. - * - * @param string $table - * @return string - */ - protected function wrapTableValuedFunction($table) - { - if (preg_match('/^(.+?)(\(.*?\))]$/', $table, $matches) === 1) { - $table = $matches[1].']'.$matches[2]; - } - - return $table; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Query/JoinClause.php b/vendor/laravel/framework/src/Illuminate/Database/Query/JoinClause.php deleted file mode 100755 index 57d650a3..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Query/JoinClause.php +++ /dev/null @@ -1,146 +0,0 @@ -type = $type; - $this->table = $table; - $this->parentClass = get_class($parentQuery); - $this->parentGrammar = $parentQuery->getGrammar(); - $this->parentProcessor = $parentQuery->getProcessor(); - $this->parentConnection = $parentQuery->getConnection(); - - parent::__construct( - $this->parentConnection, $this->parentGrammar, $this->parentProcessor - ); - } - - /** - * Add an "on" clause to the join. - * - * On clauses can be chained, e.g. - * - * $join->on('contacts.user_id', '=', 'users.id') - * ->on('contacts.info_id', '=', 'info.id') - * - * will produce the following SQL: - * - * on `contacts`.`user_id` = `users`.`id` and `contacts`.`info_id` = `info`.`id` - * - * @param \Closure|string $first - * @param string|null $operator - * @param \Illuminate\Database\Query\Expression|string|null $second - * @param string $boolean - * @return $this - * - * @throws \InvalidArgumentException - */ - public function on($first, $operator = null, $second = null, $boolean = 'and') - { - if ($first instanceof Closure) { - return $this->whereNested($first, $boolean); - } - - return $this->whereColumn($first, $operator, $second, $boolean); - } - - /** - * Add an "or on" clause to the join. - * - * @param \Closure|string $first - * @param string|null $operator - * @param \Illuminate\Database\Query\Expression|string|null $second - * @return \Illuminate\Database\Query\JoinClause - */ - public function orOn($first, $operator = null, $second = null) - { - return $this->on($first, $operator, $second, 'or'); - } - - /** - * Get a new instance of the join clause builder. - * - * @return \Illuminate\Database\Query\JoinClause - */ - public function newQuery() - { - return new static($this->newParentQuery(), $this->type, $this->table); - } - - /** - * Create a new query instance for sub-query. - * - * @return \Illuminate\Database\Query\Builder - */ - protected function forSubQuery() - { - return $this->newParentQuery()->newQuery(); - } - - /** - * Create a new parent query instance. - * - * @return \Illuminate\Database\Query\Builder - */ - protected function newParentQuery() - { - $class = $this->parentClass; - - return new $class($this->parentConnection, $this->parentGrammar, $this->parentProcessor); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/MySqlProcessor.php b/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/MySqlProcessor.php deleted file mode 100644 index ce918385..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/MySqlProcessor.php +++ /dev/null @@ -1,19 +0,0 @@ -column_name; - }, $results); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/PostgresProcessor.php b/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/PostgresProcessor.php deleted file mode 100755 index 5956a8fb..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/PostgresProcessor.php +++ /dev/null @@ -1,45 +0,0 @@ -getConnection(); - - $connection->recordsHaveBeenModified(); - - $result = $connection->selectFromWriteConnection($sql, $values)[0]; - - $sequence = $sequence ?: 'id'; - - $id = is_object($result) ? $result->{$sequence} : $result[$sequence]; - - return is_numeric($id) ? (int) $id : $id; - } - - /** - * Process the results of a column listing query. - * - * @param array $results - * @return array - */ - public function processColumnListing($results) - { - return array_map(function ($result) { - return ((object) $result)->column_name; - }, $results); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/Processor.php b/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/Processor.php deleted file mode 100755 index 0069b436..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/Processor.php +++ /dev/null @@ -1,49 +0,0 @@ -getConnection()->insert($sql, $values); - - $id = $query->getConnection()->getPdo()->lastInsertId($sequence); - - return is_numeric($id) ? (int) $id : $id; - } - - /** - * Process the results of a column listing query. - * - * @param array $results - * @return array - */ - public function processColumnListing($results) - { - return $results; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/SQLiteProcessor.php b/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/SQLiteProcessor.php deleted file mode 100644 index 65da1dff..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/SQLiteProcessor.php +++ /dev/null @@ -1,19 +0,0 @@ -name; - }, $results); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/SqlServerProcessor.php b/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/SqlServerProcessor.php deleted file mode 100755 index 49476f09..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/SqlServerProcessor.php +++ /dev/null @@ -1,70 +0,0 @@ -getConnection(); - - $connection->insert($sql, $values); - - if ($connection->getConfig('odbc') === true) { - $id = $this->processInsertGetIdForOdbc($connection); - } else { - $id = $connection->getPdo()->lastInsertId(); - } - - return is_numeric($id) ? (int) $id : $id; - } - - /** - * Process an "insert get ID" query for ODBC. - * - * @param \Illuminate\Database\Connection $connection - * @return int - * - * @throws \Exception - */ - protected function processInsertGetIdForOdbc(Connection $connection) - { - $result = $connection->selectFromWriteConnection( - 'SELECT CAST(COALESCE(SCOPE_IDENTITY(), @@IDENTITY) AS int) AS insertid' - ); - - if (! $result) { - throw new Exception('Unable to retrieve lastInsertID for ODBC.'); - } - - $row = $result[0]; - - return is_object($row) ? $row->insertid : $row['insertid']; - } - - /** - * Process the results of a column listing query. - * - * @param array $results - * @return array - */ - public function processColumnListing($results) - { - return array_map(function ($result) { - return ((object) $result)->name; - }, $results); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/QueryException.php b/vendor/laravel/framework/src/Illuminate/Database/QueryException.php deleted file mode 100644 index 74e5a31a..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/QueryException.php +++ /dev/null @@ -1,79 +0,0 @@ -sql = $sql; - $this->bindings = $bindings; - $this->code = $previous->getCode(); - $this->message = $this->formatMessage($sql, $bindings, $previous); - - if ($previous instanceof PDOException) { - $this->errorInfo = $previous->errorInfo; - } - } - - /** - * Format the SQL error message. - * - * @param string $sql - * @param array $bindings - * @param \Throwable $previous - * @return string - */ - protected function formatMessage($sql, $bindings, Throwable $previous) - { - return $previous->getMessage().' (SQL: '.Str::replaceArray('?', $bindings, $sql).')'; - } - - /** - * Get the SQL for the query. - * - * @return string - */ - public function getSql() - { - return $this->sql; - } - - /** - * Get the bindings for the query. - * - * @return array - */ - public function getBindings() - { - return $this->bindings; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/README.md b/vendor/laravel/framework/src/Illuminate/Database/README.md deleted file mode 100755 index 90199360..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/README.md +++ /dev/null @@ -1,69 +0,0 @@ -## Illuminate Database - -The Illuminate Database component is a full database toolkit for PHP, providing an expressive query builder, ActiveRecord style ORM, and schema builder. It currently supports MySQL, Postgres, SQL Server, and SQLite. It also serves as the database layer of the Laravel PHP framework. - -### Usage Instructions - -First, create a new "Capsule" manager instance. Capsule aims to make configuring the library for usage outside of the Laravel framework as easy as possible. - -```PHP -use Illuminate\Database\Capsule\Manager as Capsule; - -$capsule = new Capsule; - -$capsule->addConnection([ - 'driver' => 'mysql', - 'host' => 'localhost', - 'database' => 'database', - 'username' => 'root', - 'password' => 'password', - 'charset' => 'utf8', - 'collation' => 'utf8_unicode_ci', - 'prefix' => '', -]); - -// Set the event dispatcher used by Eloquent models... (optional) -use Illuminate\Events\Dispatcher; -use Illuminate\Container\Container; -$capsule->setEventDispatcher(new Dispatcher(new Container)); - -// Make this Capsule instance available globally via static methods... (optional) -$capsule->setAsGlobal(); - -// Setup the Eloquent ORM... (optional; unless you've used setEventDispatcher()) -$capsule->bootEloquent(); -``` - -> `composer require "illuminate/events"` required when you need to use observers with Eloquent. - -Once the Capsule instance has been registered. You may use it like so: - -**Using The Query Builder** - -```PHP -$users = Capsule::table('users')->where('votes', '>', 100)->get(); -``` -Other core methods may be accessed directly from the Capsule in the same manner as from the DB facade: -```PHP -$results = Capsule::select('select * from users where id = ?', [1]); -``` - -**Using The Schema Builder** - -```PHP -Capsule::schema()->create('users', function ($table) { - $table->increments('id'); - $table->string('email')->unique(); - $table->timestamps(); -}); -``` - -**Using The Eloquent ORM** - -```PHP -class User extends Illuminate\Database\Eloquent\Model {} - -$users = User::where('votes', '>', 1)->get(); -``` - -For further documentation on using the various database facilities this library provides, consult the [Laravel framework documentation](https://laravel.com/docs). diff --git a/vendor/laravel/framework/src/Illuminate/Database/RecordsNotFoundException.php b/vendor/laravel/framework/src/Illuminate/Database/RecordsNotFoundException.php deleted file mode 100755 index 3e0d9557..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/RecordsNotFoundException.php +++ /dev/null @@ -1,10 +0,0 @@ -getForeignKeyConstraintsConfigurationValue(); - - if ($enableForeignKeyConstraints === null) { - return; - } - - $enableForeignKeyConstraints - ? $this->getSchemaBuilder()->enableForeignKeyConstraints() - : $this->getSchemaBuilder()->disableForeignKeyConstraints(); - } - - /** - * Get the default query grammar instance. - * - * @return \Illuminate\Database\Query\Grammars\SQLiteGrammar - */ - protected function getDefaultQueryGrammar() - { - return $this->withTablePrefix(new QueryGrammar); - } - - /** - * Get a schema builder instance for the connection. - * - * @return \Illuminate\Database\Schema\SQLiteBuilder - */ - public function getSchemaBuilder() - { - if (is_null($this->schemaGrammar)) { - $this->useDefaultSchemaGrammar(); - } - - return new SQLiteBuilder($this); - } - - /** - * Get the default schema grammar instance. - * - * @return \Illuminate\Database\Schema\Grammars\SQLiteGrammar - */ - protected function getDefaultSchemaGrammar() - { - return $this->withTablePrefix(new SchemaGrammar); - } - - /** - * Get the schema state for the connection. - * - * @param \Illuminate\Filesystem\Filesystem|null $files - * @param callable|null $processFactory - * - * @throws \RuntimeException - */ - public function getSchemaState(Filesystem $files = null, callable $processFactory = null) - { - return new SqliteSchemaState($this, $files, $processFactory); - } - - /** - * Get the default post processor instance. - * - * @return \Illuminate\Database\Query\Processors\SQLiteProcessor - */ - protected function getDefaultPostProcessor() - { - return new SQLiteProcessor; - } - - /** - * Get the Doctrine DBAL driver. - * - * @return \Illuminate\Database\PDO\SQLiteDriver - */ - protected function getDoctrineDriver() - { - return new SQLiteDriver; - } - - /** - * Get the database connection foreign key constraints configuration option. - * - * @return bool|null - */ - protected function getForeignKeyConstraintsConfigurationValue() - { - return $this->getConfig('foreign_key_constraints'); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/SQLiteDatabaseDoesNotExistException.php b/vendor/laravel/framework/src/Illuminate/Database/SQLiteDatabaseDoesNotExistException.php deleted file mode 100644 index fab5079e..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/SQLiteDatabaseDoesNotExistException.php +++ /dev/null @@ -1,28 +0,0 @@ -path = $path; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Schema/Blueprint.php b/vendor/laravel/framework/src/Illuminate/Database/Schema/Blueprint.php deleted file mode 100755 index ee0988d5..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Schema/Blueprint.php +++ /dev/null @@ -1,1819 +0,0 @@ -table = $table; - $this->prefix = $prefix; - - if (! is_null($callback)) { - $callback($this); - } - } - - /** - * Execute the blueprint against the database. - * - * @param \Illuminate\Database\Connection $connection - * @param \Illuminate\Database\Schema\Grammars\Grammar $grammar - * @return void - */ - public function build(Connection $connection, Grammar $grammar) - { - foreach ($this->toSql($connection, $grammar) as $statement) { - $connection->statement($statement); - } - } - - /** - * Get the raw SQL statements for the blueprint. - * - * @param \Illuminate\Database\Connection $connection - * @param \Illuminate\Database\Schema\Grammars\Grammar $grammar - * @return array - */ - public function toSql(Connection $connection, Grammar $grammar) - { - $this->addImpliedCommands($grammar); - - $statements = []; - - // Each type of command has a corresponding compiler function on the schema - // grammar which is used to build the necessary SQL statements to build - // the blueprint element, so we'll just call that compilers function. - $this->ensureCommandsAreValid($connection); - - foreach ($this->commands as $command) { - $method = 'compile'.ucfirst($command->name); - - if (method_exists($grammar, $method) || $grammar::hasMacro($method)) { - if (! is_null($sql = $grammar->$method($this, $command, $connection))) { - $statements = array_merge($statements, (array) $sql); - } - } - } - - return $statements; - } - - /** - * Ensure the commands on the blueprint are valid for the connection type. - * - * @param \Illuminate\Database\Connection $connection - * @return void - * - * @throws \BadMethodCallException - */ - protected function ensureCommandsAreValid(Connection $connection) - { - if ($connection instanceof SQLiteConnection) { - if ($this->commandsNamed(['dropColumn', 'renameColumn'])->count() > 1 - && ! $connection->usingNativeSchemaOperations()) { - throw new BadMethodCallException( - "SQLite doesn't support multiple calls to dropColumn / renameColumn in a single modification." - ); - } - - if ($this->commandsNamed(['dropForeign'])->count() > 0) { - throw new BadMethodCallException( - "SQLite doesn't support dropping foreign keys (you would need to re-create the table)." - ); - } - } - } - - /** - * Get all of the commands matching the given names. - * - * @param array $names - * @return \Illuminate\Support\Collection - */ - protected function commandsNamed(array $names) - { - return collect($this->commands)->filter(function ($command) use ($names) { - return in_array($command->name, $names); - }); - } - - /** - * Add the commands that are implied by the blueprint's state. - * - * @param \Illuminate\Database\Schema\Grammars\Grammar $grammar - * @return void - */ - protected function addImpliedCommands(Grammar $grammar) - { - if (count($this->getAddedColumns()) > 0 && ! $this->creating()) { - array_unshift($this->commands, $this->createCommand('add')); - } - - if (count($this->getChangedColumns()) > 0 && ! $this->creating()) { - array_unshift($this->commands, $this->createCommand('change')); - } - - $this->addFluentIndexes(); - - $this->addFluentCommands($grammar); - } - - /** - * Add the index commands fluently specified on columns. - * - * @return void - */ - protected function addFluentIndexes() - { - foreach ($this->columns as $column) { - foreach (['primary', 'unique', 'index', 'fulltext', 'fullText', 'spatialIndex'] as $index) { - // If the index has been specified on the given column, but is simply equal - // to "true" (boolean), no name has been specified for this index so the - // index method can be called without a name and it will generate one. - if ($column->{$index} === true) { - $this->{$index}($column->name); - $column->{$index} = false; - - continue 2; - } - - // If the index has been specified on the given column, and it has a string - // value, we'll go ahead and call the index method and pass the name for - // the index since the developer specified the explicit name for this. - elseif (isset($column->{$index})) { - $this->{$index}($column->name, $column->{$index}); - $column->{$index} = false; - - continue 2; - } - } - } - } - - /** - * Add the fluent commands specified on any columns. - * - * @param \Illuminate\Database\Schema\Grammars\Grammar $grammar - * @return void - */ - public function addFluentCommands(Grammar $grammar) - { - foreach ($this->columns as $column) { - foreach ($grammar->getFluentCommands() as $commandName) { - $attributeName = lcfirst($commandName); - - if (! isset($column->{$attributeName})) { - continue; - } - - $value = $column->{$attributeName}; - - $this->addCommand( - $commandName, compact('value', 'column') - ); - } - } - } - - /** - * Determine if the blueprint has a create command. - * - * @return bool - */ - public function creating() - { - return collect($this->commands)->contains(function ($command) { - return $command->name === 'create'; - }); - } - - /** - * Indicate that the table needs to be created. - * - * @return \Illuminate\Support\Fluent - */ - public function create() - { - return $this->addCommand('create'); - } - - /** - * Indicate that the table needs to be temporary. - * - * @return void - */ - public function temporary() - { - $this->temporary = true; - } - - /** - * Indicate that the table should be dropped. - * - * @return \Illuminate\Support\Fluent - */ - public function drop() - { - return $this->addCommand('drop'); - } - - /** - * Indicate that the table should be dropped if it exists. - * - * @return \Illuminate\Support\Fluent - */ - public function dropIfExists() - { - return $this->addCommand('dropIfExists'); - } - - /** - * Indicate that the given columns should be dropped. - * - * @param array|mixed $columns - * @return \Illuminate\Support\Fluent - */ - public function dropColumn($columns) - { - $columns = is_array($columns) ? $columns : func_get_args(); - - return $this->addCommand('dropColumn', compact('columns')); - } - - /** - * Indicate that the given columns should be renamed. - * - * @param string $from - * @param string $to - * @return \Illuminate\Support\Fluent - */ - public function renameColumn($from, $to) - { - return $this->addCommand('renameColumn', compact('from', 'to')); - } - - /** - * Indicate that the given primary key should be dropped. - * - * @param string|array|null $index - * @return \Illuminate\Support\Fluent - */ - public function dropPrimary($index = null) - { - return $this->dropIndexCommand('dropPrimary', 'primary', $index); - } - - /** - * Indicate that the given unique key should be dropped. - * - * @param string|array $index - * @return \Illuminate\Support\Fluent - */ - public function dropUnique($index) - { - return $this->dropIndexCommand('dropUnique', 'unique', $index); - } - - /** - * Indicate that the given index should be dropped. - * - * @param string|array $index - * @return \Illuminate\Support\Fluent - */ - public function dropIndex($index) - { - return $this->dropIndexCommand('dropIndex', 'index', $index); - } - - /** - * Indicate that the given fulltext index should be dropped. - * - * @param string|array $index - * @return \Illuminate\Support\Fluent - */ - public function dropFullText($index) - { - return $this->dropIndexCommand('dropFullText', 'fulltext', $index); - } - - /** - * Indicate that the given spatial index should be dropped. - * - * @param string|array $index - * @return \Illuminate\Support\Fluent - */ - public function dropSpatialIndex($index) - { - return $this->dropIndexCommand('dropSpatialIndex', 'spatialIndex', $index); - } - - /** - * Indicate that the given foreign key should be dropped. - * - * @param string|array $index - * @return \Illuminate\Support\Fluent - */ - public function dropForeign($index) - { - return $this->dropIndexCommand('dropForeign', 'foreign', $index); - } - - /** - * Indicate that the given column and foreign key should be dropped. - * - * @param string $column - * @return \Illuminate\Support\Fluent - */ - public function dropConstrainedForeignId($column) - { - $this->dropForeign([$column]); - - return $this->dropColumn($column); - } - - /** - * Indicate that the given foreign key should be dropped. - * - * @param \Illuminate\Database\Eloquent\Model|string $model - * @param string|null $column - * @return \Illuminate\Support\Fluent - */ - public function dropForeignIdFor($model, $column = null) - { - if (is_string($model)) { - $model = new $model; - } - - return $this->dropForeign([$column ?: $model->getForeignKey()]); - } - - /** - * Indicate that the given foreign key should be dropped. - * - * @param \Illuminate\Database\Eloquent\Model|string $model - * @param string|null $column - * @return \Illuminate\Support\Fluent - */ - public function dropConstrainedForeignIdFor($model, $column = null) - { - if (is_string($model)) { - $model = new $model; - } - - return $this->dropConstrainedForeignId($column ?: $model->getForeignKey()); - } - - /** - * Indicate that the given indexes should be renamed. - * - * @param string $from - * @param string $to - * @return \Illuminate\Support\Fluent - */ - public function renameIndex($from, $to) - { - return $this->addCommand('renameIndex', compact('from', 'to')); - } - - /** - * Indicate that the timestamp columns should be dropped. - * - * @return void - */ - public function dropTimestamps() - { - $this->dropColumn('created_at', 'updated_at'); - } - - /** - * Indicate that the timestamp columns should be dropped. - * - * @return void - */ - public function dropTimestampsTz() - { - $this->dropTimestamps(); - } - - /** - * Indicate that the soft delete column should be dropped. - * - * @param string $column - * @return void - */ - public function dropSoftDeletes($column = 'deleted_at') - { - $this->dropColumn($column); - } - - /** - * Indicate that the soft delete column should be dropped. - * - * @param string $column - * @return void - */ - public function dropSoftDeletesTz($column = 'deleted_at') - { - $this->dropSoftDeletes($column); - } - - /** - * Indicate that the remember token column should be dropped. - * - * @return void - */ - public function dropRememberToken() - { - $this->dropColumn('remember_token'); - } - - /** - * Indicate that the polymorphic columns should be dropped. - * - * @param string $name - * @param string|null $indexName - * @return void - */ - public function dropMorphs($name, $indexName = null) - { - $this->dropIndex($indexName ?: $this->createIndexName('index', ["{$name}_type", "{$name}_id"])); - - $this->dropColumn("{$name}_type", "{$name}_id"); - } - - /** - * Rename the table to a given name. - * - * @param string $to - * @return \Illuminate\Support\Fluent - */ - public function rename($to) - { - return $this->addCommand('rename', compact('to')); - } - - /** - * Specify the primary key(s) for the table. - * - * @param string|array $columns - * @param string|null $name - * @param string|null $algorithm - * @return \Illuminate\Database\Schema\IndexDefinition - */ - public function primary($columns, $name = null, $algorithm = null) - { - return $this->indexCommand('primary', $columns, $name, $algorithm); - } - - /** - * Specify a unique index for the table. - * - * @param string|array $columns - * @param string|null $name - * @param string|null $algorithm - * @return \Illuminate\Database\Schema\IndexDefinition - */ - public function unique($columns, $name = null, $algorithm = null) - { - return $this->indexCommand('unique', $columns, $name, $algorithm); - } - - /** - * Specify an index for the table. - * - * @param string|array $columns - * @param string|null $name - * @param string|null $algorithm - * @return \Illuminate\Database\Schema\IndexDefinition - */ - public function index($columns, $name = null, $algorithm = null) - { - return $this->indexCommand('index', $columns, $name, $algorithm); - } - - /** - * Specify an fulltext for the table. - * - * @param string|array $columns - * @param string|null $name - * @param string|null $algorithm - * @return \Illuminate\Database\Schema\IndexDefinition - */ - public function fullText($columns, $name = null, $algorithm = null) - { - return $this->indexCommand('fulltext', $columns, $name, $algorithm); - } - - /** - * Specify a spatial index for the table. - * - * @param string|array $columns - * @param string|null $name - * @return \Illuminate\Database\Schema\IndexDefinition - */ - public function spatialIndex($columns, $name = null) - { - return $this->indexCommand('spatialIndex', $columns, $name); - } - - /** - * Specify a raw index for the table. - * - * @param string $expression - * @param string $name - * @return \Illuminate\Database\Schema\IndexDefinition - */ - public function rawIndex($expression, $name) - { - return $this->index([new Expression($expression)], $name); - } - - /** - * Specify a foreign key for the table. - * - * @param string|array $columns - * @param string|null $name - * @return \Illuminate\Database\Schema\ForeignKeyDefinition - */ - public function foreign($columns, $name = null) - { - $command = new ForeignKeyDefinition( - $this->indexCommand('foreign', $columns, $name)->getAttributes() - ); - - $this->commands[count($this->commands) - 1] = $command; - - return $command; - } - - /** - * Create a new auto-incrementing big integer (8-byte) column on the table. - * - * @param string $column - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function id($column = 'id') - { - return $this->bigIncrements($column); - } - - /** - * Create a new auto-incrementing integer (4-byte) column on the table. - * - * @param string $column - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function increments($column) - { - return $this->unsignedInteger($column, true); - } - - /** - * Create a new auto-incrementing integer (4-byte) column on the table. - * - * @param string $column - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function integerIncrements($column) - { - return $this->unsignedInteger($column, true); - } - - /** - * Create a new auto-incrementing tiny integer (1-byte) column on the table. - * - * @param string $column - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function tinyIncrements($column) - { - return $this->unsignedTinyInteger($column, true); - } - - /** - * Create a new auto-incrementing small integer (2-byte) column on the table. - * - * @param string $column - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function smallIncrements($column) - { - return $this->unsignedSmallInteger($column, true); - } - - /** - * Create a new auto-incrementing medium integer (3-byte) column on the table. - * - * @param string $column - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function mediumIncrements($column) - { - return $this->unsignedMediumInteger($column, true); - } - - /** - * Create a new auto-incrementing big integer (8-byte) column on the table. - * - * @param string $column - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function bigIncrements($column) - { - return $this->unsignedBigInteger($column, true); - } - - /** - * Create a new char column on the table. - * - * @param string $column - * @param int|null $length - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function char($column, $length = null) - { - $length = ! is_null($length) ? $length : Builder::$defaultStringLength; - - return $this->addColumn('char', $column, compact('length')); - } - - /** - * Create a new string column on the table. - * - * @param string $column - * @param int|null $length - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function string($column, $length = null) - { - $length = $length ?: Builder::$defaultStringLength; - - return $this->addColumn('string', $column, compact('length')); - } - - /** - * Create a new tiny text column on the table. - * - * @param string $column - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function tinyText($column) - { - return $this->addColumn('tinyText', $column); - } - - /** - * Create a new text column on the table. - * - * @param string $column - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function text($column) - { - return $this->addColumn('text', $column); - } - - /** - * Create a new medium text column on the table. - * - * @param string $column - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function mediumText($column) - { - return $this->addColumn('mediumText', $column); - } - - /** - * Create a new long text column on the table. - * - * @param string $column - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function longText($column) - { - return $this->addColumn('longText', $column); - } - - /** - * Create a new integer (4-byte) column on the table. - * - * @param string $column - * @param bool $autoIncrement - * @param bool $unsigned - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function integer($column, $autoIncrement = false, $unsigned = false) - { - return $this->addColumn('integer', $column, compact('autoIncrement', 'unsigned')); - } - - /** - * Create a new tiny integer (1-byte) column on the table. - * - * @param string $column - * @param bool $autoIncrement - * @param bool $unsigned - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function tinyInteger($column, $autoIncrement = false, $unsigned = false) - { - return $this->addColumn('tinyInteger', $column, compact('autoIncrement', 'unsigned')); - } - - /** - * Create a new small integer (2-byte) column on the table. - * - * @param string $column - * @param bool $autoIncrement - * @param bool $unsigned - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function smallInteger($column, $autoIncrement = false, $unsigned = false) - { - return $this->addColumn('smallInteger', $column, compact('autoIncrement', 'unsigned')); - } - - /** - * Create a new medium integer (3-byte) column on the table. - * - * @param string $column - * @param bool $autoIncrement - * @param bool $unsigned - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function mediumInteger($column, $autoIncrement = false, $unsigned = false) - { - return $this->addColumn('mediumInteger', $column, compact('autoIncrement', 'unsigned')); - } - - /** - * Create a new big integer (8-byte) column on the table. - * - * @param string $column - * @param bool $autoIncrement - * @param bool $unsigned - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function bigInteger($column, $autoIncrement = false, $unsigned = false) - { - return $this->addColumn('bigInteger', $column, compact('autoIncrement', 'unsigned')); - } - - /** - * Create a new unsigned integer (4-byte) column on the table. - * - * @param string $column - * @param bool $autoIncrement - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function unsignedInteger($column, $autoIncrement = false) - { - return $this->integer($column, $autoIncrement, true); - } - - /** - * Create a new unsigned tiny integer (1-byte) column on the table. - * - * @param string $column - * @param bool $autoIncrement - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function unsignedTinyInteger($column, $autoIncrement = false) - { - return $this->tinyInteger($column, $autoIncrement, true); - } - - /** - * Create a new unsigned small integer (2-byte) column on the table. - * - * @param string $column - * @param bool $autoIncrement - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function unsignedSmallInteger($column, $autoIncrement = false) - { - return $this->smallInteger($column, $autoIncrement, true); - } - - /** - * Create a new unsigned medium integer (3-byte) column on the table. - * - * @param string $column - * @param bool $autoIncrement - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function unsignedMediumInteger($column, $autoIncrement = false) - { - return $this->mediumInteger($column, $autoIncrement, true); - } - - /** - * Create a new unsigned big integer (8-byte) column on the table. - * - * @param string $column - * @param bool $autoIncrement - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function unsignedBigInteger($column, $autoIncrement = false) - { - return $this->bigInteger($column, $autoIncrement, true); - } - - /** - * Create a new unsigned big integer (8-byte) column on the table. - * - * @param string $column - * @return \Illuminate\Database\Schema\ForeignIdColumnDefinition - */ - public function foreignId($column) - { - return $this->addColumnDefinition(new ForeignIdColumnDefinition($this, [ - 'type' => 'bigInteger', - 'name' => $column, - 'autoIncrement' => false, - 'unsigned' => true, - ])); - } - - /** - * Create a foreign ID column for the given model. - * - * @param \Illuminate\Database\Eloquent\Model|string $model - * @param string|null $column - * @return \Illuminate\Database\Schema\ForeignIdColumnDefinition - */ - public function foreignIdFor($model, $column = null) - { - if (is_string($model)) { - $model = new $model; - } - - return $model->getKeyType() === 'int' && $model->getIncrementing() - ? $this->foreignId($column ?: $model->getForeignKey()) - : $this->foreignUuid($column ?: $model->getForeignKey()); - } - - /** - * Create a new float column on the table. - * - * @param string $column - * @param int $total - * @param int $places - * @param bool $unsigned - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function float($column, $total = 8, $places = 2, $unsigned = false) - { - return $this->addColumn('float', $column, compact('total', 'places', 'unsigned')); - } - - /** - * Create a new double column on the table. - * - * @param string $column - * @param int|null $total - * @param int|null $places - * @param bool $unsigned - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function double($column, $total = null, $places = null, $unsigned = false) - { - return $this->addColumn('double', $column, compact('total', 'places', 'unsigned')); - } - - /** - * Create a new decimal column on the table. - * - * @param string $column - * @param int $total - * @param int $places - * @param bool $unsigned - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function decimal($column, $total = 8, $places = 2, $unsigned = false) - { - return $this->addColumn('decimal', $column, compact('total', 'places', 'unsigned')); - } - - /** - * Create a new unsigned float column on the table. - * - * @param string $column - * @param int $total - * @param int $places - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function unsignedFloat($column, $total = 8, $places = 2) - { - return $this->float($column, $total, $places, true); - } - - /** - * Create a new unsigned double column on the table. - * - * @param string $column - * @param int $total - * @param int $places - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function unsignedDouble($column, $total = null, $places = null) - { - return $this->double($column, $total, $places, true); - } - - /** - * Create a new unsigned decimal column on the table. - * - * @param string $column - * @param int $total - * @param int $places - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function unsignedDecimal($column, $total = 8, $places = 2) - { - return $this->decimal($column, $total, $places, true); - } - - /** - * Create a new boolean column on the table. - * - * @param string $column - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function boolean($column) - { - return $this->addColumn('boolean', $column); - } - - /** - * Create a new enum column on the table. - * - * @param string $column - * @param array $allowed - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function enum($column, array $allowed) - { - return $this->addColumn('enum', $column, compact('allowed')); - } - - /** - * Create a new set column on the table. - * - * @param string $column - * @param array $allowed - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function set($column, array $allowed) - { - return $this->addColumn('set', $column, compact('allowed')); - } - - /** - * Create a new json column on the table. - * - * @param string $column - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function json($column) - { - return $this->addColumn('json', $column); - } - - /** - * Create a new jsonb column on the table. - * - * @param string $column - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function jsonb($column) - { - return $this->addColumn('jsonb', $column); - } - - /** - * Create a new date column on the table. - * - * @param string $column - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function date($column) - { - return $this->addColumn('date', $column); - } - - /** - * Create a new date-time column on the table. - * - * @param string $column - * @param int|null $precision - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function dateTime($column, $precision = 0) - { - return $this->addColumn('dateTime', $column, compact('precision')); - } - - /** - * Create a new date-time column (with time zone) on the table. - * - * @param string $column - * @param int|null $precision - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function dateTimeTz($column, $precision = 0) - { - return $this->addColumn('dateTimeTz', $column, compact('precision')); - } - - /** - * Create a new time column on the table. - * - * @param string $column - * @param int|null $precision - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function time($column, $precision = 0) - { - return $this->addColumn('time', $column, compact('precision')); - } - - /** - * Create a new time column (with time zone) on the table. - * - * @param string $column - * @param int|null $precision - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function timeTz($column, $precision = 0) - { - return $this->addColumn('timeTz', $column, compact('precision')); - } - - /** - * Create a new timestamp column on the table. - * - * @param string $column - * @param int|null $precision - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function timestamp($column, $precision = 0) - { - return $this->addColumn('timestamp', $column, compact('precision')); - } - - /** - * Create a new timestamp (with time zone) column on the table. - * - * @param string $column - * @param int|null $precision - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function timestampTz($column, $precision = 0) - { - return $this->addColumn('timestampTz', $column, compact('precision')); - } - - /** - * Add nullable creation and update timestamps to the table. - * - * @param int|null $precision - * @return void - */ - public function timestamps($precision = 0) - { - $this->timestamp('created_at', $precision)->nullable(); - - $this->timestamp('updated_at', $precision)->nullable(); - } - - /** - * Add nullable creation and update timestamps to the table. - * - * Alias for self::timestamps(). - * - * @param int|null $precision - * @return void - */ - public function nullableTimestamps($precision = 0) - { - $this->timestamps($precision); - } - - /** - * Add creation and update timestampTz columns to the table. - * - * @param int|null $precision - * @return void - */ - public function timestampsTz($precision = 0) - { - $this->timestampTz('created_at', $precision)->nullable(); - - $this->timestampTz('updated_at', $precision)->nullable(); - } - - /** - * Add a "deleted at" timestamp for the table. - * - * @param string $column - * @param int|null $precision - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function softDeletes($column = 'deleted_at', $precision = 0) - { - return $this->timestamp($column, $precision)->nullable(); - } - - /** - * Add a "deleted at" timestampTz for the table. - * - * @param string $column - * @param int|null $precision - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function softDeletesTz($column = 'deleted_at', $precision = 0) - { - return $this->timestampTz($column, $precision)->nullable(); - } - - /** - * Create a new year column on the table. - * - * @param string $column - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function year($column) - { - return $this->addColumn('year', $column); - } - - /** - * Create a new binary column on the table. - * - * @param string $column - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function binary($column) - { - return $this->addColumn('binary', $column); - } - - /** - * Create a new UUID column on the table. - * - * @param string $column - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function uuid($column = 'uuid') - { - return $this->addColumn('uuid', $column); - } - - /** - * Create a new UUID column on the table with a foreign key constraint. - * - * @param string $column - * @return \Illuminate\Database\Schema\ForeignIdColumnDefinition - */ - public function foreignUuid($column) - { - return $this->addColumnDefinition(new ForeignIdColumnDefinition($this, [ - 'type' => 'uuid', - 'name' => $column, - ])); - } - - /** - * Create a new ULID column on the table. - * - * @param string $column - * @param int|null $length - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function ulid($column = 'uuid', $length = 26) - { - return $this->char($column, $length); - } - - /** - * Create a new ULID column on the table with a foreign key constraint. - * - * @param string $column - * @param int|null $length - * @return \Illuminate\Database\Schema\ForeignIdColumnDefinition - */ - public function foreignUlid($column, $length = 26) - { - return $this->addColumnDefinition(new ForeignIdColumnDefinition($this, [ - 'type' => 'char', - 'name' => $column, - 'length' => $length, - ])); - } - - /** - * Create a new IP address column on the table. - * - * @param string $column - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function ipAddress($column = 'ip_address') - { - return $this->addColumn('ipAddress', $column); - } - - /** - * Create a new MAC address column on the table. - * - * @param string $column - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function macAddress($column = 'mac_address') - { - return $this->addColumn('macAddress', $column); - } - - /** - * Create a new geometry column on the table. - * - * @param string $column - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function geometry($column) - { - return $this->addColumn('geometry', $column); - } - - /** - * Create a new point column on the table. - * - * @param string $column - * @param int|null $srid - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function point($column, $srid = null) - { - return $this->addColumn('point', $column, compact('srid')); - } - - /** - * Create a new linestring column on the table. - * - * @param string $column - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function lineString($column) - { - return $this->addColumn('linestring', $column); - } - - /** - * Create a new polygon column on the table. - * - * @param string $column - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function polygon($column) - { - return $this->addColumn('polygon', $column); - } - - /** - * Create a new geometrycollection column on the table. - * - * @param string $column - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function geometryCollection($column) - { - return $this->addColumn('geometrycollection', $column); - } - - /** - * Create a new multipoint column on the table. - * - * @param string $column - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function multiPoint($column) - { - return $this->addColumn('multipoint', $column); - } - - /** - * Create a new multilinestring column on the table. - * - * @param string $column - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function multiLineString($column) - { - return $this->addColumn('multilinestring', $column); - } - - /** - * Create a new multipolygon column on the table. - * - * @param string $column - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function multiPolygon($column) - { - return $this->addColumn('multipolygon', $column); - } - - /** - * Create a new multipolygon column on the table. - * - * @param string $column - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function multiPolygonZ($column) - { - return $this->addColumn('multipolygonz', $column); - } - - /** - * Create a new generated, computed column on the table. - * - * @param string $column - * @param string $expression - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function computed($column, $expression) - { - return $this->addColumn('computed', $column, compact('expression')); - } - - /** - * Add the proper columns for a polymorphic table. - * - * @param string $name - * @param string|null $indexName - * @return void - */ - public function morphs($name, $indexName = null) - { - if (Builder::$defaultMorphKeyType === 'uuid') { - $this->uuidMorphs($name, $indexName); - } elseif (Builder::$defaultMorphKeyType === 'ulid') { - $this->ulidMorphs($name, $indexName); - } else { - $this->numericMorphs($name, $indexName); - } - } - - /** - * Add nullable columns for a polymorphic table. - * - * @param string $name - * @param string|null $indexName - * @return void - */ - public function nullableMorphs($name, $indexName = null) - { - if (Builder::$defaultMorphKeyType === 'uuid') { - $this->nullableUuidMorphs($name, $indexName); - } elseif (Builder::$defaultMorphKeyType === 'ulid') { - $this->nullableUlidMorphs($name, $indexName); - } else { - $this->nullableNumericMorphs($name, $indexName); - } - } - - /** - * Add the proper columns for a polymorphic table using numeric IDs (incremental). - * - * @param string $name - * @param string|null $indexName - * @return void - */ - public function numericMorphs($name, $indexName = null) - { - $this->string("{$name}_type"); - - $this->unsignedBigInteger("{$name}_id"); - - $this->index(["{$name}_type", "{$name}_id"], $indexName); - } - - /** - * Add nullable columns for a polymorphic table using numeric IDs (incremental). - * - * @param string $name - * @param string|null $indexName - * @return void - */ - public function nullableNumericMorphs($name, $indexName = null) - { - $this->string("{$name}_type")->nullable(); - - $this->unsignedBigInteger("{$name}_id")->nullable(); - - $this->index(["{$name}_type", "{$name}_id"], $indexName); - } - - /** - * Add the proper columns for a polymorphic table using UUIDs. - * - * @param string $name - * @param string|null $indexName - * @return void - */ - public function uuidMorphs($name, $indexName = null) - { - $this->string("{$name}_type"); - - $this->uuid("{$name}_id"); - - $this->index(["{$name}_type", "{$name}_id"], $indexName); - } - - /** - * Add nullable columns for a polymorphic table using UUIDs. - * - * @param string $name - * @param string|null $indexName - * @return void - */ - public function nullableUuidMorphs($name, $indexName = null) - { - $this->string("{$name}_type")->nullable(); - - $this->uuid("{$name}_id")->nullable(); - - $this->index(["{$name}_type", "{$name}_id"], $indexName); - } - - /** - * Add the proper columns for a polymorphic table using ULIDs. - * - * @param string $name - * @param string|null $indexName - * @return void - */ - public function ulidMorphs($name, $indexName = null) - { - $this->string("{$name}_type"); - - $this->ulid("{$name}_id"); - - $this->index(["{$name}_type", "{$name}_id"], $indexName); - } - - /** - * Add nullable columns for a polymorphic table using ULIDs. - * - * @param string $name - * @param string|null $indexName - * @return void - */ - public function nullableUlidMorphs($name, $indexName = null) - { - $this->string("{$name}_type")->nullable(); - - $this->ulid("{$name}_id")->nullable(); - - $this->index(["{$name}_type", "{$name}_id"], $indexName); - } - - /** - * Adds the `remember_token` column to the table. - * - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function rememberToken() - { - return $this->string('remember_token', 100)->nullable(); - } - - /** - * Add a comment to the table. - * - * @param string $comment - * @return \Illuminate\Support\Fluent - */ - public function comment($comment) - { - return $this->addCommand('tableComment', compact('comment')); - } - - /** - * Add a new index command to the blueprint. - * - * @param string $type - * @param string|array $columns - * @param string $index - * @param string|null $algorithm - * @return \Illuminate\Support\Fluent - */ - protected function indexCommand($type, $columns, $index, $algorithm = null) - { - $columns = (array) $columns; - - // If no name was specified for this index, we will create one using a basic - // convention of the table name, followed by the columns, followed by an - // index type, such as primary or index, which makes the index unique. - $index = $index ?: $this->createIndexName($type, $columns); - - return $this->addCommand( - $type, compact('index', 'columns', 'algorithm') - ); - } - - /** - * Create a new drop index command on the blueprint. - * - * @param string $command - * @param string $type - * @param string|array $index - * @return \Illuminate\Support\Fluent - */ - protected function dropIndexCommand($command, $type, $index) - { - $columns = []; - - // If the given "index" is actually an array of columns, the developer means - // to drop an index merely by specifying the columns involved without the - // conventional name, so we will build the index name from the columns. - if (is_array($index)) { - $index = $this->createIndexName($type, $columns = $index); - } - - return $this->indexCommand($command, $columns, $index); - } - - /** - * Create a default index name for the table. - * - * @param string $type - * @param array $columns - * @return string - */ - protected function createIndexName($type, array $columns) - { - $index = strtolower($this->prefix.$this->table.'_'.implode('_', $columns).'_'.$type); - - return str_replace(['-', '.'], '_', $index); - } - - /** - * Add a new column to the blueprint. - * - * @param string $type - * @param string $name - * @param array $parameters - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - public function addColumn($type, $name, array $parameters = []) - { - return $this->addColumnDefinition(new ColumnDefinition( - array_merge(compact('type', 'name'), $parameters) - )); - } - - /** - * Add a new column definition to the blueprint. - * - * @param \Illuminate\Database\Schema\ColumnDefinition $definition - * @return \Illuminate\Database\Schema\ColumnDefinition - */ - protected function addColumnDefinition($definition) - { - $this->columns[] = $definition; - - if ($this->after) { - $definition->after($this->after); - - $this->after = $definition->name; - } - - return $definition; - } - - /** - * Add the columns from the callback after the given column. - * - * @param string $column - * @param \Closure $callback - * @return void - */ - public function after($column, Closure $callback) - { - $this->after = $column; - - $callback($this); - - $this->after = null; - } - - /** - * Remove a column from the schema blueprint. - * - * @param string $name - * @return $this - */ - public function removeColumn($name) - { - $this->columns = array_values(array_filter($this->columns, function ($c) use ($name) { - return $c['name'] != $name; - })); - - return $this; - } - - /** - * Add a new command to the blueprint. - * - * @param string $name - * @param array $parameters - * @return \Illuminate\Support\Fluent - */ - protected function addCommand($name, array $parameters = []) - { - $this->commands[] = $command = $this->createCommand($name, $parameters); - - return $command; - } - - /** - * Create a new Fluent command. - * - * @param string $name - * @param array $parameters - * @return \Illuminate\Support\Fluent - */ - protected function createCommand($name, array $parameters = []) - { - return new Fluent(array_merge(compact('name'), $parameters)); - } - - /** - * Get the table the blueprint describes. - * - * @return string - */ - public function getTable() - { - return $this->table; - } - - /** - * Get the columns on the blueprint. - * - * @return \Illuminate\Database\Schema\ColumnDefinition[] - */ - public function getColumns() - { - return $this->columns; - } - - /** - * Get the commands on the blueprint. - * - * @return \Illuminate\Support\Fluent[] - */ - public function getCommands() - { - return $this->commands; - } - - /** - * Get the columns on the blueprint that should be added. - * - * @return \Illuminate\Database\Schema\ColumnDefinition[] - */ - public function getAddedColumns() - { - return array_filter($this->columns, function ($column) { - return ! $column->change; - }); - } - - /** - * Get the columns on the blueprint that should be changed. - * - * @return \Illuminate\Database\Schema\ColumnDefinition[] - */ - public function getChangedColumns() - { - return array_filter($this->columns, function ($column) { - return (bool) $column->change; - }); - } - - /** - * Determine if the blueprint has auto-increment columns. - * - * @return bool - */ - public function hasAutoIncrementColumn() - { - return ! is_null(collect($this->getAddedColumns())->first(function ($column) { - return $column->autoIncrement === true; - })); - } - - /** - * Get the auto-increment column starting values. - * - * @return array - */ - public function autoIncrementingStartingValues() - { - if (! $this->hasAutoIncrementColumn()) { - return []; - } - - return collect($this->getAddedColumns())->mapWithKeys(function ($column) { - return $column->autoIncrement === true - ? [$column->name => $column->get('startingValue', $column->get('from'))] - : [$column->name => null]; - })->filter()->all(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php b/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php deleted file mode 100755 index 2788a124..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php +++ /dev/null @@ -1,478 +0,0 @@ -connection = $connection; - $this->grammar = $connection->getSchemaGrammar(); - } - - /** - * Set the default string length for migrations. - * - * @param int $length - * @return void - */ - public static function defaultStringLength($length) - { - static::$defaultStringLength = $length; - } - - /** - * Set the default morph key type for migrations. - * - * @param string $type - * @return void - * - * @throws \InvalidArgumentException - */ - public static function defaultMorphKeyType(string $type) - { - if (! in_array($type, ['int', 'uuid', 'ulid'])) { - throw new InvalidArgumentException("Morph key type must be 'int', 'uuid', or 'ulid'."); - } - - static::$defaultMorphKeyType = $type; - } - - /** - * Set the default morph key type for migrations to UUIDs. - * - * @return void - */ - public static function morphUsingUuids() - { - return static::defaultMorphKeyType('uuid'); - } - - /** - * Set the default morph key type for migrations to ULIDs. - * - * @return void - */ - public static function morphUsingUlids() - { - return static::defaultMorphKeyType('ulid'); - } - - /** - * Attempt to use native schema operations for dropping and renaming columns, even if Doctrine DBAL is installed. - * - * @param bool $value - * @return void - */ - public static function useNativeSchemaOperationsIfPossible(bool $value = true) - { - static::$alwaysUsesNativeSchemaOperationsIfPossible = $value; - } - - /** - * Create a database in the schema. - * - * @param string $name - * @return bool - * - * @throws \LogicException - */ - public function createDatabase($name) - { - throw new LogicException('This database driver does not support creating databases.'); - } - - /** - * Drop a database from the schema if the database exists. - * - * @param string $name - * @return bool - * - * @throws \LogicException - */ - public function dropDatabaseIfExists($name) - { - throw new LogicException('This database driver does not support dropping databases.'); - } - - /** - * Determine if the given table exists. - * - * @param string $table - * @return bool - */ - public function hasTable($table) - { - $table = $this->connection->getTablePrefix().$table; - - return count($this->connection->selectFromWriteConnection( - $this->grammar->compileTableExists(), [$table] - )) > 0; - } - - /** - * Determine if the given table has a given column. - * - * @param string $table - * @param string $column - * @return bool - */ - public function hasColumn($table, $column) - { - return in_array( - strtolower($column), array_map('strtolower', $this->getColumnListing($table)) - ); - } - - /** - * Determine if the given table has given columns. - * - * @param string $table - * @param array $columns - * @return bool - */ - public function hasColumns($table, array $columns) - { - $tableColumns = array_map('strtolower', $this->getColumnListing($table)); - - foreach ($columns as $column) { - if (! in_array(strtolower($column), $tableColumns)) { - return false; - } - } - - return true; - } - - /** - * Execute a table builder callback if the given table has a given column. - * - * @param string $table - * @param string $column - * @param \Closure $callback - * @return void - */ - public function whenTableHasColumn(string $table, string $column, Closure $callback) - { - if ($this->hasColumn($table, $column)) { - $this->table($table, fn (Blueprint $table) => $callback($table)); - } - } - - /** - * Execute a table builder callback if the given table doesn't have a given column. - * - * @param string $table - * @param string $column - * @param \Closure $callback - * @return void - */ - public function whenTableDoesntHaveColumn(string $table, string $column, Closure $callback) - { - if (! $this->hasColumn($table, $column)) { - $this->table($table, fn (Blueprint $table) => $callback($table)); - } - } - - /** - * Get the data type for the given column name. - * - * @param string $table - * @param string $column - * @return string - */ - public function getColumnType($table, $column) - { - $table = $this->connection->getTablePrefix().$table; - - return $this->connection->getDoctrineColumn($table, $column)->getType()->getName(); - } - - /** - * Get the column listing for a given table. - * - * @param string $table - * @return array - */ - public function getColumnListing($table) - { - $results = $this->connection->selectFromWriteConnection($this->grammar->compileColumnListing( - $this->connection->getTablePrefix().$table - )); - - return $this->connection->getPostProcessor()->processColumnListing($results); - } - - /** - * Modify a table on the schema. - * - * @param string $table - * @param \Closure $callback - * @return void - */ - public function table($table, Closure $callback) - { - $this->build($this->createBlueprint($table, $callback)); - } - - /** - * Create a new table on the schema. - * - * @param string $table - * @param \Closure $callback - * @return void - */ - public function create($table, Closure $callback) - { - $this->build(tap($this->createBlueprint($table), function ($blueprint) use ($callback) { - $blueprint->create(); - - $callback($blueprint); - })); - } - - /** - * Drop a table from the schema. - * - * @param string $table - * @return void - */ - public function drop($table) - { - $this->build(tap($this->createBlueprint($table), function ($blueprint) { - $blueprint->drop(); - })); - } - - /** - * Drop a table from the schema if it exists. - * - * @param string $table - * @return void - */ - public function dropIfExists($table) - { - $this->build(tap($this->createBlueprint($table), function ($blueprint) { - $blueprint->dropIfExists(); - })); - } - - /** - * Drop columns from a table schema. - * - * @param string $table - * @param string|array $columns - * @return void - */ - public function dropColumns($table, $columns) - { - $this->table($table, function (Blueprint $blueprint) use ($columns) { - $blueprint->dropColumn($columns); - }); - } - - /** - * Drop all tables from the database. - * - * @return void - * - * @throws \LogicException - */ - public function dropAllTables() - { - throw new LogicException('This database driver does not support dropping all tables.'); - } - - /** - * Drop all views from the database. - * - * @return void - * - * @throws \LogicException - */ - public function dropAllViews() - { - throw new LogicException('This database driver does not support dropping all views.'); - } - - /** - * Drop all types from the database. - * - * @return void - * - * @throws \LogicException - */ - public function dropAllTypes() - { - throw new LogicException('This database driver does not support dropping all types.'); - } - - /** - * Get all of the table names for the database. - * - * @return void - * - * @throws \LogicException - */ - public function getAllTables() - { - throw new LogicException('This database driver does not support getting all tables.'); - } - - /** - * Rename a table on the schema. - * - * @param string $from - * @param string $to - * @return void - */ - public function rename($from, $to) - { - $this->build(tap($this->createBlueprint($from), function ($blueprint) use ($to) { - $blueprint->rename($to); - })); - } - - /** - * Enable foreign key constraints. - * - * @return bool - */ - public function enableForeignKeyConstraints() - { - return $this->connection->statement( - $this->grammar->compileEnableForeignKeyConstraints() - ); - } - - /** - * Disable foreign key constraints. - * - * @return bool - */ - public function disableForeignKeyConstraints() - { - return $this->connection->statement( - $this->grammar->compileDisableForeignKeyConstraints() - ); - } - - /** - * Execute the blueprint to build / modify the table. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @return void - */ - protected function build(Blueprint $blueprint) - { - $blueprint->build($this->connection, $this->grammar); - } - - /** - * Create a new command set with a Closure. - * - * @param string $table - * @param \Closure|null $callback - * @return \Illuminate\Database\Schema\Blueprint - */ - protected function createBlueprint($table, Closure $callback = null) - { - $prefix = $this->connection->getConfig('prefix_indexes') - ? $this->connection->getConfig('prefix') - : ''; - - if (isset($this->resolver)) { - return call_user_func($this->resolver, $table, $callback, $prefix); - } - - return Container::getInstance()->make(Blueprint::class, compact('table', 'callback', 'prefix')); - } - - /** - * Get the database connection instance. - * - * @return \Illuminate\Database\Connection - */ - public function getConnection() - { - return $this->connection; - } - - /** - * Set the database connection instance. - * - * @param \Illuminate\Database\Connection $connection - * @return $this - */ - public function setConnection(Connection $connection) - { - $this->connection = $connection; - - return $this; - } - - /** - * Set the Schema Blueprint resolver callback. - * - * @param \Closure $resolver - * @return void - */ - public function blueprintResolver(Closure $resolver) - { - $this->resolver = $resolver; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Schema/ColumnDefinition.php b/vendor/laravel/framework/src/Illuminate/Database/Schema/ColumnDefinition.php deleted file mode 100644 index 51265ac4..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Schema/ColumnDefinition.php +++ /dev/null @@ -1,38 +0,0 @@ -blueprint = $blueprint; - } - - /** - * Create a foreign key constraint on this column referencing the "id" column of the conventionally related table. - * - * @param string|null $table - * @param string $column - * @return \Illuminate\Database\Schema\ForeignKeyDefinition - */ - public function constrained($table = null, $column = 'id') - { - return $this->references($column)->on($table ?? Str::of($this->name)->beforeLast('_'.$column)->plural()); - } - - /** - * Specify which column this foreign ID references on another table. - * - * @param string $column - * @return \Illuminate\Database\Schema\ForeignKeyDefinition - */ - public function references($column) - { - return $this->blueprint->foreign($this->name)->references($column); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Schema/ForeignKeyDefinition.php b/vendor/laravel/framework/src/Illuminate/Database/Schema/ForeignKeyDefinition.php deleted file mode 100644 index a03fcff7..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Schema/ForeignKeyDefinition.php +++ /dev/null @@ -1,66 +0,0 @@ -onUpdate('cascade'); - } - - /** - * Indicate that updates should be restricted. - * - * @return $this - */ - public function restrictOnUpdate() - { - return $this->onUpdate('restrict'); - } - - /** - * Indicate that deletes should cascade. - * - * @return $this - */ - public function cascadeOnDelete() - { - return $this->onDelete('cascade'); - } - - /** - * Indicate that deletes should be restricted. - * - * @return $this - */ - public function restrictOnDelete() - { - return $this->onDelete('restrict'); - } - - /** - * Indicate that deletes should set the foreign key value to null. - * - * @return $this - */ - public function nullOnDelete() - { - return $this->onDelete('set null'); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/ChangeColumn.php b/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/ChangeColumn.php deleted file mode 100644 index 95792229..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/ChangeColumn.php +++ /dev/null @@ -1,235 +0,0 @@ -isDoctrineAvailable()) { - throw new RuntimeException(sprintf( - 'Changing columns for table "%s" requires Doctrine DBAL. Please install the doctrine/dbal package.', - $blueprint->getTable() - )); - } - - $schema = $connection->getDoctrineSchemaManager(); - $databasePlatform = $schema->getDatabasePlatform(); - $databasePlatform->registerDoctrineTypeMapping('enum', 'string'); - - $tableDiff = static::getChangedDiff( - $grammar, $blueprint, $schema - ); - - if ($tableDiff !== false) { - return (array) $databasePlatform->getAlterTableSQL($tableDiff); - } - - return []; - } - - /** - * Get the Doctrine table difference for the given changes. - * - * @param \Illuminate\Database\Schema\Grammars\Grammar $grammar - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Doctrine\DBAL\Schema\AbstractSchemaManager $schema - * @return \Doctrine\DBAL\Schema\TableDiff|bool - */ - protected static function getChangedDiff($grammar, Blueprint $blueprint, SchemaManager $schema) - { - $current = $schema->listTableDetails($grammar->getTablePrefix().$blueprint->getTable()); - - return (new Comparator)->diffTable( - $current, static::getTableWithColumnChanges($blueprint, $current) - ); - } - - /** - * Get a copy of the given Doctrine table after making the column changes. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Doctrine\DBAL\Schema\Table $table - * @return \Doctrine\DBAL\Schema\Table - */ - protected static function getTableWithColumnChanges(Blueprint $blueprint, Table $table) - { - $table = clone $table; - - foreach ($blueprint->getChangedColumns() as $fluent) { - $column = static::getDoctrineColumn($table, $fluent); - - // Here we will spin through each fluent column definition and map it to the proper - // Doctrine column definitions - which is necessary because Laravel and Doctrine - // use some different terminology for various column attributes on the tables. - foreach ($fluent->getAttributes() as $key => $value) { - if (! is_null($option = static::mapFluentOptionToDoctrine($key))) { - if (method_exists($column, $method = 'set'.ucfirst($option))) { - $column->{$method}(static::mapFluentValueToDoctrine($option, $value)); - continue; - } - - $column->setCustomSchemaOption($option, static::mapFluentValueToDoctrine($option, $value)); - } - } - } - - return $table; - } - - /** - * Get the Doctrine column instance for a column change. - * - * @param \Doctrine\DBAL\Schema\Table $table - * @param \Illuminate\Support\Fluent $fluent - * @return \Doctrine\DBAL\Schema\Column - */ - protected static function getDoctrineColumn(Table $table, Fluent $fluent) - { - return $table->changeColumn( - $fluent['name'], static::getDoctrineColumnChangeOptions($fluent) - )->getColumn($fluent['name']); - } - - /** - * Get the Doctrine column change options. - * - * @param \Illuminate\Support\Fluent $fluent - * @return array - */ - protected static function getDoctrineColumnChangeOptions(Fluent $fluent) - { - $options = ['type' => static::getDoctrineColumnType($fluent['type'])]; - - if (in_array($fluent['type'], ['tinyText', 'text', 'mediumText', 'longText'])) { - $options['length'] = static::calculateDoctrineTextLength($fluent['type']); - } - - if ($fluent['type'] === 'char') { - $options['fixed'] = true; - } - - if (static::doesntNeedCharacterOptions($fluent['type'])) { - $options['customSchemaOptions'] = [ - 'collation' => '', - 'charset' => '', - ]; - } - - return $options; - } - - /** - * Get the doctrine column type. - * - * @param string $type - * @return \Doctrine\DBAL\Types\Type - */ - protected static function getDoctrineColumnType($type) - { - $type = strtolower($type); - - return Type::getType(match ($type) { - 'biginteger' => 'bigint', - 'smallinteger' => 'smallint', - 'tinytext', 'mediumtext', 'longtext' => 'text', - 'binary' => 'blob', - 'uuid' => 'guid', - 'char' => 'string', - 'double' => 'float', - default => $type, - }); - } - - /** - * Calculate the proper column length to force the Doctrine text type. - * - * @param string $type - * @return int - */ - protected static function calculateDoctrineTextLength($type) - { - return match ($type) { - 'tinyText' => 1, - 'mediumText' => 65535 + 1, - 'longText' => 16777215 + 1, - default => 255 + 1, - }; - } - - /** - * Determine if the given type does not need character / collation options. - * - * @param string $type - * @return bool - */ - protected static function doesntNeedCharacterOptions($type) - { - return in_array($type, [ - 'bigInteger', - 'binary', - 'boolean', - 'date', - 'dateTime', - 'decimal', - 'double', - 'float', - 'integer', - 'json', - 'mediumInteger', - 'smallInteger', - 'time', - 'timestamp', - 'tinyInteger', - ]); - } - - /** - * Get the matching Doctrine option for a given Fluent attribute name. - * - * @param string $attribute - * @return string|null - */ - protected static function mapFluentOptionToDoctrine($attribute) - { - return match ($attribute) { - 'type', 'name' => null, - 'nullable' => 'notnull', - 'total' => 'precision', - 'places' => 'scale', - default => $attribute, - }; - } - - /** - * Get the matching Doctrine value for a given Fluent attribute. - * - * @param string $option - * @param mixed $value - * @return mixed - */ - protected static function mapFluentValueToDoctrine($option, $value) - { - return $option === 'notnull' ? ! $value : $value; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/Grammar.php b/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/Grammar.php deleted file mode 100755 index ea8333e4..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/Grammar.php +++ /dev/null @@ -1,345 +0,0 @@ -wrapTable($blueprint), - $this->wrap($command->index) - ); - - // Once we have the initial portion of the SQL statement we will add on the - // key name, table name, and referenced columns. These will complete the - // main portion of the SQL statement and this SQL will almost be done. - $sql .= sprintf('foreign key (%s) references %s (%s)', - $this->columnize($command->columns), - $this->wrapTable($command->on), - $this->columnize((array) $command->references) - ); - - // Once we have the basic foreign key creation statement constructed we can - // build out the syntax for what should happen on an update or delete of - // the affected columns, which will get something like "cascade", etc. - if (! is_null($command->onDelete)) { - $sql .= " on delete {$command->onDelete}"; - } - - if (! is_null($command->onUpdate)) { - $sql .= " on update {$command->onUpdate}"; - } - - return $sql; - } - - /** - * Compile the blueprint's column definitions. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @return array - */ - protected function getColumns(Blueprint $blueprint) - { - $columns = []; - - foreach ($blueprint->getAddedColumns() as $column) { - // Each of the column types has their own compiler functions, which are tasked - // with turning the column definition into its SQL format for this platform - // used by the connection. The column's modifiers are compiled and added. - $sql = $this->wrap($column).' '.$this->getType($column); - - $columns[] = $this->addModifiers($sql, $blueprint, $column); - } - - return $columns; - } - - /** - * Get the SQL for the column data type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function getType(Fluent $column) - { - return $this->{'type'.ucfirst($column->type)}($column); - } - - /** - * Create the column definition for a generated, computed column type. - * - * @param \Illuminate\Support\Fluent $column - * @return void - * - * @throws \RuntimeException - */ - protected function typeComputed(Fluent $column) - { - throw new RuntimeException('This database driver does not support the computed type.'); - } - - /** - * Add the column modifiers to the definition. - * - * @param string $sql - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function addModifiers($sql, Blueprint $blueprint, Fluent $column) - { - foreach ($this->modifiers as $modifier) { - if (method_exists($this, $method = "modify{$modifier}")) { - $sql .= $this->{$method}($blueprint, $column); - } - } - - return $sql; - } - - /** - * Get the primary key command if it exists on the blueprint. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param string $name - * @return \Illuminate\Support\Fluent|null - */ - protected function getCommandByName(Blueprint $blueprint, $name) - { - $commands = $this->getCommandsByName($blueprint, $name); - - if (count($commands) > 0) { - return reset($commands); - } - } - - /** - * Get all of the commands with a given name. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param string $name - * @return array - */ - protected function getCommandsByName(Blueprint $blueprint, $name) - { - return array_filter($blueprint->getCommands(), function ($value) use ($name) { - return $value->name == $name; - }); - } - - /** - * Add a prefix to an array of values. - * - * @param string $prefix - * @param array $values - * @return array - */ - public function prefixArray($prefix, array $values) - { - return array_map(function ($value) use ($prefix) { - return $prefix.' '.$value; - }, $values); - } - - /** - * Wrap a table in keyword identifiers. - * - * @param mixed $table - * @return string - */ - public function wrapTable($table) - { - return parent::wrapTable( - $table instanceof Blueprint ? $table->getTable() : $table - ); - } - - /** - * Wrap a value in keyword identifiers. - * - * @param \Illuminate\Database\Query\Expression|string $value - * @param bool $prefixAlias - * @return string - */ - public function wrap($value, $prefixAlias = false) - { - return parent::wrap( - $value instanceof Fluent ? $value->name : $value, $prefixAlias - ); - } - - /** - * Format a value so that it can be used in "default" clauses. - * - * @param mixed $value - * @return string - */ - protected function getDefaultValue($value) - { - if ($value instanceof Expression) { - return $value; - } - - return is_bool($value) - ? "'".(int) $value."'" - : "'".(string) $value."'"; - } - - /** - * Create an empty Doctrine DBAL TableDiff from the Blueprint. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Doctrine\DBAL\Schema\AbstractSchemaManager $schema - * @return \Doctrine\DBAL\Schema\TableDiff - */ - public function getDoctrineTableDiff(Blueprint $blueprint, SchemaManager $schema) - { - $table = $this->getTablePrefix().$blueprint->getTable(); - - return tap(new TableDiff($table), function ($tableDiff) use ($schema, $table) { - $tableDiff->fromTable = $schema->listTableDetails($table); - }); - } - - /** - * Get the fluent commands for the grammar. - * - * @return array - */ - public function getFluentCommands() - { - return $this->fluentCommands; - } - - /** - * Check if this Grammar supports schema changes wrapped in a transaction. - * - * @return bool - */ - public function supportsSchemaTransactions() - { - return $this->transactions; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php b/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php deleted file mode 100755 index 40ee3c8b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php +++ /dev/null @@ -1,1219 +0,0 @@ -wrapValue($name), - $this->wrapValue($connection->getConfig('charset')), - $this->wrapValue($connection->getConfig('collation')), - ); - } - - /** - * Compile a drop database if exists command. - * - * @param string $name - * @return string - */ - public function compileDropDatabaseIfExists($name) - { - return sprintf( - 'drop database if exists %s', - $this->wrapValue($name) - ); - } - - /** - * Compile the query to determine the list of tables. - * - * @return string - */ - public function compileTableExists() - { - return "select * from information_schema.tables where table_schema = ? and table_name = ? and table_type = 'BASE TABLE'"; - } - - /** - * Compile the query to determine the list of columns. - * - * @return string - */ - public function compileColumnListing() - { - return 'select column_name as `column_name` from information_schema.columns where table_schema = ? and table_name = ?'; - } - - /** - * Compile a create table command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @param \Illuminate\Database\Connection $connection - * @return array - */ - public function compileCreate(Blueprint $blueprint, Fluent $command, Connection $connection) - { - $sql = $this->compileCreateTable( - $blueprint, $command, $connection - ); - - // Once we have the primary SQL, we can add the encoding option to the SQL for - // the table. Then, we can check if a storage engine has been supplied for - // the table. If so, we will add the engine declaration to the SQL query. - $sql = $this->compileCreateEncoding( - $sql, $connection, $blueprint - ); - - // Finally, we will append the engine configuration onto this SQL statement as - // the final thing we do before returning this finished SQL. Once this gets - // added the query will be ready to execute against the real connections. - return array_values(array_filter(array_merge([$this->compileCreateEngine( - $sql, $connection, $blueprint - )], $this->compileAutoIncrementStartingValues($blueprint)))); - } - - /** - * Create the main create table clause. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @param \Illuminate\Database\Connection $connection - * @return array - */ - protected function compileCreateTable($blueprint, $command, $connection) - { - return trim(sprintf('%s table %s (%s)', - $blueprint->temporary ? 'create temporary' : 'create', - $this->wrapTable($blueprint), - implode(', ', $this->getColumns($blueprint)) - )); - } - - /** - * Append the character set specifications to a command. - * - * @param string $sql - * @param \Illuminate\Database\Connection $connection - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @return string - */ - protected function compileCreateEncoding($sql, Connection $connection, Blueprint $blueprint) - { - // First we will set the character set if one has been set on either the create - // blueprint itself or on the root configuration for the connection that the - // table is being created on. We will add these to the create table query. - if (isset($blueprint->charset)) { - $sql .= ' default character set '.$blueprint->charset; - } elseif (! is_null($charset = $connection->getConfig('charset'))) { - $sql .= ' default character set '.$charset; - } - - // Next we will add the collation to the create table statement if one has been - // added to either this create table blueprint or the configuration for this - // connection that the query is targeting. We'll add it to this SQL query. - if (isset($blueprint->collation)) { - $sql .= " collate '{$blueprint->collation}'"; - } elseif (! is_null($collation = $connection->getConfig('collation'))) { - $sql .= " collate '{$collation}'"; - } - - return $sql; - } - - /** - * Append the engine specifications to a command. - * - * @param string $sql - * @param \Illuminate\Database\Connection $connection - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @return string - */ - protected function compileCreateEngine($sql, Connection $connection, Blueprint $blueprint) - { - if (isset($blueprint->engine)) { - return $sql.' engine = '.$blueprint->engine; - } elseif (! is_null($engine = $connection->getConfig('engine'))) { - return $sql.' engine = '.$engine; - } - - return $sql; - } - - /** - * Compile an add column command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return array - */ - public function compileAdd(Blueprint $blueprint, Fluent $command) - { - $columns = $this->prefixArray('add', $this->getColumns($blueprint)); - - return array_values(array_merge( - ['alter table '.$this->wrapTable($blueprint).' '.implode(', ', $columns)], - $this->compileAutoIncrementStartingValues($blueprint) - )); - } - - /** - * Compile the auto-incrementing column starting values. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @return array - */ - public function compileAutoIncrementStartingValues(Blueprint $blueprint) - { - return collect($blueprint->autoIncrementingStartingValues())->map(function ($value, $column) use ($blueprint) { - return 'alter table '.$this->wrapTable($blueprint->getTable()).' auto_increment = '.$value; - })->all(); - } - - /** - * Compile a rename column command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @param \Illuminate\Database\Connection $connection - * @return array|string - */ - public function compileRenameColumn(Blueprint $blueprint, Fluent $command, Connection $connection) - { - return $connection->usingNativeSchemaOperations() - ? sprintf('alter table %s rename column %s to %s', - $this->wrapTable($blueprint), - $this->wrap($command->from), - $this->wrap($command->to) - ) - : parent::compileRenameColumn($blueprint, $command, $connection); - } - - /** - * Compile a primary key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compilePrimary(Blueprint $blueprint, Fluent $command) - { - $command->name(null); - - return $this->compileKey($blueprint, $command, 'primary key'); - } - - /** - * Compile a unique key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileUnique(Blueprint $blueprint, Fluent $command) - { - return $this->compileKey($blueprint, $command, 'unique'); - } - - /** - * Compile a plain index key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileIndex(Blueprint $blueprint, Fluent $command) - { - return $this->compileKey($blueprint, $command, 'index'); - } - - /** - * Compile a fulltext index key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileFullText(Blueprint $blueprint, Fluent $command) - { - return $this->compileKey($blueprint, $command, 'fulltext'); - } - - /** - * Compile a spatial index key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileSpatialIndex(Blueprint $blueprint, Fluent $command) - { - return $this->compileKey($blueprint, $command, 'spatial index'); - } - - /** - * Compile an index creation command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @param string $type - * @return string - */ - protected function compileKey(Blueprint $blueprint, Fluent $command, $type) - { - return sprintf('alter table %s add %s %s%s(%s)', - $this->wrapTable($blueprint), - $type, - $this->wrap($command->index), - $command->algorithm ? ' using '.$command->algorithm : '', - $this->columnize($command->columns) - ); - } - - /** - * Compile a drop table command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDrop(Blueprint $blueprint, Fluent $command) - { - return 'drop table '.$this->wrapTable($blueprint); - } - - /** - * Compile a drop table (if exists) command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropIfExists(Blueprint $blueprint, Fluent $command) - { - return 'drop table if exists '.$this->wrapTable($blueprint); - } - - /** - * Compile a drop column command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropColumn(Blueprint $blueprint, Fluent $command) - { - $columns = $this->prefixArray('drop', $this->wrapArray($command->columns)); - - return 'alter table '.$this->wrapTable($blueprint).' '.implode(', ', $columns); - } - - /** - * Compile a drop primary key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropPrimary(Blueprint $blueprint, Fluent $command) - { - return 'alter table '.$this->wrapTable($blueprint).' drop primary key'; - } - - /** - * Compile a drop unique key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropUnique(Blueprint $blueprint, Fluent $command) - { - $index = $this->wrap($command->index); - - return "alter table {$this->wrapTable($blueprint)} drop index {$index}"; - } - - /** - * Compile a drop index command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropIndex(Blueprint $blueprint, Fluent $command) - { - $index = $this->wrap($command->index); - - return "alter table {$this->wrapTable($blueprint)} drop index {$index}"; - } - - /** - * Compile a drop fulltext index command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropFullText(Blueprint $blueprint, Fluent $command) - { - return $this->compileDropIndex($blueprint, $command); - } - - /** - * Compile a drop spatial index command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropSpatialIndex(Blueprint $blueprint, Fluent $command) - { - return $this->compileDropIndex($blueprint, $command); - } - - /** - * Compile a drop foreign key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropForeign(Blueprint $blueprint, Fluent $command) - { - $index = $this->wrap($command->index); - - return "alter table {$this->wrapTable($blueprint)} drop foreign key {$index}"; - } - - /** - * Compile a rename table command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileRename(Blueprint $blueprint, Fluent $command) - { - $from = $this->wrapTable($blueprint); - - return "rename table {$from} to ".$this->wrapTable($command->to); - } - - /** - * Compile a rename index command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileRenameIndex(Blueprint $blueprint, Fluent $command) - { - return sprintf('alter table %s rename index %s to %s', - $this->wrapTable($blueprint), - $this->wrap($command->from), - $this->wrap($command->to) - ); - } - - /** - * Compile the SQL needed to drop all tables. - * - * @param array $tables - * @return string - */ - public function compileDropAllTables($tables) - { - return 'drop table '.implode(',', $this->wrapArray($tables)); - } - - /** - * Compile the SQL needed to drop all views. - * - * @param array $views - * @return string - */ - public function compileDropAllViews($views) - { - return 'drop view '.implode(',', $this->wrapArray($views)); - } - - /** - * Compile the SQL needed to retrieve all table names. - * - * @return string - */ - public function compileGetAllTables() - { - return 'SHOW FULL TABLES WHERE table_type = \'BASE TABLE\''; - } - - /** - * Compile the SQL needed to retrieve all view names. - * - * @return string - */ - public function compileGetAllViews() - { - return 'SHOW FULL TABLES WHERE table_type = \'VIEW\''; - } - - /** - * Compile the command to enable foreign key constraints. - * - * @return string - */ - public function compileEnableForeignKeyConstraints() - { - return 'SET FOREIGN_KEY_CHECKS=1;'; - } - - /** - * Compile the command to disable foreign key constraints. - * - * @return string - */ - public function compileDisableForeignKeyConstraints() - { - return 'SET FOREIGN_KEY_CHECKS=0;'; - } - - /** - * Compile a table comment command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileTableComment(Blueprint $blueprint, Fluent $command) - { - return sprintf('alter table %s comment = %s', - $this->wrapTable($blueprint), - "'".str_replace("'", "''", $command->comment)."'" - ); - } - - /** - * Create the column definition for a char type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeChar(Fluent $column) - { - return "char({$column->length})"; - } - - /** - * Create the column definition for a string type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeString(Fluent $column) - { - return "varchar({$column->length})"; - } - - /** - * Create the column definition for a tiny text type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTinyText(Fluent $column) - { - return 'tinytext'; - } - - /** - * Create the column definition for a text type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeText(Fluent $column) - { - return 'text'; - } - - /** - * Create the column definition for a medium text type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeMediumText(Fluent $column) - { - return 'mediumtext'; - } - - /** - * Create the column definition for a long text type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeLongText(Fluent $column) - { - return 'longtext'; - } - - /** - * Create the column definition for a big integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeBigInteger(Fluent $column) - { - return 'bigint'; - } - - /** - * Create the column definition for an integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeInteger(Fluent $column) - { - return 'int'; - } - - /** - * Create the column definition for a medium integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeMediumInteger(Fluent $column) - { - return 'mediumint'; - } - - /** - * Create the column definition for a tiny integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTinyInteger(Fluent $column) - { - return 'tinyint'; - } - - /** - * Create the column definition for a small integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeSmallInteger(Fluent $column) - { - return 'smallint'; - } - - /** - * Create the column definition for a float type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeFloat(Fluent $column) - { - return $this->typeDouble($column); - } - - /** - * Create the column definition for a double type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDouble(Fluent $column) - { - if ($column->total && $column->places) { - return "double({$column->total}, {$column->places})"; - } - - return 'double'; - } - - /** - * Create the column definition for a decimal type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDecimal(Fluent $column) - { - return "decimal({$column->total}, {$column->places})"; - } - - /** - * Create the column definition for a boolean type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeBoolean(Fluent $column) - { - return 'tinyint(1)'; - } - - /** - * Create the column definition for an enumeration type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeEnum(Fluent $column) - { - return sprintf('enum(%s)', $this->quoteString($column->allowed)); - } - - /** - * Create the column definition for a set enumeration type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeSet(Fluent $column) - { - return sprintf('set(%s)', $this->quoteString($column->allowed)); - } - - /** - * Create the column definition for a json type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeJson(Fluent $column) - { - return 'json'; - } - - /** - * Create the column definition for a jsonb type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeJsonb(Fluent $column) - { - return 'json'; - } - - /** - * Create the column definition for a date type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDate(Fluent $column) - { - return 'date'; - } - - /** - * Create the column definition for a date-time type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDateTime(Fluent $column) - { - $columnType = $column->precision ? "datetime($column->precision)" : 'datetime'; - - $current = $column->precision ? "CURRENT_TIMESTAMP($column->precision)" : 'CURRENT_TIMESTAMP'; - - $columnType = $column->useCurrent ? "$columnType default $current" : $columnType; - - return $column->useCurrentOnUpdate ? "$columnType on update $current" : $columnType; - } - - /** - * Create the column definition for a date-time (with time zone) type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDateTimeTz(Fluent $column) - { - return $this->typeDateTime($column); - } - - /** - * Create the column definition for a time type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTime(Fluent $column) - { - return $column->precision ? "time($column->precision)" : 'time'; - } - - /** - * Create the column definition for a time (with time zone) type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTimeTz(Fluent $column) - { - return $this->typeTime($column); - } - - /** - * Create the column definition for a timestamp type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTimestamp(Fluent $column) - { - $columnType = $column->precision ? "timestamp($column->precision)" : 'timestamp'; - - $current = $column->precision ? "CURRENT_TIMESTAMP($column->precision)" : 'CURRENT_TIMESTAMP'; - - $columnType = $column->useCurrent ? "$columnType default $current" : $columnType; - - return $column->useCurrentOnUpdate ? "$columnType on update $current" : $columnType; - } - - /** - * Create the column definition for a timestamp (with time zone) type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTimestampTz(Fluent $column) - { - return $this->typeTimestamp($column); - } - - /** - * Create the column definition for a year type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeYear(Fluent $column) - { - return 'year'; - } - - /** - * Create the column definition for a binary type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeBinary(Fluent $column) - { - return 'blob'; - } - - /** - * Create the column definition for a uuid type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeUuid(Fluent $column) - { - return 'char(36)'; - } - - /** - * Create the column definition for an IP address type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeIpAddress(Fluent $column) - { - return 'varchar(45)'; - } - - /** - * Create the column definition for a MAC address type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeMacAddress(Fluent $column) - { - return 'varchar(17)'; - } - - /** - * Create the column definition for a spatial Geometry type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeGeometry(Fluent $column) - { - return 'geometry'; - } - - /** - * Create the column definition for a spatial Point type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typePoint(Fluent $column) - { - return 'point'; - } - - /** - * Create the column definition for a spatial LineString type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeLineString(Fluent $column) - { - return 'linestring'; - } - - /** - * Create the column definition for a spatial Polygon type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typePolygon(Fluent $column) - { - return 'polygon'; - } - - /** - * Create the column definition for a spatial GeometryCollection type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeGeometryCollection(Fluent $column) - { - return 'geometrycollection'; - } - - /** - * Create the column definition for a spatial MultiPoint type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeMultiPoint(Fluent $column) - { - return 'multipoint'; - } - - /** - * Create the column definition for a spatial MultiLineString type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeMultiLineString(Fluent $column) - { - return 'multilinestring'; - } - - /** - * Create the column definition for a spatial MultiPolygon type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeMultiPolygon(Fluent $column) - { - return 'multipolygon'; - } - - /** - * Create the column definition for a generated, computed column type. - * - * @param \Illuminate\Support\Fluent $column - * @return void - * - * @throws \RuntimeException - */ - protected function typeComputed(Fluent $column) - { - throw new RuntimeException('This database driver requires a type, see the virtualAs / storedAs modifiers.'); - } - - /** - * Get the SQL for a generated virtual column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyVirtualAs(Blueprint $blueprint, Fluent $column) - { - if (! is_null($virtualAs = $column->virtualAsJson)) { - if ($this->isJsonSelector($virtualAs)) { - $virtualAs = $this->wrapJsonSelector($virtualAs); - } - - return " as ({$virtualAs})"; - } - - if (! is_null($virtualAs = $column->virtualAs)) { - return " as ({$virtualAs})"; - } - } - - /** - * Get the SQL for a generated stored column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyStoredAs(Blueprint $blueprint, Fluent $column) - { - if (! is_null($storedAs = $column->storedAsJson)) { - if ($this->isJsonSelector($storedAs)) { - $storedAs = $this->wrapJsonSelector($storedAs); - } - - return " as ({$storedAs}) stored"; - } - - if (! is_null($storedAs = $column->storedAs)) { - return " as ({$storedAs}) stored"; - } - } - - /** - * Get the SQL for an unsigned column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyUnsigned(Blueprint $blueprint, Fluent $column) - { - if ($column->unsigned) { - return ' unsigned'; - } - } - - /** - * Get the SQL for a character set column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyCharset(Blueprint $blueprint, Fluent $column) - { - if (! is_null($column->charset)) { - return ' character set '.$column->charset; - } - } - - /** - * Get the SQL for a collation column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyCollate(Blueprint $blueprint, Fluent $column) - { - if (! is_null($column->collation)) { - return " collate '{$column->collation}'"; - } - } - - /** - * Get the SQL for a nullable column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyNullable(Blueprint $blueprint, Fluent $column) - { - if (is_null($column->virtualAs) && - is_null($column->virtualAsJson) && - is_null($column->storedAs) && - is_null($column->storedAsJson)) { - return $column->nullable ? ' null' : ' not null'; - } - - if ($column->nullable === false) { - return ' not null'; - } - } - - /** - * Get the SQL for an invisible column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyInvisible(Blueprint $blueprint, Fluent $column) - { - if (! is_null($column->invisible)) { - return ' invisible'; - } - } - - /** - * Get the SQL for a default column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyDefault(Blueprint $blueprint, Fluent $column) - { - if (! is_null($column->default)) { - return ' default '.$this->getDefaultValue($column->default); - } - } - - /** - * Get the SQL for an auto-increment column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyIncrement(Blueprint $blueprint, Fluent $column) - { - if (in_array($column->type, $this->serials) && $column->autoIncrement) { - return ' auto_increment primary key'; - } - } - - /** - * Get the SQL for a "first" column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyFirst(Blueprint $blueprint, Fluent $column) - { - if (! is_null($column->first)) { - return ' first'; - } - } - - /** - * Get the SQL for an "after" column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyAfter(Blueprint $blueprint, Fluent $column) - { - if (! is_null($column->after)) { - return ' after '.$this->wrap($column->after); - } - } - - /** - * Get the SQL for a "comment" column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyComment(Blueprint $blueprint, Fluent $column) - { - if (! is_null($column->comment)) { - return " comment '".addslashes($column->comment)."'"; - } - } - - /** - * Get the SQL for a SRID column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifySrid(Blueprint $blueprint, Fluent $column) - { - if (is_int($column->srid) && $column->srid > 0) { - return ' srid '.$column->srid; - } - } - - /** - * Wrap a single string in keyword identifiers. - * - * @param string $value - * @return string - */ - protected function wrapValue($value) - { - if ($value !== '*') { - return '`'.str_replace('`', '``', $value).'`'; - } - - return $value; - } - - /** - * Wrap the given JSON selector. - * - * @param string $value - * @return string - */ - protected function wrapJsonSelector($value) - { - [$field, $path] = $this->wrapJsonFieldAndPath($value); - - return 'json_unquote(json_extract('.$field.$path.'))'; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php b/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php deleted file mode 100755 index ef60d0ff..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php +++ /dev/null @@ -1,1141 +0,0 @@ -wrapValue($name), - $this->wrapValue($connection->getConfig('charset')), - ); - } - - /** - * Compile a drop database if exists command. - * - * @param string $name - * @return string - */ - public function compileDropDatabaseIfExists($name) - { - return sprintf( - 'drop database if exists %s', - $this->wrapValue($name) - ); - } - - /** - * Compile the query to determine if a table exists. - * - * @return string - */ - public function compileTableExists() - { - return "select * from information_schema.tables where table_catalog = ? and table_schema = ? and table_name = ? and table_type = 'BASE TABLE'"; - } - - /** - * Compile the query to determine the list of columns. - * - * @return string - */ - public function compileColumnListing() - { - return 'select column_name from information_schema.columns where table_catalog = ? and table_schema = ? and table_name = ?'; - } - - /** - * Compile a create table command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return array - */ - public function compileCreate(Blueprint $blueprint, Fluent $command) - { - return array_values(array_filter(array_merge([sprintf('%s table %s (%s)', - $blueprint->temporary ? 'create temporary' : 'create', - $this->wrapTable($blueprint), - implode(', ', $this->getColumns($blueprint)) - )], $this->compileAutoIncrementStartingValues($blueprint)))); - } - - /** - * Compile a column addition command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileAdd(Blueprint $blueprint, Fluent $command) - { - return array_values(array_filter(array_merge([sprintf('alter table %s %s', - $this->wrapTable($blueprint), - implode(', ', $this->prefixArray('add column', $this->getColumns($blueprint))) - )], $this->compileAutoIncrementStartingValues($blueprint)))); - } - - /** - * Compile the auto-incrementing column starting values. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @return array - */ - public function compileAutoIncrementStartingValues(Blueprint $blueprint) - { - return collect($blueprint->autoIncrementingStartingValues())->map(function ($value, $column) use ($blueprint) { - return 'alter sequence '.$blueprint->getTable().'_'.$column.'_seq restart with '.$value; - })->all(); - } - - /** - * Compile a rename column command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @param \Illuminate\Database\Connection $connection - * @return array|string - */ - public function compileRenameColumn(Blueprint $blueprint, Fluent $command, Connection $connection) - { - return $connection->usingNativeSchemaOperations() - ? sprintf('alter table %s rename column %s to %s', - $this->wrapTable($blueprint), - $this->wrap($command->from), - $this->wrap($command->to) - ) - : parent::compileRenameColumn($blueprint, $command, $connection); - } - - /** - * Compile a primary key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compilePrimary(Blueprint $blueprint, Fluent $command) - { - $columns = $this->columnize($command->columns); - - return 'alter table '.$this->wrapTable($blueprint)." add primary key ({$columns})"; - } - - /** - * Compile a unique key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileUnique(Blueprint $blueprint, Fluent $command) - { - $sql = sprintf('alter table %s add constraint %s unique (%s)', - $this->wrapTable($blueprint), - $this->wrap($command->index), - $this->columnize($command->columns) - ); - - if (! is_null($command->deferrable)) { - $sql .= $command->deferrable ? ' deferrable' : ' not deferrable'; - } - - if ($command->deferrable && ! is_null($command->initiallyImmediate)) { - $sql .= $command->initiallyImmediate ? ' initially immediate' : ' initially deferred'; - } - - return $sql; - } - - /** - * Compile a plain index key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileIndex(Blueprint $blueprint, Fluent $command) - { - return sprintf('create index %s on %s%s (%s)', - $this->wrap($command->index), - $this->wrapTable($blueprint), - $command->algorithm ? ' using '.$command->algorithm : '', - $this->columnize($command->columns) - ); - } - - /** - * Compile a fulltext index key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - * - * @throws \RuntimeException - */ - public function compileFulltext(Blueprint $blueprint, Fluent $command) - { - $language = $command->language ?: 'english'; - - $columns = array_map(function ($column) use ($language) { - return "to_tsvector({$this->quoteString($language)}, {$this->wrap($column)})"; - }, $command->columns); - - return sprintf('create index %s on %s using gin ((%s))', - $this->wrap($command->index), - $this->wrapTable($blueprint), - implode(' || ', $columns) - ); - } - - /** - * Compile a spatial index key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileSpatialIndex(Blueprint $blueprint, Fluent $command) - { - $command->algorithm = 'gist'; - - return $this->compileIndex($blueprint, $command); - } - - /** - * Compile a foreign key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileForeign(Blueprint $blueprint, Fluent $command) - { - $sql = parent::compileForeign($blueprint, $command); - - if (! is_null($command->deferrable)) { - $sql .= $command->deferrable ? ' deferrable' : ' not deferrable'; - } - - if ($command->deferrable && ! is_null($command->initiallyImmediate)) { - $sql .= $command->initiallyImmediate ? ' initially immediate' : ' initially deferred'; - } - - if (! is_null($command->notValid)) { - $sql .= ' not valid'; - } - - return $sql; - } - - /** - * Compile a drop table command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDrop(Blueprint $blueprint, Fluent $command) - { - return 'drop table '.$this->wrapTable($blueprint); - } - - /** - * Compile a drop table (if exists) command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropIfExists(Blueprint $blueprint, Fluent $command) - { - return 'drop table if exists '.$this->wrapTable($blueprint); - } - - /** - * Compile the SQL needed to drop all tables. - * - * @param array $tables - * @return string - */ - public function compileDropAllTables($tables) - { - return 'drop table '.implode(',', $this->escapeNames($tables)).' cascade'; - } - - /** - * Compile the SQL needed to drop all views. - * - * @param array $views - * @return string - */ - public function compileDropAllViews($views) - { - return 'drop view '.implode(',', $this->escapeNames($views)).' cascade'; - } - - /** - * Compile the SQL needed to drop all types. - * - * @param array $types - * @return string - */ - public function compileDropAllTypes($types) - { - return 'drop type '.implode(',', $this->escapeNames($types)).' cascade'; - } - - /** - * Compile the SQL needed to retrieve all table names. - * - * @param string|array $searchPath - * @return string - */ - public function compileGetAllTables($searchPath) - { - return "select tablename, concat('\"', schemaname, '\".\"', tablename, '\"') as qualifiedname from pg_catalog.pg_tables where schemaname in ('".implode("','", (array) $searchPath)."')"; - } - - /** - * Compile the SQL needed to retrieve all view names. - * - * @param string|array $searchPath - * @return string - */ - public function compileGetAllViews($searchPath) - { - return "select viewname, concat('\"', schemaname, '\".\"', viewname, '\"') as qualifiedname from pg_catalog.pg_views where schemaname in ('".implode("','", (array) $searchPath)."')"; - } - - /** - * Compile the SQL needed to retrieve all type names. - * - * @return string - */ - public function compileGetAllTypes() - { - return 'select distinct pg_type.typname from pg_type inner join pg_enum on pg_enum.enumtypid = pg_type.oid'; - } - - /** - * Compile a drop column command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropColumn(Blueprint $blueprint, Fluent $command) - { - $columns = $this->prefixArray('drop column', $this->wrapArray($command->columns)); - - return 'alter table '.$this->wrapTable($blueprint).' '.implode(', ', $columns); - } - - /** - * Compile a drop primary key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropPrimary(Blueprint $blueprint, Fluent $command) - { - $index = $this->wrap("{$blueprint->getTable()}_pkey"); - - return 'alter table '.$this->wrapTable($blueprint)." drop constraint {$index}"; - } - - /** - * Compile a drop unique key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropUnique(Blueprint $blueprint, Fluent $command) - { - $index = $this->wrap($command->index); - - return "alter table {$this->wrapTable($blueprint)} drop constraint {$index}"; - } - - /** - * Compile a drop index command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropIndex(Blueprint $blueprint, Fluent $command) - { - return "drop index {$this->wrap($command->index)}"; - } - - /** - * Compile a drop fulltext index command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropFullText(Blueprint $blueprint, Fluent $command) - { - return $this->compileDropIndex($blueprint, $command); - } - - /** - * Compile a drop spatial index command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropSpatialIndex(Blueprint $blueprint, Fluent $command) - { - return $this->compileDropIndex($blueprint, $command); - } - - /** - * Compile a drop foreign key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropForeign(Blueprint $blueprint, Fluent $command) - { - $index = $this->wrap($command->index); - - return "alter table {$this->wrapTable($blueprint)} drop constraint {$index}"; - } - - /** - * Compile a rename table command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileRename(Blueprint $blueprint, Fluent $command) - { - $from = $this->wrapTable($blueprint); - - return "alter table {$from} rename to ".$this->wrapTable($command->to); - } - - /** - * Compile a rename index command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileRenameIndex(Blueprint $blueprint, Fluent $command) - { - return sprintf('alter index %s rename to %s', - $this->wrap($command->from), - $this->wrap($command->to) - ); - } - - /** - * Compile the command to enable foreign key constraints. - * - * @return string - */ - public function compileEnableForeignKeyConstraints() - { - return 'SET CONSTRAINTS ALL IMMEDIATE;'; - } - - /** - * Compile the command to disable foreign key constraints. - * - * @return string - */ - public function compileDisableForeignKeyConstraints() - { - return 'SET CONSTRAINTS ALL DEFERRED;'; - } - - /** - * Compile a comment command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileComment(Blueprint $blueprint, Fluent $command) - { - return sprintf('comment on column %s.%s is %s', - $this->wrapTable($blueprint), - $this->wrap($command->column->name), - "'".str_replace("'", "''", $command->value)."'" - ); - } - - /** - * Compile a table comment command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileTableComment(Blueprint $blueprint, Fluent $command) - { - return sprintf('comment on table %s is %s', - $this->wrapTable($blueprint), - "'".str_replace("'", "''", $command->comment)."'" - ); - } - - /** - * Quote-escape the given tables, views, or types. - * - * @param array $names - * @return array - */ - public function escapeNames($names) - { - return array_map(static function ($name) { - return '"'.collect(explode('.', $name)) - ->map(fn ($segment) => trim($segment, '\'"')) - ->implode('"."').'"'; - }, $names); - } - - /** - * Create the column definition for a char type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeChar(Fluent $column) - { - if ($column->length) { - return "char({$column->length})"; - } - - return 'char'; - } - - /** - * Create the column definition for a string type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeString(Fluent $column) - { - if ($column->length) { - return "varchar({$column->length})"; - } - - return 'varchar'; - } - - /** - * Create the column definition for a tiny text type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTinyText(Fluent $column) - { - return 'varchar(255)'; - } - - /** - * Create the column definition for a text type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeText(Fluent $column) - { - return 'text'; - } - - /** - * Create the column definition for a medium text type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeMediumText(Fluent $column) - { - return 'text'; - } - - /** - * Create the column definition for a long text type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeLongText(Fluent $column) - { - return 'text'; - } - - /** - * Create the column definition for an integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeInteger(Fluent $column) - { - return $this->generatableColumn('integer', $column); - } - - /** - * Create the column definition for a big integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeBigInteger(Fluent $column) - { - return $this->generatableColumn('bigint', $column); - } - - /** - * Create the column definition for a medium integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeMediumInteger(Fluent $column) - { - return $this->generatableColumn('integer', $column); - } - - /** - * Create the column definition for a tiny integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTinyInteger(Fluent $column) - { - return $this->generatableColumn('smallint', $column); - } - - /** - * Create the column definition for a small integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeSmallInteger(Fluent $column) - { - return $this->generatableColumn('smallint', $column); - } - - /** - * Create the column definition for a generatable column. - * - * @param string $type - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function generatableColumn($type, Fluent $column) - { - if (! $column->autoIncrement && is_null($column->generatedAs)) { - return $type; - } - - if ($column->autoIncrement && is_null($column->generatedAs)) { - return with([ - 'integer' => 'serial', - 'bigint' => 'bigserial', - 'smallint' => 'smallserial', - ])[$type]; - } - - $options = ''; - - if (! is_bool($column->generatedAs) && ! empty($column->generatedAs)) { - $options = sprintf(' (%s)', $column->generatedAs); - } - - return sprintf( - '%s generated %s as identity%s', - $type, - $column->always ? 'always' : 'by default', - $options - ); - } - - /** - * Create the column definition for a float type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeFloat(Fluent $column) - { - return $this->typeDouble($column); - } - - /** - * Create the column definition for a double type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDouble(Fluent $column) - { - return 'double precision'; - } - - /** - * Create the column definition for a real type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeReal(Fluent $column) - { - return 'real'; - } - - /** - * Create the column definition for a decimal type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDecimal(Fluent $column) - { - return "decimal({$column->total}, {$column->places})"; - } - - /** - * Create the column definition for a boolean type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeBoolean(Fluent $column) - { - return 'boolean'; - } - - /** - * Create the column definition for an enumeration type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeEnum(Fluent $column) - { - return sprintf( - 'varchar(255) check ("%s" in (%s))', - $column->name, - $this->quoteString($column->allowed) - ); - } - - /** - * Create the column definition for a json type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeJson(Fluent $column) - { - return 'json'; - } - - /** - * Create the column definition for a jsonb type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeJsonb(Fluent $column) - { - return 'jsonb'; - } - - /** - * Create the column definition for a date type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDate(Fluent $column) - { - return 'date'; - } - - /** - * Create the column definition for a date-time type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDateTime(Fluent $column) - { - return $this->typeTimestamp($column); - } - - /** - * Create the column definition for a date-time (with time zone) type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDateTimeTz(Fluent $column) - { - return $this->typeTimestampTz($column); - } - - /** - * Create the column definition for a time type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTime(Fluent $column) - { - return 'time'.(is_null($column->precision) ? '' : "($column->precision)").' without time zone'; - } - - /** - * Create the column definition for a time (with time zone) type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTimeTz(Fluent $column) - { - return 'time'.(is_null($column->precision) ? '' : "($column->precision)").' with time zone'; - } - - /** - * Create the column definition for a timestamp type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTimestamp(Fluent $column) - { - $columnType = 'timestamp'.(is_null($column->precision) ? '' : "($column->precision)").' without time zone'; - - return $column->useCurrent ? "$columnType default CURRENT_TIMESTAMP" : $columnType; - } - - /** - * Create the column definition for a timestamp (with time zone) type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTimestampTz(Fluent $column) - { - $columnType = 'timestamp'.(is_null($column->precision) ? '' : "($column->precision)").' with time zone'; - - return $column->useCurrent ? "$columnType default CURRENT_TIMESTAMP" : $columnType; - } - - /** - * Create the column definition for a year type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeYear(Fluent $column) - { - return $this->typeInteger($column); - } - - /** - * Create the column definition for a binary type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeBinary(Fluent $column) - { - return 'bytea'; - } - - /** - * Create the column definition for a uuid type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeUuid(Fluent $column) - { - return 'uuid'; - } - - /** - * Create the column definition for an IP address type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeIpAddress(Fluent $column) - { - return 'inet'; - } - - /** - * Create the column definition for a MAC address type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeMacAddress(Fluent $column) - { - return 'macaddr'; - } - - /** - * Create the column definition for a spatial Geometry type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeGeometry(Fluent $column) - { - return $this->formatPostGisType('geometry', $column); - } - - /** - * Create the column definition for a spatial Point type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typePoint(Fluent $column) - { - return $this->formatPostGisType('point', $column); - } - - /** - * Create the column definition for a spatial LineString type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeLineString(Fluent $column) - { - return $this->formatPostGisType('linestring', $column); - } - - /** - * Create the column definition for a spatial Polygon type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typePolygon(Fluent $column) - { - return $this->formatPostGisType('polygon', $column); - } - - /** - * Create the column definition for a spatial GeometryCollection type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeGeometryCollection(Fluent $column) - { - return $this->formatPostGisType('geometrycollection', $column); - } - - /** - * Create the column definition for a spatial MultiPoint type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeMultiPoint(Fluent $column) - { - return $this->formatPostGisType('multipoint', $column); - } - - /** - * Create the column definition for a spatial MultiLineString type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeMultiLineString(Fluent $column) - { - return $this->formatPostGisType('multilinestring', $column); - } - - /** - * Create the column definition for a spatial MultiPolygon type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeMultiPolygon(Fluent $column) - { - return $this->formatPostGisType('multipolygon', $column); - } - - /** - * Create the column definition for a spatial MultiPolygonZ type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeMultiPolygonZ(Fluent $column) - { - return $this->formatPostGisType('multipolygonz', $column); - } - - /** - * Format the column definition for a PostGIS spatial type. - * - * @param string $type - * @param \Illuminate\Support\Fluent $column - * @return string - */ - private function formatPostGisType($type, Fluent $column) - { - if ($column->isGeometry === null) { - return sprintf('geography(%s, %s)', $type, $column->projection ?? '4326'); - } - - if ($column->projection !== null) { - return sprintf('geometry(%s, %s)', $type, $column->projection); - } - - return "geometry({$type})"; - } - - /** - * Get the SQL for a collation column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyCollate(Blueprint $blueprint, Fluent $column) - { - if (! is_null($column->collation)) { - return ' collate '.$this->wrapValue($column->collation); - } - } - - /** - * Get the SQL for a nullable column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyNullable(Blueprint $blueprint, Fluent $column) - { - return $column->nullable ? ' null' : ' not null'; - } - - /** - * Get the SQL for a default column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyDefault(Blueprint $blueprint, Fluent $column) - { - if (! is_null($column->default)) { - return ' default '.$this->getDefaultValue($column->default); - } - } - - /** - * Get the SQL for an auto-increment column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyIncrement(Blueprint $blueprint, Fluent $column) - { - if ((in_array($column->type, $this->serials) || ($column->generatedAs !== null)) && $column->autoIncrement) { - return ' primary key'; - } - } - - /** - * Get the SQL for a generated virtual column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyVirtualAs(Blueprint $blueprint, Fluent $column) - { - if ($column->virtualAs !== null) { - return " generated always as ({$column->virtualAs})"; - } - } - - /** - * Get the SQL for a generated stored column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyStoredAs(Blueprint $blueprint, Fluent $column) - { - if ($column->storedAs !== null) { - return " generated always as ({$column->storedAs}) stored"; - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/RenameColumn.php b/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/RenameColumn.php deleted file mode 100644 index 0db0c507..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/RenameColumn.php +++ /dev/null @@ -1,84 +0,0 @@ -getDoctrineSchemaManager(); - $databasePlatform = $schema->getDatabasePlatform(); - $databasePlatform->registerDoctrineTypeMapping('enum', 'string'); - - $column = $connection->getDoctrineColumn( - $grammar->getTablePrefix().$blueprint->getTable(), $command->from - ); - - return (array) $databasePlatform->getAlterTableSQL(static::getRenamedDiff( - $grammar, $blueprint, $command, $column, $schema - )); - } - - /** - * Get a new column instance with the new column name. - * - * @param \Illuminate\Database\Schema\Grammars\Grammar $grammar - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @param \Doctrine\DBAL\Schema\Column $column - * @param \Doctrine\DBAL\Schema\AbstractSchemaManager $schema - * @return \Doctrine\DBAL\Schema\TableDiff - */ - protected static function getRenamedDiff(Grammar $grammar, Blueprint $blueprint, Fluent $command, Column $column, SchemaManager $schema) - { - return static::setRenamedColumns( - $grammar->getDoctrineTableDiff($blueprint, $schema), $command, $column - ); - } - - /** - * Set the renamed columns on the table diff. - * - * @param \Doctrine\DBAL\Schema\TableDiff $tableDiff - * @param \Illuminate\Support\Fluent $command - * @param \Doctrine\DBAL\Schema\Column $column - * @return \Doctrine\DBAL\Schema\TableDiff - */ - protected static function setRenamedColumns(TableDiff $tableDiff, Fluent $command, Column $column) - { - $tableDiff->renamedColumns = [ - $command->from => new Column($command->to, $column->getType(), self::getWritableColumnOptions($column)), - ]; - - return $tableDiff; - } - - /** - * Get the writable column options. - * - * @param \Doctrine\DBAL\Schema\Column $column - * @return array - */ - private static function getWritableColumnOptions(Column $column) - { - return array_filter($column->toArray(), function (string $name) use ($column) { - return method_exists($column, 'set'.$name); - }, ARRAY_FILTER_USE_KEY); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php b/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php deleted file mode 100755 index c9d1c550..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php +++ /dev/null @@ -1,1005 +0,0 @@ -wrap(str_replace('.', '__', $table)).')'; - } - - /** - * Compile a create table command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileCreate(Blueprint $blueprint, Fluent $command) - { - return sprintf('%s table %s (%s%s%s)', - $blueprint->temporary ? 'create temporary' : 'create', - $this->wrapTable($blueprint), - implode(', ', $this->getColumns($blueprint)), - (string) $this->addForeignKeys($blueprint), - (string) $this->addPrimaryKeys($blueprint) - ); - } - - /** - * Get the foreign key syntax for a table creation statement. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @return string|null - */ - protected function addForeignKeys(Blueprint $blueprint) - { - $foreigns = $this->getCommandsByName($blueprint, 'foreign'); - - return collect($foreigns)->reduce(function ($sql, $foreign) { - // Once we have all the foreign key commands for the table creation statement - // we'll loop through each of them and add them to the create table SQL we - // are building, since SQLite needs foreign keys on the tables creation. - $sql .= $this->getForeignKey($foreign); - - if (! is_null($foreign->onDelete)) { - $sql .= " on delete {$foreign->onDelete}"; - } - - // If this foreign key specifies the action to be taken on update we will add - // that to the statement here. We'll append it to this SQL and then return - // the SQL so we can keep adding any other foreign constraints onto this. - if (! is_null($foreign->onUpdate)) { - $sql .= " on update {$foreign->onUpdate}"; - } - - return $sql; - }, ''); - } - - /** - * Get the SQL for the foreign key. - * - * @param \Illuminate\Support\Fluent $foreign - * @return string - */ - protected function getForeignKey($foreign) - { - // We need to columnize the columns that the foreign key is being defined for - // so that it is a properly formatted list. Once we have done this, we can - // return the foreign key SQL declaration to the calling method for use. - return sprintf(', foreign key(%s) references %s(%s)', - $this->columnize($foreign->columns), - $this->wrapTable($foreign->on), - $this->columnize((array) $foreign->references) - ); - } - - /** - * Get the primary key syntax for a table creation statement. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @return string|null - */ - protected function addPrimaryKeys(Blueprint $blueprint) - { - if (! is_null($primary = $this->getCommandByName($blueprint, 'primary'))) { - return ", primary key ({$this->columnize($primary->columns)})"; - } - } - - /** - * Compile alter table commands for adding columns. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return array - */ - public function compileAdd(Blueprint $blueprint, Fluent $command) - { - $columns = $this->prefixArray('add column', $this->getColumns($blueprint)); - - return collect($columns)->reject(function ($column) { - return preg_match('/as \(.*\) stored/', $column) > 0; - })->map(function ($column) use ($blueprint) { - return 'alter table '.$this->wrapTable($blueprint).' '.$column; - })->all(); - } - - /** - * Compile a rename column command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @param \Illuminate\Database\Connection $connection - * @return array|string - */ - public function compileRenameColumn(Blueprint $blueprint, Fluent $command, Connection $connection) - { - return $connection->usingNativeSchemaOperations() - ? sprintf('alter table %s rename column %s to %s', - $this->wrapTable($blueprint), - $this->wrap($command->from), - $this->wrap($command->to) - ) - : parent::compileRenameColumn($blueprint, $command, $connection); - } - - /** - * Compile a unique key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileUnique(Blueprint $blueprint, Fluent $command) - { - return sprintf('create unique index %s on %s (%s)', - $this->wrap($command->index), - $this->wrapTable($blueprint), - $this->columnize($command->columns) - ); - } - - /** - * Compile a plain index key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileIndex(Blueprint $blueprint, Fluent $command) - { - return sprintf('create index %s on %s (%s)', - $this->wrap($command->index), - $this->wrapTable($blueprint), - $this->columnize($command->columns) - ); - } - - /** - * Compile a spatial index key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return void - * - * @throws \RuntimeException - */ - public function compileSpatialIndex(Blueprint $blueprint, Fluent $command) - { - throw new RuntimeException('The database driver in use does not support spatial indexes.'); - } - - /** - * Compile a foreign key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileForeign(Blueprint $blueprint, Fluent $command) - { - // Handled on table creation... - } - - /** - * Compile a drop table command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDrop(Blueprint $blueprint, Fluent $command) - { - return 'drop table '.$this->wrapTable($blueprint); - } - - /** - * Compile a drop table (if exists) command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropIfExists(Blueprint $blueprint, Fluent $command) - { - return 'drop table if exists '.$this->wrapTable($blueprint); - } - - /** - * Compile the SQL needed to drop all tables. - * - * @return string - */ - public function compileDropAllTables() - { - return "delete from sqlite_master where type in ('table', 'index', 'trigger')"; - } - - /** - * Compile the SQL needed to drop all views. - * - * @return string - */ - public function compileDropAllViews() - { - return "delete from sqlite_master where type in ('view')"; - } - - /** - * Compile the SQL needed to retrieve all table names. - * - * @return string - */ - public function compileGetAllTables() - { - return 'select type, name from sqlite_master where type = \'table\' and name not like \'sqlite_%\''; - } - - /** - * Compile the SQL needed to retrieve all view names. - * - * @return string - */ - public function compileGetAllViews() - { - return 'select type, name from sqlite_master where type = \'view\''; - } - - /** - * Compile the SQL needed to rebuild the database. - * - * @return string - */ - public function compileRebuild() - { - return 'vacuum'; - } - - /** - * Compile a drop column command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @param \Illuminate\Database\Connection $connection - * @return array - */ - public function compileDropColumn(Blueprint $blueprint, Fluent $command, Connection $connection) - { - if ($connection->usingNativeSchemaOperations()) { - $table = $this->wrapTable($blueprint); - - $columns = $this->prefixArray('drop column', $this->wrapArray($command->columns)); - - return collect($columns)->map(fn ($column) => 'alter table '.$table.' '.$column - )->all(); - } else { - $tableDiff = $this->getDoctrineTableDiff( - $blueprint, $schema = $connection->getDoctrineSchemaManager() - ); - - foreach ($command->columns as $name) { - $tableDiff->removedColumns[$name] = $connection->getDoctrineColumn( - $this->getTablePrefix().$blueprint->getTable(), $name - ); - } - - return (array) $schema->getDatabasePlatform()->getAlterTableSQL($tableDiff); - } - } - - /** - * Compile a drop unique key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropUnique(Blueprint $blueprint, Fluent $command) - { - $index = $this->wrap($command->index); - - return "drop index {$index}"; - } - - /** - * Compile a drop index command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropIndex(Blueprint $blueprint, Fluent $command) - { - $index = $this->wrap($command->index); - - return "drop index {$index}"; - } - - /** - * Compile a drop spatial index command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return void - * - * @throws \RuntimeException - */ - public function compileDropSpatialIndex(Blueprint $blueprint, Fluent $command) - { - throw new RuntimeException('The database driver in use does not support spatial indexes.'); - } - - /** - * Compile a rename table command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileRename(Blueprint $blueprint, Fluent $command) - { - $from = $this->wrapTable($blueprint); - - return "alter table {$from} rename to ".$this->wrapTable($command->to); - } - - /** - * Compile a rename index command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @param \Illuminate\Database\Connection $connection - * @return array - * - * @throws \RuntimeException - */ - public function compileRenameIndex(Blueprint $blueprint, Fluent $command, Connection $connection) - { - $schemaManager = $connection->getDoctrineSchemaManager(); - - $indexes = $schemaManager->listTableIndexes($this->getTablePrefix().$blueprint->getTable()); - - $index = Arr::get($indexes, $command->from); - - if (! $index) { - throw new RuntimeException("Index [{$command->from}] does not exist."); - } - - $newIndex = new Index( - $command->to, $index->getColumns(), $index->isUnique(), - $index->isPrimary(), $index->getFlags(), $index->getOptions() - ); - - $platform = $schemaManager->getDatabasePlatform(); - - return [ - $platform->getDropIndexSQL($command->from, $this->getTablePrefix().$blueprint->getTable()), - $platform->getCreateIndexSQL($newIndex, $this->getTablePrefix().$blueprint->getTable()), - ]; - } - - /** - * Compile the command to enable foreign key constraints. - * - * @return string - */ - public function compileEnableForeignKeyConstraints() - { - return 'PRAGMA foreign_keys = ON;'; - } - - /** - * Compile the command to disable foreign key constraints. - * - * @return string - */ - public function compileDisableForeignKeyConstraints() - { - return 'PRAGMA foreign_keys = OFF;'; - } - - /** - * Compile the SQL needed to enable a writable schema. - * - * @return string - */ - public function compileEnableWriteableSchema() - { - return 'PRAGMA writable_schema = 1;'; - } - - /** - * Compile the SQL needed to disable a writable schema. - * - * @return string - */ - public function compileDisableWriteableSchema() - { - return 'PRAGMA writable_schema = 0;'; - } - - /** - * Create the column definition for a char type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeChar(Fluent $column) - { - return 'varchar'; - } - - /** - * Create the column definition for a string type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeString(Fluent $column) - { - return 'varchar'; - } - - /** - * Create the column definition for a tiny text type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTinyText(Fluent $column) - { - return 'text'; - } - - /** - * Create the column definition for a text type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeText(Fluent $column) - { - return 'text'; - } - - /** - * Create the column definition for a medium text type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeMediumText(Fluent $column) - { - return 'text'; - } - - /** - * Create the column definition for a long text type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeLongText(Fluent $column) - { - return 'text'; - } - - /** - * Create the column definition for an integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeInteger(Fluent $column) - { - return 'integer'; - } - - /** - * Create the column definition for a big integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeBigInteger(Fluent $column) - { - return 'integer'; - } - - /** - * Create the column definition for a medium integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeMediumInteger(Fluent $column) - { - return 'integer'; - } - - /** - * Create the column definition for a tiny integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTinyInteger(Fluent $column) - { - return 'integer'; - } - - /** - * Create the column definition for a small integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeSmallInteger(Fluent $column) - { - return 'integer'; - } - - /** - * Create the column definition for a float type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeFloat(Fluent $column) - { - return 'float'; - } - - /** - * Create the column definition for a double type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDouble(Fluent $column) - { - return 'float'; - } - - /** - * Create the column definition for a decimal type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDecimal(Fluent $column) - { - return 'numeric'; - } - - /** - * Create the column definition for a boolean type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeBoolean(Fluent $column) - { - return 'tinyint(1)'; - } - - /** - * Create the column definition for an enumeration type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeEnum(Fluent $column) - { - return sprintf( - 'varchar check ("%s" in (%s))', - $column->name, - $this->quoteString($column->allowed) - ); - } - - /** - * Create the column definition for a json type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeJson(Fluent $column) - { - return 'text'; - } - - /** - * Create the column definition for a jsonb type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeJsonb(Fluent $column) - { - return 'text'; - } - - /** - * Create the column definition for a date type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDate(Fluent $column) - { - return 'date'; - } - - /** - * Create the column definition for a date-time type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDateTime(Fluent $column) - { - return $this->typeTimestamp($column); - } - - /** - * Create the column definition for a date-time (with time zone) type. - * - * Note: "SQLite does not have a storage class set aside for storing dates and/or times." - * - * @link https://www.sqlite.org/datatype3.html - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDateTimeTz(Fluent $column) - { - return $this->typeDateTime($column); - } - - /** - * Create the column definition for a time type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTime(Fluent $column) - { - return 'time'; - } - - /** - * Create the column definition for a time (with time zone) type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTimeTz(Fluent $column) - { - return $this->typeTime($column); - } - - /** - * Create the column definition for a timestamp type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTimestamp(Fluent $column) - { - return $column->useCurrent ? 'datetime default CURRENT_TIMESTAMP' : 'datetime'; - } - - /** - * Create the column definition for a timestamp (with time zone) type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTimestampTz(Fluent $column) - { - return $this->typeTimestamp($column); - } - - /** - * Create the column definition for a year type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeYear(Fluent $column) - { - return $this->typeInteger($column); - } - - /** - * Create the column definition for a binary type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeBinary(Fluent $column) - { - return 'blob'; - } - - /** - * Create the column definition for a uuid type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeUuid(Fluent $column) - { - return 'varchar'; - } - - /** - * Create the column definition for an IP address type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeIpAddress(Fluent $column) - { - return 'varchar'; - } - - /** - * Create the column definition for a MAC address type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeMacAddress(Fluent $column) - { - return 'varchar'; - } - - /** - * Create the column definition for a spatial Geometry type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeGeometry(Fluent $column) - { - return 'geometry'; - } - - /** - * Create the column definition for a spatial Point type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typePoint(Fluent $column) - { - return 'point'; - } - - /** - * Create the column definition for a spatial LineString type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeLineString(Fluent $column) - { - return 'linestring'; - } - - /** - * Create the column definition for a spatial Polygon type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typePolygon(Fluent $column) - { - return 'polygon'; - } - - /** - * Create the column definition for a spatial GeometryCollection type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeGeometryCollection(Fluent $column) - { - return 'geometrycollection'; - } - - /** - * Create the column definition for a spatial MultiPoint type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeMultiPoint(Fluent $column) - { - return 'multipoint'; - } - - /** - * Create the column definition for a spatial MultiLineString type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeMultiLineString(Fluent $column) - { - return 'multilinestring'; - } - - /** - * Create the column definition for a spatial MultiPolygon type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeMultiPolygon(Fluent $column) - { - return 'multipolygon'; - } - - /** - * Create the column definition for a generated, computed column type. - * - * @param \Illuminate\Support\Fluent $column - * @return void - * - * @throws \RuntimeException - */ - protected function typeComputed(Fluent $column) - { - throw new RuntimeException('This database driver requires a type, see the virtualAs / storedAs modifiers.'); - } - - /** - * Get the SQL for a generated virtual column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyVirtualAs(Blueprint $blueprint, Fluent $column) - { - if (! is_null($virtualAs = $column->virtualAsJson)) { - if ($this->isJsonSelector($virtualAs)) { - $virtualAs = $this->wrapJsonSelector($virtualAs); - } - - return " as ({$virtualAs})"; - } - - if (! is_null($virtualAs = $column->virtualAs)) { - return " as ({$virtualAs})"; - } - } - - /** - * Get the SQL for a generated stored column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyStoredAs(Blueprint $blueprint, Fluent $column) - { - if (! is_null($storedAs = $column->storedAsJson)) { - if ($this->isJsonSelector($storedAs)) { - $storedAs = $this->wrapJsonSelector($storedAs); - } - - return " as ({$storedAs}) stored"; - } - - if (! is_null($storedAs = $column->storedAs)) { - return " as ({$column->storedAs}) stored"; - } - } - - /** - * Get the SQL for a nullable column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyNullable(Blueprint $blueprint, Fluent $column) - { - if (is_null($column->virtualAs) && - is_null($column->virtualAsJson) && - is_null($column->storedAs) && - is_null($column->storedAsJson)) { - return $column->nullable ? '' : ' not null'; - } - - if ($column->nullable === false) { - return ' not null'; - } - } - - /** - * Get the SQL for a default column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyDefault(Blueprint $blueprint, Fluent $column) - { - if (! is_null($column->default) && is_null($column->virtualAs) && is_null($column->virtualAsJson) && is_null($column->storedAs)) { - return ' default '.$this->getDefaultValue($column->default); - } - } - - /** - * Get the SQL for an auto-increment column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyIncrement(Blueprint $blueprint, Fluent $column) - { - if (in_array($column->type, $this->serials) && $column->autoIncrement) { - return ' primary key autoincrement'; - } - } - - /** - * Wrap the given JSON selector. - * - * @param string $value - * @return string - */ - protected function wrapJsonSelector($value) - { - [$field, $path] = $this->wrapJsonFieldAndPath($value); - - return 'json_extract('.$field.$path.')'; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/SqlServerGrammar.php b/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/SqlServerGrammar.php deleted file mode 100755 index 4d7271ca..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/SqlServerGrammar.php +++ /dev/null @@ -1,973 +0,0 @@ -wrapValue($name), - ); - } - - /** - * Compile a drop database if exists command. - * - * @param string $name - * @return string - */ - public function compileDropDatabaseIfExists($name) - { - return sprintf( - 'drop database if exists %s', - $this->wrapValue($name) - ); - } - - /** - * Compile the query to determine if a table exists. - * - * @return string - */ - public function compileTableExists() - { - return "select * from sys.sysobjects where id = object_id(?) and xtype in ('U', 'V')"; - } - - /** - * Compile the query to determine the list of columns. - * - * @param string $table - * @return string - */ - public function compileColumnListing($table) - { - return "select name from sys.columns where object_id = object_id('$table')"; - } - - /** - * Compile a create table command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileCreate(Blueprint $blueprint, Fluent $command) - { - $columns = implode(', ', $this->getColumns($blueprint)); - - return 'create table '.$this->wrapTable($blueprint)." ($columns)"; - } - - /** - * Compile a column addition table command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileAdd(Blueprint $blueprint, Fluent $command) - { - return sprintf('alter table %s add %s', - $this->wrapTable($blueprint), - implode(', ', $this->getColumns($blueprint)) - ); - } - - /** - * Compile a rename column command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @param \Illuminate\Database\Connection $connection - * @return array|string - */ - public function compileRenameColumn(Blueprint $blueprint, Fluent $command, Connection $connection) - { - return $connection->usingNativeSchemaOperations() - ? sprintf("sp_rename '%s', %s, 'COLUMN'", - $this->wrap($blueprint->getTable().'.'.$command->from), - $this->wrap($command->to) - ) - : parent::compileRenameColumn($blueprint, $command, $connection); - } - - /** - * Compile a primary key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compilePrimary(Blueprint $blueprint, Fluent $command) - { - return sprintf('alter table %s add constraint %s primary key (%s)', - $this->wrapTable($blueprint), - $this->wrap($command->index), - $this->columnize($command->columns) - ); - } - - /** - * Compile a unique key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileUnique(Blueprint $blueprint, Fluent $command) - { - return sprintf('create unique index %s on %s (%s)', - $this->wrap($command->index), - $this->wrapTable($blueprint), - $this->columnize($command->columns) - ); - } - - /** - * Compile a plain index key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileIndex(Blueprint $blueprint, Fluent $command) - { - return sprintf('create index %s on %s (%s)', - $this->wrap($command->index), - $this->wrapTable($blueprint), - $this->columnize($command->columns) - ); - } - - /** - * Compile a spatial index key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileSpatialIndex(Blueprint $blueprint, Fluent $command) - { - return sprintf('create spatial index %s on %s (%s)', - $this->wrap($command->index), - $this->wrapTable($blueprint), - $this->columnize($command->columns) - ); - } - - /** - * Compile a drop table command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDrop(Blueprint $blueprint, Fluent $command) - { - return 'drop table '.$this->wrapTable($blueprint); - } - - /** - * Compile a drop table (if exists) command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropIfExists(Blueprint $blueprint, Fluent $command) - { - return sprintf('if exists (select * from sys.sysobjects where id = object_id(%s, \'U\')) drop table %s', - "'".str_replace("'", "''", $this->getTablePrefix().$blueprint->getTable())."'", - $this->wrapTable($blueprint) - ); - } - - /** - * Compile the SQL needed to drop all tables. - * - * @return string - */ - public function compileDropAllTables() - { - return "EXEC sp_msforeachtable 'DROP TABLE ?'"; - } - - /** - * Compile a drop column command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropColumn(Blueprint $blueprint, Fluent $command) - { - $columns = $this->wrapArray($command->columns); - - $dropExistingConstraintsSql = $this->compileDropDefaultConstraint($blueprint, $command).';'; - - return $dropExistingConstraintsSql.'alter table '.$this->wrapTable($blueprint).' drop column '.implode(', ', $columns); - } - - /** - * Compile a drop default constraint command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropDefaultConstraint(Blueprint $blueprint, Fluent $command) - { - $columns = "'".implode("','", $command->columns)."'"; - - $tableName = $this->getTablePrefix().$blueprint->getTable(); - - $sql = "DECLARE @sql NVARCHAR(MAX) = '';"; - $sql .= "SELECT @sql += 'ALTER TABLE [dbo].[{$tableName}] DROP CONSTRAINT ' + OBJECT_NAME([default_object_id]) + ';' "; - $sql .= 'FROM sys.columns '; - $sql .= "WHERE [object_id] = OBJECT_ID('[dbo].[{$tableName}]') AND [name] in ({$columns}) AND [default_object_id] <> 0;"; - $sql .= 'EXEC(@sql)'; - - return $sql; - } - - /** - * Compile a drop primary key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropPrimary(Blueprint $blueprint, Fluent $command) - { - $index = $this->wrap($command->index); - - return "alter table {$this->wrapTable($blueprint)} drop constraint {$index}"; - } - - /** - * Compile a drop unique key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropUnique(Blueprint $blueprint, Fluent $command) - { - $index = $this->wrap($command->index); - - return "drop index {$index} on {$this->wrapTable($blueprint)}"; - } - - /** - * Compile a drop index command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropIndex(Blueprint $blueprint, Fluent $command) - { - $index = $this->wrap($command->index); - - return "drop index {$index} on {$this->wrapTable($blueprint)}"; - } - - /** - * Compile a drop spatial index command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropSpatialIndex(Blueprint $blueprint, Fluent $command) - { - return $this->compileDropIndex($blueprint, $command); - } - - /** - * Compile a drop foreign key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropForeign(Blueprint $blueprint, Fluent $command) - { - $index = $this->wrap($command->index); - - return "alter table {$this->wrapTable($blueprint)} drop constraint {$index}"; - } - - /** - * Compile a rename table command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileRename(Blueprint $blueprint, Fluent $command) - { - $from = $this->wrapTable($blueprint); - - return "sp_rename {$from}, ".$this->wrapTable($command->to); - } - - /** - * Compile a rename index command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileRenameIndex(Blueprint $blueprint, Fluent $command) - { - return sprintf("sp_rename N'%s', %s, N'INDEX'", - $this->wrap($blueprint->getTable().'.'.$command->from), - $this->wrap($command->to) - ); - } - - /** - * Compile the command to enable foreign key constraints. - * - * @return string - */ - public function compileEnableForeignKeyConstraints() - { - return 'EXEC sp_msforeachtable @command1="print \'?\'", @command2="ALTER TABLE ? WITH CHECK CHECK CONSTRAINT all";'; - } - - /** - * Compile the command to disable foreign key constraints. - * - * @return string - */ - public function compileDisableForeignKeyConstraints() - { - return 'EXEC sp_msforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all";'; - } - - /** - * Compile the command to drop all foreign keys. - * - * @return string - */ - public function compileDropAllForeignKeys() - { - return "DECLARE @sql NVARCHAR(MAX) = N''; - SELECT @sql += 'ALTER TABLE ' - + QUOTENAME(OBJECT_SCHEMA_NAME(parent_object_id)) + '.' + + QUOTENAME(OBJECT_NAME(parent_object_id)) - + ' DROP CONSTRAINT ' + QUOTENAME(name) + ';' - FROM sys.foreign_keys; - - EXEC sp_executesql @sql;"; - } - - /** - * Compile the command to drop all views. - * - * @return string - */ - public function compileDropAllViews() - { - return "DECLARE @sql NVARCHAR(MAX) = N''; - SELECT @sql += 'DROP VIEW ' + QUOTENAME(OBJECT_SCHEMA_NAME(object_id)) + '.' + QUOTENAME(name) + ';' - FROM sys.views; - - EXEC sp_executesql @sql;"; - } - - /** - * Compile the SQL needed to retrieve all table names. - * - * @return string - */ - public function compileGetAllTables() - { - return "select name, type from sys.tables where type = 'U'"; - } - - /** - * Compile the SQL needed to retrieve all view names. - * - * @return string - */ - public function compileGetAllViews() - { - return "select name, type from sys.objects where type = 'V'"; - } - - /** - * Create the column definition for a char type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeChar(Fluent $column) - { - return "nchar({$column->length})"; - } - - /** - * Create the column definition for a string type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeString(Fluent $column) - { - return "nvarchar({$column->length})"; - } - - /** - * Create the column definition for a tiny text type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTinyText(Fluent $column) - { - return 'nvarchar(255)'; - } - - /** - * Create the column definition for a text type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeText(Fluent $column) - { - return 'nvarchar(max)'; - } - - /** - * Create the column definition for a medium text type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeMediumText(Fluent $column) - { - return 'nvarchar(max)'; - } - - /** - * Create the column definition for a long text type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeLongText(Fluent $column) - { - return 'nvarchar(max)'; - } - - /** - * Create the column definition for an integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeInteger(Fluent $column) - { - return 'int'; - } - - /** - * Create the column definition for a big integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeBigInteger(Fluent $column) - { - return 'bigint'; - } - - /** - * Create the column definition for a medium integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeMediumInteger(Fluent $column) - { - return 'int'; - } - - /** - * Create the column definition for a tiny integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTinyInteger(Fluent $column) - { - return 'tinyint'; - } - - /** - * Create the column definition for a small integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeSmallInteger(Fluent $column) - { - return 'smallint'; - } - - /** - * Create the column definition for a float type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeFloat(Fluent $column) - { - return 'float'; - } - - /** - * Create the column definition for a double type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDouble(Fluent $column) - { - return 'float'; - } - - /** - * Create the column definition for a decimal type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDecimal(Fluent $column) - { - return "decimal({$column->total}, {$column->places})"; - } - - /** - * Create the column definition for a boolean type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeBoolean(Fluent $column) - { - return 'bit'; - } - - /** - * Create the column definition for an enumeration type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeEnum(Fluent $column) - { - return sprintf( - 'nvarchar(255) check ("%s" in (%s))', - $column->name, - $this->quoteString($column->allowed) - ); - } - - /** - * Create the column definition for a json type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeJson(Fluent $column) - { - return 'nvarchar(max)'; - } - - /** - * Create the column definition for a jsonb type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeJsonb(Fluent $column) - { - return 'nvarchar(max)'; - } - - /** - * Create the column definition for a date type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDate(Fluent $column) - { - return 'date'; - } - - /** - * Create the column definition for a date-time type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDateTime(Fluent $column) - { - return $this->typeTimestamp($column); - } - - /** - * Create the column definition for a date-time (with time zone) type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDateTimeTz(Fluent $column) - { - return $this->typeTimestampTz($column); - } - - /** - * Create the column definition for a time type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTime(Fluent $column) - { - return $column->precision ? "time($column->precision)" : 'time'; - } - - /** - * Create the column definition for a time (with time zone) type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTimeTz(Fluent $column) - { - return $this->typeTime($column); - } - - /** - * Create the column definition for a timestamp type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTimestamp(Fluent $column) - { - $columnType = $column->precision ? "datetime2($column->precision)" : 'datetime'; - - return $column->useCurrent ? "$columnType default CURRENT_TIMESTAMP" : $columnType; - } - - /** - * Create the column definition for a timestamp (with time zone) type. - * - * @link https://docs.microsoft.com/en-us/sql/t-sql/data-types/datetimeoffset-transact-sql?view=sql-server-ver15 - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTimestampTz(Fluent $column) - { - $columnType = $column->precision ? "datetimeoffset($column->precision)" : 'datetimeoffset'; - - return $column->useCurrent ? "$columnType default CURRENT_TIMESTAMP" : $columnType; - } - - /** - * Create the column definition for a year type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeYear(Fluent $column) - { - return $this->typeInteger($column); - } - - /** - * Create the column definition for a binary type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeBinary(Fluent $column) - { - return 'varbinary(max)'; - } - - /** - * Create the column definition for a uuid type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeUuid(Fluent $column) - { - return 'uniqueidentifier'; - } - - /** - * Create the column definition for an IP address type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeIpAddress(Fluent $column) - { - return 'nvarchar(45)'; - } - - /** - * Create the column definition for a MAC address type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeMacAddress(Fluent $column) - { - return 'nvarchar(17)'; - } - - /** - * Create the column definition for a spatial Geometry type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeGeometry(Fluent $column) - { - return 'geography'; - } - - /** - * Create the column definition for a spatial Point type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typePoint(Fluent $column) - { - return 'geography'; - } - - /** - * Create the column definition for a spatial LineString type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeLineString(Fluent $column) - { - return 'geography'; - } - - /** - * Create the column definition for a spatial Polygon type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typePolygon(Fluent $column) - { - return 'geography'; - } - - /** - * Create the column definition for a spatial GeometryCollection type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeGeometryCollection(Fluent $column) - { - return 'geography'; - } - - /** - * Create the column definition for a spatial MultiPoint type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeMultiPoint(Fluent $column) - { - return 'geography'; - } - - /** - * Create the column definition for a spatial MultiLineString type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeMultiLineString(Fluent $column) - { - return 'geography'; - } - - /** - * Create the column definition for a spatial MultiPolygon type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeMultiPolygon(Fluent $column) - { - return 'geography'; - } - - /** - * Create the column definition for a generated, computed column type. - * - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function typeComputed(Fluent $column) - { - return "as ({$column->expression})"; - } - - /** - * Get the SQL for a collation column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyCollate(Blueprint $blueprint, Fluent $column) - { - if (! is_null($column->collation)) { - return ' collate '.$column->collation; - } - } - - /** - * Get the SQL for a nullable column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyNullable(Blueprint $blueprint, Fluent $column) - { - if ($column->type !== 'computed') { - return $column->nullable ? ' null' : ' not null'; - } - } - - /** - * Get the SQL for a default column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyDefault(Blueprint $blueprint, Fluent $column) - { - if (! is_null($column->default)) { - return ' default '.$this->getDefaultValue($column->default); - } - } - - /** - * Get the SQL for an auto-increment column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyIncrement(Blueprint $blueprint, Fluent $column) - { - if (in_array($column->type, $this->serials) && $column->autoIncrement) { - return ' identity primary key'; - } - } - - /** - * Get the SQL for a generated stored column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyPersisted(Blueprint $blueprint, Fluent $column) - { - if ($column->persisted) { - return ' persisted'; - } - } - - /** - * Wrap a table in keyword identifiers. - * - * @param \Illuminate\Database\Query\Expression|string $table - * @return string - */ - public function wrapTable($table) - { - if ($table instanceof Blueprint && $table->temporary) { - $this->setTablePrefix('#'); - } - - return parent::wrapTable($table); - } - - /** - * Quote the given string literal. - * - * @param string|array $value - * @return string - */ - public function quoteString($value) - { - if (is_array($value)) { - return implode(', ', array_map([$this, __FUNCTION__], $value)); - } - - return "N'$value'"; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Schema/IndexDefinition.php b/vendor/laravel/framework/src/Illuminate/Database/Schema/IndexDefinition.php deleted file mode 100644 index fc5d78e5..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Schema/IndexDefinition.php +++ /dev/null @@ -1,16 +0,0 @@ -connection->statement( - $this->grammar->compileCreateDatabase($name, $this->connection) - ); - } - - /** - * Drop a database from the schema if the database exists. - * - * @param string $name - * @return bool - */ - public function dropDatabaseIfExists($name) - { - return $this->connection->statement( - $this->grammar->compileDropDatabaseIfExists($name) - ); - } - - /** - * Determine if the given table exists. - * - * @param string $table - * @return bool - */ - public function hasTable($table) - { - $table = $this->connection->getTablePrefix().$table; - - return count($this->connection->selectFromWriteConnection( - $this->grammar->compileTableExists(), [$this->connection->getDatabaseName(), $table] - )) > 0; - } - - /** - * Get the column listing for a given table. - * - * @param string $table - * @return array - */ - public function getColumnListing($table) - { - $table = $this->connection->getTablePrefix().$table; - - $results = $this->connection->selectFromWriteConnection( - $this->grammar->compileColumnListing(), [$this->connection->getDatabaseName(), $table] - ); - - return $this->connection->getPostProcessor()->processColumnListing($results); - } - - /** - * Drop all tables from the database. - * - * @return void - */ - public function dropAllTables() - { - $tables = []; - - foreach ($this->getAllTables() as $row) { - $row = (array) $row; - - $tables[] = reset($row); - } - - if (empty($tables)) { - return; - } - - $this->disableForeignKeyConstraints(); - - $this->connection->statement( - $this->grammar->compileDropAllTables($tables) - ); - - $this->enableForeignKeyConstraints(); - } - - /** - * Drop all views from the database. - * - * @return void - */ - public function dropAllViews() - { - $views = []; - - foreach ($this->getAllViews() as $row) { - $row = (array) $row; - - $views[] = reset($row); - } - - if (empty($views)) { - return; - } - - $this->connection->statement( - $this->grammar->compileDropAllViews($views) - ); - } - - /** - * Get all of the table names for the database. - * - * @return array - */ - public function getAllTables() - { - return $this->connection->select( - $this->grammar->compileGetAllTables() - ); - } - - /** - * Get all of the view names for the database. - * - * @return array - */ - public function getAllViews() - { - return $this->connection->select( - $this->grammar->compileGetAllViews() - ); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Schema/MySqlSchemaState.php b/vendor/laravel/framework/src/Illuminate/Database/Schema/MySqlSchemaState.php deleted file mode 100644 index 0cd3486e..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Schema/MySqlSchemaState.php +++ /dev/null @@ -1,170 +0,0 @@ -executeDumpProcess($this->makeProcess( - $this->baseDumpCommand().' --routines --result-file="${:LARAVEL_LOAD_PATH}" --no-data' - ), $this->output, array_merge($this->baseVariables($this->connection->getConfig()), [ - 'LARAVEL_LOAD_PATH' => $path, - ])); - - $this->removeAutoIncrementingState($path); - - $this->appendMigrationData($path); - } - - /** - * Remove the auto-incrementing state from the given schema dump. - * - * @param string $path - * @return void - */ - protected function removeAutoIncrementingState(string $path) - { - $this->files->put($path, preg_replace( - '/\s+AUTO_INCREMENT=[0-9]+/iu', - '', - $this->files->get($path) - )); - } - - /** - * Append the migration data to the schema dump. - * - * @param string $path - * @return void - */ - protected function appendMigrationData(string $path) - { - $process = $this->executeDumpProcess($this->makeProcess( - $this->baseDumpCommand().' '.$this->migrationTable.' --no-create-info --skip-extended-insert --skip-routines --compact' - ), null, array_merge($this->baseVariables($this->connection->getConfig()), [ - // - ])); - - $this->files->append($path, $process->getOutput()); - } - - /** - * Load the given schema file into the database. - * - * @param string $path - * @return void - */ - public function load($path) - { - $command = 'mysql '.$this->connectionString().' --database="${:LARAVEL_LOAD_DATABASE}" < "${:LARAVEL_LOAD_PATH}"'; - - $process = $this->makeProcess($command)->setTimeout(null); - - $process->mustRun(null, array_merge($this->baseVariables($this->connection->getConfig()), [ - 'LARAVEL_LOAD_PATH' => $path, - ])); - } - - /** - * Get the base dump command arguments for MySQL as a string. - * - * @return string - */ - protected function baseDumpCommand() - { - $command = 'mysqldump '.$this->connectionString().' --no-tablespaces --skip-add-locks --skip-comments --skip-set-charset --tz-utc --column-statistics=0'; - - if (! $this->connection->isMaria()) { - $command .= ' --set-gtid-purged=OFF'; - } - - return $command.' "${:LARAVEL_LOAD_DATABASE}"'; - } - - /** - * Generate a basic connection string (--socket, --host, --port, --user, --password) for the database. - * - * @return string - */ - protected function connectionString() - { - $value = ' --user="${:LARAVEL_LOAD_USER}" --password="${:LARAVEL_LOAD_PASSWORD}"'; - - $config = $this->connection->getConfig(); - - $value .= $config['unix_socket'] ?? false - ? ' --socket="${:LARAVEL_LOAD_SOCKET}"' - : ' --host="${:LARAVEL_LOAD_HOST}" --port="${:LARAVEL_LOAD_PORT}"'; - - if (isset($config['options'][\PDO::MYSQL_ATTR_SSL_CA])) { - $value .= ' --ssl-ca="${:LARAVEL_LOAD_SSL_CA}"'; - } - - return $value; - } - - /** - * Get the base variables for a dump / load command. - * - * @param array $config - * @return array - */ - protected function baseVariables(array $config) - { - $config['host'] ??= ''; - - return [ - 'LARAVEL_LOAD_SOCKET' => $config['unix_socket'] ?? '', - 'LARAVEL_LOAD_HOST' => is_array($config['host']) ? $config['host'][0] : $config['host'], - 'LARAVEL_LOAD_PORT' => $config['port'] ?? '', - 'LARAVEL_LOAD_USER' => $config['username'], - 'LARAVEL_LOAD_PASSWORD' => $config['password'] ?? '', - 'LARAVEL_LOAD_DATABASE' => $config['database'], - 'LARAVEL_LOAD_SSL_CA' => $config['options'][\PDO::MYSQL_ATTR_SSL_CA] ?? '', - ]; - } - - /** - * Execute the given dump process. - * - * @param \Symfony\Component\Process\Process $process - * @param callable $output - * @param array $variables - * @return \Symfony\Component\Process\Process - */ - protected function executeDumpProcess(Process $process, $output, array $variables) - { - try { - $process->setTimeout(null)->mustRun($output, $variables); - } catch (Exception $e) { - if (Str::contains($e->getMessage(), ['column-statistics', 'column_statistics'])) { - return $this->executeDumpProcess(Process::fromShellCommandLine( - str_replace(' --column-statistics=0', '', $process->getCommandLine()) - ), $output, $variables); - } - - if (str_contains($e->getMessage(), 'set-gtid-purged')) { - return $this->executeDumpProcess(Process::fromShellCommandLine( - str_replace(' --set-gtid-purged=OFF', '', $process->getCommandLine()) - ), $output, $variables); - } - - throw $e; - } - - return $process; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Schema/PostgresBuilder.php b/vendor/laravel/framework/src/Illuminate/Database/Schema/PostgresBuilder.php deleted file mode 100755 index adfbd688..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Schema/PostgresBuilder.php +++ /dev/null @@ -1,248 +0,0 @@ -connection->statement( - $this->grammar->compileCreateDatabase($name, $this->connection) - ); - } - - /** - * Drop a database from the schema if the database exists. - * - * @param string $name - * @return bool - */ - public function dropDatabaseIfExists($name) - { - return $this->connection->statement( - $this->grammar->compileDropDatabaseIfExists($name) - ); - } - - /** - * Determine if the given table exists. - * - * @param string $table - * @return bool - */ - public function hasTable($table) - { - [$database, $schema, $table] = $this->parseSchemaAndTable($table); - - $table = $this->connection->getTablePrefix().$table; - - return count($this->connection->selectFromWriteConnection( - $this->grammar->compileTableExists(), [$database, $schema, $table] - )) > 0; - } - - /** - * Drop all tables from the database. - * - * @return void - */ - public function dropAllTables() - { - $tables = []; - - $excludedTables = $this->grammar->escapeNames( - $this->connection->getConfig('dont_drop') ?? ['spatial_ref_sys'] - ); - - foreach ($this->getAllTables() as $row) { - $row = (array) $row; - - if (empty(array_intersect($this->grammar->escapeNames($row), $excludedTables))) { - $tables[] = $row['qualifiedname'] ?? reset($row); - } - } - - if (empty($tables)) { - return; - } - - $this->connection->statement( - $this->grammar->compileDropAllTables($tables) - ); - } - - /** - * Drop all views from the database. - * - * @return void - */ - public function dropAllViews() - { - $views = []; - - foreach ($this->getAllViews() as $row) { - $row = (array) $row; - - $views[] = $row['qualifiedname'] ?? reset($row); - } - - if (empty($views)) { - return; - } - - $this->connection->statement( - $this->grammar->compileDropAllViews($views) - ); - } - - /** - * Drop all types from the database. - * - * @return void - */ - public function dropAllTypes() - { - $types = []; - - foreach ($this->getAllTypes() as $row) { - $row = (array) $row; - - $types[] = reset($row); - } - - if (empty($types)) { - return; - } - - $this->connection->statement( - $this->grammar->compileDropAllTypes($types) - ); - } - - /** - * Get all of the table names for the database. - * - * @return array - */ - public function getAllTables() - { - return $this->connection->select( - $this->grammar->compileGetAllTables( - $this->parseSearchPath( - $this->connection->getConfig('search_path') ?: $this->connection->getConfig('schema') - ) - ) - ); - } - - /** - * Get all of the view names for the database. - * - * @return array - */ - public function getAllViews() - { - return $this->connection->select( - $this->grammar->compileGetAllViews( - $this->parseSearchPath( - $this->connection->getConfig('search_path') ?: $this->connection->getConfig('schema') - ) - ) - ); - } - - /** - * Get all of the type names for the database. - * - * @return array - */ - public function getAllTypes() - { - return $this->connection->select( - $this->grammar->compileGetAllTypes() - ); - } - - /** - * Get the column listing for a given table. - * - * @param string $table - * @return array - */ - public function getColumnListing($table) - { - [$database, $schema, $table] = $this->parseSchemaAndTable($table); - - $table = $this->connection->getTablePrefix().$table; - - $results = $this->connection->selectFromWriteConnection( - $this->grammar->compileColumnListing(), [$database, $schema, $table] - ); - - return $this->connection->getPostProcessor()->processColumnListing($results); - } - - /** - * Parse the database object reference and extract the database, schema, and table. - * - * @param string $reference - * @return array - */ - protected function parseSchemaAndTable($reference) - { - $searchPath = $this->parseSearchPath( - $this->connection->getConfig('search_path') ?: $this->connection->getConfig('schema') ?: 'public' - ); - - $parts = explode('.', $reference); - - $database = $this->connection->getConfig('database'); - - // If the reference contains a database name, we will use that instead of the - // default database name for the connection. This allows the database name - // to be specified in the query instead of at the full connection level. - if (count($parts) === 3) { - $database = $parts[0]; - array_shift($parts); - } - - // We will use the default schema unless the schema has been specified in the - // query. If the schema has been specified in the query then we can use it - // instead of a default schema configured in the connection search path. - $schema = $searchPath[0]; - - if (count($parts) === 2) { - $schema = $parts[0]; - array_shift($parts); - } - - return [$database, $schema, $parts[0]]; - } - - /** - * Parse the "search_path" configuration value into an array. - * - * @param string|array|null $searchPath - * @return array - */ - protected function parseSearchPath($searchPath) - { - return array_map(function ($schema) { - return $schema === '$user' - ? $this->connection->getConfig('username') - : $schema; - }, $this->baseParseSearchPath($searchPath)); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Schema/PostgresSchemaState.php b/vendor/laravel/framework/src/Illuminate/Database/Schema/PostgresSchemaState.php deleted file mode 100644 index b6d4273f..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Schema/PostgresSchemaState.php +++ /dev/null @@ -1,82 +0,0 @@ -getSchemaBuilder()->getAllTables()) - ->map->tablename - ->reject(function ($table) { - return $table === $this->migrationTable; - })->map(function ($table) { - return '--exclude-table-data="*.'.$table.'"'; - })->implode(' '); - - $this->makeProcess( - $this->baseDumpCommand().' --file="${:LARAVEL_LOAD_PATH}" '.$excludedTables - )->mustRun($this->output, array_merge($this->baseVariables($this->connection->getConfig()), [ - 'LARAVEL_LOAD_PATH' => $path, - ])); - } - - /** - * Load the given schema file into the database. - * - * @param string $path - * @return void - */ - public function load($path) - { - $command = 'pg_restore --no-owner --no-acl --clean --if-exists --host="${:LARAVEL_LOAD_HOST}" --port="${:LARAVEL_LOAD_PORT}" --username="${:LARAVEL_LOAD_USER}" --dbname="${:LARAVEL_LOAD_DATABASE}" "${:LARAVEL_LOAD_PATH}"'; - - if (str_ends_with($path, '.sql')) { - $command = 'psql --file="${:LARAVEL_LOAD_PATH}" --host="${:LARAVEL_LOAD_HOST}" --port="${:LARAVEL_LOAD_PORT}" --username="${:LARAVEL_LOAD_USER}" --dbname="${:LARAVEL_LOAD_DATABASE}"'; - } - - $process = $this->makeProcess($command); - - $process->mustRun(null, array_merge($this->baseVariables($this->connection->getConfig()), [ - 'LARAVEL_LOAD_PATH' => $path, - ])); - } - - /** - * Get the base dump command arguments for PostgreSQL as a string. - * - * @return string - */ - protected function baseDumpCommand() - { - return 'pg_dump --no-owner --no-acl -Fc --host="${:LARAVEL_LOAD_HOST}" --port="${:LARAVEL_LOAD_PORT}" --username="${:LARAVEL_LOAD_USER}" --dbname="${:LARAVEL_LOAD_DATABASE}"'; - } - - /** - * Get the base variables for a dump / load command. - * - * @param array $config - * @return array - */ - protected function baseVariables(array $config) - { - $config['host'] ??= ''; - - return [ - 'LARAVEL_LOAD_HOST' => is_array($config['host']) ? $config['host'][0] : $config['host'], - 'LARAVEL_LOAD_PORT' => $config['port'], - 'LARAVEL_LOAD_USER' => $config['username'], - 'PGPASSWORD' => $config['password'], - 'LARAVEL_LOAD_DATABASE' => $config['database'], - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Schema/SQLiteBuilder.php b/vendor/laravel/framework/src/Illuminate/Database/Schema/SQLiteBuilder.php deleted file mode 100644 index 4e74f92d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Schema/SQLiteBuilder.php +++ /dev/null @@ -1,102 +0,0 @@ -connection->getDatabaseName() !== ':memory:') { - return $this->refreshDatabaseFile(); - } - - $this->connection->select($this->grammar->compileEnableWriteableSchema()); - - $this->connection->select($this->grammar->compileDropAllTables()); - - $this->connection->select($this->grammar->compileDisableWriteableSchema()); - - $this->connection->select($this->grammar->compileRebuild()); - } - - /** - * Drop all views from the database. - * - * @return void - */ - public function dropAllViews() - { - $this->connection->select($this->grammar->compileEnableWriteableSchema()); - - $this->connection->select($this->grammar->compileDropAllViews()); - - $this->connection->select($this->grammar->compileDisableWriteableSchema()); - - $this->connection->select($this->grammar->compileRebuild()); - } - - /** - * Get all of the table names for the database. - * - * @return array - */ - public function getAllTables() - { - return $this->connection->select( - $this->grammar->compileGetAllTables() - ); - } - - /** - * Get all of the view names for the database. - * - * @return array - */ - public function getAllViews() - { - return $this->connection->select( - $this->grammar->compileGetAllViews() - ); - } - - /** - * Empty the database file. - * - * @return void - */ - public function refreshDatabaseFile() - { - file_put_contents($this->connection->getDatabaseName(), ''); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Schema/SchemaState.php b/vendor/laravel/framework/src/Illuminate/Database/Schema/SchemaState.php deleted file mode 100644 index e6f35ab9..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Schema/SchemaState.php +++ /dev/null @@ -1,122 +0,0 @@ -connection = $connection; - - $this->files = $files ?: new Filesystem; - - $this->processFactory = $processFactory ?: function (...$arguments) { - return Process::fromShellCommandline(...$arguments)->setTimeout(null); - }; - - $this->handleOutputUsing(function () { - // - }); - } - - /** - * Dump the database's schema into a file. - * - * @param \Illuminate\Database\Connection $connection - * @param string $path - * @return void - */ - abstract public function dump(Connection $connection, $path); - - /** - * Load the given schema file into the database. - * - * @param string $path - * @return void - */ - abstract public function load($path); - - /** - * Create a new process instance. - * - * @param array $arguments - * @return \Symfony\Component\Process\Process - */ - public function makeProcess(...$arguments) - { - return call_user_func($this->processFactory, ...$arguments); - } - - /** - * Specify the name of the application's migration table. - * - * @param string $table - * @return $this - */ - public function withMigrationTable(string $table) - { - $this->migrationTable = $table; - - return $this; - } - - /** - * Specify the callback that should be used to handle process output. - * - * @param callable $output - * @return $this - */ - public function handleOutputUsing(callable $output) - { - $this->output = $output; - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Schema/SqlServerBuilder.php b/vendor/laravel/framework/src/Illuminate/Database/Schema/SqlServerBuilder.php deleted file mode 100644 index c323e126..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Schema/SqlServerBuilder.php +++ /dev/null @@ -1,78 +0,0 @@ -connection->statement( - $this->grammar->compileCreateDatabase($name, $this->connection) - ); - } - - /** - * Drop a database from the schema if the database exists. - * - * @param string $name - * @return bool - */ - public function dropDatabaseIfExists($name) - { - return $this->connection->statement( - $this->grammar->compileDropDatabaseIfExists($name) - ); - } - - /** - * Drop all tables from the database. - * - * @return void - */ - public function dropAllTables() - { - $this->connection->statement($this->grammar->compileDropAllForeignKeys()); - - $this->connection->statement($this->grammar->compileDropAllTables()); - } - - /** - * Drop all views from the database. - * - * @return void - */ - public function dropAllViews() - { - $this->connection->statement($this->grammar->compileDropAllViews()); - } - - /** - * Drop all tables from the database. - * - * @return array - */ - public function getAllTables() - { - return $this->connection->select( - $this->grammar->compileGetAllTables() - ); - } - - /** - * Get all of the view names for the database. - * - * @return array - */ - public function getAllViews() - { - return $this->connection->select( - $this->grammar->compileGetAllViews() - ); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Schema/SqliteSchemaState.php b/vendor/laravel/framework/src/Illuminate/Database/Schema/SqliteSchemaState.php deleted file mode 100644 index 10efc7c0..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Schema/SqliteSchemaState.php +++ /dev/null @@ -1,99 +0,0 @@ -makeProcess( - $this->baseCommand().' .schema' - ))->setTimeout(null)->mustRun(null, array_merge($this->baseVariables($this->connection->getConfig()), [ - // - ])); - - $migrations = collect(preg_split("/\r\n|\n|\r/", $process->getOutput()))->filter(function ($line) { - return stripos($line, 'sqlite_sequence') === false && - strlen($line) > 0; - })->all(); - - $this->files->put($path, implode(PHP_EOL, $migrations).PHP_EOL); - - $this->appendMigrationData($path); - } - - /** - * Append the migration data to the schema dump. - * - * @param string $path - * @return void - */ - protected function appendMigrationData(string $path) - { - with($process = $this->makeProcess( - $this->baseCommand().' ".dump \''.$this->migrationTable.'\'"' - ))->mustRun(null, array_merge($this->baseVariables($this->connection->getConfig()), [ - // - ])); - - $migrations = collect(preg_split("/\r\n|\n|\r/", $process->getOutput()))->filter(function ($line) { - return preg_match('/^\s*(--|INSERT\s)/iu', $line) === 1 && - strlen($line) > 0; - })->all(); - - $this->files->append($path, implode(PHP_EOL, $migrations).PHP_EOL); - } - - /** - * Load the given schema file into the database. - * - * @param string $path - * @return void - */ - public function load($path) - { - if ($this->connection->getDatabaseName() === ':memory:') { - $this->connection->getPdo()->exec($this->files->get($path)); - - return; - } - - $process = $this->makeProcess($this->baseCommand().' < "${:LARAVEL_LOAD_PATH}"'); - - $process->mustRun(null, array_merge($this->baseVariables($this->connection->getConfig()), [ - 'LARAVEL_LOAD_PATH' => $path, - ])); - } - - /** - * Get the base sqlite command arguments as a string. - * - * @return string - */ - protected function baseCommand() - { - return 'sqlite3 "${:LARAVEL_LOAD_DATABASE}"'; - } - - /** - * Get the base variables for a dump / load command. - * - * @param array $config - * @return array - */ - protected function baseVariables(array $config) - { - return [ - 'LARAVEL_LOAD_DATABASE' => $config['database'], - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/Seeder.php b/vendor/laravel/framework/src/Illuminate/Database/Seeder.php deleted file mode 100755 index 7a502a34..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/Seeder.php +++ /dev/null @@ -1,195 +0,0 @@ -resolve($class); - - $name = get_class($seeder); - - if ($silent === false && isset($this->command)) { - with(new TwoColumnDetail($this->command->getOutput()))->render( - $name, - 'RUNNING' - ); - } - - $startTime = microtime(true); - - $seeder->__invoke($parameters); - - if ($silent === false && isset($this->command)) { - $runTime = number_format((microtime(true) - $startTime) * 1000, 2); - - with(new TwoColumnDetail($this->command->getOutput()))->render( - $name, - "$runTime ms DONE" - ); - - $this->command->getOutput()->writeln(''); - } - - static::$called[] = $class; - } - - return $this; - } - - /** - * Run the given seeder class. - * - * @param array|string $class - * @param array $parameters - * @return void - */ - public function callWith($class, array $parameters = []) - { - $this->call($class, false, $parameters); - } - - /** - * Silently run the given seeder class. - * - * @param array|string $class - * @param array $parameters - * @return void - */ - public function callSilent($class, array $parameters = []) - { - $this->call($class, true, $parameters); - } - - /** - * Run the given seeder class once. - * - * @param array|string $class - * @param bool $silent - * @return void - */ - public function callOnce($class, $silent = false, array $parameters = []) - { - if (in_array($class, static::$called)) { - return; - } - - $this->call($class, $silent, $parameters); - } - - /** - * Resolve an instance of the given seeder class. - * - * @param string $class - * @return \Illuminate\Database\Seeder - */ - protected function resolve($class) - { - if (isset($this->container)) { - $instance = $this->container->make($class); - - $instance->setContainer($this->container); - } else { - $instance = new $class; - } - - if (isset($this->command)) { - $instance->setCommand($this->command); - } - - return $instance; - } - - /** - * Set the IoC container instance. - * - * @param \Illuminate\Container\Container $container - * @return $this - */ - public function setContainer(Container $container) - { - $this->container = $container; - - return $this; - } - - /** - * Set the console command instance. - * - * @param \Illuminate\Console\Command $command - * @return $this - */ - public function setCommand(Command $command) - { - $this->command = $command; - - return $this; - } - - /** - * Run the database seeds. - * - * @param array $parameters - * @return mixed - * - * @throws \InvalidArgumentException - */ - public function __invoke(array $parameters = []) - { - if (! method_exists($this, 'run')) { - throw new InvalidArgumentException('Method [run] missing from '.get_class($this)); - } - - $callback = fn () => isset($this->container) - ? $this->container->call([$this, 'run'], $parameters) - : $this->run(...$parameters); - - $uses = array_flip(class_uses_recursive(static::class)); - - if (isset($uses[WithoutModelEvents::class])) { - $callback = $this->withoutModelEvents($callback); - } - - return $callback(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/SqlServerConnection.php b/vendor/laravel/framework/src/Illuminate/Database/SqlServerConnection.php deleted file mode 100755 index feb4577b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/SqlServerConnection.php +++ /dev/null @@ -1,123 +0,0 @@ -getDriverName() === 'sqlsrv') { - return parent::transaction($callback, $attempts); - } - - $this->getPdo()->exec('BEGIN TRAN'); - - // We'll simply execute the given callback within a try / catch block - // and if we catch any exception we can rollback the transaction - // so that none of the changes are persisted to the database. - try { - $result = $callback($this); - - $this->getPdo()->exec('COMMIT TRAN'); - } - - // If we catch an exception, we will rollback so nothing gets messed - // up in the database. Then we'll re-throw the exception so it can - // be handled how the developer sees fit for their applications. - catch (Throwable $e) { - $this->getPdo()->exec('ROLLBACK TRAN'); - - throw $e; - } - - return $result; - } - } - - /** - * Get the default query grammar instance. - * - * @return \Illuminate\Database\Query\Grammars\SqlServerGrammar - */ - protected function getDefaultQueryGrammar() - { - return $this->withTablePrefix(new QueryGrammar); - } - - /** - * Get a schema builder instance for the connection. - * - * @return \Illuminate\Database\Schema\SqlServerBuilder - */ - public function getSchemaBuilder() - { - if (is_null($this->schemaGrammar)) { - $this->useDefaultSchemaGrammar(); - } - - return new SqlServerBuilder($this); - } - - /** - * Get the default schema grammar instance. - * - * @return \Illuminate\Database\Schema\Grammars\SqlServerGrammar - */ - protected function getDefaultSchemaGrammar() - { - return $this->withTablePrefix(new SchemaGrammar); - } - - /** - * Get the schema state for the connection. - * - * @param \Illuminate\Filesystem\Filesystem|null $files - * @param callable|null $processFactory - * - * @throws \RuntimeException - */ - public function getSchemaState(Filesystem $files = null, callable $processFactory = null) - { - throw new RuntimeException('Schema dumping is not supported when using SQL Server.'); - } - - /** - * Get the default post processor instance. - * - * @return \Illuminate\Database\Query\Processors\SqlServerProcessor - */ - protected function getDefaultPostProcessor() - { - return new SqlServerProcessor; - } - - /** - * Get the Doctrine DBAL driver. - * - * @return \Illuminate\Database\PDO\SqlServerDriver - */ - protected function getDoctrineDriver() - { - return new SqlServerDriver; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Database/composer.json b/vendor/laravel/framework/src/Illuminate/Database/composer.json deleted file mode 100644 index 4a94f707..00000000 --- a/vendor/laravel/framework/src/Illuminate/Database/composer.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "illuminate/database", - "description": "The Illuminate Database package.", - "license": "MIT", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "keywords": ["laravel", "database", "sql", "orm"], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "require": { - "php": "^8.0.2", - "ext-json": "*", - "illuminate/collections": "^9.0", - "illuminate/container": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0", - "symfony/console": "^6.0.9" - }, - "autoload": { - "psr-4": { - "Illuminate\\Database\\": "" - } - }, - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "suggest": { - "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.13.3|^3.1.4).", - "fakerphp/faker": "Required to use the eloquent factory builder (^1.21).", - "illuminate/console": "Required to use the database commands (^9.0).", - "illuminate/events": "Required to use the observers with Eloquent (^9.0).", - "illuminate/filesystem": "Required to use the migrations (^9.0).", - "illuminate/pagination": "Required to paginate the result set (^9.0).", - "symfony/finder": "Required to use Eloquent model factories (^6.0)." - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev" -} diff --git a/vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php b/vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php deleted file mode 100755 index 9857c983..00000000 --- a/vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php +++ /dev/null @@ -1,288 +0,0 @@ - ['size' => 16, 'aead' => false], - 'aes-256-cbc' => ['size' => 32, 'aead' => false], - 'aes-128-gcm' => ['size' => 16, 'aead' => true], - 'aes-256-gcm' => ['size' => 32, 'aead' => true], - ]; - - /** - * Create a new encrypter instance. - * - * @param string $key - * @param string $cipher - * @return void - * - * @throws \RuntimeException - */ - public function __construct($key, $cipher = 'aes-128-cbc') - { - $key = (string) $key; - - if (! static::supported($key, $cipher)) { - $ciphers = implode(', ', array_keys(self::$supportedCiphers)); - - throw new RuntimeException("Unsupported cipher or incorrect key length. Supported ciphers are: {$ciphers}."); - } - - $this->key = $key; - $this->cipher = $cipher; - } - - /** - * Determine if the given key and cipher combination is valid. - * - * @param string $key - * @param string $cipher - * @return bool - */ - public static function supported($key, $cipher) - { - if (! isset(self::$supportedCiphers[strtolower($cipher)])) { - return false; - } - - return mb_strlen($key, '8bit') === self::$supportedCiphers[strtolower($cipher)]['size']; - } - - /** - * Create a new encryption key for the given cipher. - * - * @param string $cipher - * @return string - */ - public static function generateKey($cipher) - { - return random_bytes(self::$supportedCiphers[strtolower($cipher)]['size'] ?? 32); - } - - /** - * Encrypt the given value. - * - * @param mixed $value - * @param bool $serialize - * @return string - * - * @throws \Illuminate\Contracts\Encryption\EncryptException - */ - public function encrypt($value, $serialize = true) - { - $iv = random_bytes(openssl_cipher_iv_length(strtolower($this->cipher))); - - $value = \openssl_encrypt( - $serialize ? serialize($value) : $value, - strtolower($this->cipher), $this->key, 0, $iv, $tag - ); - - if ($value === false) { - throw new EncryptException('Could not encrypt the data.'); - } - - $iv = base64_encode($iv); - $tag = base64_encode($tag ?? ''); - - $mac = self::$supportedCiphers[strtolower($this->cipher)]['aead'] - ? '' // For AEAD-algoritms, the tag / MAC is returned by openssl_encrypt... - : $this->hash($iv, $value); - - $json = json_encode(compact('iv', 'value', 'mac', 'tag'), JSON_UNESCAPED_SLASHES); - - if (json_last_error() !== JSON_ERROR_NONE) { - throw new EncryptException('Could not encrypt the data.'); - } - - return base64_encode($json); - } - - /** - * Encrypt a string without serialization. - * - * @param string $value - * @return string - * - * @throws \Illuminate\Contracts\Encryption\EncryptException - */ - public function encryptString($value) - { - return $this->encrypt($value, false); - } - - /** - * Decrypt the given value. - * - * @param string $payload - * @param bool $unserialize - * @return mixed - * - * @throws \Illuminate\Contracts\Encryption\DecryptException - */ - public function decrypt($payload, $unserialize = true) - { - $payload = $this->getJsonPayload($payload); - - $iv = base64_decode($payload['iv']); - - $this->ensureTagIsValid( - $tag = empty($payload['tag']) ? null : base64_decode($payload['tag']) - ); - - // Here we will decrypt the value. If we are able to successfully decrypt it - // we will then unserialize it and return it out to the caller. If we are - // unable to decrypt this value we will throw out an exception message. - $decrypted = \openssl_decrypt( - $payload['value'], strtolower($this->cipher), $this->key, 0, $iv, $tag ?? '' - ); - - if ($decrypted === false) { - throw new DecryptException('Could not decrypt the data.'); - } - - return $unserialize ? unserialize($decrypted) : $decrypted; - } - - /** - * Decrypt the given string without unserialization. - * - * @param string $payload - * @return string - * - * @throws \Illuminate\Contracts\Encryption\DecryptException - */ - public function decryptString($payload) - { - return $this->decrypt($payload, false); - } - - /** - * Create a MAC for the given value. - * - * @param string $iv - * @param mixed $value - * @return string - */ - protected function hash($iv, $value) - { - return hash_hmac('sha256', $iv.$value, $this->key); - } - - /** - * Get the JSON array from the given payload. - * - * @param string $payload - * @return array - * - * @throws \Illuminate\Contracts\Encryption\DecryptException - */ - protected function getJsonPayload($payload) - { - $payload = json_decode(base64_decode($payload), true); - - // If the payload is not valid JSON or does not have the proper keys set we will - // assume it is invalid and bail out of the routine since we will not be able - // to decrypt the given value. We'll also check the MAC for this encryption. - if (! $this->validPayload($payload)) { - throw new DecryptException('The payload is invalid.'); - } - - if (! self::$supportedCiphers[strtolower($this->cipher)]['aead'] && ! $this->validMac($payload)) { - throw new DecryptException('The MAC is invalid.'); - } - - return $payload; - } - - /** - * Verify that the encryption payload is valid. - * - * @param mixed $payload - * @return bool - */ - protected function validPayload($payload) - { - if (! is_array($payload)) { - return false; - } - - foreach (['iv', 'value', 'mac'] as $item) { - if (! isset($payload[$item]) || ! is_string($payload[$item])) { - return false; - } - } - - if (isset($payload['tag']) && ! is_string($payload['tag'])) { - return false; - } - - return strlen(base64_decode($payload['iv'], true)) === openssl_cipher_iv_length(strtolower($this->cipher)); - } - - /** - * Determine if the MAC for the given payload is valid. - * - * @param array $payload - * @return bool - */ - protected function validMac(array $payload) - { - return hash_equals( - $this->hash($payload['iv'], $payload['value']), $payload['mac'] - ); - } - - /** - * Ensure the given tag is a valid tag given the selected cipher. - * - * @param string $tag - * @return void - */ - protected function ensureTagIsValid($tag) - { - if (self::$supportedCiphers[strtolower($this->cipher)]['aead'] && strlen($tag) !== 16) { - throw new DecryptException('Could not decrypt the data.'); - } - - if (! self::$supportedCiphers[strtolower($this->cipher)]['aead'] && is_string($tag)) { - throw new DecryptException('Unable to use tag because the cipher algorithm does not support AEAD.'); - } - } - - /** - * Get the encryption key that the encrypter is currently using. - * - * @return string - */ - public function getKey() - { - return $this->key; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php b/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php deleted file mode 100755 index a4d27a37..00000000 --- a/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php +++ /dev/null @@ -1,83 +0,0 @@ -registerEncrypter(); - $this->registerSerializableClosureSecurityKey(); - } - - /** - * Register the encrypter. - * - * @return void - */ - protected function registerEncrypter() - { - $this->app->singleton('encrypter', function ($app) { - $config = $app->make('config')->get('app'); - - return new Encrypter($this->parseKey($config), $config['cipher']); - }); - } - - /** - * Configure Serializable Closure signing for security. - * - * @return void - */ - protected function registerSerializableClosureSecurityKey() - { - $config = $this->app->make('config')->get('app'); - - if (! class_exists(SerializableClosure::class) || empty($config['key'])) { - return; - } - - SerializableClosure::setSecretKey($this->parseKey($config)); - } - - /** - * Parse the encryption key. - * - * @param array $config - * @return string - */ - protected function parseKey(array $config) - { - if (Str::startsWith($key = $this->key($config), $prefix = 'base64:')) { - $key = base64_decode(Str::after($key, $prefix)); - } - - return $key; - } - - /** - * Extract the encryption key from the given configuration. - * - * @param array $config - * @return string - * - * @throws \Illuminate\Encryption\MissingAppKeyException - */ - protected function key(array $config) - { - return tap($config['key'], function ($key) { - if (empty($key)) { - throw new MissingAppKeyException; - } - }); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Encryption/LICENSE.md b/vendor/laravel/framework/src/Illuminate/Encryption/LICENSE.md deleted file mode 100644 index 79810c84..00000000 --- a/vendor/laravel/framework/src/Illuminate/Encryption/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Taylor Otwell - -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/laravel/framework/src/Illuminate/Encryption/MissingAppKeyException.php b/vendor/laravel/framework/src/Illuminate/Encryption/MissingAppKeyException.php deleted file mode 100644 index d8ffcd18..00000000 --- a/vendor/laravel/framework/src/Illuminate/Encryption/MissingAppKeyException.php +++ /dev/null @@ -1,19 +0,0 @@ -data = $data; - $this->class = $class; - $this->method = $method; - } - - /** - * Handle the queued job. - * - * @param \Illuminate\Container\Container $container - * @return void - */ - public function handle(Container $container) - { - $this->prepareData(); - - $handler = $this->setJobInstanceIfNecessary( - $this->job, $container->make($this->class) - ); - - $handler->{$this->method}(...array_values($this->data)); - } - - /** - * Set the job instance of the given class if necessary. - * - * @param \Illuminate\Contracts\Queue\Job $job - * @param object $instance - * @return object - */ - protected function setJobInstanceIfNecessary(Job $job, $instance) - { - if (in_array(InteractsWithQueue::class, class_uses_recursive($instance))) { - $instance->setJob($job); - } - - return $instance; - } - - /** - * Call the failed method on the job instance. - * - * The event instance and the exception will be passed. - * - * @param \Throwable $e - * @return void - */ - public function failed($e) - { - $this->prepareData(); - - $handler = Container::getInstance()->make($this->class); - - $parameters = array_merge(array_values($this->data), [$e]); - - if (method_exists($handler, 'failed')) { - $handler->failed(...$parameters); - } - } - - /** - * Unserialize the data if needed. - * - * @return void - */ - protected function prepareData() - { - if (is_string($this->data)) { - $this->data = unserialize($this->data); - } - } - - /** - * Get the display name for the queued job. - * - * @return string - */ - public function displayName() - { - return $this->class; - } - - /** - * Prepare the instance for cloning. - * - * @return void - */ - public function __clone() - { - $this->data = array_map(function ($data) { - return is_object($data) ? clone $data : $data; - }, $this->data); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php b/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php deleted file mode 100755 index 18768976..00000000 --- a/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php +++ /dev/null @@ -1,705 +0,0 @@ -container = $container ?: new Container; - } - - /** - * Register an event listener with the dispatcher. - * - * @param \Closure|string|array $events - * @param \Closure|string|array|null $listener - * @return void - */ - public function listen($events, $listener = null) - { - if ($events instanceof Closure) { - return collect($this->firstClosureParameterTypes($events)) - ->each(function ($event) use ($events) { - $this->listen($event, $events); - }); - } elseif ($events instanceof QueuedClosure) { - return collect($this->firstClosureParameterTypes($events->closure)) - ->each(function ($event) use ($events) { - $this->listen($event, $events->resolve()); - }); - } elseif ($listener instanceof QueuedClosure) { - $listener = $listener->resolve(); - } - - foreach ((array) $events as $event) { - if (str_contains($event, '*')) { - $this->setupWildcardListen($event, $listener); - } else { - $this->listeners[$event][] = $listener; - } - } - } - - /** - * Setup a wildcard listener callback. - * - * @param string $event - * @param \Closure|string $listener - * @return void - */ - protected function setupWildcardListen($event, $listener) - { - $this->wildcards[$event][] = $listener; - - $this->wildcardsCache = []; - } - - /** - * Determine if a given event has listeners. - * - * @param string $eventName - * @return bool - */ - public function hasListeners($eventName) - { - return isset($this->listeners[$eventName]) || - isset($this->wildcards[$eventName]) || - $this->hasWildcardListeners($eventName); - } - - /** - * Determine if the given event has any wildcard listeners. - * - * @param string $eventName - * @return bool - */ - public function hasWildcardListeners($eventName) - { - foreach ($this->wildcards as $key => $listeners) { - if (Str::is($key, $eventName)) { - return true; - } - } - - return false; - } - - /** - * Register an event and payload to be fired later. - * - * @param string $event - * @param object|array $payload - * @return void - */ - public function push($event, $payload = []) - { - $this->listen($event.'_pushed', function () use ($event, $payload) { - $this->dispatch($event, $payload); - }); - } - - /** - * Flush a set of pushed events. - * - * @param string $event - * @return void - */ - public function flush($event) - { - $this->dispatch($event.'_pushed'); - } - - /** - * Register an event subscriber with the dispatcher. - * - * @param object|string $subscriber - * @return void - */ - public function subscribe($subscriber) - { - $subscriber = $this->resolveSubscriber($subscriber); - - $events = $subscriber->subscribe($this); - - if (is_array($events)) { - foreach ($events as $event => $listeners) { - foreach (Arr::wrap($listeners) as $listener) { - if (is_string($listener) && method_exists($subscriber, $listener)) { - $this->listen($event, [get_class($subscriber), $listener]); - - continue; - } - - $this->listen($event, $listener); - } - } - } - } - - /** - * Resolve the subscriber instance. - * - * @param object|string $subscriber - * @return mixed - */ - protected function resolveSubscriber($subscriber) - { - if (is_string($subscriber)) { - return $this->container->make($subscriber); - } - - return $subscriber; - } - - /** - * Fire an event until the first non-null response is returned. - * - * @param string|object $event - * @param mixed $payload - * @return array|null - */ - public function until($event, $payload = []) - { - return $this->dispatch($event, $payload, true); - } - - /** - * Fire an event and call the listeners. - * - * @param string|object $event - * @param mixed $payload - * @param bool $halt - * @return array|null - */ - public function dispatch($event, $payload = [], $halt = false) - { - // When the given "event" is actually an object we will assume it is an event - // object and use the class as the event name and this event itself as the - // payload to the handler, which makes object based events quite simple. - [$event, $payload] = $this->parseEventAndPayload( - $event, $payload - ); - - if ($this->shouldBroadcast($payload)) { - $this->broadcastEvent($payload[0]); - } - - $responses = []; - - foreach ($this->getListeners($event) as $listener) { - $response = $listener($event, $payload); - - // If a response is returned from the listener and event halting is enabled - // we will just return this response, and not call the rest of the event - // listeners. Otherwise we will add the response on the response list. - if ($halt && ! is_null($response)) { - return $response; - } - - // If a boolean false is returned from a listener, we will stop propagating - // the event to any further listeners down in the chain, else we keep on - // looping through the listeners and firing every one in our sequence. - if ($response === false) { - break; - } - - $responses[] = $response; - } - - return $halt ? null : $responses; - } - - /** - * Parse the given event and payload and prepare them for dispatching. - * - * @param mixed $event - * @param mixed $payload - * @return array - */ - protected function parseEventAndPayload($event, $payload) - { - if (is_object($event)) { - [$payload, $event] = [[$event], get_class($event)]; - } - - return [$event, Arr::wrap($payload)]; - } - - /** - * Determine if the payload has a broadcastable event. - * - * @param array $payload - * @return bool - */ - protected function shouldBroadcast(array $payload) - { - return isset($payload[0]) && - $payload[0] instanceof ShouldBroadcast && - $this->broadcastWhen($payload[0]); - } - - /** - * Check if the event should be broadcasted by the condition. - * - * @param mixed $event - * @return bool - */ - protected function broadcastWhen($event) - { - return method_exists($event, 'broadcastWhen') - ? $event->broadcastWhen() : true; - } - - /** - * Broadcast the given event class. - * - * @param \Illuminate\Contracts\Broadcasting\ShouldBroadcast $event - * @return void - */ - protected function broadcastEvent($event) - { - $this->container->make(BroadcastFactory::class)->queue($event); - } - - /** - * Get all of the listeners for a given event name. - * - * @param string $eventName - * @return array - */ - public function getListeners($eventName) - { - $listeners = array_merge( - $this->prepareListeners($eventName), - $this->wildcardsCache[$eventName] ?? $this->getWildcardListeners($eventName) - ); - - return class_exists($eventName, false) - ? $this->addInterfaceListeners($eventName, $listeners) - : $listeners; - } - - /** - * Get the wildcard listeners for the event. - * - * @param string $eventName - * @return array - */ - protected function getWildcardListeners($eventName) - { - $wildcards = []; - - foreach ($this->wildcards as $key => $listeners) { - if (Str::is($key, $eventName)) { - foreach ($listeners as $listener) { - $wildcards[] = $this->makeListener($listener, true); - } - } - } - - return $this->wildcardsCache[$eventName] = $wildcards; - } - - /** - * Add the listeners for the event's interfaces to the given array. - * - * @param string $eventName - * @param array $listeners - * @return array - */ - protected function addInterfaceListeners($eventName, array $listeners = []) - { - foreach (class_implements($eventName) as $interface) { - if (isset($this->listeners[$interface])) { - foreach ($this->prepareListeners($interface) as $names) { - $listeners = array_merge($listeners, (array) $names); - } - } - } - - return $listeners; - } - - /** - * Prepare the listeners for a given event. - * - * @param string $eventName - * @return \Closure[] - */ - protected function prepareListeners(string $eventName) - { - $listeners = []; - - foreach ($this->listeners[$eventName] ?? [] as $listener) { - $listeners[] = $this->makeListener($listener); - } - - return $listeners; - } - - /** - * Register an event listener with the dispatcher. - * - * @param \Closure|string|array $listener - * @param bool $wildcard - * @return \Closure - */ - public function makeListener($listener, $wildcard = false) - { - if (is_string($listener)) { - return $this->createClassListener($listener, $wildcard); - } - - if (is_array($listener) && isset($listener[0]) && is_string($listener[0])) { - return $this->createClassListener($listener, $wildcard); - } - - return function ($event, $payload) use ($listener, $wildcard) { - if ($wildcard) { - return $listener($event, $payload); - } - - return $listener(...array_values($payload)); - }; - } - - /** - * Create a class based listener using the IoC container. - * - * @param string $listener - * @param bool $wildcard - * @return \Closure - */ - public function createClassListener($listener, $wildcard = false) - { - return function ($event, $payload) use ($listener, $wildcard) { - if ($wildcard) { - return call_user_func($this->createClassCallable($listener), $event, $payload); - } - - $callable = $this->createClassCallable($listener); - - return $callable(...array_values($payload)); - }; - } - - /** - * Create the class based event callable. - * - * @param array|string $listener - * @return callable - */ - protected function createClassCallable($listener) - { - [$class, $method] = is_array($listener) - ? $listener - : $this->parseClassCallable($listener); - - if (! method_exists($class, $method)) { - $method = '__invoke'; - } - - if ($this->handlerShouldBeQueued($class)) { - return $this->createQueuedHandlerCallable($class, $method); - } - - $listener = $this->container->make($class); - - return $this->handlerShouldBeDispatchedAfterDatabaseTransactions($listener) - ? $this->createCallbackForListenerRunningAfterCommits($listener, $method) - : [$listener, $method]; - } - - /** - * Parse the class listener into class and method. - * - * @param string $listener - * @return array - */ - protected function parseClassCallable($listener) - { - return Str::parseCallback($listener, 'handle'); - } - - /** - * Determine if the event handler class should be queued. - * - * @param string $class - * @return bool - */ - protected function handlerShouldBeQueued($class) - { - try { - return (new ReflectionClass($class))->implementsInterface( - ShouldQueue::class - ); - } catch (Exception $e) { - return false; - } - } - - /** - * Create a callable for putting an event handler on the queue. - * - * @param string $class - * @param string $method - * @return \Closure - */ - protected function createQueuedHandlerCallable($class, $method) - { - return function () use ($class, $method) { - $arguments = array_map(function ($a) { - return is_object($a) ? clone $a : $a; - }, func_get_args()); - - if ($this->handlerWantsToBeQueued($class, $arguments)) { - $this->queueHandler($class, $method, $arguments); - } - }; - } - - /** - * Determine if the given event handler should be dispatched after all database transactions have committed. - * - * @param object|mixed $listener - * @return bool - */ - protected function handlerShouldBeDispatchedAfterDatabaseTransactions($listener) - { - return ($listener->afterCommit ?? null) && $this->container->bound('db.transactions'); - } - - /** - * Create a callable for dispatching a listener after database transactions. - * - * @param mixed $listener - * @param string $method - * @return \Closure - */ - protected function createCallbackForListenerRunningAfterCommits($listener, $method) - { - return function () use ($method, $listener) { - $payload = func_get_args(); - - $this->container->make('db.transactions')->addCallback( - function () use ($listener, $method, $payload) { - $listener->$method(...$payload); - } - ); - }; - } - - /** - * Determine if the event handler wants to be queued. - * - * @param string $class - * @param array $arguments - * @return bool - */ - protected function handlerWantsToBeQueued($class, $arguments) - { - $instance = $this->container->make($class); - - if (method_exists($instance, 'shouldQueue')) { - return $instance->shouldQueue($arguments[0]); - } - - return true; - } - - /** - * Queue the handler class. - * - * @param string $class - * @param string $method - * @param array $arguments - * @return void - */ - protected function queueHandler($class, $method, $arguments) - { - [$listener, $job] = $this->createListenerAndJob($class, $method, $arguments); - - $connection = $this->resolveQueue()->connection(method_exists($listener, 'viaConnection') - ? (isset($arguments[0]) ? $listener->viaConnection($arguments[0]) : $listener->viaConnection()) - : $listener->connection ?? null); - - $queue = method_exists($listener, 'viaQueue') - ? (isset($arguments[0]) ? $listener->viaQueue($arguments[0]) : $listener->viaQueue()) - : $listener->queue ?? null; - - isset($listener->delay) - ? $connection->laterOn($queue, $listener->delay, $job) - : $connection->pushOn($queue, $job); - } - - /** - * Create the listener and job for a queued listener. - * - * @param string $class - * @param string $method - * @param array $arguments - * @return array - */ - protected function createListenerAndJob($class, $method, $arguments) - { - $listener = (new ReflectionClass($class))->newInstanceWithoutConstructor(); - - return [$listener, $this->propagateListenerOptions( - $listener, new CallQueuedListener($class, $method, $arguments) - )]; - } - - /** - * Propagate listener options to the job. - * - * @param mixed $listener - * @param \Illuminate\Events\CallQueuedListener $job - * @return mixed - */ - protected function propagateListenerOptions($listener, $job) - { - return tap($job, function ($job) use ($listener) { - $data = array_values($job->data); - - $job->afterCommit = property_exists($listener, 'afterCommit') ? $listener->afterCommit : null; - $job->backoff = method_exists($listener, 'backoff') ? $listener->backoff(...$data) : ($listener->backoff ?? null); - $job->maxExceptions = $listener->maxExceptions ?? null; - $job->retryUntil = method_exists($listener, 'retryUntil') ? $listener->retryUntil(...$data) : null; - $job->shouldBeEncrypted = $listener instanceof ShouldBeEncrypted; - $job->timeout = $listener->timeout ?? null; - $job->tries = $listener->tries ?? null; - - $job->through(array_merge( - method_exists($listener, 'middleware') ? $listener->middleware(...$data) : [], - $listener->middleware ?? [] - )); - }); - } - - /** - * Remove a set of listeners from the dispatcher. - * - * @param string $event - * @return void - */ - public function forget($event) - { - if (str_contains($event, '*')) { - unset($this->wildcards[$event]); - } else { - unset($this->listeners[$event]); - } - - foreach ($this->wildcardsCache as $key => $listeners) { - if (Str::is($event, $key)) { - unset($this->wildcardsCache[$key]); - } - } - } - - /** - * Forget all of the pushed listeners. - * - * @return void - */ - public function forgetPushed() - { - foreach ($this->listeners as $key => $value) { - if (str_ends_with($key, '_pushed')) { - $this->forget($key); - } - } - } - - /** - * Get the queue implementation from the resolver. - * - * @return \Illuminate\Contracts\Queue\Queue - */ - protected function resolveQueue() - { - return call_user_func($this->queueResolver); - } - - /** - * Set the queue resolver implementation. - * - * @param callable $resolver - * @return $this - */ - public function setQueueResolver(callable $resolver) - { - $this->queueResolver = $resolver; - - return $this; - } - - /** - * Gets the raw, unprepared listeners. - * - * @return array - */ - public function getRawListeners() - { - return $this->listeners; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Events/EventServiceProvider.php b/vendor/laravel/framework/src/Illuminate/Events/EventServiceProvider.php deleted file mode 100755 index 15fb60b1..00000000 --- a/vendor/laravel/framework/src/Illuminate/Events/EventServiceProvider.php +++ /dev/null @@ -1,23 +0,0 @@ -app->singleton('events', function ($app) { - return (new Dispatcher($app))->setQueueResolver(function () use ($app) { - return $app->make(QueueFactoryContract::class); - }); - }); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Events/InvokeQueuedClosure.php b/vendor/laravel/framework/src/Illuminate/Events/InvokeQueuedClosure.php deleted file mode 100644 index bc68b19d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Events/InvokeQueuedClosure.php +++ /dev/null @@ -1,34 +0,0 @@ -getClosure(), ...$arguments); - } - - /** - * Handle a job failure. - * - * @param \Laravel\SerializableClosure\SerializableClosure $closure - * @param array $arguments - * @param array $catchCallbacks - * @param \Throwable $exception - * @return void - */ - public function failed($closure, array $arguments, array $catchCallbacks, $exception) - { - $arguments[] = $exception; - - collect($catchCallbacks)->each->__invoke(...$arguments); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Events/LICENSE.md b/vendor/laravel/framework/src/Illuminate/Events/LICENSE.md deleted file mode 100644 index 79810c84..00000000 --- a/vendor/laravel/framework/src/Illuminate/Events/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Taylor Otwell - -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/laravel/framework/src/Illuminate/Events/NullDispatcher.php b/vendor/laravel/framework/src/Illuminate/Events/NullDispatcher.php deleted file mode 100644 index 3164fbb2..00000000 --- a/vendor/laravel/framework/src/Illuminate/Events/NullDispatcher.php +++ /dev/null @@ -1,144 +0,0 @@ -dispatcher = $dispatcher; - } - - /** - * Don't fire an event. - * - * @param string|object $event - * @param mixed $payload - * @param bool $halt - * @return void - */ - public function dispatch($event, $payload = [], $halt = false) - { - // - } - - /** - * Don't register an event and payload to be fired later. - * - * @param string $event - * @param array $payload - * @return void - */ - public function push($event, $payload = []) - { - // - } - - /** - * Don't dispatch an event. - * - * @param string|object $event - * @param mixed $payload - * @return array|null - */ - public function until($event, $payload = []) - { - // - } - - /** - * Register an event listener with the dispatcher. - * - * @param \Closure|string|array $events - * @param \Closure|string|array|null $listener - * @return void - */ - public function listen($events, $listener = null) - { - $this->dispatcher->listen($events, $listener); - } - - /** - * Determine if a given event has listeners. - * - * @param string $eventName - * @return bool - */ - public function hasListeners($eventName) - { - return $this->dispatcher->hasListeners($eventName); - } - - /** - * Register an event subscriber with the dispatcher. - * - * @param object|string $subscriber - * @return void - */ - public function subscribe($subscriber) - { - $this->dispatcher->subscribe($subscriber); - } - - /** - * Flush a set of pushed events. - * - * @param string $event - * @return void - */ - public function flush($event) - { - $this->dispatcher->flush($event); - } - - /** - * Remove a set of listeners from the dispatcher. - * - * @param string $event - * @return void - */ - public function forget($event) - { - $this->dispatcher->forget($event); - } - - /** - * Forget all of the queued listeners. - * - * @return void - */ - public function forgetPushed() - { - $this->dispatcher->forgetPushed(); - } - - /** - * Dynamically pass method calls to the underlying dispatcher. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - return $this->forwardDecoratedCallTo($this->dispatcher, $method, $parameters); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Events/QueuedClosure.php b/vendor/laravel/framework/src/Illuminate/Events/QueuedClosure.php deleted file mode 100644 index 31a462ac..00000000 --- a/vendor/laravel/framework/src/Illuminate/Events/QueuedClosure.php +++ /dev/null @@ -1,125 +0,0 @@ -closure = $closure; - } - - /** - * Set the desired connection for the job. - * - * @param string|null $connection - * @return $this - */ - public function onConnection($connection) - { - $this->connection = $connection; - - return $this; - } - - /** - * Set the desired queue for the job. - * - * @param string|null $queue - * @return $this - */ - public function onQueue($queue) - { - $this->queue = $queue; - - return $this; - } - - /** - * Set the desired delay in seconds for the job. - * - * @param \DateTimeInterface|\DateInterval|int|null $delay - * @return $this - */ - public function delay($delay) - { - $this->delay = $delay; - - return $this; - } - - /** - * Specify a callback that should be invoked if the queued listener job fails. - * - * @param \Closure $closure - * @return $this - */ - public function catch(Closure $closure) - { - $this->catchCallbacks[] = $closure; - - return $this; - } - - /** - * Resolve the actual event listener callback. - * - * @return \Closure - */ - public function resolve() - { - return function (...$arguments) { - dispatch(new CallQueuedListener(InvokeQueuedClosure::class, 'handle', [ - 'closure' => new SerializableClosure($this->closure), - 'arguments' => $arguments, - 'catch' => collect($this->catchCallbacks)->map(function ($callback) { - return new SerializableClosure($callback); - })->all(), - ]))->onConnection($this->connection)->onQueue($this->queue)->delay($this->delay); - }; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Events/composer.json b/vendor/laravel/framework/src/Illuminate/Events/composer.json deleted file mode 100755 index d0742122..00000000 --- a/vendor/laravel/framework/src/Illuminate/Events/composer.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "illuminate/events", - "description": "The Illuminate Events package.", - "license": "MIT", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "require": { - "php": "^8.0.2", - "illuminate/bus": "^9.0", - "illuminate/collections": "^9.0", - "illuminate/container": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0" - }, - "autoload": { - "psr-4": { - "Illuminate\\Events\\": "" - }, - "files": [ - "functions.php" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev" -} diff --git a/vendor/laravel/framework/src/Illuminate/Events/functions.php b/vendor/laravel/framework/src/Illuminate/Events/functions.php deleted file mode 100644 index df1b0feb..00000000 --- a/vendor/laravel/framework/src/Illuminate/Events/functions.php +++ /dev/null @@ -1,18 +0,0 @@ -client = $client; - } - - /** - * Get the URL for the file at the given path. - * - * @param string $path - * @return string - * - * @throws \RuntimeException - */ - public function url($path) - { - // If an explicit base URL has been set on the disk configuration then we will use - // it as the base URL instead of the default path. This allows the developer to - // have full control over the base path for this filesystem's generated URLs. - if (isset($this->config['url'])) { - return $this->concatPathToUrl($this->config['url'], $this->prefixer->prefixPath($path)); - } - - return $this->client->getObjectUrl( - $this->config['bucket'], $this->prefixer->prefixPath($path) - ); - } - - /** - * Determine if temporary URLs can be generated. - * - * @return bool - */ - public function providesTemporaryUrls() - { - return true; - } - - /** - * Get a temporary URL for the file at the given path. - * - * @param string $path - * @param \DateTimeInterface $expiration - * @param array $options - * @return string - */ - public function temporaryUrl($path, $expiration, array $options = []) - { - $command = $this->client->getCommand('GetObject', array_merge([ - 'Bucket' => $this->config['bucket'], - 'Key' => $this->prefixer->prefixPath($path), - ], $options)); - - $uri = $this->client->createPresignedRequest( - $command, $expiration, $options - )->getUri(); - - // If an explicit base URL has been set on the disk configuration then we will use - // it as the base URL instead of the default path. This allows the developer to - // have full control over the base path for this filesystem's generated URLs. - if (isset($this->config['temporary_url'])) { - $uri = $this->replaceBaseUrl($uri, $this->config['temporary_url']); - } - - return (string) $uri; - } - - /** - * Get the underlying S3 client. - * - * @return \Aws\S3\S3Client - */ - public function getClient() - { - return $this->client; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php b/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php deleted file mode 100644 index 16149cff..00000000 --- a/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php +++ /dev/null @@ -1,770 +0,0 @@ -exists($path); - } - - /** - * Get the contents of a file. - * - * @param string $path - * @param bool $lock - * @return string - * - * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException - */ - public function get($path, $lock = false) - { - if ($this->isFile($path)) { - return $lock ? $this->sharedGet($path) : file_get_contents($path); - } - - throw new FileNotFoundException("File does not exist at path {$path}."); - } - - /** - * Get contents of a file with shared access. - * - * @param string $path - * @return string - */ - public function sharedGet($path) - { - $contents = ''; - - $handle = fopen($path, 'rb'); - - if ($handle) { - try { - if (flock($handle, LOCK_SH)) { - clearstatcache(true, $path); - - $contents = fread($handle, $this->size($path) ?: 1); - - flock($handle, LOCK_UN); - } - } finally { - fclose($handle); - } - } - - return $contents; - } - - /** - * Get the returned value of a file. - * - * @param string $path - * @param array $data - * @return mixed - * - * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException - */ - public function getRequire($path, array $data = []) - { - if ($this->isFile($path)) { - $__path = $path; - $__data = $data; - - return (static function () use ($__path, $__data) { - extract($__data, EXTR_SKIP); - - return require $__path; - })(); - } - - throw new FileNotFoundException("File does not exist at path {$path}."); - } - - /** - * Require the given file once. - * - * @param string $path - * @param array $data - * @return mixed - * - * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException - */ - public function requireOnce($path, array $data = []) - { - if ($this->isFile($path)) { - $__path = $path; - $__data = $data; - - return (static function () use ($__path, $__data) { - extract($__data, EXTR_SKIP); - - return require_once $__path; - })(); - } - - throw new FileNotFoundException("File does not exist at path {$path}."); - } - - /** - * Get the contents of a file one line at a time. - * - * @param string $path - * @return \Illuminate\Support\LazyCollection - * - * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException - */ - public function lines($path) - { - if (! $this->isFile($path)) { - throw new FileNotFoundException( - "File does not exist at path {$path}." - ); - } - - return LazyCollection::make(function () use ($path) { - $file = new SplFileObject($path); - - $file->setFlags(SplFileObject::DROP_NEW_LINE); - - while (! $file->eof()) { - yield $file->fgets(); - } - }); - } - - /** - * Get the hash of the file at the given path. - * - * @param string $path - * @param string $algorithm - * @return string - */ - public function hash($path, $algorithm = 'md5') - { - return hash_file($algorithm, $path); - } - - /** - * Write the contents of a file. - * - * @param string $path - * @param string $contents - * @param bool $lock - * @return int|bool - */ - public function put($path, $contents, $lock = false) - { - return file_put_contents($path, $contents, $lock ? LOCK_EX : 0); - } - - /** - * Write the contents of a file, replacing it atomically if it already exists. - * - * @param string $path - * @param string $content - * @return void - */ - public function replace($path, $content) - { - // If the path already exists and is a symlink, get the real path... - clearstatcache(true, $path); - - $path = realpath($path) ?: $path; - - $tempPath = tempnam(dirname($path), basename($path)); - - // Fix permissions of tempPath because `tempnam()` creates it with permissions set to 0600... - chmod($tempPath, 0777 - umask()); - - file_put_contents($tempPath, $content); - - rename($tempPath, $path); - } - - /** - * Replace a given string within a given file. - * - * @param array|string $search - * @param array|string $replace - * @param string $path - * @return void - */ - public function replaceInFile($search, $replace, $path) - { - file_put_contents($path, str_replace($search, $replace, file_get_contents($path))); - } - - /** - * Prepend to a file. - * - * @param string $path - * @param string $data - * @return int - */ - public function prepend($path, $data) - { - if ($this->exists($path)) { - return $this->put($path, $data.$this->get($path)); - } - - return $this->put($path, $data); - } - - /** - * Append to a file. - * - * @param string $path - * @param string $data - * @return int - */ - public function append($path, $data) - { - return file_put_contents($path, $data, FILE_APPEND); - } - - /** - * Get or set UNIX mode of a file or directory. - * - * @param string $path - * @param int|null $mode - * @return mixed - */ - public function chmod($path, $mode = null) - { - if ($mode) { - return chmod($path, $mode); - } - - return substr(sprintf('%o', fileperms($path)), -4); - } - - /** - * Delete the file at a given path. - * - * @param string|array $paths - * @return bool - */ - public function delete($paths) - { - $paths = is_array($paths) ? $paths : func_get_args(); - - $success = true; - - foreach ($paths as $path) { - try { - if (@unlink($path)) { - clearstatcache(false, $path); - } else { - $success = false; - } - } catch (ErrorException $e) { - $success = false; - } - } - - return $success; - } - - /** - * Move a file to a new location. - * - * @param string $path - * @param string $target - * @return bool - */ - public function move($path, $target) - { - return rename($path, $target); - } - - /** - * Copy a file to a new location. - * - * @param string $path - * @param string $target - * @return bool - */ - public function copy($path, $target) - { - return copy($path, $target); - } - - /** - * Create a symlink to the target file or directory. On Windows, a hard link is created if the target is a file. - * - * @param string $target - * @param string $link - * @return void - */ - public function link($target, $link) - { - if (! windows_os()) { - return symlink($target, $link); - } - - $mode = $this->isDirectory($target) ? 'J' : 'H'; - - exec("mklink /{$mode} ".escapeshellarg($link).' '.escapeshellarg($target)); - } - - /** - * Create a relative symlink to the target file or directory. - * - * @param string $target - * @param string $link - * @return void - * - * @throws \RuntimeException - */ - public function relativeLink($target, $link) - { - if (! class_exists(SymfonyFilesystem::class)) { - throw new RuntimeException( - 'To enable support for relative links, please install the symfony/filesystem package.' - ); - } - - $relativeTarget = (new SymfonyFilesystem)->makePathRelative($target, dirname($link)); - - $this->link($this->isFile($target) ? rtrim($relativeTarget, '/') : $relativeTarget, $link); - } - - /** - * Extract the file name from a file path. - * - * @param string $path - * @return string - */ - public function name($path) - { - return pathinfo($path, PATHINFO_FILENAME); - } - - /** - * Extract the trailing name component from a file path. - * - * @param string $path - * @return string - */ - public function basename($path) - { - return pathinfo($path, PATHINFO_BASENAME); - } - - /** - * Extract the parent directory from a file path. - * - * @param string $path - * @return string - */ - public function dirname($path) - { - return pathinfo($path, PATHINFO_DIRNAME); - } - - /** - * Extract the file extension from a file path. - * - * @param string $path - * @return string - */ - public function extension($path) - { - return pathinfo($path, PATHINFO_EXTENSION); - } - - /** - * Guess the file extension from the mime-type of a given file. - * - * @param string $path - * @return string|null - * - * @throws \RuntimeException - */ - public function guessExtension($path) - { - if (! class_exists(MimeTypes::class)) { - throw new RuntimeException( - 'To enable support for guessing extensions, please install the symfony/mime package.' - ); - } - - return (new MimeTypes)->getExtensions($this->mimeType($path))[0] ?? null; - } - - /** - * Get the file type of a given file. - * - * @param string $path - * @return string - */ - public function type($path) - { - return filetype($path); - } - - /** - * Get the mime-type of a given file. - * - * @param string $path - * @return string|false - */ - public function mimeType($path) - { - return finfo_file(finfo_open(FILEINFO_MIME_TYPE), $path); - } - - /** - * Get the file size of a given file. - * - * @param string $path - * @return int - */ - public function size($path) - { - return filesize($path); - } - - /** - * Get the file's last modification time. - * - * @param string $path - * @return int - */ - public function lastModified($path) - { - return filemtime($path); - } - - /** - * Determine if the given path is a directory. - * - * @param string $directory - * @return bool - */ - public function isDirectory($directory) - { - return is_dir($directory); - } - - /** - * Determine if the given path is a directory that does not contain any other files or directories. - * - * @param string $directory - * @param bool $ignoreDotFiles - * @return bool - */ - public function isEmptyDirectory($directory, $ignoreDotFiles = false) - { - return ! Finder::create()->ignoreDotFiles($ignoreDotFiles)->in($directory)->depth(0)->hasResults(); - } - - /** - * Determine if the given path is readable. - * - * @param string $path - * @return bool - */ - public function isReadable($path) - { - return is_readable($path); - } - - /** - * Determine if the given path is writable. - * - * @param string $path - * @return bool - */ - public function isWritable($path) - { - return is_writable($path); - } - - /** - * Determine if two files are the same by comparing their hashes. - * - * @param string $firstFile - * @param string $secondFile - * @return bool - */ - public function hasSameHash($firstFile, $secondFile) - { - $hash = @md5_file($firstFile); - - return $hash && $hash === @md5_file($secondFile); - } - - /** - * Determine if the given path is a file. - * - * @param string $file - * @return bool - */ - public function isFile($file) - { - return is_file($file); - } - - /** - * Find path names matching a given pattern. - * - * @param string $pattern - * @param int $flags - * @return array - */ - public function glob($pattern, $flags = 0) - { - return glob($pattern, $flags); - } - - /** - * Get an array of all files in a directory. - * - * @param string $directory - * @param bool $hidden - * @return \Symfony\Component\Finder\SplFileInfo[] - */ - public function files($directory, $hidden = false) - { - return iterator_to_array( - Finder::create()->files()->ignoreDotFiles(! $hidden)->in($directory)->depth(0)->sortByName(), - false - ); - } - - /** - * Get all of the files from the given directory (recursive). - * - * @param string $directory - * @param bool $hidden - * @return \Symfony\Component\Finder\SplFileInfo[] - */ - public function allFiles($directory, $hidden = false) - { - return iterator_to_array( - Finder::create()->files()->ignoreDotFiles(! $hidden)->in($directory)->sortByName(), - false - ); - } - - /** - * Get all of the directories within a given directory. - * - * @param string $directory - * @return array - */ - public function directories($directory) - { - $directories = []; - - foreach (Finder::create()->in($directory)->directories()->depth(0)->sortByName() as $dir) { - $directories[] = $dir->getPathname(); - } - - return $directories; - } - - /** - * Ensure a directory exists. - * - * @param string $path - * @param int $mode - * @param bool $recursive - * @return void - */ - public function ensureDirectoryExists($path, $mode = 0755, $recursive = true) - { - if (! $this->isDirectory($path)) { - $this->makeDirectory($path, $mode, $recursive); - } - } - - /** - * Create a directory. - * - * @param string $path - * @param int $mode - * @param bool $recursive - * @param bool $force - * @return bool - */ - public function makeDirectory($path, $mode = 0755, $recursive = false, $force = false) - { - if ($force) { - return @mkdir($path, $mode, $recursive); - } - - return mkdir($path, $mode, $recursive); - } - - /** - * Move a directory. - * - * @param string $from - * @param string $to - * @param bool $overwrite - * @return bool - */ - public function moveDirectory($from, $to, $overwrite = false) - { - if ($overwrite && $this->isDirectory($to) && ! $this->deleteDirectory($to)) { - return false; - } - - return @rename($from, $to) === true; - } - - /** - * Copy a directory from one location to another. - * - * @param string $directory - * @param string $destination - * @param int|null $options - * @return bool - */ - public function copyDirectory($directory, $destination, $options = null) - { - if (! $this->isDirectory($directory)) { - return false; - } - - $options = $options ?: FilesystemIterator::SKIP_DOTS; - - // If the destination directory does not actually exist, we will go ahead and - // create it recursively, which just gets the destination prepared to copy - // the files over. Once we make the directory we'll proceed the copying. - $this->ensureDirectoryExists($destination, 0777); - - $items = new FilesystemIterator($directory, $options); - - foreach ($items as $item) { - // As we spin through items, we will check to see if the current file is actually - // a directory or a file. When it is actually a directory we will need to call - // back into this function recursively to keep copying these nested folders. - $target = $destination.'/'.$item->getBasename(); - - if ($item->isDir()) { - $path = $item->getPathname(); - - if (! $this->copyDirectory($path, $target, $options)) { - return false; - } - } - - // If the current items is just a regular file, we will just copy this to the new - // location and keep looping. If for some reason the copy fails we'll bail out - // and return false, so the developer is aware that the copy process failed. - elseif (! $this->copy($item->getPathname(), $target)) { - return false; - } - } - - return true; - } - - /** - * Recursively delete a directory. - * - * The directory itself may be optionally preserved. - * - * @param string $directory - * @param bool $preserve - * @return bool - */ - public function deleteDirectory($directory, $preserve = false) - { - if (! $this->isDirectory($directory)) { - return false; - } - - $items = new FilesystemIterator($directory); - - foreach ($items as $item) { - // If the item is a directory, we can just recurse into the function and - // delete that sub-directory otherwise we'll just delete the file and - // keep iterating through each file until the directory is cleaned. - if ($item->isDir() && ! $item->isLink()) { - $this->deleteDirectory($item->getPathname()); - } - - // If the item is just a file, we can go ahead and delete it since we're - // just looping through and waxing all of the files in this directory - // and calling directories recursively, so we delete the real path. - else { - $this->delete($item->getPathname()); - } - } - - if (! $preserve) { - @rmdir($directory); - } - - return true; - } - - /** - * Remove all of the directories within a given directory. - * - * @param string $directory - * @return bool - */ - public function deleteDirectories($directory) - { - $allDirectories = $this->directories($directory); - - if (! empty($allDirectories)) { - foreach ($allDirectories as $directoryName) { - $this->deleteDirectory($directoryName); - } - - return true; - } - - return false; - } - - /** - * Empty the specified directory of all files and folders. - * - * @param string $directory - * @return bool - */ - public function cleanDirectory($directory) - { - return $this->deleteDirectory($directory, true); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php b/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php deleted file mode 100644 index 87606c97..00000000 --- a/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php +++ /dev/null @@ -1,953 +0,0 @@ -driver = $driver; - $this->adapter = $adapter; - $this->config = $config; - $separator = $config['directory_separator'] ?? DIRECTORY_SEPARATOR; - - $this->prefixer = new PathPrefixer($config['root'] ?? '', $separator); - - if (isset($config['prefix'])) { - $this->prefixer = new PathPrefixer($this->prefixer->prefixPath($config['prefix']), $separator); - } - } - - /** - * Assert that the given file or directory exists. - * - * @param string|array $path - * @param string|null $content - * @return $this - */ - public function assertExists($path, $content = null) - { - clearstatcache(); - - $paths = Arr::wrap($path); - - foreach ($paths as $path) { - PHPUnit::assertTrue( - $this->exists($path), "Unable to find a file or directory at path [{$path}]." - ); - - if (! is_null($content)) { - $actual = $this->get($path); - - PHPUnit::assertSame( - $content, - $actual, - "File or directory [{$path}] was found, but content [{$actual}] does not match [{$content}]." - ); - } - } - - return $this; - } - - /** - * Assert that the given file or directory does not exist. - * - * @param string|array $path - * @return $this - */ - public function assertMissing($path) - { - clearstatcache(); - - $paths = Arr::wrap($path); - - foreach ($paths as $path) { - PHPUnit::assertFalse( - $this->exists($path), "Found unexpected file or directory at path [{$path}]." - ); - } - - return $this; - } - - /** - * Assert that the given directory is empty. - * - * @param string $path - * @return $this - */ - public function assertDirectoryEmpty($path) - { - PHPUnit::assertEmpty( - $this->allFiles($path), "Directory [{$path}] is not empty." - ); - - return $this; - } - - /** - * Determine if a file or directory exists. - * - * @param string $path - * @return bool - */ - public function exists($path) - { - return $this->driver->has($path); - } - - /** - * Determine if a file or directory is missing. - * - * @param string $path - * @return bool - */ - public function missing($path) - { - return ! $this->exists($path); - } - - /** - * Determine if a file exists. - * - * @param string $path - * @return bool - */ - public function fileExists($path) - { - return $this->driver->fileExists($path); - } - - /** - * Determine if a file is missing. - * - * @param string $path - * @return bool - */ - public function fileMissing($path) - { - return ! $this->fileExists($path); - } - - /** - * Determine if a directory exists. - * - * @param string $path - * @return bool - */ - public function directoryExists($path) - { - return $this->driver->directoryExists($path); - } - - /** - * Determine if a directory is missing. - * - * @param string $path - * @return bool - */ - public function directoryMissing($path) - { - return ! $this->directoryExists($path); - } - - /** - * Get the full path for the file at the given "short" path. - * - * @param string $path - * @return string - */ - public function path($path) - { - return $this->prefixer->prefixPath($path); - } - - /** - * Get the contents of a file. - * - * @param string $path - * @return string|null - */ - public function get($path) - { - try { - return $this->driver->read($path); - } catch (UnableToReadFile $e) { - throw_if($this->throwsExceptions(), $e); - } - } - - /** - * Create a streamed response for a given file. - * - * @param string $path - * @param string|null $name - * @param array $headers - * @param string|null $disposition - * @return \Symfony\Component\HttpFoundation\StreamedResponse - */ - public function response($path, $name = null, array $headers = [], $disposition = 'inline') - { - $response = new StreamedResponse; - - if (! array_key_exists('Content-Type', $headers)) { - $headers['Content-Type'] = $this->mimeType($path); - } - - if (! array_key_exists('Content-Length', $headers)) { - $headers['Content-Length'] = $this->size($path); - } - - if (! array_key_exists('Content-Disposition', $headers)) { - $filename = $name ?? basename($path); - - $disposition = $response->headers->makeDisposition( - $disposition, $filename, $this->fallbackName($filename) - ); - - $headers['Content-Disposition'] = $disposition; - } - - $response->headers->replace($headers); - - $response->setCallback(function () use ($path) { - $stream = $this->readStream($path); - fpassthru($stream); - fclose($stream); - }); - - return $response; - } - - /** - * Create a streamed download response for a given file. - * - * @param string $path - * @param string|null $name - * @return \Symfony\Component\HttpFoundation\StreamedResponse - */ - public function download($path, $name = null, array $headers = []) - { - return $this->response($path, $name, $headers, 'attachment'); - } - - /** - * Convert the string to ASCII characters that are equivalent to the given name. - * - * @param string $name - * @return string - */ - protected function fallbackName($name) - { - return str_replace('%', '', Str::ascii($name)); - } - - /** - * Write the contents of a file. - * - * @param string $path - * @param \Psr\Http\Message\StreamInterface|\Illuminate\Http\File|\Illuminate\Http\UploadedFile|string|resource $contents - * @param mixed $options - * @return string|bool - */ - public function put($path, $contents, $options = []) - { - $options = is_string($options) - ? ['visibility' => $options] - : (array) $options; - - // If the given contents is actually a file or uploaded file instance than we will - // automatically store the file using a stream. This provides a convenient path - // for the developer to store streams without managing them manually in code. - if ($contents instanceof File || - $contents instanceof UploadedFile) { - return $this->putFile($path, $contents, $options); - } - - try { - if ($contents instanceof StreamInterface) { - $this->driver->writeStream($path, $contents->detach(), $options); - - return true; - } - - is_resource($contents) - ? $this->driver->writeStream($path, $contents, $options) - : $this->driver->write($path, $contents, $options); - } catch (UnableToWriteFile|UnableToSetVisibility $e) { - throw_if($this->throwsExceptions(), $e); - - return false; - } - - return true; - } - - /** - * Store the uploaded file on the disk. - * - * @param string $path - * @param \Illuminate\Http\File|\Illuminate\Http\UploadedFile|string $file - * @param mixed $options - * @return string|false - */ - public function putFile($path, $file, $options = []) - { - $file = is_string($file) ? new File($file) : $file; - - return $this->putFileAs($path, $file, $file->hashName(), $options); - } - - /** - * Store the uploaded file on the disk with a given name. - * - * @param string $path - * @param \Illuminate\Http\File|\Illuminate\Http\UploadedFile|string $file - * @param string $name - * @param mixed $options - * @return string|false - */ - public function putFileAs($path, $file, $name, $options = []) - { - $stream = fopen(is_string($file) ? $file : $file->getRealPath(), 'r'); - - // Next, we will format the path of the file and store the file using a stream since - // they provide better performance than alternatives. Once we write the file this - // stream will get closed automatically by us so the developer doesn't have to. - $result = $this->put( - $path = trim($path.'/'.$name, '/'), $stream, $options - ); - - if (is_resource($stream)) { - fclose($stream); - } - - return $result ? $path : false; - } - - /** - * Get the visibility for the given path. - * - * @param string $path - * @return string - */ - public function getVisibility($path) - { - if ($this->driver->visibility($path) == Visibility::PUBLIC) { - return FilesystemContract::VISIBILITY_PUBLIC; - } - - return FilesystemContract::VISIBILITY_PRIVATE; - } - - /** - * Set the visibility for the given path. - * - * @param string $path - * @param string $visibility - * @return bool - */ - public function setVisibility($path, $visibility) - { - try { - $this->driver->setVisibility($path, $this->parseVisibility($visibility)); - } catch (UnableToSetVisibility $e) { - throw_if($this->throwsExceptions(), $e); - - return false; - } - - return true; - } - - /** - * Prepend to a file. - * - * @param string $path - * @param string $data - * @param string $separator - * @return bool - */ - public function prepend($path, $data, $separator = PHP_EOL) - { - if ($this->fileExists($path)) { - return $this->put($path, $data.$separator.$this->get($path)); - } - - return $this->put($path, $data); - } - - /** - * Append to a file. - * - * @param string $path - * @param string $data - * @param string $separator - * @return bool - */ - public function append($path, $data, $separator = PHP_EOL) - { - if ($this->fileExists($path)) { - return $this->put($path, $this->get($path).$separator.$data); - } - - return $this->put($path, $data); - } - - /** - * Delete the file at a given path. - * - * @param string|array $paths - * @return bool - */ - public function delete($paths) - { - $paths = is_array($paths) ? $paths : func_get_args(); - - $success = true; - - foreach ($paths as $path) { - try { - $this->driver->delete($path); - } catch (UnableToDeleteFile $e) { - throw_if($this->throwsExceptions(), $e); - - $success = false; - } - } - - return $success; - } - - /** - * Copy a file to a new location. - * - * @param string $from - * @param string $to - * @return bool - */ - public function copy($from, $to) - { - try { - $this->driver->copy($from, $to); - } catch (UnableToCopyFile $e) { - throw_if($this->throwsExceptions(), $e); - - return false; - } - - return true; - } - - /** - * Move a file to a new location. - * - * @param string $from - * @param string $to - * @return bool - */ - public function move($from, $to) - { - try { - $this->driver->move($from, $to); - } catch (UnableToMoveFile $e) { - throw_if($this->throwsExceptions(), $e); - - return false; - } - - return true; - } - - /** - * Get the file size of a given file. - * - * @param string $path - * @return int - */ - public function size($path) - { - return $this->driver->fileSize($path); - } - - /** - * Get the checksum for a file. - * - * @return string|false - * - * @throws UnableToProvideChecksum - */ - public function checksum(string $path, array $options = []) - { - try { - return $this->driver->checksum($path, $options); - } catch (UnableToProvideChecksum $e) { - throw_if($this->throwsExceptions(), $e); - - return false; - } - } - - /** - * Get the mime-type of a given file. - * - * @param string $path - * @return string|false - */ - public function mimeType($path) - { - try { - return $this->driver->mimeType($path); - } catch (UnableToRetrieveMetadata $e) { - throw_if($this->throwsExceptions(), $e); - } - - return false; - } - - /** - * Get the file's last modification time. - * - * @param string $path - * @return int - */ - public function lastModified($path) - { - return $this->driver->lastModified($path); - } - - /** - * {@inheritdoc} - */ - public function readStream($path) - { - try { - return $this->driver->readStream($path); - } catch (UnableToReadFile $e) { - throw_if($this->throwsExceptions(), $e); - } - } - - /** - * {@inheritdoc} - */ - public function writeStream($path, $resource, array $options = []) - { - try { - $this->driver->writeStream($path, $resource, $options); - } catch (UnableToWriteFile|UnableToSetVisibility $e) { - throw_if($this->throwsExceptions(), $e); - - return false; - } - - return true; - } - - /** - * Get the URL for the file at the given path. - * - * @param string $path - * @return string - * - * @throws \RuntimeException - */ - public function url($path) - { - if (isset($this->config['prefix'])) { - $path = $this->concatPathToUrl($this->config['prefix'], $path); - } - - $adapter = $this->adapter; - - if (method_exists($adapter, 'getUrl')) { - return $adapter->getUrl($path); - } elseif (method_exists($this->driver, 'getUrl')) { - return $this->driver->getUrl($path); - } elseif ($adapter instanceof FtpAdapter || $adapter instanceof SftpAdapter) { - return $this->getFtpUrl($path); - } elseif ($adapter instanceof LocalAdapter) { - return $this->getLocalUrl($path); - } else { - throw new RuntimeException('This driver does not support retrieving URLs.'); - } - } - - /** - * Get the URL for the file at the given path. - * - * @param string $path - * @return string - */ - protected function getFtpUrl($path) - { - return isset($this->config['url']) - ? $this->concatPathToUrl($this->config['url'], $path) - : $path; - } - - /** - * Get the URL for the file at the given path. - * - * @param string $path - * @return string - */ - protected function getLocalUrl($path) - { - // If an explicit base URL has been set on the disk configuration then we will use - // it as the base URL instead of the default path. This allows the developer to - // have full control over the base path for this filesystem's generated URLs. - if (isset($this->config['url'])) { - return $this->concatPathToUrl($this->config['url'], $path); - } - - $path = '/storage/'.$path; - - // If the path contains "storage/public", it probably means the developer is using - // the default disk to generate the path instead of the "public" disk like they - // are really supposed to use. We will remove the public from this path here. - if (str_contains($path, '/storage/public/')) { - return Str::replaceFirst('/public/', '/', $path); - } - - return $path; - } - - /** - * Determine if temporary URLs can be generated. - * - * @return bool - */ - public function providesTemporaryUrls() - { - return method_exists($this->adapter, 'getTemporaryUrl') || isset($this->temporaryUrlCallback); - } - - /** - * Get a temporary URL for the file at the given path. - * - * @param string $path - * @param \DateTimeInterface $expiration - * @param array $options - * @return string - * - * @throws \RuntimeException - */ - public function temporaryUrl($path, $expiration, array $options = []) - { - if (method_exists($this->adapter, 'getTemporaryUrl')) { - return $this->adapter->getTemporaryUrl($path, $expiration, $options); - } - - if ($this->temporaryUrlCallback) { - return $this->temporaryUrlCallback->bindTo($this, static::class)( - $path, $expiration, $options - ); - } - - throw new RuntimeException('This driver does not support creating temporary URLs.'); - } - - /** - * Concatenate a path to a URL. - * - * @param string $url - * @param string $path - * @return string - */ - protected function concatPathToUrl($url, $path) - { - return rtrim($url, '/').'/'.ltrim($path, '/'); - } - - /** - * Replace the scheme, host and port of the given UriInterface with values from the given URL. - * - * @param \Psr\Http\Message\UriInterface $uri - * @param string $url - * @return \Psr\Http\Message\UriInterface - */ - protected function replaceBaseUrl($uri, $url) - { - $parsed = parse_url($url); - - return $uri - ->withScheme($parsed['scheme']) - ->withHost($parsed['host']) - ->withPort($parsed['port'] ?? null); - } - - /** - * Get an array of all files in a directory. - * - * @param string|null $directory - * @param bool $recursive - * @return array - */ - public function files($directory = null, $recursive = false) - { - return $this->driver->listContents($directory ?? '', $recursive) - ->filter(function (StorageAttributes $attributes) { - return $attributes->isFile(); - }) - ->sortByPath() - ->map(function (StorageAttributes $attributes) { - return $attributes->path(); - }) - ->toArray(); - } - - /** - * Get all of the files from the given directory (recursive). - * - * @param string|null $directory - * @return array - */ - public function allFiles($directory = null) - { - return $this->files($directory, true); - } - - /** - * Get all of the directories within a given directory. - * - * @param string|null $directory - * @param bool $recursive - * @return array - */ - public function directories($directory = null, $recursive = false) - { - return $this->driver->listContents($directory ?? '', $recursive) - ->filter(function (StorageAttributes $attributes) { - return $attributes->isDir(); - }) - ->map(function (StorageAttributes $attributes) { - return $attributes->path(); - }) - ->toArray(); - } - - /** - * Get all the directories within a given directory (recursive). - * - * @param string|null $directory - * @return array - */ - public function allDirectories($directory = null) - { - return $this->directories($directory, true); - } - - /** - * Create a directory. - * - * @param string $path - * @return bool - */ - public function makeDirectory($path) - { - try { - $this->driver->createDirectory($path); - } catch (UnableToCreateDirectory|UnableToSetVisibility $e) { - throw_if($this->throwsExceptions(), $e); - - return false; - } - - return true; - } - - /** - * Recursively delete a directory. - * - * @param string $directory - * @return bool - */ - public function deleteDirectory($directory) - { - try { - $this->driver->deleteDirectory($directory); - } catch (UnableToDeleteDirectory $e) { - throw_if($this->throwsExceptions(), $e); - - return false; - } - - return true; - } - - /** - * Get the Flysystem driver. - * - * @return \League\Flysystem\FilesystemOperator - */ - public function getDriver() - { - return $this->driver; - } - - /** - * Get the Flysystem adapter. - * - * @return \League\Flysystem\FilesystemAdapter - */ - public function getAdapter() - { - return $this->adapter; - } - - /** - * Get the configuration values. - * - * @return array - */ - public function getConfig() - { - return $this->config; - } - - /** - * Parse the given visibility value. - * - * @param string|null $visibility - * @return string|null - * - * @throws \InvalidArgumentException - */ - protected function parseVisibility($visibility) - { - if (is_null($visibility)) { - return; - } - - return match ($visibility) { - FilesystemContract::VISIBILITY_PUBLIC => Visibility::PUBLIC, - FilesystemContract::VISIBILITY_PRIVATE => Visibility::PRIVATE, - default => throw new InvalidArgumentException("Unknown visibility: {$visibility}."), - }; - } - - /** - * Define a custom temporary URL builder callback. - * - * @param \Closure $callback - * @return void - */ - public function buildTemporaryUrlsUsing(Closure $callback) - { - $this->temporaryUrlCallback = $callback; - } - - /** - * Determine if Flysystem exceptions should be thrown. - * - * @return bool - */ - protected function throwsExceptions(): bool - { - return (bool) ($this->config['throw'] ?? false); - } - - /** - * Pass dynamic methods call onto Flysystem. - * - * @param string $method - * @param array $parameters - * @return mixed - * - * @throws \BadMethodCallException - */ - public function __call($method, array $parameters) - { - if (static::hasMacro($method)) { - return $this->macroCall($method, $parameters); - } - - return $this->driver->{$method}(...$parameters); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemManager.php b/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemManager.php deleted file mode 100644 index 9bfab780..00000000 --- a/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemManager.php +++ /dev/null @@ -1,428 +0,0 @@ -app = $app; - } - - /** - * Get a filesystem instance. - * - * @param string|null $name - * @return \Illuminate\Contracts\Filesystem\Filesystem - */ - public function drive($name = null) - { - return $this->disk($name); - } - - /** - * Get a filesystem instance. - * - * @param string|null $name - * @return \Illuminate\Contracts\Filesystem\Filesystem - */ - public function disk($name = null) - { - $name = $name ?: $this->getDefaultDriver(); - - return $this->disks[$name] = $this->get($name); - } - - /** - * Get a default cloud filesystem instance. - * - * @return \Illuminate\Contracts\Filesystem\Filesystem - */ - public function cloud() - { - $name = $this->getDefaultCloudDriver(); - - return $this->disks[$name] = $this->get($name); - } - - /** - * Build an on-demand disk. - * - * @param string|array $config - * @return \Illuminate\Contracts\Filesystem\Filesystem - */ - public function build($config) - { - return $this->resolve('ondemand', is_array($config) ? $config : [ - 'driver' => 'local', - 'root' => $config, - ]); - } - - /** - * Attempt to get the disk from the local cache. - * - * @param string $name - * @return \Illuminate\Contracts\Filesystem\Filesystem - */ - protected function get($name) - { - return $this->disks[$name] ?? $this->resolve($name); - } - - /** - * Resolve the given disk. - * - * @param string $name - * @param array|null $config - * @return \Illuminate\Contracts\Filesystem\Filesystem - * - * @throws \InvalidArgumentException - */ - protected function resolve($name, $config = null) - { - $config ??= $this->getConfig($name); - - if (empty($config['driver'])) { - throw new InvalidArgumentException("Disk [{$name}] does not have a configured driver."); - } - - $name = $config['driver']; - - if (isset($this->customCreators[$name])) { - return $this->callCustomCreator($config); - } - - $driverMethod = 'create'.ucfirst($name).'Driver'; - - if (! method_exists($this, $driverMethod)) { - throw new InvalidArgumentException("Driver [{$name}] is not supported."); - } - - return $this->{$driverMethod}($config); - } - - /** - * Call a custom driver creator. - * - * @param array $config - * @return \Illuminate\Contracts\Filesystem\Filesystem - */ - protected function callCustomCreator(array $config) - { - return $this->customCreators[$config['driver']]($this->app, $config); - } - - /** - * Create an instance of the local driver. - * - * @param array $config - * @return \Illuminate\Contracts\Filesystem\Filesystem - */ - public function createLocalDriver(array $config) - { - $visibility = PortableVisibilityConverter::fromArray( - $config['permissions'] ?? [], - $config['directory_visibility'] ?? $config['visibility'] ?? Visibility::PRIVATE - ); - - $links = ($config['links'] ?? null) === 'skip' - ? LocalAdapter::SKIP_LINKS - : LocalAdapter::DISALLOW_LINKS; - - $adapter = new LocalAdapter( - $config['root'], $visibility, $config['lock'] ?? LOCK_EX, $links - ); - - return new FilesystemAdapter($this->createFlysystem($adapter, $config), $adapter, $config); - } - - /** - * Create an instance of the ftp driver. - * - * @param array $config - * @return \Illuminate\Contracts\Filesystem\Filesystem - */ - public function createFtpDriver(array $config) - { - if (! isset($config['root'])) { - $config['root'] = ''; - } - - $adapter = new FtpAdapter(FtpConnectionOptions::fromArray($config)); - - return new FilesystemAdapter($this->createFlysystem($adapter, $config), $adapter, $config); - } - - /** - * Create an instance of the sftp driver. - * - * @param array $config - * @return \Illuminate\Contracts\Filesystem\Filesystem - */ - public function createSftpDriver(array $config) - { - $provider = SftpConnectionProvider::fromArray($config); - - $root = $config['root'] ?? '/'; - - $visibility = PortableVisibilityConverter::fromArray( - $config['permissions'] ?? [] - ); - - $adapter = new SftpAdapter($provider, $root, $visibility); - - return new FilesystemAdapter($this->createFlysystem($adapter, $config), $adapter, $config); - } - - /** - * Create an instance of the Amazon S3 driver. - * - * @param array $config - * @return \Illuminate\Contracts\Filesystem\Cloud - */ - public function createS3Driver(array $config) - { - $s3Config = $this->formatS3Config($config); - - $root = (string) ($s3Config['root'] ?? ''); - - $visibility = new AwsS3PortableVisibilityConverter( - $config['visibility'] ?? Visibility::PUBLIC - ); - - $streamReads = $s3Config['stream_reads'] ?? false; - - $client = new S3Client($s3Config); - - $adapter = new S3Adapter($client, $s3Config['bucket'], $root, $visibility, null, $config['options'] ?? [], $streamReads); - - return new AwsS3V3Adapter( - $this->createFlysystem($adapter, $config), $adapter, $s3Config, $client - ); - } - - /** - * Format the given S3 configuration with the default options. - * - * @param array $config - * @return array - */ - protected function formatS3Config(array $config) - { - $config += ['version' => 'latest']; - - if (! empty($config['key']) && ! empty($config['secret'])) { - $config['credentials'] = Arr::only($config, ['key', 'secret', 'token']); - } - - return Arr::except($config, ['token']); - } - - /** - * Create a scoped driver. - * - * @param array $config - * @return \Illuminate\Contracts\Filesystem\Filesystem - */ - public function createScopedDriver(array $config) - { - if (empty($config['disk'])) { - throw new InvalidArgumentException('Scoped disk is missing "disk" configuration option.'); - } elseif (empty($config['prefix'])) { - throw new InvalidArgumentException('Scoped disk is missing "prefix" configuration option.'); - } - - return $this->build(tap( - $this->getConfig($config['disk']), - fn (&$parent) => $parent['prefix'] = $config['prefix'] - )); - } - - /** - * Create a Flysystem instance with the given adapter. - * - * @param \League\Flysystem\FilesystemAdapter $adapter - * @param array $config - * @return \League\Flysystem\FilesystemOperator - */ - protected function createFlysystem(FlysystemAdapter $adapter, array $config) - { - if ($config['read-only'] ?? false === true) { - $adapter = new ReadOnlyFilesystemAdapter($adapter); - } - - if (! empty($config['prefix'])) { - $adapter = new PathPrefixedAdapter($adapter, $config['prefix']); - } - - return new Flysystem($adapter, Arr::only($config, [ - 'directory_visibility', - 'disable_asserts', - 'temporary_url', - 'url', - 'visibility', - ])); - } - - /** - * Set the given disk instance. - * - * @param string $name - * @param mixed $disk - * @return $this - */ - public function set($name, $disk) - { - $this->disks[$name] = $disk; - - return $this; - } - - /** - * Get the filesystem connection configuration. - * - * @param string $name - * @return array - */ - protected function getConfig($name) - { - return $this->app['config']["filesystems.disks.{$name}"] ?: []; - } - - /** - * Get the default driver name. - * - * @return string - */ - public function getDefaultDriver() - { - return $this->app['config']['filesystems.default']; - } - - /** - * Get the default cloud driver name. - * - * @return string - */ - public function getDefaultCloudDriver() - { - return $this->app['config']['filesystems.cloud'] ?? 's3'; - } - - /** - * Unset the given disk instances. - * - * @param array|string $disk - * @return $this - */ - public function forgetDisk($disk) - { - foreach ((array) $disk as $diskName) { - unset($this->disks[$diskName]); - } - - return $this; - } - - /** - * Disconnect the given disk and remove from local cache. - * - * @param string|null $name - * @return void - */ - public function purge($name = null) - { - $name ??= $this->getDefaultDriver(); - - unset($this->disks[$name]); - } - - /** - * Register a custom driver creator Closure. - * - * @param string $driver - * @param \Closure $callback - * @return $this - */ - public function extend($driver, Closure $callback) - { - $this->customCreators[$driver] = $callback; - - return $this; - } - - /** - * Set the application instance used by the manager. - * - * @param \Illuminate\Contracts\Foundation\Application $app - * @return $this - */ - public function setApplication($app) - { - $this->app = $app; - - return $this; - } - - /** - * Dynamically call the default driver instance. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - return $this->disk()->$method(...$parameters); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemServiceProvider.php b/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemServiceProvider.php deleted file mode 100644 index ff348a22..00000000 --- a/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemServiceProvider.php +++ /dev/null @@ -1,82 +0,0 @@ -registerNativeFilesystem(); - - $this->registerFlysystem(); - } - - /** - * Register the native filesystem implementation. - * - * @return void - */ - protected function registerNativeFilesystem() - { - $this->app->singleton('files', function () { - return new Filesystem; - }); - } - - /** - * Register the driver based filesystem. - * - * @return void - */ - protected function registerFlysystem() - { - $this->registerManager(); - - $this->app->singleton('filesystem.disk', function ($app) { - return $app['filesystem']->disk($this->getDefaultDriver()); - }); - - $this->app->singleton('filesystem.cloud', function ($app) { - return $app['filesystem']->disk($this->getCloudDriver()); - }); - } - - /** - * Register the filesystem manager. - * - * @return void - */ - protected function registerManager() - { - $this->app->singleton('filesystem', function ($app) { - return new FilesystemManager($app); - }); - } - - /** - * Get the default file driver. - * - * @return string - */ - protected function getDefaultDriver() - { - return $this->app['config']['filesystems.default']; - } - - /** - * Get the default cloud based file driver. - * - * @return string - */ - protected function getCloudDriver() - { - return $this->app['config']['filesystems.cloud']; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Filesystem/LICENSE.md b/vendor/laravel/framework/src/Illuminate/Filesystem/LICENSE.md deleted file mode 100644 index 79810c84..00000000 --- a/vendor/laravel/framework/src/Illuminate/Filesystem/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Taylor Otwell - -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/laravel/framework/src/Illuminate/Filesystem/LockableFile.php b/vendor/laravel/framework/src/Illuminate/Filesystem/LockableFile.php deleted file mode 100644 index 8b2de765..00000000 --- a/vendor/laravel/framework/src/Illuminate/Filesystem/LockableFile.php +++ /dev/null @@ -1,194 +0,0 @@ -path = $path; - - $this->ensureDirectoryExists($path); - $this->createResource($path, $mode); - } - - /** - * Create the file's directory if necessary. - * - * @param string $path - * @return void - */ - protected function ensureDirectoryExists($path) - { - if (! file_exists(dirname($path))) { - @mkdir(dirname($path), 0777, true); - } - } - - /** - * Create the file resource. - * - * @param string $path - * @param string $mode - * @return void - * - * @throws \Exception - */ - protected function createResource($path, $mode) - { - $this->handle = @fopen($path, $mode); - - if (! $this->handle) { - throw new Exception('Unable to create lockable file: '.$path.'. Please ensure you have permission to create files in this location.'); - } - } - - /** - * Read the file contents. - * - * @param int|null $length - * @return string - */ - public function read($length = null) - { - clearstatcache(true, $this->path); - - return fread($this->handle, $length ?? ($this->size() ?: 1)); - } - - /** - * Get the file size. - * - * @return int - */ - public function size() - { - return filesize($this->path); - } - - /** - * Write to the file. - * - * @param string $contents - * @return $this - */ - public function write($contents) - { - fwrite($this->handle, $contents); - - fflush($this->handle); - - return $this; - } - - /** - * Truncate the file. - * - * @return $this - */ - public function truncate() - { - rewind($this->handle); - - ftruncate($this->handle, 0); - - return $this; - } - - /** - * Get a shared lock on the file. - * - * @param bool $block - * @return $this - * - * @throws \Illuminate\Contracts\Filesystem\LockTimeoutException - */ - public function getSharedLock($block = false) - { - if (! flock($this->handle, LOCK_SH | ($block ? 0 : LOCK_NB))) { - throw new LockTimeoutException("Unable to acquire file lock at path [{$this->path}]."); - } - - $this->isLocked = true; - - return $this; - } - - /** - * Get an exclusive lock on the file. - * - * @param bool $block - * @return bool - * - * @throws \Illuminate\Contracts\Filesystem\LockTimeoutException - */ - public function getExclusiveLock($block = false) - { - if (! flock($this->handle, LOCK_EX | ($block ? 0 : LOCK_NB))) { - throw new LockTimeoutException("Unable to acquire file lock at path [{$this->path}]."); - } - - $this->isLocked = true; - - return $this; - } - - /** - * Release the lock on the file. - * - * @return $this - */ - public function releaseLock() - { - flock($this->handle, LOCK_UN); - - $this->isLocked = false; - - return $this; - } - - /** - * Close the file. - * - * @return bool - */ - public function close() - { - if ($this->isLocked) { - $this->releaseLock(); - } - - return fclose($this->handle); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Filesystem/composer.json b/vendor/laravel/framework/src/Illuminate/Filesystem/composer.json deleted file mode 100644 index 13d52d8d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Filesystem/composer.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "illuminate/filesystem", - "description": "The Illuminate Filesystem package.", - "license": "MIT", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "require": { - "php": "^8.0.2", - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0", - "symfony/finder": "^6.0" - }, - "autoload": { - "psr-4": { - "Illuminate\\Filesystem\\": "" - } - }, - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "suggest": { - "ext-ftp": "Required to use the Flysystem FTP driver.", - "illuminate/http": "Required for handling uploaded files (^7.0).", - "league/flysystem": "Required to use the Flysystem local driver (^3.0.16).", - "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^3.0).", - "league/flysystem-ftp": "Required to use the Flysystem FTP driver (^3.0).", - "league/flysystem-sftp-v3": "Required to use the Flysystem SFTP driver (^3.0).", - "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).", - "symfony/filesystem": "Required to enable support for relative symbolic links (^6.0).", - "symfony/mime": "Required to enable support for guessing extensions (^6.0)." - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev" -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/AliasLoader.php b/vendor/laravel/framework/src/Illuminate/Foundation/AliasLoader.php deleted file mode 100755 index 5146e443..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/AliasLoader.php +++ /dev/null @@ -1,243 +0,0 @@ -aliases = $aliases; - } - - /** - * Get or create the singleton alias loader instance. - * - * @param array $aliases - * @return \Illuminate\Foundation\AliasLoader - */ - public static function getInstance(array $aliases = []) - { - if (is_null(static::$instance)) { - return static::$instance = new static($aliases); - } - - $aliases = array_merge(static::$instance->getAliases(), $aliases); - - static::$instance->setAliases($aliases); - - return static::$instance; - } - - /** - * Load a class alias if it is registered. - * - * @param string $alias - * @return bool|null - */ - public function load($alias) - { - if (static::$facadeNamespace && str_starts_with($alias, static::$facadeNamespace)) { - $this->loadFacade($alias); - - return true; - } - - if (isset($this->aliases[$alias])) { - return class_alias($this->aliases[$alias], $alias); - } - } - - /** - * Load a real-time facade for the given alias. - * - * @param string $alias - * @return void - */ - protected function loadFacade($alias) - { - require $this->ensureFacadeExists($alias); - } - - /** - * Ensure that the given alias has an existing real-time facade class. - * - * @param string $alias - * @return string - */ - protected function ensureFacadeExists($alias) - { - if (is_file($path = storage_path('framework/cache/facade-'.sha1($alias).'.php'))) { - return $path; - } - - file_put_contents($path, $this->formatFacadeStub( - $alias, file_get_contents(__DIR__.'/stubs/facade.stub') - )); - - return $path; - } - - /** - * Format the facade stub with the proper namespace and class. - * - * @param string $alias - * @param string $stub - * @return string - */ - protected function formatFacadeStub($alias, $stub) - { - $replacements = [ - str_replace('/', '\\', dirname(str_replace('\\', '/', $alias))), - class_basename($alias), - substr($alias, strlen(static::$facadeNamespace)), - ]; - - return str_replace( - ['DummyNamespace', 'DummyClass', 'DummyTarget'], $replacements, $stub - ); - } - - /** - * Add an alias to the loader. - * - * @param string $alias - * @param string $class - * @return void - */ - public function alias($alias, $class) - { - $this->aliases[$alias] = $class; - } - - /** - * Register the loader on the auto-loader stack. - * - * @return void - */ - public function register() - { - if (! $this->registered) { - $this->prependToLoaderStack(); - - $this->registered = true; - } - } - - /** - * Prepend the load method to the auto-loader stack. - * - * @return void - */ - protected function prependToLoaderStack() - { - spl_autoload_register([$this, 'load'], true, true); - } - - /** - * Get the registered aliases. - * - * @return array - */ - public function getAliases() - { - return $this->aliases; - } - - /** - * Set the registered aliases. - * - * @param array $aliases - * @return void - */ - public function setAliases(array $aliases) - { - $this->aliases = $aliases; - } - - /** - * Indicates if the loader has been registered. - * - * @return bool - */ - public function isRegistered() - { - return $this->registered; - } - - /** - * Set the "registered" state of the loader. - * - * @param bool $value - * @return void - */ - public function setRegistered($value) - { - $this->registered = $value; - } - - /** - * Set the real-time facade namespace. - * - * @param string $namespace - * @return void - */ - public static function setFacadeNamespace($namespace) - { - static::$facadeNamespace = rtrim($namespace, '\\').'\\'; - } - - /** - * Set the value of the singleton alias loader. - * - * @param \Illuminate\Foundation\AliasLoader $loader - * @return void - */ - public static function setInstance($loader) - { - static::$instance = $loader; - } - - /** - * Clone method. - * - * @return void - */ - private function __clone() - { - // - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Application.php b/vendor/laravel/framework/src/Illuminate/Foundation/Application.php deleted file mode 100755 index 3c228a1c..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Application.php +++ /dev/null @@ -1,1431 +0,0 @@ -setBasePath($basePath); - } - - $this->registerBaseBindings(); - $this->registerBaseServiceProviders(); - $this->registerCoreContainerAliases(); - } - - /** - * Get the version number of the application. - * - * @return string - */ - public function version() - { - return static::VERSION; - } - - /** - * Register the basic bindings into the container. - * - * @return void - */ - protected function registerBaseBindings() - { - static::setInstance($this); - - $this->instance('app', $this); - - $this->instance(Container::class, $this); - $this->singleton(Mix::class); - - $this->singleton(PackageManifest::class, function () { - return new PackageManifest( - new Filesystem, $this->basePath(), $this->getCachedPackagesPath() - ); - }); - } - - /** - * Register all of the base service providers. - * - * @return void - */ - protected function registerBaseServiceProviders() - { - $this->register(new EventServiceProvider($this)); - $this->register(new LogServiceProvider($this)); - $this->register(new RoutingServiceProvider($this)); - } - - /** - * Run the given array of bootstrap classes. - * - * @param string[] $bootstrappers - * @return void - */ - public function bootstrapWith(array $bootstrappers) - { - $this->hasBeenBootstrapped = true; - - foreach ($bootstrappers as $bootstrapper) { - $this['events']->dispatch('bootstrapping: '.$bootstrapper, [$this]); - - $this->make($bootstrapper)->bootstrap($this); - - $this['events']->dispatch('bootstrapped: '.$bootstrapper, [$this]); - } - } - - /** - * Register a callback to run after loading the environment. - * - * @param \Closure $callback - * @return void - */ - public function afterLoadingEnvironment(Closure $callback) - { - $this->afterBootstrapping( - LoadEnvironmentVariables::class, $callback - ); - } - - /** - * Register a callback to run before a bootstrapper. - * - * @param string $bootstrapper - * @param \Closure $callback - * @return void - */ - public function beforeBootstrapping($bootstrapper, Closure $callback) - { - $this['events']->listen('bootstrapping: '.$bootstrapper, $callback); - } - - /** - * Register a callback to run after a bootstrapper. - * - * @param string $bootstrapper - * @param \Closure $callback - * @return void - */ - public function afterBootstrapping($bootstrapper, Closure $callback) - { - $this['events']->listen('bootstrapped: '.$bootstrapper, $callback); - } - - /** - * Determine if the application has been bootstrapped before. - * - * @return bool - */ - public function hasBeenBootstrapped() - { - return $this->hasBeenBootstrapped; - } - - /** - * Set the base path for the application. - * - * @param string $basePath - * @return $this - */ - public function setBasePath($basePath) - { - $this->basePath = rtrim($basePath, '\/'); - - $this->bindPathsInContainer(); - - return $this; - } - - /** - * Bind all of the application paths in the container. - * - * @return void - */ - protected function bindPathsInContainer() - { - $this->instance('path', $this->path()); - $this->instance('path.base', $this->basePath()); - $this->instance('path.config', $this->configPath()); - $this->instance('path.public', $this->publicPath()); - $this->instance('path.storage', $this->storagePath()); - $this->instance('path.database', $this->databasePath()); - $this->instance('path.resources', $this->resourcePath()); - $this->instance('path.bootstrap', $this->bootstrapPath()); - - $this->useLangPath(value(function () { - if (is_dir($directory = $this->resourcePath('lang'))) { - return $directory; - } - - return $this->basePath('lang'); - })); - } - - /** - * Get the path to the application "app" directory. - * - * @param string $path - * @return string - */ - public function path($path = '') - { - $appPath = $this->appPath ?: $this->basePath.DIRECTORY_SEPARATOR.'app'; - - return $appPath.($path != '' ? DIRECTORY_SEPARATOR.$path : ''); - } - - /** - * Set the application directory. - * - * @param string $path - * @return $this - */ - public function useAppPath($path) - { - $this->appPath = $path; - - $this->instance('path', $path); - - return $this; - } - - /** - * Get the base path of the Laravel installation. - * - * @param string $path - * @return string - */ - public function basePath($path = '') - { - return $this->basePath.($path != '' ? DIRECTORY_SEPARATOR.$path : ''); - } - - /** - * Get the path to the bootstrap directory. - * - * @param string $path - * @return string - */ - public function bootstrapPath($path = '') - { - return $this->basePath.DIRECTORY_SEPARATOR.'bootstrap'.($path != '' ? DIRECTORY_SEPARATOR.$path : ''); - } - - /** - * Get the path to the application configuration files. - * - * @param string $path - * @return string - */ - public function configPath($path = '') - { - return $this->basePath.DIRECTORY_SEPARATOR.'config'.($path != '' ? DIRECTORY_SEPARATOR.$path : ''); - } - - /** - * Get the path to the database directory. - * - * @param string $path - * @return string - */ - public function databasePath($path = '') - { - return ($this->databasePath ?: $this->basePath.DIRECTORY_SEPARATOR.'database').($path != '' ? DIRECTORY_SEPARATOR.$path : ''); - } - - /** - * Set the database directory. - * - * @param string $path - * @return $this - */ - public function useDatabasePath($path) - { - $this->databasePath = $path; - - $this->instance('path.database', $path); - - return $this; - } - - /** - * Get the path to the language files. - * - * @param string $path - * @return string - */ - public function langPath($path = '') - { - return $this->langPath.($path != '' ? DIRECTORY_SEPARATOR.$path : ''); - } - - /** - * Set the language file directory. - * - * @param string $path - * @return $this - */ - public function useLangPath($path) - { - $this->langPath = $path; - - $this->instance('path.lang', $path); - - return $this; - } - - /** - * Get the path to the public / web directory. - * - * @return string - */ - public function publicPath() - { - return $this->basePath.DIRECTORY_SEPARATOR.'public'; - } - - /** - * Get the path to the storage directory. - * - * @param string $path - * @return string - */ - public function storagePath($path = '') - { - return ($this->storagePath ?: $this->basePath.DIRECTORY_SEPARATOR.'storage') - .($path != '' ? DIRECTORY_SEPARATOR.$path : ''); - } - - /** - * Set the storage directory. - * - * @param string $path - * @return $this - */ - public function useStoragePath($path) - { - $this->storagePath = $path; - - $this->instance('path.storage', $path); - - return $this; - } - - /** - * Get the path to the resources directory. - * - * @param string $path - * @return string - */ - public function resourcePath($path = '') - { - return $this->basePath.DIRECTORY_SEPARATOR.'resources'.($path != '' ? DIRECTORY_SEPARATOR.$path : ''); - } - - /** - * Get the path to the views directory. - * - * This method returns the first configured path in the array of view paths. - * - * @param string $path - * @return string - */ - public function viewPath($path = '') - { - $basePath = $this['config']->get('view.paths')[0]; - - return rtrim($basePath, DIRECTORY_SEPARATOR).($path != '' ? DIRECTORY_SEPARATOR.$path : ''); - } - - /** - * Get the path to the environment file directory. - * - * @return string - */ - public function environmentPath() - { - return $this->environmentPath ?: $this->basePath; - } - - /** - * Set the directory for the environment file. - * - * @param string $path - * @return $this - */ - public function useEnvironmentPath($path) - { - $this->environmentPath = $path; - - return $this; - } - - /** - * Set the environment file to be loaded during bootstrapping. - * - * @param string $file - * @return $this - */ - public function loadEnvironmentFrom($file) - { - $this->environmentFile = $file; - - return $this; - } - - /** - * Get the environment file the application is using. - * - * @return string - */ - public function environmentFile() - { - return $this->environmentFile ?: '.env'; - } - - /** - * Get the fully qualified path to the environment file. - * - * @return string - */ - public function environmentFilePath() - { - return $this->environmentPath().DIRECTORY_SEPARATOR.$this->environmentFile(); - } - - /** - * Get or check the current application environment. - * - * @param string|array $environments - * @return string|bool - */ - public function environment(...$environments) - { - if (count($environments) > 0) { - $patterns = is_array($environments[0]) ? $environments[0] : $environments; - - return Str::is($patterns, $this['env']); - } - - return $this['env']; - } - - /** - * Determine if the application is in the local environment. - * - * @return bool - */ - public function isLocal() - { - return $this['env'] === 'local'; - } - - /** - * Determine if the application is in the production environment. - * - * @return bool - */ - public function isProduction() - { - return $this['env'] === 'production'; - } - - /** - * Detect the application's current environment. - * - * @param \Closure $callback - * @return string - */ - public function detectEnvironment(Closure $callback) - { - $args = $_SERVER['argv'] ?? null; - - return $this['env'] = (new EnvironmentDetector)->detect($callback, $args); - } - - /** - * Determine if the application is running in the console. - * - * @return bool - */ - public function runningInConsole() - { - if ($this->isRunningInConsole === null) { - $this->isRunningInConsole = Env::get('APP_RUNNING_IN_CONSOLE') ?? (\PHP_SAPI === 'cli' || \PHP_SAPI === 'phpdbg'); - } - - return $this->isRunningInConsole; - } - - /** - * Determine if the application is running unit tests. - * - * @return bool - */ - public function runningUnitTests() - { - return $this->bound('env') && $this['env'] === 'testing'; - } - - /** - * Determine if the application is running with debug mode enabled. - * - * @return bool - */ - public function hasDebugModeEnabled() - { - return (bool) $this['config']->get('app.debug'); - } - - /** - * Register all of the configured providers. - * - * @return void - */ - public function registerConfiguredProviders() - { - $providers = Collection::make($this->make('config')->get('app.providers')) - ->partition(function ($provider) { - return str_starts_with($provider, 'Illuminate\\'); - }); - - $providers->splice(1, 0, [$this->make(PackageManifest::class)->providers()]); - - (new ProviderRepository($this, new Filesystem, $this->getCachedServicesPath())) - ->load($providers->collapse()->toArray()); - } - - /** - * Register a service provider with the application. - * - * @param \Illuminate\Support\ServiceProvider|string $provider - * @param bool $force - * @return \Illuminate\Support\ServiceProvider - */ - public function register($provider, $force = false) - { - if (($registered = $this->getProvider($provider)) && ! $force) { - return $registered; - } - - // If the given "provider" is a string, we will resolve it, passing in the - // application instance automatically for the developer. This is simply - // a more convenient way of specifying your service provider classes. - if (is_string($provider)) { - $provider = $this->resolveProvider($provider); - } - - $provider->register(); - - // If there are bindings / singletons set as properties on the provider we - // will spin through them and register them with the application, which - // serves as a convenience layer while registering a lot of bindings. - if (property_exists($provider, 'bindings')) { - foreach ($provider->bindings as $key => $value) { - $this->bind($key, $value); - } - } - - if (property_exists($provider, 'singletons')) { - foreach ($provider->singletons as $key => $value) { - $key = is_int($key) ? $value : $key; - - $this->singleton($key, $value); - } - } - - $this->markAsRegistered($provider); - - // If the application has already booted, we will call this boot method on - // the provider class so it has an opportunity to do its boot logic and - // will be ready for any usage by this developer's application logic. - if ($this->isBooted()) { - $this->bootProvider($provider); - } - - return $provider; - } - - /** - * Get the registered service provider instance if it exists. - * - * @param \Illuminate\Support\ServiceProvider|string $provider - * @return \Illuminate\Support\ServiceProvider|null - */ - public function getProvider($provider) - { - return array_values($this->getProviders($provider))[0] ?? null; - } - - /** - * Get the registered service provider instances if any exist. - * - * @param \Illuminate\Support\ServiceProvider|string $provider - * @return array - */ - public function getProviders($provider) - { - $name = is_string($provider) ? $provider : get_class($provider); - - return Arr::where($this->serviceProviders, function ($value) use ($name) { - return $value instanceof $name; - }); - } - - /** - * Resolve a service provider instance from the class name. - * - * @param string $provider - * @return \Illuminate\Support\ServiceProvider - */ - public function resolveProvider($provider) - { - return new $provider($this); - } - - /** - * Mark the given provider as registered. - * - * @param \Illuminate\Support\ServiceProvider $provider - * @return void - */ - protected function markAsRegistered($provider) - { - $this->serviceProviders[] = $provider; - - $this->loadedProviders[get_class($provider)] = true; - } - - /** - * Load and boot all of the remaining deferred providers. - * - * @return void - */ - public function loadDeferredProviders() - { - // We will simply spin through each of the deferred providers and register each - // one and boot them if the application has booted. This should make each of - // the remaining services available to this application for immediate use. - foreach ($this->deferredServices as $service => $provider) { - $this->loadDeferredProvider($service); - } - - $this->deferredServices = []; - } - - /** - * Load the provider for a deferred service. - * - * @param string $service - * @return void - */ - public function loadDeferredProvider($service) - { - if (! $this->isDeferredService($service)) { - return; - } - - $provider = $this->deferredServices[$service]; - - // If the service provider has not already been loaded and registered we can - // register it with the application and remove the service from this list - // of deferred services, since it will already be loaded on subsequent. - if (! isset($this->loadedProviders[$provider])) { - $this->registerDeferredProvider($provider, $service); - } - } - - /** - * Register a deferred provider and service. - * - * @param string $provider - * @param string|null $service - * @return void - */ - public function registerDeferredProvider($provider, $service = null) - { - // Once the provider that provides the deferred service has been registered we - // will remove it from our local list of the deferred services with related - // providers so that this container does not try to resolve it out again. - if ($service) { - unset($this->deferredServices[$service]); - } - - $this->register($instance = new $provider($this)); - - if (! $this->isBooted()) { - $this->booting(function () use ($instance) { - $this->bootProvider($instance); - }); - } - } - - /** - * Resolve the given type from the container. - * - * @param string $abstract - * @param array $parameters - * @return mixed - */ - public function make($abstract, array $parameters = []) - { - $this->loadDeferredProviderIfNeeded($abstract = $this->getAlias($abstract)); - - return parent::make($abstract, $parameters); - } - - /** - * Resolve the given type from the container. - * - * @param string $abstract - * @param array $parameters - * @param bool $raiseEvents - * @return mixed - */ - protected function resolve($abstract, $parameters = [], $raiseEvents = true) - { - $this->loadDeferredProviderIfNeeded($abstract = $this->getAlias($abstract)); - - return parent::resolve($abstract, $parameters, $raiseEvents); - } - - /** - * Load the deferred provider if the given type is a deferred service and the instance has not been loaded. - * - * @param string $abstract - * @return void - */ - protected function loadDeferredProviderIfNeeded($abstract) - { - if ($this->isDeferredService($abstract) && ! isset($this->instances[$abstract])) { - $this->loadDeferredProvider($abstract); - } - } - - /** - * Determine if the given abstract type has been bound. - * - * @param string $abstract - * @return bool - */ - public function bound($abstract) - { - return $this->isDeferredService($abstract) || parent::bound($abstract); - } - - /** - * Determine if the application has booted. - * - * @return bool - */ - public function isBooted() - { - return $this->booted; - } - - /** - * Boot the application's service providers. - * - * @return void - */ - public function boot() - { - if ($this->isBooted()) { - return; - } - - // Once the application has booted we will also fire some "booted" callbacks - // for any listeners that need to do work after this initial booting gets - // finished. This is useful when ordering the boot-up processes we run. - $this->fireAppCallbacks($this->bootingCallbacks); - - array_walk($this->serviceProviders, function ($p) { - $this->bootProvider($p); - }); - - $this->booted = true; - - $this->fireAppCallbacks($this->bootedCallbacks); - } - - /** - * Boot the given service provider. - * - * @param \Illuminate\Support\ServiceProvider $provider - * @return void - */ - protected function bootProvider(ServiceProvider $provider) - { - $provider->callBootingCallbacks(); - - if (method_exists($provider, 'boot')) { - $this->call([$provider, 'boot']); - } - - $provider->callBootedCallbacks(); - } - - /** - * Register a new boot listener. - * - * @param callable $callback - * @return void - */ - public function booting($callback) - { - $this->bootingCallbacks[] = $callback; - } - - /** - * Register a new "booted" listener. - * - * @param callable $callback - * @return void - */ - public function booted($callback) - { - $this->bootedCallbacks[] = $callback; - - if ($this->isBooted()) { - $callback($this); - } - } - - /** - * Call the booting callbacks for the application. - * - * @param callable[] $callbacks - * @return void - */ - protected function fireAppCallbacks(array &$callbacks) - { - $index = 0; - - while ($index < count($callbacks)) { - $callbacks[$index]($this); - - $index++; - } - } - - /** - * {@inheritdoc} - * - * @return \Symfony\Component\HttpFoundation\Response - */ - public function handle(SymfonyRequest $request, int $type = self::MAIN_REQUEST, bool $catch = true): SymfonyResponse - { - return $this[HttpKernelContract::class]->handle(Request::createFromBase($request)); - } - - /** - * Determine if middleware has been disabled for the application. - * - * @return bool - */ - public function shouldSkipMiddleware() - { - return $this->bound('middleware.disable') && - $this->make('middleware.disable') === true; - } - - /** - * Get the path to the cached services.php file. - * - * @return string - */ - public function getCachedServicesPath() - { - return $this->normalizeCachePath('APP_SERVICES_CACHE', 'cache/services.php'); - } - - /** - * Get the path to the cached packages.php file. - * - * @return string - */ - public function getCachedPackagesPath() - { - return $this->normalizeCachePath('APP_PACKAGES_CACHE', 'cache/packages.php'); - } - - /** - * Determine if the application configuration is cached. - * - * @return bool - */ - public function configurationIsCached() - { - return is_file($this->getCachedConfigPath()); - } - - /** - * Get the path to the configuration cache file. - * - * @return string - */ - public function getCachedConfigPath() - { - return $this->normalizeCachePath('APP_CONFIG_CACHE', 'cache/config.php'); - } - - /** - * Determine if the application routes are cached. - * - * @return bool - */ - public function routesAreCached() - { - return $this['files']->exists($this->getCachedRoutesPath()); - } - - /** - * Get the path to the routes cache file. - * - * @return string - */ - public function getCachedRoutesPath() - { - return $this->normalizeCachePath('APP_ROUTES_CACHE', 'cache/routes-v7.php'); - } - - /** - * Determine if the application events are cached. - * - * @return bool - */ - public function eventsAreCached() - { - return $this['files']->exists($this->getCachedEventsPath()); - } - - /** - * Get the path to the events cache file. - * - * @return string - */ - public function getCachedEventsPath() - { - return $this->normalizeCachePath('APP_EVENTS_CACHE', 'cache/events.php'); - } - - /** - * Normalize a relative or absolute path to a cache file. - * - * @param string $key - * @param string $default - * @return string - */ - protected function normalizeCachePath($key, $default) - { - if (is_null($env = Env::get($key))) { - return $this->bootstrapPath($default); - } - - return Str::startsWith($env, $this->absoluteCachePathPrefixes) - ? $env - : $this->basePath($env); - } - - /** - * Add new prefix to list of absolute path prefixes. - * - * @param string $prefix - * @return $this - */ - public function addAbsoluteCachePathPrefix($prefix) - { - $this->absoluteCachePathPrefixes[] = $prefix; - - return $this; - } - - /** - * Get an instance of the maintenance mode manager implementation. - * - * @return \Illuminate\Contracts\Foundation\MaintenanceMode - */ - public function maintenanceMode() - { - return $this->make(MaintenanceModeContract::class); - } - - /** - * Determine if the application is currently down for maintenance. - * - * @return bool - */ - public function isDownForMaintenance() - { - return $this->maintenanceMode()->active(); - } - - /** - * Throw an HttpException with the given data. - * - * @param int $code - * @param string $message - * @param array $headers - * @return never - * - * @throws \Symfony\Component\HttpKernel\Exception\HttpException - * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException - */ - public function abort($code, $message = '', array $headers = []) - { - if ($code == 404) { - throw new NotFoundHttpException($message); - } - - throw new HttpException($code, $message, null, $headers); - } - - /** - * Register a terminating callback with the application. - * - * @param callable|string $callback - * @return $this - */ - public function terminating($callback) - { - $this->terminatingCallbacks[] = $callback; - - return $this; - } - - /** - * Terminate the application. - * - * @return void - */ - public function terminate() - { - $index = 0; - - while ($index < count($this->terminatingCallbacks)) { - $this->call($this->terminatingCallbacks[$index]); - - $index++; - } - } - - /** - * Get the service providers that have been loaded. - * - * @return array - */ - public function getLoadedProviders() - { - return $this->loadedProviders; - } - - /** - * Determine if the given service provider is loaded. - * - * @param string $provider - * @return bool - */ - public function providerIsLoaded(string $provider) - { - return isset($this->loadedProviders[$provider]); - } - - /** - * Get the application's deferred services. - * - * @return array - */ - public function getDeferredServices() - { - return $this->deferredServices; - } - - /** - * Set the application's deferred services. - * - * @param array $services - * @return void - */ - public function setDeferredServices(array $services) - { - $this->deferredServices = $services; - } - - /** - * Add an array of services to the application's deferred services. - * - * @param array $services - * @return void - */ - public function addDeferredServices(array $services) - { - $this->deferredServices = array_merge($this->deferredServices, $services); - } - - /** - * Determine if the given service is a deferred service. - * - * @param string $service - * @return bool - */ - public function isDeferredService($service) - { - return isset($this->deferredServices[$service]); - } - - /** - * Configure the real-time facade namespace. - * - * @param string $namespace - * @return void - */ - public function provideFacades($namespace) - { - AliasLoader::setFacadeNamespace($namespace); - } - - /** - * Get the current application locale. - * - * @return string - */ - public function getLocale() - { - return $this['config']->get('app.locale'); - } - - /** - * Get the current application locale. - * - * @return string - */ - public function currentLocale() - { - return $this->getLocale(); - } - - /** - * Get the current application fallback locale. - * - * @return string - */ - public function getFallbackLocale() - { - return $this['config']->get('app.fallback_locale'); - } - - /** - * Set the current application locale. - * - * @param string $locale - * @return void - */ - public function setLocale($locale) - { - $this['config']->set('app.locale', $locale); - - $this['translator']->setLocale($locale); - - $this['events']->dispatch(new LocaleUpdated($locale)); - } - - /** - * Set the current application fallback locale. - * - * @param string $fallbackLocale - * @return void - */ - public function setFallbackLocale($fallbackLocale) - { - $this['config']->set('app.fallback_locale', $fallbackLocale); - - $this['translator']->setFallback($fallbackLocale); - } - - /** - * Determine if the application locale is the given locale. - * - * @param string $locale - * @return bool - */ - public function isLocale($locale) - { - return $this->getLocale() == $locale; - } - - /** - * Register the core class aliases in the container. - * - * @return void - */ - public function registerCoreContainerAliases() - { - foreach ([ - 'app' => [self::class, \Illuminate\Contracts\Container\Container::class, \Illuminate\Contracts\Foundation\Application::class, \Psr\Container\ContainerInterface::class], - 'auth' => [\Illuminate\Auth\AuthManager::class, \Illuminate\Contracts\Auth\Factory::class], - 'auth.driver' => [\Illuminate\Contracts\Auth\Guard::class], - 'blade.compiler' => [\Illuminate\View\Compilers\BladeCompiler::class], - 'cache' => [\Illuminate\Cache\CacheManager::class, \Illuminate\Contracts\Cache\Factory::class], - 'cache.store' => [\Illuminate\Cache\Repository::class, \Illuminate\Contracts\Cache\Repository::class, \Psr\SimpleCache\CacheInterface::class], - 'cache.psr6' => [\Symfony\Component\Cache\Adapter\Psr16Adapter::class, \Symfony\Component\Cache\Adapter\AdapterInterface::class, \Psr\Cache\CacheItemPoolInterface::class], - 'config' => [\Illuminate\Config\Repository::class, \Illuminate\Contracts\Config\Repository::class], - 'cookie' => [\Illuminate\Cookie\CookieJar::class, \Illuminate\Contracts\Cookie\Factory::class, \Illuminate\Contracts\Cookie\QueueingFactory::class], - 'db' => [\Illuminate\Database\DatabaseManager::class, \Illuminate\Database\ConnectionResolverInterface::class], - 'db.connection' => [\Illuminate\Database\Connection::class, \Illuminate\Database\ConnectionInterface::class], - 'db.schema' => [\Illuminate\Database\Schema\Builder::class], - 'encrypter' => [\Illuminate\Encryption\Encrypter::class, \Illuminate\Contracts\Encryption\Encrypter::class, \Illuminate\Contracts\Encryption\StringEncrypter::class], - 'events' => [\Illuminate\Events\Dispatcher::class, \Illuminate\Contracts\Events\Dispatcher::class], - 'files' => [\Illuminate\Filesystem\Filesystem::class], - 'filesystem' => [\Illuminate\Filesystem\FilesystemManager::class, \Illuminate\Contracts\Filesystem\Factory::class], - 'filesystem.disk' => [\Illuminate\Contracts\Filesystem\Filesystem::class], - 'filesystem.cloud' => [\Illuminate\Contracts\Filesystem\Cloud::class], - 'hash' => [\Illuminate\Hashing\HashManager::class], - 'hash.driver' => [\Illuminate\Contracts\Hashing\Hasher::class], - 'translator' => [\Illuminate\Translation\Translator::class, \Illuminate\Contracts\Translation\Translator::class], - 'log' => [\Illuminate\Log\LogManager::class, \Psr\Log\LoggerInterface::class], - 'mail.manager' => [\Illuminate\Mail\MailManager::class, \Illuminate\Contracts\Mail\Factory::class], - 'mailer' => [\Illuminate\Mail\Mailer::class, \Illuminate\Contracts\Mail\Mailer::class, \Illuminate\Contracts\Mail\MailQueue::class], - 'auth.password' => [\Illuminate\Auth\Passwords\PasswordBrokerManager::class, \Illuminate\Contracts\Auth\PasswordBrokerFactory::class], - 'auth.password.broker' => [\Illuminate\Auth\Passwords\PasswordBroker::class, \Illuminate\Contracts\Auth\PasswordBroker::class], - 'queue' => [\Illuminate\Queue\QueueManager::class, \Illuminate\Contracts\Queue\Factory::class, \Illuminate\Contracts\Queue\Monitor::class], - 'queue.connection' => [\Illuminate\Contracts\Queue\Queue::class], - 'queue.failer' => [\Illuminate\Queue\Failed\FailedJobProviderInterface::class], - 'redirect' => [\Illuminate\Routing\Redirector::class], - 'redis' => [\Illuminate\Redis\RedisManager::class, \Illuminate\Contracts\Redis\Factory::class], - 'redis.connection' => [\Illuminate\Redis\Connections\Connection::class, \Illuminate\Contracts\Redis\Connection::class], - 'request' => [\Illuminate\Http\Request::class, \Symfony\Component\HttpFoundation\Request::class], - 'router' => [\Illuminate\Routing\Router::class, \Illuminate\Contracts\Routing\Registrar::class, \Illuminate\Contracts\Routing\BindingRegistrar::class], - 'session' => [\Illuminate\Session\SessionManager::class], - 'session.store' => [\Illuminate\Session\Store::class, \Illuminate\Contracts\Session\Session::class], - 'url' => [\Illuminate\Routing\UrlGenerator::class, \Illuminate\Contracts\Routing\UrlGenerator::class], - 'validator' => [\Illuminate\Validation\Factory::class, \Illuminate\Contracts\Validation\Factory::class], - 'view' => [\Illuminate\View\Factory::class, \Illuminate\Contracts\View\Factory::class], - ] as $key => $aliases) { - foreach ($aliases as $alias) { - $this->alias($key, $alias); - } - } - } - - /** - * Flush the container of all bindings and resolved instances. - * - * @return void - */ - public function flush() - { - parent::flush(); - - $this->buildStack = []; - $this->loadedProviders = []; - $this->bootedCallbacks = []; - $this->bootingCallbacks = []; - $this->deferredServices = []; - $this->reboundCallbacks = []; - $this->serviceProviders = []; - $this->resolvingCallbacks = []; - $this->terminatingCallbacks = []; - $this->beforeResolvingCallbacks = []; - $this->afterResolvingCallbacks = []; - $this->globalBeforeResolvingCallbacks = []; - $this->globalResolvingCallbacks = []; - $this->globalAfterResolvingCallbacks = []; - } - - /** - * Get the application namespace. - * - * @return string - * - * @throws \RuntimeException - */ - public function getNamespace() - { - if (! is_null($this->namespace)) { - return $this->namespace; - } - - $composer = json_decode(file_get_contents($this->basePath('composer.json')), true); - - foreach ((array) data_get($composer, 'autoload.psr-4') as $namespace => $path) { - foreach ((array) $path as $pathChoice) { - if (realpath($this->path()) === realpath($this->basePath($pathChoice))) { - return $this->namespace = $namespace; - } - } - } - - throw new RuntimeException('Unable to detect application namespace.'); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Auth/Access/Authorizable.php b/vendor/laravel/framework/src/Illuminate/Foundation/Auth/Access/Authorizable.php deleted file mode 100644 index d8cf50db..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Auth/Access/Authorizable.php +++ /dev/null @@ -1,56 +0,0 @@ -forUser($this)->check($abilities, $arguments); - } - - /** - * Determine if the entity has any of the given abilities. - * - * @param iterable|string $abilities - * @param array|mixed $arguments - * @return bool - */ - public function canAny($abilities, $arguments = []) - { - return app(Gate::class)->forUser($this)->any($abilities, $arguments); - } - - /** - * Determine if the entity does not have the given abilities. - * - * @param iterable|string $abilities - * @param array|mixed $arguments - * @return bool - */ - public function cant($abilities, $arguments = []) - { - return ! $this->can($abilities, $arguments); - } - - /** - * Determine if the entity does not have the given abilities. - * - * @param iterable|string $abilities - * @param array|mixed $arguments - * @return bool - */ - public function cannot($abilities, $arguments = []) - { - return $this->cant($abilities, $arguments); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Auth/Access/AuthorizesRequests.php b/vendor/laravel/framework/src/Illuminate/Foundation/Auth/Access/AuthorizesRequests.php deleted file mode 100644 index 19dc1641..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Auth/Access/AuthorizesRequests.php +++ /dev/null @@ -1,131 +0,0 @@ -parseAbilityAndArguments($ability, $arguments); - - return app(Gate::class)->authorize($ability, $arguments); - } - - /** - * Authorize a given action for a user. - * - * @param \Illuminate\Contracts\Auth\Authenticatable|mixed $user - * @param mixed $ability - * @param mixed|array $arguments - * @return \Illuminate\Auth\Access\Response - * - * @throws \Illuminate\Auth\Access\AuthorizationException - */ - public function authorizeForUser($user, $ability, $arguments = []) - { - [$ability, $arguments] = $this->parseAbilityAndArguments($ability, $arguments); - - return app(Gate::class)->forUser($user)->authorize($ability, $arguments); - } - - /** - * Guesses the ability's name if it wasn't provided. - * - * @param mixed $ability - * @param mixed|array $arguments - * @return array - */ - protected function parseAbilityAndArguments($ability, $arguments) - { - if (is_string($ability) && ! str_contains($ability, '\\')) { - return [$ability, $arguments]; - } - - $method = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3)[2]['function']; - - return [$this->normalizeGuessedAbilityName($method), $ability]; - } - - /** - * Normalize the ability name that has been guessed from the method name. - * - * @param string $ability - * @return string - */ - protected function normalizeGuessedAbilityName($ability) - { - $map = $this->resourceAbilityMap(); - - return $map[$ability] ?? $ability; - } - - /** - * Authorize a resource action based on the incoming request. - * - * @param string|array $model - * @param string|array|null $parameter - * @param array $options - * @param \Illuminate\Http\Request|null $request - * @return void - */ - public function authorizeResource($model, $parameter = null, array $options = [], $request = null) - { - $model = is_array($model) ? implode(',', $model) : $model; - - $parameter = is_array($parameter) ? implode(',', $parameter) : $parameter; - - $parameter = $parameter ?: Str::snake(class_basename($model)); - - $middleware = []; - - foreach ($this->resourceAbilityMap() as $method => $ability) { - $modelName = in_array($method, $this->resourceMethodsWithoutModels()) ? $model : $parameter; - - $middleware["can:{$ability},{$modelName}"][] = $method; - } - - foreach ($middleware as $middlewareName => $methods) { - $this->middleware($middlewareName, $options)->only($methods); - } - } - - /** - * Get the map of resource methods to ability names. - * - * @return array - */ - protected function resourceAbilityMap() - { - return [ - 'index' => 'viewAny', - 'show' => 'view', - 'create' => 'create', - 'store' => 'create', - 'edit' => 'update', - 'update' => 'update', - 'destroy' => 'delete', - ]; - } - - /** - * Get the list of resource methods which do not have model parameters. - * - * @return array - */ - protected function resourceMethodsWithoutModels() - { - return ['index', 'create', 'store']; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Auth/EmailVerificationRequest.php b/vendor/laravel/framework/src/Illuminate/Foundation/Auth/EmailVerificationRequest.php deleted file mode 100644 index 9cbe9b51..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Auth/EmailVerificationRequest.php +++ /dev/null @@ -1,64 +0,0 @@ -user()->getKey(), (string) $this->route('id'))) { - return false; - } - - if (! hash_equals(sha1($this->user()->getEmailForVerification()), (string) $this->route('hash'))) { - return false; - } - - return true; - } - - /** - * Get the validation rules that apply to the request. - * - * @return array - */ - public function rules() - { - return [ - // - ]; - } - - /** - * Fulfill the email verification request. - * - * @return void - */ - public function fulfill() - { - if (! $this->user()->hasVerifiedEmail()) { - $this->user()->markEmailAsVerified(); - - event(new Verified($this->user())); - } - } - - /** - * Configure the validator instance. - * - * @param \Illuminate\Validation\Validator $validator - * @return void - */ - public function withValidator($validator) - { - return $validator; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Auth/User.php b/vendor/laravel/framework/src/Illuminate/Foundation/Auth/User.php deleted file mode 100644 index be1dff54..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Auth/User.php +++ /dev/null @@ -1,20 +0,0 @@ -boot(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php b/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php deleted file mode 100644 index a67649b9..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php +++ /dev/null @@ -1,311 +0,0 @@ -forwardsTo('handleError')); - - set_exception_handler($this->forwardsTo('handleException')); - - register_shutdown_function($this->forwardsTo('handleShutdown')); - - if (! $app->environment('testing')) { - ini_set('display_errors', 'Off'); - } - } - - /** - * Report PHP deprecations, or convert PHP errors to ErrorException instances. - * - * @param int $level - * @param string $message - * @param string $file - * @param int $line - * @param array $context - * @return void - * - * @throws \ErrorException - */ - public function handleError($level, $message, $file = '', $line = 0, $context = []) - { - if ($this->isDeprecation($level)) { - $this->handleDeprecationError($message, $file, $line, $level); - } elseif (error_reporting() & $level) { - throw new ErrorException($message, 0, $level, $file, $line); - } - } - - /** - * Reports a deprecation to the "deprecations" logger. - * - * @param string $message - * @param string $file - * @param int $line - * @return void - * - * @deprecated Use handleDeprecationError instead. - */ - public function handleDeprecation($message, $file, $line) - { - $this->handleDeprecationError($message, $file, $line); - } - - /** - * Reports a deprecation to the "deprecations" logger. - * - * @param string $message - * @param string $file - * @param int $line - * @param int $level - * @return void - */ - public function handleDeprecationError($message, $file, $line, $level = E_DEPRECATED) - { - if ($this->shouldIgnoreDeprecationErrors()) { - return; - } - - try { - $logger = static::$app->make(LogManager::class); - } catch (Exception $e) { - return; - } - - $this->ensureDeprecationLoggerIsConfigured(); - - $options = static::$app['config']->get('logging.deprecations') ?? []; - - with($logger->channel('deprecations'), function ($log) use ($message, $file, $line, $level, $options) { - if ($options['trace'] ?? false) { - $log->warning((string) new ErrorException($message, 0, $level, $file, $line)); - } else { - $log->warning(sprintf('%s in %s on line %s', - $message, $file, $line - )); - } - }); - } - - /** - * Determine if deprecation errors should be ignored. - * - * @return bool - */ - protected function shouldIgnoreDeprecationErrors() - { - return ! class_exists(LogManager::class) - || ! static::$app->hasBeenBootstrapped() - || static::$app->runningUnitTests(); - } - - /** - * Ensure the "deprecations" logger is configured. - * - * @return void - */ - protected function ensureDeprecationLoggerIsConfigured() - { - with(static::$app['config'], function ($config) { - if ($config->get('logging.channels.deprecations')) { - return; - } - - $this->ensureNullLogDriverIsConfigured(); - - if (is_array($options = $config->get('logging.deprecations'))) { - $driver = $options['channel'] ?? 'null'; - } else { - $driver = $options ?? 'null'; - } - - $config->set('logging.channels.deprecations', $config->get("logging.channels.{$driver}")); - }); - } - - /** - * Ensure the "null" log driver is configured. - * - * @return void - */ - protected function ensureNullLogDriverIsConfigured() - { - with(static::$app['config'], function ($config) { - if ($config->get('logging.channels.null')) { - return; - } - - $config->set('logging.channels.null', [ - 'driver' => 'monolog', - 'handler' => NullHandler::class, - ]); - }); - } - - /** - * Handle an uncaught exception from the application. - * - * Note: Most exceptions can be handled via the try / catch block in - * the HTTP and Console kernels. But, fatal error exceptions must - * be handled differently since they are not normal exceptions. - * - * @param \Throwable $e - * @return void - */ - public function handleException(Throwable $e) - { - self::$reservedMemory = null; - - try { - $this->getExceptionHandler()->report($e); - } catch (Exception $e) { - // - } - - if (static::$app->runningInConsole()) { - $this->renderForConsole($e); - } else { - $this->renderHttpResponse($e); - } - } - - /** - * Render an exception to the console. - * - * @param \Throwable $e - * @return void - */ - protected function renderForConsole(Throwable $e) - { - $this->getExceptionHandler()->renderForConsole(new ConsoleOutput, $e); - } - - /** - * Render an exception as an HTTP response and send it. - * - * @param \Throwable $e - * @return void - */ - protected function renderHttpResponse(Throwable $e) - { - $this->getExceptionHandler()->render(static::$app['request'], $e)->send(); - } - - /** - * Handle the PHP shutdown event. - * - * @return void - */ - public function handleShutdown() - { - self::$reservedMemory = null; - - if (! is_null($error = error_get_last()) && $this->isFatal($error['type'])) { - $this->handleException($this->fatalErrorFromPhpError($error, 0)); - } - } - - /** - * Create a new fatal error instance from an error array. - * - * @param array $error - * @param int|null $traceOffset - * @return \Symfony\Component\ErrorHandler\Error\FatalError - */ - protected function fatalErrorFromPhpError(array $error, $traceOffset = null) - { - return new FatalError($error['message'], 0, $error, $traceOffset); - } - - /** - * Forward a method call to the given method if an application instance exists. - * - * @return callable - */ - protected function forwardsTo($method) - { - return fn (...$arguments) => static::$app - ? $this->{$method}(...$arguments) - : false; - } - - /** - * Determine if the error level is a deprecation. - * - * @param int $level - * @return bool - */ - protected function isDeprecation($level) - { - return in_array($level, [E_DEPRECATED, E_USER_DEPRECATED]); - } - - /** - * Determine if the error type is fatal. - * - * @param int $type - * @return bool - */ - protected function isFatal($type) - { - return in_array($type, [E_COMPILE_ERROR, E_CORE_ERROR, E_ERROR, E_PARSE]); - } - - /** - * Get an instance of the exception handler. - * - * @return \Illuminate\Contracts\Debug\ExceptionHandler - */ - protected function getExceptionHandler() - { - return static::$app->make(ExceptionHandler::class); - } - - /** - * Clear the local application instance from memory. - * - * @return void - */ - public static function forgetApp() - { - static::$app = null; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php b/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php deleted file mode 100644 index ae3f7388..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php +++ /dev/null @@ -1,114 +0,0 @@ -getCachedConfigPath())) { - $items = require $cached; - - $loadedFromCache = true; - } - - // Next we will spin through all of the configuration files in the configuration - // directory and load each one into the repository. This will make all of the - // options available to the developer for use in various parts of this app. - $app->instance('config', $config = new Repository($items)); - - if (! isset($loadedFromCache)) { - $this->loadConfigurationFiles($app, $config); - } - - // Finally, we will set the application's environment based on the configuration - // values that were loaded. We will pass a callback which will be used to get - // the environment in a web context where an "--env" switch is not present. - $app->detectEnvironment(fn () => $config->get('app.env', 'production')); - - date_default_timezone_set($config->get('app.timezone', 'UTC')); - - mb_internal_encoding('UTF-8'); - } - - /** - * Load the configuration items from all of the files. - * - * @param \Illuminate\Contracts\Foundation\Application $app - * @param \Illuminate\Contracts\Config\Repository $repository - * @return void - * - * @throws \Exception - */ - protected function loadConfigurationFiles(Application $app, RepositoryContract $repository) - { - $files = $this->getConfigurationFiles($app); - - if (! isset($files['app'])) { - throw new Exception('Unable to load the "app" configuration file.'); - } - - foreach ($files as $key => $path) { - $repository->set($key, require $path); - } - } - - /** - * Get all of the configuration files for the application. - * - * @param \Illuminate\Contracts\Foundation\Application $app - * @return array - */ - protected function getConfigurationFiles(Application $app) - { - $files = []; - - $configPath = realpath($app->configPath()); - - foreach (Finder::create()->files()->name('*.php')->in($configPath) as $file) { - $directory = $this->getNestedDirectory($file, $configPath); - - $files[$directory.basename($file->getRealPath(), '.php')] = $file->getRealPath(); - } - - ksort($files, SORT_NATURAL); - - return $files; - } - - /** - * Get the configuration file nesting path. - * - * @param \SplFileInfo $file - * @param string $configPath - * @return string - */ - protected function getNestedDirectory(SplFileInfo $file, $configPath) - { - $directory = $file->getPath(); - - if ($nested = trim(str_replace($configPath, '', $directory), DIRECTORY_SEPARATOR)) { - $nested = str_replace(DIRECTORY_SEPARATOR, '.', $nested).'.'; - } - - return $nested; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadEnvironmentVariables.php b/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadEnvironmentVariables.php deleted file mode 100644 index 3f0be6c0..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadEnvironmentVariables.php +++ /dev/null @@ -1,110 +0,0 @@ -configurationIsCached()) { - return; - } - - $this->checkForSpecificEnvironmentFile($app); - - try { - $this->createDotenv($app)->safeLoad(); - } catch (InvalidFileException $e) { - $this->writeErrorAndDie($e); - } - } - - /** - * Detect if a custom environment file matching the APP_ENV exists. - * - * @param \Illuminate\Contracts\Foundation\Application $app - * @return void - */ - protected function checkForSpecificEnvironmentFile($app) - { - if ($app->runningInConsole() && - ($input = new ArgvInput)->hasParameterOption('--env') && - $this->setEnvironmentFilePath($app, $app->environmentFile().'.'.$input->getParameterOption('--env'))) { - return; - } - - $environment = Env::get('APP_ENV'); - - if (! $environment) { - return; - } - - $this->setEnvironmentFilePath( - $app, $app->environmentFile().'.'.$environment - ); - } - - /** - * Load a custom environment file. - * - * @param \Illuminate\Contracts\Foundation\Application $app - * @param string $file - * @return bool - */ - protected function setEnvironmentFilePath($app, $file) - { - if (is_file($app->environmentPath().'/'.$file)) { - $app->loadEnvironmentFrom($file); - - return true; - } - - return false; - } - - /** - * Create a Dotenv instance. - * - * @param \Illuminate\Contracts\Foundation\Application $app - * @return \Dotenv\Dotenv - */ - protected function createDotenv($app) - { - return Dotenv::create( - Env::getRepository(), - $app->environmentPath(), - $app->environmentFile() - ); - } - - /** - * Write the error information to the screen and exit. - * - * @param \Dotenv\Exception\InvalidFileException $e - * @return void - */ - protected function writeErrorAndDie(InvalidFileException $e) - { - $output = (new ConsoleOutput)->getErrorOutput(); - - $output->writeln('The environment file is invalid!'); - $output->writeln($e->getMessage()); - - http_response_code(500); - - exit(1); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterFacades.php b/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterFacades.php deleted file mode 100644 index 2a4c6b4a..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterFacades.php +++ /dev/null @@ -1,29 +0,0 @@ -make('config')->get('app.aliases', []), - $app->make(PackageManifest::class)->aliases() - ))->register(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterProviders.php b/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterProviders.php deleted file mode 100644 index f18375cf..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterProviders.php +++ /dev/null @@ -1,19 +0,0 @@ -registerConfiguredProviders(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/SetRequestForConsole.php b/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/SetRequestForConsole.php deleted file mode 100644 index 613fa857..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/SetRequestForConsole.php +++ /dev/null @@ -1,35 +0,0 @@ -make('config')->get('app.url', 'http://localhost'); - - $components = parse_url($uri); - - $server = $_SERVER; - - if (isset($components['path'])) { - $server = array_merge($server, [ - 'SCRIPT_FILENAME' => $components['path'], - 'SCRIPT_NAME' => $components['path'], - ]); - } - - $app->instance('request', Request::create( - $uri, 'GET', [], [], [], $server - )); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Bus/Dispatchable.php b/vendor/laravel/framework/src/Illuminate/Foundation/Bus/Dispatchable.php deleted file mode 100644 index 295c5fd4..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Bus/Dispatchable.php +++ /dev/null @@ -1,109 +0,0 @@ -dispatchSync(new static(...$arguments)); - } - - /** - * Dispatch a command to its appropriate handler in the current process. - * - * @return mixed - * - * @deprecated Will be removed in a future Laravel version. - */ - public static function dispatchNow(...$arguments) - { - return app(Dispatcher::class)->dispatchNow(new static(...$arguments)); - } - - /** - * Dispatch a command to its appropriate handler after the current process. - * - * @return mixed - */ - public static function dispatchAfterResponse(...$arguments) - { - return app(Dispatcher::class)->dispatchAfterResponse(new static(...$arguments)); - } - - /** - * Set the jobs that should run if this job is successful. - * - * @param array $chain - * @return \Illuminate\Foundation\Bus\PendingChain - */ - public static function withChain($chain) - { - return new PendingChain(static::class, $chain); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Bus/DispatchesJobs.php b/vendor/laravel/framework/src/Illuminate/Foundation/Bus/DispatchesJobs.php deleted file mode 100644 index d5211585..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Bus/DispatchesJobs.php +++ /dev/null @@ -1,45 +0,0 @@ -dispatch($job); - } - - /** - * Dispatch a job to its appropriate handler in the current process. - * - * @param mixed $job - * @return mixed - * - * @deprecated Will be removed in a future Laravel version. - */ - public function dispatchNow($job) - { - return app(Dispatcher::class)->dispatchNow($job); - } - - /** - * Dispatch a job to its appropriate handler in the current process. - * - * Queueable jobs will be dispatched to the "sync" queue. - * - * @param mixed $job - * @return mixed - */ - public function dispatchSync($job) - { - return app(Dispatcher::class)->dispatchSync($job); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Bus/PendingChain.php b/vendor/laravel/framework/src/Illuminate/Foundation/Bus/PendingChain.php deleted file mode 100644 index b56b773e..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Bus/PendingChain.php +++ /dev/null @@ -1,165 +0,0 @@ -job = $job; - $this->chain = $chain; - } - - /** - * Set the desired connection for the job. - * - * @param string|null $connection - * @return $this - */ - public function onConnection($connection) - { - $this->connection = $connection; - - return $this; - } - - /** - * Set the desired queue for the job. - * - * @param string|null $queue - * @return $this - */ - public function onQueue($queue) - { - $this->queue = $queue; - - return $this; - } - - /** - * Set the desired delay in seconds for the chain. - * - * @param \DateTimeInterface|\DateInterval|int|null $delay - * @return $this - */ - public function delay($delay) - { - $this->delay = $delay; - - return $this; - } - - /** - * Add a callback to be executed on job failure. - * - * @param callable $callback - * @return $this - */ - public function catch($callback) - { - $this->catchCallbacks[] = $callback instanceof Closure - ? new SerializableClosure($callback) - : $callback; - - return $this; - } - - /** - * Get the "catch" callbacks that have been registered. - * - * @return array - */ - public function catchCallbacks() - { - return $this->catchCallbacks ?? []; - } - - /** - * Dispatch the job with the given arguments. - * - * @return \Illuminate\Foundation\Bus\PendingDispatch - */ - public function dispatch() - { - if (is_string($this->job)) { - $firstJob = new $this->job(...func_get_args()); - } elseif ($this->job instanceof Closure) { - $firstJob = CallQueuedClosure::create($this->job); - } else { - $firstJob = $this->job; - } - - if ($this->connection) { - $firstJob->chainConnection = $this->connection; - $firstJob->connection = $firstJob->connection ?: $this->connection; - } - - if ($this->queue) { - $firstJob->chainQueue = $this->queue; - $firstJob->queue = $firstJob->queue ?: $this->queue; - } - - if ($this->delay) { - $firstJob->delay = ! is_null($firstJob->delay) ? $firstJob->delay : $this->delay; - } - - $firstJob->chain($this->chain); - $firstJob->chainCatchCallbacks = $this->catchCallbacks(); - - return app(Dispatcher::class)->dispatch($firstJob); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Bus/PendingClosureDispatch.php b/vendor/laravel/framework/src/Illuminate/Foundation/Bus/PendingClosureDispatch.php deleted file mode 100644 index 84cc14a7..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Bus/PendingClosureDispatch.php +++ /dev/null @@ -1,21 +0,0 @@ -job->onFailure($callback); - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Bus/PendingDispatch.php b/vendor/laravel/framework/src/Illuminate/Foundation/Bus/PendingDispatch.php deleted file mode 100644 index 1e514e5b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Bus/PendingDispatch.php +++ /dev/null @@ -1,196 +0,0 @@ -job = $job; - } - - /** - * Set the desired connection for the job. - * - * @param string|null $connection - * @return $this - */ - public function onConnection($connection) - { - $this->job->onConnection($connection); - - return $this; - } - - /** - * Set the desired queue for the job. - * - * @param string|null $queue - * @return $this - */ - public function onQueue($queue) - { - $this->job->onQueue($queue); - - return $this; - } - - /** - * Set the desired connection for the chain. - * - * @param string|null $connection - * @return $this - */ - public function allOnConnection($connection) - { - $this->job->allOnConnection($connection); - - return $this; - } - - /** - * Set the desired queue for the chain. - * - * @param string|null $queue - * @return $this - */ - public function allOnQueue($queue) - { - $this->job->allOnQueue($queue); - - return $this; - } - - /** - * Set the desired delay in seconds for the job. - * - * @param \DateTimeInterface|\DateInterval|int|null $delay - * @return $this - */ - public function delay($delay) - { - $this->job->delay($delay); - - return $this; - } - - /** - * Indicate that the job should be dispatched after all database transactions have committed. - * - * @return $this - */ - public function afterCommit() - { - $this->job->afterCommit(); - - return $this; - } - - /** - * Indicate that the job should not wait until database transactions have been committed before dispatching. - * - * @return $this - */ - public function beforeCommit() - { - $this->job->beforeCommit(); - - return $this; - } - - /** - * Set the jobs that should run if this job is successful. - * - * @param array $chain - * @return $this - */ - public function chain($chain) - { - $this->job->chain($chain); - - return $this; - } - - /** - * Indicate that the job should be dispatched after the response is sent to the browser. - * - * @return $this - */ - public function afterResponse() - { - $this->afterResponse = true; - - return $this; - } - - /** - * Determine if the job should be dispatched. - * - * @return bool - */ - protected function shouldDispatch() - { - if (! $this->job instanceof ShouldBeUnique) { - return true; - } - - return (new UniqueLock(Container::getInstance()->make(Cache::class))) - ->acquire($this->job); - } - - /** - * Dynamically proxy methods to the underlying job. - * - * @param string $method - * @param array $parameters - * @return $this - */ - public function __call($method, $parameters) - { - $this->job->{$method}(...$parameters); - - return $this; - } - - /** - * Handle the object's destruction. - * - * @return void - */ - public function __destruct() - { - if (! $this->shouldDispatch()) { - return; - } elseif ($this->afterResponse) { - app(Dispatcher::class)->dispatchAfterResponse($this->job); - } else { - app(Dispatcher::class)->dispatch($this->job); - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/CacheBasedMaintenanceMode.php b/vendor/laravel/framework/src/Illuminate/Foundation/CacheBasedMaintenanceMode.php deleted file mode 100644 index 01ff30d4..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/CacheBasedMaintenanceMode.php +++ /dev/null @@ -1,97 +0,0 @@ -cache = $cache; - $this->store = $store; - $this->key = $key; - } - - /** - * Take the application down for maintenance. - * - * @param array $payload - * @return void - */ - public function activate(array $payload): void - { - $this->getStore()->put($this->key, $payload); - } - - /** - * Take the application out of maintenance. - * - * @return void - */ - public function deactivate(): void - { - $this->getStore()->forget($this->key); - } - - /** - * Determine if the application is currently down for maintenance. - * - * @return bool - */ - public function active(): bool - { - return $this->getStore()->has($this->key); - } - - /** - * Get the data array which was provided when the application was placed into maintenance. - * - * @return array - */ - public function data(): array - { - return $this->getStore()->get($this->key); - } - - /** - * Get the cache store to use. - * - * @return \Illuminate\Contracts\Cache\Repository - */ - protected function getStore(): Repository - { - return $this->cache->store($this->store); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/ComposerScripts.php b/vendor/laravel/framework/src/Illuminate/Foundation/ComposerScripts.php deleted file mode 100644 index 8cf56840..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/ComposerScripts.php +++ /dev/null @@ -1,69 +0,0 @@ -getComposer()->getConfig()->get('vendor-dir').'/autoload.php'; - - static::clearCompiled(); - } - - /** - * Handle the post-update Composer event. - * - * @param \Composer\Script\Event $event - * @return void - */ - public static function postUpdate(Event $event) - { - require_once $event->getComposer()->getConfig()->get('vendor-dir').'/autoload.php'; - - static::clearCompiled(); - } - - /** - * Handle the post-autoload-dump Composer event. - * - * @param \Composer\Script\Event $event - * @return void - */ - public static function postAutoloadDump(Event $event) - { - require_once $event->getComposer()->getConfig()->get('vendor-dir').'/autoload.php'; - - static::clearCompiled(); - } - - /** - * Clear the cached Laravel bootstrapping files. - * - * @return void - */ - protected static function clearCompiled() - { - $laravel = new Application(getcwd()); - - if (is_file($configPath = $laravel->getCachedConfigPath())) { - @unlink($configPath); - } - - if (is_file($servicesPath = $laravel->getCachedServicesPath())) { - @unlink($servicesPath); - } - - if (is_file($packagesPath = $laravel->getCachedPackagesPath())) { - @unlink($packagesPath); - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Concerns/ResolvesDumpSource.php b/vendor/laravel/framework/src/Illuminate/Foundation/Concerns/ResolvesDumpSource.php deleted file mode 100644 index 7e0dfffa..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Concerns/ResolvesDumpSource.php +++ /dev/null @@ -1,197 +0,0 @@ - - */ - protected $editorHrefs = [ - 'atom' => 'atom://core/open/file?filename={file}&line={line}', - 'emacs' => 'emacs://open?url=file://{file}&line={line}', - 'idea' => 'idea://open?file={file}&line={line}', - 'macvim' => 'mvim://open/?url=file://{file}&line={line}', - 'netbeans' => 'netbeans://open/?f={file}:{line}', - 'nova' => 'nova://core/open/file?filename={file}&line={line}', - 'phpstorm' => 'phpstorm://open?file={file}&line={line}', - 'sublime' => 'subl://open?url=file://{file}&line={line}', - 'textmate' => 'txmt://open?url=file://{file}&line={line}', - 'vscode' => 'vscode://file/{file}:{line}', - 'vscode-insiders' => 'vscode-insiders://file/{file}:{line}', - 'vscode-insiders-remote' => 'vscode-insiders://vscode-remote/{file}:{line}', - 'vscode-remote' => 'vscode://vscode-remote/{file}:{line}', - 'vscodium' => 'vscodium://file/{file}:{line}', - 'xdebug' => 'xdebug://{file}@{line}', - ]; - - /** - * Files that require special trace handling and their levels. - * - * @var array - */ - protected static $adjustableTraces = [ - 'symfony/var-dumper/Resources/functions/dump.php' => 1, - 'Illuminate/Collections/Traits/EnumeratesValues.php' => 4, - ]; - - /** - * The source resolver. - * - * @var (callable(): (array{0: string, 1: string, 2: int|null}|null))|null|false - */ - protected static $dumpSourceResolver; - - /** - * Resolve the source of the dump call. - * - * @return array{0: string, 1: string, 2: int|null}|null - */ - public function resolveDumpSource() - { - if (static::$dumpSourceResolver === false) { - return null; - } - - if (static::$dumpSourceResolver) { - return call_user_func(static::$dumpSourceResolver); - } - - $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 20); - - $sourceKey = null; - - foreach ($trace as $traceKey => $traceFile) { - if (! isset($traceFile['file'])) { - continue; - } - - foreach (self::$adjustableTraces as $name => $key) { - if (str_ends_with( - $traceFile['file'], - str_replace('/', DIRECTORY_SEPARATOR, $name) - )) { - $sourceKey = $traceKey + $key; - break; - } - } - - if (! is_null($sourceKey)) { - break; - } - } - - if (is_null($sourceKey)) { - return; - } - - $file = $trace[$sourceKey]['file'] ?? null; - $line = $trace[$sourceKey]['line'] ?? null; - - if (is_null($file) || is_null($line)) { - return; - } - - $relativeFile = $file; - - if ($this->isCompiledViewFile($file)) { - $file = $this->getOriginalFileForCompiledView($file); - $line = null; - } - - if (str_starts_with($file, $this->basePath)) { - $relativeFile = substr($file, strlen($this->basePath) + 1); - } - - return [$file, $relativeFile, $line]; - } - - /** - * Determine if the given file is a view compiled. - * - * @param string $file - * @return bool - */ - protected function isCompiledViewFile($file) - { - return str_starts_with($file, $this->compiledViewPath); - } - - /** - * Get the original view compiled file by the given compiled file. - * - * @param string $file - * @return string - */ - protected function getOriginalFileForCompiledView($file) - { - preg_match('/\/\*\*PATH\s(.*)\sENDPATH/', file_get_contents($file), $matches); - - if (isset($matches[1])) { - $file = $matches[1]; - } - - return $file; - } - - /** - * Resolve the source href, if possible. - * - * @param string $file - * @param int|null $line - * @return string|null - */ - protected function resolveSourceHref($file, $line) - { - try { - $editor = config('app.editor'); - } catch (Throwable $e) { - // .. - } - - if (! isset($editor)) { - return; - } - - $href = is_array($editor) && isset($editor['href']) - ? $editor['href'] - : ($this->editorHrefs[$editor['name'] ?? $editor] ?? sprintf('%s://open?file={file}&line={line}', $editor['name'] ?? $editor)); - - if ($basePath = $editor['base_path'] ?? false) { - $file = str_replace($this->basePath, $basePath, $file); - } - - $href = str_replace( - ['{file}', '{line}'], - [$file, is_null($line) ? 1 : $line], - $href, - ); - - return $href; - } - - /** - * Set the resolver that resolves the source of the dump call. - * - * @param (callable(): (array{0: string, 1: string, 2: int|null}|null))|null $callable - * @return void - */ - public static function resolveDumpSourceUsing($callable) - { - static::$dumpSourceResolver = $callable; - } - - /** - * Don't include the location / file of the dump in dumps. - * - * @return void - */ - public static function dontIncludeSource() - { - static::$dumpSourceResolver = false; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/AboutCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/AboutCommand.php deleted file mode 100644 index c6a38ce9..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/AboutCommand.php +++ /dev/null @@ -1,266 +0,0 @@ -composer = $composer; - } - - /** - * Execute the console command. - * - * @return int - */ - public function handle() - { - $this->gatherApplicationInformation(); - - collect(static::$data) - ->map(fn ($items) => collect($items) - ->map(function ($value) { - if (is_array($value)) { - return [$value]; - } - - if (is_string($value)) { - $value = $this->laravel->make($value); - } - - return collect($this->laravel->call($value)) - ->map(fn ($value, $key) => [$key, $value]) - ->values() - ->all(); - })->flatten(1) - ) - ->sortBy(function ($data, $key) { - $index = array_search($key, ['Environment', 'Cache', 'Drivers']); - - return $index === false ? 99 : $index; - }) - ->filter(function ($data, $key) { - return $this->option('only') ? in_array(Str::of($key)->lower()->snake(), $this->sections()) : true; - }) - ->pipe(fn ($data) => $this->display($data)); - - $this->newLine(); - - return 0; - } - - /** - * Display the application information. - * - * @param \Illuminate\Support\Collection $data - * @return void - */ - protected function display($data) - { - $this->option('json') ? $this->displayJson($data) : $this->displayDetail($data); - } - - /** - * Display the application information as a detail view. - * - * @param \Illuminate\Support\Collection $data - * @return void - */ - protected function displayDetail($data) - { - $data->each(function ($data, $section) { - $this->newLine(); - - $this->components->twoColumnDetail(' '.$section.''); - - $data->pipe(fn ($data) => $section !== 'Environment' ? $data->sort() : $data)->each(function ($detail) { - [$label, $value] = $detail; - - $this->components->twoColumnDetail($label, value($value)); - }); - }); - } - - /** - * Display the application information as JSON. - * - * @param \Illuminate\Support\Collection $data - * @return void - */ - protected function displayJson($data) - { - $output = $data->flatMap(function ($data, $section) { - return [(string) Str::of($section)->snake() => $data->mapWithKeys(fn ($item, $key) => [(string) Str::of($item[0])->lower()->snake() => value($item[1])])]; - }); - - $this->output->writeln(strip_tags(json_encode($output))); - } - - /** - * Gather information about the application. - * - * @return void - */ - protected function gatherApplicationInformation() - { - static::addToSection('Environment', fn () => [ - 'Application Name' => config('app.name'), - 'Laravel Version' => $this->laravel->version(), - 'PHP Version' => phpversion(), - 'Composer Version' => $this->composer->getVersion() ?? '-', - 'Environment' => $this->laravel->environment(), - 'Debug Mode' => config('app.debug') ? 'ENABLED' : 'OFF', - 'URL' => Str::of(config('app.url'))->replace(['http://', 'https://'], ''), - 'Maintenance Mode' => $this->laravel->isDownForMaintenance() ? 'ENABLED' : 'OFF', - ]); - - static::addToSection('Cache', fn () => [ - 'Config' => $this->laravel->configurationIsCached() ? 'CACHED' : 'NOT CACHED', - 'Events' => $this->laravel->eventsAreCached() ? 'CACHED' : 'NOT CACHED', - 'Routes' => $this->laravel->routesAreCached() ? 'CACHED' : 'NOT CACHED', - 'Views' => $this->hasPhpFiles($this->laravel->storagePath('framework/views')) ? 'CACHED' : 'NOT CACHED', - ]); - - $logChannel = config('logging.default'); - - if (config('logging.channels.'.$logChannel.'.driver') === 'stack') { - $secondary = collect(config('logging.channels.'.$logChannel.'.channels')) - ->implode(', '); - - $logs = ''.$logChannel.' / '.$secondary; - } else { - $logs = $logChannel; - } - - static::addToSection('Drivers', fn () => array_filter([ - 'Broadcasting' => config('broadcasting.default'), - 'Cache' => config('cache.default'), - 'Database' => config('database.default'), - 'Logs' => $logs, - 'Mail' => config('mail.default'), - 'Octane' => config('octane.server'), - 'Queue' => config('queue.default'), - 'Scout' => config('scout.driver'), - 'Session' => config('session.driver'), - ])); - - collect(static::$customDataResolvers)->each->__invoke(); - } - - /** - * Determine whether the given directory has PHP files. - * - * @param string $path - * @return bool - */ - protected function hasPhpFiles(string $path): bool - { - return count(glob($path.'/*.php')) > 0; - } - - /** - * Add additional data to the output of the "about" command. - * - * @param string $section - * @param callable|string|array $data - * @param string|null $value - * @return void - */ - public static function add(string $section, $data, string $value = null) - { - static::$customDataResolvers[] = fn () => static::addToSection($section, $data, $value); - } - - /** - * Add additional data to the output of the "about" command. - * - * @param string $section - * @param callable|string|array $data - * @param string|null $value - * @return void - */ - protected static function addToSection(string $section, $data, string $value = null) - { - if (is_array($data)) { - foreach ($data as $key => $value) { - self::$data[$section][] = [$key, $value]; - } - } elseif (is_callable($data) || ($value === null && class_exists($data))) { - self::$data[$section][] = $data; - } else { - self::$data[$section][] = [$data, $value]; - } - } - - /** - * Get the sections provided to the command. - * - * @return array - */ - protected function sections() - { - return array_filter(explode(',', $this->option('only') ?? '')); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/CastMakeCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/CastMakeCommand.php deleted file mode 100644 index 27043606..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/CastMakeCommand.php +++ /dev/null @@ -1,92 +0,0 @@ -option('inbound') - ? $this->resolveStubPath('/stubs/cast.inbound.stub') - : $this->resolveStubPath('/stubs/cast.stub'); - } - - /** - * Resolve the fully-qualified path to the stub. - * - * @param string $stub - * @return string - */ - protected function resolveStubPath($stub) - { - return file_exists($customPath = $this->laravel->basePath(trim($stub, '/'))) - ? $customPath - : __DIR__.$stub; - } - - /** - * Get the default namespace for the class. - * - * @param string $rootNamespace - * @return string - */ - protected function getDefaultNamespace($rootNamespace) - { - return $rootNamespace.'\Casts'; - } - - /** - * Get the console command arguments. - * - * @return array - */ - protected function getOptions() - { - return [ - ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the cast already exists'], - ['inbound', null, InputOption::VALUE_NONE, 'Generate an inbound cast class'], - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/ChannelMakeCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/ChannelMakeCommand.php deleted file mode 100644 index 1bc26e85..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/ChannelMakeCommand.php +++ /dev/null @@ -1,91 +0,0 @@ -userProviderModel()), - parent::buildClass($name) - ); - } - - /** - * Get the stub file for the generator. - * - * @return string - */ - protected function getStub() - { - return __DIR__.'/stubs/channel.stub'; - } - - /** - * Get the default namespace for the class. - * - * @param string $rootNamespace - * @return string - */ - protected function getDefaultNamespace($rootNamespace) - { - return $rootNamespace.'\Broadcasting'; - } - - /** - * Get the console command arguments. - * - * @return array - */ - protected function getOptions() - { - return [ - ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the channel already exists'], - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/ClearCompiledCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/ClearCompiledCommand.php deleted file mode 100644 index 20375ded..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/ClearCompiledCommand.php +++ /dev/null @@ -1,53 +0,0 @@ -laravel->getCachedServicesPath())) { - @unlink($servicesPath); - } - - if (is_file($packagesPath = $this->laravel->getCachedPackagesPath())) { - @unlink($packagesPath); - } - - $this->components->info('Compiled services and packages files removed successfully.'); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/CliDumper.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/CliDumper.php deleted file mode 100644 index beed2f2a..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/CliDumper.php +++ /dev/null @@ -1,134 +0,0 @@ -basePath = $basePath; - $this->output = $output; - $this->compiledViewPath = $compiledViewPath; - } - - /** - * Create a new CLI dumper instance and register it as the default dumper. - * - * @param string $basePath - * @param string $compiledViewPath - * @return void - */ - public static function register($basePath, $compiledViewPath) - { - $cloner = tap(new VarCloner())->addCasters(ReflectionCaster::UNSET_CLOSURE_FILE_INFO); - - $dumper = new static(new ConsoleOutput(), $basePath, $compiledViewPath); - - VarDumper::setHandler(fn ($value) => $dumper->dumpWithSource($cloner->cloneVar($value))); - } - - /** - * Dump a variable with its source file / line. - * - * @param \Symfony\Component\VarDumper\Cloner\Data $data - * @return void - */ - public function dumpWithSource(Data $data) - { - if ($this->dumping) { - $this->dump($data); - - return; - } - - $this->dumping = true; - - $output = (string) $this->dump($data, true); - $lines = explode("\n", $output); - - $lines[0] .= $this->getDumpSourceContent(); - - $this->output->write(implode("\n", $lines)); - - $this->dumping = false; - } - - /** - * Get the dump's source console content. - * - * @return string - */ - protected function getDumpSourceContent() - { - if (is_null($dumpSource = $this->resolveDumpSource())) { - return ''; - } - - [$file, $relativeFile, $line] = $dumpSource; - - $href = $this->resolveSourceHref($file, $line); - - return sprintf( - ' // %s%s', - is_null($href) ? '' : ";href=$href", - $relativeFile, - is_null($line) ? '' : ":$line" - ); - } - - /** - * {@inheritDoc} - */ - protected function supportsColors(): bool - { - return $this->output->isDecorated(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/ClosureCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/ClosureCommand.php deleted file mode 100644 index 4cd54e8e..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/ClosureCommand.php +++ /dev/null @@ -1,82 +0,0 @@ -callback = $callback; - $this->signature = $signature; - - parent::__construct(); - } - - /** - * Execute the console command. - * - * @param \Symfony\Component\Console\Input\InputInterface $input - * @param \Symfony\Component\Console\Output\OutputInterface $output - * @return int - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - $inputs = array_merge($input->getArguments(), $input->getOptions()); - - $parameters = []; - - foreach ((new ReflectionFunction($this->callback))->getParameters() as $parameter) { - if (isset($inputs[$parameter->getName()])) { - $parameters[$parameter->getName()] = $inputs[$parameter->getName()]; - } - } - - return (int) $this->laravel->call( - $this->callback->bindTo($this, $this), $parameters - ); - } - - /** - * Set the description for the command. - * - * @param string $description - * @return $this - */ - public function purpose($description) - { - return $this->describe($description); - } - - /** - * Set the description for the command. - * - * @param string $description - * @return $this - */ - public function describe($description) - { - $this->setDescription($description); - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/ComponentMakeCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/ComponentMakeCommand.php deleted file mode 100644 index e11838c2..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/ComponentMakeCommand.php +++ /dev/null @@ -1,190 +0,0 @@ -option('view')) { - $this->writeView(function () { - $this->components->info($this->type.' created successfully.'); - }); - - return; - } - - if (parent::handle() === false && ! $this->option('force')) { - return false; - } - - if (! $this->option('inline')) { - $this->writeView(); - } - } - - /** - * Write the view for the component. - * - * @param callable|null $onSuccess - * @return void - */ - protected function writeView($onSuccess = null) - { - $path = $this->viewPath( - str_replace('.', '/', 'components.'.$this->getView()).'.blade.php' - ); - - if (! $this->files->isDirectory(dirname($path))) { - $this->files->makeDirectory(dirname($path), 0777, true, true); - } - - if ($this->files->exists($path) && ! $this->option('force')) { - $this->components->error('View already exists.'); - - return; - } - - file_put_contents( - $path, - '
- -
' - ); - - if ($onSuccess) { - $onSuccess(); - } - } - - /** - * Build the class with the given name. - * - * @param string $name - * @return string - */ - protected function buildClass($name) - { - if ($this->option('inline')) { - return str_replace( - ['DummyView', '{{ view }}'], - "<<<'blade'\n
\n \n
\nblade", - parent::buildClass($name) - ); - } - - return str_replace( - ['DummyView', '{{ view }}'], - 'view(\'components.'.$this->getView().'\')', - parent::buildClass($name) - ); - } - - /** - * Get the view name relative to the components directory. - * - * @return string view - */ - protected function getView() - { - $name = str_replace('\\', '/', $this->argument('name')); - - return collect(explode('/', $name)) - ->map(function ($part) { - return Str::kebab($part); - }) - ->implode('.'); - } - - /** - * Get the stub file for the generator. - * - * @return string - */ - protected function getStub() - { - return $this->resolveStubPath('/stubs/view-component.stub'); - } - - /** - * Resolve the fully-qualified path to the stub. - * - * @param string $stub - * @return string - */ - protected function resolveStubPath($stub) - { - return file_exists($customPath = $this->laravel->basePath(trim($stub, '/'))) - ? $customPath - : __DIR__.$stub; - } - - /** - * Get the default namespace for the class. - * - * @param string $rootNamespace - * @return string - */ - protected function getDefaultNamespace($rootNamespace) - { - return $rootNamespace.'\View\Components'; - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the component already exists'], - ['inline', null, InputOption::VALUE_NONE, 'Create a component that renders an inline view'], - ['view', null, InputOption::VALUE_NONE, 'Create an anonymous component with only a view'], - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/ConfigCacheCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/ConfigCacheCommand.php deleted file mode 100644 index 18eec46c..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/ConfigCacheCommand.php +++ /dev/null @@ -1,105 +0,0 @@ -files = $files; - } - - /** - * Execute the console command. - * - * @return void - * - * @throws \LogicException - */ - public function handle() - { - $this->callSilent('config:clear'); - - $config = $this->getFreshConfiguration(); - - $configPath = $this->laravel->getCachedConfigPath(); - - $this->files->put( - $configPath, 'files->delete($configPath); - - throw new LogicException('Your configuration files are not serializable.', 0, $e); - } - - $this->components->info('Configuration cached successfully.'); - } - - /** - * Boot a fresh copy of the application configuration. - * - * @return array - */ - protected function getFreshConfiguration() - { - $app = require $this->laravel->bootstrapPath().'/app.php'; - - $app->useStoragePath($this->laravel->storagePath()); - - $app->make(ConsoleKernelContract::class)->bootstrap(); - - return $app['config']->all(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/ConfigClearCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/ConfigClearCommand.php deleted file mode 100644 index 3e07e9be..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/ConfigClearCommand.php +++ /dev/null @@ -1,68 +0,0 @@ -files = $files; - } - - /** - * Execute the console command. - * - * @return void - */ - public function handle() - { - $this->files->delete($this->laravel->getCachedConfigPath()); - - $this->components->info('Configuration cache cleared successfully.'); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/ConsoleMakeCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/ConsoleMakeCommand.php deleted file mode 100644 index 18f6dd1b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/ConsoleMakeCommand.php +++ /dev/null @@ -1,111 +0,0 @@ -option('command'), $stub); - } - - /** - * Get the stub file for the generator. - * - * @return string - */ - protected function getStub() - { - $relativePath = '/stubs/console.stub'; - - return file_exists($customPath = $this->laravel->basePath(trim($relativePath, '/'))) - ? $customPath - : __DIR__.$relativePath; - } - - /** - * Get the default namespace for the class. - * - * @param string $rootNamespace - * @return string - */ - protected function getDefaultNamespace($rootNamespace) - { - return $rootNamespace.'\Console\Commands'; - } - - /** - * Get the console command arguments. - * - * @return array - */ - protected function getArguments() - { - return [ - ['name', InputArgument::REQUIRED, 'The name of the command'], - ]; - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the console command already exists'], - ['command', null, InputOption::VALUE_OPTIONAL, 'The terminal command that should be assigned', 'command:name'], - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/DocsCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/DocsCommand.php deleted file mode 100644 index e8e1646f..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/DocsCommand.php +++ /dev/null @@ -1,546 +0,0 @@ -php artisan docs -- search query here'; - - /** - * The HTTP client instance. - * - * @var \Illuminate\Http\Client\Factory - */ - protected $http; - - /** - * The cache repository implementation. - * - * @var \Illuminate\Contracts\Cache\Repository - */ - protected $cache; - - /** - * The custom URL opener. - * - * @var callable|null - */ - protected $urlOpener; - - /** - * The custom documentation version to open. - * - * @var string|null - */ - protected $version; - - /** - * The operating system family. - * - * @var string - */ - protected $systemOsFamily = PHP_OS_FAMILY; - - /** - * Create a new command instance. - * - * @param \Illuminate\Http\Client\Factory $http - * @param \Illuminate\Contracts\Cache\Repository $cache - * @return void - */ - public function __construct(Http $http, Cache $cache) - { - parent::__construct(); - - $this->http = $http; - $this->cache = $cache; - } - - /** - * Configure the current command. - * - * @return void - */ - protected function configure() - { - parent::configure(); - - if ($this->isSearching()) { - $this->ignoreValidationErrors(); - } - } - - /** - * Execute the console command. - * - * @return int - */ - public function handle() - { - try { - $this->openUrl(); - } catch (ProcessFailedException $e) { - if ($e->getProcess()->getExitCodeText() === 'Interrupt') { - return $e->getProcess()->getExitCode(); - } - - throw $e; - } - - $this->refreshDocs(); - - return Command::SUCCESS; - } - - /** - * Open the documentation URL. - * - * @return void - */ - protected function openUrl() - { - with($this->url(), function ($url) { - $this->components->info("Opening the docs to: {$url}"); - - $this->open($url); - }); - } - - /** - * The URL to the documentation page. - * - * @return string - */ - protected function url() - { - if ($this->isSearching()) { - return "https://laravel.com/docs/{$this->version()}?".Arr::query([ - 'q' => $this->searchQuery(), - ]); - } - - return with($this->page(), function ($page) { - return trim("https://laravel.com/docs/{$this->version()}/{$page}#{$this->section($page)}", '#/'); - }); - } - - /** - * The page the user is opening. - * - * @return string - */ - protected function page() - { - return with($this->resolvePage(), function ($page) { - if ($page === null) { - $this->components->warn('Unable to determine the page you are trying to visit.'); - - return '/'; - } - - return $page; - }); - } - - /** - * Determine the page to open. - * - * @return ?string - */ - protected function resolvePage() - { - if ($this->option('no-interaction') && $this->didNotRequestPage()) { - return '/'; - } - - return $this->didNotRequestPage() - ? $this->askForPage() - : $this->guessPage(); - } - - /** - * Determine if the user requested a specific page when calling the command. - * - * @return bool - */ - protected function didNotRequestPage() - { - return $this->argument('page') === null; - } - - /** - * Ask the user which page they would like to open. - * - * @return ?string - */ - protected function askForPage() - { - return $this->askForPageViaCustomStrategy() ?? $this->askForPageViaAutocomplete(); - } - - /** - * Ask the user which page they would like to open via a custom strategy. - * - * @return ?string - */ - protected function askForPageViaCustomStrategy() - { - try { - $strategy = require Env::get('ARTISAN_DOCS_ASK_STRATEGY'); - } catch (Throwable $e) { - return null; - } - - if (! is_callable($strategy)) { - return null; - } - - return $strategy($this) ?? '/'; - } - - /** - * Ask the user which page they would like to open using autocomplete. - * - * @return ?string - */ - protected function askForPageViaAutocomplete() - { - $choice = $this->components->choice( - 'Which page would you like to open?', - $this->pages()->mapWithKeys(fn ($option) => [ - Str::lower($option['title']) => $option['title'], - ])->all(), - 'installation', - 3 - ); - - return $this->pages()->filter( - fn ($page) => $page['title'] === $choice || Str::lower($page['title']) === $choice - )->keys()->first() ?: null; - } - - /** - * Guess the page the user is attempting to open. - * - * @return ?string - */ - protected function guessPage() - { - return $this->pages() - ->filter(fn ($page) => str_starts_with( - Str::slug($page['title'], ' '), - Str::slug($this->argument('page'), ' ') - ))->keys()->first() ?? $this->pages()->map(fn ($page) => similar_text( - Str::slug($page['title'], ' '), - Str::slug($this->argument('page'), ' '), - )) - ->filter(fn ($score) => $score >= min(3, Str::length($this->argument('page')))) - ->sortDesc() - ->keys() - ->sortByDesc(fn ($slug) => Str::contains( - Str::slug($this->pages()[$slug]['title'], ' '), - Str::slug($this->argument('page'), ' ') - ) ? 1 : 0) - ->first(); - } - - /** - * The section the user specifically asked to open. - * - * @param string $page - * @return ?string - */ - protected function section($page) - { - return $this->didNotRequestSection() - ? null - : $this->guessSection($page); - } - - /** - * Determine if the user requested a specific section when calling the command. - * - * @return bool - */ - protected function didNotRequestSection() - { - return $this->argument('section') === null; - } - - /** - * Guess the section the user is attempting to open. - * - * @param string $page - * @return ?string - */ - protected function guessSection($page) - { - return $this->sectionsFor($page) - ->filter(fn ($section) => str_starts_with( - Str::slug($section['title'], ' '), - Str::slug($this->argument('section'), ' ') - ))->keys()->first() ?? $this->sectionsFor($page)->map(fn ($section) => similar_text( - Str::slug($section['title'], ' '), - Str::slug($this->argument('section'), ' '), - )) - ->filter(fn ($score) => $score >= min(3, Str::length($this->argument('section')))) - ->sortDesc() - ->keys() - ->sortByDesc(fn ($slug) => Str::contains( - Str::slug($this->sectionsFor($page)[$slug]['title'], ' '), - Str::slug($this->argument('section'), ' ') - ) ? 1 : 0) - ->first(); - } - - /** - * Open the URL in the user's browser. - * - * @param string $url - * @return void - */ - protected function open($url) - { - ($this->urlOpener ?? function ($url) { - if (Env::get('ARTISAN_DOCS_OPEN_STRATEGY')) { - $this->openViaCustomStrategy($url); - } elseif (in_array($this->systemOsFamily, ['Darwin', 'Windows', 'Linux'])) { - $this->openViaBuiltInStrategy($url); - } else { - $this->components->warn('Unable to open the URL on your system. You will need to open it yourself or create a custom opener for your system.'); - } - })($url); - } - - /** - * Open the URL via a custom strategy. - * - * @param string $url - * @return void - */ - protected function openViaCustomStrategy($url) - { - try { - $command = require Env::get('ARTISAN_DOCS_OPEN_STRATEGY'); - } catch (Throwable $e) { - $command = null; - } - - if (! is_callable($command)) { - $this->components->warn('Unable to open the URL with your custom strategy. You will need to open it yourself.'); - - return; - } - - $command($url); - } - - /** - * Open the URL via the built in strategy. - * - * @param string $url - * @return void - */ - protected function openViaBuiltInStrategy($url) - { - if ($this->systemOsFamily === 'Windows') { - $process = tap(Process::fromShellCommandline(escapeshellcmd("start {$url}")))->run(); - - if (! $process->isSuccessful()) { - throw new ProcessFailedException($process); - } - - return; - } - - $binary = Collection::make(match ($this->systemOsFamily) { - 'Darwin' => ['open'], - 'Linux' => ['xdg-open', 'wslview'], - })->first(fn ($binary) => (new ExecutableFinder)->find($binary) !== null); - - if ($binary === null) { - $this->components->warn('Unable to open the URL on your system. You will need to open it yourself or create a custom opener for your system.'); - - return; - } - - $process = tap(Process::fromShellCommandline(escapeshellcmd("{$binary} {$url}")))->run(); - - if (! $process->isSuccessful()) { - throw new ProcessFailedException($process); - } - } - - /** - * The available sections for the page. - * - * @param string $page - * @return \Illuminate\Support\Collection - */ - public function sectionsFor($page) - { - return new Collection($this->pages()[$page]['sections']); - } - - /** - * The pages available to open. - * - * @return \Illuminate\Support\Collection - */ - public function pages() - { - return new Collection($this->docs()['pages']); - } - - /** - * Get the documentation index as a collection. - * - * @return \Illuminate\Support\Collection - */ - public function docs() - { - return $this->cache->remember( - "artisan.docs.{{$this->version()}}.index", - CarbonInterval::months(2), - fn () => $this->fetchDocs()->throw()->collect() - ); - } - - /** - * Refresh the cached copy of the documentation index. - * - * @return void - */ - protected function refreshDocs() - { - with($this->fetchDocs(), function ($response) { - if ($response->successful()) { - $this->cache->put("artisan.docs.{{$this->version()}}.index", $response->collect(), CarbonInterval::months(2)); - } - }); - } - - /** - * Fetch the documentation index from the Laravel website. - * - * @return \Illuminate\Http\Client\Response - */ - protected function fetchDocs() - { - return $this->http->get("https://laravel.com/docs/{$this->version()}/index.json"); - } - - /** - * Determine the version of the docs to open. - * - * @return string - */ - protected function version() - { - return Str::before(($this->version ?? $this->laravel->version()), '.').'.x'; - } - - /** - * The search query the user provided. - * - * @return string - */ - protected function searchQuery() - { - return Collection::make($_SERVER['argv'])->skip(3)->implode(' '); - } - - /** - * Determine if the command is intended to perform a search. - * - * @return bool - */ - protected function isSearching() - { - return ($_SERVER['argv'][2] ?? null) === '--'; - } - - /** - * Set the documentation version. - * - * @param string $version - * @return $this - */ - public function setVersion($version) - { - $this->version = $version; - - return $this; - } - - /** - * Set a custom URL opener. - * - * @param callable|null $opener - * @return $this - */ - public function setUrlOpener($opener) - { - $this->urlOpener = $opener; - - return $this; - } - - /** - * Set the system operating system family. - * - * @param string $family - * @return $this - */ - public function setSystemOsFamily($family) - { - $this->systemOsFamily = $family; - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/DownCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/DownCommand.php deleted file mode 100644 index 42aa6b64..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/DownCommand.php +++ /dev/null @@ -1,151 +0,0 @@ -laravel->maintenanceMode()->active()) { - $this->components->info('Application is already down.'); - - return 0; - } - - $this->laravel->maintenanceMode()->activate($this->getDownFilePayload()); - - file_put_contents( - storage_path('framework/maintenance.php'), - file_get_contents(__DIR__.'/stubs/maintenance-mode.stub') - ); - - $this->laravel->get('events')->dispatch(new MaintenanceModeEnabled()); - - $this->components->info('Application is now in maintenance mode.'); - } catch (Exception $e) { - $this->components->error(sprintf( - 'Failed to enter maintenance mode: %s.', - $e->getMessage(), - )); - - return 1; - } - } - - /** - * Get the payload to be placed in the "down" file. - * - * @return array - */ - protected function getDownFilePayload() - { - return [ - 'except' => $this->excludedPaths(), - 'redirect' => $this->redirectPath(), - 'retry' => $this->getRetryTime(), - 'refresh' => $this->option('refresh'), - 'secret' => $this->option('secret'), - 'status' => (int) $this->option('status', 503), - 'template' => $this->option('render') ? $this->prerenderView() : null, - ]; - } - - /** - * Get the paths that should be excluded from maintenance mode. - * - * @return array - */ - protected function excludedPaths() - { - try { - return $this->laravel->make(PreventRequestsDuringMaintenance::class)->getExcludedPaths(); - } catch (Throwable $e) { - return []; - } - } - - /** - * Get the path that users should be redirected to. - * - * @return string - */ - protected function redirectPath() - { - if ($this->option('redirect') && $this->option('redirect') !== '/') { - return '/'.trim($this->option('redirect'), '/'); - } - - return $this->option('redirect'); - } - - /** - * Prerender the specified view so that it can be rendered even before loading Composer. - * - * @return string - */ - protected function prerenderView() - { - (new RegisterErrorViewPaths)(); - - return view($this->option('render'), [ - 'retryAfter' => $this->option('retry'), - ])->render(); - } - - /** - * Get the number of seconds the client should wait before retrying their request. - * - * @return int|null - */ - protected function getRetryTime() - { - $retry = $this->option('retry'); - - return is_numeric($retry) && $retry > 0 ? (int) $retry : null; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/EnvironmentCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/EnvironmentCommand.php deleted file mode 100644 index ba74ed98..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/EnvironmentCommand.php +++ /dev/null @@ -1,48 +0,0 @@ -components->info(sprintf( - 'The application environment is [%s].', - $this->laravel['env'], - )); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/EnvironmentDecryptCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/EnvironmentDecryptCommand.php deleted file mode 100644 index 1e11e110..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/EnvironmentDecryptCommand.php +++ /dev/null @@ -1,159 +0,0 @@ -files = $files; - } - - /** - * Execute the console command. - * - * @return void - */ - public function handle() - { - $key = $this->option('key') ?: Env::get('LARAVEL_ENV_ENCRYPTION_KEY'); - - if (! $key) { - $this->components->error('A decryption key is required.'); - - return Command::FAILURE; - } - - $cipher = $this->option('cipher') ?: 'AES-256-CBC'; - - $key = $this->parseKey($key); - - $encryptedFile = ($this->option('env') - ? base_path('.env').'.'.$this->option('env') - : $this->laravel->environmentFilePath()).'.encrypted'; - - $outputFile = $this->outputFilePath(); - - if (Str::endsWith($outputFile, '.encrypted')) { - $this->components->error('Invalid filename.'); - - return Command::FAILURE; - } - - if (! $this->files->exists($encryptedFile)) { - $this->components->error('Encrypted environment file not found.'); - - return Command::FAILURE; - } - - if ($this->files->exists($outputFile) && ! $this->option('force')) { - $this->components->error('Environment file already exists.'); - - return Command::FAILURE; - } - - try { - $encrypter = new Encrypter($key, $cipher); - - $this->files->put( - $outputFile, - $encrypter->decrypt($this->files->get($encryptedFile)) - ); - } catch (Exception $e) { - $this->components->error($e->getMessage()); - - return Command::FAILURE; - } - - $this->components->info('Environment successfully decrypted.'); - - $this->components->twoColumnDetail('Decrypted file', $outputFile); - - $this->newLine(); - } - - /** - * Parse the encryption key. - * - * @param string $key - * @return string - */ - protected function parseKey(string $key) - { - if (Str::startsWith($key, $prefix = 'base64:')) { - $key = base64_decode(Str::after($key, $prefix)); - } - - return $key; - } - - /** - * Get the output file path that should be used for the command. - * - * @return string - */ - protected function outputFilePath() - { - $path = Str::finish($this->option('path') ?: base_path(), DIRECTORY_SEPARATOR); - - $outputFile = $this->option('filename') ?: ('.env'.($this->option('env') ? '.'.$this->option('env') : '')); - $outputFile = ltrim($outputFile, DIRECTORY_SEPARATOR); - - return $path.$outputFile; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/EnvironmentEncryptCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/EnvironmentEncryptCommand.php deleted file mode 100644 index ef908262..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/EnvironmentEncryptCommand.php +++ /dev/null @@ -1,135 +0,0 @@ -files = $files; - } - - /** - * Execute the console command. - * - * @return void - */ - public function handle() - { - $cipher = $this->option('cipher') ?: 'AES-256-CBC'; - - $key = $this->option('key'); - - $keyPassed = $key !== null; - - $environmentFile = $this->option('env') - ? base_path('.env').'.'.$this->option('env') - : $this->laravel->environmentFilePath(); - - $encryptedFile = $environmentFile.'.encrypted'; - - if (! $keyPassed) { - $key = Encrypter::generateKey($cipher); - } - - if (! $this->files->exists($environmentFile)) { - $this->components->error('Environment file not found.'); - - return Command::FAILURE; - } - - if ($this->files->exists($encryptedFile) && ! $this->option('force')) { - $this->components->error('Encrypted environment file already exists.'); - - return Command::FAILURE; - } - - try { - $encrypter = new Encrypter($this->parseKey($key), $cipher); - - $this->files->put( - $encryptedFile, - $encrypter->encrypt($this->files->get($environmentFile)) - ); - } catch (Exception $e) { - $this->components->error($e->getMessage()); - - return Command::FAILURE; - } - - $this->components->info('Environment successfully encrypted.'); - - $this->components->twoColumnDetail('Key', ($keyPassed ? $key : 'base64:'.base64_encode($key))); - $this->components->twoColumnDetail('Cipher', $cipher); - $this->components->twoColumnDetail('Encrypted file', $encryptedFile); - - $this->newLine(); - } - - /** - * Parse the encryption key. - * - * @param string $key - * @return string - */ - protected function parseKey(string $key) - { - if (Str::startsWith($key, $prefix = 'base64:')) { - $key = base64_decode(Str::after($key, $prefix)); - } - - return $key; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/EventCacheCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/EventCacheCommand.php deleted file mode 100644 index df42fbfd..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/EventCacheCommand.php +++ /dev/null @@ -1,71 +0,0 @@ -callSilent('event:clear'); - - file_put_contents( - $this->laravel->getCachedEventsPath(), - 'getEvents(), true).';' - ); - - $this->components->info('Events cached successfully.'); - } - - /** - * Get all of the events and listeners configured for the application. - * - * @return array - */ - protected function getEvents() - { - $events = []; - - foreach ($this->laravel->getProviders(EventServiceProvider::class) as $provider) { - $providerEvents = array_merge_recursive($provider->shouldDiscoverEvents() ? $provider->discoverEvents() : [], $provider->listens()); - - $events[get_class($provider)] = $providerEvents; - } - - return $events; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/EventClearCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/EventClearCommand.php deleted file mode 100644 index a5c8ed19..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/EventClearCommand.php +++ /dev/null @@ -1,70 +0,0 @@ -files = $files; - } - - /** - * Execute the console command. - * - * @return void - * - * @throws \RuntimeException - */ - public function handle() - { - $this->files->delete($this->laravel->getCachedEventsPath()); - - $this->components->info('Cached events cleared successfully.'); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/EventGenerateCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/EventGenerateCommand.php deleted file mode 100644 index b27e9dbb..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/EventGenerateCommand.php +++ /dev/null @@ -1,90 +0,0 @@ -laravel->getProviders(EventServiceProvider::class); - - foreach ($providers as $provider) { - foreach ($provider->listens() as $event => $listeners) { - $this->makeEventAndListeners($event, $listeners); - } - } - - $this->components->info('Events and listeners generated successfully.'); - } - - /** - * Make the event and listeners for the given event. - * - * @param string $event - * @param array $listeners - * @return void - */ - protected function makeEventAndListeners($event, $listeners) - { - if (! str_contains($event, '\\')) { - return; - } - - $this->callSilent('make:event', ['name' => $event]); - - $this->makeListeners($event, $listeners); - } - - /** - * Make the listeners for the given event. - * - * @param string $event - * @param array $listeners - * @return void - */ - protected function makeListeners($event, $listeners) - { - foreach ($listeners as $listener) { - $listener = preg_replace('/@.+$/', '', $listener); - - $this->callSilent('make:listener', array_filter( - ['name' => $listener, '--event' => $event] - )); - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/EventListCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/EventListCommand.php deleted file mode 100644 index 1e0e11b8..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/EventListCommand.php +++ /dev/null @@ -1,232 +0,0 @@ -getEvents()->sortKeys(); - - if ($events->isEmpty()) { - $this->components->info("Your application doesn't have any events matching the given criteria."); - - return; - } - - $this->newLine(); - - $events->each(function ($listeners, $event) { - $this->components->twoColumnDetail($this->appendEventInterfaces($event)); - $this->components->bulletList($listeners); - }); - - $this->newLine(); - } - - /** - * Get all of the events and listeners configured for the application. - * - * @return \Illuminate\Support\Collection - */ - protected function getEvents() - { - $events = collect($this->getListenersOnDispatcher()); - - if ($this->filteringByEvent()) { - $events = $this->filterEvents($events); - } - - return $events; - } - - /** - * Get the event / listeners from the dispatcher object. - * - * @return array - */ - protected function getListenersOnDispatcher() - { - $events = []; - - foreach ($this->getRawListeners() as $event => $rawListeners) { - foreach ($rawListeners as $rawListener) { - if (is_string($rawListener)) { - $events[$event][] = $this->appendListenerInterfaces($rawListener); - } elseif ($rawListener instanceof Closure) { - $events[$event][] = $this->stringifyClosure($rawListener); - } elseif (is_array($rawListener) && count($rawListener) === 2) { - if (is_object($rawListener[0])) { - $rawListener[0] = get_class($rawListener[0]); - } - - $events[$event][] = $this->appendListenerInterfaces(implode('@', $rawListener)); - } - } - } - - return $events; - } - - /** - * Add the event implemented interfaces to the output. - * - * @param string $event - * @return string - */ - protected function appendEventInterfaces($event) - { - if (! class_exists($event)) { - return $event; - } - - $interfaces = class_implements($event); - - if (in_array(ShouldBroadcast::class, $interfaces)) { - $event .= ' (ShouldBroadcast)'; - } - - return $event; - } - - /** - * Add the listener implemented interfaces to the output. - * - * @param string $listener - * @return string - */ - protected function appendListenerInterfaces($listener) - { - $listener = explode('@', $listener); - - $interfaces = class_implements($listener[0]); - - $listener = implode('@', $listener); - - if (in_array(ShouldQueue::class, $interfaces)) { - $listener .= ' (ShouldQueue)'; - } - - return $listener; - } - - /** - * Get a displayable string representation of a Closure listener. - * - * @param \Closure $rawListener - * @return string - */ - protected function stringifyClosure(Closure $rawListener) - { - $reflection = new ReflectionFunction($rawListener); - - $path = str_replace([base_path(), DIRECTORY_SEPARATOR], ['', '/'], $reflection->getFileName() ?: ''); - - return 'Closure at: '.$path.':'.$reflection->getStartLine(); - } - - /** - * Filter the given events using the provided event name filter. - * - * @param \Illuminate\Support\Collection $events - * @return \Illuminate\Support\Collection - */ - protected function filterEvents($events) - { - if (! $eventName = $this->option('event')) { - return $events; - } - - return $events->filter( - fn ($listeners, $event) => str_contains($event, $eventName) - ); - } - - /** - * Determine whether the user is filtering by an event name. - * - * @return bool - */ - protected function filteringByEvent() - { - return ! empty($this->option('event')); - } - - /** - * Gets the raw version of event listeners from the event dispatcher. - * - * @return array - */ - protected function getRawListeners() - { - return $this->getEventsDispatcher()->getRawListeners(); - } - - /** - * Get the event dispatcher. - * - * @return Illuminate\Events\Dispatcher - */ - public function getEventsDispatcher() - { - return is_null(self::$eventsResolver) - ? $this->getLaravel()->make('events') - : call_user_func(self::$eventsResolver); - } - - /** - * Set a callback that should be used when resolving the events dispatcher. - * - * @param \Closure|null $resolver - * @return void - */ - public static function resolveEventsUsing($resolver) - { - static::$eventsResolver = $resolver; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/EventMakeCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/EventMakeCommand.php deleted file mode 100644 index 94f96b5e..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/EventMakeCommand.php +++ /dev/null @@ -1,101 +0,0 @@ -files->exists($this->getPath($this->qualifyClass($rawName))); - } - - /** - * Get the stub file for the generator. - * - * @return string - */ - protected function getStub() - { - return $this->resolveStubPath('/stubs/event.stub'); - } - - /** - * Resolve the fully-qualified path to the stub. - * - * @param string $stub - * @return string - */ - protected function resolveStubPath($stub) - { - return file_exists($customPath = $this->laravel->basePath(trim($stub, '/'))) - ? $customPath - : __DIR__.$stub; - } - - /** - * Get the default namespace for the class. - * - * @param string $rootNamespace - * @return string - */ - protected function getDefaultNamespace($rootNamespace) - { - return $rootNamespace.'\Events'; - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the event already exists'], - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/ExceptionMakeCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/ExceptionMakeCommand.php deleted file mode 100644 index 54b24d6f..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/ExceptionMakeCommand.php +++ /dev/null @@ -1,97 +0,0 @@ -option('render')) { - return $this->option('report') - ? __DIR__.'/stubs/exception-render-report.stub' - : __DIR__.'/stubs/exception-render.stub'; - } - - return $this->option('report') - ? __DIR__.'/stubs/exception-report.stub' - : __DIR__.'/stubs/exception.stub'; - } - - /** - * Determine if the class already exists. - * - * @param string $rawName - * @return bool - */ - protected function alreadyExists($rawName) - { - return class_exists($this->rootNamespace().'Exceptions\\'.$rawName); - } - - /** - * Get the default namespace for the class. - * - * @param string $rootNamespace - * @return string - */ - protected function getDefaultNamespace($rootNamespace) - { - return $rootNamespace.'\Exceptions'; - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the exception already exists'], - ['render', null, InputOption::VALUE_NONE, 'Create the exception with an empty render method'], - ['report', null, InputOption::VALUE_NONE, 'Create the exception with an empty report method'], - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/JobMakeCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/JobMakeCommand.php deleted file mode 100644 index 901fff21..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/JobMakeCommand.php +++ /dev/null @@ -1,95 +0,0 @@ -option('sync') - ? $this->resolveStubPath('/stubs/job.stub') - : $this->resolveStubPath('/stubs/job.queued.stub'); - } - - /** - * Resolve the fully-qualified path to the stub. - * - * @param string $stub - * @return string - */ - protected function resolveStubPath($stub) - { - return file_exists($customPath = $this->laravel->basePath(trim($stub, '/'))) - ? $customPath - : __DIR__.$stub; - } - - /** - * Get the default namespace for the class. - * - * @param string $rootNamespace - * @return string - */ - protected function getDefaultNamespace($rootNamespace) - { - return $rootNamespace.'\Jobs'; - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the job already exists'], - ['sync', null, InputOption::VALUE_NONE, 'Indicates that job should be synchronous'], - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php deleted file mode 100644 index 2bd43f2b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php +++ /dev/null @@ -1,468 +0,0 @@ -app = $app; - $this->events = $events; - - $this->app->booted(function () { - $this->defineConsoleSchedule(); - }); - } - - /** - * Define the application's command schedule. - * - * @return void - */ - protected function defineConsoleSchedule() - { - $this->app->singleton(Schedule::class, function ($app) { - return tap(new Schedule($this->scheduleTimezone()), function ($schedule) { - $this->schedule($schedule->useCache($this->scheduleCache())); - }); - }); - } - - /** - * Get the name of the cache store that should manage scheduling mutexes. - * - * @return string - */ - protected function scheduleCache() - { - return $this->app['config']->get('cache.schedule_store', Env::get('SCHEDULE_CACHE_DRIVER')); - } - - /** - * Run the console application. - * - * @param \Symfony\Component\Console\Input\InputInterface $input - * @param \Symfony\Component\Console\Output\OutputInterface|null $output - * @return int - */ - public function handle($input, $output = null) - { - $this->commandStartedAt = Carbon::now(); - - try { - if (in_array($input->getFirstArgument(), ['env:encrypt', 'env:decrypt'], true)) { - $this->bootstrapWithoutBootingProviders(); - } - - $this->bootstrap(); - - return $this->getArtisan()->run($input, $output); - } catch (Throwable $e) { - $this->reportException($e); - - $this->renderException($output, $e); - - return 1; - } - } - - /** - * Terminate the application. - * - * @param \Symfony\Component\Console\Input\InputInterface $input - * @param int $status - * @return void - */ - public function terminate($input, $status) - { - $this->app->terminate(); - - foreach ($this->commandLifecycleDurationHandlers as ['threshold' => $threshold, 'handler' => $handler]) { - $end ??= Carbon::now(); - - if ($this->commandStartedAt->diffInMilliseconds($end) > $threshold) { - $handler($this->commandStartedAt, $input, $status); - } - } - - $this->commandStartedAt = null; - } - - /** - * Register a callback to be invoked when the command lifecyle duration exceeds a given amount of time. - * - * @param \DateTimeInterface|\Carbon\CarbonInterval|float|int $threshold - * @param callable $handler - * @return void - */ - public function whenCommandLifecycleIsLongerThan($threshold, $handler) - { - $threshold = $threshold instanceof DateTimeInterface - ? $this->secondsUntil($threshold) * 1000 - : $threshold; - - $threshold = $threshold instanceof CarbonInterval - ? $threshold->totalMilliseconds - : $threshold; - - $this->commandLifecycleDurationHandlers[] = [ - 'threshold' => $threshold, - 'handler' => $handler, - ]; - } - - /** - * When the command being handled started. - * - * @return \Illuminate\Support\Carbon|null - */ - public function commandStartedAt() - { - return $this->commandStartedAt; - } - - /** - * Define the application's command schedule. - * - * @param \Illuminate\Console\Scheduling\Schedule $schedule - * @return void - */ - protected function schedule(Schedule $schedule) - { - // - } - - /** - * Get the timezone that should be used by default for scheduled events. - * - * @return \DateTimeZone|string|null - */ - protected function scheduleTimezone() - { - $config = $this->app['config']; - - return $config->get('app.schedule_timezone', $config->get('app.timezone')); - } - - /** - * Register the commands for the application. - * - * @return void - */ - protected function commands() - { - // - } - - /** - * Register a Closure based command with the application. - * - * @param string $signature - * @param \Closure $callback - * @return \Illuminate\Foundation\Console\ClosureCommand - */ - public function command($signature, Closure $callback) - { - $command = new ClosureCommand($signature, $callback); - - Artisan::starting(function ($artisan) use ($command) { - $artisan->add($command); - }); - - return $command; - } - - /** - * Register all of the commands in the given directory. - * - * @param array|string $paths - * @return void - */ - protected function load($paths) - { - $paths = array_unique(Arr::wrap($paths)); - - $paths = array_filter($paths, function ($path) { - return is_dir($path); - }); - - if (empty($paths)) { - return; - } - - $namespace = $this->app->getNamespace(); - - foreach ((new Finder)->in($paths)->files() as $command) { - $command = $namespace.str_replace( - ['/', '.php'], - ['\\', ''], - Str::after($command->getRealPath(), realpath(app_path()).DIRECTORY_SEPARATOR) - ); - - if (is_subclass_of($command, Command::class) && - ! (new ReflectionClass($command))->isAbstract()) { - Artisan::starting(function ($artisan) use ($command) { - $artisan->resolve($command); - }); - } - } - } - - /** - * Register the given command with the console application. - * - * @param \Symfony\Component\Console\Command\Command $command - * @return void - */ - public function registerCommand($command) - { - $this->getArtisan()->add($command); - } - - /** - * Run an Artisan console command by name. - * - * @param string $command - * @param array $parameters - * @param \Symfony\Component\Console\Output\OutputInterface|null $outputBuffer - * @return int - * - * @throws \Symfony\Component\Console\Exception\CommandNotFoundException - */ - public function call($command, array $parameters = [], $outputBuffer = null) - { - if (in_array($command, ['env:encrypt', 'env:decrypt'], true)) { - $this->bootstrapWithoutBootingProviders(); - } - - $this->bootstrap(); - - return $this->getArtisan()->call($command, $parameters, $outputBuffer); - } - - /** - * Queue the given console command. - * - * @param string $command - * @param array $parameters - * @return \Illuminate\Foundation\Bus\PendingDispatch - */ - public function queue($command, array $parameters = []) - { - return QueuedCommand::dispatch(func_get_args()); - } - - /** - * Get all of the commands registered with the console. - * - * @return array - */ - public function all() - { - $this->bootstrap(); - - return $this->getArtisan()->all(); - } - - /** - * Get the output for the last run command. - * - * @return string - */ - public function output() - { - $this->bootstrap(); - - return $this->getArtisan()->output(); - } - - /** - * Bootstrap the application for artisan commands. - * - * @return void - */ - public function bootstrap() - { - if (! $this->app->hasBeenBootstrapped()) { - $this->app->bootstrapWith($this->bootstrappers()); - } - - $this->app->loadDeferredProviders(); - - if (! $this->commandsLoaded) { - $this->commands(); - - $this->commandsLoaded = true; - } - } - - /** - * Bootstrap the application without booting service providers. - * - * @return void - */ - public function bootstrapWithoutBootingProviders() - { - $this->app->bootstrapWith( - collect($this->bootstrappers())->reject(function ($bootstrapper) { - return $bootstrapper === \Illuminate\Foundation\Bootstrap\BootProviders::class; - })->all() - ); - } - - /** - * Get the Artisan application instance. - * - * @return \Illuminate\Console\Application - */ - protected function getArtisan() - { - if (is_null($this->artisan)) { - $this->artisan = (new Artisan($this->app, $this->events, $this->app->version())) - ->resolveCommands($this->commands) - ->setContainerCommandLoader(); - } - - return $this->artisan; - } - - /** - * Set the Artisan application instance. - * - * @param \Illuminate\Console\Application $artisan - * @return void - */ - public function setArtisan($artisan) - { - $this->artisan = $artisan; - } - - /** - * Get the bootstrap classes for the application. - * - * @return array - */ - protected function bootstrappers() - { - return $this->bootstrappers; - } - - /** - * Report the exception to the exception handler. - * - * @param \Throwable $e - * @return void - */ - protected function reportException(Throwable $e) - { - $this->app[ExceptionHandler::class]->report($e); - } - - /** - * Render the given exception. - * - * @param \Symfony\Component\Console\Output\OutputInterface $output - * @param \Throwable $e - * @return void - */ - protected function renderException($output, Throwable $e) - { - $this->app[ExceptionHandler::class]->renderForConsole($output, $e); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/KeyGenerateCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/KeyGenerateCommand.php deleted file mode 100644 index f047bc39..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/KeyGenerateCommand.php +++ /dev/null @@ -1,136 +0,0 @@ -generateRandomKey(); - - if ($this->option('show')) { - return $this->line(''.$key.''); - } - - // Next, we will replace the application key in the environment file so it is - // automatically setup for this developer. This key gets generated using a - // secure random byte generator and is later base64 encoded for storage. - if (! $this->setKeyInEnvironmentFile($key)) { - return; - } - - $this->laravel['config']['app.key'] = $key; - - $this->components->info('Application key set successfully.'); - } - - /** - * Generate a random key for the application. - * - * @return string - */ - protected function generateRandomKey() - { - return 'base64:'.base64_encode( - Encrypter::generateKey($this->laravel['config']['app.cipher']) - ); - } - - /** - * Set the application key in the environment file. - * - * @param string $key - * @return bool - */ - protected function setKeyInEnvironmentFile($key) - { - $currentKey = $this->laravel['config']['app.key']; - - if (strlen($currentKey) !== 0 && (! $this->confirmToProceed())) { - return false; - } - - if (! $this->writeNewEnvironmentFileWith($key)) { - return false; - } - - return true; - } - - /** - * Write a new environment file with the given key. - * - * @param string $key - * @return bool - */ - protected function writeNewEnvironmentFileWith($key) - { - $replaced = preg_replace( - $this->keyReplacementPattern(), - 'APP_KEY='.$key, - $input = file_get_contents($this->laravel->environmentFilePath()) - ); - - if ($replaced === $input || $replaced === null) { - $this->error('Unable to set application key. No APP_KEY variable was found in the .env file.'); - - return false; - } - - file_put_contents($this->laravel->environmentFilePath(), $replaced); - - return true; - } - - /** - * Get a regex pattern that will match env APP_KEY with any random key. - * - * @return string - */ - protected function keyReplacementPattern() - { - $escaped = preg_quote('='.$this->laravel['config']['app.key'], '/'); - - return "/^APP_KEY{$escaped}/m"; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/ListenerMakeCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/ListenerMakeCommand.php deleted file mode 100644 index c5c70424..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/ListenerMakeCommand.php +++ /dev/null @@ -1,128 +0,0 @@ -option('event'); - - if (! Str::startsWith($event, [ - $this->laravel->getNamespace(), - 'Illuminate', - '\\', - ])) { - $event = $this->laravel->getNamespace().'Events\\'.str_replace('/', '\\', $event); - } - - $stub = str_replace( - ['DummyEvent', '{{ event }}'], class_basename($event), parent::buildClass($name) - ); - - return str_replace( - ['DummyFullEvent', '{{ eventNamespace }}'], trim($event, '\\'), $stub - ); - } - - /** - * Get the stub file for the generator. - * - * @return string - */ - protected function getStub() - { - if ($this->option('queued')) { - return $this->option('event') - ? __DIR__.'/stubs/listener-queued.stub' - : __DIR__.'/stubs/listener-queued-duck.stub'; - } - - return $this->option('event') - ? __DIR__.'/stubs/listener.stub' - : __DIR__.'/stubs/listener-duck.stub'; - } - - /** - * Determine if the class already exists. - * - * @param string $rawName - * @return bool - */ - protected function alreadyExists($rawName) - { - return class_exists($rawName); - } - - /** - * Get the default namespace for the class. - * - * @param string $rootNamespace - * @return string - */ - protected function getDefaultNamespace($rootNamespace) - { - return $rootNamespace.'\Listeners'; - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['event', 'e', InputOption::VALUE_OPTIONAL, 'The event class being listened for'], - ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the listener already exists'], - ['queued', null, InputOption::VALUE_NONE, 'Indicates the event listener should be queued'], - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/MailMakeCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/MailMakeCommand.php deleted file mode 100644 index fe098293..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/MailMakeCommand.php +++ /dev/null @@ -1,172 +0,0 @@ -option('force')) { - return; - } - - if ($this->option('markdown') !== false) { - $this->writeMarkdownTemplate(); - } - } - - /** - * Write the Markdown template for the mailable. - * - * @return void - */ - protected function writeMarkdownTemplate() - { - $path = $this->viewPath( - str_replace('.', '/', $this->getView()).'.blade.php' - ); - - if (! $this->files->isDirectory(dirname($path))) { - $this->files->makeDirectory(dirname($path), 0755, true); - } - - $this->files->put($path, file_get_contents(__DIR__.'/stubs/markdown.stub')); - } - - /** - * Build the class with the given name. - * - * @param string $name - * @return string - */ - protected function buildClass($name) - { - $class = str_replace( - '{{ subject }}', - Str::headline(str_replace($this->getNamespace($name).'\\', '', $name)), - parent::buildClass($name) - ); - - if ($this->option('markdown') !== false) { - $class = str_replace(['DummyView', '{{ view }}'], $this->getView(), $class); - } - - return $class; - } - - /** - * Get the view name. - * - * @return string - */ - protected function getView() - { - $view = $this->option('markdown'); - - if (! $view) { - $name = str_replace('\\', '/', $this->argument('name')); - - $view = 'mail.'.collect(explode('/', $name)) - ->map(fn ($part) => Str::kebab($part)) - ->implode('.'); - } - - return $view; - } - - /** - * Get the stub file for the generator. - * - * @return string - */ - protected function getStub() - { - return $this->resolveStubPath( - $this->option('markdown') !== false - ? '/stubs/markdown-mail.stub' - : '/stubs/mail.stub'); - } - - /** - * Resolve the fully-qualified path to the stub. - * - * @param string $stub - * @return string - */ - protected function resolveStubPath($stub) - { - return file_exists($customPath = $this->laravel->basePath(trim($stub, '/'))) - ? $customPath - : __DIR__.$stub; - } - - /** - * Get the default namespace for the class. - * - * @param string $rootNamespace - * @return string - */ - protected function getDefaultNamespace($rootNamespace) - { - return $rootNamespace.'\Mail'; - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the mailable already exists'], - ['markdown', 'm', InputOption::VALUE_OPTIONAL, 'Create a new Markdown template for the mailable', false], - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/ModelMakeCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/ModelMakeCommand.php deleted file mode 100644 index c448a061..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/ModelMakeCommand.php +++ /dev/null @@ -1,236 +0,0 @@ -option('force')) { - return false; - } - - if ($this->option('all')) { - $this->input->setOption('factory', true); - $this->input->setOption('seed', true); - $this->input->setOption('migration', true); - $this->input->setOption('controller', true); - $this->input->setOption('policy', true); - $this->input->setOption('resource', true); - } - - if ($this->option('factory')) { - $this->createFactory(); - } - - if ($this->option('migration')) { - $this->createMigration(); - } - - if ($this->option('seed')) { - $this->createSeeder(); - } - - if ($this->option('controller') || $this->option('resource') || $this->option('api')) { - $this->createController(); - } - - if ($this->option('policy')) { - $this->createPolicy(); - } - } - - /** - * Create a model factory for the model. - * - * @return void - */ - protected function createFactory() - { - $factory = Str::studly($this->argument('name')); - - $this->call('make:factory', [ - 'name' => "{$factory}Factory", - '--model' => $this->qualifyClass($this->getNameInput()), - ]); - } - - /** - * Create a migration file for the model. - * - * @return void - */ - protected function createMigration() - { - $table = Str::snake(Str::pluralStudly(class_basename($this->argument('name')))); - - if ($this->option('pivot')) { - $table = Str::singular($table); - } - - $this->call('make:migration', [ - 'name' => "create_{$table}_table", - '--create' => $table, - '--fullpath' => true, - ]); - } - - /** - * Create a seeder file for the model. - * - * @return void - */ - protected function createSeeder() - { - $seeder = Str::studly(class_basename($this->argument('name'))); - - $this->call('make:seeder', [ - 'name' => "{$seeder}Seeder", - ]); - } - - /** - * Create a controller for the model. - * - * @return void - */ - protected function createController() - { - $controller = Str::studly(class_basename($this->argument('name'))); - - $modelName = $this->qualifyClass($this->getNameInput()); - - $this->call('make:controller', array_filter([ - 'name' => "{$controller}Controller", - '--model' => $this->option('resource') || $this->option('api') ? $modelName : null, - '--api' => $this->option('api'), - '--requests' => $this->option('requests') || $this->option('all'), - ])); - } - - /** - * Create a policy file for the model. - * - * @return void - */ - protected function createPolicy() - { - $policy = Str::studly(class_basename($this->argument('name'))); - - $this->call('make:policy', [ - 'name' => "{$policy}Policy", - '--model' => $this->qualifyClass($this->getNameInput()), - ]); - } - - /** - * Get the stub file for the generator. - * - * @return string - */ - protected function getStub() - { - if ($this->option('pivot')) { - return $this->resolveStubPath('/stubs/model.pivot.stub'); - } - - if ($this->option('morph-pivot')) { - return $this->resolveStubPath('/stubs/model.morph-pivot.stub'); - } - - return $this->resolveStubPath('/stubs/model.stub'); - } - - /** - * Resolve the fully-qualified path to the stub. - * - * @param string $stub - * @return string - */ - protected function resolveStubPath($stub) - { - return file_exists($customPath = $this->laravel->basePath(trim($stub, '/'))) - ? $customPath - : __DIR__.$stub; - } - - /** - * Get the default namespace for the class. - * - * @param string $rootNamespace - * @return string - */ - protected function getDefaultNamespace($rootNamespace) - { - return is_dir(app_path('Models')) ? $rootNamespace.'\\Models' : $rootNamespace; - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['all', 'a', InputOption::VALUE_NONE, 'Generate a migration, seeder, factory, policy, resource controller, and form request classes for the model'], - ['controller', 'c', InputOption::VALUE_NONE, 'Create a new controller for the model'], - ['factory', 'f', InputOption::VALUE_NONE, 'Create a new factory for the model'], - ['force', null, InputOption::VALUE_NONE, 'Create the class even if the model already exists'], - ['migration', 'm', InputOption::VALUE_NONE, 'Create a new migration file for the model'], - ['morph-pivot', null, InputOption::VALUE_NONE, 'Indicates if the generated model should be a custom polymorphic intermediate table model'], - ['policy', null, InputOption::VALUE_NONE, 'Create a new policy for the model'], - ['seed', 's', InputOption::VALUE_NONE, 'Create a new seeder for the model'], - ['pivot', 'p', InputOption::VALUE_NONE, 'Indicates if the generated model should be a custom intermediate table model'], - ['resource', 'r', InputOption::VALUE_NONE, 'Indicates if the generated controller should be a resource controller'], - ['api', null, InputOption::VALUE_NONE, 'Indicates if the generated controller should be an API resource controller'], - ['requests', 'R', InputOption::VALUE_NONE, 'Create new form request classes and use them in the resource controller'], - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/NotificationMakeCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/NotificationMakeCommand.php deleted file mode 100644 index 4bcf5c84..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/NotificationMakeCommand.php +++ /dev/null @@ -1,146 +0,0 @@ -option('force')) { - return; - } - - if ($this->option('markdown')) { - $this->writeMarkdownTemplate(); - } - } - - /** - * Write the Markdown template for the mailable. - * - * @return void - */ - protected function writeMarkdownTemplate() - { - $path = $this->viewPath( - str_replace('.', '/', $this->option('markdown')).'.blade.php' - ); - - if (! $this->files->isDirectory(dirname($path))) { - $this->files->makeDirectory(dirname($path), 0755, true); - } - - $this->files->put($path, file_get_contents(__DIR__.'/stubs/markdown.stub')); - } - - /** - * Build the class with the given name. - * - * @param string $name - * @return string - */ - protected function buildClass($name) - { - $class = parent::buildClass($name); - - if ($this->option('markdown')) { - $class = str_replace(['DummyView', '{{ view }}'], $this->option('markdown'), $class); - } - - return $class; - } - - /** - * Get the stub file for the generator. - * - * @return string - */ - protected function getStub() - { - return $this->option('markdown') - ? $this->resolveStubPath('/stubs/markdown-notification.stub') - : $this->resolveStubPath('/stubs/notification.stub'); - } - - /** - * Resolve the fully-qualified path to the stub. - * - * @param string $stub - * @return string - */ - protected function resolveStubPath($stub) - { - return file_exists($customPath = $this->laravel->basePath(trim($stub, '/'))) - ? $customPath - : __DIR__.$stub; - } - - /** - * Get the default namespace for the class. - * - * @param string $rootNamespace - * @return string - */ - protected function getDefaultNamespace($rootNamespace) - { - return $rootNamespace.'\Notifications'; - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the notification already exists'], - ['markdown', 'm', InputOption::VALUE_OPTIONAL, 'Create a new Markdown template for the notification'], - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/ObserverMakeCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/ObserverMakeCommand.php deleted file mode 100644 index 1187269d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/ObserverMakeCommand.php +++ /dev/null @@ -1,153 +0,0 @@ -option('model'); - - return $model ? $this->replaceModel($stub, $model) : $stub; - } - - /** - * Replace the model for the given stub. - * - * @param string $stub - * @param string $model - * @return string - */ - protected function replaceModel($stub, $model) - { - $modelClass = $this->parseModel($model); - - $replace = [ - 'DummyFullModelClass' => $modelClass, - '{{ namespacedModel }}' => $modelClass, - '{{namespacedModel}}' => $modelClass, - 'DummyModelClass' => class_basename($modelClass), - '{{ model }}' => class_basename($modelClass), - '{{model}}' => class_basename($modelClass), - 'DummyModelVariable' => lcfirst(class_basename($modelClass)), - '{{ modelVariable }}' => lcfirst(class_basename($modelClass)), - '{{modelVariable}}' => lcfirst(class_basename($modelClass)), - ]; - - return str_replace( - array_keys($replace), array_values($replace), $stub - ); - } - - /** - * Get the fully-qualified model class name. - * - * @param string $model - * @return string - * - * @throws \InvalidArgumentException - */ - protected function parseModel($model) - { - if (preg_match('([^A-Za-z0-9_/\\\\])', $model)) { - throw new InvalidArgumentException('Model name contains invalid characters.'); - } - - return $this->qualifyModel($model); - } - - /** - * Get the stub file for the generator. - * - * @return string - */ - protected function getStub() - { - return $this->option('model') - ? $this->resolveStubPath('/stubs/observer.stub') - : $this->resolveStubPath('/stubs/observer.plain.stub'); - } - - /** - * Resolve the fully-qualified path to the stub. - * - * @param string $stub - * @return string - */ - protected function resolveStubPath($stub) - { - return file_exists($customPath = $this->laravel->basePath(trim($stub, '/'))) - ? $customPath - : __DIR__.$stub; - } - - /** - * Get the default namespace for the class. - * - * @param string $rootNamespace - * @return string - */ - protected function getDefaultNamespace($rootNamespace) - { - return $rootNamespace.'\Observers'; - } - - /** - * Get the console command arguments. - * - * @return array - */ - protected function getOptions() - { - return [ - ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the observer already exists'], - ['model', 'm', InputOption::VALUE_OPTIONAL, 'The model that the observer applies to'], - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/OptimizeClearCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/OptimizeClearCommand.php deleted file mode 100644 index d3b039eb..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/OptimizeClearCommand.php +++ /dev/null @@ -1,56 +0,0 @@ -components->info('Clearing cached bootstrap files.'); - - collect([ - 'events' => fn () => $this->callSilent('event:clear') == 0, - 'views' => fn () => $this->callSilent('view:clear') == 0, - 'cache' => fn () => $this->callSilent('cache:clear') == 0, - 'route' => fn () => $this->callSilent('route:clear') == 0, - 'config' => fn () => $this->callSilent('config:clear') == 0, - 'compiled' => fn () => $this->callSilent('clear-compiled') == 0, - ])->each(fn ($task, $description) => $this->components->task($description, $task)); - - $this->newLine(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/OptimizeCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/OptimizeCommand.php deleted file mode 100644 index b487928d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/OptimizeCommand.php +++ /dev/null @@ -1,52 +0,0 @@ -components->info('Caching the framework bootstrap files'); - - collect([ - 'config' => fn () => $this->callSilent('config:cache') == 0, - 'routes' => fn () => $this->callSilent('route:cache') == 0, - ])->each(fn ($task, $description) => $this->components->task($description, $task)); - - $this->newLine(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/PackageDiscoverCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/PackageDiscoverCommand.php deleted file mode 100644 index d9b928f4..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/PackageDiscoverCommand.php +++ /dev/null @@ -1,54 +0,0 @@ -components->info('Discovering packages'); - - $manifest->build(); - - collect($manifest->manifest) - ->keys() - ->each(fn ($description) => $this->components->task($description)) - ->whenNotEmpty(fn () => $this->newLine()); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/PolicyMakeCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/PolicyMakeCommand.php deleted file mode 100644 index 4c895f63..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/PolicyMakeCommand.php +++ /dev/null @@ -1,212 +0,0 @@ -replaceUserNamespace( - parent::buildClass($name) - ); - - $model = $this->option('model'); - - return $model ? $this->replaceModel($stub, $model) : $stub; - } - - /** - * Replace the User model namespace. - * - * @param string $stub - * @return string - */ - protected function replaceUserNamespace($stub) - { - $model = $this->userProviderModel(); - - if (! $model) { - return $stub; - } - - return str_replace( - $this->rootNamespace().'User', - $model, - $stub - ); - } - - /** - * Get the model for the guard's user provider. - * - * @return string|null - * - * @throws \LogicException - */ - protected function userProviderModel() - { - $config = $this->laravel['config']; - - $guard = $this->option('guard') ?: $config->get('auth.defaults.guard'); - - if (is_null($guardProvider = $config->get('auth.guards.'.$guard.'.provider'))) { - throw new LogicException('The ['.$guard.'] guard is not defined in your "auth" configuration file.'); - } - - if (! $config->get('auth.providers.'.$guardProvider.'.model')) { - return 'App\\Models\\User'; - } - - return $config->get( - 'auth.providers.'.$guardProvider.'.model' - ); - } - - /** - * Replace the model for the given stub. - * - * @param string $stub - * @param string $model - * @return string - */ - protected function replaceModel($stub, $model) - { - $model = str_replace('/', '\\', $model); - - if (str_starts_with($model, '\\')) { - $namespacedModel = trim($model, '\\'); - } else { - $namespacedModel = $this->qualifyModel($model); - } - - $model = class_basename(trim($model, '\\')); - - $dummyUser = class_basename($this->userProviderModel()); - - $dummyModel = Str::camel($model) === 'user' ? 'model' : $model; - - $replace = [ - 'NamespacedDummyModel' => $namespacedModel, - '{{ namespacedModel }}' => $namespacedModel, - '{{namespacedModel}}' => $namespacedModel, - 'DummyModel' => $model, - '{{ model }}' => $model, - '{{model}}' => $model, - 'dummyModel' => Str::camel($dummyModel), - '{{ modelVariable }}' => Str::camel($dummyModel), - '{{modelVariable}}' => Str::camel($dummyModel), - 'DummyUser' => $dummyUser, - '{{ user }}' => $dummyUser, - '{{user}}' => $dummyUser, - '$user' => '$'.Str::camel($dummyUser), - ]; - - $stub = str_replace( - array_keys($replace), array_values($replace), $stub - ); - - return preg_replace( - vsprintf('/use %s;[\r\n]+use %s;/', [ - preg_quote($namespacedModel, '/'), - preg_quote($namespacedModel, '/'), - ]), - "use {$namespacedModel};", - $stub - ); - } - - /** - * Get the stub file for the generator. - * - * @return string - */ - protected function getStub() - { - return $this->option('model') - ? $this->resolveStubPath('/stubs/policy.stub') - : $this->resolveStubPath('/stubs/policy.plain.stub'); - } - - /** - * Resolve the fully-qualified path to the stub. - * - * @param string $stub - * @return string - */ - protected function resolveStubPath($stub) - { - return file_exists($customPath = $this->laravel->basePath(trim($stub, '/'))) - ? $customPath - : __DIR__.$stub; - } - - /** - * Get the default namespace for the class. - * - * @param string $rootNamespace - * @return string - */ - protected function getDefaultNamespace($rootNamespace) - { - return $rootNamespace.'\Policies'; - } - - /** - * Get the console command arguments. - * - * @return array - */ - protected function getOptions() - { - return [ - ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the policy already exists'], - ['model', 'm', InputOption::VALUE_OPTIONAL, 'The model that the policy applies to'], - ['guard', 'g', InputOption::VALUE_OPTIONAL, 'The guard that the policy relies on'], - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/ProviderMakeCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/ProviderMakeCommand.php deleted file mode 100644 index a3b99d97..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/ProviderMakeCommand.php +++ /dev/null @@ -1,89 +0,0 @@ -resolveStubPath('/stubs/provider.stub'); - } - - /** - * Resolve the fully-qualified path to the stub. - * - * @param string $stub - * @return string - */ - protected function resolveStubPath($stub) - { - return file_exists($customPath = $this->laravel->basePath(trim($stub, '/'))) - ? $customPath - : __DIR__.$stub; - } - - /** - * Get the default namespace for the class. - * - * @param string $rootNamespace - * @return string - */ - protected function getDefaultNamespace($rootNamespace) - { - return $rootNamespace.'\Providers'; - } - - /** - * Get the console command arguments. - * - * @return array - */ - protected function getOptions() - { - return [ - ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the provider already exists'], - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/QueuedCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/QueuedCommand.php deleted file mode 100644 index fb3d027b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/QueuedCommand.php +++ /dev/null @@ -1,42 +0,0 @@ -data = $data; - } - - /** - * Handle the job. - * - * @param \Illuminate\Contracts\Console\Kernel $kernel - * @return void - */ - public function handle(KernelContract $kernel) - { - $kernel->call(...array_values($this->data)); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/RequestMakeCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/RequestMakeCommand.php deleted file mode 100644 index f181ff0c..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/RequestMakeCommand.php +++ /dev/null @@ -1,89 +0,0 @@ -resolveStubPath('/stubs/request.stub'); - } - - /** - * Resolve the fully-qualified path to the stub. - * - * @param string $stub - * @return string - */ - protected function resolveStubPath($stub) - { - return file_exists($customPath = $this->laravel->basePath(trim($stub, '/'))) - ? $customPath - : __DIR__.$stub; - } - - /** - * Get the default namespace for the class. - * - * @param string $rootNamespace - * @return string - */ - protected function getDefaultNamespace($rootNamespace) - { - return $rootNamespace.'\Http\Requests'; - } - - /** - * Get the console command arguments. - * - * @return array - */ - protected function getOptions() - { - return [ - ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the request already exists'], - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/ResourceMakeCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/ResourceMakeCommand.php deleted file mode 100644 index 9fe4fddb..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/ResourceMakeCommand.php +++ /dev/null @@ -1,117 +0,0 @@ -collection()) { - $this->type = 'Resource collection'; - } - - parent::handle(); - } - - /** - * Get the stub file for the generator. - * - * @return string - */ - protected function getStub() - { - return $this->collection() - ? $this->resolveStubPath('/stubs/resource-collection.stub') - : $this->resolveStubPath('/stubs/resource.stub'); - } - - /** - * Determine if the command is generating a resource collection. - * - * @return bool - */ - protected function collection() - { - return $this->option('collection') || - str_ends_with($this->argument('name'), 'Collection'); - } - - /** - * Resolve the fully-qualified path to the stub. - * - * @param string $stub - * @return string - */ - protected function resolveStubPath($stub) - { - return file_exists($customPath = $this->laravel->basePath(trim($stub, '/'))) - ? $customPath - : __DIR__.$stub; - } - - /** - * Get the default namespace for the class. - * - * @param string $rootNamespace - * @return string - */ - protected function getDefaultNamespace($rootNamespace) - { - return $rootNamespace.'\Http\Resources'; - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the resource already exists'], - ['collection', 'c', InputOption::VALUE_NONE, 'Create a resource collection'], - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/RouteCacheCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/RouteCacheCommand.php deleted file mode 100644 index 00f4050c..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/RouteCacheCommand.php +++ /dev/null @@ -1,122 +0,0 @@ -files = $files; - } - - /** - * Execute the console command. - * - * @return void - */ - public function handle() - { - $this->callSilent('route:clear'); - - $routes = $this->getFreshApplicationRoutes(); - - if (count($routes) === 0) { - return $this->components->error("Your application doesn't have any routes."); - } - - foreach ($routes as $route) { - $route->prepareForSerialization(); - } - - $this->files->put( - $this->laravel->getCachedRoutesPath(), $this->buildRouteCacheFile($routes) - ); - - $this->components->info('Routes cached successfully.'); - } - - /** - * Boot a fresh copy of the application and get the routes. - * - * @return \Illuminate\Routing\RouteCollection - */ - protected function getFreshApplicationRoutes() - { - return tap($this->getFreshApplication()['router']->getRoutes(), function ($routes) { - $routes->refreshNameLookups(); - $routes->refreshActionLookups(); - }); - } - - /** - * Get a fresh application instance. - * - * @return \Illuminate\Contracts\Foundation\Application - */ - protected function getFreshApplication() - { - return tap(require $this->laravel->bootstrapPath().'/app.php', function ($app) { - $app->make(ConsoleKernelContract::class)->bootstrap(); - }); - } - - /** - * Build the route cache file. - * - * @param \Illuminate\Routing\RouteCollection $routes - * @return string - */ - protected function buildRouteCacheFile(RouteCollection $routes) - { - $stub = $this->files->get(__DIR__.'/stubs/routes.stub'); - - return str_replace('{{routes}}', var_export($routes->compile(), true), $stub); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/RouteClearCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/RouteClearCommand.php deleted file mode 100644 index da45e6d8..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/RouteClearCommand.php +++ /dev/null @@ -1,68 +0,0 @@ -files = $files; - } - - /** - * Execute the console command. - * - * @return void - */ - public function handle() - { - $this->files->delete($this->laravel->getCachedRoutesPath()); - - $this->components->info('Route cache cleared successfully.'); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/RouteListCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/RouteListCommand.php deleted file mode 100644 index caa81652..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/RouteListCommand.php +++ /dev/null @@ -1,508 +0,0 @@ - 'red', - 'GET' => 'blue', - 'HEAD' => '#6C7280', - 'OPTIONS' => '#6C7280', - 'POST' => 'yellow', - 'PUT' => 'yellow', - 'PATCH' => 'yellow', - 'DELETE' => 'red', - ]; - - /** - * Create a new route command instance. - * - * @param \Illuminate\Routing\Router $router - * @return void - */ - public function __construct(Router $router) - { - parent::__construct(); - - $this->router = $router; - } - - /** - * Execute the console command. - * - * @return void - */ - public function handle() - { - $this->router->flushMiddlewareGroups(); - - if (! $this->router->getRoutes()->count()) { - return $this->components->error("Your application doesn't have any routes."); - } - - if (empty($routes = $this->getRoutes())) { - return $this->components->error("Your application doesn't have any routes matching the given criteria."); - } - - $this->displayRoutes($routes); - } - - /** - * Compile the routes into a displayable format. - * - * @return array - */ - protected function getRoutes() - { - $routes = collect($this->router->getRoutes())->map(function ($route) { - return $this->getRouteInformation($route); - })->filter()->all(); - - if (($sort = $this->option('sort')) !== null) { - $routes = $this->sortRoutes($sort, $routes); - } else { - $routes = $this->sortRoutes('uri', $routes); - } - - if ($this->option('reverse')) { - $routes = array_reverse($routes); - } - - return $this->pluckColumns($routes); - } - - /** - * Get the route information for a given route. - * - * @param \Illuminate\Routing\Route $route - * @return array - */ - protected function getRouteInformation(Route $route) - { - return $this->filterRoute([ - 'domain' => $route->domain(), - 'method' => implode('|', $route->methods()), - 'uri' => $route->uri(), - 'name' => $route->getName(), - 'action' => ltrim($route->getActionName(), '\\'), - 'middleware' => $this->getMiddleware($route), - 'vendor' => $this->isVendorRoute($route), - ]); - } - - /** - * Sort the routes by a given element. - * - * @param string $sort - * @param array $routes - * @return array - */ - protected function sortRoutes($sort, array $routes) - { - return Arr::sort($routes, function ($route) use ($sort) { - return $route[$sort]; - }); - } - - /** - * Remove unnecessary columns from the routes. - * - * @param array $routes - * @return array - */ - protected function pluckColumns(array $routes) - { - return array_map(function ($route) { - return Arr::only($route, $this->getColumns()); - }, $routes); - } - - /** - * Display the route information on the console. - * - * @param array $routes - * @return void - */ - protected function displayRoutes(array $routes) - { - $routes = collect($routes); - - $this->output->writeln( - $this->option('json') ? $this->asJson($routes) : $this->forCli($routes) - ); - } - - /** - * Get the middleware for the route. - * - * @param \Illuminate\Routing\Route $route - * @return string - */ - protected function getMiddleware($route) - { - return collect($this->router->gatherRouteMiddleware($route))->map(function ($middleware) { - return $middleware instanceof Closure ? 'Closure' : $middleware; - })->implode("\n"); - } - - /** - * Determine if the route has been defined outside of the application. - * - * @param \Illuminate\Routing\Route $route - * @return bool - */ - protected function isVendorRoute(Route $route) - { - if ($route->action['uses'] instanceof Closure) { - $path = (new ReflectionFunction($route->action['uses'])) - ->getFileName(); - } elseif (is_string($route->action['uses']) && - str_contains($route->action['uses'], 'SerializableClosure')) { - return false; - } elseif (is_string($route->action['uses'])) { - if ($this->isFrameworkController($route)) { - return false; - } - - $path = (new ReflectionClass($route->getControllerClass())) - ->getFileName(); - } else { - return false; - } - - return str_starts_with($path, base_path('vendor')); - } - - /** - * Determine if the route uses a framework controller. - * - * @param \Illuminate\Routing\Route $route - * @return bool - */ - protected function isFrameworkController(Route $route) - { - return in_array($route->getControllerClass(), [ - '\Illuminate\Routing\RedirectController', - '\Illuminate\Routing\ViewController', - ], true); - } - - /** - * Filter the route by URI and / or name. - * - * @param array $route - * @return array|null - */ - protected function filterRoute(array $route) - { - if (($this->option('name') && ! Str::contains((string) $route['name'], $this->option('name'))) || - ($this->option('path') && ! Str::contains($route['uri'], $this->option('path'))) || - ($this->option('method') && ! Str::contains($route['method'], strtoupper($this->option('method')))) || - ($this->option('domain') && ! Str::contains((string) $route['domain'], $this->option('domain'))) || - ($this->option('except-vendor') && $route['vendor']) || - ($this->option('only-vendor') && ! $route['vendor'])) { - return; - } - - if ($this->option('except-path')) { - foreach (explode(',', $this->option('except-path')) as $path) { - if (str_contains($route['uri'], $path)) { - return; - } - } - } - - return $route; - } - - /** - * Get the table headers for the visible columns. - * - * @return array - */ - protected function getHeaders() - { - return Arr::only($this->headers, array_keys($this->getColumns())); - } - - /** - * Get the column names to show (lowercase table headers). - * - * @return array - */ - protected function getColumns() - { - return array_map('strtolower', $this->headers); - } - - /** - * Parse the column list. - * - * @param array $columns - * @return array - */ - protected function parseColumns(array $columns) - { - $results = []; - - foreach ($columns as $column) { - if (str_contains($column, ',')) { - $results = array_merge($results, explode(',', $column)); - } else { - $results[] = $column; - } - } - - return array_map('strtolower', $results); - } - - /** - * Convert the given routes to JSON. - * - * @param \Illuminate\Support\Collection $routes - * @return string - */ - protected function asJson($routes) - { - return $routes - ->map(function ($route) { - $route['middleware'] = empty($route['middleware']) ? [] : explode("\n", $route['middleware']); - - return $route; - }) - ->values() - ->toJson(); - } - - /** - * Convert the given routes to regular CLI output. - * - * @param \Illuminate\Support\Collection $routes - * @return array - */ - protected function forCli($routes) - { - $routes = $routes->map( - fn ($route) => array_merge($route, [ - 'action' => $this->formatActionForCli($route), - 'method' => $route['method'] == 'GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS' ? 'ANY' : $route['method'], - 'uri' => $route['domain'] ? ($route['domain'].'/'.ltrim($route['uri'], '/')) : $route['uri'], - ]), - ); - - $maxMethod = mb_strlen($routes->max('method')); - - $terminalWidth = $this->getTerminalWidth(); - - $routeCount = $this->determineRouteCountOutput($routes, $terminalWidth); - - return $routes->map(function ($route) use ($maxMethod, $terminalWidth) { - [ - 'action' => $action, - 'domain' => $domain, - 'method' => $method, - 'middleware' => $middleware, - 'uri' => $uri, - ] = $route; - - $middleware = Str::of($middleware)->explode("\n")->filter()->whenNotEmpty( - fn ($collection) => $collection->map( - fn ($middleware) => sprintf(' %s⇂ %s', str_repeat(' ', $maxMethod), $middleware) - ) - )->implode("\n"); - - $spaces = str_repeat(' ', max($maxMethod + 6 - mb_strlen($method), 0)); - - $dots = str_repeat('.', max( - $terminalWidth - mb_strlen($method.$spaces.$uri.$action) - 6 - ($action ? 1 : 0), 0 - )); - - $dots = empty($dots) ? $dots : " $dots"; - - if ($action && ! $this->output->isVerbose() && mb_strlen($method.$spaces.$uri.$action.$dots) > ($terminalWidth - 6)) { - $action = substr($action, 0, $terminalWidth - 7 - mb_strlen($method.$spaces.$uri.$dots)).'…'; - } - - $method = Str::of($method)->explode('|')->map( - fn ($method) => sprintf('%s', $this->verbColors[$method] ?? 'default', $method), - )->implode('|'); - - return [sprintf( - ' %s %s%s%s %s', - $method, - $spaces, - preg_replace('#({[^}]+})#', '$1', $uri), - $dots, - str_replace(' ', ' › ', $action ?? ''), - ), $this->output->isVerbose() && ! empty($middleware) ? "$middleware" : null]; - }) - ->flatten() - ->filter() - ->prepend('') - ->push('')->push($routeCount)->push('') - ->toArray(); - } - - /** - * Get the formatted action for display on the CLI. - * - * @param array $route - * @return string - */ - protected function formatActionForCli($route) - { - ['action' => $action, 'name' => $name] = $route; - - if ($action === 'Closure' || $action === ViewController::class) { - return $name; - } - - $name = $name ? "$name " : null; - - $rootControllerNamespace = $this->laravel[UrlGenerator::class]->getRootControllerNamespace() - ?? ($this->laravel->getNamespace().'Http\\Controllers'); - - if (str_starts_with($action, $rootControllerNamespace)) { - return $name.substr($action, mb_strlen($rootControllerNamespace) + 1); - } - - $actionClass = explode('@', $action)[0]; - - if (class_exists($actionClass) && str_starts_with((new ReflectionClass($actionClass))->getFilename(), base_path('vendor'))) { - $actionCollection = collect(explode('\\', $action)); - - return $name.$actionCollection->take(2)->implode('\\').' '.$actionCollection->last(); - } - - return $name.$action; - } - - /** - * Determine and return the output for displaying the number of routes in the CLI output. - * - * @param \Illuminate\Support\Collection $routes - * @param int $terminalWidth - * @return string - */ - protected function determineRouteCountOutput($routes, $terminalWidth) - { - $routeCountText = 'Showing ['.$routes->count().'] routes'; - - $offset = $terminalWidth - mb_strlen($routeCountText) - 2; - - $spaces = str_repeat(' ', $offset); - - return $spaces.'Showing ['.$routes->count().'] routes'; - } - - /** - * Get the terminal width. - * - * @return int - */ - public static function getTerminalWidth() - { - return is_null(static::$terminalWidthResolver) - ? (new Terminal)->getWidth() - : call_user_func(static::$terminalWidthResolver); - } - - /** - * Set a callback that should be used when resolving the terminal width. - * - * @param \Closure|null $resolver - * @return void - */ - public static function resolveTerminalWidthUsing($resolver) - { - static::$terminalWidthResolver = $resolver; - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['json', null, InputOption::VALUE_NONE, 'Output the route list as JSON'], - ['method', null, InputOption::VALUE_OPTIONAL, 'Filter the routes by method'], - ['name', null, InputOption::VALUE_OPTIONAL, 'Filter the routes by name'], - ['domain', null, InputOption::VALUE_OPTIONAL, 'Filter the routes by domain'], - ['path', null, InputOption::VALUE_OPTIONAL, 'Only show routes matching the given path pattern'], - ['except-path', null, InputOption::VALUE_OPTIONAL, 'Do not display the routes matching the given path pattern'], - ['reverse', 'r', InputOption::VALUE_NONE, 'Reverse the ordering of the routes'], - ['sort', null, InputOption::VALUE_OPTIONAL, 'The column (domain, method, uri, name, action, middleware) to sort by', 'uri'], - ['except-vendor', null, InputOption::VALUE_NONE, 'Do not display routes defined by vendor packages'], - ['only-vendor', null, InputOption::VALUE_NONE, 'Only display routes defined by vendor packages'], - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/RuleMakeCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/RuleMakeCommand.php deleted file mode 100644 index 5cefd1fa..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/RuleMakeCommand.php +++ /dev/null @@ -1,107 +0,0 @@ -option('implicit') ? 'ImplicitRule' : 'Rule', - parent::buildClass($name) - ); - } - - /** - * Get the stub file for the generator. - * - * @return string - */ - protected function getStub() - { - $stub = '/stubs/rule.stub'; - - if ($this->option('invokable')) { - $stub = '/stubs/rule.invokable.stub'; - } - - if ($this->option('implicit') && $this->option('invokable')) { - $stub = str_replace('.stub', '.implicit.stub', $stub); - } - - return file_exists($customPath = $this->laravel->basePath(trim($stub, '/'))) - ? $customPath - : __DIR__.$stub; - } - - /** - * Get the default namespace for the class. - * - * @param string $rootNamespace - * @return string - */ - protected function getDefaultNamespace($rootNamespace) - { - return $rootNamespace.'\Rules'; - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the rule already exists'], - ['implicit', 'i', InputOption::VALUE_NONE, 'Generate an implicit rule'], - ['invokable', null, InputOption::VALUE_NONE, 'Generate a single method, invokable rule class'], - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/ScopeMakeCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/ScopeMakeCommand.php deleted file mode 100644 index d36742c8..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/ScopeMakeCommand.php +++ /dev/null @@ -1,89 +0,0 @@ -resolveStubPath('/stubs/scope.stub'); - } - - /** - * Resolve the fully-qualified path to the stub. - * - * @param string $stub - * @return string - */ - protected function resolveStubPath($stub) - { - return file_exists($customPath = $this->laravel->basePath(trim($stub, '/'))) - ? $customPath - : __DIR__.$stub; - } - - /** - * Get the default namespace for the class. - * - * @param string $rootNamespace - * @return string - */ - protected function getDefaultNamespace($rootNamespace) - { - return is_dir(app_path('Models')) ? $rootNamespace.'\\Models\\Scopes' : $rootNamespace.'\Scopes'; - } - - /** - * Get the console command arguments. - * - * @return array - */ - protected function getOptions() - { - return [ - ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the scope already exists'], - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/ServeCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/ServeCommand.php deleted file mode 100644 index b3c07993..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/ServeCommand.php +++ /dev/null @@ -1,338 +0,0 @@ - - */ - protected $requestsPool; - - /** - * Indicates if the "Server running on..." output message has been displayed. - * - * @var bool - */ - protected $serverRunningHasBeenDisplayed = false; - - /** - * The environment variables that should be passed from host machine to the PHP server process. - * - * @var string[] - */ - public static $passthroughVariables = [ - 'APP_ENV', - 'LARAVEL_SAIL', - 'PHP_CLI_SERVER_WORKERS', - 'PHP_IDE_CONFIG', - 'SYSTEMROOT', - 'XDEBUG_CONFIG', - 'XDEBUG_MODE', - 'XDEBUG_SESSION', - ]; - - /** - * Execute the console command. - * - * @return int - * - * @throws \Exception - */ - public function handle() - { - $environmentFile = $this->option('env') - ? base_path('.env').'.'.$this->option('env') - : base_path('.env'); - - $hasEnvironment = file_exists($environmentFile); - - $environmentLastModified = $hasEnvironment - ? filemtime($environmentFile) - : now()->addDays(30)->getTimestamp(); - - $process = $this->startProcess($hasEnvironment); - - while ($process->isRunning()) { - if ($hasEnvironment) { - clearstatcache(false, $environmentFile); - } - - if (! $this->option('no-reload') && - $hasEnvironment && - filemtime($environmentFile) > $environmentLastModified) { - $environmentLastModified = filemtime($environmentFile); - - $this->newLine(); - - $this->components->info('Environment modified. Restarting server...'); - - $process->stop(5); - - $this->serverRunningHasBeenDisplayed = false; - - $process = $this->startProcess($hasEnvironment); - } - - usleep(500 * 1000); - } - - $status = $process->getExitCode(); - - if ($status && $this->canTryAnotherPort()) { - $this->portOffset += 1; - - return $this->handle(); - } - - return $status; - } - - /** - * Start a new server process. - * - * @param bool $hasEnvironment - * @return \Symfony\Component\Process\Process - */ - protected function startProcess($hasEnvironment) - { - $process = new Process($this->serverCommand(), public_path(), collect($_ENV)->mapWithKeys(function ($value, $key) use ($hasEnvironment) { - if ($this->option('no-reload') || ! $hasEnvironment) { - return [$key => $value]; - } - - return in_array($key, static::$passthroughVariables) ? [$key => $value] : [$key => false]; - })->all()); - - $process->start($this->handleProcessOutput()); - - return $process; - } - - /** - * Get the full server command. - * - * @return array - */ - protected function serverCommand() - { - $server = file_exists(base_path('server.php')) - ? base_path('server.php') - : __DIR__.'/../resources/server.php'; - - return [ - (new PhpExecutableFinder)->find(false), - '-S', - $this->host().':'.$this->port(), - $server, - ]; - } - - /** - * Get the host for the command. - * - * @return string - */ - protected function host() - { - [$host] = $this->getHostAndPort(); - - return $host; - } - - /** - * Get the port for the command. - * - * @return string - */ - protected function port() - { - $port = $this->input->getOption('port'); - - if (is_null($port)) { - [, $port] = $this->getHostAndPort(); - } - - $port = $port ?: 8000; - - return $port + $this->portOffset; - } - - /** - * Get the host and port from the host option string. - * - * @return array - */ - protected function getHostAndPort() - { - $hostParts = explode(':', $this->input->getOption('host')); - - return [ - $hostParts[0], - $hostParts[1] ?? null, - ]; - } - - /** - * Check if the command has reached its maximum number of port tries. - * - * @return bool - */ - protected function canTryAnotherPort() - { - return is_null($this->input->getOption('port')) && - ($this->input->getOption('tries') > $this->portOffset); - } - - /** - * Returns a "callable" to handle the process output. - * - * @return callable(string, string): void - */ - protected function handleProcessOutput() - { - return fn ($type, $buffer) => str($buffer)->explode("\n")->each(function ($line) { - if (str($line)->contains('Development Server (http')) { - if ($this->serverRunningHasBeenDisplayed) { - return; - } - - $this->components->info("Server running on [http://{$this->host()}:{$this->port()}]."); - $this->comment(' Press Ctrl+C to stop the server'); - - $this->newLine(); - - $this->serverRunningHasBeenDisplayed = true; - } elseif (str($line)->contains(' Accepted')) { - $requestPort = $this->getRequestPortFromLine($line); - - $this->requestsPool[$requestPort] = [ - $this->getDateFromLine($line), - false, - ]; - } elseif (str($line)->contains([' [200]: GET '])) { - $requestPort = $this->getRequestPortFromLine($line); - - $this->requestsPool[$requestPort][1] = trim(explode('[200]: GET', $line)[1]); - } elseif (str($line)->contains(' Closing')) { - $requestPort = $this->getRequestPortFromLine($line); - $request = $this->requestsPool[$requestPort]; - - [$startDate, $file] = $request; - - $formattedStartedAt = $startDate->format('Y-m-d H:i:s'); - - unset($this->requestsPool[$requestPort]); - - [$date, $time] = explode(' ', $formattedStartedAt); - - $this->output->write(" $date $time"); - - $runTime = $this->getDateFromLine($line)->diffInSeconds($startDate); - - if ($file) { - $this->output->write($file = " $file"); - } - - $dots = max(terminal()->width() - mb_strlen($formattedStartedAt) - mb_strlen($file) - mb_strlen($runTime) - 9, 0); - - $this->output->write(' '.str_repeat('.', $dots)); - $this->output->writeln(" ~ {$runTime}s"); - } elseif (str($line)->contains(['Closed without sending a request'])) { - // ... - } elseif (! empty($line)) { - $warning = explode('] ', $line); - $this->components->warn(count($warning) > 1 ? $warning[1] : $warning[0]); - } - }); - } - - /** - * Get the date from the given PHP server output. - * - * @param string $line - * @return \Illuminate\Support\Carbon - */ - protected function getDateFromLine($line) - { - $regex = env('PHP_CLI_SERVER_WORKERS', 1) > 1 - ? '/^\[\d+]\s\[([a-zA-Z0-9: ]+)\]/' - : '/^\[([^\]]+)\]/'; - - preg_match($regex, $line, $matches); - - return Carbon::createFromFormat('D M d H:i:s Y', $matches[1]); - } - - /** - * Get the request port from the given PHP server output. - * - * @param string $line - * @return int - */ - protected function getRequestPortFromLine($line) - { - preg_match('/:(\d+)\s(?:(?:\w+$)|(?:\[.*))/', $line, $matches); - - return (int) $matches[1]; - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['host', null, InputOption::VALUE_OPTIONAL, 'The host address to serve the application on', Env::get('SERVER_HOST', '127.0.0.1')], - ['port', null, InputOption::VALUE_OPTIONAL, 'The port to serve the application on', Env::get('SERVER_PORT')], - ['tries', null, InputOption::VALUE_OPTIONAL, 'The max number of ports to attempt to serve from', 10], - ['no-reload', null, InputOption::VALUE_NONE, 'Do not reload the development server on .env file changes'], - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/ShowModelCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/ShowModelCommand.php deleted file mode 100644 index 495f6545..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/ShowModelCommand.php +++ /dev/null @@ -1,547 +0,0 @@ -ensureDependenciesExist()) { - return 1; - } - - $class = $this->qualifyModel($this->argument('model')); - - try { - $model = $this->laravel->make($class); - - $class = get_class($model); - } catch (BindingResolutionException $e) { - return $this->components->error($e->getMessage()); - } - - if ($this->option('database')) { - $model->setConnection($this->option('database')); - } - - $this->display( - $class, - $model->getConnection()->getName(), - $model->getConnection()->getTablePrefix().$model->getTable(), - $this->getPolicy($model), - $this->getAttributes($model), - $this->getRelations($model), - $this->getObservers($model), - ); - } - - /** - * Get the first policy associated with this model. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @return Illuminate\Support\Collection - */ - protected function getPolicy($model) - { - return collect(Gate::policies()) - ->filter(fn ($policy, $modelClass) => $modelClass === get_class($model)) - ->values() - ->first(); - } - - /** - * Get the column attributes for the given model. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @return \Illuminate\Support\Collection - */ - protected function getAttributes($model) - { - $schema = $model->getConnection()->getDoctrineSchemaManager(); - $this->registerTypeMappings($schema->getDatabasePlatform()); - $table = $model->getConnection()->getTablePrefix().$model->getTable(); - $columns = $schema->listTableColumns($table); - $indexes = $schema->listTableIndexes($table); - - return collect($columns) - ->values() - ->map(fn (Column $column) => [ - 'name' => $column->getName(), - 'type' => $this->getColumnType($column), - 'increments' => $column->getAutoincrement(), - 'nullable' => ! $column->getNotnull(), - 'default' => $this->getColumnDefault($column, $model), - 'unique' => $this->columnIsUnique($column->getName(), $indexes), - 'fillable' => $model->isFillable($column->getName()), - 'hidden' => $this->attributeIsHidden($column->getName(), $model), - 'appended' => null, - 'cast' => $this->getCastType($column->getName(), $model), - ]) - ->merge($this->getVirtualAttributes($model, $columns)); - } - - /** - * Get the virtual (non-column) attributes for the given model. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @param \Doctrine\DBAL\Schema\Column[] $columns - * @return \Illuminate\Support\Collection - */ - protected function getVirtualAttributes($model, $columns) - { - $class = new ReflectionClass($model); - - return collect($class->getMethods()) - ->reject( - fn (ReflectionMethod $method) => $method->isStatic() - || $method->isAbstract() - || $method->getDeclaringClass()->getName() !== get_class($model) - ) - ->mapWithKeys(function (ReflectionMethod $method) use ($model) { - if (preg_match('/^get(.+)Attribute$/', $method->getName(), $matches) === 1) { - return [Str::snake($matches[1]) => 'accessor']; - } elseif ($model->hasAttributeMutator($method->getName())) { - return [Str::snake($method->getName()) => 'attribute']; - } else { - return []; - } - }) - ->reject(fn ($cast, $name) => collect($columns)->has($name)) - ->map(fn ($cast, $name) => [ - 'name' => $name, - 'type' => null, - 'increments' => false, - 'nullable' => null, - 'default' => null, - 'unique' => null, - 'fillable' => $model->isFillable($name), - 'hidden' => $this->attributeIsHidden($name, $model), - 'appended' => $model->hasAppended($name), - 'cast' => $cast, - ]) - ->values(); - } - - /** - * Get the relations from the given model. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @return \Illuminate\Support\Collection - */ - protected function getRelations($model) - { - return collect(get_class_methods($model)) - ->map(fn ($method) => new ReflectionMethod($model, $method)) - ->reject( - fn (ReflectionMethod $method) => $method->isStatic() - || $method->isAbstract() - || $method->getDeclaringClass()->getName() !== get_class($model) - ) - ->filter(function (ReflectionMethod $method) { - $file = new SplFileObject($method->getFileName()); - $file->seek($method->getStartLine() - 1); - $code = ''; - while ($file->key() < $method->getEndLine()) { - $code .= $file->current(); - $file->next(); - } - - return collect($this->relationMethods) - ->contains(fn ($relationMethod) => str_contains($code, '$this->'.$relationMethod.'(')); - }) - ->map(function (ReflectionMethod $method) use ($model) { - $relation = $method->invoke($model); - - if (! $relation instanceof Relation) { - return null; - } - - return [ - 'name' => $method->getName(), - 'type' => Str::afterLast(get_class($relation), '\\'), - 'related' => get_class($relation->getRelated()), - ]; - }) - ->filter() - ->values(); - } - - /** - * Get the Observers watching this model. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @return Illuminate\Support\Collection - */ - protected function getObservers($model) - { - $listeners = $this->getLaravel()->make('events')->getRawListeners(); - - // Get the Eloquent observers for this model... - $listeners = array_filter($listeners, function ($v, $key) use ($model) { - return Str::startsWith($key, 'eloquent.') && Str::endsWith($key, $model::class); - }, ARRAY_FILTER_USE_BOTH); - - // Format listeners Eloquent verb => Observer methods... - $extractVerb = function ($key) { - preg_match('/eloquent.([a-zA-Z]+)\: /', $key, $matches); - - return $matches[1] ?? '?'; - }; - - $formatted = []; - - foreach ($listeners as $key => $observerMethods) { - $formatted[] = [ - 'event' => $extractVerb($key), - 'observer' => array_map(fn ($obs) => is_string($obs) ? $obs : 'Closure', $observerMethods), - ]; - } - - return collect($formatted); - } - - /** - * Render the model information. - * - * @param string $class - * @param string $database - * @param string $table - * @param string $policy - * @param \Illuminate\Support\Collection $attributes - * @param \Illuminate\Support\Collection $relations - * @param \Illuminate\Support\Collection $observers - * @return void - */ - protected function display($class, $database, $table, $policy, $attributes, $relations, $observers) - { - $this->option('json') - ? $this->displayJson($class, $database, $table, $policy, $attributes, $relations, $observers) - : $this->displayCli($class, $database, $table, $policy, $attributes, $relations, $observers); - } - - /** - * Render the model information as JSON. - * - * @param string $class - * @param string $database - * @param string $table - * @param string $policy - * @param \Illuminate\Support\Collection $attributes - * @param \Illuminate\Support\Collection $relations - * @param \Illuminate\Support\Collection $observers - * @return void - */ - protected function displayJson($class, $database, $table, $policy, $attributes, $relations, $observers) - { - $this->output->writeln( - collect([ - 'class' => $class, - 'database' => $database, - 'table' => $table, - 'policy' => $policy, - 'attributes' => $attributes, - 'relations' => $relations, - 'observers' => $observers, - ])->toJson() - ); - } - - /** - * Render the model information for the CLI. - * - * @param string $class - * @param string $database - * @param string $table - * @param string $policy - * @param \Illuminate\Support\Collection $attributes - * @param \Illuminate\Support\Collection $relations - * @param \Illuminate\Support\Collection $observers - * @return void - */ - protected function displayCli($class, $database, $table, $policy, $attributes, $relations, $observers) - { - $this->newLine(); - - $this->components->twoColumnDetail(''.$class.''); - $this->components->twoColumnDetail('Database', $database); - $this->components->twoColumnDetail('Table', $table); - - if ($policy) { - $this->components->twoColumnDetail('Policy', $policy); - } - - $this->newLine(); - - $this->components->twoColumnDetail( - 'Attributes', - 'type / cast', - ); - - foreach ($attributes as $attribute) { - $first = trim(sprintf( - '%s %s', - $attribute['name'], - collect(['increments', 'unique', 'nullable', 'fillable', 'hidden', 'appended']) - ->filter(fn ($property) => $attribute[$property]) - ->map(fn ($property) => sprintf('%s', $property)) - ->implode(', ') - )); - - $second = collect([ - $attribute['type'], - $attribute['cast'] ? ''.$attribute['cast'].'' : null, - ])->filter()->implode(' / '); - - $this->components->twoColumnDetail($first, $second); - - if ($attribute['default'] !== null) { - $this->components->bulletList( - [sprintf('default: %s', $attribute['default'])], - OutputInterface::VERBOSITY_VERBOSE - ); - } - } - - $this->newLine(); - - $this->components->twoColumnDetail('Relations'); - - foreach ($relations as $relation) { - $this->components->twoColumnDetail( - sprintf('%s %s', $relation['name'], $relation['type']), - $relation['related'] - ); - } - - $this->newLine(); - - $this->components->twoColumnDetail('Observers'); - - if ($observers->count()) { - foreach ($observers as $observer) { - $this->components->twoColumnDetail( - sprintf('%s', $observer['event']), - implode(', ', $observer['observer']) - ); - } - } - - $this->newLine(); - } - - /** - * Get the cast type for the given column. - * - * @param string $column - * @param \Illuminate\Database\Eloquent\Model $model - * @return string|null - */ - protected function getCastType($column, $model) - { - if ($model->hasGetMutator($column) || $model->hasSetMutator($column)) { - return 'accessor'; - } - - if ($model->hasAttributeMutator($column)) { - return 'attribute'; - } - - return $this->getCastsWithDates($model)->get($column) ?? null; - } - - /** - * Get the model casts, including any date casts. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @return \Illuminate\Support\Collection - */ - protected function getCastsWithDates($model) - { - return collect($model->getDates()) - ->filter() - ->flip() - ->map(fn () => 'datetime') - ->merge($model->getCasts()); - } - - /** - * Get the type of the given column. - * - * @param \Doctrine\DBAL\Schema\Column $column - * @return string - */ - protected function getColumnType($column) - { - $name = $column->getType()->getName(); - - $unsigned = $column->getUnsigned() ? ' unsigned' : ''; - - $details = match (get_class($column->getType())) { - DecimalType::class => $column->getPrecision().','.$column->getScale(), - default => $column->getLength(), - }; - - if ($details) { - return sprintf('%s(%s)%s', $name, $details, $unsigned); - } - - return sprintf('%s%s', $name, $unsigned); - } - - /** - * Get the default value for the given column. - * - * @param \Doctrine\DBAL\Schema\Column $column - * @param \Illuminate\Database\Eloquent\Model $model - * @return mixed|null - */ - protected function getColumnDefault($column, $model) - { - $attributeDefault = $model->getAttributes()[$column->getName()] ?? null; - - return match (true) { - $attributeDefault instanceof BackedEnum => $attributeDefault->value, - $attributeDefault instanceof UnitEnum => $attributeDefault->name, - default => $attributeDefault ?? $column->getDefault(), - }; - } - - /** - * Determine if the given attribute is hidden. - * - * @param string $attribute - * @param \Illuminate\Database\Eloquent\Model $model - * @return bool - */ - protected function attributeIsHidden($attribute, $model) - { - if (count($model->getHidden()) > 0) { - return in_array($attribute, $model->getHidden()); - } - - if (count($model->getVisible()) > 0) { - return ! in_array($attribute, $model->getVisible()); - } - - return false; - } - - /** - * Determine if the given attribute is unique. - * - * @param string $column - * @param \Doctrine\DBAL\Schema\Index[] $indexes - * @return bool - */ - protected function columnIsUnique($column, $indexes) - { - return collect($indexes) - ->filter(fn (Index $index) => count($index->getColumns()) === 1 && $index->getColumns()[0] === $column) - ->contains(fn (Index $index) => $index->isUnique()); - } - - /** - * Qualify the given model class base name. - * - * @param string $model - * @return string - * - * @see \Illuminate\Console\GeneratorCommand - */ - protected function qualifyModel(string $model) - { - if (str_contains($model, '\\') && class_exists($model)) { - return $model; - } - - $model = ltrim($model, '\\/'); - - $model = str_replace('/', '\\', $model); - - $rootNamespace = $this->laravel->getNamespace(); - - if (Str::startsWith($model, $rootNamespace)) { - return $model; - } - - return is_dir(app_path('Models')) - ? $rootNamespace.'Models\\'.$model - : $rootNamespace.$model; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/StorageLinkCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/StorageLinkCommand.php deleted file mode 100644 index 10427557..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/StorageLinkCommand.php +++ /dev/null @@ -1,89 +0,0 @@ -option('relative'); - - foreach ($this->links() as $link => $target) { - if (file_exists($link) && ! $this->isRemovableSymlink($link, $this->option('force'))) { - $this->components->error("The [$link] link already exists."); - continue; - } - - if (is_link($link)) { - $this->laravel->make('files')->delete($link); - } - - if ($relative) { - $this->laravel->make('files')->relativeLink($target, $link); - } else { - $this->laravel->make('files')->link($target, $link); - } - - $this->components->info("The [$link] link has been connected to [$target]."); - } - } - - /** - * Get the symbolic links that are configured for the application. - * - * @return array - */ - protected function links() - { - return $this->laravel['config']['filesystems.links'] ?? - [public_path('storage') => storage_path('app/public')]; - } - - /** - * Determine if the provided path is a symlink that can be removed. - * - * @param string $link - * @param bool $force - * @return bool - */ - protected function isRemovableSymlink(string $link, bool $force): bool - { - return is_link($link) && $force; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/StubPublishCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/StubPublishCommand.php deleted file mode 100644 index fe0755bf..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/StubPublishCommand.php +++ /dev/null @@ -1,105 +0,0 @@ -laravel->basePath('stubs'))) { - (new Filesystem)->makeDirectory($stubsPath); - } - - $files = [ - __DIR__.'/stubs/cast.inbound.stub' => $stubsPath.'/cast.inbound.stub', - __DIR__.'/stubs/cast.stub' => $stubsPath.'/cast.stub', - __DIR__.'/stubs/console.stub' => $stubsPath.'/console.stub', - __DIR__.'/stubs/event.stub' => $stubsPath.'/event.stub', - __DIR__.'/stubs/job.queued.stub' => $stubsPath.'/job.queued.stub', - __DIR__.'/stubs/job.stub' => $stubsPath.'/job.stub', - __DIR__.'/stubs/mail.stub' => $stubsPath.'/mail.stub', - __DIR__.'/stubs/markdown-mail.stub' => $stubsPath.'/markdown-mail.stub', - __DIR__.'/stubs/markdown-notification.stub' => $stubsPath.'/markdown-notification.stub', - __DIR__.'/stubs/model.pivot.stub' => $stubsPath.'/model.pivot.stub', - __DIR__.'/stubs/model.stub' => $stubsPath.'/model.stub', - __DIR__.'/stubs/notification.stub' => $stubsPath.'/notification.stub', - __DIR__.'/stubs/observer.plain.stub' => $stubsPath.'/observer.plain.stub', - __DIR__.'/stubs/observer.stub' => $stubsPath.'/observer.stub', - __DIR__.'/stubs/policy.plain.stub' => $stubsPath.'/policy.plain.stub', - __DIR__.'/stubs/policy.stub' => $stubsPath.'/policy.stub', - __DIR__.'/stubs/provider.stub' => $stubsPath.'/provider.stub', - __DIR__.'/stubs/request.stub' => $stubsPath.'/request.stub', - __DIR__.'/stubs/resource.stub' => $stubsPath.'/resource.stub', - __DIR__.'/stubs/resource-collection.stub' => $stubsPath.'/resource-collection.stub', - __DIR__.'/stubs/rule.stub' => $stubsPath.'/rule.stub', - __DIR__.'/stubs/scope.stub' => $stubsPath.'/scope.stub', - __DIR__.'/stubs/test.stub' => $stubsPath.'/test.stub', - __DIR__.'/stubs/test.unit.stub' => $stubsPath.'/test.unit.stub', - __DIR__.'/stubs/view-component.stub' => $stubsPath.'/view-component.stub', - realpath(__DIR__.'/../../Database/Console/Factories/stubs/factory.stub') => $stubsPath.'/factory.stub', - realpath(__DIR__.'/../../Database/Console/Seeds/stubs/seeder.stub') => $stubsPath.'/seeder.stub', - realpath(__DIR__.'/../../Database/Migrations/stubs/migration.create.stub') => $stubsPath.'/migration.create.stub', - realpath(__DIR__.'/../../Database/Migrations/stubs/migration.stub') => $stubsPath.'/migration.stub', - realpath(__DIR__.'/../../Database/Migrations/stubs/migration.update.stub') => $stubsPath.'/migration.update.stub', - realpath(__DIR__.'/../../Routing/Console/stubs/controller.api.stub') => $stubsPath.'/controller.api.stub', - realpath(__DIR__.'/../../Routing/Console/stubs/controller.invokable.stub') => $stubsPath.'/controller.invokable.stub', - realpath(__DIR__.'/../../Routing/Console/stubs/controller.model.api.stub') => $stubsPath.'/controller.model.api.stub', - realpath(__DIR__.'/../../Routing/Console/stubs/controller.model.stub') => $stubsPath.'/controller.model.stub', - realpath(__DIR__.'/../../Routing/Console/stubs/controller.nested.api.stub') => $stubsPath.'/controller.nested.api.stub', - realpath(__DIR__.'/../../Routing/Console/stubs/controller.nested.singleton.api.stub') => $stubsPath.'/controller.stub', - realpath(__DIR__.'/../../Routing/Console/stubs/controller.nested.singleton.stub') => $stubsPath.'/controller.stub', - realpath(__DIR__.'/../../Routing/Console/stubs/controller.nested.stub') => $stubsPath.'/controller.nested.stub', - realpath(__DIR__.'/../../Routing/Console/stubs/controller.plain.stub') => $stubsPath.'/controller.plain.stub', - realpath(__DIR__.'/../../Routing/Console/stubs/controller.singleton.api.stub') => $stubsPath.'/controller.stub', - realpath(__DIR__.'/../../Routing/Console/stubs/controller.singleton.stub') => $stubsPath.'/controller.stub', - realpath(__DIR__.'/../../Routing/Console/stubs/controller.stub') => $stubsPath.'/controller.stub', - realpath(__DIR__.'/../../Routing/Console/stubs/middleware.stub') => $stubsPath.'/middleware.stub', - ]; - - foreach ($files as $from => $to) { - if ((! $this->option('existing') && (! file_exists($to) || $this->option('force'))) - || ($this->option('existing') && file_exists($to))) { - file_put_contents($to, file_get_contents($from)); - } - } - - $this->components->info('Stubs published successfully.'); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/TestMakeCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/TestMakeCommand.php deleted file mode 100644 index ae8bcf2a..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/TestMakeCommand.php +++ /dev/null @@ -1,123 +0,0 @@ -option('unit') ? '.unit.stub' : '.stub'; - - return $this->option('pest') - ? $this->resolveStubPath('/stubs/pest'.$suffix) - : $this->resolveStubPath('/stubs/test'.$suffix); - } - - /** - * Resolve the fully-qualified path to the stub. - * - * @param string $stub - * @return string - */ - protected function resolveStubPath($stub) - { - return file_exists($customPath = $this->laravel->basePath(trim($stub, '/'))) - ? $customPath - : __DIR__.$stub; - } - - /** - * Get the destination class path. - * - * @param string $name - * @return string - */ - protected function getPath($name) - { - $name = Str::replaceFirst($this->rootNamespace(), '', $name); - - return base_path('tests').str_replace('\\', '/', $name).'.php'; - } - - /** - * Get the default namespace for the class. - * - * @param string $rootNamespace - * @return string - */ - protected function getDefaultNamespace($rootNamespace) - { - if ($this->option('unit')) { - return $rootNamespace.'\Unit'; - } else { - return $rootNamespace.'\Feature'; - } - } - - /** - * Get the root namespace for the class. - * - * @return string - */ - protected function rootNamespace() - { - return 'Tests'; - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the test already exists'], - ['unit', 'u', InputOption::VALUE_NONE, 'Create a unit test'], - ['pest', 'p', InputOption::VALUE_NONE, 'Create a Pest test'], - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/UpCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/UpCommand.php deleted file mode 100644 index 000d3c62..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/UpCommand.php +++ /dev/null @@ -1,72 +0,0 @@ -laravel->maintenanceMode()->active()) { - $this->components->info('Application is already up.'); - - return 0; - } - - $this->laravel->maintenanceMode()->deactivate(); - - if (is_file(storage_path('framework/maintenance.php'))) { - unlink(storage_path('framework/maintenance.php')); - } - - $this->laravel->get('events')->dispatch(new MaintenanceModeDisabled()); - - $this->components->info('Application is now live.'); - } catch (Exception $e) { - $this->components->error(sprintf( - 'Failed to disable maintenance mode: %s.', - $e->getMessage(), - )); - - return 1; - } - - return 0; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/VendorPublishCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/VendorPublishCommand.php deleted file mode 100644 index ad41fa77..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/VendorPublishCommand.php +++ /dev/null @@ -1,339 +0,0 @@ -files = $files; - } - - /** - * Execute the console command. - * - * @return void - */ - public function handle() - { - $this->determineWhatShouldBePublished(); - - foreach ($this->tags ?: [null] as $tag) { - $this->publishTag($tag); - } - } - - /** - * Determine the provider or tag(s) to publish. - * - * @return void - */ - protected function determineWhatShouldBePublished() - { - if ($this->option('all')) { - return; - } - - [$this->provider, $this->tags] = [ - $this->option('provider'), (array) $this->option('tag'), - ]; - - if (! $this->provider && ! $this->tags) { - $this->promptForProviderOrTag(); - } - } - - /** - * Prompt for which provider or tag to publish. - * - * @return void - */ - protected function promptForProviderOrTag() - { - $choice = $this->components->choice( - "Which provider or tag's files would you like to publish?", - $choices = $this->publishableChoices() - ); - - if ($choice == $choices[0] || is_null($choice)) { - return; - } - - $this->parseChoice($choice); - } - - /** - * The choices available via the prompt. - * - * @return array - */ - protected function publishableChoices() - { - return array_merge( - ['Publish files from all providers and tags listed below'], - preg_filter('/^/', 'Provider: ', Arr::sort(ServiceProvider::publishableProviders())), - preg_filter('/^/', 'Tag: ', Arr::sort(ServiceProvider::publishableGroups())) - ); - } - - /** - * Parse the answer that was given via the prompt. - * - * @param string $choice - * @return void - */ - protected function parseChoice($choice) - { - [$type, $value] = explode(': ', strip_tags($choice)); - - if ($type === 'Provider') { - $this->provider = $value; - } elseif ($type === 'Tag') { - $this->tags = [$value]; - } - } - - /** - * Publishes the assets for a tag. - * - * @param string $tag - * @return mixed - */ - protected function publishTag($tag) - { - $published = false; - - $pathsToPublish = $this->pathsToPublish($tag); - - if ($publishing = count($pathsToPublish) > 0) { - $this->components->info(sprintf( - 'Publishing %sassets', - $tag ? "[$tag] " : '', - )); - } - - foreach ($pathsToPublish as $from => $to) { - $this->publishItem($from, $to); - } - - if ($publishing === false) { - $this->components->info('No publishable resources for tag ['.$tag.'].'); - } else { - $this->laravel['events']->dispatch(new VendorTagPublished($tag, $pathsToPublish)); - - $this->newLine(); - } - } - - /** - * Get all of the paths to publish. - * - * @param string $tag - * @return array - */ - protected function pathsToPublish($tag) - { - return ServiceProvider::pathsToPublish( - $this->provider, $tag - ); - } - - /** - * Publish the given item from and to the given location. - * - * @param string $from - * @param string $to - * @return void - */ - protected function publishItem($from, $to) - { - if ($this->files->isFile($from)) { - return $this->publishFile($from, $to); - } elseif ($this->files->isDirectory($from)) { - return $this->publishDirectory($from, $to); - } - - $this->components->error("Can't locate path: <{$from}>"); - } - - /** - * Publish the file to the given path. - * - * @param string $from - * @param string $to - * @return void - */ - protected function publishFile($from, $to) - { - if ((! $this->option('existing') && (! $this->files->exists($to) || $this->option('force'))) - || ($this->option('existing') && $this->files->exists($to))) { - $this->createParentDirectory(dirname($to)); - - $this->files->copy($from, $to); - - $this->status($from, $to, 'file'); - } else { - if ($this->option('existing')) { - $this->components->twoColumnDetail(sprintf( - 'File [%s] does not exist', - str_replace(base_path().'/', '', $to), - ), 'SKIPPED'); - } else { - $this->components->twoColumnDetail(sprintf( - 'File [%s] already exists', - str_replace(base_path().'/', '', realpath($to)), - ), 'SKIPPED'); - } - } - } - - /** - * Publish the directory to the given directory. - * - * @param string $from - * @param string $to - * @return void - */ - protected function publishDirectory($from, $to) - { - $visibility = PortableVisibilityConverter::fromArray([], Visibility::PUBLIC); - - $this->moveManagedFiles(new MountManager([ - 'from' => new Flysystem(new LocalAdapter($from)), - 'to' => new Flysystem(new LocalAdapter($to, $visibility)), - ])); - - $this->status($from, $to, 'directory'); - } - - /** - * Move all the files in the given MountManager. - * - * @param \League\Flysystem\MountManager $manager - * @return void - */ - protected function moveManagedFiles($manager) - { - foreach ($manager->listContents('from://', true) as $file) { - $path = Str::after($file['path'], 'from://'); - - if ( - $file['type'] === 'file' - && ( - (! $this->option('existing') && (! $manager->fileExists('to://'.$path) || $this->option('force'))) - || ($this->option('existing') && $manager->fileExists('to://'.$path)) - ) - ) { - $manager->write('to://'.$path, $manager->read($file['path'])); - } - } - } - - /** - * Create the directory to house the published files if needed. - * - * @param string $directory - * @return void - */ - protected function createParentDirectory($directory) - { - if (! $this->files->isDirectory($directory)) { - $this->files->makeDirectory($directory, 0755, true); - } - } - - /** - * Write a status message to the console. - * - * @param string $from - * @param string $to - * @param string $type - * @return void - */ - protected function status($from, $to, $type) - { - $from = str_replace(base_path().'/', '', realpath($from)); - - $to = str_replace(base_path().'/', '', realpath($to)); - - $this->components->task(sprintf( - 'Copying %s [%s] to [%s]', - $type, - $from, - $to, - )); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/ViewCacheCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/ViewCacheCommand.php deleted file mode 100644 index 03f8d75d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/ViewCacheCommand.php +++ /dev/null @@ -1,113 +0,0 @@ -callSilent('view:clear'); - - $this->paths()->each(function ($path) { - $prefix = $this->output->isVeryVerbose() ? 'DIR ' : ''; - - $this->components->task($prefix.$path, null, OutputInterface::VERBOSITY_VERBOSE); - - $this->compileViews($this->bladeFilesIn([$path])); - }); - - $this->newLine(); - - $this->components->info('Blade templates cached successfully.'); - } - - /** - * Compile the given view files. - * - * @param \Illuminate\Support\Collection $views - * @return void - */ - protected function compileViews(Collection $views) - { - $compiler = $this->laravel['view']->getEngineResolver()->resolve('blade')->getCompiler(); - - $views->map(function (SplFileInfo $file) use ($compiler) { - $this->components->task(' '.$file->getRelativePathname(), null, OutputInterface::VERBOSITY_VERY_VERBOSE); - - $compiler->compile($file->getRealPath()); - }); - - if ($this->output->isVeryVerbose()) { - $this->newLine(); - } - } - - /** - * Get the Blade files in the given path. - * - * @param array $paths - * @return \Illuminate\Support\Collection - */ - protected function bladeFilesIn(array $paths) - { - return collect( - Finder::create() - ->in($paths) - ->exclude('vendor') - ->name('*.blade.php') - ->files() - ); - } - - /** - * Get all of the possible view paths. - * - * @return \Illuminate\Support\Collection - */ - protected function paths() - { - $finder = $this->laravel['view']->getFinder(); - - return collect($finder->getPaths())->merge( - collect($finder->getHints())->flatten() - ); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/ViewClearCommand.php b/vendor/laravel/framework/src/Illuminate/Foundation/Console/ViewClearCommand.php deleted file mode 100644 index 2480f965..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/ViewClearCommand.php +++ /dev/null @@ -1,83 +0,0 @@ -files = $files; - } - - /** - * Execute the console command. - * - * @return void - * - * @throws \RuntimeException - */ - public function handle() - { - $path = $this->laravel['config']['view.compiled']; - - if (! $path) { - throw new RuntimeException('View path not found.'); - } - - $this->laravel['view.engine.resolver'] - ->resolve('blade') - ->forgetCompiledOrNotExpired(); - - foreach ($this->files->glob("{$path}/*") as $view) { - $this->files->delete($view); - } - - $this->components->info('Compiled views cleared successfully.'); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/cast.inbound.stub b/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/cast.inbound.stub deleted file mode 100644 index c456e3c5..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/cast.inbound.stub +++ /dev/null @@ -1,22 +0,0 @@ -= time()) { - return; - } -} - -// Redirect to the proper path if necessary... -if (isset($data['redirect']) && $_SERVER['REQUEST_URI'] !== $data['redirect']) { - http_response_code(302); - header('Location: '.$data['redirect']); - - exit; -} - -// Output the prerendered template... -http_response_code($data['status'] ?? 503); - -if (isset($data['retry'])) { - header('Retry-After: '.$data['retry']); -} - -if (isset($data['refresh'])) { - header('Refresh: '.$data['refresh']); -} - -echo $data['template']; - -exit; diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/markdown-mail.stub b/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/markdown-mail.stub deleted file mode 100644 index 76b6ccc5..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/markdown-mail.stub +++ /dev/null @@ -1,59 +0,0 @@ -markdown('{{ view }}'); - } - - /** - * Get the array representation of the notification. - * - * @param mixed $notifiable - * @return array - */ - public function toArray($notifiable) - { - return [ - // - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/markdown.stub b/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/markdown.stub deleted file mode 100644 index de9a155b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/markdown.stub +++ /dev/null @@ -1,12 +0,0 @@ - -# Introduction - -The body of your message. - - -Button Text - - -Thanks,
-{{ config('app.name') }} -
diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/model.morph-pivot.stub b/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/model.morph-pivot.stub deleted file mode 100644 index eb3f1f59..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/model.morph-pivot.stub +++ /dev/null @@ -1,10 +0,0 @@ -line('The introduction to the notification.') - ->action('Notification Action', url('/')) - ->line('Thank you for using our application!'); - } - - /** - * Get the array representation of the notification. - * - * @param mixed $notifiable - * @return array - */ - public function toArray($notifiable) - { - return [ - // - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/observer.plain.stub b/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/observer.plain.stub deleted file mode 100644 index e2506b70..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/observer.plain.stub +++ /dev/null @@ -1,8 +0,0 @@ -get('/'); - - $response->assertStatus(200); -}); diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/pest.unit.stub b/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/pest.unit.stub deleted file mode 100644 index 61cd84c3..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/pest.unit.stub +++ /dev/null @@ -1,5 +0,0 @@ -toBeTrue(); -}); diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/policy.plain.stub b/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/policy.plain.stub deleted file mode 100644 index b014d859..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/policy.plain.stub +++ /dev/null @@ -1,21 +0,0 @@ - - */ - public function rules() - { - return [ - // - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/resource-collection.stub b/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/resource-collection.stub deleted file mode 100644 index ddec9614..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/resource-collection.stub +++ /dev/null @@ -1,19 +0,0 @@ -setCompiledRoutes( - {{routes}} -); diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/rule.invokable.implicit.stub b/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/rule.invokable.implicit.stub deleted file mode 100644 index 077cae59..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/rule.invokable.implicit.stub +++ /dev/null @@ -1,28 +0,0 @@ -get('/'); - - $response->assertStatus(200); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/test.unit.stub b/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/test.unit.stub deleted file mode 100644 index b6816aa7..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/test.unit.stub +++ /dev/null @@ -1,18 +0,0 @@ -assertTrue(true); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/view-component.stub b/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/view-component.stub deleted file mode 100644 index eab8fd35..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/view-component.stub +++ /dev/null @@ -1,28 +0,0 @@ -detectConsoleEnvironment($callback, $consoleArgs); - } - - return $this->detectWebEnvironment($callback); - } - - /** - * Set the application environment for a web request. - * - * @param \Closure $callback - * @return string - */ - protected function detectWebEnvironment(Closure $callback) - { - return $callback(); - } - - /** - * Set the application environment from command-line arguments. - * - * @param \Closure $callback - * @param array $args - * @return string - */ - protected function detectConsoleEnvironment(Closure $callback, array $args) - { - // First we will check if an environment argument was passed via console arguments - // and if it was that automatically overrides as the environment. Otherwise, we - // will check the environment as a "web" request like a typical HTTP request. - if (! is_null($value = $this->getEnvironmentArgument($args))) { - return $value; - } - - return $this->detectWebEnvironment($callback); - } - - /** - * Get the environment argument from the console. - * - * @param array $args - * @return string|null - */ - protected function getEnvironmentArgument(array $args) - { - foreach ($args as $i => $value) { - if ($value === '--env') { - return $args[$i + 1] ?? null; - } - - if (str_starts_with($value, '--env')) { - return head(array_slice(explode('=', $value), 1)); - } - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Events/DiscoverEvents.php b/vendor/laravel/framework/src/Illuminate/Foundation/Events/DiscoverEvents.php deleted file mode 100644 index fae42069..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Events/DiscoverEvents.php +++ /dev/null @@ -1,98 +0,0 @@ -files()->in($listenerPath), $basePath - )); - - $discoveredEvents = []; - - foreach ($listeners as $listener => $events) { - foreach ($events as $event) { - if (! isset($discoveredEvents[$event])) { - $discoveredEvents[$event] = []; - } - - $discoveredEvents[$event][] = $listener; - } - } - - return $discoveredEvents; - } - - /** - * Get all of the listeners and their corresponding events. - * - * @param iterable $listeners - * @param string $basePath - * @return array - */ - protected static function getListenerEvents($listeners, $basePath) - { - $listenerEvents = []; - - foreach ($listeners as $listener) { - try { - $listener = new ReflectionClass( - static::classFromFile($listener, $basePath) - ); - } catch (ReflectionException $e) { - continue; - } - - if (! $listener->isInstantiable()) { - continue; - } - - foreach ($listener->getMethods(ReflectionMethod::IS_PUBLIC) as $method) { - if ((! Str::is('handle*', $method->name) && ! Str::is('__invoke', $method->name)) || - ! isset($method->getParameters()[0])) { - continue; - } - - $listenerEvents[$listener->name.'@'.$method->name] = - Reflector::getParameterClassNames($method->getParameters()[0]); - } - } - - return array_filter($listenerEvents); - } - - /** - * Extract the class name from the given file path. - * - * @param \SplFileInfo $file - * @param string $basePath - * @return string - */ - protected static function classFromFile(SplFileInfo $file, $basePath) - { - $class = trim(Str::replaceFirst($basePath, '', $file->getRealPath()), DIRECTORY_SEPARATOR); - - return str_replace( - [DIRECTORY_SEPARATOR, ucfirst(basename(app()->path())).'\\'], - ['\\', app()->getNamespace()], - ucfirst(Str::replaceLast('.php', '', $class)) - ); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Events/Dispatchable.php b/vendor/laravel/framework/src/Illuminate/Foundation/Events/Dispatchable.php deleted file mode 100644 index ff633150..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Events/Dispatchable.php +++ /dev/null @@ -1,54 +0,0 @@ -locale = $locale; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Events/MaintenanceModeDisabled.php b/vendor/laravel/framework/src/Illuminate/Foundation/Events/MaintenanceModeDisabled.php deleted file mode 100644 index f8edf47d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Events/MaintenanceModeDisabled.php +++ /dev/null @@ -1,8 +0,0 @@ -tag = $tag; - $this->paths = $paths; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php b/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php deleted file mode 100644 index 5325ddca..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php +++ /dev/null @@ -1,767 +0,0 @@ -> - */ - protected $dontReport = []; - - /** - * The callbacks that should be used during reporting. - * - * @var \Illuminate\Foundation\Exceptions\ReportableHandler[] - */ - protected $reportCallbacks = []; - - /** - * A map of exceptions with their corresponding custom log levels. - * - * @var array, \Psr\Log\LogLevel::*> - */ - protected $levels = []; - - /** - * The callbacks that should be used during rendering. - * - * @var \Closure[] - */ - protected $renderCallbacks = []; - - /** - * The registered exception mappings. - * - * @var array - */ - protected $exceptionMap = []; - - /** - * A list of the internal exception types that should not be reported. - * - * @var array> - */ - protected $internalDontReport = [ - AuthenticationException::class, - AuthorizationException::class, - BackedEnumCaseNotFoundException::class, - HttpException::class, - HttpResponseException::class, - ModelNotFoundException::class, - MultipleRecordsFoundException::class, - RecordsNotFoundException::class, - SuspiciousOperationException::class, - TokenMismatchException::class, - ValidationException::class, - ]; - - /** - * A list of the inputs that are never flashed for validation exceptions. - * - * @var array - */ - protected $dontFlash = [ - 'current_password', - 'password', - 'password_confirmation', - ]; - - /** - * Create a new exception handler instance. - * - * @param \Illuminate\Contracts\Container\Container $container - * @return void - */ - public function __construct(Container $container) - { - $this->container = $container; - - $this->register(); - } - - /** - * Register the exception handling callbacks for the application. - * - * @return void - */ - public function register() - { - // - } - - /** - * Register a reportable callback. - * - * @param callable $reportUsing - * @return \Illuminate\Foundation\Exceptions\ReportableHandler - */ - public function reportable(callable $reportUsing) - { - if (! $reportUsing instanceof Closure) { - $reportUsing = Closure::fromCallable($reportUsing); - } - - return tap(new ReportableHandler($reportUsing), function ($callback) { - $this->reportCallbacks[] = $callback; - }); - } - - /** - * Register a renderable callback. - * - * @param callable $renderUsing - * @return $this - */ - public function renderable(callable $renderUsing) - { - if (! $renderUsing instanceof Closure) { - $renderUsing = Closure::fromCallable($renderUsing); - } - - $this->renderCallbacks[] = $renderUsing; - - return $this; - } - - /** - * Register a new exception mapping. - * - * @param \Closure|string $from - * @param \Closure|string|null $to - * @return $this - * - * @throws \InvalidArgumentException - */ - public function map($from, $to = null) - { - if (is_string($to)) { - $to = fn ($exception) => new $to('', 0, $exception); - } - - if (is_callable($from) && is_null($to)) { - $from = $this->firstClosureParameterType($to = $from); - } - - if (! is_string($from) || ! $to instanceof Closure) { - throw new InvalidArgumentException('Invalid exception mapping.'); - } - - $this->exceptionMap[$from] = $to; - - return $this; - } - - /** - * Indicate that the given exception type should not be reported. - * - * @param string $class - * @return $this - */ - public function ignore(string $class) - { - $this->dontReport[] = $class; - - return $this; - } - - /** - * Set the log level for the given exception type. - * - * @param class-string<\Throwable> $type - * @param \Psr\Log\LogLevel::* $level - * @return $this - */ - public function level($type, $level) - { - $this->levels[$type] = $level; - - return $this; - } - - /** - * Report or log an exception. - * - * @param \Throwable $e - * @return void - * - * @throws \Throwable - */ - public function report(Throwable $e) - { - $e = $this->mapException($e); - - if ($this->shouldntReport($e)) { - return; - } - - if (Reflector::isCallable($reportCallable = [$e, 'report']) && - $this->container->call($reportCallable) !== false) { - return; - } - - foreach ($this->reportCallbacks as $reportCallback) { - if ($reportCallback->handles($e) && $reportCallback($e) === false) { - return; - } - } - - try { - $logger = $this->container->make(LoggerInterface::class); - } catch (Exception $ex) { - throw $e; - } - - $level = Arr::first( - $this->levels, fn ($level, $type) => $e instanceof $type, LogLevel::ERROR - ); - - $context = $this->buildExceptionContext($e); - - method_exists($logger, $level) - ? $logger->{$level}($e->getMessage(), $context) - : $logger->log($level, $e->getMessage(), $context); - } - - /** - * Determine if the exception should be reported. - * - * @param \Throwable $e - * @return bool - */ - public function shouldReport(Throwable $e) - { - return ! $this->shouldntReport($e); - } - - /** - * Determine if the exception is in the "do not report" list. - * - * @param \Throwable $e - * @return bool - */ - protected function shouldntReport(Throwable $e) - { - $dontReport = array_merge($this->dontReport, $this->internalDontReport); - - return ! is_null(Arr::first($dontReport, fn ($type) => $e instanceof $type)); - } - - /** - * Create the context array for logging the given exception. - * - * @param \Throwable $e - * @return array - */ - protected function buildExceptionContext(Throwable $e) - { - return array_merge( - $this->exceptionContext($e), - $this->context(), - ['exception' => $e] - ); - } - - /** - * Get the default exception context variables for logging. - * - * @param \Throwable $e - * @return array - */ - protected function exceptionContext(Throwable $e) - { - if (method_exists($e, 'context')) { - return $e->context(); - } - - return []; - } - - /** - * Get the default context variables for logging. - * - * @return array - */ - protected function context() - { - try { - return array_filter([ - 'userId' => Auth::id(), - ]); - } catch (Throwable $e) { - return []; - } - } - - /** - * Render an exception into an HTTP response. - * - * @param \Illuminate\Http\Request $request - * @param \Throwable $e - * @return \Symfony\Component\HttpFoundation\Response - * - * @throws \Throwable - */ - public function render($request, Throwable $e) - { - if (method_exists($e, 'render') && $response = $e->render($request)) { - return Router::toResponse($request, $response); - } - - if ($e instanceof Responsable) { - return $e->toResponse($request); - } - - $e = $this->prepareException($this->mapException($e)); - - if ($response = $this->renderViaCallbacks($request, $e)) { - return $response; - } - - return match (true) { - $e instanceof HttpResponseException => $e->getResponse(), - $e instanceof AuthenticationException => $this->unauthenticated($request, $e), - $e instanceof ValidationException => $this->convertValidationExceptionToResponse($e, $request), - default => $this->renderExceptionResponse($request, $e), - }; - } - - /** - * Prepare exception for rendering. - * - * @param \Throwable $e - * @return \Throwable - */ - protected function prepareException(Throwable $e) - { - return match (true) { - $e instanceof BackedEnumCaseNotFoundException => new NotFoundHttpException($e->getMessage(), $e), - $e instanceof ModelNotFoundException => new NotFoundHttpException($e->getMessage(), $e), - $e instanceof AuthorizationException && $e->hasStatus() => new HttpException( - $e->status(), $e->response()?->message() ?: (Response::$statusTexts[$e->status()] ?? 'Whoops, looks like something went wrong.'), $e - ), - $e instanceof AuthorizationException && ! $e->hasStatus() => new AccessDeniedHttpException($e->getMessage(), $e), - $e instanceof TokenMismatchException => new HttpException(419, $e->getMessage(), $e), - $e instanceof SuspiciousOperationException => new NotFoundHttpException('Bad hostname provided.', $e), - $e instanceof RecordsNotFoundException => new NotFoundHttpException('Not found.', $e), - default => $e, - }; - } - - /** - * Map the exception using a registered mapper if possible. - * - * @param \Throwable $e - * @return \Throwable - */ - protected function mapException(Throwable $e) - { - if (method_exists($e, 'getInnerException') && - ($inner = $e->getInnerException()) instanceof Throwable) { - return $inner; - } - - foreach ($this->exceptionMap as $class => $mapper) { - if (is_a($e, $class)) { - return $mapper($e); - } - } - - return $e; - } - - /** - * Try to render a response from request and exception via render callbacks. - * - * @param \Illuminate\Http\Request $request - * @param \Throwable $e - * @return mixed - * - * @throws \ReflectionException - */ - protected function renderViaCallbacks($request, Throwable $e) - { - foreach ($this->renderCallbacks as $renderCallback) { - foreach ($this->firstClosureParameterTypes($renderCallback) as $type) { - if (is_a($e, $type)) { - $response = $renderCallback($e, $request); - - if (! is_null($response)) { - return $response; - } - } - } - } - } - - /** - * Render a default exception response if any. - * - * @param \Illuminate\Http\Request $request - * @param \Throwable $e - * @return \Symfony\Component\HttpFoundation\Response - */ - protected function renderExceptionResponse($request, Throwable $e) - { - return $this->shouldReturnJson($request, $e) - ? $this->prepareJsonResponse($request, $e) - : $this->prepareResponse($request, $e); - } - - /** - * Convert an authentication exception into a response. - * - * @param \Illuminate\Http\Request $request - * @param \Illuminate\Auth\AuthenticationException $exception - * @return \Symfony\Component\HttpFoundation\Response - */ - protected function unauthenticated($request, AuthenticationException $exception) - { - return $this->shouldReturnJson($request, $exception) - ? response()->json(['message' => $exception->getMessage()], 401) - : redirect()->guest($exception->redirectTo() ?? route('login')); - } - - /** - * Create a response object from the given validation exception. - * - * @param \Illuminate\Validation\ValidationException $e - * @param \Illuminate\Http\Request $request - * @return \Symfony\Component\HttpFoundation\Response - */ - protected function convertValidationExceptionToResponse(ValidationException $e, $request) - { - if ($e->response) { - return $e->response; - } - - return $this->shouldReturnJson($request, $e) - ? $this->invalidJson($request, $e) - : $this->invalid($request, $e); - } - - /** - * Convert a validation exception into a response. - * - * @param \Illuminate\Http\Request $request - * @param \Illuminate\Validation\ValidationException $exception - * @return \Illuminate\Http\Response - */ - protected function invalid($request, ValidationException $exception) - { - return redirect($exception->redirectTo ?? url()->previous()) - ->withInput(Arr::except($request->input(), $this->dontFlash)) - ->withErrors($exception->errors(), $request->input('_error_bag', $exception->errorBag)); - } - - /** - * Convert a validation exception into a JSON response. - * - * @param \Illuminate\Http\Request $request - * @param \Illuminate\Validation\ValidationException $exception - * @return \Illuminate\Http\JsonResponse - */ - protected function invalidJson($request, ValidationException $exception) - { - return response()->json([ - 'message' => $exception->getMessage(), - 'errors' => $exception->errors(), - ], $exception->status); - } - - /** - * Determine if the exception handler response should be JSON. - * - * @param \Illuminate\Http\Request $request - * @param \Throwable $e - * @return bool - */ - protected function shouldReturnJson($request, Throwable $e) - { - return $request->expectsJson(); - } - - /** - * Prepare a response for the given exception. - * - * @param \Illuminate\Http\Request $request - * @param \Throwable $e - * @return \Symfony\Component\HttpFoundation\Response - */ - protected function prepareResponse($request, Throwable $e) - { - if (! $this->isHttpException($e) && config('app.debug')) { - return $this->toIlluminateResponse($this->convertExceptionToResponse($e), $e)->prepare($request); - } - - if (! $this->isHttpException($e)) { - $e = new HttpException(500, $e->getMessage()); - } - - return $this->toIlluminateResponse( - $this->renderHttpException($e), $e - )->prepare($request); - } - - /** - * Create a Symfony response for the given exception. - * - * @param \Throwable $e - * @return \Symfony\Component\HttpFoundation\Response - */ - protected function convertExceptionToResponse(Throwable $e) - { - return new SymfonyResponse( - $this->renderExceptionContent($e), - $this->isHttpException($e) ? $e->getStatusCode() : 500, - $this->isHttpException($e) ? $e->getHeaders() : [] - ); - } - - /** - * Get the response content for the given exception. - * - * @param \Throwable $e - * @return string - */ - protected function renderExceptionContent(Throwable $e) - { - try { - return config('app.debug') && app()->has(ExceptionRenderer::class) - ? $this->renderExceptionWithCustomRenderer($e) - : $this->renderExceptionWithSymfony($e, config('app.debug')); - } catch (Throwable $e) { - return $this->renderExceptionWithSymfony($e, config('app.debug')); - } - } - - /** - * Render an exception to a string using the registered `ExceptionRenderer`. - * - * @param \Throwable $e - * @return string - */ - protected function renderExceptionWithCustomRenderer(Throwable $e) - { - return app(ExceptionRenderer::class)->render($e); - } - - /** - * Render an exception to a string using Symfony. - * - * @param \Throwable $e - * @param bool $debug - * @return string - */ - protected function renderExceptionWithSymfony(Throwable $e, $debug) - { - $renderer = new HtmlErrorRenderer($debug); - - return $renderer->render($e)->getAsString(); - } - - /** - * Render the given HttpException. - * - * @param \Symfony\Component\HttpKernel\Exception\HttpExceptionInterface $e - * @return \Symfony\Component\HttpFoundation\Response - */ - protected function renderHttpException(HttpExceptionInterface $e) - { - $this->registerErrorViewPaths(); - - if ($view = $this->getHttpExceptionView($e)) { - return response()->view($view, [ - 'errors' => new ViewErrorBag, - 'exception' => $e, - ], $e->getStatusCode(), $e->getHeaders()); - } - - return $this->convertExceptionToResponse($e); - } - - /** - * Register the error template hint paths. - * - * @return void - */ - protected function registerErrorViewPaths() - { - (new RegisterErrorViewPaths)(); - } - - /** - * Get the view used to render HTTP exceptions. - * - * @param \Symfony\Component\HttpKernel\Exception\HttpExceptionInterface $e - * @return string|null - */ - protected function getHttpExceptionView(HttpExceptionInterface $e) - { - $view = 'errors::'.$e->getStatusCode(); - - if (view()->exists($view)) { - return $view; - } - - $view = substr($view, 0, -2).'xx'; - - if (view()->exists($view)) { - return $view; - } - - return null; - } - - /** - * Map the given exception into an Illuminate response. - * - * @param \Symfony\Component\HttpFoundation\Response $response - * @param \Throwable $e - * @return \Illuminate\Http\Response - */ - protected function toIlluminateResponse($response, Throwable $e) - { - if ($response instanceof SymfonyRedirectResponse) { - $response = new RedirectResponse( - $response->getTargetUrl(), $response->getStatusCode(), $response->headers->all() - ); - } else { - $response = new Response( - $response->getContent(), $response->getStatusCode(), $response->headers->all() - ); - } - - return $response->withException($e); - } - - /** - * Prepare a JSON response for the given exception. - * - * @param \Illuminate\Http\Request $request - * @param \Throwable $e - * @return \Illuminate\Http\JsonResponse - */ - protected function prepareJsonResponse($request, Throwable $e) - { - return new JsonResponse( - $this->convertExceptionToArray($e), - $this->isHttpException($e) ? $e->getStatusCode() : 500, - $this->isHttpException($e) ? $e->getHeaders() : [], - JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES - ); - } - - /** - * Convert the given exception to an array. - * - * @param \Throwable $e - * @return array - */ - protected function convertExceptionToArray(Throwable $e) - { - return config('app.debug') ? [ - 'message' => $e->getMessage(), - 'exception' => get_class($e), - 'file' => $e->getFile(), - 'line' => $e->getLine(), - 'trace' => collect($e->getTrace())->map(fn ($trace) => Arr::except($trace, ['args']))->all(), - ] : [ - 'message' => $this->isHttpException($e) ? $e->getMessage() : 'Server Error', - ]; - } - - /** - * Render an exception to the console. - * - * @param \Symfony\Component\Console\Output\OutputInterface $output - * @param \Throwable $e - * @return void - * - * @internal This method is not meant to be used or overwritten outside the framework. - */ - public function renderForConsole($output, Throwable $e) - { - if ($e instanceof CommandNotFoundException) { - $message = str($e->getMessage())->explode('.')->first(); - - if (! empty($alternatives = $e->getAlternatives())) { - $message .= '. Did you mean one of these?'; - - with(new Error($output))->render($message); - with(new BulletList($output))->render($e->getAlternatives()); - - $output->writeln(''); - } else { - with(new Error($output))->render($message); - } - - return; - } - - (new ConsoleApplication)->renderThrowable($e, $output); - } - - /** - * Determine if the given exception is an HTTP exception. - * - * @param \Throwable $e - * @return bool - */ - protected function isHttpException(Throwable $e) - { - return $e instanceof HttpExceptionInterface; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/RegisterErrorViewPaths.php b/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/RegisterErrorViewPaths.php deleted file mode 100644 index c88f3261..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/RegisterErrorViewPaths.php +++ /dev/null @@ -1,20 +0,0 @@ -map(function ($path) { - return "{$path}/errors"; - })->push(__DIR__.'/views')->all()); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/ReportableHandler.php b/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/ReportableHandler.php deleted file mode 100644 index 06a6172f..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/ReportableHandler.php +++ /dev/null @@ -1,82 +0,0 @@ -callback = $callback; - } - - /** - * Invoke the handler. - * - * @param \Throwable $e - * @return bool - */ - public function __invoke(Throwable $e) - { - $result = call_user_func($this->callback, $e); - - if ($result === false) { - return false; - } - - return ! $this->shouldStop; - } - - /** - * Determine if the callback handles the given exception. - * - * @param \Throwable $e - * @return bool - */ - public function handles(Throwable $e) - { - foreach ($this->firstClosureParameterTypes($this->callback) as $type) { - if (is_a($e, $type)) { - return true; - } - } - - return false; - } - - /** - * Indicate that report handling should stop after invoking this callback. - * - * @return $this - */ - public function stop() - { - $this->shouldStop = true; - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Whoops/WhoopsExceptionRenderer.php b/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Whoops/WhoopsExceptionRenderer.php deleted file mode 100644 index 908d9a26..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Whoops/WhoopsExceptionRenderer.php +++ /dev/null @@ -1,37 +0,0 @@ -appendHandler($this->whoopsHandler()); - - $whoops->writeToOutput(false); - - $whoops->allowQuit(false); - })->handleException($throwable); - } - - /** - * Get the Whoops handler for the application. - * - * @return \Whoops\Handler\Handler - */ - protected function whoopsHandler() - { - return (new WhoopsHandler)->forDebug(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Whoops/WhoopsHandler.php b/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Whoops/WhoopsHandler.php deleted file mode 100644 index 40ee9f2f..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Whoops/WhoopsHandler.php +++ /dev/null @@ -1,86 +0,0 @@ -handleUnconditionally(true); - - $this->registerApplicationPaths($handler) - ->registerBlacklist($handler) - ->registerEditor($handler); - }); - } - - /** - * Register the application paths with the handler. - * - * @param \Whoops\Handler\PrettyPageHandler $handler - * @return $this - */ - protected function registerApplicationPaths($handler) - { - $handler->setApplicationPaths( - array_flip($this->directoriesExceptVendor()) - ); - - return $this; - } - - /** - * Get the application paths except for the "vendor" directory. - * - * @return array - */ - protected function directoriesExceptVendor() - { - return Arr::except( - array_flip((new Filesystem)->directories(base_path())), - [base_path('vendor')] - ); - } - - /** - * Register the blacklist with the handler. - * - * @param \Whoops\Handler\PrettyPageHandler $handler - * @return $this - */ - protected function registerBlacklist($handler) - { - foreach (config('app.debug_blacklist', config('app.debug_hide', [])) as $key => $secrets) { - foreach ($secrets as $secret) { - $handler->blacklist($key, $secret); - } - } - - return $this; - } - - /** - * Register the editor with the handler. - * - * @param \Whoops\Handler\PrettyPageHandler $handler - * @return $this - */ - protected function registerEditor($handler) - { - if (config('app.editor', false)) { - $handler->setEditor(config('app.editor')); - } - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/401.blade.php b/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/401.blade.php deleted file mode 100644 index 5c586db9..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/401.blade.php +++ /dev/null @@ -1,5 +0,0 @@ -@extends('errors::minimal') - -@section('title', __('Unauthorized')) -@section('code', '401') -@section('message', __('Unauthorized')) diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/403.blade.php b/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/403.blade.php deleted file mode 100644 index a5506f01..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/403.blade.php +++ /dev/null @@ -1,5 +0,0 @@ -@extends('errors::minimal') - -@section('title', __('Forbidden')) -@section('code', '403') -@section('message', __($exception->getMessage() ?: 'Forbidden')) diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/404.blade.php b/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/404.blade.php deleted file mode 100644 index 7549540d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/404.blade.php +++ /dev/null @@ -1,5 +0,0 @@ -@extends('errors::minimal') - -@section('title', __('Not Found')) -@section('code', '404') -@section('message', __('Not Found')) diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/419.blade.php b/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/419.blade.php deleted file mode 100644 index c09216e2..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/419.blade.php +++ /dev/null @@ -1,5 +0,0 @@ -@extends('errors::minimal') - -@section('title', __('Page Expired')) -@section('code', '419') -@section('message', __('Page Expired')) diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/429.blade.php b/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/429.blade.php deleted file mode 100644 index f01b07b8..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/429.blade.php +++ /dev/null @@ -1,5 +0,0 @@ -@extends('errors::minimal') - -@section('title', __('Too Many Requests')) -@section('code', '429') -@section('message', __('Too Many Requests')) diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/500.blade.php b/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/500.blade.php deleted file mode 100644 index d9e95d9b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/500.blade.php +++ /dev/null @@ -1,5 +0,0 @@ -@extends('errors::minimal') - -@section('title', __('Server Error')) -@section('code', '500') -@section('message', __('Server Error')) diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/503.blade.php b/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/503.blade.php deleted file mode 100644 index c5a9dde1..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/503.blade.php +++ /dev/null @@ -1,5 +0,0 @@ -@extends('errors::minimal') - -@section('title', __('Service Unavailable')) -@section('code', '503') -@section('message', __('Service Unavailable')) diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/layout.blade.php b/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/layout.blade.php deleted file mode 100644 index 019c2cde..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/layout.blade.php +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - @yield('title') - - - - - -
-
-
- @yield('message') -
-
-
- - diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/minimal.blade.php b/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/minimal.blade.php deleted file mode 100644 index db69f254..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/minimal.blade.php +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - @yield('title') - - - - - - -
-
-
-
- @yield('code') -
- -
- @yield('message') -
-
-
-
- - diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/FileBasedMaintenanceMode.php b/vendor/laravel/framework/src/Illuminate/Foundation/FileBasedMaintenanceMode.php deleted file mode 100644 index c63522ce..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/FileBasedMaintenanceMode.php +++ /dev/null @@ -1,64 +0,0 @@ -path(), - json_encode($payload, JSON_PRETTY_PRINT) - ); - } - - /** - * Take the application out of maintenance. - * - * @return void - */ - public function deactivate(): void - { - if ($this->active()) { - unlink($this->path()); - } - } - - /** - * Determine if the application is currently down for maintenance. - * - * @return bool - */ - public function active(): bool - { - return file_exists($this->path()); - } - - /** - * Get the data array which was provided when the application was placed into maintenance. - * - * @return array - */ - public function data(): array - { - return json_decode(file_get_contents($this->path()), true); - } - - /** - * Get the path where the file is stored that signals that the application is down for maintenance. - * - * @return string - */ - protected function path(): string - { - return storage_path('framework/down'); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Http/Events/RequestHandled.php b/vendor/laravel/framework/src/Illuminate/Foundation/Http/Events/RequestHandled.php deleted file mode 100644 index d6f71e03..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Http/Events/RequestHandled.php +++ /dev/null @@ -1,33 +0,0 @@ -request = $request; - $this->response = $response; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Http/Exceptions/MaintenanceModeException.php b/vendor/laravel/framework/src/Illuminate/Foundation/Http/Exceptions/MaintenanceModeException.php deleted file mode 100644 index 5553fde6..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Http/Exceptions/MaintenanceModeException.php +++ /dev/null @@ -1,58 +0,0 @@ -wentDownAt = Date::createFromTimestamp($time); - - if ($retryAfter) { - $this->retryAfter = $retryAfter; - - $this->willBeAvailableAt = Date::instance(Carbon::createFromTimestamp($time)->addRealSeconds($this->retryAfter)); - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Http/FormRequest.php b/vendor/laravel/framework/src/Illuminate/Foundation/Http/FormRequest.php deleted file mode 100644 index e9ed0915..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Http/FormRequest.php +++ /dev/null @@ -1,282 +0,0 @@ -validator) { - return $this->validator; - } - - $factory = $this->container->make(ValidationFactory::class); - - if (method_exists($this, 'validator')) { - $validator = $this->container->call([$this, 'validator'], compact('factory')); - } else { - $validator = $this->createDefaultValidator($factory); - } - - if (method_exists($this, 'withValidator')) { - $this->withValidator($validator); - } - - $this->setValidator($validator); - - return $this->validator; - } - - /** - * Create the default validator instance. - * - * @param \Illuminate\Contracts\Validation\Factory $factory - * @return \Illuminate\Contracts\Validation\Validator - */ - protected function createDefaultValidator(ValidationFactory $factory) - { - $rules = $this->container->call([$this, 'rules']); - - if ($this->isPrecognitive()) { - $rules = $this->filterPrecognitiveRules($rules); - } - - return $factory->make( - $this->validationData(), $rules, - $this->messages(), $this->attributes() - )->stopOnFirstFailure($this->stopOnFirstFailure); - } - - /** - * Get data to be validated from the request. - * - * @return array - */ - public function validationData() - { - return $this->all(); - } - - /** - * Handle a failed validation attempt. - * - * @param \Illuminate\Contracts\Validation\Validator $validator - * @return void - * - * @throws \Illuminate\Validation\ValidationException - */ - protected function failedValidation(Validator $validator) - { - throw (new ValidationException($validator)) - ->errorBag($this->errorBag) - ->redirectTo($this->getRedirectUrl()); - } - - /** - * Get the URL to redirect to on a validation error. - * - * @return string - */ - protected function getRedirectUrl() - { - $url = $this->redirector->getUrlGenerator(); - - if ($this->redirect) { - return $url->to($this->redirect); - } elseif ($this->redirectRoute) { - return $url->route($this->redirectRoute); - } elseif ($this->redirectAction) { - return $url->action($this->redirectAction); - } - - return $url->previous(); - } - - /** - * Determine if the request passes the authorization check. - * - * @return bool - * - * @throws \Illuminate\Auth\Access\AuthorizationException - */ - protected function passesAuthorization() - { - if (method_exists($this, 'authorize')) { - $result = $this->container->call([$this, 'authorize']); - - return $result instanceof Response ? $result->authorize() : $result; - } - - return true; - } - - /** - * Handle a failed authorization attempt. - * - * @return void - * - * @throws \Illuminate\Auth\Access\AuthorizationException - */ - protected function failedAuthorization() - { - throw new AuthorizationException; - } - - /** - * Get a validated input container for the validated input. - * - * @param array|null $keys - * @return \Illuminate\Support\ValidatedInput|array - */ - public function safe(array $keys = null) - { - return is_array($keys) - ? $this->validator->safe()->only($keys) - : $this->validator->safe(); - } - - /** - * Get the validated data from the request. - * - * @param string|null $key - * @param mixed $default - * @return mixed - */ - public function validated($key = null, $default = null) - { - return data_get($this->validator->validated(), $key, $default); - } - - /** - * Get custom messages for validator errors. - * - * @return array - */ - public function messages() - { - return []; - } - - /** - * Get custom attributes for validator errors. - * - * @return array - */ - public function attributes() - { - return []; - } - - /** - * Set the Validator instance. - * - * @param \Illuminate\Contracts\Validation\Validator $validator - * @return $this - */ - public function setValidator(Validator $validator) - { - $this->validator = $validator; - - return $this; - } - - /** - * Set the Redirector instance. - * - * @param \Illuminate\Routing\Redirector $redirector - * @return $this - */ - public function setRedirector(Redirector $redirector) - { - $this->redirector = $redirector; - - return $this; - } - - /** - * Set the container implementation. - * - * @param \Illuminate\Contracts\Container\Container $container - * @return $this - */ - public function setContainer(Container $container) - { - $this->container = $container; - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Http/HtmlDumper.php b/vendor/laravel/framework/src/Illuminate/Foundation/Http/HtmlDumper.php deleted file mode 100644 index 2df09013..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/Http/HtmlDumper.php +++ /dev/null @@ -1,140 +0,0 @@ -'; - - /** - * Where the source should be placed on "non expanded" kind of dumps. - * - * @var string - */ - const NON_EXPANDED_SEPARATOR = "\n'; - } - - /** - * Generate a link tag with attributes for the given URL. - * - * @param string $url - * @param array $attributes - * @return string - */ - protected function makeStylesheetTagWithAttributes($url, $attributes) - { - $attributes = $this->parseAttributes(array_merge([ - 'rel' => 'stylesheet', - 'href' => $url, - 'nonce' => $this->nonce ?? false, - ], $attributes)); - - return ''; - } - - /** - * Determine whether the given path is a CSS file. - * - * @param string $path - * @return bool - */ - protected function isCssPath($path) - { - return preg_match('/\.(css|less|sass|scss|styl|stylus|pcss|postcss)$/', $path) === 1; - } - - /** - * Parse the attributes into key="value" strings. - * - * @param array $attributes - * @return array - */ - protected function parseAttributes($attributes) - { - return Collection::make($attributes) - ->reject(fn ($value, $key) => in_array($value, [false, null], true)) - ->flatMap(fn ($value, $key) => $value === true ? [$key] : [$key => $value]) - ->map(fn ($value, $key) => is_int($key) ? $value : $key.'="'.$value.'"') - ->values() - ->all(); - } - - /** - * Generate React refresh runtime script. - * - * @return \Illuminate\Support\HtmlString|void - */ - public function reactRefresh() - { - if (! $this->isRunningHot()) { - return; - } - - $attributes = $this->parseAttributes([ - 'nonce' => $this->cspNonce(), - ]); - - return new HtmlString( - sprintf( - <<<'HTML' - - HTML, - implode(' ', $attributes), - $this->hotAsset('@react-refresh') - ) - ); - } - - /** - * Get the path to a given asset when running in HMR mode. - * - * @return string - */ - protected function hotAsset($asset) - { - return rtrim(file_get_contents($this->hotFile())).'/'.$asset; - } - - /** - * Get the URL for an asset. - * - * @param string $asset - * @param string|null $buildDirectory - * @return string - */ - public function asset($asset, $buildDirectory = null) - { - $buildDirectory ??= $this->buildDirectory; - - if ($this->isRunningHot()) { - return $this->hotAsset($asset); - } - - $chunk = $this->chunk($this->manifest($buildDirectory), $asset); - - return $this->assetPath($buildDirectory.'/'.$chunk['file']); - } - - /** - * Generate an asset path for the application. - * - * @param string $path - * @param bool|null $secure - * @return string - */ - protected function assetPath($path, $secure = null) - { - return asset($path, $secure); - } - - /** - * Get the the manifest file for the given build directory. - * - * @param string $buildDirectory - * @return array - * - * @throws \Exception - */ - protected function manifest($buildDirectory) - { - $path = $this->manifestPath($buildDirectory); - - if (! isset(static::$manifests[$path])) { - if (! is_file($path)) { - throw new Exception("Vite manifest not found at: {$path}"); - } - - static::$manifests[$path] = json_decode(file_get_contents($path), true); - } - - return static::$manifests[$path]; - } - - /** - * Get the path to the manifest file for the given build directory. - * - * @param string $buildDirectory - * @return string - */ - protected function manifestPath($buildDirectory) - { - return public_path($buildDirectory.'/'.$this->manifestFilename); - } - - /** - * Get a unique hash representing the current manifest, or null if there is no manifest. - * - * @param string|null $buildDirectory - * @return string|null - */ - public function manifestHash($buildDirectory = null) - { - $buildDirectory ??= $this->buildDirectory; - - if ($this->isRunningHot()) { - return null; - } - - if (! is_file($path = $this->manifestPath($buildDirectory))) { - return null; - } - - return md5_file($path) ?: null; - } - - /** - * Get the chunk for the given entry point / asset. - * - * @param array $manifest - * @param string $file - * @return array - * - * @throws \Exception - */ - protected function chunk($manifest, $file) - { - if (! isset($manifest[$file])) { - throw new Exception("Unable to locate file in Vite manifest: {$file}."); - } - - return $manifest[$file]; - } - - /** - * Determine if the HMR server is running. - * - * @return bool - */ - public function isRunningHot() - { - return is_file($this->hotFile()); - } - - /** - * Get the Vite tag content as a string of HTML. - * - * @return string - */ - public function toHtml() - { - return $this->__invoke($this->entryPoints)->toHtml(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php b/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php deleted file mode 100644 index 9a61616d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php +++ /dev/null @@ -1,1033 +0,0 @@ -toResponse(request())); - } - - app()->abort($code, $message, $headers); - } -} - -if (! function_exists('abort_if')) { - /** - * Throw an HttpException with the given data if the given condition is true. - * - * @param bool $boolean - * @param \Symfony\Component\HttpFoundation\Response|\Illuminate\Contracts\Support\Responsable|int $code - * @param string $message - * @param array $headers - * @return void - * - * @throws \Symfony\Component\HttpKernel\Exception\HttpException - * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException - */ - function abort_if($boolean, $code, $message = '', array $headers = []) - { - if ($boolean) { - abort($code, $message, $headers); - } - } -} - -if (! function_exists('abort_unless')) { - /** - * Throw an HttpException with the given data unless the given condition is true. - * - * @param bool $boolean - * @param \Symfony\Component\HttpFoundation\Response|\Illuminate\Contracts\Support\Responsable|int $code - * @param string $message - * @param array $headers - * @return void - * - * @throws \Symfony\Component\HttpKernel\Exception\HttpException - * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException - */ - function abort_unless($boolean, $code, $message = '', array $headers = []) - { - if (! $boolean) { - abort($code, $message, $headers); - } - } -} - -if (! function_exists('action')) { - /** - * Generate the URL to a controller action. - * - * @param string|array $name - * @param mixed $parameters - * @param bool $absolute - * @return string - */ - function action($name, $parameters = [], $absolute = true) - { - return app('url')->action($name, $parameters, $absolute); - } -} - -if (! function_exists('app')) { - /** - * Get the available container instance. - * - * @param string|null $abstract - * @param array $parameters - * @return mixed|\Illuminate\Contracts\Foundation\Application - */ - function app($abstract = null, array $parameters = []) - { - if (is_null($abstract)) { - return Container::getInstance(); - } - - return Container::getInstance()->make($abstract, $parameters); - } -} - -if (! function_exists('app_path')) { - /** - * Get the path to the application folder. - * - * @param string $path - * @return string - */ - function app_path($path = '') - { - return app()->path($path); - } -} - -if (! function_exists('asset')) { - /** - * Generate an asset path for the application. - * - * @param string $path - * @param bool|null $secure - * @return string - */ - function asset($path, $secure = null) - { - return app('url')->asset($path, $secure); - } -} - -if (! function_exists('auth')) { - /** - * Get the available auth instance. - * - * @param string|null $guard - * @return \Illuminate\Contracts\Auth\Factory|\Illuminate\Contracts\Auth\Guard|\Illuminate\Contracts\Auth\StatefulGuard - */ - function auth($guard = null) - { - if (is_null($guard)) { - return app(AuthFactory::class); - } - - return app(AuthFactory::class)->guard($guard); - } -} - -if (! function_exists('back')) { - /** - * Create a new redirect response to the previous location. - * - * @param int $status - * @param array $headers - * @param mixed $fallback - * @return \Illuminate\Http\RedirectResponse - */ - function back($status = 302, $headers = [], $fallback = false) - { - return app('redirect')->back($status, $headers, $fallback); - } -} - -if (! function_exists('base_path')) { - /** - * Get the path to the base of the install. - * - * @param string $path - * @return string - */ - function base_path($path = '') - { - return app()->basePath($path); - } -} - -if (! function_exists('bcrypt')) { - /** - * Hash the given value against the bcrypt algorithm. - * - * @param string $value - * @param array $options - * @return string - */ - function bcrypt($value, $options = []) - { - return app('hash')->driver('bcrypt')->make($value, $options); - } -} - -if (! function_exists('broadcast')) { - /** - * Begin broadcasting an event. - * - * @param mixed|null $event - * @return \Illuminate\Broadcasting\PendingBroadcast - */ - function broadcast($event = null) - { - return app(BroadcastFactory::class)->event($event); - } -} - -if (! function_exists('cache')) { - /** - * Get / set the specified cache value. - * - * If an array is passed, we'll assume you want to put to the cache. - * - * @param dynamic key|key,default|data,expiration|null - * @return mixed|\Illuminate\Cache\CacheManager - * - * @throws \InvalidArgumentException - */ - function cache() - { - $arguments = func_get_args(); - - if (empty($arguments)) { - return app('cache'); - } - - if (is_string($arguments[0])) { - return app('cache')->get(...$arguments); - } - - if (! is_array($arguments[0])) { - throw new InvalidArgumentException( - 'When setting a value in the cache, you must pass an array of key / value pairs.' - ); - } - - return app('cache')->put(key($arguments[0]), reset($arguments[0]), $arguments[1] ?? null); - } -} - -if (! function_exists('config')) { - /** - * Get / set the specified configuration value. - * - * If an array is passed as the key, we will assume you want to set an array of values. - * - * @param array|string|null $key - * @param mixed $default - * @return mixed|\Illuminate\Config\Repository - */ - function config($key = null, $default = null) - { - if (is_null($key)) { - return app('config'); - } - - if (is_array($key)) { - return app('config')->set($key); - } - - return app('config')->get($key, $default); - } -} - -if (! function_exists('config_path')) { - /** - * Get the configuration path. - * - * @param string $path - * @return string - */ - function config_path($path = '') - { - return app()->configPath($path); - } -} - -if (! function_exists('cookie')) { - /** - * Create a new cookie instance. - * - * @param string|null $name - * @param string|null $value - * @param int $minutes - * @param string|null $path - * @param string|null $domain - * @param bool|null $secure - * @param bool $httpOnly - * @param bool $raw - * @param string|null $sameSite - * @return \Illuminate\Cookie\CookieJar|\Symfony\Component\HttpFoundation\Cookie - */ - function cookie($name = null, $value = null, $minutes = 0, $path = null, $domain = null, $secure = null, $httpOnly = true, $raw = false, $sameSite = null) - { - $cookie = app(CookieFactory::class); - - if (is_null($name)) { - return $cookie; - } - - return $cookie->make($name, $value, $minutes, $path, $domain, $secure, $httpOnly, $raw, $sameSite); - } -} - -if (! function_exists('csrf_field')) { - /** - * Generate a CSRF token form field. - * - * @return \Illuminate\Support\HtmlString - */ - function csrf_field() - { - return new HtmlString(''); - } -} - -if (! function_exists('csrf_token')) { - /** - * Get the CSRF token value. - * - * @return string - * - * @throws \RuntimeException - */ - function csrf_token() - { - $session = app('session'); - - if (isset($session)) { - return $session->token(); - } - - throw new RuntimeException('Application session store not set.'); - } -} - -if (! function_exists('database_path')) { - /** - * Get the database path. - * - * @param string $path - * @return string - */ - function database_path($path = '') - { - return app()->databasePath($path); - } -} - -if (! function_exists('decrypt')) { - /** - * Decrypt the given value. - * - * @param string $value - * @param bool $unserialize - * @return mixed - */ - function decrypt($value, $unserialize = true) - { - return app('encrypter')->decrypt($value, $unserialize); - } -} - -if (! function_exists('dispatch')) { - /** - * Dispatch a job to its appropriate handler. - * - * @param mixed $job - * @return \Illuminate\Foundation\Bus\PendingDispatch - */ - function dispatch($job) - { - return $job instanceof Closure - ? new PendingClosureDispatch(CallQueuedClosure::create($job)) - : new PendingDispatch($job); - } -} - -if (! function_exists('dispatch_sync')) { - /** - * Dispatch a command to its appropriate handler in the current process. - * - * Queueable jobs will be dispatched to the "sync" queue. - * - * @param mixed $job - * @param mixed $handler - * @return mixed - */ - function dispatch_sync($job, $handler = null) - { - return app(Dispatcher::class)->dispatchSync($job, $handler); - } -} - -if (! function_exists('dispatch_now')) { - /** - * Dispatch a command to its appropriate handler in the current process. - * - * @param mixed $job - * @param mixed $handler - * @return mixed - * - * @deprecated Will be removed in a future Laravel version. - */ - function dispatch_now($job, $handler = null) - { - return app(Dispatcher::class)->dispatchNow($job, $handler); - } -} - -if (! function_exists('encrypt')) { - /** - * Encrypt the given value. - * - * @param mixed $value - * @param bool $serialize - * @return string - */ - function encrypt($value, $serialize = true) - { - return app('encrypter')->encrypt($value, $serialize); - } -} - -if (! function_exists('event')) { - /** - * Dispatch an event and call the listeners. - * - * @param string|object $event - * @param mixed $payload - * @param bool $halt - * @return array|null - */ - function event(...$args) - { - return app('events')->dispatch(...$args); - } -} - -if (! function_exists('fake') && class_exists(\Faker\Factory::class)) { - /** - * Get a faker instance. - * - * @param ?string $locale - * @return \Faker\Generator - */ - function fake($locale = null) - { - $locale ??= app('config')->get('app.faker_locale') ?? 'en_US'; - - $abstract = \Faker\Generator::class.':'.$locale; - - if (! app()->bound($abstract)) { - app()->singleton($abstract, fn () => \Faker\Factory::create($locale)); - } - - return app()->make($abstract); - } -} - -if (! function_exists('info')) { - /** - * Write some information to the log. - * - * @param string $message - * @param array $context - * @return void - */ - function info($message, $context = []) - { - app('log')->info($message, $context); - } -} - -if (! function_exists('logger')) { - /** - * Log a debug message to the logs. - * - * @param string|null $message - * @param array $context - * @return \Illuminate\Log\LogManager|null - */ - function logger($message = null, array $context = []) - { - if (is_null($message)) { - return app('log'); - } - - return app('log')->debug($message, $context); - } -} - -if (! function_exists('lang_path')) { - /** - * Get the path to the language folder. - * - * @param string $path - * @return string - */ - function lang_path($path = '') - { - return app()->langPath($path); - } -} - -if (! function_exists('logs')) { - /** - * Get a log driver instance. - * - * @param string|null $driver - * @return \Illuminate\Log\LogManager|\Psr\Log\LoggerInterface - */ - function logs($driver = null) - { - return $driver ? app('log')->driver($driver) : app('log'); - } -} - -if (! function_exists('method_field')) { - /** - * Generate a form field to spoof the HTTP verb used by forms. - * - * @param string $method - * @return \Illuminate\Support\HtmlString - */ - function method_field($method) - { - return new HtmlString(''); - } -} - -if (! function_exists('mix')) { - /** - * Get the path to a versioned Mix file. - * - * @param string $path - * @param string $manifestDirectory - * @return \Illuminate\Support\HtmlString|string - * - * @throws \Exception - */ - function mix($path, $manifestDirectory = '') - { - return app(Mix::class)(...func_get_args()); - } -} - -if (! function_exists('now')) { - /** - * Create a new Carbon instance for the current time. - * - * @param \DateTimeZone|string|null $tz - * @return \Illuminate\Support\Carbon - */ - function now($tz = null) - { - return Date::now($tz); - } -} - -if (! function_exists('old')) { - /** - * Retrieve an old input item. - * - * @param string|null $key - * @param mixed $default - * @return mixed - */ - function old($key = null, $default = null) - { - return app('request')->old($key, $default); - } -} - -if (! function_exists('policy')) { - /** - * Get a policy instance for a given class. - * - * @param object|string $class - * @return mixed - * - * @throws \InvalidArgumentException - */ - function policy($class) - { - return app(Gate::class)->getPolicyFor($class); - } -} - -if (! function_exists('precognitive')) { - /** - * Handle a Precognition controller hook. - * - * @param null|callable $callable - * @return mixed - */ - function precognitive($callable = null) - { - $callable ??= function () { - // - }; - - $payload = $callable(function ($default, $precognition = null) { - $response = request()->isPrecognitive() - ? ($precognition ?? $default) - : $default; - - abort(Router::toResponse(request(), value($response))); - }); - - if (request()->isPrecognitive()) { - abort(204); - } - - return $payload; - } -} - -if (! function_exists('public_path')) { - /** - * Get the path to the public folder. - * - * @param string $path - * @return string - */ - function public_path($path = '') - { - return app()->make('path.public').($path ? DIRECTORY_SEPARATOR.ltrim($path, DIRECTORY_SEPARATOR) : $path); - } -} - -if (! function_exists('redirect')) { - /** - * Get an instance of the redirector. - * - * @param string|null $to - * @param int $status - * @param array $headers - * @param bool|null $secure - * @return \Illuminate\Routing\Redirector|\Illuminate\Http\RedirectResponse - */ - function redirect($to = null, $status = 302, $headers = [], $secure = null) - { - if (is_null($to)) { - return app('redirect'); - } - - return app('redirect')->to($to, $status, $headers, $secure); - } -} - -if (! function_exists('report')) { - /** - * Report an exception. - * - * @param \Throwable|string $exception - * @return void - */ - function report($exception) - { - if (is_string($exception)) { - $exception = new Exception($exception); - } - - app(ExceptionHandler::class)->report($exception); - } -} - -if (! function_exists('report_if')) { - /** - * Report an exception if the given condition is true. - * - * @param bool $boolean - * @param \Throwable|string $exception - * @return void - */ - function report_if($boolean, $exception) - { - if ($boolean) { - report($exception); - } - } -} - -if (! function_exists('report_unless')) { - /** - * Report an exception unless the given condition is true. - * - * @param bool $boolean - * @param \Throwable|string $exception - * @return void - */ - function report_unless($boolean, $exception) - { - if (! $boolean) { - report($exception); - } - } -} - -if (! function_exists('request')) { - /** - * Get an instance of the current request or an input item from the request. - * - * @param array|string|null $key - * @param mixed $default - * @return mixed|\Illuminate\Http\Request|string|array|null - */ - function request($key = null, $default = null) - { - if (is_null($key)) { - return app('request'); - } - - if (is_array($key)) { - return app('request')->only($key); - } - - $value = app('request')->__get($key); - - return is_null($value) ? value($default) : $value; - } -} - -if (! function_exists('rescue')) { - /** - * Catch a potential exception and return a default value. - * - * @param callable $callback - * @param mixed $rescue - * @param bool|callable $report - * @return mixed - */ - function rescue(callable $callback, $rescue = null, $report = true) - { - try { - return $callback(); - } catch (Throwable $e) { - if (value($report, $e)) { - report($e); - } - - return value($rescue, $e); - } - } -} - -if (! function_exists('resolve')) { - /** - * Resolve a service from the container. - * - * @param string $name - * @param array $parameters - * @return mixed - */ - function resolve($name, array $parameters = []) - { - return app($name, $parameters); - } -} - -if (! function_exists('resource_path')) { - /** - * Get the path to the resources folder. - * - * @param string $path - * @return string - */ - function resource_path($path = '') - { - return app()->resourcePath($path); - } -} - -if (! function_exists('response')) { - /** - * Return a new response from the application. - * - * @param \Illuminate\Contracts\View\View|string|array|null $content - * @param int $status - * @param array $headers - * @return \Illuminate\Http\Response|\Illuminate\Contracts\Routing\ResponseFactory - */ - function response($content = '', $status = 200, array $headers = []) - { - $factory = app(ResponseFactory::class); - - if (func_num_args() === 0) { - return $factory; - } - - return $factory->make($content, $status, $headers); - } -} - -if (! function_exists('route')) { - /** - * Generate the URL to a named route. - * - * @param array|string $name - * @param mixed $parameters - * @param bool $absolute - * @return string - */ - function route($name, $parameters = [], $absolute = true) - { - return app('url')->route($name, $parameters, $absolute); - } -} - -if (! function_exists('secure_asset')) { - /** - * Generate an asset path for the application. - * - * @param string $path - * @return string - */ - function secure_asset($path) - { - return asset($path, true); - } -} - -if (! function_exists('secure_url')) { - /** - * Generate a HTTPS url for the application. - * - * @param string $path - * @param mixed $parameters - * @return string - */ - function secure_url($path, $parameters = []) - { - return url($path, $parameters, true); - } -} - -if (! function_exists('session')) { - /** - * Get / set the specified session value. - * - * If an array is passed as the key, we will assume you want to set an array of values. - * - * @param array|string|null $key - * @param mixed $default - * @return mixed|\Illuminate\Session\Store|\Illuminate\Session\SessionManager - */ - function session($key = null, $default = null) - { - if (is_null($key)) { - return app('session'); - } - - if (is_array($key)) { - return app('session')->put($key); - } - - return app('session')->get($key, $default); - } -} - -if (! function_exists('storage_path')) { - /** - * Get the path to the storage folder. - * - * @param string $path - * @return string - */ - function storage_path($path = '') - { - return app()->storagePath($path); - } -} - -if (! function_exists('to_route')) { - /** - * Create a new redirect response to a named route. - * - * @param string $route - * @param mixed $parameters - * @param int $status - * @param array $headers - * @return \Illuminate\Http\RedirectResponse - */ - function to_route($route, $parameters = [], $status = 302, $headers = []) - { - return redirect()->route($route, $parameters, $status, $headers); - } -} - -if (! function_exists('today')) { - /** - * Create a new Carbon instance for the current date. - * - * @param \DateTimeZone|string|null $tz - * @return \Illuminate\Support\Carbon - */ - function today($tz = null) - { - return Date::today($tz); - } -} - -if (! function_exists('trans')) { - /** - * Translate the given message. - * - * @param string|null $key - * @param array $replace - * @param string|null $locale - * @return \Illuminate\Contracts\Translation\Translator|string|array|null - */ - function trans($key = null, $replace = [], $locale = null) - { - if (is_null($key)) { - return app('translator'); - } - - return app('translator')->get($key, $replace, $locale); - } -} - -if (! function_exists('trans_choice')) { - /** - * Translates the given message based on a count. - * - * @param string $key - * @param \Countable|int|array $number - * @param array $replace - * @param string|null $locale - * @return string - */ - function trans_choice($key, $number, array $replace = [], $locale = null) - { - return app('translator')->choice($key, $number, $replace, $locale); - } -} - -if (! function_exists('__')) { - /** - * Translate the given message. - * - * @param string|null $key - * @param array $replace - * @param string|null $locale - * @return string|array|null - */ - function __($key = null, $replace = [], $locale = null) - { - if (is_null($key)) { - return $key; - } - - return trans($key, $replace, $locale); - } -} - -if (! function_exists('url')) { - /** - * Generate a url for the application. - * - * @param string|null $path - * @param mixed $parameters - * @param bool|null $secure - * @return \Illuminate\Contracts\Routing\UrlGenerator|string - */ - function url($path = null, $parameters = [], $secure = null) - { - if (is_null($path)) { - return app(UrlGenerator::class); - } - - return app(UrlGenerator::class)->to($path, $parameters, $secure); - } -} - -if (! function_exists('validator')) { - /** - * Create a new Validator instance. - * - * @param array $data - * @param array $rules - * @param array $messages - * @param array $customAttributes - * @return \Illuminate\Contracts\Validation\Validator|\Illuminate\Contracts\Validation\Factory - */ - function validator(array $data = [], array $rules = [], array $messages = [], array $customAttributes = []) - { - $factory = app(ValidationFactory::class); - - if (func_num_args() === 0) { - return $factory; - } - - return $factory->make($data, $rules, $messages, $customAttributes); - } -} - -if (! function_exists('view')) { - /** - * Get the evaluated view contents for the given view. - * - * @param string|null $view - * @param \Illuminate\Contracts\Support\Arrayable|array $data - * @param array $mergeData - * @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory - */ - function view($view = null, $data = [], $mergeData = []) - { - $factory = app(ViewFactory::class); - - if (func_num_args() === 0) { - return $factory; - } - - return $factory->make($view, $data, $mergeData); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/resources/server.php b/vendor/laravel/framework/src/Illuminate/Foundation/resources/server.php deleted file mode 100644 index 99eddccc..00000000 --- a/vendor/laravel/framework/src/Illuminate/Foundation/resources/server.php +++ /dev/null @@ -1,16 +0,0 @@ -verifyAlgorithm && $this->info($hashedValue)['algoName'] !== 'argon2id') { - throw new RuntimeException('This password does not use the Argon2id algorithm.'); - } - - if (is_null($hashedValue) || strlen($hashedValue) === 0) { - return false; - } - - return password_verify($value, $hashedValue); - } - - /** - * Get the algorithm that should be used for hashing. - * - * @return int - */ - protected function algorithm() - { - return PASSWORD_ARGON2ID; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Hashing/ArgonHasher.php b/vendor/laravel/framework/src/Illuminate/Hashing/ArgonHasher.php deleted file mode 100644 index b999257f..00000000 --- a/vendor/laravel/framework/src/Illuminate/Hashing/ArgonHasher.php +++ /dev/null @@ -1,196 +0,0 @@ -time = $options['time'] ?? $this->time; - $this->memory = $options['memory'] ?? $this->memory; - $this->threads = $this->threads($options); - $this->verifyAlgorithm = $options['verify'] ?? $this->verifyAlgorithm; - } - - /** - * Hash the given value. - * - * @param string $value - * @param array $options - * @return string - * - * @throws \RuntimeException - */ - public function make($value, array $options = []) - { - $hash = @password_hash($value, $this->algorithm(), [ - 'memory_cost' => $this->memory($options), - 'time_cost' => $this->time($options), - 'threads' => $this->threads($options), - ]); - - if (! is_string($hash)) { - throw new RuntimeException('Argon2 hashing not supported.'); - } - - return $hash; - } - - /** - * Get the algorithm that should be used for hashing. - * - * @return int - */ - protected function algorithm() - { - return PASSWORD_ARGON2I; - } - - /** - * Check the given plain value against a hash. - * - * @param string $value - * @param string $hashedValue - * @param array $options - * @return bool - * - * @throws \RuntimeException - */ - public function check($value, $hashedValue, array $options = []) - { - if ($this->verifyAlgorithm && $this->info($hashedValue)['algoName'] !== 'argon2i') { - throw new RuntimeException('This password does not use the Argon2i algorithm.'); - } - - return parent::check($value, $hashedValue, $options); - } - - /** - * Check if the given hash has been hashed using the given options. - * - * @param string $hashedValue - * @param array $options - * @return bool - */ - public function needsRehash($hashedValue, array $options = []) - { - return password_needs_rehash($hashedValue, $this->algorithm(), [ - 'memory_cost' => $this->memory($options), - 'time_cost' => $this->time($options), - 'threads' => $this->threads($options), - ]); - } - - /** - * Set the default password memory factor. - * - * @param int $memory - * @return $this - */ - public function setMemory(int $memory) - { - $this->memory = $memory; - - return $this; - } - - /** - * Set the default password timing factor. - * - * @param int $time - * @return $this - */ - public function setTime(int $time) - { - $this->time = $time; - - return $this; - } - - /** - * Set the default password threads factor. - * - * @param int $threads - * @return $this - */ - public function setThreads(int $threads) - { - $this->threads = $threads; - - return $this; - } - - /** - * Extract the memory cost value from the options array. - * - * @param array $options - * @return int - */ - protected function memory(array $options) - { - return $options['memory'] ?? $this->memory; - } - - /** - * Extract the time cost value from the options array. - * - * @param array $options - * @return int - */ - protected function time(array $options) - { - return $options['time'] ?? $this->time; - } - - /** - * Extract the thread's value from the options array. - * - * @param array $options - * @return int - */ - protected function threads(array $options) - { - if (defined('PASSWORD_ARGON2_PROVIDER') && PASSWORD_ARGON2_PROVIDER === 'sodium') { - return 1; - } - - return $options['threads'] ?? $this->threads; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Hashing/BcryptHasher.php b/vendor/laravel/framework/src/Illuminate/Hashing/BcryptHasher.php deleted file mode 100755 index 26f928cb..00000000 --- a/vendor/laravel/framework/src/Illuminate/Hashing/BcryptHasher.php +++ /dev/null @@ -1,114 +0,0 @@ -rounds = $options['rounds'] ?? $this->rounds; - $this->verifyAlgorithm = $options['verify'] ?? $this->verifyAlgorithm; - } - - /** - * Hash the given value. - * - * @param string $value - * @param array $options - * @return string - * - * @throws \RuntimeException - */ - public function make($value, array $options = []) - { - $hash = password_hash($value, PASSWORD_BCRYPT, [ - 'cost' => $this->cost($options), - ]); - - if ($hash === false) { - throw new RuntimeException('Bcrypt hashing not supported.'); - } - - return $hash; - } - - /** - * Check the given plain value against a hash. - * - * @param string $value - * @param string $hashedValue - * @param array $options - * @return bool - * - * @throws \RuntimeException - */ - public function check($value, $hashedValue, array $options = []) - { - if ($this->verifyAlgorithm && $this->info($hashedValue)['algoName'] !== 'bcrypt') { - throw new RuntimeException('This password does not use the Bcrypt algorithm.'); - } - - return parent::check($value, $hashedValue, $options); - } - - /** - * Check if the given hash has been hashed using the given options. - * - * @param string $hashedValue - * @param array $options - * @return bool - */ - public function needsRehash($hashedValue, array $options = []) - { - return password_needs_rehash($hashedValue, PASSWORD_BCRYPT, [ - 'cost' => $this->cost($options), - ]); - } - - /** - * Set the default password work factor. - * - * @param int $rounds - * @return $this - */ - public function setRounds($rounds) - { - $this->rounds = (int) $rounds; - - return $this; - } - - /** - * Extract the cost value from the options array. - * - * @param array $options - * @return int - */ - protected function cost(array $options = []) - { - return $options['rounds'] ?? $this->rounds; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Hashing/HashManager.php b/vendor/laravel/framework/src/Illuminate/Hashing/HashManager.php deleted file mode 100644 index 5584f7a1..00000000 --- a/vendor/laravel/framework/src/Illuminate/Hashing/HashManager.php +++ /dev/null @@ -1,100 +0,0 @@ -config->get('hashing.bcrypt') ?? []); - } - - /** - * Create an instance of the Argon2i hash Driver. - * - * @return \Illuminate\Hashing\ArgonHasher - */ - public function createArgonDriver() - { - return new ArgonHasher($this->config->get('hashing.argon') ?? []); - } - - /** - * Create an instance of the Argon2id hash Driver. - * - * @return \Illuminate\Hashing\Argon2IdHasher - */ - public function createArgon2idDriver() - { - return new Argon2IdHasher($this->config->get('hashing.argon') ?? []); - } - - /** - * Get information about the given hashed value. - * - * @param string $hashedValue - * @return array - */ - public function info($hashedValue) - { - return $this->driver()->info($hashedValue); - } - - /** - * Hash the given value. - * - * @param string $value - * @param array $options - * @return string - */ - public function make($value, array $options = []) - { - return $this->driver()->make($value, $options); - } - - /** - * Check the given plain value against a hash. - * - * @param string $value - * @param string $hashedValue - * @param array $options - * @return bool - */ - public function check($value, $hashedValue, array $options = []) - { - return $this->driver()->check($value, $hashedValue, $options); - } - - /** - * Check if the given hash has been hashed using the given options. - * - * @param string $hashedValue - * @param array $options - * @return bool - */ - public function needsRehash($hashedValue, array $options = []) - { - return $this->driver()->needsRehash($hashedValue, $options); - } - - /** - * Get the default driver name. - * - * @return string - */ - public function getDefaultDriver() - { - return $this->config->get('hashing.driver', 'bcrypt'); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Hashing/HashServiceProvider.php b/vendor/laravel/framework/src/Illuminate/Hashing/HashServiceProvider.php deleted file mode 100755 index 2ed56a42..00000000 --- a/vendor/laravel/framework/src/Illuminate/Hashing/HashServiceProvider.php +++ /dev/null @@ -1,35 +0,0 @@ -app->singleton('hash', function ($app) { - return new HashManager($app); - }); - - $this->app->singleton('hash.driver', function ($app) { - return $app['hash']->driver(); - }); - } - - /** - * Get the services provided by the provider. - * - * @return array - */ - public function provides() - { - return ['hash', 'hash.driver']; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Hashing/LICENSE.md b/vendor/laravel/framework/src/Illuminate/Hashing/LICENSE.md deleted file mode 100644 index 79810c84..00000000 --- a/vendor/laravel/framework/src/Illuminate/Hashing/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Taylor Otwell - -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/laravel/framework/src/Illuminate/Hashing/composer.json b/vendor/laravel/framework/src/Illuminate/Hashing/composer.json deleted file mode 100755 index 77f9280b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Hashing/composer.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "illuminate/hashing", - "description": "The Illuminate Hashing package.", - "license": "MIT", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "require": { - "php": "^8.0.2", - "illuminate/contracts": "^9.0", - "illuminate/support": "^9.0" - }, - "autoload": { - "psr-4": { - "Illuminate\\Hashing\\": "" - } - }, - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev" -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/Client/ConnectionException.php b/vendor/laravel/framework/src/Illuminate/Http/Client/ConnectionException.php deleted file mode 100644 index eac85dc7..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Client/ConnectionException.php +++ /dev/null @@ -1,8 +0,0 @@ -request = $request; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/Client/Events/RequestSending.php b/vendor/laravel/framework/src/Illuminate/Http/Client/Events/RequestSending.php deleted file mode 100644 index 1b363fb7..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Client/Events/RequestSending.php +++ /dev/null @@ -1,26 +0,0 @@ -request = $request; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/Client/Events/ResponseReceived.php b/vendor/laravel/framework/src/Illuminate/Http/Client/Events/ResponseReceived.php deleted file mode 100644 index 77be7aba..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Client/Events/ResponseReceived.php +++ /dev/null @@ -1,36 +0,0 @@ -request = $request; - $this->response = $response; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/Client/Factory.php b/vendor/laravel/framework/src/Illuminate/Http/Client/Factory.php deleted file mode 100644 index 457714ba..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Client/Factory.php +++ /dev/null @@ -1,387 +0,0 @@ -dispatcher = $dispatcher; - - $this->stubCallbacks = collect(); - } - - /** - * Create a new response instance for use during stubbing. - * - * @param array|string|null $body - * @param int $status - * @param array $headers - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public static function response($body = null, $status = 200, $headers = []) - { - if (is_array($body)) { - $body = json_encode($body); - - $headers['Content-Type'] = 'application/json'; - } - - $response = new Psr7Response($status, $headers, $body); - - return class_exists(\GuzzleHttp\Promise\Create::class) - ? \GuzzleHttp\Promise\Create::promiseFor($response) - : \GuzzleHttp\Promise\promise_for($response); - } - - /** - * Get an invokable object that returns a sequence of responses in order for use during stubbing. - * - * @param array $responses - * @return \Illuminate\Http\Client\ResponseSequence - */ - public function sequence(array $responses = []) - { - return $this->responseSequences[] = new ResponseSequence($responses); - } - - /** - * Register a stub callable that will intercept requests and be able to return stub responses. - * - * @param callable|array|null $callback - * @return $this - */ - public function fake($callback = null) - { - $this->record(); - - $this->recorded = []; - - if (is_null($callback)) { - $callback = function () { - return static::response(); - }; - } - - if (is_array($callback)) { - foreach ($callback as $url => $callable) { - $this->stubUrl($url, $callable); - } - - return $this; - } - - $this->stubCallbacks = $this->stubCallbacks->merge(collect([ - function ($request, $options) use ($callback) { - $response = $callback instanceof Closure - ? $callback($request, $options) - : $callback; - - if ($response instanceof PromiseInterface) { - $options['on_stats'](new TransferStats( - $request->toPsrRequest(), - $response->wait(), - )); - } - - return $response; - }, - ])); - - return $this; - } - - /** - * Register a response sequence for the given URL pattern. - * - * @param string $url - * @return \Illuminate\Http\Client\ResponseSequence - */ - public function fakeSequence($url = '*') - { - return tap($this->sequence(), function ($sequence) use ($url) { - $this->fake([$url => $sequence]); - }); - } - - /** - * Stub the given URL using the given callback. - * - * @param string $url - * @param \Illuminate\Http\Client\Response|\GuzzleHttp\Promise\PromiseInterface|callable $callback - * @return $this - */ - public function stubUrl($url, $callback) - { - return $this->fake(function ($request, $options) use ($url, $callback) { - if (! Str::is(Str::start($url, '*'), $request->url())) { - return; - } - - return $callback instanceof Closure || $callback instanceof ResponseSequence - ? $callback($request, $options) - : $callback; - }); - } - - /** - * Indicate that an exception should be thrown if any request is not faked. - * - * @param bool $prevent - * @return $this - */ - public function preventStrayRequests($prevent = true) - { - $this->preventStrayRequests = $prevent; - - return $this; - } - - /** - * Indicate that an exception should not be thrown if any request is not faked. - * - * @return $this - */ - public function allowStrayRequests() - { - return $this->preventStrayRequests(false); - } - - /** - * Begin recording request / response pairs. - * - * @return $this - */ - protected function record() - { - $this->recording = true; - - return $this; - } - - /** - * Record a request response pair. - * - * @param \Illuminate\Http\Client\Request $request - * @param \Illuminate\Http\Client\Response $response - * @return void - */ - public function recordRequestResponsePair($request, $response) - { - if ($this->recording) { - $this->recorded[] = [$request, $response]; - } - } - - /** - * Assert that a request / response pair was recorded matching a given truth test. - * - * @param callable $callback - * @return void - */ - public function assertSent($callback) - { - PHPUnit::assertTrue( - $this->recorded($callback)->count() > 0, - 'An expected request was not recorded.' - ); - } - - /** - * Assert that the given request was sent in the given order. - * - * @param array $callbacks - * @return void - */ - public function assertSentInOrder($callbacks) - { - $this->assertSentCount(count($callbacks)); - - foreach ($callbacks as $index => $url) { - $callback = is_callable($url) ? $url : function ($request) use ($url) { - return $request->url() == $url; - }; - - PHPUnit::assertTrue($callback( - $this->recorded[$index][0], - $this->recorded[$index][1] - ), 'An expected request (#'.($index + 1).') was not recorded.'); - } - } - - /** - * Assert that a request / response pair was not recorded matching a given truth test. - * - * @param callable $callback - * @return void - */ - public function assertNotSent($callback) - { - PHPUnit::assertFalse( - $this->recorded($callback)->count() > 0, - 'Unexpected request was recorded.' - ); - } - - /** - * Assert that no request / response pair was recorded. - * - * @return void - */ - public function assertNothingSent() - { - PHPUnit::assertEmpty( - $this->recorded, - 'Requests were recorded.' - ); - } - - /** - * Assert how many requests have been recorded. - * - * @param int $count - * @return void - */ - public function assertSentCount($count) - { - PHPUnit::assertCount($count, $this->recorded); - } - - /** - * Assert that every created response sequence is empty. - * - * @return void - */ - public function assertSequencesAreEmpty() - { - foreach ($this->responseSequences as $responseSequence) { - PHPUnit::assertTrue( - $responseSequence->isEmpty(), - 'Not all response sequences are empty.' - ); - } - } - - /** - * Get a collection of the request / response pairs matching the given truth test. - * - * @param callable $callback - * @return \Illuminate\Support\Collection - */ - public function recorded($callback = null) - { - if (empty($this->recorded)) { - return collect(); - } - - $callback = $callback ?: function () { - return true; - }; - - return collect($this->recorded)->filter(function ($pair) use ($callback) { - return $callback($pair[0], $pair[1]); - }); - } - - /** - * Create a new pending request instance for this factory. - * - * @return \Illuminate\Http\Client\PendingRequest - */ - protected function newPendingRequest() - { - return new PendingRequest($this); - } - - /** - * Get the current event dispatcher implementation. - * - * @return \Illuminate\Contracts\Events\Dispatcher|null - */ - public function getDispatcher() - { - return $this->dispatcher; - } - - /** - * Execute a method against a new pending request instance. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - if (static::hasMacro($method)) { - return $this->macroCall($method, $parameters); - } - - return tap($this->newPendingRequest(), function ($request) { - $request->stub($this->stubCallbacks)->preventStrayRequests($this->preventStrayRequests); - })->{$method}(...$parameters); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/Client/HttpClientException.php b/vendor/laravel/framework/src/Illuminate/Http/Client/HttpClientException.php deleted file mode 100644 index b15b8d30..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Client/HttpClientException.php +++ /dev/null @@ -1,10 +0,0 @@ -factory = $factory; - $this->middleware = new Collection; - - $this->asJson(); - - $this->options = [ - 'connect_timeout' => 10, - 'http_errors' => false, - 'timeout' => 30, - ]; - - $this->beforeSendingCallbacks = collect([function (Request $request, array $options, PendingRequest $pendingRequest) { - $pendingRequest->request = $request; - $pendingRequest->cookies = $options['cookies']; - - $pendingRequest->dispatchRequestSendingEvent(); - }]); - } - - /** - * Set the base URL for the pending request. - * - * @param string $url - * @return $this - */ - public function baseUrl(string $url) - { - $this->baseUrl = $url; - - return $this; - } - - /** - * Attach a raw body to the request. - * - * @param string $content - * @param string $contentType - * @return $this - */ - public function withBody($content, $contentType) - { - $this->bodyFormat('body'); - - $this->pendingBody = $content; - - $this->contentType($contentType); - - return $this; - } - - /** - * Indicate the request contains JSON. - * - * @return $this - */ - public function asJson() - { - return $this->bodyFormat('json')->contentType('application/json'); - } - - /** - * Indicate the request contains form parameters. - * - * @return $this - */ - public function asForm() - { - return $this->bodyFormat('form_params')->contentType('application/x-www-form-urlencoded'); - } - - /** - * Attach a file to the request. - * - * @param string|array $name - * @param string|resource $contents - * @param string|null $filename - * @param array $headers - * @return $this - */ - public function attach($name, $contents = '', $filename = null, array $headers = []) - { - if (is_array($name)) { - foreach ($name as $file) { - $this->attach(...$file); - } - - return $this; - } - - $this->asMultipart(); - - $this->pendingFiles[] = array_filter([ - 'name' => $name, - 'contents' => $contents, - 'headers' => $headers, - 'filename' => $filename, - ]); - - return $this; - } - - /** - * Indicate the request is a multi-part form request. - * - * @return $this - */ - public function asMultipart() - { - return $this->bodyFormat('multipart'); - } - - /** - * Specify the body format of the request. - * - * @param string $format - * @return $this - */ - public function bodyFormat(string $format) - { - return tap($this, function () use ($format) { - $this->bodyFormat = $format; - }); - } - - /** - * Specify the request's content type. - * - * @param string $contentType - * @return $this - */ - public function contentType(string $contentType) - { - return $this->withHeaders(['Content-Type' => $contentType]); - } - - /** - * Indicate that JSON should be returned by the server. - * - * @return $this - */ - public function acceptJson() - { - return $this->accept('application/json'); - } - - /** - * Indicate the type of content that should be returned by the server. - * - * @param string $contentType - * @return $this - */ - public function accept($contentType) - { - return $this->withHeaders(['Accept' => $contentType]); - } - - /** - * Add the given headers to the request. - * - * @param array $headers - * @return $this - */ - public function withHeaders(array $headers) - { - return tap($this, function () use ($headers) { - $this->options = array_merge_recursive($this->options, [ - 'headers' => $headers, - ]); - }); - } - - /** - * Specify the basic authentication username and password for the request. - * - * @param string $username - * @param string $password - * @return $this - */ - public function withBasicAuth(string $username, string $password) - { - return tap($this, function () use ($username, $password) { - $this->options['auth'] = [$username, $password]; - }); - } - - /** - * Specify the digest authentication username and password for the request. - * - * @param string $username - * @param string $password - * @return $this - */ - public function withDigestAuth($username, $password) - { - return tap($this, function () use ($username, $password) { - $this->options['auth'] = [$username, $password, 'digest']; - }); - } - - /** - * Specify an authorization token for the request. - * - * @param string $token - * @param string $type - * @return $this - */ - public function withToken($token, $type = 'Bearer') - { - return tap($this, function () use ($token, $type) { - $this->options['headers']['Authorization'] = trim($type.' '.$token); - }); - } - - /** - * Specify the user agent for the request. - * - * @param string $userAgent - * @return $this - */ - public function withUserAgent($userAgent) - { - return tap($this, function () use ($userAgent) { - $this->options['headers']['User-Agent'] = trim($userAgent); - }); - } - - /** - * Specify the cookies that should be included with the request. - * - * @param array $cookies - * @param string $domain - * @return $this - */ - public function withCookies(array $cookies, string $domain) - { - return tap($this, function () use ($cookies, $domain) { - $this->options = array_merge_recursive($this->options, [ - 'cookies' => CookieJar::fromArray($cookies, $domain), - ]); - }); - } - - /** - * Specify the maximum number of redirects to allow. - * - * @param int $max - * @return $this - */ - public function maxRedirects(int $max) - { - return tap($this, function () use ($max) { - $this->options['allow_redirects']['max'] = $max; - }); - } - - /** - * Indicate that redirects should not be followed. - * - * @return $this - */ - public function withoutRedirecting() - { - return tap($this, function () { - $this->options['allow_redirects'] = false; - }); - } - - /** - * Indicate that TLS certificates should not be verified. - * - * @return $this - */ - public function withoutVerifying() - { - return tap($this, function () { - $this->options['verify'] = false; - }); - } - - /** - * Specify the path where the body of the response should be stored. - * - * @param string|resource $to - * @return $this - */ - public function sink($to) - { - return tap($this, function () use ($to) { - $this->options['sink'] = $to; - }); - } - - /** - * Specify the timeout (in seconds) for the request. - * - * @param int $seconds - * @return $this - */ - public function timeout(int $seconds) - { - return tap($this, function () use ($seconds) { - $this->options['timeout'] = $seconds; - }); - } - - /** - * Specify the connect timeout (in seconds) for the request. - * - * @param int $seconds - * @return $this - */ - public function connectTimeout(int $seconds) - { - return tap($this, function () use ($seconds) { - $this->options['connect_timeout'] = $seconds; - }); - } - - /** - * Specify the number of times the request should be attempted. - * - * @param int $times - * @param int $sleepMilliseconds - * @param callable|null $when - * @param bool $throw - * @return $this - */ - public function retry(int $times, int $sleepMilliseconds = 0, ?callable $when = null, bool $throw = true) - { - $this->tries = $times; - $this->retryDelay = $sleepMilliseconds; - $this->retryThrow = $throw; - $this->retryWhenCallback = $when; - - return $this; - } - - /** - * Replace the specified options on the request. - * - * @param array $options - * @return $this - */ - public function withOptions(array $options) - { - return tap($this, function () use ($options) { - $this->options = array_replace_recursive( - array_merge_recursive($this->options, Arr::only($options, $this->mergableOptions)), - $options - ); - }); - } - - /** - * Add new middleware the client handler stack. - * - * @param callable $middleware - * @return $this - */ - public function withMiddleware(callable $middleware) - { - $this->middleware->push($middleware); - - return $this; - } - - /** - * Add a new "before sending" callback to the request. - * - * @param callable $callback - * @return $this - */ - public function beforeSending($callback) - { - return tap($this, function () use ($callback) { - $this->beforeSendingCallbacks[] = $callback; - }); - } - - /** - * Throw an exception if a server or client error occurs. - * - * @param callable|null $callback - * @return $this - */ - public function throw(callable $callback = null) - { - $this->throwCallback = $callback ?: fn () => null; - - return $this; - } - - /** - * Throw an exception if a server or client error occurred and the given condition evaluates to true. - * - * @param callable|bool $condition - * @param callable|null $throwCallback - * @return $this - */ - public function throwIf($condition) - { - if (is_callable($condition)) { - $this->throwIfCallback = $condition; - } - - return $condition ? $this->throw(func_get_args()[1] ?? null) : $this; - } - - /** - * Throw an exception if a server or client error occurred and the given condition evaluates to false. - * - * @param bool $condition - * @return $this - */ - public function throwUnless($condition) - { - return $this->throwIf(! $condition); - } - - /** - * Dump the request before sending. - * - * @return $this - */ - public function dump() - { - $values = func_get_args(); - - return $this->beforeSending(function (Request $request, array $options) use ($values) { - foreach (array_merge($values, [$request, $options]) as $value) { - VarDumper::dump($value); - } - }); - } - - /** - * Dump the request before sending and end the script. - * - * @return $this - */ - public function dd() - { - $values = func_get_args(); - - return $this->beforeSending(function (Request $request, array $options) use ($values) { - foreach (array_merge($values, [$request, $options]) as $value) { - VarDumper::dump($value); - } - - exit(1); - }); - } - - /** - * Issue a GET request to the given URL. - * - * @param string $url - * @param array|string|null $query - * @return \Illuminate\Http\Client\Response|\GuzzleHttp\Promise\PromiseInterface - */ - public function get(string $url, $query = null) - { - return $this->send('GET', $url, func_num_args() === 1 ? [] : [ - 'query' => $query, - ]); - } - - /** - * Issue a HEAD request to the given URL. - * - * @param string $url - * @param array|string|null $query - * @return \Illuminate\Http\Client\Response|\GuzzleHttp\Promise\PromiseInterface - */ - public function head(string $url, $query = null) - { - return $this->send('HEAD', $url, func_num_args() === 1 ? [] : [ - 'query' => $query, - ]); - } - - /** - * Issue a POST request to the given URL. - * - * @param string $url - * @param array $data - * @return \Illuminate\Http\Client\Response|\GuzzleHttp\Promise\PromiseInterface - */ - public function post(string $url, $data = []) - { - return $this->send('POST', $url, [ - $this->bodyFormat => $data, - ]); - } - - /** - * Issue a PATCH request to the given URL. - * - * @param string $url - * @param array $data - * @return \Illuminate\Http\Client\Response|\GuzzleHttp\Promise\PromiseInterface - */ - public function patch($url, $data = []) - { - return $this->send('PATCH', $url, [ - $this->bodyFormat => $data, - ]); - } - - /** - * Issue a PUT request to the given URL. - * - * @param string $url - * @param array $data - * @return \Illuminate\Http\Client\Response|\GuzzleHttp\Promise\PromiseInterface - */ - public function put($url, $data = []) - { - return $this->send('PUT', $url, [ - $this->bodyFormat => $data, - ]); - } - - /** - * Issue a DELETE request to the given URL. - * - * @param string $url - * @param array $data - * @return \Illuminate\Http\Client\Response|\GuzzleHttp\Promise\PromiseInterface - */ - public function delete($url, $data = []) - { - return $this->send('DELETE', $url, empty($data) ? [] : [ - $this->bodyFormat => $data, - ]); - } - - /** - * Send a pool of asynchronous requests concurrently. - * - * @param callable $callback - * @return array - */ - public function pool(callable $callback) - { - $results = []; - - $requests = tap(new Pool($this->factory), $callback)->getRequests(); - - foreach ($requests as $key => $item) { - $results[$key] = $item instanceof static ? $item->getPromise()->wait() : $item->wait(); - } - - return $results; - } - - /** - * Send the request to the given URL. - * - * @param string $method - * @param string $url - * @param array $options - * @return \Illuminate\Http\Client\Response|\GuzzleHttp\Promise\PromiseInterface - * - * @throws \Exception - */ - public function send(string $method, string $url, array $options = []) - { - if (! Str::startsWith($url, ['http://', 'https://'])) { - $url = ltrim(rtrim($this->baseUrl, '/').'/'.ltrim($url, '/'), '/'); - } - - $options = $this->parseHttpOptions($options); - - [$this->pendingBody, $this->pendingFiles] = [null, []]; - - if ($this->async) { - return $this->makePromise($method, $url, $options); - } - - $shouldRetry = null; - - return retry($this->tries ?? 1, function ($attempt) use ($method, $url, $options, &$shouldRetry) { - try { - return tap(new Response($this->sendRequest($method, $url, $options)), function ($response) use ($attempt, &$shouldRetry) { - $this->populateResponse($response); - - $this->dispatchResponseReceivedEvent($response); - - if (! $response->successful()) { - try { - $shouldRetry = $this->retryWhenCallback ? call_user_func($this->retryWhenCallback, $response->toException(), $this) : true; - } catch (Exception $exception) { - $shouldRetry = false; - - throw $exception; - } - - if ($this->throwCallback && - ($this->throwIfCallback === null || - call_user_func($this->throwIfCallback, $response))) { - $response->throw($this->throwCallback); - } - - if ($attempt < $this->tries && $shouldRetry) { - $response->throw(); - } - - if ($this->tries > 1 && $this->retryThrow) { - $response->throw(); - } - } - }); - } catch (ConnectException $e) { - $this->dispatchConnectionFailedEvent(); - - throw new ConnectionException($e->getMessage(), 0, $e); - } - }, $this->retryDelay ?? 100, function ($exception) use (&$shouldRetry) { - $result = $shouldRetry ?? ($this->retryWhenCallback ? call_user_func($this->retryWhenCallback, $exception, $this) : true); - - $shouldRetry = null; - - return $result; - }); - } - - /** - * Parse the given HTTP options and set the appropriate additional options. - * - * @param array $options - * @return array - */ - protected function parseHttpOptions(array $options) - { - if (isset($options[$this->bodyFormat])) { - if ($this->bodyFormat === 'multipart') { - $options[$this->bodyFormat] = $this->parseMultipartBodyFormat($options[$this->bodyFormat]); - } elseif ($this->bodyFormat === 'body') { - $options[$this->bodyFormat] = $this->pendingBody; - } - - if (is_array($options[$this->bodyFormat])) { - $options[$this->bodyFormat] = array_merge( - $options[$this->bodyFormat], $this->pendingFiles - ); - } - } else { - $options[$this->bodyFormat] = $this->pendingBody; - } - - return collect($options)->map(function ($value, $key) { - if ($key === 'json' && $value instanceof JsonSerializable) { - return $value; - } - - return $value instanceof Arrayable ? $value->toArray() : $value; - })->all(); - } - - /** - * Parse multi-part form data. - * - * @param array $data - * @return array|array[] - */ - protected function parseMultipartBodyFormat(array $data) - { - return collect($data)->map(function ($value, $key) { - return is_array($value) ? $value : ['name' => $key, 'contents' => $value]; - })->values()->all(); - } - - /** - * Send an asynchronous request to the given URL. - * - * @param string $method - * @param string $url - * @param array $options - * @return \GuzzleHttp\Promise\PromiseInterface - */ - protected function makePromise(string $method, string $url, array $options = []) - { - return $this->promise = $this->sendRequest($method, $url, $options) - ->then(function (MessageInterface $message) { - return tap(new Response($message), function ($response) { - $this->populateResponse($response); - $this->dispatchResponseReceivedEvent($response); - }); - }) - ->otherwise(function (TransferException $e) { - return $e instanceof RequestException && $e->hasResponse() ? $this->populateResponse(new Response($e->getResponse())) : $e; - }); - } - - /** - * Send a request either synchronously or asynchronously. - * - * @param string $method - * @param string $url - * @param array $options - * @return \Psr\Http\Message\MessageInterface|\GuzzleHttp\Promise\PromiseInterface - * - * @throws \Exception - */ - protected function sendRequest(string $method, string $url, array $options = []) - { - $clientMethod = $this->async ? 'requestAsync' : 'request'; - - $laravelData = $this->parseRequestData($method, $url, $options); - - return $this->buildClient()->$clientMethod($method, $url, $this->mergeOptions([ - 'laravel_data' => $laravelData, - 'on_stats' => function ($transferStats) { - $this->transferStats = $transferStats; - }, - ], $options)); - } - - /** - * Get the request data as an array so that we can attach it to the request for convenient assertions. - * - * @param string $method - * @param string $url - * @param array $options - * @return array - */ - protected function parseRequestData($method, $url, array $options) - { - if ($this->bodyFormat === 'body') { - return []; - } - - $laravelData = $options[$this->bodyFormat] ?? $options['query'] ?? []; - - $urlString = Str::of($url); - - if (empty($laravelData) && $method === 'GET' && $urlString->contains('?')) { - $laravelData = (string) $urlString->after('?'); - } - - if (is_string($laravelData)) { - parse_str($laravelData, $parsedData); - - $laravelData = is_array($parsedData) ? $parsedData : []; - } - - if ($laravelData instanceof JsonSerializable) { - $laravelData = $laravelData->jsonSerialize(); - } - - return is_array($laravelData) ? $laravelData : []; - } - - /** - * Populate the given response with additional data. - * - * @param \Illuminate\Http\Client\Response $response - * @return \Illuminate\Http\Client\Response - */ - protected function populateResponse(Response $response) - { - $response->cookies = $this->cookies; - - $response->transferStats = $this->transferStats; - - return $response; - } - - /** - * Build the Guzzle client. - * - * @return \GuzzleHttp\Client - */ - public function buildClient() - { - return $this->client ?? $this->createClient($this->buildHandlerStack()); - } - - /** - * Determine if a reusable client is required. - * - * @return bool - */ - protected function requestsReusableClient() - { - return ! is_null($this->client) || $this->async; - } - - /** - * Retrieve a reusable Guzzle client. - * - * @return \GuzzleHttp\Client - */ - protected function getReusableClient() - { - return $this->client = $this->client ?: $this->createClient($this->buildHandlerStack()); - } - - /** - * Create new Guzzle client. - * - * @param \GuzzleHttp\HandlerStack $handlerStack - * @return \GuzzleHttp\Client - */ - public function createClient($handlerStack) - { - return new Client([ - 'handler' => $handlerStack, - 'cookies' => true, - ]); - } - - /** - * Build the Guzzle client handler stack. - * - * @return \GuzzleHttp\HandlerStack - */ - public function buildHandlerStack() - { - return $this->pushHandlers(HandlerStack::create($this->handler)); - } - - /** - * Add the necessary handlers to the given handler stack. - * - * @param \GuzzleHttp\HandlerStack $handlerStack - * @return \GuzzleHttp\HandlerStack - */ - public function pushHandlers($handlerStack) - { - return tap($handlerStack, function ($stack) { - $stack->push($this->buildBeforeSendingHandler()); - $stack->push($this->buildRecorderHandler()); - - $this->middleware->each(function ($middleware) use ($stack) { - $stack->push($middleware); - }); - - $stack->push($this->buildStubHandler()); - }); - } - - /** - * Build the before sending handler. - * - * @return \Closure - */ - public function buildBeforeSendingHandler() - { - return function ($handler) { - return function ($request, $options) use ($handler) { - return $handler($this->runBeforeSendingCallbacks($request, $options), $options); - }; - }; - } - - /** - * Build the recorder handler. - * - * @return \Closure - */ - public function buildRecorderHandler() - { - return function ($handler) { - return function ($request, $options) use ($handler) { - $promise = $handler($request, $options); - - return $promise->then(function ($response) use ($request, $options) { - $this->factory?->recordRequestResponsePair( - (new Request($request))->withData($options['laravel_data']), - new Response($response) - ); - - return $response; - }); - }; - }; - } - - /** - * Build the stub handler. - * - * @return \Closure - */ - public function buildStubHandler() - { - return function ($handler) { - return function ($request, $options) use ($handler) { - $response = ($this->stubCallbacks ?? collect()) - ->map - ->__invoke((new Request($request))->withData($options['laravel_data']), $options) - ->filter() - ->first(); - - if (is_null($response)) { - if ($this->preventStrayRequests) { - throw new RuntimeException('Attempted request to ['.(string) $request->getUri().'] without a matching fake.'); - } - - return $handler($request, $options); - } - - $response = is_array($response) ? Factory::response($response) : $response; - - $sink = $options['sink'] ?? null; - - if ($sink) { - $response->then($this->sinkStubHandler($sink)); - } - - return $response; - }; - }; - } - - /** - * Get the sink stub handler callback. - * - * @param string $sink - * @return \Closure - */ - protected function sinkStubHandler($sink) - { - return function ($response) use ($sink) { - $body = $response->getBody()->getContents(); - - if (is_string($sink)) { - file_put_contents($sink, $body); - - return; - } - - fwrite($sink, $body); - rewind($sink); - }; - } - - /** - * Execute the "before sending" callbacks. - * - * @param \GuzzleHttp\Psr7\RequestInterface $request - * @param array $options - * @return \GuzzleHttp\Psr7\RequestInterface - */ - public function runBeforeSendingCallbacks($request, array $options) - { - return tap($request, function (&$request) use ($options) { - $this->beforeSendingCallbacks->each(function ($callback) use (&$request, $options) { - $callbackResult = call_user_func( - $callback, (new Request($request))->withData($options['laravel_data']), $options, $this - ); - - if ($callbackResult instanceof RequestInterface) { - $request = $callbackResult; - } elseif ($callbackResult instanceof Request) { - $request = $callbackResult->toPsrRequest(); - } - }); - }); - } - - /** - * Replace the given options with the current request options. - * - * @param array $options - * @return array - */ - public function mergeOptions(...$options) - { - return array_replace_recursive( - array_merge_recursive($this->options, Arr::only($options, $this->mergableOptions)), - ...$options - ); - } - - /** - * Register a stub callable that will intercept requests and be able to return stub responses. - * - * @param callable $callback - * @return $this - */ - public function stub($callback) - { - $this->stubCallbacks = collect($callback); - - return $this; - } - - /** - * Indicate that an exception should be thrown if any request is not faked. - * - * @param bool $prevent - * @return $this - */ - public function preventStrayRequests($prevent = true) - { - $this->preventStrayRequests = $prevent; - - return $this; - } - - /** - * Toggle asynchronicity in requests. - * - * @param bool $async - * @return $this - */ - public function async(bool $async = true) - { - $this->async = $async; - - return $this; - } - - /** - * Retrieve the pending request promise. - * - * @return \GuzzleHttp\Promise\PromiseInterface|null - */ - public function getPromise() - { - return $this->promise; - } - - /** - * Dispatch the RequestSending event if a dispatcher is available. - * - * @return void - */ - protected function dispatchRequestSendingEvent() - { - if ($dispatcher = $this->factory?->getDispatcher()) { - $dispatcher->dispatch(new RequestSending($this->request)); - } - } - - /** - * Dispatch the ResponseReceived event if a dispatcher is available. - * - * @param \Illuminate\Http\Client\Response $response - * @return void - */ - protected function dispatchResponseReceivedEvent(Response $response) - { - if (! ($dispatcher = $this->factory?->getDispatcher()) || - ! $this->request) { - return; - } - - $dispatcher->dispatch(new ResponseReceived($this->request, $response)); - } - - /** - * Dispatch the ConnectionFailed event if a dispatcher is available. - * - * @return void - */ - protected function dispatchConnectionFailedEvent() - { - if ($dispatcher = $this->factory?->getDispatcher()) { - $dispatcher->dispatch(new ConnectionFailed($this->request)); - } - } - - /** - * Set the client instance. - * - * @param \GuzzleHttp\Client $client - * @return $this - */ - public function setClient(Client $client) - { - $this->client = $client; - - return $this; - } - - /** - * Create a new client instance using the given handler. - * - * @param callable $handler - * @return $this - */ - public function setHandler($handler) - { - $this->handler = $handler; - - return $this; - } - - /** - * Get the pending request options. - * - * @return array - */ - public function getOptions() - { - return $this->options; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/Client/Pool.php b/vendor/laravel/framework/src/Illuminate/Http/Client/Pool.php deleted file mode 100644 index bedffcb1..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Client/Pool.php +++ /dev/null @@ -1,92 +0,0 @@ -factory = $factory ?: new Factory(); - - if (method_exists(Utils::class, 'chooseHandler')) { - $this->handler = Utils::chooseHandler(); - } else { - $this->handler = \GuzzleHttp\choose_handler(); - } - } - - /** - * Add a request to the pool with a key. - * - * @param string $key - * @return \Illuminate\Http\Client\PendingRequest - */ - public function as(string $key) - { - return $this->pool[$key] = $this->asyncRequest(); - } - - /** - * Retrieve a new async pending request. - * - * @return \Illuminate\Http\Client\PendingRequest - */ - protected function asyncRequest() - { - return $this->factory->setHandler($this->handler)->async(); - } - - /** - * Retrieve the requests in the pool. - * - * @return array - */ - public function getRequests() - { - return $this->pool; - } - - /** - * Add a request to the pool with a numeric index. - * - * @param string $method - * @param array $parameters - * @return \Illuminate\Http\Client\PendingRequest - */ - public function __call($method, $parameters) - { - return $this->pool[] = $this->asyncRequest()->$method(...$parameters); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/Client/Request.php b/vendor/laravel/framework/src/Illuminate/Http/Client/Request.php deleted file mode 100644 index 3c2d6a9b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Client/Request.php +++ /dev/null @@ -1,305 +0,0 @@ -request = $request; - } - - /** - * Get the request method. - * - * @return string - */ - public function method() - { - return $this->request->getMethod(); - } - - /** - * Get the URL of the request. - * - * @return string - */ - public function url() - { - return (string) $this->request->getUri(); - } - - /** - * Determine if the request has a given header. - * - * @param string $key - * @param mixed $value - * @return bool - */ - public function hasHeader($key, $value = null) - { - if (is_null($value)) { - return ! empty($this->request->getHeaders()[$key]); - } - - $headers = $this->headers(); - - if (! Arr::has($headers, $key)) { - return false; - } - - $value = is_array($value) ? $value : [$value]; - - return empty(array_diff($value, $headers[$key])); - } - - /** - * Determine if the request has the given headers. - * - * @param array|string $headers - * @return bool - */ - public function hasHeaders($headers) - { - if (is_string($headers)) { - $headers = [$headers => null]; - } - - foreach ($headers as $key => $value) { - if (! $this->hasHeader($key, $value)) { - return false; - } - } - - return true; - } - - /** - * Get the values for the header with the given name. - * - * @param string $key - * @return array - */ - public function header($key) - { - return Arr::get($this->headers(), $key, []); - } - - /** - * Get the request headers. - * - * @return array - */ - public function headers() - { - return $this->request->getHeaders(); - } - - /** - * Get the body of the request. - * - * @return string - */ - public function body() - { - return (string) $this->request->getBody(); - } - - /** - * Determine if the request contains the given file. - * - * @param string $name - * @param string|null $value - * @param string|null $filename - * @return bool - */ - public function hasFile($name, $value = null, $filename = null) - { - if (! $this->isMultipart()) { - return false; - } - - return collect($this->data)->reject(function ($file) use ($name, $value, $filename) { - return $file['name'] != $name || - ($value && $file['contents'] != $value) || - ($filename && $file['filename'] != $filename); - })->count() > 0; - } - - /** - * Get the request's data (form parameters or JSON). - * - * @return array - */ - public function data() - { - if ($this->isForm()) { - return $this->parameters(); - } elseif ($this->isJson()) { - return $this->json(); - } - - return $this->data ?? []; - } - - /** - * Get the request's form parameters. - * - * @return array - */ - protected function parameters() - { - if (! $this->data) { - parse_str($this->body(), $parameters); - - $this->data = $parameters; - } - - return $this->data; - } - - /** - * Get the JSON decoded body of the request. - * - * @return array - */ - protected function json() - { - if (! $this->data) { - $this->data = json_decode($this->body(), true); - } - - return $this->data; - } - - /** - * Determine if the request is simple form data. - * - * @return bool - */ - public function isForm() - { - return $this->hasHeader('Content-Type', 'application/x-www-form-urlencoded'); - } - - /** - * Determine if the request is JSON. - * - * @return bool - */ - public function isJson() - { - return $this->hasHeader('Content-Type') && - str_contains($this->header('Content-Type')[0], 'json'); - } - - /** - * Determine if the request is multipart. - * - * @return bool - */ - public function isMultipart() - { - return $this->hasHeader('Content-Type') && - str_contains($this->header('Content-Type')[0], 'multipart'); - } - - /** - * Set the decoded data on the request. - * - * @param array $data - * @return $this - */ - public function withData(array $data) - { - $this->data = $data; - - return $this; - } - - /** - * Get the underlying PSR compliant request instance. - * - * @return \Psr\Http\Message\RequestInterface - */ - public function toPsrRequest() - { - return $this->request; - } - - /** - * Determine if the given offset exists. - * - * @param string $offset - * @return bool - */ - public function offsetExists($offset): bool - { - return isset($this->data()[$offset]); - } - - /** - * Get the value for a given offset. - * - * @param string $offset - * @return mixed - */ - public function offsetGet($offset): mixed - { - return $this->data()[$offset]; - } - - /** - * Set the value at the given offset. - * - * @param string $offset - * @param mixed $value - * @return void - * - * @throws \LogicException - */ - public function offsetSet($offset, $value): void - { - throw new LogicException('Request data may not be mutated using array access.'); - } - - /** - * Unset the value at the given offset. - * - * @param string $offset - * @return void - * - * @throws \LogicException - */ - public function offsetUnset($offset): void - { - throw new LogicException('Request data may not be mutated using array access.'); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/Client/RequestException.php b/vendor/laravel/framework/src/Illuminate/Http/Client/RequestException.php deleted file mode 100644 index fa4f4183..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Client/RequestException.php +++ /dev/null @@ -1,43 +0,0 @@ -prepareMessage($response), $response->status()); - - $this->response = $response; - } - - /** - * Prepare the exception message. - * - * @param \Illuminate\Http\Client\Response $response - * @return string - */ - protected function prepareMessage(Response $response) - { - $message = "HTTP request returned status code {$response->status()}"; - - $summary = class_exists(\GuzzleHttp\Psr7\Message::class) - ? \GuzzleHttp\Psr7\Message::bodySummary($response->toPsrResponse()) - : \GuzzleHttp\Psr7\get_message_body_summary($response->toPsrResponse()); - - return is_null($summary) ? $message : $message .= ":\n{$summary}\n"; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/Client/Response.php b/vendor/laravel/framework/src/Illuminate/Http/Client/Response.php deleted file mode 100644 index cc9bfd6b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Client/Response.php +++ /dev/null @@ -1,415 +0,0 @@ -response = $response; - } - - /** - * Get the body of the response. - * - * @return string - */ - public function body() - { - return (string) $this->response->getBody(); - } - - /** - * Get the JSON decoded body of the response as an array or scalar value. - * - * @param string|null $key - * @param mixed $default - * @return mixed - */ - public function json($key = null, $default = null) - { - if (! $this->decoded) { - $this->decoded = json_decode($this->body(), true); - } - - if (is_null($key)) { - return $this->decoded; - } - - return data_get($this->decoded, $key, $default); - } - - /** - * Get the JSON decoded body of the response as an object. - * - * @return object|array - */ - public function object() - { - return json_decode($this->body(), false); - } - - /** - * Get the JSON decoded body of the response as a collection. - * - * @param string|null $key - * @return \Illuminate\Support\Collection - */ - public function collect($key = null) - { - return Collection::make($this->json($key)); - } - - /** - * Get a header from the response. - * - * @param string $header - * @return string - */ - public function header(string $header) - { - return $this->response->getHeaderLine($header); - } - - /** - * Get the headers from the response. - * - * @return array - */ - public function headers() - { - return $this->response->getHeaders(); - } - - /** - * Get the status code of the response. - * - * @return int - */ - public function status() - { - return (int) $this->response->getStatusCode(); - } - - /** - * Get the reason phrase of the response. - * - * @return string - */ - public function reason() - { - return $this->response->getReasonPhrase(); - } - - /** - * Get the effective URI of the response. - * - * @return \Psr\Http\Message\UriInterface|null - */ - public function effectiveUri() - { - return $this->transferStats?->getEffectiveUri(); - } - - /** - * Determine if the request was successful. - * - * @return bool - */ - public function successful() - { - return $this->status() >= 200 && $this->status() < 300; - } - - /** - * Determine if the response code was "OK". - * - * @return bool - */ - public function ok() - { - return $this->status() === 200; - } - - /** - * Determine if the response was a redirect. - * - * @return bool - */ - public function redirect() - { - return $this->status() >= 300 && $this->status() < 400; - } - - /** - * Determine if the response was a 401 "Unauthorized" response. - * - * @return bool - */ - public function unauthorized() - { - return $this->status() === 401; - } - - /** - * Determine if the response was a 403 "Forbidden" response. - * - * @return bool - */ - public function forbidden() - { - return $this->status() === 403; - } - - /** - * Determine if the response indicates a client or server error occurred. - * - * @return bool - */ - public function failed() - { - return $this->serverError() || $this->clientError(); - } - - /** - * Determine if the response indicates a client error occurred. - * - * @return bool - */ - public function clientError() - { - return $this->status() >= 400 && $this->status() < 500; - } - - /** - * Determine if the response indicates a server error occurred. - * - * @return bool - */ - public function serverError() - { - return $this->status() >= 500; - } - - /** - * Execute the given callback if there was a server or client error. - * - * @param callable $callback - * @return $this - */ - public function onError(callable $callback) - { - if ($this->failed()) { - $callback($this); - } - - return $this; - } - - /** - * Get the response cookies. - * - * @return \GuzzleHttp\Cookie\CookieJar - */ - public function cookies() - { - return $this->cookies; - } - - /** - * Get the handler stats of the response. - * - * @return array - */ - public function handlerStats() - { - return $this->transferStats?->getHandlerStats() ?? []; - } - - /** - * Close the stream and any underlying resources. - * - * @return $this - */ - public function close() - { - $this->response->getBody()->close(); - - return $this; - } - - /** - * Get the underlying PSR response for the response. - * - * @return \Psr\Http\Message\ResponseInterface - */ - public function toPsrResponse() - { - return $this->response; - } - - /** - * Create an exception if a server or client error occurred. - * - * @return \Illuminate\Http\Client\RequestException|null - */ - public function toException() - { - if ($this->failed()) { - return new RequestException($this); - } - } - - /** - * Throw an exception if a server or client error occurred. - * - * @param \Closure|null $callback - * @return $this - * - * @throws \Illuminate\Http\Client\RequestException - */ - public function throw() - { - $callback = func_get_args()[0] ?? null; - - if ($this->failed()) { - throw tap($this->toException(), function ($exception) use ($callback) { - if ($callback && is_callable($callback)) { - $callback($this, $exception); - } - }); - } - - return $this; - } - - /** - * Throw an exception if a server or client error occurred and the given condition evaluates to true. - * - * @param \Closure|bool $condition - * @param \Closure|null $throwCallback - * @return $this - * - * @throws \Illuminate\Http\Client\RequestException - */ - public function throwIf($condition) - { - return value($condition, $this) ? $this->throw(func_get_args()[1] ?? null) : $this; - } - - /** - * Determine if the given offset exists. - * - * @param string $offset - * @return bool - */ - public function offsetExists($offset): bool - { - return isset($this->json()[$offset]); - } - - /** - * Get the value for a given offset. - * - * @param string $offset - * @return mixed - */ - public function offsetGet($offset): mixed - { - return $this->json()[$offset]; - } - - /** - * Set the value at the given offset. - * - * @param string $offset - * @param mixed $value - * @return void - * - * @throws \LogicException - */ - public function offsetSet($offset, $value): void - { - throw new LogicException('Response data may not be mutated using array access.'); - } - - /** - * Unset the value at the given offset. - * - * @param string $offset - * @return void - * - * @throws \LogicException - */ - public function offsetUnset($offset): void - { - throw new LogicException('Response data may not be mutated using array access.'); - } - - /** - * Get the body of the response. - * - * @return string - */ - public function __toString() - { - return $this->body(); - } - - /** - * Dynamically proxy other methods to the underlying response. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - return static::hasMacro($method) - ? $this->macroCall($method, $parameters) - : $this->response->{$method}(...$parameters); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/Client/ResponseSequence.php b/vendor/laravel/framework/src/Illuminate/Http/Client/ResponseSequence.php deleted file mode 100644 index ddcecbd5..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Client/ResponseSequence.php +++ /dev/null @@ -1,156 +0,0 @@ -responses = $responses; - } - - /** - * Push a response to the sequence. - * - * @param string|array|null $body - * @param int $status - * @param array $headers - * @return $this - */ - public function push($body = null, int $status = 200, array $headers = []) - { - return $this->pushResponse( - Factory::response($body, $status, $headers) - ); - } - - /** - * Push a response with the given status code to the sequence. - * - * @param int $status - * @param array $headers - * @return $this - */ - public function pushStatus(int $status, array $headers = []) - { - return $this->pushResponse( - Factory::response('', $status, $headers) - ); - } - - /** - * Push response with the contents of a file as the body to the sequence. - * - * @param string $filePath - * @param int $status - * @param array $headers - * @return $this - */ - public function pushFile(string $filePath, int $status = 200, array $headers = []) - { - $string = file_get_contents($filePath); - - return $this->pushResponse( - Factory::response($string, $status, $headers) - ); - } - - /** - * Push a response to the sequence. - * - * @param mixed $response - * @return $this - */ - public function pushResponse($response) - { - $this->responses[] = $response; - - return $this; - } - - /** - * Make the sequence return a default response when it is empty. - * - * @param \GuzzleHttp\Promise\PromiseInterface|\Closure $response - * @return $this - */ - public function whenEmpty($response) - { - $this->failWhenEmpty = false; - $this->emptyResponse = $response; - - return $this; - } - - /** - * Make the sequence return a default response when it is empty. - * - * @return $this - */ - public function dontFailWhenEmpty() - { - return $this->whenEmpty(Factory::response()); - } - - /** - * Indicate that this sequence has depleted all of its responses. - * - * @return bool - */ - public function isEmpty() - { - return count($this->responses) === 0; - } - - /** - * Get the next response in the sequence. - * - * @return mixed - * - * @throws \OutOfBoundsException - */ - public function __invoke() - { - if ($this->failWhenEmpty && count($this->responses) === 0) { - throw new OutOfBoundsException('A request was made, but the response sequence is empty.'); - } - - if (! $this->failWhenEmpty && count($this->responses) === 0) { - return value($this->emptyResponse ?? Factory::response()); - } - - return array_shift($this->responses); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/Concerns/CanBePrecognitive.php b/vendor/laravel/framework/src/Illuminate/Http/Concerns/CanBePrecognitive.php deleted file mode 100644 index 54cd79d4..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Concerns/CanBePrecognitive.php +++ /dev/null @@ -1,45 +0,0 @@ -headers->has('Precognition-Validate-Only')) { - return $rules; - } - - return Collection::make($rules) - ->only(explode(',', $this->header('Precognition-Validate-Only'))) - ->all(); - } - - /** - * Determine if the request is attempting to be precognitive. - * - * @return bool - */ - public function isAttemptingPrecognition() - { - return $this->header('Precognition') === 'true'; - } - - /** - * Determine if the request is precognitive. - * - * @return bool - */ - public function isPrecognitive() - { - return $this->attributes->get('precognitive', false); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithContentTypes.php b/vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithContentTypes.php deleted file mode 100644 index 0d5f62fc..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithContentTypes.php +++ /dev/null @@ -1,179 +0,0 @@ -header('CONTENT_TYPE') ?? '', ['/json', '+json']); - } - - /** - * Determine if the current request probably expects a JSON response. - * - * @return bool - */ - public function expectsJson() - { - return ($this->ajax() && ! $this->pjax() && $this->acceptsAnyContentType()) || $this->wantsJson(); - } - - /** - * Determine if the current request is asking for JSON. - * - * @return bool - */ - public function wantsJson() - { - $acceptable = $this->getAcceptableContentTypes(); - - return isset($acceptable[0]) && Str::contains(strtolower($acceptable[0]), ['/json', '+json']); - } - - /** - * Determines whether the current requests accepts a given content type. - * - * @param string|array $contentTypes - * @return bool - */ - public function accepts($contentTypes) - { - $accepts = $this->getAcceptableContentTypes(); - - if (count($accepts) === 0) { - return true; - } - - $types = (array) $contentTypes; - - foreach ($accepts as $accept) { - if ($accept === '*/*' || $accept === '*') { - return true; - } - - foreach ($types as $type) { - $accept = strtolower($accept); - - $type = strtolower($type); - - if ($this->matchesType($accept, $type) || $accept === strtok($type, '/').'/*') { - return true; - } - } - } - - return false; - } - - /** - * Return the most suitable content type from the given array based on content negotiation. - * - * @param string|array $contentTypes - * @return string|null - */ - public function prefers($contentTypes) - { - $accepts = $this->getAcceptableContentTypes(); - - $contentTypes = (array) $contentTypes; - - foreach ($accepts as $accept) { - if (in_array($accept, ['*/*', '*'])) { - return $contentTypes[0]; - } - - foreach ($contentTypes as $contentType) { - $type = $contentType; - - if (! is_null($mimeType = $this->getMimeType($contentType))) { - $type = $mimeType; - } - - $accept = strtolower($accept); - - $type = strtolower($type); - - if ($this->matchesType($type, $accept) || $accept === strtok($type, '/').'/*') { - return $contentType; - } - } - } - } - - /** - * Determine if the current request accepts any content type. - * - * @return bool - */ - public function acceptsAnyContentType() - { - $acceptable = $this->getAcceptableContentTypes(); - - return count($acceptable) === 0 || ( - isset($acceptable[0]) && ($acceptable[0] === '*/*' || $acceptable[0] === '*') - ); - } - - /** - * Determines whether a request accepts JSON. - * - * @return bool - */ - public function acceptsJson() - { - return $this->accepts('application/json'); - } - - /** - * Determines whether a request accepts HTML. - * - * @return bool - */ - public function acceptsHtml() - { - return $this->accepts('text/html'); - } - - /** - * Determine if the given content types match. - * - * @param string $actual - * @param string $type - * @return bool - */ - public static function matchesType($actual, $type) - { - if ($actual === $type) { - return true; - } - - $split = explode('/', $actual); - - return isset($split[1]) && preg_match('#'.preg_quote($split[0], '#').'/.+\+'.preg_quote($split[1], '#').'#', $type); - } - - /** - * Get the data format expected in the response. - * - * @param string $default - * @return string - */ - public function format($default = 'html') - { - foreach ($this->getAcceptableContentTypes() as $type) { - if ($format = $this->getFormat($type)) { - return $format; - } - } - - return $default; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithFlashData.php b/vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithFlashData.php deleted file mode 100644 index a7dfa1c8..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithFlashData.php +++ /dev/null @@ -1,68 +0,0 @@ -getAttribute($key) : $default; - - return $this->hasSession() ? $this->session()->getOldInput($key, $default) : $default; - } - - /** - * Flash the input for the current request to the session. - * - * @return void - */ - public function flash() - { - $this->session()->flashInput($this->input()); - } - - /** - * Flash only some of the input to the session. - * - * @param array|mixed $keys - * @return void - */ - public function flashOnly($keys) - { - $this->session()->flashInput( - $this->only(is_array($keys) ? $keys : func_get_args()) - ); - } - - /** - * Flash only some of the input to the session. - * - * @param array|mixed $keys - * @return void - */ - public function flashExcept($keys) - { - $this->session()->flashInput( - $this->except(is_array($keys) ? $keys : func_get_args()) - ); - } - - /** - * Flush all of the old input from the session. - * - * @return void - */ - public function flush() - { - $this->session()->flashInput([]); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithInput.php b/vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithInput.php deleted file mode 100644 index 83575311..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithInput.php +++ /dev/null @@ -1,637 +0,0 @@ -retrieveItem('server', $key, $default); - } - - /** - * Determine if a header is set on the request. - * - * @param string $key - * @return bool - */ - public function hasHeader($key) - { - return ! is_null($this->header($key)); - } - - /** - * Retrieve a header from the request. - * - * @param string|null $key - * @param string|array|null $default - * @return string|array|null - */ - public function header($key = null, $default = null) - { - return $this->retrieveItem('headers', $key, $default); - } - - /** - * Get the bearer token from the request headers. - * - * @return string|null - */ - public function bearerToken() - { - $header = $this->header('Authorization', ''); - - $position = strrpos($header, 'Bearer '); - - if ($position !== false) { - $header = substr($header, $position + 7); - - return str_contains($header, ',') ? strstr($header, ',', true) : $header; - } - } - - /** - * Determine if the request contains a given input item key. - * - * @param string|array $key - * @return bool - */ - public function exists($key) - { - return $this->has($key); - } - - /** - * Determine if the request contains a given input item key. - * - * @param string|array $key - * @return bool - */ - public function has($key) - { - $keys = is_array($key) ? $key : func_get_args(); - - $input = $this->all(); - - foreach ($keys as $value) { - if (! Arr::has($input, $value)) { - return false; - } - } - - return true; - } - - /** - * Determine if the request contains any of the given inputs. - * - * @param string|array $keys - * @return bool - */ - public function hasAny($keys) - { - $keys = is_array($keys) ? $keys : func_get_args(); - - $input = $this->all(); - - return Arr::hasAny($input, $keys); - } - - /** - * Apply the callback if the request contains the given input item key. - * - * @param string $key - * @param callable $callback - * @param callable|null $default - * @return $this|mixed - */ - public function whenHas($key, callable $callback, callable $default = null) - { - if ($this->has($key)) { - return $callback(data_get($this->all(), $key)) ?: $this; - } - - if ($default) { - return $default(); - } - - return $this; - } - - /** - * Determine if the request contains a non-empty value for an input item. - * - * @param string|array $key - * @return bool - */ - public function filled($key) - { - $keys = is_array($key) ? $key : func_get_args(); - - foreach ($keys as $value) { - if ($this->isEmptyString($value)) { - return false; - } - } - - return true; - } - - /** - * Determine if the request contains an empty value for an input item. - * - * @param string|array $key - * @return bool - */ - public function isNotFilled($key) - { - $keys = is_array($key) ? $key : func_get_args(); - - foreach ($keys as $value) { - if (! $this->isEmptyString($value)) { - return false; - } - } - - return true; - } - - /** - * Determine if the request contains a non-empty value for any of the given inputs. - * - * @param string|array $keys - * @return bool - */ - public function anyFilled($keys) - { - $keys = is_array($keys) ? $keys : func_get_args(); - - foreach ($keys as $key) { - if ($this->filled($key)) { - return true; - } - } - - return false; - } - - /** - * Apply the callback if the request contains a non-empty value for the given input item key. - * - * @param string $key - * @param callable $callback - * @param callable|null $default - * @return $this|mixed - */ - public function whenFilled($key, callable $callback, callable $default = null) - { - if ($this->filled($key)) { - return $callback(data_get($this->all(), $key)) ?: $this; - } - - if ($default) { - return $default(); - } - - return $this; - } - - /** - * Determine if the request is missing a given input item key. - * - * @param string|array $key - * @return bool - */ - public function missing($key) - { - $keys = is_array($key) ? $key : func_get_args(); - - return ! $this->has($keys); - } - - /** - * Apply the callback if the request is missing the given input item key. - * - * @param string $key - * @param callable $callback - * @param callable|null $default - * @return $this|mixed - */ - public function whenMissing($key, callable $callback, callable $default = null) - { - if ($this->missing($key)) { - return $callback(data_get($this->all(), $key)) ?: $this; - } - - if ($default) { - return $default(); - } - - return $this; - } - - /** - * Determine if the given input key is an empty string for "has". - * - * @param string $key - * @return bool - */ - protected function isEmptyString($key) - { - $value = $this->input($key); - - return ! is_bool($value) && ! is_array($value) && trim((string) $value) === ''; - } - - /** - * Get the keys for all of the input and files. - * - * @return array - */ - public function keys() - { - return array_merge(array_keys($this->input()), $this->files->keys()); - } - - /** - * Get all of the input and files for the request. - * - * @param array|mixed|null $keys - * @return array - */ - public function all($keys = null) - { - $input = array_replace_recursive($this->input(), $this->allFiles()); - - if (! $keys) { - return $input; - } - - $results = []; - - foreach (is_array($keys) ? $keys : func_get_args() as $key) { - Arr::set($results, $key, Arr::get($input, $key)); - } - - return $results; - } - - /** - * Retrieve an input item from the request. - * - * @param string|null $key - * @param mixed $default - * @return mixed - */ - public function input($key = null, $default = null) - { - return data_get( - $this->getInputSource()->all() + $this->query->all(), $key, $default - ); - } - - /** - * Retrieve input from the request as a Stringable instance. - * - * @param string $key - * @param mixed $default - * @return \Illuminate\Support\Stringable - */ - public function str($key, $default = null) - { - return $this->string($key, $default); - } - - /** - * Retrieve input from the request as a Stringable instance. - * - * @param string $key - * @param mixed $default - * @return \Illuminate\Support\Stringable - */ - public function string($key, $default = null) - { - return str($this->input($key, $default)); - } - - /** - * Retrieve input as a boolean value. - * - * Returns true when value is "1", "true", "on", and "yes". Otherwise, returns false. - * - * @param string|null $key - * @param bool $default - * @return bool - */ - public function boolean($key = null, $default = false) - { - return filter_var($this->input($key, $default), FILTER_VALIDATE_BOOLEAN); - } - - /** - * Retrieve input as an integer value. - * - * @param string $key - * @param int $default - * @return int - */ - public function integer($key, $default = 0) - { - return intval($this->input($key, $default)); - } - - /** - * Retrieve input as a float value. - * - * @param string $key - * @param float $default - * @return float - */ - public function float($key, $default = 0.0) - { - return floatval($this->input($key, $default)); - } - - /** - * Retrieve input from the request as a Carbon instance. - * - * @param string $key - * @param string|null $format - * @param string|null $tz - * @return \Illuminate\Support\Carbon|null - * - * @throws \Carbon\Exceptions\InvalidFormatException - */ - public function date($key, $format = null, $tz = null) - { - if ($this->isNotFilled($key)) { - return null; - } - - if (is_null($format)) { - return Date::parse($this->input($key), $tz); - } - - return Date::createFromFormat($format, $this->input($key), $tz); - } - - /** - * Retrieve input from the request as an enum. - * - * @template TEnum - * - * @param string $key - * @param class-string $enumClass - * @return TEnum|null - */ - public function enum($key, $enumClass) - { - if ($this->isNotFilled($key) || - ! function_exists('enum_exists') || - ! enum_exists($enumClass) || - ! method_exists($enumClass, 'tryFrom')) { - return null; - } - - return $enumClass::tryFrom($this->input($key)); - } - - /** - * Retrieve input from the request as a collection. - * - * @param array|string|null $key - * @return \Illuminate\Support\Collection - */ - public function collect($key = null) - { - return collect(is_array($key) ? $this->only($key) : $this->input($key)); - } - - /** - * Get a subset containing the provided keys with values from the input data. - * - * @param array|mixed $keys - * @return array - */ - public function only($keys) - { - $results = []; - - $input = $this->all(); - - $placeholder = new stdClass; - - foreach (is_array($keys) ? $keys : func_get_args() as $key) { - $value = data_get($input, $key, $placeholder); - - if ($value !== $placeholder) { - Arr::set($results, $key, $value); - } - } - - return $results; - } - - /** - * Get all of the input except for a specified array of items. - * - * @param array|mixed $keys - * @return array - */ - public function except($keys) - { - $keys = is_array($keys) ? $keys : func_get_args(); - - $results = $this->all(); - - Arr::forget($results, $keys); - - return $results; - } - - /** - * Retrieve a query string item from the request. - * - * @param string|null $key - * @param string|array|null $default - * @return string|array|null - */ - public function query($key = null, $default = null) - { - return $this->retrieveItem('query', $key, $default); - } - - /** - * Retrieve a request payload item from the request. - * - * @param string|null $key - * @param string|array|null $default - * @return string|array|null - */ - public function post($key = null, $default = null) - { - return $this->retrieveItem('request', $key, $default); - } - - /** - * Determine if a cookie is set on the request. - * - * @param string $key - * @return bool - */ - public function hasCookie($key) - { - return ! is_null($this->cookie($key)); - } - - /** - * Retrieve a cookie from the request. - * - * @param string|null $key - * @param string|array|null $default - * @return string|array|null - */ - public function cookie($key = null, $default = null) - { - return $this->retrieveItem('cookies', $key, $default); - } - - /** - * Get an array of all of the files on the request. - * - * @return array - */ - public function allFiles() - { - $files = $this->files->all(); - - return $this->convertedFiles = $this->convertedFiles ?? $this->convertUploadedFiles($files); - } - - /** - * Convert the given array of Symfony UploadedFiles to custom Laravel UploadedFiles. - * - * @param array $files - * @return array - */ - protected function convertUploadedFiles(array $files) - { - return array_map(function ($file) { - if (is_null($file) || (is_array($file) && empty(array_filter($file)))) { - return $file; - } - - return is_array($file) - ? $this->convertUploadedFiles($file) - : UploadedFile::createFromBase($file); - }, $files); - } - - /** - * Determine if the uploaded data contains a file. - * - * @param string $key - * @return bool - */ - public function hasFile($key) - { - if (! is_array($files = $this->file($key))) { - $files = [$files]; - } - - foreach ($files as $file) { - if ($this->isValidFile($file)) { - return true; - } - } - - return false; - } - - /** - * Check that the given file is a valid file instance. - * - * @param mixed $file - * @return bool - */ - protected function isValidFile($file) - { - return $file instanceof SplFileInfo && $file->getPath() !== ''; - } - - /** - * Retrieve a file from the request. - * - * @param string|null $key - * @param mixed $default - * @return \Illuminate\Http\UploadedFile|\Illuminate\Http\UploadedFile[]|array|null - */ - public function file($key = null, $default = null) - { - return data_get($this->allFiles(), $key, $default); - } - - /** - * Retrieve a parameter item from a given source. - * - * @param string $source - * @param string $key - * @param string|array|null $default - * @return string|array|null - */ - protected function retrieveItem($source, $key, $default) - { - if (is_null($key)) { - return $this->$source->all(); - } - - if ($this->$source instanceof InputBag) { - return $this->$source->all()[$key] ?? $default; - } - - return $this->$source->get($key, $default); - } - - /** - * Dump the request items and end the script. - * - * @param mixed $keys - * @return never - */ - public function dd(...$keys) - { - $this->dump(...$keys); - - exit(1); - } - - /** - * Dump the items. - * - * @param mixed $keys - * @return $this - */ - public function dump($keys = []) - { - $keys = is_array($keys) ? $keys : func_get_args(); - - VarDumper::dump(count($keys) > 0 ? $this->only($keys) : $this->all()); - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/Exceptions/HttpResponseException.php b/vendor/laravel/framework/src/Illuminate/Http/Exceptions/HttpResponseException.php deleted file mode 100644 index b27052f0..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Exceptions/HttpResponseException.php +++ /dev/null @@ -1,37 +0,0 @@ -response = $response; - } - - /** - * Get the underlying response instance. - * - * @return \Symfony\Component\HttpFoundation\Response - */ - public function getResponse() - { - return $this->response; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/Exceptions/PostTooLargeException.php b/vendor/laravel/framework/src/Illuminate/Http/Exceptions/PostTooLargeException.php deleted file mode 100644 index d5bbc60d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Exceptions/PostTooLargeException.php +++ /dev/null @@ -1,23 +0,0 @@ -getRealPath(); - } - - /** - * Get the file's extension. - * - * @return string - */ - public function extension() - { - return $this->guessExtension(); - } - - /** - * Get a filename for the file. - * - * @param string|null $path - * @return string - */ - public function hashName($path = null) - { - if ($path) { - $path = rtrim($path, '/').'/'; - } - - $hash = $this->hashName ?: $this->hashName = Str::random(40); - - if ($extension = $this->guessExtension()) { - $extension = '.'.$extension; - } - - return $path.$hash.$extension; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/JsonResponse.php b/vendor/laravel/framework/src/Illuminate/Http/JsonResponse.php deleted file mode 100755 index 6e2f51df..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/JsonResponse.php +++ /dev/null @@ -1,139 +0,0 @@ -encodingOptions = $options; - - parent::__construct($data, $status, $headers, $json); - } - - /** - * {@inheritdoc} - * - * @return static - */ - public static function fromJsonString(?string $data = null, int $status = 200, array $headers = []): static - { - return new static($data, $status, $headers, 0, true); - } - - /** - * Sets the JSONP callback. - * - * @param string|null $callback - * @return $this - */ - public function withCallback($callback = null) - { - return $this->setCallback($callback); - } - - /** - * Get the json_decoded data from the response. - * - * @param bool $assoc - * @param int $depth - * @return mixed - */ - public function getData($assoc = false, $depth = 512) - { - return json_decode($this->data, $assoc, $depth); - } - - /** - * {@inheritdoc} - * - * @return static - */ - public function setData($data = []): static - { - $this->original = $data; - - // Ensure json_last_error() is cleared... - json_decode('[]'); - - if ($data instanceof Jsonable) { - $this->data = $data->toJson($this->encodingOptions); - } elseif ($data instanceof JsonSerializable) { - $this->data = json_encode($data->jsonSerialize(), $this->encodingOptions); - } elseif ($data instanceof Arrayable) { - $this->data = json_encode($data->toArray(), $this->encodingOptions); - } else { - $this->data = json_encode($data, $this->encodingOptions); - } - - if (! $this->hasValidJson(json_last_error())) { - throw new InvalidArgumentException(json_last_error_msg()); - } - - return $this->update(); - } - - /** - * Determine if an error occurred during JSON encoding. - * - * @param int $jsonError - * @return bool - */ - protected function hasValidJson($jsonError) - { - if ($jsonError === JSON_ERROR_NONE) { - return true; - } - - return $this->hasEncodingOption(JSON_PARTIAL_OUTPUT_ON_ERROR) && - in_array($jsonError, [ - JSON_ERROR_RECURSION, - JSON_ERROR_INF_OR_NAN, - JSON_ERROR_UNSUPPORTED_TYPE, - ]); - } - - /** - * {@inheritdoc} - * - * @return static - */ - public function setEncodingOptions($options): static - { - $this->encodingOptions = (int) $options; - - return $this->setData($this->getData()); - } - - /** - * Determine if a JSON encoding option is set. - * - * @param int $option - * @return bool - */ - public function hasEncodingOption($option) - { - return (bool) ($this->encodingOptions & $option); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/LICENSE.md b/vendor/laravel/framework/src/Illuminate/Http/LICENSE.md deleted file mode 100644 index 79810c84..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Taylor Otwell - -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/laravel/framework/src/Illuminate/Http/Middleware/AddLinkHeadersForPreloadedAssets.php b/vendor/laravel/framework/src/Illuminate/Http/Middleware/AddLinkHeadersForPreloadedAssets.php deleted file mode 100644 index 93ca06e9..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Middleware/AddLinkHeadersForPreloadedAssets.php +++ /dev/null @@ -1,27 +0,0 @@ -header('Link', Collection::make(Vite::preloadedAssets()) - ->map(fn ($attributes, $url) => "<{$url}>; ".implode('; ', $attributes)) - ->join(', ')); - } - }); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/Middleware/CheckResponseForModifications.php b/vendor/laravel/framework/src/Illuminate/Http/Middleware/CheckResponseForModifications.php deleted file mode 100644 index 2a93e21d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Middleware/CheckResponseForModifications.php +++ /dev/null @@ -1,27 +0,0 @@ -isNotModified($request); - } - - return $response; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/Middleware/FrameGuard.php b/vendor/laravel/framework/src/Illuminate/Http/Middleware/FrameGuard.php deleted file mode 100644 index 66edce44..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Middleware/FrameGuard.php +++ /dev/null @@ -1,24 +0,0 @@ -headers->set('X-Frame-Options', 'SAMEORIGIN', false); - - return $response; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php b/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php deleted file mode 100644 index eee03051..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php +++ /dev/null @@ -1,112 +0,0 @@ -container = $container; - $this->cors = $cors; - } - - /** - * Handle the incoming request. - * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @return \Illuminate\Http\Response - */ - public function handle($request, Closure $next) - { - if (! $this->hasMatchingPath($request)) { - return $next($request); - } - - $this->cors->setOptions($this->container['config']->get('cors', [])); - - if ($this->cors->isPreflightRequest($request)) { - $response = $this->cors->handlePreflightRequest($request); - - $this->cors->varyHeader($response, 'Access-Control-Request-Method'); - - return $response; - } - - $response = $next($request); - - if ($request->getMethod() === 'OPTIONS') { - $this->cors->varyHeader($response, 'Access-Control-Request-Method'); - } - - return $this->cors->addActualRequestHeaders($response, $request); - } - - /** - * Get the path from the configuration to determine if the CORS service should run. - * - * @param \Illuminate\Http\Request $request - * @return bool - */ - protected function hasMatchingPath(Request $request): bool - { - $paths = $this->getPathsByHost($request->getHost()); - - foreach ($paths as $path) { - if ($path !== '/') { - $path = trim($path, '/'); - } - - if ($request->fullUrlIs($path) || $request->is($path)) { - return true; - } - } - - return false; - } - - /** - * Get the CORS paths for the given host. - * - * @param string $host - * @return array - */ - protected function getPathsByHost(string $host) - { - $paths = $this->container['config']->get('cors.paths', []); - - if (isset($paths[$host])) { - return $paths[$host]; - } - - return array_filter($paths, function ($path) { - return is_string($path); - }); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/Middleware/SetCacheHeaders.php b/vendor/laravel/framework/src/Illuminate/Http/Middleware/SetCacheHeaders.php deleted file mode 100644 index 0a1a1566..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Middleware/SetCacheHeaders.php +++ /dev/null @@ -1,65 +0,0 @@ -isMethodCacheable() || (! $response->getContent() && ! $response instanceof BinaryFileResponse)) { - return $response; - } - - if (is_string($options)) { - $options = $this->parseOptions($options); - } - - if (isset($options['etag']) && $options['etag'] === true) { - $options['etag'] = $response->getEtag() ?? md5($response->getContent()); - } - - if (isset($options['last_modified'])) { - if (is_numeric($options['last_modified'])) { - $options['last_modified'] = Carbon::createFromTimestamp($options['last_modified']); - } else { - $options['last_modified'] = Carbon::parse($options['last_modified']); - } - } - - $response->setCache($options); - $response->isNotModified($request); - - return $response; - } - - /** - * Parse the given header options. - * - * @param string $options - * @return array - */ - protected function parseOptions($options) - { - return collect(explode(';', rtrim($options, ';')))->mapWithKeys(function ($option) { - $data = explode('=', $option, 2); - - return [$data[0] => $data[1] ?? true]; - })->all(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustHosts.php b/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustHosts.php deleted file mode 100644 index 00a5a44c..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustHosts.php +++ /dev/null @@ -1,73 +0,0 @@ -app = $app; - } - - /** - * Get the host patterns that should be trusted. - * - * @return array - */ - abstract public function hosts(); - - /** - * Handle the incoming request. - * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @return \Illuminate\Http\Response - */ - public function handle(Request $request, $next) - { - if ($this->shouldSpecifyTrustedHosts()) { - Request::setTrustedHosts(array_filter($this->hosts())); - } - - return $next($request); - } - - /** - * Determine if the application should specify trusted hosts. - * - * @return bool - */ - protected function shouldSpecifyTrustedHosts() - { - return ! $this->app->environment('local') && - ! $this->app->runningUnitTests(); - } - - /** - * Get a regular expression matching the application URL and all of its subdomains. - * - * @return string|null - */ - protected function allSubdomainsOfApplicationUrl() - { - if ($host = parse_url($this->app['config']->get('app.url'), PHP_URL_HOST)) { - return '^(.+\.)?'.preg_quote($host).'$'; - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php b/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php deleted file mode 100644 index fd2514e1..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php +++ /dev/null @@ -1,116 +0,0 @@ -getTrustedHeaderNames()); - - $this->setTrustedProxyIpAddresses($request); - - return $next($request); - } - - /** - * Sets the trusted proxies on the request. - * - * @param \Illuminate\Http\Request $request - * @return void - */ - protected function setTrustedProxyIpAddresses(Request $request) - { - $trustedIps = $this->proxies() ?: config('trustedproxy.proxies'); - - if ($trustedIps === '*' || $trustedIps === '**') { - return $this->setTrustedProxyIpAddressesToTheCallingIp($request); - } - - $trustedIps = is_string($trustedIps) - ? array_map('trim', explode(',', $trustedIps)) - : $trustedIps; - - if (is_array($trustedIps)) { - return $this->setTrustedProxyIpAddressesToSpecificIps($request, $trustedIps); - } - } - - /** - * Specify the IP addresses to trust explicitly. - * - * @param \Illuminate\Http\Request $request - * @param array $trustedIps - * @return void - */ - protected function setTrustedProxyIpAddressesToSpecificIps(Request $request, array $trustedIps) - { - $request->setTrustedProxies($trustedIps, $this->getTrustedHeaderNames()); - } - - /** - * Set the trusted proxy to be the IP address calling this servers. - * - * @param \Illuminate\Http\Request $request - * @return void - */ - protected function setTrustedProxyIpAddressesToTheCallingIp(Request $request) - { - $request->setTrustedProxies([$request->server->get('REMOTE_ADDR')], $this->getTrustedHeaderNames()); - } - - /** - * Retrieve trusted header name(s), falling back to defaults if config not set. - * - * @return int A bit field of Request::HEADER_*, to set which headers to trust from your proxies. - */ - protected function getTrustedHeaderNames() - { - return match ($this->headers) { - 'HEADER_X_FORWARDED_AWS_ELB', Request::HEADER_X_FORWARDED_AWS_ELB => Request::HEADER_X_FORWARDED_AWS_ELB, - 'HEADER_FORWARDED', Request::HEADER_FORWARDED => Request::HEADER_FORWARDED, - 'HEADER_X_FORWARDED_FOR', Request::HEADER_X_FORWARDED_FOR => Request::HEADER_X_FORWARDED_FOR, - 'HEADER_X_FORWARDED_HOST', Request::HEADER_X_FORWARDED_HOST => Request::HEADER_X_FORWARDED_HOST, - 'HEADER_X_FORWARDED_PORT', Request::HEADER_X_FORWARDED_PORT => Request::HEADER_X_FORWARDED_PORT, - 'HEADER_X_FORWARDED_PROTO', Request::HEADER_X_FORWARDED_PROTO => Request::HEADER_X_FORWARDED_PROTO, - 'HEADER_X_FORWARDED_PREFIX', Request::HEADER_X_FORWARDED_PREFIX => Request::HEADER_X_FORWARDED_PREFIX, - default => Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO | Request::HEADER_X_FORWARDED_PREFIX | Request::HEADER_X_FORWARDED_AWS_ELB, - }; - } - - /** - * Get the trusted proxies. - * - * @return array|string|null - */ - protected function proxies() - { - return $this->proxies; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/RedirectResponse.php b/vendor/laravel/framework/src/Illuminate/Http/RedirectResponse.php deleted file mode 100755 index 6edd57ef..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/RedirectResponse.php +++ /dev/null @@ -1,258 +0,0 @@ - $value]; - - foreach ($key as $k => $v) { - $this->session->flash($k, $v); - } - - return $this; - } - - /** - * Add multiple cookies to the response. - * - * @param array $cookies - * @return $this - */ - public function withCookies(array $cookies) - { - foreach ($cookies as $cookie) { - $this->headers->setCookie($cookie); - } - - return $this; - } - - /** - * Flash an array of input to the session. - * - * @param array|null $input - * @return $this - */ - public function withInput(array $input = null) - { - $this->session->flashInput($this->removeFilesFromInput( - ! is_null($input) ? $input : $this->request->input() - )); - - return $this; - } - - /** - * Remove all uploaded files form the given input array. - * - * @param array $input - * @return array - */ - protected function removeFilesFromInput(array $input) - { - foreach ($input as $key => $value) { - if (is_array($value)) { - $input[$key] = $this->removeFilesFromInput($value); - } - - if ($value instanceof SymfonyUploadedFile) { - unset($input[$key]); - } - } - - return $input; - } - - /** - * Flash an array of input to the session. - * - * @return $this - */ - public function onlyInput() - { - return $this->withInput($this->request->only(func_get_args())); - } - - /** - * Flash an array of input to the session. - * - * @return $this - */ - public function exceptInput() - { - return $this->withInput($this->request->except(func_get_args())); - } - - /** - * Flash a container of errors to the session. - * - * @param \Illuminate\Contracts\Support\MessageProvider|array|string $provider - * @param string $key - * @return $this - */ - public function withErrors($provider, $key = 'default') - { - $value = $this->parseErrors($provider); - - $errors = $this->session->get('errors', new ViewErrorBag); - - if (! $errors instanceof ViewErrorBag) { - $errors = new ViewErrorBag; - } - - $this->session->flash( - 'errors', $errors->put($key, $value) - ); - - return $this; - } - - /** - * Parse the given errors into an appropriate value. - * - * @param \Illuminate\Contracts\Support\MessageProvider|array|string $provider - * @return \Illuminate\Support\MessageBag - */ - protected function parseErrors($provider) - { - if ($provider instanceof MessageProvider) { - return $provider->getMessageBag(); - } - - return new MessageBag((array) $provider); - } - - /** - * Add a fragment identifier to the URL. - * - * @param string $fragment - * @return $this - */ - public function withFragment($fragment) - { - return $this->withoutFragment() - ->setTargetUrl($this->getTargetUrl().'#'.Str::after($fragment, '#')); - } - - /** - * Remove any fragment identifier from the response URL. - * - * @return $this - */ - public function withoutFragment() - { - return $this->setTargetUrl(Str::before($this->getTargetUrl(), '#')); - } - - /** - * Get the original response content. - * - * @return null - */ - public function getOriginalContent() - { - // - } - - /** - * Get the request instance. - * - * @return \Illuminate\Http\Request|null - */ - public function getRequest() - { - return $this->request; - } - - /** - * Set the request instance. - * - * @param \Illuminate\Http\Request $request - * @return void - */ - public function setRequest(Request $request) - { - $this->request = $request; - } - - /** - * Get the session store instance. - * - * @return \Illuminate\Session\Store|null - */ - public function getSession() - { - return $this->session; - } - - /** - * Set the session store instance. - * - * @param \Illuminate\Session\Store $session - * @return void - */ - public function setSession(SessionStore $session) - { - $this->session = $session; - } - - /** - * Dynamically bind flash data in the session. - * - * @param string $method - * @param array $parameters - * @return mixed - * - * @throws \BadMethodCallException - */ - public function __call($method, $parameters) - { - if (static::hasMacro($method)) { - return $this->macroCall($method, $parameters); - } - - if (str_starts_with($method, 'with')) { - return $this->with(Str::snake(substr($method, 4)), $parameters[0]); - } - - static::throwBadMethodCallException($method); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/Request.php b/vendor/laravel/framework/src/Illuminate/Http/Request.php deleted file mode 100644 index a0255fc8..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Request.php +++ /dev/null @@ -1,790 +0,0 @@ -getMethod(); - } - - /** - * Get the root URL for the application. - * - * @return string - */ - public function root() - { - return rtrim($this->getSchemeAndHttpHost().$this->getBaseUrl(), '/'); - } - - /** - * Get the URL (no query string) for the request. - * - * @return string - */ - public function url() - { - return rtrim(preg_replace('/\?.*/', '', $this->getUri()), '/'); - } - - /** - * Get the full URL for the request. - * - * @return string - */ - public function fullUrl() - { - $query = $this->getQueryString(); - - $question = $this->getBaseUrl().$this->getPathInfo() === '/' ? '/?' : '?'; - - return $query ? $this->url().$question.$query : $this->url(); - } - - /** - * Get the full URL for the request with the added query string parameters. - * - * @param array $query - * @return string - */ - public function fullUrlWithQuery(array $query) - { - $question = $this->getBaseUrl().$this->getPathInfo() === '/' ? '/?' : '?'; - - return count($this->query()) > 0 - ? $this->url().$question.Arr::query(array_merge($this->query(), $query)) - : $this->fullUrl().$question.Arr::query($query); - } - - /** - * Get the full URL for the request without the given query string parameters. - * - * @param array|string $keys - * @return string - */ - public function fullUrlWithoutQuery($keys) - { - $query = Arr::except($this->query(), $keys); - - $question = $this->getBaseUrl().$this->getPathInfo() === '/' ? '/?' : '?'; - - return count($query) > 0 - ? $this->url().$question.Arr::query($query) - : $this->url(); - } - - /** - * Get the current path info for the request. - * - * @return string - */ - public function path() - { - $pattern = trim($this->getPathInfo(), '/'); - - return $pattern === '' ? '/' : $pattern; - } - - /** - * Get the current decoded path info for the request. - * - * @return string - */ - public function decodedPath() - { - return rawurldecode($this->path()); - } - - /** - * Get a segment from the URI (1 based index). - * - * @param int $index - * @param string|null $default - * @return string|null - */ - public function segment($index, $default = null) - { - return Arr::get($this->segments(), $index - 1, $default); - } - - /** - * Get all of the segments for the request path. - * - * @return array - */ - public function segments() - { - $segments = explode('/', $this->decodedPath()); - - return array_values(array_filter($segments, function ($value) { - return $value !== ''; - })); - } - - /** - * Determine if the current request URI matches a pattern. - * - * @param mixed ...$patterns - * @return bool - */ - public function is(...$patterns) - { - $path = $this->decodedPath(); - - return collect($patterns)->contains(fn ($pattern) => Str::is($pattern, $path)); - } - - /** - * Determine if the route name matches a given pattern. - * - * @param mixed ...$patterns - * @return bool - */ - public function routeIs(...$patterns) - { - return $this->route() && $this->route()->named(...$patterns); - } - - /** - * Determine if the current request URL and query string match a pattern. - * - * @param mixed ...$patterns - * @return bool - */ - public function fullUrlIs(...$patterns) - { - $url = $this->fullUrl(); - - return collect($patterns)->contains(fn ($pattern) => Str::is($pattern, $url)); - } - - /** - * Get the host name. - * - * @return string - */ - public function host() - { - return $this->getHost(); - } - - /** - * Get the HTTP host being requested. - * - * @return string - */ - public function httpHost() - { - return $this->getHttpHost(); - } - - /** - * Get the scheme and HTTP host. - * - * @return string - */ - public function schemeAndHttpHost() - { - return $this->getSchemeAndHttpHost(); - } - - /** - * Determine if the request is the result of an AJAX call. - * - * @return bool - */ - public function ajax() - { - return $this->isXmlHttpRequest(); - } - - /** - * Determine if the request is the result of a PJAX call. - * - * @return bool - */ - public function pjax() - { - return $this->headers->get('X-PJAX') == true; - } - - /** - * Determine if the request is the result of a prefetch call. - * - * @return bool - */ - public function prefetch() - { - return strcasecmp($this->server->get('HTTP_X_MOZ') ?? '', 'prefetch') === 0 || - strcasecmp($this->headers->get('Purpose') ?? '', 'prefetch') === 0; - } - - /** - * Determine if the request is over HTTPS. - * - * @return bool - */ - public function secure() - { - return $this->isSecure(); - } - - /** - * Get the client IP address. - * - * @return string|null - */ - public function ip() - { - return $this->getClientIp(); - } - - /** - * Get the client IP addresses. - * - * @return array - */ - public function ips() - { - return $this->getClientIps(); - } - - /** - * Get the client user agent. - * - * @return string|null - */ - public function userAgent() - { - return $this->headers->get('User-Agent'); - } - - /** - * Merge new input into the current request's input array. - * - * @param array $input - * @return $this - */ - public function merge(array $input) - { - $this->getInputSource()->add($input); - - return $this; - } - - /** - * Merge new input into the request's input, but only when that key is missing from the request. - * - * @param array $input - * @return $this - */ - public function mergeIfMissing(array $input) - { - return $this->merge(collect($input)->filter(function ($value, $key) { - return $this->missing($key); - })->toArray()); - } - - /** - * Replace the input for the current request. - * - * @param array $input - * @return $this - */ - public function replace(array $input) - { - $this->getInputSource()->replace($input); - - return $this; - } - - /** - * This method belongs to Symfony HttpFoundation and is not usually needed when using Laravel. - * - * Instead, you may use the "input" method. - * - * @param string $key - * @param mixed $default - * @return mixed - */ - public function get(string $key, mixed $default = null): mixed - { - return parent::get($key, $default); - } - - /** - * Get the JSON payload for the request. - * - * @param string|null $key - * @param mixed $default - * @return \Symfony\Component\HttpFoundation\ParameterBag|mixed - */ - public function json($key = null, $default = null) - { - if (! isset($this->json)) { - $this->json = new ParameterBag((array) json_decode($this->getContent(), true)); - } - - if (is_null($key)) { - return $this->json; - } - - return data_get($this->json->all(), $key, $default); - } - - /** - * Get the input source for the request. - * - * @return \Symfony\Component\HttpFoundation\ParameterBag - */ - protected function getInputSource() - { - if ($this->isJson()) { - return $this->json(); - } - - return in_array($this->getRealMethod(), ['GET', 'HEAD']) ? $this->query : $this->request; - } - - /** - * Create a new request instance from the given Laravel request. - * - * @param \Illuminate\Http\Request $from - * @param \Illuminate\Http\Request|null $to - * @return static - */ - public static function createFrom(self $from, $to = null) - { - $request = $to ?: new static; - - $files = array_filter($from->files->all()); - - $request->initialize( - $from->query->all(), - $from->request->all(), - $from->attributes->all(), - $from->cookies->all(), - $files, - $from->server->all(), - $from->getContent() - ); - - $request->headers->replace($from->headers->all()); - - $request->setRequestLocale($from->getLocale()); - - $request->setDefaultRequestLocale($from->getDefaultLocale()); - - $request->setJson($from->json()); - - if ($from->hasSession() && $session = $from->session()) { - $request->setLaravelSession($session); - } - - $request->setUserResolver($from->getUserResolver()); - - $request->setRouteResolver($from->getRouteResolver()); - - return $request; - } - - /** - * Create an Illuminate request from a Symfony instance. - * - * @param \Symfony\Component\HttpFoundation\Request $request - * @return static - */ - public static function createFromBase(SymfonyRequest $request) - { - $newRequest = (new static)->duplicate( - $request->query->all(), $request->request->all(), $request->attributes->all(), - $request->cookies->all(), $request->files->all(), $request->server->all() - ); - - $newRequest->headers->replace($request->headers->all()); - - $newRequest->content = $request->content; - - if ($newRequest->isJson()) { - $newRequest->request = $newRequest->json(); - } - - return $newRequest; - } - - /** - * {@inheritdoc} - * - * @return static - */ - public function duplicate(array $query = null, array $request = null, array $attributes = null, array $cookies = null, array $files = null, array $server = null): static - { - return parent::duplicate($query, $request, $attributes, $cookies, $this->filterFiles($files), $server); - } - - /** - * Filter the given array of files, removing any empty values. - * - * @param mixed $files - * @return mixed - */ - protected function filterFiles($files) - { - if (! $files) { - return; - } - - foreach ($files as $key => $file) { - if (is_array($file)) { - $files[$key] = $this->filterFiles($files[$key]); - } - - if (empty($files[$key])) { - unset($files[$key]); - } - } - - return $files; - } - - /** - * {@inheritdoc} - */ - public function hasSession(bool $skipIfUninitialized = false): bool - { - return ! is_null($this->session); - } - - /** - * {@inheritdoc} - */ - public function getSession(): SessionInterface - { - return $this->hasSession() - ? new SymfonySessionDecorator($this->session()) - : throw new SessionNotFoundException; - } - - /** - * Get the session associated with the request. - * - * @return \Illuminate\Contracts\Session\Session - * - * @throws \RuntimeException - */ - public function session() - { - if (! $this->hasSession()) { - throw new RuntimeException('Session store not set on request.'); - } - - return $this->session; - } - - /** - * Set the session instance on the request. - * - * @param \Illuminate\Contracts\Session\Session $session - * @return void - */ - public function setLaravelSession($session) - { - $this->session = $session; - } - - /** - * Set the locale for the request instance. - * - * @param string $locale - * @return void - */ - public function setRequestLocale(string $locale) - { - $this->locale = $locale; - } - - /** - * Set the default locale for the request instance. - * - * @param string $locale - * @return void - */ - public function setDefaultRequestLocale(string $locale) - { - $this->defaultLocale = $locale; - } - - /** - * Get the user making the request. - * - * @param string|null $guard - * @return mixed - */ - public function user($guard = null) - { - return call_user_func($this->getUserResolver(), $guard); - } - - /** - * Get the route handling the request. - * - * @param string|null $param - * @param mixed $default - * @return \Illuminate\Routing\Route|object|string|null - */ - public function route($param = null, $default = null) - { - $route = call_user_func($this->getRouteResolver()); - - if (is_null($route) || is_null($param)) { - return $route; - } - - return $route->parameter($param, $default); - } - - /** - * Get a unique fingerprint for the request / route / IP address. - * - * @return string - * - * @throws \RuntimeException - */ - public function fingerprint() - { - if (! $route = $this->route()) { - throw new RuntimeException('Unable to generate fingerprint. Route unavailable.'); - } - - return sha1(implode('|', array_merge( - $route->methods(), - [$route->getDomain(), $route->uri(), $this->ip()] - ))); - } - - /** - * Set the JSON payload for the request. - * - * @param \Symfony\Component\HttpFoundation\ParameterBag $json - * @return $this - */ - public function setJson($json) - { - $this->json = $json; - - return $this; - } - - /** - * Get the user resolver callback. - * - * @return \Closure - */ - public function getUserResolver() - { - return $this->userResolver ?: function () { - // - }; - } - - /** - * Set the user resolver callback. - * - * @param \Closure $callback - * @return $this - */ - public function setUserResolver(Closure $callback) - { - $this->userResolver = $callback; - - return $this; - } - - /** - * Get the route resolver callback. - * - * @return \Closure - */ - public function getRouteResolver() - { - return $this->routeResolver ?: function () { - // - }; - } - - /** - * Set the route resolver callback. - * - * @param \Closure $callback - * @return $this - */ - public function setRouteResolver(Closure $callback) - { - $this->routeResolver = $callback; - - return $this; - } - - /** - * Get all of the input and files for the request. - * - * @return array - */ - public function toArray(): array - { - return $this->all(); - } - - /** - * Determine if the given offset exists. - * - * @param string $offset - * @return bool - */ - public function offsetExists($offset): bool - { - $route = $this->route(); - - return Arr::has( - $this->all() + ($route ? $route->parameters() : []), - $offset - ); - } - - /** - * Get the value at the given offset. - * - * @param string $offset - * @return mixed - */ - public function offsetGet($offset): mixed - { - return $this->__get($offset); - } - - /** - * Set the value at the given offset. - * - * @param string $offset - * @param mixed $value - * @return void - */ - public function offsetSet($offset, $value): void - { - $this->getInputSource()->set($offset, $value); - } - - /** - * Remove the value at the given offset. - * - * @param string $offset - * @return void - */ - public function offsetUnset($offset): void - { - $this->getInputSource()->remove($offset); - } - - /** - * Check if an input element is set on the request. - * - * @param string $key - * @return bool - */ - public function __isset($key) - { - return ! is_null($this->__get($key)); - } - - /** - * Get an input element from the request. - * - * @param string $key - * @return mixed - */ - public function __get($key) - { - return Arr::get($this->all(), $key, fn () => $this->route($key)); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/Resources/CollectsResources.php b/vendor/laravel/framework/src/Illuminate/Http/Resources/CollectsResources.php deleted file mode 100644 index b84c3445..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Resources/CollectsResources.php +++ /dev/null @@ -1,94 +0,0 @@ -collects(); - - $this->collection = $collects && ! $resource->first() instanceof $collects - ? $resource->mapInto($collects) - : $resource->toBase(); - - return ($resource instanceof AbstractPaginator || $resource instanceof AbstractCursorPaginator) - ? $resource->setCollection($this->collection) - : $this->collection; - } - - /** - * Get the resource that this resource collects. - * - * @return string|null - */ - protected function collects() - { - $collects = null; - - if ($this->collects) { - $collects = $this->collects; - } elseif (str_ends_with(class_basename($this), 'Collection') && - (class_exists($class = Str::replaceLast('Collection', '', get_class($this))) || - class_exists($class = Str::replaceLast('Collection', 'Resource', get_class($this))))) { - $collects = $class; - } - - if (! $collects || is_a($collects, JsonResource::class, true)) { - return $collects; - } - - throw new LogicException('Resource collections must collect instances of '.JsonResource::class.'.'); - } - - /** - * Get the JSON serialization options that should be applied to the resource response. - * - * @return int - */ - public function jsonOptions() - { - $collects = $this->collects(); - - if (! $collects) { - return 0; - } - - return (new ReflectionClass($collects)) - ->newInstanceWithoutConstructor() - ->jsonOptions(); - } - - /** - * Get an iterator for the resource collection. - * - * @return \ArrayIterator - */ - public function getIterator(): Traversable - { - return $this->collection->getIterator(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/Resources/ConditionallyLoadsAttributes.php b/vendor/laravel/framework/src/Illuminate/Http/Resources/ConditionallyLoadsAttributes.php deleted file mode 100644 index dad08239..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Resources/ConditionallyLoadsAttributes.php +++ /dev/null @@ -1,315 +0,0 @@ - $value) { - $index++; - - if (is_array($value)) { - $data[$key] = $this->filter($value); - - continue; - } - - if (is_numeric($key) && $value instanceof MergeValue) { - return $this->mergeData( - $data, $index, $this->filter($value->data), - array_values($value->data) === $value->data - ); - } - - if ($value instanceof self && is_null($value->resource)) { - $data[$key] = null; - } - } - - return $this->removeMissingValues($data); - } - - /** - * Merge the given data in at the given index. - * - * @param array $data - * @param int $index - * @param array $merge - * @param bool $numericKeys - * @return array - */ - protected function mergeData($data, $index, $merge, $numericKeys) - { - if ($numericKeys) { - return $this->removeMissingValues(array_merge( - array_merge(array_slice($data, 0, $index, true), $merge), - $this->filter(array_values(array_slice($data, $index + 1, null, true))) - )); - } - - return $this->removeMissingValues(array_slice($data, 0, $index, true) + - $merge + - $this->filter(array_slice($data, $index + 1, null, true))); - } - - /** - * Remove the missing values from the filtered data. - * - * @param array $data - * @return array - */ - protected function removeMissingValues($data) - { - $numericKeys = true; - - foreach ($data as $key => $value) { - if (($value instanceof PotentiallyMissing && $value->isMissing()) || - ($value instanceof self && - $value->resource instanceof PotentiallyMissing && - $value->isMissing())) { - unset($data[$key]); - } else { - $numericKeys = $numericKeys && is_numeric($key); - } - } - - if (property_exists($this, 'preserveKeys') && $this->preserveKeys === true) { - return $data; - } - - return $numericKeys ? array_values($data) : $data; - } - - /** - * Retrieve a value based on a given condition. - * - * @param bool $condition - * @param mixed $value - * @param mixed $default - * @return \Illuminate\Http\Resources\MissingValue|mixed - */ - protected function when($condition, $value, $default = null) - { - if ($condition) { - return value($value); - } - - return func_num_args() === 3 ? value($default) : new MissingValue; - } - - /** - * Merge a value into the array. - * - * @param mixed $value - * @return \Illuminate\Http\Resources\MergeValue|mixed - */ - protected function merge($value) - { - return $this->mergeWhen(true, $value); - } - - /** - * Merge a value if the given condition is truthy. - * - * @param bool $condition - * @param mixed $value - * @return \Illuminate\Http\Resources\MergeValue|mixed - */ - protected function mergeWhen($condition, $value) - { - return $condition ? new MergeValue(value($value)) : new MissingValue; - } - - /** - * Merge a value unless the given condition is truthy. - * - * @param bool $condition - * @param mixed $value - * @return \Illuminate\Http\Resources\MergeValue|mixed - */ - protected function mergeUnless($condition, $value) - { - return ! $condition ? new MergeValue(value($value)) : new MissingValue; - } - - /** - * Merge the given attributes. - * - * @param array $attributes - * @return \Illuminate\Http\Resources\MergeValue - */ - protected function attributes($attributes) - { - return new MergeValue( - Arr::only($this->resource->toArray(), $attributes) - ); - } - - /** - * Retrieve a model attribute if it is null. - * - * @param mixed $value - * @param mixed $default - * @return \Illuminate\Http\Resources\MissingValue|mixed - */ - protected function whenNull($value, $default = null) - { - $arguments = func_num_args() == 1 ? [$value] : [$value, $default]; - - return $this->when(is_null($value), ...$arguments); - } - - /** - * Retrieve a model attribute if it is not null. - * - * @param mixed $value - * @param mixed $default - * @return \Illuminate\Http\Resources\MissingValue|mixed - */ - protected function whenNotNull($value, $default = null) - { - $arguments = func_num_args() == 1 ? [$value] : [$value, $default]; - - return $this->when(! is_null($value), ...$arguments); - } - - /** - * Retrieve an accessor when it has been appended. - * - * @param string $attribute - * @param mixed $value - * @param mixed $default - * @return \Illuminate\Http\Resources\MissingValue|mixed - */ - protected function whenAppended($attribute, $value = null, $default = null) - { - if ($this->resource->hasAppended($attribute)) { - return func_num_args() >= 2 ? value($value) : $this->resource->$attribute; - } - - return func_num_args() === 3 ? value($default) : new MissingValue; - } - - /** - * Retrieve a relationship if it has been loaded. - * - * @param string $relationship - * @param mixed $value - * @param mixed $default - * @return \Illuminate\Http\Resources\MissingValue|mixed - */ - protected function whenLoaded($relationship, $value = null, $default = null) - { - if (func_num_args() < 3) { - $default = new MissingValue; - } - - if (! $this->resource->relationLoaded($relationship)) { - return value($default); - } - - if (func_num_args() === 1) { - return $this->resource->{$relationship}; - } - - if ($this->resource->{$relationship} === null) { - return; - } - - return value($value); - } - - /** - * Retrieve a relationship count if it exists. - * - * @param string $relationship - * @param mixed $value - * @param mixed $default - * @return \Illuminate\Http\Resources\MissingValue|mixed - */ - public function whenCounted($relationship, $value = null, $default = null) - { - if (func_num_args() < 3) { - $default = new MissingValue(); - } - - $attribute = (string) Str::of($relationship)->snake()->finish('_count'); - - if (! isset($this->resource->getAttributes()[$attribute])) { - return value($default); - } - - if (func_num_args() === 1) { - return $this->resource->{$attribute}; - } - - if ($this->resource->{$attribute} === null) { - return; - } - - return value($value, $this->resource->{$attribute}); - } - - /** - * Execute a callback if the given pivot table has been loaded. - * - * @param string $table - * @param mixed $value - * @param mixed $default - * @return \Illuminate\Http\Resources\MissingValue|mixed - */ - protected function whenPivotLoaded($table, $value, $default = null) - { - return $this->whenPivotLoadedAs('pivot', ...func_get_args()); - } - - /** - * Execute a callback if the given pivot table with a custom accessor has been loaded. - * - * @param string $accessor - * @param string $table - * @param mixed $value - * @param mixed $default - * @return \Illuminate\Http\Resources\MissingValue|mixed - */ - protected function whenPivotLoadedAs($accessor, $table, $value, $default = null) - { - if (func_num_args() === 3) { - $default = new MissingValue; - } - - return $this->when( - isset($this->resource->$accessor) && - ($this->resource->$accessor instanceof $table || - $this->resource->$accessor->getTable() === $table), - ...[$value, $default] - ); - } - - /** - * Transform the given value if it is present. - * - * @param mixed $value - * @param callable $callback - * @param mixed $default - * @return mixed - */ - protected function transform($value, callable $callback, $default = null) - { - return transform( - $value, $callback, func_num_args() === 3 ? $default : new MissingValue - ); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/Resources/DelegatesToResource.php b/vendor/laravel/framework/src/Illuminate/Http/Resources/DelegatesToResource.php deleted file mode 100644 index e932646e..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Resources/DelegatesToResource.php +++ /dev/null @@ -1,157 +0,0 @@ -resource->getRouteKey(); - } - - /** - * Get the route key for the resource. - * - * @return string - */ - public function getRouteKeyName() - { - return $this->resource->getRouteKeyName(); - } - - /** - * Retrieve the model for a bound value. - * - * @param mixed $value - * @param string|null $field - * @return void - * - * @throws \Exception - */ - public function resolveRouteBinding($value, $field = null) - { - throw new Exception('Resources may not be implicitly resolved from route bindings.'); - } - - /** - * Retrieve the model for a bound value. - * - * @param string $childType - * @param mixed $value - * @param string|null $field - * @return void - * - * @throws \Exception - */ - public function resolveChildRouteBinding($childType, $value, $field = null) - { - throw new Exception('Resources may not be implicitly resolved from route bindings.'); - } - - /** - * Determine if the given attribute exists. - * - * @param mixed $offset - * @return bool - */ - public function offsetExists($offset): bool - { - return isset($this->resource[$offset]); - } - - /** - * Get the value for a given offset. - * - * @param mixed $offset - * @return mixed - */ - public function offsetGet($offset): mixed - { - return $this->resource[$offset]; - } - - /** - * Set the value for a given offset. - * - * @param mixed $offset - * @param mixed $value - * @return void - */ - public function offsetSet($offset, $value): void - { - $this->resource[$offset] = $value; - } - - /** - * Unset the value for a given offset. - * - * @param mixed $offset - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->resource[$offset]); - } - - /** - * Determine if an attribute exists on the resource. - * - * @param string $key - * @return bool - */ - public function __isset($key) - { - return isset($this->resource->{$key}); - } - - /** - * Unset an attribute on the resource. - * - * @param string $key - * @return void - */ - public function __unset($key) - { - unset($this->resource->{$key}); - } - - /** - * Dynamically get properties from the underlying resource. - * - * @param string $key - * @return mixed - */ - public function __get($key) - { - return $this->resource->{$key}; - } - - /** - * Dynamically pass method calls to the underlying resource. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - if (static::hasMacro($method)) { - return $this->macroCall($method, $parameters); - } - - return $this->forwardCallTo($this->resource, $method, $parameters); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/AnonymousResourceCollection.php b/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/AnonymousResourceCollection.php deleted file mode 100644 index 26f5c460..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/AnonymousResourceCollection.php +++ /dev/null @@ -1,34 +0,0 @@ -collects = $collects; - - parent::__construct($resource); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/JsonResource.php b/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/JsonResource.php deleted file mode 100644 index 62b75b15..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/JsonResource.php +++ /dev/null @@ -1,243 +0,0 @@ -resource = $resource; - } - - /** - * Create a new resource instance. - * - * @param mixed ...$parameters - * @return static - */ - public static function make(...$parameters) - { - return new static(...$parameters); - } - - /** - * Create a new anonymous resource collection. - * - * @param mixed $resource - * @return \Illuminate\Http\Resources\Json\AnonymousResourceCollection - */ - public static function collection($resource) - { - return tap(new AnonymousResourceCollection($resource, static::class), function ($collection) { - if (property_exists(static::class, 'preserveKeys')) { - $collection->preserveKeys = (new static([]))->preserveKeys === true; - } - }); - } - - /** - * Resolve the resource to an array. - * - * @param \Illuminate\Http\Request|null $request - * @return array - */ - public function resolve($request = null) - { - $data = $this->toArray( - $request = $request ?: Container::getInstance()->make('request') - ); - - if ($data instanceof Arrayable) { - $data = $data->toArray(); - } elseif ($data instanceof JsonSerializable) { - $data = $data->jsonSerialize(); - } - - return $this->filter((array) $data); - } - - /** - * Transform the resource into an array. - * - * @param \Illuminate\Http\Request $request - * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable - */ - public function toArray($request) - { - if (is_null($this->resource)) { - return []; - } - - return is_array($this->resource) - ? $this->resource - : $this->resource->toArray(); - } - - /** - * Convert the model instance to JSON. - * - * @param int $options - * @return string - * - * @throws \Illuminate\Database\Eloquent\JsonEncodingException - */ - public function toJson($options = 0) - { - $json = json_encode($this->jsonSerialize(), $options); - - if (json_last_error() !== JSON_ERROR_NONE) { - throw JsonEncodingException::forResource($this, json_last_error_msg()); - } - - return $json; - } - - /** - * Get any additional data that should be returned with the resource array. - * - * @param \Illuminate\Http\Request $request - * @return array - */ - public function with($request) - { - return $this->with; - } - - /** - * Add additional meta data to the resource response. - * - * @param array $data - * @return $this - */ - public function additional(array $data) - { - $this->additional = $data; - - return $this; - } - - /** - * Get the JSON serialization options that should be applied to the resource response. - * - * @return int - */ - public function jsonOptions() - { - return 0; - } - - /** - * Customize the response for a request. - * - * @param \Illuminate\Http\Request $request - * @param \Illuminate\Http\JsonResponse $response - * @return void - */ - public function withResponse($request, $response) - { - // - } - - /** - * Set the string that should wrap the outer-most resource array. - * - * @param string $value - * @return void - */ - public static function wrap($value) - { - static::$wrap = $value; - } - - /** - * Disable wrapping of the outer-most resource array. - * - * @return void - */ - public static function withoutWrapping() - { - static::$wrap = null; - } - - /** - * Transform the resource into an HTTP response. - * - * @param \Illuminate\Http\Request|null $request - * @return \Illuminate\Http\JsonResponse - */ - public function response($request = null) - { - return $this->toResponse( - $request ?: Container::getInstance()->make('request') - ); - } - - /** - * Create an HTTP response that represents the object. - * - * @param \Illuminate\Http\Request $request - * @return \Illuminate\Http\JsonResponse - */ - public function toResponse($request) - { - return (new ResourceResponse($this))->toResponse($request); - } - - /** - * Prepare the resource for JSON serialization. - * - * @return array - */ - public function jsonSerialize(): array - { - return $this->resolve(Container::getInstance()->make('request')); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/PaginatedResourceResponse.php b/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/PaginatedResourceResponse.php deleted file mode 100644 index bd3e8f9a..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/PaginatedResourceResponse.php +++ /dev/null @@ -1,92 +0,0 @@ -json( - $this->wrap( - $this->resource->resolve($request), - array_merge_recursive( - $this->paginationInformation($request), - $this->resource->with($request), - $this->resource->additional - ) - ), - $this->calculateStatus(), - [], - $this->resource->jsonOptions() - ), function ($response) use ($request) { - $response->original = $this->resource->resource->map(function ($item) { - return is_array($item) ? Arr::get($item, 'resource') : $item->resource; - }); - - $this->resource->withResponse($request, $response); - }); - } - - /** - * Add the pagination information to the response. - * - * @param \Illuminate\Http\Request $request - * @return array - */ - protected function paginationInformation($request) - { - $paginated = $this->resource->resource->toArray(); - - $default = [ - 'links' => $this->paginationLinks($paginated), - 'meta' => $this->meta($paginated), - ]; - - if (method_exists($this->resource, 'paginationInformation')) { - return $this->resource->paginationInformation($request, $paginated, $default); - } - - return $default; - } - - /** - * Get the pagination links for the response. - * - * @param array $paginated - * @return array - */ - protected function paginationLinks($paginated) - { - return [ - 'first' => $paginated['first_page_url'] ?? null, - 'last' => $paginated['last_page_url'] ?? null, - 'prev' => $paginated['prev_page_url'] ?? null, - 'next' => $paginated['next_page_url'] ?? null, - ]; - } - - /** - * Gather the meta data for the response. - * - * @param array $paginated - * @return array - */ - protected function meta($paginated) - { - return Arr::except($paginated, [ - 'data', - 'first_page_url', - 'last_page_url', - 'prev_page_url', - 'next_page_url', - ]); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/ResourceCollection.php b/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/ResourceCollection.php deleted file mode 100644 index 6b825cb7..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/ResourceCollection.php +++ /dev/null @@ -1,135 +0,0 @@ -resource = $this->collectResource($resource); - } - - /** - * Indicate that all current query parameters should be appended to pagination links. - * - * @return $this - */ - public function preserveQuery() - { - $this->preserveAllQueryParameters = true; - - return $this; - } - - /** - * Specify the query string parameters that should be present on pagination links. - * - * @param array $query - * @return $this - */ - public function withQuery(array $query) - { - $this->preserveAllQueryParameters = false; - - $this->queryParameters = $query; - - return $this; - } - - /** - * Return the count of items in the resource collection. - * - * @return int - */ - public function count(): int - { - return $this->collection->count(); - } - - /** - * Transform the resource into a JSON array. - * - * @param \Illuminate\Http\Request $request - * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable - */ - public function toArray($request) - { - return $this->collection->map->toArray($request)->all(); - } - - /** - * Create an HTTP response that represents the object. - * - * @param \Illuminate\Http\Request $request - * @return \Illuminate\Http\JsonResponse - */ - public function toResponse($request) - { - if ($this->resource instanceof AbstractPaginator || $this->resource instanceof AbstractCursorPaginator) { - return $this->preparePaginatedResponse($request); - } - - return parent::toResponse($request); - } - - /** - * Create a paginate-aware HTTP response. - * - * @param \Illuminate\Http\Request $request - * @return \Illuminate\Http\JsonResponse - */ - protected function preparePaginatedResponse($request) - { - if ($this->preserveAllQueryParameters) { - $this->resource->appends($request->query()); - } elseif (! is_null($this->queryParameters)) { - $this->resource->appends($this->queryParameters); - } - - return (new PaginatedResourceResponse($this))->toResponse($request); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/ResourceResponse.php b/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/ResourceResponse.php deleted file mode 100644 index 51f36576..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/ResourceResponse.php +++ /dev/null @@ -1,122 +0,0 @@ -resource = $resource; - } - - /** - * Create an HTTP response that represents the object. - * - * @param \Illuminate\Http\Request $request - * @return \Illuminate\Http\JsonResponse - */ - public function toResponse($request) - { - return tap(response()->json( - $this->wrap( - $this->resource->resolve($request), - $this->resource->with($request), - $this->resource->additional - ), - $this->calculateStatus(), - [], - $this->resource->jsonOptions() - ), function ($response) use ($request) { - $response->original = $this->resource->resource; - - $this->resource->withResponse($request, $response); - }); - } - - /** - * Wrap the given data if necessary. - * - * @param array $data - * @param array $with - * @param array $additional - * @return array - */ - protected function wrap($data, $with = [], $additional = []) - { - if ($data instanceof Collection) { - $data = $data->all(); - } - - if ($this->haveDefaultWrapperAndDataIsUnwrapped($data)) { - $data = [$this->wrapper() => $data]; - } elseif ($this->haveAdditionalInformationAndDataIsUnwrapped($data, $with, $additional)) { - $data = [($this->wrapper() ?? 'data') => $data]; - } - - return array_merge_recursive($data, $with, $additional); - } - - /** - * Determine if we have a default wrapper and the given data is unwrapped. - * - * @param array $data - * @return bool - */ - protected function haveDefaultWrapperAndDataIsUnwrapped($data) - { - return $this->wrapper() && ! array_key_exists($this->wrapper(), $data); - } - - /** - * Determine if "with" data has been added and our data is unwrapped. - * - * @param array $data - * @param array $with - * @param array $additional - * @return bool - */ - protected function haveAdditionalInformationAndDataIsUnwrapped($data, $with, $additional) - { - return (! empty($with) || ! empty($additional)) && - (! $this->wrapper() || - ! array_key_exists($this->wrapper(), $data)); - } - - /** - * Get the default data wrapper for the resource. - * - * @return string - */ - protected function wrapper() - { - return get_class($this->resource)::$wrap; - } - - /** - * Calculate the appropriate status code for the response. - * - * @return int - */ - protected function calculateStatus() - { - return $this->resource->resource instanceof Model && - $this->resource->resource->wasRecentlyCreated ? 201 : 200; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/Resources/MergeValue.php b/vendor/laravel/framework/src/Illuminate/Http/Resources/MergeValue.php deleted file mode 100644 index fb6880fb..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Resources/MergeValue.php +++ /dev/null @@ -1,33 +0,0 @@ -data = $data->all(); - } elseif ($data instanceof JsonSerializable) { - $this->data = $data->jsonSerialize(); - } else { - $this->data = $data; - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/Resources/MissingValue.php b/vendor/laravel/framework/src/Illuminate/Http/Resources/MissingValue.php deleted file mode 100644 index d0d8dfa7..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Resources/MissingValue.php +++ /dev/null @@ -1,16 +0,0 @@ -headers = new ResponseHeaderBag($headers); - - $this->setContent($content); - $this->setStatusCode($status); - $this->setProtocolVersion('1.0'); - } - - /** - * Set the content on the response. - * - * @param mixed $content - * @return $this - * - * @throws \InvalidArgumentException - */ - public function setContent(mixed $content): static - { - $this->original = $content; - - // If the content is "JSONable" we will set the appropriate header and convert - // the content to JSON. This is useful when returning something like models - // from routes that will be automatically transformed to their JSON form. - if ($this->shouldBeJson($content)) { - $this->header('Content-Type', 'application/json'); - - $content = $this->morphToJson($content); - - if ($content === false) { - throw new InvalidArgumentException(json_last_error_msg()); - } - } - - // If this content implements the "Renderable" interface then we will call the - // render method on the object so we will avoid any "__toString" exceptions - // that might be thrown and have their errors obscured by PHP's handling. - elseif ($content instanceof Renderable) { - $content = $content->render(); - } - - parent::setContent($content); - - return $this; - } - - /** - * Determine if the given content should be turned into JSON. - * - * @param mixed $content - * @return bool - */ - protected function shouldBeJson($content) - { - return $content instanceof Arrayable || - $content instanceof Jsonable || - $content instanceof ArrayObject || - $content instanceof JsonSerializable || - is_array($content); - } - - /** - * Morph the given content into JSON. - * - * @param mixed $content - * @return string - */ - protected function morphToJson($content) - { - if ($content instanceof Jsonable) { - return $content->toJson(); - } elseif ($content instanceof Arrayable) { - return json_encode($content->toArray()); - } - - return json_encode($content); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/ResponseTrait.php b/vendor/laravel/framework/src/Illuminate/Http/ResponseTrait.php deleted file mode 100644 index cbe29dcc..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/ResponseTrait.php +++ /dev/null @@ -1,182 +0,0 @@ -getStatusCode(); - } - - /** - * Get the status text for the response. - * - * @return string - */ - public function statusText() - { - return $this->statusText; - } - - /** - * Get the content of the response. - * - * @return string - */ - public function content() - { - return $this->getContent(); - } - - /** - * Get the original response content. - * - * @return mixed - */ - public function getOriginalContent() - { - $original = $this->original; - - return $original instanceof self ? $original->{__FUNCTION__}() : $original; - } - - /** - * Set a header on the Response. - * - * @param string $key - * @param array|string $values - * @param bool $replace - * @return $this - */ - public function header($key, $values, $replace = true) - { - $this->headers->set($key, $values, $replace); - - return $this; - } - - /** - * Add an array of headers to the response. - * - * @param \Symfony\Component\HttpFoundation\HeaderBag|array $headers - * @return $this - */ - public function withHeaders($headers) - { - if ($headers instanceof HeaderBag) { - $headers = $headers->all(); - } - - foreach ($headers as $key => $value) { - $this->headers->set($key, $value); - } - - return $this; - } - - /** - * Add a cookie to the response. - * - * @param \Symfony\Component\HttpFoundation\Cookie|mixed $cookie - * @return $this - */ - public function cookie($cookie) - { - return $this->withCookie(...func_get_args()); - } - - /** - * Add a cookie to the response. - * - * @param \Symfony\Component\HttpFoundation\Cookie|mixed $cookie - * @return $this - */ - public function withCookie($cookie) - { - if (is_string($cookie) && function_exists('cookie')) { - $cookie = cookie(...func_get_args()); - } - - $this->headers->setCookie($cookie); - - return $this; - } - - /** - * Expire a cookie when sending the response. - * - * @param \Symfony\Component\HttpFoundation\Cookie|mixed $cookie - * @param string|null $path - * @param string|null $domain - * @return $this - */ - public function withoutCookie($cookie, $path = null, $domain = null) - { - if (is_string($cookie) && function_exists('cookie')) { - $cookie = cookie($cookie, null, -2628000, $path, $domain); - } - - $this->headers->setCookie($cookie); - - return $this; - } - - /** - * Get the callback of the response. - * - * @return string|null - */ - public function getCallback() - { - return $this->callback ?? null; - } - - /** - * Set the exception to attach to the response. - * - * @param \Throwable $e - * @return $this - */ - public function withException(Throwable $e) - { - $this->exception = $e; - - return $this; - } - - /** - * Throws the response in a HttpResponseException instance. - * - * @return void - * - * @throws \Illuminate\Http\Exceptions\HttpResponseException - */ - public function throwResponse() - { - throw new HttpResponseException($this); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/Testing/File.php b/vendor/laravel/framework/src/Illuminate/Http/Testing/File.php deleted file mode 100644 index aaba539c..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Testing/File.php +++ /dev/null @@ -1,147 +0,0 @@ -name = $name; - $this->tempFile = $tempFile; - - parent::__construct( - $this->tempFilePath(), $name, $this->getMimeType(), - null, true - ); - } - - /** - * Create a new fake file. - * - * @param string $name - * @param string|int $kilobytes - * @return \Illuminate\Http\Testing\File - */ - public static function create($name, $kilobytes = 0) - { - return (new FileFactory)->create($name, $kilobytes); - } - - /** - * Create a new fake file with content. - * - * @param string $name - * @param string $content - * @return \Illuminate\Http\Testing\File - */ - public static function createWithContent($name, $content) - { - return (new FileFactory)->createWithContent($name, $content); - } - - /** - * Create a new fake image. - * - * @param string $name - * @param int $width - * @param int $height - * @return \Illuminate\Http\Testing\File - */ - public static function image($name, $width = 10, $height = 10) - { - return (new FileFactory)->image($name, $width, $height); - } - - /** - * Set the "size" of the file in kilobytes. - * - * @param int $kilobytes - * @return $this - */ - public function size($kilobytes) - { - $this->sizeToReport = $kilobytes * 1024; - - return $this; - } - - /** - * Get the size of the file. - * - * @return int - */ - public function getSize(): int - { - return $this->sizeToReport ?: parent::getSize(); - } - - /** - * Set the "MIME type" for the file. - * - * @param string $mimeType - * @return $this - */ - public function mimeType($mimeType) - { - $this->mimeTypeToReport = $mimeType; - - return $this; - } - - /** - * Get the MIME type of the file. - * - * @return string - */ - public function getMimeType(): string - { - return $this->mimeTypeToReport ?: MimeType::from($this->name); - } - - /** - * Get the path to the temporary file. - * - * @return string - */ - protected function tempFilePath() - { - return stream_get_meta_data($this->tempFile)['uri']; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/Testing/FileFactory.php b/vendor/laravel/framework/src/Illuminate/Http/Testing/FileFactory.php deleted file mode 100644 index 9e25d72d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Testing/FileFactory.php +++ /dev/null @@ -1,84 +0,0 @@ -createWithContent($name, $kilobytes); - } - - return tap(new File($name, tmpfile()), function ($file) use ($kilobytes, $mimeType) { - $file->sizeToReport = $kilobytes * 1024; - $file->mimeTypeToReport = $mimeType; - }); - } - - /** - * Create a new fake file with content. - * - * @param string $name - * @param string $content - * @return \Illuminate\Http\Testing\File - */ - public function createWithContent($name, $content) - { - $tmpfile = tmpfile(); - - fwrite($tmpfile, $content); - - return tap(new File($name, $tmpfile), function ($file) use ($tmpfile) { - $file->sizeToReport = fstat($tmpfile)['size']; - }); - } - - /** - * Create a new fake image. - * - * @param string $name - * @param int $width - * @param int $height - * @return \Illuminate\Http\Testing\File - */ - public function image($name, $width = 10, $height = 10) - { - return new File($name, $this->generateImage( - $width, $height, pathinfo($name, PATHINFO_EXTENSION) - )); - } - - /** - * Generate a dummy image of the given width and height. - * - * @param int $width - * @param int $height - * @param string $extension - * @return resource - */ - protected function generateImage($width, $height, $extension) - { - return tap(tmpfile(), function ($temp) use ($width, $height, $extension) { - ob_start(); - - $extension = in_array($extension, ['jpeg', 'png', 'gif', 'webp', 'wbmp', 'bmp']) - ? strtolower($extension) - : 'jpeg'; - - $image = imagecreatetruecolor($width, $height); - - call_user_func("image{$extension}", $image); - - fwrite($temp, ob_get_clean()); - }); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/Testing/MimeType.php b/vendor/laravel/framework/src/Illuminate/Http/Testing/MimeType.php deleted file mode 100644 index d188a4be..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/Testing/MimeType.php +++ /dev/null @@ -1,65 +0,0 @@ -getMimeTypes($extension)) ?? 'application/octet-stream'; - } - - /** - * Search for the extension of a given MIME type. - * - * @param string $mimeType - * @return string|null - */ - public static function search($mimeType) - { - return Arr::first(self::getMimeTypes()->getExtensions($mimeType)); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/UploadedFile.php b/vendor/laravel/framework/src/Illuminate/Http/UploadedFile.php deleted file mode 100644 index 7779683e..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/UploadedFile.php +++ /dev/null @@ -1,149 +0,0 @@ -storeAs($path, $this->hashName(), $this->parseOptions($options)); - } - - /** - * Store the uploaded file on a filesystem disk with public visibility. - * - * @param string $path - * @param array|string $options - * @return string|false - */ - public function storePublicly($path, $options = []) - { - $options = $this->parseOptions($options); - - $options['visibility'] = 'public'; - - return $this->storeAs($path, $this->hashName(), $options); - } - - /** - * Store the uploaded file on a filesystem disk with public visibility. - * - * @param string $path - * @param string $name - * @param array|string $options - * @return string|false - */ - public function storePubliclyAs($path, $name, $options = []) - { - $options = $this->parseOptions($options); - - $options['visibility'] = 'public'; - - return $this->storeAs($path, $name, $options); - } - - /** - * Store the uploaded file on a filesystem disk. - * - * @param string $path - * @param string $name - * @param array|string $options - * @return string|false - */ - public function storeAs($path, $name, $options = []) - { - $options = $this->parseOptions($options); - - $disk = Arr::pull($options, 'disk'); - - return Container::getInstance()->make(FilesystemFactory::class)->disk($disk)->putFileAs( - $path, $this, $name, $options - ); - } - - /** - * Get the contents of the uploaded file. - * - * @return false|string - * - * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException - */ - public function get() - { - if (! $this->isValid()) { - throw new FileNotFoundException("File does not exist at path {$this->getPathname()}."); - } - - return file_get_contents($this->getPathname()); - } - - /** - * Get the file's extension supplied by the client. - * - * @return string - */ - public function clientExtension() - { - return $this->guessClientExtension(); - } - - /** - * Create a new file instance from a base instance. - * - * @param \Symfony\Component\HttpFoundation\File\UploadedFile $file - * @param bool $test - * @return static - */ - public static function createFromBase(SymfonyUploadedFile $file, $test = false) - { - return $file instanceof static ? $file : new static( - $file->getPathname(), - $file->getClientOriginalName(), - $file->getClientMimeType(), - $file->getError(), - $test - ); - } - - /** - * Parse and format the given options. - * - * @param array|string $options - * @return array - */ - protected function parseOptions($options) - { - if (is_string($options)) { - $options = ['disk' => $options]; - } - - return $options; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Http/composer.json b/vendor/laravel/framework/src/Illuminate/Http/composer.json deleted file mode 100755 index 081009b1..00000000 --- a/vendor/laravel/framework/src/Illuminate/Http/composer.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "illuminate/http", - "description": "The Illuminate Http package.", - "license": "MIT", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "require": { - "php": "^8.0.2", - "ext-json": "*", - "fruitcake/php-cors": "^1.2", - "illuminate/collections": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/session": "^9.0", - "illuminate/support": "^9.0", - "symfony/http-foundation": "^6.0", - "symfony/http-kernel": "^6.0", - "symfony/mime": "^6.0" - }, - "autoload": { - "psr-4": { - "Illuminate\\Http\\": "" - } - }, - "suggest": { - "ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory::image().", - "guzzlehttp/guzzle": "Required to use the HTTP Client (^7.5)." - }, - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev" -} diff --git a/vendor/laravel/framework/src/Illuminate/Log/Events/MessageLogged.php b/vendor/laravel/framework/src/Illuminate/Log/Events/MessageLogged.php deleted file mode 100644 index 312b343a..00000000 --- a/vendor/laravel/framework/src/Illuminate/Log/Events/MessageLogged.php +++ /dev/null @@ -1,42 +0,0 @@ -level = $level; - $this->message = $message; - $this->context = $context; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Log/LICENSE.md b/vendor/laravel/framework/src/Illuminate/Log/LICENSE.md deleted file mode 100644 index 79810c84..00000000 --- a/vendor/laravel/framework/src/Illuminate/Log/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Taylor Otwell - -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/laravel/framework/src/Illuminate/Log/LogManager.php b/vendor/laravel/framework/src/Illuminate/Log/LogManager.php deleted file mode 100644 index f528bc58..00000000 --- a/vendor/laravel/framework/src/Illuminate/Log/LogManager.php +++ /dev/null @@ -1,725 +0,0 @@ -app = $app; - } - - /** - * Build an on-demand log channel. - * - * @param array $config - * @return \Psr\Log\LoggerInterface - */ - public function build(array $config) - { - unset($this->channels['ondemand']); - - return $this->get('ondemand', $config); - } - - /** - * Create a new, on-demand aggregate logger instance. - * - * @param array $channels - * @param string|null $channel - * @return \Psr\Log\LoggerInterface - */ - public function stack(array $channels, $channel = null) - { - return (new Logger( - $this->createStackDriver(compact('channels', 'channel')), - $this->app['events'] - ))->withContext($this->sharedContext); - } - - /** - * Get a log channel instance. - * - * @param string|null $channel - * @return \Psr\Log\LoggerInterface - */ - public function channel($channel = null) - { - return $this->driver($channel); - } - - /** - * Get a log driver instance. - * - * @param string|null $driver - * @return \Psr\Log\LoggerInterface - */ - public function driver($driver = null) - { - return $this->get($this->parseDriver($driver)); - } - - /** - * Attempt to get the log from the local cache. - * - * @param string $name - * @param array|null $config - * @return \Psr\Log\LoggerInterface - */ - protected function get($name, ?array $config = null) - { - try { - return $this->channels[$name] ?? with($this->resolve($name, $config), function ($logger) use ($name) { - return $this->channels[$name] = $this->tap($name, new Logger($logger, $this->app['events']))->withContext($this->sharedContext); - }); - } catch (Throwable $e) { - return tap($this->createEmergencyLogger(), function ($logger) use ($e) { - $logger->emergency('Unable to create configured logger. Using emergency logger.', [ - 'exception' => $e, - ]); - }); - } - } - - /** - * Apply the configured taps for the logger. - * - * @param string $name - * @param \Illuminate\Log\Logger $logger - * @return \Illuminate\Log\Logger - */ - protected function tap($name, Logger $logger) - { - foreach ($this->configurationFor($name)['tap'] ?? [] as $tap) { - [$class, $arguments] = $this->parseTap($tap); - - $this->app->make($class)->__invoke($logger, ...explode(',', $arguments)); - } - - return $logger; - } - - /** - * Parse the given tap class string into a class name and arguments string. - * - * @param string $tap - * @return array - */ - protected function parseTap($tap) - { - return str_contains($tap, ':') ? explode(':', $tap, 2) : [$tap, '']; - } - - /** - * Create an emergency log handler to avoid white screens of death. - * - * @return \Psr\Log\LoggerInterface - */ - protected function createEmergencyLogger() - { - $config = $this->configurationFor('emergency'); - - $handler = new StreamHandler( - $config['path'] ?? $this->app->storagePath().'/logs/laravel.log', - $this->level(['level' => 'debug']) - ); - - return new Logger( - new Monolog('laravel', $this->prepareHandlers([$handler])), - $this->app['events'] - ); - } - - /** - * Resolve the given log instance by name. - * - * @param string $name - * @param array|null $config - * @return \Psr\Log\LoggerInterface - * - * @throws \InvalidArgumentException - */ - protected function resolve($name, ?array $config = null) - { - $config ??= $this->configurationFor($name); - - if (is_null($config)) { - throw new InvalidArgumentException("Log [{$name}] is not defined."); - } - - if (isset($this->customCreators[$config['driver']])) { - return $this->callCustomCreator($config); - } - - $driverMethod = 'create'.ucfirst($config['driver']).'Driver'; - - if (method_exists($this, $driverMethod)) { - return $this->{$driverMethod}($config); - } - - throw new InvalidArgumentException("Driver [{$config['driver']}] is not supported."); - } - - /** - * Call a custom driver creator. - * - * @param array $config - * @return mixed - */ - protected function callCustomCreator(array $config) - { - return $this->customCreators[$config['driver']]($this->app, $config); - } - - /** - * Create a custom log driver instance. - * - * @param array $config - * @return \Psr\Log\LoggerInterface - */ - protected function createCustomDriver(array $config) - { - $factory = is_callable($via = $config['via']) ? $via : $this->app->make($via); - - return $factory($config); - } - - /** - * Create an aggregate log driver instance. - * - * @param array $config - * @return \Psr\Log\LoggerInterface - */ - protected function createStackDriver(array $config) - { - if (is_string($config['channels'])) { - $config['channels'] = explode(',', $config['channels']); - } - - $handlers = collect($config['channels'])->flatMap(function ($channel) { - return $channel instanceof LoggerInterface - ? $channel->getHandlers() - : $this->channel($channel)->getHandlers(); - })->all(); - - $processors = collect($config['channels'])->flatMap(function ($channel) { - return $channel instanceof LoggerInterface - ? $channel->getProcessors() - : $this->channel($channel)->getProcessors(); - })->all(); - - if ($config['ignore_exceptions'] ?? false) { - $handlers = [new WhatFailureGroupHandler($handlers)]; - } - - return new Monolog($this->parseChannel($config), $handlers, $processors); - } - - /** - * Create an instance of the single file log driver. - * - * @param array $config - * @return \Psr\Log\LoggerInterface - */ - protected function createSingleDriver(array $config) - { - return new Monolog($this->parseChannel($config), [ - $this->prepareHandler( - new StreamHandler( - $config['path'], $this->level($config), - $config['bubble'] ?? true, $config['permission'] ?? null, $config['locking'] ?? false - ), $config - ), - ]); - } - - /** - * Create an instance of the daily file log driver. - * - * @param array $config - * @return \Psr\Log\LoggerInterface - */ - protected function createDailyDriver(array $config) - { - return new Monolog($this->parseChannel($config), [ - $this->prepareHandler(new RotatingFileHandler( - $config['path'], $config['days'] ?? 7, $this->level($config), - $config['bubble'] ?? true, $config['permission'] ?? null, $config['locking'] ?? false - ), $config), - ]); - } - - /** - * Create an instance of the Slack log driver. - * - * @param array $config - * @return \Psr\Log\LoggerInterface - */ - protected function createSlackDriver(array $config) - { - return new Monolog($this->parseChannel($config), [ - $this->prepareHandler(new SlackWebhookHandler( - $config['url'], - $config['channel'] ?? null, - $config['username'] ?? 'Laravel', - $config['attachment'] ?? true, - $config['emoji'] ?? ':boom:', - $config['short'] ?? false, - $config['context'] ?? true, - $this->level($config), - $config['bubble'] ?? true, - $config['exclude_fields'] ?? [] - ), $config), - ]); - } - - /** - * Create an instance of the syslog log driver. - * - * @param array $config - * @return \Psr\Log\LoggerInterface - */ - protected function createSyslogDriver(array $config) - { - return new Monolog($this->parseChannel($config), [ - $this->prepareHandler(new SyslogHandler( - Str::snake($this->app['config']['app.name'], '-'), - $config['facility'] ?? LOG_USER, $this->level($config) - ), $config), - ]); - } - - /** - * Create an instance of the "error log" log driver. - * - * @param array $config - * @return \Psr\Log\LoggerInterface - */ - protected function createErrorlogDriver(array $config) - { - return new Monolog($this->parseChannel($config), [ - $this->prepareHandler(new ErrorLogHandler( - $config['type'] ?? ErrorLogHandler::OPERATING_SYSTEM, $this->level($config) - )), - ]); - } - - /** - * Create an instance of any handler available in Monolog. - * - * @param array $config - * @return \Psr\Log\LoggerInterface - * - * @throws \InvalidArgumentException - * @throws \Illuminate\Contracts\Container\BindingResolutionException - */ - protected function createMonologDriver(array $config) - { - if (! is_a($config['handler'], HandlerInterface::class, true)) { - throw new InvalidArgumentException( - $config['handler'].' must be an instance of '.HandlerInterface::class - ); - } - - $with = array_merge( - ['level' => $this->level($config)], - $config['with'] ?? [], - $config['handler_with'] ?? [] - ); - - return new Monolog($this->parseChannel($config), [$this->prepareHandler( - $this->app->make($config['handler'], $with), $config - )]); - } - - /** - * Prepare the handlers for usage by Monolog. - * - * @param array $handlers - * @return array - */ - protected function prepareHandlers(array $handlers) - { - foreach ($handlers as $key => $handler) { - $handlers[$key] = $this->prepareHandler($handler); - } - - return $handlers; - } - - /** - * Prepare the handler for usage by Monolog. - * - * @param \Monolog\Handler\HandlerInterface $handler - * @param array $config - * @return \Monolog\Handler\HandlerInterface - */ - protected function prepareHandler(HandlerInterface $handler, array $config = []) - { - if (isset($config['action_level'])) { - $handler = new FingersCrossedHandler( - $handler, - $this->actionLevel($config), - 0, - true, - $config['stop_buffering'] ?? true - ); - } - - if (! $handler instanceof FormattableHandlerInterface) { - return $handler; - } - - if (! isset($config['formatter'])) { - $handler->setFormatter($this->formatter()); - } elseif ($config['formatter'] !== 'default') { - $handler->setFormatter($this->app->make($config['formatter'], $config['formatter_with'] ?? [])); - } - - return $handler; - } - - /** - * Get a Monolog formatter instance. - * - * @return \Monolog\Formatter\FormatterInterface - */ - protected function formatter() - { - return tap(new LineFormatter(null, $this->dateFormat, true, true), function ($formatter) { - $formatter->includeStacktraces(); - }); - } - - /** - * Share context across channels and stacks. - * - * @param array $context - * @return $this - */ - public function shareContext(array $context) - { - foreach ($this->channels as $channel) { - $channel->withContext($context); - } - - $this->sharedContext = array_merge($this->sharedContext, $context); - - return $this; - } - - /** - * The context shared across channels and stacks. - * - * @return array - */ - public function sharedContext() - { - return $this->sharedContext; - } - - /** - * Flush the shared context. - * - * @return $this - */ - public function flushSharedContext() - { - $this->sharedContext = []; - - return $this; - } - - /** - * Get fallback log channel name. - * - * @return string - */ - protected function getFallbackChannelName() - { - return $this->app->bound('env') ? $this->app->environment() : 'production'; - } - - /** - * Get the log connection configuration. - * - * @param string $name - * @return array - */ - protected function configurationFor($name) - { - return $this->app['config']["logging.channels.{$name}"]; - } - - /** - * Get the default log driver name. - * - * @return string|null - */ - public function getDefaultDriver() - { - return $this->app['config']['logging.default']; - } - - /** - * Set the default log driver name. - * - * @param string $name - * @return void - */ - public function setDefaultDriver($name) - { - $this->app['config']['logging.default'] = $name; - } - - /** - * Register a custom driver creator Closure. - * - * @param string $driver - * @param \Closure $callback - * @return $this - */ - public function extend($driver, Closure $callback) - { - $this->customCreators[$driver] = $callback->bindTo($this, $this); - - return $this; - } - - /** - * Unset the given channel instance. - * - * @param string|null $driver - * @return $this - */ - public function forgetChannel($driver = null) - { - $driver = $this->parseDriver($driver); - - if (isset($this->channels[$driver])) { - unset($this->channels[$driver]); - } - } - - /** - * Parse the driver name. - * - * @param string|null $driver - * @return string|null - */ - protected function parseDriver($driver) - { - $driver ??= $this->getDefaultDriver(); - - if ($this->app->runningUnitTests()) { - $driver ??= 'null'; - } - - return $driver; - } - - /** - * Get all of the resolved log channels. - * - * @return array - */ - public function getChannels() - { - return $this->channels; - } - - /** - * System is unusable. - * - * @param string $message - * @param array $context - * @return void - */ - public function emergency($message, array $context = []): void - { - $this->driver()->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 array $context - * @return void - */ - public function alert($message, array $context = []): void - { - $this->driver()->alert($message, $context); - } - - /** - * Critical conditions. - * - * Example: Application component unavailable, unexpected exception. - * - * @param string $message - * @param array $context - * @return void - */ - public function critical($message, array $context = []): void - { - $this->driver()->critical($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 = []): void - { - $this->driver()->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 array $context - * @return void - */ - public function warning($message, array $context = []): void - { - $this->driver()->warning($message, $context); - } - - /** - * Normal but significant events. - * - * @param string $message - * @param array $context - * @return void - */ - public function notice($message, array $context = []): void - { - $this->driver()->notice($message, $context); - } - - /** - * Interesting events. - * - * Example: User logs in, SQL logs. - * - * @param string $message - * @param array $context - * @return void - */ - public function info($message, array $context = []): void - { - $this->driver()->info($message, $context); - } - - /** - * Detailed debug information. - * - * @param string $message - * @param array $context - * @return void - */ - public function debug($message, array $context = []): void - { - $this->driver()->debug($message, $context); - } - - /** - * Logs with an arbitrary level. - * - * @param mixed $level - * @param string $message - * @param array $context - * @return void - */ - public function log($level, $message, array $context = []): void - { - $this->driver()->log($level, $message, $context); - } - - /** - * Dynamically call the default driver instance. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - return $this->driver()->$method(...$parameters); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Log/LogServiceProvider.php b/vendor/laravel/framework/src/Illuminate/Log/LogServiceProvider.php deleted file mode 100644 index ebe54530..00000000 --- a/vendor/laravel/framework/src/Illuminate/Log/LogServiceProvider.php +++ /dev/null @@ -1,20 +0,0 @@ -app->singleton('log', function ($app) { - return new LogManager($app); - }); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Log/Logger.php b/vendor/laravel/framework/src/Illuminate/Log/Logger.php deleted file mode 100755 index 40626a03..00000000 --- a/vendor/laravel/framework/src/Illuminate/Log/Logger.php +++ /dev/null @@ -1,310 +0,0 @@ -logger = $logger; - $this->dispatcher = $dispatcher; - } - - /** - * Log an emergency message to the logs. - * - * @param \Illuminate\Contracts\Support\Arrayable|\Illuminate\Contracts\Support\Jsonable|\Illuminate\Support\Stringable|array|string $message - * @param array $context - * @return void - */ - public function emergency($message, array $context = []): void - { - $this->writeLog(__FUNCTION__, $message, $context); - } - - /** - * Log an alert message to the logs. - * - * @param \Illuminate\Contracts\Support\Arrayable|\Illuminate\Contracts\Support\Jsonable|\Illuminate\Support\Stringable|array|string $message - * @param array $context - * @return void - */ - public function alert($message, array $context = []): void - { - $this->writeLog(__FUNCTION__, $message, $context); - } - - /** - * Log a critical message to the logs. - * - * @param \Illuminate\Contracts\Support\Arrayable|\Illuminate\Contracts\Support\Jsonable|\Illuminate\Support\Stringable|array|string $message - * @param array $context - * @return void - */ - public function critical($message, array $context = []): void - { - $this->writeLog(__FUNCTION__, $message, $context); - } - - /** - * Log an error message to the logs. - * - * @param \Illuminate\Contracts\Support\Arrayable|\Illuminate\Contracts\Support\Jsonable|\Illuminate\Support\Stringable|array|string $message - * @param array $context - * @return void - */ - public function error($message, array $context = []): void - { - $this->writeLog(__FUNCTION__, $message, $context); - } - - /** - * Log a warning message to the logs. - * - * @param \Illuminate\Contracts\Support\Arrayable|\Illuminate\Contracts\Support\Jsonable|\Illuminate\Support\Stringable|array|string $message - * @param array $context - * @return void - */ - public function warning($message, array $context = []): void - { - $this->writeLog(__FUNCTION__, $message, $context); - } - - /** - * Log a notice to the logs. - * - * @param \Illuminate\Contracts\Support\Arrayable|\Illuminate\Contracts\Support\Jsonable|\Illuminate\Support\Stringable|array|string $message - * @param array $context - * @return void - */ - public function notice($message, array $context = []): void - { - $this->writeLog(__FUNCTION__, $message, $context); - } - - /** - * Log an informational message to the logs. - * - * @param \Illuminate\Contracts\Support\Arrayable|\Illuminate\Contracts\Support\Jsonable|\Illuminate\Support\Stringable|array|string $message - * @param array $context - * @return void - */ - public function info($message, array $context = []): void - { - $this->writeLog(__FUNCTION__, $message, $context); - } - - /** - * Log a debug message to the logs. - * - * @param \Illuminate\Contracts\Support\Arrayable|\Illuminate\Contracts\Support\Jsonable|\Illuminate\Support\Stringable|array|string $message - * @param array $context - * @return void - */ - public function debug($message, array $context = []): void - { - $this->writeLog(__FUNCTION__, $message, $context); - } - - /** - * Log a message to the logs. - * - * @param string $level - * @param \Illuminate\Contracts\Support\Arrayable|\Illuminate\Contracts\Support\Jsonable|\Illuminate\Support\Stringable|array|string $message - * @param array $context - * @return void - */ - public function log($level, $message, array $context = []): void - { - $this->writeLog($level, $message, $context); - } - - /** - * Dynamically pass log calls into the writer. - * - * @param string $level - * @param \Illuminate\Contracts\Support\Arrayable|\Illuminate\Contracts\Support\Jsonable|\Illuminate\Support\Stringable|array|string $message - * @param array $context - * @return void - */ - public function write($level, $message, array $context = []): void - { - $this->writeLog($level, $message, $context); - } - - /** - * Write a message to the log. - * - * @param string $level - * @param \Illuminate\Contracts\Support\Arrayable|\Illuminate\Contracts\Support\Jsonable|\Illuminate\Support\Stringable|array|string $message - * @param array $context - * @return void - */ - protected function writeLog($level, $message, $context): void - { - $this->logger->{$level}( - $message = $this->formatMessage($message), - $context = array_merge($this->context, $context) - ); - - $this->fireLogEvent($level, $message, $context); - } - - /** - * Add context to all future logs. - * - * @param array $context - * @return $this - */ - public function withContext(array $context = []) - { - $this->context = array_merge($this->context, $context); - - return $this; - } - - /** - * Flush the existing context array. - * - * @return $this - */ - public function withoutContext() - { - $this->context = []; - - return $this; - } - - /** - * Register a new callback handler for when a log event is triggered. - * - * @param \Closure $callback - * @return void - * - * @throws \RuntimeException - */ - public function listen(Closure $callback) - { - if (! isset($this->dispatcher)) { - throw new RuntimeException('Events dispatcher has not been set.'); - } - - $this->dispatcher->listen(MessageLogged::class, $callback); - } - - /** - * Fires a log event. - * - * @param string $level - * @param string $message - * @param array $context - * @return void - */ - protected function fireLogEvent($level, $message, array $context = []) - { - // If the event dispatcher is set, we will pass along the parameters to the - // log listeners. These are useful for building profilers or other tools - // that aggregate all of the log messages for a given "request" cycle. - if (isset($this->dispatcher)) { - $this->dispatcher->dispatch(new MessageLogged($level, $message, $context)); - } - } - - /** - * Format the parameters for the logger. - * - * @param \Illuminate\Contracts\Support\Arrayable|\Illuminate\Contracts\Support\Jsonable|\Illuminate\Support\Stringable|array|string $message - * @return string - */ - protected function formatMessage($message) - { - if (is_array($message)) { - return var_export($message, true); - } elseif ($message instanceof Jsonable) { - return $message->toJson(); - } elseif ($message instanceof Arrayable) { - return var_export($message->toArray(), true); - } - - return (string) $message; - } - - /** - * Get the underlying logger implementation. - * - * @return \Psr\Log\LoggerInterface - */ - public function getLogger() - { - return $this->logger; - } - - /** - * Get the event dispatcher instance. - * - * @return \Illuminate\Contracts\Events\Dispatcher - */ - public function getEventDispatcher() - { - return $this->dispatcher; - } - - /** - * Set the event dispatcher instance. - * - * @param \Illuminate\Contracts\Events\Dispatcher $dispatcher - * @return void - */ - public function setEventDispatcher(Dispatcher $dispatcher) - { - $this->dispatcher = $dispatcher; - } - - /** - * Dynamically proxy method calls to the underlying logger. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - return $this->logger->{$method}(...$parameters); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Log/ParsesLogConfiguration.php b/vendor/laravel/framework/src/Illuminate/Log/ParsesLogConfiguration.php deleted file mode 100644 index fd0d5ed5..00000000 --- a/vendor/laravel/framework/src/Illuminate/Log/ParsesLogConfiguration.php +++ /dev/null @@ -1,79 +0,0 @@ - Monolog::DEBUG, - 'info' => Monolog::INFO, - 'notice' => Monolog::NOTICE, - 'warning' => Monolog::WARNING, - 'error' => Monolog::ERROR, - 'critical' => Monolog::CRITICAL, - 'alert' => Monolog::ALERT, - 'emergency' => Monolog::EMERGENCY, - ]; - - /** - * Get fallback log channel name. - * - * @return string - */ - abstract protected function getFallbackChannelName(); - - /** - * Parse the string level into a Monolog constant. - * - * @param array $config - * @return int - * - * @throws \InvalidArgumentException - */ - protected function level(array $config) - { - $level = $config['level'] ?? 'debug'; - - if (isset($this->levels[$level])) { - return $this->levels[$level]; - } - - throw new InvalidArgumentException('Invalid log level.'); - } - - /** - * Parse the action level from the given configuration. - * - * @param array $config - * @return int - */ - protected function actionLevel(array $config) - { - $level = $config['action_level'] ?? 'debug'; - - if (isset($this->levels[$level])) { - return $this->levels[$level]; - } - - throw new InvalidArgumentException('Invalid log action level.'); - } - - /** - * Extract the log channel from the given configuration. - * - * @param array $config - * @return string - */ - protected function parseChannel(array $config) - { - return $config['name'] ?? $this->getFallbackChannelName(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Log/composer.json b/vendor/laravel/framework/src/Illuminate/Log/composer.json deleted file mode 100755 index f6bfd0e9..00000000 --- a/vendor/laravel/framework/src/Illuminate/Log/composer.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "illuminate/log", - "description": "The Illuminate Log package.", - "license": "MIT", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "require": { - "php": "^8.0.2", - "illuminate/contracts": "^9.0", - "illuminate/support": "^9.0", - "monolog/monolog": "^2.0" - }, - "autoload": { - "psr-4": { - "Illuminate\\Log\\": "" - } - }, - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev" -} diff --git a/vendor/laravel/framework/src/Illuminate/Macroable/LICENSE.md b/vendor/laravel/framework/src/Illuminate/Macroable/LICENSE.md deleted file mode 100644 index 79810c84..00000000 --- a/vendor/laravel/framework/src/Illuminate/Macroable/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Taylor Otwell - -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/laravel/framework/src/Illuminate/Macroable/Traits/Macroable.php b/vendor/laravel/framework/src/Illuminate/Macroable/Traits/Macroable.php deleted file mode 100644 index 2269142e..00000000 --- a/vendor/laravel/framework/src/Illuminate/Macroable/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/laravel/framework/src/Illuminate/Macroable/composer.json b/vendor/laravel/framework/src/Illuminate/Macroable/composer.json deleted file mode 100644 index 0417dbe4..00000000 --- a/vendor/laravel/framework/src/Illuminate/Macroable/composer.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "illuminate/macroable", - "description": "The Illuminate Macroable package.", - "license": "MIT", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "require": { - "php": "^8.0.2" - }, - "autoload": { - "psr-4": { - "Illuminate\\Support\\": "" - } - }, - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev" -} diff --git a/vendor/laravel/framework/src/Illuminate/Mail/Attachment.php b/vendor/laravel/framework/src/Illuminate/Mail/Attachment.php deleted file mode 100644 index 5c78ddf3..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/Attachment.php +++ /dev/null @@ -1,172 +0,0 @@ -resolver = $resolver; - } - - /** - * Create a mail attachment from a path. - * - * @param string $path - * @return static - */ - public static function fromPath($path) - { - return new static(fn ($attachment, $pathStrategy) => $pathStrategy($path, $attachment)); - } - - /** - * Create a mail attachment from in-memory data. - * - * @param \Closure $data - * @param string $name - * @return static - */ - public static function fromData(Closure $data, $name) - { - return (new static( - fn ($attachment, $pathStrategy, $dataStrategy) => $dataStrategy($data, $attachment) - ))->as($name); - } - - /** - * Create a mail attachment from a file in the default storage disk. - * - * @param string $path - * @return static - */ - public static function fromStorage($path) - { - return static::fromStorageDisk(null, $path); - } - - /** - * Create a mail attachment from a file in the specified storage disk. - * - * @param string|null $disk - * @param string $path - * @return static - */ - public static function fromStorageDisk($disk, $path) - { - return new static(function ($attachment, $pathStrategy, $dataStrategy) use ($disk, $path) { - $storage = Container::getInstance()->make( - FilesystemFactory::class - )->disk($disk); - - $attachment - ->as($attachment->as ?? basename($path)) - ->withMime($attachment->mime ?? $storage->mimeType($path)); - - return $dataStrategy(fn () => $storage->get($path), $attachment); - }); - } - - /** - * Set the attached file's filename. - * - * @param string $name - * @return $this - */ - public function as($name) - { - $this->as = $name; - - return $this; - } - - /** - * Set the attached file's mime type. - * - * @param string $mime - * @return $this - */ - public function withMime($mime) - { - $this->mime = $mime; - - return $this; - } - - /** - * Attach the attachment with the given strategies. - * - * @param \Closure $pathStrategy - * @param \Closure $dataStrategy - * @return mixed - */ - public function attachWith(Closure $pathStrategy, Closure $dataStrategy) - { - return ($this->resolver)($this, $pathStrategy, $dataStrategy); - } - - /** - * Attach the attachment to a built-in mail type. - * - * @param \Illuminate\Mail\Mailable|\Illuminate\Mail\Message|\Illuminate\Notifications\Messages\MailMessage $mail - * @return mixed - */ - public function attachTo($mail) - { - return $this->attachWith( - fn ($path) => $mail->attach($path, ['as' => $this->as, 'mime' => $this->mime]), - fn ($data) => $mail->attachData($data(), $this->as, ['mime' => $this->mime]) - ); - } - - /** - * Determine if the given attachment is equivalent to this attachment. - * - * @param \Illuminate\Mail\Attachment $attachment - * @return bool - */ - public function isEquivalent(Attachment $attachment) - { - return $this->attachWith( - fn ($path) => [$path, ['as' => $this->as, 'mime' => $this->mime]], - fn ($data) => [$data(), ['as' => $this->as, 'mime' => $this->mime]], - ) === $attachment->attachWith( - fn ($path) => [$path, ['as' => $attachment->as, 'mime' => $attachment->mime]], - fn ($data) => [$data(), ['as' => $attachment->as, 'mime' => $attachment->mime]], - ); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Mail/Events/MessageSending.php b/vendor/laravel/framework/src/Illuminate/Mail/Events/MessageSending.php deleted file mode 100644 index 31435fb6..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/Events/MessageSending.php +++ /dev/null @@ -1,35 +0,0 @@ -data = $data; - $this->message = $message; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Mail/Events/MessageSent.php b/vendor/laravel/framework/src/Illuminate/Mail/Events/MessageSent.php deleted file mode 100644 index c482e073..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/Events/MessageSent.php +++ /dev/null @@ -1,93 +0,0 @@ -sent = $message; - $this->data = $data; - } - - /** - * Get the serializable representation of the object. - * - * @return array - */ - public function __serialize() - { - $hasAttachments = collect($this->message->getAttachments())->isNotEmpty(); - - return $hasAttachments ? [ - 'sent' => base64_encode(serialize($this->sent)), - 'data' => base64_encode(serialize($this->data)), - 'hasAttachments' => true, - ] : [ - 'sent' => $this->sent, - 'data' => $this->data, - 'hasAttachments' => false, - ]; - } - - /** - * Marshal the object from its serialized data. - * - * @param array $data - * @return void - */ - public function __unserialize(array $data) - { - if (isset($data['hasAttachments']) && $data['hasAttachments'] === true) { - $this->sent = unserialize(base64_decode($data['sent'])); - $this->data = unserialize(base64_decode($data['data'])); - } else { - $this->sent = $data['sent']; - $this->data = $data['data']; - } - } - - /** - * Dynamically get the original message. - * - * @param string $key - * @return mixed - * - * @throws \Exception - */ - public function __get($key) - { - if ($key === 'message') { - return $this->sent->getOriginalMessage(); - } - - throw new Exception('Unable to access undefined property on '.__CLASS__.': '.$key); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Mail/LICENSE.md b/vendor/laravel/framework/src/Illuminate/Mail/LICENSE.md deleted file mode 100644 index 79810c84..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Taylor Otwell - -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/laravel/framework/src/Illuminate/Mail/MailManager.php b/vendor/laravel/framework/src/Illuminate/Mail/MailManager.php deleted file mode 100644 index 8d60b34d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/MailManager.php +++ /dev/null @@ -1,507 +0,0 @@ -app = $app; - } - - /** - * Get a mailer instance by name. - * - * @param string|null $name - * @return \Illuminate\Contracts\Mail\Mailer - */ - public function mailer($name = null) - { - $name = $name ?: $this->getDefaultDriver(); - - return $this->mailers[$name] = $this->get($name); - } - - /** - * Get a mailer driver instance. - * - * @param string|null $driver - * @return \Illuminate\Mail\Mailer - */ - public function driver($driver = null) - { - return $this->mailer($driver); - } - - /** - * Attempt to get the mailer from the local cache. - * - * @param string $name - * @return \Illuminate\Mail\Mailer - */ - protected function get($name) - { - return $this->mailers[$name] ?? $this->resolve($name); - } - - /** - * Resolve the given mailer. - * - * @param string $name - * @return \Illuminate\Mail\Mailer - * - * @throws \InvalidArgumentException - */ - protected function resolve($name) - { - $config = $this->getConfig($name); - - if (is_null($config)) { - throw new InvalidArgumentException("Mailer [{$name}] is not defined."); - } - - // Once we have created the mailer instance we will set a container instance - // on the mailer. This allows us to resolve mailer classes via containers - // for maximum testability on said classes instead of passing Closures. - $mailer = new Mailer( - $name, - $this->app['view'], - $this->createSymfonyTransport($config), - $this->app['events'] - ); - - if ($this->app->bound('queue')) { - $mailer->setQueue($this->app['queue']); - } - - // Next we will set all of the global addresses on this mailer, which allows - // for easy unification of all "from" addresses as well as easy debugging - // of sent messages since these will be sent to a single email address. - foreach (['from', 'reply_to', 'to', 'return_path'] as $type) { - $this->setGlobalAddress($mailer, $config, $type); - } - - return $mailer; - } - - /** - * Create a new transport instance. - * - * @param array $config - * @return \Symfony\Component\Mailer\Transport\TransportInterface - * - * @throws \InvalidArgumentException - */ - public function createSymfonyTransport(array $config) - { - // Here we will check if the "transport" key exists and if it doesn't we will - // assume an application is still using the legacy mail configuration file - // format and use the "mail.driver" configuration option instead for BC. - $transport = $config['transport'] ?? $this->app['config']['mail.driver']; - - if (isset($this->customCreators[$transport])) { - return call_user_func($this->customCreators[$transport], $config); - } - - if (trim($transport ?? '') === '' || ! method_exists($this, $method = 'create'.ucfirst($transport).'Transport')) { - throw new InvalidArgumentException("Unsupported mail transport [{$transport}]."); - } - - return $this->{$method}($config); - } - - /** - * Create an instance of the Symfony SMTP Transport driver. - * - * @param array $config - * @return \Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport - */ - protected function createSmtpTransport(array $config) - { - $factory = new EsmtpTransportFactory; - - $transport = $factory->create(new Dsn( - ! empty($config['encryption']) && $config['encryption'] === 'tls' ? (($config['port'] == 465) ? 'smtps' : 'smtp') : '', - $config['host'], - $config['username'] ?? null, - $config['password'] ?? null, - $config['port'] ?? null, - $config - )); - - return $this->configureSmtpTransport($transport, $config); - } - - /** - * Configure the additional SMTP driver options. - * - * @param \Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport $transport - * @param array $config - * @return \Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport - */ - protected function configureSmtpTransport(EsmtpTransport $transport, array $config) - { - $stream = $transport->getStream(); - - if ($stream instanceof SocketStream) { - if (isset($config['source_ip'])) { - $stream->setSourceIp($config['source_ip']); - } - - if (isset($config['timeout'])) { - $stream->setTimeout($config['timeout']); - } - } - - return $transport; - } - - /** - * Create an instance of the Symfony Sendmail Transport driver. - * - * @param array $config - * @return \Symfony\Component\Mailer\Transport\SendmailTransport - */ - protected function createSendmailTransport(array $config) - { - return new SendmailTransport( - $config['path'] ?? $this->app['config']->get('mail.sendmail') - ); - } - - /** - * Create an instance of the Symfony Amazon SES Transport driver. - * - * @param array $config - * @return \Symfony\Component\Mailer\Bridge\Amazon\Transport\SesApiAsyncAwsTransport - */ - protected function createSesTransport(array $config) - { - $config = array_merge( - $this->app['config']->get('services.ses', []), - ['version' => 'latest', 'service' => 'email'], - $config - ); - - $config = Arr::except($config, ['transport']); - - return new SesTransport( - new SesClient($this->addSesCredentials($config)), - $config['options'] ?? [] - ); - } - - /** - * Add the SES credentials to the configuration array. - * - * @param array $config - * @return array - */ - protected function addSesCredentials(array $config) - { - if (! empty($config['key']) && ! empty($config['secret'])) { - $config['credentials'] = Arr::only($config, ['key', 'secret', 'token']); - } - - return Arr::except($config, ['token']); - } - - /** - * Create an instance of the Symfony Mail Transport driver. - * - * @return \Symfony\Component\Mailer\Transport\SendmailTransport - */ - protected function createMailTransport() - { - return new SendmailTransport; - } - - /** - * Create an instance of the Symfony Mailgun Transport driver. - * - * @param array $config - * @return \Symfony\Component\Mailer\Bridge\Mailgun\Transport\MailgunApiTransport - */ - protected function createMailgunTransport(array $config) - { - $factory = new MailgunTransportFactory(); - - if (! isset($config['secret'])) { - $config = $this->app['config']->get('services.mailgun', []); - } - - return $factory->create(new Dsn( - 'mailgun+'.($config['scheme'] ?? 'https'), - $config['endpoint'] ?? 'default', - $config['secret'], - $config['domain'] - )); - } - - /** - * Create an instance of the Symfony Postmark Transport driver. - * - * @param array $config - * @return \Symfony\Component\Mailer\Bridge\Postmark\Transport\PostmarkApiTransport - */ - protected function createPostmarkTransport(array $config) - { - $factory = new PostmarkTransportFactory(); - - $options = isset($config['message_stream_id']) - ? ['message_stream' => $config['message_stream_id']] - : []; - - return $factory->create(new Dsn( - 'postmark+api', - 'default', - $config['token'] ?? $this->app['config']->get('services.postmark.token'), - null, - null, - $options - )); - } - - /** - * Create an instance of the Symfony Failover Transport driver. - * - * @param array $config - * @return \Symfony\Component\Mailer\Transport\FailoverTransport - */ - protected function createFailoverTransport(array $config) - { - $transports = []; - - foreach ($config['mailers'] as $name) { - $config = $this->getConfig($name); - - if (is_null($config)) { - throw new InvalidArgumentException("Mailer [{$name}] is not defined."); - } - - // Now, we will check if the "driver" key exists and if it does we will set - // the transport configuration parameter in order to offer compatibility - // with any Laravel <= 6.x application style mail configuration files. - $transports[] = $this->app['config']['mail.driver'] - ? $this->createSymfonyTransport(array_merge($config, ['transport' => $name])) - : $this->createSymfonyTransport($config); - } - - return new FailoverTransport($transports); - } - - /** - * Create an instance of the Log Transport driver. - * - * @param array $config - * @return \Illuminate\Mail\Transport\LogTransport - */ - protected function createLogTransport(array $config) - { - $logger = $this->app->make(LoggerInterface::class); - - if ($logger instanceof LogManager) { - $logger = $logger->channel( - $config['channel'] ?? $this->app['config']->get('mail.log_channel') - ); - } - - return new LogTransport($logger); - } - - /** - * Create an instance of the Array Transport Driver. - * - * @return \Illuminate\Mail\Transport\ArrayTransport - */ - protected function createArrayTransport() - { - return new ArrayTransport; - } - - /** - * Set a global address on the mailer by type. - * - * @param \Illuminate\Mail\Mailer $mailer - * @param array $config - * @param string $type - * @return void - */ - protected function setGlobalAddress($mailer, array $config, string $type) - { - $address = Arr::get($config, $type, $this->app['config']['mail.'.$type]); - - if (is_array($address) && isset($address['address'])) { - $mailer->{'always'.Str::studly($type)}($address['address'], $address['name']); - } - } - - /** - * Get the mail connection configuration. - * - * @param string $name - * @return array - */ - protected function getConfig(string $name) - { - // Here we will check if the "driver" key exists and if it does we will use - // the entire mail configuration file as the "driver" config in order to - // provide "BC" for any Laravel <= 6.x style mail configuration files. - return $this->app['config']['mail.driver'] - ? $this->app['config']['mail'] - : $this->app['config']["mail.mailers.{$name}"]; - } - - /** - * Get the default mail driver name. - * - * @return string - */ - public function getDefaultDriver() - { - // Here we will check if the "driver" key exists and if it does we will use - // that as the default driver in order to provide support for old styles - // of the Laravel mail configuration file for backwards compatibility. - return $this->app['config']['mail.driver'] ?? - $this->app['config']['mail.default']; - } - - /** - * Set the default mail driver name. - * - * @param string $name - * @return void - */ - public function setDefaultDriver(string $name) - { - if ($this->app['config']['mail.driver']) { - $this->app['config']['mail.driver'] = $name; - } - - $this->app['config']['mail.default'] = $name; - } - - /** - * Disconnect the given mailer and remove from local cache. - * - * @param string|null $name - * @return void - */ - public function purge($name = null) - { - $name = $name ?: $this->getDefaultDriver(); - - unset($this->mailers[$name]); - } - - /** - * Register a custom transport creator Closure. - * - * @param string $driver - * @param \Closure $callback - * @return $this - */ - public function extend($driver, Closure $callback) - { - $this->customCreators[$driver] = $callback; - - return $this; - } - - /** - * Get the application instance used by the manager. - * - * @return \Illuminate\Contracts\Foundation\Application - */ - public function getApplication() - { - return $this->app; - } - - /** - * Set the application instance used by the manager. - * - * @param \Illuminate\Contracts\Foundation\Application $app - * @return $this - */ - public function setApplication($app) - { - $this->app = $app; - - return $this; - } - - /** - * Forget all of the resolved mailer instances. - * - * @return $this - */ - public function forgetMailers() - { - $this->mailers = []; - - return $this; - } - - /** - * Dynamically call the default driver instance. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - return $this->mailer()->$method(...$parameters); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Mail/MailServiceProvider.php b/vendor/laravel/framework/src/Illuminate/Mail/MailServiceProvider.php deleted file mode 100755 index d4f4682d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/MailServiceProvider.php +++ /dev/null @@ -1,73 +0,0 @@ -registerIlluminateMailer(); - $this->registerMarkdownRenderer(); - } - - /** - * Register the Illuminate mailer instance. - * - * @return void - */ - protected function registerIlluminateMailer() - { - $this->app->singleton('mail.manager', function ($app) { - return new MailManager($app); - }); - - $this->app->bind('mailer', function ($app) { - return $app->make('mail.manager')->mailer(); - }); - } - - /** - * Register the Markdown renderer instance. - * - * @return void - */ - protected function registerMarkdownRenderer() - { - if ($this->app->runningInConsole()) { - $this->publishes([ - __DIR__.'/resources/views' => $this->app->resourcePath('views/vendor/mail'), - ], 'laravel-mail'); - } - - $this->app->singleton(Markdown::class, function ($app) { - $config = $app->make('config'); - - return new Markdown($app->make('view'), [ - 'theme' => $config->get('mail.markdown.theme', 'default'), - 'paths' => $config->get('mail.markdown.paths', []), - ]); - }); - } - - /** - * Get the services provided by the provider. - * - * @return array - */ - public function provides() - { - return [ - 'mail.manager', - 'mailer', - Markdown::class, - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php b/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php deleted file mode 100644 index 5ebeb0fe..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php +++ /dev/null @@ -1,1754 +0,0 @@ -withLocale($this->locale, function () use ($mailer) { - $this->prepareMailableForDelivery(); - - $mailer = $mailer instanceof MailFactory - ? $mailer->mailer($this->mailer) - : $mailer; - - return $mailer->send($this->buildView(), $this->buildViewData(), function ($message) { - $this->buildFrom($message) - ->buildRecipients($message) - ->buildSubject($message) - ->buildTags($message) - ->buildMetadata($message) - ->runCallbacks($message) - ->buildAttachments($message); - }); - }); - } - - /** - * Queue the message for sending. - * - * @param \Illuminate\Contracts\Queue\Factory $queue - * @return mixed - */ - public function queue(Queue $queue) - { - if (isset($this->delay)) { - return $this->later($this->delay, $queue); - } - - $connection = property_exists($this, 'connection') ? $this->connection : null; - - $queueName = property_exists($this, 'queue') ? $this->queue : null; - - return $queue->connection($connection)->pushOn( - $queueName ?: null, $this->newQueuedJob() - ); - } - - /** - * Deliver the queued message after (n) seconds. - * - * @param \DateTimeInterface|\DateInterval|int $delay - * @param \Illuminate\Contracts\Queue\Factory $queue - * @return mixed - */ - public function later($delay, Queue $queue) - { - $connection = property_exists($this, 'connection') ? $this->connection : null; - - $queueName = property_exists($this, 'queue') ? $this->queue : null; - - return $queue->connection($connection)->laterOn( - $queueName ?: null, $delay, $this->newQueuedJob() - ); - } - - /** - * Make the queued mailable job instance. - * - * @return mixed - */ - protected function newQueuedJob() - { - return Container::getInstance()->make(SendQueuedMailable::class, ['mailable' => $this]) - ->through(array_merge( - method_exists($this, 'middleware') ? $this->middleware() : [], - $this->middleware ?? [] - )); - } - - /** - * Render the mailable into a view. - * - * @return string - * - * @throws \ReflectionException - */ - public function render() - { - return $this->withLocale($this->locale, function () { - $this->prepareMailableForDelivery(); - - return Container::getInstance()->make('mailer')->render( - $this->buildView(), $this->buildViewData() - ); - }); - } - - /** - * Build the view for the message. - * - * @return array|string - * - * @throws \ReflectionException - */ - protected function buildView() - { - if (isset($this->html)) { - return array_filter([ - 'html' => new HtmlString($this->html), - 'text' => $this->textView ?? null, - ]); - } - - if (isset($this->markdown)) { - return $this->buildMarkdownView(); - } - - if (isset($this->view, $this->textView)) { - return [$this->view, $this->textView]; - } elseif (isset($this->textView)) { - return ['text' => $this->textView]; - } - - return $this->view; - } - - /** - * Build the Markdown view for the message. - * - * @return array - * - * @throws \ReflectionException - */ - protected function buildMarkdownView() - { - $markdown = Container::getInstance()->make(Markdown::class); - - if (isset($this->theme)) { - $markdown->theme($this->theme); - } - - $data = $this->buildViewData(); - - return [ - 'html' => $markdown->render($this->markdown, $data), - 'text' => $this->buildMarkdownText($markdown, $data), - ]; - } - - /** - * Build the view data for the message. - * - * @return array - * - * @throws \ReflectionException - */ - public function buildViewData() - { - $data = $this->viewData; - - if (static::$viewDataCallback) { - $data = array_merge($data, call_user_func(static::$viewDataCallback, $this)); - } - - foreach ((new ReflectionClass($this))->getProperties(ReflectionProperty::IS_PUBLIC) as $property) { - if ($property->getDeclaringClass()->getName() !== self::class) { - $data[$property->getName()] = $property->getValue($this); - } - } - - return $data; - } - - /** - * Build the text view for a Markdown message. - * - * @param \Illuminate\Mail\Markdown $markdown - * @param array $data - * @return string - */ - protected function buildMarkdownText($markdown, $data) - { - return $this->textView - ?? $markdown->renderText($this->markdown, $data); - } - - /** - * Add the sender to the message. - * - * @param \Illuminate\Mail\Message $message - * @return $this - */ - protected function buildFrom($message) - { - if (! empty($this->from)) { - $message->from($this->from[0]['address'], $this->from[0]['name']); - } - - return $this; - } - - /** - * Add all of the recipients to the message. - * - * @param \Illuminate\Mail\Message $message - * @return $this - */ - protected function buildRecipients($message) - { - foreach (['to', 'cc', 'bcc', 'replyTo'] as $type) { - foreach ($this->{$type} as $recipient) { - $message->{$type}($recipient['address'], $recipient['name']); - } - } - - return $this; - } - - /** - * Set the subject for the message. - * - * @param \Illuminate\Mail\Message $message - * @return $this - */ - protected function buildSubject($message) - { - if ($this->subject) { - $message->subject($this->subject); - } else { - $message->subject(Str::title(Str::snake(class_basename($this), ' '))); - } - - return $this; - } - - /** - * Add all of the attachments to the message. - * - * @param \Illuminate\Mail\Message $message - * @return $this - */ - protected function buildAttachments($message) - { - foreach ($this->attachments as $attachment) { - $message->attach($attachment['file'], $attachment['options']); - } - - foreach ($this->rawAttachments as $attachment) { - $message->attachData( - $attachment['data'], $attachment['name'], $attachment['options'] - ); - } - - $this->buildDiskAttachments($message); - - return $this; - } - - /** - * Add all of the disk attachments to the message. - * - * @param \Illuminate\Mail\Message $message - * @return void - */ - protected function buildDiskAttachments($message) - { - foreach ($this->diskAttachments as $attachment) { - $storage = Container::getInstance()->make( - FilesystemFactory::class - )->disk($attachment['disk']); - - $message->attachData( - $storage->get($attachment['path']), - $attachment['name'] ?? basename($attachment['path']), - array_merge(['mime' => $storage->mimeType($attachment['path'])], $attachment['options']) - ); - } - } - - /** - * Add all defined tags to the message. - * - * @param \Illuminate\Mail\Message $message - * @return $this - */ - protected function buildTags($message) - { - if ($this->tags) { - foreach ($this->tags as $tag) { - $message->getHeaders()->add(new TagHeader($tag)); - } - } - - return $this; - } - - /** - * Add all defined metadata to the message. - * - * @param \Illuminate\Mail\Message $message - * @return $this - */ - protected function buildMetadata($message) - { - if ($this->metadata) { - foreach ($this->metadata as $key => $value) { - $message->getHeaders()->add(new MetadataHeader($key, $value)); - } - } - - return $this; - } - - /** - * Run the callbacks for the message. - * - * @param \Illuminate\Mail\Message $message - * @return $this - */ - protected function runCallbacks($message) - { - foreach ($this->callbacks as $callback) { - $callback($message->getSymfonyMessage()); - } - - return $this; - } - - /** - * Set the locale of the message. - * - * @param string $locale - * @return $this - */ - public function locale($locale) - { - $this->locale = $locale; - - return $this; - } - - /** - * Set the priority of this message. - * - * The value is an integer where 1 is the highest priority and 5 is the lowest. - * - * @param int $level - * @return $this - */ - public function priority($level = 3) - { - $this->callbacks[] = function ($message) use ($level) { - $message->priority($level); - }; - - return $this; - } - - /** - * Set the sender of the message. - * - * @param object|array|string $address - * @param string|null $name - * @return $this - */ - public function from($address, $name = null) - { - return $this->setAddress($address, $name, 'from'); - } - - /** - * Determine if the given recipient is set on the mailable. - * - * @param object|array|string $address - * @param string|null $name - * @return bool - */ - public function hasFrom($address, $name = null) - { - return $this->hasRecipient($address, $name, 'from'); - } - - /** - * Set the recipients of the message. - * - * @param object|array|string $address - * @param string|null $name - * @return $this - */ - public function to($address, $name = null) - { - if (! $this->locale && $address instanceof HasLocalePreference) { - $this->locale($address->preferredLocale()); - } - - return $this->setAddress($address, $name, 'to'); - } - - /** - * Determine if the given recipient is set on the mailable. - * - * @param object|array|string $address - * @param string|null $name - * @return bool - */ - public function hasTo($address, $name = null) - { - return $this->hasRecipient($address, $name, 'to'); - } - - /** - * Set the recipients of the message. - * - * @param object|array|string $address - * @param string|null $name - * @return $this - */ - public function cc($address, $name = null) - { - return $this->setAddress($address, $name, 'cc'); - } - - /** - * Determine if the given recipient is set on the mailable. - * - * @param object|array|string $address - * @param string|null $name - * @return bool - */ - public function hasCc($address, $name = null) - { - return $this->hasRecipient($address, $name, 'cc'); - } - - /** - * Set the recipients of the message. - * - * @param object|array|string $address - * @param string|null $name - * @return $this - */ - public function bcc($address, $name = null) - { - return $this->setAddress($address, $name, 'bcc'); - } - - /** - * Determine if the given recipient is set on the mailable. - * - * @param object|array|string $address - * @param string|null $name - * @return bool - */ - public function hasBcc($address, $name = null) - { - return $this->hasRecipient($address, $name, 'bcc'); - } - - /** - * Set the "reply to" address of the message. - * - * @param object|array|string $address - * @param string|null $name - * @return $this - */ - public function replyTo($address, $name = null) - { - return $this->setAddress($address, $name, 'replyTo'); - } - - /** - * Determine if the given replyTo is set on the mailable. - * - * @param object|array|string $address - * @param string|null $name - * @return bool - */ - public function hasReplyTo($address, $name = null) - { - return $this->hasRecipient($address, $name, 'replyTo'); - } - - /** - * Set the recipients of the message. - * - * All recipients are stored internally as [['name' => ?, 'address' => ?]] - * - * @param object|array|string $address - * @param string|null $name - * @param string $property - * @return $this - */ - protected function setAddress($address, $name = null, $property = 'to') - { - if (empty($address)) { - return $this; - } - - foreach ($this->addressesToArray($address, $name) as $recipient) { - $recipient = $this->normalizeRecipient($recipient); - - $this->{$property}[] = [ - 'name' => $recipient->name ?? null, - 'address' => $recipient->email, - ]; - } - - $this->{$property} = collect($this->{$property}) - ->unique('address') - ->values() - ->all(); - - return $this; - } - - /** - * Convert the given recipient arguments to an array. - * - * @param object|array|string $address - * @param string|null $name - * @return array - */ - protected function addressesToArray($address, $name) - { - if (! is_array($address) && ! $address instanceof Collection) { - $address = is_string($name) ? [['name' => $name, 'email' => $address]] : [$address]; - } - - return $address; - } - - /** - * Convert the given recipient into an object. - * - * @param mixed $recipient - * @return object - */ - protected function normalizeRecipient($recipient) - { - if (is_array($recipient)) { - if (array_values($recipient) === $recipient) { - return (object) array_map(function ($email) { - return compact('email'); - }, $recipient); - } - - return (object) $recipient; - } elseif (is_string($recipient)) { - return (object) ['email' => $recipient]; - } elseif ($recipient instanceof Address) { - return (object) ['email' => $recipient->getAddress(), 'name' => $recipient->getName()]; - } elseif ($recipient instanceof Mailables\Address) { - return (object) ['email' => $recipient->address, 'name' => $recipient->name]; - } - - return $recipient; - } - - /** - * Determine if the given recipient is set on the mailable. - * - * @param object|array|string $address - * @param string|null $name - * @param string $property - * @return bool - */ - protected function hasRecipient($address, $name = null, $property = 'to') - { - if (empty($address)) { - return false; - } - - $expected = $this->normalizeRecipient( - $this->addressesToArray($address, $name)[0] - ); - - $expected = [ - 'name' => $expected->name ?? null, - 'address' => $expected->email, - ]; - - if ($this->hasEnvelopeRecipient($expected['address'], $expected['name'], $property)) { - return true; - } - - return collect($this->{$property})->contains(function ($actual) use ($expected) { - if (! isset($expected['name'])) { - return $actual['address'] == $expected['address']; - } - - return $actual == $expected; - }); - } - - /** - * Determine if the mailable "envelope" method defines a recipient. - * - * @param string $address - * @param string|null $name - * @param string $property - * @return bool - */ - private function hasEnvelopeRecipient($address, $name, $property) - { - return method_exists($this, 'envelope') && match ($property) { - 'from' => $this->envelope()->isFrom($address, $name), - 'to' => $this->envelope()->hasTo($address, $name), - 'cc' => $this->envelope()->hasCc($address, $name), - 'bcc' => $this->envelope()->hasBcc($address, $name), - 'replyTo' => $this->envelope()->hasReplyTo($address, $name), - }; - } - - /** - * Set the subject of the message. - * - * @param string $subject - * @return $this - */ - public function subject($subject) - { - $this->subject = $subject; - - return $this; - } - - /** - * Determine if the mailable has the given subject. - * - * @param string $subject - * @return bool - */ - public function hasSubject($subject) - { - return $this->subject === $subject || - (method_exists($this, 'envelope') && $this->envelope()->hasSubject($subject)); - } - - /** - * Set the Markdown template for the message. - * - * @param string $view - * @param array $data - * @return $this - */ - public function markdown($view, array $data = []) - { - $this->markdown = $view; - $this->viewData = array_merge($this->viewData, $data); - - return $this; - } - - /** - * Set the view and view data for the message. - * - * @param string $view - * @param array $data - * @return $this - */ - public function view($view, array $data = []) - { - $this->view = $view; - $this->viewData = array_merge($this->viewData, $data); - - return $this; - } - - /** - * Set the rendered HTML content for the message. - * - * @param string $html - * @return $this - */ - public function html($html) - { - $this->html = $html; - - return $this; - } - - /** - * Set the plain text view for the message. - * - * @param string $textView - * @param array $data - * @return $this - */ - public function text($textView, array $data = []) - { - $this->textView = $textView; - $this->viewData = array_merge($this->viewData, $data); - - return $this; - } - - /** - * Set the view data for the message. - * - * @param string|array $key - * @param mixed $value - * @return $this - */ - public function with($key, $value = null) - { - if (is_array($key)) { - $this->viewData = array_merge($this->viewData, $key); - } else { - $this->viewData[$key] = $value; - } - - return $this; - } - - /** - * Attach a file to the message. - * - * @param string|\Illuminate\Contracts\Mail\Attachable|\Illuminate\Mail\Attachment $file - * @param array $options - * @return $this - */ - public function attach($file, array $options = []) - { - if ($file instanceof Attachable) { - $file = $file->toMailAttachment(); - } - - if ($file instanceof Attachment) { - return $file->attachTo($this); - } - - $this->attachments = collect($this->attachments) - ->push(compact('file', 'options')) - ->unique('file') - ->all(); - - return $this; - } - - /** - * Attach multiple files to the message. - * - * @param array $files - * @return $this - */ - public function attachMany($files) - { - foreach ($files as $file => $options) { - if (is_int($file)) { - $this->attach($options); - } else { - $this->attach($file, $options); - } - } - - return $this; - } - - /** - * Determine if the mailable has the given attachment. - * - * @param string|\Illuminate\Contracts\Mail\Attachable|\Illuminate\Mail\Attachment $file - * @param array $options - * @return bool - */ - public function hasAttachment($file, array $options = []) - { - if ($file instanceof Attachable) { - $file = $file->toMailAttachment(); - } - - if ($file instanceof Attachment && $this->hasEnvelopeAttachment($file)) { - return true; - } - - if ($file instanceof Attachment) { - $parts = $file->attachWith( - fn ($path) => [$path, ['as' => $file->as, 'mime' => $file->mime]], - fn ($data) => $this->hasAttachedData($data(), $file->as, ['mime' => $file->mime]) - ); - - if ($parts === true) { - return true; - } - - [$file, $options] = $parts === false - ? [null, []] - : $parts; - } - - return collect($this->attachments)->contains( - fn ($attachment) => $attachment['file'] === $file && array_filter($attachment['options']) === array_filter($options) - ); - } - - /** - * Determine if the mailable has the given envelope attachment. - * - * @param \Illuminate\Mail\Attachment $attachment - * @return bool - */ - private function hasEnvelopeAttachment($attachment) - { - if (! method_exists($this, 'envelope')) { - return false; - } - - $attachments = $this->attachments(); - - return Collection::make(is_object($attachments) ? [$attachments] : $attachments) - ->map(fn ($attached) => $attached instanceof Attachable ? $attached->toMailAttachment() : $attached) - ->contains(fn ($attached) => $attached->isEquivalent($attachment)); - } - - /** - * Attach a file to the message from storage. - * - * @param string $path - * @param string|null $name - * @param array $options - * @return $this - */ - public function attachFromStorage($path, $name = null, array $options = []) - { - return $this->attachFromStorageDisk(null, $path, $name, $options); - } - - /** - * Attach a file to the message from storage. - * - * @param string $disk - * @param string $path - * @param string|null $name - * @param array $options - * @return $this - */ - public function attachFromStorageDisk($disk, $path, $name = null, array $options = []) - { - $this->diskAttachments = collect($this->diskAttachments)->push([ - 'disk' => $disk, - 'path' => $path, - 'name' => $name ?? basename($path), - 'options' => $options, - ])->unique(function ($file) { - return $file['name'].$file['disk'].$file['path']; - })->all(); - - return $this; - } - - /** - * Determine if the mailable has the given attachment from storage. - * - * @param string $path - * @param string|null $name - * @param array $options - * @return bool - */ - public function hasAttachmentFromStorage($path, $name = null, array $options = []) - { - return $this->hasAttachmentFromStorageDisk(null, $path, $name, $options); - } - - /** - * Determine if the mailable has the given attachment from a specific storage disk. - * - * @param string $disk - * @param string $path - * @param string|null $name - * @param array $options - * @return bool - */ - public function hasAttachmentFromStorageDisk($disk, $path, $name = null, array $options = []) - { - return collect($this->diskAttachments)->contains( - fn ($attachment) => $attachment['disk'] === $disk - && $attachment['path'] === $path - && $attachment['name'] === ($name ?? basename($path)) - && $attachment['options'] === $options - ); - } - - /** - * Attach in-memory data as an attachment. - * - * @param string $data - * @param string $name - * @param array $options - * @return $this - */ - public function attachData($data, $name, array $options = []) - { - $this->rawAttachments = collect($this->rawAttachments) - ->push(compact('data', 'name', 'options')) - ->unique(function ($file) { - return $file['name'].$file['data']; - })->all(); - - return $this; - } - - /** - * Determine if the mailable has the given data as an attachment. - * - * @param string $data - * @param string $name - * @param array $options - * @return bool - */ - public function hasAttachedData($data, $name, array $options = []) - { - return collect($this->rawAttachments)->contains( - fn ($attachment) => $attachment['data'] === $data - && $attachment['name'] === $name - && array_filter($attachment['options']) === array_filter($options) - ); - } - - /** - * Add a tag header to the message when supported by the underlying transport. - * - * @param string $value - * @return $this - */ - public function tag($value) - { - array_push($this->tags, $value); - - return $this; - } - - /** - * Determine if the mailable has the given tag. - * - * @param string $value - * @return bool - */ - public function hasTag($value) - { - return in_array($value, $this->tags) || - (method_exists($this, 'envelope') && in_array($value, $this->envelope()->tags)); - } - - /** - * Add a metadata header to the message when supported by the underlying transport. - * - * @param string $key - * @param string $value - * @return $this - */ - public function metadata($key, $value) - { - $this->metadata[$key] = $value; - - return $this; - } - - /** - * Determine if the mailable has the given metadata. - * - * @param string $key - * @param string $value - * @return bool - */ - public function hasMetadata($key, $value) - { - return (isset($this->metadata[$key]) && $this->metadata[$key] === $value) || - (method_exists($this, 'envelope') && $this->envelope()->hasMetadata($key, $value)); - } - - /** - * Assert that the mailable is from the given address. - * - * @param object|array|string $address - * @param string|null $name - * @return $this - */ - public function assertFrom($address, $name = null) - { - $recipient = $this->formatAssertionRecipient($address, $name); - - PHPUnit::assertTrue( - $this->hasFrom($address, $name), - "Email was not from expected address [{$recipient}]." - ); - - return $this; - } - - /** - * Assert that the mailable has the given recipient. - * - * @param object|array|string $address - * @param string|null $name - * @return $this - */ - public function assertTo($address, $name = null) - { - $recipient = $this->formatAssertionRecipient($address, $name); - - PHPUnit::assertTrue( - $this->hasTo($address, $name), - "Did not see expected recipient [{$recipient}] in email recipients." - ); - - return $this; - } - - /** - * Assert that the mailable has the given recipient. - * - * @param object|array|string $address - * @param string|null $name - * @return $this - */ - public function assertHasTo($address, $name = null) - { - return $this->assertTo($address, $name); - } - - /** - * Assert that the mailable has the given recipient. - * - * @param object|array|string $address - * @param string|null $name - * @return $this - */ - public function assertHasCc($address, $name = null) - { - $recipient = $this->formatAssertionRecipient($address, $name); - - PHPUnit::assertTrue( - $this->hasCc($address, $name), - "Did not see expected recipient [{$recipient}] in email recipients." - ); - - return $this; - } - - /** - * Assert that the mailable has the given recipient. - * - * @param object|array|string $address - * @param string|null $name - * @return $this - */ - public function assertHasBcc($address, $name = null) - { - $recipient = $this->formatAssertionRecipient($address, $name); - - PHPUnit::assertTrue( - $this->hasBcc($address, $name), - "Did not see expected recipient [{$recipient}] in email recipients." - ); - - return $this; - } - - /** - * Assert that the mailable has the given "reply to" address. - * - * @param object|array|string $address - * @param string|null $name - * @return $this - */ - public function assertHasReplyTo($address, $name = null) - { - $replyTo = $this->formatAssertionRecipient($address, $name); - - PHPUnit::assertTrue( - $this->hasReplyTo($address, $name), - "Did not see expected address [{$replyTo}] as email 'reply to' recipient." - ); - - return $this; - } - - /** - * Format the mailable recipeint for display in an assertion message. - * - * @param object|array|string $address - * @param string|null $name - * @return string - */ - private function formatAssertionRecipient($address, $name = null) - { - if (! is_string($address)) { - $address = json_encode($address); - } - - if (filled($name)) { - $address .= ' ('.$name.')'; - } - - return $address; - } - - /** - * Assert that the mailable has the given subject. - * - * @param string $subject - * @return $this - */ - public function assertHasSubject($subject) - { - PHPUnit::assertTrue( - $this->hasSubject($subject), - "Did not see expected text [{$subject}] in email subject." - ); - - return $this; - } - - /** - * Assert that the given text is present in the HTML email body. - * - * @param string $string - * @return $this - */ - public function assertSeeInHtml($string) - { - [$html, $text] = $this->renderForAssertions(); - - PHPUnit::assertTrue( - str_contains($html, $string), - "Did not see expected text [{$string}] within email body." - ); - - return $this; - } - - /** - * Assert that the given text is not present in the HTML email body. - * - * @param string $string - * @return $this - */ - public function assertDontSeeInHtml($string) - { - [$html, $text] = $this->renderForAssertions(); - - PHPUnit::assertFalse( - str_contains($html, $string), - "Saw unexpected text [{$string}] within email body." - ); - - return $this; - } - - /** - * Assert that the given text strings are present in order in the HTML email body. - * - * @param array $strings - * @return $this - */ - public function assertSeeInOrderInHtml($strings) - { - [$html, $text] = $this->renderForAssertions(); - - PHPUnit::assertThat($strings, new SeeInOrder($html)); - - return $this; - } - - /** - * Assert that the given text is present in the plain-text email body. - * - * @param string $string - * @return $this - */ - public function assertSeeInText($string) - { - [$html, $text] = $this->renderForAssertions(); - - PHPUnit::assertTrue( - str_contains($text, $string), - "Did not see expected text [{$string}] within text email body." - ); - - return $this; - } - - /** - * Assert that the given text is not present in the plain-text email body. - * - * @param string $string - * @return $this - */ - public function assertDontSeeInText($string) - { - [$html, $text] = $this->renderForAssertions(); - - PHPUnit::assertFalse( - str_contains($text, $string), - "Saw unexpected text [{$string}] within text email body." - ); - - return $this; - } - - /** - * Assert that the given text strings are present in order in the plain-text email body. - * - * @param array $strings - * @return $this - */ - public function assertSeeInOrderInText($strings) - { - [$html, $text] = $this->renderForAssertions(); - - PHPUnit::assertThat($strings, new SeeInOrder($text)); - - return $this; - } - - /** - * Assert the mailable has the given attachment. - * - * @param string|\Illuminate\Contracts\Mail\Attachable|\Illuminate\Mail\Attachment $file - * @param array $options - * @return $this - */ - public function assertHasAttachment($file, array $options = []) - { - $this->renderForAssertions(); - - PHPUnit::assertTrue( - $this->hasAttachment($file, $options), - 'Did not find the expected attachment.' - ); - - return $this; - } - - /** - * Assert the mailable has the given data as an attachment. - * - * @param string $data - * @param string $name - * @param array $options - * @return $this - */ - public function assertHasAttachedData($data, $name, array $options = []) - { - $this->renderForAssertions(); - - PHPUnit::assertTrue( - $this->hasAttachedData($data, $name, $options), - 'Did not find the expected attachment.' - ); - - return $this; - } - - /** - * Assert the mailable has the given attachment from storage. - * - * @param string $path - * @param string|null $name - * @param array $options - * @return $this - */ - public function assertHasAttachmentFromStorage($path, $name = null, array $options = []) - { - $this->renderForAssertions(); - - PHPUnit::assertTrue( - $this->hasAttachmentFromStorage($path, $name, $options), - 'Did not find the expected attachment.' - ); - - return $this; - } - - /** - * Assert the mailable has the given attachment from a specific storage disk. - * - * @param string $disk - * @param string $path - * @param string|null $name - * @param array $options - * @return $this - */ - public function assertHasAttachmentFromStorageDisk($disk, $path, $name = null, array $options = []) - { - $this->renderForAssertions(); - - PHPUnit::assertTrue( - $this->hasAttachmentFromStorageDisk($disk, $path, $name, $options), - 'Did not find the expected attachment.' - ); - - return $this; - } - - /** - * Assert that the mailable has the given tag. - * - * @param string $tag - * @return $this - */ - public function assertHasTag($tag) - { - PHPUnit::assertTrue( - $this->hasTag($tag), - "Did not see expected tag [{$tag}] in email tags." - ); - - return $this; - } - - /** - * Assert that the mailable has the given metadata. - * - * @param string $key - * @param string $value - * @return $this - */ - public function assertHasMetadata($key, $value) - { - PHPUnit::assertTrue( - $this->hasMetadata($key, $value), - "Did not see expected key [{$key}] and value [{$value}] in email metadata." - ); - - return $this; - } - - /** - * Render the HTML and plain-text version of the mailable into views for assertions. - * - * @return array - * - * @throws \ReflectionException - */ - protected function renderForAssertions() - { - if ($this->assertionableRenderStrings) { - return $this->assertionableRenderStrings; - } - - return $this->assertionableRenderStrings = $this->withLocale($this->locale, function () { - $this->prepareMailableForDelivery(); - - $html = Container::getInstance()->make('mailer')->render( - $view = $this->buildView(), $this->buildViewData() - ); - - if (is_array($view) && isset($view[1])) { - $text = $view[1]; - } - - $text ??= $view['text'] ?? ''; - - if (! empty($text) && ! $text instanceof Htmlable) { - $text = Container::getInstance()->make('mailer')->render( - $text, $this->buildViewData() - ); - } - - return [(string) $html, (string) $text]; - }); - } - - /** - * Prepare the mailable instance for delivery. - * - * @return void - */ - private function prepareMailableForDelivery() - { - if (method_exists($this, 'build')) { - Container::getInstance()->call([$this, 'build']); - } - - $this->ensureHeadersAreHydrated(); - $this->ensureEnvelopeIsHydrated(); - $this->ensureContentIsHydrated(); - $this->ensureAttachmentsAreHydrated(); - } - - /** - * Ensure the mailable's headers are hydrated from the "headers" method. - * - * @return void - */ - private function ensureHeadersAreHydrated() - { - if (! method_exists($this, 'headers')) { - return; - } - - $headers = $this->headers(); - - $this->withSymfonyMessage(function ($message) use ($headers) { - if ($headers->messageId) { - $message->getHeaders()->addIdHeader('Message-Id', $headers->messageId); - } - - if (count($headers->references) > 0) { - $message->getHeaders()->addTextHeader('References', $headers->referencesString()); - } - - foreach ($headers->text as $key => $value) { - $message->getHeaders()->addTextHeader($key, $value); - } - }); - } - - /** - * Ensure the mailable's "envelope" data is hydrated from the "envelope" method. - * - * @return void - */ - private function ensureEnvelopeIsHydrated() - { - if (! method_exists($this, 'envelope')) { - return; - } - - $envelope = $this->envelope(); - - if (isset($envelope->from)) { - $this->from($envelope->from->address, $envelope->from->name); - } - - foreach (['to', 'cc', 'bcc', 'replyTo'] as $type) { - foreach ($envelope->{$type} as $address) { - $this->{$type}($address->address, $address->name); - } - } - - if ($envelope->subject) { - $this->subject($envelope->subject); - } - - foreach ($envelope->tags as $tag) { - $this->tag($tag); - } - - foreach ($envelope->metadata as $key => $value) { - $this->metadata($key, $value); - } - - foreach ($envelope->using as $callback) { - $this->withSymfonyMessage($callback); - } - } - - /** - * Ensure the mailable's content is hydrated from the "content" method. - * - * @return void - */ - private function ensureContentIsHydrated() - { - if (! method_exists($this, 'content')) { - return; - } - - $content = $this->content(); - - if ($content->view) { - $this->view($content->view); - } - - if ($content->html) { - $this->view($content->html); - } - - if ($content->text) { - $this->text($content->text); - } - - if ($content->markdown) { - $this->markdown($content->markdown); - } - - if ($content->htmlString) { - $this->html($content->htmlString); - } - - foreach ($content->with as $key => $value) { - $this->with($key, $value); - } - } - - /** - * Ensure the mailable's attachments are hydrated from the "attachments" method. - * - * @return void - */ - private function ensureAttachmentsAreHydrated() - { - if (! method_exists($this, 'attachments')) { - return; - } - - $attachments = $this->attachments(); - - Collection::make(is_object($attachments) ? [$attachments] : $attachments) - ->each(function ($attachment) { - $this->attach($attachment); - }); - } - - /** - * Set the name of the mailer that should send the message. - * - * @param string $mailer - * @return $this - */ - public function mailer($mailer) - { - $this->mailer = $mailer; - - return $this; - } - - /** - * Register a callback to be called with the Symfony message instance. - * - * @param callable $callback - * @return $this - */ - public function withSymfonyMessage($callback) - { - $this->callbacks[] = $callback; - - return $this; - } - - /** - * Register a callback to be called while building the view data. - * - * @param callable $callback - * @return void - */ - public static function buildViewDataUsing(callable $callback) - { - static::$viewDataCallback = $callback; - } - - /** - * Dynamically bind parameters to the message. - * - * @param string $method - * @param array $parameters - * @return $this - * - * @throws \BadMethodCallException - */ - public function __call($method, $parameters) - { - if (static::hasMacro($method)) { - return $this->macroCall($method, $parameters); - } - - if (str_starts_with($method, 'with')) { - return $this->with(Str::camel(substr($method, 4)), $parameters[0]); - } - - static::throwBadMethodCallException($method); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Mail/Mailables/Address.php b/vendor/laravel/framework/src/Illuminate/Mail/Mailables/Address.php deleted file mode 100644 index be54a24a..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/Mailables/Address.php +++ /dev/null @@ -1,33 +0,0 @@ -address = $address; - $this->name = $name; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Mail/Mailables/Attachment.php b/vendor/laravel/framework/src/Illuminate/Mail/Mailables/Attachment.php deleted file mode 100644 index e11d2e96..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/Mailables/Attachment.php +++ /dev/null @@ -1,10 +0,0 @@ -view = $view; - $this->html = $html; - $this->text = $text; - $this->markdown = $markdown; - $this->with = $with; - $this->htmlString = $htmlString; - } - - /** - * Set the view for the message. - * - * @param string $view - * @return $this - */ - public function view(string $view) - { - $this->view = $view; - - return $this; - } - - /** - * Set the view for the message. - * - * @param string $view - * @return $this - */ - public function html(string $view) - { - return $this->view($view); - } - - /** - * Set the plain text view for the message. - * - * @param string $view - * @return $this - */ - public function text(string $view) - { - $this->text = $view; - - return $this; - } - - /** - * Set the Markdown view for the message. - * - * @param string $view - * @return $this - */ - public function markdown(string $view) - { - $this->markdown = $view; - - return $this; - } - - /** - * Set the pre-rendered HTML for the message. - * - * @param string $html - * @return $this - */ - public function htmlString(string $html) - { - $this->htmlString = $html; - - return $this; - } - - /** - * Add a piece of view data to the message. - * - * @param string $key - * @param mixed|null $value - * @return $this - */ - public function with($key, $value = null) - { - if (is_array($key)) { - $this->with = array_merge($this->with, $key); - } else { - $this->with[$key] = $value; - } - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Mail/Mailables/Envelope.php b/vendor/laravel/framework/src/Illuminate/Mail/Mailables/Envelope.php deleted file mode 100644 index 7d6c4b1e..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/Mailables/Envelope.php +++ /dev/null @@ -1,369 +0,0 @@ -from = is_string($from) ? new Address($from) : $from; - $this->to = $this->normalizeAddresses($to); - $this->cc = $this->normalizeAddresses($cc); - $this->bcc = $this->normalizeAddresses($bcc); - $this->replyTo = $this->normalizeAddresses($replyTo); - $this->subject = $subject; - $this->tags = $tags; - $this->metadata = $metadata; - $this->using = Arr::wrap($using); - } - - /** - * Normalize the given array of addresses. - * - * @param array $addresses - * @return array - */ - protected function normalizeAddresses($addresses) - { - return collect($addresses)->map(function ($address) { - return is_string($address) ? new Address($address) : $address; - })->all(); - } - - /** - * Specify who the message will be "from". - * - * @param \Illuminate\Mail\Mailables\Address|string $address - * @param string|null $name - * @return $this - */ - public function from(Address|string $address, $name = null) - { - $this->from = is_string($address) ? new Address($address, $name) : $address; - - return $this; - } - - /** - * Add a "to" recipient to the message envelope. - * - * @param \Illuminate\Mail\Mailables\Address|array|string $address - * @param string|null $name - * @return $this - */ - public function to(Address|array|string $address, $name = null) - { - $this->to = array_merge($this->to, $this->normalizeAddresses( - is_string($name) ? [new Address($address, $name)] : Arr::wrap($address), - )); - - return $this; - } - - /** - * Add a "cc" recipient to the message envelope. - * - * @param \Illuminate\Mail\Mailables\Address|array|string $address - * @param string|null $name - * @return $this - */ - public function cc(Address|array|string $address, $name = null) - { - $this->cc = array_merge($this->cc, $this->normalizeAddresses( - is_string($name) ? [new Address($address, $name)] : Arr::wrap($address), - )); - - return $this; - } - - /** - * Add a "bcc" recipient to the message envelope. - * - * @param \Illuminate\Mail\Mailables\Address|array|string $address - * @param string|null $name - * @return $this - */ - public function bcc(Address|array|string $address, $name = null) - { - $this->bcc = array_merge($this->bcc, $this->normalizeAddresses( - is_string($name) ? [new Address($address, $name)] : Arr::wrap($address), - )); - - return $this; - } - - /** - * Add a "reply to" recipient to the message envelope. - * - * @param \Illuminate\Mail\Mailables\Address|array|string $address - * @param string|null $name - * @return $this - */ - public function replyTo(Address|array|string $address, $name = null) - { - $this->replyTo = array_merge($this->replyTo, $this->normalizeAddresses( - is_string($name) ? [new Address($address, $name)] : Arr::wrap($address), - )); - - return $this; - } - - /** - * Set the subject of the message. - * - * @param string $subject - * @return $this - */ - public function subject(string $subject) - { - $this->subject = $subject; - - return $this; - } - - /** - * Add "tags" to the message. - * - * @param array $tags - * @return $this - */ - public function tags(array $tags) - { - $this->tags = array_merge($this->tags, $tags); - - return $this; - } - - /** - * Add a "tag" to the message. - * - * @param string $tag - * @return $this - */ - public function tag(string $tag) - { - $this->tags[] = $tag; - - return $this; - } - - /** - * Add metadata to the message. - * - * @param string $key - * @param string|int $value - * @return $this - */ - public function metadata(string $key, string|int $value) - { - $this->metadata[$key] = $value; - - return $this; - } - - /** - * Add a Symfony Message customization callback to the message. - * - * @param \Closure $callback - * @return $this - */ - public function using(Closure $callback) - { - $this->using[] = $callback; - - return $this; - } - - /** - * Determine if the message is from the given address. - * - * @param string $address - * @param string|null $name - * @return bool - */ - public function isFrom(string $address, string $name = null) - { - if (is_null($name)) { - return $this->from->address === $address; - } - - return $this->from->address === $address && - $this->from->name === $name; - } - - /** - * Determine if the message has the given address as a recipient. - * - * @param string $address - * @param string|null $name - * @return bool - */ - public function hasTo(string $address, string $name = null) - { - return $this->hasRecipient($this->to, $address, $name); - } - - /** - * Determine if the message has the given address as a "cc" recipient. - * - * @param string $address - * @param string|null $name - * @return bool - */ - public function hasCc(string $address, string $name = null) - { - return $this->hasRecipient($this->cc, $address, $name); - } - - /** - * Determine if the message has the given address as a "bcc" recipient. - * - * @param string $address - * @param string|null $name - * @return bool - */ - public function hasBcc(string $address, string $name = null) - { - return $this->hasRecipient($this->bcc, $address, $name); - } - - /** - * Determine if the message has the given address as a "reply to" recipient. - * - * @param string $address - * @param string|null $name - * @return bool - */ - public function hasReplyTo(string $address, string $name = null) - { - return $this->hasRecipient($this->replyTo, $address, $name); - } - - /** - * Determine if the message has the given recipient. - * - * @param array $recipients - * @param string $address - * @param string|null $name - * @return bool - */ - protected function hasRecipient(array $recipients, string $address, ?string $name = null) - { - return collect($recipients)->contains(function ($recipient) use ($address, $name) { - if (is_null($name)) { - return $recipient->address === $address; - } - - return $recipient->address === $address && - $recipient->name === $name; - }); - } - - /** - * Determine if the message has the given subject. - * - * @param string $subject - * @return bool - */ - public function hasSubject(string $subject) - { - return $this->subject === $subject; - } - - /** - * Determine if the message has the given metadata. - * - * @param string $key - * @param string $value - * @return bool - */ - public function hasMetadata(string $key, string $value) - { - return isset($this->metadata[$key]) && (string) $this->metadata[$key] === $value; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Mail/Mailables/Headers.php b/vendor/laravel/framework/src/Illuminate/Mail/Mailables/Headers.php deleted file mode 100644 index 87cee52b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/Mailables/Headers.php +++ /dev/null @@ -1,100 +0,0 @@ -messageId = $messageId; - $this->references = $references; - $this->text = $text; - } - - /** - * Set the message ID. - * - * @param string $messageId - * @return $this - */ - public function messageId(string $messageId) - { - $this->messageId = $messageId; - - return $this; - } - - /** - * Set the message IDs referenced by this message. - * - * @param array $references - * @return $this - */ - public function references(array $references) - { - $this->references = array_merge($this->references, $references); - - return $this; - } - - /** - * Set the headers for this message. - * - * @param array $references - * @return $this - */ - public function text(array $text) - { - $this->text = array_merge($this->text, $text); - - return $this; - } - - /** - * Get the references header as a string. - * - * @return string - */ - public function referencesString(): string - { - return collect($this->references)->map(function ($messageId) { - return Str::finish(Str::start($messageId, '<'), '>'); - })->implode(' '); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php b/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php deleted file mode 100755 index 4a253cf2..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php +++ /dev/null @@ -1,604 +0,0 @@ -name = $name; - $this->views = $views; - $this->events = $events; - $this->transport = $transport; - } - - /** - * Set the global from address and name. - * - * @param string $address - * @param string|null $name - * @return void - */ - public function alwaysFrom($address, $name = null) - { - $this->from = compact('address', 'name'); - } - - /** - * Set the global reply-to address and name. - * - * @param string $address - * @param string|null $name - * @return void - */ - public function alwaysReplyTo($address, $name = null) - { - $this->replyTo = compact('address', 'name'); - } - - /** - * Set the global return path address. - * - * @param string $address - * @return void - */ - public function alwaysReturnPath($address) - { - $this->returnPath = compact('address'); - } - - /** - * Set the global to address and name. - * - * @param string $address - * @param string|null $name - * @return void - */ - public function alwaysTo($address, $name = null) - { - $this->to = compact('address', 'name'); - } - - /** - * Begin the process of mailing a mailable class instance. - * - * @param mixed $users - * @return \Illuminate\Mail\PendingMail - */ - public function to($users) - { - return (new PendingMail($this))->to($users); - } - - /** - * Begin the process of mailing a mailable class instance. - * - * @param mixed $users - * @return \Illuminate\Mail\PendingMail - */ - public function cc($users) - { - return (new PendingMail($this))->cc($users); - } - - /** - * Begin the process of mailing a mailable class instance. - * - * @param mixed $users - * @return \Illuminate\Mail\PendingMail - */ - public function bcc($users) - { - return (new PendingMail($this))->bcc($users); - } - - /** - * Send a new message with only an HTML part. - * - * @param string $html - * @param mixed $callback - * @return \Illuminate\Mail\SentMessage|null - */ - public function html($html, $callback) - { - return $this->send(['html' => new HtmlString($html)], [], $callback); - } - - /** - * Send a new message with only a raw text part. - * - * @param string $text - * @param mixed $callback - * @return \Illuminate\Mail\SentMessage|null - */ - public function raw($text, $callback) - { - return $this->send(['raw' => $text], [], $callback); - } - - /** - * Send a new message with only a plain part. - * - * @param string $view - * @param array $data - * @param mixed $callback - * @return \Illuminate\Mail\SentMessage|null - */ - public function plain($view, array $data, $callback) - { - return $this->send(['text' => $view], $data, $callback); - } - - /** - * Render the given message as a view. - * - * @param string|array $view - * @param array $data - * @return string - */ - public function render($view, array $data = []) - { - // First we need to parse the view, which could either be a string or an array - // containing both an HTML and plain text versions of the view which should - // be used when sending an e-mail. We will extract both of them out here. - [$view, $plain, $raw] = $this->parseView($view); - - $data['message'] = $this->createMessage(); - - return $this->renderView($view ?: $plain, $data); - } - - /** - * Send a new message using a view. - * - * @param \Illuminate\Contracts\Mail\Mailable|string|array $view - * @param array $data - * @param \Closure|string|null $callback - * @return \Illuminate\Mail\SentMessage|null - */ - public function send($view, array $data = [], $callback = null) - { - if ($view instanceof MailableContract) { - return $this->sendMailable($view); - } - - // First we need to parse the view, which could either be a string or an array - // containing both an HTML and plain text versions of the view which should - // be used when sending an e-mail. We will extract both of them out here. - [$view, $plain, $raw] = $this->parseView($view); - - $data['message'] = $message = $this->createMessage(); - - // Once we have retrieved the view content for the e-mail we will set the body - // of this message using the HTML type, which will provide a simple wrapper - // to creating view based emails that are able to receive arrays of data. - if (! is_null($callback)) { - $callback($message); - } - - $this->addContent($message, $view, $plain, $raw, $data); - - // If a global "to" address has been set, we will set that address on the mail - // message. This is primarily useful during local development in which each - // message should be delivered into a single mail address for inspection. - if (isset($this->to['address'])) { - $this->setGlobalToAndRemoveCcAndBcc($message); - } - - // Next we will determine if the message should be sent. We give the developer - // one final chance to stop this message and then we will send it to all of - // its recipients. We will then fire the sent event for the sent message. - $symfonyMessage = $message->getSymfonyMessage(); - - if ($this->shouldSendMessage($symfonyMessage, $data)) { - $symfonySentMessage = $this->sendSymfonyMessage($symfonyMessage); - - if ($symfonySentMessage) { - $sentMessage = new SentMessage($symfonySentMessage); - - $this->dispatchSentEvent($sentMessage, $data); - - return $sentMessage; - } - } - } - - /** - * Send the given mailable. - * - * @param \Illuminate\Contracts\Mail\Mailable $mailable - * @return \Illuminate\Mail\SentMessage|null - */ - protected function sendMailable(MailableContract $mailable) - { - return $mailable instanceof ShouldQueue - ? $mailable->mailer($this->name)->queue($this->queue) - : $mailable->mailer($this->name)->send($this); - } - - /** - * Parse the given view name or array. - * - * @param string|array $view - * @return array - * - * @throws \InvalidArgumentException - */ - protected function parseView($view) - { - if (is_string($view)) { - return [$view, null, null]; - } - - // If the given view is an array with numeric keys, we will just assume that - // both a "pretty" and "plain" view were provided, so we will return this - // array as is, since it should contain both views with numerical keys. - if (is_array($view) && isset($view[0])) { - return [$view[0], $view[1], null]; - } - - // If this view is an array but doesn't contain numeric keys, we will assume - // the views are being explicitly specified and will extract them via the - // named keys instead, allowing the developers to use one or the other. - if (is_array($view)) { - return [ - $view['html'] ?? null, - $view['text'] ?? null, - $view['raw'] ?? null, - ]; - } - - throw new InvalidArgumentException('Invalid view.'); - } - - /** - * Add the content to a given message. - * - * @param \Illuminate\Mail\Message $message - * @param string $view - * @param string $plain - * @param string $raw - * @param array $data - * @return void - */ - protected function addContent($message, $view, $plain, $raw, $data) - { - if (isset($view)) { - $message->html($this->renderView($view, $data) ?: ' '); - } - - if (isset($plain)) { - $message->text($this->renderView($plain, $data) ?: ' '); - } - - if (isset($raw)) { - $message->text($raw); - } - } - - /** - * Render the given view. - * - * @param string $view - * @param array $data - * @return string - */ - protected function renderView($view, $data) - { - return $view instanceof Htmlable - ? $view->toHtml() - : $this->views->make($view, $data)->render(); - } - - /** - * Set the global "to" address on the given message. - * - * @param \Illuminate\Mail\Message $message - * @return void - */ - protected function setGlobalToAndRemoveCcAndBcc($message) - { - $message->forgetTo(); - - $message->to($this->to['address'], $this->to['name'], true); - - $message->forgetCc(); - $message->forgetBcc(); - } - - /** - * Queue a new e-mail message for sending. - * - * @param \Illuminate\Contracts\Mail\Mailable|string|array $view - * @param string|null $queue - * @return mixed - * - * @throws \InvalidArgumentException - */ - public function queue($view, $queue = null) - { - if (! $view instanceof MailableContract) { - throw new InvalidArgumentException('Only mailables may be queued.'); - } - - if (is_string($queue)) { - $view->onQueue($queue); - } - - return $view->mailer($this->name)->queue($this->queue); - } - - /** - * Queue a new e-mail message for sending on the given queue. - * - * @param string $queue - * @param \Illuminate\Contracts\Mail\Mailable $view - * @return mixed - */ - public function onQueue($queue, $view) - { - return $this->queue($view, $queue); - } - - /** - * Queue a new e-mail message for sending on the given queue. - * - * This method didn't match rest of framework's "onQueue" phrasing. Added "onQueue". - * - * @param string $queue - * @param \Illuminate\Contracts\Mail\Mailable $view - * @return mixed - */ - public function queueOn($queue, $view) - { - return $this->onQueue($queue, $view); - } - - /** - * Queue a new e-mail message for sending after (n) seconds. - * - * @param \DateTimeInterface|\DateInterval|int $delay - * @param \Illuminate\Contracts\Mail\Mailable $view - * @param string|null $queue - * @return mixed - * - * @throws \InvalidArgumentException - */ - public function later($delay, $view, $queue = null) - { - if (! $view instanceof MailableContract) { - throw new InvalidArgumentException('Only mailables may be queued.'); - } - - return $view->mailer($this->name)->later( - $delay, is_null($queue) ? $this->queue : $queue - ); - } - - /** - * Queue a new e-mail message for sending after (n) seconds on the given queue. - * - * @param string $queue - * @param \DateTimeInterface|\DateInterval|int $delay - * @param \Illuminate\Contracts\Mail\Mailable $view - * @return mixed - */ - public function laterOn($queue, $delay, $view) - { - return $this->later($delay, $view, $queue); - } - - /** - * Create a new message instance. - * - * @return \Illuminate\Mail\Message - */ - protected function createMessage() - { - $message = new Message(new Email()); - - // If a global from address has been specified we will set it on every message - // instance so the developer does not have to repeat themselves every time - // they create a new message. We'll just go ahead and push this address. - if (! empty($this->from['address'])) { - $message->from($this->from['address'], $this->from['name']); - } - - // When a global reply address was specified we will set this on every message - // instance so the developer does not have to repeat themselves every time - // they create a new message. We will just go ahead and push this address. - if (! empty($this->replyTo['address'])) { - $message->replyTo($this->replyTo['address'], $this->replyTo['name']); - } - - if (! empty($this->returnPath['address'])) { - $message->returnPath($this->returnPath['address']); - } - - return $message; - } - - /** - * Send a Symfony Email instance. - * - * @param \Symfony\Component\Mime\Email $message - * @return \Symfony\Component\Mailer\SentMessage|null - */ - protected function sendSymfonyMessage(Email $message) - { - try { - return $this->transport->send($message, Envelope::create($message)); - } finally { - // - } - } - - /** - * Determines if the email can be sent. - * - * @param \Symfony\Component\Mime\Email $message - * @param array $data - * @return bool - */ - protected function shouldSendMessage($message, $data = []) - { - if (! $this->events) { - return true; - } - - return $this->events->until( - new MessageSending($message, $data) - ) !== false; - } - - /** - * Dispatch the message sent event. - * - * @param \Illuminate\Mail\SentMessage $message - * @param array $data - * @return void - */ - protected function dispatchSentEvent($message, $data = []) - { - if ($this->events) { - $this->events->dispatch( - new MessageSent($message, $data) - ); - } - } - - /** - * Get the Symfony Transport instance. - * - * @return \Symfony\Component\Mailer\Transport\TransportInterface - */ - public function getSymfonyTransport() - { - return $this->transport; - } - - /** - * Get the view factory instance. - * - * @return \Illuminate\Contracts\View\Factory - */ - public function getViewFactory() - { - return $this->views; - } - - /** - * Set the Symfony Transport instance. - * - * @param \Symfony\Component\Mailer\Transport\TransportInterface $transport - * @return void - */ - public function setSymfonyTransport(TransportInterface $transport) - { - $this->transport = $transport; - } - - /** - * Set the queue manager instance. - * - * @param \Illuminate\Contracts\Queue\Factory $queue - * @return $this - */ - public function setQueue(QueueContract $queue) - { - $this->queue = $queue; - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Mail/Markdown.php b/vendor/laravel/framework/src/Illuminate/Mail/Markdown.php deleted file mode 100644 index 8faf739e..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/Markdown.php +++ /dev/null @@ -1,189 +0,0 @@ -view = $view; - $this->theme = $options['theme'] ?? 'default'; - $this->loadComponentsFrom($options['paths'] ?? []); - } - - /** - * Render the Markdown template into HTML. - * - * @param string $view - * @param array $data - * @param \TijsVerkoyen\CssToInlineStyles\CssToInlineStyles|null $inliner - * @return \Illuminate\Support\HtmlString - */ - public function render($view, array $data = [], $inliner = null) - { - $this->view->flushFinderCache(); - - $contents = $this->view->replaceNamespace( - 'mail', $this->htmlComponentPaths() - )->make($view, $data)->render(); - - if ($this->view->exists($customTheme = Str::start($this->theme, 'mail.'))) { - $theme = $customTheme; - } else { - $theme = str_contains($this->theme, '::') - ? $this->theme - : 'mail::themes.'.$this->theme; - } - - return new HtmlString(($inliner ?: new CssToInlineStyles)->convert( - $contents, $this->view->make($theme, $data)->render() - )); - } - - /** - * Render the Markdown template into text. - * - * @param string $view - * @param array $data - * @return \Illuminate\Support\HtmlString - */ - public function renderText($view, array $data = []) - { - $this->view->flushFinderCache(); - - $contents = $this->view->replaceNamespace( - 'mail', $this->textComponentPaths() - )->make($view, $data)->render(); - - return new HtmlString( - html_entity_decode(preg_replace("/[\r\n]{2,}/", "\n\n", $contents), ENT_QUOTES, 'UTF-8') - ); - } - - /** - * Parse the given Markdown text into HTML. - * - * @param string $text - * @return \Illuminate\Support\HtmlString - */ - public static function parse($text) - { - $environment = new Environment([ - 'allow_unsafe_links' => false, - ]); - - $environment->addExtension(new CommonMarkCoreExtension); - $environment->addExtension(new TableExtension); - - $converter = new MarkdownConverter($environment); - - return new HtmlString($converter->convert($text)->getContent()); - } - - /** - * Get the HTML component paths. - * - * @return array - */ - public function htmlComponentPaths() - { - return array_map(function ($path) { - return $path.'/html'; - }, $this->componentPaths()); - } - - /** - * Get the text component paths. - * - * @return array - */ - public function textComponentPaths() - { - return array_map(function ($path) { - return $path.'/text'; - }, $this->componentPaths()); - } - - /** - * Get the component paths. - * - * @return array - */ - protected function componentPaths() - { - return array_unique(array_merge($this->componentPaths, [ - __DIR__.'/resources/views', - ])); - } - - /** - * Register new mail component paths. - * - * @param array $paths - * @return void - */ - public function loadComponentsFrom(array $paths = []) - { - $this->componentPaths = $paths; - } - - /** - * Set the default theme to be used. - * - * @param string $theme - * @return $this - */ - public function theme($theme) - { - $this->theme = $theme; - - return $this; - } - - /** - * Get the theme currently being used by the renderer. - * - * @return string - */ - public function getTheme() - { - return $this->theme; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Mail/Message.php b/vendor/laravel/framework/src/Illuminate/Mail/Message.php deleted file mode 100755 index 88e83eee..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/Message.php +++ /dev/null @@ -1,402 +0,0 @@ -message = $message; - } - - /** - * Add a "from" address to the message. - * - * @param string|array $address - * @param string|null $name - * @return $this - */ - public function from($address, $name = null) - { - is_array($address) - ? $this->message->from(...$address) - : $this->message->from(new Address($address, (string) $name)); - - return $this; - } - - /** - * Set the "sender" of the message. - * - * @param string|array $address - * @param string|null $name - * @return $this - */ - public function sender($address, $name = null) - { - is_array($address) - ? $this->message->sender(...$address) - : $this->message->sender(new Address($address, (string) $name)); - - return $this; - } - - /** - * Set the "return path" of the message. - * - * @param string $address - * @return $this - */ - public function returnPath($address) - { - $this->message->returnPath($address); - - return $this; - } - - /** - * Add a recipient to the message. - * - * @param string|array $address - * @param string|null $name - * @param bool $override - * @return $this - */ - public function to($address, $name = null, $override = false) - { - if ($override) { - is_array($address) - ? $this->message->to(...$address) - : $this->message->to(new Address($address, (string) $name)); - - return $this; - } - - return $this->addAddresses($address, $name, 'To'); - } - - /** - * Remove all "to" addresses from the message. - * - * @return $this - */ - public function forgetTo() - { - if ($header = $this->message->getHeaders()->get('To')) { - $this->addAddressDebugHeader('X-To', $this->message->getTo()); - - $header->setAddresses([]); - } - - return $this; - } - - /** - * Add a carbon copy to the message. - * - * @param string|array $address - * @param string|null $name - * @param bool $override - * @return $this - */ - public function cc($address, $name = null, $override = false) - { - if ($override) { - is_array($address) - ? $this->message->cc(...$address) - : $this->message->cc(new Address($address, (string) $name)); - - return $this; - } - - return $this->addAddresses($address, $name, 'Cc'); - } - - /** - * Remove all carbon copy addresses from the message. - * - * @return $this - */ - public function forgetCc() - { - if ($header = $this->message->getHeaders()->get('Cc')) { - $this->addAddressDebugHeader('X-Cc', $this->message->getCC()); - - $header->setAddresses([]); - } - - return $this; - } - - /** - * Add a blind carbon copy to the message. - * - * @param string|array $address - * @param string|null $name - * @param bool $override - * @return $this - */ - public function bcc($address, $name = null, $override = false) - { - if ($override) { - is_array($address) - ? $this->message->bcc(...$address) - : $this->message->bcc(new Address($address, (string) $name)); - - return $this; - } - - return $this->addAddresses($address, $name, 'Bcc'); - } - - /** - * Remove all of the blind carbon copy addresses from the message. - * - * @return $this - */ - public function forgetBcc() - { - if ($header = $this->message->getHeaders()->get('Bcc')) { - $this->addAddressDebugHeader('X-Bcc', $this->message->getBcc()); - - $header->setAddresses([]); - } - - return $this; - } - - /** - * Add a "reply to" address to the message. - * - * @param string|array $address - * @param string|null $name - * @return $this - */ - public function replyTo($address, $name = null) - { - return $this->addAddresses($address, $name, 'ReplyTo'); - } - - /** - * Add a recipient to the message. - * - * @param string|array $address - * @param string $name - * @param string $type - * @return $this - */ - protected function addAddresses($address, $name, $type) - { - if (is_array($address)) { - $type = lcfirst($type); - - $addresses = collect($address)->map(function ($address, $key) { - if (is_string($key) && is_string($address)) { - return new Address($key, $address); - } - - if (is_array($address)) { - return new Address($address['email'] ?? $address['address'], $address['name'] ?? null); - } - - if (is_null($address)) { - return new Address($key); - } - - return $address; - })->all(); - - $this->message->{"{$type}"}(...$addresses); - } else { - $this->message->{"add{$type}"}(new Address($address, (string) $name)); - } - - return $this; - } - - /** - * Add an address debug header for a list of recipients. - * - * @param string $header - * @param \Symfony\Component\Mime\Address[] $addresses - * @return $this - */ - protected function addAddressDebugHeader(string $header, array $addresses) - { - $this->message->getHeaders()->addTextHeader( - $header, - implode(', ', array_map(fn ($a) => $a->toString(), $addresses)), - ); - - return $this; - } - - /** - * Set the subject of the message. - * - * @param string $subject - * @return $this - */ - public function subject($subject) - { - $this->message->subject($subject); - - return $this; - } - - /** - * Set the message priority level. - * - * @param int $level - * @return $this - */ - public function priority($level) - { - $this->message->priority($level); - - return $this; - } - - /** - * Attach a file to the message. - * - * @param string|\Illuminate\Contracts\Mail\Attachable|\Illuminate\Mail\Attachment $file - * @param array $options - * @return $this - */ - public function attach($file, array $options = []) - { - if ($file instanceof Attachable) { - $file = $file->toMailAttachment(); - } - - if ($file instanceof Attachment) { - return $file->attachTo($this); - } - - $this->message->attachFromPath($file, $options['as'] ?? null, $options['mime'] ?? null); - - return $this; - } - - /** - * Attach in-memory data as an attachment. - * - * @param string $data - * @param string $name - * @param array $options - * @return $this - */ - public function attachData($data, $name, array $options = []) - { - $this->message->attach($data, $name, $options['mime'] ?? null); - - return $this; - } - - /** - * Embed a file in the message and get the CID. - * - * @param string|\Illuminate\Contracts\Mail\Attachable|\Illuminate\Mail\Attachment $file - * @return string - */ - public function embed($file) - { - if ($file instanceof Attachable) { - $file = $file->toMailAttachment(); - } - - if ($file instanceof Attachment) { - return $file->attachWith( - function ($path) use ($file) { - $cid = $file->as ?? Str::random(); - - $this->message->embedFromPath($path, $cid, $file->mime); - - return "cid:{$cid}"; - }, - function ($data) use ($file) { - $this->message->embed($data(), $file->as, $file->mime); - - return "cid:{$file->as}"; - } - ); - } - - $cid = Str::random(10); - - $this->message->embedFromPath($file, $cid); - - return "cid:$cid"; - } - - /** - * Embed in-memory data in the message and get the CID. - * - * @param string $data - * @param string $name - * @param string|null $contentType - * @return string - */ - public function embedData($data, $name, $contentType = null) - { - $this->message->embed($data, $name, $contentType); - - return "cid:$name"; - } - - /** - * Get the underlying Symfony Email instance. - * - * @return \Symfony\Component\Mime\Email - */ - public function getSymfonyMessage() - { - return $this->message; - } - - /** - * Dynamically pass missing methods to the Symfony instance. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - return $this->forwardDecoratedCallTo($this->message, $method, $parameters); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Mail/PendingMail.php b/vendor/laravel/framework/src/Illuminate/Mail/PendingMail.php deleted file mode 100644 index 330b6438..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/PendingMail.php +++ /dev/null @@ -1,166 +0,0 @@ -mailer = $mailer; - } - - /** - * Set the locale of the message. - * - * @param string $locale - * @return $this - */ - public function locale($locale) - { - $this->locale = $locale; - - return $this; - } - - /** - * Set the recipients of the message. - * - * @param mixed $users - * @return $this - */ - public function to($users) - { - $this->to = $users; - - if (! $this->locale && $users instanceof HasLocalePreference) { - $this->locale($users->preferredLocale()); - } - - return $this; - } - - /** - * Set the recipients of the message. - * - * @param mixed $users - * @return $this - */ - public function cc($users) - { - $this->cc = $users; - - return $this; - } - - /** - * Set the recipients of the message. - * - * @param mixed $users - * @return $this - */ - public function bcc($users) - { - $this->bcc = $users; - - return $this; - } - - /** - * Send a new mailable message instance. - * - * @param \Illuminate\Contracts\Mail\Mailable $mailable - * @return \Illuminate\Mail\SentMessage|null - */ - public function send(MailableContract $mailable) - { - return $this->mailer->send($this->fill($mailable)); - } - - /** - * Push the given mailable onto the queue. - * - * @param \Illuminate\Contracts\Mail\Mailable $mailable - * @return mixed - */ - public function queue(MailableContract $mailable) - { - return $this->mailer->queue($this->fill($mailable)); - } - - /** - * Deliver the queued message after (n) seconds. - * - * @param \DateTimeInterface|\DateInterval|int $delay - * @param \Illuminate\Contracts\Mail\Mailable $mailable - * @return mixed - */ - public function later($delay, MailableContract $mailable) - { - return $this->mailer->later($delay, $this->fill($mailable)); - } - - /** - * Populate the mailable with the addresses. - * - * @param \Illuminate\Contracts\Mail\Mailable $mailable - * @return \Illuminate\Mail\Mailable - */ - protected function fill(MailableContract $mailable) - { - return tap($mailable->to($this->to) - ->cc($this->cc) - ->bcc($this->bcc), function (MailableContract $mailable) { - if ($this->locale) { - $mailable->locale($this->locale); - } - }); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Mail/SendQueuedMailable.php b/vendor/laravel/framework/src/Illuminate/Mail/SendQueuedMailable.php deleted file mode 100644 index 7f202322..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/SendQueuedMailable.php +++ /dev/null @@ -1,137 +0,0 @@ -mailable = $mailable; - $this->tries = property_exists($mailable, 'tries') ? $mailable->tries : null; - $this->timeout = property_exists($mailable, 'timeout') ? $mailable->timeout : null; - $this->maxExceptions = property_exists($mailable, 'maxExceptions') ? $mailable->maxExceptions : null; - $this->afterCommit = property_exists($mailable, 'afterCommit') ? $mailable->afterCommit : null; - $this->shouldBeEncrypted = $mailable instanceof ShouldBeEncrypted; - } - - /** - * Handle the queued job. - * - * @param \Illuminate\Contracts\Mail\Factory $factory - * @return void - */ - public function handle(MailFactory $factory) - { - $this->mailable->send($factory); - } - - /** - * Get the number of seconds before a released mailable will be available. - * - * @return mixed - */ - public function backoff() - { - if (! method_exists($this->mailable, 'backoff') && ! isset($this->mailable->backoff)) { - return; - } - - return $this->mailable->backoff ?? $this->mailable->backoff(); - } - - /** - * Determine the time at which the job should timeout. - * - * @return \DateTime|null - */ - public function retryUntil() - { - if (! method_exists($this->mailable, 'retryUntil') && ! isset($this->mailable->retryUntil)) { - return; - } - - return $this->mailable->retryUntil ?? $this->mailable->retryUntil(); - } - - /** - * Call the failed method on the mailable instance. - * - * @param \Throwable $e - * @return void - */ - public function failed($e) - { - if (method_exists($this->mailable, 'failed')) { - $this->mailable->failed($e); - } - } - - /** - * Get the display name for the queued job. - * - * @return string - */ - public function displayName() - { - return get_class($this->mailable); - } - - /** - * Prepare the instance for cloning. - * - * @return void - */ - public function __clone() - { - $this->mailable = clone $this->mailable; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Mail/SentMessage.php b/vendor/laravel/framework/src/Illuminate/Mail/SentMessage.php deleted file mode 100644 index cce42dbd..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/SentMessage.php +++ /dev/null @@ -1,54 +0,0 @@ -sentMessage = $sentMessage; - } - - /** - * Get the underlying Symfony Email instance. - * - * @return \Symfony\Component\Mailer\SentMessage - */ - public function getSymfonySentMessage() - { - return $this->sentMessage; - } - - /** - * Dynamically pass missing methods to the Symfony instance. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - return $this->forwardCallTo($this->sentMessage, $method, $parameters); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Mail/Transport/ArrayTransport.php b/vendor/laravel/framework/src/Illuminate/Mail/Transport/ArrayTransport.php deleted file mode 100644 index dc26ed69..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/Transport/ArrayTransport.php +++ /dev/null @@ -1,67 +0,0 @@ -messages = new Collection; - } - - /** - * {@inheritdoc} - */ - public function send(RawMessage $message, Envelope $envelope = null): ?SentMessage - { - return $this->messages[] = new SentMessage($message, $envelope ?? Envelope::create($message)); - } - - /** - * Retrieve the collection of messages. - * - * @return \Illuminate\Support\Collection - */ - public function messages() - { - return $this->messages; - } - - /** - * Clear all of the messages from the local collection. - * - * @return \Illuminate\Support\Collection - */ - public function flush() - { - return $this->messages = new Collection; - } - - /** - * Get the string representation of the transport. - * - * @return string - */ - public function __toString(): string - { - return 'array'; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Mail/Transport/LogTransport.php b/vendor/laravel/framework/src/Illuminate/Mail/Transport/LogTransport.php deleted file mode 100644 index d9ec8ac0..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/Transport/LogTransport.php +++ /dev/null @@ -1,60 +0,0 @@ -logger = $logger; - } - - /** - * {@inheritdoc} - */ - public function send(RawMessage $message, Envelope $envelope = null): ?SentMessage - { - $this->logger->debug($message->toString()); - - return new SentMessage($message, $envelope ?? Envelope::create($message)); - } - - /** - * Get the logger for the LogTransport instance. - * - * @return \Psr\Log\LoggerInterface - */ - public function logger() - { - return $this->logger; - } - - /** - * Get the string representation of the transport. - * - * @return string - */ - public function __toString(): string - { - return 'log'; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Mail/Transport/SesTransport.php b/vendor/laravel/framework/src/Illuminate/Mail/Transport/SesTransport.php deleted file mode 100644 index d6a64da8..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/Transport/SesTransport.php +++ /dev/null @@ -1,131 +0,0 @@ -ses = $ses; - $this->options = $options; - - parent::__construct(); - } - - /** - * {@inheritDoc} - */ - protected function doSend(SentMessage $message): void - { - $options = $this->options; - - if ($message->getOriginalMessage() instanceof Message) { - foreach ($message->getOriginalMessage()->getHeaders()->all() as $header) { - if ($header instanceof MetadataHeader) { - $options['Tags'][] = ['Name' => $header->getKey(), 'Value' => $header->getValue()]; - } - } - } - - try { - $result = $this->ses->sendRawEmail( - array_merge( - $options, [ - 'Source' => $message->getEnvelope()->getSender()->toString(), - 'Destinations' => collect($message->getEnvelope()->getRecipients()) - ->map - ->toString() - ->values() - ->all(), - 'RawMessage' => [ - 'Data' => $message->toString(), - ], - ] - ) - ); - } catch (AwsException $e) { - $reason = $e->getAwsErrorMessage() ?? $e->getMessage(); - - throw new Exception( - sprintf('Request to AWS SES API failed. Reason: %s.', $reason), - is_int($e->getCode()) ? $e->getCode() : 0, - $e - ); - } - - $messageId = $result->get('MessageId'); - - $message->getOriginalMessage()->getHeaders()->addHeader('X-Message-ID', $messageId); - $message->getOriginalMessage()->getHeaders()->addHeader('X-SES-Message-ID', $messageId); - } - - /** - * Get the string representation of the transport. - * - * @return string - */ - public function __toString(): string - { - return 'ses'; - } - - /** - * Get the Amazon SES client for the SesTransport instance. - * - * @return \Aws\Ses\SesClient - */ - public function ses() - { - return $this->ses; - } - - /** - * Get the transmission options being used by the transport. - * - * @return array - */ - public function getOptions() - { - return $this->options; - } - - /** - * Set the transmission options being used by the transport. - * - * @param array $options - * @return array - */ - public function setOptions(array $options) - { - return $this->options = $options; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Mail/composer.json b/vendor/laravel/framework/src/Illuminate/Mail/composer.json deleted file mode 100755 index 20fda047..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/composer.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "illuminate/mail", - "description": "The Illuminate Mail package.", - "license": "MIT", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "require": { - "php": "^8.0.2", - "ext-json": "*", - "illuminate/collections": "^9.0", - "illuminate/container": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0", - "league/commonmark": "^2.2", - "psr/log": "^1.0|^2.0|^3.0", - "symfony/mailer": "^6.0", - "tijsverkoyen/css-to-inline-styles": "^2.2.5" - }, - "autoload": { - "psr-4": { - "Illuminate\\Mail\\": "" - } - }, - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "suggest": { - "aws/aws-sdk-php": "Required to use the SES mail driver (^3.235.5).", - "symfony/http-client": "Required to use the Symfony API mail transports (^6.0).", - "symfony/mailgun-mailer": "Required to enable support for the Mailgun mail transport (^6.0).", - "symfony/postmark-mailer": "Required to enable support for the Postmark mail transport (^6.0)." - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev" -} diff --git a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/button.blade.php b/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/button.blade.php deleted file mode 100644 index 4a9bf7d0..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/button.blade.php +++ /dev/null @@ -1,24 +0,0 @@ -@props([ - 'url', - 'color' => 'primary', - 'align' => 'center', -]) - - - - - diff --git a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/footer.blade.php b/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/footer.blade.php deleted file mode 100644 index 3ff41f89..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/footer.blade.php +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - diff --git a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/header.blade.php b/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/header.blade.php deleted file mode 100644 index 56197f8d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/header.blade.php +++ /dev/null @@ -1,12 +0,0 @@ -@props(['url']) - - - -@if (trim($slot) === 'Laravel') - -@else -{{ $slot }} -@endif - - - diff --git a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/layout.blade.php b/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/layout.blade.php deleted file mode 100644 index c0301be7..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/layout.blade.php +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/message.blade.php b/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/message.blade.php deleted file mode 100644 index f272460d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/message.blade.php +++ /dev/null @@ -1,27 +0,0 @@ - -{{-- Header --}} - - -{{ config('app.name') }} - - - -{{-- Body --}} -{{ $slot }} - -{{-- Subcopy --}} -@isset($subcopy) - - -{{ $subcopy }} - - -@endisset - -{{-- Footer --}} - - -© {{ date('Y') }} {{ config('app.name') }}. @lang('All rights reserved.') - - - diff --git a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/panel.blade.php b/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/panel.blade.php deleted file mode 100644 index 2975a60a..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/panel.blade.php +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - diff --git a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/subcopy.blade.php b/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/subcopy.blade.php deleted file mode 100644 index 790ce6c2..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/subcopy.blade.php +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/table.blade.php b/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/table.blade.php deleted file mode 100644 index a5f3348b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/table.blade.php +++ /dev/null @@ -1,3 +0,0 @@ -
-{{ Illuminate\Mail\Markdown::parse($slot) }} -
diff --git a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/themes/default.css b/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/themes/default.css deleted file mode 100644 index 2483b116..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/themes/default.css +++ /dev/null @@ -1,290 +0,0 @@ -/* Base */ - -body, -body *:not(html):not(style):not(br):not(tr):not(code) { - box-sizing: border-box; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, - 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; - position: relative; -} - -body { - -webkit-text-size-adjust: none; - background-color: #ffffff; - color: #718096; - height: 100%; - line-height: 1.4; - margin: 0; - padding: 0; - width: 100% !important; -} - -p, -ul, -ol, -blockquote { - line-height: 1.4; - text-align: left; -} - -a { - color: #3869d4; -} - -a img { - border: none; -} - -/* Typography */ - -h1 { - color: #3d4852; - font-size: 18px; - font-weight: bold; - margin-top: 0; - text-align: left; -} - -h2 { - font-size: 16px; - font-weight: bold; - margin-top: 0; - text-align: left; -} - -h3 { - font-size: 14px; - font-weight: bold; - margin-top: 0; - text-align: left; -} - -p { - font-size: 16px; - line-height: 1.5em; - margin-top: 0; - text-align: left; -} - -p.sub { - font-size: 12px; -} - -img { - max-width: 100%; -} - -/* Layout */ - -.wrapper { - -premailer-cellpadding: 0; - -premailer-cellspacing: 0; - -premailer-width: 100%; - background-color: #edf2f7; - margin: 0; - padding: 0; - width: 100%; -} - -.content { - -premailer-cellpadding: 0; - -premailer-cellspacing: 0; - -premailer-width: 100%; - margin: 0; - padding: 0; - width: 100%; -} - -/* Header */ - -.header { - padding: 25px 0; - text-align: center; -} - -.header a { - color: #3d4852; - font-size: 19px; - font-weight: bold; - text-decoration: none; -} - -/* Logo */ - -.logo { - height: 75px; - max-height: 75px; - width: 75px; -} - -/* Body */ - -.body { - -premailer-cellpadding: 0; - -premailer-cellspacing: 0; - -premailer-width: 100%; - background-color: #edf2f7; - border-bottom: 1px solid #edf2f7; - border-top: 1px solid #edf2f7; - margin: 0; - padding: 0; - width: 100%; -} - -.inner-body { - -premailer-cellpadding: 0; - -premailer-cellspacing: 0; - -premailer-width: 570px; - background-color: #ffffff; - border-color: #e8e5ef; - border-radius: 2px; - border-width: 1px; - box-shadow: 0 2px 0 rgba(0, 0, 150, 0.025), 2px 4px 0 rgba(0, 0, 150, 0.015); - margin: 0 auto; - padding: 0; - width: 570px; -} - -/* Subcopy */ - -.subcopy { - border-top: 1px solid #e8e5ef; - margin-top: 25px; - padding-top: 25px; -} - -.subcopy p { - font-size: 14px; -} - -/* Footer */ - -.footer { - -premailer-cellpadding: 0; - -premailer-cellspacing: 0; - -premailer-width: 570px; - margin: 0 auto; - padding: 0; - text-align: center; - width: 570px; -} - -.footer p { - color: #b0adc5; - font-size: 12px; - text-align: center; -} - -.footer a { - color: #b0adc5; - text-decoration: underline; -} - -/* Tables */ - -.table table { - -premailer-cellpadding: 0; - -premailer-cellspacing: 0; - -premailer-width: 100%; - margin: 30px auto; - width: 100%; -} - -.table th { - border-bottom: 1px solid #edeff2; - margin: 0; - padding-bottom: 8px; -} - -.table td { - color: #74787e; - font-size: 15px; - line-height: 18px; - margin: 0; - padding: 10px 0; -} - -.content-cell { - max-width: 100vw; - padding: 32px; -} - -/* Buttons */ - -.action { - -premailer-cellpadding: 0; - -premailer-cellspacing: 0; - -premailer-width: 100%; - margin: 30px auto; - padding: 0; - text-align: center; - width: 100%; -} - -.button { - -webkit-text-size-adjust: none; - border-radius: 4px; - color: #fff; - display: inline-block; - overflow: hidden; - text-decoration: none; -} - -.button-blue, -.button-primary { - background-color: #2d3748; - border-bottom: 8px solid #2d3748; - border-left: 18px solid #2d3748; - border-right: 18px solid #2d3748; - border-top: 8px solid #2d3748; -} - -.button-green, -.button-success { - background-color: #48bb78; - border-bottom: 8px solid #48bb78; - border-left: 18px solid #48bb78; - border-right: 18px solid #48bb78; - border-top: 8px solid #48bb78; -} - -.button-red, -.button-error { - background-color: #e53e3e; - border-bottom: 8px solid #e53e3e; - border-left: 18px solid #e53e3e; - border-right: 18px solid #e53e3e; - border-top: 8px solid #e53e3e; -} - -/* Panels */ - -.panel { - border-left: #2d3748 solid 4px; - margin: 21px 0; -} - -.panel-content { - background-color: #edf2f7; - color: #718096; - padding: 16px; -} - -.panel-content p { - color: #718096; -} - -.panel-item { - padding: 0; -} - -.panel-item p:last-of-type { - margin-bottom: 0; - padding-bottom: 0; -} - -/* Utilities */ - -.break-all { - word-break: break-all; -} diff --git a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/text/button.blade.php b/vendor/laravel/framework/src/Illuminate/Mail/resources/views/text/button.blade.php deleted file mode 100644 index 97444ebd..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/text/button.blade.php +++ /dev/null @@ -1 +0,0 @@ -{{ $slot }}: {{ $url }} diff --git a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/text/footer.blade.php b/vendor/laravel/framework/src/Illuminate/Mail/resources/views/text/footer.blade.php deleted file mode 100644 index 3338f620..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/text/footer.blade.php +++ /dev/null @@ -1 +0,0 @@ -{{ $slot }} diff --git a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/text/header.blade.php b/vendor/laravel/framework/src/Illuminate/Mail/resources/views/text/header.blade.php deleted file mode 100644 index aaa3e575..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/text/header.blade.php +++ /dev/null @@ -1 +0,0 @@ -[{{ $slot }}]({{ $url }}) diff --git a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/text/layout.blade.php b/vendor/laravel/framework/src/Illuminate/Mail/resources/views/text/layout.blade.php deleted file mode 100644 index 9378baa0..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/text/layout.blade.php +++ /dev/null @@ -1,9 +0,0 @@ -{!! strip_tags($header) !!} - -{!! strip_tags($slot) !!} -@isset($subcopy) - -{!! strip_tags($subcopy) !!} -@endisset - -{!! strip_tags($footer) !!} diff --git a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/text/message.blade.php b/vendor/laravel/framework/src/Illuminate/Mail/resources/views/text/message.blade.php deleted file mode 100644 index 80bce211..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/text/message.blade.php +++ /dev/null @@ -1,27 +0,0 @@ - - {{-- Header --}} - - - {{ config('app.name') }} - - - - {{-- Body --}} - {{ $slot }} - - {{-- Subcopy --}} - @isset($subcopy) - - - {{ $subcopy }} - - - @endisset - - {{-- Footer --}} - - - © {{ date('Y') }} {{ config('app.name') }}. @lang('All rights reserved.') - - - diff --git a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/text/panel.blade.php b/vendor/laravel/framework/src/Illuminate/Mail/resources/views/text/panel.blade.php deleted file mode 100644 index 3338f620..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/text/panel.blade.php +++ /dev/null @@ -1 +0,0 @@ -{{ $slot }} diff --git a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/text/subcopy.blade.php b/vendor/laravel/framework/src/Illuminate/Mail/resources/views/text/subcopy.blade.php deleted file mode 100644 index 3338f620..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/text/subcopy.blade.php +++ /dev/null @@ -1 +0,0 @@ -{{ $slot }} diff --git a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/text/table.blade.php b/vendor/laravel/framework/src/Illuminate/Mail/resources/views/text/table.blade.php deleted file mode 100644 index 3338f620..00000000 --- a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/text/table.blade.php +++ /dev/null @@ -1 +0,0 @@ -{{ $slot }} diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/Action.php b/vendor/laravel/framework/src/Illuminate/Notifications/Action.php deleted file mode 100644 index 071db2d9..00000000 --- a/vendor/laravel/framework/src/Illuminate/Notifications/Action.php +++ /dev/null @@ -1,33 +0,0 @@ -url = $url; - $this->text = $text; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/AnonymousNotifiable.php b/vendor/laravel/framework/src/Illuminate/Notifications/AnonymousNotifiable.php deleted file mode 100644 index aa4d7bbc..00000000 --- a/vendor/laravel/framework/src/Illuminate/Notifications/AnonymousNotifiable.php +++ /dev/null @@ -1,79 +0,0 @@ -routes[$channel] = $route; - - return $this; - } - - /** - * Send the given notification. - * - * @param mixed $notification - * @return void - */ - public function notify($notification) - { - app(Dispatcher::class)->send($this, $notification); - } - - /** - * Send the given notification immediately. - * - * @param mixed $notification - * @return void - */ - public function notifyNow($notification) - { - app(Dispatcher::class)->sendNow($this, $notification); - } - - /** - * Get the notification routing information for the given driver. - * - * @param string $driver - * @return mixed - */ - public function routeNotificationFor($driver) - { - return $this->routes[$driver] ?? null; - } - - /** - * Get the value of the notifiable's primary key. - * - * @return mixed - */ - public function getKey() - { - // - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/ChannelManager.php b/vendor/laravel/framework/src/Illuminate/Notifications/ChannelManager.php deleted file mode 100644 index 8eb9c251..00000000 --- a/vendor/laravel/framework/src/Illuminate/Notifications/ChannelManager.php +++ /dev/null @@ -1,162 +0,0 @@ -container->make(Bus::class), $this->container->make(Dispatcher::class), $this->locale) - )->send($notifiables, $notification); - } - - /** - * Send the given notification immediately. - * - * @param \Illuminate\Support\Collection|array|mixed $notifiables - * @param mixed $notification - * @param array|null $channels - * @return void - */ - public function sendNow($notifiables, $notification, array $channels = null) - { - (new NotificationSender( - $this, $this->container->make(Bus::class), $this->container->make(Dispatcher::class), $this->locale) - )->sendNow($notifiables, $notification, $channels); - } - - /** - * Get a channel instance. - * - * @param string|null $name - * @return mixed - */ - public function channel($name = null) - { - return $this->driver($name); - } - - /** - * Create an instance of the database driver. - * - * @return \Illuminate\Notifications\Channels\DatabaseChannel - */ - protected function createDatabaseDriver() - { - return $this->container->make(Channels\DatabaseChannel::class); - } - - /** - * Create an instance of the broadcast driver. - * - * @return \Illuminate\Notifications\Channels\BroadcastChannel - */ - protected function createBroadcastDriver() - { - return $this->container->make(Channels\BroadcastChannel::class); - } - - /** - * Create an instance of the mail driver. - * - * @return \Illuminate\Notifications\Channels\MailChannel - */ - protected function createMailDriver() - { - return $this->container->make(Channels\MailChannel::class); - } - - /** - * Create a new driver instance. - * - * @param string $driver - * @return mixed - * - * @throws \InvalidArgumentException - */ - protected function createDriver($driver) - { - try { - return parent::createDriver($driver); - } catch (InvalidArgumentException $e) { - if (class_exists($driver)) { - return $this->container->make($driver); - } - - throw $e; - } - } - - /** - * Get the default channel driver name. - * - * @return string - */ - public function getDefaultDriver() - { - return $this->defaultChannel; - } - - /** - * Get the default channel driver name. - * - * @return string - */ - public function deliversVia() - { - return $this->getDefaultDriver(); - } - - /** - * Set the default channel driver name. - * - * @param string $channel - * @return void - */ - public function deliverVia($channel) - { - $this->defaultChannel = $channel; - } - - /** - * Set the locale of notifications. - * - * @param string $locale - * @return $this - */ - public function locale($locale) - { - $this->locale = $locale; - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/Channels/BroadcastChannel.php b/vendor/laravel/framework/src/Illuminate/Notifications/Channels/BroadcastChannel.php deleted file mode 100644 index 1389f49c..00000000 --- a/vendor/laravel/framework/src/Illuminate/Notifications/Channels/BroadcastChannel.php +++ /dev/null @@ -1,75 +0,0 @@ -events = $events; - } - - /** - * Send the given notification. - * - * @param mixed $notifiable - * @param \Illuminate\Notifications\Notification $notification - * @return array|null - */ - public function send($notifiable, Notification $notification) - { - $message = $this->getData($notifiable, $notification); - - $event = new BroadcastNotificationCreated( - $notifiable, $notification, is_array($message) ? $message : $message->data - ); - - if ($message instanceof BroadcastMessage) { - $event->onConnection($message->connection) - ->onQueue($message->queue); - } - - return $this->events->dispatch($event); - } - - /** - * Get the data for the notification. - * - * @param mixed $notifiable - * @param \Illuminate\Notifications\Notification $notification - * @return mixed - * - * @throws \RuntimeException - */ - protected function getData($notifiable, Notification $notification) - { - if (method_exists($notification, 'toBroadcast')) { - return $notification->toBroadcast($notifiable); - } - - if (method_exists($notification, 'toArray')) { - return $notification->toArray($notifiable); - } - - throw new RuntimeException('Notification is missing toArray method.'); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/Channels/DatabaseChannel.php b/vendor/laravel/framework/src/Illuminate/Notifications/Channels/DatabaseChannel.php deleted file mode 100644 index 8b3167b0..00000000 --- a/vendor/laravel/framework/src/Illuminate/Notifications/Channels/DatabaseChannel.php +++ /dev/null @@ -1,65 +0,0 @@ -routeNotificationFor('database', $notification)->create( - $this->buildPayload($notifiable, $notification) - ); - } - - /** - * Build an array payload for the DatabaseNotification Model. - * - * @param mixed $notifiable - * @param \Illuminate\Notifications\Notification $notification - * @return array - */ - protected function buildPayload($notifiable, Notification $notification) - { - return [ - 'id' => $notification->id, - 'type' => method_exists($notification, 'databaseType') - ? $notification->databaseType($notifiable) - : get_class($notification), - 'data' => $this->getData($notifiable, $notification), - 'read_at' => null, - ]; - } - - /** - * Get the data for the notification. - * - * @param mixed $notifiable - * @param \Illuminate\Notifications\Notification $notification - * @return array - * - * @throws \RuntimeException - */ - protected function getData($notifiable, Notification $notification) - { - if (method_exists($notification, 'toDatabase')) { - return is_array($data = $notification->toDatabase($notifiable)) - ? $data : $data->data; - } - - if (method_exists($notification, 'toArray')) { - return $notification->toArray($notifiable); - } - - throw new RuntimeException('Notification is missing toDatabase / toArray method.'); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/Channels/MailChannel.php b/vendor/laravel/framework/src/Illuminate/Notifications/Channels/MailChannel.php deleted file mode 100644 index fd3a3cc2..00000000 --- a/vendor/laravel/framework/src/Illuminate/Notifications/Channels/MailChannel.php +++ /dev/null @@ -1,266 +0,0 @@ -mailer = $mailer; - $this->markdown = $markdown; - } - - /** - * Send the given notification. - * - * @param mixed $notifiable - * @param \Illuminate\Notifications\Notification $notification - * @return void - */ - public function send($notifiable, Notification $notification) - { - $message = $notification->toMail($notifiable); - - if (! $notifiable->routeNotificationFor('mail', $notification) && - ! $message instanceof Mailable) { - return; - } - - if ($message instanceof Mailable) { - return $message->send($this->mailer); - } - - $this->mailer->mailer($message->mailer ?? null)->send( - $this->buildView($message), - array_merge($message->data(), $this->additionalMessageData($notification)), - $this->messageBuilder($notifiable, $notification, $message) - ); - } - - /** - * Get the mailer Closure for the message. - * - * @param mixed $notifiable - * @param \Illuminate\Notifications\Notification $notification - * @param \Illuminate\Notifications\Messages\MailMessage $message - * @return \Closure - */ - protected function messageBuilder($notifiable, $notification, $message) - { - return function ($mailMessage) use ($notifiable, $notification, $message) { - $this->buildMessage($mailMessage, $notifiable, $notification, $message); - }; - } - - /** - * Build the notification's view. - * - * @param \Illuminate\Notifications\Messages\MailMessage $message - * @return string|array - */ - protected function buildView($message) - { - if ($message->view) { - return $message->view; - } - - if (property_exists($message, 'theme') && ! is_null($message->theme)) { - $this->markdown->theme($message->theme); - } - - return [ - 'html' => $this->markdown->render($message->markdown, $message->data()), - 'text' => $this->markdown->renderText($message->markdown, $message->data()), - ]; - } - - /** - * Get additional meta-data to pass along with the view data. - * - * @param \Illuminate\Notifications\Notification $notification - * @return array - */ - protected function additionalMessageData($notification) - { - return [ - '__laravel_notification_id' => $notification->id, - '__laravel_notification' => get_class($notification), - '__laravel_notification_queued' => in_array( - ShouldQueue::class, - class_implements($notification) - ), - ]; - } - - /** - * Build the mail message. - * - * @param \Illuminate\Mail\Message $mailMessage - * @param mixed $notifiable - * @param \Illuminate\Notifications\Notification $notification - * @param \Illuminate\Notifications\Messages\MailMessage $message - * @return void - */ - protected function buildMessage($mailMessage, $notifiable, $notification, $message) - { - $this->addressMessage($mailMessage, $notifiable, $notification, $message); - - $mailMessage->subject($message->subject ?: Str::title( - Str::snake(class_basename($notification), ' ') - )); - - $this->addAttachments($mailMessage, $message); - - if (! is_null($message->priority)) { - $mailMessage->priority($message->priority); - } - - if ($message->tags) { - foreach ($message->tags as $tag) { - $mailMessage->getHeaders()->add(new TagHeader($tag)); - } - } - - if ($message->metadata) { - foreach ($message->metadata as $key => $value) { - $mailMessage->getHeaders()->add(new MetadataHeader($key, $value)); - } - } - - $this->runCallbacks($mailMessage, $message); - } - - /** - * Address the mail message. - * - * @param \Illuminate\Mail\Message $mailMessage - * @param mixed $notifiable - * @param \Illuminate\Notifications\Notification $notification - * @param \Illuminate\Notifications\Messages\MailMessage $message - * @return void - */ - protected function addressMessage($mailMessage, $notifiable, $notification, $message) - { - $this->addSender($mailMessage, $message); - - $mailMessage->to($this->getRecipients($notifiable, $notification, $message)); - - if (! empty($message->cc)) { - foreach ($message->cc as $cc) { - $mailMessage->cc($cc[0], Arr::get($cc, 1)); - } - } - - if (! empty($message->bcc)) { - foreach ($message->bcc as $bcc) { - $mailMessage->bcc($bcc[0], Arr::get($bcc, 1)); - } - } - } - - /** - * Add the "from" and "reply to" addresses to the message. - * - * @param \Illuminate\Mail\Message $mailMessage - * @param \Illuminate\Notifications\Messages\MailMessage $message - * @return void - */ - protected function addSender($mailMessage, $message) - { - if (! empty($message->from)) { - $mailMessage->from($message->from[0], Arr::get($message->from, 1)); - } - - if (! empty($message->replyTo)) { - foreach ($message->replyTo as $replyTo) { - $mailMessage->replyTo($replyTo[0], Arr::get($replyTo, 1)); - } - } - } - - /** - * Get the recipients of the given message. - * - * @param mixed $notifiable - * @param \Illuminate\Notifications\Notification $notification - * @param \Illuminate\Notifications\Messages\MailMessage $message - * @return mixed - */ - protected function getRecipients($notifiable, $notification, $message) - { - if (is_string($recipients = $notifiable->routeNotificationFor('mail', $notification))) { - $recipients = [$recipients]; - } - - return collect($recipients)->mapWithKeys(function ($recipient, $email) { - return is_numeric($email) - ? [$email => (is_string($recipient) ? $recipient : $recipient->email)] - : [$email => $recipient]; - })->all(); - } - - /** - * Add the attachments to the message. - * - * @param \Illuminate\Mail\Message $mailMessage - * @param \Illuminate\Notifications\Messages\MailMessage $message - * @return void - */ - protected function addAttachments($mailMessage, $message) - { - foreach ($message->attachments as $attachment) { - $mailMessage->attach($attachment['file'], $attachment['options']); - } - - foreach ($message->rawAttachments as $attachment) { - $mailMessage->attachData($attachment['data'], $attachment['name'], $attachment['options']); - } - } - - /** - * Run the callbacks for the message. - * - * @param \Illuminate\Mail\Message $mailMessage - * @param \Illuminate\Notifications\Messages\MailMessage $message - * @return $this - */ - protected function runCallbacks($mailMessage, $message) - { - foreach ($message->callbacks as $callback) { - $callback($mailMessage->getSymfonyMessage()); - } - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/Console/NotificationTableCommand.php b/vendor/laravel/framework/src/Illuminate/Notifications/Console/NotificationTableCommand.php deleted file mode 100644 index a0161ce6..00000000 --- a/vendor/laravel/framework/src/Illuminate/Notifications/Console/NotificationTableCommand.php +++ /dev/null @@ -1,94 +0,0 @@ -files = $files; - $this->composer = $composer; - } - - /** - * Execute the console command. - * - * @return void - */ - public function handle() - { - $fullPath = $this->createBaseMigration(); - - $this->files->put($fullPath, $this->files->get(__DIR__.'/stubs/notifications.stub')); - - $this->components->info('Migration created successfully.'); - - $this->composer->dumpAutoloads(); - } - - /** - * Create a base migration file for the notifications. - * - * @return string - */ - protected function createBaseMigration() - { - $name = 'create_notifications_table'; - - $path = $this->laravel->databasePath().'/migrations'; - - return $this->laravel['migration.creator']->create($name, $path); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/Console/stubs/notifications.stub b/vendor/laravel/framework/src/Illuminate/Notifications/Console/stubs/notifications.stub deleted file mode 100644 index 4357c9ef..00000000 --- a/vendor/laravel/framework/src/Illuminate/Notifications/Console/stubs/notifications.stub +++ /dev/null @@ -1,35 +0,0 @@ -uuid('id')->primary(); - $table->string('type'); - $table->morphs('notifiable'); - $table->text('data'); - $table->timestamp('read_at')->nullable(); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('notifications'); - } -}; diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/DatabaseNotification.php b/vendor/laravel/framework/src/Illuminate/Notifications/DatabaseNotification.php deleted file mode 100644 index 14bc9d65..00000000 --- a/vendor/laravel/framework/src/Illuminate/Notifications/DatabaseNotification.php +++ /dev/null @@ -1,134 +0,0 @@ - 'array', - 'read_at' => 'datetime', - ]; - - /** - * Get the notifiable entity that the notification belongs to. - * - * @return \Illuminate\Database\Eloquent\Relations\MorphTo - */ - public function notifiable() - { - return $this->morphTo(); - } - - /** - * Mark the notification as read. - * - * @return void - */ - public function markAsRead() - { - if (is_null($this->read_at)) { - $this->forceFill(['read_at' => $this->freshTimestamp()])->save(); - } - } - - /** - * Mark the notification as unread. - * - * @return void - */ - public function markAsUnread() - { - if (! is_null($this->read_at)) { - $this->forceFill(['read_at' => null])->save(); - } - } - - /** - * Determine if a notification has been read. - * - * @return bool - */ - public function read() - { - return $this->read_at !== null; - } - - /** - * Determine if a notification has not been read. - * - * @return bool - */ - public function unread() - { - return $this->read_at === null; - } - - /** - * Scope a query to only include read notifications. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @return \Illuminate\Database\Eloquent\Builder - */ - public function scopeRead(Builder $query) - { - return $query->whereNotNull('read_at'); - } - - /** - * Scope a query to only include unread notifications. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @return \Illuminate\Database\Eloquent\Builder - */ - public function scopeUnread(Builder $query) - { - return $query->whereNull('read_at'); - } - - /** - * Create a new database notification collection instance. - * - * @param array $models - * @return \Illuminate\Notifications\DatabaseNotificationCollection - */ - public function newCollection(array $models = []) - { - return new DatabaseNotificationCollection($models); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/DatabaseNotificationCollection.php b/vendor/laravel/framework/src/Illuminate/Notifications/DatabaseNotificationCollection.php deleted file mode 100644 index 05924ec6..00000000 --- a/vendor/laravel/framework/src/Illuminate/Notifications/DatabaseNotificationCollection.php +++ /dev/null @@ -1,28 +0,0 @@ -each->markAsRead(); - } - - /** - * Mark all notifications as unread. - * - * @return void - */ - public function markAsUnread() - { - $this->each->markAsUnread(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/Events/BroadcastNotificationCreated.php b/vendor/laravel/framework/src/Illuminate/Notifications/Events/BroadcastNotificationCreated.php deleted file mode 100644 index 39530879..00000000 --- a/vendor/laravel/framework/src/Illuminate/Notifications/Events/BroadcastNotificationCreated.php +++ /dev/null @@ -1,123 +0,0 @@ -data = $data; - $this->notifiable = $notifiable; - $this->notification = $notification; - } - - /** - * Get the channels the event should broadcast on. - * - * @return array - */ - public function broadcastOn() - { - if ($this->notifiable instanceof AnonymousNotifiable && - $this->notifiable->routeNotificationFor('broadcast')) { - $channels = Arr::wrap($this->notifiable->routeNotificationFor('broadcast')); - } else { - $channels = $this->notification->broadcastOn(); - } - - if (! empty($channels)) { - return $channels; - } - - if (is_string($channels = $this->channelName())) { - return [new PrivateChannel($channels)]; - } - - return collect($channels)->map(function ($channel) { - return new PrivateChannel($channel); - })->all(); - } - - /** - * Get the broadcast channel name for the event. - * - * @return array|string - */ - protected function channelName() - { - if (method_exists($this->notifiable, 'receivesBroadcastNotificationsOn')) { - return $this->notifiable->receivesBroadcastNotificationsOn($this->notification); - } - - $class = str_replace('\\', '.', get_class($this->notifiable)); - - return $class.'.'.$this->notifiable->getKey(); - } - - /** - * Get the data that should be sent with the broadcasted event. - * - * @return array - */ - public function broadcastWith() - { - if (method_exists($this->notification, 'broadcastWith')) { - return $this->notification->broadcastWith(); - } - - return array_merge($this->data, [ - 'id' => $this->notification->id, - 'type' => $this->broadcastType(), - ]); - } - - /** - * Get the type of the notification being broadcast. - * - * @return string - */ - public function broadcastType() - { - return method_exists($this->notification, 'broadcastType') - ? $this->notification->broadcastType() - : get_class($this->notification); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/Events/NotificationFailed.php b/vendor/laravel/framework/src/Illuminate/Notifications/Events/NotificationFailed.php deleted file mode 100644 index b69e1c54..00000000 --- a/vendor/laravel/framework/src/Illuminate/Notifications/Events/NotificationFailed.php +++ /dev/null @@ -1,56 +0,0 @@ -data = $data; - $this->channel = $channel; - $this->notifiable = $notifiable; - $this->notification = $notification; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/Events/NotificationSending.php b/vendor/laravel/framework/src/Illuminate/Notifications/Events/NotificationSending.php deleted file mode 100644 index 6efd1d06..00000000 --- a/vendor/laravel/framework/src/Illuminate/Notifications/Events/NotificationSending.php +++ /dev/null @@ -1,47 +0,0 @@ -channel = $channel; - $this->notifiable = $notifiable; - $this->notification = $notification; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/Events/NotificationSent.php b/vendor/laravel/framework/src/Illuminate/Notifications/Events/NotificationSent.php deleted file mode 100644 index 4f090691..00000000 --- a/vendor/laravel/framework/src/Illuminate/Notifications/Events/NotificationSent.php +++ /dev/null @@ -1,56 +0,0 @@ -channel = $channel; - $this->response = $response; - $this->notifiable = $notifiable; - $this->notification = $notification; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/HasDatabaseNotifications.php b/vendor/laravel/framework/src/Illuminate/Notifications/HasDatabaseNotifications.php deleted file mode 100644 index 162d16cb..00000000 --- a/vendor/laravel/framework/src/Illuminate/Notifications/HasDatabaseNotifications.php +++ /dev/null @@ -1,36 +0,0 @@ -morphMany(DatabaseNotification::class, 'notifiable')->latest(); - } - - /** - * Get the entity's read notifications. - * - * @return \Illuminate\Database\Query\Builder - */ - public function readNotifications() - { - return $this->notifications()->read(); - } - - /** - * Get the entity's unread notifications. - * - * @return \Illuminate\Database\Query\Builder - */ - public function unreadNotifications() - { - return $this->notifications()->unread(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/LICENSE.md b/vendor/laravel/framework/src/Illuminate/Notifications/LICENSE.md deleted file mode 100644 index 79810c84..00000000 --- a/vendor/laravel/framework/src/Illuminate/Notifications/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Taylor Otwell - -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/laravel/framework/src/Illuminate/Notifications/Messages/BroadcastMessage.php b/vendor/laravel/framework/src/Illuminate/Notifications/Messages/BroadcastMessage.php deleted file mode 100644 index 9884a8fb..00000000 --- a/vendor/laravel/framework/src/Illuminate/Notifications/Messages/BroadcastMessage.php +++ /dev/null @@ -1,41 +0,0 @@ -data = $data; - } - - /** - * Set the message data. - * - * @param array $data - * @return $this - */ - public function data($data) - { - $this->data = $data; - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/Messages/DatabaseMessage.php b/vendor/laravel/framework/src/Illuminate/Notifications/Messages/DatabaseMessage.php deleted file mode 100644 index 55707a7c..00000000 --- a/vendor/laravel/framework/src/Illuminate/Notifications/Messages/DatabaseMessage.php +++ /dev/null @@ -1,24 +0,0 @@ -data = $data; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/Messages/MailMessage.php b/vendor/laravel/framework/src/Illuminate/Notifications/Messages/MailMessage.php deleted file mode 100644 index d696c8a8..00000000 --- a/vendor/laravel/framework/src/Illuminate/Notifications/Messages/MailMessage.php +++ /dev/null @@ -1,387 +0,0 @@ -view = $view; - $this->viewData = $data; - - $this->markdown = null; - - return $this; - } - - /** - * Set the Markdown template for the notification. - * - * @param string $view - * @param array $data - * @return $this - */ - public function markdown($view, array $data = []) - { - $this->markdown = $view; - $this->viewData = $data; - - $this->view = null; - - return $this; - } - - /** - * Set the default markdown template. - * - * @param string $template - * @return $this - */ - public function template($template) - { - $this->markdown = $template; - - return $this; - } - - /** - * Set the theme to use with the Markdown template. - * - * @param string $theme - * @return $this - */ - public function theme($theme) - { - $this->theme = $theme; - - return $this; - } - - /** - * Set the from address for the mail message. - * - * @param string $address - * @param string|null $name - * @return $this - */ - public function from($address, $name = null) - { - $this->from = [$address, $name]; - - return $this; - } - - /** - * Set the "reply to" address of the message. - * - * @param array|string $address - * @param string|null $name - * @return $this - */ - public function replyTo($address, $name = null) - { - if ($this->arrayOfAddresses($address)) { - $this->replyTo += $this->parseAddresses($address); - } else { - $this->replyTo[] = [$address, $name]; - } - - return $this; - } - - /** - * Set the cc address for the mail message. - * - * @param array|string $address - * @param string|null $name - * @return $this - */ - public function cc($address, $name = null) - { - if ($this->arrayOfAddresses($address)) { - $this->cc += $this->parseAddresses($address); - } else { - $this->cc[] = [$address, $name]; - } - - return $this; - } - - /** - * Set the bcc address for the mail message. - * - * @param array|string $address - * @param string|null $name - * @return $this - */ - public function bcc($address, $name = null) - { - if ($this->arrayOfAddresses($address)) { - $this->bcc += $this->parseAddresses($address); - } else { - $this->bcc[] = [$address, $name]; - } - - return $this; - } - - /** - * Attach a file to the message. - * - * @param string|\Illuminate\Contracts\Mail\Attachable|\Illuminate\Mail\Attachment $file - * @param array $options - * @return $this - */ - public function attach($file, array $options = []) - { - if ($file instanceof Attachable) { - $file = $file->toMailAttachment(); - } - - if ($file instanceof Attachment) { - return $file->attachTo($this); - } - - $this->attachments[] = compact('file', 'options'); - - return $this; - } - - /** - * Attach in-memory data as an attachment. - * - * @param string $data - * @param string $name - * @param array $options - * @return $this - */ - public function attachData($data, $name, array $options = []) - { - $this->rawAttachments[] = compact('data', 'name', 'options'); - - return $this; - } - - /** - * Add a tag header to the message when supported by the underlying transport. - * - * @param string $value - * @return $this - */ - public function tag($value) - { - array_push($this->tags, $value); - - return $this; - } - - /** - * Add a metadata header to the message when supported by the underlying transport. - * - * @param string $key - * @param string $value - * @return $this - */ - public function metadata($key, $value) - { - $this->metadata[$key] = $value; - - return $this; - } - - /** - * Set the priority of this message. - * - * The value is an integer where 1 is the highest priority and 5 is the lowest. - * - * @param int $level - * @return $this - */ - public function priority($level) - { - $this->priority = $level; - - return $this; - } - - /** - * Get the data array for the mail message. - * - * @return array - */ - public function data() - { - return array_merge($this->toArray(), $this->viewData); - } - - /** - * Parse the multi-address array into the necessary format. - * - * @param array $value - * @return array - */ - protected function parseAddresses($value) - { - return collect($value)->map(function ($address, $name) { - return [$address, is_numeric($name) ? null : $name]; - })->values()->all(); - } - - /** - * Determine if the given "address" is actually an array of addresses. - * - * @param mixed $address - * @return bool - */ - protected function arrayOfAddresses($address) - { - return is_iterable($address) || $address instanceof Arrayable; - } - - /** - * Render the mail notification message into an HTML string. - * - * @return \Illuminate\Support\HtmlString - */ - public function render() - { - if (isset($this->view)) { - return Container::getInstance()->make('mailer')->render( - $this->view, $this->data() - ); - } - - $markdown = Container::getInstance()->make(Markdown::class); - - return $markdown->theme($this->theme ?: $markdown->getTheme()) - ->render($this->markdown, $this->data()); - } - - /** - * Register a callback to be called with the Symfony message instance. - * - * @param callable $callback - * @return $this - */ - public function withSymfonyMessage($callback) - { - $this->callbacks[] = $callback; - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/Messages/SimpleMessage.php b/vendor/laravel/framework/src/Illuminate/Notifications/Messages/SimpleMessage.php deleted file mode 100644 index cb6d743a..00000000 --- a/vendor/laravel/framework/src/Illuminate/Notifications/Messages/SimpleMessage.php +++ /dev/null @@ -1,292 +0,0 @@ -level = 'success'; - - return $this; - } - - /** - * Indicate that the notification gives information about an error. - * - * @return $this - */ - public function error() - { - $this->level = 'error'; - - return $this; - } - - /** - * Set the "level" of the notification (success, error, etc.). - * - * @param string $level - * @return $this - */ - public function level($level) - { - $this->level = $level; - - return $this; - } - - /** - * Set the subject of the notification. - * - * @param string $subject - * @return $this - */ - public function subject($subject) - { - $this->subject = $subject; - - return $this; - } - - /** - * Set the greeting of the notification. - * - * @param string $greeting - * @return $this - */ - public function greeting($greeting) - { - $this->greeting = $greeting; - - return $this; - } - - /** - * Set the salutation of the notification. - * - * @param string $salutation - * @return $this - */ - public function salutation($salutation) - { - $this->salutation = $salutation; - - return $this; - } - - /** - * Add a line of text to the notification. - * - * @param mixed $line - * @return $this - */ - public function line($line) - { - return $this->with($line); - } - - /** - * Add a line of text to the notification if the given condition is true. - * - * @param bool $boolean - * @param mixed $line - * @return $this - */ - public function lineIf($boolean, $line) - { - if ($boolean) { - return $this->line($line); - } - - return $this; - } - - /** - * Add lines of text to the notification. - * - * @param iterable $lines - * @return $this - */ - public function lines($lines) - { - foreach ($lines as $line) { - $this->line($line); - } - - return $this; - } - - /** - * Add lines of text to the notification if the given condition is true. - * - * @param bool $boolean - * @param iterable $lines - * @return $this - */ - public function linesIf($boolean, $lines) - { - if ($boolean) { - return $this->lines($lines); - } - - return $this; - } - - /** - * Add a line of text to the notification. - * - * @param mixed $line - * @return $this - */ - public function with($line) - { - if ($line instanceof Action) { - $this->action($line->text, $line->url); - } elseif (! $this->actionText) { - $this->introLines[] = $this->formatLine($line); - } else { - $this->outroLines[] = $this->formatLine($line); - } - - return $this; - } - - /** - * Format the given line of text. - * - * @param \Illuminate\Contracts\Support\Htmlable|string|array $line - * @return \Illuminate\Contracts\Support\Htmlable|string - */ - protected function formatLine($line) - { - if ($line instanceof Htmlable) { - return $line; - } - - if (is_array($line)) { - return implode(' ', array_map('trim', $line)); - } - - return trim(implode(' ', array_map('trim', preg_split('/\\r\\n|\\r|\\n/', $line ?? '')))); - } - - /** - * Configure the "call to action" button. - * - * @param string $text - * @param string $url - * @return $this - */ - public function action($text, $url) - { - $this->actionText = $text; - $this->actionUrl = $url; - - return $this; - } - - /** - * Set the name of the mailer that should send the notification. - * - * @param string $mailer - * @return $this - */ - public function mailer($mailer) - { - $this->mailer = $mailer; - - return $this; - } - - /** - * Get an array representation of the message. - * - * @return array - */ - public function toArray() - { - return [ - 'level' => $this->level, - 'subject' => $this->subject, - 'greeting' => $this->greeting, - 'salutation' => $this->salutation, - 'introLines' => $this->introLines, - 'outroLines' => $this->outroLines, - 'actionText' => $this->actionText, - 'actionUrl' => $this->actionUrl, - 'displayableActionUrl' => str_replace(['mailto:', 'tel:'], '', $this->actionUrl ?? ''), - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/Notifiable.php b/vendor/laravel/framework/src/Illuminate/Notifications/Notifiable.php deleted file mode 100644 index 82381e1e..00000000 --- a/vendor/laravel/framework/src/Illuminate/Notifications/Notifiable.php +++ /dev/null @@ -1,8 +0,0 @@ -locale = $locale; - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/NotificationSender.php b/vendor/laravel/framework/src/Illuminate/Notifications/NotificationSender.php deleted file mode 100644 index 698d19dc..00000000 --- a/vendor/laravel/framework/src/Illuminate/Notifications/NotificationSender.php +++ /dev/null @@ -1,255 +0,0 @@ -bus = $bus; - $this->events = $events; - $this->locale = $locale; - $this->manager = $manager; - } - - /** - * Send the given notification to the given notifiable entities. - * - * @param \Illuminate\Support\Collection|array|mixed $notifiables - * @param mixed $notification - * @return void - */ - public function send($notifiables, $notification) - { - $notifiables = $this->formatNotifiables($notifiables); - - if ($notification instanceof ShouldQueue) { - return $this->queueNotification($notifiables, $notification); - } - - $this->sendNow($notifiables, $notification); - } - - /** - * Send the given notification immediately. - * - * @param \Illuminate\Support\Collection|array|mixed $notifiables - * @param mixed $notification - * @param array|null $channels - * @return void - */ - public function sendNow($notifiables, $notification, array $channels = null) - { - $notifiables = $this->formatNotifiables($notifiables); - - $original = clone $notification; - - foreach ($notifiables as $notifiable) { - if (empty($viaChannels = $channels ?: $notification->via($notifiable))) { - continue; - } - - $this->withLocale($this->preferredLocale($notifiable, $notification), function () use ($viaChannels, $notifiable, $original) { - $notificationId = Str::uuid()->toString(); - - foreach ((array) $viaChannels as $channel) { - if (! ($notifiable instanceof AnonymousNotifiable && $channel === 'database')) { - $this->sendToNotifiable($notifiable, $notificationId, clone $original, $channel); - } - } - }); - } - } - - /** - * Get the notifiable's preferred locale for the notification. - * - * @param mixed $notifiable - * @param mixed $notification - * @return string|null - */ - protected function preferredLocale($notifiable, $notification) - { - return $notification->locale ?? $this->locale ?? value(function () use ($notifiable) { - if ($notifiable instanceof HasLocalePreference) { - return $notifiable->preferredLocale(); - } - }); - } - - /** - * Send the given notification to the given notifiable via a channel. - * - * @param mixed $notifiable - * @param string $id - * @param mixed $notification - * @param string $channel - * @return void - */ - protected function sendToNotifiable($notifiable, $id, $notification, $channel) - { - if (! $notification->id) { - $notification->id = $id; - } - - if (! $this->shouldSendNotification($notifiable, $notification, $channel)) { - return; - } - - $response = $this->manager->driver($channel)->send($notifiable, $notification); - - $this->events->dispatch( - new NotificationSent($notifiable, $notification, $channel, $response) - ); - } - - /** - * Determines if the notification can be sent. - * - * @param mixed $notifiable - * @param mixed $notification - * @param string $channel - * @return bool - */ - protected function shouldSendNotification($notifiable, $notification, $channel) - { - if (method_exists($notification, 'shouldSend') && - $notification->shouldSend($notifiable, $channel) === false) { - return false; - } - - return $this->events->until( - new NotificationSending($notifiable, $notification, $channel) - ) !== false; - } - - /** - * Queue the given notification instances. - * - * @param mixed $notifiables - * @param \Illuminate\Notifications\Notification $notification - * @return void - */ - protected function queueNotification($notifiables, $notification) - { - $notifiables = $this->formatNotifiables($notifiables); - - $original = clone $notification; - - foreach ($notifiables as $notifiable) { - $notificationId = Str::uuid()->toString(); - - foreach ((array) $original->via($notifiable) as $channel) { - $notification = clone $original; - - if (! $notification->id) { - $notification->id = $notificationId; - } - - if (! is_null($this->locale)) { - $notification->locale = $this->locale; - } - - $connection = $notification->connection; - - if (method_exists($notification, 'viaConnections')) { - $connection = $notification->viaConnections()[$channel] ?? null; - } - - $queue = $notification->queue; - - if (method_exists($notification, 'viaQueues')) { - $queue = $notification->viaQueues()[$channel] ?? null; - } - - $delay = $notification->delay; - - if (method_exists($notification, 'withDelay')) { - $delay = $notification->withDelay($notifiable, $channel) ?? null; - } - - $middleware = $notification->middleware ?? []; - - if (method_exists($notification, 'middleware')) { - $middleware = array_merge( - $notification->middleware($notifiable, $channel), - $middleware - ); - } - - $this->bus->dispatch( - (new SendQueuedNotifications($notifiable, $notification, [$channel])) - ->onConnection($connection) - ->onQueue($queue) - ->delay(is_array($delay) ? ($delay[$channel] ?? null) : $delay) - ->through($middleware) - ); - } - } - } - - /** - * Format the notifiables into a Collection / array if necessary. - * - * @param mixed $notifiables - * @return \Illuminate\Database\Eloquent\Collection|array - */ - protected function formatNotifiables($notifiables) - { - if (! $notifiables instanceof Collection && ! is_array($notifiables)) { - return $notifiables instanceof Model - ? new ModelCollection([$notifiables]) : [$notifiables]; - } - - return $notifiables; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/NotificationServiceProvider.php b/vendor/laravel/framework/src/Illuminate/Notifications/NotificationServiceProvider.php deleted file mode 100644 index fb202ed9..00000000 --- a/vendor/laravel/framework/src/Illuminate/Notifications/NotificationServiceProvider.php +++ /dev/null @@ -1,46 +0,0 @@ -loadViewsFrom(__DIR__.'/resources/views', 'notifications'); - - if ($this->app->runningInConsole()) { - $this->publishes([ - __DIR__.'/resources/views' => $this->app->resourcePath('views/vendor/notifications'), - ], 'laravel-notifications'); - } - } - - /** - * Register the service provider. - * - * @return void - */ - public function register() - { - $this->app->singleton(ChannelManager::class, function ($app) { - return new ChannelManager($app); - }); - - $this->app->alias( - ChannelManager::class, DispatcherContract::class - ); - - $this->app->alias( - ChannelManager::class, FactoryContract::class - ); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/RoutesNotifications.php b/vendor/laravel/framework/src/Illuminate/Notifications/RoutesNotifications.php deleted file mode 100644 index 15aa673f..00000000 --- a/vendor/laravel/framework/src/Illuminate/Notifications/RoutesNotifications.php +++ /dev/null @@ -1,52 +0,0 @@ -send($this, $instance); - } - - /** - * Send the given notification immediately. - * - * @param mixed $instance - * @param array|null $channels - * @return void - */ - public function notifyNow($instance, array $channels = null) - { - app(Dispatcher::class)->sendNow($this, $instance, $channels); - } - - /** - * Get the notification routing information for the given driver. - * - * @param string $driver - * @param \Illuminate\Notifications\Notification|null $notification - * @return mixed - */ - public function routeNotificationFor($driver, $notification = null) - { - if (method_exists($this, $method = 'routeNotificationFor'.Str::studly($driver))) { - return $this->{$method}($notification); - } - - return match ($driver) { - 'database' => $this->notifications(), - 'mail' => $this->email, - default => null, - }; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/SendQueuedNotifications.php b/vendor/laravel/framework/src/Illuminate/Notifications/SendQueuedNotifications.php deleted file mode 100644 index 19af1885..00000000 --- a/vendor/laravel/framework/src/Illuminate/Notifications/SendQueuedNotifications.php +++ /dev/null @@ -1,176 +0,0 @@ -channels = $channels; - $this->notification = $notification; - $this->notifiables = $this->wrapNotifiables($notifiables); - $this->tries = property_exists($notification, 'tries') ? $notification->tries : null; - $this->timeout = property_exists($notification, 'timeout') ? $notification->timeout : null; - $this->maxExceptions = property_exists($notification, 'maxExceptions') ? $notification->maxExceptions : null; - $this->afterCommit = property_exists($notification, 'afterCommit') ? $notification->afterCommit : null; - $this->shouldBeEncrypted = $notification instanceof ShouldBeEncrypted; - } - - /** - * Wrap the notifiable(s) in a collection. - * - * @param \Illuminate\Notifications\Notifiable|\Illuminate\Support\Collection $notifiables - * @return \Illuminate\Support\Collection - */ - protected function wrapNotifiables($notifiables) - { - if ($notifiables instanceof Collection) { - return $notifiables; - } elseif ($notifiables instanceof Model) { - return EloquentCollection::wrap($notifiables); - } - - return Collection::wrap($notifiables); - } - - /** - * Send the notifications. - * - * @param \Illuminate\Notifications\ChannelManager $manager - * @return void - */ - public function handle(ChannelManager $manager) - { - $manager->sendNow($this->notifiables, $this->notification, $this->channels); - } - - /** - * Get the display name for the queued job. - * - * @return string - */ - public function displayName() - { - return get_class($this->notification); - } - - /** - * Call the failed method on the notification instance. - * - * @param \Throwable $e - * @return void - */ - public function failed($e) - { - if (method_exists($this->notification, 'failed')) { - $this->notification->failed($e); - } - } - - /** - * Get the number of seconds before a released notification will be available. - * - * @return mixed - */ - public function backoff() - { - if (! method_exists($this->notification, 'backoff') && ! isset($this->notification->backoff)) { - return; - } - - return $this->notification->backoff ?? $this->notification->backoff(); - } - - /** - * Determine the time at which the job should timeout. - * - * @return \DateTime|null - */ - public function retryUntil() - { - if (! method_exists($this->notification, 'retryUntil') && ! isset($this->notification->retryUntil)) { - return; - } - - return $this->notification->retryUntil ?? $this->notification->retryUntil(); - } - - /** - * Prepare the instance for cloning. - * - * @return void - */ - public function __clone() - { - $this->notifiables = clone $this->notifiables; - $this->notification = clone $this->notification; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/composer.json b/vendor/laravel/framework/src/Illuminate/Notifications/composer.json deleted file mode 100644 index 1fd402ef..00000000 --- a/vendor/laravel/framework/src/Illuminate/Notifications/composer.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "illuminate/notifications", - "description": "The Illuminate Notifications package.", - "license": "MIT", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "require": { - "php": "^8.0.2", - "illuminate/broadcasting": "^9.0", - "illuminate/bus": "^9.0", - "illuminate/collections": "^9.0", - "illuminate/container": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/filesystem": "^9.0", - "illuminate/mail": "^9.0", - "illuminate/queue": "^9.0", - "illuminate/support": "^9.0" - }, - "autoload": { - "psr-4": { - "Illuminate\\Notifications\\": "" - } - }, - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "suggest": { - "illuminate/database": "Required to use the database transport (^9.0)." - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev" -} diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/resources/views/email.blade.php b/vendor/laravel/framework/src/Illuminate/Notifications/resources/views/email.blade.php deleted file mode 100644 index 678e2591..00000000 --- a/vendor/laravel/framework/src/Illuminate/Notifications/resources/views/email.blade.php +++ /dev/null @@ -1,58 +0,0 @@ - -{{-- Greeting --}} -@if (! empty($greeting)) -# {{ $greeting }} -@else -@if ($level === 'error') -# @lang('Whoops!') -@else -# @lang('Hello!') -@endif -@endif - -{{-- Intro Lines --}} -@foreach ($introLines as $line) -{{ $line }} - -@endforeach - -{{-- Action Button --}} -@isset($actionText) - $level, - default => 'primary', - }; -?> - -{{ $actionText }} - -@endisset - -{{-- Outro Lines --}} -@foreach ($outroLines as $line) -{{ $line }} - -@endforeach - -{{-- Salutation --}} -@if (! empty($salutation)) -{{ $salutation }} -@else -@lang('Regards'),
-{{ config('app.name') }} -@endif - -{{-- Subcopy --}} -@isset($actionText) - -@lang( - "If you're having trouble clicking the \":actionText\" button, copy and paste the URL below\n". - 'into your web browser:', - [ - 'actionText' => $actionText, - ] -) [{{ $displayableActionUrl }}]({{ $actionUrl }}) - -@endisset -
diff --git a/vendor/laravel/framework/src/Illuminate/Pagination/AbstractCursorPaginator.php b/vendor/laravel/framework/src/Illuminate/Pagination/AbstractCursorPaginator.php deleted file mode 100644 index e6700789..00000000 --- a/vendor/laravel/framework/src/Illuminate/Pagination/AbstractCursorPaginator.php +++ /dev/null @@ -1,671 +0,0 @@ -cursorName => $cursor->encode()]; - - if (count($this->query) > 0) { - $parameters = array_merge($this->query, $parameters); - } - - return $this->path() - .(str_contains($this->path(), '?') ? '&' : '?') - .Arr::query($parameters) - .$this->buildFragment(); - } - - /** - * Get the URL for the previous page. - * - * @return string|null - */ - public function previousPageUrl() - { - if (is_null($previousCursor = $this->previousCursor())) { - return null; - } - - return $this->url($previousCursor); - } - - /** - * The URL for the next page, or null. - * - * @return string|null - */ - public function nextPageUrl() - { - if (is_null($nextCursor = $this->nextCursor())) { - return null; - } - - return $this->url($nextCursor); - } - - /** - * Get the "cursor" that points to the previous set of items. - * - * @return \Illuminate\Pagination\Cursor|null - */ - public function previousCursor() - { - if (is_null($this->cursor) || - ($this->cursor->pointsToPreviousItems() && ! $this->hasMore)) { - return null; - } - - if ($this->items->isEmpty()) { - return null; - } - - return $this->getCursorForItem($this->items->first(), false); - } - - /** - * Get the "cursor" that points to the next set of items. - * - * @return \Illuminate\Pagination\Cursor|null - */ - public function nextCursor() - { - if ((is_null($this->cursor) && ! $this->hasMore) || - (! is_null($this->cursor) && $this->cursor->pointsToNextItems() && ! $this->hasMore)) { - return null; - } - - if ($this->items->isEmpty()) { - return null; - } - - return $this->getCursorForItem($this->items->last(), true); - } - - /** - * Get a cursor instance for the given item. - * - * @param \ArrayAccess|\stdClass $item - * @param bool $isNext - * @return \Illuminate\Pagination\Cursor - */ - public function getCursorForItem($item, $isNext = true) - { - return new Cursor($this->getParametersForItem($item), $isNext); - } - - /** - * Get the cursor parameters for a given object. - * - * @param \ArrayAccess|\stdClass $item - * @return array - * - * @throws \Exception - */ - public function getParametersForItem($item) - { - return collect($this->parameters) - ->flip() - ->map(function ($_, $parameterName) use ($item) { - if ($item instanceof JsonResource) { - $item = $item->resource; - } - - if ($item instanceof Model && - ! is_null($parameter = $this->getPivotParameterForItem($item, $parameterName))) { - return $parameter; - } elseif ($item instanceof ArrayAccess || is_array($item)) { - return $this->ensureParameterIsPrimitive( - $item[$parameterName] ?? $item[Str::afterLast($parameterName, '.')] - ); - } elseif (is_object($item)) { - return $this->ensureParameterIsPrimitive( - $item->{$parameterName} ?? $item->{Str::afterLast($parameterName, '.')} - ); - } - - throw new Exception('Only arrays and objects are supported when cursor paginating items.'); - })->toArray(); - } - - /** - * Get the cursor parameter value from a pivot model if applicable. - * - * @param \ArrayAccess|\stdClass $item - * @param string $parameterName - * @return string|null - */ - protected function getPivotParameterForItem($item, $parameterName) - { - $table = Str::beforeLast($parameterName, '.'); - - foreach ($item->getRelations() as $relation) { - if ($relation instanceof Pivot && $relation->getTable() === $table) { - return $this->ensureParameterIsPrimitive( - $relation->getAttribute(Str::afterLast($parameterName, '.')) - ); - } - } - } - - /** - * Ensure the parameter is a primitive type. - * - * This can resolve issues that arise the developer uses a value object for an attribute. - * - * @param mixed $parameter - * @return mixed - */ - protected function ensureParameterIsPrimitive($parameter) - { - return is_object($parameter) && method_exists($parameter, '__toString') - ? (string) $parameter - : $parameter; - } - - /** - * Get / set the URL fragment to be appended to URLs. - * - * @param string|null $fragment - * @return $this|string|null - */ - public function fragment($fragment = null) - { - if (is_null($fragment)) { - return $this->fragment; - } - - $this->fragment = $fragment; - - return $this; - } - - /** - * Add a set of query string values to the paginator. - * - * @param array|string|null $key - * @param string|null $value - * @return $this - */ - public function appends($key, $value = null) - { - if (is_null($key)) { - return $this; - } - - if (is_array($key)) { - return $this->appendArray($key); - } - - return $this->addQuery($key, $value); - } - - /** - * Add an array of query string values. - * - * @param array $keys - * @return $this - */ - protected function appendArray(array $keys) - { - foreach ($keys as $key => $value) { - $this->addQuery($key, $value); - } - - return $this; - } - - /** - * Add all current query string values to the paginator. - * - * @return $this - */ - public function withQueryString() - { - if (! is_null($query = Paginator::resolveQueryString())) { - return $this->appends($query); - } - - return $this; - } - - /** - * Add a query string value to the paginator. - * - * @param string $key - * @param string $value - * @return $this - */ - protected function addQuery($key, $value) - { - if ($key !== $this->cursorName) { - $this->query[$key] = $value; - } - - return $this; - } - - /** - * Build the full fragment portion of a URL. - * - * @return string - */ - protected function buildFragment() - { - return $this->fragment ? '#'.$this->fragment : ''; - } - - /** - * Load a set of relationships onto the mixed relationship collection. - * - * @param string $relation - * @param array $relations - * @return $this - */ - public function loadMorph($relation, $relations) - { - $this->getCollection()->loadMorph($relation, $relations); - - return $this; - } - - /** - * Load a set of relationship counts onto the mixed relationship collection. - * - * @param string $relation - * @param array $relations - * @return $this - */ - public function loadMorphCount($relation, $relations) - { - $this->getCollection()->loadMorphCount($relation, $relations); - - return $this; - } - - /** - * Get the slice of items being paginated. - * - * @return array - */ - public function items() - { - return $this->items->all(); - } - - /** - * Transform each item in the slice of items using a callback. - * - * @param callable $callback - * @return $this - */ - public function through(callable $callback) - { - $this->items->transform($callback); - - return $this; - } - - /** - * Get the number of items shown per page. - * - * @return int - */ - public function perPage() - { - return $this->perPage; - } - - /** - * Get the current cursor being paginated. - * - * @return \Illuminate\Pagination\Cursor|null - */ - public function cursor() - { - return $this->cursor; - } - - /** - * Get the query string variable used to store the cursor. - * - * @return string - */ - public function getCursorName() - { - return $this->cursorName; - } - - /** - * Set the query string variable used to store the cursor. - * - * @param string $name - * @return $this - */ - public function setCursorName($name) - { - $this->cursorName = $name; - - return $this; - } - - /** - * Set the base path to assign to all URLs. - * - * @param string $path - * @return $this - */ - public function withPath($path) - { - return $this->setPath($path); - } - - /** - * Set the base path to assign to all URLs. - * - * @param string $path - * @return $this - */ - public function setPath($path) - { - $this->path = $path; - - return $this; - } - - /** - * Get the base path for paginator generated URLs. - * - * @return string|null - */ - public function path() - { - return $this->path; - } - - /** - * Resolve the current cursor or return the default value. - * - * @param string $cursorName - * @return \Illuminate\Pagination\Cursor|null - */ - public static function resolveCurrentCursor($cursorName = 'cursor', $default = null) - { - if (isset(static::$currentCursorResolver)) { - return call_user_func(static::$currentCursorResolver, $cursorName); - } - - return $default; - } - - /** - * Set the current cursor resolver callback. - * - * @param \Closure $resolver - * @return void - */ - public static function currentCursorResolver(Closure $resolver) - { - static::$currentCursorResolver = $resolver; - } - - /** - * Get an instance of the view factory from the resolver. - * - * @return \Illuminate\Contracts\View\Factory - */ - public static function viewFactory() - { - return Paginator::viewFactory(); - } - - /** - * Get an iterator for the items. - * - * @return \ArrayIterator - */ - public function getIterator(): Traversable - { - return $this->items->getIterator(); - } - - /** - * Determine if the list of items is empty. - * - * @return bool - */ - public function isEmpty() - { - return $this->items->isEmpty(); - } - - /** - * Determine if the list of items is not empty. - * - * @return bool - */ - public function isNotEmpty() - { - return $this->items->isNotEmpty(); - } - - /** - * Get the number of items for the current page. - * - * @return int - */ - public function count(): int - { - return $this->items->count(); - } - - /** - * Get the paginator's underlying collection. - * - * @return \Illuminate\Support\Collection - */ - public function getCollection() - { - return $this->items; - } - - /** - * Set the paginator's underlying collection. - * - * @param \Illuminate\Support\Collection $collection - * @return $this - */ - public function setCollection(Collection $collection) - { - $this->items = $collection; - - return $this; - } - - /** - * Get the paginator options. - * - * @return array - */ - public function getOptions() - { - return $this->options; - } - - /** - * Determine if the given item exists. - * - * @param mixed $key - * @return bool - */ - public function offsetExists($key): bool - { - return $this->items->has($key); - } - - /** - * Get the item at the given offset. - * - * @param mixed $key - * @return mixed - */ - public function offsetGet($key): mixed - { - return $this->items->get($key); - } - - /** - * Set the item at the given offset. - * - * @param mixed $key - * @param mixed $value - * @return void - */ - public function offsetSet($key, $value): void - { - $this->items->put($key, $value); - } - - /** - * Unset the item at the given key. - * - * @param mixed $key - * @return void - */ - public function offsetUnset($key): void - { - $this->items->forget($key); - } - - /** - * Render the contents of the paginator to HTML. - * - * @return string - */ - public function toHtml() - { - return (string) $this->render(); - } - - /** - * Make dynamic calls into the collection. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - return $this->forwardCallTo($this->getCollection(), $method, $parameters); - } - - /** - * Render the contents of the paginator when casting to a string. - * - * @return string - */ - public function __toString() - { - return (string) $this->render(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Pagination/AbstractPaginator.php b/vendor/laravel/framework/src/Illuminate/Pagination/AbstractPaginator.php deleted file mode 100644 index a4979840..00000000 --- a/vendor/laravel/framework/src/Illuminate/Pagination/AbstractPaginator.php +++ /dev/null @@ -1,797 +0,0 @@ -= 1 && filter_var($page, FILTER_VALIDATE_INT) !== false; - } - - /** - * Get the URL for the previous page. - * - * @return string|null - */ - public function previousPageUrl() - { - if ($this->currentPage() > 1) { - return $this->url($this->currentPage() - 1); - } - } - - /** - * Create a range of pagination URLs. - * - * @param int $start - * @param int $end - * @return array - */ - public function getUrlRange($start, $end) - { - return collect(range($start, $end))->mapWithKeys(function ($page) { - return [$page => $this->url($page)]; - })->all(); - } - - /** - * Get the URL for a given page number. - * - * @param int $page - * @return string - */ - public function url($page) - { - if ($page <= 0) { - $page = 1; - } - - // If we have any extra query string key / value pairs that need to be added - // onto the URL, we will put them in query string form and then attach it - // to the URL. This allows for extra information like sortings storage. - $parameters = [$this->pageName => $page]; - - if (count($this->query) > 0) { - $parameters = array_merge($this->query, $parameters); - } - - return $this->path() - .(str_contains($this->path(), '?') ? '&' : '?') - .Arr::query($parameters) - .$this->buildFragment(); - } - - /** - * Get / set the URL fragment to be appended to URLs. - * - * @param string|null $fragment - * @return $this|string|null - */ - public function fragment($fragment = null) - { - if (is_null($fragment)) { - return $this->fragment; - } - - $this->fragment = $fragment; - - return $this; - } - - /** - * Add a set of query string values to the paginator. - * - * @param array|string|null $key - * @param string|null $value - * @return $this - */ - public function appends($key, $value = null) - { - if (is_null($key)) { - return $this; - } - - if (is_array($key)) { - return $this->appendArray($key); - } - - return $this->addQuery($key, $value); - } - - /** - * Add an array of query string values. - * - * @param array $keys - * @return $this - */ - protected function appendArray(array $keys) - { - foreach ($keys as $key => $value) { - $this->addQuery($key, $value); - } - - return $this; - } - - /** - * Add all current query string values to the paginator. - * - * @return $this - */ - public function withQueryString() - { - if (isset(static::$queryStringResolver)) { - return $this->appends(call_user_func(static::$queryStringResolver)); - } - - return $this; - } - - /** - * Add a query string value to the paginator. - * - * @param string $key - * @param string $value - * @return $this - */ - protected function addQuery($key, $value) - { - if ($key !== $this->pageName) { - $this->query[$key] = $value; - } - - return $this; - } - - /** - * Build the full fragment portion of a URL. - * - * @return string - */ - protected function buildFragment() - { - return $this->fragment ? '#'.$this->fragment : ''; - } - - /** - * Load a set of relationships onto the mixed relationship collection. - * - * @param string $relation - * @param array $relations - * @return $this - */ - public function loadMorph($relation, $relations) - { - $this->getCollection()->loadMorph($relation, $relations); - - return $this; - } - - /** - * Load a set of relationship counts onto the mixed relationship collection. - * - * @param string $relation - * @param array $relations - * @return $this - */ - public function loadMorphCount($relation, $relations) - { - $this->getCollection()->loadMorphCount($relation, $relations); - - return $this; - } - - /** - * Get the slice of items being paginated. - * - * @return array - */ - public function items() - { - return $this->items->all(); - } - - /** - * Get the number of the first item in the slice. - * - * @return int - */ - public function firstItem() - { - return count($this->items) > 0 ? ($this->currentPage - 1) * $this->perPage + 1 : null; - } - - /** - * Get the number of the last item in the slice. - * - * @return int - */ - public function lastItem() - { - return count($this->items) > 0 ? $this->firstItem() + $this->count() - 1 : null; - } - - /** - * Transform each item in the slice of items using a callback. - * - * @param callable $callback - * @return $this - */ - public function through(callable $callback) - { - $this->items->transform($callback); - - return $this; - } - - /** - * Get the number of items shown per page. - * - * @return int - */ - public function perPage() - { - return $this->perPage; - } - - /** - * Determine if there are enough items to split into multiple pages. - * - * @return bool - */ - public function hasPages() - { - return $this->currentPage() != 1 || $this->hasMorePages(); - } - - /** - * Determine if the paginator is on the first page. - * - * @return bool - */ - public function onFirstPage() - { - return $this->currentPage() <= 1; - } - - /** - * Determine if the paginator is on the last page. - * - * @return bool - */ - public function onLastPage() - { - return ! $this->hasMorePages(); - } - - /** - * Get the current page. - * - * @return int - */ - public function currentPage() - { - return $this->currentPage; - } - - /** - * Get the query string variable used to store the page. - * - * @return string - */ - public function getPageName() - { - return $this->pageName; - } - - /** - * Set the query string variable used to store the page. - * - * @param string $name - * @return $this - */ - public function setPageName($name) - { - $this->pageName = $name; - - return $this; - } - - /** - * Set the base path to assign to all URLs. - * - * @param string $path - * @return $this - */ - public function withPath($path) - { - return $this->setPath($path); - } - - /** - * Set the base path to assign to all URLs. - * - * @param string $path - * @return $this - */ - public function setPath($path) - { - $this->path = $path; - - return $this; - } - - /** - * Set the number of links to display on each side of current page link. - * - * @param int $count - * @return $this - */ - public function onEachSide($count) - { - $this->onEachSide = $count; - - return $this; - } - - /** - * Get the base path for paginator generated URLs. - * - * @return string|null - */ - public function path() - { - return $this->path; - } - - /** - * Resolve the current request path or return the default value. - * - * @param string $default - * @return string - */ - public static function resolveCurrentPath($default = '/') - { - if (isset(static::$currentPathResolver)) { - return call_user_func(static::$currentPathResolver); - } - - return $default; - } - - /** - * Set the current request path resolver callback. - * - * @param \Closure $resolver - * @return void - */ - public static function currentPathResolver(Closure $resolver) - { - static::$currentPathResolver = $resolver; - } - - /** - * Resolve the current page or return the default value. - * - * @param string $pageName - * @param int $default - * @return int - */ - public static function resolveCurrentPage($pageName = 'page', $default = 1) - { - if (isset(static::$currentPageResolver)) { - return (int) call_user_func(static::$currentPageResolver, $pageName); - } - - return $default; - } - - /** - * Set the current page resolver callback. - * - * @param \Closure $resolver - * @return void - */ - public static function currentPageResolver(Closure $resolver) - { - static::$currentPageResolver = $resolver; - } - - /** - * Resolve the query string or return the default value. - * - * @param string|array|null $default - * @return string - */ - public static function resolveQueryString($default = null) - { - if (isset(static::$queryStringResolver)) { - return (static::$queryStringResolver)(); - } - - return $default; - } - - /** - * Set with query string resolver callback. - * - * @param \Closure $resolver - * @return void - */ - public static function queryStringResolver(Closure $resolver) - { - static::$queryStringResolver = $resolver; - } - - /** - * Get an instance of the view factory from the resolver. - * - * @return \Illuminate\Contracts\View\Factory - */ - public static function viewFactory() - { - return call_user_func(static::$viewFactoryResolver); - } - - /** - * Set the view factory resolver callback. - * - * @param \Closure $resolver - * @return void - */ - public static function viewFactoryResolver(Closure $resolver) - { - static::$viewFactoryResolver = $resolver; - } - - /** - * Set the default pagination view. - * - * @param string $view - * @return void - */ - public static function defaultView($view) - { - static::$defaultView = $view; - } - - /** - * Set the default "simple" pagination view. - * - * @param string $view - * @return void - */ - public static function defaultSimpleView($view) - { - static::$defaultSimpleView = $view; - } - - /** - * Indicate that Tailwind styling should be used for generated links. - * - * @return void - */ - public static function useTailwind() - { - static::defaultView('pagination::tailwind'); - static::defaultSimpleView('pagination::simple-tailwind'); - } - - /** - * Indicate that Bootstrap 4 styling should be used for generated links. - * - * @return void - */ - public static function useBootstrap() - { - static::useBootstrapFour(); - } - - /** - * Indicate that Bootstrap 3 styling should be used for generated links. - * - * @return void - */ - public static function useBootstrapThree() - { - static::defaultView('pagination::default'); - static::defaultSimpleView('pagination::simple-default'); - } - - /** - * Indicate that Bootstrap 4 styling should be used for generated links. - * - * @return void - */ - public static function useBootstrapFour() - { - static::defaultView('pagination::bootstrap-4'); - static::defaultSimpleView('pagination::simple-bootstrap-4'); - } - - /** - * Indicate that Bootstrap 5 styling should be used for generated links. - * - * @return void - */ - public static function useBootstrapFive() - { - static::defaultView('pagination::bootstrap-5'); - static::defaultSimpleView('pagination::simple-bootstrap-5'); - } - - /** - * Get an iterator for the items. - * - * @return \ArrayIterator - */ - public function getIterator(): Traversable - { - return $this->items->getIterator(); - } - - /** - * Determine if the list of items is empty. - * - * @return bool - */ - public function isEmpty() - { - return $this->items->isEmpty(); - } - - /** - * Determine if the list of items is not empty. - * - * @return bool - */ - public function isNotEmpty() - { - return $this->items->isNotEmpty(); - } - - /** - * Get the number of items for the current page. - * - * @return int - */ - public function count(): int - { - return $this->items->count(); - } - - /** - * Get the paginator's underlying collection. - * - * @return \Illuminate\Support\Collection - */ - public function getCollection() - { - return $this->items; - } - - /** - * Set the paginator's underlying collection. - * - * @param \Illuminate\Support\Collection $collection - * @return $this - */ - public function setCollection(Collection $collection) - { - $this->items = $collection; - - return $this; - } - - /** - * Get the paginator options. - * - * @return array - */ - public function getOptions() - { - return $this->options; - } - - /** - * Determine if the given item exists. - * - * @param mixed $key - * @return bool - */ - public function offsetExists($key): bool - { - return $this->items->has($key); - } - - /** - * Get the item at the given offset. - * - * @param mixed $key - * @return mixed - */ - public function offsetGet($key): mixed - { - return $this->items->get($key); - } - - /** - * Set the item at the given offset. - * - * @param mixed $key - * @param mixed $value - * @return void - */ - public function offsetSet($key, $value): void - { - $this->items->put($key, $value); - } - - /** - * Unset the item at the given key. - * - * @param mixed $key - * @return void - */ - public function offsetUnset($key): void - { - $this->items->forget($key); - } - - /** - * Render the contents of the paginator to HTML. - * - * @return string - */ - public function toHtml() - { - return (string) $this->render(); - } - - /** - * Make dynamic calls into the collection. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - return $this->forwardCallTo($this->getCollection(), $method, $parameters); - } - - /** - * Render the contents of the paginator when casting to a string. - * - * @return string - */ - public function __toString() - { - return (string) $this->render(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Pagination/Cursor.php b/vendor/laravel/framework/src/Illuminate/Pagination/Cursor.php deleted file mode 100644 index 1d622808..00000000 --- a/vendor/laravel/framework/src/Illuminate/Pagination/Cursor.php +++ /dev/null @@ -1,132 +0,0 @@ -parameters = $parameters; - $this->pointsToNextItems = $pointsToNextItems; - } - - /** - * Get the given parameter from the cursor. - * - * @param string $parameterName - * @return string|null - * - * @throws \UnexpectedValueException - */ - public function parameter(string $parameterName) - { - if (! array_key_exists($parameterName, $this->parameters)) { - throw new UnexpectedValueException("Unable to find parameter [{$parameterName}] in pagination item."); - } - - return $this->parameters[$parameterName]; - } - - /** - * Get the given parameters from the cursor. - * - * @param array $parameterNames - * @return array - */ - public function parameters(array $parameterNames) - { - return collect($parameterNames)->map(function ($parameterName) { - return $this->parameter($parameterName); - })->toArray(); - } - - /** - * Determine whether the cursor points to the next set of items. - * - * @return bool - */ - public function pointsToNextItems() - { - return $this->pointsToNextItems; - } - - /** - * Determine whether the cursor points to the previous set of items. - * - * @return bool - */ - public function pointsToPreviousItems() - { - return ! $this->pointsToNextItems; - } - - /** - * Get the array representation of the cursor. - * - * @return array - */ - public function toArray() - { - return array_merge($this->parameters, [ - '_pointsToNextItems' => $this->pointsToNextItems, - ]); - } - - /** - * Get the encoded string representation of the cursor to construct a URL. - * - * @return string - */ - public function encode() - { - return str_replace(['+', '/', '='], ['-', '_', ''], base64_encode(json_encode($this->toArray()))); - } - - /** - * Get a cursor instance from the encoded string representation. - * - * @param string|null $encodedString - * @return static|null - */ - public static function fromEncoded($encodedString) - { - if (! is_string($encodedString)) { - return null; - } - - $parameters = json_decode(base64_decode(str_replace(['-', '_'], ['+', '/'], $encodedString)), true); - - if (json_last_error() !== JSON_ERROR_NONE) { - return null; - } - - $pointsToNextItems = $parameters['_pointsToNextItems']; - - unset($parameters['_pointsToNextItems']); - - return new static($parameters, $pointsToNextItems); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Pagination/CursorPaginator.php b/vendor/laravel/framework/src/Illuminate/Pagination/CursorPaginator.php deleted file mode 100644 index 4c0a8965..00000000 --- a/vendor/laravel/framework/src/Illuminate/Pagination/CursorPaginator.php +++ /dev/null @@ -1,172 +0,0 @@ -options = $options; - - foreach ($options as $key => $value) { - $this->{$key} = $value; - } - - $this->perPage = (int) $perPage; - $this->cursor = $cursor; - $this->path = $this->path !== '/' ? rtrim($this->path, '/') : $this->path; - - $this->setItems($items); - } - - /** - * Set the items for the paginator. - * - * @param mixed $items - * @return void - */ - protected function setItems($items) - { - $this->items = $items instanceof Collection ? $items : Collection::make($items); - - $this->hasMore = $this->items->count() > $this->perPage; - - $this->items = $this->items->slice(0, $this->perPage); - - if (! is_null($this->cursor) && $this->cursor->pointsToPreviousItems()) { - $this->items = $this->items->reverse()->values(); - } - } - - /** - * Render the paginator using the given view. - * - * @param string|null $view - * @param array $data - * @return \Illuminate\Contracts\Support\Htmlable - */ - public function links($view = null, $data = []) - { - return $this->render($view, $data); - } - - /** - * Render the paginator using the given view. - * - * @param string|null $view - * @param array $data - * @return \Illuminate\Contracts\Support\Htmlable - */ - public function render($view = null, $data = []) - { - return static::viewFactory()->make($view ?: Paginator::$defaultSimpleView, array_merge($data, [ - 'paginator' => $this, - ])); - } - - /** - * Determine if there are more items in the data source. - * - * @return bool - */ - public function hasMorePages() - { - return (is_null($this->cursor) && $this->hasMore) || - (! is_null($this->cursor) && $this->cursor->pointsToNextItems() && $this->hasMore) || - (! is_null($this->cursor) && $this->cursor->pointsToPreviousItems()); - } - - /** - * Determine if there are enough items to split into multiple pages. - * - * @return bool - */ - public function hasPages() - { - return ! $this->onFirstPage() || $this->hasMorePages(); - } - - /** - * Determine if the paginator is on the first page. - * - * @return bool - */ - public function onFirstPage() - { - return is_null($this->cursor) || ($this->cursor->pointsToPreviousItems() && ! $this->hasMore); - } - - /** - * Determine if the paginator is on the last page. - * - * @return bool - */ - public function onLastPage() - { - return ! $this->hasMorePages(); - } - - /** - * Get the instance as an array. - * - * @return array - */ - public function toArray() - { - return [ - 'data' => $this->items->toArray(), - 'path' => $this->path(), - 'per_page' => $this->perPage(), - 'next_cursor' => $this->nextCursor()?->encode(), - 'next_page_url' => $this->nextPageUrl(), - 'prev_cursor' => $this->previousCursor()?->encode(), - 'prev_page_url' => $this->previousPageUrl(), - ]; - } - - /** - * Convert the object into something JSON serializable. - * - * @return array - */ - public function jsonSerialize(): array - { - return $this->toArray(); - } - - /** - * Convert the object to its JSON representation. - * - * @param int $options - * @return string - */ - public function toJson($options = 0) - { - return json_encode($this->jsonSerialize(), $options); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Pagination/LICENSE.md b/vendor/laravel/framework/src/Illuminate/Pagination/LICENSE.md deleted file mode 100644 index 79810c84..00000000 --- a/vendor/laravel/framework/src/Illuminate/Pagination/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Taylor Otwell - -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/laravel/framework/src/Illuminate/Pagination/LengthAwarePaginator.php b/vendor/laravel/framework/src/Illuminate/Pagination/LengthAwarePaginator.php deleted file mode 100644 index 8d3e0ab7..00000000 --- a/vendor/laravel/framework/src/Illuminate/Pagination/LengthAwarePaginator.php +++ /dev/null @@ -1,231 +0,0 @@ -options = $options; - - foreach ($options as $key => $value) { - $this->{$key} = $value; - } - - $this->total = $total; - $this->perPage = (int) $perPage; - $this->lastPage = max((int) ceil($total / $perPage), 1); - $this->path = $this->path !== '/' ? rtrim($this->path, '/') : $this->path; - $this->currentPage = $this->setCurrentPage($currentPage, $this->pageName); - $this->items = $items instanceof Collection ? $items : Collection::make($items); - } - - /** - * Get the current page for the request. - * - * @param int $currentPage - * @param string $pageName - * @return int - */ - protected function setCurrentPage($currentPage, $pageName) - { - $currentPage = $currentPage ?: static::resolveCurrentPage($pageName); - - return $this->isValidPageNumber($currentPage) ? (int) $currentPage : 1; - } - - /** - * Render the paginator using the given view. - * - * @param string|null $view - * @param array $data - * @return \Illuminate\Contracts\Support\Htmlable - */ - public function links($view = null, $data = []) - { - return $this->render($view, $data); - } - - /** - * Render the paginator using the given view. - * - * @param string|null $view - * @param array $data - * @return \Illuminate\Contracts\Support\Htmlable - */ - public function render($view = null, $data = []) - { - return static::viewFactory()->make($view ?: static::$defaultView, array_merge($data, [ - 'paginator' => $this, - 'elements' => $this->elements(), - ])); - } - - /** - * Get the paginator links as a collection (for JSON responses). - * - * @return \Illuminate\Support\Collection - */ - public function linkCollection() - { - return collect($this->elements())->flatMap(function ($item) { - if (! is_array($item)) { - return [['url' => null, 'label' => '...', 'active' => false]]; - } - - return collect($item)->map(function ($url, $page) { - return [ - 'url' => $url, - 'label' => (string) $page, - 'active' => $this->currentPage() === $page, - ]; - }); - })->prepend([ - 'url' => $this->previousPageUrl(), - 'label' => function_exists('__') ? __('pagination.previous') : 'Previous', - 'active' => false, - ])->push([ - 'url' => $this->nextPageUrl(), - 'label' => function_exists('__') ? __('pagination.next') : 'Next', - 'active' => false, - ]); - } - - /** - * Get the array of elements to pass to the view. - * - * @return array - */ - protected function elements() - { - $window = UrlWindow::make($this); - - return array_filter([ - $window['first'], - is_array($window['slider']) ? '...' : null, - $window['slider'], - is_array($window['last']) ? '...' : null, - $window['last'], - ]); - } - - /** - * Get the total number of items being paginated. - * - * @return int - */ - public function total() - { - return $this->total; - } - - /** - * Determine if there are more items in the data source. - * - * @return bool - */ - public function hasMorePages() - { - return $this->currentPage() < $this->lastPage(); - } - - /** - * Get the URL for the next page. - * - * @return string|null - */ - public function nextPageUrl() - { - if ($this->hasMorePages()) { - return $this->url($this->currentPage() + 1); - } - } - - /** - * Get the last page. - * - * @return int - */ - public function lastPage() - { - return $this->lastPage; - } - - /** - * Get the instance as an array. - * - * @return array - */ - public function toArray() - { - return [ - 'current_page' => $this->currentPage(), - 'data' => $this->items->toArray(), - 'first_page_url' => $this->url(1), - 'from' => $this->firstItem(), - 'last_page' => $this->lastPage(), - 'last_page_url' => $this->url($this->lastPage()), - 'links' => $this->linkCollection()->toArray(), - 'next_page_url' => $this->nextPageUrl(), - 'path' => $this->path(), - 'per_page' => $this->perPage(), - 'prev_page_url' => $this->previousPageUrl(), - 'to' => $this->lastItem(), - 'total' => $this->total(), - ]; - } - - /** - * Convert the object into something JSON serializable. - * - * @return array - */ - public function jsonSerialize(): array - { - return $this->toArray(); - } - - /** - * Convert the object to its JSON representation. - * - * @param int $options - * @return string - */ - public function toJson($options = 0) - { - return json_encode($this->jsonSerialize(), $options); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Pagination/PaginationServiceProvider.php b/vendor/laravel/framework/src/Illuminate/Pagination/PaginationServiceProvider.php deleted file mode 100755 index e94cebd6..00000000 --- a/vendor/laravel/framework/src/Illuminate/Pagination/PaginationServiceProvider.php +++ /dev/null @@ -1,34 +0,0 @@ -loadViewsFrom(__DIR__.'/resources/views', 'pagination'); - - if ($this->app->runningInConsole()) { - $this->publishes([ - __DIR__.'/resources/views' => $this->app->resourcePath('views/vendor/pagination'), - ], 'laravel-pagination'); - } - } - - /** - * Register the service provider. - * - * @return void - */ - public function register() - { - PaginationState::resolveUsing($this->app); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Pagination/PaginationState.php b/vendor/laravel/framework/src/Illuminate/Pagination/PaginationState.php deleted file mode 100644 index 347c6e22..00000000 --- a/vendor/laravel/framework/src/Illuminate/Pagination/PaginationState.php +++ /dev/null @@ -1,35 +0,0 @@ - $app['view']); - - Paginator::currentPathResolver(fn () => $app['request']->url()); - - Paginator::currentPageResolver(function ($pageName = 'page') use ($app) { - $page = $app['request']->input($pageName); - - if (filter_var($page, FILTER_VALIDATE_INT) !== false && (int) $page >= 1) { - return (int) $page; - } - - return 1; - }); - - Paginator::queryStringResolver(fn () => $app['request']->query()); - - CursorPaginator::currentCursorResolver(function ($cursorName = 'cursor') use ($app) { - return Cursor::fromEncoded($app['request']->input($cursorName)); - }); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Pagination/Paginator.php b/vendor/laravel/framework/src/Illuminate/Pagination/Paginator.php deleted file mode 100644 index d307ee9f..00000000 --- a/vendor/laravel/framework/src/Illuminate/Pagination/Paginator.php +++ /dev/null @@ -1,176 +0,0 @@ -options = $options; - - foreach ($options as $key => $value) { - $this->{$key} = $value; - } - - $this->perPage = $perPage; - $this->currentPage = $this->setCurrentPage($currentPage); - $this->path = $this->path !== '/' ? rtrim($this->path, '/') : $this->path; - - $this->setItems($items); - } - - /** - * Get the current page for the request. - * - * @param int $currentPage - * @return int - */ - protected function setCurrentPage($currentPage) - { - $currentPage = $currentPage ?: static::resolveCurrentPage(); - - return $this->isValidPageNumber($currentPage) ? (int) $currentPage : 1; - } - - /** - * Set the items for the paginator. - * - * @param mixed $items - * @return void - */ - protected function setItems($items) - { - $this->items = $items instanceof Collection ? $items : Collection::make($items); - - $this->hasMore = $this->items->count() > $this->perPage; - - $this->items = $this->items->slice(0, $this->perPage); - } - - /** - * Get the URL for the next page. - * - * @return string|null - */ - public function nextPageUrl() - { - if ($this->hasMorePages()) { - return $this->url($this->currentPage() + 1); - } - } - - /** - * Render the paginator using the given view. - * - * @param string|null $view - * @param array $data - * @return string - */ - public function links($view = null, $data = []) - { - return $this->render($view, $data); - } - - /** - * Render the paginator using the given view. - * - * @param string|null $view - * @param array $data - * @return \Illuminate\Contracts\Support\Htmlable - */ - public function render($view = null, $data = []) - { - return static::viewFactory()->make($view ?: static::$defaultSimpleView, array_merge($data, [ - 'paginator' => $this, - ])); - } - - /** - * Manually indicate that the paginator does have more pages. - * - * @param bool $hasMore - * @return $this - */ - public function hasMorePagesWhen($hasMore = true) - { - $this->hasMore = $hasMore; - - return $this; - } - - /** - * Determine if there are more items in the data source. - * - * @return bool - */ - public function hasMorePages() - { - return $this->hasMore; - } - - /** - * Get the instance as an array. - * - * @return array - */ - public function toArray() - { - return [ - 'current_page' => $this->currentPage(), - 'data' => $this->items->toArray(), - 'first_page_url' => $this->url(1), - 'from' => $this->firstItem(), - 'next_page_url' => $this->nextPageUrl(), - 'path' => $this->path(), - 'per_page' => $this->perPage(), - 'prev_page_url' => $this->previousPageUrl(), - 'to' => $this->lastItem(), - ]; - } - - /** - * Convert the object into something JSON serializable. - * - * @return array - */ - public function jsonSerialize(): array - { - return $this->toArray(); - } - - /** - * Convert the object to its JSON representation. - * - * @param int $options - * @return string - */ - public function toJson($options = 0) - { - return json_encode($this->jsonSerialize(), $options); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Pagination/UrlWindow.php b/vendor/laravel/framework/src/Illuminate/Pagination/UrlWindow.php deleted file mode 100644 index 99286f7b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Pagination/UrlWindow.php +++ /dev/null @@ -1,220 +0,0 @@ -paginator = $paginator; - } - - /** - * Create a new URL window instance. - * - * @param \Illuminate\Contracts\Pagination\LengthAwarePaginator $paginator - * @return array - */ - public static function make(PaginatorContract $paginator) - { - return (new static($paginator))->get(); - } - - /** - * Get the window of URLs to be shown. - * - * @return array - */ - public function get() - { - $onEachSide = $this->paginator->onEachSide; - - if ($this->paginator->lastPage() < ($onEachSide * 2) + 8) { - return $this->getSmallSlider(); - } - - return $this->getUrlSlider($onEachSide); - } - - /** - * Get the slider of URLs there are not enough pages to slide. - * - * @return array - */ - protected function getSmallSlider() - { - return [ - 'first' => $this->paginator->getUrlRange(1, $this->lastPage()), - 'slider' => null, - 'last' => null, - ]; - } - - /** - * Create a URL slider links. - * - * @param int $onEachSide - * @return array - */ - protected function getUrlSlider($onEachSide) - { - $window = $onEachSide + 4; - - if (! $this->hasPages()) { - return ['first' => null, 'slider' => null, 'last' => null]; - } - - // If the current page is very close to the beginning of the page range, we will - // just render the beginning of the page range, followed by the last 2 of the - // links in this list, since we will not have room to create a full slider. - if ($this->currentPage() <= $window) { - return $this->getSliderTooCloseToBeginning($window, $onEachSide); - } - - // If the current page is close to the ending of the page range we will just get - // this first couple pages, followed by a larger window of these ending pages - // since we're too close to the end of the list to create a full on slider. - elseif ($this->currentPage() > ($this->lastPage() - $window)) { - return $this->getSliderTooCloseToEnding($window, $onEachSide); - } - - // If we have enough room on both sides of the current page to build a slider we - // will surround it with both the beginning and ending caps, with this window - // of pages in the middle providing a Google style sliding paginator setup. - return $this->getFullSlider($onEachSide); - } - - /** - * Get the slider of URLs when too close to the beginning of the window. - * - * @param int $window - * @param int $onEachSide - * @return array - */ - protected function getSliderTooCloseToBeginning($window, $onEachSide) - { - return [ - 'first' => $this->paginator->getUrlRange(1, $window + $onEachSide), - 'slider' => null, - 'last' => $this->getFinish(), - ]; - } - - /** - * Get the slider of URLs when too close to the ending of the window. - * - * @param int $window - * @param int $onEachSide - * @return array - */ - protected function getSliderTooCloseToEnding($window, $onEachSide) - { - $last = $this->paginator->getUrlRange( - $this->lastPage() - ($window + ($onEachSide - 1)), - $this->lastPage() - ); - - return [ - 'first' => $this->getStart(), - 'slider' => null, - 'last' => $last, - ]; - } - - /** - * Get the slider of URLs when a full slider can be made. - * - * @param int $onEachSide - * @return array - */ - protected function getFullSlider($onEachSide) - { - return [ - 'first' => $this->getStart(), - 'slider' => $this->getAdjacentUrlRange($onEachSide), - 'last' => $this->getFinish(), - ]; - } - - /** - * Get the page range for the current page window. - * - * @param int $onEachSide - * @return array - */ - public function getAdjacentUrlRange($onEachSide) - { - return $this->paginator->getUrlRange( - $this->currentPage() - $onEachSide, - $this->currentPage() + $onEachSide - ); - } - - /** - * Get the starting URLs of a pagination slider. - * - * @return array - */ - public function getStart() - { - return $this->paginator->getUrlRange(1, 2); - } - - /** - * Get the ending URLs of a pagination slider. - * - * @return array - */ - public function getFinish() - { - return $this->paginator->getUrlRange( - $this->lastPage() - 1, - $this->lastPage() - ); - } - - /** - * Determine if the underlying paginator being presented has pages to show. - * - * @return bool - */ - public function hasPages() - { - return $this->paginator->lastPage() > 1; - } - - /** - * Get the current page from the paginator. - * - * @return int - */ - protected function currentPage() - { - return $this->paginator->currentPage(); - } - - /** - * Get the last page from the paginator. - * - * @return int - */ - protected function lastPage() - { - return $this->paginator->lastPage(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Pagination/composer.json b/vendor/laravel/framework/src/Illuminate/Pagination/composer.json deleted file mode 100755 index 3edd0d73..00000000 --- a/vendor/laravel/framework/src/Illuminate/Pagination/composer.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "illuminate/pagination", - "description": "The Illuminate Pagination package.", - "license": "MIT", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "require": { - "php": "^8.0.2", - "ext-json": "*", - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/support": "^9.0" - }, - "autoload": { - "psr-4": { - "Illuminate\\Pagination\\": "" - } - }, - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev" -} diff --git a/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/bootstrap-4.blade.php b/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/bootstrap-4.blade.php deleted file mode 100644 index 63c6f56b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/bootstrap-4.blade.php +++ /dev/null @@ -1,46 +0,0 @@ -@if ($paginator->hasPages()) - -@endif diff --git a/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/bootstrap-5.blade.php b/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/bootstrap-5.blade.php deleted file mode 100644 index a1795a4d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/bootstrap-5.blade.php +++ /dev/null @@ -1,88 +0,0 @@ -@if ($paginator->hasPages()) - -@endif diff --git a/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/default.blade.php b/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/default.blade.php deleted file mode 100644 index 0db70b56..00000000 --- a/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/default.blade.php +++ /dev/null @@ -1,46 +0,0 @@ -@if ($paginator->hasPages()) - -@endif diff --git a/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/semantic-ui.blade.php b/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/semantic-ui.blade.php deleted file mode 100644 index ef0dbb18..00000000 --- a/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/semantic-ui.blade.php +++ /dev/null @@ -1,36 +0,0 @@ -@if ($paginator->hasPages()) - -@endif diff --git a/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/simple-bootstrap-4.blade.php b/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/simple-bootstrap-4.blade.php deleted file mode 100644 index 4bb49174..00000000 --- a/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/simple-bootstrap-4.blade.php +++ /dev/null @@ -1,27 +0,0 @@ -@if ($paginator->hasPages()) - -@endif diff --git a/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/simple-bootstrap-5.blade.php b/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/simple-bootstrap-5.blade.php deleted file mode 100644 index a89005ee..00000000 --- a/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/simple-bootstrap-5.blade.php +++ /dev/null @@ -1,29 +0,0 @@ -@if ($paginator->hasPages()) - -@endif diff --git a/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/simple-default.blade.php b/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/simple-default.blade.php deleted file mode 100644 index 36bdbc18..00000000 --- a/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/simple-default.blade.php +++ /dev/null @@ -1,19 +0,0 @@ -@if ($paginator->hasPages()) - -@endif diff --git a/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/simple-tailwind.blade.php b/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/simple-tailwind.blade.php deleted file mode 100644 index 6872cca3..00000000 --- a/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/simple-tailwind.blade.php +++ /dev/null @@ -1,25 +0,0 @@ -@if ($paginator->hasPages()) - -@endif diff --git a/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/tailwind.blade.php b/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/tailwind.blade.php deleted file mode 100644 index 5bf323b4..00000000 --- a/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/tailwind.blade.php +++ /dev/null @@ -1,106 +0,0 @@ -@if ($paginator->hasPages()) - -@endif diff --git a/vendor/laravel/framework/src/Illuminate/Pipeline/Hub.php b/vendor/laravel/framework/src/Illuminate/Pipeline/Hub.php deleted file mode 100644 index 91e9b3f3..00000000 --- a/vendor/laravel/framework/src/Illuminate/Pipeline/Hub.php +++ /dev/null @@ -1,97 +0,0 @@ -container = $container; - } - - /** - * Define the default named pipeline. - * - * @param \Closure $callback - * @return void - */ - public function defaults(Closure $callback) - { - return $this->pipeline('default', $callback); - } - - /** - * Define a new named pipeline. - * - * @param string $name - * @param \Closure $callback - * @return void - */ - public function pipeline($name, Closure $callback) - { - $this->pipelines[$name] = $callback; - } - - /** - * Send an object through one of the available pipelines. - * - * @param mixed $object - * @param string|null $pipeline - * @return mixed - */ - public function pipe($object, $pipeline = null) - { - $pipeline = $pipeline ?: 'default'; - - return call_user_func( - $this->pipelines[$pipeline], new Pipeline($this->container), $object - ); - } - - /** - * Get the container instance used by the hub. - * - * @return \Illuminate\Contracts\Container\Container - */ - public function getContainer() - { - return $this->container; - } - - /** - * Set the container instance used by the hub. - * - * @param \Illuminate\Contracts\Container\Container $container - * @return $this - */ - public function setContainer(Container $container) - { - $this->container = $container; - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Pipeline/LICENSE.md b/vendor/laravel/framework/src/Illuminate/Pipeline/LICENSE.md deleted file mode 100644 index 79810c84..00000000 --- a/vendor/laravel/framework/src/Illuminate/Pipeline/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Taylor Otwell - -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/laravel/framework/src/Illuminate/Pipeline/Pipeline.php b/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php deleted file mode 100644 index 53b9fef1..00000000 --- a/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php +++ /dev/null @@ -1,271 +0,0 @@ -container = $container; - } - - /** - * Set the object being sent through the pipeline. - * - * @param mixed $passable - * @return $this - */ - public function send($passable) - { - $this->passable = $passable; - - return $this; - } - - /** - * Set the array of pipes. - * - * @param array|mixed $pipes - * @return $this - */ - public function through($pipes) - { - $this->pipes = is_array($pipes) ? $pipes : func_get_args(); - - return $this; - } - - /** - * Push additional pipes onto the pipeline. - * - * @param array|mixed $pipes - * @return $this - */ - public function pipe($pipes) - { - array_push($this->pipes, ...(is_array($pipes) ? $pipes : func_get_args())); - - return $this; - } - - /** - * Set the method to call on the pipes. - * - * @param string $method - * @return $this - */ - public function via($method) - { - $this->method = $method; - - return $this; - } - - /** - * Run the pipeline with a final destination callback. - * - * @param \Closure $destination - * @return mixed - */ - public function then(Closure $destination) - { - $pipeline = array_reduce( - array_reverse($this->pipes()), $this->carry(), $this->prepareDestination($destination) - ); - - return $pipeline($this->passable); - } - - /** - * Run the pipeline and return the result. - * - * @return mixed - */ - public function thenReturn() - { - return $this->then(function ($passable) { - return $passable; - }); - } - - /** - * Get the final piece of the Closure onion. - * - * @param \Closure $destination - * @return \Closure - */ - protected function prepareDestination(Closure $destination) - { - return function ($passable) use ($destination) { - try { - return $destination($passable); - } catch (Throwable $e) { - return $this->handleException($passable, $e); - } - }; - } - - /** - * Get a Closure that represents a slice of the application onion. - * - * @return \Closure - */ - protected function carry() - { - return function ($stack, $pipe) { - return function ($passable) use ($stack, $pipe) { - try { - if (is_callable($pipe)) { - // If the pipe is a callable, then we will call it directly, but otherwise we - // will resolve the pipes out of the dependency container and call it with - // the appropriate method and arguments, returning the results back out. - return $pipe($passable, $stack); - } elseif (! is_object($pipe)) { - [$name, $parameters] = $this->parsePipeString($pipe); - - // If the pipe is a string we will parse the string and resolve the class out - // of the dependency injection container. We can then build a callable and - // execute the pipe function giving in the parameters that are required. - $pipe = $this->getContainer()->make($name); - - $parameters = array_merge([$passable, $stack], $parameters); - } else { - // If the pipe is already an object we'll just make a callable and pass it to - // the pipe as-is. There is no need to do any extra parsing and formatting - // since the object we're given was already a fully instantiated object. - $parameters = [$passable, $stack]; - } - - $carry = method_exists($pipe, $this->method) - ? $pipe->{$this->method}(...$parameters) - : $pipe(...$parameters); - - return $this->handleCarry($carry); - } catch (Throwable $e) { - return $this->handleException($passable, $e); - } - }; - }; - } - - /** - * Parse full pipe string to get name and parameters. - * - * @param string $pipe - * @return array - */ - protected function parsePipeString($pipe) - { - [$name, $parameters] = array_pad(explode(':', $pipe, 2), 2, []); - - if (is_string($parameters)) { - $parameters = explode(',', $parameters); - } - - return [$name, $parameters]; - } - - /** - * Get the array of configured pipes. - * - * @return array - */ - protected function pipes() - { - return $this->pipes; - } - - /** - * Get the container instance. - * - * @return \Illuminate\Contracts\Container\Container - * - * @throws \RuntimeException - */ - protected function getContainer() - { - if (! $this->container) { - throw new RuntimeException('A container instance has not been passed to the Pipeline.'); - } - - return $this->container; - } - - /** - * Set the container instance. - * - * @param \Illuminate\Contracts\Container\Container $container - * @return $this - */ - public function setContainer(Container $container) - { - $this->container = $container; - - return $this; - } - - /** - * Handle the value returned from each pipe before passing it to the next. - * - * @param mixed $carry - * @return mixed - */ - protected function handleCarry($carry) - { - return $carry; - } - - /** - * Handle the given exception. - * - * @param mixed $passable - * @param \Throwable $e - * @return mixed - * - * @throws \Throwable - */ - protected function handleException($passable, Throwable $e) - { - throw $e; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Pipeline/PipelineServiceProvider.php b/vendor/laravel/framework/src/Illuminate/Pipeline/PipelineServiceProvider.php deleted file mode 100644 index 982608b6..00000000 --- a/vendor/laravel/framework/src/Illuminate/Pipeline/PipelineServiceProvider.php +++ /dev/null @@ -1,34 +0,0 @@ -app->singleton( - PipelineHubContract::class, Hub::class - ); - } - - /** - * Get the services provided by the provider. - * - * @return array - */ - public function provides() - { - return [ - PipelineHubContract::class, - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Pipeline/composer.json b/vendor/laravel/framework/src/Illuminate/Pipeline/composer.json deleted file mode 100644 index 7e640af3..00000000 --- a/vendor/laravel/framework/src/Illuminate/Pipeline/composer.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "illuminate/pipeline", - "description": "The Illuminate Pipeline package.", - "license": "MIT", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "require": { - "php": "^8.0.2", - "illuminate/contracts": "^9.0", - "illuminate/support": "^9.0" - }, - "autoload": { - "psr-4": { - "Illuminate\\Pipeline\\": "" - } - }, - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev" -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/BeanstalkdQueue.php b/vendor/laravel/framework/src/Illuminate/Queue/BeanstalkdQueue.php deleted file mode 100755 index 3f1e0a5d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/BeanstalkdQueue.php +++ /dev/null @@ -1,211 +0,0 @@ -default = $default; - $this->blockFor = $blockFor; - $this->timeToRun = $timeToRun; - $this->pheanstalk = $pheanstalk; - $this->dispatchAfterCommit = $dispatchAfterCommit; - } - - /** - * Get the size of the queue. - * - * @param string|null $queue - * @return int - */ - public function size($queue = null) - { - $queue = $this->getQueue($queue); - - return (int) $this->pheanstalk->statsTube($queue)->current_jobs_ready; - } - - /** - * Push a new job onto the queue. - * - * @param string $job - * @param mixed $data - * @param string|null $queue - * @return mixed - */ - public function push($job, $data = '', $queue = null) - { - return $this->enqueueUsing( - $job, - $this->createPayload($job, $this->getQueue($queue), $data), - $queue, - null, - function ($payload, $queue) { - return $this->pushRaw($payload, $queue); - } - ); - } - - /** - * Push a raw payload onto the queue. - * - * @param string $payload - * @param string|null $queue - * @param array $options - * @return mixed - */ - public function pushRaw($payload, $queue = null, array $options = []) - { - return $this->pheanstalk->useTube($this->getQueue($queue))->put( - $payload, Pheanstalk::DEFAULT_PRIORITY, Pheanstalk::DEFAULT_DELAY, $this->timeToRun - ); - } - - /** - * Push a new job onto the queue after (n) seconds. - * - * @param \DateTimeInterface|\DateInterval|int $delay - * @param string $job - * @param mixed $data - * @param string|null $queue - * @return mixed - */ - public function later($delay, $job, $data = '', $queue = null) - { - return $this->enqueueUsing( - $job, - $this->createPayload($job, $this->getQueue($queue), $data), - $queue, - $delay, - function ($payload, $queue, $delay) { - return $this->pheanstalk->useTube($this->getQueue($queue))->put( - $payload, - Pheanstalk::DEFAULT_PRIORITY, - $this->secondsUntil($delay), - $this->timeToRun - ); - } - ); - } - - /** - * Push an array of jobs onto the queue. - * - * @param array $jobs - * @param mixed $data - * @param string|null $queue - * @return void - */ - public function bulk($jobs, $data = '', $queue = null) - { - foreach ((array) $jobs as $job) { - if (isset($job->delay)) { - $this->later($job->delay, $job, $data, $queue); - } else { - $this->push($job, $data, $queue); - } - } - } - - /** - * Pop the next job off of the queue. - * - * @param string|null $queue - * @return \Illuminate\Contracts\Queue\Job|null - */ - public function pop($queue = null) - { - $queue = $this->getQueue($queue); - - $job = $this->pheanstalk->watchOnly($queue)->reserveWithTimeout($this->blockFor); - - if ($job instanceof PheanstalkJob) { - return new BeanstalkdJob( - $this->container, $this->pheanstalk, $job, $this->connectionName, $queue - ); - } - } - - /** - * Delete a message from the Beanstalk queue. - * - * @param string $queue - * @param string|int $id - * @return void - */ - public function deleteMessage($queue, $id) - { - $queue = $this->getQueue($queue); - - $this->pheanstalk->useTube($queue)->delete(new PheanstalkJob($id, '')); - } - - /** - * Get the queue or return the default. - * - * @param string|null $queue - * @return string - */ - public function getQueue($queue) - { - return $queue ?: $this->default; - } - - /** - * Get the underlying Pheanstalk instance. - * - * @return \Pheanstalk\Pheanstalk - */ - public function getPheanstalk() - { - return $this->pheanstalk; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedClosure.php b/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedClosure.php deleted file mode 100644 index 58155523..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedClosure.php +++ /dev/null @@ -1,111 +0,0 @@ -closure = $closure; - } - - /** - * Create a new job instance. - * - * @param \Closure $job - * @return self - */ - public static function create(Closure $job) - { - return new self(new SerializableClosure($job)); - } - - /** - * Execute the job. - * - * @param \Illuminate\Contracts\Container\Container $container - * @return void - */ - public function handle(Container $container) - { - $container->call($this->closure->getClosure(), ['job' => $this]); - } - - /** - * Add a callback to be executed if the job fails. - * - * @param callable $callback - * @return $this - */ - public function onFailure($callback) - { - $this->failureCallbacks[] = $callback instanceof Closure - ? new SerializableClosure($callback) - : $callback; - - return $this; - } - - /** - * Handle a job failure. - * - * @param \Throwable $e - * @return void - */ - public function failed($e) - { - foreach ($this->failureCallbacks as $callback) { - $callback($e); - } - } - - /** - * Get the display name for the queued job. - * - * @return string - */ - public function displayName() - { - $reflection = new ReflectionFunction($this->closure->getClosure()); - - return 'Closure ('.basename($reflection->getFileName()).':'.$reflection->getStartLine().')'; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php b/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php deleted file mode 100644 index 22fe9cca..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php +++ /dev/null @@ -1,297 +0,0 @@ -container = $container; - $this->dispatcher = $dispatcher; - } - - /** - * Handle the queued job. - * - * @param \Illuminate\Contracts\Queue\Job $job - * @param array $data - * @return void - */ - public function call(Job $job, array $data) - { - try { - $command = $this->setJobInstanceIfNecessary( - $job, $this->getCommand($data) - ); - } catch (ModelNotFoundException $e) { - return $this->handleModelNotFound($job, $e); - } - - if ($command instanceof ShouldBeUniqueUntilProcessing) { - $this->ensureUniqueJobLockIsReleased($command); - } - - $this->dispatchThroughMiddleware($job, $command); - - if (! $job->isReleased() && ! $command instanceof ShouldBeUniqueUntilProcessing) { - $this->ensureUniqueJobLockIsReleased($command); - } - - if (! $job->hasFailed() && ! $job->isReleased()) { - $this->ensureNextJobInChainIsDispatched($command); - $this->ensureSuccessfulBatchJobIsRecorded($command); - } - - if (! $job->isDeletedOrReleased()) { - $job->delete(); - } - } - - /** - * Get the command from the given payload. - * - * @param array $data - * @return mixed - * - * @throws \RuntimeException - */ - protected function getCommand(array $data) - { - if (str_starts_with($data['command'], 'O:')) { - return unserialize($data['command']); - } - - if ($this->container->bound(Encrypter::class)) { - return unserialize($this->container[Encrypter::class]->decrypt($data['command'])); - } - - throw new RuntimeException('Unable to extract job payload.'); - } - - /** - * Dispatch the given job / command through its specified middleware. - * - * @param \Illuminate\Contracts\Queue\Job $job - * @param mixed $command - * @return mixed - */ - protected function dispatchThroughMiddleware(Job $job, $command) - { - if ($command instanceof \__PHP_Incomplete_Class) { - throw new Exception('Job is incomplete class: '.json_encode($command)); - } - - return (new Pipeline($this->container))->send($command) - ->through(array_merge(method_exists($command, 'middleware') ? $command->middleware() : [], $command->middleware ?? [])) - ->then(function ($command) use ($job) { - return $this->dispatcher->dispatchNow( - $command, $this->resolveHandler($job, $command) - ); - }); - } - - /** - * Resolve the handler for the given command. - * - * @param \Illuminate\Contracts\Queue\Job $job - * @param mixed $command - * @return mixed - */ - protected function resolveHandler($job, $command) - { - $handler = $this->dispatcher->getCommandHandler($command) ?: null; - - if ($handler) { - $this->setJobInstanceIfNecessary($job, $handler); - } - - return $handler; - } - - /** - * Set the job instance of the given class if necessary. - * - * @param \Illuminate\Contracts\Queue\Job $job - * @param mixed $instance - * @return mixed - */ - protected function setJobInstanceIfNecessary(Job $job, $instance) - { - if (in_array(InteractsWithQueue::class, class_uses_recursive($instance))) { - $instance->setJob($job); - } - - return $instance; - } - - /** - * Ensure the next job in the chain is dispatched if applicable. - * - * @param mixed $command - * @return void - */ - protected function ensureNextJobInChainIsDispatched($command) - { - if (method_exists($command, 'dispatchNextJobInChain')) { - $command->dispatchNextJobInChain(); - } - } - - /** - * Ensure the batch is notified of the successful job completion. - * - * @param mixed $command - * @return void - */ - protected function ensureSuccessfulBatchJobIsRecorded($command) - { - $uses = class_uses_recursive($command); - - if (! in_array(Batchable::class, $uses) || - ! in_array(InteractsWithQueue::class, $uses)) { - return; - } - - if ($batch = $command->batch()) { - $batch->recordSuccessfulJob($command->job->uuid()); - } - } - - /** - * Ensure the lock for a unique job is released. - * - * @param mixed $command - * @return void - */ - protected function ensureUniqueJobLockIsReleased($command) - { - if ($command instanceof ShouldBeUnique) { - (new UniqueLock($this->container->make(Cache::class)))->release($command); - } - } - - /** - * Handle a model not found exception. - * - * @param \Illuminate\Contracts\Queue\Job $job - * @param \Throwable $e - * @return void - */ - protected function handleModelNotFound(Job $job, $e) - { - $class = $job->resolveName(); - - try { - $shouldDelete = (new ReflectionClass($class)) - ->getDefaultProperties()['deleteWhenMissingModels'] ?? false; - } catch (Exception $e) { - $shouldDelete = false; - } - - if ($shouldDelete) { - return $job->delete(); - } - - return $job->fail($e); - } - - /** - * Call the failed method on the job instance. - * - * The exception that caused the failure will be passed. - * - * @param array $data - * @param \Throwable|null $e - * @param string $uuid - * @return void - */ - public function failed(array $data, $e, string $uuid) - { - $command = $this->getCommand($data); - - if (! $command instanceof ShouldBeUniqueUntilProcessing) { - $this->ensureUniqueJobLockIsReleased($command); - } - - if ($command instanceof \__PHP_Incomplete_Class) { - return; - } - - $this->ensureFailedBatchJobIsRecorded($uuid, $command, $e); - $this->ensureChainCatchCallbacksAreInvoked($uuid, $command, $e); - - if (method_exists($command, 'failed')) { - $command->failed($e); - } - } - - /** - * Ensure the batch is notified of the failed job. - * - * @param string $uuid - * @param mixed $command - * @param \Throwable $e - * @return void - */ - protected function ensureFailedBatchJobIsRecorded(string $uuid, $command, $e) - { - if (! in_array(Batchable::class, class_uses_recursive($command))) { - return; - } - - if ($batch = $command->batch()) { - $batch->recordFailedJob($uuid, $e); - } - } - - /** - * Ensure the chained job catch callbacks are invoked. - * - * @param string $uuid - * @param mixed $command - * @param \Throwable $e - * @return void - */ - protected function ensureChainCatchCallbacksAreInvoked(string $uuid, $command, $e) - { - if (method_exists($command, 'invokeChainCatchCallbacks')) { - $command->invokeChainCatchCallbacks($e); - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Capsule/Manager.php b/vendor/laravel/framework/src/Illuminate/Queue/Capsule/Manager.php deleted file mode 100644 index c5ceb872..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Capsule/Manager.php +++ /dev/null @@ -1,187 +0,0 @@ -setupContainer($container ?: new Container); - - // Once we have the container setup, we will set up the default configuration - // options in the container "config" bindings. This'll just make the queue - // manager behave correctly since all the correct bindings are in place. - $this->setupDefaultConfiguration(); - - $this->setupManager(); - - $this->registerConnectors(); - } - - /** - * Setup the default queue configuration options. - * - * @return void - */ - protected function setupDefaultConfiguration() - { - $this->container['config']['queue.default'] = 'default'; - } - - /** - * Build the queue manager instance. - * - * @return void - */ - protected function setupManager() - { - $this->manager = new QueueManager($this->container); - } - - /** - * Register the default connectors that the component ships with. - * - * @return void - */ - protected function registerConnectors() - { - $provider = new QueueServiceProvider($this->container); - - $provider->registerConnectors($this->manager); - } - - /** - * Get a connection instance from the global manager. - * - * @param string|null $connection - * @return \Illuminate\Contracts\Queue\Queue - */ - public static function connection($connection = null) - { - return static::$instance->getConnection($connection); - } - - /** - * Push a new job onto the queue. - * - * @param string $job - * @param mixed $data - * @param string|null $queue - * @param string|null $connection - * @return mixed - */ - public static function push($job, $data = '', $queue = null, $connection = null) - { - return static::$instance->connection($connection)->push($job, $data, $queue); - } - - /** - * Push a new an array of jobs onto the queue. - * - * @param array $jobs - * @param mixed $data - * @param string|null $queue - * @param string|null $connection - * @return mixed - */ - public static function bulk($jobs, $data = '', $queue = null, $connection = null) - { - return static::$instance->connection($connection)->bulk($jobs, $data, $queue); - } - - /** - * Push a new job onto the queue after (n) seconds. - * - * @param \DateTimeInterface|\DateInterval|int $delay - * @param string $job - * @param mixed $data - * @param string|null $queue - * @param string|null $connection - * @return mixed - */ - public static function later($delay, $job, $data = '', $queue = null, $connection = null) - { - return static::$instance->connection($connection)->later($delay, $job, $data, $queue); - } - - /** - * Get a registered connection instance. - * - * @param string|null $name - * @return \Illuminate\Contracts\Queue\Queue - */ - public function getConnection($name = null) - { - return $this->manager->connection($name); - } - - /** - * Register a connection with the manager. - * - * @param array $config - * @param string $name - * @return void - */ - public function addConnection(array $config, $name = 'default') - { - $this->container['config']["queue.connections.{$name}"] = $config; - } - - /** - * Get the queue manager instance. - * - * @return \Illuminate\Queue\QueueManager - */ - public function getQueueManager() - { - return $this->manager; - } - - /** - * Pass dynamic instance methods to the manager. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - return $this->manager->$method(...$parameters); - } - - /** - * Dynamically pass methods to the default connection. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public static function __callStatic($method, $parameters) - { - return static::connection()->$method(...$parameters); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Connectors/BeanstalkdConnector.php b/vendor/laravel/framework/src/Illuminate/Queue/Connectors/BeanstalkdConnector.php deleted file mode 100755 index fdcdb355..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Connectors/BeanstalkdConnector.php +++ /dev/null @@ -1,42 +0,0 @@ -pheanstalk($config), - $config['queue'], - $config['retry_after'] ?? Pheanstalk::DEFAULT_TTR, - $config['block_for'] ?? 0, - $config['after_commit'] ?? null - ); - } - - /** - * Create a Pheanstalk instance. - * - * @param array $config - * @return \Pheanstalk\Pheanstalk - */ - protected function pheanstalk(array $config) - { - return Pheanstalk::create( - $config['host'], - $config['port'] ?? Pheanstalk::DEFAULT_PORT, - $config['timeout'] ?? Connection::DEFAULT_CONNECT_TIMEOUT - ); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Connectors/ConnectorInterface.php b/vendor/laravel/framework/src/Illuminate/Queue/Connectors/ConnectorInterface.php deleted file mode 100755 index 617bf09d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Connectors/ConnectorInterface.php +++ /dev/null @@ -1,14 +0,0 @@ -connections = $connections; - } - - /** - * Establish a queue connection. - * - * @param array $config - * @return \Illuminate\Contracts\Queue\Queue - */ - public function connect(array $config) - { - return new DatabaseQueue( - $this->connections->connection($config['connection'] ?? null), - $config['table'], - $config['queue'], - $config['retry_after'] ?? 60, - $config['after_commit'] ?? null - ); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Connectors/NullConnector.php b/vendor/laravel/framework/src/Illuminate/Queue/Connectors/NullConnector.php deleted file mode 100644 index 39de4800..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Connectors/NullConnector.php +++ /dev/null @@ -1,19 +0,0 @@ -redis = $redis; - $this->connection = $connection; - } - - /** - * Establish a queue connection. - * - * @param array $config - * @return \Illuminate\Contracts\Queue\Queue - */ - public function connect(array $config) - { - return new RedisQueue( - $this->redis, $config['queue'], - $config['connection'] ?? $this->connection, - $config['retry_after'] ?? 60, - $config['block_for'] ?? null, - $config['after_commit'] ?? null, - $config['migration_batch_size'] ?? -1 - ); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Connectors/SqsConnector.php b/vendor/laravel/framework/src/Illuminate/Queue/Connectors/SqsConnector.php deleted file mode 100755 index d70bd8e5..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Connectors/SqsConnector.php +++ /dev/null @@ -1,52 +0,0 @@ -getDefaultConfiguration($config); - - if (! empty($config['key']) && ! empty($config['secret'])) { - $config['credentials'] = Arr::only($config, ['key', 'secret', 'token']); - } - - return new SqsQueue( - new SqsClient( - Arr::except($config, ['token']) - ), - $config['queue'], - $config['prefix'] ?? '', - $config['suffix'] ?? '', - $config['after_commit'] ?? null - ); - } - - /** - * Get the default configuration for SQS. - * - * @param array $config - * @return array - */ - protected function getDefaultConfiguration(array $config) - { - return array_merge([ - 'version' => 'latest', - 'http' => [ - 'timeout' => 60, - 'connect_timeout' => 60, - ], - ], $config); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Connectors/SyncConnector.php b/vendor/laravel/framework/src/Illuminate/Queue/Connectors/SyncConnector.php deleted file mode 100755 index 4269b803..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Connectors/SyncConnector.php +++ /dev/null @@ -1,19 +0,0 @@ -files = $files; - $this->composer = $composer; - } - - /** - * Execute the console command. - * - * @return void - */ - public function handle() - { - $table = $this->laravel['config']['queue.batching.table'] ?? 'job_batches'; - - $this->replaceMigration( - $this->createBaseMigration($table), $table - ); - - $this->components->info('Migration created successfully.'); - - $this->composer->dumpAutoloads(); - } - - /** - * Create a base migration file for the table. - * - * @param string $table - * @return string - */ - protected function createBaseMigration($table = 'job_batches') - { - return $this->laravel['migration.creator']->create( - 'create_'.$table.'_table', $this->laravel->databasePath().'/migrations' - ); - } - - /** - * Replace the generated migration with the batches job table stub. - * - * @param string $path - * @param string $table - * @return void - */ - protected function replaceMigration($path, $table) - { - $stub = str_replace( - '{{table}}', $table, $this->files->get(__DIR__.'/stubs/batches.stub') - ); - - $this->files->put($path, $stub); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Console/ClearCommand.php b/vendor/laravel/framework/src/Illuminate/Queue/Console/ClearCommand.php deleted file mode 100644 index 8b48c3e0..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Console/ClearCommand.php +++ /dev/null @@ -1,113 +0,0 @@ -confirmToProceed()) { - return 1; - } - - $connection = $this->argument('connection') - ?: $this->laravel['config']['queue.default']; - - // We need to get the right queue for the connection which is set in the queue - // configuration file for the application. We will pull it based on the set - // connection being run for the queue operation currently being executed. - $queueName = $this->getQueue($connection); - - $queue = $this->laravel['queue']->connection($connection); - - if ($queue instanceof ClearableQueue) { - $count = $queue->clear($queueName); - - $this->components->info('Cleared '.$count.' jobs from the ['.$queueName.'] queue'); - } else { - $this->components->error('Clearing queues is not supported on ['.(new ReflectionClass($queue))->getShortName().']'); - } - - return 0; - } - - /** - * Get the queue name to clear. - * - * @param string $connection - * @return string - */ - protected function getQueue($connection) - { - return $this->option('queue') ?: $this->laravel['config']->get( - "queue.connections.{$connection}.queue", 'default' - ); - } - - /** - * Get the console command arguments. - * - * @return array - */ - protected function getArguments() - { - return [ - ['connection', InputArgument::OPTIONAL, 'The name of the queue connection to clear'], - ]; - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['queue', null, InputOption::VALUE_OPTIONAL, 'The name of the queue to clear'], - - ['force', null, InputOption::VALUE_NONE, 'Force the operation to run when in production'], - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Console/FailedTableCommand.php b/vendor/laravel/framework/src/Illuminate/Queue/Console/FailedTableCommand.php deleted file mode 100644 index f3f20cca..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Console/FailedTableCommand.php +++ /dev/null @@ -1,111 +0,0 @@ -files = $files; - $this->composer = $composer; - } - - /** - * Execute the console command. - * - * @return void - */ - public function handle() - { - $table = $this->laravel['config']['queue.failed.table']; - - $this->replaceMigration( - $this->createBaseMigration($table), $table - ); - - $this->components->info('Migration created successfully.'); - - $this->composer->dumpAutoloads(); - } - - /** - * Create a base migration file for the table. - * - * @param string $table - * @return string - */ - protected function createBaseMigration($table = 'failed_jobs') - { - return $this->laravel['migration.creator']->create( - 'create_'.$table.'_table', $this->laravel->databasePath().'/migrations' - ); - } - - /** - * Replace the generated migration with the failed job table stub. - * - * @param string $path - * @param string $table - * @return void - */ - protected function replaceMigration($path, $table) - { - $stub = str_replace( - '{{table}}', $table, $this->files->get(__DIR__.'/stubs/failed_jobs.stub') - ); - - $this->files->put($path, $stub); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Console/FlushFailedCommand.php b/vendor/laravel/framework/src/Illuminate/Queue/Console/FlushFailedCommand.php deleted file mode 100644 index 86a5d16c..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Console/FlushFailedCommand.php +++ /dev/null @@ -1,53 +0,0 @@ -laravel['queue.failer']->flush($this->option('hours')); - - if ($this->option('hours')) { - $this->components->info("All jobs that failed more than {$this->option('hours')} hours ago have been deleted successfully."); - - return; - } - - $this->components->info('All failed jobs deleted successfully.'); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Console/ForgetFailedCommand.php b/vendor/laravel/framework/src/Illuminate/Queue/Console/ForgetFailedCommand.php deleted file mode 100644 index f4625e11..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Console/ForgetFailedCommand.php +++ /dev/null @@ -1,49 +0,0 @@ -laravel['queue.failer']->forget($this->argument('id'))) { - $this->components->info('Failed job deleted successfully.'); - } else { - $this->components->error('No failed job matches the given ID.'); - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Console/ListFailedCommand.php b/vendor/laravel/framework/src/Illuminate/Queue/Console/ListFailedCommand.php deleted file mode 100644 index 4ccaf30e..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Console/ListFailedCommand.php +++ /dev/null @@ -1,134 +0,0 @@ -getFailedJobs()) === 0) { - return $this->components->info('No failed jobs found.'); - } - - $this->newLine(); - $this->displayFailedJobs($jobs); - $this->newLine(); - } - - /** - * Compile the failed jobs into a displayable format. - * - * @return array - */ - protected function getFailedJobs() - { - $failed = $this->laravel['queue.failer']->all(); - - return collect($failed)->map(function ($failed) { - return $this->parseFailedJob((array) $failed); - })->filter()->all(); - } - - /** - * Parse the failed job row. - * - * @param array $failed - * @return array - */ - protected function parseFailedJob(array $failed) - { - $row = array_values(Arr::except($failed, ['payload', 'exception'])); - - array_splice($row, 3, 0, $this->extractJobName($failed['payload']) ?: ''); - - return $row; - } - - /** - * Extract the failed job name from payload. - * - * @param string $payload - * @return string|null - */ - private function extractJobName($payload) - { - $payload = json_decode($payload, true); - - if ($payload && (! isset($payload['data']['command']))) { - return $payload['job'] ?? null; - } elseif ($payload && isset($payload['data']['command'])) { - return $this->matchJobName($payload); - } - } - - /** - * Match the job name from the payload. - * - * @param array $payload - * @return string|null - */ - protected function matchJobName($payload) - { - preg_match('/"([^"]+)"/', $payload['data']['command'], $matches); - - return $matches[1] ?? $payload['job'] ?? null; - } - - /** - * Display the failed jobs in the console. - * - * @param array $jobs - * @return void - */ - protected function displayFailedJobs(array $jobs) - { - collect($jobs)->each( - fn ($job) => $this->components->twoColumnDetail( - sprintf('%s %s', $job[4], $job[0]), - sprintf('%s@%s %s', $job[1], $job[2], $job[3]) - ), - ); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Console/ListenCommand.php b/vendor/laravel/framework/src/Illuminate/Queue/Console/ListenCommand.php deleted file mode 100755 index 2952c627..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Console/ListenCommand.php +++ /dev/null @@ -1,141 +0,0 @@ -setOutputHandler($this->listener = $listener); - } - - /** - * Execute the console command. - * - * @return void - */ - public function handle() - { - // We need to get the right queue for the connection which is set in the queue - // configuration file for the application. We will pull it based on the set - // connection being run for the queue operation currently being executed. - $queue = $this->getQueue( - $connection = $this->input->getArgument('connection') - ); - - $this->components->info(sprintf('Processing jobs from the [%s] %s.', $queue, str('queue')->plural(explode(',', $queue)))); - - $this->listener->listen( - $connection, $queue, $this->gatherOptions() - ); - } - - /** - * Get the name of the queue connection to listen on. - * - * @param string $connection - * @return string - */ - protected function getQueue($connection) - { - $connection = $connection ?: $this->laravel['config']['queue.default']; - - return $this->input->getOption('queue') ?: $this->laravel['config']->get( - "queue.connections.{$connection}.queue", 'default' - ); - } - - /** - * Get the listener options for the command. - * - * @return \Illuminate\Queue\ListenerOptions - */ - protected function gatherOptions() - { - $backoff = $this->hasOption('backoff') - ? $this->option('backoff') - : $this->option('delay'); - - return new ListenerOptions( - name: $this->option('name'), - environment: $this->option('env'), - backoff: $backoff, - memory: $this->option('memory'), - timeout: $this->option('timeout'), - sleep: $this->option('sleep'), - rest: $this->option('rest'), - maxTries: $this->option('tries'), - force: $this->option('force') - ); - } - - /** - * Set the options on the queue listener. - * - * @param \Illuminate\Queue\Listener $listener - * @return void - */ - protected function setOutputHandler(Listener $listener) - { - $listener->setOutputHandler(function ($type, $line) { - $this->output->write($line); - }); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Console/MonitorCommand.php b/vendor/laravel/framework/src/Illuminate/Queue/Console/MonitorCommand.php deleted file mode 100644 index 527d6a88..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Console/MonitorCommand.php +++ /dev/null @@ -1,160 +0,0 @@ -manager = $manager; - $this->events = $events; - } - - /** - * Execute the console command. - * - * @return void - */ - public function handle() - { - $queues = $this->parseQueues($this->argument('queues')); - - $this->displaySizes($queues); - - $this->dispatchEvents($queues); - } - - /** - * Parse the queues into an array of the connections and queues. - * - * @param string $queues - * @return \Illuminate\Support\Collection - */ - protected function parseQueues($queues) - { - return collect(explode(',', $queues))->map(function ($queue) { - [$connection, $queue] = array_pad(explode(':', $queue, 2), 2, null); - - if (! isset($queue)) { - $queue = $connection; - $connection = $this->laravel['config']['queue.default']; - } - - return [ - 'connection' => $connection, - 'queue' => $queue, - 'size' => $size = $this->manager->connection($connection)->size($queue), - 'status' => $size >= $this->option('max') ? 'ALERT' : 'OK', - ]; - }); - } - - /** - * Display the queue sizes in the console. - * - * @param \Illuminate\Support\Collection $queues - * @return void - */ - protected function displaySizes(Collection $queues) - { - $this->newLine(); - - $this->components->twoColumnDetail('Queue name', 'Size / Status'); - - $queues->each(function ($queue) { - $status = '['.$queue['size'].'] '.$queue['status']; - - $this->components->twoColumnDetail($queue['queue'], $status); - }); - - $this->newLine(); - } - - /** - * Fire the monitoring events. - * - * @param \Illuminate\Support\Collection $queues - * @return void - */ - protected function dispatchEvents(Collection $queues) - { - foreach ($queues as $queue) { - if ($queue['status'] == 'OK') { - continue; - } - - $this->events->dispatch( - new QueueBusy( - $queue['connection'], - $queue['queue'], - $queue['size'], - ) - ); - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Console/PruneBatchesCommand.php b/vendor/laravel/framework/src/Illuminate/Queue/Console/PruneBatchesCommand.php deleted file mode 100644 index 5e2d3233..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Console/PruneBatchesCommand.php +++ /dev/null @@ -1,80 +0,0 @@ -laravel[BatchRepository::class]; - - $count = 0; - - if ($repository instanceof PrunableBatchRepository) { - $count = $repository->prune(Carbon::now()->subHours($this->option('hours'))); - } - - $this->components->info("{$count} entries deleted."); - - if ($this->option('unfinished')) { - $count = 0; - - if ($repository instanceof DatabaseBatchRepository) { - $count = $repository->pruneUnfinished(Carbon::now()->subHours($this->option('unfinished'))); - } - - $this->components->info("{$count} unfinished entries deleted."); - } - - if ($this->option('cancelled')) { - $count = 0; - - if ($repository instanceof DatabaseBatchRepository) { - $count = $repository->pruneCancelled(Carbon::now()->subHours($this->option('cancelled'))); - } - - $this->components->info("{$count} cancelled entries deleted."); - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Console/PruneFailedJobsCommand.php b/vendor/laravel/framework/src/Illuminate/Queue/Console/PruneFailedJobsCommand.php deleted file mode 100644 index 61f7903b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Console/PruneFailedJobsCommand.php +++ /dev/null @@ -1,58 +0,0 @@ -laravel['queue.failer']; - - if ($failer instanceof PrunableFailedJobProvider) { - $count = $failer->prune(Carbon::now()->subHours($this->option('hours'))); - } else { - $this->components->error('The ['.class_basename($failer).'] failed job storage driver does not support pruning.'); - - return 1; - } - - $this->components->info("{$count} entries deleted."); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Console/RestartCommand.php b/vendor/laravel/framework/src/Illuminate/Queue/Console/RestartCommand.php deleted file mode 100644 index 6dfbcb1f..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Console/RestartCommand.php +++ /dev/null @@ -1,71 +0,0 @@ -cache = $cache; - } - - /** - * Execute the console command. - * - * @return void - */ - public function handle() - { - $this->cache->forever('illuminate:queue:restart', $this->currentTime()); - - $this->components->info('Broadcasting queue restart signal.'); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Console/RetryBatchCommand.php b/vendor/laravel/framework/src/Illuminate/Queue/Console/RetryBatchCommand.php deleted file mode 100644 index b99e0020..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Console/RetryBatchCommand.php +++ /dev/null @@ -1,64 +0,0 @@ -laravel[BatchRepository::class]->find($id = $this->argument('id')); - - if (! $batch) { - $this->components->error("Unable to find a batch with ID [{$id}]."); - - return 1; - } elseif (empty($batch->failedJobIds)) { - $this->components->error('The given batch does not contain any failed jobs.'); - - return 1; - } - - $this->components->info("Pushing failed queue jobs of the batch [$id] back onto the queue."); - - foreach ($batch->failedJobIds as $failedJobId) { - $this->components->task($failedJobId, fn () => $this->callSilent('queue:retry', ['id' => $failedJobId]) == 0); - } - - $this->newLine(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Console/RetryCommand.php b/vendor/laravel/framework/src/Illuminate/Queue/Console/RetryCommand.php deleted file mode 100644 index ef6a5ed4..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Console/RetryCommand.php +++ /dev/null @@ -1,205 +0,0 @@ -getJobIds()) > 0; - - if ($jobsFound) { - $this->components->info('Pushing failed queue jobs back onto the queue.'); - } - - foreach ($ids as $id) { - $job = $this->laravel['queue.failer']->find($id); - - if (is_null($job)) { - $this->components->error("Unable to find failed job with ID [{$id}]."); - } else { - $this->laravel['events']->dispatch(new JobRetryRequested($job)); - - $this->components->task($id, fn () => $this->retryJob($job)); - - $this->laravel['queue.failer']->forget($id); - } - } - - $jobsFound ? $this->newLine() : $this->components->info('No retryable jobs found.'); - } - - /** - * Get the job IDs to be retried. - * - * @return array - */ - protected function getJobIds() - { - $ids = (array) $this->argument('id'); - - if (count($ids) === 1 && $ids[0] === 'all') { - return Arr::pluck($this->laravel['queue.failer']->all(), 'id'); - } - - if ($queue = $this->option('queue')) { - return $this->getJobIdsByQueue($queue); - } - - if ($ranges = (array) $this->option('range')) { - $ids = array_merge($ids, $this->getJobIdsByRanges($ranges)); - } - - return array_values(array_filter(array_unique($ids))); - } - - /** - * Get the job IDs by queue, if applicable. - * - * @param string $queue - * @return array - */ - protected function getJobIdsByQueue($queue) - { - $ids = collect($this->laravel['queue.failer']->all()) - ->where('queue', $queue) - ->pluck('id') - ->toArray(); - - if (count($ids) === 0) { - $this->components->error("Unable to find failed jobs for queue [{$queue}]."); - } - - return $ids; - } - - /** - * Get the job IDs ranges, if applicable. - * - * @param array $ranges - * @return array - */ - protected function getJobIdsByRanges(array $ranges) - { - $ids = []; - - foreach ($ranges as $range) { - if (preg_match('/^[0-9]+\-[0-9]+$/', $range)) { - $ids = array_merge($ids, range(...explode('-', $range))); - } - } - - return $ids; - } - - /** - * Retry the queue job. - * - * @param \stdClass $job - * @return void - */ - protected function retryJob($job) - { - $this->laravel['queue']->connection($job->connection)->pushRaw( - $this->refreshRetryUntil($this->resetAttempts($job->payload)), $job->queue - ); - } - - /** - * Reset the payload attempts. - * - * Applicable to Redis and other jobs which store attempts in their payload. - * - * @param string $payload - * @return string - */ - protected function resetAttempts($payload) - { - $payload = json_decode($payload, true); - - if (isset($payload['attempts'])) { - $payload['attempts'] = 0; - } - - return json_encode($payload); - } - - /** - * Refresh the "retry until" timestamp for the job. - * - * @param string $payload - * @return string - * - * @throws \RuntimeException - */ - protected function refreshRetryUntil($payload) - { - $payload = json_decode($payload, true); - - if (! isset($payload['data']['command'])) { - return json_encode($payload); - } - - if (str_starts_with($payload['data']['command'], 'O:')) { - $instance = unserialize($payload['data']['command']); - } elseif ($this->laravel->bound(Encrypter::class)) { - $instance = unserialize($this->laravel->make(Encrypter::class)->decrypt($payload['data']['command'])); - } - - if (! isset($instance)) { - throw new RuntimeException('Unable to extract job payload.'); - } - - if (is_object($instance) && ! $instance instanceof \__PHP_Incomplete_Class && method_exists($instance, 'retryUntil')) { - $retryUntil = $instance->retryUntil(); - - $payload['retryUntil'] = $retryUntil instanceof DateTimeInterface - ? $retryUntil->getTimestamp() - : $retryUntil; - } - - return json_encode($payload); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Console/TableCommand.php b/vendor/laravel/framework/src/Illuminate/Queue/Console/TableCommand.php deleted file mode 100644 index aa25dafe..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Console/TableCommand.php +++ /dev/null @@ -1,111 +0,0 @@ -files = $files; - $this->composer = $composer; - } - - /** - * Execute the console command. - * - * @return void - */ - public function handle() - { - $table = $this->laravel['config']['queue.connections.database.table']; - - $this->replaceMigration( - $this->createBaseMigration($table), $table - ); - - $this->components->info('Migration created successfully.'); - - $this->composer->dumpAutoloads(); - } - - /** - * Create a base migration file for the table. - * - * @param string $table - * @return string - */ - protected function createBaseMigration($table = 'jobs') - { - return $this->laravel['migration.creator']->create( - 'create_'.$table.'_table', $this->laravel->databasePath().'/migrations' - ); - } - - /** - * Replace the generated migration with the job table stub. - * - * @param string $path - * @param string $table - * @return void - */ - protected function replaceMigration($path, $table) - { - $stub = str_replace( - '{{table}}', $table, $this->files->get(__DIR__.'/stubs/jobs.stub') - ); - - $this->files->put($path, $stub); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php b/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php deleted file mode 100644 index abf580fd..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php +++ /dev/null @@ -1,283 +0,0 @@ -cache = $cache; - $this->worker = $worker; - } - - /** - * Execute the console command. - * - * @return int|null - */ - public function handle() - { - if ($this->downForMaintenance() && $this->option('once')) { - return $this->worker->sleep($this->option('sleep')); - } - - // We'll listen to the processed and failed events so we can write information - // to the console as jobs are processed, which will let the developer watch - // which jobs are coming through a queue and be informed on its progress. - $this->listenForEvents(); - - $connection = $this->argument('connection') - ?: $this->laravel['config']['queue.default']; - - // We need to get the right queue for the connection which is set in the queue - // configuration file for the application. We will pull it based on the set - // connection being run for the queue operation currently being executed. - $queue = $this->getQueue($connection); - - if (Terminal::hasSttyAvailable()) { - $this->components->info( - sprintf('Processing jobs from the [%s] %s.', $queue, str('queue')->plural(explode(',', $queue))) - ); - } - - return $this->runWorker( - $connection, $queue - ); - } - - /** - * Run the worker instance. - * - * @param string $connection - * @param string $queue - * @return int|null - */ - protected function runWorker($connection, $queue) - { - return $this->worker - ->setName($this->option('name')) - ->setCache($this->cache) - ->{$this->option('once') ? 'runNextJob' : 'daemon'}( - $connection, $queue, $this->gatherWorkerOptions() - ); - } - - /** - * Gather all of the queue worker options as a single object. - * - * @return \Illuminate\Queue\WorkerOptions - */ - protected function gatherWorkerOptions() - { - return new WorkerOptions( - $this->option('name'), - max($this->option('backoff'), $this->option('delay')), - $this->option('memory'), - $this->option('timeout'), - $this->option('sleep'), - $this->option('tries'), - $this->option('force'), - $this->option('stop-when-empty'), - $this->option('max-jobs'), - $this->option('max-time'), - $this->option('rest') - ); - } - - /** - * Listen for the queue events in order to update the console output. - * - * @return void - */ - protected function listenForEvents() - { - $this->laravel['events']->listen(JobProcessing::class, function ($event) { - $this->writeOutput($event->job, 'starting'); - }); - - $this->laravel['events']->listen(JobProcessed::class, function ($event) { - $this->writeOutput($event->job, 'success'); - }); - - $this->laravel['events']->listen(JobReleasedAfterException::class, function ($event) { - $this->writeOutput($event->job, 'released_after_exception'); - }); - - $this->laravel['events']->listen(JobFailed::class, function ($event) { - $this->writeOutput($event->job, 'failed'); - - $this->logFailedJob($event); - }); - } - - /** - * Write the status output for the queue worker. - * - * @param \Illuminate\Contracts\Queue\Job $job - * @param string $status - * @return void - */ - protected function writeOutput(Job $job, $status) - { - $this->output->write(sprintf( - ' %s %s%s', - Carbon::now()->format('Y-m-d H:i:s'), - $job->resolveName(), - $this->output->isVerbose() - ? sprintf(' %s', $job->getJobId()) - : '' - )); - - if ($status == 'starting') { - $this->latestStartedAt = microtime(true); - - $dots = max(terminal()->width() - mb_strlen($job->resolveName()) - ( - $this->output->isVerbose() ? (mb_strlen($job->getJobId()) + 1) : 0 - ) - 33, 0); - - $this->output->write(' '.str_repeat('.', $dots)); - - return $this->output->writeln(' RUNNING'); - } - - $runTime = number_format((microtime(true) - $this->latestStartedAt) * 1000, 2).'ms'; - - $dots = max(terminal()->width() - mb_strlen($job->resolveName()) - ( - $this->output->isVerbose() ? (mb_strlen($job->getJobId()) + 1) : 0 - ) - mb_strlen($runTime) - 31, 0); - - $this->output->write(' '.str_repeat('.', $dots)); - $this->output->write(" $runTime"); - - $this->output->writeln(match ($status) { - 'success' => ' DONE', - 'released_after_exception' => ' FAIL', - default => ' FAIL', - }); - } - - /** - * Store a failed job event. - * - * @param \Illuminate\Queue\Events\JobFailed $event - * @return void - */ - protected function logFailedJob(JobFailed $event) - { - $this->laravel['queue.failer']->log( - $event->connectionName, - $event->job->getQueue(), - $event->job->getRawBody(), - $event->exception - ); - } - - /** - * Get the queue name for the worker. - * - * @param string $connection - * @return string - */ - protected function getQueue($connection) - { - return $this->option('queue') ?: $this->laravel['config']->get( - "queue.connections.{$connection}.queue", 'default' - ); - } - - /** - * Determine if the worker should run in maintenance mode. - * - * @return bool - */ - protected function downForMaintenance() - { - return $this->option('force') ? false : $this->laravel->isDownForMaintenance(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Console/stubs/batches.stub b/vendor/laravel/framework/src/Illuminate/Queue/Console/stubs/batches.stub deleted file mode 100644 index c3ff2317..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Console/stubs/batches.stub +++ /dev/null @@ -1,39 +0,0 @@ -string('id')->primary(); - $table->string('name'); - $table->integer('total_jobs'); - $table->integer('pending_jobs'); - $table->integer('failed_jobs'); - $table->longText('failed_job_ids'); - $table->mediumText('options')->nullable(); - $table->integer('cancelled_at')->nullable(); - $table->integer('created_at'); - $table->integer('finished_at')->nullable(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('{{table}}'); - } -}; diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Console/stubs/failed_jobs.stub b/vendor/laravel/framework/src/Illuminate/Queue/Console/stubs/failed_jobs.stub deleted file mode 100644 index c804dd6d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Console/stubs/failed_jobs.stub +++ /dev/null @@ -1,36 +0,0 @@ -id(); - $table->string('uuid')->unique(); - $table->text('connection'); - $table->text('queue'); - $table->longText('payload'); - $table->longText('exception'); - $table->timestamp('failed_at')->useCurrent(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('{{table}}'); - } -}; diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Console/stubs/jobs.stub b/vendor/laravel/framework/src/Illuminate/Queue/Console/stubs/jobs.stub deleted file mode 100644 index 5ea6d0cb..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Console/stubs/jobs.stub +++ /dev/null @@ -1,36 +0,0 @@ -bigIncrements('id'); - $table->string('queue')->index(); - $table->longText('payload'); - $table->unsignedTinyInteger('attempts'); - $table->unsignedInteger('reserved_at')->nullable(); - $table->unsignedInteger('available_at'); - $table->unsignedInteger('created_at'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('{{table}}'); - } -}; diff --git a/vendor/laravel/framework/src/Illuminate/Queue/DatabaseQueue.php b/vendor/laravel/framework/src/Illuminate/Queue/DatabaseQueue.php deleted file mode 100644 index bce025c5..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/DatabaseQueue.php +++ /dev/null @@ -1,413 +0,0 @@ -table = $table; - $this->default = $default; - $this->database = $database; - $this->retryAfter = $retryAfter; - $this->dispatchAfterCommit = $dispatchAfterCommit; - } - - /** - * Get the size of the queue. - * - * @param string|null $queue - * @return int - */ - public function size($queue = null) - { - return $this->database->table($this->table) - ->where('queue', $this->getQueue($queue)) - ->count(); - } - - /** - * Push a new job onto the queue. - * - * @param string $job - * @param mixed $data - * @param string|null $queue - * @return mixed - */ - public function push($job, $data = '', $queue = null) - { - return $this->enqueueUsing( - $job, - $this->createPayload($job, $this->getQueue($queue), $data), - $queue, - null, - function ($payload, $queue) { - return $this->pushToDatabase($queue, $payload); - } - ); - } - - /** - * Push a raw payload onto the queue. - * - * @param string $payload - * @param string|null $queue - * @param array $options - * @return mixed - */ - public function pushRaw($payload, $queue = null, array $options = []) - { - return $this->pushToDatabase($queue, $payload); - } - - /** - * Push a new job onto the queue after (n) seconds. - * - * @param \DateTimeInterface|\DateInterval|int $delay - * @param string $job - * @param mixed $data - * @param string|null $queue - * @return void - */ - public function later($delay, $job, $data = '', $queue = null) - { - return $this->enqueueUsing( - $job, - $this->createPayload($job, $this->getQueue($queue), $data), - $queue, - $delay, - function ($payload, $queue, $delay) { - return $this->pushToDatabase($queue, $payload, $delay); - } - ); - } - - /** - * Push an array of jobs onto the queue. - * - * @param array $jobs - * @param mixed $data - * @param string|null $queue - * @return mixed - */ - public function bulk($jobs, $data = '', $queue = null) - { - $queue = $this->getQueue($queue); - - $now = $this->availableAt(); - - return $this->database->table($this->table)->insert(collect((array) $jobs)->map( - function ($job) use ($queue, $data, $now) { - return $this->buildDatabaseRecord( - $queue, - $this->createPayload($job, $this->getQueue($queue), $data), - isset($job->delay) ? $this->availableAt($job->delay) : $now, - ); - } - )->all()); - } - - /** - * Release a reserved job back onto the queue after (n) seconds. - * - * @param string $queue - * @param \Illuminate\Queue\Jobs\DatabaseJobRecord $job - * @param int $delay - * @return mixed - */ - public function release($queue, $job, $delay) - { - return $this->pushToDatabase($queue, $job->payload, $delay, $job->attempts); - } - - /** - * Push a raw payload to the database with a given delay of (n) seconds. - * - * @param string|null $queue - * @param string $payload - * @param \DateTimeInterface|\DateInterval|int $delay - * @param int $attempts - * @return mixed - */ - protected function pushToDatabase($queue, $payload, $delay = 0, $attempts = 0) - { - return $this->database->table($this->table)->insertGetId($this->buildDatabaseRecord( - $this->getQueue($queue), $payload, $this->availableAt($delay), $attempts - )); - } - - /** - * Create an array to insert for the given job. - * - * @param string|null $queue - * @param string $payload - * @param int $availableAt - * @param int $attempts - * @return array - */ - protected function buildDatabaseRecord($queue, $payload, $availableAt, $attempts = 0) - { - return [ - 'queue' => $queue, - 'attempts' => $attempts, - 'reserved_at' => null, - 'available_at' => $availableAt, - 'created_at' => $this->currentTime(), - 'payload' => $payload, - ]; - } - - /** - * Pop the next job off of the queue. - * - * @param string|null $queue - * @return \Illuminate\Contracts\Queue\Job|null - * - * @throws \Throwable - */ - public function pop($queue = null) - { - $queue = $this->getQueue($queue); - - return $this->database->transaction(function () use ($queue) { - if ($job = $this->getNextAvailableJob($queue)) { - return $this->marshalJob($queue, $job); - } - }); - } - - /** - * Get the next available job for the queue. - * - * @param string|null $queue - * @return \Illuminate\Queue\Jobs\DatabaseJobRecord|null - */ - protected function getNextAvailableJob($queue) - { - $job = $this->database->table($this->table) - ->lock($this->getLockForPopping()) - ->where('queue', $this->getQueue($queue)) - ->where(function ($query) { - $this->isAvailable($query); - $this->isReservedButExpired($query); - }) - ->orderBy('id', 'asc') - ->first(); - - return $job ? new DatabaseJobRecord((object) $job) : null; - } - - /** - * Get the lock required for popping the next job. - * - * @return string|bool - */ - protected function getLockForPopping() - { - $databaseEngine = $this->database->getPdo()->getAttribute(PDO::ATTR_DRIVER_NAME); - $databaseVersion = $this->database->getConfig('version') ?? $this->database->getPdo()->getAttribute(PDO::ATTR_SERVER_VERSION); - - if (Str::of($databaseVersion)->contains('MariaDB')) { - $databaseEngine = 'mariadb'; - $databaseVersion = Str::before(Str::after($databaseVersion, '5.5.5-'), '-'); - } elseif (Str::of($databaseVersion)->contains(['vitess', 'PlanetScale'])) { - $databaseEngine = 'vitess'; - $databaseVersion = Str::before($databaseVersion, '-'); - } - - if (($databaseEngine === 'mysql' && version_compare($databaseVersion, '8.0.1', '>=')) || - ($databaseEngine === 'mariadb' && version_compare($databaseVersion, '10.6.0', '>=')) || - ($databaseEngine === 'pgsql' && version_compare($databaseVersion, '9.5', '>='))) { - return 'FOR UPDATE SKIP LOCKED'; - } - - if ($databaseEngine === 'sqlsrv') { - return 'with(rowlock,updlock,readpast)'; - } - - return true; - } - - /** - * Modify the query to check for available jobs. - * - * @param \Illuminate\Database\Query\Builder $query - * @return void - */ - protected function isAvailable($query) - { - $query->where(function ($query) { - $query->whereNull('reserved_at') - ->where('available_at', '<=', $this->currentTime()); - }); - } - - /** - * Modify the query to check for jobs that are reserved but have expired. - * - * @param \Illuminate\Database\Query\Builder $query - * @return void - */ - protected function isReservedButExpired($query) - { - $expiration = Carbon::now()->subSeconds($this->retryAfter)->getTimestamp(); - - $query->orWhere(function ($query) use ($expiration) { - $query->where('reserved_at', '<=', $expiration); - }); - } - - /** - * Marshal the reserved job into a DatabaseJob instance. - * - * @param string $queue - * @param \Illuminate\Queue\Jobs\DatabaseJobRecord $job - * @return \Illuminate\Queue\Jobs\DatabaseJob - */ - protected function marshalJob($queue, $job) - { - $job = $this->markJobAsReserved($job); - - return new DatabaseJob( - $this->container, $this, $job, $this->connectionName, $queue - ); - } - - /** - * Mark the given job ID as reserved. - * - * @param \Illuminate\Queue\Jobs\DatabaseJobRecord $job - * @return \Illuminate\Queue\Jobs\DatabaseJobRecord - */ - protected function markJobAsReserved($job) - { - $this->database->table($this->table)->where('id', $job->id)->update([ - 'reserved_at' => $job->touch(), - 'attempts' => $job->increment(), - ]); - - return $job; - } - - /** - * Delete a reserved job from the queue. - * - * @param string $queue - * @param string $id - * @return void - * - * @throws \Throwable - */ - public function deleteReserved($queue, $id) - { - $this->database->transaction(function () use ($id) { - if ($this->database->table($this->table)->lockForUpdate()->find($id)) { - $this->database->table($this->table)->where('id', $id)->delete(); - } - }); - } - - /** - * Delete a reserved job from the reserved queue and release it. - * - * @param string $queue - * @param \Illuminate\Queue\Jobs\DatabaseJob $job - * @param int $delay - * @return void - */ - public function deleteAndRelease($queue, $job, $delay) - { - $this->database->transaction(function () use ($queue, $job, $delay) { - if ($this->database->table($this->table)->lockForUpdate()->find($job->getJobId())) { - $this->database->table($this->table)->where('id', $job->getJobId())->delete(); - } - - $this->release($queue, $job->getJobRecord(), $delay); - }); - } - - /** - * Delete all of the jobs from the queue. - * - * @param string $queue - * @return int - */ - public function clear($queue) - { - return $this->database->table($this->table) - ->where('queue', $this->getQueue($queue)) - ->delete(); - } - - /** - * Get the queue or return the default. - * - * @param string|null $queue - * @return string - */ - public function getQueue($queue) - { - return $queue ?: $this->default; - } - - /** - * Get the underlying database instance. - * - * @return \Illuminate\Database\Connection - */ - public function getDatabase() - { - return $this->database; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Events/JobExceptionOccurred.php b/vendor/laravel/framework/src/Illuminate/Queue/Events/JobExceptionOccurred.php deleted file mode 100644 index 4bdf3922..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Events/JobExceptionOccurred.php +++ /dev/null @@ -1,42 +0,0 @@ -job = $job; - $this->exception = $exception; - $this->connectionName = $connectionName; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Events/JobFailed.php b/vendor/laravel/framework/src/Illuminate/Queue/Events/JobFailed.php deleted file mode 100644 index d973a503..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Events/JobFailed.php +++ /dev/null @@ -1,42 +0,0 @@ -job = $job; - $this->exception = $exception; - $this->connectionName = $connectionName; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Events/JobProcessed.php b/vendor/laravel/framework/src/Illuminate/Queue/Events/JobProcessed.php deleted file mode 100644 index f8abefb6..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Events/JobProcessed.php +++ /dev/null @@ -1,33 +0,0 @@ -job = $job; - $this->connectionName = $connectionName; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Events/JobProcessing.php b/vendor/laravel/framework/src/Illuminate/Queue/Events/JobProcessing.php deleted file mode 100644 index 3dd97248..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Events/JobProcessing.php +++ /dev/null @@ -1,33 +0,0 @@ -job = $job; - $this->connectionName = $connectionName; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Events/JobQueued.php b/vendor/laravel/framework/src/Illuminate/Queue/Events/JobQueued.php deleted file mode 100644 index c91d1409..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Events/JobQueued.php +++ /dev/null @@ -1,42 +0,0 @@ -connectionName = $connectionName; - $this->id = $id; - $this->job = $job; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Events/JobReleasedAfterException.php b/vendor/laravel/framework/src/Illuminate/Queue/Events/JobReleasedAfterException.php deleted file mode 100644 index 4600c0b1..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Events/JobReleasedAfterException.php +++ /dev/null @@ -1,33 +0,0 @@ -job = $job; - $this->connectionName = $connectionName; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Events/JobRetryRequested.php b/vendor/laravel/framework/src/Illuminate/Queue/Events/JobRetryRequested.php deleted file mode 100644 index 9b9809f6..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Events/JobRetryRequested.php +++ /dev/null @@ -1,45 +0,0 @@ -job = $job; - } - - /** - * The job payload. - * - * @return array - */ - public function payload() - { - if (is_null($this->payload)) { - $this->payload = json_decode($this->job->payload, true); - } - - return $this->payload; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Events/Looping.php b/vendor/laravel/framework/src/Illuminate/Queue/Events/Looping.php deleted file mode 100644 index f9538e4c..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Events/Looping.php +++ /dev/null @@ -1,33 +0,0 @@ -queue = $queue; - $this->connectionName = $connectionName; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Events/QueueBusy.php b/vendor/laravel/framework/src/Illuminate/Queue/Events/QueueBusy.php deleted file mode 100644 index 684dec4e..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Events/QueueBusy.php +++ /dev/null @@ -1,42 +0,0 @@ -connection = $connection; - $this->queue = $queue; - $this->size = $size; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Events/WorkerStopping.php b/vendor/laravel/framework/src/Illuminate/Queue/Events/WorkerStopping.php deleted file mode 100644 index ccebb3cb..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Events/WorkerStopping.php +++ /dev/null @@ -1,33 +0,0 @@ -status = $status; - $this->workerOptions = $workerOptions; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Failed/DatabaseFailedJobProvider.php b/vendor/laravel/framework/src/Illuminate/Queue/Failed/DatabaseFailedJobProvider.php deleted file mode 100644 index 5793c761..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Failed/DatabaseFailedJobProvider.php +++ /dev/null @@ -1,142 +0,0 @@ -table = $table; - $this->resolver = $resolver; - $this->database = $database; - } - - /** - * Log a failed job into storage. - * - * @param string $connection - * @param string $queue - * @param string $payload - * @param \Throwable $exception - * @return int|null - */ - public function log($connection, $queue, $payload, $exception) - { - $failed_at = Date::now(); - - $exception = (string) mb_convert_encoding($exception, 'UTF-8'); - - return $this->getTable()->insertGetId(compact( - 'connection', 'queue', 'payload', 'exception', 'failed_at' - )); - } - - /** - * Get a list of all of the failed jobs. - * - * @return array - */ - public function all() - { - return $this->getTable()->orderBy('id', 'desc')->get()->all(); - } - - /** - * Get a single failed job. - * - * @param mixed $id - * @return object|null - */ - public function find($id) - { - return $this->getTable()->find($id); - } - - /** - * Delete a single failed job from storage. - * - * @param mixed $id - * @return bool - */ - public function forget($id) - { - return $this->getTable()->where('id', $id)->delete() > 0; - } - - /** - * Flush all of the failed jobs from storage. - * - * @param int|null $hours - * @return void - */ - public function flush($hours = null) - { - $this->getTable()->when($hours, function ($query, $hours) { - $query->where('failed_at', '<=', Date::now()->subHours($hours)); - })->delete(); - } - - /** - * Prune all of the entries older than the given date. - * - * @param \DateTimeInterface $before - * @return int - */ - public function prune(DateTimeInterface $before) - { - $query = $this->getTable()->where('failed_at', '<', $before); - - $totalDeleted = 0; - - do { - $deleted = $query->take(1000)->delete(); - - $totalDeleted += $deleted; - } while ($deleted !== 0); - - return $totalDeleted; - } - - /** - * Get a new query builder instance for the table. - * - * @return \Illuminate\Database\Query\Builder - */ - protected function getTable() - { - return $this->resolver->connection($this->database)->table($this->table); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Failed/DatabaseUuidFailedJobProvider.php b/vendor/laravel/framework/src/Illuminate/Queue/Failed/DatabaseUuidFailedJobProvider.php deleted file mode 100644 index c676faab..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Failed/DatabaseUuidFailedJobProvider.php +++ /dev/null @@ -1,155 +0,0 @@ -table = $table; - $this->resolver = $resolver; - $this->database = $database; - } - - /** - * Log a failed job into storage. - * - * @param string $connection - * @param string $queue - * @param string $payload - * @param \Throwable $exception - * @return string|null - */ - public function log($connection, $queue, $payload, $exception) - { - $this->getTable()->insert([ - 'uuid' => $uuid = json_decode($payload, true)['uuid'], - 'connection' => $connection, - 'queue' => $queue, - 'payload' => $payload, - 'exception' => (string) mb_convert_encoding($exception, 'UTF-8'), - 'failed_at' => Date::now(), - ]); - - return $uuid; - } - - /** - * Get a list of all of the failed jobs. - * - * @return array - */ - public function all() - { - return $this->getTable()->orderBy('id', 'desc')->get()->map(function ($record) { - $record->id = $record->uuid; - unset($record->uuid); - - return $record; - })->all(); - } - - /** - * Get a single failed job. - * - * @param mixed $id - * @return object|null - */ - public function find($id) - { - if ($record = $this->getTable()->where('uuid', $id)->first()) { - $record->id = $record->uuid; - unset($record->uuid); - } - - return $record; - } - - /** - * Delete a single failed job from storage. - * - * @param mixed $id - * @return bool - */ - public function forget($id) - { - return $this->getTable()->where('uuid', $id)->delete() > 0; - } - - /** - * Flush all of the failed jobs from storage. - * - * @param int|null $hours - * @return void - */ - public function flush($hours = null) - { - $this->getTable()->when($hours, function ($query, $hours) { - $query->where('failed_at', '<=', Date::now()->subHours($hours)); - })->delete(); - } - - /** - * Prune all of the entries older than the given date. - * - * @param \DateTimeInterface $before - * @return int - */ - public function prune(DateTimeInterface $before) - { - $query = $this->getTable()->where('failed_at', '<', $before); - - $totalDeleted = 0; - - do { - $deleted = $query->take(1000)->delete(); - - $totalDeleted += $deleted; - } while ($deleted !== 0); - - return $totalDeleted; - } - - /** - * Get a new query builder instance for the table. - * - * @return \Illuminate\Database\Query\Builder - */ - protected function getTable() - { - return $this->resolver->connection($this->database)->table($this->table); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Failed/DynamoDbFailedJobProvider.php b/vendor/laravel/framework/src/Illuminate/Queue/Failed/DynamoDbFailedJobProvider.php deleted file mode 100644 index 2feeaa98..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Failed/DynamoDbFailedJobProvider.php +++ /dev/null @@ -1,177 +0,0 @@ -table = $table; - $this->dynamo = $dynamo; - $this->applicationName = $applicationName; - } - - /** - * Log a failed job into storage. - * - * @param string $connection - * @param string $queue - * @param string $payload - * @param \Throwable $exception - * @return string|int|null - */ - public function log($connection, $queue, $payload, $exception) - { - $id = json_decode($payload, true)['uuid']; - - $failedAt = Date::now(); - - $this->dynamo->putItem([ - 'TableName' => $this->table, - 'Item' => [ - 'application' => ['S' => $this->applicationName], - 'uuid' => ['S' => $id], - 'connection' => ['S' => $connection], - 'queue' => ['S' => $queue], - 'payload' => ['S' => $payload], - 'exception' => ['S' => (string) $exception], - 'failed_at' => ['N' => (string) $failedAt->getTimestamp()], - 'expires_at' => ['N' => (string) $failedAt->addDays(3)->getTimestamp()], - ], - ]); - - return $id; - } - - /** - * Get a list of all of the failed jobs. - * - * @return array - */ - public function all() - { - $results = $this->dynamo->query([ - 'TableName' => $this->table, - 'Select' => 'ALL_ATTRIBUTES', - 'KeyConditionExpression' => 'application = :application', - 'ExpressionAttributeValues' => [ - ':application' => ['S' => $this->applicationName], - ], - 'ScanIndexForward' => false, - ]); - - return collect($results['Items'])->sortByDesc(function ($result) { - return (int) $result['failed_at']['N']; - })->map(function ($result) { - return (object) [ - 'id' => $result['uuid']['S'], - 'connection' => $result['connection']['S'], - 'queue' => $result['queue']['S'], - 'payload' => $result['payload']['S'], - 'exception' => $result['exception']['S'], - 'failed_at' => Carbon::createFromTimestamp( - (int) $result['failed_at']['N'] - )->format(DateTimeInterface::ISO8601), - ]; - })->all(); - } - - /** - * Get a single failed job. - * - * @param mixed $id - * @return object|null - */ - public function find($id) - { - $result = $this->dynamo->getItem([ - 'TableName' => $this->table, - 'Key' => [ - 'application' => ['S' => $this->applicationName], - 'uuid' => ['S' => $id], - ], - ]); - - if (! isset($result['Item'])) { - return; - } - - return (object) [ - 'id' => $result['Item']['uuid']['S'], - 'connection' => $result['Item']['connection']['S'], - 'queue' => $result['Item']['queue']['S'], - 'payload' => $result['Item']['payload']['S'], - 'exception' => $result['Item']['exception']['S'], - 'failed_at' => Carbon::createFromTimestamp( - (int) $result['Item']['failed_at']['N'] - )->format(DateTimeInterface::ISO8601), - ]; - } - - /** - * Delete a single failed job from storage. - * - * @param mixed $id - * @return bool - */ - public function forget($id) - { - $this->dynamo->deleteItem([ - 'TableName' => $this->table, - 'Key' => [ - 'application' => ['S' => $this->applicationName], - 'uuid' => ['S' => $id], - ], - ]); - - return true; - } - - /** - * Flush all of the failed jobs from storage. - * - * @param int|null $hours - * @return void - * - * @throws \Exception - */ - public function flush($hours = null) - { - throw new Exception("DynamoDb failed job storage may not be flushed. Please use DynamoDb's TTL features on your expires_at attribute."); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Failed/FailedJobProviderInterface.php b/vendor/laravel/framework/src/Illuminate/Queue/Failed/FailedJobProviderInterface.php deleted file mode 100644 index 26dd583b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Failed/FailedJobProviderInterface.php +++ /dev/null @@ -1,48 +0,0 @@ -job ? $this->job->attempts() : 1; - } - - /** - * Delete the job from the queue. - * - * @return void - */ - public function delete() - { - if ($this->job) { - return $this->job->delete(); - } - } - - /** - * Fail the job from the queue. - * - * @param \Throwable|null $exception - * @return void - */ - public function fail($exception = null) - { - if ($exception instanceof Throwable || is_null($exception)) { - if ($this->job) { - return $this->job->fail($exception); - } - } else { - throw new InvalidArgumentException('The fail method requires an instance of Throwable.'); - } - } - - /** - * Release the job back into the queue after (n) seconds. - * - * @param int $delay - * @return void - */ - public function release($delay = 0) - { - if ($this->job) { - return $this->job->release($delay); - } - } - - /** - * Set the base queue job instance. - * - * @param \Illuminate\Contracts\Queue\Job $job - * @return $this - */ - public function setJob(JobContract $job) - { - $this->job = $job; - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/InvalidPayloadException.php b/vendor/laravel/framework/src/Illuminate/Queue/InvalidPayloadException.php deleted file mode 100644 index 788fa660..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/InvalidPayloadException.php +++ /dev/null @@ -1,19 +0,0 @@ -job = $job; - $this->queue = $queue; - $this->container = $container; - $this->pheanstalk = $pheanstalk; - $this->connectionName = $connectionName; - } - - /** - * Release the job back into the queue after (n) seconds. - * - * @param int $delay - * @return void - */ - public function release($delay = 0) - { - parent::release($delay); - - $priority = Pheanstalk::DEFAULT_PRIORITY; - - $this->pheanstalk->release($this->job, $priority, $delay); - } - - /** - * Bury the job in the queue. - * - * @return void - */ - public function bury() - { - parent::release(); - - $this->pheanstalk->bury($this->job); - } - - /** - * Delete the job from the queue. - * - * @return void - */ - public function delete() - { - parent::delete(); - - $this->pheanstalk->delete($this->job); - } - - /** - * Get the number of times the job has been attempted. - * - * @return int - */ - public function attempts() - { - $stats = $this->pheanstalk->statsJob($this->job); - - return (int) $stats->reserves; - } - - /** - * Get the job identifier. - * - * @return int - */ - public function getJobId() - { - return $this->job->getId(); - } - - /** - * Get the raw body string for the job. - * - * @return string - */ - public function getRawBody() - { - return $this->job->getData(); - } - - /** - * Get the underlying Pheanstalk instance. - * - * @return \Pheanstalk\Pheanstalk - */ - public function getPheanstalk() - { - return $this->pheanstalk; - } - - /** - * Get the underlying Pheanstalk job. - * - * @return \Pheanstalk\Job - */ - public function getPheanstalkJob() - { - return $this->job; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Jobs/DatabaseJob.php b/vendor/laravel/framework/src/Illuminate/Queue/Jobs/DatabaseJob.php deleted file mode 100644 index 77f50427..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Jobs/DatabaseJob.php +++ /dev/null @@ -1,108 +0,0 @@ -job = $job; - $this->queue = $queue; - $this->database = $database; - $this->container = $container; - $this->connectionName = $connectionName; - } - - /** - * Release the job back into the queue after (n) seconds. - * - * @param int $delay - * @return void - */ - public function release($delay = 0) - { - parent::release($delay); - - $this->database->deleteAndRelease($this->queue, $this, $delay); - } - - /** - * Delete the job from the queue. - * - * @return void - */ - public function delete() - { - parent::delete(); - - $this->database->deleteReserved($this->queue, $this->job->id); - } - - /** - * Get the number of times the job has been attempted. - * - * @return int - */ - public function attempts() - { - return (int) $this->job->attempts; - } - - /** - * Get the job identifier. - * - * @return string - */ - public function getJobId() - { - return $this->job->id; - } - - /** - * Get the raw body string for the job. - * - * @return string - */ - public function getRawBody() - { - return $this->job->payload; - } - - /** - * Get the database job record. - * - * @return \Illuminate\Queue\Jobs\DatabaseJobRecord - */ - public function getJobRecord() - { - return $this->job; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Jobs/DatabaseJobRecord.php b/vendor/laravel/framework/src/Illuminate/Queue/Jobs/DatabaseJobRecord.php deleted file mode 100644 index b4b57254..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Jobs/DatabaseJobRecord.php +++ /dev/null @@ -1,63 +0,0 @@ -record = $record; - } - - /** - * Increment the number of times the job has been attempted. - * - * @return int - */ - public function increment() - { - $this->record->attempts++; - - return $this->record->attempts; - } - - /** - * Update the "reserved at" timestamp of the job. - * - * @return int - */ - public function touch() - { - $this->record->reserved_at = $this->currentTime(); - - return $this->record->reserved_at; - } - - /** - * Dynamically access the underlying job information. - * - * @param string $key - * @return mixed - */ - public function __get($key) - { - return $this->record->{$key}; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php b/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php deleted file mode 100755 index d5464946..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php +++ /dev/null @@ -1,359 +0,0 @@ -payload()['uuid'] ?? null; - } - - /** - * Fire the job. - * - * @return void - */ - public function fire() - { - $payload = $this->payload(); - - [$class, $method] = JobName::parse($payload['job']); - - ($this->instance = $this->resolve($class))->{$method}($this, $payload['data']); - } - - /** - * Delete the job from the queue. - * - * @return void - */ - public function delete() - { - $this->deleted = true; - } - - /** - * Determine if the job has been deleted. - * - * @return bool - */ - public function isDeleted() - { - return $this->deleted; - } - - /** - * Release the job back into the queue after (n) seconds. - * - * @param int $delay - * @return void - */ - public function release($delay = 0) - { - $this->released = true; - } - - /** - * Determine if the job was released back into the queue. - * - * @return bool - */ - public function isReleased() - { - return $this->released; - } - - /** - * Determine if the job has been deleted or released. - * - * @return bool - */ - public function isDeletedOrReleased() - { - return $this->isDeleted() || $this->isReleased(); - } - - /** - * Determine if the job has been marked as a failure. - * - * @return bool - */ - public function hasFailed() - { - return $this->failed; - } - - /** - * Mark the job as "failed". - * - * @return void - */ - public function markAsFailed() - { - $this->failed = true; - } - - /** - * Delete the job, call the "failed" method, and raise the failed job event. - * - * @param \Throwable|null $e - * @return void - */ - public function fail($e = null) - { - $this->markAsFailed(); - - if ($this->isDeleted()) { - return; - } - - try { - // If the job has failed, we will delete it, call the "failed" method and then call - // an event indicating the job has failed so it can be logged if needed. This is - // to allow every developer to better keep monitor of their failed queue jobs. - $this->delete(); - - $this->failed($e); - } finally { - $this->resolve(Dispatcher::class)->dispatch(new JobFailed( - $this->connectionName, $this, $e ?: new ManuallyFailedException - )); - } - } - - /** - * Process an exception that caused the job to fail. - * - * @param \Throwable|null $e - * @return void - */ - protected function failed($e) - { - $payload = $this->payload(); - - [$class, $method] = JobName::parse($payload['job']); - - if (method_exists($this->instance = $this->resolve($class), 'failed')) { - $this->instance->failed($payload['data'], $e, $payload['uuid'] ?? ''); - } - } - - /** - * Resolve the given class. - * - * @param string $class - * @return mixed - */ - protected function resolve($class) - { - return $this->container->make($class); - } - - /** - * Get the resolved job handler instance. - * - * @return mixed - */ - public function getResolvedJob() - { - return $this->instance; - } - - /** - * Get the decoded body of the job. - * - * @return array - */ - public function payload() - { - return json_decode($this->getRawBody(), true); - } - - /** - * Get the number of times to attempt a job. - * - * @return int|null - */ - public function maxTries() - { - return $this->payload()['maxTries'] ?? null; - } - - /** - * Get the number of times to attempt a job after an exception. - * - * @return int|null - */ - public function maxExceptions() - { - return $this->payload()['maxExceptions'] ?? null; - } - - /** - * Determine if the job should fail when it timeouts. - * - * @return bool - */ - public function shouldFailOnTimeout() - { - return $this->payload()['failOnTimeout'] ?? false; - } - - /** - * The number of seconds to wait before retrying a job that encountered an uncaught exception. - * - * @return int|int[]|null - */ - public function backoff() - { - return $this->payload()['backoff'] ?? $this->payload()['delay'] ?? null; - } - - /** - * Get the number of seconds the job can run. - * - * @return int|null - */ - public function timeout() - { - return $this->payload()['timeout'] ?? null; - } - - /** - * Get the timestamp indicating when the job should timeout. - * - * @return int|null - */ - public function retryUntil() - { - return $this->payload()['retryUntil'] ?? null; - } - - /** - * Get the name of the queued job class. - * - * @return string - */ - public function getName() - { - return $this->payload()['job']; - } - - /** - * Get the resolved name of the queued job class. - * - * Resolves the name of "wrapped" jobs such as class-based handlers. - * - * @return string - */ - public function resolveName() - { - return JobName::resolve($this->getName(), $this->payload()); - } - - /** - * Get the name of the connection the job belongs to. - * - * @return string - */ - public function getConnectionName() - { - return $this->connectionName; - } - - /** - * Get the name of the queue the job belongs to. - * - * @return string - */ - public function getQueue() - { - return $this->queue; - } - - /** - * Get the service container instance. - * - * @return \Illuminate\Container\Container - */ - public function getContainer() - { - return $this->container; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Jobs/JobName.php b/vendor/laravel/framework/src/Illuminate/Queue/Jobs/JobName.php deleted file mode 100644 index 0db53bb4..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Jobs/JobName.php +++ /dev/null @@ -1,35 +0,0 @@ -job = $job; - $this->redis = $redis; - $this->queue = $queue; - $this->reserved = $reserved; - $this->container = $container; - $this->connectionName = $connectionName; - - $this->decoded = $this->payload(); - } - - /** - * Get the raw body string for the job. - * - * @return string - */ - public function getRawBody() - { - return $this->job; - } - - /** - * Delete the job from the queue. - * - * @return void - */ - public function delete() - { - parent::delete(); - - $this->redis->deleteReserved($this->queue, $this); - } - - /** - * Release the job back into the queue after (n) seconds. - * - * @param int $delay - * @return void - */ - public function release($delay = 0) - { - parent::release($delay); - - $this->redis->deleteAndRelease($this->queue, $this, $delay); - } - - /** - * Get the number of times the job has been attempted. - * - * @return int - */ - public function attempts() - { - return ($this->decoded['attempts'] ?? null) + 1; - } - - /** - * Get the job identifier. - * - * @return string|null - */ - public function getJobId() - { - return $this->decoded['id'] ?? null; - } - - /** - * Get the underlying Redis factory implementation. - * - * @return \Illuminate\Queue\RedisQueue - */ - public function getRedisQueue() - { - return $this->redis; - } - - /** - * Get the underlying reserved Redis job. - * - * @return string - */ - public function getReservedJob() - { - return $this->reserved; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Jobs/SqsJob.php b/vendor/laravel/framework/src/Illuminate/Queue/Jobs/SqsJob.php deleted file mode 100755 index 87b722e2..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Jobs/SqsJob.php +++ /dev/null @@ -1,124 +0,0 @@ -sqs = $sqs; - $this->job = $job; - $this->queue = $queue; - $this->container = $container; - $this->connectionName = $connectionName; - } - - /** - * Release the job back into the queue after (n) seconds. - * - * @param int $delay - * @return void - */ - public function release($delay = 0) - { - parent::release($delay); - - $this->sqs->changeMessageVisibility([ - 'QueueUrl' => $this->queue, - 'ReceiptHandle' => $this->job['ReceiptHandle'], - 'VisibilityTimeout' => $delay, - ]); - } - - /** - * Delete the job from the queue. - * - * @return void - */ - public function delete() - { - parent::delete(); - - $this->sqs->deleteMessage([ - 'QueueUrl' => $this->queue, 'ReceiptHandle' => $this->job['ReceiptHandle'], - ]); - } - - /** - * Get the number of times the job has been attempted. - * - * @return int - */ - public function attempts() - { - return (int) $this->job['Attributes']['ApproximateReceiveCount']; - } - - /** - * Get the job identifier. - * - * @return string - */ - public function getJobId() - { - return $this->job['MessageId']; - } - - /** - * Get the raw body string for the job. - * - * @return string - */ - public function getRawBody() - { - return $this->job['Body']; - } - - /** - * Get the underlying SQS client instance. - * - * @return \Aws\Sqs\SqsClient - */ - public function getSqs() - { - return $this->sqs; - } - - /** - * Get the underlying raw SQS job. - * - * @return array - */ - public function getSqsJob() - { - return $this->job; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Jobs/SyncJob.php b/vendor/laravel/framework/src/Illuminate/Queue/Jobs/SyncJob.php deleted file mode 100755 index fc9c7030..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Jobs/SyncJob.php +++ /dev/null @@ -1,91 +0,0 @@ -queue = $queue; - $this->payload = $payload; - $this->container = $container; - $this->connectionName = $connectionName; - } - - /** - * Release the job back into the queue after (n) seconds. - * - * @param int $delay - * @return void - */ - public function release($delay = 0) - { - parent::release($delay); - } - - /** - * Get the number of times the job has been attempted. - * - * @return int - */ - public function attempts() - { - return 1; - } - - /** - * Get the job identifier. - * - * @return string - */ - public function getJobId() - { - return ''; - } - - /** - * Get the raw body string for the job. - * - * @return string - */ - public function getRawBody() - { - return $this->payload; - } - - /** - * Get the name of the queue the job belongs to. - * - * @return string - */ - public function getQueue() - { - return 'sync'; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/LICENSE.md b/vendor/laravel/framework/src/Illuminate/Queue/LICENSE.md deleted file mode 100644 index 79810c84..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Taylor Otwell - -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/laravel/framework/src/Illuminate/Queue/Listener.php b/vendor/laravel/framework/src/Illuminate/Queue/Listener.php deleted file mode 100755 index b552828f..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Listener.php +++ /dev/null @@ -1,236 +0,0 @@ -commandPath = $commandPath; - } - - /** - * Get the PHP binary. - * - * @return string - */ - protected function phpBinary() - { - return (new PhpExecutableFinder)->find(false); - } - - /** - * Get the Artisan binary. - * - * @return string - */ - protected function artisanBinary() - { - return defined('ARTISAN_BINARY') ? ARTISAN_BINARY : 'artisan'; - } - - /** - * Listen to the given queue connection. - * - * @param string $connection - * @param string $queue - * @param \Illuminate\Queue\ListenerOptions $options - * @return void - */ - public function listen($connection, $queue, ListenerOptions $options) - { - $process = $this->makeProcess($connection, $queue, $options); - - while (true) { - $this->runProcess($process, $options->memory); - - if ($options->rest) { - sleep($options->rest); - } - } - } - - /** - * Create a new Symfony process for the worker. - * - * @param string $connection - * @param string $queue - * @param \Illuminate\Queue\ListenerOptions $options - * @return \Symfony\Component\Process\Process - */ - public function makeProcess($connection, $queue, ListenerOptions $options) - { - $command = $this->createCommand( - $connection, - $queue, - $options - ); - - // If the environment is set, we will append it to the command array so the - // workers will run under the specified environment. Otherwise, they will - // just run under the production environment which is not always right. - if (isset($options->environment)) { - $command = $this->addEnvironment($command, $options); - } - - return new Process( - $command, - $this->commandPath, - null, - null, - $options->timeout - ); - } - - /** - * Add the environment option to the given command. - * - * @param array $command - * @param \Illuminate\Queue\ListenerOptions $options - * @return array - */ - protected function addEnvironment($command, ListenerOptions $options) - { - return array_merge($command, ["--env={$options->environment}"]); - } - - /** - * Create the command with the listener options. - * - * @param string $connection - * @param string $queue - * @param \Illuminate\Queue\ListenerOptions $options - * @return array - */ - protected function createCommand($connection, $queue, ListenerOptions $options) - { - return array_filter([ - $this->phpBinary(), - $this->artisanBinary(), - 'queue:work', - $connection, - '--once', - "--name={$options->name}", - "--queue={$queue}", - "--backoff={$options->backoff}", - "--memory={$options->memory}", - "--sleep={$options->sleep}", - "--tries={$options->maxTries}", - $options->force ? '--force' : null, - ], function ($value) { - return ! is_null($value); - }); - } - - /** - * Run the given process. - * - * @param \Symfony\Component\Process\Process $process - * @param int $memory - * @return void - */ - public function runProcess(Process $process, $memory) - { - $process->run(function ($type, $line) { - $this->handleWorkerOutput($type, $line); - }); - - // Once we have run the job we'll go check if the memory limit has been exceeded - // for the script. If it has, we will kill this script so the process manager - // will restart this with a clean slate of memory automatically on exiting. - if ($this->memoryExceeded($memory)) { - $this->stop(); - } - } - - /** - * Handle output from the worker process. - * - * @param int $type - * @param string $line - * @return void - */ - protected function handleWorkerOutput($type, $line) - { - if (isset($this->outputHandler)) { - call_user_func($this->outputHandler, $type, $line); - } - } - - /** - * Determine if the memory limit has been exceeded. - * - * @param int $memoryLimit - * @return bool - */ - public function memoryExceeded($memoryLimit) - { - return (memory_get_usage(true) / 1024 / 1024) >= $memoryLimit; - } - - /** - * Stop listening and bail out of the script. - * - * @return void - */ - public function stop() - { - exit; - } - - /** - * Set the output handler callback. - * - * @param \Closure $outputHandler - * @return void - */ - public function setOutputHandler(Closure $outputHandler) - { - $this->outputHandler = $outputHandler; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/ListenerOptions.php b/vendor/laravel/framework/src/Illuminate/Queue/ListenerOptions.php deleted file mode 100644 index d71989d9..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/ListenerOptions.php +++ /dev/null @@ -1,34 +0,0 @@ -environment = $environment; - - parent::__construct($name, $backoff, $memory, $timeout, $sleep, $maxTries, $force, false, 0, 0, $rest); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/LuaScripts.php b/vendor/laravel/framework/src/Illuminate/Queue/LuaScripts.php deleted file mode 100644 index 5452c116..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/LuaScripts.php +++ /dev/null @@ -1,148 +0,0 @@ -limiter = Container::getInstance()->make(RateLimiter::class); - - $this->limiterName = $limiterName; - } - - /** - * Process the job. - * - * @param mixed $job - * @param callable $next - * @return mixed - */ - public function handle($job, $next) - { - if (is_null($limiter = $this->limiter->limiter($this->limiterName))) { - return $next($job); - } - - $limiterResponse = $limiter($job); - - if ($limiterResponse instanceof Unlimited) { - return $next($job); - } - - return $this->handleJob( - $job, - $next, - collect(Arr::wrap($limiterResponse))->map(function ($limit) { - return (object) [ - 'key' => md5($this->limiterName.$limit->key), - 'maxAttempts' => $limit->maxAttempts, - 'decayMinutes' => $limit->decayMinutes, - ]; - })->all() - ); - } - - /** - * Handle a rate limited job. - * - * @param mixed $job - * @param callable $next - * @param array $limits - * @return mixed - */ - protected function handleJob($job, $next, array $limits) - { - foreach ($limits as $limit) { - if ($this->limiter->tooManyAttempts($limit->key, $limit->maxAttempts)) { - return $this->shouldRelease - ? $job->release($this->getTimeUntilNextRetry($limit->key)) - : false; - } - - $this->limiter->hit($limit->key, $limit->decayMinutes * 60); - } - - return $next($job); - } - - /** - * Do not release the job back to the queue if the limit is exceeded. - * - * @return $this - */ - public function dontRelease() - { - $this->shouldRelease = false; - - return $this; - } - - /** - * Get the number of seconds that should elapse before the job is retried. - * - * @param string $key - * @return int - */ - protected function getTimeUntilNextRetry($key) - { - return $this->limiter->availableIn($key) + 3; - } - - /** - * Prepare the object for serialization. - * - * @return array - */ - public function __sleep() - { - return [ - 'limiterName', - 'shouldRelease', - ]; - } - - /** - * Prepare the object after unserialization. - * - * @return void - */ - public function __wakeup() - { - $this->limiter = Container::getInstance()->make(RateLimiter::class); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Middleware/RateLimitedWithRedis.php b/vendor/laravel/framework/src/Illuminate/Queue/Middleware/RateLimitedWithRedis.php deleted file mode 100644 index e919786f..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Middleware/RateLimitedWithRedis.php +++ /dev/null @@ -1,103 +0,0 @@ -redis = Container::getInstance()->make(Redis::class); - } - - /** - * Handle a rate limited job. - * - * @param mixed $job - * @param callable $next - * @param array $limits - * @return mixed - */ - protected function handleJob($job, $next, array $limits) - { - foreach ($limits as $limit) { - if ($this->tooManyAttempts($limit->key, $limit->maxAttempts, $limit->decayMinutes)) { - return $this->shouldRelease - ? $job->release($this->getTimeUntilNextRetry($limit->key)) - : false; - } - } - - return $next($job); - } - - /** - * Determine if the given key has been "accessed" too many times. - * - * @param string $key - * @param int $maxAttempts - * @param int $decayMinutes - * @return bool - */ - protected function tooManyAttempts($key, $maxAttempts, $decayMinutes) - { - $limiter = new DurationLimiter( - $this->redis, $key, $maxAttempts, $decayMinutes * 60 - ); - - return tap(! $limiter->acquire(), function () use ($key, $limiter) { - $this->decaysAt[$key] = $limiter->decaysAt; - }); - } - - /** - * Get the number of seconds that should elapse before the job is retried. - * - * @param string $key - * @return int - */ - protected function getTimeUntilNextRetry($key) - { - return ($this->decaysAt[$key] - $this->currentTime()) + 3; - } - - /** - * Prepare the object after unserialization. - * - * @return void - */ - public function __wakeup() - { - parent::__wakeup(); - - $this->redis = Container::getInstance()->make(Redis::class); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Middleware/ThrottlesExceptions.php b/vendor/laravel/framework/src/Illuminate/Queue/Middleware/ThrottlesExceptions.php deleted file mode 100644 index 61ddf343..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Middleware/ThrottlesExceptions.php +++ /dev/null @@ -1,201 +0,0 @@ -maxAttempts = $maxAttempts; - $this->decayMinutes = $decayMinutes; - } - - /** - * Process the job. - * - * @param mixed $job - * @param callable $next - * @return mixed - */ - public function handle($job, $next) - { - $this->limiter = Container::getInstance()->make(RateLimiter::class); - - if ($this->limiter->tooManyAttempts($jobKey = $this->getKey($job), $this->maxAttempts)) { - return $job->release($this->getTimeUntilNextRetry($jobKey)); - } - - try { - $next($job); - - $this->limiter->clear($jobKey); - } catch (Throwable $throwable) { - if ($this->whenCallback && ! call_user_func($this->whenCallback, $throwable)) { - throw $throwable; - } - - $this->limiter->hit($jobKey, $this->decayMinutes * 60); - - return $job->release($this->retryAfterMinutes * 60); - } - } - - /** - * Specify a callback that should determine if rate limiting behavior should apply. - * - * @param callable $callback - * @return $this - */ - public function when(callable $callback) - { - $this->whenCallback = $callback; - - return $this; - } - - /** - * Set the prefix of the rate limiter key. - * - * @param string $prefix - * @return $this - */ - public function withPrefix(string $prefix) - { - $this->prefix = $prefix; - - return $this; - } - - /** - * Specify the number of minutes a job should be delayed when it is released (before it has reached its max exceptions). - * - * @param int $backoff - * @return $this - */ - public function backoff($backoff) - { - $this->retryAfterMinutes = $backoff; - - return $this; - } - - /** - * Get the cache key associated for the rate limiter. - * - * @param mixed $job - * @return string - */ - protected function getKey($job) - { - if ($this->key) { - return $this->prefix.$this->key; - } elseif ($this->byJob) { - return $this->prefix.$job->job->uuid(); - } - - return $this->prefix.md5(get_class($job)); - } - - /** - * Set the value that the rate limiter should be keyed by. - * - * @param string $key - * @return $this - */ - public function by($key) - { - $this->key = $key; - - return $this; - } - - /** - * Indicate that the throttle key should use the job's UUID. - * - * @return $this - */ - public function byJob() - { - $this->byJob = true; - - return $this; - } - - /** - * Get the number of seconds that should elapse before the job is retried. - * - * @param string $key - * @return int - */ - protected function getTimeUntilNextRetry($key) - { - return $this->limiter->availableIn($key) + 3; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Middleware/ThrottlesExceptionsWithRedis.php b/vendor/laravel/framework/src/Illuminate/Queue/Middleware/ThrottlesExceptionsWithRedis.php deleted file mode 100644 index 38790e35..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Middleware/ThrottlesExceptionsWithRedis.php +++ /dev/null @@ -1,62 +0,0 @@ -redis = Container::getInstance()->make(Redis::class); - - $this->limiter = new DurationLimiter( - $this->redis, $this->getKey($job), $this->maxAttempts, $this->decayMinutes * 60 - ); - - if ($this->limiter->tooManyAttempts()) { - return $job->release($this->limiter->decaysAt - $this->currentTime()); - } - - try { - $next($job); - - $this->limiter->clear(); - } catch (Throwable $throwable) { - if ($this->whenCallback && ! call_user_func($this->whenCallback, $throwable)) { - throw $throwable; - } - - $this->limiter->acquire(); - - return $job->release($this->retryAfterMinutes * 60); - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Middleware/WithoutOverlapping.php b/vendor/laravel/framework/src/Illuminate/Queue/Middleware/WithoutOverlapping.php deleted file mode 100644 index 3b773adf..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Middleware/WithoutOverlapping.php +++ /dev/null @@ -1,162 +0,0 @@ -key = $key; - $this->releaseAfter = $releaseAfter; - $this->expiresAfter = $this->secondsUntil($expiresAfter); - } - - /** - * Process the job. - * - * @param mixed $job - * @param callable $next - * @return mixed - */ - public function handle($job, $next) - { - $lock = Container::getInstance()->make(Cache::class)->lock( - $this->getLockKey($job), $this->expiresAfter - ); - - if ($lock->get()) { - try { - $next($job); - } finally { - $lock->release(); - } - } elseif (! is_null($this->releaseAfter)) { - $job->release($this->releaseAfter); - } - } - - /** - * Set the delay (in seconds) to release the job back to the queue. - * - * @param \DateTimeInterface|int $releaseAfter - * @return $this - */ - public function releaseAfter($releaseAfter) - { - $this->releaseAfter = $releaseAfter; - - return $this; - } - - /** - * Do not release the job back to the queue if no lock can be acquired. - * - * @return $this - */ - public function dontRelease() - { - $this->releaseAfter = null; - - return $this; - } - - /** - * Set the maximum number of seconds that can elapse before the lock is released. - * - * @param \DateTimeInterface|\DateInterval|int $expiresAfter - * @return $this - */ - public function expireAfter($expiresAfter) - { - $this->expiresAfter = $this->secondsUntil($expiresAfter); - - return $this; - } - - /** - * Set the prefix of the lock key. - * - * @param string $prefix - * @return $this - */ - public function withPrefix(string $prefix) - { - $this->prefix = $prefix; - - return $this; - } - - /** - * Indicate that the lock key should be shared across job classes. - * - * @return $this - */ - public function shared() - { - $this->shareKey = true; - - return $this; - } - - /** - * Get the lock key for the given job. - * - * @param mixed $job - * @return string - */ - public function getLockKey($job) - { - return $this->shareKey - ? $this->prefix.$this->key - : $this->prefix.get_class($job).':'.$this->key; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/NullQueue.php b/vendor/laravel/framework/src/Illuminate/Queue/NullQueue.php deleted file mode 100644 index 10493a1b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/NullQueue.php +++ /dev/null @@ -1,70 +0,0 @@ -push($job, $data, $queue); - } - - /** - * Push a new job onto a specific queue after (n) seconds. - * - * @param string $queue - * @param \DateTimeInterface|\DateInterval|int $delay - * @param string $job - * @param mixed $data - * @return mixed - */ - public function laterOn($queue, $delay, $job, $data = '') - { - return $this->later($delay, $job, $data, $queue); - } - - /** - * Push an array of jobs onto the queue. - * - * @param array $jobs - * @param mixed $data - * @param string|null $queue - * @return void - */ - public function bulk($jobs, $data = '', $queue = null) - { - foreach ((array) $jobs as $job) { - $this->push($job, $data, $queue); - } - } - - /** - * Create a payload string from the given job and data. - * - * @param \Closure|string|object $job - * @param string $queue - * @param mixed $data - * @return string - * - * @throws \Illuminate\Queue\InvalidPayloadException - */ - protected function createPayload($job, $queue, $data = '') - { - if ($job instanceof Closure) { - $job = CallQueuedClosure::create($job); - } - - $payload = json_encode($this->createPayloadArray($job, $queue, $data), \JSON_UNESCAPED_UNICODE); - - if (json_last_error() !== JSON_ERROR_NONE) { - throw new InvalidPayloadException( - 'Unable to JSON encode payload. Error code: '.json_last_error() - ); - } - - return $payload; - } - - /** - * Create a payload array from the given job and data. - * - * @param string|object $job - * @param string $queue - * @param mixed $data - * @return array - */ - protected function createPayloadArray($job, $queue, $data = '') - { - return is_object($job) - ? $this->createObjectPayload($job, $queue) - : $this->createStringPayload($job, $queue, $data); - } - - /** - * Create a payload for an object-based queue handler. - * - * @param object $job - * @param string $queue - * @return array - */ - protected function createObjectPayload($job, $queue) - { - $payload = $this->withCreatePayloadHooks($queue, [ - 'uuid' => (string) Str::uuid(), - 'displayName' => $this->getDisplayName($job), - 'job' => 'Illuminate\Queue\CallQueuedHandler@call', - 'maxTries' => $job->tries ?? null, - 'maxExceptions' => $job->maxExceptions ?? null, - 'failOnTimeout' => $job->failOnTimeout ?? false, - 'backoff' => $this->getJobBackoff($job), - 'timeout' => $job->timeout ?? null, - 'retryUntil' => $this->getJobExpiration($job), - 'data' => [ - 'commandName' => $job, - 'command' => $job, - ], - ]); - - $command = $this->jobShouldBeEncrypted($job) && $this->container->bound(Encrypter::class) - ? $this->container[Encrypter::class]->encrypt(serialize(clone $job)) - : serialize(clone $job); - - return array_merge($payload, [ - 'data' => array_merge($payload['data'], [ - 'commandName' => get_class($job), - 'command' => $command, - ]), - ]); - } - - /** - * Get the display name for the given job. - * - * @param object $job - * @return string - */ - protected function getDisplayName($job) - { - return method_exists($job, 'displayName') - ? $job->displayName() : get_class($job); - } - - /** - * Get the backoff for an object-based queue handler. - * - * @param mixed $job - * @return mixed - */ - public function getJobBackoff($job) - { - if (! method_exists($job, 'backoff') && ! isset($job->backoff)) { - return; - } - - if (is_null($backoff = $job->backoff ?? $job->backoff())) { - return; - } - - return collect(Arr::wrap($backoff)) - ->map(function ($backoff) { - return $backoff instanceof DateTimeInterface - ? $this->secondsUntil($backoff) : $backoff; - })->implode(','); - } - - /** - * Get the expiration timestamp for an object-based queue handler. - * - * @param mixed $job - * @return mixed - */ - public function getJobExpiration($job) - { - if (! method_exists($job, 'retryUntil') && ! isset($job->retryUntil)) { - return; - } - - $expiration = $job->retryUntil ?? $job->retryUntil(); - - return $expiration instanceof DateTimeInterface - ? $expiration->getTimestamp() : $expiration; - } - - /** - * Determine if the job should be encrypted. - * - * @param object $job - * @return bool - */ - protected function jobShouldBeEncrypted($job) - { - if ($job instanceof ShouldBeEncrypted) { - return true; - } - - return isset($job->shouldBeEncrypted) && $job->shouldBeEncrypted; - } - - /** - * Create a typical, string based queue payload array. - * - * @param string $job - * @param string $queue - * @param mixed $data - * @return array - */ - protected function createStringPayload($job, $queue, $data) - { - return $this->withCreatePayloadHooks($queue, [ - 'uuid' => (string) Str::uuid(), - 'displayName' => is_string($job) ? explode('@', $job)[0] : null, - 'job' => $job, - 'maxTries' => null, - 'maxExceptions' => null, - 'failOnTimeout' => false, - 'backoff' => null, - 'timeout' => null, - 'data' => $data, - ]); - } - - /** - * Register a callback to be executed when creating job payloads. - * - * @param callable|null $callback - * @return void - */ - public static function createPayloadUsing($callback) - { - if (is_null($callback)) { - static::$createPayloadCallbacks = []; - } else { - static::$createPayloadCallbacks[] = $callback; - } - } - - /** - * Create the given payload using any registered payload hooks. - * - * @param string $queue - * @param array $payload - * @return array - */ - protected function withCreatePayloadHooks($queue, array $payload) - { - if (! empty(static::$createPayloadCallbacks)) { - foreach (static::$createPayloadCallbacks as $callback) { - $payload = array_merge($payload, $callback($this->getConnectionName(), $queue, $payload)); - } - } - - return $payload; - } - - /** - * Enqueue a job using the given callback. - * - * @param \Closure|string|object $job - * @param string $payload - * @param string $queue - * @param \DateTimeInterface|\DateInterval|int|null $delay - * @param callable $callback - * @return mixed - */ - protected function enqueueUsing($job, $payload, $queue, $delay, $callback) - { - if ($this->shouldDispatchAfterCommit($job) && - $this->container->bound('db.transactions')) { - return $this->container->make('db.transactions')->addCallback( - function () use ($payload, $queue, $delay, $callback, $job) { - return tap($callback($payload, $queue, $delay), function ($jobId) use ($job) { - $this->raiseJobQueuedEvent($jobId, $job); - }); - } - ); - } - - return tap($callback($payload, $queue, $delay), function ($jobId) use ($job) { - $this->raiseJobQueuedEvent($jobId, $job); - }); - } - - /** - * Determine if the job should be dispatched after all database transactions have committed. - * - * @param \Closure|string|object $job - * @return bool - */ - protected function shouldDispatchAfterCommit($job) - { - if (is_object($job) && isset($job->afterCommit)) { - return $job->afterCommit; - } - - if (isset($this->dispatchAfterCommit)) { - return $this->dispatchAfterCommit; - } - - return false; - } - - /** - * Raise the job queued event. - * - * @param string|int|null $jobId - * @param \Closure|string|object $job - * @return void - */ - protected function raiseJobQueuedEvent($jobId, $job) - { - if ($this->container->bound('events')) { - $this->container['events']->dispatch(new JobQueued($this->connectionName, $jobId, $job)); - } - } - - /** - * Get the connection name for the queue. - * - * @return string - */ - public function getConnectionName() - { - return $this->connectionName; - } - - /** - * Set the connection name for the queue. - * - * @param string $name - * @return $this - */ - public function setConnectionName($name) - { - $this->connectionName = $name; - - return $this; - } - - /** - * Get the container instance being used by the connection. - * - * @return \Illuminate\Container\Container - */ - public function getContainer() - { - return $this->container; - } - - /** - * Set the IoC container instance. - * - * @param \Illuminate\Container\Container $container - * @return void - */ - public function setContainer(Container $container) - { - $this->container = $container; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/QueueManager.php b/vendor/laravel/framework/src/Illuminate/Queue/QueueManager.php deleted file mode 100755 index 33f1cd16..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/QueueManager.php +++ /dev/null @@ -1,293 +0,0 @@ -app = $app; - } - - /** - * Register an event listener for the before job event. - * - * @param mixed $callback - * @return void - */ - public function before($callback) - { - $this->app['events']->listen(Events\JobProcessing::class, $callback); - } - - /** - * Register an event listener for the after job event. - * - * @param mixed $callback - * @return void - */ - public function after($callback) - { - $this->app['events']->listen(Events\JobProcessed::class, $callback); - } - - /** - * Register an event listener for the exception occurred job event. - * - * @param mixed $callback - * @return void - */ - public function exceptionOccurred($callback) - { - $this->app['events']->listen(Events\JobExceptionOccurred::class, $callback); - } - - /** - * Register an event listener for the daemon queue loop. - * - * @param mixed $callback - * @return void - */ - public function looping($callback) - { - $this->app['events']->listen(Events\Looping::class, $callback); - } - - /** - * Register an event listener for the failed job event. - * - * @param mixed $callback - * @return void - */ - public function failing($callback) - { - $this->app['events']->listen(Events\JobFailed::class, $callback); - } - - /** - * Register an event listener for the daemon queue stopping. - * - * @param mixed $callback - * @return void - */ - public function stopping($callback) - { - $this->app['events']->listen(Events\WorkerStopping::class, $callback); - } - - /** - * Determine if the driver is connected. - * - * @param string|null $name - * @return bool - */ - public function connected($name = null) - { - return isset($this->connections[$name ?: $this->getDefaultDriver()]); - } - - /** - * Resolve a queue connection instance. - * - * @param string|null $name - * @return \Illuminate\Contracts\Queue\Queue - */ - public function connection($name = null) - { - $name = $name ?: $this->getDefaultDriver(); - - // If the connection has not been resolved yet we will resolve it now as all - // of the connections are resolved when they are actually needed so we do - // not make any unnecessary connection to the various queue end-points. - if (! isset($this->connections[$name])) { - $this->connections[$name] = $this->resolve($name); - - $this->connections[$name]->setContainer($this->app); - } - - return $this->connections[$name]; - } - - /** - * Resolve a queue connection. - * - * @param string $name - * @return \Illuminate\Contracts\Queue\Queue - * - * @throws \InvalidArgumentException - */ - protected function resolve($name) - { - $config = $this->getConfig($name); - - if (is_null($config)) { - throw new InvalidArgumentException("The [{$name}] queue connection has not been configured."); - } - - return $this->getConnector($config['driver']) - ->connect($config) - ->setConnectionName($name); - } - - /** - * Get the connector for a given driver. - * - * @param string $driver - * @return \Illuminate\Queue\Connectors\ConnectorInterface - * - * @throws \InvalidArgumentException - */ - protected function getConnector($driver) - { - if (! isset($this->connectors[$driver])) { - throw new InvalidArgumentException("No connector for [$driver]."); - } - - return call_user_func($this->connectors[$driver]); - } - - /** - * Add a queue connection resolver. - * - * @param string $driver - * @param \Closure $resolver - * @return void - */ - public function extend($driver, Closure $resolver) - { - return $this->addConnector($driver, $resolver); - } - - /** - * Add a queue connection resolver. - * - * @param string $driver - * @param \Closure $resolver - * @return void - */ - public function addConnector($driver, Closure $resolver) - { - $this->connectors[$driver] = $resolver; - } - - /** - * Get the queue connection configuration. - * - * @param string $name - * @return array|null - */ - protected function getConfig($name) - { - if (! is_null($name) && $name !== 'null') { - return $this->app['config']["queue.connections.{$name}"]; - } - - return ['driver' => 'null']; - } - - /** - * Get the name of the default queue connection. - * - * @return string - */ - public function getDefaultDriver() - { - return $this->app['config']['queue.default']; - } - - /** - * Set the name of the default queue connection. - * - * @param string $name - * @return void - */ - public function setDefaultDriver($name) - { - $this->app['config']['queue.default'] = $name; - } - - /** - * Get the full name for the given connection. - * - * @param string|null $connection - * @return string - */ - public function getName($connection = null) - { - return $connection ?: $this->getDefaultDriver(); - } - - /** - * Get the application instance used by the manager. - * - * @return \Illuminate\Contracts\Foundation\Application - */ - public function getApplication() - { - return $this->app; - } - - /** - * Set the application instance used by the manager. - * - * @param \Illuminate\Contracts\Foundation\Application $app - * @return $this - */ - public function setApplication($app) - { - $this->app = $app; - - foreach ($this->connections as $connection) { - $connection->setContainer($app); - } - - return $this; - } - - /** - * Dynamically pass calls to the default connection. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - return $this->connection()->$method(...$parameters); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/QueueServiceProvider.php b/vendor/laravel/framework/src/Illuminate/Queue/QueueServiceProvider.php deleted file mode 100755 index 2f39ad61..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/QueueServiceProvider.php +++ /dev/null @@ -1,333 +0,0 @@ -configureSerializableClosureUses(); - - $this->registerManager(); - $this->registerConnection(); - $this->registerWorker(); - $this->registerListener(); - $this->registerFailedJobServices(); - } - - /** - * Configure serializable closures uses. - * - * @return void - */ - protected function configureSerializableClosureUses() - { - SerializableClosure::transformUseVariablesUsing(function ($data) { - foreach ($data as $key => $value) { - $data[$key] = $this->getSerializedPropertyValue($value); - } - - return $data; - }); - - SerializableClosure::resolveUseVariablesUsing(function ($data) { - foreach ($data as $key => $value) { - $data[$key] = $this->getRestoredPropertyValue($value); - } - - return $data; - }); - } - - /** - * Register the queue manager. - * - * @return void - */ - protected function registerManager() - { - $this->app->singleton('queue', function ($app) { - // Once we have an instance of the queue manager, we will register the various - // resolvers for the queue connectors. These connectors are responsible for - // creating the classes that accept queue configs and instantiate queues. - return tap(new QueueManager($app), function ($manager) { - $this->registerConnectors($manager); - }); - }); - } - - /** - * Register the default queue connection binding. - * - * @return void - */ - protected function registerConnection() - { - $this->app->singleton('queue.connection', function ($app) { - return $app['queue']->connection(); - }); - } - - /** - * Register the connectors on the queue manager. - * - * @param \Illuminate\Queue\QueueManager $manager - * @return void - */ - public function registerConnectors($manager) - { - foreach (['Null', 'Sync', 'Database', 'Redis', 'Beanstalkd', 'Sqs'] as $connector) { - $this->{"register{$connector}Connector"}($manager); - } - } - - /** - * Register the Null queue connector. - * - * @param \Illuminate\Queue\QueueManager $manager - * @return void - */ - protected function registerNullConnector($manager) - { - $manager->addConnector('null', function () { - return new NullConnector; - }); - } - - /** - * Register the Sync queue connector. - * - * @param \Illuminate\Queue\QueueManager $manager - * @return void - */ - protected function registerSyncConnector($manager) - { - $manager->addConnector('sync', function () { - return new SyncConnector; - }); - } - - /** - * Register the database queue connector. - * - * @param \Illuminate\Queue\QueueManager $manager - * @return void - */ - protected function registerDatabaseConnector($manager) - { - $manager->addConnector('database', function () { - return new DatabaseConnector($this->app['db']); - }); - } - - /** - * Register the Redis queue connector. - * - * @param \Illuminate\Queue\QueueManager $manager - * @return void - */ - protected function registerRedisConnector($manager) - { - $manager->addConnector('redis', function () { - return new RedisConnector($this->app['redis']); - }); - } - - /** - * Register the Beanstalkd queue connector. - * - * @param \Illuminate\Queue\QueueManager $manager - * @return void - */ - protected function registerBeanstalkdConnector($manager) - { - $manager->addConnector('beanstalkd', function () { - return new BeanstalkdConnector; - }); - } - - /** - * Register the Amazon SQS queue connector. - * - * @param \Illuminate\Queue\QueueManager $manager - * @return void - */ - protected function registerSqsConnector($manager) - { - $manager->addConnector('sqs', function () { - return new SqsConnector; - }); - } - - /** - * Register the queue worker. - * - * @return void - */ - protected function registerWorker() - { - $this->app->singleton('queue.worker', function ($app) { - $isDownForMaintenance = function () { - return $this->app->isDownForMaintenance(); - }; - - $resetScope = function () use ($app) { - if (method_exists($app['log']->driver(), 'withoutContext')) { - $app['log']->withoutContext(); - } - - if (method_exists($app['db'], 'getConnections')) { - foreach ($app['db']->getConnections() as $connection) { - $connection->resetTotalQueryDuration(); - $connection->allowQueryDurationHandlersToRunAgain(); - } - } - - $app->forgetScopedInstances(); - - return Facade::clearResolvedInstances(); - }; - - return new Worker( - $app['queue'], - $app['events'], - $app[ExceptionHandler::class], - $isDownForMaintenance, - $resetScope - ); - }); - } - - /** - * Register the queue listener. - * - * @return void - */ - protected function registerListener() - { - $this->app->singleton('queue.listener', function ($app) { - return new Listener($app->basePath()); - }); - } - - /** - * Register the failed job services. - * - * @return void - */ - protected function registerFailedJobServices() - { - $this->app->singleton('queue.failer', function ($app) { - $config = $app['config']['queue.failed']; - - if (array_key_exists('driver', $config) && - (is_null($config['driver']) || $config['driver'] === 'null')) { - return new NullFailedJobProvider; - } - - if (isset($config['driver']) && $config['driver'] === 'dynamodb') { - return $this->dynamoFailedJobProvider($config); - } elseif (isset($config['driver']) && $config['driver'] === 'database-uuids') { - return $this->databaseUuidFailedJobProvider($config); - } elseif (isset($config['table'])) { - return $this->databaseFailedJobProvider($config); - } else { - return new NullFailedJobProvider; - } - }); - } - - /** - * Create a new database failed job provider. - * - * @param array $config - * @return \Illuminate\Queue\Failed\DatabaseFailedJobProvider - */ - protected function databaseFailedJobProvider($config) - { - return new DatabaseFailedJobProvider( - $this->app['db'], $config['database'], $config['table'] - ); - } - - /** - * Create a new database failed job provider that uses UUIDs as IDs. - * - * @param array $config - * @return \Illuminate\Queue\Failed\DatabaseUuidFailedJobProvider - */ - protected function databaseUuidFailedJobProvider($config) - { - return new DatabaseUuidFailedJobProvider( - $this->app['db'], $config['database'], $config['table'] - ); - } - - /** - * Create a new DynamoDb failed job provider. - * - * @param array $config - * @return \Illuminate\Queue\Failed\DynamoDbFailedJobProvider - */ - protected function dynamoFailedJobProvider($config) - { - $dynamoConfig = [ - 'region' => $config['region'], - 'version' => 'latest', - 'endpoint' => $config['endpoint'] ?? null, - ]; - - if (! empty($config['key']) && ! empty($config['secret'])) { - $dynamoConfig['credentials'] = Arr::only( - $config, ['key', 'secret', 'token'] - ); - } - - return new DynamoDbFailedJobProvider( - new DynamoDbClient($dynamoConfig), - $this->app['config']['app.name'], - $config['table'] - ); - } - - /** - * Get the services provided by the provider. - * - * @return array - */ - public function provides() - { - return [ - 'queue', - 'queue.connection', - 'queue.failer', - 'queue.listener', - 'queue.worker', - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/README.md b/vendor/laravel/framework/src/Illuminate/Queue/README.md deleted file mode 100644 index 1999dd7d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/README.md +++ /dev/null @@ -1,34 +0,0 @@ -## Illuminate Queue - -The Laravel Queue component provides a unified API across a variety of different queue services. Queues allow you to defer the processing of a time consuming task, such as sending an e-mail, until a later time, thus drastically speeding up the web requests to your application. - -### Usage Instructions - -First, create a new Queue `Capsule` manager instance. Similar to the "Capsule" provided for the Eloquent ORM, the queue Capsule aims to make configuring the library for usage outside of the Laravel framework as easy as possible. - -```PHP -use Illuminate\Queue\Capsule\Manager as Queue; - -$queue = new Queue; - -$queue->addConnection([ - 'driver' => 'beanstalkd', - 'host' => 'localhost', - 'queue' => 'default', -]); - -// Make this Capsule instance available globally via static methods... (optional) -$queue->setAsGlobal(); -``` - -Once the Capsule instance has been registered. You may use it like so: - -```PHP -// As an instance... -$queue->push('SendEmail', ['message' => $message]); - -// If setAsGlobal has been called... -Queue::push('SendEmail', ['message' => $message]); -``` - -For further documentation on using the queue, consult the [Laravel framework documentation](https://laravel.com/docs). diff --git a/vendor/laravel/framework/src/Illuminate/Queue/RedisQueue.php b/vendor/laravel/framework/src/Illuminate/Queue/RedisQueue.php deleted file mode 100644 index 4c376a81..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/RedisQueue.php +++ /dev/null @@ -1,382 +0,0 @@ -redis = $redis; - $this->default = $default; - $this->blockFor = $blockFor; - $this->connection = $connection; - $this->retryAfter = $retryAfter; - $this->dispatchAfterCommit = $dispatchAfterCommit; - $this->migrationBatchSize = $migrationBatchSize; - } - - /** - * Get the size of the queue. - * - * @param string|null $queue - * @return int - */ - public function size($queue = null) - { - $queue = $this->getQueue($queue); - - return $this->getConnection()->eval( - LuaScripts::size(), 3, $queue, $queue.':delayed', $queue.':reserved' - ); - } - - /** - * Push an array of jobs onto the queue. - * - * @param array $jobs - * @param mixed $data - * @param string|null $queue - * @return void - */ - public function bulk($jobs, $data = '', $queue = null) - { - $this->getConnection()->pipeline(function () use ($jobs, $data, $queue) { - $this->getConnection()->transaction(function () use ($jobs, $data, $queue) { - foreach ((array) $jobs as $job) { - if (isset($job->delay)) { - $this->later($job->delay, $job, $data, $queue); - } else { - $this->push($job, $data, $queue); - } - } - }); - }); - } - - /** - * Push a new job onto the queue. - * - * @param object|string $job - * @param mixed $data - * @param string|null $queue - * @return mixed - */ - public function push($job, $data = '', $queue = null) - { - return $this->enqueueUsing( - $job, - $this->createPayload($job, $this->getQueue($queue), $data), - $queue, - null, - function ($payload, $queue) { - return $this->pushRaw($payload, $queue); - } - ); - } - - /** - * Push a raw payload onto the queue. - * - * @param string $payload - * @param string|null $queue - * @param array $options - * @return mixed - */ - public function pushRaw($payload, $queue = null, array $options = []) - { - $this->getConnection()->eval( - LuaScripts::push(), 2, $this->getQueue($queue), - $this->getQueue($queue).':notify', $payload - ); - - return json_decode($payload, true)['id'] ?? null; - } - - /** - * Push a new job onto the queue after a delay. - * - * @param \DateTimeInterface|\DateInterval|int $delay - * @param object|string $job - * @param mixed $data - * @param string|null $queue - * @return mixed - */ - public function later($delay, $job, $data = '', $queue = null) - { - return $this->enqueueUsing( - $job, - $this->createPayload($job, $this->getQueue($queue), $data), - $queue, - $delay, - function ($payload, $queue, $delay) { - return $this->laterRaw($delay, $payload, $queue); - } - ); - } - - /** - * Push a raw job onto the queue after (n) seconds. - * - * @param \DateTimeInterface|\DateInterval|int $delay - * @param string $payload - * @param string|null $queue - * @return mixed - */ - protected function laterRaw($delay, $payload, $queue = null) - { - $this->getConnection()->zadd( - $this->getQueue($queue).':delayed', $this->availableAt($delay), $payload - ); - - return json_decode($payload, true)['id'] ?? null; - } - - /** - * Create a payload string from the given job and data. - * - * @param string $job - * @param string $queue - * @param mixed $data - * @return array - */ - protected function createPayloadArray($job, $queue, $data = '') - { - return array_merge(parent::createPayloadArray($job, $queue, $data), [ - 'id' => $this->getRandomId(), - 'attempts' => 0, - ]); - } - - /** - * Pop the next job off of the queue. - * - * @param string|null $queue - * @return \Illuminate\Contracts\Queue\Job|null - */ - public function pop($queue = null) - { - $this->migrate($prefixed = $this->getQueue($queue)); - - [$job, $reserved] = $this->retrieveNextJob($prefixed); - - if ($reserved) { - return new RedisJob( - $this->container, $this, $job, - $reserved, $this->connectionName, $queue ?: $this->default - ); - } - } - - /** - * Migrate any delayed or expired jobs onto the primary queue. - * - * @param string $queue - * @return void - */ - protected function migrate($queue) - { - $this->migrateExpiredJobs($queue.':delayed', $queue); - - if (! is_null($this->retryAfter)) { - $this->migrateExpiredJobs($queue.':reserved', $queue); - } - } - - /** - * Migrate the delayed jobs that are ready to the regular queue. - * - * @param string $from - * @param string $to - * @param int $limit - * @return array - */ - public function migrateExpiredJobs($from, $to) - { - return $this->getConnection()->eval( - LuaScripts::migrateExpiredJobs(), 3, $from, $to, $to.':notify', $this->currentTime(), $this->migrationBatchSize - ); - } - - /** - * Retrieve the next job from the queue. - * - * @param string $queue - * @param bool $block - * @return array - */ - protected function retrieveNextJob($queue, $block = true) - { - $nextJob = $this->getConnection()->eval( - LuaScripts::pop(), 3, $queue, $queue.':reserved', $queue.':notify', - $this->availableAt($this->retryAfter) - ); - - if (empty($nextJob)) { - return [null, null]; - } - - [$job, $reserved] = $nextJob; - - if (! $job && ! is_null($this->blockFor) && $block && - $this->getConnection()->blpop([$queue.':notify'], $this->blockFor)) { - return $this->retrieveNextJob($queue, false); - } - - return [$job, $reserved]; - } - - /** - * Delete a reserved job from the queue. - * - * @param string $queue - * @param \Illuminate\Queue\Jobs\RedisJob $job - * @return void - */ - public function deleteReserved($queue, $job) - { - $this->getConnection()->zrem($this->getQueue($queue).':reserved', $job->getReservedJob()); - } - - /** - * Delete a reserved job from the reserved queue and release it. - * - * @param string $queue - * @param \Illuminate\Queue\Jobs\RedisJob $job - * @param int $delay - * @return void - */ - public function deleteAndRelease($queue, $job, $delay) - { - $queue = $this->getQueue($queue); - - $this->getConnection()->eval( - LuaScripts::release(), 2, $queue.':delayed', $queue.':reserved', - $job->getReservedJob(), $this->availableAt($delay) - ); - } - - /** - * Delete all of the jobs from the queue. - * - * @param string $queue - * @return int - */ - public function clear($queue) - { - $queue = $this->getQueue($queue); - - return $this->getConnection()->eval( - LuaScripts::clear(), 4, $queue, $queue.':delayed', - $queue.':reserved', $queue.':notify' - ); - } - - /** - * Get a random ID string. - * - * @return string - */ - protected function getRandomId() - { - return Str::random(32); - } - - /** - * Get the queue or return the default. - * - * @param string|null $queue - * @return string - */ - public function getQueue($queue) - { - return 'queues:'.($queue ?: $this->default); - } - - /** - * Get the connection for the queue. - * - * @return \Illuminate\Redis\Connections\Connection - */ - public function getConnection() - { - return $this->redis->connection($this->connection); - } - - /** - * Get the underlying Redis instance. - * - * @return \Illuminate\Contracts\Redis\Factory - */ - public function getRedis() - { - return $this->redis; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/SerializesAndRestoresModelIdentifiers.php b/vendor/laravel/framework/src/Illuminate/Queue/SerializesAndRestoresModelIdentifiers.php deleted file mode 100644 index 748c3459..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/SerializesAndRestoresModelIdentifiers.php +++ /dev/null @@ -1,122 +0,0 @@ -getQueueableClass(), - $value->getQueueableIds(), - $value->getQueueableRelations(), - $value->getQueueableConnection() - ))->useCollectionClass( - ($collectionClass = get_class($value)) !== EloquentCollection::class - ? $collectionClass - : null - ); - } - - if ($value instanceof QueueableEntity) { - return new ModelIdentifier( - get_class($value), - $value->getQueueableId(), - $value->getQueueableRelations(), - $value->getQueueableConnection() - ); - } - - return $value; - } - - /** - * Get the restored property value after deserialization. - * - * @param mixed $value - * @return mixed - */ - protected function getRestoredPropertyValue($value) - { - if (! $value instanceof ModelIdentifier) { - return $value; - } - - return is_array($value->id) - ? $this->restoreCollection($value) - : $this->restoreModel($value); - } - - /** - * Restore a queueable collection instance. - * - * @param \Illuminate\Contracts\Database\ModelIdentifier $value - * @return \Illuminate\Database\Eloquent\Collection - */ - protected function restoreCollection($value) - { - if (! $value->class || count($value->id) === 0) { - return ! is_null($value->collectionClass ?? null) - ? new $value->collectionClass - : new EloquentCollection; - } - - $collection = $this->getQueryForModelRestoration( - (new $value->class)->setConnection($value->connection), $value->id - )->useWritePdo()->get(); - - if (is_a($value->class, Pivot::class, true) || - in_array(AsPivot::class, class_uses($value->class))) { - return $collection; - } - - $collection = $collection->keyBy->getKey(); - - $collectionClass = get_class($collection); - - return new $collectionClass( - collect($value->id)->map(function ($id) use ($collection) { - return $collection[$id] ?? null; - })->filter() - ); - } - - /** - * Restore the model from the model identifier instance. - * - * @param \Illuminate\Contracts\Database\ModelIdentifier $value - * @return \Illuminate\Database\Eloquent\Model - */ - public function restoreModel($value) - { - return $this->getQueryForModelRestoration( - (new $value->class)->setConnection($value->connection), $value->id - )->useWritePdo()->firstOrFail()->load($value->relations ?? []); - } - - /** - * Get the query for model restoration. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @param array|int $ids - * @return \Illuminate\Database\Eloquent\Builder - */ - protected function getQueryForModelRestoration($model, $ids) - { - return $model->newQueryForRestoration($ids); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/SerializesModels.php b/vendor/laravel/framework/src/Illuminate/Queue/SerializesModels.php deleted file mode 100644 index e5d176d7..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/SerializesModels.php +++ /dev/null @@ -1,105 +0,0 @@ -getProperties(); - - $class = get_class($this); - - foreach ($properties as $property) { - if ($property->isStatic()) { - continue; - } - - $property->setAccessible(true); - - if (! $property->isInitialized($this)) { - continue; - } - - $value = $this->getPropertyValue($property); - - if ($property->hasDefaultValue() && $value === $property->getDefaultValue()) { - continue; - } - - $name = $property->getName(); - - if ($property->isPrivate()) { - $name = "\0{$class}\0{$name}"; - } elseif ($property->isProtected()) { - $name = "\0*\0{$name}"; - } - - $values[$name] = $this->getSerializedPropertyValue($value); - } - - return $values; - } - - /** - * Restore the model after serialization. - * - * @param array $values - * @return void - */ - public function __unserialize(array $values) - { - $properties = (new ReflectionClass($this))->getProperties(); - - $class = get_class($this); - - foreach ($properties as $property) { - if ($property->isStatic()) { - continue; - } - - $name = $property->getName(); - - if ($property->isPrivate()) { - $name = "\0{$class}\0{$name}"; - } elseif ($property->isProtected()) { - $name = "\0*\0{$name}"; - } - - if (! array_key_exists($name, $values)) { - continue; - } - - $property->setAccessible(true); - - $property->setValue( - $this, $this->getRestoredPropertyValue($values[$name]) - ); - } - } - - /** - * Get the property value for the given property. - * - * @param \ReflectionProperty $property - * @return mixed - */ - protected function getPropertyValue(ReflectionProperty $property) - { - $property->setAccessible(true); - - return $property->getValue($this); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/SqsQueue.php b/vendor/laravel/framework/src/Illuminate/Queue/SqsQueue.php deleted file mode 100755 index 38849f99..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/SqsQueue.php +++ /dev/null @@ -1,241 +0,0 @@ -sqs = $sqs; - $this->prefix = $prefix; - $this->default = $default; - $this->suffix = $suffix; - $this->dispatchAfterCommit = $dispatchAfterCommit; - } - - /** - * Get the size of the queue. - * - * @param string|null $queue - * @return int - */ - public function size($queue = null) - { - $response = $this->sqs->getQueueAttributes([ - 'QueueUrl' => $this->getQueue($queue), - 'AttributeNames' => ['ApproximateNumberOfMessages'], - ]); - - $attributes = $response->get('Attributes'); - - return (int) $attributes['ApproximateNumberOfMessages']; - } - - /** - * Push a new job onto the queue. - * - * @param string $job - * @param mixed $data - * @param string|null $queue - * @return mixed - */ - public function push($job, $data = '', $queue = null) - { - return $this->enqueueUsing( - $job, - $this->createPayload($job, $queue ?: $this->default, $data), - $queue, - null, - function ($payload, $queue) { - return $this->pushRaw($payload, $queue); - } - ); - } - - /** - * Push a raw payload onto the queue. - * - * @param string $payload - * @param string|null $queue - * @param array $options - * @return mixed - */ - public function pushRaw($payload, $queue = null, array $options = []) - { - return $this->sqs->sendMessage([ - 'QueueUrl' => $this->getQueue($queue), 'MessageBody' => $payload, - ])->get('MessageId'); - } - - /** - * Push a new job onto the queue after (n) seconds. - * - * @param \DateTimeInterface|\DateInterval|int $delay - * @param string $job - * @param mixed $data - * @param string|null $queue - * @return mixed - */ - public function later($delay, $job, $data = '', $queue = null) - { - return $this->enqueueUsing( - $job, - $this->createPayload($job, $queue ?: $this->default, $data), - $queue, - $delay, - function ($payload, $queue, $delay) { - return $this->sqs->sendMessage([ - 'QueueUrl' => $this->getQueue($queue), - 'MessageBody' => $payload, - 'DelaySeconds' => $this->secondsUntil($delay), - ])->get('MessageId'); - } - ); - } - - /** - * Push an array of jobs onto the queue. - * - * @param array $jobs - * @param mixed $data - * @param string|null $queue - * @return void - */ - public function bulk($jobs, $data = '', $queue = null) - { - foreach ((array) $jobs as $job) { - if (isset($job->delay)) { - $this->later($job->delay, $job, $data, $queue); - } else { - $this->push($job, $data, $queue); - } - } - } - - /** - * Pop the next job off of the queue. - * - * @param string|null $queue - * @return \Illuminate\Contracts\Queue\Job|null - */ - public function pop($queue = null) - { - $response = $this->sqs->receiveMessage([ - 'QueueUrl' => $queue = $this->getQueue($queue), - 'AttributeNames' => ['ApproximateReceiveCount'], - ]); - - if (! is_null($response['Messages']) && count($response['Messages']) > 0) { - return new SqsJob( - $this->container, $this->sqs, $response['Messages'][0], - $this->connectionName, $queue - ); - } - } - - /** - * Delete all of the jobs from the queue. - * - * @param string $queue - * @return int - */ - public function clear($queue) - { - return tap($this->size($queue), function () use ($queue) { - $this->sqs->purgeQueue([ - 'QueueUrl' => $this->getQueue($queue), - ]); - }); - } - - /** - * Get the queue or return the default. - * - * @param string|null $queue - * @return string - */ - public function getQueue($queue) - { - $queue = $queue ?: $this->default; - - return filter_var($queue, FILTER_VALIDATE_URL) === false - ? $this->suffixQueue($queue, $this->suffix) - : $queue; - } - - /** - * Add the given suffix to the given queue name. - * - * @param string $queue - * @param string $suffix - * @return string - */ - protected function suffixQueue($queue, $suffix = '') - { - if (str_ends_with($queue, '.fifo')) { - $queue = Str::beforeLast($queue, '.fifo'); - - return rtrim($this->prefix, '/').'/'.Str::finish($queue, $suffix).'.fifo'; - } - - return rtrim($this->prefix, '/').'/'.Str::finish($queue, $this->suffix); - } - - /** - * Get the underlying SQS instance. - * - * @return \Aws\Sqs\SqsClient - */ - public function getSqs() - { - return $this->sqs; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/SyncQueue.php b/vendor/laravel/framework/src/Illuminate/Queue/SyncQueue.php deleted file mode 100755 index f416b023..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/SyncQueue.php +++ /dev/null @@ -1,160 +0,0 @@ -resolveJob($this->createPayload($job, $queue, $data), $queue); - - try { - $this->raiseBeforeJobEvent($queueJob); - - $queueJob->fire(); - - $this->raiseAfterJobEvent($queueJob); - } catch (Throwable $e) { - $this->handleException($queueJob, $e); - } - - return 0; - } - - /** - * Resolve a Sync job instance. - * - * @param string $payload - * @param string $queue - * @return \Illuminate\Queue\Jobs\SyncJob - */ - protected function resolveJob($payload, $queue) - { - return new SyncJob($this->container, $payload, $this->connectionName, $queue); - } - - /** - * Raise the before queue job event. - * - * @param \Illuminate\Contracts\Queue\Job $job - * @return void - */ - protected function raiseBeforeJobEvent(Job $job) - { - if ($this->container->bound('events')) { - $this->container['events']->dispatch(new JobProcessing($this->connectionName, $job)); - } - } - - /** - * Raise the after queue job event. - * - * @param \Illuminate\Contracts\Queue\Job $job - * @return void - */ - protected function raiseAfterJobEvent(Job $job) - { - if ($this->container->bound('events')) { - $this->container['events']->dispatch(new JobProcessed($this->connectionName, $job)); - } - } - - /** - * Raise the exception occurred queue job event. - * - * @param \Illuminate\Contracts\Queue\Job $job - * @param \Throwable $e - * @return void - */ - protected function raiseExceptionOccurredJobEvent(Job $job, Throwable $e) - { - if ($this->container->bound('events')) { - $this->container['events']->dispatch(new JobExceptionOccurred($this->connectionName, $job, $e)); - } - } - - /** - * Handle an exception that occurred while processing a job. - * - * @param \Illuminate\Contracts\Queue\Job $queueJob - * @param \Throwable $e - * @return void - * - * @throws \Throwable - */ - protected function handleException(Job $queueJob, Throwable $e) - { - $this->raiseExceptionOccurredJobEvent($queueJob, $e); - - $queueJob->fail($e); - - throw $e; - } - - /** - * Push a raw payload onto the queue. - * - * @param string $payload - * @param string|null $queue - * @param array $options - * @return mixed - */ - public function pushRaw($payload, $queue = null, array $options = []) - { - // - } - - /** - * Push a new job onto the queue after (n) seconds. - * - * @param \DateTimeInterface|\DateInterval|int $delay - * @param string $job - * @param mixed $data - * @param string|null $queue - * @return mixed - */ - public function later($delay, $job, $data = '', $queue = null) - { - return $this->push($job, $data, $queue); - } - - /** - * Pop the next job off of the queue. - * - * @param string|null $queue - * @return \Illuminate\Contracts\Queue\Job|null - */ - public function pop($queue = null) - { - // - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/Worker.php b/vendor/laravel/framework/src/Illuminate/Queue/Worker.php deleted file mode 100644 index 8be7a10f..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/Worker.php +++ /dev/null @@ -1,828 +0,0 @@ -events = $events; - $this->manager = $manager; - $this->exceptions = $exceptions; - $this->isDownForMaintenance = $isDownForMaintenance; - $this->resetScope = $resetScope; - } - - /** - * Listen to the given queue in a loop. - * - * @param string $connectionName - * @param string $queue - * @param \Illuminate\Queue\WorkerOptions $options - * @return int - */ - public function daemon($connectionName, $queue, WorkerOptions $options) - { - if ($supportsAsyncSignals = $this->supportsAsyncSignals()) { - $this->listenForSignals(); - } - - $lastRestart = $this->getTimestampOfLastQueueRestart(); - - [$startTime, $jobsProcessed] = [hrtime(true) / 1e9, 0]; - - while (true) { - // Before reserving any jobs, we will make sure this queue is not paused and - // if it is we will just pause this worker for a given amount of time and - // make sure we do not need to kill this worker process off completely. - if (! $this->daemonShouldRun($options, $connectionName, $queue)) { - $status = $this->pauseWorker($options, $lastRestart); - - if (! is_null($status)) { - return $this->stop($status, $options); - } - - continue; - } - - if (isset($this->resetScope)) { - ($this->resetScope)(); - } - - // First, we will attempt to get the next job off of the queue. We will also - // register the timeout handler and reset the alarm for this job so it is - // not stuck in a frozen state forever. Then, we can fire off this job. - $job = $this->getNextJob( - $this->manager->connection($connectionName), $queue - ); - - if ($supportsAsyncSignals) { - $this->registerTimeoutHandler($job, $options); - } - - // If the daemon should run (not in maintenance mode, etc.), then we can run - // fire off this job for processing. Otherwise, we will need to sleep the - // worker so no more jobs are processed until they should be processed. - if ($job) { - $jobsProcessed++; - - $this->runJob($job, $connectionName, $options); - - if ($options->rest > 0) { - $this->sleep($options->rest); - } - } else { - $this->sleep($options->sleep); - } - - if ($supportsAsyncSignals) { - $this->resetTimeoutHandler(); - } - - // Finally, we will check to see if we have exceeded our memory limits or if - // the queue should restart based on other indications. If so, we'll stop - // this worker and let whatever is "monitoring" it restart the process. - $status = $this->stopIfNecessary( - $options, $lastRestart, $startTime, $jobsProcessed, $job - ); - - if (! is_null($status)) { - return $this->stop($status, $options); - } - } - } - - /** - * Register the worker timeout handler. - * - * @param \Illuminate\Contracts\Queue\Job|null $job - * @param \Illuminate\Queue\WorkerOptions $options - * @return void - */ - protected function registerTimeoutHandler($job, WorkerOptions $options) - { - // We will register a signal handler for the alarm signal so that we can kill this - // process if it is running too long because it has frozen. This uses the async - // signals supported in recent versions of PHP to accomplish it conveniently. - pcntl_signal(SIGALRM, function () use ($job, $options) { - if ($job) { - $this->markJobAsFailedIfWillExceedMaxAttempts( - $job->getConnectionName(), $job, (int) $options->maxTries, $e = $this->maxAttemptsExceededException($job) - ); - - $this->markJobAsFailedIfWillExceedMaxExceptions( - $job->getConnectionName(), $job, $e - ); - - $this->markJobAsFailedIfItShouldFailOnTimeout( - $job->getConnectionName(), $job, $e - ); - } - - $this->kill(static::EXIT_ERROR, $options); - }); - - pcntl_alarm( - max($this->timeoutForJob($job, $options), 0) - ); - } - - /** - * Reset the worker timeout handler. - * - * @return void - */ - protected function resetTimeoutHandler() - { - pcntl_alarm(0); - } - - /** - * Get the appropriate timeout for the given job. - * - * @param \Illuminate\Contracts\Queue\Job|null $job - * @param \Illuminate\Queue\WorkerOptions $options - * @return int - */ - protected function timeoutForJob($job, WorkerOptions $options) - { - return $job && ! is_null($job->timeout()) ? $job->timeout() : $options->timeout; - } - - /** - * Determine if the daemon should process on this iteration. - * - * @param \Illuminate\Queue\WorkerOptions $options - * @param string $connectionName - * @param string $queue - * @return bool - */ - protected function daemonShouldRun(WorkerOptions $options, $connectionName, $queue) - { - return ! ((($this->isDownForMaintenance)() && ! $options->force) || - $this->paused || - $this->events->until(new Looping($connectionName, $queue)) === false); - } - - /** - * Pause the worker for the current loop. - * - * @param \Illuminate\Queue\WorkerOptions $options - * @param int $lastRestart - * @return int|null - */ - protected function pauseWorker(WorkerOptions $options, $lastRestart) - { - $this->sleep($options->sleep > 0 ? $options->sleep : 1); - - return $this->stopIfNecessary($options, $lastRestart); - } - - /** - * Determine the exit code to stop the process if necessary. - * - * @param \Illuminate\Queue\WorkerOptions $options - * @param int $lastRestart - * @param int $startTime - * @param int $jobsProcessed - * @param mixed $job - * @return int|null - */ - protected function stopIfNecessary(WorkerOptions $options, $lastRestart, $startTime = 0, $jobsProcessed = 0, $job = null) - { - return match (true) { - $this->shouldQuit => static::EXIT_SUCCESS, - $this->memoryExceeded($options->memory) => static::EXIT_MEMORY_LIMIT, - $this->queueShouldRestart($lastRestart) => static::EXIT_SUCCESS, - $options->stopWhenEmpty && is_null($job) => static::EXIT_SUCCESS, - $options->maxTime && hrtime(true) / 1e9 - $startTime >= $options->maxTime => static::EXIT_SUCCESS, - $options->maxJobs && $jobsProcessed >= $options->maxJobs => static::EXIT_SUCCESS, - default => null - }; - } - - /** - * Process the next job on the queue. - * - * @param string $connectionName - * @param string $queue - * @param \Illuminate\Queue\WorkerOptions $options - * @return void - */ - public function runNextJob($connectionName, $queue, WorkerOptions $options) - { - $job = $this->getNextJob( - $this->manager->connection($connectionName), $queue - ); - - // If we're able to pull a job off of the stack, we will process it and then return - // from this method. If there is no job on the queue, we will "sleep" the worker - // for the specified number of seconds, then keep processing jobs after sleep. - if ($job) { - return $this->runJob($job, $connectionName, $options); - } - - $this->sleep($options->sleep); - } - - /** - * Get the next job from the queue connection. - * - * @param \Illuminate\Contracts\Queue\Queue $connection - * @param string $queue - * @return \Illuminate\Contracts\Queue\Job|null - */ - protected function getNextJob($connection, $queue) - { - $popJobCallback = function ($queue) use ($connection) { - return $connection->pop($queue); - }; - - try { - if (isset(static::$popCallbacks[$this->name])) { - return (static::$popCallbacks[$this->name])($popJobCallback, $queue); - } - - foreach (explode(',', $queue) as $queue) { - if (! is_null($job = $popJobCallback($queue))) { - return $job; - } - } - } catch (Throwable $e) { - $this->exceptions->report($e); - - $this->stopWorkerIfLostConnection($e); - - $this->sleep(1); - } - } - - /** - * Process the given job. - * - * @param \Illuminate\Contracts\Queue\Job $job - * @param string $connectionName - * @param \Illuminate\Queue\WorkerOptions $options - * @return void - */ - protected function runJob($job, $connectionName, WorkerOptions $options) - { - try { - return $this->process($connectionName, $job, $options); - } catch (Throwable $e) { - $this->exceptions->report($e); - - $this->stopWorkerIfLostConnection($e); - } - } - - /** - * Stop the worker if we have lost connection to a database. - * - * @param \Throwable $e - * @return void - */ - protected function stopWorkerIfLostConnection($e) - { - if ($this->causedByLostConnection($e)) { - $this->shouldQuit = true; - } - } - - /** - * Process the given job from the queue. - * - * @param string $connectionName - * @param \Illuminate\Contracts\Queue\Job $job - * @param \Illuminate\Queue\WorkerOptions $options - * @return void - * - * @throws \Throwable - */ - public function process($connectionName, $job, WorkerOptions $options) - { - try { - // First we will raise the before job event and determine if the job has already run - // over its maximum attempt limits, which could primarily happen when this job is - // continually timing out and not actually throwing any exceptions from itself. - $this->raiseBeforeJobEvent($connectionName, $job); - - $this->markJobAsFailedIfAlreadyExceedsMaxAttempts( - $connectionName, $job, (int) $options->maxTries - ); - - if ($job->isDeleted()) { - return $this->raiseAfterJobEvent($connectionName, $job); - } - - // Here we will fire off the job and let it process. We will catch any exceptions, so - // they can be reported to the developer's logs, etc. Once the job is finished the - // proper events will be fired to let any listeners know this job has completed. - $job->fire(); - - $this->raiseAfterJobEvent($connectionName, $job); - } catch (Throwable $e) { - $this->handleJobException($connectionName, $job, $options, $e); - } - } - - /** - * Handle an exception that occurred while the job was running. - * - * @param string $connectionName - * @param \Illuminate\Contracts\Queue\Job $job - * @param \Illuminate\Queue\WorkerOptions $options - * @param \Throwable $e - * @return void - * - * @throws \Throwable - */ - protected function handleJobException($connectionName, $job, WorkerOptions $options, Throwable $e) - { - try { - // First, we will go ahead and mark the job as failed if it will exceed the maximum - // attempts it is allowed to run the next time we process it. If so we will just - // go ahead and mark it as failed now so we do not have to release this again. - if (! $job->hasFailed()) { - $this->markJobAsFailedIfWillExceedMaxAttempts( - $connectionName, $job, (int) $options->maxTries, $e - ); - - $this->markJobAsFailedIfWillExceedMaxExceptions( - $connectionName, $job, $e - ); - } - - $this->raiseExceptionOccurredJobEvent( - $connectionName, $job, $e - ); - } finally { - // If we catch an exception, we will attempt to release the job back onto the queue - // so it is not lost entirely. This'll let the job be retried at a later time by - // another listener (or this same one). We will re-throw this exception after. - if (! $job->isDeleted() && ! $job->isReleased() && ! $job->hasFailed()) { - $job->release($this->calculateBackoff($job, $options)); - - $this->events->dispatch(new JobReleasedAfterException( - $connectionName, $job - )); - } - } - - throw $e; - } - - /** - * Mark the given job as failed if it has exceeded the maximum allowed attempts. - * - * This will likely be because the job previously exceeded a timeout. - * - * @param string $connectionName - * @param \Illuminate\Contracts\Queue\Job $job - * @param int $maxTries - * @return void - * - * @throws \Throwable - */ - protected function markJobAsFailedIfAlreadyExceedsMaxAttempts($connectionName, $job, $maxTries) - { - $maxTries = ! is_null($job->maxTries()) ? $job->maxTries() : $maxTries; - - $retryUntil = $job->retryUntil(); - - if ($retryUntil && Carbon::now()->getTimestamp() <= $retryUntil) { - return; - } - - if (! $retryUntil && ($maxTries === 0 || $job->attempts() <= $maxTries)) { - return; - } - - $this->failJob($job, $e = $this->maxAttemptsExceededException($job)); - - throw $e; - } - - /** - * Mark the given job as failed if it has exceeded the maximum allowed attempts. - * - * @param string $connectionName - * @param \Illuminate\Contracts\Queue\Job $job - * @param int $maxTries - * @param \Throwable $e - * @return void - */ - protected function markJobAsFailedIfWillExceedMaxAttempts($connectionName, $job, $maxTries, Throwable $e) - { - $maxTries = ! is_null($job->maxTries()) ? $job->maxTries() : $maxTries; - - if ($job->retryUntil() && $job->retryUntil() <= Carbon::now()->getTimestamp()) { - $this->failJob($job, $e); - } - - if (! $job->retryUntil() && $maxTries > 0 && $job->attempts() >= $maxTries) { - $this->failJob($job, $e); - } - } - - /** - * Mark the given job as failed if it has exceeded the maximum allowed attempts. - * - * @param string $connectionName - * @param \Illuminate\Contracts\Queue\Job $job - * @param \Throwable $e - * @return void - */ - protected function markJobAsFailedIfWillExceedMaxExceptions($connectionName, $job, Throwable $e) - { - if (! $this->cache || is_null($uuid = $job->uuid()) || - is_null($maxExceptions = $job->maxExceptions())) { - return; - } - - if (! $this->cache->get('job-exceptions:'.$uuid)) { - $this->cache->put('job-exceptions:'.$uuid, 0, Carbon::now()->addDay()); - } - - if ($maxExceptions <= $this->cache->increment('job-exceptions:'.$uuid)) { - $this->cache->forget('job-exceptions:'.$uuid); - - $this->failJob($job, $e); - } - } - - /** - * Mark the given job as failed if it should fail on timeouts. - * - * @param string $connectionName - * @param \Illuminate\Contracts\Queue\Job $job - * @param \Throwable $e - * @return void - */ - protected function markJobAsFailedIfItShouldFailOnTimeout($connectionName, $job, Throwable $e) - { - if (method_exists($job, 'shouldFailOnTimeout') ? $job->shouldFailOnTimeout() : false) { - $this->failJob($job, $e); - } - } - - /** - * Mark the given job as failed and raise the relevant event. - * - * @param \Illuminate\Contracts\Queue\Job $job - * @param \Throwable $e - * @return void - */ - protected function failJob($job, Throwable $e) - { - $job->fail($e); - } - - /** - * Calculate the backoff for the given job. - * - * @param \Illuminate\Contracts\Queue\Job $job - * @param \Illuminate\Queue\WorkerOptions $options - * @return int - */ - protected function calculateBackoff($job, WorkerOptions $options) - { - $backoff = explode( - ',', - method_exists($job, 'backoff') && ! is_null($job->backoff()) - ? $job->backoff() - : $options->backoff - ); - - return (int) ($backoff[$job->attempts() - 1] ?? last($backoff)); - } - - /** - * Raise the before queue job event. - * - * @param string $connectionName - * @param \Illuminate\Contracts\Queue\Job $job - * @return void - */ - protected function raiseBeforeJobEvent($connectionName, $job) - { - $this->events->dispatch(new JobProcessing( - $connectionName, $job - )); - } - - /** - * Raise the after queue job event. - * - * @param string $connectionName - * @param \Illuminate\Contracts\Queue\Job $job - * @return void - */ - protected function raiseAfterJobEvent($connectionName, $job) - { - $this->events->dispatch(new JobProcessed( - $connectionName, $job - )); - } - - /** - * Raise the exception occurred queue job event. - * - * @param string $connectionName - * @param \Illuminate\Contracts\Queue\Job $job - * @param \Throwable $e - * @return void - */ - protected function raiseExceptionOccurredJobEvent($connectionName, $job, Throwable $e) - { - $this->events->dispatch(new JobExceptionOccurred( - $connectionName, $job, $e - )); - } - - /** - * Determine if the queue worker should restart. - * - * @param int|null $lastRestart - * @return bool - */ - protected function queueShouldRestart($lastRestart) - { - return $this->getTimestampOfLastQueueRestart() != $lastRestart; - } - - /** - * Get the last queue restart timestamp, or null. - * - * @return int|null - */ - protected function getTimestampOfLastQueueRestart() - { - if ($this->cache) { - return $this->cache->get('illuminate:queue:restart'); - } - } - - /** - * Enable async signals for the process. - * - * @return void - */ - protected function listenForSignals() - { - pcntl_async_signals(true); - - pcntl_signal(SIGQUIT, fn () => $this->shouldQuit = true); - pcntl_signal(SIGTERM, fn () => $this->shouldQuit = true); - pcntl_signal(SIGUSR2, fn () => $this->paused = true); - pcntl_signal(SIGCONT, fn () => $this->paused = false); - } - - /** - * Determine if "async" signals are supported. - * - * @return bool - */ - protected function supportsAsyncSignals() - { - return extension_loaded('pcntl'); - } - - /** - * Determine if the memory limit has been exceeded. - * - * @param int $memoryLimit - * @return bool - */ - public function memoryExceeded($memoryLimit) - { - return (memory_get_usage(true) / 1024 / 1024) >= $memoryLimit; - } - - /** - * Stop listening and bail out of the script. - * - * @param int $status - * @param WorkerOptions|null $options - * @return int - */ - public function stop($status = 0, $options = null) - { - $this->events->dispatch(new WorkerStopping($status, $options)); - - return $status; - } - - /** - * Kill the process. - * - * @param int $status - * @param \Illuminate\Queue\WorkerOptions|null $options - * @return never - */ - public function kill($status = 0, $options = null) - { - $this->events->dispatch(new WorkerStopping($status, $options)); - - if (extension_loaded('posix')) { - posix_kill(getmypid(), SIGKILL); - } - - exit($status); - } - - /** - * Create an instance of MaxAttemptsExceededException. - * - * @param \Illuminate\Contracts\Queue\Job $job - * @return \Illuminate\Queue\MaxAttemptsExceededException - */ - protected function maxAttemptsExceededException($job) - { - return new MaxAttemptsExceededException( - $job->resolveName().' has been attempted too many times or run too long. The job may have previously timed out.' - ); - } - - /** - * Sleep the script for a given number of seconds. - * - * @param int|float $seconds - * @return void - */ - public function sleep($seconds) - { - if ($seconds < 1) { - usleep($seconds * 1000000); - } else { - sleep($seconds); - } - } - - /** - * Set the cache repository implementation. - * - * @param \Illuminate\Contracts\Cache\Repository $cache - * @return $this - */ - public function setCache(CacheContract $cache) - { - $this->cache = $cache; - - return $this; - } - - /** - * Set the name of the worker. - * - * @param string $name - * @return $this - */ - public function setName($name) - { - $this->name = $name; - - return $this; - } - - /** - * Register a callback to be executed to pick jobs. - * - * @param string $workerName - * @param callable $callback - * @return void - */ - public static function popUsing($workerName, $callback) - { - if (is_null($callback)) { - unset(static::$popCallbacks[$workerName]); - } else { - static::$popCallbacks[$workerName] = $callback; - } - } - - /** - * Get the queue manager instance. - * - * @return \Illuminate\Contracts\Queue\Factory - */ - public function getManager() - { - return $this->manager; - } - - /** - * Set the queue manager instance. - * - * @param \Illuminate\Contracts\Queue\Factory $manager - * @return void - */ - public function setManager(QueueManager $manager) - { - $this->manager = $manager; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/WorkerOptions.php b/vendor/laravel/framework/src/Illuminate/Queue/WorkerOptions.php deleted file mode 100644 index 0fbb03e2..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/WorkerOptions.php +++ /dev/null @@ -1,115 +0,0 @@ -name = $name; - $this->backoff = $backoff; - $this->sleep = $sleep; - $this->rest = $rest; - $this->force = $force; - $this->memory = $memory; - $this->timeout = $timeout; - $this->maxTries = $maxTries; - $this->stopWhenEmpty = $stopWhenEmpty; - $this->maxJobs = $maxJobs; - $this->maxTime = $maxTime; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Queue/composer.json b/vendor/laravel/framework/src/Illuminate/Queue/composer.json deleted file mode 100644 index f9681738..00000000 --- a/vendor/laravel/framework/src/Illuminate/Queue/composer.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "illuminate/queue", - "description": "The Illuminate Queue package.", - "license": "MIT", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "require": { - "php": "^8.0.2", - "ext-json": "*", - "illuminate/collections": "^9.0", - "illuminate/console": "^9.0", - "illuminate/container": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/database": "^9.0", - "illuminate/filesystem": "^9.0", - "illuminate/pipeline": "^9.0", - "illuminate/support": "^9.0", - "laravel/serializable-closure": "^1.2.2", - "ramsey/uuid": "^4.7", - "symfony/process": "^6.0" - }, - "autoload": { - "psr-4": { - "Illuminate\\Queue\\": "" - } - }, - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "suggest": { - "ext-pcntl": "Required to use all features of the queue worker.", - "ext-posix": "Required to use all features of the queue worker.", - "aws/aws-sdk-php": "Required to use the SQS queue driver and DynamoDb failed job storage (^3.235.5).", - "illuminate/redis": "Required to use the Redis queue driver (^9.0).", - "pda/pheanstalk": "Required to use the Beanstalk queue driver (^4.0)." - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev" -} diff --git a/vendor/laravel/framework/src/Illuminate/Redis/Connections/Connection.php b/vendor/laravel/framework/src/Illuminate/Redis/Connections/Connection.php deleted file mode 100644 index e3e55e94..00000000 --- a/vendor/laravel/framework/src/Illuminate/Redis/Connections/Connection.php +++ /dev/null @@ -1,218 +0,0 @@ -client; - } - - /** - * Subscribe to a set of given channels for messages. - * - * @param array|string $channels - * @param \Closure $callback - * @return void - */ - public function subscribe($channels, Closure $callback) - { - return $this->createSubscription($channels, $callback, __FUNCTION__); - } - - /** - * Subscribe to a set of given channels with wildcards. - * - * @param array|string $channels - * @param \Closure $callback - * @return void - */ - public function psubscribe($channels, Closure $callback) - { - return $this->createSubscription($channels, $callback, __FUNCTION__); - } - - /** - * Run a command against the Redis database. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function command($method, array $parameters = []) - { - $start = microtime(true); - - $result = $this->client->{$method}(...$parameters); - - $time = round((microtime(true) - $start) * 1000, 2); - - if (isset($this->events)) { - $this->event(new CommandExecuted($method, $parameters, $time, $this)); - } - - return $result; - } - - /** - * Fire the given event if possible. - * - * @param mixed $event - * @return void - */ - protected function event($event) - { - $this->events?->dispatch($event); - } - - /** - * Register a Redis command listener with the connection. - * - * @param \Closure $callback - * @return void - */ - public function listen(Closure $callback) - { - $this->events?->listen(CommandExecuted::class, $callback); - } - - /** - * Get the connection name. - * - * @return string|null - */ - public function getName() - { - return $this->name; - } - - /** - * Set the connections name. - * - * @param string $name - * @return $this - */ - public function setName($name) - { - $this->name = $name; - - return $this; - } - - /** - * Get the event dispatcher used by the connection. - * - * @return \Illuminate\Contracts\Events\Dispatcher - */ - public function getEventDispatcher() - { - return $this->events; - } - - /** - * Set the event dispatcher instance on the connection. - * - * @param \Illuminate\Contracts\Events\Dispatcher $events - * @return void - */ - public function setEventDispatcher(Dispatcher $events) - { - $this->events = $events; - } - - /** - * Unset the event dispatcher instance on the connection. - * - * @return void - */ - public function unsetEventDispatcher() - { - $this->events = null; - } - - /** - * Pass other method calls down to the underlying client. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - if (static::hasMacro($method)) { - return $this->macroCall($method, $parameters); - } - - return $this->command($method, $parameters); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Redis/Connections/PacksPhpRedisValues.php b/vendor/laravel/framework/src/Illuminate/Redis/Connections/PacksPhpRedisValues.php deleted file mode 100644 index 4d27ff59..00000000 --- a/vendor/laravel/framework/src/Illuminate/Redis/Connections/PacksPhpRedisValues.php +++ /dev/null @@ -1,183 +0,0 @@ - $values - * @return array - */ - public function pack(array $values): array - { - if (empty($values)) { - return $values; - } - - if ($this->supportsPacking()) { - return array_map([$this->client, '_pack'], $values); - } - - if ($this->compressed()) { - if ($this->supportsLzf() && $this->lzfCompressed()) { - if (! function_exists('lzf_compress')) { - throw new RuntimeException("'lzf' extension required to call 'lzf_compress'."); - } - - $processor = function ($value) { - return \lzf_compress($this->client->_serialize($value)); - }; - } elseif ($this->supportsZstd() && $this->zstdCompressed()) { - if (! function_exists('zstd_compress')) { - throw new RuntimeException("'zstd' extension required to call 'zstd_compress'."); - } - - $compressionLevel = $this->client->getOption(Redis::OPT_COMPRESSION_LEVEL); - - $processor = function ($value) use ($compressionLevel) { - return \zstd_compress( - $this->client->_serialize($value), - $compressionLevel === 0 ? Redis::COMPRESSION_ZSTD_DEFAULT : $compressionLevel - ); - }; - } else { - throw new UnexpectedValueException(sprintf( - 'Unsupported phpredis compression in use [%d].', - $this->client->getOption(Redis::OPT_COMPRESSION) - )); - } - } else { - $processor = function ($value) { - return $this->client->_serialize($value); - }; - } - - return array_map($processor, $values); - } - - /** - * Determine if compression is enabled. - * - * @return bool - */ - public function compressed(): bool - { - return defined('Redis::OPT_COMPRESSION') && - $this->client->getOption(Redis::OPT_COMPRESSION) !== Redis::COMPRESSION_NONE; - } - - /** - * Determine if LZF compression is enabled. - * - * @return bool - */ - public function lzfCompressed(): bool - { - return defined('Redis::COMPRESSION_LZF') && - $this->client->getOption(Redis::OPT_COMPRESSION) === Redis::COMPRESSION_LZF; - } - - /** - * Determine if ZSTD compression is enabled. - * - * @return bool - */ - public function zstdCompressed(): bool - { - return defined('Redis::COMPRESSION_ZSTD') && - $this->client->getOption(Redis::OPT_COMPRESSION) === Redis::COMPRESSION_ZSTD; - } - - /** - * Determine if LZ4 compression is enabled. - * - * @return bool - */ - public function lz4Compressed(): bool - { - return defined('Redis::COMPRESSION_LZ4') && - $this->client->getOption(Redis::OPT_COMPRESSION) === Redis::COMPRESSION_LZ4; - } - - /** - * Determine if the current PhpRedis extension version supports packing. - * - * @return bool - */ - protected function supportsPacking(): bool - { - if ($this->supportsPacking === null) { - $this->supportsPacking = $this->phpRedisVersionAtLeast('5.3.5'); - } - - return $this->supportsPacking; - } - - /** - * Determine if the current PhpRedis extension version supports LZF compression. - * - * @return bool - */ - protected function supportsLzf(): bool - { - if ($this->supportsLzf === null) { - $this->supportsLzf = $this->phpRedisVersionAtLeast('4.3.0'); - } - - return $this->supportsLzf; - } - - /** - * Determine if the current PhpRedis extension version supports Zstd compression. - * - * @return bool - */ - protected function supportsZstd(): bool - { - if ($this->supportsZstd === null) { - $this->supportsZstd = $this->phpRedisVersionAtLeast('5.1.0'); - } - - return $this->supportsZstd; - } - - /** - * Determine if the PhpRedis extension version is at least the given version. - * - * @param string $version - * @return bool - */ - protected function phpRedisVersionAtLeast(string $version): bool - { - $phpredisVersion = phpversion('redis'); - - return $phpredisVersion !== false && version_compare($phpredisVersion, $version, '>='); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Redis/Connections/PhpRedisClusterConnection.php b/vendor/laravel/framework/src/Illuminate/Redis/Connections/PhpRedisClusterConnection.php deleted file mode 100644 index bf4816a4..00000000 --- a/vendor/laravel/framework/src/Illuminate/Redis/Connections/PhpRedisClusterConnection.php +++ /dev/null @@ -1,24 +0,0 @@ -client->_masters() as $master) { - $async - ? $this->command('rawCommand', [$master, 'flushdb', 'async']) - : $this->command('flushdb', [$master]); - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Redis/Connections/PhpRedisConnection.php b/vendor/laravel/framework/src/Illuminate/Redis/Connections/PhpRedisConnection.php deleted file mode 100644 index d4c1f676..00000000 --- a/vendor/laravel/framework/src/Illuminate/Redis/Connections/PhpRedisConnection.php +++ /dev/null @@ -1,567 +0,0 @@ -client = $client; - $this->config = $config; - $this->connector = $connector; - } - - /** - * Returns the value of the given key. - * - * @param string $key - * @return string|null - */ - public function get($key) - { - $result = $this->command('get', [$key]); - - return $result !== false ? $result : null; - } - - /** - * Get the values of all the given keys. - * - * @param array $keys - * @return array - */ - public function mget(array $keys) - { - return array_map(function ($value) { - return $value !== false ? $value : null; - }, $this->command('mget', [$keys])); - } - - /** - * Set the string value in the argument as the value of the key. - * - * @param string $key - * @param mixed $value - * @param string|null $expireResolution - * @param int|null $expireTTL - * @param string|null $flag - * @return bool - */ - public function set($key, $value, $expireResolution = null, $expireTTL = null, $flag = null) - { - return $this->command('set', [ - $key, - $value, - $expireResolution ? [$flag, $expireResolution => $expireTTL] : null, - ]); - } - - /** - * Set the given key if it doesn't exist. - * - * @param string $key - * @param string $value - * @return int - */ - public function setnx($key, $value) - { - return (int) $this->command('setnx', [$key, $value]); - } - - /** - * Get the value of the given hash fields. - * - * @param string $key - * @param mixed $dictionary - * @return array - */ - public function hmget($key, ...$dictionary) - { - if (count($dictionary) === 1) { - $dictionary = $dictionary[0]; - } - - return array_values($this->command('hmget', [$key, $dictionary])); - } - - /** - * Set the given hash fields to their respective values. - * - * @param string $key - * @param mixed $dictionary - * @return int - */ - public function hmset($key, ...$dictionary) - { - if (count($dictionary) === 1) { - $dictionary = $dictionary[0]; - } else { - $input = collect($dictionary); - - $dictionary = $input->nth(2)->combine($input->nth(2, 1))->toArray(); - } - - return $this->command('hmset', [$key, $dictionary]); - } - - /** - * Set the given hash field if it doesn't exist. - * - * @param string $hash - * @param string $key - * @param string $value - * @return int - */ - public function hsetnx($hash, $key, $value) - { - return (int) $this->command('hsetnx', [$hash, $key, $value]); - } - - /** - * Removes the first count occurrences of the value element from the list. - * - * @param string $key - * @param int $count - * @param mixed $value - * @return int|false - */ - public function lrem($key, $count, $value) - { - return $this->command('lrem', [$key, $value, $count]); - } - - /** - * Removes and returns the first element of the list stored at key. - * - * @param mixed $arguments - * @return array|null - */ - public function blpop(...$arguments) - { - $result = $this->command('blpop', $arguments); - - return empty($result) ? null : $result; - } - - /** - * Removes and returns the last element of the list stored at key. - * - * @param mixed $arguments - * @return array|null - */ - public function brpop(...$arguments) - { - $result = $this->command('brpop', $arguments); - - return empty($result) ? null : $result; - } - - /** - * Removes and returns a random element from the set value at key. - * - * @param string $key - * @param int|null $count - * @return mixed|false - */ - public function spop($key, $count = 1) - { - return $this->command('spop', func_get_args()); - } - - /** - * Add one or more members to a sorted set or update its score if it already exists. - * - * @param string $key - * @param mixed $dictionary - * @return int - */ - public function zadd($key, ...$dictionary) - { - if (is_array(end($dictionary))) { - foreach (array_pop($dictionary) as $member => $score) { - $dictionary[] = $score; - $dictionary[] = $member; - } - } - - $options = []; - - foreach (array_slice($dictionary, 0, 3) as $i => $value) { - if (in_array($value, ['nx', 'xx', 'ch', 'incr', 'gt', 'lt', 'NX', 'XX', 'CH', 'INCR', 'GT', 'LT'], true)) { - $options[] = $value; - - unset($dictionary[$i]); - } - } - - return $this->command('zadd', array_merge([$key], [$options], array_values($dictionary))); - } - - /** - * Return elements with score between $min and $max. - * - * @param string $key - * @param mixed $min - * @param mixed $max - * @param array $options - * @return array - */ - public function zrangebyscore($key, $min, $max, $options = []) - { - if (isset($options['limit']) && Arr::isAssoc($options['limit'])) { - $options['limit'] = [ - $options['limit']['offset'], - $options['limit']['count'], - ]; - } - - return $this->command('zRangeByScore', [$key, $min, $max, $options]); - } - - /** - * Return elements with score between $min and $max. - * - * @param string $key - * @param mixed $min - * @param mixed $max - * @param array $options - * @return array - */ - public function zrevrangebyscore($key, $min, $max, $options = []) - { - if (isset($options['limit']) && Arr::isAssoc($options['limit'])) { - $options['limit'] = [ - $options['limit']['offset'], - $options['limit']['count'], - ]; - } - - return $this->command('zRevRangeByScore', [$key, $min, $max, $options]); - } - - /** - * Find the intersection between sets and store in a new set. - * - * @param string $output - * @param array $keys - * @param array $options - * @return int - */ - public function zinterstore($output, $keys, $options = []) - { - return $this->command('zinterstore', [$output, $keys, - $options['weights'] ?? null, - $options['aggregate'] ?? 'sum', - ]); - } - - /** - * Find the union between sets and store in a new set. - * - * @param string $output - * @param array $keys - * @param array $options - * @return int - */ - public function zunionstore($output, $keys, $options = []) - { - return $this->command('zunionstore', [$output, $keys, - $options['weights'] ?? null, - $options['aggregate'] ?? 'sum', - ]); - } - - /** - * Scans all keys based on options. - * - * @param mixed $cursor - * @param array $options - * @return mixed - */ - public function scan($cursor, $options = []) - { - $result = $this->client->scan($cursor, - $options['match'] ?? '*', - $options['count'] ?? 10 - ); - - if ($result === false) { - $result = []; - } - - return $cursor === 0 && empty($result) ? false : [$cursor, $result]; - } - - /** - * Scans the given set for all values based on options. - * - * @param string $key - * @param mixed $cursor - * @param array $options - * @return mixed - */ - public function zscan($key, $cursor, $options = []) - { - $result = $this->client->zscan($key, $cursor, - $options['match'] ?? '*', - $options['count'] ?? 10 - ); - - if ($result === false) { - $result = []; - } - - return $cursor === 0 && empty($result) ? false : [$cursor, $result]; - } - - /** - * Scans the given hash for all values based on options. - * - * @param string $key - * @param mixed $cursor - * @param array $options - * @return mixed - */ - public function hscan($key, $cursor, $options = []) - { - $result = $this->client->hscan($key, $cursor, - $options['match'] ?? '*', - $options['count'] ?? 10 - ); - - if ($result === false) { - $result = []; - } - - return $cursor === 0 && empty($result) ? false : [$cursor, $result]; - } - - /** - * Scans the given set for all values based on options. - * - * @param string $key - * @param mixed $cursor - * @param array $options - * @return mixed - */ - public function sscan($key, $cursor, $options = []) - { - $result = $this->client->sscan($key, $cursor, - $options['match'] ?? '*', - $options['count'] ?? 10 - ); - - if ($result === false) { - $result = []; - } - - return $cursor === 0 && empty($result) ? false : [$cursor, $result]; - } - - /** - * Execute commands in a pipeline. - * - * @param callable|null $callback - * @return \Redis|array - */ - public function pipeline(callable $callback = null) - { - $pipeline = $this->client()->pipeline(); - - return is_null($callback) - ? $pipeline - : tap($pipeline, $callback)->exec(); - } - - /** - * Execute commands in a transaction. - * - * @param callable|null $callback - * @return \Redis|array - */ - public function transaction(callable $callback = null) - { - $transaction = $this->client()->multi(); - - return is_null($callback) - ? $transaction - : tap($transaction, $callback)->exec(); - } - - /** - * Evaluate a LUA script serverside, from the SHA1 hash of the script instead of the script itself. - * - * @param string $script - * @param int $numkeys - * @param mixed $arguments - * @return mixed - */ - public function evalsha($script, $numkeys, ...$arguments) - { - return $this->command('evalsha', [ - $this->script('load', $script), $arguments, $numkeys, - ]); - } - - /** - * Evaluate a script and return its result. - * - * @param string $script - * @param int $numberOfKeys - * @param dynamic $arguments - * @return mixed - */ - public function eval($script, $numberOfKeys, ...$arguments) - { - return $this->command('eval', [$script, $arguments, $numberOfKeys]); - } - - /** - * Subscribe to a set of given channels for messages. - * - * @param array|string $channels - * @param \Closure $callback - * @return void - */ - public function subscribe($channels, Closure $callback) - { - $this->client->subscribe((array) $channels, function ($redis, $channel, $message) use ($callback) { - $callback($message, $channel); - }); - } - - /** - * Subscribe to a set of given channels with wildcards. - * - * @param array|string $channels - * @param \Closure $callback - * @return void - */ - public function psubscribe($channels, Closure $callback) - { - $this->client->psubscribe((array) $channels, function ($redis, $pattern, $channel, $message) use ($callback) { - $callback($message, $channel); - }); - } - - /** - * Subscribe to a set of given channels for messages. - * - * @param array|string $channels - * @param \Closure $callback - * @param string $method - * @return void - */ - public function createSubscription($channels, Closure $callback, $method = 'subscribe') - { - // - } - - /** - * Flush the selected Redis database. - * - * @return mixed - */ - public function flushdb() - { - $arguments = func_get_args(); - - if (strtoupper((string) ($arguments[0] ?? null)) === 'ASYNC') { - return $this->command('flushdb', [true]); - } - - return $this->command('flushdb'); - } - - /** - * Execute a raw command. - * - * @param array $parameters - * @return mixed - */ - public function executeRaw(array $parameters) - { - return $this->command('rawCommand', $parameters); - } - - /** - * Run a command against the Redis database. - * - * @param string $method - * @param array $parameters - * @return mixed - * - * @throws \RedisException - */ - public function command($method, array $parameters = []) - { - try { - return parent::command($method, $parameters); - } catch (RedisException $e) { - foreach (['went away', 'socket', 'read error on connection'] as $errorMessage) { - if (str_contains($e->getMessage(), $errorMessage)) { - $this->client = $this->connector ? call_user_func($this->connector) : $this->client; - - break; - } - } - - throw $e; - } - } - - /** - * Disconnects from the Redis instance. - * - * @return void - */ - public function disconnect() - { - $this->client->close(); - } - - /** - * Pass other method calls down to the underlying client. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - return parent::__call(strtolower($method), $parameters); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Redis/Connections/PredisClusterConnection.php b/vendor/laravel/framework/src/Illuminate/Redis/Connections/PredisClusterConnection.php deleted file mode 100644 index 6d07de16..00000000 --- a/vendor/laravel/framework/src/Illuminate/Redis/Connections/PredisClusterConnection.php +++ /dev/null @@ -1,20 +0,0 @@ -client->executeCommandOnNodes( - tap(new ServerFlushDatabase)->setArguments(func_get_args()) - ); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Redis/Connections/PredisConnection.php b/vendor/laravel/framework/src/Illuminate/Redis/Connections/PredisConnection.php deleted file mode 100644 index f642dd62..00000000 --- a/vendor/laravel/framework/src/Illuminate/Redis/Connections/PredisConnection.php +++ /dev/null @@ -1,53 +0,0 @@ -client = $client; - } - - /** - * Subscribe to a set of given channels for messages. - * - * @param array|string $channels - * @param \Closure $callback - * @param string $method - * @return void - */ - public function createSubscription($channels, Closure $callback, $method = 'subscribe') - { - $loop = $this->pubSubLoop(); - - $loop->{$method}(...array_values((array) $channels)); - - foreach ($loop as $message) { - if ($message->kind === 'message' || $message->kind === 'pmessage') { - $callback($message->payload, $message->channel); - } - } - - unset($loop); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Redis/Connectors/PhpRedisConnector.php b/vendor/laravel/framework/src/Illuminate/Redis/Connectors/PhpRedisConnector.php deleted file mode 100644 index 8953c5f5..00000000 --- a/vendor/laravel/framework/src/Illuminate/Redis/Connectors/PhpRedisConnector.php +++ /dev/null @@ -1,234 +0,0 @@ -createClient(array_merge( - $config, $options, $formattedOptions - )); - }; - - return new PhpRedisConnection($connector(), $connector, $config); - } - - /** - * Create a new clustered PhpRedis connection. - * - * @param array $config - * @param array $clusterOptions - * @param array $options - * @return \Illuminate\Redis\Connections\PhpRedisClusterConnection - */ - public function connectToCluster(array $config, array $clusterOptions, array $options) - { - $options = array_merge($options, $clusterOptions, Arr::pull($config, 'options', [])); - - return new PhpRedisClusterConnection($this->createRedisClusterInstance( - array_map([$this, 'buildClusterConnectionString'], $config), $options - )); - } - - /** - * Build a single cluster seed string from an array. - * - * @param array $server - * @return string - */ - protected function buildClusterConnectionString(array $server) - { - return $this->formatHost($server).':'.$server['port'].'?'.Arr::query(Arr::only($server, [ - 'database', 'password', 'prefix', 'read_timeout', - ])); - } - - /** - * Create the Redis client instance. - * - * @param array $config - * @return \Redis - * - * @throws \LogicException - */ - protected function createClient(array $config) - { - return tap(new Redis, function ($client) use ($config) { - if ($client instanceof RedisFacade) { - throw new LogicException( - extension_loaded('redis') - ? 'Please remove or rename the Redis facade alias in your "app" configuration file in order to avoid collision with the PHP Redis extension.' - : 'Please make sure the PHP Redis extension is installed and enabled.' - ); - } - - $this->establishConnection($client, $config); - - if (! empty($config['password'])) { - if (isset($config['username']) && $config['username'] !== '' && is_string($config['password'])) { - $client->auth([$config['username'], $config['password']]); - } else { - $client->auth($config['password']); - } - } - - if (isset($config['database'])) { - $client->select((int) $config['database']); - } - - if (! empty($config['prefix'])) { - $client->setOption(Redis::OPT_PREFIX, $config['prefix']); - } - - if (! empty($config['read_timeout'])) { - $client->setOption(Redis::OPT_READ_TIMEOUT, $config['read_timeout']); - } - - if (! empty($config['scan'])) { - $client->setOption(Redis::OPT_SCAN, $config['scan']); - } - - if (! empty($config['name'])) { - $client->client('SETNAME', $config['name']); - } - - if (array_key_exists('serializer', $config)) { - $client->setOption(Redis::OPT_SERIALIZER, $config['serializer']); - } - - if (array_key_exists('compression', $config)) { - $client->setOption(Redis::OPT_COMPRESSION, $config['compression']); - } - - if (array_key_exists('compression_level', $config)) { - $client->setOption(Redis::OPT_COMPRESSION_LEVEL, $config['compression_level']); - } - }); - } - - /** - * Establish a connection with the Redis host. - * - * @param \Redis $client - * @param array $config - * @return void - */ - protected function establishConnection($client, array $config) - { - $persistent = $config['persistent'] ?? false; - - $parameters = [ - $this->formatHost($config), - $config['port'], - Arr::get($config, 'timeout', 0.0), - $persistent ? Arr::get($config, 'persistent_id', null) : null, - Arr::get($config, 'retry_interval', 0), - ]; - - if (version_compare(phpversion('redis'), '3.1.3', '>=')) { - $parameters[] = Arr::get($config, 'read_timeout', 0.0); - } - - if (version_compare(phpversion('redis'), '5.3.0', '>=') && ! is_null($context = Arr::get($config, 'context'))) { - $parameters[] = $context; - } - - $client->{$persistent ? 'pconnect' : 'connect'}(...$parameters); - } - - /** - * Create a new redis cluster instance. - * - * @param array $servers - * @param array $options - * @return \RedisCluster - */ - protected function createRedisClusterInstance(array $servers, array $options) - { - $parameters = [ - null, - array_values($servers), - $options['timeout'] ?? 0, - $options['read_timeout'] ?? 0, - isset($options['persistent']) && $options['persistent'], - ]; - - if (version_compare(phpversion('redis'), '4.3.0', '>=')) { - $parameters[] = $options['password'] ?? null; - } - - if (version_compare(phpversion('redis'), '5.3.2', '>=') && ! is_null($context = Arr::get($options, 'context'))) { - $parameters[] = $context; - } - - return tap(new RedisCluster(...$parameters), function ($client) use ($options) { - if (! empty($options['prefix'])) { - $client->setOption(RedisCluster::OPT_PREFIX, $options['prefix']); - } - - if (! empty($options['scan'])) { - $client->setOption(RedisCluster::OPT_SCAN, $options['scan']); - } - - if (! empty($options['failover'])) { - $client->setOption(RedisCluster::OPT_SLAVE_FAILOVER, $options['failover']); - } - - if (! empty($options['name'])) { - $client->client('SETNAME', $options['name']); - } - - if (array_key_exists('serializer', $options)) { - $client->setOption(RedisCluster::OPT_SERIALIZER, $options['serializer']); - } - - if (array_key_exists('compression', $options)) { - $client->setOption(RedisCluster::OPT_COMPRESSION, $options['compression']); - } - - if (array_key_exists('compression_level', $options)) { - $client->setOption(RedisCluster::OPT_COMPRESSION_LEVEL, $options['compression_level']); - } - }); - } - - /** - * Format the host using the scheme if available. - * - * @param array $options - * @return string - */ - protected function formatHost(array $options) - { - if (isset($options['scheme'])) { - return Str::start($options['host'], "{$options['scheme']}://"); - } - - return $options['host']; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Redis/Connectors/PredisConnector.php b/vendor/laravel/framework/src/Illuminate/Redis/Connectors/PredisConnector.php deleted file mode 100644 index 6222a4b8..00000000 --- a/vendor/laravel/framework/src/Illuminate/Redis/Connectors/PredisConnector.php +++ /dev/null @@ -1,53 +0,0 @@ - 10.0], $options, Arr::pull($config, 'options', []) - ); - - if (isset($config['prefix'])) { - $formattedOptions['prefix'] = $config['prefix']; - } - - return new PredisConnection(new Client($config, $formattedOptions)); - } - - /** - * Create a new clustered Predis connection. - * - * @param array $config - * @param array $clusterOptions - * @param array $options - * @return \Illuminate\Redis\Connections\PredisClusterConnection - */ - public function connectToCluster(array $config, array $clusterOptions, array $options) - { - $clusterSpecificOptions = Arr::pull($config, 'options', []); - - if (isset($config['prefix'])) { - $clusterSpecificOptions['prefix'] = $config['prefix']; - } - - return new PredisClusterConnection(new Client(array_values($config), array_merge( - $options, $clusterOptions, $clusterSpecificOptions - ))); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Redis/Events/CommandExecuted.php b/vendor/laravel/framework/src/Illuminate/Redis/Events/CommandExecuted.php deleted file mode 100644 index fa65719a..00000000 --- a/vendor/laravel/framework/src/Illuminate/Redis/Events/CommandExecuted.php +++ /dev/null @@ -1,59 +0,0 @@ -time = $time; - $this->command = $command; - $this->parameters = $parameters; - $this->connection = $connection; - $this->connectionName = $connection->getName(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Redis/LICENSE.md b/vendor/laravel/framework/src/Illuminate/Redis/LICENSE.md deleted file mode 100644 index 79810c84..00000000 --- a/vendor/laravel/framework/src/Illuminate/Redis/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Taylor Otwell - -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/laravel/framework/src/Illuminate/Redis/Limiters/ConcurrencyLimiter.php b/vendor/laravel/framework/src/Illuminate/Redis/Limiters/ConcurrencyLimiter.php deleted file mode 100644 index e249053e..00000000 --- a/vendor/laravel/framework/src/Illuminate/Redis/Limiters/ConcurrencyLimiter.php +++ /dev/null @@ -1,167 +0,0 @@ -name = $name; - $this->redis = $redis; - $this->maxLocks = $maxLocks; - $this->releaseAfter = $releaseAfter; - } - - /** - * Attempt to acquire the lock for the given number of seconds. - * - * @param int $timeout - * @param callable|null $callback - * @param int $sleep - * @return mixed - * - * @throws \Illuminate\Contracts\Redis\LimiterTimeoutException - * @throws \Throwable - */ - public function block($timeout, $callback = null, $sleep = 250) - { - $starting = time(); - - $id = Str::random(20); - - while (! $slot = $this->acquire($id)) { - if (time() - $timeout >= $starting) { - throw new LimiterTimeoutException; - } - - usleep($sleep * 1000); - } - - if (is_callable($callback)) { - try { - return tap($callback(), function () use ($slot, $id) { - $this->release($slot, $id); - }); - } catch (Throwable $exception) { - $this->release($slot, $id); - - throw $exception; - } - } - - return true; - } - - /** - * Attempt to acquire the lock. - * - * @param string $id A unique identifier for this lock - * @return mixed - */ - protected function acquire($id) - { - $slots = array_map(function ($i) { - return $this->name.$i; - }, range(1, $this->maxLocks)); - - return $this->redis->eval(...array_merge( - [$this->lockScript(), count($slots)], - array_merge($slots, [$this->name, $this->releaseAfter, $id]) - )); - } - - /** - * Get the Lua script for acquiring a lock. - * - * KEYS - The keys that represent available slots - * ARGV[1] - The limiter name - * ARGV[2] - The number of seconds the slot should be reserved - * ARGV[3] - The unique identifier for this lock - * - * @return string - */ - protected function lockScript() - { - return <<<'LUA' -for index, value in pairs(redis.call('mget', unpack(KEYS))) do - if not value then - redis.call('set', KEYS[index], ARGV[3], "EX", ARGV[2]) - return ARGV[1]..index - end -end -LUA; - } - - /** - * Release the lock. - * - * @param string $key - * @param string $id - * @return void - */ - protected function release($key, $id) - { - $this->redis->eval($this->releaseScript(), 1, $key, $id); - } - - /** - * Get the Lua script to atomically release a lock. - * - * KEYS[1] - The name of the lock - * ARGV[1] - The unique identifier for this lock - * - * @return string - */ - protected function releaseScript() - { - return <<<'LUA' -if redis.call('get', KEYS[1]) == ARGV[1] -then - return redis.call('del', KEYS[1]) -else - return 0 -end -LUA; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Redis/Limiters/ConcurrencyLimiterBuilder.php b/vendor/laravel/framework/src/Illuminate/Redis/Limiters/ConcurrencyLimiterBuilder.php deleted file mode 100644 index fd2bf121..00000000 --- a/vendor/laravel/framework/src/Illuminate/Redis/Limiters/ConcurrencyLimiterBuilder.php +++ /dev/null @@ -1,142 +0,0 @@ -name = $name; - $this->connection = $connection; - } - - /** - * Set the maximum number of locks that can be obtained per time window. - * - * @param int $maxLocks - * @return $this - */ - public function limit($maxLocks) - { - $this->maxLocks = $maxLocks; - - return $this; - } - - /** - * Set the number of seconds until the lock will be released. - * - * @param int $releaseAfter - * @return $this - */ - public function releaseAfter($releaseAfter) - { - $this->releaseAfter = $this->secondsUntil($releaseAfter); - - return $this; - } - - /** - * Set the amount of time to block until a lock is available. - * - * @param int $timeout - * @return $this - */ - public function block($timeout) - { - $this->timeout = $timeout; - - return $this; - } - - /** - * The number of milliseconds to wait between lock acquisition attempts. - * - * @param int $sleep - * @return $this - */ - public function sleep($sleep) - { - $this->sleep = $sleep; - - return $this; - } - - /** - * Execute the given callback if a lock is obtained, otherwise call the failure callback. - * - * @param callable $callback - * @param callable|null $failure - * @return mixed - * - * @throws \Illuminate\Contracts\Redis\LimiterTimeoutException - */ - public function then(callable $callback, callable $failure = null) - { - try { - return (new ConcurrencyLimiter( - $this->connection, $this->name, $this->maxLocks, $this->releaseAfter - ))->block($this->timeout, $callback, $this->sleep); - } catch (LimiterTimeoutException $e) { - if ($failure) { - return $failure($e); - } - - throw $e; - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Redis/Limiters/DurationLimiter.php b/vendor/laravel/framework/src/Illuminate/Redis/Limiters/DurationLimiter.php deleted file mode 100644 index 65297ff9..00000000 --- a/vendor/laravel/framework/src/Illuminate/Redis/Limiters/DurationLimiter.php +++ /dev/null @@ -1,203 +0,0 @@ -name = $name; - $this->decay = $decay; - $this->redis = $redis; - $this->maxLocks = $maxLocks; - } - - /** - * Attempt to acquire the lock for the given number of seconds. - * - * @param int $timeout - * @param callable|null $callback - * @param int $sleep - * @return mixed - * - * @throws \Illuminate\Contracts\Redis\LimiterTimeoutException - */ - public function block($timeout, $callback = null, $sleep = 750) - { - $starting = time(); - - while (! $this->acquire()) { - if (time() - $timeout >= $starting) { - throw new LimiterTimeoutException; - } - - usleep($sleep * 1000); - } - - if (is_callable($callback)) { - return $callback(); - } - - return true; - } - - /** - * Attempt to acquire the lock. - * - * @return bool - */ - public function acquire() - { - $results = $this->redis->eval( - $this->luaScript(), 1, $this->name, microtime(true), time(), $this->decay, $this->maxLocks - ); - - $this->decaysAt = $results[1]; - - $this->remaining = max(0, $results[2]); - - return (bool) $results[0]; - } - - /** - * Determine if the key has been "accessed" too many times. - * - * @return bool - */ - public function tooManyAttempts() - { - [$this->decaysAt, $this->remaining] = $this->redis->eval( - $this->tooManyAttemptsLuaScript(), 1, $this->name, microtime(true), time(), $this->decay, $this->maxLocks - ); - - return $this->remaining <= 0; - } - - /** - * Clear the limiter. - * - * @return void - */ - public function clear() - { - $this->redis->del($this->name); - } - - /** - * Get the Lua script for acquiring a lock. - * - * KEYS[1] - The limiter name - * ARGV[1] - Current time in microseconds - * ARGV[2] - Current time in seconds - * ARGV[3] - Duration of the bucket - * ARGV[4] - Allowed number of tasks - * - * @return string - */ - protected function luaScript() - { - return <<<'LUA' -local function reset() - redis.call('HMSET', KEYS[1], 'start', ARGV[2], 'end', ARGV[2] + ARGV[3], 'count', 1) - return redis.call('EXPIRE', KEYS[1], ARGV[3] * 2) -end - -if redis.call('EXISTS', KEYS[1]) == 0 then - return {reset(), ARGV[2] + ARGV[3], ARGV[4] - 1} -end - -if ARGV[1] >= redis.call('HGET', KEYS[1], 'start') and ARGV[1] <= redis.call('HGET', KEYS[1], 'end') then - return { - tonumber(redis.call('HINCRBY', KEYS[1], 'count', 1)) <= tonumber(ARGV[4]), - redis.call('HGET', KEYS[1], 'end'), - ARGV[4] - redis.call('HGET', KEYS[1], 'count') - } -end - -return {reset(), ARGV[2] + ARGV[3], ARGV[4] - 1} -LUA; - } - - /** - * Get the Lua script to determine if the key has been "accessed" too many times. - * - * KEYS[1] - The limiter name - * ARGV[1] - Current time in microseconds - * ARGV[2] - Current time in seconds - * ARGV[3] - Duration of the bucket - * ARGV[4] - Allowed number of tasks - * - * @return string - */ - protected function tooManyAttemptsLuaScript() - { - return <<<'LUA' - -if redis.call('EXISTS', KEYS[1]) == 0 then - return {0, ARGV[2] + ARGV[3]} -end - -if ARGV[1] >= redis.call('HGET', KEYS[1], 'start') and ARGV[1] <= redis.call('HGET', KEYS[1], 'end') then - return { - redis.call('HGET', KEYS[1], 'end'), - ARGV[4] - redis.call('HGET', KEYS[1], 'count') - } -end - -return {0, ARGV[2] + ARGV[3]} -LUA; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Redis/Limiters/DurationLimiterBuilder.php b/vendor/laravel/framework/src/Illuminate/Redis/Limiters/DurationLimiterBuilder.php deleted file mode 100644 index ddb32184..00000000 --- a/vendor/laravel/framework/src/Illuminate/Redis/Limiters/DurationLimiterBuilder.php +++ /dev/null @@ -1,142 +0,0 @@ -name = $name; - $this->connection = $connection; - } - - /** - * Set the maximum number of locks that can be obtained per time window. - * - * @param int $maxLocks - * @return $this - */ - public function allow($maxLocks) - { - $this->maxLocks = $maxLocks; - - return $this; - } - - /** - * Set the amount of time the lock window is maintained. - * - * @param \DateTimeInterface|\DateInterval|int $decay - * @return $this - */ - public function every($decay) - { - $this->decay = $this->secondsUntil($decay); - - return $this; - } - - /** - * Set the amount of time to block until a lock is available. - * - * @param int $timeout - * @return $this - */ - public function block($timeout) - { - $this->timeout = $timeout; - - return $this; - } - - /** - * The number of milliseconds to wait between lock acquisition attempts. - * - * @param int $sleep - * @return $this - */ - public function sleep($sleep) - { - $this->sleep = $sleep; - - return $this; - } - - /** - * Execute the given callback if a lock is obtained, otherwise call the failure callback. - * - * @param callable $callback - * @param callable|null $failure - * @return mixed - * - * @throws \Illuminate\Contracts\Redis\LimiterTimeoutException - */ - public function then(callable $callback, callable $failure = null) - { - try { - return (new DurationLimiter( - $this->connection, $this->name, $this->maxLocks, $this->decay - ))->block($this->timeout, $callback, $this->sleep); - } catch (LimiterTimeoutException $e) { - if ($failure) { - return $failure($e); - } - - throw $e; - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Redis/RedisManager.php b/vendor/laravel/framework/src/Illuminate/Redis/RedisManager.php deleted file mode 100644 index e8697418..00000000 --- a/vendor/laravel/framework/src/Illuminate/Redis/RedisManager.php +++ /dev/null @@ -1,278 +0,0 @@ -app = $app; - $this->driver = $driver; - $this->config = $config; - } - - /** - * Get a Redis connection by name. - * - * @param string|null $name - * @return \Illuminate\Redis\Connections\Connection - */ - public function connection($name = null) - { - $name = $name ?: 'default'; - - if (isset($this->connections[$name])) { - return $this->connections[$name]; - } - - return $this->connections[$name] = $this->configure( - $this->resolve($name), $name - ); - } - - /** - * Resolve the given connection by name. - * - * @param string|null $name - * @return \Illuminate\Redis\Connections\Connection - * - * @throws \InvalidArgumentException - */ - public function resolve($name = null) - { - $name = $name ?: 'default'; - - $options = $this->config['options'] ?? []; - - if (isset($this->config[$name])) { - return $this->connector()->connect( - $this->parseConnectionConfiguration($this->config[$name]), - array_merge(Arr::except($options, 'parameters'), ['parameters' => Arr::get($options, 'parameters.'.$name, Arr::get($options, 'parameters', []))]) - ); - } - - if (isset($this->config['clusters'][$name])) { - return $this->resolveCluster($name); - } - - throw new InvalidArgumentException("Redis connection [{$name}] not configured."); - } - - /** - * Resolve the given cluster connection by name. - * - * @param string $name - * @return \Illuminate\Redis\Connections\Connection - */ - protected function resolveCluster($name) - { - return $this->connector()->connectToCluster( - array_map(function ($config) { - return $this->parseConnectionConfiguration($config); - }, $this->config['clusters'][$name]), - $this->config['clusters']['options'] ?? [], - $this->config['options'] ?? [] - ); - } - - /** - * Configure the given connection to prepare it for commands. - * - * @param \Illuminate\Redis\Connections\Connection $connection - * @param string $name - * @return \Illuminate\Redis\Connections\Connection - */ - protected function configure(Connection $connection, $name) - { - $connection->setName($name); - - if ($this->events && $this->app->bound('events')) { - $connection->setEventDispatcher($this->app->make('events')); - } - - return $connection; - } - - /** - * Get the connector instance for the current driver. - * - * @return \Illuminate\Contracts\Redis\Connector|null - */ - protected function connector() - { - $customCreator = $this->customCreators[$this->driver] ?? null; - - if ($customCreator) { - return $customCreator(); - } - - return match ($this->driver) { - 'predis' => new PredisConnector, - 'phpredis' => new PhpRedisConnector, - default => null, - }; - } - - /** - * Parse the Redis connection configuration. - * - * @param mixed $config - * @return array - */ - protected function parseConnectionConfiguration($config) - { - $parsed = (new ConfigurationUrlParser)->parseConfiguration($config); - - $driver = strtolower($parsed['driver'] ?? ''); - - if (in_array($driver, ['tcp', 'tls'])) { - $parsed['scheme'] = $driver; - } - - return array_filter($parsed, function ($key) { - return ! in_array($key, ['driver'], true); - }, ARRAY_FILTER_USE_KEY); - } - - /** - * Return all of the created connections. - * - * @return array - */ - public function connections() - { - return $this->connections; - } - - /** - * Enable the firing of Redis command events. - * - * @return void - */ - public function enableEvents() - { - $this->events = true; - } - - /** - * Disable the firing of Redis command events. - * - * @return void - */ - public function disableEvents() - { - $this->events = false; - } - - /** - * Set the default driver. - * - * @param string $driver - * @return void - */ - public function setDriver($driver) - { - $this->driver = $driver; - } - - /** - * Disconnect the given connection and remove from local cache. - * - * @param string|null $name - * @return void - */ - public function purge($name = null) - { - $name = $name ?: 'default'; - - unset($this->connections[$name]); - } - - /** - * Register a custom driver creator Closure. - * - * @param string $driver - * @param \Closure $callback - * @return $this - */ - public function extend($driver, Closure $callback) - { - $this->customCreators[$driver] = $callback->bindTo($this, $this); - - return $this; - } - - /** - * Pass methods onto the default Redis connection. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - return $this->connection()->{$method}(...$parameters); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Redis/RedisServiceProvider.php b/vendor/laravel/framework/src/Illuminate/Redis/RedisServiceProvider.php deleted file mode 100755 index 66282e51..00000000 --- a/vendor/laravel/framework/src/Illuminate/Redis/RedisServiceProvider.php +++ /dev/null @@ -1,38 +0,0 @@ -app->singleton('redis', function ($app) { - $config = $app->make('config')->get('database.redis', []); - - return new RedisManager($app, Arr::pull($config, 'client', 'phpredis'), $config); - }); - - $this->app->bind('redis.connection', function ($app) { - return $app['redis']->connection(); - }); - } - - /** - * Get the services provided by the provider. - * - * @return array - */ - public function provides() - { - return ['redis', 'redis.connection']; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Redis/composer.json b/vendor/laravel/framework/src/Illuminate/Redis/composer.json deleted file mode 100755 index 93fe330e..00000000 --- a/vendor/laravel/framework/src/Illuminate/Redis/composer.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "illuminate/redis", - "description": "The Illuminate Redis package.", - "license": "MIT", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "require": { - "php": "^8.0.2", - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0" - }, - "autoload": { - "psr-4": { - "Illuminate\\Redis\\": "" - } - }, - "suggest": { - "ext-redis": "Required to use the phpredis connector (^4.0|^5.0).", - "predis/predis": "Required to use the predis connector (^1.1.9|^2.0.2)." - }, - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev" -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/AbstractRouteCollection.php b/vendor/laravel/framework/src/Illuminate/Routing/AbstractRouteCollection.php deleted file mode 100644 index ce09c4fb..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/AbstractRouteCollection.php +++ /dev/null @@ -1,284 +0,0 @@ -bind($request); - } - - // If no route was found we will now check if a matching route is specified by - // another HTTP verb. If it is we will need to throw a MethodNotAllowed and - // inform the user agent of which HTTP verb it should use for this route. - $others = $this->checkForAlternateVerbs($request); - - if (count($others) > 0) { - return $this->getRouteForMethods($request, $others); - } - - throw new NotFoundHttpException(sprintf( - 'The route %s could not be found.', - $request->path() - )); - } - - /** - * Determine if any routes match on another HTTP verb. - * - * @param \Illuminate\Http\Request $request - * @return array - */ - protected function checkForAlternateVerbs($request) - { - $methods = array_diff(Router::$verbs, [$request->getMethod()]); - - // Here we will spin through all verbs except for the current request verb and - // check to see if any routes respond to them. If they do, we will return a - // proper error response with the correct headers on the response string. - return array_values(array_filter( - $methods, - function ($method) use ($request) { - return ! is_null($this->matchAgainstRoutes($this->get($method), $request, false)); - } - )); - } - - /** - * Determine if a route in the array matches the request. - * - * @param \Illuminate\Routing\Route[] $routes - * @param \Illuminate\Http\Request $request - * @param bool $includingMethod - * @return \Illuminate\Routing\Route|null - */ - protected function matchAgainstRoutes(array $routes, $request, $includingMethod = true) - { - [$fallbacks, $routes] = collect($routes)->partition(function ($route) { - return $route->isFallback; - }); - - return $routes->merge($fallbacks)->first( - fn (Route $route) => $route->matches($request, $includingMethod) - ); - } - - /** - * Get a route (if necessary) that responds when other available methods are present. - * - * @param \Illuminate\Http\Request $request - * @param string[] $methods - * @return \Illuminate\Routing\Route - * - * @throws \Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException - */ - protected function getRouteForMethods($request, array $methods) - { - if ($request->isMethod('OPTIONS')) { - return (new Route('OPTIONS', $request->path(), function () use ($methods) { - return new Response('', 200, ['Allow' => implode(',', $methods)]); - }))->bind($request); - } - - $this->requestMethodNotAllowed($request, $methods, $request->method()); - } - - /** - * Throw a method not allowed HTTP exception. - * - * @param \Illuminate\Http\Request $request - * @param array $others - * @param string $method - * @return void - * - * @throws \Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException - */ - protected function requestMethodNotAllowed($request, array $others, $method) - { - throw new MethodNotAllowedHttpException( - $others, - sprintf( - 'The %s method is not supported for route %s. Supported methods: %s.', - $request->path(), - $method, - implode(', ', $others) - ) - ); - } - - /** - * Throw a method not allowed HTTP exception. - * - * @param array $others - * @param string $method - * @return void - * - * @deprecated use requestMethodNotAllowed - * - * @throws \Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException - */ - protected function methodNotAllowed(array $others, $method) - { - throw new MethodNotAllowedHttpException( - $others, - sprintf( - 'The %s method is not supported for this route. Supported methods: %s.', - $method, - implode(', ', $others) - ) - ); - } - - /** - * Compile the routes for caching. - * - * @return array - */ - public function compile() - { - $compiled = $this->dumper()->getCompiledRoutes(); - - $attributes = []; - - foreach ($this->getRoutes() as $route) { - $attributes[$route->getName()] = [ - 'methods' => $route->methods(), - 'uri' => $route->uri(), - 'action' => $route->getAction(), - 'fallback' => $route->isFallback, - 'defaults' => $route->defaults, - 'wheres' => $route->wheres, - 'bindingFields' => $route->bindingFields(), - 'lockSeconds' => $route->locksFor(), - 'waitSeconds' => $route->waitsFor(), - 'withTrashed' => $route->allowsTrashedBindings(), - ]; - } - - return compact('compiled', 'attributes'); - } - - /** - * Return the CompiledUrlMatcherDumper instance for the route collection. - * - * @return \Symfony\Component\Routing\Matcher\Dumper\CompiledUrlMatcherDumper - */ - public function dumper() - { - return new CompiledUrlMatcherDumper($this->toSymfonyRouteCollection()); - } - - /** - * Convert the collection to a Symfony RouteCollection instance. - * - * @return \Symfony\Component\Routing\RouteCollection - */ - public function toSymfonyRouteCollection() - { - $symfonyRoutes = new SymfonyRouteCollection; - - $routes = $this->getRoutes(); - - foreach ($routes as $route) { - if (! $route->isFallback) { - $symfonyRoutes = $this->addToSymfonyRoutesCollection($symfonyRoutes, $route); - } - } - - foreach ($routes as $route) { - if ($route->isFallback) { - $symfonyRoutes = $this->addToSymfonyRoutesCollection($symfonyRoutes, $route); - } - } - - return $symfonyRoutes; - } - - /** - * Add a route to the SymfonyRouteCollection instance. - * - * @param \Symfony\Component\Routing\RouteCollection $symfonyRoutes - * @param \Illuminate\Routing\Route $route - * @return \Symfony\Component\Routing\RouteCollection - * - * @throws \LogicException - */ - protected function addToSymfonyRoutesCollection(SymfonyRouteCollection $symfonyRoutes, Route $route) - { - $name = $route->getName(); - - if ( - ! is_null($name) - && str_ends_with($name, '.') - && ! is_null($symfonyRoutes->get($name)) - ) { - $name = null; - } - - if (! $name) { - $route->name($this->generateRouteName()); - - $this->add($route); - } elseif (! is_null($symfonyRoutes->get($name))) { - throw new LogicException("Unable to prepare route [{$route->uri}] for serialization. Another route has already been assigned name [{$name}]."); - } - - $symfonyRoutes->add($route->getName(), $route->toSymfonyRoute()); - - return $symfonyRoutes; - } - - /** - * Get a randomly generated route name. - * - * @return string - */ - protected function generateRouteName() - { - return 'generated::'.Str::random(); - } - - /** - * Get an iterator for the items. - * - * @return \ArrayIterator - */ - public function getIterator(): Traversable - { - return new ArrayIterator($this->getRoutes()); - } - - /** - * Count the number of items in the collection. - * - * @return int - */ - public function count(): int - { - return count($this->getRoutes()); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/CallableDispatcher.php b/vendor/laravel/framework/src/Illuminate/Routing/CallableDispatcher.php deleted file mode 100644 index e85ee04b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/CallableDispatcher.php +++ /dev/null @@ -1,54 +0,0 @@ -container = $container; - } - - /** - * Dispatch a request to a given callable. - * - * @param \Illuminate\Routing\Route $route - * @param callable $callable - * @return mixed - */ - public function dispatch(Route $route, $callable) - { - return $callable(...array_values($this->resolveParameters($route, $callable))); - } - - /** - * Resolve the parameters for the callable. - * - * @param \Illuminate\Routing\Route $route - * @param callable $callable - * @return array - */ - protected function resolveParameters(Route $route, $callable) - { - return $this->resolveMethodDependencies($route->parametersWithoutNulls(), new ReflectionFunction($callable)); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/CompiledRouteCollection.php b/vendor/laravel/framework/src/Illuminate/Routing/CompiledRouteCollection.php deleted file mode 100644 index 2b693f85..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/CompiledRouteCollection.php +++ /dev/null @@ -1,330 +0,0 @@ -compiled = $compiled; - $this->attributes = $attributes; - $this->routes = new RouteCollection; - } - - /** - * Add a Route instance to the collection. - * - * @param \Illuminate\Routing\Route $route - * @return \Illuminate\Routing\Route - */ - public function add(Route $route) - { - return $this->routes->add($route); - } - - /** - * Refresh the name look-up table. - * - * This is done in case any names are fluently defined or if routes are overwritten. - * - * @return void - */ - public function refreshNameLookups() - { - // - } - - /** - * Refresh the action look-up table. - * - * This is done in case any actions are overwritten with new controllers. - * - * @return void - */ - public function refreshActionLookups() - { - // - } - - /** - * Find the first route matching a given request. - * - * @param \Illuminate\Http\Request $request - * @return \Illuminate\Routing\Route - * - * @throws \Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException - * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException - */ - public function match(Request $request) - { - $matcher = new CompiledUrlMatcher( - $this->compiled, (new RequestContext)->fromRequest( - $trimmedRequest = $this->requestWithoutTrailingSlash($request) - ) - ); - - $route = null; - - try { - if ($result = $matcher->matchRequest($trimmedRequest)) { - $route = $this->getByName($result['_route']); - } - } catch (ResourceNotFoundException|MethodNotAllowedException $e) { - try { - return $this->routes->match($request); - } catch (NotFoundHttpException $e) { - // - } - } - - if ($route && $route->isFallback) { - try { - $dynamicRoute = $this->routes->match($request); - - if (! $dynamicRoute->isFallback) { - $route = $dynamicRoute; - } - } catch (NotFoundHttpException|MethodNotAllowedHttpException $e) { - // - } - } - - return $this->handleMatchedRoute($request, $route); - } - - /** - * Get a cloned instance of the given request without any trailing slash on the URI. - * - * @param \Illuminate\Http\Request $request - * @return \Illuminate\Http\Request - */ - protected function requestWithoutTrailingSlash(Request $request) - { - $trimmedRequest = $request->duplicate(); - - $parts = explode('?', $request->server->get('REQUEST_URI'), 2); - - $trimmedRequest->server->set( - 'REQUEST_URI', rtrim($parts[0], '/').(isset($parts[1]) ? '?'.$parts[1] : '') - ); - - return $trimmedRequest; - } - - /** - * Get routes from the collection by method. - * - * @param string|null $method - * @return \Illuminate\Routing\Route[] - */ - public function get($method = null) - { - return $this->getRoutesByMethod()[$method] ?? []; - } - - /** - * Determine if the route collection contains a given named route. - * - * @param string $name - * @return bool - */ - public function hasNamedRoute($name) - { - return isset($this->attributes[$name]) || $this->routes->hasNamedRoute($name); - } - - /** - * Get a route instance by its name. - * - * @param string $name - * @return \Illuminate\Routing\Route|null - */ - public function getByName($name) - { - if (isset($this->attributes[$name])) { - return $this->newRoute($this->attributes[$name]); - } - - return $this->routes->getByName($name); - } - - /** - * Get a route instance by its controller action. - * - * @param string $action - * @return \Illuminate\Routing\Route|null - */ - public function getByAction($action) - { - $attributes = collect($this->attributes)->first(function (array $attributes) use ($action) { - if (isset($attributes['action']['controller'])) { - return trim($attributes['action']['controller'], '\\') === $action; - } - - return $attributes['action']['uses'] === $action; - }); - - if ($attributes) { - return $this->newRoute($attributes); - } - - return $this->routes->getByAction($action); - } - - /** - * Get all of the routes in the collection. - * - * @return \Illuminate\Routing\Route[] - */ - public function getRoutes() - { - return collect($this->attributes) - ->map(function (array $attributes) { - return $this->newRoute($attributes); - }) - ->merge($this->routes->getRoutes()) - ->values() - ->all(); - } - - /** - * Get all of the routes keyed by their HTTP verb / method. - * - * @return array - */ - public function getRoutesByMethod() - { - return collect($this->getRoutes()) - ->groupBy(function (Route $route) { - return $route->methods(); - }) - ->map(function (Collection $routes) { - return $routes->mapWithKeys(function (Route $route) { - return [$route->getDomain().$route->uri => $route]; - })->all(); - }) - ->all(); - } - - /** - * Get all of the routes keyed by their name. - * - * @return \Illuminate\Routing\Route[] - */ - public function getRoutesByName() - { - return collect($this->getRoutes()) - ->keyBy(function (Route $route) { - return $route->getName(); - }) - ->all(); - } - - /** - * Resolve an array of attributes to a Route instance. - * - * @param array $attributes - * @return \Illuminate\Routing\Route - */ - protected function newRoute(array $attributes) - { - if (empty($attributes['action']['prefix'] ?? '')) { - $baseUri = $attributes['uri']; - } else { - $prefix = trim($attributes['action']['prefix'], '/'); - - $baseUri = trim(implode( - '/', array_slice( - explode('/', trim($attributes['uri'], '/')), - count($prefix !== '' ? explode('/', $prefix) : []) - ) - ), '/'); - } - - return $this->router->newRoute($attributes['methods'], $baseUri === '' ? '/' : $baseUri, $attributes['action']) - ->setFallback($attributes['fallback']) - ->setDefaults($attributes['defaults']) - ->setWheres($attributes['wheres']) - ->setBindingFields($attributes['bindingFields']) - ->block($attributes['lockSeconds'] ?? null, $attributes['waitSeconds'] ?? null) - ->withTrashed($attributes['withTrashed'] ?? false); - } - - /** - * Set the router instance on the route. - * - * @param \Illuminate\Routing\Router $router - * @return $this - */ - public function setRouter(Router $router) - { - $this->router = $router; - - return $this; - } - - /** - * Set the container instance on the route. - * - * @param \Illuminate\Container\Container $container - * @return $this - */ - public function setContainer(Container $container) - { - $this->container = $container; - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/Console/ControllerMakeCommand.php b/vendor/laravel/framework/src/Illuminate/Routing/Console/ControllerMakeCommand.php deleted file mode 100755 index 6ba0a388..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/Console/ControllerMakeCommand.php +++ /dev/null @@ -1,300 +0,0 @@ -option('type')) { - $stub = "/stubs/controller.{$type}.stub"; - } elseif ($this->option('parent')) { - $stub = $this->option('singleton') - ? '/stubs/controller.nested.singleton.stub' - : '/stubs/controller.nested.stub'; - } elseif ($this->option('model')) { - $stub = '/stubs/controller.model.stub'; - } elseif ($this->option('invokable')) { - $stub = '/stubs/controller.invokable.stub'; - } elseif ($this->option('singleton')) { - $stub = '/stubs/controller.singleton.stub'; - } elseif ($this->option('resource')) { - $stub = '/stubs/controller.stub'; - } - - if ($this->option('api') && is_null($stub)) { - $stub = '/stubs/controller.api.stub'; - } elseif ($this->option('api') && ! is_null($stub) && ! $this->option('invokable')) { - $stub = str_replace('.stub', '.api.stub', $stub); - } - - $stub ??= '/stubs/controller.plain.stub'; - - return $this->resolveStubPath($stub); - } - - /** - * Resolve the fully-qualified path to the stub. - * - * @param string $stub - * @return string - */ - protected function resolveStubPath($stub) - { - return file_exists($customPath = $this->laravel->basePath(trim($stub, '/'))) - ? $customPath - : __DIR__.$stub; - } - - /** - * Get the default namespace for the class. - * - * @param string $rootNamespace - * @return string - */ - protected function getDefaultNamespace($rootNamespace) - { - return $rootNamespace.'\Http\Controllers'; - } - - /** - * Build the class with the given name. - * - * Remove the base controller import if we are already in the base namespace. - * - * @param string $name - * @return string - */ - protected function buildClass($name) - { - $controllerNamespace = $this->getNamespace($name); - - $replace = []; - - if ($this->option('parent')) { - $replace = $this->buildParentReplacements(); - } - - if ($this->option('model')) { - $replace = $this->buildModelReplacements($replace); - } - - if ($this->option('creatable')) { - $replace['abort(404);'] = '//'; - } - - $replace["use {$controllerNamespace}\Controller;\n"] = ''; - - return str_replace( - array_keys($replace), array_values($replace), parent::buildClass($name) - ); - } - - /** - * Build the replacements for a parent controller. - * - * @return array - */ - protected function buildParentReplacements() - { - $parentModelClass = $this->parseModel($this->option('parent')); - - if (! class_exists($parentModelClass) && - $this->components->confirm("A {$parentModelClass} model does not exist. Do you want to generate it?", true)) { - $this->call('make:model', ['name' => $parentModelClass]); - } - - return [ - 'ParentDummyFullModelClass' => $parentModelClass, - '{{ namespacedParentModel }}' => $parentModelClass, - '{{namespacedParentModel}}' => $parentModelClass, - 'ParentDummyModelClass' => class_basename($parentModelClass), - '{{ parentModel }}' => class_basename($parentModelClass), - '{{parentModel}}' => class_basename($parentModelClass), - 'ParentDummyModelVariable' => lcfirst(class_basename($parentModelClass)), - '{{ parentModelVariable }}' => lcfirst(class_basename($parentModelClass)), - '{{parentModelVariable}}' => lcfirst(class_basename($parentModelClass)), - ]; - } - - /** - * Build the model replacement values. - * - * @param array $replace - * @return array - */ - protected function buildModelReplacements(array $replace) - { - $modelClass = $this->parseModel($this->option('model')); - - if (! class_exists($modelClass) && $this->components->confirm("A {$modelClass} model does not exist. Do you want to generate it?", true)) { - $this->call('make:model', ['name' => $modelClass]); - } - - $replace = $this->buildFormRequestReplacements($replace, $modelClass); - - return array_merge($replace, [ - 'DummyFullModelClass' => $modelClass, - '{{ namespacedModel }}' => $modelClass, - '{{namespacedModel}}' => $modelClass, - 'DummyModelClass' => class_basename($modelClass), - '{{ model }}' => class_basename($modelClass), - '{{model}}' => class_basename($modelClass), - 'DummyModelVariable' => lcfirst(class_basename($modelClass)), - '{{ modelVariable }}' => lcfirst(class_basename($modelClass)), - '{{modelVariable}}' => lcfirst(class_basename($modelClass)), - ]); - } - - /** - * Get the fully-qualified model class name. - * - * @param string $model - * @return string - * - * @throws \InvalidArgumentException - */ - protected function parseModel($model) - { - if (preg_match('([^A-Za-z0-9_/\\\\])', $model)) { - throw new InvalidArgumentException('Model name contains invalid characters.'); - } - - return $this->qualifyModel($model); - } - - /** - * Build the model replacement values. - * - * @param array $replace - * @param string $modelClass - * @return array - */ - protected function buildFormRequestReplacements(array $replace, $modelClass) - { - [$namespace, $storeRequestClass, $updateRequestClass] = [ - 'Illuminate\\Http', 'Request', 'Request', - ]; - - if ($this->option('requests')) { - $namespace = 'App\\Http\\Requests'; - - [$storeRequestClass, $updateRequestClass] = $this->generateFormRequests( - $modelClass, $storeRequestClass, $updateRequestClass - ); - } - - $namespacedRequests = $namespace.'\\'.$storeRequestClass.';'; - - if ($storeRequestClass !== $updateRequestClass) { - $namespacedRequests .= PHP_EOL.'use '.$namespace.'\\'.$updateRequestClass.';'; - } - - return array_merge($replace, [ - '{{ storeRequest }}' => $storeRequestClass, - '{{storeRequest}}' => $storeRequestClass, - '{{ updateRequest }}' => $updateRequestClass, - '{{updateRequest}}' => $updateRequestClass, - '{{ namespacedStoreRequest }}' => $namespace.'\\'.$storeRequestClass, - '{{namespacedStoreRequest}}' => $namespace.'\\'.$storeRequestClass, - '{{ namespacedUpdateRequest }}' => $namespace.'\\'.$updateRequestClass, - '{{namespacedUpdateRequest}}' => $namespace.'\\'.$updateRequestClass, - '{{ namespacedRequests }}' => $namespacedRequests, - '{{namespacedRequests}}' => $namespacedRequests, - ]); - } - - /** - * Generate the form requests for the given model and classes. - * - * @param string $modelClass - * @param string $storeRequestClass - * @param string $updateRequestClass - * @return array - */ - protected function generateFormRequests($modelClass, $storeRequestClass, $updateRequestClass) - { - $storeRequestClass = 'Store'.class_basename($modelClass).'Request'; - - $this->call('make:request', [ - 'name' => $storeRequestClass, - ]); - - $updateRequestClass = 'Update'.class_basename($modelClass).'Request'; - - $this->call('make:request', [ - 'name' => $updateRequestClass, - ]); - - return [$storeRequestClass, $updateRequestClass]; - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['api', null, InputOption::VALUE_NONE, 'Exclude the create and edit methods from the controller'], - ['type', null, InputOption::VALUE_REQUIRED, 'Manually specify the controller stub file to use'], - ['force', null, InputOption::VALUE_NONE, 'Create the class even if the controller already exists'], - ['invokable', 'i', InputOption::VALUE_NONE, 'Generate a single method, invokable controller class'], - ['model', 'm', InputOption::VALUE_OPTIONAL, 'Generate a resource controller for the given model'], - ['parent', 'p', InputOption::VALUE_OPTIONAL, 'Generate a nested resource controller class'], - ['resource', 'r', InputOption::VALUE_NONE, 'Generate a resource controller class'], - ['requests', 'R', InputOption::VALUE_NONE, 'Generate FormRequest classes for store and update'], - ['singleton', 's', InputOption::VALUE_NONE, 'Generate a singleton resource controller class'], - ['creatable', null, InputOption::VALUE_NONE, 'Indicate that a singleton resource should be creatable'], - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/Console/MiddlewareMakeCommand.php b/vendor/laravel/framework/src/Illuminate/Routing/Console/MiddlewareMakeCommand.php deleted file mode 100644 index 11bec0ef..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/Console/MiddlewareMakeCommand.php +++ /dev/null @@ -1,79 +0,0 @@ -resolveStubPath('/stubs/middleware.stub'); - } - - /** - * Resolve the fully-qualified path to the stub. - * - * @param string $stub - * @return string - */ - protected function resolveStubPath($stub) - { - return file_exists($customPath = $this->laravel->basePath(trim($stub, '/'))) - ? $customPath - : __DIR__.$stub; - } - - /** - * Get the default namespace for the class. - * - * @param string $rootNamespace - * @return string - */ - protected function getDefaultNamespace($rootNamespace) - { - return $rootNamespace.'\Http\Middleware'; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/Console/stubs/controller.api.stub b/vendor/laravel/framework/src/Illuminate/Routing/Console/stubs/controller.api.stub deleted file mode 100644 index 381a9c87..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/Console/stubs/controller.api.stub +++ /dev/null @@ -1,64 +0,0 @@ -middleware[] = [ - 'middleware' => $m, - 'options' => &$options, - ]; - } - - return new ControllerMiddlewareOptions($options); - } - - /** - * Get the middleware assigned to the controller. - * - * @return array - */ - public function getMiddleware() - { - return $this->middleware; - } - - /** - * Execute an action on the controller. - * - * @param string $method - * @param array $parameters - * @return \Symfony\Component\HttpFoundation\Response - */ - public function callAction($method, $parameters) - { - return $this->{$method}(...array_values($parameters)); - } - - /** - * Handle calls to missing methods on the controller. - * - * @param string $method - * @param array $parameters - * @return mixed - * - * @throws \BadMethodCallException - */ - public function __call($method, $parameters) - { - throw new BadMethodCallException(sprintf( - 'Method %s::%s does not exist.', static::class, $method - )); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php b/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php deleted file mode 100644 index d3b0bc88..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php +++ /dev/null @@ -1,94 +0,0 @@ -container = $container; - } - - /** - * Dispatch a request to a given controller and method. - * - * @param \Illuminate\Routing\Route $route - * @param mixed $controller - * @param string $method - * @return mixed - */ - public function dispatch(Route $route, $controller, $method) - { - $parameters = $this->resolveParameters($route, $controller, $method); - - if (method_exists($controller, 'callAction')) { - return $controller->callAction($method, $parameters); - } - - return $controller->{$method}(...array_values($parameters)); - } - - /** - * Resolve the parameters for the controller. - * - * @param \Illuminate\Routing\Route $route - * @param mixed $controller - * @param string $method - * @return array - */ - protected function resolveParameters(Route $route, $controller, $method) - { - return $this->resolveClassMethodDependencies( - $route->parametersWithoutNulls(), $controller, $method - ); - } - - /** - * Get the middleware for the controller instance. - * - * @param \Illuminate\Routing\Controller $controller - * @param string $method - * @return array - */ - public function getMiddleware($controller, $method) - { - if (! method_exists($controller, 'getMiddleware')) { - return []; - } - - return collect($controller->getMiddleware())->reject(function ($data) use ($method) { - return static::methodExcludedByOptions($method, $data['options']); - })->pluck('middleware')->all(); - } - - /** - * Determine if the given options exclude a particular method. - * - * @param string $method - * @param array $options - * @return bool - */ - public static function methodExcludedByOptions($method, array $options) - { - return (isset($options['only']) && ! in_array($method, (array) $options['only'])) || - (! empty($options['except']) && in_array($method, (array) $options['except'])); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/ControllerMiddlewareOptions.php b/vendor/laravel/framework/src/Illuminate/Routing/ControllerMiddlewareOptions.php deleted file mode 100644 index 13ef1898..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/ControllerMiddlewareOptions.php +++ /dev/null @@ -1,50 +0,0 @@ -options = &$options; - } - - /** - * Set the controller methods the middleware should apply to. - * - * @param array|string|dynamic $methods - * @return $this - */ - public function only($methods) - { - $this->options['only'] = is_array($methods) ? $methods : func_get_args(); - - return $this; - } - - /** - * Set the controller methods the middleware should exclude. - * - * @param array|string|dynamic $methods - * @return $this - */ - public function except($methods) - { - $this->options['except'] = is_array($methods) ? $methods : func_get_args(); - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/Controllers/HasMiddleware.php b/vendor/laravel/framework/src/Illuminate/Routing/Controllers/HasMiddleware.php deleted file mode 100644 index 3d4b262b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/Controllers/HasMiddleware.php +++ /dev/null @@ -1,13 +0,0 @@ -middleware = $middleware; - } - - /** - * Specify the only controller methods the middleware should apply to. - * - * @param array|string $only - * @return $this - */ - public function only(array|string $only) - { - $this->only = Arr::wrap($only); - - return $this; - } - - /** - * Specify the controller methods the middleware should not apply to. - * - * @param array|string $only - * @return $this - */ - public function except(array|string $except) - { - $this->except = Arr::wrap($except); - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/CreatesRegularExpressionRouteConstraints.php b/vendor/laravel/framework/src/Illuminate/Routing/CreatesRegularExpressionRouteConstraints.php deleted file mode 100644 index e1704514..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/CreatesRegularExpressionRouteConstraints.php +++ /dev/null @@ -1,89 +0,0 @@ -assignExpressionToParameters($parameters, '[a-zA-Z]+'); - } - - /** - * Specify that the given route parameters must be alphanumeric. - * - * @param array|string $parameters - * @return $this - */ - public function whereAlphaNumeric($parameters) - { - return $this->assignExpressionToParameters($parameters, '[a-zA-Z0-9]+'); - } - - /** - * Specify that the given route parameters must be numeric. - * - * @param array|string $parameters - * @return $this - */ - public function whereNumber($parameters) - { - return $this->assignExpressionToParameters($parameters, '[0-9]+'); - } - - /** - * Specify that the given route parameters must be ULIDs. - * - * @param array|string $parameters - * @return $this - */ - public function whereUlid($parameters) - { - return $this->assignExpressionToParameters($parameters, '[0-7][0-9a-hjkmnp-tv-zA-HJKMNP-TV-Z]{25}'); - } - - /** - * Specify that the given route parameters must be UUIDs. - * - * @param array|string $parameters - * @return $this - */ - public function whereUuid($parameters) - { - return $this->assignExpressionToParameters($parameters, '[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}'); - } - - /** - * Specify that the given route parameters must be one of the given values. - * - * @param array|string $parameters - * @param array $values - * @return $this - */ - public function whereIn($parameters, array $values) - { - return $this->assignExpressionToParameters($parameters, implode('|', $values)); - } - - /** - * Apply the given regular expression to the given parameters. - * - * @param array|string $parameters - * @param string $expression - * @return $this - */ - protected function assignExpressionToParameters($parameters, $expression) - { - return $this->where(collect(Arr::wrap($parameters)) - ->mapWithKeys(fn ($parameter) => [$parameter => $expression]) - ->all()); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/Events/RouteMatched.php b/vendor/laravel/framework/src/Illuminate/Routing/Events/RouteMatched.php deleted file mode 100644 index c8486071..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/Events/RouteMatched.php +++ /dev/null @@ -1,33 +0,0 @@ -route = $route; - $this->request = $request; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/Events/Routing.php b/vendor/laravel/framework/src/Illuminate/Routing/Events/Routing.php deleted file mode 100644 index af1bb48d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/Events/Routing.php +++ /dev/null @@ -1,24 +0,0 @@ -request = $request; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/Exceptions/BackedEnumCaseNotFoundException.php b/vendor/laravel/framework/src/Illuminate/Routing/Exceptions/BackedEnumCaseNotFoundException.php deleted file mode 100644 index 468583d2..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/Exceptions/BackedEnumCaseNotFoundException.php +++ /dev/null @@ -1,20 +0,0 @@ -originalException = $originalException; - - parent::__construct($originalException->getMessage()); - } - - /** - * Render the exception. - * - * @return \Illuminate\Http\Response - */ - public function render() - { - return new Response(''); - } - - /** - * Get the actual exception thrown during the stream. - * - * @return \Throwable - */ - public function getInnerException() - { - return $this->originalException; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/Exceptions/UrlGenerationException.php b/vendor/laravel/framework/src/Illuminate/Routing/Exceptions/UrlGenerationException.php deleted file mode 100644 index eadda801..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/Exceptions/UrlGenerationException.php +++ /dev/null @@ -1,37 +0,0 @@ -getName(), - $route->uri() - ); - - if (count($parameters) > 0) { - $message .= sprintf(' [Missing %s: %s]', $parameterLabel, implode(', ', $parameters)); - } - - $message .= '.'; - - return new static($message); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/ImplicitRouteBinding.php b/vendor/laravel/framework/src/Illuminate/Routing/ImplicitRouteBinding.php deleted file mode 100644 index d9978af3..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/ImplicitRouteBinding.php +++ /dev/null @@ -1,118 +0,0 @@ - - * @throws \Illuminate\Routing\Exceptions\BackedEnumCaseNotFoundException - */ - public static function resolveForRoute($container, $route) - { - $parameters = $route->parameters(); - - $route = static::resolveBackedEnumsForRoute($route, $parameters); - - foreach ($route->signatureParameters(['subClass' => UrlRoutable::class]) as $parameter) { - if (! $parameterName = static::getParameterName($parameter->getName(), $parameters)) { - continue; - } - - $parameterValue = $parameters[$parameterName]; - - if ($parameterValue instanceof UrlRoutable) { - continue; - } - - $instance = $container->make(Reflector::getParameterClassName($parameter)); - - $parent = $route->parentOfParameter($parameterName); - - $routeBindingMethod = $route->allowsTrashedBindings() && in_array(SoftDeletes::class, class_uses_recursive($instance)) - ? 'resolveSoftDeletableRouteBinding' - : 'resolveRouteBinding'; - - if ($parent instanceof UrlRoutable && - ! $route->preventsScopedBindings() && - ($route->enforcesScopedBindings() || array_key_exists($parameterName, $route->bindingFields()))) { - $childRouteBindingMethod = $route->allowsTrashedBindings() && in_array(SoftDeletes::class, class_uses_recursive($instance)) - ? 'resolveSoftDeletableChildRouteBinding' - : 'resolveChildRouteBinding'; - - if (! $model = $parent->{$childRouteBindingMethod}( - $parameterName, $parameterValue, $route->bindingFieldFor($parameterName) - )) { - throw (new ModelNotFoundException)->setModel(get_class($instance), [$parameterValue]); - } - } elseif (! $model = $instance->{$routeBindingMethod}($parameterValue, $route->bindingFieldFor($parameterName))) { - throw (new ModelNotFoundException)->setModel(get_class($instance), [$parameterValue]); - } - - $route->setParameter($parameterName, $model); - } - } - - /** - * Resolve the Backed Enums route bindings for the route. - * - * @param \Illuminate\Routing\Route $route - * @param array $parameters - * @return \Illuminate\Routing\Route - * - * @throws \Illuminate\Routing\Exceptions\BackedEnumCaseNotFoundException - */ - protected static function resolveBackedEnumsForRoute($route, $parameters) - { - foreach ($route->signatureParameters(['backedEnum' => true]) as $parameter) { - if (! $parameterName = static::getParameterName($parameter->getName(), $parameters)) { - continue; - } - - $parameterValue = $parameters[$parameterName]; - - $backedEnumClass = (string) $parameter->getType(); - - $backedEnum = $backedEnumClass::tryFrom((string) $parameterValue); - - if (is_null($backedEnum)) { - throw new BackedEnumCaseNotFoundException($backedEnumClass, $parameterValue); - } - - $route->setParameter($parameterName, $backedEnum); - } - - return $route; - } - - /** - * Return the parameter name if it exists in the given parameters. - * - * @param string $name - * @param array $parameters - * @return string|null - */ - protected static function getParameterName($name, $parameters) - { - if (array_key_exists($name, $parameters)) { - return $name; - } - - if (array_key_exists($snakedName = Str::snake($name), $parameters)) { - return $snakedName; - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/LICENSE.md b/vendor/laravel/framework/src/Illuminate/Routing/LICENSE.md deleted file mode 100644 index 79810c84..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Taylor Otwell - -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/laravel/framework/src/Illuminate/Routing/Matching/HostValidator.php b/vendor/laravel/framework/src/Illuminate/Routing/Matching/HostValidator.php deleted file mode 100644 index a0ea7210..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/Matching/HostValidator.php +++ /dev/null @@ -1,27 +0,0 @@ -getCompiled()->getHostRegex(); - - if (is_null($hostRegex)) { - return true; - } - - return preg_match($hostRegex, $request->getHost()); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/Matching/MethodValidator.php b/vendor/laravel/framework/src/Illuminate/Routing/Matching/MethodValidator.php deleted file mode 100644 index f9cf155d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/Matching/MethodValidator.php +++ /dev/null @@ -1,21 +0,0 @@ -getMethod(), $route->methods()); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/Matching/SchemeValidator.php b/vendor/laravel/framework/src/Illuminate/Routing/Matching/SchemeValidator.php deleted file mode 100644 index fd5d5af8..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/Matching/SchemeValidator.php +++ /dev/null @@ -1,27 +0,0 @@ -httpOnly()) { - return ! $request->secure(); - } elseif ($route->secure()) { - return $request->secure(); - } - - return true; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/Matching/UriValidator.php b/vendor/laravel/framework/src/Illuminate/Routing/Matching/UriValidator.php deleted file mode 100644 index 4dcc2cf3..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/Matching/UriValidator.php +++ /dev/null @@ -1,23 +0,0 @@ -getPathInfo(), '/') ?: '/'; - - return preg_match($route->getCompiled()->getRegex(), rawurldecode($path)); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/Matching/ValidatorInterface.php b/vendor/laravel/framework/src/Illuminate/Routing/Matching/ValidatorInterface.php deleted file mode 100644 index 0f178f13..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/Matching/ValidatorInterface.php +++ /dev/null @@ -1,18 +0,0 @@ -router = $router; - } - - /** - * Handle an incoming request. - * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @return mixed - */ - public function handle($request, Closure $next) - { - try { - $this->router->substituteBindings($route = $request->route()); - - $this->router->substituteImplicitBindings($route); - } catch (ModelNotFoundException $exception) { - if ($route->getMissing()) { - return $route->getMissing()($request, $exception); - } - - throw $exception; - } - - return $next($request); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php b/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php deleted file mode 100644 index 09675250..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php +++ /dev/null @@ -1,276 +0,0 @@ -limiter = $limiter; - } - - /** - * Handle an incoming request. - * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @param int|string $maxAttempts - * @param float|int $decayMinutes - * @param string $prefix - * @return \Symfony\Component\HttpFoundation\Response - * - * @throws \Illuminate\Http\Exceptions\ThrottleRequestsException - */ - public function handle($request, Closure $next, $maxAttempts = 60, $decayMinutes = 1, $prefix = '') - { - if (is_string($maxAttempts) - && func_num_args() === 3 - && ! is_null($limiter = $this->limiter->limiter($maxAttempts))) { - return $this->handleRequestUsingNamedLimiter($request, $next, $maxAttempts, $limiter); - } - - return $this->handleRequest( - $request, - $next, - [ - (object) [ - 'key' => $prefix.$this->resolveRequestSignature($request), - 'maxAttempts' => $this->resolveMaxAttempts($request, $maxAttempts), - 'decayMinutes' => $decayMinutes, - 'responseCallback' => null, - ], - ] - ); - } - - /** - * Handle an incoming request. - * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @param string $limiterName - * @param \Closure $limiter - * @return \Symfony\Component\HttpFoundation\Response - * - * @throws \Illuminate\Http\Exceptions\ThrottleRequestsException - */ - protected function handleRequestUsingNamedLimiter($request, Closure $next, $limiterName, Closure $limiter) - { - $limiterResponse = $limiter($request); - - if ($limiterResponse instanceof Response) { - return $limiterResponse; - } elseif ($limiterResponse instanceof Unlimited) { - return $next($request); - } - - return $this->handleRequest( - $request, - $next, - collect(Arr::wrap($limiterResponse))->map(function ($limit) use ($limiterName) { - return (object) [ - 'key' => md5($limiterName.$limit->key), - 'maxAttempts' => $limit->maxAttempts, - 'decayMinutes' => $limit->decayMinutes, - 'responseCallback' => $limit->responseCallback, - ]; - })->all() - ); - } - - /** - * Handle an incoming request. - * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @param array $limits - * @return \Symfony\Component\HttpFoundation\Response - * - * @throws \Illuminate\Http\Exceptions\ThrottleRequestsException - */ - protected function handleRequest($request, Closure $next, array $limits) - { - foreach ($limits as $limit) { - if ($this->limiter->tooManyAttempts($limit->key, $limit->maxAttempts)) { - throw $this->buildException($request, $limit->key, $limit->maxAttempts, $limit->responseCallback); - } - - $this->limiter->hit($limit->key, $limit->decayMinutes * 60); - } - - $response = $next($request); - - foreach ($limits as $limit) { - $response = $this->addHeaders( - $response, - $limit->maxAttempts, - $this->calculateRemainingAttempts($limit->key, $limit->maxAttempts) - ); - } - - return $response; - } - - /** - * Resolve the number of attempts if the user is authenticated or not. - * - * @param \Illuminate\Http\Request $request - * @param int|string $maxAttempts - * @return int - */ - protected function resolveMaxAttempts($request, $maxAttempts) - { - if (str_contains($maxAttempts, '|')) { - $maxAttempts = explode('|', $maxAttempts, 2)[$request->user() ? 1 : 0]; - } - - if (! is_numeric($maxAttempts) && $request->user()) { - $maxAttempts = $request->user()->{$maxAttempts}; - } - - return (int) $maxAttempts; - } - - /** - * Resolve request signature. - * - * @param \Illuminate\Http\Request $request - * @return string - * - * @throws \RuntimeException - */ - protected function resolveRequestSignature($request) - { - if ($user = $request->user()) { - return sha1($user->getAuthIdentifier()); - } elseif ($route = $request->route()) { - return sha1($route->getDomain().'|'.$request->ip()); - } - - throw new RuntimeException('Unable to generate the request signature. Route unavailable.'); - } - - /** - * Create a 'too many attempts' exception. - * - * @param \Illuminate\Http\Request $request - * @param string $key - * @param int $maxAttempts - * @param callable|null $responseCallback - * @return \Illuminate\Http\Exceptions\ThrottleRequestsException - */ - protected function buildException($request, $key, $maxAttempts, $responseCallback = null) - { - $retryAfter = $this->getTimeUntilNextRetry($key); - - $headers = $this->getHeaders( - $maxAttempts, - $this->calculateRemainingAttempts($key, $maxAttempts, $retryAfter), - $retryAfter - ); - - return is_callable($responseCallback) - ? new HttpResponseException($responseCallback($request, $headers)) - : new ThrottleRequestsException('Too Many Attempts.', null, $headers); - } - - /** - * Get the number of seconds until the next retry. - * - * @param string $key - * @return int - */ - protected function getTimeUntilNextRetry($key) - { - return $this->limiter->availableIn($key); - } - - /** - * Add the limit header information to the given response. - * - * @param \Symfony\Component\HttpFoundation\Response $response - * @param int $maxAttempts - * @param int $remainingAttempts - * @param int|null $retryAfter - * @return \Symfony\Component\HttpFoundation\Response - */ - protected function addHeaders(Response $response, $maxAttempts, $remainingAttempts, $retryAfter = null) - { - $response->headers->add( - $this->getHeaders($maxAttempts, $remainingAttempts, $retryAfter, $response) - ); - - return $response; - } - - /** - * Get the limit headers information. - * - * @param int $maxAttempts - * @param int $remainingAttempts - * @param int|null $retryAfter - * @param \Symfony\Component\HttpFoundation\Response|null $response - * @return array - */ - protected function getHeaders($maxAttempts, - $remainingAttempts, - $retryAfter = null, - ?Response $response = null) - { - if ($response && - ! is_null($response->headers->get('X-RateLimit-Remaining')) && - (int) $response->headers->get('X-RateLimit-Remaining') <= (int) $remainingAttempts) { - return []; - } - - $headers = [ - 'X-RateLimit-Limit' => $maxAttempts, - 'X-RateLimit-Remaining' => $remainingAttempts, - ]; - - if (! is_null($retryAfter)) { - $headers['Retry-After'] = $retryAfter; - $headers['X-RateLimit-Reset'] = $this->availableAt($retryAfter); - } - - return $headers; - } - - /** - * Calculate the number of remaining attempts. - * - * @param string $key - * @param int $maxAttempts - * @param int|null $retryAfter - * @return int - */ - protected function calculateRemainingAttempts($key, $maxAttempts, $retryAfter = null) - { - return is_null($retryAfter) ? $this->limiter->retriesLeft($key, $maxAttempts) : 0; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequestsWithRedis.php b/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequestsWithRedis.php deleted file mode 100644 index 777f30c0..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequestsWithRedis.php +++ /dev/null @@ -1,122 +0,0 @@ -redis = $redis; - } - - /** - * Handle an incoming request. - * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @param array $limits - * @return \Symfony\Component\HttpFoundation\Response - * - * @throws \Illuminate\Http\Exceptions\ThrottleRequestsException - */ - protected function handleRequest($request, Closure $next, array $limits) - { - foreach ($limits as $limit) { - if ($this->tooManyAttempts($limit->key, $limit->maxAttempts, $limit->decayMinutes)) { - throw $this->buildException($request, $limit->key, $limit->maxAttempts, $limit->responseCallback); - } - } - - $response = $next($request); - - foreach ($limits as $limit) { - $response = $this->addHeaders( - $response, - $limit->maxAttempts, - $this->calculateRemainingAttempts($limit->key, $limit->maxAttempts) - ); - } - - return $response; - } - - /** - * Determine if the given key has been "accessed" too many times. - * - * @param string $key - * @param int $maxAttempts - * @param int $decayMinutes - * @return mixed - */ - protected function tooManyAttempts($key, $maxAttempts, $decayMinutes) - { - $limiter = new DurationLimiter( - $this->redis, $key, $maxAttempts, $decayMinutes * 60 - ); - - return tap(! $limiter->acquire(), function () use ($key, $limiter) { - [$this->decaysAt[$key], $this->remaining[$key]] = [ - $limiter->decaysAt, $limiter->remaining, - ]; - }); - } - - /** - * Calculate the number of remaining attempts. - * - * @param string $key - * @param int $maxAttempts - * @param int|null $retryAfter - * @return int - */ - protected function calculateRemainingAttempts($key, $maxAttempts, $retryAfter = null) - { - return is_null($retryAfter) ? $this->remaining[$key] : 0; - } - - /** - * Get the number of seconds until the lock is released. - * - * @param string $key - * @return int - */ - protected function getTimeUntilNextRetry($key) - { - return $this->decaysAt[$key] - $this->currentTime(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ValidateSignature.php b/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ValidateSignature.php deleted file mode 100644 index 63841b28..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ValidateSignature.php +++ /dev/null @@ -1,39 +0,0 @@ - - */ - protected $ignore = [ - // - ]; - - /** - * Handle an incoming request. - * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @param string|null $relative - * @return \Illuminate\Http\Response - * - * @throws \Illuminate\Routing\Exceptions\InvalidSignatureException - */ - public function handle($request, Closure $next, $relative = null) - { - $ignore = property_exists($this, 'except') ? $this->except : $this->ignore; - - if ($request->hasValidSignatureWhileIgnoring($ignore, $relative !== 'relative')) { - return $next($request); - } - - throw new InvalidSignatureException; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/MiddlewareNameResolver.php b/vendor/laravel/framework/src/Illuminate/Routing/MiddlewareNameResolver.php deleted file mode 100644 index 87ab42d1..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/MiddlewareNameResolver.php +++ /dev/null @@ -1,85 +0,0 @@ -name = $name; - $this->options = $options; - $this->registrar = $registrar; - $this->controller = $controller; - } - - /** - * Set the methods the controller should apply to. - * - * @param array|string|dynamic $methods - * @return \Illuminate\Routing\PendingResourceRegistration - */ - public function only($methods) - { - $this->options['only'] = is_array($methods) ? $methods : func_get_args(); - - return $this; - } - - /** - * Set the methods the controller should exclude. - * - * @param array|string|dynamic $methods - * @return \Illuminate\Routing\PendingResourceRegistration - */ - public function except($methods) - { - $this->options['except'] = is_array($methods) ? $methods : func_get_args(); - - return $this; - } - - /** - * Set the route names for controller actions. - * - * @param array|string $names - * @return \Illuminate\Routing\PendingResourceRegistration - */ - public function names($names) - { - $this->options['names'] = $names; - - return $this; - } - - /** - * Set the route name for a controller action. - * - * @param string $method - * @param string $name - * @return \Illuminate\Routing\PendingResourceRegistration - */ - public function name($method, $name) - { - $this->options['names'][$method] = $name; - - return $this; - } - - /** - * Override the route parameter names. - * - * @param array|string $parameters - * @return \Illuminate\Routing\PendingResourceRegistration - */ - public function parameters($parameters) - { - $this->options['parameters'] = $parameters; - - return $this; - } - - /** - * Override a route parameter's name. - * - * @param string $previous - * @param string $new - * @return \Illuminate\Routing\PendingResourceRegistration - */ - public function parameter($previous, $new) - { - $this->options['parameters'][$previous] = $new; - - return $this; - } - - /** - * Add middleware to the resource routes. - * - * @param mixed $middleware - * @return \Illuminate\Routing\PendingResourceRegistration - */ - public function middleware($middleware) - { - $middleware = Arr::wrap($middleware); - - foreach ($middleware as $key => $value) { - $middleware[$key] = (string) $value; - } - - $this->options['middleware'] = $middleware; - - return $this; - } - - /** - * Specify middleware that should be removed from the resource routes. - * - * @param array|string $middleware - * @return $this|array - */ - public function withoutMiddleware($middleware) - { - $this->options['excluded_middleware'] = array_merge( - (array) ($this->options['excluded_middleware'] ?? []), Arr::wrap($middleware) - ); - - return $this; - } - - /** - * Add "where" constraints to the resource routes. - * - * @param mixed $wheres - * @return \Illuminate\Routing\PendingResourceRegistration - */ - public function where($wheres) - { - $this->options['wheres'] = $wheres; - - return $this; - } - - /** - * Indicate that the resource routes should have "shallow" nesting. - * - * @param bool $shallow - * @return \Illuminate\Routing\PendingResourceRegistration - */ - public function shallow($shallow = true) - { - $this->options['shallow'] = $shallow; - - return $this; - } - - /** - * Define the callable that should be invoked on a missing model exception. - * - * @param callable $callback - * @return $this - */ - public function missing($callback) - { - $this->options['missing'] = $callback; - - return $this; - } - - /** - * Indicate that the resource routes should be scoped using the given binding fields. - * - * @param array $fields - * @return \Illuminate\Routing\PendingResourceRegistration - */ - public function scoped(array $fields = []) - { - $this->options['bindingFields'] = $fields; - - return $this; - } - - /** - * Define which routes should allow "trashed" models to be retrieved when resolving implicit model bindings. - * - * @param array $methods - * @return \Illuminate\Routing\PendingResourceRegistration - */ - public function withTrashed(array $methods = []) - { - $this->options['trashed'] = $methods; - - return $this; - } - - /** - * Register the resource route. - * - * @return \Illuminate\Routing\RouteCollection - */ - public function register() - { - $this->registered = true; - - return $this->registrar->register( - $this->name, $this->controller, $this->options - ); - } - - /** - * Handle the object's destruction. - * - * @return void - */ - public function __destruct() - { - if (! $this->registered) { - $this->register(); - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/PendingSingletonResourceRegistration.php b/vendor/laravel/framework/src/Illuminate/Routing/PendingSingletonResourceRegistration.php deleted file mode 100644 index 28a0c8d4..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/PendingSingletonResourceRegistration.php +++ /dev/null @@ -1,229 +0,0 @@ -name = $name; - $this->options = $options; - $this->registrar = $registrar; - $this->controller = $controller; - } - - /** - * Set the methods the controller should apply to. - * - * @param array|string|dynamic $methods - * @return \Illuminate\Routing\PendingSingletonResourceRegistration - */ - public function only($methods) - { - $this->options['only'] = is_array($methods) ? $methods : func_get_args(); - - return $this; - } - - /** - * Set the methods the controller should exclude. - * - * @param array|string|dynamic $methods - * @return \Illuminate\Routing\PendingSingletonResourceRegistration - */ - public function except($methods) - { - $this->options['except'] = is_array($methods) ? $methods : func_get_args(); - - return $this; - } - - /** - * Indicate that the resource should have creation and storage routes. - * - * @param bool $creatable - * @return $this - */ - public function creatable($creatable = true) - { - $this->options['creatable'] = $creatable; - - return $this; - } - - /** - * Set the route names for controller actions. - * - * @param array|string $names - * @return \Illuminate\Routing\PendingSingletonResourceRegistration - */ - public function names($names) - { - $this->options['names'] = $names; - - return $this; - } - - /** - * Set the route name for a controller action. - * - * @param string $method - * @param string $name - * @return \Illuminate\Routing\PendingSingletonResourceRegistration - */ - public function name($method, $name) - { - $this->options['names'][$method] = $name; - - return $this; - } - - /** - * Override the route parameter names. - * - * @param array|string $parameters - * @return \Illuminate\Routing\PendingSingletonResourceRegistration - */ - public function parameters($parameters) - { - $this->options['parameters'] = $parameters; - - return $this; - } - - /** - * Override a route parameter's name. - * - * @param string $previous - * @param string $new - * @return \Illuminate\Routing\PendingSingletonResourceRegistration - */ - public function parameter($previous, $new) - { - $this->options['parameters'][$previous] = $new; - - return $this; - } - - /** - * Add middleware to the resource routes. - * - * @param mixed $middleware - * @return \Illuminate\Routing\PendingSingletonResourceRegistration - */ - public function middleware($middleware) - { - $middleware = Arr::wrap($middleware); - - foreach ($middleware as $key => $value) { - $middleware[$key] = (string) $value; - } - - $this->options['middleware'] = $middleware; - - return $this; - } - - /** - * Specify middleware that should be removed from the resource routes. - * - * @param array|string $middleware - * @return $this|array - */ - public function withoutMiddleware($middleware) - { - $this->options['excluded_middleware'] = array_merge( - (array) ($this->options['excluded_middleware'] ?? []), Arr::wrap($middleware) - ); - - return $this; - } - - /** - * Add "where" constraints to the resource routes. - * - * @param mixed $wheres - * @return \Illuminate\Routing\PendingSingletonResourceRegistration - */ - public function where($wheres) - { - $this->options['wheres'] = $wheres; - - return $this; - } - - /** - * Register the singleton resource route. - * - * @return \Illuminate\Routing\RouteCollection - */ - public function register() - { - $this->registered = true; - - return $this->registrar->singleton( - $this->name, $this->controller, $this->options - ); - } - - /** - * Handle the object's destruction. - * - * @return void - */ - public function __destruct() - { - if (! $this->registered) { - $this->register(); - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php b/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php deleted file mode 100644 index e43d5919..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php +++ /dev/null @@ -1,59 +0,0 @@ -toResponse($this->getContainer()->make(Request::class)) - : $carry; - } - - /** - * Handle the given exception. - * - * @param mixed $passable - * @param \Throwable $e - * @return mixed - * - * @throws \Throwable - */ - protected function handleException($passable, Throwable $e) - { - if (! $this->container->bound(ExceptionHandler::class) || - ! $passable instanceof Request) { - throw $e; - } - - $handler = $this->container->make(ExceptionHandler::class); - - $handler->report($e); - - $response = $handler->render($passable, $e); - - if (is_object($response) && method_exists($response, 'withException')) { - $response->withException($e); - } - - return $response; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/RedirectController.php b/vendor/laravel/framework/src/Illuminate/Routing/RedirectController.php deleted file mode 100644 index 3dd24895..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/RedirectController.php +++ /dev/null @@ -1,44 +0,0 @@ -route()->parameters()); - - $status = $parameters->get('status'); - - $destination = $parameters->get('destination'); - - $parameters->forget('status')->forget('destination'); - - $route = (new Route('GET', $destination, [ - 'as' => 'laravel_route_redirect_destination', - ]))->bind($request); - - $parameters = $parameters->only( - $route->getCompiled()->getPathVariables() - )->toArray(); - - $url = $url->toRoute($route, $parameters, false); - - if (! str_starts_with($destination, '/') && str_starts_with($url, '/')) { - $url = Str::after($url, '/'); - } - - return new RedirectResponse($url, $status); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/Redirector.php b/vendor/laravel/framework/src/Illuminate/Routing/Redirector.php deleted file mode 100755 index 362e288a..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/Redirector.php +++ /dev/null @@ -1,276 +0,0 @@ -generator = $generator; - } - - /** - * Create a new redirect response to the "home" route. - * - * @param int $status - * @return \Illuminate\Http\RedirectResponse - * - * @deprecated Will be removed in a future Laravel version. - */ - public function home($status = 302) - { - return $this->to($this->generator->route('home'), $status); - } - - /** - * Create a new redirect response to the previous location. - * - * @param int $status - * @param array $headers - * @param mixed $fallback - * @return \Illuminate\Http\RedirectResponse - */ - public function back($status = 302, $headers = [], $fallback = false) - { - return $this->createRedirect($this->generator->previous($fallback), $status, $headers); - } - - /** - * Create a new redirect response to the current URI. - * - * @param int $status - * @param array $headers - * @return \Illuminate\Http\RedirectResponse - */ - public function refresh($status = 302, $headers = []) - { - return $this->to($this->generator->getRequest()->path(), $status, $headers); - } - - /** - * Create a new redirect response, while putting the current URL in the session. - * - * @param string $path - * @param int $status - * @param array $headers - * @param bool|null $secure - * @return \Illuminate\Http\RedirectResponse - */ - public function guest($path, $status = 302, $headers = [], $secure = null) - { - $request = $this->generator->getRequest(); - - $intended = $request->isMethod('GET') && $request->route() && ! $request->expectsJson() - ? $this->generator->full() - : $this->generator->previous(); - - if ($intended) { - $this->setIntendedUrl($intended); - } - - return $this->to($path, $status, $headers, $secure); - } - - /** - * Create a new redirect response to the previously intended location. - * - * @param mixed $default - * @param int $status - * @param array $headers - * @param bool|null $secure - * @return \Illuminate\Http\RedirectResponse - */ - public function intended($default = '/', $status = 302, $headers = [], $secure = null) - { - $path = $this->session->pull('url.intended', $default); - - return $this->to($path, $status, $headers, $secure); - } - - /** - * Create a new redirect response to the given path. - * - * @param string $path - * @param int $status - * @param array $headers - * @param bool|null $secure - * @return \Illuminate\Http\RedirectResponse - */ - public function to($path, $status = 302, $headers = [], $secure = null) - { - return $this->createRedirect($this->generator->to($path, [], $secure), $status, $headers); - } - - /** - * Create a new redirect response to an external URL (no validation). - * - * @param string $path - * @param int $status - * @param array $headers - * @return \Illuminate\Http\RedirectResponse - */ - public function away($path, $status = 302, $headers = []) - { - return $this->createRedirect($path, $status, $headers); - } - - /** - * Create a new redirect response to the given HTTPS path. - * - * @param string $path - * @param int $status - * @param array $headers - * @return \Illuminate\Http\RedirectResponse - */ - public function secure($path, $status = 302, $headers = []) - { - return $this->to($path, $status, $headers, true); - } - - /** - * Create a new redirect response to a named route. - * - * @param string $route - * @param mixed $parameters - * @param int $status - * @param array $headers - * @return \Illuminate\Http\RedirectResponse - */ - public function route($route, $parameters = [], $status = 302, $headers = []) - { - return $this->to($this->generator->route($route, $parameters), $status, $headers); - } - - /** - * Create a new redirect response to a signed named route. - * - * @param string $route - * @param mixed $parameters - * @param \DateTimeInterface|\DateInterval|int|null $expiration - * @param int $status - * @param array $headers - * @return \Illuminate\Http\RedirectResponse - */ - public function signedRoute($route, $parameters = [], $expiration = null, $status = 302, $headers = []) - { - return $this->to($this->generator->signedRoute($route, $parameters, $expiration), $status, $headers); - } - - /** - * Create a new redirect response to a signed named route. - * - * @param string $route - * @param \DateTimeInterface|\DateInterval|int|null $expiration - * @param mixed $parameters - * @param int $status - * @param array $headers - * @return \Illuminate\Http\RedirectResponse - */ - public function temporarySignedRoute($route, $expiration, $parameters = [], $status = 302, $headers = []) - { - return $this->to($this->generator->temporarySignedRoute($route, $expiration, $parameters), $status, $headers); - } - - /** - * Create a new redirect response to a controller action. - * - * @param string|array $action - * @param mixed $parameters - * @param int $status - * @param array $headers - * @return \Illuminate\Http\RedirectResponse - */ - public function action($action, $parameters = [], $status = 302, $headers = []) - { - return $this->to($this->generator->action($action, $parameters), $status, $headers); - } - - /** - * Create a new redirect response. - * - * @param string $path - * @param int $status - * @param array $headers - * @return \Illuminate\Http\RedirectResponse - */ - protected function createRedirect($path, $status, $headers) - { - return tap(new RedirectResponse($path, $status, $headers), function ($redirect) { - if (isset($this->session)) { - $redirect->setSession($this->session); - } - - $redirect->setRequest($this->generator->getRequest()); - }); - } - - /** - * Get the URL generator instance. - * - * @return \Illuminate\Routing\UrlGenerator - */ - public function getUrlGenerator() - { - return $this->generator; - } - - /** - * Set the active session store. - * - * @param \Illuminate\Session\Store $session - * @return void - */ - public function setSession(SessionStore $session) - { - $this->session = $session; - } - - /** - * Get the "intended" URL from the session. - * - * @return string|null - */ - public function getIntendedUrl() - { - return $this->session->get('url.intended'); - } - - /** - * Set the "intended" URL in the session. - * - * @param string $url - * @return $this - */ - public function setIntendedUrl($url) - { - $this->session->put('url.intended', $url); - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/ResourceRegistrar.php b/vendor/laravel/framework/src/Illuminate/Routing/ResourceRegistrar.php deleted file mode 100644 index af81a180..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/ResourceRegistrar.php +++ /dev/null @@ -1,720 +0,0 @@ - 'create', - 'edit' => 'edit', - ]; - - /** - * Create a new resource registrar instance. - * - * @param \Illuminate\Routing\Router $router - * @return void - */ - public function __construct(Router $router) - { - $this->router = $router; - } - - /** - * Route a resource to a controller. - * - * @param string $name - * @param string $controller - * @param array $options - * @return \Illuminate\Routing\RouteCollection - */ - public function register($name, $controller, array $options = []) - { - if (isset($options['parameters']) && ! isset($this->parameters)) { - $this->parameters = $options['parameters']; - } - - // If the resource name contains a slash, we will assume the developer wishes to - // register these resource routes with a prefix so we will set that up out of - // the box so they don't have to mess with it. Otherwise, we will continue. - if (str_contains($name, '/')) { - $this->prefixedResource($name, $controller, $options); - - return; - } - - // We need to extract the base resource from the resource name. Nested resources - // are supported in the framework, but we need to know what name to use for a - // place-holder on the route parameters, which should be the base resources. - $base = $this->getResourceWildcard(last(explode('.', $name))); - - $defaults = $this->resourceDefaults; - - $collection = new RouteCollection; - - $resourceMethods = $this->getResourceMethods($defaults, $options); - - foreach ($resourceMethods as $m) { - $route = $this->{'addResource'.ucfirst($m)}( - $name, $base, $controller, $options - ); - - if (isset($options['bindingFields'])) { - $this->setResourceBindingFields($route, $options['bindingFields']); - } - - if (isset($options['trashed']) && - in_array($m, ! empty($options['trashed']) ? $options['trashed'] : array_intersect($resourceMethods, ['show', 'edit', 'update']))) { - $route->withTrashed(); - } - - $collection->add($route); - } - - return $collection; - } - - /** - * Route a singleton resource to a controller. - * - * @param string $name - * @param string $controller - * @param array $options - * @return \Illuminate\Routing\RouteCollection - */ - public function singleton($name, $controller, array $options = []) - { - if (isset($options['parameters']) && ! isset($this->parameters)) { - $this->parameters = $options['parameters']; - } - - // If the resource name contains a slash, we will assume the developer wishes to - // register these singleton routes with a prefix so we will set that up out of - // the box so they don't have to mess with it. Otherwise, we will continue. - if (str_contains($name, '/')) { - $this->prefixedSingleton($name, $controller, $options); - - return; - } - - $defaults = $this->singletonResourceDefaults; - - $collection = new RouteCollection; - - $resourceMethods = $this->getResourceMethods($defaults, $options); - - foreach ($resourceMethods as $m) { - $route = $this->{'addSingleton'.ucfirst($m)}( - $name, $controller, $options - ); - - if (isset($options['bindingFields'])) { - $this->setResourceBindingFields($route, $options['bindingFields']); - } - - $collection->add($route); - } - - return $collection; - } - - /** - * Build a set of prefixed resource routes. - * - * @param string $name - * @param string $controller - * @param array $options - * @return void - */ - protected function prefixedResource($name, $controller, array $options) - { - [$name, $prefix] = $this->getResourcePrefix($name); - - // We need to extract the base resource from the resource name. Nested resources - // are supported in the framework, but we need to know what name to use for a - // place-holder on the route parameters, which should be the base resources. - $callback = function ($me) use ($name, $controller, $options) { - $me->resource($name, $controller, $options); - }; - - return $this->router->group(compact('prefix'), $callback); - } - - /** - * Build a set of prefixed singleton routes. - * - * @param string $name - * @param string $controller - * @param array $options - * @return void - */ - protected function prefixedSingleton($name, $controller, array $options) - { - [$name, $prefix] = $this->getResourcePrefix($name); - - // We need to extract the base resource from the resource name. Nested resources - // are supported in the framework, but we need to know what name to use for a - // place-holder on the route parameters, which should be the base resources. - $callback = function ($me) use ($name, $controller, $options) { - $me->singleton($name, $controller, $options); - }; - - return $this->router->group(compact('prefix'), $callback); - } - - /** - * Extract the resource and prefix from a resource name. - * - * @param string $name - * @return array - */ - protected function getResourcePrefix($name) - { - $segments = explode('/', $name); - - // To get the prefix, we will take all of the name segments and implode them on - // a slash. This will generate a proper URI prefix for us. Then we take this - // last segment, which will be considered the final resources name we use. - $prefix = implode('/', array_slice($segments, 0, -1)); - - return [end($segments), $prefix]; - } - - /** - * Get the applicable resource methods. - * - * @param array $defaults - * @param array $options - * @return array - */ - protected function getResourceMethods($defaults, $options) - { - $methods = $defaults; - - if (isset($options['only'])) { - $methods = array_intersect($methods, (array) $options['only']); - } - - if (isset($options['except'])) { - $methods = array_diff($methods, (array) $options['except']); - } - - if (isset($options['creatable'])) { - $methods = isset($options['apiSingleton']) - ? array_merge(['store', 'destroy'], $methods) - : array_merge(['create', 'store', 'destroy'], $methods); - - return $this->getResourceMethods( - $methods, array_values(Arr::except($options, ['creatable'])) - ); - } - - return $methods; - } - - /** - * Add the index method for a resourceful route. - * - * @param string $name - * @param string $base - * @param string $controller - * @param array $options - * @return \Illuminate\Routing\Route - */ - protected function addResourceIndex($name, $base, $controller, $options) - { - $uri = $this->getResourceUri($name); - - unset($options['missing']); - - $action = $this->getResourceAction($name, $controller, 'index', $options); - - return $this->router->get($uri, $action); - } - - /** - * Add the create method for a resourceful route. - * - * @param string $name - * @param string $base - * @param string $controller - * @param array $options - * @return \Illuminate\Routing\Route - */ - protected function addResourceCreate($name, $base, $controller, $options) - { - $uri = $this->getResourceUri($name).'/'.static::$verbs['create']; - - unset($options['missing']); - - $action = $this->getResourceAction($name, $controller, 'create', $options); - - return $this->router->get($uri, $action); - } - - /** - * Add the store method for a resourceful route. - * - * @param string $name - * @param string $base - * @param string $controller - * @param array $options - * @return \Illuminate\Routing\Route - */ - protected function addResourceStore($name, $base, $controller, $options) - { - $uri = $this->getResourceUri($name); - - unset($options['missing']); - - $action = $this->getResourceAction($name, $controller, 'store', $options); - - return $this->router->post($uri, $action); - } - - /** - * Add the show method for a resourceful route. - * - * @param string $name - * @param string $base - * @param string $controller - * @param array $options - * @return \Illuminate\Routing\Route - */ - protected function addResourceShow($name, $base, $controller, $options) - { - $name = $this->getShallowName($name, $options); - - $uri = $this->getResourceUri($name).'/{'.$base.'}'; - - $action = $this->getResourceAction($name, $controller, 'show', $options); - - return $this->router->get($uri, $action); - } - - /** - * Add the edit method for a resourceful route. - * - * @param string $name - * @param string $base - * @param string $controller - * @param array $options - * @return \Illuminate\Routing\Route - */ - protected function addResourceEdit($name, $base, $controller, $options) - { - $name = $this->getShallowName($name, $options); - - $uri = $this->getResourceUri($name).'/{'.$base.'}/'.static::$verbs['edit']; - - $action = $this->getResourceAction($name, $controller, 'edit', $options); - - return $this->router->get($uri, $action); - } - - /** - * Add the update method for a resourceful route. - * - * @param string $name - * @param string $base - * @param string $controller - * @param array $options - * @return \Illuminate\Routing\Route - */ - protected function addResourceUpdate($name, $base, $controller, $options) - { - $name = $this->getShallowName($name, $options); - - $uri = $this->getResourceUri($name).'/{'.$base.'}'; - - $action = $this->getResourceAction($name, $controller, 'update', $options); - - return $this->router->match(['PUT', 'PATCH'], $uri, $action); - } - - /** - * Add the destroy method for a resourceful route. - * - * @param string $name - * @param string $base - * @param string $controller - * @param array $options - * @return \Illuminate\Routing\Route - */ - protected function addResourceDestroy($name, $base, $controller, $options) - { - $name = $this->getShallowName($name, $options); - - $uri = $this->getResourceUri($name).'/{'.$base.'}'; - - $action = $this->getResourceAction($name, $controller, 'destroy', $options); - - return $this->router->delete($uri, $action); - } - - /** - * Add the create method for a singleton route. - * - * @param string $name - * @param string $controller - * @param array $options - * @return \Illuminate\Routing\Route - */ - protected function addSingletonCreate($name, $controller, $options) - { - $uri = $this->getResourceUri($name).'/'.static::$verbs['create']; - - unset($options['missing']); - - $action = $this->getResourceAction($name, $controller, 'create', $options); - - return $this->router->get($uri, $action); - } - - /** - * Add the store method for a singleton route. - * - * @param string $name - * @param string $controller - * @param array $options - * @return \Illuminate\Routing\Route - */ - protected function addSingletonStore($name, $controller, $options) - { - $uri = $this->getResourceUri($name); - - unset($options['missing']); - - $action = $this->getResourceAction($name, $controller, 'store', $options); - - return $this->router->post($uri, $action); - } - - /** - * Add the show method for a singleton route. - * - * @param string $name - * @param string $controller - * @param array $options - * @return \Illuminate\Routing\Route - */ - protected function addSingletonShow($name, $controller, $options) - { - $uri = $this->getResourceUri($name); - - unset($options['missing']); - - $action = $this->getResourceAction($name, $controller, 'show', $options); - - return $this->router->get($uri, $action); - } - - /** - * Add the edit method for a singleton route. - * - * @param string $name - * @param string $controller - * @param array $options - * @return \Illuminate\Routing\Route - */ - protected function addSingletonEdit($name, $controller, $options) - { - $name = $this->getShallowName($name, $options); - - $uri = $this->getResourceUri($name).'/'.static::$verbs['edit']; - - $action = $this->getResourceAction($name, $controller, 'edit', $options); - - return $this->router->get($uri, $action); - } - - /** - * Add the update method for a singleton route. - * - * @param string $name - * @param string $base - * @param string $controller - * @param array $options - * @return \Illuminate\Routing\Route - */ - protected function addSingletonUpdate($name, $controller, $options) - { - $name = $this->getShallowName($name, $options); - - $uri = $this->getResourceUri($name); - - $action = $this->getResourceAction($name, $controller, 'update', $options); - - return $this->router->match(['PUT', 'PATCH'], $uri, $action); - } - - /** - * Add the destroy method for a singleton route. - * - * @param string $name - * @param string $controller - * @param array $options - * @return \Illuminate\Routing\Route - */ - protected function addSingletonDestroy($name, $controller, $options) - { - $name = $this->getShallowName($name, $options); - - $uri = $this->getResourceUri($name); - - $action = $this->getResourceAction($name, $controller, 'destroy', $options); - - return $this->router->delete($uri, $action); - } - - /** - * Get the name for a given resource with shallowness applied when applicable. - * - * @param string $name - * @param array $options - * @return string - */ - protected function getShallowName($name, $options) - { - return isset($options['shallow']) && $options['shallow'] - ? last(explode('.', $name)) - : $name; - } - - /** - * Set the route's binding fields if the resource is scoped. - * - * @param \Illuminate\Routing\Route $route - * @param array $bindingFields - * @return void - */ - protected function setResourceBindingFields($route, $bindingFields) - { - preg_match_all('/(?<={).*?(?=})/', $route->uri, $matches); - - $fields = array_fill_keys($matches[0], null); - - $route->setBindingFields(array_replace( - $fields, array_intersect_key($bindingFields, $fields) - )); - } - - /** - * Get the base resource URI for a given resource. - * - * @param string $resource - * @return string - */ - public function getResourceUri($resource) - { - if (! str_contains($resource, '.')) { - return $resource; - } - - // Once we have built the base URI, we'll remove the parameter holder for this - // base resource name so that the individual route adders can suffix these - // paths however they need to, as some do not have any parameters at all. - $segments = explode('.', $resource); - - $uri = $this->getNestedResourceUri($segments); - - return str_replace('/{'.$this->getResourceWildcard(end($segments)).'}', '', $uri); - } - - /** - * Get the URI for a nested resource segment array. - * - * @param array $segments - * @return string - */ - protected function getNestedResourceUri(array $segments) - { - // We will spin through the segments and create a place-holder for each of the - // resource segments, as well as the resource itself. Then we should get an - // entire string for the resource URI that contains all nested resources. - return implode('/', array_map(function ($s) { - return $s.'/{'.$this->getResourceWildcard($s).'}'; - }, $segments)); - } - - /** - * Format a resource parameter for usage. - * - * @param string $value - * @return string - */ - public function getResourceWildcard($value) - { - if (isset($this->parameters[$value])) { - $value = $this->parameters[$value]; - } elseif (isset(static::$parameterMap[$value])) { - $value = static::$parameterMap[$value]; - } elseif ($this->parameters === 'singular' || static::$singularParameters) { - $value = Str::singular($value); - } - - return str_replace('-', '_', $value); - } - - /** - * Get the action array for a resource route. - * - * @param string $resource - * @param string $controller - * @param string $method - * @param array $options - * @return array - */ - protected function getResourceAction($resource, $controller, $method, $options) - { - $name = $this->getResourceRouteName($resource, $method, $options); - - $action = ['as' => $name, 'uses' => $controller.'@'.$method]; - - if (isset($options['middleware'])) { - $action['middleware'] = $options['middleware']; - } - - if (isset($options['excluded_middleware'])) { - $action['excluded_middleware'] = $options['excluded_middleware']; - } - - if (isset($options['wheres'])) { - $action['where'] = $options['wheres']; - } - - if (isset($options['missing'])) { - $action['missing'] = $options['missing']; - } - - return $action; - } - - /** - * Get the name for a given resource. - * - * @param string $resource - * @param string $method - * @param array $options - * @return string - */ - protected function getResourceRouteName($resource, $method, $options) - { - $name = $resource; - - // If the names array has been provided to us we will check for an entry in the - // array first. We will also check for the specific method within this array - // so the names may be specified on a more "granular" level using methods. - if (isset($options['names'])) { - if (is_string($options['names'])) { - $name = $options['names']; - } elseif (isset($options['names'][$method])) { - return $options['names'][$method]; - } - } - - // If a global prefix has been assigned to all names for this resource, we will - // grab that so we can prepend it onto the name when we create this name for - // the resource action. Otherwise we'll just use an empty string for here. - $prefix = isset($options['as']) ? $options['as'].'.' : ''; - - return trim(sprintf('%s%s.%s', $prefix, $name, $method), '.'); - } - - /** - * Set or unset the unmapped global parameters to singular. - * - * @param bool $singular - * @return void - */ - public static function singularParameters($singular = true) - { - static::$singularParameters = (bool) $singular; - } - - /** - * Get the global parameter map. - * - * @return array - */ - public static function getParameters() - { - return static::$parameterMap; - } - - /** - * Set the global parameter mapping. - * - * @param array $parameters - * @return void - */ - public static function setParameters(array $parameters = []) - { - static::$parameterMap = $parameters; - } - - /** - * Get or set the action verbs used in the resource URIs. - * - * @param array $verbs - * @return array - */ - public static function verbs(array $verbs = []) - { - if (empty($verbs)) { - return static::$verbs; - } else { - static::$verbs = array_merge(static::$verbs, $verbs); - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php b/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php deleted file mode 100644 index 29ba323e..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php +++ /dev/null @@ -1,276 +0,0 @@ -view = $view; - $this->redirector = $redirector; - } - - /** - * Create a new response instance. - * - * @param mixed $content - * @param int $status - * @param array $headers - * @return \Illuminate\Http\Response - */ - public function make($content = '', $status = 200, array $headers = []) - { - return new Response($content, $status, $headers); - } - - /** - * Create a new "no content" response. - * - * @param int $status - * @param array $headers - * @return \Illuminate\Http\Response - */ - public function noContent($status = 204, array $headers = []) - { - return $this->make('', $status, $headers); - } - - /** - * Create a new response for a given view. - * - * @param string|array $view - * @param array $data - * @param int $status - * @param array $headers - * @return \Illuminate\Http\Response - */ - public function view($view, $data = [], $status = 200, array $headers = []) - { - if (is_array($view)) { - return $this->make($this->view->first($view, $data), $status, $headers); - } - - return $this->make($this->view->make($view, $data), $status, $headers); - } - - /** - * Create a new JSON response instance. - * - * @param mixed $data - * @param int $status - * @param array $headers - * @param int $options - * @return \Illuminate\Http\JsonResponse - */ - public function json($data = [], $status = 200, array $headers = [], $options = 0) - { - return new JsonResponse($data, $status, $headers, $options); - } - - /** - * Create a new JSONP response instance. - * - * @param string $callback - * @param mixed $data - * @param int $status - * @param array $headers - * @param int $options - * @return \Illuminate\Http\JsonResponse - */ - public function jsonp($callback, $data = [], $status = 200, array $headers = [], $options = 0) - { - return $this->json($data, $status, $headers, $options)->setCallback($callback); - } - - /** - * Create a new streamed response instance. - * - * @param \Closure $callback - * @param int $status - * @param array $headers - * @return \Symfony\Component\HttpFoundation\StreamedResponse - */ - public function stream($callback, $status = 200, array $headers = []) - { - return new StreamedResponse($callback, $status, $headers); - } - - /** - * Create a new streamed response instance as a file download. - * - * @param \Closure $callback - * @param string|null $name - * @param array $headers - * @param string|null $disposition - * @return \Symfony\Component\HttpFoundation\StreamedResponse - */ - public function streamDownload($callback, $name = null, array $headers = [], $disposition = 'attachment') - { - $withWrappedException = function () use ($callback) { - try { - $callback(); - } catch (Throwable $e) { - throw new StreamedResponseException($e); - } - }; - - $response = new StreamedResponse($withWrappedException, 200, $headers); - - if (! is_null($name)) { - $response->headers->set('Content-Disposition', $response->headers->makeDisposition( - $disposition, - $name, - $this->fallbackName($name) - )); - } - - return $response; - } - - /** - * Create a new file download response. - * - * @param \SplFileInfo|string $file - * @param string|null $name - * @param array $headers - * @param string|null $disposition - * @return \Symfony\Component\HttpFoundation\BinaryFileResponse - */ - public function download($file, $name = null, array $headers = [], $disposition = 'attachment') - { - $response = new BinaryFileResponse($file, 200, $headers, true, $disposition); - - if (! is_null($name)) { - return $response->setContentDisposition($disposition, $name, $this->fallbackName($name)); - } - - return $response; - } - - /** - * Convert the string to ASCII characters that are equivalent to the given name. - * - * @param string $name - * @return string - */ - protected function fallbackName($name) - { - return str_replace('%', '', Str::ascii($name)); - } - - /** - * Return the raw contents of a binary file. - * - * @param \SplFileInfo|string $file - * @param array $headers - * @return \Symfony\Component\HttpFoundation\BinaryFileResponse - */ - public function file($file, array $headers = []) - { - return new BinaryFileResponse($file, 200, $headers); - } - - /** - * Create a new redirect response to the given path. - * - * @param string $path - * @param int $status - * @param array $headers - * @param bool|null $secure - * @return \Illuminate\Http\RedirectResponse - */ - public function redirectTo($path, $status = 302, $headers = [], $secure = null) - { - return $this->redirector->to($path, $status, $headers, $secure); - } - - /** - * Create a new redirect response to a named route. - * - * @param string $route - * @param mixed $parameters - * @param int $status - * @param array $headers - * @return \Illuminate\Http\RedirectResponse - */ - public function redirectToRoute($route, $parameters = [], $status = 302, $headers = []) - { - return $this->redirector->route($route, $parameters, $status, $headers); - } - - /** - * Create a new redirect response to a controller action. - * - * @param string $action - * @param mixed $parameters - * @param int $status - * @param array $headers - * @return \Illuminate\Http\RedirectResponse - */ - public function redirectToAction($action, $parameters = [], $status = 302, $headers = []) - { - return $this->redirector->action($action, $parameters, $status, $headers); - } - - /** - * Create a new redirect response, while putting the current URL in the session. - * - * @param string $path - * @param int $status - * @param array $headers - * @param bool|null $secure - * @return \Illuminate\Http\RedirectResponse - */ - public function redirectGuest($path, $status = 302, $headers = [], $secure = null) - { - return $this->redirector->guest($path, $status, $headers, $secure); - } - - /** - * Create a new redirect response to the previously intended location. - * - * @param string $default - * @param int $status - * @param array $headers - * @param bool|null $secure - * @return \Illuminate\Http\RedirectResponse - */ - public function redirectToIntended($default = '/', $status = 302, $headers = [], $secure = null) - { - return $this->redirector->intended($default, $status, $headers, $secure); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/Route.php b/vendor/laravel/framework/src/Illuminate/Routing/Route.php deleted file mode 100755 index f14f769e..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/Route.php +++ /dev/null @@ -1,1368 +0,0 @@ -uri = $uri; - $this->methods = (array) $methods; - $this->action = Arr::except($this->parseAction($action), ['prefix']); - - if (in_array('GET', $this->methods) && ! in_array('HEAD', $this->methods)) { - $this->methods[] = 'HEAD'; - } - - $this->prefix(is_array($action) ? Arr::get($action, 'prefix') : ''); - } - - /** - * Parse the route action into a standard array. - * - * @param callable|array|null $action - * @return array - * - * @throws \UnexpectedValueException - */ - protected function parseAction($action) - { - return RouteAction::parse($this->uri, $action); - } - - /** - * Run the route action and return the response. - * - * @return mixed - */ - public function run() - { - $this->container = $this->container ?: new Container; - - try { - if ($this->isControllerAction()) { - return $this->runController(); - } - - return $this->runCallable(); - } catch (HttpResponseException $e) { - return $e->getResponse(); - } - } - - /** - * Checks whether the route's action is a controller. - * - * @return bool - */ - protected function isControllerAction() - { - return is_string($this->action['uses']) && ! $this->isSerializedClosure(); - } - - /** - * Run the route action and return the response. - * - * @return mixed - */ - protected function runCallable() - { - $callable = $this->action['uses']; - - if ($this->isSerializedClosure()) { - $callable = unserialize($this->action['uses'])->getClosure(); - } - - return $this->container[CallableDispatcher::class]->dispatch($this, $callable); - } - - /** - * Determine if the route action is a serialized Closure. - * - * @return bool - */ - protected function isSerializedClosure() - { - return RouteAction::containsSerializedClosure($this->action); - } - - /** - * Run the route action and return the response. - * - * @return mixed - * - * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException - */ - protected function runController() - { - return $this->controllerDispatcher()->dispatch( - $this, $this->getController(), $this->getControllerMethod() - ); - } - - /** - * Get the controller instance for the route. - * - * @return mixed - */ - public function getController() - { - if (! $this->controller) { - $class = $this->getControllerClass(); - - $this->controller = $this->container->make(ltrim($class, '\\')); - } - - return $this->controller; - } - - /** - * Get the controller class used for the route. - * - * @return string - */ - public function getControllerClass() - { - return $this->parseControllerCallback()[0]; - } - - /** - * Get the controller method used for the route. - * - * @return string - */ - protected function getControllerMethod() - { - return $this->parseControllerCallback()[1]; - } - - /** - * Parse the controller. - * - * @return array - */ - protected function parseControllerCallback() - { - return Str::parseCallback($this->action['uses']); - } - - /** - * Flush the cached container instance on the route. - * - * @return void - */ - public function flushController() - { - $this->computedMiddleware = null; - $this->controller = null; - } - - /** - * Determine if the route matches a given request. - * - * @param \Illuminate\Http\Request $request - * @param bool $includingMethod - * @return bool - */ - public function matches(Request $request, $includingMethod = true) - { - $this->compileRoute(); - - foreach (self::getValidators() as $validator) { - if (! $includingMethod && $validator instanceof MethodValidator) { - continue; - } - - if (! $validator->matches($this, $request)) { - return false; - } - } - - return true; - } - - /** - * Compile the route into a Symfony CompiledRoute instance. - * - * @return \Symfony\Component\Routing\CompiledRoute - */ - protected function compileRoute() - { - if (! $this->compiled) { - $this->compiled = $this->toSymfonyRoute()->compile(); - } - - return $this->compiled; - } - - /** - * Bind the route to a given request for execution. - * - * @param \Illuminate\Http\Request $request - * @return $this - */ - public function bind(Request $request) - { - $this->compileRoute(); - - $this->parameters = (new RouteParameterBinder($this)) - ->parameters($request); - - $this->originalParameters = $this->parameters; - - return $this; - } - - /** - * Determine if the route has parameters. - * - * @return bool - */ - public function hasParameters() - { - return isset($this->parameters); - } - - /** - * Determine a given parameter exists from the route. - * - * @param string $name - * @return bool - */ - public function hasParameter($name) - { - if ($this->hasParameters()) { - return array_key_exists($name, $this->parameters()); - } - - return false; - } - - /** - * Get a given parameter from the route. - * - * @param string $name - * @param string|object|null $default - * @return string|object|null - */ - public function parameter($name, $default = null) - { - return Arr::get($this->parameters(), $name, $default); - } - - /** - * Get original value of a given parameter from the route. - * - * @param string $name - * @param string|null $default - * @return string|null - */ - public function originalParameter($name, $default = null) - { - return Arr::get($this->originalParameters(), $name, $default); - } - - /** - * Set a parameter to the given value. - * - * @param string $name - * @param string|object|null $value - * @return void - */ - public function setParameter($name, $value) - { - $this->parameters(); - - $this->parameters[$name] = $value; - } - - /** - * Unset a parameter on the route if it is set. - * - * @param string $name - * @return void - */ - public function forgetParameter($name) - { - $this->parameters(); - - unset($this->parameters[$name]); - } - - /** - * Get the key / value list of parameters for the route. - * - * @return array - * - * @throws \LogicException - */ - public function parameters() - { - if (isset($this->parameters)) { - return $this->parameters; - } - - throw new LogicException('Route is not bound.'); - } - - /** - * Get the key / value list of original parameters for the route. - * - * @return array - * - * @throws \LogicException - */ - public function originalParameters() - { - if (isset($this->originalParameters)) { - return $this->originalParameters; - } - - throw new LogicException('Route is not bound.'); - } - - /** - * Get the key / value list of parameters without null values. - * - * @return array - */ - public function parametersWithoutNulls() - { - return array_filter($this->parameters(), fn ($p) => ! is_null($p)); - } - - /** - * Get all of the parameter names for the route. - * - * @return array - */ - public function parameterNames() - { - if (isset($this->parameterNames)) { - return $this->parameterNames; - } - - return $this->parameterNames = $this->compileParameterNames(); - } - - /** - * Get the parameter names for the route. - * - * @return array - */ - protected function compileParameterNames() - { - preg_match_all('/\{(.*?)\}/', $this->getDomain().$this->uri, $matches); - - return array_map(fn ($m) => trim($m, '?'), $matches[1]); - } - - /** - * Get the parameters that are listed in the route / controller signature. - * - * @param array $conditions - * @return array - */ - public function signatureParameters($conditions = []) - { - if (is_string($conditions)) { - $conditions = ['subClass' => $conditions]; - } - - return RouteSignatureParameters::fromAction($this->action, $conditions); - } - - /** - * Get the binding field for the given parameter. - * - * @param string|int $parameter - * @return string|null - */ - public function bindingFieldFor($parameter) - { - $fields = is_int($parameter) ? array_values($this->bindingFields) : $this->bindingFields; - - return $fields[$parameter] ?? null; - } - - /** - * Get the binding fields for the route. - * - * @return array - */ - public function bindingFields() - { - return $this->bindingFields ?? []; - } - - /** - * Set the binding fields for the route. - * - * @param array $bindingFields - * @return $this - */ - public function setBindingFields(array $bindingFields) - { - $this->bindingFields = $bindingFields; - - return $this; - } - - /** - * Get the parent parameter of the given parameter. - * - * @param string $parameter - * @return string - */ - public function parentOfParameter($parameter) - { - $key = array_search($parameter, array_keys($this->parameters)); - - if ($key === 0) { - return; - } - - return array_values($this->parameters)[$key - 1]; - } - - /** - * Allow "trashed" models to be retrieved when resolving implicit model bindings for this route. - * - * @param bool $withTrashed - * @return $this - */ - public function withTrashed($withTrashed = true) - { - $this->withTrashedBindings = $withTrashed; - - return $this; - } - - /** - * Determines if the route allows "trashed" models to be retrieved when resolving implicit model bindings. - * - * @return bool - */ - public function allowsTrashedBindings() - { - return $this->withTrashedBindings; - } - - /** - * Set a default value for the route. - * - * @param string $key - * @param mixed $value - * @return $this - */ - public function defaults($key, $value) - { - $this->defaults[$key] = $value; - - return $this; - } - - /** - * Set the default values for the route. - * - * @param array $defaults - * @return $this - */ - public function setDefaults(array $defaults) - { - $this->defaults = $defaults; - - return $this; - } - - /** - * Set a regular expression requirement on the route. - * - * @param array|string $name - * @param string|null $expression - * @return $this - */ - public function where($name, $expression = null) - { - foreach ($this->parseWhere($name, $expression) as $name => $expression) { - $this->wheres[$name] = $expression; - } - - return $this; - } - - /** - * Parse arguments to the where method into an array. - * - * @param array|string $name - * @param string $expression - * @return array - */ - protected function parseWhere($name, $expression) - { - return is_array($name) ? $name : [$name => $expression]; - } - - /** - * Set a list of regular expression requirements on the route. - * - * @param array $wheres - * @return $this - */ - public function setWheres(array $wheres) - { - foreach ($wheres as $name => $expression) { - $this->where($name, $expression); - } - - return $this; - } - - /** - * Mark this route as a fallback route. - * - * @return $this - */ - public function fallback() - { - $this->isFallback = true; - - return $this; - } - - /** - * Set the fallback value. - * - * @param bool $isFallback - * @return $this - */ - public function setFallback($isFallback) - { - $this->isFallback = $isFallback; - - return $this; - } - - /** - * Get the HTTP verbs the route responds to. - * - * @return array - */ - public function methods() - { - return $this->methods; - } - - /** - * Determine if the route only responds to HTTP requests. - * - * @return bool - */ - public function httpOnly() - { - return in_array('http', $this->action, true); - } - - /** - * Determine if the route only responds to HTTPS requests. - * - * @return bool - */ - public function httpsOnly() - { - return $this->secure(); - } - - /** - * Determine if the route only responds to HTTPS requests. - * - * @return bool - */ - public function secure() - { - return in_array('https', $this->action, true); - } - - /** - * Get or set the domain for the route. - * - * @param string|null $domain - * @return $this|string|null - */ - public function domain($domain = null) - { - if (is_null($domain)) { - return $this->getDomain(); - } - - $parsed = RouteUri::parse($domain); - - $this->action['domain'] = $parsed->uri; - - $this->bindingFields = array_merge( - $this->bindingFields, $parsed->bindingFields - ); - - return $this; - } - - /** - * Get the domain defined for the route. - * - * @return string|null - */ - public function getDomain() - { - return isset($this->action['domain']) - ? str_replace(['http://', 'https://'], '', $this->action['domain']) : null; - } - - /** - * Get the prefix of the route instance. - * - * @return string|null - */ - public function getPrefix() - { - return $this->action['prefix'] ?? null; - } - - /** - * Add a prefix to the route URI. - * - * @param string $prefix - * @return $this - */ - public function prefix($prefix) - { - $prefix ??= ''; - - $this->updatePrefixOnAction($prefix); - - $uri = rtrim($prefix, '/').'/'.ltrim($this->uri, '/'); - - return $this->setUri($uri !== '/' ? trim($uri, '/') : $uri); - } - - /** - * Update the "prefix" attribute on the action array. - * - * @param string $prefix - * @return void - */ - protected function updatePrefixOnAction($prefix) - { - if (! empty($newPrefix = trim(rtrim($prefix, '/').'/'.ltrim($this->action['prefix'] ?? '', '/'), '/'))) { - $this->action['prefix'] = $newPrefix; - } - } - - /** - * Get the URI associated with the route. - * - * @return string - */ - public function uri() - { - return $this->uri; - } - - /** - * Set the URI that the route responds to. - * - * @param string $uri - * @return $this - */ - public function setUri($uri) - { - $this->uri = $this->parseUri($uri); - - return $this; - } - - /** - * Parse the route URI and normalize / store any implicit binding fields. - * - * @param string $uri - * @return string - */ - protected function parseUri($uri) - { - $this->bindingFields = []; - - return tap(RouteUri::parse($uri), function ($uri) { - $this->bindingFields = $uri->bindingFields; - })->uri; - } - - /** - * Get the name of the route instance. - * - * @return string|null - */ - public function getName() - { - return $this->action['as'] ?? null; - } - - /** - * Add or change the route name. - * - * @param string $name - * @return $this - */ - public function name($name) - { - $this->action['as'] = isset($this->action['as']) ? $this->action['as'].$name : $name; - - return $this; - } - - /** - * Determine whether the route's name matches the given patterns. - * - * @param mixed ...$patterns - * @return bool - */ - public function named(...$patterns) - { - if (is_null($routeName = $this->getName())) { - return false; - } - - foreach ($patterns as $pattern) { - if (Str::is($pattern, $routeName)) { - return true; - } - } - - return false; - } - - /** - * Set the handler for the route. - * - * @param \Closure|array|string $action - * @return $this - */ - public function uses($action) - { - if (is_array($action)) { - $action = $action[0].'@'.$action[1]; - } - - $action = is_string($action) ? $this->addGroupNamespaceToStringUses($action) : $action; - - return $this->setAction(array_merge($this->action, $this->parseAction([ - 'uses' => $action, - 'controller' => $action, - ]))); - } - - /** - * Parse a string based action for the "uses" fluent method. - * - * @param string $action - * @return string - */ - protected function addGroupNamespaceToStringUses($action) - { - $groupStack = last($this->router->getGroupStack()); - - if (isset($groupStack['namespace']) && ! str_starts_with($action, '\\')) { - return $groupStack['namespace'].'\\'.$action; - } - - return $action; - } - - /** - * Get the action name for the route. - * - * @return string - */ - public function getActionName() - { - return $this->action['controller'] ?? 'Closure'; - } - - /** - * Get the method name of the route action. - * - * @return string - */ - public function getActionMethod() - { - return Arr::last(explode('@', $this->getActionName())); - } - - /** - * Get the action array or one of its properties for the route. - * - * @param string|null $key - * @return mixed - */ - public function getAction($key = null) - { - return Arr::get($this->action, $key); - } - - /** - * Set the action array for the route. - * - * @param array $action - * @return $this - */ - public function setAction(array $action) - { - $this->action = $action; - - if (isset($this->action['domain'])) { - $this->domain($this->action['domain']); - } - - return $this; - } - - /** - * Get the value of the action that should be taken on a missing model exception. - * - * @return \Closure|null - */ - public function getMissing() - { - $missing = $this->action['missing'] ?? null; - - return is_string($missing) && - Str::startsWith($missing, [ - 'O:47:"Laravel\\SerializableClosure\\SerializableClosure', - ]) ? unserialize($missing) : $missing; - } - - /** - * Define the callable that should be invoked on a missing model exception. - * - * @param \Closure $missing - * @return $this - */ - public function missing($missing) - { - $this->action['missing'] = $missing; - - return $this; - } - - /** - * Get all middleware, including the ones from the controller. - * - * @return array - */ - public function gatherMiddleware() - { - if (! is_null($this->computedMiddleware)) { - return $this->computedMiddleware; - } - - $this->computedMiddleware = []; - - return $this->computedMiddleware = Router::uniqueMiddleware(array_merge( - $this->middleware(), $this->controllerMiddleware() - )); - } - - /** - * Get or set the middlewares attached to the route. - * - * @param array|string|null $middleware - * @return $this|array - */ - public function middleware($middleware = null) - { - if (is_null($middleware)) { - return (array) ($this->action['middleware'] ?? []); - } - - if (! is_array($middleware)) { - $middleware = func_get_args(); - } - - foreach ($middleware as $index => $value) { - $middleware[$index] = (string) $value; - } - - $this->action['middleware'] = array_merge( - (array) ($this->action['middleware'] ?? []), $middleware - ); - - return $this; - } - - /** - * Specify that the "Authorize" / "can" middleware should be applied to the route with the given options. - * - * @param string $ability - * @param array|string $models - * @return $this - */ - public function can($ability, $models = []) - { - return empty($models) - ? $this->middleware(['can:'.$ability]) - : $this->middleware(['can:'.$ability.','.implode(',', Arr::wrap($models))]); - } - - /** - * Get the middleware for the route's controller. - * - * @return array - */ - public function controllerMiddleware() - { - if (! $this->isControllerAction()) { - return []; - } - - [$controllerClass, $controllerMethod] = [ - $this->getControllerClass(), - $this->getControllerMethod(), - ]; - - if (is_a($controllerClass, HasMiddleware::class, true)) { - return $this->staticallyProvidedControllerMiddleware( - $controllerClass, $controllerMethod - ); - } - - if (method_exists($controllerClass, 'getMiddleware')) { - return $this->controllerDispatcher()->getMiddleware( - $this->getController(), $controllerMethod - ); - } - - return []; - } - - /** - * Get the statically provided controller middleware for the given class and method. - * - * @param string $class - * @param string $method - * @return array - */ - protected function staticallyProvidedControllerMiddleware(string $class, string $method) - { - return collect($class::middleware())->reject(function ($middleware) use ($method) { - return $this->controllerDispatcher()::methodExcludedByOptions( - $method, ['only' => $middleware->only, 'except' => $middleware->except] - ); - })->map->middleware->values()->all(); - } - - /** - * Specify middleware that should be removed from the given route. - * - * @param array|string $middleware - * @return $this - */ - public function withoutMiddleware($middleware) - { - $this->action['excluded_middleware'] = array_merge( - (array) ($this->action['excluded_middleware'] ?? []), Arr::wrap($middleware) - ); - - return $this; - } - - /** - * Get the middleware should be removed from the route. - * - * @return array - */ - public function excludedMiddleware() - { - return (array) ($this->action['excluded_middleware'] ?? []); - } - - /** - * Indicate that the route should enforce scoping of multiple implicit Eloquent bindings. - * - * @return $this - */ - public function scopeBindings() - { - $this->action['scope_bindings'] = true; - - return $this; - } - - /** - * Indicate that the route should not enforce scoping of multiple implicit Eloquent bindings. - * - * @return $this - */ - public function withoutScopedBindings() - { - $this->action['scope_bindings'] = false; - - return $this; - } - - /** - * Determine if the route should enforce scoping of multiple implicit Eloquent bindings. - * - * @return bool - */ - public function enforcesScopedBindings() - { - return (bool) ($this->action['scope_bindings'] ?? false); - } - - /** - * Determine if the route should prevent scoping of multiple implicit Eloquent bindings. - * - * @return bool - */ - public function preventsScopedBindings() - { - return isset($this->action['scope_bindings']) && $this->action['scope_bindings'] === false; - } - - /** - * Specify that the route should not allow concurrent requests from the same session. - * - * @param int|null $lockSeconds - * @param int|null $waitSeconds - * @return $this - */ - public function block($lockSeconds = 10, $waitSeconds = 10) - { - $this->lockSeconds = $lockSeconds; - $this->waitSeconds = $waitSeconds; - - return $this; - } - - /** - * Specify that the route should allow concurrent requests from the same session. - * - * @return $this - */ - public function withoutBlocking() - { - return $this->block(null, null); - } - - /** - * Get the maximum number of seconds the route's session lock should be held for. - * - * @return int|null - */ - public function locksFor() - { - return $this->lockSeconds; - } - - /** - * Get the maximum number of seconds to wait while attempting to acquire a session lock. - * - * @return int|null - */ - public function waitsFor() - { - return $this->waitSeconds; - } - - /** - * Get the dispatcher for the route's controller. - * - * @return \Illuminate\Routing\Contracts\ControllerDispatcher - */ - public function controllerDispatcher() - { - if ($this->container->bound(ControllerDispatcherContract::class)) { - return $this->container->make(ControllerDispatcherContract::class); - } - - return new ControllerDispatcher($this->container); - } - - /** - * Get the route validators for the instance. - * - * @return array - */ - public static function getValidators() - { - if (isset(static::$validators)) { - return static::$validators; - } - - // To match the route, we will use a chain of responsibility pattern with the - // validator implementations. We will spin through each one making sure it - // passes and then we will know if the route as a whole matches request. - return static::$validators = [ - new UriValidator, new MethodValidator, - new SchemeValidator, new HostValidator, - ]; - } - - /** - * Convert the route to a Symfony route. - * - * @return \Symfony\Component\Routing\Route - */ - public function toSymfonyRoute() - { - return new SymfonyRoute( - preg_replace('/\{(\w+?)\?\}/', '{$1}', $this->uri()), $this->getOptionalParameterNames(), - $this->wheres, ['utf8' => true], - $this->getDomain() ?: '', [], $this->methods - ); - } - - /** - * Get the optional parameter names for the route. - * - * @return array - */ - protected function getOptionalParameterNames() - { - preg_match_all('/\{(\w+?)\?\}/', $this->uri(), $matches); - - return isset($matches[1]) ? array_fill_keys($matches[1], null) : []; - } - - /** - * Get the compiled version of the route. - * - * @return \Symfony\Component\Routing\CompiledRoute - */ - public function getCompiled() - { - return $this->compiled; - } - - /** - * Set the router instance on the route. - * - * @param \Illuminate\Routing\Router $router - * @return $this - */ - public function setRouter(Router $router) - { - $this->router = $router; - - return $this; - } - - /** - * Set the container instance on the route. - * - * @param \Illuminate\Container\Container $container - * @return $this - */ - public function setContainer(Container $container) - { - $this->container = $container; - - return $this; - } - - /** - * Prepare the route instance for serialization. - * - * @return void - * - * @throws \LogicException - */ - public function prepareForSerialization() - { - if ($this->action['uses'] instanceof Closure) { - $this->action['uses'] = serialize( - new SerializableClosure($this->action['uses']) - ); - } - - if (isset($this->action['missing']) && $this->action['missing'] instanceof Closure) { - $this->action['missing'] = serialize( - new SerializableClosure($this->action['missing']) - ); - } - - $this->compileRoute(); - - unset($this->router, $this->container); - } - - /** - * Dynamically access route parameters. - * - * @param string $key - * @return mixed - */ - public function __get($key) - { - return $this->parameter($key); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/RouteAction.php b/vendor/laravel/framework/src/Illuminate/Routing/RouteAction.php deleted file mode 100644 index ad47a872..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/RouteAction.php +++ /dev/null @@ -1,110 +0,0 @@ - $action] : [ - 'uses' => $action[0].'@'.$action[1], - 'controller' => $action[0].'@'.$action[1], - ]; - } - - // If no "uses" property has been set, we will dig through the array to find a - // Closure instance within this list. We will set the first Closure we come - // across into the "uses" property that will get fired off by this route. - elseif (! isset($action['uses'])) { - $action['uses'] = static::findCallable($action); - } - - if (! static::containsSerializedClosure($action) && is_string($action['uses']) && ! str_contains($action['uses'], '@')) { - $action['uses'] = static::makeInvokable($action['uses']); - } - - return $action; - } - - /** - * Get an action for a route that has no action. - * - * @param string $uri - * @return array - * - * @throws \LogicException - */ - protected static function missingAction($uri) - { - return ['uses' => function () use ($uri) { - throw new LogicException("Route for [{$uri}] has no action."); - }]; - } - - /** - * Find the callable in an action array. - * - * @param array $action - * @return callable - */ - protected static function findCallable(array $action) - { - return Arr::first($action, function ($value, $key) { - return Reflector::isCallable($value) && is_numeric($key); - }); - } - - /** - * Make an action for an invokable controller. - * - * @param string $action - * @return string - * - * @throws \UnexpectedValueException - */ - protected static function makeInvokable($action) - { - if (! method_exists($action, '__invoke')) { - throw new UnexpectedValueException("Invalid route action: [{$action}]."); - } - - return $action.'@__invoke'; - } - - /** - * Determine if the given array actions contain a serialized Closure. - * - * @param array $action - * @return bool - */ - public static function containsSerializedClosure(array $action) - { - return is_string($action['uses']) && Str::startsWith($action['uses'], [ - 'O:47:"Laravel\\SerializableClosure\\SerializableClosure', - ]) !== false; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/RouteBinding.php b/vendor/laravel/framework/src/Illuminate/Routing/RouteBinding.php deleted file mode 100644 index 36fdc4f2..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/RouteBinding.php +++ /dev/null @@ -1,84 +0,0 @@ -make($class), $method]; - - return $callable($value, $route); - }; - } - - /** - * Create a Route model binding for a model. - * - * @param \Illuminate\Container\Container $container - * @param string $class - * @param \Closure|null $callback - * @return \Closure - * - * @throws \Illuminate\Database\Eloquent\ModelNotFoundException<\Illuminate\Database\Eloquent\Model> - */ - public static function forModel($container, $class, $callback = null) - { - return function ($value) use ($container, $class, $callback) { - if (is_null($value)) { - return; - } - - // For model binders, we will attempt to retrieve the models using the first - // method on the model instance. If we cannot retrieve the models we'll - // throw a not found exception otherwise we will return the instance. - $instance = $container->make($class); - - if ($model = $instance->resolveRouteBinding($value)) { - return $model; - } - - // If a callback was supplied to the method we will call that to determine - // what we should do when the model is not found. This just gives these - // developer a little greater flexibility to decide what will happen. - if ($callback instanceof Closure) { - return $callback($value); - } - - throw (new ModelNotFoundException)->setModel($class); - }; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/RouteCollection.php b/vendor/laravel/framework/src/Illuminate/Routing/RouteCollection.php deleted file mode 100644 index 7e6f98bc..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/RouteCollection.php +++ /dev/null @@ -1,268 +0,0 @@ -addToCollections($route); - - $this->addLookups($route); - - return $route; - } - - /** - * Add the given route to the arrays of routes. - * - * @param \Illuminate\Routing\Route $route - * @return void - */ - protected function addToCollections($route) - { - $domainAndUri = $route->getDomain().$route->uri(); - - foreach ($route->methods() as $method) { - $this->routes[$method][$domainAndUri] = $route; - } - - $this->allRoutes[$method.$domainAndUri] = $route; - } - - /** - * Add the route to any look-up tables if necessary. - * - * @param \Illuminate\Routing\Route $route - * @return void - */ - protected function addLookups($route) - { - // If the route has a name, we will add it to the name look-up table so that we - // will quickly be able to find any route associate with a name and not have - // to iterate through every route every time we need to perform a look-up. - if ($name = $route->getName()) { - $this->nameList[$name] = $route; - } - - // When the route is routing to a controller we will also store the action that - // is used by the route. This will let us reverse route to controllers while - // processing a request and easily generate URLs to the given controllers. - $action = $route->getAction(); - - if (isset($action['controller'])) { - $this->addToActionList($action, $route); - } - } - - /** - * Add a route to the controller action dictionary. - * - * @param array $action - * @param \Illuminate\Routing\Route $route - * @return void - */ - protected function addToActionList($action, $route) - { - $this->actionList[trim($action['controller'], '\\')] = $route; - } - - /** - * Refresh the name look-up table. - * - * This is done in case any names are fluently defined or if routes are overwritten. - * - * @return void - */ - public function refreshNameLookups() - { - $this->nameList = []; - - foreach ($this->allRoutes as $route) { - if ($route->getName()) { - $this->nameList[$route->getName()] = $route; - } - } - } - - /** - * Refresh the action look-up table. - * - * This is done in case any actions are overwritten with new controllers. - * - * @return void - */ - public function refreshActionLookups() - { - $this->actionList = []; - - foreach ($this->allRoutes as $route) { - if (isset($route->getAction()['controller'])) { - $this->addToActionList($route->getAction(), $route); - } - } - } - - /** - * Find the first route matching a given request. - * - * @param \Illuminate\Http\Request $request - * @return \Illuminate\Routing\Route - * - * @throws \Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException - * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException - */ - public function match(Request $request) - { - $routes = $this->get($request->getMethod()); - - // First, we will see if we can find a matching route for this current request - // method. If we can, great, we can just return it so that it can be called - // by the consumer. Otherwise we will check for routes with another verb. - $route = $this->matchAgainstRoutes($routes, $request); - - return $this->handleMatchedRoute($request, $route); - } - - /** - * Get routes from the collection by method. - * - * @param string|null $method - * @return \Illuminate\Routing\Route[] - */ - public function get($method = null) - { - return is_null($method) ? $this->getRoutes() : Arr::get($this->routes, $method, []); - } - - /** - * Determine if the route collection contains a given named route. - * - * @param string $name - * @return bool - */ - public function hasNamedRoute($name) - { - return ! is_null($this->getByName($name)); - } - - /** - * Get a route instance by its name. - * - * @param string $name - * @return \Illuminate\Routing\Route|null - */ - public function getByName($name) - { - return $this->nameList[$name] ?? null; - } - - /** - * Get a route instance by its controller action. - * - * @param string $action - * @return \Illuminate\Routing\Route|null - */ - public function getByAction($action) - { - return $this->actionList[$action] ?? null; - } - - /** - * Get all of the routes in the collection. - * - * @return \Illuminate\Routing\Route[] - */ - public function getRoutes() - { - return array_values($this->allRoutes); - } - - /** - * Get all of the routes keyed by their HTTP verb / method. - * - * @return array - */ - public function getRoutesByMethod() - { - return $this->routes; - } - - /** - * Get all of the routes keyed by their name. - * - * @return \Illuminate\Routing\Route[] - */ - public function getRoutesByName() - { - return $this->nameList; - } - - /** - * Convert the collection to a Symfony RouteCollection instance. - * - * @return \Symfony\Component\Routing\RouteCollection - */ - public function toSymfonyRouteCollection() - { - $symfonyRoutes = parent::toSymfonyRouteCollection(); - - $this->refreshNameLookups(); - - return $symfonyRoutes; - } - - /** - * Convert the collection to a CompiledRouteCollection instance. - * - * @param \Illuminate\Routing\Router $router - * @param \Illuminate\Container\Container $container - * @return \Illuminate\Routing\CompiledRouteCollection - */ - public function toCompiledRouteCollection(Router $router, Container $container) - { - ['compiled' => $compiled, 'attributes' => $attributes] = $this->compile(); - - return (new CompiledRouteCollection($compiled, $attributes)) - ->setRouter($router) - ->setContainer($container); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/RouteCollectionInterface.php b/vendor/laravel/framework/src/Illuminate/Routing/RouteCollectionInterface.php deleted file mode 100644 index 8e25d0fa..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/RouteCollectionInterface.php +++ /dev/null @@ -1,98 +0,0 @@ -resolveMethodDependencies( - $parameters, new ReflectionMethod($instance, $method) - ); - } - - /** - * Resolve the given method's type-hinted dependencies. - * - * @param array $parameters - * @param \ReflectionFunctionAbstract $reflector - * @return array - */ - public function resolveMethodDependencies(array $parameters, ReflectionFunctionAbstract $reflector) - { - $instanceCount = 0; - - $values = array_values($parameters); - - $skippableValue = new stdClass; - - foreach ($reflector->getParameters() as $key => $parameter) { - $instance = $this->transformDependency($parameter, $parameters, $skippableValue); - - if ($instance !== $skippableValue) { - $instanceCount++; - - $this->spliceIntoParameters($parameters, $key, $instance); - } elseif (! isset($values[$key - $instanceCount]) && - $parameter->isDefaultValueAvailable()) { - $this->spliceIntoParameters($parameters, $key, $parameter->getDefaultValue()); - } - } - - return $parameters; - } - - /** - * Attempt to transform the given parameter into a class instance. - * - * @param \ReflectionParameter $parameter - * @param array $parameters - * @param object $skippableValue - * @return mixed - */ - protected function transformDependency(ReflectionParameter $parameter, $parameters, $skippableValue) - { - $className = Reflector::getParameterClassName($parameter); - - // If the parameter has a type-hinted class, we will check to see if it is already in - // the list of parameters. If it is we will just skip it as it is probably a model - // binding and we do not want to mess with those; otherwise, we resolve it here. - if ($className && ! $this->alreadyInParameters($className, $parameters)) { - $isEnum = method_exists(ReflectionClass::class, 'isEnum') && (new ReflectionClass($className))->isEnum(); - - return $parameter->isDefaultValueAvailable() - ? ($isEnum ? $parameter->getDefaultValue() : null) - : $this->container->make($className); - } - - return $skippableValue; - } - - /** - * Determine if an object of the given class is in a list of parameters. - * - * @param string $class - * @param array $parameters - * @return bool - */ - protected function alreadyInParameters($class, array $parameters) - { - return ! is_null(Arr::first($parameters, fn ($value) => $value instanceof $class)); - } - - /** - * Splice the given value into the parameter list. - * - * @param array $parameters - * @param string $offset - * @param mixed $value - * @return void - */ - protected function spliceIntoParameters(array &$parameters, $offset, $value) - { - array_splice( - $parameters, $offset, 0, [$value] - ); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/RouteFileRegistrar.php b/vendor/laravel/framework/src/Illuminate/Routing/RouteFileRegistrar.php deleted file mode 100644 index 7670b10e..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/RouteFileRegistrar.php +++ /dev/null @@ -1,37 +0,0 @@ -router = $router; - } - - /** - * Require the given routes file. - * - * @param string $routes - * @return void - */ - public function register($routes) - { - $router = $this->router; - - require $routes; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/RouteGroup.php b/vendor/laravel/framework/src/Illuminate/Routing/RouteGroup.php deleted file mode 100644 index 28e05d55..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/RouteGroup.php +++ /dev/null @@ -1,105 +0,0 @@ - static::formatNamespace($new, $old), - 'prefix' => static::formatPrefix($new, $old, $prependExistingPrefix), - 'where' => static::formatWhere($new, $old), - ]); - - return array_merge_recursive(Arr::except( - $old, ['namespace', 'prefix', 'where', 'as'] - ), $new); - } - - /** - * Format the namespace for the new group attributes. - * - * @param array $new - * @param array $old - * @return string|null - */ - protected static function formatNamespace($new, $old) - { - if (isset($new['namespace'])) { - return isset($old['namespace']) && ! str_starts_with($new['namespace'], '\\') - ? trim($old['namespace'], '\\').'\\'.trim($new['namespace'], '\\') - : trim($new['namespace'], '\\'); - } - - return $old['namespace'] ?? null; - } - - /** - * Format the prefix for the new group attributes. - * - * @param array $new - * @param array $old - * @param bool $prependExistingPrefix - * @return string|null - */ - protected static function formatPrefix($new, $old, $prependExistingPrefix = true) - { - $old = $old['prefix'] ?? ''; - - if ($prependExistingPrefix) { - return isset($new['prefix']) ? trim($old, '/').'/'.trim($new['prefix'], '/') : $old; - } else { - return isset($new['prefix']) ? trim($new['prefix'], '/').'/'.trim($old, '/') : $old; - } - } - - /** - * Format the "wheres" for the new group attributes. - * - * @param array $new - * @param array $old - * @return array - */ - protected static function formatWhere($new, $old) - { - return array_merge( - $old['where'] ?? [], - $new['where'] ?? [] - ); - } - - /** - * Format the "as" clause of the new group attributes. - * - * @param array $new - * @param array $old - * @return array - */ - protected static function formatAs($new, $old) - { - if (isset($old['as'])) { - $new['as'] = $old['as'].($new['as'] ?? ''); - } - - return $new; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/RouteParameterBinder.php b/vendor/laravel/framework/src/Illuminate/Routing/RouteParameterBinder.php deleted file mode 100644 index 8c3968e0..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/RouteParameterBinder.php +++ /dev/null @@ -1,117 +0,0 @@ -route = $route; - } - - /** - * Get the parameters for the route. - * - * @param \Illuminate\Http\Request $request - * @return array - */ - public function parameters($request) - { - $parameters = $this->bindPathParameters($request); - - // If the route has a regular expression for the host part of the URI, we will - // compile that and get the parameter matches for this domain. We will then - // merge them into this parameters array so that this array is completed. - if (! is_null($this->route->compiled->getHostRegex())) { - $parameters = $this->bindHostParameters( - $request, $parameters - ); - } - - return $this->replaceDefaults($parameters); - } - - /** - * Get the parameter matches for the path portion of the URI. - * - * @param \Illuminate\Http\Request $request - * @return array - */ - protected function bindPathParameters($request) - { - $path = '/'.ltrim($request->decodedPath(), '/'); - - preg_match($this->route->compiled->getRegex(), $path, $matches); - - return $this->matchToKeys(array_slice($matches, 1)); - } - - /** - * Extract the parameter list from the host part of the request. - * - * @param \Illuminate\Http\Request $request - * @param array $parameters - * @return array - */ - protected function bindHostParameters($request, $parameters) - { - preg_match($this->route->compiled->getHostRegex(), $request->getHost(), $matches); - - return array_merge($this->matchToKeys(array_slice($matches, 1)), $parameters); - } - - /** - * Combine a set of parameter matches with the route's keys. - * - * @param array $matches - * @return array - */ - protected function matchToKeys(array $matches) - { - if (empty($parameterNames = $this->route->parameterNames())) { - return []; - } - - $parameters = array_intersect_key($matches, array_flip($parameterNames)); - - return array_filter($parameters, function ($value) { - return is_string($value) && strlen($value) > 0; - }); - } - - /** - * Replace null parameters with their defaults. - * - * @param array $parameters - * @return array - */ - protected function replaceDefaults(array $parameters) - { - foreach ($parameters as $key => $value) { - $parameters[$key] = $value ?? Arr::get($this->route->defaults, $key); - } - - foreach ($this->route->defaults as $key => $value) { - if (! isset($parameters[$key])) { - $parameters[$key] = $value; - } - } - - return $parameters; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/RouteRegistrar.php b/vendor/laravel/framework/src/Illuminate/Routing/RouteRegistrar.php deleted file mode 100644 index c6b27110..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/RouteRegistrar.php +++ /dev/null @@ -1,285 +0,0 @@ - 'as', - 'scopeBindings' => 'scope_bindings', - 'withoutMiddleware' => 'excluded_middleware', - ]; - - /** - * Create a new route registrar instance. - * - * @param \Illuminate\Routing\Router $router - * @return void - */ - public function __construct(Router $router) - { - $this->router = $router; - } - - /** - * Set the value for a given attribute. - * - * @param string $key - * @param mixed $value - * @return $this - * - * @throws \InvalidArgumentException - */ - public function attribute($key, $value) - { - if (! in_array($key, $this->allowedAttributes)) { - throw new InvalidArgumentException("Attribute [{$key}] does not exist."); - } - - if ($key === 'middleware') { - foreach ($value as $index => $middleware) { - $value[$index] = (string) $middleware; - } - } - - $attributeKey = Arr::get($this->aliases, $key, $key); - - if ($key === 'withoutMiddleware') { - $value = array_merge( - (array) ($this->attributes[$attributeKey] ?? []), Arr::wrap($value) - ); - } - - $this->attributes[$attributeKey] = $value; - - return $this; - } - - /** - * Route a resource to a controller. - * - * @param string $name - * @param string $controller - * @param array $options - * @return \Illuminate\Routing\PendingResourceRegistration - */ - public function resource($name, $controller, array $options = []) - { - return $this->router->resource($name, $controller, $this->attributes + $options); - } - - /** - * Route an API resource to a controller. - * - * @param string $name - * @param string $controller - * @param array $options - * @return \Illuminate\Routing\PendingResourceRegistration - */ - public function apiResource($name, $controller, array $options = []) - { - return $this->router->apiResource($name, $controller, $this->attributes + $options); - } - - /** - * Route a singleton resource to a controller. - * - * @param string $name - * @param string $controller - * @param array $options - * @return \Illuminate\Routing\PendingSingletonResourceRegistration - */ - public function singleton($name, $controller, array $options = []) - { - return $this->router->singleton($name, $controller, $this->attributes + $options); - } - - /** - * Route an API singleton resource to a controller. - * - * @param string $name - * @param string $controller - * @param array $options - * @return \Illuminate\Routing\PendingSingletonResourceRegistration - */ - public function apiSingleton($name, $controller, array $options = []) - { - return $this->router->apiSingleton($name, $controller, $this->attributes + $options); - } - - /** - * Create a route group with shared attributes. - * - * @param \Closure|string $callback - * @return $this - */ - public function group($callback) - { - $this->router->group($this->attributes, $callback); - - return $this; - } - - /** - * Register a new route with the given verbs. - * - * @param array|string $methods - * @param string $uri - * @param \Closure|array|string|null $action - * @return \Illuminate\Routing\Route - */ - public function match($methods, $uri, $action = null) - { - return $this->router->match($methods, $uri, $this->compileAction($action)); - } - - /** - * Register a new route with the router. - * - * @param string $method - * @param string $uri - * @param \Closure|array|string|null $action - * @return \Illuminate\Routing\Route - */ - protected function registerRoute($method, $uri, $action = null) - { - if (! is_array($action)) { - $action = array_merge($this->attributes, $action ? ['uses' => $action] : []); - } - - return $this->router->{$method}($uri, $this->compileAction($action)); - } - - /** - * Compile the action into an array including the attributes. - * - * @param \Closure|array|string|null $action - * @return array - */ - protected function compileAction($action) - { - if (is_null($action)) { - return $this->attributes; - } - - if (is_string($action) || $action instanceof Closure) { - $action = ['uses' => $action]; - } - - if (is_array($action) && - ! Arr::isAssoc($action) && - Reflector::isCallable($action)) { - if (strncmp($action[0], '\\', 1)) { - $action[0] = '\\'.$action[0]; - } - $action = [ - 'uses' => $action[0].'@'.$action[1], - 'controller' => $action[0].'@'.$action[1], - ]; - } - - return array_merge($this->attributes, $action); - } - - /** - * Dynamically handle calls into the route registrar. - * - * @param string $method - * @param array $parameters - * @return \Illuminate\Routing\Route|$this - * - * @throws \BadMethodCallException - */ - public function __call($method, $parameters) - { - if (in_array($method, $this->passthru)) { - return $this->registerRoute($method, ...$parameters); - } - - if (in_array($method, $this->allowedAttributes)) { - if ($method === 'middleware') { - return $this->attribute($method, is_array($parameters[0]) ? $parameters[0] : $parameters); - } - - return $this->attribute($method, array_key_exists(0, $parameters) ? $parameters[0] : true); - } - - throw new BadMethodCallException(sprintf( - 'Method %s::%s does not exist.', static::class, $method - )); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/RouteSignatureParameters.php b/vendor/laravel/framework/src/Illuminate/Routing/RouteSignatureParameters.php deleted file mode 100644 index 7a4b6dad..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/RouteSignatureParameters.php +++ /dev/null @@ -1,52 +0,0 @@ -getClosure() - : $action['uses']; - - $parameters = is_string($callback) - ? static::fromClassMethodString($callback) - : (new ReflectionFunction($callback))->getParameters(); - - return match (true) { - ! empty($conditions['subClass']) => array_filter($parameters, fn ($p) => Reflector::isParameterSubclassOf($p, $conditions['subClass'])), - ! empty($conditions['backedEnum']) => array_filter($parameters, fn ($p) => Reflector::isParameterBackedEnumWithStringBackingType($p)), - default => $parameters, - }; - } - - /** - * Get the parameters for the given class / method by string. - * - * @param string $uses - * @return array - */ - protected static function fromClassMethodString($uses) - { - [$class, $method] = Str::parseCallback($uses); - - if (! method_exists($class, $method) && Reflector::isCallable($class, $method)) { - return []; - } - - return (new ReflectionMethod($class, $method))->getParameters(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/RouteUri.php b/vendor/laravel/framework/src/Illuminate/Routing/RouteUri.php deleted file mode 100644 index 32371774..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/RouteUri.php +++ /dev/null @@ -1,62 +0,0 @@ -uri = $uri; - $this->bindingFields = $bindingFields; - } - - /** - * Parse the given URI. - * - * @param string $uri - * @return static - */ - public static function parse($uri) - { - preg_match_all('/\{([\w\:]+?)\??\}/', $uri, $matches); - - $bindingFields = []; - - foreach ($matches[0] as $match) { - if (! str_contains($match, ':')) { - continue; - } - - $segments = explode(':', trim($match, '{}?')); - - $bindingFields[$segments[0]] = $segments[1]; - - $uri = str_contains($match, '?') - ? str_replace($match, '{'.$segments[0].'?}', $uri) - : str_replace($match, '{'.$segments[0].'}', $uri); - } - - return new static($uri, $bindingFields); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/RouteUrlGenerator.php b/vendor/laravel/framework/src/Illuminate/Routing/RouteUrlGenerator.php deleted file mode 100644 index a0e5cf64..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/RouteUrlGenerator.php +++ /dev/null @@ -1,320 +0,0 @@ - '/', - '%40' => '@', - '%3A' => ':', - '%3B' => ';', - '%2C' => ',', - '%3D' => '=', - '%2B' => '+', - '%21' => '!', - '%2A' => '*', - '%7C' => '|', - '%3F' => '?', - '%26' => '&', - '%23' => '#', - '%25' => '%', - ]; - - /** - * Create a new Route URL generator. - * - * @param \Illuminate\Routing\UrlGenerator $url - * @param \Illuminate\Http\Request $request - * @return void - */ - public function __construct($url, $request) - { - $this->url = $url; - $this->request = $request; - } - - /** - * Generate a URL for the given route. - * - * @param \Illuminate\Routing\Route $route - * @param array $parameters - * @param bool $absolute - * @return string - * - * @throws \Illuminate\Routing\Exceptions\UrlGenerationException - */ - public function to($route, $parameters = [], $absolute = false) - { - $domain = $this->getRouteDomain($route, $parameters); - - // First we will construct the entire URI including the root and query string. Once it - // has been constructed, we'll make sure we don't have any missing parameters or we - // will need to throw the exception to let the developers know one was not given. - $uri = $this->addQueryString($this->url->format( - $root = $this->replaceRootParameters($route, $domain, $parameters), - $this->replaceRouteParameters($route->uri(), $parameters), - $route - ), $parameters); - - if (preg_match_all('/{(.*?)}/', $uri, $matchedMissingParameters)) { - throw UrlGenerationException::forMissingParameters($route, $matchedMissingParameters[1]); - } - - // Once we have ensured that there are no missing parameters in the URI we will encode - // the URI and prepare it for returning to the developer. If the URI is supposed to - // be absolute, we will return it as-is. Otherwise we will remove the URL's root. - $uri = strtr(rawurlencode($uri), $this->dontEncode); - - if (! $absolute) { - $uri = preg_replace('#^(//|[^/?])+#', '', $uri); - - if ($base = $this->request->getBaseUrl()) { - $uri = preg_replace('#^'.$base.'#i', '', $uri); - } - - return '/'.ltrim($uri, '/'); - } - - return $uri; - } - - /** - * Get the formatted domain for a given route. - * - * @param \Illuminate\Routing\Route $route - * @param array $parameters - * @return string - */ - protected function getRouteDomain($route, &$parameters) - { - return $route->getDomain() ? $this->formatDomain($route, $parameters) : null; - } - - /** - * Format the domain and port for the route and request. - * - * @param \Illuminate\Routing\Route $route - * @param array $parameters - * @return string - */ - protected function formatDomain($route, &$parameters) - { - return $this->addPortToDomain( - $this->getRouteScheme($route).$route->getDomain() - ); - } - - /** - * Get the scheme for the given route. - * - * @param \Illuminate\Routing\Route $route - * @return string - */ - protected function getRouteScheme($route) - { - if ($route->httpOnly()) { - return 'http://'; - } elseif ($route->httpsOnly()) { - return 'https://'; - } - - return $this->url->formatScheme(); - } - - /** - * Add the port to the domain if necessary. - * - * @param string $domain - * @return string - */ - protected function addPortToDomain($domain) - { - $secure = $this->request->isSecure(); - - $port = (int) $this->request->getPort(); - - return ($secure && $port === 443) || (! $secure && $port === 80) - ? $domain : $domain.':'.$port; - } - - /** - * Replace the parameters on the root path. - * - * @param \Illuminate\Routing\Route $route - * @param string $domain - * @param array $parameters - * @return string - */ - protected function replaceRootParameters($route, $domain, &$parameters) - { - $scheme = $this->getRouteScheme($route); - - return $this->replaceRouteParameters( - $this->url->formatRoot($scheme, $domain), $parameters - ); - } - - /** - * Replace all of the wildcard parameters for a route path. - * - * @param string $path - * @param array $parameters - * @return string - */ - protected function replaceRouteParameters($path, array &$parameters) - { - $path = $this->replaceNamedParameters($path, $parameters); - - $path = preg_replace_callback('/\{.*?\}/', function ($match) use (&$parameters) { - // Reset only the numeric keys... - $parameters = array_merge($parameters); - - return (! isset($parameters[0]) && ! str_ends_with($match[0], '?}')) - ? $match[0] - : Arr::pull($parameters, 0); - }, $path); - - return trim(preg_replace('/\{.*?\?\}/', '', $path), '/'); - } - - /** - * Replace all of the named parameters in the path. - * - * @param string $path - * @param array $parameters - * @return string - */ - protected function replaceNamedParameters($path, &$parameters) - { - return preg_replace_callback('/\{(.*?)(\?)?\}/', function ($m) use (&$parameters) { - if (isset($parameters[$m[1]]) && $parameters[$m[1]] !== '') { - return Arr::pull($parameters, $m[1]); - } elseif (isset($this->defaultParameters[$m[1]])) { - return $this->defaultParameters[$m[1]]; - } elseif (isset($parameters[$m[1]])) { - Arr::pull($parameters, $m[1]); - } - - return $m[0]; - }, $path); - } - - /** - * Add a query string to the URI. - * - * @param string $uri - * @param array $parameters - * @return mixed|string - */ - protected function addQueryString($uri, array $parameters) - { - // If the URI has a fragment we will move it to the end of this URI since it will - // need to come after any query string that may be added to the URL else it is - // not going to be available. We will remove it then append it back on here. - if (! is_null($fragment = parse_url($uri, PHP_URL_FRAGMENT))) { - $uri = preg_replace('/#.*/', '', $uri); - } - - $uri .= $this->getRouteQueryString($parameters); - - return is_null($fragment) ? $uri : $uri."#{$fragment}"; - } - - /** - * Get the query string for a given route. - * - * @param array $parameters - * @return string - */ - protected function getRouteQueryString(array $parameters) - { - // First we will get all of the string parameters that are remaining after we - // have replaced the route wildcards. We'll then build a query string from - // these string parameters then use it as a starting point for the rest. - if (count($parameters) === 0) { - return ''; - } - - $query = Arr::query( - $keyed = $this->getStringParameters($parameters) - ); - - // Lastly, if there are still parameters remaining, we will fetch the numeric - // parameters that are in the array and add them to the query string or we - // will make the initial query string if it wasn't started with strings. - if (count($keyed) < count($parameters)) { - $query .= '&'.implode( - '&', $this->getNumericParameters($parameters) - ); - } - - $query = trim($query, '&'); - - return $query === '' ? '' : "?{$query}"; - } - - /** - * Get the string parameters from a given list. - * - * @param array $parameters - * @return array - */ - protected function getStringParameters(array $parameters) - { - return array_filter($parameters, 'is_string', ARRAY_FILTER_USE_KEY); - } - - /** - * Get the numeric parameters from a given list. - * - * @param array $parameters - * @return array - */ - protected function getNumericParameters(array $parameters) - { - return array_filter($parameters, 'is_numeric', ARRAY_FILTER_USE_KEY); - } - - /** - * Set the default named parameters used by the URL generator. - * - * @param array $defaults - * @return void - */ - public function defaults(array $defaults) - { - $this->defaultParameters = array_merge( - $this->defaultParameters, $defaults - ); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/Router.php b/vendor/laravel/framework/src/Illuminate/Routing/Router.php deleted file mode 100644 index e2fb7420..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/Router.php +++ /dev/null @@ -1,1475 +0,0 @@ -events = $events; - $this->routes = new RouteCollection; - $this->container = $container ?: new Container; - } - - /** - * Register a new GET route with the router. - * - * @param string $uri - * @param array|string|callable|null $action - * @return \Illuminate\Routing\Route - */ - public function get($uri, $action = null) - { - return $this->addRoute(['GET', 'HEAD'], $uri, $action); - } - - /** - * Register a new POST route with the router. - * - * @param string $uri - * @param array|string|callable|null $action - * @return \Illuminate\Routing\Route - */ - public function post($uri, $action = null) - { - return $this->addRoute('POST', $uri, $action); - } - - /** - * Register a new PUT route with the router. - * - * @param string $uri - * @param array|string|callable|null $action - * @return \Illuminate\Routing\Route - */ - public function put($uri, $action = null) - { - return $this->addRoute('PUT', $uri, $action); - } - - /** - * Register a new PATCH route with the router. - * - * @param string $uri - * @param array|string|callable|null $action - * @return \Illuminate\Routing\Route - */ - public function patch($uri, $action = null) - { - return $this->addRoute('PATCH', $uri, $action); - } - - /** - * Register a new DELETE route with the router. - * - * @param string $uri - * @param array|string|callable|null $action - * @return \Illuminate\Routing\Route - */ - public function delete($uri, $action = null) - { - return $this->addRoute('DELETE', $uri, $action); - } - - /** - * Register a new OPTIONS route with the router. - * - * @param string $uri - * @param array|string|callable|null $action - * @return \Illuminate\Routing\Route - */ - public function options($uri, $action = null) - { - return $this->addRoute('OPTIONS', $uri, $action); - } - - /** - * Register a new route responding to all verbs. - * - * @param string $uri - * @param array|string|callable|null $action - * @return \Illuminate\Routing\Route - */ - public function any($uri, $action = null) - { - return $this->addRoute(self::$verbs, $uri, $action); - } - - /** - * Register a new Fallback route with the router. - * - * @param array|string|callable|null $action - * @return \Illuminate\Routing\Route - */ - public function fallback($action) - { - $placeholder = 'fallbackPlaceholder'; - - return $this->addRoute( - 'GET', "{{$placeholder}}", $action - )->where($placeholder, '.*')->fallback(); - } - - /** - * Create a redirect from one URI to another. - * - * @param string $uri - * @param string $destination - * @param int $status - * @return \Illuminate\Routing\Route - */ - public function redirect($uri, $destination, $status = 302) - { - return $this->any($uri, '\Illuminate\Routing\RedirectController') - ->defaults('destination', $destination) - ->defaults('status', $status); - } - - /** - * Create a permanent redirect from one URI to another. - * - * @param string $uri - * @param string $destination - * @return \Illuminate\Routing\Route - */ - public function permanentRedirect($uri, $destination) - { - return $this->redirect($uri, $destination, 301); - } - - /** - * Register a new route that returns a view. - * - * @param string $uri - * @param string $view - * @param array $data - * @param int|array $status - * @param array $headers - * @return \Illuminate\Routing\Route - */ - public function view($uri, $view, $data = [], $status = 200, array $headers = []) - { - return $this->match(['GET', 'HEAD'], $uri, '\Illuminate\Routing\ViewController') - ->setDefaults([ - 'view' => $view, - 'data' => $data, - 'status' => is_array($status) ? 200 : $status, - 'headers' => is_array($status) ? $status : $headers, - ]); - } - - /** - * Register a new route with the given verbs. - * - * @param array|string $methods - * @param string $uri - * @param array|string|callable|null $action - * @return \Illuminate\Routing\Route - */ - public function match($methods, $uri, $action = null) - { - return $this->addRoute(array_map('strtoupper', (array) $methods), $uri, $action); - } - - /** - * Register an array of resource controllers. - * - * @param array $resources - * @param array $options - * @return void - */ - public function resources(array $resources, array $options = []) - { - foreach ($resources as $name => $controller) { - $this->resource($name, $controller, $options); - } - } - - /** - * Route a resource to a controller. - * - * @param string $name - * @param string $controller - * @param array $options - * @return \Illuminate\Routing\PendingResourceRegistration - */ - public function resource($name, $controller, array $options = []) - { - if ($this->container && $this->container->bound(ResourceRegistrar::class)) { - $registrar = $this->container->make(ResourceRegistrar::class); - } else { - $registrar = new ResourceRegistrar($this); - } - - return new PendingResourceRegistration( - $registrar, $name, $controller, $options - ); - } - - /** - * Register an array of API resource controllers. - * - * @param array $resources - * @param array $options - * @return void - */ - public function apiResources(array $resources, array $options = []) - { - foreach ($resources as $name => $controller) { - $this->apiResource($name, $controller, $options); - } - } - - /** - * Route an API resource to a controller. - * - * @param string $name - * @param string $controller - * @param array $options - * @return \Illuminate\Routing\PendingResourceRegistration - */ - public function apiResource($name, $controller, array $options = []) - { - $only = ['index', 'show', 'store', 'update', 'destroy']; - - if (isset($options['except'])) { - $only = array_diff($only, (array) $options['except']); - } - - return $this->resource($name, $controller, array_merge([ - 'only' => $only, - ], $options)); - } - - /** - * Register an array of singleton resource controllers. - * - * @param array $singletons - * @param array $options - * @return void - */ - public function singletons(array $singletons, array $options = []) - { - foreach ($singletons as $name => $controller) { - $this->singleton($name, $controller, $options); - } - } - - /** - * Route a singleton resource to a controller. - * - * @param string $name - * @param string $controller - * @param array $options - * @return \Illuminate\Routing\PendingSingletonResourceRegistration - */ - public function singleton($name, $controller, array $options = []) - { - if ($this->container && $this->container->bound(ResourceRegistrar::class)) { - $registrar = $this->container->make(ResourceRegistrar::class); - } else { - $registrar = new ResourceRegistrar($this); - } - - return new PendingSingletonResourceRegistration( - $registrar, $name, $controller, $options - ); - } - - /** - * Register an array of API singleton resource controllers. - * - * @param array $singletons - * @param array $options - * @return void - */ - public function apiSingletons(array $singletons, array $options = []) - { - foreach ($singletons as $name => $controller) { - $this->apiSingleton($name, $controller, $options); - } - } - - /** - * Route an API singleton resource to a controller. - * - * @param string $name - * @param string $controller - * @param array $options - * @return \Illuminate\Routing\PendingSingletonResourceRegistration - */ - public function apiSingleton($name, $controller, array $options = []) - { - $only = ['show', 'update', 'destroy']; - - if (isset($options['except'])) { - $only = array_diff($only, (array) $options['except']); - } - - return $this->singleton($name, $controller, array_merge([ - 'only' => $only, - 'apiSingleton' => true, - ], $options)); - } - - /** - * Create a route group with shared attributes. - * - * @param array $attributes - * @param \Closure|array|string $routes - * @return $this - */ - public function group(array $attributes, $routes) - { - foreach (Arr::wrap($routes) as $groupRoutes) { - $this->updateGroupStack($attributes); - - // Once we have updated the group stack, we'll load the provided routes and - // merge in the group's attributes when the routes are created. After we - // have created the routes, we will pop the attributes off the stack. - $this->loadRoutes($groupRoutes); - - array_pop($this->groupStack); - } - - return $this; - } - - /** - * Update the group stack with the given attributes. - * - * @param array $attributes - * @return void - */ - protected function updateGroupStack(array $attributes) - { - if ($this->hasGroupStack()) { - $attributes = $this->mergeWithLastGroup($attributes); - } - - $this->groupStack[] = $attributes; - } - - /** - * Merge the given array with the last group stack. - * - * @param array $new - * @param bool $prependExistingPrefix - * @return array - */ - public function mergeWithLastGroup($new, $prependExistingPrefix = true) - { - return RouteGroup::merge($new, end($this->groupStack), $prependExistingPrefix); - } - - /** - * Load the provided routes. - * - * @param \Closure|string $routes - * @return void - */ - protected function loadRoutes($routes) - { - if ($routes instanceof Closure) { - $routes($this); - } else { - (new RouteFileRegistrar($this))->register($routes); - } - } - - /** - * Get the prefix from the last group on the stack. - * - * @return string - */ - public function getLastGroupPrefix() - { - if ($this->hasGroupStack()) { - $last = end($this->groupStack); - - return $last['prefix'] ?? ''; - } - - return ''; - } - - /** - * Add a route to the underlying route collection. - * - * @param array|string $methods - * @param string $uri - * @param array|string|callable|null $action - * @return \Illuminate\Routing\Route - */ - public function addRoute($methods, $uri, $action) - { - return $this->routes->add($this->createRoute($methods, $uri, $action)); - } - - /** - * Create a new route instance. - * - * @param array|string $methods - * @param string $uri - * @param mixed $action - * @return \Illuminate\Routing\Route - */ - protected function createRoute($methods, $uri, $action) - { - // If the route is routing to a controller we will parse the route action into - // an acceptable array format before registering it and creating this route - // instance itself. We need to build the Closure that will call this out. - if ($this->actionReferencesController($action)) { - $action = $this->convertToControllerAction($action); - } - - $route = $this->newRoute( - $methods, $this->prefix($uri), $action - ); - - // If we have groups that need to be merged, we will merge them now after this - // route has already been created and is ready to go. After we're done with - // the merge we will be ready to return the route back out to the caller. - if ($this->hasGroupStack()) { - $this->mergeGroupAttributesIntoRoute($route); - } - - $this->addWhereClausesToRoute($route); - - return $route; - } - - /** - * Determine if the action is routing to a controller. - * - * @param mixed $action - * @return bool - */ - protected function actionReferencesController($action) - { - if (! $action instanceof Closure) { - return is_string($action) || (isset($action['uses']) && is_string($action['uses'])); - } - - return false; - } - - /** - * Add a controller based route action to the action array. - * - * @param array|string $action - * @return array - */ - protected function convertToControllerAction($action) - { - if (is_string($action)) { - $action = ['uses' => $action]; - } - - // Here we'll merge any group "controller" and "uses" statements if necessary so that - // the action has the proper clause for this property. Then, we can simply set the - // name of this controller on the action plus return the action array for usage. - if ($this->hasGroupStack()) { - $action['uses'] = $this->prependGroupController($action['uses']); - $action['uses'] = $this->prependGroupNamespace($action['uses']); - } - - // Here we will set this controller name on the action array just so we always - // have a copy of it for reference if we need it. This can be used while we - // search for a controller name or do some other type of fetch operation. - $action['controller'] = $action['uses']; - - return $action; - } - - /** - * Prepend the last group namespace onto the use clause. - * - * @param string $class - * @return string - */ - protected function prependGroupNamespace($class) - { - $group = end($this->groupStack); - - return isset($group['namespace']) && ! str_starts_with($class, '\\') && ! str_starts_with($class, $group['namespace']) - ? $group['namespace'].'\\'.$class : $class; - } - - /** - * Prepend the last group controller onto the use clause. - * - * @param string $class - * @return string - */ - protected function prependGroupController($class) - { - $group = end($this->groupStack); - - if (! isset($group['controller'])) { - return $class; - } - - if (class_exists($class)) { - return $class; - } - - if (str_contains($class, '@')) { - return $class; - } - - return $group['controller'].'@'.$class; - } - - /** - * Create a new Route object. - * - * @param array|string $methods - * @param string $uri - * @param mixed $action - * @return \Illuminate\Routing\Route - */ - public function newRoute($methods, $uri, $action) - { - return (new Route($methods, $uri, $action)) - ->setRouter($this) - ->setContainer($this->container); - } - - /** - * Prefix the given URI with the last prefix. - * - * @param string $uri - * @return string - */ - protected function prefix($uri) - { - return trim(trim($this->getLastGroupPrefix(), '/').'/'.trim($uri, '/'), '/') ?: '/'; - } - - /** - * Add the necessary where clauses to the route based on its initial registration. - * - * @param \Illuminate\Routing\Route $route - * @return \Illuminate\Routing\Route - */ - protected function addWhereClausesToRoute($route) - { - $route->where(array_merge( - $this->patterns, $route->getAction()['where'] ?? [] - )); - - return $route; - } - - /** - * Merge the group stack with the controller action. - * - * @param \Illuminate\Routing\Route $route - * @return void - */ - protected function mergeGroupAttributesIntoRoute($route) - { - $route->setAction($this->mergeWithLastGroup( - $route->getAction(), - $prependExistingPrefix = false - )); - } - - /** - * Return the response returned by the given route. - * - * @param string $name - * @return \Symfony\Component\HttpFoundation\Response - */ - public function respondWithRoute($name) - { - $route = tap($this->routes->getByName($name))->bind($this->currentRequest); - - return $this->runRoute($this->currentRequest, $route); - } - - /** - * Dispatch the request to the application. - * - * @param \Illuminate\Http\Request $request - * @return \Symfony\Component\HttpFoundation\Response - */ - public function dispatch(Request $request) - { - $this->currentRequest = $request; - - return $this->dispatchToRoute($request); - } - - /** - * Dispatch the request to a route and return the response. - * - * @param \Illuminate\Http\Request $request - * @return \Symfony\Component\HttpFoundation\Response - */ - public function dispatchToRoute(Request $request) - { - return $this->runRoute($request, $this->findRoute($request)); - } - - /** - * Find the route matching a given request. - * - * @param \Illuminate\Http\Request $request - * @return \Illuminate\Routing\Route - */ - protected function findRoute($request) - { - $this->events->dispatch(new Routing($request)); - - $this->current = $route = $this->routes->match($request); - - $route->setContainer($this->container); - - $this->container->instance(Route::class, $route); - - return $route; - } - - /** - * Return the response for the given route. - * - * @param \Illuminate\Http\Request $request - * @param \Illuminate\Routing\Route $route - * @return \Symfony\Component\HttpFoundation\Response - */ - protected function runRoute(Request $request, Route $route) - { - $request->setRouteResolver(fn () => $route); - - $this->events->dispatch(new RouteMatched($route, $request)); - - return $this->prepareResponse($request, - $this->runRouteWithinStack($route, $request) - ); - } - - /** - * Run the given route within a Stack "onion" instance. - * - * @param \Illuminate\Routing\Route $route - * @param \Illuminate\Http\Request $request - * @return mixed - */ - protected function runRouteWithinStack(Route $route, Request $request) - { - $shouldSkipMiddleware = $this->container->bound('middleware.disable') && - $this->container->make('middleware.disable') === true; - - $middleware = $shouldSkipMiddleware ? [] : $this->gatherRouteMiddleware($route); - - return (new Pipeline($this->container)) - ->send($request) - ->through($middleware) - ->then(fn ($request) => $this->prepareResponse( - $request, $route->run() - )); - } - - /** - * Gather the middleware for the given route with resolved class names. - * - * @param \Illuminate\Routing\Route $route - * @return array - */ - public function gatherRouteMiddleware(Route $route) - { - return $this->resolveMiddleware($route->gatherMiddleware(), $route->excludedMiddleware()); - } - - /** - * Resolve a flat array of middleware classes from the provided array. - * - * @param array $middleware - * @param array $excluded - * @return array - */ - public function resolveMiddleware(array $middleware, array $excluded = []) - { - $excluded = collect($excluded)->map(function ($name) { - return (array) MiddlewareNameResolver::resolve($name, $this->middleware, $this->middlewareGroups); - })->flatten()->values()->all(); - - $middleware = collect($middleware)->map(function ($name) { - return (array) MiddlewareNameResolver::resolve($name, $this->middleware, $this->middlewareGroups); - })->flatten()->reject(function ($name) use ($excluded) { - if (empty($excluded)) { - return false; - } - - if ($name instanceof Closure) { - return false; - } - - if (in_array($name, $excluded, true)) { - return true; - } - - if (! class_exists($name)) { - return false; - } - - $reflection = new ReflectionClass($name); - - return collect($excluded)->contains( - fn ($exclude) => class_exists($exclude) && $reflection->isSubclassOf($exclude) - ); - })->values(); - - return $this->sortMiddleware($middleware); - } - - /** - * Sort the given middleware by priority. - * - * @param \Illuminate\Support\Collection $middlewares - * @return array - */ - protected function sortMiddleware(Collection $middlewares) - { - return (new SortedMiddleware($this->middlewarePriority, $middlewares))->all(); - } - - /** - * Create a response instance from the given value. - * - * @param \Symfony\Component\HttpFoundation\Request $request - * @param mixed $response - * @return \Symfony\Component\HttpFoundation\Response - */ - public function prepareResponse($request, $response) - { - return static::toResponse($request, $response); - } - - /** - * Static version of prepareResponse. - * - * @param \Symfony\Component\HttpFoundation\Request $request - * @param mixed $response - * @return \Symfony\Component\HttpFoundation\Response - */ - public static function toResponse($request, $response) - { - if ($response instanceof Responsable) { - $response = $response->toResponse($request); - } - - if ($response instanceof PsrResponseInterface) { - $response = (new HttpFoundationFactory)->createResponse($response); - } elseif ($response instanceof Model && $response->wasRecentlyCreated) { - $response = new JsonResponse($response, 201); - } elseif ($response instanceof Stringable) { - $response = new Response($response->__toString(), 200, ['Content-Type' => 'text/html']); - } elseif (! $response instanceof SymfonyResponse && - ($response instanceof Arrayable || - $response instanceof Jsonable || - $response instanceof ArrayObject || - $response instanceof JsonSerializable || - $response instanceof stdClass || - is_array($response))) { - $response = new JsonResponse($response); - } elseif (! $response instanceof SymfonyResponse) { - $response = new Response($response, 200, ['Content-Type' => 'text/html']); - } - - if ($response->getStatusCode() === Response::HTTP_NOT_MODIFIED) { - $response->setNotModified(); - } - - return $response->prepare($request); - } - - /** - * Substitute the route bindings onto the route. - * - * @param \Illuminate\Routing\Route $route - * @return \Illuminate\Routing\Route - * - * @throws \Illuminate\Database\Eloquent\ModelNotFoundException<\Illuminate\Database\Eloquent\Model> - * @throws \Illuminate\Routing\Exceptions\BackedEnumCaseNotFoundException - */ - public function substituteBindings($route) - { - foreach ($route->parameters() as $key => $value) { - if (isset($this->binders[$key])) { - $route->setParameter($key, $this->performBinding($key, $value, $route)); - } - } - - return $route; - } - - /** - * Substitute the implicit route bindings for the given route. - * - * @param \Illuminate\Routing\Route $route - * @return void - * - * @throws \Illuminate\Database\Eloquent\ModelNotFoundException<\Illuminate\Database\Eloquent\Model> - * @throws \Illuminate\Routing\Exceptions\BackedEnumCaseNotFoundException - */ - public function substituteImplicitBindings($route) - { - ImplicitRouteBinding::resolveForRoute($this->container, $route); - } - - /** - * Call the binding callback for the given key. - * - * @param string $key - * @param string $value - * @param \Illuminate\Routing\Route $route - * @return mixed - * - * @throws \Illuminate\Database\Eloquent\ModelNotFoundException<\Illuminate\Database\Eloquent\Model> - */ - protected function performBinding($key, $value, $route) - { - return call_user_func($this->binders[$key], $value, $route); - } - - /** - * Register a route matched event listener. - * - * @param string|callable $callback - * @return void - */ - public function matched($callback) - { - $this->events->listen(Events\RouteMatched::class, $callback); - } - - /** - * Get all of the defined middleware short-hand names. - * - * @return array - */ - public function getMiddleware() - { - return $this->middleware; - } - - /** - * Register a short-hand name for a middleware. - * - * @param string $name - * @param string $class - * @return $this - */ - public function aliasMiddleware($name, $class) - { - $this->middleware[$name] = $class; - - return $this; - } - - /** - * Check if a middlewareGroup with the given name exists. - * - * @param string $name - * @return bool - */ - public function hasMiddlewareGroup($name) - { - return array_key_exists($name, $this->middlewareGroups); - } - - /** - * Get all of the defined middleware groups. - * - * @return array - */ - public function getMiddlewareGroups() - { - return $this->middlewareGroups; - } - - /** - * Register a group of middleware. - * - * @param string $name - * @param array $middleware - * @return $this - */ - public function middlewareGroup($name, array $middleware) - { - $this->middlewareGroups[$name] = $middleware; - - return $this; - } - - /** - * Add a middleware to the beginning of a middleware group. - * - * If the middleware is already in the group, it will not be added again. - * - * @param string $group - * @param string $middleware - * @return $this - */ - public function prependMiddlewareToGroup($group, $middleware) - { - if (isset($this->middlewareGroups[$group]) && ! in_array($middleware, $this->middlewareGroups[$group])) { - array_unshift($this->middlewareGroups[$group], $middleware); - } - - return $this; - } - - /** - * Add a middleware to the end of a middleware group. - * - * If the middleware is already in the group, it will not be added again. - * - * @param string $group - * @param string $middleware - * @return $this - */ - public function pushMiddlewareToGroup($group, $middleware) - { - if (! array_key_exists($group, $this->middlewareGroups)) { - $this->middlewareGroups[$group] = []; - } - - if (! in_array($middleware, $this->middlewareGroups[$group])) { - $this->middlewareGroups[$group][] = $middleware; - } - - return $this; - } - - /** - * Remove the given middleware from the specified group. - * - * @param string $group - * @param string $middleware - * @return $this - */ - public function removeMiddlewareFromGroup($group, $middleware) - { - if (! $this->hasMiddlewareGroup($group)) { - return $this; - } - - $reversedMiddlewaresArray = array_flip($this->middlewareGroups[$group]); - - if (! array_key_exists($middleware, $reversedMiddlewaresArray)) { - return $this; - } - - $middlewareKey = $reversedMiddlewaresArray[$middleware]; - - unset($this->middlewareGroups[$group][$middlewareKey]); - - return $this; - } - - /** - * Flush the router's middleware groups. - * - * @return $this - */ - public function flushMiddlewareGroups() - { - $this->middlewareGroups = []; - - return $this; - } - - /** - * Add a new route parameter binder. - * - * @param string $key - * @param string|callable $binder - * @return void - */ - public function bind($key, $binder) - { - $this->binders[str_replace('-', '_', $key)] = RouteBinding::forCallback( - $this->container, $binder - ); - } - - /** - * Register a model binder for a wildcard. - * - * @param string $key - * @param string $class - * @param \Closure|null $callback - * @return void - */ - public function model($key, $class, Closure $callback = null) - { - $this->bind($key, RouteBinding::forModel($this->container, $class, $callback)); - } - - /** - * Get the binding callback for a given binding. - * - * @param string $key - * @return \Closure|null - */ - public function getBindingCallback($key) - { - if (isset($this->binders[$key = str_replace('-', '_', $key)])) { - return $this->binders[$key]; - } - } - - /** - * Get the global "where" patterns. - * - * @return array - */ - public function getPatterns() - { - return $this->patterns; - } - - /** - * Set a global where pattern on all routes. - * - * @param string $key - * @param string $pattern - * @return void - */ - public function pattern($key, $pattern) - { - $this->patterns[$key] = $pattern; - } - - /** - * Set a group of global where patterns on all routes. - * - * @param array $patterns - * @return void - */ - public function patterns($patterns) - { - foreach ($patterns as $key => $pattern) { - $this->pattern($key, $pattern); - } - } - - /** - * Determine if the router currently has a group stack. - * - * @return bool - */ - public function hasGroupStack() - { - return ! empty($this->groupStack); - } - - /** - * Get the current group stack for the router. - * - * @return array - */ - public function getGroupStack() - { - return $this->groupStack; - } - - /** - * Get a route parameter for the current route. - * - * @param string $key - * @param string|null $default - * @return mixed - */ - public function input($key, $default = null) - { - return $this->current()->parameter($key, $default); - } - - /** - * Get the request currently being dispatched. - * - * @return \Illuminate\Http\Request - */ - public function getCurrentRequest() - { - return $this->currentRequest; - } - - /** - * Get the currently dispatched route instance. - * - * @return \Illuminate\Routing\Route|null - */ - public function getCurrentRoute() - { - return $this->current(); - } - - /** - * Get the currently dispatched route instance. - * - * @return \Illuminate\Routing\Route|null - */ - public function current() - { - return $this->current; - } - - /** - * Check if a route with the given name exists. - * - * @param string|array $name - * @return bool - */ - public function has($name) - { - $names = is_array($name) ? $name : func_get_args(); - - foreach ($names as $value) { - if (! $this->routes->hasNamedRoute($value)) { - return false; - } - } - - return true; - } - - /** - * Get the current route name. - * - * @return string|null - */ - public function currentRouteName() - { - return $this->current() ? $this->current()->getName() : null; - } - - /** - * Alias for the "currentRouteNamed" method. - * - * @param mixed ...$patterns - * @return bool - */ - public function is(...$patterns) - { - return $this->currentRouteNamed(...$patterns); - } - - /** - * Determine if the current route matches a pattern. - * - * @param mixed ...$patterns - * @return bool - */ - public function currentRouteNamed(...$patterns) - { - return $this->current() && $this->current()->named(...$patterns); - } - - /** - * Get the current route action. - * - * @return string|null - */ - public function currentRouteAction() - { - if ($this->current()) { - return $this->current()->getAction()['controller'] ?? null; - } - } - - /** - * Alias for the "currentRouteUses" method. - * - * @param array ...$patterns - * @return bool - */ - public function uses(...$patterns) - { - foreach ($patterns as $pattern) { - if (Str::is($pattern, $this->currentRouteAction())) { - return true; - } - } - - return false; - } - - /** - * Determine if the current route action matches a given action. - * - * @param string $action - * @return bool - */ - public function currentRouteUses($action) - { - return $this->currentRouteAction() == $action; - } - - /** - * Set the unmapped global resource parameters to singular. - * - * @param bool $singular - * @return void - */ - public function singularResourceParameters($singular = true) - { - ResourceRegistrar::singularParameters($singular); - } - - /** - * Set the global resource parameter mapping. - * - * @param array $parameters - * @return void - */ - public function resourceParameters(array $parameters = []) - { - ResourceRegistrar::setParameters($parameters); - } - - /** - * Get or set the verbs used in the resource URIs. - * - * @param array $verbs - * @return array|null - */ - public function resourceVerbs(array $verbs = []) - { - return ResourceRegistrar::verbs($verbs); - } - - /** - * Get the underlying route collection. - * - * @return \Illuminate\Routing\RouteCollectionInterface - */ - public function getRoutes() - { - return $this->routes; - } - - /** - * Set the route collection instance. - * - * @param \Illuminate\Routing\RouteCollection $routes - * @return void - */ - public function setRoutes(RouteCollection $routes) - { - foreach ($routes as $route) { - $route->setRouter($this)->setContainer($this->container); - } - - $this->routes = $routes; - - $this->container->instance('routes', $this->routes); - } - - /** - * Set the compiled route collection instance. - * - * @param array $routes - * @return void - */ - public function setCompiledRoutes(array $routes) - { - $this->routes = (new CompiledRouteCollection($routes['compiled'], $routes['attributes'])) - ->setRouter($this) - ->setContainer($this->container); - - $this->container->instance('routes', $this->routes); - } - - /** - * Remove any duplicate middleware from the given array. - * - * @param array $middleware - * @return array - */ - public static function uniqueMiddleware(array $middleware) - { - $seen = []; - $result = []; - - foreach ($middleware as $value) { - $key = \is_object($value) ? \spl_object_id($value) : $value; - - if (! isset($seen[$key])) { - $seen[$key] = true; - $result[] = $value; - } - } - - return $result; - } - - /** - * Set the container instance used by the router. - * - * @param \Illuminate\Container\Container $container - * @return $this - */ - public function setContainer(Container $container) - { - $this->container = $container; - - return $this; - } - - /** - * Dynamically handle calls into the router instance. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - if (static::hasMacro($method)) { - return $this->macroCall($method, $parameters); - } - - if ($method === 'middleware') { - return (new RouteRegistrar($this))->attribute($method, is_array($parameters[0]) ? $parameters[0] : $parameters); - } - - if ($method !== 'where' && Str::startsWith($method, 'where')) { - return (new RouteRegistrar($this))->{$method}(...$parameters); - } - - return (new RouteRegistrar($this))->attribute($method, array_key_exists(0, $parameters) ? $parameters[0] : true); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/RoutingServiceProvider.php b/vendor/laravel/framework/src/Illuminate/Routing/RoutingServiceProvider.php deleted file mode 100755 index 696e4ca4..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/RoutingServiceProvider.php +++ /dev/null @@ -1,201 +0,0 @@ -registerRouter(); - $this->registerUrlGenerator(); - $this->registerRedirector(); - $this->registerPsrRequest(); - $this->registerPsrResponse(); - $this->registerResponseFactory(); - $this->registerCallableDispatcher(); - $this->registerControllerDispatcher(); - } - - /** - * Register the router instance. - * - * @return void - */ - protected function registerRouter() - { - $this->app->singleton('router', function ($app) { - return new Router($app['events'], $app); - }); - } - - /** - * Register the URL generator service. - * - * @return void - */ - protected function registerUrlGenerator() - { - $this->app->singleton('url', function ($app) { - $routes = $app['router']->getRoutes(); - - // The URL generator needs the route collection that exists on the router. - // Keep in mind this is an object, so we're passing by references here - // and all the registered routes will be available to the generator. - $app->instance('routes', $routes); - - return new UrlGenerator( - $routes, $app->rebinding( - 'request', $this->requestRebinder() - ), $app['config']['app.asset_url'] - ); - }); - - $this->app->extend('url', function (UrlGeneratorContract $url, $app) { - // Next we will set a few service resolvers on the URL generator so it can - // get the information it needs to function. This just provides some of - // the convenience features to this URL generator like "signed" URLs. - $url->setSessionResolver(function () { - return $this->app['session'] ?? null; - }); - - $url->setKeyResolver(function () { - return $this->app->make('config')->get('app.key'); - }); - - // If the route collection is "rebound", for example, when the routes stay - // cached for the application, we will need to rebind the routes on the - // URL generator instance so it has the latest version of the routes. - $app->rebinding('routes', function ($app, $routes) { - $app['url']->setRoutes($routes); - }); - - return $url; - }); - } - - /** - * Get the URL generator request rebinder. - * - * @return \Closure - */ - protected function requestRebinder() - { - return function ($app, $request) { - $app['url']->setRequest($request); - }; - } - - /** - * Register the Redirector service. - * - * @return void - */ - protected function registerRedirector() - { - $this->app->singleton('redirect', function ($app) { - $redirector = new Redirector($app['url']); - - // If the session is set on the application instance, we'll inject it into - // the redirector instance. This allows the redirect responses to allow - // for the quite convenient "with" methods that flash to the session. - if (isset($app['session.store'])) { - $redirector->setSession($app['session.store']); - } - - return $redirector; - }); - } - - /** - * Register a binding for the PSR-7 request implementation. - * - * @return void - * - * @throws \Illuminate\Contracts\Container\BindingResolutionException - */ - protected function registerPsrRequest() - { - $this->app->bind(ServerRequestInterface::class, function ($app) { - if (class_exists(Psr17Factory::class) && class_exists(PsrHttpFactory::class)) { - $psr17Factory = new Psr17Factory; - - return (new PsrHttpFactory($psr17Factory, $psr17Factory, $psr17Factory, $psr17Factory)) - ->createRequest($app->make('request')); - } - - throw new BindingResolutionException('Unable to resolve PSR request. Please install the symfony/psr-http-message-bridge and nyholm/psr7 packages.'); - }); - } - - /** - * Register a binding for the PSR-7 response implementation. - * - * @return void - * - * @throws \Illuminate\Contracts\Container\BindingResolutionException - */ - protected function registerPsrResponse() - { - $this->app->bind(ResponseInterface::class, function () { - if (class_exists(PsrResponse::class)) { - return new PsrResponse; - } - - throw new BindingResolutionException('Unable to resolve PSR response. Please install the nyholm/psr7 package.'); - }); - } - - /** - * Register the response factory implementation. - * - * @return void - */ - protected function registerResponseFactory() - { - $this->app->singleton(ResponseFactoryContract::class, function ($app) { - return new ResponseFactory($app[ViewFactoryContract::class], $app['redirect']); - }); - } - - /** - * Register the callable dispatcher. - * - * @return void - */ - protected function registerCallableDispatcher() - { - $this->app->singleton(CallableDispatcherContract::class, function ($app) { - return new CallableDispatcher($app); - }); - } - - /** - * Register the controller dispatcher. - * - * @return void - */ - protected function registerControllerDispatcher() - { - $this->app->singleton(ControllerDispatcherContract::class, function ($app) { - return new ControllerDispatcher($app); - }); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/SortedMiddleware.php b/vendor/laravel/framework/src/Illuminate/Routing/SortedMiddleware.php deleted file mode 100644 index 853378cf..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/SortedMiddleware.php +++ /dev/null @@ -1,122 +0,0 @@ -all(); - } - - $this->items = $this->sortMiddleware($priorityMap, $middlewares); - } - - /** - * Sort the middlewares by the given priority map. - * - * Each call to this method makes one discrete middleware movement if necessary. - * - * @param array $priorityMap - * @param array $middlewares - * @return array - */ - protected function sortMiddleware($priorityMap, $middlewares) - { - $lastIndex = 0; - - foreach ($middlewares as $index => $middleware) { - if (! is_string($middleware)) { - continue; - } - - $priorityIndex = $this->priorityMapIndex($priorityMap, $middleware); - - if (! is_null($priorityIndex)) { - // This middleware is in the priority map. If we have encountered another middleware - // that was also in the priority map and was at a lower priority than the current - // middleware, we will move this middleware to be above the previous encounter. - if (isset($lastPriorityIndex) && $priorityIndex < $lastPriorityIndex) { - return $this->sortMiddleware( - $priorityMap, array_values($this->moveMiddleware($middlewares, $index, $lastIndex)) - ); - } - - // This middleware is in the priority map; but, this is the first middleware we have - // encountered from the map thus far. We'll save its current index plus its index - // from the priority map so we can compare against them on the next iterations. - $lastIndex = $index; - - $lastPriorityIndex = $priorityIndex; - } - } - - return Router::uniqueMiddleware($middlewares); - } - - /** - * Calculate the priority map index of the middleware. - * - * @param array $priorityMap - * @param string $middleware - * @return int|null - */ - protected function priorityMapIndex($priorityMap, $middleware) - { - foreach ($this->middlewareNames($middleware) as $name) { - $priorityIndex = array_search($name, $priorityMap); - - if ($priorityIndex !== false) { - return $priorityIndex; - } - } - } - - /** - * Resolve the middleware names to look for in the priority array. - * - * @param string $middleware - * @return \Generator - */ - protected function middlewareNames($middleware) - { - $stripped = head(explode(':', $middleware)); - - yield $stripped; - - $interfaces = @class_implements($stripped); - - if ($interfaces !== false) { - foreach ($interfaces as $interface) { - yield $interface; - } - } - } - - /** - * Splice a middleware into a new position and remove the old entry. - * - * @param array $middlewares - * @param int $from - * @param int $to - * @return array - */ - protected function moveMiddleware($middlewares, $from, $to) - { - array_splice($middlewares, $to, 0, $middlewares[$from]); - - unset($middlewares[$from + 1]); - - return $middlewares; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php b/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php deleted file mode 100755 index 56a116d4..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php +++ /dev/null @@ -1,847 +0,0 @@ -routes = $routes; - $this->assetRoot = $assetRoot; - - $this->setRequest($request); - } - - /** - * Get the full URL for the current request. - * - * @return string - */ - public function full() - { - return $this->request->fullUrl(); - } - - /** - * Get the current URL for the request. - * - * @return string - */ - public function current() - { - return $this->to($this->request->getPathInfo()); - } - - /** - * Get the URL for the previous request. - * - * @param mixed $fallback - * @return string - */ - public function previous($fallback = false) - { - $referrer = $this->request->headers->get('referer'); - - $url = $referrer ? $this->to($referrer) : $this->getPreviousUrlFromSession(); - - if ($url) { - return $url; - } elseif ($fallback) { - return $this->to($fallback); - } - - return $this->to('/'); - } - - /** - * Get the previous path info for the request. - * - * @param mixed $fallback - * @return string - */ - public function previousPath($fallback = false) - { - $previousPath = str_replace($this->to('/'), '', rtrim(preg_replace('/\?.*/', '', $this->previous($fallback)), '/')); - - return $previousPath === '' ? '/' : $previousPath; - } - - /** - * Get the previous URL from the session if possible. - * - * @return string|null - */ - protected function getPreviousUrlFromSession() - { - $session = $this->getSession(); - - return $session ? $session->previousUrl() : null; - } - - /** - * Generate an absolute URL to the given path. - * - * @param string $path - * @param mixed $extra - * @param bool|null $secure - * @return string - */ - public function to($path, $extra = [], $secure = null) - { - // First we will check if the URL is already a valid URL. If it is we will not - // try to generate a new one but will simply return the URL as is, which is - // convenient since developers do not always have to check if it's valid. - if ($this->isValidUrl($path)) { - return $path; - } - - $tail = implode('/', array_map( - 'rawurlencode', (array) $this->formatParameters($extra)) - ); - - // Once we have the scheme we will compile the "tail" by collapsing the values - // into a single string delimited by slashes. This just makes it convenient - // for passing the array of parameters to this URL as a list of segments. - $root = $this->formatRoot($this->formatScheme($secure)); - - [$path, $query] = $this->extractQueryString($path); - - return $this->format( - $root, '/'.trim($path.'/'.$tail, '/') - ).$query; - } - - /** - * Generate a secure, absolute URL to the given path. - * - * @param string $path - * @param array $parameters - * @return string - */ - public function secure($path, $parameters = []) - { - return $this->to($path, $parameters, true); - } - - /** - * Generate the URL to an application asset. - * - * @param string $path - * @param bool|null $secure - * @return string - */ - public function asset($path, $secure = null) - { - if ($this->isValidUrl($path)) { - return $path; - } - - // Once we get the root URL, we will check to see if it contains an index.php - // file in the paths. If it does, we will remove it since it is not needed - // for asset paths, but only for routes to endpoints in the application. - $root = $this->assetRoot ?: $this->formatRoot($this->formatScheme($secure)); - - return $this->removeIndex($root).'/'.trim($path, '/'); - } - - /** - * Generate the URL to a secure asset. - * - * @param string $path - * @return string - */ - public function secureAsset($path) - { - return $this->asset($path, true); - } - - /** - * Generate the URL to an asset from a custom root domain such as CDN, etc. - * - * @param string $root - * @param string $path - * @param bool|null $secure - * @return string - */ - public function assetFrom($root, $path, $secure = null) - { - // Once we get the root URL, we will check to see if it contains an index.php - // file in the paths. If it does, we will remove it since it is not needed - // for asset paths, but only for routes to endpoints in the application. - $root = $this->formatRoot($this->formatScheme($secure), $root); - - return $this->removeIndex($root).'/'.trim($path, '/'); - } - - /** - * Remove the index.php file from a path. - * - * @param string $root - * @return string - */ - protected function removeIndex($root) - { - $i = 'index.php'; - - return str_contains($root, $i) ? str_replace('/'.$i, '', $root) : $root; - } - - /** - * Get the default scheme for a raw URL. - * - * @param bool|null $secure - * @return string - */ - public function formatScheme($secure = null) - { - if (! is_null($secure)) { - return $secure ? 'https://' : 'http://'; - } - - if (is_null($this->cachedScheme)) { - $this->cachedScheme = $this->forceScheme ?: $this->request->getScheme().'://'; - } - - return $this->cachedScheme; - } - - /** - * Create a signed route URL for a named route. - * - * @param string $name - * @param mixed $parameters - * @param \DateTimeInterface|\DateInterval|int|null $expiration - * @param bool $absolute - * @return string - * - * @throws \InvalidArgumentException - */ - public function signedRoute($name, $parameters = [], $expiration = null, $absolute = true) - { - $this->ensureSignedRouteParametersAreNotReserved( - $parameters = Arr::wrap($parameters) - ); - - if ($expiration) { - $parameters = $parameters + ['expires' => $this->availableAt($expiration)]; - } - - ksort($parameters); - - $key = call_user_func($this->keyResolver); - - return $this->route($name, $parameters + [ - 'signature' => hash_hmac('sha256', $this->route($name, $parameters, $absolute), $key), - ], $absolute); - } - - /** - * Ensure the given signed route parameters are not reserved. - * - * @param mixed $parameters - * @return void - */ - protected function ensureSignedRouteParametersAreNotReserved($parameters) - { - if (array_key_exists('signature', $parameters)) { - throw new InvalidArgumentException( - '"Signature" is a reserved parameter when generating signed routes. Please rename your route parameter.' - ); - } - - if (array_key_exists('expires', $parameters)) { - throw new InvalidArgumentException( - '"Expires" is a reserved parameter when generating signed routes. Please rename your route parameter.' - ); - } - } - - /** - * Create a temporary signed route URL for a named route. - * - * @param string $name - * @param \DateTimeInterface|\DateInterval|int $expiration - * @param array $parameters - * @param bool $absolute - * @return string - */ - public function temporarySignedRoute($name, $expiration, $parameters = [], $absolute = true) - { - return $this->signedRoute($name, $parameters, $expiration, $absolute); - } - - /** - * Determine if the given request has a valid signature. - * - * @param \Illuminate\Http\Request $request - * @param bool $absolute - * @param array $ignoreQuery - * @return bool - */ - public function hasValidSignature(Request $request, $absolute = true, array $ignoreQuery = []) - { - return $this->hasCorrectSignature($request, $absolute, $ignoreQuery) - && $this->signatureHasNotExpired($request); - } - - /** - * Determine if the given request has a valid signature for a relative URL. - * - * @param \Illuminate\Http\Request $request - * @param array $ignoreQuery - * @return bool - */ - public function hasValidRelativeSignature(Request $request, array $ignoreQuery = []) - { - return $this->hasValidSignature($request, false, $ignoreQuery); - } - - /** - * Determine if the signature from the given request matches the URL. - * - * @param \Illuminate\Http\Request $request - * @param bool $absolute - * @param array $ignoreQuery - * @return bool - */ - public function hasCorrectSignature(Request $request, $absolute = true, array $ignoreQuery = []) - { - $ignoreQuery[] = 'signature'; - - $url = $absolute ? $request->url() : '/'.$request->path(); - - $queryString = collect(explode('&', (string) $request->server->get('QUERY_STRING'))) - ->reject(fn ($parameter) => in_array(Str::before($parameter, '='), $ignoreQuery)) - ->join('&'); - - $original = rtrim($url.'?'.$queryString, '?'); - - $signature = hash_hmac('sha256', $original, call_user_func($this->keyResolver)); - - return hash_equals($signature, (string) $request->query('signature', '')); - } - - /** - * Determine if the expires timestamp from the given request is not from the past. - * - * @param \Illuminate\Http\Request $request - * @return bool - */ - public function signatureHasNotExpired(Request $request) - { - $expires = $request->query('expires'); - - return ! ($expires && Carbon::now()->getTimestamp() > $expires); - } - - /** - * Get the URL to a named route. - * - * @param string $name - * @param mixed $parameters - * @param bool $absolute - * @return string - * - * @throws \Symfony\Component\Routing\Exception\RouteNotFoundException - */ - public function route($name, $parameters = [], $absolute = true) - { - if (! is_null($route = $this->routes->getByName($name))) { - return $this->toRoute($route, $parameters, $absolute); - } - - throw new RouteNotFoundException("Route [{$name}] not defined."); - } - - /** - * Get the URL for a given route instance. - * - * @param \Illuminate\Routing\Route $route - * @param mixed $parameters - * @param bool $absolute - * @return string - * - * @throws \Illuminate\Routing\Exceptions\UrlGenerationException - */ - public function toRoute($route, $parameters, $absolute) - { - $parameters = collect(Arr::wrap($parameters))->map(function ($value, $key) use ($route) { - $value = $value instanceof UrlRoutable && $route->bindingFieldFor($key) - ? $value->{$route->bindingFieldFor($key)} - : $value; - - return function_exists('enum_exists') && $value instanceof BackedEnum - ? $value->value - : $value; - })->all(); - - return $this->routeUrl()->to( - $route, $this->formatParameters($parameters), $absolute - ); - } - - /** - * Get the URL to a controller action. - * - * @param string|array $action - * @param mixed $parameters - * @param bool $absolute - * @return string - * - * @throws \InvalidArgumentException - */ - public function action($action, $parameters = [], $absolute = true) - { - if (is_null($route = $this->routes->getByAction($action = $this->formatAction($action)))) { - throw new InvalidArgumentException("Action {$action} not defined."); - } - - return $this->toRoute($route, $parameters, $absolute); - } - - /** - * Format the given controller action. - * - * @param string|array $action - * @return string - */ - protected function formatAction($action) - { - if (is_array($action)) { - $action = '\\'.implode('@', $action); - } - - if ($this->rootNamespace && ! str_starts_with($action, '\\')) { - return $this->rootNamespace.'\\'.$action; - } else { - return trim($action, '\\'); - } - } - - /** - * Format the array of URL parameters. - * - * @param mixed|array $parameters - * @return array - */ - public function formatParameters($parameters) - { - $parameters = Arr::wrap($parameters); - - foreach ($parameters as $key => $parameter) { - if ($parameter instanceof UrlRoutable) { - $parameters[$key] = $parameter->getRouteKey(); - } - } - - return $parameters; - } - - /** - * Extract the query string from the given path. - * - * @param string $path - * @return array - */ - protected function extractQueryString($path) - { - if (($queryPosition = strpos($path, '?')) !== false) { - return [ - substr($path, 0, $queryPosition), - substr($path, $queryPosition), - ]; - } - - return [$path, '']; - } - - /** - * Get the base URL for the request. - * - * @param string $scheme - * @param string|null $root - * @return string - */ - public function formatRoot($scheme, $root = null) - { - if (is_null($root)) { - if (is_null($this->cachedRoot)) { - $this->cachedRoot = $this->forcedRoot ?: $this->request->root(); - } - - $root = $this->cachedRoot; - } - - $start = str_starts_with($root, 'http://') ? 'http://' : 'https://'; - - return preg_replace('~'.$start.'~', $scheme, $root, 1); - } - - /** - * Format the given URL segments into a single URL. - * - * @param string $root - * @param string $path - * @param \Illuminate\Routing\Route|null $route - * @return string - */ - public function format($root, $path, $route = null) - { - $path = '/'.trim($path, '/'); - - if ($this->formatHostUsing) { - $root = call_user_func($this->formatHostUsing, $root, $route); - } - - if ($this->formatPathUsing) { - $path = call_user_func($this->formatPathUsing, $path, $route); - } - - return trim($root.$path, '/'); - } - - /** - * Determine if the given path is a valid URL. - * - * @param string $path - * @return bool - */ - public function isValidUrl($path) - { - if (! preg_match('~^(#|//|https?://|(mailto|tel|sms):)~', $path)) { - return filter_var($path, FILTER_VALIDATE_URL) !== false; - } - - return true; - } - - /** - * Get the Route URL generator instance. - * - * @return \Illuminate\Routing\RouteUrlGenerator - */ - protected function routeUrl() - { - if (! $this->routeGenerator) { - $this->routeGenerator = new RouteUrlGenerator($this, $this->request); - } - - return $this->routeGenerator; - } - - /** - * Set the default named parameters used by the URL generator. - * - * @param array $defaults - * @return void - */ - public function defaults(array $defaults) - { - $this->routeUrl()->defaults($defaults); - } - - /** - * Get the default named parameters used by the URL generator. - * - * @return array - */ - public function getDefaultParameters() - { - return $this->routeUrl()->defaultParameters; - } - - /** - * Force the scheme for URLs. - * - * @param string|null $scheme - * @return void - */ - public function forceScheme($scheme) - { - $this->cachedScheme = null; - - $this->forceScheme = $scheme ? $scheme.'://' : null; - } - - /** - * Set the forced root URL. - * - * @param string|null $root - * @return void - */ - public function forceRootUrl($root) - { - $this->forcedRoot = $root ? rtrim($root, '/') : null; - - $this->cachedRoot = null; - } - - /** - * Set a callback to be used to format the host of generated URLs. - * - * @param \Closure $callback - * @return $this - */ - public function formatHostUsing(Closure $callback) - { - $this->formatHostUsing = $callback; - - return $this; - } - - /** - * Set a callback to be used to format the path of generated URLs. - * - * @param \Closure $callback - * @return $this - */ - public function formatPathUsing(Closure $callback) - { - $this->formatPathUsing = $callback; - - return $this; - } - - /** - * Get the path formatter being used by the URL generator. - * - * @return \Closure - */ - public function pathFormatter() - { - return $this->formatPathUsing ?: function ($path) { - return $path; - }; - } - - /** - * Get the request instance. - * - * @return \Illuminate\Http\Request - */ - public function getRequest() - { - return $this->request; - } - - /** - * Set the current request instance. - * - * @param \Illuminate\Http\Request $request - * @return void - */ - public function setRequest(Request $request) - { - $this->request = $request; - - $this->cachedRoot = null; - $this->cachedScheme = null; - - tap(optional($this->routeGenerator)->defaultParameters ?: [], function ($defaults) { - $this->routeGenerator = null; - - if (! empty($defaults)) { - $this->defaults($defaults); - } - }); - } - - /** - * Set the route collection. - * - * @param \Illuminate\Routing\RouteCollectionInterface $routes - * @return $this - */ - public function setRoutes(RouteCollectionInterface $routes) - { - $this->routes = $routes; - - return $this; - } - - /** - * Get the session implementation from the resolver. - * - * @return \Illuminate\Session\Store|null - */ - protected function getSession() - { - if ($this->sessionResolver) { - return call_user_func($this->sessionResolver); - } - } - - /** - * Set the session resolver for the generator. - * - * @param callable $sessionResolver - * @return $this - */ - public function setSessionResolver(callable $sessionResolver) - { - $this->sessionResolver = $sessionResolver; - - return $this; - } - - /** - * Set the encryption key resolver. - * - * @param callable $keyResolver - * @return $this - */ - public function setKeyResolver(callable $keyResolver) - { - $this->keyResolver = $keyResolver; - - return $this; - } - - /** - * Clone a new instance of the URL generator with a different encryption key resolver. - * - * @param callable $keyResolver - * @return \Illuminate\Routing\UrlGenerator - */ - public function withKeyResolver(callable $keyResolver) - { - return (clone $this)->setKeyResolver($keyResolver); - } - - /** - * Get the root controller namespace. - * - * @return string - */ - public function getRootControllerNamespace() - { - return $this->rootNamespace; - } - - /** - * Set the root controller namespace. - * - * @param string $rootNamespace - * @return $this - */ - public function setRootControllerNamespace($rootNamespace) - { - $this->rootNamespace = $rootNamespace; - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/ViewController.php b/vendor/laravel/framework/src/Illuminate/Routing/ViewController.php deleted file mode 100644 index 54a73595..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/ViewController.php +++ /dev/null @@ -1,60 +0,0 @@ -response = $response; - } - - /** - * Invoke the controller method. - * - * @param array $args - * @return \Illuminate\Http\Response - */ - public function __invoke(...$args) - { - $routeParameters = array_filter($args, function ($key) { - return ! in_array($key, ['view', 'data', 'status', 'headers']); - }, ARRAY_FILTER_USE_KEY); - - $args['data'] = array_merge($args['data'], $routeParameters); - - return $this->response->view( - $args['view'], - $args['data'], - $args['status'], - $args['headers'] - ); - } - - /** - * Execute an action on the controller. - * - * @param string $method - * @param array $parameters - * @return \Symfony\Component\HttpFoundation\Response - */ - public function callAction($method, $parameters) - { - return $this->{$method}(...$parameters); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Routing/composer.json b/vendor/laravel/framework/src/Illuminate/Routing/composer.json deleted file mode 100644 index 2b3aa1a7..00000000 --- a/vendor/laravel/framework/src/Illuminate/Routing/composer.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "illuminate/routing", - "description": "The Illuminate Routing package.", - "license": "MIT", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "require": { - "php": "^8.0.2", - "ext-json": "*", - "illuminate/collections": "^9.0", - "illuminate/container": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/http": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/pipeline": "^9.0", - "illuminate/session": "^9.0", - "illuminate/support": "^9.0", - "symfony/http-foundation": "^6.0", - "symfony/http-kernel": "^6.0", - "symfony/routing": "^6.0" - }, - "autoload": { - "psr-4": { - "Illuminate\\Routing\\": "" - } - }, - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "suggest": { - "illuminate/console": "Required to use the make commands (^9.0).", - "nyholm/psr7": "Required to use PSR-7 bridging features (^1.2).", - "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^2.0)." - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev" -} diff --git a/vendor/laravel/framework/src/Illuminate/Session/ArraySessionHandler.php b/vendor/laravel/framework/src/Illuminate/Session/ArraySessionHandler.php deleted file mode 100644 index 44d50daf..00000000 --- a/vendor/laravel/framework/src/Illuminate/Session/ArraySessionHandler.php +++ /dev/null @@ -1,139 +0,0 @@ -minutes = $minutes; - } - - /** - * {@inheritdoc} - * - * @return bool - */ - public function open($savePath, $sessionName): bool - { - return true; - } - - /** - * {@inheritdoc} - * - * @return bool - */ - public function close(): bool - { - return true; - } - - /** - * {@inheritdoc} - * - * @return string|false - */ - public function read($sessionId): string|false - { - if (! isset($this->storage[$sessionId])) { - return ''; - } - - $session = $this->storage[$sessionId]; - - $expiration = $this->calculateExpiration($this->minutes * 60); - - if (isset($session['time']) && $session['time'] >= $expiration) { - return $session['data']; - } - - return ''; - } - - /** - * {@inheritdoc} - * - * @return bool - */ - public function write($sessionId, $data): bool - { - $this->storage[$sessionId] = [ - 'data' => $data, - 'time' => $this->currentTime(), - ]; - - return true; - } - - /** - * {@inheritdoc} - * - * @return bool - */ - public function destroy($sessionId): bool - { - if (isset($this->storage[$sessionId])) { - unset($this->storage[$sessionId]); - } - - return true; - } - - /** - * {@inheritdoc} - * - * @return int - */ - public function gc($lifetime): int - { - $expiration = $this->calculateExpiration($lifetime); - - $deletedSessions = 0; - - foreach ($this->storage as $sessionId => $session) { - if ($session['time'] < $expiration) { - unset($this->storage[$sessionId]); - $deletedSessions++; - } - } - - return $deletedSessions; - } - - /** - * Get the expiration time of the session. - * - * @param int $seconds - * @return int - */ - protected function calculateExpiration($seconds) - { - return $this->currentTime() - $seconds; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Session/CacheBasedSessionHandler.php b/vendor/laravel/framework/src/Illuminate/Session/CacheBasedSessionHandler.php deleted file mode 100755 index 0cccdf2d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Session/CacheBasedSessionHandler.php +++ /dev/null @@ -1,106 +0,0 @@ -cache = $cache; - $this->minutes = $minutes; - } - - /** - * {@inheritdoc} - * - * @return bool - */ - public function open($savePath, $sessionName): bool - { - return true; - } - - /** - * {@inheritdoc} - * - * @return bool - */ - public function close(): bool - { - return true; - } - - /** - * {@inheritdoc} - * - * @return string - */ - public function read($sessionId): string - { - return $this->cache->get($sessionId, ''); - } - - /** - * {@inheritdoc} - * - * @return bool - */ - public function write($sessionId, $data): bool - { - return $this->cache->put($sessionId, $data, $this->minutes * 60); - } - - /** - * {@inheritdoc} - * - * @return bool - */ - public function destroy($sessionId): bool - { - return $this->cache->forget($sessionId); - } - - /** - * {@inheritdoc} - * - * @return int - */ - public function gc($lifetime): int - { - return 0; - } - - /** - * Get the underlying cache repository. - * - * @return \Illuminate\Contracts\Cache\Repository - */ - public function getCache() - { - return $this->cache; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Session/Console/SessionTableCommand.php b/vendor/laravel/framework/src/Illuminate/Session/Console/SessionTableCommand.php deleted file mode 100644 index e44b2da7..00000000 --- a/vendor/laravel/framework/src/Illuminate/Session/Console/SessionTableCommand.php +++ /dev/null @@ -1,94 +0,0 @@ -files = $files; - $this->composer = $composer; - } - - /** - * Execute the console command. - * - * @return void - */ - public function handle() - { - $fullPath = $this->createBaseMigration(); - - $this->files->put($fullPath, $this->files->get(__DIR__.'/stubs/database.stub')); - - $this->components->info('Migration created successfully.'); - - $this->composer->dumpAutoloads(); - } - - /** - * Create a base migration file for the session. - * - * @return string - */ - protected function createBaseMigration() - { - $name = 'create_sessions_table'; - - $path = $this->laravel->databasePath().'/migrations'; - - return $this->laravel['migration.creator']->create($name, $path); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Session/Console/stubs/database.stub b/vendor/laravel/framework/src/Illuminate/Session/Console/stubs/database.stub deleted file mode 100755 index 06c3e450..00000000 --- a/vendor/laravel/framework/src/Illuminate/Session/Console/stubs/database.stub +++ /dev/null @@ -1,35 +0,0 @@ -string('id')->primary(); - $table->foreignId('user_id')->nullable()->index(); - $table->string('ip_address', 45)->nullable(); - $table->text('user_agent')->nullable(); - $table->longText('payload'); - $table->integer('last_activity')->index(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('sessions'); - } -}; diff --git a/vendor/laravel/framework/src/Illuminate/Session/CookieSessionHandler.php b/vendor/laravel/framework/src/Illuminate/Session/CookieSessionHandler.php deleted file mode 100755 index 213b5cb4..00000000 --- a/vendor/laravel/framework/src/Illuminate/Session/CookieSessionHandler.php +++ /dev/null @@ -1,132 +0,0 @@ -cookie = $cookie; - $this->minutes = $minutes; - } - - /** - * {@inheritdoc} - * - * @return bool - */ - public function open($savePath, $sessionName): bool - { - return true; - } - - /** - * {@inheritdoc} - * - * @return bool - */ - public function close(): bool - { - return true; - } - - /** - * {@inheritdoc} - * - * @return string|false - */ - public function read($sessionId): string|false - { - $value = $this->request->cookies->get($sessionId) ?: ''; - - if (! is_null($decoded = json_decode($value, true)) && is_array($decoded) && - isset($decoded['expires']) && $this->currentTime() <= $decoded['expires']) { - return $decoded['data']; - } - - return ''; - } - - /** - * {@inheritdoc} - * - * @return bool - */ - public function write($sessionId, $data): bool - { - $this->cookie->queue($sessionId, json_encode([ - 'data' => $data, - 'expires' => $this->availableAt($this->minutes * 60), - ]), $this->minutes); - - return true; - } - - /** - * {@inheritdoc} - * - * @return bool - */ - public function destroy($sessionId): bool - { - $this->cookie->queue($this->cookie->forget($sessionId)); - - return true; - } - - /** - * {@inheritdoc} - * - * @return int - */ - public function gc($lifetime): int - { - return 0; - } - - /** - * Set the request instance. - * - * @param \Symfony\Component\HttpFoundation\Request $request - * @return void - */ - public function setRequest(Request $request) - { - $this->request = $request; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Session/DatabaseSessionHandler.php b/vendor/laravel/framework/src/Illuminate/Session/DatabaseSessionHandler.php deleted file mode 100644 index 6cbf6471..00000000 --- a/vendor/laravel/framework/src/Illuminate/Session/DatabaseSessionHandler.php +++ /dev/null @@ -1,319 +0,0 @@ -table = $table; - $this->minutes = $minutes; - $this->container = $container; - $this->connection = $connection; - } - - /** - * {@inheritdoc} - * - * @return bool - */ - public function open($savePath, $sessionName): bool - { - return true; - } - - /** - * {@inheritdoc} - * - * @return bool - */ - public function close(): bool - { - return true; - } - - /** - * {@inheritdoc} - * - * @return string|false - */ - public function read($sessionId): string|false - { - $session = (object) $this->getQuery()->find($sessionId); - - if ($this->expired($session)) { - $this->exists = true; - - return ''; - } - - if (isset($session->payload)) { - $this->exists = true; - - return base64_decode($session->payload); - } - - return ''; - } - - /** - * Determine if the session is expired. - * - * @param \stdClass $session - * @return bool - */ - protected function expired($session) - { - return isset($session->last_activity) && - $session->last_activity < Carbon::now()->subMinutes($this->minutes)->getTimestamp(); - } - - /** - * {@inheritdoc} - * - * @return bool - */ - public function write($sessionId, $data): bool - { - $payload = $this->getDefaultPayload($data); - - if (! $this->exists) { - $this->read($sessionId); - } - - if ($this->exists) { - $this->performUpdate($sessionId, $payload); - } else { - $this->performInsert($sessionId, $payload); - } - - return $this->exists = true; - } - - /** - * Perform an insert operation on the session ID. - * - * @param string $sessionId - * @param array $payload - * @return bool|null - */ - protected function performInsert($sessionId, $payload) - { - try { - return $this->getQuery()->insert(Arr::set($payload, 'id', $sessionId)); - } catch (QueryException $e) { - $this->performUpdate($sessionId, $payload); - } - } - - /** - * Perform an update operation on the session ID. - * - * @param string $sessionId - * @param array $payload - * @return int - */ - protected function performUpdate($sessionId, $payload) - { - return $this->getQuery()->where('id', $sessionId)->update($payload); - } - - /** - * Get the default payload for the session. - * - * @param string $data - * @return array - */ - protected function getDefaultPayload($data) - { - $payload = [ - 'payload' => base64_encode($data), - 'last_activity' => $this->currentTime(), - ]; - - if (! $this->container) { - return $payload; - } - - return tap($payload, function (&$payload) { - $this->addUserInformation($payload) - ->addRequestInformation($payload); - }); - } - - /** - * Add the user information to the session payload. - * - * @param array $payload - * @return $this - */ - protected function addUserInformation(&$payload) - { - if ($this->container->bound(Guard::class)) { - $payload['user_id'] = $this->userId(); - } - - return $this; - } - - /** - * Get the currently authenticated user's ID. - * - * @return mixed - */ - protected function userId() - { - return $this->container->make(Guard::class)->id(); - } - - /** - * Add the request information to the session payload. - * - * @param array $payload - * @return $this - */ - protected function addRequestInformation(&$payload) - { - if ($this->container->bound('request')) { - $payload = array_merge($payload, [ - 'ip_address' => $this->ipAddress(), - 'user_agent' => $this->userAgent(), - ]); - } - - return $this; - } - - /** - * Get the IP address for the current request. - * - * @return string - */ - protected function ipAddress() - { - return $this->container->make('request')->ip(); - } - - /** - * Get the user agent for the current request. - * - * @return string - */ - protected function userAgent() - { - return substr((string) $this->container->make('request')->header('User-Agent'), 0, 500); - } - - /** - * {@inheritdoc} - * - * @return bool - */ - public function destroy($sessionId): bool - { - $this->getQuery()->where('id', $sessionId)->delete(); - - return true; - } - - /** - * {@inheritdoc} - * - * @return int - */ - public function gc($lifetime): int - { - return $this->getQuery()->where('last_activity', '<=', $this->currentTime() - $lifetime)->delete(); - } - - /** - * Get a fresh query builder instance for the table. - * - * @return \Illuminate\Database\Query\Builder - */ - protected function getQuery() - { - return $this->connection->table($this->table); - } - - /** - * Set the application instance used by the handler. - * - * @param \Illuminate\Contracts\Foundation\Application $container - * @return $this - */ - public function setContainer($container) - { - $this->container = $container; - - return $this; - } - - /** - * Set the existence state for the session. - * - * @param bool $value - * @return $this - */ - public function setExists($value) - { - $this->exists = $value; - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Session/EncryptedStore.php b/vendor/laravel/framework/src/Illuminate/Session/EncryptedStore.php deleted file mode 100644 index b8ae8cfa..00000000 --- a/vendor/laravel/framework/src/Illuminate/Session/EncryptedStore.php +++ /dev/null @@ -1,70 +0,0 @@ -encrypter = $encrypter; - - parent::__construct($name, $handler, $id, $serialization); - } - - /** - * Prepare the raw string data from the session for unserialization. - * - * @param string $data - * @return string - */ - protected function prepareForUnserialize($data) - { - try { - return $this->encrypter->decrypt($data); - } catch (DecryptException $e) { - return $this->serialization === 'json' ? json_encode([]) : serialize([]); - } - } - - /** - * Prepare the serialized session data for storage. - * - * @param string $data - * @return string - */ - protected function prepareForStorage($data) - { - return $this->encrypter->encrypt($data); - } - - /** - * Get the encrypter instance. - * - * @return \Illuminate\Contracts\Encryption\Encrypter - */ - public function getEncrypter() - { - return $this->encrypter; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Session/ExistenceAwareInterface.php b/vendor/laravel/framework/src/Illuminate/Session/ExistenceAwareInterface.php deleted file mode 100644 index 4a6bd984..00000000 --- a/vendor/laravel/framework/src/Illuminate/Session/ExistenceAwareInterface.php +++ /dev/null @@ -1,14 +0,0 @@ -path = $path; - $this->files = $files; - $this->minutes = $minutes; - } - - /** - * {@inheritdoc} - * - * @return bool - */ - public function open($savePath, $sessionName): bool - { - return true; - } - - /** - * {@inheritdoc} - * - * @return bool - */ - public function close(): bool - { - return true; - } - - /** - * {@inheritdoc} - * - * @return string|false - */ - public function read($sessionId): string|false - { - if ($this->files->isFile($path = $this->path.'/'.$sessionId) && - $this->files->lastModified($path) >= Carbon::now()->subMinutes($this->minutes)->getTimestamp()) { - return $this->files->sharedGet($path); - } - - return ''; - } - - /** - * {@inheritdoc} - * - * @return bool - */ - public function write($sessionId, $data): bool - { - $this->files->put($this->path.'/'.$sessionId, $data, true); - - return true; - } - - /** - * {@inheritdoc} - * - * @return bool - */ - public function destroy($sessionId): bool - { - $this->files->delete($this->path.'/'.$sessionId); - - return true; - } - - /** - * {@inheritdoc} - * - * @return int - */ - public function gc($lifetime): int - { - $files = Finder::create() - ->in($this->path) - ->files() - ->ignoreDotFiles(true) - ->date('<= now - '.$lifetime.' seconds'); - - $deletedSessions = 0; - - foreach ($files as $file) { - $this->files->delete($file->getRealPath()); - $deletedSessions++; - } - - return $deletedSessions; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Session/LICENSE.md b/vendor/laravel/framework/src/Illuminate/Session/LICENSE.md deleted file mode 100644 index 79810c84..00000000 --- a/vendor/laravel/framework/src/Illuminate/Session/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Taylor Otwell - -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/laravel/framework/src/Illuminate/Session/Middleware/AuthenticateSession.php b/vendor/laravel/framework/src/Illuminate/Session/Middleware/AuthenticateSession.php deleted file mode 100644 index 1b3cee37..00000000 --- a/vendor/laravel/framework/src/Illuminate/Session/Middleware/AuthenticateSession.php +++ /dev/null @@ -1,109 +0,0 @@ -auth = $auth; - } - - /** - * Handle an incoming request. - * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @return mixed - */ - public function handle($request, Closure $next) - { - if (! $request->hasSession() || ! $request->user()) { - return $next($request); - } - - if ($this->guard()->viaRemember()) { - $passwordHash = explode('|', $request->cookies->get($this->guard()->getRecallerName()))[2] ?? null; - - if (! $passwordHash || $passwordHash != $request->user()->getAuthPassword()) { - $this->logout($request); - } - } - - if (! $request->session()->has('password_hash_'.$this->auth->getDefaultDriver())) { - $this->storePasswordHashInSession($request); - } - - if ($request->session()->get('password_hash_'.$this->auth->getDefaultDriver()) !== $request->user()->getAuthPassword()) { - $this->logout($request); - } - - return tap($next($request), function () use ($request) { - if (! is_null($this->guard()->user())) { - $this->storePasswordHashInSession($request); - } - }); - } - - /** - * Store the user's current password hash in the session. - * - * @param \Illuminate\Http\Request $request - * @return void - */ - protected function storePasswordHashInSession($request) - { - if (! $request->user()) { - return; - } - - $request->session()->put([ - 'password_hash_'.$this->auth->getDefaultDriver() => $request->user()->getAuthPassword(), - ]); - } - - /** - * Log the user out of the application. - * - * @param \Illuminate\Http\Request $request - * @return void - * - * @throws \Illuminate\Auth\AuthenticationException - */ - protected function logout($request) - { - $this->guard()->logoutCurrentDevice(); - - $request->session()->flush(); - - throw new AuthenticationException('Unauthenticated.', [$this->auth->getDefaultDriver()]); - } - - /** - * Get the guard instance that should be used by the middleware. - * - * @return \Illuminate\Contracts\Auth\Factory|\Illuminate\Contracts\Auth\Guard - */ - protected function guard() - { - return $this->auth; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php b/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php deleted file mode 100644 index 8079ab9c..00000000 --- a/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php +++ /dev/null @@ -1,299 +0,0 @@ -manager = $manager; - $this->cacheFactoryResolver = $cacheFactoryResolver; - } - - /** - * Handle an incoming request. - * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @return mixed - */ - public function handle($request, Closure $next) - { - if (! $this->sessionConfigured()) { - return $next($request); - } - - $session = $this->getSession($request); - - if ($this->manager->shouldBlock() || - ($request->route() instanceof Route && $request->route()->locksFor())) { - return $this->handleRequestWhileBlocking($request, $session, $next); - } - - return $this->handleStatefulRequest($request, $session, $next); - } - - /** - * Handle the given request within session state. - * - * @param \Illuminate\Http\Request $request - * @param \Illuminate\Contracts\Session\Session $session - * @param \Closure $next - * @return mixed - */ - protected function handleRequestWhileBlocking(Request $request, $session, Closure $next) - { - if (! $request->route() instanceof Route) { - return; - } - - $lockFor = $request->route() && $request->route()->locksFor() - ? $request->route()->locksFor() - : 10; - - $lock = $this->cache($this->manager->blockDriver()) - ->lock('session:'.$session->getId(), $lockFor) - ->betweenBlockedAttemptsSleepFor(50); - - try { - $lock->block( - ! is_null($request->route()->waitsFor()) - ? $request->route()->waitsFor() - : 10 - ); - - return $this->handleStatefulRequest($request, $session, $next); - } finally { - $lock?->release(); - } - } - - /** - * Handle the given request within session state. - * - * @param \Illuminate\Http\Request $request - * @param \Illuminate\Contracts\Session\Session $session - * @param \Closure $next - * @return mixed - */ - protected function handleStatefulRequest(Request $request, $session, Closure $next) - { - // If a session driver has been configured, we will need to start the session here - // so that the data is ready for an application. Note that the Laravel sessions - // do not make use of PHP "native" sessions in any way since they are crappy. - $request->setLaravelSession( - $this->startSession($request, $session) - ); - - $this->collectGarbage($session); - - $response = $next($request); - - $this->storeCurrentUrl($request, $session); - - $this->addCookieToResponse($response, $session); - - // Again, if the session has been configured we will need to close out the session - // so that the attributes may be persisted to some storage medium. We will also - // add the session identifier cookie to the application response headers now. - $this->saveSession($request); - - return $response; - } - - /** - * Start the session for the given request. - * - * @param \Illuminate\Http\Request $request - * @param \Illuminate\Contracts\Session\Session $session - * @return \Illuminate\Contracts\Session\Session - */ - protected function startSession(Request $request, $session) - { - return tap($session, function ($session) use ($request) { - $session->setRequestOnHandler($request); - - $session->start(); - }); - } - - /** - * Get the session implementation from the manager. - * - * @param \Illuminate\Http\Request $request - * @return \Illuminate\Contracts\Session\Session - */ - public function getSession(Request $request) - { - return tap($this->manager->driver(), function ($session) use ($request) { - $session->setId($request->cookies->get($session->getName())); - }); - } - - /** - * Remove the garbage from the session if necessary. - * - * @param \Illuminate\Contracts\Session\Session $session - * @return void - */ - protected function collectGarbage(Session $session) - { - $config = $this->manager->getSessionConfig(); - - // Here we will see if this request hits the garbage collection lottery by hitting - // the odds needed to perform garbage collection on any given request. If we do - // hit it, we'll call this handler to let it delete all the expired sessions. - if ($this->configHitsLottery($config)) { - $session->getHandler()->gc($this->getSessionLifetimeInSeconds()); - } - } - - /** - * Determine if the configuration odds hit the lottery. - * - * @param array $config - * @return bool - */ - protected function configHitsLottery(array $config) - { - return random_int(1, $config['lottery'][1]) <= $config['lottery'][0]; - } - - /** - * Store the current URL for the request if necessary. - * - * @param \Illuminate\Http\Request $request - * @param \Illuminate\Contracts\Session\Session $session - * @return void - */ - protected function storeCurrentUrl(Request $request, $session) - { - if ($request->isMethod('GET') && - $request->route() instanceof Route && - ! $request->ajax() && - ! $request->prefetch() && - ! $request->isPrecognitive()) { - $session->setPreviousUrl($request->fullUrl()); - } - } - - /** - * Add the session cookie to the application response. - * - * @param \Symfony\Component\HttpFoundation\Response $response - * @param \Illuminate\Contracts\Session\Session $session - * @return void - */ - protected function addCookieToResponse(Response $response, Session $session) - { - if ($this->sessionIsPersistent($config = $this->manager->getSessionConfig())) { - $response->headers->setCookie(new Cookie( - $session->getName(), $session->getId(), $this->getCookieExpirationDate(), - $config['path'], $config['domain'], $config['secure'] ?? false, - $config['http_only'] ?? true, false, $config['same_site'] ?? null - )); - } - } - - /** - * Save the session data to storage. - * - * @param \Illuminate\Http\Request $request - * @return void - */ - protected function saveSession($request) - { - if (! $request->isPrecognitive()) { - $this->manager->driver()->save(); - } - } - - /** - * Get the session lifetime in seconds. - * - * @return int - */ - protected function getSessionLifetimeInSeconds() - { - return ($this->manager->getSessionConfig()['lifetime'] ?? null) * 60; - } - - /** - * Get the cookie lifetime in seconds. - * - * @return \DateTimeInterface|int - */ - protected function getCookieExpirationDate() - { - $config = $this->manager->getSessionConfig(); - - return $config['expire_on_close'] ? 0 : Date::instance( - Carbon::now()->addRealMinutes($config['lifetime']) - ); - } - - /** - * Determine if a session driver has been configured. - * - * @return bool - */ - protected function sessionConfigured() - { - return ! is_null($this->manager->getSessionConfig()['driver'] ?? null); - } - - /** - * Determine if the configured session driver is persistent. - * - * @param array|null $config - * @return bool - */ - protected function sessionIsPersistent(array $config = null) - { - $config = $config ?: $this->manager->getSessionConfig(); - - return ! is_null($config['driver'] ?? null); - } - - /** - * Resolve the given cache driver. - * - * @param string $driver - * @return \Illuminate\Cache\Store - */ - protected function cache($driver) - { - return call_user_func($this->cacheFactoryResolver)->driver($driver); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Session/NullSessionHandler.php b/vendor/laravel/framework/src/Illuminate/Session/NullSessionHandler.php deleted file mode 100644 index fbebd5d7..00000000 --- a/vendor/laravel/framework/src/Illuminate/Session/NullSessionHandler.php +++ /dev/null @@ -1,68 +0,0 @@ -buildSession(parent::callCustomCreator($driver)); - } - - /** - * Create an instance of the "null" session driver. - * - * @return \Illuminate\Session\Store - */ - protected function createNullDriver() - { - return $this->buildSession(new NullSessionHandler); - } - - /** - * Create an instance of the "array" session driver. - * - * @return \Illuminate\Session\Store - */ - protected function createArrayDriver() - { - return $this->buildSession(new ArraySessionHandler( - $this->config->get('session.lifetime') - )); - } - - /** - * Create an instance of the "cookie" session driver. - * - * @return \Illuminate\Session\Store - */ - protected function createCookieDriver() - { - return $this->buildSession(new CookieSessionHandler( - $this->container->make('cookie'), $this->config->get('session.lifetime') - )); - } - - /** - * Create an instance of the file session driver. - * - * @return \Illuminate\Session\Store - */ - protected function createFileDriver() - { - return $this->createNativeDriver(); - } - - /** - * Create an instance of the file session driver. - * - * @return \Illuminate\Session\Store - */ - protected function createNativeDriver() - { - $lifetime = $this->config->get('session.lifetime'); - - return $this->buildSession(new FileSessionHandler( - $this->container->make('files'), $this->config->get('session.files'), $lifetime - )); - } - - /** - * Create an instance of the database session driver. - * - * @return \Illuminate\Session\Store - */ - protected function createDatabaseDriver() - { - $table = $this->config->get('session.table'); - - $lifetime = $this->config->get('session.lifetime'); - - return $this->buildSession(new DatabaseSessionHandler( - $this->getDatabaseConnection(), $table, $lifetime, $this->container - )); - } - - /** - * Get the database connection for the database driver. - * - * @return \Illuminate\Database\Connection - */ - protected function getDatabaseConnection() - { - $connection = $this->config->get('session.connection'); - - return $this->container->make('db')->connection($connection); - } - - /** - * Create an instance of the APC session driver. - * - * @return \Illuminate\Session\Store - */ - protected function createApcDriver() - { - return $this->createCacheBased('apc'); - } - - /** - * Create an instance of the Memcached session driver. - * - * @return \Illuminate\Session\Store - */ - protected function createMemcachedDriver() - { - return $this->createCacheBased('memcached'); - } - - /** - * Create an instance of the Redis session driver. - * - * @return \Illuminate\Session\Store - */ - protected function createRedisDriver() - { - $handler = $this->createCacheHandler('redis'); - - $handler->getCache()->getStore()->setConnection( - $this->config->get('session.connection') - ); - - return $this->buildSession($handler); - } - - /** - * Create an instance of the DynamoDB session driver. - * - * @return \Illuminate\Session\Store - */ - protected function createDynamodbDriver() - { - return $this->createCacheBased('dynamodb'); - } - - /** - * Create an instance of a cache driven driver. - * - * @param string $driver - * @return \Illuminate\Session\Store - */ - protected function createCacheBased($driver) - { - return $this->buildSession($this->createCacheHandler($driver)); - } - - /** - * Create the cache based session handler instance. - * - * @param string $driver - * @return \Illuminate\Session\CacheBasedSessionHandler - */ - protected function createCacheHandler($driver) - { - $store = $this->config->get('session.store') ?: $driver; - - return new CacheBasedSessionHandler( - clone $this->container->make('cache')->store($store), - $this->config->get('session.lifetime') - ); - } - - /** - * Build the session instance. - * - * @param \SessionHandlerInterface $handler - * @return \Illuminate\Session\Store - */ - protected function buildSession($handler) - { - return $this->config->get('session.encrypt') - ? $this->buildEncryptedSession($handler) - : new Store( - $this->config->get('session.cookie'), - $handler, - $id = null, - $this->config->get('session.serialization', 'php') - ); - } - - /** - * Build the encrypted session instance. - * - * @param \SessionHandlerInterface $handler - * @return \Illuminate\Session\EncryptedStore - */ - protected function buildEncryptedSession($handler) - { - return new EncryptedStore( - $this->config->get('session.cookie'), - $handler, - $this->container['encrypter'], - $id = null, - $this->config->get('session.serialization', 'php'), - ); - } - - /** - * Determine if requests for the same session should wait for each to finish before executing. - * - * @return bool - */ - public function shouldBlock() - { - return $this->config->get('session.block', false); - } - - /** - * Get the name of the cache store / driver that should be used to acquire session locks. - * - * @return string|null - */ - public function blockDriver() - { - return $this->config->get('session.block_store'); - } - - /** - * Get the session configuration. - * - * @return array - */ - public function getSessionConfig() - { - return $this->config->get('session'); - } - - /** - * Get the default session driver name. - * - * @return string - */ - public function getDefaultDriver() - { - return $this->config->get('session.driver'); - } - - /** - * Set the default session driver name. - * - * @param string $name - * @return void - */ - public function setDefaultDriver($name) - { - $this->config->set('session.driver', $name); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Session/SessionServiceProvider.php b/vendor/laravel/framework/src/Illuminate/Session/SessionServiceProvider.php deleted file mode 100755 index d1108e3a..00000000 --- a/vendor/laravel/framework/src/Illuminate/Session/SessionServiceProvider.php +++ /dev/null @@ -1,55 +0,0 @@ -registerSessionManager(); - - $this->registerSessionDriver(); - - $this->app->singleton(StartSession::class, function ($app) { - return new StartSession($app->make(SessionManager::class), function () use ($app) { - return $app->make(CacheFactory::class); - }); - }); - } - - /** - * Register the session manager instance. - * - * @return void - */ - protected function registerSessionManager() - { - $this->app->singleton('session', function ($app) { - return new SessionManager($app); - }); - } - - /** - * Register the session driver instance. - * - * @return void - */ - protected function registerSessionDriver() - { - $this->app->singleton('session.store', function ($app) { - // First, we will create the session manager which is responsible for the - // creation of the various session drivers when they are needed by the - // application instance, and will resolve them on a lazy load basis. - return $app->make('session')->driver(); - }); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Session/Store.php b/vendor/laravel/framework/src/Illuminate/Session/Store.php deleted file mode 100755 index b78b54c8..00000000 --- a/vendor/laravel/framework/src/Illuminate/Session/Store.php +++ /dev/null @@ -1,771 +0,0 @@ -setId($id); - $this->name = $name; - $this->handler = $handler; - $this->serialization = $serialization; - } - - /** - * Start the session, reading the data from a handler. - * - * @return bool - */ - public function start() - { - $this->loadSession(); - - if (! $this->has('_token')) { - $this->regenerateToken(); - } - - return $this->started = true; - } - - /** - * Load the session data from the handler. - * - * @return void - */ - protected function loadSession() - { - $this->attributes = array_merge($this->attributes, $this->readFromHandler()); - - $this->marshalErrorBag(); - } - - /** - * Read the session data from the handler. - * - * @return array - */ - protected function readFromHandler() - { - if ($data = $this->handler->read($this->getId())) { - if ($this->serialization === 'json') { - $data = json_decode($this->prepareForUnserialize($data), true); - } else { - $data = @unserialize($this->prepareForUnserialize($data)); - } - - if ($data !== false && is_array($data)) { - return $data; - } - } - - return []; - } - - /** - * Prepare the raw string data from the session for unserialization. - * - * @param string $data - * @return string - */ - protected function prepareForUnserialize($data) - { - return $data; - } - - /** - * Marshal the ViewErrorBag when using JSON serialization for sessions. - * - * @return void - */ - protected function marshalErrorBag() - { - if ($this->serialization !== 'json' || $this->missing('errors')) { - return; - } - - $errorBag = new ViewErrorBag; - - foreach ($this->get('errors') as $key => $value) { - $messageBag = new MessageBag($value['messages']); - - $errorBag->put($key, $messageBag->setFormat($value['format'])); - } - - $this->put('errors', $errorBag); - } - - /** - * Save the session data to storage. - * - * @return void - */ - public function save() - { - $this->ageFlashData(); - - $this->prepareErrorBagForSerialization(); - - $this->handler->write($this->getId(), $this->prepareForStorage( - $this->serialization === 'json' ? json_encode($this->attributes) : serialize($this->attributes) - )); - - $this->started = false; - } - - /** - * Prepare the ViewErrorBag instance for JSON serialization. - * - * @return void - */ - protected function prepareErrorBagForSerialization() - { - if ($this->serialization !== 'json' || $this->missing('errors')) { - return; - } - - $errors = []; - - foreach ($this->attributes['errors']->getBags() as $key => $value) { - $errors[$key] = [ - 'format' => $value->getFormat(), - 'messages' => $value->getMessages(), - ]; - } - - $this->attributes['errors'] = $errors; - } - - /** - * Prepare the serialized session data for storage. - * - * @param string $data - * @return string - */ - protected function prepareForStorage($data) - { - return $data; - } - - /** - * Age the flash data for the session. - * - * @return void - */ - public function ageFlashData() - { - $this->forget($this->get('_flash.old', [])); - - $this->put('_flash.old', $this->get('_flash.new', [])); - - $this->put('_flash.new', []); - } - - /** - * Get all of the session data. - * - * @return array - */ - public function all() - { - return $this->attributes; - } - - /** - * Get a subset of the session data. - * - * @param array $keys - * @return array - */ - public function only(array $keys) - { - return Arr::only($this->attributes, $keys); - } - - /** - * Checks if a key exists. - * - * @param string|array $key - * @return bool - */ - public function exists($key) - { - $placeholder = new stdClass; - - return ! collect(is_array($key) ? $key : func_get_args())->contains(function ($key) use ($placeholder) { - return $this->get($key, $placeholder) === $placeholder; - }); - } - - /** - * Determine if the given key is missing from the session data. - * - * @param string|array $key - * @return bool - */ - public function missing($key) - { - return ! $this->exists($key); - } - - /** - * Checks if a key is present and not null. - * - * @param string|array $key - * @return bool - */ - public function has($key) - { - return ! collect(is_array($key) ? $key : func_get_args())->contains(function ($key) { - return is_null($this->get($key)); - }); - } - - /** - * Get an item from the session. - * - * @param string $key - * @param mixed $default - * @return mixed - */ - public function get($key, $default = null) - { - return Arr::get($this->attributes, $key, $default); - } - - /** - * Get the value of a given key and then forget it. - * - * @param string $key - * @param mixed $default - * @return mixed - */ - public function pull($key, $default = null) - { - return Arr::pull($this->attributes, $key, $default); - } - - /** - * Determine if the session contains old input. - * - * @param string|null $key - * @return bool - */ - public function hasOldInput($key = null) - { - $old = $this->getOldInput($key); - - return is_null($key) ? count($old) > 0 : ! is_null($old); - } - - /** - * Get the requested item from the flashed input array. - * - * @param string|null $key - * @param mixed $default - * @return mixed - */ - public function getOldInput($key = null, $default = null) - { - return Arr::get($this->get('_old_input', []), $key, $default); - } - - /** - * Replace the given session attributes entirely. - * - * @param array $attributes - * @return void - */ - public function replace(array $attributes) - { - $this->put($attributes); - } - - /** - * Put a key / value pair or array of key / value pairs in the session. - * - * @param string|array $key - * @param mixed $value - * @return void - */ - public function put($key, $value = null) - { - if (! is_array($key)) { - $key = [$key => $value]; - } - - foreach ($key as $arrayKey => $arrayValue) { - Arr::set($this->attributes, $arrayKey, $arrayValue); - } - } - - /** - * Get an item from the session, or store the default value. - * - * @param string $key - * @param \Closure $callback - * @return mixed - */ - public function remember($key, Closure $callback) - { - if (! is_null($value = $this->get($key))) { - return $value; - } - - return tap($callback(), function ($value) use ($key) { - $this->put($key, $value); - }); - } - - /** - * Push a value onto a session array. - * - * @param string $key - * @param mixed $value - * @return void - */ - public function push($key, $value) - { - $array = $this->get($key, []); - - $array[] = $value; - - $this->put($key, $array); - } - - /** - * Increment the value of an item in the session. - * - * @param string $key - * @param int $amount - * @return mixed - */ - public function increment($key, $amount = 1) - { - $this->put($key, $value = $this->get($key, 0) + $amount); - - return $value; - } - - /** - * Decrement the value of an item in the session. - * - * @param string $key - * @param int $amount - * @return int - */ - public function decrement($key, $amount = 1) - { - return $this->increment($key, $amount * -1); - } - - /** - * Flash a key / value pair to the session. - * - * @param string $key - * @param mixed $value - * @return void - */ - public function flash(string $key, $value = true) - { - $this->put($key, $value); - - $this->push('_flash.new', $key); - - $this->removeFromOldFlashData([$key]); - } - - /** - * Flash a key / value pair to the session for immediate use. - * - * @param string $key - * @param mixed $value - * @return void - */ - public function now($key, $value) - { - $this->put($key, $value); - - $this->push('_flash.old', $key); - } - - /** - * Reflash all of the session flash data. - * - * @return void - */ - public function reflash() - { - $this->mergeNewFlashes($this->get('_flash.old', [])); - - $this->put('_flash.old', []); - } - - /** - * Reflash a subset of the current flash data. - * - * @param array|mixed $keys - * @return void - */ - public function keep($keys = null) - { - $this->mergeNewFlashes($keys = is_array($keys) ? $keys : func_get_args()); - - $this->removeFromOldFlashData($keys); - } - - /** - * Merge new flash keys into the new flash array. - * - * @param array $keys - * @return void - */ - protected function mergeNewFlashes(array $keys) - { - $values = array_unique(array_merge($this->get('_flash.new', []), $keys)); - - $this->put('_flash.new', $values); - } - - /** - * Remove the given keys from the old flash data. - * - * @param array $keys - * @return void - */ - protected function removeFromOldFlashData(array $keys) - { - $this->put('_flash.old', array_diff($this->get('_flash.old', []), $keys)); - } - - /** - * Flash an input array to the session. - * - * @param array $value - * @return void - */ - public function flashInput(array $value) - { - $this->flash('_old_input', $value); - } - - /** - * Remove an item from the session, returning its value. - * - * @param string $key - * @return mixed - */ - public function remove($key) - { - return Arr::pull($this->attributes, $key); - } - - /** - * Remove one or many items from the session. - * - * @param string|array $keys - * @return void - */ - public function forget($keys) - { - Arr::forget($this->attributes, $keys); - } - - /** - * Remove all of the items from the session. - * - * @return void - */ - public function flush() - { - $this->attributes = []; - } - - /** - * Flush the session data and regenerate the ID. - * - * @return bool - */ - public function invalidate() - { - $this->flush(); - - return $this->migrate(true); - } - - /** - * Generate a new session identifier. - * - * @param bool $destroy - * @return bool - */ - public function regenerate($destroy = false) - { - return tap($this->migrate($destroy), function () { - $this->regenerateToken(); - }); - } - - /** - * Generate a new session ID for the session. - * - * @param bool $destroy - * @return bool - */ - public function migrate($destroy = false) - { - if ($destroy) { - $this->handler->destroy($this->getId()); - } - - $this->setExists(false); - - $this->setId($this->generateSessionId()); - - return true; - } - - /** - * Determine if the session has been started. - * - * @return bool - */ - public function isStarted() - { - return $this->started; - } - - /** - * Get the name of the session. - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Set the name of the session. - * - * @param string $name - * @return void - */ - public function setName($name) - { - $this->name = $name; - } - - /** - * Get the current session ID. - * - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Set the session ID. - * - * @param string $id - * @return void - */ - public function setId($id) - { - $this->id = $this->isValidId($id) ? $id : $this->generateSessionId(); - } - - /** - * Determine if this is a valid session ID. - * - * @param string $id - * @return bool - */ - public function isValidId($id) - { - return is_string($id) && ctype_alnum($id) && strlen($id) === 40; - } - - /** - * Get a new, random session ID. - * - * @return string - */ - protected function generateSessionId() - { - return Str::random(40); - } - - /** - * Set the existence of the session on the handler if applicable. - * - * @param bool $value - * @return void - */ - public function setExists($value) - { - if ($this->handler instanceof ExistenceAwareInterface) { - $this->handler->setExists($value); - } - } - - /** - * Get the CSRF token value. - * - * @return string - */ - public function token() - { - return $this->get('_token'); - } - - /** - * Regenerate the CSRF token value. - * - * @return void - */ - public function regenerateToken() - { - $this->put('_token', Str::random(40)); - } - - /** - * Get the previous URL from the session. - * - * @return string|null - */ - public function previousUrl() - { - return $this->get('_previous.url'); - } - - /** - * Set the "previous" URL in the session. - * - * @param string $url - * @return void - */ - public function setPreviousUrl($url) - { - $this->put('_previous.url', $url); - } - - /** - * Specify that the user has confirmed their password. - * - * @return void - */ - public function passwordConfirmed() - { - $this->put('auth.password_confirmed_at', time()); - } - - /** - * Get the underlying session handler implementation. - * - * @return \SessionHandlerInterface - */ - public function getHandler() - { - return $this->handler; - } - - /** - * Set the underlying session handler implementation. - * - * @param \SessionHandlerInterface $handler - * @return void - */ - public function setHandler(SessionHandlerInterface $handler) - { - return $this->handler = $handler; - } - - /** - * Determine if the session handler needs a request. - * - * @return bool - */ - public function handlerNeedsRequest() - { - return $this->handler instanceof CookieSessionHandler; - } - - /** - * Set the request on the handler instance. - * - * @param \Illuminate\Http\Request $request - * @return void - */ - public function setRequestOnHandler($request) - { - if ($this->handlerNeedsRequest()) { - $this->handler->setRequest($request); - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Session/SymfonySessionDecorator.php b/vendor/laravel/framework/src/Illuminate/Session/SymfonySessionDecorator.php deleted file mode 100644 index 889560b1..00000000 --- a/vendor/laravel/framework/src/Illuminate/Session/SymfonySessionDecorator.php +++ /dev/null @@ -1,186 +0,0 @@ -store = $store; - } - - /** - * {@inheritdoc} - */ - public function start(): bool - { - return $this->store->start(); - } - - /** - * {@inheritdoc} - */ - public function getId(): string - { - return $this->store->getId(); - } - - /** - * {@inheritdoc} - */ - public function setId(string $id) - { - $this->store->setId($id); - } - - /** - * {@inheritdoc} - */ - public function getName(): string - { - return $this->store->getName(); - } - - /** - * {@inheritdoc} - */ - public function setName(string $name) - { - $this->store->setName($name); - } - - /** - * {@inheritdoc} - */ - public function invalidate(int $lifetime = null): bool - { - $this->store->invalidate(); - - return true; - } - - /** - * {@inheritdoc} - */ - public function migrate(bool $destroy = false, int $lifetime = null): bool - { - $this->store->migrate($destroy); - - return true; - } - - /** - * {@inheritdoc} - */ - public function save() - { - $this->store->save(); - } - - /** - * {@inheritdoc} - */ - public function has(string $name): bool - { - return $this->store->has($name); - } - - /** - * {@inheritdoc} - */ - public function get(string $name, mixed $default = null): mixed - { - return $this->store->get($name, $default); - } - - /** - * {@inheritdoc} - */ - public function set(string $name, mixed $value) - { - $this->store->put($name, $value); - } - - /** - * {@inheritdoc} - */ - public function all(): array - { - return $this->store->all(); - } - - /** - * {@inheritdoc} - */ - public function replace(array $attributes) - { - $this->store->replace($attributes); - } - - /** - * {@inheritdoc} - */ - public function remove(string $name): mixed - { - return $this->store->remove($name); - } - - /** - * {@inheritdoc} - */ - public function clear() - { - $this->store->flush(); - } - - /** - * {@inheritdoc} - */ - public function isStarted(): bool - { - return $this->store->isStarted(); - } - - /** - * {@inheritdoc} - */ - public function registerBag(SessionBagInterface $bag) - { - throw new BadMethodCallException('Method not implemented by Laravel.'); - } - - /** - * {@inheritdoc} - */ - public function getBag(string $name): SessionBagInterface - { - throw new BadMethodCallException('Method not implemented by Laravel.'); - } - - /** - * {@inheritdoc} - */ - public function getMetadataBag(): MetadataBag - { - throw new BadMethodCallException('Method not implemented by Laravel.'); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Session/TokenMismatchException.php b/vendor/laravel/framework/src/Illuminate/Session/TokenMismatchException.php deleted file mode 100755 index 98d99a1e..00000000 --- a/vendor/laravel/framework/src/Illuminate/Session/TokenMismatchException.php +++ /dev/null @@ -1,10 +0,0 @@ -instances = []; - - foreach ($this->providers as $provider) { - $this->instances[] = $this->app->register($provider); - } - } - - /** - * Get the services provided by the provider. - * - * @return array - */ - public function provides() - { - $provides = []; - - foreach ($this->providers as $provider) { - $instance = $this->app->resolveProvider($provider); - - $provides = array_merge($provides, $instance->provides()); - } - - return $provides; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Benchmark.php b/vendor/laravel/framework/src/Illuminate/Support/Benchmark.php deleted file mode 100644 index 3a09d592..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Benchmark.php +++ /dev/null @@ -1,50 +0,0 @@ -map(function ($callback) use ($iterations) { - return collect(range(1, $iterations))->map(function () use ($callback) { - gc_collect_cycles(); - - $start = hrtime(true); - - $callback(); - - return (hrtime(true) - $start) / 1000000; - })->average(); - })->when( - $benchmarkables instanceof Closure, - fn ($c) => $c->first(), - fn ($c) => $c->all(), - ); - } - - /** - * Measure a callable or array of callables over the given number of iterations, then dump and die. - * - * @param \Closure|array $benchmarkables - * @param int $iterations - * @return never - */ - public static function dd(Closure|array $benchmarkables, int $iterations = 1): void - { - $result = collect(static::measure(Arr::wrap($benchmarkables), $iterations)) - ->map(fn ($average) => number_format($average, 3).'ms') - ->when($benchmarkables instanceof Closure, fn ($c) => $c->first(), fn ($c) => $c->all()); - - dd($result); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Carbon.php b/vendor/laravel/framework/src/Illuminate/Support/Carbon.php deleted file mode 100644 index 972d7eb7..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Carbon.php +++ /dev/null @@ -1,21 +0,0 @@ -files = $files; - $this->workingPath = $workingPath; - } - - /** - * Regenerate the Composer autoloader files. - * - * @param string|array $extra - * @return int - */ - public function dumpAutoloads($extra = '') - { - $extra = $extra ? (array) $extra : []; - - $command = array_merge($this->findComposer(), ['dump-autoload'], $extra); - - return $this->getProcess($command)->run(); - } - - /** - * Regenerate the optimized Composer autoloader files. - * - * @return int - */ - public function dumpOptimized() - { - return $this->dumpAutoloads('--optimize'); - } - - /** - * Get the composer command for the environment. - * - * @return array - */ - public function findComposer() - { - if ($this->files->exists($this->workingPath.'/composer.phar')) { - return [$this->phpBinary(), 'composer.phar']; - } - - return ['composer']; - } - - /** - * Get the PHP binary. - * - * @return string - */ - protected function phpBinary() - { - return ProcessUtils::escapeArgument((new PhpExecutableFinder)->find(false)); - } - - /** - * Get a new Symfony process instance. - * - * @param array $command - * @return \Symfony\Component\Process\Process - */ - protected function getProcess(array $command) - { - return (new Process($command, $this->workingPath))->setTimeout(null); - } - - /** - * Set the working path used by the class. - * - * @param string $path - * @return $this - */ - public function setWorkingPath($path) - { - $this->workingPath = realpath($path); - - return $this; - } - - /** - * Get the version of Composer. - * - * @return string|null - */ - public function getVersion() - { - $command = array_merge($this->findComposer(), ['-V', '--no-ansi']); - - $process = $this->getProcess($command); - - $process->run(); - - $output = $process->getOutput(); - - if (preg_match('/(\d+(\.\d+){2})/', $output, $version)) { - return $version[1]; - } - - return explode(' ', $output)[2] ?? null; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/ConfigurationUrlParser.php b/vendor/laravel/framework/src/Illuminate/Support/ConfigurationUrlParser.php deleted file mode 100644 index a1b93370..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/ConfigurationUrlParser.php +++ /dev/null @@ -1,191 +0,0 @@ - 'sqlsrv', - 'mysql2' => 'mysql', // RDS - 'postgres' => 'pgsql', - 'postgresql' => 'pgsql', - 'sqlite3' => 'sqlite', - 'redis' => 'tcp', - 'rediss' => 'tls', - ]; - - /** - * Parse the database configuration, hydrating options using a database configuration URL if possible. - * - * @param array|string $config - * @return array - */ - public function parseConfiguration($config) - { - if (is_string($config)) { - $config = ['url' => $config]; - } - - $url = Arr::pull($config, 'url'); - - if (! $url) { - return $config; - } - - $rawComponents = $this->parseUrl($url); - - $decodedComponents = $this->parseStringsToNativeTypes( - array_map('rawurldecode', $rawComponents) - ); - - return array_merge( - $config, - $this->getPrimaryOptions($decodedComponents), - $this->getQueryOptions($rawComponents) - ); - } - - /** - * Get the primary database connection options. - * - * @param array $url - * @return array - */ - protected function getPrimaryOptions($url) - { - return array_filter([ - 'driver' => $this->getDriver($url), - 'database' => $this->getDatabase($url), - 'host' => $url['host'] ?? null, - 'port' => $url['port'] ?? null, - 'username' => $url['user'] ?? null, - 'password' => $url['pass'] ?? null, - ], fn ($value) => ! is_null($value)); - } - - /** - * Get the database driver from the URL. - * - * @param array $url - * @return string|null - */ - protected function getDriver($url) - { - $alias = $url['scheme'] ?? null; - - if (! $alias) { - return; - } - - return static::$driverAliases[$alias] ?? $alias; - } - - /** - * Get the database name from the URL. - * - * @param array $url - * @return string|null - */ - protected function getDatabase($url) - { - $path = $url['path'] ?? null; - - return $path && $path !== '/' ? substr($path, 1) : null; - } - - /** - * Get all of the additional database options from the query string. - * - * @param array $url - * @return array - */ - protected function getQueryOptions($url) - { - $queryString = $url['query'] ?? null; - - if (! $queryString) { - return []; - } - - $query = []; - - parse_str($queryString, $query); - - return $this->parseStringsToNativeTypes($query); - } - - /** - * Parse the string URL to an array of components. - * - * @param string $url - * @return array - * - * @throws \InvalidArgumentException - */ - protected function parseUrl($url) - { - $url = preg_replace('#^(sqlite3?):///#', '$1://null/', $url); - - $parsedUrl = parse_url($url); - - if ($parsedUrl === false) { - throw new InvalidArgumentException('The database configuration URL is malformed.'); - } - - return $parsedUrl; - } - - /** - * Convert string casted values to their native types. - * - * @param mixed $value - * @return mixed - */ - protected function parseStringsToNativeTypes($value) - { - if (is_array($value)) { - return array_map([$this, 'parseStringsToNativeTypes'], $value); - } - - if (! is_string($value)) { - return $value; - } - - $parsedValue = json_decode($value, true); - - if (json_last_error() === JSON_ERROR_NONE) { - return $parsedValue; - } - - return $value; - } - - /** - * Get all of the current drivers' aliases. - * - * @return array - */ - public static function getDriverAliases() - { - return static::$driverAliases; - } - - /** - * Add the given driver alias to the driver aliases array. - * - * @param string $alias - * @param string $driver - * @return void - */ - public static function addDriverAlias($alias, $driver) - { - static::$driverAliases[$alias] = $driver; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/DateFactory.php b/vendor/laravel/framework/src/Illuminate/Support/DateFactory.php deleted file mode 100644 index 22d79fce..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/DateFactory.php +++ /dev/null @@ -1,231 +0,0 @@ -$method(...$parameters); - } - - $dateClass = static::$dateClass ?: $defaultClassName; - - // Check if the date can be created using the public class method... - if (method_exists($dateClass, $method) || - method_exists($dateClass, 'hasMacro') && $dateClass::hasMacro($method)) { - return $dateClass::$method(...$parameters); - } - - // If that fails, create the date with the default class... - $date = $defaultClassName::$method(...$parameters); - - // If the configured class has an "instance" method, we'll try to pass our date into there... - if (method_exists($dateClass, 'instance')) { - return $dateClass::instance($date); - } - - // Otherwise, assume the configured class has a DateTime compatible constructor... - return new $dateClass($date->format('Y-m-d H:i:s.u'), $date->getTimezone()); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Env.php b/vendor/laravel/framework/src/Illuminate/Support/Env.php deleted file mode 100644 index 4d5747a8..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Env.php +++ /dev/null @@ -1,101 +0,0 @@ -addAdapter(PutenvAdapter::class); - } - - static::$repository = $builder->immutable()->make(); - } - - return static::$repository; - } - - /** - * Gets the value of an environment variable. - * - * @param string $key - * @param mixed $default - * @return mixed - */ - public static function get($key, $default = null) - { - return Option::fromValue(static::getRepository()->get($key)) - ->map(function ($value) { - switch (strtolower($value)) { - case 'true': - case '(true)': - return true; - case 'false': - case '(false)': - return false; - case 'empty': - case '(empty)': - return ''; - case 'null': - case '(null)': - return; - } - - if (preg_match('/\A([\'"])(.*)\1\z/', $value, $matches)) { - return $matches[2]; - } - - return $value; - }) - ->getOrCall(fn () => value($default)); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Facades/App.php b/vendor/laravel/framework/src/Illuminate/Support/Facades/App.php deleted file mode 100755 index 9754f980..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Facades/App.php +++ /dev/null @@ -1,141 +0,0 @@ - $parameters = [], string|null $defaultMethod = null) - * @method static \Closure factory(string $abstract) - * @method static mixed makeWith(string|callable $abstract, array $parameters = []) - * @method static mixed get(string $id) - * @method static mixed build(\Closure|string $concrete) - * @method static void beforeResolving(\Closure|string $abstract, \Closure|null $callback = null) - * @method static void resolving(\Closure|string $abstract, \Closure|null $callback = null) - * @method static void afterResolving(\Closure|string $abstract, \Closure|null $callback = null) - * @method static array getBindings() - * @method static string getAlias(string $abstract) - * @method static void forgetExtenders(string $abstract) - * @method static void forgetInstance(string $abstract) - * @method static void forgetInstances() - * @method static void forgetScopedInstances() - * @method static \Illuminate\Foundation\Application getInstance() - * @method static \Illuminate\Contracts\Container\Container|\Illuminate\Foundation\Application setInstance(\Illuminate\Contracts\Container\Container|null $container = null) - * @method static void macro(string $name, object|callable $macro) - * @method static void mixin(object $mixin, bool $replace = true) - * @method static bool hasMacro(string $name) - * @method static void flushMacros() - * - * @see \Illuminate\Foundation\Application - */ -class App extends Facade -{ - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return 'app'; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Facades/Artisan.php b/vendor/laravel/framework/src/Illuminate/Support/Facades/Artisan.php deleted file mode 100755 index 0efa8504..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Facades/Artisan.php +++ /dev/null @@ -1,35 +0,0 @@ -providerIsLoaded(UiServiceProvider::class)) { - throw new RuntimeException('In order to use the Auth::routes() method, please install the laravel/ui package.'); - } - - static::$app->make('router')->auth($options); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Facades/Blade.php b/vendor/laravel/framework/src/Illuminate/Support/Facades/Blade.php deleted file mode 100755 index a58b2142..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Facades/Blade.php +++ /dev/null @@ -1,60 +0,0 @@ -dispatch(); - } - - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return BusDispatcherContract::class; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Facades/Cache.php b/vendor/laravel/framework/src/Illuminate/Support/Facades/Cache.php deleted file mode 100755 index 4bb149bd..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Facades/Cache.php +++ /dev/null @@ -1,66 +0,0 @@ - $keys, mixed $default = null) - * @method static mixed pull(string $key, mixed $default = null) - * @method static bool put(array|string $key, mixed $value, \DateTimeInterface|\DateInterval|int|null $ttl = null) - * @method static bool set(string $key, mixed $value, null|int|\DateInterval $ttl = null) - * @method static bool putMany(array $values, \DateTimeInterface|\DateInterval|int|null $ttl = null) - * @method static bool setMultiple(iterable $values, null|int|\DateInterval $ttl = null) - * @method static bool add(string $key, mixed $value, \DateTimeInterface|\DateInterval|int|null $ttl = null) - * @method static int|bool increment(string $key, mixed $value = 1) - * @method static int|bool decrement(string $key, mixed $value = 1) - * @method static bool forever(string $key, mixed $value) - * @method static mixed remember(string $key, \Closure|\DateTimeInterface|\DateInterval|int|null $ttl, \Closure $callback) - * @method static mixed sear(string $key, \Closure $callback) - * @method static mixed rememberForever(string $key, \Closure $callback) - * @method static bool forget(string $key) - * @method static bool delete(string $key) - * @method static bool deleteMultiple(iterable $keys) - * @method static bool clear() - * @method static \Illuminate\Cache\TaggedCache tags(array|mixed $names) - * @method static bool supportsTags() - * @method static int|null getDefaultCacheTime() - * @method static \Illuminate\Cache\Repository setDefaultCacheTime(int|null $seconds) - * @method static \Illuminate\Contracts\Cache\Store getStore() - * @method static \Illuminate\Contracts\Events\Dispatcher getEventDispatcher() - * @method static void setEventDispatcher(\Illuminate\Contracts\Events\Dispatcher $events) - * @method static void macro(string $name, object|callable $macro) - * @method static void mixin(object $mixin, bool $replace = true) - * @method static bool hasMacro(string $name) - * @method static void flushMacros() - * @method static mixed macroCall(string $method, array $parameters) - * @method static bool flush() - * @method static string getPrefix() - * @method static \Illuminate\Contracts\Cache\Lock lock(string $name, int $seconds = 0, string|null $owner = null) - * @method static \Illuminate\Contracts\Cache\Lock restoreLock(string $name, string $owner) - * - * @see \Illuminate\Cache\CacheManager - */ -class Cache extends Facade -{ - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return 'cache'; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Facades/Config.php b/vendor/laravel/framework/src/Illuminate/Support/Facades/Config.php deleted file mode 100755 index e4d6a62c..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Facades/Config.php +++ /dev/null @@ -1,31 +0,0 @@ -cookie($key, null)); - } - - /** - * Retrieve a cookie from the request. - * - * @param string|null $key - * @param mixed $default - * @return string|array|null - */ - public static function get($key = null, $default = null) - { - return static::$app['request']->cookie($key, $default); - } - - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return 'cookie'; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Facades/Crypt.php b/vendor/laravel/framework/src/Illuminate/Support/Facades/Crypt.php deleted file mode 100755 index 20f269d9..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Facades/Crypt.php +++ /dev/null @@ -1,27 +0,0 @@ - getConnections() - * @method static void setReconnector(callable $reconnector) - * @method static \Illuminate\Database\DatabaseManager setApplication(\Illuminate\Contracts\Foundation\Application $app) - * @method static void macro(string $name, object|callable $macro) - * @method static void mixin(object $mixin, bool $replace = true) - * @method static bool hasMacro(string $name) - * @method static void flushMacros() - * @method static mixed macroCall(string $method, array $parameters) - * @method static void useDefaultQueryGrammar() - * @method static void useDefaultSchemaGrammar() - * @method static void useDefaultPostProcessor() - * @method static \Illuminate\Database\Schema\Builder getSchemaBuilder() - * @method static \Illuminate\Database\Query\Builder table(\Closure|\Illuminate\Database\Query\Builder|string $table, string|null $as = null) - * @method static \Illuminate\Database\Query\Builder query() - * @method static mixed selectOne(string $query, array $bindings = [], bool $useReadPdo = true) - * @method static mixed scalar(string $query, array $bindings = [], bool $useReadPdo = true) - * @method static array selectFromWriteConnection(string $query, array $bindings = []) - * @method static array select(string $query, array $bindings = [], bool $useReadPdo = true) - * @method static \Generator cursor(string $query, array $bindings = [], bool $useReadPdo = true) - * @method static bool insert(string $query, array $bindings = []) - * @method static int update(string $query, array $bindings = []) - * @method static int delete(string $query, array $bindings = []) - * @method static bool statement(string $query, array $bindings = []) - * @method static int affectingStatement(string $query, array $bindings = []) - * @method static bool unprepared(string $query) - * @method static array pretend(\Closure $callback) - * @method static void bindValues(\PDOStatement $statement, array $bindings) - * @method static array prepareBindings(array $bindings) - * @method static void logQuery(string $query, array $bindings, float|null $time = null) - * @method static void whenQueryingForLongerThan(\DateTimeInterface|\Carbon\CarbonInterval|float|int $threshold, callable $handler) - * @method static void allowQueryDurationHandlersToRunAgain() - * @method static float totalQueryDuration() - * @method static void resetTotalQueryDuration() - * @method static \Illuminate\Database\Connection beforeExecuting(\Closure $callback) - * @method static void listen(\Closure $callback) - * @method static \Illuminate\Database\Query\Expression raw(mixed $value) - * @method static bool hasModifiedRecords() - * @method static void recordsHaveBeenModified(bool $value = true) - * @method static \Illuminate\Database\Connection setRecordModificationState(bool $value) - * @method static void forgetRecordModificationState() - * @method static \Illuminate\Database\Connection useWriteConnectionWhenReading(bool $value = true) - * @method static bool isDoctrineAvailable() - * @method static bool usingNativeSchemaOperations() - * @method static \Doctrine\DBAL\Schema\Column getDoctrineColumn(string $table, string $column) - * @method static \Doctrine\DBAL\Schema\AbstractSchemaManager getDoctrineSchemaManager() - * @method static \Doctrine\DBAL\Connection getDoctrineConnection() - * @method static \PDO getPdo() - * @method static \PDO|\Closure|null getRawPdo() - * @method static \PDO getReadPdo() - * @method static \PDO|\Closure|null getRawReadPdo() - * @method static \Illuminate\Database\Connection setPdo(\PDO|\Closure|null $pdo) - * @method static \Illuminate\Database\Connection setReadPdo(\PDO|\Closure|null $pdo) - * @method static string|null getName() - * @method static string|null getNameWithReadWriteType() - * @method static mixed getConfig(string|null $option = null) - * @method static string getDriverName() - * @method static \Illuminate\Database\Query\Grammars\Grammar getQueryGrammar() - * @method static \Illuminate\Database\Connection setQueryGrammar(\Illuminate\Database\Query\Grammars\Grammar $grammar) - * @method static \Illuminate\Database\Schema\Grammars\Grammar getSchemaGrammar() - * @method static \Illuminate\Database\Connection setSchemaGrammar(\Illuminate\Database\Schema\Grammars\Grammar $grammar) - * @method static \Illuminate\Database\Query\Processors\Processor getPostProcessor() - * @method static \Illuminate\Database\Connection setPostProcessor(\Illuminate\Database\Query\Processors\Processor $processor) - * @method static \Illuminate\Contracts\Events\Dispatcher getEventDispatcher() - * @method static \Illuminate\Database\Connection setEventDispatcher(\Illuminate\Contracts\Events\Dispatcher $events) - * @method static void unsetEventDispatcher() - * @method static \Illuminate\Database\Connection setTransactionManager(\Illuminate\Database\DatabaseTransactionsManager $manager) - * @method static void unsetTransactionManager() - * @method static bool pretending() - * @method static array getQueryLog() - * @method static void flushQueryLog() - * @method static void enableQueryLog() - * @method static void disableQueryLog() - * @method static bool logging() - * @method static string getDatabaseName() - * @method static \Illuminate\Database\Connection setDatabaseName(string $database) - * @method static \Illuminate\Database\Connection setReadWriteType(string|null $readWriteType) - * @method static string getTablePrefix() - * @method static \Illuminate\Database\Connection setTablePrefix(string $prefix) - * @method static \Illuminate\Database\Grammar withTablePrefix(\Illuminate\Database\Grammar $grammar) - * @method static void resolverFor(string $driver, \Closure $callback) - * @method static mixed getResolver(string $driver) - * @method static mixed transaction(\Closure $callback, int $attempts = 1) - * @method static void beginTransaction() - * @method static void commit() - * @method static void rollBack(int|null $toLevel = null) - * @method static int transactionLevel() - * @method static void afterCommit(callable $callback) - * - * @see \Illuminate\Database\DatabaseManager - */ -class DB extends Facade -{ - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return 'db'; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Facades/Date.php b/vendor/laravel/framework/src/Illuminate/Support/Facades/Date.php deleted file mode 100644 index 40bc3edc..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Facades/Date.php +++ /dev/null @@ -1,122 +0,0 @@ -resolved($accessor) === true) { - $callback(static::getFacadeRoot()); - } - - static::$app->afterResolving($accessor, function ($service) use ($callback) { - $callback($service); - }); - } - - /** - * Convert the facade into a Mockery spy. - * - * @return \Mockery\MockInterface - */ - public static function spy() - { - if (! static::isMock()) { - $class = static::getMockableClass(); - - return tap($class ? Mockery::spy($class) : Mockery::spy(), function ($spy) { - static::swap($spy); - }); - } - } - - /** - * Initiate a partial mock on the facade. - * - * @return \Mockery\MockInterface - */ - public static function partialMock() - { - $name = static::getFacadeAccessor(); - - $mock = static::isMock() - ? static::$resolvedInstance[$name] - : static::createFreshMockInstance(); - - return $mock->makePartial(); - } - - /** - * Initiate a mock expectation on the facade. - * - * @return \Mockery\Expectation - */ - public static function shouldReceive() - { - $name = static::getFacadeAccessor(); - - $mock = static::isMock() - ? static::$resolvedInstance[$name] - : static::createFreshMockInstance(); - - return $mock->shouldReceive(...func_get_args()); - } - - /** - * Initiate a mock expectation on the facade. - * - * @return \Mockery\Expectation - */ - public static function expects() - { - $name = static::getFacadeAccessor(); - - $mock = static::isMock() - ? static::$resolvedInstance[$name] - : static::createFreshMockInstance(); - - return $mock->expects(...func_get_args()); - } - - /** - * Create a fresh mock instance for the given class. - * - * @return \Mockery\MockInterface - */ - protected static function createFreshMockInstance() - { - return tap(static::createMock(), function ($mock) { - static::swap($mock); - - $mock->shouldAllowMockingProtectedMethods(); - }); - } - - /** - * Create a fresh mock instance for the given class. - * - * @return \Mockery\MockInterface - */ - protected static function createMock() - { - $class = static::getMockableClass(); - - return $class ? Mockery::mock($class) : Mockery::mock(); - } - - /** - * Determines whether a mock is set as the instance of the facade. - * - * @return bool - */ - protected static function isMock() - { - $name = static::getFacadeAccessor(); - - return isset(static::$resolvedInstance[$name]) && - static::$resolvedInstance[$name] instanceof LegacyMockInterface; - } - - /** - * Get the mockable class for the bound instance. - * - * @return string|null - */ - protected static function getMockableClass() - { - if ($root = static::getFacadeRoot()) { - return get_class($root); - } - } - - /** - * Hotswap the underlying instance behind the facade. - * - * @param mixed $instance - * @return void - */ - public static function swap($instance) - { - static::$resolvedInstance[static::getFacadeAccessor()] = $instance; - - if (isset(static::$app)) { - static::$app->instance(static::getFacadeAccessor(), $instance); - } - } - - /** - * Get the root object behind the facade. - * - * @return mixed - */ - public static function getFacadeRoot() - { - return static::resolveFacadeInstance(static::getFacadeAccessor()); - } - - /** - * Get the registered name of the component. - * - * @return string - * - * @throws \RuntimeException - */ - protected static function getFacadeAccessor() - { - throw new RuntimeException('Facade does not implement getFacadeAccessor method.'); - } - - /** - * Resolve the facade root instance from the container. - * - * @param string $name - * @return mixed - */ - protected static function resolveFacadeInstance($name) - { - if (isset(static::$resolvedInstance[$name])) { - return static::$resolvedInstance[$name]; - } - - if (static::$app) { - if (static::$cached) { - return static::$resolvedInstance[$name] = static::$app[$name]; - } - - return static::$app[$name]; - } - } - - /** - * Clear a resolved facade instance. - * - * @param string $name - * @return void - */ - public static function clearResolvedInstance($name) - { - unset(static::$resolvedInstance[$name]); - } - - /** - * Clear all of the resolved instances. - * - * @return void - */ - public static function clearResolvedInstances() - { - static::$resolvedInstance = []; - } - - /** - * Get the application default aliases. - * - * @return \Illuminate\Support\Collection - */ - public static function defaultAliases() - { - return collect([ - 'App' => App::class, - 'Arr' => Arr::class, - 'Artisan' => Artisan::class, - 'Auth' => Auth::class, - 'Blade' => Blade::class, - 'Broadcast' => Broadcast::class, - 'Bus' => Bus::class, - 'Cache' => Cache::class, - 'Config' => Config::class, - 'Cookie' => Cookie::class, - 'Crypt' => Crypt::class, - 'Date' => Date::class, - 'DB' => DB::class, - 'Eloquent' => Model::class, - 'Event' => Event::class, - 'File' => File::class, - 'Gate' => Gate::class, - 'Hash' => Hash::class, - 'Http' => Http::class, - 'Js' => Js::class, - 'Lang' => Lang::class, - 'Log' => Log::class, - 'Mail' => Mail::class, - 'Notification' => Notification::class, - 'Password' => Password::class, - 'Queue' => Queue::class, - 'RateLimiter' => RateLimiter::class, - 'Redirect' => Redirect::class, - 'Request' => Request::class, - 'Response' => Response::class, - 'Route' => Route::class, - 'Schema' => Schema::class, - 'Session' => Session::class, - 'Storage' => Storage::class, - 'Str' => Str::class, - 'URL' => URL::class, - 'Validator' => Validator::class, - 'View' => View::class, - 'Vite' => Vite::class, - ]); - } - - /** - * Get the application instance behind the facade. - * - * @return \Illuminate\Contracts\Foundation\Application - */ - public static function getFacadeApplication() - { - return static::$app; - } - - /** - * Set the application instance. - * - * @param \Illuminate\Contracts\Foundation\Application $app - * @return void - */ - public static function setFacadeApplication($app) - { - static::$app = $app; - } - - /** - * Handle dynamic, static calls to the object. - * - * @param string $method - * @param array $args - * @return mixed - * - * @throws \RuntimeException - */ - public static function __callStatic($method, $args) - { - $instance = static::getFacadeRoot(); - - if (! $instance) { - throw new RuntimeException('A facade root has not been set.'); - } - - return $instance->$method(...$args); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Facades/File.php b/vendor/laravel/framework/src/Illuminate/Support/Facades/File.php deleted file mode 100755 index 7dcb132f..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Facades/File.php +++ /dev/null @@ -1,71 +0,0 @@ -fake($callback)); - }); - } - - /** - * Register a response sequence for the given URL pattern. - * - * @param string $urlPattern - * @return \Illuminate\Http\Client\ResponseSequence - */ - public static function fakeSequence(string $urlPattern = '*') - { - $fake = tap(static::getFacadeRoot(), function ($fake) { - static::swap($fake); - }); - - return $fake->fakeSequence($urlPattern); - } - - /** - * Indicate that an exception should be thrown if any request is not faked. - * - * @return \Illuminate\Http\Client\Factory - */ - public static function preventStrayRequests() - { - return tap(static::getFacadeRoot(), function ($fake) { - static::swap($fake->preventStrayRequests()); - }); - } - - /** - * Stub the given URL using the given callback. - * - * @param string $url - * @param \Illuminate\Http\Client\Response|\GuzzleHttp\Promise\PromiseInterface|callable $callback - * @return \Illuminate\Http\Client\Factory - */ - public static function stubUrl($url, $callback) - { - return tap(static::getFacadeRoot(), function ($fake) use ($url, $callback) { - static::swap($fake->stubUrl($url, $callback)); - }); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Facades/Lang.php b/vendor/laravel/framework/src/Illuminate/Support/Facades/Lang.php deleted file mode 100755 index a87088a3..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Facades/Lang.php +++ /dev/null @@ -1,45 +0,0 @@ -route($channel, $route); - } - - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return ChannelManager::class; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Facades/ParallelTesting.php b/vendor/laravel/framework/src/Illuminate/Support/Facades/ParallelTesting.php deleted file mode 100644 index d91558c1..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Facades/ParallelTesting.php +++ /dev/null @@ -1,34 +0,0 @@ - $enumClass) - * @method static \Illuminate\Support\Collection collect(array|string|null $key = null) - * @method static array only(array|mixed $keys) - * @method static array except(array|mixed $keys) - * @method static string|array|null query(string|null $key = null, string|array|null $default = null) - * @method static string|array|null post(string|null $key = null, string|array|null $default = null) - * @method static bool hasCookie(string $key) - * @method static string|array|null cookie(string|null $key = null, string|array|null $default = null) - * @method static array allFiles() - * @method static bool hasFile(string $key) - * @method static \Illuminate\Http\UploadedFile|\Illuminate\Http\UploadedFile[]|array|null file(string|null $key = null, mixed $default = null) - * @method static never dd(mixed ...$keys) - * @method static \Illuminate\Http\Request dump(mixed $keys = []) - * @method static void macro(string $name, object|callable $macro) - * @method static void mixin(object $mixin, bool $replace = true) - * @method static bool hasMacro(string $name) - * @method static void flushMacros() - * @method static array validate(array $rules, ...$params) - * @method static array validateWithBag(string $errorBag, array $rules, ...$params) - * @method static bool hasValidSignature(bool $absolute = true) - * - * @see \Illuminate\Http\Request - */ -class Request extends Facade -{ - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return 'request'; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Facades/Response.php b/vendor/laravel/framework/src/Illuminate/Support/Facades/Response.php deleted file mode 100755 index 3215ca06..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Facades/Response.php +++ /dev/null @@ -1,40 +0,0 @@ -connection($name)->getSchemaBuilder(); - } - - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return 'db.schema'; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Facades/Session.php b/vendor/laravel/framework/src/Illuminate/Support/Facades/Session.php deleted file mode 100755 index a36f6133..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Facades/Session.php +++ /dev/null @@ -1,80 +0,0 @@ -get('filesystems.default'); - - $root = storage_path('framework/testing/disks/'.$disk); - - if ($token = ParallelTesting::token()) { - $root = "{$root}_test_{$token}"; - } - - (new Filesystem)->cleanDirectory($root); - - static::set($disk, $fake = static::createLocalDriver(array_merge($config, [ - 'root' => $root, - ]))); - - return tap($fake)->buildTemporaryUrlsUsing(function ($path, $expiration) { - return URL::to($path.'?expiration='.$expiration->getTimestamp()); - }); - } - - /** - * Replace the given disk with a persistent local testing disk. - * - * @param string|null $disk - * @param array $config - * @return \Illuminate\Contracts\Filesystem\Filesystem - */ - public static function persistentFake($disk = null, array $config = []) - { - $disk = $disk ?: static::$app['config']->get('filesystems.default'); - - static::set($disk, $fake = static::createLocalDriver(array_merge($config, [ - 'root' => storage_path('framework/testing/disks/'.$disk), - ]))); - - return $fake; - } - - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return 'filesystem'; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Facades/URL.php b/vendor/laravel/framework/src/Illuminate/Support/Facades/URL.php deleted file mode 100755 index 8da96f48..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Facades/URL.php +++ /dev/null @@ -1,62 +0,0 @@ - - * @implements \ArrayAccess - */ -class Fluent implements Arrayable, ArrayAccess, Jsonable, JsonSerializable -{ - /** - * All of the attributes set on the fluent instance. - * - * @var array - */ - protected $attributes = []; - - /** - * Create a new fluent instance. - * - * @param iterable $attributes - * @return void - */ - public function __construct($attributes = []) - { - foreach ($attributes as $key => $value) { - $this->attributes[$key] = $value; - } - } - - /** - * Get an attribute from the fluent instance. - * - * @template TGetDefault - * - * @param TKey $key - * @param TGetDefault|(\Closure(): TGetDefault) $default - * @return TValue|TGetDefault - */ - public function get($key, $default = null) - { - if (array_key_exists($key, $this->attributes)) { - return $this->attributes[$key]; - } - - return value($default); - } - - /** - * Get the attributes from the fluent instance. - * - * @return array - */ - public function getAttributes() - { - return $this->attributes; - } - - /** - * Convert the fluent instance to an array. - * - * @return array - */ - public function toArray() - { - return $this->attributes; - } - - /** - * Convert the object into something JSON serializable. - * - * @return array - */ - public function jsonSerialize(): array - { - return $this->toArray(); - } - - /** - * Convert the fluent instance to JSON. - * - * @param int $options - * @return string - */ - public function toJson($options = 0) - { - return json_encode($this->jsonSerialize(), $options); - } - - /** - * Determine if the given offset exists. - * - * @param TKey $offset - * @return bool - */ - public function offsetExists($offset): bool - { - return isset($this->attributes[$offset]); - } - - /** - * Get the value for a given offset. - * - * @param TKey $offset - * @return TValue|null - */ - public function offsetGet($offset): mixed - { - return $this->get($offset); - } - - /** - * Set the value at the given offset. - * - * @param TKey $offset - * @param TValue $value - * @return void - */ - public function offsetSet($offset, $value): void - { - $this->attributes[$offset] = $value; - } - - /** - * Unset the value at the given offset. - * - * @param TKey $offset - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->attributes[$offset]); - } - - /** - * Handle dynamic calls to the fluent instance to set attributes. - * - * @param TKey $method - * @param array{0: ?TValue} $parameters - * @return $this - */ - public function __call($method, $parameters) - { - $this->attributes[$method] = count($parameters) > 0 ? reset($parameters) : true; - - return $this; - } - - /** - * Dynamically retrieve the value of an attribute. - * - * @param TKey $key - * @return TValue|null - */ - public function __get($key) - { - return $this->get($key); - } - - /** - * Dynamically set the value of an attribute. - * - * @param TKey $key - * @param TValue $value - * @return void - */ - public function __set($key, $value) - { - $this->offsetSet($key, $value); - } - - /** - * Dynamically check if an attribute is set. - * - * @param TKey $key - * @return bool - */ - public function __isset($key) - { - return $this->offsetExists($key); - } - - /** - * Dynamically unset an attribute. - * - * @param TKey $key - * @return void - */ - public function __unset($key) - { - $this->offsetUnset($key); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/HigherOrderTapProxy.php b/vendor/laravel/framework/src/Illuminate/Support/HigherOrderTapProxy.php deleted file mode 100644 index bbf9b2e5..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/HigherOrderTapProxy.php +++ /dev/null @@ -1,38 +0,0 @@ -target = $target; - } - - /** - * Dynamically pass method calls to the target. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - $this->target->{$method}(...$parameters); - - return $this->target; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/HtmlString.php b/vendor/laravel/framework/src/Illuminate/Support/HtmlString.php deleted file mode 100644 index d6b71d46..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/HtmlString.php +++ /dev/null @@ -1,66 +0,0 @@ -html = $html; - } - - /** - * Get the HTML string. - * - * @return string - */ - public function toHtml() - { - return $this->html; - } - - /** - * Determine if the given HTML string is empty. - * - * @return bool - */ - public function isEmpty() - { - return $this->html === ''; - } - - /** - * Determine if the given HTML string is not empty. - * - * @return bool - */ - public function isNotEmpty() - { - return ! $this->isEmpty(); - } - - /** - * Get the HTML string. - * - * @return string - */ - public function __toString() - { - return $this->toHtml(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/InteractsWithTime.php b/vendor/laravel/framework/src/Illuminate/Support/InteractsWithTime.php deleted file mode 100644 index 2b617c39..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/InteractsWithTime.php +++ /dev/null @@ -1,64 +0,0 @@ -parseDateInterval($delay); - - return $delay instanceof DateTimeInterface - ? max(0, $delay->getTimestamp() - $this->currentTime()) - : (int) $delay; - } - - /** - * Get the "available at" UNIX timestamp. - * - * @param \DateTimeInterface|\DateInterval|int $delay - * @return int - */ - protected function availableAt($delay = 0) - { - $delay = $this->parseDateInterval($delay); - - return $delay instanceof DateTimeInterface - ? $delay->getTimestamp() - : Carbon::now()->addRealSeconds($delay)->getTimestamp(); - } - - /** - * If the given value is an interval, convert it to a DateTime instance. - * - * @param \DateTimeInterface|\DateInterval|int $delay - * @return \DateTimeInterface|int - */ - protected function parseDateInterval($delay) - { - if ($delay instanceof DateInterval) { - $delay = Carbon::now()->add($delay); - } - - return $delay; - } - - /** - * Get the current system time as a UNIX timestamp. - * - * @return int - */ - protected function currentTime() - { - return Carbon::now()->getTimestamp(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Js.php b/vendor/laravel/framework/src/Illuminate/Support/Js.php deleted file mode 100644 index 5a1d23ae..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Js.php +++ /dev/null @@ -1,145 +0,0 @@ -js = $this->convertDataToJavaScriptExpression($data, $flags, $depth); - } - - /** - * Create a new JavaScript string from the given data. - * - * @param mixed $data - * @param int $flags - * @param int $depth - * @return static - * - * @throws \JsonException - */ - public static function from($data, $flags = 0, $depth = 512) - { - return new static($data, $flags, $depth); - } - - /** - * Convert the given data to a JavaScript expression. - * - * @param mixed $data - * @param int $flags - * @param int $depth - * @return string - * - * @throws \JsonException - */ - protected function convertDataToJavaScriptExpression($data, $flags = 0, $depth = 512) - { - if ($data instanceof self) { - return $data->toHtml(); - } - - $json = $this->jsonEncode($data, $flags, $depth); - - if (is_string($data)) { - return "'".substr($json, 1, -1)."'"; - } - - return $this->convertJsonToJavaScriptExpression($json, $flags); - } - - /** - * Encode the given data as JSON. - * - * @param mixed $data - * @param int $flags - * @param int $depth - * @return string - * - * @throws \JsonException - */ - protected function jsonEncode($data, $flags = 0, $depth = 512) - { - if ($data instanceof Jsonable) { - return $data->toJson($flags | static::REQUIRED_FLAGS); - } - - if ($data instanceof Arrayable && ! ($data instanceof JsonSerializable)) { - $data = $data->toArray(); - } - - return json_encode($data, $flags | static::REQUIRED_FLAGS, $depth); - } - - /** - * Convert the given JSON to a JavaScript expression. - * - * @param string $json - * @param int $flags - * @return string - * - * @throws \JsonException - */ - protected function convertJsonToJavaScriptExpression($json, $flags = 0) - { - if ($json === '[]' || $json === '{}') { - return $json; - } - - if (Str::startsWith($json, ['"', '{', '['])) { - return "JSON.parse('".substr(json_encode($json, $flags | static::REQUIRED_FLAGS), 1, -1)."')"; - } - - return $json; - } - - /** - * Get the string representation of the data for use in HTML. - * - * @return string - */ - public function toHtml() - { - return $this->js; - } - - /** - * Get the string representation of the data for use in HTML. - * - * @return string - */ - public function __toString() - { - return $this->toHtml(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/LICENSE.md b/vendor/laravel/framework/src/Illuminate/Support/LICENSE.md deleted file mode 100644 index 79810c84..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Taylor Otwell - -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/laravel/framework/src/Illuminate/Support/Lottery.php b/vendor/laravel/framework/src/Illuminate/Support/Lottery.php deleted file mode 100644 index 5fe1f3e8..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Lottery.php +++ /dev/null @@ -1,270 +0,0 @@ - 1) { - throw new RuntimeException('Float must not be greater than 1.'); - } - - $this->chances = $chances; - - $this->outOf = $outOf; - } - - /** - * Create a new Lottery instance. - * - * @param int|float $chances - * @param ?int $outOf - * @return static - */ - public static function odds($chances, $outOf = null) - { - return new static($chances, $outOf); - } - - /** - * Set the winner callback. - * - * @param callable $callback - * @return $this - */ - public function winner($callback) - { - $this->winner = $callback; - - return $this; - } - - /** - * Set the loser callback. - * - * @param callable $callback - * @return $this - */ - public function loser($callback) - { - $this->loser = $callback; - - return $this; - } - - /** - * Run the lottery. - * - * @param mixed ...$args - * @return mixed - */ - public function __invoke(...$args) - { - return $this->runCallback(...$args); - } - - /** - * Run the lottery. - * - * @param null|int $times - * @return mixed - */ - public function choose($times = null) - { - if ($times === null) { - return $this->runCallback(); - } - - $results = []; - - for ($i = 0; $i < $times; $i++) { - $results[] = $this->runCallback(); - } - - return $results; - } - - /** - * Run the winner or loser callback, randomly. - * - * @param mixed ...$args - * @return callable - */ - protected function runCallback(...$args) - { - return $this->wins() - ? ($this->winner ?? fn () => true)(...$args) - : ($this->loser ?? fn () => false)(...$args); - } - - /** - * Determine if the lottery "wins" or "loses". - * - * @return bool - */ - protected function wins() - { - return static::resultFactory()($this->chances, $this->outOf); - } - - /** - * The factory that determines the lottery result. - * - * @return callable - */ - protected static function resultFactory() - { - return static::$resultFactory ?? fn ($chances, $outOf) => $outOf === null - ? random_int(0, PHP_INT_MAX) / PHP_INT_MAX <= $chances - : random_int(1, $outOf) <= $chances; - } - - /** - * Force the lottery to always result in a win. - * - * @param callable|null $callback - * @return void - */ - public static function alwaysWin($callback = null) - { - self::setResultFactory(fn () => true); - - if ($callback === null) { - return; - } - - $callback(); - - static::determineResultNormally(); - } - - /** - * Force the lottery to always result in a lose. - * - * @param callable|null $callback - * @return void - */ - public static function alwaysLose($callback = null) - { - self::setResultFactory(fn () => false); - - if ($callback === null) { - return; - } - - $callback(); - - static::determineResultNormally(); - } - - /** - * Set the sequence that will be used to determine lottery results. - * - * @param array $sequence - * @param callable|null $whenMissing - * @return void - */ - public static function fix($sequence, $whenMissing = null) - { - return static::forceResultWithSequence($sequence, $whenMissing); - } - - /** - * Set the sequence that will be used to determine lottery results. - * - * @param array $sequence - * @param callable|null $whenMissing - * @return void - */ - public static function forceResultWithSequence($sequence, $whenMissing = null) - { - $next = 0; - - $whenMissing ??= function ($chances, $outOf) use (&$next) { - $factoryCache = static::$resultFactory; - - static::$resultFactory = null; - - $result = static::resultFactory()($chances, $outOf); - - static::$resultFactory = $factoryCache; - - $next++; - - return $result; - }; - - static::setResultFactory(function ($chances, $outOf) use (&$next, $sequence, $whenMissing) { - if (array_key_exists($next, $sequence)) { - return $sequence[$next++]; - } - - return $whenMissing($chances, $outOf); - }); - } - - /** - * Indicate that the lottery results should be determined normally. - * - * @return void - */ - public static function determineResultNormally() - { - static::$resultFactory = null; - } - - /** - * Set the factory that should be used to deterine the lottery results. - * - * @param callable $factory - * @return void - */ - public static function setResultFactory($factory) - { - self::$resultFactory = $factory; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Manager.php b/vendor/laravel/framework/src/Illuminate/Support/Manager.php deleted file mode 100755 index f8ae0729..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Manager.php +++ /dev/null @@ -1,193 +0,0 @@ -container = $container; - $this->config = $container->make('config'); - } - - /** - * Get the default driver name. - * - * @return string - */ - abstract public function getDefaultDriver(); - - /** - * Get a driver instance. - * - * @param string|null $driver - * @return mixed - * - * @throws \InvalidArgumentException - */ - public function driver($driver = null) - { - $driver = $driver ?: $this->getDefaultDriver(); - - if (is_null($driver)) { - throw new InvalidArgumentException(sprintf( - 'Unable to resolve NULL driver for [%s].', static::class - )); - } - - // If the given driver has not been created before, we will create the instances - // here and cache it so we can return it next time very quickly. If there is - // already a driver created by this name, we'll just return that instance. - if (! isset($this->drivers[$driver])) { - $this->drivers[$driver] = $this->createDriver($driver); - } - - return $this->drivers[$driver]; - } - - /** - * Create a new driver instance. - * - * @param string $driver - * @return mixed - * - * @throws \InvalidArgumentException - */ - protected function createDriver($driver) - { - // First, we will determine if a custom driver creator exists for the given driver and - // if it does not we will check for a creator method for the driver. Custom creator - // callbacks allow developers to build their own "drivers" easily using Closures. - if (isset($this->customCreators[$driver])) { - return $this->callCustomCreator($driver); - } else { - $method = 'create'.Str::studly($driver).'Driver'; - - if (method_exists($this, $method)) { - return $this->$method(); - } - } - - throw new InvalidArgumentException("Driver [$driver] not supported."); - } - - /** - * Call a custom driver creator. - * - * @param string $driver - * @return mixed - */ - protected function callCustomCreator($driver) - { - return $this->customCreators[$driver]($this->container); - } - - /** - * Register a custom driver creator Closure. - * - * @param string $driver - * @param \Closure $callback - * @return $this - */ - public function extend($driver, Closure $callback) - { - $this->customCreators[$driver] = $callback; - - return $this; - } - - /** - * Get all of the created "drivers". - * - * @return array - */ - public function getDrivers() - { - return $this->drivers; - } - - /** - * Get the container instance used by the manager. - * - * @return \Illuminate\Contracts\Container\Container - */ - public function getContainer() - { - return $this->container; - } - - /** - * Set the container instance used by the manager. - * - * @param \Illuminate\Contracts\Container\Container $container - * @return $this - */ - public function setContainer(Container $container) - { - $this->container = $container; - - return $this; - } - - /** - * Forget all of the resolved driver instances. - * - * @return $this - */ - public function forgetDrivers() - { - $this->drivers = []; - - return $this; - } - - /** - * Dynamically call the default driver instance. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - return $this->driver()->$method(...$parameters); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/MessageBag.php b/vendor/laravel/framework/src/Illuminate/Support/MessageBag.php deleted file mode 100755 index 88ebfb08..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/MessageBag.php +++ /dev/null @@ -1,420 +0,0 @@ - $value) { - $value = $value instanceof Arrayable ? $value->toArray() : (array) $value; - - $this->messages[$key] = array_unique($value); - } - } - - /** - * Get the keys present in the message bag. - * - * @return array - */ - public function keys() - { - return array_keys($this->messages); - } - - /** - * Add a message to the message bag. - * - * @param string $key - * @param string $message - * @return $this - */ - public function add($key, $message) - { - if ($this->isUnique($key, $message)) { - $this->messages[$key][] = $message; - } - - return $this; - } - - /** - * Add a message to the message bag if the given conditional is "true". - * - * @param bool $boolean - * @param string $key - * @param string $message - * @return $this - */ - public function addIf($boolean, $key, $message) - { - return $boolean ? $this->add($key, $message) : $this; - } - - /** - * Determine if a key and message combination already exists. - * - * @param string $key - * @param string $message - * @return bool - */ - protected function isUnique($key, $message) - { - $messages = (array) $this->messages; - - return ! isset($messages[$key]) || ! in_array($message, $messages[$key]); - } - - /** - * Merge a new array of messages into the message bag. - * - * @param \Illuminate\Contracts\Support\MessageProvider|array $messages - * @return $this - */ - public function merge($messages) - { - if ($messages instanceof MessageProvider) { - $messages = $messages->getMessageBag()->getMessages(); - } - - $this->messages = array_merge_recursive($this->messages, $messages); - - return $this; - } - - /** - * Determine if messages exist for all of the given keys. - * - * @param array|string|null $key - * @return bool - */ - public function has($key) - { - if ($this->isEmpty()) { - return false; - } - - if (is_null($key)) { - return $this->any(); - } - - $keys = is_array($key) ? $key : func_get_args(); - - foreach ($keys as $key) { - if ($this->first($key) === '') { - return false; - } - } - - return true; - } - - /** - * Determine if messages exist for any of the given keys. - * - * @param array|string|null $keys - * @return bool - */ - public function hasAny($keys = []) - { - if ($this->isEmpty()) { - return false; - } - - $keys = is_array($keys) ? $keys : func_get_args(); - - foreach ($keys as $key) { - if ($this->has($key)) { - return true; - } - } - - return false; - } - - /** - * Get the first message from the message bag for a given key. - * - * @param string|null $key - * @param string|null $format - * @return string - */ - public function first($key = null, $format = null) - { - $messages = is_null($key) ? $this->all($format) : $this->get($key, $format); - - $firstMessage = Arr::first($messages, null, ''); - - return is_array($firstMessage) ? Arr::first($firstMessage) : $firstMessage; - } - - /** - * Get all of the messages from the message bag for a given key. - * - * @param string $key - * @param string|null $format - * @return array - */ - public function get($key, $format = null) - { - // If the message exists in the message bag, we will transform it and return - // the message. Otherwise, we will check if the key is implicit & collect - // all the messages that match the given key and output it as an array. - if (array_key_exists($key, $this->messages)) { - return $this->transform( - $this->messages[$key], $this->checkFormat($format), $key - ); - } - - if (str_contains($key, '*')) { - return $this->getMessagesForWildcardKey($key, $format); - } - - return []; - } - - /** - * Get the messages for a wildcard key. - * - * @param string $key - * @param string|null $format - * @return array - */ - protected function getMessagesForWildcardKey($key, $format) - { - return collect($this->messages) - ->filter(function ($messages, $messageKey) use ($key) { - return Str::is($key, $messageKey); - }) - ->map(function ($messages, $messageKey) use ($format) { - return $this->transform( - $messages, $this->checkFormat($format), $messageKey - ); - })->all(); - } - - /** - * Get all of the messages for every key in the message bag. - * - * @param string|null $format - * @return array - */ - public function all($format = null) - { - $format = $this->checkFormat($format); - - $all = []; - - foreach ($this->messages as $key => $messages) { - $all = array_merge($all, $this->transform($messages, $format, $key)); - } - - return $all; - } - - /** - * Get all of the unique messages for every key in the message bag. - * - * @param string|null $format - * @return array - */ - public function unique($format = null) - { - return array_unique($this->all($format)); - } - - /** - * Format an array of messages. - * - * @param array $messages - * @param string $format - * @param string $messageKey - * @return array - */ - protected function transform($messages, $format, $messageKey) - { - if ($format == ':message') { - return (array) $messages; - } - - return collect((array) $messages) - ->map(function ($message) use ($format, $messageKey) { - // We will simply spin through the given messages and transform each one - // replacing the :message place holder with the real message allowing - // the messages to be easily formatted to each developer's desires. - return str_replace([':message', ':key'], [$message, $messageKey], $format); - })->all(); - } - - /** - * Get the appropriate format based on the given format. - * - * @param string $format - * @return string - */ - protected function checkFormat($format) - { - return $format ?: $this->format; - } - - /** - * Get the raw messages in the message bag. - * - * @return array - */ - public function messages() - { - return $this->messages; - } - - /** - * Get the raw messages in the message bag. - * - * @return array - */ - public function getMessages() - { - return $this->messages(); - } - - /** - * Get the messages for the instance. - * - * @return \Illuminate\Support\MessageBag - */ - public function getMessageBag() - { - return $this; - } - - /** - * Get the default message format. - * - * @return string - */ - public function getFormat() - { - return $this->format; - } - - /** - * Set the default message format. - * - * @param string $format - * @return \Illuminate\Support\MessageBag - */ - public function setFormat($format = ':message') - { - $this->format = $format; - - return $this; - } - - /** - * Determine if the message bag has any messages. - * - * @return bool - */ - public function isEmpty() - { - return ! $this->any(); - } - - /** - * Determine if the message bag has any messages. - * - * @return bool - */ - public function isNotEmpty() - { - return $this->any(); - } - - /** - * Determine if the message bag has any messages. - * - * @return bool - */ - public function any() - { - return $this->count() > 0; - } - - /** - * Get the number of messages in the message bag. - * - * @return int - */ - public function count(): int - { - return count($this->messages, COUNT_RECURSIVE) - count($this->messages); - } - - /** - * Get the instance as an array. - * - * @return array - */ - public function toArray() - { - return $this->getMessages(); - } - - /** - * Convert the object into something JSON serializable. - * - * @return array - */ - public function jsonSerialize(): array - { - return $this->toArray(); - } - - /** - * Convert the object to its JSON representation. - * - * @param int $options - * @return string - */ - public function toJson($options = 0) - { - return json_encode($this->jsonSerialize(), $options); - } - - /** - * Convert the message bag to its string representation. - * - * @return string - */ - public function __toString() - { - return $this->toJson(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/MultipleInstanceManager.php b/vendor/laravel/framework/src/Illuminate/Support/MultipleInstanceManager.php deleted file mode 100644 index 8544bdf7..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/MultipleInstanceManager.php +++ /dev/null @@ -1,191 +0,0 @@ -app = $app; - } - - /** - * Get the default instance name. - * - * @return string - */ - abstract public function getDefaultInstance(); - - /** - * Set the default instance name. - * - * @param string $name - * @return void - */ - abstract public function setDefaultInstance($name); - - /** - * Get the instance specific configuration. - * - * @param string $name - * @return array - */ - abstract public function getInstanceConfig($name); - - /** - * Get an instance instance by name. - * - * @param string|null $name - * @return mixed - */ - public function instance($name = null) - { - $name = $name ?: $this->getDefaultInstance(); - - return $this->instances[$name] = $this->get($name); - } - - /** - * Attempt to get an instance from the local cache. - * - * @param string $name - * @return mixed - */ - protected function get($name) - { - return $this->instances[$name] ?? $this->resolve($name); - } - - /** - * Resolve the given instance. - * - * @param string $name - * @return mixed - * - * @throws \InvalidArgumentException - */ - protected function resolve($name) - { - $config = $this->getInstanceConfig($name); - - if (is_null($config)) { - throw new InvalidArgumentException("Instance [{$name}] is not defined."); - } - - if (! array_key_exists('driver', $config)) { - throw new RuntimeException("Instance [{$name}] does not specify a driver."); - } - - if (isset($this->customCreators[$config['driver']])) { - return $this->callCustomCreator($config); - } else { - $driverMethod = 'create'.ucfirst($config['driver']).'Driver'; - - if (method_exists($this, $driverMethod)) { - return $this->{$driverMethod}($config); - } else { - throw new InvalidArgumentException("Instance driver [{$config['driver']}] is not supported."); - } - } - } - - /** - * Call a custom instance creator. - * - * @param array $config - * @return mixed - */ - protected function callCustomCreator(array $config) - { - return $this->customCreators[$config['driver']]($this->app, $config); - } - - /** - * Unset the given instances. - * - * @param array|string|null $name - * @return $this - */ - public function forgetInstance($name = null) - { - $name ??= $this->getDefaultInstance(); - - foreach ((array) $name as $instanceName) { - if (isset($this->instances[$instanceName])) { - unset($this->instances[$instanceName]); - } - } - - return $this; - } - - /** - * Disconnect the given instance and remove from local cache. - * - * @param string|null $name - * @return void - */ - public function purge($name = null) - { - $name ??= $this->getDefaultInstance(); - - unset($this->instances[$name]); - } - - /** - * Register a custom instance creator Closure. - * - * @param string $name - * @param \Closure $callback - * @return $this - */ - public function extend($name, Closure $callback) - { - $this->customCreators[$name] = $callback->bindTo($this, $this); - - return $this; - } - - /** - * Dynamically call the default instance. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - return $this->instance()->$method(...$parameters); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/NamespacedItemResolver.php b/vendor/laravel/framework/src/Illuminate/Support/NamespacedItemResolver.php deleted file mode 100755 index a059c6da..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/NamespacedItemResolver.php +++ /dev/null @@ -1,112 +0,0 @@ -parsed[$key])) { - return $this->parsed[$key]; - } - - // If the key does not contain a double colon, it means the key is not in a - // namespace, and is just a regular configuration item. Namespaces are a - // tool for organizing configuration items for things such as modules. - if (! str_contains($key, '::')) { - $segments = explode('.', $key); - - $parsed = $this->parseBasicSegments($segments); - } else { - $parsed = $this->parseNamespacedSegments($key); - } - - // Once we have the parsed array of this key's elements, such as its groups - // and namespace, we will cache each array inside a simple list that has - // the key and the parsed array for quick look-ups for later requests. - return $this->parsed[$key] = $parsed; - } - - /** - * Parse an array of basic segments. - * - * @param array $segments - * @return array - */ - protected function parseBasicSegments(array $segments) - { - // The first segment in a basic array will always be the group, so we can go - // ahead and grab that segment. If there is only one total segment we are - // just pulling an entire group out of the array and not a single item. - $group = $segments[0]; - - // If there is more than one segment in this group, it means we are pulling - // a specific item out of a group and will need to return this item name - // as well as the group so we know which item to pull from the arrays. - $item = count($segments) === 1 - ? null - : implode('.', array_slice($segments, 1)); - - return [null, $group, $item]; - } - - /** - * Parse an array of namespaced segments. - * - * @param string $key - * @return array - */ - protected function parseNamespacedSegments($key) - { - [$namespace, $item] = explode('::', $key); - - // First we'll just explode the first segment to get the namespace and group - // since the item should be in the remaining segments. Once we have these - // two pieces of data we can proceed with parsing out the item's value. - $itemSegments = explode('.', $item); - - $groupAndItem = array_slice( - $this->parseBasicSegments($itemSegments), 1 - ); - - return array_merge([$namespace], $groupAndItem); - } - - /** - * Set the parsed value of a key. - * - * @param string $key - * @param array $parsed - * @return void - */ - public function setParsedKey($key, $parsed) - { - $this->parsed[$key] = $parsed; - } - - /** - * Flush the cache of parsed keys. - * - * @return void - */ - public function flushParsedKeys() - { - $this->parsed = []; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Optional.php b/vendor/laravel/framework/src/Illuminate/Support/Optional.php deleted file mode 100644 index ba84a2cc..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Optional.php +++ /dev/null @@ -1,131 +0,0 @@ -value = $value; - } - - /** - * Dynamically access a property on the underlying object. - * - * @param string $key - * @return mixed - */ - public function __get($key) - { - if (is_object($this->value)) { - return $this->value->{$key} ?? null; - } - } - - /** - * Dynamically check a property exists on the underlying object. - * - * @param mixed $name - * @return bool - */ - public function __isset($name) - { - if (is_object($this->value)) { - return isset($this->value->{$name}); - } - - if (is_array($this->value) || $this->value instanceof ArrayObject) { - return isset($this->value[$name]); - } - - return false; - } - - /** - * Determine if an item exists at an offset. - * - * @param mixed $key - * @return bool - */ - public function offsetExists($key): bool - { - return Arr::accessible($this->value) && Arr::exists($this->value, $key); - } - - /** - * Get an item at a given offset. - * - * @param mixed $key - * @return mixed - */ - public function offsetGet($key): mixed - { - return Arr::get($this->value, $key); - } - - /** - * Set the item at a given offset. - * - * @param mixed $key - * @param mixed $value - * @return void - */ - public function offsetSet($key, $value): void - { - if (Arr::accessible($this->value)) { - $this->value[$key] = $value; - } - } - - /** - * Unset the item at a given offset. - * - * @param string $key - * @return void - */ - public function offsetUnset($key): void - { - if (Arr::accessible($this->value)) { - unset($this->value[$key]); - } - } - - /** - * Dynamically pass a method to the underlying object. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - if (static::hasMacro($method)) { - return $this->macroCall($method, $parameters); - } - - if (is_object($this->value)) { - return $this->value->{$method}(...$parameters); - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Pluralizer.php b/vendor/laravel/framework/src/Illuminate/Support/Pluralizer.php deleted file mode 100755 index 9a9228c7..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Pluralizer.php +++ /dev/null @@ -1,129 +0,0 @@ -pluralize($value); - - return static::matchCase($plural, $value); - } - - /** - * Get the singular form of an English word. - * - * @param string $value - * @return string - */ - public static function singular($value) - { - $singular = static::inflector()->singularize($value); - - return static::matchCase($singular, $value); - } - - /** - * Determine if the given value is uncountable. - * - * @param string $value - * @return bool - */ - protected static function uncountable($value) - { - return in_array(strtolower($value), static::$uncountable); - } - - /** - * Attempt to match the case on two strings. - * - * @param string $value - * @param string $comparison - * @return string - */ - protected static function matchCase($value, $comparison) - { - $functions = ['mb_strtolower', 'mb_strtoupper', 'ucfirst', 'ucwords']; - - foreach ($functions as $function) { - if ($function($comparison) === $comparison) { - return $function($value); - } - } - - return $value; - } - - /** - * Get the inflector instance. - * - * @return \Doctrine\Inflector\Inflector - */ - public static function inflector() - { - if (is_null(static::$inflector)) { - static::$inflector = InflectorFactory::createForLanguage(static::$language)->build(); - } - - return static::$inflector; - } - - /** - * Specify the language that should be used by the inflector. - * - * @param string $language - * @return void - */ - public static function useLanguage(string $language) - { - static::$language = $language; - - static::$inflector = null; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/ProcessUtils.php b/vendor/laravel/framework/src/Illuminate/Support/ProcessUtils.php deleted file mode 100644 index 165e7516..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/ProcessUtils.php +++ /dev/null @@ -1,69 +0,0 @@ - 2 && $char === $arg[0] && $char === $arg[strlen($arg) - 1]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Reflector.php b/vendor/laravel/framework/src/Illuminate/Support/Reflector.php deleted file mode 100644 index 1390c9da..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Reflector.php +++ /dev/null @@ -1,162 +0,0 @@ -isPublic(); - } - - if (is_object($var[0]) && method_exists($class, '__call')) { - return (new ReflectionMethod($class, '__call'))->isPublic(); - } - - if (! is_object($var[0]) && method_exists($class, '__callStatic')) { - return (new ReflectionMethod($class, '__callStatic'))->isPublic(); - } - - return false; - } - - /** - * Get the class name of the given parameter's type, if possible. - * - * @param \ReflectionParameter $parameter - * @return string|null - */ - public static function getParameterClassName($parameter) - { - $type = $parameter->getType(); - - if (! $type instanceof ReflectionNamedType || $type->isBuiltin()) { - return; - } - - return static::getTypeName($parameter, $type); - } - - /** - * Get the class names of the given parameter's type, including union types. - * - * @param \ReflectionParameter $parameter - * @return array - */ - public static function getParameterClassNames($parameter) - { - $type = $parameter->getType(); - - if (! $type instanceof ReflectionUnionType) { - return array_filter([static::getParameterClassName($parameter)]); - } - - $unionTypes = []; - - foreach ($type->getTypes() as $listedType) { - if (! $listedType instanceof ReflectionNamedType || $listedType->isBuiltin()) { - continue; - } - - $unionTypes[] = static::getTypeName($parameter, $listedType); - } - - return array_filter($unionTypes); - } - - /** - * Get the given type's class name. - * - * @param \ReflectionParameter $parameter - * @param \ReflectionNamedType $type - * @return string - */ - protected static function getTypeName($parameter, $type) - { - $name = $type->getName(); - - if (! is_null($class = $parameter->getDeclaringClass())) { - if ($name === 'self') { - return $class->getName(); - } - - if ($name === 'parent' && $parent = $class->getParentClass()) { - return $parent->getName(); - } - } - - return $name; - } - - /** - * Determine if the parameter's type is a subclass of the given type. - * - * @param \ReflectionParameter $parameter - * @param string $className - * @return bool - */ - public static function isParameterSubclassOf($parameter, $className) - { - $paramClassName = static::getParameterClassName($parameter); - - return $paramClassName - && (class_exists($paramClassName) || interface_exists($paramClassName)) - && (new ReflectionClass($paramClassName))->isSubclassOf($className); - } - - /** - * Determine if the parameter's type is a Backed Enum with a string backing type. - * - * @param \ReflectionParameter $parameter - * @return bool - */ - public static function isParameterBackedEnumWithStringBackingType($parameter) - { - $backedEnumClass = (string) $parameter->getType(); - - if (function_exists('enum_exists') && enum_exists($backedEnumClass)) { - $reflectionBackedEnum = new ReflectionEnum($backedEnumClass); - - return $reflectionBackedEnum->isBacked() - && $reflectionBackedEnum->getBackingType()->getName() == 'string'; - } - - return false; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php b/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php deleted file mode 100755 index 6c530c12..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php +++ /dev/null @@ -1,437 +0,0 @@ -app = $app; - } - - /** - * Register any application services. - * - * @return void - */ - public function register() - { - // - } - - /** - * Register a booting callback to be run before the "boot" method is called. - * - * @param \Closure $callback - * @return void - */ - public function booting(Closure $callback) - { - $this->bootingCallbacks[] = $callback; - } - - /** - * Register a booted callback to be run after the "boot" method is called. - * - * @param \Closure $callback - * @return void - */ - public function booted(Closure $callback) - { - $this->bootedCallbacks[] = $callback; - } - - /** - * Call the registered booting callbacks. - * - * @return void - */ - public function callBootingCallbacks() - { - $index = 0; - - while ($index < count($this->bootingCallbacks)) { - $this->app->call($this->bootingCallbacks[$index]); - - $index++; - } - } - - /** - * Call the registered booted callbacks. - * - * @return void - */ - public function callBootedCallbacks() - { - $index = 0; - - while ($index < count($this->bootedCallbacks)) { - $this->app->call($this->bootedCallbacks[$index]); - - $index++; - } - } - - /** - * Merge the given configuration with the existing configuration. - * - * @param string $path - * @param string $key - * @return void - */ - protected function mergeConfigFrom($path, $key) - { - if (! ($this->app instanceof CachesConfiguration && $this->app->configurationIsCached())) { - $config = $this->app->make('config'); - - $config->set($key, array_merge( - require $path, $config->get($key, []) - )); - } - } - - /** - * Load the given routes file if routes are not already cached. - * - * @param string $path - * @return void - */ - protected function loadRoutesFrom($path) - { - if (! ($this->app instanceof CachesRoutes && $this->app->routesAreCached())) { - require $path; - } - } - - /** - * Register a view file namespace. - * - * @param string|array $path - * @param string $namespace - * @return void - */ - protected function loadViewsFrom($path, $namespace) - { - $this->callAfterResolving('view', function ($view) use ($path, $namespace) { - if (isset($this->app->config['view']['paths']) && - is_array($this->app->config['view']['paths'])) { - foreach ($this->app->config['view']['paths'] as $viewPath) { - if (is_dir($appPath = $viewPath.'/vendor/'.$namespace)) { - $view->addNamespace($namespace, $appPath); - } - } - } - - $view->addNamespace($namespace, $path); - }); - } - - /** - * Register the given view components with a custom prefix. - * - * @param string $prefix - * @param array $components - * @return void - */ - protected function loadViewComponentsAs($prefix, array $components) - { - $this->callAfterResolving(BladeCompiler::class, function ($blade) use ($prefix, $components) { - foreach ($components as $alias => $component) { - $blade->component($component, is_string($alias) ? $alias : null, $prefix); - } - }); - } - - /** - * Register a translation file namespace. - * - * @param string $path - * @param string $namespace - * @return void - */ - protected function loadTranslationsFrom($path, $namespace) - { - $this->callAfterResolving('translator', function ($translator) use ($path, $namespace) { - $translator->addNamespace($namespace, $path); - }); - } - - /** - * Register a JSON translation file path. - * - * @param string $path - * @return void - */ - protected function loadJsonTranslationsFrom($path) - { - $this->callAfterResolving('translator', function ($translator) use ($path) { - $translator->addJsonPath($path); - }); - } - - /** - * Register database migration paths. - * - * @param array|string $paths - * @return void - */ - protected function loadMigrationsFrom($paths) - { - $this->callAfterResolving('migrator', function ($migrator) use ($paths) { - foreach ((array) $paths as $path) { - $migrator->path($path); - } - }); - } - - /** - * Register Eloquent model factory paths. - * - * @deprecated Will be removed in a future Laravel version. - * - * @param array|string $paths - * @return void - */ - protected function loadFactoriesFrom($paths) - { - $this->callAfterResolving(ModelFactory::class, function ($factory) use ($paths) { - foreach ((array) $paths as $path) { - $factory->load($path); - } - }); - } - - /** - * Setup an after resolving listener, or fire immediately if already resolved. - * - * @param string $name - * @param callable $callback - * @return void - */ - protected function callAfterResolving($name, $callback) - { - $this->app->afterResolving($name, $callback); - - if ($this->app->resolved($name)) { - $callback($this->app->make($name), $this->app); - } - } - - /** - * Register paths to be published by the publish command. - * - * @param array $paths - * @param mixed $groups - * @return void - */ - protected function publishes(array $paths, $groups = null) - { - $this->ensurePublishArrayInitialized($class = static::class); - - static::$publishes[$class] = array_merge(static::$publishes[$class], $paths); - - foreach ((array) $groups as $group) { - $this->addPublishGroup($group, $paths); - } - } - - /** - * Ensure the publish array for the service provider is initialized. - * - * @param string $class - * @return void - */ - protected function ensurePublishArrayInitialized($class) - { - if (! array_key_exists($class, static::$publishes)) { - static::$publishes[$class] = []; - } - } - - /** - * Add a publish group / tag to the service provider. - * - * @param string $group - * @param array $paths - * @return void - */ - protected function addPublishGroup($group, $paths) - { - if (! array_key_exists($group, static::$publishGroups)) { - static::$publishGroups[$group] = []; - } - - static::$publishGroups[$group] = array_merge( - static::$publishGroups[$group], $paths - ); - } - - /** - * Get the paths to publish. - * - * @param string|null $provider - * @param string|null $group - * @return array - */ - public static function pathsToPublish($provider = null, $group = null) - { - if (! is_null($paths = static::pathsForProviderOrGroup($provider, $group))) { - return $paths; - } - - return collect(static::$publishes)->reduce(function ($paths, $p) { - return array_merge($paths, $p); - }, []); - } - - /** - * Get the paths for the provider or group (or both). - * - * @param string|null $provider - * @param string|null $group - * @return array - */ - protected static function pathsForProviderOrGroup($provider, $group) - { - if ($provider && $group) { - return static::pathsForProviderAndGroup($provider, $group); - } elseif ($group && array_key_exists($group, static::$publishGroups)) { - return static::$publishGroups[$group]; - } elseif ($provider && array_key_exists($provider, static::$publishes)) { - return static::$publishes[$provider]; - } elseif ($group || $provider) { - return []; - } - } - - /** - * Get the paths for the provider and group. - * - * @param string $provider - * @param string $group - * @return array - */ - protected static function pathsForProviderAndGroup($provider, $group) - { - if (! empty(static::$publishes[$provider]) && ! empty(static::$publishGroups[$group])) { - return array_intersect_key(static::$publishes[$provider], static::$publishGroups[$group]); - } - - return []; - } - - /** - * Get the service providers available for publishing. - * - * @return array - */ - public static function publishableProviders() - { - return array_keys(static::$publishes); - } - - /** - * Get the groups available for publishing. - * - * @return array - */ - public static function publishableGroups() - { - return array_keys(static::$publishGroups); - } - - /** - * Register the package's custom Artisan commands. - * - * @param array|mixed $commands - * @return void - */ - public function commands($commands) - { - $commands = is_array($commands) ? $commands : func_get_args(); - - Artisan::starting(function ($artisan) use ($commands) { - $artisan->resolveCommands($commands); - }); - } - - /** - * Get the services provided by the provider. - * - * @return array - */ - public function provides() - { - return []; - } - - /** - * Get the events that trigger this service provider to register. - * - * @return array - */ - public function when() - { - return []; - } - - /** - * Determine if the provider is deferred. - * - * @return bool - */ - public function isDeferred() - { - return $this instanceof DeferrableProvider; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Str.php b/vendor/laravel/framework/src/Illuminate/Support/Str.php deleted file mode 100644 index 8b23bfad..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Str.php +++ /dev/null @@ -1,1365 +0,0 @@ - $needles - * @param bool $ignoreCase - * @return bool - */ - public static function contains($haystack, $needles, $ignoreCase = false) - { - if ($ignoreCase) { - $haystack = mb_strtolower($haystack); - } - - if (! is_iterable($needles)) { - $needles = (array) $needles; - } - - foreach ($needles as $needle) { - if ($ignoreCase) { - $needle = mb_strtolower($needle); - } - - if ($needle !== '' && str_contains($haystack, $needle)) { - return true; - } - } - - return false; - } - - /** - * Determine if a given string contains all array values. - * - * @param string $haystack - * @param iterable $needles - * @param bool $ignoreCase - * @return bool - */ - public static function containsAll($haystack, $needles, $ignoreCase = false) - { - foreach ($needles as $needle) { - if (! static::contains($haystack, $needle, $ignoreCase)) { - return false; - } - } - - return true; - } - - /** - * Determine if a given string ends with a given substring. - * - * @param string $haystack - * @param string|iterable $needles - * @return bool - */ - public static function endsWith($haystack, $needles) - { - if (! is_iterable($needles)) { - $needles = (array) $needles; - } - - foreach ($needles as $needle) { - if ((string) $needle !== '' && str_ends_with($haystack, $needle)) { - return true; - } - } - - return false; - } - - /** - * Extracts an excerpt from text that matches the first instance of a phrase. - * - * @param string $text - * @param string $phrase - * @param array $options - * @return string|null - */ - public static function excerpt($text, $phrase = '', $options = []) - { - $radius = $options['radius'] ?? 100; - $omission = $options['omission'] ?? '...'; - - preg_match('/^(.*?)('.preg_quote((string) $phrase).')(.*)$/iu', (string) $text, $matches); - - if (empty($matches)) { - return null; - } - - $start = ltrim($matches[1]); - - $start = str(mb_substr($start, max(mb_strlen($start, 'UTF-8') - $radius, 0), $radius, 'UTF-8'))->ltrim()->unless( - fn ($startWithRadius) => $startWithRadius->exactly($start), - fn ($startWithRadius) => $startWithRadius->prepend($omission), - ); - - $end = rtrim($matches[3]); - - $end = str(mb_substr($end, 0, $radius, 'UTF-8'))->rtrim()->unless( - fn ($endWithRadius) => $endWithRadius->exactly($end), - fn ($endWithRadius) => $endWithRadius->append($omission), - ); - - return $start->append($matches[2], $end)->toString(); - } - - /** - * Cap a string with a single instance of a given value. - * - * @param string $value - * @param string $cap - * @return string - */ - public static function finish($value, $cap) - { - $quoted = preg_quote($cap, '/'); - - return preg_replace('/(?:'.$quoted.')+$/u', '', $value).$cap; - } - - /** - * Wrap the string with the given strings. - * - * @param string $value - * @param string $before - * @param string|null $after - * @return string - */ - public static function wrap($value, $before, $after = null) - { - return $before.$value.($after ??= $before); - } - - /** - * Determine if a given string matches a given pattern. - * - * @param string|iterable $pattern - * @param string $value - * @return bool - */ - public static function is($pattern, $value) - { - $value = (string) $value; - - if (! is_iterable($pattern)) { - $pattern = [$pattern]; - } - - foreach ($pattern as $pattern) { - $pattern = (string) $pattern; - - // If the given value is an exact match we can of course return true right - // from the beginning. Otherwise, we will translate asterisks and do an - // actual pattern match against the two strings to see if they match. - if ($pattern === $value) { - return true; - } - - $pattern = preg_quote($pattern, '#'); - - // Asterisks are translated into zero-or-more regular expression wildcards - // to make it convenient to check if the strings starts with the given - // pattern such as "library/*", making any string check convenient. - $pattern = str_replace('\*', '.*', $pattern); - - if (preg_match('#^'.$pattern.'\z#u', $value) === 1) { - return true; - } - } - - return false; - } - - /** - * Determine if a given string is 7 bit ASCII. - * - * @param string $value - * @return bool - */ - public static function isAscii($value) - { - return ASCII::is_ascii((string) $value); - } - - /** - * Determine if a given string is valid JSON. - * - * @param string $value - * @return bool - */ - public static function isJson($value) - { - if (! is_string($value)) { - return false; - } - - try { - json_decode($value, true, 512, JSON_THROW_ON_ERROR); - } catch (JsonException) { - return false; - } - - return true; - } - - /** - * Determine if a given string is a valid UUID. - * - * @param string $value - * @return bool - */ - public static function isUuid($value) - { - if (! is_string($value)) { - return false; - } - - return preg_match('/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iD', $value) > 0; - } - - /** - * Determine if a given string is a valid ULID. - * - * @param string $value - * @return bool - */ - public static function isUlid($value) - { - if (! is_string($value)) { - return false; - } - - return Ulid::isValid($value); - } - - /** - * Convert a string to kebab case. - * - * @param string $value - * @return string - */ - public static function kebab($value) - { - return static::snake($value, '-'); - } - - /** - * Return the length of the given string. - * - * @param string $value - * @param string|null $encoding - * @return int - */ - public static function length($value, $encoding = null) - { - if ($encoding) { - return mb_strlen($value, $encoding); - } - - return mb_strlen($value); - } - - /** - * Limit the number of characters in a string. - * - * @param string $value - * @param int $limit - * @param string $end - * @return string - */ - public static function limit($value, $limit = 100, $end = '...') - { - if (mb_strwidth($value, 'UTF-8') <= $limit) { - return $value; - } - - return rtrim(mb_strimwidth($value, 0, $limit, '', 'UTF-8')).$end; - } - - /** - * Convert the given string to lower-case. - * - * @param string $value - * @return string - */ - public static function lower($value) - { - return mb_strtolower($value, 'UTF-8'); - } - - /** - * Limit the number of words in a string. - * - * @param string $value - * @param int $words - * @param string $end - * @return string - */ - public static function words($value, $words = 100, $end = '...') - { - preg_match('/^\s*+(?:\S++\s*+){1,'.$words.'}/u', $value, $matches); - - if (! isset($matches[0]) || static::length($value) === static::length($matches[0])) { - return $value; - } - - return rtrim($matches[0]).$end; - } - - /** - * Converts GitHub flavored Markdown into HTML. - * - * @param string $string - * @param array $options - * @return string - */ - public static function markdown($string, array $options = []) - { - $converter = new GithubFlavoredMarkdownConverter($options); - - return (string) $converter->convert($string); - } - - /** - * Converts inline Markdown into HTML. - * - * @param string $string - * @param array $options - * @return string - */ - public static function inlineMarkdown($string, array $options = []) - { - $environment = new Environment($options); - - $environment->addExtension(new GithubFlavoredMarkdownExtension()); - $environment->addExtension(new InlinesOnlyExtension()); - - $converter = new MarkdownConverter($environment); - - return (string) $converter->convert($string); - } - - /** - * Masks a portion of a string with a repeated character. - * - * @param string $string - * @param string $character - * @param int $index - * @param int|null $length - * @param string $encoding - * @return string - */ - public static function mask($string, $character, $index, $length = null, $encoding = 'UTF-8') - { - if ($character === '') { - return $string; - } - - $segment = mb_substr($string, $index, $length, $encoding); - - if ($segment === '') { - return $string; - } - - $strlen = mb_strlen($string, $encoding); - $startIndex = $index; - - if ($index < 0) { - $startIndex = $index < -$strlen ? 0 : $strlen + $index; - } - - $start = mb_substr($string, 0, $startIndex, $encoding); - $segmentLen = mb_strlen($segment, $encoding); - $end = mb_substr($string, $startIndex + $segmentLen); - - return $start.str_repeat(mb_substr($character, 0, 1, $encoding), $segmentLen).$end; - } - - /** - * Get the string matching the given pattern. - * - * @param string $pattern - * @param string $subject - * @return string - */ - public static function match($pattern, $subject) - { - preg_match($pattern, $subject, $matches); - - if (! $matches) { - return ''; - } - - return $matches[1] ?? $matches[0]; - } - - /** - * Get the string matching the given pattern. - * - * @param string $pattern - * @param string $subject - * @return \Illuminate\Support\Collection - */ - public static function matchAll($pattern, $subject) - { - preg_match_all($pattern, $subject, $matches); - - if (empty($matches[0])) { - return collect(); - } - - return collect($matches[1] ?? $matches[0]); - } - - /** - * Pad both sides of a string with another. - * - * @param string $value - * @param int $length - * @param string $pad - * @return string - */ - public static function padBoth($value, $length, $pad = ' ') - { - $short = max(0, $length - mb_strlen($value)); - $shortLeft = floor($short / 2); - $shortRight = ceil($short / 2); - - return mb_substr(str_repeat($pad, $shortLeft), 0, $shortLeft). - $value. - mb_substr(str_repeat($pad, $shortRight), 0, $shortRight); - } - - /** - * Pad the left side of a string with another. - * - * @param string $value - * @param int $length - * @param string $pad - * @return string - */ - public static function padLeft($value, $length, $pad = ' ') - { - $short = max(0, $length - mb_strlen($value)); - - return mb_substr(str_repeat($pad, $short), 0, $short).$value; - } - - /** - * Pad the right side of a string with another. - * - * @param string $value - * @param int $length - * @param string $pad - * @return string - */ - public static function padRight($value, $length, $pad = ' ') - { - $short = max(0, $length - mb_strlen($value)); - - return $value.mb_substr(str_repeat($pad, $short), 0, $short); - } - - /** - * Parse a Class[@]method style callback into class and method. - * - * @param string $callback - * @param string|null $default - * @return array - */ - public static function parseCallback($callback, $default = null) - { - return static::contains($callback, '@') ? explode('@', $callback, 2) : [$callback, $default]; - } - - /** - * Get the plural form of an English word. - * - * @param string $value - * @param int|array|\Countable $count - * @return string - */ - public static function plural($value, $count = 2) - { - return Pluralizer::plural($value, $count); - } - - /** - * Pluralize the last word of an English, studly caps case string. - * - * @param string $value - * @param int|array|\Countable $count - * @return string - */ - public static function pluralStudly($value, $count = 2) - { - $parts = preg_split('/(.)(?=[A-Z])/u', $value, -1, PREG_SPLIT_DELIM_CAPTURE); - - $lastWord = array_pop($parts); - - return implode('', $parts).self::plural($lastWord, $count); - } - - /** - * Generate a more truly "random" alpha-numeric string. - * - * @param int $length - * @return string - */ - public static function random($length = 16) - { - return (static::$randomStringFactory ?? function ($length) { - $string = ''; - - while (($len = strlen($string)) < $length) { - $size = $length - $len; - - $bytes = random_bytes($size); - - $string .= substr(str_replace(['/', '+', '='], '', base64_encode($bytes)), 0, $size); - } - - return $string; - })($length); - } - - /** - * Set the callable that will be used to generate random strings. - * - * @param callable|null $factory - * @return void - */ - public static function createRandomStringsUsing(callable $factory = null) - { - static::$randomStringFactory = $factory; - } - - /** - * Set the sequence that will be used to generate random strings. - * - * @param array $sequence - * @param callable|null $whenMissing - * @return void - */ - public static function createRandomStringsUsingSequence(array $sequence, $whenMissing = null) - { - $next = 0; - - $whenMissing ??= function ($length) use (&$next) { - $factoryCache = static::$randomStringFactory; - - static::$randomStringFactory = null; - - $randomString = static::random($length); - - static::$randomStringFactory = $factoryCache; - - $next++; - - return $randomString; - }; - - static::createRandomStringsUsing(function ($length) use (&$next, $sequence, $whenMissing) { - if (array_key_exists($next, $sequence)) { - return $sequence[$next++]; - } - - return $whenMissing($length); - }); - } - - /** - * Indicate that random strings should be created normally and not using a custom factory. - * - * @return void - */ - public static function createRandomStringsNormally() - { - static::$randomStringFactory = null; - } - - /** - * Repeat the given string. - * - * @param string $string - * @param int $times - * @return string - */ - public static function repeat(string $string, int $times) - { - return str_repeat($string, $times); - } - - /** - * Replace a given value in the string sequentially with an array. - * - * @param string $search - * @param iterable $replace - * @param string $subject - * @return string - */ - public static function replaceArray($search, $replace, $subject) - { - if ($replace instanceof Traversable) { - $replace = collect($replace)->all(); - } - - $segments = explode($search, $subject); - - $result = array_shift($segments); - - foreach ($segments as $segment) { - $result .= (array_shift($replace) ?? $search).$segment; - } - - return $result; - } - - /** - * Replace the given value in the given string. - * - * @param string|iterable $search - * @param string|iterable $replace - * @param string|iterable $subject - * @return string - */ - public static function replace($search, $replace, $subject) - { - if ($search instanceof Traversable) { - $search = collect($search)->all(); - } - - if ($replace instanceof Traversable) { - $replace = collect($replace)->all(); - } - - if ($subject instanceof Traversable) { - $subject = collect($subject)->all(); - } - - return str_replace($search, $replace, $subject); - } - - /** - * Replace the first occurrence of a given value in the string. - * - * @param string $search - * @param string $replace - * @param string $subject - * @return string - */ - public static function replaceFirst($search, $replace, $subject) - { - $search = (string) $search; - - if ($search === '') { - return $subject; - } - - $position = strpos($subject, $search); - - if ($position !== false) { - return substr_replace($subject, $replace, $position, strlen($search)); - } - - return $subject; - } - - /** - * Replace the last occurrence of a given value in the string. - * - * @param string $search - * @param string $replace - * @param string $subject - * @return string - */ - public static function replaceLast($search, $replace, $subject) - { - if ($search === '') { - return $subject; - } - - $position = strrpos($subject, $search); - - if ($position !== false) { - return substr_replace($subject, $replace, $position, strlen($search)); - } - - return $subject; - } - - /** - * Remove any occurrence of the given string in the subject. - * - * @param string|iterable $search - * @param string $subject - * @param bool $caseSensitive - * @return string - */ - public static function remove($search, $subject, $caseSensitive = true) - { - if ($search instanceof Traversable) { - $search = collect($search)->all(); - } - - $subject = $caseSensitive - ? str_replace($search, '', $subject) - : str_ireplace($search, '', $subject); - - return $subject; - } - - /** - * Reverse the given string. - * - * @param string $value - * @return string - */ - public static function reverse(string $value) - { - return implode(array_reverse(mb_str_split($value))); - } - - /** - * Begin a string with a single instance of a given value. - * - * @param string $value - * @param string $prefix - * @return string - */ - public static function start($value, $prefix) - { - $quoted = preg_quote($prefix, '/'); - - return $prefix.preg_replace('/^(?:'.$quoted.')+/u', '', $value); - } - - /** - * Convert the given string to upper-case. - * - * @param string $value - * @return string - */ - public static function upper($value) - { - return mb_strtoupper($value, 'UTF-8'); - } - - /** - * Convert the given string to title case. - * - * @param string $value - * @return string - */ - public static function title($value) - { - return mb_convert_case($value, MB_CASE_TITLE, 'UTF-8'); - } - - /** - * Convert the given string to title case for each word. - * - * @param string $value - * @return string - */ - public static function headline($value) - { - $parts = explode(' ', $value); - - $parts = count($parts) > 1 - ? array_map([static::class, 'title'], $parts) - : array_map([static::class, 'title'], static::ucsplit(implode('_', $parts))); - - $collapsed = static::replace(['-', '_', ' '], '_', implode('_', $parts)); - - return implode(' ', array_filter(explode('_', $collapsed))); - } - - /** - * Get the singular form of an English word. - * - * @param string $value - * @return string - */ - public static function singular($value) - { - return Pluralizer::singular($value); - } - - /** - * Generate a URL friendly "slug" from a given string. - * - * @param string $title - * @param string $separator - * @param string|null $language - * @param array $dictionary - * @return string - */ - public static function slug($title, $separator = '-', $language = 'en', $dictionary = ['@' => 'at']) - { - $title = $language ? static::ascii($title, $language) : $title; - - // Convert all dashes/underscores into separator - $flip = $separator === '-' ? '_' : '-'; - - $title = preg_replace('!['.preg_quote($flip).']+!u', $separator, $title); - - // Replace dictionary words - foreach ($dictionary as $key => $value) { - $dictionary[$key] = $separator.$value.$separator; - } - - $title = str_replace(array_keys($dictionary), array_values($dictionary), $title); - - // Remove all characters that are not the separator, letters, numbers, or whitespace - $title = preg_replace('![^'.preg_quote($separator).'\pL\pN\s]+!u', '', static::lower($title)); - - // Replace all separator characters and whitespace by a single separator - $title = preg_replace('!['.preg_quote($separator).'\s]+!u', $separator, $title); - - return trim($title, $separator); - } - - /** - * Convert a string to snake case. - * - * @param string $value - * @param string $delimiter - * @return string - */ - public static function snake($value, $delimiter = '_') - { - $key = $value; - - if (isset(static::$snakeCache[$key][$delimiter])) { - return static::$snakeCache[$key][$delimiter]; - } - - if (! ctype_lower($value)) { - $value = preg_replace('/\s+/u', '', ucwords($value)); - - $value = static::lower(preg_replace('/(.)(?=[A-Z])/u', '$1'.$delimiter, $value)); - } - - return static::$snakeCache[$key][$delimiter] = $value; - } - - /** - * Remove all "extra" blank space from the given string. - * - * @param string $value - * @return string - */ - public static function squish($value) - { - return preg_replace('~(\s|\x{3164})+~u', ' ', preg_replace('~^[\s]+|[\s]+$~u', '', $value)); - } - - /** - * Determine if a given string starts with a given substring. - * - * @param string $haystack - * @param string|iterable $needles - * @return bool - */ - public static function startsWith($haystack, $needles) - { - if (! is_iterable($needles)) { - $needles = [$needles]; - } - - foreach ($needles as $needle) { - if ((string) $needle !== '' && str_starts_with($haystack, $needle)) { - return true; - } - } - - return false; - } - - /** - * Convert a value to studly caps case. - * - * @param string $value - * @return string - */ - public static function studly($value) - { - $key = $value; - - if (isset(static::$studlyCache[$key])) { - return static::$studlyCache[$key]; - } - - $words = explode(' ', static::replace(['-', '_'], ' ', $value)); - - $studlyWords = array_map(fn ($word) => static::ucfirst($word), $words); - - return static::$studlyCache[$key] = implode($studlyWords); - } - - /** - * Returns the portion of the string specified by the start and length parameters. - * - * @param string $string - * @param int $start - * @param int|null $length - * @param string $encoding - * @return string - */ - public static function substr($string, $start, $length = null, $encoding = 'UTF-8') - { - return mb_substr($string, $start, $length, $encoding); - } - - /** - * Returns the number of substring occurrences. - * - * @param string $haystack - * @param string $needle - * @param int $offset - * @param int|null $length - * @return int - */ - public static function substrCount($haystack, $needle, $offset = 0, $length = null) - { - if (! is_null($length)) { - return substr_count($haystack, $needle, $offset, $length); - } - - return substr_count($haystack, $needle, $offset); - } - - /** - * Replace text within a portion of a string. - * - * @param string|string[] $string - * @param string|string[] $replace - * @param int|int[] $offset - * @param int|int[]|null $length - * @return string|string[] - */ - public static function substrReplace($string, $replace, $offset = 0, $length = null) - { - if ($length === null) { - $length = strlen($string); - } - - return substr_replace($string, $replace, $offset, $length); - } - - /** - * Swap multiple keywords in a string with other keywords. - * - * @param array $map - * @param string $subject - * @return string - */ - public static function swap(array $map, $subject) - { - return strtr($subject, $map); - } - - /** - * Make a string's first character lowercase. - * - * @param string $string - * @return string - */ - public static function lcfirst($string) - { - return static::lower(static::substr($string, 0, 1)).static::substr($string, 1); - } - - /** - * Make a string's first character uppercase. - * - * @param string $string - * @return string - */ - public static function ucfirst($string) - { - return static::upper(static::substr($string, 0, 1)).static::substr($string, 1); - } - - /** - * Split a string into pieces by uppercase characters. - * - * @param string $string - * @return string[] - */ - public static function ucsplit($string) - { - return preg_split('/(?=\p{Lu})/u', $string, -1, PREG_SPLIT_NO_EMPTY); - } - - /** - * Get the number of words a string contains. - * - * @param string $string - * @param string|null $characters - * @return int - */ - public static function wordCount($string, $characters = null) - { - return str_word_count($string, 0, $characters); - } - - /** - * Generate a UUID (version 4). - * - * @return \Ramsey\Uuid\UuidInterface - */ - public static function uuid() - { - return static::$uuidFactory - ? call_user_func(static::$uuidFactory) - : Uuid::uuid4(); - } - - /** - * Generate a time-ordered UUID (version 4). - * - * @return \Ramsey\Uuid\UuidInterface - */ - public static function orderedUuid() - { - if (static::$uuidFactory) { - return call_user_func(static::$uuidFactory); - } - - $factory = new UuidFactory; - - $factory->setRandomGenerator(new CombGenerator( - $factory->getRandomGenerator(), - $factory->getNumberConverter() - )); - - $factory->setCodec(new TimestampFirstCombCodec( - $factory->getUuidBuilder() - )); - - return $factory->uuid4(); - } - - /** - * Set the callable that will be used to generate UUIDs. - * - * @param callable|null $factory - * @return void - */ - public static function createUuidsUsing(callable $factory = null) - { - static::$uuidFactory = $factory; - } - - /** - * Set the sequence that will be used to generate UUIDs. - * - * @param array $sequence - * @param callable|null $whenMissing - * @return void - */ - public static function createUuidsUsingSequence(array $sequence, $whenMissing = null) - { - $next = 0; - - $whenMissing ??= function () use (&$next) { - $factoryCache = static::$uuidFactory; - - static::$uuidFactory = null; - - $uuid = static::uuid(); - - static::$uuidFactory = $factoryCache; - - $next++; - - return $uuid; - }; - - static::createUuidsUsing(function () use (&$next, $sequence, $whenMissing) { - if (array_key_exists($next, $sequence)) { - return $sequence[$next++]; - } - - return $whenMissing(); - }); - } - - /** - * Always return the same UUID when generating new UUIDs. - * - * @param \Closure|null $callback - * @return \Ramsey\Uuid\UuidInterface - */ - public static function freezeUuids(Closure $callback = null) - { - $uuid = Str::uuid(); - - Str::createUuidsUsing(fn () => $uuid); - - if ($callback !== null) { - try { - $callback($uuid); - } finally { - Str::createUuidsNormally(); - } - } - - return $uuid; - } - - /** - * Indicate that UUIDs should be created normally and not using a custom factory. - * - * @return void - */ - public static function createUuidsNormally() - { - static::$uuidFactory = null; - } - - /** - * Generate a ULID. - * - * @return \Symfony\Component\Uid\Ulid - */ - public static function ulid() - { - return new Ulid(); - } - - /** - * Remove all strings from the casing caches. - * - * @return void - */ - public static function flushCache() - { - static::$snakeCache = []; - static::$camelCache = []; - static::$studlyCache = []; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Stringable.php b/vendor/laravel/framework/src/Illuminate/Support/Stringable.php deleted file mode 100644 index 0fc5db25..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Stringable.php +++ /dev/null @@ -1,1228 +0,0 @@ -value = (string) $value; - } - - /** - * Return the remainder of a string after the first occurrence of a given value. - * - * @param string $search - * @return static - */ - public function after($search) - { - return new static(Str::after($this->value, $search)); - } - - /** - * Return the remainder of a string after the last occurrence of a given value. - * - * @param string $search - * @return static - */ - public function afterLast($search) - { - return new static(Str::afterLast($this->value, $search)); - } - - /** - * Append the given values to the string. - * - * @param array $values - * @return static - */ - public function append(...$values) - { - return new static($this->value.implode('', $values)); - } - - /** - * Append a new line to the string. - * - * @param int $count - * @return $this - */ - public function newLine($count = 1) - { - return $this->append(str_repeat(PHP_EOL, $count)); - } - - /** - * Transliterate a UTF-8 value to ASCII. - * - * @param string $language - * @return static - */ - public function ascii($language = 'en') - { - return new static(Str::ascii($this->value, $language)); - } - - /** - * Get the trailing name component of the path. - * - * @param string $suffix - * @return static - */ - public function basename($suffix = '') - { - return new static(basename($this->value, $suffix)); - } - - /** - * Get the basename of the class path. - * - * @return static - */ - public function classBasename() - { - return new static(class_basename($this->value)); - } - - /** - * Get the portion of a string before the first occurrence of a given value. - * - * @param string $search - * @return static - */ - public function before($search) - { - return new static(Str::before($this->value, $search)); - } - - /** - * Get the portion of a string before the last occurrence of a given value. - * - * @param string $search - * @return static - */ - public function beforeLast($search) - { - return new static(Str::beforeLast($this->value, $search)); - } - - /** - * Get the portion of a string between two given values. - * - * @param string $from - * @param string $to - * @return static - */ - public function between($from, $to) - { - return new static(Str::between($this->value, $from, $to)); - } - - /** - * Get the smallest possible portion of a string between two given values. - * - * @param string $from - * @param string $to - * @return static - */ - public function betweenFirst($from, $to) - { - return new static(Str::betweenFirst($this->value, $from, $to)); - } - - /** - * Convert a value to camel case. - * - * @return static - */ - public function camel() - { - return new static(Str::camel($this->value)); - } - - /** - * Determine if a given string contains a given substring. - * - * @param string|iterable $needles - * @param bool $ignoreCase - * @return bool - */ - public function contains($needles, $ignoreCase = false) - { - return Str::contains($this->value, $needles, $ignoreCase); - } - - /** - * Determine if a given string contains all array values. - * - * @param iterable $needles - * @param bool $ignoreCase - * @return bool - */ - public function containsAll($needles, $ignoreCase = false) - { - return Str::containsAll($this->value, $needles, $ignoreCase); - } - - /** - * Get the parent directory's path. - * - * @param int $levels - * @return static - */ - public function dirname($levels = 1) - { - return new static(dirname($this->value, $levels)); - } - - /** - * Determine if a given string ends with a given substring. - * - * @param string|iterable $needles - * @return bool - */ - public function endsWith($needles) - { - return Str::endsWith($this->value, $needles); - } - - /** - * Determine if the string is an exact match with the given value. - * - * @param \Illuminate\Support\Stringable|string $value - * @return bool - */ - public function exactly($value) - { - if ($value instanceof Stringable) { - $value = $value->toString(); - } - - return $this->value === $value; - } - - /** - * Extracts an excerpt from text that matches the first instance of a phrase. - * - * @param string $phrase - * @param array $options - * @return string|null - */ - public function excerpt($phrase = '', $options = []) - { - return Str::excerpt($this->value, $phrase, $options); - } - - /** - * Explode the string into an array. - * - * @param string $delimiter - * @param int $limit - * @return \Illuminate\Support\Collection - */ - public function explode($delimiter, $limit = PHP_INT_MAX) - { - return collect(explode($delimiter, $this->value, $limit)); - } - - /** - * Split a string using a regular expression or by length. - * - * @param string|int $pattern - * @param int $limit - * @param int $flags - * @return \Illuminate\Support\Collection - */ - public function split($pattern, $limit = -1, $flags = 0) - { - if (filter_var($pattern, FILTER_VALIDATE_INT) !== false) { - return collect(mb_str_split($this->value, $pattern)); - } - - $segments = preg_split($pattern, $this->value, $limit, $flags); - - return ! empty($segments) ? collect($segments) : collect(); - } - - /** - * Cap a string with a single instance of a given value. - * - * @param string $cap - * @return static - */ - public function finish($cap) - { - return new static(Str::finish($this->value, $cap)); - } - - /** - * Determine if a given string matches a given pattern. - * - * @param string|iterable $pattern - * @return bool - */ - public function is($pattern) - { - return Str::is($pattern, $this->value); - } - - /** - * Determine if a given string is 7 bit ASCII. - * - * @return bool - */ - public function isAscii() - { - return Str::isAscii($this->value); - } - - /** - * Determine if a given string is valid JSON. - * - * @return bool - */ - public function isJson() - { - return Str::isJson($this->value); - } - - /** - * Determine if a given string is a valid UUID. - * - * @return bool - */ - public function isUuid() - { - return Str::isUuid($this->value); - } - - /** - * Determine if a given string is a valid ULID. - * - * @return bool - */ - public function isUlid() - { - return Str::isUlid($this->value); - } - - /** - * Determine if the given string is empty. - * - * @return bool - */ - public function isEmpty() - { - return $this->value === ''; - } - - /** - * Determine if the given string is not empty. - * - * @return bool - */ - public function isNotEmpty() - { - return ! $this->isEmpty(); - } - - /** - * Convert a string to kebab case. - * - * @return static - */ - public function kebab() - { - return new static(Str::kebab($this->value)); - } - - /** - * Return the length of the given string. - * - * @param string|null $encoding - * @return int - */ - public function length($encoding = null) - { - return Str::length($this->value, $encoding); - } - - /** - * Limit the number of characters in a string. - * - * @param int $limit - * @param string $end - * @return static - */ - public function limit($limit = 100, $end = '...') - { - return new static(Str::limit($this->value, $limit, $end)); - } - - /** - * Convert the given string to lower-case. - * - * @return static - */ - public function lower() - { - return new static(Str::lower($this->value)); - } - - /** - * Convert GitHub flavored Markdown into HTML. - * - * @param array $options - * @return static - */ - public function markdown(array $options = []) - { - return new static(Str::markdown($this->value, $options)); - } - - /** - * Convert inline Markdown into HTML. - * - * @param array $options - * @return static - */ - public function inlineMarkdown(array $options = []) - { - return new static(Str::inlineMarkdown($this->value, $options)); - } - - /** - * Masks a portion of a string with a repeated character. - * - * @param string $character - * @param int $index - * @param int|null $length - * @param string $encoding - * @return static - */ - public function mask($character, $index, $length = null, $encoding = 'UTF-8') - { - return new static(Str::mask($this->value, $character, $index, $length, $encoding)); - } - - /** - * Get the string matching the given pattern. - * - * @param string $pattern - * @return static - */ - public function match($pattern) - { - return new static(Str::match($pattern, $this->value)); - } - - /** - * Get the string matching the given pattern. - * - * @param string $pattern - * @return \Illuminate\Support\Collection - */ - public function matchAll($pattern) - { - return Str::matchAll($pattern, $this->value); - } - - /** - * Determine if the string matches the given pattern. - * - * @param string $pattern - * @return bool - */ - public function test($pattern) - { - return $this->match($pattern)->isNotEmpty(); - } - - /** - * Pad both sides of the string with another. - * - * @param int $length - * @param string $pad - * @return static - */ - public function padBoth($length, $pad = ' ') - { - return new static(Str::padBoth($this->value, $length, $pad)); - } - - /** - * Pad the left side of the string with another. - * - * @param int $length - * @param string $pad - * @return static - */ - public function padLeft($length, $pad = ' ') - { - return new static(Str::padLeft($this->value, $length, $pad)); - } - - /** - * Pad the right side of the string with another. - * - * @param int $length - * @param string $pad - * @return static - */ - public function padRight($length, $pad = ' ') - { - return new static(Str::padRight($this->value, $length, $pad)); - } - - /** - * Parse a Class@method style callback into class and method. - * - * @param string|null $default - * @return array - */ - public function parseCallback($default = null) - { - return Str::parseCallback($this->value, $default); - } - - /** - * Call the given callback and return a new string. - * - * @param callable $callback - * @return static - */ - public function pipe(callable $callback) - { - return new static($callback($this)); - } - - /** - * Get the plural form of an English word. - * - * @param int|array|\Countable $count - * @return static - */ - public function plural($count = 2) - { - return new static(Str::plural($this->value, $count)); - } - - /** - * Pluralize the last word of an English, studly caps case string. - * - * @param int|array|\Countable $count - * @return static - */ - public function pluralStudly($count = 2) - { - return new static(Str::pluralStudly($this->value, $count)); - } - - /** - * Prepend the given values to the string. - * - * @param array $values - * @return static - */ - public function prepend(...$values) - { - return new static(implode('', $values).$this->value); - } - - /** - * Remove any occurrence of the given string in the subject. - * - * @param string|iterable $search - * @param bool $caseSensitive - * @return static - */ - public function remove($search, $caseSensitive = true) - { - return new static(Str::remove($search, $this->value, $caseSensitive)); - } - - /** - * Reverse the string. - * - * @return static - */ - public function reverse() - { - return new static(Str::reverse($this->value)); - } - - /** - * Repeat the string. - * - * @param int $times - * @return static - */ - public function repeat(int $times) - { - return new static(str_repeat($this->value, $times)); - } - - /** - * Replace the given value in the given string. - * - * @param string|iterable $search - * @param string|iterable $replace - * @return static - */ - public function replace($search, $replace) - { - return new static(Str::replace($search, $replace, $this->value)); - } - - /** - * Replace a given value in the string sequentially with an array. - * - * @param string $search - * @param iterable $replace - * @return static - */ - public function replaceArray($search, $replace) - { - return new static(Str::replaceArray($search, $replace, $this->value)); - } - - /** - * Replace the first occurrence of a given value in the string. - * - * @param string $search - * @param string $replace - * @return static - */ - public function replaceFirst($search, $replace) - { - return new static(Str::replaceFirst($search, $replace, $this->value)); - } - - /** - * Replace the last occurrence of a given value in the string. - * - * @param string $search - * @param string $replace - * @return static - */ - public function replaceLast($search, $replace) - { - return new static(Str::replaceLast($search, $replace, $this->value)); - } - - /** - * Replace the patterns matching the given regular expression. - * - * @param string $pattern - * @param \Closure|string $replace - * @param int $limit - * @return static - */ - public function replaceMatches($pattern, $replace, $limit = -1) - { - if ($replace instanceof Closure) { - return new static(preg_replace_callback($pattern, $replace, $this->value, $limit)); - } - - return new static(preg_replace($pattern, $replace, $this->value, $limit)); - } - - /** - * Parse input from a string to a collection, according to a format. - * - * @param string $format - * @return \Illuminate\Support\Collection - */ - public function scan($format) - { - return collect(sscanf($this->value, $format)); - } - - /** - * Remove all "extra" blank space from the given string. - * - * @return static - */ - public function squish() - { - return new static(Str::squish($this->value)); - } - - /** - * Begin a string with a single instance of a given value. - * - * @param string $prefix - * @return static - */ - public function start($prefix) - { - return new static(Str::start($this->value, $prefix)); - } - - /** - * Strip HTML and PHP tags from the given string. - * - * @param string $allowedTags - * @return static - */ - public function stripTags($allowedTags = null) - { - return new static(strip_tags($this->value, $allowedTags)); - } - - /** - * Convert the given string to upper-case. - * - * @return static - */ - public function upper() - { - return new static(Str::upper($this->value)); - } - - /** - * Convert the given string to title case. - * - * @return static - */ - public function title() - { - return new static(Str::title($this->value)); - } - - /** - * Convert the given string to title case for each word. - * - * @return static - */ - public function headline() - { - return new static(Str::headline($this->value)); - } - - /** - * Get the singular form of an English word. - * - * @return static - */ - public function singular() - { - return new static(Str::singular($this->value)); - } - - /** - * Generate a URL friendly "slug" from a given string. - * - * @param string $separator - * @param string|null $language - * @param array $dictionary - * @return static - */ - public function slug($separator = '-', $language = 'en', $dictionary = ['@' => 'at']) - { - return new static(Str::slug($this->value, $separator, $language, $dictionary)); - } - - /** - * Convert a string to snake case. - * - * @param string $delimiter - * @return static - */ - public function snake($delimiter = '_') - { - return new static(Str::snake($this->value, $delimiter)); - } - - /** - * Determine if a given string starts with a given substring. - * - * @param string|iterable $needles - * @return bool - */ - public function startsWith($needles) - { - return Str::startsWith($this->value, $needles); - } - - /** - * Convert a value to studly caps case. - * - * @return static - */ - public function studly() - { - return new static(Str::studly($this->value)); - } - - /** - * Returns the portion of the string specified by the start and length parameters. - * - * @param int $start - * @param int|null $length - * @param string $encoding - * @return static - */ - public function substr($start, $length = null, $encoding = 'UTF-8') - { - return new static(Str::substr($this->value, $start, $length, $encoding)); - } - - /** - * Returns the number of substring occurrences. - * - * @param string $needle - * @param int $offset - * @param int|null $length - * @return int - */ - public function substrCount($needle, $offset = 0, $length = null) - { - return Str::substrCount($this->value, $needle, $offset, $length); - } - - /** - * Replace text within a portion of a string. - * - * @param string|string[] $replace - * @param int|int[] $offset - * @param int|int[]|null $length - * @return static - */ - public function substrReplace($replace, $offset = 0, $length = null) - { - return new static(Str::substrReplace($this->value, $replace, $offset, $length)); - } - - /** - * Swap multiple keywords in a string with other keywords. - * - * @param array $map - * @return static - */ - public function swap(array $map) - { - return new static(strtr($this->value, $map)); - } - - /** - * Trim the string of the given characters. - * - * @param string $characters - * @return static - */ - public function trim($characters = null) - { - return new static(trim(...array_merge([$this->value], func_get_args()))); - } - - /** - * Left trim the string of the given characters. - * - * @param string $characters - * @return static - */ - public function ltrim($characters = null) - { - return new static(ltrim(...array_merge([$this->value], func_get_args()))); - } - - /** - * Right trim the string of the given characters. - * - * @param string $characters - * @return static - */ - public function rtrim($characters = null) - { - return new static(rtrim(...array_merge([$this->value], func_get_args()))); - } - - /** - * Make a string's first character lowercase. - * - * @return static - */ - public function lcfirst() - { - return new static(Str::lcfirst($this->value)); - } - - /** - * Make a string's first character uppercase. - * - * @return static - */ - public function ucfirst() - { - return new static(Str::ucfirst($this->value)); - } - - /** - * Split a string by uppercase characters. - * - * @return \Illuminate\Support\Collection - */ - public function ucsplit() - { - return collect(Str::ucsplit($this->value)); - } - - /** - * Execute the given callback if the string contains a given substring. - * - * @param string|iterable $needles - * @param callable $callback - * @param callable|null $default - * @return static - */ - public function whenContains($needles, $callback, $default = null) - { - return $this->when($this->contains($needles), $callback, $default); - } - - /** - * Execute the given callback if the string contains all array values. - * - * @param iterable $needles - * @param callable $callback - * @param callable|null $default - * @return static - */ - public function whenContainsAll(array $needles, $callback, $default = null) - { - return $this->when($this->containsAll($needles), $callback, $default); - } - - /** - * Execute the given callback if the string is empty. - * - * @param callable $callback - * @param callable|null $default - * @return static - */ - public function whenEmpty($callback, $default = null) - { - return $this->when($this->isEmpty(), $callback, $default); - } - - /** - * Execute the given callback if the string is not empty. - * - * @param callable $callback - * @param callable|null $default - * @return static - */ - public function whenNotEmpty($callback, $default = null) - { - return $this->when($this->isNotEmpty(), $callback, $default); - } - - /** - * Execute the given callback if the string ends with a given substring. - * - * @param string|iterable $needles - * @param callable $callback - * @param callable|null $default - * @return static - */ - public function whenEndsWith($needles, $callback, $default = null) - { - return $this->when($this->endsWith($needles), $callback, $default); - } - - /** - * Execute the given callback if the string is an exact match with the given value. - * - * @param string $value - * @param callable $callback - * @param callable|null $default - * @return static - */ - public function whenExactly($value, $callback, $default = null) - { - return $this->when($this->exactly($value), $callback, $default); - } - - /** - * Execute the given callback if the string is not an exact match with the given value. - * - * @param string $value - * @param callable $callback - * @param callable|null $default - * @return static - */ - public function whenNotExactly($value, $callback, $default = null) - { - return $this->when(! $this->exactly($value), $callback, $default); - } - - /** - * Execute the given callback if the string matches a given pattern. - * - * @param string|iterable $pattern - * @param callable $callback - * @param callable|null $default - * @return static - */ - public function whenIs($pattern, $callback, $default = null) - { - return $this->when($this->is($pattern), $callback, $default); - } - - /** - * Execute the given callback if the string is 7 bit ASCII. - * - * @param callable $callback - * @param callable|null $default - * @return static - */ - public function whenIsAscii($callback, $default = null) - { - return $this->when($this->isAscii(), $callback, $default); - } - - /** - * Execute the given callback if the string is a valid UUID. - * - * @param callable $callback - * @param callable|null $default - * @return static - */ - public function whenIsUuid($callback, $default = null) - { - return $this->when($this->isUuid(), $callback, $default); - } - - /** - * Execute the given callback if the string is a valid ULID. - * - * @param callable $callback - * @param callable|null $default - * @return static - */ - public function whenIsUlid($callback, $default = null) - { - return $this->when($this->isUlid(), $callback, $default); - } - - /** - * Execute the given callback if the string starts with a given substring. - * - * @param string|iterable $needles - * @param callable $callback - * @param callable|null $default - * @return static - */ - public function whenStartsWith($needles, $callback, $default = null) - { - return $this->when($this->startsWith($needles), $callback, $default); - } - - /** - * Execute the given callback if the string matches the given pattern. - * - * @param string $pattern - * @param callable $callback - * @param callable|null $default - * @return static - */ - public function whenTest($pattern, $callback, $default = null) - { - return $this->when($this->test($pattern), $callback, $default); - } - - /** - * Limit the number of words in a string. - * - * @param int $words - * @param string $end - * @return static - */ - public function words($words = 100, $end = '...') - { - return new static(Str::words($this->value, $words, $end)); - } - - /** - * Get the number of words a string contains. - * - * @param string|null $characters - * @return int - */ - public function wordCount($characters = null) - { - return Str::wordCount($this->value, $characters); - } - - /** - * Wrap the string with the given strings. - * - * @param string $before - * @param string|null $after - * @return static - */ - public function wrap($before, $after = null) - { - return new static(Str::wrap($this->value, $before, $after)); - } - - /** - * Convert the string into a `HtmlString` instance. - * - * @return \Illuminate\Support\HtmlString - */ - public function toHtmlString() - { - return new HtmlString($this->value); - } - - /** - * Dump the string. - * - * @return $this - */ - public function dump() - { - VarDumper::dump($this->value); - - return $this; - } - - /** - * Dump the string and end the script. - * - * @return never - */ - public function dd() - { - $this->dump(); - - exit(1); - } - - /** - * Get the underlying string value. - * - * @return string - */ - public function value() - { - return $this->toString(); - } - - /** - * Get the underlying string value. - * - * @return string - */ - public function toString() - { - return $this->value; - } - - /** - * Get the underlying string value as an integer. - * - * @return int - */ - public function toInteger() - { - return intval($this->value); - } - - /** - * Get the underlying string value as a float. - * - * @return float - */ - public function toFloat() - { - return floatval($this->value); - } - - /** - * Get the underlying string value as a boolean. - * - * Returns true when value is "1", "true", "on", and "yes". Otherwise, returns false. - * - * @return bool - */ - public function toBoolean() - { - return filter_var($this->value, FILTER_VALIDATE_BOOLEAN); - } - - /** - * Get the underlying string value as a Carbon instance. - * - * @param string|null $format - * @param string|null $tz - * @return \Illuminate\Support\Carbon - * - * @throws \Carbon\Exceptions\InvalidFormatException - */ - public function toDate($format = null, $tz = null) - { - if (is_null($format)) { - return Date::parse($this->value, $tz); - } - - return Date::createFromFormat($format, $this->value, $tz); - } - - /** - * Convert the object to a string when JSON encoded. - * - * @return string - */ - public function jsonSerialize(): string - { - return $this->__toString(); - } - - /** - * Proxy dynamic properties onto methods. - * - * @param string $key - * @return mixed - */ - public function __get($key) - { - return $this->{$key}(); - } - - /** - * Get the raw string value. - * - * @return string - */ - public function __toString() - { - return (string) $this->value; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/BatchFake.php b/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/BatchFake.php deleted file mode 100644 index f6b08cbd..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/BatchFake.php +++ /dev/null @@ -1,161 +0,0 @@ -id = $id; - $this->name = $name; - $this->totalJobs = $totalJobs; - $this->pendingJobs = $pendingJobs; - $this->failedJobs = $failedJobs; - $this->failedJobIds = $failedJobIds; - $this->options = $options; - $this->createdAt = $createdAt; - $this->cancelledAt = $cancelledAt; - $this->finishedAt = $finishedAt; - } - - /** - * Get a fresh instance of the batch represented by this ID. - * - * @return self - */ - public function fresh() - { - return $this; - } - - /** - * Add additional jobs to the batch. - * - * @param \Illuminate\Support\Enumerable|object|array $jobs - * @return self - */ - public function add($jobs) - { - $this->added[] = array_merge($this->added, $jobs); - - return $this; - } - - /** - * Record that a job within the batch finished successfully, executing any callbacks if necessary. - * - * @param string $jobId - * @return void - */ - public function recordSuccessfulJob(string $jobId) - { - // - } - - /** - * Decrement the pending jobs for the batch. - * - * @param string $jobId - * @return \Illuminate\Bus\UpdatedBatchJobCounts - */ - public function decrementPendingJobs(string $jobId) - { - // - } - - /** - * Record that a job within the batch failed to finish successfully, executing any callbacks if necessary. - * - * @param string $jobId - * @param \Throwable $e - * @return void - */ - public function recordFailedJob(string $jobId, $e) - { - // - } - - /** - * Increment the failed jobs for the batch. - * - * @param string $jobId - * @return \Illuminate\Bus\UpdatedBatchJobCounts - */ - public function incrementFailedJobs(string $jobId) - { - return new UpdatedBatchJobCounts; - } - - /** - * Cancel the batch. - * - * @return void - */ - public function cancel() - { - $this->cancelledAt = Carbon::now(); - } - - /** - * Delete the batch from storage. - * - * @return void - */ - public function delete() - { - $this->deleted = true; - } - - /** - * Determine if the batch has been deleted. - * - * @return bool - */ - public function deleted() - { - return $this->deleted; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/BatchRepositoryFake.php b/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/BatchRepositoryFake.php deleted file mode 100644 index 021c73f2..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/BatchRepositoryFake.php +++ /dev/null @@ -1,153 +0,0 @@ -batches; - } - - /** - * Retrieve information about an existing batch. - * - * @param string $batchId - * @return \Illuminate\Bus\Batch|null - */ - public function find(string $batchId) - { - return $this->batches[$batchId] ?? null; - } - - /** - * Store a new pending batch. - * - * @param \Illuminate\Bus\PendingBatch $batch - * @return \Illuminate\Bus\Batch - */ - public function store(PendingBatch $batch) - { - $id = (string) Str::orderedUuid(); - - $this->batches[$id] = new BatchFake( - $id, - $batch->name, - count($batch->jobs), - count($batch->jobs), - 0, - [], - $batch->options, - CarbonImmutable::now(), - null, - null - ); - - return $this->batches[$id]; - } - - /** - * Increment the total number of jobs within the batch. - * - * @param string $batchId - * @param int $amount - * @return void - */ - public function incrementTotalJobs(string $batchId, int $amount) - { - // - } - - /** - * Decrement the total number of pending jobs for the batch. - * - * @param string $batchId - * @param string $jobId - * @return \Illuminate\Bus\UpdatedBatchJobCounts - */ - public function decrementPendingJobs(string $batchId, string $jobId) - { - return new UpdatedBatchJobCounts; - } - - /** - * Increment the total number of failed jobs for the batch. - * - * @param string $batchId - * @param string $jobId - * @return \Illuminate\Bus\UpdatedBatchJobCounts - */ - public function incrementFailedJobs(string $batchId, string $jobId) - { - return new UpdatedBatchJobCounts; - } - - /** - * Mark the batch that has the given ID as finished. - * - * @param string $batchId - * @return void - */ - public function markAsFinished(string $batchId) - { - if (isset($this->batches[$batchId])) { - $this->batches[$batchId]->finishedAt = now(); - } - } - - /** - * Cancel the batch that has the given ID. - * - * @param string $batchId - * @return void - */ - public function cancel(string $batchId) - { - if (isset($this->batches[$batchId])) { - $this->batches[$batchId]->cancel(); - } - } - - /** - * Delete the batch that has the given ID. - * - * @param string $batchId - * @return void - */ - public function delete(string $batchId) - { - unset($this->batches[$batchId]); - } - - /** - * Execute the given Closure within a storage specific transaction. - * - * @param \Closure $callback - * @return mixed - */ - public function transaction(Closure $callback) - { - return $callback(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/BusFake.php b/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/BusFake.php deleted file mode 100644 index 21bd822d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/BusFake.php +++ /dev/null @@ -1,791 +0,0 @@ -dispatcher = $dispatcher; - $this->jobsToFake = Arr::wrap($jobsToFake); - $this->batchRepository = $batchRepository ?: new BatchRepositoryFake; - } - - /** - * Specify the jobs that should be dispatched instead of faked. - * - * @param array|string $jobsToDispatch - * @return void - */ - public function except($jobsToDispatch) - { - $this->jobsToDispatch = array_merge($this->jobsToDispatch, Arr::wrap($jobsToDispatch)); - - return $this; - } - - /** - * Assert if a job was dispatched based on a truth-test callback. - * - * @param string|\Closure $command - * @param callable|int|null $callback - * @return void - */ - public function assertDispatched($command, $callback = null) - { - if ($command instanceof Closure) { - [$command, $callback] = [$this->firstClosureParameterType($command), $command]; - } - - if (is_numeric($callback)) { - return $this->assertDispatchedTimes($command, $callback); - } - - PHPUnit::assertTrue( - $this->dispatched($command, $callback)->count() > 0 || - $this->dispatchedAfterResponse($command, $callback)->count() > 0 || - $this->dispatchedSync($command, $callback)->count() > 0, - "The expected [{$command}] job was not dispatched." - ); - } - - /** - * Assert if a job was pushed a number of times. - * - * @param string $command - * @param int $times - * @return void - */ - public function assertDispatchedTimes($command, $times = 1) - { - $count = $this->dispatched($command)->count() + - $this->dispatchedAfterResponse($command)->count() + - $this->dispatchedSync($command)->count(); - - PHPUnit::assertSame( - $times, $count, - "The expected [{$command}] job was pushed {$count} times instead of {$times} times." - ); - } - - /** - * Determine if a job was dispatched based on a truth-test callback. - * - * @param string|\Closure $command - * @param callable|null $callback - * @return void - */ - public function assertNotDispatched($command, $callback = null) - { - if ($command instanceof Closure) { - [$command, $callback] = [$this->firstClosureParameterType($command), $command]; - } - - PHPUnit::assertTrue( - $this->dispatched($command, $callback)->count() === 0 && - $this->dispatchedAfterResponse($command, $callback)->count() === 0 && - $this->dispatchedSync($command, $callback)->count() === 0, - "The unexpected [{$command}] job was dispatched." - ); - } - - /** - * Assert that no jobs were dispatched. - * - * @return void - */ - public function assertNothingDispatched() - { - PHPUnit::assertEmpty($this->commands, 'Jobs were dispatched unexpectedly.'); - } - - /** - * Assert if a job was explicitly dispatched synchronously based on a truth-test callback. - * - * @param string|\Closure $command - * @param callable|int|null $callback - * @return void - */ - public function assertDispatchedSync($command, $callback = null) - { - if ($command instanceof Closure) { - [$command, $callback] = [$this->firstClosureParameterType($command), $command]; - } - - if (is_numeric($callback)) { - return $this->assertDispatchedSyncTimes($command, $callback); - } - - PHPUnit::assertTrue( - $this->dispatchedSync($command, $callback)->count() > 0, - "The expected [{$command}] job was not dispatched synchronously." - ); - } - - /** - * Assert if a job was pushed synchronously a number of times. - * - * @param string $command - * @param int $times - * @return void - */ - public function assertDispatchedSyncTimes($command, $times = 1) - { - $count = $this->dispatchedSync($command)->count(); - - PHPUnit::assertSame( - $times, $count, - "The expected [{$command}] job was synchronously pushed {$count} times instead of {$times} times." - ); - } - - /** - * Determine if a job was dispatched based on a truth-test callback. - * - * @param string|\Closure $command - * @param callable|null $callback - * @return void - */ - public function assertNotDispatchedSync($command, $callback = null) - { - if ($command instanceof Closure) { - [$command, $callback] = [$this->firstClosureParameterType($command), $command]; - } - - PHPUnit::assertCount( - 0, $this->dispatchedSync($command, $callback), - "The unexpected [{$command}] job was dispatched synchronously." - ); - } - - /** - * Assert if a job was dispatched after the response was sent based on a truth-test callback. - * - * @param string|\Closure $command - * @param callable|int|null $callback - * @return void - */ - public function assertDispatchedAfterResponse($command, $callback = null) - { - if ($command instanceof Closure) { - [$command, $callback] = [$this->firstClosureParameterType($command), $command]; - } - - if (is_numeric($callback)) { - return $this->assertDispatchedAfterResponseTimes($command, $callback); - } - - PHPUnit::assertTrue( - $this->dispatchedAfterResponse($command, $callback)->count() > 0, - "The expected [{$command}] job was not dispatched after sending the response." - ); - } - - /** - * Assert if a job was pushed after the response was sent a number of times. - * - * @param string $command - * @param int $times - * @return void - */ - public function assertDispatchedAfterResponseTimes($command, $times = 1) - { - $count = $this->dispatchedAfterResponse($command)->count(); - - PHPUnit::assertSame( - $times, $count, - "The expected [{$command}] job was pushed {$count} times instead of {$times} times." - ); - } - - /** - * Determine if a job was dispatched based on a truth-test callback. - * - * @param string|\Closure $command - * @param callable|null $callback - * @return void - */ - public function assertNotDispatchedAfterResponse($command, $callback = null) - { - if ($command instanceof Closure) { - [$command, $callback] = [$this->firstClosureParameterType($command), $command]; - } - - PHPUnit::assertCount( - 0, $this->dispatchedAfterResponse($command, $callback), - "The unexpected [{$command}] job was dispatched after sending the response." - ); - } - - /** - * Assert if a chain of jobs was dispatched. - * - * @param array $expectedChain - * @return void - */ - public function assertChained(array $expectedChain) - { - $command = $expectedChain[0]; - - $expectedChain = array_slice($expectedChain, 1); - - $callback = null; - - if ($command instanceof Closure) { - [$command, $callback] = [$this->firstClosureParameterType($command), $command]; - } elseif (! is_string($command)) { - $instance = $command; - - $command = get_class($instance); - - $callback = function ($job) use ($instance) { - return serialize($this->resetChainPropertiesToDefaults($job)) === serialize($instance); - }; - } - - PHPUnit::assertTrue( - $this->dispatched($command, $callback)->isNotEmpty(), - "The expected [{$command}] job was not dispatched." - ); - - PHPUnit::assertTrue( - collect($expectedChain)->isNotEmpty(), - 'The expected chain can not be empty.' - ); - - $this->isChainOfObjects($expectedChain) - ? $this->assertDispatchedWithChainOfObjects($command, $expectedChain, $callback) - : $this->assertDispatchedWithChainOfClasses($command, $expectedChain, $callback); - } - - /** - * Reset the chain properties to their default values on the job. - * - * @param mixed $job - * @return mixed - */ - protected function resetChainPropertiesToDefaults($job) - { - return tap(clone $job, function ($job) { - $job->chainConnection = null; - $job->chainQueue = null; - $job->chainCatchCallbacks = null; - $job->chained = []; - }); - } - - /** - * Assert if a job was dispatched with an empty chain based on a truth-test callback. - * - * @param string|\Closure $command - * @param callable|null $callback - * @return void - */ - public function assertDispatchedWithoutChain($command, $callback = null) - { - if ($command instanceof Closure) { - [$command, $callback] = [$this->firstClosureParameterType($command), $command]; - } - - PHPUnit::assertTrue( - $this->dispatched($command, $callback)->isNotEmpty(), - "The expected [{$command}] job was not dispatched." - ); - - $this->assertDispatchedWithChainOfClasses($command, [], $callback); - } - - /** - * Assert if a job was dispatched with chained jobs based on a truth-test callback. - * - * @param string $command - * @param array $expectedChain - * @param callable|null $callback - * @return void - */ - protected function assertDispatchedWithChainOfObjects($command, $expectedChain, $callback) - { - $chain = collect($expectedChain)->map(fn ($job) => serialize($job))->all(); - - PHPUnit::assertTrue( - $this->dispatched($command, $callback)->filter( - fn ($job) => $job->chained == $chain - )->isNotEmpty(), - 'The expected chain was not dispatched.' - ); - } - - /** - * Assert if a job was dispatched with chained jobs based on a truth-test callback. - * - * @param string $command - * @param array $expectedChain - * @param callable|null $callback - * @return void - */ - protected function assertDispatchedWithChainOfClasses($command, $expectedChain, $callback) - { - $matching = $this->dispatched($command, $callback)->map->chained->map(function ($chain) { - return collect($chain)->map( - fn ($job) => get_class(unserialize($job)) - ); - })->filter( - fn ($chain) => $chain->all() === $expectedChain - ); - - PHPUnit::assertTrue( - $matching->isNotEmpty(), 'The expected chain was not dispatched.' - ); - } - - /** - * Determine if the given chain is entirely composed of objects. - * - * @param array $chain - * @return bool - */ - protected function isChainOfObjects($chain) - { - return ! collect($chain)->contains(fn ($job) => ! is_object($job)); - } - - /** - * Assert if a batch was dispatched based on a truth-test callback. - * - * @param callable $callback - * @return void - */ - public function assertBatched(callable $callback) - { - PHPUnit::assertTrue( - $this->batched($callback)->count() > 0, - 'The expected batch was not dispatched.' - ); - } - - /** - * Assert the number of batches that have been dispatched. - * - * @param int $count - * @return void - */ - public function assertBatchCount($count) - { - PHPUnit::assertCount( - $count, $this->batches, - ); - } - - /** - * Assert that no batched jobs were dispatched. - * - * @return void - */ - public function assertNothingBatched() - { - PHPUnit::assertEmpty($this->batches, 'Batched jobs were dispatched unexpectedly.'); - } - - /** - * Get all of the jobs matching a truth-test callback. - * - * @param string $command - * @param callable|null $callback - * @return \Illuminate\Support\Collection - */ - public function dispatched($command, $callback = null) - { - if (! $this->hasDispatched($command)) { - return collect(); - } - - $callback = $callback ?: fn () => true; - - return collect($this->commands[$command])->filter(fn ($command) => $callback($command)); - } - - /** - * Get all of the jobs dispatched synchronously matching a truth-test callback. - * - * @param string $command - * @param callable|null $callback - * @return \Illuminate\Support\Collection - */ - public function dispatchedSync(string $command, $callback = null) - { - if (! $this->hasDispatchedSync($command)) { - return collect(); - } - - $callback = $callback ?: fn () => true; - - return collect($this->commandsSync[$command])->filter(fn ($command) => $callback($command)); - } - - /** - * Get all of the jobs dispatched after the response was sent matching a truth-test callback. - * - * @param string $command - * @param callable|null $callback - * @return \Illuminate\Support\Collection - */ - public function dispatchedAfterResponse(string $command, $callback = null) - { - if (! $this->hasDispatchedAfterResponse($command)) { - return collect(); - } - - $callback = $callback ?: fn () => true; - - return collect($this->commandsAfterResponse[$command])->filter(fn ($command) => $callback($command)); - } - - /** - * Get all of the pending batches matching a truth-test callback. - * - * @param callable $callback - * @return \Illuminate\Support\Collection - */ - public function batched(callable $callback) - { - if (empty($this->batches)) { - return collect(); - } - - return collect($this->batches)->filter(fn ($batch) => $callback($batch)); - } - - /** - * Determine if there are any stored commands for a given class. - * - * @param string $command - * @return bool - */ - public function hasDispatched($command) - { - return isset($this->commands[$command]) && ! empty($this->commands[$command]); - } - - /** - * Determine if there are any stored commands for a given class. - * - * @param string $command - * @return bool - */ - public function hasDispatchedSync($command) - { - return isset($this->commandsSync[$command]) && ! empty($this->commandsSync[$command]); - } - - /** - * Determine if there are any stored commands for a given class. - * - * @param string $command - * @return bool - */ - public function hasDispatchedAfterResponse($command) - { - return isset($this->commandsAfterResponse[$command]) && ! empty($this->commandsAfterResponse[$command]); - } - - /** - * Dispatch a command to its appropriate handler. - * - * @param mixed $command - * @return mixed - */ - public function dispatch($command) - { - if ($this->shouldFakeJob($command)) { - $this->commands[get_class($command)][] = $command; - } else { - return $this->dispatcher->dispatch($command); - } - } - - /** - * Dispatch a command to its appropriate handler in the current process. - * - * Queueable jobs will be dispatched to the "sync" queue. - * - * @param mixed $command - * @param mixed $handler - * @return mixed - */ - public function dispatchSync($command, $handler = null) - { - if ($this->shouldFakeJob($command)) { - $this->commandsSync[get_class($command)][] = $command; - } else { - return $this->dispatcher->dispatchSync($command, $handler); - } - } - - /** - * Dispatch a command to its appropriate handler in the current process. - * - * @param mixed $command - * @param mixed $handler - * @return mixed - */ - public function dispatchNow($command, $handler = null) - { - if ($this->shouldFakeJob($command)) { - $this->commands[get_class($command)][] = $command; - } else { - return $this->dispatcher->dispatchNow($command, $handler); - } - } - - /** - * Dispatch a command to its appropriate handler behind a queue. - * - * @param mixed $command - * @return mixed - */ - public function dispatchToQueue($command) - { - if ($this->shouldFakeJob($command)) { - $this->commands[get_class($command)][] = $command; - } else { - return $this->dispatcher->dispatchToQueue($command); - } - } - - /** - * Dispatch a command to its appropriate handler. - * - * @param mixed $command - * @return mixed - */ - public function dispatchAfterResponse($command) - { - if ($this->shouldFakeJob($command)) { - $this->commandsAfterResponse[get_class($command)][] = $command; - } else { - return $this->dispatcher->dispatch($command); - } - } - - /** - * Create a new chain of queueable jobs. - * - * @param \Illuminate\Support\Collection|array $jobs - * @return \Illuminate\Foundation\Bus\PendingChain - */ - public function chain($jobs) - { - $jobs = Collection::wrap($jobs); - - return new PendingChainFake($this, $jobs->shift(), $jobs->toArray()); - } - - /** - * Attempt to find the batch with the given ID. - * - * @param string $batchId - * @return \Illuminate\Bus\Batch|null - */ - public function findBatch(string $batchId) - { - return $this->batchRepository->find($batchId); - } - - /** - * Create a new batch of queueable jobs. - * - * @param \Illuminate\Support\Collection|array $jobs - * @return \Illuminate\Bus\PendingBatch - */ - public function batch($jobs) - { - return new PendingBatchFake($this, Collection::wrap($jobs)); - } - - /** - * Dispatch an empty job batch for testing. - * - * @param string $name - * @return \Illuminate\Bus\Batch - */ - public function dispatchFakeBatch($name = '') - { - return $this->batch([])->name($name)->dispatch(); - } - - /** - * Record the fake pending batch dispatch. - * - * @param \Illuminate\Bus\PendingBatch $pendingBatch - * @return \Illuminate\Bus\Batch - */ - public function recordPendingBatch(PendingBatch $pendingBatch) - { - $this->batches[] = $pendingBatch; - - return $this->batchRepository->store($pendingBatch); - } - - /** - * Determine if a command should be faked or actually dispatched. - * - * @param mixed $command - * @return bool - */ - protected function shouldFakeJob($command) - { - if ($this->shouldDispatchCommand($command)) { - return false; - } - - if (empty($this->jobsToFake)) { - return true; - } - - return collect($this->jobsToFake) - ->filter(function ($job) use ($command) { - return $job instanceof Closure - ? $job($command) - : $job === get_class($command); - })->isNotEmpty(); - } - - /** - * Determine if a command should be dispatched or not. - * - * @param mixed $command - * @return bool - */ - protected function shouldDispatchCommand($command) - { - return collect($this->jobsToDispatch) - ->filter(function ($job) use ($command) { - return $job instanceof Closure - ? $job($command) - : $job === get_class($command); - })->isNotEmpty(); - } - - /** - * Set the pipes commands should be piped through before dispatching. - * - * @param array $pipes - * @return $this - */ - public function pipeThrough(array $pipes) - { - $this->dispatcher->pipeThrough($pipes); - - return $this; - } - - /** - * Determine if the given command has a handler. - * - * @param mixed $command - * @return bool - */ - public function hasCommandHandler($command) - { - return $this->dispatcher->hasCommandHandler($command); - } - - /** - * Retrieve the handler for a command. - * - * @param mixed $command - * @return mixed - */ - public function getCommandHandler($command) - { - return $this->dispatcher->getCommandHandler($command); - } - - /** - * Map a command to a handler. - * - * @param array $map - * @return $this - */ - public function map(array $map) - { - $this->dispatcher->map($map); - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/EventFake.php b/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/EventFake.php deleted file mode 100644 index 2a102afb..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/EventFake.php +++ /dev/null @@ -1,380 +0,0 @@ -dispatcher = $dispatcher; - - $this->eventsToFake = Arr::wrap($eventsToFake); - } - - /** - * Specify the events that should be dispatched instead of faked. - * - * @param array|string $eventsToDispatch - * @return $this - */ - public function except($eventsToDispatch) - { - $this->eventsToDispatch = array_merge( - $this->eventsToDispatch, - Arr::wrap($eventsToDispatch) - ); - - return $this; - } - - /** - * Assert if an event has a listener attached to it. - * - * @param string $expectedEvent - * @param string|array $expectedListener - * @return void - */ - public function assertListening($expectedEvent, $expectedListener) - { - foreach ($this->dispatcher->getListeners($expectedEvent) as $listenerClosure) { - $actualListener = (new ReflectionFunction($listenerClosure)) - ->getStaticVariables()['listener']; - - if (is_string($actualListener) && Str::contains($actualListener, '@')) { - $actualListener = Str::parseCallback($actualListener); - - if (is_string($expectedListener)) { - if (Str::contains($expectedListener, '@')) { - $expectedListener = Str::parseCallback($expectedListener); - } else { - $expectedListener = [$expectedListener, 'handle']; - } - } - } - - if ($actualListener === $expectedListener || - ($actualListener instanceof Closure && - $expectedListener === Closure::class)) { - PHPUnit::assertTrue(true); - - return; - } - } - - PHPUnit::assertTrue( - false, - sprintf( - 'Event [%s] does not have the [%s] listener attached to it', - $expectedEvent, - print_r($expectedListener, true) - ) - ); - } - - /** - * Assert if an event was dispatched based on a truth-test callback. - * - * @param string|\Closure $event - * @param callable|int|null $callback - * @return void - */ - public function assertDispatched($event, $callback = null) - { - if ($event instanceof Closure) { - [$event, $callback] = [$this->firstClosureParameterType($event), $event]; - } - - if (is_int($callback)) { - return $this->assertDispatchedTimes($event, $callback); - } - - PHPUnit::assertTrue( - $this->dispatched($event, $callback)->count() > 0, - "The expected [{$event}] event was not dispatched." - ); - } - - /** - * Assert if an event was dispatched a number of times. - * - * @param string $event - * @param int $times - * @return void - */ - public function assertDispatchedTimes($event, $times = 1) - { - $count = $this->dispatched($event)->count(); - - PHPUnit::assertSame( - $times, $count, - "The expected [{$event}] event was dispatched {$count} times instead of {$times} times." - ); - } - - /** - * Determine if an event was dispatched based on a truth-test callback. - * - * @param string|\Closure $event - * @param callable|null $callback - * @return void - */ - public function assertNotDispatched($event, $callback = null) - { - if ($event instanceof Closure) { - [$event, $callback] = [$this->firstClosureParameterType($event), $event]; - } - - PHPUnit::assertCount( - 0, $this->dispatched($event, $callback), - "The unexpected [{$event}] event was dispatched." - ); - } - - /** - * Assert that no events were dispatched. - * - * @return void - */ - public function assertNothingDispatched() - { - $count = count(Arr::flatten($this->events)); - - PHPUnit::assertSame( - 0, $count, - "{$count} unexpected events were dispatched." - ); - } - - /** - * Get all of the events matching a truth-test callback. - * - * @param string $event - * @param callable|null $callback - * @return \Illuminate\Support\Collection - */ - public function dispatched($event, $callback = null) - { - if (! $this->hasDispatched($event)) { - return collect(); - } - - $callback = $callback ?: fn () => true; - - return collect($this->events[$event])->filter( - fn ($arguments) => $callback(...$arguments) - ); - } - - /** - * Determine if the given event has been dispatched. - * - * @param string $event - * @return bool - */ - public function hasDispatched($event) - { - return isset($this->events[$event]) && ! empty($this->events[$event]); - } - - /** - * Register an event listener with the dispatcher. - * - * @param \Closure|string|array $events - * @param mixed $listener - * @return void - */ - public function listen($events, $listener = null) - { - $this->dispatcher->listen($events, $listener); - } - - /** - * Determine if a given event has listeners. - * - * @param string $eventName - * @return bool - */ - public function hasListeners($eventName) - { - return $this->dispatcher->hasListeners($eventName); - } - - /** - * Register an event and payload to be dispatched later. - * - * @param string $event - * @param array $payload - * @return void - */ - public function push($event, $payload = []) - { - // - } - - /** - * Register an event subscriber with the dispatcher. - * - * @param object|string $subscriber - * @return void - */ - public function subscribe($subscriber) - { - $this->dispatcher->subscribe($subscriber); - } - - /** - * Flush a set of pushed events. - * - * @param string $event - * @return void - */ - public function flush($event) - { - // - } - - /** - * Fire an event and call the listeners. - * - * @param string|object $event - * @param mixed $payload - * @param bool $halt - * @return array|null - */ - public function dispatch($event, $payload = [], $halt = false) - { - $name = is_object($event) ? get_class($event) : (string) $event; - - if ($this->shouldFakeEvent($name, $payload)) { - $this->events[$name][] = func_get_args(); - } else { - return $this->dispatcher->dispatch($event, $payload, $halt); - } - } - - /** - * Determine if an event should be faked or actually dispatched. - * - * @param string $eventName - * @param mixed $payload - * @return bool - */ - protected function shouldFakeEvent($eventName, $payload) - { - if ($this->shouldDispatchEvent($eventName, $payload)) { - return false; - } - - if (empty($this->eventsToFake)) { - return true; - } - - return collect($this->eventsToFake) - ->filter(function ($event) use ($eventName, $payload) { - return $event instanceof Closure - ? $event($eventName, $payload) - : $event === $eventName; - }) - ->isNotEmpty(); - } - - /** - * Determine whether an event should be dispatched or not. - * - * @param string $eventName - * @param mixed $payload - * @return bool - */ - protected function shouldDispatchEvent($eventName, $payload) - { - if (empty($this->eventsToDispatch)) { - return false; - } - - return collect($this->eventsToDispatch) - ->filter(function ($event) use ($eventName, $payload) { - return $event instanceof Closure - ? $event($eventName, $payload) - : $event === $eventName; - }) - ->isNotEmpty(); - } - - /** - * Remove a set of listeners from the dispatcher. - * - * @param string $event - * @return void - */ - public function forget($event) - { - // - } - - /** - * Forget all of the queued listeners. - * - * @return void - */ - public function forgetPushed() - { - // - } - - /** - * Dispatch an event and call the listeners. - * - * @param string|object $event - * @param mixed $payload - * @return array|null - */ - public function until($event, $payload = []) - { - return $this->dispatch($event, $payload, true); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/MailFake.php b/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/MailFake.php deleted file mode 100644 index c95c15a5..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/MailFake.php +++ /dev/null @@ -1,444 +0,0 @@ -prepareMailableAndCallback($mailable, $callback); - - if (is_numeric($callback)) { - return $this->assertSentTimes($mailable, $callback); - } - - $message = "The expected [{$mailable}] mailable was not sent."; - - if (count($this->queuedMailables) > 0) { - $message .= ' Did you mean to use assertQueued() instead?'; - } - - PHPUnit::assertTrue( - $this->sent($mailable, $callback)->count() > 0, - $message - ); - } - - /** - * Assert if a mailable was sent a number of times. - * - * @param string $mailable - * @param int $times - * @return void - */ - protected function assertSentTimes($mailable, $times = 1) - { - $count = $this->sent($mailable)->count(); - - PHPUnit::assertSame( - $times, $count, - "The expected [{$mailable}] mailable was sent {$count} times instead of {$times} times." - ); - } - - /** - * Determine if a mailable was not sent or queued to be sent based on a truth-test callback. - * - * @param string|\Closure $mailable - * @param callable|null $callback - * @return void - */ - public function assertNotOutgoing($mailable, $callback = null) - { - $this->assertNotSent($mailable, $callback); - $this->assertNotQueued($mailable, $callback); - } - - /** - * Determine if a mailable was not sent based on a truth-test callback. - * - * @param string|\Closure $mailable - * @param callable|null $callback - * @return void - */ - public function assertNotSent($mailable, $callback = null) - { - [$mailable, $callback] = $this->prepareMailableAndCallback($mailable, $callback); - - PHPUnit::assertCount( - 0, $this->sent($mailable, $callback), - "The unexpected [{$mailable}] mailable was sent." - ); - } - - /** - * Assert that no mailables were sent or queued to be sent. - * - * @return void - */ - public function assertNothingOutgoing() - { - $this->assertNothingSent(); - $this->assertNothingQueued(); - } - - /** - * Assert that no mailables were sent. - * - * @return void - */ - public function assertNothingSent() - { - $mailableNames = collect($this->mailables)->map( - fn ($mailable) => get_class($mailable) - )->join(', '); - - PHPUnit::assertEmpty($this->mailables, 'The following mailables were sent unexpectedly: '.$mailableNames); - } - - /** - * Assert if a mailable was queued based on a truth-test callback. - * - * @param string|\Closure $mailable - * @param callable|int|null $callback - * @return void - */ - public function assertQueued($mailable, $callback = null) - { - [$mailable, $callback] = $this->prepareMailableAndCallback($mailable, $callback); - - if (is_numeric($callback)) { - return $this->assertQueuedTimes($mailable, $callback); - } - - PHPUnit::assertTrue( - $this->queued($mailable, $callback)->count() > 0, - "The expected [{$mailable}] mailable was not queued." - ); - } - - /** - * Assert if a mailable was queued a number of times. - * - * @param string $mailable - * @param int $times - * @return void - */ - protected function assertQueuedTimes($mailable, $times = 1) - { - $count = $this->queued($mailable)->count(); - - PHPUnit::assertSame( - $times, $count, - "The expected [{$mailable}] mailable was queued {$count} times instead of {$times} times." - ); - } - - /** - * Determine if a mailable was not queued based on a truth-test callback. - * - * @param string|\Closure $mailable - * @param callable|null $callback - * @return void - */ - public function assertNotQueued($mailable, $callback = null) - { - [$mailable, $callback] = $this->prepareMailableAndCallback($mailable, $callback); - - PHPUnit::assertCount( - 0, $this->queued($mailable, $callback), - "The unexpected [{$mailable}] mailable was queued." - ); - } - - /** - * Assert that no mailables were queued. - * - * @return void - */ - public function assertNothingQueued() - { - $mailableNames = collect($this->queuedMailables)->map( - fn ($mailable) => get_class($mailable) - )->join(', '); - - PHPUnit::assertEmpty($this->queuedMailables, 'The following mailables were queued unexpectedly: '.$mailableNames); - } - - /** - * Get all of the mailables matching a truth-test callback. - * - * @param string|\Closure $mailable - * @param callable|null $callback - * @return \Illuminate\Support\Collection - */ - public function sent($mailable, $callback = null) - { - [$mailable, $callback] = $this->prepareMailableAndCallback($mailable, $callback); - - if (! $this->hasSent($mailable)) { - return collect(); - } - - $callback = $callback ?: fn () => true; - - return $this->mailablesOf($mailable)->filter(fn ($mailable) => $callback($mailable)); - } - - /** - * Determine if the given mailable has been sent. - * - * @param string $mailable - * @return bool - */ - public function hasSent($mailable) - { - return $this->mailablesOf($mailable)->count() > 0; - } - - /** - * Get all of the queued mailables matching a truth-test callback. - * - * @param string|\Closure $mailable - * @param callable|null $callback - * @return \Illuminate\Support\Collection - */ - public function queued($mailable, $callback = null) - { - [$mailable, $callback] = $this->prepareMailableAndCallback($mailable, $callback); - - if (! $this->hasQueued($mailable)) { - return collect(); - } - - $callback = $callback ?: fn () => true; - - return $this->queuedMailablesOf($mailable)->filter(fn ($mailable) => $callback($mailable)); - } - - /** - * Determine if the given mailable has been queued. - * - * @param string $mailable - * @return bool - */ - public function hasQueued($mailable) - { - return $this->queuedMailablesOf($mailable)->count() > 0; - } - - /** - * Get all of the mailed mailables for a given type. - * - * @param string $type - * @return \Illuminate\Support\Collection - */ - protected function mailablesOf($type) - { - return collect($this->mailables)->filter(fn ($mailable) => $mailable instanceof $type); - } - - /** - * Get all of the mailed mailables for a given type. - * - * @param string $type - * @return \Illuminate\Support\Collection - */ - protected function queuedMailablesOf($type) - { - return collect($this->queuedMailables)->filter(fn ($mailable) => $mailable instanceof $type); - } - - /** - * Get a mailer instance by name. - * - * @param string|null $name - * @return \Illuminate\Contracts\Mail\Mailer - */ - public function mailer($name = null) - { - $this->currentMailer = $name; - - return $this; - } - - /** - * Begin the process of mailing a mailable class instance. - * - * @param mixed $users - * @return \Illuminate\Mail\PendingMail - */ - public function to($users) - { - return (new PendingMailFake($this))->to($users); - } - - /** - * Begin the process of mailing a mailable class instance. - * - * @param mixed $users - * @return \Illuminate\Mail\PendingMail - */ - public function cc($users) - { - return (new PendingMailFake($this))->cc($users); - } - - /** - * Begin the process of mailing a mailable class instance. - * - * @param mixed $users - * @return \Illuminate\Mail\PendingMail - */ - public function bcc($users) - { - return (new PendingMailFake($this))->bcc($users); - } - - /** - * Send a new message with only a raw text part. - * - * @param string $text - * @param \Closure|string $callback - * @return void - */ - public function raw($text, $callback) - { - // - } - - /** - * Send a new message using a view. - * - * @param \Illuminate\Contracts\Mail\Mailable|string|array $view - * @param array $data - * @param \Closure|string|null $callback - * @return void - */ - public function send($view, array $data = [], $callback = null) - { - if (! $view instanceof Mailable) { - return; - } - - $view->mailer($this->currentMailer); - - if ($view instanceof ShouldQueue) { - return $this->queue($view, $data); - } - - $this->currentMailer = null; - - $this->mailables[] = $view; - } - - /** - * Queue a new e-mail message for sending. - * - * @param \Illuminate\Contracts\Mail\Mailable|string|array $view - * @param string|null $queue - * @return mixed - */ - public function queue($view, $queue = null) - { - if (! $view instanceof Mailable) { - return; - } - - $view->mailer($this->currentMailer); - - $this->currentMailer = null; - - $this->queuedMailables[] = $view; - } - - /** - * Queue a new e-mail message for sending after (n) seconds. - * - * @param \DateTimeInterface|\DateInterval|int $delay - * @param \Illuminate\Contracts\Mail\Mailable|string|array $view - * @param string|null $queue - * @return mixed - */ - public function later($delay, $view, $queue = null) - { - $this->queue($view, $queue); - } - - /** - * Get the array of failed recipients. - * - * @return array - */ - public function failures() - { - return []; - } - - /** - * Infer mailable class using reflection if a typehinted closure is passed to assertion. - * - * @param string|\Closure $mailable - * @param callable|null $callback - * @return array - */ - protected function prepareMailableAndCallback($mailable, $callback) - { - if ($mailable instanceof Closure) { - return [$this->firstClosureParameterType($mailable), $mailable]; - } - - return [$mailable, $callback]; - } - - /** - * Forget all of the resolved mailer instances. - * - * @return $this - */ - public function forgetMailers() - { - $this->currentMailer = null; - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/NotificationFake.php b/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/NotificationFake.php deleted file mode 100644 index 5991420d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/NotificationFake.php +++ /dev/null @@ -1,375 +0,0 @@ -assertSentTo(new AnonymousNotifiable, $notification, $callback); - } - - /** - * Assert if a notification was sent based on a truth-test callback. - * - * @param mixed $notifiable - * @param string|\Closure $notification - * @param callable|null $callback - * @return void - * - * @throws \Exception - */ - public function assertSentTo($notifiable, $notification, $callback = null) - { - if (is_array($notifiable) || $notifiable instanceof Collection) { - if (count($notifiable) === 0) { - throw new Exception('No notifiable given.'); - } - - foreach ($notifiable as $singleNotifiable) { - $this->assertSentTo($singleNotifiable, $notification, $callback); - } - - return; - } - - if ($notification instanceof Closure) { - [$notification, $callback] = [$this->firstClosureParameterType($notification), $notification]; - } - - if (is_numeric($callback)) { - return $this->assertSentToTimes($notifiable, $notification, $callback); - } - - PHPUnit::assertTrue( - $this->sent($notifiable, $notification, $callback)->count() > 0, - "The expected [{$notification}] notification was not sent." - ); - } - - /** - * Assert if a notification was sent on-demand a number of times. - * - * @param string $notification - * @param int $times - * @return void - */ - public function assertSentOnDemandTimes($notification, $times = 1) - { - return $this->assertSentToTimes(new AnonymousNotifiable, $notification, $times); - } - - /** - * Assert if a notification was sent a number of times. - * - * @param mixed $notifiable - * @param string $notification - * @param int $times - * @return void - */ - public function assertSentToTimes($notifiable, $notification, $times = 1) - { - $count = $this->sent($notifiable, $notification)->count(); - - PHPUnit::assertSame( - $times, $count, - "Expected [{$notification}] to be sent {$times} times, but was sent {$count} times." - ); - } - - /** - * Determine if a notification was sent based on a truth-test callback. - * - * @param mixed $notifiable - * @param string|\Closure $notification - * @param callable|null $callback - * @return void - * - * @throws \Exception - */ - public function assertNotSentTo($notifiable, $notification, $callback = null) - { - if (is_array($notifiable) || $notifiable instanceof Collection) { - if (count($notifiable) === 0) { - throw new Exception('No notifiable given.'); - } - - foreach ($notifiable as $singleNotifiable) { - $this->assertNotSentTo($singleNotifiable, $notification, $callback); - } - - return; - } - - if ($notification instanceof Closure) { - [$notification, $callback] = [$this->firstClosureParameterType($notification), $notification]; - } - - PHPUnit::assertCount( - 0, $this->sent($notifiable, $notification, $callback), - "The unexpected [{$notification}] notification was sent." - ); - } - - /** - * Assert that no notifications were sent. - * - * @return void - */ - public function assertNothingSent() - { - PHPUnit::assertEmpty($this->notifications, 'Notifications were sent unexpectedly.'); - } - - /** - * Assert that no notifications were sent to the given notifiable. - * - * @param mixed $notifiable - * @return void - * - * @throws \Exception - */ - public function assertNothingSentTo($notifiable) - { - if (is_array($notifiable) || $notifiable instanceof Collection) { - if (count($notifiable) === 0) { - throw new Exception('No notifiable given.'); - } - - foreach ($notifiable as $singleNotifiable) { - $this->assertNothingSentTo($singleNotifiable); - } - - return; - } - - PHPUnit::assertEmpty( - $this->notifications[get_class($notifiable)][$notifiable->getKey()] ?? [], - 'Notifications were sent unexpectedly.', - ); - } - - /** - * Assert the total amount of times a notification was sent. - * - * @param string $notification - * @param int $expectedCount - * @return void - */ - public function assertSentTimes($notification, $expectedCount) - { - $actualCount = collect($this->notifications) - ->flatten(1) - ->reduce(fn ($count, $sent) => $count + count($sent[$notification] ?? []), 0); - - PHPUnit::assertSame( - $expectedCount, $actualCount, - "Expected [{$notification}] to be sent {$expectedCount} times, but was sent {$actualCount} times." - ); - } - - /** - * Assert the total count of notification that were sent. - * - * @param int $expectedCount - * @return void - */ - public function assertCount($expectedCount) - { - $actualCount = collect($this->notifications)->flatten(3)->count(); - - PHPUnit::assertSame( - $expectedCount, $actualCount, - "Expected {$expectedCount} notifications to be sent, but {$actualCount} were sent." - ); - } - - /** - * Assert the total amount of times a notification was sent. - * - * @param int $expectedCount - * @param string $notification - * @return void - * - * @deprecated Use the assertSentTimes method instead - */ - public function assertTimesSent($expectedCount, $notification) - { - $this->assertSentTimes($notification, $expectedCount); - } - - /** - * Get all of the notifications matching a truth-test callback. - * - * @param mixed $notifiable - * @param string $notification - * @param callable|null $callback - * @return \Illuminate\Support\Collection - */ - public function sent($notifiable, $notification, $callback = null) - { - if (! $this->hasSent($notifiable, $notification)) { - return collect(); - } - - $callback = $callback ?: fn () => true; - - $notifications = collect($this->notificationsFor($notifiable, $notification)); - - return $notifications->filter( - fn ($arguments) => $callback(...array_values($arguments)) - )->pluck('notification'); - } - - /** - * Determine if there are more notifications left to inspect. - * - * @param mixed $notifiable - * @param string $notification - * @return bool - */ - public function hasSent($notifiable, $notification) - { - return ! empty($this->notificationsFor($notifiable, $notification)); - } - - /** - * Get all of the notifications for a notifiable entity by type. - * - * @param mixed $notifiable - * @param string $notification - * @return array - */ - protected function notificationsFor($notifiable, $notification) - { - return $this->notifications[get_class($notifiable)][$notifiable->getKey()][$notification] ?? []; - } - - /** - * Send the given notification to the given notifiable entities. - * - * @param \Illuminate\Support\Collection|array|mixed $notifiables - * @param mixed $notification - * @return void - */ - public function send($notifiables, $notification) - { - $this->sendNow($notifiables, $notification); - } - - /** - * Send the given notification immediately. - * - * @param \Illuminate\Support\Collection|array|mixed $notifiables - * @param mixed $notification - * @param array|null $channels - * @return void - */ - public function sendNow($notifiables, $notification, array $channels = null) - { - if (! $notifiables instanceof Collection && ! is_array($notifiables)) { - $notifiables = [$notifiables]; - } - - foreach ($notifiables as $notifiable) { - if (! $notification->id) { - $notification->id = Str::uuid()->toString(); - } - - $notifiableChannels = $channels ?: $notification->via($notifiable); - - if (method_exists($notification, 'shouldSend')) { - $notifiableChannels = array_filter( - $notifiableChannels, - fn ($channel) => $notification->shouldSend($notifiable, $channel) !== false - ); - - if (empty($notifiableChannels)) { - continue; - } - } - - $this->notifications[get_class($notifiable)][$notifiable->getKey()][get_class($notification)][] = [ - 'notification' => $notification, - 'channels' => $notifiableChannels, - 'notifiable' => $notifiable, - 'locale' => $notification->locale ?? $this->locale ?? value(function () use ($notifiable) { - if ($notifiable instanceof HasLocalePreference) { - return $notifiable->preferredLocale(); - } - }), - ]; - } - } - - /** - * Get a channel instance by name. - * - * @param string|null $name - * @return mixed - */ - public function channel($name = null) - { - // - } - - /** - * Set the locale of notifications. - * - * @param string $locale - * @return $this - */ - public function locale($locale) - { - $this->locale = $locale; - - return $this; - } - - /** - * Get the notifications that have been sent. - * - * @return array - */ - public function sentNotifications() - { - return $this->notifications; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/PendingBatchFake.php b/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/PendingBatchFake.php deleted file mode 100644 index 3d0f4992..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/PendingBatchFake.php +++ /dev/null @@ -1,49 +0,0 @@ -bus = $bus; - $this->jobs = $jobs; - } - - /** - * Dispatch the batch. - * - * @return \Illuminate\Bus\Batch - */ - public function dispatch() - { - return $this->bus->recordPendingBatch($this); - } - - /** - * Dispatch the batch after the response is sent to the browser. - * - * @return \Illuminate\Bus\Batch - */ - public function dispatchAfterResponse() - { - return $this->bus->recordPendingBatch($this); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/PendingChainFake.php b/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/PendingChainFake.php deleted file mode 100644 index 533c6498..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/PendingChainFake.php +++ /dev/null @@ -1,56 +0,0 @@ -bus = $bus; - $this->job = $job; - $this->chain = $chain; - } - - /** - * Dispatch the job with the given arguments. - * - * @return \Illuminate\Foundation\Bus\PendingDispatch - */ - public function dispatch() - { - if (is_string($this->job)) { - $firstJob = new $this->job(...func_get_args()); - } elseif ($this->job instanceof Closure) { - $firstJob = CallQueuedClosure::create($this->job); - } else { - $firstJob = $this->job; - } - - $firstJob->allOnConnection($this->connection); - $firstJob->allOnQueue($this->queue); - $firstJob->chain($this->chain); - $firstJob->delay($this->delay); - $firstJob->chainCatchCallbacks = $this->catchCallbacks(); - - return $this->bus->dispatch($firstJob); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/PendingMailFake.php b/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/PendingMailFake.php deleted file mode 100644 index 52251301..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/PendingMailFake.php +++ /dev/null @@ -1,42 +0,0 @@ -mailer = $mailer; - } - - /** - * Send a new mailable message instance. - * - * @param \Illuminate\Contracts\Mail\Mailable $mailable - * @return void - */ - public function send(Mailable $mailable) - { - $this->mailer->send($this->fill($mailable)); - } - - /** - * Push the given mailable onto the queue. - * - * @param \Illuminate\Contracts\Mail\Mailable $mailable - * @return mixed - */ - public function queue(Mailable $mailable) - { - return $this->mailer->queue($this->fill($mailable)); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/QueueFake.php b/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/QueueFake.php deleted file mode 100644 index f2caa768..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/QueueFake.php +++ /dev/null @@ -1,503 +0,0 @@ -jobsToFake = Collection::wrap($jobsToFake); - $this->jobsToBeQueued = Collection::make(); - $this->queue = $queue; - } - - /** - * Specify the jobs that should be queued instead of faked. - * - * @param array|string $jobsToBeQueued - * @return $this - */ - public function except($jobsToBeQueued) - { - $this->jobsToBeQueued = Collection::wrap($jobsToBeQueued)->merge($this->jobsToBeQueued); - - return $this; - } - - /** - * Assert if a job was pushed based on a truth-test callback. - * - * @param string|\Closure $job - * @param callable|int|null $callback - * @return void - */ - public function assertPushed($job, $callback = null) - { - if ($job instanceof Closure) { - [$job, $callback] = [$this->firstClosureParameterType($job), $job]; - } - - if (is_numeric($callback)) { - return $this->assertPushedTimes($job, $callback); - } - - PHPUnit::assertTrue( - $this->pushed($job, $callback)->count() > 0, - "The expected [{$job}] job was not pushed." - ); - } - - /** - * Assert if a job was pushed a number of times. - * - * @param string $job - * @param int $times - * @return void - */ - protected function assertPushedTimes($job, $times = 1) - { - $count = $this->pushed($job)->count(); - - PHPUnit::assertSame( - $times, $count, - "The expected [{$job}] job was pushed {$count} times instead of {$times} times." - ); - } - - /** - * Assert if a job was pushed based on a truth-test callback. - * - * @param string $queue - * @param string|\Closure $job - * @param callable|null $callback - * @return void - */ - public function assertPushedOn($queue, $job, $callback = null) - { - if ($job instanceof Closure) { - [$job, $callback] = [$this->firstClosureParameterType($job), $job]; - } - - $this->assertPushed($job, function ($job, $pushedQueue) use ($callback, $queue) { - if ($pushedQueue !== $queue) { - return false; - } - - return $callback ? $callback(...func_get_args()) : true; - }); - } - - /** - * Assert if a job was pushed with chained jobs based on a truth-test callback. - * - * @param string $job - * @param array $expectedChain - * @param callable|null $callback - * @return void - */ - public function assertPushedWithChain($job, $expectedChain = [], $callback = null) - { - PHPUnit::assertTrue( - $this->pushed($job, $callback)->isNotEmpty(), - "The expected [{$job}] job was not pushed." - ); - - PHPUnit::assertTrue( - collect($expectedChain)->isNotEmpty(), - 'The expected chain can not be empty.' - ); - - $this->isChainOfObjects($expectedChain) - ? $this->assertPushedWithChainOfObjects($job, $expectedChain, $callback) - : $this->assertPushedWithChainOfClasses($job, $expectedChain, $callback); - } - - /** - * Assert if a job was pushed with an empty chain based on a truth-test callback. - * - * @param string $job - * @param callable|null $callback - * @return void - */ - public function assertPushedWithoutChain($job, $callback = null) - { - PHPUnit::assertTrue( - $this->pushed($job, $callback)->isNotEmpty(), - "The expected [{$job}] job was not pushed." - ); - - $this->assertPushedWithChainOfClasses($job, [], $callback); - } - - /** - * Assert if a job was pushed with chained jobs based on a truth-test callback. - * - * @param string $job - * @param array $expectedChain - * @param callable|null $callback - * @return void - */ - protected function assertPushedWithChainOfObjects($job, $expectedChain, $callback) - { - $chain = collect($expectedChain)->map(fn ($job) => serialize($job))->all(); - - PHPUnit::assertTrue( - $this->pushed($job, $callback)->filter(fn ($job) => $job->chained == $chain)->isNotEmpty(), - 'The expected chain was not pushed.' - ); - } - - /** - * Assert if a job was pushed with chained jobs based on a truth-test callback. - * - * @param string $job - * @param array $expectedChain - * @param callable|null $callback - * @return void - */ - protected function assertPushedWithChainOfClasses($job, $expectedChain, $callback) - { - $matching = $this->pushed($job, $callback)->map->chained->map(function ($chain) { - return collect($chain)->map(function ($job) { - return get_class(unserialize($job)); - }); - })->filter(function ($chain) use ($expectedChain) { - return $chain->all() === $expectedChain; - }); - - PHPUnit::assertTrue( - $matching->isNotEmpty(), 'The expected chain was not pushed.' - ); - } - - /** - * Determine if the given chain is entirely composed of objects. - * - * @param array $chain - * @return bool - */ - protected function isChainOfObjects($chain) - { - return ! collect($chain)->contains(fn ($job) => ! is_object($job)); - } - - /** - * Determine if a job was pushed based on a truth-test callback. - * - * @param string|\Closure $job - * @param callable|null $callback - * @return void - */ - public function assertNotPushed($job, $callback = null) - { - if ($job instanceof Closure) { - [$job, $callback] = [$this->firstClosureParameterType($job), $job]; - } - - PHPUnit::assertCount( - 0, $this->pushed($job, $callback), - "The unexpected [{$job}] job was pushed." - ); - } - - /** - * Assert that no jobs were pushed. - * - * @return void - */ - public function assertNothingPushed() - { - PHPUnit::assertEmpty($this->jobs, 'Jobs were pushed unexpectedly.'); - } - - /** - * Get all of the jobs matching a truth-test callback. - * - * @param string $job - * @param callable|null $callback - * @return \Illuminate\Support\Collection - */ - public function pushed($job, $callback = null) - { - if (! $this->hasPushed($job)) { - return collect(); - } - - $callback = $callback ?: fn () => true; - - return collect($this->jobs[$job])->filter( - fn ($data) => $callback($data['job'], $data['queue'], $data['data']) - )->pluck('job'); - } - - /** - * Determine if there are any stored jobs for a given class. - * - * @param string $job - * @return bool - */ - public function hasPushed($job) - { - return isset($this->jobs[$job]) && ! empty($this->jobs[$job]); - } - - /** - * Resolve a queue connection instance. - * - * @param mixed $value - * @return \Illuminate\Contracts\Queue\Queue - */ - public function connection($value = null) - { - return $this; - } - - /** - * Get the size of the queue. - * - * @param string|null $queue - * @return int - */ - public function size($queue = null) - { - return collect($this->jobs)->flatten(1)->filter( - fn ($job) => $job['queue'] === $queue - )->count(); - } - - /** - * Push a new job onto the queue. - * - * @param string|object $job - * @param mixed $data - * @param string|null $queue - * @return mixed - */ - public function push($job, $data = '', $queue = null) - { - if ($this->shouldFakeJob($job)) { - $this->jobs[is_object($job) ? get_class($job) : $job][] = [ - 'job' => $job, - 'queue' => $queue, - 'data' => $data, - ]; - } else { - is_object($job) && isset($job->connection) - ? $this->queue->connection($job->connection)->push($job, $data, $queue) - : $this->queue->push($job, $data, $queue); - } - } - - /** - * Determine if a job should be faked or actually dispatched. - * - * @param object $job - * @return bool - */ - public function shouldFakeJob($job) - { - if ($this->shouldDispatchJob($job)) { - return false; - } - - if ($this->jobsToFake->isEmpty()) { - return true; - } - - return $this->jobsToFake->contains( - fn ($jobToFake) => $job instanceof ((string) $jobToFake) - ); - } - - /** - * Determine if a job should be pushed to the queue instead of faked. - * - * @param object $job - * @return bool - */ - protected function shouldDispatchJob($job) - { - if ($this->jobsToBeQueued->isEmpty()) { - return false; - } - - return $this->jobsToBeQueued->contains( - fn ($jobToQueue) => $job instanceof ((string) $jobToQueue) - ); - } - - /** - * Push a raw payload onto the queue. - * - * @param string $payload - * @param string|null $queue - * @param array $options - * @return mixed - */ - public function pushRaw($payload, $queue = null, array $options = []) - { - // - } - - /** - * Push a new job onto the queue after (n) seconds. - * - * @param \DateTimeInterface|\DateInterval|int $delay - * @param string|object $job - * @param mixed $data - * @param string|null $queue - * @return mixed - */ - public function later($delay, $job, $data = '', $queue = null) - { - return $this->push($job, $data, $queue); - } - - /** - * Push a new job onto the queue. - * - * @param string $queue - * @param string|object $job - * @param mixed $data - * @return mixed - */ - public function pushOn($queue, $job, $data = '') - { - return $this->push($job, $data, $queue); - } - - /** - * Push a new job onto a specific queue after (n) seconds. - * - * @param string $queue - * @param \DateTimeInterface|\DateInterval|int $delay - * @param string|object $job - * @param mixed $data - * @return mixed - */ - public function laterOn($queue, $delay, $job, $data = '') - { - return $this->push($job, $data, $queue); - } - - /** - * Pop the next job off of the queue. - * - * @param string|null $queue - * @return \Illuminate\Contracts\Queue\Job|null - */ - public function pop($queue = null) - { - // - } - - /** - * Push an array of jobs onto the queue. - * - * @param array $jobs - * @param mixed $data - * @param string|null $queue - * @return mixed - */ - public function bulk($jobs, $data = '', $queue = null) - { - foreach ($jobs as $job) { - $this->push($job, $data, $queue); - } - } - - /** - * Get the jobs that have been pushed. - * - * @return array - */ - public function pushedJobs() - { - return $this->jobs; - } - - /** - * Get the connection name for the queue. - * - * @return string - */ - public function getConnectionName() - { - // - } - - /** - * Set the connection name for the queue. - * - * @param string $name - * @return $this - */ - public function setConnectionName($name) - { - return $this; - } - - /** - * Override the QueueManager to prevent circular dependency. - * - * @param string $method - * @param array $parameters - * @return mixed - * - * @throws \BadMethodCallException - */ - public function __call($method, $parameters) - { - throw new BadMethodCallException(sprintf( - 'Call to undefined method %s::%s()', static::class, $method - )); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Timebox.php b/vendor/laravel/framework/src/Illuminate/Support/Timebox.php deleted file mode 100644 index 6e9361a6..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Timebox.php +++ /dev/null @@ -1,70 +0,0 @@ -earlyReturn && $remainder > 0) { - $this->usleep($remainder); - } - - return $result; - } - - /** - * Indicate that the timebox can return early. - * - * @return $this - */ - public function returnEarly() - { - $this->earlyReturn = true; - - return $this; - } - - /** - * Indicate that the timebox cannot return early. - * - * @return $this - */ - public function dontReturnEarly() - { - $this->earlyReturn = false; - - return $this; - } - - /** - * Sleep for the specified number of microseconds. - * - * @param int $microseconds - * @return void - */ - protected function usleep(int $microseconds) - { - usleep($microseconds); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Traits/CapsuleManagerTrait.php b/vendor/laravel/framework/src/Illuminate/Support/Traits/CapsuleManagerTrait.php deleted file mode 100644 index 05327552..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Traits/CapsuleManagerTrait.php +++ /dev/null @@ -1,69 +0,0 @@ -container = $container; - - if (! $this->container->bound('config')) { - $this->container->instance('config', new Fluent); - } - } - - /** - * Make this capsule instance available globally. - * - * @return void - */ - public function setAsGlobal() - { - static::$instance = $this; - } - - /** - * Get the IoC container instance. - * - * @return \Illuminate\Contracts\Container\Container - */ - public function getContainer() - { - return $this->container; - } - - /** - * Set the IoC container instance. - * - * @param \Illuminate\Contracts\Container\Container $container - * @return void - */ - public function setContainer(Container $container) - { - $this->container = $container; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php b/vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php deleted file mode 100644 index e7181809..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php +++ /dev/null @@ -1,75 +0,0 @@ -{$method}(...$parameters); - } catch (Error|BadMethodCallException $e) { - $pattern = '~^Call to undefined method (?P[^:]+)::(?P[^\(]+)\(\)$~'; - - if (! preg_match($pattern, $e->getMessage(), $matches)) { - throw $e; - } - - if ($matches['class'] != get_class($object) || - $matches['method'] != $method) { - throw $e; - } - - static::throwBadMethodCallException($method); - } - } - - /** - * Forward a method call to the given object, returning $this if the forwarded call returned itself. - * - * @param mixed $object - * @param string $method - * @param array $parameters - * @return mixed - * - * @throws \BadMethodCallException - */ - protected function forwardDecoratedCallTo($object, $method, $parameters) - { - $result = $this->forwardCallTo($object, $method, $parameters); - - if ($result === $object) { - return $this; - } - - return $result; - } - - /** - * Throw a bad method call exception for the given method. - * - * @param string $method - * @return void - * - * @throws \BadMethodCallException - */ - protected static function throwBadMethodCallException($method) - { - throw new BadMethodCallException(sprintf( - 'Call to undefined method %s::%s()', static::class, $method - )); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Traits/Localizable.php b/vendor/laravel/framework/src/Illuminate/Support/Traits/Localizable.php deleted file mode 100644 index 1e9fa58c..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Traits/Localizable.php +++ /dev/null @@ -1,34 +0,0 @@ -getLocale(); - - try { - $app->setLocale($locale); - - return $callback(); - } finally { - $app->setLocale($original); - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Traits/ReflectsClosures.php b/vendor/laravel/framework/src/Illuminate/Support/Traits/ReflectsClosures.php deleted file mode 100644 index bf47d7ec..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Traits/ReflectsClosures.php +++ /dev/null @@ -1,88 +0,0 @@ -closureParameterTypes($closure)); - - if (! $types) { - throw new RuntimeException('The given Closure has no parameters.'); - } - - if ($types[0] === null) { - throw new RuntimeException('The first parameter of the given Closure is missing a type hint.'); - } - - return $types[0]; - } - - /** - * Get the class names of the first parameter of the given Closure, including union types. - * - * @param \Closure $closure - * @return array - * - * @throws \ReflectionException - * @throws \RuntimeException - */ - protected function firstClosureParameterTypes(Closure $closure) - { - $reflection = new ReflectionFunction($closure); - - $types = collect($reflection->getParameters())->mapWithKeys(function ($parameter) { - if ($parameter->isVariadic()) { - return [$parameter->getName() => null]; - } - - return [$parameter->getName() => Reflector::getParameterClassNames($parameter)]; - })->filter()->values()->all(); - - if (empty($types)) { - throw new RuntimeException('The given Closure has no parameters.'); - } - - if (isset($types[0]) && empty($types[0])) { - throw new RuntimeException('The first parameter of the given Closure is missing a type hint.'); - } - - return $types[0]; - } - - /** - * Get the class names / types of the parameters of the given Closure. - * - * @param \Closure $closure - * @return array - * - * @throws \ReflectionException - */ - protected function closureParameterTypes(Closure $closure) - { - $reflection = new ReflectionFunction($closure); - - return collect($reflection->getParameters())->mapWithKeys(function ($parameter) { - if ($parameter->isVariadic()) { - return [$parameter->getName() => null]; - } - - return [$parameter->getName() => Reflector::getParameterClassName($parameter)]; - })->all(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/Traits/Tappable.php b/vendor/laravel/framework/src/Illuminate/Support/Traits/Tappable.php deleted file mode 100644 index 9353451a..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/Traits/Tappable.php +++ /dev/null @@ -1,17 +0,0 @@ -input = $input; - } - - /** - * Determine if the validated input has one or more keys. - * - * @param mixed $keys - * @return bool - */ - public function has($keys) - { - $keys = is_array($keys) ? $keys : func_get_args(); - - foreach ($keys as $key) { - if (! Arr::has($this->input, $key)) { - return false; - } - } - - return true; - } - - /** - * Determine if the validated input is missing one or more keys. - * - * @param mixed $keys - * @return bool - */ - public function missing($keys) - { - return ! $this->has($keys); - } - - /** - * Get a subset containing the provided keys with values from the input data. - * - * @param mixed $keys - * @return array - */ - public function only($keys) - { - $results = []; - - $input = $this->input; - - $placeholder = new stdClass; - - foreach (is_array($keys) ? $keys : func_get_args() as $key) { - $value = data_get($input, $key, $placeholder); - - if ($value !== $placeholder) { - Arr::set($results, $key, $value); - } - } - - return $results; - } - - /** - * Get all of the input except for a specified array of items. - * - * @param mixed $keys - * @return array - */ - public function except($keys) - { - $keys = is_array($keys) ? $keys : func_get_args(); - - $results = $this->input; - - Arr::forget($results, $keys); - - return $results; - } - - /** - * Merge the validated input with the given array of additional data. - * - * @param array $items - * @return static - */ - public function merge(array $items) - { - return new static(array_merge($this->input, $items)); - } - - /** - * Get the input as a collection. - * - * @return \Illuminate\Support\Collection - */ - public function collect() - { - return new Collection($this->input); - } - - /** - * Get the raw, underlying input array. - * - * @return array - */ - public function all() - { - return $this->input; - } - - /** - * Get the instance as an array. - * - * @return array - */ - public function toArray() - { - return $this->all(); - } - - /** - * Dynamically access input data. - * - * @param string $name - * @return mixed - */ - public function __get($name) - { - return $this->input[$name]; - } - - /** - * Dynamically set input data. - * - * @param string $name - * @param mixed $value - * @return mixed - */ - public function __set($name, $value) - { - $this->input[$name] = $value; - } - - /** - * Determine if an input key is set. - * - * @return bool - */ - public function __isset($name) - { - return isset($this->input[$name]); - } - - /** - * Remove an input key. - * - * @param string $name - * @return void - */ - public function __unset($name) - { - unset($this->input[$name]); - } - - /** - * Determine if an item exists at an offset. - * - * @param mixed $key - * @return bool - */ - public function offsetExists($key): bool - { - return isset($this->input[$key]); - } - - /** - * Get an item at a given offset. - * - * @param mixed $key - * @return mixed - */ - public function offsetGet($key): mixed - { - return $this->input[$key]; - } - - /** - * Set the item at a given offset. - * - * @param mixed $key - * @param mixed $value - * @return void - */ - public function offsetSet($key, $value): void - { - if (is_null($key)) { - $this->input[] = $value; - } else { - $this->input[$key] = $value; - } - } - - /** - * Unset the item at a given offset. - * - * @param string $key - * @return void - */ - public function offsetUnset($key): void - { - unset($this->input[$key]); - } - - /** - * Get an iterator for the input. - * - * @return \ArrayIterator - */ - public function getIterator(): Traversable - { - return new ArrayIterator($this->input); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/ViewErrorBag.php b/vendor/laravel/framework/src/Illuminate/Support/ViewErrorBag.php deleted file mode 100644 index ff9da4fc..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/ViewErrorBag.php +++ /dev/null @@ -1,130 +0,0 @@ -bags[$key]); - } - - /** - * Get a MessageBag instance from the bags. - * - * @param string $key - * @return \Illuminate\Contracts\Support\MessageBag - */ - public function getBag($key) - { - return Arr::get($this->bags, $key) ?: new MessageBag; - } - - /** - * Get all the bags. - * - * @return array - */ - public function getBags() - { - return $this->bags; - } - - /** - * Add a new MessageBag instance to the bags. - * - * @param string $key - * @param \Illuminate\Contracts\Support\MessageBag $bag - * @return $this - */ - public function put($key, MessageBagContract $bag) - { - $this->bags[$key] = $bag; - - return $this; - } - - /** - * Determine if the default message bag has any messages. - * - * @return bool - */ - public function any() - { - return $this->count() > 0; - } - - /** - * Get the number of messages in the default bag. - * - * @return int - */ - public function count(): int - { - return $this->getBag('default')->count(); - } - - /** - * Dynamically call methods on the default bag. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - return $this->getBag('default')->$method(...$parameters); - } - - /** - * Dynamically access a view error bag. - * - * @param string $key - * @return \Illuminate\Contracts\Support\MessageBag - */ - public function __get($key) - { - return $this->getBag($key); - } - - /** - * Dynamically set a view error bag. - * - * @param string $key - * @param \Illuminate\Contracts\Support\MessageBag $value - * @return void - */ - public function __set($key, $value) - { - $this->put($key, $value); - } - - /** - * Convert the default bag to its string representation. - * - * @return string - */ - public function __toString() - { - return (string) $this->getBag('default'); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/composer.json b/vendor/laravel/framework/src/Illuminate/Support/composer.json deleted file mode 100644 index cc86a276..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/composer.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "name": "illuminate/support", - "description": "The Illuminate Support package.", - "license": "MIT", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "require": { - "php": "^8.0.2", - "ext-json": "*", - "ext-mbstring": "*", - "doctrine/inflector": "^2.0", - "illuminate/collections": "^9.0", - "illuminate/conditionable": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "nesbot/carbon": "^2.62.1", - "voku/portable-ascii": "^2.0" - }, - "conflict": { - "tightenco/collect": "<5.5.33" - }, - "autoload": { - "psr-4": { - "Illuminate\\Support\\": "" - }, - "files": [ - "helpers.php" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "suggest": { - "illuminate/filesystem": "Required to use the composer class (^9.0).", - "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^2.0.2).", - "ramsey/uuid": "Required to use Str::uuid() (^4.7).", - "symfony/process": "Required to use the composer class (^6.0).", - "symfony/uid": "Required to use Str::ulid() (^6.0).", - "symfony/var-dumper": "Required to use the dd function (^6.0).", - "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.4.1)." - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev" -} diff --git a/vendor/laravel/framework/src/Illuminate/Support/helpers.php b/vendor/laravel/framework/src/Illuminate/Support/helpers.php deleted file mode 100755 index 2e62e149..00000000 --- a/vendor/laravel/framework/src/Illuminate/Support/helpers.php +++ /dev/null @@ -1,424 +0,0 @@ - $value) { - if (is_numeric($key)) { - $start++; - - $array[$start] = Arr::pull($array, $key); - } - } - - return $array; - } -} - -if (! function_exists('blank')) { - /** - * Determine if the given value is "blank". - * - * @param mixed $value - * @return bool - */ - function blank($value) - { - if (is_null($value)) { - return true; - } - - if (is_string($value)) { - return trim($value) === ''; - } - - if (is_numeric($value) || is_bool($value)) { - return false; - } - - if ($value instanceof Countable) { - return count($value) === 0; - } - - return empty($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)); - } -} - -if (! function_exists('class_uses_recursive')) { - /** - * Returns all traits used by a class, its parent classes and trait of their traits. - * - * @param object|string $class - * @return array - */ - function class_uses_recursive($class) - { - if (is_object($class)) { - $class = get_class($class); - } - - $results = []; - - foreach (array_reverse(class_parents($class)) + [$class => $class] as $class) { - $results += trait_uses_recursive($class); - } - - return array_unique($results); - } -} - -if (! function_exists('e')) { - /** - * Encode HTML special characters in a string. - * - * @param \Illuminate\Contracts\Support\DeferringDisplayableValue|\Illuminate\Contracts\Support\Htmlable|\BackedEnum|string|null $value - * @param bool $doubleEncode - * @return string - */ - function e($value, $doubleEncode = true) - { - if ($value instanceof DeferringDisplayableValue) { - $value = $value->resolveDisplayableValue(); - } - - if ($value instanceof Htmlable) { - return $value->toHtml(); - } - - if ($value instanceof BackedEnum) { - $value = $value->value; - } - - return htmlspecialchars($value ?? '', ENT_QUOTES, 'UTF-8', $doubleEncode); - } -} - -if (! function_exists('env')) { - /** - * Gets the value of an environment variable. - * - * @param string $key - * @param mixed $default - * @return mixed - */ - function env($key, $default = null) - { - return Env::get($key, $default); - } -} - -if (! function_exists('filled')) { - /** - * Determine if a value is "filled". - * - * @param mixed $value - * @return bool - */ - function filled($value) - { - return ! blank($value); - } -} - -if (! function_exists('object_get')) { - /** - * Get an item from an object using "dot" notation. - * - * @param object $object - * @param string|null $key - * @param mixed $default - * @return mixed - */ - function object_get($object, $key, $default = null) - { - if (is_null($key) || trim($key) === '') { - return $object; - } - - foreach (explode('.', $key) as $segment) { - if (! is_object($object) || ! isset($object->{$segment})) { - return value($default); - } - - $object = $object->{$segment}; - } - - return $object; - } -} - -if (! function_exists('optional')) { - /** - * Provide access to optional objects. - * - * @param mixed $value - * @param callable|null $callback - * @return mixed - */ - function optional($value = null, callable $callback = null) - { - if (is_null($callback)) { - return new Optional($value); - } elseif (! is_null($value)) { - return $callback($value); - } - } -} - -if (! function_exists('preg_replace_array')) { - /** - * Replace a given pattern with each value in the array in sequentially. - * - * @param string $pattern - * @param array $replacements - * @param string $subject - * @return string - */ - function preg_replace_array($pattern, array $replacements, $subject) - { - return preg_replace_callback($pattern, function () use (&$replacements) { - foreach ($replacements as $value) { - return array_shift($replacements); - } - }, $subject); - } -} - -if (! function_exists('retry')) { - /** - * Retry an operation a given number of times. - * - * @param int|array $times - * @param callable $callback - * @param int|\Closure $sleepMilliseconds - * @param callable|null $when - * @return mixed - * - * @throws \Exception - */ - function retry($times, callable $callback, $sleepMilliseconds = 0, $when = null) - { - $attempts = 0; - - $backoff = []; - - if (is_array($times)) { - $backoff = $times; - - $times = count($times) + 1; - } - - beginning: - $attempts++; - $times--; - - try { - return $callback($attempts); - } catch (Exception $e) { - if ($times < 1 || ($when && ! $when($e))) { - throw $e; - } - - $sleepMilliseconds = $backoff[$attempts - 1] ?? $sleepMilliseconds; - - if ($sleepMilliseconds) { - usleep(value($sleepMilliseconds, $attempts, $e) * 1000); - } - - goto beginning; - } - } -} - -if (! function_exists('str')) { - /** - * Get a new stringable object from the given string. - * - * @param string|null $string - * @return \Illuminate\Support\Stringable|mixed - */ - function str($string = null) - { - if (func_num_args() === 0) { - return new class - { - public function __call($method, $parameters) - { - return Str::$method(...$parameters); - } - - public function __toString() - { - return ''; - } - }; - } - - return Str::of($string); - } -} - -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('throw_if')) { - /** - * Throw the given exception if the given condition is true. - * - * @param mixed $condition - * @param \Throwable|string $exception - * @param mixed ...$parameters - * @return mixed - * - * @throws \Throwable - */ - function throw_if($condition, $exception = 'RuntimeException', ...$parameters) - { - if ($condition) { - if (is_string($exception) && class_exists($exception)) { - $exception = new $exception(...$parameters); - } - - throw is_string($exception) ? new RuntimeException($exception) : $exception; - } - - return $condition; - } -} - -if (! function_exists('throw_unless')) { - /** - * Throw the given exception unless the given condition is true. - * - * @param mixed $condition - * @param \Throwable|string $exception - * @param mixed ...$parameters - * @return mixed - * - * @throws \Throwable - */ - function throw_unless($condition, $exception = 'RuntimeException', ...$parameters) - { - throw_if(! $condition, $exception, ...$parameters); - - return $condition; - } -} - -if (! function_exists('trait_uses_recursive')) { - /** - * Returns all traits used by a trait and its traits. - * - * @param string $trait - * @return array - */ - function trait_uses_recursive($trait) - { - $traits = class_uses($trait) ?: []; - - foreach ($traits as $trait) { - $traits += trait_uses_recursive($trait); - } - - return $traits; - } -} - -if (! function_exists('transform')) { - /** - * Transform the given value if it is present. - * - * @param mixed $value - * @param callable $callback - * @param mixed $default - * @return mixed|null - */ - function transform($value, callable $callback, $default = null) - { - if (filled($value)) { - return $callback($value); - } - - if (is_callable($default)) { - return $default($value); - } - - return $default; - } -} - -if (! function_exists('windows_os')) { - /** - * Determine whether the current environment is Windows based. - * - * @return bool - */ - function windows_os() - { - return PHP_OS_FAMILY === 'Windows'; - } -} - -if (! function_exists('with')) { - /** - * Return the given value, optionally passed through the given callback. - * - * @template TValue - * - * @param TValue $value - * @param (callable(TValue): TValue)|null $callback - * @return TValue - */ - function with($value, callable $callback = null) - { - return is_null($callback) ? $value : $callback($value); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Testing/Assert.php b/vendor/laravel/framework/src/Illuminate/Testing/Assert.php deleted file mode 100644 index c0184b7b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Testing/Assert.php +++ /dev/null @@ -1,79 +0,0 @@ -json = $jsonable; - - if ($jsonable instanceof JsonSerializable) { - $this->decoded = $jsonable->jsonSerialize(); - } elseif ($jsonable instanceof Jsonable) { - $this->decoded = json_decode($jsonable->toJson(), true); - } elseif (is_array($jsonable)) { - $this->decoded = $jsonable; - } else { - $this->decoded = json_decode($jsonable, true); - } - } - - /** - * Validate and return the decoded response JSON. - * - * @param string|null $key - * @return mixed - */ - public function json($key = null) - { - return data_get($this->decoded, $key); - } - - /** - * Assert that the response JSON has the expected count of items at the given key. - * - * @param int $count - * @param string|null $key - * @return $this - */ - public function assertCount(int $count, $key = null) - { - if (! is_null($key)) { - PHPUnit::assertCount( - $count, data_get($this->decoded, $key), - "Failed to assert that the response count matched the expected {$count}" - ); - - return $this; - } - - PHPUnit::assertCount($count, - $this->decoded, - "Failed to assert that the response count matched the expected {$count}" - ); - - return $this; - } - - /** - * Assert that the response has the exact given JSON. - * - * @param array $data - * @return $this - */ - public function assertExact(array $data) - { - $actual = $this->reorderAssocKeys((array) $this->decoded); - - $expected = $this->reorderAssocKeys($data); - - PHPUnit::assertEquals( - json_encode($expected, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES), - json_encode($actual, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) - ); - - return $this; - } - - /** - * Assert that the response has the similar JSON as given. - * - * @param array $data - * @return $this - */ - public function assertSimilar(array $data) - { - $actual = json_encode( - Arr::sortRecursive((array) $this->decoded), - JSON_UNESCAPED_UNICODE - ); - - PHPUnit::assertEquals(json_encode(Arr::sortRecursive($data), JSON_UNESCAPED_UNICODE), $actual); - - return $this; - } - - /** - * Assert that the response contains the given JSON fragment. - * - * @param array $data - * @return $this - */ - public function assertFragment(array $data) - { - $actual = json_encode( - Arr::sortRecursive((array) $this->decoded), - JSON_UNESCAPED_UNICODE - ); - - foreach (Arr::sortRecursive($data) as $key => $value) { - $expected = $this->jsonSearchStrings($key, $value); - - PHPUnit::assertTrue( - Str::contains($actual, $expected), - 'Unable to find JSON fragment: '.PHP_EOL.PHP_EOL. - '['.json_encode([$key => $value], JSON_UNESCAPED_UNICODE).']'.PHP_EOL.PHP_EOL. - 'within'.PHP_EOL.PHP_EOL. - "[{$actual}]." - ); - } - - return $this; - } - - /** - * Assert that the response does not contain the given JSON fragment. - * - * @param array $data - * @param bool $exact - * @return $this - */ - public function assertMissing(array $data, $exact = false) - { - if ($exact) { - return $this->assertMissingExact($data); - } - - $actual = json_encode( - Arr::sortRecursive((array) $this->decoded), - JSON_UNESCAPED_UNICODE - ); - - foreach (Arr::sortRecursive($data) as $key => $value) { - $unexpected = $this->jsonSearchStrings($key, $value); - - PHPUnit::assertFalse( - Str::contains($actual, $unexpected), - 'Found unexpected JSON fragment: '.PHP_EOL.PHP_EOL. - '['.json_encode([$key => $value], JSON_UNESCAPED_UNICODE).']'.PHP_EOL.PHP_EOL. - 'within'.PHP_EOL.PHP_EOL. - "[{$actual}]." - ); - } - - return $this; - } - - /** - * Assert that the response does not contain the exact JSON fragment. - * - * @param array $data - * @return $this - */ - public function assertMissingExact(array $data) - { - $actual = json_encode( - Arr::sortRecursive((array) $this->decoded), - JSON_UNESCAPED_UNICODE - ); - - foreach (Arr::sortRecursive($data) as $key => $value) { - $unexpected = $this->jsonSearchStrings($key, $value); - - if (! Str::contains($actual, $unexpected)) { - return $this; - } - } - - PHPUnit::fail( - 'Found unexpected JSON fragment: '.PHP_EOL.PHP_EOL. - '['.json_encode($data, JSON_UNESCAPED_UNICODE).']'.PHP_EOL.PHP_EOL. - 'within'.PHP_EOL.PHP_EOL. - "[{$actual}]." - ); - - return $this; - } - - /** - * Assert that the response does not contain the given path. - * - * @param string $path - * @return $this - */ - public function assertMissingPath($path) - { - PHPUnit::assertFalse(Arr::has($this->json(), $path)); - - return $this; - } - - /** - * Assert that the expected value and type exists at the given path in the response. - * - * @param string $path - * @param mixed $expect - * @return $this - */ - public function assertPath($path, $expect) - { - if ($expect instanceof Closure) { - PHPUnit::assertTrue($expect($this->json($path))); - } else { - PHPUnit::assertSame($expect, $this->json($path)); - } - - return $this; - } - - /** - * Assert that the response has a given JSON structure. - * - * @param array|null $structure - * @param array|null $responseData - * @return $this - */ - public function assertStructure(array $structure = null, $responseData = null) - { - if (is_null($structure)) { - return $this->assertSimilar($this->decoded); - } - - if (! is_null($responseData)) { - return (new static($responseData))->assertStructure($structure); - } - - foreach ($structure as $key => $value) { - if (is_array($value) && $key === '*') { - PHPUnit::assertIsArray($this->decoded); - - foreach ($this->decoded as $responseDataItem) { - $this->assertStructure($structure['*'], $responseDataItem); - } - } elseif (is_array($value)) { - PHPUnit::assertArrayHasKey($key, $this->decoded); - - $this->assertStructure($structure[$key], $this->decoded[$key]); - } else { - PHPUnit::assertArrayHasKey($value, $this->decoded); - } - } - - return $this; - } - - /** - * Assert that the response is a superset of the given JSON. - * - * @param array $data - * @param bool $strict - * @return $this - */ - public function assertSubset(array $data, $strict = false) - { - PHPUnit::assertArraySubset( - $data, $this->decoded, $strict, $this->assertJsonMessage($data) - ); - - return $this; - } - - /** - * Reorder associative array keys to make it easy to compare arrays. - * - * @param array $data - * @return array - */ - protected function reorderAssocKeys(array $data) - { - $data = Arr::dot($data); - ksort($data); - - $result = []; - - foreach ($data as $key => $value) { - Arr::set($result, $key, $value); - } - - return $result; - } - - /** - * Get the assertion message for assertJson. - * - * @param array $data - * @return string - */ - protected function assertJsonMessage(array $data) - { - $expected = json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); - - $actual = json_encode($this->decoded, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); - - return 'Unable to find JSON: '.PHP_EOL.PHP_EOL. - "[{$expected}]".PHP_EOL.PHP_EOL. - 'within response JSON:'.PHP_EOL.PHP_EOL. - "[{$actual}].".PHP_EOL.PHP_EOL; - } - - /** - * Get the strings we need to search for when examining the JSON. - * - * @param string $key - * @param string $value - * @return array - */ - protected function jsonSearchStrings($key, $value) - { - $needle = Str::substr(json_encode([$key => $value], JSON_UNESCAPED_UNICODE), 1, -1); - - return [ - $needle.']', - $needle.'}', - $needle.',', - ]; - } - - /** - * Get the total number of items in the underlying JSON array. - * - * @return int - */ - public function count(): int - { - return count($this->decoded); - } - - /** - * Determine whether an offset exists. - * - * @param mixed $offset - * @return bool - */ - public function offsetExists($offset): bool - { - return isset($this->decoded[$offset]); - } - - /** - * Get the value at the given offset. - * - * @param string $offset - * @return mixed - */ - public function offsetGet($offset): mixed - { - return $this->decoded[$offset]; - } - - /** - * Set the value at the given offset. - * - * @param string $offset - * @param mixed $value - * @return void - */ - public function offsetSet($offset, $value): void - { - $this->decoded[$offset] = $value; - } - - /** - * Unset the value at the given offset. - * - * @param string $offset - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->decoded[$offset]); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Testing/Concerns/TestDatabases.php b/vendor/laravel/framework/src/Illuminate/Testing/Concerns/TestDatabases.php deleted file mode 100644 index eff8f276..00000000 --- a/vendor/laravel/framework/src/Illuminate/Testing/Concerns/TestDatabases.php +++ /dev/null @@ -1,188 +0,0 @@ -whenNotUsingInMemoryDatabase(function ($database) { - if (ParallelTesting::option('recreate_databases')) { - Schema::dropDatabaseIfExists( - $this->testDatabase($database) - ); - } - }); - }); - - ParallelTesting::setUpTestCase(function ($testCase) { - $uses = array_flip(class_uses_recursive(get_class($testCase))); - - $databaseTraits = [ - Testing\DatabaseMigrations::class, - Testing\DatabaseTransactions::class, - Testing\RefreshDatabase::class, - ]; - - if (Arr::hasAny($uses, $databaseTraits) && ! ParallelTesting::option('without_databases')) { - $this->whenNotUsingInMemoryDatabase(function ($database) use ($uses) { - [$testDatabase, $created] = $this->ensureTestDatabaseExists($database); - - $this->switchToDatabase($testDatabase); - - if (isset($uses[Testing\DatabaseTransactions::class])) { - $this->ensureSchemaIsUpToDate(); - } - - if ($created) { - ParallelTesting::callSetUpTestDatabaseCallbacks($testDatabase); - } - }); - } - }); - - ParallelTesting::tearDownProcess(function () { - $this->whenNotUsingInMemoryDatabase(function ($database) { - if (ParallelTesting::option('drop_databases')) { - Schema::dropDatabaseIfExists( - $this->testDatabase($database) - ); - } - }); - }); - } - - /** - * Ensure a test database exists and returns its name. - * - * @param string $database - * @return array - */ - protected function ensureTestDatabaseExists($database) - { - $testDatabase = $this->testDatabase($database); - - try { - $this->usingDatabase($testDatabase, function () { - Schema::hasTable('dummy'); - }); - } catch (QueryException $e) { - $this->usingDatabase($database, function () use ($testDatabase) { - Schema::dropDatabaseIfExists($testDatabase); - Schema::createDatabase($testDatabase); - }); - - return [$testDatabase, true]; - } - - return [$testDatabase, false]; - } - - /** - * Ensure the current database test schema is up to date. - * - * @return void - */ - protected function ensureSchemaIsUpToDate() - { - if (! static::$schemaIsUpToDate) { - Artisan::call('migrate'); - - static::$schemaIsUpToDate = true; - } - } - - /** - * Runs the given callable using the given database. - * - * @param string $database - * @param callable $callable - * @return void - */ - protected function usingDatabase($database, $callable) - { - $original = DB::getConfig('database'); - - try { - $this->switchToDatabase($database); - $callable(); - } finally { - $this->switchToDatabase($original); - } - } - - /** - * Apply the given callback when tests are not using in memory database. - * - * @param callable $callback - * @return void - */ - protected function whenNotUsingInMemoryDatabase($callback) - { - $database = DB::getConfig('database'); - - if ($database !== ':memory:') { - $callback($database); - } - } - - /** - * Switch to the given database. - * - * @param string $database - * @return void - */ - protected function switchToDatabase($database) - { - DB::purge(); - - $default = config('database.default'); - - $url = config("database.connections.{$default}.url"); - - if ($url) { - config()->set( - "database.connections.{$default}.url", - preg_replace('/^(.*)(\/[\w-]*)(\??.*)$/', "$1/{$database}$3", $url), - ); - } else { - config()->set( - "database.connections.{$default}.database", - $database, - ); - } - } - - /** - * Returns the test database name. - * - * @return string - */ - protected function testDatabase($database) - { - $token = ParallelTesting::token(); - - return "{$database}_test_{$token}"; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Testing/Constraints/ArraySubset.php b/vendor/laravel/framework/src/Illuminate/Testing/Constraints/ArraySubset.php deleted file mode 100644 index c455bdd5..00000000 --- a/vendor/laravel/framework/src/Illuminate/Testing/Constraints/ArraySubset.php +++ /dev/null @@ -1,279 +0,0 @@ -= 9) { - /** - * @internal This class is not meant to be used or overwritten outside the framework itself. - */ - final class ArraySubset extends Constraint - { - /** - * @var iterable - */ - private $subset; - - /** - * @var bool - */ - private $strict; - - /** - * Create a new array subset constraint instance. - * - * @param iterable $subset - * @param bool $strict - * @return void - */ - public function __construct(iterable $subset, bool $strict = false) - { - $this->strict = $strict; - $this->subset = $subset; - } - - /** - * Evaluates the constraint for parameter $other. - * - * If $returnResult is set to false (the default), an exception is thrown - * in case of a failure. null is returned otherwise. - * - * If $returnResult is true, the result of the evaluation is returned as - * a boolean value instead: true in case of success, false in case of a - * failure. - * - * @param mixed $other - * @param string $description - * @param bool $returnResult - * @return bool|null - * - * @throws \PHPUnit\Framework\ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function evaluate($other, string $description = '', bool $returnResult = false): ?bool - { - // type cast $other & $this->subset as an array to allow - // support in standard array functions. - $other = $this->toArray($other); - $this->subset = $this->toArray($this->subset); - - $patched = array_replace_recursive($other, $this->subset); - - if ($this->strict) { - $result = $other === $patched; - } else { - $result = $other == $patched; - } - - if ($returnResult) { - return $result; - } - - if (! $result) { - $f = new ComparisonFailure( - $patched, - $other, - var_export($patched, true), - var_export($other, true) - ); - - $this->fail($other, $description, $f); - } - - return null; - } - - /** - * Returns a string representation of the constraint. - * - * @return string - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function toString(): string - { - return 'has the subset '.$this->exporter()->export($this->subset); - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other - * @return string - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - protected function failureDescription($other): string - { - return 'an array '.$this->toString(); - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param iterable $other - * @return array - */ - private function toArray(iterable $other): array - { - if (is_array($other)) { - return $other; - } - - if ($other instanceof ArrayObject) { - return $other->getArrayCopy(); - } - - if ($other instanceof Traversable) { - return iterator_to_array($other); - } - - // Keep BC even if we know that array would not be the expected one - return (array) $other; - } - } -} else { - /** - * @internal This class is not meant to be used or overwritten outside the framework itself. - */ - final class ArraySubset extends Constraint - { - /** - * @var iterable - */ - private $subset; - - /** - * @var bool - */ - private $strict; - - /** - * Create a new array subset constraint instance. - * - * @param iterable $subset - * @param bool $strict - * @return void - */ - public function __construct(iterable $subset, bool $strict = false) - { - $this->strict = $strict; - $this->subset = $subset; - } - - /** - * Evaluates the constraint for parameter $other. - * - * If $returnResult is set to false (the default), an exception is thrown - * in case of a failure. null is returned otherwise. - * - * If $returnResult is true, the result of the evaluation is returned as - * a boolean value instead: true in case of success, false in case of a - * failure. - * - * @param mixed $other - * @param string $description - * @param bool $returnResult - * @return bool|null - * - * @throws \PHPUnit\Framework\ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function evaluate($other, string $description = '', bool $returnResult = false) - { - // type cast $other & $this->subset as an array to allow - // support in standard array functions. - $other = $this->toArray($other); - $this->subset = $this->toArray($this->subset); - - $patched = array_replace_recursive($other, $this->subset); - - if ($this->strict) { - $result = $other === $patched; - } else { - $result = $other == $patched; - } - - if ($returnResult) { - return $result; - } - - if (! $result) { - $f = new ComparisonFailure( - $patched, - $other, - var_export($patched, true), - var_export($other, true) - ); - - $this->fail($other, $description, $f); - } - } - - /** - * Returns a string representation of the constraint. - * - * @return string - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function toString(): string - { - return 'has the subset '.$this->exporter()->export($this->subset); - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other - * @return string - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - protected function failureDescription($other): string - { - return 'an array '.$this->toString(); - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param iterable $other - * @return array - */ - private function toArray(iterable $other): array - { - if (is_array($other)) { - return $other; - } - - if ($other instanceof ArrayObject) { - return $other->getArrayCopy(); - } - - if ($other instanceof Traversable) { - return iterator_to_array($other); - } - - // Keep BC even if we know that array would not be the expected one - return (array) $other; - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Testing/Constraints/CountInDatabase.php b/vendor/laravel/framework/src/Illuminate/Testing/Constraints/CountInDatabase.php deleted file mode 100644 index 3ed68269..00000000 --- a/vendor/laravel/framework/src/Illuminate/Testing/Constraints/CountInDatabase.php +++ /dev/null @@ -1,83 +0,0 @@ -expectedCount = $expectedCount; - - $this->database = $database; - } - - /** - * Check if the expected and actual count are equal. - * - * @param string $table - * @return bool - */ - public function matches($table): bool - { - $this->actualCount = $this->database->table($table)->count(); - - return $this->actualCount === $this->expectedCount; - } - - /** - * Get the description of the failure. - * - * @param string $table - * @return string - */ - public function failureDescription($table): string - { - return sprintf( - "table [%s] matches expected entries count of %s. Entries found: %s.\n", - $table, $this->expectedCount, $this->actualCount - ); - } - - /** - * Get a string representation of the object. - * - * @param int $options - * @return string - */ - public function toString($options = 0): string - { - return (new ReflectionClass($this))->name; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Testing/Constraints/HasInDatabase.php b/vendor/laravel/framework/src/Illuminate/Testing/Constraints/HasInDatabase.php deleted file mode 100644 index c377f01b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Testing/Constraints/HasInDatabase.php +++ /dev/null @@ -1,121 +0,0 @@ -data = $data; - - $this->database = $database; - } - - /** - * Check if the data is found in the given table. - * - * @param string $table - * @return bool - */ - public function matches($table): bool - { - return $this->database->table($table)->where($this->data)->count() > 0; - } - - /** - * Get the description of the failure. - * - * @param string $table - * @return string - */ - public function failureDescription($table): string - { - return sprintf( - "a row in the table [%s] matches the attributes %s.\n\n%s", - $table, $this->toString(JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE), $this->getAdditionalInfo($table) - ); - } - - /** - * Get additional info about the records found in the database table. - * - * @param string $table - * @return string - */ - protected function getAdditionalInfo($table) - { - $query = $this->database->table($table); - - $similarResults = $query->where( - array_key_first($this->data), - $this->data[array_key_first($this->data)] - )->select(array_keys($this->data))->limit($this->show)->get(); - - if ($similarResults->isNotEmpty()) { - $description = 'Found similar results: '.json_encode($similarResults, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE); - } else { - $query = $this->database->table($table); - - $results = $query->select(array_keys($this->data))->limit($this->show)->get(); - - if ($results->isEmpty()) { - return 'The table is empty'; - } - - $description = 'Found: '.json_encode($results, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE); - } - - if ($query->count() > $this->show) { - $description .= sprintf(' and %s others', $query->count() - $this->show); - } - - return $description; - } - - /** - * Get a string representation of the object. - * - * @param int $options - * @return string - */ - public function toString($options = 0): string - { - foreach ($this->data as $key => $data) { - $output[$key] = $data instanceof Expression ? (string) $data : $data; - } - - return json_encode($output ?? [], $options); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Testing/Constraints/NotSoftDeletedInDatabase.php b/vendor/laravel/framework/src/Illuminate/Testing/Constraints/NotSoftDeletedInDatabase.php deleted file mode 100644 index ff819582..00000000 --- a/vendor/laravel/framework/src/Illuminate/Testing/Constraints/NotSoftDeletedInDatabase.php +++ /dev/null @@ -1,115 +0,0 @@ -database = $database; - $this->data = $data; - $this->deletedAtColumn = $deletedAtColumn; - } - - /** - * Check if the data is found in the given table. - * - * @param string $table - * @return bool - */ - public function matches($table): bool - { - return $this->database->table($table) - ->where($this->data) - ->whereNull($this->deletedAtColumn) - ->count() > 0; - } - - /** - * Get the description of the failure. - * - * @param string $table - * @return string - */ - public function failureDescription($table): string - { - return sprintf( - "any existing row in the table [%s] matches the attributes %s.\n\n%s", - $table, $this->toString(), $this->getAdditionalInfo($table) - ); - } - - /** - * Get additional info about the records found in the database table. - * - * @param string $table - * @return string - */ - protected function getAdditionalInfo($table) - { - $query = $this->database->table($table); - - $results = $query->limit($this->show)->get(); - - if ($results->isEmpty()) { - return 'The table is empty'; - } - - $description = 'Found: '.json_encode($results, JSON_PRETTY_PRINT); - - if ($query->count() > $this->show) { - $description .= sprintf(' and %s others', $query->count() - $this->show); - } - - return $description; - } - - /** - * Get a string representation of the object. - * - * @return string - */ - public function toString(): string - { - return json_encode($this->data); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Testing/Constraints/SeeInOrder.php b/vendor/laravel/framework/src/Illuminate/Testing/Constraints/SeeInOrder.php deleted file mode 100644 index 609f32d5..00000000 --- a/vendor/laravel/framework/src/Illuminate/Testing/Constraints/SeeInOrder.php +++ /dev/null @@ -1,88 +0,0 @@ -content = $content; - } - - /** - * Determine if the rule passes validation. - * - * @param array $values - * @return bool - */ - public function matches($values): bool - { - $position = 0; - - foreach ($values as $value) { - if (empty($value)) { - continue; - } - - $valuePosition = mb_strpos($this->content, $value, $position); - - if ($valuePosition === false || $valuePosition < $position) { - $this->failedValue = $value; - - return false; - } - - $position = $valuePosition + mb_strlen($value); - } - - return true; - } - - /** - * Get the description of the failure. - * - * @param array $values - * @return string - */ - public function failureDescription($values): string - { - return sprintf( - 'Failed asserting that \'%s\' contains "%s" in specified order.', - $this->content, - $this->failedValue - ); - } - - /** - * Get a string representation of the object. - * - * @return string - */ - public function toString(): string - { - return (new ReflectionClass($this))->name; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Testing/Constraints/SoftDeletedInDatabase.php b/vendor/laravel/framework/src/Illuminate/Testing/Constraints/SoftDeletedInDatabase.php deleted file mode 100644 index baaeee27..00000000 --- a/vendor/laravel/framework/src/Illuminate/Testing/Constraints/SoftDeletedInDatabase.php +++ /dev/null @@ -1,117 +0,0 @@ -data = $data; - - $this->database = $database; - - $this->deletedAtColumn = $deletedAtColumn; - } - - /** - * Check if the data is found in the given table. - * - * @param string $table - * @return bool - */ - public function matches($table): bool - { - return $this->database->table($table) - ->where($this->data) - ->whereNotNull($this->deletedAtColumn) - ->count() > 0; - } - - /** - * Get the description of the failure. - * - * @param string $table - * @return string - */ - public function failureDescription($table): string - { - return sprintf( - "any soft deleted row in the table [%s] matches the attributes %s.\n\n%s", - $table, $this->toString(), $this->getAdditionalInfo($table) - ); - } - - /** - * Get additional info about the records found in the database table. - * - * @param string $table - * @return string - */ - protected function getAdditionalInfo($table) - { - $query = $this->database->table($table); - - $results = $query->limit($this->show)->get(); - - if ($results->isEmpty()) { - return 'The table is empty'; - } - - $description = 'Found: '.json_encode($results, JSON_PRETTY_PRINT); - - if ($query->count() > $this->show) { - $description .= sprintf(' and %s others', $query->count() - $this->show); - } - - return $description; - } - - /** - * Get a string representation of the object. - * - * @return string - */ - public function toString(): string - { - return json_encode($this->data); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Testing/Fluent/AssertableJson.php b/vendor/laravel/framework/src/Illuminate/Testing/Fluent/AssertableJson.php deleted file mode 100644 index fde468e3..00000000 --- a/vendor/laravel/framework/src/Illuminate/Testing/Fluent/AssertableJson.php +++ /dev/null @@ -1,177 +0,0 @@ -path = $path; - $this->props = $props; - } - - /** - * Compose the absolute "dot" path to the given key. - * - * @param string $key - * @return string - */ - protected function dotPath(string $key = ''): string - { - if (is_null($this->path)) { - return $key; - } - - return rtrim(implode('.', [$this->path, $key]), '.'); - } - - /** - * Retrieve a prop within the current scope using "dot" notation. - * - * @param string|null $key - * @return mixed - */ - protected function prop(string $key = null) - { - return Arr::get($this->props, $key); - } - - /** - * Instantiate a new "scope" at the path of the given key. - * - * @param string $key - * @param \Closure $callback - * @return $this - */ - protected function scope(string $key, Closure $callback): self - { - $props = $this->prop($key); - $path = $this->dotPath($key); - - PHPUnit::assertIsArray($props, sprintf('Property [%s] is not scopeable.', $path)); - - $scope = new static($props, $path); - $callback($scope); - $scope->interacted(); - - return $this; - } - - /** - * Instantiate a new "scope" on the first child element. - * - * @param \Closure $callback - * @return $this - */ - public function first(Closure $callback): self - { - $props = $this->prop(); - - $path = $this->dotPath(); - - PHPUnit::assertNotEmpty($props, $path === '' - ? 'Cannot scope directly onto the first element of the root level because it is empty.' - : sprintf('Cannot scope directly onto the first element of property [%s] because it is empty.', $path) - ); - - $key = array_keys($props)[0]; - - $this->interactsWith($key); - - return $this->scope($key, $callback); - } - - /** - * Instantiate a new "scope" on each child element. - * - * @param \Closure $callback - * @return $this - */ - public function each(Closure $callback): self - { - $props = $this->prop(); - - $path = $this->dotPath(); - - PHPUnit::assertNotEmpty($props, $path === '' - ? 'Cannot scope directly onto each element of the root level because it is empty.' - : sprintf('Cannot scope directly onto each element of property [%s] because it is empty.', $path) - ); - - foreach (array_keys($props) as $key) { - $this->interactsWith($key); - - $this->scope($key, $callback); - } - - return $this; - } - - /** - * Create a new instance from an array. - * - * @param array $data - * @return static - */ - public static function fromArray(array $data): self - { - return new static($data); - } - - /** - * Create a new instance from an AssertableJsonString. - * - * @param \Illuminate\Testing\AssertableJsonString $json - * @return static - */ - public static function fromAssertableJsonString(AssertableJsonString $json): self - { - return static::fromArray($json->json()); - } - - /** - * Get the instance as an array. - * - * @return array - */ - public function toArray() - { - return $this->props; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Testing/Fluent/Concerns/Debugging.php b/vendor/laravel/framework/src/Illuminate/Testing/Fluent/Concerns/Debugging.php deleted file mode 100644 index e655556c..00000000 --- a/vendor/laravel/framework/src/Illuminate/Testing/Fluent/Concerns/Debugging.php +++ /dev/null @@ -1,38 +0,0 @@ -prop($prop)); - - return $this; - } - - /** - * Dumps the given props and exits. - * - * @param string|null $prop - * @return never - */ - public function dd(string $prop = null): void - { - dd($this->prop($prop)); - } - - /** - * Retrieve a prop within the current scope using "dot" notation. - * - * @param string|null $key - * @return mixed - */ - abstract protected function prop(string $key = null); -} diff --git a/vendor/laravel/framework/src/Illuminate/Testing/Fluent/Concerns/Has.php b/vendor/laravel/framework/src/Illuminate/Testing/Fluent/Concerns/Has.php deleted file mode 100644 index 7765f4a0..00000000 --- a/vendor/laravel/framework/src/Illuminate/Testing/Fluent/Concerns/Has.php +++ /dev/null @@ -1,213 +0,0 @@ -dotPath(); - - PHPUnit::assertCount( - $key, - $this->prop(), - $path - ? sprintf('Property [%s] does not have the expected size.', $path) - : sprintf('Root level does not have the expected size.') - ); - - return $this; - } - - PHPUnit::assertCount( - $length, - $this->prop($key), - sprintf('Property [%s] does not have the expected size.', $this->dotPath($key)) - ); - - return $this; - } - - /** - * Ensure that the given prop exists. - * - * @param string|int $key - * @param int|\Closure|null $length - * @param \Closure|null $callback - * @return $this - */ - public function has($key, $length = null, Closure $callback = null): self - { - $prop = $this->prop(); - - if (is_int($key) && is_null($length)) { - return $this->count($key); - } - - PHPUnit::assertTrue( - Arr::has($prop, $key), - sprintf('Property [%s] does not exist.', $this->dotPath($key)) - ); - - $this->interactsWith($key); - - if (! is_null($callback)) { - return $this->has($key, function (self $scope) use ($length, $callback) { - return $scope - ->tap(function (self $scope) use ($length) { - if (! is_null($length)) { - $scope->count($length); - } - }) - ->first($callback) - ->etc(); - }); - } - - if (is_callable($length)) { - return $this->scope($key, $length); - } - - if (! is_null($length)) { - return $this->count($key, $length); - } - - return $this; - } - - /** - * Assert that all of the given props exist. - * - * @param array|string $key - * @return $this - */ - public function hasAll($key): self - { - $keys = is_array($key) ? $key : func_get_args(); - - foreach ($keys as $prop => $count) { - if (is_int($prop)) { - $this->has($count); - } else { - $this->has($prop, $count); - } - } - - return $this; - } - - /** - * Assert that at least one of the given props exists. - * - * @param array|string $key - * @return $this - */ - public function hasAny($key): self - { - $keys = is_array($key) ? $key : func_get_args(); - - PHPUnit::assertTrue( - Arr::hasAny($this->prop(), $keys), - sprintf('None of properties [%s] exist.', implode(', ', $keys)) - ); - - foreach ($keys as $key) { - $this->interactsWith($key); - } - - return $this; - } - - /** - * Assert that none of the given props exist. - * - * @param array|string $key - * @return $this - */ - public function missingAll($key): self - { - $keys = is_array($key) ? $key : func_get_args(); - - foreach ($keys as $prop) { - $this->missing($prop); - } - - return $this; - } - - /** - * Assert that the given prop does not exist. - * - * @param string $key - * @return $this - */ - public function missing(string $key): self - { - PHPUnit::assertNotTrue( - Arr::has($this->prop(), $key), - sprintf('Property [%s] was found while it was expected to be missing.', $this->dotPath($key)) - ); - - return $this; - } - - /** - * Compose the absolute "dot" path to the given key. - * - * @param string $key - * @return string - */ - abstract protected function dotPath(string $key = ''): string; - - /** - * Marks the property as interacted. - * - * @param string $key - * @return void - */ - abstract protected function interactsWith(string $key): void; - - /** - * Retrieve a prop within the current scope using "dot" notation. - * - * @param string|null $key - * @return mixed - */ - abstract protected function prop(string $key = null); - - /** - * Instantiate a new "scope" at the path of the given key. - * - * @param string $key - * @param \Closure $callback - * @return $this - */ - abstract protected function scope(string $key, Closure $callback); - - /** - * Disables the interaction check. - * - * @return $this - */ - abstract public function etc(); - - /** - * Instantiate a new "scope" on the first element. - * - * @param \Closure $callback - * @return $this - */ - abstract public function first(Closure $callback); -} diff --git a/vendor/laravel/framework/src/Illuminate/Testing/Fluent/Concerns/Interaction.php b/vendor/laravel/framework/src/Illuminate/Testing/Fluent/Concerns/Interaction.php deleted file mode 100644 index 15e7e950..00000000 --- a/vendor/laravel/framework/src/Illuminate/Testing/Fluent/Concerns/Interaction.php +++ /dev/null @@ -1,67 +0,0 @@ -interacted, true)) { - $this->interacted[] = $prop; - } - } - - /** - * Asserts that all properties have been interacted with. - * - * @return void - */ - public function interacted(): void - { - PHPUnit::assertSame( - [], - array_diff(array_keys($this->prop()), $this->interacted), - $this->path - ? sprintf('Unexpected properties were found in scope [%s].', $this->path) - : 'Unexpected properties were found on the root level.' - ); - } - - /** - * Disables the interaction check. - * - * @return $this - */ - public function etc(): self - { - $this->interacted = array_keys($this->prop()); - - return $this; - } - - /** - * Retrieve a prop within the current scope using "dot" notation. - * - * @param string|null $key - * @return mixed - */ - abstract protected function prop(string $key = null); -} diff --git a/vendor/laravel/framework/src/Illuminate/Testing/Fluent/Concerns/Matching.php b/vendor/laravel/framework/src/Illuminate/Testing/Fluent/Concerns/Matching.php deleted file mode 100644 index 9ff7a318..00000000 --- a/vendor/laravel/framework/src/Illuminate/Testing/Fluent/Concerns/Matching.php +++ /dev/null @@ -1,236 +0,0 @@ -has($key); - - $actual = $this->prop($key); - - if ($expected instanceof Closure) { - PHPUnit::assertTrue( - $expected(is_array($actual) ? Collection::make($actual) : $actual), - sprintf('Property [%s] was marked as invalid using a closure.', $this->dotPath($key)) - ); - - return $this; - } - - if ($expected instanceof Arrayable) { - $expected = $expected->toArray(); - } - - $this->ensureSorted($expected); - $this->ensureSorted($actual); - - PHPUnit::assertSame( - $expected, - $actual, - sprintf('Property [%s] does not match the expected value.', $this->dotPath($key)) - ); - - return $this; - } - - /** - * Asserts that the property does not match the expected value. - * - * @param string $key - * @param mixed|\Closure $expected - * @return $this - */ - public function whereNot(string $key, $expected): self - { - $this->has($key); - - $actual = $this->prop($key); - - if ($expected instanceof Closure) { - PHPUnit::assertFalse( - $expected(is_array($actual) ? Collection::make($actual) : $actual), - sprintf('Property [%s] was marked as invalid using a closure.', $this->dotPath($key)) - ); - - return $this; - } - - if ($expected instanceof Arrayable) { - $expected = $expected->toArray(); - } - - $this->ensureSorted($expected); - $this->ensureSorted($actual); - - PHPUnit::assertNotSame( - $expected, - $actual, - sprintf( - 'Property [%s] contains a value that should be missing: [%s, %s]', - $this->dotPath($key), - $key, - $expected - ) - ); - - return $this; - } - - /** - * Asserts that all properties match their expected values. - * - * @param array $bindings - * @return $this - */ - public function whereAll(array $bindings): self - { - foreach ($bindings as $key => $value) { - $this->where($key, $value); - } - - return $this; - } - - /** - * Asserts that the property is of the expected type. - * - * @param string $key - * @param string|array $expected - * @return $this - */ - public function whereType(string $key, $expected): self - { - $this->has($key); - - $actual = $this->prop($key); - - if (! is_array($expected)) { - $expected = explode('|', $expected); - } - - PHPUnit::assertContains( - strtolower(gettype($actual)), - $expected, - sprintf('Property [%s] is not of expected type [%s].', $this->dotPath($key), implode('|', $expected)) - ); - - return $this; - } - - /** - * Asserts that all properties are of their expected types. - * - * @param array $bindings - * @return $this - */ - public function whereAllType(array $bindings): self - { - foreach ($bindings as $key => $value) { - $this->whereType($key, $value); - } - - return $this; - } - - /** - * Asserts that the property contains the expected values. - * - * @param string $key - * @param mixed $expected - * @return $this - */ - public function whereContains(string $key, $expected) - { - $actual = Collection::make( - $this->prop($key) ?? $this->prop() - ); - - $missing = Collection::make($expected)->reject(function ($search) use ($key, $actual) { - if ($actual->containsStrict($key, $search)) { - return true; - } - - return $actual->containsStrict($search); - }); - - if ($missing->whereInstanceOf('Closure')->isNotEmpty()) { - PHPUnit::assertEmpty( - $missing->toArray(), - sprintf( - 'Property [%s] does not contain a value that passes the truth test within the given closure.', - $key, - ) - ); - } else { - PHPUnit::assertEmpty( - $missing->toArray(), - sprintf( - 'Property [%s] does not contain [%s].', - $key, - implode(', ', array_values($missing->toArray())) - ) - ); - } - - return $this; - } - - /** - * Ensures that all properties are sorted the same way, recursively. - * - * @param mixed $value - * @return void - */ - protected function ensureSorted(&$value): void - { - if (! is_array($value)) { - return; - } - - foreach ($value as &$arg) { - $this->ensureSorted($arg); - } - - ksort($value); - } - - /** - * Compose the absolute "dot" path to the given key. - * - * @param string $key - * @return string - */ - abstract protected function dotPath(string $key = ''): string; - - /** - * Ensure that the given prop exists. - * - * @param string $key - * @param null $value - * @param \Closure|null $scope - * @return $this - */ - abstract public function has(string $key, $value = null, Closure $scope = null); - - /** - * Retrieve a prop within the current scope using "dot" notation. - * - * @param string|null $key - * @return mixed - */ - abstract protected function prop(string $key = null); -} diff --git a/vendor/laravel/framework/src/Illuminate/Testing/LICENSE.md b/vendor/laravel/framework/src/Illuminate/Testing/LICENSE.md deleted file mode 100644 index 79810c84..00000000 --- a/vendor/laravel/framework/src/Illuminate/Testing/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Taylor Otwell - -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/laravel/framework/src/Illuminate/Testing/LoggedExceptionCollection.php b/vendor/laravel/framework/src/Illuminate/Testing/LoggedExceptionCollection.php deleted file mode 100644 index 907b061a..00000000 --- a/vendor/laravel/framework/src/Illuminate/Testing/LoggedExceptionCollection.php +++ /dev/null @@ -1,10 +0,0 @@ -getVerbosity(), - $output->isDecorated(), - $output->getFormatter(), - ); - - $this->output = $output; - } - - /** - * Writes a message to the output. - * - * @param string|iterable $messages - * @param bool $newline - * @param int $options - * @return void - */ - public function write($messages, bool $newline = false, int $options = 0) - { - $messages = collect($messages)->filter(function ($message) { - return ! Str::contains($message, $this->ignore); - }); - - $this->output->write($messages->toArray(), $newline, $options); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Testing/ParallelRunner.php b/vendor/laravel/framework/src/Illuminate/Testing/ParallelRunner.php deleted file mode 100644 index 6eeb45c5..00000000 --- a/vendor/laravel/framework/src/Illuminate/Testing/ParallelRunner.php +++ /dev/null @@ -1,175 +0,0 @@ -options = $options; - - if ($output instanceof ConsoleOutput) { - $output = new ParallelConsoleOutput($output); - } - - $runnerResolver = static::$runnerResolver ?: function (Options $options, OutputInterface $output) { - return new WrapperRunner($options, $output); - }; - - $this->runner = $runnerResolver($options, $output); - } - - /** - * Set the application resolver callback. - * - * @param \Closure|null $resolver - * @return void - */ - public static function resolveApplicationUsing($resolver) - { - static::$applicationResolver = $resolver; - } - - /** - * Set the runner resolver callback. - * - * @param \Closure|null $resolver - * @return void - */ - public static function resolveRunnerUsing($resolver) - { - static::$runnerResolver = $resolver; - } - - /** - * Runs the test suite. - * - * @return void - */ - public function run(): void - { - (new PhpHandler)->handle($this->options->configuration()->php()); - - $this->forEachProcess(function () { - ParallelTesting::callSetUpProcessCallbacks(); - }); - - try { - $this->runner->run(); - } finally { - $this->forEachProcess(function () { - ParallelTesting::callTearDownProcessCallbacks(); - }); - } - } - - /** - * Returns the highest exit code encountered throughout the course of test execution. - * - * @return int - */ - public function getExitCode(): int - { - return $this->runner->getExitCode(); - } - - /** - * Apply the given callback for each process. - * - * @param callable $callback - * @return void - */ - protected function forEachProcess($callback) - { - collect(range(1, $this->options->processes()))->each(function ($token) use ($callback) { - tap($this->createApplication(), function ($app) use ($callback, $token) { - ParallelTesting::resolveTokenUsing(fn () => $token); - - $callback($app); - })->flush(); - }); - } - - /** - * Creates the application. - * - * @return \Illuminate\Contracts\Foundation\Application - * - * @throws \RuntimeException - */ - protected function createApplication() - { - $applicationResolver = static::$applicationResolver ?: function () { - if (trait_exists(\Tests\CreatesApplication::class)) { - $applicationCreator = new class - { - use \Tests\CreatesApplication; - }; - - return $applicationCreator->createApplication(); - } elseif (file_exists(getcwd().'/bootstrap/app.php')) { - $app = require getcwd().'/bootstrap/app.php'; - - $app->make(Kernel::class)->bootstrap(); - - return $app; - } - - throw new RuntimeException('Parallel Runner unable to resolve application.'); - }; - - return $applicationResolver(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Testing/ParallelTesting.php b/vendor/laravel/framework/src/Illuminate/Testing/ParallelTesting.php deleted file mode 100644 index e633bc57..00000000 --- a/vendor/laravel/framework/src/Illuminate/Testing/ParallelTesting.php +++ /dev/null @@ -1,291 +0,0 @@ -container = $container; - } - - /** - * Set a callback that should be used when resolving options. - * - * @param \Closure|null $resolver - * @return void - */ - public function resolveOptionsUsing($resolver) - { - $this->optionsResolver = $resolver; - } - - /** - * Set a callback that should be used when resolving the unique process token. - * - * @param \Closure|null $resolver - * @return void - */ - public function resolveTokenUsing($resolver) - { - $this->tokenResolver = $resolver; - } - - /** - * Register a "setUp" process callback. - * - * @param callable $callback - * @return void - */ - public function setUpProcess($callback) - { - $this->setUpProcessCallbacks[] = $callback; - } - - /** - * Register a "setUp" test case callback. - * - * @param callable $callback - * @return void - */ - public function setUpTestCase($callback) - { - $this->setUpTestCaseCallbacks[] = $callback; - } - - /** - * Register a "setUp" test database callback. - * - * @param callable $callback - * @return void - */ - public function setUpTestDatabase($callback) - { - $this->setUpTestDatabaseCallbacks[] = $callback; - } - - /** - * Register a "tearDown" process callback. - * - * @param callable $callback - * @return void - */ - public function tearDownProcess($callback) - { - $this->tearDownProcessCallbacks[] = $callback; - } - - /** - * Register a "tearDown" test case callback. - * - * @param callable $callback - * @return void - */ - public function tearDownTestCase($callback) - { - $this->tearDownTestCaseCallbacks[] = $callback; - } - - /** - * Call all of the "setUp" process callbacks. - * - * @return void - */ - public function callSetUpProcessCallbacks() - { - $this->whenRunningInParallel(function () { - foreach ($this->setUpProcessCallbacks as $callback) { - $this->container->call($callback, [ - 'token' => $this->token(), - ]); - } - }); - } - - /** - * Call all of the "setUp" test case callbacks. - * - * @param \Illuminate\Foundation\Testing\TestCase $testCase - * @return void - */ - public function callSetUpTestCaseCallbacks($testCase) - { - $this->whenRunningInParallel(function () use ($testCase) { - foreach ($this->setUpTestCaseCallbacks as $callback) { - $this->container->call($callback, [ - 'testCase' => $testCase, - 'token' => $this->token(), - ]); - } - }); - } - - /** - * Call all of the "setUp" test database callbacks. - * - * @param string $database - * @return void - */ - public function callSetUpTestDatabaseCallbacks($database) - { - $this->whenRunningInParallel(function () use ($database) { - foreach ($this->setUpTestDatabaseCallbacks as $callback) { - $this->container->call($callback, [ - 'database' => $database, - 'token' => $this->token(), - ]); - } - }); - } - - /** - * Call all of the "tearDown" process callbacks. - * - * @return void - */ - public function callTearDownProcessCallbacks() - { - $this->whenRunningInParallel(function () { - foreach ($this->tearDownProcessCallbacks as $callback) { - $this->container->call($callback, [ - 'token' => $this->token(), - ]); - } - }); - } - - /** - * Call all of the "tearDown" test case callbacks. - * - * @param \Illuminate\Foundation\Testing\TestCase $testCase - * @return void - */ - public function callTearDownTestCaseCallbacks($testCase) - { - $this->whenRunningInParallel(function () use ($testCase) { - foreach ($this->tearDownTestCaseCallbacks as $callback) { - $this->container->call($callback, [ - 'testCase' => $testCase, - 'token' => $this->token(), - ]); - } - }); - } - - /** - * Get a parallel testing option. - * - * @param string $option - * @return mixed - */ - public function option($option) - { - $optionsResolver = $this->optionsResolver ?: function ($option) { - $option = 'LARAVEL_PARALLEL_TESTING_'.Str::upper($option); - - return $_SERVER[$option] ?? false; - }; - - return $optionsResolver($option); - } - - /** - * Gets a unique test token. - * - * @return string|false - */ - public function token() - { - return $this->tokenResolver - ? call_user_func($this->tokenResolver) - : ($_SERVER['TEST_TOKEN'] ?? false); - } - - /** - * Apply the callback if tests are running in parallel. - * - * @param callable $callback - * @return void - */ - protected function whenRunningInParallel($callback) - { - if ($this->inParallel()) { - $callback(); - } - } - - /** - * Indicates if the current tests are been run in parallel. - * - * @return bool - */ - protected function inParallel() - { - return ! empty($_SERVER['LARAVEL_PARALLEL_TESTING']) && $this->token(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Testing/ParallelTestingServiceProvider.php b/vendor/laravel/framework/src/Illuminate/Testing/ParallelTestingServiceProvider.php deleted file mode 100644 index 20b900d2..00000000 --- a/vendor/laravel/framework/src/Illuminate/Testing/ParallelTestingServiceProvider.php +++ /dev/null @@ -1,38 +0,0 @@ -app->runningInConsole()) { - $this->bootTestDatabase(); - } - } - - /** - * Register the service provider. - * - * @return void - */ - public function register() - { - if ($this->app->runningInConsole()) { - $this->app->singleton(ParallelTesting::class, function () { - return new ParallelTesting($this->app); - }); - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Testing/PendingCommand.php b/vendor/laravel/framework/src/Illuminate/Testing/PendingCommand.php deleted file mode 100644 index 56d5fad7..00000000 --- a/vendor/laravel/framework/src/Illuminate/Testing/PendingCommand.php +++ /dev/null @@ -1,483 +0,0 @@ -app = $app; - $this->test = $test; - $this->command = $command; - $this->parameters = $parameters; - } - - /** - * Specify an expected question that will be asked when the command runs. - * - * @param string $question - * @param string|bool $answer - * @return $this - */ - public function expectsQuestion($question, $answer) - { - $this->test->expectedQuestions[] = [$question, $answer]; - - return $this; - } - - /** - * Specify an expected confirmation question that will be asked when the command runs. - * - * @param string $question - * @param string $answer - * @return $this - */ - public function expectsConfirmation($question, $answer = 'no') - { - return $this->expectsQuestion($question, strtolower($answer) === 'yes'); - } - - /** - * Specify an expected choice question with expected answers that will be asked/shown when the command runs. - * - * @param string $question - * @param string|array $answer - * @param array $answers - * @param bool $strict - * @return $this - */ - public function expectsChoice($question, $answer, $answers, $strict = false) - { - $this->test->expectedChoices[$question] = [ - 'expected' => $answers, - 'strict' => $strict, - ]; - - return $this->expectsQuestion($question, $answer); - } - - /** - * Specify output that should be printed when the command runs. - * - * @param string $output - * @return $this - */ - public function expectsOutput($output) - { - $this->test->expectedOutput[] = $output; - - return $this; - } - - /** - * Specify output that should never be printed when the command runs. - * - * @param string $output - * @return $this - */ - public function doesntExpectOutput($output) - { - $this->test->unexpectedOutput[$output] = false; - - return $this; - } - - /** - * Specify that the given string should be contained in the command output. - * - * @param string $string - * @return $this - */ - public function expectsOutputToContain($string) - { - $this->test->expectedOutputSubstrings[] = $string; - - return $this; - } - - /** - * Specify that the given string shouldn't be contained in the command output. - * - * @param string $string - * @return $this - */ - public function doesntExpectOutputToContain($string) - { - $this->test->unexpectedOutputSubstrings[$string] = false; - - return $this; - } - - /** - * Specify a table that should be printed when the command runs. - * - * @param array $headers - * @param \Illuminate\Contracts\Support\Arrayable|array $rows - * @param string $tableStyle - * @param array $columnStyles - * @return $this - */ - public function expectsTable($headers, $rows, $tableStyle = 'default', array $columnStyles = []) - { - $table = (new Table($output = new BufferedOutput)) - ->setHeaders((array) $headers) - ->setRows($rows instanceof Arrayable ? $rows->toArray() : $rows) - ->setStyle($tableStyle); - - foreach ($columnStyles as $columnIndex => $columnStyle) { - $table->setColumnStyle($columnIndex, $columnStyle); - } - - $table->render(); - - $lines = array_filter( - explode(PHP_EOL, $output->fetch()) - ); - - foreach ($lines as $line) { - $this->expectsOutput($line); - } - - return $this; - } - - /** - * Assert that the command has the given exit code. - * - * @param int $exitCode - * @return $this - */ - public function assertExitCode($exitCode) - { - $this->expectedExitCode = $exitCode; - - return $this; - } - - /** - * Assert that the command does not have the given exit code. - * - * @param int $exitCode - * @return $this - */ - public function assertNotExitCode($exitCode) - { - $this->unexpectedExitCode = $exitCode; - - return $this; - } - - /** - * Assert that the command has the success exit code. - * - * @return $this - */ - public function assertSuccessful() - { - return $this->assertExitCode(Command::SUCCESS); - } - - /** - * Assert that the command has the success exit code. - * - * @return $this - */ - public function assertOk() - { - return $this->assertSuccessful(); - } - - /** - * Assert that the command does not have the success exit code. - * - * @return $this - */ - public function assertFailed() - { - return $this->assertNotExitCode(Command::SUCCESS); - } - - /** - * Execute the command. - * - * @return int - */ - public function execute() - { - return $this->run(); - } - - /** - * Execute the command. - * - * @return int - * - * @throws \Mockery\Exception\NoMatchingExpectationException - */ - public function run() - { - $this->hasExecuted = true; - - $mock = $this->mockConsoleOutput(); - - try { - $exitCode = $this->app->make(Kernel::class)->call($this->command, $this->parameters, $mock); - } catch (NoMatchingExpectationException $e) { - if ($e->getMethodName() === 'askQuestion') { - $this->test->fail('Unexpected question "'.$e->getActualArguments()[0]->getQuestion().'" was asked.'); - } - - throw $e; - } - - if ($this->expectedExitCode !== null) { - $this->test->assertEquals( - $this->expectedExitCode, $exitCode, - "Expected status code {$this->expectedExitCode} but received {$exitCode}." - ); - } elseif (! is_null($this->unexpectedExitCode)) { - $this->test->assertNotEquals( - $this->unexpectedExitCode, $exitCode, - "Unexpected status code {$this->unexpectedExitCode} was received." - ); - } - - $this->verifyExpectations(); - $this->flushExpectations(); - - return $exitCode; - } - - /** - * Determine if expected questions / choices / outputs are fulfilled. - * - * @return void - */ - protected function verifyExpectations() - { - if (count($this->test->expectedQuestions)) { - $this->test->fail('Question "'.Arr::first($this->test->expectedQuestions)[0].'" was not asked.'); - } - - if (count($this->test->expectedChoices) > 0) { - foreach ($this->test->expectedChoices as $question => $answers) { - $assertion = $answers['strict'] ? 'assertEquals' : 'assertEqualsCanonicalizing'; - - $this->test->{$assertion}( - $answers['expected'], - $answers['actual'], - 'Question "'.$question.'" has different options.' - ); - } - } - - if (count($this->test->expectedOutput)) { - $this->test->fail('Output "'.Arr::first($this->test->expectedOutput).'" was not printed.'); - } - - if (count($this->test->expectedOutputSubstrings)) { - $this->test->fail('Output does not contain "'.Arr::first($this->test->expectedOutputSubstrings).'".'); - } - - if ($output = array_search(true, $this->test->unexpectedOutput)) { - $this->test->fail('Output "'.$output.'" was printed.'); - } - - if ($output = array_search(true, $this->test->unexpectedOutputSubstrings)) { - $this->test->fail('Output "'.$output.'" was printed.'); - } - } - - /** - * Mock the application's console output. - * - * @return \Mockery\MockInterface - */ - protected function mockConsoleOutput() - { - $mock = Mockery::mock(OutputStyle::class.'[askQuestion]', [ - new ArrayInput($this->parameters), $this->createABufferedOutputMock(), - ]); - - foreach ($this->test->expectedQuestions as $i => $question) { - $mock->shouldReceive('askQuestion') - ->once() - ->ordered() - ->with(Mockery::on(function ($argument) use ($question) { - if (isset($this->test->expectedChoices[$question[0]])) { - $this->test->expectedChoices[$question[0]]['actual'] = $argument->getAutocompleterValues(); - } - - return $argument->getQuestion() == $question[0]; - })) - ->andReturnUsing(function () use ($question, $i) { - unset($this->test->expectedQuestions[$i]); - - return $question[1]; - }); - } - - $this->app->bind(OutputStyle::class, function () use ($mock) { - return $mock; - }); - - return $mock; - } - - /** - * Create a mock for the buffered output. - * - * @return \Mockery\MockInterface - */ - private function createABufferedOutputMock() - { - $mock = Mockery::mock(BufferedOutput::class.'[doWrite]') - ->shouldAllowMockingProtectedMethods() - ->shouldIgnoreMissing(); - - foreach ($this->test->expectedOutput as $i => $output) { - $mock->shouldReceive('doWrite') - ->once() - ->ordered() - ->with($output, Mockery::any()) - ->andReturnUsing(function () use ($i) { - unset($this->test->expectedOutput[$i]); - }); - } - - foreach ($this->test->expectedOutputSubstrings as $i => $text) { - $mock->shouldReceive('doWrite') - ->atLeast() - ->times(0) - ->withArgs(fn ($output) => str_contains($output, $text)) - ->andReturnUsing(function () use ($i) { - unset($this->test->expectedOutputSubstrings[$i]); - }); - } - - foreach ($this->test->unexpectedOutput as $output => $displayed) { - $mock->shouldReceive('doWrite') - ->atLeast() - ->times(0) - ->ordered() - ->with($output, Mockery::any()) - ->andReturnUsing(function () use ($output) { - $this->test->unexpectedOutput[$output] = true; - }); - } - - foreach ($this->test->unexpectedOutputSubstrings as $text => $displayed) { - $mock->shouldReceive('doWrite') - ->atLeast() - ->times(0) - ->withArgs(fn ($output) => str_contains($output, $text)) - ->andReturnUsing(function () use ($text) { - $this->test->unexpectedOutputSubstrings[$text] = true; - }); - } - - return $mock; - } - - /** - * Flush the expectations from the test case. - * - * @return void - */ - protected function flushExpectations() - { - $this->test->expectedOutput = []; - $this->test->expectedOutputSubstrings = []; - $this->test->unexpectedOutput = []; - $this->test->unexpectedOutputSubstrings = []; - $this->test->expectedTables = []; - $this->test->expectedQuestions = []; - $this->test->expectedChoices = []; - } - - /** - * Handle the object's destruction. - * - * @return void - */ - public function __destruct() - { - if ($this->hasExecuted) { - return; - } - - $this->run(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Testing/TestComponent.php b/vendor/laravel/framework/src/Illuminate/Testing/TestComponent.php deleted file mode 100644 index 4a805514..00000000 --- a/vendor/laravel/framework/src/Illuminate/Testing/TestComponent.php +++ /dev/null @@ -1,166 +0,0 @@ -component = $component; - - $this->rendered = $view->render(); - } - - /** - * Assert that the given string is contained within the rendered component. - * - * @param string $value - * @param bool $escape - * @return $this - */ - public function assertSee($value, $escape = true) - { - $value = $escape ? e($value) : $value; - - PHPUnit::assertStringContainsString((string) $value, $this->rendered); - - return $this; - } - - /** - * Assert that the given strings are contained in order within the rendered component. - * - * @param array $values - * @param bool $escape - * @return $this - */ - public function assertSeeInOrder(array $values, $escape = true) - { - $values = $escape ? array_map('e', $values) : $values; - - PHPUnit::assertThat($values, new SeeInOrder($this->rendered)); - - return $this; - } - - /** - * Assert that the given string is contained within the rendered component text. - * - * @param string $value - * @param bool $escape - * @return $this - */ - public function assertSeeText($value, $escape = true) - { - $value = $escape ? e($value) : $value; - - PHPUnit::assertStringContainsString((string) $value, strip_tags($this->rendered)); - - return $this; - } - - /** - * Assert that the given strings are contained in order within the rendered component text. - * - * @param array $values - * @param bool $escape - * @return $this - */ - public function assertSeeTextInOrder(array $values, $escape = true) - { - $values = $escape ? array_map('e', $values) : $values; - - PHPUnit::assertThat($values, new SeeInOrder(strip_tags($this->rendered))); - - return $this; - } - - /** - * Assert that the given string is not contained within the rendered component. - * - * @param string $value - * @param bool $escape - * @return $this - */ - public function assertDontSee($value, $escape = true) - { - $value = $escape ? e($value) : $value; - - PHPUnit::assertStringNotContainsString((string) $value, $this->rendered); - - return $this; - } - - /** - * Assert that the given string is not contained within the rendered component text. - * - * @param string $value - * @param bool $escape - * @return $this - */ - public function assertDontSeeText($value, $escape = true) - { - $value = $escape ? e($value) : $value; - - PHPUnit::assertStringNotContainsString((string) $value, strip_tags($this->rendered)); - - return $this; - } - - /** - * Get the string contents of the rendered component. - * - * @return string - */ - public function __toString() - { - return $this->rendered; - } - - /** - * Dynamically access properties on the underlying component. - * - * @param string $attribute - * @return mixed - */ - public function __get($attribute) - { - return $this->component->{$attribute}; - } - - /** - * Dynamically call methods on the underlying component. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - return $this->component->{$method}(...$parameters); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Testing/TestResponse.php b/vendor/laravel/framework/src/Illuminate/Testing/TestResponse.php deleted file mode 100644 index cda2c336..00000000 --- a/vendor/laravel/framework/src/Illuminate/Testing/TestResponse.php +++ /dev/null @@ -1,1793 +0,0 @@ -baseResponse = $response; - $this->exceptions = new Collection; - } - - /** - * Create a new TestResponse from another response. - * - * @param \Illuminate\Http\Response $response - * @return static - */ - public static function fromBaseResponse($response) - { - return new static($response); - } - - /** - * Assert that the response has a successful status code. - * - * @return $this - */ - public function assertSuccessful() - { - PHPUnit::assertTrue( - $this->isSuccessful(), - $this->statusMessageWithDetails('>=200, <300', $this->getStatusCode()) - ); - - return $this; - } - - /** - * Assert that the response has a 200 status code. - * - * @return $this - */ - public function assertOk() - { - return $this->assertStatus(200); - } - - /** - * Assert that the response has a 201 status code. - * - * @return $this - */ - public function assertCreated() - { - return $this->assertStatus(201); - } - - /** - * Assert that the response has the given status code and no content. - * - * @param int $status - * @return $this - */ - public function assertNoContent($status = 204) - { - $this->assertStatus($status); - - PHPUnit::assertEmpty($this->getContent(), 'Response content is not empty.'); - - return $this; - } - - /** - * Assert that the response has a not found status code. - * - * @return $this - */ - public function assertNotFound() - { - return $this->assertStatus(404); - } - - /** - * Assert that the response has a forbidden status code. - * - * @return $this - */ - public function assertForbidden() - { - return $this->assertStatus(403); - } - - /** - * Assert that the response has an unauthorized status code. - * - * @return $this - */ - public function assertUnauthorized() - { - return $this->assertStatus(401); - } - - /** - * Assert that the response has a 422 status code. - * - * @return $this - */ - public function assertUnprocessable() - { - return $this->assertStatus(422); - } - - /** - * Assert that the response is a server error. - * - * @return $this - */ - public function assertServerError() - { - PHPUnit::assertTrue( - $this->isServerError(), - $this->statusMessageWithDetails('>=500, < 600', $this->getStatusCode()) - ); - - return $this; - } - - /** - * Assert that the response has the given status code. - * - * @param int $status - * @return $this - */ - public function assertStatus($status) - { - $message = $this->statusMessageWithDetails($status, $actual = $this->getStatusCode()); - - PHPUnit::assertSame($actual, $status, $message); - - return $this; - } - - /** - * Get an assertion message for a status assertion containing extra details when available. - * - * @param string|int $expected - * @param string|int $actual - * @return string - */ - protected function statusMessageWithDetails($expected, $actual) - { - return "Expected response status code [{$expected}] but received {$actual}."; - } - - /** - * Assert whether the response is redirecting to a given URI. - * - * @param string|null $uri - * @return $this - */ - public function assertRedirect($uri = null) - { - PHPUnit::assertTrue( - $this->isRedirect(), - $this->statusMessageWithDetails('201, 301, 302, 303, 307, 308', $this->getStatusCode()), - ); - - if (! is_null($uri)) { - $this->assertLocation($uri); - } - - return $this; - } - - /** - * Assert whether the response is redirecting to a URI that contains the given URI. - * - * @param string $uri - * @return $this - */ - public function assertRedirectContains($uri) - { - PHPUnit::assertTrue( - $this->isRedirect(), - $this->statusMessageWithDetails('201, 301, 302, 303, 307, 308', $this->getStatusCode()), - ); - - PHPUnit::assertTrue( - Str::contains($this->headers->get('Location'), $uri), 'Redirect location ['.$this->headers->get('Location').'] does not contain ['.$uri.'].' - ); - - return $this; - } - - /** - * Assert whether the response is redirecting to a given route. - * - * @param string $name - * @param mixed $parameters - * @return $this - */ - public function assertRedirectToRoute($name, $parameters = []) - { - $uri = route($name, $parameters); - - PHPUnit::assertTrue( - $this->isRedirect(), - $this->statusMessageWithDetails('201, 301, 302, 303, 307, 308', $this->getStatusCode()), - ); - - $request = Request::create($this->headers->get('Location')); - - PHPUnit::assertEquals( - app('url')->to($uri), $request->fullUrl() - ); - - return $this; - } - - /** - * Assert whether the response is redirecting to a given signed route. - * - * @param string|null $name - * @param mixed $parameters - * @return $this - */ - public function assertRedirectToSignedRoute($name = null, $parameters = []) - { - if (! is_null($name)) { - $uri = route($name, $parameters); - } - - PHPUnit::assertTrue( - $this->isRedirect(), - $this->statusMessageWithDetails('201, 301, 302, 303, 307, 308', $this->getStatusCode()), - ); - - $request = Request::create($this->headers->get('Location')); - - PHPUnit::assertTrue( - $request->hasValidSignature(), 'The response is not a redirect to a signed route.' - ); - - if (! is_null($name)) { - $expectedUri = rtrim($request->fullUrlWithQuery([ - 'signature' => null, - 'expires' => null, - ]), '?'); - - PHPUnit::assertEquals( - app('url')->to($uri), $expectedUri - ); - } - - return $this; - } - - /** - * Asserts that the response contains the given header and equals the optional value. - * - * @param string $headerName - * @param mixed $value - * @return $this - */ - public function assertHeader($headerName, $value = null) - { - PHPUnit::assertTrue( - $this->headers->has($headerName), "Header [{$headerName}] not present on response." - ); - - $actual = $this->headers->get($headerName); - - if (! is_null($value)) { - PHPUnit::assertEquals( - $value, $this->headers->get($headerName), - "Header [{$headerName}] was found, but value [{$actual}] does not match [{$value}]." - ); - } - - return $this; - } - - /** - * Asserts that the response does not contain the given header. - * - * @param string $headerName - * @return $this - */ - public function assertHeaderMissing($headerName) - { - PHPUnit::assertFalse( - $this->headers->has($headerName), "Unexpected header [{$headerName}] is present on response." - ); - - return $this; - } - - /** - * Assert that the current location header matches the given URI. - * - * @param string $uri - * @return $this - */ - public function assertLocation($uri) - { - PHPUnit::assertEquals( - app('url')->to($uri), app('url')->to($this->headers->get('Location')) - ); - - return $this; - } - - /** - * Assert that the response offers a file download. - * - * @param string|null $filename - * @return $this - */ - public function assertDownload($filename = null) - { - $contentDisposition = explode(';', $this->headers->get('content-disposition')); - - if (trim($contentDisposition[0]) !== 'attachment') { - PHPUnit::fail( - 'Response does not offer a file download.'.PHP_EOL. - 'Disposition ['.trim($contentDisposition[0]).'] found in header, [attachment] expected.' - ); - } - - if (! is_null($filename)) { - if (isset($contentDisposition[1]) && - trim(explode('=', $contentDisposition[1])[0]) !== 'filename') { - PHPUnit::fail( - 'Unsupported Content-Disposition header provided.'.PHP_EOL. - 'Disposition ['.trim(explode('=', $contentDisposition[1])[0]).'] found in header, [filename] expected.' - ); - } - - $message = "Expected file [{$filename}] is not present in Content-Disposition header."; - - if (! isset($contentDisposition[1])) { - PHPUnit::fail($message); - } else { - PHPUnit::assertSame( - $filename, - isset(explode('=', $contentDisposition[1])[1]) - ? trim(explode('=', $contentDisposition[1])[1], " \"'") - : '', - $message - ); - - return $this; - } - } else { - PHPUnit::assertTrue(true); - - return $this; - } - } - - /** - * Asserts that the response contains the given cookie and equals the optional value. - * - * @param string $cookieName - * @param mixed $value - * @return $this - */ - public function assertPlainCookie($cookieName, $value = null) - { - $this->assertCookie($cookieName, $value, false); - - return $this; - } - - /** - * Asserts that the response contains the given cookie and equals the optional value. - * - * @param string $cookieName - * @param mixed $value - * @param bool $encrypted - * @param bool $unserialize - * @return $this - */ - public function assertCookie($cookieName, $value = null, $encrypted = true, $unserialize = false) - { - PHPUnit::assertNotNull( - $cookie = $this->getCookie($cookieName, $encrypted && ! is_null($value), $unserialize), - "Cookie [{$cookieName}] not present on response." - ); - - if (! $cookie || is_null($value)) { - return $this; - } - - $cookieValue = $cookie->getValue(); - - PHPUnit::assertEquals( - $value, $cookieValue, - "Cookie [{$cookieName}] was found, but value [{$cookieValue}] does not match [{$value}]." - ); - - return $this; - } - - /** - * Asserts that the response contains the given cookie and is expired. - * - * @param string $cookieName - * @return $this - */ - public function assertCookieExpired($cookieName) - { - PHPUnit::assertNotNull( - $cookie = $this->getCookie($cookieName, false), - "Cookie [{$cookieName}] not present on response." - ); - - $expiresAt = Carbon::createFromTimestamp($cookie->getExpiresTime()); - - PHPUnit::assertTrue( - $cookie->getExpiresTime() !== 0 && $expiresAt->lessThan(Carbon::now()), - "Cookie [{$cookieName}] is not expired, it expires at [{$expiresAt}]." - ); - - return $this; - } - - /** - * Asserts that the response contains the given cookie and is not expired. - * - * @param string $cookieName - * @return $this - */ - public function assertCookieNotExpired($cookieName) - { - PHPUnit::assertNotNull( - $cookie = $this->getCookie($cookieName, false), - "Cookie [{$cookieName}] not present on response." - ); - - $expiresAt = Carbon::createFromTimestamp($cookie->getExpiresTime()); - - PHPUnit::assertTrue( - $cookie->getExpiresTime() === 0 || $expiresAt->greaterThan(Carbon::now()), - "Cookie [{$cookieName}] is expired, it expired at [{$expiresAt}]." - ); - - return $this; - } - - /** - * Asserts that the response does not contain the given cookie. - * - * @param string $cookieName - * @return $this - */ - public function assertCookieMissing($cookieName) - { - PHPUnit::assertNull( - $this->getCookie($cookieName, false), - "Cookie [{$cookieName}] is present on response." - ); - - return $this; - } - - /** - * Get the given cookie from the response. - * - * @param string $cookieName - * @param bool $decrypt - * @param bool $unserialize - * @return \Symfony\Component\HttpFoundation\Cookie|null - */ - public function getCookie($cookieName, $decrypt = true, $unserialize = false) - { - foreach ($this->headers->getCookies() as $cookie) { - if ($cookie->getName() === $cookieName) { - if (! $decrypt) { - return $cookie; - } - - $decryptedValue = CookieValuePrefix::remove( - app('encrypter')->decrypt($cookie->getValue(), $unserialize) - ); - - return new Cookie( - $cookie->getName(), - $decryptedValue, - $cookie->getExpiresTime(), - $cookie->getPath(), - $cookie->getDomain(), - $cookie->isSecure(), - $cookie->isHttpOnly(), - $cookie->isRaw(), - $cookie->getSameSite() - ); - } - } - } - - /** - * Assert that the given string matches the response content. - * - * @param string $value - * @return $this - */ - public function assertContent($value) - { - PHPUnit::assertSame($value, $this->content()); - - return $this; - } - - /** - * Assert that the given string matches the streamed response content. - * - * @param $value - * @return $this - */ - public function assertStreamedContent($value) - { - PHPUnit::assertSame($value, $this->streamedContent()); - - return $this; - } - - /** - * Assert that the given string or array of strings are contained within the response. - * - * @param string|array $value - * @param bool $escape - * @return $this - */ - public function assertSee($value, $escape = true) - { - $value = Arr::wrap($value); - - $values = $escape ? array_map('e', $value) : $value; - - foreach ($values as $value) { - PHPUnit::assertStringContainsString((string) $value, $this->getContent()); - } - - return $this; - } - - /** - * Assert that the given strings are contained in order within the response. - * - * @param array $values - * @param bool $escape - * @return $this - */ - public function assertSeeInOrder(array $values, $escape = true) - { - $values = $escape ? array_map('e', $values) : $values; - - PHPUnit::assertThat($values, new SeeInOrder($this->getContent())); - - return $this; - } - - /** - * Assert that the given string or array of strings are contained within the response text. - * - * @param string|array $value - * @param bool $escape - * @return $this - */ - public function assertSeeText($value, $escape = true) - { - $value = Arr::wrap($value); - - $values = $escape ? array_map('e', $value) : $value; - - $content = strip_tags($this->getContent()); - - foreach ($values as $value) { - PHPUnit::assertStringContainsString((string) $value, $content); - } - - return $this; - } - - /** - * Assert that the given strings are contained in order within the response text. - * - * @param array $values - * @param bool $escape - * @return $this - */ - public function assertSeeTextInOrder(array $values, $escape = true) - { - $values = $escape ? array_map('e', $values) : $values; - - PHPUnit::assertThat($values, new SeeInOrder(strip_tags($this->getContent()))); - - return $this; - } - - /** - * Assert that the given string or array of strings are not contained within the response. - * - * @param string|array $value - * @param bool $escape - * @return $this - */ - public function assertDontSee($value, $escape = true) - { - $value = Arr::wrap($value); - - $values = $escape ? array_map('e', $value) : $value; - - foreach ($values as $value) { - PHPUnit::assertStringNotContainsString((string) $value, $this->getContent()); - } - - return $this; - } - - /** - * Assert that the given string or array of strings are not contained within the response text. - * - * @param string|array $value - * @param bool $escape - * @return $this - */ - public function assertDontSeeText($value, $escape = true) - { - $value = Arr::wrap($value); - - $values = $escape ? array_map('e', $value) : $value; - - $content = strip_tags($this->getContent()); - - foreach ($values as $value) { - PHPUnit::assertStringNotContainsString((string) $value, $content); - } - - return $this; - } - - /** - * Assert that the response is a superset of the given JSON. - * - * @param array|callable $value - * @param bool $strict - * @return $this - */ - public function assertJson($value, $strict = false) - { - $json = $this->decodeResponseJson(); - - if (is_array($value)) { - $json->assertSubset($value, $strict); - } else { - $assert = AssertableJson::fromAssertableJsonString($json); - - $value($assert); - - if (Arr::isAssoc($assert->toArray())) { - $assert->interacted(); - } - } - - return $this; - } - - /** - * Assert that the expected value and type exists at the given path in the response. - * - * @param string $path - * @param mixed $expect - * @return $this - */ - public function assertJsonPath($path, $expect) - { - $this->decodeResponseJson()->assertPath($path, $expect); - - return $this; - } - - /** - * Assert that the response has the exact given JSON. - * - * @param array $data - * @return $this - */ - public function assertExactJson(array $data) - { - $this->decodeResponseJson()->assertExact($data); - - return $this; - } - - /** - * Assert that the response has the similar JSON as given. - * - * @param array $data - * @return $this - */ - public function assertSimilarJson(array $data) - { - $this->decodeResponseJson()->assertSimilar($data); - - return $this; - } - - /** - * Assert that the response contains the given JSON fragment. - * - * @param array $data - * @return $this - */ - public function assertJsonFragment(array $data) - { - $this->decodeResponseJson()->assertFragment($data); - - return $this; - } - - /** - * Assert that the response does not contain the given JSON fragment. - * - * @param array $data - * @param bool $exact - * @return $this - */ - public function assertJsonMissing(array $data, $exact = false) - { - $this->decodeResponseJson()->assertMissing($data, $exact); - - return $this; - } - - /** - * Assert that the response does not contain the exact JSON fragment. - * - * @param array $data - * @return $this - */ - public function assertJsonMissingExact(array $data) - { - $this->decodeResponseJson()->assertMissingExact($data); - - return $this; - } - - /** - * Assert that the response does not contain the given path. - * - * @param string $path - * @return $this - */ - public function assertJsonMissingPath(string $path) - { - $this->decodeResponseJson()->assertMissingPath($path); - - return $this; - } - - /** - * Assert that the response has a given JSON structure. - * - * @param array|null $structure - * @param array|null $responseData - * @return $this - */ - public function assertJsonStructure(array $structure = null, $responseData = null) - { - $this->decodeResponseJson()->assertStructure($structure, $responseData); - - return $this; - } - - /** - * Assert that the response JSON has the expected count of items at the given key. - * - * @param int $count - * @param string|null $key - * @return $this - */ - public function assertJsonCount(int $count, $key = null) - { - $this->decodeResponseJson()->assertCount($count, $key); - - return $this; - } - - /** - * Assert that the response has the given JSON validation errors. - * - * @param string|array $errors - * @param string $responseKey - * @return $this - */ - public function assertJsonValidationErrors($errors, $responseKey = 'errors') - { - $errors = Arr::wrap($errors); - - PHPUnit::assertNotEmpty($errors, 'No validation errors were provided.'); - - $jsonErrors = Arr::get($this->json(), $responseKey) ?? []; - - $errorMessage = $jsonErrors - ? 'Response has the following JSON validation errors:'. - PHP_EOL.PHP_EOL.json_encode($jsonErrors, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE).PHP_EOL - : 'Response does not have JSON validation errors.'; - - foreach ($errors as $key => $value) { - if (is_int($key)) { - $this->assertJsonValidationErrorFor($value, $responseKey); - - continue; - } - - $this->assertJsonValidationErrorFor($key, $responseKey); - - foreach (Arr::wrap($value) as $expectedMessage) { - $errorMissing = true; - - foreach (Arr::wrap($jsonErrors[$key]) as $jsonErrorMessage) { - if (Str::contains($jsonErrorMessage, $expectedMessage)) { - $errorMissing = false; - - break; - } - } - } - - if ($errorMissing) { - PHPUnit::fail( - "Failed to find a validation error in the response for key and message: '$key' => '$expectedMessage'".PHP_EOL.PHP_EOL.$errorMessage - ); - } - } - - return $this; - } - - /** - * Assert the response has any JSON validation errors for the given key. - * - * @param string $key - * @param string $responseKey - * @return $this - */ - public function assertJsonValidationErrorFor($key, $responseKey = 'errors') - { - $jsonErrors = Arr::get($this->json(), $responseKey) ?? []; - - $errorMessage = $jsonErrors - ? 'Response has the following JSON validation errors:'. - PHP_EOL.PHP_EOL.json_encode($jsonErrors, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE).PHP_EOL - : 'Response does not have JSON validation errors.'; - - PHPUnit::assertArrayHasKey( - $key, - $jsonErrors, - "Failed to find a validation error in the response for key: '{$key}'".PHP_EOL.PHP_EOL.$errorMessage - ); - - return $this; - } - - /** - * Assert that the response has no JSON validation errors for the given keys. - * - * @param string|array|null $keys - * @param string $responseKey - * @return $this - */ - public function assertJsonMissingValidationErrors($keys = null, $responseKey = 'errors') - { - if ($this->getContent() === '') { - PHPUnit::assertTrue(true); - - return $this; - } - - $json = $this->json(); - - if (! Arr::has($json, $responseKey)) { - PHPUnit::assertTrue(true); - - return $this; - } - - $errors = Arr::get($json, $responseKey, []); - - if (is_null($keys) && count($errors) > 0) { - PHPUnit::fail( - 'Response has unexpected validation errors: '.PHP_EOL.PHP_EOL. - json_encode($errors, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) - ); - } - - foreach (Arr::wrap($keys) as $key) { - PHPUnit::assertFalse( - isset($errors[$key]), - "Found unexpected validation error for key: '{$key}'" - ); - } - - return $this; - } - - /** - * Validate and return the decoded response JSON. - * - * @return \Illuminate\Testing\AssertableJsonString - * - * @throws \Throwable - */ - public function decodeResponseJson() - { - $testJson = new AssertableJsonString($this->getContent()); - - $decodedResponse = $testJson->json(); - - if (is_null($decodedResponse) || $decodedResponse === false) { - if ($this->exception) { - throw $this->exception; - } else { - PHPUnit::fail('Invalid JSON was returned from the route.'); - } - } - - return $testJson; - } - - /** - * Validate and return the decoded response JSON. - * - * @param string|null $key - * @return mixed - */ - public function json($key = null) - { - return $this->decodeResponseJson()->json($key); - } - - /** - * Get the JSON decoded body of the response as a collection. - * - * @param string|null $key - * @return \Illuminate\Support\Collection - */ - public function collect($key = null) - { - return Collection::make($this->json($key)); - } - - /** - * Assert that the response view equals the given value. - * - * @param string $value - * @return $this - */ - public function assertViewIs($value) - { - $this->ensureResponseHasView(); - - PHPUnit::assertEquals($value, $this->original->name()); - - return $this; - } - - /** - * Assert that the response view has a given piece of bound data. - * - * @param string|array $key - * @param mixed $value - * @return $this - */ - public function assertViewHas($key, $value = null) - { - if (is_array($key)) { - return $this->assertViewHasAll($key); - } - - $this->ensureResponseHasView(); - - if (is_null($value)) { - PHPUnit::assertTrue(Arr::has($this->original->gatherData(), $key)); - } elseif ($value instanceof Closure) { - PHPUnit::assertTrue($value(Arr::get($this->original->gatherData(), $key))); - } elseif ($value instanceof Model) { - PHPUnit::assertTrue($value->is(Arr::get($this->original->gatherData(), $key))); - } elseif ($value instanceof EloquentCollection) { - $actual = Arr::get($this->original->gatherData(), $key); - - PHPUnit::assertInstanceOf(EloquentCollection::class, $actual); - PHPUnit::assertSameSize($value, $actual); - - $value->each(fn ($item, $index) => PHPUnit::assertTrue($actual->get($index)->is($item))); - } else { - PHPUnit::assertEquals($value, Arr::get($this->original->gatherData(), $key)); - } - - return $this; - } - - /** - * Assert that the response view has a given list of bound data. - * - * @param array $bindings - * @return $this - */ - public function assertViewHasAll(array $bindings) - { - foreach ($bindings as $key => $value) { - if (is_int($key)) { - $this->assertViewHas($value); - } else { - $this->assertViewHas($key, $value); - } - } - - return $this; - } - - /** - * Get a piece of data from the original view. - * - * @param string $key - * @return mixed - */ - public function viewData($key) - { - $this->ensureResponseHasView(); - - return $this->original->gatherData()[$key]; - } - - /** - * Assert that the response view is missing a piece of bound data. - * - * @param string $key - * @return $this - */ - public function assertViewMissing($key) - { - $this->ensureResponseHasView(); - - PHPUnit::assertFalse(Arr::has($this->original->gatherData(), $key)); - - return $this; - } - - /** - * Ensure that the response has a view as its original content. - * - * @return $this - */ - protected function ensureResponseHasView() - { - if (! $this->responseHasView()) { - return PHPUnit::fail('The response is not a view.'); - } - - return $this; - } - - /** - * Determine if the original response is a view. - * - * @return bool - */ - protected function responseHasView() - { - return isset($this->original) && $this->original instanceof View; - } - - /** - * Assert that the given keys do not have validation errors. - * - * @param string|array|null $keys - * @param string $errorBag - * @param string $responseKey - * @return $this - */ - public function assertValid($keys = null, $errorBag = 'default', $responseKey = 'errors') - { - if ($this->baseResponse->headers->get('Content-Type') === 'application/json') { - return $this->assertJsonMissingValidationErrors($keys, $responseKey); - } - - if ($this->session()->get('errors')) { - $errors = $this->session()->get('errors')->getBag($errorBag)->getMessages(); - } else { - $errors = []; - } - - if (empty($errors)) { - PHPUnit::assertTrue(true); - - return $this; - } - - if (is_null($keys) && count($errors) > 0) { - PHPUnit::fail( - 'Response has unexpected validation errors: '.PHP_EOL.PHP_EOL. - json_encode($errors, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) - ); - } - - foreach (Arr::wrap($keys) as $key) { - PHPUnit::assertFalse( - isset($errors[$key]), - "Found unexpected validation error for key: '{$key}'" - ); - } - - return $this; - } - - /** - * Assert that the response has the given validation errors. - * - * @param string|array|null $errors - * @param string $errorBag - * @param string $responseKey - * @return $this - */ - public function assertInvalid($errors = null, - $errorBag = 'default', - $responseKey = 'errors') - { - if ($this->baseResponse->headers->get('Content-Type') === 'application/json') { - return $this->assertJsonValidationErrors($errors, $responseKey); - } - - $this->assertSessionHas('errors'); - - $sessionErrors = $this->session()->get('errors')->getBag($errorBag)->getMessages(); - - $errorMessage = $sessionErrors - ? 'Response has the following validation errors in the session:'. - PHP_EOL.PHP_EOL.json_encode($sessionErrors, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE).PHP_EOL - : 'Response does not have validation errors in the session.'; - - foreach (Arr::wrap($errors) as $key => $value) { - PHPUnit::assertArrayHasKey( - (is_int($key)) ? $value : $key, - $sessionErrors, - "Failed to find a validation error in session for key: '{$value}'".PHP_EOL.PHP_EOL.$errorMessage - ); - - if (! is_int($key)) { - $hasError = false; - - foreach (Arr::wrap($sessionErrors[$key]) as $sessionErrorMessage) { - if (Str::contains($sessionErrorMessage, $value)) { - $hasError = true; - - break; - } - } - - if (! $hasError) { - PHPUnit::fail( - "Failed to find a validation error for key and message: '$key' => '$value'".PHP_EOL.PHP_EOL.$errorMessage - ); - } - } - } - - return $this; - } - - /** - * Assert that the session has a given value. - * - * @param string|array $key - * @param mixed $value - * @return $this - */ - public function assertSessionHas($key, $value = null) - { - if (is_array($key)) { - return $this->assertSessionHasAll($key); - } - - if (is_null($value)) { - PHPUnit::assertTrue( - $this->session()->has($key), - "Session is missing expected key [{$key}]." - ); - } elseif ($value instanceof Closure) { - PHPUnit::assertTrue($value($this->session()->get($key))); - } else { - PHPUnit::assertEquals($value, $this->session()->get($key)); - } - - return $this; - } - - /** - * Assert that the session has a given list of values. - * - * @param array $bindings - * @return $this - */ - public function assertSessionHasAll(array $bindings) - { - foreach ($bindings as $key => $value) { - if (is_int($key)) { - $this->assertSessionHas($value); - } else { - $this->assertSessionHas($key, $value); - } - } - - return $this; - } - - /** - * Assert that the session has a given value in the flashed input array. - * - * @param string|array $key - * @param mixed $value - * @return $this - */ - public function assertSessionHasInput($key, $value = null) - { - if (is_array($key)) { - foreach ($key as $k => $v) { - if (is_int($k)) { - $this->assertSessionHasInput($v); - } else { - $this->assertSessionHasInput($k, $v); - } - } - - return $this; - } - - if (is_null($value)) { - PHPUnit::assertTrue( - $this->session()->hasOldInput($key), - "Session is missing expected key [{$key}]." - ); - } elseif ($value instanceof Closure) { - PHPUnit::assertTrue($value($this->session()->getOldInput($key))); - } else { - PHPUnit::assertEquals($value, $this->session()->getOldInput($key)); - } - - return $this; - } - - /** - * Assert that the session has the given errors. - * - * @param string|array $keys - * @param mixed $format - * @param string $errorBag - * @return $this - */ - public function assertSessionHasErrors($keys = [], $format = null, $errorBag = 'default') - { - $this->assertSessionHas('errors'); - - $keys = (array) $keys; - - $errors = $this->session()->get('errors')->getBag($errorBag); - - foreach ($keys as $key => $value) { - if (is_int($key)) { - PHPUnit::assertTrue($errors->has($value), "Session missing error: $value"); - } else { - PHPUnit::assertContains(is_bool($value) ? (string) $value : $value, $errors->get($key, $format)); - } - } - - return $this; - } - - /** - * Assert that the session is missing the given errors. - * - * @param string|array $keys - * @param string|null $format - * @param string $errorBag - * @return $this - */ - public function assertSessionDoesntHaveErrors($keys = [], $format = null, $errorBag = 'default') - { - $keys = (array) $keys; - - if (empty($keys)) { - return $this->assertSessionHasNoErrors(); - } - - if (is_null($this->session()->get('errors'))) { - PHPUnit::assertTrue(true); - - return $this; - } - - $errors = $this->session()->get('errors')->getBag($errorBag); - - foreach ($keys as $key => $value) { - if (is_int($key)) { - PHPUnit::assertFalse($errors->has($value), "Session has unexpected error: $value"); - } else { - PHPUnit::assertNotContains($value, $errors->get($key, $format)); - } - } - - return $this; - } - - /** - * Assert that the session has no errors. - * - * @return $this - */ - public function assertSessionHasNoErrors() - { - $hasErrors = $this->session()->has('errors'); - - PHPUnit::assertFalse( - $hasErrors, - 'Session has unexpected errors: '.PHP_EOL.PHP_EOL. - json_encode((function () use ($hasErrors) { - $errors = []; - - $sessionErrors = $this->session()->get('errors'); - - if ($hasErrors && is_a($sessionErrors, ViewErrorBag::class)) { - foreach ($sessionErrors->getBags() as $bag => $messages) { - if (is_a($messages, MessageBag::class)) { - $errors[$bag] = $messages->all(); - } - } - } - - return $errors; - })(), JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), - ); - - return $this; - } - - /** - * Assert that the session has the given errors. - * - * @param string $errorBag - * @param string|array $keys - * @param mixed $format - * @return $this - */ - public function assertSessionHasErrorsIn($errorBag, $keys = [], $format = null) - { - return $this->assertSessionHasErrors($keys, $format, $errorBag); - } - - /** - * Assert that the session does not have a given key. - * - * @param string|array $key - * @return $this - */ - public function assertSessionMissing($key) - { - if (is_array($key)) { - foreach ($key as $value) { - $this->assertSessionMissing($value); - } - } else { - PHPUnit::assertFalse( - $this->session()->has($key), - "Session has unexpected key [{$key}]." - ); - } - - return $this; - } - - /** - * Get the current session store. - * - * @return \Illuminate\Session\Store - */ - protected function session() - { - $session = app('session.store'); - - if (! $session->isStarted()) { - $session->start(); - } - - return $session; - } - - /** - * Dump the content from the response and end the script. - * - * @return never - */ - public function dd() - { - $this->dump(); - - exit(1); - } - - /** - * Dump the headers from the response and end the script. - * - * @return never - */ - public function ddHeaders() - { - $this->dumpHeaders(); - - exit(1); - } - - /** - * Dump the session from the response and end the script. - * - * @param string|array $keys - * @return never - */ - public function ddSession($keys = []) - { - $this->dumpSession($keys); - - exit(1); - } - - /** - * Dump the content from the response. - * - * @param string|null $key - * @return $this - */ - public function dump($key = null) - { - $content = $this->getContent(); - - $json = json_decode($content); - - if (json_last_error() === JSON_ERROR_NONE) { - $content = $json; - } - - if (! is_null($key)) { - dump(data_get($content, $key)); - } else { - dump($content); - } - - return $this; - } - - /** - * Dump the headers from the response. - * - * @return $this - */ - public function dumpHeaders() - { - dump($this->headers->all()); - - return $this; - } - - /** - * Dump the session from the response. - * - * @param string|array $keys - * @return $this - */ - public function dumpSession($keys = []) - { - $keys = (array) $keys; - - if (empty($keys)) { - dump($this->session()->all()); - } else { - dump($this->session()->only($keys)); - } - - return $this; - } - - /** - * Get the streamed content from the response. - * - * @return string - */ - public function streamedContent() - { - if (! is_null($this->streamedContent)) { - return $this->streamedContent; - } - - if (! $this->baseResponse instanceof StreamedResponse) { - PHPUnit::fail('The response is not a streamed response.'); - } - - ob_start(function (string $buffer): string { - $this->streamedContent .= $buffer; - - return ''; - }); - - $this->sendContent(); - - ob_end_clean(); - - return $this->streamedContent; - } - - /** - * Set the previous exceptions on the response. - * - * @param \Illuminate\Support\Collection $exceptions - * @return $this - */ - public function withExceptions(Collection $exceptions) - { - $this->exceptions = $exceptions; - - return $this; - } - - /** - * This method is called when test method did not execute successfully. - * - * @param \Throwable $exception - * @return \Throwable - */ - public function transformNotSuccessfulException($exception) - { - if (! $exception instanceof ExpectationFailedException) { - return $exception; - } - - if ($lastException = $this->exceptions->last()) { - return $this->appendExceptionToException($lastException, $exception); - } - - if ($this->baseResponse instanceof RedirectResponse) { - $session = $this->baseResponse->getSession(); - - if (! is_null($session) && $session->has('errors')) { - return $this->appendErrorsToException($session->get('errors')->all(), $exception); - } - } - - if ($this->baseResponse->headers->get('Content-Type') === 'application/json') { - $testJson = new AssertableJsonString($this->getContent()); - - if (isset($testJson['errors'])) { - return $this->appendErrorsToException($testJson->json(), $exception, true); - } - } - - return $exception; - } - - /** - * Append an exception to the message of another exception. - * - * @param \Throwable $exceptionToAppend - * @param \Throwable $exception - * @return \Throwable - */ - protected function appendExceptionToException($exceptionToAppend, $exception) - { - $exceptionMessage = $exceptionToAppend->getMessage(); - - $exceptionToAppend = (string) $exceptionToAppend; - - $message = <<<"EOF" - The following exception occurred during the last request: - - $exceptionToAppend - - ---------------------------------------------------------------------------------- - - $exceptionMessage - EOF; - - return $this->appendMessageToException($message, $exception); - } - - /** - * Append errors to an exception message. - * - * @param array $errors - * @param \Throwable $exception - * @param bool $json - * @return \Throwable - */ - protected function appendErrorsToException($errors, $exception, $json = false) - { - $errors = $json - ? json_encode($errors, JSON_PRETTY_PRINT) - : implode(PHP_EOL, Arr::flatten($errors)); - - // JSON error messages may already contain the errors, so we shouldn't duplicate them... - if (str_contains($exception->getMessage(), $errors)) { - return $exception; - } - - $message = <<<"EOF" - The following errors occurred during the last request: - - $errors - EOF; - - return $this->appendMessageToException($message, $exception); - } - - /** - * Append a message to an exception. - * - * @param string $message - * @param \Throwable $exception - * @return \Throwable - */ - protected function appendMessageToException($message, $exception) - { - $property = new ReflectionProperty($exception, 'message'); - - $property->setAccessible(true); - - $property->setValue( - $exception, - $exception->getMessage().PHP_EOL.PHP_EOL.$message.PHP_EOL - ); - - return $exception; - } - - /** - * Dynamically access base response parameters. - * - * @param string $key - * @return mixed - */ - public function __get($key) - { - return $this->baseResponse->{$key}; - } - - /** - * Proxy isset() checks to the underlying base response. - * - * @param string $key - * @return mixed - */ - public function __isset($key) - { - return isset($this->baseResponse->{$key}); - } - - /** - * Determine if the given offset exists. - * - * @param string $offset - * @return bool - */ - public function offsetExists($offset): bool - { - return $this->responseHasView() - ? isset($this->original->gatherData()[$offset]) - : isset($this->json()[$offset]); - } - - /** - * Get the value for a given offset. - * - * @param string $offset - * @return mixed - */ - public function offsetGet($offset): mixed - { - return $this->responseHasView() - ? $this->viewData($offset) - : $this->json()[$offset]; - } - - /** - * Set the value at the given offset. - * - * @param string $offset - * @param mixed $value - * @return void - * - * @throws \LogicException - */ - public function offsetSet($offset, $value): void - { - throw new LogicException('Response data may not be mutated using array access.'); - } - - /** - * Unset the value at the given offset. - * - * @param string $offset - * @return void - * - * @throws \LogicException - */ - public function offsetUnset($offset): void - { - throw new LogicException('Response data may not be mutated using array access.'); - } - - /** - * Handle dynamic calls into macros or pass missing methods to the base response. - * - * @param string $method - * @param array $args - * @return mixed - */ - public function __call($method, $args) - { - if (static::hasMacro($method)) { - return $this->macroCall($method, $args); - } - - return $this->baseResponse->{$method}(...$args); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Testing/TestView.php b/vendor/laravel/framework/src/Illuminate/Testing/TestView.php deleted file mode 100644 index 137b41e6..00000000 --- a/vendor/laravel/framework/src/Illuminate/Testing/TestView.php +++ /dev/null @@ -1,214 +0,0 @@ -view = $view; - $this->rendered = $view->render(); - } - - /** - * Assert that the response view has a given piece of bound data. - * - * @param string|array $key - * @param mixed $value - * @return $this - */ - public function assertViewHas($key, $value = null) - { - if (is_array($key)) { - return $this->assertViewHasAll($key); - } - - if (is_null($value)) { - PHPUnit::assertTrue(Arr::has($this->view->gatherData(), $key)); - } elseif ($value instanceof Closure) { - PHPUnit::assertTrue($value(Arr::get($this->view->gatherData(), $key))); - } elseif ($value instanceof Model) { - PHPUnit::assertTrue($value->is(Arr::get($this->view->gatherData(), $key))); - } elseif ($value instanceof Collection) { - $actual = Arr::get($this->view->gatherData(), $key); - - PHPUnit::assertInstanceOf(Collection::class, $actual); - PHPUnit::assertSameSize($value, $actual); - - $value->each(fn ($item, $index) => PHPUnit::assertTrue($actual->get($index)->is($item))); - } else { - PHPUnit::assertEquals($value, Arr::get($this->view->gatherData(), $key)); - } - - return $this; - } - - /** - * Assert that the response view has a given list of bound data. - * - * @param array $bindings - * @return $this - */ - public function assertViewHasAll(array $bindings) - { - foreach ($bindings as $key => $value) { - if (is_int($key)) { - $this->assertViewHas($value); - } else { - $this->assertViewHas($key, $value); - } - } - - return $this; - } - - /** - * Assert that the response view is missing a piece of bound data. - * - * @param string $key - * @return $this - */ - public function assertViewMissing($key) - { - PHPUnit::assertFalse(Arr::has($this->view->gatherData(), $key)); - - return $this; - } - - /** - * Assert that the given string is contained within the view. - * - * @param string $value - * @param bool $escape - * @return $this - */ - public function assertSee($value, $escape = true) - { - $value = $escape ? e($value) : $value; - - PHPUnit::assertStringContainsString((string) $value, $this->rendered); - - return $this; - } - - /** - * Assert that the given strings are contained in order within the view. - * - * @param array $values - * @param bool $escape - * @return $this - */ - public function assertSeeInOrder(array $values, $escape = true) - { - $values = $escape ? array_map('e', $values) : $values; - - PHPUnit::assertThat($values, new SeeInOrder($this->rendered)); - - return $this; - } - - /** - * Assert that the given string is contained within the view text. - * - * @param string $value - * @param bool $escape - * @return $this - */ - public function assertSeeText($value, $escape = true) - { - $value = $escape ? e($value) : $value; - - PHPUnit::assertStringContainsString((string) $value, strip_tags($this->rendered)); - - return $this; - } - - /** - * Assert that the given strings are contained in order within the view text. - * - * @param array $values - * @param bool $escape - * @return $this - */ - public function assertSeeTextInOrder(array $values, $escape = true) - { - $values = $escape ? array_map('e', $values) : $values; - - PHPUnit::assertThat($values, new SeeInOrder(strip_tags($this->rendered))); - - return $this; - } - - /** - * Assert that the given string is not contained within the view. - * - * @param string $value - * @param bool $escape - * @return $this - */ - public function assertDontSee($value, $escape = true) - { - $value = $escape ? e($value) : $value; - - PHPUnit::assertStringNotContainsString((string) $value, $this->rendered); - - return $this; - } - - /** - * Assert that the given string is not contained within the view text. - * - * @param string $value - * @param bool $escape - * @return $this - */ - public function assertDontSeeText($value, $escape = true) - { - $value = $escape ? e($value) : $value; - - PHPUnit::assertStringNotContainsString((string) $value, strip_tags($this->rendered)); - - return $this; - } - - /** - * Get the string contents of the rendered view. - * - * @return string - */ - public function __toString() - { - return $this->rendered; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Testing/composer.json b/vendor/laravel/framework/src/Illuminate/Testing/composer.json deleted file mode 100644 index 7fae381c..00000000 --- a/vendor/laravel/framework/src/Illuminate/Testing/composer.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "illuminate/testing", - "description": "The Illuminate Testing package.", - "license": "MIT", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "require": { - "php": "^8.0.2", - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0" - }, - "autoload": { - "psr-4": { - "Illuminate\\Testing\\": "" - } - }, - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "suggest": { - "brianium/paratest": "Required to run tests in parallel (^6.0).", - "illuminate/console": "Required to assert console commands (^9.0).", - "illuminate/database": "Required to assert databases (^9.0).", - "illuminate/http": "Required to assert responses (^9.0).", - "mockery/mockery": "Required to use mocking (^1.5.1).", - "phpunit/phpunit": "Required to use assertions and run tests (^9.5.8)." - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev" -} diff --git a/vendor/laravel/framework/src/Illuminate/Translation/ArrayLoader.php b/vendor/laravel/framework/src/Illuminate/Translation/ArrayLoader.php deleted file mode 100644 index 117e0440..00000000 --- a/vendor/laravel/framework/src/Illuminate/Translation/ArrayLoader.php +++ /dev/null @@ -1,81 +0,0 @@ -messages[$namespace][$locale][$group] ?? []; - } - - /** - * Add a new namespace to the loader. - * - * @param string $namespace - * @param string $hint - * @return void - */ - public function addNamespace($namespace, $hint) - { - // - } - - /** - * Add a new JSON path to the loader. - * - * @param string $path - * @return void - */ - public function addJsonPath($path) - { - // - } - - /** - * Add messages to the loader. - * - * @param string $locale - * @param string $group - * @param array $messages - * @param string|null $namespace - * @return $this - */ - public function addMessages($locale, $group, array $messages, $namespace = null) - { - $namespace = $namespace ?: '*'; - - $this->messages[$namespace][$locale][$group] = $messages; - - return $this; - } - - /** - * Get an array of all the registered namespaces. - * - * @return array - */ - public function namespaces() - { - return []; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Translation/FileLoader.php b/vendor/laravel/framework/src/Illuminate/Translation/FileLoader.php deleted file mode 100755 index f359a8e5..00000000 --- a/vendor/laravel/framework/src/Illuminate/Translation/FileLoader.php +++ /dev/null @@ -1,197 +0,0 @@ -path = $path; - $this->files = $files; - } - - /** - * Load the messages for the given locale. - * - * @param string $locale - * @param string $group - * @param string|null $namespace - * @return array - */ - public function load($locale, $group, $namespace = null) - { - if ($group === '*' && $namespace === '*') { - return $this->loadJsonPaths($locale); - } - - if (is_null($namespace) || $namespace === '*') { - return $this->loadPath($this->path, $locale, $group); - } - - return $this->loadNamespaced($locale, $group, $namespace); - } - - /** - * Load a namespaced translation group. - * - * @param string $locale - * @param string $group - * @param string $namespace - * @return array - */ - protected function loadNamespaced($locale, $group, $namespace) - { - if (isset($this->hints[$namespace])) { - $lines = $this->loadPath($this->hints[$namespace], $locale, $group); - - return $this->loadNamespaceOverrides($lines, $locale, $group, $namespace); - } - - return []; - } - - /** - * Load a local namespaced translation group for overrides. - * - * @param array $lines - * @param string $locale - * @param string $group - * @param string $namespace - * @return array - */ - protected function loadNamespaceOverrides(array $lines, $locale, $group, $namespace) - { - $file = "{$this->path}/vendor/{$namespace}/{$locale}/{$group}.php"; - - if ($this->files->exists($file)) { - return array_replace_recursive($lines, $this->files->getRequire($file)); - } - - return $lines; - } - - /** - * Load a locale from a given path. - * - * @param string $path - * @param string $locale - * @param string $group - * @return array - */ - protected function loadPath($path, $locale, $group) - { - if ($this->files->exists($full = "{$path}/{$locale}/{$group}.php")) { - return $this->files->getRequire($full); - } - - return []; - } - - /** - * Load a locale from the given JSON file path. - * - * @param string $locale - * @return array - * - * @throws \RuntimeException - */ - protected function loadJsonPaths($locale) - { - return collect(array_merge($this->jsonPaths, [$this->path])) - ->reduce(function ($output, $path) use ($locale) { - if ($this->files->exists($full = "{$path}/{$locale}.json")) { - $decoded = json_decode($this->files->get($full), true); - - if (is_null($decoded) || json_last_error() !== JSON_ERROR_NONE) { - throw new RuntimeException("Translation file [{$full}] contains an invalid JSON structure."); - } - - $output = array_merge($output, $decoded); - } - - return $output; - }, []); - } - - /** - * Add a new namespace to the loader. - * - * @param string $namespace - * @param string $hint - * @return void - */ - public function addNamespace($namespace, $hint) - { - $this->hints[$namespace] = $hint; - } - - /** - * Get an array of all the registered namespaces. - * - * @return array - */ - public function namespaces() - { - return $this->hints; - } - - /** - * Add a new JSON path to the loader. - * - * @param string $path - * @return void - */ - public function addJsonPath($path) - { - $this->jsonPaths[] = $path; - } - - /** - * Get an array of all the registered paths to JSON translation files. - * - * @return array - */ - public function jsonPaths() - { - return $this->jsonPaths; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Translation/LICENSE.md b/vendor/laravel/framework/src/Illuminate/Translation/LICENSE.md deleted file mode 100644 index 79810c84..00000000 --- a/vendor/laravel/framework/src/Illuminate/Translation/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Taylor Otwell - -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/laravel/framework/src/Illuminate/Translation/MessageSelector.php b/vendor/laravel/framework/src/Illuminate/Translation/MessageSelector.php deleted file mode 100755 index 37c9b31f..00000000 --- a/vendor/laravel/framework/src/Illuminate/Translation/MessageSelector.php +++ /dev/null @@ -1,410 +0,0 @@ -extract($segments, $number)) !== null) { - return trim($value); - } - - $segments = $this->stripConditions($segments); - - $pluralIndex = $this->getPluralIndex($locale, $number); - - if (count($segments) === 1 || ! isset($segments[$pluralIndex])) { - return $segments[0]; - } - - return $segments[$pluralIndex]; - } - - /** - * Extract a translation string using inline conditions. - * - * @param array $segments - * @param int $number - * @return mixed - */ - private function extract($segments, $number) - { - foreach ($segments as $part) { - if (! is_null($line = $this->extractFromString($part, $number))) { - return $line; - } - } - } - - /** - * Get the translation string if the condition matches. - * - * @param string $part - * @param int $number - * @return mixed - */ - private function extractFromString($part, $number) - { - preg_match('/^[\{\[]([^\[\]\{\}]*)[\}\]](.*)/s', $part, $matches); - - if (count($matches) !== 3) { - return null; - } - - $condition = $matches[1]; - - $value = $matches[2]; - - if (str_contains($condition, ',')) { - [$from, $to] = explode(',', $condition, 2); - - if ($to === '*' && $number >= $from) { - return $value; - } elseif ($from === '*' && $number <= $to) { - return $value; - } elseif ($number >= $from && $number <= $to) { - return $value; - } - } - - return $condition == $number ? $value : null; - } - - /** - * Strip the inline conditions from each segment, just leaving the text. - * - * @param array $segments - * @return array - */ - private function stripConditions($segments) - { - return collect($segments)->map(function ($part) { - return preg_replace('/^[\{\[]([^\[\]\{\}]*)[\}\]]/', '', $part); - })->all(); - } - - /** - * Get the index to use for pluralization. - * - * The plural rules are derived from code of the Zend Framework (2010-09-25), which - * is subject to the new BSD license (https://framework.zend.com/license) - * Copyright (c) 2005-2010 - Zend Technologies USA Inc. (http://www.zend.com) - * - * @param string $locale - * @param int $number - * @return int - */ - public function getPluralIndex($locale, $number) - { - switch ($locale) { - case 'az': - case 'az_AZ': - case 'bo': - case 'bo_CN': - case 'bo_IN': - case 'dz': - case 'dz_BT': - case 'id': - case 'id_ID': - case 'ja': - case 'ja_JP': - case 'jv': - case 'ka': - case 'ka_GE': - case 'km': - case 'km_KH': - case 'kn': - case 'kn_IN': - case 'ko': - case 'ko_KR': - case 'ms': - case 'ms_MY': - case 'th': - case 'th_TH': - case 'tr': - case 'tr_CY': - case 'tr_TR': - case 'vi': - case 'vi_VN': - case 'zh': - case 'zh_CN': - case 'zh_HK': - case 'zh_SG': - case 'zh_TW': - return 0; - case 'af': - case 'af_ZA': - case 'bn': - case 'bn_BD': - case 'bn_IN': - case 'bg': - case 'bg_BG': - case 'ca': - case 'ca_AD': - case 'ca_ES': - case 'ca_FR': - case 'ca_IT': - case 'da': - case 'da_DK': - case 'de': - case 'de_AT': - case 'de_BE': - case 'de_CH': - case 'de_DE': - case 'de_LI': - case 'de_LU': - case 'el': - case 'el_CY': - case 'el_GR': - case 'en': - case 'en_AG': - case 'en_AU': - case 'en_BW': - case 'en_CA': - case 'en_DK': - case 'en_GB': - case 'en_HK': - case 'en_IE': - case 'en_IN': - case 'en_NG': - case 'en_NZ': - case 'en_PH': - case 'en_SG': - case 'en_US': - case 'en_ZA': - case 'en_ZM': - case 'en_ZW': - case 'eo': - case 'eo_US': - case 'es': - case 'es_AR': - case 'es_BO': - case 'es_CL': - case 'es_CO': - case 'es_CR': - case 'es_CU': - case 'es_DO': - case 'es_EC': - case 'es_ES': - case 'es_GT': - case 'es_HN': - case 'es_MX': - case 'es_NI': - case 'es_PA': - case 'es_PE': - case 'es_PR': - case 'es_PY': - case 'es_SV': - case 'es_US': - case 'es_UY': - case 'es_VE': - case 'et': - case 'et_EE': - case 'eu': - case 'eu_ES': - case 'eu_FR': - case 'fa': - case 'fa_IR': - case 'fi': - case 'fi_FI': - case 'fo': - case 'fo_FO': - case 'fur': - case 'fur_IT': - case 'fy': - case 'fy_DE': - case 'fy_NL': - case 'gl': - case 'gl_ES': - case 'gu': - case 'gu_IN': - case 'ha': - case 'ha_NG': - case 'he': - case 'he_IL': - case 'hu': - case 'hu_HU': - case 'is': - case 'is_IS': - case 'it': - case 'it_CH': - case 'it_IT': - case 'ku': - case 'ku_TR': - case 'lb': - case 'lb_LU': - case 'ml': - case 'ml_IN': - case 'mn': - case 'mn_MN': - case 'mr': - case 'mr_IN': - case 'nah': - case 'nb': - case 'nb_NO': - case 'ne': - case 'ne_NP': - case 'nl': - case 'nl_AW': - case 'nl_BE': - case 'nl_NL': - case 'nn': - case 'nn_NO': - case 'no': - case 'om': - case 'om_ET': - case 'om_KE': - case 'or': - case 'or_IN': - case 'pa': - case 'pa_IN': - case 'pa_PK': - case 'pap': - case 'pap_AN': - case 'pap_AW': - case 'pap_CW': - case 'ps': - case 'ps_AF': - case 'pt': - case 'pt_BR': - case 'pt_PT': - case 'so': - case 'so_DJ': - case 'so_ET': - case 'so_KE': - case 'so_SO': - case 'sq': - case 'sq_AL': - case 'sq_MK': - case 'sv': - case 'sv_FI': - case 'sv_SE': - case 'sw': - case 'sw_KE': - case 'sw_TZ': - case 'ta': - case 'ta_IN': - case 'ta_LK': - case 'te': - case 'te_IN': - case 'tk': - case 'tk_TM': - case 'ur': - case 'ur_IN': - case 'ur_PK': - case 'zu': - case 'zu_ZA': - return ($number == 1) ? 0 : 1; - case 'am': - case 'am_ET': - case 'bh': - case 'fil': - case 'fil_PH': - case 'fr': - case 'fr_BE': - case 'fr_CA': - case 'fr_CH': - case 'fr_FR': - case 'fr_LU': - case 'gun': - case 'hi': - case 'hi_IN': - case 'hy': - case 'hy_AM': - case 'ln': - case 'ln_CD': - case 'mg': - case 'mg_MG': - case 'nso': - case 'nso_ZA': - case 'ti': - case 'ti_ER': - case 'ti_ET': - case 'wa': - case 'wa_BE': - case 'xbr': - return (($number == 0) || ($number == 1)) ? 0 : 1; - case 'be': - case 'be_BY': - case 'bs': - case 'bs_BA': - case 'hr': - case 'hr_HR': - case 'ru': - case 'ru_RU': - case 'ru_UA': - case 'sr': - case 'sr_ME': - case 'sr_RS': - case 'uk': - case 'uk_UA': - return (($number % 10 == 1) && ($number % 100 != 11)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2); - case 'cs': - case 'cs_CZ': - case 'sk': - case 'sk_SK': - return ($number == 1) ? 0 : ((($number >= 2) && ($number <= 4)) ? 1 : 2); - case 'ga': - case 'ga_IE': - return ($number == 1) ? 0 : (($number == 2) ? 1 : 2); - case 'lt': - case 'lt_LT': - return (($number % 10 == 1) && ($number % 100 != 11)) ? 0 : ((($number % 10 >= 2) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2); - case 'sl': - case 'sl_SI': - return ($number % 100 == 1) ? 0 : (($number % 100 == 2) ? 1 : ((($number % 100 == 3) || ($number % 100 == 4)) ? 2 : 3)); - case 'mk': - case 'mk_MK': - return ($number % 10 == 1) ? 0 : 1; - case 'mt': - case 'mt_MT': - return ($number == 1) ? 0 : ((($number == 0) || (($number % 100 > 1) && ($number % 100 < 11))) ? 1 : ((($number % 100 > 10) && ($number % 100 < 20)) ? 2 : 3)); - case 'lv': - case 'lv_LV': - return ($number == 0) ? 0 : ((($number % 10 == 1) && ($number % 100 != 11)) ? 1 : 2); - case 'pl': - case 'pl_PL': - return ($number == 1) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 12) || ($number % 100 > 14))) ? 1 : 2); - case 'cy': - case 'cy_GB': - return ($number == 1) ? 0 : (($number == 2) ? 1 : ((($number == 8) || ($number == 11)) ? 2 : 3)); - case 'ro': - case 'ro_RO': - return ($number == 1) ? 0 : ((($number == 0) || (($number % 100 > 0) && ($number % 100 < 20))) ? 1 : 2); - case 'ar': - case 'ar_AE': - case 'ar_BH': - case 'ar_DZ': - case 'ar_EG': - case 'ar_IN': - case 'ar_IQ': - case 'ar_JO': - case 'ar_KW': - case 'ar_LB': - case 'ar_LY': - case 'ar_MA': - case 'ar_OM': - case 'ar_QA': - case 'ar_SA': - case 'ar_SD': - case 'ar_SS': - case 'ar_SY': - case 'ar_TN': - case 'ar_YE': - return ($number == 0) ? 0 : (($number == 1) ? 1 : (($number == 2) ? 2 : ((($number % 100 >= 3) && ($number % 100 <= 10)) ? 3 : ((($number % 100 >= 11) && ($number % 100 <= 99)) ? 4 : 5)))); - default: - return 0; - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Translation/PotentiallyTranslatedString.php b/vendor/laravel/framework/src/Illuminate/Translation/PotentiallyTranslatedString.php deleted file mode 100644 index f46db352..00000000 --- a/vendor/laravel/framework/src/Illuminate/Translation/PotentiallyTranslatedString.php +++ /dev/null @@ -1,101 +0,0 @@ -string = $string; - - $this->translator = $translator; - } - - /** - * Translate the string. - * - * @param array $replace - * @param string|null $locale - * @return $this - */ - public function translate($replace = [], $locale = null) - { - $this->translation = $this->translator->get($this->string, $replace, $locale); - - return $this; - } - - /** - * Translates the string based on a count. - * - * @param \Countable|int|array $number - * @param array $replace - * @param string|null $locale - * @return $this - */ - public function translateChoice($number, array $replace = [], $locale = null) - { - $this->translation = $this->translator->choice($this->string, $number, $replace, $locale); - - return $this; - } - - /** - * Get the original string. - * - * @return string - */ - public function original() - { - return $this->string; - } - - /** - * Get the potentially translated string. - * - * @return string - */ - public function __toString() - { - return $this->translation ?? $this->string; - } - - /** - * Get the potentially translated string. - * - * @return string - */ - public function toString() - { - return (string) $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Translation/TranslationServiceProvider.php b/vendor/laravel/framework/src/Illuminate/Translation/TranslationServiceProvider.php deleted file mode 100755 index 2305535e..00000000 --- a/vendor/laravel/framework/src/Illuminate/Translation/TranslationServiceProvider.php +++ /dev/null @@ -1,56 +0,0 @@ -registerLoader(); - - $this->app->singleton('translator', function ($app) { - $loader = $app['translation.loader']; - - // When registering the translator component, we'll need to set the default - // locale as well as the fallback locale. So, we'll grab the application - // configuration so we can easily get both of these values from there. - $locale = $app->getLocale(); - - $trans = new Translator($loader, $locale); - - $trans->setFallback($app->getFallbackLocale()); - - return $trans; - }); - } - - /** - * Register the translation line loader. - * - * @return void - */ - protected function registerLoader() - { - $this->app->singleton('translation.loader', function ($app) { - return new FileLoader($app['files'], $app['path.lang']); - }); - } - - /** - * Get the services provided by the provider. - * - * @return array - */ - public function provides() - { - return ['translator', 'translation.loader']; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Translation/Translator.php b/vendor/laravel/framework/src/Illuminate/Translation/Translator.php deleted file mode 100755 index 048423f7..00000000 --- a/vendor/laravel/framework/src/Illuminate/Translation/Translator.php +++ /dev/null @@ -1,454 +0,0 @@ -loader = $loader; - - $this->setLocale($locale); - } - - /** - * Determine if a translation exists for a given locale. - * - * @param string $key - * @param string|null $locale - * @return bool - */ - public function hasForLocale($key, $locale = null) - { - return $this->has($key, $locale, false); - } - - /** - * Determine if a translation exists. - * - * @param string $key - * @param string|null $locale - * @param bool $fallback - * @return bool - */ - public function has($key, $locale = null, $fallback = true) - { - return $this->get($key, [], $locale, $fallback) !== $key; - } - - /** - * Get the translation for the given key. - * - * @param string $key - * @param array $replace - * @param string|null $locale - * @param bool $fallback - * @return string|array - */ - public function get($key, array $replace = [], $locale = null, $fallback = true) - { - $locale = $locale ?: $this->locale; - - // For JSON translations, there is only one file per locale, so we will simply load - // that file and then we will be ready to check the array for the key. These are - // only one level deep so we do not need to do any fancy searching through it. - $this->load('*', '*', $locale); - - $line = $this->loaded['*']['*'][$locale][$key] ?? null; - - // If we can't find a translation for the JSON key, we will attempt to translate it - // using the typical translation file. This way developers can always just use a - // helper such as __ instead of having to pick between trans or __ with views. - if (! isset($line)) { - [$namespace, $group, $item] = $this->parseKey($key); - - // Here we will get the locale that should be used for the language line. If one - // was not passed, we will use the default locales which was given to us when - // the translator was instantiated. Then, we can load the lines and return. - $locales = $fallback ? $this->localeArray($locale) : [$locale]; - - foreach ($locales as $locale) { - if (! is_null($line = $this->getLine( - $namespace, $group, $locale, $item, $replace - ))) { - return $line; - } - } - } - - // If the line doesn't exist, we will return back the key which was requested as - // that will be quick to spot in the UI if language keys are wrong or missing - // from the application's language files. Otherwise we can return the line. - return $this->makeReplacements($line ?: $key, $replace); - } - - /** - * Get a translation according to an integer value. - * - * @param string $key - * @param \Countable|int|array $number - * @param array $replace - * @param string|null $locale - * @return string - */ - public function choice($key, $number, array $replace = [], $locale = null) - { - $line = $this->get( - $key, $replace, $locale = $this->localeForChoice($locale) - ); - - // If the given "number" is actually an array or countable we will simply count the - // number of elements in an instance. This allows developers to pass an array of - // items without having to count it on their end first which gives bad syntax. - if (is_countable($number)) { - $number = count($number); - } - - $replace['count'] = $number; - - return $this->makeReplacements( - $this->getSelector()->choose($line, $number, $locale), $replace - ); - } - - /** - * Get the proper locale for a choice operation. - * - * @param string|null $locale - * @return string - */ - protected function localeForChoice($locale) - { - return $locale ?: $this->locale ?: $this->fallback; - } - - /** - * Retrieve a language line out the loaded array. - * - * @param string $namespace - * @param string $group - * @param string $locale - * @param string $item - * @param array $replace - * @return string|array|null - */ - protected function getLine($namespace, $group, $locale, $item, array $replace) - { - $this->load($namespace, $group, $locale); - - $line = Arr::get($this->loaded[$namespace][$group][$locale], $item); - - if (is_string($line)) { - return $this->makeReplacements($line, $replace); - } elseif (is_array($line) && count($line) > 0) { - array_walk_recursive($line, function (&$value, $key) use ($replace) { - $value = $this->makeReplacements($value, $replace); - }); - - return $line; - } - } - - /** - * Make the place-holder replacements on a line. - * - * @param string $line - * @param array $replace - * @return string - */ - protected function makeReplacements($line, array $replace) - { - if (empty($replace)) { - return $line; - } - - $shouldReplace = []; - - foreach ($replace as $key => $value) { - $shouldReplace[':'.Str::ucfirst($key ?? '')] = Str::ucfirst($value ?? ''); - $shouldReplace[':'.Str::upper($key ?? '')] = Str::upper($value ?? ''); - $shouldReplace[':'.$key] = $value; - } - - return strtr($line, $shouldReplace); - } - - /** - * Add translation lines to the given locale. - * - * @param array $lines - * @param string $locale - * @param string $namespace - * @return void - */ - public function addLines(array $lines, $locale, $namespace = '*') - { - foreach ($lines as $key => $value) { - [$group, $item] = explode('.', $key, 2); - - Arr::set($this->loaded, "$namespace.$group.$locale.$item", $value); - } - } - - /** - * Load the specified language group. - * - * @param string $namespace - * @param string $group - * @param string $locale - * @return void - */ - public function load($namespace, $group, $locale) - { - if ($this->isLoaded($namespace, $group, $locale)) { - return; - } - - // The loader is responsible for returning the array of language lines for the - // given namespace, group, and locale. We'll set the lines in this array of - // lines that have already been loaded so that we can easily access them. - $lines = $this->loader->load($locale, $group, $namespace); - - $this->loaded[$namespace][$group][$locale] = $lines; - } - - /** - * Determine if the given group has been loaded. - * - * @param string $namespace - * @param string $group - * @param string $locale - * @return bool - */ - protected function isLoaded($namespace, $group, $locale) - { - return isset($this->loaded[$namespace][$group][$locale]); - } - - /** - * Add a new namespace to the loader. - * - * @param string $namespace - * @param string $hint - * @return void - */ - public function addNamespace($namespace, $hint) - { - $this->loader->addNamespace($namespace, $hint); - } - - /** - * Add a new JSON path to the loader. - * - * @param string $path - * @return void - */ - public function addJsonPath($path) - { - $this->loader->addJsonPath($path); - } - - /** - * Parse a key into namespace, group, and item. - * - * @param string $key - * @return array - */ - public function parseKey($key) - { - $segments = parent::parseKey($key); - - if (is_null($segments[0])) { - $segments[0] = '*'; - } - - return $segments; - } - - /** - * Get the array of locales to be checked. - * - * @param string|null $locale - * @return array - */ - protected function localeArray($locale) - { - $locales = array_filter([$locale ?: $this->locale, $this->fallback]); - - return call_user_func($this->determineLocalesUsing ?: fn () => $locales, $locales); - } - - /** - * Specify a callback that should be invoked to determined the applicable locale array. - * - * @param callable $callback - * @return void - */ - public function determineLocalesUsing($callback) - { - $this->determineLocalesUsing = $callback; - } - - /** - * Get the message selector instance. - * - * @return \Illuminate\Translation\MessageSelector - */ - public function getSelector() - { - if (! isset($this->selector)) { - $this->selector = new MessageSelector; - } - - return $this->selector; - } - - /** - * Set the message selector instance. - * - * @param \Illuminate\Translation\MessageSelector $selector - * @return void - */ - public function setSelector(MessageSelector $selector) - { - $this->selector = $selector; - } - - /** - * Get the language line loader implementation. - * - * @return \Illuminate\Contracts\Translation\Loader - */ - public function getLoader() - { - return $this->loader; - } - - /** - * Get the default locale being used. - * - * @return string - */ - public function locale() - { - return $this->getLocale(); - } - - /** - * Get the default locale being used. - * - * @return string - */ - public function getLocale() - { - return $this->locale; - } - - /** - * Set the default locale. - * - * @param string $locale - * @return void - * - * @throws \InvalidArgumentException - */ - public function setLocale($locale) - { - if (Str::contains($locale, ['/', '\\'])) { - throw new InvalidArgumentException('Invalid characters present in locale.'); - } - - $this->locale = $locale; - } - - /** - * Get the fallback locale being used. - * - * @return string - */ - public function getFallback() - { - return $this->fallback; - } - - /** - * Set the fallback locale being used. - * - * @param string $fallback - * @return void - */ - public function setFallback($fallback) - { - $this->fallback = $fallback; - } - - /** - * Set the loaded translation groups. - * - * @param array $loaded - * @return void - */ - public function setLoaded(array $loaded) - { - $this->loaded = $loaded; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Translation/composer.json b/vendor/laravel/framework/src/Illuminate/Translation/composer.json deleted file mode 100755 index fc6bd262..00000000 --- a/vendor/laravel/framework/src/Illuminate/Translation/composer.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "illuminate/translation", - "description": "The Illuminate Translation package.", - "license": "MIT", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "require": { - "php": "^8.0.2", - "ext-json": "*", - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/filesystem": "^9.0", - "illuminate/support": "^9.0" - }, - "autoload": { - "psr-4": { - "Illuminate\\Translation\\": "" - } - }, - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev" -} diff --git a/vendor/laravel/framework/src/Illuminate/Validation/ClosureValidationRule.php b/vendor/laravel/framework/src/Illuminate/Validation/ClosureValidationRule.php deleted file mode 100644 index 8f247fc3..00000000 --- a/vendor/laravel/framework/src/Illuminate/Validation/ClosureValidationRule.php +++ /dev/null @@ -1,70 +0,0 @@ -callback = $callback; - } - - /** - * Determine if the validation rule passes. - * - * @param string $attribute - * @param mixed $value - * @return bool - */ - public function passes($attribute, $value) - { - $this->failed = false; - - $this->callback->__invoke($attribute, $value, function ($message) { - $this->failed = true; - - $this->message = $message; - }); - - return ! $this->failed; - } - - /** - * Get the validation error message. - * - * @return string - */ - public function message() - { - return $this->message; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Validation/Concerns/FilterEmailValidation.php b/vendor/laravel/framework/src/Illuminate/Validation/Concerns/FilterEmailValidation.php deleted file mode 100644 index 84ed212f..00000000 --- a/vendor/laravel/framework/src/Illuminate/Validation/Concerns/FilterEmailValidation.php +++ /dev/null @@ -1,72 +0,0 @@ -flags = $flags; - } - - /** - * Create a new instance which allows any unicode characters in local-part. - * - * @return static - */ - public static function unicode() - { - return new static(FILTER_FLAG_EMAIL_UNICODE); - } - - /** - * Returns true if the given email is valid. - * - * @param string $email - * @param \Egulias\EmailValidator\EmailLexer $emailLexer - * @return bool - */ - public function isValid(string $email, EmailLexer $emailLexer): bool - { - return is_null($this->flags) - ? filter_var($email, FILTER_VALIDATE_EMAIL) !== false - : filter_var($email, FILTER_VALIDATE_EMAIL, $this->flags) !== false; - } - - /** - * Returns the validation error. - * - * @return \Egulias\EmailValidator\Result\InvalidEmail|null - */ - public function getError(): ?InvalidEmail - { - return null; - } - - /** - * Returns the validation warnings. - * - * @return \Egulias\EmailValidator\Warning\Warning[] - */ - public function getWarnings(): array - { - return []; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Validation/Concerns/FormatsMessages.php b/vendor/laravel/framework/src/Illuminate/Validation/Concerns/FormatsMessages.php deleted file mode 100644 index 17d0a464..00000000 --- a/vendor/laravel/framework/src/Illuminate/Validation/Concerns/FormatsMessages.php +++ /dev/null @@ -1,520 +0,0 @@ -replacePlaceholderInString($attribute); - - $inlineMessage = $this->getInlineMessage($attribute, $rule); - - // First we will retrieve the custom message for the validation rule if one - // exists. If a custom validation message is being used we'll return the - // custom message, otherwise we'll keep searching for a valid message. - if (! is_null($inlineMessage)) { - return $inlineMessage; - } - - $lowerRule = Str::snake($rule); - - $customKey = "validation.custom.{$attribute}.{$lowerRule}"; - - $customMessage = $this->getCustomMessageFromTranslator( - in_array($rule, $this->sizeRules) - ? [$customKey.".{$this->getAttributeType($attribute)}", $customKey] - : $customKey - ); - - // First we check for a custom defined validation message for the attribute - // and rule. This allows the developer to specify specific messages for - // only some attributes and rules that need to get specially formed. - if ($customMessage !== $customKey) { - return $customMessage; - } - - // If the rule being validated is a "size" rule, we will need to gather the - // specific error message for the type of attribute being validated such - // as a number, file or string which all have different message types. - elseif (in_array($rule, $this->sizeRules)) { - return $this->getSizeMessage($attributeWithPlaceholders, $rule); - } - - // Finally, if no developer specified messages have been set, and no other - // special messages apply for this rule, we will just pull the default - // messages out of the translator service for this validation rule. - $key = "validation.{$lowerRule}"; - - if ($key !== ($value = $this->translator->get($key))) { - return $value; - } - - return $this->getFromLocalArray( - $attribute, $lowerRule, $this->fallbackMessages - ) ?: $key; - } - - /** - * Get the proper inline error message for standard and size rules. - * - * @param string $attribute - * @param string $rule - * @return string|null - */ - protected function getInlineMessage($attribute, $rule) - { - $inlineEntry = $this->getFromLocalArray($attribute, Str::snake($rule)); - - return is_array($inlineEntry) && in_array($rule, $this->sizeRules) - ? $inlineEntry[$this->getAttributeType($attribute)] - : $inlineEntry; - } - - /** - * Get the inline message for a rule if it exists. - * - * @param string $attribute - * @param string $lowerRule - * @param array|null $source - * @return string|null - */ - protected function getFromLocalArray($attribute, $lowerRule, $source = null) - { - $source = $source ?: $this->customMessages; - - $keys = ["{$attribute}.{$lowerRule}", $lowerRule, $attribute]; - - // First we will check for a custom message for an attribute specific rule - // message for the fields, then we will check for a general custom line - // that is not attribute specific. If we find either we'll return it. - foreach ($keys as $key) { - foreach (array_keys($source) as $sourceKey) { - if (str_contains($sourceKey, '*')) { - $pattern = str_replace('\*', '([^.]*)', preg_quote($sourceKey, '#')); - - if (preg_match('#^'.$pattern.'\z#u', $key) === 1) { - $message = $source[$sourceKey]; - - if (is_array($message) && isset($message[$lowerRule])) { - return $message[$lowerRule]; - } - - return $message; - } - - continue; - } - - if (Str::is($sourceKey, $key)) { - $message = $source[$sourceKey]; - - if ($sourceKey === $attribute && is_array($message) && isset($message[$lowerRule])) { - return $message[$lowerRule]; - } - - return $message; - } - } - } - } - - /** - * Get the custom error message from the translator. - * - * @param array|string $keys - * @return string - */ - protected function getCustomMessageFromTranslator($keys) - { - foreach (Arr::wrap($keys) as $key) { - if (($message = $this->translator->get($key)) !== $key) { - return $message; - } - - // If an exact match was not found for the key, we will collapse all of these - // messages and loop through them and try to find a wildcard match for the - // given key. Otherwise, we will simply return the key's value back out. - $shortKey = preg_replace( - '/^validation\.custom\./', '', $key - ); - - $message = $this->getWildcardCustomMessages(Arr::dot( - (array) $this->translator->get('validation.custom') - ), $shortKey, $key); - - if ($message !== $key) { - return $message; - } - } - - return Arr::last(Arr::wrap($keys)); - } - - /** - * Check the given messages for a wildcard key. - * - * @param array $messages - * @param string $search - * @param string $default - * @return string - */ - protected function getWildcardCustomMessages($messages, $search, $default) - { - foreach ($messages as $key => $message) { - if ($search === $key || (Str::contains($key, ['*']) && Str::is($key, $search))) { - return $message; - } - } - - return $default; - } - - /** - * Get the proper error message for an attribute and size rule. - * - * @param string $attribute - * @param string $rule - * @return string - */ - protected function getSizeMessage($attribute, $rule) - { - $lowerRule = Str::snake($rule); - - // There are three different types of size validations. The attribute may be - // either a number, file, or string so we will check a few things to know - // which type of value it is and return the correct line for that type. - $type = $this->getAttributeType($attribute); - - $key = "validation.{$lowerRule}.{$type}"; - - return $this->translator->get($key); - } - - /** - * Get the data type of the given attribute. - * - * @param string $attribute - * @return string - */ - protected function getAttributeType($attribute) - { - // We assume that the attributes present in the file array are files so that - // means that if the attribute does not have a numeric rule and the files - // list doesn't have it we'll just consider it a string by elimination. - if ($this->hasRule($attribute, $this->numericRules)) { - return 'numeric'; - } elseif ($this->hasRule($attribute, ['Array'])) { - return 'array'; - } elseif ($this->getValue($attribute) instanceof UploadedFile) { - return 'file'; - } - - return 'string'; - } - - /** - * Replace all error message place-holders with actual values. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - public function makeReplacements($message, $attribute, $rule, $parameters) - { - $message = $this->replaceAttributePlaceholder( - $message, $this->getDisplayableAttribute($attribute) - ); - - $message = $this->replaceInputPlaceholder($message, $attribute); - $message = $this->replaceIndexPlaceholder($message, $attribute); - $message = $this->replacePositionPlaceholder($message, $attribute); - - if (isset($this->replacers[Str::snake($rule)])) { - return $this->callReplacer($message, $attribute, Str::snake($rule), $parameters, $this); - } elseif (method_exists($this, $replacer = "replace{$rule}")) { - return $this->$replacer($message, $attribute, $rule, $parameters); - } - - return $message; - } - - /** - * Get the displayable name of the attribute. - * - * @param string $attribute - * @return string - */ - public function getDisplayableAttribute($attribute) - { - $primaryAttribute = $this->getPrimaryAttribute($attribute); - - $expectedAttributes = $attribute != $primaryAttribute - ? [$attribute, $primaryAttribute] : [$attribute]; - - foreach ($expectedAttributes as $name) { - // The developer may dynamically specify the array of custom attributes on this - // validator instance. If the attribute exists in this array it is used over - // the other ways of pulling the attribute name for this given attributes. - if (isset($this->customAttributes[$name])) { - return $this->customAttributes[$name]; - } - - // We allow for a developer to specify language lines for any attribute in this - // application, which allows flexibility for displaying a unique displayable - // version of the attribute name instead of the name used in an HTTP POST. - if ($line = $this->getAttributeFromTranslations($name)) { - return $line; - } - } - - // When no language line has been specified for the attribute and it is also - // an implicit attribute we will display the raw attribute's name and not - // modify it with any of these replacements before we display the name. - if (isset($this->implicitAttributes[$primaryAttribute])) { - return ($formatter = $this->implicitAttributesFormatter) - ? $formatter($attribute) - : $attribute; - } - - return str_replace('_', ' ', Str::snake($attribute)); - } - - /** - * Get the given attribute from the attribute translations. - * - * @param string $name - * @return string - */ - protected function getAttributeFromTranslations($name) - { - return Arr::get($this->translator->get('validation.attributes'), $name); - } - - /** - * Replace the :attribute placeholder in the given message. - * - * @param string $message - * @param string $value - * @return string - */ - protected function replaceAttributePlaceholder($message, $value) - { - return str_replace( - [':attribute', ':ATTRIBUTE', ':Attribute'], - [$value, Str::upper($value), Str::ucfirst($value)], - $message - ); - } - - /** - * Replace the :index placeholder in the given message. - * - * @param string $message - * @param string $attribute - * @return string - */ - protected function replaceIndexPlaceholder($message, $attribute) - { - return $this->replaceIndexOrPositionPlaceholder( - $message, $attribute, 'index' - ); - } - - /** - * Replace the :position placeholder in the given message. - * - * @param string $message - * @param string $attribute - * @return string - */ - protected function replacePositionPlaceholder($message, $attribute) - { - return $this->replaceIndexOrPositionPlaceholder( - $message, $attribute, 'position', fn ($segment) => $segment + 1 - ); - } - - /** - * Replace the :index or :position placeholder in the given message. - * - * @param string $message - * @param string $attribute - * @param string $placeholder - * @param \Closure|null $modifier - * @return string - */ - protected function replaceIndexOrPositionPlaceholder($message, $attribute, $placeholder, Closure $modifier = null) - { - $segments = explode('.', $attribute); - - $modifier ??= fn ($value) => $value; - - $numericIndex = 1; - - foreach ($segments as $segment) { - if (is_numeric($segment)) { - if ($numericIndex === 1) { - $message = str_ireplace(':'.$placeholder, $modifier((int) $segment), $message); - } - - $message = str_ireplace( - ':'.$this->numberToIndexOrPositionWord($numericIndex).'-'.$placeholder, - $modifier((int) $segment), - $message - ); - - $numericIndex++; - } - } - - return $message; - } - - /** - * Get the word for a index or position segment. - * - * @param int $value - * @return string - */ - protected function numberToIndexOrPositionWord(int $value) - { - return [ - 1 => 'first', - 2 => 'second', - 3 => 'third', - 4 => 'fourth', - 5 => 'fifth', - 6 => 'sixth', - 7 => 'seventh', - 8 => 'eighth', - 9 => 'ninth', - 10 => 'tenth', - ][(int) $value] ?? 'other'; - } - - /** - * Replace the :input placeholder in the given message. - * - * @param string $message - * @param string $attribute - * @return string - */ - protected function replaceInputPlaceholder($message, $attribute) - { - $actualValue = $this->getValue($attribute); - - if (is_scalar($actualValue) || is_null($actualValue)) { - $message = str_replace(':input', $this->getDisplayableValue($attribute, $actualValue), $message); - } - - return $message; - } - - /** - * Get the displayable name of the value. - * - * @param string $attribute - * @param mixed $value - * @return string - */ - public function getDisplayableValue($attribute, $value) - { - if (isset($this->customValues[$attribute][$value])) { - return $this->customValues[$attribute][$value]; - } - - $key = "validation.values.{$attribute}.{$value}"; - - if (($line = $this->translator->get($key)) !== $key) { - return $line; - } - - if (is_bool($value)) { - return $value ? 'true' : 'false'; - } - - if (is_null($value)) { - return 'empty'; - } - - return (string) $value; - } - - /** - * Transform an array of attributes to their displayable form. - * - * @param array $values - * @return array - */ - protected function getAttributeList(array $values) - { - $attributes = []; - - // For each attribute in the list we will simply get its displayable form as - // this is convenient when replacing lists of parameters like some of the - // replacement functions do when formatting out the validation message. - foreach ($values as $key => $value) { - $attributes[$key] = $this->getDisplayableAttribute($value); - } - - return $attributes; - } - - /** - * Call a custom validator message replacer. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @param \Illuminate\Validation\Validator $validator - * @return string|null - */ - protected function callReplacer($message, $attribute, $rule, $parameters, $validator) - { - $callback = $this->replacers[$rule]; - - if ($callback instanceof Closure) { - return $callback(...func_get_args()); - } elseif (is_string($callback)) { - return $this->callClassBasedReplacer($callback, $message, $attribute, $rule, $parameters, $validator); - } - } - - /** - * Call a class based validator message replacer. - * - * @param string $callback - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @param \Illuminate\Validation\Validator $validator - * @return string - */ - protected function callClassBasedReplacer($callback, $message, $attribute, $rule, $parameters, $validator) - { - [$class, $method] = Str::parseCallback($callback, 'replace'); - - return $this->container->make($class)->{$method}(...array_slice(func_get_args(), 1)); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Validation/Concerns/ReplacesAttributes.php b/vendor/laravel/framework/src/Illuminate/Validation/Concerns/ReplacesAttributes.php deleted file mode 100644 index b585839e..00000000 --- a/vendor/laravel/framework/src/Illuminate/Validation/Concerns/ReplacesAttributes.php +++ /dev/null @@ -1,730 +0,0 @@ - $parameters - * @return string - */ - protected function replaceAcceptedIf($message, $attribute, $rule, $parameters) - { - $parameters[1] = $this->getDisplayableValue($parameters[0], Arr::get($this->data, $parameters[0])); - - $parameters[0] = $this->getDisplayableAttribute($parameters[0]); - - return str_replace([':other', ':value'], $parameters, $message); - } - - /** - * Replace all place-holders for the declined_if rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceDeclinedIf($message, $attribute, $rule, $parameters) - { - $parameters[1] = $this->getDisplayableValue($parameters[0], Arr::get($this->data, $parameters[0])); - - $parameters[0] = $this->getDisplayableAttribute($parameters[0]); - - return str_replace([':other', ':value'], $parameters, $message); - } - - /** - * Replace all place-holders for the between rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceBetween($message, $attribute, $rule, $parameters) - { - return str_replace([':min', ':max'], $parameters, $message); - } - - /** - * Replace all place-holders for the date_format rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceDateFormat($message, $attribute, $rule, $parameters) - { - return str_replace(':format', $parameters[0], $message); - } - - /** - * Replace all place-holders for the decimal rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceDecimal($message, $attribute, $rule, $parameters) - { - return str_replace( - ':decimal', - isset($parameters[1]) - ? $parameters[0].'-'.$parameters[1] - : $parameters[0], - $message - ); - } - - /** - * Replace all place-holders for the different rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceDifferent($message, $attribute, $rule, $parameters) - { - return $this->replaceSame($message, $attribute, $rule, $parameters); - } - - /** - * Replace all place-holders for the digits rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceDigits($message, $attribute, $rule, $parameters) - { - return str_replace(':digits', $parameters[0], $message); - } - - /** - * Replace all place-holders for the digits (between) rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceDigitsBetween($message, $attribute, $rule, $parameters) - { - return $this->replaceBetween($message, $attribute, $rule, $parameters); - } - - /** - * Replace all place-holders for the min rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceMin($message, $attribute, $rule, $parameters) - { - return str_replace(':min', $parameters[0], $message); - } - - /** - * Replace all place-holders for the min digits rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceMinDigits($message, $attribute, $rule, $parameters) - { - return str_replace(':min', $parameters[0], $message); - } - - /** - * Replace all place-holders for the max rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceMax($message, $attribute, $rule, $parameters) - { - return str_replace(':max', $parameters[0], $message); - } - - /** - * Replace all place-holders for the max digits rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceMaxDigits($message, $attribute, $rule, $parameters) - { - return str_replace(':max', $parameters[0], $message); - } - - /** - * Replace all place-holders for the multiple_of rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceMultipleOf($message, $attribute, $rule, $parameters) - { - return str_replace(':value', $parameters[0] ?? '', $message); - } - - /** - * Replace all place-holders for the in rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceIn($message, $attribute, $rule, $parameters) - { - foreach ($parameters as &$parameter) { - $parameter = $this->getDisplayableValue($attribute, $parameter); - } - - return str_replace(':values', implode(', ', $parameters), $message); - } - - /** - * Replace all place-holders for the not_in rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceNotIn($message, $attribute, $rule, $parameters) - { - return $this->replaceIn($message, $attribute, $rule, $parameters); - } - - /** - * Replace all place-holders for the in_array rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceInArray($message, $attribute, $rule, $parameters) - { - return str_replace(':other', $this->getDisplayableAttribute($parameters[0]), $message); - } - - /** - * Replace all place-holders for the required_array_keys rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceRequiredArrayKeys($message, $attribute, $rule, $parameters) - { - foreach ($parameters as &$parameter) { - $parameter = $this->getDisplayableValue($attribute, $parameter); - } - - return str_replace(':values', implode(', ', $parameters), $message); - } - - /** - * Replace all place-holders for the mimetypes rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceMimetypes($message, $attribute, $rule, $parameters) - { - return str_replace(':values', implode(', ', $parameters), $message); - } - - /** - * Replace all place-holders for the mimes rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceMimes($message, $attribute, $rule, $parameters) - { - return str_replace(':values', implode(', ', $parameters), $message); - } - - /** - * Replace all place-holders for the required_with rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceRequiredWith($message, $attribute, $rule, $parameters) - { - return str_replace(':values', implode(' / ', $this->getAttributeList($parameters)), $message); - } - - /** - * Replace all place-holders for the required_with_all rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceRequiredWithAll($message, $attribute, $rule, $parameters) - { - return $this->replaceRequiredWith($message, $attribute, $rule, $parameters); - } - - /** - * Replace all place-holders for the required_without rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceRequiredWithout($message, $attribute, $rule, $parameters) - { - return $this->replaceRequiredWith($message, $attribute, $rule, $parameters); - } - - /** - * Replace all place-holders for the required_without_all rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceRequiredWithoutAll($message, $attribute, $rule, $parameters) - { - return $this->replaceRequiredWith($message, $attribute, $rule, $parameters); - } - - /** - * Replace all place-holders for the size rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceSize($message, $attribute, $rule, $parameters) - { - return str_replace(':size', $parameters[0], $message); - } - - /** - * Replace all place-holders for the gt rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceGt($message, $attribute, $rule, $parameters) - { - if (is_null($value = $this->getValue($parameters[0]))) { - return str_replace(':value', $this->getDisplayableAttribute($parameters[0]), $message); - } - - return str_replace(':value', $this->getSize($attribute, $value), $message); - } - - /** - * Replace all place-holders for the lt rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceLt($message, $attribute, $rule, $parameters) - { - if (is_null($value = $this->getValue($parameters[0]))) { - return str_replace(':value', $this->getDisplayableAttribute($parameters[0]), $message); - } - - return str_replace(':value', $this->getSize($attribute, $value), $message); - } - - /** - * Replace all place-holders for the gte rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceGte($message, $attribute, $rule, $parameters) - { - if (is_null($value = $this->getValue($parameters[0]))) { - return str_replace(':value', $this->getDisplayableAttribute($parameters[0]), $message); - } - - return str_replace(':value', $this->getSize($attribute, $value), $message); - } - - /** - * Replace all place-holders for the lte rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceLte($message, $attribute, $rule, $parameters) - { - if (is_null($value = $this->getValue($parameters[0]))) { - return str_replace(':value', $this->getDisplayableAttribute($parameters[0]), $message); - } - - return str_replace(':value', $this->getSize($attribute, $value), $message); - } - - /** - * Replace all place-holders for the required_if rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceRequiredIf($message, $attribute, $rule, $parameters) - { - $parameters[1] = $this->getDisplayableValue($parameters[0], Arr::get($this->data, $parameters[0])); - - $parameters[0] = $this->getDisplayableAttribute($parameters[0]); - - return str_replace([':other', ':value'], $parameters, $message); - } - - /** - * Replace all place-holders for the required_if_accepted rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceRequiredIfAccepted($message, $attribute, $rule, $parameters) - { - $parameters[0] = $this->getDisplayableAttribute($parameters[0]); - - return str_replace([':other'], $parameters, $message); - } - - /** - * Replace all place-holders for the required_unless rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceRequiredUnless($message, $attribute, $rule, $parameters) - { - $other = $this->getDisplayableAttribute($parameters[0]); - - $values = []; - - foreach (array_slice($parameters, 1) as $value) { - $values[] = $this->getDisplayableValue($parameters[0], $value); - } - - return str_replace([':other', ':values'], [$other, implode(', ', $values)], $message); - } - - /** - * Replace all place-holders for the prohibited_if rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceProhibitedIf($message, $attribute, $rule, $parameters) - { - $parameters[1] = $this->getDisplayableValue($parameters[0], Arr::get($this->data, $parameters[0])); - - $parameters[0] = $this->getDisplayableAttribute($parameters[0]); - - return str_replace([':other', ':value'], $parameters, $message); - } - - /** - * Replace all place-holders for the prohibited_unless rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceProhibitedUnless($message, $attribute, $rule, $parameters) - { - $other = $this->getDisplayableAttribute($parameters[0]); - - $values = []; - - foreach (array_slice($parameters, 1) as $value) { - $values[] = $this->getDisplayableValue($parameters[0], $value); - } - - return str_replace([':other', ':values'], [$other, implode(', ', $values)], $message); - } - - /** - * Replace all place-holders for the prohibited_with rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceProhibits($message, $attribute, $rule, $parameters) - { - return str_replace(':other', implode(' / ', $this->getAttributeList($parameters)), $message); - } - - /** - * Replace all place-holders for the same rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceSame($message, $attribute, $rule, $parameters) - { - return str_replace(':other', $this->getDisplayableAttribute($parameters[0]), $message); - } - - /** - * Replace all place-holders for the before rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceBefore($message, $attribute, $rule, $parameters) - { - if (! strtotime($parameters[0])) { - return str_replace(':date', $this->getDisplayableAttribute($parameters[0]), $message); - } - - return str_replace(':date', $this->getDisplayableValue($attribute, $parameters[0]), $message); - } - - /** - * Replace all place-holders for the before_or_equal rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceBeforeOrEqual($message, $attribute, $rule, $parameters) - { - return $this->replaceBefore($message, $attribute, $rule, $parameters); - } - - /** - * Replace all place-holders for the after rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceAfter($message, $attribute, $rule, $parameters) - { - return $this->replaceBefore($message, $attribute, $rule, $parameters); - } - - /** - * Replace all place-holders for the after_or_equal rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceAfterOrEqual($message, $attribute, $rule, $parameters) - { - return $this->replaceBefore($message, $attribute, $rule, $parameters); - } - - /** - * Replace all place-holders for the date_equals rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceDateEquals($message, $attribute, $rule, $parameters) - { - return $this->replaceBefore($message, $attribute, $rule, $parameters); - } - - /** - * Replace all place-holders for the dimensions rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceDimensions($message, $attribute, $rule, $parameters) - { - $parameters = $this->parseNamedParameters($parameters); - - if (is_array($parameters)) { - foreach ($parameters as $key => $value) { - $message = str_replace(':'.$key, $value, $message); - } - } - - return $message; - } - - /** - * Replace all place-holders for the ends_with rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceEndsWith($message, $attribute, $rule, $parameters) - { - foreach ($parameters as &$parameter) { - $parameter = $this->getDisplayableValue($attribute, $parameter); - } - - return str_replace(':values', implode(', ', $parameters), $message); - } - - /** - * Replace all place-holders for the doesnt_end_with rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceDoesntEndWith($message, $attribute, $rule, $parameters) - { - foreach ($parameters as &$parameter) { - $parameter = $this->getDisplayableValue($attribute, $parameter); - } - - return str_replace(':values', implode(', ', $parameters), $message); - } - - /** - * Replace all place-holders for the starts_with rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceStartsWith($message, $attribute, $rule, $parameters) - { - foreach ($parameters as &$parameter) { - $parameter = $this->getDisplayableValue($attribute, $parameter); - } - - return str_replace(':values', implode(', ', $parameters), $message); - } - - /** - * Replace all place-holders for the doesnt_start_with rule. - * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string - */ - protected function replaceDoesntStartWith($message, $attribute, $rule, $parameters) - { - foreach ($parameters as &$parameter) { - $parameter = $this->getDisplayableValue($attribute, $parameter); - } - - return str_replace(':values', implode(', ', $parameters), $message); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Validation/Concerns/ValidatesAttributes.php b/vendor/laravel/framework/src/Illuminate/Validation/Concerns/ValidatesAttributes.php deleted file mode 100644 index dc4dc56f..00000000 --- a/vendor/laravel/framework/src/Illuminate/Validation/Concerns/ValidatesAttributes.php +++ /dev/null @@ -1,2330 +0,0 @@ -validateRequired($attribute, $value) && in_array($value, $acceptable, true); - } - - /** - * Validate that an attribute was "accepted" when another attribute has a given value. - * - * @param string $attribute - * @param mixed $value - * @param mixed $parameters - * @return bool - */ - public function validateAcceptedIf($attribute, $value, $parameters) - { - $acceptable = ['yes', 'on', '1', 1, true, 'true']; - - $this->requireParameterCount(2, $parameters, 'accepted_if'); - - [$values, $other] = $this->parseDependentRuleParameters($parameters); - - if (in_array($other, $values, is_bool($other) || is_null($other))) { - return $this->validateRequired($attribute, $value) && in_array($value, $acceptable, true); - } - - return true; - } - - /** - * Validate that an attribute was "declined". - * - * This validation rule implies the attribute is "required". - * - * @param string $attribute - * @param mixed $value - * @return bool - */ - public function validateDeclined($attribute, $value) - { - $acceptable = ['no', 'off', '0', 0, false, 'false']; - - return $this->validateRequired($attribute, $value) && in_array($value, $acceptable, true); - } - - /** - * Validate that an attribute was "declined" when another attribute has a given value. - * - * @param string $attribute - * @param mixed $value - * @param mixed $parameters - * @return bool - */ - public function validateDeclinedIf($attribute, $value, $parameters) - { - $acceptable = ['no', 'off', '0', 0, false, 'false']; - - $this->requireParameterCount(2, $parameters, 'declined_if'); - - [$values, $other] = $this->parseDependentRuleParameters($parameters); - - if (in_array($other, $values, is_bool($other) || is_null($other))) { - return $this->validateRequired($attribute, $value) && in_array($value, $acceptable, true); - } - - return true; - } - - /** - * Validate that an attribute is an active URL. - * - * @param string $attribute - * @param mixed $value - * @return bool - */ - public function validateActiveUrl($attribute, $value) - { - if (! is_string($value)) { - return false; - } - - if ($url = parse_url($value, PHP_URL_HOST)) { - try { - $records = $this->getDnsRecords($url.'.', DNS_A | DNS_AAAA); - - if (is_array($records) && count($records) > 0) { - return true; - } - } catch (Exception $e) { - return false; - } - } - - return false; - } - - /** - * Get the DNS records for the given hostname. - * - * @param string $hostname - * @param int $type - * @return array|false - */ - protected function getDnsRecords($hostname, $type) - { - return dns_get_record($hostname, $type); - } - - /** - * Validate that an attribute is 7 bit ASCII. - * - * @param string $attribute - * @param mixed $value - * @return bool - */ - public function validateAscii($attribute, $value) - { - return Str::isAscii($value); - } - - /** - * "Break" on first validation fail. - * - * Always returns true, just lets us put "bail" in rules. - * - * @return bool - */ - public function validateBail() - { - return true; - } - - /** - * Validate the date is before a given date. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateBefore($attribute, $value, $parameters) - { - $this->requireParameterCount(1, $parameters, 'before'); - - return $this->compareDates($attribute, $value, $parameters, '<'); - } - - /** - * Validate the date is before or equal a given date. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateBeforeOrEqual($attribute, $value, $parameters) - { - $this->requireParameterCount(1, $parameters, 'before_or_equal'); - - return $this->compareDates($attribute, $value, $parameters, '<='); - } - - /** - * Validate the date is after a given date. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateAfter($attribute, $value, $parameters) - { - $this->requireParameterCount(1, $parameters, 'after'); - - return $this->compareDates($attribute, $value, $parameters, '>'); - } - - /** - * Validate the date is equal or after a given date. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateAfterOrEqual($attribute, $value, $parameters) - { - $this->requireParameterCount(1, $parameters, 'after_or_equal'); - - return $this->compareDates($attribute, $value, $parameters, '>='); - } - - /** - * Compare a given date against another using an operator. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @param string $operator - * @return bool - */ - protected function compareDates($attribute, $value, $parameters, $operator) - { - if (! is_string($value) && ! is_numeric($value) && ! $value instanceof DateTimeInterface) { - return false; - } - - if ($format = $this->getDateFormat($attribute)) { - return $this->checkDateTimeOrder($format, $value, $parameters[0], $operator); - } - - if (! $date = $this->getDateTimestamp($parameters[0])) { - $date = $this->getDateTimestamp($this->getValue($parameters[0])); - } - - return $this->compare($this->getDateTimestamp($value), $date, $operator); - } - - /** - * Get the date format for an attribute if it has one. - * - * @param string $attribute - * @return string|null - */ - protected function getDateFormat($attribute) - { - if ($result = $this->getRule($attribute, 'DateFormat')) { - return $result[1][0]; - } - } - - /** - * Get the date timestamp. - * - * @param mixed $value - * @return int - */ - protected function getDateTimestamp($value) - { - $date = is_null($value) ? null : $this->getDateTime($value); - - return $date ? $date->getTimestamp() : null; - } - - /** - * Given two date/time strings, check that one is after the other. - * - * @param string $format - * @param string $first - * @param string $second - * @param string $operator - * @return bool - */ - protected function checkDateTimeOrder($format, $first, $second, $operator) - { - $firstDate = $this->getDateTimeWithOptionalFormat($format, $first); - - if (! $secondDate = $this->getDateTimeWithOptionalFormat($format, $second)) { - if (is_null($second = $this->getValue($second))) { - return true; - } - - $secondDate = $this->getDateTimeWithOptionalFormat($format, $second); - } - - return ($firstDate && $secondDate) && $this->compare($firstDate, $secondDate, $operator); - } - - /** - * Get a DateTime instance from a string. - * - * @param string $format - * @param string $value - * @return \DateTime|null - */ - protected function getDateTimeWithOptionalFormat($format, $value) - { - if ($date = DateTime::createFromFormat('!'.$format, $value)) { - return $date; - } - - return $this->getDateTime($value); - } - - /** - * Get a DateTime instance from a string with no format. - * - * @param string $value - * @return \DateTime|null - */ - protected function getDateTime($value) - { - try { - return @Date::parse($value) ?: null; - } catch (Exception $e) { - // - } - } - - /** - * Validate that an attribute contains only alphabetic characters. - * - * @param string $attribute - * @param mixed $value - * @return bool - */ - public function validateAlpha($attribute, $value) - { - return is_string($value) && preg_match('/^[\pL\pM]+$/u', $value); - } - - /** - * Validate that an attribute contains only alpha-numeric characters, dashes, and underscores. - * - * @param string $attribute - * @param mixed $value - * @return bool - */ - public function validateAlphaDash($attribute, $value) - { - if (! is_string($value) && ! is_numeric($value)) { - return false; - } - - return preg_match('/^[\pL\pM\pN_-]+$/u', $value) > 0; - } - - /** - * Validate that an attribute contains only alpha-numeric characters. - * - * @param string $attribute - * @param mixed $value - * @return bool - */ - public function validateAlphaNum($attribute, $value) - { - if (! is_string($value) && ! is_numeric($value)) { - return false; - } - - return preg_match('/^[\pL\pM\pN]+$/u', $value) > 0; - } - - /** - * Validate that an attribute is an array. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateArray($attribute, $value, $parameters = []) - { - if (! is_array($value)) { - return false; - } - - if (empty($parameters)) { - return true; - } - - return empty(array_diff_key($value, array_fill_keys($parameters, ''))); - } - - /** - * Validate that an array has all of the given keys. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateRequiredArrayKeys($attribute, $value, $parameters) - { - if (! is_array($value)) { - return false; - } - - foreach ($parameters as $param) { - if (! Arr::exists($value, $param)) { - return false; - } - } - - return true; - } - - /** - * Validate the size of an attribute is between a set of values. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateBetween($attribute, $value, $parameters) - { - $this->requireParameterCount(2, $parameters, 'between'); - - $size = $this->getSize($attribute, $value); - - return $size >= $parameters[0] && $size <= $parameters[1]; - } - - /** - * Validate that an attribute is a boolean. - * - * @param string $attribute - * @param mixed $value - * @return bool - */ - public function validateBoolean($attribute, $value) - { - $acceptable = [true, false, 0, 1, '0', '1']; - - return in_array($value, $acceptable, true); - } - - /** - * Validate that an attribute has a matching confirmation. - * - * @param string $attribute - * @param mixed $value - * @return bool - */ - public function validateConfirmed($attribute, $value) - { - return $this->validateSame($attribute, $value, [$attribute.'_confirmation']); - } - - /** - * Validate that the password of the currently authenticated user matches the given value. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - protected function validateCurrentPassword($attribute, $value, $parameters) - { - $auth = $this->container->make('auth'); - $hasher = $this->container->make('hash'); - - $guard = $auth->guard(Arr::first($parameters)); - - if ($guard->guest()) { - return false; - } - - return $hasher->check($value, $guard->user()->getAuthPassword()); - } - - /** - * Validate that an attribute is a valid date. - * - * @param string $attribute - * @param mixed $value - * @return bool - */ - public function validateDate($attribute, $value) - { - if ($value instanceof DateTimeInterface) { - return true; - } - - try { - if ((! is_string($value) && ! is_numeric($value)) || strtotime($value) === false) { - return false; - } - } catch (Exception $e) { - return false; - } - - $date = date_parse($value); - - return checkdate($date['month'], $date['day'], $date['year']); - } - - /** - * Validate that an attribute matches a date format. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateDateFormat($attribute, $value, $parameters) - { - $this->requireParameterCount(1, $parameters, 'date_format'); - - if (! is_string($value) && ! is_numeric($value)) { - return false; - } - - foreach ($parameters as $format) { - $date = DateTime::createFromFormat('!'.$format, $value); - - if ($date && $date->format($format) == $value) { - return true; - } - } - - return false; - } - - /** - * Validate that an attribute is equal to another date. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateDateEquals($attribute, $value, $parameters) - { - $this->requireParameterCount(1, $parameters, 'date_equals'); - - return $this->compareDates($attribute, $value, $parameters, '='); - } - - /** - * Validate that an attribute has a given number of decimal places. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateDecimal($attribute, $value, $parameters) - { - if (! $this->validateNumeric($attribute, $value)) { - return false; - } - - $this->requireParameterCount(1, $parameters, 'decimal'); - - $matches = []; - - preg_match('/^\d*.(\d*)$/', $value, $matches); - - $decimals = strlen(end($matches)); - - if (! isset($parameters[1])) { - return $decimals == $parameters[0]; - } - - return $decimals >= $parameters[0] && - $decimals <= $parameters[1]; - } - - /** - * Validate that an attribute is different from another attribute. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateDifferent($attribute, $value, $parameters) - { - $this->requireParameterCount(1, $parameters, 'different'); - - foreach ($parameters as $parameter) { - if (Arr::has($this->data, $parameter)) { - $other = Arr::get($this->data, $parameter); - - if ($value === $other) { - return false; - } - } - } - - return true; - } - - /** - * Validate that an attribute has a given number of digits. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateDigits($attribute, $value, $parameters) - { - $this->requireParameterCount(1, $parameters, 'digits'); - - return ! preg_match('/[^0-9]/', $value) - && strlen((string) $value) == $parameters[0]; - } - - /** - * Validate that an attribute is between a given number of digits. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateDigitsBetween($attribute, $value, $parameters) - { - $this->requireParameterCount(2, $parameters, 'digits_between'); - - $length = strlen((string) $value); - - return ! preg_match('/[^0-9]/', $value) - && $length >= $parameters[0] && $length <= $parameters[1]; - } - - /** - * Validate the dimensions of an image matches the given values. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateDimensions($attribute, $value, $parameters) - { - if ($this->isValidFileInstance($value) && in_array($value->getMimeType(), ['image/svg+xml', 'image/svg'])) { - return true; - } - - if (! $this->isValidFileInstance($value) || ! $sizeDetails = @getimagesize($value->getRealPath())) { - return false; - } - - $this->requireParameterCount(1, $parameters, 'dimensions'); - - [$width, $height] = $sizeDetails; - - $parameters = $this->parseNamedParameters($parameters); - - if ($this->failsBasicDimensionChecks($parameters, $width, $height) || - $this->failsRatioCheck($parameters, $width, $height)) { - return false; - } - - return true; - } - - /** - * Test if the given width and height fail any conditions. - * - * @param array $parameters - * @param int $width - * @param int $height - * @return bool - */ - protected function failsBasicDimensionChecks($parameters, $width, $height) - { - return (isset($parameters['width']) && $parameters['width'] != $width) || - (isset($parameters['min_width']) && $parameters['min_width'] > $width) || - (isset($parameters['max_width']) && $parameters['max_width'] < $width) || - (isset($parameters['height']) && $parameters['height'] != $height) || - (isset($parameters['min_height']) && $parameters['min_height'] > $height) || - (isset($parameters['max_height']) && $parameters['max_height'] < $height); - } - - /** - * Determine if the given parameters fail a dimension ratio check. - * - * @param array $parameters - * @param int $width - * @param int $height - * @return bool - */ - protected function failsRatioCheck($parameters, $width, $height) - { - if (! isset($parameters['ratio'])) { - return false; - } - - [$numerator, $denominator] = array_replace( - [1, 1], array_filter(sscanf($parameters['ratio'], '%f/%d')) - ); - - $precision = 1 / (max($width, $height) + 1); - - return abs($numerator / $denominator - $width / $height) > $precision; - } - - /** - * Validate an attribute is unique among other values. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateDistinct($attribute, $value, $parameters) - { - $data = Arr::except($this->getDistinctValues($attribute), $attribute); - - if (in_array('ignore_case', $parameters)) { - return empty(preg_grep('/^'.preg_quote($value, '/').'$/iu', $data)); - } - - return ! in_array($value, array_values($data), in_array('strict', $parameters)); - } - - /** - * Get the values to distinct between. - * - * @param string $attribute - * @return array - */ - protected function getDistinctValues($attribute) - { - $attributeName = $this->getPrimaryAttribute($attribute); - - if (! property_exists($this, 'distinctValues')) { - return $this->extractDistinctValues($attributeName); - } - - if (! array_key_exists($attributeName, $this->distinctValues)) { - $this->distinctValues[$attributeName] = $this->extractDistinctValues($attributeName); - } - - return $this->distinctValues[$attributeName]; - } - - /** - * Extract the distinct values from the data. - * - * @param string $attribute - * @return array - */ - protected function extractDistinctValues($attribute) - { - $attributeData = ValidationData::extractDataFromPath( - ValidationData::getLeadingExplicitAttributePath($attribute), $this->data - ); - - $pattern = str_replace('\*', '[^.]+', preg_quote($attribute, '#')); - - return Arr::where(Arr::dot($attributeData), function ($value, $key) use ($pattern) { - return (bool) preg_match('#^'.$pattern.'\z#u', $key); - }); - } - - /** - * Validate that an attribute is a valid e-mail address. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateEmail($attribute, $value, $parameters) - { - if (! is_string($value) && ! (is_object($value) && method_exists($value, '__toString'))) { - return false; - } - - $validations = collect($parameters) - ->unique() - ->map(fn ($validation) => match (true) { - $validation === 'strict' => new NoRFCWarningsValidation(), - $validation === 'dns' => new DNSCheckValidation(), - $validation === 'spoof' => new SpoofCheckValidation(), - $validation === 'filter' => new FilterEmailValidation(), - $validation === 'filter_unicode' => FilterEmailValidation::unicode(), - is_string($validation) && class_exists($validation) => $this->container->make($validation), - default => new RFCValidation(), - }) - ->values() - ->all() ?: [new RFCValidation]; - - return (new EmailValidator)->isValid($value, new MultipleValidationWithAnd($validations)); - } - - /** - * Validate the existence of an attribute value in a database table. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateExists($attribute, $value, $parameters) - { - $this->requireParameterCount(1, $parameters, 'exists'); - - [$connection, $table] = $this->parseTable($parameters[0]); - - // The second parameter position holds the name of the column that should be - // verified as existing. If this parameter is not specified we will guess - // that the columns being "verified" shares the given attribute's name. - $column = $this->getQueryColumn($parameters, $attribute); - - $expected = is_array($value) ? count(array_unique($value)) : 1; - - return $this->getExistCount( - $connection, $table, $column, $value, $parameters - ) >= $expected; - } - - /** - * Get the number of records that exist in storage. - * - * @param mixed $connection - * @param string $table - * @param string $column - * @param mixed $value - * @param array $parameters - * @return int - */ - protected function getExistCount($connection, $table, $column, $value, $parameters) - { - $verifier = $this->getPresenceVerifier($connection); - - $extra = $this->getExtraConditions( - array_values(array_slice($parameters, 2)) - ); - - if ($this->currentRule instanceof Exists) { - $extra = array_merge($extra, $this->currentRule->queryCallbacks()); - } - - return is_array($value) - ? $verifier->getMultiCount($table, $column, $value, $extra) - : $verifier->getCount($table, $column, $value, null, null, $extra); - } - - /** - * Validate the uniqueness of an attribute value on a given database table. - * - * If a database column is not specified, the attribute will be used. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateUnique($attribute, $value, $parameters) - { - $this->requireParameterCount(1, $parameters, 'unique'); - - [$connection, $table, $idColumn] = $this->parseTable($parameters[0]); - - // The second parameter position holds the name of the column that needs to - // be verified as unique. If this parameter isn't specified we will just - // assume that this column to be verified shares the attribute's name. - $column = $this->getQueryColumn($parameters, $attribute); - - $id = null; - - if (isset($parameters[2])) { - [$idColumn, $id] = $this->getUniqueIds($idColumn, $parameters); - - if (! is_null($id)) { - $id = stripslashes($id); - } - } - - // The presence verifier is responsible for counting rows within this store - // mechanism which might be a relational database or any other permanent - // data store like Redis, etc. We will use it to determine uniqueness. - $verifier = $this->getPresenceVerifier($connection); - - $extra = $this->getUniqueExtra($parameters); - - if ($this->currentRule instanceof Unique) { - $extra = array_merge($extra, $this->currentRule->queryCallbacks()); - } - - return $verifier->getCount( - $table, $column, $value, $id, $idColumn, $extra - ) == 0; - } - - /** - * Get the excluded ID column and value for the unique rule. - * - * @param string|null $idColumn - * @param array $parameters - * @return array - */ - protected function getUniqueIds($idColumn, $parameters) - { - $idColumn ??= $parameters[3] ?? 'id'; - - return [$idColumn, $this->prepareUniqueId($parameters[2])]; - } - - /** - * Prepare the given ID for querying. - * - * @param mixed $id - * @return int - */ - protected function prepareUniqueId($id) - { - if (preg_match('/\[(.*)\]/', $id, $matches)) { - $id = $this->getValue($matches[1]); - } - - if (strtolower($id) === 'null') { - $id = null; - } - - if (filter_var($id, FILTER_VALIDATE_INT) !== false) { - $id = (int) $id; - } - - return $id; - } - - /** - * Get the extra conditions for a unique rule. - * - * @param array $parameters - * @return array - */ - protected function getUniqueExtra($parameters) - { - if (isset($parameters[4])) { - return $this->getExtraConditions(array_slice($parameters, 4)); - } - - return []; - } - - /** - * Parse the connection / table for the unique / exists rules. - * - * @param string $table - * @return array - */ - public function parseTable($table) - { - [$connection, $table] = str_contains($table, '.') ? explode('.', $table, 2) : [null, $table]; - - if (str_contains($table, '\\') && class_exists($table) && is_a($table, Model::class, true)) { - $model = new $table; - - $table = $model->getTable(); - $connection ??= $model->getConnectionName(); - - if (str_contains($table, '.') && Str::startsWith($table, $connection)) { - $connection = null; - } - - $idColumn = $model->getKeyName(); - } - - return [$connection, $table, $idColumn ?? null]; - } - - /** - * Get the column name for an exists / unique query. - * - * @param array $parameters - * @param string $attribute - * @return bool - */ - public function getQueryColumn($parameters, $attribute) - { - return isset($parameters[1]) && $parameters[1] !== 'NULL' - ? $parameters[1] : $this->guessColumnForQuery($attribute); - } - - /** - * Guess the database column from the given attribute name. - * - * @param string $attribute - * @return string - */ - public function guessColumnForQuery($attribute) - { - if (in_array($attribute, Arr::collapse($this->implicitAttributes)) - && ! is_numeric($last = last(explode('.', $attribute)))) { - return $last; - } - - return $attribute; - } - - /** - * Get the extra conditions for a unique / exists rule. - * - * @param array $segments - * @return array - */ - protected function getExtraConditions(array $segments) - { - $extra = []; - - $count = count($segments); - - for ($i = 0; $i < $count; $i += 2) { - $extra[$segments[$i]] = $segments[$i + 1]; - } - - return $extra; - } - - /** - * Validate the given value is a valid file. - * - * @param string $attribute - * @param mixed $value - * @return bool - */ - public function validateFile($attribute, $value) - { - return $this->isValidFileInstance($value); - } - - /** - * Validate the given attribute is filled if it is present. - * - * @param string $attribute - * @param mixed $value - * @return bool - */ - public function validateFilled($attribute, $value) - { - if (Arr::has($this->data, $attribute)) { - return $this->validateRequired($attribute, $value); - } - - return true; - } - - /** - * Validate that an attribute is greater than another attribute. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateGt($attribute, $value, $parameters) - { - $this->requireParameterCount(1, $parameters, 'gt'); - - $comparedToValue = $this->getValue($parameters[0]); - - $this->shouldBeNumeric($attribute, 'Gt'); - - if (is_null($comparedToValue) && (is_numeric($value) && is_numeric($parameters[0]))) { - return $this->getSize($attribute, $value) > $parameters[0]; - } - - if (is_numeric($parameters[0])) { - return false; - } - - if ($this->hasRule($attribute, $this->numericRules) && is_numeric($value) && is_numeric($comparedToValue)) { - return $value > $comparedToValue; - } - - if (! $this->isSameType($value, $comparedToValue)) { - return false; - } - - return $this->getSize($attribute, $value) > $this->getSize($attribute, $comparedToValue); - } - - /** - * Validate that an attribute is less than another attribute. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateLt($attribute, $value, $parameters) - { - $this->requireParameterCount(1, $parameters, 'lt'); - - $comparedToValue = $this->getValue($parameters[0]); - - $this->shouldBeNumeric($attribute, 'Lt'); - - if (is_null($comparedToValue) && (is_numeric($value) && is_numeric($parameters[0]))) { - return $this->getSize($attribute, $value) < $parameters[0]; - } - - if (is_numeric($parameters[0])) { - return false; - } - - if ($this->hasRule($attribute, $this->numericRules) && is_numeric($value) && is_numeric($comparedToValue)) { - return $value < $comparedToValue; - } - - if (! $this->isSameType($value, $comparedToValue)) { - return false; - } - - return $this->getSize($attribute, $value) < $this->getSize($attribute, $comparedToValue); - } - - /** - * Validate that an attribute is greater than or equal another attribute. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateGte($attribute, $value, $parameters) - { - $this->requireParameterCount(1, $parameters, 'gte'); - - $comparedToValue = $this->getValue($parameters[0]); - - $this->shouldBeNumeric($attribute, 'Gte'); - - if (is_null($comparedToValue) && (is_numeric($value) && is_numeric($parameters[0]))) { - return $this->getSize($attribute, $value) >= $parameters[0]; - } - - if (is_numeric($parameters[0])) { - return false; - } - - if ($this->hasRule($attribute, $this->numericRules) && is_numeric($value) && is_numeric($comparedToValue)) { - return $value >= $comparedToValue; - } - - if (! $this->isSameType($value, $comparedToValue)) { - return false; - } - - return $this->getSize($attribute, $value) >= $this->getSize($attribute, $comparedToValue); - } - - /** - * Validate that an attribute is less than or equal another attribute. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateLte($attribute, $value, $parameters) - { - $this->requireParameterCount(1, $parameters, 'lte'); - - $comparedToValue = $this->getValue($parameters[0]); - - $this->shouldBeNumeric($attribute, 'Lte'); - - if (is_null($comparedToValue) && (is_numeric($value) && is_numeric($parameters[0]))) { - return $this->getSize($attribute, $value) <= $parameters[0]; - } - - if (is_numeric($parameters[0])) { - return false; - } - - if ($this->hasRule($attribute, $this->numericRules) && is_numeric($value) && is_numeric($comparedToValue)) { - return $value <= $comparedToValue; - } - - if (! $this->isSameType($value, $comparedToValue)) { - return false; - } - - return $this->getSize($attribute, $value) <= $this->getSize($attribute, $comparedToValue); - } - - /** - * Validate that an attribute is lowercase. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateLowercase($attribute, $value, $parameters) - { - return Str::lower($value) === $value; - } - - /** - * Validate that an attribute is uppercase. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateUppercase($attribute, $value, $parameters) - { - return Str::upper($value) === $value; - } - - /** - * Validate the MIME type of a file is an image MIME type. - * - * @param string $attribute - * @param mixed $value - * @return bool - */ - public function validateImage($attribute, $value) - { - return $this->validateMimes($attribute, $value, ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'svg', 'webp']); - } - - /** - * Validate an attribute is contained within a list of values. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateIn($attribute, $value, $parameters) - { - if (is_array($value) && $this->hasRule($attribute, 'Array')) { - foreach ($value as $element) { - if (is_array($element)) { - return false; - } - } - - return count(array_diff($value, $parameters)) === 0; - } - - return ! is_array($value) && in_array((string) $value, $parameters); - } - - /** - * Validate that the values of an attribute are in another attribute. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateInArray($attribute, $value, $parameters) - { - $this->requireParameterCount(1, $parameters, 'in_array'); - - $explicitPath = ValidationData::getLeadingExplicitAttributePath($parameters[0]); - - $attributeData = ValidationData::extractDataFromPath($explicitPath, $this->data); - - $otherValues = Arr::where(Arr::dot($attributeData), function ($value, $key) use ($parameters) { - return Str::is($parameters[0], $key); - }); - - return in_array($value, $otherValues); - } - - /** - * Validate that an attribute is an integer. - * - * @param string $attribute - * @param mixed $value - * @return bool - */ - public function validateInteger($attribute, $value) - { - return filter_var($value, FILTER_VALIDATE_INT) !== false; - } - - /** - * Validate that an attribute is a valid IP. - * - * @param string $attribute - * @param mixed $value - * @return bool - */ - public function validateIp($attribute, $value) - { - return filter_var($value, FILTER_VALIDATE_IP) !== false; - } - - /** - * Validate that an attribute is a valid IPv4. - * - * @param string $attribute - * @param mixed $value - * @return bool - */ - public function validateIpv4($attribute, $value) - { - return filter_var($value, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) !== false; - } - - /** - * Validate that an attribute is a valid IPv6. - * - * @param string $attribute - * @param mixed $value - * @return bool - */ - public function validateIpv6($attribute, $value) - { - return filter_var($value, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) !== false; - } - - /** - * Validate that an attribute is a valid MAC address. - * - * @param string $attribute - * @param mixed $value - * @return bool - */ - public function validateMacAddress($attribute, $value) - { - return filter_var($value, FILTER_VALIDATE_MAC) !== false; - } - - /** - * Validate the attribute is a valid JSON string. - * - * @param string $attribute - * @param mixed $value - * @return bool - */ - public function validateJson($attribute, $value) - { - if (is_array($value)) { - return false; - } - - if (! is_scalar($value) && ! is_null($value) && ! method_exists($value, '__toString')) { - return false; - } - - json_decode($value); - - return json_last_error() === JSON_ERROR_NONE; - } - - /** - * Validate the size of an attribute is less than a maximum value. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateMax($attribute, $value, $parameters) - { - $this->requireParameterCount(1, $parameters, 'max'); - - if ($value instanceof UploadedFile && ! $value->isValid()) { - return false; - } - - return $this->getSize($attribute, $value) <= $parameters[0]; - } - - /** - * Validate that an attribute has a maximum number of digits. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateMaxDigits($attribute, $value, $parameters) - { - $this->requireParameterCount(1, $parameters, 'max'); - - $length = strlen((string) $value); - - return ! preg_match('/[^0-9]/', $value) && $length <= $parameters[0]; - } - - /** - * Validate the guessed extension of a file upload is in a set of file extensions. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateMimes($attribute, $value, $parameters) - { - if (! $this->isValidFileInstance($value)) { - return false; - } - - if ($this->shouldBlockPhpUpload($value, $parameters)) { - return false; - } - - if (in_array('jpg', $parameters) || in_array('jpeg', $parameters)) { - $parameters = array_unique(array_merge($parameters, ['jpg', 'jpeg'])); - } - - return $value->getPath() !== '' && in_array($value->guessExtension(), $parameters); - } - - /** - * Validate the MIME type of a file upload attribute is in a set of MIME types. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateMimetypes($attribute, $value, $parameters) - { - if (! $this->isValidFileInstance($value)) { - return false; - } - - if ($this->shouldBlockPhpUpload($value, $parameters)) { - return false; - } - - return $value->getPath() !== '' && - (in_array($value->getMimeType(), $parameters) || - in_array(explode('/', $value->getMimeType())[0].'/*', $parameters)); - } - - /** - * Check if PHP uploads are explicitly allowed. - * - * @param mixed $value - * @param array $parameters - * @return bool - */ - protected function shouldBlockPhpUpload($value, $parameters) - { - if (in_array('php', $parameters)) { - return false; - } - - $phpExtensions = [ - 'php', 'php3', 'php4', 'php5', 'php7', 'php8', 'phtml', 'phar', - ]; - - return ($value instanceof UploadedFile) - ? in_array(trim(strtolower($value->getClientOriginalExtension())), $phpExtensions) - : in_array(trim(strtolower($value->getExtension())), $phpExtensions); - } - - /** - * Validate the size of an attribute is greater than a minimum value. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateMin($attribute, $value, $parameters) - { - $this->requireParameterCount(1, $parameters, 'min'); - - return $this->getSize($attribute, $value) >= $parameters[0]; - } - - /** - * Validate that an attribute has a minimum number of digits. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateMinDigits($attribute, $value, $parameters) - { - $this->requireParameterCount(1, $parameters, 'min'); - - $length = strlen((string) $value); - - return ! preg_match('/[^0-9]/', $value) && $length >= $parameters[0]; - } - - /** - * Validate the value of an attribute is a multiple of a given value. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateMultipleOf($attribute, $value, $parameters) - { - $this->requireParameterCount(1, $parameters, 'multiple_of'); - - if (! $this->validateNumeric($attribute, $value) || ! $this->validateNumeric($attribute, $parameters[0])) { - return false; - } - - if ((float) $parameters[0] === 0.0) { - return false; - } - - return bcmod($value, $parameters[0], 16) === '0.0000000000000000'; - } - - /** - * "Indicate" validation should pass if value is null. - * - * Always returns true, just lets us put "nullable" in rules. - * - * @return bool - */ - public function validateNullable() - { - return true; - } - - /** - * Validate an attribute is not contained within a list of values. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateNotIn($attribute, $value, $parameters) - { - return ! $this->validateIn($attribute, $value, $parameters); - } - - /** - * Validate that an attribute is numeric. - * - * @param string $attribute - * @param mixed $value - * @return bool - */ - public function validateNumeric($attribute, $value) - { - return is_numeric($value); - } - - /** - * Validate that an attribute exists even if not filled. - * - * @param string $attribute - * @param mixed $value - * @return bool - */ - public function validatePresent($attribute, $value) - { - return Arr::has($this->data, $attribute); - } - - /** - * Validate that an attribute passes a regular expression check. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateRegex($attribute, $value, $parameters) - { - if (! is_string($value) && ! is_numeric($value)) { - return false; - } - - $this->requireParameterCount(1, $parameters, 'regex'); - - return preg_match($parameters[0], $value) > 0; - } - - /** - * Validate that an attribute does not pass a regular expression check. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateNotRegex($attribute, $value, $parameters) - { - if (! is_string($value) && ! is_numeric($value)) { - return false; - } - - $this->requireParameterCount(1, $parameters, 'not_regex'); - - return preg_match($parameters[0], $value) < 1; - } - - /** - * Validate that a required attribute exists. - * - * @param string $attribute - * @param mixed $value - * @return bool - */ - public function validateRequired($attribute, $value) - { - if (is_null($value)) { - return false; - } elseif (is_string($value) && trim($value) === '') { - return false; - } elseif (is_countable($value) && count($value) < 1) { - return false; - } elseif ($value instanceof File) { - return (string) $value->getPath() !== ''; - } - - return true; - } - - /** - * Validate that an attribute exists when another attribute has a given value. - * - * @param string $attribute - * @param mixed $value - * @param mixed $parameters - * @return bool - */ - public function validateRequiredIf($attribute, $value, $parameters) - { - $this->requireParameterCount(2, $parameters, 'required_if'); - - if (! Arr::has($this->data, $parameters[0])) { - return true; - } - - [$values, $other] = $this->parseDependentRuleParameters($parameters); - - if (in_array($other, $values, is_bool($other) || is_null($other))) { - return $this->validateRequired($attribute, $value); - } - - return true; - } - - /** - * Validate that an attribute exists when another attribute was "accepted". - * - * @param string $attribute - * @param mixed $value - * @param mixed $parameters - * @return bool - */ - public function validateRequiredIfAccepted($attribute, $value, $parameters) - { - $this->requireParameterCount(1, $parameters, 'required_if_accepted'); - - if ($this->validateAccepted($parameters[0], $this->getValue($parameters[0]))) { - return $this->validateRequired($attribute, $value); - } - - return true; - } - - /** - * Validate that an attribute does not exist. - * - * @param string $attribute - * @param mixed $value - * @return bool - */ - public function validateProhibited($attribute, $value) - { - return false; - } - - /** - * Validate that an attribute does not exist when another attribute has a given value. - * - * @param string $attribute - * @param mixed $value - * @param mixed $parameters - * @return bool - */ - public function validateProhibitedIf($attribute, $value, $parameters) - { - $this->requireParameterCount(2, $parameters, 'prohibited_if'); - - [$values, $other] = $this->parseDependentRuleParameters($parameters); - - if (in_array($other, $values, is_bool($other) || is_null($other))) { - return ! $this->validateRequired($attribute, $value); - } - - return true; - } - - /** - * Validate that an attribute does not exist unless another attribute has a given value. - * - * @param string $attribute - * @param mixed $value - * @param mixed $parameters - * @return bool - */ - public function validateProhibitedUnless($attribute, $value, $parameters) - { - $this->requireParameterCount(2, $parameters, 'prohibited_unless'); - - [$values, $other] = $this->parseDependentRuleParameters($parameters); - - if (! in_array($other, $values, is_bool($other) || is_null($other))) { - return ! $this->validateRequired($attribute, $value); - } - - return true; - } - - /** - * Validate that other attributes do not exist when this attribute exists. - * - * @param string $attribute - * @param mixed $value - * @param mixed $parameters - * @return bool - */ - public function validateProhibits($attribute, $value, $parameters) - { - return ! Arr::hasAny($this->data, $parameters); - } - - /** - * Indicate that an attribute is excluded. - * - * @return bool - */ - public function validateExclude() - { - return false; - } - - /** - * Indicate that an attribute should be excluded when another attribute has a given value. - * - * @param string $attribute - * @param mixed $value - * @param mixed $parameters - * @return bool - */ - public function validateExcludeIf($attribute, $value, $parameters) - { - $this->requireParameterCount(2, $parameters, 'exclude_if'); - - if (! Arr::has($this->data, $parameters[0])) { - return true; - } - - [$values, $other] = $this->parseDependentRuleParameters($parameters); - - return ! in_array($other, $values, is_bool($other) || is_null($other)); - } - - /** - * Indicate that an attribute should be excluded when another attribute does not have a given value. - * - * @param string $attribute - * @param mixed $value - * @param mixed $parameters - * @return bool - */ - public function validateExcludeUnless($attribute, $value, $parameters) - { - $this->requireParameterCount(2, $parameters, 'exclude_unless'); - - [$values, $other] = $this->parseDependentRuleParameters($parameters); - - return in_array($other, $values, is_bool($other) || is_null($other)); - } - - /** - * Validate that an attribute exists when another attribute does not have a given value. - * - * @param string $attribute - * @param mixed $value - * @param mixed $parameters - * @return bool - */ - public function validateRequiredUnless($attribute, $value, $parameters) - { - $this->requireParameterCount(2, $parameters, 'required_unless'); - - [$values, $other] = $this->parseDependentRuleParameters($parameters); - - if (! in_array($other, $values, is_bool($other) || is_null($other))) { - return $this->validateRequired($attribute, $value); - } - - return true; - } - - /** - * Indicate that an attribute should be excluded when another attribute presents. - * - * @param string $attribute - * @param mixed $value - * @param mixed $parameters - * @return bool - */ - public function validateExcludeWith($attribute, $value, $parameters) - { - $this->requireParameterCount(1, $parameters, 'exclude_with'); - - if (! Arr::has($this->data, $parameters[0])) { - return true; - } - - return false; - } - - /** - * Indicate that an attribute should be excluded when another attribute is missing. - * - * @param string $attribute - * @param mixed $value - * @param mixed $parameters - * @return bool - */ - public function validateExcludeWithout($attribute, $value, $parameters) - { - $this->requireParameterCount(1, $parameters, 'exclude_without'); - - if ($this->anyFailingRequired($parameters)) { - return false; - } - - return true; - } - - /** - * Prepare the values and the other value for validation. - * - * @param array $parameters - * @return array - */ - public function parseDependentRuleParameters($parameters) - { - $other = Arr::get($this->data, $parameters[0]); - - $values = array_slice($parameters, 1); - - if ($this->shouldConvertToBoolean($parameters[0]) || is_bool($other)) { - $values = $this->convertValuesToBoolean($values); - } - - if (is_null($other)) { - $values = $this->convertValuesToNull($values); - } - - return [$values, $other]; - } - - /** - * Check if parameter should be converted to boolean. - * - * @param string $parameter - * @return bool - */ - protected function shouldConvertToBoolean($parameter) - { - return in_array('boolean', Arr::get($this->rules, $parameter, [])); - } - - /** - * Convert the given values to boolean if they are string "true" / "false". - * - * @param array $values - * @return array - */ - protected function convertValuesToBoolean($values) - { - return array_map(function ($value) { - if ($value === 'true') { - return true; - } elseif ($value === 'false') { - return false; - } - - return $value; - }, $values); - } - - /** - * Convert the given values to null if they are string "null". - * - * @param array $values - * @return array - */ - protected function convertValuesToNull($values) - { - return array_map(function ($value) { - return Str::lower($value) === 'null' ? null : $value; - }, $values); - } - - /** - * Validate that an attribute exists when any other attribute exists. - * - * @param string $attribute - * @param mixed $value - * @param mixed $parameters - * @return bool - */ - public function validateRequiredWith($attribute, $value, $parameters) - { - if (! $this->allFailingRequired($parameters)) { - return $this->validateRequired($attribute, $value); - } - - return true; - } - - /** - * Validate that an attribute exists when all other attributes exist. - * - * @param string $attribute - * @param mixed $value - * @param mixed $parameters - * @return bool - */ - public function validateRequiredWithAll($attribute, $value, $parameters) - { - if (! $this->anyFailingRequired($parameters)) { - return $this->validateRequired($attribute, $value); - } - - return true; - } - - /** - * Validate that an attribute exists when another attribute does not. - * - * @param string $attribute - * @param mixed $value - * @param mixed $parameters - * @return bool - */ - public function validateRequiredWithout($attribute, $value, $parameters) - { - if ($this->anyFailingRequired($parameters)) { - return $this->validateRequired($attribute, $value); - } - - return true; - } - - /** - * Validate that an attribute exists when all other attributes do not. - * - * @param string $attribute - * @param mixed $value - * @param mixed $parameters - * @return bool - */ - public function validateRequiredWithoutAll($attribute, $value, $parameters) - { - if ($this->allFailingRequired($parameters)) { - return $this->validateRequired($attribute, $value); - } - - return true; - } - - /** - * Determine if any of the given attributes fail the required test. - * - * @param array $attributes - * @return bool - */ - protected function anyFailingRequired(array $attributes) - { - foreach ($attributes as $key) { - if (! $this->validateRequired($key, $this->getValue($key))) { - return true; - } - } - - return false; - } - - /** - * Determine if all of the given attributes fail the required test. - * - * @param array $attributes - * @return bool - */ - protected function allFailingRequired(array $attributes) - { - foreach ($attributes as $key) { - if ($this->validateRequired($key, $this->getValue($key))) { - return false; - } - } - - return true; - } - - /** - * Validate that two attributes match. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateSame($attribute, $value, $parameters) - { - $this->requireParameterCount(1, $parameters, 'same'); - - $other = Arr::get($this->data, $parameters[0]); - - return $value === $other; - } - - /** - * Validate the size of an attribute. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateSize($attribute, $value, $parameters) - { - $this->requireParameterCount(1, $parameters, 'size'); - - return $this->getSize($attribute, $value) == $parameters[0]; - } - - /** - * "Validate" optional attributes. - * - * Always returns true, just lets us put sometimes in rules. - * - * @return bool - */ - public function validateSometimes() - { - return true; - } - - /** - * Validate the attribute starts with a given substring. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateStartsWith($attribute, $value, $parameters) - { - return Str::startsWith($value, $parameters); - } - - /** - * Validate the attribute does not start with a given substring. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateDoesntStartWith($attribute, $value, $parameters) - { - return ! Str::startsWith($value, $parameters); - } - - /** - * Validate the attribute ends with a given substring. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateEndsWith($attribute, $value, $parameters) - { - return Str::endsWith($value, $parameters); - } - - /** - * Validate the attribute does not end with a given substring. - * - * @param string $attribute - * @param mixed $value - * @param array $parameters - * @return bool - */ - public function validateDoesntEndWith($attribute, $value, $parameters) - { - return ! Str::endsWith($value, $parameters); - } - - /** - * Validate that an attribute is a string. - * - * @param string $attribute - * @param mixed $value - * @return bool - */ - public function validateString($attribute, $value) - { - return is_string($value); - } - - /** - * Validate that an attribute is a valid timezone. - * - * @param string $attribute - * @param mixed $value - * @return bool - */ - public function validateTimezone($attribute, $value) - { - return in_array($value, timezone_identifiers_list(), true); - } - - /** - * Validate that an attribute is a valid URL. - * - * @param string $attribute - * @param mixed $value - * @return bool - */ - public function validateUrl($attribute, $value) - { - if (! is_string($value)) { - return false; - } - - /* - * This pattern is derived from Symfony\Component\Validator\Constraints\UrlValidator (5.0.7). - * - * (c) Fabien Potencier http://symfony.com - */ - $pattern = '~^ - (aaa|aaas|about|acap|acct|acd|acr|adiumxtra|adt|afp|afs|aim|amss|android|appdata|apt|ark|attachment|aw|barion|beshare|bitcoin|bitcoincash|blob|bolo|browserext|calculator|callto|cap|cast|casts|chrome|chrome-extension|cid|coap|coap\+tcp|coap\+ws|coaps|coaps\+tcp|coaps\+ws|com-eventbrite-attendee|content|conti|crid|cvs|dab|data|dav|diaspora|dict|did|dis|dlna-playcontainer|dlna-playsingle|dns|dntp|dpp|drm|drop|dtn|dvb|ed2k|elsi|example|facetime|fax|feed|feedready|file|filesystem|finger|first-run-pen-experience|fish|fm|ftp|fuchsia-pkg|geo|gg|git|gizmoproject|go|gopher|graph|gtalk|h323|ham|hcap|hcp|http|https|hxxp|hxxps|hydrazone|iax|icap|icon|im|imap|info|iotdisco|ipn|ipp|ipps|irc|irc6|ircs|iris|iris\.beep|iris\.lwz|iris\.xpc|iris\.xpcs|isostore|itms|jabber|jar|jms|keyparc|lastfm|ldap|ldaps|leaptofrogans|lorawan|lvlt|magnet|mailserver|mailto|maps|market|message|mid|mms|modem|mongodb|moz|ms-access|ms-browser-extension|ms-calculator|ms-drive-to|ms-enrollment|ms-excel|ms-eyecontrolspeech|ms-gamebarservices|ms-gamingoverlay|ms-getoffice|ms-help|ms-infopath|ms-inputapp|ms-lockscreencomponent-config|ms-media-stream-id|ms-mixedrealitycapture|ms-mobileplans|ms-officeapp|ms-people|ms-project|ms-powerpoint|ms-publisher|ms-restoretabcompanion|ms-screenclip|ms-screensketch|ms-search|ms-search-repair|ms-secondary-screen-controller|ms-secondary-screen-setup|ms-settings|ms-settings-airplanemode|ms-settings-bluetooth|ms-settings-camera|ms-settings-cellular|ms-settings-cloudstorage|ms-settings-connectabledevices|ms-settings-displays-topology|ms-settings-emailandaccounts|ms-settings-language|ms-settings-location|ms-settings-lock|ms-settings-nfctransactions|ms-settings-notifications|ms-settings-power|ms-settings-privacy|ms-settings-proximity|ms-settings-screenrotation|ms-settings-wifi|ms-settings-workplace|ms-spd|ms-sttoverlay|ms-transit-to|ms-useractivityset|ms-virtualtouchpad|ms-visio|ms-walk-to|ms-whiteboard|ms-whiteboard-cmd|ms-word|msnim|msrp|msrps|mss|mtqp|mumble|mupdate|mvn|news|nfs|ni|nih|nntp|notes|ocf|oid|onenote|onenote-cmd|opaquelocktoken|openpgp4fpr|pack|palm|paparazzi|payto|pkcs11|platform|pop|pres|prospero|proxy|pwid|psyc|pttp|qb|query|redis|rediss|reload|res|resource|rmi|rsync|rtmfp|rtmp|rtsp|rtsps|rtspu|s3|secondlife|service|session|sftp|sgn|shttp|sieve|simpleledger|sip|sips|skype|smb|sms|smtp|snews|snmp|soap\.beep|soap\.beeps|soldat|spiffe|spotify|ssh|steam|stun|stuns|submit|svn|tag|teamspeak|tel|teliaeid|telnet|tftp|tg|things|thismessage|tip|tn3270|tool|ts3server|turn|turns|tv|udp|unreal|urn|ut2004|v-event|vemmi|ventrilo|videotex|vnc|view-source|wais|webcal|wpid|ws|wss|wtai|wyciwyg|xcon|xcon-userid|xfire|xmlrpc\.beep|xmlrpc\.beeps|xmpp|xri|ymsgr|z39\.50|z39\.50r|z39\.50s):// # protocol - (((?:[\_\.\pL\pN-]|%[0-9A-Fa-f]{2})+:)?((?:[\_\.\pL\pN-]|%[0-9A-Fa-f]{2})+)@)? # basic auth - ( - ([\pL\pN\pS\-\_\.])+(\.?([\pL\pN]|xn\-\-[\pL\pN-]+)+\.?) # a domain name - | # or - \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} # an IP address - | # or - \[ - (?:(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){6})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:::(?:(?:(?:[0-9a-f]{1,4})):){5})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){4})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,1}(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){3})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,2}(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){2})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,3}(?:(?:[0-9a-f]{1,4})))?::(?:(?:[0-9a-f]{1,4})):)(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,4}(?:(?:[0-9a-f]{1,4})))?::)(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,5}(?:(?:[0-9a-f]{1,4})))?::)(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,6}(?:(?:[0-9a-f]{1,4})))?::)))) - \] # an IPv6 address - ) - (:[0-9]+)? # a port (optional) - (?:/ (?:[\pL\pN\-._\~!$&\'()*+,;=:@]|%[0-9A-Fa-f]{2})* )* # a path - (?:\? (?:[\pL\pN\-._\~!$&\'\[\]()*+,;=:@/?]|%[0-9A-Fa-f]{2})* )? # a query (optional) - (?:\# (?:[\pL\pN\-._\~!$&\'()*+,;=:@/?]|%[0-9A-Fa-f]{2})* )? # a fragment (optional) - $~ixu'; - - return preg_match($pattern, $value) > 0; - } - - /** - * Validate that an attribute is a valid ULID. - * - * @param string $attribute - * @param mixed $value - * @return bool - */ - public function validateUlid($attribute, $value) - { - return Str::isUlid($value); - } - - /** - * Validate that an attribute is a valid UUID. - * - * @param string $attribute - * @param mixed $value - * @return bool - */ - public function validateUuid($attribute, $value) - { - return Str::isUuid($value); - } - - /** - * Get the size of an attribute. - * - * @param string $attribute - * @param mixed $value - * @return mixed - */ - protected function getSize($attribute, $value) - { - $hasNumeric = $this->hasRule($attribute, $this->numericRules); - - // This method will determine if the attribute is a number, string, or file and - // return the proper size accordingly. If it is a number, then number itself - // is the size. If it is a file, we take kilobytes, and for a string the - // entire length of the string will be considered the attribute size. - if (is_numeric($value) && $hasNumeric) { - return $value; - } elseif (is_array($value)) { - return count($value); - } elseif ($value instanceof File) { - return $value->getSize() / 1024; - } - - return mb_strlen($value ?? ''); - } - - /** - * Check that the given value is a valid file instance. - * - * @param mixed $value - * @return bool - */ - public function isValidFileInstance($value) - { - if ($value instanceof UploadedFile && ! $value->isValid()) { - return false; - } - - return $value instanceof File; - } - - /** - * Determine if a comparison passes between the given values. - * - * @param mixed $first - * @param mixed $second - * @param string $operator - * @return bool - * - * @throws \InvalidArgumentException - */ - protected function compare($first, $second, $operator) - { - return match ($operator) { - '<' => $first < $second, - '>' => $first > $second, - '<=' => $first <= $second, - '>=' => $first >= $second, - '=' => $first == $second, - default => throw new InvalidArgumentException, - }; - } - - /** - * Parse named parameters to $key => $value items. - * - * @param array $parameters - * @return array - */ - public function parseNamedParameters($parameters) - { - return array_reduce($parameters, function ($result, $item) { - [$key, $value] = array_pad(explode('=', $item, 2), 2, null); - - $result[$key] = $value; - - return $result; - }); - } - - /** - * Require a certain number of parameters to be present. - * - * @param int $count - * @param array $parameters - * @param string $rule - * @return void - * - * @throws \InvalidArgumentException - */ - public function requireParameterCount($count, $parameters, $rule) - { - if (count($parameters) < $count) { - throw new InvalidArgumentException("Validation rule $rule requires at least $count parameters."); - } - } - - /** - * Check if the parameters are of the same type. - * - * @param mixed $first - * @param mixed $second - * @return bool - */ - protected function isSameType($first, $second) - { - return gettype($first) == gettype($second); - } - - /** - * Adds the existing rule to the numericRules array if the attribute's value is numeric. - * - * @param string $attribute - * @param string $rule - * @return void - */ - protected function shouldBeNumeric($attribute, $rule) - { - if (is_numeric($this->getValue($attribute))) { - $this->numericRules[] = $rule; - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Validation/ConditionalRules.php b/vendor/laravel/framework/src/Illuminate/Validation/ConditionalRules.php deleted file mode 100644 index 02f8e21f..00000000 --- a/vendor/laravel/framework/src/Illuminate/Validation/ConditionalRules.php +++ /dev/null @@ -1,83 +0,0 @@ -condition = $condition; - $this->rules = $rules; - $this->defaultRules = $defaultRules; - } - - /** - * Determine if the conditional rules should be added. - * - * @param array $data - * @return bool - */ - public function passes(array $data = []) - { - return is_callable($this->condition) - ? call_user_func($this->condition, new Fluent($data)) - : $this->condition; - } - - /** - * Get the rules. - * - * @param array $data - * @return array - */ - public function rules(array $data = []) - { - return is_string($this->rules) - ? explode('|', $this->rules) - : value($this->rules, new Fluent($data)); - } - - /** - * Get the default rules. - * - * @param array $data - * @return array - */ - public function defaultRules(array $data = []) - { - return is_string($this->defaultRules) - ? explode('|', $this->defaultRules) - : value($this->defaultRules, new Fluent($data)); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Validation/DatabasePresenceVerifier.php b/vendor/laravel/framework/src/Illuminate/Validation/DatabasePresenceVerifier.php deleted file mode 100755 index 9229f06b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Validation/DatabasePresenceVerifier.php +++ /dev/null @@ -1,137 +0,0 @@ -db = $db; - } - - /** - * Count the number of objects in a collection having the given value. - * - * @param string $collection - * @param string $column - * @param string $value - * @param int|null $excludeId - * @param string|null $idColumn - * @param array $extra - * @return int - */ - public function getCount($collection, $column, $value, $excludeId = null, $idColumn = null, array $extra = []) - { - $query = $this->table($collection)->where($column, '=', $value); - - if (! is_null($excludeId) && $excludeId !== 'NULL') { - $query->where($idColumn ?: 'id', '<>', $excludeId); - } - - return $this->addConditions($query, $extra)->count(); - } - - /** - * Count the number of objects in a collection with the given values. - * - * @param string $collection - * @param string $column - * @param array $values - * @param array $extra - * @return int - */ - public function getMultiCount($collection, $column, array $values, array $extra = []) - { - $query = $this->table($collection)->whereIn($column, $values); - - return $this->addConditions($query, $extra)->distinct()->count($column); - } - - /** - * Add the given conditions to the query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $conditions - * @return \Illuminate\Database\Query\Builder - */ - protected function addConditions($query, $conditions) - { - foreach ($conditions as $key => $value) { - if ($value instanceof Closure) { - $query->where(function ($query) use ($value) { - $value($query); - }); - } else { - $this->addWhere($query, $key, $value); - } - } - - return $query; - } - - /** - * Add a "where" clause to the given query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param string $key - * @param string $extraValue - * @return void - */ - protected function addWhere($query, $key, $extraValue) - { - if ($extraValue === 'NULL') { - $query->whereNull($key); - } elseif ($extraValue === 'NOT_NULL') { - $query->whereNotNull($key); - } elseif (str_starts_with($extraValue, '!')) { - $query->where($key, '!=', mb_substr($extraValue, 1)); - } else { - $query->where($key, $extraValue); - } - } - - /** - * Get a query builder for the given table. - * - * @param string $table - * @return \Illuminate\Database\Query\Builder - */ - protected function table($table) - { - return $this->db->connection($this->connection)->table($table)->useWritePdo(); - } - - /** - * Set the connection to be used. - * - * @param string $connection - * @return void - */ - public function setConnection($connection) - { - $this->connection = $connection; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Validation/DatabasePresenceVerifierInterface.php b/vendor/laravel/framework/src/Illuminate/Validation/DatabasePresenceVerifierInterface.php deleted file mode 100755 index 4b70ee0b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Validation/DatabasePresenceVerifierInterface.php +++ /dev/null @@ -1,14 +0,0 @@ - - */ - protected $extensions = []; - - /** - * All of the custom implicit validator extensions. - * - * @var array - */ - protected $implicitExtensions = []; - - /** - * All of the custom dependent validator extensions. - * - * @var array - */ - protected $dependentExtensions = []; - - /** - * All of the custom validator message replacers. - * - * @var array - */ - protected $replacers = []; - - /** - * All of the fallback messages for custom rules. - * - * @var array - */ - protected $fallbackMessages = []; - - /** - * Indicates that unvalidated array keys should be excluded, even if the parent array was validated. - * - * @var bool - */ - protected $excludeUnvalidatedArrayKeys = true; - - /** - * The Validator resolver instance. - * - * @var \Closure - */ - protected $resolver; - - /** - * Create a new Validator factory instance. - * - * @param \Illuminate\Contracts\Translation\Translator $translator - * @param \Illuminate\Contracts\Container\Container|null $container - * @return void - */ - public function __construct(Translator $translator, Container $container = null) - { - $this->container = $container; - $this->translator = $translator; - } - - /** - * Create a new Validator instance. - * - * @param array $data - * @param array $rules - * @param array $messages - * @param array $customAttributes - * @return \Illuminate\Validation\Validator - */ - public function make(array $data, array $rules, array $messages = [], array $customAttributes = []) - { - $validator = $this->resolve( - $data, $rules, $messages, $customAttributes - ); - - // The presence verifier is responsible for checking the unique and exists data - // for the validator. It is behind an interface so that multiple versions of - // it may be written besides database. We'll inject it into the validator. - if (! is_null($this->verifier)) { - $validator->setPresenceVerifier($this->verifier); - } - - // Next we'll set the IoC container instance of the validator, which is used to - // resolve out class based validator extensions. If it is not set then these - // types of extensions will not be possible on these validation instances. - if (! is_null($this->container)) { - $validator->setContainer($this->container); - } - - $validator->excludeUnvalidatedArrayKeys = $this->excludeUnvalidatedArrayKeys; - - $this->addExtensions($validator); - - return $validator; - } - - /** - * Validate the given data against the provided rules. - * - * @param array $data - * @param array $rules - * @param array $messages - * @param array $customAttributes - * @return array - * - * @throws \Illuminate\Validation\ValidationException - */ - public function validate(array $data, array $rules, array $messages = [], array $customAttributes = []) - { - return $this->make($data, $rules, $messages, $customAttributes)->validate(); - } - - /** - * Resolve a new Validator instance. - * - * @param array $data - * @param array $rules - * @param array $messages - * @param array $customAttributes - * @return \Illuminate\Validation\Validator - */ - protected function resolve(array $data, array $rules, array $messages, array $customAttributes) - { - if (is_null($this->resolver)) { - return new Validator($this->translator, $data, $rules, $messages, $customAttributes); - } - - return call_user_func($this->resolver, $this->translator, $data, $rules, $messages, $customAttributes); - } - - /** - * Add the extensions to a validator instance. - * - * @param \Illuminate\Validation\Validator $validator - * @return void - */ - protected function addExtensions(Validator $validator) - { - $validator->addExtensions($this->extensions); - - // Next, we will add the implicit extensions, which are similar to the required - // and accepted rule in that they're run even if the attributes aren't in an - // array of data which is given to a validator instance via instantiation. - $validator->addImplicitExtensions($this->implicitExtensions); - - $validator->addDependentExtensions($this->dependentExtensions); - - $validator->addReplacers($this->replacers); - - $validator->setFallbackMessages($this->fallbackMessages); - } - - /** - * Register a custom validator extension. - * - * @param string $rule - * @param \Closure|string $extension - * @param string|null $message - * @return void - */ - public function extend($rule, $extension, $message = null) - { - $this->extensions[$rule] = $extension; - - if ($message) { - $this->fallbackMessages[Str::snake($rule)] = $message; - } - } - - /** - * Register a custom implicit validator extension. - * - * @param string $rule - * @param \Closure|string $extension - * @param string|null $message - * @return void - */ - public function extendImplicit($rule, $extension, $message = null) - { - $this->implicitExtensions[$rule] = $extension; - - if ($message) { - $this->fallbackMessages[Str::snake($rule)] = $message; - } - } - - /** - * Register a custom dependent validator extension. - * - * @param string $rule - * @param \Closure|string $extension - * @param string|null $message - * @return void - */ - public function extendDependent($rule, $extension, $message = null) - { - $this->dependentExtensions[$rule] = $extension; - - if ($message) { - $this->fallbackMessages[Str::snake($rule)] = $message; - } - } - - /** - * Register a custom validator message replacer. - * - * @param string $rule - * @param \Closure|string $replacer - * @return void - */ - public function replacer($rule, $replacer) - { - $this->replacers[$rule] = $replacer; - } - - /** - * Indicate that unvalidated array keys should be included in validated data when the parent array is validated. - * - * @return void - */ - public function includeUnvalidatedArrayKeys() - { - $this->excludeUnvalidatedArrayKeys = false; - } - - /** - * Indicate that unvalidated array keys should be excluded from the validated data, even if the parent array was validated. - * - * @return void - */ - public function excludeUnvalidatedArrayKeys() - { - $this->excludeUnvalidatedArrayKeys = true; - } - - /** - * Set the Validator instance resolver. - * - * @param \Closure $resolver - * @return void - */ - public function resolver(Closure $resolver) - { - $this->resolver = $resolver; - } - - /** - * Get the Translator implementation. - * - * @return \Illuminate\Contracts\Translation\Translator - */ - public function getTranslator() - { - return $this->translator; - } - - /** - * Get the Presence Verifier implementation. - * - * @return \Illuminate\Validation\PresenceVerifierInterface - */ - public function getPresenceVerifier() - { - return $this->verifier; - } - - /** - * Set the Presence Verifier implementation. - * - * @param \Illuminate\Validation\PresenceVerifierInterface $presenceVerifier - * @return void - */ - public function setPresenceVerifier(PresenceVerifierInterface $presenceVerifier) - { - $this->verifier = $presenceVerifier; - } - - /** - * Get the container instance used by the validation factory. - * - * @return \Illuminate\Contracts\Container\Container|null - */ - public function getContainer() - { - return $this->container; - } - - /** - * Set the container instance used by the validation factory. - * - * @param \Illuminate\Contracts\Container\Container $container - * @return $this - */ - public function setContainer(Container $container) - { - $this->container = $container; - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Validation/InvokableValidationRule.php b/vendor/laravel/framework/src/Illuminate/Validation/InvokableValidationRule.php deleted file mode 100644 index 8ca83f0a..00000000 --- a/vendor/laravel/framework/src/Illuminate/Validation/InvokableValidationRule.php +++ /dev/null @@ -1,199 +0,0 @@ -invokable = $invokable; - } - - /** - * Create a new implicit or explicit Invokable validation rule. - * - * @param \Illuminate\Contracts\Validation\InvokableRule $invokable - * @return \Illuminate\Contracts\Validation\Rule - */ - public static function make($invokable) - { - if ($invokable->implicit ?? false) { - return new class($invokable) extends InvokableValidationRule implements ImplicitRule - { - // - }; - } - - return new InvokableValidationRule($invokable); - } - - /** - * Determine if the validation rule passes. - * - * @param string $attribute - * @param mixed $value - * @return bool - */ - public function passes($attribute, $value) - { - $this->failed = false; - - if ($this->invokable instanceof DataAwareRule) { - $this->invokable->setData($this->validator->getData()); - } - - if ($this->invokable instanceof ValidatorAwareRule) { - $this->invokable->setValidator($this->validator); - } - - $this->invokable->__invoke($attribute, $value, function ($attribute, $message = null) { - $this->failed = true; - - return $this->pendingPotentiallyTranslatedString($attribute, $message); - }); - - return ! $this->failed; - } - - /** - * Get the underlying invokable rule. - * - * @return \Illuminate\Contracts\Validation\InvokableRule - */ - public function invokable() - { - return $this->invokable; - } - - /** - * Get the validation error messages. - * - * @return array - */ - public function message() - { - return $this->messages; - } - - /** - * Set the data under validation. - * - * @param array $data - * @return $this - */ - public function setData($data) - { - $this->data = $data; - - return $this; - } - - /** - * Set the current validator. - * - * @param \Illuminate\Validation\Validator $validator - * @return $this - */ - public function setValidator($validator) - { - $this->validator = $validator; - - return $this; - } - - /** - * Create a pending potentially translated string. - * - * @param string $attribute - * @param ?string $message - * @return \Illuminate\Translation\PotentiallyTranslatedString - */ - protected function pendingPotentiallyTranslatedString($attribute, $message) - { - $destructor = $message === null - ? fn ($message) => $this->messages[] = $message - : fn ($message) => $this->messages[$attribute] = $message; - - return new class($message ?? $attribute, $this->validator->getTranslator(), $destructor) extends PotentiallyTranslatedString - { - /** - * The callback to call when the object destructs. - * - * @var \Closure - */ - protected $destructor; - - /** - * Create a new pending potentially translated string. - * - * @param string $message - * @param \Illuminate\Contracts\Translation\Translator $translator - * @param \Closure $destructor - */ - public function __construct($message, $translator, $destructor) - { - parent::__construct($message, $translator); - - $this->destructor = $destructor; - } - - /** - * Handle the object's destruction. - * - * @return void - */ - public function __destruct() - { - ($this->destructor)($this->toString()); - } - }; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Validation/LICENSE.md b/vendor/laravel/framework/src/Illuminate/Validation/LICENSE.md deleted file mode 100644 index 79810c84..00000000 --- a/vendor/laravel/framework/src/Illuminate/Validation/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Taylor Otwell - -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/laravel/framework/src/Illuminate/Validation/NestedRules.php b/vendor/laravel/framework/src/Illuminate/Validation/NestedRules.php deleted file mode 100644 index 7a18fe11..00000000 --- a/vendor/laravel/framework/src/Illuminate/Validation/NestedRules.php +++ /dev/null @@ -1,55 +0,0 @@ -callback = $callback; - } - - /** - * Compile the callback into an array of rules. - * - * @param string $attribute - * @param mixed $value - * @param mixed $data - * @return \stdClass - */ - public function compile($attribute, $value, $data = null) - { - $rules = call_user_func($this->callback, $value, $attribute, $data); - - $parser = new ValidationRuleParser( - Arr::undot(Arr::wrap($data)) - ); - - if (is_array($rules) && Arr::isAssoc($rules)) { - $nested = []; - - foreach ($rules as $key => $rule) { - $nested[$attribute.'.'.$key] = $rule; - } - - return $parser->explode($nested); - } - - return $parser->explode([$attribute => $rules]); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Validation/NotPwnedVerifier.php b/vendor/laravel/framework/src/Illuminate/Validation/NotPwnedVerifier.php deleted file mode 100644 index 1a3511e4..00000000 --- a/vendor/laravel/framework/src/Illuminate/Validation/NotPwnedVerifier.php +++ /dev/null @@ -1,104 +0,0 @@ -factory = $factory; - $this->timeout = $timeout ?? 30; - } - - /** - * Verify that the given data has not been compromised in public breaches. - * - * @param array $data - * @return bool - */ - public function verify($data) - { - $value = $data['value']; - $threshold = $data['threshold']; - - if (empty($value = (string) $value)) { - return false; - } - - [$hash, $hashPrefix] = $this->getHash($value); - - return ! $this->search($hashPrefix) - ->contains(function ($line) use ($hash, $hashPrefix, $threshold) { - [$hashSuffix, $count] = explode(':', $line); - - return $hashPrefix.$hashSuffix == $hash && $count > $threshold; - }); - } - - /** - * Get the hash and its first 5 chars. - * - * @param string $value - * @return array - */ - protected function getHash($value) - { - $hash = strtoupper(sha1((string) $value)); - - $hashPrefix = substr($hash, 0, 5); - - return [$hash, $hashPrefix]; - } - - /** - * Search by the given hash prefix and returns all occurrences of leaked passwords. - * - * @param string $hashPrefix - * @return \Illuminate\Support\Collection - */ - protected function search($hashPrefix) - { - try { - $response = $this->factory->withHeaders([ - 'Add-Padding' => true, - ])->timeout($this->timeout)->get( - 'https://api.pwnedpasswords.com/range/'.$hashPrefix - ); - } catch (Exception $e) { - report($e); - } - - $body = (isset($response) && $response->successful()) - ? $response->body() - : ''; - - return Str::of($body)->trim()->explode("\n")->filter(function ($line) { - return str_contains($line, ':'); - }); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Validation/PresenceVerifierInterface.php b/vendor/laravel/framework/src/Illuminate/Validation/PresenceVerifierInterface.php deleted file mode 100755 index da58a121..00000000 --- a/vendor/laravel/framework/src/Illuminate/Validation/PresenceVerifierInterface.php +++ /dev/null @@ -1,30 +0,0 @@ -toArray(); - } - - return new In(is_array($values) ? $values : func_get_args()); - } - - /** - * Get a not_in constraint builder instance. - * - * @param \Illuminate\Contracts\Support\Arrayable|array|string $values - * @return \Illuminate\Validation\Rules\NotIn - */ - public static function notIn($values) - { - if ($values instanceof Arrayable) { - $values = $values->toArray(); - } - - return new NotIn(is_array($values) ? $values : func_get_args()); - } - - /** - * Get a required_if constraint builder instance. - * - * @param callable|bool $callback - * @return \Illuminate\Validation\Rules\RequiredIf - */ - public static function requiredIf($callback) - { - return new RequiredIf($callback); - } - - /** - * Get a exclude_if constraint builder instance. - * - * @param callable|bool $callback - * @return \Illuminate\Validation\Rules\ExcludeIf - */ - public static function excludeIf($callback) - { - return new ExcludeIf($callback); - } - - /** - * Get a prohibited_if constraint builder instance. - * - * @param callable|bool $callback - * @return \Illuminate\Validation\Rules\ProhibitedIf - */ - public static function prohibitedIf($callback) - { - return new ProhibitedIf($callback); - } - - /** - * Get an enum constraint builder instance. - * - * @param string $type - * @return \Illuminate\Validation\Rules\Enum - */ - public static function enum($type) - { - return new Enum($type); - } - - /** - * Get a file constraint builder instance. - * - * @return \Illuminate\Validation\Rules\File - */ - public static function file() - { - return new File; - } - - /** - * Get an image file constraint builder instance. - * - * @return \Illuminate\Validation\Rules\ImageFile - */ - public static function imageFile() - { - return new ImageFile; - } - - /** - * Get a dimensions constraint builder instance. - * - * @param array $constraints - * @return \Illuminate\Validation\Rules\Dimensions - */ - public static function dimensions(array $constraints = []) - { - return new Dimensions($constraints); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Validation/Rules/DatabaseRule.php b/vendor/laravel/framework/src/Illuminate/Validation/Rules/DatabaseRule.php deleted file mode 100644 index c523bec6..00000000 --- a/vendor/laravel/framework/src/Illuminate/Validation/Rules/DatabaseRule.php +++ /dev/null @@ -1,232 +0,0 @@ -column = $column; - - $this->table = $this->resolveTableName($table); - } - - /** - * Resolves the name of the table from the given string. - * - * @param string $table - * @return string - */ - public function resolveTableName($table) - { - if (! str_contains($table, '\\') || ! class_exists($table)) { - return $table; - } - - if (is_subclass_of($table, Model::class)) { - $model = new $table; - - if (str_contains($model->getTable(), '.')) { - return $table; - } - - return implode('.', array_map(function (string $part) { - return trim($part, '.'); - }, array_filter([$model->getConnectionName(), $model->getTable()]))); - } - - return $table; - } - - /** - * Set a "where" constraint on the query. - * - * @param \Closure|string $column - * @param \Illuminate\Contracts\Support\Arrayable|array|string|int|null $value - * @return $this - */ - public function where($column, $value = null) - { - if ($value instanceof Arrayable || is_array($value)) { - return $this->whereIn($column, $value); - } - - if ($column instanceof Closure) { - return $this->using($column); - } - - if (is_null($value)) { - return $this->whereNull($column); - } - - $this->wheres[] = compact('column', 'value'); - - return $this; - } - - /** - * Set a "where not" constraint on the query. - * - * @param string $column - * @param \Illuminate\Contracts\Support\Arrayable|array|string $value - * @return $this - */ - public function whereNot($column, $value) - { - if ($value instanceof Arrayable || is_array($value)) { - return $this->whereNotIn($column, $value); - } - - return $this->where($column, '!'.$value); - } - - /** - * Set a "where null" constraint on the query. - * - * @param string $column - * @return $this - */ - public function whereNull($column) - { - return $this->where($column, 'NULL'); - } - - /** - * Set a "where not null" constraint on the query. - * - * @param string $column - * @return $this - */ - public function whereNotNull($column) - { - return $this->where($column, 'NOT_NULL'); - } - - /** - * Set a "where in" constraint on the query. - * - * @param string $column - * @param \Illuminate\Contracts\Support\Arrayable|array $values - * @return $this - */ - public function whereIn($column, $values) - { - return $this->where(function ($query) use ($column, $values) { - $query->whereIn($column, $values); - }); - } - - /** - * Set a "where not in" constraint on the query. - * - * @param string $column - * @param \Illuminate\Contracts\Support\Arrayable|array $values - * @return $this - */ - public function whereNotIn($column, $values) - { - return $this->where(function ($query) use ($column, $values) { - $query->whereNotIn($column, $values); - }); - } - - /** - * Ignore soft deleted models during the existence check. - * - * @param string $deletedAtColumn - * @return $this - */ - public function withoutTrashed($deletedAtColumn = 'deleted_at') - { - $this->whereNull($deletedAtColumn); - - return $this; - } - - /** - * Only include soft deleted models during the existence check. - * - * @param string $deletedAtColumn - * @return $this - */ - public function onlyTrashed($deletedAtColumn = 'deleted_at') - { - $this->whereNotNull($deletedAtColumn); - - return $this; - } - - /** - * Register a custom query callback. - * - * @param \Closure $callback - * @return $this - */ - public function using(Closure $callback) - { - $this->using[] = $callback; - - return $this; - } - - /** - * Get the custom query callbacks for the rule. - * - * @return array - */ - public function queryCallbacks() - { - return $this->using; - } - - /** - * Format the where clauses. - * - * @return string - */ - protected function formatWheres() - { - return collect($this->wheres)->map(function ($where) { - return $where['column'].','.'"'.str_replace('"', '""', $where['value']).'"'; - })->implode(','); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Validation/Rules/Dimensions.php b/vendor/laravel/framework/src/Illuminate/Validation/Rules/Dimensions.php deleted file mode 100644 index 624cbcb8..00000000 --- a/vendor/laravel/framework/src/Illuminate/Validation/Rules/Dimensions.php +++ /dev/null @@ -1,135 +0,0 @@ -constraints = $constraints; - } - - /** - * Set the "width" constraint. - * - * @param int $value - * @return $this - */ - public function width($value) - { - $this->constraints['width'] = $value; - - return $this; - } - - /** - * Set the "height" constraint. - * - * @param int $value - * @return $this - */ - public function height($value) - { - $this->constraints['height'] = $value; - - return $this; - } - - /** - * Set the "min width" constraint. - * - * @param int $value - * @return $this - */ - public function minWidth($value) - { - $this->constraints['min_width'] = $value; - - return $this; - } - - /** - * Set the "min height" constraint. - * - * @param int $value - * @return $this - */ - public function minHeight($value) - { - $this->constraints['min_height'] = $value; - - return $this; - } - - /** - * Set the "max width" constraint. - * - * @param int $value - * @return $this - */ - public function maxWidth($value) - { - $this->constraints['max_width'] = $value; - - return $this; - } - - /** - * Set the "max height" constraint. - * - * @param int $value - * @return $this - */ - public function maxHeight($value) - { - $this->constraints['max_height'] = $value; - - return $this; - } - - /** - * Set the "ratio" constraint. - * - * @param float $value - * @return $this - */ - public function ratio($value) - { - $this->constraints['ratio'] = $value; - - return $this; - } - - /** - * Convert the rule to a validation string. - * - * @return string - */ - public function __toString() - { - $result = ''; - - foreach ($this->constraints as $key => $value) { - $result .= "$key=$value,"; - } - - return 'dimensions:'.substr($result, 0, -1); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Validation/Rules/Enum.php b/vendor/laravel/framework/src/Illuminate/Validation/Rules/Enum.php deleted file mode 100644 index a519e58b..00000000 --- a/vendor/laravel/framework/src/Illuminate/Validation/Rules/Enum.php +++ /dev/null @@ -1,65 +0,0 @@ -type = $type; - } - - /** - * Determine if the validation rule passes. - * - * @param string $attribute - * @param mixed $value - * @return bool - */ - public function passes($attribute, $value) - { - if ($value instanceof $this->type) { - return true; - } - - if (is_null($value) || ! function_exists('enum_exists') || ! enum_exists($this->type) || ! method_exists($this->type, 'tryFrom')) { - return false; - } - - try { - return ! is_null($this->type::tryFrom($value)); - } catch (TypeError $e) { - return false; - } - } - - /** - * Get the validation error message. - * - * @return array - */ - public function message() - { - $message = trans('validation.enum'); - - return $message === 'validation.enum' - ? ['The selected :attribute is invalid.'] - : $message; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Validation/Rules/ExcludeIf.php b/vendor/laravel/framework/src/Illuminate/Validation/Rules/ExcludeIf.php deleted file mode 100644 index 2fff3d78..00000000 --- a/vendor/laravel/framework/src/Illuminate/Validation/Rules/ExcludeIf.php +++ /dev/null @@ -1,47 +0,0 @@ -condition = $condition; - } else { - throw new InvalidArgumentException('The provided condition must be a callable or boolean.'); - } - } - - /** - * Convert the rule to a validation string. - * - * @return string - */ - public function __toString() - { - if (is_callable($this->condition)) { - return call_user_func($this->condition) ? 'exclude' : ''; - } - - return $this->condition ? 'exclude' : ''; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Validation/Rules/Exists.php b/vendor/laravel/framework/src/Illuminate/Validation/Rules/Exists.php deleted file mode 100644 index e6dac83d..00000000 --- a/vendor/laravel/framework/src/Illuminate/Validation/Rules/Exists.php +++ /dev/null @@ -1,24 +0,0 @@ -table, - $this->column, - $this->formatWheres() - ), ','); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Validation/Rules/File.php b/vendor/laravel/framework/src/Illuminate/Validation/Rules/File.php deleted file mode 100644 index c97f68e4..00000000 --- a/vendor/laravel/framework/src/Illuminate/Validation/Rules/File.php +++ /dev/null @@ -1,329 +0,0 @@ - $mimetypes - * @return static - */ - public static function types($mimetypes) - { - return tap(new static(), fn ($file) => $file->allowedMimetypes = (array) $mimetypes); - } - - /** - * Indicate that the uploaded file should be exactly a certain size in kilobytes. - * - * @param int $kilobytes - * @return $this - */ - public function size($kilobytes) - { - $this->minimumFileSize = $kilobytes; - $this->maximumFileSize = $kilobytes; - - return $this; - } - - /** - * Indicate that the uploaded file should be between a minimum and maximum size in kilobytes. - * - * @param int $minKilobytes - * @param int $maxKilobytes - * @return $this - */ - public function between($minKilobytes, $maxKilobytes) - { - $this->minimumFileSize = $minKilobytes; - $this->maximumFileSize = $maxKilobytes; - - return $this; - } - - /** - * Indicate that the uploaded file should be no less than the given number of kilobytes. - * - * @param int $kilobytes - * @return $this - */ - public function min($kilobytes) - { - $this->minimumFileSize = $kilobytes; - - return $this; - } - - /** - * Indicate that the uploaded file should be no more than the given number of kilobytes. - * - * @param int $kilobytes - * @return $this - */ - public function max($kilobytes) - { - $this->maximumFileSize = $kilobytes; - - return $this; - } - - /** - * Specify additional validation rules that should be merged with the default rules during validation. - * - * @param string|array $rules - * @return $this - */ - public function rules($rules) - { - $this->customRules = array_merge($this->customRules, Arr::wrap($rules)); - - return $this; - } - - /** - * Determine if the validation rule passes. - * - * @param string $attribute - * @param mixed $value - * @return bool - */ - public function passes($attribute, $value) - { - $this->messages = []; - - $validator = Validator::make( - $this->data, - [$attribute => $this->buildValidationRules()], - $this->validator->customMessages, - $this->validator->customAttributes - ); - - if ($validator->fails()) { - return $this->fail($validator->messages()->all()); - } - - return true; - } - - /** - * Build the array of underlying validation rules based on the current state. - * - * @return array - */ - protected function buildValidationRules() - { - $rules = ['file']; - - $rules = array_merge($rules, $this->buildMimetypes()); - - $rules[] = match (true) { - is_null($this->minimumFileSize) && is_null($this->maximumFileSize) => null, - is_null($this->maximumFileSize) => "min:{$this->minimumFileSize}", - is_null($this->minimumFileSize) => "max:{$this->maximumFileSize}", - $this->minimumFileSize !== $this->maximumFileSize => "between:{$this->minimumFileSize},{$this->maximumFileSize}", - default => "size:{$this->minimumFileSize}", - }; - - return array_merge(array_filter($rules), $this->customRules); - } - - /** - * Separate the given mimetypes from extensions and return an array of correct rules to validate against. - * - * @return array - */ - protected function buildMimetypes() - { - if (count($this->allowedMimetypes) === 0) { - return []; - } - - $rules = []; - - $mimetypes = array_filter( - $this->allowedMimetypes, - fn ($type) => str_contains($type, '/') - ); - - $mimes = array_diff($this->allowedMimetypes, $mimetypes); - - if (count($mimetypes) > 0) { - $rules[] = 'mimetypes:'.implode(',', $mimetypes); - } - - if (count($mimes) > 0) { - $rules[] = 'mimes:'.implode(',', $mimes); - } - - return $rules; - } - - /** - * Adds the given failures, and return false. - * - * @param array|string $messages - * @return bool - */ - protected function fail($messages) - { - $messages = collect(Arr::wrap($messages))->map(function ($message) { - return $this->validator->getTranslator()->get($message); - })->all(); - - $this->messages = array_merge($this->messages, $messages); - - return false; - } - - /** - * Get the validation error message. - * - * @return array - */ - public function message() - { - return $this->messages; - } - - /** - * Set the current validator. - * - * @param \Illuminate\Contracts\Validation\Validator $validator - * @return $this - */ - public function setValidator($validator) - { - $this->validator = $validator; - - return $this; - } - - /** - * Set the current data under validation. - * - * @param array $data - * @return $this - */ - public function setData($data) - { - $this->data = $data; - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Validation/Rules/ImageFile.php b/vendor/laravel/framework/src/Illuminate/Validation/Rules/ImageFile.php deleted file mode 100644 index 2cee97e5..00000000 --- a/vendor/laravel/framework/src/Illuminate/Validation/Rules/ImageFile.php +++ /dev/null @@ -1,28 +0,0 @@ -rules('image'); - } - - /** - * The dimension constraints for the uploaded file. - * - * @param \Illuminate\Validation\Rules\Dimensions $dimensions - */ - public function dimensions($dimensions) - { - $this->rules($dimensions); - - return $this; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Validation/Rules/In.php b/vendor/laravel/framework/src/Illuminate/Validation/Rules/In.php deleted file mode 100644 index cc45b338..00000000 --- a/vendor/laravel/framework/src/Illuminate/Validation/Rules/In.php +++ /dev/null @@ -1,47 +0,0 @@ -values = $values; - } - - /** - * Convert the rule to a validation string. - * - * @return string - * - * @see \Illuminate\Validation\ValidationRuleParser::parseParameters - */ - public function __toString() - { - $values = array_map(function ($value) { - return '"'.str_replace('"', '""', $value).'"'; - }, $this->values); - - return $this->rule.':'.implode(',', $values); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Validation/Rules/NotIn.php b/vendor/laravel/framework/src/Illuminate/Validation/Rules/NotIn.php deleted file mode 100644 index 5701da68..00000000 --- a/vendor/laravel/framework/src/Illuminate/Validation/Rules/NotIn.php +++ /dev/null @@ -1,45 +0,0 @@ -values = $values; - } - - /** - * Convert the rule to a validation string. - * - * @return string - */ - public function __toString() - { - $values = array_map(function ($value) { - return '"'.str_replace('"', '""', $value).'"'; - }, $this->values); - - return $this->rule.':'.implode(',', $values); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Validation/Rules/Password.php b/vendor/laravel/framework/src/Illuminate/Validation/Rules/Password.php deleted file mode 100644 index fe0e1906..00000000 --- a/vendor/laravel/framework/src/Illuminate/Validation/Rules/Password.php +++ /dev/null @@ -1,395 +0,0 @@ -min = max((int) $min, 1); - } - - /** - * Set the default callback to be used for determining a password's default rules. - * - * If no arguments are passed, the default password rule configuration will be returned. - * - * @param static|callable|null $callback - * @return static|null - */ - public static function defaults($callback = null) - { - if (is_null($callback)) { - return static::default(); - } - - if (! is_callable($callback) && ! $callback instanceof static) { - throw new InvalidArgumentException('The given callback should be callable or an instance of '.static::class); - } - - static::$defaultCallback = $callback; - } - - /** - * Get the default configuration of the password rule. - * - * @return static - */ - public static function default() - { - $password = is_callable(static::$defaultCallback) - ? call_user_func(static::$defaultCallback) - : static::$defaultCallback; - - return $password instanceof Rule ? $password : static::min(8); - } - - /** - * Get the default configuration of the password rule and mark the field as required. - * - * @return array - */ - public static function required() - { - return ['required', static::default()]; - } - - /** - * Get the default configuration of the password rule and mark the field as sometimes being required. - * - * @return array - */ - public static function sometimes() - { - return ['sometimes', static::default()]; - } - - /** - * Set the performing validator. - * - * @param \Illuminate\Contracts\Validation\Validator $validator - * @return $this - */ - public function setValidator($validator) - { - $this->validator = $validator; - - return $this; - } - - /** - * Set the data under validation. - * - * @param array $data - * @return $this - */ - public function setData($data) - { - $this->data = $data; - - return $this; - } - - /** - * Sets the minimum size of the password. - * - * @param int $size - * @return $this - */ - public static function min($size) - { - return new static($size); - } - - /** - * Ensures the password has not been compromised in data leaks. - * - * @param int $threshold - * @return $this - */ - public function uncompromised($threshold = 0) - { - $this->uncompromised = true; - - $this->compromisedThreshold = $threshold; - - return $this; - } - - /** - * Makes the password require at least one uppercase and one lowercase letter. - * - * @return $this - */ - public function mixedCase() - { - $this->mixedCase = true; - - return $this; - } - - /** - * Makes the password require at least one letter. - * - * @return $this - */ - public function letters() - { - $this->letters = true; - - return $this; - } - - /** - * Makes the password require at least one number. - * - * @return $this - */ - public function numbers() - { - $this->numbers = true; - - return $this; - } - - /** - * Makes the password require at least one symbol. - * - * @return $this - */ - public function symbols() - { - $this->symbols = true; - - return $this; - } - - /** - * Specify additional validation rules that should be merged with the default rules during validation. - * - * @param string|array $rules - * @return $this - */ - public function rules($rules) - { - $this->customRules = Arr::wrap($rules); - - return $this; - } - - /** - * Determine if the validation rule passes. - * - * @param string $attribute - * @param mixed $value - * @return bool - */ - public function passes($attribute, $value) - { - $this->messages = []; - - $validator = Validator::make( - $this->data, - [$attribute => array_merge(['string', 'min:'.$this->min], $this->customRules)], - $this->validator->customMessages, - $this->validator->customAttributes - )->after(function ($validator) use ($attribute, $value) { - if (! is_string($value)) { - return; - } - - if ($this->mixedCase && ! preg_match('/(\p{Ll}+.*\p{Lu})|(\p{Lu}+.*\p{Ll})/u', $value)) { - $validator->errors()->add( - $attribute, - $this->getErrorMessage('validation.password.mixed') - ); - } - - if ($this->letters && ! preg_match('/\pL/u', $value)) { - $validator->errors()->add( - $attribute, - $this->getErrorMessage('validation.password.letters') - ); - } - - if ($this->symbols && ! preg_match('/\p{Z}|\p{S}|\p{P}/u', $value)) { - $validator->errors()->add( - $attribute, - $this->getErrorMessage('validation.password.symbols') - ); - } - - if ($this->numbers && ! preg_match('/\pN/u', $value)) { - $validator->errors()->add( - $attribute, - $this->getErrorMessage('validation.password.numbers') - ); - } - }); - - if ($validator->fails()) { - return $this->fail($validator->messages()->all()); - } - - if ($this->uncompromised && ! Container::getInstance()->make(UncompromisedVerifier::class)->verify([ - 'value' => $value, - 'threshold' => $this->compromisedThreshold, - ])) { - return $this->fail($this->getErrorMessage('validation.password.uncompromised')); - } - - return true; - } - - /** - * Get the validation error message. - * - * @return array - */ - public function message() - { - return $this->messages; - } - - /** - * Get the translated password error message. - * - * @param string $key - * @return string - */ - protected function getErrorMessage($key) - { - if (($message = $this->validator->getTranslator()->get($key)) !== $key) { - return $message; - } - - $messages = [ - 'validation.password.mixed' => 'The :attribute must contain at least one uppercase and one lowercase letter.', - 'validation.password.letters' => 'The :attribute must contain at least one letter.', - 'validation.password.symbols' => 'The :attribute must contain at least one symbol.', - 'validation.password.numbers' => 'The :attribute must contain at least one number.', - 'validation.password.uncompromised' => 'The given :attribute has appeared in a data leak. Please choose a different :attribute.', - ]; - - return $messages[$key]; - } - - /** - * Adds the given failures, and return false. - * - * @param array|string $messages - * @return bool - */ - protected function fail($messages) - { - $messages = collect(Arr::wrap($messages))->map(function ($message) { - return $this->validator->getTranslator()->get($message); - })->all(); - - $this->messages = array_merge($this->messages, $messages); - - return false; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Validation/Rules/ProhibitedIf.php b/vendor/laravel/framework/src/Illuminate/Validation/Rules/ProhibitedIf.php deleted file mode 100644 index fdc35cda..00000000 --- a/vendor/laravel/framework/src/Illuminate/Validation/Rules/ProhibitedIf.php +++ /dev/null @@ -1,47 +0,0 @@ -condition = $condition; - } else { - throw new InvalidArgumentException('The provided condition must be a callable or boolean.'); - } - } - - /** - * Convert the rule to a validation string. - * - * @return string - */ - public function __toString() - { - if (is_callable($this->condition)) { - return call_user_func($this->condition) ? 'prohibited' : ''; - } - - return $this->condition ? 'prohibited' : ''; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Validation/Rules/RequiredIf.php b/vendor/laravel/framework/src/Illuminate/Validation/Rules/RequiredIf.php deleted file mode 100644 index a1ab7491..00000000 --- a/vendor/laravel/framework/src/Illuminate/Validation/Rules/RequiredIf.php +++ /dev/null @@ -1,44 +0,0 @@ -condition = $condition; - } else { - throw new InvalidArgumentException('The provided condition must be a callable or boolean.'); - } - } - - /** - * Convert the rule to a validation string. - * - * @return string - */ - public function __toString() - { - if (is_callable($this->condition)) { - return call_user_func($this->condition) ? 'required' : ''; - } - - return $this->condition ? 'required' : ''; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Validation/Rules/Unique.php b/vendor/laravel/framework/src/Illuminate/Validation/Rules/Unique.php deleted file mode 100644 index 1f4e8678..00000000 --- a/vendor/laravel/framework/src/Illuminate/Validation/Rules/Unique.php +++ /dev/null @@ -1,75 +0,0 @@ -ignoreModel($id, $idColumn); - } - - $this->ignore = $id; - $this->idColumn = $idColumn ?? 'id'; - - return $this; - } - - /** - * Ignore the given model during the unique check. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @param string|null $idColumn - * @return $this - */ - public function ignoreModel($model, $idColumn = null) - { - $this->idColumn = $idColumn ?? $model->getKeyName(); - $this->ignore = $model->{$this->idColumn}; - - return $this; - } - - /** - * Convert the rule to a validation string. - * - * @return string - */ - public function __toString() - { - return rtrim(sprintf('unique:%s,%s,%s,%s,%s', - $this->table, - $this->column, - $this->ignore ? '"'.addslashes($this->ignore).'"' : 'NULL', - $this->idColumn, - $this->formatWheres() - ), ','); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Validation/UnauthorizedException.php b/vendor/laravel/framework/src/Illuminate/Validation/UnauthorizedException.php deleted file mode 100644 index ea8a6ec0..00000000 --- a/vendor/laravel/framework/src/Illuminate/Validation/UnauthorizedException.php +++ /dev/null @@ -1,10 +0,0 @@ -prepareForValidation(); - - if (! $this->passesAuthorization()) { - $this->failedAuthorization(); - } - - $instance = $this->getValidatorInstance(); - - if ($this->isPrecognitive()) { - $instance->after(Precognition::afterValidationHook($this)); - } - - if ($instance->fails()) { - $this->failedValidation($instance); - } - - $this->passedValidation(); - } - - /** - * Prepare the data for validation. - * - * @return void - */ - protected function prepareForValidation() - { - // - } - - /** - * Get the validator instance for the request. - * - * @return \Illuminate\Validation\Validator - */ - protected function getValidatorInstance() - { - return $this->validator(); - } - - /** - * Handle a passed validation attempt. - * - * @return void - */ - protected function passedValidation() - { - // - } - - /** - * Handle a failed validation attempt. - * - * @param \Illuminate\Validation\Validator $validator - * @return void - * - * @throws \Illuminate\Validation\ValidationException - */ - protected function failedValidation(Validator $validator) - { - throw new ValidationException($validator); - } - - /** - * Determine if the request passes the authorization check. - * - * @return bool - */ - protected function passesAuthorization() - { - if (method_exists($this, 'authorize')) { - return $this->authorize(); - } - - return true; - } - - /** - * Handle a failed authorization attempt. - * - * @return void - * - * @throws \Illuminate\Validation\UnauthorizedException - */ - protected function failedAuthorization() - { - throw new UnauthorizedException; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Validation/ValidationData.php b/vendor/laravel/framework/src/Illuminate/Validation/ValidationData.php deleted file mode 100644 index 8d4962d7..00000000 --- a/vendor/laravel/framework/src/Illuminate/Validation/ValidationData.php +++ /dev/null @@ -1,112 +0,0 @@ - $value) { - if ((bool) preg_match('/^'.$pattern.'/', $key, $matches)) { - $keys[] = $matches[0]; - } - } - - $keys = array_unique($keys); - - $data = []; - - foreach ($keys as $key) { - $data[$key] = Arr::get($masterData, $key); - } - - return $data; - } - - /** - * Extract data based on the given dot-notated path. - * - * Used to extract a sub-section of the data for faster iteration. - * - * @param string $attribute - * @param array $masterData - * @return array - */ - public static function extractDataFromPath($attribute, $masterData) - { - $results = []; - - $value = Arr::get($masterData, $attribute, '__missing__'); - - if ($value !== '__missing__') { - Arr::set($results, $attribute, $value); - } - - return $results; - } - - /** - * Get the explicit part of the attribute name. - * - * E.g. 'foo.bar.*.baz' -> 'foo.bar' - * - * Allows us to not spin through all of the flattened data for some operations. - * - * @param string $attribute - * @return string - */ - public static function getLeadingExplicitAttributePath($attribute) - { - return rtrim(explode('*', $attribute)[0], '.') ?: null; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Validation/ValidationException.php b/vendor/laravel/framework/src/Illuminate/Validation/ValidationException.php deleted file mode 100644 index 31f6f1fa..00000000 --- a/vendor/laravel/framework/src/Illuminate/Validation/ValidationException.php +++ /dev/null @@ -1,163 +0,0 @@ -response = $response; - $this->errorBag = $errorBag; - $this->validator = $validator; - } - - /** - * Create a new validation exception from a plain array of messages. - * - * @param array $messages - * @return static - */ - public static function withMessages(array $messages) - { - return new static(tap(ValidatorFacade::make([], []), function ($validator) use ($messages) { - foreach ($messages as $key => $value) { - foreach (Arr::wrap($value) as $message) { - $validator->errors()->add($key, $message); - } - } - })); - } - - /** - * Create an error message summary from the validation errors. - * - * @param \Illuminate\Contracts\Validation\Validator $validator - * @return string - */ - protected static function summarize($validator) - { - $messages = $validator->errors()->all(); - - if (! count($messages) || ! is_string($messages[0])) { - return $validator->getTranslator()->get('The given data was invalid.'); - } - - $message = array_shift($messages); - - if ($count = count($messages)) { - $pluralized = $count === 1 ? 'error' : 'errors'; - - $message .= ' '.$validator->getTranslator()->get("(and :count more $pluralized)", compact('count')); - } - - return $message; - } - - /** - * Get all of the validation error messages. - * - * @return array - */ - public function errors() - { - return $this->validator->errors()->messages(); - } - - /** - * Set the HTTP status code to be used for the response. - * - * @param int $status - * @return $this - */ - public function status($status) - { - $this->status = $status; - - return $this; - } - - /** - * Set the error bag on the exception. - * - * @param string $errorBag - * @return $this - */ - public function errorBag($errorBag) - { - $this->errorBag = $errorBag; - - return $this; - } - - /** - * Set the URL to redirect to on a validation error. - * - * @param string $url - * @return $this - */ - public function redirectTo($url) - { - $this->redirectTo = $url; - - return $this; - } - - /** - * Get the underlying response instance. - * - * @return \Symfony\Component\HttpFoundation\Response|null - */ - public function getResponse() - { - return $this->response; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Validation/ValidationRuleParser.php b/vendor/laravel/framework/src/Illuminate/Validation/ValidationRuleParser.php deleted file mode 100644 index eed342bd..00000000 --- a/vendor/laravel/framework/src/Illuminate/Validation/ValidationRuleParser.php +++ /dev/null @@ -1,343 +0,0 @@ -data = $data; - } - - /** - * Parse the human-friendly rules into a full rules array for the validator. - * - * @param array $rules - * @return \stdClass - */ - public function explode($rules) - { - $this->implicitAttributes = []; - - $rules = $this->explodeRules($rules); - - return (object) [ - 'rules' => $rules, - 'implicitAttributes' => $this->implicitAttributes, - ]; - } - - /** - * Explode the rules into an array of explicit rules. - * - * @param array $rules - * @return array - */ - protected function explodeRules($rules) - { - foreach ($rules as $key => $rule) { - if (str_contains($key, '*')) { - $rules = $this->explodeWildcardRules($rules, $key, [$rule]); - - unset($rules[$key]); - } else { - $rules[$key] = $this->explodeExplicitRule($rule, $key); - } - } - - return $rules; - } - - /** - * Explode the explicit rule into an array if necessary. - * - * @param mixed $rule - * @param string $attribute - * @return array - */ - protected function explodeExplicitRule($rule, $attribute) - { - if (is_string($rule)) { - [$name] = static::parseStringRule($rule); - - return static::ruleIsRegex($name) ? [$rule] : explode('|', $rule); - } - - if (is_object($rule)) { - return Arr::wrap($this->prepareRule($rule, $attribute)); - } - - return array_map( - [$this, 'prepareRule'], - $rule, - array_fill((int) array_key_first($rule), count($rule), $attribute) - ); - } - - /** - * Prepare the given rule for the Validator. - * - * @param mixed $rule - * @param string $attribute - * @return mixed - */ - protected function prepareRule($rule, $attribute) - { - if ($rule instanceof Closure) { - $rule = new ClosureValidationRule($rule); - } - - if ($rule instanceof InvokableRule) { - $rule = InvokableValidationRule::make($rule); - } - - if (! is_object($rule) || - $rule instanceof RuleContract || - ($rule instanceof Exists && $rule->queryCallbacks()) || - ($rule instanceof Unique && $rule->queryCallbacks())) { - return $rule; - } - - if ($rule instanceof NestedRules) { - return $rule->compile( - $attribute, $this->data[$attribute] ?? null, Arr::dot($this->data) - )->rules[$attribute]; - } - - return (string) $rule; - } - - /** - * Define a set of rules that apply to each element in an array attribute. - * - * @param array $results - * @param string $attribute - * @param string|array $rules - * @return array - */ - protected function explodeWildcardRules($results, $attribute, $rules) - { - $pattern = str_replace('\*', '[^\.]*', preg_quote($attribute)); - - $data = ValidationData::initializeAndGatherData($attribute, $this->data); - - foreach ($data as $key => $value) { - if (Str::startsWith($key, $attribute) || (bool) preg_match('/^'.$pattern.'\z/', $key)) { - foreach ((array) $rules as $rule) { - if ($rule instanceof NestedRules) { - $compiled = $rule->compile($key, $value, $data); - - $this->implicitAttributes = array_merge_recursive( - $compiled->implicitAttributes, - $this->implicitAttributes, - [$attribute => [$key]] - ); - - $results = $this->mergeRules($results, $compiled->rules); - } else { - $this->implicitAttributes[$attribute][] = $key; - - $results = $this->mergeRules($results, $key, $rule); - } - } - } - } - - return $results; - } - - /** - * Merge additional rules into a given attribute(s). - * - * @param array $results - * @param string|array $attribute - * @param string|array $rules - * @return array - */ - public function mergeRules($results, $attribute, $rules = []) - { - if (is_array($attribute)) { - foreach ((array) $attribute as $innerAttribute => $innerRules) { - $results = $this->mergeRulesForAttribute($results, $innerAttribute, $innerRules); - } - - return $results; - } - - return $this->mergeRulesForAttribute( - $results, $attribute, $rules - ); - } - - /** - * Merge additional rules into a given attribute. - * - * @param array $results - * @param string $attribute - * @param string|array $rules - * @return array - */ - protected function mergeRulesForAttribute($results, $attribute, $rules) - { - $merge = head($this->explodeRules([$rules])); - - $results[$attribute] = array_merge( - isset($results[$attribute]) ? $this->explodeExplicitRule($results[$attribute], $attribute) : [], $merge - ); - - return $results; - } - - /** - * Extract the rule name and parameters from a rule. - * - * @param array|string $rule - * @return array - */ - public static function parse($rule) - { - if ($rule instanceof RuleContract || $rule instanceof NestedRules) { - return [$rule, []]; - } - - if (is_array($rule)) { - $rule = static::parseArrayRule($rule); - } else { - $rule = static::parseStringRule($rule); - } - - $rule[0] = static::normalizeRule($rule[0]); - - return $rule; - } - - /** - * Parse an array based rule. - * - * @param array $rule - * @return array - */ - protected static function parseArrayRule(array $rule) - { - return [Str::studly(trim(Arr::get($rule, 0, ''))), array_slice($rule, 1)]; - } - - /** - * Parse a string based rule. - * - * @param string $rule - * @return array - */ - protected static function parseStringRule($rule) - { - $parameters = []; - - // The format for specifying validation rules and parameters follows an - // easy {rule}:{parameters} formatting convention. For instance the - // rule "Max:3" states that the value may only be three letters. - if (str_contains($rule, ':')) { - [$rule, $parameter] = explode(':', $rule, 2); - - $parameters = static::parseParameters($rule, $parameter); - } - - return [Str::studly(trim($rule)), $parameters]; - } - - /** - * Parse a parameter list. - * - * @param string $rule - * @param string $parameter - * @return array - */ - protected static function parseParameters($rule, $parameter) - { - return static::ruleIsRegex($rule) ? [$parameter] : str_getcsv($parameter); - } - - /** - * Determine if the rule is a regular expression. - * - * @param string $rule - * @return bool - */ - protected static function ruleIsRegex($rule) - { - return in_array(strtolower($rule), ['regex', 'not_regex', 'notregex'], true); - } - - /** - * Normalizes a rule so that we can accept short types. - * - * @param string $rule - * @return string - */ - protected static function normalizeRule($rule) - { - return match ($rule) { - 'Int' => 'Integer', - 'Bool' => 'Boolean', - default => $rule, - }; - } - - /** - * Expand and conditional rules in the given array of rules. - * - * @param array $rules - * @param array $data - * @return array - */ - public static function filterConditionalRules($rules, array $data = []) - { - return collect($rules)->mapWithKeys(function ($attributeRules, $attribute) use ($data) { - if (! is_array($attributeRules) && - ! $attributeRules instanceof ConditionalRules) { - return [$attribute => $attributeRules]; - } - - if ($attributeRules instanceof ConditionalRules) { - return [$attribute => $attributeRules->passes($data) - ? array_filter($attributeRules->rules($data)) - : array_filter($attributeRules->defaultRules($data)), ]; - } - - return [$attribute => collect($attributeRules)->map(function ($rule) use ($data) { - if (! $rule instanceof ConditionalRules) { - return [$rule]; - } - - return $rule->passes($data) ? $rule->rules($data) : $rule->defaultRules($data); - })->filter()->flatten(1)->values()->all()]; - })->all(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Validation/ValidationServiceProvider.php b/vendor/laravel/framework/src/Illuminate/Validation/ValidationServiceProvider.php deleted file mode 100755 index 936235f9..00000000 --- a/vendor/laravel/framework/src/Illuminate/Validation/ValidationServiceProvider.php +++ /dev/null @@ -1,80 +0,0 @@ -registerPresenceVerifier(); - $this->registerUncompromisedVerifier(); - $this->registerValidationFactory(); - } - - /** - * Register the validation factory. - * - * @return void - */ - protected function registerValidationFactory() - { - $this->app->singleton('validator', function ($app) { - $validator = new Factory($app['translator'], $app); - - // The validation presence verifier is responsible for determining the existence of - // values in a given data collection which is typically a relational database or - // other persistent data stores. It is used to check for "uniqueness" as well. - if (isset($app['db'], $app['validation.presence'])) { - $validator->setPresenceVerifier($app['validation.presence']); - } - - return $validator; - }); - } - - /** - * Register the database presence verifier. - * - * @return void - */ - protected function registerPresenceVerifier() - { - $this->app->singleton('validation.presence', function ($app) { - return new DatabasePresenceVerifier($app['db']); - }); - } - - /** - * Register the uncompromised password verifier. - * - * @return void - */ - protected function registerUncompromisedVerifier() - { - $this->app->singleton(UncompromisedVerifier::class, function ($app) { - return new NotPwnedVerifier($app[HttpFactory::class]); - }); - } - - /** - * Get the services provided by the provider. - * - * @return array - */ - public function provides() - { - return [ - 'validator', 'validation.presence', - ]; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Validation/Validator.php b/vendor/laravel/framework/src/Illuminate/Validation/Validator.php deleted file mode 100755 index d1a6c4ab..00000000 --- a/vendor/laravel/framework/src/Illuminate/Validation/Validator.php +++ /dev/null @@ -1,1540 +0,0 @@ -dotPlaceholder = Str::random(); - - $this->initialRules = $rules; - $this->translator = $translator; - $this->customMessages = $messages; - $this->data = $this->parseData($data); - $this->customAttributes = $customAttributes; - - $this->setRules($rules); - } - - /** - * Parse the data array, converting dots and asterisks. - * - * @param array $data - * @return array - */ - public function parseData(array $data) - { - $newData = []; - - foreach ($data as $key => $value) { - if (is_array($value)) { - $value = $this->parseData($value); - } - - $key = str_replace( - ['.', '*'], - [$this->dotPlaceholder, '__asterisk__'], - $key - ); - - $newData[$key] = $value; - } - - return $newData; - } - - /** - * Replace the placeholders used in data keys. - * - * @param array $data - * @return array - */ - protected function replacePlaceholders($data) - { - $originalData = []; - - foreach ($data as $key => $value) { - $originalData[$this->replacePlaceholderInString($key)] = is_array($value) - ? $this->replacePlaceholders($value) - : $value; - } - - return $originalData; - } - - /** - * Replace the placeholders in the given string. - * - * @param string $value - * @return string - */ - protected function replacePlaceholderInString(string $value) - { - return str_replace( - [$this->dotPlaceholder, '__asterisk__'], - ['.', '*'], - $value - ); - } - - /** - * Add an after validation callback. - * - * @param callable|string $callback - * @return $this - */ - public function after($callback) - { - $this->after[] = fn () => $callback($this); - - return $this; - } - - /** - * Determine if the data passes the validation rules. - * - * @return bool - */ - public function passes() - { - $this->messages = new MessageBag; - - [$this->distinctValues, $this->failedRules] = [[], []]; - - // We'll spin through each rule, validating the attributes attached to that - // rule. Any error messages will be added to the containers with each of - // the other error messages, returning true if we don't have messages. - foreach ($this->rules as $attribute => $rules) { - if ($this->shouldBeExcluded($attribute)) { - $this->removeAttribute($attribute); - - continue; - } - - if ($this->stopOnFirstFailure && $this->messages->isNotEmpty()) { - break; - } - - foreach ($rules as $rule) { - $this->validateAttribute($attribute, $rule); - - if ($this->shouldBeExcluded($attribute)) { - $this->removeAttribute($attribute); - - break; - } - - if ($this->shouldStopValidating($attribute)) { - break; - } - } - } - - // Here we will spin through all of the "after" hooks on this validator and - // fire them off. This gives the callbacks a chance to perform all kinds - // of other validation that needs to get wrapped up in this operation. - foreach ($this->after as $after) { - $after(); - } - - return $this->messages->isEmpty(); - } - - /** - * Determine if the data fails the validation rules. - * - * @return bool - */ - public function fails() - { - return ! $this->passes(); - } - - /** - * Determine if the attribute should be excluded. - * - * @param string $attribute - * @return bool - */ - protected function shouldBeExcluded($attribute) - { - foreach ($this->excludeAttributes as $excludeAttribute) { - if ($attribute === $excludeAttribute || - Str::startsWith($attribute, $excludeAttribute.'.')) { - return true; - } - } - - return false; - } - - /** - * Remove the given attribute. - * - * @param string $attribute - * @return void - */ - protected function removeAttribute($attribute) - { - Arr::forget($this->data, $attribute); - Arr::forget($this->rules, $attribute); - } - - /** - * Run the validator's rules against its data. - * - * @return array - * - * @throws \Illuminate\Validation\ValidationException - */ - public function validate() - { - throw_if($this->fails(), $this->exception, $this); - - return $this->validated(); - } - - /** - * Run the validator's rules against its data. - * - * @param string $errorBag - * @return array - * - * @throws \Illuminate\Validation\ValidationException - */ - public function validateWithBag(string $errorBag) - { - try { - return $this->validate(); - } catch (ValidationException $e) { - $e->errorBag = $errorBag; - - throw $e; - } - } - - /** - * Get a validated input container for the validated input. - * - * @param array|null $keys - * @return \Illuminate\Support\ValidatedInput|array - */ - public function safe(array $keys = null) - { - return is_array($keys) - ? (new ValidatedInput($this->validated()))->only($keys) - : new ValidatedInput($this->validated()); - } - - /** - * Get the attributes and values that were validated. - * - * @return array - * - * @throws \Illuminate\Validation\ValidationException - */ - public function validated() - { - throw_if($this->invalid(), $this->exception, $this); - - $results = []; - - $missingValue = new stdClass; - - foreach ($this->getRules() as $key => $rules) { - if ($this->excludeUnvalidatedArrayKeys && - in_array('array', $rules) && - ! empty(preg_grep('/^'.preg_quote($key, '/').'\.+/', array_keys($this->getRules())))) { - continue; - } - - $value = data_get($this->getData(), $key, $missingValue); - - if ($value !== $missingValue) { - Arr::set($results, $key, $value); - } - } - - return $this->replacePlaceholders($results); - } - - /** - * Validate a given attribute against a rule. - * - * @param string $attribute - * @param string $rule - * @return void - */ - protected function validateAttribute($attribute, $rule) - { - $this->currentRule = $rule; - - [$rule, $parameters] = ValidationRuleParser::parse($rule); - - if ($rule === '') { - return; - } - - // First we will get the correct keys for the given attribute in case the field is nested in - // an array. Then we determine if the given rule accepts other field names as parameters. - // If so, we will replace any asterisks found in the parameters with the correct keys. - if ($this->dependsOnOtherFields($rule)) { - $parameters = $this->replaceDotInParameters($parameters); - - if ($keys = $this->getExplicitKeys($attribute)) { - $parameters = $this->replaceAsterisksInParameters($parameters, $keys); - } - } - - $value = $this->getValue($attribute); - - // If the attribute is a file, we will verify that the file upload was actually successful - // and if it wasn't we will add a failure for the attribute. Files may not successfully - // upload if they are too large based on PHP's settings so we will bail in this case. - if ($value instanceof UploadedFile && ! $value->isValid() && - $this->hasRule($attribute, array_merge($this->fileRules, $this->implicitRules)) - ) { - return $this->addFailure($attribute, 'uploaded', []); - } - - // If we have made it this far we will make sure the attribute is validatable and if it is - // we will call the validation method with the attribute. If a method returns false the - // attribute is invalid and we will add a failure message for this failing attribute. - $validatable = $this->isValidatable($rule, $attribute, $value); - - if ($rule instanceof RuleContract) { - return $validatable - ? $this->validateUsingCustomRule($attribute, $value, $rule) - : null; - } - - $method = "validate{$rule}"; - - if ($validatable && ! $this->$method($attribute, $value, $parameters, $this)) { - $this->addFailure($attribute, $rule, $parameters); - } - } - - /** - * Determine if the given rule depends on other fields. - * - * @param string $rule - * @return bool - */ - protected function dependsOnOtherFields($rule) - { - return in_array($rule, $this->dependentRules); - } - - /** - * Get the explicit keys from an attribute flattened with dot notation. - * - * E.g. 'foo.1.bar.spark.baz' -> [1, 'spark'] for 'foo.*.bar.*.baz' - * - * @param string $attribute - * @return array - */ - protected function getExplicitKeys($attribute) - { - $pattern = str_replace('\*', '([^\.]+)', preg_quote($this->getPrimaryAttribute($attribute), '/')); - - if (preg_match('/^'.$pattern.'/', $attribute, $keys)) { - array_shift($keys); - - return $keys; - } - - return []; - } - - /** - * Get the primary attribute name. - * - * For example, if "name.0" is given, "name.*" will be returned. - * - * @param string $attribute - * @return string - */ - protected function getPrimaryAttribute($attribute) - { - foreach ($this->implicitAttributes as $unparsed => $parsed) { - if (in_array($attribute, $parsed, true)) { - return $unparsed; - } - } - - return $attribute; - } - - /** - * Replace each field parameter which has an escaped dot with the dot placeholder. - * - * @param array $parameters - * @return array - */ - protected function replaceDotInParameters(array $parameters) - { - return array_map(function ($field) { - return str_replace('\.', $this->dotPlaceholder, $field); - }, $parameters); - } - - /** - * Replace each field parameter which has asterisks with the given keys. - * - * @param array $parameters - * @param array $keys - * @return array - */ - protected function replaceAsterisksInParameters(array $parameters, array $keys) - { - return array_map(function ($field) use ($keys) { - return vsprintf(str_replace('*', '%s', $field), $keys); - }, $parameters); - } - - /** - * Determine if the attribute is validatable. - * - * @param object|string $rule - * @param string $attribute - * @param mixed $value - * @return bool - */ - protected function isValidatable($rule, $attribute, $value) - { - if (in_array($rule, $this->excludeRules)) { - return true; - } - - return $this->presentOrRuleIsImplicit($rule, $attribute, $value) && - $this->passesOptionalCheck($attribute) && - $this->isNotNullIfMarkedAsNullable($rule, $attribute) && - $this->hasNotFailedPreviousRuleIfPresenceRule($rule, $attribute); - } - - /** - * Determine if the field is present, or the rule implies required. - * - * @param object|string $rule - * @param string $attribute - * @param mixed $value - * @return bool - */ - protected function presentOrRuleIsImplicit($rule, $attribute, $value) - { - if (is_string($value) && trim($value) === '') { - return $this->isImplicit($rule); - } - - return $this->validatePresent($attribute, $value) || - $this->isImplicit($rule); - } - - /** - * Determine if a given rule implies the attribute is required. - * - * @param object|string $rule - * @return bool - */ - protected function isImplicit($rule) - { - return $rule instanceof ImplicitRule || - in_array($rule, $this->implicitRules); - } - - /** - * Determine if the attribute passes any optional check. - * - * @param string $attribute - * @return bool - */ - protected function passesOptionalCheck($attribute) - { - if (! $this->hasRule($attribute, ['Sometimes'])) { - return true; - } - - $data = ValidationData::initializeAndGatherData($attribute, $this->data); - - return array_key_exists($attribute, $data) - || array_key_exists($attribute, $this->data); - } - - /** - * Determine if the attribute fails the nullable check. - * - * @param string $rule - * @param string $attribute - * @return bool - */ - protected function isNotNullIfMarkedAsNullable($rule, $attribute) - { - if ($this->isImplicit($rule) || ! $this->hasRule($attribute, ['Nullable'])) { - return true; - } - - return ! is_null(Arr::get($this->data, $attribute, 0)); - } - - /** - * Determine if it's a necessary presence validation. - * - * This is to avoid possible database type comparison errors. - * - * @param string $rule - * @param string $attribute - * @return bool - */ - protected function hasNotFailedPreviousRuleIfPresenceRule($rule, $attribute) - { - return in_array($rule, ['Unique', 'Exists']) ? ! $this->messages->has($attribute) : true; - } - - /** - * Validate an attribute using a custom rule object. - * - * @param string $attribute - * @param mixed $value - * @param \Illuminate\Contracts\Validation\Rule $rule - * @return void - */ - protected function validateUsingCustomRule($attribute, $value, $rule) - { - $attribute = $this->replacePlaceholderInString($attribute); - - $value = is_array($value) ? $this->replacePlaceholders($value) : $value; - - if ($rule instanceof ValidatorAwareRule) { - $rule->setValidator($this); - } - - if ($rule instanceof DataAwareRule) { - $rule->setData($this->data); - } - - if (! $rule->passes($attribute, $value)) { - $ruleClass = $rule instanceof InvokableValidationRule ? - get_class($rule->invokable()) : - get_class($rule); - - $this->failedRules[$attribute][$ruleClass] = []; - - $messages = $this->getFromLocalArray($attribute, $ruleClass) ?? $rule->message(); - - $messages = $messages ? (array) $messages : [$ruleClass]; - - foreach ($messages as $key => $message) { - $key = is_string($key) ? $key : $attribute; - - $this->messages->add($key, $this->makeReplacements( - $message, $key, $ruleClass, [] - )); - } - } - } - - /** - * Check if we should stop further validations on a given attribute. - * - * @param string $attribute - * @return bool - */ - protected function shouldStopValidating($attribute) - { - $cleanedAttribute = $this->replacePlaceholderInString($attribute); - - if ($this->hasRule($attribute, ['Bail'])) { - return $this->messages->has($cleanedAttribute); - } - - if (isset($this->failedRules[$cleanedAttribute]) && - array_key_exists('uploaded', $this->failedRules[$cleanedAttribute])) { - return true; - } - - // In case the attribute has any rule that indicates that the field is required - // and that rule already failed then we should stop validation at this point - // as now there is no point in calling other rules with this field empty. - return $this->hasRule($attribute, $this->implicitRules) && - isset($this->failedRules[$cleanedAttribute]) && - array_intersect(array_keys($this->failedRules[$cleanedAttribute]), $this->implicitRules); - } - - /** - * Add a failed rule and error message to the collection. - * - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return void - */ - public function addFailure($attribute, $rule, $parameters = []) - { - if (! $this->messages) { - $this->passes(); - } - - $attributeWithPlaceholders = $attribute; - - $attribute = $this->replacePlaceholderInString($attribute); - - if (in_array($rule, $this->excludeRules)) { - return $this->excludeAttribute($attribute); - } - - $this->messages->add($attribute, $this->makeReplacements( - $this->getMessage($attributeWithPlaceholders, $rule), $attribute, $rule, $parameters - )); - - $this->failedRules[$attribute][$rule] = $parameters; - } - - /** - * Add the given attribute to the list of excluded attributes. - * - * @param string $attribute - * @return void - */ - protected function excludeAttribute(string $attribute) - { - $this->excludeAttributes[] = $attribute; - - $this->excludeAttributes = array_unique($this->excludeAttributes); - } - - /** - * Returns the data which was valid. - * - * @return array - */ - public function valid() - { - if (! $this->messages) { - $this->passes(); - } - - return array_diff_key( - $this->data, $this->attributesThatHaveMessages() - ); - } - - /** - * Returns the data which was invalid. - * - * @return array - */ - public function invalid() - { - if (! $this->messages) { - $this->passes(); - } - - $invalid = array_intersect_key( - $this->data, $this->attributesThatHaveMessages() - ); - - $result = []; - - $failed = Arr::only(Arr::dot($invalid), array_keys($this->failed())); - - foreach ($failed as $key => $failure) { - Arr::set($result, $key, $failure); - } - - return $result; - } - - /** - * Generate an array of all attributes that have messages. - * - * @return array - */ - protected function attributesThatHaveMessages() - { - return collect($this->messages()->toArray())->map(function ($message, $key) { - return explode('.', $key)[0]; - })->unique()->flip()->all(); - } - - /** - * Get the failed validation rules. - * - * @return array - */ - public function failed() - { - return $this->failedRules; - } - - /** - * Get the message container for the validator. - * - * @return \Illuminate\Support\MessageBag - */ - public function messages() - { - if (! $this->messages) { - $this->passes(); - } - - return $this->messages; - } - - /** - * An alternative more semantic shortcut to the message container. - * - * @return \Illuminate\Support\MessageBag - */ - public function errors() - { - return $this->messages(); - } - - /** - * Get the messages for the instance. - * - * @return \Illuminate\Support\MessageBag - */ - public function getMessageBag() - { - return $this->messages(); - } - - /** - * Determine if the given attribute has a rule in the given set. - * - * @param string $attribute - * @param string|array $rules - * @return bool - */ - public function hasRule($attribute, $rules) - { - return ! is_null($this->getRule($attribute, $rules)); - } - - /** - * Get a rule and its parameters for a given attribute. - * - * @param string $attribute - * @param string|array $rules - * @return array|null - */ - protected function getRule($attribute, $rules) - { - if (! array_key_exists($attribute, $this->rules)) { - return; - } - - $rules = (array) $rules; - - foreach ($this->rules[$attribute] as $rule) { - [$rule, $parameters] = ValidationRuleParser::parse($rule); - - if (in_array($rule, $rules)) { - return [$rule, $parameters]; - } - } - } - - /** - * Get the data under validation. - * - * @return array - */ - public function attributes() - { - return $this->getData(); - } - - /** - * Get the data under validation. - * - * @return array - */ - public function getData() - { - return $this->data; - } - - /** - * Set the data under validation. - * - * @param array $data - * @return $this - */ - public function setData(array $data) - { - $this->data = $this->parseData($data); - - $this->setRules($this->initialRules); - - return $this; - } - - /** - * Get the value of a given attribute. - * - * @param string $attribute - * @return mixed - */ - protected function getValue($attribute) - { - return Arr::get($this->data, $attribute); - } - - /** - * Get the validation rules. - * - * @return array - */ - public function getRules() - { - return $this->rules; - } - - /** - * Set the validation rules. - * - * @param array $rules - * @return $this - */ - public function setRules(array $rules) - { - $rules = collect($rules)->mapWithKeys(function ($value, $key) { - return [str_replace('\.', $this->dotPlaceholder, $key) => $value]; - })->toArray(); - - $this->initialRules = $rules; - - $this->rules = []; - - $this->addRules($rules); - - return $this; - } - - /** - * Parse the given rules and merge them into current rules. - * - * @param array $rules - * @return void - */ - public function addRules($rules) - { - // The primary purpose of this parser is to expand any "*" rules to the all - // of the explicit rules needed for the given data. For example the rule - // names.* would get expanded to names.0, names.1, etc. for this data. - $response = (new ValidationRuleParser($this->data)) - ->explode(ValidationRuleParser::filterConditionalRules($rules, $this->data)); - - $this->rules = array_merge_recursive( - $this->rules, $response->rules - ); - - $this->implicitAttributes = array_merge( - $this->implicitAttributes, $response->implicitAttributes - ); - } - - /** - * Add conditions to a given field based on a Closure. - * - * @param string|array $attribute - * @param string|array $rules - * @param callable $callback - * @return $this - */ - public function sometimes($attribute, $rules, callable $callback) - { - $payload = new Fluent($this->data); - - foreach ((array) $attribute as $key) { - $response = (new ValidationRuleParser($this->data))->explode([$key => $rules]); - - $this->implicitAttributes = array_merge($response->implicitAttributes, $this->implicitAttributes); - - foreach ($response->rules as $ruleKey => $ruleValue) { - if ($callback($payload, $this->dataForSometimesIteration($ruleKey, ! str_ends_with($key, '.*')))) { - $this->addRules([$ruleKey => $ruleValue]); - } - } - } - - return $this; - } - - /** - * Get the data that should be injected into the iteration of a wildcard "sometimes" callback. - * - * @param string $attribute - * @return \Illuminate\Support\Fluent|array|mixed - */ - private function dataForSometimesIteration(string $attribute, $removeLastSegmentOfAttribute) - { - $lastSegmentOfAttribute = strrchr($attribute, '.'); - - $attribute = $lastSegmentOfAttribute && $removeLastSegmentOfAttribute - ? Str::replaceLast($lastSegmentOfAttribute, '', $attribute) - : $attribute; - - return is_array($data = data_get($this->data, $attribute)) - ? new Fluent($data) - : $data; - } - - /** - * Instruct the validator to stop validating after the first rule failure. - * - * @param bool $stopOnFirstFailure - * @return $this - */ - public function stopOnFirstFailure($stopOnFirstFailure = true) - { - $this->stopOnFirstFailure = $stopOnFirstFailure; - - return $this; - } - - /** - * Register an array of custom validator extensions. - * - * @param array $extensions - * @return void - */ - public function addExtensions(array $extensions) - { - if ($extensions) { - $keys = array_map([Str::class, 'snake'], array_keys($extensions)); - - $extensions = array_combine($keys, array_values($extensions)); - } - - $this->extensions = array_merge($this->extensions, $extensions); - } - - /** - * Register an array of custom implicit validator extensions. - * - * @param array $extensions - * @return void - */ - public function addImplicitExtensions(array $extensions) - { - $this->addExtensions($extensions); - - foreach ($extensions as $rule => $extension) { - $this->implicitRules[] = Str::studly($rule); - } - } - - /** - * Register an array of custom dependent validator extensions. - * - * @param array $extensions - * @return void - */ - public function addDependentExtensions(array $extensions) - { - $this->addExtensions($extensions); - - foreach ($extensions as $rule => $extension) { - $this->dependentRules[] = Str::studly($rule); - } - } - - /** - * Register a custom validator extension. - * - * @param string $rule - * @param \Closure|string $extension - * @return void - */ - public function addExtension($rule, $extension) - { - $this->extensions[Str::snake($rule)] = $extension; - } - - /** - * Register a custom implicit validator extension. - * - * @param string $rule - * @param \Closure|string $extension - * @return void - */ - public function addImplicitExtension($rule, $extension) - { - $this->addExtension($rule, $extension); - - $this->implicitRules[] = Str::studly($rule); - } - - /** - * Register a custom dependent validator extension. - * - * @param string $rule - * @param \Closure|string $extension - * @return void - */ - public function addDependentExtension($rule, $extension) - { - $this->addExtension($rule, $extension); - - $this->dependentRules[] = Str::studly($rule); - } - - /** - * Register an array of custom validator message replacers. - * - * @param array $replacers - * @return void - */ - public function addReplacers(array $replacers) - { - if ($replacers) { - $keys = array_map([Str::class, 'snake'], array_keys($replacers)); - - $replacers = array_combine($keys, array_values($replacers)); - } - - $this->replacers = array_merge($this->replacers, $replacers); - } - - /** - * Register a custom validator message replacer. - * - * @param string $rule - * @param \Closure|string $replacer - * @return void - */ - public function addReplacer($rule, $replacer) - { - $this->replacers[Str::snake($rule)] = $replacer; - } - - /** - * Set the custom messages for the validator. - * - * @param array $messages - * @return $this - */ - public function setCustomMessages(array $messages) - { - $this->customMessages = array_merge($this->customMessages, $messages); - - return $this; - } - - /** - * Set the custom attributes on the validator. - * - * @param array $attributes - * @return $this - */ - public function setAttributeNames(array $attributes) - { - $this->customAttributes = $attributes; - - return $this; - } - - /** - * Add custom attributes to the validator. - * - * @param array $customAttributes - * @return $this - */ - public function addCustomAttributes(array $customAttributes) - { - $this->customAttributes = array_merge($this->customAttributes, $customAttributes); - - return $this; - } - - /** - * Set the callback that used to format an implicit attribute. - * - * @param callable|null $formatter - * @return $this - */ - public function setImplicitAttributesFormatter(callable $formatter = null) - { - $this->implicitAttributesFormatter = $formatter; - - return $this; - } - - /** - * Set the custom values on the validator. - * - * @param array $values - * @return $this - */ - public function setValueNames(array $values) - { - $this->customValues = $values; - - return $this; - } - - /** - * Add the custom values for the validator. - * - * @param array $customValues - * @return $this - */ - public function addCustomValues(array $customValues) - { - $this->customValues = array_merge($this->customValues, $customValues); - - return $this; - } - - /** - * Set the fallback messages for the validator. - * - * @param array $messages - * @return void - */ - public function setFallbackMessages(array $messages) - { - $this->fallbackMessages = $messages; - } - - /** - * Get the Presence Verifier implementation. - * - * @param string|null $connection - * @return \Illuminate\Validation\PresenceVerifierInterface - * - * @throws \RuntimeException - */ - public function getPresenceVerifier($connection = null) - { - if (! isset($this->presenceVerifier)) { - throw new RuntimeException('Presence verifier has not been set.'); - } - - if ($this->presenceVerifier instanceof DatabasePresenceVerifierInterface) { - $this->presenceVerifier->setConnection($connection); - } - - return $this->presenceVerifier; - } - - /** - * Set the Presence Verifier implementation. - * - * @param \Illuminate\Validation\PresenceVerifierInterface $presenceVerifier - * @return void - */ - public function setPresenceVerifier(PresenceVerifierInterface $presenceVerifier) - { - $this->presenceVerifier = $presenceVerifier; - } - - /** - * Set the exception to throw upon failed validation. - * - * @param string $exception - * @return $this - * - * @throws \InvalidArgumentException - */ - public function setException($exception) - { - if (! is_a($exception, ValidationException::class, true)) { - throw new InvalidArgumentException( - sprintf('Exception [%s] is invalid. It must extend [%s].', $exception, ValidationException::class) - ); - } - - $this->exception = $exception; - - return $this; - } - - /** - * Get the Translator implementation. - * - * @return \Illuminate\Contracts\Translation\Translator - */ - public function getTranslator() - { - return $this->translator; - } - - /** - * Set the Translator implementation. - * - * @param \Illuminate\Contracts\Translation\Translator $translator - * @return void - */ - public function setTranslator(Translator $translator) - { - $this->translator = $translator; - } - - /** - * Set the IoC container instance. - * - * @param \Illuminate\Contracts\Container\Container $container - * @return void - */ - public function setContainer(Container $container) - { - $this->container = $container; - } - - /** - * Call a custom validator extension. - * - * @param string $rule - * @param array $parameters - * @return bool|null - */ - protected function callExtension($rule, $parameters) - { - $callback = $this->extensions[$rule]; - - if (is_callable($callback)) { - return $callback(...array_values($parameters)); - } elseif (is_string($callback)) { - return $this->callClassBasedExtension($callback, $parameters); - } - } - - /** - * Call a class based validator extension. - * - * @param string $callback - * @param array $parameters - * @return bool - */ - protected function callClassBasedExtension($callback, $parameters) - { - [$class, $method] = Str::parseCallback($callback, 'validate'); - - return $this->container->make($class)->{$method}(...array_values($parameters)); - } - - /** - * Handle dynamic calls to class methods. - * - * @param string $method - * @param array $parameters - * @return mixed - * - * @throws \BadMethodCallException - */ - public function __call($method, $parameters) - { - $rule = Str::snake(substr($method, 8)); - - if (isset($this->extensions[$rule])) { - return $this->callExtension($rule, $parameters); - } - - throw new BadMethodCallException(sprintf( - 'Method %s::%s does not exist.', static::class, $method - )); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/Validation/composer.json b/vendor/laravel/framework/src/Illuminate/Validation/composer.json deleted file mode 100755 index 154d7278..00000000 --- a/vendor/laravel/framework/src/Illuminate/Validation/composer.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "illuminate/validation", - "description": "The Illuminate Validation package.", - "license": "MIT", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "require": { - "php": "^8.0.2", - "ext-json": "*", - "egulias/email-validator": "^3.2.1", - "illuminate/collections": "^9.0", - "illuminate/container": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0", - "illuminate/translation": "^9.0", - "symfony/http-foundation": "^6.0", - "symfony/mime": "^6.0" - }, - "autoload": { - "psr-4": { - "Illuminate\\Validation\\": "" - } - }, - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "suggest": { - "ext-bcmath": "Required to use the multiple_of validation rule.", - "illuminate/database": "Required to use the database presence verifier (^9.0)." - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev" -} diff --git a/vendor/laravel/framework/src/Illuminate/View/AnonymousComponent.php b/vendor/laravel/framework/src/Illuminate/View/AnonymousComponent.php deleted file mode 100644 index eba64365..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/AnonymousComponent.php +++ /dev/null @@ -1,60 +0,0 @@ -view = $view; - $this->data = $data; - } - - /** - * Get the view / view contents that represent the component. - * - * @return string - */ - public function render() - { - return $this->view; - } - - /** - * Get the data that should be supplied to the view. - * - * @return array - */ - public function data() - { - $this->attributes = $this->attributes ?: $this->newAttributeBag(); - - return array_merge( - ($this->data['attributes'] ?? null)?->getAttributes() ?: [], - $this->attributes->getAttributes(), - $this->data, - ['attributes' => $this->attributes] - ); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/AppendableAttributeValue.php b/vendor/laravel/framework/src/Illuminate/View/AppendableAttributeValue.php deleted file mode 100644 index f275801e..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/AppendableAttributeValue.php +++ /dev/null @@ -1,34 +0,0 @@ -value = $value; - } - - /** - * Get the string value. - * - * @return string - */ - public function __toString() - { - return (string) $this->value; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/Compilers/BladeCompiler.php b/vendor/laravel/framework/src/Illuminate/View/Compilers/BladeCompiler.php deleted file mode 100644 index a27d977d..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/Compilers/BladeCompiler.php +++ /dev/null @@ -1,904 +0,0 @@ -setPath($path); - } - - if (! is_null($this->cachePath)) { - $contents = $this->compileString($this->files->get($this->getPath())); - - if (! empty($this->getPath())) { - $contents = $this->appendFilePath($contents); - } - - $this->ensureCompiledDirectoryExists( - $compiledPath = $this->getCompiledPath($this->getPath()) - ); - - $this->files->put($compiledPath, $contents); - } - } - - /** - * Append the file path to the compiled string. - * - * @param string $contents - * @return string - */ - protected function appendFilePath($contents) - { - $tokens = $this->getOpenAndClosingPhpTokens($contents); - - if ($tokens->isNotEmpty() && $tokens->last() !== T_CLOSE_TAG) { - $contents .= ' ?>'; - } - - return $contents."getPath()} ENDPATH**/ ?>"; - } - - /** - * Get the open and closing PHP tag tokens from the given string. - * - * @param string $contents - * @return \Illuminate\Support\Collection - */ - protected function getOpenAndClosingPhpTokens($contents) - { - return collect(token_get_all($contents)) - ->pluck(0) - ->filter(function ($token) { - return in_array($token, [T_OPEN_TAG, T_OPEN_TAG_WITH_ECHO, T_CLOSE_TAG]); - }); - } - - /** - * Get the path currently being compiled. - * - * @return string - */ - public function getPath() - { - return $this->path; - } - - /** - * Set the path currently being compiled. - * - * @param string $path - * @return void - */ - public function setPath($path) - { - $this->path = $path; - } - - /** - * Compile the given Blade template contents. - * - * @param string $value - * @return string - */ - public function compileString($value) - { - [$this->footer, $result] = [[], '']; - - // First we will compile the Blade component tags. This is a precompile style - // step which compiles the component Blade tags into @component directives - // that may be used by Blade. Then we should call any other precompilers. - $value = $this->compileComponentTags( - $this->compileComments($this->storeUncompiledBlocks($value)) - ); - - foreach ($this->precompilers as $precompiler) { - $value = $precompiler($value); - } - - // Here we will loop through all of the tokens returned by the Zend lexer and - // parse each one into the corresponding valid PHP. We will then have this - // template as the correctly rendered PHP that can be rendered natively. - foreach (token_get_all($value) as $token) { - $result .= is_array($token) ? $this->parseToken($token) : $token; - } - - if (! empty($this->rawBlocks)) { - $result = $this->restoreRawContent($result); - } - - // If there are any footer lines that need to get added to a template we will - // add them here at the end of the template. This gets used mainly for the - // template inheritance via the extends keyword that should be appended. - if (count($this->footer) > 0) { - $result = $this->addFooters($result); - } - - if (! empty($this->echoHandlers)) { - $result = $this->addBladeCompilerVariable($result); - } - - return str_replace( - ['##BEGIN-COMPONENT-CLASS##', '##END-COMPONENT-CLASS##'], - '', - $result); - } - - /** - * Evaluate and render a Blade string to HTML. - * - * @param string $string - * @param array $data - * @param bool $deleteCachedView - * @return string - */ - public static function render($string, $data = [], $deleteCachedView = false) - { - $component = new class($string) extends Component - { - protected $template; - - public function __construct($template) - { - $this->template = $template; - } - - public function render() - { - return $this->template; - } - }; - - $view = Container::getInstance() - ->make(ViewFactory::class) - ->make($component->resolveView(), $data); - - return tap($view->render(), function () use ($view, $deleteCachedView) { - if ($deleteCachedView) { - unlink($view->getPath()); - } - }); - } - - /** - * Render a component instance to HTML. - * - * @param \Illuminate\View\Component $component - * @return string - */ - public static function renderComponent(Component $component) - { - $data = $component->data(); - - $view = value($component->resolveView(), $data); - - if ($view instanceof View) { - return $view->with($data)->render(); - } elseif ($view instanceof Htmlable) { - return $view->toHtml(); - } else { - return Container::getInstance() - ->make(ViewFactory::class) - ->make($view, $data) - ->render(); - } - } - - /** - * Store the blocks that do not receive compilation. - * - * @param string $value - * @return string - */ - protected function storeUncompiledBlocks($value) - { - if (str_contains($value, '@verbatim')) { - $value = $this->storeVerbatimBlocks($value); - } - - if (str_contains($value, '@php')) { - $value = $this->storePhpBlocks($value); - } - - return $value; - } - - /** - * Store the verbatim blocks and replace them with a temporary placeholder. - * - * @param string $value - * @return string - */ - protected function storeVerbatimBlocks($value) - { - return preg_replace_callback('/(?storeRawBlock($matches[1]); - }, $value); - } - - /** - * Store the PHP blocks and replace them with a temporary placeholder. - * - * @param string $value - * @return string - */ - protected function storePhpBlocks($value) - { - return preg_replace_callback('/(?storeRawBlock(""); - }, $value); - } - - /** - * Store a raw block and return a unique raw placeholder. - * - * @param string $value - * @return string - */ - protected function storeRawBlock($value) - { - return $this->getRawPlaceholder( - array_push($this->rawBlocks, $value) - 1 - ); - } - - /** - * Compile the component tags. - * - * @param string $value - * @return string - */ - protected function compileComponentTags($value) - { - if (! $this->compilesComponentTags) { - return $value; - } - - return (new ComponentTagCompiler( - $this->classComponentAliases, $this->classComponentNamespaces, $this - ))->compile($value); - } - - /** - * Replace the raw placeholders with the original code stored in the raw blocks. - * - * @param string $result - * @return string - */ - protected function restoreRawContent($result) - { - $result = preg_replace_callback('/'.$this->getRawPlaceholder('(\d+)').'/', function ($matches) { - return $this->rawBlocks[$matches[1]]; - }, $result); - - $this->rawBlocks = []; - - return $result; - } - - /** - * Get a placeholder to temporarily mark the position of raw blocks. - * - * @param int|string $replace - * @return string - */ - protected function getRawPlaceholder($replace) - { - return str_replace('#', $replace, '@__raw_block_#__@'); - } - - /** - * Add the stored footers onto the given content. - * - * @param string $result - * @return string - */ - protected function addFooters($result) - { - return ltrim($result, "\n") - ."\n".implode("\n", array_reverse($this->footer)); - } - - /** - * Parse the tokens from the template. - * - * @param array $token - * @return string - */ - protected function parseToken($token) - { - [$id, $content] = $token; - - if ($id == T_INLINE_HTML) { - foreach ($this->compilers as $type) { - $content = $this->{"compile{$type}"}($content); - } - } - - return $content; - } - - /** - * Execute the user defined extensions. - * - * @param string $value - * @return string - */ - protected function compileExtensions($value) - { - foreach ($this->extensions as $compiler) { - $value = $compiler($value, $this); - } - - return $value; - } - - /** - * Compile Blade statements that start with "@". - * - * @param string $value - * @return string - */ - protected function compileStatements($value) - { - return preg_replace_callback( - '/\B@(@?\w+(?:::\w+)?)([ \t]*)(\( ( (?>[^()]+) | (?3) )* \))?/x', function ($match) { - return $this->compileStatement($match); - }, $value - ); - } - - /** - * Compile a single Blade @ statement. - * - * @param array $match - * @return string - */ - protected function compileStatement($match) - { - if (str_contains($match[1], '@')) { - $match[0] = isset($match[3]) ? $match[1].$match[3] : $match[1]; - } elseif (isset($this->customDirectives[$match[1]])) { - $match[0] = $this->callCustomDirective($match[1], Arr::get($match, 3)); - } elseif (method_exists($this, $method = 'compile'.ucfirst($match[1]))) { - $match[0] = $this->$method(Arr::get($match, 3)); - } else { - return $match[0]; - } - - return isset($match[3]) ? $match[0] : $match[0].$match[2]; - } - - /** - * Call the given directive with the given value. - * - * @param string $name - * @param string|null $value - * @return string - */ - protected function callCustomDirective($name, $value) - { - $value ??= ''; - - if (str_starts_with($value, '(') && str_ends_with($value, ')')) { - $value = Str::substr($value, 1, -1); - } - - return call_user_func($this->customDirectives[$name], trim($value)); - } - - /** - * Strip the parentheses from the given expression. - * - * @param string $expression - * @return string - */ - public function stripParentheses($expression) - { - if (Str::startsWith($expression, '(')) { - $expression = substr($expression, 1, -1); - } - - return $expression; - } - - /** - * Register a custom Blade compiler. - * - * @param callable $compiler - * @return void - */ - public function extend(callable $compiler) - { - $this->extensions[] = $compiler; - } - - /** - * Get the extensions used by the compiler. - * - * @return array - */ - public function getExtensions() - { - return $this->extensions; - } - - /** - * Register an "if" statement directive. - * - * @param string $name - * @param callable $callback - * @return void - */ - public function if($name, callable $callback) - { - $this->conditions[$name] = $callback; - - $this->directive($name, function ($expression) use ($name) { - return $expression !== '' - ? "" - : ""; - }); - - $this->directive('unless'.$name, function ($expression) use ($name) { - return $expression !== '' - ? "" - : ""; - }); - - $this->directive('else'.$name, function ($expression) use ($name) { - return $expression !== '' - ? "" - : ""; - }); - - $this->directive('end'.$name, function () { - return ''; - }); - } - - /** - * Check the result of a condition. - * - * @param string $name - * @param array $parameters - * @return bool - */ - public function check($name, ...$parameters) - { - return call_user_func($this->conditions[$name], ...$parameters); - } - - /** - * Register a class-based component alias directive. - * - * @param string $class - * @param string|null $alias - * @param string $prefix - * @return void - */ - public function component($class, $alias = null, $prefix = '') - { - if (! is_null($alias) && str_contains($alias, '\\')) { - [$class, $alias] = [$alias, $class]; - } - - if (is_null($alias)) { - $alias = str_contains($class, '\\View\\Components\\') - ? collect(explode('\\', Str::after($class, '\\View\\Components\\')))->map(function ($segment) { - return Str::kebab($segment); - })->implode(':') - : Str::kebab(class_basename($class)); - } - - if (! empty($prefix)) { - $alias = $prefix.'-'.$alias; - } - - $this->classComponentAliases[$alias] = $class; - } - - /** - * Register an array of class-based components. - * - * @param array $components - * @param string $prefix - * @return void - */ - public function components(array $components, $prefix = '') - { - foreach ($components as $key => $value) { - if (is_numeric($key)) { - $this->component($value, null, $prefix); - } else { - $this->component($key, $value, $prefix); - } - } - } - - /** - * Get the registered class component aliases. - * - * @return array - */ - public function getClassComponentAliases() - { - return $this->classComponentAliases; - } - - /** - * Register a new anonymous component path. - * - * @param string $path - * @param string|null $prefix - * @return void - */ - public function anonymousComponentPath(string $path, string $prefix = null) - { - $prefixHash = md5($prefix ?: $path); - - $this->anonymousComponentPaths[] = [ - 'path' => $path, - 'prefix' => $prefix, - 'prefixHash' => $prefixHash, - ]; - - Container::getInstance() - ->make(ViewFactory::class) - ->addNamespace($prefixHash, $path); - } - - /** - * Register an anonymous component namespace. - * - * @param string $directory - * @param string|null $prefix - * @return void - */ - public function anonymousComponentNamespace(string $directory, string $prefix = null) - { - $prefix ??= $directory; - - $this->anonymousComponentNamespaces[$prefix] = Str::of($directory) - ->replace('/', '.') - ->trim('. ') - ->toString(); - } - - /** - * Register a class-based component namespace. - * - * @param string $namespace - * @param string $prefix - * @return void - */ - public function componentNamespace($namespace, $prefix) - { - $this->classComponentNamespaces[$prefix] = $namespace; - } - - /** - * Get the registered anonymous component paths. - * - * @return array - */ - public function getAnonymousComponentPaths() - { - return $this->anonymousComponentPaths; - } - - /** - * Get the registered anonymous component namespaces. - * - * @return array - */ - public function getAnonymousComponentNamespaces() - { - return $this->anonymousComponentNamespaces; - } - - /** - * Get the registered class component namespaces. - * - * @return array - */ - public function getClassComponentNamespaces() - { - return $this->classComponentNamespaces; - } - - /** - * Register a component alias directive. - * - * @param string $path - * @param string|null $alias - * @return void - */ - public function aliasComponent($path, $alias = null) - { - $alias = $alias ?: Arr::last(explode('.', $path)); - - $this->directive($alias, function ($expression) use ($path) { - return $expression - ? "startComponent('{$path}', {$expression}); ?>" - : "startComponent('{$path}'); ?>"; - }); - - $this->directive('end'.$alias, function ($expression) { - return 'renderComponent(); ?>'; - }); - } - - /** - * Register an include alias directive. - * - * @param string $path - * @param string|null $alias - * @return void - */ - public function include($path, $alias = null) - { - $this->aliasInclude($path, $alias); - } - - /** - * Register an include alias directive. - * - * @param string $path - * @param string|null $alias - * @return void - */ - public function aliasInclude($path, $alias = null) - { - $alias = $alias ?: Arr::last(explode('.', $path)); - - $this->directive($alias, function ($expression) use ($path) { - $expression = $this->stripParentheses($expression) ?: '[]'; - - return "make('{$path}', {$expression}, \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>"; - }); - } - - /** - * Register a handler for custom directives. - * - * @param string $name - * @param callable $handler - * @return void - * - * @throws \InvalidArgumentException - */ - public function directive($name, callable $handler) - { - if (! preg_match('/^\w+(?:::\w+)?$/x', $name)) { - throw new InvalidArgumentException("The directive name [{$name}] is not valid. Directive names must only contain alphanumeric characters and underscores."); - } - - $this->customDirectives[$name] = $handler; - } - - /** - * Get the list of custom directives. - * - * @return array - */ - public function getCustomDirectives() - { - return $this->customDirectives; - } - - /** - * Register a new precompiler. - * - * @param callable $precompiler - * @return void - */ - public function precompiler(callable $precompiler) - { - $this->precompilers[] = $precompiler; - } - - /** - * Set the echo format to be used by the compiler. - * - * @param string $format - * @return void - */ - public function setEchoFormat($format) - { - $this->echoFormat = $format; - } - - /** - * Set the "echo" format to double encode entities. - * - * @return void - */ - public function withDoubleEncoding() - { - $this->setEchoFormat('e(%s, true)'); - } - - /** - * Set the "echo" format to not double encode entities. - * - * @return void - */ - public function withoutDoubleEncoding() - { - $this->setEchoFormat('e(%s, false)'); - } - - /** - * Indicate that component tags should not be compiled. - * - * @return void - */ - public function withoutComponentTags() - { - $this->compilesComponentTags = false; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/Compilers/Compiler.php b/vendor/laravel/framework/src/Illuminate/View/Compilers/Compiler.php deleted file mode 100755 index 90c5d608..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/Compilers/Compiler.php +++ /dev/null @@ -1,124 +0,0 @@ -files = $files; - $this->cachePath = $cachePath; - $this->basePath = $basePath; - $this->shouldCache = $shouldCache; - $this->compiledExtension = $compiledExtension; - } - - /** - * Get the path to the compiled version of a view. - * - * @param string $path - * @return string - */ - public function getCompiledPath($path) - { - return $this->cachePath.'/'.sha1('v2'.Str::after($path, $this->basePath)).'.'.$this->compiledExtension; - } - - /** - * Determine if the view at the given path is expired. - * - * @param string $path - * @return bool - */ - public function isExpired($path) - { - if (! $this->shouldCache) { - return true; - } - - $compiled = $this->getCompiledPath($path); - - // If the compiled file doesn't exist we will indicate that the view is expired - // so that it can be re-compiled. Else, we will verify the last modification - // of the views is less than the modification times of the compiled views. - if (! $this->files->exists($compiled)) { - return true; - } - - return $this->files->lastModified($path) >= - $this->files->lastModified($compiled); - } - - /** - * Create the compiled file directory if necessary. - * - * @param string $path - * @return void - */ - protected function ensureCompiledDirectoryExists($path) - { - if (! $this->files->exists(dirname($path))) { - $this->files->makeDirectory(dirname($path), 0777, true, true); - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/Compilers/CompilerInterface.php b/vendor/laravel/framework/src/Illuminate/View/Compilers/CompilerInterface.php deleted file mode 100755 index dfcb023a..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/Compilers/CompilerInterface.php +++ /dev/null @@ -1,30 +0,0 @@ - - * @author Taylor Otwell - */ -class ComponentTagCompiler -{ - /** - * The Blade compiler instance. - * - * @var \Illuminate\View\Compilers\BladeCompiler - */ - protected $blade; - - /** - * The component class aliases. - * - * @var array - */ - protected $aliases = []; - - /** - * The component class namespaces. - * - * @var array - */ - protected $namespaces = []; - - /** - * The "bind:" attributes that have been compiled for the current component. - * - * @var array - */ - protected $boundAttributes = []; - - /** - * Create a new component tag compiler. - * - * @param array $aliases - * @param array $namespaces - * @param \Illuminate\View\Compilers\BladeCompiler|null $blade - * @return void - */ - public function __construct(array $aliases = [], array $namespaces = [], ?BladeCompiler $blade = null) - { - $this->aliases = $aliases; - $this->namespaces = $namespaces; - - $this->blade = $blade ?: new BladeCompiler(new Filesystem, sys_get_temp_dir()); - } - - /** - * Compile the component and slot tags within the given string. - * - * @param string $value - * @return string - */ - public function compile(string $value) - { - $value = $this->compileSlots($value); - - return $this->compileTags($value); - } - - /** - * Compile the tags within the given string. - * - * @param string $value - * @return string - * - * @throws \InvalidArgumentException - */ - public function compileTags(string $value) - { - $value = $this->compileSelfClosingTags($value); - $value = $this->compileOpeningTags($value); - $value = $this->compileClosingTags($value); - - return $value; - } - - /** - * Compile the opening tags within the given string. - * - * @param string $value - * @return string - * - * @throws \InvalidArgumentException - */ - protected function compileOpeningTags(string $value) - { - $pattern = "/ - < - \s* - x[-\:]([\w\-\:\.]*) - (? - (?: - \s+ - (?: - (?: - @(?:class)(\( (?: (?>[^()]+) | (?-1) )* \)) - ) - | - (?: - \{\{\s*\\\$attributes(?:[^}]+?)?\s*\}\} - ) - | - (?: - (\:\\\$)(\w+) - ) - | - (?: - [\w\-:.@]+ - ( - = - (?: - \\\"[^\\\"]*\\\" - | - \'[^\']*\' - | - [^\'\\\"=<>]+ - ) - )? - ) - ) - )* - \s* - ) - (? - /x"; - - return preg_replace_callback($pattern, function (array $matches) { - $this->boundAttributes = []; - - $attributes = $this->getAttributesFromAttributeString($matches['attributes']); - - return $this->componentString($matches[1], $attributes); - }, $value); - } - - /** - * Compile the self-closing tags within the given string. - * - * @param string $value - * @return string - * - * @throws \InvalidArgumentException - */ - protected function compileSelfClosingTags(string $value) - { - $pattern = "/ - < - \s* - x[-\:]([\w\-\:\.]*) - \s* - (? - (?: - \s+ - (?: - (?: - @(?:class)(\( (?: (?>[^()]+) | (?-1) )* \)) - ) - | - (?: - \{\{\s*\\\$attributes(?:[^}]+?)?\s*\}\} - ) - | - (?: - (\:\\\$)(\w+) - ) - | - (?: - [\w\-:.@]+ - ( - = - (?: - \\\"[^\\\"]*\\\" - | - \'[^\']*\' - | - [^\'\\\"=<>]+ - ) - )? - ) - ) - )* - \s* - ) - \/> - /x"; - - return preg_replace_callback($pattern, function (array $matches) { - $this->boundAttributes = []; - - $attributes = $this->getAttributesFromAttributeString($matches['attributes']); - - return $this->componentString($matches[1], $attributes)."\n@endComponentClass##END-COMPONENT-CLASS##"; - }, $value); - } - - /** - * Compile the Blade component string for the given component and attributes. - * - * @param string $component - * @param array $attributes - * @return string - * - * @throws \InvalidArgumentException - */ - protected function componentString(string $component, array $attributes) - { - $class = $this->componentClass($component); - - [$data, $attributes] = $this->partitionDataAndAttributes($class, $attributes); - - $data = $data->mapWithKeys(function ($value, $key) { - return [Str::camel($key) => $value]; - }); - - // If the component doesn't exist as a class, we'll assume it's a class-less - // component and pass the component as a view parameter to the data so it - // can be accessed within the component and we can render out the view. - if (! class_exists($class)) { - $view = Str::startsWith($component, 'mail::') - ? "\$__env->getContainer()->make(Illuminate\\View\\Factory::class)->make('{$component}')" - : "'$class'"; - - $parameters = [ - 'view' => $view, - 'data' => '['.$this->attributesToString($data->all(), $escapeBound = false).']', - ]; - - $class = AnonymousComponent::class; - } else { - $parameters = $data->all(); - } - - return "##BEGIN-COMPONENT-CLASS##@component('{$class}', '{$component}', [".$this->attributesToString($parameters, $escapeBound = false).']) -getConstructor()): ?> -except(collect($constructor->getParameters())->map->getName()->all()); ?> - -withAttributes(['.$this->attributesToString($attributes->all(), $escapeAttributes = $class !== DynamicComponent::class).']); ?>'; - } - - /** - * Get the component class for a given component alias. - * - * @param string $component - * @return string - * - * @throws \InvalidArgumentException - */ - public function componentClass(string $component) - { - $viewFactory = Container::getInstance()->make(Factory::class); - - if (isset($this->aliases[$component])) { - if (class_exists($alias = $this->aliases[$component])) { - return $alias; - } - - if ($viewFactory->exists($alias)) { - return $alias; - } - - throw new InvalidArgumentException( - "Unable to locate class or view [{$alias}] for component [{$component}]." - ); - } - - if ($class = $this->findClassByComponent($component)) { - return $class; - } - - if (class_exists($class = $this->guessClassName($component))) { - return $class; - } - - if (! is_null($guess = $this->guessAnonymousComponentUsingNamespaces($viewFactory, $component)) || - ! is_null($guess = $this->guessAnonymousComponentUsingPaths($viewFactory, $component))) { - return $guess; - } - - if (Str::startsWith($component, 'mail::')) { - return $component; - } - - throw new InvalidArgumentException( - "Unable to locate a class or view for component [{$component}]." - ); - } - - /** - * Attempt to find an anonymous component using the registered anonymous component paths. - * - * @param \Illuminate\Contracts\View\Factory $viewFactory - * @param string $component - * @return string|null - */ - protected function guessAnonymousComponentUsingPaths(Factory $viewFactory, string $component) - { - $delimiter = ViewFinderInterface::HINT_PATH_DELIMITER; - - foreach ($this->blade->getAnonymousComponentPaths() as $path) { - try { - if (str_contains($component, $delimiter) && - ! str_starts_with($component, $path['prefix'].$delimiter)) { - continue; - } - - $formattedComponent = str_starts_with($component, $path['prefix'].$delimiter) - ? Str::after($component, $delimiter) - : $component; - - if (! is_null($guess = match (true) { - $viewFactory->exists($guess = $path['prefixHash'].$delimiter.$formattedComponent) => $guess, - $viewFactory->exists($guess = $path['prefixHash'].$delimiter.$formattedComponent.'.index') => $guess, - default => null, - })) { - return $guess; - } - } catch (InvalidArgumentException $e) { - // - } - } - } - - /** - * Attempt to find an anonymous component using the registered anonymous component namespaces. - * - * @param \Illuminate\Contracts\View\Factory $viewFactory - * @param string $component - * @return string|null - */ - protected function guessAnonymousComponentUsingNamespaces(Factory $viewFactory, string $component) - { - return collect($this->blade->getAnonymousComponentNamespaces()) - ->filter(function ($directory, $prefix) use ($component) { - return Str::startsWith($component, $prefix.'::'); - }) - ->prepend('components', $component) - ->reduce(function ($carry, $directory, $prefix) use ($component, $viewFactory) { - if (! is_null($carry)) { - return $carry; - } - - $componentName = Str::after($component, $prefix.'::'); - - if ($viewFactory->exists($view = $this->guessViewName($componentName, $directory))) { - return $view; - } - - if ($viewFactory->exists($view = $this->guessViewName($componentName, $directory).'.index')) { - return $view; - } - }); - } - - /** - * Find the class for the given component using the registered namespaces. - * - * @param string $component - * @return string|null - */ - public function findClassByComponent(string $component) - { - $segments = explode('::', $component); - - $prefix = $segments[0]; - - if (! isset($this->namespaces[$prefix], $segments[1])) { - return; - } - - if (class_exists($class = $this->namespaces[$prefix].'\\'.$this->formatClassName($segments[1]))) { - return $class; - } - } - - /** - * Guess the class name for the given component. - * - * @param string $component - * @return string - */ - public function guessClassName(string $component) - { - $namespace = Container::getInstance() - ->make(Application::class) - ->getNamespace(); - - $class = $this->formatClassName($component); - - return $namespace.'View\\Components\\'.$class; - } - - /** - * Format the class name for the given component. - * - * @param string $component - * @return string - */ - public function formatClassName(string $component) - { - $componentPieces = array_map(function ($componentPiece) { - return ucfirst(Str::camel($componentPiece)); - }, explode('.', $component)); - - return implode('\\', $componentPieces); - } - - /** - * Guess the view name for the given component. - * - * @param string $name - * @param string $prefix - * @return string - */ - public function guessViewName($name, $prefix = 'components.') - { - if (! Str::endsWith($prefix, '.')) { - $prefix .= '.'; - } - - $delimiter = ViewFinderInterface::HINT_PATH_DELIMITER; - - if (str_contains($name, $delimiter)) { - return Str::replaceFirst($delimiter, $delimiter.$prefix, $name); - } - - return $prefix.$name; - } - - /** - * Partition the data and extra attributes from the given array of attributes. - * - * @param string $class - * @param array $attributes - * @return array - */ - public function partitionDataAndAttributes($class, array $attributes) - { - // If the class doesn't exist, we'll assume it is a class-less component and - // return all of the attributes as both data and attributes since we have - // now way to partition them. The user can exclude attributes manually. - if (! class_exists($class)) { - return [collect($attributes), collect($attributes)]; - } - - $constructor = (new ReflectionClass($class))->getConstructor(); - - $parameterNames = $constructor - ? collect($constructor->getParameters())->map->getName()->all() - : []; - - return collect($attributes)->partition(function ($value, $key) use ($parameterNames) { - return in_array(Str::camel($key), $parameterNames); - })->all(); - } - - /** - * Compile the closing tags within the given string. - * - * @param string $value - * @return string - */ - protected function compileClosingTags(string $value) - { - return preg_replace("/<\/\s*x[-\:][\w\-\:\.]*\s*>/", ' @endComponentClass##END-COMPONENT-CLASS##', $value); - } - - /** - * Compile the slot tags within the given string. - * - * @param string $value - * @return string - */ - public function compileSlots(string $value) - { - $pattern = "/ - < - \s* - x[\-\:]slot - (?:\:(?\w+(?:-\w+)*))? - (?:\s+(:?)name=(?(\"[^\"]+\"|\\\'[^\\\']+\\\'|[^\s>]+)))? - (? - (?: - \s+ - (?: - (?: - @(?:class)(\( (?: (?>[^()]+) | (?-1) )* \)) - ) - | - (?: - \{\{\s*\\\$attributes(?:[^}]+?)?\s*\}\} - ) - | - (?: - [\w\-:.@]+ - ( - = - (?: - \\\"[^\\\"]*\\\" - | - \'[^\']*\' - | - [^\'\\\"=<>]+ - ) - )? - ) - ) - )* - \s* - ) - (? - /x"; - - $value = preg_replace_callback($pattern, function ($matches) { - $name = $this->stripQuotes($matches['inlineName'] ?: $matches['name']); - - if (Str::contains($name, '-') && ! empty($matches['inlineName'])) { - $name = Str::camel($name); - } - - if ($matches[2] !== ':') { - $name = "'{$name}'"; - } - - $this->boundAttributes = []; - - $attributes = $this->getAttributesFromAttributeString($matches['attributes']); - - return " @slot({$name}, null, [".$this->attributesToString($attributes).']) '; - }, $value); - - return preg_replace('/<\/\s*x[\-\:]slot[^>]*>/', ' @endslot', $value); - } - - /** - * Get an array of attributes from the given attribute string. - * - * @param string $attributeString - * @return array - */ - protected function getAttributesFromAttributeString(string $attributeString) - { - $attributeString = $this->parseShortAttributeSyntax($attributeString); - $attributeString = $this->parseAttributeBag($attributeString); - $attributeString = $this->parseComponentTagClassStatements($attributeString); - $attributeString = $this->parseBindAttributes($attributeString); - - $pattern = '/ - (?[\w\-:.@]+) - ( - = - (? - ( - \"[^\"]+\" - | - \\\'[^\\\']+\\\' - | - [^\s>]+ - ) - ) - )? - /x'; - - if (! preg_match_all($pattern, $attributeString, $matches, PREG_SET_ORDER)) { - return []; - } - - return collect($matches)->mapWithKeys(function ($match) { - $attribute = $match['attribute']; - $value = $match['value'] ?? null; - - if (is_null($value)) { - $value = 'true'; - - $attribute = Str::start($attribute, 'bind:'); - } - - $value = $this->stripQuotes($value); - - if (str_starts_with($attribute, 'bind:')) { - $attribute = Str::after($attribute, 'bind:'); - - $this->boundAttributes[$attribute] = true; - } else { - $value = "'".$this->compileAttributeEchos($value)."'"; - } - - if (str_starts_with($attribute, '::')) { - $attribute = substr($attribute, 1); - } - - return [$attribute => $value]; - })->toArray(); - } - - /** - * Parses a short attribute syntax like :$foo into a fully-qualified syntax like :foo="$foo". - * - * @param string $value - * @return string - */ - protected function parseShortAttributeSyntax(string $value) - { - $pattern = "/\s\:\\\$(\w+)/x"; - - return preg_replace_callback($pattern, function (array $matches) { - return " :{$matches[1]}=\"\${$matches[1]}\""; - }, $value); - } - - /** - * Parse the attribute bag in a given attribute string into its fully-qualified syntax. - * - * @param string $attributeString - * @return string - */ - protected function parseAttributeBag(string $attributeString) - { - $pattern = "/ - (?:^|\s+) # start of the string or whitespace between attributes - \{\{\s*(\\\$attributes(?:[^}]+?(?[^()]+) | (?2) )* \))/x', function ($match) { - if ($match[1] === 'class') { - $match[2] = str_replace('"', "'", $match[2]); - - return ":class=\"\Illuminate\Support\Arr::toCssClasses{$match[2]}\""; - } - - return $match[0]; - }, $attributeString - ); - } - - /** - * Parse the "bind" attributes in a given attribute string into their fully-qualified syntax. - * - * @param string $attributeString - * @return string - */ - protected function parseBindAttributes(string $attributeString) - { - $pattern = "/ - (?:^|\s+) # start of the string or whitespace between attributes - :(?!:) # attribute needs to start with a single colon - ([\w\-:.@]+) # match the actual attribute name - = # only match attributes that have a value - /xm"; - - return preg_replace($pattern, ' bind:$1=', $attributeString); - } - - /** - * Compile any Blade echo statements that are present in the attribute string. - * - * These echo statements need to be converted to string concatenation statements. - * - * @param string $attributeString - * @return string - */ - protected function compileAttributeEchos(string $attributeString) - { - $value = $this->blade->compileEchos($attributeString); - - $value = $this->escapeSingleQuotesOutsideOfPhpBlocks($value); - - $value = str_replace('', '.\'', $value); - - return $value; - } - - /** - * Escape the single quotes in the given string that are outside of PHP blocks. - * - * @param string $value - * @return string - */ - protected function escapeSingleQuotesOutsideOfPhpBlocks(string $value) - { - return collect(token_get_all($value))->map(function ($token) { - if (! is_array($token)) { - return $token; - } - - return $token[0] === T_INLINE_HTML - ? str_replace("'", "\\'", $token[1]) - : $token[1]; - })->implode(''); - } - - /** - * Convert an array of attributes to a string. - * - * @param array $attributes - * @param bool $escapeBound - * @return string - */ - protected function attributesToString(array $attributes, $escapeBound = true) - { - return collect($attributes) - ->map(function (string $value, string $attribute) use ($escapeBound) { - return $escapeBound && isset($this->boundAttributes[$attribute]) && $value !== 'true' && ! is_numeric($value) - ? "'{$attribute}' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute({$value})" - : "'{$attribute}' => {$value}"; - }) - ->implode(','); - } - - /** - * Strip any quotes from the given string. - * - * @param string $value - * @return string - */ - public function stripQuotes(string $value) - { - return Str::startsWith($value, ['"', '\'']) - ? substr($value, 1, -1) - : $value; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesAuthorizations.php b/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesAuthorizations.php deleted file mode 100644 index 4f969982..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesAuthorizations.php +++ /dev/null @@ -1,102 +0,0 @@ -check{$expression}): ?>"; - } - - /** - * Compile the cannot statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compileCannot($expression) - { - return "denies{$expression}): ?>"; - } - - /** - * Compile the canany statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compileCanany($expression) - { - return "any{$expression}): ?>"; - } - - /** - * Compile the else-can statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compileElsecan($expression) - { - return "check{$expression}): ?>"; - } - - /** - * Compile the else-cannot statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compileElsecannot($expression) - { - return "denies{$expression}): ?>"; - } - - /** - * Compile the else-canany statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compileElsecanany($expression) - { - return "any{$expression}): ?>"; - } - - /** - * Compile the end-can statements into valid PHP. - * - * @return string - */ - protected function compileEndcan() - { - return ''; - } - - /** - * Compile the end-cannot statements into valid PHP. - * - * @return string - */ - protected function compileEndcannot() - { - return ''; - } - - /** - * Compile the end-canany statements into valid PHP. - * - * @return string - */ - protected function compileEndcanany() - { - return ''; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesClasses.php b/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesClasses.php deleted file mode 100644 index b3dbbcd2..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesClasses.php +++ /dev/null @@ -1,19 +0,0 @@ -\""; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesComments.php b/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesComments.php deleted file mode 100644 index 104a9c81..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesComments.php +++ /dev/null @@ -1,19 +0,0 @@ -contentTags[0], $this->contentTags[1]); - - return preg_replace($pattern, '', $value); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesComponents.php b/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesComponents.php deleted file mode 100644 index de565c67..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesComponents.php +++ /dev/null @@ -1,198 +0,0 @@ -startComponent{$expression}; ?>"; - } - - /** - * Get a new component hash for a component name. - * - * @param string $component - * @return string - */ - public static function newComponentHash(string $component) - { - static::$componentHashStack[] = $hash = sha1($component); - - return $hash; - } - - /** - * Compile a class component opening. - * - * @param string $component - * @param string $alias - * @param string $data - * @param string $hash - * @return string - */ - public static function compileClassComponentOpening(string $component, string $alias, string $data, string $hash) - { - return implode("\n", [ - '', - 'getIterator() : [])); ?>', - 'withName('.$alias.'); ?>', - 'shouldRender()): ?>', - 'startComponent($component->resolveView(), $component->data()); ?>', - ]); - } - - /** - * Compile the end-component statements into valid PHP. - * - * @return string - */ - protected function compileEndComponent() - { - return 'renderComponent(); ?>'; - } - - /** - * Compile the end-component statements into valid PHP. - * - * @return string - */ - public function compileEndComponentClass() - { - $hash = array_pop(static::$componentHashStack); - - return $this->compileEndComponent()."\n".implode("\n", [ - '', - '', - '', - '', - '', - ]); - } - - /** - * Compile the slot statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compileSlot($expression) - { - return "slot{$expression}; ?>"; - } - - /** - * Compile the end-slot statements into valid PHP. - * - * @return string - */ - protected function compileEndSlot() - { - return 'endSlot(); ?>'; - } - - /** - * Compile the component-first statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compileComponentFirst($expression) - { - return "startComponentFirst{$expression}; ?>"; - } - - /** - * Compile the end-component-first statements into valid PHP. - * - * @return string - */ - protected function compileEndComponentFirst() - { - return $this->compileEndComponent(); - } - - /** - * Compile the prop statement into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compileProps($expression) - { - return " -onlyProps{$expression} as \$__key => \$__value) { - \$\$__key = \$\$__key ?? \$__value; -} ?> -exceptProps{$expression}; ?> - \$__value) { - \$\$__key = \$\$__key ?? \$__value; -} ?> - - \$__value) { - if (array_key_exists(\$__key, \$__defined_vars)) unset(\$\$__key); -} ?> -"; - } - - /** - * Compile the aware statement into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compileAware($expression) - { - return " \$__value) { - \$__consumeVariable = is_string(\$__key) ? \$__key : \$__value; - \$\$__consumeVariable = is_string(\$__key) ? \$__env->getConsumableComponentData(\$__key, \$__value) : \$__env->getConsumableComponentData(\$__value); -} ?>"; - } - - /** - * Sanitize the given component attribute value. - * - * @param mixed $value - * @return mixed - */ - public static function sanitizeComponentAttribute($value) - { - if ($value instanceof CanBeEscapedWhenCastToString) { - return $value->escapeWhenCastingToString(); - } - - return is_string($value) || - (is_object($value) && ! $value instanceof ComponentAttributeBag && method_exists($value, '__toString')) - ? e($value) - : $value; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesConditionals.php b/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesConditionals.php deleted file mode 100644 index 2b1c0e8e..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesConditionals.php +++ /dev/null @@ -1,385 +0,0 @@ -guard{$guard}->check()): ?>"; - } - - /** - * Compile the else-auth statements into valid PHP. - * - * @param string|null $guard - * @return string - */ - protected function compileElseAuth($guard = null) - { - $guard = is_null($guard) ? '()' : $guard; - - return "guard{$guard}->check()): ?>"; - } - - /** - * Compile the end-auth statements into valid PHP. - * - * @return string - */ - protected function compileEndAuth() - { - return ''; - } - - /** - * Compile the env statements into valid PHP. - * - * @param string $environments - * @return string - */ - protected function compileEnv($environments) - { - return "environment{$environments}): ?>"; - } - - /** - * Compile the end-env statements into valid PHP. - * - * @return string - */ - protected function compileEndEnv() - { - return ''; - } - - /** - * Compile the production statements into valid PHP. - * - * @return string - */ - protected function compileProduction() - { - return "environment('production')): ?>"; - } - - /** - * Compile the end-production statements into valid PHP. - * - * @return string - */ - protected function compileEndProduction() - { - return ''; - } - - /** - * Compile the if-guest statements into valid PHP. - * - * @param string|null $guard - * @return string - */ - protected function compileGuest($guard = null) - { - $guard = is_null($guard) ? '()' : $guard; - - return "guard{$guard}->guest()): ?>"; - } - - /** - * Compile the else-guest statements into valid PHP. - * - * @param string|null $guard - * @return string - */ - protected function compileElseGuest($guard = null) - { - $guard = is_null($guard) ? '()' : $guard; - - return "guard{$guard}->guest()): ?>"; - } - - /** - * Compile the end-guest statements into valid PHP. - * - * @return string - */ - protected function compileEndGuest() - { - return ''; - } - - /** - * Compile the has-section statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compileHasSection($expression) - { - return "yieldContent{$expression}))): ?>"; - } - - /** - * Compile the section-missing statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compileSectionMissing($expression) - { - return "yieldContent{$expression}))): ?>"; - } - - /** - * Compile the if statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compileIf($expression) - { - return ""; - } - - /** - * Compile the unless statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compileUnless($expression) - { - return ""; - } - - /** - * Compile the else-if statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compileElseif($expression) - { - return ""; - } - - /** - * Compile the else statements into valid PHP. - * - * @return string - */ - protected function compileElse() - { - return ''; - } - - /** - * Compile the end-if statements into valid PHP. - * - * @return string - */ - protected function compileEndif() - { - return ''; - } - - /** - * Compile the end-unless statements into valid PHP. - * - * @return string - */ - protected function compileEndunless() - { - return ''; - } - - /** - * Compile the if-isset statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compileIsset($expression) - { - return ""; - } - - /** - * Compile the end-isset statements into valid PHP. - * - * @return string - */ - protected function compileEndIsset() - { - return ''; - } - - /** - * Compile the switch statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compileSwitch($expression) - { - $this->firstCaseInSwitch = true; - - return "firstCaseInSwitch) { - $this->firstCaseInSwitch = false; - - return "case {$expression}: ?>"; - } - - return ""; - } - - /** - * Compile the default statements in switch case into valid PHP. - * - * @return string - */ - protected function compileDefault() - { - return ''; - } - - /** - * Compile the end switch statements into valid PHP. - * - * @return string - */ - protected function compileEndSwitch() - { - return ''; - } - - /** - * Compile a once block into valid PHP. - * - * @param string|null $id - * @return string - */ - protected function compileOnce($id = null) - { - $id = $id ? $this->stripParentheses($id) : "'".(string) Str::uuid()."'"; - - return 'hasRenderedOnce('.$id.')): $__env->markAsRenderedOnce('.$id.'); ?>'; - } - - /** - * Compile an end-once block into valid PHP. - * - * @return string - */ - public function compileEndOnce() - { - return ''; - } - - /** - * Compile a selected block into valid PHP. - * - * @param string $condition - * @return string - */ - protected function compileSelected($condition) - { - return ""; - } - - /** - * Compile a checked block into valid PHP. - * - * @param string $condition - * @return string - */ - protected function compileChecked($condition) - { - return ""; - } - - /** - * Compile a disabled block into valid PHP. - * - * @param string $condition - * @return string - */ - protected function compileDisabled($condition) - { - return ""; - } - - /** - * Compile a required block into valid PHP. - * - * @param string $condition - * @return string - */ - protected function compileRequired($condition) - { - return ""; - } - - /** - * Compile a readonly block into valid PHP. - * - * @param string $condition - * @return string - */ - protected function compileReadonly($condition) - { - return ""; - } - - /** - * Compile the push statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compilePushIf($expression) - { - $parts = explode(',', $this->stripParentheses($expression), 2); - - return "startPush({$parts[1]}); ?>"; - } - - /** - * Compile the end-push statements into valid PHP. - * - * @return string - */ - protected function compileEndPushIf() - { - return 'stopPush(); endif; ?>'; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesEchos.php b/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesEchos.php deleted file mode 100644 index 37f1cbc9..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesEchos.php +++ /dev/null @@ -1,167 +0,0 @@ -firstClosureParameterType($class), $class]; - } - - $this->echoHandlers[$class] = $handler; - } - - /** - * Compile Blade echos into valid PHP. - * - * @param string $value - * @return string - */ - public function compileEchos($value) - { - foreach ($this->getEchoMethods() as $method) { - $value = $this->$method($value); - } - - return $value; - } - - /** - * Get the echo methods in the proper order for compilation. - * - * @return array - */ - protected function getEchoMethods() - { - return [ - 'compileRawEchos', - 'compileEscapedEchos', - 'compileRegularEchos', - ]; - } - - /** - * Compile the "raw" echo statements. - * - * @param string $value - * @return string - */ - protected function compileRawEchos($value) - { - $pattern = sprintf('/(@)?%s\s*(.+?)\s*%s(\r?\n)?/s', $this->rawTags[0], $this->rawTags[1]); - - $callback = function ($matches) { - $whitespace = empty($matches[3]) ? '' : $matches[3].$matches[3]; - - return $matches[1] - ? substr($matches[0], 1) - : "wrapInEchoHandler($matches[2])}; ?>{$whitespace}"; - }; - - return preg_replace_callback($pattern, $callback, $value); - } - - /** - * Compile the "regular" echo statements. - * - * @param string $value - * @return string - */ - protected function compileRegularEchos($value) - { - $pattern = sprintf('/(@)?%s\s*(.+?)\s*%s(\r?\n)?/s', $this->contentTags[0], $this->contentTags[1]); - - $callback = function ($matches) { - $whitespace = empty($matches[3]) ? '' : $matches[3].$matches[3]; - - $wrapped = sprintf($this->echoFormat, $this->wrapInEchoHandler($matches[2])); - - return $matches[1] ? substr($matches[0], 1) : "{$whitespace}"; - }; - - return preg_replace_callback($pattern, $callback, $value); - } - - /** - * Compile the escaped echo statements. - * - * @param string $value - * @return string - */ - protected function compileEscapedEchos($value) - { - $pattern = sprintf('/(@)?%s\s*(.+?)\s*%s(\r?\n)?/s', $this->escapedTags[0], $this->escapedTags[1]); - - $callback = function ($matches) { - $whitespace = empty($matches[3]) ? '' : $matches[3].$matches[3]; - - return $matches[1] - ? $matches[0] - : "wrapInEchoHandler($matches[2])}); ?>{$whitespace}"; - }; - - return preg_replace_callback($pattern, $callback, $value); - } - - /** - * Add an instance of the blade echo handler to the start of the compiled string. - * - * @param string $result - * @return string - */ - protected function addBladeCompilerVariable($result) - { - return "".$result; - } - - /** - * Wrap the echoable value in an echo handler if applicable. - * - * @param string $value - * @return string - */ - protected function wrapInEchoHandler($value) - { - $value = Str::of($value) - ->trim() - ->when(str_ends_with($value, ';'), function ($str) { - return $str->beforeLast(';'); - }); - - return empty($this->echoHandlers) ? $value : '$__bladeCompiler->applyEchoHandler('.$value.')'; - } - - /** - * Apply the echo handler for the value if it exists. - * - * @param string $value - * @return string - */ - public function applyEchoHandler($value) - { - if (is_object($value) && isset($this->echoHandlers[get_class($value)])) { - return call_user_func($this->echoHandlers[get_class($value)], $value); - } - - return $value; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesErrors.php b/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesErrors.php deleted file mode 100644 index 77edc4bf..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesErrors.php +++ /dev/null @@ -1,37 +0,0 @@ -stripParentheses($expression); - - return 'getBag($__errorArgs[1] ?? \'default\'); -if ($__bag->has($__errorArgs[0])) : -if (isset($message)) { $__messageOriginal = $message; } -$message = $__bag->first($__errorArgs[0]); ?>'; - } - - /** - * Compile the enderror statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compileEnderror($expression) - { - return ''; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesFragments.php b/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesFragments.php deleted file mode 100644 index 607b6dd2..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesFragments.php +++ /dev/null @@ -1,36 +0,0 @@ -lastFragment = trim($expression, "()'\" "); - - return "startFragment{$expression}; ?>"; - } - - /** - * Compile the end-fragment statements into valid PHP. - * - * @return string - */ - protected function compileEndfragment() - { - return 'stopFragment(); ?>'; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesHelpers.php b/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesHelpers.php deleted file mode 100644 index 6c6fcd99..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesHelpers.php +++ /dev/null @@ -1,78 +0,0 @@ -'; - } - - /** - * Compile the "dd" statements into valid PHP. - * - * @param string $arguments - * @return string - */ - protected function compileDd($arguments) - { - return ""; - } - - /** - * Compile the "dump" statements into valid PHP. - * - * @param string $arguments - * @return string - */ - protected function compileDump($arguments) - { - return ""; - } - - /** - * Compile the method statements into valid PHP. - * - * @param string $method - * @return string - */ - protected function compileMethod($method) - { - return ""; - } - - /** - * Compile the "vite" statements into valid PHP. - * - * @param ?string $arguments - * @return string - */ - protected function compileVite($arguments) - { - $arguments ??= '()'; - - $class = Vite::class; - - return ""; - } - - /** - * Compile the "viteReactRefresh" statements into valid PHP. - * - * @return string - */ - protected function compileViteReactRefresh() - { - $class = Vite::class; - - return "reactRefresh(); ?>"; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesIncludes.php b/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesIncludes.php deleted file mode 100644 index aa3d4a6f..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesIncludes.php +++ /dev/null @@ -1,82 +0,0 @@ -renderEach{$expression}; ?>"; - } - - /** - * Compile the include statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compileInclude($expression) - { - $expression = $this->stripParentheses($expression); - - return "make({$expression}, \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>"; - } - - /** - * Compile the include-if statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compileIncludeIf($expression) - { - $expression = $this->stripParentheses($expression); - - return "exists({$expression})) echo \$__env->make({$expression}, \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>"; - } - - /** - * Compile the include-when statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compileIncludeWhen($expression) - { - $expression = $this->stripParentheses($expression); - - return "renderWhen($expression, \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path'])); ?>"; - } - - /** - * Compile the include-unless statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compileIncludeUnless($expression) - { - $expression = $this->stripParentheses($expression); - - return "renderUnless($expression, \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path'])); ?>"; - } - - /** - * Compile the include-first statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compileIncludeFirst($expression) - { - $expression = $this->stripParentheses($expression); - - return "first({$expression}, \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>"; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesInjections.php b/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesInjections.php deleted file mode 100644 index a0d1ccf5..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesInjections.php +++ /dev/null @@ -1,23 +0,0 @@ -"; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesJs.php b/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesJs.php deleted file mode 100644 index 3104057d..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesJs.php +++ /dev/null @@ -1,22 +0,0 @@ -toHtml() ?>", - Js::class, $this->stripParentheses($expression) - ); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesJson.php b/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesJson.php deleted file mode 100644 index cf343e97..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesJson.php +++ /dev/null @@ -1,30 +0,0 @@ -stripParentheses($expression)); - - $options = isset($parts[1]) ? trim($parts[1]) : $this->encodingOptions; - - $depth = isset($parts[2]) ? trim($parts[2]) : 512; - - return ""; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesLayouts.php b/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesLayouts.php deleted file mode 100644 index 6540603d..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesLayouts.php +++ /dev/null @@ -1,133 +0,0 @@ -stripParentheses($expression); - - $echo = "make({$expression}, \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>"; - - $this->footer[] = $echo; - - return ''; - } - - /** - * Compile the extends-first statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compileExtendsFirst($expression) - { - $expression = $this->stripParentheses($expression); - - $echo = "first({$expression}, \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>"; - - $this->footer[] = $echo; - - return ''; - } - - /** - * Compile the section statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compileSection($expression) - { - $this->lastSection = trim($expression, "()'\" "); - - return "startSection{$expression}; ?>"; - } - - /** - * Replace the @parent directive to a placeholder. - * - * @return string - */ - protected function compileParent() - { - $escapedLastSection = strtr($this->lastSection, ['\\' => '\\\\', "'" => "\\'"]); - - return ""; - } - - /** - * Compile the yield statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compileYield($expression) - { - return "yieldContent{$expression}; ?>"; - } - - /** - * Compile the show statements into valid PHP. - * - * @return string - */ - protected function compileShow() - { - return 'yieldSection(); ?>'; - } - - /** - * Compile the append statements into valid PHP. - * - * @return string - */ - protected function compileAppend() - { - return 'appendSection(); ?>'; - } - - /** - * Compile the overwrite statements into valid PHP. - * - * @return string - */ - protected function compileOverwrite() - { - return 'stopSection(true); ?>'; - } - - /** - * Compile the stop statements into valid PHP. - * - * @return string - */ - protected function compileStop() - { - return 'stopSection(); ?>'; - } - - /** - * Compile the end-section statements into valid PHP. - * - * @return string - */ - protected function compileEndsection() - { - return 'stopSection(); ?>'; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesLoops.php b/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesLoops.php deleted file mode 100644 index 209206a3..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesLoops.php +++ /dev/null @@ -1,194 +0,0 @@ -forElseCounter; - - preg_match('/\( *(.+) +as +(.+)\)$/is', $expression ?? '', $matches); - - if (count($matches) === 0) { - throw new ViewCompilationException('Malformed @forelse statement.'); - } - - $iteratee = trim($matches[1]); - - $iteration = trim($matches[2]); - - $initLoop = "\$__currentLoopData = {$iteratee}; \$__env->addLoop(\$__currentLoopData);"; - - $iterateLoop = '$__env->incrementLoopIndices(); $loop = $__env->getLastLoop();'; - - return ""; - } - - /** - * Compile the for-else-empty and empty statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compileEmpty($expression) - { - if ($expression) { - return ""; - } - - $empty = '$__empty_'.$this->forElseCounter--; - - return "popLoop(); \$loop = \$__env->getLastLoop(); if ({$empty}): ?>"; - } - - /** - * Compile the end-for-else statements into valid PHP. - * - * @return string - */ - protected function compileEndforelse() - { - return ''; - } - - /** - * Compile the end-empty statements into valid PHP. - * - * @return string - */ - protected function compileEndEmpty() - { - return ''; - } - - /** - * Compile the for statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compileFor($expression) - { - return ""; - } - - /** - * Compile the for-each statements into valid PHP. - * - * @param string $expression - * @return string - * - * @throws \Illuminate\Contracts\View\ViewCompilationException - */ - protected function compileForeach($expression) - { - preg_match('/\( *(.+) +as +(.*)\)$/is', $expression ?? '', $matches); - - if (count($matches) === 0) { - throw new ViewCompilationException('Malformed @foreach statement.'); - } - - $iteratee = trim($matches[1]); - - $iteration = trim($matches[2]); - - $initLoop = "\$__currentLoopData = {$iteratee}; \$__env->addLoop(\$__currentLoopData);"; - - $iterateLoop = '$__env->incrementLoopIndices(); $loop = $__env->getLastLoop();'; - - return ""; - } - - /** - * Compile the break statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compileBreak($expression) - { - if ($expression) { - preg_match('/\(\s*(-?\d+)\s*\)$/', $expression, $matches); - - return $matches ? '' : ""; - } - - return ''; - } - - /** - * Compile the continue statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compileContinue($expression) - { - if ($expression) { - preg_match('/\(\s*(-?\d+)\s*\)$/', $expression, $matches); - - return $matches ? '' : ""; - } - - return ''; - } - - /** - * Compile the end-for statements into valid PHP. - * - * @return string - */ - protected function compileEndfor() - { - return ''; - } - - /** - * Compile the end-for-each statements into valid PHP. - * - * @return string - */ - protected function compileEndforeach() - { - return 'popLoop(); $loop = $__env->getLastLoop(); ?>'; - } - - /** - * Compile the while statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compileWhile($expression) - { - return ""; - } - - /** - * Compile the end-while statements into valid PHP. - * - * @return string - */ - protected function compileEndwhile() - { - return ''; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesRawPhp.php b/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesRawPhp.php deleted file mode 100644 index 41c7edfd..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesRawPhp.php +++ /dev/null @@ -1,32 +0,0 @@ -"; - } - - return '@php'; - } - - /** - * Compile the unset statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compileUnset($expression) - { - return ""; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesStacks.php b/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesStacks.php deleted file mode 100644 index 16ceef37..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesStacks.php +++ /dev/null @@ -1,117 +0,0 @@ -yieldPushContent{$expression}; ?>"; - } - - /** - * Compile the push statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compilePush($expression) - { - return "startPush{$expression}; ?>"; - } - - /** - * Compile the push-once statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compilePushOnce($expression) - { - $parts = explode(',', $this->stripParentheses($expression), 2); - - [$stack, $id] = [$parts[0], $parts[1] ?? '']; - - $id = trim($id) ?: "'".(string) Str::uuid()."'"; - - return 'hasRenderedOnce('.$id.')): $__env->markAsRenderedOnce('.$id.'); -$__env->startPush('.$stack.'); ?>'; - } - - /** - * Compile the end-push statements into valid PHP. - * - * @return string - */ - protected function compileEndpush() - { - return 'stopPush(); ?>'; - } - - /** - * Compile the end-push-once statements into valid PHP. - * - * @return string - */ - protected function compileEndpushOnce() - { - return 'stopPush(); endif; ?>'; - } - - /** - * Compile the prepend statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compilePrepend($expression) - { - return "startPrepend{$expression}; ?>"; - } - - /** - * Compile the prepend-once statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compilePrependOnce($expression) - { - $parts = explode(',', $this->stripParentheses($expression), 2); - - [$stack, $id] = [$parts[0], $parts[1] ?? '']; - - $id = trim($id) ?: "'".(string) Str::uuid()."'"; - - return 'hasRenderedOnce('.$id.')): $__env->markAsRenderedOnce('.$id.'); -$__env->startPrepend('.$stack.'); ?>'; - } - - /** - * Compile the end-prepend statements into valid PHP. - * - * @return string - */ - protected function compileEndprepend() - { - return 'stopPrepend(); ?>'; - } - - /** - * Compile the end-prepend-once statements into valid PHP. - * - * @return string - */ - protected function compileEndprependOnce() - { - return 'stopPrepend(); endif; ?>'; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesTranslations.php b/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesTranslations.php deleted file mode 100644 index 7cbafdb9..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesTranslations.php +++ /dev/null @@ -1,44 +0,0 @@ -startTranslation(); ?>'; - } elseif ($expression[1] === '[') { - return "startTranslation{$expression}; ?>"; - } - - return "get{$expression}; ?>"; - } - - /** - * Compile the end-lang statements into valid PHP. - * - * @return string - */ - protected function compileEndlang() - { - return 'renderTranslation(); ?>'; - } - - /** - * Compile the choice statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compileChoice($expression) - { - return "choice{$expression}; ?>"; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/Component.php b/vendor/laravel/framework/src/Illuminate/View/Component.php deleted file mode 100644 index 94980305..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/Component.php +++ /dev/null @@ -1,458 +0,0 @@ - - */ - protected static $bladeViewCache = []; - - /** - * The cache of public property names, keyed by class. - * - * @var array - */ - protected static $propertyCache = []; - - /** - * The cache of public method names, keyed by class. - * - * @var array - */ - protected static $methodCache = []; - - /** - * The cache of constructor parameters, keyed by class. - * - * @var array> - */ - protected static $constructorParametersCache = []; - - /** - * Get the view / view contents that represent the component. - * - * @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\Support\Htmlable|\Closure|string - */ - abstract public function render(); - - /** - * Resolve the component instance with the given data. - * - * @param array $data - * @return static - */ - public static function resolve($data) - { - if (static::$componentsResolver) { - return call_user_func(static::$componentsResolver, static::class, $data); - } - - $parameters = static::extractConstructorParameters(); - - $dataKeys = array_keys($data); - - if (empty(array_diff($parameters, $dataKeys))) { - return new static(...array_intersect_key($data, array_flip($parameters))); - } - - return Container::getInstance()->make(static::class, $data); - } - - /** - * Extract the constructor parameters for the component. - * - * @return array - */ - protected static function extractConstructorParameters() - { - if (! isset(static::$constructorParametersCache[static::class])) { - $class = new ReflectionClass(static::class); - - $constructor = $class->getConstructor(); - - static::$constructorParametersCache[static::class] = $constructor - ? collect($constructor->getParameters())->map->getName()->all() - : []; - } - - return static::$constructorParametersCache[static::class]; - } - - /** - * Resolve the Blade view or view file that should be used when rendering the component. - * - * @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\Support\Htmlable|\Closure|string - */ - public function resolveView() - { - $view = $this->render(); - - if ($view instanceof ViewContract) { - return $view; - } - - if ($view instanceof Htmlable) { - return $view; - } - - $resolver = function ($view) { - return $this->extractBladeViewFromString($view); - }; - - return $view instanceof Closure ? function (array $data = []) use ($view, $resolver) { - return $resolver($view($data)); - } - : $resolver($view); - } - - /** - * Create a Blade view with the raw component string content. - * - * @param string $contents - * @return string - */ - protected function extractBladeViewFromString($contents) - { - $key = sprintf('%s::%s', static::class, $contents); - - if (isset(static::$bladeViewCache[$key])) { - return static::$bladeViewCache[$key]; - } - - if (strlen($contents) <= PHP_MAXPATHLEN && $this->factory()->exists($contents)) { - return static::$bladeViewCache[$key] = $contents; - } - - return static::$bladeViewCache[$key] = $this->createBladeViewFromString($this->factory(), $contents); - } - - /** - * Create a Blade view with the raw component string content. - * - * @param \Illuminate\Contracts\View\Factory $factory - * @param string $contents - * @return string - */ - protected function createBladeViewFromString($factory, $contents) - { - $factory->addNamespace( - '__components', - $directory = Container::getInstance()['config']->get('view.compiled') - ); - - if (! is_file($viewFile = $directory.'/'.sha1($contents).'.blade.php')) { - if (! is_dir($directory)) { - mkdir($directory, 0755, true); - } - - file_put_contents($viewFile, $contents); - } - - return '__components::'.basename($viewFile, '.blade.php'); - } - - /** - * Get the data that should be supplied to the view. - * - * @author Freek Van der Herten - * @author Brent Roose - * - * @return array - */ - public function data() - { - $this->attributes = $this->attributes ?: $this->newAttributeBag(); - - return array_merge($this->extractPublicProperties(), $this->extractPublicMethods()); - } - - /** - * Extract the public properties for the component. - * - * @return array - */ - protected function extractPublicProperties() - { - $class = get_class($this); - - if (! isset(static::$propertyCache[$class])) { - $reflection = new ReflectionClass($this); - - static::$propertyCache[$class] = collect($reflection->getProperties(ReflectionProperty::IS_PUBLIC)) - ->reject(function (ReflectionProperty $property) { - return $property->isStatic(); - }) - ->reject(function (ReflectionProperty $property) { - return $this->shouldIgnore($property->getName()); - }) - ->map(function (ReflectionProperty $property) { - return $property->getName(); - })->all(); - } - - $values = []; - - foreach (static::$propertyCache[$class] as $property) { - $values[$property] = $this->{$property}; - } - - return $values; - } - - /** - * Extract the public methods for the component. - * - * @return array - */ - protected function extractPublicMethods() - { - $class = get_class($this); - - if (! isset(static::$methodCache[$class])) { - $reflection = new ReflectionClass($this); - - static::$methodCache[$class] = collect($reflection->getMethods(ReflectionMethod::IS_PUBLIC)) - ->reject(function (ReflectionMethod $method) { - return $this->shouldIgnore($method->getName()); - }) - ->map(function (ReflectionMethod $method) { - return $method->getName(); - }); - } - - $values = []; - - foreach (static::$methodCache[$class] as $method) { - $values[$method] = $this->createVariableFromMethod(new ReflectionMethod($this, $method)); - } - - return $values; - } - - /** - * Create a callable variable from the given method. - * - * @param \ReflectionMethod $method - * @return mixed - */ - protected function createVariableFromMethod(ReflectionMethod $method) - { - return $method->getNumberOfParameters() === 0 - ? $this->createInvokableVariable($method->getName()) - : Closure::fromCallable([$this, $method->getName()]); - } - - /** - * Create an invokable, toStringable variable for the given component method. - * - * @param string $method - * @return \Illuminate\View\InvokableComponentVariable - */ - protected function createInvokableVariable(string $method) - { - return new InvokableComponentVariable(function () use ($method) { - return $this->{$method}(); - }); - } - - /** - * Determine if the given property / method should be ignored. - * - * @param string $name - * @return bool - */ - protected function shouldIgnore($name) - { - return str_starts_with($name, '__') || - in_array($name, $this->ignoredMethods()); - } - - /** - * Get the methods that should be ignored. - * - * @return array - */ - protected function ignoredMethods() - { - return array_merge([ - 'data', - 'render', - 'resolveView', - 'shouldRender', - 'view', - 'withName', - 'withAttributes', - ], $this->except); - } - - /** - * Set the component alias name. - * - * @param string $name - * @return $this - */ - public function withName($name) - { - $this->componentName = $name; - - return $this; - } - - /** - * Set the extra attributes that the component should make available. - * - * @param array $attributes - * @return $this - */ - public function withAttributes(array $attributes) - { - $this->attributes = $this->attributes ?: $this->newAttributeBag(); - - $this->attributes->setAttributes($attributes); - - return $this; - } - - /** - * Get a new attribute bag instance. - * - * @param array $attributes - * @return \Illuminate\View\ComponentAttributeBag - */ - protected function newAttributeBag(array $attributes = []) - { - return new ComponentAttributeBag($attributes); - } - - /** - * Determine if the component should be rendered. - * - * @return bool - */ - public function shouldRender() - { - return true; - } - - /** - * Get the evaluated view contents for the given view. - * - * @param string|null $view - * @param \Illuminate\Contracts\Support\Arrayable|array $data - * @param array $mergeData - * @return \Illuminate\Contracts\View\View - */ - public function view($view, $data = [], $mergeData = []) - { - return $this->factory()->make($view, $data, $mergeData); - } - - /** - * Get the view factory instance. - * - * @return \Illuminate\Contracts\View\Factory - */ - protected function factory() - { - if (is_null(static::$factory)) { - static::$factory = Container::getInstance()->make('view'); - } - - return static::$factory; - } - - /** - * Flush the component's cached state. - * - * @return void - */ - public static function flushCache() - { - static::$bladeViewCache = []; - static::$constructorParametersCache = []; - static::$methodCache = []; - static::$propertyCache = []; - } - - /** - * Forget the component's factory instance. - * - * @return void - */ - public static function forgetFactory() - { - static::$factory = null; - } - - /** - * Forget the component's resolver callback. - * - * @return void - * - * @internal - */ - public static function forgetComponentsResolver() - { - static::$componentsResolver = null; - } - - /** - * Set the callback that should be used to resolve components within views. - * - * @param \Closure(string $component, array $data): Component $resolver - * @return void - * - * @internal - */ - public static function resolveComponentsUsing($resolver) - { - static::$componentsResolver = $resolver; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/ComponentAttributeBag.php b/vendor/laravel/framework/src/Illuminate/View/ComponentAttributeBag.php deleted file mode 100644 index 0c6c615f..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/ComponentAttributeBag.php +++ /dev/null @@ -1,432 +0,0 @@ -attributes = $attributes; - } - - /** - * Get the first attribute's value. - * - * @param mixed $default - * @return mixed - */ - public function first($default = null) - { - return $this->getIterator()->current() ?? value($default); - } - - /** - * Get a given attribute from the attribute array. - * - * @param string $key - * @param mixed $default - * @return mixed - */ - public function get($key, $default = null) - { - return $this->attributes[$key] ?? value($default); - } - - /** - * Determine if a given attribute exists in the attribute array. - * - * @param string $key - * @return bool - */ - public function has($key) - { - return array_key_exists($key, $this->attributes); - } - - /** - * Determine if a given attribute is missing from the attribute array. - * - * @param string $key - * @return bool - */ - public function missing($key) - { - return ! $this->has($key, $this->attributes); - } - - /** - * Only include the given attribute from the attribute array. - * - * @param mixed $keys - * @return static - */ - public function only($keys) - { - if (is_null($keys)) { - $values = $this->attributes; - } else { - $keys = Arr::wrap($keys); - - $values = Arr::only($this->attributes, $keys); - } - - return new static($values); - } - - /** - * Exclude the given attribute from the attribute array. - * - * @param mixed|array $keys - * @return static - */ - public function except($keys) - { - if (is_null($keys)) { - $values = $this->attributes; - } else { - $keys = Arr::wrap($keys); - - $values = Arr::except($this->attributes, $keys); - } - - return new static($values); - } - - /** - * Filter the attributes, returning a bag of attributes that pass the filter. - * - * @param callable $callback - * @return static - */ - public function filter($callback) - { - return new static(collect($this->attributes)->filter($callback)->all()); - } - - /** - * Return a bag of attributes that have keys starting with the given value / pattern. - * - * @param string|string[] $needles - * @return static - */ - public function whereStartsWith($needles) - { - return $this->filter(function ($value, $key) use ($needles) { - return Str::startsWith($key, $needles); - }); - } - - /** - * Return a bag of attributes with keys that do not start with the given value / pattern. - * - * @param string|string[] $needles - * @return static - */ - public function whereDoesntStartWith($needles) - { - return $this->filter(function ($value, $key) use ($needles) { - return ! Str::startsWith($key, $needles); - }); - } - - /** - * Return a bag of attributes that have keys starting with the given value / pattern. - * - * @param string|string[] $needles - * @return static - */ - public function thatStartWith($needles) - { - return $this->whereStartsWith($needles); - } - - /** - * Only include the given attribute from the attribute array. - * - * @param mixed|array $keys - * @return static - */ - public function onlyProps($keys) - { - return $this->only($this->extractPropNames($keys)); - } - - /** - * Exclude the given attribute from the attribute array. - * - * @param mixed|array $keys - * @return static - */ - public function exceptProps($keys) - { - return $this->except($this->extractPropNames($keys)); - } - - /** - * Extract prop names from given keys. - * - * @param mixed|array $keys - * @return array - */ - protected function extractPropNames($keys) - { - $props = []; - - foreach ($keys as $key => $defaultValue) { - $key = is_numeric($key) ? $defaultValue : $key; - - $props[] = $key; - $props[] = Str::kebab($key); - } - - return $props; - } - - /** - * Conditionally merge classes into the attribute bag. - * - * @param mixed|array $classList - * @return static - */ - public function class($classList) - { - $classList = Arr::wrap($classList); - - return $this->merge(['class' => Arr::toCssClasses($classList)]); - } - - /** - * Merge additional attributes / values into the attribute bag. - * - * @param array $attributeDefaults - * @param bool $escape - * @return static - */ - public function merge(array $attributeDefaults = [], $escape = true) - { - $attributeDefaults = array_map(function ($value) use ($escape) { - return $this->shouldEscapeAttributeValue($escape, $value) - ? e($value) - : $value; - }, $attributeDefaults); - - [$appendableAttributes, $nonAppendableAttributes] = collect($this->attributes) - ->partition(function ($value, $key) use ($attributeDefaults) { - return $key === 'class' || - (isset($attributeDefaults[$key]) && - $attributeDefaults[$key] instanceof AppendableAttributeValue); - }); - - $attributes = $appendableAttributes->mapWithKeys(function ($value, $key) use ($attributeDefaults, $escape) { - $defaultsValue = isset($attributeDefaults[$key]) && $attributeDefaults[$key] instanceof AppendableAttributeValue - ? $this->resolveAppendableAttributeDefault($attributeDefaults, $key, $escape) - : ($attributeDefaults[$key] ?? ''); - - return [$key => implode(' ', array_unique(array_filter([$defaultsValue, $value])))]; - })->merge($nonAppendableAttributes)->all(); - - return new static(array_merge($attributeDefaults, $attributes)); - } - - /** - * Determine if the specific attribute value should be escaped. - * - * @param bool $escape - * @param mixed $value - * @return bool - */ - protected function shouldEscapeAttributeValue($escape, $value) - { - if (! $escape) { - return false; - } - - return ! is_object($value) && - ! is_null($value) && - ! is_bool($value); - } - - /** - * Create a new appendable attribute value. - * - * @param mixed $value - * @return \Illuminate\View\AppendableAttributeValue - */ - public function prepends($value) - { - return new AppendableAttributeValue($value); - } - - /** - * Resolve an appendable attribute value default value. - * - * @param array $attributeDefaults - * @param string $key - * @param bool $escape - * @return mixed - */ - protected function resolveAppendableAttributeDefault($attributeDefaults, $key, $escape) - { - if ($this->shouldEscapeAttributeValue($escape, $value = $attributeDefaults[$key]->value)) { - $value = e($value); - } - - return $value; - } - - /** - * Get all of the raw attributes. - * - * @return array - */ - public function getAttributes() - { - return $this->attributes; - } - - /** - * Set the underlying attributes. - * - * @param array $attributes - * @return void - */ - public function setAttributes(array $attributes) - { - if (isset($attributes['attributes']) && - $attributes['attributes'] instanceof self) { - $parentBag = $attributes['attributes']; - - unset($attributes['attributes']); - - $attributes = $parentBag->merge($attributes, $escape = false)->getAttributes(); - } - - $this->attributes = $attributes; - } - - /** - * Get content as a string of HTML. - * - * @return string - */ - public function toHtml() - { - return (string) $this; - } - - /** - * Merge additional attributes / values into the attribute bag. - * - * @param array $attributeDefaults - * @return \Illuminate\Support\HtmlString - */ - public function __invoke(array $attributeDefaults = []) - { - return new HtmlString((string) $this->merge($attributeDefaults)); - } - - /** - * Determine if the given offset exists. - * - * @param string $offset - * @return bool - */ - public function offsetExists($offset): bool - { - return isset($this->attributes[$offset]); - } - - /** - * Get the value at the given offset. - * - * @param string $offset - * @return mixed - */ - public function offsetGet($offset): mixed - { - return $this->get($offset); - } - - /** - * Set the value at a given offset. - * - * @param string $offset - * @param mixed $value - * @return void - */ - public function offsetSet($offset, $value): void - { - $this->attributes[$offset] = $value; - } - - /** - * Remove the value at the given offset. - * - * @param string $offset - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->attributes[$offset]); - } - - /** - * Get an iterator for the items. - * - * @return \ArrayIterator - */ - public function getIterator(): Traversable - { - return new ArrayIterator($this->attributes); - } - - /** - * Implode the attributes into a single HTML ready string. - * - * @return string - */ - public function __toString() - { - $string = ''; - - foreach ($this->attributes as $key => $value) { - if ($value === false || is_null($value)) { - continue; - } - - if ($value === true) { - $value = $key; - } - - $string .= ' '.$key.'="'.str_replace('"', '\\"', trim($value)).'"'; - } - - return trim($string); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/ComponentSlot.php b/vendor/laravel/framework/src/Illuminate/View/ComponentSlot.php deleted file mode 100644 index 85665ad6..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/ComponentSlot.php +++ /dev/null @@ -1,89 +0,0 @@ -contents = $contents; - - $this->withAttributes($attributes); - } - - /** - * Set the extra attributes that the slot should make available. - * - * @param array $attributes - * @return $this - */ - public function withAttributes(array $attributes) - { - $this->attributes = new ComponentAttributeBag($attributes); - - return $this; - } - - /** - * Get the slot's HTML string. - * - * @return string - */ - public function toHtml() - { - return $this->contents; - } - - /** - * Determine if the slot is empty. - * - * @return bool - */ - public function isEmpty() - { - return $this->contents === ''; - } - - /** - * Determine if the slot is not empty. - * - * @return bool - */ - public function isNotEmpty() - { - return ! $this->isEmpty(); - } - - /** - * Get the slot's HTML string. - * - * @return string - */ - public function __toString() - { - return $this->toHtml(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/Concerns/ManagesComponents.php b/vendor/laravel/framework/src/Illuminate/View/Concerns/ManagesComponents.php deleted file mode 100644 index f24908f1..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/Concerns/ManagesComponents.php +++ /dev/null @@ -1,222 +0,0 @@ -componentStack[] = $view; - - $this->componentData[$this->currentComponent()] = $data; - - $this->slots[$this->currentComponent()] = []; - } - } - - /** - * Get the first view that actually exists from the given list, and start a component. - * - * @param array $names - * @param array $data - * @return void - */ - public function startComponentFirst(array $names, array $data = []) - { - $name = Arr::first($names, function ($item) { - return $this->exists($item); - }); - - $this->startComponent($name, $data); - } - - /** - * Render the current component. - * - * @return string - */ - public function renderComponent() - { - $view = array_pop($this->componentStack); - - $this->currentComponentData = array_merge( - $previousComponentData = $this->currentComponentData, - $data = $this->componentData() - ); - - try { - $view = value($view, $data); - - if ($view instanceof View) { - return $view->with($data)->render(); - } elseif ($view instanceof Htmlable) { - return $view->toHtml(); - } else { - return $this->make($view, $data)->render(); - } - } finally { - $this->currentComponentData = $previousComponentData; - } - } - - /** - * Get the data for the given component. - * - * @return array - */ - protected function componentData() - { - $defaultSlot = new HtmlString(trim(ob_get_clean())); - - $slots = array_merge([ - '__default' => $defaultSlot, - ], $this->slots[count($this->componentStack)]); - - return array_merge( - $this->componentData[count($this->componentStack)], - ['slot' => $defaultSlot], - $this->slots[count($this->componentStack)], - ['__laravel_slots' => $slots] - ); - } - - /** - * Get an item from the component data that exists above the current component. - * - * @param string $key - * @param mixed $default - * @return mixed|null - */ - public function getConsumableComponentData($key, $default = null) - { - if (array_key_exists($key, $this->currentComponentData)) { - return $this->currentComponentData[$key]; - } - - $currentComponent = count($this->componentStack); - - if ($currentComponent === 0) { - return value($default); - } - - for ($i = $currentComponent - 1; $i >= 0; $i--) { - $data = $this->componentData[$i] ?? []; - - if (array_key_exists($key, $data)) { - return $data[$key]; - } - } - - return value($default); - } - - /** - * Start the slot rendering process. - * - * @param string $name - * @param string|null $content - * @param array $attributes - * @return void - */ - public function slot($name, $content = null, $attributes = []) - { - if (func_num_args() === 2 || $content !== null) { - $this->slots[$this->currentComponent()][$name] = $content; - } elseif (ob_start()) { - $this->slots[$this->currentComponent()][$name] = ''; - - $this->slotStack[$this->currentComponent()][] = [$name, $attributes]; - } - } - - /** - * Save the slot content for rendering. - * - * @return void - */ - public function endSlot() - { - last($this->componentStack); - - $currentSlot = array_pop( - $this->slotStack[$this->currentComponent()] - ); - - [$currentName, $currentAttributes] = $currentSlot; - - $this->slots[$this->currentComponent()][$currentName] = new ComponentSlot( - trim(ob_get_clean()), $currentAttributes - ); - } - - /** - * Get the index for the current component. - * - * @return int - */ - protected function currentComponent() - { - return count($this->componentStack) - 1; - } - - /** - * Flush all of the component state. - * - * @return void - */ - protected function flushComponents() - { - $this->componentStack = []; - $this->componentData = []; - $this->currentComponentData = []; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/Concerns/ManagesEvents.php b/vendor/laravel/framework/src/Illuminate/View/Concerns/ManagesEvents.php deleted file mode 100644 index d6cd9d81..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/Concerns/ManagesEvents.php +++ /dev/null @@ -1,190 +0,0 @@ -addViewEvent($view, $callback, 'creating: '); - } - - return $creators; - } - - /** - * Register multiple view composers via an array. - * - * @param array $composers - * @return array - */ - public function composers(array $composers) - { - $registered = []; - - foreach ($composers as $callback => $views) { - $registered = array_merge($registered, $this->composer($views, $callback)); - } - - return $registered; - } - - /** - * Register a view composer event. - * - * @param array|string $views - * @param \Closure|string $callback - * @return array - */ - public function composer($views, $callback) - { - $composers = []; - - foreach ((array) $views as $view) { - $composers[] = $this->addViewEvent($view, $callback); - } - - return $composers; - } - - /** - * Add an event for a given view. - * - * @param string $view - * @param \Closure|string $callback - * @param string $prefix - * @return \Closure|null - */ - protected function addViewEvent($view, $callback, $prefix = 'composing: ') - { - $view = $this->normalizeName($view); - - if ($callback instanceof Closure) { - $this->addEventListener($prefix.$view, $callback); - - return $callback; - } elseif (is_string($callback)) { - return $this->addClassEvent($view, $callback, $prefix); - } - } - - /** - * Register a class based view composer. - * - * @param string $view - * @param string $class - * @param string $prefix - * @return \Closure - */ - protected function addClassEvent($view, $class, $prefix) - { - $name = $prefix.$view; - - // When registering a class based view "composer", we will simply resolve the - // classes from the application IoC container then call the compose method - // on the instance. This allows for convenient, testable view composers. - $callback = $this->buildClassEventCallback( - $class, $prefix - ); - - $this->addEventListener($name, $callback); - - return $callback; - } - - /** - * Build a class based container callback Closure. - * - * @param string $class - * @param string $prefix - * @return \Closure - */ - protected function buildClassEventCallback($class, $prefix) - { - [$class, $method] = $this->parseClassEvent($class, $prefix); - - // Once we have the class and method name, we can build the Closure to resolve - // the instance out of the IoC container and call the method on it with the - // given arguments that are passed to the Closure as the composer's data. - return function () use ($class, $method) { - return $this->container->make($class)->{$method}(...func_get_args()); - }; - } - - /** - * Parse a class based composer name. - * - * @param string $class - * @param string $prefix - * @return array - */ - protected function parseClassEvent($class, $prefix) - { - return Str::parseCallback($class, $this->classEventMethodForPrefix($prefix)); - } - - /** - * Determine the class event method based on the given prefix. - * - * @param string $prefix - * @return string - */ - protected function classEventMethodForPrefix($prefix) - { - return str_contains($prefix, 'composing') ? 'compose' : 'create'; - } - - /** - * Add a listener to the event dispatcher. - * - * @param string $name - * @param \Closure $callback - * @return void - */ - protected function addEventListener($name, $callback) - { - if (str_contains($name, '*')) { - $callback = function ($name, array $data) use ($callback) { - return $callback($data[0]); - }; - } - - $this->events->listen($name, $callback); - } - - /** - * Call the composer for a given view. - * - * @param \Illuminate\Contracts\View\View $view - * @return void - */ - public function callComposer(ViewContract $view) - { - $this->events->dispatch('composing: '.$view->name(), [$view]); - } - - /** - * Call the creator for a given view. - * - * @param \Illuminate\Contracts\View\View $view - * @return void - */ - public function callCreator(ViewContract $view) - { - $this->events->dispatch('creating: '.$view->name(), [$view]); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/Concerns/ManagesFragments.php b/vendor/laravel/framework/src/Illuminate/View/Concerns/ManagesFragments.php deleted file mode 100644 index 7273da64..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/Concerns/ManagesFragments.php +++ /dev/null @@ -1,88 +0,0 @@ -fragmentStack[] = $fragment; - } - } - - /** - * Stop injecting content into a fragment. - * - * @return string - * - * @throws \InvalidArgumentException - */ - public function stopFragment() - { - if (empty($this->fragmentStack)) { - throw new InvalidArgumentException('Cannot end a fragment without first starting one.'); - } - - $last = array_pop($this->fragmentStack); - - $this->fragments[$last] = ob_get_clean(); - - return $this->fragments[$last]; - } - - /** - * Get the contents of a fragment. - * - * @param string $name - * @param string|null $default - * @return mixed - */ - public function getFragment($name, $default = null) - { - return $this->getFragments()[$name] ?? $default; - } - - /** - * Get the entire array of rendered fragments. - * - * @return array - */ - public function getFragments() - { - return $this->fragments; - } - - /** - * Flush all of the fragments. - * - * @return void - */ - public function flushFragments() - { - $this->fragments = []; - $this->fragmentStack = []; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/Concerns/ManagesLayouts.php b/vendor/laravel/framework/src/Illuminate/View/Concerns/ManagesLayouts.php deleted file mode 100644 index f0451265..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/Concerns/ManagesLayouts.php +++ /dev/null @@ -1,255 +0,0 @@ -sectionStack[] = $section; - } - } else { - $this->extendSection($section, $content instanceof View ? $content : e($content)); - } - } - - /** - * Inject inline content into a section. - * - * @param string $section - * @param string $content - * @return void - */ - public function inject($section, $content) - { - $this->startSection($section, $content); - } - - /** - * Stop injecting content into a section and return its contents. - * - * @return string - */ - public function yieldSection() - { - if (empty($this->sectionStack)) { - return ''; - } - - return $this->yieldContent($this->stopSection()); - } - - /** - * Stop injecting content into a section. - * - * @param bool $overwrite - * @return string - * - * @throws \InvalidArgumentException - */ - public function stopSection($overwrite = false) - { - if (empty($this->sectionStack)) { - throw new InvalidArgumentException('Cannot end a section without first starting one.'); - } - - $last = array_pop($this->sectionStack); - - if ($overwrite) { - $this->sections[$last] = ob_get_clean(); - } else { - $this->extendSection($last, ob_get_clean()); - } - - return $last; - } - - /** - * Stop injecting content into a section and append it. - * - * @return string - * - * @throws \InvalidArgumentException - */ - public function appendSection() - { - if (empty($this->sectionStack)) { - throw new InvalidArgumentException('Cannot end a section without first starting one.'); - } - - $last = array_pop($this->sectionStack); - - if (isset($this->sections[$last])) { - $this->sections[$last] .= ob_get_clean(); - } else { - $this->sections[$last] = ob_get_clean(); - } - - return $last; - } - - /** - * Append content to a given section. - * - * @param string $section - * @param string $content - * @return void - */ - protected function extendSection($section, $content) - { - if (isset($this->sections[$section])) { - $content = str_replace(static::parentPlaceholder($section), $content, $this->sections[$section]); - } - - $this->sections[$section] = $content; - } - - /** - * Get the string contents of a section. - * - * @param string $section - * @param string $default - * @return string - */ - public function yieldContent($section, $default = '') - { - $sectionContent = $default instanceof View ? $default : e($default); - - if (isset($this->sections[$section])) { - $sectionContent = $this->sections[$section]; - } - - $sectionContent = str_replace('@@parent', '--parent--holder--', $sectionContent); - - return str_replace( - '--parent--holder--', '@parent', str_replace(static::parentPlaceholder($section), '', $sectionContent) - ); - } - - /** - * Get the parent placeholder for the current request. - * - * @param string $section - * @return string - */ - public static function parentPlaceholder($section = '') - { - if (! isset(static::$parentPlaceholder[$section])) { - $salt = static::parentPlaceholderSalt(); - - static::$parentPlaceholder[$section] = '##parent-placeholder-'.sha1($salt.$section).'##'; - } - - return static::$parentPlaceholder[$section]; - } - - /** - * Get the parent placeholder salt. - * - * @return string - */ - protected static function parentPlaceholderSalt() - { - if (! static::$parentPlaceholderSalt) { - return static::$parentPlaceholderSalt = Str::random(40); - } - - return static::$parentPlaceholderSalt; - } - - /** - * Check if section exists. - * - * @param string $name - * @return bool - */ - public function hasSection($name) - { - return array_key_exists($name, $this->sections); - } - - /** - * Check if section does not exist. - * - * @param string $name - * @return bool - */ - public function sectionMissing($name) - { - return ! $this->hasSection($name); - } - - /** - * Get the contents of a section. - * - * @param string $name - * @param string|null $default - * @return mixed - */ - public function getSection($name, $default = null) - { - return $this->getSections()[$name] ?? $default; - } - - /** - * Get the entire array of sections. - * - * @return array - */ - public function getSections() - { - return $this->sections; - } - - /** - * Flush all of the sections. - * - * @return void - */ - public function flushSections() - { - $this->sections = []; - $this->sectionStack = []; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/Concerns/ManagesLoops.php b/vendor/laravel/framework/src/Illuminate/View/Concerns/ManagesLoops.php deleted file mode 100644 index 95f06c82..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/Concerns/ManagesLoops.php +++ /dev/null @@ -1,96 +0,0 @@ -loopsStack); - - $this->loopsStack[] = [ - 'iteration' => 0, - 'index' => 0, - 'remaining' => $length ?? null, - 'count' => $length, - 'first' => true, - 'last' => isset($length) ? $length == 1 : null, - 'odd' => false, - 'even' => true, - 'depth' => count($this->loopsStack) + 1, - 'parent' => $parent ? (object) $parent : null, - ]; - } - - /** - * Increment the top loop's indices. - * - * @return void - */ - public function incrementLoopIndices() - { - $loop = $this->loopsStack[$index = count($this->loopsStack) - 1]; - - $this->loopsStack[$index] = array_merge($this->loopsStack[$index], [ - 'iteration' => $loop['iteration'] + 1, - 'index' => $loop['iteration'], - 'first' => $loop['iteration'] == 0, - 'odd' => ! $loop['odd'], - 'even' => ! $loop['even'], - 'remaining' => isset($loop['count']) ? $loop['remaining'] - 1 : null, - 'last' => isset($loop['count']) ? $loop['iteration'] == $loop['count'] - 1 : null, - ]); - } - - /** - * Pop a loop from the top of the loop stack. - * - * @return void - */ - public function popLoop() - { - array_pop($this->loopsStack); - } - - /** - * Get an instance of the last loop in the stack. - * - * @return \stdClass|null - */ - public function getLastLoop() - { - if ($last = Arr::last($this->loopsStack)) { - return (object) $last; - } - } - - /** - * Get the entire loop stack. - * - * @return array - */ - public function getLoopStack() - { - return $this->loopsStack; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/Concerns/ManagesStacks.php b/vendor/laravel/framework/src/Illuminate/View/Concerns/ManagesStacks.php deleted file mode 100644 index 4e063af1..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/Concerns/ManagesStacks.php +++ /dev/null @@ -1,179 +0,0 @@ -pushStack[] = $section; - } - } else { - $this->extendPush($section, $content); - } - } - - /** - * Stop injecting content into a push section. - * - * @return string - * - * @throws \InvalidArgumentException - */ - public function stopPush() - { - if (empty($this->pushStack)) { - throw new InvalidArgumentException('Cannot end a push stack without first starting one.'); - } - - return tap(array_pop($this->pushStack), function ($last) { - $this->extendPush($last, ob_get_clean()); - }); - } - - /** - * Append content to a given push section. - * - * @param string $section - * @param string $content - * @return void - */ - protected function extendPush($section, $content) - { - if (! isset($this->pushes[$section])) { - $this->pushes[$section] = []; - } - - if (! isset($this->pushes[$section][$this->renderCount])) { - $this->pushes[$section][$this->renderCount] = $content; - } else { - $this->pushes[$section][$this->renderCount] .= $content; - } - } - - /** - * Start prepending content into a push section. - * - * @param string $section - * @param string $content - * @return void - */ - public function startPrepend($section, $content = '') - { - if ($content === '') { - if (ob_start()) { - $this->pushStack[] = $section; - } - } else { - $this->extendPrepend($section, $content); - } - } - - /** - * Stop prepending content into a push section. - * - * @return string - * - * @throws \InvalidArgumentException - */ - public function stopPrepend() - { - if (empty($this->pushStack)) { - throw new InvalidArgumentException('Cannot end a prepend operation without first starting one.'); - } - - return tap(array_pop($this->pushStack), function ($last) { - $this->extendPrepend($last, ob_get_clean()); - }); - } - - /** - * Prepend content to a given stack. - * - * @param string $section - * @param string $content - * @return void - */ - protected function extendPrepend($section, $content) - { - if (! isset($this->prepends[$section])) { - $this->prepends[$section] = []; - } - - if (! isset($this->prepends[$section][$this->renderCount])) { - $this->prepends[$section][$this->renderCount] = $content; - } else { - $this->prepends[$section][$this->renderCount] = $content.$this->prepends[$section][$this->renderCount]; - } - } - - /** - * Get the string contents of a push section. - * - * @param string $section - * @param string $default - * @return string - */ - public function yieldPushContent($section, $default = '') - { - if (! isset($this->pushes[$section]) && ! isset($this->prepends[$section])) { - return $default; - } - - $output = ''; - - if (isset($this->prepends[$section])) { - $output .= implode(array_reverse($this->prepends[$section])); - } - - if (isset($this->pushes[$section])) { - $output .= implode($this->pushes[$section]); - } - - return $output; - } - - /** - * Flush all of the stacks. - * - * @return void - */ - public function flushStacks() - { - $this->pushes = []; - $this->prepends = []; - $this->pushStack = []; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/Concerns/ManagesTranslations.php b/vendor/laravel/framework/src/Illuminate/View/Concerns/ManagesTranslations.php deleted file mode 100644 index a77fc26a..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/Concerns/ManagesTranslations.php +++ /dev/null @@ -1,38 +0,0 @@ -translationReplacements = $replacements; - } - - /** - * Render the current translation. - * - * @return string - */ - public function renderTranslation() - { - return $this->container->make('translator')->get( - trim(ob_get_clean()), $this->translationReplacements - ); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/DynamicComponent.php b/vendor/laravel/framework/src/Illuminate/View/DynamicComponent.php deleted file mode 100644 index cea66e77..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/DynamicComponent.php +++ /dev/null @@ -1,172 +0,0 @@ -component = $component; - } - - /** - * Get the view / contents that represent the component. - * - * @return \Illuminate\Contracts\View\View|string - */ - public function render() - { - $template = <<<'EOF' -getAttributes())->mapWithKeys(function ($value, $key) { return [Illuminate\Support\Str::camel(str_replace([':', '.'], ' ', $key)) => $value]; })->all(), EXTR_SKIP); ?> -{{ props }} - -{{ slots }} -{{ defaultSlot }} - -EOF; - - return function ($data) use ($template) { - $bindings = $this->bindings($class = $this->classForComponent()); - - return str_replace( - [ - '{{ component }}', - '{{ props }}', - '{{ bindings }}', - '{{ attributes }}', - '{{ slots }}', - '{{ defaultSlot }}', - ], - [ - $this->component, - $this->compileProps($bindings), - $this->compileBindings($bindings), - class_exists($class) ? '{{ $attributes }}' : '', - $this->compileSlots($data['__laravel_slots']), - '{{ $slot ?? "" }}', - ], - $template - ); - }; - } - - /** - * Compile the @props directive for the component. - * - * @param array $bindings - * @return string - */ - protected function compileProps(array $bindings) - { - if (empty($bindings)) { - return ''; - } - - return '@props('.'[\''.implode('\',\'', collect($bindings)->map(function ($dataKey) { - return Str::camel($dataKey); - })->all()).'\']'.')'; - } - - /** - * Compile the bindings for the component. - * - * @param array $bindings - * @return string - */ - protected function compileBindings(array $bindings) - { - return collect($bindings)->map(function ($key) { - return ':'.$key.'="$'.Str::camel(str_replace([':', '.'], ' ', $key)).'"'; - })->implode(' '); - } - - /** - * Compile the slots for the component. - * - * @param array $slots - * @return string - */ - protected function compileSlots(array $slots) - { - return collect($slots)->map(function ($slot, $name) { - return $name === '__default' ? null : 'attributes).'>{{ $'.$name.' }}'; - })->filter()->implode(PHP_EOL); - } - - /** - * Get the class for the current component. - * - * @return string - */ - protected function classForComponent() - { - if (isset(static::$componentClasses[$this->component])) { - return static::$componentClasses[$this->component]; - } - - return static::$componentClasses[$this->component] = - $this->compiler()->componentClass($this->component); - } - - /** - * Get the names of the variables that should be bound to the component. - * - * @param string $class - * @return array - */ - protected function bindings(string $class) - { - [$data, $attributes] = $this->compiler()->partitionDataAndAttributes($class, $this->attributes->getAttributes()); - - return array_keys($data->all()); - } - - /** - * Get an instance of the Blade tag compiler. - * - * @return \Illuminate\View\Compilers\ComponentTagCompiler - */ - protected function compiler() - { - if (! static::$compiler) { - static::$compiler = new ComponentTagCompiler( - Container::getInstance()->make('blade.compiler')->getClassComponentAliases(), - Container::getInstance()->make('blade.compiler')->getClassComponentNamespaces(), - Container::getInstance()->make('blade.compiler') - ); - } - - return static::$compiler; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php b/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php deleted file mode 100755 index 97fb0971..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php +++ /dev/null @@ -1,138 +0,0 @@ - - */ - protected $compiledOrNotExpired = []; - - /** - * Create a new compiler engine instance. - * - * @param \Illuminate\View\Compilers\CompilerInterface $compiler - * @param \Illuminate\Filesystem\Filesystem|null $files - * @return void - */ - public function __construct(CompilerInterface $compiler, Filesystem $files = null) - { - parent::__construct($files ?: new Filesystem); - - $this->compiler = $compiler; - } - - /** - * Get the evaluated contents of the view. - * - * @param string $path - * @param array $data - * @return string - */ - public function get($path, array $data = []) - { - $this->lastCompiled[] = $path; - - // If this given view has expired, which means it has simply been edited since - // it was last compiled, we will re-compile the views so we can evaluate a - // fresh copy of the view. We'll pass the compiler the path of the view. - if (! isset($this->compiledOrNotExpired[$path]) && $this->compiler->isExpired($path)) { - $this->compiler->compile($path); - } - - // Once we have the path to the compiled file, we will evaluate the paths with - // typical PHP just like any other templates. We also keep a stack of views - // which have been rendered for right exception messages to be generated. - - try { - $results = $this->evaluatePath($this->compiler->getCompiledPath($path), $data); - } catch (ViewException $e) { - if (! str($e->getMessage())->contains(['No such file or directory', 'File does not exist at path'])) { - throw $e; - } - - if (! isset($this->compiledOrNotExpired[$path])) { - throw $e; - } - - $this->compiler->compile($path); - - $results = $this->evaluatePath($this->compiler->getCompiledPath($path), $data); - } - - $this->compiledOrNotExpired[$path] = true; - - array_pop($this->lastCompiled); - - return $results; - } - - /** - * Handle a view exception. - * - * @param \Throwable $e - * @param int $obLevel - * @return void - * - * @throws \Throwable - */ - protected function handleViewException(Throwable $e, $obLevel) - { - $e = new ViewException($this->getMessage($e), 0, 1, $e->getFile(), $e->getLine(), $e); - - parent::handleViewException($e, $obLevel); - } - - /** - * Get the exception message for an exception. - * - * @param \Throwable $e - * @return string - */ - protected function getMessage(Throwable $e) - { - return $e->getMessage().' (View: '.realpath(last($this->lastCompiled)).')'; - } - - /** - * Get the compiler implementation. - * - * @return \Illuminate\View\Compilers\CompilerInterface - */ - public function getCompiler() - { - return $this->compiler; - } - - /** - * Clear the cache of views that were compiled or not expired. - * - * @return void - */ - public function forgetCompiledOrNotExpired() - { - $this->compiledOrNotExpired = []; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/Engines/Engine.php b/vendor/laravel/framework/src/Illuminate/View/Engines/Engine.php deleted file mode 100755 index bf5c748d..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/Engines/Engine.php +++ /dev/null @@ -1,23 +0,0 @@ -lastRendered; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/Engines/EngineResolver.php b/vendor/laravel/framework/src/Illuminate/View/Engines/EngineResolver.php deleted file mode 100755 index 67404077..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/Engines/EngineResolver.php +++ /dev/null @@ -1,71 +0,0 @@ -forget($engine); - - $this->resolvers[$engine] = $resolver; - } - - /** - * Resolve an engine instance by name. - * - * @param string $engine - * @return \Illuminate\Contracts\View\Engine - * - * @throws \InvalidArgumentException - */ - public function resolve($engine) - { - if (isset($this->resolved[$engine])) { - return $this->resolved[$engine]; - } - - if (isset($this->resolvers[$engine])) { - return $this->resolved[$engine] = call_user_func($this->resolvers[$engine]); - } - - throw new InvalidArgumentException("Engine [{$engine}] not found."); - } - - /** - * Remove a resolved engine. - * - * @param string $engine - * @return void - */ - public function forget($engine) - { - unset($this->resolved[$engine]); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/Engines/FileEngine.php b/vendor/laravel/framework/src/Illuminate/View/Engines/FileEngine.php deleted file mode 100644 index 992f6758..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/Engines/FileEngine.php +++ /dev/null @@ -1,39 +0,0 @@ -files = $files; - } - - /** - * Get the evaluated contents of the view. - * - * @param string $path - * @param array $data - * @return string - */ - public function get($path, array $data = []) - { - return $this->files->get($path); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php b/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php deleted file mode 100755 index 13525aee..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php +++ /dev/null @@ -1,83 +0,0 @@ -files = $files; - } - - /** - * Get the evaluated contents of the view. - * - * @param string $path - * @param array $data - * @return string - */ - public function get($path, array $data = []) - { - return $this->evaluatePath($path, $data); - } - - /** - * Get the evaluated contents of the view at the given path. - * - * @param string $path - * @param array $data - * @return string - */ - protected function evaluatePath($path, $data) - { - $obLevel = ob_get_level(); - - ob_start(); - - // We'll evaluate the contents of the view inside a try/catch block so we can - // flush out any stray output that might get out before an error occurs or - // an exception is thrown. This prevents any partial views from leaking. - try { - $this->files->getRequire($path, $data); - } catch (Throwable $e) { - $this->handleViewException($e, $obLevel); - } - - return ltrim(ob_get_clean()); - } - - /** - * Handle a view exception. - * - * @param \Throwable $e - * @param int $obLevel - * @return void - * - * @throws \Throwable - */ - protected function handleViewException(Throwable $e, $obLevel) - { - while (ob_get_level() > $obLevel) { - ob_end_clean(); - } - - throw $e; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/Factory.php b/vendor/laravel/framework/src/Illuminate/View/Factory.php deleted file mode 100755 index 315edc12..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/Factory.php +++ /dev/null @@ -1,614 +0,0 @@ - 'blade', - 'php' => 'php', - 'css' => 'file', - 'html' => 'file', - ]; - - /** - * The view composer events. - * - * @var array - */ - protected $composers = []; - - /** - * The number of active rendering operations. - * - * @var int - */ - protected $renderCount = 0; - - /** - * The "once" block IDs that have been rendered. - * - * @var array - */ - protected $renderedOnce = []; - - /** - * Create a new view factory instance. - * - * @param \Illuminate\View\Engines\EngineResolver $engines - * @param \Illuminate\View\ViewFinderInterface $finder - * @param \Illuminate\Contracts\Events\Dispatcher $events - * @return void - */ - public function __construct(EngineResolver $engines, ViewFinderInterface $finder, Dispatcher $events) - { - $this->finder = $finder; - $this->events = $events; - $this->engines = $engines; - - $this->share('__env', $this); - } - - /** - * Get the evaluated view contents for the given view. - * - * @param string $path - * @param \Illuminate\Contracts\Support\Arrayable|array $data - * @param array $mergeData - * @return \Illuminate\Contracts\View\View - */ - public function file($path, $data = [], $mergeData = []) - { - $data = array_merge($mergeData, $this->parseData($data)); - - return tap($this->viewInstance($path, $path, $data), function ($view) { - $this->callCreator($view); - }); - } - - /** - * Get the evaluated view contents for the given view. - * - * @param string $view - * @param \Illuminate\Contracts\Support\Arrayable|array $data - * @param array $mergeData - * @return \Illuminate\Contracts\View\View - */ - public function make($view, $data = [], $mergeData = []) - { - $path = $this->finder->find( - $view = $this->normalizeName($view) - ); - - // Next, we will create the view instance and call the view creator for the view - // which can set any data, etc. Then we will return the view instance back to - // the caller for rendering or performing other view manipulations on this. - $data = array_merge($mergeData, $this->parseData($data)); - - return tap($this->viewInstance($view, $path, $data), function ($view) { - $this->callCreator($view); - }); - } - - /** - * Get the first view that actually exists from the given list. - * - * @param array $views - * @param \Illuminate\Contracts\Support\Arrayable|array $data - * @param array $mergeData - * @return \Illuminate\Contracts\View\View - * - * @throws \InvalidArgumentException - */ - public function first(array $views, $data = [], $mergeData = []) - { - $view = Arr::first($views, function ($view) { - return $this->exists($view); - }); - - if (! $view) { - throw new InvalidArgumentException('None of the views in the given array exist.'); - } - - return $this->make($view, $data, $mergeData); - } - - /** - * Get the rendered content of the view based on a given condition. - * - * @param bool $condition - * @param string $view - * @param \Illuminate\Contracts\Support\Arrayable|array $data - * @param array $mergeData - * @return string - */ - public function renderWhen($condition, $view, $data = [], $mergeData = []) - { - if (! $condition) { - return ''; - } - - return $this->make($view, $this->parseData($data), $mergeData)->render(); - } - - /** - * Get the rendered content of the view based on the negation of a given condition. - * - * @param bool $condition - * @param string $view - * @param \Illuminate\Contracts\Support\Arrayable|array $data - * @param array $mergeData - * @return string - */ - public function renderUnless($condition, $view, $data = [], $mergeData = []) - { - return $this->renderWhen(! $condition, $view, $data, $mergeData); - } - - /** - * Get the rendered contents of a partial from a loop. - * - * @param string $view - * @param array $data - * @param string $iterator - * @param string $empty - * @return string - */ - public function renderEach($view, $data, $iterator, $empty = 'raw|') - { - $result = ''; - - // If is actually data in the array, we will loop through the data and append - // an instance of the partial view to the final result HTML passing in the - // iterated value of this data array, allowing the views to access them. - if (count($data) > 0) { - foreach ($data as $key => $value) { - $result .= $this->make( - $view, ['key' => $key, $iterator => $value] - )->render(); - } - } - - // If there is no data in the array, we will render the contents of the empty - // view. Alternatively, the "empty view" could be a raw string that begins - // with "raw|" for convenience and to let this know that it is a string. - else { - $result = str_starts_with($empty, 'raw|') - ? substr($empty, 4) - : $this->make($empty)->render(); - } - - return $result; - } - - /** - * Normalize a view name. - * - * @param string $name - * @return string - */ - protected function normalizeName($name) - { - return ViewName::normalize($name); - } - - /** - * Parse the given data into a raw array. - * - * @param mixed $data - * @return array - */ - protected function parseData($data) - { - return $data instanceof Arrayable ? $data->toArray() : $data; - } - - /** - * Create a new view instance from the given arguments. - * - * @param string $view - * @param string $path - * @param \Illuminate\Contracts\Support\Arrayable|array $data - * @return \Illuminate\Contracts\View\View - */ - protected function viewInstance($view, $path, $data) - { - return new View($this, $this->getEngineFromPath($path), $view, $path, $data); - } - - /** - * Determine if a given view exists. - * - * @param string $view - * @return bool - */ - public function exists($view) - { - try { - $this->finder->find($view); - } catch (InvalidArgumentException $e) { - return false; - } - - return true; - } - - /** - * Get the appropriate view engine for the given path. - * - * @param string $path - * @return \Illuminate\Contracts\View\Engine - * - * @throws \InvalidArgumentException - */ - public function getEngineFromPath($path) - { - if (! $extension = $this->getExtension($path)) { - throw new InvalidArgumentException("Unrecognized extension in file: {$path}."); - } - - $engine = $this->extensions[$extension]; - - return $this->engines->resolve($engine); - } - - /** - * Get the extension used by the view file. - * - * @param string $path - * @return string|null - */ - protected function getExtension($path) - { - $extensions = array_keys($this->extensions); - - return Arr::first($extensions, function ($value) use ($path) { - return str_ends_with($path, '.'.$value); - }); - } - - /** - * Add a piece of shared data to the environment. - * - * @param array|string $key - * @param mixed|null $value - * @return mixed - */ - public function share($key, $value = null) - { - $keys = is_array($key) ? $key : [$key => $value]; - - foreach ($keys as $key => $value) { - $this->shared[$key] = $value; - } - - return $value; - } - - /** - * Increment the rendering counter. - * - * @return void - */ - public function incrementRender() - { - $this->renderCount++; - } - - /** - * Decrement the rendering counter. - * - * @return void - */ - public function decrementRender() - { - $this->renderCount--; - } - - /** - * Check if there are no active render operations. - * - * @return bool - */ - public function doneRendering() - { - return $this->renderCount == 0; - } - - /** - * Determine if the given once token has been rendered. - * - * @param string $id - * @return bool - */ - public function hasRenderedOnce(string $id) - { - return isset($this->renderedOnce[$id]); - } - - /** - * Mark the given once token as having been rendered. - * - * @param string $id - * @return void - */ - public function markAsRenderedOnce(string $id) - { - $this->renderedOnce[$id] = true; - } - - /** - * Add a location to the array of view locations. - * - * @param string $location - * @return void - */ - public function addLocation($location) - { - $this->finder->addLocation($location); - } - - /** - * Add a new namespace to the loader. - * - * @param string $namespace - * @param string|array $hints - * @return $this - */ - public function addNamespace($namespace, $hints) - { - $this->finder->addNamespace($namespace, $hints); - - return $this; - } - - /** - * Prepend a new namespace to the loader. - * - * @param string $namespace - * @param string|array $hints - * @return $this - */ - public function prependNamespace($namespace, $hints) - { - $this->finder->prependNamespace($namespace, $hints); - - return $this; - } - - /** - * Replace the namespace hints for the given namespace. - * - * @param string $namespace - * @param string|array $hints - * @return $this - */ - public function replaceNamespace($namespace, $hints) - { - $this->finder->replaceNamespace($namespace, $hints); - - return $this; - } - - /** - * Register a valid view extension and its engine. - * - * @param string $extension - * @param string $engine - * @param \Closure|null $resolver - * @return void - */ - public function addExtension($extension, $engine, $resolver = null) - { - $this->finder->addExtension($extension); - - if (isset($resolver)) { - $this->engines->register($engine, $resolver); - } - - unset($this->extensions[$extension]); - - $this->extensions = array_merge([$extension => $engine], $this->extensions); - } - - /** - * Flush all of the factory state like sections and stacks. - * - * @return void - */ - public function flushState() - { - $this->renderCount = 0; - $this->renderedOnce = []; - - $this->flushSections(); - $this->flushStacks(); - $this->flushComponents(); - $this->flushFragments(); - } - - /** - * Flush all of the section contents if done rendering. - * - * @return void - */ - public function flushStateIfDoneRendering() - { - if ($this->doneRendering()) { - $this->flushState(); - } - } - - /** - * Get the extension to engine bindings. - * - * @return array - */ - public function getExtensions() - { - return $this->extensions; - } - - /** - * Get the engine resolver instance. - * - * @return \Illuminate\View\Engines\EngineResolver - */ - public function getEngineResolver() - { - return $this->engines; - } - - /** - * Get the view finder instance. - * - * @return \Illuminate\View\ViewFinderInterface - */ - public function getFinder() - { - return $this->finder; - } - - /** - * Set the view finder instance. - * - * @param \Illuminate\View\ViewFinderInterface $finder - * @return void - */ - public function setFinder(ViewFinderInterface $finder) - { - $this->finder = $finder; - } - - /** - * Flush the cache of views located by the finder. - * - * @return void - */ - public function flushFinderCache() - { - $this->getFinder()->flush(); - } - - /** - * Get the event dispatcher instance. - * - * @return \Illuminate\Contracts\Events\Dispatcher - */ - public function getDispatcher() - { - return $this->events; - } - - /** - * Set the event dispatcher instance. - * - * @param \Illuminate\Contracts\Events\Dispatcher $events - * @return void - */ - public function setDispatcher(Dispatcher $events) - { - $this->events = $events; - } - - /** - * Get the IoC container instance. - * - * @return \Illuminate\Contracts\Container\Container - */ - public function getContainer() - { - return $this->container; - } - - /** - * Set the IoC container instance. - * - * @param \Illuminate\Contracts\Container\Container $container - * @return void - */ - public function setContainer(Container $container) - { - $this->container = $container; - } - - /** - * Get an item from the shared data. - * - * @param string $key - * @param mixed $default - * @return mixed - */ - public function shared($key, $default = null) - { - return Arr::get($this->shared, $key, $default); - } - - /** - * Get all of the shared data for the environment. - * - * @return array - */ - public function getShared() - { - return $this->shared; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/FileViewFinder.php b/vendor/laravel/framework/src/Illuminate/View/FileViewFinder.php deleted file mode 100755 index 5502fe5a..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/FileViewFinder.php +++ /dev/null @@ -1,330 +0,0 @@ -files = $files; - $this->paths = array_map([$this, 'resolvePath'], $paths); - - if (isset($extensions)) { - $this->extensions = $extensions; - } - } - - /** - * Get the fully qualified location of the view. - * - * @param string $name - * @return string - */ - public function find($name) - { - if (isset($this->views[$name])) { - return $this->views[$name]; - } - - if ($this->hasHintInformation($name = trim($name))) { - return $this->views[$name] = $this->findNamespacedView($name); - } - - return $this->views[$name] = $this->findInPaths($name, $this->paths); - } - - /** - * Get the path to a template with a named path. - * - * @param string $name - * @return string - */ - protected function findNamespacedView($name) - { - [$namespace, $view] = $this->parseNamespaceSegments($name); - - return $this->findInPaths($view, $this->hints[$namespace]); - } - - /** - * Get the segments of a template with a named path. - * - * @param string $name - * @return array - * - * @throws \InvalidArgumentException - */ - protected function parseNamespaceSegments($name) - { - $segments = explode(static::HINT_PATH_DELIMITER, $name); - - if (count($segments) !== 2) { - throw new InvalidArgumentException("View [{$name}] has an invalid name."); - } - - if (! isset($this->hints[$segments[0]])) { - throw new InvalidArgumentException("No hint path defined for [{$segments[0]}]."); - } - - return $segments; - } - - /** - * Find the given view in the list of paths. - * - * @param string $name - * @param array $paths - * @return string - * - * @throws \InvalidArgumentException - */ - protected function findInPaths($name, $paths) - { - foreach ((array) $paths as $path) { - foreach ($this->getPossibleViewFiles($name) as $file) { - if ($this->files->exists($viewPath = $path.'/'.$file)) { - return $viewPath; - } - } - } - - throw new InvalidArgumentException("View [{$name}] not found."); - } - - /** - * Get an array of possible view files. - * - * @param string $name - * @return array - */ - protected function getPossibleViewFiles($name) - { - return array_map(fn ($extension) => str_replace('.', '/', $name).'.'.$extension, $this->extensions); - } - - /** - * Add a location to the finder. - * - * @param string $location - * @return void - */ - public function addLocation($location) - { - $this->paths[] = $this->resolvePath($location); - } - - /** - * Prepend a location to the finder. - * - * @param string $location - * @return void - */ - public function prependLocation($location) - { - array_unshift($this->paths, $this->resolvePath($location)); - } - - /** - * Resolve the path. - * - * @param string $path - * @return string - */ - protected function resolvePath($path) - { - return realpath($path) ?: $path; - } - - /** - * Add a namespace hint to the finder. - * - * @param string $namespace - * @param string|array $hints - * @return void - */ - public function addNamespace($namespace, $hints) - { - $hints = (array) $hints; - - if (isset($this->hints[$namespace])) { - $hints = array_merge($this->hints[$namespace], $hints); - } - - $this->hints[$namespace] = $hints; - } - - /** - * Prepend a namespace hint to the finder. - * - * @param string $namespace - * @param string|array $hints - * @return void - */ - public function prependNamespace($namespace, $hints) - { - $hints = (array) $hints; - - if (isset($this->hints[$namespace])) { - $hints = array_merge($hints, $this->hints[$namespace]); - } - - $this->hints[$namespace] = $hints; - } - - /** - * Replace the namespace hints for the given namespace. - * - * @param string $namespace - * @param string|array $hints - * @return void - */ - public function replaceNamespace($namespace, $hints) - { - $this->hints[$namespace] = (array) $hints; - } - - /** - * Register an extension with the view finder. - * - * @param string $extension - * @return void - */ - public function addExtension($extension) - { - if (($index = array_search($extension, $this->extensions)) !== false) { - unset($this->extensions[$index]); - } - - array_unshift($this->extensions, $extension); - } - - /** - * Returns whether or not the view name has any hint information. - * - * @param string $name - * @return bool - */ - public function hasHintInformation($name) - { - return strpos($name, static::HINT_PATH_DELIMITER) > 0; - } - - /** - * Flush the cache of located views. - * - * @return void - */ - public function flush() - { - $this->views = []; - } - - /** - * Get the filesystem instance. - * - * @return \Illuminate\Filesystem\Filesystem - */ - public function getFilesystem() - { - return $this->files; - } - - /** - * Set the active view paths. - * - * @param array $paths - * @return $this - */ - public function setPaths($paths) - { - $this->paths = $paths; - - return $this; - } - - /** - * Get the active view paths. - * - * @return array - */ - public function getPaths() - { - return $this->paths; - } - - /** - * Get the views that have been located. - * - * @return array - */ - public function getViews() - { - return $this->views; - } - - /** - * Get the namespace to file path hints. - * - * @return array - */ - public function getHints() - { - return $this->hints; - } - - /** - * Get registered extensions. - * - * @return array - */ - public function getExtensions() - { - return $this->extensions; - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/InvokableComponentVariable.php b/vendor/laravel/framework/src/Illuminate/View/InvokableComponentVariable.php deleted file mode 100644 index 0d43ae3d..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/InvokableComponentVariable.php +++ /dev/null @@ -1,96 +0,0 @@ -callable = $callable; - } - - /** - * Resolve the displayable value that the class is deferring. - * - * @return \Illuminate\Contracts\Support\Htmlable|string - */ - public function resolveDisplayableValue() - { - return $this->__invoke(); - } - - /** - * Get an interator instance for the variable. - * - * @return \ArrayIterator - */ - public function getIterator(): Traversable - { - $result = $this->__invoke(); - - return new ArrayIterator($result instanceof Enumerable ? $result->all() : $result); - } - - /** - * Dynamically proxy attribute access to the variable. - * - * @param string $key - * @return mixed - */ - public function __get($key) - { - return $this->__invoke()->{$key}; - } - - /** - * Dynamically proxy method access to the variable. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - return $this->__invoke()->{$method}(...$parameters); - } - - /** - * Resolve the variable. - * - * @return mixed - */ - public function __invoke() - { - return call_user_func($this->callable); - } - - /** - * Resolve the variable as a string. - * - * @return mixed - */ - public function __toString() - { - return (string) $this->__invoke(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/LICENSE.md b/vendor/laravel/framework/src/Illuminate/View/LICENSE.md deleted file mode 100644 index 79810c84..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Taylor Otwell - -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/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php b/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php deleted file mode 100644 index 64015d58..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php +++ /dev/null @@ -1,51 +0,0 @@ -view = $view; - } - - /** - * Handle an incoming request. - * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @return mixed - */ - public function handle($request, Closure $next) - { - // If the current session has an "errors" variable bound to it, we will share - // its value with all view instances so the views can easily access errors - // without having to bind. An empty bag is set when there aren't errors. - $this->view->share( - 'errors', $request->session()->get('errors') ?: new ViewErrorBag - ); - - // Putting the errors in the view for every view allows the developer to just - // assume that some errors are always available, which is convenient since - // they don't have to continually run checks for the presence of errors. - - return $next($request); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/View.php b/vendor/laravel/framework/src/Illuminate/View/View.php deleted file mode 100755 index a5e09585..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/View.php +++ /dev/null @@ -1,451 +0,0 @@ -view = $view; - $this->path = $path; - $this->engine = $engine; - $this->factory = $factory; - - $this->data = $data instanceof Arrayable ? $data->toArray() : (array) $data; - } - - /** - * Get the evaluated contents of a given fragment. - * - * @param string $fragment - * @return string - */ - public function fragment($fragment) - { - return $this->render(function () use ($fragment) { - return $this->factory->getFragment($fragment); - }); - } - - /** - * Get the string contents of the view. - * - * @param callable|null $callback - * @return string - * - * @throws \Throwable - */ - public function render(callable $callback = null) - { - try { - $contents = $this->renderContents(); - - $response = isset($callback) ? $callback($this, $contents) : null; - - // Once we have the contents of the view, we will flush the sections if we are - // done rendering all views so that there is nothing left hanging over when - // another view gets rendered in the future by the application developer. - $this->factory->flushStateIfDoneRendering(); - - return ! is_null($response) ? $response : $contents; - } catch (Throwable $e) { - $this->factory->flushState(); - - throw $e; - } - } - - /** - * Get the contents of the view instance. - * - * @return string - */ - protected function renderContents() - { - // We will keep track of the number of views being rendered so we can flush - // the section after the complete rendering operation is done. This will - // clear out the sections for any separate views that may be rendered. - $this->factory->incrementRender(); - - $this->factory->callComposer($this); - - $contents = $this->getContents(); - - // Once we've finished rendering the view, we'll decrement the render count - // so that each section gets flushed out next time a view is created and - // no old sections are staying around in the memory of an environment. - $this->factory->decrementRender(); - - return $contents; - } - - /** - * Get the evaluated contents of the view. - * - * @return string - */ - protected function getContents() - { - return $this->engine->get($this->path, $this->gatherData()); - } - - /** - * Get the data bound to the view instance. - * - * @return array - */ - public function gatherData() - { - $data = array_merge($this->factory->getShared(), $this->data); - - foreach ($data as $key => $value) { - if ($value instanceof Renderable) { - $data[$key] = $value->render(); - } - } - - return $data; - } - - /** - * Get the sections of the rendered view. - * - * @return array - * - * @throws \Throwable - */ - public function renderSections() - { - return $this->render(function () { - return $this->factory->getSections(); - }); - } - - /** - * Add a piece of data to the view. - * - * @param string|array $key - * @param mixed $value - * @return $this - */ - public function with($key, $value = null) - { - if (is_array($key)) { - $this->data = array_merge($this->data, $key); - } else { - $this->data[$key] = $value; - } - - return $this; - } - - /** - * Add a view instance to the view data. - * - * @param string $key - * @param string $view - * @param array $data - * @return $this - */ - public function nest($key, $view, array $data = []) - { - return $this->with($key, $this->factory->make($view, $data)); - } - - /** - * Add validation errors to the view. - * - * @param \Illuminate\Contracts\Support\MessageProvider|array $provider - * @param string $bag - * @return $this - */ - public function withErrors($provider, $bag = 'default') - { - return $this->with('errors', (new ViewErrorBag)->put( - $bag, $this->formatErrors($provider) - )); - } - - /** - * Parse the given errors into an appropriate value. - * - * @param \Illuminate\Contracts\Support\MessageProvider|array|string $provider - * @return \Illuminate\Support\MessageBag - */ - protected function formatErrors($provider) - { - return $provider instanceof MessageProvider - ? $provider->getMessageBag() - : new MessageBag((array) $provider); - } - - /** - * Get the name of the view. - * - * @return string - */ - public function name() - { - return $this->getName(); - } - - /** - * Get the name of the view. - * - * @return string - */ - public function getName() - { - return $this->view; - } - - /** - * Get the array of view data. - * - * @return array - */ - public function getData() - { - return $this->data; - } - - /** - * Get the path to the view file. - * - * @return string - */ - public function getPath() - { - return $this->path; - } - - /** - * Set the path to the view. - * - * @param string $path - * @return void - */ - public function setPath($path) - { - $this->path = $path; - } - - /** - * Get the view factory instance. - * - * @return \Illuminate\View\Factory - */ - public function getFactory() - { - return $this->factory; - } - - /** - * Get the view's rendering engine. - * - * @return \Illuminate\Contracts\View\Engine - */ - public function getEngine() - { - return $this->engine; - } - - /** - * Determine if a piece of data is bound. - * - * @param string $key - * @return bool - */ - public function offsetExists($key): bool - { - return array_key_exists($key, $this->data); - } - - /** - * Get a piece of bound data to the view. - * - * @param string $key - * @return mixed - */ - public function offsetGet($key): mixed - { - return $this->data[$key]; - } - - /** - * Set a piece of data on the view. - * - * @param string $key - * @param mixed $value - * @return void - */ - public function offsetSet($key, $value): void - { - $this->with($key, $value); - } - - /** - * Unset a piece of data from the view. - * - * @param string $key - * @return void - */ - public function offsetUnset($key): void - { - unset($this->data[$key]); - } - - /** - * Get a piece of data from the view. - * - * @param string $key - * @return mixed - */ - public function &__get($key) - { - return $this->data[$key]; - } - - /** - * Set a piece of data on the view. - * - * @param string $key - * @param mixed $value - * @return void - */ - public function __set($key, $value) - { - $this->with($key, $value); - } - - /** - * Check if a piece of data is bound to the view. - * - * @param string $key - * @return bool - */ - public function __isset($key) - { - return isset($this->data[$key]); - } - - /** - * Remove a piece of bound data from the view. - * - * @param string $key - * @return void - */ - public function __unset($key) - { - unset($this->data[$key]); - } - - /** - * Dynamically bind parameters to the view. - * - * @param string $method - * @param array $parameters - * @return \Illuminate\View\View - * - * @throws \BadMethodCallException - */ - public function __call($method, $parameters) - { - if (static::hasMacro($method)) { - return $this->macroCall($method, $parameters); - } - - if (! str_starts_with($method, 'with')) { - throw new BadMethodCallException(sprintf( - 'Method %s::%s does not exist.', static::class, $method - )); - } - - return $this->with(Str::camel(substr($method, 4)), $parameters[0]); - } - - /** - * Get content as a string of HTML. - * - * @return string - */ - public function toHtml() - { - return $this->render(); - } - - /** - * Get the string contents of the view. - * - * @return string - * - * @throws \Throwable - */ - public function __toString() - { - return $this->render(); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/ViewException.php b/vendor/laravel/framework/src/Illuminate/View/ViewException.php deleted file mode 100644 index 77f9ee65..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/ViewException.php +++ /dev/null @@ -1,41 +0,0 @@ -getPrevious(); - - if (Reflector::isCallable($reportCallable = [$exception, 'report'])) { - return Container::getInstance()->call($reportCallable); - } - - return false; - } - - /** - * Render the exception into an HTTP response. - * - * @param \Illuminate\Http\Request $request - * @return \Illuminate\Http\Response|null - */ - public function render($request) - { - $exception = $this->getPrevious(); - - if ($exception && method_exists($exception, 'render')) { - return $exception->render($request); - } - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/ViewFinderInterface.php b/vendor/laravel/framework/src/Illuminate/View/ViewFinderInterface.php deleted file mode 100755 index 7b8a849e..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/ViewFinderInterface.php +++ /dev/null @@ -1,71 +0,0 @@ -registerFactory(); - $this->registerViewFinder(); - $this->registerBladeCompiler(); - $this->registerEngineResolver(); - - $this->app->terminating(static function () { - Component::flushCache(); - }); - } - - /** - * Register the view environment. - * - * @return void - */ - public function registerFactory() - { - $this->app->singleton('view', function ($app) { - // Next we need to grab the engine resolver instance that will be used by the - // environment. The resolver will be used by an environment to get each of - // the various engine implementations such as plain PHP or Blade engine. - $resolver = $app['view.engine.resolver']; - - $finder = $app['view.finder']; - - $factory = $this->createFactory($resolver, $finder, $app['events']); - - // We will also set the container instance on this view environment since the - // view composers may be classes registered in the container, which allows - // for great testable, flexible composers for the application developer. - $factory->setContainer($app); - - $factory->share('app', $app); - - $app->terminating(static function () { - Component::forgetFactory(); - }); - - return $factory; - }); - } - - /** - * Create a new Factory Instance. - * - * @param \Illuminate\View\Engines\EngineResolver $resolver - * @param \Illuminate\View\ViewFinderInterface $finder - * @param \Illuminate\Contracts\Events\Dispatcher $events - * @return \Illuminate\View\Factory - */ - protected function createFactory($resolver, $finder, $events) - { - return new Factory($resolver, $finder, $events); - } - - /** - * Register the view finder implementation. - * - * @return void - */ - public function registerViewFinder() - { - $this->app->bind('view.finder', function ($app) { - return new FileViewFinder($app['files'], $app['config']['view.paths']); - }); - } - - /** - * Register the Blade compiler implementation. - * - * @return void - */ - public function registerBladeCompiler() - { - $this->app->singleton('blade.compiler', function ($app) { - return tap(new BladeCompiler( - $app['files'], - $app['config']['view.compiled'], - $app['config']->get('view.relative_hash', false) ? $app->basePath() : '', - $app['config']->get('view.cache', true), - $app['config']->get('view.compiled_extension', 'php'), - ), function ($blade) { - $blade->component('dynamic-component', DynamicComponent::class); - }); - }); - } - - /** - * Register the engine resolver instance. - * - * @return void - */ - public function registerEngineResolver() - { - $this->app->singleton('view.engine.resolver', function () { - $resolver = new EngineResolver; - - // Next, we will register the various view engines with the resolver so that the - // environment will resolve the engines needed for various views based on the - // extension of view file. We call a method for each of the view's engines. - foreach (['file', 'php', 'blade'] as $engine) { - $this->{'register'.ucfirst($engine).'Engine'}($resolver); - } - - return $resolver; - }); - } - - /** - * Register the file engine implementation. - * - * @param \Illuminate\View\Engines\EngineResolver $resolver - * @return void - */ - public function registerFileEngine($resolver) - { - $resolver->register('file', function () { - return new FileEngine($this->app['files']); - }); - } - - /** - * Register the PHP engine implementation. - * - * @param \Illuminate\View\Engines\EngineResolver $resolver - * @return void - */ - public function registerPhpEngine($resolver) - { - $resolver->register('php', function () { - return new PhpEngine($this->app['files']); - }); - } - - /** - * Register the Blade engine implementation. - * - * @param \Illuminate\View\Engines\EngineResolver $resolver - * @return void - */ - public function registerBladeEngine($resolver) - { - $resolver->register('blade', function () { - $compiler = new CompilerEngine($this->app['blade.compiler'], $this->app['files']); - - $this->app->terminating(static function () use ($compiler) { - $compiler->forgetCompiledOrNotExpired(); - }); - - return $compiler; - }); - } -} diff --git a/vendor/laravel/framework/src/Illuminate/View/composer.json b/vendor/laravel/framework/src/Illuminate/View/composer.json deleted file mode 100644 index 7487d55d..00000000 --- a/vendor/laravel/framework/src/Illuminate/View/composer.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "illuminate/view", - "description": "The Illuminate View package.", - "license": "MIT", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "require": { - "php": "^8.0.2", - "ext-json": "*", - "illuminate/collections": "^9.0", - "illuminate/container": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/events": "^9.0", - "illuminate/filesystem": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0" - }, - "autoload": { - "psr-4": { - "Illuminate\\View\\": "" - } - }, - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev" -} diff --git a/vendor/laravel/pint/LICENSE.md b/vendor/laravel/pint/LICENSE.md deleted file mode 100644 index 79810c84..00000000 --- a/vendor/laravel/pint/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Taylor Otwell - -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/laravel/pint/builds/pint b/vendor/laravel/pint/builds/pint deleted file mode 100755 index 5019e802..00000000 Binary files a/vendor/laravel/pint/builds/pint and /dev/null differ diff --git a/vendor/laravel/pint/composer.json b/vendor/laravel/pint/composer.json deleted file mode 100644 index 0d0ce114..00000000 --- a/vendor/laravel/pint/composer.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "laravel/pint", - "description": "An opinionated code formatter for PHP.", - "keywords": ["php", "format", "formatter", "lint", "linter"], - "homepage": "https://laravel.com", - "type": "project", - "license": "MIT", - "support": { - "issues": "https://github.com/laravel/pint/issues", - "source": "https://github.com/laravel/pint" - }, - "authors": [ - { - "name": "Nuno Maduro", - "email": "enunomaduro@gmail.com" - } - ], - "require": { - "php": "^8.0", - "ext-json": "*", - "ext-mbstring": "*", - "ext-tokenizer": "*", - "ext-xml": "*" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "~3.13.1", - "illuminate/view": "^9.32.0", - "laravel-zero/framework": "^9.2.0", - "mockery/mockery": "^1.5.1", - "nunomaduro/larastan": "^2.2.0", - "nunomaduro/termwind": "^1.14.0", - "pestphp/pest": "^1.22.1" - }, - "autoload": { - "psr-4": { - "App\\": "app/", - "Database\\Factories\\": "database/factories/", - "Database\\Seeders\\": "database/seeders/" - } - }, - "autoload-dev": { - "psr-4": { - "Scripts\\": "scripts/", - "Tests\\": "tests/" - } - }, - "config": { - "preferred-install": "dist", - "sort-packages": true, - "optimize-autoloader": true, - "platform": { - "php": "8.0.2" - }, - "allow-plugins": { - "pestphp/pest-plugin": true - } - }, - "minimum-stability": "dev", - "prefer-stable": true, - "bin": ["builds/pint"] -} diff --git a/vendor/laravel/serializable-closure/LICENSE.md b/vendor/laravel/serializable-closure/LICENSE.md deleted file mode 100644 index 79810c84..00000000 --- a/vendor/laravel/serializable-closure/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Taylor Otwell - -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/laravel/serializable-closure/README.md b/vendor/laravel/serializable-closure/README.md deleted file mode 100644 index a9c25135..00000000 --- a/vendor/laravel/serializable-closure/README.md +++ /dev/null @@ -1,71 +0,0 @@ -# Serializable Closure - - - Build Status - - - Total Downloads - - - Latest Stable Version - - - License - - -## 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. - -## 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 7142366b..00000000 --- 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 1a62922e..00000000 --- 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(); - } - - /** - * 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 0ff8410c..00000000 --- a/vendor/laravel/serializable-closure/src/Serializers/Native.php +++ /dev/null @@ -1,513 +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 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) { - 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 391d20d6..00000000 --- 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 d94b0a2a..00000000 --- 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 64ca19a3..00000000 --- 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 a0d37075..00000000 --- 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 58319504..00000000 --- a/vendor/laravel/serializable-closure/src/Support/SelfReference.php +++ /dev/null @@ -1,24 +0,0 @@ -hash = $hash; - } -} diff --git a/vendor/league/commonmark/.phpstorm.meta.php b/vendor/league/commonmark/.phpstorm.meta.php deleted file mode 100644 index 2b1c7450..00000000 --- a/vendor/league/commonmark/.phpstorm.meta.php +++ /dev/null @@ -1,98 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace PHPSTORM_META -{ - expectedArguments(\League\CommonMark\Util\HtmlElement::__construct(), 0, 'a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kdb', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'pre', 'progress', 'q', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr'); - - expectedArguments(\League\CommonMark\Extension\CommonMark\Node\Block\Heading::__construct(), 0, 1, 2, 3, 4, 5, 6); - expectedReturnValues(\League\CommonMark\Extension\CommonMark\Node\Block\Heading::getLevel(), 1, 2, 3, 4, 5, 6); - - registerArgumentsSet('league_commonmark_htmlblock_types', \League\CommonMark\Extension\CommonMark\Node\Block\HtmlBlock::TYPE_1_CODE_CONTAINER, \League\CommonMark\Extension\CommonMark\Node\Block\HtmlBlock::TYPE_2_COMMENT, \League\CommonMark\Extension\CommonMark\Node\Block\HtmlBlock::TYPE_3, \League\CommonMark\Extension\CommonMark\Node\Block\HtmlBlock::TYPE_4, \League\CommonMark\Extension\CommonMark\Node\Block\HtmlBlock::TYPE_5_CDATA, \League\CommonMark\Extension\CommonMark\Node\Block\HtmlBlock::TYPE_6_BLOCK_ELEMENT, \League\CommonMark\Extension\CommonMark\Node\Block\HtmlBlock::TYPE_7_MISC_ELEMENT); - expectedArguments(\League\CommonMark\Extension\CommonMark\Node\Block\HtmlBlock::__construct(), 0, argumentsSet('league_commonmark_htmlblock_types')); - expectedArguments(\League\CommonMark\Extension\CommonMark\Node\Block\HtmlBlock::setType(), 0, argumentsSet('league_commonmark_htmlblock_types')); - expectedReturnValues(\League\CommonMark\Extension\CommonMark\Node\Block\HtmlBlock::getType(), argumentsSet('league_commonmark_htmlblock_types')); - expectedArguments(\League\CommonMark\Util\RegexHelper::getHtmlBlockOpenRegex(), 0, argumentsSet('league_commonmark_htmlblock_types')); - expectedArguments(\League\CommonMark\Util\RegexHelper::getHtmlBlockCloseRegex(), 0, argumentsSet('league_commonmark_htmlblock_types')); - - registerArgumentsSet('league_commonmark_newline_types', \League\CommonMark\Node\Inline\Newline::HARDBREAK, \League\CommonMark\Node\Inline\Newline::SOFTBREAK); - expectedArguments(\League\CommonMark\Node\Inline\Newline::__construct(), 0, argumentsSet('league_commonmark_newline_types')); - expectedReturnValues(\League\CommonMark\Node\Inline\Newline::getType(), argumentsSet('league_commonmark_newline_types')); - - registerArgumentsSet('league_commonmark_options', - 'html_input', - 'allow_unsafe_links', - 'max_nesting_level', - 'renderer', - 'renderer/block_separator', - 'renderer/inner_separator', - 'renderer/soft_break', - 'commonmark', - 'commonmark/enable_em', - 'commonmark/enable_strong', - 'commonmark/use_asterisk', - 'commonmark/use_underscore', - 'commonmark/unordered_list_markers', - 'disallowed_raw_html', - 'disallowed_raw_html/disallowed_tags', - 'external_link', - 'external_link/html_class', - 'external_link/internal_hosts', - 'external_link/nofollow', - 'external_link/noopener', - 'external_link/noreferrer', - 'external_link/open_in_new_window', - 'footnote', - 'footnote/backref_class', - 'footnote/backref_symbol', - 'footnote/container_add_hr', - 'footnote/container_class', - 'footnote/ref_class', - 'footnote/ref_id_prefix', - 'footnote/footnote_class', - 'footnote/footnote_id_prefix', - 'heading_permalink', - 'heading_permalink/html_class', - 'heading_permalink/fragment_prefix', - 'heading_permalink/id_prefix', - 'heading_permalink/inner_contents', - 'heading_permalink/insert', - 'heading_permalink/max_heading_level', - 'heading_permalink/min_heading_level', - 'heading_permalink/symbol', - 'heading_permalink/title', - 'mentions', - 'smartpunct/double_quote_closer', - 'smartpunct/double_quote_opener', - 'smartpunct/single_quote_closer', - 'smartpunct/single_quote_opener', - 'slug_normalizer', - 'slug_normalizer/instance', - 'slug_normalizer/max_length', - 'slug_normalizer/unique', - 'table', - 'table/wrap', - 'table/wrap/attributes', - 'table/wrap/enabled', - 'table/wrap/tag', - 'table_of_contents', - 'table_of_contents/html_class', - 'table_of_contents/max_heading_level', - 'table_of_contents/min_heading_level', - 'table_of_contents/normalize', - 'table_of_contents/placeholder', - 'table_of_contents/position', - 'table_of_contents/style', - ); - expectedArguments(\League\Config\ConfigurationInterface::get(), 0, argumentsSet('league_commonmark_options')); - expectedArguments(\League\Config\ConfigurationInterface::exists(), 0, argumentsSet('league_commonmark_options')); - expectedArguments(\League\Config\MutableConfigurationInterface::set(), 0, argumentsSet('league_commonmark_options')); -} diff --git a/vendor/league/commonmark/CHANGELOG.md b/vendor/league/commonmark/CHANGELOG.md deleted file mode 100644 index 1a246b01..00000000 --- a/vendor/league/commonmark/CHANGELOG.md +++ /dev/null @@ -1,544 +0,0 @@ -# Change Log -All notable changes to this project will be documented in this file. -Updates should follow the [Keep a CHANGELOG](https://keepachangelog.com/) principles. - -**Upgrading from 1.x?** See for additional information. - -## [Unreleased][unreleased] - -## [2.3.8] - 2022-12-10 - -### Fixed - -- Fixed parsing issues when `mb_internal_encoding()` is set to something other than `UTF-8` (#951) - -## [2.3.7] - 2022-11-03 - -### Fixed - -- Fixed `TaskListItemMarkerRenderer` not including HTML attributes set on the node by other extensions (#947) - -## [2.3.6] - 2022-10-30 - -### Fixed - -- Fixed unquoted attribute parsing when closing curly brace is followed by certain characters (like a `.`) (#943) - -## [2.3.5] - 2022-07-29 - -### Fixed - -- Fixed error using `InlineParserEngine` when no inline parsers are registered in the `Environment` (#908) - -## [2.3.4] - 2022-07-17 - -### Changed - -- Made a number of small tweaks to the embed extension's parsing behavior to fix #898: - - Changed `EmbedStartParser` to always capture embed-like lines in container blocks, regardless of parent block type - - Changed `EmbedProcessor` to also remove `Embed` blocks that aren't direct children of the `Document` - - Increased the priority of `EmbedProcessor` to `1010` - -### Fixed - -- Fixed `EmbedExtension` not parsing embeds following a list block (#898) - -## [2.3.3] - 2022-06-07 - -### Fixed - -- Fixed `DomainFilteringAdapter` not reindexing the embed list (#884, #885) - -## [2.3.2] - 2022-06-03 - -### Fixed - -- Fixed FootnoteExtension stripping extra characters from tab-indented footnotes (#881) - -## [2.2.5] - 2022-06-03 - -### Fixed - -- Fixed FootnoteExtension stripping extra characters from tab-indented footnotes (#881) - -## [2.3.1] - 2022-05-14 - -### Fixed - -- Fixed AutolinkExtension not ignoring trailing strikethrough syntax (#867) - -## [2.2.4] - 2022-05-14 - -### Fixed - -- Fixed AutolinkExtension not ignoring trailing strikethrough syntax (#867) - -## [2.3.0] - 2022-04-07 - -### Added - -- Added new `EmbedExtension` (#805) -- Added `DocumentRendererInterface` as a replacement for the now-deprecated `MarkdownRendererInterface` - -### Deprecated - -- Deprecated `MarkdownRendererInterface`; use `DocumentRendererInterface` instead - -## [2.2.3] - 2022-02-26 - -### Fixed - -- Fixed front matter parsing with Windows line endings (#821) - -## [2.1.3] - 2022-02-26 - -### Fixed - -- Fixed front matter parsing with Windows line endings (#821) - -## [2.0.4] - 2022-02-26 - -### Fixed - -- Fixed front matter parsing with Windows line endings (#821) - -## [2.2.2] - 2022-02-13 - -### Fixed - -- Fixed double-escaping of image alt text (#806, #810) -- Fixed Psalm typehints for event class names - -## [2.2.1] - 2022-01-25 - -### Fixed - - - Fixed `symfony/deprecation-contracts` constraint - -### Removed - - - Removed deprecation trigger from `MarkdownConverterInterface` to reduce noise - -## [2.2.0] - 2022-01-22 - -### Added - - - Added new `ConverterInterface` - - Added new `MarkdownToXmlConverter` class - - Added new `HtmlDecorator` class which can wrap existing renderers with additional HTML tags - - Added new `table/wrap` config to apply an optional wrapping/container element around a table (#780) - -### Changed - - - `HtmlElement` contents can now consist of any `Stringable`, not just `HtmlElement` and `string` - -### Deprecated - - - Deprecated `MarkdownConverterInterface` and its `convertToHtml()` method; use `ConverterInterface` and `convert()` instead - -## [2.1.2] - 2022-02-13 - -### Fixed - -- Fixed double-escaping of image alt text (#806, #810) -- Fixed Psalm typehints for event class names - -## [2.1.1] - 2022-01-02 - -### Added - - - Added missing return type to `Environment::dispatch()` to fix deprecation warning (#778) - -## [2.1.0] - 2021-12-05 - -### Added - -- Added support for ext-yaml in FrontMatterExtension (#715) -- Added support for symfony/yaml v6.0 in FrontMatterExtension (#739) -- Added new `heading_permalink/aria_hidden` config option (#741) - -### Fixed - - - Fixed PHP 8.1 deprecation warning (#759, #762) - -## [2.0.3] - 2022-02-13 - -### Fixed - -- Fixed double-escaping of image alt text (#806, #810) -- Fixed Psalm typehints for event class names - -## [2.0.2] - 2021-08-14 - -### Changed - -- Bumped minimum version of league/config to support PHP 8.1 - -### Fixed - -- Fixed ability to register block parsers that identify lines starting with letters (#706) - -## [2.0.1] - 2021-07-31 - -### Fixed - -- Fixed nested autolinks (#689) -- Fixed description lists being parsed incorrectly (#692) -- Fixed Table of Contents not respecting Heading Permalink prefixes (#690) - -## [2.0.0] - 2021-07-24 - -No changes were introduced since the previous RC2 release. -See all entries below for a list of changes between 1.x and 2.0. - -## [2.0.0-rc2] - 2021-07-17 - -### Fixed - -- Fixed Mentions inside of links creating nested links against the spec's rules (#688) - -## [2.0.0-rc1] - 2021-07-10 - -No changes were introduced since the previous release. - -## [2.0.0-beta3] - 2021-07-03 - -### Changed - - - Any leading UTF-8 BOM will be stripped from the input - - The `getEnvironment()` method of `CommonMarkConverter` and `GithubFlavoredMarkdownConverter` will always return the concrete, configurable `Environment` for upgrading convenience - - Optimized AST iteration - - Lots of small micro-optimizations - -## [2.0.0-beta2] - 2021-06-27 - -### Added - -- Added new `Node::iterator()` method and `NodeIterator` class for faster AST iteration (#683, #684) - -### Changed - -- Made compatible with CommonMark spec 0.30.0 -- Optimized link label parsing -- Optimized AST iteration for a 50% performance boost in some event listeners (#683, #684) - -### Fixed - -- Fixed processing instructions with EOLs -- Fixed case-insensitive matching for HTML tag types -- Fixed type 7 HTML blocks incorrectly interrupting lazy paragraphs -- Fixed newlines in reference labels not collapsing into spaces -- Fixed link label normalization with escaped newlines -- Fixed unnecessary AST iteration when no default attributes are configured - -## [2.0.0-beta1] - 2021-06-20 - -### Added - - - **Added three new extensions:** - - `FrontMatterExtension` ([see documentation](https://commonmark.thephpleague.com/extensions/front-matter/)) - - `DescriptionListExtension` ([see documentation](https://commonmark.thephpleague.com/extensions/description-lists/)) - - `DefaultAttributesExtension` ([see documentation](https://commonmark.thephpleague.com/extensions/default-attributes/)) - - **Added new `XmlRenderer` to simplify AST debugging** ([see documentation](https://commonmark.thephpleague.com/xml/)) (#431) - - **Added the ability to configure disallowed raw HTML tags** (#507) - - **Added the ability for Mentions to use multiple characters for their symbol** (#514, #550) - - **Added the ability to delegate event dispatching to PSR-14 compliant event dispatcher libraries** - - **Added new configuration options:** - - Added `heading_permalink/min_heading_level` and `heading_permalink/max_heading_level` options to control which headings get permalinks (#519) - - Added `heading_permalink/fragment_prefix` to allow customizing the URL fragment prefix (#602) - - Added `footnote/backref_symbol` option for customizing backreference link appearance (#522) - - Added `slug_normalizer/max_length` option to control the maximum length of generated URL slugs - - Added `slug_normalizer/unique` option to control whether unique slugs should be generated per-document or per-environment - - **Added purity markers throughout the codebase** (verified with Psalm) - - Added `Query` class to simplify Node traversal when looking to take action on certain Nodes - - Added new `HtmlFilter` and `StringContainerHelper` utility classes - - Added new `AbstractBlockContinueParser` class to simplify the creation of custom block parsers - - Added several new classes and interfaces: - - `BlockContinue` - - `BlockContinueParserInterface` - - `BlockContinueParserWithInlinesInterface` - - `BlockStart` - - `BlockStartParserInterface` - - `ChildNodeRendererInterface` - - `ConfigurableExtensionInterface` - - `CursorState` - - `DashParser` (extracted from `PunctuationParser`) - - `DelimiterParser` - - `DocumentBlockParser` - - `DocumentPreRenderEvent` - - `DocumentRenderedEvent` - - `EllipsesParser` (extracted from `PunctuationParser`) - - `ExpressionInterface` - - `FallbackNodeXmlRenderer` - - `InlineParserEngineInterface` - - `InlineParserMatch` - - `MarkdownParserState` - - `MarkdownParserStateInterface` - - `MarkdownRendererInterface` - - `Query` - - `RawMarkupContainerInterface` - - `ReferenceableInterface` - - `RenderedContent` - - `RenderedContentInterface` - - `ReplaceUnpairedQuotesListener` - - `SpecReader` - - `TableOfContentsRenderer` - - `UniqueSlugNormalizer` - - `UniqueSlugNormalizerInterface` - - `XmlRenderer` - - `XmlNodeRendererInterface` - - Added several new methods: - - `Cursor::getCurrentCharacter()` - - `Environment::createDefaultConfiguration()` - - `Environment::setEventDispatcher()` - - `EnvironmentInterface::getExtensions()` - - `EnvironmentInterface::getInlineParsers()` - - `EnvironmentInterface::getSlugNormalizer()` - - `FencedCode::setInfo()` - - `Heading::setLevel()` - - `HtmlRenderer::renderDocument()` - - `InlineParserContext::getFullMatch()` - - `InlineParserContext::getFullMatchLength()` - - `InlineParserContext::getMatches()` - - `InlineParserContext::getSubMatches()` - - `LinkParserHelper::parsePartialLinkLabel()` - - `LinkParserHelper::parsePartialLinkTitle()` - - `Node::assertInstanceOf()` - - `RegexHelper::isLetter()` - - `StringContainerInterface::setLiteral()` - - `TableCell::getType()` - - `TableCell::setType()` - - `TableCell::getAlign()` - - `TableCell::setAlign()` - -### Changed - - - **Changed the converter return type** - - `CommonMarkConverter::convertToHtml()` now returns an instance of `RenderedContentInterface`. This can be cast to a string for backward compatibility with 1.x. - - **Table of Contents items are no longer wrapped with `

` tags** (#613) - - **Heading Permalinks now link to element IDs instead of using `name` attributes** (#602) - - **Heading Permalink IDs and URL fragments now have a `content` prefix by default** (#602) - - **Changes to configuration options:** - - `enable_em` has been renamed to `commonmark/enable_em` - - `enable_strong` has been renamed to `commonmark/enable_strong` - - `use_asterisk` has been renamed to `commonmark/use_asterisk` - - `use_underscore` has been renamed to `commonmark/use_underscore` - - `unordered_list_markers` has been renamed to `commonmark/unordered_list_markers` - - `mentions/*/symbol` has been renamed to `mentions/*/prefix` - - `mentions/*/regex` has been renamed to `mentions/*/pattern` and requires partial regular expressions (without delimiters or flags) - - `max_nesting_level` now defaults to `PHP_INT_MAX` and no longer supports floats - - `heading_permalink/slug_normalizer` has been renamed to `slug_normalizer/instance` - - **Event dispatching is now fully PSR-14 compliant** - - **Moved and renamed several classes** - [see the full list here](https://commonmark.thephpleague.com/2.0/upgrading/#classesnamespaces-renamed) - - The `HeadingPermalinkExtension` and `FootnoteExtension` were modified to ensure they never produce a slug which conflicts with slugs created by the other extension - - `SlugNormalizer::normalizer()` now supports optional prefixes and max length options passed in via the `$context` argument - - The `AbstractBlock::$data` and `AbstractInline::$data` arrays were replaced with a `Data` array-like object on the base `Node` class - - **Implemented a new approach to block parsing.** This was a massive change, so here are the highlights: - - Functionality previously found in block parsers and node elements has moved to block parser factories and block parsers, respectively ([more details](https://commonmark.thephpleague.com/2.0/upgrading/#new-block-parsing-approach)) - - `ConfigurableEnvironmentInterface::addBlockParser()` is now `EnvironmentBuilderInterface::addBlockParserFactory()` - - `ReferenceParser` was re-implemented and works completely different than before - - The paragraph parser no longer needs to be added manually to the environment - - **Implemented a new approach to inline parsing** where parsers can now specify longer strings or regular expressions they want to parse (instead of just single characters): - - `InlineParserInterface::getCharacters()` is now `getMatchDefinition()` and returns an instance of `InlineParserMatch` - - `InlineParserContext::__construct()` now requires the contents to be provided as a `Cursor` instead of a `string` - - **Implemented delimiter parsing as a special type of inline parser** (via the new `DelimiterParser` class) - - **Changed block and inline rendering to use common methods and interfaces** - - `BlockRendererInterface` and `InlineRendererInterface` were replaced by `NodeRendererInterface` with slightly different parameters. All core renderers now implement this interface. - - `ConfigurableEnvironmentInterface::addBlockRenderer()` and `addInlineRenderer()` were combined into `EnvironmentBuilderInterface::addRenderer()` - - `EnvironmentInterface::getBlockRenderersForClass()` and `getInlineRenderersForClass()` are now just `getRenderersForClass()` - - **Completely refactored the Configuration implementation** - - All configuration-specific classes have been moved into a new `league/config` package with a new namespace - - `Configuration` objects must now be configured with a schema and all options must match that schema - arbitrary keys are no longer permitted - - `Configuration::__construct()` no longer accepts the default configuration values - use `Configuration::merge()` instead - - `ConfigurationInterface` now only contains a `get(string $key)`; this method no longer allows arbitrary default values to be returned if the option is missing - - `ConfigurableEnvironmentInterface` was renamed to `EnvironmentBuilderInterface` - - `ExtensionInterface::register()` now requires an `EnvironmentBuilderInterface` param instead of `ConfigurableEnvironmentInterface` - - **Added missing return types to virtually every class and interface method** - - Re-implemented the GFM Autolink extension using the new inline parser approach instead of document processors - - `EmailAutolinkProcessor` is now `EmailAutolinkParser` - - `UrlAutolinkProcessor` is now `UrlAutolinkParser` - - `HtmlElement` can now properly handle array (i.e. `class`) and boolean (i.e. `checked`) attribute values - - `HtmlElement` automatically flattens any attributes with array values into space-separated strings, removing duplicate entries - - Combined separate classes/interfaces into one: - - `DisallowedRawHtmlRenderer` replaces `DisallowedRawHtmlBlockRenderer` and `DisallowedRawHtmlInlineRenderer` - - `NodeRendererInterface` replaces `BlockRendererInterface` and `InlineRendererInterface` - - Renamed the following methods: - - `Environment` and `ConfigurableEnvironmentInterface`: - - `addBlockParser()` is now `addBlockStartParser()` - - `ReferenceMap` and `ReferenceMapInterface`: - - `addReference()` is now `add()` - - `getReference()` is now `get()` - - `listReferences()` is now `getIterator()` - - Various node (block/inline) classes: - - `getContent()` is now `getLiteral()` - - `setContent()` is now `setLiteral()` - - Moved and renamed the following constants: - - `EnvironmentInterface::HTML_INPUT_ALLOW` is now `HtmlFilter::ALLOW` - - `EnvironmentInterface::HTML_INPUT_ESCAPE` is now `HtmlFilter::ESCAPE` - - `EnvironmentInterface::HTML_INPUT_STRIP` is now `HtmlFilter::STRIP` - - `TableCell::TYPE_HEAD` is now `TableCell::TYPE_HEADER` - - `TableCell::TYPE_BODY` is now `TableCell::TYPE_DATA` - - Changed the visibility of the following properties: - - `AttributesInline::$attributes` is now `private` - - `AttributesInline::$block` is now `private` - - `TableCell::$align` is now `private` - - `TableCell::$type` is now `private` - - `TableSection::$type` is now `private` - - Several methods which previously returned `$this` now return `void` - - `Delimiter::setPrevious()` - - `Node::replaceChildren()` - - `Context::setTip()` - - `Context::setContainer()` - - `Context::setBlocksParsed()` - - `AbstractStringContainer::setContent()` - - `AbstractWebResource::setUrl()` - - Several classes are now marked `final`: - - `ArrayCollection` - - `Emphasis` - - `FencedCode` - - `Heading` - - `HtmlBlock` - - `HtmlElement` - - `HtmlInline` - - `IndentedCode` - - `Newline` - - `Strikethrough` - - `Strong` - - `Text` - - `Heading` nodes no longer directly contain a copy of their inner text - - `StringContainerInterface` can now be used for inlines, not just blocks - - `ArrayCollection` only supports integer keys - - `HtmlElement` now implements `Stringable` - - `Cursor::saveState()` and `Cursor::restoreState()` now use `CursorState` objects instead of arrays - - `NodeWalker::next()` now enters, traverses any children, and leaves all elements which may have children (basically all blocks plus any inlines with children). Previously, it only did this for elements explicitly marked as "containers". - - `InvalidOptionException` was removed - - Anything with a `getReference(): ReferenceInterface` method now implements `ReferencableInterface` - - The `SmartPunct` extension now replaces all unpaired `Quote` elements with `Text` elements towards the end of parsing, making the `QuoteRenderer` unnecessary - - Several changes made to the Footnote extension: - - Footnote identifiers can no longer contain spaces - - Anonymous footnotes can now span subsequent lines - - Footnotes can now contain multiple lines of content, including sub-blocks, by indenting them - - Footnote event listeners now have numbered priorities (but still execute in the same order) - - Footnotes must now be separated from previous content by a blank line - - The line numbers (keys) returned via `MarkdownInput::getLines()` now start at 1 instead of 0 - - `DelimiterProcessorCollectionInterface` now extends `Countable` - - `RegexHelper::PARTIAL_` constants must always be used in case-insensitive contexts - - `HeadingPermalinkProcessor` no longer accepts text normalizers via the constructor - these must be provided via configuration instead - - Blocks which can't contain inlines will no longer be asked to render inlines - - `AnonymousFootnoteRefParser` and `HeadingPermalinkProcessor` now implement `EnvironmentAwareInterface` instead of `ConfigurationAwareInterface` - - The second argument to `TextNormalizerInterface::normalize()` must now be an array - - The `title` attribute for `Link` and `Image` nodes is now stored using a dedicated property instead of stashing it in `$data` - - `ListData::$delimiter` now returns either `ListBlock::DELIM_PERIOD` or `ListBlock::DELIM_PAREN` instead of the literal delimiter - -### Fixed - - - **Fixed parsing of footnotes without content** - - **Fixed rendering of orphaned footnotes and footnote refs** - - **Fixed some URL autolinks breaking too early** (#492) - - Fixed `AbstractStringContainer` not actually being `abstract` - -### Removed - - - **Removed support for PHP 7.1, 7.2, and 7.3** (#625, #671) - - **Removed all previously-deprecated functionality:** - - Removed the ability to pass custom `Environment` instances into the `CommonMarkConverter` and `GithubFlavoredMarkdownConverter` constructors - - Removed the `Converter` class and `ConverterInterface` - - Removed the `bin/commonmark` script - - Removed the `Html5Entities` utility class - - Removed the `InlineMentionParser` (use `MentionParser` instead) - - Removed `DefaultSlugGenerator` and `SlugGeneratorInterface` from the `Extension/HeadingPermalink/Slug` sub-namespace (use the new ones under `./SlugGenerator` instead) - - Removed the following `ArrayCollection` methods: - - `add()` - - `set()` - - `get()` - - `remove()` - - `isEmpty()` - - `contains()` - - `indexOf()` - - `containsKey()` - - `replaceWith()` - - `removeGaps()` - - Removed the `ConfigurableEnvironmentInterface::setConfig()` method - - Removed the `ListBlock::TYPE_UNORDERED` constant - - Removed the `CommonMarkConverter::VERSION` constant - - Removed the `HeadingPermalinkRenderer::DEFAULT_INNER_CONTENTS` constant - - Removed the `heading_permalink/inner_contents` configuration option - - **Removed now-unused classes:** - - `AbstractStringContainerBlock` - - `BlockRendererInterface` - - `Context` - - `ContextInterface` - - `Converter` - - `ConverterInterface` - - `InlineRendererInterface` - - `PunctuationParser` (was split into two classes: `DashParser` and `EllipsesParser`) - - `QuoteRenderer` - - `UnmatchedBlockCloser` - - Removed the following methods, properties, and constants: - - `AbstractBlock::$open` - - `AbstractBlock::$lastLineBlank` - - `AbstractBlock::isContainer()` - - `AbstractBlock::canContain()` - - `AbstractBlock::isCode()` - - `AbstractBlock::matchesNextLine()` - - `AbstractBlock::endsWithBlankLine()` - - `AbstractBlock::setLastLineBlank()` - - `AbstractBlock::shouldLastLineBeBlank()` - - `AbstractBlock::isOpen()` - - `AbstractBlock::finalize()` - - `AbstractBlock::getData()` - - `AbstractInline::getData()` - - `ConfigurableEnvironmentInterface::addBlockParser()` - - `ConfigurableEnvironmentInterface::mergeConfig()` - - `Delimiter::setCanClose()` - - `EnvironmentInterface::getConfig()` - - `EnvironmentInterface::getInlineParsersForCharacter()` - - `EnvironmentInterface::getInlineParserCharacterRegex()` - - `HtmlRenderer::renderBlock()` - - `HtmlRenderer::renderBlocks()` - - `HtmlRenderer::renderInline()` - - `HtmlRenderer::renderInlines()` - - `Node::isContainer()` - - `RegexHelper::matchAll()` (use the new `matchFirst()` method instead) - - `RegexHelper::REGEX_WHITESPACE` - - Removed the second `$contents` argument from the `Heading` constructor - -### Deprecated - -**The following things have been deprecated and will not be supported in v3.0:** - - - `Environment::mergeConfig()` (set configuration before instantiation instead) - - `Environment::createCommonMarkEnvironment()` and `Environment::createGFMEnvironment()` - - Alternative 1: Use `CommonMarkConverter` or `GithubFlavoredMarkdownConverter` if you don't need to customize the environment - - Alternative 2: Instantiate a new `Environment` and add the necessary extensions yourself - -[unreleased]: https://github.com/thephpleague/commonmark/compare/2.3.8...main -[2.3.8]: https://github.com/thephpleague/commonmark/compare/2.3.7...2.3.8 -[2.3.7]: https://github.com/thephpleague/commonmark/compare/2.3.6...2.3.7 -[2.3.6]: https://github.com/thephpleague/commonmark/compare/2.3.5...2.3.6 -[2.3.5]: https://github.com/thephpleague/commonmark/compare/2.3.4...2.3.5 -[2.3.4]: https://github.com/thephpleague/commonmark/compare/2.3.3...2.3.4 -[2.3.3]: https://github.com/thephpleague/commonmark/compare/2.3.2...2.3.3 -[2.3.2]: https://github.com/thephpleague/commonmark/compare/2.3.2...main -[2.3.1]: https://github.com/thephpleague/commonmark/compare/2.3.0...2.3.1 -[2.3.0]: https://github.com/thephpleague/commonmark/compare/2.2.3...2.3.0 -[2.2.5]: https://github.com/thephpleague/commonmark/compare/2.2.4...2.2.5 -[2.2.4]: https://github.com/thephpleague/commonmark/compare/2.2.3...2.2.4 -[2.2.3]: https://github.com/thephpleague/commonmark/compare/2.2.2...2.2.3 -[2.2.2]: https://github.com/thephpleague/commonmark/compare/2.2.1...2.2.2 -[2.2.1]: https://github.com/thephpleague/commonmark/compare/2.2.0...2.2.1 -[2.2.0]: https://github.com/thephpleague/commonmark/compare/2.1.1...2.2.0 -[2.1.3]: https://github.com/thephpleague/commonmark/compare/2.1.2...2.1.3 -[2.1.2]: https://github.com/thephpleague/commonmark/compare/2.1.1...2.1.2 -[2.1.1]: https://github.com/thephpleague/commonmark/compare/2.0.2...2.1.1 -[2.1.0]: https://github.com/thephpleague/commonmark/compare/2.0.2...2.1.0 -[2.0.4]: https://github.com/thephpleague/commonmark/compare/2.0.3...2.0.4 -[2.0.3]: https://github.com/thephpleague/commonmark/compare/2.0.2...2.0.3 -[2.0.2]: https://github.com/thephpleague/commonmark/compare/2.0.1...2.0.2 -[2.0.1]: https://github.com/thephpleague/commonmark/compare/2.0.0...2.0.1 -[2.0.0]: https://github.com/thephpleague/commonmark/compare/2.0.0-rc2...2.0.0 -[2.0.0-rc2]: https://github.com/thephpleague/commonmark/compare/2.0.0-rc1...2.0.0-rc2 -[2.0.0-rc1]: https://github.com/thephpleague/commonmark/compare/2.0.0-beta3...2.0.0-rc1 -[2.0.0-beta3]: https://github.com/thephpleague/commonmark/compare/2.0.0-beta2...2.0.0-beta3 -[2.0.0-beta2]: https://github.com/thephpleague/commonmark/compare/2.0.0-beta1...2.0.0-beta2 -[2.0.0-beta1]: https://github.com/thephpleague/commonmark/compare/1.6...2.0.0-beta1 diff --git a/vendor/league/commonmark/LICENSE b/vendor/league/commonmark/LICENSE deleted file mode 100644 index 5f04fad7..00000000 --- a/vendor/league/commonmark/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ -BSD 3-Clause License - -Copyright (c) 2014-2022, Colin O'Dell. All rights reserved. Some code based on commonmark.js (copyright 2014-2018, John MacFarlane) and commonmark-java (copyright 2015-2016, Atlassian Pty Ltd) - -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 its - 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 HOLDER 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/league/commonmark/README.md b/vendor/league/commonmark/README.md deleted file mode 100644 index a8e22668..00000000 --- a/vendor/league/commonmark/README.md +++ /dev/null @@ -1,221 +0,0 @@ -# league/commonmark - -[![Latest Version](https://img.shields.io/packagist/v/league/commonmark.svg?style=flat-square)](https://packagist.org/packages/league/commonmark) -[![Total Downloads](https://img.shields.io/packagist/dt/league/commonmark.svg?style=flat-square)](https://packagist.org/packages/league/commonmark) -[![Software License](https://img.shields.io/badge/License-BSD--3-brightgreen.svg?style=flat-square)](LICENSE) -[![Build Status](https://img.shields.io/github/workflow/status/thephpleague/commonmark/Tests/main.svg?style=flat-square)](https://github.com/thephpleague/commonmark/actions?query=workflow%3ATests+branch%3Amain) -[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/thephpleague/commonmark.svg?style=flat-square)](https://scrutinizer-ci.com/g/thephpleague/commonmark/code-structure) -[![Quality Score](https://img.shields.io/scrutinizer/g/thephpleague/commonmark.svg?style=flat-square)](https://scrutinizer-ci.com/g/thephpleague/commonmark) -[![Psalm Type Coverage](https://shepherd.dev/github/thephpleague/commonmark/coverage.svg)](https://shepherd.dev/github/thephpleague/commonmark) -[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/126/badge)](https://bestpractices.coreinfrastructure.org/projects/126) -[![Sponsor development of this project](https://img.shields.io/badge/sponsor%20this%20package-%E2%9D%A4-ff69b4.svg?style=flat-square)](https://www.colinodell.com/sponsor) - -![league/commonmark](commonmark-banner.png) - -**league/commonmark** is a highly-extensible PHP Markdown parser created by [Colin O'Dell][@colinodell] which supports the full [CommonMark] spec and [GitHub-Flavored Markdown]. It is based on the [CommonMark JS reference implementation][commonmark.js] by [John MacFarlane] \([@jgm]\). - -## 📦 Installation & Basic Usage - -This project requires PHP 7.4 or higher with the `mbstring` extension. To install it via [Composer] simply run: - -``` bash -$ composer require league/commonmark -``` - -The `CommonMarkConverter` class provides a simple wrapper for converting CommonMark to HTML: - -```php -use League\CommonMark\CommonMarkConverter; - -$converter = new CommonMarkConverter([ - 'html_input' => 'strip', - 'allow_unsafe_links' => false, -]); - -echo $converter->convert('# Hello World!'); - -//

Hello World!

-``` - -Or if you want GitHub-Flavored Markdown, use the `GithubFlavoredMarkdownConverter` class instead: - -```php -use League\CommonMark\GithubFlavoredMarkdownConverter; - -$converter = new GithubFlavoredMarkdownConverter([ - 'html_input' => 'strip', - 'allow_unsafe_links' => false, -]); - -echo $converter->convert('# Hello World!'); - -//

Hello World!

-``` - -Please note that only UTF-8 and ASCII encodings are supported. If your Markdown uses a different encoding please convert it to UTF-8 before running it through this library. - -🔒 If you will be parsing untrusted input from users, please consider setting the `html_input` and `allow_unsafe_links` options per the example above. See for more details. If you also do choose to allow raw HTML input from untrusted users, consider using a library (like [HTML Purifier](https://github.com/ezyang/htmlpurifier)) to provide additional HTML filtering. - -## 📓 Documentation - -Full documentation on advanced usage, configuration, and customization can be found at [commonmark.thephpleague.com][docs]. - -## ⏫ Upgrading - -Information on how to upgrade to newer versions of this library can be found at . - -## 💻 GitHub-Flavored Markdown - -The `GithubFlavoredMarkdownConverter` shown earlier is a drop-in replacement for the `CommonMarkConverter` which adds additional features found in the GFM spec: - - - Autolinks - - Disallowed raw HTML - - Strikethrough - - Tables - - Task Lists - -See the [Extensions documentation](https://commonmark.thephpleague.com/customization/extensions/) for more details on how to include only certain GFM features if you don't want them all. - -## 🗃️ Related Packages - -### Integrations - -- [CakePHP 3](https://github.com/gourmet/common-mark) -- [Drupal](https://www.drupal.org/project/markdown) -- [Laravel 4+](https://github.com/GrahamCampbell/Laravel-Markdown) -- [Sculpin](https://github.com/bcremer/sculpin-commonmark-bundle) -- [Symfony 2 & 3](https://github.com/webuni/commonmark-bundle) -- [Symfony 4](https://github.com/avensome/commonmark-bundle) -- [Twig Markdown extension](https://github.com/twigphp/markdown-extension) -- [Twig filter and tag](https://github.com/aptoma/twig-markdown) -- [Laravel CommonMark Blog](https://github.com/spekulatius/laravel-commonmark-blog) - -### Included Extensions - -See [our extension documentation](https://commonmark.thephpleague.com/extensions/overview) for a full list of extensions bundled with this library. - -### Community Extensions - -Custom parsers/renderers can be bundled into extensions which extend CommonMark. Here are some that you may find interesting: - - - [Alt Three Emoji](https://github.com/AltThree/Emoji) An emoji parser for CommonMark. - - [Sup Sub extensions](https://github.com/OWS/commonmark-sup-sub-extensions) - Adds support of superscript and subscript (`` and `` HTML tags) - - [YouTube iframe extension](https://github.com/zoonru/commonmark-ext-youtube-iframe) - Replaces youtube link with iframe. - - [Lazy Image extension](https://github.com/simonvomeyser/commonmark-ext-lazy-image) - Adds various options for lazy loading of images. - - [Marker Extension](https://github.com/noah1400/commonmark-marker-extension) - Adds support of highlighted text (`` HTML tag) - -Others can be found on [Packagist under the `commonmark-extension` package type](https://packagist.org/packages/league/commonmark?type=commonmark-extension). - -If you build your own, feel free to submit a PR to add it to this list! - -### Others - -Check out the other cool things people are doing with `league/commonmark`: - -## 🏷️ Versioning - -[SemVer](http://semver.org/) is followed closely. Minor and patch releases should not introduce breaking changes to the codebase; however, they might change the resulting AST or HTML output of parsed Markdown (due to bug fixes, spec changes, etc.) As a result, you might get slightly different HTML, but any custom code built onto this library should still function correctly. - -Any classes or methods marked `@internal` are not intended for use outside of this library and are subject to breaking changes at any time, so please avoid using them. - -## 🛠️ Maintenance & Support - -When a new **minor** version (e.g. `2.0` -> `2.1`) is released, the previous one (`2.0`) will continue to receive security and critical bug fixes for *at least* 3 months. - -When a new **major** version is released (e.g. `1.6` -> `2.0`), the previous one (`1.6`) will receive critical bug fixes for *at least* 3 months and security updates for 6 months after that new release comes out. - -(This policy may change in the future and exceptions may be made on a case-by-case basis.) - -**Professional support, including notification of new releases and security updates, is available through a [Tidelift Subscription](https://tidelift.com/subscription/pkg/packagist-league-commonmark?utm_source=packagist-league-commonmark&utm_medium=referral&utm_campaign=readme).** - -## 👷‍♀️ Contributing - -To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure with us. - -If you encounter a bug in the spec, please report it to the [CommonMark] project. Any resulting fix will eventually be implemented in this project as well. - -Contributions to this library are **welcome**, especially ones that: - - * Improve usability or flexibility without compromising our ability to adhere to the [CommonMark spec] - * Mirror fixes made to the [reference implementation][commonmark.js] - * Optimize performance - * Fix issues with adhering to the [CommonMark spec] - -Major refactoring to core parsing logic should be avoided if possible so that we can easily follow updates made to [the reference implementation][commonmark.js]. That being said, we will absolutely consider changes which don't deviate too far from the reference spec or which are favored by other popular CommonMark implementations. - -Please see [CONTRIBUTING](https://github.com/thephpleague/commonmark/blob/main/.github/CONTRIBUTING.md) for additional details. - -## 🧪 Testing - -``` bash -$ composer test -``` - -This will also test league/commonmark against the latest supported spec. - -## 🚀 Performance Benchmarks - -You can compare the performance of **league/commonmark** to other popular parsers by running the included benchmark tool: - -``` bash -$ ./tests/benchmark/benchmark.php -``` - -## 👥 Credits & Acknowledgements - -- [Colin O'Dell][@colinodell] -- [John MacFarlane][@jgm] -- [All Contributors] - -This code is partially based on the [CommonMark JS reference implementation][commonmark.js] which is written, maintained and copyrighted by [John MacFarlane]. This project simply wouldn't exist without his work. - -### Sponsors - -We'd also like to extend our sincere thanks the following sponsors who support ongoing development of this project: - - - [Tidelift](https://tidelift.com/subscription/pkg/packagist-league-commonmark?utm_source=packagist-league-commonmark&utm_medium=referral&utm_campaign=readme) for offering support to both the maintainers and end-users through their [professional support](https://tidelift.com/subscription/pkg/packagist-league-commonmark?utm_source=packagist-league-commonmark&utm_medium=referral&utm_campaign=readme) program - - [Blackfire](https://www.blackfire.io/) for providing an Open-Source Profiler subscription - - [JetBrains](https://www.jetbrains.com/) for supporting this project with complimentary [PhpStorm](https://www.jetbrains.com/phpstorm/) licenses - - [Taylor Otwell](https://twitter.com/taylorotwell) for sponsoring this project through GitHub sponsors - -Are you interested in sponsoring development of this project? See for a list of ways to contribute. - -## 📄 License - -**league/commonmark** is licensed under the BSD-3 license. See the [`LICENSE`](LICENSE) file for more details. - -## 🏛️ Governance - -This project is primarily maintained by [Colin O'Dell][@colinodell]. Members of the [PHP League] Leadership Team may occasionally assist with some of these duties. - -## 🗺️ Who Uses It? - -This project is used by [Drupal](https://www.drupal.org/project/markdown), [Laravel Framework](https://laravel.com/), [Cachet](https://cachethq.io/), [Firefly III](https://firefly-iii.org/), [Neos](https://www.neos.io/), [Daux.io](https://daux.io/), and [more](https://packagist.org/packages/league/commonmark/dependents)! - ---- - -
- - Get professional support for league/commonmark with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-
- -[CommonMark]: http://commonmark.org/ -[CommonMark spec]: http://spec.commonmark.org/ -[commonmark.js]: https://github.com/jgm/commonmark.js -[GitHub-Flavored Markdown]: https://github.github.com/gfm/ -[John MacFarlane]: http://johnmacfarlane.net -[docs]: https://commonmark.thephpleague.com/ -[docs-examples]: https://commonmark.thephpleague.com/customization/overview/#examples -[docs-example-twitter]: https://commonmark.thephpleague.com/customization/inline-parsing#example-1---twitter-handles -[docs-example-smilies]: https://commonmark.thephpleague.com/customization/inline-parsing#example-2---emoticons -[All Contributors]: https://github.com/thephpleague/commonmark/contributors -[@colinodell]: https://www.twitter.com/colinodell -[@jgm]: https://github.com/jgm -[jgm/stmd]: https://github.com/jgm/stmd -[Composer]: https://getcomposer.org/ -[PHP League]: https://thephpleague.com diff --git a/vendor/league/commonmark/composer.json b/vendor/league/commonmark/composer.json deleted file mode 100644 index d432b804..00000000 --- a/vendor/league/commonmark/composer.json +++ /dev/null @@ -1,125 +0,0 @@ -{ - "name": "league/commonmark", - "type": "library", - "description": "Highly-extensible PHP Markdown parser which fully supports the CommonMark spec and GitHub-Flavored Markdown (GFM)", - "keywords": ["markdown","parser","commonmark","gfm","github","flavored","github-flavored","md"], - "homepage": "https://commonmark.thephpleague.com", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Colin O'Dell", - "email": "colinodell@gmail.com", - "homepage": "https://www.colinodell.com", - "role": "Lead Developer" - } - ], - "support": { - "docs": "https://commonmark.thephpleague.com/", - "forum": "https://github.com/thephpleague/commonmark/discussions", - "issues": "https://github.com/thephpleague/commonmark/issues", - "rss": "https://github.com/thephpleague/commonmark/releases.atom", - "source": "https://github.com/thephpleague/commonmark" - }, - "require": { - "php": "^7.4 || ^8.0", - "ext-mbstring": "*", - "league/config": "^1.1.1", - "psr/event-dispatcher": "^1.0", - "symfony/deprecation-contracts": "^2.1 || ^3.0", - "symfony/polyfill-php80": "^1.16" - }, - "require-dev": { - "ext-json": "*", - "cebe/markdown": "^1.0", - "commonmark/cmark": "0.30.0", - "commonmark/commonmark.js": "0.30.0", - "composer/package-versions-deprecated": "^1.8", - "embed/embed": "^4.4", - "erusev/parsedown": "^1.0", - "github/gfm": "0.29.0", - "michelf/php-markdown": "^1.4 || ^2.0", - "nyholm/psr7": "^1.5", - "phpstan/phpstan": "^1.8.2", - "phpunit/phpunit": "^9.5.21", - "scrutinizer/ocular": "^1.8.1", - "symfony/finder": "^5.3 | ^6.0", - "symfony/yaml": "^2.3 | ^3.0 | ^4.0 | ^5.0 | ^6.0", - "unleashedtech/php-coding-standard": "^3.1.1", - "vimeo/psalm": "^4.24.0 || ^5.0.0" - }, - "minimum-stability": "beta", - "suggest": { - "symfony/yaml": "v2.3+ required if using the Front Matter extension" - }, - "repositories": [ - { - "type": "package", - "package": { - "name": "commonmark/commonmark.js", - "version": "0.30.0", - "dist": { - "url": "https://github.com/commonmark/commonmark.js/archive/0.30.0.zip", - "type": "zip" - } - } - }, - { - "type": "package", - "package": { - "name": "commonmark/cmark", - "version": "0.30.0", - "dist": { - "url": "https://github.com/commonmark/cmark/archive/0.30.0.zip", - "type": "zip" - } - } - }, - { - "type": "package", - "package": { - "name": "github/gfm", - "version": "0.29.0", - "dist": { - "url": "https://github.com/github/cmark-gfm/archive/0.29.0.gfm.0.zip", - "type": "zip" - } - } - } - ], - "autoload": { - "psr-4": { - "League\\CommonMark\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "League\\CommonMark\\Tests\\Unit\\": "tests/unit", - "League\\CommonMark\\Tests\\Functional\\": "tests/functional", - "League\\CommonMark\\Tests\\PHPStan\\": "tests/phpstan" - } - }, - "scripts": { - "phpcs": "phpcs", - "phpstan": "phpstan analyse", - "phpunit": "phpunit --no-coverage", - "psalm": "psalm --stats", - "test": [ - "@phpcs", - "@phpstan", - "@psalm", - "@phpunit" - ] - }, - "extra": { - "branch-alias": { - "dev-main": "2.4-dev" - } - }, - "config": { - "allow-plugins": { - "composer/package-versions-deprecated": true, - "dealerdirect/phpcodesniffer-composer-installer": true - }, - "sort-packages": true - } -} diff --git a/vendor/league/commonmark/src/CommonMarkConverter.php b/vendor/league/commonmark/src/CommonMarkConverter.php deleted file mode 100644 index 4d700534..00000000 --- a/vendor/league/commonmark/src/CommonMarkConverter.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark; - -use League\CommonMark\Environment\Environment; -use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension; - -/** - * Converts CommonMark-compatible Markdown to HTML. - */ -final class CommonMarkConverter extends MarkdownConverter -{ - /** - * Create a new Markdown converter pre-configured for CommonMark - * - * @param array $config - */ - public function __construct(array $config = []) - { - $environment = new Environment($config); - $environment->addExtension(new CommonMarkCoreExtension()); - - parent::__construct($environment); - } - - public function getEnvironment(): Environment - { - \assert($this->environment instanceof Environment); - - return $this->environment; - } -} diff --git a/vendor/league/commonmark/src/ConverterInterface.php b/vendor/league/commonmark/src/ConverterInterface.php deleted file mode 100644 index b5152e86..00000000 --- a/vendor/league/commonmark/src/ConverterInterface.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 League\CommonMark; - -use League\CommonMark\Output\RenderedContentInterface; - -/** - * Interface for a service which converts content from one format (like Markdown) to another (like HTML). - */ -interface ConverterInterface -{ - /** - * @throws \RuntimeException - */ - public function convert(string $input): RenderedContentInterface; -} diff --git a/vendor/league/commonmark/src/Delimiter/Delimiter.php b/vendor/league/commonmark/src/Delimiter/Delimiter.php deleted file mode 100644 index 2f04f248..00000000 --- a/vendor/league/commonmark/src/Delimiter/Delimiter.php +++ /dev/null @@ -1,134 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Delimiter; - -use League\CommonMark\Node\Inline\AbstractStringContainer; - -final class Delimiter implements DelimiterInterface -{ - /** @psalm-readonly */ - private string $char; - - /** @psalm-readonly-allow-private-mutation */ - private int $length; - - /** @psalm-readonly */ - private int $originalLength; - - /** @psalm-readonly */ - private AbstractStringContainer $inlineNode; - - /** @psalm-readonly-allow-private-mutation */ - private ?DelimiterInterface $previous = null; - - /** @psalm-readonly-allow-private-mutation */ - private ?DelimiterInterface $next = null; - - /** @psalm-readonly */ - private bool $canOpen; - - /** @psalm-readonly */ - private bool $canClose; - - /** @psalm-readonly-allow-private-mutation */ - private bool $active; - - /** @psalm-readonly */ - private ?int $index = null; - - public function __construct(string $char, int $numDelims, AbstractStringContainer $node, bool $canOpen, bool $canClose, ?int $index = null) - { - $this->char = $char; - $this->length = $numDelims; - $this->originalLength = $numDelims; - $this->inlineNode = $node; - $this->canOpen = $canOpen; - $this->canClose = $canClose; - $this->active = true; - $this->index = $index; - } - - public function canClose(): bool - { - return $this->canClose; - } - - public function canOpen(): bool - { - return $this->canOpen; - } - - public function isActive(): bool - { - return $this->active; - } - - public function setActive(bool $active): void - { - $this->active = $active; - } - - public function getChar(): string - { - return $this->char; - } - - public function getIndex(): ?int - { - return $this->index; - } - - public function getNext(): ?DelimiterInterface - { - return $this->next; - } - - public function setNext(?DelimiterInterface $next): void - { - $this->next = $next; - } - - public function getLength(): int - { - return $this->length; - } - - public function setLength(int $length): void - { - $this->length = $length; - } - - public function getOriginalLength(): int - { - return $this->originalLength; - } - - public function getInlineNode(): AbstractStringContainer - { - return $this->inlineNode; - } - - public function getPrevious(): ?DelimiterInterface - { - return $this->previous; - } - - public function setPrevious(?DelimiterInterface $previous): void - { - $this->previous = $previous; - } -} diff --git a/vendor/league/commonmark/src/Delimiter/DelimiterInterface.php b/vendor/league/commonmark/src/Delimiter/DelimiterInterface.php deleted file mode 100644 index 6bfa32e4..00000000 --- a/vendor/league/commonmark/src/Delimiter/DelimiterInterface.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Delimiter; - -use League\CommonMark\Node\Inline\AbstractStringContainer; - -interface DelimiterInterface -{ - public function canClose(): bool; - - public function canOpen(): bool; - - public function isActive(): bool; - - public function setActive(bool $active): void; - - public function getChar(): string; - - public function getIndex(): ?int; - - public function getNext(): ?DelimiterInterface; - - public function setNext(?DelimiterInterface $next): void; - - public function getLength(): int; - - public function setLength(int $length): void; - - public function getOriginalLength(): int; - - public function getInlineNode(): AbstractStringContainer; - - public function getPrevious(): ?DelimiterInterface; - - public function setPrevious(?DelimiterInterface $previous): void; -} diff --git a/vendor/league/commonmark/src/Delimiter/DelimiterParser.php b/vendor/league/commonmark/src/Delimiter/DelimiterParser.php deleted file mode 100644 index ca00aeb7..00000000 --- a/vendor/league/commonmark/src/Delimiter/DelimiterParser.php +++ /dev/null @@ -1,104 +0,0 @@ -collection = $collection; - } - - public function getMatchDefinition(): InlineParserMatch - { - return InlineParserMatch::oneOf(...$this->collection->getDelimiterCharacters()); - } - - public function parse(InlineParserContext $inlineContext): bool - { - $character = $inlineContext->getFullMatch(); - $numDelims = 0; - $cursor = $inlineContext->getCursor(); - $processor = $this->collection->getDelimiterProcessor($character); - - if ($processor === null) { - throw new \LogicException('Delimiter processor should never be null here'); - } - - $charBefore = $cursor->peek(-1); - if ($charBefore === null) { - $charBefore = "\n"; - } - - while ($cursor->peek($numDelims) === $character) { - ++$numDelims; - } - - if ($numDelims < $processor->getMinLength()) { - return false; - } - - $cursor->advanceBy($numDelims); - - $charAfter = $cursor->getCurrentCharacter(); - if ($charAfter === null) { - $charAfter = "\n"; - } - - [$canOpen, $canClose] = self::determineCanOpenOrClose($charBefore, $charAfter, $character, $processor); - - $node = new Text(\str_repeat($character, $numDelims), [ - 'delim' => true, - ]); - $inlineContext->getContainer()->appendChild($node); - - // Add entry to stack to this opener - if ($canOpen || $canClose) { - $delimiter = new Delimiter($character, $numDelims, $node, $canOpen, $canClose); - $inlineContext->getDelimiterStack()->push($delimiter); - } - - return true; - } - - /** - * @return bool[] - */ - private static function determineCanOpenOrClose(string $charBefore, string $charAfter, string $character, DelimiterProcessorInterface $delimiterProcessor): array - { - $afterIsWhitespace = \preg_match(RegexHelper::REGEX_UNICODE_WHITESPACE_CHAR, $charAfter); - $afterIsPunctuation = \preg_match(RegexHelper::REGEX_PUNCTUATION, $charAfter); - $beforeIsWhitespace = \preg_match(RegexHelper::REGEX_UNICODE_WHITESPACE_CHAR, $charBefore); - $beforeIsPunctuation = \preg_match(RegexHelper::REGEX_PUNCTUATION, $charBefore); - - $leftFlanking = ! $afterIsWhitespace && (! $afterIsPunctuation || $beforeIsWhitespace || $beforeIsPunctuation); - $rightFlanking = ! $beforeIsWhitespace && (! $beforeIsPunctuation || $afterIsWhitespace || $afterIsPunctuation); - - if ($character === '_') { - $canOpen = $leftFlanking && (! $rightFlanking || $beforeIsPunctuation); - $canClose = $rightFlanking && (! $leftFlanking || $afterIsPunctuation); - } else { - $canOpen = $leftFlanking && $character === $delimiterProcessor->getOpeningCharacter(); - $canClose = $rightFlanking && $character === $delimiterProcessor->getClosingCharacter(); - } - - return [$canOpen, $canClose]; - } -} diff --git a/vendor/league/commonmark/src/Delimiter/DelimiterStack.php b/vendor/league/commonmark/src/Delimiter/DelimiterStack.php deleted file mode 100644 index fb95b907..00000000 --- a/vendor/league/commonmark/src/Delimiter/DelimiterStack.php +++ /dev/null @@ -1,214 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * Additional emphasis processing code based on commonmark-java (https://github.com/atlassian/commonmark-java) - * - (c) Atlassian Pty Ltd - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Delimiter; - -use League\CommonMark\Delimiter\Processor\DelimiterProcessorCollection; -use League\CommonMark\Node\Inline\AdjacentTextMerger; - -final class DelimiterStack -{ - /** @psalm-readonly-allow-private-mutation */ - private ?DelimiterInterface $top = null; - - public function push(DelimiterInterface $newDelimiter): void - { - $newDelimiter->setPrevious($this->top); - - if ($this->top !== null) { - $this->top->setNext($newDelimiter); - } - - $this->top = $newDelimiter; - } - - private function findEarliest(?DelimiterInterface $stackBottom = null): ?DelimiterInterface - { - $delimiter = $this->top; - while ($delimiter !== null && $delimiter->getPrevious() !== $stackBottom) { - $delimiter = $delimiter->getPrevious(); - } - - return $delimiter; - } - - public function removeDelimiter(DelimiterInterface $delimiter): void - { - if ($delimiter->getPrevious() !== null) { - /** @psalm-suppress PossiblyNullReference */ - $delimiter->getPrevious()->setNext($delimiter->getNext()); - } - - if ($delimiter->getNext() === null) { - // top of stack - $this->top = $delimiter->getPrevious(); - } else { - /** @psalm-suppress PossiblyNullReference */ - $delimiter->getNext()->setPrevious($delimiter->getPrevious()); - } - } - - private function removeDelimiterAndNode(DelimiterInterface $delimiter): void - { - $delimiter->getInlineNode()->detach(); - $this->removeDelimiter($delimiter); - } - - private function removeDelimitersBetween(DelimiterInterface $opener, DelimiterInterface $closer): void - { - $delimiter = $closer->getPrevious(); - while ($delimiter !== null && $delimiter !== $opener) { - $previous = $delimiter->getPrevious(); - $this->removeDelimiter($delimiter); - $delimiter = $previous; - } - } - - public function removeAll(?DelimiterInterface $stackBottom = null): void - { - while ($this->top && $this->top !== $stackBottom) { - $this->removeDelimiter($this->top); - } - } - - public function removeEarlierMatches(string $character): void - { - $opener = $this->top; - while ($opener !== null) { - if ($opener->getChar() === $character) { - $opener->setActive(false); - } - - $opener = $opener->getPrevious(); - } - } - - /** - * @param string|string[] $characters - */ - public function searchByCharacter($characters): ?DelimiterInterface - { - if (! \is_array($characters)) { - $characters = [$characters]; - } - - $opener = $this->top; - while ($opener !== null) { - if (\in_array($opener->getChar(), $characters, true)) { - break; - } - - $opener = $opener->getPrevious(); - } - - return $opener; - } - - public function processDelimiters(?DelimiterInterface $stackBottom, DelimiterProcessorCollection $processors): void - { - $openersBottom = []; - - // Find first closer above stackBottom - $closer = $this->findEarliest($stackBottom); - - // Move forward, looking for closers, and handling each - while ($closer !== null) { - $delimiterChar = $closer->getChar(); - - $delimiterProcessor = $processors->getDelimiterProcessor($delimiterChar); - if (! $closer->canClose() || $delimiterProcessor === null) { - $closer = $closer->getNext(); - continue; - } - - $openingDelimiterChar = $delimiterProcessor->getOpeningCharacter(); - - $useDelims = 0; - $openerFound = false; - $potentialOpenerFound = false; - $opener = $closer->getPrevious(); - while ($opener !== null && $opener !== $stackBottom && $opener !== ($openersBottom[$delimiterChar] ?? null)) { - if ($opener->canOpen() && $opener->getChar() === $openingDelimiterChar) { - $potentialOpenerFound = true; - $useDelims = $delimiterProcessor->getDelimiterUse($opener, $closer); - if ($useDelims > 0) { - $openerFound = true; - break; - } - } - - $opener = $opener->getPrevious(); - } - - if (! $openerFound) { - if (! $potentialOpenerFound) { - // Only do this when we didn't even have a potential - // opener (one that matches the character and can open). - // If an opener was rejected because of the number of - // delimiters (e.g. because of the "multiple of 3" - // Set lower bound for future searches for openersrule), - // we want to consider it next time because the number - // of delimiters can change as we continue processing. - $openersBottom[$delimiterChar] = $closer->getPrevious(); - if (! $closer->canOpen()) { - // We can remove a closer that can't be an opener, - // once we've seen there's no matching opener. - $this->removeDelimiter($closer); - } - } - - $closer = $closer->getNext(); - continue; - } - - \assert($opener !== null); - - $openerNode = $opener->getInlineNode(); - $closerNode = $closer->getInlineNode(); - - // Remove number of used delimiters from stack and inline nodes. - $opener->setLength($opener->getLength() - $useDelims); - $closer->setLength($closer->getLength() - $useDelims); - - $openerNode->setLiteral(\substr($openerNode->getLiteral(), 0, -$useDelims)); - $closerNode->setLiteral(\substr($closerNode->getLiteral(), 0, -$useDelims)); - - $this->removeDelimitersBetween($opener, $closer); - // The delimiter processor can re-parent the nodes between opener and closer, - // so make sure they're contiguous already. Exclusive because we want to keep opener/closer themselves. - AdjacentTextMerger::mergeTextNodesBetweenExclusive($openerNode, $closerNode); - $delimiterProcessor->process($openerNode, $closerNode, $useDelims); - - // No delimiter characters left to process, so we can remove delimiter and the now empty node. - if ($opener->getLength() === 0) { - $this->removeDelimiterAndNode($opener); - } - - // phpcs:disable SlevomatCodingStandard.ControlStructures.EarlyExit.EarlyExitNotUsed - if ($closer->getLength() === 0) { - $next = $closer->getNext(); - $this->removeDelimiterAndNode($closer); - $closer = $next; - } - } - - // Remove all delimiters - $this->removeAll($stackBottom); - } -} diff --git a/vendor/league/commonmark/src/Delimiter/Processor/DelimiterProcessorCollection.php b/vendor/league/commonmark/src/Delimiter/Processor/DelimiterProcessorCollection.php deleted file mode 100644 index b4b7767d..00000000 --- a/vendor/league/commonmark/src/Delimiter/Processor/DelimiterProcessorCollection.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * Additional emphasis processing code based on commonmark-java (https://github.com/atlassian/commonmark-java) - * - (c) Atlassian Pty Ltd - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Delimiter\Processor; - -final class DelimiterProcessorCollection implements DelimiterProcessorCollectionInterface -{ - /** - * @var array|DelimiterProcessorInterface[] - * - * @psalm-readonly-allow-private-mutation - */ - private array $processorsByChar = []; - - public function add(DelimiterProcessorInterface $processor): void - { - $opening = $processor->getOpeningCharacter(); - $closing = $processor->getClosingCharacter(); - - if ($opening === $closing) { - $old = $this->processorsByChar[$opening] ?? null; - if ($old !== null && $old->getOpeningCharacter() === $old->getClosingCharacter()) { - $this->addStaggeredDelimiterProcessorForChar($opening, $old, $processor); - } else { - $this->addDelimiterProcessorForChar($opening, $processor); - } - } else { - $this->addDelimiterProcessorForChar($opening, $processor); - $this->addDelimiterProcessorForChar($closing, $processor); - } - } - - public function getDelimiterProcessor(string $char): ?DelimiterProcessorInterface - { - return $this->processorsByChar[$char] ?? null; - } - - /** - * @return string[] - */ - public function getDelimiterCharacters(): array - { - return \array_keys($this->processorsByChar); - } - - private function addDelimiterProcessorForChar(string $delimiterChar, DelimiterProcessorInterface $processor): void - { - if (isset($this->processorsByChar[$delimiterChar])) { - throw new \InvalidArgumentException(\sprintf('Delim processor for character "%s" already exists', $processor->getOpeningCharacter())); - } - - $this->processorsByChar[$delimiterChar] = $processor; - } - - private function addStaggeredDelimiterProcessorForChar(string $opening, DelimiterProcessorInterface $old, DelimiterProcessorInterface $new): void - { - if ($old instanceof StaggeredDelimiterProcessor) { - $s = $old; - } else { - $s = new StaggeredDelimiterProcessor($opening, $old); - } - - $s->add($new); - $this->processorsByChar[$opening] = $s; - } - - public function count(): int - { - return \count($this->processorsByChar); - } -} diff --git a/vendor/league/commonmark/src/Delimiter/Processor/DelimiterProcessorCollectionInterface.php b/vendor/league/commonmark/src/Delimiter/Processor/DelimiterProcessorCollectionInterface.php deleted file mode 100644 index 2a12075c..00000000 --- a/vendor/league/commonmark/src/Delimiter/Processor/DelimiterProcessorCollectionInterface.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * Additional emphasis processing code based on commonmark-java (https://github.com/atlassian/commonmark-java) - * - (c) Atlassian Pty Ltd - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Delimiter\Processor; - -interface DelimiterProcessorCollectionInterface extends \Countable -{ - /** - * Add the given delim processor to the collection - * - * @param DelimiterProcessorInterface $processor The delim processor to add - * - * @throws \InvalidArgumentException Exception will be thrown if attempting to add multiple processors for the same character - */ - public function add(DelimiterProcessorInterface $processor): void; - - /** - * Returns the delim processor which handles the given character if one exists - */ - public function getDelimiterProcessor(string $char): ?DelimiterProcessorInterface; - - /** - * Returns an array of delimiter characters who have associated processors - * - * @return string[] - */ - public function getDelimiterCharacters(): array; -} diff --git a/vendor/league/commonmark/src/Delimiter/Processor/DelimiterProcessorInterface.php b/vendor/league/commonmark/src/Delimiter/Processor/DelimiterProcessorInterface.php deleted file mode 100644 index 465378c3..00000000 --- a/vendor/league/commonmark/src/Delimiter/Processor/DelimiterProcessorInterface.php +++ /dev/null @@ -1,78 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * Additional emphasis processing code based on commonmark-java (https://github.com/atlassian/commonmark-java) - * - (c) Atlassian Pty Ltd - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Delimiter\Processor; - -use League\CommonMark\Delimiter\DelimiterInterface; -use League\CommonMark\Node\Inline\AbstractStringContainer; - -/** - * Interface for a delimiter processor - */ -interface DelimiterProcessorInterface -{ - /** - * Returns the character that marks the beginning of a delimited node. - * - * This must not clash with any other processors being added to the environment. - */ - public function getOpeningCharacter(): string; - - /** - * Returns the character that marks the ending of a delimited node. - * - * This must not clash with any other processors being added to the environment. - * - * Note that for a symmetric delimiter such as "*", this is the same as the opening. - */ - public function getClosingCharacter(): string; - - /** - * Minimum number of delimiter characters that are needed to active this. - * - * Must be at least 1. - */ - public function getMinLength(): int; - - /** - * Determine how many (if any) of the delimiter characters should be used. - * - * This allows implementations to decide how many characters to be used - * based on the properties of the delimiter runs. An implementation can also - * return 0 when it doesn't want to allow this particular combination of - * delimiter runs. - * - * @param DelimiterInterface $opener The opening delimiter run - * @param DelimiterInterface $closer The closing delimiter run - */ - public function getDelimiterUse(DelimiterInterface $opener, DelimiterInterface $closer): int; - - /** - * Process the matched delimiters, e.g. by wrapping the nodes between opener - * and closer in a new node, or appending a new node after the opener. - * - * Note that removal of the delimiter from the delimiter nodes and detaching - * them is done by the caller. - * - * @param AbstractStringContainer $opener The node that contained the opening delimiter - * @param AbstractStringContainer $closer The node that contained the closing delimiter - * @param int $delimiterUse The number of delimiters that were used - */ - public function process(AbstractStringContainer $opener, AbstractStringContainer $closer, int $delimiterUse): void; -} diff --git a/vendor/league/commonmark/src/Delimiter/Processor/StaggeredDelimiterProcessor.php b/vendor/league/commonmark/src/Delimiter/Processor/StaggeredDelimiterProcessor.php deleted file mode 100644 index e0404198..00000000 --- a/vendor/league/commonmark/src/Delimiter/Processor/StaggeredDelimiterProcessor.php +++ /dev/null @@ -1,108 +0,0 @@ - - * - * Additional emphasis processing code based on commonmark-java (https://github.com/atlassian/commonmark-java) - * - (c) Atlassian Pty Ltd - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Delimiter\Processor; - -use League\CommonMark\Delimiter\DelimiterInterface; -use League\CommonMark\Node\Inline\AbstractStringContainer; - -/** - * An implementation of DelimiterProcessorInterface that dispatches all calls to two or more other DelimiterProcessors - * depending on the length of the delimiter run. All child DelimiterProcessors must have different minimum - * lengths. A given delimiter run is dispatched to the child with the largest acceptable minimum length. If no - * child is applicable, the one with the largest minimum length is chosen. - * - * @internal - */ -final class StaggeredDelimiterProcessor implements DelimiterProcessorInterface -{ - /** @psalm-readonly */ - private string $delimiterChar; - - /** @psalm-readonly-allow-private-mutation */ - private int $minLength = 0; - - /** - * @var array|DelimiterProcessorInterface[] - * - * @psalm-readonly-allow-private-mutation - */ - private array $processors = []; // keyed by minLength in reverse order - - public function __construct(string $char, DelimiterProcessorInterface $processor) - { - $this->delimiterChar = $char; - $this->add($processor); - } - - public function getOpeningCharacter(): string - { - return $this->delimiterChar; - } - - public function getClosingCharacter(): string - { - return $this->delimiterChar; - } - - public function getMinLength(): int - { - return $this->minLength; - } - - /** - * Adds the given processor to this staggered delimiter processor - */ - public function add(DelimiterProcessorInterface $processor): void - { - $len = $processor->getMinLength(); - - if (isset($this->processors[$len])) { - throw new \InvalidArgumentException(\sprintf('Cannot add two delimiter processors for char "%s" and minimum length %d', $this->delimiterChar, $len)); - } - - $this->processors[$len] = $processor; - \krsort($this->processors); - - $this->minLength = \min($this->minLength, $len); - } - - public function getDelimiterUse(DelimiterInterface $opener, DelimiterInterface $closer): int - { - return $this->findProcessor($opener->getLength())->getDelimiterUse($opener, $closer); - } - - public function process(AbstractStringContainer $opener, AbstractStringContainer $closer, int $delimiterUse): void - { - $this->findProcessor($delimiterUse)->process($opener, $closer, $delimiterUse); - } - - private function findProcessor(int $len): DelimiterProcessorInterface - { - // Find the "longest" processor which can handle this length - foreach ($this->processors as $processor) { - if ($processor->getMinLength() <= $len) { - return $processor; - } - } - - // Just use the first one in our list - $first = \reset($this->processors); - \assert($first instanceof DelimiterProcessorInterface); - - return $first; - } -} diff --git a/vendor/league/commonmark/src/Environment/Environment.php b/vendor/league/commonmark/src/Environment/Environment.php deleted file mode 100644 index c5897f80..00000000 --- a/vendor/league/commonmark/src/Environment/Environment.php +++ /dev/null @@ -1,446 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Environment; - -use League\CommonMark\Delimiter\DelimiterParser; -use League\CommonMark\Delimiter\Processor\DelimiterProcessorCollection; -use League\CommonMark\Delimiter\Processor\DelimiterProcessorInterface; -use League\CommonMark\Event\DocumentParsedEvent; -use League\CommonMark\Event\ListenerData; -use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension; -use League\CommonMark\Extension\ConfigurableExtensionInterface; -use League\CommonMark\Extension\ExtensionInterface; -use League\CommonMark\Extension\GithubFlavoredMarkdownExtension; -use League\CommonMark\Normalizer\SlugNormalizer; -use League\CommonMark\Normalizer\TextNormalizerInterface; -use League\CommonMark\Normalizer\UniqueSlugNormalizer; -use League\CommonMark\Normalizer\UniqueSlugNormalizerInterface; -use League\CommonMark\Parser\Block\BlockStartParserInterface; -use League\CommonMark\Parser\Block\SkipLinesStartingWithLettersParser; -use League\CommonMark\Parser\Inline\InlineParserInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\CommonMark\Util\HtmlFilter; -use League\CommonMark\Util\PrioritizedList; -use League\Config\Configuration; -use League\Config\ConfigurationAwareInterface; -use League\Config\ConfigurationInterface; -use Nette\Schema\Expect; -use Psr\EventDispatcher\EventDispatcherInterface; -use Psr\EventDispatcher\ListenerProviderInterface; -use Psr\EventDispatcher\StoppableEventInterface; - -final class Environment implements EnvironmentInterface, EnvironmentBuilderInterface, ListenerProviderInterface -{ - /** - * @var ExtensionInterface[] - * - * @psalm-readonly-allow-private-mutation - */ - private array $extensions = []; - - /** - * @var ExtensionInterface[] - * - * @psalm-readonly-allow-private-mutation - */ - private array $uninitializedExtensions = []; - - /** @psalm-readonly-allow-private-mutation */ - private bool $extensionsInitialized = false; - - /** - * @var PrioritizedList - * - * @psalm-readonly - */ - private PrioritizedList $blockStartParsers; - - /** - * @var PrioritizedList - * - * @psalm-readonly - */ - private PrioritizedList $inlineParsers; - - /** @psalm-readonly */ - private DelimiterProcessorCollection $delimiterProcessors; - - /** - * @var array> - * - * @psalm-readonly-allow-private-mutation - */ - private array $renderersByClass = []; - - /** - * @var PrioritizedList - * - * @psalm-readonly-allow-private-mutation - */ - private PrioritizedList $listenerData; - - private ?EventDispatcherInterface $eventDispatcher = null; - - /** @psalm-readonly */ - private Configuration $config; - - private ?TextNormalizerInterface $slugNormalizer = null; - - /** - * @param array $config - */ - public function __construct(array $config = []) - { - $this->config = self::createDefaultConfiguration(); - $this->config->merge($config); - - $this->blockStartParsers = new PrioritizedList(); - $this->inlineParsers = new PrioritizedList(); - $this->listenerData = new PrioritizedList(); - $this->delimiterProcessors = new DelimiterProcessorCollection(); - - // Performance optimization: always include a block "parser" that aborts parsing if a line starts with a letter - // and is therefore unlikely to match any lines as a block start. - $this->addBlockStartParser(new SkipLinesStartingWithLettersParser(), 249); - } - - public function getConfiguration(): ConfigurationInterface - { - return $this->config->reader(); - } - - /** - * @deprecated Environment::mergeConfig() is deprecated since league/commonmark v2.0 and will be removed in v3.0. Configuration should be set when instantiating the environment instead. - * - * @param array $config - */ - public function mergeConfig(array $config): void - { - @\trigger_error('Environment::mergeConfig() is deprecated since league/commonmark v2.0 and will be removed in v3.0. Configuration should be set when instantiating the environment instead.', \E_USER_DEPRECATED); - - $this->assertUninitialized('Failed to modify configuration.'); - - $this->config->merge($config); - } - - public function addBlockStartParser(BlockStartParserInterface $parser, int $priority = 0): EnvironmentBuilderInterface - { - $this->assertUninitialized('Failed to add block start parser.'); - - $this->blockStartParsers->add($parser, $priority); - $this->injectEnvironmentAndConfigurationIfNeeded($parser); - - return $this; - } - - public function addInlineParser(InlineParserInterface $parser, int $priority = 0): EnvironmentBuilderInterface - { - $this->assertUninitialized('Failed to add inline parser.'); - - $this->inlineParsers->add($parser, $priority); - $this->injectEnvironmentAndConfigurationIfNeeded($parser); - - return $this; - } - - public function addDelimiterProcessor(DelimiterProcessorInterface $processor): EnvironmentBuilderInterface - { - $this->assertUninitialized('Failed to add delimiter processor.'); - $this->delimiterProcessors->add($processor); - $this->injectEnvironmentAndConfigurationIfNeeded($processor); - - return $this; - } - - public function addRenderer(string $nodeClass, NodeRendererInterface $renderer, int $priority = 0): EnvironmentBuilderInterface - { - $this->assertUninitialized('Failed to add renderer.'); - - if (! isset($this->renderersByClass[$nodeClass])) { - $this->renderersByClass[$nodeClass] = new PrioritizedList(); - } - - $this->renderersByClass[$nodeClass]->add($renderer, $priority); - $this->injectEnvironmentAndConfigurationIfNeeded($renderer); - - return $this; - } - - /** - * {@inheritDoc} - */ - public function getBlockStartParsers(): iterable - { - if (! $this->extensionsInitialized) { - $this->initializeExtensions(); - } - - return $this->blockStartParsers->getIterator(); - } - - public function getDelimiterProcessors(): DelimiterProcessorCollection - { - if (! $this->extensionsInitialized) { - $this->initializeExtensions(); - } - - return $this->delimiterProcessors; - } - - /** - * {@inheritDoc} - */ - public function getRenderersForClass(string $nodeClass): iterable - { - if (! $this->extensionsInitialized) { - $this->initializeExtensions(); - } - - // If renderers are defined for this specific class, return them immediately - if (isset($this->renderersByClass[$nodeClass])) { - return $this->renderersByClass[$nodeClass]; - } - - /** @psalm-suppress TypeDoesNotContainType -- Bug: https://github.com/vimeo/psalm/issues/3332 */ - while (\class_exists($parent ??= $nodeClass) && $parent = \get_parent_class($parent)) { - if (! isset($this->renderersByClass[$parent])) { - continue; - } - - // "Cache" this result to avoid future loops - return $this->renderersByClass[$nodeClass] = $this->renderersByClass[$parent]; - } - - return []; - } - - /** - * {@inheritDoc} - */ - public function getExtensions(): iterable - { - return $this->extensions; - } - - /** - * Add a single extension - * - * @return $this - */ - public function addExtension(ExtensionInterface $extension): EnvironmentBuilderInterface - { - $this->assertUninitialized('Failed to add extension.'); - - $this->extensions[] = $extension; - $this->uninitializedExtensions[] = $extension; - - if ($extension instanceof ConfigurableExtensionInterface) { - $extension->configureSchema($this->config); - } - - return $this; - } - - private function initializeExtensions(): void - { - // Initialize the slug normalizer - $this->getSlugNormalizer(); - - // Ask all extensions to register their components - while (\count($this->uninitializedExtensions) > 0) { - foreach ($this->uninitializedExtensions as $i => $extension) { - $extension->register($this); - unset($this->uninitializedExtensions[$i]); - } - } - - $this->extensionsInitialized = true; - - // Create the special delimiter parser if any processors were registered - if ($this->delimiterProcessors->count() > 0) { - $this->inlineParsers->add(new DelimiterParser($this->delimiterProcessors), PHP_INT_MIN); - } - } - - private function injectEnvironmentAndConfigurationIfNeeded(object $object): void - { - if ($object instanceof EnvironmentAwareInterface) { - $object->setEnvironment($this); - } - - if ($object instanceof ConfigurationAwareInterface) { - $object->setConfiguration($this->config->reader()); - } - } - - /** - * @deprecated Instantiate the environment and add the extension yourself - * - * @param array $config - */ - public static function createCommonMarkEnvironment(array $config = []): Environment - { - $environment = new self($config); - $environment->addExtension(new CommonMarkCoreExtension()); - - return $environment; - } - - /** - * @deprecated Instantiate the environment and add the extension yourself - * - * @param array $config - */ - public static function createGFMEnvironment(array $config = []): Environment - { - $environment = new self($config); - $environment->addExtension(new CommonMarkCoreExtension()); - $environment->addExtension(new GithubFlavoredMarkdownExtension()); - - return $environment; - } - - public function addEventListener(string $eventClass, callable $listener, int $priority = 0): EnvironmentBuilderInterface - { - $this->assertUninitialized('Failed to add event listener.'); - - $this->listenerData->add(new ListenerData($eventClass, $listener), $priority); - - if (\is_object($listener)) { - $this->injectEnvironmentAndConfigurationIfNeeded($listener); - } elseif (\is_array($listener) && \is_object($listener[0])) { - $this->injectEnvironmentAndConfigurationIfNeeded($listener[0]); - } - - return $this; - } - - public function dispatch(object $event): object - { - if (! $this->extensionsInitialized) { - $this->initializeExtensions(); - } - - if ($this->eventDispatcher !== null) { - return $this->eventDispatcher->dispatch($event); - } - - foreach ($this->getListenersForEvent($event) as $listener) { - if ($event instanceof StoppableEventInterface && $event->isPropagationStopped()) { - return $event; - } - - $listener($event); - } - - return $event; - } - - public function setEventDispatcher(EventDispatcherInterface $dispatcher): void - { - $this->eventDispatcher = $dispatcher; - } - - /** - * {@inheritDoc} - * - * @return iterable - */ - public function getListenersForEvent(object $event): iterable - { - foreach ($this->listenerData as $listenerData) { - \assert($listenerData instanceof ListenerData); - - /** @psalm-suppress ArgumentTypeCoercion */ - if (! \is_a($event, $listenerData->getEvent())) { - continue; - } - - yield function (object $event) use ($listenerData) { - if (! $this->extensionsInitialized) { - $this->initializeExtensions(); - } - - return \call_user_func($listenerData->getListener(), $event); - }; - } - } - - /** - * @return iterable - */ - public function getInlineParsers(): iterable - { - if (! $this->extensionsInitialized) { - $this->initializeExtensions(); - } - - return $this->inlineParsers->getIterator(); - } - - public function getSlugNormalizer(): TextNormalizerInterface - { - if ($this->slugNormalizer === null) { - $normalizer = $this->config->get('slug_normalizer/instance'); - \assert($normalizer instanceof TextNormalizerInterface); - $this->injectEnvironmentAndConfigurationIfNeeded($normalizer); - - if ($this->config->get('slug_normalizer/unique') !== UniqueSlugNormalizerInterface::DISABLED && ! $normalizer instanceof UniqueSlugNormalizer) { - $normalizer = new UniqueSlugNormalizer($normalizer); - } - - if ($normalizer instanceof UniqueSlugNormalizer) { - if ($this->config->get('slug_normalizer/unique') === UniqueSlugNormalizerInterface::PER_DOCUMENT) { - $this->addEventListener(DocumentParsedEvent::class, [$normalizer, 'clearHistory'], -1000); - } - } - - $this->slugNormalizer = $normalizer; - } - - return $this->slugNormalizer; - } - - /** - * @throws \RuntimeException - */ - private function assertUninitialized(string $message): void - { - if ($this->extensionsInitialized) { - throw new \RuntimeException($message . ' Extensions have already been initialized.'); - } - } - - public static function createDefaultConfiguration(): Configuration - { - return new Configuration([ - 'html_input' => Expect::anyOf(HtmlFilter::STRIP, HtmlFilter::ALLOW, HtmlFilter::ESCAPE)->default(HtmlFilter::ALLOW), - 'allow_unsafe_links' => Expect::bool(true), - 'max_nesting_level' => Expect::type('int')->default(PHP_INT_MAX), - 'renderer' => Expect::structure([ - 'block_separator' => Expect::string("\n"), - 'inner_separator' => Expect::string("\n"), - 'soft_break' => Expect::string("\n"), - ]), - 'slug_normalizer' => Expect::structure([ - 'instance' => Expect::type(TextNormalizerInterface::class)->default(new SlugNormalizer()), - 'max_length' => Expect::int()->min(0)->default(255), - 'unique' => Expect::anyOf(UniqueSlugNormalizerInterface::DISABLED, UniqueSlugNormalizerInterface::PER_ENVIRONMENT, UniqueSlugNormalizerInterface::PER_DOCUMENT)->default(UniqueSlugNormalizerInterface::PER_DOCUMENT), - ]), - ]); - } -} diff --git a/vendor/league/commonmark/src/Environment/EnvironmentAwareInterface.php b/vendor/league/commonmark/src/Environment/EnvironmentAwareInterface.php deleted file mode 100644 index 44b9d3ec..00000000 --- a/vendor/league/commonmark/src/Environment/EnvironmentAwareInterface.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Environment; - -interface EnvironmentAwareInterface -{ - public function setEnvironment(EnvironmentInterface $environment): void; -} diff --git a/vendor/league/commonmark/src/Environment/EnvironmentBuilderInterface.php b/vendor/league/commonmark/src/Environment/EnvironmentBuilderInterface.php deleted file mode 100644 index 4590777e..00000000 --- a/vendor/league/commonmark/src/Environment/EnvironmentBuilderInterface.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 League\CommonMark\Environment; - -use League\CommonMark\Delimiter\Processor\DelimiterProcessorInterface; -use League\CommonMark\Extension\ExtensionInterface; -use League\CommonMark\Node\Node; -use League\CommonMark\Parser\Block\BlockStartParserInterface; -use League\CommonMark\Parser\Inline\InlineParserInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\Config\ConfigurationProviderInterface; - -/** - * Interface for building the Environment with any extensions, parsers, listeners, etc. that it may need - */ -interface EnvironmentBuilderInterface extends ConfigurationProviderInterface -{ - /** - * Registers the given extension with the Environment - */ - public function addExtension(ExtensionInterface $extension): EnvironmentBuilderInterface; - - /** - * Registers the given block start parser with the Environment - * - * @param BlockStartParserInterface $parser Block parser instance - * @param int $priority Priority (a higher number will be executed earlier) - * - * @return $this - */ - public function addBlockStartParser(BlockStartParserInterface $parser, int $priority = 0): EnvironmentBuilderInterface; - - /** - * Registers the given inline parser with the Environment - * - * @param InlineParserInterface $parser Inline parser instance - * @param int $priority Priority (a higher number will be executed earlier) - * - * @return $this - */ - public function addInlineParser(InlineParserInterface $parser, int $priority = 0): EnvironmentBuilderInterface; - - /** - * Registers the given delimiter processor with the Environment - * - * @param DelimiterProcessorInterface $processor Delimiter processors instance - */ - public function addDelimiterProcessor(DelimiterProcessorInterface $processor): EnvironmentBuilderInterface; - - /** - * Registers the given node renderer with the Environment - * - * @param string $nodeClass The fully-qualified node element class name the renderer below should handle - * @param NodeRendererInterface $renderer The renderer responsible for rendering the type of element given above - * @param int $priority Priority (a higher number will be executed earlier) - * - * @psalm-param class-string $nodeClass - * - * @return $this - */ - public function addRenderer(string $nodeClass, NodeRendererInterface $renderer, int $priority = 0): EnvironmentBuilderInterface; - - /** - * Registers the given event listener - * - * @param class-string $eventClass Fully-qualified class name of the event this listener should respond to - * @param callable $listener Listener to be executed - * @param int $priority Priority (a higher number will be executed earlier) - * - * @return $this - */ - public function addEventListener(string $eventClass, callable $listener, int $priority = 0): EnvironmentBuilderInterface; -} diff --git a/vendor/league/commonmark/src/Environment/EnvironmentInterface.php b/vendor/league/commonmark/src/Environment/EnvironmentInterface.php deleted file mode 100644 index 8e19a527..00000000 --- a/vendor/league/commonmark/src/Environment/EnvironmentInterface.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Environment; - -use League\CommonMark\Delimiter\Processor\DelimiterProcessorCollection; -use League\CommonMark\Extension\ExtensionInterface; -use League\CommonMark\Node\Node; -use League\CommonMark\Normalizer\TextNormalizerInterface; -use League\CommonMark\Parser\Block\BlockStartParserInterface; -use League\CommonMark\Parser\Inline\InlineParserInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\Config\ConfigurationProviderInterface; -use Psr\EventDispatcher\EventDispatcherInterface; - -interface EnvironmentInterface extends ConfigurationProviderInterface, EventDispatcherInterface -{ - /** - * Get all registered extensions - * - * @return ExtensionInterface[] - */ - public function getExtensions(): iterable; - - /** - * @return iterable - */ - public function getBlockStartParsers(): iterable; - - /** - * @return iterable - */ - public function getInlineParsers(): iterable; - - public function getDelimiterProcessors(): DelimiterProcessorCollection; - - /** - * @psalm-param class-string $nodeClass - * - * @return iterable - */ - public function getRenderersForClass(string $nodeClass): iterable; - - public function getSlugNormalizer(): TextNormalizerInterface; -} diff --git a/vendor/league/commonmark/src/Event/AbstractEvent.php b/vendor/league/commonmark/src/Event/AbstractEvent.php deleted file mode 100644 index 8c83f922..00000000 --- a/vendor/league/commonmark/src/Event/AbstractEvent.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * Original code based on the Symfony EventDispatcher "Event" contract - * - (c) 2018-2019 Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Event; - -use Psr\EventDispatcher\StoppableEventInterface; - -/** - * Base class for classes containing event data. - * - * This class contains no event data. It is used by events that do not pass - * state information to an event handler when an event is raised. - * - * You can call the method stopPropagation() to abort the execution of - * further listeners in your event listener. - */ -abstract class AbstractEvent implements StoppableEventInterface -{ - /** @psalm-readonly-allow-private-mutation */ - private bool $propagationStopped = false; - - /** - * Returns whether further event listeners should be triggered. - */ - final public function isPropagationStopped(): bool - { - return $this->propagationStopped; - } - - /** - * Stops the propagation of the event to further event listeners. - * - * If multiple event listeners are connected to the same event, no - * further event listener will be triggered once any trigger calls - * stopPropagation(). - */ - final public function stopPropagation(): void - { - $this->propagationStopped = true; - } -} diff --git a/vendor/league/commonmark/src/Event/DocumentParsedEvent.php b/vendor/league/commonmark/src/Event/DocumentParsedEvent.php deleted file mode 100644 index 04664c5a..00000000 --- a/vendor/league/commonmark/src/Event/DocumentParsedEvent.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Event; - -use League\CommonMark\Node\Block\Document; - -/** - * Event dispatched when the document has been fully parsed - */ -final class DocumentParsedEvent extends AbstractEvent -{ - /** @psalm-readonly */ - private Document $document; - - public function __construct(Document $document) - { - $this->document = $document; - } - - public function getDocument(): Document - { - return $this->document; - } -} diff --git a/vendor/league/commonmark/src/Event/DocumentPreParsedEvent.php b/vendor/league/commonmark/src/Event/DocumentPreParsedEvent.php deleted file mode 100644 index ad725124..00000000 --- a/vendor/league/commonmark/src/Event/DocumentPreParsedEvent.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Event; - -use League\CommonMark\Input\MarkdownInputInterface; -use League\CommonMark\Node\Block\Document; - -/** - * Event dispatched when the document is about to be parsed - */ -final class DocumentPreParsedEvent extends AbstractEvent -{ - /** @psalm-readonly */ - private Document $document; - - private MarkdownInputInterface $markdown; - - public function __construct(Document $document, MarkdownInputInterface $markdown) - { - $this->document = $document; - $this->markdown = $markdown; - } - - public function getDocument(): Document - { - return $this->document; - } - - public function getMarkdown(): MarkdownInputInterface - { - return $this->markdown; - } - - public function replaceMarkdown(MarkdownInputInterface $markdownInput): void - { - $this->markdown = $markdownInput; - } -} diff --git a/vendor/league/commonmark/src/Event/DocumentPreRenderEvent.php b/vendor/league/commonmark/src/Event/DocumentPreRenderEvent.php deleted file mode 100644 index c569ca33..00000000 --- a/vendor/league/commonmark/src/Event/DocumentPreRenderEvent.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Event; - -use League\CommonMark\Node\Block\Document; - -/** - * Event dispatched just before rendering begins - */ -final class DocumentPreRenderEvent extends AbstractEvent -{ - /** @psalm-readonly */ - private Document $document; - - /** @psalm-readonly */ - private string $format; - - public function __construct(Document $document, string $format) - { - $this->document = $document; - $this->format = $format; - } - - public function getDocument(): Document - { - return $this->document; - } - - public function getFormat(): string - { - return $this->format; - } -} diff --git a/vendor/league/commonmark/src/Event/DocumentRenderedEvent.php b/vendor/league/commonmark/src/Event/DocumentRenderedEvent.php deleted file mode 100644 index 7e49d01f..00000000 --- a/vendor/league/commonmark/src/Event/DocumentRenderedEvent.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. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Event; - -use League\CommonMark\Output\RenderedContentInterface; - -final class DocumentRenderedEvent extends AbstractEvent -{ - private RenderedContentInterface $output; - - public function __construct(RenderedContentInterface $output) - { - $this->output = $output; - } - - /** - * @psalm-mutation-free - */ - public function getOutput(): RenderedContentInterface - { - return $this->output; - } - - /** - * @psalm-external-mutation-free - */ - public function replaceOutput(RenderedContentInterface $output): void - { - $this->output = $output; - } -} diff --git a/vendor/league/commonmark/src/Event/ListenerData.php b/vendor/league/commonmark/src/Event/ListenerData.php deleted file mode 100644 index 4cf3b3a3..00000000 --- a/vendor/league/commonmark/src/Event/ListenerData.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Event; - -/** - * @internal - * - * @psalm-immutable - */ -final class ListenerData -{ - /** @var class-string */ - private string $event; - - /** @var callable */ - private $listener; - - /** - * @param class-string $event - */ - public function __construct(string $event, callable $listener) - { - $this->event = $event; - $this->listener = $listener; - } - - /** - * @return class-string - */ - public function getEvent(): string - { - return $this->event; - } - - public function getListener(): callable - { - return $this->listener; - } -} diff --git a/vendor/league/commonmark/src/Exception/UnexpectedEncodingException.php b/vendor/league/commonmark/src/Exception/UnexpectedEncodingException.php deleted file mode 100644 index 17329e22..00000000 --- a/vendor/league/commonmark/src/Exception/UnexpectedEncodingException.php +++ /dev/null @@ -1,18 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Exception; - -final class UnexpectedEncodingException extends \RuntimeException -{ -} diff --git a/vendor/league/commonmark/src/Extension/Attributes/AttributesExtension.php b/vendor/league/commonmark/src/Extension/Attributes/AttributesExtension.php deleted file mode 100644 index 2ef3d85c..00000000 --- a/vendor/league/commonmark/src/Extension/Attributes/AttributesExtension.php +++ /dev/null @@ -1,32 +0,0 @@ - - * (c) 2015 Martin Hasoň - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Extension\Attributes; - -use League\CommonMark\Environment\EnvironmentBuilderInterface; -use League\CommonMark\Event\DocumentParsedEvent; -use League\CommonMark\Extension\Attributes\Event\AttributesListener; -use League\CommonMark\Extension\Attributes\Parser\AttributesBlockStartParser; -use League\CommonMark\Extension\Attributes\Parser\AttributesInlineParser; -use League\CommonMark\Extension\ExtensionInterface; - -final class AttributesExtension implements ExtensionInterface -{ - public function register(EnvironmentBuilderInterface $environment): void - { - $environment->addBlockStartParser(new AttributesBlockStartParser()); - $environment->addInlineParser(new AttributesInlineParser()); - $environment->addEventListener(DocumentParsedEvent::class, [new AttributesListener(), 'processDocument']); - } -} diff --git a/vendor/league/commonmark/src/Extension/Attributes/Event/AttributesListener.php b/vendor/league/commonmark/src/Extension/Attributes/Event/AttributesListener.php deleted file mode 100644 index feec8cce..00000000 --- a/vendor/league/commonmark/src/Extension/Attributes/Event/AttributesListener.php +++ /dev/null @@ -1,139 +0,0 @@ - - * (c) 2015 Martin Hasoň - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Extension\Attributes\Event; - -use League\CommonMark\Event\DocumentParsedEvent; -use League\CommonMark\Extension\Attributes\Node\Attributes; -use League\CommonMark\Extension\Attributes\Node\AttributesInline; -use League\CommonMark\Extension\Attributes\Util\AttributesHelper; -use League\CommonMark\Extension\CommonMark\Node\Block\FencedCode; -use League\CommonMark\Extension\CommonMark\Node\Block\ListBlock; -use League\CommonMark\Extension\CommonMark\Node\Block\ListItem; -use League\CommonMark\Node\Inline\AbstractInline; -use League\CommonMark\Node\Node; - -final class AttributesListener -{ - private const DIRECTION_PREFIX = 'prefix'; - private const DIRECTION_SUFFIX = 'suffix'; - - public function processDocument(DocumentParsedEvent $event): void - { - foreach ($event->getDocument()->iterator() as $node) { - if (! ($node instanceof Attributes || $node instanceof AttributesInline)) { - continue; - } - - [$target, $direction] = self::findTargetAndDirection($node); - - if ($target instanceof Node) { - $parent = $target->parent(); - if ($parent instanceof ListItem && $parent->parent() instanceof ListBlock && $parent->parent()->isTight()) { - $target = $parent; - } - - if ($direction === self::DIRECTION_SUFFIX) { - $attributes = AttributesHelper::mergeAttributes($target, $node->getAttributes()); - } else { - $attributes = AttributesHelper::mergeAttributes($node->getAttributes(), $target); - } - - $target->data->set('attributes', $attributes); - } - - $node->detach(); - } - } - - /** - * @param Attributes|AttributesInline $node - * - * @return array - */ - private static function findTargetAndDirection($node): array - { - $target = null; - $direction = null; - $previous = $next = $node; - while (true) { - $previous = self::getPrevious($previous); - $next = self::getNext($next); - - if ($previous === null && $next === null) { - if (! $node->parent() instanceof FencedCode) { - $target = $node->parent(); - $direction = self::DIRECTION_SUFFIX; - } - - break; - } - - if ($node instanceof AttributesInline && ($previous === null || ($previous instanceof AbstractInline && $node->isBlock()))) { - continue; - } - - if ($previous !== null && ! self::isAttributesNode($previous)) { - $target = $previous; - $direction = self::DIRECTION_SUFFIX; - - break; - } - - if ($next !== null && ! self::isAttributesNode($next)) { - $target = $next; - $direction = self::DIRECTION_PREFIX; - - break; - } - } - - return [$target, $direction]; - } - - /** - * Get any previous block (sibling or parent) this might apply to - */ - private static function getPrevious(?Node $node = null): ?Node - { - if ($node instanceof Attributes) { - if ($node->getTarget() === Attributes::TARGET_NEXT) { - return null; - } - - if ($node->getTarget() === Attributes::TARGET_PARENT) { - return $node->parent(); - } - } - - return $node instanceof Node ? $node->previous() : null; - } - - /** - * Get any previous block (sibling or parent) this might apply to - */ - private static function getNext(?Node $node = null): ?Node - { - if ($node instanceof Attributes && $node->getTarget() !== Attributes::TARGET_NEXT) { - return null; - } - - return $node instanceof Node ? $node->next() : null; - } - - private static function isAttributesNode(Node $node): bool - { - return $node instanceof Attributes || $node instanceof AttributesInline; - } -} diff --git a/vendor/league/commonmark/src/Extension/Attributes/Node/Attributes.php b/vendor/league/commonmark/src/Extension/Attributes/Node/Attributes.php deleted file mode 100644 index 096f04af..00000000 --- a/vendor/league/commonmark/src/Extension/Attributes/Node/Attributes.php +++ /dev/null @@ -1,65 +0,0 @@ - - * (c) 2015 Martin Hasoň - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Extension\Attributes\Node; - -use League\CommonMark\Node\Block\AbstractBlock; - -final class Attributes extends AbstractBlock -{ - public const TARGET_PARENT = 0; - public const TARGET_PREVIOUS = 1; - public const TARGET_NEXT = 2; - - /** @var array */ - private array $attributes; - - private int $target = self::TARGET_NEXT; - - /** - * @param array $attributes - */ - public function __construct(array $attributes) - { - parent::__construct(); - - $this->attributes = $attributes; - } - - /** - * @return array - */ - public function getAttributes(): array - { - return $this->attributes; - } - - /** - * @param array $attributes - */ - public function setAttributes(array $attributes): void - { - $this->attributes = $attributes; - } - - public function getTarget(): int - { - return $this->target; - } - - public function setTarget(int $target): void - { - $this->target = $target; - } -} diff --git a/vendor/league/commonmark/src/Extension/Attributes/Node/AttributesInline.php b/vendor/league/commonmark/src/Extension/Attributes/Node/AttributesInline.php deleted file mode 100644 index d8b0d08f..00000000 --- a/vendor/league/commonmark/src/Extension/Attributes/Node/AttributesInline.php +++ /dev/null @@ -1,57 +0,0 @@ - - * (c) 2015 Martin Hasoň - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Extension\Attributes\Node; - -use League\CommonMark\Node\Inline\AbstractInline; - -final class AttributesInline extends AbstractInline -{ - /** @var array */ - private array $attributes; - - private bool $block; - - /** - * @param array $attributes - */ - public function __construct(array $attributes, bool $block) - { - parent::__construct(); - - $this->attributes = $attributes; - $this->block = $block; - } - - /** - * @return array - */ - public function getAttributes(): array - { - return $this->attributes; - } - - /** - * @param array $attributes - */ - public function setAttributes(array $attributes): void - { - $this->attributes = $attributes; - } - - public function isBlock(): bool - { - return $this->block; - } -} diff --git a/vendor/league/commonmark/src/Extension/Attributes/Parser/AttributesBlockContinueParser.php b/vendor/league/commonmark/src/Extension/Attributes/Parser/AttributesBlockContinueParser.php deleted file mode 100644 index 6e0cdc6e..00000000 --- a/vendor/league/commonmark/src/Extension/Attributes/Parser/AttributesBlockContinueParser.php +++ /dev/null @@ -1,92 +0,0 @@ - - * (c) 2015 Martin Hasoň - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Extension\Attributes\Parser; - -use League\CommonMark\Extension\Attributes\Node\Attributes; -use League\CommonMark\Extension\Attributes\Util\AttributesHelper; -use League\CommonMark\Node\Block\AbstractBlock; -use League\CommonMark\Parser\Block\AbstractBlockContinueParser; -use League\CommonMark\Parser\Block\BlockContinue; -use League\CommonMark\Parser\Block\BlockContinueParserInterface; -use League\CommonMark\Parser\Cursor; - -final class AttributesBlockContinueParser extends AbstractBlockContinueParser -{ - private Attributes $block; - - private AbstractBlock $container; - - private bool $hasSubsequentLine = false; - - /** - * @param array $attributes The attributes identified by the block start parser - * @param AbstractBlock $container The node we were in when these attributes were discovered - */ - public function __construct(array $attributes, AbstractBlock $container) - { - $this->block = new Attributes($attributes); - - $this->container = $container; - } - - public function getBlock(): AbstractBlock - { - return $this->block; - } - - public function tryContinue(Cursor $cursor, BlockContinueParserInterface $activeBlockParser): ?BlockContinue - { - $this->hasSubsequentLine = true; - - $cursor->advanceToNextNonSpaceOrTab(); - - // Does this next line also have attributes? - $attributes = AttributesHelper::parseAttributes($cursor); - $cursor->advanceToNextNonSpaceOrTab(); - if ($cursor->isAtEnd() && $attributes !== []) { - // It does! Merge them into what we parsed previously - $this->block->setAttributes(AttributesHelper::mergeAttributes( - $this->block->getAttributes(), - $attributes - )); - - // Tell the core parser we've consumed everything - return BlockContinue::at($cursor); - } - - // Okay, so there are no attributes on the next line - // If this next line is blank we know we can't target the next node, it must be a previous one - if ($cursor->isBlank()) { - $this->block->setTarget(Attributes::TARGET_PREVIOUS); - } - - return BlockContinue::none(); - } - - public function closeBlock(): void - { - // Attributes appearing at the very end of the document won't have any last lines to check - // so we can make that determination here - if (! $this->hasSubsequentLine) { - $this->block->setTarget(Attributes::TARGET_PREVIOUS); - } - - // We know this block must apply to the "previous" block, but that could be a sibling or parent, - // so we check the containing block to see which one it might be. - if ($this->block->getTarget() === Attributes::TARGET_PREVIOUS && $this->block->parent() === $this->container) { - $this->block->setTarget(Attributes::TARGET_PARENT); - } - } -} diff --git a/vendor/league/commonmark/src/Extension/Attributes/Parser/AttributesBlockStartParser.php b/vendor/league/commonmark/src/Extension/Attributes/Parser/AttributesBlockStartParser.php deleted file mode 100644 index 299ccd40..00000000 --- a/vendor/league/commonmark/src/Extension/Attributes/Parser/AttributesBlockStartParser.php +++ /dev/null @@ -1,40 +0,0 @@ - - * (c) 2015 Martin Hasoň - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Extension\Attributes\Parser; - -use League\CommonMark\Extension\Attributes\Util\AttributesHelper; -use League\CommonMark\Parser\Block\BlockStart; -use League\CommonMark\Parser\Block\BlockStartParserInterface; -use League\CommonMark\Parser\Cursor; -use League\CommonMark\Parser\MarkdownParserStateInterface; - -final class AttributesBlockStartParser implements BlockStartParserInterface -{ - public function tryStart(Cursor $cursor, MarkdownParserStateInterface $parserState): ?BlockStart - { - $originalPosition = $cursor->getPosition(); - $attributes = AttributesHelper::parseAttributes($cursor); - - if ($attributes === [] && $originalPosition === $cursor->getPosition()) { - return BlockStart::none(); - } - - if ($cursor->getNextNonSpaceCharacter() !== null) { - return BlockStart::none(); - } - - return BlockStart::of(new AttributesBlockContinueParser($attributes, $parserState->getActiveBlockParser()->getBlock()))->at($cursor); - } -} diff --git a/vendor/league/commonmark/src/Extension/Attributes/Parser/AttributesInlineParser.php b/vendor/league/commonmark/src/Extension/Attributes/Parser/AttributesInlineParser.php deleted file mode 100644 index 26af3ca5..00000000 --- a/vendor/league/commonmark/src/Extension/Attributes/Parser/AttributesInlineParser.php +++ /dev/null @@ -1,54 +0,0 @@ - - * (c) 2015 Martin Hasoň - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Extension\Attributes\Parser; - -use League\CommonMark\Extension\Attributes\Node\AttributesInline; -use League\CommonMark\Extension\Attributes\Util\AttributesHelper; -use League\CommonMark\Node\StringContainerInterface; -use League\CommonMark\Parser\Inline\InlineParserInterface; -use League\CommonMark\Parser\Inline\InlineParserMatch; -use League\CommonMark\Parser\InlineParserContext; - -final class AttributesInlineParser implements InlineParserInterface -{ - public function getMatchDefinition(): InlineParserMatch - { - return InlineParserMatch::string('{'); - } - - public function parse(InlineParserContext $inlineContext): bool - { - $cursor = $inlineContext->getCursor(); - $char = (string) $cursor->peek(-1); - - $attributes = AttributesHelper::parseAttributes($cursor); - if ($attributes === []) { - return false; - } - - if ($char === ' ' && ($prev = $inlineContext->getContainer()->lastChild()) instanceof StringContainerInterface) { - $prev->setLiteral(\rtrim($prev->getLiteral(), ' ')); - } - - if ($char === '') { - $cursor->advanceToNextNonSpaceOrNewline(); - } - - $node = new AttributesInline($attributes, $char === ' ' || $char === ''); - $inlineContext->getContainer()->appendChild($node); - - return true; - } -} diff --git a/vendor/league/commonmark/src/Extension/Attributes/Util/AttributesHelper.php b/vendor/league/commonmark/src/Extension/Attributes/Util/AttributesHelper.php deleted file mode 100644 index f2a140a8..00000000 --- a/vendor/league/commonmark/src/Extension/Attributes/Util/AttributesHelper.php +++ /dev/null @@ -1,136 +0,0 @@ - - * (c) 2015 Martin Hasoň - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Extension\Attributes\Util; - -use League\CommonMark\Node\Node; -use League\CommonMark\Parser\Cursor; -use League\CommonMark\Util\RegexHelper; - -/** - * @internal - */ -final class AttributesHelper -{ - private const SINGLE_ATTRIBUTE = '\s*([.#][_a-z0-9-]+|' . RegexHelper::PARTIAL_ATTRIBUTENAME . RegexHelper::PARTIAL_ATTRIBUTEVALUESPEC . ')\s*'; - private const ATTRIBUTE_LIST = '/^{:?(' . self::SINGLE_ATTRIBUTE . ')+}/i'; - - /** - * @return array - */ - public static function parseAttributes(Cursor $cursor): array - { - $state = $cursor->saveState(); - $cursor->advanceToNextNonSpaceOrNewline(); - - // Quick check to see if we might have attributes - if ($cursor->getCharacter() !== '{') { - $cursor->restoreState($state); - - return []; - } - - // Attempt to match the entire attribute list expression - // While this is less performant than checking for '{' now and '}' later, it simplifies - // matching individual attributes since they won't need to look ahead for the closing '}' - // while dealing with the fact that attributes can technically contain curly braces. - // So we'll just match the start and end braces up front. - $attributeExpression = $cursor->match(self::ATTRIBUTE_LIST); - if ($attributeExpression === null) { - $cursor->restoreState($state); - - return []; - } - - // Trim the leading '{' or '{:' and the trailing '}' - $attributeExpression = \ltrim(\substr($attributeExpression, 1, -1), ':'); - $attributeCursor = new Cursor($attributeExpression); - - /** @var array $attributes */ - $attributes = []; - while ($attribute = \trim((string) $attributeCursor->match('/^' . self::SINGLE_ATTRIBUTE . '/i'))) { - if ($attribute[0] === '#') { - $attributes['id'] = \substr($attribute, 1); - - continue; - } - - if ($attribute[0] === '.') { - $attributes['class'][] = \substr($attribute, 1); - - continue; - } - - [$name, $value] = \explode('=', $attribute, 2); - - $first = $value[0]; - $last = \substr($value, -1); - if (($first === '"' && $last === '"') || ($first === "'" && $last === "'") && \strlen($value) > 1) { - $value = \substr($value, 1, -1); - } - - if (\strtolower(\trim($name)) === 'class') { - foreach (\array_filter(\explode(' ', \trim($value))) as $class) { - $attributes['class'][] = $class; - } - } else { - $attributes[\trim($name)] = \trim($value); - } - } - - if (isset($attributes['class'])) { - $attributes['class'] = \implode(' ', (array) $attributes['class']); - } - - return $attributes; - } - - /** - * @param Node|array $attributes1 - * @param Node|array $attributes2 - * - * @return array - */ - public static function mergeAttributes($attributes1, $attributes2): array - { - $attributes = []; - foreach ([$attributes1, $attributes2] as $arg) { - if ($arg instanceof Node) { - $arg = $arg->data->get('attributes'); - } - - /** @var array $arg */ - $arg = (array) $arg; - if (isset($arg['class'])) { - if (\is_string($arg['class'])) { - $arg['class'] = \array_filter(\explode(' ', \trim($arg['class']))); - } - - foreach ($arg['class'] as $class) { - $attributes['class'][] = $class; - } - - unset($arg['class']); - } - - $attributes = \array_merge($attributes, $arg); - } - - if (isset($attributes['class'])) { - $attributes['class'] = \implode(' ', $attributes['class']); - } - - return $attributes; - } -} diff --git a/vendor/league/commonmark/src/Extension/Autolink/AutolinkExtension.php b/vendor/league/commonmark/src/Extension/Autolink/AutolinkExtension.php deleted file mode 100644 index 3516ebba..00000000 --- a/vendor/league/commonmark/src/Extension/Autolink/AutolinkExtension.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 League\CommonMark\Extension\Autolink; - -use League\CommonMark\Environment\EnvironmentBuilderInterface; -use League\CommonMark\Extension\ExtensionInterface; - -final class AutolinkExtension implements ExtensionInterface -{ - public function register(EnvironmentBuilderInterface $environment): void - { - $environment->addInlineParser(new EmailAutolinkParser()); - $environment->addInlineParser(new UrlAutolinkParser()); - } -} diff --git a/vendor/league/commonmark/src/Extension/Autolink/EmailAutolinkParser.php b/vendor/league/commonmark/src/Extension/Autolink/EmailAutolinkParser.php deleted file mode 100644 index 15a7d346..00000000 --- a/vendor/league/commonmark/src/Extension/Autolink/EmailAutolinkParser.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\Autolink; - -use League\CommonMark\Extension\CommonMark\Node\Inline\Link; -use League\CommonMark\Parser\Inline\InlineParserInterface; -use League\CommonMark\Parser\Inline\InlineParserMatch; -use League\CommonMark\Parser\InlineParserContext; - -final class EmailAutolinkParser implements InlineParserInterface -{ - private const REGEX = '[A-Za-z0-9.\-_+]+@[A-Za-z0-9\-_]+\.[A-Za-z0-9\-_.]+'; - - public function getMatchDefinition(): InlineParserMatch - { - return InlineParserMatch::regex(self::REGEX); - } - - public function parse(InlineParserContext $inlineContext): bool - { - $email = $inlineContext->getFullMatch(); - // The last character cannot be - or _ - if (\in_array(\substr($email, -1), ['-', '_'], true)) { - return false; - } - - // Does the URL end with punctuation that should be stripped? - if (\substr($email, -1) === '.') { - $email = \substr($email, 0, -1); - } - - $inlineContext->getCursor()->advanceBy(\strlen($email)); - $inlineContext->getContainer()->appendChild(new Link('mailto:' . $email, $email)); - - return true; - } -} diff --git a/vendor/league/commonmark/src/Extension/Autolink/UrlAutolinkParser.php b/vendor/league/commonmark/src/Extension/Autolink/UrlAutolinkParser.php deleted file mode 100644 index 7fad7f55..00000000 --- a/vendor/league/commonmark/src/Extension/Autolink/UrlAutolinkParser.php +++ /dev/null @@ -1,140 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\Autolink; - -use League\CommonMark\Extension\CommonMark\Node\Inline\Link; -use League\CommonMark\Parser\Inline\InlineParserInterface; -use League\CommonMark\Parser\Inline\InlineParserMatch; -use League\CommonMark\Parser\InlineParserContext; - -final class UrlAutolinkParser implements InlineParserInterface -{ - private const ALLOWED_AFTER = [null, ' ', "\t", "\n", "\x0b", "\x0c", "\x0d", '*', '_', '~', '(']; - - // RegEx adapted from https://github.com/symfony/symfony/blob/4.2/src/Symfony/Component/Validator/Constraints/UrlValidator.php - private const REGEX = '~ - ( - # Must start with a supported scheme + auth, or "www" - (?: - (?:%s):// # protocol - (?:([\.\pL\pN-]+:)?([\.\pL\pN-]+)@)? # basic auth - |www\.) - (?: - (?:[\pL\pN\pS\-\.])+(?:\.?(?:[\pL\pN]|xn\-\-[\pL\pN-]+)+\.?) # a domain name - | # or - \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} # an IP address - | # or - \[ - (?:(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){6})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:::(?:(?:(?:[0-9a-f]{1,4})):){5})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){4})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,1}(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){3})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,2}(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){2})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,3}(?:(?:[0-9a-f]{1,4})))?::(?:(?:[0-9a-f]{1,4})):)(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,4}(?:(?:[0-9a-f]{1,4})))?::)(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,5}(?:(?:[0-9a-f]{1,4})))?::)(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,6}(?:(?:[0-9a-f]{1,4})))?::)))) - \] # an IPv6 address - ) - (?::[0-9]+)? # a port (optional) - (?:/ (?:[\pL\pN\-._\~!$&\'()*+,;=:@]|%%[0-9A-Fa-f]{2})* )* # a path - (?:\? (?:[\pL\pN\-._\~!$&\'()*+,;=:@/?]|%%[0-9A-Fa-f]{2})* )? # a query (optional) - (?:\# (?:[\pL\pN\-._\~!$&\'()*+,;=:@/?]|%%[0-9A-Fa-f]{2})* )? # a fragment (optional) - )~ixu'; - - /** - * @var string[] - * - * @psalm-readonly - */ - private array $prefixes = ['www']; - - /** @psalm-readonly */ - private string $finalRegex; - - /** - * @param array $allowedProtocols - */ - public function __construct(array $allowedProtocols = ['http', 'https', 'ftp']) - { - $this->finalRegex = \sprintf(self::REGEX, \implode('|', $allowedProtocols)); - - foreach ($allowedProtocols as $protocol) { - $this->prefixes[] = $protocol . '://'; - } - } - - public function getMatchDefinition(): InlineParserMatch - { - return InlineParserMatch::oneOf(...$this->prefixes); - } - - public function parse(InlineParserContext $inlineContext): bool - { - $cursor = $inlineContext->getCursor(); - - // Autolinks can only come at the beginning of a line, after whitespace, or certain delimiting characters - $previousChar = $cursor->peek(-1); - if (! \in_array($previousChar, self::ALLOWED_AFTER, true)) { - return false; - } - - // Check if we have a valid URL - if (! \preg_match($this->finalRegex, $cursor->getRemainder(), $matches)) { - return false; - } - - $url = $matches[0]; - - // Does the URL end with punctuation that should be stripped? - if (\preg_match('/(.+?)([?!.,:*_~]+)$/', $url, $matches)) { - // Add the punctuation later - $url = $matches[1]; - } - - // Does the URL end with something that looks like an entity reference? - if (\preg_match('/(.+)(&[A-Za-z0-9]+;)$/', $url, $matches)) { - $url = $matches[1]; - } - - // Does the URL need unmatched parens chopped off? - if (\substr($url, -1) === ')' && ($diff = self::diffParens($url)) > 0) { - $url = \substr($url, 0, -$diff); - } - - $cursor->advanceBy(\mb_strlen($url, 'UTF-8')); - - // Auto-prefix 'http://' onto 'www' URLs - if (\substr($url, 0, 4) === 'www.') { - $inlineContext->getContainer()->appendChild(new Link('http://' . $url, $url)); - - return true; - } - - $inlineContext->getContainer()->appendChild(new Link($url, $url)); - - return true; - } - - /** - * @psalm-pure - */ - private static function diffParens(string $content): int - { - // Scan the entire autolink for the total number of parentheses. - // If there is a greater number of closing parentheses than opening ones, - // we don’t consider ANY of the last characters as part of the autolink, - // in order to facilitate including an autolink inside a parenthesis. - \preg_match_all('/[()]/', $content, $matches); - - $charCount = ['(' => 0, ')' => 0]; - foreach ($matches[0] as $char) { - $charCount[$char]++; - } - - return $charCount[')'] - $charCount['(']; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/CommonMarkCoreExtension.php b/vendor/league/commonmark/src/Extension/CommonMark/CommonMarkCoreExtension.php deleted file mode 100644 index 91f7a227..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/CommonMarkCoreExtension.php +++ /dev/null @@ -1,92 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark; - -use League\CommonMark\Environment\EnvironmentBuilderInterface; -use League\CommonMark\Extension\CommonMark\Delimiter\Processor\EmphasisDelimiterProcessor; -use League\CommonMark\Extension\ConfigurableExtensionInterface; -use League\CommonMark\Node as CoreNode; -use League\CommonMark\Parser as CoreParser; -use League\CommonMark\Renderer as CoreRenderer; -use League\Config\ConfigurationBuilderInterface; -use Nette\Schema\Expect; - -final class CommonMarkCoreExtension implements ConfigurableExtensionInterface -{ - public function configureSchema(ConfigurationBuilderInterface $builder): void - { - $builder->addSchema('commonmark', Expect::structure([ - 'use_asterisk' => Expect::bool(true), - 'use_underscore' => Expect::bool(true), - 'enable_strong' => Expect::bool(true), - 'enable_em' => Expect::bool(true), - 'unordered_list_markers' => Expect::listOf('string')->min(1)->default(['*', '+', '-'])->mergeDefaults(false), - ])); - } - - // phpcs:disable Generic.Functions.FunctionCallArgumentSpacing.TooMuchSpaceAfterComma,Squiz.WhiteSpace.SemicolonSpacing.Incorrect - public function register(EnvironmentBuilderInterface $environment): void - { - $environment - ->addBlockStartParser(new Parser\Block\BlockQuoteStartParser(), 70) - ->addBlockStartParser(new Parser\Block\HeadingStartParser(), 60) - ->addBlockStartParser(new Parser\Block\FencedCodeStartParser(), 50) - ->addBlockStartParser(new Parser\Block\HtmlBlockStartParser(), 40) - ->addBlockStartParser(new Parser\Block\ThematicBreakStartParser(), 20) - ->addBlockStartParser(new Parser\Block\ListBlockStartParser(), 10) - ->addBlockStartParser(new Parser\Block\IndentedCodeStartParser(), -100) - - ->addInlineParser(new CoreParser\Inline\NewlineParser(), 200) - ->addInlineParser(new Parser\Inline\BacktickParser(), 150) - ->addInlineParser(new Parser\Inline\EscapableParser(), 80) - ->addInlineParser(new Parser\Inline\EntityParser(), 70) - ->addInlineParser(new Parser\Inline\AutolinkParser(), 50) - ->addInlineParser(new Parser\Inline\HtmlInlineParser(), 40) - ->addInlineParser(new Parser\Inline\CloseBracketParser(), 30) - ->addInlineParser(new Parser\Inline\OpenBracketParser(), 20) - ->addInlineParser(new Parser\Inline\BangParser(), 10) - - ->addRenderer(Node\Block\BlockQuote::class, new Renderer\Block\BlockQuoteRenderer(), 0) - ->addRenderer(CoreNode\Block\Document::class, new CoreRenderer\Block\DocumentRenderer(), 0) - ->addRenderer(Node\Block\FencedCode::class, new Renderer\Block\FencedCodeRenderer(), 0) - ->addRenderer(Node\Block\Heading::class, new Renderer\Block\HeadingRenderer(), 0) - ->addRenderer(Node\Block\HtmlBlock::class, new Renderer\Block\HtmlBlockRenderer(), 0) - ->addRenderer(Node\Block\IndentedCode::class, new Renderer\Block\IndentedCodeRenderer(), 0) - ->addRenderer(Node\Block\ListBlock::class, new Renderer\Block\ListBlockRenderer(), 0) - ->addRenderer(Node\Block\ListItem::class, new Renderer\Block\ListItemRenderer(), 0) - ->addRenderer(CoreNode\Block\Paragraph::class, new CoreRenderer\Block\ParagraphRenderer(), 0) - ->addRenderer(Node\Block\ThematicBreak::class, new Renderer\Block\ThematicBreakRenderer(), 0) - - ->addRenderer(Node\Inline\Code::class, new Renderer\Inline\CodeRenderer(), 0) - ->addRenderer(Node\Inline\Emphasis::class, new Renderer\Inline\EmphasisRenderer(), 0) - ->addRenderer(Node\Inline\HtmlInline::class, new Renderer\Inline\HtmlInlineRenderer(), 0) - ->addRenderer(Node\Inline\Image::class, new Renderer\Inline\ImageRenderer(), 0) - ->addRenderer(Node\Inline\Link::class, new Renderer\Inline\LinkRenderer(), 0) - ->addRenderer(CoreNode\Inline\Newline::class, new CoreRenderer\Inline\NewlineRenderer(), 0) - ->addRenderer(Node\Inline\Strong::class, new Renderer\Inline\StrongRenderer(), 0) - ->addRenderer(CoreNode\Inline\Text::class, new CoreRenderer\Inline\TextRenderer(), 0) - ; - - if ($environment->getConfiguration()->get('commonmark/use_asterisk')) { - $environment->addDelimiterProcessor(new EmphasisDelimiterProcessor('*')); - } - - if ($environment->getConfiguration()->get('commonmark/use_underscore')) { - $environment->addDelimiterProcessor(new EmphasisDelimiterProcessor('_')); - } - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Delimiter/Processor/EmphasisDelimiterProcessor.php b/vendor/league/commonmark/src/Extension/CommonMark/Delimiter/Processor/EmphasisDelimiterProcessor.php deleted file mode 100644 index 84b46ee6..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Delimiter/Processor/EmphasisDelimiterProcessor.php +++ /dev/null @@ -1,108 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * Additional emphasis processing code based on commonmark-java (https://github.com/atlassian/commonmark-java) - * - (c) Atlassian Pty Ltd - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Delimiter\Processor; - -use League\CommonMark\Delimiter\DelimiterInterface; -use League\CommonMark\Delimiter\Processor\DelimiterProcessorInterface; -use League\CommonMark\Extension\CommonMark\Node\Inline\Emphasis; -use League\CommonMark\Extension\CommonMark\Node\Inline\Strong; -use League\CommonMark\Node\Inline\AbstractStringContainer; -use League\Config\ConfigurationAwareInterface; -use League\Config\ConfigurationInterface; - -final class EmphasisDelimiterProcessor implements DelimiterProcessorInterface, ConfigurationAwareInterface -{ - /** @psalm-readonly */ - private string $char; - - /** @psalm-readonly-allow-private-mutation */ - private ConfigurationInterface $config; - - /** - * @param string $char The emphasis character to use (typically '*' or '_') - */ - public function __construct(string $char) - { - $this->char = $char; - } - - public function getOpeningCharacter(): string - { - return $this->char; - } - - public function getClosingCharacter(): string - { - return $this->char; - } - - public function getMinLength(): int - { - return 1; - } - - public function getDelimiterUse(DelimiterInterface $opener, DelimiterInterface $closer): int - { - // "Multiple of 3" rule for internal delimiter runs - if (($opener->canClose() || $closer->canOpen()) && $closer->getOriginalLength() % 3 !== 0 && ($opener->getOriginalLength() + $closer->getOriginalLength()) % 3 === 0) { - return 0; - } - - // Calculate actual number of delimiters used from this closer - if ($opener->getLength() >= 2 && $closer->getLength() >= 2) { - if ($this->config->get('commonmark/enable_strong')) { - return 2; - } - - return 0; - } - - if ($this->config->get('commonmark/enable_em')) { - return 1; - } - - return 0; - } - - public function process(AbstractStringContainer $opener, AbstractStringContainer $closer, int $delimiterUse): void - { - if ($delimiterUse === 1) { - $emphasis = new Emphasis($this->char); - } elseif ($delimiterUse === 2) { - $emphasis = new Strong($this->char . $this->char); - } else { - return; - } - - $next = $opener->next(); - while ($next !== null && $next !== $closer) { - $tmp = $next->next(); - $emphasis->appendChild($next); - $next = $tmp; - } - - $opener->insertAfter($emphasis); - } - - public function setConfiguration(ConfigurationInterface $configuration): void - { - $this->config = $configuration; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Node/Block/BlockQuote.php b/vendor/league/commonmark/src/Extension/CommonMark/Node/Block/BlockQuote.php deleted file mode 100644 index 11094b9d..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Node/Block/BlockQuote.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. - */ - -namespace League\CommonMark\Extension\CommonMark\Node\Block; - -use League\CommonMark\Node\Block\AbstractBlock; - -class BlockQuote extends AbstractBlock -{ -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Node/Block/FencedCode.php b/vendor/league/commonmark/src/Extension/CommonMark/Node/Block/FencedCode.php deleted file mode 100644 index b50b4070..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Node/Block/FencedCode.php +++ /dev/null @@ -1,100 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Node\Block; - -use League\CommonMark\Node\Block\AbstractBlock; -use League\CommonMark\Node\StringContainerInterface; - -final class FencedCode extends AbstractBlock implements StringContainerInterface -{ - private ?string $info = null; - - private string $literal = ''; - - private int $length; - - private string $char; - - private int $offset; - - public function __construct(int $length, string $char, int $offset) - { - parent::__construct(); - - $this->length = $length; - $this->char = $char; - $this->offset = $offset; - } - - public function getInfo(): ?string - { - return $this->info; - } - - /** - * @return string[] - */ - public function getInfoWords(): array - { - return \preg_split('/\s+/', $this->info ?? '') ?: []; - } - - public function setInfo(string $info): void - { - $this->info = $info; - } - - public function getLiteral(): string - { - return $this->literal; - } - - public function setLiteral(string $literal): void - { - $this->literal = $literal; - } - - public function getChar(): string - { - return $this->char; - } - - public function setChar(string $char): void - { - $this->char = $char; - } - - public function getLength(): int - { - return $this->length; - } - - public function setLength(int $length): void - { - $this->length = $length; - } - - public function getOffset(): int - { - return $this->offset; - } - - public function setOffset(int $offset): void - { - $this->offset = $offset; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Node/Block/Heading.php b/vendor/league/commonmark/src/Extension/CommonMark/Node/Block/Heading.php deleted file mode 100644 index 1cf11845..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Node/Block/Heading.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Node\Block; - -use League\CommonMark\Node\Block\AbstractBlock; - -final class Heading extends AbstractBlock -{ - private int $level; - - public function __construct(int $level) - { - parent::__construct(); - - $this->level = $level; - } - - public function getLevel(): int - { - return $this->level; - } - - public function setLevel(int $level): void - { - $this->level = $level; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Node/Block/HtmlBlock.php b/vendor/league/commonmark/src/Extension/CommonMark/Node/Block/HtmlBlock.php deleted file mode 100644 index 9879a89d..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Node/Block/HtmlBlock.php +++ /dev/null @@ -1,79 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Node\Block; - -use League\CommonMark\Node\Block\AbstractBlock; -use League\CommonMark\Node\RawMarkupContainerInterface; - -final class HtmlBlock extends AbstractBlock implements RawMarkupContainerInterface -{ - // Any changes to these constants should be reflected in .phpstorm.meta.php - public const TYPE_1_CODE_CONTAINER = 1; - public const TYPE_2_COMMENT = 2; - public const TYPE_3 = 3; - public const TYPE_4 = 4; - public const TYPE_5_CDATA = 5; - public const TYPE_6_BLOCK_ELEMENT = 6; - public const TYPE_7_MISC_ELEMENT = 7; - - /** - * @psalm-var self::TYPE_* $type - * @phpstan-var self::TYPE_* $type - */ - private int $type; - - private string $literal = ''; - - /** - * @psalm-param self::TYPE_* $type - * - * @phpstan-param self::TYPE_* $type - */ - public function __construct(int $type) - { - parent::__construct(); - - $this->type = $type; - } - - /** - * @psalm-return self::TYPE_* - * - * @phpstan-return self::TYPE_* - */ - public function getType(): int - { - return $this->type; - } - - /** - * @psalm-param self::TYPE_* $type - * - * @phpstan-param self::TYPE_* $type - */ - public function setType(int $type): void - { - $this->type = $type; - } - - public function getLiteral(): string - { - return $this->literal; - } - - public function setLiteral(string $literal): void - { - $this->literal = $literal; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Node/Block/IndentedCode.php b/vendor/league/commonmark/src/Extension/CommonMark/Node/Block/IndentedCode.php deleted file mode 100644 index d18be159..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Node/Block/IndentedCode.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 League\CommonMark\Extension\CommonMark\Node\Block; - -use League\CommonMark\Node\Block\AbstractBlock; -use League\CommonMark\Node\StringContainerInterface; - -final class IndentedCode extends AbstractBlock implements StringContainerInterface -{ - private string $literal = ''; - - public function getLiteral(): string - { - return $this->literal; - } - - public function setLiteral(string $literal): void - { - $this->literal = $literal; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Node/Block/ListBlock.php b/vendor/league/commonmark/src/Extension/CommonMark/Node/Block/ListBlock.php deleted file mode 100644 index 74f9ca84..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Node/Block/ListBlock.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Node\Block; - -use League\CommonMark\Node\Block\AbstractBlock; -use League\CommonMark\Node\Block\TightBlockInterface; - -class ListBlock extends AbstractBlock implements TightBlockInterface -{ - public const TYPE_BULLET = 'bullet'; - public const TYPE_ORDERED = 'ordered'; - - public const DELIM_PERIOD = 'period'; - public const DELIM_PAREN = 'paren'; - - protected bool $tight = false; - - /** @psalm-readonly */ - protected ListData $listData; - - public function __construct(ListData $listData) - { - parent::__construct(); - - $this->listData = $listData; - } - - public function getListData(): ListData - { - return $this->listData; - } - - public function isTight(): bool - { - return $this->tight; - } - - public function setTight(bool $tight): void - { - $this->tight = $tight; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Node/Block/ListData.php b/vendor/league/commonmark/src/Extension/CommonMark/Node/Block/ListData.php deleted file mode 100644 index 7108a933..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Node/Block/ListData.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Node\Block; - -class ListData -{ - public ?int $start = null; - - public int $padding = 0; - - /** - * @psalm-var ListBlock::TYPE_* - * @phpstan-var ListBlock::TYPE_* - */ - public string $type; - - /** - * @psalm-var ListBlock::DELIM_*|null - * @phpstan-var ListBlock::DELIM_*|null - */ - public ?string $delimiter = null; - - public ?string $bulletChar = null; - - public int $markerOffset; - - public function equals(ListData $data): bool - { - return $this->type === $data->type && - $this->delimiter === $data->delimiter && - $this->bulletChar === $data->bulletChar; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Node/Block/ListItem.php b/vendor/league/commonmark/src/Extension/CommonMark/Node/Block/ListItem.php deleted file mode 100644 index f136b7e0..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Node/Block/ListItem.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Node\Block; - -use League\CommonMark\Node\Block\AbstractBlock; - -class ListItem extends AbstractBlock -{ - /** @psalm-readonly */ - protected ListData $listData; - - public function __construct(ListData $listData) - { - parent::__construct(); - - $this->listData = $listData; - } - - public function getListData(): ListData - { - return $this->listData; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Node/Block/ThematicBreak.php b/vendor/league/commonmark/src/Extension/CommonMark/Node/Block/ThematicBreak.php deleted file mode 100644 index bb6cea0b..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Node/Block/ThematicBreak.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. - */ - -namespace League\CommonMark\Extension\CommonMark\Node\Block; - -use League\CommonMark\Node\Block\AbstractBlock; - -class ThematicBreak extends AbstractBlock -{ -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Node/Inline/AbstractWebResource.php b/vendor/league/commonmark/src/Extension/CommonMark/Node/Inline/AbstractWebResource.php deleted file mode 100644 index dc0ed0a8..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Node/Inline/AbstractWebResource.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Node\Inline; - -use League\CommonMark\Node\Inline\AbstractInline; - -abstract class AbstractWebResource extends AbstractInline -{ - protected string $url; - - public function __construct(string $url) - { - parent::__construct(); - - $this->url = $url; - } - - public function getUrl(): string - { - return $this->url; - } - - public function setUrl(string $url): void - { - $this->url = $url; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Node/Inline/Code.php b/vendor/league/commonmark/src/Extension/CommonMark/Node/Inline/Code.php deleted file mode 100644 index 3a6aca24..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Node/Inline/Code.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Node\Inline; - -use League\CommonMark\Node\Inline\AbstractStringContainer; - -class Code extends AbstractStringContainer -{ -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Node/Inline/Emphasis.php b/vendor/league/commonmark/src/Extension/CommonMark/Node/Inline/Emphasis.php deleted file mode 100644 index fab6869c..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Node/Inline/Emphasis.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Node\Inline; - -use League\CommonMark\Node\Inline\AbstractInline; -use League\CommonMark\Node\Inline\DelimitedInterface; - -final class Emphasis extends AbstractInline implements DelimitedInterface -{ - private string $delimiter; - - public function __construct(string $delimiter = '_') - { - parent::__construct(); - - $this->delimiter = $delimiter; - } - - public function getOpeningDelimiter(): string - { - return $this->delimiter; - } - - public function getClosingDelimiter(): string - { - return $this->delimiter; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Node/Inline/HtmlInline.php b/vendor/league/commonmark/src/Extension/CommonMark/Node/Inline/HtmlInline.php deleted file mode 100644 index 8594a06e..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Node/Inline/HtmlInline.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Node\Inline; - -use League\CommonMark\Node\Inline\AbstractStringContainer; -use League\CommonMark\Node\RawMarkupContainerInterface; - -final class HtmlInline extends AbstractStringContainer implements RawMarkupContainerInterface -{ -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Node/Inline/Image.php b/vendor/league/commonmark/src/Extension/CommonMark/Node/Inline/Image.php deleted file mode 100644 index 20e3f87b..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Node/Inline/Image.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Node\Inline; - -use League\CommonMark\Node\Inline\Text; - -class Image extends AbstractWebResource -{ - protected ?string $title = null; - - public function __construct(string $url, ?string $label = null, ?string $title = null) - { - parent::__construct($url); - - if ($label !== null && $label !== '') { - $this->appendChild(new Text($label)); - } - - $this->title = $title; - } - - public function getTitle(): ?string - { - if ($this->title === '') { - return null; - } - - return $this->title; - } - - public function setTitle(?string $title): void - { - $this->title = $title; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Node/Inline/Link.php b/vendor/league/commonmark/src/Extension/CommonMark/Node/Inline/Link.php deleted file mode 100644 index 76d5609b..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Node/Inline/Link.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Node\Inline; - -use League\CommonMark\Node\Inline\Text; - -class Link extends AbstractWebResource -{ - protected ?string $title = null; - - public function __construct(string $url, ?string $label = null, ?string $title = null) - { - parent::__construct($url); - - if ($label !== null && $label !== '') { - $this->appendChild(new Text($label)); - } - - $this->title = $title; - } - - public function getTitle(): ?string - { - if ($this->title === '') { - return null; - } - - return $this->title; - } - - public function setTitle(?string $title): void - { - $this->title = $title; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Node/Inline/Strong.php b/vendor/league/commonmark/src/Extension/CommonMark/Node/Inline/Strong.php deleted file mode 100644 index 827960f3..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Node/Inline/Strong.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Node\Inline; - -use League\CommonMark\Node\Inline\AbstractInline; -use League\CommonMark\Node\Inline\DelimitedInterface; - -final class Strong extends AbstractInline implements DelimitedInterface -{ - private string $delimiter; - - public function __construct(string $delimiter = '**') - { - parent::__construct(); - - $this->delimiter = $delimiter; - } - - public function getOpeningDelimiter(): string - { - return $this->delimiter; - } - - public function getClosingDelimiter(): string - { - return $this->delimiter; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/BlockQuoteParser.php b/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/BlockQuoteParser.php deleted file mode 100644 index 78db6c5a..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/BlockQuoteParser.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Parser\Block; - -use League\CommonMark\Extension\CommonMark\Node\Block\BlockQuote; -use League\CommonMark\Node\Block\AbstractBlock; -use League\CommonMark\Parser\Block\AbstractBlockContinueParser; -use League\CommonMark\Parser\Block\BlockContinue; -use League\CommonMark\Parser\Block\BlockContinueParserInterface; -use League\CommonMark\Parser\Cursor; - -final class BlockQuoteParser extends AbstractBlockContinueParser -{ - /** @psalm-readonly */ - private BlockQuote $block; - - public function __construct() - { - $this->block = new BlockQuote(); - } - - public function getBlock(): BlockQuote - { - return $this->block; - } - - public function isContainer(): bool - { - return true; - } - - public function canContain(AbstractBlock $childBlock): bool - { - return true; - } - - public function tryContinue(Cursor $cursor, BlockContinueParserInterface $activeBlockParser): ?BlockContinue - { - if (! $cursor->isIndented() && $cursor->getNextNonSpaceCharacter() === '>') { - $cursor->advanceToNextNonSpaceOrTab(); - $cursor->advanceBy(1); - $cursor->advanceBySpaceOrTab(); - - return BlockContinue::at($cursor); - } - - return BlockContinue::none(); - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/BlockQuoteStartParser.php b/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/BlockQuoteStartParser.php deleted file mode 100644 index de9a6bc9..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/BlockQuoteStartParser.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Parser\Block; - -use League\CommonMark\Parser\Block\BlockStart; -use League\CommonMark\Parser\Block\BlockStartParserInterface; -use League\CommonMark\Parser\Cursor; -use League\CommonMark\Parser\MarkdownParserStateInterface; - -final class BlockQuoteStartParser implements BlockStartParserInterface -{ - public function tryStart(Cursor $cursor, MarkdownParserStateInterface $parserState): ?BlockStart - { - if ($cursor->isIndented()) { - return BlockStart::none(); - } - - if ($cursor->getNextNonSpaceCharacter() !== '>') { - return BlockStart::none(); - } - - $cursor->advanceToNextNonSpaceOrTab(); - $cursor->advanceBy(1); - $cursor->advanceBySpaceOrTab(); - - return BlockStart::of(new BlockQuoteParser())->at($cursor); - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/FencedCodeParser.php b/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/FencedCodeParser.php deleted file mode 100644 index 88572c7f..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/FencedCodeParser.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 League\CommonMark\Extension\CommonMark\Parser\Block; - -use League\CommonMark\Extension\CommonMark\Node\Block\FencedCode; -use League\CommonMark\Parser\Block\AbstractBlockContinueParser; -use League\CommonMark\Parser\Block\BlockContinue; -use League\CommonMark\Parser\Block\BlockContinueParserInterface; -use League\CommonMark\Parser\Cursor; -use League\CommonMark\Util\ArrayCollection; -use League\CommonMark\Util\RegexHelper; - -final class FencedCodeParser extends AbstractBlockContinueParser -{ - /** @psalm-readonly */ - private FencedCode $block; - - /** @var ArrayCollection */ - private ArrayCollection $strings; - - public function __construct(int $fenceLength, string $fenceChar, int $fenceOffset) - { - $this->block = new FencedCode($fenceLength, $fenceChar, $fenceOffset); - $this->strings = new ArrayCollection(); - } - - public function getBlock(): FencedCode - { - return $this->block; - } - - public function tryContinue(Cursor $cursor, BlockContinueParserInterface $activeBlockParser): ?BlockContinue - { - // Check for closing code fence - if (! $cursor->isIndented() && $cursor->getNextNonSpaceCharacter() === $this->block->getChar()) { - $match = RegexHelper::matchFirst('/^(?:`{3,}|~{3,})(?= *$)/', $cursor->getLine(), $cursor->getNextNonSpacePosition()); - if ($match !== null && \strlen($match[0]) >= $this->block->getLength()) { - // closing fence - we're at end of line, so we can finalize now - return BlockContinue::finished(); - } - } - - // Skip optional spaces of fence offset - // Optimization: don't attempt to match if we're at a non-space position - if ($cursor->getNextNonSpacePosition() > $cursor->getPosition()) { - $cursor->match('/^ {0,' . $this->block->getOffset() . '}/'); - } - - return BlockContinue::at($cursor); - } - - public function addLine(string $line): void - { - $this->strings[] = $line; - } - - public function closeBlock(): void - { - // first line becomes info string - $firstLine = $this->strings->first(); - if ($firstLine === false) { - $firstLine = ''; - } - - $this->block->setInfo(RegexHelper::unescape(\trim($firstLine))); - - if ($this->strings->count() === 1) { - $this->block->setLiteral(''); - } else { - $this->block->setLiteral(\implode("\n", $this->strings->slice(1)) . "\n"); - } - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/FencedCodeStartParser.php b/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/FencedCodeStartParser.php deleted file mode 100644 index be1b1dca..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/FencedCodeStartParser.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Parser\Block; - -use League\CommonMark\Parser\Block\BlockStart; -use League\CommonMark\Parser\Block\BlockStartParserInterface; -use League\CommonMark\Parser\Cursor; -use League\CommonMark\Parser\MarkdownParserStateInterface; - -final class FencedCodeStartParser implements BlockStartParserInterface -{ - public function tryStart(Cursor $cursor, MarkdownParserStateInterface $parserState): ?BlockStart - { - if ($cursor->isIndented() || ! \in_array($cursor->getNextNonSpaceCharacter(), ['`', '~'], true)) { - return BlockStart::none(); - } - - $indent = $cursor->getIndent(); - $fence = $cursor->match('/^[ \t]*(?:`{3,}(?!.*`)|~{3,})/'); - if ($fence === null) { - return BlockStart::none(); - } - - // fenced code block - $fence = \ltrim($fence, " \t"); - - return BlockStart::of(new FencedCodeParser(\strlen($fence), $fence[0], $indent))->at($cursor); - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/HeadingParser.php b/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/HeadingParser.php deleted file mode 100644 index c3e31086..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/HeadingParser.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 League\CommonMark\Extension\CommonMark\Parser\Block; - -use League\CommonMark\Extension\CommonMark\Node\Block\Heading; -use League\CommonMark\Parser\Block\AbstractBlockContinueParser; -use League\CommonMark\Parser\Block\BlockContinue; -use League\CommonMark\Parser\Block\BlockContinueParserInterface; -use League\CommonMark\Parser\Block\BlockContinueParserWithInlinesInterface; -use League\CommonMark\Parser\Cursor; -use League\CommonMark\Parser\InlineParserEngineInterface; - -final class HeadingParser extends AbstractBlockContinueParser implements BlockContinueParserWithInlinesInterface -{ - /** @psalm-readonly */ - private Heading $block; - - private string $content; - - public function __construct(int $level, string $content) - { - $this->block = new Heading($level); - $this->content = $content; - } - - public function getBlock(): Heading - { - return $this->block; - } - - public function tryContinue(Cursor $cursor, BlockContinueParserInterface $activeBlockParser): ?BlockContinue - { - return BlockContinue::none(); - } - - public function parseInlines(InlineParserEngineInterface $inlineParser): void - { - $inlineParser->parse($this->content, $this->block); - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/HeadingStartParser.php b/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/HeadingStartParser.php deleted file mode 100644 index 404f4038..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/HeadingStartParser.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 League\CommonMark\Extension\CommonMark\Parser\Block; - -use League\CommonMark\Parser\Block\BlockStart; -use League\CommonMark\Parser\Block\BlockStartParserInterface; -use League\CommonMark\Parser\Cursor; -use League\CommonMark\Parser\MarkdownParserStateInterface; -use League\CommonMark\Util\RegexHelper; - -class HeadingStartParser implements BlockStartParserInterface -{ - public function tryStart(Cursor $cursor, MarkdownParserStateInterface $parserState): ?BlockStart - { - if ($cursor->isIndented() || ! \in_array($cursor->getNextNonSpaceCharacter(), ['#', '-', '='], true)) { - return BlockStart::none(); - } - - $cursor->advanceToNextNonSpaceOrTab(); - - if ($atxHeading = self::getAtxHeader($cursor)) { - return BlockStart::of($atxHeading)->at($cursor); - } - - $setextHeadingLevel = self::getSetextHeadingLevel($cursor); - if ($setextHeadingLevel > 0) { - $content = $parserState->getParagraphContent(); - if ($content !== null) { - $cursor->advanceToEnd(); - - return BlockStart::of(new HeadingParser($setextHeadingLevel, $content)) - ->at($cursor) - ->replaceActiveBlockParser(); - } - } - - return BlockStart::none(); - } - - private static function getAtxHeader(Cursor $cursor): ?HeadingParser - { - $match = RegexHelper::matchFirst('/^#{1,6}(?:[ \t]+|$)/', $cursor->getRemainder()); - if (! $match) { - return null; - } - - $cursor->advanceToNextNonSpaceOrTab(); - $cursor->advanceBy(\strlen($match[0])); - - $level = \strlen(\trim($match[0])); - $str = $cursor->getRemainder(); - $str = \preg_replace('/^[ \t]*#+[ \t]*$/', '', $str); - \assert(\is_string($str)); - $str = \preg_replace('/[ \t]+#+[ \t]*$/', '', $str); - \assert(\is_string($str)); - - return new HeadingParser($level, $str); - } - - private static function getSetextHeadingLevel(Cursor $cursor): int - { - $match = RegexHelper::matchFirst('/^(?:=+|-+)[ \t]*$/', $cursor->getRemainder()); - if ($match === null) { - return 0; - } - - return $match[0][0] === '=' ? 1 : 2; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/HtmlBlockParser.php b/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/HtmlBlockParser.php deleted file mode 100644 index 67786762..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/HtmlBlockParser.php +++ /dev/null @@ -1,82 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Parser\Block; - -use League\CommonMark\Extension\CommonMark\Node\Block\HtmlBlock; -use League\CommonMark\Parser\Block\AbstractBlockContinueParser; -use League\CommonMark\Parser\Block\BlockContinue; -use League\CommonMark\Parser\Block\BlockContinueParserInterface; -use League\CommonMark\Parser\Cursor; -use League\CommonMark\Util\RegexHelper; - -final class HtmlBlockParser extends AbstractBlockContinueParser -{ - /** @psalm-readonly */ - private HtmlBlock $block; - - private string $content = ''; - - private bool $finished = false; - - /** - * @psalm-param HtmlBlock::TYPE_* $blockType - * - * @phpstan-param HtmlBlock::TYPE_* $blockType - */ - public function __construct(int $blockType) - { - $this->block = new HtmlBlock($blockType); - } - - public function getBlock(): HtmlBlock - { - return $this->block; - } - - public function tryContinue(Cursor $cursor, BlockContinueParserInterface $activeBlockParser): ?BlockContinue - { - if ($this->finished) { - return BlockContinue::none(); - } - - if ($cursor->isBlank() && \in_array($this->block->getType(), [HtmlBlock::TYPE_6_BLOCK_ELEMENT, HtmlBlock::TYPE_7_MISC_ELEMENT], true)) { - return BlockContinue::none(); - } - - return BlockContinue::at($cursor); - } - - public function addLine(string $line): void - { - if ($this->content !== '') { - $this->content .= "\n"; - } - - $this->content .= $line; - - // Check for end condition - // phpcs:disable SlevomatCodingStandard.ControlStructures.EarlyExit.EarlyExitNotUsed - if ($this->block->getType() <= HtmlBlock::TYPE_5_CDATA) { - if (\preg_match(RegexHelper::getHtmlBlockCloseRegex($this->block->getType()), $line) === 1) { - $this->finished = true; - } - } - } - - public function closeBlock(): void - { - $this->block->setLiteral($this->content); - $this->content = ''; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/HtmlBlockStartParser.php b/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/HtmlBlockStartParser.php deleted file mode 100644 index bcef0af2..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/HtmlBlockStartParser.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 League\CommonMark\Extension\CommonMark\Parser\Block; - -use League\CommonMark\Extension\CommonMark\Node\Block\HtmlBlock; -use League\CommonMark\Node\Block\Paragraph; -use League\CommonMark\Parser\Block\BlockStart; -use League\CommonMark\Parser\Block\BlockStartParserInterface; -use League\CommonMark\Parser\Cursor; -use League\CommonMark\Parser\MarkdownParserStateInterface; -use League\CommonMark\Util\RegexHelper; - -final class HtmlBlockStartParser implements BlockStartParserInterface -{ - public function tryStart(Cursor $cursor, MarkdownParserStateInterface $parserState): ?BlockStart - { - if ($cursor->isIndented() || $cursor->getNextNonSpaceCharacter() !== '<') { - return BlockStart::none(); - } - - $tmpCursor = clone $cursor; - $tmpCursor->advanceToNextNonSpaceOrTab(); - $line = $tmpCursor->getRemainder(); - - for ($blockType = 1; $blockType <= 7; $blockType++) { - /** @psalm-var HtmlBlock::TYPE_* $blockType */ - /** @phpstan-var HtmlBlock::TYPE_* $blockType */ - $match = RegexHelper::matchAt( - RegexHelper::getHtmlBlockOpenRegex($blockType), - $line - ); - - if ($match !== null && ($blockType < 7 || $this->isType7BlockAllowed($cursor, $parserState))) { - return BlockStart::of(new HtmlBlockParser($blockType))->at($cursor); - } - } - - return BlockStart::none(); - } - - private function isType7BlockAllowed(Cursor $cursor, MarkdownParserStateInterface $parserState): bool - { - // Type 7 blocks can't interrupt paragraphs - if ($parserState->getLastMatchedBlockParser()->getBlock() instanceof Paragraph) { - return false; - } - - // Even lazy ones - return ! $parserState->getActiveBlockParser()->canHaveLazyContinuationLines(); - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/IndentedCodeParser.php b/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/IndentedCodeParser.php deleted file mode 100644 index b7c425aa..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/IndentedCodeParser.php +++ /dev/null @@ -1,83 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Parser\Block; - -use League\CommonMark\Extension\CommonMark\Node\Block\IndentedCode; -use League\CommonMark\Parser\Block\AbstractBlockContinueParser; -use League\CommonMark\Parser\Block\BlockContinue; -use League\CommonMark\Parser\Block\BlockContinueParserInterface; -use League\CommonMark\Parser\Cursor; -use League\CommonMark\Util\ArrayCollection; - -final class IndentedCodeParser extends AbstractBlockContinueParser -{ - /** @psalm-readonly */ - private IndentedCode $block; - - /** @var ArrayCollection */ - private ArrayCollection $strings; - - public function __construct() - { - $this->block = new IndentedCode(); - $this->strings = new ArrayCollection(); - } - - public function getBlock(): IndentedCode - { - return $this->block; - } - - public function tryContinue(Cursor $cursor, BlockContinueParserInterface $activeBlockParser): ?BlockContinue - { - if ($cursor->isIndented()) { - $cursor->advanceBy(Cursor::INDENT_LEVEL, true); - - return BlockContinue::at($cursor); - } - - if ($cursor->isBlank()) { - $cursor->advanceToNextNonSpaceOrTab(); - - return BlockContinue::at($cursor); - } - - return BlockContinue::none(); - } - - public function addLine(string $line): void - { - $this->strings[] = $line; - } - - public function closeBlock(): void - { - $reversed = \array_reverse($this->strings->toArray(), true); - foreach ($reversed as $index => $line) { - if ($line !== '' && $line !== "\n" && ! \preg_match('/^(\n *)$/', $line)) { - break; - } - - unset($reversed[$index]); - } - - $fixed = \array_reverse($reversed); - $tmp = \implode("\n", $fixed); - if (\substr($tmp, -1) !== "\n") { - $tmp .= "\n"; - } - - $this->block->setLiteral($tmp); - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/IndentedCodeStartParser.php b/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/IndentedCodeStartParser.php deleted file mode 100644 index bea4bdeb..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/IndentedCodeStartParser.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. - */ - -namespace League\CommonMark\Extension\CommonMark\Parser\Block; - -use League\CommonMark\Node\Block\Paragraph; -use League\CommonMark\Parser\Block\BlockStart; -use League\CommonMark\Parser\Block\BlockStartParserInterface; -use League\CommonMark\Parser\Cursor; -use League\CommonMark\Parser\MarkdownParserStateInterface; - -final class IndentedCodeStartParser implements BlockStartParserInterface -{ - public function tryStart(Cursor $cursor, MarkdownParserStateInterface $parserState): ?BlockStart - { - if (! $cursor->isIndented()) { - return BlockStart::none(); - } - - if ($parserState->getActiveBlockParser()->getBlock() instanceof Paragraph) { - return BlockStart::none(); - } - - if ($cursor->isBlank()) { - return BlockStart::none(); - } - - $cursor->advanceBy(Cursor::INDENT_LEVEL, true); - - return BlockStart::of(new IndentedCodeParser())->at($cursor); - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/ListBlockParser.php b/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/ListBlockParser.php deleted file mode 100644 index 4dffb7ac..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/ListBlockParser.php +++ /dev/null @@ -1,79 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Parser\Block; - -use League\CommonMark\Extension\CommonMark\Node\Block\ListBlock; -use League\CommonMark\Extension\CommonMark\Node\Block\ListData; -use League\CommonMark\Extension\CommonMark\Node\Block\ListItem; -use League\CommonMark\Node\Block\AbstractBlock; -use League\CommonMark\Parser\Block\AbstractBlockContinueParser; -use League\CommonMark\Parser\Block\BlockContinue; -use League\CommonMark\Parser\Block\BlockContinueParserInterface; -use League\CommonMark\Parser\Cursor; - -final class ListBlockParser extends AbstractBlockContinueParser -{ - /** @psalm-readonly */ - private ListBlock $block; - - private bool $hadBlankLine = false; - - private int $linesAfterBlank = 0; - - public function __construct(ListData $listData) - { - $this->block = new ListBlock($listData); - } - - public function getBlock(): ListBlock - { - return $this->block; - } - - public function isContainer(): bool - { - return true; - } - - public function canContain(AbstractBlock $childBlock): bool - { - if (! $childBlock instanceof ListItem) { - return false; - } - - // Another list item is being added to this list block. - // If the previous line was blank, that means this list - // block is "loose" (not tight). - if ($this->hadBlankLine && $this->linesAfterBlank === 1) { - $this->block->setTight(false); - $this->hadBlankLine = false; - } - - return true; - } - - public function tryContinue(Cursor $cursor, BlockContinueParserInterface $activeBlockParser): ?BlockContinue - { - if ($cursor->isBlank()) { - $this->hadBlankLine = true; - $this->linesAfterBlank = 0; - } elseif ($this->hadBlankLine) { - $this->linesAfterBlank++; - } - - // List blocks themselves don't have any markers, only list items. So try to stay in the list. - // If there is a block start other than list item, canContain makes sure that this list is closed. - return BlockContinue::at($cursor); - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/ListBlockStartParser.php b/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/ListBlockStartParser.php deleted file mode 100644 index 74b0c2bb..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/ListBlockStartParser.php +++ /dev/null @@ -1,146 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Parser\Block; - -use League\CommonMark\Extension\CommonMark\Node\Block\ListBlock; -use League\CommonMark\Extension\CommonMark\Node\Block\ListData; -use League\CommonMark\Parser\Block\BlockStart; -use League\CommonMark\Parser\Block\BlockStartParserInterface; -use League\CommonMark\Parser\Cursor; -use League\CommonMark\Parser\MarkdownParserStateInterface; -use League\CommonMark\Util\RegexHelper; -use League\Config\ConfigurationAwareInterface; -use League\Config\ConfigurationInterface; - -final class ListBlockStartParser implements BlockStartParserInterface, ConfigurationAwareInterface -{ - /** @psalm-readonly-allow-private-mutation */ - private ?ConfigurationInterface $config = null; - - /** @psalm-readonly-allow-private-mutation */ - private ?string $listMarkerRegex = null; - - public function setConfiguration(ConfigurationInterface $configuration): void - { - $this->config = $configuration; - } - - public function tryStart(Cursor $cursor, MarkdownParserStateInterface $parserState): ?BlockStart - { - if ($cursor->isIndented()) { - return BlockStart::none(); - } - - $listData = $this->parseList($cursor, $parserState->getParagraphContent() !== null); - if ($listData === null) { - return BlockStart::none(); - } - - $listItemParser = new ListItemParser($listData); - - // prepend the list block if needed - $matched = $parserState->getLastMatchedBlockParser(); - if (! ($matched instanceof ListBlockParser) || ! $listData->equals($matched->getBlock()->getListData())) { - $listBlockParser = new ListBlockParser($listData); - // We start out with assuming a list is tight. If we find a blank line, we set it to loose later. - $listBlockParser->getBlock()->setTight(true); - - return BlockStart::of($listBlockParser, $listItemParser)->at($cursor); - } - - return BlockStart::of($listItemParser)->at($cursor); - } - - private function parseList(Cursor $cursor, bool $inParagraph): ?ListData - { - $indent = $cursor->getIndent(); - - $tmpCursor = clone $cursor; - $tmpCursor->advanceToNextNonSpaceOrTab(); - $rest = $tmpCursor->getRemainder(); - - if (\preg_match($this->listMarkerRegex ?? $this->generateListMarkerRegex(), $rest) === 1) { - $data = new ListData(); - $data->markerOffset = $indent; - $data->type = ListBlock::TYPE_BULLET; - $data->delimiter = null; - $data->bulletChar = $rest[0]; - $markerLength = 1; - } elseif (($matches = RegexHelper::matchFirst('/^(\d{1,9})([.)])/', $rest)) && (! $inParagraph || $matches[1] === '1')) { - $data = new ListData(); - $data->markerOffset = $indent; - $data->type = ListBlock::TYPE_ORDERED; - $data->start = (int) $matches[1]; - $data->delimiter = $matches[2] === '.' ? ListBlock::DELIM_PERIOD : ListBlock::DELIM_PAREN; - $data->bulletChar = null; - $markerLength = \strlen($matches[0]); - } else { - return null; - } - - // Make sure we have spaces after - $nextChar = $tmpCursor->peek($markerLength); - if (! ($nextChar === null || $nextChar === "\t" || $nextChar === ' ')) { - return null; - } - - // If it interrupts paragraph, make sure first line isn't blank - if ($inParagraph && ! RegexHelper::matchAt(RegexHelper::REGEX_NON_SPACE, $rest, $markerLength)) { - return null; - } - - $cursor->advanceToNextNonSpaceOrTab(); // to start of marker - $cursor->advanceBy($markerLength, true); // to end of marker - $data->padding = self::calculateListMarkerPadding($cursor, $markerLength); - - return $data; - } - - private static function calculateListMarkerPadding(Cursor $cursor, int $markerLength): int - { - $start = $cursor->saveState(); - $spacesStartCol = $cursor->getColumn(); - - while ($cursor->getColumn() - $spacesStartCol < 5) { - if (! $cursor->advanceBySpaceOrTab()) { - break; - } - } - - $blankItem = $cursor->peek() === null; - $spacesAfterMarker = $cursor->getColumn() - $spacesStartCol; - - if ($spacesAfterMarker >= 5 || $spacesAfterMarker < 1 || $blankItem) { - $cursor->restoreState($start); - $cursor->advanceBySpaceOrTab(); - - return $markerLength + 1; - } - - return $markerLength + $spacesAfterMarker; - } - - private function generateListMarkerRegex(): string - { - // No configuration given - use the defaults - if ($this->config === null) { - return $this->listMarkerRegex = '/^[*+-]/'; - } - - $markers = $this->config->get('commonmark/unordered_list_markers'); - \assert(\is_array($markers)); - - return $this->listMarkerRegex = '/^[' . \preg_quote(\implode('', $markers), '/') . ']/'; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/ListItemParser.php b/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/ListItemParser.php deleted file mode 100644 index 73b98be7..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/ListItemParser.php +++ /dev/null @@ -1,90 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Parser\Block; - -use League\CommonMark\Extension\CommonMark\Node\Block\ListBlock; -use League\CommonMark\Extension\CommonMark\Node\Block\ListData; -use League\CommonMark\Extension\CommonMark\Node\Block\ListItem; -use League\CommonMark\Node\Block\AbstractBlock; -use League\CommonMark\Node\Block\Paragraph; -use League\CommonMark\Parser\Block\AbstractBlockContinueParser; -use League\CommonMark\Parser\Block\BlockContinue; -use League\CommonMark\Parser\Block\BlockContinueParserInterface; -use League\CommonMark\Parser\Cursor; - -final class ListItemParser extends AbstractBlockContinueParser -{ - /** @psalm-readonly */ - private ListItem $block; - - private bool $hadBlankLine = false; - - public function __construct(ListData $listData) - { - $this->block = new ListItem($listData); - } - - public function getBlock(): ListItem - { - return $this->block; - } - - public function isContainer(): bool - { - return true; - } - - public function canContain(AbstractBlock $childBlock): bool - { - if ($this->hadBlankLine) { - // We saw a blank line in this list item, that means the list block is loose. - // - // spec: if any of its constituent list items directly contain two block-level elements with a blank line - // between them - $parent = $this->block->parent(); - if ($parent instanceof ListBlock) { - $parent->setTight(false); - } - } - - return true; - } - - public function tryContinue(Cursor $cursor, BlockContinueParserInterface $activeBlockParser): ?BlockContinue - { - if ($cursor->isBlank()) { - if ($this->block->firstChild() === null) { - // Blank line after empty list item - return BlockContinue::none(); - } - - $activeBlock = $activeBlockParser->getBlock(); - // If the active block is a code block, blank lines in it should not affect if the list is tight. - $this->hadBlankLine = $activeBlock instanceof Paragraph || $activeBlock instanceof ListItem; - $cursor->advanceToNextNonSpaceOrTab(); - - return BlockContinue::at($cursor); - } - - $contentIndent = $this->block->getListData()->markerOffset + $this->getBlock()->getListData()->padding; - if ($cursor->getIndent() >= $contentIndent) { - $cursor->advanceBy($contentIndent, true); - - return BlockContinue::at($cursor); - } - - // Note: We'll hit this case for lazy continuation lines, they will get added later. - return BlockContinue::none(); - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/ThematicBreakParser.php b/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/ThematicBreakParser.php deleted file mode 100644 index fb46637b..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/ThematicBreakParser.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. - */ - -namespace League\CommonMark\Extension\CommonMark\Parser\Block; - -use League\CommonMark\Extension\CommonMark\Node\Block\ThematicBreak; -use League\CommonMark\Parser\Block\AbstractBlockContinueParser; -use League\CommonMark\Parser\Block\BlockContinue; -use League\CommonMark\Parser\Block\BlockContinueParserInterface; -use League\CommonMark\Parser\Cursor; - -final class ThematicBreakParser extends AbstractBlockContinueParser -{ - /** @psalm-readonly */ - private ThematicBreak $block; - - public function __construct() - { - $this->block = new ThematicBreak(); - } - - public function getBlock(): ThematicBreak - { - return $this->block; - } - - public function tryContinue(Cursor $cursor, BlockContinueParserInterface $activeBlockParser): ?BlockContinue - { - // a horizontal rule can never container > 1 line, so fail to match - return BlockContinue::none(); - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/ThematicBreakStartParser.php b/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/ThematicBreakStartParser.php deleted file mode 100644 index ba7ddf37..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Block/ThematicBreakStartParser.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Parser\Block; - -use League\CommonMark\Parser\Block\BlockStart; -use League\CommonMark\Parser\Block\BlockStartParserInterface; -use League\CommonMark\Parser\Cursor; -use League\CommonMark\Parser\MarkdownParserStateInterface; -use League\CommonMark\Util\RegexHelper; - -final class ThematicBreakStartParser implements BlockStartParserInterface -{ - public function tryStart(Cursor $cursor, MarkdownParserStateInterface $parserState): ?BlockStart - { - if ($cursor->isIndented()) { - return BlockStart::none(); - } - - $match = RegexHelper::matchAt(RegexHelper::REGEX_THEMATIC_BREAK, $cursor->getLine(), $cursor->getNextNonSpacePosition()); - if ($match === null) { - return BlockStart::none(); - } - - // Advance to the end of the string, consuming the entire line (of the thematic break) - $cursor->advanceToEnd(); - - return BlockStart::of(new ThematicBreakParser())->at($cursor); - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Inline/AutolinkParser.php b/vendor/league/commonmark/src/Extension/CommonMark/Parser/Inline/AutolinkParser.php deleted file mode 100644 index 810769d7..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Inline/AutolinkParser.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Parser\Inline; - -use League\CommonMark\Extension\CommonMark\Node\Inline\Link; -use League\CommonMark\Parser\Inline\InlineParserInterface; -use League\CommonMark\Parser\Inline\InlineParserMatch; -use League\CommonMark\Parser\InlineParserContext; -use League\CommonMark\Util\UrlEncoder; - -final class AutolinkParser implements InlineParserInterface -{ - private const EMAIL_REGEX = '<([a-zA-Z0-9.!#$%&\'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>'; - private const OTHER_LINK_REGEX = '<([A-Za-z][A-Za-z0-9.+-]{1,31}:[^<>\x00-\x20]*)>'; - - public function getMatchDefinition(): InlineParserMatch - { - return InlineParserMatch::regex(self::EMAIL_REGEX . '|' . self::OTHER_LINK_REGEX); - } - - public function parse(InlineParserContext $inlineContext): bool - { - $inlineContext->getCursor()->advanceBy($inlineContext->getFullMatchLength()); - $matches = $inlineContext->getMatches(); - - if ($matches[1] !== '') { - $inlineContext->getContainer()->appendChild(new Link('mailto:' . UrlEncoder::unescapeAndEncode($matches[1]), $matches[1])); - - return true; - } - - if ($matches[2] !== '') { - $inlineContext->getContainer()->appendChild(new Link(UrlEncoder::unescapeAndEncode($matches[2]), $matches[2])); - - return true; - } - - return false; // This should never happen - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Inline/BacktickParser.php b/vendor/league/commonmark/src/Extension/CommonMark/Parser/Inline/BacktickParser.php deleted file mode 100644 index 9618f2e6..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Inline/BacktickParser.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Parser\Inline; - -use League\CommonMark\Extension\CommonMark\Node\Inline\Code; -use League\CommonMark\Node\Inline\Text; -use League\CommonMark\Parser\Inline\InlineParserInterface; -use League\CommonMark\Parser\Inline\InlineParserMatch; -use League\CommonMark\Parser\InlineParserContext; - -final class BacktickParser implements InlineParserInterface -{ - public function getMatchDefinition(): InlineParserMatch - { - return InlineParserMatch::regex('`+'); - } - - public function parse(InlineParserContext $inlineContext): bool - { - $ticks = $inlineContext->getFullMatch(); - $cursor = $inlineContext->getCursor(); - $cursor->advanceBy($inlineContext->getFullMatchLength()); - - $currentPosition = $cursor->getPosition(); - $previousState = $cursor->saveState(); - - while ($matchingTicks = $cursor->match('/`+/m')) { - if ($matchingTicks !== $ticks) { - continue; - } - - $code = $cursor->getSubstring($currentPosition, $cursor->getPosition() - $currentPosition - \strlen($ticks)); - - $c = \preg_replace('/\n/m', ' ', $code) ?? ''; - - if ( - $c !== '' && - $c[0] === ' ' && - \substr($c, -1, 1) === ' ' && - \preg_match('/[^ ]/', $c) - ) { - $c = \substr($c, 1, -1); - } - - $inlineContext->getContainer()->appendChild(new Code($c)); - - return true; - } - - // If we got here, we didn't match a closing backtick sequence - $cursor->restoreState($previousState); - $inlineContext->getContainer()->appendChild(new Text($ticks)); - - return true; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Inline/BangParser.php b/vendor/league/commonmark/src/Extension/CommonMark/Parser/Inline/BangParser.php deleted file mode 100644 index 8a9e1bd6..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Inline/BangParser.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Parser\Inline; - -use League\CommonMark\Delimiter\Delimiter; -use League\CommonMark\Node\Inline\Text; -use League\CommonMark\Parser\Inline\InlineParserInterface; -use League\CommonMark\Parser\Inline\InlineParserMatch; -use League\CommonMark\Parser\InlineParserContext; - -final class BangParser implements InlineParserInterface -{ - public function getMatchDefinition(): InlineParserMatch - { - return InlineParserMatch::string('!['); - } - - public function parse(InlineParserContext $inlineContext): bool - { - $cursor = $inlineContext->getCursor(); - $cursor->advanceBy(2); - - $node = new Text('![', ['delim' => true]); - $inlineContext->getContainer()->appendChild($node); - - // Add entry to stack for this opener - $delimiter = new Delimiter('!', 1, $node, true, false, $cursor->getPosition()); - $inlineContext->getDelimiterStack()->push($delimiter); - - return true; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Inline/CloseBracketParser.php b/vendor/league/commonmark/src/Extension/CommonMark/Parser/Inline/CloseBracketParser.php deleted file mode 100644 index 16f24dc2..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Inline/CloseBracketParser.php +++ /dev/null @@ -1,212 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Parser\Inline; - -use League\CommonMark\Environment\EnvironmentAwareInterface; -use League\CommonMark\Environment\EnvironmentInterface; -use League\CommonMark\Extension\CommonMark\Node\Inline\AbstractWebResource; -use League\CommonMark\Extension\CommonMark\Node\Inline\Image; -use League\CommonMark\Extension\CommonMark\Node\Inline\Link; -use League\CommonMark\Extension\Mention\Mention; -use League\CommonMark\Node\Inline\AdjacentTextMerger; -use League\CommonMark\Node\Inline\Text; -use League\CommonMark\Parser\Cursor; -use League\CommonMark\Parser\Inline\InlineParserInterface; -use League\CommonMark\Parser\Inline\InlineParserMatch; -use League\CommonMark\Parser\InlineParserContext; -use League\CommonMark\Reference\ReferenceInterface; -use League\CommonMark\Reference\ReferenceMapInterface; -use League\CommonMark\Util\LinkParserHelper; -use League\CommonMark\Util\RegexHelper; - -final class CloseBracketParser implements InlineParserInterface, EnvironmentAwareInterface -{ - /** @psalm-readonly-allow-private-mutation */ - private EnvironmentInterface $environment; - - public function getMatchDefinition(): InlineParserMatch - { - return InlineParserMatch::string(']'); - } - - public function parse(InlineParserContext $inlineContext): bool - { - // Look through stack of delimiters for a [ or ! - $opener = $inlineContext->getDelimiterStack()->searchByCharacter(['[', '!']); - if ($opener === null) { - return false; - } - - if (! $opener->isActive()) { - // no matched opener; remove from emphasis stack - $inlineContext->getDelimiterStack()->removeDelimiter($opener); - - return false; - } - - $cursor = $inlineContext->getCursor(); - - $startPos = $cursor->getPosition(); - $previousState = $cursor->saveState(); - - $cursor->advanceBy(1); - - // Check to see if we have a link/image - - // Inline link? - if ($result = $this->tryParseInlineLinkAndTitle($cursor)) { - $link = $result; - } elseif ($link = $this->tryParseReference($cursor, $inlineContext->getReferenceMap(), $opener->getIndex(), $startPos)) { - $reference = $link; - $link = ['url' => $link->getDestination(), 'title' => $link->getTitle()]; - } else { - // No match - $inlineContext->getDelimiterStack()->removeDelimiter($opener); // Remove this opener from stack - $cursor->restoreState($previousState); - - return false; - } - - $isImage = $opener->getChar() === '!'; - - $inline = $this->createInline($link['url'], $link['title'], $isImage, $reference ?? null); - $opener->getInlineNode()->replaceWith($inline); - while (($label = $inline->next()) !== null) { - // Is there a Mention or Link contained within this link? - // CommonMark does not allow nested links, so we'll restore the original text. - if ($label instanceof Mention) { - $label->replaceWith($replacement = new Text($label->getPrefix() . $label->getIdentifier())); - $inline->appendChild($replacement); - } elseif ($label instanceof Link) { - foreach ($label->children() as $child) { - $label->insertBefore($child); - } - - $label->detach(); - } else { - $inline->appendChild($label); - } - } - - // Process delimiters such as emphasis inside link/image - $delimiterStack = $inlineContext->getDelimiterStack(); - $stackBottom = $opener->getPrevious(); - $delimiterStack->processDelimiters($stackBottom, $this->environment->getDelimiterProcessors()); - $delimiterStack->removeAll($stackBottom); - - // Merge any adjacent Text nodes together - AdjacentTextMerger::mergeChildNodes($inline); - - // processEmphasis will remove this and later delimiters. - // Now, for a link, we also remove earlier link openers (no links in links) - if (! $isImage) { - $inlineContext->getDelimiterStack()->removeEarlierMatches('['); - } - - return true; - } - - public function setEnvironment(EnvironmentInterface $environment): void - { - $this->environment = $environment; - } - - /** - * @return array|null - */ - private function tryParseInlineLinkAndTitle(Cursor $cursor): ?array - { - if ($cursor->getCurrentCharacter() !== '(') { - return null; - } - - $previousState = $cursor->saveState(); - - $cursor->advanceBy(1); - $cursor->advanceToNextNonSpaceOrNewline(); - if (($dest = LinkParserHelper::parseLinkDestination($cursor)) === null) { - $cursor->restoreState($previousState); - - return null; - } - - $cursor->advanceToNextNonSpaceOrNewline(); - $previousCharacter = $cursor->peek(-1); - // We know from previous lines that we've advanced at least one space so far, so this next call should never be null - \assert(\is_string($previousCharacter)); - - $title = ''; - // make sure there's a space before the title: - if (\preg_match(RegexHelper::REGEX_WHITESPACE_CHAR, $previousCharacter)) { - $title = LinkParserHelper::parseLinkTitle($cursor) ?? ''; - } - - $cursor->advanceToNextNonSpaceOrNewline(); - - if ($cursor->getCurrentCharacter() !== ')') { - $cursor->restoreState($previousState); - - return null; - } - - $cursor->advanceBy(1); - - return ['url' => $dest, 'title' => $title]; - } - - private function tryParseReference(Cursor $cursor, ReferenceMapInterface $referenceMap, ?int $openerIndex, int $startPos): ?ReferenceInterface - { - if ($openerIndex === null) { - return null; - } - - $savePos = $cursor->saveState(); - $beforeLabel = $cursor->getPosition(); - $n = LinkParserHelper::parseLinkLabel($cursor); - if ($n === 0 || $n === 2) { - $start = $openerIndex; - $length = $startPos - $openerIndex; - } else { - $start = $beforeLabel + 1; - $length = $n - 2; - } - - $referenceLabel = $cursor->getSubstring($start, $length); - - if ($n === 0) { - // If shortcut reference link, rewind before spaces we skipped - $cursor->restoreState($savePos); - } - - return $referenceMap->get($referenceLabel); - } - - private function createInline(string $url, string $title, bool $isImage, ?ReferenceInterface $reference = null): AbstractWebResource - { - if ($isImage) { - $inline = new Image($url, null, $title); - } else { - $inline = new Link($url, null, $title); - } - - if ($reference) { - $inline->data->set('reference', $reference); - } - - return $inline; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Inline/EntityParser.php b/vendor/league/commonmark/src/Extension/CommonMark/Parser/Inline/EntityParser.php deleted file mode 100644 index 4122ff70..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Inline/EntityParser.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Parser\Inline; - -use League\CommonMark\Node\Inline\Text; -use League\CommonMark\Parser\Inline\InlineParserInterface; -use League\CommonMark\Parser\Inline\InlineParserMatch; -use League\CommonMark\Parser\InlineParserContext; -use League\CommonMark\Util\Html5EntityDecoder; -use League\CommonMark\Util\RegexHelper; - -final class EntityParser implements InlineParserInterface -{ - public function getMatchDefinition(): InlineParserMatch - { - return InlineParserMatch::regex(RegexHelper::PARTIAL_ENTITY); - } - - public function parse(InlineParserContext $inlineContext): bool - { - $entity = $inlineContext->getFullMatch(); - - $inlineContext->getCursor()->advanceBy($inlineContext->getFullMatchLength()); - $inlineContext->getContainer()->appendChild(new Text(Html5EntityDecoder::decode($entity))); - - return true; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Inline/EscapableParser.php b/vendor/league/commonmark/src/Extension/CommonMark/Parser/Inline/EscapableParser.php deleted file mode 100644 index 64e6fab8..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Inline/EscapableParser.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Parser\Inline; - -use League\CommonMark\Node\Inline\Newline; -use League\CommonMark\Node\Inline\Text; -use League\CommonMark\Parser\Inline\InlineParserInterface; -use League\CommonMark\Parser\Inline\InlineParserMatch; -use League\CommonMark\Parser\InlineParserContext; -use League\CommonMark\Util\RegexHelper; - -final class EscapableParser implements InlineParserInterface -{ - public function getMatchDefinition(): InlineParserMatch - { - return InlineParserMatch::string('\\'); - } - - public function parse(InlineParserContext $inlineContext): bool - { - $cursor = $inlineContext->getCursor(); - $nextChar = $cursor->peek(); - - if ($nextChar === "\n") { - $cursor->advanceBy(2); - $inlineContext->getContainer()->appendChild(new Newline(Newline::HARDBREAK)); - - return true; - } - - if ($nextChar !== null && RegexHelper::isEscapable($nextChar)) { - $cursor->advanceBy(2); - $inlineContext->getContainer()->appendChild(new Text($nextChar)); - - return true; - } - - $cursor->advanceBy(1); - $inlineContext->getContainer()->appendChild(new Text('\\')); - - return true; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Inline/HtmlInlineParser.php b/vendor/league/commonmark/src/Extension/CommonMark/Parser/Inline/HtmlInlineParser.php deleted file mode 100644 index f38db135..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Inline/HtmlInlineParser.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Parser\Inline; - -use League\CommonMark\Extension\CommonMark\Node\Inline\HtmlInline; -use League\CommonMark\Parser\Inline\InlineParserInterface; -use League\CommonMark\Parser\Inline\InlineParserMatch; -use League\CommonMark\Parser\InlineParserContext; -use League\CommonMark\Util\RegexHelper; - -final class HtmlInlineParser implements InlineParserInterface -{ - public function getMatchDefinition(): InlineParserMatch - { - return InlineParserMatch::regex(RegexHelper::PARTIAL_HTMLTAG)->caseSensitive(); - } - - public function parse(InlineParserContext $inlineContext): bool - { - $inline = $inlineContext->getFullMatch(); - - $inlineContext->getCursor()->advanceBy($inlineContext->getFullMatchLength()); - $inlineContext->getContainer()->appendChild(new HtmlInline($inline)); - - return true; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Inline/OpenBracketParser.php b/vendor/league/commonmark/src/Extension/CommonMark/Parser/Inline/OpenBracketParser.php deleted file mode 100644 index 2b52d1cd..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Parser/Inline/OpenBracketParser.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Parser\Inline; - -use League\CommonMark\Delimiter\Delimiter; -use League\CommonMark\Node\Inline\Text; -use League\CommonMark\Parser\Inline\InlineParserInterface; -use League\CommonMark\Parser\Inline\InlineParserMatch; -use League\CommonMark\Parser\InlineParserContext; - -final class OpenBracketParser implements InlineParserInterface -{ - public function getMatchDefinition(): InlineParserMatch - { - return InlineParserMatch::string('['); - } - - public function parse(InlineParserContext $inlineContext): bool - { - $inlineContext->getCursor()->advanceBy(1); - $node = new Text('[', ['delim' => true]); - $inlineContext->getContainer()->appendChild($node); - - // Add entry to stack for this opener - $delimiter = new Delimiter('[', 1, $node, true, false, $inlineContext->getCursor()->getPosition()); - $inlineContext->getDelimiterStack()->push($delimiter); - - return true; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Block/BlockQuoteRenderer.php b/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Block/BlockQuoteRenderer.php deleted file mode 100644 index 4a59bd36..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Block/BlockQuoteRenderer.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Renderer\Block; - -use League\CommonMark\Extension\CommonMark\Node\Block\BlockQuote; -use League\CommonMark\Node\Node; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\CommonMark\Util\HtmlElement; -use League\CommonMark\Xml\XmlNodeRendererInterface; - -final class BlockQuoteRenderer implements NodeRendererInterface, XmlNodeRendererInterface -{ - /** - * @param BlockQuote $node - * - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function render(Node $node, ChildNodeRendererInterface $childRenderer): \Stringable - { - BlockQuote::assertInstanceOf($node); - - $attrs = $node->data->get('attributes'); - - $filling = $childRenderer->renderNodes($node->children()); - $innerSeparator = $childRenderer->getInnerSeparator(); - if ($filling === '') { - return new HtmlElement('blockquote', $attrs, $innerSeparator); - } - - return new HtmlElement( - 'blockquote', - $attrs, - $innerSeparator . $filling . $innerSeparator - ); - } - - public function getXmlTagName(Node $node): string - { - return 'block_quote'; - } - - /** - * @param BlockQuote $node - * - * @return array - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function getXmlAttributes(Node $node): array - { - return []; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Block/FencedCodeRenderer.php b/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Block/FencedCodeRenderer.php deleted file mode 100644 index e7204ea6..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Block/FencedCodeRenderer.php +++ /dev/null @@ -1,76 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Renderer\Block; - -use League\CommonMark\Extension\CommonMark\Node\Block\FencedCode; -use League\CommonMark\Node\Node; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\CommonMark\Util\HtmlElement; -use League\CommonMark\Util\Xml; -use League\CommonMark\Xml\XmlNodeRendererInterface; - -final class FencedCodeRenderer implements NodeRendererInterface, XmlNodeRendererInterface -{ - /** - * @param FencedCode $node - * - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function render(Node $node, ChildNodeRendererInterface $childRenderer): \Stringable - { - FencedCode::assertInstanceOf($node); - - $attrs = $node->data->getData('attributes'); - - $infoWords = $node->getInfoWords(); - if (\count($infoWords) !== 0 && $infoWords[0] !== '') { - $attrs->append('class', 'language-' . $infoWords[0]); - } - - return new HtmlElement( - 'pre', - [], - new HtmlElement('code', $attrs->export(), Xml::escape($node->getLiteral())) - ); - } - - public function getXmlTagName(Node $node): string - { - return 'code_block'; - } - - /** - * @param FencedCode $node - * - * @return array - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function getXmlAttributes(Node $node): array - { - FencedCode::assertInstanceOf($node); - - if (($info = $node->getInfo()) === null || $info === '') { - return []; - } - - return ['info' => $info]; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Block/HeadingRenderer.php b/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Block/HeadingRenderer.php deleted file mode 100644 index 8718b8c3..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Block/HeadingRenderer.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Renderer\Block; - -use League\CommonMark\Extension\CommonMark\Node\Block\Heading; -use League\CommonMark\Node\Node; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\CommonMark\Util\HtmlElement; -use League\CommonMark\Xml\XmlNodeRendererInterface; - -final class HeadingRenderer implements NodeRendererInterface, XmlNodeRendererInterface -{ - /** - * @param Heading $node - * - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function render(Node $node, ChildNodeRendererInterface $childRenderer): \Stringable - { - Heading::assertInstanceOf($node); - - $tag = 'h' . $node->getLevel(); - - $attrs = $node->data->get('attributes'); - - return new HtmlElement($tag, $attrs, $childRenderer->renderNodes($node->children())); - } - - public function getXmlTagName(Node $node): string - { - return 'heading'; - } - - /** - * @param Heading $node - * - * @return array - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function getXmlAttributes(Node $node): array - { - Heading::assertInstanceOf($node); - - return ['level' => $node->getLevel()]; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Block/HtmlBlockRenderer.php b/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Block/HtmlBlockRenderer.php deleted file mode 100644 index 63a19076..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Block/HtmlBlockRenderer.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Renderer\Block; - -use League\CommonMark\Extension\CommonMark\Node\Block\HtmlBlock; -use League\CommonMark\Node\Node; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\CommonMark\Util\HtmlFilter; -use League\CommonMark\Xml\XmlNodeRendererInterface; -use League\Config\ConfigurationAwareInterface; -use League\Config\ConfigurationInterface; - -final class HtmlBlockRenderer implements NodeRendererInterface, XmlNodeRendererInterface, ConfigurationAwareInterface -{ - /** @psalm-readonly-allow-private-mutation */ - private ConfigurationInterface $config; - - /** - * @param HtmlBlock $node - * - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function render(Node $node, ChildNodeRendererInterface $childRenderer): string - { - HtmlBlock::assertInstanceOf($node); - - $htmlInput = $this->config->get('html_input'); - - return HtmlFilter::filter($node->getLiteral(), $htmlInput); - } - - public function setConfiguration(ConfigurationInterface $configuration): void - { - $this->config = $configuration; - } - - public function getXmlTagName(Node $node): string - { - return 'html_block'; - } - - /** - * {@inheritDoc} - */ - public function getXmlAttributes(Node $node): array - { - return []; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Block/IndentedCodeRenderer.php b/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Block/IndentedCodeRenderer.php deleted file mode 100644 index c4bd4eb0..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Block/IndentedCodeRenderer.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Renderer\Block; - -use League\CommonMark\Extension\CommonMark\Node\Block\IndentedCode; -use League\CommonMark\Node\Node; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\CommonMark\Util\HtmlElement; -use League\CommonMark\Util\Xml; -use League\CommonMark\Xml\XmlNodeRendererInterface; - -final class IndentedCodeRenderer implements NodeRendererInterface, XmlNodeRendererInterface -{ - /** - * @param IndentedCode $node - * - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function render(Node $node, ChildNodeRendererInterface $childRenderer): \Stringable - { - IndentedCode::assertInstanceOf($node); - - $attrs = $node->data->get('attributes'); - - return new HtmlElement( - 'pre', - [], - new HtmlElement('code', $attrs, Xml::escape($node->getLiteral())) - ); - } - - public function getXmlTagName(Node $node): string - { - return 'code_block'; - } - - /** - * @return array - */ - public function getXmlAttributes(Node $node): array - { - return []; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Block/ListBlockRenderer.php b/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Block/ListBlockRenderer.php deleted file mode 100644 index f79b44dd..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Block/ListBlockRenderer.php +++ /dev/null @@ -1,86 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Renderer\Block; - -use League\CommonMark\Extension\CommonMark\Node\Block\ListBlock; -use League\CommonMark\Node\Node; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\CommonMark\Util\HtmlElement; -use League\CommonMark\Xml\XmlNodeRendererInterface; - -final class ListBlockRenderer implements NodeRendererInterface, XmlNodeRendererInterface -{ - /** - * @param ListBlock $node - * - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function render(Node $node, ChildNodeRendererInterface $childRenderer): \Stringable - { - ListBlock::assertInstanceOf($node); - - $listData = $node->getListData(); - - $tag = $listData->type === ListBlock::TYPE_BULLET ? 'ul' : 'ol'; - - $attrs = $node->data->get('attributes'); - - if ($listData->start !== null && $listData->start !== 1) { - $attrs['start'] = (string) $listData->start; - } - - $innerSeparator = $childRenderer->getInnerSeparator(); - - return new HtmlElement($tag, $attrs, $innerSeparator . $childRenderer->renderNodes($node->children()) . $innerSeparator); - } - - public function getXmlTagName(Node $node): string - { - return 'list'; - } - - /** - * @param ListBlock $node - * - * @return array - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function getXmlAttributes(Node $node): array - { - ListBlock::assertInstanceOf($node); - - $data = $node->getListData(); - - if ($data->type === ListBlock::TYPE_BULLET) { - return [ - 'type' => $data->type, - 'tight' => $node->isTight() ? 'true' : 'false', - ]; - } - - return [ - 'type' => $data->type, - 'start' => $data->start ?? 1, - 'tight' => $node->isTight(), - 'delimiter' => $data->delimiter ?? ListBlock::DELIM_PERIOD, - ]; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Block/ListItemRenderer.php b/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Block/ListItemRenderer.php deleted file mode 100644 index 570f5a7f..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Block/ListItemRenderer.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Renderer\Block; - -use League\CommonMark\Extension\CommonMark\Node\Block\ListItem; -use League\CommonMark\Extension\TaskList\TaskListItemMarker; -use League\CommonMark\Node\Block\Paragraph; -use League\CommonMark\Node\Node; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\CommonMark\Util\HtmlElement; -use League\CommonMark\Xml\XmlNodeRendererInterface; - -final class ListItemRenderer implements NodeRendererInterface, XmlNodeRendererInterface -{ - /** - * @param ListItem $node - * - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function render(Node $node, ChildNodeRendererInterface $childRenderer): \Stringable - { - ListItem::assertInstanceOf($node); - - $contents = $childRenderer->renderNodes($node->children()); - if (\substr($contents, 0, 1) === '<' && ! $this->startsTaskListItem($node)) { - $contents = "\n" . $contents; - } - - if (\substr($contents, -1, 1) === '>') { - $contents .= "\n"; - } - - $attrs = $node->data->get('attributes'); - - return new HtmlElement('li', $attrs, $contents); - } - - public function getXmlTagName(Node $node): string - { - return 'item'; - } - - /** - * {@inheritDoc} - */ - public function getXmlAttributes(Node $node): array - { - return []; - } - - private function startsTaskListItem(ListItem $block): bool - { - $firstChild = $block->firstChild(); - - return $firstChild instanceof Paragraph && $firstChild->firstChild() instanceof TaskListItemMarker; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Block/ThematicBreakRenderer.php b/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Block/ThematicBreakRenderer.php deleted file mode 100644 index 392bfeed..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Block/ThematicBreakRenderer.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Renderer\Block; - -use League\CommonMark\Extension\CommonMark\Node\Block\ThematicBreak; -use League\CommonMark\Node\Node; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\CommonMark\Util\HtmlElement; -use League\CommonMark\Xml\XmlNodeRendererInterface; - -final class ThematicBreakRenderer implements NodeRendererInterface, XmlNodeRendererInterface -{ - /** - * @param ThematicBreak $node - * - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function render(Node $node, ChildNodeRendererInterface $childRenderer): \Stringable - { - ThematicBreak::assertInstanceOf($node); - - $attrs = $node->data->get('attributes'); - - return new HtmlElement('hr', $attrs, '', true); - } - - public function getXmlTagName(Node $node): string - { - return 'thematic_break'; - } - - /** - * {@inheritDoc} - */ - public function getXmlAttributes(Node $node): array - { - return []; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Inline/CodeRenderer.php b/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Inline/CodeRenderer.php deleted file mode 100644 index de030e84..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Inline/CodeRenderer.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Renderer\Inline; - -use League\CommonMark\Extension\CommonMark\Node\Inline\Code; -use League\CommonMark\Node\Node; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\CommonMark\Util\HtmlElement; -use League\CommonMark\Util\Xml; -use League\CommonMark\Xml\XmlNodeRendererInterface; - -final class CodeRenderer implements NodeRendererInterface, XmlNodeRendererInterface -{ - /** - * @param Code $node - * - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function render(Node $node, ChildNodeRendererInterface $childRenderer): \Stringable - { - Code::assertInstanceOf($node); - - $attrs = $node->data->get('attributes'); - - return new HtmlElement('code', $attrs, Xml::escape($node->getLiteral())); - } - - public function getXmlTagName(Node $node): string - { - return 'code'; - } - - /** - * {@inheritDoc} - */ - public function getXmlAttributes(Node $node): array - { - return []; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Inline/EmphasisRenderer.php b/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Inline/EmphasisRenderer.php deleted file mode 100644 index 41169c4d..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Inline/EmphasisRenderer.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Renderer\Inline; - -use League\CommonMark\Extension\CommonMark\Node\Inline\Emphasis; -use League\CommonMark\Node\Node; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\CommonMark\Util\HtmlElement; -use League\CommonMark\Xml\XmlNodeRendererInterface; - -final class EmphasisRenderer implements NodeRendererInterface, XmlNodeRendererInterface -{ - /** - * @param Emphasis $node - * - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function render(Node $node, ChildNodeRendererInterface $childRenderer): \Stringable - { - Emphasis::assertInstanceOf($node); - - $attrs = $node->data->get('attributes'); - - return new HtmlElement('em', $attrs, $childRenderer->renderNodes($node->children())); - } - - public function getXmlTagName(Node $node): string - { - return 'emph'; - } - - /** - * {@inheritDoc} - */ - public function getXmlAttributes(Node $node): array - { - return []; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Inline/HtmlInlineRenderer.php b/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Inline/HtmlInlineRenderer.php deleted file mode 100644 index 69f0fd5a..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Inline/HtmlInlineRenderer.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Renderer\Inline; - -use League\CommonMark\Extension\CommonMark\Node\Inline\HtmlInline; -use League\CommonMark\Node\Node; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\CommonMark\Util\HtmlFilter; -use League\CommonMark\Xml\XmlNodeRendererInterface; -use League\Config\ConfigurationAwareInterface; -use League\Config\ConfigurationInterface; - -final class HtmlInlineRenderer implements NodeRendererInterface, XmlNodeRendererInterface, ConfigurationAwareInterface -{ - /** @psalm-readonly-allow-private-mutation */ - private ConfigurationInterface $config; - - /** - * @param HtmlInline $node - * - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function render(Node $node, ChildNodeRendererInterface $childRenderer): string - { - HtmlInline::assertInstanceOf($node); - - $htmlInput = $this->config->get('html_input'); - - return HtmlFilter::filter($node->getLiteral(), $htmlInput); - } - - public function setConfiguration(ConfigurationInterface $configuration): void - { - $this->config = $configuration; - } - - public function getXmlTagName(Node $node): string - { - return 'html_inline'; - } - - /** - * {@inheritDoc} - */ - public function getXmlAttributes(Node $node): array - { - return []; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Inline/ImageRenderer.php b/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Inline/ImageRenderer.php deleted file mode 100644 index 7bf09ac7..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Inline/ImageRenderer.php +++ /dev/null @@ -1,107 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Renderer\Inline; - -use League\CommonMark\Extension\CommonMark\Node\Inline\Image; -use League\CommonMark\Node\Inline\Newline; -use League\CommonMark\Node\Node; -use League\CommonMark\Node\NodeIterator; -use League\CommonMark\Node\StringContainerInterface; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\CommonMark\Util\HtmlElement; -use League\CommonMark\Util\RegexHelper; -use League\CommonMark\Xml\XmlNodeRendererInterface; -use League\Config\ConfigurationAwareInterface; -use League\Config\ConfigurationInterface; - -final class ImageRenderer implements NodeRendererInterface, XmlNodeRendererInterface, ConfigurationAwareInterface -{ - /** @psalm-readonly-allow-private-mutation */ - private ConfigurationInterface $config; - - /** - * @param Image $node - * - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function render(Node $node, ChildNodeRendererInterface $childRenderer): \Stringable - { - Image::assertInstanceOf($node); - - $attrs = $node->data->get('attributes'); - - $forbidUnsafeLinks = ! $this->config->get('allow_unsafe_links'); - if ($forbidUnsafeLinks && RegexHelper::isLinkPotentiallyUnsafe($node->getUrl())) { - $attrs['src'] = ''; - } else { - $attrs['src'] = $node->getUrl(); - } - - $attrs['alt'] = $this->getAltText($node); - - if (($title = $node->getTitle()) !== null) { - $attrs['title'] = $title; - } - - return new HtmlElement('img', $attrs, '', true); - } - - public function setConfiguration(ConfigurationInterface $configuration): void - { - $this->config = $configuration; - } - - public function getXmlTagName(Node $node): string - { - return 'image'; - } - - /** - * @param Image $node - * - * @return array - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function getXmlAttributes(Node $node): array - { - Image::assertInstanceOf($node); - - return [ - 'destination' => $node->getUrl(), - 'title' => $node->getTitle() ?? '', - ]; - } - - private function getAltText(Image $node): string - { - $altText = ''; - - foreach ((new NodeIterator($node)) as $n) { - if ($n instanceof StringContainerInterface) { - $altText .= $n->getLiteral(); - } elseif ($n instanceof Newline) { - $altText .= "\n"; - } - } - - return $altText; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Inline/LinkRenderer.php b/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Inline/LinkRenderer.php deleted file mode 100644 index 4ef96452..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Inline/LinkRenderer.php +++ /dev/null @@ -1,89 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Renderer\Inline; - -use League\CommonMark\Extension\CommonMark\Node\Inline\Link; -use League\CommonMark\Node\Node; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\CommonMark\Util\HtmlElement; -use League\CommonMark\Util\RegexHelper; -use League\CommonMark\Xml\XmlNodeRendererInterface; -use League\Config\ConfigurationAwareInterface; -use League\Config\ConfigurationInterface; - -final class LinkRenderer implements NodeRendererInterface, XmlNodeRendererInterface, ConfigurationAwareInterface -{ - /** @psalm-readonly-allow-private-mutation */ - private ConfigurationInterface $config; - - /** - * @param Link $node - * - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function render(Node $node, ChildNodeRendererInterface $childRenderer): \Stringable - { - Link::assertInstanceOf($node); - - $attrs = $node->data->get('attributes'); - - $forbidUnsafeLinks = ! $this->config->get('allow_unsafe_links'); - if (! ($forbidUnsafeLinks && RegexHelper::isLinkPotentiallyUnsafe($node->getUrl()))) { - $attrs['href'] = $node->getUrl(); - } - - if (($title = $node->getTitle()) !== null) { - $attrs['title'] = $title; - } - - if (isset($attrs['target']) && $attrs['target'] === '_blank' && ! isset($attrs['rel'])) { - $attrs['rel'] = 'noopener noreferrer'; - } - - return new HtmlElement('a', $attrs, $childRenderer->renderNodes($node->children())); - } - - public function setConfiguration(ConfigurationInterface $configuration): void - { - $this->config = $configuration; - } - - public function getXmlTagName(Node $node): string - { - return 'link'; - } - - /** - * @param Link $node - * - * @return array - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function getXmlAttributes(Node $node): array - { - Link::assertInstanceOf($node); - - return [ - 'destination' => $node->getUrl(), - 'title' => $node->getTitle() ?? '', - ]; - } -} diff --git a/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Inline/StrongRenderer.php b/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Inline/StrongRenderer.php deleted file mode 100644 index f0bb8f9c..00000000 --- a/vendor/league/commonmark/src/Extension/CommonMark/Renderer/Inline/StrongRenderer.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\CommonMark\Renderer\Inline; - -use League\CommonMark\Extension\CommonMark\Node\Inline\Strong; -use League\CommonMark\Node\Node; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\CommonMark\Util\HtmlElement; -use League\CommonMark\Xml\XmlNodeRendererInterface; - -final class StrongRenderer implements NodeRendererInterface, XmlNodeRendererInterface -{ - /** - * @param Strong $node - * - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function render(Node $node, ChildNodeRendererInterface $childRenderer): \Stringable - { - Strong::assertInstanceOf($node); - - $attrs = $node->data->get('attributes'); - - return new HtmlElement('strong', $attrs, $childRenderer->renderNodes($node->children())); - } - - public function getXmlTagName(Node $node): string - { - return 'strong'; - } - - /** - * {@inheritDoc} - */ - public function getXmlAttributes(Node $node): array - { - return []; - } -} diff --git a/vendor/league/commonmark/src/Extension/ConfigurableExtensionInterface.php b/vendor/league/commonmark/src/Extension/ConfigurableExtensionInterface.php deleted file mode 100644 index 63e467cb..00000000 --- a/vendor/league/commonmark/src/Extension/ConfigurableExtensionInterface.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension; - -use League\Config\ConfigurationBuilderInterface; - -interface ConfigurableExtensionInterface extends ExtensionInterface -{ - public function configureSchema(ConfigurationBuilderInterface $builder): void; -} diff --git a/vendor/league/commonmark/src/Extension/DefaultAttributes/ApplyDefaultAttributesProcessor.php b/vendor/league/commonmark/src/Extension/DefaultAttributes/ApplyDefaultAttributesProcessor.php deleted file mode 100644 index 6b519f86..00000000 --- a/vendor/league/commonmark/src/Extension/DefaultAttributes/ApplyDefaultAttributesProcessor.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\DefaultAttributes; - -use League\CommonMark\Event\DocumentParsedEvent; -use League\CommonMark\Extension\Attributes\Util\AttributesHelper; -use League\Config\ConfigurationAwareInterface; -use League\Config\ConfigurationInterface; - -final class ApplyDefaultAttributesProcessor implements ConfigurationAwareInterface -{ - private ConfigurationInterface $config; - - public function onDocumentParsed(DocumentParsedEvent $event): void - { - /** @var array> $map */ - $map = $this->config->get('default_attributes'); - - // Don't bother iterating if no default attributes are configured - if (! $map) { - return; - } - - foreach ($event->getDocument()->iterator() as $node) { - // Check to see if any default attributes were defined - if (($attributesToApply = $map[\get_class($node)] ?? []) === []) { - continue; - } - - $newAttributes = []; - foreach ($attributesToApply as $name => $value) { - if (\is_callable($value)) { - $value = $value($node); - // Callables are allowed to return `null` indicating that no changes should be made - if ($value !== null) { - $newAttributes[$name] = $value; - } - } else { - $newAttributes[$name] = $value; - } - } - - // Merge these attributes into the node - if (\count($newAttributes) > 0) { - $node->data->set('attributes', AttributesHelper::mergeAttributes($node, $newAttributes)); - } - } - } - - public function setConfiguration(ConfigurationInterface $configuration): void - { - $this->config = $configuration; - } -} diff --git a/vendor/league/commonmark/src/Extension/DefaultAttributes/DefaultAttributesExtension.php b/vendor/league/commonmark/src/Extension/DefaultAttributes/DefaultAttributesExtension.php deleted file mode 100644 index 152c29a0..00000000 --- a/vendor/league/commonmark/src/Extension/DefaultAttributes/DefaultAttributesExtension.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\DefaultAttributes; - -use League\CommonMark\Environment\EnvironmentBuilderInterface; -use League\CommonMark\Event\DocumentParsedEvent; -use League\CommonMark\Extension\ConfigurableExtensionInterface; -use League\Config\ConfigurationBuilderInterface; -use Nette\Schema\Expect; - -final class DefaultAttributesExtension implements ConfigurableExtensionInterface -{ - public function configureSchema(ConfigurationBuilderInterface $builder): void - { - $builder->addSchema('default_attributes', Expect::arrayOf( - Expect::arrayOf( - Expect::type('string|string[]|bool|callable'), // attribute value(s) - 'string' // attribute name - ), - 'string' // node FQCN - )->default([])); - } - - public function register(EnvironmentBuilderInterface $environment): void - { - $environment->addEventListener(DocumentParsedEvent::class, [new ApplyDefaultAttributesProcessor(), 'onDocumentParsed']); - } -} diff --git a/vendor/league/commonmark/src/Extension/DescriptionList/DescriptionListExtension.php b/vendor/league/commonmark/src/Extension/DescriptionList/DescriptionListExtension.php deleted file mode 100644 index 9ddd2a83..00000000 --- a/vendor/league/commonmark/src/Extension/DescriptionList/DescriptionListExtension.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. - */ - -namespace League\CommonMark\Extension\DescriptionList; - -use League\CommonMark\Environment\EnvironmentBuilderInterface; -use League\CommonMark\Event\DocumentParsedEvent; -use League\CommonMark\Extension\DescriptionList\Event\ConsecutiveDescriptionListMerger; -use League\CommonMark\Extension\DescriptionList\Event\LooseDescriptionHandler; -use League\CommonMark\Extension\DescriptionList\Node\Description; -use League\CommonMark\Extension\DescriptionList\Node\DescriptionList; -use League\CommonMark\Extension\DescriptionList\Node\DescriptionTerm; -use League\CommonMark\Extension\DescriptionList\Parser\DescriptionStartParser; -use League\CommonMark\Extension\DescriptionList\Renderer\DescriptionListRenderer; -use League\CommonMark\Extension\DescriptionList\Renderer\DescriptionRenderer; -use League\CommonMark\Extension\DescriptionList\Renderer\DescriptionTermRenderer; -use League\CommonMark\Extension\ExtensionInterface; - -final class DescriptionListExtension implements ExtensionInterface -{ - public function register(EnvironmentBuilderInterface $environment): void - { - $environment->addBlockStartParser(new DescriptionStartParser()); - - $environment->addEventListener(DocumentParsedEvent::class, new LooseDescriptionHandler(), 1001); - $environment->addEventListener(DocumentParsedEvent::class, new ConsecutiveDescriptionListMerger(), 1000); - - $environment->addRenderer(DescriptionList::class, new DescriptionListRenderer()); - $environment->addRenderer(DescriptionTerm::class, new DescriptionTermRenderer()); - $environment->addRenderer(Description::class, new DescriptionRenderer()); - } -} diff --git a/vendor/league/commonmark/src/Extension/DescriptionList/Event/ConsecutiveDescriptionListMerger.php b/vendor/league/commonmark/src/Extension/DescriptionList/Event/ConsecutiveDescriptionListMerger.php deleted file mode 100644 index 15210e77..00000000 --- a/vendor/league/commonmark/src/Extension/DescriptionList/Event/ConsecutiveDescriptionListMerger.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\DescriptionList\Event; - -use League\CommonMark\Event\DocumentParsedEvent; -use League\CommonMark\Extension\DescriptionList\Node\DescriptionList; -use League\CommonMark\Node\NodeIterator; - -final class ConsecutiveDescriptionListMerger -{ - public function __invoke(DocumentParsedEvent $event): void - { - foreach ($event->getDocument()->iterator(NodeIterator::FLAG_BLOCKS_ONLY) as $node) { - if (! $node instanceof DescriptionList) { - continue; - } - - if (! ($prev = $node->previous()) instanceof DescriptionList) { - continue; - } - - // There's another description list behind this one; merge the current one into that - foreach ($node->children() as $child) { - $prev->appendChild($child); - } - - $node->detach(); - } - } -} diff --git a/vendor/league/commonmark/src/Extension/DescriptionList/Event/LooseDescriptionHandler.php b/vendor/league/commonmark/src/Extension/DescriptionList/Event/LooseDescriptionHandler.php deleted file mode 100644 index a8823fab..00000000 --- a/vendor/league/commonmark/src/Extension/DescriptionList/Event/LooseDescriptionHandler.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 League\CommonMark\Extension\DescriptionList\Event; - -use League\CommonMark\Event\DocumentParsedEvent; -use League\CommonMark\Extension\DescriptionList\Node\Description; -use League\CommonMark\Extension\DescriptionList\Node\DescriptionList; -use League\CommonMark\Extension\DescriptionList\Node\DescriptionTerm; -use League\CommonMark\Node\Block\Paragraph; -use League\CommonMark\Node\Inline\Newline; -use League\CommonMark\Node\NodeIterator; - -final class LooseDescriptionHandler -{ - public function __invoke(DocumentParsedEvent $event): void - { - foreach ($event->getDocument()->iterator(NodeIterator::FLAG_BLOCKS_ONLY) as $description) { - if (! $description instanceof Description) { - continue; - } - - // Does this description need to be added to a list? - if (! $description->parent() instanceof DescriptionList) { - $list = new DescriptionList(); - // Taking any preceding paragraphs with it - if (($paragraph = $description->previous()) instanceof Paragraph) { - $list->appendChild($paragraph); - } - - $description->replaceWith($list); - $list->appendChild($description); - } - - // Is this description preceded by a paragraph that should really be a term? - if (! (($paragraph = $description->previous()) instanceof Paragraph)) { - continue; - } - - // Convert the paragraph into one or more terms - $term = new DescriptionTerm(); - $paragraph->replaceWith($term); - - foreach ($paragraph->children() as $child) { - if ($child instanceof Newline) { - $newTerm = new DescriptionTerm(); - $term->insertAfter($newTerm); - $term = $newTerm; - continue; - } - - $term->appendChild($child); - } - } - } -} diff --git a/vendor/league/commonmark/src/Extension/DescriptionList/Node/Description.php b/vendor/league/commonmark/src/Extension/DescriptionList/Node/Description.php deleted file mode 100644 index ccef962f..00000000 --- a/vendor/league/commonmark/src/Extension/DescriptionList/Node/Description.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\DescriptionList\Node; - -use League\CommonMark\Node\Block\AbstractBlock; -use League\CommonMark\Node\Block\TightBlockInterface; - -class Description extends AbstractBlock implements TightBlockInterface -{ - private bool $tight; - - public function __construct(bool $tight = false) - { - parent::__construct(); - - $this->tight = $tight; - } - - public function isTight(): bool - { - return $this->tight; - } - - public function setTight(bool $tight): void - { - $this->tight = $tight; - } -} diff --git a/vendor/league/commonmark/src/Extension/DescriptionList/Node/DescriptionList.php b/vendor/league/commonmark/src/Extension/DescriptionList/Node/DescriptionList.php deleted file mode 100644 index 90d026c3..00000000 --- a/vendor/league/commonmark/src/Extension/DescriptionList/Node/DescriptionList.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. - */ - -namespace League\CommonMark\Extension\DescriptionList\Node; - -use League\CommonMark\Node\Block\AbstractBlock; - -class DescriptionList extends AbstractBlock -{ -} diff --git a/vendor/league/commonmark/src/Extension/DescriptionList/Node/DescriptionTerm.php b/vendor/league/commonmark/src/Extension/DescriptionList/Node/DescriptionTerm.php deleted file mode 100644 index b13ec751..00000000 --- a/vendor/league/commonmark/src/Extension/DescriptionList/Node/DescriptionTerm.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. - */ - -namespace League\CommonMark\Extension\DescriptionList\Node; - -use League\CommonMark\Node\Block\AbstractBlock; - -class DescriptionTerm extends AbstractBlock -{ -} diff --git a/vendor/league/commonmark/src/Extension/DescriptionList/Parser/DescriptionContinueParser.php b/vendor/league/commonmark/src/Extension/DescriptionList/Parser/DescriptionContinueParser.php deleted file mode 100644 index 0cdd9d56..00000000 --- a/vendor/league/commonmark/src/Extension/DescriptionList/Parser/DescriptionContinueParser.php +++ /dev/null @@ -1,71 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Extension\DescriptionList\Parser; - -use League\CommonMark\Extension\DescriptionList\Node\Description; -use League\CommonMark\Node\Block\AbstractBlock; -use League\CommonMark\Parser\Block\AbstractBlockContinueParser; -use League\CommonMark\Parser\Block\BlockContinue; -use League\CommonMark\Parser\Block\BlockContinueParserInterface; -use League\CommonMark\Parser\Cursor; - -final class DescriptionContinueParser extends AbstractBlockContinueParser -{ - private Description $block; - - private int $indentation; - - public function __construct(bool $tight, int $indentation) - { - $this->block = new Description($tight); - $this->indentation = $indentation; - } - - public function getBlock(): Description - { - return $this->block; - } - - public function tryContinue(Cursor $cursor, BlockContinueParserInterface $activeBlockParser): ?BlockContinue - { - if ($cursor->isBlank()) { - if ($this->block->firstChild() === null) { - // Blank line after empty item - return BlockContinue::none(); - } - - $cursor->advanceToNextNonSpaceOrTab(); - - return BlockContinue::at($cursor); - } - - if ($cursor->getIndent() >= $this->indentation) { - $cursor->advanceBy($this->indentation, true); - - return BlockContinue::at($cursor); - } - - return BlockContinue::none(); - } - - public function isContainer(): bool - { - return true; - } - - public function canContain(AbstractBlock $childBlock): bool - { - return true; - } -} diff --git a/vendor/league/commonmark/src/Extension/DescriptionList/Parser/DescriptionListContinueParser.php b/vendor/league/commonmark/src/Extension/DescriptionList/Parser/DescriptionListContinueParser.php deleted file mode 100644 index 1d446a77..00000000 --- a/vendor/league/commonmark/src/Extension/DescriptionList/Parser/DescriptionListContinueParser.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. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Extension\DescriptionList\Parser; - -use League\CommonMark\Extension\DescriptionList\Node\Description; -use League\CommonMark\Extension\DescriptionList\Node\DescriptionList; -use League\CommonMark\Extension\DescriptionList\Node\DescriptionTerm; -use League\CommonMark\Node\Block\AbstractBlock; -use League\CommonMark\Parser\Block\AbstractBlockContinueParser; -use League\CommonMark\Parser\Block\BlockContinue; -use League\CommonMark\Parser\Block\BlockContinueParserInterface; -use League\CommonMark\Parser\Cursor; - -final class DescriptionListContinueParser extends AbstractBlockContinueParser -{ - private DescriptionList $block; - - public function __construct() - { - $this->block = new DescriptionList(); - } - - public function getBlock(): DescriptionList - { - return $this->block; - } - - public function tryContinue(Cursor $cursor, BlockContinueParserInterface $activeBlockParser): ?BlockContinue - { - return BlockContinue::at($cursor); - } - - public function isContainer(): bool - { - return true; - } - - public function canContain(AbstractBlock $childBlock): bool - { - return $childBlock instanceof DescriptionTerm || $childBlock instanceof Description; - } -} diff --git a/vendor/league/commonmark/src/Extension/DescriptionList/Parser/DescriptionStartParser.php b/vendor/league/commonmark/src/Extension/DescriptionList/Parser/DescriptionStartParser.php deleted file mode 100644 index b4e8c98e..00000000 --- a/vendor/league/commonmark/src/Extension/DescriptionList/Parser/DescriptionStartParser.php +++ /dev/null @@ -1,73 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Extension\DescriptionList\Parser; - -use League\CommonMark\Extension\DescriptionList\Node\Description; -use League\CommonMark\Node\Block\Paragraph; -use League\CommonMark\Parser\Block\BlockStart; -use League\CommonMark\Parser\Block\BlockStartParserInterface; -use League\CommonMark\Parser\Cursor; -use League\CommonMark\Parser\MarkdownParserStateInterface; - -final class DescriptionStartParser implements BlockStartParserInterface -{ - public function tryStart(Cursor $cursor, MarkdownParserStateInterface $parserState): ?BlockStart - { - if ($cursor->isIndented()) { - return BlockStart::none(); - } - - $cursor->advanceToNextNonSpaceOrTab(); - if ($cursor->match('/^:[ \t]+/') === null) { - return BlockStart::none(); - } - - $terms = $parserState->getParagraphContent(); - - $activeBlock = $parserState->getActiveBlockParser()->getBlock(); - - if ($terms !== null && $terms !== '') { - // New description; tight; term(s) sitting in pending block that we will replace - return BlockStart::of(...[new DescriptionListContinueParser()], ...self::splitTerms($terms), ...[new DescriptionContinueParser(true, $cursor->getPosition())]) - ->at($cursor) - ->replaceActiveBlockParser(); - } - - if ($activeBlock instanceof Paragraph && $activeBlock->parent() instanceof Description) { - // Additional description in the same list as the parent description - return BlockStart::of(new DescriptionContinueParser(true, $cursor->getPosition()))->at($cursor); - } - - if ($activeBlock->lastChild() instanceof Paragraph) { - // New description; loose; term(s) sitting in previous closed paragraph block - return BlockStart::of(new DescriptionContinueParser(false, $cursor->getPosition()))->at($cursor); - } - - // No preceding terms - return BlockStart::none(); - } - - /** - * @return array - */ - private static function splitTerms(string $terms): array - { - $ret = []; - foreach (\explode("\n", $terms) as $term) { - $ret[] = new DescriptionTermContinueParser($term); - } - - return $ret; - } -} diff --git a/vendor/league/commonmark/src/Extension/DescriptionList/Parser/DescriptionTermContinueParser.php b/vendor/league/commonmark/src/Extension/DescriptionList/Parser/DescriptionTermContinueParser.php deleted file mode 100644 index 7b43882e..00000000 --- a/vendor/league/commonmark/src/Extension/DescriptionList/Parser/DescriptionTermContinueParser.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\DescriptionList\Parser; - -use League\CommonMark\Extension\DescriptionList\Node\DescriptionTerm; -use League\CommonMark\Parser\Block\AbstractBlockContinueParser; -use League\CommonMark\Parser\Block\BlockContinue; -use League\CommonMark\Parser\Block\BlockContinueParserInterface; -use League\CommonMark\Parser\Block\BlockContinueParserWithInlinesInterface; -use League\CommonMark\Parser\Cursor; -use League\CommonMark\Parser\InlineParserEngineInterface; - -final class DescriptionTermContinueParser extends AbstractBlockContinueParser implements BlockContinueParserWithInlinesInterface -{ - private DescriptionTerm $block; - - private string $term; - - public function __construct(string $term) - { - $this->block = new DescriptionTerm(); - $this->term = $term; - } - - public function getBlock(): DescriptionTerm - { - return $this->block; - } - - public function tryContinue(Cursor $cursor, BlockContinueParserInterface $activeBlockParser): ?BlockContinue - { - return BlockContinue::finished(); - } - - public function parseInlines(InlineParserEngineInterface $inlineParser): void - { - if ($this->term !== '') { - $inlineParser->parse($this->term, $this->block); - } - } -} diff --git a/vendor/league/commonmark/src/Extension/DescriptionList/Renderer/DescriptionListRenderer.php b/vendor/league/commonmark/src/Extension/DescriptionList/Renderer/DescriptionListRenderer.php deleted file mode 100644 index 7723038f..00000000 --- a/vendor/league/commonmark/src/Extension/DescriptionList/Renderer/DescriptionListRenderer.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\DescriptionList\Renderer; - -use League\CommonMark\Extension\DescriptionList\Node\DescriptionList; -use League\CommonMark\Node\Node; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\CommonMark\Util\HtmlElement; - -final class DescriptionListRenderer implements NodeRendererInterface -{ - /** - * @param DescriptionList $node - * - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function render(Node $node, ChildNodeRendererInterface $childRenderer): HtmlElement - { - DescriptionList::assertInstanceOf($node); - - $separator = $childRenderer->getBlockSeparator(); - - return new HtmlElement('dl', [], $separator . $childRenderer->renderNodes($node->children()) . $separator); - } -} diff --git a/vendor/league/commonmark/src/Extension/DescriptionList/Renderer/DescriptionRenderer.php b/vendor/league/commonmark/src/Extension/DescriptionList/Renderer/DescriptionRenderer.php deleted file mode 100644 index 5fcffd6a..00000000 --- a/vendor/league/commonmark/src/Extension/DescriptionList/Renderer/DescriptionRenderer.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 League\CommonMark\Extension\DescriptionList\Renderer; - -use League\CommonMark\Extension\DescriptionList\Node\Description; -use League\CommonMark\Node\Node; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\CommonMark\Util\HtmlElement; - -final class DescriptionRenderer implements NodeRendererInterface -{ - /** - * @param Description $node - * - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function render(Node $node, ChildNodeRendererInterface $childRenderer): \Stringable - { - Description::assertInstanceOf($node); - - return new HtmlElement('dd', [], $childRenderer->renderNodes($node->children())); - } -} diff --git a/vendor/league/commonmark/src/Extension/DescriptionList/Renderer/DescriptionTermRenderer.php b/vendor/league/commonmark/src/Extension/DescriptionList/Renderer/DescriptionTermRenderer.php deleted file mode 100644 index ce8a1c44..00000000 --- a/vendor/league/commonmark/src/Extension/DescriptionList/Renderer/DescriptionTermRenderer.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 League\CommonMark\Extension\DescriptionList\Renderer; - -use League\CommonMark\Extension\DescriptionList\Node\DescriptionTerm; -use League\CommonMark\Node\Node; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\CommonMark\Util\HtmlElement; - -final class DescriptionTermRenderer implements NodeRendererInterface -{ - /** - * @param DescriptionTerm $node - * - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function render(Node $node, ChildNodeRendererInterface $childRenderer): \Stringable - { - DescriptionTerm::assertInstanceOf($node); - - return new HtmlElement('dt', [], $childRenderer->renderNodes($node->children())); - } -} diff --git a/vendor/league/commonmark/src/Extension/DisallowedRawHtml/DisallowedRawHtmlExtension.php b/vendor/league/commonmark/src/Extension/DisallowedRawHtml/DisallowedRawHtmlExtension.php deleted file mode 100644 index 0ece0c2f..00000000 --- a/vendor/league/commonmark/src/Extension/DisallowedRawHtml/DisallowedRawHtmlExtension.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 League\CommonMark\Extension\DisallowedRawHtml; - -use League\CommonMark\Environment\EnvironmentBuilderInterface; -use League\CommonMark\Extension\CommonMark\Node\Block\HtmlBlock; -use League\CommonMark\Extension\CommonMark\Node\Inline\HtmlInline; -use League\CommonMark\Extension\CommonMark\Renderer\Block\HtmlBlockRenderer; -use League\CommonMark\Extension\CommonMark\Renderer\Inline\HtmlInlineRenderer; -use League\CommonMark\Extension\ConfigurableExtensionInterface; -use League\Config\ConfigurationBuilderInterface; -use Nette\Schema\Expect; - -final class DisallowedRawHtmlExtension implements ConfigurableExtensionInterface -{ - private const DEFAULT_DISALLOWED_TAGS = [ - 'title', - 'textarea', - 'style', - 'xmp', - 'iframe', - 'noembed', - 'noframes', - 'script', - 'plaintext', - ]; - - public function configureSchema(ConfigurationBuilderInterface $builder): void - { - $builder->addSchema('disallowed_raw_html', Expect::structure([ - 'disallowed_tags' => Expect::listOf('string')->default(self::DEFAULT_DISALLOWED_TAGS)->mergeDefaults(false), - ])); - } - - public function register(EnvironmentBuilderInterface $environment): void - { - $environment->addRenderer(HtmlBlock::class, new DisallowedRawHtmlRenderer(new HtmlBlockRenderer()), 50); - $environment->addRenderer(HtmlInline::class, new DisallowedRawHtmlRenderer(new HtmlInlineRenderer()), 50); - } -} diff --git a/vendor/league/commonmark/src/Extension/DisallowedRawHtml/DisallowedRawHtmlRenderer.php b/vendor/league/commonmark/src/Extension/DisallowedRawHtml/DisallowedRawHtmlRenderer.php deleted file mode 100644 index 06252a31..00000000 --- a/vendor/league/commonmark/src/Extension/DisallowedRawHtml/DisallowedRawHtmlRenderer.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 League\CommonMark\Extension\DisallowedRawHtml; - -use League\CommonMark\Node\Node; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\Config\ConfigurationAwareInterface; -use League\Config\ConfigurationInterface; - -final class DisallowedRawHtmlRenderer implements NodeRendererInterface, ConfigurationAwareInterface -{ - /** @psalm-readonly */ - private NodeRendererInterface $innerRenderer; - - /** @psalm-readonly-allow-private-mutation */ - private ConfigurationInterface $config; - - public function __construct(NodeRendererInterface $innerRenderer) - { - $this->innerRenderer = $innerRenderer; - } - - public function render(Node $node, ChildNodeRendererInterface $childRenderer): ?string - { - $rendered = (string) $this->innerRenderer->render($node, $childRenderer); - - if ($rendered === '') { - return ''; - } - - $tags = (array) $this->config->get('disallowed_raw_html/disallowed_tags'); - if (\count($tags) === 0) { - return $rendered; - } - - $regex = \sprintf('/<(\/?(?:%s)[ \/>])/i', \implode('|', \array_map('preg_quote', $tags))); - - // Match these types of tags: <title/> <title /> - return \preg_replace($regex, '<$1', $rendered); - } - - public function setConfiguration(ConfigurationInterface $configuration): void - { - $this->config = $configuration; - - if ($this->innerRenderer instanceof ConfigurationAwareInterface) { - $this->innerRenderer->setConfiguration($configuration); - } - } -} diff --git a/vendor/league/commonmark/src/Extension/Embed/Bridge/OscaroteroEmbedAdapter.php b/vendor/league/commonmark/src/Extension/Embed/Bridge/OscaroteroEmbedAdapter.php deleted file mode 100644 index 5335eea5..00000000 --- a/vendor/league/commonmark/src/Extension/Embed/Bridge/OscaroteroEmbedAdapter.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\Embed\Bridge; - -use Embed\Embed as EmbedLib; -use League\CommonMark\Extension\Embed\Embed; -use League\CommonMark\Extension\Embed\EmbedAdapterInterface; - -final class OscaroteroEmbedAdapter implements EmbedAdapterInterface -{ - private EmbedLib $embedLib; - - public function __construct(?EmbedLib $embed = null) - { - if ($embed === null) { - if (! \class_exists(EmbedLib::class)) { - throw new \RuntimeException('The embed/embed package is not installed. Please install it with Composer to use this adapter.'); - } - - $embed = new EmbedLib(); - } - - $this->embedLib = $embed; - } - - /** - * {@inheritDoc} - */ - public function updateEmbeds(array $embeds): void - { - $extractors = $this->embedLib->getMulti(...\array_map(static fn (Embed $embed) => $embed->getUrl(), $embeds)); - foreach ($extractors as $i => $extractor) { - if ($extractor->code !== null) { - $embeds[$i]->setEmbedCode($extractor->code->html); - } - } - } -} diff --git a/vendor/league/commonmark/src/Extension/Embed/DomainFilteringAdapter.php b/vendor/league/commonmark/src/Extension/Embed/DomainFilteringAdapter.php deleted file mode 100644 index 69dc096f..00000000 --- a/vendor/league/commonmark/src/Extension/Embed/DomainFilteringAdapter.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\Embed; - -class DomainFilteringAdapter implements EmbedAdapterInterface -{ - private EmbedAdapterInterface $decorated; - - private string $regex; - - /** - * @param string[] $allowedDomains - */ - public function __construct(EmbedAdapterInterface $decorated, array $allowedDomains) - { - $this->decorated = $decorated; - $this->regex = self::createRegex($allowedDomains); - } - - /** - * {@inheritDoc} - */ - public function updateEmbeds(array $embeds): void - { - $this->decorated->updateEmbeds(\array_values(\array_filter($embeds, function (Embed $embed): bool { - return \preg_match($this->regex, $embed->getUrl()) === 1; - }))); - } - - /** - * @param string[] $allowedDomains - */ - private static function createRegex(array $allowedDomains): string - { - $allowedDomains = \array_map('preg_quote', $allowedDomains); - - return '/^(?:https?:\/\/)?(?:[^.]+\.)*(' . \implode('|', $allowedDomains) . ')/'; - } -} diff --git a/vendor/league/commonmark/src/Extension/Embed/Embed.php b/vendor/league/commonmark/src/Extension/Embed/Embed.php deleted file mode 100644 index 94c19804..00000000 --- a/vendor/league/commonmark/src/Extension/Embed/Embed.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\Embed; - -use League\CommonMark\Node\Block\AbstractBlock; - -final class Embed extends AbstractBlock -{ - private string $url; - private ?string $embedCode; - - public function __construct(string $url, ?string $embedCode = null) - { - parent::__construct(); - - $this->url = $url; - $this->embedCode = $embedCode; - } - - public function getUrl(): string - { - return $this->url; - } - - public function setUrl(string $url): void - { - $this->url = $url; - } - - public function getEmbedCode(): ?string - { - return $this->embedCode; - } - - public function setEmbedCode(?string $embedCode): void - { - $this->embedCode = $embedCode; - } -} diff --git a/vendor/league/commonmark/src/Extension/Embed/EmbedAdapterInterface.php b/vendor/league/commonmark/src/Extension/Embed/EmbedAdapterInterface.php deleted file mode 100644 index 9880a439..00000000 --- a/vendor/league/commonmark/src/Extension/Embed/EmbedAdapterInterface.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\Embed; - -/** - * Interface for a service which updates the embed code(s) for the given array of embeds - */ -interface EmbedAdapterInterface -{ - /** - * @param Embed[] $embeds - */ - public function updateEmbeds(array $embeds): void; -} diff --git a/vendor/league/commonmark/src/Extension/Embed/EmbedExtension.php b/vendor/league/commonmark/src/Extension/Embed/EmbedExtension.php deleted file mode 100644 index babf048d..00000000 --- a/vendor/league/commonmark/src/Extension/Embed/EmbedExtension.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\Embed; - -use League\CommonMark\Environment\EnvironmentBuilderInterface; -use League\CommonMark\Event\DocumentParsedEvent; -use League\CommonMark\Extension\ConfigurableExtensionInterface; -use League\Config\ConfigurationBuilderInterface; -use Nette\Schema\Expect; - -final class EmbedExtension implements ConfigurableExtensionInterface -{ - public function configureSchema(ConfigurationBuilderInterface $builder): void - { - $builder->addSchema('embed', Expect::structure([ - 'adapter' => Expect::type(EmbedAdapterInterface::class), - 'allowed_domains' => Expect::arrayOf('string')->default([]), - 'fallback' => Expect::anyOf('link', 'remove')->default('link'), - ])); - } - - public function register(EnvironmentBuilderInterface $environment): void - { - $adapter = $environment->getConfiguration()->get('embed.adapter'); - \assert($adapter instanceof EmbedAdapterInterface); - - $allowedDomains = $environment->getConfiguration()->get('embed.allowed_domains'); - if ($allowedDomains !== []) { - $adapter = new DomainFilteringAdapter($adapter, $allowedDomains); - } - - $environment - ->addBlockStartParser(new EmbedStartParser(), 300) - ->addEventListener(DocumentParsedEvent::class, new EmbedProcessor($adapter, $environment->getConfiguration()->get('embed.fallback')), 1010) - ->addRenderer(Embed::class, new EmbedRenderer()); - } -} diff --git a/vendor/league/commonmark/src/Extension/Embed/EmbedParser.php b/vendor/league/commonmark/src/Extension/Embed/EmbedParser.php deleted file mode 100644 index e957caf8..00000000 --- a/vendor/league/commonmark/src/Extension/Embed/EmbedParser.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\Embed; - -use League\CommonMark\Node\Block\AbstractBlock; -use League\CommonMark\Parser\Block\BlockContinue; -use League\CommonMark\Parser\Block\BlockContinueParserInterface; -use League\CommonMark\Parser\Cursor; - -class EmbedParser implements BlockContinueParserInterface -{ - private Embed $embed; - - public function __construct(string $url) - { - $this->embed = new Embed($url); - } - - public function getBlock(): AbstractBlock - { - return $this->embed; - } - - public function isContainer(): bool - { - return false; - } - - public function canHaveLazyContinuationLines(): bool - { - return false; - } - - public function canContain(AbstractBlock $childBlock): bool - { - return false; - } - - public function tryContinue(Cursor $cursor, BlockContinueParserInterface $activeBlockParser): ?BlockContinue - { - return BlockContinue::none(); - } - - public function addLine(string $line): void - { - } - - public function closeBlock(): void - { - } -} diff --git a/vendor/league/commonmark/src/Extension/Embed/EmbedProcessor.php b/vendor/league/commonmark/src/Extension/Embed/EmbedProcessor.php deleted file mode 100644 index 68fb9eeb..00000000 --- a/vendor/league/commonmark/src/Extension/Embed/EmbedProcessor.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\Embed; - -use League\CommonMark\Event\DocumentParsedEvent; -use League\CommonMark\Extension\CommonMark\Node\Inline\Link; -use League\CommonMark\Node\Block\Paragraph; -use League\CommonMark\Node\Inline\Text; -use League\CommonMark\Node\NodeIterator; - -final class EmbedProcessor -{ - public const FALLBACK_REMOVE = 'remove'; - public const FALLBACK_LINK = 'link'; - - private EmbedAdapterInterface $adapter; - private string $fallback; - - public function __construct(EmbedAdapterInterface $adapter, string $fallback = self::FALLBACK_REMOVE) - { - $this->adapter = $adapter; - $this->fallback = $fallback; - } - - public function __invoke(DocumentParsedEvent $event): void - { - $document = $event->getDocument(); - $embeds = []; - foreach (new NodeIterator($document) as $node) { - if (! ($node instanceof Embed)) { - continue; - } - - if ($node->parent() !== $document) { - $replacement = new Paragraph(); - $replacement->appendChild(new Text($node->getUrl())); - $node->replaceWith($replacement); - } else { - $embeds[] = $node; - } - } - - $this->adapter->updateEmbeds($embeds); - - foreach ($embeds as $embed) { - if ($embed->getEmbedCode() !== null) { - continue; - } - - if ($this->fallback === self::FALLBACK_REMOVE) { - $embed->detach(); - } elseif ($this->fallback === self::FALLBACK_LINK) { - $paragraph = new Paragraph(); - $paragraph->appendChild(new Link($embed->getUrl(), $embed->getUrl())); - $embed->replaceWith($paragraph); - } - } - } -} diff --git a/vendor/league/commonmark/src/Extension/Embed/EmbedRenderer.php b/vendor/league/commonmark/src/Extension/Embed/EmbedRenderer.php deleted file mode 100644 index 91655d88..00000000 --- a/vendor/league/commonmark/src/Extension/Embed/EmbedRenderer.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\Embed; - -use League\CommonMark\Node\Node; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; - -class EmbedRenderer implements NodeRendererInterface -{ - /** - * @param Embed $node - * - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function render(Node $node, ChildNodeRendererInterface $childRenderer) - { - Embed::assertInstanceOf($node); - - return $node->getEmbedCode() ?? ''; - } -} diff --git a/vendor/league/commonmark/src/Extension/Embed/EmbedStartParser.php b/vendor/league/commonmark/src/Extension/Embed/EmbedStartParser.php deleted file mode 100644 index 5ff38086..00000000 --- a/vendor/league/commonmark/src/Extension/Embed/EmbedStartParser.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\Embed; - -use League\CommonMark\Parser\Block\BlockStart; -use League\CommonMark\Parser\Block\BlockStartParserInterface; -use League\CommonMark\Parser\Cursor; -use League\CommonMark\Parser\MarkdownParserStateInterface; -use League\CommonMark\Util\LinkParserHelper; - -class EmbedStartParser implements BlockStartParserInterface -{ - public function tryStart(Cursor $cursor, MarkdownParserStateInterface $parserState): ?BlockStart - { - if ($cursor->isIndented() || $parserState->getParagraphContent() !== null || ! ($parserState->getActiveBlockParser()->isContainer())) { - return BlockStart::none(); - } - - // 0-3 leading spaces are okay - $cursor->advanceToNextNonSpaceOrTab(); - - // The line must begin with "https://" - if (! str_starts_with($cursor->getRemainder(), 'https://')) { - return BlockStart::none(); - } - - // A valid link must be found next - if (($dest = LinkParserHelper::parseLinkDestination($cursor)) === null) { - return BlockStart::none(); - } - - // Skip any trailing whitespace - $cursor->advanceToNextNonSpaceOrTab(); - - // We must be at the end of the line; otherwise, this link was not by itself - if (! $cursor->isAtEnd()) { - return BlockStart::none(); - } - - return BlockStart::of(new EmbedParser($dest))->at($cursor); - } -} diff --git a/vendor/league/commonmark/src/Extension/ExtensionInterface.php b/vendor/league/commonmark/src/Extension/ExtensionInterface.php deleted file mode 100644 index 01a9f2ed..00000000 --- a/vendor/league/commonmark/src/Extension/ExtensionInterface.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension; - -use League\CommonMark\Environment\EnvironmentBuilderInterface; - -interface ExtensionInterface -{ - public function register(EnvironmentBuilderInterface $environment): void; -} diff --git a/vendor/league/commonmark/src/Extension/ExternalLink/ExternalLinkExtension.php b/vendor/league/commonmark/src/Extension/ExternalLink/ExternalLinkExtension.php deleted file mode 100644 index df0079cf..00000000 --- a/vendor/league/commonmark/src/Extension/ExternalLink/ExternalLinkExtension.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\ExternalLink; - -use League\CommonMark\Environment\EnvironmentBuilderInterface; -use League\CommonMark\Event\DocumentParsedEvent; -use League\CommonMark\Extension\ConfigurableExtensionInterface; -use League\Config\ConfigurationBuilderInterface; -use Nette\Schema\Expect; - -final class ExternalLinkExtension implements ConfigurableExtensionInterface -{ - public function configureSchema(ConfigurationBuilderInterface $builder): void - { - $applyOptions = [ - ExternalLinkProcessor::APPLY_NONE, - ExternalLinkProcessor::APPLY_ALL, - ExternalLinkProcessor::APPLY_INTERNAL, - ExternalLinkProcessor::APPLY_EXTERNAL, - ]; - - $builder->addSchema('external_link', Expect::structure([ - 'internal_hosts' => Expect::type('string|string[]'), - 'open_in_new_window' => Expect::bool(false), - 'html_class' => Expect::string()->default(''), - 'nofollow' => Expect::anyOf(...$applyOptions)->default(ExternalLinkProcessor::APPLY_NONE), - 'noopener' => Expect::anyOf(...$applyOptions)->default(ExternalLinkProcessor::APPLY_EXTERNAL), - 'noreferrer' => Expect::anyOf(...$applyOptions)->default(ExternalLinkProcessor::APPLY_EXTERNAL), - ])); - } - - public function register(EnvironmentBuilderInterface $environment): void - { - $environment->addEventListener(DocumentParsedEvent::class, new ExternalLinkProcessor($environment->getConfiguration()), -50); - } -} diff --git a/vendor/league/commonmark/src/Extension/ExternalLink/ExternalLinkProcessor.php b/vendor/league/commonmark/src/Extension/ExternalLink/ExternalLinkProcessor.php deleted file mode 100644 index 12505357..00000000 --- a/vendor/league/commonmark/src/Extension/ExternalLink/ExternalLinkProcessor.php +++ /dev/null @@ -1,114 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\ExternalLink; - -use League\CommonMark\Event\DocumentParsedEvent; -use League\CommonMark\Extension\CommonMark\Node\Inline\Link; -use League\Config\ConfigurationInterface; - -final class ExternalLinkProcessor -{ - public const APPLY_NONE = ''; - public const APPLY_ALL = 'all'; - public const APPLY_EXTERNAL = 'external'; - public const APPLY_INTERNAL = 'internal'; - - /** @psalm-readonly */ - private ConfigurationInterface $config; - - public function __construct(ConfigurationInterface $config) - { - $this->config = $config; - } - - public function __invoke(DocumentParsedEvent $e): void - { - $internalHosts = $this->config->get('external_link/internal_hosts'); - $openInNewWindow = $this->config->get('external_link/open_in_new_window'); - $classes = $this->config->get('external_link/html_class'); - - foreach ($e->getDocument()->iterator() as $link) { - if (! ($link instanceof Link)) { - continue; - } - - $host = \parse_url($link->getUrl(), PHP_URL_HOST); - if (! \is_string($host)) { - // Something is terribly wrong with this URL - continue; - } - - if (self::hostMatches($host, $internalHosts)) { - $link->data->set('external', false); - $this->applyRelAttribute($link, false); - continue; - } - - // Host does not match our list - $this->markLinkAsExternal($link, $openInNewWindow, $classes); - } - } - - private function markLinkAsExternal(Link $link, bool $openInNewWindow, string $classes): void - { - $link->data->set('external', true); - $this->applyRelAttribute($link, true); - - if ($openInNewWindow) { - $link->data->set('attributes/target', '_blank'); - } - - if ($classes !== '') { - $link->data->append('attributes/class', $classes); - } - } - - private function applyRelAttribute(Link $link, bool $isExternal): void - { - $options = [ - 'nofollow' => $this->config->get('external_link/nofollow'), - 'noopener' => $this->config->get('external_link/noopener'), - 'noreferrer' => $this->config->get('external_link/noreferrer'), - ]; - - foreach ($options as $type => $option) { - switch (true) { - case $option === self::APPLY_ALL: - case $isExternal && $option === self::APPLY_EXTERNAL: - case ! $isExternal && $option === self::APPLY_INTERNAL: - $link->data->append('attributes/rel', $type); - } - } - } - - /** - * @internal This method is only public so we can easily test it. DO NOT USE THIS OUTSIDE OF THIS EXTENSION! - * - * @param mixed $compareTo - */ - public static function hostMatches(string $host, $compareTo): bool - { - foreach ((array) $compareTo as $c) { - if (\strpos($c, '/') === 0) { - if (\preg_match($c, $host)) { - return true; - } - } elseif ($c === $host) { - return true; - } - } - - return false; - } -} diff --git a/vendor/league/commonmark/src/Extension/Footnote/Event/AnonymousFootnotesListener.php b/vendor/league/commonmark/src/Extension/Footnote/Event/AnonymousFootnotesListener.php deleted file mode 100644 index 401613a7..00000000 --- a/vendor/league/commonmark/src/Extension/Footnote/Event/AnonymousFootnotesListener.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * (c) Rezo Zero / Ambroise Maupate - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Extension\Footnote\Event; - -use League\CommonMark\Event\DocumentParsedEvent; -use League\CommonMark\Extension\Footnote\Node\Footnote; -use League\CommonMark\Extension\Footnote\Node\FootnoteBackref; -use League\CommonMark\Extension\Footnote\Node\FootnoteRef; -use League\CommonMark\Node\Block\Paragraph; -use League\CommonMark\Node\Inline\Text; -use League\CommonMark\Reference\Reference; -use League\Config\ConfigurationAwareInterface; -use League\Config\ConfigurationInterface; - -final class AnonymousFootnotesListener implements ConfigurationAwareInterface -{ - private ConfigurationInterface $config; - - public function onDocumentParsed(DocumentParsedEvent $event): void - { - $document = $event->getDocument(); - foreach ($document->iterator() as $node) { - if (! $node instanceof FootnoteRef || ($text = $node->getContent()) === null) { - continue; - } - - // Anonymous footnote needs to create a footnote from its content - $existingReference = $node->getReference(); - $newReference = new Reference( - $existingReference->getLabel(), - '#' . $this->config->get('footnote/ref_id_prefix') . $existingReference->getLabel(), - $existingReference->getTitle() - ); - - $paragraph = new Paragraph(); - $paragraph->appendChild(new Text($text)); - $paragraph->appendChild(new FootnoteBackref($newReference)); - - $footnote = new Footnote($newReference); - $footnote->appendChild($paragraph); - - $document->appendChild($footnote); - } - } - - public function setConfiguration(ConfigurationInterface $configuration): void - { - $this->config = $configuration; - } -} diff --git a/vendor/league/commonmark/src/Extension/Footnote/Event/FixOrphanedFootnotesAndRefsListener.php b/vendor/league/commonmark/src/Extension/Footnote/Event/FixOrphanedFootnotesAndRefsListener.php deleted file mode 100644 index a0295b53..00000000 --- a/vendor/league/commonmark/src/Extension/Footnote/Event/FixOrphanedFootnotesAndRefsListener.php +++ /dev/null @@ -1,68 +0,0 @@ -<?php - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Extension\Footnote\Event; - -use League\CommonMark\Event\DocumentParsedEvent; -use League\CommonMark\Extension\Footnote\Node\Footnote; -use League\CommonMark\Extension\Footnote\Node\FootnoteRef; -use League\CommonMark\Node\Block\Document; -use League\CommonMark\Node\Inline\Text; - -final class FixOrphanedFootnotesAndRefsListener -{ - public function onDocumentParsed(DocumentParsedEvent $event): void - { - $document = $event->getDocument(); - $map = $this->buildMapOfKnownFootnotesAndRefs($document); - - foreach ($map['_flat'] as $node) { - if ($node instanceof FootnoteRef && ! isset($map[Footnote::class][$node->getReference()->getLabel()])) { - // Found an orphaned FootnoteRef without a corresponding Footnote - // Restore the original footnote ref text - $node->replaceWith(new Text(\sprintf('[^%s]', $node->getReference()->getLabel()))); - } - - // phpcs:disable SlevomatCodingStandard.ControlStructures.EarlyExit.EarlyExitNotUsed - if ($node instanceof Footnote && ! isset($map[FootnoteRef::class][$node->getReference()->getLabel()])) { - // Found an orphaned Footnote without a corresponding FootnoteRef - // Remove the footnote - $node->detach(); - } - } - } - - /** @phpstan-ignore-next-line */ - private function buildMapOfKnownFootnotesAndRefs(Document $document): array // @phpcs:ignore - { - $map = [ - Footnote::class => [], - FootnoteRef::class => [], - '_flat' => [], - ]; - - foreach ($document->iterator() as $node) { - if ($node instanceof Footnote) { - $map[Footnote::class][$node->getReference()->getLabel()] = true; - - $map['_flat'][] = $node; - } elseif ($node instanceof FootnoteRef) { - $map[FootnoteRef::class][$node->getReference()->getLabel()] = true; - - $map['_flat'][] = $node; - } - } - - return $map; - } -} diff --git a/vendor/league/commonmark/src/Extension/Footnote/Event/GatherFootnotesListener.php b/vendor/league/commonmark/src/Extension/Footnote/Event/GatherFootnotesListener.php deleted file mode 100644 index ae8d00b0..00000000 --- a/vendor/league/commonmark/src/Extension/Footnote/Event/GatherFootnotesListener.php +++ /dev/null @@ -1,106 +0,0 @@ -<?php - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * (c) Rezo Zero / Ambroise Maupate - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Extension\Footnote\Event; - -use League\CommonMark\Event\DocumentParsedEvent; -use League\CommonMark\Extension\Footnote\Node\Footnote; -use League\CommonMark\Extension\Footnote\Node\FootnoteBackref; -use League\CommonMark\Extension\Footnote\Node\FootnoteContainer; -use League\CommonMark\Node\Block\Document; -use League\CommonMark\Node\NodeIterator; -use League\CommonMark\Reference\Reference; -use League\Config\ConfigurationAwareInterface; -use League\Config\ConfigurationInterface; - -final class GatherFootnotesListener implements ConfigurationAwareInterface -{ - private ConfigurationInterface $config; - - public function onDocumentParsed(DocumentParsedEvent $event): void - { - $document = $event->getDocument(); - $footnotes = []; - - foreach ($document->iterator(NodeIterator::FLAG_BLOCKS_ONLY) as $node) { - if (! $node instanceof Footnote) { - continue; - } - - // Look for existing reference with footnote label - $ref = $document->getReferenceMap()->get($node->getReference()->getLabel()); - if ($ref !== null) { - // Use numeric title to get footnotes order - $footnotes[(int) $ref->getTitle()] = $node; - } else { - // Footnote call is missing, append footnote at the end - $footnotes[\PHP_INT_MAX] = $node; - } - - $key = '#' . $this->config->get('footnote/footnote_id_prefix') . $node->getReference()->getDestination(); - if ($document->data->has($key)) { - $this->createBackrefs($node, $document->data->get($key)); - } - } - - // Only add a footnote container if there are any - if (\count($footnotes) === 0) { - return; - } - - $container = $this->getFootnotesContainer($document); - - \ksort($footnotes); - foreach ($footnotes as $footnote) { - $container->appendChild($footnote); - } - } - - private function getFootnotesContainer(Document $document): FootnoteContainer - { - $footnoteContainer = new FootnoteContainer(); - $document->appendChild($footnoteContainer); - - return $footnoteContainer; - } - - /** - * Look for all footnote refs pointing to this footnote and create each footnote backrefs. - * - * @param Footnote $node The target footnote - * @param Reference[] $backrefs References to create backrefs for - */ - private function createBackrefs(Footnote $node, array $backrefs): void - { - // Backrefs should be added to the child paragraph - $target = $node->lastChild(); - if ($target === null) { - // This should never happen, but you never know - $target = $node; - } - - foreach ($backrefs as $backref) { - $target->appendChild(new FootnoteBackref(new Reference( - $backref->getLabel(), - '#' . $this->config->get('footnote/ref_id_prefix') . $backref->getLabel(), - $backref->getTitle() - ))); - } - } - - public function setConfiguration(ConfigurationInterface $configuration): void - { - $this->config = $configuration; - } -} diff --git a/vendor/league/commonmark/src/Extension/Footnote/Event/NumberFootnotesListener.php b/vendor/league/commonmark/src/Extension/Footnote/Event/NumberFootnotesListener.php deleted file mode 100644 index 65600fab..00000000 --- a/vendor/league/commonmark/src/Extension/Footnote/Event/NumberFootnotesListener.php +++ /dev/null @@ -1,75 +0,0 @@ -<?php - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * (c) Rezo Zero / Ambroise Maupate - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Extension\Footnote\Event; - -use League\CommonMark\Event\DocumentParsedEvent; -use League\CommonMark\Extension\Footnote\Node\FootnoteRef; -use League\CommonMark\Reference\Reference; - -final class NumberFootnotesListener -{ - public function onDocumentParsed(DocumentParsedEvent $event): void - { - $document = $event->getDocument(); - $nextCounter = 1; - $usedLabels = []; - $usedCounters = []; - - foreach ($document->iterator() as $node) { - if (! $node instanceof FootnoteRef) { - continue; - } - - $existingReference = $node->getReference(); - $label = $existingReference->getLabel(); - $counter = $nextCounter; - $canIncrementCounter = true; - - if (\array_key_exists($label, $usedLabels)) { - /* - * Reference is used again, we need to point - * to the same footnote. But with a different ID - */ - $counter = $usedCounters[$label]; - $label .= '__' . ++$usedLabels[$label]; - $canIncrementCounter = false; - } - - // rewrite reference title to use a numeric link - $newReference = new Reference( - $label, - $existingReference->getDestination(), - (string) $counter - ); - - // Override reference with numeric link - $node->setReference($newReference); - $document->getReferenceMap()->add($newReference); - - /* - * Store created references in document for - * creating FootnoteBackrefs - */ - $document->data->append($existingReference->getDestination(), $newReference); - - $usedLabels[$label] = 1; - $usedCounters[$label] = $nextCounter; - - if ($canIncrementCounter) { - $nextCounter++; - } - } - } -} diff --git a/vendor/league/commonmark/src/Extension/Footnote/FootnoteExtension.php b/vendor/league/commonmark/src/Extension/Footnote/FootnoteExtension.php deleted file mode 100644 index 0fa8038e..00000000 --- a/vendor/league/commonmark/src/Extension/Footnote/FootnoteExtension.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * (c) Rezo Zero / Ambroise Maupate - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Extension\Footnote; - -use League\CommonMark\Environment\EnvironmentBuilderInterface; -use League\CommonMark\Event\DocumentParsedEvent; -use League\CommonMark\Extension\ConfigurableExtensionInterface; -use League\CommonMark\Extension\Footnote\Event\AnonymousFootnotesListener; -use League\CommonMark\Extension\Footnote\Event\FixOrphanedFootnotesAndRefsListener; -use League\CommonMark\Extension\Footnote\Event\GatherFootnotesListener; -use League\CommonMark\Extension\Footnote\Event\NumberFootnotesListener; -use League\CommonMark\Extension\Footnote\Node\Footnote; -use League\CommonMark\Extension\Footnote\Node\FootnoteBackref; -use League\CommonMark\Extension\Footnote\Node\FootnoteContainer; -use League\CommonMark\Extension\Footnote\Node\FootnoteRef; -use League\CommonMark\Extension\Footnote\Parser\AnonymousFootnoteRefParser; -use League\CommonMark\Extension\Footnote\Parser\FootnoteRefParser; -use League\CommonMark\Extension\Footnote\Parser\FootnoteStartParser; -use League\CommonMark\Extension\Footnote\Renderer\FootnoteBackrefRenderer; -use League\CommonMark\Extension\Footnote\Renderer\FootnoteContainerRenderer; -use League\CommonMark\Extension\Footnote\Renderer\FootnoteRefRenderer; -use League\CommonMark\Extension\Footnote\Renderer\FootnoteRenderer; -use League\Config\ConfigurationBuilderInterface; -use Nette\Schema\Expect; - -final class FootnoteExtension implements ConfigurableExtensionInterface -{ - public function configureSchema(ConfigurationBuilderInterface $builder): void - { - $builder->addSchema('footnote', Expect::structure([ - 'backref_class' => Expect::string('footnote-backref'), - 'backref_symbol' => Expect::string('↩'), - 'container_add_hr' => Expect::bool(true), - 'container_class' => Expect::string('footnotes'), - 'ref_class' => Expect::string('footnote-ref'), - 'ref_id_prefix' => Expect::string('fnref:'), - 'footnote_class' => Expect::string('footnote'), - 'footnote_id_prefix' => Expect::string('fn:'), - ])); - } - - public function register(EnvironmentBuilderInterface $environment): void - { - $environment->addBlockStartParser(new FootnoteStartParser(), 51); - $environment->addInlineParser(new AnonymousFootnoteRefParser(), 35); - $environment->addInlineParser(new FootnoteRefParser(), 51); - - $environment->addRenderer(FootnoteContainer::class, new FootnoteContainerRenderer()); - $environment->addRenderer(Footnote::class, new FootnoteRenderer()); - $environment->addRenderer(FootnoteRef::class, new FootnoteRefRenderer()); - $environment->addRenderer(FootnoteBackref::class, new FootnoteBackrefRenderer()); - - $environment->addEventListener(DocumentParsedEvent::class, [new AnonymousFootnotesListener(), 'onDocumentParsed'], 40); - $environment->addEventListener(DocumentParsedEvent::class, [new FixOrphanedFootnotesAndRefsListener(), 'onDocumentParsed'], 30); - $environment->addEventListener(DocumentParsedEvent::class, [new NumberFootnotesListener(), 'onDocumentParsed'], 20); - $environment->addEventListener(DocumentParsedEvent::class, [new GatherFootnotesListener(), 'onDocumentParsed'], 10); - } -} diff --git a/vendor/league/commonmark/src/Extension/Footnote/Node/Footnote.php b/vendor/league/commonmark/src/Extension/Footnote/Node/Footnote.php deleted file mode 100644 index c3f77cac..00000000 --- a/vendor/league/commonmark/src/Extension/Footnote/Node/Footnote.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * (c) Rezo Zero / Ambroise Maupate - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Extension\Footnote\Node; - -use League\CommonMark\Node\Block\AbstractBlock; -use League\CommonMark\Reference\ReferenceInterface; -use League\CommonMark\Reference\ReferenceableInterface; - -final class Footnote extends AbstractBlock implements ReferenceableInterface -{ - /** @psalm-readonly */ - private ReferenceInterface $reference; - - public function __construct(ReferenceInterface $reference) - { - parent::__construct(); - - $this->reference = $reference; - } - - public function getReference(): ReferenceInterface - { - return $this->reference; - } -} diff --git a/vendor/league/commonmark/src/Extension/Footnote/Node/FootnoteBackref.php b/vendor/league/commonmark/src/Extension/Footnote/Node/FootnoteBackref.php deleted file mode 100644 index f56daa53..00000000 --- a/vendor/league/commonmark/src/Extension/Footnote/Node/FootnoteBackref.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * (c) Rezo Zero / Ambroise Maupate - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Extension\Footnote\Node; - -use League\CommonMark\Node\Inline\AbstractInline; -use League\CommonMark\Reference\ReferenceInterface; -use League\CommonMark\Reference\ReferenceableInterface; - -/** - * Link from the footnote on the bottom of the document back to the reference - */ -final class FootnoteBackref extends AbstractInline implements ReferenceableInterface -{ - /** @psalm-readonly */ - private ReferenceInterface $reference; - - public function __construct(ReferenceInterface $reference) - { - parent::__construct(); - - $this->reference = $reference; - } - - public function getReference(): ReferenceInterface - { - return $this->reference; - } -} diff --git a/vendor/league/commonmark/src/Extension/Footnote/Node/FootnoteContainer.php b/vendor/league/commonmark/src/Extension/Footnote/Node/FootnoteContainer.php deleted file mode 100644 index af4ee35f..00000000 --- a/vendor/league/commonmark/src/Extension/Footnote/Node/FootnoteContainer.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * (c) Rezo Zero / Ambroise Maupate - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Extension\Footnote\Node; - -use League\CommonMark\Node\Block\AbstractBlock; - -final class FootnoteContainer extends AbstractBlock -{ -} diff --git a/vendor/league/commonmark/src/Extension/Footnote/Node/FootnoteRef.php b/vendor/league/commonmark/src/Extension/Footnote/Node/FootnoteRef.php deleted file mode 100644 index f98f5d33..00000000 --- a/vendor/league/commonmark/src/Extension/Footnote/Node/FootnoteRef.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * (c) Rezo Zero / Ambroise Maupate - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Extension\Footnote\Node; - -use League\CommonMark\Node\Inline\AbstractInline; -use League\CommonMark\Reference\ReferenceInterface; -use League\CommonMark\Reference\ReferenceableInterface; - -final class FootnoteRef extends AbstractInline implements ReferenceableInterface -{ - private ReferenceInterface $reference; - - /** @psalm-readonly */ - private ?string $content = null; - - /** - * @param array<mixed> $data - */ - public function __construct(ReferenceInterface $reference, ?string $content = null, array $data = []) - { - parent::__construct(); - - $this->reference = $reference; - $this->content = $content; - - $this->data->import($data); - } - - public function getReference(): ReferenceInterface - { - return $this->reference; - } - - public function setReference(ReferenceInterface $reference): void - { - $this->reference = $reference; - } - - public function getContent(): ?string - { - return $this->content; - } -} diff --git a/vendor/league/commonmark/src/Extension/Footnote/Parser/AnonymousFootnoteRefParser.php b/vendor/league/commonmark/src/Extension/Footnote/Parser/AnonymousFootnoteRefParser.php deleted file mode 100644 index 4ed93da5..00000000 --- a/vendor/league/commonmark/src/Extension/Footnote/Parser/AnonymousFootnoteRefParser.php +++ /dev/null @@ -1,66 +0,0 @@ -<?php - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * (c) Rezo Zero / Ambroise Maupate - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Extension\Footnote\Parser; - -use League\CommonMark\Environment\EnvironmentAwareInterface; -use League\CommonMark\Environment\EnvironmentInterface; -use League\CommonMark\Extension\Footnote\Node\FootnoteRef; -use League\CommonMark\Normalizer\TextNormalizerInterface; -use League\CommonMark\Parser\Inline\InlineParserInterface; -use League\CommonMark\Parser\Inline\InlineParserMatch; -use League\CommonMark\Parser\InlineParserContext; -use League\CommonMark\Reference\Reference; -use League\Config\ConfigurationInterface; - -final class AnonymousFootnoteRefParser implements InlineParserInterface, EnvironmentAwareInterface -{ - private ConfigurationInterface $config; - - /** @psalm-readonly-allow-private-mutation */ - private TextNormalizerInterface $slugNormalizer; - - public function getMatchDefinition(): InlineParserMatch - { - return InlineParserMatch::regex('\^\[([^\]]+)\]'); - } - - public function parse(InlineParserContext $inlineContext): bool - { - $inlineContext->getCursor()->advanceBy($inlineContext->getFullMatchLength()); - - [$label] = $inlineContext->getSubMatches(); - $reference = $this->createReference($label); - $inlineContext->getContainer()->appendChild(new FootnoteRef($reference, $label)); - - return true; - } - - private function createReference(string $label): Reference - { - $refLabel = $this->slugNormalizer->normalize($label, ['length' => 20]); - - return new Reference( - $refLabel, - '#' . $this->config->get('footnote/footnote_id_prefix') . $refLabel, - $label - ); - } - - public function setEnvironment(EnvironmentInterface $environment): void - { - $this->config = $environment->getConfiguration(); - $this->slugNormalizer = $environment->getSlugNormalizer(); - } -} diff --git a/vendor/league/commonmark/src/Extension/Footnote/Parser/FootnoteParser.php b/vendor/league/commonmark/src/Extension/Footnote/Parser/FootnoteParser.php deleted file mode 100644 index 21925468..00000000 --- a/vendor/league/commonmark/src/Extension/Footnote/Parser/FootnoteParser.php +++ /dev/null @@ -1,68 +0,0 @@ -<?php - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * (c) Rezo Zero / Ambroise Maupate - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Extension\Footnote\Parser; - -use League\CommonMark\Extension\Footnote\Node\Footnote; -use League\CommonMark\Node\Block\AbstractBlock; -use League\CommonMark\Parser\Block\AbstractBlockContinueParser; -use League\CommonMark\Parser\Block\BlockContinue; -use League\CommonMark\Parser\Block\BlockContinueParserInterface; -use League\CommonMark\Parser\Cursor; -use League\CommonMark\Reference\ReferenceInterface; - -final class FootnoteParser extends AbstractBlockContinueParser -{ - /** @psalm-readonly */ - private Footnote $block; - - /** @psalm-readonly-allow-private-mutation */ - private ?int $indentation = null; - - public function __construct(ReferenceInterface $reference) - { - $this->block = new Footnote($reference); - } - - public function getBlock(): Footnote - { - return $this->block; - } - - public function tryContinue(Cursor $cursor, BlockContinueParserInterface $activeBlockParser): ?BlockContinue - { - if ($cursor->isBlank()) { - return BlockContinue::at($cursor); - } - - if ($cursor->isIndented()) { - $this->indentation ??= $cursor->getIndent(); - $cursor->advanceBy($this->indentation, true); - - return BlockContinue::at($cursor); - } - - return BlockContinue::none(); - } - - public function isContainer(): bool - { - return true; - } - - public function canContain(AbstractBlock $childBlock): bool - { - return true; - } -} diff --git a/vendor/league/commonmark/src/Extension/Footnote/Parser/FootnoteRefParser.php b/vendor/league/commonmark/src/Extension/Footnote/Parser/FootnoteRefParser.php deleted file mode 100644 index 4032abda..00000000 --- a/vendor/league/commonmark/src/Extension/Footnote/Parser/FootnoteRefParser.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * (c) Rezo Zero / Ambroise Maupate - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Extension\Footnote\Parser; - -use League\CommonMark\Extension\Footnote\Node\FootnoteRef; -use League\CommonMark\Parser\Inline\InlineParserInterface; -use League\CommonMark\Parser\Inline\InlineParserMatch; -use League\CommonMark\Parser\InlineParserContext; -use League\CommonMark\Reference\Reference; -use League\Config\ConfigurationAwareInterface; -use League\Config\ConfigurationInterface; - -final class FootnoteRefParser implements InlineParserInterface, ConfigurationAwareInterface -{ - private ConfigurationInterface $config; - - public function getMatchDefinition(): InlineParserMatch - { - return InlineParserMatch::regex('\[\^([^\s\]]+)\]'); - } - - public function parse(InlineParserContext $inlineContext): bool - { - $inlineContext->getCursor()->advanceBy($inlineContext->getFullMatchLength()); - - [$label] = $inlineContext->getSubMatches(); - $inlineContext->getContainer()->appendChild(new FootnoteRef($this->createReference($label))); - - return true; - } - - private function createReference(string $label): Reference - { - return new Reference( - $label, - '#' . $this->config->get('footnote/footnote_id_prefix') . $label, - $label - ); - } - - public function setConfiguration(ConfigurationInterface $configuration): void - { - $this->config = $configuration; - } -} diff --git a/vendor/league/commonmark/src/Extension/Footnote/Parser/FootnoteStartParser.php b/vendor/league/commonmark/src/Extension/Footnote/Parser/FootnoteStartParser.php deleted file mode 100644 index 734e6786..00000000 --- a/vendor/league/commonmark/src/Extension/Footnote/Parser/FootnoteStartParser.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * (c) Rezo Zero / Ambroise Maupate - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Extension\Footnote\Parser; - -use League\CommonMark\Parser\Block\BlockStart; -use League\CommonMark\Parser\Block\BlockStartParserInterface; -use League\CommonMark\Parser\Cursor; -use League\CommonMark\Parser\MarkdownParserStateInterface; -use League\CommonMark\Reference\Reference; -use League\CommonMark\Util\RegexHelper; - -final class FootnoteStartParser implements BlockStartParserInterface -{ - public function tryStart(Cursor $cursor, MarkdownParserStateInterface $parserState): ?BlockStart - { - if ($cursor->isIndented() || $parserState->getLastMatchedBlockParser()->canHaveLazyContinuationLines()) { - return BlockStart::none(); - } - - $match = RegexHelper::matchFirst( - '/^\[\^([^\s^\]]+)\]\:(?:\s|$)/', - $cursor->getLine(), - $cursor->getNextNonSpacePosition() - ); - - if (! $match) { - return BlockStart::none(); - } - - $cursor->advanceToNextNonSpaceOrTab(); - $cursor->advanceBy(\strlen($match[0])); - $str = $cursor->getRemainder(); - \preg_replace('/^\[\^([^\s^\]]+)\]\:(?:\s|$)/', '', $str); - - if (\preg_match('/^\[\^([^\s^\]]+)\]\:(?:\s|$)/', $match[0], $matches) !== 1) { - return BlockStart::none(); - } - - $reference = new Reference($matches[1], $matches[1], $matches[1]); - $footnoteParser = new FootnoteParser($reference); - - return BlockStart::of($footnoteParser)->at($cursor); - } -} diff --git a/vendor/league/commonmark/src/Extension/Footnote/Renderer/FootnoteBackrefRenderer.php b/vendor/league/commonmark/src/Extension/Footnote/Renderer/FootnoteBackrefRenderer.php deleted file mode 100644 index 3b7bc3c2..00000000 --- a/vendor/league/commonmark/src/Extension/Footnote/Renderer/FootnoteBackrefRenderer.php +++ /dev/null @@ -1,81 +0,0 @@ -<?php - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * (c) Rezo Zero / Ambroise Maupate - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Extension\Footnote\Renderer; - -use League\CommonMark\Extension\Footnote\Node\FootnoteBackref; -use League\CommonMark\Node\Node; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\CommonMark\Util\HtmlElement; -use League\CommonMark\Xml\XmlNodeRendererInterface; -use League\Config\ConfigurationAwareInterface; -use League\Config\ConfigurationInterface; - -final class FootnoteBackrefRenderer implements NodeRendererInterface, XmlNodeRendererInterface, ConfigurationAwareInterface -{ - public const DEFAULT_SYMBOL = '↩'; - - private ConfigurationInterface $config; - - /** - * @param FootnoteBackref $node - * - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function render(Node $node, ChildNodeRendererInterface $childRenderer): string - { - FootnoteBackref::assertInstanceOf($node); - - $attrs = $node->data->getData('attributes'); - - $attrs->append('class', $this->config->get('footnote/backref_class')); - $attrs->set('rev', 'footnote'); - $attrs->set('href', \mb_strtolower($node->getReference()->getDestination(), 'UTF-8')); - $attrs->set('role', 'doc-backlink'); - - $symbol = $this->config->get('footnote/backref_symbol'); - \assert(\is_string($symbol)); - - return ' ' . new HtmlElement('a', $attrs->export(), \htmlspecialchars($symbol), true); - } - - public function setConfiguration(ConfigurationInterface $configuration): void - { - $this->config = $configuration; - } - - public function getXmlTagName(Node $node): string - { - return 'footnote_backref'; - } - - /** - * @param FootnoteBackref $node - * - * @return array<string, scalar> - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function getXmlAttributes(Node $node): array - { - FootnoteBackref::assertInstanceOf($node); - - return [ - 'reference' => $node->getReference()->getLabel(), - ]; - } -} diff --git a/vendor/league/commonmark/src/Extension/Footnote/Renderer/FootnoteContainerRenderer.php b/vendor/league/commonmark/src/Extension/Footnote/Renderer/FootnoteContainerRenderer.php deleted file mode 100644 index 74d35ef9..00000000 --- a/vendor/league/commonmark/src/Extension/Footnote/Renderer/FootnoteContainerRenderer.php +++ /dev/null @@ -1,71 +0,0 @@ -<?php - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * (c) Rezo Zero / Ambroise Maupate - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Extension\Footnote\Renderer; - -use League\CommonMark\Extension\Footnote\Node\FootnoteContainer; -use League\CommonMark\Node\Node; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\CommonMark\Util\HtmlElement; -use League\CommonMark\Xml\XmlNodeRendererInterface; -use League\Config\ConfigurationAwareInterface; -use League\Config\ConfigurationInterface; - -final class FootnoteContainerRenderer implements NodeRendererInterface, XmlNodeRendererInterface, ConfigurationAwareInterface -{ - private ConfigurationInterface $config; - - /** - * @param FootnoteContainer $node - * - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function render(Node $node, ChildNodeRendererInterface $childRenderer): \Stringable - { - FootnoteContainer::assertInstanceOf($node); - - $attrs = $node->data->getData('attributes'); - - $attrs->append('class', $this->config->get('footnote/container_class')); - $attrs->set('role', 'doc-endnotes'); - - $contents = new HtmlElement('ol', [], $childRenderer->renderNodes($node->children())); - if ($this->config->get('footnote/container_add_hr')) { - $contents = [new HtmlElement('hr', [], null, true), $contents]; - } - - return new HtmlElement('div', $attrs->export(), $contents); - } - - public function setConfiguration(ConfigurationInterface $configuration): void - { - $this->config = $configuration; - } - - public function getXmlTagName(Node $node): string - { - return 'footnote_container'; - } - - /** - * @return array<string, scalar> - */ - public function getXmlAttributes(Node $node): array - { - return []; - } -} diff --git a/vendor/league/commonmark/src/Extension/Footnote/Renderer/FootnoteRefRenderer.php b/vendor/league/commonmark/src/Extension/Footnote/Renderer/FootnoteRefRenderer.php deleted file mode 100644 index c0c07d7c..00000000 --- a/vendor/league/commonmark/src/Extension/Footnote/Renderer/FootnoteRefRenderer.php +++ /dev/null @@ -1,87 +0,0 @@ -<?php - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * (c) Rezo Zero / Ambroise Maupate - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Extension\Footnote\Renderer; - -use League\CommonMark\Extension\Footnote\Node\FootnoteRef; -use League\CommonMark\Node\Node; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\CommonMark\Util\HtmlElement; -use League\CommonMark\Xml\XmlNodeRendererInterface; -use League\Config\ConfigurationAwareInterface; -use League\Config\ConfigurationInterface; - -final class FootnoteRefRenderer implements NodeRendererInterface, XmlNodeRendererInterface, ConfigurationAwareInterface -{ - private ConfigurationInterface $config; - - /** - * @param FootnoteRef $node - * - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function render(Node $node, ChildNodeRendererInterface $childRenderer): \Stringable - { - FootnoteRef::assertInstanceOf($node); - - $attrs = $node->data->getData('attributes'); - $attrs->append('class', $this->config->get('footnote/ref_class')); - $attrs->set('href', \mb_strtolower($node->getReference()->getDestination(), 'UTF-8')); - $attrs->set('role', 'doc-noteref'); - - $idPrefix = $this->config->get('footnote/ref_id_prefix'); - - return new HtmlElement( - 'sup', - [ - 'id' => $idPrefix . \mb_strtolower($node->getReference()->getLabel(), 'UTF-8'), - ], - new HtmlElement( - 'a', - $attrs->export(), - $node->getReference()->getTitle() - ), - true - ); - } - - public function setConfiguration(ConfigurationInterface $configuration): void - { - $this->config = $configuration; - } - - public function getXmlTagName(Node $node): string - { - return 'footnote_ref'; - } - - /** - * @param FootnoteRef $node - * - * @return array<string, scalar> - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function getXmlAttributes(Node $node): array - { - FootnoteRef::assertInstanceOf($node); - - return [ - 'reference' => $node->getReference()->getLabel(), - ]; - } -} diff --git a/vendor/league/commonmark/src/Extension/Footnote/Renderer/FootnoteRenderer.php b/vendor/league/commonmark/src/Extension/Footnote/Renderer/FootnoteRenderer.php deleted file mode 100644 index cdd027e6..00000000 --- a/vendor/league/commonmark/src/Extension/Footnote/Renderer/FootnoteRenderer.php +++ /dev/null @@ -1,80 +0,0 @@ -<?php - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * (c) Rezo Zero / Ambroise Maupate - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Extension\Footnote\Renderer; - -use League\CommonMark\Extension\Footnote\Node\Footnote; -use League\CommonMark\Node\Node; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\CommonMark\Util\HtmlElement; -use League\CommonMark\Xml\XmlNodeRendererInterface; -use League\Config\ConfigurationAwareInterface; -use League\Config\ConfigurationInterface; - -final class FootnoteRenderer implements NodeRendererInterface, XmlNodeRendererInterface, ConfigurationAwareInterface -{ - private ConfigurationInterface $config; - - /** - * @param Footnote $node - * - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function render(Node $node, ChildNodeRendererInterface $childRenderer): \Stringable - { - Footnote::assertInstanceOf($node); - - $attrs = $node->data->getData('attributes'); - - $attrs->append('class', $this->config->get('footnote/footnote_class')); - $attrs->set('id', $this->config->get('footnote/footnote_id_prefix') . \mb_strtolower($node->getReference()->getLabel(), 'UTF-8')); - $attrs->set('role', 'doc-endnote'); - - return new HtmlElement( - 'li', - $attrs->export(), - $childRenderer->renderNodes($node->children()), - true - ); - } - - public function setConfiguration(ConfigurationInterface $configuration): void - { - $this->config = $configuration; - } - - public function getXmlTagName(Node $node): string - { - return 'footnote'; - } - - /** - * @param Footnote $node - * - * @return array<string, scalar> - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function getXmlAttributes(Node $node): array - { - Footnote::assertInstanceOf($node); - - return [ - 'reference' => $node->getReference()->getLabel(), - ]; - } -} diff --git a/vendor/league/commonmark/src/Extension/FrontMatter/Data/FrontMatterDataParserInterface.php b/vendor/league/commonmark/src/Extension/FrontMatter/Data/FrontMatterDataParserInterface.php deleted file mode 100644 index 9e3441f4..00000000 --- a/vendor/league/commonmark/src/Extension/FrontMatter/Data/FrontMatterDataParserInterface.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\FrontMatter\Data; - -use League\CommonMark\Extension\FrontMatter\Exception\InvalidFrontMatterException; - -interface FrontMatterDataParserInterface -{ - /** - * @return mixed|null The parsed data (which may be null, if the input represents a null value) - * - * @throws InvalidFrontMatterException if parsing fails - * @throws \RuntimeException if other errors occur - */ - public function parse(string $frontMatter); -} diff --git a/vendor/league/commonmark/src/Extension/FrontMatter/Data/LibYamlFrontMatterParser.php b/vendor/league/commonmark/src/Extension/FrontMatter/Data/LibYamlFrontMatterParser.php deleted file mode 100644 index 7384e37a..00000000 --- a/vendor/league/commonmark/src/Extension/FrontMatter/Data/LibYamlFrontMatterParser.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\FrontMatter\Data; - -use League\CommonMark\Extension\FrontMatter\Exception\InvalidFrontMatterException; - -final class LibYamlFrontMatterParser implements FrontMatterDataParserInterface -{ - public static function capable(): ?LibYamlFrontMatterParser - { - if (! \extension_loaded('yaml')) { - return null; - } - - return new LibYamlFrontMatterParser(); - } - - /** - * {@inheritDoc} - */ - public function parse(string $frontMatter) - { - if (! \extension_loaded('yaml')) { - throw new \RuntimeException('Failed to parse yaml: "ext-yaml" extension is missing'); - } - - $result = @\yaml_parse($frontMatter); - - if ($result === false) { - throw new InvalidFrontMatterException('Failed to parse front matter'); - } - - return $result; - } -} diff --git a/vendor/league/commonmark/src/Extension/FrontMatter/Data/SymfonyYamlFrontMatterParser.php b/vendor/league/commonmark/src/Extension/FrontMatter/Data/SymfonyYamlFrontMatterParser.php deleted file mode 100644 index 4a01c1eb..00000000 --- a/vendor/league/commonmark/src/Extension/FrontMatter/Data/SymfonyYamlFrontMatterParser.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\FrontMatter\Data; - -use League\CommonMark\Extension\FrontMatter\Exception\InvalidFrontMatterException; -use Symfony\Component\Yaml\Exception\ParseException; -use Symfony\Component\Yaml\Yaml; - -final class SymfonyYamlFrontMatterParser implements FrontMatterDataParserInterface -{ - /** - * {@inheritDoc} - */ - public function parse(string $frontMatter) - { - if (! \class_exists(Yaml::class)) { - throw new \RuntimeException('Failed to parse yaml: "symfony/yaml" library is missing'); - } - - try { - return Yaml::parse($frontMatter); - } catch (ParseException $ex) { - throw InvalidFrontMatterException::wrap($ex); - } - } -} diff --git a/vendor/league/commonmark/src/Extension/FrontMatter/Exception/InvalidFrontMatterException.php b/vendor/league/commonmark/src/Extension/FrontMatter/Exception/InvalidFrontMatterException.php deleted file mode 100644 index ca86f8ad..00000000 --- a/vendor/league/commonmark/src/Extension/FrontMatter/Exception/InvalidFrontMatterException.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Extension\FrontMatter\Exception; - -class InvalidFrontMatterException extends \RuntimeException -{ - public static function wrap(\Throwable $t): self - { - return new InvalidFrontMatterException('Failed to parse front matter: ' . $t->getMessage(), 0, $t); - } -} diff --git a/vendor/league/commonmark/src/Extension/FrontMatter/FrontMatterExtension.php b/vendor/league/commonmark/src/Extension/FrontMatter/FrontMatterExtension.php deleted file mode 100644 index 019ecb40..00000000 --- a/vendor/league/commonmark/src/Extension/FrontMatter/FrontMatterExtension.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\FrontMatter; - -use League\CommonMark\Environment\EnvironmentBuilderInterface; -use League\CommonMark\Event\DocumentPreParsedEvent; -use League\CommonMark\Event\DocumentRenderedEvent; -use League\CommonMark\Extension\ExtensionInterface; -use League\CommonMark\Extension\FrontMatter\Data\FrontMatterDataParserInterface; -use League\CommonMark\Extension\FrontMatter\Data\LibYamlFrontMatterParser; -use League\CommonMark\Extension\FrontMatter\Data\SymfonyYamlFrontMatterParser; -use League\CommonMark\Extension\FrontMatter\Listener\FrontMatterPostRenderListener; -use League\CommonMark\Extension\FrontMatter\Listener\FrontMatterPreParser; - -final class FrontMatterExtension implements ExtensionInterface -{ - /** @psalm-readonly */ - private FrontMatterParserInterface $frontMatterParser; - - public function __construct(?FrontMatterDataParserInterface $dataParser = null) - { - $this->frontMatterParser = new FrontMatterParser($dataParser ?? LibYamlFrontMatterParser::capable() ?? new SymfonyYamlFrontMatterParser()); - } - - public function getFrontMatterParser(): FrontMatterParserInterface - { - return $this->frontMatterParser; - } - - public function register(EnvironmentBuilderInterface $environment): void - { - $environment->addEventListener(DocumentPreParsedEvent::class, new FrontMatterPreParser($this->frontMatterParser)); - $environment->addEventListener(DocumentRenderedEvent::class, new FrontMatterPostRenderListener(), -500); - } -} diff --git a/vendor/league/commonmark/src/Extension/FrontMatter/FrontMatterParser.php b/vendor/league/commonmark/src/Extension/FrontMatter/FrontMatterParser.php deleted file mode 100644 index cbb42c2b..00000000 --- a/vendor/league/commonmark/src/Extension/FrontMatter/FrontMatterParser.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\FrontMatter; - -use League\CommonMark\Extension\FrontMatter\Data\FrontMatterDataParserInterface; -use League\CommonMark\Extension\FrontMatter\Input\MarkdownInputWithFrontMatter; -use League\CommonMark\Parser\Cursor; - -final class FrontMatterParser implements FrontMatterParserInterface -{ - /** @psalm-readonly */ - private FrontMatterDataParserInterface $frontMatterParser; - - private const REGEX_FRONT_MATTER = '/^---\\R.*?\\R---\\R/s'; - - public function __construct(FrontMatterDataParserInterface $frontMatterParser) - { - $this->frontMatterParser = $frontMatterParser; - } - - public function parse(string $markdownContent): MarkdownInputWithFrontMatter - { - $cursor = new Cursor($markdownContent); - - // Locate the front matter - $frontMatter = $cursor->match(self::REGEX_FRONT_MATTER); - if ($frontMatter === null) { - return new MarkdownInputWithFrontMatter($markdownContent); - } - - // Trim the last line (ending ---s and newline) - $frontMatter = \preg_replace('/---\R$/', '', $frontMatter); - if ($frontMatter === null) { - return new MarkdownInputWithFrontMatter($markdownContent); - } - - // Parse the resulting YAML data - $data = $this->frontMatterParser->parse($frontMatter); - - // Advance through any remaining newlines which separated the front matter from the Markdown text - $trailingNewlines = $cursor->match('/^\R+/'); - - // Calculate how many lines the Markdown is offset from the front matter by counting the number of newlines - // Don't forget to add 1 because we stripped one out when trimming the trailing delims - $lineOffset = \preg_match_all('/\R/', $frontMatter . $trailingNewlines) + 1; - - return new MarkdownInputWithFrontMatter($cursor->getRemainder(), $lineOffset, $data); - } -} diff --git a/vendor/league/commonmark/src/Extension/FrontMatter/FrontMatterParserInterface.php b/vendor/league/commonmark/src/Extension/FrontMatter/FrontMatterParserInterface.php deleted file mode 100644 index 197a33bb..00000000 --- a/vendor/league/commonmark/src/Extension/FrontMatter/FrontMatterParserInterface.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Extension\FrontMatter; - -use League\CommonMark\Extension\FrontMatter\Input\MarkdownInputWithFrontMatter; - -interface FrontMatterParserInterface -{ - public function parse(string $markdownContent): MarkdownInputWithFrontMatter; -} diff --git a/vendor/league/commonmark/src/Extension/FrontMatter/FrontMatterProviderInterface.php b/vendor/league/commonmark/src/Extension/FrontMatter/FrontMatterProviderInterface.php deleted file mode 100644 index b5a72784..00000000 --- a/vendor/league/commonmark/src/Extension/FrontMatter/FrontMatterProviderInterface.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Extension\FrontMatter; - -interface FrontMatterProviderInterface -{ - /** - * @return mixed|null - */ - public function getFrontMatter(); -} diff --git a/vendor/league/commonmark/src/Extension/FrontMatter/Input/MarkdownInputWithFrontMatter.php b/vendor/league/commonmark/src/Extension/FrontMatter/Input/MarkdownInputWithFrontMatter.php deleted file mode 100644 index 86c982b1..00000000 --- a/vendor/league/commonmark/src/Extension/FrontMatter/Input/MarkdownInputWithFrontMatter.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Extension\FrontMatter\Input; - -use League\CommonMark\Extension\FrontMatter\FrontMatterProviderInterface; -use League\CommonMark\Input\MarkdownInput; - -final class MarkdownInputWithFrontMatter extends MarkdownInput implements FrontMatterProviderInterface -{ - /** @var mixed|null */ - private $frontMatter; - - /** - * @param string $content Markdown content without the raw front matter - * @param int $lineOffset Line offset (based on number of front matter lines removed) - * @param mixed|null $frontMatter Parsed front matter - */ - public function __construct(string $content, int $lineOffset = 0, $frontMatter = null) - { - parent::__construct($content, $lineOffset); - - $this->frontMatter = $frontMatter; - } - - /** - * {@inheritDoc} - */ - public function getFrontMatter() - { - return $this->frontMatter; - } -} diff --git a/vendor/league/commonmark/src/Extension/FrontMatter/Listener/FrontMatterPostRenderListener.php b/vendor/league/commonmark/src/Extension/FrontMatter/Listener/FrontMatterPostRenderListener.php deleted file mode 100644 index 14b71917..00000000 --- a/vendor/league/commonmark/src/Extension/FrontMatter/Listener/FrontMatterPostRenderListener.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Extension\FrontMatter\Listener; - -use League\CommonMark\Event\DocumentRenderedEvent; -use League\CommonMark\Extension\FrontMatter\Output\RenderedContentWithFrontMatter; - -final class FrontMatterPostRenderListener -{ - public function __invoke(DocumentRenderedEvent $event): void - { - if ($event->getOutput()->getDocument()->data->get('front_matter', null) === null) { - return; - } - - $frontMatter = $event->getOutput()->getDocument()->data->get('front_matter'); - - $event->replaceOutput(new RenderedContentWithFrontMatter( - $event->getOutput()->getDocument(), - $event->getOutput()->getContent(), - $frontMatter - )); - } -} diff --git a/vendor/league/commonmark/src/Extension/FrontMatter/Listener/FrontMatterPreParser.php b/vendor/league/commonmark/src/Extension/FrontMatter/Listener/FrontMatterPreParser.php deleted file mode 100644 index b0afbeea..00000000 --- a/vendor/league/commonmark/src/Extension/FrontMatter/Listener/FrontMatterPreParser.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Extension\FrontMatter\Listener; - -use League\CommonMark\Event\DocumentPreParsedEvent; -use League\CommonMark\Extension\FrontMatter\FrontMatterParserInterface; - -final class FrontMatterPreParser -{ - private FrontMatterParserInterface $parser; - - public function __construct(FrontMatterParserInterface $parser) - { - $this->parser = $parser; - } - - public function __invoke(DocumentPreParsedEvent $event): void - { - $content = $event->getMarkdown()->getContent(); - - $parsed = $this->parser->parse($content); - - $event->getDocument()->data->set('front_matter', $parsed->getFrontMatter()); - $event->replaceMarkdown($parsed); - } -} diff --git a/vendor/league/commonmark/src/Extension/FrontMatter/Output/RenderedContentWithFrontMatter.php b/vendor/league/commonmark/src/Extension/FrontMatter/Output/RenderedContentWithFrontMatter.php deleted file mode 100644 index efaa3428..00000000 --- a/vendor/league/commonmark/src/Extension/FrontMatter/Output/RenderedContentWithFrontMatter.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Extension\FrontMatter\Output; - -use League\CommonMark\Extension\FrontMatter\FrontMatterProviderInterface; -use League\CommonMark\Node\Block\Document; -use League\CommonMark\Output\RenderedContent; - -/** - * @psalm-immutable - */ -final class RenderedContentWithFrontMatter extends RenderedContent implements FrontMatterProviderInterface -{ - /** - * @var mixed - * - * @psalm-readonly - */ - private $frontMatter; - - /** - * @param Document $document The parsed Document object - * @param string $content The final HTML - * @param mixed|null $frontMatter Any parsed front matter - */ - public function __construct(Document $document, string $content, $frontMatter) - { - parent::__construct($document, $content); - - $this->frontMatter = $frontMatter; - } - - /** - * {@inheritDoc} - */ - public function getFrontMatter() - { - return $this->frontMatter; - } -} diff --git a/vendor/league/commonmark/src/Extension/GithubFlavoredMarkdownExtension.php b/vendor/league/commonmark/src/Extension/GithubFlavoredMarkdownExtension.php deleted file mode 100644 index b3920aa5..00000000 --- a/vendor/league/commonmark/src/Extension/GithubFlavoredMarkdownExtension.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension; - -use League\CommonMark\Environment\EnvironmentBuilderInterface; -use League\CommonMark\Extension\Autolink\AutolinkExtension; -use League\CommonMark\Extension\DisallowedRawHtml\DisallowedRawHtmlExtension; -use League\CommonMark\Extension\Strikethrough\StrikethroughExtension; -use League\CommonMark\Extension\Table\TableExtension; -use League\CommonMark\Extension\TaskList\TaskListExtension; - -final class GithubFlavoredMarkdownExtension implements ExtensionInterface -{ - public function register(EnvironmentBuilderInterface $environment): void - { - $environment->addExtension(new AutolinkExtension()); - $environment->addExtension(new DisallowedRawHtmlExtension()); - $environment->addExtension(new StrikethroughExtension()); - $environment->addExtension(new TableExtension()); - $environment->addExtension(new TaskListExtension()); - } -} diff --git a/vendor/league/commonmark/src/Extension/HeadingPermalink/HeadingPermalink.php b/vendor/league/commonmark/src/Extension/HeadingPermalink/HeadingPermalink.php deleted file mode 100644 index df9bded0..00000000 --- a/vendor/league/commonmark/src/Extension/HeadingPermalink/HeadingPermalink.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\HeadingPermalink; - -use League\CommonMark\Node\Inline\AbstractInline; - -/** - * Represents an anchor link within a heading - */ -final class HeadingPermalink extends AbstractInline -{ - /** @psalm-readonly */ - private string $slug; - - public function __construct(string $slug) - { - parent::__construct(); - - $this->slug = $slug; - } - - public function getSlug(): string - { - return $this->slug; - } -} diff --git a/vendor/league/commonmark/src/Extension/HeadingPermalink/HeadingPermalinkExtension.php b/vendor/league/commonmark/src/Extension/HeadingPermalink/HeadingPermalinkExtension.php deleted file mode 100644 index 1f7d3864..00000000 --- a/vendor/league/commonmark/src/Extension/HeadingPermalink/HeadingPermalinkExtension.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\HeadingPermalink; - -use League\CommonMark\Environment\EnvironmentBuilderInterface; -use League\CommonMark\Event\DocumentParsedEvent; -use League\CommonMark\Extension\ConfigurableExtensionInterface; -use League\Config\ConfigurationBuilderInterface; -use Nette\Schema\Expect; - -/** - * Extension which automatically anchor links to heading elements - */ -final class HeadingPermalinkExtension implements ConfigurableExtensionInterface -{ - public function configureSchema(ConfigurationBuilderInterface $builder): void - { - $builder->addSchema('heading_permalink', Expect::structure([ - 'min_heading_level' => Expect::int()->min(1)->max(6)->default(1), - 'max_heading_level' => Expect::int()->min(1)->max(6)->default(6), - 'insert' => Expect::anyOf(HeadingPermalinkProcessor::INSERT_BEFORE, HeadingPermalinkProcessor::INSERT_AFTER)->default(HeadingPermalinkProcessor::INSERT_BEFORE), - 'id_prefix' => Expect::string()->default('content'), - 'fragment_prefix' => Expect::string()->default('content'), - 'html_class' => Expect::string()->default('heading-permalink'), - 'title' => Expect::string()->default('Permalink'), - 'symbol' => Expect::string()->default(HeadingPermalinkRenderer::DEFAULT_SYMBOL), - 'aria_hidden' => Expect::bool()->default(true), - ])); - } - - public function register(EnvironmentBuilderInterface $environment): void - { - $environment->addEventListener(DocumentParsedEvent::class, new HeadingPermalinkProcessor(), -100); - $environment->addRenderer(HeadingPermalink::class, new HeadingPermalinkRenderer()); - } -} diff --git a/vendor/league/commonmark/src/Extension/HeadingPermalink/HeadingPermalinkProcessor.php b/vendor/league/commonmark/src/Extension/HeadingPermalink/HeadingPermalinkProcessor.php deleted file mode 100644 index fc821c89..00000000 --- a/vendor/league/commonmark/src/Extension/HeadingPermalink/HeadingPermalinkProcessor.php +++ /dev/null @@ -1,83 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\HeadingPermalink; - -use League\CommonMark\Environment\EnvironmentAwareInterface; -use League\CommonMark\Environment\EnvironmentInterface; -use League\CommonMark\Event\DocumentParsedEvent; -use League\CommonMark\Extension\CommonMark\Node\Block\Heading; -use League\CommonMark\Node\NodeIterator; -use League\CommonMark\Node\RawMarkupContainerInterface; -use League\CommonMark\Node\StringContainerHelper; -use League\CommonMark\Normalizer\TextNormalizerInterface; -use League\Config\ConfigurationInterface; - -/** - * Searches the Document for Heading elements and adds HeadingPermalinks to each one - */ -final class HeadingPermalinkProcessor implements EnvironmentAwareInterface -{ - public const INSERT_BEFORE = 'before'; - public const INSERT_AFTER = 'after'; - - /** @psalm-readonly-allow-private-mutation */ - private TextNormalizerInterface $slugNormalizer; - - /** @psalm-readonly-allow-private-mutation */ - private ConfigurationInterface $config; - - public function setEnvironment(EnvironmentInterface $environment): void - { - $this->config = $environment->getConfiguration(); - $this->slugNormalizer = $environment->getSlugNormalizer(); - } - - public function __invoke(DocumentParsedEvent $e): void - { - $min = (int) $this->config->get('heading_permalink/min_heading_level'); - $max = (int) $this->config->get('heading_permalink/max_heading_level'); - - $slugLength = (int) $this->config->get('slug_normalizer/max_length'); - - foreach ($e->getDocument()->iterator(NodeIterator::FLAG_BLOCKS_ONLY) as $node) { - if ($node instanceof Heading && $node->getLevel() >= $min && $node->getLevel() <= $max) { - $this->addHeadingLink($node, $slugLength); - } - } - } - - private function addHeadingLink(Heading $heading, int $slugLength): void - { - $text = StringContainerHelper::getChildText($heading, [RawMarkupContainerInterface::class]); - $slug = $this->slugNormalizer->normalize($text, [ - 'node' => $heading, - 'length' => $slugLength, - ]); - - $headingLinkAnchor = new HeadingPermalink($slug); - - switch ($this->config->get('heading_permalink/insert')) { - case self::INSERT_BEFORE: - $heading->prependChild($headingLinkAnchor); - - return; - case self::INSERT_AFTER: - $heading->appendChild($headingLinkAnchor); - - return; - default: - throw new \RuntimeException("Invalid configuration value for heading_permalink/insert; expected 'before' or 'after'"); - } - } -} diff --git a/vendor/league/commonmark/src/Extension/HeadingPermalink/HeadingPermalinkRenderer.php b/vendor/league/commonmark/src/Extension/HeadingPermalink/HeadingPermalinkRenderer.php deleted file mode 100644 index 7cc872e5..00000000 --- a/vendor/league/commonmark/src/Extension/HeadingPermalink/HeadingPermalinkRenderer.php +++ /dev/null @@ -1,100 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\HeadingPermalink; - -use League\CommonMark\Node\Node; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\CommonMark\Util\HtmlElement; -use League\CommonMark\Xml\XmlNodeRendererInterface; -use League\Config\ConfigurationAwareInterface; -use League\Config\ConfigurationInterface; - -/** - * Renders the HeadingPermalink elements - */ -final class HeadingPermalinkRenderer implements NodeRendererInterface, XmlNodeRendererInterface, ConfigurationAwareInterface -{ - public const DEFAULT_SYMBOL = '¶'; - - /** @psalm-readonly-allow-private-mutation */ - private ConfigurationInterface $config; - - public function setConfiguration(ConfigurationInterface $configuration): void - { - $this->config = $configuration; - } - - /** - * @param HeadingPermalink $node - * - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function render(Node $node, ChildNodeRendererInterface $childRenderer): \Stringable - { - HeadingPermalink::assertInstanceOf($node); - - $slug = $node->getSlug(); - - $idPrefix = (string) $this->config->get('heading_permalink/id_prefix'); - if ($idPrefix !== '') { - $idPrefix .= '-'; - } - - $fragmentPrefix = (string) $this->config->get('heading_permalink/fragment_prefix'); - if ($fragmentPrefix !== '') { - $fragmentPrefix .= '-'; - } - - $attrs = $node->data->getData('attributes'); - $attrs->set('id', $idPrefix . $slug); - $attrs->set('href', '#' . $fragmentPrefix . $slug); - $attrs->append('class', $this->config->get('heading_permalink/html_class')); - - $hidden = $this->config->get('heading_permalink/aria_hidden'); - if ($hidden) { - $attrs->set('aria-hidden', 'true'); - } - - $attrs->set('title', $this->config->get('heading_permalink/title')); - - $symbol = $this->config->get('heading_permalink/symbol'); - \assert(\is_string($symbol)); - - return new HtmlElement('a', $attrs->export(), \htmlspecialchars($symbol), false); - } - - public function getXmlTagName(Node $node): string - { - return 'heading_permalink'; - } - - /** - * @param HeadingPermalink $node - * - * @return array<string, scalar> - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function getXmlAttributes(Node $node): array - { - HeadingPermalink::assertInstanceOf($node); - - return [ - 'slug' => $node->getSlug(), - ]; - } -} diff --git a/vendor/league/commonmark/src/Extension/InlinesOnly/ChildRenderer.php b/vendor/league/commonmark/src/Extension/InlinesOnly/ChildRenderer.php deleted file mode 100644 index 403e948e..00000000 --- a/vendor/league/commonmark/src/Extension/InlinesOnly/ChildRenderer.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\InlinesOnly; - -use League\CommonMark\Node\Block\Document; -use League\CommonMark\Node\Node; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; - -/** - * Simply renders child elements as-is, adding newlines as needed. - */ -final class ChildRenderer implements NodeRendererInterface -{ - public function render(Node $node, ChildNodeRendererInterface $childRenderer): string - { - $out = $childRenderer->renderNodes($node->children()); - if (! $node instanceof Document) { - $out .= $childRenderer->getBlockSeparator(); - } - - return $out; - } -} diff --git a/vendor/league/commonmark/src/Extension/InlinesOnly/InlinesOnlyExtension.php b/vendor/league/commonmark/src/Extension/InlinesOnly/InlinesOnlyExtension.php deleted file mode 100644 index 7777510e..00000000 --- a/vendor/league/commonmark/src/Extension/InlinesOnly/InlinesOnlyExtension.php +++ /dev/null @@ -1,73 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\InlinesOnly; - -use League\CommonMark as Core; -use League\CommonMark\Environment\EnvironmentBuilderInterface; -use League\CommonMark\Extension\CommonMark; -use League\CommonMark\Extension\CommonMark\Delimiter\Processor\EmphasisDelimiterProcessor; -use League\CommonMark\Extension\ConfigurableExtensionInterface; -use League\Config\ConfigurationBuilderInterface; -use Nette\Schema\Expect; - -final class InlinesOnlyExtension implements ConfigurableExtensionInterface -{ - public function configureSchema(ConfigurationBuilderInterface $builder): void - { - $builder->addSchema('commonmark', Expect::structure([ - 'use_asterisk' => Expect::bool(true), - 'use_underscore' => Expect::bool(true), - 'enable_strong' => Expect::bool(true), - 'enable_em' => Expect::bool(true), - ])); - } - - // phpcs:disable Generic.Functions.FunctionCallArgumentSpacing.TooMuchSpaceAfterComma,Squiz.WhiteSpace.SemicolonSpacing.Incorrect - public function register(EnvironmentBuilderInterface $environment): void - { - $childRenderer = new ChildRenderer(); - - $environment - ->addInlineParser(new Core\Parser\Inline\NewlineParser(), 200) - ->addInlineParser(new CommonMark\Parser\Inline\BacktickParser(), 150) - ->addInlineParser(new CommonMark\Parser\Inline\EscapableParser(), 80) - ->addInlineParser(new CommonMark\Parser\Inline\EntityParser(), 70) - ->addInlineParser(new CommonMark\Parser\Inline\AutolinkParser(), 50) - ->addInlineParser(new CommonMark\Parser\Inline\HtmlInlineParser(), 40) - ->addInlineParser(new CommonMark\Parser\Inline\CloseBracketParser(), 30) - ->addInlineParser(new CommonMark\Parser\Inline\OpenBracketParser(), 20) - ->addInlineParser(new CommonMark\Parser\Inline\BangParser(), 10) - - ->addRenderer(Core\Node\Block\Document::class, $childRenderer, 0) - ->addRenderer(Core\Node\Block\Paragraph::class, $childRenderer, 0) - - ->addRenderer(CommonMark\Node\Inline\Code::class, new CommonMark\Renderer\Inline\CodeRenderer(), 0) - ->addRenderer(CommonMark\Node\Inline\Emphasis::class, new CommonMark\Renderer\Inline\EmphasisRenderer(), 0) - ->addRenderer(CommonMark\Node\Inline\HtmlInline::class, new CommonMark\Renderer\Inline\HtmlInlineRenderer(), 0) - ->addRenderer(CommonMark\Node\Inline\Image::class, new CommonMark\Renderer\Inline\ImageRenderer(), 0) - ->addRenderer(CommonMark\Node\Inline\Link::class, new CommonMark\Renderer\Inline\LinkRenderer(), 0) - ->addRenderer(Core\Node\Inline\Newline::class, new Core\Renderer\Inline\NewlineRenderer(), 0) - ->addRenderer(CommonMark\Node\Inline\Strong::class, new CommonMark\Renderer\Inline\StrongRenderer(), 0) - ->addRenderer(Core\Node\Inline\Text::class, new Core\Renderer\Inline\TextRenderer(), 0) - ; - - if ($environment->getConfiguration()->get('commonmark/use_asterisk')) { - $environment->addDelimiterProcessor(new EmphasisDelimiterProcessor('*')); - } - - if ($environment->getConfiguration()->get('commonmark/use_underscore')) { - $environment->addDelimiterProcessor(new EmphasisDelimiterProcessor('_')); - } - } -} diff --git a/vendor/league/commonmark/src/Extension/Mention/Generator/CallbackGenerator.php b/vendor/league/commonmark/src/Extension/Mention/Generator/CallbackGenerator.php deleted file mode 100644 index 025d0702..00000000 --- a/vendor/league/commonmark/src/Extension/Mention/Generator/CallbackGenerator.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\Mention\Generator; - -use League\CommonMark\Extension\Mention\Mention; -use League\CommonMark\Node\Inline\AbstractInline; - -final class CallbackGenerator implements MentionGeneratorInterface -{ - /** - * A callback function which sets the URL on the passed mention and returns the mention, return a new AbstractInline based object or null if the mention is not a match - * - * @var callable(Mention): ?AbstractInline - */ - private $callback; - - public function __construct(callable $callback) - { - $this->callback = $callback; - } - - public function generateMention(Mention $mention): ?AbstractInline - { - $result = \call_user_func($this->callback, $mention); - if ($result === null) { - return null; - } - - if ($result instanceof AbstractInline && ! ($result instanceof Mention)) { - return $result; - } - - if ($result instanceof Mention && $result->hasUrl()) { - return $mention; - } - - throw new \RuntimeException('CallbackGenerator callable must set the URL on the passed mention and return the mention, return a new AbstractInline based object or null if the mention is not a match'); - } -} diff --git a/vendor/league/commonmark/src/Extension/Mention/Generator/MentionGeneratorInterface.php b/vendor/league/commonmark/src/Extension/Mention/Generator/MentionGeneratorInterface.php deleted file mode 100644 index 30d4a510..00000000 --- a/vendor/league/commonmark/src/Extension/Mention/Generator/MentionGeneratorInterface.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\Mention\Generator; - -use League\CommonMark\Extension\Mention\Mention; -use League\CommonMark\Node\Inline\AbstractInline; - -interface MentionGeneratorInterface -{ - public function generateMention(Mention $mention): ?AbstractInline; -} diff --git a/vendor/league/commonmark/src/Extension/Mention/Generator/StringTemplateLinkGenerator.php b/vendor/league/commonmark/src/Extension/Mention/Generator/StringTemplateLinkGenerator.php deleted file mode 100644 index 5d92897c..00000000 --- a/vendor/league/commonmark/src/Extension/Mention/Generator/StringTemplateLinkGenerator.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\Mention\Generator; - -use League\CommonMark\Extension\Mention\Mention; -use League\CommonMark\Node\Inline\AbstractInline; - -final class StringTemplateLinkGenerator implements MentionGeneratorInterface -{ - private string $urlTemplate; - - public function __construct(string $urlTemplate) - { - $this->urlTemplate = $urlTemplate; - } - - public function generateMention(Mention $mention): ?AbstractInline - { - $mention->setUrl(\sprintf($this->urlTemplate, $mention->getIdentifier())); - - return $mention; - } -} diff --git a/vendor/league/commonmark/src/Extension/Mention/Mention.php b/vendor/league/commonmark/src/Extension/Mention/Mention.php deleted file mode 100644 index 74eaee47..00000000 --- a/vendor/league/commonmark/src/Extension/Mention/Mention.php +++ /dev/null @@ -1,93 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\Mention; - -use League\CommonMark\Extension\CommonMark\Node\Inline\Link; -use League\CommonMark\Node\Inline\Text; - -class Mention extends Link -{ - private string $name; - - private string $prefix; - - private string $identifier; - - public function __construct(string $name, string $prefix, string $identifier, ?string $label = null) - { - $this->name = $name; - $this->prefix = $prefix; - $this->identifier = $identifier; - - parent::__construct('', $label ?? \sprintf('%s%s', $prefix, $identifier)); - } - - public function getLabel(): ?string - { - if (($labelNode = $this->findLabelNode()) === null) { - return null; - } - - return $labelNode->getLiteral(); - } - - public function getIdentifier(): string - { - return $this->identifier; - } - - public function getName(): ?string - { - return $this->name; - } - - public function getPrefix(): string - { - return $this->prefix; - } - - public function hasUrl(): bool - { - return $this->url !== ''; - } - - /** - * @return $this - */ - public function setLabel(string $label): self - { - if (($labelNode = $this->findLabelNode()) === null) { - $labelNode = new Text(); - $this->prependChild($labelNode); - } - - $labelNode->setLiteral($label); - - return $this; - } - - private function findLabelNode(): ?Text - { - foreach ($this->children() as $child) { - if ($child instanceof Text) { - return $child; - } - } - - return null; - } -} diff --git a/vendor/league/commonmark/src/Extension/Mention/MentionExtension.php b/vendor/league/commonmark/src/Extension/Mention/MentionExtension.php deleted file mode 100644 index c848c269..00000000 --- a/vendor/league/commonmark/src/Extension/Mention/MentionExtension.php +++ /dev/null @@ -1,61 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\Mention; - -use League\CommonMark\Environment\EnvironmentBuilderInterface; -use League\CommonMark\Extension\ConfigurableExtensionInterface; -use League\CommonMark\Extension\Mention\Generator\MentionGeneratorInterface; -use League\Config\ConfigurationBuilderInterface; -use League\Config\Exception\InvalidConfigurationException; -use Nette\Schema\Expect; - -final class MentionExtension implements ConfigurableExtensionInterface -{ - public function configureSchema(ConfigurationBuilderInterface $builder): void - { - $isAValidPartialRegex = static function (string $regex): bool { - $regex = '/' . $regex . '/i'; - - return @\preg_match($regex, '') !== false; - }; - - $builder->addSchema('mentions', Expect::arrayOf( - Expect::structure([ - 'prefix' => Expect::string()->required(), - 'pattern' => Expect::string()->assert($isAValidPartialRegex, 'Pattern must not include starting/ending delimiters (like "/")')->required(), - 'generator' => Expect::anyOf( - Expect::type(MentionGeneratorInterface::class), - Expect::string(), - Expect::type('callable') - )->required(), - ]) - )); - } - - public function register(EnvironmentBuilderInterface $environment): void - { - $mentions = $environment->getConfiguration()->get('mentions'); - foreach ($mentions as $name => $mention) { - if ($mention['generator'] instanceof MentionGeneratorInterface) { - $environment->addInlineParser(new MentionParser($name, $mention['prefix'], $mention['pattern'], $mention['generator'])); - } elseif (\is_string($mention['generator'])) { - $environment->addInlineParser(MentionParser::createWithStringTemplate($name, $mention['prefix'], $mention['pattern'], $mention['generator'])); - } elseif (\is_callable($mention['generator'])) { - $environment->addInlineParser(MentionParser::createWithCallback($name, $mention['prefix'], $mention['pattern'], $mention['generator'])); - } else { - throw new InvalidConfigurationException(\sprintf('The "generator" provided for the "%s" MentionParser configuration must be a string template, callable, or an object that implements %s.', $name, MentionGeneratorInterface::class)); - } - } - } -} diff --git a/vendor/league/commonmark/src/Extension/Mention/MentionParser.php b/vendor/league/commonmark/src/Extension/Mention/MentionParser.php deleted file mode 100644 index a81c787d..00000000 --- a/vendor/league/commonmark/src/Extension/Mention/MentionParser.php +++ /dev/null @@ -1,87 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\Mention; - -use League\CommonMark\Extension\Mention\Generator\CallbackGenerator; -use League\CommonMark\Extension\Mention\Generator\MentionGeneratorInterface; -use League\CommonMark\Extension\Mention\Generator\StringTemplateLinkGenerator; -use League\CommonMark\Parser\Inline\InlineParserInterface; -use League\CommonMark\Parser\Inline\InlineParserMatch; -use League\CommonMark\Parser\InlineParserContext; - -final class MentionParser implements InlineParserInterface -{ - /** @psalm-readonly */ - private string $name; - - /** @psalm-readonly */ - private string $prefix; - - /** @psalm-readonly */ - private string $identifierPattern; - - /** @psalm-readonly */ - private MentionGeneratorInterface $mentionGenerator; - - public function __construct(string $name, string $prefix, string $identifierPattern, MentionGeneratorInterface $mentionGenerator) - { - $this->name = $name; - $this->prefix = $prefix; - $this->identifierPattern = $identifierPattern; - $this->mentionGenerator = $mentionGenerator; - } - - public function getMatchDefinition(): InlineParserMatch - { - return InlineParserMatch::join( - InlineParserMatch::string($this->prefix), - InlineParserMatch::regex($this->identifierPattern) - ); - } - - public function parse(InlineParserContext $inlineContext): bool - { - $cursor = $inlineContext->getCursor(); - - // The prefix must not have any other characters immediately prior - $previousChar = $cursor->peek(-1); - if ($previousChar !== null && \preg_match('/\w/', $previousChar)) { - // peek() doesn't modify the cursor, so no need to restore state first - return false; - } - - [$prefix, $identifier] = $inlineContext->getSubMatches(); - - $mention = $this->mentionGenerator->generateMention(new Mention($this->name, $prefix, $identifier)); - - if ($mention === null) { - return false; - } - - $cursor->advanceBy($inlineContext->getFullMatchLength()); - $inlineContext->getContainer()->appendChild($mention); - - return true; - } - - public static function createWithStringTemplate(string $name, string $prefix, string $mentionRegex, string $urlTemplate): MentionParser - { - return new self($name, $prefix, $mentionRegex, new StringTemplateLinkGenerator($urlTemplate)); - } - - public static function createWithCallback(string $name, string $prefix, string $mentionRegex, callable $callback): MentionParser - { - return new self($name, $prefix, $mentionRegex, new CallbackGenerator($callback)); - } -} diff --git a/vendor/league/commonmark/src/Extension/SmartPunct/DashParser.php b/vendor/league/commonmark/src/Extension/SmartPunct/DashParser.php deleted file mode 100644 index cf0e1af6..00000000 --- a/vendor/league/commonmark/src/Extension/SmartPunct/DashParser.php +++ /dev/null @@ -1,59 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (http://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\SmartPunct; - -use League\CommonMark\Node\Inline\Text; -use League\CommonMark\Parser\Inline\InlineParserInterface; -use League\CommonMark\Parser\Inline\InlineParserMatch; -use League\CommonMark\Parser\InlineParserContext; - -final class DashParser implements InlineParserInterface -{ - private const EN_DASH = '–'; - private const EM_DASH = '—'; - - public function getMatchDefinition(): InlineParserMatch - { - return InlineParserMatch::regex('(?<!-)(-{2,})'); - } - - public function parse(InlineParserContext $inlineContext): bool - { - $count = $inlineContext->getFullMatchLength(); - $inlineContext->getCursor()->advanceBy($count); - - $enCount = 0; - $emCount = 0; - if ($count % 3 === 0) { // If divisible by 3, use all em dashes - $emCount = (int) ($count / 3); - } elseif ($count % 2 === 0) { // If divisible by 2, use all en dashes - $enCount = (int) ($count / 2); - } elseif ($count % 3 === 2) { // If 2 extra dashes, use en dash for last 2; em dashes for rest - $emCount = (int) (($count - 2) / 3); - $enCount = 1; - } else { // Use en dashes for last 4 hyphens; em dashes for rest - $emCount = (int) (($count - 4) / 3); - $enCount = 2; - } - - $inlineContext->getContainer()->appendChild(new Text( - \str_repeat(self::EM_DASH, $emCount) . \str_repeat(self::EN_DASH, $enCount) - )); - - return true; - } -} diff --git a/vendor/league/commonmark/src/Extension/SmartPunct/EllipsesParser.php b/vendor/league/commonmark/src/Extension/SmartPunct/EllipsesParser.php deleted file mode 100644 index 9f5b3bdb..00000000 --- a/vendor/league/commonmark/src/Extension/SmartPunct/EllipsesParser.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (http://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\SmartPunct; - -use League\CommonMark\Node\Inline\Text; -use League\CommonMark\Parser\Inline\InlineParserInterface; -use League\CommonMark\Parser\Inline\InlineParserMatch; -use League\CommonMark\Parser\InlineParserContext; - -final class EllipsesParser implements InlineParserInterface -{ - public function getMatchDefinition(): InlineParserMatch - { - return InlineParserMatch::oneOf('...', '. . .'); - } - - public function parse(InlineParserContext $inlineContext): bool - { - $inlineContext->getCursor()->advanceBy($inlineContext->getFullMatchLength()); - $inlineContext->getContainer()->appendChild(new Text('…')); - - return true; - } -} diff --git a/vendor/league/commonmark/src/Extension/SmartPunct/Quote.php b/vendor/league/commonmark/src/Extension/SmartPunct/Quote.php deleted file mode 100644 index dee97592..00000000 --- a/vendor/league/commonmark/src/Extension/SmartPunct/Quote.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (http://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\SmartPunct; - -use League\CommonMark\Node\Inline\AbstractStringContainer; - -final class Quote extends AbstractStringContainer -{ - public const DOUBLE_QUOTE = '"'; - public const DOUBLE_QUOTE_OPENER = '“'; - public const DOUBLE_QUOTE_CLOSER = '”'; - - public const SINGLE_QUOTE = "'"; - public const SINGLE_QUOTE_OPENER = '‘'; - public const SINGLE_QUOTE_CLOSER = '’'; -} diff --git a/vendor/league/commonmark/src/Extension/SmartPunct/QuoteParser.php b/vendor/league/commonmark/src/Extension/SmartPunct/QuoteParser.php deleted file mode 100644 index 97c9d1a4..00000000 --- a/vendor/league/commonmark/src/Extension/SmartPunct/QuoteParser.php +++ /dev/null @@ -1,105 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (http://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\SmartPunct; - -use League\CommonMark\Delimiter\Delimiter; -use League\CommonMark\Parser\Inline\InlineParserInterface; -use League\CommonMark\Parser\Inline\InlineParserMatch; -use League\CommonMark\Parser\InlineParserContext; -use League\CommonMark\Util\RegexHelper; - -final class QuoteParser implements InlineParserInterface -{ - public const DOUBLE_QUOTES = [Quote::DOUBLE_QUOTE, Quote::DOUBLE_QUOTE_OPENER, Quote::DOUBLE_QUOTE_CLOSER]; - public const SINGLE_QUOTES = [Quote::SINGLE_QUOTE, Quote::SINGLE_QUOTE_OPENER, Quote::SINGLE_QUOTE_CLOSER]; - - public function getMatchDefinition(): InlineParserMatch - { - return InlineParserMatch::oneOf(...\array_merge(self::DOUBLE_QUOTES, self::SINGLE_QUOTES)); - } - - /** - * Normalizes any quote characters found and manually adds them to the delimiter stack - */ - public function parse(InlineParserContext $inlineContext): bool - { - $char = $inlineContext->getFullMatch(); - $cursor = $inlineContext->getCursor(); - - $normalizedCharacter = $this->getNormalizedQuoteCharacter($char); - - $charBefore = $cursor->peek(-1); - if ($charBefore === null) { - $charBefore = "\n"; - } - - $cursor->advance(); - - $charAfter = $cursor->getCurrentCharacter(); - if ($charAfter === null) { - $charAfter = "\n"; - } - - [$leftFlanking, $rightFlanking] = $this->determineFlanking($charBefore, $charAfter); - $canOpen = $leftFlanking && ! $rightFlanking; - $canClose = $rightFlanking; - - $node = new Quote($normalizedCharacter, ['delim' => true]); - $inlineContext->getContainer()->appendChild($node); - - // Add entry to stack to this opener - $inlineContext->getDelimiterStack()->push(new Delimiter($normalizedCharacter, 1, $node, $canOpen, $canClose)); - - return true; - } - - private function getNormalizedQuoteCharacter(string $character): string - { - if (\in_array($character, self::DOUBLE_QUOTES, true)) { - return Quote::DOUBLE_QUOTE; - } - - if (\in_array($character, self::SINGLE_QUOTES, true)) { - return Quote::SINGLE_QUOTE; - } - - return $character; - } - - /** - * @return bool[] - */ - private function determineFlanking(string $charBefore, string $charAfter): array - { - $afterIsWhitespace = \preg_match('/\pZ|\s/u', $charAfter); - $afterIsPunctuation = \preg_match(RegexHelper::REGEX_PUNCTUATION, $charAfter); - $beforeIsWhitespace = \preg_match('/\pZ|\s/u', $charBefore); - $beforeIsPunctuation = \preg_match(RegexHelper::REGEX_PUNCTUATION, $charBefore); - - $leftFlanking = ! $afterIsWhitespace && - ! ($afterIsPunctuation && - ! $beforeIsWhitespace && - ! $beforeIsPunctuation); - - $rightFlanking = ! $beforeIsWhitespace && - ! ($beforeIsPunctuation && - ! $afterIsWhitespace && - ! $afterIsPunctuation); - - return [$leftFlanking, $rightFlanking]; - } -} diff --git a/vendor/league/commonmark/src/Extension/SmartPunct/QuoteProcessor.php b/vendor/league/commonmark/src/Extension/SmartPunct/QuoteProcessor.php deleted file mode 100644 index 1fc30d4e..00000000 --- a/vendor/league/commonmark/src/Extension/SmartPunct/QuoteProcessor.php +++ /dev/null @@ -1,82 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (http://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\SmartPunct; - -use League\CommonMark\Delimiter\DelimiterInterface; -use League\CommonMark\Delimiter\Processor\DelimiterProcessorInterface; -use League\CommonMark\Node\Inline\AbstractStringContainer; - -final class QuoteProcessor implements DelimiterProcessorInterface -{ - /** @psalm-readonly */ - private string $normalizedCharacter; - - /** @psalm-readonly */ - private string $openerCharacter; - - /** @psalm-readonly */ - private string $closerCharacter; - - private function __construct(string $char, string $opener, string $closer) - { - $this->normalizedCharacter = $char; - $this->openerCharacter = $opener; - $this->closerCharacter = $closer; - } - - public function getOpeningCharacter(): string - { - return $this->normalizedCharacter; - } - - public function getClosingCharacter(): string - { - return $this->normalizedCharacter; - } - - public function getMinLength(): int - { - return 1; - } - - public function getDelimiterUse(DelimiterInterface $opener, DelimiterInterface $closer): int - { - return 1; - } - - public function process(AbstractStringContainer $opener, AbstractStringContainer $closer, int $delimiterUse): void - { - $opener->insertAfter(new Quote($this->openerCharacter)); - $closer->insertBefore(new Quote($this->closerCharacter)); - } - - /** - * Create a double-quote processor - */ - public static function createDoubleQuoteProcessor(string $opener = Quote::DOUBLE_QUOTE_OPENER, string $closer = Quote::DOUBLE_QUOTE_CLOSER): self - { - return new self(Quote::DOUBLE_QUOTE, $opener, $closer); - } - - /** - * Create a single-quote processor - */ - public static function createSingleQuoteProcessor(string $opener = Quote::SINGLE_QUOTE_OPENER, string $closer = Quote::SINGLE_QUOTE_CLOSER): self - { - return new self(Quote::SINGLE_QUOTE, $opener, $closer); - } -} diff --git a/vendor/league/commonmark/src/Extension/SmartPunct/ReplaceUnpairedQuotesListener.php b/vendor/league/commonmark/src/Extension/SmartPunct/ReplaceUnpairedQuotesListener.php deleted file mode 100644 index 3536452d..00000000 --- a/vendor/league/commonmark/src/Extension/SmartPunct/ReplaceUnpairedQuotesListener.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\SmartPunct; - -use League\CommonMark\Event\DocumentParsedEvent; -use League\CommonMark\Node\Inline\AdjacentTextMerger; -use League\CommonMark\Node\Inline\Text; -use League\CommonMark\Node\Query; - -/** - * Identifies any lingering Quote nodes that were missing pairs and converts them into Text nodes - */ -final class ReplaceUnpairedQuotesListener -{ - public function __invoke(DocumentParsedEvent $event): void - { - $query = (new Query())->where(Query::type(Quote::class)); - foreach ($query->findAll($event->getDocument()) as $quote) { - \assert($quote instanceof Quote); - - $literal = $quote->getLiteral(); - if ($literal === Quote::SINGLE_QUOTE) { - $literal = Quote::SINGLE_QUOTE_CLOSER; - } elseif ($literal === Quote::DOUBLE_QUOTE) { - $literal = Quote::DOUBLE_QUOTE_OPENER; - } - - $quote->replaceWith($new = new Text($literal)); - AdjacentTextMerger::mergeWithDirectlyAdjacentNodes($new); - } - } -} diff --git a/vendor/league/commonmark/src/Extension/SmartPunct/SmartPunctExtension.php b/vendor/league/commonmark/src/Extension/SmartPunct/SmartPunctExtension.php deleted file mode 100644 index 8524ca11..00000000 --- a/vendor/league/commonmark/src/Extension/SmartPunct/SmartPunctExtension.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (http://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\SmartPunct; - -use League\CommonMark\Environment\EnvironmentBuilderInterface; -use League\CommonMark\Event\DocumentParsedEvent; -use League\CommonMark\Extension\ConfigurableExtensionInterface; -use League\CommonMark\Node\Block\Document; -use League\CommonMark\Node\Block\Paragraph; -use League\CommonMark\Node\Inline\Text; -use League\CommonMark\Renderer\Block as CoreBlockRenderer; -use League\CommonMark\Renderer\Inline as CoreInlineRenderer; -use League\Config\ConfigurationBuilderInterface; -use Nette\Schema\Expect; - -final class SmartPunctExtension implements ConfigurableExtensionInterface -{ - public function configureSchema(ConfigurationBuilderInterface $builder): void - { - $builder->addSchema('smartpunct', Expect::structure([ - 'double_quote_opener' => Expect::string(Quote::DOUBLE_QUOTE_OPENER), - 'double_quote_closer' => Expect::string(Quote::DOUBLE_QUOTE_CLOSER), - 'single_quote_opener' => Expect::string(Quote::SINGLE_QUOTE_OPENER), - 'single_quote_closer' => Expect::string(Quote::SINGLE_QUOTE_CLOSER), - ])); - } - - public function register(EnvironmentBuilderInterface $environment): void - { - $environment - ->addInlineParser(new QuoteParser(), 10) - ->addInlineParser(new DashParser(), 0) - ->addInlineParser(new EllipsesParser(), 0) - - ->addDelimiterProcessor(QuoteProcessor::createDoubleQuoteProcessor( - $environment->getConfiguration()->get('smartpunct/double_quote_opener'), - $environment->getConfiguration()->get('smartpunct/double_quote_closer') - )) - ->addDelimiterProcessor(QuoteProcessor::createSingleQuoteProcessor( - $environment->getConfiguration()->get('smartpunct/single_quote_opener'), - $environment->getConfiguration()->get('smartpunct/single_quote_closer') - )) - - ->addEventListener(DocumentParsedEvent::class, new ReplaceUnpairedQuotesListener()) - - ->addRenderer(Document::class, new CoreBlockRenderer\DocumentRenderer(), 0) - ->addRenderer(Paragraph::class, new CoreBlockRenderer\ParagraphRenderer(), 0) - ->addRenderer(Text::class, new CoreInlineRenderer\TextRenderer(), 0); - } -} diff --git a/vendor/league/commonmark/src/Extension/Strikethrough/Strikethrough.php b/vendor/league/commonmark/src/Extension/Strikethrough/Strikethrough.php deleted file mode 100644 index 20ad161c..00000000 --- a/vendor/league/commonmark/src/Extension/Strikethrough/Strikethrough.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> and uAfrica.com (http://uafrica.com) - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\Strikethrough; - -use League\CommonMark\Node\Inline\AbstractInline; -use League\CommonMark\Node\Inline\DelimitedInterface; - -final class Strikethrough extends AbstractInline implements DelimitedInterface -{ - private string $delimiter; - - public function __construct(string $delimiter = '~~') - { - parent::__construct(); - - $this->delimiter = $delimiter; - } - - public function getOpeningDelimiter(): string - { - return $this->delimiter; - } - - public function getClosingDelimiter(): string - { - return $this->delimiter; - } -} diff --git a/vendor/league/commonmark/src/Extension/Strikethrough/StrikethroughDelimiterProcessor.php b/vendor/league/commonmark/src/Extension/Strikethrough/StrikethroughDelimiterProcessor.php deleted file mode 100644 index f3fd70a9..00000000 --- a/vendor/league/commonmark/src/Extension/Strikethrough/StrikethroughDelimiterProcessor.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> and uAfrica.com (http://uafrica.com) - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\Strikethrough; - -use League\CommonMark\Delimiter\DelimiterInterface; -use League\CommonMark\Delimiter\Processor\DelimiterProcessorInterface; -use League\CommonMark\Node\Inline\AbstractStringContainer; - -final class StrikethroughDelimiterProcessor implements DelimiterProcessorInterface -{ - public function getOpeningCharacter(): string - { - return '~'; - } - - public function getClosingCharacter(): string - { - return '~'; - } - - public function getMinLength(): int - { - return 2; - } - - public function getDelimiterUse(DelimiterInterface $opener, DelimiterInterface $closer): int - { - $min = \min($opener->getLength(), $closer->getLength()); - - return $min >= 2 ? $min : 0; - } - - public function process(AbstractStringContainer $opener, AbstractStringContainer $closer, int $delimiterUse): void - { - $strikethrough = new Strikethrough(\str_repeat('~', $delimiterUse)); - - $tmp = $opener->next(); - while ($tmp !== null && $tmp !== $closer) { - $next = $tmp->next(); - $strikethrough->appendChild($tmp); - $tmp = $next; - } - - $opener->insertAfter($strikethrough); - } -} diff --git a/vendor/league/commonmark/src/Extension/Strikethrough/StrikethroughExtension.php b/vendor/league/commonmark/src/Extension/Strikethrough/StrikethroughExtension.php deleted file mode 100644 index 96ffe7a5..00000000 --- a/vendor/league/commonmark/src/Extension/Strikethrough/StrikethroughExtension.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> and uAfrica.com (http://uafrica.com) - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\Strikethrough; - -use League\CommonMark\Environment\EnvironmentBuilderInterface; -use League\CommonMark\Extension\ExtensionInterface; - -final class StrikethroughExtension implements ExtensionInterface -{ - public function register(EnvironmentBuilderInterface $environment): void - { - $environment->addDelimiterProcessor(new StrikethroughDelimiterProcessor()); - $environment->addRenderer(Strikethrough::class, new StrikethroughRenderer()); - } -} diff --git a/vendor/league/commonmark/src/Extension/Strikethrough/StrikethroughRenderer.php b/vendor/league/commonmark/src/Extension/Strikethrough/StrikethroughRenderer.php deleted file mode 100644 index a50b895e..00000000 --- a/vendor/league/commonmark/src/Extension/Strikethrough/StrikethroughRenderer.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> and uAfrica.com (http://uafrica.com) - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\Strikethrough; - -use League\CommonMark\Node\Node; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\CommonMark\Util\HtmlElement; -use League\CommonMark\Xml\XmlNodeRendererInterface; - -final class StrikethroughRenderer implements NodeRendererInterface, XmlNodeRendererInterface -{ - /** - * @param Strikethrough $node - * - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function render(Node $node, ChildNodeRendererInterface $childRenderer): \Stringable - { - Strikethrough::assertInstanceOf($node); - - return new HtmlElement('del', $node->data->get('attributes'), $childRenderer->renderNodes($node->children())); - } - - public function getXmlTagName(Node $node): string - { - return 'strikethrough'; - } - - /** - * {@inheritDoc} - */ - public function getXmlAttributes(Node $node): array - { - return []; - } -} diff --git a/vendor/league/commonmark/src/Extension/Table/Table.php b/vendor/league/commonmark/src/Extension/Table/Table.php deleted file mode 100644 index 2fe441d6..00000000 --- a/vendor/league/commonmark/src/Extension/Table/Table.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This is part of the league/commonmark package. - * - * (c) Martin Hasoň <martin.hason@gmail.com> - * (c) Webuni s.r.o. <info@webuni.cz> - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\Table; - -use League\CommonMark\Node\Block\AbstractBlock; - -final class Table extends AbstractBlock -{ -} diff --git a/vendor/league/commonmark/src/Extension/Table/TableCell.php b/vendor/league/commonmark/src/Extension/Table/TableCell.php deleted file mode 100644 index 6ed359a6..00000000 --- a/vendor/league/commonmark/src/Extension/Table/TableCell.php +++ /dev/null @@ -1,99 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This is part of the league/commonmark package. - * - * (c) Martin Hasoň <martin.hason@gmail.com> - * (c) Webuni s.r.o. <info@webuni.cz> - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\Table; - -use League\CommonMark\Node\Block\AbstractBlock; - -final class TableCell extends AbstractBlock -{ - public const TYPE_HEADER = 'header'; - public const TYPE_DATA = 'data'; - - public const ALIGN_LEFT = 'left'; - public const ALIGN_RIGHT = 'right'; - public const ALIGN_CENTER = 'center'; - - /** - * @psalm-var self::TYPE_* - * @phpstan-var self::TYPE_* - * - * @psalm-readonly-allow-private-mutation - */ - private string $type = self::TYPE_DATA; - - /** - * @psalm-var self::ALIGN_*|null - * @phpstan-var self::ALIGN_*|null - * - * @psalm-readonly-allow-private-mutation - */ - private ?string $align = null; - - /** - * @psalm-param self::TYPE_* $type - * @psalm-param self::ALIGN_*|null $align - * - * @phpstan-param self::TYPE_* $type - * @phpstan-param self::ALIGN_*|null $align - */ - public function __construct(string $type = self::TYPE_DATA, ?string $align = null) - { - parent::__construct(); - - $this->type = $type; - $this->align = $align; - } - - /** - * @psalm-return self::TYPE_* - * - * @phpstan-return self::TYPE_* - */ - public function getType(): string - { - return $this->type; - } - - /** - * @psalm-param self::TYPE_* $type - * - * @phpstan-param self::TYPE_* $type - */ - public function setType(string $type): void - { - $this->type = $type; - } - - /** - * @psalm-return self::ALIGN_*|null - * - * @phpstan-return self::ALIGN_*|null - */ - public function getAlign(): ?string - { - return $this->align; - } - - /** - * @psalm-param self::ALIGN_*|null $align - * - * @phpstan-param self::ALIGN_*|null $align - */ - public function setAlign(?string $align): void - { - $this->align = $align; - } -} diff --git a/vendor/league/commonmark/src/Extension/Table/TableCellRenderer.php b/vendor/league/commonmark/src/Extension/Table/TableCellRenderer.php deleted file mode 100644 index e6b736a3..00000000 --- a/vendor/league/commonmark/src/Extension/Table/TableCellRenderer.php +++ /dev/null @@ -1,72 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This is part of the league/commonmark package. - * - * (c) Martin Hasoň <martin.hason@gmail.com> - * (c) Webuni s.r.o. <info@webuni.cz> - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\Table; - -use League\CommonMark\Node\Node; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\CommonMark\Util\HtmlElement; -use League\CommonMark\Xml\XmlNodeRendererInterface; - -final class TableCellRenderer implements NodeRendererInterface, XmlNodeRendererInterface -{ - /** - * @param TableCell $node - * - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function render(Node $node, ChildNodeRendererInterface $childRenderer): \Stringable - { - TableCell::assertInstanceOf($node); - - $attrs = $node->data->get('attributes'); - - if ($node->getAlign() !== null) { - $attrs['align'] = $node->getAlign(); - } - - $tag = $node->getType() === TableCell::TYPE_HEADER ? 'th' : 'td'; - - return new HtmlElement($tag, $attrs, $childRenderer->renderNodes($node->children())); - } - - public function getXmlTagName(Node $node): string - { - return 'table_cell'; - } - - /** - * @param TableCell $node - * - * @return array<string, scalar> - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function getXmlAttributes(Node $node): array - { - TableCell::assertInstanceOf($node); - - $ret = ['type' => $node->getType()]; - - if (($align = $node->getAlign()) !== null) { - $ret['align'] = $align; - } - - return $ret; - } -} diff --git a/vendor/league/commonmark/src/Extension/Table/TableExtension.php b/vendor/league/commonmark/src/Extension/Table/TableExtension.php deleted file mode 100644 index 2e4f2324..00000000 --- a/vendor/league/commonmark/src/Extension/Table/TableExtension.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This is part of the league/commonmark package. - * - * (c) Martin Hasoň <martin.hason@gmail.com> - * (c) Webuni s.r.o. <info@webuni.cz> - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\Table; - -use League\CommonMark\Environment\EnvironmentBuilderInterface; -use League\CommonMark\Extension\ConfigurableExtensionInterface; -use League\CommonMark\Renderer\HtmlDecorator; -use League\Config\ConfigurationBuilderInterface; -use Nette\Schema\Expect; - -final class TableExtension implements ConfigurableExtensionInterface -{ - public function configureSchema(ConfigurationBuilderInterface $builder): void - { - $builder->addSchema('table', Expect::structure([ - 'wrap' => Expect::structure([ - 'enabled' => Expect::bool()->default(false), - 'tag' => Expect::string()->default('div'), - 'attributes' => Expect::arrayOf(Expect::string()), - ]), - ])); - } - - public function register(EnvironmentBuilderInterface $environment): void - { - $tableRenderer = new TableRenderer(); - if ($environment->getConfiguration()->get('table/wrap/enabled')) { - $tableRenderer = new HtmlDecorator($tableRenderer, $environment->getConfiguration()->get('table/wrap/tag'), $environment->getConfiguration()->get('table/wrap/attributes')); - } - - $environment - ->addBlockStartParser(new TableStartParser()) - - ->addRenderer(Table::class, $tableRenderer) - ->addRenderer(TableSection::class, new TableSectionRenderer()) - ->addRenderer(TableRow::class, new TableRowRenderer()) - ->addRenderer(TableCell::class, new TableCellRenderer()); - } -} diff --git a/vendor/league/commonmark/src/Extension/Table/TableParser.php b/vendor/league/commonmark/src/Extension/Table/TableParser.php deleted file mode 100644 index ca340a31..00000000 --- a/vendor/league/commonmark/src/Extension/Table/TableParser.php +++ /dev/null @@ -1,200 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This is part of the league/commonmark package. - * - * (c) Martin Hasoň <martin.hason@gmail.com> - * (c) Webuni s.r.o. <info@webuni.cz> - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\Table; - -use League\CommonMark\Parser\Block\AbstractBlockContinueParser; -use League\CommonMark\Parser\Block\BlockContinue; -use League\CommonMark\Parser\Block\BlockContinueParserInterface; -use League\CommonMark\Parser\Block\BlockContinueParserWithInlinesInterface; -use League\CommonMark\Parser\Cursor; -use League\CommonMark\Parser\InlineParserEngineInterface; -use League\CommonMark\Util\ArrayCollection; - -final class TableParser extends AbstractBlockContinueParser implements BlockContinueParserWithInlinesInterface -{ - /** @psalm-readonly */ - private Table $block; - - /** - * @var ArrayCollection<string> - * - * @psalm-readonly-allow-private-mutation - */ - private ArrayCollection $bodyLines; - - /** - * @var array<int, string|null> - * @psalm-var array<int, TableCell::ALIGN_*|null> - * @phpstan-var array<int, TableCell::ALIGN_*|null> - * - * @psalm-readonly - */ - private array $columns; - - /** - * @var array<int, string> - * - * @psalm-readonly-allow-private-mutation - */ - private array $headerCells; - - /** @psalm-readonly-allow-private-mutation */ - private bool $nextIsSeparatorLine = true; - - /** - * @param array<int, string|null> $columns - * @param array<int, string> $headerCells - * - * @psalm-param array<int, TableCell::ALIGN_*|null> $columns - * - * @phpstan-param array<int, TableCell::ALIGN_*|null> $columns - */ - public function __construct(array $columns, array $headerCells) - { - $this->block = new Table(); - $this->bodyLines = new ArrayCollection(); - $this->columns = $columns; - $this->headerCells = $headerCells; - } - - public function canHaveLazyContinuationLines(): bool - { - return true; - } - - public function getBlock(): Table - { - return $this->block; - } - - public function tryContinue(Cursor $cursor, BlockContinueParserInterface $activeBlockParser): ?BlockContinue - { - if (\strpos($cursor->getLine(), '|') === false) { - return BlockContinue::none(); - } - - return BlockContinue::at($cursor); - } - - public function addLine(string $line): void - { - if ($this->nextIsSeparatorLine) { - $this->nextIsSeparatorLine = false; - } else { - $this->bodyLines[] = $line; - } - } - - public function parseInlines(InlineParserEngineInterface $inlineParser): void - { - $headerColumns = \count($this->headerCells); - - $head = new TableSection(TableSection::TYPE_HEAD); - $this->block->appendChild($head); - - $headerRow = new TableRow(); - $head->appendChild($headerRow); - for ($i = 0; $i < $headerColumns; $i++) { - $cell = $this->headerCells[$i]; - $tableCell = $this->parseCell($cell, $i, $inlineParser); - $tableCell->setType(TableCell::TYPE_HEADER); - $headerRow->appendChild($tableCell); - } - - $body = null; - foreach ($this->bodyLines as $rowLine) { - $cells = self::split($rowLine); - $row = new TableRow(); - - // Body can not have more columns than head - for ($i = 0; $i < $headerColumns; $i++) { - $cell = $cells[$i] ?? ''; - $tableCell = $this->parseCell($cell, $i, $inlineParser); - $row->appendChild($tableCell); - } - - if ($body === null) { - // It's valid to have a table without body. In that case, don't add an empty TableBody node. - $body = new TableSection(); - $this->block->appendChild($body); - } - - $body->appendChild($row); - } - } - - private function parseCell(string $cell, int $column, InlineParserEngineInterface $inlineParser): TableCell - { - $tableCell = new TableCell(); - - if ($column < \count($this->columns)) { - $tableCell->setAlign($this->columns[$column]); - } - - $inlineParser->parse(\trim($cell), $tableCell); - - return $tableCell; - } - - /** - * @internal - * - * @return array<int, string> - */ - public static function split(string $line): array - { - $cursor = new Cursor(\trim($line)); - - if ($cursor->getCurrentCharacter() === '|') { - $cursor->advanceBy(1); - } - - $cells = []; - $sb = ''; - - while (! $cursor->isAtEnd()) { - switch ($c = $cursor->getCurrentCharacter()) { - case '\\': - if ($cursor->peek() === '|') { - // Pipe is special for table parsing. An escaped pipe doesn't result in a new cell, but is - // passed down to inline parsing as an unescaped pipe. Note that that applies even for the `\|` - // in an input like `\\|` - in other words, table parsing doesn't support escaping backslashes. - $sb .= '|'; - $cursor->advanceBy(1); - } else { - // Preserve backslash before other characters or at end of line. - $sb .= '\\'; - } - - break; - case '|': - $cells[] = $sb; - $sb = ''; - break; - default: - $sb .= $c; - } - - $cursor->advanceBy(1); - } - - if ($sb !== '') { - $cells[] = $sb; - } - - return $cells; - } -} diff --git a/vendor/league/commonmark/src/Extension/Table/TableRenderer.php b/vendor/league/commonmark/src/Extension/Table/TableRenderer.php deleted file mode 100644 index 7799e224..00000000 --- a/vendor/league/commonmark/src/Extension/Table/TableRenderer.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This is part of the league/commonmark package. - * - * (c) Martin Hasoň <martin.hason@gmail.com> - * (c) Webuni s.r.o. <info@webuni.cz> - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\Table; - -use League\CommonMark\Node\Node; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\CommonMark\Util\HtmlElement; -use League\CommonMark\Xml\XmlNodeRendererInterface; - -final class TableRenderer implements NodeRendererInterface, XmlNodeRendererInterface -{ - /** - * @param Table $node - * - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function render(Node $node, ChildNodeRendererInterface $childRenderer): \Stringable - { - Table::assertInstanceOf($node); - - $attrs = $node->data->get('attributes'); - - $separator = $childRenderer->getInnerSeparator(); - - $children = $childRenderer->renderNodes($node->children()); - - return new HtmlElement('table', $attrs, $separator . \trim($children) . $separator); - } - - public function getXmlTagName(Node $node): string - { - return 'table'; - } - - /** - * {@inheritDoc} - */ - public function getXmlAttributes(Node $node): array - { - return []; - } -} diff --git a/vendor/league/commonmark/src/Extension/Table/TableRow.php b/vendor/league/commonmark/src/Extension/Table/TableRow.php deleted file mode 100644 index cd6ac991..00000000 --- a/vendor/league/commonmark/src/Extension/Table/TableRow.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This is part of the league/commonmark package. - * - * (c) Martin Hasoň <martin.hason@gmail.com> - * (c) Webuni s.r.o. <info@webuni.cz> - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\Table; - -use League\CommonMark\Node\Block\AbstractBlock; - -final class TableRow extends AbstractBlock -{ -} diff --git a/vendor/league/commonmark/src/Extension/Table/TableRowRenderer.php b/vendor/league/commonmark/src/Extension/Table/TableRowRenderer.php deleted file mode 100644 index dee72d2d..00000000 --- a/vendor/league/commonmark/src/Extension/Table/TableRowRenderer.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This is part of the league/commonmark package. - * - * (c) Martin Hasoň <martin.hason@gmail.com> - * (c) Webuni s.r.o. <info@webuni.cz> - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\Table; - -use League\CommonMark\Node\Node; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\CommonMark\Util\HtmlElement; -use League\CommonMark\Xml\XmlNodeRendererInterface; - -final class TableRowRenderer implements NodeRendererInterface, XmlNodeRendererInterface -{ - /** - * @param TableRow $node - * - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function render(Node $node, ChildNodeRendererInterface $childRenderer): \Stringable - { - TableRow::assertInstanceOf($node); - - $attrs = $node->data->get('attributes'); - - $separator = $childRenderer->getInnerSeparator(); - - return new HtmlElement('tr', $attrs, $separator . $childRenderer->renderNodes($node->children()) . $separator); - } - - public function getXmlTagName(Node $node): string - { - return 'table_row'; - } - - /** - * {@inheritDoc} - */ - public function getXmlAttributes(Node $node): array - { - return []; - } -} diff --git a/vendor/league/commonmark/src/Extension/Table/TableSection.php b/vendor/league/commonmark/src/Extension/Table/TableSection.php deleted file mode 100644 index 9edd63bc..00000000 --- a/vendor/league/commonmark/src/Extension/Table/TableSection.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This is part of the league/commonmark package. - * - * (c) Martin Hasoň <martin.hason@gmail.com> - * (c) Webuni s.r.o. <info@webuni.cz> - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\Table; - -use League\CommonMark\Node\Block\AbstractBlock; - -final class TableSection extends AbstractBlock -{ - public const TYPE_HEAD = 'head'; - public const TYPE_BODY = 'body'; - - /** - * @psalm-var self::TYPE_* - * @phpstan-var self::TYPE_* - * - * @psalm-readonly - */ - private string $type; - - /** - * @psalm-param self::TYPE_* $type - * - * @phpstan-param self::TYPE_* $type - */ - public function __construct(string $type = self::TYPE_BODY) - { - parent::__construct(); - - $this->type = $type; - } - - /** - * @psalm-return self::TYPE_* - * - * @phpstan-return self::TYPE_* - */ - public function getType(): string - { - return $this->type; - } - - public function isHead(): bool - { - return $this->type === self::TYPE_HEAD; - } - - public function isBody(): bool - { - return $this->type === self::TYPE_BODY; - } -} diff --git a/vendor/league/commonmark/src/Extension/Table/TableSectionRenderer.php b/vendor/league/commonmark/src/Extension/Table/TableSectionRenderer.php deleted file mode 100644 index cccf06c6..00000000 --- a/vendor/league/commonmark/src/Extension/Table/TableSectionRenderer.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This is part of the league/commonmark package. - * - * (c) Martin Hasoň <martin.hason@gmail.com> - * (c) Webuni s.r.o. <info@webuni.cz> - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\Table; - -use League\CommonMark\Node\Node; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\CommonMark\Util\HtmlElement; -use League\CommonMark\Xml\XmlNodeRendererInterface; - -final class TableSectionRenderer implements NodeRendererInterface, XmlNodeRendererInterface -{ - /** - * @param TableSection $node - * - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function render(Node $node, ChildNodeRendererInterface $childRenderer) - { - TableSection::assertInstanceOf($node); - - if (! $node->hasChildren()) { - return ''; - } - - $attrs = $node->data->get('attributes'); - - $separator = $childRenderer->getInnerSeparator(); - - $tag = $node->getType() === TableSection::TYPE_HEAD ? 'thead' : 'tbody'; - - return new HtmlElement($tag, $attrs, $separator . $childRenderer->renderNodes($node->children()) . $separator); - } - - public function getXmlTagName(Node $node): string - { - return 'table_section'; - } - - /** - * @param TableSection $node - * - * @return array<string, scalar> - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function getXmlAttributes(Node $node): array - { - TableSection::assertInstanceOf($node); - - return [ - 'type' => $node->getType(), - ]; - } -} diff --git a/vendor/league/commonmark/src/Extension/Table/TableStartParser.php b/vendor/league/commonmark/src/Extension/Table/TableStartParser.php deleted file mode 100644 index 12206d28..00000000 --- a/vendor/league/commonmark/src/Extension/Table/TableStartParser.php +++ /dev/null @@ -1,158 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This is part of the league/commonmark package. - * - * (c) Martin Hasoň <martin.hason@gmail.com> - * (c) Webuni s.r.o. <info@webuni.cz> - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\Table; - -use League\CommonMark\Parser\Block\BlockStart; -use League\CommonMark\Parser\Block\BlockStartParserInterface; -use League\CommonMark\Parser\Block\ParagraphParser; -use League\CommonMark\Parser\Cursor; -use League\CommonMark\Parser\MarkdownParserStateInterface; - -final class TableStartParser implements BlockStartParserInterface -{ - public function tryStart(Cursor $cursor, MarkdownParserStateInterface $parserState): ?BlockStart - { - $paragraph = $parserState->getParagraphContent(); - if ($paragraph === null || \strpos($paragraph, '|') === false) { - return BlockStart::none(); - } - - $columns = self::parseSeparator($cursor); - if (\count($columns) === 0) { - return BlockStart::none(); - } - - $lines = \explode("\n", $paragraph); - $lastLine = \array_pop($lines); - - $headerCells = TableParser::split($lastLine); - if (\count($headerCells) > \count($columns)) { - return BlockStart::none(); - } - - $cursor->advanceToEnd(); - - $parsers = []; - - if (\count($lines) > 0) { - $p = new ParagraphParser(); - $p->addLine(\implode("\n", $lines)); - $parsers[] = $p; - } - - $parsers[] = new TableParser($columns, $headerCells); - - return BlockStart::of(...$parsers) - ->at($cursor) - ->replaceActiveBlockParser(); - } - - /** - * @return array<int, string|null> - * - * @psalm-return array<int, TableCell::ALIGN_*|null> - * - * @phpstan-return array<int, TableCell::ALIGN_*|null> - */ - private static function parseSeparator(Cursor $cursor): array - { - $columns = []; - $pipes = 0; - $valid = false; - - while (! $cursor->isAtEnd()) { - switch ($c = $cursor->getCurrentCharacter()) { - case '|': - $cursor->advanceBy(1); - $pipes++; - if ($pipes > 1) { - // More than one adjacent pipe not allowed - return []; - } - - // Need at least one pipe, even for a one-column table - $valid = true; - break; - case '-': - case ':': - if ($pipes === 0 && \count($columns) > 0) { - // Need a pipe after the first column (first column doesn't need to start with one) - return []; - } - - $left = false; - $right = false; - if ($c === ':') { - $left = true; - $cursor->advanceBy(1); - } - - if ($cursor->match('/^-+/') === null) { - // Need at least one dash - return []; - } - - if ($cursor->getCurrentCharacter() === ':') { - $right = true; - $cursor->advanceBy(1); - } - - $columns[] = self::getAlignment($left, $right); - // Next, need another pipe - $pipes = 0; - break; - case ' ': - case "\t": - // White space is allowed between pipes and columns - $cursor->advanceToNextNonSpaceOrTab(); - break; - default: - // Any other character is invalid - return []; - } - } - - if (! $valid) { - return []; - } - - return $columns; - } - - /** - * @psalm-return TableCell::ALIGN_*|null - * - * @phpstan-return TableCell::ALIGN_*|null - * - * @psalm-pure - */ - private static function getAlignment(bool $left, bool $right): ?string - { - if ($left && $right) { - return TableCell::ALIGN_CENTER; - } - - if ($left) { - return TableCell::ALIGN_LEFT; - } - - if ($right) { - return TableCell::ALIGN_RIGHT; - } - - return null; - } -} diff --git a/vendor/league/commonmark/src/Extension/TableOfContents/Node/TableOfContents.php b/vendor/league/commonmark/src/Extension/TableOfContents/Node/TableOfContents.php deleted file mode 100644 index e040d862..00000000 --- a/vendor/league/commonmark/src/Extension/TableOfContents/Node/TableOfContents.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\TableOfContents\Node; - -use League\CommonMark\Extension\CommonMark\Node\Block\ListBlock; - -final class TableOfContents extends ListBlock -{ -} diff --git a/vendor/league/commonmark/src/Extension/TableOfContents/Node/TableOfContentsPlaceholder.php b/vendor/league/commonmark/src/Extension/TableOfContents/Node/TableOfContentsPlaceholder.php deleted file mode 100644 index 6d6db100..00000000 --- a/vendor/league/commonmark/src/Extension/TableOfContents/Node/TableOfContentsPlaceholder.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\TableOfContents\Node; - -use League\CommonMark\Node\Block\AbstractBlock; - -final class TableOfContentsPlaceholder extends AbstractBlock -{ -} diff --git a/vendor/league/commonmark/src/Extension/TableOfContents/Normalizer/AsIsNormalizerStrategy.php b/vendor/league/commonmark/src/Extension/TableOfContents/Normalizer/AsIsNormalizerStrategy.php deleted file mode 100644 index f5bb9a4d..00000000 --- a/vendor/league/commonmark/src/Extension/TableOfContents/Normalizer/AsIsNormalizerStrategy.php +++ /dev/null @@ -1,72 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\TableOfContents\Normalizer; - -use League\CommonMark\Extension\CommonMark\Node\Block\ListBlock; -use League\CommonMark\Extension\CommonMark\Node\Block\ListItem; -use League\CommonMark\Extension\TableOfContents\Node\TableOfContents; - -final class AsIsNormalizerStrategy implements NormalizerStrategyInterface -{ - /** @psalm-readonly-allow-private-mutation */ - private ListBlock $parentListBlock; - - /** @psalm-readonly-allow-private-mutation */ - private int $parentLevel = 1; - - /** @psalm-readonly-allow-private-mutation */ - private ?ListItem $lastListItem = null; - - public function __construct(TableOfContents $toc) - { - $this->parentListBlock = $toc; - } - - public function addItem(int $level, ListItem $listItemToAdd): void - { - while ($level > $this->parentLevel) { - // Descend downwards, creating new ListBlocks if needed, until we reach the correct depth - if ($this->lastListItem === null) { - $this->lastListItem = new ListItem($this->parentListBlock->getListData()); - $this->parentListBlock->appendChild($this->lastListItem); - } - - $newListBlock = new ListBlock($this->parentListBlock->getListData()); - $newListBlock->setStartLine($listItemToAdd->getStartLine()); - $newListBlock->setEndLine($listItemToAdd->getEndLine()); - $this->lastListItem->appendChild($newListBlock); - $this->parentListBlock = $newListBlock; - $this->lastListItem = null; - - $this->parentLevel++; - } - - while ($level < $this->parentLevel) { - // Search upwards for the previous parent list block - $search = $this->parentListBlock; - while ($search = $search->parent()) { - if ($search instanceof ListBlock) { - $this->parentListBlock = $search; - break; - } - } - - $this->parentLevel--; - } - - $this->parentListBlock->appendChild($listItemToAdd); - - $this->lastListItem = $listItemToAdd; - } -} diff --git a/vendor/league/commonmark/src/Extension/TableOfContents/Normalizer/FlatNormalizerStrategy.php b/vendor/league/commonmark/src/Extension/TableOfContents/Normalizer/FlatNormalizerStrategy.php deleted file mode 100644 index 8e805ae0..00000000 --- a/vendor/league/commonmark/src/Extension/TableOfContents/Normalizer/FlatNormalizerStrategy.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\TableOfContents\Normalizer; - -use League\CommonMark\Extension\CommonMark\Node\Block\ListItem; -use League\CommonMark\Extension\TableOfContents\Node\TableOfContents; - -final class FlatNormalizerStrategy implements NormalizerStrategyInterface -{ - /** @psalm-readonly */ - private TableOfContents $toc; - - public function __construct(TableOfContents $toc) - { - $this->toc = $toc; - } - - public function addItem(int $level, ListItem $listItemToAdd): void - { - $this->toc->appendChild($listItemToAdd); - } -} diff --git a/vendor/league/commonmark/src/Extension/TableOfContents/Normalizer/NormalizerStrategyInterface.php b/vendor/league/commonmark/src/Extension/TableOfContents/Normalizer/NormalizerStrategyInterface.php deleted file mode 100644 index f30afb1b..00000000 --- a/vendor/league/commonmark/src/Extension/TableOfContents/Normalizer/NormalizerStrategyInterface.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\TableOfContents\Normalizer; - -use League\CommonMark\Extension\CommonMark\Node\Block\ListItem; - -interface NormalizerStrategyInterface -{ - public function addItem(int $level, ListItem $listItemToAdd): void; -} diff --git a/vendor/league/commonmark/src/Extension/TableOfContents/Normalizer/RelativeNormalizerStrategy.php b/vendor/league/commonmark/src/Extension/TableOfContents/Normalizer/RelativeNormalizerStrategy.php deleted file mode 100644 index 1b2197ff..00000000 --- a/vendor/league/commonmark/src/Extension/TableOfContents/Normalizer/RelativeNormalizerStrategy.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\TableOfContents\Normalizer; - -use League\CommonMark\Extension\CommonMark\Node\Block\ListBlock; -use League\CommonMark\Extension\CommonMark\Node\Block\ListItem; -use League\CommonMark\Extension\TableOfContents\Node\TableOfContents; - -final class RelativeNormalizerStrategy implements NormalizerStrategyInterface -{ - /** @psalm-readonly */ - private TableOfContents $toc; - - /** - * @var array<int, ListItem> - * - * @psalm-readonly-allow-private-mutation - */ - private array $listItemStack = []; - - public function __construct(TableOfContents $toc) - { - $this->toc = $toc; - } - - public function addItem(int $level, ListItem $listItemToAdd): void - { - $previousLevel = \array_key_last($this->listItemStack); - - // Pop the stack if we're too deep - while ($previousLevel !== null && $level < $previousLevel) { - \array_pop($this->listItemStack); - $previousLevel = \array_key_last($this->listItemStack); - } - - $lastListItem = \end($this->listItemStack); - - // Need to go one level deeper? Add that level - if ($lastListItem !== false && $level > $previousLevel) { - $targetListBlock = new ListBlock($lastListItem->getListData()); - $targetListBlock->setStartLine($listItemToAdd->getStartLine()); - $targetListBlock->setEndLine($listItemToAdd->getEndLine()); - $lastListItem->appendChild($targetListBlock); - // Otherwise we're at the right level - // If there's no stack we're adding this item directly to the TOC element - } elseif ($lastListItem === false) { - $targetListBlock = $this->toc; - // Otherwise add it to the last list item - } else { - $targetListBlock = $lastListItem->parent(); - } - - $targetListBlock->appendChild($listItemToAdd); - $this->listItemStack[$level] = $listItemToAdd; - } -} diff --git a/vendor/league/commonmark/src/Extension/TableOfContents/TableOfContentsBuilder.php b/vendor/league/commonmark/src/Extension/TableOfContents/TableOfContentsBuilder.php deleted file mode 100644 index 7fe2b099..00000000 --- a/vendor/league/commonmark/src/Extension/TableOfContents/TableOfContentsBuilder.php +++ /dev/null @@ -1,106 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\TableOfContents; - -use League\CommonMark\Event\DocumentParsedEvent; -use League\CommonMark\Extension\CommonMark\Node\Block\Heading; -use League\CommonMark\Extension\HeadingPermalink\HeadingPermalink; -use League\CommonMark\Extension\TableOfContents\Node\TableOfContents; -use League\CommonMark\Extension\TableOfContents\Node\TableOfContentsPlaceholder; -use League\CommonMark\Node\Block\Document; -use League\CommonMark\Node\NodeIterator; -use League\Config\ConfigurationAwareInterface; -use League\Config\ConfigurationInterface; -use League\Config\Exception\InvalidConfigurationException; - -final class TableOfContentsBuilder implements ConfigurationAwareInterface -{ - public const POSITION_TOP = 'top'; - public const POSITION_BEFORE_HEADINGS = 'before-headings'; - public const POSITION_PLACEHOLDER = 'placeholder'; - - /** @psalm-readonly-allow-private-mutation */ - private ConfigurationInterface $config; - - public function onDocumentParsed(DocumentParsedEvent $event): void - { - $document = $event->getDocument(); - - $generator = new TableOfContentsGenerator( - (string) $this->config->get('table_of_contents/style'), - (string) $this->config->get('table_of_contents/normalize'), - (int) $this->config->get('table_of_contents/min_heading_level'), - (int) $this->config->get('table_of_contents/max_heading_level'), - (string) $this->config->get('heading_permalink/fragment_prefix'), - ); - - $toc = $generator->generate($document); - if ($toc === null) { - // No linkable headers exist, so no TOC could be generated - return; - } - - // Add custom CSS class(es), if defined - $class = $this->config->get('table_of_contents/html_class'); - if ($class !== null) { - $toc->data->append('attributes/class', $class); - } - - // Add the TOC to the Document - $position = $this->config->get('table_of_contents/position'); - if ($position === self::POSITION_TOP) { - $document->prependChild($toc); - } elseif ($position === self::POSITION_BEFORE_HEADINGS) { - $this->insertBeforeFirstLinkedHeading($document, $toc); - } elseif ($position === self::POSITION_PLACEHOLDER) { - $this->replacePlaceholders($document, $toc); - } else { - throw InvalidConfigurationException::forConfigOption('table_of_contents/position', $position); - } - } - - private function insertBeforeFirstLinkedHeading(Document $document, TableOfContents $toc): void - { - foreach ($document->iterator(NodeIterator::FLAG_BLOCKS_ONLY) as $node) { - if (! $node instanceof Heading) { - continue; - } - - foreach ($node->children() as $child) { - if ($child instanceof HeadingPermalink) { - $node->insertBefore($toc); - - return; - } - } - } - } - - private function replacePlaceholders(Document $document, TableOfContents $toc): void - { - foreach ($document->iterator(NodeIterator::FLAG_BLOCKS_ONLY) as $node) { - // Add the block once we find a placeholder - if (! $node instanceof TableOfContentsPlaceholder) { - continue; - } - - $node->replaceWith(clone $toc); - } - } - - public function setConfiguration(ConfigurationInterface $configuration): void - { - $this->config = $configuration; - } -} diff --git a/vendor/league/commonmark/src/Extension/TableOfContents/TableOfContentsExtension.php b/vendor/league/commonmark/src/Extension/TableOfContents/TableOfContentsExtension.php deleted file mode 100644 index 9c8223be..00000000 --- a/vendor/league/commonmark/src/Extension/TableOfContents/TableOfContentsExtension.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\TableOfContents; - -use League\CommonMark\Environment\EnvironmentBuilderInterface; -use League\CommonMark\Event\DocumentParsedEvent; -use League\CommonMark\Extension\CommonMark\Node\Block\ListBlock; -use League\CommonMark\Extension\CommonMark\Renderer\Block\ListBlockRenderer; -use League\CommonMark\Extension\ConfigurableExtensionInterface; -use League\CommonMark\Extension\TableOfContents\Node\TableOfContents; -use League\CommonMark\Extension\TableOfContents\Node\TableOfContentsPlaceholder; -use League\Config\ConfigurationBuilderInterface; -use Nette\Schema\Expect; - -final class TableOfContentsExtension implements ConfigurableExtensionInterface -{ - public function configureSchema(ConfigurationBuilderInterface $builder): void - { - $builder->addSchema('table_of_contents', Expect::structure([ - 'position' => Expect::anyOf(TableOfContentsBuilder::POSITION_BEFORE_HEADINGS, TableOfContentsBuilder::POSITION_PLACEHOLDER, TableOfContentsBuilder::POSITION_TOP)->default(TableOfContentsBuilder::POSITION_TOP), - 'style' => Expect::anyOf(ListBlock::TYPE_BULLET, ListBlock::TYPE_ORDERED)->default(ListBlock::TYPE_BULLET), - 'normalize' => Expect::anyOf(TableOfContentsGenerator::NORMALIZE_RELATIVE, TableOfContentsGenerator::NORMALIZE_FLAT, TableOfContentsGenerator::NORMALIZE_DISABLED)->default(TableOfContentsGenerator::NORMALIZE_RELATIVE), - 'min_heading_level' => Expect::int()->min(1)->max(6)->default(1), - 'max_heading_level' => Expect::int()->min(1)->max(6)->default(6), - 'html_class' => Expect::string()->default('table-of-contents'), - 'placeholder' => Expect::anyOf(Expect::string(), Expect::null())->default(null), - ])); - } - - public function register(EnvironmentBuilderInterface $environment): void - { - $environment->addRenderer(TableOfContents::class, new TableOfContentsRenderer(new ListBlockRenderer())); - $environment->addEventListener(DocumentParsedEvent::class, [new TableOfContentsBuilder(), 'onDocumentParsed'], -150); - - // phpcs:ignore SlevomatCodingStandard.ControlStructures.EarlyExit.EarlyExitNotUsed - if ($environment->getConfiguration()->get('table_of_contents/position') === TableOfContentsBuilder::POSITION_PLACEHOLDER) { - $environment->addBlockStartParser(TableOfContentsPlaceholderParser::blockStartParser(), 200); - // If a placeholder cannot be replaced with a TOC element this renderer will ensure the parser won't error out - $environment->addRenderer(TableOfContentsPlaceholder::class, new TableOfContentsPlaceholderRenderer()); - } - } -} diff --git a/vendor/league/commonmark/src/Extension/TableOfContents/TableOfContentsGenerator.php b/vendor/league/commonmark/src/Extension/TableOfContents/TableOfContentsGenerator.php deleted file mode 100644 index f0df96bf..00000000 --- a/vendor/league/commonmark/src/Extension/TableOfContents/TableOfContentsGenerator.php +++ /dev/null @@ -1,168 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\TableOfContents; - -use League\CommonMark\Extension\CommonMark\Node\Block\Heading; -use League\CommonMark\Extension\CommonMark\Node\Block\ListBlock; -use League\CommonMark\Extension\CommonMark\Node\Block\ListData; -use League\CommonMark\Extension\CommonMark\Node\Block\ListItem; -use League\CommonMark\Extension\CommonMark\Node\Inline\Link; -use League\CommonMark\Extension\HeadingPermalink\HeadingPermalink; -use League\CommonMark\Extension\TableOfContents\Node\TableOfContents; -use League\CommonMark\Extension\TableOfContents\Normalizer\AsIsNormalizerStrategy; -use League\CommonMark\Extension\TableOfContents\Normalizer\FlatNormalizerStrategy; -use League\CommonMark\Extension\TableOfContents\Normalizer\NormalizerStrategyInterface; -use League\CommonMark\Extension\TableOfContents\Normalizer\RelativeNormalizerStrategy; -use League\CommonMark\Node\Block\Document; -use League\CommonMark\Node\NodeIterator; -use League\CommonMark\Node\RawMarkupContainerInterface; -use League\CommonMark\Node\StringContainerHelper; -use League\Config\Exception\InvalidConfigurationException; - -final class TableOfContentsGenerator implements TableOfContentsGeneratorInterface -{ - public const STYLE_BULLET = ListBlock::TYPE_BULLET; - public const STYLE_ORDERED = ListBlock::TYPE_ORDERED; - - public const NORMALIZE_DISABLED = 'as-is'; - public const NORMALIZE_RELATIVE = 'relative'; - public const NORMALIZE_FLAT = 'flat'; - - /** @psalm-readonly */ - private string $style; - - /** @psalm-readonly */ - private string $normalizationStrategy; - - /** @psalm-readonly */ - private int $minHeadingLevel; - - /** @psalm-readonly */ - private int $maxHeadingLevel; - - /** @psalm-readonly */ - private string $fragmentPrefix; - - public function __construct(string $style, string $normalizationStrategy, int $minHeadingLevel, int $maxHeadingLevel, string $fragmentPrefix) - { - $this->style = $style; - $this->normalizationStrategy = $normalizationStrategy; - $this->minHeadingLevel = $minHeadingLevel; - $this->maxHeadingLevel = $maxHeadingLevel; - $this->fragmentPrefix = $fragmentPrefix; - - if ($fragmentPrefix !== '') { - $this->fragmentPrefix .= '-'; - } - } - - public function generate(Document $document): ?TableOfContents - { - $toc = $this->createToc($document); - - $normalizer = $this->getNormalizer($toc); - - $firstHeading = null; - - foreach ($this->getHeadingLinks($document) as $headingLink) { - $heading = $headingLink->parent(); - // Make sure this is actually tied to a heading - if (! $heading instanceof Heading) { - continue; - } - - // Skip any headings outside the configured min/max levels - if ($heading->getLevel() < $this->minHeadingLevel || $heading->getLevel() > $this->maxHeadingLevel) { - continue; - } - - // Keep track of the first heading we see - we might need this later - $firstHeading ??= $heading; - - // Keep track of the start and end lines - $toc->setStartLine($firstHeading->getStartLine()); - $toc->setEndLine($heading->getEndLine()); - - // Create the new link - $link = new Link('#' . $this->fragmentPrefix . $headingLink->getSlug(), StringContainerHelper::getChildText($heading, [RawMarkupContainerInterface::class])); - - $listItem = new ListItem($toc->getListData()); - $listItem->setStartLine($heading->getStartLine()); - $listItem->setEndLine($heading->getEndLine()); - $listItem->appendChild($link); - - // Add it to the correct place - $normalizer->addItem($heading->getLevel(), $listItem); - } - - // Don't add the TOC if no headings were present - if (! $toc->hasChildren() || $firstHeading === null) { - return null; - } - - return $toc; - } - - private function createToc(Document $document): TableOfContents - { - $listData = new ListData(); - - if ($this->style === self::STYLE_BULLET) { - $listData->type = ListBlock::TYPE_BULLET; - } elseif ($this->style === self::STYLE_ORDERED) { - $listData->type = ListBlock::TYPE_ORDERED; - } else { - throw new InvalidConfigurationException(\sprintf('Invalid table of contents list style: "%s"', $this->style)); - } - - $toc = new TableOfContents($listData); - - $toc->setStartLine($document->getStartLine()); - $toc->setEndLine($document->getEndLine()); - - return $toc; - } - - /** - * @return iterable<HeadingPermalink> - */ - private function getHeadingLinks(Document $document): iterable - { - foreach ($document->iterator(NodeIterator::FLAG_BLOCKS_ONLY) as $node) { - if (! $node instanceof Heading) { - continue; - } - - foreach ($node->children() as $child) { - if ($child instanceof HeadingPermalink) { - yield $child; - } - } - } - } - - private function getNormalizer(TableOfContents $toc): NormalizerStrategyInterface - { - switch ($this->normalizationStrategy) { - case self::NORMALIZE_DISABLED: - return new AsIsNormalizerStrategy($toc); - case self::NORMALIZE_RELATIVE: - return new RelativeNormalizerStrategy($toc); - case self::NORMALIZE_FLAT: - return new FlatNormalizerStrategy($toc); - default: - throw new InvalidConfigurationException(\sprintf('Invalid table of contents normalization strategy: "%s"', $this->normalizationStrategy)); - } - } -} diff --git a/vendor/league/commonmark/src/Extension/TableOfContents/TableOfContentsGeneratorInterface.php b/vendor/league/commonmark/src/Extension/TableOfContents/TableOfContentsGeneratorInterface.php deleted file mode 100644 index 64ecb8e5..00000000 --- a/vendor/league/commonmark/src/Extension/TableOfContents/TableOfContentsGeneratorInterface.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\TableOfContents; - -use League\CommonMark\Extension\TableOfContents\Node\TableOfContents; -use League\CommonMark\Node\Block\Document; - -interface TableOfContentsGeneratorInterface -{ - public function generate(Document $document): ?TableOfContents; -} diff --git a/vendor/league/commonmark/src/Extension/TableOfContents/TableOfContentsPlaceholderParser.php b/vendor/league/commonmark/src/Extension/TableOfContents/TableOfContentsPlaceholderParser.php deleted file mode 100644 index b27ddee6..00000000 --- a/vendor/league/commonmark/src/Extension/TableOfContents/TableOfContentsPlaceholderParser.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\TableOfContents; - -use League\CommonMark\Extension\TableOfContents\Node\TableOfContentsPlaceholder; -use League\CommonMark\Parser\Block\AbstractBlockContinueParser; -use League\CommonMark\Parser\Block\BlockContinue; -use League\CommonMark\Parser\Block\BlockContinueParserInterface; -use League\CommonMark\Parser\Block\BlockStart; -use League\CommonMark\Parser\Block\BlockStartParserInterface; -use League\CommonMark\Parser\Cursor; -use League\CommonMark\Parser\MarkdownParserStateInterface; -use League\Config\ConfigurationAwareInterface; -use League\Config\ConfigurationInterface; - -final class TableOfContentsPlaceholderParser extends AbstractBlockContinueParser -{ - /** @psalm-readonly */ - private TableOfContentsPlaceholder $block; - - public function __construct() - { - $this->block = new TableOfContentsPlaceholder(); - } - - public function getBlock(): TableOfContentsPlaceholder - { - return $this->block; - } - - public function tryContinue(Cursor $cursor, BlockContinueParserInterface $activeBlockParser): ?BlockContinue - { - return BlockContinue::none(); - } - - public static function blockStartParser(): BlockStartParserInterface - { - return new class () implements BlockStartParserInterface, ConfigurationAwareInterface { - /** @psalm-readonly-allow-private-mutation */ - private ConfigurationInterface $config; - - public function tryStart(Cursor $cursor, MarkdownParserStateInterface $parserState): ?BlockStart - { - $placeholder = $this->config->get('table_of_contents/placeholder'); - if ($placeholder === null) { - return BlockStart::none(); - } - - // The placeholder must be the only thing on the line - if ($cursor->match('/^' . \preg_quote($placeholder, '/') . '$/') === null) { - return BlockStart::none(); - } - - return BlockStart::of(new TableOfContentsPlaceholderParser())->at($cursor); - } - - public function setConfiguration(ConfigurationInterface $configuration): void - { - $this->config = $configuration; - } - }; - } -} diff --git a/vendor/league/commonmark/src/Extension/TableOfContents/TableOfContentsPlaceholderRenderer.php b/vendor/league/commonmark/src/Extension/TableOfContents/TableOfContentsPlaceholderRenderer.php deleted file mode 100644 index 0366cb91..00000000 --- a/vendor/league/commonmark/src/Extension/TableOfContents/TableOfContentsPlaceholderRenderer.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\TableOfContents; - -use League\CommonMark\Node\Node; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\CommonMark\Xml\XmlNodeRendererInterface; - -final class TableOfContentsPlaceholderRenderer implements NodeRendererInterface, XmlNodeRendererInterface -{ - public function render(Node $node, ChildNodeRendererInterface $childRenderer): string - { - return '<!-- table of contents -->'; - } - - public function getXmlTagName(Node $node): string - { - return 'table_of_contents_placeholder'; - } - - /** - * @return array<string, scalar> - */ - public function getXmlAttributes(Node $node): array - { - return []; - } -} diff --git a/vendor/league/commonmark/src/Extension/TableOfContents/TableOfContentsRenderer.php b/vendor/league/commonmark/src/Extension/TableOfContents/TableOfContentsRenderer.php deleted file mode 100644 index da1b6983..00000000 --- a/vendor/league/commonmark/src/Extension/TableOfContents/TableOfContentsRenderer.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\TableOfContents; - -use League\CommonMark\Node\Node; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\CommonMark\Xml\XmlNodeRendererInterface; - -final class TableOfContentsRenderer implements NodeRendererInterface, XmlNodeRendererInterface -{ - /** @var NodeRendererInterface&XmlNodeRendererInterface */ - private $innerRenderer; - - /** - * @psalm-param NodeRendererInterface&XmlNodeRendererInterface $innerRenderer - * - * @phpstan-param NodeRendererInterface&XmlNodeRendererInterface $innerRenderer - */ - public function __construct(NodeRendererInterface $innerRenderer) - { - $this->innerRenderer = $innerRenderer; - } - - /** - * {@inheritDoc} - */ - public function render(Node $node, ChildNodeRendererInterface $childRenderer) - { - return $this->innerRenderer->render($node, $childRenderer); - } - - public function getXmlTagName(Node $node): string - { - return 'table_of_contents'; - } - - /** - * @return array<string, scalar> - */ - public function getXmlAttributes(Node $node): array - { - return $this->innerRenderer->getXmlAttributes($node); - } -} diff --git a/vendor/league/commonmark/src/Extension/TaskList/TaskListExtension.php b/vendor/league/commonmark/src/Extension/TaskList/TaskListExtension.php deleted file mode 100644 index bf4b0d23..00000000 --- a/vendor/league/commonmark/src/Extension/TaskList/TaskListExtension.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\TaskList; - -use League\CommonMark\Environment\EnvironmentBuilderInterface; -use League\CommonMark\Extension\ExtensionInterface; - -final class TaskListExtension implements ExtensionInterface -{ - public function register(EnvironmentBuilderInterface $environment): void - { - $environment->addInlineParser(new TaskListItemMarkerParser(), 35); - $environment->addRenderer(TaskListItemMarker::class, new TaskListItemMarkerRenderer()); - } -} diff --git a/vendor/league/commonmark/src/Extension/TaskList/TaskListItemMarker.php b/vendor/league/commonmark/src/Extension/TaskList/TaskListItemMarker.php deleted file mode 100644 index 125ae405..00000000 --- a/vendor/league/commonmark/src/Extension/TaskList/TaskListItemMarker.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\TaskList; - -use League\CommonMark\Node\Inline\AbstractInline; - -final class TaskListItemMarker extends AbstractInline -{ - /** @psalm-readonly-allow-private-mutation */ - private bool $checked; - - public function __construct(bool $isCompleted) - { - parent::__construct(); - - $this->checked = $isCompleted; - } - - public function isChecked(): bool - { - return $this->checked; - } - - public function setChecked(bool $checked): void - { - $this->checked = $checked; - } -} diff --git a/vendor/league/commonmark/src/Extension/TaskList/TaskListItemMarkerParser.php b/vendor/league/commonmark/src/Extension/TaskList/TaskListItemMarkerParser.php deleted file mode 100644 index 30e27316..00000000 --- a/vendor/league/commonmark/src/Extension/TaskList/TaskListItemMarkerParser.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\TaskList; - -use League\CommonMark\Extension\CommonMark\Node\Block\ListItem; -use League\CommonMark\Node\Block\Paragraph; -use League\CommonMark\Parser\Inline\InlineParserInterface; -use League\CommonMark\Parser\Inline\InlineParserMatch; -use League\CommonMark\Parser\InlineParserContext; - -final class TaskListItemMarkerParser implements InlineParserInterface -{ - public function getMatchDefinition(): InlineParserMatch - { - return InlineParserMatch::oneOf('[ ]', '[x]'); - } - - public function parse(InlineParserContext $inlineContext): bool - { - $container = $inlineContext->getContainer(); - - // Checkbox must come at the beginning of the first paragraph of the list item - if ($container->hasChildren() || ! ($container instanceof Paragraph && $container->parent() && $container->parent() instanceof ListItem)) { - return false; - } - - $cursor = $inlineContext->getCursor(); - $oldState = $cursor->saveState(); - - $cursor->advanceBy(3); - - if ($cursor->getNextNonSpaceCharacter() === null) { - $cursor->restoreState($oldState); - - return false; - } - - $isChecked = $inlineContext->getFullMatch() !== '[ ]'; - - $container->appendChild(new TaskListItemMarker($isChecked)); - - return true; - } -} diff --git a/vendor/league/commonmark/src/Extension/TaskList/TaskListItemMarkerRenderer.php b/vendor/league/commonmark/src/Extension/TaskList/TaskListItemMarkerRenderer.php deleted file mode 100644 index a1eb745c..00000000 --- a/vendor/league/commonmark/src/Extension/TaskList/TaskListItemMarkerRenderer.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Extension\TaskList; - -use League\CommonMark\Node\Node; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\CommonMark\Util\HtmlElement; -use League\CommonMark\Xml\XmlNodeRendererInterface; - -final class TaskListItemMarkerRenderer implements NodeRendererInterface, XmlNodeRendererInterface -{ - /** - * @param TaskListItemMarker $node - * - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function render(Node $node, ChildNodeRendererInterface $childRenderer): \Stringable - { - TaskListItemMarker::assertInstanceOf($node); - - $attrs = $node->data->get('attributes'); - $checkbox = new HtmlElement('input', $attrs, '', true); - - if ($node->isChecked()) { - $checkbox->setAttribute('checked', ''); - } - - $checkbox->setAttribute('disabled', ''); - $checkbox->setAttribute('type', 'checkbox'); - - return $checkbox; - } - - public function getXmlTagName(Node $node): string - { - return 'task_list_item_marker'; - } - - /** - * @param TaskListItemMarker $node - * - * @return array<string, scalar> - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function getXmlAttributes(Node $node): array - { - TaskListItemMarker::assertInstanceOf($node); - - if ($node->isChecked()) { - return ['checked' => 'checked']; - } - - return []; - } -} diff --git a/vendor/league/commonmark/src/GithubFlavoredMarkdownConverter.php b/vendor/league/commonmark/src/GithubFlavoredMarkdownConverter.php deleted file mode 100644 index f2524b22..00000000 --- a/vendor/league/commonmark/src/GithubFlavoredMarkdownConverter.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark; - -use League\CommonMark\Environment\Environment; -use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension; -use League\CommonMark\Extension\GithubFlavoredMarkdownExtension; - -/** - * Converts GitHub Flavored Markdown to HTML. - */ -final class GithubFlavoredMarkdownConverter extends MarkdownConverter -{ - /** - * Create a new Markdown converter pre-configured for GFM - * - * @param array<string, mixed> $config - */ - public function __construct(array $config = []) - { - $environment = new Environment($config); - $environment->addExtension(new CommonMarkCoreExtension()); - $environment->addExtension(new GithubFlavoredMarkdownExtension()); - - parent::__construct($environment); - } - - public function getEnvironment(): Environment - { - \assert($this->environment instanceof Environment); - - return $this->environment; - } -} diff --git a/vendor/league/commonmark/src/Input/MarkdownInput.php b/vendor/league/commonmark/src/Input/MarkdownInput.php deleted file mode 100644 index bbe1618a..00000000 --- a/vendor/league/commonmark/src/Input/MarkdownInput.php +++ /dev/null @@ -1,102 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Input; - -use League\CommonMark\Exception\UnexpectedEncodingException; - -class MarkdownInput implements MarkdownInputInterface -{ - /** - * @var array<int, string>|null - * - * @psalm-readonly-allow-private-mutation - */ - private ?array $lines = null; - - /** @psalm-readonly-allow-private-mutation */ - private string $content; - - /** @psalm-readonly-allow-private-mutation */ - private ?int $lineCount = null; - - /** @psalm-readonly */ - private int $lineOffset; - - public function __construct(string $content, int $lineOffset = 0) - { - if (! \mb_check_encoding($content, 'UTF-8')) { - throw new UnexpectedEncodingException('Unexpected encoding - UTF-8 or ASCII was expected'); - } - - // Strip any leading UTF-8 BOM - if (\substr($content, 0, 3) === "\xEF\xBB\xBF") { - $content = \substr($content, 3); - } - - $this->content = $content; - $this->lineOffset = $lineOffset; - } - - public function getContent(): string - { - return $this->content; - } - - /** - * {@inheritDoc} - */ - public function getLines(): iterable - { - $this->splitLinesIfNeeded(); - - \assert($this->lines !== null); - - /** @psalm-suppress PossiblyNullIterator */ - foreach ($this->lines as $i => $line) { - yield $this->lineOffset + $i + 1 => $line; - } - } - - public function getLineCount(): int - { - $this->splitLinesIfNeeded(); - - \assert($this->lineCount !== null); - - return $this->lineCount; - } - - private function splitLinesIfNeeded(): void - { - if ($this->lines !== null) { - return; - } - - $lines = \preg_split('/\r\n|\n|\r/', $this->content); - if ($lines === false) { - throw new UnexpectedEncodingException('Failed to split Markdown content by line'); - } - - $this->lines = $lines; - - // Remove any newline which appears at the very end of the string. - // We've already split the document by newlines, so we can simply drop - // any empty element which appears on the end. - if (\end($this->lines) === '') { - \array_pop($this->lines); - } - - $this->lineCount = \count($this->lines); - } -} diff --git a/vendor/league/commonmark/src/Input/MarkdownInputInterface.php b/vendor/league/commonmark/src/Input/MarkdownInputInterface.php deleted file mode 100644 index bb8d6f1d..00000000 --- a/vendor/league/commonmark/src/Input/MarkdownInputInterface.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Input; - -interface MarkdownInputInterface -{ - public function getContent(): string; - - /** - * @return iterable<int, string> - */ - public function getLines(): iterable; - - public function getLineCount(): int; -} diff --git a/vendor/league/commonmark/src/MarkdownConverter.php b/vendor/league/commonmark/src/MarkdownConverter.php deleted file mode 100644 index ac6c4d50..00000000 --- a/vendor/league/commonmark/src/MarkdownConverter.php +++ /dev/null @@ -1,92 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark; - -use League\CommonMark\Environment\EnvironmentInterface; -use League\CommonMark\Output\RenderedContentInterface; -use League\CommonMark\Parser\MarkdownParser; -use League\CommonMark\Parser\MarkdownParserInterface; -use League\CommonMark\Renderer\HtmlRenderer; -use League\CommonMark\Renderer\MarkdownRendererInterface; - -class MarkdownConverter implements ConverterInterface, MarkdownConverterInterface -{ - /** @psalm-readonly */ - protected EnvironmentInterface $environment; - - /** @psalm-readonly */ - protected MarkdownParserInterface $markdownParser; - - /** @psalm-readonly */ - protected MarkdownRendererInterface $htmlRenderer; - - public function __construct(EnvironmentInterface $environment) - { - $this->environment = $environment; - - $this->markdownParser = new MarkdownParser($environment); - $this->htmlRenderer = new HtmlRenderer($environment); - } - - public function getEnvironment(): EnvironmentInterface - { - return $this->environment; - } - - /** - * Converts Markdown to HTML. - * - * @param string $input The Markdown to convert - * - * @return RenderedContentInterface Rendered HTML - * - * @throws \RuntimeException - */ - public function convert(string $input): RenderedContentInterface - { - $documentAST = $this->markdownParser->parse($input); - - return $this->htmlRenderer->renderDocument($documentAST); - } - - /** - * Converts Markdown to HTML. - * - * @deprecated since 2.2; use {@link convert()} instead - * - * @param string $markdown The Markdown to convert - * - * @return RenderedContentInterface Rendered HTML - * - * @throws \RuntimeException - */ - public function convertToHtml(string $markdown): RenderedContentInterface - { - \trigger_deprecation('league/commonmark', '2.2.0', 'Calling "convertToHtml()" on a %s class is deprecated, use "convert()" instead.', self::class); - - return $this->convert($markdown); - } - - /** - * Converts CommonMark to HTML. - * - * @see MarkdownConverter::convert() - * - * @throws \RuntimeException - */ - public function __invoke(string $markdown): RenderedContentInterface - { - return $this->convert($markdown); - } -} diff --git a/vendor/league/commonmark/src/MarkdownConverterInterface.php b/vendor/league/commonmark/src/MarkdownConverterInterface.php deleted file mode 100644 index 5cdc9755..00000000 --- a/vendor/league/commonmark/src/MarkdownConverterInterface.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark; - -use League\CommonMark\Output\RenderedContentInterface; - -/** - * Interface for a service which converts Markdown to HTML. - * - * @deprecated since 2.2; use {@link ConverterInterface} instead - */ -interface MarkdownConverterInterface -{ - /** - * Converts Markdown to HTML. - * - * @deprecated since 2.2; use {@link ConverterInterface::convert()} instead - * - * @throws \RuntimeException - */ - public function convertToHtml(string $markdown): RenderedContentInterface; -} diff --git a/vendor/league/commonmark/src/Node/Block/AbstractBlock.php b/vendor/league/commonmark/src/Node/Block/AbstractBlock.php deleted file mode 100644 index c44013d8..00000000 --- a/vendor/league/commonmark/src/Node/Block/AbstractBlock.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Node\Block; - -use League\CommonMark\Node\Node; - -/** - * Block-level element - * - * @method parent() ?AbstractBlock - */ -abstract class AbstractBlock extends Node -{ - protected ?int $startLine = null; - - protected ?int $endLine = null; - - protected function setParent(?Node $node = null): void - { - if ($node && ! $node instanceof self) { - throw new \InvalidArgumentException('Parent of block must also be block (cannot be inline)'); - } - - parent::setParent($node); - } - - public function setStartLine(?int $startLine): void - { - $this->startLine = $startLine; - if ($this->endLine === null) { - $this->endLine = $startLine; - } - } - - public function getStartLine(): ?int - { - return $this->startLine; - } - - public function setEndLine(?int $endLine): void - { - $this->endLine = $endLine; - } - - public function getEndLine(): ?int - { - return $this->endLine; - } -} diff --git a/vendor/league/commonmark/src/Node/Block/Document.php b/vendor/league/commonmark/src/Node/Block/Document.php deleted file mode 100644 index ee7ee44e..00000000 --- a/vendor/league/commonmark/src/Node/Block/Document.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Node\Block; - -use League\CommonMark\Parser\Cursor; -use League\CommonMark\Reference\ReferenceMap; -use League\CommonMark\Reference\ReferenceMapInterface; - -class Document extends AbstractBlock -{ - /** @psalm-readonly */ - protected ReferenceMapInterface $referenceMap; - - public function __construct(?ReferenceMapInterface $referenceMap = null) - { - parent::__construct(); - - $this->setStartLine(1); - - $this->referenceMap = $referenceMap ?? new ReferenceMap(); - } - - public function getReferenceMap(): ReferenceMapInterface - { - return $this->referenceMap; - } - - public function canContain(AbstractBlock $block): bool - { - return true; - } - - public function isCode(): bool - { - return false; - } - - public function matchesNextLine(Cursor $cursor): bool - { - return true; - } -} diff --git a/vendor/league/commonmark/src/Node/Block/Paragraph.php b/vendor/league/commonmark/src/Node/Block/Paragraph.php deleted file mode 100644 index 5b7d17c2..00000000 --- a/vendor/league/commonmark/src/Node/Block/Paragraph.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Node\Block; - -class Paragraph extends AbstractBlock -{ -} diff --git a/vendor/league/commonmark/src/Node/Block/TightBlockInterface.php b/vendor/league/commonmark/src/Node/Block/TightBlockInterface.php deleted file mode 100644 index 21a5868e..00000000 --- a/vendor/league/commonmark/src/Node/Block/TightBlockInterface.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Node\Block; - -interface TightBlockInterface -{ - public function isTight(): bool; - - public function setTight(bool $tight): void; -} diff --git a/vendor/league/commonmark/src/Node/Inline/AbstractInline.php b/vendor/league/commonmark/src/Node/Inline/AbstractInline.php deleted file mode 100644 index d3705b44..00000000 --- a/vendor/league/commonmark/src/Node/Inline/AbstractInline.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Node\Inline; - -use League\CommonMark\Node\Node; - -abstract class AbstractInline extends Node -{ -} diff --git a/vendor/league/commonmark/src/Node/Inline/AbstractStringContainer.php b/vendor/league/commonmark/src/Node/Inline/AbstractStringContainer.php deleted file mode 100644 index 9e64660d..00000000 --- a/vendor/league/commonmark/src/Node/Inline/AbstractStringContainer.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Node\Inline; - -use League\CommonMark\Node\StringContainerInterface; - -abstract class AbstractStringContainer extends AbstractInline implements StringContainerInterface -{ - protected string $literal = ''; - - /** - * @param array<string, mixed> $data - */ - public function __construct(string $contents = '', array $data = []) - { - parent::__construct(); - - $this->literal = $contents; - $this->data->import($data); - } - - public function getLiteral(): string - { - return $this->literal; - } - - public function setLiteral(string $literal): void - { - $this->literal = $literal; - } -} diff --git a/vendor/league/commonmark/src/Node/Inline/AdjacentTextMerger.php b/vendor/league/commonmark/src/Node/Inline/AdjacentTextMerger.php deleted file mode 100644 index 43922d42..00000000 --- a/vendor/league/commonmark/src/Node/Inline/AdjacentTextMerger.php +++ /dev/null @@ -1,105 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Additional emphasis processing code based on commonmark-java (https://github.com/atlassian/commonmark-java) - * - (c) Atlassian Pty Ltd - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Node\Inline; - -use League\CommonMark\Node\Node; - -/** - * @internal - */ -final class AdjacentTextMerger -{ - public static function mergeChildNodes(Node $node): void - { - // No children or just one child node, no need for merging - if ($node->firstChild() === $node->lastChild() || $node->firstChild() === null || $node->lastChild() === null) { - return; - } - - /** @psalm-suppress PossiblyNullArgument */ - self::mergeTextNodesInclusive($node->firstChild(), $node->lastChild()); - } - - public static function mergeTextNodesBetweenExclusive(Node $fromNode, Node $toNode): void - { - // No nodes between them - if ($fromNode === $toNode || $fromNode->next() === $toNode || $fromNode->next() === null || $toNode->previous() === null) { - return; - } - - /** @psalm-suppress PossiblyNullArgument */ - self::mergeTextNodesInclusive($fromNode->next(), $toNode->previous()); - } - - public static function mergeWithDirectlyAdjacentNodes(Text $node): void - { - $start = ($previous = $node->previous()) instanceof Text ? $previous : $node; - $end = ($next = $node->next()) instanceof Text ? $next : $node; - - self::mergeIfNeeded($start, $end); - } - - private static function mergeTextNodesInclusive(Node $fromNode, Node $toNode): void - { - $first = null; - $last = null; - - $node = $fromNode; - while ($node !== null) { - if ($node instanceof Text) { - if ($first === null) { - $first = $node; - } - - $last = $node; - } else { - self::mergeIfNeeded($first, $last); - $first = null; - $last = null; - } - - if ($node === $toNode) { - break; - } - - $node = $node->next(); - } - - self::mergeIfNeeded($first, $last); - } - - private static function mergeIfNeeded(?Text $first, ?Text $last): void - { - if ($first === null || $last === null || $first === $last) { - // No merging needed - return; - } - - $s = $first->getLiteral(); - - $node = $first->next(); - $stop = $last->next(); - while ($node !== $stop && $node instanceof Text) { - $s .= $node->getLiteral(); - $unlink = $node; - $node = $node->next(); - $unlink->detach(); - } - - $first->setLiteral($s); - } -} diff --git a/vendor/league/commonmark/src/Node/Inline/DelimitedInterface.php b/vendor/league/commonmark/src/Node/Inline/DelimitedInterface.php deleted file mode 100644 index 89773faa..00000000 --- a/vendor/league/commonmark/src/Node/Inline/DelimitedInterface.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Node\Inline; - -interface DelimitedInterface -{ - public function getOpeningDelimiter(): string; - - public function getClosingDelimiter(): string; -} diff --git a/vendor/league/commonmark/src/Node/Inline/Newline.php b/vendor/league/commonmark/src/Node/Inline/Newline.php deleted file mode 100644 index 68790de0..00000000 --- a/vendor/league/commonmark/src/Node/Inline/Newline.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Node\Inline; - -final class Newline extends AbstractInline -{ - // Any changes to these constants should be reflected in .phpstorm.meta.php - public const HARDBREAK = 0; - public const SOFTBREAK = 1; - - /** @psalm-readonly */ - private int $type; - - public function __construct(int $breakType = self::HARDBREAK) - { - parent::__construct(); - - $this->type = $breakType; - } - - /** @psalm-immutable */ - public function getType(): int - { - return $this->type; - } -} diff --git a/vendor/league/commonmark/src/Node/Inline/Text.php b/vendor/league/commonmark/src/Node/Inline/Text.php deleted file mode 100644 index 31387f91..00000000 --- a/vendor/league/commonmark/src/Node/Inline/Text.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Node\Inline; - -final class Text extends AbstractStringContainer -{ - public function append(string $literal): void - { - $this->literal .= $literal; - } -} diff --git a/vendor/league/commonmark/src/Node/Node.php b/vendor/league/commonmark/src/Node/Node.php deleted file mode 100644 index f3e400b3..00000000 --- a/vendor/league/commonmark/src/Node/Node.php +++ /dev/null @@ -1,261 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Node; - -use Dflydev\DotAccessData\Data; - -abstract class Node -{ - /** @psalm-readonly */ - public Data $data; - - /** @psalm-readonly-allow-private-mutation */ - protected int $depth = 0; - - /** @psalm-readonly-allow-private-mutation */ - protected ?Node $parent = null; - - /** @psalm-readonly-allow-private-mutation */ - protected ?Node $previous = null; - - /** @psalm-readonly-allow-private-mutation */ - protected ?Node $next = null; - - /** @psalm-readonly-allow-private-mutation */ - protected ?Node $firstChild = null; - - /** @psalm-readonly-allow-private-mutation */ - protected ?Node $lastChild = null; - - public function __construct() - { - $this->data = new Data([ - 'attributes' => [], - ]); - } - - public function previous(): ?Node - { - return $this->previous; - } - - public function next(): ?Node - { - return $this->next; - } - - public function parent(): ?Node - { - return $this->parent; - } - - protected function setParent(?Node $node = null): void - { - $this->parent = $node; - $this->depth = $node === null ? 0 : $node->depth + 1; - } - - /** - * Inserts the $sibling node after $this - */ - public function insertAfter(Node $sibling): void - { - $sibling->detach(); - $sibling->next = $this->next; - - if ($sibling->next) { - $sibling->next->previous = $sibling; - } - - $sibling->previous = $this; - $this->next = $sibling; - $sibling->setParent($this->parent); - - if (! $sibling->next && $sibling->parent) { - $sibling->parent->lastChild = $sibling; - } - } - - /** - * Inserts the $sibling node before $this - */ - public function insertBefore(Node $sibling): void - { - $sibling->detach(); - $sibling->previous = $this->previous; - - if ($sibling->previous) { - $sibling->previous->next = $sibling; - } - - $sibling->next = $this; - $this->previous = $sibling; - $sibling->setParent($this->parent); - - if (! $sibling->previous && $sibling->parent) { - $sibling->parent->firstChild = $sibling; - } - } - - public function replaceWith(Node $replacement): void - { - $replacement->detach(); - $this->insertAfter($replacement); - $this->detach(); - } - - public function detach(): void - { - if ($this->previous) { - $this->previous->next = $this->next; - } elseif ($this->parent) { - $this->parent->firstChild = $this->next; - } - - if ($this->next) { - $this->next->previous = $this->previous; - } elseif ($this->parent) { - $this->parent->lastChild = $this->previous; - } - - $this->parent = null; - $this->next = null; - $this->previous = null; - $this->depth = 0; - } - - public function hasChildren(): bool - { - return $this->firstChild !== null; - } - - public function firstChild(): ?Node - { - return $this->firstChild; - } - - public function lastChild(): ?Node - { - return $this->lastChild; - } - - /** - * @return Node[] - */ - public function children(): iterable - { - $children = []; - for ($current = $this->firstChild; $current !== null; $current = $current->next) { - $children[] = $current; - } - - return $children; - } - - public function appendChild(Node $child): void - { - if ($this->lastChild) { - $this->lastChild->insertAfter($child); - } else { - $child->detach(); - $child->setParent($this); - $this->lastChild = $this->firstChild = $child; - } - } - - /** - * Adds $child as the very first child of $this - */ - public function prependChild(Node $child): void - { - if ($this->firstChild) { - $this->firstChild->insertBefore($child); - } else { - $child->detach(); - $child->setParent($this); - $this->lastChild = $this->firstChild = $child; - } - } - - /** - * Detaches all child nodes of given node - */ - public function detachChildren(): void - { - foreach ($this->children() as $children) { - $children->setParent(null); - } - - $this->firstChild = $this->lastChild = null; - } - - /** - * Replace all children of given node with collection of another - * - * @param iterable<Node> $children - */ - public function replaceChildren(iterable $children): void - { - $this->detachChildren(); - foreach ($children as $item) { - $this->appendChild($item); - } - } - - public function getDepth(): int - { - return $this->depth; - } - - public function walker(): NodeWalker - { - return new NodeWalker($this); - } - - public function iterator(int $flags = 0): NodeIterator - { - return new NodeIterator($this, $flags); - } - - /** - * Clone the current node and its children - * - * WARNING: This is a recursive function and should not be called on deeply-nested node trees! - */ - public function __clone() - { - // Cloned nodes are detached from their parents, siblings, and children - $this->parent = null; - $this->previous = null; - $this->next = null; - // But save a copy of the children since we'll need that in a moment - $children = $this->children(); - $this->detachChildren(); - - // The original children get cloned and re-added - foreach ($children as $child) { - $this->appendChild(clone $child); - } - } - - public static function assertInstanceOf(Node $node): void - { - if (! $node instanceof static) { - throw new \InvalidArgumentException(\sprintf('Incompatible node type: expected %s, got %s', static::class, \get_class($node))); - } - } -} diff --git a/vendor/league/commonmark/src/Node/NodeIterator.php b/vendor/league/commonmark/src/Node/NodeIterator.php deleted file mode 100644 index 3d295ef1..00000000 --- a/vendor/league/commonmark/src/Node/NodeIterator.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Node; - -use League\CommonMark\Node\Block\AbstractBlock; - -/** - * @implements \IteratorAggregate<int, Node> - */ -final class NodeIterator implements \IteratorAggregate -{ - public const FLAG_BLOCKS_ONLY = 1; - - private Node $node; - private bool $blocksOnly; - - public function __construct(Node $node, int $flags = 0) - { - $this->node = $node; - $this->blocksOnly = ($flags & self::FLAG_BLOCKS_ONLY) === self::FLAG_BLOCKS_ONLY; - } - - /** - * @return \Generator<int, Node> - */ - public function getIterator(): \Generator - { - $stack = [$this->node]; - $index = 0; - - while ($stack) { - $node = \array_pop($stack); - - yield $index++ => $node; - - // Push all children onto the stack in reverse order - $child = $node->lastChild(); - while ($child !== null) { - if (! $this->blocksOnly || $child instanceof AbstractBlock) { - $stack[] = $child; - } - - $child = $child->previous(); - } - } - } -} diff --git a/vendor/league/commonmark/src/Node/NodeWalker.php b/vendor/league/commonmark/src/Node/NodeWalker.php deleted file mode 100644 index 6f922e83..00000000 --- a/vendor/league/commonmark/src/Node/NodeWalker.php +++ /dev/null @@ -1,80 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Node; - -use League\CommonMark\Node\Block\AbstractBlock; - -final class NodeWalker -{ - /** @psalm-readonly */ - private Node $root; - - /** @psalm-readonly-allow-private-mutation */ - private ?Node $current = null; - - /** @psalm-readonly-allow-private-mutation */ - private bool $entering; - - public function __construct(Node $root) - { - $this->root = $root; - $this->current = $this->root; - $this->entering = true; - } - - /** - * Returns an event which contains node and entering flag - * (entering is true when we enter a Node from a parent or sibling, - * and false when we reenter it from child) - */ - public function next(): ?NodeWalkerEvent - { - $current = $this->current; - $entering = $this->entering; - if ($current === null) { - return null; - } - - if ($entering && ($current instanceof AbstractBlock || $current->hasChildren())) { - if ($current->firstChild()) { - $this->current = $current->firstChild(); - $this->entering = true; - } else { - $this->entering = false; - } - } elseif ($current === $this->root) { - $this->current = null; - } elseif ($current->next() === null) { - $this->current = $current->parent(); - $this->entering = false; - } else { - $this->current = $current->next(); - $this->entering = true; - } - - return new NodeWalkerEvent($current, $entering); - } - - /** - * Resets the iterator to resume at the specified node - */ - public function resumeAt(Node $node, bool $entering = true): void - { - $this->current = $node; - $this->entering = $entering; - } -} diff --git a/vendor/league/commonmark/src/Node/NodeWalkerEvent.php b/vendor/league/commonmark/src/Node/NodeWalkerEvent.php deleted file mode 100644 index 773ec3a9..00000000 --- a/vendor/league/commonmark/src/Node/NodeWalkerEvent.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Node; - -final class NodeWalkerEvent -{ - /** @psalm-readonly */ - private Node $node; - - /** @psalm-readonly */ - private bool $isEntering; - - public function __construct(Node $node, bool $isEntering = true) - { - $this->node = $node; - $this->isEntering = $isEntering; - } - - public function getNode(): Node - { - return $this->node; - } - - public function isEntering(): bool - { - return $this->isEntering; - } -} diff --git a/vendor/league/commonmark/src/Node/Query.php b/vendor/league/commonmark/src/Node/Query.php deleted file mode 100644 index 7e76fe35..00000000 --- a/vendor/league/commonmark/src/Node/Query.php +++ /dev/null @@ -1,139 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Node; - -use League\CommonMark\Node\Query\AndExpr; -use League\CommonMark\Node\Query\OrExpr; - -final class Query -{ - /** @var callable(Node): bool $condition */ - private $condition; - - public function __construct() - { - $this->condition = new AndExpr(); - } - - public function where(callable ...$conditions): self - { - return $this->andWhere(...$conditions); - } - - public function andWhere(callable ...$conditions): self - { - if ($this->condition instanceof AndExpr) { - foreach ($conditions as $condition) { - $this->condition->add($condition); - } - } else { - $this->condition = new AndExpr($this->condition, ...$conditions); - } - - return $this; - } - - public function orWhere(callable ...$conditions): self - { - if ($this->condition instanceof OrExpr) { - foreach ($conditions as $condition) { - $this->condition->add($condition); - } - } else { - $this->condition = new OrExpr($this->condition, ...$conditions); - } - - return $this; - } - - public function findOne(Node $node): ?Node - { - foreach ($node->iterator() as $n) { - if (\call_user_func($this->condition, $n)) { - return $n; - } - } - - return null; - } - - /** - * @return iterable<Node> - */ - public function findAll(Node $node, ?int $limit = PHP_INT_MAX): iterable - { - $resultCount = 0; - - foreach ($node->iterator() as $n) { - if ($resultCount >= $limit) { - break; - } - - if (! \call_user_func($this->condition, $n)) { - continue; - } - - ++$resultCount; - - yield $n; - } - } - - /** - * @return callable(Node): bool - */ - public static function type(string $class): callable - { - return static fn (Node $node): bool => $node instanceof $class; - } - - /** - * @psalm-param ?callable(Node): bool $condition - * - * @return callable(Node): bool - */ - public static function hasChild(?callable $condition = null): callable - { - return static function (Node $node) use ($condition): bool { - foreach ($node->children() as $child) { - if ($condition === null || $condition($child)) { - return true; - } - } - - return false; - }; - } - - /** - * @psalm-param ?callable(Node): bool $condition - * - * @return callable(Node): bool - */ - public static function hasParent(?callable $condition = null): callable - { - return static function (Node $node) use ($condition): bool { - $parent = $node->parent(); - if ($parent === null) { - return false; - } - - if ($condition === null) { - return true; - } - - return $condition($parent); - }; - } -} diff --git a/vendor/league/commonmark/src/Node/Query/AndExpr.php b/vendor/league/commonmark/src/Node/Query/AndExpr.php deleted file mode 100644 index ceb441a4..00000000 --- a/vendor/league/commonmark/src/Node/Query/AndExpr.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Node\Query; - -use League\CommonMark\Node\Node; - -/** - * @internal - */ -final class AndExpr implements ExpressionInterface -{ - /** - * @var callable[] - * @psalm-var list<callable(Node): bool> - */ - private array $conditions; - - /** - * @psalm-param callable(Node): bool $expressions - */ - public function __construct(callable ...$expressions) - { - $this->conditions = $expressions; - } - - /** - * @param callable(Node): bool $expression - */ - public function add(callable $expression): void - { - $this->conditions[] = $expression; - } - - public function __invoke(Node $node): bool - { - foreach ($this->conditions as $condition) { - if (! $condition($node)) { - return false; - } - } - - return true; - } -} diff --git a/vendor/league/commonmark/src/Node/Query/ExpressionInterface.php b/vendor/league/commonmark/src/Node/Query/ExpressionInterface.php deleted file mode 100644 index 2bbbc7fe..00000000 --- a/vendor/league/commonmark/src/Node/Query/ExpressionInterface.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Node\Query; - -use League\CommonMark\Node\Node; - -interface ExpressionInterface -{ - public function __invoke(Node $node): bool; -} diff --git a/vendor/league/commonmark/src/Node/Query/OrExpr.php b/vendor/league/commonmark/src/Node/Query/OrExpr.php deleted file mode 100644 index df2adef7..00000000 --- a/vendor/league/commonmark/src/Node/Query/OrExpr.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Node\Query; - -use League\CommonMark\Node\Node; - -/** - * @internal - */ -final class OrExpr implements ExpressionInterface -{ - /** - * @var callable[] - * @psalm-var list<callable(Node): bool> - */ - private array $conditions; - - /** - * @psalm-param callable(Node): bool $expressions - */ - public function __construct(callable ...$expressions) - { - $this->conditions = $expressions; - } - - /** - * @param callable(Node): bool $expression - */ - public function add(callable $expression): void - { - $this->conditions[] = $expression; - } - - public function __invoke(Node $node): bool - { - foreach ($this->conditions as $condition) { - if ($condition($node)) { - return true; - } - } - - return false; - } -} diff --git a/vendor/league/commonmark/src/Node/RawMarkupContainerInterface.php b/vendor/league/commonmark/src/Node/RawMarkupContainerInterface.php deleted file mode 100644 index 1545285d..00000000 --- a/vendor/league/commonmark/src/Node/RawMarkupContainerInterface.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Node; - -/** - * Interface for a node which contains raw, unprocessed markup (like HTML) - */ -interface RawMarkupContainerInterface extends StringContainerInterface -{ -} diff --git a/vendor/league/commonmark/src/Node/StringContainerHelper.php b/vendor/league/commonmark/src/Node/StringContainerHelper.php deleted file mode 100644 index 8e1ec34d..00000000 --- a/vendor/league/commonmark/src/Node/StringContainerHelper.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Node; - -final class StringContainerHelper -{ - /** - * Extract text literals from all descendant nodes - * - * @param Node $node Parent node - * @param array<string> $excludeTypes Optional list of node class types to exclude - * - * @return string Concatenated literals - */ - public static function getChildText(Node $node, array $excludeTypes = []): string - { - $text = ''; - - foreach ($node->iterator() as $child) { - if ($child instanceof StringContainerInterface && ! self::isOneOf($child, $excludeTypes)) { - $text .= $child->getLiteral(); - } - } - - return $text; - } - - /** - * @param string[] $classesOrInterfacesToCheck - * - * @psalm-pure - */ - private static function isOneOf(object $object, array $classesOrInterfacesToCheck): bool - { - foreach ($classesOrInterfacesToCheck as $type) { - if ($object instanceof $type) { - return true; - } - } - - return false; - } -} diff --git a/vendor/league/commonmark/src/Node/StringContainerInterface.php b/vendor/league/commonmark/src/Node/StringContainerInterface.php deleted file mode 100644 index 23564ae7..00000000 --- a/vendor/league/commonmark/src/Node/StringContainerInterface.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Node; - -/** - * Interface for a node which directly contains line(s) of text - */ -interface StringContainerInterface -{ - public function setLiteral(string $literal): void; - - public function getLiteral(): string; -} diff --git a/vendor/league/commonmark/src/Normalizer/SlugNormalizer.php b/vendor/league/commonmark/src/Normalizer/SlugNormalizer.php deleted file mode 100644 index d41ea24c..00000000 --- a/vendor/league/commonmark/src/Normalizer/SlugNormalizer.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Normalizer; - -use League\Config\ConfigurationAwareInterface; -use League\Config\ConfigurationInterface; - -/** - * Creates URL-friendly strings based on the given string input - */ -final class SlugNormalizer implements TextNormalizerInterface, ConfigurationAwareInterface -{ - /** @psalm-allow-private-mutation */ - private int $defaultMaxLength = 255; - - public function setConfiguration(ConfigurationInterface $configuration): void - { - $this->defaultMaxLength = $configuration->get('slug_normalizer/max_length'); - } - - /** - * {@inheritDoc} - * - * @psalm-immutable - */ - public function normalize(string $text, array $context = []): string - { - // Add any requested prefix - $slug = ($context['prefix'] ?? '') . $text; - // Trim whitespace - $slug = \trim($slug); - // Convert to lowercase - $slug = \mb_strtolower($slug, 'UTF-8'); - // Try replacing whitespace with a dash - $slug = \preg_replace('/\s+/u', '-', $slug) ?? $slug; - // Try removing characters other than letters, numbers, and marks. - $slug = \preg_replace('/[^\p{L}\p{Nd}\p{Nl}\p{M}-]+/u', '', $slug) ?? $slug; - // Trim to requested length if given - if ($length = $context['length'] ?? $this->defaultMaxLength) { - $slug = \mb_substr($slug, 0, $length, 'UTF-8'); - } - - return $slug; - } -} diff --git a/vendor/league/commonmark/src/Normalizer/TextNormalizer.php b/vendor/league/commonmark/src/Normalizer/TextNormalizer.php deleted file mode 100644 index 7860f1b9..00000000 --- a/vendor/league/commonmark/src/Normalizer/TextNormalizer.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Normalizer; - -/*** - * Normalize text input using the steps given by the CommonMark spec to normalize labels - * - * @see https://spec.commonmark.org/0.29/#matches - * - * @psalm-immutable - */ -final class TextNormalizer implements TextNormalizerInterface -{ - /** - * {@inheritDoc} - * - * @psalm-pure - */ - public function normalize(string $text, array $context = []): string - { - // Collapse internal whitespace to single space and remove - // leading/trailing whitespace - $text = \preg_replace('/[ \t\r\n]+/', ' ', \trim($text)); - \assert(\is_string($text)); - - return \mb_convert_case($text, \MB_CASE_FOLD, 'UTF-8'); - } -} diff --git a/vendor/league/commonmark/src/Normalizer/TextNormalizerInterface.php b/vendor/league/commonmark/src/Normalizer/TextNormalizerInterface.php deleted file mode 100644 index f4762342..00000000 --- a/vendor/league/commonmark/src/Normalizer/TextNormalizerInterface.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Normalizer; - -/** - * Creates a normalized version of the given input text - */ -interface TextNormalizerInterface -{ - /** - * @param string $text The text to normalize - * @param array<string, mixed> $context Additional context about the text being normalized (optional) - * - * $context may include (but is not required to include) the following: - * - `prefix` - A string prefix to prepend to each normalized result - * - `length` - The requested maximum length - * - `node` - The node we're normalizing text for - * - * Implementations do not have to use or respect any information within that $context - */ - public function normalize(string $text, array $context = []): string; -} diff --git a/vendor/league/commonmark/src/Normalizer/UniqueSlugNormalizer.php b/vendor/league/commonmark/src/Normalizer/UniqueSlugNormalizer.php deleted file mode 100644 index 591f19fb..00000000 --- a/vendor/league/commonmark/src/Normalizer/UniqueSlugNormalizer.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Normalizer; - -// phpcs:disable Squiz.Strings.DoubleQuoteUsage.ContainsVar -final class UniqueSlugNormalizer implements UniqueSlugNormalizerInterface -{ - private TextNormalizerInterface $innerNormalizer; - /** @var array<string, bool> */ - private array $alreadyUsed = []; - - public function __construct(TextNormalizerInterface $innerNormalizer) - { - $this->innerNormalizer = $innerNormalizer; - } - - public function clearHistory(): void - { - $this->alreadyUsed = []; - } - - /** - * {@inheritDoc} - * - * @psalm-allow-private-mutation - */ - public function normalize(string $text, array $context = []): string - { - $normalized = $this->innerNormalizer->normalize($text, $context); - - // If it's not unique, add an incremental number to the end until we get a unique version - if (\array_key_exists($normalized, $this->alreadyUsed)) { - $suffix = 0; - do { - ++$suffix; - } while (\array_key_exists("$normalized-$suffix", $this->alreadyUsed)); - - $normalized = "$normalized-$suffix"; - } - - $this->alreadyUsed[$normalized] = true; - - return $normalized; - } -} diff --git a/vendor/league/commonmark/src/Normalizer/UniqueSlugNormalizerInterface.php b/vendor/league/commonmark/src/Normalizer/UniqueSlugNormalizerInterface.php deleted file mode 100644 index 642edebe..00000000 --- a/vendor/league/commonmark/src/Normalizer/UniqueSlugNormalizerInterface.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Normalizer; - -interface UniqueSlugNormalizerInterface extends TextNormalizerInterface -{ - public const DISABLED = false; - public const PER_ENVIRONMENT = 'environment'; - public const PER_DOCUMENT = 'document'; - - /** - * Called by the Environment whenever the configured scope changes - * - * Currently, this will only be called PER_DOCUMENT. - */ - public function clearHistory(): void; -} diff --git a/vendor/league/commonmark/src/Output/RenderedContent.php b/vendor/league/commonmark/src/Output/RenderedContent.php deleted file mode 100644 index 4bf612d0..00000000 --- a/vendor/league/commonmark/src/Output/RenderedContent.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Output; - -use League\CommonMark\Node\Block\Document; - -class RenderedContent implements RenderedContentInterface, \Stringable -{ - /** @psalm-readonly */ - private Document $document; - - /** @psalm-readonly */ - private string $content; - - public function __construct(Document $document, string $content) - { - $this->document = $document; - $this->content = $content; - } - - public function getDocument(): Document - { - return $this->document; - } - - public function getContent(): string - { - return $this->content; - } - - /** - * @psalm-mutation-free - */ - public function __toString(): string - { - return $this->content; - } -} diff --git a/vendor/league/commonmark/src/Output/RenderedContentInterface.php b/vendor/league/commonmark/src/Output/RenderedContentInterface.php deleted file mode 100644 index 2179b1bf..00000000 --- a/vendor/league/commonmark/src/Output/RenderedContentInterface.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Output; - -use League\CommonMark\Node\Block\Document; - -interface RenderedContentInterface extends \Stringable -{ - /** - * @psalm-mutation-free - */ - public function getDocument(): Document; - - /** - * @psalm-mutation-free - */ - public function getContent(): string; -} diff --git a/vendor/league/commonmark/src/Parser/Block/AbstractBlockContinueParser.php b/vendor/league/commonmark/src/Parser/Block/AbstractBlockContinueParser.php deleted file mode 100644 index 889532ed..00000000 --- a/vendor/league/commonmark/src/Parser/Block/AbstractBlockContinueParser.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Parser\Block; - -use League\CommonMark\Node\Block\AbstractBlock; - -/** - * Base class for a block parser - * - * Slightly more convenient to extend from vs. implementing the interface - */ -abstract class AbstractBlockContinueParser implements BlockContinueParserInterface -{ - public function isContainer(): bool - { - return false; - } - - public function canHaveLazyContinuationLines(): bool - { - return false; - } - - public function canContain(AbstractBlock $childBlock): bool - { - return false; - } - - public function addLine(string $line): void - { - } - - public function closeBlock(): void - { - } -} diff --git a/vendor/league/commonmark/src/Parser/Block/BlockContinue.php b/vendor/league/commonmark/src/Parser/Block/BlockContinue.php deleted file mode 100644 index 4b5f37d4..00000000 --- a/vendor/league/commonmark/src/Parser/Block/BlockContinue.php +++ /dev/null @@ -1,73 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Parser\Block; - -use League\CommonMark\Parser\Cursor; -use League\CommonMark\Parser\CursorState; - -/** - * Result object for continuing parsing of a block; see static methods for constructors. - * - * @psalm-immutable - */ -final class BlockContinue -{ - /** @psalm-readonly */ - private ?CursorState $cursorState = null; - - /** @psalm-readonly */ - private bool $finalize; - - private function __construct(?CursorState $cursorState = null, bool $finalize = false) - { - $this->cursorState = $cursorState; - $this->finalize = $finalize; - } - - public function getCursorState(): ?CursorState - { - return $this->cursorState; - } - - public function isFinalize(): bool - { - return $this->finalize; - } - - /** - * Signal that we cannot continue here - * - * @return null - */ - public static function none(): ?self - { - return null; - } - - /** - * Signal that we're continuing at the given position - */ - public static function at(Cursor $cursor): self - { - return new self($cursor->saveState(), false); - } - - /** - * Signal that we want to finalize and close the block - */ - public static function finished(): self - { - return new self(null, true); - } -} diff --git a/vendor/league/commonmark/src/Parser/Block/BlockContinueParserInterface.php b/vendor/league/commonmark/src/Parser/Block/BlockContinueParserInterface.php deleted file mode 100644 index b6e54724..00000000 --- a/vendor/league/commonmark/src/Parser/Block/BlockContinueParserInterface.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Parser\Block; - -use League\CommonMark\Node\Block\AbstractBlock; -use League\CommonMark\Parser\Cursor; - -/** - * Interface for a block continuation parser - * - * A block continue parser can only handle a single block instance. The current block being parsed is stored within this parser and - * can be returned once parsing has completed. If you need to parse multiple block continuations, instantiate a new parser for each one. - */ -interface BlockContinueParserInterface -{ - /** - * Return the current block being parsed by this parser - */ - public function getBlock(): AbstractBlock; - - /** - * Return whether we are parsing a container block - */ - public function isContainer(): bool; - - /** - * Return whether we are interested in possibly lazily parsing any subsequent lines - */ - public function canHaveLazyContinuationLines(): bool; - - /** - * Determine whether the current block being parsed can contain the given child block - */ - public function canContain(AbstractBlock $childBlock): bool; - - /** - * Attempt to parse the given line - */ - public function tryContinue(Cursor $cursor, BlockContinueParserInterface $activeBlockParser): ?BlockContinue; - - /** - * Add the given line of text to the current block - */ - public function addLine(string $line): void; - - /** - * Close and finalize the current block - */ - public function closeBlock(): void; -} diff --git a/vendor/league/commonmark/src/Parser/Block/BlockContinueParserWithInlinesInterface.php b/vendor/league/commonmark/src/Parser/Block/BlockContinueParserWithInlinesInterface.php deleted file mode 100644 index 6f826c9a..00000000 --- a/vendor/league/commonmark/src/Parser/Block/BlockContinueParserWithInlinesInterface.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Parser\Block; - -use League\CommonMark\Parser\InlineParserEngineInterface; - -interface BlockContinueParserWithInlinesInterface extends BlockContinueParserInterface -{ - /** - * Parse any inlines inside of the current block - */ - public function parseInlines(InlineParserEngineInterface $inlineParser): void; -} diff --git a/vendor/league/commonmark/src/Parser/Block/BlockStart.php b/vendor/league/commonmark/src/Parser/Block/BlockStart.php deleted file mode 100644 index 55766228..00000000 --- a/vendor/league/commonmark/src/Parser/Block/BlockStart.php +++ /dev/null @@ -1,124 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Parser\Block; - -use League\CommonMark\Parser\Cursor; -use League\CommonMark\Parser\CursorState; - -/** - * Result object for starting parsing of a block; see static methods for constructors - */ -final class BlockStart -{ - /** - * @var BlockContinueParserInterface[] - * - * @psalm-readonly - */ - private array $blockParsers; - - /** @psalm-readonly-allow-private-mutation */ - private ?CursorState $cursorState = null; - - /** @psalm-readonly-allow-private-mutation */ - private bool $replaceActiveBlockParser = false; - - private bool $isAborting = false; - - private function __construct(BlockContinueParserInterface ...$blockParsers) - { - $this->blockParsers = $blockParsers; - } - - /** - * @return BlockContinueParserInterface[] - */ - public function getBlockParsers(): iterable - { - return $this->blockParsers; - } - - public function getCursorState(): ?CursorState - { - return $this->cursorState; - } - - public function isReplaceActiveBlockParser(): bool - { - return $this->replaceActiveBlockParser; - } - - /** - * @internal - */ - public function isAborting(): bool - { - return $this->isAborting; - } - - /** - * Signal that we want to parse at the given cursor position - * - * @return $this - */ - public function at(Cursor $cursor): self - { - $this->cursorState = $cursor->saveState(); - - return $this; - } - - /** - * Signal that we want to replace the active block parser with this one - * - * @return $this - */ - public function replaceActiveBlockParser(): self - { - $this->replaceActiveBlockParser = true; - - return $this; - } - - /** - * Signal that we cannot parse whatever is here - * - * @return null - */ - public static function none(): ?self - { - return null; - } - - /** - * Signal that we'd like to register the given parser(s) so they can parse the current block - */ - public static function of(BlockContinueParserInterface ...$blockParsers): self - { - return new self(...$blockParsers); - } - - /** - * Signal that the block parsing process should be aborted (no other block starts should be checked) - * - * @internal - */ - public static function abort(): self - { - $ret = new self(); - $ret->isAborting = true; - - return $ret; - } -} diff --git a/vendor/league/commonmark/src/Parser/Block/BlockStartParserInterface.php b/vendor/league/commonmark/src/Parser/Block/BlockStartParserInterface.php deleted file mode 100644 index 90ed7814..00000000 --- a/vendor/league/commonmark/src/Parser/Block/BlockStartParserInterface.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Parser\Block; - -use League\CommonMark\Parser\Cursor; -use League\CommonMark\Parser\MarkdownParserStateInterface; - -/** - * Interface for a block parser which identifies block starts. - */ -interface BlockStartParserInterface -{ - /** - * Check whether we should handle the block at the current position - * - * @param Cursor $cursor A cloned copy of the cursor at the current parsing location - * @param MarkdownParserStateInterface $parserState Additional information about the state of the Markdown parser - * - * @return BlockStart|null The BlockStart that has been identified, or null if the block doesn't match here - */ - public function tryStart(Cursor $cursor, MarkdownParserStateInterface $parserState): ?BlockStart; -} diff --git a/vendor/league/commonmark/src/Parser/Block/DocumentBlockParser.php b/vendor/league/commonmark/src/Parser/Block/DocumentBlockParser.php deleted file mode 100644 index bacb5122..00000000 --- a/vendor/league/commonmark/src/Parser/Block/DocumentBlockParser.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Parser\Block; - -use League\CommonMark\Node\Block\AbstractBlock; -use League\CommonMark\Node\Block\Document; -use League\CommonMark\Parser\Cursor; -use League\CommonMark\Reference\ReferenceMapInterface; - -/** - * Parser implementation which ensures everything is added to the root-level Document - */ -final class DocumentBlockParser extends AbstractBlockContinueParser -{ - /** @psalm-readonly */ - private Document $document; - - public function __construct(ReferenceMapInterface $referenceMap) - { - $this->document = new Document($referenceMap); - } - - public function getBlock(): Document - { - return $this->document; - } - - public function isContainer(): bool - { - return true; - } - - public function canContain(AbstractBlock $childBlock): bool - { - return true; - } - - public function tryContinue(Cursor $cursor, BlockContinueParserInterface $activeBlockParser): ?BlockContinue - { - return BlockContinue::at($cursor); - } -} diff --git a/vendor/league/commonmark/src/Parser/Block/ParagraphParser.php b/vendor/league/commonmark/src/Parser/Block/ParagraphParser.php deleted file mode 100644 index 1573429f..00000000 --- a/vendor/league/commonmark/src/Parser/Block/ParagraphParser.php +++ /dev/null @@ -1,87 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Parser\Block; - -use League\CommonMark\Node\Block\Paragraph; -use League\CommonMark\Parser\Cursor; -use League\CommonMark\Parser\InlineParserEngineInterface; -use League\CommonMark\Reference\ReferenceInterface; -use League\CommonMark\Reference\ReferenceParser; - -final class ParagraphParser extends AbstractBlockContinueParser implements BlockContinueParserWithInlinesInterface -{ - /** @psalm-readonly */ - private Paragraph $block; - - /** @psalm-readonly */ - private ReferenceParser $referenceParser; - - public function __construct() - { - $this->block = new Paragraph(); - $this->referenceParser = new ReferenceParser(); - } - - public function canHaveLazyContinuationLines(): bool - { - return true; - } - - public function getBlock(): Paragraph - { - return $this->block; - } - - public function tryContinue(Cursor $cursor, BlockContinueParserInterface $activeBlockParser): ?BlockContinue - { - if ($cursor->isBlank()) { - return BlockContinue::none(); - } - - return BlockContinue::at($cursor); - } - - public function addLine(string $line): void - { - $this->referenceParser->parse($line); - } - - public function closeBlock(): void - { - if ($this->referenceParser->hasReferences() && $this->referenceParser->getParagraphContent() === '') { - $this->block->detach(); - } - } - - public function parseInlines(InlineParserEngineInterface $inlineParser): void - { - $content = $this->getContentString(); - if ($content !== '') { - $inlineParser->parse($content, $this->block); - } - } - - public function getContentString(): string - { - return $this->referenceParser->getParagraphContent(); - } - - /** - * @return ReferenceInterface[] - */ - public function getReferences(): iterable - { - return $this->referenceParser->getReferences(); - } -} diff --git a/vendor/league/commonmark/src/Parser/Block/SkipLinesStartingWithLettersParser.php b/vendor/league/commonmark/src/Parser/Block/SkipLinesStartingWithLettersParser.php deleted file mode 100644 index 95d8bd2f..00000000 --- a/vendor/league/commonmark/src/Parser/Block/SkipLinesStartingWithLettersParser.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Parser\Block; - -use League\CommonMark\Parser\Cursor; -use League\CommonMark\Parser\MarkdownParserStateInterface; -use League\CommonMark\Util\RegexHelper; - -/** - * @internal - * - * This "parser" is actually a performance optimization. - * - * Most lines in a typical Markdown document probably won't match a block start. This is especially true for lines starting - * with letters - nothing in the core CommonMark spec or our supported extensions will match those lines as blocks. Therefore, - * if we can identify those lines and skip block start parsing, we can optimize performance by ~10%. - * - * Previously this optimization was hard-coded in the MarkdownParser but did not allow users to override this behavior. - * By implementing this optimization as a block parser instead, users wanting custom blocks starting with letters - * can instead register their block parser with a higher priority to ensure their parser is always called first. - */ -final class SkipLinesStartingWithLettersParser implements BlockStartParserInterface -{ - public function tryStart(Cursor $cursor, MarkdownParserStateInterface $parserState): ?BlockStart - { - if (! $cursor->isIndented() && RegexHelper::isLetter($cursor->getNextNonSpaceCharacter())) { - $cursor->advanceToNextNonSpaceOrTab(); - - return BlockStart::abort(); - } - - return BlockStart::none(); - } -} diff --git a/vendor/league/commonmark/src/Parser/Cursor.php b/vendor/league/commonmark/src/Parser/Cursor.php deleted file mode 100644 index 23072a01..00000000 --- a/vendor/league/commonmark/src/Parser/Cursor.php +++ /dev/null @@ -1,481 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Parser; - -use League\CommonMark\Exception\UnexpectedEncodingException; - -class Cursor -{ - public const INDENT_LEVEL = 4; - - /** @psalm-readonly */ - private string $line; - - /** @psalm-readonly */ - private int $length; - - /** - * @var int - * - * It's possible for this to be 1 char past the end, meaning we've parsed all chars and have - * reached the end. In this state, any character-returning method MUST return null. - */ - private int $currentPosition = 0; - - private int $column = 0; - - private int $indent = 0; - - private int $previousPosition = 0; - - private ?int $nextNonSpaceCache = null; - - private bool $partiallyConsumedTab = false; - - /** @psalm-readonly */ - private bool $lineContainsTabs; - - /** @psalm-readonly */ - private bool $isMultibyte; - - /** @var array<int, string> */ - private array $charCache = []; - - /** - * @param string $line The line being parsed (ASCII or UTF-8) - */ - public function __construct(string $line) - { - if (! \mb_check_encoding($line, 'UTF-8')) { - throw new UnexpectedEncodingException('Unexpected encoding - UTF-8 or ASCII was expected'); - } - - $this->line = $line; - $this->length = \mb_strlen($line, 'UTF-8') ?: 0; - $this->isMultibyte = $this->length !== \strlen($line); - $this->lineContainsTabs = \strpos($line, "\t") !== false; - } - - /** - * Returns the position of the next character which is not a space (or tab) - */ - public function getNextNonSpacePosition(): int - { - if ($this->nextNonSpaceCache !== null) { - return $this->nextNonSpaceCache; - } - - $c = null; - $i = $this->currentPosition; - $cols = $this->column; - - while (($c = $this->getCharacter($i)) !== null) { - if ($c === ' ') { - $i++; - $cols++; - } elseif ($c === "\t") { - $i++; - $cols += 4 - ($cols % 4); - } else { - break; - } - } - - $nextNonSpace = $c === null ? $this->length : $i; - $this->indent = $cols - $this->column; - - return $this->nextNonSpaceCache = $nextNonSpace; - } - - /** - * Returns the next character which isn't a space (or tab) - */ - public function getNextNonSpaceCharacter(): ?string - { - return $this->getCharacter($this->getNextNonSpacePosition()); - } - - /** - * Calculates the current indent (number of spaces after current position) - */ - public function getIndent(): int - { - if ($this->nextNonSpaceCache === null) { - $this->getNextNonSpacePosition(); - } - - return $this->indent; - } - - /** - * Whether the cursor is indented to INDENT_LEVEL - */ - public function isIndented(): bool - { - if ($this->nextNonSpaceCache === null) { - $this->getNextNonSpacePosition(); - } - - return $this->indent >= self::INDENT_LEVEL; - } - - public function getCharacter(?int $index = null): ?string - { - if ($index === null) { - $index = $this->currentPosition; - } - - // Index out-of-bounds, or we're at the end - if ($index < 0 || $index >= $this->length) { - return null; - } - - if ($this->isMultibyte) { - return $this->charCache[$index] ??= \mb_substr($this->line, $index, 1, 'UTF-8'); - } - - return $this->line[$index]; - } - - /** - * Slightly-optimized version of getCurrent(null) - */ - public function getCurrentCharacter(): ?string - { - if ($this->currentPosition >= $this->length) { - return null; - } - - if ($this->isMultibyte) { - return $this->charCache[$this->currentPosition] ??= \mb_substr($this->line, $this->currentPosition, 1, 'UTF-8'); - } - - return $this->line[$this->currentPosition]; - } - - /** - * Returns the next character (or null, if none) without advancing forwards - */ - public function peek(int $offset = 1): ?string - { - return $this->getCharacter($this->currentPosition + $offset); - } - - /** - * Whether the remainder is blank - */ - public function isBlank(): bool - { - return $this->nextNonSpaceCache === $this->length || $this->getNextNonSpacePosition() === $this->length; - } - - /** - * Move the cursor forwards - */ - public function advance(): void - { - $this->advanceBy(1); - } - - /** - * Move the cursor forwards - * - * @param int $characters Number of characters to advance by - * @param bool $advanceByColumns Whether to advance by columns instead of spaces - */ - public function advanceBy(int $characters, bool $advanceByColumns = false): void - { - $this->previousPosition = $this->currentPosition; - - $this->nextNonSpaceCache = null; - - // Optimization to avoid tab handling logic if we have no tabs - if (! $this->lineContainsTabs) { - $this->advanceWithoutTabCharacters($characters); - - return; - } - - $nextFewChars = $this->isMultibyte ? - \mb_substr($this->line, $this->currentPosition, $characters, 'UTF-8') : - \substr($this->line, $this->currentPosition, $characters); - - if ($nextFewChars === '') { - return; - } - - // Optimization to avoid tab handling logic if we have no tabs - if (\strpos($nextFewChars, "\t") === false) { - $this->advanceWithoutTabCharacters($characters); - - return; - } - - if ($characters === 1) { - $asArray = [$nextFewChars]; - } elseif ($this->isMultibyte) { - /** @var string[] $asArray */ - $asArray = \mb_str_split($nextFewChars, 1, 'UTF-8'); - } else { - $asArray = \str_split($nextFewChars); - } - - foreach ($asArray as $c) { - if ($c === "\t") { - $charsToTab = 4 - ($this->column % 4); - if ($advanceByColumns) { - $this->partiallyConsumedTab = $charsToTab > $characters; - $charsToAdvance = $charsToTab > $characters ? $characters : $charsToTab; - $this->column += $charsToAdvance; - $this->currentPosition += $this->partiallyConsumedTab ? 0 : 1; - $characters -= $charsToAdvance; - } else { - $this->partiallyConsumedTab = false; - $this->column += $charsToTab; - $this->currentPosition++; - $characters--; - } - } else { - $this->partiallyConsumedTab = false; - $this->currentPosition++; - $this->column++; - $characters--; - } - - if ($characters <= 0) { - break; - } - } - } - - private function advanceWithoutTabCharacters(int $characters): void - { - $length = \min($characters, $this->length - $this->currentPosition); - $this->partiallyConsumedTab = false; - $this->currentPosition += $length; - $this->column += $length; - } - - /** - * Advances the cursor by a single space or tab, if present - */ - public function advanceBySpaceOrTab(): bool - { - $character = $this->getCurrentCharacter(); - - if ($character === ' ' || $character === "\t") { - $this->advanceBy(1, true); - - return true; - } - - return false; - } - - /** - * Parse zero or more space/tab characters - * - * @return int Number of positions moved - */ - public function advanceToNextNonSpaceOrTab(): int - { - $newPosition = $this->nextNonSpaceCache ?? $this->getNextNonSpacePosition(); - if ($newPosition === $this->currentPosition) { - return 0; - } - - $this->advanceBy($newPosition - $this->currentPosition); - $this->partiallyConsumedTab = false; - - // We've just advanced to where that non-space is, - // so any subsequent calls to find the next one will - // always return the current position. - $this->nextNonSpaceCache = $this->currentPosition; - $this->indent = 0; - - return $this->currentPosition - $this->previousPosition; - } - - /** - * Parse zero or more space characters, including at most one newline. - * - * Tab characters are not parsed with this function. - * - * @return int Number of positions moved - */ - public function advanceToNextNonSpaceOrNewline(): int - { - $remainder = $this->getRemainder(); - - // Optimization: Avoid the regex if we know there are no spaces or newlines - if ($remainder === '' || ($remainder[0] !== ' ' && $remainder[0] !== "\n")) { - $this->previousPosition = $this->currentPosition; - - return 0; - } - - $matches = []; - \preg_match('/^ *(?:\n *)?/', $remainder, $matches, \PREG_OFFSET_CAPTURE); - - // [0][0] contains the matched text - // [0][1] contains the index of that match - $increment = $matches[0][1] + \strlen($matches[0][0]); - - $this->advanceBy($increment); - - return $this->currentPosition - $this->previousPosition; - } - - /** - * Move the position to the very end of the line - * - * @return int The number of characters moved - */ - public function advanceToEnd(): int - { - $this->previousPosition = $this->currentPosition; - $this->nextNonSpaceCache = null; - - $this->currentPosition = $this->length; - - return $this->currentPosition - $this->previousPosition; - } - - public function getRemainder(): string - { - if ($this->currentPosition >= $this->length) { - return ''; - } - - $prefix = ''; - $position = $this->currentPosition; - if ($this->partiallyConsumedTab) { - $position++; - $charsToTab = 4 - ($this->column % 4); - $prefix = \str_repeat(' ', $charsToTab); - } - - $subString = $this->isMultibyte ? - \mb_substr($this->line, $position, null, 'UTF-8') : - \substr($this->line, $position); - - return $prefix . $subString; - } - - public function getLine(): string - { - return $this->line; - } - - public function isAtEnd(): bool - { - return $this->currentPosition >= $this->length; - } - - /** - * Try to match a regular expression - * - * Returns the matching text and advances to the end of that match - */ - public function match(string $regex): ?string - { - $subject = $this->getRemainder(); - - if (! \preg_match($regex, $subject, $matches, \PREG_OFFSET_CAPTURE)) { - return null; - } - - // $matches[0][0] contains the matched text - // $matches[0][1] contains the index of that match - - if ($this->isMultibyte) { - // PREG_OFFSET_CAPTURE always returns the byte offset, not the char offset, which is annoying - $offset = \mb_strlen(\substr($subject, 0, $matches[0][1]), 'UTF-8'); - $matchLength = \mb_strlen($matches[0][0], 'UTF-8'); - } else { - $offset = $matches[0][1]; - $matchLength = \strlen($matches[0][0]); - } - - // [0][0] contains the matched text - // [0][1] contains the index of that match - $this->advanceBy($offset + $matchLength); - - return $matches[0][0]; - } - - /** - * Encapsulates the current state of this cursor in case you need to rollback later. - * - * WARNING: Do not parse or use the return value for ANYTHING except for - * passing it back into restoreState(), as the number of values and their - * contents may change in any future release without warning. - */ - public function saveState(): CursorState - { - return new CursorState([ - $this->currentPosition, - $this->previousPosition, - $this->nextNonSpaceCache, - $this->indent, - $this->column, - $this->partiallyConsumedTab, - ]); - } - - /** - * Restore the cursor to a previous state. - * - * Pass in the value previously obtained by calling saveState(). - */ - public function restoreState(CursorState $state): void - { - [ - $this->currentPosition, - $this->previousPosition, - $this->nextNonSpaceCache, - $this->indent, - $this->column, - $this->partiallyConsumedTab, - ] = $state->toArray(); - } - - public function getPosition(): int - { - return $this->currentPosition; - } - - public function getPreviousText(): string - { - return \mb_substr($this->line, $this->previousPosition, $this->currentPosition - $this->previousPosition, 'UTF-8'); - } - - public function getSubstring(int $start, ?int $length = null): string - { - if ($this->isMultibyte) { - return \mb_substr($this->line, $start, $length, 'UTF-8'); - } - - if ($length !== null) { - return \substr($this->line, $start, $length); - } - - return \substr($this->line, $start); - } - - public function getColumn(): int - { - return $this->column; - } -} diff --git a/vendor/league/commonmark/src/Parser/CursorState.php b/vendor/league/commonmark/src/Parser/CursorState.php deleted file mode 100644 index 4a6c2d96..00000000 --- a/vendor/league/commonmark/src/Parser/CursorState.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Parser; - -/** - * Encapsulates the current state of a cursor in case you need to rollback later. - * - * WARNING: Do not attempt to use this class for ANYTHING except for - * type hinting and passing this object back into restoreState(). - * The constructor, methods, and inner contents may change in any - * future release without warning! - * - * @internal - * - * @psalm-immutable - */ -final class CursorState -{ - /** - * @var array<int, mixed> - * - * @psalm-readonly - */ - private array $state; - - /** - * @internal - * - * @param array<int, mixed> $state - */ - public function __construct(array $state) - { - $this->state = $state; - } - - /** - * @internal - * - * @return array<int, mixed> - */ - public function toArray(): array - { - return $this->state; - } -} diff --git a/vendor/league/commonmark/src/Parser/Inline/InlineParserInterface.php b/vendor/league/commonmark/src/Parser/Inline/InlineParserInterface.php deleted file mode 100644 index fd13435b..00000000 --- a/vendor/league/commonmark/src/Parser/Inline/InlineParserInterface.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Parser\Inline; - -use League\CommonMark\Parser\InlineParserContext; - -interface InlineParserInterface -{ - public function getMatchDefinition(): InlineParserMatch; - - public function parse(InlineParserContext $inlineContext): bool; -} diff --git a/vendor/league/commonmark/src/Parser/Inline/InlineParserMatch.php b/vendor/league/commonmark/src/Parser/Inline/InlineParserMatch.php deleted file mode 100644 index 9e8e7a98..00000000 --- a/vendor/league/commonmark/src/Parser/Inline/InlineParserMatch.php +++ /dev/null @@ -1,83 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Parser\Inline; - -final class InlineParserMatch -{ - private string $regex; - - private bool $caseSensitive; - - private function __construct(string $regex, bool $caseSensitive = false) - { - $this->regex = $regex; - $this->caseSensitive = $caseSensitive; - } - - public function caseSensitive(): self - { - $this->caseSensitive = true; - - return $this; - } - - /** - * @internal - */ - public function getRegex(): string - { - return '/' . $this->regex . '/' . ($this->caseSensitive ? '' : 'i'); - } - - /** - * Match the given string (case-insensitive) - */ - public static function string(string $str): self - { - return new self(\preg_quote($str, '/')); - } - - /** - * Match any of the given strings (case-insensitive) - */ - public static function oneOf(string ...$str): self - { - return new self(\implode('|', \array_map(static fn (string $str): string => \preg_quote($str, '/'), $str))); - } - - /** - * Match a partial regular expression without starting/ending delimiters, anchors, or flags - */ - public static function regex(string $regex): self - { - return new self($regex); - } - - public static function join(self ...$definitions): self - { - $regex = ''; - $caseSensitive = null; - foreach ($definitions as $definition) { - $regex .= '(' . $definition->regex . ')'; - - if ($caseSensitive === null) { - $caseSensitive = $definition->caseSensitive; - } elseif ($caseSensitive !== $definition->caseSensitive) { - throw new \LogicException('Case-sensitive and case-insensitive defintions cannot be comined'); - } - } - - return new self($regex, $caseSensitive ?? false); - } -} diff --git a/vendor/league/commonmark/src/Parser/Inline/NewlineParser.php b/vendor/league/commonmark/src/Parser/Inline/NewlineParser.php deleted file mode 100644 index eb10d917..00000000 --- a/vendor/league/commonmark/src/Parser/Inline/NewlineParser.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Parser\Inline; - -use League\CommonMark\Node\Inline\Newline; -use League\CommonMark\Node\Inline\Text; -use League\CommonMark\Parser\InlineParserContext; - -final class NewlineParser implements InlineParserInterface -{ - public function getMatchDefinition(): InlineParserMatch - { - return InlineParserMatch::regex('\\n'); - } - - public function parse(InlineParserContext $inlineContext): bool - { - $inlineContext->getCursor()->advanceBy(1); - - // Check previous inline for trailing spaces - $spaces = 0; - $lastInline = $inlineContext->getContainer()->lastChild(); - if ($lastInline instanceof Text) { - $trimmed = \rtrim($lastInline->getLiteral(), ' '); - $spaces = \strlen($lastInline->getLiteral()) - \strlen($trimmed); - if ($spaces) { - $lastInline->setLiteral($trimmed); - } - } - - if ($spaces >= 2) { - $inlineContext->getContainer()->appendChild(new Newline(Newline::HARDBREAK)); - } else { - $inlineContext->getContainer()->appendChild(new Newline(Newline::SOFTBREAK)); - } - - return true; - } -} diff --git a/vendor/league/commonmark/src/Parser/InlineParserContext.php b/vendor/league/commonmark/src/Parser/InlineParserContext.php deleted file mode 100644 index 796f2f38..00000000 --- a/vendor/league/commonmark/src/Parser/InlineParserContext.php +++ /dev/null @@ -1,120 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Parser; - -use League\CommonMark\Delimiter\DelimiterStack; -use League\CommonMark\Node\Block\AbstractBlock; -use League\CommonMark\Reference\ReferenceMapInterface; - -final class InlineParserContext -{ - /** @psalm-readonly */ - private AbstractBlock $container; - - /** @psalm-readonly */ - private ReferenceMapInterface $referenceMap; - - /** @psalm-readonly */ - private Cursor $cursor; - - /** @psalm-readonly */ - private DelimiterStack $delimiterStack; - - /** - * @var string[] - * @psalm-var non-empty-array<string> - * - * @psalm-readonly-allow-private-mutation - */ - private array $matches; - - public function __construct(Cursor $contents, AbstractBlock $container, ReferenceMapInterface $referenceMap) - { - $this->referenceMap = $referenceMap; - $this->container = $container; - $this->cursor = $contents; - $this->delimiterStack = new DelimiterStack(); - } - - public function getContainer(): AbstractBlock - { - return $this->container; - } - - public function getReferenceMap(): ReferenceMapInterface - { - return $this->referenceMap; - } - - public function getCursor(): Cursor - { - return $this->cursor; - } - - public function getDelimiterStack(): DelimiterStack - { - return $this->delimiterStack; - } - - /** - * @return string The full text that matched the InlineParserMatch definition - */ - public function getFullMatch(): string - { - return $this->matches[0]; - } - - /** - * @return int The length of the full match (in characters, not bytes) - */ - public function getFullMatchLength(): int - { - return \mb_strlen($this->matches[0], 'UTF-8'); - } - - /** - * @return string[] Similar to preg_match(), index 0 will contain the full match, and any other array elements will be captured sub-matches - * - * @psalm-return non-empty-array<string> - */ - public function getMatches(): array - { - return $this->matches; - } - - /** - * @return string[] - */ - public function getSubMatches(): array - { - return \array_slice($this->matches, 1); - } - - /** - * @param string[] $matches - * - * @psalm-param non-empty-array<string> $matches - */ - public function withMatches(array $matches): InlineParserContext - { - $ctx = clone $this; - - $ctx->matches = $matches; - - return $ctx; - } -} diff --git a/vendor/league/commonmark/src/Parser/InlineParserEngine.php b/vendor/league/commonmark/src/Parser/InlineParserEngine.php deleted file mode 100644 index 42a1bcdc..00000000 --- a/vendor/league/commonmark/src/Parser/InlineParserEngine.php +++ /dev/null @@ -1,177 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Parser; - -use League\CommonMark\Environment\EnvironmentInterface; -use League\CommonMark\Node\Block\AbstractBlock; -use League\CommonMark\Node\Inline\AdjacentTextMerger; -use League\CommonMark\Node\Inline\Text; -use League\CommonMark\Parser\Inline\InlineParserInterface; -use League\CommonMark\Reference\ReferenceMapInterface; - -/** - * @internal - */ -final class InlineParserEngine implements InlineParserEngineInterface -{ - /** @psalm-readonly */ - private EnvironmentInterface $environment; - - /** @psalm-readonly */ - private ReferenceMapInterface $referenceMap; - - /** - * @var array<int, InlineParserInterface|string|bool> - * @psalm-var list<array{0: InlineParserInterface, 1: string, 2: bool}> - * @phpstan-var array<int, array{0: InlineParserInterface, 1: string, 2: bool}> - */ - private array $parsers = []; - - public function __construct(EnvironmentInterface $environment, ReferenceMapInterface $referenceMap) - { - $this->environment = $environment; - $this->referenceMap = $referenceMap; - - foreach ($environment->getInlineParsers() as $parser) { - \assert($parser instanceof InlineParserInterface); - $regex = $parser->getMatchDefinition()->getRegex(); - - $this->parsers[] = [$parser, $regex, \strlen($regex) !== \mb_strlen($regex, 'UTF-8')]; - } - } - - public function parse(string $contents, AbstractBlock $block): void - { - $contents = \trim($contents); - $cursor = new Cursor($contents); - - $inlineParserContext = new InlineParserContext($cursor, $block, $this->referenceMap); - - // Have all parsers look at the line to determine what they might want to parse and what positions they exist at - foreach ($this->matchParsers($contents) as $matchPosition => $parsers) { - $currentPosition = $cursor->getPosition(); - // We've already gone past this point - if ($currentPosition > $matchPosition) { - continue; - } - - // We've skipped over some uninteresting text that should be added as a plain text node - if ($currentPosition < $matchPosition) { - $cursor->advanceBy($matchPosition - $currentPosition); - $this->addPlainText($cursor->getPreviousText(), $block); - } - - // We're now at a potential start - see which of the current parsers can handle it - $parsed = false; - foreach ($parsers as [$parser, $matches]) { - \assert($parser instanceof InlineParserInterface); - if ($parser->parse($inlineParserContext->withMatches($matches))) { - // A parser has successfully handled the text at the given position; don't consider any others at this position - $parsed = true; - break; - } - } - - if ($parsed) { - continue; - } - - // Despite potentially being interested, nothing actually parsed text here, so add the current character and continue onwards - $this->addPlainText((string) $cursor->getCurrentCharacter(), $block); - $cursor->advance(); - } - - // Add any remaining text that wasn't parsed - if (! $cursor->isAtEnd()) { - $this->addPlainText($cursor->getRemainder(), $block); - } - - // Process any delimiters that were found - $delimiterStack = $inlineParserContext->getDelimiterStack(); - $delimiterStack->processDelimiters(null, $this->environment->getDelimiterProcessors()); - $delimiterStack->removeAll(); - - // Combine adjacent text notes into one - AdjacentTextMerger::mergeChildNodes($block); - } - - private function addPlainText(string $text, AbstractBlock $container): void - { - $lastInline = $container->lastChild(); - if ($lastInline instanceof Text && ! $lastInline->data->has('delim')) { - $lastInline->append($text); - } else { - $container->appendChild(new Text($text)); - } - } - - /** - * Given the current line, ask all the parsers which parts of the text they would be interested in parsing. - * - * The resulting array provides a list of character positions, which parsers are interested in trying to parse - * the text at those points, and (for convenience/optimization) what the matching text happened to be. - * - * @return array<array<int, InlineParserInterface|string>> - * - * @psalm-return array<int, list<array{0: InlineParserInterface, 1: non-empty-array<string>}>> - * - * @phpstan-return array<int, array<int, array{0: InlineParserInterface, 1: non-empty-array<string>}>> - */ - private function matchParsers(string $contents): array - { - $contents = \trim($contents); - $isMultibyte = \mb_strlen($contents, 'UTF-8') !== \strlen($contents); - - $ret = []; - - foreach ($this->parsers as [$parser, $regex, $isRegexMultibyte]) { - if ($isMultibyte || $isRegexMultibyte) { - $regex .= 'u'; - } - - // See if the parser's InlineParserMatch regex matched against any part of the string - if (! \preg_match_all($regex, $contents, $matches, \PREG_OFFSET_CAPTURE | \PREG_SET_ORDER)) { - continue; - } - - // For each part that matched... - foreach ($matches as $match) { - if ($isMultibyte) { - // PREG_OFFSET_CAPTURE always returns the byte offset, not the char offset, which is annoying - $offset = \mb_strlen(\substr($contents, 0, $match[0][1]), 'UTF-8'); - } else { - $offset = \intval($match[0][1]); - } - - // Remove the offsets, keeping only the matched text - $m = \array_column($match, 0); - - if ($m === []) { - continue; - } - - // Add this match to the list of character positions to stop at - $ret[$offset][] = [$parser, $m]; - } - } - - // Sort matches by position so we visit them in order - \ksort($ret); - - return $ret; - } -} diff --git a/vendor/league/commonmark/src/Parser/InlineParserEngineInterface.php b/vendor/league/commonmark/src/Parser/InlineParserEngineInterface.php deleted file mode 100644 index 8a0986dc..00000000 --- a/vendor/league/commonmark/src/Parser/InlineParserEngineInterface.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Parser; - -use League\CommonMark\Node\Block\AbstractBlock; - -/** - * Parser for inline content (text, links, emphasized text, etc). - */ -interface InlineParserEngineInterface -{ - /** - * Parse the given contents as inlines and insert them into the given block - */ - public function parse(string $contents, AbstractBlock $block): void; -} diff --git a/vendor/league/commonmark/src/Parser/MarkdownParser.php b/vendor/league/commonmark/src/Parser/MarkdownParser.php deleted file mode 100644 index 7753a0eb..00000000 --- a/vendor/league/commonmark/src/Parser/MarkdownParser.php +++ /dev/null @@ -1,339 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * Additional code based on commonmark-java (https://github.com/commonmark/commonmark-java) - * - (c) Atlassian Pty Ltd - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Parser; - -use League\CommonMark\Environment\EnvironmentInterface; -use League\CommonMark\Event\DocumentParsedEvent; -use League\CommonMark\Event\DocumentPreParsedEvent; -use League\CommonMark\Input\MarkdownInput; -use League\CommonMark\Node\Block\Document; -use League\CommonMark\Node\Block\Paragraph; -use League\CommonMark\Parser\Block\BlockContinueParserInterface; -use League\CommonMark\Parser\Block\BlockContinueParserWithInlinesInterface; -use League\CommonMark\Parser\Block\BlockStart; -use League\CommonMark\Parser\Block\BlockStartParserInterface; -use League\CommonMark\Parser\Block\DocumentBlockParser; -use League\CommonMark\Parser\Block\ParagraphParser; -use League\CommonMark\Reference\ReferenceInterface; -use League\CommonMark\Reference\ReferenceMap; - -final class MarkdownParser implements MarkdownParserInterface -{ - /** @psalm-readonly */ - private EnvironmentInterface $environment; - - /** @psalm-readonly-allow-private-mutation */ - private int $maxNestingLevel; - - /** @psalm-readonly-allow-private-mutation */ - private ReferenceMap $referenceMap; - - /** @psalm-readonly-allow-private-mutation */ - private int $lineNumber = 0; - - /** @psalm-readonly-allow-private-mutation */ - private Cursor $cursor; - - /** - * @var array<int, BlockContinueParserInterface> - * - * @psalm-readonly-allow-private-mutation - */ - private array $activeBlockParsers = []; - - /** - * @var array<int, BlockContinueParserWithInlinesInterface> - * - * @psalm-readonly-allow-private-mutation - */ - private array $closedBlockParsers = []; - - public function __construct(EnvironmentInterface $environment) - { - $this->environment = $environment; - } - - private function initialize(): void - { - $this->referenceMap = new ReferenceMap(); - $this->lineNumber = 0; - $this->activeBlockParsers = []; - $this->closedBlockParsers = []; - - $this->maxNestingLevel = $this->environment->getConfiguration()->get('max_nesting_level'); - } - - /** - * @throws \RuntimeException - */ - public function parse(string $input): Document - { - $this->initialize(); - - $documentParser = new DocumentBlockParser($this->referenceMap); - $this->activateBlockParser($documentParser); - - $preParsedEvent = new DocumentPreParsedEvent($documentParser->getBlock(), new MarkdownInput($input)); - $this->environment->dispatch($preParsedEvent); - $markdownInput = $preParsedEvent->getMarkdown(); - - foreach ($markdownInput->getLines() as $lineNumber => $line) { - $this->lineNumber = $lineNumber; - $this->parseLine($line); - } - - // finalizeAndProcess - $this->closeBlockParsers(\count($this->activeBlockParsers), $this->lineNumber); - $this->processInlines(); - - $this->environment->dispatch(new DocumentParsedEvent($documentParser->getBlock())); - - return $documentParser->getBlock(); - } - - /** - * Analyze a line of text and update the document appropriately. We parse markdown text by calling this on each - * line of input, then finalizing the document. - */ - private function parseLine(string $line): void - { - $this->cursor = new Cursor($line); - - $matches = $this->parseBlockContinuation(); - if ($matches === null) { - return; - } - - $unmatchedBlocks = \count($this->activeBlockParsers) - $matches; - $blockParser = $this->activeBlockParsers[$matches - 1]; - $startedNewBlock = false; - - // Unless last matched container is a code block, try new container starts, - // adding children to the last matched container: - $tryBlockStarts = $blockParser->getBlock() instanceof Paragraph || $blockParser->isContainer(); - while ($tryBlockStarts) { - // this is a little performance optimization - if ($this->cursor->isBlank()) { - $this->cursor->advanceToEnd(); - break; - } - - if ($blockParser->getBlock()->getDepth() >= $this->maxNestingLevel) { - break; - } - - $blockStart = $this->findBlockStart($blockParser); - if ($blockStart === null || $blockStart->isAborting()) { - $this->cursor->advanceToNextNonSpaceOrTab(); - break; - } - - if (($state = $blockStart->getCursorState()) !== null) { - $this->cursor->restoreState($state); - } - - $startedNewBlock = true; - - // We're starting a new block. If we have any previous blocks that need to be closed, we need to do it now. - if ($unmatchedBlocks > 0) { - $this->closeBlockParsers($unmatchedBlocks, $this->lineNumber - 1); - $unmatchedBlocks = 0; - } - - if ($blockStart->isReplaceActiveBlockParser()) { - $this->prepareActiveBlockParserForReplacement(); - } - - foreach ($blockStart->getBlockParsers() as $newBlockParser) { - $blockParser = $this->addChild($newBlockParser); - $tryBlockStarts = $newBlockParser->isContainer(); - } - } - - // What remains at the offset is a text line. Add the text to the appropriate block. - - // First check for a lazy paragraph continuation: - if (! $startedNewBlock && ! $this->cursor->isBlank() && $this->getActiveBlockParser()->canHaveLazyContinuationLines()) { - $this->getActiveBlockParser()->addLine($this->cursor->getRemainder()); - } else { - // finalize any blocks not matched - if ($unmatchedBlocks > 0) { - $this->closeBlockParsers($unmatchedBlocks, $this->lineNumber); - } - - if (! $blockParser->isContainer()) { - $this->getActiveBlockParser()->addLine($this->cursor->getRemainder()); - } elseif (! $this->cursor->isBlank()) { - $this->addChild(new ParagraphParser()); - $this->getActiveBlockParser()->addLine($this->cursor->getRemainder()); - } - } - } - - private function parseBlockContinuation(): ?int - { - // For each containing block, try to parse the associated line start. - // The document will always match, so we can skip the first block parser and start at 1 matches - $matches = 1; - for ($i = 1; $i < \count($this->activeBlockParsers); $i++) { - $blockParser = $this->activeBlockParsers[$i]; - $blockContinue = $blockParser->tryContinue(clone $this->cursor, $this->getActiveBlockParser()); - if ($blockContinue === null) { - break; - } - - if ($blockContinue->isFinalize()) { - $this->closeBlockParsers(\count($this->activeBlockParsers) - $i, $this->lineNumber); - - return null; - } - - if (($state = $blockContinue->getCursorState()) !== null) { - $this->cursor->restoreState($state); - } - - $matches++; - } - - return $matches; - } - - private function findBlockStart(BlockContinueParserInterface $lastMatchedBlockParser): ?BlockStart - { - $matchedBlockParser = new MarkdownParserState($this->getActiveBlockParser(), $lastMatchedBlockParser); - - foreach ($this->environment->getBlockStartParsers() as $blockStartParser) { - \assert($blockStartParser instanceof BlockStartParserInterface); - if (($result = $blockStartParser->tryStart(clone $this->cursor, $matchedBlockParser)) !== null) { - return $result; - } - } - - return null; - } - - private function closeBlockParsers(int $count, int $endLineNumber): void - { - for ($i = 0; $i < $count; $i++) { - $blockParser = $this->deactivateBlockParser(); - $this->finalize($blockParser, $endLineNumber); - - // phpcs:disable SlevomatCodingStandard.ControlStructures.EarlyExit.EarlyExitNotUsed - if ($blockParser instanceof BlockContinueParserWithInlinesInterface) { - // Remember for inline parsing - $this->closedBlockParsers[] = $blockParser; - } - } - } - - /** - * Finalize a block. Close it and do any necessary postprocessing, e.g. creating string_content from strings, - * setting the 'tight' or 'loose' status of a list, and parsing the beginnings of paragraphs for reference - * definitions. - */ - private function finalize(BlockContinueParserInterface $blockParser, int $endLineNumber): void - { - if ($blockParser instanceof ParagraphParser) { - $this->updateReferenceMap($blockParser->getReferences()); - } - - $blockParser->getBlock()->setEndLine($endLineNumber); - $blockParser->closeBlock(); - } - - /** - * Walk through a block & children recursively, parsing string content into inline content where appropriate. - */ - private function processInlines(): void - { - $p = new InlineParserEngine($this->environment, $this->referenceMap); - - foreach ($this->closedBlockParsers as $blockParser) { - $blockParser->parseInlines($p); - } - } - - /** - * Add block of type tag as a child of the tip. If the tip can't accept children, close and finalize it and try - * its parent, and so on til we find a block that can accept children. - */ - private function addChild(BlockContinueParserInterface $blockParser): BlockContinueParserInterface - { - $blockParser->getBlock()->setStartLine($this->lineNumber); - - while (! $this->getActiveBlockParser()->canContain($blockParser->getBlock())) { - $this->closeBlockParsers(1, $this->lineNumber - 1); - } - - $this->getActiveBlockParser()->getBlock()->appendChild($blockParser->getBlock()); - $this->activateBlockParser($blockParser); - - return $blockParser; - } - - private function activateBlockParser(BlockContinueParserInterface $blockParser): void - { - $this->activeBlockParsers[] = $blockParser; - } - - private function deactivateBlockParser(): BlockContinueParserInterface - { - $popped = \array_pop($this->activeBlockParsers); - if ($popped === null) { - throw new \RuntimeException('The last block parser should not be deactivated'); - } - - return $popped; - } - - private function prepareActiveBlockParserForReplacement(): void - { - // Note that we don't want to parse inlines or finalize this block, as it's getting replaced. - $old = $this->deactivateBlockParser(); - - if ($old instanceof ParagraphParser) { - $this->updateReferenceMap($old->getReferences()); - } - - $old->getBlock()->detach(); - } - - /** - * @param ReferenceInterface[] $references - */ - private function updateReferenceMap(iterable $references): void - { - foreach ($references as $reference) { - if (! $this->referenceMap->contains($reference->getLabel())) { - $this->referenceMap->add($reference); - } - } - } - - public function getActiveBlockParser(): BlockContinueParserInterface - { - $active = \end($this->activeBlockParsers); - if ($active === false) { - throw new \RuntimeException('No active block parsers are available'); - } - - return $active; - } -} diff --git a/vendor/league/commonmark/src/Parser/MarkdownParserInterface.php b/vendor/league/commonmark/src/Parser/MarkdownParserInterface.php deleted file mode 100644 index 5ab833ff..00000000 --- a/vendor/league/commonmark/src/Parser/MarkdownParserInterface.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Parser; - -use League\CommonMark\Node\Block\Document; - -interface MarkdownParserInterface -{ - /** - * @throws \RuntimeException - */ - public function parse(string $input): Document; -} diff --git a/vendor/league/commonmark/src/Parser/MarkdownParserState.php b/vendor/league/commonmark/src/Parser/MarkdownParserState.php deleted file mode 100644 index 79abd42f..00000000 --- a/vendor/league/commonmark/src/Parser/MarkdownParserState.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Parser; - -use League\CommonMark\Parser\Block\BlockContinueParserInterface; -use League\CommonMark\Parser\Block\ParagraphParser; - -/** - * @internal You should rely on the interface instead - */ -final class MarkdownParserState implements MarkdownParserStateInterface -{ - /** @psalm-readonly */ - private BlockContinueParserInterface $activeBlockParser; - - /** @psalm-readonly */ - private BlockContinueParserInterface $lastMatchedBlockParser; - - public function __construct(BlockContinueParserInterface $activeBlockParser, BlockContinueParserInterface $lastMatchedBlockParser) - { - $this->activeBlockParser = $activeBlockParser; - $this->lastMatchedBlockParser = $lastMatchedBlockParser; - } - - public function getActiveBlockParser(): BlockContinueParserInterface - { - return $this->activeBlockParser; - } - - public function getLastMatchedBlockParser(): BlockContinueParserInterface - { - return $this->lastMatchedBlockParser; - } - - public function getParagraphContent(): ?string - { - if (! $this->lastMatchedBlockParser instanceof ParagraphParser) { - return null; - } - - $paragraphParser = $this->lastMatchedBlockParser; - $content = $paragraphParser->getContentString(); - - return $content === '' ? null : $content; - } -} diff --git a/vendor/league/commonmark/src/Parser/MarkdownParserStateInterface.php b/vendor/league/commonmark/src/Parser/MarkdownParserStateInterface.php deleted file mode 100644 index 21a9d3ab..00000000 --- a/vendor/league/commonmark/src/Parser/MarkdownParserStateInterface.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Parser; - -use League\CommonMark\Parser\Block\BlockContinueParserInterface; - -interface MarkdownParserStateInterface -{ - /** - * Returns the deepest open block parser - */ - public function getActiveBlockParser(): BlockContinueParserInterface; - - /** - * Open block parser that was last matched during the continue phase. This is different from the currently active - * block parser, as an unmatched block is only closed when a new block is started. - */ - public function getLastMatchedBlockParser(): BlockContinueParserInterface; - - /** - * Returns the current content of the paragraph if the matched block is a paragraph. The content can be multiple - * lines separated by newlines. - */ - public function getParagraphContent(): ?string; -} diff --git a/vendor/league/commonmark/src/Reference/Reference.php b/vendor/league/commonmark/src/Reference/Reference.php deleted file mode 100644 index a0d571d5..00000000 --- a/vendor/league/commonmark/src/Reference/Reference.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Reference; - -/** - * @psalm-immutable - */ -final class Reference implements ReferenceInterface -{ - /** @psalm-readonly */ - private string $label; - - /** @psalm-readonly */ - private string $destination; - - /** @psalm-readonly */ - private string $title; - - public function __construct(string $label, string $destination, string $title) - { - $this->label = $label; - $this->destination = $destination; - $this->title = $title; - } - - public function getLabel(): string - { - return $this->label; - } - - public function getDestination(): string - { - return $this->destination; - } - - public function getTitle(): string - { - return $this->title; - } -} diff --git a/vendor/league/commonmark/src/Reference/ReferenceInterface.php b/vendor/league/commonmark/src/Reference/ReferenceInterface.php deleted file mode 100644 index 244b3546..00000000 --- a/vendor/league/commonmark/src/Reference/ReferenceInterface.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Reference; - -/** - * Link reference - */ -interface ReferenceInterface -{ - public function getLabel(): string; - - public function getDestination(): string; - - public function getTitle(): string; -} diff --git a/vendor/league/commonmark/src/Reference/ReferenceMap.php b/vendor/league/commonmark/src/Reference/ReferenceMap.php deleted file mode 100644 index 982cb125..00000000 --- a/vendor/league/commonmark/src/Reference/ReferenceMap.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Reference; - -use League\CommonMark\Normalizer\TextNormalizer; - -/** - * A collection of references, indexed by label - */ -final class ReferenceMap implements ReferenceMapInterface -{ - /** @psalm-readonly */ - private TextNormalizer $normalizer; - - /** - * @var array<string, ReferenceInterface> - * - * @psalm-readonly-allow-private-mutation - */ - private array $references = []; - - public function __construct() - { - $this->normalizer = new TextNormalizer(); - } - - public function add(ReferenceInterface $reference): void - { - // Normalize the key - $key = $this->normalizer->normalize($reference->getLabel()); - // Store the reference - $this->references[$key] = $reference; - } - - public function contains(string $label): bool - { - $label = $this->normalizer->normalize($label); - - return isset($this->references[$label]); - } - - public function get(string $label): ?ReferenceInterface - { - $label = $this->normalizer->normalize($label); - - return $this->references[$label] ?? null; - } - - /** - * @return \Traversable<string, ReferenceInterface> - */ - public function getIterator(): \Traversable - { - foreach ($this->references as $normalizedLabel => $reference) { - yield $normalizedLabel => $reference; - } - } - - public function count(): int - { - return \count($this->references); - } -} diff --git a/vendor/league/commonmark/src/Reference/ReferenceMapInterface.php b/vendor/league/commonmark/src/Reference/ReferenceMapInterface.php deleted file mode 100644 index 71daa19e..00000000 --- a/vendor/league/commonmark/src/Reference/ReferenceMapInterface.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Reference; - -/** - * A collection of references - * - * @phpstan-extends \IteratorAggregate<ReferenceInterface> - */ -interface ReferenceMapInterface extends \IteratorAggregate, \Countable -{ - public function add(ReferenceInterface $reference): void; - - public function contains(string $label): bool; - - public function get(string $label): ?ReferenceInterface; -} diff --git a/vendor/league/commonmark/src/Reference/ReferenceParser.php b/vendor/league/commonmark/src/Reference/ReferenceParser.php deleted file mode 100644 index c01dd213..00000000 --- a/vendor/league/commonmark/src/Reference/ReferenceParser.php +++ /dev/null @@ -1,324 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Reference; - -use League\CommonMark\Parser\Cursor; -use League\CommonMark\Util\LinkParserHelper; - -final class ReferenceParser -{ - // Looking for the start of a definition, i.e. `[` - private const START_DEFINITION = 0; - // Looking for and parsing the label, i.e. `[foo]` within `[foo]` - private const LABEL = 1; - // Parsing the destination, i.e. `/url` in `[foo]: /url` - private const DESTINATION = 2; - // Looking for the start of a title, i.e. the first `"` in `[foo]: /url "title"` - private const START_TITLE = 3; - // Parsing the content of the title, i.e. `title` in `[foo]: /url "title"` - private const TITLE = 4; - // End state, no matter what kind of lines we add, they won't be references - private const PARAGRAPH = 5; - - /** @psalm-readonly-allow-private-mutation */ - private string $paragraph = ''; - - /** - * @var array<int, ReferenceInterface> - * - * @psalm-readonly-allow-private-mutation - */ - private array $references = []; - - /** @psalm-readonly-allow-private-mutation */ - private int $state = self::START_DEFINITION; - - /** @psalm-readonly-allow-private-mutation */ - private ?string $label = null; - - /** @psalm-readonly-allow-private-mutation */ - private ?string $destination = null; - - /** - * @var string string - * - * @psalm-readonly-allow-private-mutation - */ - private string $title = ''; - - /** @psalm-readonly-allow-private-mutation */ - private ?string $titleDelimiter = null; - - /** @psalm-readonly-allow-private-mutation */ - private bool $referenceValid = false; - - public function getParagraphContent(): string - { - return $this->paragraph; - } - - /** - * @return ReferenceInterface[] - */ - public function getReferences(): iterable - { - $this->finishReference(); - - return $this->references; - } - - public function hasReferences(): bool - { - return $this->references !== []; - } - - public function parse(string $line): void - { - if ($this->paragraph !== '') { - $this->paragraph .= "\n"; - } - - $this->paragraph .= $line; - - $cursor = new Cursor($line); - while (! $cursor->isAtEnd()) { - $result = false; - switch ($this->state) { - case self::PARAGRAPH: - // We're in a paragraph now. Link reference definitions can only appear at the beginning, so once - // we're in a paragraph, there's no going back. - return; - case self::START_DEFINITION: - $result = $this->parseStartDefinition($cursor); - break; - case self::LABEL: - $result = $this->parseLabel($cursor); - break; - case self::DESTINATION: - $result = $this->parseDestination($cursor); - break; - case self::START_TITLE: - $result = $this->parseStartTitle($cursor); - break; - case self::TITLE: - $result = $this->parseTitle($cursor); - break; - default: - // this should never happen - break; - } - - if (! $result) { - $this->state = self::PARAGRAPH; - - return; - } - } - } - - private function parseStartDefinition(Cursor $cursor): bool - { - $cursor->advanceToNextNonSpaceOrTab(); - if ($cursor->isAtEnd() || $cursor->getCurrentCharacter() !== '[') { - return false; - } - - $this->state = self::LABEL; - $this->label = ''; - - $cursor->advance(); - if ($cursor->isAtEnd()) { - $this->label .= "\n"; - } - - return true; - } - - private function parseLabel(Cursor $cursor): bool - { - $cursor->advanceToNextNonSpaceOrTab(); - - $partialLabel = LinkParserHelper::parsePartialLinkLabel($cursor); - if ($partialLabel === null) { - return false; - } - - \assert($this->label !== null); - $this->label .= $partialLabel; - - if ($cursor->isAtEnd()) { - // label might continue on next line - $this->label .= "\n"; - - return true; - } - - if ($cursor->getCurrentCharacter() !== ']') { - return false; - } - - $cursor->advance(); - - // end of label - if ($cursor->getCurrentCharacter() !== ':') { - return false; - } - - $cursor->advance(); - - // spec: A link label can have at most 999 characters inside the square brackets - if (\mb_strlen($this->label, 'UTF-8') > 999) { - return false; - } - - // spec: A link label must contain at least one non-whitespace character - if (\trim($this->label) === '') { - return false; - } - - $cursor->advanceToNextNonSpaceOrTab(); - - $this->state = self::DESTINATION; - - return true; - } - - private function parseDestination(Cursor $cursor): bool - { - $cursor->advanceToNextNonSpaceOrTab(); - - $destination = LinkParserHelper::parseLinkDestination($cursor); - if ($destination === null) { - return false; - } - - $this->destination = $destination; - - $advanced = $cursor->advanceToNextNonSpaceOrTab(); - if ($cursor->isAtEnd()) { - // Destination was at end of line, so this is a valid reference for sure (and maybe a title). - // If not at end of line, wait for title to be valid first. - $this->referenceValid = true; - $this->paragraph = ''; - } elseif ($advanced === 0) { - // spec: The title must be separated from the link destination by whitespace - return false; - } - - $this->state = self::START_TITLE; - - return true; - } - - private function parseStartTitle(Cursor $cursor): bool - { - $cursor->advanceToNextNonSpaceOrTab(); - if ($cursor->isAtEnd()) { - $this->state = self::START_DEFINITION; - - return true; - } - - $this->titleDelimiter = null; - switch ($c = $cursor->getCurrentCharacter()) { - case '"': - case "'": - $this->titleDelimiter = $c; - break; - case '(': - $this->titleDelimiter = ')'; - break; - default: - // no title delimter found - break; - } - - if ($this->titleDelimiter !== null) { - $this->state = self::TITLE; - $cursor->advance(); - if ($cursor->isAtEnd()) { - $this->title .= "\n"; - } - } else { - $this->finishReference(); - // There might be another reference instead, try that for the same character. - $this->state = self::START_DEFINITION; - } - - return true; - } - - private function parseTitle(Cursor $cursor): bool - { - \assert($this->titleDelimiter !== null); - $title = LinkParserHelper::parsePartialLinkTitle($cursor, $this->titleDelimiter); - - if ($title === null) { - // Invalid title, stop - return false; - } - - // Did we find the end delimiter? - $endDelimiterFound = false; - if (\substr($title, -1) === $this->titleDelimiter) { - $endDelimiterFound = true; - // Chop it off - $title = \substr($title, 0, -1); - } - - $this->title .= $title; - - if (! $endDelimiterFound && $cursor->isAtEnd()) { - // Title still going, continue on next line - $this->title .= "\n"; - - return true; - } - - // We either hit the end delimiter or some extra whitespace - $cursor->advanceToNextNonSpaceOrTab(); - if (! $cursor->isAtEnd()) { - // spec: No further non-whitespace characters may occur on the line. - return false; - } - - $this->referenceValid = true; - $this->finishReference(); - $this->paragraph = ''; - - // See if there's another definition - $this->state = self::START_DEFINITION; - - return true; - } - - private function finishReference(): void - { - if (! $this->referenceValid) { - return; - } - - /** @psalm-suppress PossiblyNullArgument -- these can't possibly be null if we're in this state */ - $this->references[] = new Reference($this->label, $this->destination, $this->title); - - $this->label = null; - $this->referenceValid = false; - $this->destination = null; - $this->title = ''; - $this->titleDelimiter = null; - } -} diff --git a/vendor/league/commonmark/src/Reference/ReferenceableInterface.php b/vendor/league/commonmark/src/Reference/ReferenceableInterface.php deleted file mode 100644 index b45f379e..00000000 --- a/vendor/league/commonmark/src/Reference/ReferenceableInterface.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\CommonMark\Reference; - -interface ReferenceableInterface -{ - public function getReference(): ReferenceInterface; -} diff --git a/vendor/league/commonmark/src/Renderer/Block/DocumentRenderer.php b/vendor/league/commonmark/src/Renderer/Block/DocumentRenderer.php deleted file mode 100644 index 32626914..00000000 --- a/vendor/league/commonmark/src/Renderer/Block/DocumentRenderer.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Renderer\Block; - -use League\CommonMark\Node\Block\Document; -use League\CommonMark\Node\Node; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\CommonMark\Xml\XmlNodeRendererInterface; - -final class DocumentRenderer implements NodeRendererInterface, XmlNodeRendererInterface -{ - /** - * @param Document $node - * - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function render(Node $node, ChildNodeRendererInterface $childRenderer): string - { - Document::assertInstanceOf($node); - - $wholeDoc = $childRenderer->renderNodes($node->children()); - - return $wholeDoc === '' ? '' : $wholeDoc . "\n"; - } - - public function getXmlTagName(Node $node): string - { - return 'document'; - } - - /** - * {@inheritDoc} - */ - public function getXmlAttributes(Node $node): array - { - return [ - 'xmlns' => 'http://commonmark.org/xml/1.0', - ]; - } -} diff --git a/vendor/league/commonmark/src/Renderer/Block/ParagraphRenderer.php b/vendor/league/commonmark/src/Renderer/Block/ParagraphRenderer.php deleted file mode 100644 index 934eac2d..00000000 --- a/vendor/league/commonmark/src/Renderer/Block/ParagraphRenderer.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Renderer\Block; - -use League\CommonMark\Node\Block\Paragraph; -use League\CommonMark\Node\Block\TightBlockInterface; -use League\CommonMark\Node\Node; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\CommonMark\Util\HtmlElement; -use League\CommonMark\Xml\XmlNodeRendererInterface; - -final class ParagraphRenderer implements NodeRendererInterface, XmlNodeRendererInterface -{ - /** - * @param Paragraph $node - * - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function render(Node $node, ChildNodeRendererInterface $childRenderer) - { - Paragraph::assertInstanceOf($node); - - if ($this->inTightList($node)) { - return $childRenderer->renderNodes($node->children()); - } - - $attrs = $node->data->get('attributes'); - - return new HtmlElement('p', $attrs, $childRenderer->renderNodes($node->children())); - } - - public function getXmlTagName(Node $node): string - { - return 'paragraph'; - } - - /** - * {@inheritDoc} - */ - public function getXmlAttributes(Node $node): array - { - return []; - } - - private function inTightList(Paragraph $node): bool - { - // Only check up to two (2) levels above this for tightness - $i = 2; - while (($node = $node->parent()) && $i--) { - if ($node instanceof TightBlockInterface) { - return $node->isTight(); - } - } - - return false; - } -} diff --git a/vendor/league/commonmark/src/Renderer/ChildNodeRendererInterface.php b/vendor/league/commonmark/src/Renderer/ChildNodeRendererInterface.php deleted file mode 100644 index 8e866b56..00000000 --- a/vendor/league/commonmark/src/Renderer/ChildNodeRendererInterface.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Renderer; - -use League\CommonMark\Node\Node; - -/** - * Renders multiple nodes by delegating to the individual node renderers and adding spacing where needed - */ -interface ChildNodeRendererInterface -{ - /** - * @param Node[] $nodes - */ - public function renderNodes(iterable $nodes): string; - - public function getBlockSeparator(): string; - - public function getInnerSeparator(): string; -} diff --git a/vendor/league/commonmark/src/Renderer/DocumentRendererInterface.php b/vendor/league/commonmark/src/Renderer/DocumentRendererInterface.php deleted file mode 100644 index dd34dd6b..00000000 --- a/vendor/league/commonmark/src/Renderer/DocumentRendererInterface.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Renderer; - -use League\CommonMark\Node\Block\Document; -use League\CommonMark\Output\RenderedContentInterface; - -/** - * Renders a parsed Document AST - */ -interface DocumentRendererInterface extends MarkdownRendererInterface -{ - /** - * Render the given Document node (and all of its children) - */ - public function renderDocument(Document $document): RenderedContentInterface; -} diff --git a/vendor/league/commonmark/src/Renderer/HtmlDecorator.php b/vendor/league/commonmark/src/Renderer/HtmlDecorator.php deleted file mode 100644 index 46a38d92..00000000 --- a/vendor/league/commonmark/src/Renderer/HtmlDecorator.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Renderer; - -use League\CommonMark\Node\Node; -use League\CommonMark\Util\HtmlElement; - -final class HtmlDecorator implements NodeRendererInterface -{ - private NodeRendererInterface $inner; - private string $tag; - /** @var array<string, string|string[]|bool> */ - private array $attributes; - private bool $selfClosing; - - /** - * @param array<string, string|string[]|bool> $attributes - */ - public function __construct(NodeRendererInterface $inner, string $tag, array $attributes = [], bool $selfClosing = false) - { - $this->inner = $inner; - $this->tag = $tag; - $this->attributes = $attributes; - $this->selfClosing = $selfClosing; - } - - /** - * {@inheritDoc} - */ - public function render(Node $node, ChildNodeRendererInterface $childRenderer) - { - return new HtmlElement($this->tag, $this->attributes, $this->inner->render($node, $childRenderer), $this->selfClosing); - } -} diff --git a/vendor/league/commonmark/src/Renderer/HtmlRenderer.php b/vendor/league/commonmark/src/Renderer/HtmlRenderer.php deleted file mode 100644 index ec21166f..00000000 --- a/vendor/league/commonmark/src/Renderer/HtmlRenderer.php +++ /dev/null @@ -1,100 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Renderer; - -use League\CommonMark\Environment\EnvironmentInterface; -use League\CommonMark\Event\DocumentPreRenderEvent; -use League\CommonMark\Event\DocumentRenderedEvent; -use League\CommonMark\Node\Block\AbstractBlock; -use League\CommonMark\Node\Block\Document; -use League\CommonMark\Node\Node; -use League\CommonMark\Output\RenderedContent; -use League\CommonMark\Output\RenderedContentInterface; - -final class HtmlRenderer implements DocumentRendererInterface, ChildNodeRendererInterface -{ - /** @psalm-readonly */ - private EnvironmentInterface $environment; - - public function __construct(EnvironmentInterface $environment) - { - $this->environment = $environment; - } - - public function renderDocument(Document $document): RenderedContentInterface - { - $this->environment->dispatch(new DocumentPreRenderEvent($document, 'html')); - - $output = new RenderedContent($document, (string) $this->renderNode($document)); - - $event = new DocumentRenderedEvent($output); - $this->environment->dispatch($event); - - return $event->getOutput(); - } - - /** - * {@inheritDoc} - */ - public function renderNodes(iterable $nodes): string - { - $output = ''; - - $isFirstItem = true; - - foreach ($nodes as $node) { - if (! $isFirstItem && $node instanceof AbstractBlock) { - $output .= $this->getBlockSeparator(); - } - - $output .= $this->renderNode($node); - - $isFirstItem = false; - } - - return $output; - } - - /** - * @return \Stringable|string - * - * @throws \RuntimeException - */ - private function renderNode(Node $node) - { - $renderers = $this->environment->getRenderersForClass(\get_class($node)); - - foreach ($renderers as $renderer) { - \assert($renderer instanceof NodeRendererInterface); - if (($result = $renderer->render($node, $this)) !== null) { - return $result; - } - } - - throw new \RuntimeException('Unable to find corresponding renderer for node type ' . \get_class($node)); - } - - public function getBlockSeparator(): string - { - return $this->environment->getConfiguration()->get('renderer/block_separator'); - } - - public function getInnerSeparator(): string - { - return $this->environment->getConfiguration()->get('renderer/inner_separator'); - } -} diff --git a/vendor/league/commonmark/src/Renderer/Inline/NewlineRenderer.php b/vendor/league/commonmark/src/Renderer/Inline/NewlineRenderer.php deleted file mode 100644 index f64cc587..00000000 --- a/vendor/league/commonmark/src/Renderer/Inline/NewlineRenderer.php +++ /dev/null @@ -1,76 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Renderer\Inline; - -use League\CommonMark\Node\Inline\Newline; -use League\CommonMark\Node\Node; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\CommonMark\Xml\XmlNodeRendererInterface; -use League\Config\ConfigurationAwareInterface; -use League\Config\ConfigurationInterface; - -final class NewlineRenderer implements NodeRendererInterface, XmlNodeRendererInterface, ConfigurationAwareInterface -{ - /** @psalm-readonly-allow-private-mutation */ - private ConfigurationInterface $config; - - public function setConfiguration(ConfigurationInterface $configuration): void - { - $this->config = $configuration; - } - - /** - * @param Newline $node - * - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function render(Node $node, ChildNodeRendererInterface $childRenderer): string - { - Newline::assertInstanceOf($node); - - if ($node->getType() === Newline::HARDBREAK) { - return "<br />\n"; - } - - return $this->config->get('renderer/soft_break'); - } - - /** - * @param Newline $node - * - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function getXmlTagName(Node $node): string - { - Newline::assertInstanceOf($node); - - return $node->getType() === Newline::SOFTBREAK ? 'softbreak' : 'linebreak'; - } - - /** - * {@inheritDoc} - */ - public function getXmlAttributes(Node $node): array - { - return []; - } -} diff --git a/vendor/league/commonmark/src/Renderer/Inline/TextRenderer.php b/vendor/league/commonmark/src/Renderer/Inline/TextRenderer.php deleted file mode 100644 index 40ad02a5..00000000 --- a/vendor/league/commonmark/src/Renderer/Inline/TextRenderer.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Renderer\Inline; - -use League\CommonMark\Node\Inline\Text; -use League\CommonMark\Node\Node; -use League\CommonMark\Renderer\ChildNodeRendererInterface; -use League\CommonMark\Renderer\NodeRendererInterface; -use League\CommonMark\Util\Xml; -use League\CommonMark\Xml\XmlNodeRendererInterface; - -final class TextRenderer implements NodeRendererInterface, XmlNodeRendererInterface -{ - /** - * @param Text $node - * - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function render(Node $node, ChildNodeRendererInterface $childRenderer): string - { - Text::assertInstanceOf($node); - - return Xml::escape($node->getLiteral()); - } - - public function getXmlTagName(Node $node): string - { - return 'text'; - } - - /** - * {@inheritDoc} - */ - public function getXmlAttributes(Node $node): array - { - return []; - } -} diff --git a/vendor/league/commonmark/src/Renderer/MarkdownRendererInterface.php b/vendor/league/commonmark/src/Renderer/MarkdownRendererInterface.php deleted file mode 100644 index 83af8cdc..00000000 --- a/vendor/league/commonmark/src/Renderer/MarkdownRendererInterface.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Renderer; - -use League\CommonMark\Node\Block\Document; -use League\CommonMark\Output\RenderedContentInterface; - -/** - * Renders a parsed Document AST - * - * @deprecated since 2.3; use {@link DocumentRendererInterface} instead - */ -interface MarkdownRendererInterface -{ - /** - * Render the given Document node (and all of its children) - */ - public function renderDocument(Document $document): RenderedContentInterface; -} diff --git a/vendor/league/commonmark/src/Renderer/NodeRendererInterface.php b/vendor/league/commonmark/src/Renderer/NodeRendererInterface.php deleted file mode 100644 index 8cc36436..00000000 --- a/vendor/league/commonmark/src/Renderer/NodeRendererInterface.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Renderer; - -use League\CommonMark\Node\Node; - -interface NodeRendererInterface -{ - /** - * @return \Stringable|string|null - * - * @throws \InvalidArgumentException if the wrong type of Node is provided - */ - public function render(Node $node, ChildNodeRendererInterface $childRenderer); -} diff --git a/vendor/league/commonmark/src/Util/ArrayCollection.php b/vendor/league/commonmark/src/Util/ArrayCollection.php deleted file mode 100644 index 7210770d..00000000 --- a/vendor/league/commonmark/src/Util/ArrayCollection.php +++ /dev/null @@ -1,173 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Util; - -/** - * Array collection - * - * Provides a wrapper around a standard PHP array. - * - * @internal - * - * @phpstan-template T - * @phpstan-implements \IteratorAggregate<int, T> - * @phpstan-implements \ArrayAccess<int, T> - */ -final class ArrayCollection implements \IteratorAggregate, \Countable, \ArrayAccess -{ - /** - * @var array<int, mixed> - * @phpstan-var array<int, T> - */ - private array $elements; - - /** - * Constructor - * - * @param array<int|string, mixed> $elements - * - * @phpstan-param array<int, T> $elements - */ - public function __construct(array $elements = []) - { - $this->elements = $elements; - } - - /** - * @return mixed|false - * - * @phpstan-return T|false - */ - public function first() - { - return \reset($this->elements); - } - - /** - * @return mixed|false - * - * @phpstan-return T|false - */ - public function last() - { - return \end($this->elements); - } - - /** - * Retrieve an external iterator - * - * @return \ArrayIterator<int, mixed> - * - * @phpstan-return \ArrayIterator<int, T> - */ - #[\ReturnTypeWillChange] - public function getIterator(): \ArrayIterator - { - return new \ArrayIterator($this->elements); - } - - /** - * Count elements of an object - * - * @return int The count as an integer. - */ - public function count(): int - { - return \count($this->elements); - } - - /** - * Whether an offset exists - * - * {@inheritDoc} - * - * @phpstan-param int $offset - */ - public function offsetExists($offset): bool - { - return \array_key_exists($offset, $this->elements); - } - - /** - * Offset to retrieve - * - * {@inheritDoc} - * - * @phpstan-param int $offset - * - * @phpstan-return T|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->elements[$offset] ?? null; - } - - /** - * Offset to set - * - * {@inheritDoc} - * - * @phpstan-param int|null $offset - * @phpstan-param T $value - */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value): void - { - if ($offset === null) { - $this->elements[] = $value; - } else { - $this->elements[$offset] = $value; - } - } - - /** - * Offset to unset - * - * {@inheritDoc} - * - * @phpstan-param int $offset - */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset): void - { - if (! \array_key_exists($offset, $this->elements)) { - return; - } - - unset($this->elements[$offset]); - } - - /** - * Returns a subset of the array - * - * @return array<int, mixed> - * - * @phpstan-return array<int, T> - */ - public function slice(int $offset, ?int $length = null): array - { - return \array_slice($this->elements, $offset, $length, true); - } - - /** - * @return array<int, mixed> - * - * @phpstan-return array<int, T> - */ - public function toArray(): array - { - return $this->elements; - } -} diff --git a/vendor/league/commonmark/src/Util/Html5EntityDecoder.php b/vendor/league/commonmark/src/Util/Html5EntityDecoder.php deleted file mode 100644 index 52550a01..00000000 --- a/vendor/league/commonmark/src/Util/Html5EntityDecoder.php +++ /dev/null @@ -1,75 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Util; - -/** - * @psalm-immutable - */ -final class Html5EntityDecoder -{ - /** - * @psalm-pure - */ - public static function decode(string $entity): string - { - if (\substr($entity, -1) !== ';') { - return $entity; - } - - if (\substr($entity, 0, 2) === '&#') { - if (\strtolower(\substr($entity, 2, 1)) === 'x') { - return self::fromHex(\substr($entity, 3, -1)); - } - - return self::fromDecimal(\substr($entity, 2, -1)); - } - - return \html_entity_decode($entity, \ENT_QUOTES | \ENT_HTML5, 'UTF-8'); - } - - /** - * @param mixed $number - * - * @psalm-pure - */ - private static function fromDecimal($number): string - { - // Only convert code points within planes 0-2, excluding NULL - // phpcs:ignore Generic.PHP.ForbiddenFunctions.Found - if (empty($number) || $number > 0x2FFFF) { - return self::fromHex('fffd'); - } - - $entity = '&#' . $number . ';'; - - $converted = \mb_decode_numericentity($entity, [0x0, 0x2FFFF, 0, 0xFFFF], 'UTF-8'); - - if ($converted === $entity) { - return self::fromHex('fffd'); - } - - return $converted; - } - - /** - * @psalm-pure - */ - private static function fromHex(string $hexChars): string - { - return self::fromDecimal(\hexdec($hexChars)); - } -} diff --git a/vendor/league/commonmark/src/Util/HtmlElement.php b/vendor/league/commonmark/src/Util/HtmlElement.php deleted file mode 100644 index b2b51613..00000000 --- a/vendor/league/commonmark/src/Util/HtmlElement.php +++ /dev/null @@ -1,160 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Util; - -final class HtmlElement implements \Stringable -{ - /** @psalm-readonly */ - private string $tagName; - - /** @var array<string, string|bool> */ - private array $attributes = []; - - /** @var \Stringable|\Stringable[]|string */ - private $contents; - - /** @psalm-readonly */ - private bool $selfClosing; - - /** - * @param string $tagName Name of the HTML tag - * @param array<string, string|string[]|bool> $attributes Array of attributes (values should be unescaped) - * @param \Stringable|\Stringable[]|string|null $contents Inner contents, pre-escaped if needed - * @param bool $selfClosing Whether the tag is self-closing - */ - public function __construct(string $tagName, array $attributes = [], $contents = '', bool $selfClosing = false) - { - $this->tagName = $tagName; - $this->selfClosing = $selfClosing; - - foreach ($attributes as $name => $value) { - $this->setAttribute($name, $value); - } - - $this->setContents($contents ?? ''); - } - - /** @psalm-immutable */ - public function getTagName(): string - { - return $this->tagName; - } - - /** - * @return array<string, string|bool> - * - * @psalm-immutable - */ - public function getAllAttributes(): array - { - return $this->attributes; - } - - /** - * @return string|bool|null - * - * @psalm-immutable - */ - public function getAttribute(string $key) - { - return $this->attributes[$key] ?? null; - } - - /** - * @param string|string[]|bool $value - */ - public function setAttribute(string $key, $value): self - { - if (\is_array($value)) { - $this->attributes[$key] = \implode(' ', \array_unique($value)); - } else { - $this->attributes[$key] = $value; - } - - return $this; - } - - /** - * @return \Stringable|\Stringable[]|string - * - * @psalm-immutable - */ - public function getContents(bool $asString = true) - { - if (! $asString) { - return $this->contents; - } - - return $this->getContentsAsString(); - } - - /** - * Sets the inner contents of the tag (must be pre-escaped if needed) - * - * @param \Stringable|\Stringable[]|string $contents - * - * @return $this - */ - public function setContents($contents): self - { - $this->contents = $contents ?? ''; // @phpstan-ignore-line - - return $this; - } - - /** @psalm-immutable */ - public function __toString(): string - { - $result = '<' . $this->tagName; - - foreach ($this->attributes as $key => $value) { - if ($value === true) { - $result .= ' ' . $key; - } elseif ($value === false) { - continue; - } else { - $result .= ' ' . $key . '="' . Xml::escape($value) . '"'; - } - } - - if ($this->contents !== '') { - $result .= '>' . $this->getContentsAsString() . '</' . $this->tagName . '>'; - } elseif ($this->selfClosing && $this->tagName === 'input') { - $result .= '>'; - } elseif ($this->selfClosing) { - $result .= ' />'; - } else { - $result .= '></' . $this->tagName . '>'; - } - - return $result; - } - - /** @psalm-immutable */ - private function getContentsAsString(): string - { - if (\is_string($this->contents)) { - return $this->contents; - } - - if (\is_array($this->contents)) { - return \implode('', $this->contents); - } - - return (string) $this->contents; - } -} diff --git a/vendor/league/commonmark/src/Util/HtmlFilter.php b/vendor/league/commonmark/src/Util/HtmlFilter.php deleted file mode 100644 index 7986c04d..00000000 --- a/vendor/league/commonmark/src/Util/HtmlFilter.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Util; - -/** - * @psalm-immutable - */ -final class HtmlFilter -{ - // Return the entire string as-is - public const ALLOW = 'allow'; - // Escape the entire string so any HTML/JS won't be interpreted as such - public const ESCAPE = 'escape'; - // Return an empty string - public const STRIP = 'strip'; - - /** - * Runs the given HTML through the given filter - * - * @param string $html HTML input to be filtered - * @param string $filter One of the HtmlFilter constants - * - * @return string Filtered HTML - * - * @throws \InvalidArgumentException when an invalid $filter is given - * - * @psalm-pure - */ - public static function filter(string $html, string $filter): string - { - switch ($filter) { - case self::STRIP: - return ''; - case self::ESCAPE: - return \htmlspecialchars($html, \ENT_NOQUOTES); - case self::ALLOW: - return $html; - default: - throw new \InvalidArgumentException(\sprintf('Invalid filter provided: "%s"', $filter)); - } - } -} diff --git a/vendor/league/commonmark/src/Util/LinkParserHelper.php b/vendor/league/commonmark/src/Util/LinkParserHelper.php deleted file mode 100644 index e329669b..00000000 --- a/vendor/league/commonmark/src/Util/LinkParserHelper.php +++ /dev/null @@ -1,142 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Util; - -use League\CommonMark\Parser\Cursor; - -/** - * @psalm-immutable - */ -final class LinkParserHelper -{ - /** - * Attempt to parse link destination - * - * @return string|null The string, or null if no match - */ - public static function parseLinkDestination(Cursor $cursor): ?string - { - if ($res = $cursor->match(RegexHelper::REGEX_LINK_DESTINATION_BRACES)) { - // Chop off surrounding <..>: - return UrlEncoder::unescapeAndEncode( - RegexHelper::unescape(\substr($res, 1, -1)) - ); - } - - if ($cursor->getCurrentCharacter() === '<') { - return null; - } - - $destination = self::manuallyParseLinkDestination($cursor); - if ($destination === null) { - return null; - } - - return UrlEncoder::unescapeAndEncode( - RegexHelper::unescape($destination) - ); - } - - public static function parseLinkLabel(Cursor $cursor): int - { - $match = $cursor->match('/^\[(?:[^\\\\\[\]]|\\\\.){0,1000}\]/'); - if ($match === null) { - return 0; - } - - $length = \mb_strlen($match, 'UTF-8'); - - if ($length > 1001) { - return 0; - } - - return $length; - } - - public static function parsePartialLinkLabel(Cursor $cursor): ?string - { - return $cursor->match('/^(?:[^\\\\\[\]]+|\\\\.?)*/'); - } - - /** - * Attempt to parse link title (sans quotes) - * - * @return string|null The string, or null if no match - */ - public static function parseLinkTitle(Cursor $cursor): ?string - { - if ($title = $cursor->match('/' . RegexHelper::PARTIAL_LINK_TITLE . '/')) { - // Chop off quotes from title and unescape - return RegexHelper::unescape(\substr($title, 1, -1)); - } - - return null; - } - - public static function parsePartialLinkTitle(Cursor $cursor, string $endDelimiter): ?string - { - $endDelimiter = \preg_quote($endDelimiter, '/'); - $regex = \sprintf('/(%s|[^%s\x00])*(?:%s)?/', RegexHelper::PARTIAL_ESCAPED_CHAR, $endDelimiter, $endDelimiter); - if (($partialTitle = $cursor->match($regex)) === null) { - return null; - } - - return RegexHelper::unescape($partialTitle); - } - - private static function manuallyParseLinkDestination(Cursor $cursor): ?string - { - $oldPosition = $cursor->getPosition(); - $oldState = $cursor->saveState(); - - $openParens = 0; - while (($c = $cursor->getCurrentCharacter()) !== null) { - if ($c === '\\' && ($peek = $cursor->peek()) !== null && RegexHelper::isEscapable($peek)) { - $cursor->advanceBy(2); - } elseif ($c === '(') { - $cursor->advanceBy(1); - $openParens++; - } elseif ($c === ')') { - if ($openParens < 1) { - break; - } - - $cursor->advanceBy(1); - $openParens--; - } elseif (\preg_match(RegexHelper::REGEX_WHITESPACE_CHAR, $c)) { - break; - } else { - $cursor->advanceBy(1); - } - } - - if ($openParens !== 0) { - return null; - } - - if ($cursor->getPosition() === $oldPosition && (! isset($c) || $c !== ')')) { - return null; - } - - $newPos = $cursor->getPosition(); - $cursor->restoreState($oldState); - - $cursor->advanceBy($newPos - $cursor->getPosition()); - - return $cursor->getPreviousText(); - } -} diff --git a/vendor/league/commonmark/src/Util/PrioritizedList.php b/vendor/league/commonmark/src/Util/PrioritizedList.php deleted file mode 100644 index 77ec24a4..00000000 --- a/vendor/league/commonmark/src/Util/PrioritizedList.php +++ /dev/null @@ -1,73 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Util; - -/** - * @internal - * - * @phpstan-template T - * @phpstan-implements \IteratorAggregate<T> - */ -final class PrioritizedList implements \IteratorAggregate -{ - /** - * @var array<int, array<mixed>> - * @phpstan-var array<int, array<T>> - */ - private array $list = []; - - /** - * @var \Traversable<mixed>|null - * @phpstan-var \Traversable<T>|null - */ - private ?\Traversable $optimized = null; - - /** - * @param mixed $item - * - * @phpstan-param T $item - */ - public function add($item, int $priority): void - { - $this->list[$priority][] = $item; - $this->optimized = null; - } - - /** - * @return \Traversable<int, mixed> - * - * @phpstan-return \Traversable<int, T> - */ - #[\ReturnTypeWillChange] - public function getIterator(): \Traversable - { - if ($this->optimized === null) { - \krsort($this->list); - - $sorted = []; - foreach ($this->list as $group) { - foreach ($group as $item) { - $sorted[] = $item; - } - } - - $this->optimized = new \ArrayIterator($sorted); - } - - return $this->optimized; - } -} diff --git a/vendor/league/commonmark/src/Util/RegexHelper.php b/vendor/league/commonmark/src/Util/RegexHelper.php deleted file mode 100644 index 9e56b48c..00000000 --- a/vendor/league/commonmark/src/Util/RegexHelper.php +++ /dev/null @@ -1,228 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Util; - -use League\CommonMark\Extension\CommonMark\Node\Block\HtmlBlock; - -/** - * Provides regular expressions and utilities for parsing Markdown - * - * All of the PARTIAL_ regex constants assume that they'll be used in case-insensitive searches - * All other complete regexes provided by this class (either via constants or methods) will have case-insensitivity enabled. - * - * @phpcs:disable Generic.Strings.UnnecessaryStringConcat.Found - * - * @psalm-immutable - */ -final class RegexHelper -{ - // Partial regular expressions (wrap with `/` on each side and add the case-insensitive `i` flag before use) - public const PARTIAL_ENTITY = '&(?:#x[a-f0-9]{1,6}|#[0-9]{1,7}|[a-z][a-z0-9]{1,31});'; - public const PARTIAL_ESCAPABLE = '[!"#$%&\'()*+,.\/:;<=>?@[\\\\\]^_`{|}~-]'; - public const PARTIAL_ESCAPED_CHAR = '\\\\' . self::PARTIAL_ESCAPABLE; - public const PARTIAL_IN_DOUBLE_QUOTES = '"(' . self::PARTIAL_ESCAPED_CHAR . '|[^"\x00])*"'; - public const PARTIAL_IN_SINGLE_QUOTES = '\'(' . self::PARTIAL_ESCAPED_CHAR . '|[^\'\x00])*\''; - public const PARTIAL_IN_PARENS = '\\((' . self::PARTIAL_ESCAPED_CHAR . '|[^)\x00])*\\)'; - public const PARTIAL_REG_CHAR = '[^\\\\()\x00-\x20]'; - public const PARTIAL_IN_PARENS_NOSP = '\((' . self::PARTIAL_REG_CHAR . '|' . self::PARTIAL_ESCAPED_CHAR . '|\\\\)*\)'; - public const PARTIAL_TAGNAME = '[a-z][a-z0-9-]*'; - public const PARTIAL_BLOCKTAGNAME = '(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)'; - public const PARTIAL_ATTRIBUTENAME = '[a-z_:][a-z0-9:._-]*'; - public const PARTIAL_UNQUOTEDVALUE = '[^"\'=<>`\x00-\x20]+'; - public const PARTIAL_SINGLEQUOTEDVALUE = '\'[^\']*\''; - public const PARTIAL_DOUBLEQUOTEDVALUE = '"[^"]*"'; - public const PARTIAL_ATTRIBUTEVALUE = '(?:' . self::PARTIAL_UNQUOTEDVALUE . '|' . self::PARTIAL_SINGLEQUOTEDVALUE . '|' . self::PARTIAL_DOUBLEQUOTEDVALUE . ')'; - public const PARTIAL_ATTRIBUTEVALUESPEC = '(?:' . '\s*=' . '\s*' . self::PARTIAL_ATTRIBUTEVALUE . ')'; - public const PARTIAL_ATTRIBUTE = '(?:' . '\s+' . self::PARTIAL_ATTRIBUTENAME . self::PARTIAL_ATTRIBUTEVALUESPEC . '?)'; - public const PARTIAL_OPENTAG = '<' . self::PARTIAL_TAGNAME . self::PARTIAL_ATTRIBUTE . '*' . '\s*\/?>'; - public const PARTIAL_CLOSETAG = '<\/' . self::PARTIAL_TAGNAME . '\s*[>]'; - public const PARTIAL_OPENBLOCKTAG = '<' . self::PARTIAL_BLOCKTAGNAME . self::PARTIAL_ATTRIBUTE . '*' . '\s*\/?>'; - public const PARTIAL_CLOSEBLOCKTAG = '<\/' . self::PARTIAL_BLOCKTAGNAME . '\s*[>]'; - public const PARTIAL_HTMLCOMMENT = '<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->'; - public const PARTIAL_PROCESSINGINSTRUCTION = '[<][?][\s\S]*?[?][>]'; - public const PARTIAL_DECLARATION = '<![A-Z]+' . '\s+[^>]*>'; - public const PARTIAL_CDATA = '<!\[CDATA\[[\s\S]*?]\]>'; - public const PARTIAL_HTMLTAG = '(?:' . self::PARTIAL_OPENTAG . '|' . self::PARTIAL_CLOSETAG . '|' . self::PARTIAL_HTMLCOMMENT . '|' . - self::PARTIAL_PROCESSINGINSTRUCTION . '|' . self::PARTIAL_DECLARATION . '|' . self::PARTIAL_CDATA . ')'; - public const PARTIAL_HTMLBLOCKOPEN = '<(?:' . self::PARTIAL_BLOCKTAGNAME . '(?:[\s\/>]|$)' . '|' . - '\/' . self::PARTIAL_BLOCKTAGNAME . '(?:[\s>]|$)' . '|' . '[?!])'; - public const PARTIAL_LINK_TITLE = '^(?:"(' . self::PARTIAL_ESCAPED_CHAR . '|[^"\x00])*"' . - '|' . '\'(' . self::PARTIAL_ESCAPED_CHAR . '|[^\'\x00])*\'' . - '|' . '\((' . self::PARTIAL_ESCAPED_CHAR . '|[^()\x00])*\))'; - - public const REGEX_PUNCTUATION = '/^[\x{2000}-\x{206F}\x{2E00}-\x{2E7F}\p{Pc}\p{Pd}\p{Pe}\p{Pf}\p{Pi}\p{Po}\p{Ps}\\\\\'!"#\$%&\(\)\*\+,\-\.\\/:;<=>\?@\[\]\^_`\{\|\}~]/u'; - public const REGEX_UNSAFE_PROTOCOL = '/^javascript:|vbscript:|file:|data:/i'; - public const REGEX_SAFE_DATA_PROTOCOL = '/^data:image\/(?:png|gif|jpeg|webp)/i'; - public const REGEX_NON_SPACE = '/[^ \t\f\v\r\n]/'; - - public const REGEX_WHITESPACE_CHAR = '/^[ \t\n\x0b\x0c\x0d]/'; - public const REGEX_UNICODE_WHITESPACE_CHAR = '/^\pZ|\s/u'; - public const REGEX_THEMATIC_BREAK = '/^(?:\*[ \t]*){3,}$|^(?:_[ \t]*){3,}$|^(?:-[ \t]*){3,}$/'; - public const REGEX_LINK_DESTINATION_BRACES = '/^(?:<(?:[^<>\\n\\\\\\x00]|\\\\.)*>)/'; - - /** - * @psalm-pure - */ - public static function isEscapable(string $character): bool - { - return \preg_match('/' . self::PARTIAL_ESCAPABLE . '/', $character) === 1; - } - - /** - * @psalm-pure - */ - public static function isLetter(?string $character): bool - { - if ($character === null) { - return false; - } - - return \preg_match('/[\pL]/u', $character) === 1; - } - - /** - * Attempt to match a regex in string s at offset offset - * - * @return int|null Index of match, or null - * - * @psalm-pure - */ - public static function matchAt(string $regex, string $string, int $offset = 0): ?int - { - $matches = []; - $string = \mb_substr($string, $offset, null, 'UTF-8'); - if (! \preg_match($regex, $string, $matches, \PREG_OFFSET_CAPTURE)) { - return null; - } - - // PREG_OFFSET_CAPTURE always returns the byte offset, not the char offset, which is annoying - $charPos = \mb_strlen(\mb_strcut($string, 0, $matches[0][1], 'UTF-8'), 'UTF-8'); - - return $offset + $charPos; - } - - /** - * Functional wrapper around preg_match_all which only returns the first set of matches - * - * @return string[]|null - * - * @psalm-pure - */ - public static function matchFirst(string $pattern, string $subject, int $offset = 0): ?array - { - if ($offset !== 0) { - $subject = \substr($subject, $offset); - } - - \preg_match_all($pattern, $subject, $matches, \PREG_SET_ORDER); - - if ($matches === []) { - return null; - } - - return $matches[0] ?: null; - } - - /** - * Replace backslash escapes with literal characters - * - * @psalm-pure - */ - public static function unescape(string $string): string - { - $allEscapedChar = '/\\\\(' . self::PARTIAL_ESCAPABLE . ')/'; - - $escaped = \preg_replace($allEscapedChar, '$1', $string); - \assert(\is_string($escaped)); - - return \preg_replace_callback('/' . self::PARTIAL_ENTITY . '/i', static fn ($e) => Html5EntityDecoder::decode($e[0]), $escaped); - } - - /** - * @internal - * - * @param int $type HTML block type - * - * @psalm-param HtmlBlock::TYPE_* $type - * - * @phpstan-param HtmlBlock::TYPE_* $type - * - * @throws \InvalidArgumentException if an invalid type is given - * - * @psalm-pure - */ - public static function getHtmlBlockOpenRegex(int $type): string - { - switch ($type) { - case HtmlBlock::TYPE_1_CODE_CONTAINER: - return '/^<(?:script|pre|textarea|style)(?:\s|>|$)/i'; - case HtmlBlock::TYPE_2_COMMENT: - return '/^<!--/'; - case HtmlBlock::TYPE_3: - return '/^<[?]/'; - case HtmlBlock::TYPE_4: - return '/^<![A-Z]/i'; - case HtmlBlock::TYPE_5_CDATA: - return '/^<!\[CDATA\[/i'; - case HtmlBlock::TYPE_6_BLOCK_ELEMENT: - return '%^<[/]?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[123456]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|[/]?[>]|$)%i'; - case HtmlBlock::TYPE_7_MISC_ELEMENT: - return '/^(?:' . self::PARTIAL_OPENTAG . '|' . self::PARTIAL_CLOSETAG . ')\\s*$/i'; - default: - throw new \InvalidArgumentException('Invalid HTML block type'); - } - } - - /** - * @internal - * - * @param int $type HTML block type - * - * @psalm-param HtmlBlock::TYPE_* $type - * - * @phpstan-param HtmlBlock::TYPE_* $type - * - * @throws \InvalidArgumentException if an invalid type is given - * - * @psalm-pure - */ - public static function getHtmlBlockCloseRegex(int $type): string - { - switch ($type) { - case HtmlBlock::TYPE_1_CODE_CONTAINER: - return '%<\/(?:script|pre|textarea|style)>%i'; - case HtmlBlock::TYPE_2_COMMENT: - return '/-->/'; - case HtmlBlock::TYPE_3: - return '/\?>/'; - case HtmlBlock::TYPE_4: - return '/>/'; - case HtmlBlock::TYPE_5_CDATA: - return '/\]\]>/'; - default: - throw new \InvalidArgumentException('Invalid HTML block type'); - } - } - - /** - * @psalm-pure - */ - public static function isLinkPotentiallyUnsafe(string $url): bool - { - return \preg_match(self::REGEX_UNSAFE_PROTOCOL, $url) !== 0 && \preg_match(self::REGEX_SAFE_DATA_PROTOCOL, $url) === 0; - } -} diff --git a/vendor/league/commonmark/src/Util/SpecReader.php b/vendor/league/commonmark/src/Util/SpecReader.php deleted file mode 100644 index a019d6ee..00000000 --- a/vendor/league/commonmark/src/Util/SpecReader.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Util; - -/** - * Reads in a CommonMark spec document and extracts the input/output examples for testing against them - */ -final class SpecReader -{ - private function __construct() - { - } - - /** - * @return iterable<string, array{input: string, output: string, type: string, section: string, number: int}> - */ - public static function read(string $data): iterable - { - // Normalize newlines for platform independence - $data = \preg_replace('/\r\n?/', "\n", $data); - \assert($data !== null); - $data = \preg_replace('/<!-- END TESTS -->.*$/', '', $data); - \assert($data !== null); - \preg_match_all('/^`{32} (example ?\w*)\n([\s\S]*?)^\.\n([\s\S]*?)^`{32}$|^#{1,6} *(.*)$/m', $data, $matches, PREG_SET_ORDER); - - $currentSection = 'Example'; - $exampleNumber = 0; - - foreach ($matches as $match) { - if (isset($match[4])) { - $currentSection = $match[4]; - continue; - } - - yield \trim($currentSection . ' #' . $exampleNumber) => [ - 'input' => \str_replace('→', "\t", $match[2]), - 'output' => \str_replace('→', "\t", $match[3]), - 'type' => $match[1], - 'section' => $currentSection, - 'number' => $exampleNumber++, - ]; - } - } - - /** - * @return iterable<string, array{input: string, output: string, type: string, section: string, number: int}> - * - * @throws \RuntimeException if the file cannot be loaded - */ - public static function readFile(string $filename): iterable - { - if (($data = \file_get_contents($filename)) === false) { - throw new \RuntimeException(\sprintf('Failed to load spec from %s', $filename)); - } - - return self::read($data); - } -} diff --git a/vendor/league/commonmark/src/Util/UrlEncoder.php b/vendor/league/commonmark/src/Util/UrlEncoder.php deleted file mode 100644 index bba1af34..00000000 --- a/vendor/league/commonmark/src/Util/UrlEncoder.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Util; - -use League\CommonMark\Exception\UnexpectedEncodingException; - -/** - * @psalm-immutable - */ -final class UrlEncoder -{ - private const ENCODE_CACHE = ['%00', '%01', '%02', '%03', '%04', '%05', '%06', '%07', '%08', '%09', '%0A', '%0B', '%0C', '%0D', '%0E', '%0F', '%10', '%11', '%12', '%13', '%14', '%15', '%16', '%17', '%18', '%19', '%1A', '%1B', '%1C', '%1D', '%1E', '%1F', '%20', '!', '%22', '#', '$', '%25', '&', "'", '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '%3C', '=', '%3E', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '%5B', '%5C', '%5D', '%5E', '_', '%60', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '%7B', '%7C', '%7D', '~', '%7F']; - - /** - * @throws UnexpectedEncodingException if a non-UTF-8-compatible encoding is used - * - * @psalm-pure - */ - public static function unescapeAndEncode(string $uri): string - { - // Optimization: if the URL only includes characters we know will be kept as-is, then just return the URL as-is. - if (\preg_match('/^[A-Za-z0-9~!@#$&*()\-_=+;:,.\/?]+$/', $uri)) { - return $uri; - } - - if (! \mb_check_encoding($uri, 'UTF-8')) { - throw new UnexpectedEncodingException('Unexpected encoding - UTF-8 or ASCII was expected'); - } - - $result = ''; - - $chars = \mb_str_split($uri, 1, 'UTF-8'); - - $l = \count($chars); - for ($i = 0; $i < $l; $i++) { - $code = $chars[$i]; - if ($code === '%' && $i + 2 < $l) { - if (\preg_match('/^[0-9a-f]{2}$/i', $chars[$i + 1] . $chars[$i + 2]) === 1) { - $result .= '%' . $chars[$i + 1] . $chars[$i + 2]; - $i += 2; - continue; - } - } - - if (\ord($code) < 128) { - $result .= self::ENCODE_CACHE[\ord($code)]; - continue; - } - - $result .= \rawurlencode($code); - } - - return $result; - } -} diff --git a/vendor/league/commonmark/src/Util/Xml.php b/vendor/league/commonmark/src/Util/Xml.php deleted file mode 100644 index 8f9e84d0..00000000 --- a/vendor/league/commonmark/src/Util/Xml.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js) - * - (c) John MacFarlane - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Util; - -/** - * Utility class for handling/generating XML and HTML - * - * @psalm-immutable - */ -final class Xml -{ - /** - * @psalm-pure - */ - public static function escape(string $string): string - { - return \str_replace(['&', '<', '>', '"'], ['&', '<', '>', '"'], $string); - } -} diff --git a/vendor/league/commonmark/src/Xml/FallbackNodeXmlRenderer.php b/vendor/league/commonmark/src/Xml/FallbackNodeXmlRenderer.php deleted file mode 100644 index 48aa3c8e..00000000 --- a/vendor/league/commonmark/src/Xml/FallbackNodeXmlRenderer.php +++ /dev/null @@ -1,85 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Xml; - -use League\CommonMark\Node\Block\AbstractBlock; -use League\CommonMark\Node\Inline\AbstractInline; -use League\CommonMark\Node\Node; - -/** - * @internal - */ -final class FallbackNodeXmlRenderer implements XmlNodeRendererInterface -{ - /** - * @var array<string, string> - * - * @psalm-allow-private-mutation - */ - private array $classCache = []; - - /** - * @psalm-allow-private-mutation - */ - public function getXmlTagName(Node $node): string - { - $className = \get_class($node); - if (isset($this->classCache[$className])) { - return $this->classCache[$className]; - } - - $type = $node instanceof AbstractBlock ? 'block' : 'inline'; - $shortName = \strtolower((new \ReflectionClass($node))->getShortName()); - - return $this->classCache[$className] = \sprintf('custom_%s_%s', $type, $shortName); - } - - /** - * {@inheritDoc} - */ - public function getXmlAttributes(Node $node): array - { - $attrs = []; - foreach ($node->data->export() as $k => $v) { - if (self::isValueUsable($v)) { - $attrs[$k] = $v; - } - } - - $reflClass = new \ReflectionClass($node); - foreach ($reflClass->getProperties() as $property) { - if (\in_array($property->getDeclaringClass()->getName(), [Node::class, AbstractBlock::class, AbstractInline::class], true)) { - continue; - } - - $property->setAccessible(true); - $value = $property->getValue($node); - if (self::isValueUsable($value)) { - $attrs[$property->getName()] = $value; - } - } - - return $attrs; - } - - /** - * @param mixed $var - * - * @psalm-pure - */ - private static function isValueUsable($var): bool - { - return \is_string($var) || \is_int($var) || \is_float($var) || \is_bool($var); - } -} diff --git a/vendor/league/commonmark/src/Xml/MarkdownToXmlConverter.php b/vendor/league/commonmark/src/Xml/MarkdownToXmlConverter.php deleted file mode 100644 index cf1da67b..00000000 --- a/vendor/league/commonmark/src/Xml/MarkdownToXmlConverter.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Xml; - -use League\CommonMark\ConverterInterface; -use League\CommonMark\Environment\EnvironmentInterface; -use League\CommonMark\Output\RenderedContentInterface; -use League\CommonMark\Parser\MarkdownParser; -use League\CommonMark\Parser\MarkdownParserInterface; -use League\CommonMark\Renderer\DocumentRendererInterface; - -final class MarkdownToXmlConverter implements ConverterInterface -{ - /** @psalm-readonly */ - private MarkdownParserInterface $parser; - - /** @psalm-readonly */ - private DocumentRendererInterface $renderer; - - public function __construct(EnvironmentInterface $environment) - { - $this->parser = new MarkdownParser($environment); - $this->renderer = new XmlRenderer($environment); - } - - /** - * Converts Markdown to XML - * - * @throws \RuntimeException - */ - public function convert(string $input): RenderedContentInterface - { - return $this->renderer->renderDocument($this->parser->parse($input)); - } - - /** - * Converts CommonMark to HTML. - * - * @see MarkdownToXmlConverter::convert() - * - * @throws \RuntimeException - */ - public function __invoke(string $input): RenderedContentInterface - { - return $this->convert($input); - } -} diff --git a/vendor/league/commonmark/src/Xml/XmlNodeRendererInterface.php b/vendor/league/commonmark/src/Xml/XmlNodeRendererInterface.php deleted file mode 100644 index aafc9f15..00000000 --- a/vendor/league/commonmark/src/Xml/XmlNodeRendererInterface.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/commonmark package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\CommonMark\Xml; - -use League\CommonMark\Node\Node; - -interface XmlNodeRendererInterface -{ - public function getXmlTagName(Node $node): string; - - /** - * @return array<string, string|int|float|bool> - * - * @psalm-return array<string, scalar> - */ - public function getXmlAttributes(Node $node): array; -} diff --git a/vendor/league/commonmark/src/Xml/XmlRenderer.php b/vendor/league/commonmark/src/Xml/XmlRenderer.php deleted file mode 100644 index db29aa45..00000000 --- a/vendor/league/commonmark/src/Xml/XmlRenderer.php +++ /dev/null @@ -1,134 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\CommonMark\Xml; - -use League\CommonMark\Environment\EnvironmentInterface; -use League\CommonMark\Event\DocumentPreRenderEvent; -use League\CommonMark\Node\Block\Document; -use League\CommonMark\Node\Node; -use League\CommonMark\Node\StringContainerInterface; -use League\CommonMark\Output\RenderedContent; -use League\CommonMark\Output\RenderedContentInterface; -use League\CommonMark\Renderer\DocumentRendererInterface; -use League\CommonMark\Util\Xml; - -final class XmlRenderer implements DocumentRendererInterface -{ - private const INDENTATION = ' '; - - private EnvironmentInterface $environment; - - private XmlNodeRendererInterface $fallbackRenderer; - - /** @var array<class-string, XmlNodeRendererInterface> */ - private array $rendererCache = []; - - public function __construct(EnvironmentInterface $environment) - { - $this->environment = $environment; - $this->fallbackRenderer = new FallbackNodeXmlRenderer(); - } - - public function renderDocument(Document $document): RenderedContentInterface - { - $this->environment->dispatch(new DocumentPreRenderEvent($document, 'xml')); - - $xml = '<?xml version="1.0" encoding="UTF-8"?>'; - - $indent = 0; - $walker = $document->walker(); - while ($event = $walker->next()) { - $node = $event->getNode(); - - $closeImmediately = ! $node->hasChildren(); - $selfClosing = $closeImmediately && ! $node instanceof StringContainerInterface; - - $renderer = $this->findXmlRenderer($node); - $tagName = $renderer->getXmlTagName($node); - - if ($event->isEntering()) { - $attrs = $renderer->getXmlAttributes($node); - - $xml .= "\n" . \str_repeat(self::INDENTATION, $indent); - $xml .= self::tag($tagName, $attrs, $selfClosing); - - if ($node instanceof StringContainerInterface) { - $xml .= Xml::escape($node->getLiteral()); - } - - if ($closeImmediately && ! $selfClosing) { - $xml .= self::tag('/' . $tagName); - } - - if (! $closeImmediately) { - $indent++; - } - } elseif (! $closeImmediately) { - $indent--; - $xml .= "\n" . \str_repeat(self::INDENTATION, $indent); - $xml .= self::tag('/' . $tagName); - } - } - - return new RenderedContent($document, $xml . "\n"); - } - - /** - * @param array<string, string|int|float|bool> $attrs - */ - private static function tag(string $name, array $attrs = [], bool $selfClosing = \false): string - { - $result = '<' . $name; - foreach ($attrs as $key => $value) { - $result .= \sprintf(' %s="%s"', $key, self::convertAndEscape($value)); - } - - if ($selfClosing) { - $result .= ' /'; - } - - $result .= '>'; - - return $result; - } - - /** - * @param string|int|float|bool $value - */ - private static function convertAndEscape($value): string - { - if (\is_string($value)) { - return Xml::escape($value); - } - - if (\is_int($value) || \is_float($value)) { - return (string) $value; - } - - if (\is_bool($value)) { - return $value ? 'true' : 'false'; - } - - // @phpstan-ignore-next-line - throw new \InvalidArgumentException('$value must be a string, int, float, or bool'); - } - - private function findXmlRenderer(Node $node): XmlNodeRendererInterface - { - $class = \get_class($node); - - if (\array_key_exists($class, $this->rendererCache)) { - return $this->rendererCache[$class]; - } - - foreach ($this->environment->getRenderersForClass($class) as $renderer) { - if ($renderer instanceof XmlNodeRendererInterface) { - return $this->rendererCache[$class] = $renderer; - } - } - - return $this->rendererCache[$class] = $this->fallbackRenderer; - } -} diff --git a/vendor/league/config/CHANGELOG.md b/vendor/league/config/CHANGELOG.md deleted file mode 100644 index 9a7813ac..00000000 --- a/vendor/league/config/CHANGELOG.md +++ /dev/null @@ -1,42 +0,0 @@ -# Change Log -All notable changes to this project will be documented in this file. -Updates should follow the [Keep a CHANGELOG](https://keepachangelog.com/) principles. - -## [Unreleased][unreleased] - -## [1.2.0] - 2022-12-11 - -### Changed - -- Values can now be set prior to the corresponding schema being registered. -- `exists()` and `get()` now only trigger validation for the relevant schema, not the entire config at once. - -## [1.1.1] - 2021-08-14 - -### Changed - - - Bumped the minimum version of dflydev/dot-access-data for PHP 8.1 support - -## [1.1.0] - 2021-06-19 - -### Changed - -- Bumped the minimum PHP version to 7.4+ -- Bumped the minimum version of nette/schema to 1.2.0 - -## [1.0.1] - 2021-05-31 - -### Fixed - -- Fixed the `ConfigurationExceptionInterface` marker interface not extending `Throwable` (#2) - -## [1.0.0] - 2021-05-31 - -Initial release! 🎉 - -[unreleased]: https://github.com/thephpleague/config/compare/v1.2.0...main -[1.2.0]: https://github.com/thephpleague/config/compare/v1.1.1...v.1.2.0 -[1.1.1]: https://github.com/thephpleague/config/compare/v1.1.0...v1.1.1 -[1.1.0]: https://github.com/thephpleague/config/compare/v1.0.1...v1.1.0 -[1.0.1]: https://github.com/thephpleague/config/compare/v1.0.0...v1.0.1 -[1.0.0]: https://github.com/thephpleague/config/releases/tag/v1.0.0 diff --git a/vendor/league/config/LICENSE.md b/vendor/league/config/LICENSE.md deleted file mode 100644 index 1a444a17..00000000 --- a/vendor/league/config/LICENSE.md +++ /dev/null @@ -1,28 +0,0 @@ -BSD 3-Clause License - -Copyright (c) 2022, Colin O'Dell. 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 its - 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 HOLDER 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/league/config/README.md b/vendor/league/config/README.md deleted file mode 100644 index 23047465..00000000 --- a/vendor/league/config/README.md +++ /dev/null @@ -1,153 +0,0 @@ -# league/config - -[![Latest Version](https://img.shields.io/packagist/v/league/config.svg?style=flat-square)](https://packagist.org/packages/league/config) -[![Total Downloads](https://img.shields.io/packagist/dt/league/config.svg?style=flat-square)](https://packagist.org/packages/league/config) -[![Software License](https://img.shields.io/badge/License-BSD--3-brightgreen.svg?style=flat-square)](LICENSE) -[![Build Status](https://img.shields.io/github/workflow/status/thephpleague/config/Tests/main.svg?style=flat-square)](https://github.com/thephpleague/config/actions?query=workflow%3ATests+branch%3Amain) -[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/thephpleague/config.svg?style=flat-square)](https://scrutinizer-ci.com/g/thephpleague/config/code-structure) -[![Quality Score](https://img.shields.io/scrutinizer/g/thephpleague/config.svg?style=flat-square)](https://scrutinizer-ci.com/g/thephpleague/config) -[![Sponsor development of this project](https://img.shields.io/badge/sponsor%20this%20package-%E2%9D%A4-ff69b4.svg?style=flat-square)](https://www.colinodell.com/sponsor) - -**league/config** helps you define nested configuration arrays with strict schemas and access configuration values with dot notation. It was created by [Colin O'Dell][@colinodell]. - -## 📦 Installation - -This project requires PHP 7.4 or higher. To install it via [Composer] simply run: - -```bash -composer require league/config -``` - -## 🧰️ Basic Usage - -The `Configuration` class provides everything you need to define the configuration structure and fetch values: - -```php -use League\Config\Configuration; -use Nette\Schema\Expect; - -// Define your configuration schema -$config = new Configuration([ - 'database' => Expect::structure([ - 'driver' => Expect::anyOf('mysql', 'postgresql', 'sqlite')->required(), - 'host' => Expect::string()->default('localhost'), - 'port' => Expect::int()->min(1)->max(65535), - 'ssl' => Expect::bool(), - 'database' => Expect::string()->required(), - 'username' => Expect::string()->required(), - 'password' => Expect::string()->nullable(), - ]), - 'logging' => Expect::structure([ - 'enabled' => Expect::bool()->default($_ENV['DEBUG'] == true), - 'file' => Expect::string()->deprecated("use logging.path instead"), - 'path' => Expect::string()->assert(function ($path) { return \is_writeable($path); })->required(), - ]), -]); - -// Set the values, either all at once with `merge()`: -$config->merge([ - 'database' => [ - 'driver' => 'mysql', - 'port' => 3306, - 'database' => 'mydb', - 'username' => 'user', - 'password' => 'secret', - ], -]); - -// Or one-at-a-time with `set()`: -$config->set('logging.path', '/var/log/myapp.log'); - -// You can now retrieve those values with `get()`. -// Validation and defaults will be applied for you automatically -$config->get('database'); // Fetches the entire "database" section as an array -$config->get('database.driver'); // Fetch a specific nested value with dot notation -$config->get('database/driver'); // Fetch a specific nested value with slash notation -$config->get('database.host'); // Returns the default value "localhost" -$config->get('logging.path'); // Guaranteed to be writeable thanks to the assertion in the schema - -// If validation fails an `InvalidConfigurationException` will be thrown: -$config->set('database.driver', 'mongodb'); -$config->get('database.driver'); // InvalidConfigurationException - -// Attempting to fetch a non-existent key will result in an `InvalidConfigurationException` -$config->get('foo.bar'); - -// You could avoid this by checking whether that item exists: -$config->exists('foo.bar'); // Returns `false` -``` - -## 📓 Documentation - -Full documentation can be found at [config.thephpleague.com][docs]. - -## 💭 Philosophy - -This library aims to provide a **simple yet opinionated** approach to configuration with the following goals: - -- The configuration should operate on **arrays with nested values** which are easily accessible -- The configuration structure should be **defined with strict schemas** defining the overall structure, allowed types, and allowed values -- Schemas should be defined using a **simple, fluent interface** -- You should be able to **add and combine schemas but never modify existing ones** -- Both the configuration values and the schema should be **defined and managed with PHP code** -- Schemas should be **immutable**; they should never change once they are set -- Configuration values should never define or influence the schemas - -As a result, this library will likely **never** support features like: - -- Loading and/or exporting configuration values or schemas using YAML, XML, or other files -- Parsing configuration values from a command line or other user interface -- Dynamically changing the schema, allowed values, or default values based on other configuration values - -If you need that functionality you should check out other libraries like: - -- [symfony/config] -- [symfony/options-resolver] -- [hassankhan/config] -- [consolidation/config] -- [laminas/laminas-config] - -## 🏷️ Versioning - -[SemVer](http://semver.org/) is followed closely. Minor and patch releases should not introduce breaking changes to the codebase. - -Any classes or methods marked `@internal` are not intended for use outside this library and are subject to breaking changes at any time, so please avoid using them. - -## 🛠️ Maintenance & Support - -When a new **minor** version (e.g. `1.0` -> `1.1`) is released, the previous one (`1.0`) will continue to receive security and critical bug fixes for *at least* 3 months. - -When a new **major** version is released (e.g. `1.1` -> `2.0`), the previous one (`1.1`) will receive critical bug fixes for *at least* 3 months and security updates for 6 months after that new release comes out. - -(This policy may change in the future and exceptions may be made on a case-by-case basis.) - -## 👷‍️ Contributing - -Contributions to this library are **welcome**! We only ask that you adhere to our [contributor guidelines] and avoid making changes that conflict with our Philosophy above. - -## 🧪 Testing - -```bash -composer test -``` - -## 📄 License - -**league/config** is licensed under the BSD-3 license. See the [`LICENSE.md`][license] file for more details. - -## 🗺️ Who Uses It? - -This project is used by [league/commonmark][league-commonmark]. - -[docs]: https://config.thephpleague.com/ -[@colinodell]: https://www.twitter.com/colinodell -[Composer]: https://getcomposer.org/ -[PHP League]: https://thephpleague.com -[symfony/config]: https://symfony.com/doc/current/components/config.html -[symfony/options-resolver]: https://symfony.com/doc/current/components/options_resolver.html -[hassankhan/config]: https://github.com/hassankhan/config -[consolidation/config]: https://github.com/consolidation/config -[laminas/laminas-config]: https://docs.laminas.dev/laminas-config/ -[contributor guidelines]: https://github.com/thephpleague/config/blob/main/.github/CONTRIBUTING.md -[license]: https://github.com/thephpleague/config/blob/main/LICENSE.md -[league-commonmark]: https://commonmark.thephpleague.com diff --git a/vendor/league/config/composer.json b/vendor/league/config/composer.json deleted file mode 100644 index 3cd8d87e..00000000 --- a/vendor/league/config/composer.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "name": "league/config", - "type": "library", - "description": "Define configuration arrays with strict schemas and access values with dot notation", - "keywords": ["configuration","config","schema","array","nested","dot","dot-access"], - "homepage": "https://config.thephpleague.com", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Colin O'Dell", - "email": "colinodell@gmail.com", - "homepage": "https://www.colinodell.com", - "role": "Lead Developer" - } - ], - "support": { - "docs": "https://config.thephpleague.com/", - "issues": "https://github.com/thephpleague/config/issues", - "rss": "https://github.com/thephpleague/config/releases.atom", - "source": "https://github.com/thephpleague/config" - }, - "require": { - "php": "^7.4 || ^8.0", - "dflydev/dot-access-data": "^3.0.1", - "nette/schema": "^1.2" - }, - "require-dev": { - "phpstan/phpstan": "^1.8.2", - "phpunit/phpunit": "^9.5.5", - "scrutinizer/ocular": "^1.8.1", - "unleashedtech/php-coding-standard": "^3.1", - "vimeo/psalm": "^4.7.3" - }, - "minimum-stability": "dev", - "prefer-stable": true, - "autoload": { - "psr-4": { - "League\\Config\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "League\\Config\\Tests\\": "tests" - } - }, - "scripts": { - "phpcs": "phpcs", - "phpstan": "phpstan analyse", - "phpunit": "phpunit --no-coverage", - "psalm": "psalm", - "test": [ - "@phpcs", - "@phpstan", - "@psalm", - "@phpunit" - ] - }, - "extra": { - "branch-alias": { - "dev-main": "1.2-dev" - } - }, - "config": { - "sort-packages": true, - "allow-plugins": { - "dealerdirect/phpcodesniffer-composer-installer": true - } - } -} diff --git a/vendor/league/config/src/Configuration.php b/vendor/league/config/src/Configuration.php deleted file mode 100644 index 62943678..00000000 --- a/vendor/league/config/src/Configuration.php +++ /dev/null @@ -1,255 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/config package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\Config; - -use Dflydev\DotAccessData\Data; -use Dflydev\DotAccessData\DataInterface; -use Dflydev\DotAccessData\Exception\DataException; -use Dflydev\DotAccessData\Exception\InvalidPathException; -use Dflydev\DotAccessData\Exception\MissingPathException; -use League\Config\Exception\UnknownOptionException; -use League\Config\Exception\ValidationException; -use Nette\Schema\Expect; -use Nette\Schema\Processor; -use Nette\Schema\Schema; -use Nette\Schema\ValidationException as NetteValidationException; - -final class Configuration implements ConfigurationBuilderInterface, ConfigurationInterface -{ - /** @psalm-readonly */ - private Data $userConfig; - - /** - * @var array<string, Schema> - * - * @psalm-allow-private-mutation - */ - private array $configSchemas = []; - - /** @psalm-allow-private-mutation */ - private Data $finalConfig; - - /** - * @var array<string, mixed> - * - * @psalm-allow-private-mutation - */ - private array $cache = []; - - /** @psalm-readonly */ - private ConfigurationInterface $reader; - - /** - * @param array<string, Schema> $baseSchemas - */ - public function __construct(array $baseSchemas = []) - { - $this->configSchemas = $baseSchemas; - $this->userConfig = new Data(); - $this->finalConfig = new Data(); - - $this->reader = new ReadOnlyConfiguration($this); - } - - /** - * Registers a new configuration schema at the given top-level key - * - * @psalm-allow-private-mutation - */ - public function addSchema(string $key, Schema $schema): void - { - $this->invalidate(); - - $this->configSchemas[$key] = $schema; - } - - /** - * {@inheritDoc} - * - * @psalm-allow-private-mutation - */ - public function merge(array $config = []): void - { - $this->invalidate(); - - $this->userConfig->import($config, DataInterface::REPLACE); - } - - /** - * {@inheritDoc} - * - * @psalm-allow-private-mutation - */ - public function set(string $key, $value): void - { - $this->invalidate(); - - try { - $this->userConfig->set($key, $value); - } catch (DataException $ex) { - throw new UnknownOptionException($ex->getMessage(), $key, (int) $ex->getCode(), $ex); - } - } - - /** - * {@inheritDoc} - * - * @psalm-external-mutation-free - */ - public function get(string $key) - { - if (\array_key_exists($key, $this->cache)) { - return $this->cache[$key]; - } - - try { - $this->build(self::getTopLevelKey($key)); - - return $this->cache[$key] = $this->finalConfig->get($key); - } catch (InvalidPathException | MissingPathException $ex) { - throw new UnknownOptionException($ex->getMessage(), $key, (int) $ex->getCode(), $ex); - } - } - - /** - * {@inheritDoc} - * - * @psalm-external-mutation-free - */ - public function exists(string $key): bool - { - if (\array_key_exists($key, $this->cache)) { - return true; - } - - try { - $this->build(self::getTopLevelKey($key)); - - return $this->finalConfig->has($key); - } catch (InvalidPathException | UnknownOptionException $ex) { - return false; - } - } - - /** - * @psalm-mutation-free - */ - public function reader(): ConfigurationInterface - { - return $this->reader; - } - - /** - * @psalm-external-mutation-free - */ - private function invalidate(): void - { - $this->cache = []; - $this->finalConfig = new Data(); - } - - /** - * Applies the schema against the configuration to return the final configuration - * - * @throws ValidationException|UnknownOptionException|InvalidPathException - * - * @psalm-allow-private-mutation - */ - private function build(string $topLevelKey): void - { - if ($this->finalConfig->has($topLevelKey)) { - return; - } - - if (! isset($this->configSchemas[$topLevelKey])) { - throw new UnknownOptionException(\sprintf('Missing config schema for "%s"', $topLevelKey), $topLevelKey); - } - - try { - $userData = [$topLevelKey => $this->userConfig->get($topLevelKey)]; - } catch (DataException $ex) { - $userData = []; - } - - try { - $schema = $this->configSchemas[$topLevelKey]; - $processor = new Processor(); - - $processed = $processor->process(Expect::structure([$topLevelKey => $schema]), $userData); - - $this->raiseAnyDeprecationNotices($processor->getWarnings()); - - $this->finalConfig->import((array) self::convertStdClassesToArrays($processed)); - } catch (NetteValidationException $ex) { - throw new ValidationException($ex); - } - } - - /** - * Recursively converts stdClass instances to arrays - * - * @phpstan-template T - * - * @param T $data - * - * @return mixed - * - * @phpstan-return ($data is \stdClass ? array<string, mixed> : T) - * - * @psalm-pure - */ - private static function convertStdClassesToArrays($data) - { - if ($data instanceof \stdClass) { - $data = (array) $data; - } - - if (\is_array($data)) { - foreach ($data as $k => $v) { - $data[$k] = self::convertStdClassesToArrays($v); - } - } - - return $data; - } - - /** - * @param string[] $warnings - */ - private function raiseAnyDeprecationNotices(array $warnings): void - { - foreach ($warnings as $warning) { - @\trigger_error($warning, \E_USER_DEPRECATED); - } - } - - /** - * @throws InvalidPathException - */ - private static function getTopLevelKey(string $path): string - { - if (\strlen($path) === 0) { - throw new InvalidPathException('Path cannot be an empty string'); - } - - $path = \str_replace(['.', '/'], '.', $path); - - $firstDelimiter = \strpos($path, '.'); - if ($firstDelimiter === false) { - return $path; - } - - return \substr($path, 0, $firstDelimiter); - } -} diff --git a/vendor/league/config/src/ConfigurationAwareInterface.php b/vendor/league/config/src/ConfigurationAwareInterface.php deleted file mode 100644 index ec5d7b36..00000000 --- a/vendor/league/config/src/ConfigurationAwareInterface.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/config package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\Config; - -/** - * Implement this class to facilitate setter injection of the configuration where needed - */ -interface ConfigurationAwareInterface -{ - public function setConfiguration(ConfigurationInterface $configuration): void; -} diff --git a/vendor/league/config/src/ConfigurationBuilderInterface.php b/vendor/league/config/src/ConfigurationBuilderInterface.php deleted file mode 100644 index e9c5ed6c..00000000 --- a/vendor/league/config/src/ConfigurationBuilderInterface.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/config package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\Config; - -/** - * An interface that provides the ability to set both the schema and configuration values - */ -interface ConfigurationBuilderInterface extends MutableConfigurationInterface, SchemaBuilderInterface -{ -} diff --git a/vendor/league/config/src/ConfigurationInterface.php b/vendor/league/config/src/ConfigurationInterface.php deleted file mode 100644 index 534bd9fd..00000000 --- a/vendor/league/config/src/ConfigurationInterface.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/config package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\Config; - -use League\Config\Exception\UnknownOptionException; -use League\Config\Exception\ValidationException; - -/** - * Interface for reading configuration values - */ -interface ConfigurationInterface -{ - /** - * @param string $key Configuration option path/key - * - * @psalm-param non-empty-string $key - * - * @return mixed - * - * @throws ValidationException if the schema failed to validate the given input - * @throws UnknownOptionException if the requested key does not exist or is malformed - */ - public function get(string $key); - - /** - * @param string $key Configuration option path/key - * - * @psalm-param non-empty-string $key - * - * @return bool Whether the given option exists - * - * @throws ValidationException if the schema failed to validate the given input - */ - public function exists(string $key): bool; -} diff --git a/vendor/league/config/src/ConfigurationProviderInterface.php b/vendor/league/config/src/ConfigurationProviderInterface.php deleted file mode 100644 index 7af6148b..00000000 --- a/vendor/league/config/src/ConfigurationProviderInterface.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/config package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\Config; - -/** - * Interface for a service which provides a readable configuration object - */ -interface ConfigurationProviderInterface -{ - public function getConfiguration(): ConfigurationInterface; -} diff --git a/vendor/league/config/src/Exception/ConfigurationExceptionInterface.php b/vendor/league/config/src/Exception/ConfigurationExceptionInterface.php deleted file mode 100644 index db9ee783..00000000 --- a/vendor/league/config/src/Exception/ConfigurationExceptionInterface.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/config package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\Config\Exception; - -/** - * Marker interface for any/all exceptions thrown by this library - */ -interface ConfigurationExceptionInterface extends \Throwable -{ -} diff --git a/vendor/league/config/src/Exception/InvalidConfigurationException.php b/vendor/league/config/src/Exception/InvalidConfigurationException.php deleted file mode 100644 index f2a6b697..00000000 --- a/vendor/league/config/src/Exception/InvalidConfigurationException.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/config package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\Config\Exception; - -class InvalidConfigurationException extends \UnexpectedValueException implements ConfigurationExceptionInterface -{ - /** - * @param string $option Name/path of the option - * @param mixed $valueGiven The invalid option that was provided - * @param ?string $description Additional text describing the issue (optional) - */ - public static function forConfigOption(string $option, $valueGiven, ?string $description = null): self - { - $message = \sprintf('Invalid config option for "%s": %s', $option, self::getDebugValue($valueGiven)); - if ($description !== null) { - $message .= \sprintf(' (%s)', $description); - } - - return new self($message); - } - - /** - * @param mixed $value - * - * @psalm-pure - */ - private static function getDebugValue($value): string - { - if (\is_object($value)) { - return \get_class($value); - } - - return \print_r($value, true); - } -} diff --git a/vendor/league/config/src/Exception/UnknownOptionException.php b/vendor/league/config/src/Exception/UnknownOptionException.php deleted file mode 100644 index 5afba12a..00000000 --- a/vendor/league/config/src/Exception/UnknownOptionException.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/config package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\Config\Exception; - -use Throwable; - -final class UnknownOptionException extends \InvalidArgumentException implements ConfigurationExceptionInterface -{ - private string $path; - - public function __construct(string $message, string $path, int $code = 0, ?Throwable $previous = null) - { - parent::__construct($message, $code, $previous); - - $this->path = $path; - } - - public function getPath(): string - { - return $this->path; - } -} diff --git a/vendor/league/config/src/Exception/ValidationException.php b/vendor/league/config/src/Exception/ValidationException.php deleted file mode 100644 index b43e2f5c..00000000 --- a/vendor/league/config/src/Exception/ValidationException.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/config package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\Config\Exception; - -use Nette\Schema\ValidationException as NetteException; - -final class ValidationException extends InvalidConfigurationException -{ - /** @var string[] */ - private array $messages; - - public function __construct(NetteException $innerException) - { - parent::__construct($innerException->getMessage(), (int) $innerException->getCode(), $innerException); - - $this->messages = $innerException->getMessages(); - } - - /** - * @return string[] - */ - public function getMessages(): array - { - return $this->messages; - } -} diff --git a/vendor/league/config/src/MutableConfigurationInterface.php b/vendor/league/config/src/MutableConfigurationInterface.php deleted file mode 100644 index 2d4b2ee8..00000000 --- a/vendor/league/config/src/MutableConfigurationInterface.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/config package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\Config; - -use League\Config\Exception\UnknownOptionException; - -/** - * Interface for setting/merging user-defined configuration values into the configuration object - */ -interface MutableConfigurationInterface -{ - /** - * @param mixed $value - * - * @throws UnknownOptionException if $key contains a nested path which doesn't point to an array value - */ - public function set(string $key, $value): void; - - /** - * @param array<string, mixed> $config - */ - public function merge(array $config = []): void; -} diff --git a/vendor/league/config/src/ReadOnlyConfiguration.php b/vendor/league/config/src/ReadOnlyConfiguration.php deleted file mode 100644 index 58e61719..00000000 --- a/vendor/league/config/src/ReadOnlyConfiguration.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/config package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\Config; - -/** - * Provides read-only access to a given Configuration object - */ -final class ReadOnlyConfiguration implements ConfigurationInterface -{ - private Configuration $config; - - public function __construct(Configuration $config) - { - $this->config = $config; - } - - /** - * {@inheritDoc} - */ - public function get(string $key) - { - return $this->config->get($key); - } - - public function exists(string $key): bool - { - return $this->config->exists($key); - } -} diff --git a/vendor/league/config/src/SchemaBuilderInterface.php b/vendor/league/config/src/SchemaBuilderInterface.php deleted file mode 100644 index 3a198078..00000000 --- a/vendor/league/config/src/SchemaBuilderInterface.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the league/config package. - * - * (c) Colin O'Dell <colinodell@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace League\Config; - -use Nette\Schema\Schema; - -/** - * Interface that allows new schemas to be added to a configuration - */ -interface SchemaBuilderInterface -{ - /** - * Registers a new configuration schema at the given top-level key - */ - public function addSchema(string $key, Schema $schema): void; -} diff --git a/vendor/league/flysystem/.dockerignore b/vendor/league/flysystem/.dockerignore deleted file mode 100644 index 6b8710a7..00000000 --- a/vendor/league/flysystem/.dockerignore +++ /dev/null @@ -1 +0,0 @@ -.git diff --git a/vendor/league/flysystem/INFO.md b/vendor/league/flysystem/INFO.md deleted file mode 100644 index 70c07b41..00000000 --- a/vendor/league/flysystem/INFO.md +++ /dev/null @@ -1,2 +0,0 @@ -View the docs at: https://flysystem.thephpleague.com/docs/ -Changelog at: https://github.com/thephpleague/flysystem/blob/3.x/CHANGELOG.md diff --git a/vendor/league/flysystem/LICENSE b/vendor/league/flysystem/LICENSE deleted file mode 100644 index 1f016521..00000000 --- a/vendor/league/flysystem/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/flysystem/composer.json b/vendor/league/flysystem/composer.json deleted file mode 100644 index 16691ccc..00000000 --- a/vendor/league/flysystem/composer.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "league/flysystem", - "description": "File storage abstraction for PHP", - "keywords": [ - "filesystem", "filesystems", "files", "storage", "aws", - "s3", "ftp", "sftp", "webdav", "file", "cloud" - ], - "scripts": { - "phpstan": "vendor/bin/phpstan analyse -l 6 src" - }, - "type": "library", - "minimum-stability": "dev", - "prefer-stable": true, - "autoload": { - "psr-4": { - "League\\Flysystem\\": "src" - } - }, - "require": { - "php": "^8.0.2", - "league/mime-type-detection": "^1.0.0" - }, - "require-dev": { - "ext-zip": "*", - "ext-fileinfo": "*", - "ext-ftp": "*", - "microsoft/azure-storage-blob": "^1.1", - "phpunit/phpunit": "^9.5.11", - "phpstan/phpstan": "^0.12.26", - "phpseclib/phpseclib": "^3.0.14", - "aws/aws-sdk-php": "^3.198.1", - "composer/semver": "^3.0", - "friendsofphp/php-cs-fixer": "^3.5", - "google/cloud-storage": "^1.23", - "async-aws/s3": "^1.5", - "async-aws/simple-s3": "^1.1", - "sabre/dav": "^4.3.1" - }, - "conflict": { - "symfony/http-client": "<5.2", - "guzzlehttp/ringphp": "<1.1.1", - "guzzlehttp/guzzle": "<7.0", - "aws/aws-sdk-php": "3.209.31 || 3.210.0", - "phpseclib/phpseclib": "3.0.15" - }, - "license": "MIT", - "authors": [ - { - "name": "Frank de Jonge", - "email": "info@frankdejonge.nl" - } - ] -} diff --git a/vendor/league/flysystem/docker-compose.yml b/vendor/league/flysystem/docker-compose.yml deleted file mode 100644 index 9a0463ac..00000000 --- a/vendor/league/flysystem/docker-compose.yml +++ /dev/null @@ -1,77 +0,0 @@ ---- -version: "3" -services: - sabredav: - image: php:8.1-alpine3.15 - restart: always - volumes: - - ./:/var/www/html/ - ports: - - "4040:4040" - command: php -S 0.0.0.0:4040 /var/www/html/src/WebDAV/resources/server.php - webdav: - image: bytemark/webdav - restart: always - ports: - - "4080:80" - environment: - AUTH_TYPE: Digest - USERNAME: alice - PASSWORD: secret1234 - ANONYMOUS_METHODS: 'GET,OPTIONS' - 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" - sftp_eddsa_only: - container_name: sftp_eddsa_only - restart: always - image: atmoz/sftp - volumes: - - ./test_files/sftp/users.conf:/etc/sftp/users.conf - - ./test_files/sftp/sshd_custom_configs.sh:/etc/sftp.d/sshd_custom_configs.sh - - ./test_files/sftp/ssh_host_ed25519_key:/etc/ssh/ssh_host_ed25519_key - ports: - - "2223: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 4cfd76db..00000000 --- a/vendor/league/flysystem/readme.md +++ /dev/null @@ -1,54 +0,0 @@ -# League\Flysystem - -[![Author](https://img.shields.io/badge/author-@frankdejonge-blue.svg)](https://twitter.com/frankdejonge) -[![Source Code](https://img.shields.io/badge/source-thephpleague/flysystem-blue.svg)](https://github.com/thephpleague/flysystem) -[![Latest Version](https://img.shields.io/github/tag/thephpleague/flysystem.svg)](https://github.com/thephpleague/flysystem/releases) -[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://github.com/thephpleague/flysystem/blob/master/LICENSE) -[![Quality Assurance](https://github.com/thephpleague/flysystem/workflows/Quality%20Assurance/badge.svg?branch=2.x)](https://github.com/thephpleague/flysystem/actions?query=workflow%3A%22Quality+Assurance%22) -[![Total Downloads](https://img.shields.io/packagist/dt/league/flysystem.svg)](https://packagist.org/packages/league/flysystem) -![php 7.2+](https://img.shields.io/badge/php-min%208.0.2-red.svg) - -## 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 V3](https://flysystem.thephpleague.com/docs/what-is-new/)**: What is new in Flysystem V2/V3? -* **[Architecture](https://flysystem.thephpleague.com/docs/architecture/)**: Flysystem's internal architecture -* **[Flysystem API](https://flysystem.thephpleague.com/docs/usage/filesystem-api/)**: How to interact with your Flysystem instance -* **[Upgrade from 1x](https://flysystem.thephpleague.com/docs/upgrade-from-1.x/)**: How to upgrade from 1.x/2.x - -### Officially supported adapters - -* **[Local](https://flysystem.thephpleague.com/docs/adapter/local/)** -* **[FTP](https://flysystem.thephpleague.com/docs/adapter/ftp/)** -* **[SFTP](https://flysystem.thephpleague.com/docs/adapter/sftp-v3/)** -* **[Memory](https://flysystem.thephpleague.com/docs/adapter/in-memory/)** -* **[AWS S3](https://flysystem.thephpleague.com/docs/adapter/aws-s3-v3/)** -* **[AsyncAws S3](https://flysystem.thephpleague.com/docs/adapter/async-aws-s3/)** -* **[Google Cloud Storage](https://flysystem.thephpleague.com/docs/adapter/google-cloud-storage/)** -* **[Azure Blob Storage](https://flysystem.thephpleague.com/docs/adapter/azure-blob-storage/)** -* **[WebDAV](https://flysystem.thephpleague.com/docs/adapter/webdav/)** - -### Third party Adapters - -* **[Gitlab](https://github.com/RoyVoetman/flysystem-gitlab-storage)** -* **[Google Drive (using regular paths)](https://github.com/masbug/flysystem-google-drive-ext)** -* **[bunny.net / BunnyCDN](https://github.com/PlatformCommunity/flysystem-bunnycdn/tree/v3)** -* **[Sharepoint 365 / One Drive (Using MS Graph)](https://github.com/shitware-ltd/flysystem-msgraph)** -* **[OneDrive](https://github.com/doerffler/flysystem-onedrive)** -* **[Dropbox](https://github.com/spatie/flysystem-dropbox)** - -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/CalculateChecksumFromStream.php b/vendor/league/flysystem/src/CalculateChecksumFromStream.php deleted file mode 100644 index 61b1fa11..00000000 --- a/vendor/league/flysystem/src/CalculateChecksumFromStream.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php -declare(strict_types=1); - -namespace League\Flysystem; - -use function hash_final; -use function hash_init; -use function hash_update_stream; - -trait CalculateChecksumFromStream -{ - private function calculateChecksumFromStream(string $path, Config $config): string - { - try { - $stream = $this->readStream($path); - $algo = (string) $config->get('checksum_algo', 'md5'); - $context = hash_init($algo); - hash_update_stream($context, $stream); - - return hash_final($context); - } catch (FilesystemException $exception) { - throw new UnableToProvideChecksum($exception->getMessage(), $path, $exception); - } - } - - /** - * @return resource - */ - abstract public function readStream(string $path); -} diff --git a/vendor/league/flysystem/src/ChecksumAlgoIsNotSupported.php b/vendor/league/flysystem/src/ChecksumAlgoIsNotSupported.php deleted file mode 100644 index 5d33c0cf..00000000 --- a/vendor/league/flysystem/src/ChecksumAlgoIsNotSupported.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php -declare(strict_types=1); - -namespace League\Flysystem; - -use InvalidArgumentException; - -final class ChecksumAlgoIsNotSupported extends InvalidArgumentException -{ - -} diff --git a/vendor/league/flysystem/src/ChecksumProvider.php b/vendor/league/flysystem/src/ChecksumProvider.php deleted file mode 100644 index f14ab006..00000000 --- a/vendor/league/flysystem/src/ChecksumProvider.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -namespace League\Flysystem; - -interface ChecksumProvider -{ - /** - * @return string MD5 hash of the file contents - * - * @throws UnableToProvideChecksum - * @throws ChecksumAlgoIsNotSupported - */ - public function checksum(string $path, Config $config): string; -} diff --git a/vendor/league/flysystem/src/Config.php b/vendor/league/flysystem/src/Config.php deleted file mode 100644 index ace07099..00000000 --- a/vendor/league/flysystem/src/Config.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -use function array_merge; - -class Config -{ - public const OPTION_VISIBILITY = 'visibility'; - public const OPTION_DIRECTORY_VISIBILITY = 'directory_visibility'; - - public function __construct(private array $options = []) - { - } - - /** - * @param mixed $default - * - * @return mixed - */ - public function get(string $property, $default = null) - { - return $this->options[$property] ?? $default; - } - - public function extend(array $options): Config - { - return new Config(array_merge($this->options, $options)); - } - - public function withDefaults(array $defaults): Config - { - return new Config($this->options + $defaults); - } -} diff --git a/vendor/league/flysystem/src/CorruptedPathDetected.php b/vendor/league/flysystem/src/CorruptedPathDetected.php deleted file mode 100644 index 70631ccc..00000000 --- a/vendor/league/flysystem/src/CorruptedPathDetected.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php - -namespace League\Flysystem; - -use RuntimeException; - -final class CorruptedPathDetected extends RuntimeException implements FilesystemException -{ - public static function forPath(string $path): CorruptedPathDetected - { - return new CorruptedPathDetected("Corrupted path detected: " . $path); - } -} diff --git a/vendor/league/flysystem/src/DirectoryAttributes.php b/vendor/league/flysystem/src/DirectoryAttributes.php deleted file mode 100644 index 7841b3cc..00000000 --- a/vendor/league/flysystem/src/DirectoryAttributes.php +++ /dev/null @@ -1,87 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -class DirectoryAttributes implements StorageAttributes -{ - use ProxyArrayAccessToProperties; - private string $type = StorageAttributes::TYPE_DIRECTORY; - - public function __construct( - private string $path, - private ?string $visibility = null, - private ?int $lastModified = null, - private array $extraMetadata = []) - { - $this->path = trim($this->path, '/'); - } - - public function path(): string - { - return $this->path; - } - - public function type(): string - { - return $this->type; - } - - 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): self - { - $clone = clone $this; - $clone->path = $path; - - return $clone; - } - - public static function fromArray(array $attributes): self - { - 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 ab73a546..00000000 --- a/vendor/league/flysystem/src/DirectoryListing.php +++ /dev/null @@ -1,78 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -use ArrayIterator; -use Generator; -use IteratorAggregate; -use Traversable; - -/** - * @template T - */ -class DirectoryListing implements IteratorAggregate -{ - /** - * @param iterable<T> $listing - */ - public function __construct(private iterable $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<T> - */ - 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/FileAttributes.php b/vendor/league/flysystem/src/FileAttributes.php deleted file mode 100644 index 42172f8c..00000000 --- a/vendor/league/flysystem/src/FileAttributes.php +++ /dev/null @@ -1,100 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -class FileAttributes implements StorageAttributes -{ - use ProxyArrayAccessToProperties; - private string $type = StorageAttributes::TYPE_FILE; - - public function __construct( - private string $path, - private ?int $fileSize = null, - private ?string $visibility = null, - private ?int $lastModified = null, - private ?string $mimeType = null, - private array $extraMetadata = [] - ) { - $this->path = ltrim($this->path, '/'); - } - - 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): self - { - $clone = clone $this; - $clone->path = $path; - - return $clone; - } - - public static function fromArray(array $attributes): self - { - 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/Filesystem.php b/vendor/league/flysystem/src/Filesystem.php deleted file mode 100644 index 94fae15e..00000000 --- a/vendor/league/flysystem/src/Filesystem.php +++ /dev/null @@ -1,239 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -use DateTimeInterface; -use Generator; -use League\Flysystem\UrlGeneration\ShardedPrefixPublicUrlGenerator; -use League\Flysystem\UrlGeneration\PrefixPublicUrlGenerator; -use League\Flysystem\UrlGeneration\PublicUrlGenerator; -use League\Flysystem\UrlGeneration\TemporaryUrlGenerator; -use Throwable; - -use function is_array; - -class Filesystem implements FilesystemOperator -{ - use CalculateChecksumFromStream; - - private Config $config; - private PathNormalizer $pathNormalizer; - - public function __construct( - private FilesystemAdapter $adapter, - array $config = [], - PathNormalizer $pathNormalizer = null, - private ?PublicUrlGenerator $publicUrlGenerator = null, - private ?TemporaryUrlGenerator $temporaryUrlGenerator = null, - ) { - $this->config = new Config($config); - $this->pathNormalizer = $pathNormalizer ?: new WhitespacePathNormalizer(); - } - - public function fileExists(string $location): bool - { - return $this->adapter->fileExists($this->pathNormalizer->normalizePath($location)); - } - - public function directoryExists(string $location): bool - { - return $this->adapter->directoryExists($this->pathNormalizer->normalizePath($location)); - } - - public function has(string $location): bool - { - $path = $this->pathNormalizer->normalizePath($location); - - return $this->adapter->fileExists($path) || $this->adapter->directoryExists($path); - } - - public function write(string $location, string $contents, array $config = []): void - { - $this->adapter->write( - $this->pathNormalizer->normalizePath($location), - $contents, - $this->config->extend($config) - ); - } - - public function writeStream(string $location, $contents, array $config = []): void - { - /* @var resource $contents */ - $this->assertIsResource($contents); - $this->rewindStream($contents); - $this->adapter->writeStream( - $this->pathNormalizer->normalizePath($location), - $contents, - $this->config->extend($config) - ); - } - - public function read(string $location): string - { - return $this->adapter->read($this->pathNormalizer->normalizePath($location)); - } - - public function readStream(string $location) - { - return $this->adapter->readStream($this->pathNormalizer->normalizePath($location)); - } - - public function delete(string $location): void - { - $this->adapter->delete($this->pathNormalizer->normalizePath($location)); - } - - public function deleteDirectory(string $location): void - { - $this->adapter->deleteDirectory($this->pathNormalizer->normalizePath($location)); - } - - public function createDirectory(string $location, array $config = []): void - { - $this->adapter->createDirectory( - $this->pathNormalizer->normalizePath($location), - $this->config->extend($config) - ); - } - - public function listContents(string $location, bool $deep = self::LIST_SHALLOW): DirectoryListing - { - $path = $this->pathNormalizer->normalizePath($location); - $listing = $this->adapter->listContents($path, $deep); - - return new DirectoryListing($this->pipeListing($location, $deep, $listing)); - } - - private function pipeListing(string $location, bool $deep, iterable $listing): Generator - { - try { - foreach ($listing as $item) { - yield $item; - } - } catch (Throwable $exception) { - throw UnableToListContents::atLocation($location, $deep, $exception); - } - } - - public function move(string $source, string $destination, array $config = []): void - { - $this->adapter->move( - $this->pathNormalizer->normalizePath($source), - $this->pathNormalizer->normalizePath($destination), - $this->config->extend($config) - ); - } - - public function copy(string $source, string $destination, array $config = []): void - { - $this->adapter->copy( - $this->pathNormalizer->normalizePath($source), - $this->pathNormalizer->normalizePath($destination), - $this->config->extend($config) - ); - } - - public function lastModified(string $path): int - { - return $this->adapter->lastModified($this->pathNormalizer->normalizePath($path))->lastModified(); - } - - public function fileSize(string $path): int - { - return $this->adapter->fileSize($this->pathNormalizer->normalizePath($path))->fileSize(); - } - - public function mimeType(string $path): string - { - return $this->adapter->mimeType($this->pathNormalizer->normalizePath($path))->mimeType(); - } - - public function setVisibility(string $path, string $visibility): void - { - $this->adapter->setVisibility($this->pathNormalizer->normalizePath($path), $visibility); - } - - public function visibility(string $path): string - { - return $this->adapter->visibility($this->pathNormalizer->normalizePath($path))->visibility(); - } - - public function publicUrl(string $path, array $config = []): string - { - $this->publicUrlGenerator ??= $this->resolvePublicUrlGenerator() - ?: throw UnableToGeneratePublicUrl::noGeneratorConfigured($path); - $config = $this->config->extend($config); - - return $this->publicUrlGenerator->publicUrl($path, $config); - } - - public function temporaryUrl(string $path, DateTimeInterface $expiresAt, array $config = []): string - { - $generator = $this->temporaryUrlGenerator ?: $this->adapter; - - if ($generator instanceof TemporaryUrlGenerator) { - return $generator->temporaryUrl($path, $expiresAt, $this->config->extend($config)); - } - - throw UnableToGenerateTemporaryUrl::noGeneratorConfigured($path); - } - - public function checksum(string $path, array $config = []): string - { - $config = $this->config->extend($config); - - if ( ! $this->adapter instanceof ChecksumProvider) { - return $this->calculateChecksumFromStream($path, $config); - } - - try { - return $this->adapter->checksum($path, $config); - } catch (ChecksumAlgoIsNotSupported) { - return $this->calculateChecksumFromStream($path, $config); - } - } - - private function resolvePublicUrlGenerator(): ?PublicUrlGenerator - { - if ($publicUrl = $this->config->get('public_url')) { - return match (true) { - is_array($publicUrl) => new ShardedPrefixPublicUrlGenerator($publicUrl), - default => new PrefixPublicUrlGenerator($publicUrl), - }; - } - - if ($this->adapter instanceof PublicUrlGenerator) { - return $this->adapter; - } - - return null; - } - - /** - * @param mixed $contents - */ - private function assertIsResource($contents): void - { - if (is_resource($contents) === false) { - throw new InvalidStreamProvided( - "Invalid stream provided, expected stream resource, received " . gettype($contents) - ); - } elseif ($type = get_resource_type($contents) !== 'stream') { - throw new InvalidStreamProvided( - "Invalid stream provided, expected stream resource, received resource of type " . $type - ); - } - } - - /** - * @param resource $resource - */ - private function rewindStream($resource): void - { - if (ftell($resource) !== 0 && stream_get_meta_data($resource)['seekable']) { - rewind($resource); - } - } -} diff --git a/vendor/league/flysystem/src/FilesystemAdapter.php b/vendor/league/flysystem/src/FilesystemAdapter.php deleted file mode 100644 index 714309f3..00000000 --- a/vendor/league/flysystem/src/FilesystemAdapter.php +++ /dev/null @@ -1,115 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -interface FilesystemAdapter -{ - /** - * @throws FilesystemException - * @throws UnableToCheckExistence - */ - public function fileExists(string $path): bool; - - /** - * @throws FilesystemException - * @throws UnableToCheckExistence - */ - public function directoryExists(string $path): bool; - - /** - * @throws UnableToWriteFile - * @throws FilesystemException - */ - public function write(string $path, string $contents, Config $config): void; - - /** - * @param resource $contents - * - * @throws UnableToWriteFile - * @throws FilesystemException - */ - public function writeStream(string $path, $contents, Config $config): void; - - /** - * @throws UnableToReadFile - * @throws FilesystemException - */ - public function read(string $path): string; - - /** - * @return resource - * - * @throws UnableToReadFile - * @throws FilesystemException - */ - public function readStream(string $path); - - /** - * @throws UnableToDeleteFile - * @throws FilesystemException - */ - public function delete(string $path): void; - - /** - * @throws UnableToDeleteDirectory - * @throws FilesystemException - */ - public function deleteDirectory(string $path): void; - - /** - * @throws UnableToCreateDirectory - * @throws FilesystemException - */ - public function createDirectory(string $path, Config $config): void; - - /** - * @throws InvalidVisibilityProvided - * @throws FilesystemException - */ - public function setVisibility(string $path, string $visibility): void; - - /** - * @throws UnableToRetrieveMetadata - * @throws FilesystemException - */ - public function visibility(string $path): FileAttributes; - - /** - * @throws UnableToRetrieveMetadata - * @throws FilesystemException - */ - public function mimeType(string $path): FileAttributes; - - /** - * @throws UnableToRetrieveMetadata - * @throws FilesystemException - */ - public function lastModified(string $path): FileAttributes; - - /** - * @throws UnableToRetrieveMetadata - * @throws FilesystemException - */ - public function fileSize(string $path): FileAttributes; - - /** - * @return iterable<StorageAttributes> - * - * @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 f9d60185..00000000 --- a/vendor/league/flysystem/src/FilesystemException.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -use Throwable; - -interface FilesystemException extends Throwable -{ -} diff --git a/vendor/league/flysystem/src/FilesystemOperationFailed.php b/vendor/league/flysystem/src/FilesystemOperationFailed.php deleted file mode 100644 index 27c726b1..00000000 --- a/vendor/league/flysystem/src/FilesystemOperationFailed.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -interface FilesystemOperationFailed extends FilesystemException -{ - public const OPERATION_WRITE = 'WRITE'; - public const OPERATION_UPDATE = 'UPDATE'; // not used - public const OPERATION_EXISTENCE_CHECK = 'EXISTENCE_CHECK'; - public const OPERATION_DIRECTORY_EXISTS = 'DIRECTORY_EXISTS'; - public const OPERATION_FILE_EXISTS = 'FILE_EXISTS'; - public const OPERATION_CREATE_DIRECTORY = 'CREATE_DIRECTORY'; - public const OPERATION_DELETE = 'DELETE'; - public const OPERATION_DELETE_DIRECTORY = 'DELETE_DIRECTORY'; - public const OPERATION_MOVE = 'MOVE'; - public const OPERATION_RETRIEVE_METADATA = 'RETRIEVE_METADATA'; - public const OPERATION_COPY = 'COPY'; - public const OPERATION_READ = 'READ'; - public const OPERATION_SET_VISIBILITY = 'SET_VISIBILITY'; - public const OPERATION_LIST_CONTENTS = 'LIST_CONTENTS'; - - public function operation(): string; -} diff --git a/vendor/league/flysystem/src/FilesystemOperator.php b/vendor/league/flysystem/src/FilesystemOperator.php deleted file mode 100644 index b7f7bd46..00000000 --- a/vendor/league/flysystem/src/FilesystemOperator.php +++ /dev/null @@ -1,9 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -interface FilesystemOperator extends FilesystemReader, FilesystemWriter -{ -} diff --git a/vendor/league/flysystem/src/FilesystemReader.php b/vendor/league/flysystem/src/FilesystemReader.php deleted file mode 100644 index 9e4acacf..00000000 --- a/vendor/league/flysystem/src/FilesystemReader.php +++ /dev/null @@ -1,85 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -use DateTimeInterface; - -/** - * This interface contains everything to read from and inspect - * a filesystem. All methods containing are non-destructive. - * - * @method string publicUrl(string $path, array $config = []) Will be added in 4.0 - * @method string temporaryUrl(string $path, DateTimeInterface $expiresAt, array $config = []) Will be added in 4.0 - * @method string checksum(string $path, array $config = []) Will be added in 4.0 - */ -interface FilesystemReader -{ - public const LIST_SHALLOW = false; - public const LIST_DEEP = true; - - /** - * @throws FilesystemException - * @throws UnableToCheckExistence - */ - public function fileExists(string $location): bool; - - /** - * @throws FilesystemException - * @throws UnableToCheckExistence - */ - public function directoryExists(string $location): bool; - - /** - * @throws FilesystemException - * @throws UnableToCheckExistence - */ - public function has(string $location): bool; - - /** - * @throws UnableToReadFile - * @throws FilesystemException - */ - public function read(string $location): string; - - /** - * @return resource - * - * @throws UnableToReadFile - * @throws FilesystemException - */ - public function readStream(string $location); - - /** - * @return DirectoryListing<StorageAttributes> - * - * @throws FilesystemException - * @throws UnableToListContents - */ - 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 a24bb0fc..00000000 --- a/vendor/league/flysystem/src/FilesystemWriter.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -interface FilesystemWriter -{ - /** - * @throws UnableToWriteFile - * @throws FilesystemException - */ - public function write(string $location, string $contents, array $config = []): void; - - /** - * @param mixed $contents - * - * @throws UnableToWriteFile - * @throws FilesystemException - */ - public function writeStream(string $location, $contents, array $config = []): void; - - /** - * @throws UnableToSetVisibility - * @throws FilesystemException - */ - public function setVisibility(string $path, string $visibility): void; - - /** - * @throws UnableToDeleteFile - * @throws FilesystemException - */ - public function delete(string $location): void; - - /** - * @throws UnableToDeleteDirectory - * @throws FilesystemException - */ - public function deleteDirectory(string $location): void; - - /** - * @throws UnableToCreateDirectory - * @throws FilesystemException - */ - public function createDirectory(string $location, array $config = []): void; - - /** - * @throws UnableToMoveFile - * @throws FilesystemException - */ - public function move(string $source, string $destination, array $config = []): void; - - /** - * @throws UnableToCopyFile - * @throws FilesystemException - */ - public function copy(string $source, string $destination, array $config = []): void; -} diff --git a/vendor/league/flysystem/src/InvalidStreamProvided.php b/vendor/league/flysystem/src/InvalidStreamProvided.php deleted file mode 100644 index f57b2c74..00000000 --- a/vendor/league/flysystem/src/InvalidStreamProvided.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -use InvalidArgumentException as BaseInvalidArgumentException; - -class InvalidStreamProvided extends BaseInvalidArgumentException implements FilesystemException -{ -} diff --git a/vendor/league/flysystem/src/InvalidVisibilityProvided.php b/vendor/league/flysystem/src/InvalidVisibilityProvided.php deleted file mode 100644 index ddc1909d..00000000 --- a/vendor/league/flysystem/src/InvalidVisibilityProvided.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -use InvalidArgumentException; - -use function var_export; - -class InvalidVisibilityProvided extends InvalidArgumentException implements FilesystemException -{ - public static function withVisibility(string $visibility, string $expectedMessage): InvalidVisibilityProvided - { - $provided = var_export($visibility, true); - $message = "Invalid visibility provided. Expected {$expectedMessage}, received {$provided}"; - - throw new InvalidVisibilityProvided($message); - } -} diff --git a/vendor/league/flysystem/src/Local/FallbackMimeTypeDetector.php b/vendor/league/flysystem/src/Local/FallbackMimeTypeDetector.php deleted file mode 100644 index 97b0ddc8..00000000 --- a/vendor/league/flysystem/src/Local/FallbackMimeTypeDetector.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem\Local; - -use League\MimeTypeDetection\MimeTypeDetector; - -use function in_array; - -class FallbackMimeTypeDetector implements MimeTypeDetector -{ - private const INCONCLUSIVE_MIME_TYPES = [ - 'application/x-empty', - 'text/plain', - 'text/x-asm', - 'application/octet-stream', - 'inode/x-empty', - ]; - - public function __construct( - private MimeTypeDetector $detector, - private array $inconclusiveMimetypes = self::INCONCLUSIVE_MIME_TYPES - ) {} - - public function detectMimeType(string $path, $contents): ?string - { - return $this->detector->detectMimeType($path, $contents); - } - - public function detectMimeTypeFromBuffer(string $contents): ?string - { - return $this->detector->detectMimeTypeFromBuffer($contents); - } - - public function detectMimeTypeFromPath(string $path): ?string - { - return $this->detector->detectMimeTypeFromPath($path); - } - - public function detectMimeTypeFromFile(string $path): ?string - { - $mimeType = $this->detector->detectMimeTypeFromFile($path); - - if ($mimeType !== null && ! in_array($mimeType, $this->inconclusiveMimetypes)) { - return $mimeType; - } - - return $this->detector->detectMimeTypeFromPath($path); - } -} diff --git a/vendor/league/flysystem/src/Local/LocalFilesystemAdapter.php b/vendor/league/flysystem/src/Local/LocalFilesystemAdapter.php deleted file mode 100644 index 78fcdc52..00000000 --- a/vendor/league/flysystem/src/Local/LocalFilesystemAdapter.php +++ /dev/null @@ -1,454 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem\Local; - -use DirectoryIterator; -use FilesystemIterator; -use Generator; -use League\Flysystem\ChecksumProvider; -use League\Flysystem\Config; -use League\Flysystem\DirectoryAttributes; -use League\Flysystem\FileAttributes; -use League\Flysystem\FilesystemAdapter; -use League\Flysystem\PathPrefixer; -use League\Flysystem\SymbolicLinkEncountered; -use League\Flysystem\UnableToCopyFile; -use League\Flysystem\UnableToCreateDirectory; -use League\Flysystem\UnableToDeleteDirectory; -use League\Flysystem\UnableToDeleteFile; -use League\Flysystem\UnableToMoveFile; -use League\Flysystem\UnableToProvideChecksum; -use League\Flysystem\UnableToReadFile; -use League\Flysystem\UnableToRetrieveMetadata; -use League\Flysystem\UnableToSetVisibility; -use League\Flysystem\UnableToWriteFile; -use League\Flysystem\UnixVisibility\PortableVisibilityConverter; -use League\Flysystem\UnixVisibility\VisibilityConverter; -use League\MimeTypeDetection\FinfoMimeTypeDetector; -use League\MimeTypeDetection\MimeTypeDetector; -use RecursiveDirectoryIterator; -use RecursiveIteratorIterator; -use SplFileInfo; -use function chmod; -use function clearstatcache; -use function dirname; -use function error_clear_last; -use function error_get_last; -use function file_exists; -use function file_put_contents; -use function hash_file; -use function is_dir; -use function is_file; -use function mkdir; -use function rename; -use const DIRECTORY_SEPARATOR; -use const LOCK_EX; - -class LocalFilesystemAdapter implements FilesystemAdapter, ChecksumProvider -{ - /** - * @var int - */ - public const SKIP_LINKS = 0001; - - /** - * @var int - */ - public const DISALLOW_LINKS = 0002; - - private PathPrefixer $prefixer; - private VisibilityConverter $visibility; - private MimeTypeDetector $mimeTypeDetector; - private string $rootLocation; - - /** - * @var bool - */ - private $rootLocationIsSetup = false; - - public function __construct( - string $location, - VisibilityConverter $visibility = null, - private int $writeFlags = LOCK_EX, - private int $linkHandling = self::DISALLOW_LINKS, - MimeTypeDetector $mimeTypeDetector = null, - bool $lazyRootCreation = false, - ) { - $this->prefixer = new PathPrefixer($location, DIRECTORY_SEPARATOR); - $visibility ??= new PortableVisibilityConverter(); - $this->visibility = $visibility; - $this->rootLocation = $location; - $this->mimeTypeDetector = $mimeTypeDetector ?: new FallbackMimeTypeDetector(new FinfoMimeTypeDetector()); - - if ( ! $lazyRootCreation) { - $this->ensureRootDirectoryExists(); - } - } - - private function ensureRootDirectoryExists(): void - { - if ($this->rootLocationIsSetup) { - return; - } - - $this->ensureDirectoryExists($this->rootLocation, $this->visibility->defaultForDirectories()); - } - - 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->ensureRootDirectoryExists(); - $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 { - if ( ! is_dir($path)) { - return; - } - - 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(str_replace('\\', '/', $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->ensureRootDirectoryExists(); - $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->ensureRootDirectoryExists(); - $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 directoryExists(string $location): bool - { - $location = $this->prefixer->prefixPath($location); - - return is_dir($location); - } - - public function createDirectory(string $path, Config $config): void - { - $this->ensureRootDirectoryExists(); - $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(); - - if ( ! is_file($location)) { - throw UnableToRetrieveMetadata::mimeType($location, 'No such file exists.'); - } - - $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'] ?? ''); - } - - public function checksum(string $path, Config $config): string - { - $algo = $config->get('checksum_algo', 'md5'); - $location = $this->prefixer->prefixPath($path); - error_clear_last(); - $checksum = @hash_file($algo, $location); - - if ($checksum === false) { - throw new UnableToProvideChecksum(error_get_last()['message'] ?? '', $path); - } - - return $checksum; - } - - 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 4f4ad551..00000000 --- a/vendor/league/flysystem/src/MountManager.php +++ /dev/null @@ -1,398 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -use DateTimeInterface; -use Throwable; - -use function method_exists; -use function sprintf; - -class MountManager implements FilesystemOperator -{ - /** - * @var array<string, FilesystemOperator> - */ - private $filesystems = []; - - /** - * MountManager constructor. - * - * @param array<string,FilesystemOperator> $filesystems - */ - public function __construct(array $filesystems = []) - { - $this->mountFilesystems($filesystems); - } - - public function fileExists(string $location): bool - { - /** @var FilesystemOperator $filesystem */ - [$filesystem, $path] = $this->determineFilesystemAndPath($location); - - try { - return $filesystem->fileExists($path); - } catch (Throwable $exception) { - throw UnableToCheckFileExistence::forLocation($location, $exception); - } - } - - public function has(string $location): bool - { - /** @var FilesystemOperator $filesystem */ - [$filesystem, $path] = $this->determineFilesystemAndPath($location); - - try { - return $filesystem->fileExists($path) || $filesystem->directoryExists($path); - } catch (Throwable $exception) { - throw UnableToCheckExistence::forLocation($location, $exception); - } - } - - public function directoryExists(string $location): bool - { - /** @var FilesystemOperator $filesystem */ - [$filesystem, $path] = $this->determineFilesystemAndPath($location); - - try { - return $filesystem->directoryExists($path); - } catch (Throwable $exception) { - throw UnableToCheckDirectoryExistence::forLocation($location, $exception); - } - } - - public function read(string $location): string - { - /** @var FilesystemOperator $filesystem */ - [$filesystem, $path] = $this->determineFilesystemAndPath($location); - - try { - return $filesystem->read($path); - } catch (UnableToReadFile $exception) { - throw UnableToReadFile::fromLocation($location, $exception->reason(), $exception); - } - } - - public function readStream(string $location) - { - /** @var FilesystemOperator $filesystem */ - [$filesystem, $path] = $this->determineFilesystemAndPath($location); - - try { - return $filesystem->readStream($path); - } catch (UnableToReadFile $exception) { - throw UnableToReadFile::fromLocation($location, $exception->reason(), $exception); - } - } - - public function listContents(string $location, bool $deep = self::LIST_SHALLOW): DirectoryListing - { - /** @var FilesystemOperator $filesystem */ - [$filesystem, $path, $mountIdentifier] = $this->determineFilesystemAndPath($location); - - return - $filesystem - ->listContents($path, $deep) - ->map( - function (StorageAttributes $attributes) use ($mountIdentifier) { - return $attributes->withPath(sprintf('%s://%s', $mountIdentifier, $attributes->path())); - } - ); - } - - public function lastModified(string $location): int - { - /** @var FilesystemOperator $filesystem */ - [$filesystem, $path] = $this->determineFilesystemAndPath($location); - - try { - return $filesystem->lastModified($path); - } catch (UnableToRetrieveMetadata $exception) { - throw UnableToRetrieveMetadata::lastModified($location, $exception->reason(), $exception); - } - } - - public function fileSize(string $location): int - { - /** @var FilesystemOperator $filesystem */ - [$filesystem, $path] = $this->determineFilesystemAndPath($location); - - try { - return $filesystem->fileSize($path); - } catch (UnableToRetrieveMetadata $exception) { - throw UnableToRetrieveMetadata::fileSize($location, $exception->reason(), $exception); - } - } - - public function mimeType(string $location): string - { - /** @var FilesystemOperator $filesystem */ - [$filesystem, $path] = $this->determineFilesystemAndPath($location); - - try { - return $filesystem->mimeType($path); - } catch (UnableToRetrieveMetadata $exception) { - throw UnableToRetrieveMetadata::mimeType($location, $exception->reason(), $exception); - } - } - - public function visibility(string $location): string - { - /** @var FilesystemOperator $filesystem */ - [$filesystem, $path] = $this->determineFilesystemAndPath($location); - - try { - return $filesystem->visibility($path); - } catch (UnableToRetrieveMetadata $exception) { - throw UnableToRetrieveMetadata::visibility($location, $exception->reason(), $exception); - } - } - - public function write(string $location, string $contents, array $config = []): void - { - /** @var FilesystemOperator $filesystem */ - [$filesystem, $path] = $this->determineFilesystemAndPath($location); - - try { - $filesystem->write($path, $contents, $config); - } catch (UnableToWriteFile $exception) { - throw UnableToWriteFile::atLocation($location, $exception->reason(), $exception); - } - } - - public function writeStream(string $location, $contents, array $config = []): void - { - /** @var FilesystemOperator $filesystem */ - [$filesystem, $path] = $this->determineFilesystemAndPath($location); - $filesystem->writeStream($path, $contents, $config); - } - - public function setVisibility(string $path, string $visibility): void - { - /** @var FilesystemOperator $filesystem */ - [$filesystem, $path] = $this->determineFilesystemAndPath($path); - $filesystem->setVisibility($path, $visibility); - } - - public function delete(string $location): void - { - /** @var FilesystemOperator $filesystem */ - [$filesystem, $path] = $this->determineFilesystemAndPath($location); - - try { - $filesystem->delete($path); - } catch (UnableToDeleteFile $exception) { - throw UnableToDeleteFile::atLocation($location, $exception->reason(), $exception); - } - } - - public function deleteDirectory(string $location): void - { - /** @var FilesystemOperator $filesystem */ - [$filesystem, $path] = $this->determineFilesystemAndPath($location); - - try { - $filesystem->deleteDirectory($path); - } catch (UnableToDeleteDirectory $exception) { - throw UnableToDeleteDirectory::atLocation($location, $exception->reason(), $exception); - } - } - - public function createDirectory(string $location, array $config = []): void - { - /** @var FilesystemOperator $filesystem */ - [$filesystem, $path] = $this->determineFilesystemAndPath($location); - - try { - $filesystem->createDirectory($path, $config); - } catch (UnableToCreateDirectory $exception) { - throw UnableToCreateDirectory::dueToFailure($location, $exception); - } - } - - public function move(string $source, string $destination, array $config = []): void - { - /** @var FilesystemOperator $sourceFilesystem */ - /* @var FilesystemOperator $destinationFilesystem */ - [$sourceFilesystem, $sourcePath] = $this->determineFilesystemAndPath($source); - [$destinationFilesystem, $destinationPath] = $this->determineFilesystemAndPath($destination); - - $sourceFilesystem === $destinationFilesystem ? $this->moveInTheSameFilesystem( - $sourceFilesystem, - $sourcePath, - $destinationPath, - $source, - $destination - ) : $this->moveAcrossFilesystems($source, $destination, $config); - } - - public function copy(string $source, string $destination, array $config = []): void - { - /** @var FilesystemOperator $sourceFilesystem */ - /* @var FilesystemOperator $destinationFilesystem */ - [$sourceFilesystem, $sourcePath] = $this->determineFilesystemAndPath($source); - [$destinationFilesystem, $destinationPath] = $this->determineFilesystemAndPath($destination); - - $sourceFilesystem === $destinationFilesystem ? $this->copyInSameFilesystem( - $sourceFilesystem, - $sourcePath, - $destinationPath, - $source, - $destination - ) : $this->copyAcrossFilesystem( - $config['visibility'] ?? null, - $sourceFilesystem, - $sourcePath, - $destinationFilesystem, - $destinationPath, - $source, - $destination - ); - } - - public function publicUrl(string $path, array $config = []): string - { - /** @var FilesystemOperator $filesystem */ - [$filesystem, $path] = $this->determineFilesystemAndPath($path); - - if ( ! method_exists($filesystem, 'publicUrl')) { - throw new UnableToGeneratePublicUrl(sprintf('%s does not support generating public urls.', $filesystem::class), $path); - } - - return $filesystem->publicUrl($path, $config); - } - - public function temporaryUrl(string $path, DateTimeInterface $expiresAt, array $config = []): string - { - /** @var FilesystemOperator $filesystem */ - [$filesystem, $path] = $this->determineFilesystemAndPath($path); - - if ( ! method_exists($filesystem, 'temporaryUrl')) { - throw new UnableToGenerateTemporaryUrl(sprintf('%s does not support generating public urls.', $filesystem::class), $path); - } - - return $filesystem->temporaryUrl($path, $expiresAt, $config); - } - - public function checksum(string $path, array $config = []): string - { - /** @var FilesystemOperator $filesystem */ - [$filesystem, $path] = $this->determineFilesystemAndPath($path); - - if ( ! method_exists($filesystem, 'checksum')) { - throw new UnableToProvideChecksum(sprintf('%s does not support providing checksums.', $filesystem::class), $path); - } - - return $filesystem->checksum($path, $config); - } - - private function mountFilesystems(array $filesystems): void - { - foreach ($filesystems as $key => $filesystem) { - $this->guardAgainstInvalidMount($key, $filesystem); - /* @var string $key */ - /* @var FilesystemOperator $filesystem */ - $this->mountFilesystem($key, $filesystem); - } - } - - /** - * @param mixed $key - * @param mixed $filesystem - */ - private function guardAgainstInvalidMount($key, $filesystem): void - { - if ( ! is_string($key)) { - throw UnableToMountFilesystem::becauseTheKeyIsNotValid($key); - } - - if ( ! $filesystem instanceof FilesystemOperator) { - throw UnableToMountFilesystem::becauseTheFilesystemWasNotValid($filesystem); - } - } - - private function mountFilesystem(string $key, FilesystemOperator $filesystem): void - { - $this->filesystems[$key] = $filesystem; - } - - /** - * @param string $path - * - * @return array{0:FilesystemOperator, 1:string} - */ - private function determineFilesystemAndPath(string $path): array - { - if (strpos($path, '://') < 1) { - throw UnableToResolveFilesystemMount::becauseTheSeparatorIsMissing($path); - } - - /** @var string $mountIdentifier */ - /** @var string $mountPath */ - [$mountIdentifier, $mountPath] = explode('://', $path, 2); - - if ( ! array_key_exists($mountIdentifier, $this->filesystems)) { - throw UnableToResolveFilesystemMount::becauseTheMountWasNotRegistered($mountIdentifier); - } - - return [$this->filesystems[$mountIdentifier], $mountPath, $mountIdentifier]; - } - - private function copyInSameFilesystem( - FilesystemOperator $sourceFilesystem, - string $sourcePath, - string $destinationPath, - string $source, - string $destination - ): void { - try { - $sourceFilesystem->copy($sourcePath, $destinationPath); - } catch (UnableToCopyFile $exception) { - throw UnableToCopyFile::fromLocationTo($source, $destination, $exception); - } - } - - private function copyAcrossFilesystem( - ?string $visibility, - FilesystemOperator $sourceFilesystem, - string $sourcePath, - FilesystemOperator $destinationFilesystem, - string $destinationPath, - string $source, - string $destination - ): void { - try { - $visibility = $visibility ?? $sourceFilesystem->visibility($sourcePath); - $stream = $sourceFilesystem->readStream($sourcePath); - $destinationFilesystem->writeStream($destinationPath, $stream, compact('visibility')); - } catch (UnableToRetrieveMetadata | UnableToReadFile | UnableToWriteFile $exception) { - throw UnableToCopyFile::fromLocationTo($source, $destination, $exception); - } - } - - private function moveInTheSameFilesystem( - FilesystemOperator $sourceFilesystem, - string $sourcePath, - string $destinationPath, - string $source, - string $destination - ): void { - try { - $sourceFilesystem->move($sourcePath, $destinationPath); - } catch (UnableToMoveFile $exception) { - throw UnableToMoveFile::fromLocationTo($source, $destination, $exception); - } - } - - private function moveAcrossFilesystems(string $source, string $destination, array $config = []): void - { - try { - $this->copy($source, $destination, $config); - $this->delete($source); - } catch (UnableToCopyFile | UnableToDeleteFile $exception) { - throw UnableToMoveFile::fromLocationTo($source, $destination, $exception); - } - } -} diff --git a/vendor/league/flysystem/src/PathNormalizer.php b/vendor/league/flysystem/src/PathNormalizer.php deleted file mode 100644 index 54da201a..00000000 --- a/vendor/league/flysystem/src/PathNormalizer.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -interface PathNormalizer -{ - public function normalizePath(string $path): string; -} diff --git a/vendor/league/flysystem/src/PathPrefixer.php b/vendor/league/flysystem/src/PathPrefixer.php deleted file mode 100644 index ca4f007f..00000000 --- a/vendor/league/flysystem/src/PathPrefixer.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -use function rtrim; -use function strlen; -use function substr; - -final class PathPrefixer -{ - private string $prefix = ''; - - public function __construct(string $prefix, private string $separator = '/') - { - $this->prefix = rtrim($prefix, '\\/'); - - if ($this->prefix !== '' || $prefix === $separator) { - $this->prefix .= $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 ($prefixedPath === '' || substr($prefixedPath, -1) === $this->separator) { - 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 fef3edf1..00000000 --- a/vendor/league/flysystem/src/PathTraversalDetected.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -use RuntimeException; - -class PathTraversalDetected extends RuntimeException implements FilesystemException -{ - private string $path; - - public function path(): string - { - return $this->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/PortableVisibilityGuard.php b/vendor/league/flysystem/src/PortableVisibilityGuard.php deleted file mode 100644 index 6e2498b4..00000000 --- a/vendor/league/flysystem/src/PortableVisibilityGuard.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -final class PortableVisibilityGuard -{ - public static function guardAgainstInvalidInput(string $visibility): void - { - if ($visibility !== Visibility::PUBLIC && $visibility !== Visibility::PRIVATE) { - $className = Visibility::class; - throw InvalidVisibilityProvided::withVisibility( - $visibility, - "either {$className}::PUBLIC or {$className}::PRIVATE" - ); - } - } -} diff --git a/vendor/league/flysystem/src/ProxyArrayAccessToProperties.php b/vendor/league/flysystem/src/ProxyArrayAccessToProperties.php deleted file mode 100644 index 956b3300..00000000 --- a/vendor/league/flysystem/src/ProxyArrayAccessToProperties.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -use RuntimeException; - -/** - * @internal - */ -trait ProxyArrayAccessToProperties -{ - private function formatPropertyName(string $offset): string - { - return str_replace('_', '', lcfirst(ucwords($offset, '_'))); - } - - /** - * @param mixed $offset - * - * @return bool - */ - public function offsetExists($offset): bool - { - $property = $this->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/StorageAttributes.php b/vendor/league/flysystem/src/StorageAttributes.php deleted file mode 100644 index 6be6235b..00000000 --- a/vendor/league/flysystem/src/StorageAttributes.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -use ArrayAccess; -use JsonSerializable; - -interface StorageAttributes extends JsonSerializable, ArrayAccess -{ - public const ATTRIBUTE_PATH = 'path'; - public const ATTRIBUTE_TYPE = 'type'; - public const ATTRIBUTE_FILE_SIZE = 'file_size'; - public const ATTRIBUTE_VISIBILITY = 'visibility'; - public const ATTRIBUTE_LAST_MODIFIED = 'last_modified'; - public const ATTRIBUTE_MIME_TYPE = 'mime_type'; - public const ATTRIBUTE_EXTRA_METADATA = 'extra_metadata'; - - public const TYPE_FILE = 'file'; - public const TYPE_DIRECTORY = 'dir'; - - public function path(): string; - - public function type(): string; - - public function visibility(): ?string; - - public function lastModified(): ?int; - - public static function fromArray(array $attributes): StorageAttributes; - - public function isFile(): bool; - - public function isDir(): bool; - - public function withPath(string $path): StorageAttributes; - - public function extraMetadata(): array; -} diff --git a/vendor/league/flysystem/src/SymbolicLinkEncountered.php b/vendor/league/flysystem/src/SymbolicLinkEncountered.php deleted file mode 100644 index e4e0a533..00000000 --- a/vendor/league/flysystem/src/SymbolicLinkEncountered.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -use RuntimeException; - -final class SymbolicLinkEncountered extends RuntimeException implements FilesystemException -{ - private string $location; - - public function location(): string - { - return $this->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/UnableToCheckDirectoryExistence.php b/vendor/league/flysystem/src/UnableToCheckDirectoryExistence.php deleted file mode 100644 index 73ce858b..00000000 --- a/vendor/league/flysystem/src/UnableToCheckDirectoryExistence.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -class UnableToCheckDirectoryExistence extends UnableToCheckExistence -{ - public function operation(): string - { - return FilesystemOperationFailed::OPERATION_DIRECTORY_EXISTS; - } -} diff --git a/vendor/league/flysystem/src/UnableToCheckExistence.php b/vendor/league/flysystem/src/UnableToCheckExistence.php deleted file mode 100644 index 52c2bd69..00000000 --- a/vendor/league/flysystem/src/UnableToCheckExistence.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -use RuntimeException; -use Throwable; - -class UnableToCheckExistence extends RuntimeException implements FilesystemOperationFailed -{ - final public function __construct(string $message = "", int $code = 0, ?Throwable $previous = null) - { - parent::__construct($message, $code, $previous); - } - - public static function forLocation(string $path, Throwable $exception = null): static - { - return new static("Unable to check existence for: {$path}", 0, $exception); - } - - public function operation(): string - { - return FilesystemOperationFailed::OPERATION_EXISTENCE_CHECK; - } -} diff --git a/vendor/league/flysystem/src/UnableToCheckFileExistence.php b/vendor/league/flysystem/src/UnableToCheckFileExistence.php deleted file mode 100644 index bc0536dc..00000000 --- a/vendor/league/flysystem/src/UnableToCheckFileExistence.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -class UnableToCheckFileExistence extends UnableToCheckExistence -{ - public function operation(): string - { - return FilesystemOperationFailed::OPERATION_FILE_EXISTS; - } -} diff --git a/vendor/league/flysystem/src/UnableToCopyFile.php b/vendor/league/flysystem/src/UnableToCopyFile.php deleted file mode 100644 index 2180c1e3..00000000 --- a/vendor/league/flysystem/src/UnableToCopyFile.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -use RuntimeException; -use Throwable; - -final class UnableToCopyFile extends RuntimeException implements FilesystemOperationFailed -{ - /** - * @var string - */ - private $source; - - /** - * @var string - */ - private $destination; - - public function source(): string - { - return $this->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 f4eead0c..00000000 --- a/vendor/league/flysystem/src/UnableToCreateDirectory.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -use RuntimeException; -use Throwable; - -final class UnableToCreateDirectory extends RuntimeException implements FilesystemOperationFailed -{ - private string $location; - private string $reason = ''; - - public static function atLocation(string $dirname, string $errorMessage = '', ?Throwable $previous = null): UnableToCreateDirectory - { - $message = "Unable to create a directory at {$dirname}. {$errorMessage}"; - $e = new static(rtrim($message), 0, $previous); - $e->location = $dirname; - $e->reason = $errorMessage; - - return $e; - } - - public static function dueToFailure(string $dirname, Throwable $previous): UnableToCreateDirectory - { - $reason = $previous instanceof UnableToCreateDirectory ? $previous->reason() : ''; - $message = "Unable to create a directory at $dirname. $reason"; - $e = new static(rtrim($message), 0, $previous); - $e->location = $dirname; - $e->reason = $reason ?: $message; - - return $e; - } - - public function operation(): string - { - return FilesystemOperationFailed::OPERATION_CREATE_DIRECTORY; - } - - public function reason(): string - { - return $this->reason; - } - - 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 eeeab24b..00000000 --- a/vendor/league/flysystem/src/UnableToDeleteDirectory.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -use RuntimeException; -use Throwable; - -final class UnableToDeleteDirectory extends RuntimeException implements FilesystemOperationFailed -{ - /** - * @var string - */ - private $location = ''; - - /** - * @var string - */ - private $reason; - - public static function atLocation( - string $location, - string $reason = '', - Throwable $previous = null - ): UnableToDeleteDirectory { - $e = new static(rtrim("Unable to delete directory located at: {$location}. {$reason}"), 0, $previous); - $e->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 18f7215c..00000000 --- a/vendor/league/flysystem/src/UnableToDeleteFile.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -use RuntimeException; -use Throwable; - -final class UnableToDeleteFile extends RuntimeException implements FilesystemOperationFailed -{ - /** - * @var string - */ - private $location = ''; - - /** - * @var string - */ - private $reason; - - public static function atLocation(string $location, string $reason = '', Throwable $previous = null): UnableToDeleteFile - { - $e = new static(rtrim("Unable to delete file located at: {$location}. {$reason}"), 0, $previous); - $e->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/UnableToGeneratePublicUrl.php b/vendor/league/flysystem/src/UnableToGeneratePublicUrl.php deleted file mode 100644 index e3648c75..00000000 --- a/vendor/league/flysystem/src/UnableToGeneratePublicUrl.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -use RuntimeException; -use Throwable; - -final class UnableToGeneratePublicUrl extends RuntimeException implements FilesystemException -{ - public function __construct(string $reason, string $path, ?Throwable $previous = null) - { - parent::__construct("Unable to generate public url for $path: $reason", 0, $previous); - } - - public static function dueToError(string $path, Throwable $exception): static - { - return new static($exception->getMessage(), $path, $exception); - } - - public static function noGeneratorConfigured(string $path, string $extraReason = ''): static - { - return new static('No generator was configured ' . $extraReason, $path); - } -} diff --git a/vendor/league/flysystem/src/UnableToGenerateTemporaryUrl.php b/vendor/league/flysystem/src/UnableToGenerateTemporaryUrl.php deleted file mode 100644 index 338601c7..00000000 --- a/vendor/league/flysystem/src/UnableToGenerateTemporaryUrl.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -use RuntimeException; -use Throwable; - -final class UnableToGenerateTemporaryUrl extends RuntimeException implements FilesystemException -{ - public function __construct(string $reason, string $path, ?Throwable $previous = null) - { - parent::__construct("Unable to generate temporary url for $path: $reason", 0, $previous); - } - - public static function dueToError(string $path, Throwable $exception): static - { - return new static($exception->getMessage(), $path, $exception); - } - - public static function noGeneratorConfigured(string $path, string $extraReason = ''): static - { - return new static('No generator was configured ' . $extraReason, $path); - } -} diff --git a/vendor/league/flysystem/src/UnableToListContents.php b/vendor/league/flysystem/src/UnableToListContents.php deleted file mode 100644 index 4f7961dd..00000000 --- a/vendor/league/flysystem/src/UnableToListContents.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -use RuntimeException; -use Throwable; - -final class UnableToListContents extends RuntimeException implements FilesystemOperationFailed -{ - public static function atLocation(string $location, bool $deep, Throwable $previous): UnableToListContents - { - $message = "Unable to list contents for '$location', " . ($deep ? 'deep' : 'shallow') . " listing\n\n" - . 'Reason: ' . $previous->getMessage(); - - return new UnableToListContents($message, 0, $previous); - } - - public function operation(): string - { - return self::OPERATION_LIST_CONTENTS; - } -} diff --git a/vendor/league/flysystem/src/UnableToMountFilesystem.php b/vendor/league/flysystem/src/UnableToMountFilesystem.php deleted file mode 100644 index bd41bc98..00000000 --- a/vendor/league/flysystem/src/UnableToMountFilesystem.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -use LogicException; - -class UnableToMountFilesystem extends LogicException implements FilesystemException -{ - /** - * @param mixed $key - */ - public static function becauseTheKeyIsNotValid($key): UnableToMountFilesystem - { - return new UnableToMountFilesystem( - 'Unable to mount filesystem, key was invalid. String expected, received: ' . gettype($key) - ); - } - - /** - * @param mixed $filesystem - */ - public static function becauseTheFilesystemWasNotValid($filesystem): UnableToMountFilesystem - { - $received = is_object($filesystem) ? get_class($filesystem) : gettype($filesystem); - - return new UnableToMountFilesystem( - 'Unable to mount filesystem, filesystem was invalid. Instance of ' . FilesystemOperator::class . ' expected, received: ' . $received - ); - } -} diff --git a/vendor/league/flysystem/src/UnableToMoveFile.php b/vendor/league/flysystem/src/UnableToMoveFile.php deleted file mode 100644 index 72792f4a..00000000 --- a/vendor/league/flysystem/src/UnableToMoveFile.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -use RuntimeException; -use Throwable; - -final class UnableToMoveFile extends RuntimeException implements FilesystemOperationFailed -{ - /** - * @var string - */ - private $source; - - /** - * @var string - */ - private $destination; - - public function source(): string - { - return $this->source; - } - - public function destination(): string - { - return $this->destination; - } - - public static function fromLocationTo( - string $sourcePath, - string $destinationPath, - Throwable $previous = null - ): UnableToMoveFile { - $message = $previous?->getMessage() ?? "Unable to move file from $sourcePath to $destinationPath"; - $e = new static($message, 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/UnableToProvideChecksum.php b/vendor/league/flysystem/src/UnableToProvideChecksum.php deleted file mode 100644 index 35e05023..00000000 --- a/vendor/league/flysystem/src/UnableToProvideChecksum.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -use RuntimeException; -use Throwable; - -final class UnableToProvideChecksum extends RuntimeException implements FilesystemException -{ - public function __construct(string $reason, string $path, ?Throwable $previous = null) - { - parent::__construct("Unable to get checksum for $path: $reason", 0, $previous); - } -} diff --git a/vendor/league/flysystem/src/UnableToReadFile.php b/vendor/league/flysystem/src/UnableToReadFile.php deleted file mode 100644 index 766b5630..00000000 --- a/vendor/league/flysystem/src/UnableToReadFile.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -use RuntimeException; -use Throwable; - -final class UnableToReadFile extends RuntimeException implements FilesystemOperationFailed -{ - /** - * @var string - */ - private $location = ''; - - /** - * @var string - */ - private $reason = ''; - - public static function fromLocation(string $location, string $reason = '', Throwable $previous = null): UnableToReadFile - { - $e = new static(rtrim("Unable to read file from location: {$location}. {$reason}"), 0, $previous); - $e->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 91a9ee3e..00000000 --- a/vendor/league/flysystem/src/UnableToResolveFilesystemMount.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -use RuntimeException; - -class UnableToResolveFilesystemMount extends RuntimeException implements FilesystemException -{ - public static function becauseTheSeparatorIsMissing(string $path): UnableToResolveFilesystemMount - { - return new UnableToResolveFilesystemMount("Unable to resolve the filesystem mount because the path ($path) is missing a separator (://)."); - } - - public static function becauseTheMountWasNotRegistered(string $mountIdentifier): UnableToResolveFilesystemMount - { - return new UnableToResolveFilesystemMount("Unable to resolve the filesystem mount because the mount ($mountIdentifier) was not registered."); - } -} diff --git a/vendor/league/flysystem/src/UnableToRetrieveMetadata.php b/vendor/league/flysystem/src/UnableToRetrieveMetadata.php deleted file mode 100644 index 11cec7f9..00000000 --- a/vendor/league/flysystem/src/UnableToRetrieveMetadata.php +++ /dev/null @@ -1,76 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -use RuntimeException; -use Throwable; - -final class UnableToRetrieveMetadata extends RuntimeException implements FilesystemOperationFailed -{ - /** - * @var string - */ - private $location; - - /** - * @var string - */ - private $metadataType; - - /** - * @var string - */ - private $reason; - - public static function lastModified(string $location, string $reason = '', Throwable $previous = null): self - { - return static::create($location, FileAttributes::ATTRIBUTE_LAST_MODIFIED, $reason, $previous); - } - - public static function visibility(string $location, string $reason = '', Throwable $previous = null): self - { - return static::create($location, FileAttributes::ATTRIBUTE_VISIBILITY, $reason, $previous); - } - - public static function fileSize(string $location, string $reason = '', Throwable $previous = null): self - { - return static::create($location, FileAttributes::ATTRIBUTE_FILE_SIZE, $reason, $previous); - } - - public static function mimeType(string $location, string $reason = '', Throwable $previous = null): self - { - return static::create($location, FileAttributes::ATTRIBUTE_MIME_TYPE, $reason, $previous); - } - - public static function create(string $location, string $type, string $reason = '', Throwable $previous = null): self - { - $e = new static("Unable to retrieve the $type for file at location: $location. {$reason}", 0, $previous); - $e->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 5862d0e0..00000000 --- a/vendor/league/flysystem/src/UnableToSetVisibility.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -use RuntimeException; - -use Throwable; - -use function rtrim; - -final class UnableToSetVisibility extends RuntimeException implements FilesystemOperationFailed -{ - /** - * @var string - */ - private $location; - - /** - * @var string - */ - private $reason; - - public function reason(): string - { - return $this->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 5de78665..00000000 --- a/vendor/league/flysystem/src/UnableToWriteFile.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -use RuntimeException; -use Throwable; - -final class UnableToWriteFile extends RuntimeException implements FilesystemOperationFailed -{ - /** - * @var string - */ - private $location = ''; - - /** - * @var string - */ - private $reason; - - public static function atLocation(string $location, string $reason = '', Throwable $previous = null): UnableToWriteFile - { - $e = new static(rtrim("Unable to write file at location: {$location}. {$reason}"), 0, $previous); - $e->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 117b4d96..00000000 --- a/vendor/league/flysystem/src/UnixVisibility/PortableVisibilityConverter.php +++ /dev/null @@ -1,79 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem\UnixVisibility; - -use League\Flysystem\PortableVisibilityGuard; -use League\Flysystem\Visibility; - -class PortableVisibilityConverter implements VisibilityConverter -{ - public function __construct( - private int $filePublic = 0644, - private int $filePrivate = 0600, - private int $directoryPublic = 0755, - private int $directoryPrivate = 0700, - private string $defaultForDirectories = Visibility::PRIVATE - ) { - } - - 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<mixed> $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 64af86a0..00000000 --- a/vendor/league/flysystem/src/UnixVisibility/VisibilityConverter.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem\UnixVisibility; - -interface VisibilityConverter -{ - public function forFile(string $visibility): int; - public function forDirectory(string $visibility): int; - public function inverseForFile(int $visibility): string; - public function inverseForDirectory(int $visibility): string; - public function defaultForDirectories(): int; -} diff --git a/vendor/league/flysystem/src/UnreadableFileEncountered.php b/vendor/league/flysystem/src/UnreadableFileEncountered.php deleted file mode 100644 index e31952d4..00000000 --- a/vendor/league/flysystem/src/UnreadableFileEncountered.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -use RuntimeException; - -final class UnreadableFileEncountered extends RuntimeException implements FilesystemException -{ - /** - * @var string - */ - private $location; - - public function location(): string - { - return $this->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/UrlGeneration/ChainedPublicUrlGenerator.php b/vendor/league/flysystem/src/UrlGeneration/ChainedPublicUrlGenerator.php deleted file mode 100644 index 079375a1..00000000 --- a/vendor/league/flysystem/src/UrlGeneration/ChainedPublicUrlGenerator.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem\UrlGeneration; - -use League\Flysystem\Config; -use League\Flysystem\UnableToGeneratePublicUrl; - -final class ChainedPublicUrlGenerator implements PublicUrlGenerator -{ - /** - * @param PublicUrlGenerator[] $generators - */ - public function __construct(private iterable $generators) - { - } - - public function publicUrl(string $path, Config $config): string - { - foreach ($this->generators as $generator) { - try { - return $generator->publicUrl($path, $config); - } catch (UnableToGeneratePublicUrl) { - } - } - - throw new UnableToGeneratePublicUrl('No supported public url generator found.', $path); - } -} diff --git a/vendor/league/flysystem/src/UrlGeneration/PrefixPublicUrlGenerator.php b/vendor/league/flysystem/src/UrlGeneration/PrefixPublicUrlGenerator.php deleted file mode 100644 index 79217155..00000000 --- a/vendor/league/flysystem/src/UrlGeneration/PrefixPublicUrlGenerator.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem\UrlGeneration; - -use League\Flysystem\Config; -use League\Flysystem\PathPrefixer; - -class PrefixPublicUrlGenerator implements PublicUrlGenerator -{ - private PathPrefixer $prefixer; - - public function __construct(string $urlPrefix) - { - $this->prefixer = new PathPrefixer($urlPrefix, '/'); - } - - public function publicUrl(string $path, Config $config): string - { - return $this->prefixer->prefixPath($path); - } -} diff --git a/vendor/league/flysystem/src/UrlGeneration/PublicUrlGenerator.php b/vendor/league/flysystem/src/UrlGeneration/PublicUrlGenerator.php deleted file mode 100644 index 08c987fd..00000000 --- a/vendor/league/flysystem/src/UrlGeneration/PublicUrlGenerator.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem\UrlGeneration; - -use League\Flysystem\Config; -use League\Flysystem\UnableToGeneratePublicUrl; - -interface PublicUrlGenerator -{ - /** - * @throws UnableToGeneratePublicUrl - */ - public function publicUrl(string $path, Config $config): string; -} diff --git a/vendor/league/flysystem/src/UrlGeneration/ShardedPrefixPublicUrlGenerator.php b/vendor/league/flysystem/src/UrlGeneration/ShardedPrefixPublicUrlGenerator.php deleted file mode 100644 index a4ff58f1..00000000 --- a/vendor/league/flysystem/src/UrlGeneration/ShardedPrefixPublicUrlGenerator.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -namespace League\Flysystem\UrlGeneration; - -use InvalidArgumentException; -use League\Flysystem\Config; -use League\Flysystem\PathPrefixer; - -use function array_map; -use function count; -use function crc32; - -final class ShardedPrefixPublicUrlGenerator implements PublicUrlGenerator -{ - /** @var PathPrefixer[] */ - private array $prefixes; - private int $count; - - /** - * @param string[] $prefixes - */ - public function __construct(array $prefixes) - { - $this->count = count($prefixes); - - if ($this->count === 0) { - throw new InvalidArgumentException('At least one prefix is required.'); - } - - $this->prefixes = array_map(static fn (string $prefix) => new PathPrefixer($prefix, '/'), $prefixes); - } - - public function publicUrl(string $path, Config $config): string - { - $index = abs(crc32($path)) % $this->count; - - return $this->prefixes[$index]->prefixPath($path); - } -} diff --git a/vendor/league/flysystem/src/UrlGeneration/TemporaryUrlGenerator.php b/vendor/league/flysystem/src/UrlGeneration/TemporaryUrlGenerator.php deleted file mode 100644 index 87074f75..00000000 --- a/vendor/league/flysystem/src/UrlGeneration/TemporaryUrlGenerator.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php -declare(strict_types=1); - -namespace League\Flysystem\UrlGeneration; - -use DateTimeInterface; -use League\Flysystem\Config; -use League\Flysystem\UnableToGenerateTemporaryUrl; - -interface TemporaryUrlGenerator -{ - /** - * @throws UnableToGenerateTemporaryUrl - */ - public function temporaryUrl(string $path, DateTimeInterface $expiresAt, Config $config): string; -} diff --git a/vendor/league/flysystem/src/Visibility.php b/vendor/league/flysystem/src/Visibility.php deleted file mode 100644 index 071ca000..00000000 --- a/vendor/league/flysystem/src/Visibility.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -final class Visibility -{ - public const PUBLIC = 'public'; - public const PRIVATE = 'private'; -} diff --git a/vendor/league/flysystem/src/WhitespacePathNormalizer.php b/vendor/league/flysystem/src/WhitespacePathNormalizer.php deleted file mode 100644 index 135b22a4..00000000 --- a/vendor/league/flysystem/src/WhitespacePathNormalizer.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\Flysystem; - -class WhitespacePathNormalizer implements PathNormalizer -{ - public function normalizePath(string $path): string - { - $path = str_replace('\\', '/', $path); - $this->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 2264f7ad..00000000 --- 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 1f016521..00000000 --- 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 80ca1af8..00000000 --- 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 fc042416..00000000 --- a/vendor/league/mime-type-detection/src/EmptyExtensionToMimeTypeMap.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\MimeTypeDetection; - -class EmptyExtensionToMimeTypeMap implements ExtensionToMimeTypeMap -{ - public function lookupMimeType(string $extension): ?string - { - return null; - } -} diff --git a/vendor/league/mime-type-detection/src/ExtensionMimeTypeDetector.php b/vendor/league/mime-type-detection/src/ExtensionMimeTypeDetector.php deleted file mode 100644 index 92b6b1c6..00000000 --- a/vendor/league/mime-type-detection/src/ExtensionMimeTypeDetector.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\MimeTypeDetection; - -use const PATHINFO_EXTENSION; - -class ExtensionMimeTypeDetector implements MimeTypeDetector -{ - /** - * @var ExtensionToMimeTypeMap - */ - private $extensions; - - public function __construct(ExtensionToMimeTypeMap $extensions = null) - { - $this->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 1dad7bc1..00000000 --- a/vendor/league/mime-type-detection/src/ExtensionToMimeTypeMap.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\MimeTypeDetection; - -interface ExtensionToMimeTypeMap -{ - public function lookupMimeType(string $extension): ?string; -} diff --git a/vendor/league/mime-type-detection/src/FinfoMimeTypeDetector.php b/vendor/league/mime-type-detection/src/FinfoMimeTypeDetector.php deleted file mode 100644 index ba91938f..00000000 --- a/vendor/league/mime-type-detection/src/FinfoMimeTypeDetector.php +++ /dev/null @@ -1,92 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\MimeTypeDetection; - -use const FILEINFO_MIME_TYPE; - -use const PATHINFO_EXTENSION; -use finfo; - -class FinfoMimeTypeDetector implements MimeTypeDetector -{ - private const INCONCLUSIVE_MIME_TYPES = [ - 'application/x-empty', - 'text/plain', - 'text/x-asm', - 'application/octet-stream', - 'inode/x-empty', - ]; - - /** - * @var finfo - */ - private $finfo; - - /** - * @var ExtensionToMimeTypeMap - */ - private $extensionMap; - - /** - * @var int|null - */ - private $bufferSampleSize; - - /** - * @var array<string> - */ - 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 f092388d..00000000 --- a/vendor/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php +++ /dev/null @@ -1,1227 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\MimeTypeDetection; - -class GeneratedExtensionToMimeTypeMap implements ExtensionToMimeTypeMap -{ - /** - * @var string[] - * - * @internal - */ - public const MIME_TYPES_FOR_EXTENSIONS = [ - '1km' => '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 5d799d2a..00000000 --- a/vendor/league/mime-type-detection/src/MimeTypeDetector.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace League\MimeTypeDetection; - -interface MimeTypeDetector -{ - /** - * @param string|resource $contents - */ - public function detectMimeType(string $path, $contents): ?string; - - public function detectMimeTypeFromBuffer(string $contents): ?string; - - public function detectMimeTypeFromPath(string $path): ?string; - - public function detectMimeTypeFromFile(string $path): ?string; -} diff --git a/vendor/league/mime-type-detection/src/OverridingExtensionToMimeTypeMap.php b/vendor/league/mime-type-detection/src/OverridingExtensionToMimeTypeMap.php deleted file mode 100644 index 0c71e4d5..00000000 --- a/vendor/league/mime-type-detection/src/OverridingExtensionToMimeTypeMap.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php - -namespace League\MimeTypeDetection; - -class OverridingExtensionToMimeTypeMap implements ExtensionToMimeTypeMap -{ - /** - * @var ExtensionToMimeTypeMap - */ - private $innerMap; - - /** - * @var string[] - */ - private $overrides; - - /** - * @param array<string, string> $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/mockery/mockery/.phpstorm.meta.php b/vendor/mockery/mockery/.phpstorm.meta.php deleted file mode 100644 index bb7acee5..00000000 --- a/vendor/mockery/mockery/.phpstorm.meta.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php - -namespace PHPSTORM_META; - -override(\Mockery::mock(0), map(["" => "@"])); -override(\Mockery::spy(0), map(["" => "@"])); -override(\Mockery::namedMock(0), map(["" => "@"])); -override(\Mockery::instanceMock(0), map(["" => "@"])); -override(\mock(0), map(["" => "@"])); -override(\spy(0), map(["" => "@"])); -override(\namedMock(0), map(["" => "@"])); \ No newline at end of file diff --git a/vendor/mockery/mockery/CHANGELOG.md b/vendor/mockery/mockery/CHANGELOG.md deleted file mode 100644 index 937460e9..00000000 --- a/vendor/mockery/mockery/CHANGELOG.md +++ /dev/null @@ -1,217 +0,0 @@ -# Change Log - -## 1.3.6 (2022-09-07) -* PHP 8.2 | Fix "Use of "parent" in callables is deprecated" notice #1169 - -## 1.5.1 (2022-09-07) - -* [PHP 8.2] Various tests: explicitly declare properties #1170 -* [PHP 8.2] Fix "Use of "parent" in callables is deprecated" notice #1169 -* [PHP 8.1] Support intersection types #1164 -* Handle final `__toString` methods #1162 - -## 1.5.0 (2022-01-20) - -* Override default call count expectations via expects() #1146 -* Mock methods with static return types #1157 -* Mock methods with mixed return type #1156 -* Mock classes with new in initializers on PHP 8.1 #1160 -* Removes redundant PHPUnitConstraint #1158 - -## 1.4.4 (2021-09-13) - -* Fixes auto-generated return values #1144 -* Adds support for tentative types #1130 -* Fixes for PHP 8.1 Support (#1130 and #1140) -* Add method that allows defining a set of arguments the mock should yield #1133 -* Added option to configure default matchers for objects `\Mockery::getConfiguration()->setDefaultMatcher($class, $matcherClass)` #1120 - -## 1.3.5 (2021-09-13) -* Fix auto-generated return values with union types #1143 -* Adds support for tentative types #1130 -* Fixes for PHP 8.1 Support (#1130 and #1140) -* Add method that allows defining a set of arguments the mock should yield #1133 -* Added option to configure default matchers for objects `\Mockery::getConfiguration()->setDefaultMatcher($class, $matcherClass)` #1120 - -## 1.4.3 (2021-02-24) - -* Fixes calls to fetchMock before initialisation #1113 -* Allow shouldIgnoreMissing() to behave in a recursive fashion #1097 -* Custom object formatters #766 (Needs Docs) -* Fix crash on a union type including null #1106 - -## 1.3.4 (2021-02-24) - -* Fixes calls to fetchMock before initialisation #1113 -* Fix crash on a union type including null #1106 - -## 1.4.2 (2020-08-11) - -* Fix array to string conversion in ConstantsPass (#1086) -* Fixed nullable PHP 8.0 union types (#1088, #1089) -* Fixed support for PHP 8.0 parent type (#1088, #1089) -* Fixed PHP 8.0 mixed type support (#1088, #1089) -* Fixed PHP 8.0 union return types (#1088, #1089) - -## 1.4.1 (2020-07-09) - -* Allow quick definitions to use 'at least once' expectation - `\Mockery::getConfiguration()->getQuickDefinitions()->shouldBeCalledAtLeastOnce(true)` (#1056) -* Added provisional support for PHP 8.0 (#1068, #1072,#1079) -* Fix mocking methods with iterable return type without specifying a return value (#1075) - -## 1.3.3 (2020-08-11) - -* Fix array to string conversion in ConstantsPass (#1086) -* Fixed nullable PHP 8.0 union types (#1088) -* Fixed support for PHP 8.0 parent type (#1088) -* Fixed PHP 8.0 mixed type support (#1088) -* Fixed PHP 8.0 union return types (#1088) - -## 1.3.2 (2020-07-09) - -* Fix mocking with anonymous classes (#1039) -* Fix andAnyOthers() to properly match earlier expectations (#1051) -* Added provisional support for PHP 8.0 (#1068, #1072,#1079) -* Fix mocking methods with iterable return type without specifying a return value (#1075) - -## 1.4.0 (2020-05-19) - -* Fix mocking with anonymous classes (#1039) -* Fix andAnyOthers() to properly match earlier expectations (#1051) -* Drops support for PHP < 7.3 and PHPUnit < 8 (#1059) - -## 1.3.1 (2019-12-26) - -* Revert improved exception debugging due to BC breaks (#1032) - -## 1.3.0 (2019-11-24) - -* Added capture `Mockery::capture` convenience matcher (#1020) -* Added `andReturnArg` to echo back an argument passed to a an expectation (#992) -* Improved exception debugging (#1000) -* Fixed `andSet` to not reuse properties between mock objects (#1012) - -## 1.2.4 (2019-09-30) - -* Fix a bug introduced with previous release, for empty method definition lists (#1009) - -## 1.2.3 (2019-08-07) - -* Allow mocking classes that have allows and expects methods (#868) -* Allow passing thru __call method in all mock types (experimental) (#969) -* Add support for `!` to blacklist methods (#959) -* Added `withSomeOfArgs` to partial match a list of args (#967) -* Fix chained demeter calls with type hint (#956) - -## 1.2.2 (2019-02-13) - -* Fix a BC breaking change for PHP 5.6/PHPUnit 5.7.27 (#947) - -## 1.2.1 (2019-02-07) - -* Support for PHPUnit 8 (#942) -* Allow mocking static methods called on instance (#938) - -## 1.2.0 (2018-10-02) - -* Starts counting default expectations towards count (#910) -* Adds workaround for some HHVM return types (#909) -* Adds PhpStorm metadata support for autocomplete etc (#904) -* Further attempts to support multiple PHPUnit versions (#903) -* Allows setting constructor expectations on instance mocks (#900) -* Adds workaround for HHVM memoization decorator (#893) -* Adds experimental support for callable spys (#712) - -## 1.1.0 (2018-05-08) - -* Allows use of string method names in allows and expects (#794) -* Finalises allows and expects syntax in API (#799) -* Search for handlers in a case instensitive way (#801) -* Deprecate allowMockingMethodsUnnecessarily (#808) -* Fix risky tests (#769) -* Fix namespace in TestListener (#812) -* Fixed conflicting mock names (#813) -* Clean elses (#819) -* Updated protected method mocking exception message (#826) -* Map of constants to mock (#829) -* Simplify foreach with `in_array` function (#830) -* Typehinted return value on Expectation#verify. (#832) -* Fix shouldNotHaveReceived with HigherOrderMessage (#842) -* Deprecates shouldDeferMissing (#839) -* Adds support for return type hints in Demeter chains (#848) -* Adds shouldNotReceive to composite expectation (#847) -* Fix internal error when using --static-backup (#845) -* Adds `andAnyOtherArgs` as an optional argument matcher (#860) -* Fixes namespace qualifying with namespaced named mocks (#872) -* Added possibility to add Constructor-Expections on hard dependencies, read: Mockery::mock('overload:...') (#781) - -## 1.0.0 (2017-09-06) - -* Destructors (`__destruct`) are stubbed out where it makes sense -* Allow passing a closure argument to `withArgs()` to validate multiple arguments at once. -* `Mockery\Adapter\Phpunit\TestListener` has been rewritten because it - incorrectly marked some tests as risky. It will no longer verify mock - expectations but instead check that tests do that themselves. PHPUnit 6 is - required if you want to use this fail safe. -* Removes SPL Class Loader -* Removed object recorder feature -* Bumped minimum PHP version to 5.6 -* `andThrow` will now throw anything `\Throwable` -* Adds `allows` and `expects` syntax -* Adds optional global helpers for `mock`, `namedMock` and `spy` -* Adds ability to create objects using traits -* `Mockery\Matcher\MustBe` was deprecated -* Marked `Mockery\MockInterface` as internal -* Subset matcher matches recursively -* BC BREAK - Spies return `null` by default from ignored (non-mocked) methods with nullable return type -* Removed extracting getter methods of object instances -* BC BREAK - Remove implicit regex matching when trying to match string arguments, introduce `\Mockery::pattern()` when regex matching is needed -* Fix Mockery not getting closed in cases of failing test cases -* Fix Mockery not setting properties on overloaded instance mocks -* BC BREAK - Fix Mockery not trying default expectations if there is any concrete expectation -* BC BREAK - Mockery's PHPUnit integration will mark a test as risky if it - thinks one it's exceptions has been swallowed in PHPUnit > 5.7.6. Use `$e->dismiss()` to dismiss. - -## 0.9.4 (XXXX-XX-XX) - -* `shouldIgnoreMissing` will respect global `allowMockingNonExistentMethods` - config -* Some support for variadic parameters -* Hamcrest is now a required dependency -* Instance mocks now respect `shouldIgnoreMissing` call on control instance -* This will be the *last version to support PHP 5.3* -* Added `Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration` trait -* Added `makePartial` to `Mockery\MockInterface` as it was missing - -## 0.9.3 (2014-12-22) - -* Added a basic spy implementation -* Added `Mockery\Adapter\Phpunit\MockeryTestCase` for more reliable PHPUnit - integration - -## 0.9.2 (2014-09-03) - -* Some workarounds for the serialisation problems created by changes to PHP in 5.5.13, 5.4.29, - 5.6. -* Demeter chains attempt to reuse doubles as they see fit, so for foo->bar and - foo->baz, we'll attempt to use the same foo - -## 0.9.1 (2014-05-02) - -* Allow specifying consecutive exceptions to be thrown with `andThrowExceptions` -* Allow specifying methods which can be mocked when using - `Mockery\Configuration::allowMockingNonExistentMethods(false)` with - `Mockery\MockInterface::shouldAllowMockingMethod($methodName)` -* Added andReturnSelf method: `$mock->shouldReceive("foo")->andReturnSelf()` -* `shouldIgnoreMissing` now takes an optional value that will be return instead - of null, e.g. `$mock->shouldIgnoreMissing($mock)` - -## 0.9.0 (2014-02-05) - -* Allow mocking classes with final __wakeup() method -* Quick definitions are now always `byDefault` -* Allow mocking of protected methods with `shouldAllowMockingProtectedMethods` -* Support official Hamcrest package -* Generator completely rewritten -* Easily create named mocks with namedMock diff --git a/vendor/mockery/mockery/CONTRIBUTING.md b/vendor/mockery/mockery/CONTRIBUTING.md deleted file mode 100644 index b714f3f4..00000000 --- a/vendor/mockery/mockery/CONTRIBUTING.md +++ /dev/null @@ -1,88 +0,0 @@ -# Contributing - - -We'd love you to help out with mockery and no contribution is too small. - - -## Reporting Bugs - -Issues can be reported on the [issue -tracker](https://github.com/padraic/mockery/issues). Please try and report any -bugs with a minimal reproducible example, it will make things easier for other -contributors and your problems will hopefully be resolved quickly. - - -## Requesting Features - -We're always interested to hear about your ideas and you can request features by -creating a ticket in the [issue -tracker](https://github.com/padraic/mockery/issues). We can't always guarantee -someone will jump on it straight away, but putting it out there to see if anyone -else is interested is a good idea. - -Likewise, if a feature you would like is already listed in -the issue tracker, add a :+1: so that other contributors know it's a feature -that would help others. - - -## Contributing code and documentation - -We loosely follow the -[PSR-1](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md) -and -[PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) coding standards, -but we'll probably merge any code that looks close enough. - -* Fork the [repository](https://github.com/padraic/mockery) on GitHub -* Add the code for your feature or bug -* Add some tests for your feature or bug -* Optionally, but preferably, write some documentation -* Optionally, update the CHANGELOG.md file with your feature or - [BC](http://en.wikipedia.org/wiki/Backward_compatibility) break -* Send a [Pull - Request](https://help.github.com/articles/creating-a-pull-request) to the - correct target branch (see below) - -If you have a big change or would like to discuss something, create an issue in -the [issue tracker](https://github.com/padraic/mockery/issues) or jump in to -\#mockery on freenode - - -Any code you contribute must be licensed under the [BSD 3-Clause -License](http://opensource.org/licenses/BSD-3-Clause). - - -## Target Branch - -Mockery may have several active branches at any one time and roughly follows a -[Git Branching Model](https://igor.io/2013/10/21/git-branching-model.html). -Generally, if you're developing a new feature, you want to be targeting the -master branch, if it's a bug fix, you want to be targeting a release branch, -e.g. 0.8. - - -## Testing Mockery - -To run the unit tests for Mockery, clone the git repository, download Composer using -the instructions at [http://getcomposer.org/download/](http://getcomposer.org/download/), -then install the dependencies with `php /path/to/composer.phar install`. - -This will install the required PHPUnit and Hamcrest dev dependencies and create the -autoload files required by the unit tests. You may run the `vendor/bin/phpunit` command -to run the unit tests. If everything goes to plan, there will be no failed tests! - - -## Debugging Mockery - -Mockery and its code generation can be difficult to debug. A good start is to -use the `RequireLoader`, which will dump the code generated by mockery to a file -before requiring it, rather than using eval. This will help with stack traces, -and you will be able to open the mock class in your editor. - -``` php - -// tests/bootstrap.php - -Mockery::setLoader(new Mockery\Loader\RequireLoader(sys_get_temp_dir())); - -``` diff --git a/vendor/mockery/mockery/LICENSE b/vendor/mockery/mockery/LICENSE deleted file mode 100644 index 2e127a65..00000000 --- a/vendor/mockery/mockery/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2010, Pádraic Brady -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. - - * The name of Pádraic Brady may not 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/mockery/mockery/README.md b/vendor/mockery/mockery/README.md deleted file mode 100644 index 55771dfb..00000000 --- a/vendor/mockery/mockery/README.md +++ /dev/null @@ -1,291 +0,0 @@ -Mockery -======= - -[![Build Status](https://github.com/mockery/mockery/actions/workflows/tests.yml/badge.svg)](https://github.com/mockery/mockery/actions) -[![Latest Stable Version](https://poser.pugx.org/mockery/mockery/v/stable.svg)](https://packagist.org/packages/mockery/mockery) -[![Total Downloads](https://poser.pugx.org/mockery/mockery/downloads.svg)](https://packagist.org/packages/mockery/mockery) - -Mockery is a simple yet flexible PHP mock object framework for use in unit testing -with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a -test double framework with a succinct API capable of clearly defining all possible -object operations and interactions using a human readable Domain Specific Language -(DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library, -Mockery is easy to integrate with PHPUnit and can operate alongside -phpunit-mock-objects without the World ending. - -Mockery is released under a New BSD License. - -## Installation - -To install Mockery, run the command below and you will get the latest -version - -```sh -composer require --dev mockery/mockery -``` - -## Documentation - -In older versions, this README file was the documentation for Mockery. Over time -we have improved this, and have created an extensive documentation for you. Please -use this README file as a starting point for Mockery, but do read the documentation -to learn how to use Mockery. - -The current version can be seen at [docs.mockery.io](http://docs.mockery.io). - -## PHPUnit Integration - -Mockery ships with some helpers if you are using PHPUnit. You can extend the -[`Mockery\Adapter\Phpunit\MockeryTestCase`](library/Mockery/Adapter/Phpunit/MockeryTestCase.php) -class instead of `PHPUnit\Framework\TestCase`, or if you are already using a -custom base class for your tests, take a look at the traits available in the -[`Mockery\Adapter\Phpunit`](library/Mockery/Adapter/Phpunit) namespace. - -## Test Doubles - -Test doubles (often called mocks) simulate the behaviour of real objects. They are -commonly utilised to offer test isolation, to stand in for objects which do not -yet exist, or to allow for the exploratory design of class APIs without -requiring actual implementation up front. - -The benefits of a test double framework are to allow for the flexible generation -and configuration of test doubles. They allow the setting of expected method calls -and/or return values using a flexible API which is capable of capturing every -possible real object behaviour in way that is stated as close as possible to a -natural language description. Use the `Mockery::mock` method to create a test -double. - -``` php -$double = Mockery::mock(); -``` - -If you need Mockery to create a test double to satisfy a particular type hint, -you can pass the type to the `mock` method. - -``` php -class Book {} - -interface BookRepository { - function find($id): Book; - function findAll(): array; - function add(Book $book): void; -} - -$double = Mockery::mock(BookRepository::class); -``` - -A detailed explanation of creating and working with test doubles is given in the -documentation, [Creating test doubles](http://docs.mockery.io/en/latest/reference/creating_test_doubles.html) -section. - -## Method Stubs 🎫 - -A method stub is a mechanism for having your test double return canned responses -to certain method calls. With stubs, you don't care how many times, if at all, -the method is called. Stubs are used to provide indirect input to the system -under test. - -``` php -$double->allows()->find(123)->andReturns(new Book()); - -$book = $double->find(123); -``` - -If you have used Mockery before, you might see something new in the example -above — we created a method stub using `allows`, instead of the "old" -`shouldReceive` syntax. This is a new feature of Mockery v1, but fear not, -the trusty ol' `shouldReceive` is still here. - -For new users of Mockery, the above example can also be written as: - -``` php -$double->shouldReceive('find')->with(123)->andReturn(new Book()); -$book = $double->find(123); -``` - -If your stub doesn't require specific arguments, you can also use this shortcut -for setting up multiple calls at once: - -``` php -$double->allows([ - "findAll" => [new Book(), new Book()], -]); -``` - -or - -``` php -$double->shouldReceive('findAll') - ->andReturn([new Book(), new Book()]); -``` - -You can also use this shortcut, which creates a double and sets up some stubs in -one call: - -``` php -$double = Mockery::mock(BookRepository::class, [ - "findAll" => [new Book(), new Book()], -]); -``` - -## Method Call Expectations 📲 - -A Method call expectation is a mechanism to allow you to verify that a -particular method has been called. You can specify the parameters and you can -also specify how many times you expect it to be called. Method call expectations -are used to verify indirect output of the system under test. - -``` php -$book = new Book(); - -$double = Mockery::mock(BookRepository::class); -$double->expects()->add($book); -``` - -During the test, Mockery accept calls to the `add` method as prescribed. -After you have finished exercising the system under test, you need to -tell Mockery to check that the method was called as expected, using the -`Mockery::close` method. One way to do that is to add it to your `tearDown` -method in PHPUnit. - -``` php - -public function tearDown() -{ - Mockery::close(); -} -``` - -The `expects()` method automatically sets up an expectation that the method call -(and matching parameters) is called **once and once only**. You can choose to change -this if you are expecting more calls. - -``` php -$double->expects()->add($book)->twice(); -``` - -If you have used Mockery before, you might see something new in the example -above — we created a method expectation using `expects`, instead of the "old" -`shouldReceive` syntax. This is a new feature of Mockery v1, but same as with -`accepts` in the previous section, it can be written in the "old" style. - -For new users of Mockery, the above example can also be written as: - -``` php -$double->shouldReceive('find') - ->with(123) - ->once() - ->andReturn(new Book()); -$book = $double->find(123); -``` - -A detailed explanation of declaring expectations on method calls, please -read the documentation, the [Expectation declarations](http://docs.mockery.io/en/latest/reference/expectations.html) -section. After that, you can also learn about the new `allows` and `expects` methods -in the [Alternative shouldReceive syntax](http://docs.mockery.io/en/latest/reference/alternative_should_receive_syntax.html) -section. - -It is worth mentioning that one way of setting up expectations is no better or worse -than the other. Under the hood, `allows` and `expects` are doing the same thing as -`shouldReceive`, at times in "less words", and as such it comes to a personal preference -of the programmer which way to use. - -## Test Spies 🕵️ - -By default, all test doubles created with the `Mockery::mock` method will only -accept calls that they have been configured to `allow` or `expect` (or in other words, -calls that they `shouldReceive`). Sometimes we don't necessarily care about all of the -calls that are going to be made to an object. To facilitate this, we can tell Mockery -to ignore any calls it has not been told to expect or allow. To do so, we can tell a -test double `shouldIgnoreMissing`, or we can create the double using the `Mocker::spy` -shortcut. - -``` php -// $double = Mockery::mock()->shouldIgnoreMissing(); -$double = Mockery::spy(); - -$double->foo(); // null -$double->bar(); // null -``` - -Further to this, sometimes we want to have the object accept any call during the test execution -and then verify the calls afterwards. For these purposes, we need our test -double to act as a Spy. All mockery test doubles record the calls that are made -to them for verification afterwards by default: - -``` php -$double->baz(123); - -$double->shouldHaveReceived()->baz(123); // null -$double->shouldHaveReceived()->baz(12345); // Uncaught Exception Mockery\Exception\InvalidCountException... -``` - -Please refer to the [Spies](http://docs.mockery.io/en/latest/reference/spies.html) section -of the documentation to learn more about the spies. - -## Utilities 🔌 - -### Global Helpers - -Mockery ships with a handful of global helper methods, you just need to ask -Mockery to declare them. - -``` php -Mockery::globalHelpers(); - -$mock = mock(Some::class); -$spy = spy(Some::class); - -$spy->shouldHaveReceived() - ->foo(anyArgs()); -``` - -All of the global helpers are wrapped in a `!function_exists` call to avoid -conflicts. So if you already have a global function called `spy`, Mockery will -silently skip the declaring its own `spy` function. - -### Testing Traits - -As Mockery ships with code generation capabilities, it was trivial to add -functionality allowing users to create objects on the fly that use particular -traits. Any abstract methods defined by the trait will be created and can have -expectations or stubs configured like normal Test Doubles. - -``` php -trait Foo { - function foo() { - return $this->doFoo(); - } - - abstract function doFoo(); -} - -$double = Mockery::mock(Foo::class); -$double->allows()->doFoo()->andReturns(123); -$double->foo(); // int(123) -``` - -## Versioning - -The Mockery team attempts to adhere to [Semantic Versioning](http://semver.org), -however, some of Mockery's internals are considered private and will be open to -change at any time. Just because a class isn't final, or a method isn't marked -private, does not mean it constitutes part of the API we guarantee under the -versioning scheme. - -### Alternative Runtimes - -Mockery 1.3 was the last version to support HHVM 3 and PHP 5. There is no support for HHVM 4+. - -## A new home for Mockery - -⚠️️ Update your remotes! Mockery has transferred to a new location. While it was once -at `padraic/mockery`, it is now at `mockery/mockery`. While your -existing repositories will redirect transparently for any operations, take some -time to transition to the new URL. -```sh -$ git remote set-url upstream https://github.com/mockery/mockery.git -``` -Replace `upstream` with the name of the remote you use locally; `upstream` is commonly -used but you may be using something else. Run `git remote -v` to see what you're actually -using. diff --git a/vendor/mockery/mockery/composer.json b/vendor/mockery/mockery/composer.json deleted file mode 100644 index 43caba8c..00000000 --- a/vendor/mockery/mockery/composer.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "name": "mockery/mockery", - "description": "Mockery is a simple yet flexible PHP mock object framework", - "scripts": { - "docs": "phpdoc -d library -t docs/api" - }, - "keywords": [ - "bdd", - "library", - "mock", - "mock objects", - "mockery", - "stub", - "tdd", - "test", - "test double", - "testing" - ], - "homepage": "https://github.com/mockery/mockery", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Pádraic Brady", - "email": "padraic.brady@gmail.com", - "homepage": "http://blog.astrumfutura.com" - }, - { - "name": "Dave Marshall", - "email": "dave.marshall@atstsolutions.co.uk", - "homepage": "http://davedevelopment.co.uk" - } - ], - "require": { - "php": "^7.3 || ^8.0", - "lib-pcre": ">=7.0", - "hamcrest/hamcrest-php": "^2.0.1" - }, - "require-dev": { - "phpunit/phpunit": "^8.5 || ^9.3" - }, - "conflict": { - "phpunit/phpunit": "<8.0" - }, - "autoload": { - "psr-0": { - "Mockery": "library/" - } - }, - "autoload-dev": { - "psr-4": { - "test\\": "tests/" - } - }, - "config": { - "preferred-install": "dist" - }, - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - } -} diff --git a/vendor/mockery/mockery/docs/README.md b/vendor/mockery/mockery/docs/README.md deleted file mode 100644 index 63ca69db..00000000 --- a/vendor/mockery/mockery/docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -mockery-docs -============ - -Document for the PHP Mockery framework on readthedocs.org \ No newline at end of file diff --git a/vendor/mockery/mockery/docs/conf.py b/vendor/mockery/mockery/docs/conf.py deleted file mode 100644 index 901f0405..00000000 --- a/vendor/mockery/mockery/docs/conf.py +++ /dev/null @@ -1,267 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Mockery Docs documentation build configuration file, created by -# sphinx-quickstart on Mon Mar 3 14:04:26 2014. -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -#sys.path.insert(0, os.path.abspath('.')) - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -#needs_sphinx = '1.0' - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - 'sphinx.ext.todo', -] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# The suffix of source filenames. -source_suffix = '.rst' - -# The encoding of source files. -#source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = 'index' - -# General information about the project. -project = u'Mockery Docs' -copyright = u'Pádraic Brady, Dave Marshall and contributors' - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The short X.Y version. -version = '1.0' -# The full version, including alpha/beta/rc tags. -release = '1.0-alpha' - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -#language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -#today = '' -# Else, today_fmt is used as the format for a strftime call. -#today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ['_build'] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -#default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -#add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -#add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -#show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' - -# A list of ignored prefixes for module index sorting. -#modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -#keep_warnings = False - - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = 'default' - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -#html_theme_options = {} - -# Add any paths that contain custom themes here, relative to this directory. -#html_theme_path = [] - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -#html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -#html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -#html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -#html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -#html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -#html_additional_pages = {} - -# If false, no module index is generated. -#html_domain_indices = True - -# If false, no index is generated. -#html_use_index = True - -# If true, the index is split into individual pages for each letter. -#html_split_index = False - -# If true, links to the reST sources are added to the pages. -#html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -#html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -#html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a <link> tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -#html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -#html_file_suffix = None - -# Output file base name for HTML help builder. -htmlhelp_basename = 'MockeryDocsdoc' - - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -#'papersize': 'letterpaper', - -# The font size ('10pt', '11pt' or '12pt'). -#'pointsize': '10pt', - -# Additional stuff for the LaTeX preamble. -#'preamble': '', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ('index', 'MockeryDocs.tex', u'Mockery Docs Documentation', - u'Pádraic Brady, Dave Marshall, Wouter, Graham Campbell', 'manual'), -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -#latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -#latex_use_parts = False - -# If true, show page references after internal links. -#latex_show_pagerefs = False - -# If true, show URL addresses after external links. -#latex_show_urls = False - -# Documents to append as an appendix to all manuals. -#latex_appendices = [] - -# If false, no module index is generated. -#latex_domain_indices = True - - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ('index', 'mockerydocs', u'Mockery Docs Documentation', - [u'Pádraic Brady, Dave Marshall, Wouter, Graham Campbell'], 1) -] - -# If true, show URL addresses after external links. -#man_show_urls = False - - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ('index', 'MockeryDocs', u'Mockery Docs Documentation', - u'Pádraic Brady, Dave Marshall, Wouter, Graham Campbell', 'MockeryDocs', 'One line description of project.', - 'Miscellaneous'), -] - -# Documents to append as an appendix to all manuals. -#texinfo_appendices = [] - -# If false, no module index is generated. -#texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -#texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -#texinfo_no_detailmenu = False - - -#on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org -on_rtd = os.environ.get('READTHEDOCS', None) == 'True' - -if not on_rtd: # only import and set the theme if we're building docs locally - import sphinx_rtd_theme - html_theme = 'sphinx_rtd_theme' - html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] - print sphinx_rtd_theme.get_html_theme_path() - -# load PhpLexer -from sphinx.highlighting import lexers -from pygments.lexers.web import PhpLexer - -# enable highlighting for PHP code not between <?php ... ?> by default -lexers['php'] = PhpLexer(startinline=True) -lexers['php-annotations'] = PhpLexer(startinline=True) diff --git a/vendor/mockery/mockery/docs/cookbook/big_parent_class.rst b/vendor/mockery/mockery/docs/cookbook/big_parent_class.rst deleted file mode 100644 index a27d5327..00000000 --- a/vendor/mockery/mockery/docs/cookbook/big_parent_class.rst +++ /dev/null @@ -1,52 +0,0 @@ -.. index:: - single: Cookbook; Big Parent Class - -Big Parent Class -================ - -In some application code, especially older legacy code, we can come across some -classes that extend a "big parent class" - a parent class that knows and does -too much: - -.. code-block:: php - - class BigParentClass - { - public function doesEverything() - { - // sets up database connections - // writes to log files - } - } - - class ChildClass extends BigParentClass - { - public function doesOneThing() - { - // but calls on BigParentClass methods - $result = $this->doesEverything(); - // does something with $result - return $result; - } - } - -We want to test our ``ChildClass`` and its ``doesOneThing`` method, but the -problem is that it calls on ``BigParentClass::doesEverything()``. One way to -handle this would be to mock out **all** of the dependencies ``BigParentClass`` -has and needs, and then finally actually test our ``doesOneThing`` method. It's -an awful lot of work to do that. - -What we can do, is to do something... unconventional. We can create a runtime -partial test double of the ``ChildClass`` itself and mock only the parent's -``doesEverything()`` method: - -.. code-block:: php - - $childClass = \Mockery::mock('ChildClass')->makePartial(); - $childClass->shouldReceive('doesEverything') - ->andReturn('some result from parent'); - - $childClass->doesOneThing(); // string("some result from parent"); - -With this approach we mock out only the ``doesEverything()`` method, and all the -unmocked methods are called on the actual ``ChildClass`` instance. diff --git a/vendor/mockery/mockery/docs/cookbook/class_constants.rst b/vendor/mockery/mockery/docs/cookbook/class_constants.rst deleted file mode 100644 index 0b925692..00000000 --- a/vendor/mockery/mockery/docs/cookbook/class_constants.rst +++ /dev/null @@ -1,183 +0,0 @@ -.. index:: - single: Cookbook; Class Constants - -Class Constants -=============== - -When creating a test double for a class, Mockery does not create stubs out of -any class constants defined in the class we are mocking. Sometimes though, the -non-existence of these class constants, setup of the test, and the application -code itself, it can lead to undesired behavior, and even a PHP error: -``PHP Fatal error: Uncaught Error: Undefined class constant 'FOO' in ...`` - -While supporting class constants in Mockery would be possible, it does require -an awful lot of work, for a small number of use cases. - -Named Mocks ------------ - -We can, however, deal with these constants in a way supported by Mockery - by -using :ref:`creating-test-doubles-named-mocks`. - -A named mock is a test double that has a name of the class we want to mock, but -under it is a stubbed out class that mimics the real class with canned responses. - -Lets look at the following made up, but not impossible scenario: - -.. code-block:: php - - class Fetcher - { - const SUCCESS = 0; - const FAILURE = 1; - - public static function fetch() - { - // Fetcher gets something for us from somewhere... - return self::SUCCESS; - } - } - - class MyClass - { - public function doFetching() - { - $response = Fetcher::fetch(); - - if ($response == Fetcher::SUCCESS) { - echo "Thanks!" . PHP_EOL; - } else { - echo "Try again!" . PHP_EOL; - } - } - } - -Our ``MyClass`` calls a ``Fetcher`` that fetches some resource from somewhere - -maybe it downloads a file from a remote web service. Our ``MyClass`` prints out -a response message depending on the response from the ``Fetcher::fetch()`` call. - -When testing ``MyClass`` we don't really want ``Fetcher`` to go and download -random stuff from the internet every time we run our test suite. So we mock it -out: - -.. code-block:: php - - // Using alias: because fetch is called statically! - \Mockery::mock('alias:Fetcher') - ->shouldReceive('fetch') - ->andReturn(0); - - $myClass = new MyClass(); - $myClass->doFetching(); - -If we run this, our test will error out with a nasty -``PHP Fatal error: Uncaught Error: Undefined class constant 'SUCCESS' in ..``. - -Here's how a ``namedMock()`` can help us in a situation like this. - -We create a stub for the ``Fetcher`` class, stubbing out the class constants, -and then use ``namedMock()`` to create a mock named ``Fetcher`` based on our -stub: - -.. code-block:: php - - class FetcherStub - { - const SUCCESS = 0; - const FAILURE = 1; - } - - \Mockery::namedMock('Fetcher', 'FetcherStub') - ->shouldReceive('fetch') - ->andReturn(0); - - $myClass = new MyClass(); - $myClass->doFetching(); - -This works because under the hood, Mockery creates a class called ``Fetcher`` -that extends ``FetcherStub``. - -The same approach will work even if ``Fetcher::fetch()`` is not a static -dependency: - -.. code-block:: php - - class Fetcher - { - const SUCCESS = 0; - const FAILURE = 1; - - public function fetch() - { - // Fetcher gets something for us from somewhere... - return self::SUCCESS; - } - } - - class MyClass - { - public function doFetching($fetcher) - { - $response = $fetcher->fetch(); - - if ($response == Fetcher::SUCCESS) { - echo "Thanks!" . PHP_EOL; - } else { - echo "Try again!" . PHP_EOL; - } - } - } - -And the test will have something like this: - -.. code-block:: php - - class FetcherStub - { - const SUCCESS = 0; - const FAILURE = 1; - } - - $mock = \Mockery::mock('Fetcher', 'FetcherStub') - $mock->shouldReceive('fetch') - ->andReturn(0); - - $myClass = new MyClass(); - $myClass->doFetching($mock); - - -Constants Map -------------- - -Another way of mocking class constants can be with the use of the constants map configuration. - -Given a class with constants: - -.. code-block:: php - - class Fetcher - { - const SUCCESS = 0; - const FAILURE = 1; - - public function fetch() - { - // Fetcher gets something for us from somewhere... - return self::SUCCESS; - } - } - -It can be mocked with: - -.. code-block:: php - - \Mockery::getConfiguration()->setConstantsMap([ - 'Fetcher' => [ - 'SUCCESS' => 'success', - 'FAILURE' => 'fail', - ] - ]); - - $mock = \Mockery::mock('Fetcher'); - var_dump($mock::SUCCESS); // (string) 'success' - var_dump($mock::FAILURE); // (string) 'fail' diff --git a/vendor/mockery/mockery/docs/cookbook/default_expectations.rst b/vendor/mockery/mockery/docs/cookbook/default_expectations.rst deleted file mode 100644 index 2c6fcae2..00000000 --- a/vendor/mockery/mockery/docs/cookbook/default_expectations.rst +++ /dev/null @@ -1,17 +0,0 @@ -.. index:: - single: Cookbook; Default Mock Expectations - -Default Mock Expectations -========================= - -Often in unit testing, we end up with sets of tests which use the same object -dependency over and over again. Rather than mocking this class/object within -every single unit test (requiring a mountain of duplicate code), we can -instead define reusable default mocks within the test case's ``setup()`` -method. This even works where unit tests use varying expectations on the same -or similar mock object. - -How this works, is that you can define mocks with default expectations. Then, -in a later unit test, you can add or fine-tune expectations for that specific -test. Any expectation can be set as a default using the ``byDefault()`` -declaration. diff --git a/vendor/mockery/mockery/docs/cookbook/detecting_mock_objects.rst b/vendor/mockery/mockery/docs/cookbook/detecting_mock_objects.rst deleted file mode 100644 index 0210c692..00000000 --- a/vendor/mockery/mockery/docs/cookbook/detecting_mock_objects.rst +++ /dev/null @@ -1,13 +0,0 @@ -.. index:: - single: Cookbook; Detecting Mock Objects - -Detecting Mock Objects -====================== - -Users may find it useful to check whether a given object is a real object or a -simulated Mock Object. All Mockery mocks implement the -``\Mockery\MockInterface`` interface which can be used in a type check. - -.. code-block:: php - - assert($mightBeMocked instanceof \Mockery\MockInterface); diff --git a/vendor/mockery/mockery/docs/cookbook/index.rst b/vendor/mockery/mockery/docs/cookbook/index.rst deleted file mode 100644 index 034e39de..00000000 --- a/vendor/mockery/mockery/docs/cookbook/index.rst +++ /dev/null @@ -1,16 +0,0 @@ -Cookbook -======== - -.. toctree:: - :hidden: - - default_expectations - detecting_mock_objects - not_calling_the_constructor - mocking_hard_dependencies - class_constants - big_parent_class - mockery_on - mocking_class_within_class - -.. include:: map.rst.inc diff --git a/vendor/mockery/mockery/docs/cookbook/map.rst.inc b/vendor/mockery/mockery/docs/cookbook/map.rst.inc deleted file mode 100644 index c9dd99ef..00000000 --- a/vendor/mockery/mockery/docs/cookbook/map.rst.inc +++ /dev/null @@ -1,7 +0,0 @@ -* :doc:`/cookbook/default_expectations` -* :doc:`/cookbook/detecting_mock_objects` -* :doc:`/cookbook/not_calling_the_constructor` -* :doc:`/cookbook/mocking_hard_dependencies` -* :doc:`/cookbook/class_constants` -* :doc:`/cookbook/big_parent_class` -* :doc:`/cookbook/mockery_on` diff --git a/vendor/mockery/mockery/docs/cookbook/mockery_on.rst b/vendor/mockery/mockery/docs/cookbook/mockery_on.rst deleted file mode 100644 index 631f1241..00000000 --- a/vendor/mockery/mockery/docs/cookbook/mockery_on.rst +++ /dev/null @@ -1,85 +0,0 @@ -.. index:: - single: Cookbook; Complex Argument Matching With Mockery::on - -Complex Argument Matching With Mockery::on -========================================== - -When we need to do a more complex argument matching for an expected method call, -the ``\Mockery::on()`` matcher comes in really handy. It accepts a closure as an -argument and that closure in turn receives the argument passed in to the method, -when called. If the closure returns ``true``, Mockery will consider that the -argument has passed the expectation. If the closure returns ``false``, or a -"falsey" value, the expectation will not pass. - -The ``\Mockery::on()`` matcher can be used in various scenarios — validating -an array argument based on multiple keys and values, complex string matching... - -Say, for example, we have the following code. It doesn't do much; publishes a -post by setting the ``published`` flag in the database to ``1`` and sets the -``published_at`` to the current date and time: - -.. code-block:: php - - <?php - namespace Service; - class Post - { - public function __construct($model) - { - $this->model = $model; - } - - public function publishPost($id) - { - $saveData = [ - 'post_id' => $id, - 'published' => 1, - 'published_at' => gmdate('Y-m-d H:i:s'), - ]; - $this->model->save($saveData); - } - } - -In a test we would mock the model and set some expectations on the call of the -``save()`` method: - -.. code-block:: php - - <?php - $postId = 42; - - $modelMock = \Mockery::mock('Model'); - $modelMock->shouldReceive('save') - ->once() - ->with(\Mockery::on(function ($argument) use ($postId) { - $postIdIsSet = isset($argument['post_id']) && $argument['post_id'] === $postId; - $publishedFlagIsSet = isset($argument['published']) && $argument['published'] === 1; - $publishedAtIsSet = isset($argument['published_at']); - - return $postIdIsSet && $publishedFlagIsSet && $publishedAtIsSet; - })); - - $service = new \Service\Post($modelMock); - $service->publishPost($postId); - - \Mockery::close(); - -The important part of the example is inside the closure we pass to the -``\Mockery::on()`` matcher. The ``$argument`` is actually the ``$saveData`` argument -the ``save()`` method gets when it is called. We check for a couple of things in -this argument: - -* the post ID is set, and is same as the post ID we passed in to the - ``publishPost()`` method, -* the ``published`` flag is set, and is ``1``, and -* the ``published_at`` key is present. - -If any of these requirements is not satisfied, the closure will return ``false``, -the method call expectation will not be met, and Mockery will throw a -``NoMatchingExpectationException``. - -.. note:: - - This cookbook entry is an adaption of the blog post titled - `"Complex argument matching in Mockery" <https://robertbasic.com/blog/complex-argument-matching-in-mockery/>`_, - published by Robert Basic on his blog. diff --git a/vendor/mockery/mockery/docs/cookbook/mocking_class_within_class.rst b/vendor/mockery/mockery/docs/cookbook/mocking_class_within_class.rst deleted file mode 100644 index 51f030b9..00000000 --- a/vendor/mockery/mockery/docs/cookbook/mocking_class_within_class.rst +++ /dev/null @@ -1,146 +0,0 @@ -.. index:: - single: Cookbook; Mocking class within class - -.. _mocking-class-within-class: - -Mocking class within class -========================== - -Imagine a case where you need to create an instance of a class and use it -within the same method: - -.. code-block:: php - - // Point.php - <?php - namespace App; - - class Point { - public function setPoint($x, $y) { - echo "Point (" . $x . ", " . $y . ")" . PHP_EOL; - } - } - - // Rectangle.php - <?php - namespace App; - use App\Point; - - class Rectangle { - public function create($x1, $y1, $x2, $y2) { - $a = new Point(); - $a->setPoint($x1, $y1); - - $b = new Point(); - $b->setPoint($x2, $y1); - - $c = new Point(); - $c->setPoint($x2, $y2); - - $d = new Point(); - $d->setPoint($x1, $y2); - - $this->draw([$a, $b, $c, $d]); - } - - public function draw($points) { - echo "Do something with the points"; - } - } - -And that you want to test that a logic in ``Rectangle->create()`` calls -properly each used thing - in this case calls ``Point->setPoint()``, but -``Rectangle->draw()`` does some graphical stuff that you want to avoid calling. - -You set the mocks for ``App\Point`` and ``App\Rectangle``: - -.. code-block:: php - - <?php - class MyTest extends PHPUnit\Framework\TestCase { - public function testCreate() { - $point = Mockery::mock("App\Point"); - // check if our mock is called - $point->shouldReceive("setPoint")->andThrow(Exception::class); - - $rect = Mockery::mock("App\Rectangle")->makePartial(); - $rect->shouldReceive("draw"); - - $rect->create(0, 0, 100, 100); // does not throw exception - Mockery::close(); - } - } - -and the test does not work. Why? The mocking relies on the class not being -present yet, but the class is autoloaded therefore the mock alone for -``App\Point`` is useless which you can see with ``echo`` being executed. - -Mocks however work for the first class in the order of loading i.e. -``App\Rectangle``, which loads the ``App\Point`` class. In more complex example -that would be a single point that initiates the whole loading (``use Class``) -such as:: - - A // main loading initiator - |- B // another loading initiator - | |-E - | +-G - | - |- C // another loading initiator - | +-F - | - +- D - -That basically means that the loading prevents mocking and for each such -a loading initiator there needs to be implemented a workaround. -Overloading is one approach, however it pollutes the global state. In this case -we try to completely avoid the global state pollution with custom -``new Class()`` behavior per loading initiator and that can be mocked easily -in few critical places. - -That being said, although we can't stop loading, we can return mocks. Let's -look at ``Rectangle->create()`` method: - -.. code-block:: php - - class Rectangle { - public function newPoint() { - return new Point(); - } - - public function create($x1, $y1, $x2, $y2) { - $a = $this->newPoint(); - $a->setPoint($x1, $y1); - ... - } - ... - } - -We create a custom function to encapsulate ``new`` keyword that would otherwise -just use the autoloaded class ``App\Point`` and in our test we mock that function -so that it returns our mock: - -.. code-block:: php - - <?php - class MyTest extends PHPUnit\Framework\TestCase { - public function testCreate() { - $point = Mockery::mock("App\Point"); - // check if our mock is called - $point->shouldReceive("setPoint")->andThrow(Exception::class); - - $rect = Mockery::mock("App\Rectangle")->makePartial(); - $rect->shouldReceive("draw"); - - // pass the App\Point mock into App\Rectangle as an alternative - // to using new App\Point() in-place. - $rect->shouldReceive("newPoint")->andReturn($point); - - $this->expectException(Exception::class); - $rect->create(0, 0, 100, 100); - Mockery::close(); - } - } - -If we run this test now, it should pass. For more complex cases we'd find -the next loader in the program flow and proceed with wrapping and passing -mock instances with predefined behavior into already existing classes. diff --git a/vendor/mockery/mockery/docs/cookbook/mocking_hard_dependencies.rst b/vendor/mockery/mockery/docs/cookbook/mocking_hard_dependencies.rst deleted file mode 100644 index 3391d7b3..00000000 --- a/vendor/mockery/mockery/docs/cookbook/mocking_hard_dependencies.rst +++ /dev/null @@ -1,137 +0,0 @@ -.. index:: - single: Cookbook; Mocking Hard Dependencies - -Mocking Hard Dependencies (new Keyword) -======================================= - -One prerequisite to mock hard dependencies is that the code we are trying to test uses autoloading. - -Let's take the following code for an example: - -.. code-block:: php - - <?php - namespace App; - class Service - { - function callExternalService($param) - { - $externalService = new Service\External($version = 5); - $externalService->sendSomething($param); - return $externalService->getSomething(); - } - } - -The way we can test this without doing any changes to the code itself is by creating :doc:`instance mocks </reference/instance_mocking>` by using the ``overload`` prefix. - -.. code-block:: php - - <?php - namespace AppTest; - use Mockery as m; - class ServiceTest extends \PHPUnit_Framework_TestCase - { - public function testCallingExternalService() - { - $param = 'Testing'; - - $externalMock = m::mock('overload:App\Service\External'); - $externalMock->shouldReceive('sendSomething') - ->once() - ->with($param); - $externalMock->shouldReceive('getSomething') - ->once() - ->andReturn('Tested!'); - - $service = new \App\Service(); - - $result = $service->callExternalService($param); - - $this->assertSame('Tested!', $result); - } - } - -If we run this test now, it should pass. Mockery does its job and our ``App\Service`` will use the mocked external service instead of the real one. - -The problem with this is when we want to, for example, test the ``App\Service\External`` itself, or if we use that class somewhere else in our tests. - -When Mockery overloads a class, because of how PHP works with files, that overloaded class file must not be included otherwise Mockery will throw a "class already exists" exception. This is where autoloading kicks in and makes our job a lot easier. - -To make this possible, we'll tell PHPUnit to run the tests that have overloaded classes in separate processes and to not preserve global state. That way we'll avoid having the overloaded class included more than once. Of course this has its downsides as these tests will run slower. - -Our test example from above now becomes: - -.. code-block:: php - - <?php - namespace AppTest; - use Mockery as m; - /** - * @runTestsInSeparateProcesses - * @preserveGlobalState disabled - */ - class ServiceTest extends \PHPUnit_Framework_TestCase - { - public function testCallingExternalService() - { - $param = 'Testing'; - - $externalMock = m::mock('overload:App\Service\External'); - $externalMock->shouldReceive('sendSomething') - ->once() - ->with($param); - $externalMock->shouldReceive('getSomething') - ->once() - ->andReturn('Tested!'); - - $service = new \App\Service(); - - $result = $service->callExternalService($param); - - $this->assertSame('Tested!', $result); - } - } - - - -Testing the constructor arguments of hard Dependencies ------------------------------------------------------- - -Sometimes we might want to ensure that the hard dependency is instantiated with -particular arguments. With overloaded mocks, we can set up expectations on the -constructor. - -.. code-block:: php - - <?php - namespace AppTest; - use Mockery as m; - /** - * @runTestsInSeparateProcesses - * @preserveGlobalState disabled - */ - class ServiceTest extends \PHPUnit_Framework_TestCase - { - public function testCallingExternalService() - { - $externalMock = m::mock('overload:App\Service\External'); - $externalMock->allows('sendSomething'); - $externalMock->shouldReceive('__construct') - ->once() - ->with(5); - - $service = new \App\Service(); - $result = $service->callExternalService($param); - } - } - - -.. note:: - For more straightforward and single-process tests oriented way check - :ref:`mocking-class-within-class`. - -.. note:: - - This cookbook entry is an adaption of the blog post titled - `"Mocking hard dependencies with Mockery" <https://robertbasic.com/blog/mocking-hard-dependencies-with-mockery/>`_, - published by Robert Basic on his blog. diff --git a/vendor/mockery/mockery/docs/cookbook/not_calling_the_constructor.rst b/vendor/mockery/mockery/docs/cookbook/not_calling_the_constructor.rst deleted file mode 100644 index b8157ae3..00000000 --- a/vendor/mockery/mockery/docs/cookbook/not_calling_the_constructor.rst +++ /dev/null @@ -1,63 +0,0 @@ -.. index:: - single: Cookbook; Not Calling the Original Constructor - -Not Calling the Original Constructor -==================================== - -When creating generated partial test doubles, Mockery mocks out only the method -which we specifically told it to. This means that the original constructor of -the class we are mocking will be called. - -In some cases this is not a desired behavior, as the constructor might issue -calls to other methods, or other object collaborators, and as such, can create -undesired side-effects in the application's environment when running the tests. - -If this happens, we need to use runtime partial test doubles, as they don't -call the original constructor. - -.. code-block:: php - - class MyClass - { - public function __construct() - { - echo "Original constructor called." . PHP_EOL; - // Other side-effects can happen... - } - } - - // This will print "Original constructor called." - $mock = \Mockery::mock('MyClass[foo]'); - -A better approach is to use runtime partial doubles: - -.. code-block:: php - - class MyClass - { - public function __construct() - { - echo "Original constructor called." . PHP_EOL; - // Other side-effects can happen... - } - } - - // This will not print anything - $mock = \Mockery::mock('MyClass')->makePartial(); - $mock->shouldReceive('foo'); - -This is one of the reason why we don't recommend using generated partial test -doubles, but if possible, always use the runtime partials. - -Read more about :ref:`creating-test-doubles-partial-test-doubles`. - -.. note:: - - The way generated partial test doubles work, is a BC break. If you use a - really old version of Mockery, it might behave in a way that the constructor - is not being called for these generated partials. In the case if you upgrade - to a more recent version of Mockery, you'll probably have to change your - tests to use runtime partials, instead of generated ones. - - This change was introduced in early 2013, so it is highly unlikely that you - are using a Mockery from before that, so this should not be an issue. diff --git a/vendor/mockery/mockery/docs/getting_started/index.rst b/vendor/mockery/mockery/docs/getting_started/index.rst deleted file mode 100644 index 434755c8..00000000 --- a/vendor/mockery/mockery/docs/getting_started/index.rst +++ /dev/null @@ -1,12 +0,0 @@ -Getting Started -=============== - -.. toctree:: - :hidden: - - installation - upgrading - simple_example - quick_reference - -.. include:: map.rst.inc diff --git a/vendor/mockery/mockery/docs/getting_started/installation.rst b/vendor/mockery/mockery/docs/getting_started/installation.rst deleted file mode 100644 index f578adc9..00000000 --- a/vendor/mockery/mockery/docs/getting_started/installation.rst +++ /dev/null @@ -1,49 +0,0 @@ -.. index:: - single: Installation - -Installation -============ - -Mockery can be installed using Composer or by cloning it from its GitHub -repository. These two options are outlined below. - -Composer --------- - -You can read more about Composer on `getcomposer.org <https://getcomposer.org>`_. -To install Mockery using Composer, first install Composer for your project -using the instructions on the `Composer download page <https://getcomposer.org/download/>`_. -You can then define your development dependency on Mockery using the suggested -parameters below. While every effort is made to keep the master branch stable, -you may prefer to use the current stable version tag instead (use the -``@stable`` tag). - -.. code-block:: json - - { - "require-dev": { - "mockery/mockery": "dev-master" - } - } - -To install, you then may call: - -.. code-block:: bash - - php composer.phar update - -This will install Mockery as a development dependency, meaning it won't be -installed when using ``php composer.phar update --no-dev`` in production. - -Other way to install is directly from composer command line, as below. - -.. code-block:: bash - - php composer.phar require --dev mockery/mockery - -Git ---- - -The Git repository hosts the development version in its master branch. You can -install this using Composer by referencing ``dev-master`` as your preferred -version in your project's ``composer.json`` file as the earlier example shows. diff --git a/vendor/mockery/mockery/docs/getting_started/map.rst.inc b/vendor/mockery/mockery/docs/getting_started/map.rst.inc deleted file mode 100644 index 1055945b..00000000 --- a/vendor/mockery/mockery/docs/getting_started/map.rst.inc +++ /dev/null @@ -1,4 +0,0 @@ -* :doc:`/getting_started/installation` -* :doc:`/getting_started/upgrading` -* :doc:`/getting_started/simple_example` -* :doc:`/getting_started/quick_reference` diff --git a/vendor/mockery/mockery/docs/getting_started/quick_reference.rst b/vendor/mockery/mockery/docs/getting_started/quick_reference.rst deleted file mode 100644 index e729a850..00000000 --- a/vendor/mockery/mockery/docs/getting_started/quick_reference.rst +++ /dev/null @@ -1,200 +0,0 @@ -.. index:: - single: Quick Reference - -Quick Reference -=============== - -The purpose of this page is to give a quick and short overview of some of the -most common Mockery features. - -Do read the :doc:`../reference/index` to learn about all the Mockery features. - -Integrate Mockery with PHPUnit, either by extending the ``MockeryTestCase``: - -.. code-block:: php - - use \Mockery\Adapter\Phpunit\MockeryTestCase; - - class MyTest extends MockeryTestCase - { - } - -or by using the ``MockeryPHPUnitIntegration`` trait: - -.. code-block:: php - - use \PHPUnit\Framework\TestCase; - use \Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration; - - class MyTest extends TestCase - { - use MockeryPHPUnitIntegration; - } - -Creating a test double: - -.. code-block:: php - - $testDouble = \Mockery::mock('MyClass'); - -Creating a test double that implements a certain interface: - -.. code-block:: php - - $testDouble = \Mockery::mock('MyClass, MyInterface'); - -Expecting a method to be called on a test double: - -.. code-block:: php - - $testDouble = \Mockery::mock('MyClass'); - $testDouble->shouldReceive('foo'); - -Expecting a method to **not** be called on a test double: - -.. code-block:: php - - $testDouble = \Mockery::mock('MyClass'); - $testDouble->shouldNotReceive('foo'); - -Expecting a method to be called on a test double, once, with a certain argument, -and to return a value: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('foo') - ->once() - ->with($arg) - ->andReturn($returnValue); - -Expecting a method to be called on a test double and to return a different value -for each successive call: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('foo') - ->andReturn(1, 2, 3); - - $mock->foo(); // int(1); - $mock->foo(); // int(2); - $mock->foo(); // int(3); - $mock->foo(); // int(3); - -Creating a runtime partial test double: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass')->makePartial(); - -Creating a spy: - -.. code-block:: php - - $spy = \Mockery::spy('MyClass'); - -Expecting that a spy should have received a method call: - -.. code-block:: php - - $spy = \Mockery::spy('MyClass'); - - $spy->foo(); - - $spy->shouldHaveReceived()->foo(); - -Not so simple examples -^^^^^^^^^^^^^^^^^^^^^^ - -Creating a mock object to return a sequence of values from a set of method -calls: - -.. code-block:: php - - use \Mockery\Adapter\Phpunit\MockeryTestCase; - - class SimpleTest extends MockeryTestCase - { - public function testSimpleMock() - { - $mock = \Mockery::mock(array('pi' => 3.1416, 'e' => 2.71)); - $this->assertEquals(3.1416, $mock->pi()); - $this->assertEquals(2.71, $mock->e()); - } - } - -Creating a mock object which returns a self-chaining Undefined object for a -method call: - -.. code-block:: php - - use \Mockery\Adapter\Phpunit\MockeryTestCase; - - class UndefinedTest extends MockeryTestCase - { - public function testUndefinedValues() - { - $mock = \Mockery::mock('mymock'); - $mock->shouldReceive('divideBy')->with(0)->andReturnUndefined(); - $this->assertTrue($mock->divideBy(0) instanceof \Mockery\Undefined); - } - } - -Creating a mock object with multiple query calls and a single update call: - -.. code-block:: php - - use \Mockery\Adapter\Phpunit\MockeryTestCase; - - class DbTest extends MockeryTestCase - { - public function testDbAdapter() - { - $mock = \Mockery::mock('db'); - $mock->shouldReceive('query')->andReturn(1, 2, 3); - $mock->shouldReceive('update')->with(5)->andReturn(NULL)->once(); - - // ... test code here using the mock - } - } - -Expecting all queries to be executed before any updates: - -.. code-block:: php - - use \Mockery\Adapter\Phpunit\MockeryTestCase; - - class DbTest extends MockeryTestCase - { - public function testQueryAndUpdateOrder() - { - $mock = \Mockery::mock('db'); - $mock->shouldReceive('query')->andReturn(1, 2, 3)->ordered(); - $mock->shouldReceive('update')->andReturn(NULL)->once()->ordered(); - - // ... test code here using the mock - } - } - -Creating a mock object where all queries occur after startup, but before finish, -and where queries are expected with several different params: - -.. code-block:: php - - use \Mockery\Adapter\Phpunit\MockeryTestCase; - - class DbTest extends MockeryTestCase - { - public function testOrderedQueries() - { - $db = \Mockery::mock('db'); - $db->shouldReceive('startup')->once()->ordered(); - $db->shouldReceive('query')->with('CPWR')->andReturn(12.3)->once()->ordered('queries'); - $db->shouldReceive('query')->with('MSFT')->andReturn(10.0)->once()->ordered('queries'); - $db->shouldReceive('query')->with(\Mockery::pattern("/^....$/"))->andReturn(3.3)->atLeast()->once()->ordered('queries'); - $db->shouldReceive('finish')->once()->ordered(); - - // ... test code here using the mock - } - } diff --git a/vendor/mockery/mockery/docs/getting_started/simple_example.rst b/vendor/mockery/mockery/docs/getting_started/simple_example.rst deleted file mode 100644 index 32ee2691..00000000 --- a/vendor/mockery/mockery/docs/getting_started/simple_example.rst +++ /dev/null @@ -1,70 +0,0 @@ -.. index:: - single: Getting Started; Simple Example - -Simple Example -============== - -Imagine we have a ``Temperature`` class which samples the temperature of a -locale before reporting an average temperature. The data could come from a web -service or any other data source, but we do not have such a class at present. -We can, however, assume some basic interactions with such a class based on its -interaction with the ``Temperature`` class: - -.. code-block:: php - - class Temperature - { - private $service; - - public function __construct($service) - { - $this->service = $service; - } - - public function average() - { - $total = 0; - for ($i=0; $i<3; $i++) { - $total += $this->service->readTemp(); - } - return $total/3; - } - } - -Even without an actual service class, we can see how we expect it to operate. -When writing a test for the ``Temperature`` class, we can now substitute a -mock object for the real service which allows us to test the behaviour of the -``Temperature`` class without actually needing a concrete service instance. - -.. code-block:: php - - use \Mockery; - - class TemperatureTest extends \PHPUnit\Framework\TestCase - { - public function tearDown() - { - Mockery::close(); - } - - public function testGetsAverageTemperatureFromThreeServiceReadings() - { - $service = Mockery::mock('service'); - $service->shouldReceive('readTemp') - ->times(3) - ->andReturn(10, 12, 14); - - $temperature = new Temperature($service); - - $this->assertEquals(12, $temperature->average()); - } - } - -We create a mock object which our ``Temperature`` class will use and set some -expectations for that mock — that it should receive three calls to the ``readTemp`` -method, and these calls will return 10, 12, and 14 as results. - -.. note:: - - PHPUnit integration can remove the need for a ``tearDown()`` method. See - ":doc:`/reference/phpunit_integration`" for more information. diff --git a/vendor/mockery/mockery/docs/getting_started/upgrading.rst b/vendor/mockery/mockery/docs/getting_started/upgrading.rst deleted file mode 100644 index 7201e597..00000000 --- a/vendor/mockery/mockery/docs/getting_started/upgrading.rst +++ /dev/null @@ -1,82 +0,0 @@ -.. index:: - single: Upgrading - -Upgrading -========= - -Upgrading to 1.0.0 ------------------- - -Minimum PHP version -+++++++++++++++++++ - -As of Mockery 1.0.0 the minimum PHP version required is 5.6. - -Using Mockery with PHPUnit -++++++++++++++++++++++++++ - -In the "old days", 0.9.x and older, the way Mockery was integrated with PHPUnit was -through a PHPUnit listener. That listener would in turn call the ``\Mockery::close()`` -method for us. - -As of 1.0.0, PHPUnit test cases where we want to use Mockery, should either use the -``\Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration`` trait, or extend the -``\Mockery\Adapter\Phpunit\MockeryTestCase`` test case. This will in turn call the -``\Mockery::close()`` method for us. - -Read the documentation for a detailed overview of ":doc:`/reference/phpunit_integration`". - -``\Mockery\Matcher\MustBe`` is deprecated -+++++++++++++++++++++++++++++++++++++++++ - -As of 1.0.0 the ``\Mockery\Matcher\MustBe`` matcher is deprecated and will be removed in -Mockery 2.0.0. We recommend instead to use the PHPUnit or Hamcrest equivalents of the -MustBe matcher. - -``allows`` and ``expects`` -++++++++++++++++++++++++++ - -As of 1.0.0, Mockery has two new methods to set up expectations: ``allows`` and ``expects``. -This means that these methods names are now "reserved" for Mockery, or in other words -classes you want to mock with Mockery, can't have methods called ``allows`` or ``expects``. - -Read more in the documentation about this ":doc:`/reference/alternative_should_receive_syntax`". - -No more implicit regex matching for string arguments -++++++++++++++++++++++++++++++++++++++++++++++++++++ - -When setting up string arguments in method expectations, Mockery 0.9.x and older, would try -to match arguments using a regular expression in a "last attempt" scenario. - -As of 1.0.0, Mockery will no longer attempt to do this regex matching, but will only try -first the identical operator ``===``, and failing that, the equals operator ``==``. - -If you want to match an argument using regular expressions, please use the new -``\Mockery\Matcher\Pattern`` matcher. Read more in the documentation about this -pattern matcher in the ":doc:`/reference/argument_validation`" section. - -``andThrow`` ``\Throwable`` -+++++++++++++++++++++++++++ - -As of 1.0.0, the ``andThrow`` can now throw any ``\Throwable``. - -Upgrading to 0.9 ----------------- - -The generator was completely rewritten, so any code with a deep integration to -mockery will need evaluating. - -Upgrading to 0.8 ----------------- - -Since the release of 0.8.0 the following behaviours were altered: - -1. The ``shouldIgnoreMissing()`` behaviour optionally applied to mock objects - returned an instance of ``\Mockery\Undefined`` when methods called did not - match a known expectation. Since 0.8.0, this behaviour was switched to - returning ``null`` instead. You can restore the 0.7.2 behaviour by using the - following: - - .. code-block:: php - - $mock = \Mockery::mock('stdClass')->shouldIgnoreMissing()->asUndefined(); diff --git a/vendor/mockery/mockery/docs/index.rst b/vendor/mockery/mockery/docs/index.rst deleted file mode 100644 index f8cbbd32..00000000 --- a/vendor/mockery/mockery/docs/index.rst +++ /dev/null @@ -1,76 +0,0 @@ -Mockery -======= - -Mockery is a simple yet flexible PHP mock object framework for use in unit -testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is -to offer a test double framework with a succinct API capable of clearly -defining all possible object operations and interactions using a human -readable Domain Specific Language (DSL). Designed as a drop in alternative to -PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate with -PHPUnit and can operate alongside phpunit-mock-objects without the World -ending. - -Mock Objects ------------- - -In unit tests, mock objects simulate the behaviour of real objects. They are -commonly utilised to offer test isolation, to stand in for objects which do -not yet exist, or to allow for the exploratory design of class APIs without -requiring actual implementation up front. - -The benefits of a mock object framework are to allow for the flexible -generation of such mock objects (and stubs). They allow the setting of -expected method calls and return values using a flexible API which is capable -of capturing every possible real object behaviour in way that is stated as -close as possible to a natural language description. - -Getting Started ---------------- - -Ready to dive into the Mockery framework? Then you can get started by reading -the "Getting Started" section! - -.. toctree:: - :hidden: - - getting_started/index - -.. include:: getting_started/map.rst.inc - -Reference ---------- - -The reference contains a complete overview of all features of the Mockery -framework. - -.. toctree:: - :hidden: - - reference/index - -.. include:: reference/map.rst.inc - -Mockery -------- - -Learn about Mockery's configuration, reserved method names, exceptions... - -.. toctree:: - :hidden: - - mockery/index - -.. include:: mockery/map.rst.inc - -Cookbook --------- - -Want to learn some easy tips and tricks? Take a look at the cookbook articles! - -.. toctree:: - :hidden: - - cookbook/index - -.. include:: cookbook/map.rst.inc - diff --git a/vendor/mockery/mockery/docs/mockery/configuration.rst b/vendor/mockery/mockery/docs/mockery/configuration.rst deleted file mode 100644 index 00713367..00000000 --- a/vendor/mockery/mockery/docs/mockery/configuration.rst +++ /dev/null @@ -1,94 +0,0 @@ -.. index:: - single: Mockery; Configuration - -Mockery Global Configuration -============================ - -To allow for a degree of fine-tuning, Mockery utilises a singleton -configuration object to store a small subset of core behaviours. The three -currently present include: - -* Option to allow/disallow the mocking of methods which do not actually exist - fulfilled (i.e. unused) -* Setter/Getter for added a parameter map for internal PHP class methods - (``Reflection`` cannot detect these automatically) -* Option to drive if quick definitions should define a stub or a mock with - an 'at least once' expectation. - -By default, the first behaviour is enabled. Of course, there are -situations where this can lead to unintended consequences. The mocking of -non-existent methods may allow mocks based on real classes/objects to fall out -of sync with the actual implementations, especially when some degree of -integration testing (testing of object wiring) is not being performed. - -You may allow or disallow this behaviour (whether for whole test suites or -just select tests) by using the following call: - -.. code-block:: php - - \Mockery::getConfiguration()->allowMockingNonExistentMethods(bool); - -Passing a true allows the behaviour, false disallows it. It takes effect -immediately until switched back. If the behaviour is detected when not allowed, -it will result in an Exception being thrown at that point. Note that disallowing -this behaviour should be carefully considered since it necessarily removes at -least some of Mockery's flexibility. - -The other two methods are: - -.. code-block:: php - - \Mockery::getConfiguration()->setInternalClassMethodParamMap($class, $method, array $paramMap) - \Mockery::getConfiguration()->getInternalClassMethodParamMap($class, $method) - -These are used to define parameters (i.e. the signature string of each) for the -methods of internal PHP classes (e.g. SPL, or PECL extension classes like -ext/mongo's MongoCollection. Reflection cannot analyse the parameters of internal -classes. Most of the time, you never need to do this. It's mainly needed where an -internal class method uses pass-by-reference for a parameter - you MUST in such -cases ensure the parameter signature includes the ``&`` symbol correctly as Mockery -won't correctly add it automatically for internal classes. Note that internal class -parameter overriding is not available in PHP 8. This is because incompatible -signatures have been reclassified as fatal errors. - -Finally there is the possibility to change what a quick definition produces. -By default quick definitions create stubs but you can change this behaviour -by asking Mockery to use 'at least once' expectations. - -.. code-block:: php - - \Mockery::getConfiguration()->getQuickDefinitions()->shouldBeCalledAtLeastOnce(bool) - -Passing a true allows the behaviour, false disallows it. It takes effect -immediately until switched back. By doing so you can avoid the proliferating of -quick definitions that accumulate overtime in your code since the test would -fail in case the 'at least once' expectation is not fulfilled. - -Disabling reflection caching ----------------------------- - -Mockery heavily uses `"reflection" <https://secure.php.net/manual/en/book.reflection.php>`_ -to do it's job. To speed up things, Mockery caches internally the information it -gathers via reflection. In some cases, this caching can cause problems. - -The **only** known situation when this occurs is when PHPUnit's ``--static-backup`` option -is used. If you use ``--static-backup`` and you get an error that looks like the -following: - -.. code-block:: php - - Error: Internal error: Failed to retrieve the reflection object - -We suggest turning off the reflection cache as so: - -.. code-block:: php - - \Mockery::getConfiguration()->disableReflectionCache(); - -Turning it back on can be done like so: - -.. code-block:: php - - \Mockery::getConfiguration()->enableReflectionCache(); - -In no other situation should you be required turn this reflection cache off. diff --git a/vendor/mockery/mockery/docs/mockery/exceptions.rst b/vendor/mockery/mockery/docs/mockery/exceptions.rst deleted file mode 100644 index 623b158e..00000000 --- a/vendor/mockery/mockery/docs/mockery/exceptions.rst +++ /dev/null @@ -1,65 +0,0 @@ -.. index:: - single: Mockery; Exceptions - -Mockery Exceptions -================== - -Mockery throws three types of exceptions when it cannot verify a mock object. - -#. ``\Mockery\Exception\InvalidCountException`` -#. ``\Mockery\Exception\InvalidOrderException`` -#. ``\Mockery\Exception\NoMatchingExpectationException`` - -You can capture any of these exceptions in a try...catch block to query them -for specific information which is also passed along in the exception message -but is provided separately from getters should they be useful when logging or -reformatting output. - -\Mockery\Exception\InvalidCountException ----------------------------------------- - -The exception class is used when a method is called too many (or too few) -times and offers the following methods: - -* ``getMock()`` - return actual mock object -* ``getMockName()`` - return the name of the mock object -* ``getMethodName()`` - return the name of the method the failing expectation - is attached to -* ``getExpectedCount()`` - return expected calls -* ``getExpectedCountComparative()`` - returns a string, e.g. ``<=`` used to - compare to actual count -* ``getActualCount()`` - return actual calls made with given argument - constraints - -\Mockery\Exception\InvalidOrderException ----------------------------------------- - -The exception class is used when a method is called outside the expected order -set using the ``ordered()`` and ``globally()`` expectation modifiers. It -offers the following methods: - -* ``getMock()`` - return actual mock object -* ``getMockName()`` - return the name of the mock object -* ``getMethodName()`` - return the name of the method the failing expectation - is attached to -* ``getExpectedOrder()`` - returns an integer represented the expected index - for which this call was expected -* ``getActualOrder()`` - return the actual index at which this method call - occurred. - -\Mockery\Exception\NoMatchingExpectationException -------------------------------------------------- - -The exception class is used when a method call does not match any known -expectation. All expectations are uniquely identified in a mock object by the -method name and the list of expected arguments. You can disable this exception -and opt for returning NULL from all unexpected method calls by using the -earlier mentioned shouldIgnoreMissing() behaviour modifier. This exception -class offers the following methods: - -* ``getMock()`` - return actual mock object -* ``getMockName()`` - return the name of the mock object -* ``getMethodName()`` - return the name of the method the failing expectation - is attached to -* ``getActualArguments()`` - return actual arguments used to search for a - matching expectation diff --git a/vendor/mockery/mockery/docs/mockery/gotchas.rst b/vendor/mockery/mockery/docs/mockery/gotchas.rst deleted file mode 100644 index 92c566dd..00000000 --- a/vendor/mockery/mockery/docs/mockery/gotchas.rst +++ /dev/null @@ -1,44 +0,0 @@ -.. index:: - single: Mockery; Gotchas - -Gotchas! -======== - -Mocking objects in PHP has its limitations and gotchas. Some functionality -can't be mocked or can't be mocked YET! If you locate such a circumstance, -please please (pretty please with sugar on top) create a new issue on GitHub -so it can be documented and resolved where possible. Here is a list to note: - -1. Classes containing public ``__wakeup()`` methods can be mocked but the - mocked ``__wakeup()`` method will perform no actions and cannot have - expectations set for it. This is necessary since Mockery must serialize and - unserialize objects to avoid some ``__construct()`` insanity and attempting - to mock a ``__wakeup()`` method as normal leads to a - ``BadMethodCallException`` being thrown. - -2. Mockery has two scenarios where real classes are replaced: Instance mocks - and alias mocks. Both will generate PHP fatal errors if the real class is - loaded, usually via a require or include statement. Only use these two mock - types where autoloading is in place and where classes are not explicitly - loaded on a per-file basis using ``require()``, ``require_once()``, etc. - -3. Internal PHP classes are not entirely capable of being fully analysed using - ``Reflection``. For example, ``Reflection`` cannot reveal details of - expected parameters to the methods of such internal classes. As a result, - there will be problems where a method parameter is defined to accept a - value by reference (Mockery cannot detect this condition and will assume a - pass by value on scalars and arrays). If references as internal class - method parameters are needed, you should use the - ``\Mockery\Configuration::setInternalClassMethodParamMap()`` method. - Note, however that internal class parameter overriding is not available in - PHP 8 since incompatible signatures have been reclassified as fatal errors. - -4. Creating a mock implementing a certain interface with incorrect case in the - interface name, and then creating a second mock implementing the same - interface, but this time with the correct case, will have undefined behavior - due to PHP's ``class_exists`` and related functions being case insensitive. - Using the ``::class`` keyword in PHP can help you avoid these mistakes. - -The gotchas noted above are largely down to PHP's architecture and are assumed -to be unavoidable. But - if you figure out a solution (or a better one than -what may exist), let us know! diff --git a/vendor/mockery/mockery/docs/mockery/index.rst b/vendor/mockery/mockery/docs/mockery/index.rst deleted file mode 100644 index b698d6cb..00000000 --- a/vendor/mockery/mockery/docs/mockery/index.rst +++ /dev/null @@ -1,12 +0,0 @@ -Mockery -======= - -.. toctree:: - :hidden: - - configuration - exceptions - reserved_method_names - gotchas - -.. include:: map.rst.inc diff --git a/vendor/mockery/mockery/docs/mockery/map.rst.inc b/vendor/mockery/mockery/docs/mockery/map.rst.inc deleted file mode 100644 index 46ffa975..00000000 --- a/vendor/mockery/mockery/docs/mockery/map.rst.inc +++ /dev/null @@ -1,4 +0,0 @@ -* :doc:`/mockery/configuration` -* :doc:`/mockery/exceptions` -* :doc:`/mockery/reserved_method_names` -* :doc:`/mockery/gotchas` diff --git a/vendor/mockery/mockery/docs/mockery/reserved_method_names.rst b/vendor/mockery/mockery/docs/mockery/reserved_method_names.rst deleted file mode 100644 index 5ad58d40..00000000 --- a/vendor/mockery/mockery/docs/mockery/reserved_method_names.rst +++ /dev/null @@ -1,33 +0,0 @@ -.. index:: - single: Reserved Method Names - -Reserved Method Names -===================== - -As you may have noticed, Mockery uses a number of methods called directly on -all mock objects, for example ``shouldReceive()``. Such methods are necessary -in order to setup expectations on the given mock, and so they cannot be -implemented on the classes or objects being mocked without creating a method -name collision (reported as a PHP fatal error). The methods reserved by -Mockery are: - -* ``shouldReceive()`` -* ``shouldNotReceive()`` -* ``allows()`` -* ``expects()`` -* ``shouldAllowMockingMethod()`` -* ``shouldIgnoreMissing()`` -* ``asUndefined()`` -* ``shouldAllowMockingProtectedMethods()`` -* ``makePartial()`` -* ``byDefault()`` -* ``shouldHaveReceived()`` -* ``shouldHaveBeenCalled()`` -* ``shouldNotHaveReceived()`` -* ``shouldNotHaveBeenCalled()`` - - -In addition, all mocks utilise a set of added methods and protected properties -which cannot exist on the class or object being mocked. These are far less -likely to cause collisions. All properties are prefixed with ``_mockery`` and -all method names with ``mockery_``. diff --git a/vendor/mockery/mockery/docs/reference/alternative_should_receive_syntax.rst b/vendor/mockery/mockery/docs/reference/alternative_should_receive_syntax.rst deleted file mode 100644 index 78c1e83c..00000000 --- a/vendor/mockery/mockery/docs/reference/alternative_should_receive_syntax.rst +++ /dev/null @@ -1,91 +0,0 @@ -.. index:: - single: Alternative shouldReceive Syntax - -Alternative shouldReceive Syntax -================================ - -As of Mockery 1.0.0, we support calling methods as we would call any PHP method, -and not as string arguments to Mockery ``should*`` methods. - -The two Mockery methods that enable this are ``allows()`` and ``expects()``. - -Allows ------- - -We use ``allows()`` when we create stubs for methods that return a predefined -return value, but for these method stubs we don't care how many times, or if at -all, were they called. - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->allows([ - 'name_of_method_1' => 'return value', - 'name_of_method_2' => 'return value', - ]); - -This is equivalent with the following ``shouldReceive`` syntax: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive([ - 'name_of_method_1' => 'return value', - 'name_of_method_2' => 'return value', - ]); - -Note that with this format, we also tell Mockery that we don't care about the -arguments to the stubbed methods. - -If we do care about the arguments, we would do it like so: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->allows() - ->name_of_method_1($arg1) - ->andReturn('return value'); - -This is equivalent with the following ``shouldReceive`` syntax: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method_1') - ->with($arg1) - ->andReturn('return value'); - -Expects -------- - -We use ``expects()`` when we want to verify that a particular method was called: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->expects() - ->name_of_method_1($arg1) - ->andReturn('return value'); - -This is equivalent with the following ``shouldReceive`` syntax: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method_1') - ->once() - ->with($arg1) - ->andReturn('return value'); - -By default ``expects()`` sets up an expectation that the method should be called -once and once only. If we expect more than one call to the method, we can change -that expectation: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->expects() - ->name_of_method_1($arg1) - ->twice() - ->andReturn('return value'); - diff --git a/vendor/mockery/mockery/docs/reference/argument_validation.rst b/vendor/mockery/mockery/docs/reference/argument_validation.rst deleted file mode 100644 index 9351ce40..00000000 --- a/vendor/mockery/mockery/docs/reference/argument_validation.rst +++ /dev/null @@ -1,338 +0,0 @@ -.. index:: - single: Argument Validation - -Argument Validation -=================== - -The arguments passed to the ``with()`` declaration when setting up an -expectation determine the criteria for matching method calls to expectations. -Thus, we can setup up many expectations for a single method, each -differentiated by the expected arguments. Such argument matching is done on a -"best fit" basis. This ensures explicit matches take precedence over -generalised matches. - -An explicit match is merely where the expected argument and the actual -argument are easily equated (i.e. using ``===`` or ``==``). More generalised -matches are possible using regular expressions, class hinting and the -available generic matchers. The purpose of generalised matchers is to allow -arguments be defined in non-explicit terms, e.g. ``Mockery::any()`` passed to -``with()`` will match **any** argument in that position. - -Mockery's generic matchers do not cover all possibilities but offers optional -support for the Hamcrest library of matchers. Hamcrest is a PHP port of the -similarly named Java library (which has been ported also to Python, Erlang, -etc). By using Hamcrest, Mockery does not need to duplicate Hamcrest's already -impressive utility which itself promotes a natural English DSL. - -The examples below show Mockery matchers and their Hamcrest equivalent, if there -is one. Hamcrest uses functions (no namespacing). - -.. note:: - - If you don't wish to use the global Hamcrest functions, they are all exposed - through the ``\Hamcrest\Matchers`` class as well, as static methods. Thus, - ``identicalTo($arg)`` is the same as ``\Hamcrest\Matchers::identicalTo($arg)`` - -The most common matcher is the ``with()`` matcher: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('foo') - ->with(1): - -It tells mockery that it should receive a call to the ``foo`` method with the -integer ``1`` as an argument. In cases like this, Mockery first tries to match -the arguments using ``===`` (identical) comparison operator. If the argument is -a primitive, and if it fails the identical comparison, Mockery does a fallback -to the ``==`` (equals) comparison operator. - -When matching objects as arguments, Mockery only does the strict ``===`` -comparison, which means only the same ``$object`` will match: - -.. code-block:: php - - $object = new stdClass(); - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive("foo") - ->with($object); - - // Hamcrest equivalent - $mock->shouldReceive("foo") - ->with(identicalTo($object)); - -A different instance of ``stdClass`` will **not** match. - -.. note:: - - The ``Mockery\Matcher\MustBe`` matcher has been deprecated. - -If we need a loose comparison of objects, we can do that using Hamcrest's -``equalTo`` matcher: - -.. code-block:: php - - $mock->shouldReceive("foo") - ->with(equalTo(new stdClass)); - -In cases when we don't care about the type, or the value of an argument, just -that any argument is present, we use ``any()``: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive("foo") - ->with(\Mockery::any()); - - // Hamcrest equivalent - $mock->shouldReceive("foo") - ->with(anything()) - -Anything and everything passed in this argument slot is passed unconstrained. - -Validating Types and Resources ------------------------------- - -The ``type()`` matcher accepts any string which can be attached to ``is_`` to -form a valid type check. - -To match any PHP resource, we could do the following: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive("foo") - ->with(\Mockery::type('resource')); - - // Hamcrest equivalents - $mock->shouldReceive("foo") - ->with(resourceValue()); - $mock->shouldReceive("foo") - ->with(typeOf('resource')); - -It will return a ``true`` from an ``is_resource()`` call, if the provided -argument to the method is a PHP resource. For example, ``\Mockery::type('float')`` -or Hamcrest's ``floatValue()`` and ``typeOf('float')`` checks use ``is_float()``, -and ``\Mockery::type('callable')`` or Hamcrest's ``callable()`` uses -``is_callable()``. - -The ``type()`` matcher also accepts a class or interface name to be used in an -``instanceof`` evaluation of the actual argument. Hamcrest uses ``anInstanceOf()``. - -A full list of the type checkers is available at -`php.net <http://www.php.net/manual/en/ref.var.php>`_ or browse Hamcrest's function -list in -`the Hamcrest code <https://github.com/hamcrest/hamcrest-php/blob/master/hamcrest/Hamcrest.php>`_. - -.. _argument-validation-complex-argument-validation: - -Complex Argument Validation ---------------------------- - -If we want to perform a complex argument validation, the ``on()`` matcher is -invaluable. It accepts a closure (anonymous function) to which the actual -argument will be passed. - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive("foo") - ->with(\Mockery::on(closure)); - -If the closure evaluates to (i.e. returns) boolean ``true`` then the argument is -assumed to have matched the expectation. - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - - $mock->shouldReceive('foo') - ->with(\Mockery::on(function ($argument) { - if ($argument % 2 == 0) { - return true; - } - return false; - })); - - $mock->foo(4); // matches the expectation - $mock->foo(3); // throws a NoMatchingExpectationException - -.. note:: - - There is no Hamcrest version of the ``on()`` matcher. - -We can also perform argument validation by passing a closure to ``withArgs()`` -method. The closure will receive all arguments passed in the call to the expected -method and if it evaluates (i.e. returns) to boolean ``true``, then the list of -arguments is assumed to have matched the expectation: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive("foo") - ->withArgs(closure); - -The closure can also handle optional parameters, so if an optional parameter is -missing in the call to the expected method, it doesn't necessary means that the -list of arguments doesn't match the expectation. - -.. code-block:: php - - $closure = function ($odd, $even, $sum = null) { - $result = ($odd % 2 != 0) && ($even % 2 == 0); - if (!is_null($sum)) { - return $result && ($odd + $even == $sum); - } - return $result; - }; - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('foo')->withArgs($closure); - - $mock->foo(1, 2); // It matches the expectation: the optional argument is not needed - $mock->foo(1, 2, 3); // It also matches the expectation: the optional argument pass the validation - $mock->foo(1, 2, 4); // It doesn't match the expectation: the optional doesn't pass the validation - -.. note:: - - In previous versions, Mockery's ``with()`` would attempt to do a pattern - matching against the arguments, attempting to use the argument as a - regular expression. Over time this proved to be not such a great idea, so - we removed this functionality, and have introduced ``Mockery::pattern()`` - instead. - -If we would like to match an argument against a regular expression, we can use -the ``\Mockery::pattern()``: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('foo') - ->with(\Mockery::pattern('/^foo/')); - - // Hamcrest equivalent - $mock->shouldReceive('foo') - ->with(matchesPattern('/^foo/')); - -The ``ducktype()`` matcher is an alternative to matching by class type: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('foo') - ->with(\Mockery::ducktype('foo', 'bar')); - -It matches any argument which is an object containing the provided list of -methods to call. - -.. note:: - - There is no Hamcrest version of the ``ducktype()`` matcher. - -Capturing Arguments -------------------- - -If we want to perform multiple validations on a single argument, the ``capture`` -matcher provides a streamlined alternative to using the ``on()`` matcher. -It accepts a variable which the actual argument will be assigned. - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive("foo") - ->with(\Mockery::capture($bar)); - -This will assign *any* argument passed to ``foo`` to the local ``$bar`` variable to -then perform additional validation using assertions. - -.. note:: - - The ``capture`` matcher always evaluates to ``true``. As such, we should always - perform additional argument validation. - -Additional Argument Matchers ----------------------------- - -The ``not()`` matcher matches any argument which is not equal or identical to -the matcher's parameter: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('foo') - ->with(\Mockery::not(2)); - - // Hamcrest equivalent - $mock->shouldReceive('foo') - ->with(not(2)); - -``anyOf()`` matches any argument which equals any one of the given parameters: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('foo') - ->with(\Mockery::anyOf(1, 2)); - - // Hamcrest equivalent - $mock->shouldReceive('foo') - ->with(anyOf(1,2)); - -``notAnyOf()`` matches any argument which is not equal or identical to any of -the given parameters: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('foo') - ->with(\Mockery::notAnyOf(1, 2)); - -.. note:: - - There is no Hamcrest version of the ``notAnyOf()`` matcher. - -``subset()`` matches any argument which is any array containing the given array -subset: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('foo') - ->with(\Mockery::subset(array(0 => 'foo'))); - -This enforces both key naming and values, i.e. both the key and value of each -actual element is compared. - -.. note:: - - There is no Hamcrest version of this functionality, though Hamcrest can check - a single entry using ``hasEntry()`` or ``hasKeyValuePair()``. - -``contains()`` matches any argument which is an array containing the listed -values: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('foo') - ->with(\Mockery::contains(value1, value2)); - -The naming of keys is ignored. - -``hasKey()`` matches any argument which is an array containing the given key -name: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('foo') - ->with(\Mockery::hasKey(key)); - -``hasValue()`` matches any argument which is an array containing the given -value: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('foo') - ->with(\Mockery::hasValue(value)); diff --git a/vendor/mockery/mockery/docs/reference/creating_test_doubles.rst b/vendor/mockery/mockery/docs/reference/creating_test_doubles.rst deleted file mode 100644 index 6f8f8c3f..00000000 --- a/vendor/mockery/mockery/docs/reference/creating_test_doubles.rst +++ /dev/null @@ -1,435 +0,0 @@ -.. index:: - single: Reference; Creating Test Doubles - -Creating Test Doubles -===================== - -Mockery's main goal is to help us create test doubles. It can create stubs, -mocks, and spies. - -Stubs and mocks are created the same. The difference between the two is that a -stub only returns a preset result when called, while a mock needs to have -expectations set on the method calls it expects to receive. - -Spies are a type of test doubles that keep track of the calls they received, and -allow us to inspect these calls after the fact. - -When creating a test double object, we can pass in an identifier as a name for -our test double. If we pass it no identifier, the test double name will be -unknown. Furthermore, the identifier does not have to be a class name. It is a -good practice, and our recommendation, to always name the test doubles with the -same name as the underlying class we are creating test doubles for. - -If the identifier we use for our test double is a name of an existing class, -the test double will inherit the type of the class (via inheritance), i.e. the -mock object will pass type hints or ``instanceof`` evaluations for the existing -class. This is useful when a test double must be of a specific type, to satisfy -the expectations our code has. - -Stubs and mocks ---------------- - -Stubs and mocks are created by calling the ``\Mockery::mock()`` method. The -following example shows how to create a stub, or a mock, object named "foo": - -.. code-block:: php - - $mock = \Mockery::mock('foo'); - -The mock object created like this is the loosest form of mocks possible, and is -an instance of ``\Mockery\MockInterface``. - -.. note:: - - All test doubles created with Mockery are an instance of - ``\Mockery\MockInterface``, regardless are they a stub, mock or a spy. - -To create a stub or a mock object with no name, we can call the ``mock()`` -method with no parameters: - -.. code-block:: php - - $mock = \Mockery::mock(); - -As we stated earlier, we don't recommend creating stub or mock objects without -a name. - -Classes, abstracts, interfaces -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -The recommended way to create a stub or a mock object is by using a name of -an existing class we want to create a test double of: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - -This stub or mock object will have the type of ``MyClass``, through inheritance. - -Stub or mock objects can be based on any concrete class, abstract class or even -an interface. The primary purpose is to ensure the mock object inherits a -specific type for type hinting. - -.. code-block:: php - - $mock = \Mockery::mock('MyInterface'); - -This stub or mock object will implement the ``MyInterface`` interface. - -.. note:: - - Classes marked final, or classes that have methods marked final cannot be - mocked fully. Mockery supports creating partial mocks for these cases. - Partial mocks will be explained later in the documentation. - -Mockery also supports creating stub or mock objects based on a single existing -class, which must implement one or more interfaces. We can do this by providing -a comma-separated list of the class and interfaces as the first argument to the -``\Mockery::mock()`` method: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass, MyInterface, OtherInterface'); - -This stub or mock object will now be of type ``MyClass`` and implement the -``MyInterface`` and ``OtherInterface`` interfaces. - -.. note:: - - The class name doesn't need to be the first member of the list but it's a - friendly convention to use for readability. - -We can tell a mock to implement the desired interfaces by passing the list of -interfaces as the second argument: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass', 'MyInterface, OtherInterface'); - -For all intents and purposes, this is the same as the previous example. - -Spies ------ - -The third type of test doubles Mockery supports are spies. The main difference -between spies and mock objects is that with spies we verify the calls made -against our test double after the calls were made. We would use a spy when we -don't necessarily care about all of the calls that are going to be made to an -object. - -A spy will return ``null`` for all method calls it receives. It is not possible -to tell a spy what will be the return value of a method call. If we do that, then -we would deal with a mock object, and not with a spy. - -We create a spy by calling the ``\Mockery::spy()`` method: - -.. code-block:: php - - $spy = \Mockery::spy('MyClass'); - -Just as with stubs or mocks, we can tell Mockery to base a spy on any concrete -or abstract class, or to implement any number of interfaces: - -.. code-block:: php - - $spy = \Mockery::spy('MyClass, MyInterface, OtherInterface'); - -This spy will now be of type ``MyClass`` and implement the ``MyInterface`` and -``OtherInterface`` interfaces. - -.. note:: - - The ``\Mockery::spy()`` method call is actually a shorthand for calling - ``\Mockery::mock()->shouldIgnoreMissing()``. The ``shouldIgnoreMissing`` - method is a "behaviour modifier". We'll discuss them a bit later. - -Mocks vs. Spies ---------------- - -Let's try and illustrate the difference between mocks and spies with the -following example: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $spy = \Mockery::spy('MyClass'); - - $mock->shouldReceive('foo')->andReturn(42); - - $mockResult = $mock->foo(); - $spyResult = $spy->foo(); - - $spy->shouldHaveReceived()->foo(); - - var_dump($mockResult); // int(42) - var_dump($spyResult); // null - -As we can see from this example, with a mock object we set the call expectations -before the call itself, and we get the return result we expect it to return. -With a spy object on the other hand, we verify the call has happened after the -fact. The return result of a method call against a spy is always ``null``. - -We also have a dedicated chapter to :doc:`spies` only. - -.. _creating-test-doubles-partial-test-doubles: - -Partial Test Doubles --------------------- - -Partial doubles are useful when we want to stub out, set expectations for, or -spy on *some* methods of a class, but run the actual code for other methods. - -We differentiate between three types of partial test doubles: - - * runtime partial test doubles, - * generated partial test doubles, and - * proxied partial test doubles. - -Runtime partial test doubles -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -What we call a runtime partial, involves creating a test double and then telling -it to make itself partial. Any method calls that the double hasn't been told to -allow or expect, will act as they would on a normal instance of the object. - -.. code-block:: php - - class Foo { - function foo() { return 123; } - function bar() { return $this->foo(); } - } - - $foo = mock(Foo::class)->makePartial(); - $foo->foo(); // int(123); - -We can then tell the test double to allow or expect calls as with any other -Mockery double. - -.. code-block:: php - - $foo->shouldReceive('foo')->andReturn(456); - $foo->bar(); // int(456) - -See the cookbook entry on :doc:`../cookbook/big_parent_class` for an example -usage of runtime partial test doubles. - -Generated partial test doubles -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -The second type of partial double we can create is what we call a generated -partial. With generated partials, we specifically tell Mockery which methods -we want to be able to allow or expect calls to. All other methods will run the -actual code *directly*, so stubs and expectations on these methods will not -work. - -.. code-block:: php - - class Foo { - function foo() { return 123; } - function bar() { return $this->foo(); } - } - - $foo = mock("Foo[foo]"); - - $foo->foo(); // error, no expectation set - - $foo->shouldReceive('foo')->andReturn(456); - $foo->foo(); // int(456) - - // setting an expectation for this has no effect - $foo->shouldReceive('bar')->andReturn(999); - $foo->bar(); // int(456) - -It's also possible to specify explicitly which methods to run directly using -the `!method` syntax: - -.. code-block:: php - - class Foo { - function foo() { return 123; } - function bar() { return $this->foo(); } - } - - $foo = mock("Foo[!foo]"); - - $foo->foo(); // int(123) - - $foo->bar(); // error, no expectation set - -.. note:: - - Even though we support generated partial test doubles, we do not recommend - using them. - - One of the reasons why is because a generated partial will call the original - constructor of the mocked class. This can have unwanted side-effects during - testing application code. - - See :doc:`../cookbook/not_calling_the_constructor` for more details. - -Proxied partial test doubles -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -A proxied partial mock is a partial of last resort. We may encounter a class -which is simply not capable of being mocked because it has been marked as -final. Similarly, we may find a class with methods marked as final. In such a -scenario, we cannot simply extend the class and override methods to mock - we -need to get creative. - -.. code-block:: php - - $mock = \Mockery::mock(new MyClass); - -Yes, the new mock is a Proxy. It intercepts calls and reroutes them to the -proxied object (which we construct and pass in) for methods which are not -subject to any expectations. Indirectly, this allows us to mock methods -marked final since the Proxy is not subject to those limitations. The tradeoff -should be obvious - a proxied partial will fail any typehint checks for the -class being mocked since it cannot extend that class. - -.. _creating-test-doubles-aliasing: - -Aliasing --------- - -Prefixing the valid name of a class (which is NOT currently loaded) with -"alias:" will generate an "alias mock". Alias mocks create a class alias with -the given classname to stdClass and are generally used to enable the mocking -of public static methods. Expectations set on the new mock object which refer -to static methods will be used by all static calls to this class. - -.. code-block:: php - - $mock = \Mockery::mock('alias:MyClass'); - - -.. note:: - - Even though aliasing classes is supported, we do not recommend it. - -Overloading ------------ - -Prefixing the valid name of a class (which is NOT currently loaded) with -"overload:" will generate an alias mock (as with "alias:") except that created -new instances of that class will import any expectations set on the origin -mock (``$mock``). The origin mock is never verified since it's used an -expectation store for new instances. For this purpose we use the term "instance -mock" to differentiate it from the simpler "alias mock". - -In other words, an instance mock will "intercept" when a new instance of the -mocked class is created, then the mock will be used instead. This is useful -especially when mocking hard dependencies which will be discussed later. - -.. code-block:: php - - $mock = \Mockery::mock('overload:MyClass'); - -.. note:: - - Using alias/instance mocks across more than one test will generate a fatal - error since we can't have two classes of the same name. To avoid this, - run each test of this kind in a separate PHP process (which is supported - out of the box by both PHPUnit and PHPT). - - -.. _creating-test-doubles-named-mocks: - -Named Mocks ------------ - -The ``namedMock()`` method will generate a class called by the first argument, -so in this example ``MyClassName``. The rest of the arguments are treated in the -same way as the ``mock`` method: - -.. code-block:: php - - $mock = \Mockery::namedMock('MyClassName', 'DateTime'); - -This example would create a class called ``MyClassName`` that extends -``DateTime``. - -Named mocks are quite an edge case, but they can be useful when code depends -on the ``__CLASS__`` magic constant, or when we need two derivatives of an -abstract type, that are actually different classes. - -See the cookbook entry on :doc:`../cookbook/class_constants` for an example -usage of named mocks. - -.. note:: - - We can only create a named mock once, any subsequent calls to - ``namedMock``, with different arguments are likely to cause exceptions. - -.. _creating-test-doubles-constructor-arguments: - -Constructor Arguments ---------------------- - -Sometimes the mocked class has required constructor arguments. We can pass these -to Mockery as an indexed array, as the 2nd argument: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass', [$constructorArg1, $constructorArg2]); - -or if we need the ``MyClass`` to implement an interface as well, as the 3rd -argument: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass', 'MyInterface', [$constructorArg1, $constructorArg2]); - -Mockery now knows to pass in ``$constructorArg1`` and ``$constructorArg2`` as -arguments to the constructor. - -.. _creating-test-doubles-behavior-modifiers: - -Behavior Modifiers ------------------- - -When creating a mock object, we may wish to use some commonly preferred -behaviours that are not the default in Mockery. - -The use of the ``shouldIgnoreMissing()`` behaviour modifier will label this -mock object as a Passive Mock: - -.. code-block:: php - - \Mockery::mock('MyClass')->shouldIgnoreMissing(); - -In such a mock object, calls to methods which are not covered by expectations -will return ``null`` instead of the usual error about there being no expectation -matching the call. - -On PHP >= 7.0.0, methods with missing expectations that have a return type -will return either a mock of the object (if return type is a class) or a -"falsy" primitive value, e.g. empty string, empty array, zero for ints and -floats, false for bools, or empty closures. - -On PHP >= 7.1.0, methods with missing expectations and nullable return type -will return null. - -We can optionally prefer to return an object of type ``\Mockery\Undefined`` -(i.e. a ``null`` object) (which was the 0.7.2 behaviour) by using an -additional modifier: - -.. code-block:: php - - \Mockery::mock('MyClass')->shouldIgnoreMissing()->asUndefined(); - -The returned object is nothing more than a placeholder so if, by some act of -fate, it's erroneously used somewhere it shouldn't it will likely not pass a -logic check. - -We have encountered the ``makePartial()`` method before, as it is the method we -use to create runtime partial test doubles: - -.. code-block:: php - - \Mockery::mock('MyClass')->makePartial(); - -This form of mock object will defer all methods not subject to an expectation to -the parent class of the mock, i.e. ``MyClass``. Whereas the previous -``shouldIgnoreMissing()`` returned ``null``, this behaviour simply calls the -parent's matching method. diff --git a/vendor/mockery/mockery/docs/reference/demeter_chains.rst b/vendor/mockery/mockery/docs/reference/demeter_chains.rst deleted file mode 100644 index 1dad5eff..00000000 --- a/vendor/mockery/mockery/docs/reference/demeter_chains.rst +++ /dev/null @@ -1,38 +0,0 @@ -.. index:: - single: Mocking; Demeter Chains - -Mocking Demeter Chains And Fluent Interfaces -============================================ - -Both of these terms refer to the growing practice of invoking statements -similar to: - -.. code-block:: php - - $object->foo()->bar()->zebra()->alpha()->selfDestruct(); - -The long chain of method calls isn't necessarily a bad thing, assuming they -each link back to a local object the calling class knows. As a fun example, -Mockery's long chains (after the first ``shouldReceive()`` method) all call to -the same instance of ``\Mockery\Expectation``. However, sometimes this is not -the case and the chain is constantly crossing object boundaries. - -In either case, mocking such a chain can be a horrible task. To make it easier -Mockery supports demeter chain mocking. Essentially, we shortcut through the -chain and return a defined value from the final call. For example, let's -assume ``selfDestruct()`` returns the string "Ten!" to $object (an instance of -``CaptainsConsole``). Here's how we could mock it. - -.. code-block:: php - - $mock = \Mockery::mock('CaptainsConsole'); - $mock->shouldReceive('foo->bar->zebra->alpha->selfDestruct')->andReturn('Ten!'); - -The above expectation can follow any previously seen format or expectation, -except that the method name is simply the string of all expected chain calls -separated by ``->``. Mockery will automatically setup the chain of expected -calls with its final return values, regardless of whatever intermediary object -might be used in the real implementation. - -Arguments to all members of the chain (except the final call) are ignored in -this process. diff --git a/vendor/mockery/mockery/docs/reference/expectations.rst b/vendor/mockery/mockery/docs/reference/expectations.rst deleted file mode 100644 index 608aaef1..00000000 --- a/vendor/mockery/mockery/docs/reference/expectations.rst +++ /dev/null @@ -1,533 +0,0 @@ -.. index:: - single: Expectations - -Expectation Declarations -======================== - -.. note:: - - In order for our expectations to work we MUST call ``Mockery::close()``, - preferably in a callback method such as ``tearDown`` or ``_after`` - (depending on whether or not we're integrating Mockery with another - framework). This static call cleans up the Mockery container used by the - current test, and run any verification tasks needed for our expectations. - -Once we have created a mock object, we'll often want to start defining how -exactly it should behave (and how it should be called). This is where the -Mockery expectation declarations take over. - -Declaring Method Call Expectations ----------------------------------- - -To tell our test double to expect a call for a method with a given name, we use -the ``shouldReceive`` method: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method'); - -This is the starting expectation upon which all other expectations and -constraints are appended. - -We can declare more than one method call to be expected: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method_1', 'name_of_method_2'); - -All of these will adopt any chained expectations or constraints. - -It is possible to declare the expectations for the method calls, along with -their return values: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive([ - 'name_of_method_1' => 'return value 1', - 'name_of_method_2' => 'return value 2', - ]); - -There's also a shorthand way of setting up method call expectations and their -return values: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass', ['name_of_method_1' => 'return value 1', 'name_of_method_2' => 'return value 2']); - -All of these will adopt any additional chained expectations or constraints. - -We can declare that a test double should not expect a call to the given method -name: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldNotReceive('name_of_method'); - -This method is a convenience method for calling ``shouldReceive()->never()``. - -Declaring Method Argument Expectations --------------------------------------- - -For every method we declare expectation for, we can add constraints that the -defined expectations apply only to the method calls that match the expected -argument list: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->with($arg1, $arg2, ...); - // or - $mock->shouldReceive('name_of_method') - ->withArgs([$arg1, $arg2, ...]); - -We can add a lot more flexibility to argument matching using the built in -matcher classes (see later). For example, ``\Mockery::any()`` matches any -argument passed to that position in the ``with()`` parameter list. Mockery also -allows Hamcrest library matchers - for example, the Hamcrest function -``anything()`` is equivalent to ``\Mockery::any()``. - -It's important to note that this means all expectations attached only apply to -the given method when it is called with these exact arguments: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - - $mock->shouldReceive('foo')->with('Hello'); - - $mock->foo('Goodbye'); // throws a NoMatchingExpectationException - -This allows for setting up differing expectations based on the arguments -provided to expected calls. - -Argument matching with closures -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Instead of providing a built-in matcher for each argument, we can provide a -closure that matches all passed arguments at once: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->withArgs(closure); - -The given closure receives all the arguments passed in the call to the expected -method. In this way, this expectation only applies to method calls where passed -arguments make the closure evaluate to true: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - - $mock->shouldReceive('foo')->withArgs(function ($arg) { - if ($arg % 2 == 0) { - return true; - } - return false; - }); - - $mock->foo(4); // matches the expectation - $mock->foo(3); // throws a NoMatchingExpectationException - -Argument matching with some of given values -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -We can provide expected arguments that match passed arguments when mocked method -is called. - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->withSomeOfArgs(arg1, arg2, arg3, ...); - -The given expected arguments order doesn't matter. -Check if expected values are included or not, but type should be matched: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('foo') - ->withSomeOfArgs(1, 2); - - $mock->foo(1, 2, 3); // matches the expectation - $mock->foo(3, 2, 1); // matches the expectation (passed order doesn't matter) - $mock->foo('1', '2'); // throws a NoMatchingExpectationException (type should be matched) - $mock->foo(3); // throws a NoMatchingExpectationException - -Any, or no arguments -^^^^^^^^^^^^^^^^^^^^ - -We can declare that the expectation matches a method call regardless of what -arguments are passed: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->withAnyArgs(); - -This is set by default unless otherwise specified. - -We can declare that the expectation matches method calls with zero arguments: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->withNoArgs(); - -Declaring Return Value Expectations ------------------------------------ - -For mock objects, we can tell Mockery what return values to return from the -expected method calls. - -For that we can use the ``andReturn()`` method: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->andReturn($value); - -This sets a value to be returned from the expected method call. - -It is possible to set up expectation for multiple return values. By providing -a sequence of return values, we tell Mockery what value to return on every -subsequent call to the method: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->andReturn($value1, $value2, ...) - -The first call will return ``$value1`` and the second call will return ``$value2``. - -If we call the method more times than the number of return values we declared, -Mockery will return the final value for any subsequent method call: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - - $mock->shouldReceive('foo')->andReturn(1, 2, 3); - - $mock->foo(); // int(1) - $mock->foo(); // int(2) - $mock->foo(); // int(3) - $mock->foo(); // int(3) - -The same can be achieved using the alternative syntax: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->andReturnValues([$value1, $value2, ...]) - -It accepts a simple array instead of a list of parameters. The order of return -is determined by the numerical index of the given array with the last array -member being returned on all calls once previous return values are exhausted. - -The following two options are primarily for communication with test readers: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->andReturnNull(); - // or - $mock->shouldReceive('name_of_method') - ->andReturn([null]); - -They mark the mock object method call as returning ``null`` or nothing. - -Sometimes we want to calculate the return results of the method calls, based on -the arguments passed to the method. We can do that with the ``andReturnUsing()`` -method which accepts one or more closure: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->andReturnUsing(closure, ...); - -Closures can be queued by passing them as extra parameters as for ``andReturn()``. - -Occasionally, it can be useful to echo back one of the arguments that a method -is called with. In this case we can use the ``andReturnArg()`` method; the -argument to be returned is specified by its index in the arguments list: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->andReturnArg(1); - -This returns the second argument (index #1) from the list of arguments when the -method is called. - -.. note:: - - We cannot currently mix ``andReturnUsing()`` or ``andReturnArg`` with - ``andReturn()``. - -If we are mocking fluid interfaces, the following method will be helpful: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->andReturnSelf(); - -It sets the return value to the mocked class name. - -Throwing Exceptions -------------------- - -We can tell the method of mock objects to throw exceptions: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->andThrow(new Exception); - -It will throw the given ``Exception`` object when called. - -Rather than an object, we can pass in the ``Exception`` class, message and/or code to -use when throwing an ``Exception`` from the mocked method: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->andThrow('exception_name', 'message', 123456789); - -.. _expectations-setting-public-properties: - -Setting Public Properties -------------------------- - -Used with an expectation so that when a matching method is called, we can cause -a mock object's public property to be set to a specified value, by using -``andSet()`` or ``set()``: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->andSet($property, $value); - // or - $mock->shouldReceive('name_of_method') - ->set($property, $value); - -In cases where we want to call the real method of the class that was mocked and -return its result, the ``passthru()`` method tells the expectation to bypass -a return queue: - -.. code-block:: php - - passthru() - -It allows expectation matching and call count validation to be applied against -real methods while still calling the real class method with the expected -arguments. - -Declaring Call Count Expectations ---------------------------------- - -Besides setting expectations on the arguments of the method calls, and the -return values of those same calls, we can set expectations on how many times -should any method be called. - -When a call count expectation is not met, a -``\Mockery\Expectation\InvalidCountException`` will be thrown. - -.. note:: - - It is absolutely required to call ``\Mockery::close()`` at the end of our - tests, for example in the ``tearDown()`` method of PHPUnit. Otherwise - Mockery will not verify the calls made against our mock objects. - -We can declare that the expected method may be called zero or more times: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->zeroOrMoreTimes(); - -This is the default for all methods unless otherwise set. - -To tell Mockery to expect an exact number of calls to a method, we can use the -following: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->times($n); - -where ``$n`` is the number of times the method should be called. - -A couple of most common cases got their shorthand methods. - -To declare that the expected method must be called one time only: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->once(); - -To declare that the expected method must be called two times: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->twice(); - -To declare that the expected method must never be called: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->never(); - -Call count modifiers -^^^^^^^^^^^^^^^^^^^^ - -The call count expectations can have modifiers set. - -If we want to tell Mockery the minimum number of times a method should be called, -we use ``atLeast()``: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->atLeast() - ->times(3); - -``atLeast()->times(3)`` means the call must be called at least three times -(given matching method args) but never less than three times. - -Similarly, we can tell Mockery the maximum number of times a method should be -called, using ``atMost()``: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->atMost() - ->times(3); - -``atMost()->times(3)`` means the call must be called no more than three times. -If the method gets no calls at all, the expectation will still be met. - -We can also set a range of call counts, using ``between()``: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - $mock->shouldReceive('name_of_method') - ->between($min, $max); - -This is actually identical to using ``atLeast()->times($min)->atMost()->times($max)`` -but is provided as a shorthand. It may be followed by a ``times()`` call with no -parameter to preserve the APIs natural language readability. - -Multiple Calls with Different Expectations -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -If a method is expected to get called multiple times with different arguments -and/or return values we can simply repeat the expectations. The same of course -also works if we expect multiple calls to different methods. - -.. code-block:: php - - $mock = \Mockery::mock('MyClass'); - // Expectations for the 1st call - $mock->shouldReceive('name_of_method'); - ->once() - ->with('arg1') - ->andReturn($value1) - - // 2nd call to same method - ->shouldReceive('name_of_method') - ->once() - ->with('arg2') - ->andReturn($value2) - - // final call to another method - ->shouldReceive('other_method') - ->once() - ->with('other') - ->andReturn($value_other); - -Expectation Declaration Utilities ---------------------------------- - -Declares that this method is expected to be called in a specific order in -relation to similarly marked methods. - -.. code-block:: php - - ordered() - -The order is dictated by the order in which this modifier is actually used when -setting up mocks. - -Declares the method as belonging to an order group (which can be named or -numbered). Methods within a group can be called in any order, but the ordered -calls from outside the group are ordered in relation to the group: - -.. code-block:: php - - ordered(group) - -We can set up so that method1 is called before group1 which is in turn called -before method2. - -When called prior to ``ordered()`` or ``ordered(group)``, it declares this -ordering to apply across all mock objects (not just the current mock): - -.. code-block:: php - - globally() - -This allows for dictating order expectations across multiple mocks. - -The ``byDefault()`` marks an expectation as a default. Default expectations are -applied unless a non-default expectation is created: - -.. code-block:: php - - byDefault() - -These later expectations immediately replace the previously defined default. -This is useful so we can setup default mocks in our unit test ``setup()`` and -later tweak them in specific tests as needed. - -Returns the current mock object from an expectation chain: - -.. code-block:: php - - getMock() - -Useful where we prefer to keep mock setups as a single statement, e.g.: - -.. code-block:: php - - $mock = \Mockery::mock('foo')->shouldReceive('foo')->andReturn(1)->getMock(); diff --git a/vendor/mockery/mockery/docs/reference/final_methods_classes.rst b/vendor/mockery/mockery/docs/reference/final_methods_classes.rst deleted file mode 100644 index dd0fa5ba..00000000 --- a/vendor/mockery/mockery/docs/reference/final_methods_classes.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. index:: - single: Mocking; Final Classes/Methods - -Dealing with Final Classes/Methods -================================== - -One of the primary restrictions of mock objects in PHP, is that mocking -classes or methods marked final is hard. The final keyword prevents methods so -marked from being replaced in subclasses (subclassing is how mock objects can -inherit the type of the class or object being mocked). - -The simplest solution is to implement an interface in your final class and -typehint against / mock this. - -However this may not be possible in some third party libraries. -Mockery does allow creating "proxy mocks" from classes marked final, or from -classes with methods marked final. This offers all the usual mock object -goodness but the resulting mock will not inherit the class type of the object -being mocked, i.e. it will not pass any instanceof comparison. Methods marked -as final will be proxied to the original method, i.e., final methods can't be -mocked. - -We can create a proxy mock by passing the instantiated object we wish to -mock into ``\Mockery::mock()``, i.e. Mockery will then generate a Proxy to the -real object and selectively intercept method calls for the purposes of setting -and meeting expectations. - -See the :ref:`creating-test-doubles-partial-test-doubles` chapter, the subsection -about proxied partial test doubles. diff --git a/vendor/mockery/mockery/docs/reference/index.rst b/vendor/mockery/mockery/docs/reference/index.rst deleted file mode 100644 index 1e5bf048..00000000 --- a/vendor/mockery/mockery/docs/reference/index.rst +++ /dev/null @@ -1,22 +0,0 @@ -Reference -========= - -.. toctree:: - :hidden: - - creating_test_doubles - expectations - argument_validation - alternative_should_receive_syntax - spies - partial_mocks - protected_methods - public_properties - public_static_properties - pass_by_reference_behaviours - demeter_chains - final_methods_classes - magic_methods - phpunit_integration - -.. include:: map.rst.inc diff --git a/vendor/mockery/mockery/docs/reference/instance_mocking.rst b/vendor/mockery/mockery/docs/reference/instance_mocking.rst deleted file mode 100644 index 9d1aa283..00000000 --- a/vendor/mockery/mockery/docs/reference/instance_mocking.rst +++ /dev/null @@ -1,22 +0,0 @@ -.. index:: - single: Mocking; Instance - -Instance Mocking -================ - -Instance mocking means that a statement like: - -.. code-block:: php - - $obj = new \MyNamespace\Foo; - -...will actually generate a mock object. This is done by replacing the real -class with an instance mock (similar to an alias mock), as with mocking public -methods. The alias will import its expectations from the original mock of -that type (note that the original is never verified and should be ignored -after its expectations are setup). This lets you intercept instantiation where -you can't simply inject a replacement object. - -As before, this does not prevent a require statement from including the real -class and triggering a fatal PHP error. It's intended for use where -autoloading is the primary class loading mechanism. diff --git a/vendor/mockery/mockery/docs/reference/magic_methods.rst b/vendor/mockery/mockery/docs/reference/magic_methods.rst deleted file mode 100644 index 39591cff..00000000 --- a/vendor/mockery/mockery/docs/reference/magic_methods.rst +++ /dev/null @@ -1,16 +0,0 @@ -.. index:: - single: Mocking; Magic Methods - -PHP Magic Methods -================= - -PHP magic methods which are prefixed with a double underscore, e.g. -``__set()``, pose a particular problem in mocking and unit testing in general. -It is strongly recommended that unit tests and mock objects do not directly -refer to magic methods. Instead, refer only to the virtual methods and -properties these magic methods simulate. - -Following this piece of advice will ensure we are testing the real API of -classes and also ensures there is no conflict should Mockery override these -magic methods, which it will inevitably do in order to support its role in -intercepting method calls and properties. diff --git a/vendor/mockery/mockery/docs/reference/map.rst.inc b/vendor/mockery/mockery/docs/reference/map.rst.inc deleted file mode 100644 index 883bc3ca..00000000 --- a/vendor/mockery/mockery/docs/reference/map.rst.inc +++ /dev/null @@ -1,14 +0,0 @@ -* :doc:`/reference/creating_test_doubles` -* :doc:`/reference/expectations` -* :doc:`/reference/argument_validation` -* :doc:`/reference/alternative_should_receive_syntax` -* :doc:`/reference/spies` -* :doc:`/reference/partial_mocks` -* :doc:`/reference/protected_methods` -* :doc:`/reference/public_properties` -* :doc:`/reference/public_static_properties` -* :doc:`/reference/pass_by_reference_behaviours` -* :doc:`/reference/demeter_chains` -* :doc:`/reference/final_methods_classes` -* :doc:`/reference/magic_methods` -* :doc:`/reference/phpunit_integration` diff --git a/vendor/mockery/mockery/docs/reference/partial_mocks.rst b/vendor/mockery/mockery/docs/reference/partial_mocks.rst deleted file mode 100644 index 457eb8de..00000000 --- a/vendor/mockery/mockery/docs/reference/partial_mocks.rst +++ /dev/null @@ -1,108 +0,0 @@ -.. index:: - single: Mocking; Partial Mocks - -Creating Partial Mocks -====================== - -Partial mocks are useful when we only need to mock several methods of an -object leaving the remainder free to respond to calls normally (i.e. as -implemented). Mockery implements three distinct strategies for creating -partials. Each has specific advantages and disadvantages so which strategy we -use will depend on our own preferences and the source code in need of -mocking. - -We have previously talked a bit about :ref:`creating-test-doubles-partial-test-doubles`, -but we'd like to expand on the subject a bit here. - -#. Runtime partial test doubles -#. Generated partial test doubles -#. Proxied Partial Mock - -Runtime partial test doubles ----------------------------- - -A runtime partial test double, also known as a passive partial mock, is a kind -of a default state of being for a mocked object. - -.. code-block:: php - - $mock = \Mockery::mock('MyClass')->makePartial(); - -With a runtime partial, we assume that all methods will simply defer to the -parent class (``MyClass``) original methods unless a method call matches a -known expectation. If we have no matching expectation for a specific method -call, that call is deferred to the class being mocked. Since the division -between mocked and unmocked calls depends entirely on the expectations we -define, there is no need to define which methods to mock in advance. - -See the cookbook entry on :doc:`../cookbook/big_parent_class` for an example -usage of runtime partial test doubles. - -Generated Partial Test Doubles ------------------------------- - -A generated partial test double, also known as a traditional partial mock, -defines ahead of time which methods of a class are to be mocked and which are -to be left unmocked (i.e. callable as normal). The syntax for creating -traditional mocks is: - -.. code-block:: php - - $mock = \Mockery::mock('MyClass[foo,bar]'); - -In the above example, the ``foo()`` and ``bar()`` methods of MyClass will be -mocked but no other MyClass methods are touched. We will need to define -expectations for the ``foo()`` and ``bar()`` methods to dictate their mocked -behaviour. - -Don't forget that we can pass in constructor arguments since unmocked methods -may rely on those! - -.. code-block:: php - - $mock = \Mockery::mock('MyNamespace\MyClass[foo]', array($arg1, $arg2)); - -See the :ref:`creating-test-doubles-constructor-arguments` section to read up -on them. - -.. note:: - - Even though we support generated partial test doubles, we do not recommend - using them. - -Proxied Partial Mock --------------------- - -A proxied partial mock is a partial of last resort. We may encounter a class -which is simply not capable of being mocked because it has been marked as -final. Similarly, we may find a class with methods marked as final. In such a -scenario, we cannot simply extend the class and override methods to mock - we -need to get creative. - -.. code-block:: php - - $mock = \Mockery::mock(new MyClass); - -Yes, the new mock is a Proxy. It intercepts calls and reroutes them to the -proxied object (which we construct and pass in) for methods which are not -subject to any expectations. Indirectly, this allows us to mock methods -marked final since the Proxy is not subject to those limitations. The tradeoff -should be obvious - a proxied partial will fail any typehint checks for the -class being mocked since it cannot extend that class. - -Special Internal Cases ----------------------- - -All mock objects, with the exception of Proxied Partials, allows us to make -any expectation call to the underlying real class method using the ``passthru()`` -expectation call. This will return values from the real call and bypass any -mocked return queue (which can simply be omitted obviously). - -There is a fourth kind of partial mock reserved for internal use. This is -automatically generated when we attempt to mock a class containing methods -marked final. Since we cannot override such methods, they are simply left -unmocked. Typically, we don't need to worry about this but if we really -really must mock a final method, the only possible means is through a Proxied -Partial Mock. SplFileInfo, for example, is a common class subject to this form -of automatic internal partial since it contains public final methods used -internally. diff --git a/vendor/mockery/mockery/docs/reference/pass_by_reference_behaviours.rst b/vendor/mockery/mockery/docs/reference/pass_by_reference_behaviours.rst deleted file mode 100644 index 5e2e457f..00000000 --- a/vendor/mockery/mockery/docs/reference/pass_by_reference_behaviours.rst +++ /dev/null @@ -1,130 +0,0 @@ -.. index:: - single: Pass-By-Reference Method Parameter Behaviour - -Preserving Pass-By-Reference Method Parameter Behaviour -======================================================= - -PHP Class method may accept parameters by reference. In this case, changes -made to the parameter (a reference to the original variable passed to the -method) are reflected in the original variable. An example: - -.. code-block:: php - - class Foo - { - - public function bar(&$a) - { - $a++; - } - - } - - $baz = 1; - $foo = new Foo; - $foo->bar($baz); - - echo $baz; // will echo the integer 2 - -In the example above, the variable ``$baz`` is passed by reference to -``Foo::bar()`` (notice the ``&`` symbol in front of the parameter?). Any -change ``bar()`` makes to the parameter reference is reflected in the original -variable, ``$baz``. - -Mockery handles references correctly for all methods where it can analyse -the parameter (using ``Reflection``) to see if it is passed by reference. To -mock how a reference is manipulated by the class method, we can use a closure -argument matcher to manipulate it, i.e. ``\Mockery::on()`` - see the -:ref:`argument-validation-complex-argument-validation` chapter. - -There is an exception for internal PHP classes where Mockery cannot analyse -method parameters using ``Reflection`` (a limitation in PHP). To work around -this, we can explicitly declare method parameters for an internal class using -``\Mockery\Configuration::setInternalClassMethodParamMap()``. - -Here's an example using ``MongoCollection::insert()``. ``MongoCollection`` is -an internal class offered by the mongo extension from PECL. Its ``insert()`` -method accepts an array of data as the first parameter, and an optional -options array as the second parameter. The original data array is updated -(i.e. when a ``insert()`` pass-by-reference parameter) to include a new -``_id`` field. We can mock this behaviour using a configured parameter map (to -tell Mockery to expect a pass by reference parameter) and a ``Closure`` -attached to the expected method parameter to be updated. - -Here's a PHPUnit unit test verifying that this pass-by-reference behaviour is -preserved: - -.. code-block:: php - - public function testCanOverrideExpectedParametersOfInternalPHPClassesToPreserveRefs() - { - \Mockery::getConfiguration()->setInternalClassMethodParamMap( - 'MongoCollection', - 'insert', - array('&$data', '$options = array()') - ); - $m = \Mockery::mock('MongoCollection'); - $m->shouldReceive('insert')->with( - \Mockery::on(function(&$data) { - if (!is_array($data)) return false; - $data['_id'] = 123; - return true; - }), - \Mockery::any() - ); - - $data = array('a'=>1,'b'=>2); - $m->insert($data); - - $this->assertTrue(isset($data['_id'])); - $this->assertEquals(123, $data['_id']); - - \Mockery::resetContainer(); - } - -Protected Methods ------------------ - -When dealing with protected methods, and trying to preserve pass by reference -behavior for them, a different approach is required. - -.. code-block:: php - - class Model - { - public function test(&$data) - { - return $this->doTest($data); - } - - protected function doTest(&$data) - { - $data['something'] = 'wrong'; - return $this; - } - } - - class Test extends \PHPUnit\Framework\TestCase - { - public function testModel() - { - $mock = \Mockery::mock('Model[test]')->shouldAllowMockingProtectedMethods(); - - $mock->shouldReceive('test') - ->with(\Mockery::on(function(&$data) { - $data['something'] = 'wrong'; - return true; - })); - - $data = array('foo' => 'bar'); - - $mock->test($data); - $this->assertTrue(isset($data['something'])); - $this->assertEquals('wrong', $data['something']); - } - } - -This is quite an edge case, so we need to change the original code a little bit, -by creating a public method that will call our protected method, and then mock -that, instead of the protected method. This new public method will act as a -proxy to our protected method. diff --git a/vendor/mockery/mockery/docs/reference/phpunit_integration.rst b/vendor/mockery/mockery/docs/reference/phpunit_integration.rst deleted file mode 100644 index 669a8ca9..00000000 --- a/vendor/mockery/mockery/docs/reference/phpunit_integration.rst +++ /dev/null @@ -1,145 +0,0 @@ -.. index:: - single: PHPUnit Integration - -PHPUnit Integration -=================== - -Mockery was designed as a simple-to-use *standalone* mock object framework, so -its need for integration with any testing framework is entirely optional. To -integrate Mockery, we need to define a ``tearDown()`` method for our tests -containing the following (we may use a shorter ``\Mockery`` namespace -alias): - -.. code-block:: php - - public function tearDown() { - \Mockery::close(); - } - -This static call cleans up the Mockery container used by the current test, and -run any verification tasks needed for our expectations. - -For some added brevity when it comes to using Mockery, we can also explicitly -use the Mockery namespace with a shorter alias. For example: - -.. code-block:: php - - use \Mockery as m; - - class SimpleTest extends \PHPUnit\Framework\TestCase - { - public function testSimpleMock() { - $mock = m::mock('simplemock'); - $mock->shouldReceive('foo')->with(5, m::any())->once()->andReturn(10); - - $this->assertEquals(10, $mock->foo(5)); - } - - public function tearDown() { - m::close(); - } - } - -Mockery ships with an autoloader so we don't need to litter our tests with -``require_once()`` calls. To use it, ensure Mockery is on our -``include_path`` and add the following to our test suite's ``Bootstrap.php`` -or ``TestHelper.php`` file: - -.. code-block:: php - - require_once 'Mockery/Loader.php'; - require_once 'Hamcrest/Hamcrest.php'; - - $loader = new \Mockery\Loader; - $loader->register(); - -If we are using Composer, we can simplify this to including the Composer -generated autoloader file: - -.. code-block:: php - - require __DIR__ . '/../vendor/autoload.php'; // assuming vendor is one directory up - -.. caution:: - - Prior to Hamcrest 1.0.0, the ``Hamcrest.php`` file name had a small "h" - (i.e. ``hamcrest.php``). If upgrading Hamcrest to 1.0.0 remember to check - the file name is updated for all your projects.) - -To integrate Mockery into PHPUnit and avoid having to call the close method -and have Mockery remove itself from code coverage reports, have your test case -extends the ``\Mockery\Adapter\Phpunit\MockeryTestCase``: - -.. code-block:: php - - class MyTest extends \Mockery\Adapter\Phpunit\MockeryTestCase - { - - } - -An alternative is to use the supplied trait: - -.. code-block:: php - - class MyTest extends \PHPUnit\Framework\TestCase - { - use \Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration; - } - -Extending ``MockeryTestCase`` or using the ``MockeryPHPUnitIntegration`` -trait is **the recommended way** of integrating Mockery with PHPUnit, -since Mockery 1.0.0. - -PHPUnit listener ----------------- - -Before the 1.0.0 release, Mockery provided a PHPUnit listener that would -call ``Mockery::close()`` for us at the end of a test. This has changed -significantly since the 1.0.0 version. - -Now, Mockery provides a PHPUnit listener that makes tests fail if -``Mockery::close()`` has not been called. It can help identify tests where -we've forgotten to include the trait or extend the ``MockeryTestCase``. - -If we are using PHPUnit's XML configuration approach, we can include the -following to load the ``TestListener``: - -.. code-block:: xml - - <listeners> - <listener class="\Mockery\Adapter\Phpunit\TestListener"></listener> - </listeners> - -Make sure Composer's or Mockery's autoloader is present in the bootstrap file -or we will need to also define a "file" attribute pointing to the file of the -``TestListener`` class. - -If we are creating the test suite programmatically we may add the listener -like this: - -.. code-block:: php - - // Create the suite. - $suite = new PHPUnit\Framework\TestSuite(); - - // Create the listener and add it to the suite. - $result = new PHPUnit\Framework\TestResult(); - $result->addListener(new \Mockery\Adapter\Phpunit\TestListener()); - - // Run the tests. - $suite->run($result); - -.. caution:: - - PHPUnit provides a functionality that allows - `tests to run in a separated process <http://phpunit.de/manual/current/en/appendixes.annotations.html#appendixes.annotations.runTestsInSeparateProcesses>`_, - to ensure better isolation. Mockery verifies the mocks expectations using the - ``Mockery::close()`` method, and provides a PHPUnit listener, that automatically - calls this method for us after every test. - - However, this listener is not called in the right process when using - PHPUnit's process isolation, resulting in expectations that might not be - respected, but without raising any ``Mockery\Exception``. To avoid this, - we cannot rely on the supplied Mockery PHPUnit ``TestListener``, and we need - to explicitly call ``Mockery::close``. The easiest solution to include this - call in the ``tearDown()`` method, as explained previously. diff --git a/vendor/mockery/mockery/docs/reference/protected_methods.rst b/vendor/mockery/mockery/docs/reference/protected_methods.rst deleted file mode 100644 index ec4a5bad..00000000 --- a/vendor/mockery/mockery/docs/reference/protected_methods.rst +++ /dev/null @@ -1,26 +0,0 @@ -.. index:: - single: Mocking; Protected Methods - -Mocking Protected Methods -========================= - -By default, Mockery does not allow mocking protected methods. We do not recommend -mocking protected methods, but there are cases when there is no other solution. - -For those cases we have the ``shouldAllowMockingProtectedMethods()`` method. It -instructs Mockery to specifically allow mocking of protected methods, for that -one class only: - -.. code-block:: php - - class MyClass - { - protected function foo() - { - } - } - - $mock = \Mockery::mock('MyClass') - ->shouldAllowMockingProtectedMethods(); - $mock->shouldReceive('foo'); - diff --git a/vendor/mockery/mockery/docs/reference/public_properties.rst b/vendor/mockery/mockery/docs/reference/public_properties.rst deleted file mode 100644 index 31656683..00000000 --- a/vendor/mockery/mockery/docs/reference/public_properties.rst +++ /dev/null @@ -1,20 +0,0 @@ -.. index:: - single: Mocking; Public Properties - -Mocking Public Properties -========================= - -Mockery allows us to mock properties in several ways. One way is that we can set -a public property and its value on any mock object. The second is that we can -use the expectation methods ``set()`` and ``andSet()`` to set property values if -that expectation is ever met. - -You can read more about :ref:`expectations-setting-public-properties`. - -.. note:: - - In general, Mockery does not support mocking any magic methods since these - are generally not considered a public API (and besides it is a bit difficult - to differentiate them when you badly need them for mocking!). So please mock - virtual properties (those relying on ``__get()`` and ``__set()``) as if they - were actually declared on the class. diff --git a/vendor/mockery/mockery/docs/reference/public_static_properties.rst b/vendor/mockery/mockery/docs/reference/public_static_properties.rst deleted file mode 100644 index 2396efc7..00000000 --- a/vendor/mockery/mockery/docs/reference/public_static_properties.rst +++ /dev/null @@ -1,15 +0,0 @@ -.. index:: - single: Mocking; Public Static Methods - -Mocking Public Static Methods -============================= - -Static methods are not called on real objects, so normal mock objects can't -mock them. Mockery supports class aliased mocks, mocks representing a class -name which would normally be loaded (via autoloading or a require statement) -in the system under test. These aliases block that loading (unless via a -require statement - so please use autoloading!) and allow Mockery to intercept -static method calls and add expectations for them. - -See the :ref:`creating-test-doubles-aliasing` section for more information on -creating aliased mocks, for the purpose of mocking public static methods. diff --git a/vendor/mockery/mockery/docs/reference/spies.rst b/vendor/mockery/mockery/docs/reference/spies.rst deleted file mode 100644 index 9a699cbf..00000000 --- a/vendor/mockery/mockery/docs/reference/spies.rst +++ /dev/null @@ -1,154 +0,0 @@ -.. index:: - single: Reference; Spies - -Spies -===== - -Spies are a type of test doubles, but they differ from stubs or mocks in that, -that the spies record any interaction between the spy and the System Under Test -(SUT), and allow us to make assertions against those interactions after the fact. - -Creating a spy means we don't have to set up expectations for every method call -the double might receive during the test, some of which may not be relevant to -the current test. A spy allows us to make assertions about the calls we care -about for this test only, reducing the chances of over-specification and making -our tests more clear. - -Spies also allow us to follow the more familiar Arrange-Act-Assert or -Given-When-Then style within our tests. With mocks, we have to follow a less -familiar style, something along the lines of Arrange-Expect-Act-Assert, where -we have to tell our mocks what to expect before we act on the SUT, then assert -that those expectations where met: - -.. code-block:: php - - // arrange - $mock = \Mockery::mock('MyDependency'); - $sut = new MyClass($mock); - - // expect - $mock->shouldReceive('foo') - ->once() - ->with('bar'); - - // act - $sut->callFoo(); - - // assert - \Mockery::close(); - -Spies allow us to skip the expect part and move the assertion to after we have -acted on the SUT, usually making our tests more readable: - -.. code-block:: php - - // arrange - $spy = \Mockery::spy('MyDependency'); - $sut = new MyClass($spy); - - // act - $sut->callFoo(); - - // assert - $spy->shouldHaveReceived() - ->foo() - ->with('bar'); - -On the other hand, spies are far less restrictive than mocks, meaning tests are -usually less precise, as they let us get away with more. This is usually a -good thing, they should only be as precise as they need to be, but while spies -make our tests more intent-revealing, they do tend to reveal less about the -design of the SUT. If we're having to setup lots of expectations for a mock, -in lots of different tests, our tests are trying to tell us something - the SUT -is doing too much and probably should be refactored. We don't get this with -spies, they simply ignore the calls that aren't relevant to them. - -Another downside to using spies is debugging. When a mock receives a call that -it wasn't expecting, it immediately throws an exception (failing fast), giving -us a nice stack trace or possibly even invoking our debugger. With spies, we're -simply asserting calls were made after the fact, so if the wrong calls were made, -we don't have quite the same just in time context we have with the mocks. - -Finally, if we need to define a return value for our test double, we can't do -that with a spy, only with a mock object. - -.. note:: - - This documentation page is an adaption of the blog post titled - `"Mockery Spies" <https://davedevelopment.co.uk/2014/10/09/mockery-spies.html>`_, - published by Dave Marshall on his blog. Dave is the original author of spies - in Mockery. - -Spies Reference ---------------- - -To verify that a method was called on a spy, we use the ``shouldHaveReceived()`` -method: - -.. code-block:: php - - $spy->shouldHaveReceived('foo'); - -To verify that a method was **not** called on a spy, we use the -``shouldNotHaveReceived()`` method: - -.. code-block:: php - - $spy->shouldNotHaveReceived('foo'); - -We can also do argument matching with spies: - -.. code-block:: php - - $spy->shouldHaveReceived('foo') - ->with('bar'); - -Argument matching is also possible by passing in an array of arguments to -match: - -.. code-block:: php - - $spy->shouldHaveReceived('foo', ['bar']); - -Although when verifying a method was not called, the argument matching can only -be done by supplying the array of arguments as the 2nd argument to the -``shouldNotHaveReceived()`` method: - -.. code-block:: php - - $spy->shouldNotHaveReceived('foo', ['bar']); - -This is due to Mockery's internals. - -Finally, when expecting calls that should have been received, we can also verify -the number of calls: - -.. code-block:: php - - $spy->shouldHaveReceived('foo') - ->with('bar') - ->twice(); - -Alternative shouldReceive syntax -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -As of Mockery 1.0.0, we support calling methods as we would call any PHP method, -and not as string arguments to Mockery ``should*`` methods. - -In cases of spies, this only applies to the ``shouldHaveReceived()`` method: - -.. code-block:: php - - $spy->shouldHaveReceived() - ->foo('bar'); - -We can set expectation on number of calls as well: - -.. code-block:: php - - $spy->shouldHaveReceived() - ->foo('bar') - ->twice(); - -Unfortunately, due to limitations we can't support the same syntax for the -``shouldNotHaveReceived()`` method. diff --git a/vendor/mockery/mockery/library/Mockery.php b/vendor/mockery/mockery/library/Mockery.php deleted file mode 100644 index 95abd1b9..00000000 --- a/vendor/mockery/mockery/library/Mockery.php +++ /dev/null @@ -1,983 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -use Mockery\ClosureWrapper; -use Mockery\ExpectationInterface; -use Mockery\Generator\CachingGenerator; -use Mockery\Generator\Generator; -use Mockery\Generator\MockConfigurationBuilder; -use Mockery\Generator\MockNameBuilder; -use Mockery\Generator\StringManipulationGenerator; -use Mockery\Loader\EvalLoader; -use Mockery\Loader\Loader; -use Mockery\Matcher\MatcherAbstract; -use Mockery\Reflector; - -class Mockery -{ - const BLOCKS = 'Mockery_Forward_Blocks'; - - /** - * Global container to hold all mocks for the current unit test running. - * - * @var \Mockery\Container|null - */ - protected static $_container = null; - - /** - * Global configuration handler containing configuration options. - * - * @var \Mockery\Configuration - */ - protected static $_config = null; - - /** - * @var \Mockery\Generator\Generator - */ - protected static $_generator; - - /** - * @var \Mockery\Loader\Loader - */ - protected static $_loader; - - /** - * @var array - */ - private static $_filesToCleanUp = []; - - /** - * Defines the global helper functions - * - * @return void - */ - public static function globalHelpers() - { - require_once __DIR__ . '/helpers.php'; - } - - /** - * @return array - * - * @deprecated since 1.3.2 and will be removed in 2.0. - */ - public static function builtInTypes() - { - return array( - 'array', - 'bool', - 'callable', - 'float', - 'int', - 'iterable', - 'object', - 'self', - 'string', - 'void', - ); - } - - /** - * @param string $type - * @return bool - * - * @deprecated since 1.3.2 and will be removed in 2.0. - */ - public static function isBuiltInType($type) - { - return in_array($type, \Mockery::builtInTypes()); - } - - /** - * Static shortcut to \Mockery\Container::mock(). - * - * @param mixed ...$args - * - * @return \Mockery\MockInterface|\Mockery\LegacyMockInterface - */ - public static function mock(...$args) - { - return call_user_func_array(array(self::getContainer(), 'mock'), $args); - } - - /** - * Static and semantic shortcut for getting a mock from the container - * and applying the spy's expected behavior into it. - * - * @param mixed ...$args - * - * @return \Mockery\MockInterface|\Mockery\LegacyMockInterface - */ - public static function spy(...$args) - { - if (count($args) && $args[0] instanceof \Closure) { - $args[0] = new ClosureWrapper($args[0]); - } - - return call_user_func_array(array(self::getContainer(), 'mock'), $args)->shouldIgnoreMissing(); - } - - /** - * Static and Semantic shortcut to \Mockery\Container::mock(). - * - * @param mixed ...$args - * - * @return \Mockery\MockInterface|\Mockery\LegacyMockInterface - */ - public static function instanceMock(...$args) - { - return call_user_func_array(array(self::getContainer(), 'mock'), $args); - } - - /** - * Static shortcut to \Mockery\Container::mock(), first argument names the mock. - * - * @param mixed ...$args - * - * @return \Mockery\MockInterface|\Mockery\LegacyMockInterface - */ - public static function namedMock(...$args) - { - $name = array_shift($args); - - $builder = new MockConfigurationBuilder(); - $builder->setName($name); - - array_unshift($args, $builder); - - return call_user_func_array(array(self::getContainer(), 'mock'), $args); - } - - /** - * Static shortcut to \Mockery\Container::self(). - * - * @throws LogicException - * - * @return \Mockery\MockInterface|\Mockery\LegacyMockInterface - */ - public static function self() - { - if (is_null(self::$_container)) { - throw new \LogicException('You have not declared any mocks yet'); - } - - return self::$_container->self(); - } - - /** - * Static shortcut to closing up and verifying all mocks in the global - * container, and resetting the container static variable to null. - * - * @return void - */ - public static function close() - { - foreach (self::$_filesToCleanUp as $fileName) { - @unlink($fileName); - } - self::$_filesToCleanUp = []; - - if (is_null(self::$_container)) { - return; - } - - $container = self::$_container; - self::$_container = null; - - $container->mockery_teardown(); - $container->mockery_close(); - } - - /** - * Static fetching of a mock associated with a name or explicit class poser. - * - * @param string $name - * - * @return \Mockery\Mock - */ - public static function fetchMock($name) - { - return self::getContainer()->fetchMock($name); - } - - /** - * Lazy loader and getter for - * the container property. - * - * @return Mockery\Container - */ - public static function getContainer() - { - if (is_null(self::$_container)) { - self::$_container = new Mockery\Container(self::getGenerator(), self::getLoader()); - } - - return self::$_container; - } - - /** - * Setter for the $_generator static property. - * - * @param \Mockery\Generator\Generator $generator - */ - public static function setGenerator(Generator $generator) - { - self::$_generator = $generator; - } - - /** - * Lazy loader method and getter for - * the generator property. - * - * @return Generator - */ - public static function getGenerator() - { - if (is_null(self::$_generator)) { - self::$_generator = self::getDefaultGenerator(); - } - - return self::$_generator; - } - - /** - * Creates and returns a default generator - * used inside this class. - * - * @return CachingGenerator - */ - public static function getDefaultGenerator() - { - return new CachingGenerator(StringManipulationGenerator::withDefaultPasses()); - } - - /** - * Setter for the $_loader static property. - * - * @param Loader $loader - */ - public static function setLoader(Loader $loader) - { - self::$_loader = $loader; - } - - /** - * Lazy loader method and getter for - * the $_loader property. - * - * @return Loader - */ - public static function getLoader() - { - if (is_null(self::$_loader)) { - self::$_loader = self::getDefaultLoader(); - } - - return self::$_loader; - } - - /** - * Gets an EvalLoader to be used as default. - * - * @return EvalLoader - */ - public static function getDefaultLoader() - { - return new EvalLoader(); - } - - /** - * Set the container. - * - * @param \Mockery\Container $container - * - * @return \Mockery\Container - */ - public static function setContainer(Mockery\Container $container) - { - return self::$_container = $container; - } - - /** - * Reset the container to null. - * - * @return void - */ - public static function resetContainer() - { - self::$_container = null; - } - - /** - * Return instance of ANY matcher. - * - * @return \Mockery\Matcher\Any - */ - public static function any() - { - return new \Mockery\Matcher\Any(); - } - - /** - * Return instance of AndAnyOtherArgs matcher. - * - * An alternative name to `andAnyOtherArgs` so - * the API stays closer to `any` as well. - * - * @return \Mockery\Matcher\AndAnyOtherArgs - */ - public static function andAnyOthers() - { - return new \Mockery\Matcher\AndAnyOtherArgs(); - } - - /** - * Return instance of AndAnyOtherArgs matcher. - * - * @return \Mockery\Matcher\AndAnyOtherArgs - */ - public static function andAnyOtherArgs() - { - return new \Mockery\Matcher\AndAnyOtherArgs(); - } - - /** - * Return instance of TYPE matcher. - * - * @param mixed $expected - * - * @return \Mockery\Matcher\Type - */ - public static function type($expected) - { - return new \Mockery\Matcher\Type($expected); - } - - /** - * Return instance of DUCKTYPE matcher. - * - * @param array ...$args - * - * @return \Mockery\Matcher\Ducktype - */ - public static function ducktype(...$args) - { - return new \Mockery\Matcher\Ducktype($args); - } - - /** - * Return instance of SUBSET matcher. - * - * @param array $part - * @param bool $strict - (Optional) True for strict comparison, false for loose - * - * @return \Mockery\Matcher\Subset - */ - public static function subset(array $part, $strict = true) - { - return new \Mockery\Matcher\Subset($part, $strict); - } - - /** - * Return instance of CONTAINS matcher. - * - * @param mixed $args - * - * @return \Mockery\Matcher\Contains - */ - public static function contains(...$args) - { - return new \Mockery\Matcher\Contains($args); - } - - /** - * Return instance of HASKEY matcher. - * - * @param mixed $key - * - * @return \Mockery\Matcher\HasKey - */ - public static function hasKey($key) - { - return new \Mockery\Matcher\HasKey($key); - } - - /** - * Return instance of HASVALUE matcher. - * - * @param mixed $val - * - * @return \Mockery\Matcher\HasValue - */ - public static function hasValue($val) - { - return new \Mockery\Matcher\HasValue($val); - } - - /** - * Return instance of CLOSURE matcher. - * - * @param $reference - * - * @return \Mockery\Matcher\Closure - */ - public static function capture(&$reference) - { - $closure = function ($argument) use (&$reference) { - $reference = $argument; - return true; - }; - - return new \Mockery\Matcher\Closure($closure); - } - - /** - * Return instance of CLOSURE matcher. - * - * @param mixed $closure - * - * @return \Mockery\Matcher\Closure - */ - public static function on($closure) - { - return new \Mockery\Matcher\Closure($closure); - } - - /** - * Return instance of MUSTBE matcher. - * - * @param mixed $expected - * - * @return \Mockery\Matcher\MustBe - */ - public static function mustBe($expected) - { - return new \Mockery\Matcher\MustBe($expected); - } - - /** - * Return instance of NOT matcher. - * - * @param mixed $expected - * - * @return \Mockery\Matcher\Not - */ - public static function not($expected) - { - return new \Mockery\Matcher\Not($expected); - } - - /** - * Return instance of ANYOF matcher. - * - * @param array ...$args - * - * @return \Mockery\Matcher\AnyOf - */ - public static function anyOf(...$args) - { - return new \Mockery\Matcher\AnyOf($args); - } - - /** - * Return instance of NOTANYOF matcher. - * - * @param array ...$args - * - * @return \Mockery\Matcher\NotAnyOf - */ - public static function notAnyOf(...$args) - { - return new \Mockery\Matcher\NotAnyOf($args); - } - - /** - * Return instance of PATTERN matcher. - * - * @param mixed $expected - * - * @return \Mockery\Matcher\Pattern - */ - public static function pattern($expected) - { - return new \Mockery\Matcher\Pattern($expected); - } - - /** - * Lazy loader and Getter for the global - * configuration container. - * - * @return \Mockery\Configuration - */ - public static function getConfiguration() - { - if (is_null(self::$_config)) { - self::$_config = new \Mockery\Configuration(); - } - - return self::$_config; - } - - /** - * Utility method to format method name and arguments into a string. - * - * @param string $method - * @param array $arguments - * - * @return string - */ - public static function formatArgs($method, array $arguments = null) - { - if (is_null($arguments)) { - return $method . '()'; - } - - $formattedArguments = array(); - foreach ($arguments as $argument) { - $formattedArguments[] = self::formatArgument($argument); - } - - return $method . '(' . implode(', ', $formattedArguments) . ')'; - } - - /** - * Gets the string representation - * of any passed argument. - * - * @param mixed $argument - * @param int $depth - * - * @return mixed - */ - private static function formatArgument($argument, $depth = 0) - { - if ($argument instanceof MatcherAbstract) { - return (string) $argument; - } - - if (is_object($argument)) { - return 'object(' . get_class($argument) . ')'; - } - - if (is_int($argument) || is_float($argument)) { - return $argument; - } - - if (is_array($argument)) { - if ($depth === 1) { - $argument = '[...]'; - } else { - $sample = array(); - foreach ($argument as $key => $value) { - $key = is_int($key) ? $key : "'$key'"; - $value = self::formatArgument($value, $depth + 1); - $sample[] = "$key => $value"; - } - - $argument = "[" . implode(", ", $sample) . "]"; - } - - return ((strlen($argument) > 1000) ? substr($argument, 0, 1000) . '...]' : $argument); - } - - if (is_bool($argument)) { - return $argument ? 'true' : 'false'; - } - - if (is_resource($argument)) { - return 'resource(...)'; - } - - if (is_null($argument)) { - return 'NULL'; - } - - return "'" . (string) $argument . "'"; - } - - /** - * Utility function to format objects to printable arrays. - * - * @param array $objects - * - * @return string - */ - public static function formatObjects(array $objects = null) - { - static $formatting; - - if ($formatting) { - return '[Recursion]'; - } - - if (is_null($objects)) { - return ''; - } - - $objects = array_filter($objects, 'is_object'); - if (empty($objects)) { - return ''; - } - - $formatting = true; - $parts = array(); - - foreach ($objects as $object) { - $parts[get_class($object)] = self::objectToArray($object); - } - - $formatting = false; - - return 'Objects: ( ' . var_export($parts, true) . ')'; - } - - /** - * Utility function to turn public properties and public get* and is* method values into an array. - * - * @param object $object - * @param int $nesting - * - * @return array - */ - private static function objectToArray($object, $nesting = 3) - { - if ($nesting == 0) { - return array('...'); - } - - $defaultFormatter = function ($object, $nesting) { - return array('properties' => self::extractInstancePublicProperties($object, $nesting)); - }; - - $class = get_class($object); - - $formatter = self::getConfiguration()->getObjectFormatter($class, $defaultFormatter); - - $array = array( - 'class' => $class, - 'identity' => '#' . md5(spl_object_hash($object)) - ); - - $array = array_merge($array, $formatter($object, $nesting)); - - return $array; - } - - /** - * Returns all public instance properties. - * - * @param mixed $object - * @param int $nesting - * - * @return array - */ - private static function extractInstancePublicProperties($object, $nesting) - { - $reflection = new \ReflectionClass(get_class($object)); - $properties = $reflection->getProperties(\ReflectionProperty::IS_PUBLIC); - $cleanedProperties = array(); - - foreach ($properties as $publicProperty) { - if (!$publicProperty->isStatic()) { - $name = $publicProperty->getName(); - try { - $cleanedProperties[$name] = self::cleanupNesting($object->$name, $nesting); - } catch (\Exception $exception) { - $cleanedProperties[$name] = $exception->getMessage(); - } - } - } - - return $cleanedProperties; - } - - /** - * Utility method used for recursively generating - * an object or array representation. - * - * @param mixed $argument - * @param int $nesting - * - * @return mixed - */ - private static function cleanupNesting($argument, $nesting) - { - if (is_object($argument)) { - $object = self::objectToArray($argument, $nesting - 1); - $object['class'] = get_class($argument); - - return $object; - } - - if (is_array($argument)) { - return self::cleanupArray($argument, $nesting - 1); - } - - return $argument; - } - - /** - * Utility method for recursively - * gerating a representation - * of the given array. - * - * @param array $argument - * @param int $nesting - * - * @return mixed - */ - private static function cleanupArray($argument, $nesting = 3) - { - if ($nesting == 0) { - return '...'; - } - - foreach ($argument as $key => $value) { - if (is_array($value)) { - $argument[$key] = self::cleanupArray($value, $nesting - 1); - } elseif (is_object($value)) { - $argument[$key] = self::objectToArray($value, $nesting - 1); - } - } - - return $argument; - } - - /** - * Utility function to parse shouldReceive() arguments and generate - * expectations from such as needed. - * - * @param Mockery\LegacyMockInterface $mock - * @param array ...$args - * @param callable $add - * @return \Mockery\CompositeExpectation - */ - public static function parseShouldReturnArgs(\Mockery\LegacyMockInterface $mock, $args, $add) - { - $composite = new \Mockery\CompositeExpectation(); - - foreach ($args as $arg) { - if (is_array($arg)) { - foreach ($arg as $k => $v) { - $expectation = self::buildDemeterChain($mock, $k, $add)->andReturn($v); - $composite->add($expectation); - } - } elseif (is_string($arg)) { - $expectation = self::buildDemeterChain($mock, $arg, $add); - $composite->add($expectation); - } - } - - return $composite; - } - - /** - * Sets up expectations on the members of the CompositeExpectation and - * builds up any demeter chain that was passed to shouldReceive. - * - * @param \Mockery\LegacyMockInterface $mock - * @param string $arg - * @param callable $add - * @throws Mockery\Exception - * @return \Mockery\ExpectationInterface - */ - protected static function buildDemeterChain(\Mockery\LegacyMockInterface $mock, $arg, $add) - { - /** @var Mockery\Container $container */ - $container = $mock->mockery_getContainer(); - $methodNames = explode('->', $arg); - reset($methodNames); - - if (!\Mockery::getConfiguration()->mockingNonExistentMethodsAllowed() - && !$mock->mockery_isAnonymous() - && !in_array(current($methodNames), $mock->mockery_getMockableMethods()) - ) { - throw new \Mockery\Exception( - 'Mockery\'s configuration currently forbids mocking the method ' - . current($methodNames) . ' as it does not exist on the class or object ' - . 'being mocked' - ); - } - - /** @var ExpectationInterface|null $expectations */ - $expectations = null; - - /** @var Callable $nextExp */ - $nextExp = function ($method) use ($add) { - return $add($method); - }; - - $parent = get_class($mock); - - while (true) { - $method = array_shift($methodNames); - $expectations = $mock->mockery_getExpectationsFor($method); - - if (is_null($expectations) || self::noMoreElementsInChain($methodNames)) { - $expectations = $nextExp($method); - if (self::noMoreElementsInChain($methodNames)) { - break; - } - - $mock = self::getNewDemeterMock($container, $parent, $method, $expectations); - } else { - $demeterMockKey = $container->getKeyOfDemeterMockFor($method, $parent); - if ($demeterMockKey) { - $mock = self::getExistingDemeterMock($container, $demeterMockKey); - } - } - - $parent .= '->' . $method; - - $nextExp = function ($n) use ($mock) { - return $mock->shouldReceive($n); - }; - } - - return $expectations; - } - - /** - * Gets a new demeter configured - * mock from the container. - * - * @param \Mockery\Container $container - * @param string $parent - * @param string $method - * @param Mockery\ExpectationInterface $exp - * - * @return \Mockery\Mock - */ - private static function getNewDemeterMock( - Mockery\Container $container, - $parent, - $method, - Mockery\ExpectationInterface $exp - ) { - $newMockName = 'demeter_' . md5($parent) . '_' . $method; - - $parRef = null; - $parRefMethod = null; - $parRefMethodRetType = null; - - $parentMock = $exp->getMock(); - if ($parentMock !== null) { - $parRef = new ReflectionObject($parentMock); - } - - if ($parRef !== null && $parRef->hasMethod($method)) { - $parRefMethod = $parRef->getMethod($method); - $parRefMethodRetType = Reflector::getReturnType($parRefMethod, true); - - if ($parRefMethodRetType !== null && $parRefMethodRetType !== 'mixed') { - $nameBuilder = new MockNameBuilder(); - $nameBuilder->addPart('\\' . $newMockName); - $mock = self::namedMock($nameBuilder->build(), $parRefMethodRetType); - $exp->andReturn($mock); - - return $mock; - } - } - - $mock = $container->mock($newMockName); - $exp->andReturn($mock); - - return $mock; - } - - /** - * Gets an specific demeter mock from - * the ones kept by the container. - * - * @param \Mockery\Container $container - * @param string $demeterMockKey - * - * @return mixed - */ - private static function getExistingDemeterMock( - Mockery\Container $container, - $demeterMockKey - ) { - $mocks = $container->getMocks(); - $mock = $mocks[$demeterMockKey]; - - return $mock; - } - - /** - * Checks if the passed array representing a demeter - * chain with the method names is empty. - * - * @param array $methodNames - * - * @return bool - */ - private static function noMoreElementsInChain(array $methodNames) - { - return empty($methodNames); - } - - public static function declareClass($fqn) - { - return static::declareType($fqn, "class"); - } - - public static function declareInterface($fqn) - { - return static::declareType($fqn, "interface"); - } - - private static function declareType($fqn, $type) - { - $targetCode = "<?php "; - $shortName = $fqn; - - if (strpos($fqn, "\\")) { - $parts = explode("\\", $fqn); - - $shortName = trim(array_pop($parts)); - $namespace = implode("\\", $parts); - - $targetCode.= "namespace $namespace;\n"; - } - - $targetCode.= "$type $shortName {} "; - - /* - * We could eval here, but it doesn't play well with the way - * PHPUnit tries to backup global state and the require definition - * loader - */ - $tmpfname = tempnam(sys_get_temp_dir(), "Mockery"); - file_put_contents($tmpfname, $targetCode); - require $tmpfname; - \Mockery::registerFileForCleanUp($tmpfname); - } - - /** - * Register a file to be deleted on tearDown. - * - * @param string $fileName - */ - public static function registerFileForCleanUp($fileName) - { - self::$_filesToCleanUp[] = $fileName; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryPHPUnitIntegration.php b/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryPHPUnitIntegration.php deleted file mode 100644 index 472f6fbc..00000000 --- a/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryPHPUnitIntegration.php +++ /dev/null @@ -1,90 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Adapter\Phpunit; - -use Mockery; - -/** - * Integrates Mockery into PHPUnit. Ensures Mockery expectations are verified - * for each test and are included by the assertion counter. - */ -trait MockeryPHPUnitIntegration -{ - use MockeryPHPUnitIntegrationAssertPostConditions; - - protected $mockeryOpen; - - /** - * Performs assertions shared by all tests of a test case. This method is - * called before execution of a test ends and before the tearDown method. - */ - protected function mockeryAssertPostConditions() - { - $this->addMockeryExpectationsToAssertionCount(); - $this->checkMockeryExceptions(); - $this->closeMockery(); - - parent::assertPostConditions(); - } - - protected function addMockeryExpectationsToAssertionCount() - { - $this->addToAssertionCount(Mockery::getContainer()->mockery_getExpectationCount()); - } - - protected function checkMockeryExceptions() - { - if (!method_exists($this, "markAsRisky")) { - return; - } - - foreach (Mockery::getContainer()->mockery_thrownExceptions() as $e) { - if (!$e->dismissed()) { - $this->markAsRisky(); - } - } - } - - protected function closeMockery() - { - Mockery::close(); - $this->mockeryOpen = false; - } - - /** - * @before - */ - protected function startMockery() - { - $this->mockeryOpen = true; - } - - /** - * @after - */ - protected function purgeMockeryContainer() - { - if ($this->mockeryOpen) { - // post conditions wasn't called, so test probably failed - Mockery::close(); - } - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryPHPUnitIntegrationAssertPostConditions.php b/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryPHPUnitIntegrationAssertPostConditions.php deleted file mode 100644 index 68fc89ef..00000000 --- a/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryPHPUnitIntegrationAssertPostConditions.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2019 Enalean - * @license https://github.com/mockery/mockery/blob/master/LICENSE New BSD License - */ - -declare(strict_types=1); - -namespace Mockery\Adapter\Phpunit; - -trait MockeryPHPUnitIntegrationAssertPostConditions -{ - protected function assertPostConditions(): void - { - $this->mockeryAssertPostConditions(); - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryTestCase.php b/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryTestCase.php deleted file mode 100644 index f18ce2cf..00000000 --- a/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryTestCase.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Adapter\Phpunit; - -abstract class MockeryTestCase extends \PHPUnit\Framework\TestCase -{ - use MockeryPHPUnitIntegration; - use MockeryTestCaseSetUp; - - protected function mockeryTestSetUp() - { - } - - protected function mockeryTestTearDown() - { - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryTestCaseSetUp.php b/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryTestCaseSetUp.php deleted file mode 100644 index e4cc588e..00000000 --- a/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryTestCaseSetUp.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2019 Enalean - * @license https://github.com/mockery/mockery/blob/master/LICENSE New BSD License - */ - -declare(strict_types=1); - -namespace Mockery\Adapter\Phpunit; - -trait MockeryTestCaseSetUp -{ - protected function setUp(): void - { - parent::setUp(); - $this->mockeryTestSetUp(); - } - - protected function tearDown(): void - { - $this->mockeryTestTearDown(); - parent::tearDown(); - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/TestListener.php b/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/TestListener.php deleted file mode 100644 index effb8e48..00000000 --- a/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/TestListener.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Adapter\Phpunit; - -use PHPUnit\Framework\Test; -use PHPUnit\Framework\TestListenerDefaultImplementation; -use PHPUnit\Framework\TestSuite; -use PHPUnit\Framework\TestListener as PHPUnitTestListener; - -class TestListener implements PHPUnitTestListener -{ - use TestListenerDefaultImplementation; - - private $trait; - - public function __construct() - { - $this->trait = new TestListenerTrait(); - } - - public function endTest(Test $test, float $time): void - { - $this->trait->endTest($test, $time); - } - - public function startTestSuite(TestSuite $suite): void - { - $this->trait->startTestSuite(); - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/TestListenerTrait.php b/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/TestListenerTrait.php deleted file mode 100644 index 7b5bfe92..00000000 --- a/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/TestListenerTrait.php +++ /dev/null @@ -1,87 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Adapter\Phpunit; - -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\Test; -use PHPUnit\Framework\TestCase; -use PHPUnit\Util\Blacklist; -use PHPUnit\Runner\BaseTestRunner; - -class TestListenerTrait -{ - /** - * endTest is called after each test and checks if \Mockery::close() has - * been called, and will let the test fail if it hasn't. - * - * @param Test $test - * @param float $time - */ - public function endTest(Test $test, $time) - { - if (!$test instanceof TestCase) { - // We need the getTestResultObject and getStatus methods which are - // not part of the interface. - return; - } - - if ($test->getStatus() !== BaseTestRunner::STATUS_PASSED) { - // If the test didn't pass there is no guarantee that - // verifyMockObjects and assertPostConditions have been called. - // And even if it did, the point here is to prevent false - // negatives, not to make failing tests fail for more reasons. - return; - } - - try { - // The self() call is used as a sentinel. Anything that throws if - // the container is closed already will do. - \Mockery::self(); - } catch (\LogicException $_) { - return; - } - - $e = new ExpectationFailedException( - \sprintf( - "Mockery's expectations have not been verified. Make sure that \Mockery::close() is called at the end of the test. Consider using %s\MockeryPHPUnitIntegration or extending %s\MockeryTestCase.", - __NAMESPACE__, - __NAMESPACE__ - ) - ); - - /** @var \PHPUnit\Framework\TestResult $result */ - $result = $test->getTestResultObject(); - - if ($result !== null) { - $result->addFailure($test, $e, $time); - } - } - - public function startTestSuite() - { - if (method_exists(Blacklist::class, 'addDirectory')) { - (new BlackList())->getBlacklistedDirectories(); - Blacklist::addDirectory(\dirname((new \ReflectionClass(\Mockery::class))->getFileName())); - } else { - Blacklist::$blacklistedClassNames[\Mockery::class] = 1; - } - } -} diff --git a/vendor/mockery/mockery/library/Mockery/ClosureWrapper.php b/vendor/mockery/mockery/library/Mockery/ClosureWrapper.php deleted file mode 100644 index 35ca16db..00000000 --- a/vendor/mockery/mockery/library/Mockery/ClosureWrapper.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2017 Dave Marshall https://github.com/davedevelopment - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery; - -use Mockery\Matcher\Closure; - -/** - * @internal - */ -class ClosureWrapper -{ - private $closure; - - public function __construct(\Closure $closure) - { - $this->closure = $closure; - } - - public function __invoke() - { - return call_user_func_array($this->closure, func_get_args()); - } -} diff --git a/vendor/mockery/mockery/library/Mockery/CompositeExpectation.php b/vendor/mockery/mockery/library/Mockery/CompositeExpectation.php deleted file mode 100644 index 52314322..00000000 --- a/vendor/mockery/mockery/library/Mockery/CompositeExpectation.php +++ /dev/null @@ -1,154 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery; - -class CompositeExpectation implements ExpectationInterface -{ - /** - * Stores an array of all expectations for this composite - * - * @var array - */ - protected $_expectations = array(); - - /** - * Add an expectation to the composite - * - * @param \Mockery\Expectation|\Mockery\CompositeExpectation $expectation - * @return void - */ - public function add($expectation) - { - $this->_expectations[] = $expectation; - } - - /** - * @param mixed ...$args - */ - public function andReturn(...$args) - { - return $this->__call(__FUNCTION__, $args); - } - - /** - * Set a return value, or sequential queue of return values - * - * @param mixed ...$args - * @return self - */ - public function andReturns(...$args) - { - return call_user_func_array([$this, 'andReturn'], $args); - } - - /** - * Intercept any expectation calls and direct against all expectations - * - * @param string $method - * @param array $args - * @return self - */ - public function __call($method, array $args) - { - foreach ($this->_expectations as $expectation) { - call_user_func_array(array($expectation, $method), $args); - } - return $this; - } - - /** - * Return order number of the first expectation - * - * @return int - */ - public function getOrderNumber() - { - reset($this->_expectations); - $first = current($this->_expectations); - return $first->getOrderNumber(); - } - - /** - * Return the parent mock of the first expectation - * - * @return \Mockery\MockInterface|\Mockery\LegacyMockInterface - */ - public function getMock() - { - reset($this->_expectations); - $first = current($this->_expectations); - return $first->getMock(); - } - - /** - * Mockery API alias to getMock - * - * @return \Mockery\LegacyMockInterface|\Mockery\MockInterface - */ - public function mock() - { - return $this->getMock(); - } - - /** - * Starts a new expectation addition on the first mock which is the primary - * target outside of a demeter chain - * - * @param mixed ...$args - * @return \Mockery\Expectation - */ - public function shouldReceive(...$args) - { - reset($this->_expectations); - $first = current($this->_expectations); - return call_user_func_array(array($first->getMock(), 'shouldReceive'), $args); - } - - /** - * Starts a new expectation addition on the first mock which is the primary - * target outside of a demeter chain - * - * @param mixed ...$args - * @return \Mockery\Expectation - */ - public function shouldNotReceive(...$args) - { - reset($this->_expectations); - $first = current($this->_expectations); - return call_user_func_array(array($first->getMock(), 'shouldNotReceive'), $args); - } - - /** - * Return the string summary of this composite expectation - * - * @return string - */ - public function __toString() - { - $return = '['; - $parts = array(); - foreach ($this->_expectations as $exp) { - $parts[] = (string) $exp; - } - $return .= implode(', ', $parts) . ']'; - return $return; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Configuration.php b/vendor/mockery/mockery/library/Mockery/Configuration.php deleted file mode 100644 index bce05f3c..00000000 --- a/vendor/mockery/mockery/library/Mockery/Configuration.php +++ /dev/null @@ -1,283 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery; - -class Configuration -{ - /** - * Boolean assertion of whether we can mock methods which do not actually - * exist for the given class or object (ignored for unreal mocks) - * - * @var bool - */ - protected $_allowMockingNonExistentMethod = true; - - /** - * Boolean assertion of whether we ignore unnecessary mocking of methods, - * i.e. when method expectations are made, set using a zeroOrMoreTimes() - * constraint, and then never called. Essentially such expectations are - * not required and are just taking up test space. - * - * @var bool - */ - protected $_allowMockingMethodsUnnecessarily = true; - - /** - * @var QuickDefinitionsConfiguration - */ - protected $_quickDefinitionsConfiguration; - - /** - * Parameter map for use with PHP internal classes. - * - * @var array - */ - protected $_internalClassParamMap = array(); - - protected $_constantsMap = array(); - - /** - * Boolean assertion is reflection caching enabled or not. It should be - * always enabled, except when using PHPUnit's --static-backup option. - * - * @see https://github.com/mockery/mockery/issues/268 - */ - protected $_reflectionCacheEnabled = true; - - public function __construct() - { - $this->_quickDefinitionsConfiguration = new QuickDefinitionsConfiguration(); - } - - /** - * Custom object formatters - * - * @var array - */ - protected $_objectFormatters = array(); - - /** - * Default argument matchers - * - * @var array - */ - protected $_defaultMatchers = array(); - - /** - * Set boolean to allow/prevent mocking of non-existent methods - * - * @param bool $flag - */ - public function allowMockingNonExistentMethods($flag = true) - { - $this->_allowMockingNonExistentMethod = (bool) $flag; - } - - /** - * Return flag indicating whether mocking non-existent methods allowed - * - * @return bool - */ - public function mockingNonExistentMethodsAllowed() - { - return $this->_allowMockingNonExistentMethod; - } - - /** - * Set boolean to allow/prevent unnecessary mocking of methods - * - * @param bool $flag - * - * @deprecated since 1.4.0 - */ - public function allowMockingMethodsUnnecessarily($flag = true) - { - @trigger_error(sprintf("The %s method is deprecated and will be removed in a future version of Mockery", __METHOD__), E_USER_DEPRECATED); - - $this->_allowMockingMethodsUnnecessarily = (bool) $flag; - } - - /** - * Return flag indicating whether mocking non-existent methods allowed - * - * @return bool - * - * @deprecated since 1.4.0 - */ - public function mockingMethodsUnnecessarilyAllowed() - { - @trigger_error(sprintf("The %s method is deprecated and will be removed in a future version of Mockery", __METHOD__), E_USER_DEPRECATED); - - return $this->_allowMockingMethodsUnnecessarily; - } - - /** - * Set a parameter map (array of param signature strings) for the method - * of an internal PHP class. - * - * @param string $class - * @param string $method - * @param array $map - */ - public function setInternalClassMethodParamMap($class, $method, array $map) - { - if (\PHP_MAJOR_VERSION > 7) { - throw new \LogicException('Internal class parameter overriding is not available in PHP 8. Incompatible signatures have been reclassified as fatal errors.'); - } - - if (!isset($this->_internalClassParamMap[strtolower($class)])) { - $this->_internalClassParamMap[strtolower($class)] = array(); - } - $this->_internalClassParamMap[strtolower($class)][strtolower($method)] = $map; - } - - /** - * Remove all overridden parameter maps from internal PHP classes. - */ - public function resetInternalClassMethodParamMaps() - { - $this->_internalClassParamMap = array(); - } - - /** - * Get the parameter map of an internal PHP class method - * - * @return array|null - */ - public function getInternalClassMethodParamMap($class, $method) - { - if (isset($this->_internalClassParamMap[strtolower($class)][strtolower($method)])) { - return $this->_internalClassParamMap[strtolower($class)][strtolower($method)]; - } - } - - public function getInternalClassMethodParamMaps() - { - return $this->_internalClassParamMap; - } - - public function setConstantsMap(array $map) - { - $this->_constantsMap = $map; - } - - public function getConstantsMap() - { - return $this->_constantsMap; - } - - /** - * Returns the quick definitions configuration - */ - public function getQuickDefinitions(): QuickDefinitionsConfiguration - { - return $this->_quickDefinitionsConfiguration; - } - - /** - * Disable reflection caching - * - * It should be always enabled, except when using - * PHPUnit's --static-backup option. - * - * @see https://github.com/mockery/mockery/issues/268 - */ - public function disableReflectionCache() - { - $this->_reflectionCacheEnabled = false; - } - - /** - * Enable reflection caching - * - * It should be always enabled, except when using - * PHPUnit's --static-backup option. - * - * @see https://github.com/mockery/mockery/issues/268 - */ - public function enableReflectionCache() - { - $this->_reflectionCacheEnabled = true; - } - - /** - * Is reflection cache enabled? - */ - public function reflectionCacheEnabled() - { - return $this->_reflectionCacheEnabled; - } - - public function setObjectFormatter($class, $formatterCallback) - { - $this->_objectFormatters[$class] = $formatterCallback; - } - - public function getObjectFormatter($class, $defaultFormatter) - { - $parentClass = $class; - do { - $classes[] = $parentClass; - $parentClass = get_parent_class($parentClass); - } while ($parentClass); - $classesAndInterfaces = array_merge($classes, class_implements($class)); - foreach ($classesAndInterfaces as $type) { - if (isset($this->_objectFormatters[$type])) { - return $this->_objectFormatters[$type]; - } - } - return $defaultFormatter; - } - - /** - * @param string $class - * @param string $matcherClass - */ - public function setDefaultMatcher($class, $matcherClass) - { - if (!is_a($matcherClass, \Mockery\Matcher\MatcherAbstract::class, true) && - !is_a($matcherClass, \Hamcrest\Matcher::class, true) && - !is_a($matcherClass, \Hamcrest_Matcher::class, true) - ) { - throw new \InvalidArgumentException( - "Matcher class must be either Hamcrest matcher or extend \Mockery\Matcher\MatcherAbstract, " . - "'$matcherClass' given." - ); - } - $this->_defaultMatchers[$class] = $matcherClass; - } - - public function getDefaultMatcher($class) - { - $parentClass = $class; - do { - $classes[] = $parentClass; - $parentClass = get_parent_class($parentClass); - } while ($parentClass); - $classesAndInterfaces = array_merge($classes, class_implements($class)); - foreach ($classesAndInterfaces as $type) { - if (isset($this->_defaultMatchers[$type])) { - return $this->_defaultMatchers[$type]; - } - } - return null; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Container.php b/vendor/mockery/mockery/library/Mockery/Container.php deleted file mode 100644 index 196dc996..00000000 --- a/vendor/mockery/mockery/library/Mockery/Container.php +++ /dev/null @@ -1,535 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery; - -use Mockery\Generator\Generator; -use Mockery\Generator\MockConfigurationBuilder; -use Mockery\Loader\Loader as LoaderInterface; - -class Container -{ - const BLOCKS = \Mockery::BLOCKS; - - /** - * Store of mock objects - * - * @var array - */ - protected $_mocks = array(); - - /** - * Order number of allocation - * - * @var int - */ - protected $_allocatedOrder = 0; - - /** - * Current ordered number - * - * @var int - */ - protected $_currentOrder = 0; - - /** - * Ordered groups - * - * @var array - */ - protected $_groups = array(); - - /** - * @var Generator - */ - protected $_generator; - - /** - * @var LoaderInterface - */ - protected $_loader; - - /** - * @var array - */ - protected $_namedMocks = array(); - - public function __construct(Generator $generator = null, LoaderInterface $loader = null) - { - $this->_generator = $generator ?: \Mockery::getDefaultGenerator(); - $this->_loader = $loader ?: \Mockery::getDefaultLoader(); - } - - /** - * Generates a new mock object for this container - * - * I apologies in advance for this. A God Method just fits the API which - * doesn't require differentiating between classes, interfaces, abstracts, - * names or partials - just so long as it's something that can be mocked. - * I'll refactor it one day so it's easier to follow. - * - * @param array ...$args - * - * @return Mock - * @throws Exception\RuntimeException - */ - public function mock(...$args) - { - $expectationClosure = null; - $quickdefs = array(); - $constructorArgs = null; - $blocks = array(); - $class = null; - - if (count($args) > 1) { - $finalArg = end($args); - reset($args); - if (is_callable($finalArg) && is_object($finalArg)) { - $expectationClosure = array_pop($args); - } - } - - $builder = new MockConfigurationBuilder(); - - foreach ($args as $k => $arg) { - if ($arg instanceof MockConfigurationBuilder) { - $builder = $arg; - unset($args[$k]); - } - } - reset($args); - - $builder->setParameterOverrides(\Mockery::getConfiguration()->getInternalClassMethodParamMaps()); - $builder->setConstantsMap(\Mockery::getConfiguration()->getConstantsMap()); - - while (count($args) > 0) { - $arg = array_shift($args); - // check for multiple interfaces - if (is_string($arg)) { - foreach (explode('|', $arg) as $type) { - if ($arg === 'null') { - // skip PHP 8 'null's - } elseif (strpos($type, ',') && !strpos($type, ']')) { - $interfaces = explode(',', str_replace(' ', '', $type)); - $builder->addTargets($interfaces); - } elseif (substr($type, 0, 6) == 'alias:') { - $type = str_replace('alias:', '', $type); - $builder->addTarget('stdClass'); - $builder->setName($type); - } elseif (substr($type, 0, 9) == 'overload:') { - $type = str_replace('overload:', '', $type); - $builder->setInstanceMock(true); - $builder->addTarget('stdClass'); - $builder->setName($type); - } elseif (substr($type, strlen($type)-1, 1) == ']') { - $parts = explode('[', $type); - if (!class_exists($parts[0], true) && !interface_exists($parts[0], true)) { - throw new \Mockery\Exception('Can only create a partial mock from' - . ' an existing class or interface'); - } - $class = $parts[0]; - $parts[1] = str_replace(' ', '', $parts[1]); - $partialMethods = array_filter(explode(',', strtolower(rtrim($parts[1], ']')))); - $builder->addTarget($class); - foreach ($partialMethods as $partialMethod) { - if ($partialMethod[0] === '!') { - $builder->addBlackListedMethod(substr($partialMethod, 1)); - continue; - } - $builder->addWhiteListedMethod($partialMethod); - } - } elseif (class_exists($type, true) || interface_exists($type, true) || trait_exists($type, true)) { - $builder->addTarget($type); - } elseif (!\Mockery::getConfiguration()->mockingNonExistentMethodsAllowed() && (!class_exists($type, true) && !interface_exists($type, true))) { - throw new \Mockery\Exception("Mockery can't find '$type' so can't mock it"); - } else { - if (!$this->isValidClassName($type)) { - throw new \Mockery\Exception('Class name contains invalid characters'); - } - $builder->addTarget($type); - } - break; // unions are "sum" types and not "intersections", and so we must only process the first part - } - } elseif (is_object($arg)) { - $builder->addTarget($arg); - } elseif (is_array($arg)) { - if (!empty($arg) && array_keys($arg) !== range(0, count($arg) - 1)) { - // if associative array - if (array_key_exists(self::BLOCKS, $arg)) { - $blocks = $arg[self::BLOCKS]; - } - unset($arg[self::BLOCKS]); - $quickdefs = $arg; - } else { - $constructorArgs = $arg; - } - } else { - throw new \Mockery\Exception( - 'Unable to parse arguments sent to ' - . get_class($this) . '::mock()' - ); - } - } - - $builder->addBlackListedMethods($blocks); - - if (!is_null($constructorArgs)) { - $builder->addBlackListedMethod("__construct"); // we need to pass through - } else { - $builder->setMockOriginalDestructor(true); - } - - if (!empty($partialMethods) && $constructorArgs === null) { - $constructorArgs = array(); - } - - $config = $builder->getMockConfiguration(); - - $this->checkForNamedMockClashes($config); - - $def = $this->getGenerator()->generate($config); - - if (class_exists($def->getClassName(), $attemptAutoload = false)) { - $rfc = new \ReflectionClass($def->getClassName()); - if (!$rfc->implementsInterface("Mockery\LegacyMockInterface")) { - throw new \Mockery\Exception\RuntimeException("Could not load mock {$def->getClassName()}, class already exists"); - } - } - - $this->getLoader()->load($def); - - $mock = $this->_getInstance($def->getClassName(), $constructorArgs); - $mock->mockery_init($this, $config->getTargetObject(), $config->isInstanceMock()); - - if (!empty($quickdefs)) { - if (\Mockery::getConfiguration()->getQuickDefinitions()->shouldBeCalledAtLeastOnce()) { - $mock->shouldReceive($quickdefs)->atLeast()->once(); - } else { - $mock->shouldReceive($quickdefs)->byDefault(); - } - } - if (!empty($expectationClosure)) { - $expectationClosure($mock); - } - $this->rememberMock($mock); - return $mock; - } - - public function instanceMock() - { - } - - public function getLoader() - { - return $this->_loader; - } - - public function getGenerator() - { - return $this->_generator; - } - - /** - * @param string $method - * @param string $parent - * @return string|null - */ - public function getKeyOfDemeterMockFor($method, $parent) - { - $keys = array_keys($this->_mocks); - $match = preg_grep("/__demeter_" . md5($parent) . "_{$method}$/", $keys); - if (count($match) == 1) { - $res = array_values($match); - if (count($res) > 0) { - return $res[0]; - } - } - return null; - } - - /** - * @return array - */ - public function getMocks() - { - return $this->_mocks; - } - - /** - * Tear down tasks for this container - * - * @throws \Exception - * @return void - */ - public function mockery_teardown() - { - try { - $this->mockery_verify(); - } catch (\Exception $e) { - $this->mockery_close(); - throw $e; - } - } - - /** - * Verify the container mocks - * - * @return void - */ - public function mockery_verify() - { - foreach ($this->_mocks as $mock) { - $mock->mockery_verify(); - } - } - - /** - * Retrieves all exceptions thrown by mocks - * - * @return array - */ - public function mockery_thrownExceptions() - { - $e = []; - - foreach ($this->_mocks as $mock) { - $e = array_merge($e, $mock->mockery_thrownExceptions()); - } - - return $e; - } - - /** - * Reset the container to its original state - * - * @return void - */ - public function mockery_close() - { - foreach ($this->_mocks as $mock) { - $mock->mockery_teardown(); - } - $this->_mocks = array(); - } - - /** - * Fetch the next available allocation order number - * - * @return int - */ - public function mockery_allocateOrder() - { - $this->_allocatedOrder += 1; - return $this->_allocatedOrder; - } - - /** - * Set ordering for a group - * - * @param mixed $group - * @param int $order - */ - public function mockery_setGroup($group, $order) - { - $this->_groups[$group] = $order; - } - - /** - * Fetch array of ordered groups - * - * @return array - */ - public function mockery_getGroups() - { - return $this->_groups; - } - - /** - * Set current ordered number - * - * @param int $order - * @return int The current order number that was set - */ - public function mockery_setCurrentOrder($order) - { - $this->_currentOrder = $order; - return $this->_currentOrder; - } - - /** - * Get current ordered number - * - * @return int - */ - public function mockery_getCurrentOrder() - { - return $this->_currentOrder; - } - - /** - * Validate the current mock's ordering - * - * @param string $method - * @param int $order - * @throws \Mockery\Exception - * @return void - */ - public function mockery_validateOrder($method, $order, \Mockery\LegacyMockInterface $mock) - { - if ($order < $this->_currentOrder) { - $exception = new \Mockery\Exception\InvalidOrderException( - 'Method ' . $method . ' called out of order: expected order ' - . $order . ', was ' . $this->_currentOrder - ); - $exception->setMock($mock) - ->setMethodName($method) - ->setExpectedOrder($order) - ->setActualOrder($this->_currentOrder); - throw $exception; - } - $this->mockery_setCurrentOrder($order); - } - - /** - * Gets the count of expectations on the mocks - * - * @return int - */ - public function mockery_getExpectationCount() - { - $count = 0; - foreach ($this->_mocks as $mock) { - $count += $mock->mockery_getExpectationCount(); - } - return $count; - } - - /** - * Store a mock and set its container reference - * - * @param \Mockery\Mock $mock - * @return \Mockery\LegacyMockInterface|\Mockery\MockInterface - */ - public function rememberMock(\Mockery\LegacyMockInterface $mock) - { - if (!isset($this->_mocks[get_class($mock)])) { - $this->_mocks[get_class($mock)] = $mock; - } else { - /** - * This condition triggers for an instance mock where origin mock - * is already remembered - */ - $this->_mocks[] = $mock; - } - return $mock; - } - - /** - * Retrieve the last remembered mock object, which is the same as saying - * retrieve the current mock being programmed where you have yet to call - * mock() to change it - thus why the method name is "self" since it will be - * be used during the programming of the same mock. - * - * @return \Mockery\Mock - */ - public function self() - { - $mocks = array_values($this->_mocks); - $index = count($mocks) - 1; - return $mocks[$index]; - } - - /** - * Return a specific remembered mock according to the array index it - * was stored to in this container instance - * - * @return \Mockery\Mock - */ - public function fetchMock($reference) - { - if (isset($this->_mocks[$reference])) { - return $this->_mocks[$reference]; - } - } - - protected function _getInstance($mockName, $constructorArgs = null) - { - if ($constructorArgs !== null) { - $r = new \ReflectionClass($mockName); - return $r->newInstanceArgs($constructorArgs); - } - - try { - $instantiator = new Instantiator(); - $instance = $instantiator->instantiate($mockName); - } catch (\Exception $ex) { - $internalMockName = $mockName . '_Internal'; - - if (!class_exists($internalMockName)) { - eval("class $internalMockName extends $mockName {" . - 'public function __construct() {}' . - '}'); - } - - $instance = new $internalMockName(); - } - - return $instance; - } - - protected function checkForNamedMockClashes($config) - { - $name = $config->getName(); - - if (!$name) { - return; - } - - $hash = $config->getHash(); - - if (isset($this->_namedMocks[$name])) { - if ($hash !== $this->_namedMocks[$name]) { - throw new \Mockery\Exception( - "The mock named '$name' has been already defined with a different mock configuration" - ); - } - } - - $this->_namedMocks[$name] = $hash; - } - - /** - * see http://php.net/manual/en/language.oop5.basic.php - * @param string $className - * @return bool - */ - public function isValidClassName($className) - { - $pos = strpos($className, '\\'); - if ($pos === 0) { - $className = substr($className, 1); // remove the first backslash - } - // all the namespaces and class name should match the regex - $invalidNames = array_filter(explode('\\', $className), function ($name) { - return !preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $name); - }); - return empty($invalidNames); - } -} diff --git a/vendor/mockery/mockery/library/Mockery/CountValidator/AtLeast.php b/vendor/mockery/mockery/library/Mockery/CountValidator/AtLeast.php deleted file mode 100644 index f6ac130e..00000000 --- a/vendor/mockery/mockery/library/Mockery/CountValidator/AtLeast.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\CountValidator; - -use Mockery; - -class AtLeast extends CountValidatorAbstract -{ - /** - * Checks if the validator can accept an additional nth call - * - * @param int $n - * @return bool - */ - public function isEligible($n) - { - return true; - } - - /** - * Validate the call count against this validator - * - * @param int $n - * @return bool - */ - public function validate($n) - { - if ($this->_limit > $n) { - $exception = new Mockery\Exception\InvalidCountException( - 'Method ' . (string) $this->_expectation - . ' from ' . $this->_expectation->getMock()->mockery_getName() - . ' should be called' . PHP_EOL - . ' at least ' . $this->_limit . ' times but called ' . $n - . ' times.' - ); - $exception->setMock($this->_expectation->getMock()) - ->setMethodName((string) $this->_expectation) - ->setExpectedCountComparative('>=') - ->setExpectedCount($this->_limit) - ->setActualCount($n); - throw $exception; - } - } -} diff --git a/vendor/mockery/mockery/library/Mockery/CountValidator/AtMost.php b/vendor/mockery/mockery/library/Mockery/CountValidator/AtMost.php deleted file mode 100644 index 4d23e28d..00000000 --- a/vendor/mockery/mockery/library/Mockery/CountValidator/AtMost.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\CountValidator; - -use Mockery; - -class AtMost extends CountValidatorAbstract -{ - /** - * Validate the call count against this validator - * - * @param int $n - * @return bool - */ - public function validate($n) - { - if ($this->_limit < $n) { - $exception = new Mockery\Exception\InvalidCountException( - 'Method ' . (string) $this->_expectation - . ' from ' . $this->_expectation->getMock()->mockery_getName() - . ' should be called' . PHP_EOL - . ' at most ' . $this->_limit . ' times but called ' . $n - . ' times.' - ); - $exception->setMock($this->_expectation->getMock()) - ->setMethodName((string) $this->_expectation) - ->setExpectedCountComparative('<=') - ->setExpectedCount($this->_limit) - ->setActualCount($n); - throw $exception; - } - } -} diff --git a/vendor/mockery/mockery/library/Mockery/CountValidator/CountValidatorAbstract.php b/vendor/mockery/mockery/library/Mockery/CountValidator/CountValidatorAbstract.php deleted file mode 100644 index ae3b0bfe..00000000 --- a/vendor/mockery/mockery/library/Mockery/CountValidator/CountValidatorAbstract.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\CountValidator; - -abstract class CountValidatorAbstract -{ - /** - * Expectation for which this validator is assigned - * - * @var \Mockery\Expectation - */ - protected $_expectation = null; - - /** - * Call count limit - * - * @var int - */ - protected $_limit = null; - - /** - * Set Expectation object and upper call limit - * - * @param \Mockery\Expectation $expectation - * @param int $limit - */ - public function __construct(\Mockery\Expectation $expectation, $limit) - { - $this->_expectation = $expectation; - $this->_limit = $limit; - } - - /** - * Checks if the validator can accept an additional nth call - * - * @param int $n - * @return bool - */ - public function isEligible($n) - { - return ($n < $this->_limit); - } - - /** - * Validate the call count against this validator - * - * @param int $n - * @return bool - */ - abstract public function validate($n); -} diff --git a/vendor/mockery/mockery/library/Mockery/CountValidator/Exact.php b/vendor/mockery/mockery/library/Mockery/CountValidator/Exact.php deleted file mode 100644 index 504f080d..00000000 --- a/vendor/mockery/mockery/library/Mockery/CountValidator/Exact.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\CountValidator; - -use Mockery; - -class Exact extends CountValidatorAbstract -{ - /** - * Validate the call count against this validator - * - * @param int $n - * @return bool - */ - public function validate($n) - { - if ($this->_limit !== $n) { - $because = $this->_expectation->getExceptionMessage(); - - $exception = new Mockery\Exception\InvalidCountException( - 'Method ' . (string) $this->_expectation - . ' from ' . $this->_expectation->getMock()->mockery_getName() - . ' should be called' . PHP_EOL - . ' exactly ' . $this->_limit . ' times but called ' . $n - . ' times.' - . ($because ? ' Because ' . $this->_expectation->getExceptionMessage() : '') - ); - $exception->setMock($this->_expectation->getMock()) - ->setMethodName((string) $this->_expectation) - ->setExpectedCountComparative('=') - ->setExpectedCount($this->_limit) - ->setActualCount($n); - throw $exception; - } - } -} diff --git a/vendor/mockery/mockery/library/Mockery/CountValidator/Exception.php b/vendor/mockery/mockery/library/Mockery/CountValidator/Exception.php deleted file mode 100644 index b43aad3e..00000000 --- a/vendor/mockery/mockery/library/Mockery/CountValidator/Exception.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\CountValidator; - -class Exception extends \OutOfBoundsException -{ -} diff --git a/vendor/mockery/mockery/library/Mockery/Exception.php b/vendor/mockery/mockery/library/Mockery/Exception.php deleted file mode 100644 index b0b85120..00000000 --- a/vendor/mockery/mockery/library/Mockery/Exception.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery; - -class Exception extends \UnexpectedValueException -{ -} diff --git a/vendor/mockery/mockery/library/Mockery/Exception/BadMethodCallException.php b/vendor/mockery/mockery/library/Mockery/Exception/BadMethodCallException.php deleted file mode 100644 index 8123d44e..00000000 --- a/vendor/mockery/mockery/library/Mockery/Exception/BadMethodCallException.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -namespace Mockery\Exception; - -class BadMethodCallException extends \BadMethodCallException -{ - private $dismissed = false; - - public function dismiss() - { - $this->dismissed = true; - - // we sometimes stack them - if ($this->getPrevious() && $this->getPrevious() instanceof BadMethodCallException) { - $this->getPrevious()->dismiss(); - } - } - - public function dismissed() - { - return $this->dismissed; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Exception/InvalidArgumentException.php b/vendor/mockery/mockery/library/Mockery/Exception/InvalidArgumentException.php deleted file mode 100644 index ccf5c76f..00000000 --- a/vendor/mockery/mockery/library/Mockery/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Exception; - -class InvalidArgumentException extends \InvalidArgumentException -{ -} diff --git a/vendor/mockery/mockery/library/Mockery/Exception/InvalidCountException.php b/vendor/mockery/mockery/library/Mockery/Exception/InvalidCountException.php deleted file mode 100644 index 650d2da3..00000000 --- a/vendor/mockery/mockery/library/Mockery/Exception/InvalidCountException.php +++ /dev/null @@ -1,102 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Exception; - -use Mockery; -use Mockery\Exception\RuntimeException; - -class InvalidCountException extends Mockery\CountValidator\Exception -{ - protected $method = null; - - protected $expected = 0; - - protected $expectedComparative = '<='; - - protected $actual = null; - - protected $mockObject = null; - - public function setMock(Mockery\LegacyMockInterface $mock) - { - $this->mockObject = $mock; - return $this; - } - - public function setMethodName($name) - { - $this->method = $name; - return $this; - } - - public function setActualCount($count) - { - $this->actual = $count; - return $this; - } - - public function setExpectedCount($count) - { - $this->expected = $count; - return $this; - } - - public function setExpectedCountComparative($comp) - { - if (!in_array($comp, array('=', '>', '<', '>=', '<='))) { - throw new RuntimeException( - 'Illegal comparative for expected call counts set: ' . $comp - ); - } - $this->expectedComparative = $comp; - return $this; - } - - public function getMock() - { - return $this->mockObject; - } - - public function getMethodName() - { - return $this->method; - } - - public function getActualCount() - { - return $this->actual; - } - - public function getExpectedCount() - { - return $this->expected; - } - - public function getMockName() - { - return $this->getMock()->mockery_getName(); - } - - public function getExpectedCountComparative() - { - return $this->expectedComparative; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Exception/InvalidOrderException.php b/vendor/mockery/mockery/library/Mockery/Exception/InvalidOrderException.php deleted file mode 100644 index 50b8049e..00000000 --- a/vendor/mockery/mockery/library/Mockery/Exception/InvalidOrderException.php +++ /dev/null @@ -1,83 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Exception; - -use Mockery; - -class InvalidOrderException extends Mockery\Exception -{ - protected $method = null; - - protected $expected = 0; - - protected $actual = null; - - protected $mockObject = null; - - public function setMock(Mockery\LegacyMockInterface $mock) - { - $this->mockObject = $mock; - return $this; - } - - public function setMethodName($name) - { - $this->method = $name; - return $this; - } - - public function setActualOrder($count) - { - $this->actual = $count; - return $this; - } - - public function setExpectedOrder($count) - { - $this->expected = $count; - return $this; - } - - public function getMock() - { - return $this->mockObject; - } - - public function getMethodName() - { - return $this->method; - } - - public function getActualOrder() - { - return $this->actual; - } - - public function getExpectedOrder() - { - return $this->expected; - } - - public function getMockName() - { - return $this->getMock()->mockery_getName(); - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Exception/NoMatchingExpectationException.php b/vendor/mockery/mockery/library/Mockery/Exception/NoMatchingExpectationException.php deleted file mode 100644 index fe5f3515..00000000 --- a/vendor/mockery/mockery/library/Mockery/Exception/NoMatchingExpectationException.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Exception; - -use Mockery; - -class NoMatchingExpectationException extends Mockery\Exception -{ - protected $method = null; - - protected $actual = array(); - - protected $mockObject = null; - - public function setMock(Mockery\LegacyMockInterface $mock) - { - $this->mockObject = $mock; - return $this; - } - - public function setMethodName($name) - { - $this->method = $name; - return $this; - } - - public function setActualArguments($count) - { - $this->actual = $count; - return $this; - } - - public function getMock() - { - return $this->mockObject; - } - - public function getMethodName() - { - return $this->method; - } - - public function getActualArguments() - { - return $this->actual; - } - - public function getMockName() - { - return $this->getMock()->mockery_getName(); - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Exception/RuntimeException.php b/vendor/mockery/mockery/library/Mockery/Exception/RuntimeException.php deleted file mode 100644 index 4b2f53c2..00000000 --- a/vendor/mockery/mockery/library/Mockery/Exception/RuntimeException.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Exception; - -class RuntimeException extends \Exception -{ -} diff --git a/vendor/mockery/mockery/library/Mockery/Expectation.php b/vendor/mockery/mockery/library/Mockery/Expectation.php deleted file mode 100644 index ed87a5a6..00000000 --- a/vendor/mockery/mockery/library/Mockery/Expectation.php +++ /dev/null @@ -1,940 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery; - -use Closure; -use Mockery\Matcher\NoArgs; -use Mockery\Matcher\AnyArgs; -use Mockery\Matcher\AndAnyOtherArgs; -use Mockery\Matcher\ArgumentListMatcher; -use Mockery\Matcher\MultiArgumentClosure; - -class Expectation implements ExpectationInterface -{ - /** - * Mock object to which this expectation belongs - * - * @var \Mockery\LegacyMockInterface - */ - protected $_mock = null; - - /** - * Method name - * - * @var string - */ - protected $_name = null; - - /** - * Exception message - * - * @var string|null - */ - protected $_because = null; - - /** - * Arguments expected by this expectation - * - * @var array - */ - protected $_expectedArgs = array(); - - /** - * Count validator store - * - * @var array - */ - protected $_countValidators = array(); - - /** - * The count validator class to use - * - * @var string - */ - protected $_countValidatorClass = 'Mockery\CountValidator\Exact'; - - /** - * Actual count of calls to this expectation - * - * @var int - */ - protected $_actualCount = 0; - - /** - * Value to return from this expectation - * - * @var mixed - */ - protected $_returnValue = null; - - /** - * Array of return values as a queue for multiple return sequence - * - * @var array - */ - protected $_returnQueue = array(); - - /** - * Array of closures executed with given arguments to generate a result - * to be returned - * - * @var array - */ - protected $_closureQueue = array(); - - /** - * Array of values to be set when this expectation matches - * - * @var array - */ - protected $_setQueue = array(); - - /** - * Integer representing the call order of this expectation - * - * @var int - */ - protected $_orderNumber = null; - - /** - * Integer representing the call order of this expectation on a global basis - * - * @var int - */ - protected $_globalOrderNumber = null; - - /** - * Flag indicating that an exception is expected to be throw (not returned) - * - * @var bool - */ - protected $_throw = false; - - /** - * Flag indicating whether the order of calling is determined locally or - * globally - * - * @var bool - */ - protected $_globally = false; - - /** - * Flag indicating if the return value should be obtained from the original - * class method instead of returning predefined values from the return queue - * - * @var bool - */ - protected $_passthru = false; - - /** - * Constructor - * - * @param \Mockery\LegacyMockInterface $mock - * @param string $name - */ - public function __construct(\Mockery\LegacyMockInterface $mock, $name) - { - $this->_mock = $mock; - $this->_name = $name; - $this->withAnyArgs(); - } - - /** - * Return a string with the method name and arguments formatted - * - * @param string $name Name of the expected method - * @param array $args List of arguments to the method - * @return string - */ - public function __toString() - { - return \Mockery::formatArgs($this->_name, $this->_expectedArgs); - } - - /** - * Verify the current call, i.e. that the given arguments match those - * of this expectation - * - * @param array $args - * @return mixed - */ - public function verifyCall(array $args) - { - $this->validateOrder(); - $this->_actualCount++; - if (true === $this->_passthru) { - return $this->_mock->mockery_callSubjectMethod($this->_name, $args); - } - - $return = $this->_getReturnValue($args); - $this->throwAsNecessary($return); - $this->_setValues(); - - return $return; - } - - /** - * Throws an exception if the expectation has been configured to do so - * - * @throws \Throwable - * @return void - */ - private function throwAsNecessary($return) - { - if (!$this->_throw) { - return; - } - - if ($return instanceof \Throwable) { - throw $return; - } - - return; - } - - /** - * Sets public properties with queued values to the mock object - * - * @param array $args - * @return mixed - */ - protected function _setValues() - { - $mockClass = get_class($this->_mock); - $container = $this->_mock->mockery_getContainer(); - /** @var Mock[] $mocks */ - $mocks = $container->getMocks(); - foreach ($this->_setQueue as $name => &$values) { - if (count($values) > 0) { - $value = array_shift($values); - $this->_mock->{$name} = $value; - foreach ($mocks as $mock) { - if (is_a($mock, $mockClass) && $mock->mockery_isInstance()) { - $mock->{$name} = $value; - } - } - } - } - } - - /** - * Fetch the return value for the matching args - * - * @param array $args - * @return mixed - */ - protected function _getReturnValue(array $args) - { - if (count($this->_closureQueue) > 1) { - return call_user_func_array(array_shift($this->_closureQueue), $args); - } elseif (count($this->_closureQueue) > 0) { - return call_user_func_array(current($this->_closureQueue), $args); - } elseif (count($this->_returnQueue) > 1) { - return array_shift($this->_returnQueue); - } elseif (count($this->_returnQueue) > 0) { - return current($this->_returnQueue); - } - - return $this->_mock->mockery_returnValueForMethod($this->_name); - } - - /** - * Checks if this expectation is eligible for additional calls - * - * @return bool - */ - public function isEligible() - { - foreach ($this->_countValidators as $validator) { - if (!$validator->isEligible($this->_actualCount)) { - return false; - } - } - return true; - } - - /** - * Check if there is a constraint on call count - * - * @return bool - */ - public function isCallCountConstrained() - { - return (count($this->_countValidators) > 0); - } - - /** - * Verify call order - * - * @return void - */ - public function validateOrder() - { - if ($this->_orderNumber) { - $this->_mock->mockery_validateOrder((string) $this, $this->_orderNumber, $this->_mock); - } - if ($this->_globalOrderNumber) { - $this->_mock->mockery_getContainer() - ->mockery_validateOrder((string) $this, $this->_globalOrderNumber, $this->_mock); - } - } - - /** - * Verify this expectation - * - * @return void - */ - public function verify() - { - foreach ($this->_countValidators as $validator) { - $validator->validate($this->_actualCount); - } - } - - /** - * Check if the registered expectation is an ArgumentListMatcher - * @return bool - */ - private function isArgumentListMatcher() - { - return (count($this->_expectedArgs) === 1 && ($this->_expectedArgs[0] instanceof ArgumentListMatcher)); - } - - private function isAndAnyOtherArgumentsMatcher($expectedArg) - { - return $expectedArg instanceof AndAnyOtherArgs; - } - - /** - * Check if passed arguments match an argument expectation - * - * @param array $args - * @return bool - */ - public function matchArgs(array $args) - { - if ($this->isArgumentListMatcher()) { - return $this->_matchArg($this->_expectedArgs[0], $args); - } - $argCount = count($args); - if ($argCount !== count((array) $this->_expectedArgs)) { - $lastExpectedArgument = end($this->_expectedArgs); - reset($this->_expectedArgs); - - if ($this->isAndAnyOtherArgumentsMatcher($lastExpectedArgument)) { - $args = array_slice($args, 0, array_search($lastExpectedArgument, $this->_expectedArgs, true)); - return $this->_matchArgs($args); - } - - return false; - } - - return $this->_matchArgs($args); - } - - /** - * Check if the passed arguments match the expectations, one by one. - * - * @param array $args - * @return bool - */ - protected function _matchArgs($args) - { - $argCount = count($args); - for ($i=0; $i<$argCount; $i++) { - $param =& $args[$i]; - if (!$this->_matchArg($this->_expectedArgs[$i], $param)) { - return false; - } - } - return true; - } - - /** - * Check if passed argument matches an argument expectation - * - * @param mixed $expected - * @param mixed $actual - * @return bool - */ - protected function _matchArg($expected, &$actual) - { - if ($expected === $actual) { - return true; - } - if (!is_object($expected) && !is_object($actual) && $expected == $actual) { - return true; - } - if (is_string($expected) && is_object($actual)) { - $result = $actual instanceof $expected; - if ($result) { - return true; - } - } - if (is_object($expected)) { - $matcher = \Mockery::getConfiguration()->getDefaultMatcher(get_class($expected)); - if ($matcher !== null) { - $expected = new $matcher($expected); - } - } - if ($expected instanceof \Mockery\Matcher\MatcherAbstract) { - return $expected->match($actual); - } - if ($expected instanceof \Hamcrest\Matcher || $expected instanceof \Hamcrest_Matcher) { - return $expected->matches($actual); - } - return false; - } - - /** - * Expected argument setter for the expectation - * - * @param mixed ...$args - * - * @return self - */ - public function with(...$args) - { - return $this->withArgs($args); - } - - /** - * Expected arguments for the expectation passed as an array - * - * @param array $arguments - * @return self - */ - private function withArgsInArray(array $arguments) - { - if (empty($arguments)) { - return $this->withNoArgs(); - } - $this->_expectedArgs = $arguments; - return $this; - } - - /** - * Expected arguments have to be matched by the given closure. - * - * @param Closure $closure - * @return self - */ - private function withArgsMatchedByClosure(Closure $closure) - { - $this->_expectedArgs = [new MultiArgumentClosure($closure)]; - return $this; - } - - /** - * Expected arguments for the expectation passed as an array or a closure that matches each passed argument on - * each function call. - * - * @param array|Closure $argsOrClosure - * @return self - */ - public function withArgs($argsOrClosure) - { - if (is_array($argsOrClosure)) { - $this->withArgsInArray($argsOrClosure); - } elseif ($argsOrClosure instanceof Closure) { - $this->withArgsMatchedByClosure($argsOrClosure); - } else { - throw new \InvalidArgumentException(sprintf('Call to %s with an invalid argument (%s), only array and ' . - 'closure are allowed', __METHOD__, $argsOrClosure)); - } - return $this; - } - - /** - * Set with() as no arguments expected - * - * @return self - */ - public function withNoArgs() - { - $this->_expectedArgs = [new NoArgs()]; - return $this; - } - - /** - * Set expectation that any arguments are acceptable - * - * @return self - */ - public function withAnyArgs() - { - $this->_expectedArgs = [new AnyArgs()]; - return $this; - } - - /** - * Expected arguments should partially match the real arguments - * - * @param mixed ...$expectedArgs - * @return self - */ - public function withSomeOfArgs(...$expectedArgs) - { - return $this->withArgs(function (...$args) use ($expectedArgs) { - foreach ($expectedArgs as $expectedArg) { - if (!in_array($expectedArg, $args, true)) { - return false; - } - } - return true; - }); - } - - /** - * Set a return value, or sequential queue of return values - * - * @param mixed ...$args - * @return self - */ - public function andReturn(...$args) - { - $this->_returnQueue = $args; - return $this; - } - - /** - * Set a return value, or sequential queue of return values - * - * @param mixed ...$args - * @return self - */ - public function andReturns(...$args) - { - return call_user_func_array([$this, 'andReturn'], $args); - } - - /** - * Return this mock, like a fluent interface - * - * @return self - */ - public function andReturnSelf() - { - return $this->andReturn($this->_mock); - } - - /** - * Set a sequential queue of return values with an array - * - * @param array $values - * @return self - */ - public function andReturnValues(array $values) - { - call_user_func_array(array($this, 'andReturn'), $values); - return $this; - } - - /** - * Set a closure or sequence of closures with which to generate return - * values. The arguments passed to the expected method are passed to the - * closures as parameters. - * - * @param callable ...$args - * @return self - */ - public function andReturnUsing(...$args) - { - $this->_closureQueue = $args; - return $this; - } - - /** - * Sets up a closure to return the nth argument from the expected method call - * - * @param int $index - * @return self - */ - public function andReturnArg($index) - { - if (!is_int($index) || $index < 0) { - throw new \InvalidArgumentException("Invalid argument index supplied. Index must be a non-negative integer."); - } - $closure = function (...$args) use ($index) { - if (array_key_exists($index, $args)) { - return $args[$index]; - } - throw new \OutOfBoundsException("Cannot return an argument value. No argument exists for the index $index"); - }; - - $this->_closureQueue = [$closure]; - return $this; - } - - /** - * Return a self-returning black hole object. - * - * @return self - */ - public function andReturnUndefined() - { - $this->andReturn(new \Mockery\Undefined()); - return $this; - } - - /** - * Return null. This is merely a language construct for Mock describing. - * - * @return self - */ - public function andReturnNull() - { - return $this->andReturn(null); - } - - public function andReturnFalse() - { - return $this->andReturn(false); - } - - public function andReturnTrue() - { - return $this->andReturn(true); - } - - /** - * Set Exception class and arguments to that class to be thrown - * - * @param string|\Exception $exception - * @param string $message - * @param int $code - * @param \Exception $previous - * @return self - */ - public function andThrow($exception, $message = '', $code = 0, \Exception $previous = null) - { - $this->_throw = true; - if (is_object($exception)) { - $this->andReturn($exception); - } else { - $this->andReturn(new $exception($message, $code, $previous)); - } - return $this; - } - - public function andThrows($exception, $message = '', $code = 0, \Exception $previous = null) - { - return $this->andThrow($exception, $message, $code, $previous); - } - - /** - * Set Exception classes to be thrown - * - * @param array $exceptions - * @return self - */ - public function andThrowExceptions(array $exceptions) - { - $this->_throw = true; - foreach ($exceptions as $exception) { - if (!is_object($exception)) { - throw new Exception('You must pass an array of exception objects to andThrowExceptions'); - } - } - return $this->andReturnValues($exceptions); - } - - /** - * Register values to be set to a public property each time this expectation occurs - * - * @param string $name - * @param array ...$values - * @return self - */ - public function andSet($name, ...$values) - { - $this->_setQueue[$name] = $values; - return $this; - } - - /** - * Sets up a closure that will yield each of the provided args - * - * @param mixed ...$args - * @return self - */ - public function andYield(...$args) - { - $this->_closureQueue = [ - static function () use ($args) { - foreach ($args as $arg) { - yield $arg; - } - }, - ]; - - return $this; - } - - /** - * Alias to andSet(). Allows the natural English construct - * - set('foo', 'bar')->andReturn('bar') - * - * @param string $name - * @param mixed $value - * @return self - */ - public function set($name, $value) - { - return call_user_func_array(array($this, 'andSet'), func_get_args()); - } - - /** - * Indicates this expectation should occur zero or more times - * - * @return self - */ - public function zeroOrMoreTimes() - { - $this->atLeast()->never(); - } - - /** - * Indicates the number of times this expectation should occur - * - * @param int $limit - * @throws \InvalidArgumentException - * @return self - */ - public function times($limit = null) - { - if (is_null($limit)) { - return $this; - } - if (!is_int($limit)) { - throw new \InvalidArgumentException('The passed Times limit should be an integer value'); - } - $this->_countValidators[$this->_countValidatorClass] = new $this->_countValidatorClass($this, $limit); - - if ('Mockery\CountValidator\Exact' !== $this->_countValidatorClass) { - $this->_countValidatorClass = 'Mockery\CountValidator\Exact'; - unset($this->_countValidators[$this->_countValidatorClass]); - } - - return $this; - } - - /** - * Indicates that this expectation is never expected to be called - * - * @return self - */ - public function never() - { - return $this->times(0); - } - - /** - * Indicates that this expectation is expected exactly once - * - * @return self - */ - public function once() - { - return $this->times(1); - } - - /** - * Indicates that this expectation is expected exactly twice - * - * @return self - */ - public function twice() - { - return $this->times(2); - } - - /** - * Sets next count validator to the AtLeast instance - * - * @return self - */ - public function atLeast() - { - $this->_countValidatorClass = 'Mockery\CountValidator\AtLeast'; - return $this; - } - - /** - * Sets next count validator to the AtMost instance - * - * @return self - */ - public function atMost() - { - $this->_countValidatorClass = 'Mockery\CountValidator\AtMost'; - return $this; - } - - /** - * Shorthand for setting minimum and maximum constraints on call counts - * - * @param int $minimum - * @param int $maximum - */ - public function between($minimum, $maximum) - { - return $this->atLeast()->times($minimum)->atMost()->times($maximum); - } - - - /** - * Set the exception message - * - * @param string $message - * @return $this - */ - public function because($message) - { - $this->_because = $message; - return $this; - } - - /** - * Indicates that this expectation must be called in a specific given order - * - * @param string $group Name of the ordered group - * @return self - */ - public function ordered($group = null) - { - if ($this->_globally) { - $this->_globalOrderNumber = $this->_defineOrdered($group, $this->_mock->mockery_getContainer()); - } else { - $this->_orderNumber = $this->_defineOrdered($group, $this->_mock); - } - $this->_globally = false; - return $this; - } - - /** - * Indicates call order should apply globally - * - * @return self - */ - public function globally() - { - $this->_globally = true; - return $this; - } - - /** - * Setup the ordering tracking on the mock or mock container - * - * @param string $group - * @param object $ordering - * @return int - */ - protected function _defineOrdered($group, $ordering) - { - $groups = $ordering->mockery_getGroups(); - if (is_null($group)) { - $result = $ordering->mockery_allocateOrder(); - } elseif (isset($groups[$group])) { - $result = $groups[$group]; - } else { - $result = $ordering->mockery_allocateOrder(); - $ordering->mockery_setGroup($group, $result); - } - return $result; - } - - /** - * Return order number - * - * @return int - */ - public function getOrderNumber() - { - return $this->_orderNumber; - } - - /** - * Mark this expectation as being a default - * - * @return self - */ - public function byDefault() - { - $director = $this->_mock->mockery_getExpectationsFor($this->_name); - if (!empty($director)) { - $director->makeExpectationDefault($this); - } - return $this; - } - - /** - * Return the parent mock of the expectation - * - * @return \Mockery\LegacyMockInterface|\Mockery\MockInterface - */ - public function getMock() - { - return $this->_mock; - } - - /** - * Flag this expectation as calling the original class method with the - * any provided arguments instead of using a return value queue. - * - * @return self - */ - public function passthru() - { - if ($this->_mock instanceof Mock) { - throw new Exception( - 'Mock Objects not created from a loaded/existing class are ' - . 'incapable of passing method calls through to a parent class' - ); - } - $this->_passthru = true; - return $this; - } - - /** - * Cloning logic - * - */ - public function __clone() - { - $newValidators = array(); - $countValidators = $this->_countValidators; - foreach ($countValidators as $validator) { - $newValidators[] = clone $validator; - } - $this->_countValidators = $newValidators; - } - - public function getName() - { - return $this->_name; - } - - public function getExceptionMessage() - { - return $this->_because; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/ExpectationDirector.php b/vendor/mockery/mockery/library/Mockery/ExpectationDirector.php deleted file mode 100644 index efb0b70b..00000000 --- a/vendor/mockery/mockery/library/Mockery/ExpectationDirector.php +++ /dev/null @@ -1,226 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery; - -class ExpectationDirector -{ - /** - * Method name the director is directing - * - * @var string - */ - protected $_name = null; - - /** - * Mock object the director is attached to - * - * @var \Mockery\MockInterface|\Mockery\LegacyMockInterface - */ - protected $_mock = null; - - /** - * Stores an array of all expectations for this mock - * - * @var array - */ - protected $_expectations = array(); - - /** - * The expected order of next call - * - * @var int - */ - protected $_expectedOrder = null; - - /** - * Stores an array of all default expectations for this mock - * - * @var array - */ - protected $_defaults = array(); - - /** - * Constructor - * - * @param string $name - * @param \Mockery\LegacyMockInterface $mock - */ - public function __construct($name, \Mockery\LegacyMockInterface $mock) - { - $this->_name = $name; - $this->_mock = $mock; - } - - /** - * Add a new expectation to the director - * - * @param \Mockery\Expectation $expectation - */ - public function addExpectation(\Mockery\Expectation $expectation) - { - $this->_expectations[] = $expectation; - } - - /** - * Handle a method call being directed by this instance - * - * @param array $args - * @return mixed - */ - public function call(array $args) - { - $expectation = $this->findExpectation($args); - if (is_null($expectation)) { - $exception = new \Mockery\Exception\NoMatchingExpectationException( - 'No matching handler found for ' - . $this->_mock->mockery_getName() . '::' - . \Mockery::formatArgs($this->_name, $args) - . '. Either the method was unexpected or its arguments matched' - . ' no expected argument list for this method' - . PHP_EOL . PHP_EOL - . \Mockery::formatObjects($args) - ); - $exception->setMock($this->_mock) - ->setMethodName($this->_name) - ->setActualArguments($args); - throw $exception; - } - return $expectation->verifyCall($args); - } - - /** - * Verify all expectations of the director - * - * @throws \Mockery\CountValidator\Exception - * @return void - */ - public function verify() - { - if (!empty($this->_expectations)) { - foreach ($this->_expectations as $exp) { - $exp->verify(); - } - } else { - foreach ($this->_defaults as $exp) { - $exp->verify(); - } - } - } - - /** - * Attempt to locate an expectation matching the provided args - * - * @param array $args - * @return mixed - */ - public function findExpectation(array $args) - { - $expectation = null; - - if (!empty($this->_expectations)) { - $expectation = $this->_findExpectationIn($this->_expectations, $args); - } - - if ($expectation === null && !empty($this->_defaults)) { - $expectation = $this->_findExpectationIn($this->_defaults, $args); - } - - return $expectation; - } - - /** - * Make the given expectation a default for all others assuming it was - * correctly created last - * - * @param \Mockery\Expectation $expectation - */ - public function makeExpectationDefault(\Mockery\Expectation $expectation) - { - $last = end($this->_expectations); - if ($last === $expectation) { - array_pop($this->_expectations); - array_unshift($this->_defaults, $expectation); - } else { - throw new \Mockery\Exception( - 'Cannot turn a previously defined expectation into a default' - ); - } - } - - /** - * Search current array of expectations for a match - * - * @param array $expectations - * @param array $args - * @return mixed - */ - protected function _findExpectationIn(array $expectations, array $args) - { - foreach ($expectations as $exp) { - if ($exp->isEligible() && $exp->matchArgs($args)) { - return $exp; - } - } - foreach ($expectations as $exp) { - if ($exp->matchArgs($args)) { - return $exp; - } - } - } - - /** - * Return all expectations assigned to this director - * - * @return array - */ - public function getExpectations() - { - return $this->_expectations; - } - - /** - * Return all expectations assigned to this director - * - * @return array - */ - public function getDefaultExpectations() - { - return $this->_defaults; - } - - /** - * Return the number of expectations assigned to this director. - * - * @return int - */ - public function getExpectationCount() - { - $count = 0; - /** @var Expectation $expectations */ - $expectations = $this->getExpectations() ?: $this->getDefaultExpectations(); - foreach ($expectations as $expectation) { - if ($expectation->isCallCountConstrained()) { - $count++; - } - } - return $count; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/ExpectationInterface.php b/vendor/mockery/mockery/library/Mockery/ExpectationInterface.php deleted file mode 100644 index f1295ad3..00000000 --- a/vendor/mockery/mockery/library/Mockery/ExpectationInterface.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php - -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery; - -interface ExpectationInterface -{ - /** - * @return int - */ - public function getOrderNumber(); - - /** - * @return LegacyMockInterface|MockInterface - */ - public function getMock(); - - /** - * @param mixed $args - * @return self - */ - public function andReturn(...$args); - - /** - * @return self - */ - public function andReturns(); -} diff --git a/vendor/mockery/mockery/library/Mockery/ExpectsHigherOrderMessage.php b/vendor/mockery/mockery/library/Mockery/ExpectsHigherOrderMessage.php deleted file mode 100644 index 6255cb08..00000000 --- a/vendor/mockery/mockery/library/Mockery/ExpectsHigherOrderMessage.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery; - -class ExpectsHigherOrderMessage extends HigherOrderMessage -{ - public function __construct(MockInterface $mock) - { - parent::__construct($mock, "shouldReceive"); - } - /** - * @return \Mockery\Expectation - */ - public function __call($method, $args) - { - $expectation = parent::__call($method, $args); - - return $expectation->once(); - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/CachingGenerator.php b/vendor/mockery/mockery/library/Mockery/Generator/CachingGenerator.php deleted file mode 100644 index 6497e885..00000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/CachingGenerator.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Generator; - -class CachingGenerator implements Generator -{ - protected $generator; - protected $cache = array(); - - public function __construct(Generator $generator) - { - $this->generator = $generator; - } - - public function generate(MockConfiguration $config) - { - $hash = $config->getHash(); - if (isset($this->cache[$hash])) { - return $this->cache[$hash]; - } - - $definition = $this->generator->generate($config); - $this->cache[$hash] = $definition; - - return $definition; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/DefinedTargetClass.php b/vendor/mockery/mockery/library/Mockery/Generator/DefinedTargetClass.php deleted file mode 100644 index 7463f1d1..00000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/DefinedTargetClass.php +++ /dev/null @@ -1,110 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Generator; - -class DefinedTargetClass implements TargetClassInterface -{ - private $rfc; - private $name; - - public function __construct(\ReflectionClass $rfc, $alias = null) - { - $this->rfc = $rfc; - $this->name = $alias === null ? $rfc->getName() : $alias; - } - - public static function factory($name, $alias = null) - { - return new self(new \ReflectionClass($name), $alias); - } - - public function getName() - { - return $this->name; - } - - public function isAbstract() - { - return $this->rfc->isAbstract(); - } - - public function isFinal() - { - return $this->rfc->isFinal(); - } - - public function getMethods() - { - return array_map(function ($method) { - return new Method($method); - }, $this->rfc->getMethods()); - } - - public function getInterfaces() - { - $class = __CLASS__; - return array_map(function ($interface) use ($class) { - return new $class($interface); - }, $this->rfc->getInterfaces()); - } - - public function __toString() - { - return $this->getName(); - } - - public function getNamespaceName() - { - return $this->rfc->getNamespaceName(); - } - - public function inNamespace() - { - return $this->rfc->inNamespace(); - } - - public function getShortName() - { - return $this->rfc->getShortName(); - } - - public function implementsInterface($interface) - { - return $this->rfc->implementsInterface($interface); - } - - public function hasInternalAncestor() - { - if ($this->rfc->isInternal()) { - return true; - } - - $child = $this->rfc; - while ($parent = $child->getParentClass()) { - if ($parent->isInternal()) { - return true; - } - $child = $parent; - } - - return false; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/Generator.php b/vendor/mockery/mockery/library/Mockery/Generator/Generator.php deleted file mode 100644 index 459a93cc..00000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/Generator.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Generator; - -interface Generator -{ - /** @returns MockDefinition */ - public function generate(MockConfiguration $config); -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/Method.php b/vendor/mockery/mockery/library/Mockery/Generator/Method.php deleted file mode 100644 index 552932fc..00000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/Method.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Generator; - -use Mockery\Reflector; - -class Method -{ - /** @var \ReflectionMethod */ - private $method; - - public function __construct(\ReflectionMethod $method) - { - $this->method = $method; - } - - public function __call($method, $args) - { - return call_user_func_array(array($this->method, $method), $args); - } - - /** - * @return Parameter[] - */ - public function getParameters() - { - return array_map(function (\ReflectionParameter $parameter) { - return new Parameter($parameter); - }, $this->method->getParameters()); - } - - /** - * @return string|null - */ - public function getReturnType() - { - return Reflector::getReturnType($this->method); - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/MockConfiguration.php b/vendor/mockery/mockery/library/Mockery/Generator/MockConfiguration.php deleted file mode 100644 index 05903e5b..00000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/MockConfiguration.php +++ /dev/null @@ -1,556 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Generator; - -/** - * This class describes the configuration of mocks and hides away some of the - * reflection implementation - */ -class MockConfiguration -{ - /** - * A class that we'd like to mock - */ - protected $targetClass; - protected $targetClassName; - - /** - * A number of interfaces we'd like to mock, keyed by name to attempt to - * keep unique - */ - protected $targetInterfaces = array(); - protected $targetInterfaceNames = array(); - - /** - * A number of traits we'd like to mock, keyed by name to attempt to - * keep unique - */ - protected $targetTraits = array(); - protected $targetTraitNames = array(); - - /** - * An object we'd like our mock to proxy to - */ - protected $targetObject; - - /** - * The class name we'd like to use for a generated mock - */ - protected $name; - - /** - * Methods that should specifically not be mocked - * - * This is currently populated with stuff we don't know how to deal with, - * should really be somewhere else - */ - protected $blackListedMethods = array(); - - /** - * If not empty, only these methods will be mocked - */ - protected $whiteListedMethods = array(); - - /** - * An instance mock is where we override the original class before it's - * autoloaded - */ - protected $instanceMock = false; - - /** - * Param overrides - */ - protected $parameterOverrides = array(); - - /** - * Instance cache of all methods - */ - protected $allMethods; - - /** - * If true, overrides original class destructor - */ - protected $mockOriginalDestructor = false; - - protected $constantsMap = array(); - - public function __construct( - array $targets = array(), - array $blackListedMethods = array(), - array $whiteListedMethods = array(), - $name = null, - $instanceMock = false, - array $parameterOverrides = array(), - $mockOriginalDestructor = false, - array $constantsMap = array() - ) { - $this->addTargets($targets); - $this->blackListedMethods = $blackListedMethods; - $this->whiteListedMethods = $whiteListedMethods; - $this->name = $name; - $this->instanceMock = $instanceMock; - $this->parameterOverrides = $parameterOverrides; - $this->mockOriginalDestructor = $mockOriginalDestructor; - $this->constantsMap = $constantsMap; - } - - /** - * Attempt to create a hash of the configuration, in order to allow caching - * - * @TODO workout if this will work - * - * @return string - */ - public function getHash() - { - $vars = array( - 'targetClassName' => $this->targetClassName, - 'targetInterfaceNames' => $this->targetInterfaceNames, - 'targetTraitNames' => $this->targetTraitNames, - 'name' => $this->name, - 'blackListedMethods' => $this->blackListedMethods, - 'whiteListedMethod' => $this->whiteListedMethods, - 'instanceMock' => $this->instanceMock, - 'parameterOverrides' => $this->parameterOverrides, - 'mockOriginalDestructor' => $this->mockOriginalDestructor - ); - - return md5(serialize($vars)); - } - - /** - * Gets a list of methods from the classes, interfaces and objects and - * filters them appropriately. Lot's of filtering going on, perhaps we could - * have filter classes to iterate through - */ - public function getMethodsToMock() - { - $methods = $this->getAllMethods(); - - foreach ($methods as $key => $method) { - if ($method->isFinal()) { - unset($methods[$key]); - } - } - - /** - * Whitelist trumps everything else - */ - if (count($this->getWhiteListedMethods())) { - $whitelist = array_map('strtolower', $this->getWhiteListedMethods()); - $methods = array_filter($methods, function ($method) use ($whitelist) { - return $method->isAbstract() || in_array(strtolower($method->getName()), $whitelist); - }); - - return $methods; - } - - /** - * Remove blacklisted methods - */ - if (count($this->getBlackListedMethods())) { - $blacklist = array_map('strtolower', $this->getBlackListedMethods()); - $methods = array_filter($methods, function ($method) use ($blacklist) { - return !in_array(strtolower($method->getName()), $blacklist); - }); - } - - /** - * Internal objects can not be instantiated with newInstanceArgs and if - * they implement Serializable, unserialize will have to be called. As - * such, we can't mock it and will need a pass to add a dummy - * implementation - */ - if ($this->getTargetClass() - && $this->getTargetClass()->implementsInterface("Serializable") - && $this->getTargetClass()->hasInternalAncestor()) { - $methods = array_filter($methods, function ($method) { - return $method->getName() !== "unserialize"; - }); - } - - return array_values($methods); - } - - /** - * We declare the __call method to handle undefined stuff, if the class - * we're mocking has also defined it, we need to comply with their interface - */ - public function requiresCallTypeHintRemoval() - { - foreach ($this->getAllMethods() as $method) { - if ("__call" === $method->getName()) { - $params = $method->getParameters(); - return !$params[1]->isArray(); - } - } - - return false; - } - - /** - * We declare the __callStatic method to handle undefined stuff, if the class - * we're mocking has also defined it, we need to comply with their interface - */ - public function requiresCallStaticTypeHintRemoval() - { - foreach ($this->getAllMethods() as $method) { - if ("__callStatic" === $method->getName()) { - $params = $method->getParameters(); - return !$params[1]->isArray(); - } - } - - return false; - } - - public function rename($className) - { - $targets = array(); - - if ($this->targetClassName) { - $targets[] = $this->targetClassName; - } - - if ($this->targetInterfaceNames) { - $targets = array_merge($targets, $this->targetInterfaceNames); - } - - if ($this->targetTraitNames) { - $targets = array_merge($targets, $this->targetTraitNames); - } - - if ($this->targetObject) { - $targets[] = $this->targetObject; - } - - return new self( - $targets, - $this->blackListedMethods, - $this->whiteListedMethods, - $className, - $this->instanceMock, - $this->parameterOverrides, - $this->mockOriginalDestructor, - $this->constantsMap - ); - } - - protected function addTarget($target) - { - if (is_object($target)) { - $this->setTargetObject($target); - $this->setTargetClassName(get_class($target)); - return $this; - } - - if ($target[0] !== "\\") { - $target = "\\" . $target; - } - - if (class_exists($target)) { - $this->setTargetClassName($target); - return $this; - } - - if (interface_exists($target)) { - $this->addTargetInterfaceName($target); - return $this; - } - - if (trait_exists($target)) { - $this->addTargetTraitName($target); - return $this; - } - - /** - * Default is to set as class, or interface if class already set - * - * Don't like this condition, can't remember what the default - * targetClass is for - */ - if ($this->getTargetClassName()) { - $this->addTargetInterfaceName($target); - return $this; - } - - $this->setTargetClassName($target); - } - - protected function addTargets($interfaces) - { - foreach ($interfaces as $interface) { - $this->addTarget($interface); - } - } - - public function getTargetClassName() - { - return $this->targetClassName; - } - - public function getTargetClass() - { - if ($this->targetClass) { - return $this->targetClass; - } - - if (!$this->targetClassName) { - return null; - } - - if (class_exists($this->targetClassName)) { - $alias = null; - if (strpos($this->targetClassName, '@') !== false) { - $alias = (new MockNameBuilder()) - ->addPart('anonymous_class') - ->addPart(md5($this->targetClassName)) - ->build(); - class_alias($this->targetClassName, $alias); - } - $dtc = DefinedTargetClass::factory($this->targetClassName, $alias); - - if ($this->getTargetObject() == false && $dtc->isFinal()) { - throw new \Mockery\Exception( - 'The class ' . $this->targetClassName . ' is marked final and its methods' - . ' cannot be replaced. Classes marked final can be passed in' - . ' to \Mockery::mock() as instantiated objects to create a' - . ' partial mock, but only if the mock is not subject to type' - . ' hinting checks.' - ); - } - - $this->targetClass = $dtc; - } else { - $this->targetClass = UndefinedTargetClass::factory($this->targetClassName); - } - - return $this->targetClass; - } - - public function getTargetTraits() - { - if (!empty($this->targetTraits)) { - return $this->targetTraits; - } - - foreach ($this->targetTraitNames as $targetTrait) { - $this->targetTraits[] = DefinedTargetClass::factory($targetTrait); - } - - $this->targetTraits = array_unique($this->targetTraits); // just in case - return $this->targetTraits; - } - - public function getTargetInterfaces() - { - if (!empty($this->targetInterfaces)) { - return $this->targetInterfaces; - } - - foreach ($this->targetInterfaceNames as $targetInterface) { - if (!interface_exists($targetInterface)) { - $this->targetInterfaces[] = UndefinedTargetClass::factory($targetInterface); - continue; - } - - $dtc = DefinedTargetClass::factory($targetInterface); - $extendedInterfaces = array_keys($dtc->getInterfaces()); - $extendedInterfaces[] = $targetInterface; - - $traversableFound = false; - $iteratorShiftedToFront = false; - foreach ($extendedInterfaces as $interface) { - if (!$traversableFound && preg_match("/^\\?Iterator(|Aggregate)$/i", $interface)) { - break; - } - - if (preg_match("/^\\\\?IteratorAggregate$/i", $interface)) { - $this->targetInterfaces[] = DefinedTargetClass::factory("\\IteratorAggregate"); - $iteratorShiftedToFront = true; - } elseif (preg_match("/^\\\\?Iterator$/i", $interface)) { - $this->targetInterfaces[] = DefinedTargetClass::factory("\\Iterator"); - $iteratorShiftedToFront = true; - } elseif (preg_match("/^\\\\?Traversable$/i", $interface)) { - $traversableFound = true; - } - } - - if ($traversableFound && !$iteratorShiftedToFront) { - $this->targetInterfaces[] = DefinedTargetClass::factory("\\IteratorAggregate"); - } - - /** - * We never straight up implement Traversable - */ - if (!preg_match("/^\\\\?Traversable$/i", $targetInterface)) { - $this->targetInterfaces[] = $dtc; - } - } - $this->targetInterfaces = array_unique($this->targetInterfaces); // just in case - return $this->targetInterfaces; - } - - public function getTargetObject() - { - return $this->targetObject; - } - - public function getName() - { - return $this->name; - } - - /** - * Generate a suitable name based on the config - */ - public function generateName() - { - $nameBuilder = new MockNameBuilder(); - - if ($this->getTargetObject()) { - $className = get_class($this->getTargetObject()); - $nameBuilder->addPart(strpos($className, '@') !== false ? md5($className) : $className); - } - - if ($this->getTargetClass()) { - $className = $this->getTargetClass()->getName(); - $nameBuilder->addPart(strpos($className, '@') !== false ? md5($className) : $className); - } - - foreach ($this->getTargetInterfaces() as $targetInterface) { - $nameBuilder->addPart($targetInterface->getName()); - } - - return $nameBuilder->build(); - } - - public function getShortName() - { - $parts = explode("\\", $this->getName()); - return array_pop($parts); - } - - public function getNamespaceName() - { - $parts = explode("\\", $this->getName()); - array_pop($parts); - - if (count($parts)) { - return implode("\\", $parts); - } - - return ""; - } - - public function getBlackListedMethods() - { - return $this->blackListedMethods; - } - - public function getWhiteListedMethods() - { - return $this->whiteListedMethods; - } - - public function isInstanceMock() - { - return $this->instanceMock; - } - - public function getParameterOverrides() - { - return $this->parameterOverrides; - } - - public function isMockOriginalDestructor() - { - return $this->mockOriginalDestructor; - } - - protected function setTargetClassName($targetClassName) - { - $this->targetClassName = $targetClassName; - } - - protected function getAllMethods() - { - if ($this->allMethods) { - return $this->allMethods; - } - - $classes = $this->getTargetInterfaces(); - - if ($this->getTargetClass()) { - $classes[] = $this->getTargetClass(); - } - - $methods = array(); - foreach ($classes as $class) { - $methods = array_merge($methods, $class->getMethods()); - } - - foreach ($this->getTargetTraits() as $trait) { - foreach ($trait->getMethods() as $method) { - if ($method->isAbstract()) { - $methods[] = $method; - } - } - } - - $names = array(); - $methods = array_filter($methods, function ($method) use (&$names) { - if (in_array($method->getName(), $names)) { - return false; - } - - $names[] = $method->getName(); - return true; - }); - - return $this->allMethods = $methods; - } - - /** - * If we attempt to implement Traversable, we must ensure we are also - * implementing either Iterator or IteratorAggregate, and that whichever one - * it is comes before Traversable in the list of implements. - */ - protected function addTargetInterfaceName($targetInterface) - { - $this->targetInterfaceNames[] = $targetInterface; - } - - protected function addTargetTraitName($targetTraitName) - { - $this->targetTraitNames[] = $targetTraitName; - } - - protected function setTargetObject($object) - { - $this->targetObject = $object; - } - - public function getConstantsMap() - { - return $this->constantsMap; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/MockConfigurationBuilder.php b/vendor/mockery/mockery/library/Mockery/Generator/MockConfigurationBuilder.php deleted file mode 100644 index 273b1d8b..00000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/MockConfigurationBuilder.php +++ /dev/null @@ -1,174 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Generator; - -class MockConfigurationBuilder -{ - protected $name; - protected $blackListedMethods = array( - '__call', - '__callStatic', - '__clone', - '__wakeup', - '__set', - '__get', - '__toString', - '__isset', - '__destruct', - '__debugInfo', ## mocking this makes it difficult to debug with xdebug - - // below are reserved words in PHP - "__halt_compiler", "abstract", "and", "array", "as", - "break", "callable", "case", "catch", "class", - "clone", "const", "continue", "declare", "default", - "die", "do", "echo", "else", "elseif", - "empty", "enddeclare", "endfor", "endforeach", "endif", - "endswitch", "endwhile", "eval", "exit", "extends", - "final", "for", "foreach", "function", "global", - "goto", "if", "implements", "include", "include_once", - "instanceof", "insteadof", "interface", "isset", "list", - "namespace", "new", "or", "print", "private", - "protected", "public", "require", "require_once", "return", - "static", "switch", "throw", "trait", "try", - "unset", "use", "var", "while", "xor" - ); - - protected $php7SemiReservedKeywords = [ - "callable", "class", "trait", "extends", "implements", "static", "abstract", "final", - "public", "protected", "private", "const", "enddeclare", "endfor", "endforeach", "endif", - "endwhile", "and", "global", "goto", "instanceof", "insteadof", "interface", "namespace", "new", - "or", "xor", "try", "use", "var", "exit", "list", "clone", "include", "include_once", "throw", - "array", "print", "echo", "require", "require_once", "return", "else", "elseif", "default", - "break", "continue", "switch", "yield", "function", "if", "endswitch", "finally", "for", "foreach", - "declare", "case", "do", "while", "as", "catch", "die", "self", "parent", - ]; - - protected $whiteListedMethods = array(); - protected $instanceMock = false; - protected $parameterOverrides = array(); - - protected $mockOriginalDestructor = false; - protected $targets = array(); - - protected $constantsMap = array(); - - public function __construct() - { - $this->blackListedMethods = array_diff($this->blackListedMethods, $this->php7SemiReservedKeywords); - } - - public function addTarget($target) - { - $this->targets[] = $target; - - return $this; - } - - public function addTargets($targets) - { - foreach ($targets as $target) { - $this->addTarget($target); - } - - return $this; - } - - public function setName($name) - { - $this->name = $name; - return $this; - } - - public function addBlackListedMethod($blackListedMethod) - { - $this->blackListedMethods[] = $blackListedMethod; - return $this; - } - - public function addBlackListedMethods(array $blackListedMethods) - { - foreach ($blackListedMethods as $method) { - $this->addBlackListedMethod($method); - } - return $this; - } - - public function setBlackListedMethods(array $blackListedMethods) - { - $this->blackListedMethods = $blackListedMethods; - return $this; - } - - public function addWhiteListedMethod($whiteListedMethod) - { - $this->whiteListedMethods[] = $whiteListedMethod; - return $this; - } - - public function addWhiteListedMethods(array $whiteListedMethods) - { - foreach ($whiteListedMethods as $method) { - $this->addWhiteListedMethod($method); - } - return $this; - } - - public function setWhiteListedMethods(array $whiteListedMethods) - { - $this->whiteListedMethods = $whiteListedMethods; - return $this; - } - - public function setInstanceMock($instanceMock) - { - $this->instanceMock = (bool) $instanceMock; - } - - public function setParameterOverrides(array $overrides) - { - $this->parameterOverrides = $overrides; - } - - public function setMockOriginalDestructor($mockDestructor) - { - $this->mockOriginalDestructor = $mockDestructor; - return $this; - } - - public function setConstantsMap(array $map) - { - $this->constantsMap = $map; - } - - public function getMockConfiguration() - { - return new MockConfiguration( - $this->targets, - $this->blackListedMethods, - $this->whiteListedMethods, - $this->name, - $this->instanceMock, - $this->parameterOverrides, - $this->mockOriginalDestructor, - $this->constantsMap - ); - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/MockDefinition.php b/vendor/mockery/mockery/library/Mockery/Generator/MockDefinition.php deleted file mode 100644 index fd6a9fa2..00000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/MockDefinition.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Generator; - -class MockDefinition -{ - protected $config; - protected $code; - - public function __construct(MockConfiguration $config, $code) - { - if (!$config->getName()) { - throw new \InvalidArgumentException("MockConfiguration must contain a name"); - } - $this->config = $config; - $this->code = $code; - } - - public function getConfig() - { - return $this->config; - } - - public function getClassName() - { - return $this->config->getName(); - } - - public function getCode() - { - return $this->code; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/MockNameBuilder.php b/vendor/mockery/mockery/library/Mockery/Generator/MockNameBuilder.php deleted file mode 100644 index 204308ab..00000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/MockNameBuilder.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Generator; - -class MockNameBuilder -{ - protected static $mockCounter = 0; - - protected $parts = []; - - public function addPart($part) - { - $this->parts[] = $part; - - return $this; - } - - public function build() - { - $parts = ['Mockery', static::$mockCounter++]; - - foreach ($this->parts as $part) { - $parts[] = str_replace("\\", "_", $part); - } - - return implode('_', $parts); - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/Parameter.php b/vendor/mockery/mockery/library/Mockery/Generator/Parameter.php deleted file mode 100644 index 70095336..00000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/Parameter.php +++ /dev/null @@ -1,117 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Generator; - -use Mockery\Reflector; - -class Parameter -{ - /** @var int */ - private static $parameterCounter = 0; - - /** @var \ReflectionParameter */ - private $rfp; - - public function __construct(\ReflectionParameter $rfp) - { - $this->rfp = $rfp; - } - - public function __call($method, array $args) - { - return call_user_func_array(array($this->rfp, $method), $args); - } - - /** - * Get the reflection class for the parameter type, if it exists. - * - * This will be null if there was no type, or it was a scalar or a union. - * - * @return \ReflectionClass|null - * - * @deprecated since 1.3.3 and will be removed in 2.0. - */ - public function getClass() - { - $typeHint = Reflector::getTypeHint($this->rfp, true); - - return \class_exists($typeHint) ? DefinedTargetClass::factory($typeHint, false) : null; - } - - /** - * Get the string representation for the paramater type. - * - * @return string|null - */ - public function getTypeHint() - { - return Reflector::getTypeHint($this->rfp); - } - - /** - * Get the string representation for the paramater type. - * - * @return string - * - * @deprecated since 1.3.2 and will be removed in 2.0. Use getTypeHint() instead. - */ - public function getTypeHintAsString() - { - return (string) Reflector::getTypeHint($this->rfp, true); - } - - /** - * Get the name of the parameter. - * - * Some internal classes have funny looking definitions! - * - * @return string - */ - public function getName() - { - $name = $this->rfp->getName(); - if (!$name || $name == '...') { - $name = 'arg' . self::$parameterCounter++; - } - - return $name; - } - - /** - * Determine if the parameter is an array. - * - * @return bool - */ - public function isArray() - { - return Reflector::isArray($this->rfp); - } - - /** - * Determine if the parameter is variadic. - * - * @return bool - */ - public function isVariadic() - { - return $this->rfp->isVariadic(); - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/AvoidMethodClashPass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/AvoidMethodClashPass.php deleted file mode 100644 index 45312573..00000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/AvoidMethodClashPass.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Generator\StringManipulation\Pass; - -use Mockery\Generator\Method; -use Mockery\Generator\Parameter; -use Mockery\Generator\MockConfiguration; - -class AvoidMethodClashPass implements Pass -{ - public function apply($code, MockConfiguration $config) - { - $names = array_map(function ($method) { - return $method->getName(); - }, $config->getMethodsToMock()); - - foreach (["allows", "expects"] as $method) { - if (in_array($method, $names)) { - $code = preg_replace( - "#// start method {$method}.*// end method {$method}#ms", - "", - $code - ); - - $code = str_replace(" implements MockInterface", " implements LegacyMockInterface", $code); - } - } - - return $code; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/CallTypeHintPass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/CallTypeHintPass.php deleted file mode 100644 index fd00264c..00000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/CallTypeHintPass.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Generator\StringManipulation\Pass; - -use Mockery\Generator\MockConfiguration; - -class CallTypeHintPass implements Pass -{ - public function apply($code, MockConfiguration $config) - { - if ($config->requiresCallTypeHintRemoval()) { - $code = str_replace( - 'public function __call($method, array $args)', - 'public function __call($method, $args)', - $code - ); - } - - if ($config->requiresCallStaticTypeHintRemoval()) { - $code = str_replace( - 'public static function __callStatic($method, array $args)', - 'public static function __callStatic($method, $args)', - $code - ); - } - - return $code; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassNamePass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassNamePass.php deleted file mode 100644 index b5a31098..00000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassNamePass.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Generator\StringManipulation\Pass; - -use Mockery\Generator\MockConfiguration; - -class ClassNamePass implements Pass -{ - public function apply($code, MockConfiguration $config) - { - $namespace = $config->getNamespaceName(); - - $namespace = ltrim($namespace, "\\"); - - $className = $config->getShortName(); - - $code = str_replace( - 'namespace Mockery;', - $namespace ? 'namespace ' . $namespace . ';' : '', - $code - ); - - $code = str_replace( - 'class Mock', - 'class ' . $className, - $code - ); - - return $code; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassPass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassPass.php deleted file mode 100644 index 1debcbb1..00000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassPass.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Generator\StringManipulation\Pass; - -use Mockery\Generator\MockConfiguration; - -class ClassPass implements Pass -{ - public function apply($code, MockConfiguration $config) - { - $target = $config->getTargetClass(); - - if (!$target) { - return $code; - } - - if ($target->isFinal()) { - return $code; - } - - $className = ltrim($target->getName(), "\\"); - - if (!class_exists($className)) { - \Mockery::declareClass($className); - } - - $code = str_replace( - "implements MockInterface", - "extends \\" . $className . " implements MockInterface", - $code - ); - - return $code; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ConstantsPass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ConstantsPass.php deleted file mode 100644 index df5dd8ce..00000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ConstantsPass.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -namespace Mockery\Generator\StringManipulation\Pass; - -use Mockery\Generator\MockConfiguration; - -class ConstantsPass implements Pass -{ - public function apply($code, MockConfiguration $config) - { - $cm = $config->getConstantsMap(); - if (empty($cm)) { - return $code; - } - - if (!isset($cm[$config->getName()])) { - return $code; - } - - $cm = $cm[$config->getName()]; - - $constantsCode = ''; - foreach ($cm as $constant => $value) { - $constantsCode .= sprintf("\n const %s = %s;\n", $constant, var_export($value, true)); - } - - $i = strrpos($code, '}'); - $code = substr_replace($code, $constantsCode, $i); - $code .= "}\n"; - - return $code; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/InstanceMockPass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/InstanceMockPass.php deleted file mode 100644 index 62791475..00000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/InstanceMockPass.php +++ /dev/null @@ -1,83 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Generator\StringManipulation\Pass; - -use Mockery\Generator\MockConfiguration; - -class InstanceMockPass -{ - const INSTANCE_MOCK_CODE = <<<MOCK - - protected \$_mockery_ignoreVerification = true; - - public function __construct() - { - \$this->_mockery_ignoreVerification = false; - \$associatedRealObject = \Mockery::fetchMock(__CLASS__); - - foreach (get_object_vars(\$this) as \$attr => \$val) { - if (\$attr !== "_mockery_ignoreVerification" && \$attr !== "_mockery_expectations") { - \$this->\$attr = \$associatedRealObject->\$attr; - } - } - - \$directors = \$associatedRealObject->mockery_getExpectations(); - foreach (\$directors as \$method=>\$director) { - // get the director method needed - \$existingDirector = \$this->mockery_getExpectationsFor(\$method); - if (!\$existingDirector) { - \$existingDirector = new \Mockery\ExpectationDirector(\$method, \$this); - \$this->mockery_setExpectationsFor(\$method, \$existingDirector); - } - \$expectations = \$director->getExpectations(); - foreach (\$expectations as \$expectation) { - \$clonedExpectation = clone \$expectation; - \$existingDirector->addExpectation(\$clonedExpectation); - } - \$defaultExpectations = \$director->getDefaultExpectations(); - foreach (array_reverse(\$defaultExpectations) as \$expectation) { - \$clonedExpectation = clone \$expectation; - \$existingDirector->addExpectation(\$clonedExpectation); - \$existingDirector->makeExpectationDefault(\$clonedExpectation); - } - } - \Mockery::getContainer()->rememberMock(\$this); - - \$this->_mockery_constructorCalled(func_get_args()); - } -MOCK; - - public function apply($code, MockConfiguration $config) - { - if ($config->isInstanceMock()) { - $code = $this->appendToClass($code, static::INSTANCE_MOCK_CODE); - } - - return $code; - } - - protected function appendToClass($class, $code) - { - $lastBrace = strrpos($class, "}"); - $class = substr($class, 0, $lastBrace) . $code . "\n }\n"; - return $class; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/InterfacePass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/InterfacePass.php deleted file mode 100644 index 982956e5..00000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/InterfacePass.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Generator\StringManipulation\Pass; - -use Mockery\Generator\MockConfiguration; - -class InterfacePass implements Pass -{ - public function apply($code, MockConfiguration $config) - { - foreach ($config->getTargetInterfaces() as $i) { - $name = ltrim($i->getName(), "\\"); - if (!interface_exists($name)) { - \Mockery::declareInterface($name); - } - } - - $interfaces = array_reduce((array) $config->getTargetInterfaces(), function ($code, $i) { - return $code . ", \\" . ltrim($i->getName(), "\\"); - }, ""); - - $code = str_replace( - "implements MockInterface", - "implements MockInterface" . $interfaces, - $code - ); - - return $code; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/MagicMethodTypeHintsPass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/MagicMethodTypeHintsPass.php deleted file mode 100644 index ddcdb0b7..00000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/MagicMethodTypeHintsPass.php +++ /dev/null @@ -1,212 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Generator\StringManipulation\Pass; - -use Mockery\Generator\MockConfiguration; -use Mockery\Generator\TargetClassInterface; -use Mockery\Generator\Method; -use Mockery\Generator\Parameter; - -class MagicMethodTypeHintsPass implements Pass -{ - /** - * @var array $mockMagicMethods - */ - private $mockMagicMethods = array( - '__construct', - '__destruct', - '__call', - '__callStatic', - '__get', - '__set', - '__isset', - '__unset', - '__sleep', - '__wakeup', - '__toString', - '__invoke', - '__set_state', - '__clone', - '__debugInfo' - ); - - /** - * Apply implementation. - * - * @param string $code - * @param MockConfiguration $config - * @return string - */ - public function apply($code, MockConfiguration $config) - { - $magicMethods = $this->getMagicMethods($config->getTargetClass()); - foreach ($config->getTargetInterfaces() as $interface) { - $magicMethods = array_merge($magicMethods, $this->getMagicMethods($interface)); - } - - foreach ($magicMethods as $method) { - $code = $this->applyMagicTypeHints($code, $method); - } - - return $code; - } - - /** - * Returns the magic methods within the - * passed DefinedTargetClass. - * - * @param TargetClassInterface $class - * @return array - */ - public function getMagicMethods( - TargetClassInterface $class = null - ) { - if (is_null($class)) { - return array(); - } - return array_filter($class->getMethods(), function (Method $method) { - return in_array($method->getName(), $this->mockMagicMethods); - }); - } - - /** - * Applies type hints of magic methods from - * class to the passed code. - * - * @param int $code - * @param Method $method - * @return string - */ - private function applyMagicTypeHints($code, Method $method) - { - if ($this->isMethodWithinCode($code, $method)) { - $namedParameters = $this->getOriginalParameters( - $code, - $method - ); - $code = preg_replace( - $this->getDeclarationRegex($method->getName()), - $this->getMethodDeclaration($method, $namedParameters), - $code - ); - } - return $code; - } - - /** - * Checks if the method is declared within code. - * - * @param int $code - * @param Method $method - * @return boolean - */ - private function isMethodWithinCode($code, Method $method) - { - return preg_match( - $this->getDeclarationRegex($method->getName()), - $code - ) == 1; - } - - /** - * Returns the method original parameters, as they're - * described in the $code string. - * - * @param int $code - * @param Method $method - * @return array - */ - private function getOriginalParameters($code, Method $method) - { - $matches = []; - $parameterMatches = []; - - preg_match( - $this->getDeclarationRegex($method->getName()), - $code, - $matches - ); - - if (count($matches) > 0) { - preg_match_all( - '/(?<=\$)(\w+)+/i', - $matches[0], - $parameterMatches - ); - } - - $groupMatches = end($parameterMatches); - $parameterNames = is_array($groupMatches) ? $groupMatches : [$groupMatches]; - - return $parameterNames; - } - - /** - * Gets the declaration code, as a string, for the passed method. - * - * @param Method $method - * @param array $namedParameters - * @return string - */ - private function getMethodDeclaration( - Method $method, - array $namedParameters - ) { - $declaration = 'public'; - $declaration .= $method->isStatic() ? ' static' : ''; - $declaration .= ' function ' . $method->getName() . '('; - - foreach ($method->getParameters() as $index => $parameter) { - $declaration .= $this->renderTypeHint($parameter); - $name = isset($namedParameters[$index]) ? $namedParameters[$index] : $parameter->getName(); - $declaration .= '$' . $name; - $declaration .= ','; - } - $declaration = rtrim($declaration, ','); - $declaration .= ') '; - - $returnType = $method->getReturnType(); - if ($returnType !== null) { - $declaration .= sprintf(': %s', $returnType); - } - - return $declaration; - } - - protected function renderTypeHint(Parameter $param) - { - $typeHint = $param->getTypeHint(); - - return $typeHint === null ? '' : sprintf('%s ', $typeHint); - } - - /** - * Returns a regex string used to match the - * declaration of some method. - * - * @param string $methodName - * @return string - */ - private function getDeclarationRegex($methodName) - { - return "/public\s+(?:static\s+)?function\s+$methodName\s*\(.*\)\s*(?=\{)/i"; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/MethodDefinitionPass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/MethodDefinitionPass.php deleted file mode 100644 index b0b743df..00000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/MethodDefinitionPass.php +++ /dev/null @@ -1,167 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Generator\StringManipulation\Pass; - -use Mockery\Generator\Method; -use Mockery\Generator\Parameter; -use Mockery\Generator\MockConfiguration; - -class MethodDefinitionPass implements Pass -{ - public function apply($code, MockConfiguration $config) - { - foreach ($config->getMethodsToMock() as $method) { - if ($method->isPublic()) { - $methodDef = 'public'; - } elseif ($method->isProtected()) { - $methodDef = 'protected'; - } else { - $methodDef = 'private'; - } - - if ($method->isStatic()) { - $methodDef .= ' static'; - } - - $methodDef .= ' function '; - $methodDef .= $method->returnsReference() ? ' & ' : ''; - $methodDef .= $method->getName(); - $methodDef .= $this->renderParams($method, $config); - $methodDef .= $this->renderReturnType($method); - $methodDef .= $this->renderMethodBody($method, $config); - - $code = $this->appendToClass($code, $methodDef); - } - - return $code; - } - - protected function renderParams(Method $method, $config) - { - $class = $method->getDeclaringClass(); - if ($class->isInternal()) { - $overrides = $config->getParameterOverrides(); - - if (isset($overrides[strtolower($class->getName())][$method->getName()])) { - return '(' . implode(',', $overrides[strtolower($class->getName())][$method->getName()]) . ')'; - } - } - - $methodParams = array(); - $params = $method->getParameters(); - foreach ($params as $param) { - $paramDef = $this->renderTypeHint($param); - $paramDef .= $param->isPassedByReference() ? '&' : ''; - $paramDef .= $param->isVariadic() ? '...' : ''; - $paramDef .= '$' . $param->getName(); - - if (!$param->isVariadic()) { - if (false !== $param->isDefaultValueAvailable()) { - $defaultValue = $param->getDefaultValue(); - $paramDef .= ' = ' . (is_object($defaultValue) ? get_class($defaultValue) : var_export($defaultValue, true)); - } elseif ($param->isOptional()) { - $paramDef .= ' = null'; - } - } - - $methodParams[] = $paramDef; - } - return '(' . implode(', ', $methodParams) . ')'; - } - - protected function renderReturnType(Method $method) - { - $type = $method->getReturnType(); - - return $type ? sprintf(': %s', $type) : ''; - } - - protected function appendToClass($class, $code) - { - $lastBrace = strrpos($class, "}"); - $class = substr($class, 0, $lastBrace) . $code . "\n }\n"; - return $class; - } - - protected function renderTypeHint(Parameter $param) - { - $typeHint = $param->getTypeHint(); - - return $typeHint === null ? '' : sprintf('%s ', $typeHint); - } - - private function renderMethodBody($method, $config) - { - $invoke = $method->isStatic() ? 'static::_mockery_handleStaticMethodCall' : '$this->_mockery_handleMethodCall'; - $body = <<<BODY -{ -\$argc = func_num_args(); -\$argv = func_get_args(); - -BODY; - - // Fix up known parameters by reference - used func_get_args() above - // in case more parameters are passed in than the function definition - // says - eg varargs. - $class = $method->getDeclaringClass(); - $class_name = strtolower($class->getName()); - $overrides = $config->getParameterOverrides(); - if (isset($overrides[$class_name][$method->getName()])) { - $params = array_values($overrides[$class_name][$method->getName()]); - $paramCount = count($params); - for ($i = 0; $i < $paramCount; ++$i) { - $param = $params[$i]; - if (strpos($param, '&') !== false) { - $body .= <<<BODY -if (\$argc > $i) { - \$argv[$i] = {$param}; -} - -BODY; - } - } - } else { - $params = array_values($method->getParameters()); - $paramCount = count($params); - for ($i = 0; $i < $paramCount; ++$i) { - $param = $params[$i]; - if (!$param->isPassedByReference()) { - continue; - } - $body .= <<<BODY -if (\$argc > $i) { - \$argv[$i] =& \${$param->getName()}; -} - -BODY; - } - } - - $body .= "\$ret = {$invoke}(__FUNCTION__, \$argv);\n"; - - if (! in_array($method->getReturnType(), ['never','void'], true)) { - $body .= "return \$ret;\n"; - } - - $body .= "}\n"; - return $body; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/Pass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/Pass.php deleted file mode 100644 index f7b72c9f..00000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/Pass.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Generator\StringManipulation\Pass; - -use Mockery\Generator\MockConfiguration; - -interface Pass -{ - public function apply($code, MockConfiguration $config); -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/RemoveBuiltinMethodsThatAreFinalPass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/RemoveBuiltinMethodsThatAreFinalPass.php deleted file mode 100644 index 7b0850ed..00000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/RemoveBuiltinMethodsThatAreFinalPass.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Generator\StringManipulation\Pass; - -use Mockery\Generator\MockConfiguration; - -/** - * The standard Mockery\Mock class includes some methods to ease mocking, such - * as __wakeup, however if the target has a final __wakeup method, it can't be - * mocked. This pass removes the builtin methods where they are final on the - * target - */ -class RemoveBuiltinMethodsThatAreFinalPass -{ - protected $methods = array( - '__wakeup' => '/public function __wakeup\(\)\s+\{.*?\}/sm', - '__toString' => '/public function __toString\(\)\s+(:\s+string)?\s*\{.*?\}/sm', - ); - - public function apply($code, MockConfiguration $config) - { - $target = $config->getTargetClass(); - - if (!$target) { - return $code; - } - - foreach ($target->getMethods() as $method) { - if ($method->isFinal() && isset($this->methods[$method->getName()])) { - $code = preg_replace($this->methods[$method->getName()], '', $code); - } - } - - return $code; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/RemoveDestructorPass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/RemoveDestructorPass.php deleted file mode 100644 index ed5a4206..00000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/RemoveDestructorPass.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - * @author Boris Avdeev <elephant@lislon.ru> - */ - -namespace Mockery\Generator\StringManipulation\Pass; - -use Mockery\Generator\MockConfiguration; - -/** - * Remove mock's empty destructor if we tend to use original class destructor - */ -class RemoveDestructorPass -{ - public function apply($code, MockConfiguration $config) - { - $target = $config->getTargetClass(); - - if (!$target) { - return $code; - } - - if (!$config->isMockOriginalDestructor()) { - $code = preg_replace('/public function __destruct\(\)\s+\{.*?\}/sm', '', $code); - } - - return $code; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/RemoveUnserializeForInternalSerializableClassesPass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/RemoveUnserializeForInternalSerializableClassesPass.php deleted file mode 100644 index 0abefe26..00000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/RemoveUnserializeForInternalSerializableClassesPass.php +++ /dev/null @@ -1,59 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Generator\StringManipulation\Pass; - -use Mockery\Generator\MockConfiguration; - -/** - * Internal classes can not be instantiated with the newInstanceWithoutArgs - * reflection method, so need the serialization hack. If the class also - * implements Serializable, we need to replace the standard unserialize method - * definition with a dummy - */ -class RemoveUnserializeForInternalSerializableClassesPass -{ - const DUMMY_METHOD_DEFINITION_LEGACY = 'public function unserialize($string) {} '; - const DUMMY_METHOD_DEFINITION = 'public function unserialize(string $data): void {} '; - - public function apply($code, MockConfiguration $config) - { - $target = $config->getTargetClass(); - - if (!$target) { - return $code; - } - - if (!$target->hasInternalAncestor() || !$target->implementsInterface("Serializable")) { - return $code; - } - - $code = $this->appendToClass($code, \PHP_VERSION_ID < 80100 ? self::DUMMY_METHOD_DEFINITION_LEGACY : self::DUMMY_METHOD_DEFINITION); - - return $code; - } - - protected function appendToClass($class, $code) - { - $lastBrace = strrpos($class, "}"); - $class = substr($class, 0, $lastBrace) . $code . "\n }\n"; - return $class; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/TraitPass.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/TraitPass.php deleted file mode 100644 index f6db5d74..00000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/TraitPass.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Generator\StringManipulation\Pass; - -use Mockery\Generator\MockConfiguration; - -class TraitPass implements Pass -{ - public function apply($code, MockConfiguration $config) - { - $traits = $config->getTargetTraits(); - - if (empty($traits)) { - return $code; - } - - $useStatements = array_map(function ($trait) { - return "use \\\\" . ltrim($trait->getName(), "\\") . ";"; - }, $traits); - - $code = preg_replace( - '/^{$/m', - "{\n " . implode("\n ", $useStatements) . "\n", - $code - ); - - return $code; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulationGenerator.php b/vendor/mockery/mockery/library/Mockery/Generator/StringManipulationGenerator.php deleted file mode 100644 index 4bc415f6..00000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/StringManipulationGenerator.php +++ /dev/null @@ -1,89 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Generator; - -use Mockery\Generator\StringManipulation\Pass\CallTypeHintPass; -use Mockery\Generator\StringManipulation\Pass\ClassNamePass; -use Mockery\Generator\StringManipulation\Pass\ClassPass; -use Mockery\Generator\StringManipulation\Pass\ConstantsPass; -use Mockery\Generator\StringManipulation\Pass\InstanceMockPass; -use Mockery\Generator\StringManipulation\Pass\InterfacePass; -use Mockery\Generator\StringManipulation\Pass\MagicMethodTypeHintsPass; -use Mockery\Generator\StringManipulation\Pass\MethodDefinitionPass; -use Mockery\Generator\StringManipulation\Pass\Pass; -use Mockery\Generator\StringManipulation\Pass\RemoveBuiltinMethodsThatAreFinalPass; -use Mockery\Generator\StringManipulation\Pass\RemoveDestructorPass; -use Mockery\Generator\StringManipulation\Pass\RemoveUnserializeForInternalSerializableClassesPass; -use Mockery\Generator\StringManipulation\Pass\TraitPass; -use Mockery\Generator\StringManipulation\Pass\AvoidMethodClashPass; - -class StringManipulationGenerator implements Generator -{ - protected $passes = array(); - - /** - * Creates a new StringManipulationGenerator with the default passes - * - * @return StringManipulationGenerator - */ - public static function withDefaultPasses() - { - return new static([ - new CallTypeHintPass(), - new MagicMethodTypeHintsPass(), - new ClassPass(), - new TraitPass(), - new ClassNamePass(), - new InstanceMockPass(), - new InterfacePass(), - new AvoidMethodClashPass(), - new MethodDefinitionPass(), - new RemoveUnserializeForInternalSerializableClassesPass(), - new RemoveBuiltinMethodsThatAreFinalPass(), - new RemoveDestructorPass(), - new ConstantsPass(), - ]); - } - - public function __construct(array $passes) - { - $this->passes = $passes; - } - - public function generate(MockConfiguration $config) - { - $code = file_get_contents(__DIR__ . '/../Mock.php'); - $className = $config->getName() ?: $config->generateName(); - - $namedConfig = $config->rename($className); - - foreach ($this->passes as $pass) { - $code = $pass->apply($code, $namedConfig); - } - - return new MockDefinition($namedConfig, $code); - } - - public function addPass(Pass $pass) - { - $this->passes[] = $pass; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/TargetClassInterface.php b/vendor/mockery/mockery/library/Mockery/Generator/TargetClassInterface.php deleted file mode 100644 index 77244124..00000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/TargetClassInterface.php +++ /dev/null @@ -1,107 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Generator; - -interface TargetClassInterface -{ - /** - * Returns a new instance of the current - * TargetClassInterface's - * implementation. - * - * @param string $name - * @return TargetClassInterface - */ - public static function factory($name); - - /** - * Returns the targetClass's name. - * - * @return string - */ - public function getName(); - - /** - * Returns the targetClass's methods. - * - * @return array - */ - public function getMethods(); - - /** - * Returns the targetClass's interfaces. - * - * @return array - */ - public function getInterfaces(); - - /** - * Returns the targetClass's namespace name. - * - * @return string - */ - public function getNamespaceName(); - - /** - * Returns the targetClass's short name. - * - * @return string - */ - public function getShortName(); - - /** - * Returns whether the targetClass is abstract. - * - * @return boolean - */ - public function isAbstract(); - - /** - * Returns whether the targetClass is final. - * - * @return boolean - */ - public function isFinal(); - - /** - * Returns whether the targetClass is in namespace. - * - * @return boolean - */ - public function inNamespace(); - - /** - * Returns whether the targetClass is in - * the passed interface. - * - * @param mixed $interface - * @return boolean - */ - public function implementsInterface($interface); - - /** - * Returns whether the targetClass has - * an internal ancestor. - * - * @return boolean - */ - public function hasInternalAncestor(); -} diff --git a/vendor/mockery/mockery/library/Mockery/Generator/UndefinedTargetClass.php b/vendor/mockery/mockery/library/Mockery/Generator/UndefinedTargetClass.php deleted file mode 100644 index fb83c610..00000000 --- a/vendor/mockery/mockery/library/Mockery/Generator/UndefinedTargetClass.php +++ /dev/null @@ -1,94 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Generator; - -class UndefinedTargetClass implements TargetClassInterface -{ - private $name; - - public function __construct($name) - { - $this->name = $name; - } - - public static function factory($name) - { - return new self($name); - } - - public function getName() - { - return $this->name; - } - - public function isAbstract() - { - return false; - } - - public function isFinal() - { - return false; - } - - public function getMethods() - { - return array(); - } - - public function getInterfaces() - { - return array(); - } - - public function getNamespaceName() - { - $parts = explode("\\", ltrim($this->getName(), "\\")); - array_pop($parts); - return implode("\\", $parts); - } - - public function inNamespace() - { - return $this->getNamespaceName() !== ''; - } - - public function getShortName() - { - $parts = explode("\\", $this->getName()); - return array_pop($parts); - } - - public function implementsInterface($interface) - { - return false; - } - - public function hasInternalAncestor() - { - return false; - } - - public function __toString() - { - return $this->name; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/HigherOrderMessage.php b/vendor/mockery/mockery/library/Mockery/HigherOrderMessage.php deleted file mode 100644 index 1c13c898..00000000 --- a/vendor/mockery/mockery/library/Mockery/HigherOrderMessage.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery; - -/** - * @method \Mockery\Expectation withArgs(\Closure|array $args) - */ -class HigherOrderMessage -{ - private $mock; - private $method; - - public function __construct(MockInterface $mock, $method) - { - $this->mock = $mock; - $this->method = $method; - } - - /** - * @return \Mockery\Expectation - */ - public function __call($method, $args) - { - if ($this->method === 'shouldNotHaveReceived') { - return $this->mock->{$this->method}($method, $args); - } - - $expectation = $this->mock->{$this->method}($method); - return $expectation->withArgs($args); - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Instantiator.php b/vendor/mockery/mockery/library/Mockery/Instantiator.php deleted file mode 100644 index 0eafff7f..00000000 --- a/vendor/mockery/mockery/library/Mockery/Instantiator.php +++ /dev/null @@ -1,162 +0,0 @@ -<?php -/* - * 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. - * - * This software consists of voluntary contributions made by many individuals - * and is licensed under the MIT license. For more information, see - * <http://www.doctrine-project.org>. - */ - -namespace Mockery; - -use Closure; -use ReflectionClass; -use UnexpectedValueException; -use InvalidArgumentException; - -/** - * This is a trimmed down version of https://github.com/doctrine/instantiator, - * basically without the caching - * - * @author Marco Pivetta <ocramius@gmail.com> - */ -final class Instantiator -{ - /** - * {@inheritDoc} - */ - public function instantiate($className) - { - $factory = $this->buildFactory($className); - $instance = $factory(); - - return $instance; - } - - /** - * Builds a {@see \Closure} capable of instantiating the given $className without - * invoking its constructor. - * - * @param string $className - * - * @return Closure - */ - private function buildFactory($className) - { - $reflectionClass = $this->getReflectionClass($className); - - if ($this->isInstantiableViaReflection($reflectionClass)) { - return function () use ($reflectionClass) { - return $reflectionClass->newInstanceWithoutConstructor(); - }; - } - - $serializedString = sprintf( - 'O:%d:"%s":0:{}', - strlen($className), - $className - ); - - $this->attemptInstantiationViaUnSerialization($reflectionClass, $serializedString); - - return function () use ($serializedString) { - return unserialize($serializedString); - }; - } - - /** - * @param string $className - * - * @return ReflectionClass - * - * @throws InvalidArgumentException - */ - private function getReflectionClass($className) - { - if (! class_exists($className)) { - throw new InvalidArgumentException("Class:$className does not exist"); - } - - $reflection = new ReflectionClass($className); - - if ($reflection->isAbstract()) { - throw new InvalidArgumentException("Class:$className is an abstract class"); - } - - return $reflection; - } - - /** - * @param ReflectionClass $reflectionClass - * @param string $serializedString - * - * @throws UnexpectedValueException - * - * @return void - */ - private function attemptInstantiationViaUnSerialization(ReflectionClass $reflectionClass, $serializedString) - { - set_error_handler(function ($code, $message, $file, $line) use ($reflectionClass, & $error) { - $msg = sprintf( - 'Could not produce an instance of "%s" via un-serialization, since an error was triggered in file "%s" at line "%d"', - $reflectionClass->getName(), - $file, - $line - ); - - $error = new UnexpectedValueException($msg, 0, new \Exception($message, $code)); - }); - - try { - unserialize($serializedString); - } catch (\Exception $exception) { - restore_error_handler(); - - throw new UnexpectedValueException("An exception was raised while trying to instantiate an instance of \"{$reflectionClass->getName()}\" via un-serialization", 0, $exception); - } - - restore_error_handler(); - - if ($error) { - throw $error; - } - } - - /** - * @param ReflectionClass $reflectionClass - * - * @return bool - */ - private function isInstantiableViaReflection(ReflectionClass $reflectionClass) - { - return ! ($reflectionClass->isInternal() && $reflectionClass->isFinal()); - } - - /** - * Verifies whether the given class is to be considered internal - * - * @param ReflectionClass $reflectionClass - * - * @return bool - */ - private function hasInternalAncestors(ReflectionClass $reflectionClass) - { - do { - if ($reflectionClass->isInternal()) { - return true; - } - } while ($reflectionClass = $reflectionClass->getParentClass()); - - return false; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/LegacyMockInterface.php b/vendor/mockery/mockery/library/Mockery/LegacyMockInterface.php deleted file mode 100644 index ae0cc2a7..00000000 --- a/vendor/mockery/mockery/library/Mockery/LegacyMockInterface.php +++ /dev/null @@ -1,240 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery; - -interface LegacyMockInterface -{ - /** - * Alternative setup method to constructor - * - * @param \Mockery\Container $container - * @param object $partialObject - * @return void - */ - public function mockery_init(\Mockery\Container $container = null, $partialObject = null); - - /** - * Set expected method calls - * - * @param string|array ...$methodNames one or many methods that are expected to be called in this mock - * - * @return \Mockery\ExpectationInterface|\Mockery\Expectation|\Mockery\HigherOrderMessage - */ - public function shouldReceive(...$methodNames); - - /** - * Shortcut method for setting an expectation that a method should not be called. - * - * @param string|array ...$methodNames one or many methods that are expected not to be called in this mock - * @return \Mockery\ExpectationInterface|\Mockery\Expectation|\Mockery\HigherOrderMessage - */ - public function shouldNotReceive(...$methodNames); - - /** - * Allows additional methods to be mocked that do not explicitly exist on mocked class - * @param String $method name of the method to be mocked - */ - public function shouldAllowMockingMethod($method); - - /** - * Set mock to ignore unexpected methods and return Undefined class - * @param mixed $returnValue the default return value for calls to missing functions on this mock - * @return Mock - */ - public function shouldIgnoreMissing($returnValue = null); - - /** - * @return Mock - */ - public function shouldAllowMockingProtectedMethods(); - - /** - * Set mock to defer unexpected methods to its parent if possible - * - * @deprecated since 1.4.0. Please use makePartial() instead. - * - * @return Mock - */ - public function shouldDeferMissing(); - - /** - * Set mock to defer unexpected methods to its parent if possible - * - * @return Mock - */ - public function makePartial(); - - /** - * @param null|string $method - * @param null|array|Closure $args - * @return mixed - */ - public function shouldHaveReceived($method, $args = null); - - /** - * @return mixed - */ - public function shouldHaveBeenCalled(); - - /** - * @param null|string $method - * @param null|array|Closure $args - * @return mixed - */ - public function shouldNotHaveReceived($method, $args = null); - - /** - * @param array $args (optional) - * @return mixed - */ - public function shouldNotHaveBeenCalled(array $args = null); - - /** - * In the event shouldReceive() accepting an array of methods/returns - * this method will switch them from normal expectations to default - * expectations - * - * @return self - */ - public function byDefault(); - - /** - * Iterate across all expectation directors and validate each - * - * @throws \Mockery\CountValidator\Exception - * @return void - */ - public function mockery_verify(); - - /** - * Tear down tasks for this mock - * - * @return void - */ - public function mockery_teardown(); - - /** - * Fetch the next available allocation order number - * - * @return int - */ - public function mockery_allocateOrder(); - - /** - * Set ordering for a group - * - * @param mixed $group - * @param int $order - */ - public function mockery_setGroup($group, $order); - - /** - * Fetch array of ordered groups - * - * @return array - */ - public function mockery_getGroups(); - - /** - * Set current ordered number - * - * @param int $order - */ - public function mockery_setCurrentOrder($order); - - /** - * Get current ordered number - * - * @return int - */ - public function mockery_getCurrentOrder(); - - /** - * Validate the current mock's ordering - * - * @param string $method - * @param int $order - * @throws \Mockery\Exception - * @return void - */ - public function mockery_validateOrder($method, $order); - - /** - * Gets the count of expectations for this mock - * - * @return int - */ - public function mockery_getExpectationCount(); - - /** - * Return the expectations director for the given method - * - * @var string $method - * @return \Mockery\ExpectationDirector|null - */ - public function mockery_setExpectationsFor($method, \Mockery\ExpectationDirector $director); - - /** - * Return the expectations director for the given method - * - * @var string $method - * @return \Mockery\ExpectationDirector|null - */ - public function mockery_getExpectationsFor($method); - - /** - * Find an expectation matching the given method and arguments - * - * @var string $method - * @var array $args - * @return \Mockery\Expectation|null - */ - public function mockery_findExpectation($method, array $args); - - /** - * Return the container for this mock - * - * @return \Mockery\Container - */ - public function mockery_getContainer(); - - /** - * Return the name for this mock - * - * @return string - */ - public function mockery_getName(); - - /** - * @return array - */ - public function mockery_getMockableProperties(); - - /** - * @return string[] - */ - public function mockery_getMockableMethods(); - - /** - * @return bool - */ - public function mockery_isAnonymous(); -} diff --git a/vendor/mockery/mockery/library/Mockery/Loader/EvalLoader.php b/vendor/mockery/mockery/library/Mockery/Loader/EvalLoader.php deleted file mode 100644 index e5f78a20..00000000 --- a/vendor/mockery/mockery/library/Mockery/Loader/EvalLoader.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Loader; - -use Mockery\Generator\MockDefinition; -use Mockery\Loader\Loader; - -class EvalLoader implements Loader -{ - public function load(MockDefinition $definition) - { - if (class_exists($definition->getClassName(), false)) { - return; - } - - eval("?>" . $definition->getCode()); - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Loader/Loader.php b/vendor/mockery/mockery/library/Mockery/Loader/Loader.php deleted file mode 100644 index 170ffb6e..00000000 --- a/vendor/mockery/mockery/library/Mockery/Loader/Loader.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Loader; - -use Mockery\Generator\MockDefinition; - -interface Loader -{ - public function load(MockDefinition $definition); -} diff --git a/vendor/mockery/mockery/library/Mockery/Loader/RequireLoader.php b/vendor/mockery/mockery/library/Mockery/Loader/RequireLoader.php deleted file mode 100644 index a2934ebd..00000000 --- a/vendor/mockery/mockery/library/Mockery/Loader/RequireLoader.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Loader; - -use Mockery\Generator\MockDefinition; -use Mockery\Loader\Loader; - -class RequireLoader implements Loader -{ - protected $path; - - public function __construct($path = null) - { - $this->path = realpath($path) ?: sys_get_temp_dir(); - } - - public function load(MockDefinition $definition) - { - if (class_exists($definition->getClassName(), false)) { - return; - } - - $tmpfname = $this->path . DIRECTORY_SEPARATOR . "Mockery_" . uniqid() . ".php"; - file_put_contents($tmpfname, $definition->getCode()); - - require $tmpfname; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/AndAnyOtherArgs.php b/vendor/mockery/mockery/library/Mockery/Matcher/AndAnyOtherArgs.php deleted file mode 100644 index e3c3b943..00000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/AndAnyOtherArgs.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Matcher; - -class AndAnyOtherArgs extends MatcherAbstract -{ - /** - * Check if the actual value matches the expected. - * - * @param mixed $actual - * @return bool - */ - public function match(&$actual) - { - return true; - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - return '<AndAnyOthers>'; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/Any.php b/vendor/mockery/mockery/library/Mockery/Matcher/Any.php deleted file mode 100644 index 1ff440b1..00000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/Any.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Matcher; - -class Any extends MatcherAbstract -{ - /** - * Check if the actual value matches the expected. - * - * @param mixed $actual - * @return bool - */ - public function match(&$actual) - { - return true; - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - return '<Any>'; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/AnyArgs.php b/vendor/mockery/mockery/library/Mockery/Matcher/AnyArgs.php deleted file mode 100644 index 9663a76d..00000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/AnyArgs.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2017 Dave Marshall - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Matcher; - -class AnyArgs extends MatcherAbstract implements ArgumentListMatcher -{ - /** - * @inheritdoc - */ - public function match(&$actual) - { - return true; - } - - /** - * @inheritdoc - */ - public function __toString() - { - return '<Any Arguments>'; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/AnyOf.php b/vendor/mockery/mockery/library/Mockery/Matcher/AnyOf.php deleted file mode 100644 index bcce4b74..00000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/AnyOf.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Matcher; - -class AnyOf extends MatcherAbstract -{ - /** - * Check if the actual value does not match the expected (in this - * case it's specifically NOT expected). - * - * @param mixed $actual - * @return bool - */ - public function match(&$actual) - { - return in_array($actual, $this->_expected, true); - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - return '<AnyOf>'; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/ArgumentListMatcher.php b/vendor/mockery/mockery/library/Mockery/Matcher/ArgumentListMatcher.php deleted file mode 100644 index 04408f56..00000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/ArgumentListMatcher.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2017 Dave Marshall - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Matcher; - -interface ArgumentListMatcher -{ -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/Closure.php b/vendor/mockery/mockery/library/Mockery/Matcher/Closure.php deleted file mode 100644 index 69ed4cb7..00000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/Closure.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Matcher; - -class Closure extends MatcherAbstract -{ - /** - * Check if the actual value matches the expected. - * - * @param mixed $actual - * @return bool - */ - public function match(&$actual) - { - $closure = $this->_expected; - $result = $closure($actual); - return $result === true; - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - return '<Closure===true>'; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/Contains.php b/vendor/mockery/mockery/library/Mockery/Matcher/Contains.php deleted file mode 100644 index 79afb73a..00000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/Contains.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Matcher; - -class Contains extends MatcherAbstract -{ - /** - * Check if the actual value matches the expected. - * - * @param mixed $actual - * @return bool - */ - public function match(&$actual) - { - $values = array_values($actual); - foreach ($this->_expected as $exp) { - $match = false; - foreach ($values as $val) { - if ($exp === $val || $exp == $val) { - $match = true; - break; - } - } - if ($match === false) { - return false; - } - } - return true; - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - $return = '<Contains['; - $elements = array(); - foreach ($this->_expected as $v) { - $elements[] = (string) $v; - } - $return .= implode(', ', $elements) . ']>'; - return $return; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/Ducktype.php b/vendor/mockery/mockery/library/Mockery/Matcher/Ducktype.php deleted file mode 100644 index 291f4220..00000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/Ducktype.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Matcher; - -class Ducktype extends MatcherAbstract -{ - /** - * Check if the actual value matches the expected. - * - * @param mixed $actual - * @return bool - */ - public function match(&$actual) - { - if (!is_object($actual)) { - return false; - } - foreach ($this->_expected as $method) { - if (!method_exists($actual, $method)) { - return false; - } - } - return true; - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - return '<Ducktype[' . implode(', ', $this->_expected) . ']>'; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/HasKey.php b/vendor/mockery/mockery/library/Mockery/Matcher/HasKey.php deleted file mode 100644 index fa983eaf..00000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/HasKey.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Matcher; - -class HasKey extends MatcherAbstract -{ - /** - * Check if the actual value matches the expected. - * - * @param mixed $actual - * @return bool - */ - public function match(&$actual) - { - return array_key_exists($this->_expected, $actual); - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - return "<HasKey[$this->_expected]>"; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/HasValue.php b/vendor/mockery/mockery/library/Mockery/Matcher/HasValue.php deleted file mode 100644 index 8ca6afd1..00000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/HasValue.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Matcher; - -class HasValue extends MatcherAbstract -{ - /** - * Check if the actual value matches the expected. - * - * @param mixed $actual - * @return bool - */ - public function match(&$actual) - { - return in_array($this->_expected, $actual); - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - $return = '<HasValue[' . (string) $this->_expected . ']>'; - return $return; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/MatcherAbstract.php b/vendor/mockery/mockery/library/Mockery/Matcher/MatcherAbstract.php deleted file mode 100644 index 3233079e..00000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/MatcherAbstract.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Matcher; - -abstract class MatcherAbstract -{ - /** - * The expected value (or part thereof) - * - * @var mixed - */ - protected $_expected = null; - - /** - * Set the expected value - * - * @param mixed $expected - */ - public function __construct($expected = null) - { - $this->_expected = $expected; - } - - /** - * Check if the actual value matches the expected. - * Actual passed by reference to preserve reference trail (where applicable) - * back to the original method parameter. - * - * @param mixed $actual - * @return bool - */ - abstract public function match(&$actual); - - /** - * Return a string representation of this Matcher - * - * @return string - */ - abstract public function __toString(); -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/MultiArgumentClosure.php b/vendor/mockery/mockery/library/Mockery/Matcher/MultiArgumentClosure.php deleted file mode 100644 index 63dbff0e..00000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/MultiArgumentClosure.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Matcher; - -class MultiArgumentClosure extends MatcherAbstract implements ArgumentListMatcher -{ - /** - * Check if the actual value matches the expected. - * Actual passed by reference to preserve reference trail (where applicable) - * back to the original method parameter. - * - * @param mixed $actual - * @return bool - */ - public function match(&$actual) - { - $closure = $this->_expected; - return true === call_user_func_array($closure, $actual); - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - return '<MultiArgumentClosure===true>'; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/MustBe.php b/vendor/mockery/mockery/library/Mockery/Matcher/MustBe.php deleted file mode 100644 index 27b5ec56..00000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/MustBe.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Matcher; - -/** - * @deprecated 2.0 Due to ambiguity, use Hamcrest or PHPUnit equivalents - */ -class MustBe extends MatcherAbstract -{ - /** - * Check if the actual value matches the expected. - * - * @param mixed $actual - * @return bool - */ - public function match(&$actual) - { - if (!is_object($actual)) { - return $this->_expected === $actual; - } - - return $this->_expected == $actual; - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - return '<MustBe>'; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/NoArgs.php b/vendor/mockery/mockery/library/Mockery/Matcher/NoArgs.php deleted file mode 100644 index 5e9e4189..00000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/NoArgs.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2017 Dave Marshall - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Matcher; - -class NoArgs extends MatcherAbstract implements ArgumentListMatcher -{ - /** - * @inheritdoc - */ - public function match(&$actual) - { - return count($actual) == 0; - } - - /** - * @inheritdoc - */ - public function __toString() - { - return '<No Arguments>'; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/Not.php b/vendor/mockery/mockery/library/Mockery/Matcher/Not.php deleted file mode 100644 index 756ccaa5..00000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/Not.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Matcher; - -class Not extends MatcherAbstract -{ - /** - * Check if the actual value does not match the expected (in this - * case it's specifically NOT expected). - * - * @param mixed $actual - * @return bool - */ - public function match(&$actual) - { - return $actual !== $this->_expected; - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - return '<Not>'; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/NotAnyOf.php b/vendor/mockery/mockery/library/Mockery/Matcher/NotAnyOf.php deleted file mode 100644 index cd827015..00000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/NotAnyOf.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Matcher; - -class NotAnyOf extends MatcherAbstract -{ - /** - * Check if the actual value does not match the expected (in this - * case it's specifically NOT expected). - * - * @param mixed $actual - * @return bool - */ - public function match(&$actual) - { - foreach ($this->_expected as $exp) { - if ($actual === $exp || $actual == $exp) { - return false; - } - } - return true; - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - return '<AnyOf>'; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/Pattern.php b/vendor/mockery/mockery/library/Mockery/Matcher/Pattern.php deleted file mode 100644 index 362c366f..00000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/Pattern.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Matcher; - -class Pattern extends MatcherAbstract -{ - /** - * Check if the actual value matches the expected pattern. - * - * @param mixed $actual - * @return bool - */ - public function match(&$actual) - { - return preg_match($this->_expected, (string) $actual) >= 1; - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - return '<Pattern>'; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/Subset.php b/vendor/mockery/mockery/library/Mockery/Matcher/Subset.php deleted file mode 100644 index 5e706c81..00000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/Subset.php +++ /dev/null @@ -1,92 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Matcher; - -class Subset extends MatcherAbstract -{ - private $expected; - private $strict = true; - - /** - * @param array $expected Expected subset of data - * @param bool $strict Whether to run a strict or loose comparison - */ - public function __construct(array $expected, $strict = true) - { - $this->expected = $expected; - $this->strict = $strict; - } - - /** - * @param array $expected Expected subset of data - * - * @return Subset - */ - public static function strict(array $expected) - { - return new static($expected, true); - } - - /** - * @param array $expected Expected subset of data - * - * @return Subset - */ - public static function loose(array $expected) - { - return new static($expected, false); - } - - /** - * Check if the actual value matches the expected. - * - * @param mixed $actual - * @return bool - */ - public function match(&$actual) - { - if (!is_array($actual)) { - return false; - } - - if ($this->strict) { - return $actual === array_replace_recursive($actual, $this->expected); - } - - return $actual == array_replace_recursive($actual, $this->expected); - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - $return = '<Subset['; - $elements = array(); - foreach ($this->expected as $k=>$v) { - $elements[] = $k . '=' . (string) $v; - } - $return .= implode(', ', $elements) . ']>'; - return $return; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Matcher/Type.php b/vendor/mockery/mockery/library/Mockery/Matcher/Type.php deleted file mode 100644 index d81ce834..00000000 --- a/vendor/mockery/mockery/library/Mockery/Matcher/Type.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery\Matcher; - -class Type extends MatcherAbstract -{ - /** - * Check if the actual value matches the expected. - * - * @param mixed $actual - * @return bool - */ - public function match(&$actual) - { - if ($this->_expected == 'real') { - $function = 'is_float'; - } else { - $function = 'is_' . strtolower($this->_expected); - } - if (function_exists($function)) { - return $function($actual); - } elseif (is_string($this->_expected) - && (class_exists($this->_expected) || interface_exists($this->_expected))) { - return $actual instanceof $this->_expected; - } - return false; - } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - return '<' . ucfirst($this->_expected) . '>'; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/MethodCall.php b/vendor/mockery/mockery/library/Mockery/MethodCall.php deleted file mode 100644 index db68fd81..00000000 --- a/vendor/mockery/mockery/library/Mockery/MethodCall.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery; - -class MethodCall -{ - private $method; - private $args; - - public function __construct($method, $args) - { - $this->method = $method; - $this->args = $args; - } - - public function getMethod() - { - return $this->method; - } - - public function getArgs() - { - return $this->args; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Mock.php b/vendor/mockery/mockery/library/Mockery/Mock.php deleted file mode 100644 index c9000838..00000000 --- a/vendor/mockery/mockery/library/Mockery/Mock.php +++ /dev/null @@ -1,977 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery; - -use Mockery\Exception\BadMethodCallException; -use Mockery\ExpectsHigherOrderMessage; -use Mockery\HigherOrderMessage; -use Mockery\LegacyMockInterface; -use Mockery\MockInterface; -use Mockery\Reflector; - -class Mock implements MockInterface -{ - /** - * Stores an array of all expectation directors for this mock - * - * @var array - */ - protected $_mockery_expectations = array(); - - /** - * Stores an initial number of expectations that can be manipulated - * while using the getter method. - * - * @var int - */ - protected $_mockery_expectations_count = 0; - - /** - * Flag to indicate whether we can ignore method calls missing from our - * expectations - * - * @var bool - */ - protected $_mockery_ignoreMissing = false; - - /** - * Flag to indicate whether we want to set the ignoreMissing flag on - * mocks generated form this calls to this one - * - * @var bool - */ - protected $_mockery_ignoreMissingRecursive = false; - - /** - * Flag to indicate whether we can defer method calls missing from our - * expectations - * - * @var bool - */ - protected $_mockery_deferMissing = false; - - /** - * Flag to indicate whether this mock was verified - * - * @var bool - */ - protected $_mockery_verified = false; - - /** - * Given name of the mock - * - * @var string - */ - protected $_mockery_name = null; - - /** - * Order number of allocation - * - * @var int - */ - protected $_mockery_allocatedOrder = 0; - - /** - * Current ordered number - * - * @var int - */ - protected $_mockery_currentOrder = 0; - - /** - * Ordered groups - * - * @var array - */ - protected $_mockery_groups = array(); - - /** - * Mock container containing this mock object - * - * @var \Mockery\Container - */ - protected $_mockery_container = null; - - /** - * Instance of a core object on which methods are called in the event - * it has been set, and an expectation for one of the object's methods - * does not exist. This implements a simple partial mock proxy system. - * - * @var object - */ - protected $_mockery_partial = null; - - /** - * Flag to indicate we should ignore all expectations temporarily. Used - * mainly to prevent expectation matching when in the middle of a mock - * object recording session. - * - * @var bool - */ - protected $_mockery_disableExpectationMatching = false; - - /** - * Stores all stubbed public methods separate from any on-object public - * properties that may exist. - * - * @var array - */ - protected $_mockery_mockableProperties = array(); - - /** - * @var array - */ - protected $_mockery_mockableMethods = array(); - - /** - * Just a local cache for this mock's target's methods - * - * @var \ReflectionMethod[] - */ - protected static $_mockery_methods; - - protected $_mockery_allowMockingProtectedMethods = false; - - protected $_mockery_receivedMethodCalls; - - /** - * If shouldIgnoreMissing is called, this value will be returned on all calls to missing methods - * @var mixed - */ - protected $_mockery_defaultReturnValue = null; - - /** - * Tracks internally all the bad method call exceptions that happened during runtime - * - * @var array - */ - protected $_mockery_thrownExceptions = []; - - protected $_mockery_instanceMock = true; - - /** - * We want to avoid constructors since class is copied to Generator.php - * for inclusion on extending class definitions. - * - * @param \Mockery\Container $container - * @param object $partialObject - * @param bool $instanceMock - * @return void - */ - public function mockery_init(\Mockery\Container $container = null, $partialObject = null, $instanceMock = true) - { - if (is_null($container)) { - $container = new \Mockery\Container(); - } - $this->_mockery_container = $container; - if (!is_null($partialObject)) { - $this->_mockery_partial = $partialObject; - } - - if (!\Mockery::getConfiguration()->mockingNonExistentMethodsAllowed()) { - foreach ($this->mockery_getMethods() as $method) { - if ($method->isPublic()) { - $this->_mockery_mockableMethods[] = $method->getName(); - } - } - } - - $this->_mockery_instanceMock = $instanceMock; - } - - /** - * Set expected method calls - * - * @param string ...$methodNames one or many methods that are expected to be called in this mock - * - * @return \Mockery\ExpectationInterface|\Mockery\Expectation|\Mockery\HigherOrderMessage - */ - public function shouldReceive(...$methodNames) - { - if (count($methodNames) === 0) { - return new HigherOrderMessage($this, "shouldReceive"); - } - - foreach ($methodNames as $method) { - if ("" == $method) { - throw new \InvalidArgumentException("Received empty method name"); - } - } - - $self = $this; - $allowMockingProtectedMethods = $this->_mockery_allowMockingProtectedMethods; - - $lastExpectation = \Mockery::parseShouldReturnArgs( - $this, - $methodNames, - function ($method) use ($self, $allowMockingProtectedMethods) { - $rm = $self->mockery_getMethod($method); - if ($rm) { - if ($rm->isPrivate()) { - throw new \InvalidArgumentException("$method() cannot be mocked as it is a private method"); - } - if (!$allowMockingProtectedMethods && $rm->isProtected()) { - throw new \InvalidArgumentException("$method() cannot be mocked as it is a protected method and mocking protected methods is not enabled for the currently used mock object. Use shouldAllowMockingProtectedMethods() to enable mocking of protected methods."); - } - } - - $director = $self->mockery_getExpectationsFor($method); - if (!$director) { - $director = new \Mockery\ExpectationDirector($method, $self); - $self->mockery_setExpectationsFor($method, $director); - } - $expectation = new \Mockery\Expectation($self, $method); - $director->addExpectation($expectation); - return $expectation; - } - ); - return $lastExpectation; - } - - // start method allows - /** - * @param mixed $something String method name or map of method => return - * @return self|\Mockery\ExpectationInterface|\Mockery\Expectation|\Mockery\HigherOrderMessage - */ - public function allows($something = []) - { - if (is_string($something)) { - return $this->shouldReceive($something); - } - - if (empty($something)) { - return $this->shouldReceive(); - } - - foreach ($something as $method => $returnValue) { - $this->shouldReceive($method)->andReturn($returnValue); - } - - return $this; - } - // end method allows - - // start method expects - /** - /** - * @param mixed $something String method name (optional) - * @return \Mockery\ExpectationInterface|\Mockery\Expectation|ExpectsHigherOrderMessage - */ - public function expects($something = null) - { - if (is_string($something)) { - return $this->shouldReceive($something)->once(); - } - - return new ExpectsHigherOrderMessage($this); - } - // end method expects - - /** - * Shortcut method for setting an expectation that a method should not be called. - * - * @param string ...$methodNames one or many methods that are expected not to be called in this mock - * @return \Mockery\ExpectationInterface|\Mockery\Expectation|\Mockery\HigherOrderMessage - */ - public function shouldNotReceive(...$methodNames) - { - if (count($methodNames) === 0) { - return new HigherOrderMessage($this, "shouldNotReceive"); - } - - $expectation = call_user_func_array(array($this, 'shouldReceive'), $methodNames); - $expectation->never(); - return $expectation; - } - - /** - * Allows additional methods to be mocked that do not explicitly exist on mocked class - * @param String $method name of the method to be mocked - * @return Mock - */ - public function shouldAllowMockingMethod($method) - { - $this->_mockery_mockableMethods[] = $method; - return $this; - } - - /** - * Set mock to ignore unexpected methods and return Undefined class - * @param mixed $returnValue the default return value for calls to missing functions on this mock - * @param bool $recursive Specify if returned mocks should also have shouldIgnoreMissing set - * @return Mock - */ - public function shouldIgnoreMissing($returnValue = null, $recursive = false) - { - $this->_mockery_ignoreMissing = true; - $this->_mockery_ignoreMissingRecursive = $recursive; - $this->_mockery_defaultReturnValue = $returnValue; - return $this; - } - - public function asUndefined() - { - $this->_mockery_ignoreMissing = true; - $this->_mockery_defaultReturnValue = new \Mockery\Undefined(); - return $this; - } - - /** - * @return Mock - */ - public function shouldAllowMockingProtectedMethods() - { - if (!\Mockery::getConfiguration()->mockingNonExistentMethodsAllowed()) { - foreach ($this->mockery_getMethods() as $method) { - if ($method->isProtected()) { - $this->_mockery_mockableMethods[] = $method->getName(); - } - } - } - - $this->_mockery_allowMockingProtectedMethods = true; - return $this; - } - - - /** - * Set mock to defer unexpected methods to it's parent - * - * This is particularly useless for this class, as it doesn't have a parent, - * but included for completeness - * - * @deprecated 2.0.0 Please use makePartial() instead - * - * @return Mock - */ - public function shouldDeferMissing() - { - return $this->makePartial(); - } - - /** - * Set mock to defer unexpected methods to it's parent - * - * It was an alias for shouldDeferMissing(), which will be removed - * in 2.0.0. - * - * @return Mock - */ - public function makePartial() - { - $this->_mockery_deferMissing = true; - return $this; - } - - /** - * In the event shouldReceive() accepting one or more methods/returns, - * this method will switch them from normal expectations to default - * expectations - * - * @return self - */ - public function byDefault() - { - foreach ($this->_mockery_expectations as $director) { - $exps = $director->getExpectations(); - foreach ($exps as $exp) { - $exp->byDefault(); - } - } - return $this; - } - - /** - * Capture calls to this mock - */ - public function __call($method, array $args) - { - return $this->_mockery_handleMethodCall($method, $args); - } - - public static function __callStatic($method, array $args) - { - return self::_mockery_handleStaticMethodCall($method, $args); - } - - /** - * Forward calls to this magic method to the __call method - */ - public function __toString() - { - return $this->__call('__toString', array()); - } - - /** - * Iterate across all expectation directors and validate each - * - * @throws \Mockery\CountValidator\Exception - * @return void - */ - public function mockery_verify() - { - if ($this->_mockery_verified) { - return; - } - if (isset($this->_mockery_ignoreVerification) - && $this->_mockery_ignoreVerification == true) { - return; - } - $this->_mockery_verified = true; - foreach ($this->_mockery_expectations as $director) { - $director->verify(); - } - } - - /** - * Gets a list of exceptions thrown by this mock - * - * @return array - */ - public function mockery_thrownExceptions() - { - return $this->_mockery_thrownExceptions; - } - - /** - * Tear down tasks for this mock - * - * @return void - */ - public function mockery_teardown() - { - } - - /** - * Fetch the next available allocation order number - * - * @return int - */ - public function mockery_allocateOrder() - { - $this->_mockery_allocatedOrder += 1; - return $this->_mockery_allocatedOrder; - } - - /** - * Set ordering for a group - * - * @param mixed $group - * @param int $order - */ - public function mockery_setGroup($group, $order) - { - $this->_mockery_groups[$group] = $order; - } - - /** - * Fetch array of ordered groups - * - * @return array - */ - public function mockery_getGroups() - { - return $this->_mockery_groups; - } - - /** - * Set current ordered number - * - * @param int $order - */ - public function mockery_setCurrentOrder($order) - { - $this->_mockery_currentOrder = $order; - return $this->_mockery_currentOrder; - } - - /** - * Get current ordered number - * - * @return int - */ - public function mockery_getCurrentOrder() - { - return $this->_mockery_currentOrder; - } - - /** - * Validate the current mock's ordering - * - * @param string $method - * @param int $order - * @throws \Mockery\Exception - * @return void - */ - public function mockery_validateOrder($method, $order) - { - if ($order < $this->_mockery_currentOrder) { - $exception = new \Mockery\Exception\InvalidOrderException( - 'Method ' . __CLASS__ . '::' . $method . '()' - . ' called out of order: expected order ' - . $order . ', was ' . $this->_mockery_currentOrder - ); - $exception->setMock($this) - ->setMethodName($method) - ->setExpectedOrder($order) - ->setActualOrder($this->_mockery_currentOrder); - throw $exception; - } - $this->mockery_setCurrentOrder($order); - } - - /** - * Gets the count of expectations for this mock - * - * @return int - */ - public function mockery_getExpectationCount() - { - $count = $this->_mockery_expectations_count; - foreach ($this->_mockery_expectations as $director) { - $count += $director->getExpectationCount(); - } - return $count; - } - - /** - * Return the expectations director for the given method - * - * @var string $method - * @return \Mockery\ExpectationDirector|null - */ - public function mockery_setExpectationsFor($method, \Mockery\ExpectationDirector $director) - { - $this->_mockery_expectations[$method] = $director; - } - - /** - * Return the expectations director for the given method - * - * @var string $method - * @return \Mockery\ExpectationDirector|null - */ - public function mockery_getExpectationsFor($method) - { - if (isset($this->_mockery_expectations[$method])) { - return $this->_mockery_expectations[$method]; - } - } - - /** - * Find an expectation matching the given method and arguments - * - * @var string $method - * @var array $args - * @return \Mockery\Expectation|null - */ - public function mockery_findExpectation($method, array $args) - { - if (!isset($this->_mockery_expectations[$method])) { - return null; - } - $director = $this->_mockery_expectations[$method]; - - return $director->findExpectation($args); - } - - /** - * Return the container for this mock - * - * @return \Mockery\Container - */ - public function mockery_getContainer() - { - return $this->_mockery_container; - } - - /** - * Return the name for this mock - * - * @return string - */ - public function mockery_getName() - { - return __CLASS__; - } - - /** - * @return array - */ - public function mockery_getMockableProperties() - { - return $this->_mockery_mockableProperties; - } - - public function __isset($name) - { - if (false === stripos($name, '_mockery_') && get_parent_class($this) && method_exists(get_parent_class($this), '__isset')) { - return call_user_func(get_parent_class($this) . '::__isset', $name); - } - - return false; - } - - public function mockery_getExpectations() - { - return $this->_mockery_expectations; - } - - /** - * Calls a parent class method and returns the result. Used in a passthru - * expectation where a real return value is required while still taking - * advantage of expectation matching and call count verification. - * - * @param string $name - * @param array $args - * @return mixed - */ - public function mockery_callSubjectMethod($name, array $args) - { - if (!method_exists($this, $name) && get_parent_class($this) && method_exists(get_parent_class($this), '__call')) { - return call_user_func(get_parent_class($this) . '::__call', $name, $args); - } - return call_user_func_array(get_parent_class($this) . '::' . $name, $args); - } - - /** - * @return string[] - */ - public function mockery_getMockableMethods() - { - return $this->_mockery_mockableMethods; - } - - /** - * @return bool - */ - public function mockery_isAnonymous() - { - $rfc = new \ReflectionClass($this); - - // PHP 8 has Stringable interface - $interfaces = array_filter($rfc->getInterfaces(), function ($i) { - return $i->getName() !== 'Stringable'; - }); - - return false === $rfc->getParentClass() && 2 === count($interfaces); - } - - public function mockery_isInstance() - { - return $this->_mockery_instanceMock; - } - - public function __wakeup() - { - /** - * This does not add __wakeup method support. It's a blind method and any - * expected __wakeup work will NOT be performed. It merely cuts off - * annoying errors where a __wakeup exists but is not essential when - * mocking - */ - } - - public function __destruct() - { - /** - * Overrides real class destructor in case if class was created without original constructor - */ - } - - public function mockery_getMethod($name) - { - foreach ($this->mockery_getMethods() as $method) { - if ($method->getName() == $name) { - return $method; - } - } - - return null; - } - - /** - * @param string $name Method name. - * - * @return mixed Generated return value based on the declared return value of the named method. - */ - public function mockery_returnValueForMethod($name) - { - $rm = $this->mockery_getMethod($name); - - if ($rm === null) { - return null; - } - - $returnType = Reflector::getSimplestReturnType($rm); - - switch ($returnType) { - case null: return null; - case 'string': return ''; - case 'int': return 0; - case 'float': return 0.0; - case 'bool': return false; - - case 'array': - case 'iterable': - return []; - - case 'callable': - case '\Closure': - return function () { - }; - - case '\Traversable': - case '\Generator': - $generator = function () { yield; }; - return $generator(); - - case 'void': - return null; - - case 'static': - return $this; - - case 'object': - $mock = \Mockery::mock(); - if ($this->_mockery_ignoreMissingRecursive) { - $mock->shouldIgnoreMissing($this->_mockery_defaultReturnValue, true); - } - return $mock; - - default: - $mock = \Mockery::mock($returnType); - if ($this->_mockery_ignoreMissingRecursive) { - $mock->shouldIgnoreMissing($this->_mockery_defaultReturnValue, true); - } - return $mock; - } - } - - public function shouldHaveReceived($method = null, $args = null) - { - if ($method === null) { - return new HigherOrderMessage($this, "shouldHaveReceived"); - } - - $expectation = new \Mockery\VerificationExpectation($this, $method); - if (null !== $args) { - $expectation->withArgs($args); - } - $expectation->atLeast()->once(); - $director = new \Mockery\VerificationDirector($this->_mockery_getReceivedMethodCalls(), $expectation); - $this->_mockery_expectations_count++; - $director->verify(); - return $director; - } - - public function shouldHaveBeenCalled() - { - return $this->shouldHaveReceived("__invoke"); - } - - public function shouldNotHaveReceived($method = null, $args = null) - { - if ($method === null) { - return new HigherOrderMessage($this, "shouldNotHaveReceived"); - } - - $expectation = new \Mockery\VerificationExpectation($this, $method); - if (null !== $args) { - $expectation->withArgs($args); - } - $expectation->never(); - $director = new \Mockery\VerificationDirector($this->_mockery_getReceivedMethodCalls(), $expectation); - $this->_mockery_expectations_count++; - $director->verify(); - return null; - } - - public function shouldNotHaveBeenCalled(array $args = null) - { - return $this->shouldNotHaveReceived("__invoke", $args); - } - - protected static function _mockery_handleStaticMethodCall($method, array $args) - { - $associatedRealObject = \Mockery::fetchMock(__CLASS__); - try { - return $associatedRealObject->__call($method, $args); - } catch (BadMethodCallException $e) { - throw new BadMethodCallException( - 'Static method ' . $associatedRealObject->mockery_getName() . '::' . $method - . '() does not exist on this mock object', - 0, - $e - ); - } - } - - protected function _mockery_getReceivedMethodCalls() - { - return $this->_mockery_receivedMethodCalls ?: $this->_mockery_receivedMethodCalls = new \Mockery\ReceivedMethodCalls(); - } - - /** - * Called when an instance Mock was created and its constructor is getting called - * - * @see \Mockery\Generator\StringManipulation\Pass\InstanceMockPass - * @param array $args - */ - protected function _mockery_constructorCalled(array $args) - { - if (!isset($this->_mockery_expectations['__construct']) /* _mockery_handleMethodCall runs the other checks */) { - return; - } - $this->_mockery_handleMethodCall('__construct', $args); - } - - protected function _mockery_findExpectedMethodHandler($method) - { - if (isset($this->_mockery_expectations[$method])) { - return $this->_mockery_expectations[$method]; - } - - $lowerCasedMockeryExpectations = array_change_key_case($this->_mockery_expectations, CASE_LOWER); - $lowerCasedMethod = strtolower($method); - - if (isset($lowerCasedMockeryExpectations[$lowerCasedMethod])) { - return $lowerCasedMockeryExpectations[$lowerCasedMethod]; - } - - return null; - } - - protected function _mockery_handleMethodCall($method, array $args) - { - $this->_mockery_getReceivedMethodCalls()->push(new \Mockery\MethodCall($method, $args)); - - $rm = $this->mockery_getMethod($method); - if ($rm && $rm->isProtected() && !$this->_mockery_allowMockingProtectedMethods) { - if ($rm->isAbstract()) { - return; - } - - try { - $prototype = $rm->getPrototype(); - if ($prototype->isAbstract()) { - return; - } - } catch (\ReflectionException $re) { - // noop - there is no hasPrototype method - } - - return call_user_func_array(get_parent_class($this) . '::' . $method, $args); - } - - $handler = $this->_mockery_findExpectedMethodHandler($method); - - if ($handler !== null && !$this->_mockery_disableExpectationMatching) { - try { - return $handler->call($args); - } catch (\Mockery\Exception\NoMatchingExpectationException $e) { - if (!$this->_mockery_ignoreMissing && !$this->_mockery_deferMissing) { - throw $e; - } - } - } - - if (!is_null($this->_mockery_partial) && - (method_exists($this->_mockery_partial, $method) || method_exists($this->_mockery_partial, '__call')) - ) { - return call_user_func_array(array($this->_mockery_partial, $method), $args); - } elseif ($this->_mockery_deferMissing && is_callable(get_parent_class($this) . '::' . $method) - && (!$this->hasMethodOverloadingInParentClass() || (get_parent_class($this) && method_exists(get_parent_class($this), $method)))) { - return call_user_func_array(get_parent_class($this) . '::' . $method, $args); - } elseif ($this->_mockery_deferMissing && get_parent_class($this) && method_exists(get_parent_class($this), '__call')) { - return call_user_func(get_parent_class($this) . '::__call', $method, $args); - } elseif ($method == '__toString') { - // __toString is special because we force its addition to the class API regardless of the - // original implementation. Thus, we should always return a string rather than honor - // _mockery_ignoreMissing and break the API with an error. - return sprintf("%s#%s", __CLASS__, spl_object_hash($this)); - } elseif ($this->_mockery_ignoreMissing) { - if (\Mockery::getConfiguration()->mockingNonExistentMethodsAllowed() || (!is_null($this->_mockery_partial) && method_exists($this->_mockery_partial, $method)) || is_callable(get_parent_class($this) . '::' . $method)) { - if ($this->_mockery_defaultReturnValue instanceof \Mockery\Undefined) { - return call_user_func_array(array($this->_mockery_defaultReturnValue, $method), $args); - } elseif (null === $this->_mockery_defaultReturnValue) { - return $this->mockery_returnValueForMethod($method); - } - - return $this->_mockery_defaultReturnValue; - } - } - - $message = 'Method ' . __CLASS__ . '::' . $method . - '() does not exist on this mock object'; - - if (!is_null($rm)) { - $message = 'Received ' . __CLASS__ . - '::' . $method . '(), but no expectations were specified'; - } - - $bmce = new BadMethodCallException($message); - $this->_mockery_thrownExceptions[] = $bmce; - throw $bmce; - } - - /** - * Uses reflection to get the list of all - * methods within the current mock object - * - * @return array - */ - protected function mockery_getMethods() - { - if (static::$_mockery_methods && \Mockery::getConfiguration()->reflectionCacheEnabled()) { - return static::$_mockery_methods; - } - - if (isset($this->_mockery_partial)) { - $reflected = new \ReflectionObject($this->_mockery_partial); - } else { - $reflected = new \ReflectionClass($this); - } - - return static::$_mockery_methods = $reflected->getMethods(); - } - - private function hasMethodOverloadingInParentClass() - { - // if there's __call any name would be callable - return is_callable(get_parent_class($this) . '::aFunctionNameThatNoOneWouldEverUseInRealLife12345'); - } - - /** - * @return array - */ - private function getNonPublicMethods() - { - return array_map( - function ($method) { - return $method->getName(); - }, - array_filter($this->mockery_getMethods(), function ($method) { - return !$method->isPublic(); - }) - ); - } -} diff --git a/vendor/mockery/mockery/library/Mockery/MockInterface.php b/vendor/mockery/mockery/library/Mockery/MockInterface.php deleted file mode 100644 index 7c1774b4..00000000 --- a/vendor/mockery/mockery/library/Mockery/MockInterface.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery; - -use Mockery\LegacyMockInterface; - -interface MockInterface extends LegacyMockInterface -{ - /** - * @param mixed $something String method name or map of method => return - * @return self|\Mockery\ExpectationInterface|\Mockery\Expectation|\Mockery\HigherOrderMessage - */ - public function allows($something = []); - - /** - * @param mixed $something String method name (optional) - * @return \Mockery\ExpectationInterface|\Mockery\Expectation|\Mockery\ExpectsHigherOrderMessage - */ - public function expects($something = null); -} diff --git a/vendor/mockery/mockery/library/Mockery/QuickDefinitionsConfiguration.php b/vendor/mockery/mockery/library/Mockery/QuickDefinitionsConfiguration.php deleted file mode 100644 index b0eea662..00000000 --- a/vendor/mockery/mockery/library/Mockery/QuickDefinitionsConfiguration.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery; - -class QuickDefinitionsConfiguration -{ - private const QUICK_DEFINITIONS_MODE_MOCK_AT_LEAST_ONCE = 'QUICK_DEFINITIONS_MODE_MOCK_AT_LEAST_ONCE'; - private const QUICK_DEFINITIONS_MODE_DEFAULT_EXPECTATION = 'QUICK_DEFINITIONS_MODE_DEFAULT_EXPECTATION'; - - /** - * Defines what a quick definition should produce. - * Possible options are: - * - self::QUICK_DEFINITIONS_MODE_DEFAULT_EXPECTATION: in this case quick - * definitions define a stub. - * - self::QUICK_DEFINITIONS_MODE_MOCK_AT_LEAST_ONCE: in this case quick - * definitions define a mock with an 'at least once' expectation. - * - * @var string - */ - protected $_quickDefinitionsApplicationMode = self::QUICK_DEFINITIONS_MODE_DEFAULT_EXPECTATION; - - /** - * Returns true if quick definitions should setup a stub, returns false when - * quick definitions should setup a mock with 'at least once' expectation. - * When parameter $newValue is specified it sets the configuration with the - * given value. - */ - public function shouldBeCalledAtLeastOnce(?bool $newValue = null): bool - { - if ($newValue !== null) { - $this->_quickDefinitionsApplicationMode = $newValue - ? self::QUICK_DEFINITIONS_MODE_MOCK_AT_LEAST_ONCE - : self::QUICK_DEFINITIONS_MODE_DEFAULT_EXPECTATION; - } - - return $this->_quickDefinitionsApplicationMode === self::QUICK_DEFINITIONS_MODE_MOCK_AT_LEAST_ONCE; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/ReceivedMethodCalls.php b/vendor/mockery/mockery/library/Mockery/ReceivedMethodCalls.php deleted file mode 100644 index 8ed81f10..00000000 --- a/vendor/mockery/mockery/library/Mockery/ReceivedMethodCalls.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery; - -class ReceivedMethodCalls -{ - private $methodCalls = array(); - - public function push(MethodCall $methodCall) - { - $this->methodCalls[] = $methodCall; - } - - public function verify(Expectation $expectation) - { - foreach ($this->methodCalls as $methodCall) { - if ($methodCall->getMethod() !== $expectation->getName()) { - continue; - } - - if (!$expectation->matchArgs($methodCall->getArgs())) { - continue; - } - - $expectation->verifyCall($methodCall->getArgs()); - } - - $expectation->verify(); - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Reflector.php b/vendor/mockery/mockery/library/Mockery/Reflector.php deleted file mode 100644 index 4e8c6e1f..00000000 --- a/vendor/mockery/mockery/library/Mockery/Reflector.php +++ /dev/null @@ -1,224 +0,0 @@ -<?php - -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2017 Dave Marshall https://github.com/davedevelopment - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery; - -/** - * @internal - */ -class Reflector -{ - /** - * Determine if the parameter is typed as an array. - * - * @param \ReflectionParameter $param - * - * @return bool - */ - public static function isArray(\ReflectionParameter $param) - { - $type = $param->getType(); - - return $type instanceof \ReflectionNamedType && $type->getName(); - } - - /** - * Compute the string representation for the paramater type. - * - * @param \ReflectionParameter $param - * @param bool $withoutNullable - * - * @return string|null - */ - public static function getTypeHint(\ReflectionParameter $param, $withoutNullable = false) - { - if (!$param->hasType()) { - return null; - } - - $type = $param->getType(); - $declaringClass = $param->getDeclaringClass(); - $typeHint = self::typeToString($type, $declaringClass); - - return (!$withoutNullable && $type->allowsNull()) ? self::formatNullableType($typeHint) : $typeHint; - } - - /** - * Compute the string representation for the return type. - * - * @param \ReflectionParameter $param - * @param bool $withoutNullable - * - * @return string|null - */ - public static function getReturnType(\ReflectionMethod $method, $withoutNullable = false) - { - $type = $method->getReturnType(); - - if (is_null($type) && method_exists($method, 'getTentativeReturnType')) { - $type = $method->getTentativeReturnType(); - } - - if (is_null($type)) { - return null; - } - - $typeHint = self::typeToString($type, $method->getDeclaringClass()); - - return (!$withoutNullable && $type->allowsNull()) ? self::formatNullableType($typeHint) : $typeHint; - } - - /** - * Compute the string representation for the simplest return type. - * - * @param \ReflectionParameter $param - * - * @return string|null - */ - public static function getSimplestReturnType(\ReflectionMethod $method) - { - $type = $method->getReturnType(); - - if (is_null($type) && method_exists($method, 'getTentativeReturnType')) { - $type = $method->getTentativeReturnType(); - } - - if (is_null($type) || $type->allowsNull()) { - return null; - } - - $typeInformation = self::getTypeInformation($type, $method->getDeclaringClass()); - - // return the first primitive type hint - foreach ($typeInformation as $info) { - if ($info['isPrimitive']) { - return $info['typeHint']; - } - } - - // if no primitive type, return the first type - foreach ($typeInformation as $info) { - return $info['typeHint']; - } - - return null; - } - - /** - * Get the string representation of the given type. - * - * @param \ReflectionType $type - * @param string $declaringClass - * - * @return string|null - */ - private static function typeToString(\ReflectionType $type, \ReflectionClass $declaringClass) - { - return \implode('|', \array_map(function (array $typeInformation) { - return $typeInformation['typeHint']; - }, self::getTypeInformation($type, $declaringClass))); - } - - /** - * Get the string representation of the given type. - * - * @param \ReflectionType $type - * @param \ReflectionClass $declaringClass - * - * @return list<array{typeHint: string, isPrimitive: bool}> - */ - private static function getTypeInformation(\ReflectionType $type, \ReflectionClass $declaringClass) - { - // PHP 8 union types and PHP 8.1 intersection types can be recursively processed - if ($type instanceof \ReflectionUnionType || $type instanceof \ReflectionIntersectionType) { - $types = []; - - foreach ($type->getTypes() as $innterType) { - foreach (self::getTypeInformation($innterType, $declaringClass) as $info) { - if ($info['typeHint'] === 'null' && $info['isPrimitive']) { - continue; - } - - $types[] = $info; - } - } - - return $types; - } - - // $type must be an instance of \ReflectionNamedType - $typeHint = $type->getName(); - - // builtins can be returned as is - if ($type->isBuiltin()) { - return [ - [ - 'typeHint' => $typeHint, - 'isPrimitive' => in_array($typeHint, ['array', 'bool', 'int', 'float', 'null', 'object', 'string']), - ], - ]; - } - - // 'static' can be returned as is - if ($typeHint === 'static') { - return [ - [ - 'typeHint' => $typeHint, - 'isPrimitive' => false, - ], - ]; - } - - // 'self' needs to be resolved to the name of the declaring class - if ($typeHint === 'self') { - $typeHint = $declaringClass->getName(); - } - - // 'parent' needs to be resolved to the name of the parent class - if ($typeHint === 'parent') { - $typeHint = $declaringClass->getParentClass()->getName(); - } - - // class names need prefixing with a slash - return [ - [ - 'typeHint' => sprintf('\\%s', $typeHint), - 'isPrimitive' => false, - ], - ]; - } - - /** - * Format the given type as a nullable type. - * - * @param string $typeHint - * - * @return string - */ - private static function formatNullableType($typeHint) - { - if (\PHP_VERSION_ID < 80000) { - return sprintf('?%s', $typeHint); - } - - return $typeHint === 'mixed' ? 'mixed' : sprintf('%s|null', $typeHint); - } -} diff --git a/vendor/mockery/mockery/library/Mockery/Undefined.php b/vendor/mockery/mockery/library/Mockery/Undefined.php deleted file mode 100644 index 53b05e9c..00000000 --- a/vendor/mockery/mockery/library/Mockery/Undefined.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery; - -class Undefined -{ - /** - * Call capturing to merely return this same object. - * - * @param string $method - * @param array $args - * @return self - */ - public function __call($method, array $args) - { - return $this; - } - - /** - * Return a string, avoiding E_RECOVERABLE_ERROR - * - * @return string - */ - public function __toString() - { - return __CLASS__ . ":" . spl_object_hash($this); - } -} diff --git a/vendor/mockery/mockery/library/Mockery/VerificationDirector.php b/vendor/mockery/mockery/library/Mockery/VerificationDirector.php deleted file mode 100644 index 8420e73e..00000000 --- a/vendor/mockery/mockery/library/Mockery/VerificationDirector.php +++ /dev/null @@ -1,107 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery; - -class VerificationDirector -{ - private $receivedMethodCalls; - private $expectation; - - public function __construct(ReceivedMethodCalls $receivedMethodCalls, VerificationExpectation $expectation) - { - $this->receivedMethodCalls = $receivedMethodCalls; - $this->expectation = $expectation; - } - - public function verify() - { - return $this->receivedMethodCalls->verify($this->expectation); - } - - public function with(...$args) - { - return $this->cloneApplyAndVerify("with", $args); - } - - public function withArgs($args) - { - return $this->cloneApplyAndVerify("withArgs", array($args)); - } - - public function withNoArgs() - { - return $this->cloneApplyAndVerify("withNoArgs", array()); - } - - public function withAnyArgs() - { - return $this->cloneApplyAndVerify("withAnyArgs", array()); - } - - public function times($limit = null) - { - return $this->cloneWithoutCountValidatorsApplyAndVerify("times", array($limit)); - } - - public function once() - { - return $this->cloneWithoutCountValidatorsApplyAndVerify("once", array()); - } - - public function twice() - { - return $this->cloneWithoutCountValidatorsApplyAndVerify("twice", array()); - } - - public function atLeast() - { - return $this->cloneWithoutCountValidatorsApplyAndVerify("atLeast", array()); - } - - public function atMost() - { - return $this->cloneWithoutCountValidatorsApplyAndVerify("atMost", array()); - } - - public function between($minimum, $maximum) - { - return $this->cloneWithoutCountValidatorsApplyAndVerify("between", array($minimum, $maximum)); - } - - protected function cloneWithoutCountValidatorsApplyAndVerify($method, $args) - { - $expectation = clone $this->expectation; - $expectation->clearCountValidators(); - call_user_func_array(array($expectation, $method), $args); - $director = new VerificationDirector($this->receivedMethodCalls, $expectation); - $director->verify(); - return $director; - } - - protected function cloneApplyAndVerify($method, $args) - { - $expectation = clone $this->expectation; - call_user_func_array(array($expectation, $method), $args); - $director = new VerificationDirector($this->receivedMethodCalls, $expectation); - $director->verify(); - return $director; - } -} diff --git a/vendor/mockery/mockery/library/Mockery/VerificationExpectation.php b/vendor/mockery/mockery/library/Mockery/VerificationExpectation.php deleted file mode 100644 index 3844a090..00000000 --- a/vendor/mockery/mockery/library/Mockery/VerificationExpectation.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -namespace Mockery; - -class VerificationExpectation extends Expectation -{ - public function clearCountValidators() - { - $this->_countValidators = array(); - } - - public function __clone() - { - parent::__clone(); - $this->_actualCount = 0; - } -} diff --git a/vendor/mockery/mockery/library/helpers.php b/vendor/mockery/mockery/library/helpers.php deleted file mode 100644 index 0756a328..00000000 --- a/vendor/mockery/mockery/library/helpers.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php - -use Mockery\Matcher\AndAnyOtherArgs; -use Mockery\Matcher\AnyArgs; - -/** - * Mockery - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://github.com/padraic/mockery/blob/master/LICENSE - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to padraic@php.net so we can send you a copy immediately. - * - * @category Mockery - * @package Mockery - * @copyright Copyright (c) 2016 Dave Marshall - * @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License - */ - -if (!function_exists("mock")) { - function mock(...$args) - { - return Mockery::mock(...$args); - } -} - -if (!function_exists("spy")) { - function spy(...$args) - { - return Mockery::spy(...$args); - } -} - -if (!function_exists("namedMock")) { - function namedMock(...$args) - { - return Mockery::namedMock(...$args); - } -} - -if (!function_exists("anyArgs")) { - function anyArgs() - { - return new AnyArgs(); - } -} - -if (!function_exists("andAnyOtherArgs")) { - function andAnyOtherArgs() - { - return new AndAnyOtherArgs(); - } -} - -if (!function_exists("andAnyOthers")) { - function andAnyOthers() - { - return new AndAnyOtherArgs(); - } -} diff --git a/vendor/monolog/monolog/CHANGELOG.md b/vendor/monolog/monolog/CHANGELOG.md deleted file mode 100644 index 7f9db2b0..00000000 --- a/vendor/monolog/monolog/CHANGELOG.md +++ /dev/null @@ -1,608 +0,0 @@ -### 2.8.0 (2022-07-24) - - * Deprecated `CubeHandler` and `PHPConsoleHandler` as both projects are abandoned and those should not be used anymore (#1734) - * Added RFC 5424 level (`7` to `0`) support to `Logger::log` and `Logger::addRecord` to increase interoperability (#1723) - * Added support for `__toString` for objects which are not json serializable in `JsonFormatter` (#1733) - * Added `GoogleCloudLoggingFormatter` (#1719) - * Added support for Predis 2.x (#1732) - * Added `AmqpHandler->setExtraAttributes` to allow configuring attributes when using an AMQPExchange (#1724) - * Fixed serialization/unserialization of handlers to make sure private properties are included (#1727) - * Fixed allowInlineLineBreaks in LineFormatter causing issues with windows paths containing `\n` or `\r` sequences (#1720) - * Fixed max normalization depth not being taken into account when formatting exceptions with a deep chain of previous exceptions (#1726) - * Fixed PHP 8.2 deprecation warnings (#1722) - * Fixed rare race condition or filesystem issue where StreamHandler is unable to create the directory the log should go into yet it exists already (#1678) - -### 2.7.0 (2022-06-09) - - * Added `$datetime` parameter to `Logger::addRecord` as low level API to allow logging into the past or future (#1682) - * Added `Logger::useLoggingLoopDetection` to allow disabling cyclic logging detection in concurrent frameworks (#1681) - * Fixed handling of fatal errors if callPrevious is disabled in ErrorHandler (#1670) - * Marked the reusable `Monolog\Test\TestCase` class as `@internal` to make sure PHPStorm does not show it above PHPUnit, you may still use it to test your own handlers/etc though (#1677) - * Fixed RotatingFileHandler issue when the date format contained slashes (#1671) - -### 2.6.0 (2022-05-10) - - * Deprecated `SwiftMailerHandler`, use `SymfonyMailerHandler` instead - * Added `SymfonyMailerHandler` (#1663) - * Added ElasticSearch 8.x support to the ElasticsearchHandler (#1662) - * Added a way to filter/modify stack traces in LineFormatter (#1665) - * Fixed UdpSocket not being able to reopen/reconnect after close() - * Fixed infinite loops if a Handler is triggering logging while handling log records - -### 2.5.0 (2022-04-08) - - * Added `callType` to IntrospectionProcessor (#1612) - * Fixed AsMonologProcessor syntax to be compatible with PHP 7.2 (#1651) - -### 2.4.0 (2022-03-14) - - * Added [`Monolog\LogRecord`](src/Monolog/LogRecord.php) interface that can be used to type-hint records like `array|\Monolog\LogRecord $record` to be forward compatible with the upcoming Monolog 3 changes - * Added `includeStacktraces` constructor params to LineFormatter & JsonFormatter (#1603) - * Added `persistent`, `timeout`, `writingTimeout`, `connectionTimeout`, `chunkSize` constructor params to SocketHandler and derivatives (#1600) - * Added `AsMonologProcessor` PHP attribute which can help autowiring / autoconfiguration of processors if frameworks / integrations decide to make use of it. This is useless when used purely with Monolog (#1637) - * Added support for keeping native BSON types as is in MongoDBFormatter (#1620) - * Added support for a `user_agent` key in WebProcessor, disabled by default but you can use it by configuring the $extraFields you want (#1613) - * Added support for username/userIcon in SlackWebhookHandler (#1617) - * Added extension points to BrowserConsoleHandler (#1593) - * Added record message/context/extra info to exceptions thrown when a StreamHandler cannot open its stream to avoid completely losing the data logged (#1630) - * Fixed error handler signature to accept a null $context which happens with internal PHP errors (#1614) - * Fixed a few setter methods not returning `self` (#1609) - * Fixed handling of records going over the max Telegram message length (#1616) - -### 2.3.5 (2021-10-01) - - * Fixed regression in StreamHandler since 2.3.3 on systems with the memory_limit set to >=20GB (#1592) - -### 2.3.4 (2021-09-15) - - * Fixed support for psr/log 3.x (#1589) - -### 2.3.3 (2021-09-14) - - * Fixed memory usage when using StreamHandler and calling stream_get_contents on the resource you passed to it (#1578, #1577) - * Fixed support for psr/log 2.x (#1587) - * Fixed some type annotations - -### 2.3.2 (2021-07-23) - - * Fixed compatibility with PHP 7.2 - 7.4 when experiencing PCRE errors (#1568) - -### 2.3.1 (2021-07-14) - - * Fixed Utils::getClass handling of anonymous classes not being fully compatible with PHP 8 (#1563) - * Fixed some `@inheritDoc` annotations having the wrong case - -### 2.3.0 (2021-07-05) - - * Added a ton of PHPStan type annotations as well as type aliases on Monolog\Logger for Record, Level and LevelName that you can import (#1557) - * Added ability to customize date format when using JsonFormatter (#1561) - * Fixed FilterHandler not calling reset on its internal handler when reset() is called on it (#1531) - * Fixed SyslogUdpHandler not setting the timezone correctly on DateTimeImmutable instances (#1540) - * Fixed StreamHandler thread safety - chunk size set to 2GB now to avoid interlacing when doing concurrent writes (#1553) - -### 2.2.0 (2020-12-14) - - * Added JSON_PARTIAL_OUTPUT_ON_ERROR to default json encoding flags, to avoid dropping entire context data or even records due to an invalid subset of it somewhere - * Added setDateFormat to NormalizerFormatter (and Line/Json formatters by extension) to allow changing this after object creation - * Added RedisPubSubHandler to log records to a Redis channel using PUBLISH - * Added support for Elastica 7, and deprecated the $type argument of ElasticaFormatter which is not in use anymore as of Elastica 7 - * Added support for millisecond write timeouts in SocketHandler, you can now pass floats to setWritingTimeout, e.g. 0.2 is 200ms - * Added support for unix sockets in SyslogUdpHandler (set $port to 0 to make the $host a unix socket) - * Added handleBatch support for TelegramBotHandler - * Added RFC5424e extended date format including milliseconds to SyslogUdpHandler - * Added support for configuring handlers with numeric level values in strings (coming from e.g. env vars) - * Fixed Wildfire/FirePHP/ChromePHP handling of unicode characters - * Fixed PHP 8 issues in SyslogUdpHandler - * Fixed internal type error when mbstring is missing - -### 2.1.1 (2020-07-23) - - * Fixed removing of json encoding options - * Fixed type hint of $level not accepting strings in SendGridHandler and OverflowHandler - * Fixed SwiftMailerHandler not accepting email templates with an empty subject - * Fixed array access on null in RavenHandler - * Fixed unique_id in WebProcessor not being disableable - -### 2.1.0 (2020-05-22) - - * Added `JSON_INVALID_UTF8_SUBSTITUTE` to default json flags, so that invalid UTF8 characters now get converted to [�](https://en.wikipedia.org/wiki/Specials_(Unicode_block)#Replacement_character) instead of being converted from ISO-8859-15 to UTF8 as it was before, which was hardly a comprehensive solution - * Added `$ignoreEmptyContextAndExtra` option to JsonFormatter to skip empty context/extra entirely from the output - * Added `$parseMode`, `$disableWebPagePreview` and `$disableNotification` options to TelegramBotHandler - * Added tentative support for PHP 8 - * NormalizerFormatter::addJsonEncodeOption and removeJsonEncodeOption are now public to allow modifying default json flags - * Fixed GitProcessor type error when there is no git repo present - * Fixed normalization of SoapFault objects containing deeply nested objects as "detail" - * Fixed support for relative paths in RotatingFileHandler - -### 2.0.2 (2019-12-20) - - * Fixed ElasticsearchHandler swallowing exceptions details when failing to index log records - * Fixed normalization of SoapFault objects containing non-strings as "detail" in LineFormatter - * Fixed formatting of resources in JsonFormatter - * Fixed RedisHandler failing to use MULTI properly when passed a proxied Redis instance (e.g. in Symfony with lazy services) - * Fixed FilterHandler triggering a notice when handleBatch was filtering all records passed to it - * Fixed Turkish locale messing up the conversion of level names to their constant values - -### 2.0.1 (2019-11-13) - - * Fixed normalization of Traversables to avoid traversing them as not all of them are rewindable - * Fixed setFormatter/getFormatter to forward to the nested handler in FilterHandler, FingersCrossedHandler, BufferHandler, OverflowHandler and SamplingHandler - * Fixed BrowserConsoleHandler formatting when using multiple styles - * Fixed normalization of exception codes to be always integers even for PDOException which have them as numeric strings - * Fixed normalization of SoapFault objects containing non-strings as "detail" - * Fixed json encoding across all handlers to always attempt recovery of non-UTF-8 strings instead of failing the whole encoding - * Fixed ChromePHPHandler to avoid sending more data than latest Chrome versions allow in headers (4KB down from 256KB). - * Fixed type error in BrowserConsoleHandler when the context array of log records was not associative. - -### 2.0.0 (2019-08-30) - - * BC Break: This is a major release, see [UPGRADE.md](UPGRADE.md) for details if you are coming from a 1.x release - * BC Break: Logger methods log/debug/info/notice/warning/error/critical/alert/emergency now have explicit void return types - * Added FallbackGroupHandler which works like the WhatFailureGroupHandler but stops dispatching log records as soon as one handler accepted it - * Fixed support for UTF-8 when cutting strings to avoid cutting a multibyte-character in half - * Fixed normalizers handling of exception backtraces to avoid serializing arguments in some cases - * Fixed date timezone handling in SyslogUdpHandler - -### 2.0.0-beta2 (2019-07-06) - - * BC Break: This is a major release, see [UPGRADE.md](UPGRADE.md) for details if you are coming from a 1.x release - * BC Break: PHP 7.2 is now the minimum required PHP version. - * BC Break: Removed SlackbotHandler, RavenHandler and HipChatHandler, see [UPGRADE.md](UPGRADE.md) for details - * Added OverflowHandler which will only flush log records to its nested handler when reaching a certain amount of logs (i.e. only pass through when things go really bad) - * Added TelegramBotHandler to log records to a [Telegram](https://core.telegram.org/bots/api) bot account - * Added support for JsonSerializable when normalizing exceptions - * Added support for RFC3164 (outdated BSD syslog protocol) to SyslogUdpHandler - * Added SoapFault details to formatted exceptions - * Fixed DeduplicationHandler silently failing to start when file could not be opened - * Fixed issue in GroupHandler and WhatFailureGroupHandler where setting multiple processors would duplicate records - * Fixed GelfFormatter losing some data when one attachment was too long - * Fixed issue in SignalHandler restarting syscalls functionality - * Improved performance of LogglyHandler when sending multiple logs in a single request - -### 2.0.0-beta1 (2018-12-08) - - * BC Break: This is a major release, see [UPGRADE.md](UPGRADE.md) for details if you are coming from a 1.x release - * BC Break: PHP 7.1 is now the minimum required PHP version. - * BC Break: Quite a few interface changes, only relevant if you implemented your own handlers/processors/formatters - * BC Break: Removed non-PSR-3 methods to add records, all the `add*` (e.g. `addWarning`) methods as well as `emerg`, `crit`, `err` and `warn` - * BC Break: The record timezone is now set per Logger instance and not statically anymore - * BC Break: There is no more default handler configured on empty Logger instances - * BC Break: ElasticSearchHandler renamed to ElasticaHandler - * BC Break: Various handler-specific breaks, see [UPGRADE.md](UPGRADE.md) for details - * Added scalar type hints and return hints in all the places it was possible. Switched strict_types on for more reliability. - * Added DateTimeImmutable support, all record datetime are now immutable, and will toString/json serialize with the correct date format, including microseconds (unless disabled) - * Added timezone and microseconds to the default date format - * Added SendGridHandler to use the SendGrid API to send emails - * Added LogmaticHandler to use the Logmatic.io API to store log records - * Added SqsHandler to send log records to an AWS SQS queue - * Added ElasticsearchHandler to send records via the official ES library. Elastica users should now use ElasticaHandler instead of ElasticSearchHandler - * Added NoopHandler which is similar to the NullHandle but does not prevent the bubbling of log records to handlers further down the configuration, useful for temporarily disabling a handler in configuration files - * Added ProcessHandler to write log output to the STDIN of a given process - * Added HostnameProcessor that adds the machine's hostname to log records - * Added a `$dateFormat` option to the PsrLogMessageProcessor which lets you format DateTime instances nicely - * Added support for the PHP 7.x `mongodb` extension in the MongoDBHandler - * Fixed many minor issues in various handlers, and probably added a few regressions too - -### 1.26.1 (2021-05-28) - - * Fixed PHP 8.1 deprecation warning - -### 1.26.0 (2020-12-14) - - * Added $dateFormat and $removeUsedContextFields arguments to PsrLogMessageProcessor (backport from 2.x) - -### 1.25.5 (2020-07-23) - - * Fixed array access on null in RavenHandler - * Fixed unique_id in WebProcessor not being disableable - -### 1.25.4 (2020-05-22) - - * Fixed GitProcessor type error when there is no git repo present - * Fixed normalization of SoapFault objects containing deeply nested objects as "detail" - * Fixed support for relative paths in RotatingFileHandler - -### 1.25.3 (2019-12-20) - - * Fixed formatting of resources in JsonFormatter - * Fixed RedisHandler failing to use MULTI properly when passed a proxied Redis instance (e.g. in Symfony with lazy services) - * Fixed FilterHandler triggering a notice when handleBatch was filtering all records passed to it - * Fixed Turkish locale messing up the conversion of level names to their constant values - -### 1.25.2 (2019-11-13) - - * Fixed normalization of Traversables to avoid traversing them as not all of them are rewindable - * Fixed setFormatter/getFormatter to forward to the nested handler in FilterHandler, FingersCrossedHandler, BufferHandler and SamplingHandler - * Fixed BrowserConsoleHandler formatting when using multiple styles - * Fixed normalization of exception codes to be always integers even for PDOException which have them as numeric strings - * Fixed normalization of SoapFault objects containing non-strings as "detail" - * Fixed json encoding across all handlers to always attempt recovery of non-UTF-8 strings instead of failing the whole encoding - -### 1.25.1 (2019-09-06) - - * Fixed forward-compatible interfaces to be compatible with Monolog 1.x too. - -### 1.25.0 (2019-09-06) - - * Deprecated SlackbotHandler, use SlackWebhookHandler or SlackHandler instead - * Deprecated RavenHandler, use sentry/sentry 2.x and their Sentry\Monolog\Handler instead - * Deprecated HipChatHandler, migrate to Slack and use SlackWebhookHandler or SlackHandler instead - * Added forward-compatible interfaces and traits FormattableHandlerInterface, FormattableHandlerTrait, ProcessableHandlerInterface, ProcessableHandlerTrait. If you use modern PHP and want to make code compatible with Monolog 1 and 2 this can help. You will have to require at least Monolog 1.25 though. - * Added support for RFC3164 (outdated BSD syslog protocol) to SyslogUdpHandler - * Fixed issue in GroupHandler and WhatFailureGroupHandler where setting multiple processors would duplicate records - * Fixed issue in SignalHandler restarting syscalls functionality - * Fixed normalizers handling of exception backtraces to avoid serializing arguments in some cases - * Fixed ZendMonitorHandler to work with the latest Zend Server versions - * Fixed ChromePHPHandler to avoid sending more data than latest Chrome versions allow in headers (4KB down from 256KB). - -### 1.24.0 (2018-11-05) - - * BC Notice: If you are extending any of the Monolog's Formatters' `normalize` method, make sure you add the new `$depth = 0` argument to your function signature to avoid strict PHP warnings. - * Added a `ResettableInterface` in order to reset/reset/clear/flush handlers and processors - * Added a `ProcessorInterface` as an optional way to label a class as being a processor (mostly useful for autowiring dependency containers) - * Added a way to log signals being received using Monolog\SignalHandler - * Added ability to customize error handling at the Logger level using Logger::setExceptionHandler - * Added InsightOpsHandler to migrate users of the LogEntriesHandler - * Added protection to NormalizerFormatter against circular and very deep structures, it now stops normalizing at a depth of 9 - * Added capture of stack traces to ErrorHandler when logging PHP errors - * Added RavenHandler support for a `contexts` context or extra key to forward that to Sentry's contexts - * Added forwarding of context info to FluentdFormatter - * Added SocketHandler::setChunkSize to override the default chunk size in case you must send large log lines to rsyslog for example - * Added ability to extend/override BrowserConsoleHandler - * Added SlackWebhookHandler::getWebhookUrl and SlackHandler::getToken to enable class extensibility - * Added SwiftMailerHandler::getSubjectFormatter to enable class extensibility - * Dropped official support for HHVM in test builds - * Fixed normalization of exception traces when call_user_func is used to avoid serializing objects and the data they contain - * Fixed naming of fields in Slack handler, all field names are now capitalized in all cases - * Fixed HipChatHandler bug where slack dropped messages randomly - * Fixed normalization of objects in Slack handlers - * Fixed support for PHP7's Throwable in NewRelicHandler - * Fixed race bug when StreamHandler sometimes incorrectly reported it failed to create a directory - * Fixed table row styling issues in HtmlFormatter - * Fixed RavenHandler dropping the message when logging exception - * Fixed WhatFailureGroupHandler skipping processors when using handleBatch - and implement it where possible - * Fixed display of anonymous class names - -### 1.23.0 (2017-06-19) - - * Improved SyslogUdpHandler's support for RFC5424 and added optional `$ident` argument - * Fixed GelfHandler truncation to be per field and not per message - * Fixed compatibility issue with PHP <5.3.6 - * Fixed support for headless Chrome in ChromePHPHandler - * Fixed support for latest Aws SDK in DynamoDbHandler - * Fixed support for SwiftMailer 6.0+ in SwiftMailerHandler - -### 1.22.1 (2017-03-13) - - * Fixed lots of minor issues in the new Slack integrations - * Fixed support for allowInlineLineBreaks in LineFormatter when formatting exception backtraces - -### 1.22.0 (2016-11-26) - - * Added SlackbotHandler and SlackWebhookHandler to set up Slack integration more easily - * Added MercurialProcessor to add mercurial revision and branch names to log records - * Added support for AWS SDK v3 in DynamoDbHandler - * Fixed fatal errors occurring when normalizing generators that have been fully consumed - * Fixed RollbarHandler to include a level (rollbar level), monolog_level (original name), channel and datetime (unix) - * Fixed RollbarHandler not flushing records automatically, calling close() explicitly is not necessary anymore - * Fixed SyslogUdpHandler to avoid sending empty frames - * Fixed a few PHP 7.0 and 7.1 compatibility issues - -### 1.21.0 (2016-07-29) - - * Break: Reverted the addition of $context when the ErrorHandler handles regular php errors from 1.20.0 as it was causing issues - * Added support for more formats in RotatingFileHandler::setFilenameFormat as long as they have Y, m and d in order - * Added ability to format the main line of text the SlackHandler sends by explicitly setting a formatter on the handler - * Added information about SoapFault instances in NormalizerFormatter - * Added $handleOnlyReportedErrors option on ErrorHandler::registerErrorHandler (default true) to allow logging of all errors no matter the error_reporting level - -### 1.20.0 (2016-07-02) - - * Added FingersCrossedHandler::activate() to manually trigger the handler regardless of the activation policy - * Added StreamHandler::getUrl to retrieve the stream's URL - * Added ability to override addRow/addTitle in HtmlFormatter - * Added the $context to context information when the ErrorHandler handles a regular php error - * Deprecated RotatingFileHandler::setFilenameFormat to only support 3 formats: Y, Y-m and Y-m-d - * Fixed WhatFailureGroupHandler to work with PHP7 throwables - * Fixed a few minor bugs - -### 1.19.0 (2016-04-12) - - * Break: StreamHandler will not close streams automatically that it does not own. If you pass in a stream (not a path/url), then it will not close it for you. You can retrieve those using getStream() if needed - * Added DeduplicationHandler to remove duplicate records from notifications across multiple requests, useful for email or other notifications on errors - * Added ability to use `%message%` and other LineFormatter replacements in the subject line of emails sent with NativeMailHandler and SwiftMailerHandler - * Fixed HipChatHandler handling of long messages - -### 1.18.2 (2016-04-02) - - * Fixed ElasticaFormatter to use more precise dates - * Fixed GelfMessageFormatter sending too long messages - -### 1.18.1 (2016-03-13) - - * Fixed SlackHandler bug where slack dropped messages randomly - * Fixed RedisHandler issue when using with the PHPRedis extension - * Fixed AmqpHandler content-type being incorrectly set when using with the AMQP extension - * Fixed BrowserConsoleHandler regression - -### 1.18.0 (2016-03-01) - - * Added optional reduction of timestamp precision via `Logger->useMicrosecondTimestamps(false)`, disabling it gets you a bit of performance boost but reduces the precision to the second instead of microsecond - * Added possibility to skip some extra stack frames in IntrospectionProcessor if you have some library wrapping Monolog that is always adding frames - * Added `Logger->withName` to clone a logger (keeping all handlers) with a new name - * Added FluentdFormatter for the Fluentd unix socket protocol - * Added HandlerWrapper base class to ease the creation of handler wrappers, just extend it and override as needed - * Added support for replacing context sub-keys using `%context.*%` in LineFormatter - * Added support for `payload` context value in RollbarHandler - * Added setRelease to RavenHandler to describe the application version, sent with every log - * Added support for `fingerprint` context value in RavenHandler - * Fixed JSON encoding errors that would gobble up the whole log record, we now handle those more gracefully by dropping chars as needed - * Fixed write timeouts in SocketHandler and derivatives, set to 10sec by default, lower it with `setWritingTimeout()` - * Fixed PHP7 compatibility with regard to Exception/Throwable handling in a few places - -### 1.17.2 (2015-10-14) - - * Fixed ErrorHandler compatibility with non-Monolog PSR-3 loggers - * Fixed SlackHandler handling to use slack functionalities better - * Fixed SwiftMailerHandler bug when sending multiple emails they all had the same id - * Fixed 5.3 compatibility regression - -### 1.17.1 (2015-08-31) - - * Fixed RollbarHandler triggering PHP notices - -### 1.17.0 (2015-08-30) - - * Added support for `checksum` and `release` context/extra values in RavenHandler - * Added better support for exceptions in RollbarHandler - * Added UidProcessor::getUid - * Added support for showing the resource type in NormalizedFormatter - * Fixed IntrospectionProcessor triggering PHP notices - -### 1.16.0 (2015-08-09) - - * Added IFTTTHandler to notify ifttt.com triggers - * Added Logger::setHandlers() to allow setting/replacing all handlers - * Added $capSize in RedisHandler to cap the log size - * Fixed StreamHandler creation of directory to only trigger when the first log write happens - * Fixed bug in the handling of curl failures - * Fixed duplicate logging of fatal errors when both error and fatal error handlers are registered in monolog's ErrorHandler - * Fixed missing fatal errors records with handlers that need to be closed to flush log records - * Fixed TagProcessor::addTags support for associative arrays - -### 1.15.0 (2015-07-12) - - * Added addTags and setTags methods to change a TagProcessor - * Added automatic creation of directories if they are missing for a StreamHandler to open a log file - * Added retry functionality to Loggly, Cube and Mandrill handlers so they retry up to 5 times in case of network failure - * Fixed process exit code being incorrectly reset to 0 if ErrorHandler::registerExceptionHandler was used - * Fixed HTML/JS escaping in BrowserConsoleHandler - * Fixed JSON encoding errors being silently suppressed (PHP 5.5+ only) - -### 1.14.0 (2015-06-19) - - * Added PHPConsoleHandler to send record to Chrome's PHP Console extension and library - * Added support for objects implementing __toString in the NormalizerFormatter - * Added support for HipChat's v2 API in HipChatHandler - * Added Logger::setTimezone() to initialize the timezone monolog should use in case date.timezone isn't correct for your app - * Added an option to send formatted message instead of the raw record on PushoverHandler via ->useFormattedMessage(true) - * Fixed curl errors being silently suppressed - -### 1.13.1 (2015-03-09) - - * Fixed regression in HipChat requiring a new token to be created - -### 1.13.0 (2015-03-05) - - * Added Registry::hasLogger to check for the presence of a logger instance - * Added context.user support to RavenHandler - * Added HipChat API v2 support in the HipChatHandler - * Added NativeMailerHandler::addParameter to pass params to the mail() process - * Added context data to SlackHandler when $includeContextAndExtra is true - * Added ability to customize the Swift_Message per-email in SwiftMailerHandler - * Fixed SwiftMailerHandler to lazily create message instances if a callback is provided - * Fixed serialization of INF and NaN values in Normalizer and LineFormatter - -### 1.12.0 (2014-12-29) - - * Break: HandlerInterface::isHandling now receives a partial record containing only a level key. This was always the intent and does not break any Monolog handler but is strictly speaking a BC break and you should check if you relied on any other field in your own handlers. - * Added PsrHandler to forward records to another PSR-3 logger - * Added SamplingHandler to wrap around a handler and include only every Nth record - * Added MongoDBFormatter to support better storage with MongoDBHandler (it must be enabled manually for now) - * Added exception codes in the output of most formatters - * Added LineFormatter::includeStacktraces to enable exception stack traces in logs (uses more than one line) - * Added $useShortAttachment to SlackHandler to minify attachment size and $includeExtra to append extra data - * Added $host to HipChatHandler for users of private instances - * Added $transactionName to NewRelicHandler and support for a transaction_name context value - * Fixed MandrillHandler to avoid outputting API call responses - * Fixed some non-standard behaviors in SyslogUdpHandler - -### 1.11.0 (2014-09-30) - - * Break: The NewRelicHandler extra and context data are now prefixed with extra_ and context_ to avoid clashes. Watch out if you have scripts reading those from the API and rely on names - * Added WhatFailureGroupHandler to suppress any exception coming from the wrapped handlers and avoid chain failures if a logging service fails - * Added MandrillHandler to send emails via the Mandrillapp.com API - * Added SlackHandler to log records to a Slack.com account - * Added FleepHookHandler to log records to a Fleep.io account - * Added LogglyHandler::addTag to allow adding tags to an existing handler - * Added $ignoreEmptyContextAndExtra to LineFormatter to avoid empty [] at the end - * Added $useLocking to StreamHandler and RotatingFileHandler to enable flock() while writing - * Added support for PhpAmqpLib in the AmqpHandler - * Added FingersCrossedHandler::clear and BufferHandler::clear to reset them between batches in long running jobs - * Added support for adding extra fields from $_SERVER in the WebProcessor - * Fixed support for non-string values in PrsLogMessageProcessor - * Fixed SwiftMailer messages being sent with the wrong date in long running scripts - * Fixed minor PHP 5.6 compatibility issues - * Fixed BufferHandler::close being called twice - -### 1.10.0 (2014-06-04) - - * Added Logger::getHandlers() and Logger::getProcessors() methods - * Added $passthruLevel argument to FingersCrossedHandler to let it always pass some records through even if the trigger level is not reached - * Added support for extra data in NewRelicHandler - * Added $expandNewlines flag to the ErrorLogHandler to create multiple log entries when a message has multiple lines - -### 1.9.1 (2014-04-24) - - * Fixed regression in RotatingFileHandler file permissions - * Fixed initialization of the BufferHandler to make sure it gets flushed after receiving records - * Fixed ChromePHPHandler and FirePHPHandler's activation strategies to be more conservative - -### 1.9.0 (2014-04-20) - - * Added LogEntriesHandler to send logs to a LogEntries account - * Added $filePermissions to tweak file mode on StreamHandler and RotatingFileHandler - * Added $useFormatting flag to MemoryProcessor to make it send raw data in bytes - * Added support for table formatting in FirePHPHandler via the table context key - * Added a TagProcessor to add tags to records, and support for tags in RavenHandler - * Added $appendNewline flag to the JsonFormatter to enable using it when logging to files - * Added sound support to the PushoverHandler - * Fixed multi-threading support in StreamHandler - * Fixed empty headers issue when ChromePHPHandler received no records - * Fixed default format of the ErrorLogHandler - -### 1.8.0 (2014-03-23) - - * Break: the LineFormatter now strips newlines by default because this was a bug, set $allowInlineLineBreaks to true if you need them - * Added BrowserConsoleHandler to send logs to any browser's console via console.log() injection in the output - * Added FilterHandler to filter records and only allow those of a given list of levels through to the wrapped handler - * Added FlowdockHandler to send logs to a Flowdock account - * Added RollbarHandler to send logs to a Rollbar account - * Added HtmlFormatter to send prettier log emails with colors for each log level - * Added GitProcessor to add the current branch/commit to extra record data - * Added a Monolog\Registry class to allow easier global access to pre-configured loggers - * Added support for the new official graylog2/gelf-php lib for GelfHandler, upgrade if you can by replacing the mlehner/gelf-php requirement - * Added support for HHVM - * Added support for Loggly batch uploads - * Added support for tweaking the content type and encoding in NativeMailerHandler - * Added $skipClassesPartials to tweak the ignored classes in the IntrospectionProcessor - * Fixed batch request support in GelfHandler - -### 1.7.0 (2013-11-14) - - * Added ElasticSearchHandler to send logs to an Elastic Search server - * Added DynamoDbHandler and ScalarFormatter to send logs to Amazon's Dynamo DB - * Added SyslogUdpHandler to send logs to a remote syslogd server - * Added LogglyHandler to send logs to a Loggly account - * Added $level to IntrospectionProcessor so it only adds backtraces when needed - * Added $version to LogstashFormatter to allow using the new v1 Logstash format - * Added $appName to NewRelicHandler - * Added configuration of Pushover notification retries/expiry - * Added $maxColumnWidth to NativeMailerHandler to change the 70 chars default - * Added chainability to most setters for all handlers - * Fixed RavenHandler batch processing so it takes the message from the record with highest priority - * Fixed HipChatHandler batch processing so it sends all messages at once - * Fixed issues with eAccelerator - * Fixed and improved many small things - -### 1.6.0 (2013-07-29) - - * Added HipChatHandler to send logs to a HipChat chat room - * Added ErrorLogHandler to send logs to PHP's error_log function - * Added NewRelicHandler to send logs to NewRelic's service - * Added Monolog\ErrorHandler helper class to register a Logger as exception/error/fatal handler - * Added ChannelLevelActivationStrategy for the FingersCrossedHandler to customize levels by channel - * Added stack traces output when normalizing exceptions (json output & co) - * Added Monolog\Logger::API constant (currently 1) - * Added support for ChromePHP's v4.0 extension - * Added support for message priorities in PushoverHandler, see $highPriorityLevel and $emergencyLevel - * Added support for sending messages to multiple users at once with the PushoverHandler - * Fixed RavenHandler's support for batch sending of messages (when behind a Buffer or FingersCrossedHandler) - * Fixed normalization of Traversables with very large data sets, only the first 1000 items are shown now - * Fixed issue in RotatingFileHandler when an open_basedir restriction is active - * Fixed minor issues in RavenHandler and bumped the API to Raven 0.5.0 - * Fixed SyslogHandler issue when many were used concurrently with different facilities - -### 1.5.0 (2013-04-23) - - * Added ProcessIdProcessor to inject the PID in log records - * Added UidProcessor to inject a unique identifier to all log records of one request/run - * Added support for previous exceptions in the LineFormatter exception serialization - * Added Monolog\Logger::getLevels() to get all available levels - * Fixed ChromePHPHandler so it avoids sending headers larger than Chrome can handle - -### 1.4.1 (2013-04-01) - - * Fixed exception formatting in the LineFormatter to be more minimalistic - * Fixed RavenHandler's handling of context/extra data, requires Raven client >0.1.0 - * Fixed log rotation in RotatingFileHandler to work with long running scripts spanning multiple days - * Fixed WebProcessor array access so it checks for data presence - * Fixed Buffer, Group and FingersCrossed handlers to make use of their processors - -### 1.4.0 (2013-02-13) - - * Added RedisHandler to log to Redis via the Predis library or the phpredis extension - * Added ZendMonitorHandler to log to the Zend Server monitor - * Added the possibility to pass arrays of handlers and processors directly in the Logger constructor - * Added `$useSSL` option to the PushoverHandler which is enabled by default - * Fixed ChromePHPHandler and FirePHPHandler issue when multiple instances are used simultaneously - * Fixed header injection capability in the NativeMailHandler - -### 1.3.1 (2013-01-11) - - * Fixed LogstashFormatter to be usable with stream handlers - * Fixed GelfMessageFormatter levels on Windows - -### 1.3.0 (2013-01-08) - - * Added PSR-3 compliance, the `Monolog\Logger` class is now an instance of `Psr\Log\LoggerInterface` - * Added PsrLogMessageProcessor that you can selectively enable for full PSR-3 compliance - * Added LogstashFormatter (combine with SocketHandler or StreamHandler to send logs to Logstash) - * Added PushoverHandler to send mobile notifications - * Added CouchDBHandler and DoctrineCouchDBHandler - * Added RavenHandler to send data to Sentry servers - * Added support for the new MongoClient class in MongoDBHandler - * Added microsecond precision to log records' timestamps - * Added `$flushOnOverflow` param to BufferHandler to flush by batches instead of losing - the oldest entries - * Fixed normalization of objects with cyclic references - -### 1.2.1 (2012-08-29) - - * Added new $logopts arg to SyslogHandler to provide custom openlog options - * Fixed fatal error in SyslogHandler - -### 1.2.0 (2012-08-18) - - * Added AmqpHandler (for use with AMQP servers) - * Added CubeHandler - * Added NativeMailerHandler::addHeader() to send custom headers in mails - * Added the possibility to specify more than one recipient in NativeMailerHandler - * Added the possibility to specify float timeouts in SocketHandler - * Added NOTICE and EMERGENCY levels to conform with RFC 5424 - * Fixed the log records to use the php default timezone instead of UTC - * Fixed BufferHandler not being flushed properly on PHP fatal errors - * Fixed normalization of exotic resource types - * Fixed the default format of the SyslogHandler to avoid duplicating datetimes in syslog - -### 1.1.0 (2012-04-23) - - * Added Monolog\Logger::isHandling() to check if a handler will - handle the given log level - * Added ChromePHPHandler - * Added MongoDBHandler - * Added GelfHandler (for use with Graylog2 servers) - * Added SocketHandler (for use with syslog-ng for example) - * Added NormalizerFormatter - * Added the possibility to change the activation strategy of the FingersCrossedHandler - * Added possibility to show microseconds in logs - * Added `server` and `referer` to WebProcessor output - -### 1.0.2 (2011-10-24) - - * Fixed bug in IE with large response headers and FirePHPHandler - -### 1.0.1 (2011-08-25) - - * Added MemoryPeakUsageProcessor and MemoryUsageProcessor - * Added Monolog\Logger::getName() to get a logger's channel name - -### 1.0.0 (2011-07-06) - - * Added IntrospectionProcessor to get info from where the logger was called - * Fixed WebProcessor in CLI - -### 1.0.0-RC1 (2011-07-01) - - * Initial release diff --git a/vendor/monolog/monolog/LICENSE b/vendor/monolog/monolog/LICENSE deleted file mode 100644 index aa2a0426..00000000 --- a/vendor/monolog/monolog/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011-2020 Jordi Boggiano - -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/monolog/monolog/README.md b/vendor/monolog/monolog/README.md deleted file mode 100644 index bfcae0c0..00000000 --- a/vendor/monolog/monolog/README.md +++ /dev/null @@ -1,112 +0,0 @@ -# Monolog - Logging for PHP [![Continuous Integration](https://github.com/Seldaek/monolog/workflows/Continuous%20Integration/badge.svg?branch=main)](https://github.com/Seldaek/monolog/actions) - -[![Total Downloads](https://img.shields.io/packagist/dt/monolog/monolog.svg)](https://packagist.org/packages/monolog/monolog) -[![Latest Stable Version](https://img.shields.io/packagist/v/monolog/monolog.svg)](https://packagist.org/packages/monolog/monolog) - - -Monolog sends your logs to files, sockets, inboxes, databases and various -web services. See the complete list of handlers below. Special handlers -allow you to build advanced logging strategies. - -This library implements the [PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md) -interface that you can type-hint against in your own libraries to keep -a maximum of interoperability. You can also use it in your applications to -make sure you can always use another compatible logger at a later time. -As of 1.11.0 Monolog public APIs will also accept PSR-3 log levels. -Internally Monolog still uses its own level scheme since it predates PSR-3. - -## Installation - -Install the latest version with - -```bash -$ composer require monolog/monolog -``` - -## Basic Usage - -```php -<?php - -use Monolog\Logger; -use Monolog\Handler\StreamHandler; - -// create a log channel -$log = new Logger('name'); -$log->pushHandler(new StreamHandler('path/to/your.log', Logger::WARNING)); - -// add records to the log -$log->warning('Foo'); -$log->error('Bar'); -``` - -## Documentation - -- [Usage Instructions](doc/01-usage.md) -- [Handlers, Formatters and Processors](doc/02-handlers-formatters-processors.md) -- [Utility Classes](doc/03-utilities.md) -- [Extending Monolog](doc/04-extending.md) -- [Log Record Structure](doc/message-structure.md) - -## Support Monolog Financially - -Get supported Monolog and help fund the project with the [Tidelift Subscription](https://tidelift.com/subscription/pkg/packagist-monolog-monolog?utm_source=packagist-monolog-monolog&utm_medium=referral&utm_campaign=enterprise) or via [GitHub sponsorship](https://github.com/sponsors/Seldaek). - -Tidelift delivers 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. - -## Third Party Packages - -Third party handlers, formatters and processors are -[listed in the wiki](https://github.com/Seldaek/monolog/wiki/Third-Party-Packages). You -can also add your own there if you publish one. - -## About - -### Requirements - -- Monolog `^2.0` works with PHP 7.2 or above, use Monolog `^1.25` for PHP 5.3+ support. - -### Support - -Monolog 1.x support is somewhat limited at this point and only important fixes will be done. You should migrate to Monolog 2 where possible to benefit from all the latest features and fixes. - -### Submitting bugs and feature requests - -Bugs and feature request are tracked on [GitHub](https://github.com/Seldaek/monolog/issues) - -### Framework Integrations - -- Frameworks and libraries using [PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md) - can be used very easily with Monolog since it implements the interface. -- [Symfony](http://symfony.com) comes out of the box with Monolog. -- [Laravel](http://laravel.com/) comes out of the box with Monolog. -- [Lumen](http://lumen.laravel.com/) comes out of the box with Monolog. -- [PPI](https://github.com/ppi/framework) comes out of the box with Monolog. -- [CakePHP](http://cakephp.org/) is usable with Monolog via the [cakephp-monolog](https://github.com/jadb/cakephp-monolog) plugin. -- [Slim](http://www.slimframework.com/) is usable with Monolog via the [Slim-Monolog](https://github.com/Flynsarmy/Slim-Monolog) log writer. -- [XOOPS 2.6](http://xoops.org/) comes out of the box with Monolog. -- [Aura.Web_Project](https://github.com/auraphp/Aura.Web_Project) comes out of the box with Monolog. -- [Nette Framework](http://nette.org/en/) is usable with Monolog via the [contributte/monolog](https://github.com/contributte/monolog) or [orisai/nette-monolog](https://github.com/orisai/nette-monolog) extensions. -- [Proton Micro Framework](https://github.com/alexbilbie/Proton) comes out of the box with Monolog. -- [FuelPHP](http://fuelphp.com/) comes out of the box with Monolog. -- [Equip Framework](https://github.com/equip/framework) comes out of the box with Monolog. -- [Yii 2](http://www.yiiframework.com/) is usable with Monolog via the [yii2-monolog](https://github.com/merorafael/yii2-monolog) or [yii2-psr-log-target](https://github.com/samdark/yii2-psr-log-target) plugins. -- [Hawkbit Micro Framework](https://github.com/HawkBitPhp/hawkbit) comes out of the box with Monolog. -- [SilverStripe 4](https://www.silverstripe.org/) comes out of the box with Monolog. -- [Drupal](https://www.drupal.org/) is usable with Monolog via the [monolog](https://www.drupal.org/project/monolog) module. -- [Aimeos ecommerce framework](https://aimeos.org/) is usable with Monolog via the [ai-monolog](https://github.com/aimeos/ai-monolog) extension. -- [Magento](https://magento.com/) comes out of the box with Monolog. - -### Author - -Jordi Boggiano - <j.boggiano@seld.be> - <http://twitter.com/seldaek><br /> -See also the list of [contributors](https://github.com/Seldaek/monolog/contributors) who participated in this project. - -### License - -Monolog is licensed under the MIT License - see the [LICENSE](LICENSE) file for details - -### Acknowledgements - -This library is heavily inspired by Python's [Logbook](https://logbook.readthedocs.io/en/stable/) -library, although most concepts have been adjusted to fit to the PHP world. diff --git a/vendor/monolog/monolog/UPGRADE.md b/vendor/monolog/monolog/UPGRADE.md deleted file mode 100644 index 84e15e6b..00000000 --- a/vendor/monolog/monolog/UPGRADE.md +++ /dev/null @@ -1,72 +0,0 @@ -### 2.0.0 - -- `Monolog\Logger::API` can be used to distinguish between a Monolog `1` and `2` - install of Monolog when writing integration code. - -- Removed non-PSR-3 methods to add records, all the `add*` (e.g. `addWarning`) - methods as well as `emerg`, `crit`, `err` and `warn`. - -- DateTime are now formatted with a timezone and microseconds (unless disabled). - Various formatters and log output might be affected, which may mess with log parsing - in some cases. - -- The `datetime` in every record array is now a DateTimeImmutable, not that you - should have been modifying these anyway. - -- The timezone is now set per Logger instance and not statically, either - via ->setTimezone or passed in the constructor. Calls to Logger::setTimezone - should be converted. - -- `HandlerInterface` has been split off and two new interfaces now exist for - more granular controls: `ProcessableHandlerInterface` and - `FormattableHandlerInterface`. Handlers not extending `AbstractHandler` - should make sure to implement the relevant interfaces. - -- `HandlerInterface` now requires the `close` method to be implemented. This - only impacts you if you implement the interface yourself, but you can extend - the new `Monolog\Handler\Handler` base class too. - -- There is no more default handler configured on empty Logger instances, if - you were relying on that you will not get any output anymore, make sure to - configure the handler you need. - -#### LogglyFormatter - -- The records' `datetime` is not sent anymore. Only `timestamp` is sent to Loggly. - -#### AmqpHandler - -- Log levels are not shortened to 4 characters anymore. e.g. a warning record - will be sent using the `warning.channel` routing key instead of `warn.channel` - as in 1.x. -- The exchange name does not default to 'log' anymore, and it is completely ignored - now for the AMQP extension users. Only PHPAmqpLib uses it if provided. - -#### RotatingFileHandler - -- The file name format must now contain `{date}` and the date format must be set - to one of the predefined FILE_PER_* constants to avoid issues with file rotation. - See `setFilenameFormat`. - -#### LogstashFormatter - -- Removed Logstash V0 support -- Context/extra prefix has been removed in favor of letting users configure the exact key being sent -- Context/extra data are now sent as an object instead of single keys - -#### HipChatHandler - -- Removed deprecated HipChat handler, migrate to Slack and use SlackWebhookHandler or SlackHandler instead - -#### SlackbotHandler - -- Removed deprecated SlackbotHandler handler, use SlackWebhookHandler or SlackHandler instead - -#### RavenHandler - -- Removed deprecated RavenHandler handler, use sentry/sentry 2.x and their Sentry\Monolog\Handler instead - -#### ElasticSearchHandler - -- As support for the official Elasticsearch library was added, the former ElasticSearchHandler has been - renamed to ElasticaHandler and the new one added as ElasticsearchHandler. diff --git a/vendor/monolog/monolog/composer.json b/vendor/monolog/monolog/composer.json deleted file mode 100644 index ab775ad6..00000000 --- a/vendor/monolog/monolog/composer.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "name": "monolog/monolog", - "description": "Sends your logs to files, sockets, inboxes, databases and various web services", - "keywords": ["log", "logging", "psr-3"], - "homepage": "https://github.com/Seldaek/monolog", - "type": "library", - "license": "MIT", - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "https://seld.be" - } - ], - "require": { - "php": ">=7.2", - "psr/log": "^1.0.1 || ^2.0 || ^3.0" - }, - "require-dev": { - "ext-json": "*", - "aws/aws-sdk-php": "^2.4.9 || ^3.0", - "doctrine/couchdb": "~1.0@dev", - "elasticsearch/elasticsearch": "^7 || ^8", - "graylog2/gelf-php": "^1.4.2", - "guzzlehttp/guzzle": "^7.4", - "guzzlehttp/psr7": "^2.2", - "mongodb/mongodb": "^1.8", - "php-amqplib/php-amqplib": "~2.4 || ^3", - "phpspec/prophecy": "^1.15", - "phpstan/phpstan": "^0.12.91", - "phpunit/phpunit": "^8.5.14", - "predis/predis": "^1.1 || ^2.0", - "rollbar/rollbar": "^1.3 || ^2 || ^3", - "ruflin/elastica": "^7", - "swiftmailer/swiftmailer": "^5.3|^6.0", - "symfony/mailer": "^5.4 || ^6", - "symfony/mime": "^5.4 || ^6" - }, - "suggest": { - "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", - "doctrine/couchdb": "Allow sending log messages to a CouchDB server", - "ruflin/elastica": "Allow sending log messages to an Elastic Search server", - "elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client", - "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", - "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", - "ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)", - "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", - "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", - "rollbar/rollbar": "Allow sending log messages to Rollbar", - "ext-mbstring": "Allow to work properly with unicode symbols", - "ext-sockets": "Allow sending log messages to a Syslog server (via UDP driver)", - "ext-curl": "Required to send log messages using the IFTTTHandler, the LogglyHandler, the SendGridHandler, the SlackWebhookHandler or the TelegramBotHandler", - "ext-openssl": "Required to send log messages using SSL" - }, - "autoload": { - "psr-4": {"Monolog\\": "src/Monolog"} - }, - "autoload-dev": { - "psr-4": {"Monolog\\": "tests/Monolog"} - }, - "provide": { - "psr/log-implementation": "1.0.0 || 2.0.0 || 3.0.0" - }, - "extra": { - "branch-alias": { - "dev-main": "2.x-dev" - } - }, - "scripts": { - "test": "@php vendor/bin/phpunit", - "phpstan": "@php vendor/bin/phpstan analyse" - }, - "config": { - "lock": false, - "sort-packages": true, - "platform-check": false, - "allow-plugins": { - "composer/package-versions-deprecated": true - } - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Attribute/AsMonologProcessor.php b/vendor/monolog/monolog/src/Monolog/Attribute/AsMonologProcessor.php deleted file mode 100644 index 188bbb0d..00000000 --- a/vendor/monolog/monolog/src/Monolog/Attribute/AsMonologProcessor.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Attribute; - -/** - * A reusable attribute to help configure a class or a method as a processor. - * - * Using it offers no guarantee: it needs to be leveraged by a Monolog third-party consumer. - * - * Using it with the Monolog library only has no effect at all: processors should still be turned into a callable if - * needed and manually pushed to the loggers and to the processable handlers. - */ -#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] -class AsMonologProcessor -{ - /** @var string|null */ - public $channel = null; - /** @var string|null */ - public $handler = null; - /** @var string|null */ - public $method = null; - - /** - * @param string|null $channel The logging channel the processor should be pushed to. - * @param string|null $handler The handler the processor should be pushed to. - * @param string|null $method The method that processes the records (if the attribute is used at the class level). - */ - public function __construct( - ?string $channel = null, - ?string $handler = null, - ?string $method = null - ) { - $this->channel = $channel; - $this->handler = $handler; - $this->method = $method; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/DateTimeImmutable.php b/vendor/monolog/monolog/src/Monolog/DateTimeImmutable.php deleted file mode 100644 index 6a1ba9b2..00000000 --- a/vendor/monolog/monolog/src/Monolog/DateTimeImmutable.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog; - -use DateTimeZone; - -/** - * Overrides default json encoding of date time objects - * - * @author Menno Holtkamp - * @author Jordi Boggiano <j.boggiano@seld.be> - */ -class DateTimeImmutable extends \DateTimeImmutable implements \JsonSerializable -{ - /** - * @var bool - */ - private $useMicroseconds; - - public function __construct(bool $useMicroseconds, ?DateTimeZone $timezone = null) - { - $this->useMicroseconds = $useMicroseconds; - - parent::__construct('now', $timezone); - } - - public function jsonSerialize(): string - { - if ($this->useMicroseconds) { - return $this->format('Y-m-d\TH:i:s.uP'); - } - - return $this->format('Y-m-d\TH:i:sP'); - } - - public function __toString(): string - { - return $this->jsonSerialize(); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/ErrorHandler.php b/vendor/monolog/monolog/src/Monolog/ErrorHandler.php deleted file mode 100644 index 576f1713..00000000 --- a/vendor/monolog/monolog/src/Monolog/ErrorHandler.php +++ /dev/null @@ -1,307 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog; - -use Psr\Log\LoggerInterface; -use Psr\Log\LogLevel; - -/** - * Monolog error handler - * - * A facility to enable logging of runtime errors, exceptions and fatal errors. - * - * Quick setup: <code>ErrorHandler::register($logger);</code> - * - * @author Jordi Boggiano <j.boggiano@seld.be> - */ -class ErrorHandler -{ - /** @var LoggerInterface */ - private $logger; - - /** @var ?callable */ - private $previousExceptionHandler = null; - /** @var array<class-string, LogLevel::*> an array of class name to LogLevel::* constant mapping */ - private $uncaughtExceptionLevelMap = []; - - /** @var callable|true|null */ - private $previousErrorHandler = null; - /** @var array<int, LogLevel::*> an array of E_* constant to LogLevel::* constant mapping */ - private $errorLevelMap = []; - /** @var bool */ - private $handleOnlyReportedErrors = true; - - /** @var bool */ - private $hasFatalErrorHandler = false; - /** @var LogLevel::* */ - private $fatalLevel = LogLevel::ALERT; - /** @var ?string */ - private $reservedMemory = null; - /** @var ?array{type: int, message: string, file: string, line: int, trace: mixed} */ - private $lastFatalData = null; - /** @var int[] */ - private static $fatalErrors = [E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR]; - - public function __construct(LoggerInterface $logger) - { - $this->logger = $logger; - } - - /** - * Registers a new ErrorHandler for a given Logger - * - * By default it will handle errors, exceptions and fatal errors - * - * @param LoggerInterface $logger - * @param array<int, LogLevel::*>|false $errorLevelMap an array of E_* constant to LogLevel::* constant mapping, or false to disable error handling - * @param array<class-string, LogLevel::*>|false $exceptionLevelMap an array of class name to LogLevel::* constant mapping, or false to disable exception handling - * @param LogLevel::*|null|false $fatalLevel a LogLevel::* constant, null to use the default LogLevel::ALERT or false to disable fatal error handling - * @return ErrorHandler - */ - public static function register(LoggerInterface $logger, $errorLevelMap = [], $exceptionLevelMap = [], $fatalLevel = null): self - { - /** @phpstan-ignore-next-line */ - $handler = new static($logger); - if ($errorLevelMap !== false) { - $handler->registerErrorHandler($errorLevelMap); - } - if ($exceptionLevelMap !== false) { - $handler->registerExceptionHandler($exceptionLevelMap); - } - if ($fatalLevel !== false) { - $handler->registerFatalHandler($fatalLevel); - } - - return $handler; - } - - /** - * @param array<class-string, LogLevel::*> $levelMap an array of class name to LogLevel::* constant mapping - * @return $this - */ - public function registerExceptionHandler(array $levelMap = [], bool $callPrevious = true): self - { - $prev = set_exception_handler(function (\Throwable $e): void { - $this->handleException($e); - }); - $this->uncaughtExceptionLevelMap = $levelMap; - foreach ($this->defaultExceptionLevelMap() as $class => $level) { - if (!isset($this->uncaughtExceptionLevelMap[$class])) { - $this->uncaughtExceptionLevelMap[$class] = $level; - } - } - if ($callPrevious && $prev) { - $this->previousExceptionHandler = $prev; - } - - return $this; - } - - /** - * @param array<int, LogLevel::*> $levelMap an array of E_* constant to LogLevel::* constant mapping - * @return $this - */ - public function registerErrorHandler(array $levelMap = [], bool $callPrevious = true, int $errorTypes = -1, bool $handleOnlyReportedErrors = true): self - { - $prev = set_error_handler([$this, 'handleError'], $errorTypes); - $this->errorLevelMap = array_replace($this->defaultErrorLevelMap(), $levelMap); - if ($callPrevious) { - $this->previousErrorHandler = $prev ?: true; - } else { - $this->previousErrorHandler = null; - } - - $this->handleOnlyReportedErrors = $handleOnlyReportedErrors; - - return $this; - } - - /** - * @param LogLevel::*|null $level a LogLevel::* constant, null to use the default LogLevel::ALERT - * @param int $reservedMemorySize Amount of KBs to reserve in memory so that it can be freed when handling fatal errors giving Monolog some room in memory to get its job done - */ - public function registerFatalHandler($level = null, int $reservedMemorySize = 20): self - { - register_shutdown_function([$this, 'handleFatalError']); - - $this->reservedMemory = str_repeat(' ', 1024 * $reservedMemorySize); - $this->fatalLevel = null === $level ? LogLevel::ALERT : $level; - $this->hasFatalErrorHandler = true; - - return $this; - } - - /** - * @return array<class-string, LogLevel::*> - */ - protected function defaultExceptionLevelMap(): array - { - return [ - 'ParseError' => LogLevel::CRITICAL, - 'Throwable' => LogLevel::ERROR, - ]; - } - - /** - * @return array<int, LogLevel::*> - */ - protected function defaultErrorLevelMap(): array - { - return [ - E_ERROR => LogLevel::CRITICAL, - E_WARNING => LogLevel::WARNING, - E_PARSE => LogLevel::ALERT, - E_NOTICE => LogLevel::NOTICE, - E_CORE_ERROR => LogLevel::CRITICAL, - E_CORE_WARNING => LogLevel::WARNING, - E_COMPILE_ERROR => LogLevel::ALERT, - E_COMPILE_WARNING => LogLevel::WARNING, - E_USER_ERROR => LogLevel::ERROR, - E_USER_WARNING => LogLevel::WARNING, - E_USER_NOTICE => LogLevel::NOTICE, - E_STRICT => LogLevel::NOTICE, - E_RECOVERABLE_ERROR => LogLevel::ERROR, - E_DEPRECATED => LogLevel::NOTICE, - E_USER_DEPRECATED => LogLevel::NOTICE, - ]; - } - - /** - * @phpstan-return never - */ - private function handleException(\Throwable $e): void - { - $level = LogLevel::ERROR; - foreach ($this->uncaughtExceptionLevelMap as $class => $candidate) { - if ($e instanceof $class) { - $level = $candidate; - break; - } - } - - $this->logger->log( - $level, - sprintf('Uncaught Exception %s: "%s" at %s line %s', Utils::getClass($e), $e->getMessage(), $e->getFile(), $e->getLine()), - ['exception' => $e] - ); - - if ($this->previousExceptionHandler) { - ($this->previousExceptionHandler)($e); - } - - if (!headers_sent() && !ini_get('display_errors')) { - http_response_code(500); - } - - exit(255); - } - - /** - * @private - * - * @param mixed[] $context - */ - public function handleError(int $code, string $message, string $file = '', int $line = 0, ?array $context = []): bool - { - if ($this->handleOnlyReportedErrors && !(error_reporting() & $code)) { - return false; - } - - // fatal error codes are ignored if a fatal error handler is present as well to avoid duplicate log entries - if (!$this->hasFatalErrorHandler || !in_array($code, self::$fatalErrors, true)) { - $level = $this->errorLevelMap[$code] ?? LogLevel::CRITICAL; - $this->logger->log($level, self::codeToString($code).': '.$message, ['code' => $code, 'message' => $message, 'file' => $file, 'line' => $line]); - } else { - $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); - array_shift($trace); // Exclude handleError from trace - $this->lastFatalData = ['type' => $code, 'message' => $message, 'file' => $file, 'line' => $line, 'trace' => $trace]; - } - - if ($this->previousErrorHandler === true) { - return false; - } elseif ($this->previousErrorHandler) { - return (bool) ($this->previousErrorHandler)($code, $message, $file, $line, $context); - } - - return true; - } - - /** - * @private - */ - public function handleFatalError(): void - { - $this->reservedMemory = ''; - - if (is_array($this->lastFatalData)) { - $lastError = $this->lastFatalData; - } else { - $lastError = error_get_last(); - } - - if ($lastError && in_array($lastError['type'], self::$fatalErrors, true)) { - $trace = $lastError['trace'] ?? null; - $this->logger->log( - $this->fatalLevel, - 'Fatal Error ('.self::codeToString($lastError['type']).'): '.$lastError['message'], - ['code' => $lastError['type'], 'message' => $lastError['message'], 'file' => $lastError['file'], 'line' => $lastError['line'], 'trace' => $trace] - ); - - if ($this->logger instanceof Logger) { - foreach ($this->logger->getHandlers() as $handler) { - $handler->close(); - } - } - } - } - - /** - * @param int $code - */ - private static function codeToString($code): string - { - switch ($code) { - case E_ERROR: - return 'E_ERROR'; - case E_WARNING: - return 'E_WARNING'; - case E_PARSE: - return 'E_PARSE'; - case E_NOTICE: - return 'E_NOTICE'; - case E_CORE_ERROR: - return 'E_CORE_ERROR'; - case E_CORE_WARNING: - return 'E_CORE_WARNING'; - case E_COMPILE_ERROR: - return 'E_COMPILE_ERROR'; - case E_COMPILE_WARNING: - return 'E_COMPILE_WARNING'; - case E_USER_ERROR: - return 'E_USER_ERROR'; - case E_USER_WARNING: - return 'E_USER_WARNING'; - case E_USER_NOTICE: - return 'E_USER_NOTICE'; - case E_STRICT: - return 'E_STRICT'; - case E_RECOVERABLE_ERROR: - return 'E_RECOVERABLE_ERROR'; - case E_DEPRECATED: - return 'E_DEPRECATED'; - case E_USER_DEPRECATED: - return 'E_USER_DEPRECATED'; - } - - return 'Unknown PHP error'; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php deleted file mode 100644 index aa1884b9..00000000 --- a/vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php +++ /dev/null @@ -1,83 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Logger; - -/** - * Formats a log message according to the ChromePHP array format - * - * @author Christophe Coevoet <stof@notk.org> - */ -class ChromePHPFormatter implements FormatterInterface -{ - /** - * Translates Monolog log levels to Wildfire levels. - * - * @var array<int, 'log'|'info'|'warn'|'error'> - */ - private $logLevels = [ - Logger::DEBUG => 'log', - Logger::INFO => 'info', - Logger::NOTICE => 'info', - Logger::WARNING => 'warn', - Logger::ERROR => 'error', - Logger::CRITICAL => 'error', - Logger::ALERT => 'error', - Logger::EMERGENCY => 'error', - ]; - - /** - * {@inheritDoc} - */ - public function format(array $record) - { - // Retrieve the line and file if set and remove them from the formatted extra - $backtrace = 'unknown'; - if (isset($record['extra']['file'], $record['extra']['line'])) { - $backtrace = $record['extra']['file'].' : '.$record['extra']['line']; - unset($record['extra']['file'], $record['extra']['line']); - } - - $message = ['message' => $record['message']]; - if ($record['context']) { - $message['context'] = $record['context']; - } - if ($record['extra']) { - $message['extra'] = $record['extra']; - } - if (count($message) === 1) { - $message = reset($message); - } - - return [ - $record['channel'], - $message, - $backtrace, - $this->logLevels[$record['level']], - ]; - } - - /** - * {@inheritDoc} - */ - public function formatBatch(array $records) - { - $formatted = []; - - foreach ($records as $record) { - $formatted[] = $this->format($record); - } - - return $formatted; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php deleted file mode 100644 index 6c8a9ab5..00000000 --- a/vendor/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php +++ /dev/null @@ -1,89 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Elastica\Document; - -/** - * Format a log message into an Elastica Document - * - * @author Jelle Vink <jelle.vink@gmail.com> - * - * @phpstan-import-type Record from \Monolog\Logger - */ -class ElasticaFormatter extends NormalizerFormatter -{ - /** - * @var string Elastic search index name - */ - protected $index; - - /** - * @var ?string Elastic search document type - */ - protected $type; - - /** - * @param string $index Elastic Search index name - * @param ?string $type Elastic Search document type, deprecated as of Elastica 7 - */ - public function __construct(string $index, ?string $type) - { - // elasticsearch requires a ISO 8601 format date with optional millisecond precision. - parent::__construct('Y-m-d\TH:i:s.uP'); - - $this->index = $index; - $this->type = $type; - } - - /** - * {@inheritDoc} - */ - public function format(array $record) - { - $record = parent::format($record); - - return $this->getDocument($record); - } - - public function getIndex(): string - { - return $this->index; - } - - /** - * @deprecated since Elastica 7 type has no effect - */ - public function getType(): string - { - /** @phpstan-ignore-next-line */ - return $this->type; - } - - /** - * Convert a log message into an Elastica Document - * - * @phpstan-param Record $record - */ - protected function getDocument(array $record): Document - { - $document = new Document(); - $document->setData($record); - if (method_exists($document, 'setType')) { - /** @phpstan-ignore-next-line */ - $document->setType($this->type); - } - $document->setIndex($this->index); - - return $document; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/ElasticsearchFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/ElasticsearchFormatter.php deleted file mode 100644 index b792b819..00000000 --- a/vendor/monolog/monolog/src/Monolog/Formatter/ElasticsearchFormatter.php +++ /dev/null @@ -1,89 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use DateTimeInterface; - -/** - * Format a log message into an Elasticsearch record - * - * @author Avtandil Kikabidze <akalongman@gmail.com> - */ -class ElasticsearchFormatter extends NormalizerFormatter -{ - /** - * @var string Elasticsearch index name - */ - protected $index; - - /** - * @var string Elasticsearch record type - */ - protected $type; - - /** - * @param string $index Elasticsearch index name - * @param string $type Elasticsearch record type - */ - public function __construct(string $index, string $type) - { - // Elasticsearch requires an ISO 8601 format date with optional millisecond precision. - parent::__construct(DateTimeInterface::ISO8601); - - $this->index = $index; - $this->type = $type; - } - - /** - * {@inheritDoc} - */ - public function format(array $record) - { - $record = parent::format($record); - - return $this->getDocument($record); - } - - /** - * Getter index - * - * @return string - */ - public function getIndex(): string - { - return $this->index; - } - - /** - * Getter type - * - * @return string - */ - public function getType(): string - { - return $this->type; - } - - /** - * Convert a log message into an Elasticsearch record - * - * @param mixed[] $record Log message - * @return mixed[] - */ - protected function getDocument(array $record): array - { - $record['_index'] = $this->index; - $record['_type'] = $this->type; - - return $record; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php deleted file mode 100644 index 41b56b3c..00000000 --- a/vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php +++ /dev/null @@ -1,111 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -/** - * formats the record to be used in the FlowdockHandler - * - * @author Dominik Liebler <liebler.dominik@gmail.com> - */ -class FlowdockFormatter implements FormatterInterface -{ - /** - * @var string - */ - private $source; - - /** - * @var string - */ - private $sourceEmail; - - public function __construct(string $source, string $sourceEmail) - { - $this->source = $source; - $this->sourceEmail = $sourceEmail; - } - - /** - * {@inheritDoc} - * - * @return mixed[] - */ - public function format(array $record): array - { - $tags = [ - '#logs', - '#' . strtolower($record['level_name']), - '#' . $record['channel'], - ]; - - foreach ($record['extra'] as $value) { - $tags[] = '#' . $value; - } - - $subject = sprintf( - 'in %s: %s - %s', - $this->source, - $record['level_name'], - $this->getShortMessage($record['message']) - ); - - $record['flowdock'] = [ - 'source' => $this->source, - 'from_address' => $this->sourceEmail, - 'subject' => $subject, - 'content' => $record['message'], - 'tags' => $tags, - 'project' => $this->source, - ]; - - return $record; - } - - /** - * {@inheritDoc} - * - * @return mixed[][] - */ - public function formatBatch(array $records): array - { - $formatted = []; - - foreach ($records as $record) { - $formatted[] = $this->format($record); - } - - return $formatted; - } - - public function getShortMessage(string $message): string - { - static $hasMbString; - - if (null === $hasMbString) { - $hasMbString = function_exists('mb_strlen'); - } - - $maxLength = 45; - - if ($hasMbString) { - if (mb_strlen($message, 'UTF-8') > $maxLength) { - $message = mb_substr($message, 0, $maxLength - 4, 'UTF-8') . ' ...'; - } - } else { - if (strlen($message) > $maxLength) { - $message = substr($message, 0, $maxLength - 4) . ' ...'; - } - } - - return $message; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php deleted file mode 100644 index 29b14d30..00000000 --- a/vendor/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php +++ /dev/null @@ -1,88 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Utils; - -/** - * Class FluentdFormatter - * - * Serializes a log message to Fluentd unix socket protocol - * - * Fluentd config: - * - * <source> - * type unix - * path /var/run/td-agent/td-agent.sock - * </source> - * - * Monolog setup: - * - * $logger = new Monolog\Logger('fluent.tag'); - * $fluentHandler = new Monolog\Handler\SocketHandler('unix:///var/run/td-agent/td-agent.sock'); - * $fluentHandler->setFormatter(new Monolog\Formatter\FluentdFormatter()); - * $logger->pushHandler($fluentHandler); - * - * @author Andrius Putna <fordnox@gmail.com> - */ -class FluentdFormatter implements FormatterInterface -{ - /** - * @var bool $levelTag should message level be a part of the fluentd tag - */ - protected $levelTag = false; - - public function __construct(bool $levelTag = false) - { - if (!function_exists('json_encode')) { - throw new \RuntimeException('PHP\'s json extension is required to use Monolog\'s FluentdUnixFormatter'); - } - - $this->levelTag = $levelTag; - } - - public function isUsingLevelsInTag(): bool - { - return $this->levelTag; - } - - public function format(array $record): string - { - $tag = $record['channel']; - if ($this->levelTag) { - $tag .= '.' . strtolower($record['level_name']); - } - - $message = [ - 'message' => $record['message'], - 'context' => $record['context'], - 'extra' => $record['extra'], - ]; - - if (!$this->levelTag) { - $message['level'] = $record['level']; - $message['level_name'] = $record['level_name']; - } - - return Utils::jsonEncode([$tag, $record['datetime']->getTimestamp(), $message]); - } - - public function formatBatch(array $records): string - { - $message = ''; - foreach ($records as $record) { - $message .= $this->format($record); - } - - return $message; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php b/vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php deleted file mode 100644 index 19617ec5..00000000 --- a/vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -/** - * Interface for formatters - * - * @author Jordi Boggiano <j.boggiano@seld.be> - * - * @phpstan-import-type Record from \Monolog\Logger - */ -interface FormatterInterface -{ - /** - * Formats a log record. - * - * @param array $record A record to format - * @return mixed The formatted record - * - * @phpstan-param Record $record - */ - public function format(array $record); - - /** - * Formats a set of log records. - * - * @param array $records A set of records to format - * @return mixed The formatted set of records - * - * @phpstan-param Record[] $records - */ - public function formatBatch(array $records); -} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php deleted file mode 100644 index a1a79372..00000000 --- a/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php +++ /dev/null @@ -1,160 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Logger; -use Gelf\Message; -use Monolog\Utils; - -/** - * Serializes a log message to GELF - * @see http://docs.graylog.org/en/latest/pages/gelf.html - * - * @author Matt Lehner <mlehner@gmail.com> - * - * @phpstan-import-type Level from \Monolog\Logger - */ -class GelfMessageFormatter extends NormalizerFormatter -{ - protected const DEFAULT_MAX_LENGTH = 32766; - - /** - * @var string the name of the system for the Gelf log message - */ - protected $systemName; - - /** - * @var string a prefix for 'extra' fields from the Monolog record (optional) - */ - protected $extraPrefix; - - /** - * @var string a prefix for 'context' fields from the Monolog record (optional) - */ - protected $contextPrefix; - - /** - * @var int max length per field - */ - protected $maxLength; - - /** - * Translates Monolog log levels to Graylog2 log priorities. - * - * @var array<int, int> - * - * @phpstan-var array<Level, int> - */ - private $logLevels = [ - Logger::DEBUG => 7, - Logger::INFO => 6, - Logger::NOTICE => 5, - Logger::WARNING => 4, - Logger::ERROR => 3, - Logger::CRITICAL => 2, - Logger::ALERT => 1, - Logger::EMERGENCY => 0, - ]; - - public function __construct(?string $systemName = null, ?string $extraPrefix = null, string $contextPrefix = 'ctxt_', ?int $maxLength = null) - { - if (!class_exists(Message::class)) { - throw new \RuntimeException('Composer package graylog2/gelf-php is required to use Monolog\'s GelfMessageFormatter'); - } - - parent::__construct('U.u'); - - $this->systemName = (is_null($systemName) || $systemName === '') ? (string) gethostname() : $systemName; - - $this->extraPrefix = is_null($extraPrefix) ? '' : $extraPrefix; - $this->contextPrefix = $contextPrefix; - $this->maxLength = is_null($maxLength) ? self::DEFAULT_MAX_LENGTH : $maxLength; - } - - /** - * {@inheritDoc} - */ - public function format(array $record): Message - { - $context = $extra = []; - if (isset($record['context'])) { - /** @var mixed[] $context */ - $context = parent::normalize($record['context']); - } - if (isset($record['extra'])) { - /** @var mixed[] $extra */ - $extra = parent::normalize($record['extra']); - } - - if (!isset($record['datetime'], $record['message'], $record['level'])) { - throw new \InvalidArgumentException('The record should at least contain datetime, message and level keys, '.var_export($record, true).' given'); - } - - $message = new Message(); - $message - ->setTimestamp($record['datetime']) - ->setShortMessage((string) $record['message']) - ->setHost($this->systemName) - ->setLevel($this->logLevels[$record['level']]); - - // message length + system name length + 200 for padding / metadata - $len = 200 + strlen((string) $record['message']) + strlen($this->systemName); - - if ($len > $this->maxLength) { - $message->setShortMessage(Utils::substr($record['message'], 0, $this->maxLength)); - } - - if (isset($record['channel'])) { - $message->setFacility($record['channel']); - } - if (isset($extra['line'])) { - $message->setLine($extra['line']); - unset($extra['line']); - } - if (isset($extra['file'])) { - $message->setFile($extra['file']); - unset($extra['file']); - } - - foreach ($extra as $key => $val) { - $val = is_scalar($val) || null === $val ? $val : $this->toJson($val); - $len = strlen($this->extraPrefix . $key . $val); - if ($len > $this->maxLength) { - $message->setAdditional($this->extraPrefix . $key, Utils::substr((string) $val, 0, $this->maxLength)); - - continue; - } - $message->setAdditional($this->extraPrefix . $key, $val); - } - - foreach ($context as $key => $val) { - $val = is_scalar($val) || null === $val ? $val : $this->toJson($val); - $len = strlen($this->contextPrefix . $key . $val); - if ($len > $this->maxLength) { - $message->setAdditional($this->contextPrefix . $key, Utils::substr((string) $val, 0, $this->maxLength)); - - continue; - } - $message->setAdditional($this->contextPrefix . $key, $val); - } - - /** @phpstan-ignore-next-line */ - if (null === $message->getFile() && isset($context['exception']['file'])) { - if (preg_match("/^(.+):([0-9]+)$/", $context['exception']['file'], $matches)) { - $message->setFile($matches[1]); - $message->setLine($matches[2]); - } - } - - return $message; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/GoogleCloudLoggingFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/GoogleCloudLoggingFormatter.php deleted file mode 100644 index 0cd287f5..00000000 --- a/vendor/monolog/monolog/src/Monolog/Formatter/GoogleCloudLoggingFormatter.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use DateTimeInterface; -use Monolog\LogRecord; - -/** - * Encodes message information into JSON in a format compatible with Cloud logging. - * - * @see https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry - * - * @author Luís Cobucci <lcobucci@gmail.com> - */ -final class GoogleCloudLoggingFormatter extends JsonFormatter -{ - /** {@inheritdoc} **/ - public function format(array $record): string - { - // Re-key level for GCP logging - $record['severity'] = $record['level_name']; - $record['timestamp'] = $record['datetime']->format(DateTimeInterface::RFC3339_EXTENDED); - - // Remove keys that are not used by GCP - unset($record['level'], $record['level_name'], $record['datetime']); - - return parent::format($record); - } -} - diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php deleted file mode 100644 index 10a4311c..00000000 --- a/vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php +++ /dev/null @@ -1,142 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Logger; -use Monolog\Utils; - -/** - * Formats incoming records into an HTML table - * - * This is especially useful for html email logging - * - * @author Tiago Brito <tlfbrito@gmail.com> - */ -class HtmlFormatter extends NormalizerFormatter -{ - /** - * Translates Monolog log levels to html color priorities. - * - * @var array<int, string> - */ - protected $logLevels = [ - Logger::DEBUG => '#CCCCCC', - Logger::INFO => '#28A745', - Logger::NOTICE => '#17A2B8', - Logger::WARNING => '#FFC107', - Logger::ERROR => '#FD7E14', - Logger::CRITICAL => '#DC3545', - Logger::ALERT => '#821722', - Logger::EMERGENCY => '#000000', - ]; - - /** - * @param string|null $dateFormat The format of the timestamp: one supported by DateTime::format - */ - public function __construct(?string $dateFormat = null) - { - parent::__construct($dateFormat); - } - - /** - * Creates an HTML table row - * - * @param string $th Row header content - * @param string $td Row standard cell content - * @param bool $escapeTd false if td content must not be html escaped - */ - protected function addRow(string $th, string $td = ' ', bool $escapeTd = true): string - { - $th = htmlspecialchars($th, ENT_NOQUOTES, 'UTF-8'); - if ($escapeTd) { - $td = '<pre>'.htmlspecialchars($td, ENT_NOQUOTES, 'UTF-8').'</pre>'; - } - - return "<tr style=\"padding: 4px;text-align: left;\">\n<th style=\"vertical-align: top;background: #ccc;color: #000\" width=\"100\">$th:</th>\n<td style=\"padding: 4px;text-align: left;vertical-align: top;background: #eee;color: #000\">".$td."</td>\n</tr>"; - } - - /** - * Create a HTML h1 tag - * - * @param string $title Text to be in the h1 - * @param int $level Error level - * @return string - */ - protected function addTitle(string $title, int $level): string - { - $title = htmlspecialchars($title, ENT_NOQUOTES, 'UTF-8'); - - return '<h1 style="background: '.$this->logLevels[$level].';color: #ffffff;padding: 5px;" class="monolog-output">'.$title.'</h1>'; - } - - /** - * Formats a log record. - * - * @return string The formatted record - */ - public function format(array $record): string - { - $output = $this->addTitle($record['level_name'], $record['level']); - $output .= '<table cellspacing="1" width="100%" class="monolog-output">'; - - $output .= $this->addRow('Message', (string) $record['message']); - $output .= $this->addRow('Time', $this->formatDate($record['datetime'])); - $output .= $this->addRow('Channel', $record['channel']); - if ($record['context']) { - $embeddedTable = '<table cellspacing="1" width="100%">'; - foreach ($record['context'] as $key => $value) { - $embeddedTable .= $this->addRow((string) $key, $this->convertToString($value)); - } - $embeddedTable .= '</table>'; - $output .= $this->addRow('Context', $embeddedTable, false); - } - if ($record['extra']) { - $embeddedTable = '<table cellspacing="1" width="100%">'; - foreach ($record['extra'] as $key => $value) { - $embeddedTable .= $this->addRow((string) $key, $this->convertToString($value)); - } - $embeddedTable .= '</table>'; - $output .= $this->addRow('Extra', $embeddedTable, false); - } - - return $output.'</table>'; - } - - /** - * Formats a set of log records. - * - * @return string The formatted set of records - */ - public function formatBatch(array $records): string - { - $message = ''; - foreach ($records as $record) { - $message .= $this->format($record); - } - - return $message; - } - - /** - * @param mixed $data - */ - protected function convertToString($data): string - { - if (null === $data || is_scalar($data)) { - return (string) $data; - } - - $data = $this->normalize($data); - - return Utils::jsonEncode($data, JSON_PRETTY_PRINT | Utils::DEFAULT_JSON_FLAGS, true); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php deleted file mode 100644 index b737d82e..00000000 --- a/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php +++ /dev/null @@ -1,224 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Throwable; - -/** - * Encodes whatever record data is passed to it as json - * - * This can be useful to log to databases or remote APIs - * - * @author Jordi Boggiano <j.boggiano@seld.be> - * - * @phpstan-import-type Record from \Monolog\Logger - */ -class JsonFormatter extends NormalizerFormatter -{ - public const BATCH_MODE_JSON = 1; - public const BATCH_MODE_NEWLINES = 2; - - /** @var self::BATCH_MODE_* */ - protected $batchMode; - /** @var bool */ - protected $appendNewline; - /** @var bool */ - protected $ignoreEmptyContextAndExtra; - /** @var bool */ - protected $includeStacktraces = false; - - /** - * @param self::BATCH_MODE_* $batchMode - */ - public function __construct(int $batchMode = self::BATCH_MODE_JSON, bool $appendNewline = true, bool $ignoreEmptyContextAndExtra = false, bool $includeStacktraces = false) - { - $this->batchMode = $batchMode; - $this->appendNewline = $appendNewline; - $this->ignoreEmptyContextAndExtra = $ignoreEmptyContextAndExtra; - $this->includeStacktraces = $includeStacktraces; - - parent::__construct(); - } - - /** - * The batch mode option configures the formatting style for - * multiple records. By default, multiple records will be - * formatted as a JSON-encoded array. However, for - * compatibility with some API endpoints, alternative styles - * are available. - */ - public function getBatchMode(): int - { - return $this->batchMode; - } - - /** - * True if newlines are appended to every formatted record - */ - public function isAppendingNewlines(): bool - { - return $this->appendNewline; - } - - /** - * {@inheritDoc} - */ - public function format(array $record): string - { - $normalized = $this->normalize($record); - - if (isset($normalized['context']) && $normalized['context'] === []) { - if ($this->ignoreEmptyContextAndExtra) { - unset($normalized['context']); - } else { - $normalized['context'] = new \stdClass; - } - } - if (isset($normalized['extra']) && $normalized['extra'] === []) { - if ($this->ignoreEmptyContextAndExtra) { - unset($normalized['extra']); - } else { - $normalized['extra'] = new \stdClass; - } - } - - return $this->toJson($normalized, true) . ($this->appendNewline ? "\n" : ''); - } - - /** - * {@inheritDoc} - */ - public function formatBatch(array $records): string - { - switch ($this->batchMode) { - case static::BATCH_MODE_NEWLINES: - return $this->formatBatchNewlines($records); - - case static::BATCH_MODE_JSON: - default: - return $this->formatBatchJson($records); - } - } - - /** - * @return self - */ - public function includeStacktraces(bool $include = true): self - { - $this->includeStacktraces = $include; - - return $this; - } - - /** - * Return a JSON-encoded array of records. - * - * @phpstan-param Record[] $records - */ - protected function formatBatchJson(array $records): string - { - return $this->toJson($this->normalize($records), true); - } - - /** - * Use new lines to separate records instead of a - * JSON-encoded array. - * - * @phpstan-param Record[] $records - */ - protected function formatBatchNewlines(array $records): string - { - $instance = $this; - - $oldNewline = $this->appendNewline; - $this->appendNewline = false; - array_walk($records, function (&$value, $key) use ($instance) { - $value = $instance->format($value); - }); - $this->appendNewline = $oldNewline; - - return implode("\n", $records); - } - - /** - * Normalizes given $data. - * - * @param mixed $data - * - * @return mixed - */ - protected function normalize($data, int $depth = 0) - { - if ($depth > $this->maxNormalizeDepth) { - return 'Over '.$this->maxNormalizeDepth.' levels deep, aborting normalization'; - } - - if (is_array($data)) { - $normalized = []; - - $count = 1; - foreach ($data as $key => $value) { - if ($count++ > $this->maxNormalizeItemCount) { - $normalized['...'] = 'Over '.$this->maxNormalizeItemCount.' items ('.count($data).' total), aborting normalization'; - break; - } - - $normalized[$key] = $this->normalize($value, $depth + 1); - } - - return $normalized; - } - - if (is_object($data)) { - if ($data instanceof \DateTimeInterface) { - return $this->formatDate($data); - } - - if ($data instanceof Throwable) { - return $this->normalizeException($data, $depth); - } - - // if the object has specific json serializability we want to make sure we skip the __toString treatment below - if ($data instanceof \JsonSerializable) { - return $data; - } - - if (method_exists($data, '__toString')) { - return $data->__toString(); - } - - return $data; - } - - if (is_resource($data)) { - return parent::normalize($data); - } - - return $data; - } - - /** - * Normalizes given exception with or without its own stack trace based on - * `includeStacktraces` property. - * - * {@inheritDoc} - */ - protected function normalizeException(Throwable $e, int $depth = 0): array - { - $data = parent::normalizeException($e, $depth); - if (!$this->includeStacktraces) { - unset($data['trace']); - } - - return $data; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php deleted file mode 100644 index b31b2971..00000000 --- a/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php +++ /dev/null @@ -1,246 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Utils; - -/** - * Formats incoming records into a one-line string - * - * This is especially useful for logging to files - * - * @author Jordi Boggiano <j.boggiano@seld.be> - * @author Christophe Coevoet <stof@notk.org> - */ -class LineFormatter extends NormalizerFormatter -{ - public const SIMPLE_FORMAT = "[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n"; - - /** @var string */ - protected $format; - /** @var bool */ - protected $allowInlineLineBreaks; - /** @var bool */ - protected $ignoreEmptyContextAndExtra; - /** @var bool */ - protected $includeStacktraces; - /** @var ?callable */ - protected $stacktracesParser; - - /** - * @param string|null $format The format of the message - * @param string|null $dateFormat The format of the timestamp: one supported by DateTime::format - * @param bool $allowInlineLineBreaks Whether to allow inline line breaks in log entries - * @param bool $ignoreEmptyContextAndExtra - */ - public function __construct(?string $format = null, ?string $dateFormat = null, bool $allowInlineLineBreaks = false, bool $ignoreEmptyContextAndExtra = false, bool $includeStacktraces = false) - { - $this->format = $format === null ? static::SIMPLE_FORMAT : $format; - $this->allowInlineLineBreaks = $allowInlineLineBreaks; - $this->ignoreEmptyContextAndExtra = $ignoreEmptyContextAndExtra; - $this->includeStacktraces($includeStacktraces); - parent::__construct($dateFormat); - } - - public function includeStacktraces(bool $include = true, ?callable $parser = null): self - { - $this->includeStacktraces = $include; - if ($this->includeStacktraces) { - $this->allowInlineLineBreaks = true; - $this->stacktracesParser = $parser; - } - - return $this; - } - - public function allowInlineLineBreaks(bool $allow = true): self - { - $this->allowInlineLineBreaks = $allow; - - return $this; - } - - public function ignoreEmptyContextAndExtra(bool $ignore = true): self - { - $this->ignoreEmptyContextAndExtra = $ignore; - - return $this; - } - - /** - * {@inheritDoc} - */ - public function format(array $record): string - { - $vars = parent::format($record); - - $output = $this->format; - - foreach ($vars['extra'] as $var => $val) { - if (false !== strpos($output, '%extra.'.$var.'%')) { - $output = str_replace('%extra.'.$var.'%', $this->stringify($val), $output); - unset($vars['extra'][$var]); - } - } - - foreach ($vars['context'] as $var => $val) { - if (false !== strpos($output, '%context.'.$var.'%')) { - $output = str_replace('%context.'.$var.'%', $this->stringify($val), $output); - unset($vars['context'][$var]); - } - } - - if ($this->ignoreEmptyContextAndExtra) { - if (empty($vars['context'])) { - unset($vars['context']); - $output = str_replace('%context%', '', $output); - } - - if (empty($vars['extra'])) { - unset($vars['extra']); - $output = str_replace('%extra%', '', $output); - } - } - - foreach ($vars as $var => $val) { - if (false !== strpos($output, '%'.$var.'%')) { - $output = str_replace('%'.$var.'%', $this->stringify($val), $output); - } - } - - // remove leftover %extra.xxx% and %context.xxx% if any - if (false !== strpos($output, '%')) { - $output = preg_replace('/%(?:extra|context)\..+?%/', '', $output); - if (null === $output) { - $pcreErrorCode = preg_last_error(); - throw new \RuntimeException('Failed to run preg_replace: ' . $pcreErrorCode . ' / ' . Utils::pcreLastErrorMessage($pcreErrorCode)); - } - } - - return $output; - } - - public function formatBatch(array $records): string - { - $message = ''; - foreach ($records as $record) { - $message .= $this->format($record); - } - - return $message; - } - - /** - * @param mixed $value - */ - public function stringify($value): string - { - return $this->replaceNewlines($this->convertToString($value)); - } - - protected function normalizeException(\Throwable $e, int $depth = 0): string - { - $str = $this->formatException($e); - - if ($previous = $e->getPrevious()) { - do { - $depth++; - if ($depth > $this->maxNormalizeDepth) { - $str .= '\n[previous exception] Over ' . $this->maxNormalizeDepth . ' levels deep, aborting normalization'; - break; - } - - $str .= "\n[previous exception] " . $this->formatException($previous); - } while ($previous = $previous->getPrevious()); - } - - return $str; - } - - /** - * @param mixed $data - */ - protected function convertToString($data): string - { - if (null === $data || is_bool($data)) { - return var_export($data, true); - } - - if (is_scalar($data)) { - return (string) $data; - } - - return $this->toJson($data, true); - } - - protected function replaceNewlines(string $str): string - { - if ($this->allowInlineLineBreaks) { - if (0 === strpos($str, '{')) { - $str = preg_replace('/(?<!\\\\)\\\\[rn]/', "\n", $str); - if (null === $str) { - $pcreErrorCode = preg_last_error(); - throw new \RuntimeException('Failed to run preg_replace: ' . $pcreErrorCode . ' / ' . Utils::pcreLastErrorMessage($pcreErrorCode)); - } - } - - return $str; - } - - return str_replace(["\r\n", "\r", "\n"], ' ', $str); - } - - private function formatException(\Throwable $e): string - { - $str = '[object] (' . Utils::getClass($e) . '(code: ' . $e->getCode(); - if ($e instanceof \SoapFault) { - if (isset($e->faultcode)) { - $str .= ' faultcode: ' . $e->faultcode; - } - - if (isset($e->faultactor)) { - $str .= ' faultactor: ' . $e->faultactor; - } - - if (isset($e->detail)) { - if (is_string($e->detail)) { - $str .= ' detail: ' . $e->detail; - } elseif (is_object($e->detail) || is_array($e->detail)) { - $str .= ' detail: ' . $this->toJson($e->detail, true); - } - } - } - $str .= '): ' . $e->getMessage() . ' at ' . $e->getFile() . ':' . $e->getLine() . ')'; - - if ($this->includeStacktraces) { - $str .= $this->stacktracesParser($e); - } - - return $str; - } - - private function stacktracesParser(\Throwable $e): string - { - $trace = $e->getTraceAsString(); - - if ($this->stacktracesParser) { - $trace = $this->stacktracesParserCustom($trace); - } - - return "\n[stacktrace]\n" . $trace . "\n"; - } - - private function stacktracesParserCustom(string $trace): string - { - return implode("\n", array_filter(array_map($this->stacktracesParser, explode("\n", $trace)))); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/LogglyFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/LogglyFormatter.php deleted file mode 100644 index 29841aa3..00000000 --- a/vendor/monolog/monolog/src/Monolog/Formatter/LogglyFormatter.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -/** - * Encodes message information into JSON in a format compatible with Loggly. - * - * @author Adam Pancutt <adam@pancutt.com> - */ -class LogglyFormatter extends JsonFormatter -{ - /** - * Overrides the default batch mode to new lines for compatibility with the - * Loggly bulk API. - */ - public function __construct(int $batchMode = self::BATCH_MODE_NEWLINES, bool $appendNewline = false) - { - parent::__construct($batchMode, $appendNewline); - } - - /** - * Appends the 'timestamp' parameter for indexing by Loggly. - * - * @see https://www.loggly.com/docs/automated-parsing/#json - * @see \Monolog\Formatter\JsonFormatter::format() - */ - public function format(array $record): string - { - if (isset($record["datetime"]) && ($record["datetime"] instanceof \DateTimeInterface)) { - $record["timestamp"] = $record["datetime"]->format("Y-m-d\TH:i:s.uO"); - unset($record["datetime"]); - } - - return parent::format($record); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/LogmaticFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/LogmaticFormatter.php deleted file mode 100644 index b0451aba..00000000 --- a/vendor/monolog/monolog/src/Monolog/Formatter/LogmaticFormatter.php +++ /dev/null @@ -1,66 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -/** - * Encodes message information into JSON in a format compatible with Logmatic. - * - * @author Julien Breux <julien.breux@gmail.com> - */ -class LogmaticFormatter extends JsonFormatter -{ - protected const MARKERS = ["sourcecode", "php"]; - - /** - * @var string - */ - protected $hostname = ''; - - /** - * @var string - */ - protected $appname = ''; - - public function setHostname(string $hostname): self - { - $this->hostname = $hostname; - - return $this; - } - - public function setAppname(string $appname): self - { - $this->appname = $appname; - - return $this; - } - - /** - * Appends the 'hostname' and 'appname' parameter for indexing by Logmatic. - * - * @see http://doc.logmatic.io/docs/basics-to-send-data - * @see \Monolog\Formatter\JsonFormatter::format() - */ - public function format(array $record): string - { - if (!empty($this->hostname)) { - $record["hostname"] = $this->hostname; - } - if (!empty($this->appname)) { - $record["appname"] = $this->appname; - } - - $record["@marker"] = static::MARKERS; - - return parent::format($record); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php deleted file mode 100644 index f8de0d33..00000000 --- a/vendor/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php +++ /dev/null @@ -1,101 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -/** - * Serializes a log message to Logstash Event Format - * - * @see https://www.elastic.co/products/logstash - * @see https://github.com/elastic/logstash/blob/master/logstash-core/src/main/java/org/logstash/Event.java - * - * @author Tim Mower <timothy.mower@gmail.com> - */ -class LogstashFormatter extends NormalizerFormatter -{ - /** - * @var string the name of the system for the Logstash log message, used to fill the @source field - */ - protected $systemName; - - /** - * @var string an application name for the Logstash log message, used to fill the @type field - */ - protected $applicationName; - - /** - * @var string the key for 'extra' fields from the Monolog record - */ - protected $extraKey; - - /** - * @var string the key for 'context' fields from the Monolog record - */ - protected $contextKey; - - /** - * @param string $applicationName The application that sends the data, used as the "type" field of logstash - * @param string|null $systemName The system/machine name, used as the "source" field of logstash, defaults to the hostname of the machine - * @param string $extraKey The key for extra keys inside logstash "fields", defaults to extra - * @param string $contextKey The key for context keys inside logstash "fields", defaults to context - */ - public function __construct(string $applicationName, ?string $systemName = null, string $extraKey = 'extra', string $contextKey = 'context') - { - // logstash requires a ISO 8601 format date with optional millisecond precision. - parent::__construct('Y-m-d\TH:i:s.uP'); - - $this->systemName = $systemName === null ? (string) gethostname() : $systemName; - $this->applicationName = $applicationName; - $this->extraKey = $extraKey; - $this->contextKey = $contextKey; - } - - /** - * {@inheritDoc} - */ - public function format(array $record): string - { - $record = parent::format($record); - - if (empty($record['datetime'])) { - $record['datetime'] = gmdate('c'); - } - $message = [ - '@timestamp' => $record['datetime'], - '@version' => 1, - 'host' => $this->systemName, - ]; - if (isset($record['message'])) { - $message['message'] = $record['message']; - } - if (isset($record['channel'])) { - $message['type'] = $record['channel']; - $message['channel'] = $record['channel']; - } - if (isset($record['level_name'])) { - $message['level'] = $record['level_name']; - } - if (isset($record['level'])) { - $message['monolog_level'] = $record['level']; - } - if ($this->applicationName) { - $message['type'] = $this->applicationName; - } - if (!empty($record['extra'])) { - $message[$this->extraKey] = $record['extra']; - } - if (!empty($record['context'])) { - $message[$this->contextKey] = $record['context']; - } - - return $this->toJson($message) . "\n"; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php deleted file mode 100644 index fca69a89..00000000 --- a/vendor/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php +++ /dev/null @@ -1,162 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use MongoDB\BSON\Type; -use MongoDB\BSON\UTCDateTime; -use Monolog\Utils; - -/** - * Formats a record for use with the MongoDBHandler. - * - * @author Florian Plattner <me@florianplattner.de> - */ -class MongoDBFormatter implements FormatterInterface -{ - /** @var bool */ - private $exceptionTraceAsString; - /** @var int */ - private $maxNestingLevel; - /** @var bool */ - private $isLegacyMongoExt; - - /** - * @param int $maxNestingLevel 0 means infinite nesting, the $record itself is level 1, $record['context'] is 2 - * @param bool $exceptionTraceAsString set to false to log exception traces as a sub documents instead of strings - */ - public function __construct(int $maxNestingLevel = 3, bool $exceptionTraceAsString = true) - { - $this->maxNestingLevel = max($maxNestingLevel, 0); - $this->exceptionTraceAsString = $exceptionTraceAsString; - - $this->isLegacyMongoExt = extension_loaded('mongodb') && version_compare((string) phpversion('mongodb'), '1.1.9', '<='); - } - - /** - * {@inheritDoc} - * - * @return mixed[] - */ - public function format(array $record): array - { - /** @var mixed[] $res */ - $res = $this->formatArray($record); - - return $res; - } - - /** - * {@inheritDoc} - * - * @return array<mixed[]> - */ - public function formatBatch(array $records): array - { - $formatted = []; - foreach ($records as $key => $record) { - $formatted[$key] = $this->format($record); - } - - return $formatted; - } - - /** - * @param mixed[] $array - * @return mixed[]|string Array except when max nesting level is reached then a string "[...]" - */ - protected function formatArray(array $array, int $nestingLevel = 0) - { - if ($this->maxNestingLevel > 0 && $nestingLevel > $this->maxNestingLevel) { - return '[...]'; - } - - foreach ($array as $name => $value) { - if ($value instanceof \DateTimeInterface) { - $array[$name] = $this->formatDate($value, $nestingLevel + 1); - } elseif ($value instanceof \Throwable) { - $array[$name] = $this->formatException($value, $nestingLevel + 1); - } elseif (is_array($value)) { - $array[$name] = $this->formatArray($value, $nestingLevel + 1); - } elseif (is_object($value) && !$value instanceof Type) { - $array[$name] = $this->formatObject($value, $nestingLevel + 1); - } - } - - return $array; - } - - /** - * @param mixed $value - * @return mixed[]|string - */ - protected function formatObject($value, int $nestingLevel) - { - $objectVars = get_object_vars($value); - $objectVars['class'] = Utils::getClass($value); - - return $this->formatArray($objectVars, $nestingLevel); - } - - /** - * @return mixed[]|string - */ - protected function formatException(\Throwable $exception, int $nestingLevel) - { - $formattedException = [ - 'class' => Utils::getClass($exception), - 'message' => $exception->getMessage(), - 'code' => (int) $exception->getCode(), - 'file' => $exception->getFile() . ':' . $exception->getLine(), - ]; - - if ($this->exceptionTraceAsString === true) { - $formattedException['trace'] = $exception->getTraceAsString(); - } else { - $formattedException['trace'] = $exception->getTrace(); - } - - return $this->formatArray($formattedException, $nestingLevel); - } - - protected function formatDate(\DateTimeInterface $value, int $nestingLevel): UTCDateTime - { - if ($this->isLegacyMongoExt) { - return $this->legacyGetMongoDbDateTime($value); - } - - return $this->getMongoDbDateTime($value); - } - - private function getMongoDbDateTime(\DateTimeInterface $value): UTCDateTime - { - return new UTCDateTime((int) floor(((float) $value->format('U.u')) * 1000)); - } - - /** - * This is needed to support MongoDB Driver v1.19 and below - * - * See https://github.com/mongodb/mongo-php-driver/issues/426 - * - * It can probably be removed in 2.1 or later once MongoDB's 1.2 is released and widely adopted - */ - private function legacyGetMongoDbDateTime(\DateTimeInterface $value): UTCDateTime - { - $milliseconds = floor(((float) $value->format('U.u')) * 1000); - - $milliseconds = (PHP_INT_SIZE == 8) //64-bit OS? - ? (int) $milliseconds - : (string) $milliseconds; - - // @phpstan-ignore-next-line - return new UTCDateTime($milliseconds); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php deleted file mode 100644 index 5441bc0a..00000000 --- a/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php +++ /dev/null @@ -1,287 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\DateTimeImmutable; -use Monolog\Utils; -use Throwable; - -/** - * Normalizes incoming records to remove objects/resources so it's easier to dump to various targets - * - * @author Jordi Boggiano <j.boggiano@seld.be> - */ -class NormalizerFormatter implements FormatterInterface -{ - public const SIMPLE_DATE = "Y-m-d\TH:i:sP"; - - /** @var string */ - protected $dateFormat; - /** @var int */ - protected $maxNormalizeDepth = 9; - /** @var int */ - protected $maxNormalizeItemCount = 1000; - - /** @var int */ - private $jsonEncodeOptions = Utils::DEFAULT_JSON_FLAGS; - - /** - * @param string|null $dateFormat The format of the timestamp: one supported by DateTime::format - */ - public function __construct(?string $dateFormat = null) - { - $this->dateFormat = null === $dateFormat ? static::SIMPLE_DATE : $dateFormat; - if (!function_exists('json_encode')) { - throw new \RuntimeException('PHP\'s json extension is required to use Monolog\'s NormalizerFormatter'); - } - } - - /** - * {@inheritDoc} - * - * @param mixed[] $record - */ - public function format(array $record) - { - return $this->normalize($record); - } - - /** - * {@inheritDoc} - */ - public function formatBatch(array $records) - { - foreach ($records as $key => $record) { - $records[$key] = $this->format($record); - } - - return $records; - } - - public function getDateFormat(): string - { - return $this->dateFormat; - } - - public function setDateFormat(string $dateFormat): self - { - $this->dateFormat = $dateFormat; - - return $this; - } - - /** - * The maximum number of normalization levels to go through - */ - public function getMaxNormalizeDepth(): int - { - return $this->maxNormalizeDepth; - } - - public function setMaxNormalizeDepth(int $maxNormalizeDepth): self - { - $this->maxNormalizeDepth = $maxNormalizeDepth; - - return $this; - } - - /** - * The maximum number of items to normalize per level - */ - public function getMaxNormalizeItemCount(): int - { - return $this->maxNormalizeItemCount; - } - - public function setMaxNormalizeItemCount(int $maxNormalizeItemCount): self - { - $this->maxNormalizeItemCount = $maxNormalizeItemCount; - - return $this; - } - - /** - * Enables `json_encode` pretty print. - */ - public function setJsonPrettyPrint(bool $enable): self - { - if ($enable) { - $this->jsonEncodeOptions |= JSON_PRETTY_PRINT; - } else { - $this->jsonEncodeOptions &= ~JSON_PRETTY_PRINT; - } - - return $this; - } - - /** - * @param mixed $data - * @return null|scalar|array<array|scalar|null> - */ - protected function normalize($data, int $depth = 0) - { - if ($depth > $this->maxNormalizeDepth) { - return 'Over ' . $this->maxNormalizeDepth . ' levels deep, aborting normalization'; - } - - if (null === $data || is_scalar($data)) { - if (is_float($data)) { - if (is_infinite($data)) { - return ($data > 0 ? '' : '-') . 'INF'; - } - if (is_nan($data)) { - return 'NaN'; - } - } - - return $data; - } - - if (is_array($data)) { - $normalized = []; - - $count = 1; - foreach ($data as $key => $value) { - if ($count++ > $this->maxNormalizeItemCount) { - $normalized['...'] = 'Over ' . $this->maxNormalizeItemCount . ' items ('.count($data).' total), aborting normalization'; - break; - } - - $normalized[$key] = $this->normalize($value, $depth + 1); - } - - return $normalized; - } - - if ($data instanceof \DateTimeInterface) { - return $this->formatDate($data); - } - - if (is_object($data)) { - if ($data instanceof Throwable) { - return $this->normalizeException($data, $depth); - } - - if ($data instanceof \JsonSerializable) { - /** @var null|scalar|array<array|scalar|null> $value */ - $value = $data->jsonSerialize(); - } elseif (method_exists($data, '__toString')) { - /** @var string $value */ - $value = $data->__toString(); - } else { - // the rest is normalized by json encoding and decoding it - /** @var null|scalar|array<array|scalar|null> $value */ - $value = json_decode($this->toJson($data, true), true); - } - - return [Utils::getClass($data) => $value]; - } - - if (is_resource($data)) { - return sprintf('[resource(%s)]', get_resource_type($data)); - } - - return '[unknown('.gettype($data).')]'; - } - - /** - * @return mixed[] - */ - protected function normalizeException(Throwable $e, int $depth = 0) - { - if ($depth > $this->maxNormalizeDepth) { - return ['Over ' . $this->maxNormalizeDepth . ' levels deep, aborting normalization']; - } - - if ($e instanceof \JsonSerializable) { - return (array) $e->jsonSerialize(); - } - - $data = [ - 'class' => Utils::getClass($e), - 'message' => $e->getMessage(), - 'code' => (int) $e->getCode(), - 'file' => $e->getFile().':'.$e->getLine(), - ]; - - if ($e instanceof \SoapFault) { - if (isset($e->faultcode)) { - $data['faultcode'] = $e->faultcode; - } - - if (isset($e->faultactor)) { - $data['faultactor'] = $e->faultactor; - } - - if (isset($e->detail)) { - if (is_string($e->detail)) { - $data['detail'] = $e->detail; - } elseif (is_object($e->detail) || is_array($e->detail)) { - $data['detail'] = $this->toJson($e->detail, true); - } - } - } - - $trace = $e->getTrace(); - foreach ($trace as $frame) { - if (isset($frame['file'])) { - $data['trace'][] = $frame['file'].':'.$frame['line']; - } - } - - if ($previous = $e->getPrevious()) { - $data['previous'] = $this->normalizeException($previous, $depth + 1); - } - - return $data; - } - - /** - * Return the JSON representation of a value - * - * @param mixed $data - * @throws \RuntimeException if encoding fails and errors are not ignored - * @return string if encoding fails and ignoreErrors is true 'null' is returned - */ - protected function toJson($data, bool $ignoreErrors = false): string - { - return Utils::jsonEncode($data, $this->jsonEncodeOptions, $ignoreErrors); - } - - /** - * @return string - */ - protected function formatDate(\DateTimeInterface $date) - { - // in case the date format isn't custom then we defer to the custom DateTimeImmutable - // formatting logic, which will pick the right format based on whether useMicroseconds is on - if ($this->dateFormat === self::SIMPLE_DATE && $date instanceof DateTimeImmutable) { - return (string) $date; - } - - return $date->format($this->dateFormat); - } - - public function addJsonEncodeOption(int $option): self - { - $this->jsonEncodeOptions |= $option; - - return $this; - } - - public function removeJsonEncodeOption(int $option): self - { - $this->jsonEncodeOptions &= ~$option; - - return $this; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php deleted file mode 100644 index 187bc550..00000000 --- a/vendor/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -/** - * Formats data into an associative array of scalar values. - * Objects and arrays will be JSON encoded. - * - * @author Andrew Lawson <adlawson@gmail.com> - */ -class ScalarFormatter extends NormalizerFormatter -{ - /** - * {@inheritDoc} - * - * @phpstan-return array<string, scalar|null> $record - */ - public function format(array $record): array - { - $result = []; - foreach ($record as $key => $value) { - $result[$key] = $this->normalizeValue($value); - } - - return $result; - } - - /** - * @param mixed $value - * @return scalar|null - */ - protected function normalizeValue($value) - { - $normalized = $this->normalize($value); - - if (is_array($normalized)) { - return $this->toJson($normalized, true); - } - - return $normalized; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php deleted file mode 100644 index 6539b347..00000000 --- a/vendor/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php +++ /dev/null @@ -1,139 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Logger; - -/** - * Serializes a log message according to Wildfire's header requirements - * - * @author Eric Clemmons (@ericclemmons) <eric@uxdriven.com> - * @author Christophe Coevoet <stof@notk.org> - * @author Kirill chEbba Chebunin <iam@chebba.org> - * - * @phpstan-import-type Level from \Monolog\Logger - */ -class WildfireFormatter extends NormalizerFormatter -{ - /** - * Translates Monolog log levels to Wildfire levels. - * - * @var array<Level, string> - */ - private $logLevels = [ - Logger::DEBUG => 'LOG', - Logger::INFO => 'INFO', - Logger::NOTICE => 'INFO', - Logger::WARNING => 'WARN', - Logger::ERROR => 'ERROR', - Logger::CRITICAL => 'ERROR', - Logger::ALERT => 'ERROR', - Logger::EMERGENCY => 'ERROR', - ]; - - /** - * @param string|null $dateFormat The format of the timestamp: one supported by DateTime::format - */ - public function __construct(?string $dateFormat = null) - { - parent::__construct($dateFormat); - - // http headers do not like non-ISO-8559-1 characters - $this->removeJsonEncodeOption(JSON_UNESCAPED_UNICODE); - } - - /** - * {@inheritDoc} - * - * @return string - */ - public function format(array $record): string - { - // Retrieve the line and file if set and remove them from the formatted extra - $file = $line = ''; - if (isset($record['extra']['file'])) { - $file = $record['extra']['file']; - unset($record['extra']['file']); - } - if (isset($record['extra']['line'])) { - $line = $record['extra']['line']; - unset($record['extra']['line']); - } - - /** @var mixed[] $record */ - $record = $this->normalize($record); - $message = ['message' => $record['message']]; - $handleError = false; - if ($record['context']) { - $message['context'] = $record['context']; - $handleError = true; - } - if ($record['extra']) { - $message['extra'] = $record['extra']; - $handleError = true; - } - if (count($message) === 1) { - $message = reset($message); - } - - if (isset($record['context']['table'])) { - $type = 'TABLE'; - $label = $record['channel'] .': '. $record['message']; - $message = $record['context']['table']; - } else { - $type = $this->logLevels[$record['level']]; - $label = $record['channel']; - } - - // Create JSON object describing the appearance of the message in the console - $json = $this->toJson([ - [ - 'Type' => $type, - 'File' => $file, - 'Line' => $line, - 'Label' => $label, - ], - $message, - ], $handleError); - - // The message itself is a serialization of the above JSON object + it's length - return sprintf( - '%d|%s|', - strlen($json), - $json - ); - } - - /** - * {@inheritDoc} - * - * @phpstan-return never - */ - public function formatBatch(array $records) - { - throw new \BadMethodCallException('Batch formatting does not make sense for the WildfireFormatter'); - } - - /** - * {@inheritDoc} - * - * @return null|scalar|array<array|scalar|null>|object - */ - protected function normalize($data, int $depth = 0) - { - if (is_object($data) && !$data instanceof \DateTimeInterface) { - return $data; - } - - return parent::normalize($data, $depth); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php deleted file mode 100644 index a5cdaa71..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php +++ /dev/null @@ -1,112 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\ResettableInterface; -use Psr\Log\LogLevel; - -/** - * Base Handler class providing basic level/bubble support - * - * @author Jordi Boggiano <j.boggiano@seld.be> - * - * @phpstan-import-type Level from \Monolog\Logger - * @phpstan-import-type LevelName from \Monolog\Logger - */ -abstract class AbstractHandler extends Handler implements ResettableInterface -{ - /** - * @var int - * @phpstan-var Level - */ - protected $level = Logger::DEBUG; - /** @var bool */ - protected $bubble = true; - - /** - * @param int|string $level The minimum logging level at which this handler will be triggered - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - * - * @phpstan-param Level|LevelName|LogLevel::* $level - */ - public function __construct($level = Logger::DEBUG, bool $bubble = true) - { - $this->setLevel($level); - $this->bubble = $bubble; - } - - /** - * {@inheritDoc} - */ - public function isHandling(array $record): bool - { - return $record['level'] >= $this->level; - } - - /** - * Sets minimum logging level at which this handler will be triggered. - * - * @param Level|LevelName|LogLevel::* $level Level or level name - * @return self - */ - public function setLevel($level): self - { - $this->level = Logger::toMonologLevel($level); - - return $this; - } - - /** - * Gets minimum logging level at which this handler will be triggered. - * - * @return int - * - * @phpstan-return Level - */ - public function getLevel(): int - { - return $this->level; - } - - /** - * Sets the bubbling behavior. - * - * @param bool $bubble true means that this handler allows bubbling. - * false means that bubbling is not permitted. - * @return self - */ - public function setBubble(bool $bubble): self - { - $this->bubble = $bubble; - - return $this; - } - - /** - * Gets the bubbling behavior. - * - * @return bool true means that this handler allows bubbling. - * false means that bubbling is not permitted. - */ - public function getBubble(): bool - { - return $this->bubble; - } - - /** - * {@inheritDoc} - */ - public function reset() - { - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php deleted file mode 100644 index 77e533fc..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -/** - * Base Handler class providing the Handler structure, including processors and formatters - * - * Classes extending it should (in most cases) only implement write($record) - * - * @author Jordi Boggiano <j.boggiano@seld.be> - * @author Christophe Coevoet <stof@notk.org> - * - * @phpstan-import-type LevelName from \Monolog\Logger - * @phpstan-import-type Level from \Monolog\Logger - * @phpstan-import-type Record from \Monolog\Logger - * @phpstan-type FormattedRecord array{message: string, context: mixed[], level: Level, level_name: LevelName, channel: string, datetime: \DateTimeImmutable, extra: mixed[], formatted: mixed} - */ -abstract class AbstractProcessingHandler extends AbstractHandler implements ProcessableHandlerInterface, FormattableHandlerInterface -{ - use ProcessableHandlerTrait; - use FormattableHandlerTrait; - - /** - * {@inheritDoc} - */ - public function handle(array $record): bool - { - if (!$this->isHandling($record)) { - return false; - } - - if ($this->processors) { - /** @var Record $record */ - $record = $this->processRecord($record); - } - - $record['formatted'] = $this->getFormatter()->format($record); - - $this->write($record); - - return false === $this->bubble; - } - - /** - * Writes the record down to the log of the implementing handler - * - * @phpstan-param FormattedRecord $record - */ - abstract protected function write(array $record): void; - - /** - * @return void - */ - public function reset() - { - parent::reset(); - - $this->resetProcessors(); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php deleted file mode 100644 index 5e5ad1c1..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php +++ /dev/null @@ -1,106 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Formatter\FormatterInterface; -use Monolog\Formatter\LineFormatter; - -/** - * Common syslog functionality - * - * @phpstan-import-type Level from \Monolog\Logger - */ -abstract class AbstractSyslogHandler extends AbstractProcessingHandler -{ - /** @var int */ - protected $facility; - - /** - * Translates Monolog log levels to syslog log priorities. - * @var array - * @phpstan-var array<Level, int> - */ - protected $logLevels = [ - Logger::DEBUG => LOG_DEBUG, - Logger::INFO => LOG_INFO, - Logger::NOTICE => LOG_NOTICE, - Logger::WARNING => LOG_WARNING, - Logger::ERROR => LOG_ERR, - Logger::CRITICAL => LOG_CRIT, - Logger::ALERT => LOG_ALERT, - Logger::EMERGENCY => LOG_EMERG, - ]; - - /** - * List of valid log facility names. - * @var array<string, int> - */ - protected $facilities = [ - 'auth' => LOG_AUTH, - 'authpriv' => LOG_AUTHPRIV, - 'cron' => LOG_CRON, - 'daemon' => LOG_DAEMON, - 'kern' => LOG_KERN, - 'lpr' => LOG_LPR, - 'mail' => LOG_MAIL, - 'news' => LOG_NEWS, - 'syslog' => LOG_SYSLOG, - 'user' => LOG_USER, - 'uucp' => LOG_UUCP, - ]; - - /** - * @param string|int $facility Either one of the names of the keys in $this->facilities, or a LOG_* facility constant - */ - public function __construct($facility = LOG_USER, $level = Logger::DEBUG, bool $bubble = true) - { - parent::__construct($level, $bubble); - - if (!defined('PHP_WINDOWS_VERSION_BUILD')) { - $this->facilities['local0'] = LOG_LOCAL0; - $this->facilities['local1'] = LOG_LOCAL1; - $this->facilities['local2'] = LOG_LOCAL2; - $this->facilities['local3'] = LOG_LOCAL3; - $this->facilities['local4'] = LOG_LOCAL4; - $this->facilities['local5'] = LOG_LOCAL5; - $this->facilities['local6'] = LOG_LOCAL6; - $this->facilities['local7'] = LOG_LOCAL7; - } else { - $this->facilities['local0'] = 128; // LOG_LOCAL0 - $this->facilities['local1'] = 136; // LOG_LOCAL1 - $this->facilities['local2'] = 144; // LOG_LOCAL2 - $this->facilities['local3'] = 152; // LOG_LOCAL3 - $this->facilities['local4'] = 160; // LOG_LOCAL4 - $this->facilities['local5'] = 168; // LOG_LOCAL5 - $this->facilities['local6'] = 176; // LOG_LOCAL6 - $this->facilities['local7'] = 184; // LOG_LOCAL7 - } - - // convert textual description of facility to syslog constant - if (is_string($facility) && array_key_exists(strtolower($facility), $this->facilities)) { - $facility = $this->facilities[strtolower($facility)]; - } elseif (!in_array($facility, array_values($this->facilities), true)) { - throw new \UnexpectedValueException('Unknown facility value "'.$facility.'" given'); - } - - $this->facility = $facility; - } - - /** - * {@inheritDoc} - */ - protected function getDefaultFormatter(): FormatterInterface - { - return new LineFormatter('%channel%.%level_name%: %message% %context% %extra%'); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/AmqpHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/AmqpHandler.php deleted file mode 100644 index c4997482..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/AmqpHandler.php +++ /dev/null @@ -1,170 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Formatter\FormatterInterface; -use Monolog\Formatter\JsonFormatter; -use PhpAmqpLib\Message\AMQPMessage; -use PhpAmqpLib\Channel\AMQPChannel; -use AMQPExchange; - -/** - * @phpstan-import-type Record from \Monolog\Logger - */ -class AmqpHandler extends AbstractProcessingHandler -{ - /** - * @var AMQPExchange|AMQPChannel $exchange - */ - protected $exchange; - /** @var array<string, mixed> */ - private $extraAttributes = []; - - /** - * @return array<string, mixed> - */ - public function getExtraAttributes(): array - { - return $this->extraAttributes; - } - - /** - * Configure extra attributes to pass to the AMQPExchange (if you are using the amqp extension) - * - * @param array<string, mixed> $extraAttributes One of content_type, content_encoding, - * message_id, user_id, app_id, delivery_mode, - * priority, timestamp, expiration, type - * or reply_to, headers. - * @return AmqpHandler - */ - public function setExtraAttributes(array $extraAttributes): self - { - $this->extraAttributes = $extraAttributes; - return $this; - } - - /** - * @var string - */ - protected $exchangeName; - - /** - * @param AMQPExchange|AMQPChannel $exchange AMQPExchange (php AMQP ext) or PHP AMQP lib channel, ready for use - * @param string|null $exchangeName Optional exchange name, for AMQPChannel (PhpAmqpLib) only - */ - public function __construct($exchange, ?string $exchangeName = null, $level = Logger::DEBUG, bool $bubble = true) - { - if ($exchange instanceof AMQPChannel) { - $this->exchangeName = (string) $exchangeName; - } elseif (!$exchange instanceof AMQPExchange) { - throw new \InvalidArgumentException('PhpAmqpLib\Channel\AMQPChannel or AMQPExchange instance required'); - } elseif ($exchangeName) { - @trigger_error('The $exchangeName parameter can only be passed when using PhpAmqpLib, if using an AMQPExchange instance configure it beforehand', E_USER_DEPRECATED); - } - $this->exchange = $exchange; - - parent::__construct($level, $bubble); - } - - /** - * {@inheritDoc} - */ - protected function write(array $record): void - { - $data = $record["formatted"]; - $routingKey = $this->getRoutingKey($record); - - if ($this->exchange instanceof AMQPExchange) { - $attributes = [ - 'delivery_mode' => 2, - 'content_type' => 'application/json', - ]; - if ($this->extraAttributes) { - $attributes = array_merge($attributes, $this->extraAttributes); - } - $this->exchange->publish( - $data, - $routingKey, - 0, - $attributes - ); - } else { - $this->exchange->basic_publish( - $this->createAmqpMessage($data), - $this->exchangeName, - $routingKey - ); - } - } - - /** - * {@inheritDoc} - */ - public function handleBatch(array $records): void - { - if ($this->exchange instanceof AMQPExchange) { - parent::handleBatch($records); - - return; - } - - foreach ($records as $record) { - if (!$this->isHandling($record)) { - continue; - } - - /** @var Record $record */ - $record = $this->processRecord($record); - $data = $this->getFormatter()->format($record); - - $this->exchange->batch_basic_publish( - $this->createAmqpMessage($data), - $this->exchangeName, - $this->getRoutingKey($record) - ); - } - - $this->exchange->publish_batch(); - } - - /** - * Gets the routing key for the AMQP exchange - * - * @phpstan-param Record $record - */ - protected function getRoutingKey(array $record): string - { - $routingKey = sprintf('%s.%s', $record['level_name'], $record['channel']); - - return strtolower($routingKey); - } - - private function createAmqpMessage(string $data): AMQPMessage - { - return new AMQPMessage( - $data, - [ - 'delivery_mode' => 2, - 'content_type' => 'application/json', - ] - ); - } - - /** - * {@inheritDoc} - */ - protected function getDefaultFormatter(): FormatterInterface - { - return new JsonFormatter(JsonFormatter::BATCH_MODE_JSON, false); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php deleted file mode 100644 index fa383f1c..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php +++ /dev/null @@ -1,293 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\FormatterInterface; -use Monolog\Formatter\LineFormatter; -use Monolog\Utils; - -use function count; -use function headers_list; -use function stripos; -use function trigger_error; - -use const E_USER_DEPRECATED; - -/** - * Handler sending logs to browser's javascript console with no browser extension required - * - * @author Olivier Poitrey <rs@dailymotion.com> - * - * @phpstan-import-type FormattedRecord from AbstractProcessingHandler - */ -class BrowserConsoleHandler extends AbstractProcessingHandler -{ - /** @var bool */ - protected static $initialized = false; - /** @var FormattedRecord[] */ - protected static $records = []; - - protected const FORMAT_HTML = 'html'; - protected const FORMAT_JS = 'js'; - protected const FORMAT_UNKNOWN = 'unknown'; - - /** - * {@inheritDoc} - * - * Formatted output may contain some formatting markers to be transferred to `console.log` using the %c format. - * - * Example of formatted string: - * - * You can do [[blue text]]{color: blue} or [[green background]]{background-color: green; color: white} - */ - protected function getDefaultFormatter(): FormatterInterface - { - return new LineFormatter('[[%channel%]]{macro: autolabel} [[%level_name%]]{font-weight: bold} %message%'); - } - - /** - * {@inheritDoc} - */ - protected function write(array $record): void - { - // Accumulate records - static::$records[] = $record; - - // Register shutdown handler if not already done - if (!static::$initialized) { - static::$initialized = true; - $this->registerShutdownFunction(); - } - } - - /** - * Convert records to javascript console commands and send it to the browser. - * This method is automatically called on PHP shutdown if output is HTML or Javascript. - */ - public static function send(): void - { - $format = static::getResponseFormat(); - if ($format === self::FORMAT_UNKNOWN) { - return; - } - - if (count(static::$records)) { - if ($format === self::FORMAT_HTML) { - static::writeOutput('<script>' . static::generateScript() . '</script>'); - } elseif ($format === self::FORMAT_JS) { - static::writeOutput(static::generateScript()); - } - static::resetStatic(); - } - } - - public function close(): void - { - self::resetStatic(); - } - - public function reset() - { - parent::reset(); - - self::resetStatic(); - } - - /** - * Forget all logged records - */ - public static function resetStatic(): void - { - static::$records = []; - } - - /** - * Wrapper for register_shutdown_function to allow overriding - */ - protected function registerShutdownFunction(): void - { - if (PHP_SAPI !== 'cli') { - register_shutdown_function(['Monolog\Handler\BrowserConsoleHandler', 'send']); - } - } - - /** - * Wrapper for echo to allow overriding - */ - protected static function writeOutput(string $str): void - { - echo $str; - } - - /** - * Checks the format of the response - * - * If Content-Type is set to application/javascript or text/javascript -> js - * If Content-Type is set to text/html, or is unset -> html - * If Content-Type is anything else -> unknown - * - * @return string One of 'js', 'html' or 'unknown' - * @phpstan-return self::FORMAT_* - */ - protected static function getResponseFormat(): string - { - // Check content type - foreach (headers_list() as $header) { - if (stripos($header, 'content-type:') === 0) { - return static::getResponseFormatFromContentType($header); - } - } - - return self::FORMAT_HTML; - } - - /** - * @return string One of 'js', 'html' or 'unknown' - * @phpstan-return self::FORMAT_* - */ - protected static function getResponseFormatFromContentType(string $contentType): string - { - // This handler only works with HTML and javascript outputs - // text/javascript is obsolete in favour of application/javascript, but still used - if (stripos($contentType, 'application/javascript') !== false || stripos($contentType, 'text/javascript') !== false) { - return self::FORMAT_JS; - } - - if (stripos($contentType, 'text/html') !== false) { - return self::FORMAT_HTML; - } - - return self::FORMAT_UNKNOWN; - } - - private static function generateScript(): string - { - $script = []; - foreach (static::$records as $record) { - $context = static::dump('Context', $record['context']); - $extra = static::dump('Extra', $record['extra']); - - if (empty($context) && empty($extra)) { - $script[] = static::call_array('log', static::handleStyles($record['formatted'])); - } else { - $script = array_merge( - $script, - [static::call_array('groupCollapsed', static::handleStyles($record['formatted']))], - $context, - $extra, - [static::call('groupEnd')] - ); - } - } - - return "(function (c) {if (c && c.groupCollapsed) {\n" . implode("\n", $script) . "\n}})(console);"; - } - - /** - * @return string[] - */ - private static function handleStyles(string $formatted): array - { - $args = []; - $format = '%c' . $formatted; - preg_match_all('/\[\[(.*?)\]\]\{([^}]*)\}/s', $format, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER); - - foreach (array_reverse($matches) as $match) { - $args[] = '"font-weight: normal"'; - $args[] = static::quote(static::handleCustomStyles($match[2][0], $match[1][0])); - - $pos = $match[0][1]; - $format = Utils::substr($format, 0, $pos) . '%c' . $match[1][0] . '%c' . Utils::substr($format, $pos + strlen($match[0][0])); - } - - $args[] = static::quote('font-weight: normal'); - $args[] = static::quote($format); - - return array_reverse($args); - } - - private static function handleCustomStyles(string $style, string $string): string - { - static $colors = ['blue', 'green', 'red', 'magenta', 'orange', 'black', 'grey']; - static $labels = []; - - $style = preg_replace_callback('/macro\s*:(.*?)(?:;|$)/', function (array $m) use ($string, &$colors, &$labels) { - if (trim($m[1]) === 'autolabel') { - // Format the string as a label with consistent auto assigned background color - if (!isset($labels[$string])) { - $labels[$string] = $colors[count($labels) % count($colors)]; - } - $color = $labels[$string]; - - return "background-color: $color; color: white; border-radius: 3px; padding: 0 2px 0 2px"; - } - - return $m[1]; - }, $style); - - if (null === $style) { - $pcreErrorCode = preg_last_error(); - throw new \RuntimeException('Failed to run preg_replace_callback: ' . $pcreErrorCode . ' / ' . Utils::pcreLastErrorMessage($pcreErrorCode)); - } - - return $style; - } - - /** - * @param mixed[] $dict - * @return mixed[] - */ - private static function dump(string $title, array $dict): array - { - $script = []; - $dict = array_filter($dict); - if (empty($dict)) { - return $script; - } - $script[] = static::call('log', static::quote('%c%s'), static::quote('font-weight: bold'), static::quote($title)); - foreach ($dict as $key => $value) { - $value = json_encode($value); - if (empty($value)) { - $value = static::quote(''); - } - $script[] = static::call('log', static::quote('%s: %o'), static::quote((string) $key), $value); - } - - return $script; - } - - private static function quote(string $arg): string - { - return '"' . addcslashes($arg, "\"\n\\") . '"'; - } - - /** - * @param mixed $args - */ - private static function call(...$args): string - { - $method = array_shift($args); - if (!is_string($method)) { - throw new \UnexpectedValueException('Expected the first arg to be a string, got: '.var_export($method, true)); - } - - return static::call_array($method, $args); - } - - /** - * @param mixed[] $args - */ - private static function call_array(string $method, array $args): string - { - return 'c.' . $method . '(' . implode(', ', $args) . ');'; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php deleted file mode 100644 index fcce5d63..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php +++ /dev/null @@ -1,167 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\ResettableInterface; -use Monolog\Formatter\FormatterInterface; - -/** - * Buffers all records until closing the handler and then pass them as batch. - * - * This is useful for a MailHandler to send only one mail per request instead of - * sending one per log message. - * - * @author Christophe Coevoet <stof@notk.org> - * - * @phpstan-import-type Record from \Monolog\Logger - */ -class BufferHandler extends AbstractHandler implements ProcessableHandlerInterface, FormattableHandlerInterface -{ - use ProcessableHandlerTrait; - - /** @var HandlerInterface */ - protected $handler; - /** @var int */ - protected $bufferSize = 0; - /** @var int */ - protected $bufferLimit; - /** @var bool */ - protected $flushOnOverflow; - /** @var Record[] */ - protected $buffer = []; - /** @var bool */ - protected $initialized = false; - - /** - * @param HandlerInterface $handler Handler. - * @param int $bufferLimit How many entries should be buffered at most, beyond that the oldest items are removed from the buffer. - * @param bool $flushOnOverflow If true, the buffer is flushed when the max size has been reached, by default oldest entries are discarded - */ - public function __construct(HandlerInterface $handler, int $bufferLimit = 0, $level = Logger::DEBUG, bool $bubble = true, bool $flushOnOverflow = false) - { - parent::__construct($level, $bubble); - $this->handler = $handler; - $this->bufferLimit = $bufferLimit; - $this->flushOnOverflow = $flushOnOverflow; - } - - /** - * {@inheritDoc} - */ - public function handle(array $record): bool - { - if ($record['level'] < $this->level) { - return false; - } - - if (!$this->initialized) { - // __destructor() doesn't get called on Fatal errors - register_shutdown_function([$this, 'close']); - $this->initialized = true; - } - - if ($this->bufferLimit > 0 && $this->bufferSize === $this->bufferLimit) { - if ($this->flushOnOverflow) { - $this->flush(); - } else { - array_shift($this->buffer); - $this->bufferSize--; - } - } - - if ($this->processors) { - /** @var Record $record */ - $record = $this->processRecord($record); - } - - $this->buffer[] = $record; - $this->bufferSize++; - - return false === $this->bubble; - } - - public function flush(): void - { - if ($this->bufferSize === 0) { - return; - } - - $this->handler->handleBatch($this->buffer); - $this->clear(); - } - - public function __destruct() - { - // suppress the parent behavior since we already have register_shutdown_function() - // to call close(), and the reference contained there will prevent this from being - // GC'd until the end of the request - } - - /** - * {@inheritDoc} - */ - public function close(): void - { - $this->flush(); - - $this->handler->close(); - } - - /** - * Clears the buffer without flushing any messages down to the wrapped handler. - */ - public function clear(): void - { - $this->bufferSize = 0; - $this->buffer = []; - } - - public function reset() - { - $this->flush(); - - parent::reset(); - - $this->resetProcessors(); - - if ($this->handler instanceof ResettableInterface) { - $this->handler->reset(); - } - } - - /** - * {@inheritDoc} - */ - public function setFormatter(FormatterInterface $formatter): HandlerInterface - { - if ($this->handler instanceof FormattableHandlerInterface) { - $this->handler->setFormatter($formatter); - - return $this; - } - - throw new \UnexpectedValueException('The nested handler of type '.get_class($this->handler).' does not support formatters.'); - } - - /** - * {@inheritDoc} - */ - public function getFormatter(): FormatterInterface - { - if ($this->handler instanceof FormattableHandlerInterface) { - return $this->handler->getFormatter(); - } - - throw new \UnexpectedValueException('The nested handler of type '.get_class($this->handler).' does not support formatters.'); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php deleted file mode 100644 index 234ecf61..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php +++ /dev/null @@ -1,196 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\ChromePHPFormatter; -use Monolog\Formatter\FormatterInterface; -use Monolog\Logger; -use Monolog\Utils; - -/** - * Handler sending logs to the ChromePHP extension (http://www.chromephp.com/) - * - * This also works out of the box with Firefox 43+ - * - * @author Christophe Coevoet <stof@notk.org> - * - * @phpstan-import-type Record from \Monolog\Logger - */ -class ChromePHPHandler extends AbstractProcessingHandler -{ - use WebRequestRecognizerTrait; - - /** - * Version of the extension - */ - protected const VERSION = '4.0'; - - /** - * Header name - */ - protected const HEADER_NAME = 'X-ChromeLogger-Data'; - - /** - * Regular expression to detect supported browsers (matches any Chrome, or Firefox 43+) - */ - protected const USER_AGENT_REGEX = '{\b(?:Chrome/\d+(?:\.\d+)*|HeadlessChrome|Firefox/(?:4[3-9]|[5-9]\d|\d{3,})(?:\.\d)*)\b}'; - - /** @var bool */ - protected static $initialized = false; - - /** - * Tracks whether we sent too much data - * - * Chrome limits the headers to 4KB, so when we sent 3KB we stop sending - * - * @var bool - */ - protected static $overflowed = false; - - /** @var mixed[] */ - protected static $json = [ - 'version' => self::VERSION, - 'columns' => ['label', 'log', 'backtrace', 'type'], - 'rows' => [], - ]; - - /** @var bool */ - protected static $sendHeaders = true; - - public function __construct($level = Logger::DEBUG, bool $bubble = true) - { - parent::__construct($level, $bubble); - if (!function_exists('json_encode')) { - throw new \RuntimeException('PHP\'s json extension is required to use Monolog\'s ChromePHPHandler'); - } - } - - /** - * {@inheritDoc} - */ - public function handleBatch(array $records): void - { - if (!$this->isWebRequest()) { - return; - } - - $messages = []; - - foreach ($records as $record) { - if ($record['level'] < $this->level) { - continue; - } - /** @var Record $message */ - $message = $this->processRecord($record); - $messages[] = $message; - } - - if (!empty($messages)) { - $messages = $this->getFormatter()->formatBatch($messages); - self::$json['rows'] = array_merge(self::$json['rows'], $messages); - $this->send(); - } - } - - /** - * {@inheritDoc} - */ - protected function getDefaultFormatter(): FormatterInterface - { - return new ChromePHPFormatter(); - } - - /** - * Creates & sends header for a record - * - * @see sendHeader() - * @see send() - */ - protected function write(array $record): void - { - if (!$this->isWebRequest()) { - return; - } - - self::$json['rows'][] = $record['formatted']; - - $this->send(); - } - - /** - * Sends the log header - * - * @see sendHeader() - */ - protected function send(): void - { - if (self::$overflowed || !self::$sendHeaders) { - return; - } - - if (!self::$initialized) { - self::$initialized = true; - - self::$sendHeaders = $this->headersAccepted(); - if (!self::$sendHeaders) { - return; - } - - self::$json['request_uri'] = $_SERVER['REQUEST_URI'] ?? ''; - } - - $json = Utils::jsonEncode(self::$json, Utils::DEFAULT_JSON_FLAGS & ~JSON_UNESCAPED_UNICODE, true); - $data = base64_encode($json); - if (strlen($data) > 3 * 1024) { - self::$overflowed = true; - - $record = [ - 'message' => 'Incomplete logs, chrome header size limit reached', - 'context' => [], - 'level' => Logger::WARNING, - 'level_name' => Logger::getLevelName(Logger::WARNING), - 'channel' => 'monolog', - 'datetime' => new \DateTimeImmutable(), - 'extra' => [], - ]; - self::$json['rows'][count(self::$json['rows']) - 1] = $this->getFormatter()->format($record); - $json = Utils::jsonEncode(self::$json, Utils::DEFAULT_JSON_FLAGS & ~JSON_UNESCAPED_UNICODE, true); - $data = base64_encode($json); - } - - if (trim($data) !== '') { - $this->sendHeader(static::HEADER_NAME, $data); - } - } - - /** - * Send header string to the client - */ - protected function sendHeader(string $header, string $content): void - { - if (!headers_sent() && self::$sendHeaders) { - header(sprintf('%s: %s', $header, $content)); - } - } - - /** - * Verifies if the headers are accepted by the current user agent - */ - protected function headersAccepted(): bool - { - if (empty($_SERVER['HTTP_USER_AGENT'])) { - return false; - } - - return preg_match(static::USER_AGENT_REGEX, $_SERVER['HTTP_USER_AGENT']) === 1; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/CouchDBHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/CouchDBHandler.php deleted file mode 100644 index 52657613..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/CouchDBHandler.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\FormatterInterface; -use Monolog\Formatter\JsonFormatter; -use Monolog\Logger; - -/** - * CouchDB handler - * - * @author Markus Bachmann <markus.bachmann@bachi.biz> - */ -class CouchDBHandler extends AbstractProcessingHandler -{ - /** @var mixed[] */ - private $options; - - /** - * @param mixed[] $options - */ - public function __construct(array $options = [], $level = Logger::DEBUG, bool $bubble = true) - { - $this->options = array_merge([ - 'host' => 'localhost', - 'port' => 5984, - 'dbname' => 'logger', - 'username' => null, - 'password' => null, - ], $options); - - parent::__construct($level, $bubble); - } - - /** - * {@inheritDoc} - */ - protected function write(array $record): void - { - $basicAuth = null; - if ($this->options['username']) { - $basicAuth = sprintf('%s:%s@', $this->options['username'], $this->options['password']); - } - - $url = 'http://'.$basicAuth.$this->options['host'].':'.$this->options['port'].'/'.$this->options['dbname']; - $context = stream_context_create([ - 'http' => [ - 'method' => 'POST', - 'content' => $record['formatted'], - 'ignore_errors' => true, - 'max_redirects' => 0, - 'header' => 'Content-type: application/json', - ], - ]); - - if (false === @file_get_contents($url, false, $context)) { - throw new \RuntimeException(sprintf('Could not connect to %s', $url)); - } - } - - /** - * {@inheritDoc} - */ - protected function getDefaultFormatter(): FormatterInterface - { - return new JsonFormatter(JsonFormatter::BATCH_MODE_JSON, false); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/CubeHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/CubeHandler.php deleted file mode 100644 index 3535a4fc..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/CubeHandler.php +++ /dev/null @@ -1,167 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Utils; - -/** - * Logs to Cube. - * - * @link https://github.com/square/cube/wiki - * @author Wan Chen <kami@kamisama.me> - * @deprecated Since 2.8.0 and 3.2.0, Cube appears abandoned and thus we will drop this handler in Monolog 4 - */ -class CubeHandler extends AbstractProcessingHandler -{ - /** @var resource|\Socket|null */ - private $udpConnection = null; - /** @var resource|\CurlHandle|null */ - private $httpConnection = null; - /** @var string */ - private $scheme; - /** @var string */ - private $host; - /** @var int */ - private $port; - /** @var string[] */ - private $acceptedSchemes = ['http', 'udp']; - - /** - * Create a Cube handler - * - * @throws \UnexpectedValueException when given url is not a valid url. - * A valid url must consist of three parts : protocol://host:port - * Only valid protocols used by Cube are http and udp - */ - public function __construct(string $url, $level = Logger::DEBUG, bool $bubble = true) - { - $urlInfo = parse_url($url); - - if ($urlInfo === false || !isset($urlInfo['scheme'], $urlInfo['host'], $urlInfo['port'])) { - throw new \UnexpectedValueException('URL "'.$url.'" is not valid'); - } - - if (!in_array($urlInfo['scheme'], $this->acceptedSchemes)) { - throw new \UnexpectedValueException( - 'Invalid protocol (' . $urlInfo['scheme'] . ').' - . ' Valid options are ' . implode(', ', $this->acceptedSchemes) - ); - } - - $this->scheme = $urlInfo['scheme']; - $this->host = $urlInfo['host']; - $this->port = (int) $urlInfo['port']; - - parent::__construct($level, $bubble); - } - - /** - * Establish a connection to an UDP socket - * - * @throws \LogicException when unable to connect to the socket - * @throws MissingExtensionException when there is no socket extension - */ - protected function connectUdp(): void - { - if (!extension_loaded('sockets')) { - throw new MissingExtensionException('The sockets extension is required to use udp URLs with the CubeHandler'); - } - - $udpConnection = socket_create(AF_INET, SOCK_DGRAM, 0); - if (false === $udpConnection) { - throw new \LogicException('Unable to create a socket'); - } - - $this->udpConnection = $udpConnection; - if (!socket_connect($this->udpConnection, $this->host, $this->port)) { - throw new \LogicException('Unable to connect to the socket at ' . $this->host . ':' . $this->port); - } - } - - /** - * Establish a connection to an http server - * - * @throws \LogicException when unable to connect to the socket - * @throws MissingExtensionException when no curl extension - */ - protected function connectHttp(): void - { - if (!extension_loaded('curl')) { - throw new MissingExtensionException('The curl extension is required to use http URLs with the CubeHandler'); - } - - $httpConnection = curl_init('http://'.$this->host.':'.$this->port.'/1.0/event/put'); - if (false === $httpConnection) { - throw new \LogicException('Unable to connect to ' . $this->host . ':' . $this->port); - } - - $this->httpConnection = $httpConnection; - curl_setopt($this->httpConnection, CURLOPT_CUSTOMREQUEST, "POST"); - curl_setopt($this->httpConnection, CURLOPT_RETURNTRANSFER, true); - } - - /** - * {@inheritDoc} - */ - protected function write(array $record): void - { - $date = $record['datetime']; - - $data = ['time' => $date->format('Y-m-d\TH:i:s.uO')]; - unset($record['datetime']); - - if (isset($record['context']['type'])) { - $data['type'] = $record['context']['type']; - unset($record['context']['type']); - } else { - $data['type'] = $record['channel']; - } - - $data['data'] = $record['context']; - $data['data']['level'] = $record['level']; - - if ($this->scheme === 'http') { - $this->writeHttp(Utils::jsonEncode($data)); - } else { - $this->writeUdp(Utils::jsonEncode($data)); - } - } - - private function writeUdp(string $data): void - { - if (!$this->udpConnection) { - $this->connectUdp(); - } - - socket_send($this->udpConnection, $data, strlen($data), 0); - } - - private function writeHttp(string $data): void - { - if (!$this->httpConnection) { - $this->connectHttp(); - } - - if (null === $this->httpConnection) { - throw new \LogicException('No connection could be established'); - } - - curl_setopt($this->httpConnection, CURLOPT_POSTFIELDS, '['.$data.']'); - curl_setopt($this->httpConnection, CURLOPT_HTTPHEADER, [ - 'Content-Type: application/json', - 'Content-Length: ' . strlen('['.$data.']'), - ]); - - Curl\Util::execute($this->httpConnection, 5, false); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/Curl/Util.php b/vendor/monolog/monolog/src/Monolog/Handler/Curl/Util.php deleted file mode 100644 index 7213e8ee..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/Curl/Util.php +++ /dev/null @@ -1,71 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler\Curl; - -use CurlHandle; - -/** - * This class is marked as internal and it is not under the BC promise of the package. - * - * @internal - */ -final class Util -{ - /** @var array<int> */ - private static $retriableErrorCodes = [ - CURLE_COULDNT_RESOLVE_HOST, - CURLE_COULDNT_CONNECT, - CURLE_HTTP_NOT_FOUND, - CURLE_READ_ERROR, - CURLE_OPERATION_TIMEOUTED, - CURLE_HTTP_POST_ERROR, - CURLE_SSL_CONNECT_ERROR, - ]; - - /** - * Executes a CURL request with optional retries and exception on failure - * - * @param resource|CurlHandle $ch curl handler - * @param int $retries - * @param bool $closeAfterDone - * @return bool|string @see curl_exec - */ - public static function execute($ch, int $retries = 5, bool $closeAfterDone = true) - { - while ($retries--) { - $curlResponse = curl_exec($ch); - if ($curlResponse === false) { - $curlErrno = curl_errno($ch); - - if (false === in_array($curlErrno, self::$retriableErrorCodes, true) || !$retries) { - $curlError = curl_error($ch); - - if ($closeAfterDone) { - curl_close($ch); - } - - throw new \RuntimeException(sprintf('Curl error (code %d): %s', $curlErrno, $curlError)); - } - - continue; - } - - if ($closeAfterDone) { - curl_close($ch); - } - - return $curlResponse; - } - - return false; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/DeduplicationHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/DeduplicationHandler.php deleted file mode 100644 index 9b85ae7e..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/DeduplicationHandler.php +++ /dev/null @@ -1,186 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Psr\Log\LogLevel; - -/** - * Simple handler wrapper that deduplicates log records across multiple requests - * - * It also includes the BufferHandler functionality and will buffer - * all messages until the end of the request or flush() is called. - * - * This works by storing all log records' messages above $deduplicationLevel - * to the file specified by $deduplicationStore. When further logs come in at the end of the - * request (or when flush() is called), all those above $deduplicationLevel are checked - * against the existing stored logs. If they match and the timestamps in the stored log is - * not older than $time seconds, the new log record is discarded. If no log record is new, the - * whole data set is discarded. - * - * This is mainly useful in combination with Mail handlers or things like Slack or HipChat handlers - * that send messages to people, to avoid spamming with the same message over and over in case of - * a major component failure like a database server being down which makes all requests fail in the - * same way. - * - * @author Jordi Boggiano <j.boggiano@seld.be> - * - * @phpstan-import-type Record from \Monolog\Logger - * @phpstan-import-type LevelName from \Monolog\Logger - * @phpstan-import-type Level from \Monolog\Logger - */ -class DeduplicationHandler extends BufferHandler -{ - /** - * @var string - */ - protected $deduplicationStore; - - /** - * @var Level - */ - protected $deduplicationLevel; - - /** - * @var int - */ - protected $time; - - /** - * @var bool - */ - private $gc = false; - - /** - * @param HandlerInterface $handler Handler. - * @param string $deduplicationStore The file/path where the deduplication log should be kept - * @param string|int $deduplicationLevel The minimum logging level for log records to be looked at for deduplication purposes - * @param int $time The period (in seconds) during which duplicate entries should be suppressed after a given log is sent through - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - * - * @phpstan-param Level|LevelName|LogLevel::* $deduplicationLevel - */ - public function __construct(HandlerInterface $handler, ?string $deduplicationStore = null, $deduplicationLevel = Logger::ERROR, int $time = 60, bool $bubble = true) - { - parent::__construct($handler, 0, Logger::DEBUG, $bubble, false); - - $this->deduplicationStore = $deduplicationStore === null ? sys_get_temp_dir() . '/monolog-dedup-' . substr(md5(__FILE__), 0, 20) .'.log' : $deduplicationStore; - $this->deduplicationLevel = Logger::toMonologLevel($deduplicationLevel); - $this->time = $time; - } - - public function flush(): void - { - if ($this->bufferSize === 0) { - return; - } - - $passthru = null; - - foreach ($this->buffer as $record) { - if ($record['level'] >= $this->deduplicationLevel) { - $passthru = $passthru || !$this->isDuplicate($record); - if ($passthru) { - $this->appendRecord($record); - } - } - } - - // default of null is valid as well as if no record matches duplicationLevel we just pass through - if ($passthru === true || $passthru === null) { - $this->handler->handleBatch($this->buffer); - } - - $this->clear(); - - if ($this->gc) { - $this->collectLogs(); - } - } - - /** - * @phpstan-param Record $record - */ - private function isDuplicate(array $record): bool - { - if (!file_exists($this->deduplicationStore)) { - return false; - } - - $store = file($this->deduplicationStore, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); - if (!is_array($store)) { - return false; - } - - $yesterday = time() - 86400; - $timestampValidity = $record['datetime']->getTimestamp() - $this->time; - $expectedMessage = preg_replace('{[\r\n].*}', '', $record['message']); - - for ($i = count($store) - 1; $i >= 0; $i--) { - list($timestamp, $level, $message) = explode(':', $store[$i], 3); - - if ($level === $record['level_name'] && $message === $expectedMessage && $timestamp > $timestampValidity) { - return true; - } - - if ($timestamp < $yesterday) { - $this->gc = true; - } - } - - return false; - } - - private function collectLogs(): void - { - if (!file_exists($this->deduplicationStore)) { - return; - } - - $handle = fopen($this->deduplicationStore, 'rw+'); - - if (!$handle) { - throw new \RuntimeException('Failed to open file for reading and writing: ' . $this->deduplicationStore); - } - - flock($handle, LOCK_EX); - $validLogs = []; - - $timestampValidity = time() - $this->time; - - while (!feof($handle)) { - $log = fgets($handle); - if ($log && substr($log, 0, 10) >= $timestampValidity) { - $validLogs[] = $log; - } - } - - ftruncate($handle, 0); - rewind($handle); - foreach ($validLogs as $log) { - fwrite($handle, $log); - } - - flock($handle, LOCK_UN); - fclose($handle); - - $this->gc = false; - } - - /** - * @phpstan-param Record $record - */ - private function appendRecord(array $record): void - { - file_put_contents($this->deduplicationStore, $record['datetime']->getTimestamp() . ':' . $record['level_name'] . ':' . preg_replace('{[\r\n].*}', '', $record['message']) . "\n", FILE_APPEND); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/DoctrineCouchDBHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/DoctrineCouchDBHandler.php deleted file mode 100644 index ebd52c3a..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/DoctrineCouchDBHandler.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Formatter\NormalizerFormatter; -use Monolog\Formatter\FormatterInterface; -use Doctrine\CouchDB\CouchDBClient; - -/** - * CouchDB handler for Doctrine CouchDB ODM - * - * @author Markus Bachmann <markus.bachmann@bachi.biz> - */ -class DoctrineCouchDBHandler extends AbstractProcessingHandler -{ - /** @var CouchDBClient */ - private $client; - - public function __construct(CouchDBClient $client, $level = Logger::DEBUG, bool $bubble = true) - { - $this->client = $client; - parent::__construct($level, $bubble); - } - - /** - * {@inheritDoc} - */ - protected function write(array $record): void - { - $this->client->postDocument($record['formatted']); - } - - protected function getDefaultFormatter(): FormatterInterface - { - return new NormalizerFormatter; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php deleted file mode 100644 index 21840bf6..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php +++ /dev/null @@ -1,104 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Aws\Sdk; -use Aws\DynamoDb\DynamoDbClient; -use Monolog\Formatter\FormatterInterface; -use Aws\DynamoDb\Marshaler; -use Monolog\Formatter\ScalarFormatter; -use Monolog\Logger; - -/** - * Amazon DynamoDB handler (http://aws.amazon.com/dynamodb/) - * - * @link https://github.com/aws/aws-sdk-php/ - * @author Andrew Lawson <adlawson@gmail.com> - */ -class DynamoDbHandler extends AbstractProcessingHandler -{ - public const DATE_FORMAT = 'Y-m-d\TH:i:s.uO'; - - /** - * @var DynamoDbClient - */ - protected $client; - - /** - * @var string - */ - protected $table; - - /** - * @var int - */ - protected $version; - - /** - * @var Marshaler - */ - protected $marshaler; - - public function __construct(DynamoDbClient $client, string $table, $level = Logger::DEBUG, bool $bubble = true) - { - /** @phpstan-ignore-next-line */ - if (defined('Aws\Sdk::VERSION') && version_compare(Sdk::VERSION, '3.0', '>=')) { - $this->version = 3; - $this->marshaler = new Marshaler; - } else { - $this->version = 2; - } - - $this->client = $client; - $this->table = $table; - - parent::__construct($level, $bubble); - } - - /** - * {@inheritDoc} - */ - protected function write(array $record): void - { - $filtered = $this->filterEmptyFields($record['formatted']); - if ($this->version === 3) { - $formatted = $this->marshaler->marshalItem($filtered); - } else { - /** @phpstan-ignore-next-line */ - $formatted = $this->client->formatAttributes($filtered); - } - - $this->client->putItem([ - 'TableName' => $this->table, - 'Item' => $formatted, - ]); - } - - /** - * @param mixed[] $record - * @return mixed[] - */ - protected function filterEmptyFields(array $record): array - { - return array_filter($record, function ($value) { - return !empty($value) || false === $value || 0 === $value; - }); - } - - /** - * {@inheritDoc} - */ - protected function getDefaultFormatter(): FormatterInterface - { - return new ScalarFormatter(self::DATE_FORMAT); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/ElasticaHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/ElasticaHandler.php deleted file mode 100644 index fc92ca42..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/ElasticaHandler.php +++ /dev/null @@ -1,129 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Elastica\Document; -use Monolog\Formatter\FormatterInterface; -use Monolog\Formatter\ElasticaFormatter; -use Monolog\Logger; -use Elastica\Client; -use Elastica\Exception\ExceptionInterface; - -/** - * Elastic Search handler - * - * Usage example: - * - * $client = new \Elastica\Client(); - * $options = array( - * 'index' => 'elastic_index_name', - * 'type' => 'elastic_doc_type', Types have been removed in Elastica 7 - * ); - * $handler = new ElasticaHandler($client, $options); - * $log = new Logger('application'); - * $log->pushHandler($handler); - * - * @author Jelle Vink <jelle.vink@gmail.com> - */ -class ElasticaHandler extends AbstractProcessingHandler -{ - /** - * @var Client - */ - protected $client; - - /** - * @var mixed[] Handler config options - */ - protected $options = []; - - /** - * @param Client $client Elastica Client object - * @param mixed[] $options Handler configuration - */ - public function __construct(Client $client, array $options = [], $level = Logger::DEBUG, bool $bubble = true) - { - parent::__construct($level, $bubble); - $this->client = $client; - $this->options = array_merge( - [ - 'index' => 'monolog', // Elastic index name - 'type' => 'record', // Elastic document type - 'ignore_error' => false, // Suppress Elastica exceptions - ], - $options - ); - } - - /** - * {@inheritDoc} - */ - protected function write(array $record): void - { - $this->bulkSend([$record['formatted']]); - } - - /** - * {@inheritDoc} - */ - public function setFormatter(FormatterInterface $formatter): HandlerInterface - { - if ($formatter instanceof ElasticaFormatter) { - return parent::setFormatter($formatter); - } - - throw new \InvalidArgumentException('ElasticaHandler is only compatible with ElasticaFormatter'); - } - - /** - * @return mixed[] - */ - public function getOptions(): array - { - return $this->options; - } - - /** - * {@inheritDoc} - */ - protected function getDefaultFormatter(): FormatterInterface - { - return new ElasticaFormatter($this->options['index'], $this->options['type']); - } - - /** - * {@inheritDoc} - */ - public function handleBatch(array $records): void - { - $documents = $this->getFormatter()->formatBatch($records); - $this->bulkSend($documents); - } - - /** - * Use Elasticsearch bulk API to send list of documents - * - * @param Document[] $documents - * - * @throws \RuntimeException - */ - protected function bulkSend(array $documents): void - { - try { - $this->client->addDocuments($documents); - } catch (ExceptionInterface $e) { - if (!$this->options['ignore_error']) { - throw new \RuntimeException("Error sending messages to Elasticsearch", 0, $e); - } - } - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/ElasticsearchHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/ElasticsearchHandler.php deleted file mode 100644 index e88375c0..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/ElasticsearchHandler.php +++ /dev/null @@ -1,218 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Elastic\Elasticsearch\Response\Elasticsearch; -use Throwable; -use RuntimeException; -use Monolog\Logger; -use Monolog\Formatter\FormatterInterface; -use Monolog\Formatter\ElasticsearchFormatter; -use InvalidArgumentException; -use Elasticsearch\Common\Exceptions\RuntimeException as ElasticsearchRuntimeException; -use Elasticsearch\Client; -use Elastic\Elasticsearch\Exception\InvalidArgumentException as ElasticInvalidArgumentException; -use Elastic\Elasticsearch\Client as Client8; - -/** - * Elasticsearch handler - * - * @link https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/index.html - * - * Simple usage example: - * - * $client = \Elasticsearch\ClientBuilder::create() - * ->setHosts($hosts) - * ->build(); - * - * $options = array( - * 'index' => 'elastic_index_name', - * 'type' => 'elastic_doc_type', - * ); - * $handler = new ElasticsearchHandler($client, $options); - * $log = new Logger('application'); - * $log->pushHandler($handler); - * - * @author Avtandil Kikabidze <akalongman@gmail.com> - */ -class ElasticsearchHandler extends AbstractProcessingHandler -{ - /** - * @var Client|Client8 - */ - protected $client; - - /** - * @var mixed[] Handler config options - */ - protected $options = []; - - /** - * @var bool - */ - private $needsType; - - /** - * @param Client|Client8 $client Elasticsearch Client object - * @param mixed[] $options Handler configuration - */ - public function __construct($client, array $options = [], $level = Logger::DEBUG, bool $bubble = true) - { - if (!$client instanceof Client && !$client instanceof Client8) { - throw new \TypeError('Elasticsearch\Client or Elastic\Elasticsearch\Client instance required'); - } - - parent::__construct($level, $bubble); - $this->client = $client; - $this->options = array_merge( - [ - 'index' => 'monolog', // Elastic index name - 'type' => '_doc', // Elastic document type - 'ignore_error' => false, // Suppress Elasticsearch exceptions - ], - $options - ); - - if ($client instanceof Client8 || $client::VERSION[0] === '7') { - $this->needsType = false; - // force the type to _doc for ES8/ES7 - $this->options['type'] = '_doc'; - } else { - $this->needsType = true; - } - } - - /** - * {@inheritDoc} - */ - protected function write(array $record): void - { - $this->bulkSend([$record['formatted']]); - } - - /** - * {@inheritDoc} - */ - public function setFormatter(FormatterInterface $formatter): HandlerInterface - { - if ($formatter instanceof ElasticsearchFormatter) { - return parent::setFormatter($formatter); - } - - throw new InvalidArgumentException('ElasticsearchHandler is only compatible with ElasticsearchFormatter'); - } - - /** - * Getter options - * - * @return mixed[] - */ - public function getOptions(): array - { - return $this->options; - } - - /** - * {@inheritDoc} - */ - protected function getDefaultFormatter(): FormatterInterface - { - return new ElasticsearchFormatter($this->options['index'], $this->options['type']); - } - - /** - * {@inheritDoc} - */ - public function handleBatch(array $records): void - { - $documents = $this->getFormatter()->formatBatch($records); - $this->bulkSend($documents); - } - - /** - * Use Elasticsearch bulk API to send list of documents - * - * @param array[] $records Records + _index/_type keys - * @throws \RuntimeException - */ - protected function bulkSend(array $records): void - { - try { - $params = [ - 'body' => [], - ]; - - foreach ($records as $record) { - $params['body'][] = [ - 'index' => $this->needsType ? [ - '_index' => $record['_index'], - '_type' => $record['_type'], - ] : [ - '_index' => $record['_index'], - ], - ]; - unset($record['_index'], $record['_type']); - - $params['body'][] = $record; - } - - /** @var Elasticsearch */ - $responses = $this->client->bulk($params); - - if ($responses['errors'] === true) { - throw $this->createExceptionFromResponses($responses); - } - } catch (Throwable $e) { - if (! $this->options['ignore_error']) { - throw new RuntimeException('Error sending messages to Elasticsearch', 0, $e); - } - } - } - - /** - * Creates elasticsearch exception from responses array - * - * Only the first error is converted into an exception. - * - * @param mixed[]|Elasticsearch $responses returned by $this->client->bulk() - */ - protected function createExceptionFromResponses($responses): Throwable - { - foreach ($responses['items'] ?? [] as $item) { - if (isset($item['index']['error'])) { - return $this->createExceptionFromError($item['index']['error']); - } - } - - if (class_exists(ElasticInvalidArgumentException::class)) { - return new ElasticInvalidArgumentException('Elasticsearch failed to index one or more records.'); - } - - return new ElasticsearchRuntimeException('Elasticsearch failed to index one or more records.'); - } - - /** - * Creates elasticsearch exception from error array - * - * @param mixed[] $error - */ - protected function createExceptionFromError(array $error): Throwable - { - $previous = isset($error['caused_by']) ? $this->createExceptionFromError($error['caused_by']) : null; - - if (class_exists(ElasticInvalidArgumentException::class)) { - return new ElasticInvalidArgumentException($error['type'] . ': ' . $error['reason'], 0, $previous); - } - - return new ElasticsearchRuntimeException($error['type'] . ': ' . $error['reason'], 0, $previous); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php deleted file mode 100644 index f2e22036..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php +++ /dev/null @@ -1,91 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\LineFormatter; -use Monolog\Formatter\FormatterInterface; -use Monolog\Logger; -use Monolog\Utils; - -/** - * Stores to PHP error_log() handler. - * - * @author Elan Ruusamäe <glen@delfi.ee> - */ -class ErrorLogHandler extends AbstractProcessingHandler -{ - public const OPERATING_SYSTEM = 0; - public const SAPI = 4; - - /** @var int */ - protected $messageType; - /** @var bool */ - protected $expandNewlines; - - /** - * @param int $messageType Says where the error should go. - * @param bool $expandNewlines If set to true, newlines in the message will be expanded to be take multiple log entries - */ - public function __construct(int $messageType = self::OPERATING_SYSTEM, $level = Logger::DEBUG, bool $bubble = true, bool $expandNewlines = false) - { - parent::__construct($level, $bubble); - - if (false === in_array($messageType, self::getAvailableTypes(), true)) { - $message = sprintf('The given message type "%s" is not supported', print_r($messageType, true)); - - throw new \InvalidArgumentException($message); - } - - $this->messageType = $messageType; - $this->expandNewlines = $expandNewlines; - } - - /** - * @return int[] With all available types - */ - public static function getAvailableTypes(): array - { - return [ - self::OPERATING_SYSTEM, - self::SAPI, - ]; - } - - /** - * {@inheritDoc} - */ - protected function getDefaultFormatter(): FormatterInterface - { - return new LineFormatter('[%datetime%] %channel%.%level_name%: %message% %context% %extra%'); - } - - /** - * {@inheritDoc} - */ - protected function write(array $record): void - { - if (!$this->expandNewlines) { - error_log((string) $record['formatted'], $this->messageType); - - return; - } - - $lines = preg_split('{[\r\n]+}', (string) $record['formatted']); - if ($lines === false) { - $pcreErrorCode = preg_last_error(); - throw new \RuntimeException('Failed to preg_split formatted string: ' . $pcreErrorCode . ' / '. Utils::pcreLastErrorMessage($pcreErrorCode)); - } - foreach ($lines as $line) { - error_log($line, $this->messageType); - } - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/FallbackGroupHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/FallbackGroupHandler.php deleted file mode 100644 index d4e234ce..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/FallbackGroupHandler.php +++ /dev/null @@ -1,71 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Throwable; - -/** - * Forwards records to at most one handler - * - * If a handler fails, the exception is suppressed and the record is forwarded to the next handler. - * - * As soon as one handler handles a record successfully, the handling stops there. - * - * @phpstan-import-type Record from \Monolog\Logger - */ -class FallbackGroupHandler extends GroupHandler -{ - /** - * {@inheritDoc} - */ - public function handle(array $record): bool - { - if ($this->processors) { - /** @var Record $record */ - $record = $this->processRecord($record); - } - foreach ($this->handlers as $handler) { - try { - $handler->handle($record); - break; - } catch (Throwable $e) { - // What throwable? - } - } - - return false === $this->bubble; - } - - /** - * {@inheritDoc} - */ - public function handleBatch(array $records): void - { - if ($this->processors) { - $processed = []; - foreach ($records as $record) { - $processed[] = $this->processRecord($record); - } - /** @var Record[] $records */ - $records = $processed; - } - - foreach ($this->handlers as $handler) { - try { - $handler->handleBatch($records); - break; - } catch (Throwable $e) { - // What throwable? - } - } - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php deleted file mode 100644 index 718f17ef..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php +++ /dev/null @@ -1,212 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\ResettableInterface; -use Monolog\Formatter\FormatterInterface; -use Psr\Log\LogLevel; - -/** - * Simple handler wrapper that filters records based on a list of levels - * - * It can be configured with an exact list of levels to allow, or a min/max level. - * - * @author Hennadiy Verkh - * @author Jordi Boggiano <j.boggiano@seld.be> - * - * @phpstan-import-type Record from \Monolog\Logger - * @phpstan-import-type Level from \Monolog\Logger - * @phpstan-import-type LevelName from \Monolog\Logger - */ -class FilterHandler extends Handler implements ProcessableHandlerInterface, ResettableInterface, FormattableHandlerInterface -{ - use ProcessableHandlerTrait; - - /** - * Handler or factory callable($record, $this) - * - * @var callable|HandlerInterface - * @phpstan-var callable(?Record, HandlerInterface): HandlerInterface|HandlerInterface - */ - protected $handler; - - /** - * Minimum level for logs that are passed to handler - * - * @var int[] - * @phpstan-var array<Level, int> - */ - protected $acceptedLevels; - - /** - * Whether the messages that are handled can bubble up the stack or not - * - * @var bool - */ - protected $bubble; - - /** - * @psalm-param HandlerInterface|callable(?Record, HandlerInterface): HandlerInterface $handler - * - * @param callable|HandlerInterface $handler Handler or factory callable($record|null, $filterHandler). - * @param int|array $minLevelOrList A list of levels to accept or a minimum level if maxLevel is provided - * @param int|string $maxLevel Maximum level to accept, only used if $minLevelOrList is not an array - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - * - * @phpstan-param Level|LevelName|LogLevel::*|array<Level|LevelName|LogLevel::*> $minLevelOrList - * @phpstan-param Level|LevelName|LogLevel::* $maxLevel - */ - public function __construct($handler, $minLevelOrList = Logger::DEBUG, $maxLevel = Logger::EMERGENCY, bool $bubble = true) - { - $this->handler = $handler; - $this->bubble = $bubble; - $this->setAcceptedLevels($minLevelOrList, $maxLevel); - - if (!$this->handler instanceof HandlerInterface && !is_callable($this->handler)) { - throw new \RuntimeException("The given handler (".json_encode($this->handler).") is not a callable nor a Monolog\Handler\HandlerInterface object"); - } - } - - /** - * @phpstan-return array<int, Level> - */ - public function getAcceptedLevels(): array - { - return array_flip($this->acceptedLevels); - } - - /** - * @param int|string|array $minLevelOrList A list of levels to accept or a minimum level or level name if maxLevel is provided - * @param int|string $maxLevel Maximum level or level name to accept, only used if $minLevelOrList is not an array - * - * @phpstan-param Level|LevelName|LogLevel::*|array<Level|LevelName|LogLevel::*> $minLevelOrList - * @phpstan-param Level|LevelName|LogLevel::* $maxLevel - */ - public function setAcceptedLevels($minLevelOrList = Logger::DEBUG, $maxLevel = Logger::EMERGENCY): self - { - if (is_array($minLevelOrList)) { - $acceptedLevels = array_map('Monolog\Logger::toMonologLevel', $minLevelOrList); - } else { - $minLevelOrList = Logger::toMonologLevel($minLevelOrList); - $maxLevel = Logger::toMonologLevel($maxLevel); - $acceptedLevels = array_values(array_filter(Logger::getLevels(), function ($level) use ($minLevelOrList, $maxLevel) { - return $level >= $minLevelOrList && $level <= $maxLevel; - })); - } - $this->acceptedLevels = array_flip($acceptedLevels); - - return $this; - } - - /** - * {@inheritDoc} - */ - public function isHandling(array $record): bool - { - return isset($this->acceptedLevels[$record['level']]); - } - - /** - * {@inheritDoc} - */ - public function handle(array $record): bool - { - if (!$this->isHandling($record)) { - return false; - } - - if ($this->processors) { - /** @var Record $record */ - $record = $this->processRecord($record); - } - - $this->getHandler($record)->handle($record); - - return false === $this->bubble; - } - - /** - * {@inheritDoc} - */ - public function handleBatch(array $records): void - { - $filtered = []; - foreach ($records as $record) { - if ($this->isHandling($record)) { - $filtered[] = $record; - } - } - - if (count($filtered) > 0) { - $this->getHandler($filtered[count($filtered) - 1])->handleBatch($filtered); - } - } - - /** - * Return the nested handler - * - * If the handler was provided as a factory callable, this will trigger the handler's instantiation. - * - * @return HandlerInterface - * - * @phpstan-param Record $record - */ - public function getHandler(array $record = null) - { - if (!$this->handler instanceof HandlerInterface) { - $this->handler = ($this->handler)($record, $this); - if (!$this->handler instanceof HandlerInterface) { - throw new \RuntimeException("The factory callable should return a HandlerInterface"); - } - } - - return $this->handler; - } - - /** - * {@inheritDoc} - */ - public function setFormatter(FormatterInterface $formatter): HandlerInterface - { - $handler = $this->getHandler(); - if ($handler instanceof FormattableHandlerInterface) { - $handler->setFormatter($formatter); - - return $this; - } - - throw new \UnexpectedValueException('The nested handler of type '.get_class($handler).' does not support formatters.'); - } - - /** - * {@inheritDoc} - */ - public function getFormatter(): FormatterInterface - { - $handler = $this->getHandler(); - if ($handler instanceof FormattableHandlerInterface) { - return $handler->getFormatter(); - } - - throw new \UnexpectedValueException('The nested handler of type '.get_class($handler).' does not support formatters.'); - } - - public function reset() - { - $this->resetProcessors(); - - if ($this->getHandler() instanceof ResettableInterface) { - $this->getHandler()->reset(); - } - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php b/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php deleted file mode 100644 index 0aa5607b..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler\FingersCrossed; - -/** - * Interface for activation strategies for the FingersCrossedHandler. - * - * @author Johannes M. Schmitt <schmittjoh@gmail.com> - * - * @phpstan-import-type Record from \Monolog\Logger - */ -interface ActivationStrategyInterface -{ - /** - * Returns whether the given record activates the handler. - * - * @phpstan-param Record $record - */ - public function isHandlerActivated(array $record): bool; -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php b/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php deleted file mode 100644 index 7b9abb58..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler\FingersCrossed; - -use Monolog\Logger; -use Psr\Log\LogLevel; - -/** - * Channel and Error level based monolog activation strategy. Allows to trigger activation - * based on level per channel. e.g. trigger activation on level 'ERROR' by default, except - * for records of the 'sql' channel; those should trigger activation on level 'WARN'. - * - * Example: - * - * <code> - * $activationStrategy = new ChannelLevelActivationStrategy( - * Logger::CRITICAL, - * array( - * 'request' => Logger::ALERT, - * 'sensitive' => Logger::ERROR, - * ) - * ); - * $handler = new FingersCrossedHandler(new StreamHandler('php://stderr'), $activationStrategy); - * </code> - * - * @author Mike Meessen <netmikey@gmail.com> - * - * @phpstan-import-type Record from \Monolog\Logger - * @phpstan-import-type Level from \Monolog\Logger - * @phpstan-import-type LevelName from \Monolog\Logger - */ -class ChannelLevelActivationStrategy implements ActivationStrategyInterface -{ - /** - * @var Level - */ - private $defaultActionLevel; - - /** - * @var array<string, Level> - */ - private $channelToActionLevel; - - /** - * @param int|string $defaultActionLevel The default action level to be used if the record's category doesn't match any - * @param array<string, int> $channelToActionLevel An array that maps channel names to action levels. - * - * @phpstan-param array<string, Level> $channelToActionLevel - * @phpstan-param Level|LevelName|LogLevel::* $defaultActionLevel - */ - public function __construct($defaultActionLevel, array $channelToActionLevel = []) - { - $this->defaultActionLevel = Logger::toMonologLevel($defaultActionLevel); - $this->channelToActionLevel = array_map('Monolog\Logger::toMonologLevel', $channelToActionLevel); - } - - /** - * @phpstan-param Record $record - */ - public function isHandlerActivated(array $record): bool - { - if (isset($this->channelToActionLevel[$record['channel']])) { - return $record['level'] >= $this->channelToActionLevel[$record['channel']]; - } - - return $record['level'] >= $this->defaultActionLevel; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php b/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php deleted file mode 100644 index 5ec88eab..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler\FingersCrossed; - -use Monolog\Logger; -use Psr\Log\LogLevel; - -/** - * Error level based activation strategy. - * - * @author Johannes M. Schmitt <schmittjoh@gmail.com> - * - * @phpstan-import-type Level from \Monolog\Logger - * @phpstan-import-type LevelName from \Monolog\Logger - */ -class ErrorLevelActivationStrategy implements ActivationStrategyInterface -{ - /** - * @var Level - */ - private $actionLevel; - - /** - * @param int|string $actionLevel Level or name or value - * - * @phpstan-param Level|LevelName|LogLevel::* $actionLevel - */ - public function __construct($actionLevel) - { - $this->actionLevel = Logger::toMonologLevel($actionLevel); - } - - public function isHandlerActivated(array $record): bool - { - return $record['level'] >= $this->actionLevel; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php deleted file mode 100644 index 0627b445..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php +++ /dev/null @@ -1,252 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy; -use Monolog\Handler\FingersCrossed\ActivationStrategyInterface; -use Monolog\Logger; -use Monolog\ResettableInterface; -use Monolog\Formatter\FormatterInterface; -use Psr\Log\LogLevel; - -/** - * Buffers all records until a certain level is reached - * - * The advantage of this approach is that you don't get any clutter in your log files. - * Only requests which actually trigger an error (or whatever your actionLevel is) will be - * in the logs, but they will contain all records, not only those above the level threshold. - * - * You can then have a passthruLevel as well which means that at the end of the request, - * even if it did not get activated, it will still send through log records of e.g. at least a - * warning level. - * - * You can find the various activation strategies in the - * Monolog\Handler\FingersCrossed\ namespace. - * - * @author Jordi Boggiano <j.boggiano@seld.be> - * - * @phpstan-import-type Record from \Monolog\Logger - * @phpstan-import-type Level from \Monolog\Logger - * @phpstan-import-type LevelName from \Monolog\Logger - */ -class FingersCrossedHandler extends Handler implements ProcessableHandlerInterface, ResettableInterface, FormattableHandlerInterface -{ - use ProcessableHandlerTrait; - - /** - * @var callable|HandlerInterface - * @phpstan-var callable(?Record, HandlerInterface): HandlerInterface|HandlerInterface - */ - protected $handler; - /** @var ActivationStrategyInterface */ - protected $activationStrategy; - /** @var bool */ - protected $buffering = true; - /** @var int */ - protected $bufferSize; - /** @var Record[] */ - protected $buffer = []; - /** @var bool */ - protected $stopBuffering; - /** - * @var ?int - * @phpstan-var ?Level - */ - protected $passthruLevel; - /** @var bool */ - protected $bubble; - - /** - * @psalm-param HandlerInterface|callable(?Record, HandlerInterface): HandlerInterface $handler - * - * @param callable|HandlerInterface $handler Handler or factory callable($record|null, $fingersCrossedHandler). - * @param int|string|ActivationStrategyInterface $activationStrategy Strategy which determines when this handler takes action, or a level name/value at which the handler is activated - * @param int $bufferSize How many entries should be buffered at most, beyond that the oldest items are removed from the buffer. - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - * @param bool $stopBuffering Whether the handler should stop buffering after being triggered (default true) - * @param int|string $passthruLevel Minimum level to always flush to handler on close, even if strategy not triggered - * - * @phpstan-param Level|LevelName|LogLevel::* $passthruLevel - * @phpstan-param Level|LevelName|LogLevel::*|ActivationStrategyInterface $activationStrategy - */ - public function __construct($handler, $activationStrategy = null, int $bufferSize = 0, bool $bubble = true, bool $stopBuffering = true, $passthruLevel = null) - { - if (null === $activationStrategy) { - $activationStrategy = new ErrorLevelActivationStrategy(Logger::WARNING); - } - - // convert simple int activationStrategy to an object - if (!$activationStrategy instanceof ActivationStrategyInterface) { - $activationStrategy = new ErrorLevelActivationStrategy($activationStrategy); - } - - $this->handler = $handler; - $this->activationStrategy = $activationStrategy; - $this->bufferSize = $bufferSize; - $this->bubble = $bubble; - $this->stopBuffering = $stopBuffering; - - if ($passthruLevel !== null) { - $this->passthruLevel = Logger::toMonologLevel($passthruLevel); - } - - if (!$this->handler instanceof HandlerInterface && !is_callable($this->handler)) { - throw new \RuntimeException("The given handler (".json_encode($this->handler).") is not a callable nor a Monolog\Handler\HandlerInterface object"); - } - } - - /** - * {@inheritDoc} - */ - public function isHandling(array $record): bool - { - return true; - } - - /** - * Manually activate this logger regardless of the activation strategy - */ - public function activate(): void - { - if ($this->stopBuffering) { - $this->buffering = false; - } - - $this->getHandler(end($this->buffer) ?: null)->handleBatch($this->buffer); - $this->buffer = []; - } - - /** - * {@inheritDoc} - */ - public function handle(array $record): bool - { - if ($this->processors) { - /** @var Record $record */ - $record = $this->processRecord($record); - } - - if ($this->buffering) { - $this->buffer[] = $record; - if ($this->bufferSize > 0 && count($this->buffer) > $this->bufferSize) { - array_shift($this->buffer); - } - if ($this->activationStrategy->isHandlerActivated($record)) { - $this->activate(); - } - } else { - $this->getHandler($record)->handle($record); - } - - return false === $this->bubble; - } - - /** - * {@inheritDoc} - */ - public function close(): void - { - $this->flushBuffer(); - - $this->getHandler()->close(); - } - - public function reset() - { - $this->flushBuffer(); - - $this->resetProcessors(); - - if ($this->getHandler() instanceof ResettableInterface) { - $this->getHandler()->reset(); - } - } - - /** - * Clears the buffer without flushing any messages down to the wrapped handler. - * - * It also resets the handler to its initial buffering state. - */ - public function clear(): void - { - $this->buffer = []; - $this->reset(); - } - - /** - * Resets the state of the handler. Stops forwarding records to the wrapped handler. - */ - private function flushBuffer(): void - { - if (null !== $this->passthruLevel) { - $level = $this->passthruLevel; - $this->buffer = array_filter($this->buffer, function ($record) use ($level) { - return $record['level'] >= $level; - }); - if (count($this->buffer) > 0) { - $this->getHandler(end($this->buffer))->handleBatch($this->buffer); - } - } - - $this->buffer = []; - $this->buffering = true; - } - - /** - * Return the nested handler - * - * If the handler was provided as a factory callable, this will trigger the handler's instantiation. - * - * @return HandlerInterface - * - * @phpstan-param Record $record - */ - public function getHandler(array $record = null) - { - if (!$this->handler instanceof HandlerInterface) { - $this->handler = ($this->handler)($record, $this); - if (!$this->handler instanceof HandlerInterface) { - throw new \RuntimeException("The factory callable should return a HandlerInterface"); - } - } - - return $this->handler; - } - - /** - * {@inheritDoc} - */ - public function setFormatter(FormatterInterface $formatter): HandlerInterface - { - $handler = $this->getHandler(); - if ($handler instanceof FormattableHandlerInterface) { - $handler->setFormatter($formatter); - - return $this; - } - - throw new \UnexpectedValueException('The nested handler of type '.get_class($handler).' does not support formatters.'); - } - - /** - * {@inheritDoc} - */ - public function getFormatter(): FormatterInterface - { - $handler = $this->getHandler(); - if ($handler instanceof FormattableHandlerInterface) { - return $handler->getFormatter(); - } - - throw new \UnexpectedValueException('The nested handler of type '.get_class($handler).' does not support formatters.'); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php deleted file mode 100644 index 72718de6..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php +++ /dev/null @@ -1,180 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\WildfireFormatter; -use Monolog\Formatter\FormatterInterface; - -/** - * Simple FirePHP Handler (http://www.firephp.org/), which uses the Wildfire protocol. - * - * @author Eric Clemmons (@ericclemmons) <eric@uxdriven.com> - * - * @phpstan-import-type FormattedRecord from AbstractProcessingHandler - */ -class FirePHPHandler extends AbstractProcessingHandler -{ - use WebRequestRecognizerTrait; - - /** - * WildFire JSON header message format - */ - protected const PROTOCOL_URI = 'http://meta.wildfirehq.org/Protocol/JsonStream/0.2'; - - /** - * FirePHP structure for parsing messages & their presentation - */ - protected const STRUCTURE_URI = 'http://meta.firephp.org/Wildfire/Structure/FirePHP/FirebugConsole/0.1'; - - /** - * Must reference a "known" plugin, otherwise headers won't display in FirePHP - */ - protected const PLUGIN_URI = 'http://meta.firephp.org/Wildfire/Plugin/FirePHP/Library-FirePHPCore/0.3'; - - /** - * Header prefix for Wildfire to recognize & parse headers - */ - protected const HEADER_PREFIX = 'X-Wf'; - - /** - * Whether or not Wildfire vendor-specific headers have been generated & sent yet - * @var bool - */ - protected static $initialized = false; - - /** - * Shared static message index between potentially multiple handlers - * @var int - */ - protected static $messageIndex = 1; - - /** @var bool */ - protected static $sendHeaders = true; - - /** - * Base header creation function used by init headers & record headers - * - * @param array<int|string> $meta Wildfire Plugin, Protocol & Structure Indexes - * @param string $message Log message - * - * @return array<string, string> Complete header string ready for the client as key and message as value - * - * @phpstan-return non-empty-array<string, string> - */ - protected function createHeader(array $meta, string $message): array - { - $header = sprintf('%s-%s', static::HEADER_PREFIX, join('-', $meta)); - - return [$header => $message]; - } - - /** - * Creates message header from record - * - * @return array<string, string> - * - * @phpstan-return non-empty-array<string, string> - * - * @see createHeader() - * - * @phpstan-param FormattedRecord $record - */ - protected function createRecordHeader(array $record): array - { - // Wildfire is extensible to support multiple protocols & plugins in a single request, - // but we're not taking advantage of that (yet), so we're using "1" for simplicity's sake. - return $this->createHeader( - [1, 1, 1, self::$messageIndex++], - $record['formatted'] - ); - } - - /** - * {@inheritDoc} - */ - protected function getDefaultFormatter(): FormatterInterface - { - return new WildfireFormatter(); - } - - /** - * Wildfire initialization headers to enable message parsing - * - * @see createHeader() - * @see sendHeader() - * - * @return array<string, string> - */ - protected function getInitHeaders(): array - { - // Initial payload consists of required headers for Wildfire - return array_merge( - $this->createHeader(['Protocol', 1], static::PROTOCOL_URI), - $this->createHeader([1, 'Structure', 1], static::STRUCTURE_URI), - $this->createHeader([1, 'Plugin', 1], static::PLUGIN_URI) - ); - } - - /** - * Send header string to the client - */ - protected function sendHeader(string $header, string $content): void - { - if (!headers_sent() && self::$sendHeaders) { - header(sprintf('%s: %s', $header, $content)); - } - } - - /** - * Creates & sends header for a record, ensuring init headers have been sent prior - * - * @see sendHeader() - * @see sendInitHeaders() - */ - protected function write(array $record): void - { - if (!self::$sendHeaders || !$this->isWebRequest()) { - return; - } - - // WildFire-specific headers must be sent prior to any messages - if (!self::$initialized) { - self::$initialized = true; - - self::$sendHeaders = $this->headersAccepted(); - if (!self::$sendHeaders) { - return; - } - - foreach ($this->getInitHeaders() as $header => $content) { - $this->sendHeader($header, $content); - } - } - - $header = $this->createRecordHeader($record); - if (trim(current($header)) !== '') { - $this->sendHeader(key($header), current($header)); - } - } - - /** - * Verifies if the headers are accepted by the current user agent - */ - protected function headersAccepted(): bool - { - if (!empty($_SERVER['HTTP_USER_AGENT']) && preg_match('{\bFirePHP/\d+\.\d+\b}', $_SERVER['HTTP_USER_AGENT'])) { - return true; - } - - return isset($_SERVER['HTTP_X_FIREPHP_VERSION']); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php deleted file mode 100644 index 85c95b9d..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php +++ /dev/null @@ -1,135 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\FormatterInterface; -use Monolog\Formatter\LineFormatter; -use Monolog\Logger; - -/** - * Sends logs to Fleep.io using Webhook integrations - * - * You'll need a Fleep.io account to use this handler. - * - * @see https://fleep.io/integrations/webhooks/ Fleep Webhooks Documentation - * @author Ando Roots <ando@sqroot.eu> - * - * @phpstan-import-type FormattedRecord from AbstractProcessingHandler - */ -class FleepHookHandler extends SocketHandler -{ - protected const FLEEP_HOST = 'fleep.io'; - - protected const FLEEP_HOOK_URI = '/hook/'; - - /** - * @var string Webhook token (specifies the conversation where logs are sent) - */ - protected $token; - - /** - * Construct a new Fleep.io Handler. - * - * For instructions on how to create a new web hook in your conversations - * see https://fleep.io/integrations/webhooks/ - * - * @param string $token Webhook token - * @throws MissingExtensionException - */ - public function __construct( - string $token, - $level = Logger::DEBUG, - bool $bubble = true, - bool $persistent = false, - float $timeout = 0.0, - float $writingTimeout = 10.0, - ?float $connectionTimeout = null, - ?int $chunkSize = null - ) { - if (!extension_loaded('openssl')) { - throw new MissingExtensionException('The OpenSSL PHP extension is required to use the FleepHookHandler'); - } - - $this->token = $token; - - $connectionString = 'ssl://' . static::FLEEP_HOST . ':443'; - parent::__construct( - $connectionString, - $level, - $bubble, - $persistent, - $timeout, - $writingTimeout, - $connectionTimeout, - $chunkSize - ); - } - - /** - * Returns the default formatter to use with this handler - * - * Overloaded to remove empty context and extra arrays from the end of the log message. - * - * @return LineFormatter - */ - protected function getDefaultFormatter(): FormatterInterface - { - return new LineFormatter(null, null, true, true); - } - - /** - * Handles a log record - */ - public function write(array $record): void - { - parent::write($record); - $this->closeSocket(); - } - - /** - * {@inheritDoc} - */ - protected function generateDataStream(array $record): string - { - $content = $this->buildContent($record); - - return $this->buildHeader($content) . $content; - } - - /** - * Builds the header of the API Call - */ - private function buildHeader(string $content): string - { - $header = "POST " . static::FLEEP_HOOK_URI . $this->token . " HTTP/1.1\r\n"; - $header .= "Host: " . static::FLEEP_HOST . "\r\n"; - $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; - $header .= "Content-Length: " . strlen($content) . "\r\n"; - $header .= "\r\n"; - - return $header; - } - - /** - * Builds the body of API call - * - * @phpstan-param FormattedRecord $record - */ - private function buildContent(array $record): string - { - $dataArray = [ - 'message' => $record['formatted'], - ]; - - return http_build_query($dataArray); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php deleted file mode 100644 index b837bdb6..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php +++ /dev/null @@ -1,132 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Utils; -use Monolog\Formatter\FlowdockFormatter; -use Monolog\Formatter\FormatterInterface; - -/** - * Sends notifications through the Flowdock push API - * - * This must be configured with a FlowdockFormatter instance via setFormatter() - * - * Notes: - * API token - Flowdock API token - * - * @author Dominik Liebler <liebler.dominik@gmail.com> - * @see https://www.flowdock.com/api/push - * - * @phpstan-import-type FormattedRecord from AbstractProcessingHandler - */ -class FlowdockHandler extends SocketHandler -{ - /** - * @var string - */ - protected $apiToken; - - /** - * @throws MissingExtensionException if OpenSSL is missing - */ - public function __construct( - string $apiToken, - $level = Logger::DEBUG, - bool $bubble = true, - bool $persistent = false, - float $timeout = 0.0, - float $writingTimeout = 10.0, - ?float $connectionTimeout = null, - ?int $chunkSize = null - ) { - if (!extension_loaded('openssl')) { - throw new MissingExtensionException('The OpenSSL PHP extension is required to use the FlowdockHandler'); - } - - parent::__construct( - 'ssl://api.flowdock.com:443', - $level, - $bubble, - $persistent, - $timeout, - $writingTimeout, - $connectionTimeout, - $chunkSize - ); - $this->apiToken = $apiToken; - } - - /** - * {@inheritDoc} - */ - public function setFormatter(FormatterInterface $formatter): HandlerInterface - { - if (!$formatter instanceof FlowdockFormatter) { - throw new \InvalidArgumentException('The FlowdockHandler requires an instance of Monolog\Formatter\FlowdockFormatter to function correctly'); - } - - return parent::setFormatter($formatter); - } - - /** - * Gets the default formatter. - */ - protected function getDefaultFormatter(): FormatterInterface - { - throw new \InvalidArgumentException('The FlowdockHandler must be configured (via setFormatter) with an instance of Monolog\Formatter\FlowdockFormatter to function correctly'); - } - - /** - * {@inheritDoc} - */ - protected function write(array $record): void - { - parent::write($record); - - $this->closeSocket(); - } - - /** - * {@inheritDoc} - */ - protected function generateDataStream(array $record): string - { - $content = $this->buildContent($record); - - return $this->buildHeader($content) . $content; - } - - /** - * Builds the body of API call - * - * @phpstan-param FormattedRecord $record - */ - private function buildContent(array $record): string - { - return Utils::jsonEncode($record['formatted']['flowdock']); - } - - /** - * Builds the header of the API Call - */ - private function buildHeader(string $content): string - { - $header = "POST /v1/messages/team_inbox/" . $this->apiToken . " HTTP/1.1\r\n"; - $header .= "Host: api.flowdock.com\r\n"; - $header .= "Content-Type: application/json\r\n"; - $header .= "Content-Length: " . strlen($content) . "\r\n"; - $header .= "\r\n"; - - return $header; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/FormattableHandlerInterface.php b/vendor/monolog/monolog/src/Monolog/Handler/FormattableHandlerInterface.php deleted file mode 100644 index fc1693cd..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/FormattableHandlerInterface.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\FormatterInterface; - -/** - * Interface to describe loggers that have a formatter - * - * @author Jordi Boggiano <j.boggiano@seld.be> - */ -interface FormattableHandlerInterface -{ - /** - * Sets the formatter. - * - * @param FormatterInterface $formatter - * @return HandlerInterface self - */ - public function setFormatter(FormatterInterface $formatter): HandlerInterface; - - /** - * Gets the formatter. - * - * @return FormatterInterface - */ - public function getFormatter(): FormatterInterface; -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/FormattableHandlerTrait.php b/vendor/monolog/monolog/src/Monolog/Handler/FormattableHandlerTrait.php deleted file mode 100644 index b60bdce0..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/FormattableHandlerTrait.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\FormatterInterface; -use Monolog\Formatter\LineFormatter; - -/** - * Helper trait for implementing FormattableInterface - * - * @author Jordi Boggiano <j.boggiano@seld.be> - */ -trait FormattableHandlerTrait -{ - /** - * @var ?FormatterInterface - */ - protected $formatter; - - /** - * {@inheritDoc} - */ - public function setFormatter(FormatterInterface $formatter): HandlerInterface - { - $this->formatter = $formatter; - - return $this; - } - - /** - * {@inheritDoc} - */ - public function getFormatter(): FormatterInterface - { - if (!$this->formatter) { - $this->formatter = $this->getDefaultFormatter(); - } - - return $this->formatter; - } - - /** - * Gets the default formatter. - * - * Overwrite this if the LineFormatter is not a good default for your handler. - */ - protected function getDefaultFormatter(): FormatterInterface - { - return new LineFormatter(); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/GelfHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/GelfHandler.php deleted file mode 100644 index 4ff26c4c..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/GelfHandler.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Gelf\PublisherInterface; -use Monolog\Logger; -use Monolog\Formatter\GelfMessageFormatter; -use Monolog\Formatter\FormatterInterface; - -/** - * Handler to send messages to a Graylog2 (http://www.graylog2.org) server - * - * @author Matt Lehner <mlehner@gmail.com> - * @author Benjamin Zikarsky <benjamin@zikarsky.de> - */ -class GelfHandler extends AbstractProcessingHandler -{ - /** - * @var PublisherInterface the publisher object that sends the message to the server - */ - protected $publisher; - - /** - * @param PublisherInterface $publisher a gelf publisher object - */ - public function __construct(PublisherInterface $publisher, $level = Logger::DEBUG, bool $bubble = true) - { - parent::__construct($level, $bubble); - - $this->publisher = $publisher; - } - - /** - * {@inheritDoc} - */ - protected function write(array $record): void - { - $this->publisher->publish($record['formatted']); - } - - /** - * {@inheritDoc} - */ - protected function getDefaultFormatter(): FormatterInterface - { - return new GelfMessageFormatter(); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/GroupHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/GroupHandler.php deleted file mode 100644 index 3c9dc4b3..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/GroupHandler.php +++ /dev/null @@ -1,132 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\FormatterInterface; -use Monolog\ResettableInterface; - -/** - * Forwards records to multiple handlers - * - * @author Lenar Lõhmus <lenar@city.ee> - * - * @phpstan-import-type Record from \Monolog\Logger - */ -class GroupHandler extends Handler implements ProcessableHandlerInterface, ResettableInterface -{ - use ProcessableHandlerTrait; - - /** @var HandlerInterface[] */ - protected $handlers; - /** @var bool */ - protected $bubble; - - /** - * @param HandlerInterface[] $handlers Array of Handlers. - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct(array $handlers, bool $bubble = true) - { - foreach ($handlers as $handler) { - if (!$handler instanceof HandlerInterface) { - throw new \InvalidArgumentException('The first argument of the GroupHandler must be an array of HandlerInterface instances.'); - } - } - - $this->handlers = $handlers; - $this->bubble = $bubble; - } - - /** - * {@inheritDoc} - */ - public function isHandling(array $record): bool - { - foreach ($this->handlers as $handler) { - if ($handler->isHandling($record)) { - return true; - } - } - - return false; - } - - /** - * {@inheritDoc} - */ - public function handle(array $record): bool - { - if ($this->processors) { - /** @var Record $record */ - $record = $this->processRecord($record); - } - - foreach ($this->handlers as $handler) { - $handler->handle($record); - } - - return false === $this->bubble; - } - - /** - * {@inheritDoc} - */ - public function handleBatch(array $records): void - { - if ($this->processors) { - $processed = []; - foreach ($records as $record) { - $processed[] = $this->processRecord($record); - } - /** @var Record[] $records */ - $records = $processed; - } - - foreach ($this->handlers as $handler) { - $handler->handleBatch($records); - } - } - - public function reset() - { - $this->resetProcessors(); - - foreach ($this->handlers as $handler) { - if ($handler instanceof ResettableInterface) { - $handler->reset(); - } - } - } - - public function close(): void - { - parent::close(); - - foreach ($this->handlers as $handler) { - $handler->close(); - } - } - - /** - * {@inheritDoc} - */ - public function setFormatter(FormatterInterface $formatter): HandlerInterface - { - foreach ($this->handlers as $handler) { - if ($handler instanceof FormattableHandlerInterface) { - $handler->setFormatter($formatter); - } - } - - return $this; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/Handler.php b/vendor/monolog/monolog/src/Monolog/Handler/Handler.php deleted file mode 100644 index 34b4935d..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/Handler.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -/** - * Base Handler class providing basic close() support as well as handleBatch - * - * @author Jordi Boggiano <j.boggiano@seld.be> - */ -abstract class Handler implements HandlerInterface -{ - /** - * {@inheritDoc} - */ - public function handleBatch(array $records): void - { - foreach ($records as $record) { - $this->handle($record); - } - } - - /** - * {@inheritDoc} - */ - public function close(): void - { - } - - public function __destruct() - { - try { - $this->close(); - } catch (\Throwable $e) { - // do nothing - } - } - - public function __sleep() - { - $this->close(); - - $reflClass = new \ReflectionClass($this); - - $keys = []; - foreach ($reflClass->getProperties() as $reflProp) { - if (!$reflProp->isStatic()) { - $keys[] = $reflProp->getName(); - } - } - - return $keys; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/HandlerInterface.php b/vendor/monolog/monolog/src/Monolog/Handler/HandlerInterface.php deleted file mode 100644 index affcc51f..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/HandlerInterface.php +++ /dev/null @@ -1,85 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -/** - * Interface that all Monolog Handlers must implement - * - * @author Jordi Boggiano <j.boggiano@seld.be> - * - * @phpstan-import-type Record from \Monolog\Logger - * @phpstan-import-type Level from \Monolog\Logger - */ -interface HandlerInterface -{ - /** - * Checks whether the given record will be handled by this handler. - * - * This is mostly done for performance reasons, to avoid calling processors for nothing. - * - * Handlers should still check the record levels within handle(), returning false in isHandling() - * is no guarantee that handle() will not be called, and isHandling() might not be called - * for a given record. - * - * @param array $record Partial log record containing only a level key - * - * @return bool - * - * @phpstan-param array{level: Level} $record - */ - public function isHandling(array $record): bool; - - /** - * Handles a record. - * - * All records may be passed to this method, and the handler should discard - * those that it does not want to handle. - * - * The return value of this function controls the bubbling process of the handler stack. - * Unless the bubbling is interrupted (by returning true), the Logger class will keep on - * calling further handlers in the stack with a given log record. - * - * @param array $record The record to handle - * @return bool true means that this handler handled the record, and that bubbling is not permitted. - * false means the record was either not processed or that this handler allows bubbling. - * - * @phpstan-param Record $record - */ - public function handle(array $record): bool; - - /** - * Handles a set of records at once. - * - * @param array $records The records to handle (an array of record arrays) - * - * @phpstan-param Record[] $records - */ - public function handleBatch(array $records): void; - - /** - * Closes the handler. - * - * Ends a log cycle and frees all resources used by the handler. - * - * Closing a Handler means flushing all buffers and freeing any open resources/handles. - * - * Implementations have to be idempotent (i.e. it should be possible to call close several times without breakage) - * and ideally handlers should be able to reopen themselves on handle() after they have been closed. - * - * This is useful at the end of a request and will be called automatically when the object - * is destroyed if you extend Monolog\Handler\Handler. - * - * If you are thinking of calling this method yourself, most likely you should be - * calling ResettableInterface::reset instead. Have a look. - */ - public function close(): void; -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/HandlerWrapper.php b/vendor/monolog/monolog/src/Monolog/Handler/HandlerWrapper.php deleted file mode 100644 index d4351b9f..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/HandlerWrapper.php +++ /dev/null @@ -1,136 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\ResettableInterface; -use Monolog\Formatter\FormatterInterface; - -/** - * This simple wrapper class can be used to extend handlers functionality. - * - * Example: A custom filtering that can be applied to any handler. - * - * Inherit from this class and override handle() like this: - * - * public function handle(array $record) - * { - * if ($record meets certain conditions) { - * return false; - * } - * return $this->handler->handle($record); - * } - * - * @author Alexey Karapetov <alexey@karapetov.com> - */ -class HandlerWrapper implements HandlerInterface, ProcessableHandlerInterface, FormattableHandlerInterface, ResettableInterface -{ - /** - * @var HandlerInterface - */ - protected $handler; - - public function __construct(HandlerInterface $handler) - { - $this->handler = $handler; - } - - /** - * {@inheritDoc} - */ - public function isHandling(array $record): bool - { - return $this->handler->isHandling($record); - } - - /** - * {@inheritDoc} - */ - public function handle(array $record): bool - { - return $this->handler->handle($record); - } - - /** - * {@inheritDoc} - */ - public function handleBatch(array $records): void - { - $this->handler->handleBatch($records); - } - - /** - * {@inheritDoc} - */ - public function close(): void - { - $this->handler->close(); - } - - /** - * {@inheritDoc} - */ - public function pushProcessor(callable $callback): HandlerInterface - { - if ($this->handler instanceof ProcessableHandlerInterface) { - $this->handler->pushProcessor($callback); - - return $this; - } - - throw new \LogicException('The wrapped handler does not implement ' . ProcessableHandlerInterface::class); - } - - /** - * {@inheritDoc} - */ - public function popProcessor(): callable - { - if ($this->handler instanceof ProcessableHandlerInterface) { - return $this->handler->popProcessor(); - } - - throw new \LogicException('The wrapped handler does not implement ' . ProcessableHandlerInterface::class); - } - - /** - * {@inheritDoc} - */ - public function setFormatter(FormatterInterface $formatter): HandlerInterface - { - if ($this->handler instanceof FormattableHandlerInterface) { - $this->handler->setFormatter($formatter); - - return $this; - } - - throw new \LogicException('The wrapped handler does not implement ' . FormattableHandlerInterface::class); - } - - /** - * {@inheritDoc} - */ - public function getFormatter(): FormatterInterface - { - if ($this->handler instanceof FormattableHandlerInterface) { - return $this->handler->getFormatter(); - } - - throw new \LogicException('The wrapped handler does not implement ' . FormattableHandlerInterface::class); - } - - public function reset() - { - if ($this->handler instanceof ResettableInterface) { - $this->handler->reset(); - } - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php deleted file mode 100644 index 000ccea4..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Utils; - -/** - * IFTTTHandler uses cURL to trigger IFTTT Maker actions - * - * Register a secret key and trigger/event name at https://ifttt.com/maker - * - * value1 will be the channel from monolog's Logger constructor, - * value2 will be the level name (ERROR, WARNING, ..) - * value3 will be the log record's message - * - * @author Nehal Patel <nehal@nehalpatel.me> - */ -class IFTTTHandler extends AbstractProcessingHandler -{ - /** @var string */ - private $eventName; - /** @var string */ - private $secretKey; - - /** - * @param string $eventName The name of the IFTTT Maker event that should be triggered - * @param string $secretKey A valid IFTTT secret key - */ - public function __construct(string $eventName, string $secretKey, $level = Logger::ERROR, bool $bubble = true) - { - if (!extension_loaded('curl')) { - throw new MissingExtensionException('The curl extension is needed to use the IFTTTHandler'); - } - - $this->eventName = $eventName; - $this->secretKey = $secretKey; - - parent::__construct($level, $bubble); - } - - /** - * {@inheritDoc} - */ - public function write(array $record): void - { - $postData = [ - "value1" => $record["channel"], - "value2" => $record["level_name"], - "value3" => $record["message"], - ]; - $postString = Utils::jsonEncode($postData); - - $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, "https://maker.ifttt.com/trigger/" . $this->eventName . "/with/key/" . $this->secretKey); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $postString); - curl_setopt($ch, CURLOPT_HTTPHEADER, [ - "Content-Type: application/json", - ]); - - Curl\Util::execute($ch); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/InsightOpsHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/InsightOpsHandler.php deleted file mode 100644 index 71f64a26..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/InsightOpsHandler.php +++ /dev/null @@ -1,76 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; - -/** - * Inspired on LogEntriesHandler. - * - * @author Robert Kaufmann III <rok3@rok3.me> - * @author Gabriel Machado <gabriel.ms1@hotmail.com> - */ -class InsightOpsHandler extends SocketHandler -{ - /** - * @var string - */ - protected $logToken; - - /** - * @param string $token Log token supplied by InsightOps - * @param string $region Region where InsightOps account is hosted. Could be 'us' or 'eu'. - * @param bool $useSSL Whether or not SSL encryption should be used - * - * @throws MissingExtensionException If SSL encryption is set to true and OpenSSL is missing - */ - public function __construct( - string $token, - string $region = 'us', - bool $useSSL = true, - $level = Logger::DEBUG, - bool $bubble = true, - bool $persistent = false, - float $timeout = 0.0, - float $writingTimeout = 10.0, - ?float $connectionTimeout = null, - ?int $chunkSize = null - ) { - if ($useSSL && !extension_loaded('openssl')) { - throw new MissingExtensionException('The OpenSSL PHP plugin is required to use SSL encrypted connection for InsightOpsHandler'); - } - - $endpoint = $useSSL - ? 'ssl://' . $region . '.data.logs.insight.rapid7.com:443' - : $region . '.data.logs.insight.rapid7.com:80'; - - parent::__construct( - $endpoint, - $level, - $bubble, - $persistent, - $timeout, - $writingTimeout, - $connectionTimeout, - $chunkSize - ); - $this->logToken = $token; - } - - /** - * {@inheritDoc} - */ - protected function generateDataStream(array $record): string - { - return $this->logToken . ' ' . $record['formatted']; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php deleted file mode 100644 index 25fcd159..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; - -/** - * @author Robert Kaufmann III <rok3@rok3.me> - */ -class LogEntriesHandler extends SocketHandler -{ - /** - * @var string - */ - protected $logToken; - - /** - * @param string $token Log token supplied by LogEntries - * @param bool $useSSL Whether or not SSL encryption should be used. - * @param string $host Custom hostname to send the data to if needed - * - * @throws MissingExtensionException If SSL encryption is set to true and OpenSSL is missing - */ - public function __construct( - string $token, - bool $useSSL = true, - $level = Logger::DEBUG, - bool $bubble = true, - string $host = 'data.logentries.com', - bool $persistent = false, - float $timeout = 0.0, - float $writingTimeout = 10.0, - ?float $connectionTimeout = null, - ?int $chunkSize = null - ) { - if ($useSSL && !extension_loaded('openssl')) { - throw new MissingExtensionException('The OpenSSL PHP plugin is required to use SSL encrypted connection for LogEntriesHandler'); - } - - $endpoint = $useSSL ? 'ssl://' . $host . ':443' : $host . ':80'; - parent::__construct( - $endpoint, - $level, - $bubble, - $persistent, - $timeout, - $writingTimeout, - $connectionTimeout, - $chunkSize - ); - $this->logToken = $token; - } - - /** - * {@inheritDoc} - */ - protected function generateDataStream(array $record): string - { - return $this->logToken . ' ' . $record['formatted']; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/LogglyHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/LogglyHandler.php deleted file mode 100644 index 6d13db37..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/LogglyHandler.php +++ /dev/null @@ -1,160 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Formatter\FormatterInterface; -use Monolog\Formatter\LogglyFormatter; -use function array_key_exists; -use CurlHandle; - -/** - * Sends errors to Loggly. - * - * @author Przemek Sobstel <przemek@sobstel.org> - * @author Adam Pancutt <adam@pancutt.com> - * @author Gregory Barchard <gregory@barchard.net> - */ -class LogglyHandler extends AbstractProcessingHandler -{ - protected const HOST = 'logs-01.loggly.com'; - protected const ENDPOINT_SINGLE = 'inputs'; - protected const ENDPOINT_BATCH = 'bulk'; - - /** - * Caches the curl handlers for every given endpoint. - * - * @var resource[]|CurlHandle[] - */ - protected $curlHandlers = []; - - /** @var string */ - protected $token; - - /** @var string[] */ - protected $tag = []; - - /** - * @param string $token API token supplied by Loggly - * - * @throws MissingExtensionException If the curl extension is missing - */ - public function __construct(string $token, $level = Logger::DEBUG, bool $bubble = true) - { - if (!extension_loaded('curl')) { - throw new MissingExtensionException('The curl extension is needed to use the LogglyHandler'); - } - - $this->token = $token; - - parent::__construct($level, $bubble); - } - - /** - * Loads and returns the shared curl handler for the given endpoint. - * - * @param string $endpoint - * - * @return resource|CurlHandle - */ - protected function getCurlHandler(string $endpoint) - { - if (!array_key_exists($endpoint, $this->curlHandlers)) { - $this->curlHandlers[$endpoint] = $this->loadCurlHandle($endpoint); - } - - return $this->curlHandlers[$endpoint]; - } - - /** - * Starts a fresh curl session for the given endpoint and returns its handler. - * - * @param string $endpoint - * - * @return resource|CurlHandle - */ - private function loadCurlHandle(string $endpoint) - { - $url = sprintf("https://%s/%s/%s/", static::HOST, $endpoint, $this->token); - - $ch = curl_init(); - - curl_setopt($ch, CURLOPT_URL, $url); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - return $ch; - } - - /** - * @param string[]|string $tag - */ - public function setTag($tag): self - { - $tag = !empty($tag) ? $tag : []; - $this->tag = is_array($tag) ? $tag : [$tag]; - - return $this; - } - - /** - * @param string[]|string $tag - */ - public function addTag($tag): self - { - if (!empty($tag)) { - $tag = is_array($tag) ? $tag : [$tag]; - $this->tag = array_unique(array_merge($this->tag, $tag)); - } - - return $this; - } - - protected function write(array $record): void - { - $this->send($record["formatted"], static::ENDPOINT_SINGLE); - } - - public function handleBatch(array $records): void - { - $level = $this->level; - - $records = array_filter($records, function ($record) use ($level) { - return ($record['level'] >= $level); - }); - - if ($records) { - $this->send($this->getFormatter()->formatBatch($records), static::ENDPOINT_BATCH); - } - } - - protected function send(string $data, string $endpoint): void - { - $ch = $this->getCurlHandler($endpoint); - - $headers = ['Content-Type: application/json']; - - if (!empty($this->tag)) { - $headers[] = 'X-LOGGLY-TAG: '.implode(',', $this->tag); - } - - curl_setopt($ch, CURLOPT_POSTFIELDS, $data); - curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); - - Curl\Util::execute($ch, 5, false); - } - - protected function getDefaultFormatter(): FormatterInterface - { - return new LogglyFormatter(); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/LogmaticHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/LogmaticHandler.php deleted file mode 100644 index 859a4690..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/LogmaticHandler.php +++ /dev/null @@ -1,106 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Formatter\FormatterInterface; -use Monolog\Formatter\LogmaticFormatter; - -/** - * @author Julien Breux <julien.breux@gmail.com> - */ -class LogmaticHandler extends SocketHandler -{ - /** - * @var string - */ - private $logToken; - - /** - * @var string - */ - private $hostname; - - /** - * @var string - */ - private $appname; - - /** - * @param string $token Log token supplied by Logmatic. - * @param string $hostname Host name supplied by Logmatic. - * @param string $appname Application name supplied by Logmatic. - * @param bool $useSSL Whether or not SSL encryption should be used. - * - * @throws MissingExtensionException If SSL encryption is set to true and OpenSSL is missing - */ - public function __construct( - string $token, - string $hostname = '', - string $appname = '', - bool $useSSL = true, - $level = Logger::DEBUG, - bool $bubble = true, - bool $persistent = false, - float $timeout = 0.0, - float $writingTimeout = 10.0, - ?float $connectionTimeout = null, - ?int $chunkSize = null - ) { - if ($useSSL && !extension_loaded('openssl')) { - throw new MissingExtensionException('The OpenSSL PHP extension is required to use SSL encrypted connection for LogmaticHandler'); - } - - $endpoint = $useSSL ? 'ssl://api.logmatic.io:10515' : 'api.logmatic.io:10514'; - $endpoint .= '/v1/'; - - parent::__construct( - $endpoint, - $level, - $bubble, - $persistent, - $timeout, - $writingTimeout, - $connectionTimeout, - $chunkSize - ); - - $this->logToken = $token; - $this->hostname = $hostname; - $this->appname = $appname; - } - - /** - * {@inheritDoc} - */ - protected function generateDataStream(array $record): string - { - return $this->logToken . ' ' . $record['formatted']; - } - - /** - * {@inheritDoc} - */ - protected function getDefaultFormatter(): FormatterInterface - { - $formatter = new LogmaticFormatter(); - - if (!empty($this->hostname)) { - $formatter->setHostname($this->hostname); - } - if (!empty($this->appname)) { - $formatter->setAppname($this->appname); - } - - return $formatter; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php deleted file mode 100644 index 97f34320..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php +++ /dev/null @@ -1,95 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\FormatterInterface; -use Monolog\Formatter\HtmlFormatter; - -/** - * Base class for all mail handlers - * - * @author Gyula Sallai - * - * @phpstan-import-type Record from \Monolog\Logger - */ -abstract class MailHandler extends AbstractProcessingHandler -{ - /** - * {@inheritDoc} - */ - public function handleBatch(array $records): void - { - $messages = []; - - foreach ($records as $record) { - if ($record['level'] < $this->level) { - continue; - } - /** @var Record $message */ - $message = $this->processRecord($record); - $messages[] = $message; - } - - if (!empty($messages)) { - $this->send((string) $this->getFormatter()->formatBatch($messages), $messages); - } - } - - /** - * Send a mail with the given content - * - * @param string $content formatted email body to be sent - * @param array $records the array of log records that formed this content - * - * @phpstan-param Record[] $records - */ - abstract protected function send(string $content, array $records): void; - - /** - * {@inheritDoc} - */ - protected function write(array $record): void - { - $this->send((string) $record['formatted'], [$record]); - } - - /** - * @phpstan-param non-empty-array<Record> $records - * @phpstan-return Record - */ - protected function getHighestRecord(array $records): array - { - $highestRecord = null; - foreach ($records as $record) { - if ($highestRecord === null || $highestRecord['level'] < $record['level']) { - $highestRecord = $record; - } - } - - return $highestRecord; - } - - protected function isHtmlBody(string $body): bool - { - return ($body[0] ?? null) === '<'; - } - - /** - * Gets the default formatter. - * - * @return FormatterInterface - */ - protected function getDefaultFormatter(): FormatterInterface - { - return new HtmlFormatter(); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/MandrillHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/MandrillHandler.php deleted file mode 100644 index 3003500e..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/MandrillHandler.php +++ /dev/null @@ -1,83 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Swift; -use Swift_Message; - -/** - * MandrillHandler uses cURL to send the emails to the Mandrill API - * - * @author Adam Nicholson <adamnicholson10@gmail.com> - */ -class MandrillHandler extends MailHandler -{ - /** @var Swift_Message */ - protected $message; - /** @var string */ - protected $apiKey; - - /** - * @psalm-param Swift_Message|callable(): Swift_Message $message - * - * @param string $apiKey A valid Mandrill API key - * @param callable|Swift_Message $message An example message for real messages, only the body will be replaced - */ - public function __construct(string $apiKey, $message, $level = Logger::ERROR, bool $bubble = true) - { - parent::__construct($level, $bubble); - - if (!$message instanceof Swift_Message && is_callable($message)) { - $message = $message(); - } - if (!$message instanceof Swift_Message) { - throw new \InvalidArgumentException('You must provide either a Swift_Message instance or a callable returning it'); - } - $this->message = $message; - $this->apiKey = $apiKey; - } - - /** - * {@inheritDoc} - */ - protected function send(string $content, array $records): void - { - $mime = 'text/plain'; - if ($this->isHtmlBody($content)) { - $mime = 'text/html'; - } - - $message = clone $this->message; - $message->setBody($content, $mime); - /** @phpstan-ignore-next-line */ - if (version_compare(Swift::VERSION, '6.0.0', '>=')) { - $message->setDate(new \DateTimeImmutable()); - } else { - /** @phpstan-ignore-next-line */ - $message->setDate(time()); - } - - $ch = curl_init(); - - curl_setopt($ch, CURLOPT_URL, 'https://mandrillapp.com/api/1.0/messages/send-raw.json'); - curl_setopt($ch, CURLOPT_POST, 1); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([ - 'key' => $this->apiKey, - 'raw_message' => (string) $message, - 'async' => false, - ])); - - Curl\Util::execute($ch); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/MissingExtensionException.php b/vendor/monolog/monolog/src/Monolog/Handler/MissingExtensionException.php deleted file mode 100644 index 3965aeea..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/MissingExtensionException.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -/** - * Exception can be thrown if an extension for a handler is missing - * - * @author Christian Bergau <cbergau86@gmail.com> - */ -class MissingExtensionException extends \Exception -{ -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php deleted file mode 100644 index 30630911..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php +++ /dev/null @@ -1,86 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use MongoDB\Driver\BulkWrite; -use MongoDB\Driver\Manager; -use MongoDB\Client; -use Monolog\Logger; -use Monolog\Formatter\FormatterInterface; -use Monolog\Formatter\MongoDBFormatter; - -/** - * Logs to a MongoDB database. - * - * Usage example: - * - * $log = new \Monolog\Logger('application'); - * $client = new \MongoDB\Client('mongodb://localhost:27017'); - * $mongodb = new \Monolog\Handler\MongoDBHandler($client, 'logs', 'prod'); - * $log->pushHandler($mongodb); - * - * The above examples uses the MongoDB PHP library's client class; however, the - * MongoDB\Driver\Manager class from ext-mongodb is also supported. - */ -class MongoDBHandler extends AbstractProcessingHandler -{ - /** @var \MongoDB\Collection */ - private $collection; - /** @var Client|Manager */ - private $manager; - /** @var string */ - private $namespace; - - /** - * Constructor. - * - * @param Client|Manager $mongodb MongoDB library or driver client - * @param string $database Database name - * @param string $collection Collection name - */ - public function __construct($mongodb, string $database, string $collection, $level = Logger::DEBUG, bool $bubble = true) - { - if (!($mongodb instanceof Client || $mongodb instanceof Manager)) { - throw new \InvalidArgumentException('MongoDB\Client or MongoDB\Driver\Manager instance required'); - } - - if ($mongodb instanceof Client) { - $this->collection = $mongodb->selectCollection($database, $collection); - } else { - $this->manager = $mongodb; - $this->namespace = $database . '.' . $collection; - } - - parent::__construct($level, $bubble); - } - - protected function write(array $record): void - { - if (isset($this->collection)) { - $this->collection->insertOne($record['formatted']); - } - - if (isset($this->manager, $this->namespace)) { - $bulk = new BulkWrite; - $bulk->insert($record["formatted"]); - $this->manager->executeBulkWrite($this->namespace, $bulk); - } - } - - /** - * {@inheritDoc} - */ - protected function getDefaultFormatter(): FormatterInterface - { - return new MongoDBFormatter; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php deleted file mode 100644 index 0c0a3bdb..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php +++ /dev/null @@ -1,174 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Formatter\LineFormatter; - -/** - * NativeMailerHandler uses the mail() function to send the emails - * - * @author Christophe Coevoet <stof@notk.org> - * @author Mark Garrett <mark@moderndeveloperllc.com> - */ -class NativeMailerHandler extends MailHandler -{ - /** - * The email addresses to which the message will be sent - * @var string[] - */ - protected $to; - - /** - * The subject of the email - * @var string - */ - protected $subject; - - /** - * Optional headers for the message - * @var string[] - */ - protected $headers = []; - - /** - * Optional parameters for the message - * @var string[] - */ - protected $parameters = []; - - /** - * The wordwrap length for the message - * @var int - */ - protected $maxColumnWidth; - - /** - * The Content-type for the message - * @var string|null - */ - protected $contentType; - - /** - * The encoding for the message - * @var string - */ - protected $encoding = 'utf-8'; - - /** - * @param string|string[] $to The receiver of the mail - * @param string $subject The subject of the mail - * @param string $from The sender of the mail - * @param int $maxColumnWidth The maximum column width that the message lines will have - */ - public function __construct($to, string $subject, string $from, $level = Logger::ERROR, bool $bubble = true, int $maxColumnWidth = 70) - { - parent::__construct($level, $bubble); - $this->to = (array) $to; - $this->subject = $subject; - $this->addHeader(sprintf('From: %s', $from)); - $this->maxColumnWidth = $maxColumnWidth; - } - - /** - * Add headers to the message - * - * @param string|string[] $headers Custom added headers - */ - public function addHeader($headers): self - { - foreach ((array) $headers as $header) { - if (strpos($header, "\n") !== false || strpos($header, "\r") !== false) { - throw new \InvalidArgumentException('Headers can not contain newline characters for security reasons'); - } - $this->headers[] = $header; - } - - return $this; - } - - /** - * Add parameters to the message - * - * @param string|string[] $parameters Custom added parameters - */ - public function addParameter($parameters): self - { - $this->parameters = array_merge($this->parameters, (array) $parameters); - - return $this; - } - - /** - * {@inheritDoc} - */ - protected function send(string $content, array $records): void - { - $contentType = $this->getContentType() ?: ($this->isHtmlBody($content) ? 'text/html' : 'text/plain'); - - if ($contentType !== 'text/html') { - $content = wordwrap($content, $this->maxColumnWidth); - } - - $headers = ltrim(implode("\r\n", $this->headers) . "\r\n", "\r\n"); - $headers .= 'Content-type: ' . $contentType . '; charset=' . $this->getEncoding() . "\r\n"; - if ($contentType === 'text/html' && false === strpos($headers, 'MIME-Version:')) { - $headers .= 'MIME-Version: 1.0' . "\r\n"; - } - - $subject = $this->subject; - if ($records) { - $subjectFormatter = new LineFormatter($this->subject); - $subject = $subjectFormatter->format($this->getHighestRecord($records)); - } - - $parameters = implode(' ', $this->parameters); - foreach ($this->to as $to) { - mail($to, $subject, $content, $headers, $parameters); - } - } - - public function getContentType(): ?string - { - return $this->contentType; - } - - public function getEncoding(): string - { - return $this->encoding; - } - - /** - * @param string $contentType The content type of the email - Defaults to text/plain. Use text/html for HTML messages. - */ - public function setContentType(string $contentType): self - { - if (strpos($contentType, "\n") !== false || strpos($contentType, "\r") !== false) { - throw new \InvalidArgumentException('The content type can not contain newline characters to prevent email header injection'); - } - - $this->contentType = $contentType; - - return $this; - } - - public function setEncoding(string $encoding): self - { - if (strpos($encoding, "\n") !== false || strpos($encoding, "\r") !== false) { - throw new \InvalidArgumentException('The encoding can not contain newline characters to prevent email header injection'); - } - - $this->encoding = $encoding; - - return $this; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php deleted file mode 100644 index 114d749e..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php +++ /dev/null @@ -1,199 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Utils; -use Monolog\Formatter\NormalizerFormatter; -use Monolog\Formatter\FormatterInterface; - -/** - * Class to record a log on a NewRelic application. - * Enabling New Relic High Security mode may prevent capture of useful information. - * - * This handler requires a NormalizerFormatter to function and expects an array in $record['formatted'] - * - * @see https://docs.newrelic.com/docs/agents/php-agent - * @see https://docs.newrelic.com/docs/accounts-partnerships/accounts/security/high-security - */ -class NewRelicHandler extends AbstractProcessingHandler -{ - /** - * Name of the New Relic application that will receive logs from this handler. - * - * @var ?string - */ - protected $appName; - - /** - * Name of the current transaction - * - * @var ?string - */ - protected $transactionName; - - /** - * Some context and extra data is passed into the handler as arrays of values. Do we send them as is - * (useful if we are using the API), or explode them for display on the NewRelic RPM website? - * - * @var bool - */ - protected $explodeArrays; - - /** - * {@inheritDoc} - * - * @param string|null $appName - * @param bool $explodeArrays - * @param string|null $transactionName - */ - public function __construct( - $level = Logger::ERROR, - bool $bubble = true, - ?string $appName = null, - bool $explodeArrays = false, - ?string $transactionName = null - ) { - parent::__construct($level, $bubble); - - $this->appName = $appName; - $this->explodeArrays = $explodeArrays; - $this->transactionName = $transactionName; - } - - /** - * {@inheritDoc} - */ - protected function write(array $record): void - { - if (!$this->isNewRelicEnabled()) { - throw new MissingExtensionException('The newrelic PHP extension is required to use the NewRelicHandler'); - } - - if ($appName = $this->getAppName($record['context'])) { - $this->setNewRelicAppName($appName); - } - - if ($transactionName = $this->getTransactionName($record['context'])) { - $this->setNewRelicTransactionName($transactionName); - unset($record['formatted']['context']['transaction_name']); - } - - if (isset($record['context']['exception']) && $record['context']['exception'] instanceof \Throwable) { - newrelic_notice_error($record['message'], $record['context']['exception']); - unset($record['formatted']['context']['exception']); - } else { - newrelic_notice_error($record['message']); - } - - if (isset($record['formatted']['context']) && is_array($record['formatted']['context'])) { - foreach ($record['formatted']['context'] as $key => $parameter) { - if (is_array($parameter) && $this->explodeArrays) { - foreach ($parameter as $paramKey => $paramValue) { - $this->setNewRelicParameter('context_' . $key . '_' . $paramKey, $paramValue); - } - } else { - $this->setNewRelicParameter('context_' . $key, $parameter); - } - } - } - - if (isset($record['formatted']['extra']) && is_array($record['formatted']['extra'])) { - foreach ($record['formatted']['extra'] as $key => $parameter) { - if (is_array($parameter) && $this->explodeArrays) { - foreach ($parameter as $paramKey => $paramValue) { - $this->setNewRelicParameter('extra_' . $key . '_' . $paramKey, $paramValue); - } - } else { - $this->setNewRelicParameter('extra_' . $key, $parameter); - } - } - } - } - - /** - * Checks whether the NewRelic extension is enabled in the system. - * - * @return bool - */ - protected function isNewRelicEnabled(): bool - { - return extension_loaded('newrelic'); - } - - /** - * Returns the appname where this log should be sent. Each log can override the default appname, set in this - * handler's constructor, by providing the appname in it's context. - * - * @param mixed[] $context - */ - protected function getAppName(array $context): ?string - { - if (isset($context['appname'])) { - return $context['appname']; - } - - return $this->appName; - } - - /** - * Returns the name of the current transaction. Each log can override the default transaction name, set in this - * handler's constructor, by providing the transaction_name in it's context - * - * @param mixed[] $context - */ - protected function getTransactionName(array $context): ?string - { - if (isset($context['transaction_name'])) { - return $context['transaction_name']; - } - - return $this->transactionName; - } - - /** - * Sets the NewRelic application that should receive this log. - */ - protected function setNewRelicAppName(string $appName): void - { - newrelic_set_appname($appName); - } - - /** - * Overwrites the name of the current transaction - */ - protected function setNewRelicTransactionName(string $transactionName): void - { - newrelic_name_transaction($transactionName); - } - - /** - * @param string $key - * @param mixed $value - */ - protected function setNewRelicParameter(string $key, $value): void - { - if (null === $value || is_scalar($value)) { - newrelic_add_custom_parameter($key, $value); - } else { - newrelic_add_custom_parameter($key, Utils::jsonEncode($value, null, true)); - } - } - - /** - * {@inheritDoc} - */ - protected function getDefaultFormatter(): FormatterInterface - { - return new NormalizerFormatter(); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/NoopHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/NoopHandler.php deleted file mode 100644 index 1ddf0beb..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/NoopHandler.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -/** - * No-op - * - * This handler handles anything, but does nothing, and does not stop bubbling to the rest of the stack. - * This can be used for testing, or to disable a handler when overriding a configuration without - * influencing the rest of the stack. - * - * @author Roel Harbers <roelharbers@gmail.com> - */ -class NoopHandler extends Handler -{ - /** - * {@inheritDoc} - */ - public function isHandling(array $record): bool - { - return true; - } - - /** - * {@inheritDoc} - */ - public function handle(array $record): bool - { - return false; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/NullHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/NullHandler.php deleted file mode 100644 index e75ee0c6..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/NullHandler.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Psr\Log\LogLevel; - -/** - * Blackhole - * - * Any record it can handle will be thrown away. This can be used - * to put on top of an existing stack to override it temporarily. - * - * @author Jordi Boggiano <j.boggiano@seld.be> - * - * @phpstan-import-type Level from \Monolog\Logger - * @phpstan-import-type LevelName from \Monolog\Logger - */ -class NullHandler extends Handler -{ - /** - * @var int - */ - private $level; - - /** - * @param string|int $level The minimum logging level at which this handler will be triggered - * - * @phpstan-param Level|LevelName|LogLevel::* $level - */ - public function __construct($level = Logger::DEBUG) - { - $this->level = Logger::toMonologLevel($level); - } - - /** - * {@inheritDoc} - */ - public function isHandling(array $record): bool - { - return $record['level'] >= $this->level; - } - - /** - * {@inheritDoc} - */ - public function handle(array $record): bool - { - return $record['level'] >= $this->level; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/OverflowHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/OverflowHandler.php deleted file mode 100644 index 22068c9a..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/OverflowHandler.php +++ /dev/null @@ -1,149 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Formatter\FormatterInterface; - -/** - * Handler to only pass log messages when a certain threshold of number of messages is reached. - * - * This can be useful in cases of processing a batch of data, but you're for example only interested - * in case it fails catastrophically instead of a warning for 1 or 2 events. Worse things can happen, right? - * - * Usage example: - * - * ``` - * $log = new Logger('application'); - * $handler = new SomeHandler(...) - * - * // Pass all warnings to the handler when more than 10 & all error messages when more then 5 - * $overflow = new OverflowHandler($handler, [Logger::WARNING => 10, Logger::ERROR => 5]); - * - * $log->pushHandler($overflow); - *``` - * - * @author Kris Buist <krisbuist@gmail.com> - */ -class OverflowHandler extends AbstractHandler implements FormattableHandlerInterface -{ - /** @var HandlerInterface */ - private $handler; - - /** @var int[] */ - private $thresholdMap = [ - Logger::DEBUG => 0, - Logger::INFO => 0, - Logger::NOTICE => 0, - Logger::WARNING => 0, - Logger::ERROR => 0, - Logger::CRITICAL => 0, - Logger::ALERT => 0, - Logger::EMERGENCY => 0, - ]; - - /** - * Buffer of all messages passed to the handler before the threshold was reached - * - * @var mixed[][] - */ - private $buffer = []; - - /** - * @param HandlerInterface $handler - * @param int[] $thresholdMap Dictionary of logger level => threshold - */ - public function __construct( - HandlerInterface $handler, - array $thresholdMap = [], - $level = Logger::DEBUG, - bool $bubble = true - ) { - $this->handler = $handler; - foreach ($thresholdMap as $thresholdLevel => $threshold) { - $this->thresholdMap[$thresholdLevel] = $threshold; - } - parent::__construct($level, $bubble); - } - - /** - * Handles a record. - * - * All records may be passed to this method, and the handler should discard - * those that it does not want to handle. - * - * The return value of this function controls the bubbling process of the handler stack. - * Unless the bubbling is interrupted (by returning true), the Logger class will keep on - * calling further handlers in the stack with a given log record. - * - * {@inheritDoc} - */ - public function handle(array $record): bool - { - if ($record['level'] < $this->level) { - return false; - } - - $level = $record['level']; - - if (!isset($this->thresholdMap[$level])) { - $this->thresholdMap[$level] = 0; - } - - if ($this->thresholdMap[$level] > 0) { - // The overflow threshold is not yet reached, so we're buffering the record and lowering the threshold by 1 - $this->thresholdMap[$level]--; - $this->buffer[$level][] = $record; - - return false === $this->bubble; - } - - if ($this->thresholdMap[$level] == 0) { - // This current message is breaking the threshold. Flush the buffer and continue handling the current record - foreach ($this->buffer[$level] ?? [] as $buffered) { - $this->handler->handle($buffered); - } - $this->thresholdMap[$level]--; - unset($this->buffer[$level]); - } - - $this->handler->handle($record); - - return false === $this->bubble; - } - - /** - * {@inheritDoc} - */ - public function setFormatter(FormatterInterface $formatter): HandlerInterface - { - if ($this->handler instanceof FormattableHandlerInterface) { - $this->handler->setFormatter($formatter); - - return $this; - } - - throw new \UnexpectedValueException('The nested handler of type '.get_class($this->handler).' does not support formatters.'); - } - - /** - * {@inheritDoc} - */ - public function getFormatter(): FormatterInterface - { - if ($this->handler instanceof FormattableHandlerInterface) { - return $this->handler->getFormatter(); - } - - throw new \UnexpectedValueException('The nested handler of type '.get_class($this->handler).' does not support formatters.'); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php deleted file mode 100644 index 23a1d117..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php +++ /dev/null @@ -1,263 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\LineFormatter; -use Monolog\Formatter\FormatterInterface; -use Monolog\Logger; -use Monolog\Utils; -use PhpConsole\Connector; -use PhpConsole\Handler as VendorPhpConsoleHandler; -use PhpConsole\Helper; - -/** - * Monolog handler for Google Chrome extension "PHP Console" - * - * Display PHP error/debug log messages in Google Chrome console and notification popups, executes PHP code remotely - * - * Usage: - * 1. Install Google Chrome extension [now dead and removed from the chrome store] - * 2. See overview https://github.com/barbushin/php-console#overview - * 3. Install PHP Console library https://github.com/barbushin/php-console#installation - * 4. Example (result will looks like http://i.hizliresim.com/vg3Pz4.png) - * - * $logger = new \Monolog\Logger('all', array(new \Monolog\Handler\PHPConsoleHandler())); - * \Monolog\ErrorHandler::register($logger); - * echo $undefinedVar; - * $logger->debug('SELECT * FROM users', array('db', 'time' => 0.012)); - * PC::debug($_SERVER); // PHP Console debugger for any type of vars - * - * @author Sergey Barbushin https://www.linkedin.com/in/barbushin - * - * @phpstan-import-type Record from \Monolog\Logger - * @deprecated Since 2.8.0 and 3.2.0, PHPConsole is abandoned and thus we will drop this handler in Monolog 4 - */ -class PHPConsoleHandler extends AbstractProcessingHandler -{ - /** @var array<string, mixed> */ - private $options = [ - 'enabled' => true, // bool Is PHP Console server enabled - 'classesPartialsTraceIgnore' => ['Monolog\\'], // array Hide calls of classes started with... - 'debugTagsKeysInContext' => [0, 'tag'], // bool Is PHP Console server enabled - 'useOwnErrorsHandler' => false, // bool Enable errors handling - 'useOwnExceptionsHandler' => false, // bool Enable exceptions handling - 'sourcesBasePath' => null, // string Base path of all project sources to strip in errors source paths - 'registerHelper' => true, // bool Register PhpConsole\Helper that allows short debug calls like PC::debug($var, 'ta.g.s') - 'serverEncoding' => null, // string|null Server internal encoding - 'headersLimit' => null, // int|null Set headers size limit for your web-server - 'password' => null, // string|null Protect PHP Console connection by password - 'enableSslOnlyMode' => false, // bool Force connection by SSL for clients with PHP Console installed - 'ipMasks' => [], // array Set IP masks of clients that will be allowed to connect to PHP Console: array('192.168.*.*', '127.0.0.1') - 'enableEvalListener' => false, // bool Enable eval request to be handled by eval dispatcher(if enabled, 'password' option is also required) - 'dumperDetectCallbacks' => false, // bool Convert callback items in dumper vars to (callback SomeClass::someMethod) strings - 'dumperLevelLimit' => 5, // int Maximum dumped vars array or object nested dump level - 'dumperItemsCountLimit' => 100, // int Maximum dumped var same level array items or object properties number - 'dumperItemSizeLimit' => 5000, // int Maximum length of any string or dumped array item - 'dumperDumpSizeLimit' => 500000, // int Maximum approximate size of dumped vars result formatted in JSON - 'detectDumpTraceAndSource' => false, // bool Autodetect and append trace data to debug - 'dataStorage' => null, // \PhpConsole\Storage|null Fixes problem with custom $_SESSION handler(see http://goo.gl/Ne8juJ) - ]; - - /** @var Connector */ - private $connector; - - /** - * @param array<string, mixed> $options See \Monolog\Handler\PHPConsoleHandler::$options for more details - * @param Connector|null $connector Instance of \PhpConsole\Connector class (optional) - * @throws \RuntimeException - */ - public function __construct(array $options = [], ?Connector $connector = null, $level = Logger::DEBUG, bool $bubble = true) - { - if (!class_exists('PhpConsole\Connector')) { - throw new \RuntimeException('PHP Console library not found. See https://github.com/barbushin/php-console#installation'); - } - parent::__construct($level, $bubble); - $this->options = $this->initOptions($options); - $this->connector = $this->initConnector($connector); - } - - /** - * @param array<string, mixed> $options - * - * @return array<string, mixed> - */ - private function initOptions(array $options): array - { - $wrongOptions = array_diff(array_keys($options), array_keys($this->options)); - if ($wrongOptions) { - throw new \RuntimeException('Unknown options: ' . implode(', ', $wrongOptions)); - } - - return array_replace($this->options, $options); - } - - private function initConnector(?Connector $connector = null): Connector - { - if (!$connector) { - if ($this->options['dataStorage']) { - Connector::setPostponeStorage($this->options['dataStorage']); - } - $connector = Connector::getInstance(); - } - - if ($this->options['registerHelper'] && !Helper::isRegistered()) { - Helper::register(); - } - - if ($this->options['enabled'] && $connector->isActiveClient()) { - if ($this->options['useOwnErrorsHandler'] || $this->options['useOwnExceptionsHandler']) { - $handler = VendorPhpConsoleHandler::getInstance(); - $handler->setHandleErrors($this->options['useOwnErrorsHandler']); - $handler->setHandleExceptions($this->options['useOwnExceptionsHandler']); - $handler->start(); - } - if ($this->options['sourcesBasePath']) { - $connector->setSourcesBasePath($this->options['sourcesBasePath']); - } - if ($this->options['serverEncoding']) { - $connector->setServerEncoding($this->options['serverEncoding']); - } - if ($this->options['password']) { - $connector->setPassword($this->options['password']); - } - if ($this->options['enableSslOnlyMode']) { - $connector->enableSslOnlyMode(); - } - if ($this->options['ipMasks']) { - $connector->setAllowedIpMasks($this->options['ipMasks']); - } - if ($this->options['headersLimit']) { - $connector->setHeadersLimit($this->options['headersLimit']); - } - if ($this->options['detectDumpTraceAndSource']) { - $connector->getDebugDispatcher()->detectTraceAndSource = true; - } - $dumper = $connector->getDumper(); - $dumper->levelLimit = $this->options['dumperLevelLimit']; - $dumper->itemsCountLimit = $this->options['dumperItemsCountLimit']; - $dumper->itemSizeLimit = $this->options['dumperItemSizeLimit']; - $dumper->dumpSizeLimit = $this->options['dumperDumpSizeLimit']; - $dumper->detectCallbacks = $this->options['dumperDetectCallbacks']; - if ($this->options['enableEvalListener']) { - $connector->startEvalRequestsListener(); - } - } - - return $connector; - } - - public function getConnector(): Connector - { - return $this->connector; - } - - /** - * @return array<string, mixed> - */ - public function getOptions(): array - { - return $this->options; - } - - public function handle(array $record): bool - { - if ($this->options['enabled'] && $this->connector->isActiveClient()) { - return parent::handle($record); - } - - return !$this->bubble; - } - - /** - * Writes the record down to the log of the implementing handler - */ - protected function write(array $record): void - { - if ($record['level'] < Logger::NOTICE) { - $this->handleDebugRecord($record); - } elseif (isset($record['context']['exception']) && $record['context']['exception'] instanceof \Throwable) { - $this->handleExceptionRecord($record); - } else { - $this->handleErrorRecord($record); - } - } - - /** - * @phpstan-param Record $record - */ - private function handleDebugRecord(array $record): void - { - $tags = $this->getRecordTags($record); - $message = $record['message']; - if ($record['context']) { - $message .= ' ' . Utils::jsonEncode($this->connector->getDumper()->dump(array_filter($record['context'])), null, true); - } - $this->connector->getDebugDispatcher()->dispatchDebug($message, $tags, $this->options['classesPartialsTraceIgnore']); - } - - /** - * @phpstan-param Record $record - */ - private function handleExceptionRecord(array $record): void - { - $this->connector->getErrorsDispatcher()->dispatchException($record['context']['exception']); - } - - /** - * @phpstan-param Record $record - */ - private function handleErrorRecord(array $record): void - { - $context = $record['context']; - - $this->connector->getErrorsDispatcher()->dispatchError( - $context['code'] ?? null, - $context['message'] ?? $record['message'], - $context['file'] ?? null, - $context['line'] ?? null, - $this->options['classesPartialsTraceIgnore'] - ); - } - - /** - * @phpstan-param Record $record - * @return string - */ - private function getRecordTags(array &$record) - { - $tags = null; - if (!empty($record['context'])) { - $context = & $record['context']; - foreach ($this->options['debugTagsKeysInContext'] as $key) { - if (!empty($context[$key])) { - $tags = $context[$key]; - if ($key === 0) { - array_shift($context); - } else { - unset($context[$key]); - } - break; - } - } - } - - return $tags ?: strtolower($record['level_name']); - } - - /** - * {@inheritDoc} - */ - protected function getDefaultFormatter(): FormatterInterface - { - return new LineFormatter('%message%'); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/ProcessHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/ProcessHandler.php deleted file mode 100644 index 8a8cf1be..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/ProcessHandler.php +++ /dev/null @@ -1,191 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; - -/** - * Stores to STDIN of any process, specified by a command. - * - * Usage example: - * <pre> - * $log = new Logger('myLogger'); - * $log->pushHandler(new ProcessHandler('/usr/bin/php /var/www/monolog/someScript.php')); - * </pre> - * - * @author Kolja Zuelsdorf <koljaz@web.de> - */ -class ProcessHandler extends AbstractProcessingHandler -{ - /** - * Holds the process to receive data on its STDIN. - * - * @var resource|bool|null - */ - private $process; - - /** - * @var string - */ - private $command; - - /** - * @var string|null - */ - private $cwd; - - /** - * @var resource[] - */ - private $pipes = []; - - /** - * @var array<int, string[]> - */ - protected const DESCRIPTOR_SPEC = [ - 0 => ['pipe', 'r'], // STDIN is a pipe that the child will read from - 1 => ['pipe', 'w'], // STDOUT is a pipe that the child will write to - 2 => ['pipe', 'w'], // STDERR is a pipe to catch the any errors - ]; - - /** - * @param string $command Command for the process to start. Absolute paths are recommended, - * especially if you do not use the $cwd parameter. - * @param string|null $cwd "Current working directory" (CWD) for the process to be executed in. - * @throws \InvalidArgumentException - */ - public function __construct(string $command, $level = Logger::DEBUG, bool $bubble = true, ?string $cwd = null) - { - if ($command === '') { - throw new \InvalidArgumentException('The command argument must be a non-empty string.'); - } - if ($cwd === '') { - throw new \InvalidArgumentException('The optional CWD argument must be a non-empty string or null.'); - } - - parent::__construct($level, $bubble); - - $this->command = $command; - $this->cwd = $cwd; - } - - /** - * Writes the record down to the log of the implementing handler - * - * @throws \UnexpectedValueException - */ - protected function write(array $record): void - { - $this->ensureProcessIsStarted(); - - $this->writeProcessInput($record['formatted']); - - $errors = $this->readProcessErrors(); - if (empty($errors) === false) { - throw new \UnexpectedValueException(sprintf('Errors while writing to process: %s', $errors)); - } - } - - /** - * Makes sure that the process is actually started, and if not, starts it, - * assigns the stream pipes, and handles startup errors, if any. - */ - private function ensureProcessIsStarted(): void - { - if (is_resource($this->process) === false) { - $this->startProcess(); - - $this->handleStartupErrors(); - } - } - - /** - * Starts the actual process and sets all streams to non-blocking. - */ - private function startProcess(): void - { - $this->process = proc_open($this->command, static::DESCRIPTOR_SPEC, $this->pipes, $this->cwd); - - foreach ($this->pipes as $pipe) { - stream_set_blocking($pipe, false); - } - } - - /** - * Selects the STDERR stream, handles upcoming startup errors, and throws an exception, if any. - * - * @throws \UnexpectedValueException - */ - private function handleStartupErrors(): void - { - $selected = $this->selectErrorStream(); - if (false === $selected) { - throw new \UnexpectedValueException('Something went wrong while selecting a stream.'); - } - - $errors = $this->readProcessErrors(); - - if (is_resource($this->process) === false || empty($errors) === false) { - throw new \UnexpectedValueException( - sprintf('The process "%s" could not be opened: ' . $errors, $this->command) - ); - } - } - - /** - * Selects the STDERR stream. - * - * @return int|bool - */ - protected function selectErrorStream() - { - $empty = []; - $errorPipes = [$this->pipes[2]]; - - return stream_select($errorPipes, $empty, $empty, 1); - } - - /** - * Reads the errors of the process, if there are any. - * - * @codeCoverageIgnore - * @return string Empty string if there are no errors. - */ - protected function readProcessErrors(): string - { - return (string) stream_get_contents($this->pipes[2]); - } - - /** - * Writes to the input stream of the opened process. - * - * @codeCoverageIgnore - */ - protected function writeProcessInput(string $string): void - { - fwrite($this->pipes[0], $string); - } - - /** - * {@inheritDoc} - */ - public function close(): void - { - if (is_resource($this->process)) { - foreach ($this->pipes as $pipe) { - fclose($pipe); - } - proc_close($this->process); - $this->process = null; - } - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/ProcessableHandlerInterface.php b/vendor/monolog/monolog/src/Monolog/Handler/ProcessableHandlerInterface.php deleted file mode 100644 index 3adec7a4..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/ProcessableHandlerInterface.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Processor\ProcessorInterface; - -/** - * Interface to describe loggers that have processors - * - * @author Jordi Boggiano <j.boggiano@seld.be> - * - * @phpstan-import-type Record from \Monolog\Logger - */ -interface ProcessableHandlerInterface -{ - /** - * Adds a processor in the stack. - * - * @psalm-param ProcessorInterface|callable(Record): Record $callback - * - * @param ProcessorInterface|callable $callback - * @return HandlerInterface self - */ - public function pushProcessor(callable $callback): HandlerInterface; - - /** - * Removes the processor on top of the stack and returns it. - * - * @psalm-return ProcessorInterface|callable(Record): Record $callback - * - * @throws \LogicException In case the processor stack is empty - * @return callable|ProcessorInterface - */ - public function popProcessor(): callable; -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/ProcessableHandlerTrait.php b/vendor/monolog/monolog/src/Monolog/Handler/ProcessableHandlerTrait.php deleted file mode 100644 index 9ef6e301..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/ProcessableHandlerTrait.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\ResettableInterface; -use Monolog\Processor\ProcessorInterface; - -/** - * Helper trait for implementing ProcessableInterface - * - * @author Jordi Boggiano <j.boggiano@seld.be> - * - * @phpstan-import-type Record from \Monolog\Logger - */ -trait ProcessableHandlerTrait -{ - /** - * @var callable[] - * @phpstan-var array<ProcessorInterface|callable(Record): Record> - */ - protected $processors = []; - - /** - * {@inheritDoc} - */ - public function pushProcessor(callable $callback): HandlerInterface - { - array_unshift($this->processors, $callback); - - return $this; - } - - /** - * {@inheritDoc} - */ - public function popProcessor(): callable - { - if (!$this->processors) { - throw new \LogicException('You tried to pop from an empty processor stack.'); - } - - return array_shift($this->processors); - } - - /** - * Processes a record. - * - * @phpstan-param Record $record - * @phpstan-return Record - */ - protected function processRecord(array $record): array - { - foreach ($this->processors as $processor) { - $record = $processor($record); - } - - return $record; - } - - protected function resetProcessors(): void - { - foreach ($this->processors as $processor) { - if ($processor instanceof ResettableInterface) { - $processor->reset(); - } - } - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/PsrHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/PsrHandler.php deleted file mode 100644 index 36e19ccc..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/PsrHandler.php +++ /dev/null @@ -1,95 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Psr\Log\LoggerInterface; -use Monolog\Formatter\FormatterInterface; - -/** - * Proxies log messages to an existing PSR-3 compliant logger. - * - * If a formatter is configured, the formatter's output MUST be a string and the - * formatted message will be fed to the wrapped PSR logger instead of the original - * log record's message. - * - * @author Michael Moussa <michael.moussa@gmail.com> - */ -class PsrHandler extends AbstractHandler implements FormattableHandlerInterface -{ - /** - * PSR-3 compliant logger - * - * @var LoggerInterface - */ - protected $logger; - - /** - * @var FormatterInterface|null - */ - protected $formatter; - - /** - * @param LoggerInterface $logger The underlying PSR-3 compliant logger to which messages will be proxied - */ - public function __construct(LoggerInterface $logger, $level = Logger::DEBUG, bool $bubble = true) - { - parent::__construct($level, $bubble); - - $this->logger = $logger; - } - - /** - * {@inheritDoc} - */ - public function handle(array $record): bool - { - if (!$this->isHandling($record)) { - return false; - } - - if ($this->formatter) { - $formatted = $this->formatter->format($record); - $this->logger->log(strtolower($record['level_name']), (string) $formatted, $record['context']); - } else { - $this->logger->log(strtolower($record['level_name']), $record['message'], $record['context']); - } - - return false === $this->bubble; - } - - /** - * Sets the formatter. - * - * @param FormatterInterface $formatter - */ - public function setFormatter(FormatterInterface $formatter): HandlerInterface - { - $this->formatter = $formatter; - - return $this; - } - - /** - * Gets the formatter. - * - * @return FormatterInterface - */ - public function getFormatter(): FormatterInterface - { - if (!$this->formatter) { - throw new \LogicException('No formatter has been set and this handler does not have a default formatter'); - } - - return $this->formatter; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/PushoverHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/PushoverHandler.php deleted file mode 100644 index fed2303d..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/PushoverHandler.php +++ /dev/null @@ -1,246 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Utils; -use Psr\Log\LogLevel; - -/** - * Sends notifications through the pushover api to mobile phones - * - * @author Sebastian Göttschkes <sebastian.goettschkes@googlemail.com> - * @see https://www.pushover.net/api - * - * @phpstan-import-type FormattedRecord from AbstractProcessingHandler - * @phpstan-import-type Level from \Monolog\Logger - * @phpstan-import-type LevelName from \Monolog\Logger - */ -class PushoverHandler extends SocketHandler -{ - /** @var string */ - private $token; - /** @var array<int|string> */ - private $users; - /** @var string */ - private $title; - /** @var string|int|null */ - private $user = null; - /** @var int */ - private $retry; - /** @var int */ - private $expire; - - /** @var int */ - private $highPriorityLevel; - /** @var int */ - private $emergencyLevel; - /** @var bool */ - private $useFormattedMessage = false; - - /** - * All parameters that can be sent to Pushover - * @see https://pushover.net/api - * @var array<string, bool> - */ - private $parameterNames = [ - 'token' => true, - 'user' => true, - 'message' => true, - 'device' => true, - 'title' => true, - 'url' => true, - 'url_title' => true, - 'priority' => true, - 'timestamp' => true, - 'sound' => true, - 'retry' => true, - 'expire' => true, - 'callback' => true, - ]; - - /** - * Sounds the api supports by default - * @see https://pushover.net/api#sounds - * @var string[] - */ - private $sounds = [ - 'pushover', 'bike', 'bugle', 'cashregister', 'classical', 'cosmic', 'falling', 'gamelan', 'incoming', - 'intermission', 'magic', 'mechanical', 'pianobar', 'siren', 'spacealarm', 'tugboat', 'alien', 'climb', - 'persistent', 'echo', 'updown', 'none', - ]; - - /** - * @param string $token Pushover api token - * @param string|array $users Pushover user id or array of ids the message will be sent to - * @param string|null $title Title sent to the Pushover API - * @param bool $useSSL Whether to connect via SSL. Required when pushing messages to users that are not - * the pushover.net app owner. OpenSSL is required for this option. - * @param string|int $highPriorityLevel The minimum logging level at which this handler will start - * sending "high priority" requests to the Pushover API - * @param string|int $emergencyLevel The minimum logging level at which this handler will start - * sending "emergency" requests to the Pushover API - * @param int $retry The retry parameter specifies how often (in seconds) the Pushover servers will - * send the same notification to the user. - * @param int $expire The expire parameter specifies how many seconds your notification will continue - * to be retried for (every retry seconds). - * - * @phpstan-param string|array<int|string> $users - * @phpstan-param Level|LevelName|LogLevel::* $highPriorityLevel - * @phpstan-param Level|LevelName|LogLevel::* $emergencyLevel - */ - public function __construct( - string $token, - $users, - ?string $title = null, - $level = Logger::CRITICAL, - bool $bubble = true, - bool $useSSL = true, - $highPriorityLevel = Logger::CRITICAL, - $emergencyLevel = Logger::EMERGENCY, - int $retry = 30, - int $expire = 25200, - bool $persistent = false, - float $timeout = 0.0, - float $writingTimeout = 10.0, - ?float $connectionTimeout = null, - ?int $chunkSize = null - ) { - $connectionString = $useSSL ? 'ssl://api.pushover.net:443' : 'api.pushover.net:80'; - parent::__construct( - $connectionString, - $level, - $bubble, - $persistent, - $timeout, - $writingTimeout, - $connectionTimeout, - $chunkSize - ); - - $this->token = $token; - $this->users = (array) $users; - $this->title = $title ?: (string) gethostname(); - $this->highPriorityLevel = Logger::toMonologLevel($highPriorityLevel); - $this->emergencyLevel = Logger::toMonologLevel($emergencyLevel); - $this->retry = $retry; - $this->expire = $expire; - } - - protected function generateDataStream(array $record): string - { - $content = $this->buildContent($record); - - return $this->buildHeader($content) . $content; - } - - /** - * @phpstan-param FormattedRecord $record - */ - private function buildContent(array $record): string - { - // Pushover has a limit of 512 characters on title and message combined. - $maxMessageLength = 512 - strlen($this->title); - - $message = ($this->useFormattedMessage) ? $record['formatted'] : $record['message']; - $message = Utils::substr($message, 0, $maxMessageLength); - - $timestamp = $record['datetime']->getTimestamp(); - - $dataArray = [ - 'token' => $this->token, - 'user' => $this->user, - 'message' => $message, - 'title' => $this->title, - 'timestamp' => $timestamp, - ]; - - if (isset($record['level']) && $record['level'] >= $this->emergencyLevel) { - $dataArray['priority'] = 2; - $dataArray['retry'] = $this->retry; - $dataArray['expire'] = $this->expire; - } elseif (isset($record['level']) && $record['level'] >= $this->highPriorityLevel) { - $dataArray['priority'] = 1; - } - - // First determine the available parameters - $context = array_intersect_key($record['context'], $this->parameterNames); - $extra = array_intersect_key($record['extra'], $this->parameterNames); - - // Least important info should be merged with subsequent info - $dataArray = array_merge($extra, $context, $dataArray); - - // Only pass sounds that are supported by the API - if (isset($dataArray['sound']) && !in_array($dataArray['sound'], $this->sounds)) { - unset($dataArray['sound']); - } - - return http_build_query($dataArray); - } - - private function buildHeader(string $content): string - { - $header = "POST /1/messages.json HTTP/1.1\r\n"; - $header .= "Host: api.pushover.net\r\n"; - $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; - $header .= "Content-Length: " . strlen($content) . "\r\n"; - $header .= "\r\n"; - - return $header; - } - - protected function write(array $record): void - { - foreach ($this->users as $user) { - $this->user = $user; - - parent::write($record); - $this->closeSocket(); - } - - $this->user = null; - } - - /** - * @param int|string $value - * - * @phpstan-param Level|LevelName|LogLevel::* $value - */ - public function setHighPriorityLevel($value): self - { - $this->highPriorityLevel = Logger::toMonologLevel($value); - - return $this; - } - - /** - * @param int|string $value - * - * @phpstan-param Level|LevelName|LogLevel::* $value - */ - public function setEmergencyLevel($value): self - { - $this->emergencyLevel = Logger::toMonologLevel($value); - - return $this; - } - - /** - * Use the formatted message? - */ - public function useFormattedMessage(bool $value): self - { - $this->useFormattedMessage = $value; - - return $this; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/RedisHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/RedisHandler.php deleted file mode 100644 index 91d16eaf..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/RedisHandler.php +++ /dev/null @@ -1,101 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\LineFormatter; -use Monolog\Formatter\FormatterInterface; -use Monolog\Logger; - -/** - * Logs to a Redis key using rpush - * - * usage example: - * - * $log = new Logger('application'); - * $redis = new RedisHandler(new Predis\Client("tcp://localhost:6379"), "logs", "prod"); - * $log->pushHandler($redis); - * - * @author Thomas Tourlourat <thomas@tourlourat.com> - * - * @phpstan-import-type FormattedRecord from AbstractProcessingHandler - */ -class RedisHandler extends AbstractProcessingHandler -{ - /** @var \Predis\Client<\Predis\Client>|\Redis */ - private $redisClient; - /** @var string */ - private $redisKey; - /** @var int */ - protected $capSize; - - /** - * @param \Predis\Client<\Predis\Client>|\Redis $redis The redis instance - * @param string $key The key name to push records to - * @param int $capSize Number of entries to limit list size to, 0 = unlimited - */ - public function __construct($redis, string $key, $level = Logger::DEBUG, bool $bubble = true, int $capSize = 0) - { - if (!(($redis instanceof \Predis\Client) || ($redis instanceof \Redis))) { - throw new \InvalidArgumentException('Predis\Client or Redis instance required'); - } - - $this->redisClient = $redis; - $this->redisKey = $key; - $this->capSize = $capSize; - - parent::__construct($level, $bubble); - } - - /** - * {@inheritDoc} - */ - protected function write(array $record): void - { - if ($this->capSize) { - $this->writeCapped($record); - } else { - $this->redisClient->rpush($this->redisKey, $record["formatted"]); - } - } - - /** - * Write and cap the collection - * Writes the record to the redis list and caps its - * - * @phpstan-param FormattedRecord $record - */ - protected function writeCapped(array $record): void - { - if ($this->redisClient instanceof \Redis) { - $mode = defined('\Redis::MULTI') ? \Redis::MULTI : 1; - $this->redisClient->multi($mode) - ->rpush($this->redisKey, $record["formatted"]) - ->ltrim($this->redisKey, -$this->capSize, -1) - ->exec(); - } else { - $redisKey = $this->redisKey; - $capSize = $this->capSize; - $this->redisClient->transaction(function ($tx) use ($record, $redisKey, $capSize) { - $tx->rpush($redisKey, $record["formatted"]); - $tx->ltrim($redisKey, -$capSize, -1); - }); - } - } - - /** - * {@inheritDoc} - */ - protected function getDefaultFormatter(): FormatterInterface - { - return new LineFormatter(); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/RedisPubSubHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/RedisPubSubHandler.php deleted file mode 100644 index 7789309c..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/RedisPubSubHandler.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\LineFormatter; -use Monolog\Formatter\FormatterInterface; -use Monolog\Logger; - -/** - * Sends the message to a Redis Pub/Sub channel using PUBLISH - * - * usage example: - * - * $log = new Logger('application'); - * $redis = new RedisPubSubHandler(new Predis\Client("tcp://localhost:6379"), "logs", Logger::WARNING); - * $log->pushHandler($redis); - * - * @author Gaëtan Faugère <gaetan@fauge.re> - */ -class RedisPubSubHandler extends AbstractProcessingHandler -{ - /** @var \Predis\Client<\Predis\Client>|\Redis */ - private $redisClient; - /** @var string */ - private $channelKey; - - /** - * @param \Predis\Client<\Predis\Client>|\Redis $redis The redis instance - * @param string $key The channel key to publish records to - */ - public function __construct($redis, string $key, $level = Logger::DEBUG, bool $bubble = true) - { - if (!(($redis instanceof \Predis\Client) || ($redis instanceof \Redis))) { - throw new \InvalidArgumentException('Predis\Client or Redis instance required'); - } - - $this->redisClient = $redis; - $this->channelKey = $key; - - parent::__construct($level, $bubble); - } - - /** - * {@inheritDoc} - */ - protected function write(array $record): void - { - $this->redisClient->publish($this->channelKey, $record["formatted"]); - } - - /** - * {@inheritDoc} - */ - protected function getDefaultFormatter(): FormatterInterface - { - return new LineFormatter(); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/RollbarHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/RollbarHandler.php deleted file mode 100644 index adcc9395..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/RollbarHandler.php +++ /dev/null @@ -1,131 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Rollbar\RollbarLogger; -use Throwable; -use Monolog\Logger; - -/** - * Sends errors to Rollbar - * - * If the context data contains a `payload` key, that is used as an array - * of payload options to RollbarLogger's log method. - * - * Rollbar's context info will contain the context + extra keys from the log record - * merged, and then on top of that a few keys: - * - * - level (rollbar level name) - * - monolog_level (monolog level name, raw level, as rollbar only has 5 but monolog 8) - * - channel - * - datetime (unix timestamp) - * - * @author Paul Statezny <paulstatezny@gmail.com> - */ -class RollbarHandler extends AbstractProcessingHandler -{ - /** - * @var RollbarLogger - */ - protected $rollbarLogger; - - /** @var string[] */ - protected $levelMap = [ - Logger::DEBUG => 'debug', - Logger::INFO => 'info', - Logger::NOTICE => 'info', - Logger::WARNING => 'warning', - Logger::ERROR => 'error', - Logger::CRITICAL => 'critical', - Logger::ALERT => 'critical', - Logger::EMERGENCY => 'critical', - ]; - - /** - * Records whether any log records have been added since the last flush of the rollbar notifier - * - * @var bool - */ - private $hasRecords = false; - - /** @var bool */ - protected $initialized = false; - - /** - * @param RollbarLogger $rollbarLogger RollbarLogger object constructed with valid token - */ - public function __construct(RollbarLogger $rollbarLogger, $level = Logger::ERROR, bool $bubble = true) - { - $this->rollbarLogger = $rollbarLogger; - - parent::__construct($level, $bubble); - } - - /** - * {@inheritDoc} - */ - protected function write(array $record): void - { - if (!$this->initialized) { - // __destructor() doesn't get called on Fatal errors - register_shutdown_function(array($this, 'close')); - $this->initialized = true; - } - - $context = $record['context']; - $context = array_merge($context, $record['extra'], [ - 'level' => $this->levelMap[$record['level']], - 'monolog_level' => $record['level_name'], - 'channel' => $record['channel'], - 'datetime' => $record['datetime']->format('U'), - ]); - - if (isset($context['exception']) && $context['exception'] instanceof Throwable) { - $exception = $context['exception']; - unset($context['exception']); - $toLog = $exception; - } else { - $toLog = $record['message']; - } - - // @phpstan-ignore-next-line - $this->rollbarLogger->log($context['level'], $toLog, $context); - - $this->hasRecords = true; - } - - public function flush(): void - { - if ($this->hasRecords) { - $this->rollbarLogger->flush(); - $this->hasRecords = false; - } - } - - /** - * {@inheritDoc} - */ - public function close(): void - { - $this->flush(); - } - - /** - * {@inheritDoc} - */ - public function reset() - { - $this->flush(); - - parent::reset(); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php deleted file mode 100644 index 17745d22..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php +++ /dev/null @@ -1,207 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use InvalidArgumentException; -use Monolog\Logger; -use Monolog\Utils; - -/** - * Stores logs to files that are rotated every day and a limited number of files are kept. - * - * This rotation is only intended to be used as a workaround. Using logrotate to - * handle the rotation is strongly encouraged when you can use it. - * - * @author Christophe Coevoet <stof@notk.org> - * @author Jordi Boggiano <j.boggiano@seld.be> - */ -class RotatingFileHandler extends StreamHandler -{ - public const FILE_PER_DAY = 'Y-m-d'; - public const FILE_PER_MONTH = 'Y-m'; - public const FILE_PER_YEAR = 'Y'; - - /** @var string */ - protected $filename; - /** @var int */ - protected $maxFiles; - /** @var bool */ - protected $mustRotate; - /** @var \DateTimeImmutable */ - protected $nextRotation; - /** @var string */ - protected $filenameFormat; - /** @var string */ - protected $dateFormat; - - /** - * @param string $filename - * @param int $maxFiles The maximal amount of files to keep (0 means unlimited) - * @param int|null $filePermission Optional file permissions (default (0644) are only for owner read/write) - * @param bool $useLocking Try to lock log file before doing any writes - */ - public function __construct(string $filename, int $maxFiles = 0, $level = Logger::DEBUG, bool $bubble = true, ?int $filePermission = null, bool $useLocking = false) - { - $this->filename = Utils::canonicalizePath($filename); - $this->maxFiles = $maxFiles; - $this->nextRotation = new \DateTimeImmutable('tomorrow'); - $this->filenameFormat = '{filename}-{date}'; - $this->dateFormat = static::FILE_PER_DAY; - - parent::__construct($this->getTimedFilename(), $level, $bubble, $filePermission, $useLocking); - } - - /** - * {@inheritDoc} - */ - public function close(): void - { - parent::close(); - - if (true === $this->mustRotate) { - $this->rotate(); - } - } - - /** - * {@inheritDoc} - */ - public function reset() - { - parent::reset(); - - if (true === $this->mustRotate) { - $this->rotate(); - } - } - - public function setFilenameFormat(string $filenameFormat, string $dateFormat): self - { - if (!preg_match('{^[Yy](([/_.-]?m)([/_.-]?d)?)?$}', $dateFormat)) { - throw new InvalidArgumentException( - 'Invalid date format - format must be one of '. - 'RotatingFileHandler::FILE_PER_DAY ("Y-m-d"), RotatingFileHandler::FILE_PER_MONTH ("Y-m") '. - 'or RotatingFileHandler::FILE_PER_YEAR ("Y"), or you can set one of the '. - 'date formats using slashes, underscores and/or dots instead of dashes.' - ); - } - if (substr_count($filenameFormat, '{date}') === 0) { - throw new InvalidArgumentException( - 'Invalid filename format - format must contain at least `{date}`, because otherwise rotating is impossible.' - ); - } - $this->filenameFormat = $filenameFormat; - $this->dateFormat = $dateFormat; - $this->url = $this->getTimedFilename(); - $this->close(); - - return $this; - } - - /** - * {@inheritDoc} - */ - protected function write(array $record): void - { - // on the first record written, if the log is new, we should rotate (once per day) - if (null === $this->mustRotate) { - $this->mustRotate = null === $this->url || !file_exists($this->url); - } - - if ($this->nextRotation <= $record['datetime']) { - $this->mustRotate = true; - $this->close(); - } - - parent::write($record); - } - - /** - * Rotates the files. - */ - protected function rotate(): void - { - // update filename - $this->url = $this->getTimedFilename(); - $this->nextRotation = new \DateTimeImmutable('tomorrow'); - - // skip GC of old logs if files are unlimited - if (0 === $this->maxFiles) { - return; - } - - $logFiles = glob($this->getGlobPattern()); - if (false === $logFiles) { - // failed to glob - return; - } - - if ($this->maxFiles >= count($logFiles)) { - // no files to remove - return; - } - - // Sorting the files by name to remove the older ones - usort($logFiles, function ($a, $b) { - return strcmp($b, $a); - }); - - foreach (array_slice($logFiles, $this->maxFiles) as $file) { - if (is_writable($file)) { - // suppress errors here as unlink() might fail if two processes - // are cleaning up/rotating at the same time - set_error_handler(function (int $errno, string $errstr, string $errfile, int $errline): bool { - return false; - }); - unlink($file); - restore_error_handler(); - } - } - - $this->mustRotate = false; - } - - protected function getTimedFilename(): string - { - $fileInfo = pathinfo($this->filename); - $timedFilename = str_replace( - ['{filename}', '{date}'], - [$fileInfo['filename'], date($this->dateFormat)], - $fileInfo['dirname'] . '/' . $this->filenameFormat - ); - - if (isset($fileInfo['extension'])) { - $timedFilename .= '.'.$fileInfo['extension']; - } - - return $timedFilename; - } - - protected function getGlobPattern(): string - { - $fileInfo = pathinfo($this->filename); - $glob = str_replace( - ['{filename}', '{date}'], - [$fileInfo['filename'], str_replace( - ['Y', 'y', 'm', 'd'], - ['[0-9][0-9][0-9][0-9]', '[0-9][0-9]', '[0-9][0-9]', '[0-9][0-9]'], - $this->dateFormat) - ], - $fileInfo['dirname'] . '/' . $this->filenameFormat - ); - if (isset($fileInfo['extension'])) { - $glob .= '.'.$fileInfo['extension']; - } - - return $glob; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php deleted file mode 100644 index c128a32d..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php +++ /dev/null @@ -1,132 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\FormatterInterface; - -/** - * Sampling handler - * - * A sampled event stream can be useful for logging high frequency events in - * a production environment where you only need an idea of what is happening - * and are not concerned with capturing every occurrence. Since the decision to - * handle or not handle a particular event is determined randomly, the - * resulting sampled log is not guaranteed to contain 1/N of the events that - * occurred in the application, but based on the Law of large numbers, it will - * tend to be close to this ratio with a large number of attempts. - * - * @author Bryan Davis <bd808@wikimedia.org> - * @author Kunal Mehta <legoktm@gmail.com> - * - * @phpstan-import-type Record from \Monolog\Logger - * @phpstan-import-type Level from \Monolog\Logger - */ -class SamplingHandler extends AbstractHandler implements ProcessableHandlerInterface, FormattableHandlerInterface -{ - use ProcessableHandlerTrait; - - /** - * @var HandlerInterface|callable - * @phpstan-var HandlerInterface|callable(Record|array{level: Level}|null, HandlerInterface): HandlerInterface - */ - protected $handler; - - /** - * @var int $factor - */ - protected $factor; - - /** - * @psalm-param HandlerInterface|callable(Record|array{level: Level}|null, HandlerInterface): HandlerInterface $handler - * - * @param callable|HandlerInterface $handler Handler or factory callable($record|null, $samplingHandler). - * @param int $factor Sample factor (e.g. 10 means every ~10th record is sampled) - */ - public function __construct($handler, int $factor) - { - parent::__construct(); - $this->handler = $handler; - $this->factor = $factor; - - if (!$this->handler instanceof HandlerInterface && !is_callable($this->handler)) { - throw new \RuntimeException("The given handler (".json_encode($this->handler).") is not a callable nor a Monolog\Handler\HandlerInterface object"); - } - } - - public function isHandling(array $record): bool - { - return $this->getHandler($record)->isHandling($record); - } - - public function handle(array $record): bool - { - if ($this->isHandling($record) && mt_rand(1, $this->factor) === 1) { - if ($this->processors) { - /** @var Record $record */ - $record = $this->processRecord($record); - } - - $this->getHandler($record)->handle($record); - } - - return false === $this->bubble; - } - - /** - * Return the nested handler - * - * If the handler was provided as a factory callable, this will trigger the handler's instantiation. - * - * @phpstan-param Record|array{level: Level}|null $record - * - * @return HandlerInterface - */ - public function getHandler(array $record = null) - { - if (!$this->handler instanceof HandlerInterface) { - $this->handler = ($this->handler)($record, $this); - if (!$this->handler instanceof HandlerInterface) { - throw new \RuntimeException("The factory callable should return a HandlerInterface"); - } - } - - return $this->handler; - } - - /** - * {@inheritDoc} - */ - public function setFormatter(FormatterInterface $formatter): HandlerInterface - { - $handler = $this->getHandler(); - if ($handler instanceof FormattableHandlerInterface) { - $handler->setFormatter($formatter); - - return $this; - } - - throw new \UnexpectedValueException('The nested handler of type '.get_class($handler).' does not support formatters.'); - } - - /** - * {@inheritDoc} - */ - public function getFormatter(): FormatterInterface - { - $handler = $this->getHandler(); - if ($handler instanceof FormattableHandlerInterface) { - return $handler->getFormatter(); - } - - throw new \UnexpectedValueException('The nested handler of type '.get_class($handler).' does not support formatters.'); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SendGridHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SendGridHandler.php deleted file mode 100644 index 1280ee70..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/SendGridHandler.php +++ /dev/null @@ -1,102 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; - -/** - * SendGridrHandler uses the SendGrid API v2 function to send Log emails, more information in https://sendgrid.com/docs/API_Reference/Web_API/mail.html - * - * @author Ricardo Fontanelli <ricardo.fontanelli@hotmail.com> - */ -class SendGridHandler extends MailHandler -{ - /** - * The SendGrid API User - * @var string - */ - protected $apiUser; - - /** - * The SendGrid API Key - * @var string - */ - protected $apiKey; - - /** - * The email addresses to which the message will be sent - * @var string - */ - protected $from; - - /** - * The email addresses to which the message will be sent - * @var string[] - */ - protected $to; - - /** - * The subject of the email - * @var string - */ - protected $subject; - - /** - * @param string $apiUser The SendGrid API User - * @param string $apiKey The SendGrid API Key - * @param string $from The sender of the email - * @param string|string[] $to The recipients of the email - * @param string $subject The subject of the mail - */ - public function __construct(string $apiUser, string $apiKey, string $from, $to, string $subject, $level = Logger::ERROR, bool $bubble = true) - { - if (!extension_loaded('curl')) { - throw new MissingExtensionException('The curl extension is needed to use the SendGridHandler'); - } - - parent::__construct($level, $bubble); - $this->apiUser = $apiUser; - $this->apiKey = $apiKey; - $this->from = $from; - $this->to = (array) $to; - $this->subject = $subject; - } - - /** - * {@inheritDoc} - */ - protected function send(string $content, array $records): void - { - $message = []; - $message['api_user'] = $this->apiUser; - $message['api_key'] = $this->apiKey; - $message['from'] = $this->from; - foreach ($this->to as $recipient) { - $message['to[]'] = $recipient; - } - $message['subject'] = $this->subject; - $message['date'] = date('r'); - - if ($this->isHtmlBody($content)) { - $message['html'] = $content; - } else { - $message['text'] = $content; - } - - $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, 'https://api.sendgrid.com/api/mail.send.json'); - curl_setopt($ch, CURLOPT_POST, 1); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($message)); - Curl\Util::execute($ch, 2); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php b/vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php deleted file mode 100644 index 71a41094..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php +++ /dev/null @@ -1,387 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler\Slack; - -use Monolog\Logger; -use Monolog\Utils; -use Monolog\Formatter\NormalizerFormatter; -use Monolog\Formatter\FormatterInterface; - -/** - * Slack record utility helping to log to Slack webhooks or API. - * - * @author Greg Kedzierski <greg@gregkedzierski.com> - * @author Haralan Dobrev <hkdobrev@gmail.com> - * @see https://api.slack.com/incoming-webhooks - * @see https://api.slack.com/docs/message-attachments - * - * @phpstan-import-type FormattedRecord from \Monolog\Handler\AbstractProcessingHandler - * @phpstan-import-type Record from \Monolog\Logger - */ -class SlackRecord -{ - public const COLOR_DANGER = 'danger'; - - public const COLOR_WARNING = 'warning'; - - public const COLOR_GOOD = 'good'; - - public const COLOR_DEFAULT = '#e3e4e6'; - - /** - * Slack channel (encoded ID or name) - * @var string|null - */ - private $channel; - - /** - * Name of a bot - * @var string|null - */ - private $username; - - /** - * User icon e.g. 'ghost', 'http://example.com/user.png' - * @var string|null - */ - private $userIcon; - - /** - * Whether the message should be added to Slack as attachment (plain text otherwise) - * @var bool - */ - private $useAttachment; - - /** - * Whether the the context/extra messages added to Slack as attachments are in a short style - * @var bool - */ - private $useShortAttachment; - - /** - * Whether the attachment should include context and extra data - * @var bool - */ - private $includeContextAndExtra; - - /** - * Dot separated list of fields to exclude from slack message. E.g. ['context.field1', 'extra.field2'] - * @var string[] - */ - private $excludeFields; - - /** - * @var ?FormatterInterface - */ - private $formatter; - - /** - * @var NormalizerFormatter - */ - private $normalizerFormatter; - - /** - * @param string[] $excludeFields - */ - public function __construct( - ?string $channel = null, - ?string $username = null, - bool $useAttachment = true, - ?string $userIcon = null, - bool $useShortAttachment = false, - bool $includeContextAndExtra = false, - array $excludeFields = array(), - FormatterInterface $formatter = null - ) { - $this - ->setChannel($channel) - ->setUsername($username) - ->useAttachment($useAttachment) - ->setUserIcon($userIcon) - ->useShortAttachment($useShortAttachment) - ->includeContextAndExtra($includeContextAndExtra) - ->excludeFields($excludeFields) - ->setFormatter($formatter); - - if ($this->includeContextAndExtra) { - $this->normalizerFormatter = new NormalizerFormatter(); - } - } - - /** - * Returns required data in format that Slack - * is expecting. - * - * @phpstan-param FormattedRecord $record - * @phpstan-return mixed[] - */ - public function getSlackData(array $record): array - { - $dataArray = array(); - $record = $this->removeExcludedFields($record); - - if ($this->username) { - $dataArray['username'] = $this->username; - } - - if ($this->channel) { - $dataArray['channel'] = $this->channel; - } - - if ($this->formatter && !$this->useAttachment) { - /** @phpstan-ignore-next-line */ - $message = $this->formatter->format($record); - } else { - $message = $record['message']; - } - - if ($this->useAttachment) { - $attachment = array( - 'fallback' => $message, - 'text' => $message, - 'color' => $this->getAttachmentColor($record['level']), - 'fields' => array(), - 'mrkdwn_in' => array('fields'), - 'ts' => $record['datetime']->getTimestamp(), - 'footer' => $this->username, - 'footer_icon' => $this->userIcon, - ); - - if ($this->useShortAttachment) { - $attachment['title'] = $record['level_name']; - } else { - $attachment['title'] = 'Message'; - $attachment['fields'][] = $this->generateAttachmentField('Level', $record['level_name']); - } - - if ($this->includeContextAndExtra) { - foreach (array('extra', 'context') as $key) { - if (empty($record[$key])) { - continue; - } - - if ($this->useShortAttachment) { - $attachment['fields'][] = $this->generateAttachmentField( - (string) $key, - $record[$key] - ); - } else { - // Add all extra fields as individual fields in attachment - $attachment['fields'] = array_merge( - $attachment['fields'], - $this->generateAttachmentFields($record[$key]) - ); - } - } - } - - $dataArray['attachments'] = array($attachment); - } else { - $dataArray['text'] = $message; - } - - if ($this->userIcon) { - if (filter_var($this->userIcon, FILTER_VALIDATE_URL)) { - $dataArray['icon_url'] = $this->userIcon; - } else { - $dataArray['icon_emoji'] = ":{$this->userIcon}:"; - } - } - - return $dataArray; - } - - /** - * Returns a Slack message attachment color associated with - * provided level. - */ - public function getAttachmentColor(int $level): string - { - switch (true) { - case $level >= Logger::ERROR: - return static::COLOR_DANGER; - case $level >= Logger::WARNING: - return static::COLOR_WARNING; - case $level >= Logger::INFO: - return static::COLOR_GOOD; - default: - return static::COLOR_DEFAULT; - } - } - - /** - * Stringifies an array of key/value pairs to be used in attachment fields - * - * @param mixed[] $fields - */ - public function stringify(array $fields): string - { - /** @var Record $fields */ - $normalized = $this->normalizerFormatter->format($fields); - - $hasSecondDimension = count(array_filter($normalized, 'is_array')); - $hasNonNumericKeys = !count(array_filter(array_keys($normalized), 'is_numeric')); - - return $hasSecondDimension || $hasNonNumericKeys - ? Utils::jsonEncode($normalized, JSON_PRETTY_PRINT|Utils::DEFAULT_JSON_FLAGS) - : Utils::jsonEncode($normalized, Utils::DEFAULT_JSON_FLAGS); - } - - /** - * Channel used by the bot when posting - * - * @param ?string $channel - * - * @return static - */ - public function setChannel(?string $channel = null): self - { - $this->channel = $channel; - - return $this; - } - - /** - * Username used by the bot when posting - * - * @param ?string $username - * - * @return static - */ - public function setUsername(?string $username = null): self - { - $this->username = $username; - - return $this; - } - - public function useAttachment(bool $useAttachment = true): self - { - $this->useAttachment = $useAttachment; - - return $this; - } - - public function setUserIcon(?string $userIcon = null): self - { - $this->userIcon = $userIcon; - - if (\is_string($userIcon)) { - $this->userIcon = trim($userIcon, ':'); - } - - return $this; - } - - public function useShortAttachment(bool $useShortAttachment = false): self - { - $this->useShortAttachment = $useShortAttachment; - - return $this; - } - - public function includeContextAndExtra(bool $includeContextAndExtra = false): self - { - $this->includeContextAndExtra = $includeContextAndExtra; - - if ($this->includeContextAndExtra) { - $this->normalizerFormatter = new NormalizerFormatter(); - } - - return $this; - } - - /** - * @param string[] $excludeFields - */ - public function excludeFields(array $excludeFields = []): self - { - $this->excludeFields = $excludeFields; - - return $this; - } - - public function setFormatter(?FormatterInterface $formatter = null): self - { - $this->formatter = $formatter; - - return $this; - } - - /** - * Generates attachment field - * - * @param string|mixed[] $value - * - * @return array{title: string, value: string, short: false} - */ - private function generateAttachmentField(string $title, $value): array - { - $value = is_array($value) - ? sprintf('```%s```', substr($this->stringify($value), 0, 1990)) - : $value; - - return array( - 'title' => ucfirst($title), - 'value' => $value, - 'short' => false, - ); - } - - /** - * Generates a collection of attachment fields from array - * - * @param mixed[] $data - * - * @return array<array{title: string, value: string, short: false}> - */ - private function generateAttachmentFields(array $data): array - { - /** @var Record $data */ - $normalized = $this->normalizerFormatter->format($data); - - $fields = array(); - foreach ($normalized as $key => $value) { - $fields[] = $this->generateAttachmentField((string) $key, $value); - } - - return $fields; - } - - /** - * Get a copy of record with fields excluded according to $this->excludeFields - * - * @phpstan-param FormattedRecord $record - * - * @return mixed[] - */ - private function removeExcludedFields(array $record): array - { - foreach ($this->excludeFields as $field) { - $keys = explode('.', $field); - $node = &$record; - $lastKey = end($keys); - foreach ($keys as $key) { - if (!isset($node[$key])) { - break; - } - if ($lastKey === $key) { - unset($node[$key]); - break; - } - $node = &$node[$key]; - } - } - - return $record; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php deleted file mode 100644 index a648513e..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php +++ /dev/null @@ -1,256 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\FormatterInterface; -use Monolog\Logger; -use Monolog\Utils; -use Monolog\Handler\Slack\SlackRecord; - -/** - * Sends notifications through Slack API - * - * @author Greg Kedzierski <greg@gregkedzierski.com> - * @see https://api.slack.com/ - * - * @phpstan-import-type FormattedRecord from AbstractProcessingHandler - */ -class SlackHandler extends SocketHandler -{ - /** - * Slack API token - * @var string - */ - private $token; - - /** - * Instance of the SlackRecord util class preparing data for Slack API. - * @var SlackRecord - */ - private $slackRecord; - - /** - * @param string $token Slack API token - * @param string $channel Slack channel (encoded ID or name) - * @param string|null $username Name of a bot - * @param bool $useAttachment Whether the message should be added to Slack as attachment (plain text otherwise) - * @param string|null $iconEmoji The emoji name to use (or null) - * @param bool $useShortAttachment Whether the context/extra messages added to Slack as attachments are in a short style - * @param bool $includeContextAndExtra Whether the attachment should include context and extra data - * @param string[] $excludeFields Dot separated list of fields to exclude from slack message. E.g. ['context.field1', 'extra.field2'] - * @throws MissingExtensionException If no OpenSSL PHP extension configured - */ - public function __construct( - string $token, - string $channel, - ?string $username = null, - bool $useAttachment = true, - ?string $iconEmoji = null, - $level = Logger::CRITICAL, - bool $bubble = true, - bool $useShortAttachment = false, - bool $includeContextAndExtra = false, - array $excludeFields = array(), - bool $persistent = false, - float $timeout = 0.0, - float $writingTimeout = 10.0, - ?float $connectionTimeout = null, - ?int $chunkSize = null - ) { - if (!extension_loaded('openssl')) { - throw new MissingExtensionException('The OpenSSL PHP extension is required to use the SlackHandler'); - } - - parent::__construct( - 'ssl://slack.com:443', - $level, - $bubble, - $persistent, - $timeout, - $writingTimeout, - $connectionTimeout, - $chunkSize - ); - - $this->slackRecord = new SlackRecord( - $channel, - $username, - $useAttachment, - $iconEmoji, - $useShortAttachment, - $includeContextAndExtra, - $excludeFields - ); - - $this->token = $token; - } - - public function getSlackRecord(): SlackRecord - { - return $this->slackRecord; - } - - public function getToken(): string - { - return $this->token; - } - - /** - * {@inheritDoc} - */ - protected function generateDataStream(array $record): string - { - $content = $this->buildContent($record); - - return $this->buildHeader($content) . $content; - } - - /** - * Builds the body of API call - * - * @phpstan-param FormattedRecord $record - */ - private function buildContent(array $record): string - { - $dataArray = $this->prepareContentData($record); - - return http_build_query($dataArray); - } - - /** - * @phpstan-param FormattedRecord $record - * @return string[] - */ - protected function prepareContentData(array $record): array - { - $dataArray = $this->slackRecord->getSlackData($record); - $dataArray['token'] = $this->token; - - if (!empty($dataArray['attachments'])) { - $dataArray['attachments'] = Utils::jsonEncode($dataArray['attachments']); - } - - return $dataArray; - } - - /** - * Builds the header of the API Call - */ - private function buildHeader(string $content): string - { - $header = "POST /api/chat.postMessage HTTP/1.1\r\n"; - $header .= "Host: slack.com\r\n"; - $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; - $header .= "Content-Length: " . strlen($content) . "\r\n"; - $header .= "\r\n"; - - return $header; - } - - /** - * {@inheritDoc} - */ - protected function write(array $record): void - { - parent::write($record); - $this->finalizeWrite(); - } - - /** - * Finalizes the request by reading some bytes and then closing the socket - * - * If we do not read some but close the socket too early, slack sometimes - * drops the request entirely. - */ - protected function finalizeWrite(): void - { - $res = $this->getResource(); - if (is_resource($res)) { - @fread($res, 2048); - } - $this->closeSocket(); - } - - public function setFormatter(FormatterInterface $formatter): HandlerInterface - { - parent::setFormatter($formatter); - $this->slackRecord->setFormatter($formatter); - - return $this; - } - - public function getFormatter(): FormatterInterface - { - $formatter = parent::getFormatter(); - $this->slackRecord->setFormatter($formatter); - - return $formatter; - } - - /** - * Channel used by the bot when posting - */ - public function setChannel(string $channel): self - { - $this->slackRecord->setChannel($channel); - - return $this; - } - - /** - * Username used by the bot when posting - */ - public function setUsername(string $username): self - { - $this->slackRecord->setUsername($username); - - return $this; - } - - public function useAttachment(bool $useAttachment): self - { - $this->slackRecord->useAttachment($useAttachment); - - return $this; - } - - public function setIconEmoji(string $iconEmoji): self - { - $this->slackRecord->setUserIcon($iconEmoji); - - return $this; - } - - public function useShortAttachment(bool $useShortAttachment): self - { - $this->slackRecord->useShortAttachment($useShortAttachment); - - return $this; - } - - public function includeContextAndExtra(bool $includeContextAndExtra): self - { - $this->slackRecord->includeContextAndExtra($includeContextAndExtra); - - return $this; - } - - /** - * @param string[] $excludeFields - */ - public function excludeFields(array $excludeFields): self - { - $this->slackRecord->excludeFields($excludeFields); - - return $this; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php deleted file mode 100644 index 8ae3c788..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php +++ /dev/null @@ -1,130 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\FormatterInterface; -use Monolog\Logger; -use Monolog\Utils; -use Monolog\Handler\Slack\SlackRecord; - -/** - * Sends notifications through Slack Webhooks - * - * @author Haralan Dobrev <hkdobrev@gmail.com> - * @see https://api.slack.com/incoming-webhooks - */ -class SlackWebhookHandler extends AbstractProcessingHandler -{ - /** - * Slack Webhook token - * @var string - */ - private $webhookUrl; - - /** - * Instance of the SlackRecord util class preparing data for Slack API. - * @var SlackRecord - */ - private $slackRecord; - - /** - * @param string $webhookUrl Slack Webhook URL - * @param string|null $channel Slack channel (encoded ID or name) - * @param string|null $username Name of a bot - * @param bool $useAttachment Whether the message should be added to Slack as attachment (plain text otherwise) - * @param string|null $iconEmoji The emoji name to use (or null) - * @param bool $useShortAttachment Whether the the context/extra messages added to Slack as attachments are in a short style - * @param bool $includeContextAndExtra Whether the attachment should include context and extra data - * @param string[] $excludeFields Dot separated list of fields to exclude from slack message. E.g. ['context.field1', 'extra.field2'] - */ - public function __construct( - string $webhookUrl, - ?string $channel = null, - ?string $username = null, - bool $useAttachment = true, - ?string $iconEmoji = null, - bool $useShortAttachment = false, - bool $includeContextAndExtra = false, - $level = Logger::CRITICAL, - bool $bubble = true, - array $excludeFields = array() - ) { - if (!extension_loaded('curl')) { - throw new MissingExtensionException('The curl extension is needed to use the SlackWebhookHandler'); - } - - parent::__construct($level, $bubble); - - $this->webhookUrl = $webhookUrl; - - $this->slackRecord = new SlackRecord( - $channel, - $username, - $useAttachment, - $iconEmoji, - $useShortAttachment, - $includeContextAndExtra, - $excludeFields - ); - } - - public function getSlackRecord(): SlackRecord - { - return $this->slackRecord; - } - - public function getWebhookUrl(): string - { - return $this->webhookUrl; - } - - /** - * {@inheritDoc} - */ - protected function write(array $record): void - { - $postData = $this->slackRecord->getSlackData($record); - $postString = Utils::jsonEncode($postData); - - $ch = curl_init(); - $options = array( - CURLOPT_URL => $this->webhookUrl, - CURLOPT_POST => true, - CURLOPT_RETURNTRANSFER => true, - CURLOPT_HTTPHEADER => array('Content-type: application/json'), - CURLOPT_POSTFIELDS => $postString, - ); - if (defined('CURLOPT_SAFE_UPLOAD')) { - $options[CURLOPT_SAFE_UPLOAD] = true; - } - - curl_setopt_array($ch, $options); - - Curl\Util::execute($ch); - } - - public function setFormatter(FormatterInterface $formatter): HandlerInterface - { - parent::setFormatter($formatter); - $this->slackRecord->setFormatter($formatter); - - return $this; - } - - public function getFormatter(): FormatterInterface - { - $formatter = parent::getFormatter(); - $this->slackRecord->setFormatter($formatter); - - return $formatter; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php deleted file mode 100644 index 21701afa..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php +++ /dev/null @@ -1,448 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; - -/** - * Stores to any socket - uses fsockopen() or pfsockopen(). - * - * @author Pablo de Leon Belloc <pablolb@gmail.com> - * @see http://php.net/manual/en/function.fsockopen.php - * - * @phpstan-import-type Record from \Monolog\Logger - * @phpstan-import-type FormattedRecord from AbstractProcessingHandler - */ -class SocketHandler extends AbstractProcessingHandler -{ - /** @var string */ - private $connectionString; - /** @var float */ - private $connectionTimeout; - /** @var resource|null */ - private $resource; - /** @var float */ - private $timeout; - /** @var float */ - private $writingTimeout; - /** @var ?int */ - private $lastSentBytes = null; - /** @var ?int */ - private $chunkSize; - /** @var bool */ - private $persistent; - /** @var ?int */ - private $errno = null; - /** @var ?string */ - private $errstr = null; - /** @var ?float */ - private $lastWritingAt = null; - - /** - * @param string $connectionString Socket connection string - * @param bool $persistent Flag to enable/disable persistent connections - * @param float $timeout Socket timeout to wait until the request is being aborted - * @param float $writingTimeout Socket timeout to wait until the request should've been sent/written - * @param float|null $connectionTimeout Socket connect timeout to wait until the connection should've been - * established - * @param int|null $chunkSize Sets the chunk size. Only has effect during connection in the writing cycle - * - * @throws \InvalidArgumentException If an invalid timeout value (less than 0) is passed. - */ - public function __construct( - string $connectionString, - $level = Logger::DEBUG, - bool $bubble = true, - bool $persistent = false, - float $timeout = 0.0, - float $writingTimeout = 10.0, - ?float $connectionTimeout = null, - ?int $chunkSize = null - ) { - parent::__construct($level, $bubble); - $this->connectionString = $connectionString; - - if ($connectionTimeout !== null) { - $this->validateTimeout($connectionTimeout); - } - - $this->connectionTimeout = $connectionTimeout ?? (float) ini_get('default_socket_timeout'); - $this->persistent = $persistent; - $this->validateTimeout($timeout); - $this->timeout = $timeout; - $this->validateTimeout($writingTimeout); - $this->writingTimeout = $writingTimeout; - $this->chunkSize = $chunkSize; - } - - /** - * Connect (if necessary) and write to the socket - * - * {@inheritDoc} - * - * @throws \UnexpectedValueException - * @throws \RuntimeException - */ - protected function write(array $record): void - { - $this->connectIfNotConnected(); - $data = $this->generateDataStream($record); - $this->writeToSocket($data); - } - - /** - * We will not close a PersistentSocket instance so it can be reused in other requests. - */ - public function close(): void - { - if (!$this->isPersistent()) { - $this->closeSocket(); - } - } - - /** - * Close socket, if open - */ - public function closeSocket(): void - { - if (is_resource($this->resource)) { - fclose($this->resource); - $this->resource = null; - } - } - - /** - * Set socket connection to be persistent. It only has effect before the connection is initiated. - */ - public function setPersistent(bool $persistent): self - { - $this->persistent = $persistent; - - return $this; - } - - /** - * Set connection timeout. Only has effect before we connect. - * - * @see http://php.net/manual/en/function.fsockopen.php - */ - public function setConnectionTimeout(float $seconds): self - { - $this->validateTimeout($seconds); - $this->connectionTimeout = $seconds; - - return $this; - } - - /** - * Set write timeout. Only has effect before we connect. - * - * @see http://php.net/manual/en/function.stream-set-timeout.php - */ - public function setTimeout(float $seconds): self - { - $this->validateTimeout($seconds); - $this->timeout = $seconds; - - return $this; - } - - /** - * Set writing timeout. Only has effect during connection in the writing cycle. - * - * @param float $seconds 0 for no timeout - */ - public function setWritingTimeout(float $seconds): self - { - $this->validateTimeout($seconds); - $this->writingTimeout = $seconds; - - return $this; - } - - /** - * Set chunk size. Only has effect during connection in the writing cycle. - */ - public function setChunkSize(int $bytes): self - { - $this->chunkSize = $bytes; - - return $this; - } - - /** - * Get current connection string - */ - public function getConnectionString(): string - { - return $this->connectionString; - } - - /** - * Get persistent setting - */ - public function isPersistent(): bool - { - return $this->persistent; - } - - /** - * Get current connection timeout setting - */ - public function getConnectionTimeout(): float - { - return $this->connectionTimeout; - } - - /** - * Get current in-transfer timeout - */ - public function getTimeout(): float - { - return $this->timeout; - } - - /** - * Get current local writing timeout - * - * @return float - */ - public function getWritingTimeout(): float - { - return $this->writingTimeout; - } - - /** - * Get current chunk size - */ - public function getChunkSize(): ?int - { - return $this->chunkSize; - } - - /** - * Check to see if the socket is currently available. - * - * UDP might appear to be connected but might fail when writing. See http://php.net/fsockopen for details. - */ - public function isConnected(): bool - { - return is_resource($this->resource) - && !feof($this->resource); // on TCP - other party can close connection. - } - - /** - * Wrapper to allow mocking - * - * @return resource|false - */ - protected function pfsockopen() - { - return @pfsockopen($this->connectionString, -1, $this->errno, $this->errstr, $this->connectionTimeout); - } - - /** - * Wrapper to allow mocking - * - * @return resource|false - */ - protected function fsockopen() - { - return @fsockopen($this->connectionString, -1, $this->errno, $this->errstr, $this->connectionTimeout); - } - - /** - * Wrapper to allow mocking - * - * @see http://php.net/manual/en/function.stream-set-timeout.php - * - * @return bool - */ - protected function streamSetTimeout() - { - $seconds = floor($this->timeout); - $microseconds = round(($this->timeout - $seconds) * 1e6); - - if (!is_resource($this->resource)) { - throw new \LogicException('streamSetTimeout called but $this->resource is not a resource'); - } - - return stream_set_timeout($this->resource, (int) $seconds, (int) $microseconds); - } - - /** - * Wrapper to allow mocking - * - * @see http://php.net/manual/en/function.stream-set-chunk-size.php - * - * @return int|bool - */ - protected function streamSetChunkSize() - { - if (!is_resource($this->resource)) { - throw new \LogicException('streamSetChunkSize called but $this->resource is not a resource'); - } - - if (null === $this->chunkSize) { - throw new \LogicException('streamSetChunkSize called but $this->chunkSize is not set'); - } - - return stream_set_chunk_size($this->resource, $this->chunkSize); - } - - /** - * Wrapper to allow mocking - * - * @return int|bool - */ - protected function fwrite(string $data) - { - if (!is_resource($this->resource)) { - throw new \LogicException('fwrite called but $this->resource is not a resource'); - } - - return @fwrite($this->resource, $data); - } - - /** - * Wrapper to allow mocking - * - * @return mixed[]|bool - */ - protected function streamGetMetadata() - { - if (!is_resource($this->resource)) { - throw new \LogicException('streamGetMetadata called but $this->resource is not a resource'); - } - - return stream_get_meta_data($this->resource); - } - - private function validateTimeout(float $value): void - { - if ($value < 0) { - throw new \InvalidArgumentException("Timeout must be 0 or a positive float (got $value)"); - } - } - - private function connectIfNotConnected(): void - { - if ($this->isConnected()) { - return; - } - $this->connect(); - } - - /** - * @phpstan-param FormattedRecord $record - */ - protected function generateDataStream(array $record): string - { - return (string) $record['formatted']; - } - - /** - * @return resource|null - */ - protected function getResource() - { - return $this->resource; - } - - private function connect(): void - { - $this->createSocketResource(); - $this->setSocketTimeout(); - $this->setStreamChunkSize(); - } - - private function createSocketResource(): void - { - if ($this->isPersistent()) { - $resource = $this->pfsockopen(); - } else { - $resource = $this->fsockopen(); - } - if (is_bool($resource)) { - throw new \UnexpectedValueException("Failed connecting to $this->connectionString ($this->errno: $this->errstr)"); - } - $this->resource = $resource; - } - - private function setSocketTimeout(): void - { - if (!$this->streamSetTimeout()) { - throw new \UnexpectedValueException("Failed setting timeout with stream_set_timeout()"); - } - } - - private function setStreamChunkSize(): void - { - if ($this->chunkSize && !$this->streamSetChunkSize()) { - throw new \UnexpectedValueException("Failed setting chunk size with stream_set_chunk_size()"); - } - } - - private function writeToSocket(string $data): void - { - $length = strlen($data); - $sent = 0; - $this->lastSentBytes = $sent; - while ($this->isConnected() && $sent < $length) { - if (0 == $sent) { - $chunk = $this->fwrite($data); - } else { - $chunk = $this->fwrite(substr($data, $sent)); - } - if ($chunk === false) { - throw new \RuntimeException("Could not write to socket"); - } - $sent += $chunk; - $socketInfo = $this->streamGetMetadata(); - if (is_array($socketInfo) && $socketInfo['timed_out']) { - throw new \RuntimeException("Write timed-out"); - } - - if ($this->writingIsTimedOut($sent)) { - throw new \RuntimeException("Write timed-out, no data sent for `{$this->writingTimeout}` seconds, probably we got disconnected (sent $sent of $length)"); - } - } - if (!$this->isConnected() && $sent < $length) { - throw new \RuntimeException("End-of-file reached, probably we got disconnected (sent $sent of $length)"); - } - } - - private function writingIsTimedOut(int $sent): bool - { - // convert to ms - if (0.0 == $this->writingTimeout) { - return false; - } - - if ($sent !== $this->lastSentBytes) { - $this->lastWritingAt = microtime(true); - $this->lastSentBytes = $sent; - - return false; - } else { - usleep(100); - } - - if ((microtime(true) - $this->lastWritingAt) >= $this->writingTimeout) { - $this->closeSocket(); - - return true; - } - - return false; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SqsHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SqsHandler.php deleted file mode 100644 index dcf282b4..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/SqsHandler.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Aws\Sqs\SqsClient; -use Monolog\Logger; -use Monolog\Utils; - -/** - * Writes to any sqs queue. - * - * @author Martijn van Calker <git@amvc.nl> - */ -class SqsHandler extends AbstractProcessingHandler -{ - /** 256 KB in bytes - maximum message size in SQS */ - protected const MAX_MESSAGE_SIZE = 262144; - /** 100 KB in bytes - head message size for new error log */ - protected const HEAD_MESSAGE_SIZE = 102400; - - /** @var SqsClient */ - private $client; - /** @var string */ - private $queueUrl; - - public function __construct(SqsClient $sqsClient, string $queueUrl, $level = Logger::DEBUG, bool $bubble = true) - { - parent::__construct($level, $bubble); - - $this->client = $sqsClient; - $this->queueUrl = $queueUrl; - } - - /** - * {@inheritDoc} - */ - protected function write(array $record): void - { - if (!isset($record['formatted']) || 'string' !== gettype($record['formatted'])) { - throw new \InvalidArgumentException('SqsHandler accepts only formatted records as a string' . Utils::getRecordMessageForException($record)); - } - - $messageBody = $record['formatted']; - if (strlen($messageBody) >= static::MAX_MESSAGE_SIZE) { - $messageBody = Utils::substr($messageBody, 0, static::HEAD_MESSAGE_SIZE); - } - - $this->client->sendMessage([ - 'QueueUrl' => $this->queueUrl, - 'MessageBody' => $messageBody, - ]); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php deleted file mode 100644 index 65183512..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php +++ /dev/null @@ -1,221 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Utils; - -/** - * Stores to any stream resource - * - * Can be used to store into php://stderr, remote and local files, etc. - * - * @author Jordi Boggiano <j.boggiano@seld.be> - * - * @phpstan-import-type FormattedRecord from AbstractProcessingHandler - */ -class StreamHandler extends AbstractProcessingHandler -{ - /** @const int */ - protected const MAX_CHUNK_SIZE = 2147483647; - /** @const int 10MB */ - protected const DEFAULT_CHUNK_SIZE = 10 * 1024 * 1024; - /** @var int */ - protected $streamChunkSize; - /** @var resource|null */ - protected $stream; - /** @var ?string */ - protected $url = null; - /** @var ?string */ - private $errorMessage = null; - /** @var ?int */ - protected $filePermission; - /** @var bool */ - protected $useLocking; - /** @var true|null */ - private $dirCreated = null; - - /** - * @param resource|string $stream If a missing path can't be created, an UnexpectedValueException will be thrown on first write - * @param int|null $filePermission Optional file permissions (default (0644) are only for owner read/write) - * @param bool $useLocking Try to lock log file before doing any writes - * - * @throws \InvalidArgumentException If stream is not a resource or string - */ - public function __construct($stream, $level = Logger::DEBUG, bool $bubble = true, ?int $filePermission = null, bool $useLocking = false) - { - parent::__construct($level, $bubble); - - if (($phpMemoryLimit = Utils::expandIniShorthandBytes(ini_get('memory_limit'))) !== false) { - if ($phpMemoryLimit > 0) { - // use max 10% of allowed memory for the chunk size, and at least 100KB - $this->streamChunkSize = min(static::MAX_CHUNK_SIZE, max((int) ($phpMemoryLimit / 10), 100 * 1024)); - } else { - // memory is unlimited, set to the default 10MB - $this->streamChunkSize = static::DEFAULT_CHUNK_SIZE; - } - } else { - // no memory limit information, set to the default 10MB - $this->streamChunkSize = static::DEFAULT_CHUNK_SIZE; - } - - if (is_resource($stream)) { - $this->stream = $stream; - - stream_set_chunk_size($this->stream, $this->streamChunkSize); - } elseif (is_string($stream)) { - $this->url = Utils::canonicalizePath($stream); - } else { - throw new \InvalidArgumentException('A stream must either be a resource or a string.'); - } - - $this->filePermission = $filePermission; - $this->useLocking = $useLocking; - } - - /** - * {@inheritDoc} - */ - public function close(): void - { - if ($this->url && is_resource($this->stream)) { - fclose($this->stream); - } - $this->stream = null; - $this->dirCreated = null; - } - - /** - * Return the currently active stream if it is open - * - * @return resource|null - */ - public function getStream() - { - return $this->stream; - } - - /** - * Return the stream URL if it was configured with a URL and not an active resource - * - * @return string|null - */ - public function getUrl(): ?string - { - return $this->url; - } - - /** - * @return int - */ - public function getStreamChunkSize(): int - { - return $this->streamChunkSize; - } - - /** - * {@inheritDoc} - */ - protected function write(array $record): void - { - if (!is_resource($this->stream)) { - $url = $this->url; - if (null === $url || '' === $url) { - throw new \LogicException('Missing stream url, the stream can not be opened. This may be caused by a premature call to close().' . Utils::getRecordMessageForException($record)); - } - $this->createDir($url); - $this->errorMessage = null; - set_error_handler([$this, 'customErrorHandler']); - $stream = fopen($url, 'a'); - if ($this->filePermission !== null) { - @chmod($url, $this->filePermission); - } - restore_error_handler(); - if (!is_resource($stream)) { - $this->stream = null; - - throw new \UnexpectedValueException(sprintf('The stream or file "%s" could not be opened in append mode: '.$this->errorMessage, $url) . Utils::getRecordMessageForException($record)); - } - stream_set_chunk_size($stream, $this->streamChunkSize); - $this->stream = $stream; - } - - $stream = $this->stream; - if (!is_resource($stream)) { - throw new \LogicException('No stream was opened yet' . Utils::getRecordMessageForException($record)); - } - - if ($this->useLocking) { - // ignoring errors here, there's not much we can do about them - flock($stream, LOCK_EX); - } - - $this->streamWrite($stream, $record); - - if ($this->useLocking) { - flock($stream, LOCK_UN); - } - } - - /** - * Write to stream - * @param resource $stream - * @param array $record - * - * @phpstan-param FormattedRecord $record - */ - protected function streamWrite($stream, array $record): void - { - fwrite($stream, (string) $record['formatted']); - } - - private function customErrorHandler(int $code, string $msg): bool - { - $this->errorMessage = preg_replace('{^(fopen|mkdir)\(.*?\): }', '', $msg); - - return true; - } - - private function getDirFromStream(string $stream): ?string - { - $pos = strpos($stream, '://'); - if ($pos === false) { - return dirname($stream); - } - - if ('file://' === substr($stream, 0, 7)) { - return dirname(substr($stream, 7)); - } - - return null; - } - - private function createDir(string $url): void - { - // Do not try to create dir if it has already been tried. - if ($this->dirCreated) { - return; - } - - $dir = $this->getDirFromStream($url); - if (null !== $dir && !is_dir($dir)) { - $this->errorMessage = null; - set_error_handler([$this, 'customErrorHandler']); - $status = mkdir($dir, 0777, true); - restore_error_handler(); - if (false === $status && !is_dir($dir) && strpos((string) $this->errorMessage, 'File exists') === false) { - throw new \UnexpectedValueException(sprintf('There is no existing directory at "%s" and it could not be created: '.$this->errorMessage, $dir)); - } - } - $this->dirCreated = true; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php deleted file mode 100644 index fae92514..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php +++ /dev/null @@ -1,115 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Utils; -use Monolog\Formatter\FormatterInterface; -use Monolog\Formatter\LineFormatter; -use Swift_Message; -use Swift; - -/** - * SwiftMailerHandler uses Swift_Mailer to send the emails - * - * @author Gyula Sallai - * - * @phpstan-import-type Record from \Monolog\Logger - * @deprecated Since Monolog 2.6. Use SymfonyMailerHandler instead. - */ -class SwiftMailerHandler extends MailHandler -{ - /** @var \Swift_Mailer */ - protected $mailer; - /** @var Swift_Message|callable(string, Record[]): Swift_Message */ - private $messageTemplate; - - /** - * @psalm-param Swift_Message|callable(string, Record[]): Swift_Message $message - * - * @param \Swift_Mailer $mailer The mailer to use - * @param callable|Swift_Message $message An example message for real messages, only the body will be replaced - */ - public function __construct(\Swift_Mailer $mailer, $message, $level = Logger::ERROR, bool $bubble = true) - { - parent::__construct($level, $bubble); - - @trigger_error('The SwiftMailerHandler is deprecated since Monolog 2.6. Use SymfonyMailerHandler instead.', E_USER_DEPRECATED); - - $this->mailer = $mailer; - $this->messageTemplate = $message; - } - - /** - * {@inheritDoc} - */ - protected function send(string $content, array $records): void - { - $this->mailer->send($this->buildMessage($content, $records)); - } - - /** - * Gets the formatter for the Swift_Message subject. - * - * @param string|null $format The format of the subject - */ - protected function getSubjectFormatter(?string $format): FormatterInterface - { - return new LineFormatter($format); - } - - /** - * Creates instance of Swift_Message to be sent - * - * @param string $content formatted email body to be sent - * @param array $records Log records that formed the content - * @return Swift_Message - * - * @phpstan-param Record[] $records - */ - protected function buildMessage(string $content, array $records): Swift_Message - { - $message = null; - if ($this->messageTemplate instanceof Swift_Message) { - $message = clone $this->messageTemplate; - $message->generateId(); - } elseif (is_callable($this->messageTemplate)) { - $message = ($this->messageTemplate)($content, $records); - } - - if (!$message instanceof Swift_Message) { - $record = reset($records); - throw new \InvalidArgumentException('Could not resolve message as instance of Swift_Message or a callable returning it' . ($record ? Utils::getRecordMessageForException($record) : '')); - } - - if ($records) { - $subjectFormatter = $this->getSubjectFormatter($message->getSubject()); - $message->setSubject($subjectFormatter->format($this->getHighestRecord($records))); - } - - $mime = 'text/plain'; - if ($this->isHtmlBody($content)) { - $mime = 'text/html'; - } - - $message->setBody($content, $mime); - /** @phpstan-ignore-next-line */ - if (version_compare(Swift::VERSION, '6.0.0', '>=')) { - $message->setDate(new \DateTimeImmutable()); - } else { - /** @phpstan-ignore-next-line */ - $message->setDate(time()); - } - - return $message; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SymfonyMailerHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SymfonyMailerHandler.php deleted file mode 100644 index 130e6f1f..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/SymfonyMailerHandler.php +++ /dev/null @@ -1,111 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Utils; -use Monolog\Formatter\FormatterInterface; -use Monolog\Formatter\LineFormatter; -use Symfony\Component\Mailer\MailerInterface; -use Symfony\Component\Mailer\Transport\TransportInterface; -use Symfony\Component\Mime\Email; - -/** - * SymfonyMailerHandler uses Symfony's Mailer component to send the emails - * - * @author Jordi Boggiano <j.boggiano@seld.be> - * - * @phpstan-import-type Record from \Monolog\Logger - */ -class SymfonyMailerHandler extends MailHandler -{ - /** @var MailerInterface|TransportInterface */ - protected $mailer; - /** @var Email|callable(string, Record[]): Email */ - private $emailTemplate; - - /** - * @psalm-param Email|callable(string, Record[]): Email $email - * - * @param MailerInterface|TransportInterface $mailer The mailer to use - * @param callable|Email $email An email template, the subject/body will be replaced - */ - public function __construct($mailer, $email, $level = Logger::ERROR, bool $bubble = true) - { - parent::__construct($level, $bubble); - - $this->mailer = $mailer; - $this->emailTemplate = $email; - } - - /** - * {@inheritDoc} - */ - protected function send(string $content, array $records): void - { - $this->mailer->send($this->buildMessage($content, $records)); - } - - /** - * Gets the formatter for the Swift_Message subject. - * - * @param string|null $format The format of the subject - */ - protected function getSubjectFormatter(?string $format): FormatterInterface - { - return new LineFormatter($format); - } - - /** - * Creates instance of Email to be sent - * - * @param string $content formatted email body to be sent - * @param array $records Log records that formed the content - * - * @phpstan-param Record[] $records - */ - protected function buildMessage(string $content, array $records): Email - { - $message = null; - if ($this->emailTemplate instanceof Email) { - $message = clone $this->emailTemplate; - } elseif (is_callable($this->emailTemplate)) { - $message = ($this->emailTemplate)($content, $records); - } - - if (!$message instanceof Email) { - $record = reset($records); - throw new \InvalidArgumentException('Could not resolve message as instance of Email or a callable returning it' . ($record ? Utils::getRecordMessageForException($record) : '')); - } - - if ($records) { - $subjectFormatter = $this->getSubjectFormatter($message->getSubject()); - $message->subject($subjectFormatter->format($this->getHighestRecord($records))); - } - - if ($this->isHtmlBody($content)) { - if (null !== ($charset = $message->getHtmlCharset())) { - $message->html($content, $charset); - } else { - $message->html($content); - } - } else { - if (null !== ($charset = $message->getTextCharset())) { - $message->text($content, $charset); - } else { - $message->text($content); - } - } - - return $message->date(new \DateTimeImmutable()); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SyslogHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SyslogHandler.php deleted file mode 100644 index 1d543b7e..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/SyslogHandler.php +++ /dev/null @@ -1,68 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Utils; - -/** - * Logs to syslog service. - * - * usage example: - * - * $log = new Logger('application'); - * $syslog = new SyslogHandler('myfacility', 'local6'); - * $formatter = new LineFormatter("%channel%.%level_name%: %message% %extra%"); - * $syslog->setFormatter($formatter); - * $log->pushHandler($syslog); - * - * @author Sven Paulus <sven@karlsruhe.org> - */ -class SyslogHandler extends AbstractSyslogHandler -{ - /** @var string */ - protected $ident; - /** @var int */ - protected $logopts; - - /** - * @param string $ident - * @param string|int $facility Either one of the names of the keys in $this->facilities, or a LOG_* facility constant - * @param int $logopts Option flags for the openlog() call, defaults to LOG_PID - */ - public function __construct(string $ident, $facility = LOG_USER, $level = Logger::DEBUG, bool $bubble = true, int $logopts = LOG_PID) - { - parent::__construct($facility, $level, $bubble); - - $this->ident = $ident; - $this->logopts = $logopts; - } - - /** - * {@inheritDoc} - */ - public function close(): void - { - closelog(); - } - - /** - * {@inheritDoc} - */ - protected function write(array $record): void - { - if (!openlog($this->ident, $this->logopts, $this->facility)) { - throw new \LogicException('Can\'t open syslog for ident "'.$this->ident.'" and facility "'.$this->facility.'"' . Utils::getRecordMessageForException($record)); - } - syslog($this->logLevels[$record['level']], (string) $record['formatted']); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php b/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php deleted file mode 100644 index dbd8ef69..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php +++ /dev/null @@ -1,88 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler\SyslogUdp; - -use Monolog\Utils; -use Socket; - -class UdpSocket -{ - protected const DATAGRAM_MAX_LENGTH = 65023; - - /** @var string */ - protected $ip; - /** @var int */ - protected $port; - /** @var resource|Socket|null */ - protected $socket = null; - - public function __construct(string $ip, int $port = 514) - { - $this->ip = $ip; - $this->port = $port; - } - - /** - * @param string $line - * @param string $header - * @return void - */ - public function write($line, $header = "") - { - $this->send($this->assembleMessage($line, $header)); - } - - public function close(): void - { - if (is_resource($this->socket) || $this->socket instanceof Socket) { - socket_close($this->socket); - $this->socket = null; - } - } - - /** - * @return resource|Socket - */ - protected function getSocket() - { - if (null !== $this->socket) { - return $this->socket; - } - - $domain = AF_INET; - $protocol = SOL_UDP; - // Check if we are using unix sockets. - if ($this->port === 0) { - $domain = AF_UNIX; - $protocol = IPPROTO_IP; - } - - $this->socket = socket_create($domain, SOCK_DGRAM, $protocol) ?: null; - if (null === $this->socket) { - throw new \RuntimeException('The UdpSocket to '.$this->ip.':'.$this->port.' could not be opened via socket_create'); - } - - return $this->socket; - } - - protected function send(string $chunk): void - { - socket_sendto($this->getSocket(), $chunk, strlen($chunk), $flags = 0, $this->ip, $this->port); - } - - protected function assembleMessage(string $line, string $header): string - { - $chunkSize = static::DATAGRAM_MAX_LENGTH - strlen($header); - - return $header . Utils::substr($line, 0, $chunkSize); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php deleted file mode 100644 index deaa19f8..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php +++ /dev/null @@ -1,150 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use DateTimeInterface; -use Monolog\Logger; -use Monolog\Handler\SyslogUdp\UdpSocket; -use Monolog\Utils; - -/** - * A Handler for logging to a remote syslogd server. - * - * @author Jesper Skovgaard Nielsen <nulpunkt@gmail.com> - * @author Dominik Kukacka <dominik.kukacka@gmail.com> - */ -class SyslogUdpHandler extends AbstractSyslogHandler -{ - const RFC3164 = 0; - const RFC5424 = 1; - const RFC5424e = 2; - - /** @var array<self::RFC*, string> */ - private $dateFormats = array( - self::RFC3164 => 'M d H:i:s', - self::RFC5424 => \DateTime::RFC3339, - self::RFC5424e => \DateTime::RFC3339_EXTENDED, - ); - - /** @var UdpSocket */ - protected $socket; - /** @var string */ - protected $ident; - /** @var self::RFC* */ - protected $rfc; - - /** - * @param string $host Either IP/hostname or a path to a unix socket (port must be 0 then) - * @param int $port Port number, or 0 if $host is a unix socket - * @param string|int $facility Either one of the names of the keys in $this->facilities, or a LOG_* facility constant - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - * @param string $ident Program name or tag for each log message. - * @param int $rfc RFC to format the message for. - * @throws MissingExtensionException - * - * @phpstan-param self::RFC* $rfc - */ - public function __construct(string $host, int $port = 514, $facility = LOG_USER, $level = Logger::DEBUG, bool $bubble = true, string $ident = 'php', int $rfc = self::RFC5424) - { - if (!extension_loaded('sockets')) { - throw new MissingExtensionException('The sockets extension is required to use the SyslogUdpHandler'); - } - - parent::__construct($facility, $level, $bubble); - - $this->ident = $ident; - $this->rfc = $rfc; - - $this->socket = new UdpSocket($host, $port); - } - - protected function write(array $record): void - { - $lines = $this->splitMessageIntoLines($record['formatted']); - - $header = $this->makeCommonSyslogHeader($this->logLevels[$record['level']], $record['datetime']); - - foreach ($lines as $line) { - $this->socket->write($line, $header); - } - } - - public function close(): void - { - $this->socket->close(); - } - - /** - * @param string|string[] $message - * @return string[] - */ - private function splitMessageIntoLines($message): array - { - if (is_array($message)) { - $message = implode("\n", $message); - } - - $lines = preg_split('/$\R?^/m', (string) $message, -1, PREG_SPLIT_NO_EMPTY); - if (false === $lines) { - $pcreErrorCode = preg_last_error(); - throw new \RuntimeException('Could not preg_split: ' . $pcreErrorCode . ' / ' . Utils::pcreLastErrorMessage($pcreErrorCode)); - } - - return $lines; - } - - /** - * Make common syslog header (see rfc5424 or rfc3164) - */ - protected function makeCommonSyslogHeader(int $severity, DateTimeInterface $datetime): string - { - $priority = $severity + $this->facility; - - if (!$pid = getmypid()) { - $pid = '-'; - } - - if (!$hostname = gethostname()) { - $hostname = '-'; - } - - if ($this->rfc === self::RFC3164) { - // see https://github.com/phpstan/phpstan/issues/5348 - // @phpstan-ignore-next-line - $dateNew = $datetime->setTimezone(new \DateTimeZone('UTC')); - $date = $dateNew->format($this->dateFormats[$this->rfc]); - - return "<$priority>" . - $date . " " . - $hostname . " " . - $this->ident . "[" . $pid . "]: "; - } - - $date = $datetime->format($this->dateFormats[$this->rfc]); - - return "<$priority>1 " . - $date . " " . - $hostname . " " . - $this->ident . " " . - $pid . " - - "; - } - - /** - * Inject your own socket, mainly used for testing - */ - public function setSocket(UdpSocket $socket): self - { - $this->socket = $socket; - - return $this; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/TelegramBotHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/TelegramBotHandler.php deleted file mode 100644 index 8912eba5..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/TelegramBotHandler.php +++ /dev/null @@ -1,274 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use RuntimeException; -use Monolog\Logger; -use Monolog\Utils; - -/** - * Handler send logs to Telegram using Telegram Bot API. - * - * How to use: - * 1) Create telegram bot with https://telegram.me/BotFather - * 2) Create a telegram channel where logs will be recorded. - * 3) Add created bot from step 1 to the created channel from step 2. - * - * Use telegram bot API key from step 1 and channel name with '@' prefix from step 2 to create instance of TelegramBotHandler - * - * @link https://core.telegram.org/bots/api - * - * @author Mazur Alexandr <alexandrmazur96@gmail.com> - * - * @phpstan-import-type Record from \Monolog\Logger - */ -class TelegramBotHandler extends AbstractProcessingHandler -{ - private const BOT_API = 'https://api.telegram.org/bot'; - - /** - * The available values of parseMode according to the Telegram api documentation - */ - private const AVAILABLE_PARSE_MODES = [ - 'HTML', - 'MarkdownV2', - 'Markdown', // legacy mode without underline and strikethrough, use MarkdownV2 instead - ]; - - /** - * The maximum number of characters allowed in a message according to the Telegram api documentation - */ - private const MAX_MESSAGE_LENGTH = 4096; - - /** - * Telegram bot access token provided by BotFather. - * Create telegram bot with https://telegram.me/BotFather and use access token from it. - * @var string - */ - private $apiKey; - - /** - * Telegram channel name. - * Since to start with '@' symbol as prefix. - * @var string - */ - private $channel; - - /** - * The kind of formatting that is used for the message. - * See available options at https://core.telegram.org/bots/api#formatting-options - * or in AVAILABLE_PARSE_MODES - * @var ?string - */ - private $parseMode; - - /** - * Disables link previews for links in the message. - * @var ?bool - */ - private $disableWebPagePreview; - - /** - * Sends the message silently. Users will receive a notification with no sound. - * @var ?bool - */ - private $disableNotification; - - /** - * True - split a message longer than MAX_MESSAGE_LENGTH into parts and send in multiple messages. - * False - truncates a message that is too long. - * @var bool - */ - private $splitLongMessages; - - /** - * Adds 1-second delay between sending a split message (according to Telegram API to avoid 429 Too Many Requests). - * @var bool - */ - private $delayBetweenMessages; - - /** - * @param string $apiKey Telegram bot access token provided by BotFather - * @param string $channel Telegram channel name - * @param bool $splitLongMessages Split a message longer than MAX_MESSAGE_LENGTH into parts and send in multiple messages - * @param bool $delayBetweenMessages Adds delay between sending a split message according to Telegram API - * @throws MissingExtensionException - */ - public function __construct( - string $apiKey, - string $channel, - $level = Logger::DEBUG, - bool $bubble = true, - string $parseMode = null, - bool $disableWebPagePreview = null, - bool $disableNotification = null, - bool $splitLongMessages = false, - bool $delayBetweenMessages = false - ) - { - if (!extension_loaded('curl')) { - throw new MissingExtensionException('The curl extension is needed to use the TelegramBotHandler'); - } - - parent::__construct($level, $bubble); - - $this->apiKey = $apiKey; - $this->channel = $channel; - $this->setParseMode($parseMode); - $this->disableWebPagePreview($disableWebPagePreview); - $this->disableNotification($disableNotification); - $this->splitLongMessages($splitLongMessages); - $this->delayBetweenMessages($delayBetweenMessages); - } - - public function setParseMode(string $parseMode = null): self - { - if ($parseMode !== null && !in_array($parseMode, self::AVAILABLE_PARSE_MODES)) { - throw new \InvalidArgumentException('Unknown parseMode, use one of these: ' . implode(', ', self::AVAILABLE_PARSE_MODES) . '.'); - } - - $this->parseMode = $parseMode; - - return $this; - } - - public function disableWebPagePreview(bool $disableWebPagePreview = null): self - { - $this->disableWebPagePreview = $disableWebPagePreview; - - return $this; - } - - public function disableNotification(bool $disableNotification = null): self - { - $this->disableNotification = $disableNotification; - - return $this; - } - - /** - * True - split a message longer than MAX_MESSAGE_LENGTH into parts and send in multiple messages. - * False - truncates a message that is too long. - * @param bool $splitLongMessages - * @return $this - */ - public function splitLongMessages(bool $splitLongMessages = false): self - { - $this->splitLongMessages = $splitLongMessages; - - return $this; - } - - /** - * Adds 1-second delay between sending a split message (according to Telegram API to avoid 429 Too Many Requests). - * @param bool $delayBetweenMessages - * @return $this - */ - public function delayBetweenMessages(bool $delayBetweenMessages = false): self - { - $this->delayBetweenMessages = $delayBetweenMessages; - - return $this; - } - - /** - * {@inheritDoc} - */ - public function handleBatch(array $records): void - { - /** @var Record[] $messages */ - $messages = []; - - foreach ($records as $record) { - if (!$this->isHandling($record)) { - continue; - } - - if ($this->processors) { - /** @var Record $record */ - $record = $this->processRecord($record); - } - - $messages[] = $record; - } - - if (!empty($messages)) { - $this->send((string)$this->getFormatter()->formatBatch($messages)); - } - } - - /** - * @inheritDoc - */ - protected function write(array $record): void - { - $this->send($record['formatted']); - } - - /** - * Send request to @link https://api.telegram.org/bot on SendMessage action. - * @param string $message - */ - protected function send(string $message): void - { - $messages = $this->handleMessageLength($message); - - foreach ($messages as $key => $msg) { - if ($this->delayBetweenMessages && $key > 0) { - sleep(1); - } - - $this->sendCurl($msg); - } - } - - protected function sendCurl(string $message): void - { - $ch = curl_init(); - $url = self::BOT_API . $this->apiKey . '/SendMessage'; - curl_setopt($ch, CURLOPT_URL, $url); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([ - 'text' => $message, - 'chat_id' => $this->channel, - 'parse_mode' => $this->parseMode, - 'disable_web_page_preview' => $this->disableWebPagePreview, - 'disable_notification' => $this->disableNotification, - ])); - - $result = Curl\Util::execute($ch); - if (!is_string($result)) { - throw new RuntimeException('Telegram API error. Description: No response'); - } - $result = json_decode($result, true); - - if ($result['ok'] === false) { - throw new RuntimeException('Telegram API error. Description: ' . $result['description']); - } - } - - /** - * Handle a message that is too long: truncates or splits into several - * @param string $message - * @return string[] - */ - private function handleMessageLength(string $message): array - { - $truncatedMarker = ' (...truncated)'; - if (!$this->splitLongMessages && strlen($message) > self::MAX_MESSAGE_LENGTH) { - return [Utils::substr($message, 0, self::MAX_MESSAGE_LENGTH - strlen($truncatedMarker)) . $truncatedMarker]; - } - - return str_split($message, self::MAX_MESSAGE_LENGTH); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/TestHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/TestHandler.php deleted file mode 100644 index 0986da27..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/TestHandler.php +++ /dev/null @@ -1,231 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Psr\Log\LogLevel; - -/** - * Used for testing purposes. - * - * It records all records and gives you access to them for verification. - * - * @author Jordi Boggiano <j.boggiano@seld.be> - * - * @method bool hasEmergency($record) - * @method bool hasAlert($record) - * @method bool hasCritical($record) - * @method bool hasError($record) - * @method bool hasWarning($record) - * @method bool hasNotice($record) - * @method bool hasInfo($record) - * @method bool hasDebug($record) - * - * @method bool hasEmergencyRecords() - * @method bool hasAlertRecords() - * @method bool hasCriticalRecords() - * @method bool hasErrorRecords() - * @method bool hasWarningRecords() - * @method bool hasNoticeRecords() - * @method bool hasInfoRecords() - * @method bool hasDebugRecords() - * - * @method bool hasEmergencyThatContains($message) - * @method bool hasAlertThatContains($message) - * @method bool hasCriticalThatContains($message) - * @method bool hasErrorThatContains($message) - * @method bool hasWarningThatContains($message) - * @method bool hasNoticeThatContains($message) - * @method bool hasInfoThatContains($message) - * @method bool hasDebugThatContains($message) - * - * @method bool hasEmergencyThatMatches($message) - * @method bool hasAlertThatMatches($message) - * @method bool hasCriticalThatMatches($message) - * @method bool hasErrorThatMatches($message) - * @method bool hasWarningThatMatches($message) - * @method bool hasNoticeThatMatches($message) - * @method bool hasInfoThatMatches($message) - * @method bool hasDebugThatMatches($message) - * - * @method bool hasEmergencyThatPasses($message) - * @method bool hasAlertThatPasses($message) - * @method bool hasCriticalThatPasses($message) - * @method bool hasErrorThatPasses($message) - * @method bool hasWarningThatPasses($message) - * @method bool hasNoticeThatPasses($message) - * @method bool hasInfoThatPasses($message) - * @method bool hasDebugThatPasses($message) - * - * @phpstan-import-type Record from \Monolog\Logger - * @phpstan-import-type Level from \Monolog\Logger - * @phpstan-import-type LevelName from \Monolog\Logger - */ -class TestHandler extends AbstractProcessingHandler -{ - /** @var Record[] */ - protected $records = []; - /** @var array<Level, Record[]> */ - protected $recordsByLevel = []; - /** @var bool */ - private $skipReset = false; - - /** - * @return array - * - * @phpstan-return Record[] - */ - public function getRecords() - { - return $this->records; - } - - /** - * @return void - */ - public function clear() - { - $this->records = []; - $this->recordsByLevel = []; - } - - /** - * @return void - */ - public function reset() - { - if (!$this->skipReset) { - $this->clear(); - } - } - - /** - * @return void - */ - public function setSkipReset(bool $skipReset) - { - $this->skipReset = $skipReset; - } - - /** - * @param string|int $level Logging level value or name - * - * @phpstan-param Level|LevelName|LogLevel::* $level - */ - public function hasRecords($level): bool - { - return isset($this->recordsByLevel[Logger::toMonologLevel($level)]); - } - - /** - * @param string|array $record Either a message string or an array containing message and optionally context keys that will be checked against all records - * @param string|int $level Logging level value or name - * - * @phpstan-param array{message: string, context?: mixed[]}|string $record - * @phpstan-param Level|LevelName|LogLevel::* $level - */ - public function hasRecord($record, $level): bool - { - if (is_string($record)) { - $record = array('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); - } - - /** - * @param string|int $level Logging level value or name - * - * @phpstan-param Level|LevelName|LogLevel::* $level - */ - public function hasRecordThatContains(string $message, $level): bool - { - return $this->hasRecordThatPasses(function ($rec) use ($message) { - return strpos($rec['message'], $message) !== false; - }, $level); - } - - /** - * @param string|int $level Logging level value or name - * - * @phpstan-param Level|LevelName|LogLevel::* $level - */ - public function hasRecordThatMatches(string $regex, $level): bool - { - return $this->hasRecordThatPasses(function (array $rec) use ($regex): bool { - return preg_match($regex, $rec['message']) > 0; - }, $level); - } - - /** - * @param string|int $level Logging level value or name - * @return bool - * - * @psalm-param callable(Record, int): mixed $predicate - * @phpstan-param Level|LevelName|LogLevel::* $level - */ - public function hasRecordThatPasses(callable $predicate, $level) - { - $level = Logger::toMonologLevel($level); - - if (!isset($this->recordsByLevel[$level])) { - return false; - } - - foreach ($this->recordsByLevel[$level] as $i => $rec) { - if ($predicate($rec, $i)) { - return true; - } - } - - return false; - } - - /** - * {@inheritDoc} - */ - protected function write(array $record): void - { - $this->recordsByLevel[$record['level']][] = $record; - $this->records[] = $record; - } - - /** - * @param string $method - * @param mixed[] $args - * @return bool - */ - 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 = constant('Monolog\Logger::' . strtoupper($matches[2])); - $callback = [$this, $genericMethod]; - if (is_callable($callback)) { - $args[] = $level; - - return call_user_func_array($callback, $args); - } - } - - throw new \BadMethodCallException('Call to undefined method ' . get_class($this) . '::' . $method . '()'); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/WebRequestRecognizerTrait.php b/vendor/monolog/monolog/src/Monolog/Handler/WebRequestRecognizerTrait.php deleted file mode 100644 index c8183528..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/WebRequestRecognizerTrait.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -trait WebRequestRecognizerTrait -{ - /** - * Checks if PHP's serving a web request - * @return bool - */ - protected function isWebRequest(): bool - { - return 'cli' !== \PHP_SAPI && 'phpdbg' !== \PHP_SAPI; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php deleted file mode 100644 index 2dd13672..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -/** - * Forwards records to multiple handlers suppressing failures of each handler - * and continuing through to give every handler a chance to succeed. - * - * @author Craig D'Amelio <craig@damelio.ca> - * - * @phpstan-import-type Record from \Monolog\Logger - */ -class WhatFailureGroupHandler extends GroupHandler -{ - /** - * {@inheritDoc} - */ - public function handle(array $record): bool - { - if ($this->processors) { - /** @var Record $record */ - $record = $this->processRecord($record); - } - - foreach ($this->handlers as $handler) { - try { - $handler->handle($record); - } catch (\Throwable $e) { - // What failure? - } - } - - return false === $this->bubble; - } - - /** - * {@inheritDoc} - */ - public function handleBatch(array $records): void - { - if ($this->processors) { - $processed = array(); - foreach ($records as $record) { - $processed[] = $this->processRecord($record); - } - /** @var Record[] $records */ - $records = $processed; - } - - foreach ($this->handlers as $handler) { - try { - $handler->handleBatch($records); - } catch (\Throwable $e) { - // What failure? - } - } - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/ZendMonitorHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/ZendMonitorHandler.php deleted file mode 100644 index ddd46d8c..00000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/ZendMonitorHandler.php +++ /dev/null @@ -1,101 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\FormatterInterface; -use Monolog\Formatter\NormalizerFormatter; -use Monolog\Logger; - -/** - * Handler sending logs to Zend Monitor - * - * @author Christian Bergau <cbergau86@gmail.com> - * @author Jason Davis <happydude@jasondavis.net> - * - * @phpstan-import-type FormattedRecord from AbstractProcessingHandler - */ -class ZendMonitorHandler extends AbstractProcessingHandler -{ - /** - * Monolog level / ZendMonitor Custom Event priority map - * - * @var array<int, int> - */ - protected $levelMap = []; - - /** - * @throws MissingExtensionException - */ - public function __construct($level = Logger::DEBUG, bool $bubble = true) - { - if (!function_exists('zend_monitor_custom_event')) { - throw new MissingExtensionException( - 'You must have Zend Server installed with Zend Monitor enabled in order to use this handler' - ); - } - //zend monitor constants are not defined if zend monitor is not enabled. - $this->levelMap = [ - Logger::DEBUG => \ZEND_MONITOR_EVENT_SEVERITY_INFO, - Logger::INFO => \ZEND_MONITOR_EVENT_SEVERITY_INFO, - Logger::NOTICE => \ZEND_MONITOR_EVENT_SEVERITY_INFO, - Logger::WARNING => \ZEND_MONITOR_EVENT_SEVERITY_WARNING, - Logger::ERROR => \ZEND_MONITOR_EVENT_SEVERITY_ERROR, - Logger::CRITICAL => \ZEND_MONITOR_EVENT_SEVERITY_ERROR, - Logger::ALERT => \ZEND_MONITOR_EVENT_SEVERITY_ERROR, - Logger::EMERGENCY => \ZEND_MONITOR_EVENT_SEVERITY_ERROR, - ]; - parent::__construct($level, $bubble); - } - - /** - * {@inheritDoc} - */ - protected function write(array $record): void - { - $this->writeZendMonitorCustomEvent( - Logger::getLevelName($record['level']), - $record['message'], - $record['formatted'], - $this->levelMap[$record['level']] - ); - } - - /** - * Write to Zend Monitor Events - * @param string $type Text displayed in "Class Name (custom)" field - * @param string $message Text displayed in "Error String" - * @param array $formatted Displayed in Custom Variables tab - * @param int $severity Set the event severity level (-1,0,1) - * - * @phpstan-param FormattedRecord $formatted - */ - protected function writeZendMonitorCustomEvent(string $type, string $message, array $formatted, int $severity): void - { - zend_monitor_custom_event($type, $message, $formatted, $severity); - } - - /** - * {@inheritDoc} - */ - public function getDefaultFormatter(): FormatterInterface - { - return new NormalizerFormatter(); - } - - /** - * @return array<int, int> - */ - public function getLevelMap(): array - { - return $this->levelMap; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/LogRecord.php b/vendor/monolog/monolog/src/Monolog/LogRecord.php deleted file mode 100644 index 702807d7..00000000 --- a/vendor/monolog/monolog/src/Monolog/LogRecord.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog; - -use ArrayAccess; - -/** - * Monolog log record interface for forward compatibility with Monolog 3.0 - * - * This is just present in Monolog 2.4+ to allow interoperable code to be written against - * both versions by type-hinting arguments as `array|\Monolog\LogRecord $record` - * - * Do not rely on this interface for other purposes, and do not implement it. - * - * @author Jordi Boggiano <j.boggiano@seld.be> - * @template-extends \ArrayAccess<'message'|'level'|'context'|'level_name'|'channel'|'datetime'|'extra'|'formatted', mixed> - * @phpstan-import-type Record from Logger - */ -interface LogRecord extends \ArrayAccess -{ - /** - * @phpstan-return Record - */ - public function toArray(): array; -} diff --git a/vendor/monolog/monolog/src/Monolog/Logger.php b/vendor/monolog/monolog/src/Monolog/Logger.php deleted file mode 100644 index 1ab75b9e..00000000 --- a/vendor/monolog/monolog/src/Monolog/Logger.php +++ /dev/null @@ -1,701 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog; - -use DateTimeZone; -use Monolog\Handler\HandlerInterface; -use Psr\Log\LoggerInterface; -use Psr\Log\InvalidArgumentException; -use Psr\Log\LogLevel; -use Throwable; -use Stringable; - -/** - * Monolog log channel - * - * It contains a stack of Handlers and a stack of Processors, - * and uses them to store records that are added to it. - * - * @author Jordi Boggiano <j.boggiano@seld.be> - * - * @phpstan-type Level Logger::DEBUG|Logger::INFO|Logger::NOTICE|Logger::WARNING|Logger::ERROR|Logger::CRITICAL|Logger::ALERT|Logger::EMERGENCY - * @phpstan-type LevelName 'DEBUG'|'INFO'|'NOTICE'|'WARNING'|'ERROR'|'CRITICAL'|'ALERT'|'EMERGENCY' - * @phpstan-type Record array{message: string, context: mixed[], level: Level, level_name: LevelName, channel: string, datetime: \DateTimeImmutable, extra: mixed[]} - */ -class Logger implements LoggerInterface, ResettableInterface -{ - /** - * Detailed debug information - */ - public const DEBUG = 100; - - /** - * Interesting events - * - * Examples: User logs in, SQL logs. - */ - public const INFO = 200; - - /** - * Uncommon events - */ - public const NOTICE = 250; - - /** - * Exceptional occurrences that are not errors - * - * Examples: Use of deprecated APIs, poor use of an API, - * undesirable things that are not necessarily wrong. - */ - public const WARNING = 300; - - /** - * Runtime errors - */ - public const ERROR = 400; - - /** - * Critical conditions - * - * Example: Application component unavailable, unexpected exception. - */ - public const CRITICAL = 500; - - /** - * Action must be taken immediately - * - * Example: Entire website down, database unavailable, etc. - * This should trigger the SMS alerts and wake you up. - */ - public const ALERT = 550; - - /** - * Urgent alert. - */ - public const EMERGENCY = 600; - - /** - * Monolog API version - * - * This is only bumped when API breaks are done and should - * follow the major version of the library - * - * @var int - */ - public const API = 2; - - /** - * This is a static variable and not a constant to serve as an extension point for custom levels - * - * @var array<int, string> $levels Logging levels with the levels as key - * - * @phpstan-var array<Level, LevelName> $levels Logging levels with the levels as key - */ - protected static $levels = [ - self::DEBUG => 'DEBUG', - self::INFO => 'INFO', - self::NOTICE => 'NOTICE', - self::WARNING => 'WARNING', - self::ERROR => 'ERROR', - self::CRITICAL => 'CRITICAL', - self::ALERT => 'ALERT', - self::EMERGENCY => 'EMERGENCY', - ]; - - /** - * Mapping between levels numbers defined in RFC 5424 and Monolog ones - * - * @phpstan-var array<int, Level> $rfc_5424_levels - */ - private const RFC_5424_LEVELS = [ - 7 => self::DEBUG, - 6 => self::INFO, - 5 => self::NOTICE, - 4 => self::WARNING, - 3 => self::ERROR, - 2 => self::CRITICAL, - 1 => self::ALERT, - 0 => self::EMERGENCY, - ]; - - /** - * @var string - */ - protected $name; - - /** - * The handler stack - * - * @var HandlerInterface[] - */ - protected $handlers; - - /** - * Processors that will process all log records - * - * To process records of a single handler instead, add the processor on that specific handler - * - * @var callable[] - */ - protected $processors; - - /** - * @var bool - */ - protected $microsecondTimestamps = true; - - /** - * @var DateTimeZone - */ - protected $timezone; - - /** - * @var callable|null - */ - protected $exceptionHandler; - - /** - * @var int Keeps track of depth to prevent infinite logging loops - */ - private $logDepth = 0; - - /** - * @var bool Whether to detect infinite logging loops - * - * This can be disabled via {@see useLoggingLoopDetection} if you have async handlers that do not play well with this - */ - private $detectCycles = true; - - /** - * @psalm-param array<callable(array): array> $processors - * - * @param string $name The logging channel, a simple descriptive name that is attached to all log records - * @param HandlerInterface[] $handlers Optional stack of handlers, the first one in the array is called first, etc. - * @param callable[] $processors Optional array of processors - * @param DateTimeZone|null $timezone Optional timezone, if not provided date_default_timezone_get() will be used - */ - public function __construct(string $name, array $handlers = [], array $processors = [], ?DateTimeZone $timezone = null) - { - $this->name = $name; - $this->setHandlers($handlers); - $this->processors = $processors; - $this->timezone = $timezone ?: new DateTimeZone(date_default_timezone_get() ?: 'UTC'); - } - - public function getName(): string - { - return $this->name; - } - - /** - * Return a new cloned instance with the name changed - */ - public function withName(string $name): self - { - $new = clone $this; - $new->name = $name; - - return $new; - } - - /** - * Pushes a handler on to the stack. - */ - public function pushHandler(HandlerInterface $handler): self - { - array_unshift($this->handlers, $handler); - - return $this; - } - - /** - * Pops a handler from the stack - * - * @throws \LogicException If empty handler stack - */ - public function popHandler(): HandlerInterface - { - if (!$this->handlers) { - throw new \LogicException('You tried to pop from an empty handler stack.'); - } - - return array_shift($this->handlers); - } - - /** - * Set handlers, replacing all existing ones. - * - * If a map is passed, keys will be ignored. - * - * @param HandlerInterface[] $handlers - */ - public function setHandlers(array $handlers): self - { - $this->handlers = []; - foreach (array_reverse($handlers) as $handler) { - $this->pushHandler($handler); - } - - return $this; - } - - /** - * @return HandlerInterface[] - */ - public function getHandlers(): array - { - return $this->handlers; - } - - /** - * Adds a processor on to the stack. - */ - public function pushProcessor(callable $callback): self - { - array_unshift($this->processors, $callback); - - return $this; - } - - /** - * Removes the processor on top of the stack and returns it. - * - * @throws \LogicException If empty processor stack - * @return callable - */ - public function popProcessor(): callable - { - if (!$this->processors) { - throw new \LogicException('You tried to pop from an empty processor stack.'); - } - - return array_shift($this->processors); - } - - /** - * @return callable[] - */ - public function getProcessors(): array - { - return $this->processors; - } - - /** - * Control the use of microsecond resolution timestamps in the 'datetime' - * member of new records. - * - * As of PHP7.1 microseconds are always included by the engine, so - * there is no performance penalty and Monolog 2 enabled microseconds - * by default. This function lets you disable them though in case you want - * to suppress microseconds from the output. - * - * @param bool $micro True to use microtime() to create timestamps - */ - public function useMicrosecondTimestamps(bool $micro): self - { - $this->microsecondTimestamps = $micro; - - return $this; - } - - public function useLoggingLoopDetection(bool $detectCycles): self - { - $this->detectCycles = $detectCycles; - - return $this; - } - - /** - * Adds a log record. - * - * @param int $level The logging level (a Monolog or RFC 5424 level) - * @param string $message The log message - * @param mixed[] $context The log context - * @param DateTimeImmutable $datetime Optional log date to log into the past or future - * @return bool Whether the record has been processed - * - * @phpstan-param Level $level - */ - public function addRecord(int $level, string $message, array $context = [], DateTimeImmutable $datetime = null): bool - { - if (isset(self::RFC_5424_LEVELS[$level])) { - $level = self::RFC_5424_LEVELS[$level]; - } - - if ($this->detectCycles) { - $this->logDepth += 1; - } - if ($this->logDepth === 3) { - $this->warning('A possible infinite logging loop was detected and aborted. It appears some of your handler code is triggering logging, see the previous log record for a hint as to what may be the cause.'); - return false; - } elseif ($this->logDepth >= 5) { // log depth 4 is let through so we can log the warning above - return false; - } - - try { - $record = null; - - foreach ($this->handlers as $handler) { - if (null === $record) { - // skip creating the record as long as no handler is going to handle it - if (!$handler->isHandling(['level' => $level])) { - continue; - } - - $levelName = static::getLevelName($level); - - $record = [ - 'message' => $message, - 'context' => $context, - 'level' => $level, - 'level_name' => $levelName, - 'channel' => $this->name, - 'datetime' => $datetime ?? new DateTimeImmutable($this->microsecondTimestamps, $this->timezone), - 'extra' => [], - ]; - - try { - foreach ($this->processors as $processor) { - $record = $processor($record); - } - } catch (Throwable $e) { - $this->handleException($e, $record); - - return true; - } - } - - // once the record exists, send it to all handlers as long as the bubbling chain is not interrupted - try { - if (true === $handler->handle($record)) { - break; - } - } catch (Throwable $e) { - $this->handleException($e, $record); - - return true; - } - } - } finally { - if ($this->detectCycles) { - $this->logDepth--; - } - } - - return null !== $record; - } - - /** - * Ends a log cycle and frees all resources used by handlers. - * - * Closing a Handler means flushing all buffers and freeing any open resources/handles. - * Handlers that have been closed should be able to accept log records again and re-open - * themselves on demand, but this may not always be possible depending on implementation. - * - * This is useful at the end of a request and will be called automatically on every handler - * when they get destructed. - */ - public function close(): void - { - foreach ($this->handlers as $handler) { - $handler->close(); - } - } - - /** - * Ends a log cycle and resets all handlers and processors to their initial state. - * - * Resetting a Handler or a Processor means flushing/cleaning all buffers, resetting internal - * state, and getting it back to a state in which it can receive log records again. - * - * This is useful in case you want to avoid logs leaking between two requests or jobs when you - * have a long running process like a worker or an application server serving multiple requests - * in one process. - */ - public function reset(): void - { - foreach ($this->handlers as $handler) { - if ($handler instanceof ResettableInterface) { - $handler->reset(); - } - } - - foreach ($this->processors as $processor) { - if ($processor instanceof ResettableInterface) { - $processor->reset(); - } - } - } - - /** - * Gets all supported logging levels. - * - * @return array<string, int> Assoc array with human-readable level names => level codes. - * @phpstan-return array<LevelName, Level> - */ - public static function getLevels(): array - { - return array_flip(static::$levels); - } - - /** - * Gets the name of the logging level. - * - * @throws \Psr\Log\InvalidArgumentException If level is not defined - * - * @phpstan-param Level $level - * @phpstan-return LevelName - */ - public static function getLevelName(int $level): string - { - if (!isset(static::$levels[$level])) { - throw new InvalidArgumentException('Level "'.$level.'" is not defined, use one of: '.implode(', ', array_keys(static::$levels))); - } - - return static::$levels[$level]; - } - - /** - * Converts PSR-3 levels to Monolog ones if necessary - * - * @param string|int $level Level number (monolog) or name (PSR-3) - * @throws \Psr\Log\InvalidArgumentException If level is not defined - * - * @phpstan-param Level|LevelName|LogLevel::* $level - * @phpstan-return Level - */ - public static function toMonologLevel($level): int - { - if (is_string($level)) { - if (is_numeric($level)) { - /** @phpstan-ignore-next-line */ - return intval($level); - } - - // Contains chars of all log levels and avoids using strtoupper() which may have - // strange results depending on locale (for example, "i" will become "İ" in Turkish locale) - $upper = strtr($level, 'abcdefgilmnortuwy', 'ABCDEFGILMNORTUWY'); - if (defined(__CLASS__.'::'.$upper)) { - return constant(__CLASS__ . '::' . $upper); - } - - throw new InvalidArgumentException('Level "'.$level.'" is not defined, use one of: '.implode(', ', array_keys(static::$levels) + static::$levels)); - } - - if (!is_int($level)) { - throw new InvalidArgumentException('Level "'.var_export($level, true).'" is not defined, use one of: '.implode(', ', array_keys(static::$levels) + static::$levels)); - } - - return $level; - } - - /** - * Checks whether the Logger has a handler that listens on the given level - * - * @phpstan-param Level $level - */ - public function isHandling(int $level): bool - { - $record = [ - 'level' => $level, - ]; - - foreach ($this->handlers as $handler) { - if ($handler->isHandling($record)) { - return true; - } - } - - return false; - } - - /** - * Set a custom exception handler that will be called if adding a new record fails - * - * The callable will receive an exception object and the record that failed to be logged - */ - public function setExceptionHandler(?callable $callback): self - { - $this->exceptionHandler = $callback; - - return $this; - } - - public function getExceptionHandler(): ?callable - { - return $this->exceptionHandler; - } - - /** - * Adds a log record at an arbitrary level. - * - * This method allows for compatibility with common interfaces. - * - * @param mixed $level The log level (a Monolog, PSR-3 or RFC 5424 level) - * @param string|Stringable $message The log message - * @param mixed[] $context The log context - * - * @phpstan-param Level|LevelName|LogLevel::* $level - */ - public function log($level, $message, array $context = []): void - { - if (!is_int($level) && !is_string($level)) { - throw new \InvalidArgumentException('$level is expected to be a string or int'); - } - - if (isset(self::RFC_5424_LEVELS[$level])) { - $level = self::RFC_5424_LEVELS[$level]; - } - - $level = static::toMonologLevel($level); - - $this->addRecord($level, (string) $message, $context); - } - - /** - * Adds a log record at the DEBUG level. - * - * This method allows for compatibility with common interfaces. - * - * @param string|Stringable $message The log message - * @param mixed[] $context The log context - */ - public function debug($message, array $context = []): void - { - $this->addRecord(static::DEBUG, (string) $message, $context); - } - - /** - * Adds a log record at the INFO level. - * - * This method allows for compatibility with common interfaces. - * - * @param string|Stringable $message The log message - * @param mixed[] $context The log context - */ - public function info($message, array $context = []): void - { - $this->addRecord(static::INFO, (string) $message, $context); - } - - /** - * Adds a log record at the NOTICE level. - * - * This method allows for compatibility with common interfaces. - * - * @param string|Stringable $message The log message - * @param mixed[] $context The log context - */ - public function notice($message, array $context = []): void - { - $this->addRecord(static::NOTICE, (string) $message, $context); - } - - /** - * Adds a log record at the WARNING level. - * - * This method allows for compatibility with common interfaces. - * - * @param string|Stringable $message The log message - * @param mixed[] $context The log context - */ - public function warning($message, array $context = []): void - { - $this->addRecord(static::WARNING, (string) $message, $context); - } - - /** - * Adds a log record at the ERROR level. - * - * This method allows for compatibility with common interfaces. - * - * @param string|Stringable $message The log message - * @param mixed[] $context The log context - */ - public function error($message, array $context = []): void - { - $this->addRecord(static::ERROR, (string) $message, $context); - } - - /** - * Adds a log record at the CRITICAL level. - * - * This method allows for compatibility with common interfaces. - * - * @param string|Stringable $message The log message - * @param mixed[] $context The log context - */ - public function critical($message, array $context = []): void - { - $this->addRecord(static::CRITICAL, (string) $message, $context); - } - - /** - * Adds a log record at the ALERT level. - * - * This method allows for compatibility with common interfaces. - * - * @param string|Stringable $message The log message - * @param mixed[] $context The log context - */ - public function alert($message, array $context = []): void - { - $this->addRecord(static::ALERT, (string) $message, $context); - } - - /** - * Adds a log record at the EMERGENCY level. - * - * This method allows for compatibility with common interfaces. - * - * @param string|Stringable $message The log message - * @param mixed[] $context The log context - */ - public function emergency($message, array $context = []): void - { - $this->addRecord(static::EMERGENCY, (string) $message, $context); - } - - /** - * Sets the timezone to be used for the timestamp of log records. - */ - public function setTimezone(DateTimeZone $tz): self - { - $this->timezone = $tz; - - return $this; - } - - /** - * Returns the timezone to be used for the timestamp of log records. - */ - public function getTimezone(): DateTimeZone - { - return $this->timezone; - } - - /** - * Delegates exception management to the custom exception handler, - * or throws the exception if no custom handler is set. - * - * @param array $record - * @phpstan-param Record $record - */ - protected function handleException(Throwable $e, array $record): void - { - if (!$this->exceptionHandler) { - throw $e; - } - - ($this->exceptionHandler)($e, $record); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Processor/GitProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/GitProcessor.php deleted file mode 100644 index 8166bdca..00000000 --- a/vendor/monolog/monolog/src/Monolog/Processor/GitProcessor.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -use Monolog\Logger; -use Psr\Log\LogLevel; - -/** - * Injects Git branch and Git commit SHA in all records - * - * @author Nick Otter - * @author Jordi Boggiano <j.boggiano@seld.be> - * - * @phpstan-import-type Level from \Monolog\Logger - * @phpstan-import-type LevelName from \Monolog\Logger - */ -class GitProcessor implements ProcessorInterface -{ - /** @var int */ - private $level; - /** @var array{branch: string, commit: string}|array<never>|null */ - private static $cache = null; - - /** - * @param string|int $level The minimum logging level at which this Processor will be triggered - * - * @phpstan-param Level|LevelName|LogLevel::* $level - */ - public function __construct($level = Logger::DEBUG) - { - $this->level = Logger::toMonologLevel($level); - } - - /** - * {@inheritDoc} - */ - public function __invoke(array $record): array - { - // return if the level is not high enough - if ($record['level'] < $this->level) { - return $record; - } - - $record['extra']['git'] = self::getGitInfo(); - - return $record; - } - - /** - * @return array{branch: string, commit: string}|array<never> - */ - private static function getGitInfo(): array - { - if (self::$cache) { - return self::$cache; - } - - $branches = `git branch -v --no-abbrev`; - if ($branches && preg_match('{^\* (.+?)\s+([a-f0-9]{40})(?:\s|$)}m', $branches, $matches)) { - return self::$cache = [ - 'branch' => $matches[1], - 'commit' => $matches[2], - ]; - } - - return self::$cache = []; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Processor/HostnameProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/HostnameProcessor.php deleted file mode 100644 index 91fda7d6..00000000 --- a/vendor/monolog/monolog/src/Monolog/Processor/HostnameProcessor.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -/** - * Injects value of gethostname in all records - */ -class HostnameProcessor implements ProcessorInterface -{ - /** @var string */ - private static $host; - - public function __construct() - { - self::$host = (string) gethostname(); - } - - /** - * {@inheritDoc} - */ - public function __invoke(array $record): array - { - $record['extra']['hostname'] = self::$host; - - return $record; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php deleted file mode 100644 index a32e76b2..00000000 --- a/vendor/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php +++ /dev/null @@ -1,123 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -use Monolog\Logger; -use Psr\Log\LogLevel; - -/** - * Injects line/file:class/function where the log message came from - * - * Warning: This only works if the handler processes the logs directly. - * If you put the processor on a handler that is behind a FingersCrossedHandler - * for example, the processor will only be called once the trigger level is reached, - * and all the log records will have the same file/line/.. data from the call that - * triggered the FingersCrossedHandler. - * - * @author Jordi Boggiano <j.boggiano@seld.be> - * - * @phpstan-import-type Level from \Monolog\Logger - * @phpstan-import-type LevelName from \Monolog\Logger - */ -class IntrospectionProcessor implements ProcessorInterface -{ - /** @var int */ - private $level; - /** @var string[] */ - private $skipClassesPartials; - /** @var int */ - private $skipStackFramesCount; - /** @var string[] */ - private $skipFunctions = [ - 'call_user_func', - 'call_user_func_array', - ]; - - /** - * @param string|int $level The minimum logging level at which this Processor will be triggered - * @param string[] $skipClassesPartials - * - * @phpstan-param Level|LevelName|LogLevel::* $level - */ - public function __construct($level = Logger::DEBUG, array $skipClassesPartials = [], int $skipStackFramesCount = 0) - { - $this->level = Logger::toMonologLevel($level); - $this->skipClassesPartials = array_merge(['Monolog\\'], $skipClassesPartials); - $this->skipStackFramesCount = $skipStackFramesCount; - } - - /** - * {@inheritDoc} - */ - public function __invoke(array $record): array - { - // return if the level is not high enough - if ($record['level'] < $this->level) { - return $record; - } - - $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); - - // skip first since it's always the current method - array_shift($trace); - // the call_user_func call is also skipped - array_shift($trace); - - $i = 0; - - while ($this->isTraceClassOrSkippedFunction($trace, $i)) { - if (isset($trace[$i]['class'])) { - foreach ($this->skipClassesPartials as $part) { - if (strpos($trace[$i]['class'], $part) !== false) { - $i++; - - continue 2; - } - } - } elseif (in_array($trace[$i]['function'], $this->skipFunctions)) { - $i++; - - continue; - } - - break; - } - - $i += $this->skipStackFramesCount; - - // we should have the call source now - $record['extra'] = array_merge( - $record['extra'], - [ - 'file' => isset($trace[$i - 1]['file']) ? $trace[$i - 1]['file'] : null, - 'line' => isset($trace[$i - 1]['line']) ? $trace[$i - 1]['line'] : null, - 'class' => isset($trace[$i]['class']) ? $trace[$i]['class'] : null, - 'callType' => isset($trace[$i]['type']) ? $trace[$i]['type'] : null, - 'function' => isset($trace[$i]['function']) ? $trace[$i]['function'] : null, - ] - ); - - return $record; - } - - /** - * @param array[] $trace - */ - private function isTraceClassOrSkippedFunction(array $trace, int $index): bool - { - if (!isset($trace[$index])) { - return false; - } - - return isset($trace[$index]['class']) || in_array($trace[$index]['function'], $this->skipFunctions); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Processor/MemoryPeakUsageProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/MemoryPeakUsageProcessor.php deleted file mode 100644 index 37c756fc..00000000 --- a/vendor/monolog/monolog/src/Monolog/Processor/MemoryPeakUsageProcessor.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -/** - * Injects memory_get_peak_usage in all records - * - * @see Monolog\Processor\MemoryProcessor::__construct() for options - * @author Rob Jensen - */ -class MemoryPeakUsageProcessor extends MemoryProcessor -{ - /** - * {@inheritDoc} - */ - public function __invoke(array $record): array - { - $usage = memory_get_peak_usage($this->realUsage); - - if ($this->useFormatting) { - $usage = $this->formatBytes($usage); - } - - $record['extra']['memory_peak_usage'] = $usage; - - return $record; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php deleted file mode 100644 index 227deb7c..00000000 --- a/vendor/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php +++ /dev/null @@ -1,61 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -/** - * Some methods that are common for all memory processors - * - * @author Rob Jensen - */ -abstract class MemoryProcessor implements ProcessorInterface -{ - /** - * @var bool If true, get the real size of memory allocated from system. Else, only the memory used by emalloc() is reported. - */ - protected $realUsage; - - /** - * @var bool If true, then format memory size to human readable string (MB, KB, B depending on size) - */ - protected $useFormatting; - - /** - * @param bool $realUsage Set this to true to get the real size of memory allocated from system. - * @param bool $useFormatting If true, then format memory size to human readable string (MB, KB, B depending on size) - */ - public function __construct(bool $realUsage = true, bool $useFormatting = true) - { - $this->realUsage = $realUsage; - $this->useFormatting = $useFormatting; - } - - /** - * Formats bytes into a human readable string if $this->useFormatting is true, otherwise return $bytes as is - * - * @param int $bytes - * @return string|int Formatted string if $this->useFormatting is true, otherwise return $bytes as int - */ - protected function formatBytes(int $bytes) - { - if (!$this->useFormatting) { - return $bytes; - } - - if ($bytes > 1024 * 1024) { - return round($bytes / 1024 / 1024, 2).' MB'; - } elseif ($bytes > 1024) { - return round($bytes / 1024, 2).' KB'; - } - - return $bytes . ' B'; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Processor/MemoryUsageProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/MemoryUsageProcessor.php deleted file mode 100644 index e141921e..00000000 --- a/vendor/monolog/monolog/src/Monolog/Processor/MemoryUsageProcessor.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -/** - * Injects memory_get_usage in all records - * - * @see Monolog\Processor\MemoryProcessor::__construct() for options - * @author Rob Jensen - */ -class MemoryUsageProcessor extends MemoryProcessor -{ - /** - * {@inheritDoc} - */ - public function __invoke(array $record): array - { - $usage = memory_get_usage($this->realUsage); - - if ($this->useFormatting) { - $usage = $this->formatBytes($usage); - } - - $record['extra']['memory_usage'] = $usage; - - return $record; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Processor/MercurialProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/MercurialProcessor.php deleted file mode 100644 index d4a628f5..00000000 --- a/vendor/monolog/monolog/src/Monolog/Processor/MercurialProcessor.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -use Monolog\Logger; -use Psr\Log\LogLevel; - -/** - * Injects Hg branch and Hg revision number in all records - * - * @author Jonathan A. Schweder <jonathanschweder@gmail.com> - * - * @phpstan-import-type LevelName from \Monolog\Logger - * @phpstan-import-type Level from \Monolog\Logger - */ -class MercurialProcessor implements ProcessorInterface -{ - /** @var Level */ - private $level; - /** @var array{branch: string, revision: string}|array<never>|null */ - private static $cache = null; - - /** - * @param int|string $level The minimum logging level at which this Processor will be triggered - * - * @phpstan-param Level|LevelName|LogLevel::* $level - */ - public function __construct($level = Logger::DEBUG) - { - $this->level = Logger::toMonologLevel($level); - } - - /** - * {@inheritDoc} - */ - public function __invoke(array $record): array - { - // return if the level is not high enough - if ($record['level'] < $this->level) { - return $record; - } - - $record['extra']['hg'] = self::getMercurialInfo(); - - return $record; - } - - /** - * @return array{branch: string, revision: string}|array<never> - */ - private static function getMercurialInfo(): array - { - if (self::$cache) { - return self::$cache; - } - - $result = explode(' ', trim(`hg id -nb`)); - - if (count($result) >= 3) { - return self::$cache = [ - 'branch' => $result[1], - 'revision' => $result[2], - ]; - } - - return self::$cache = []; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Processor/ProcessIdProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/ProcessIdProcessor.php deleted file mode 100644 index 3b939a95..00000000 --- a/vendor/monolog/monolog/src/Monolog/Processor/ProcessIdProcessor.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -/** - * Adds value of getmypid into records - * - * @author Andreas Hörnicke - */ -class ProcessIdProcessor implements ProcessorInterface -{ - /** - * {@inheritDoc} - */ - public function __invoke(array $record): array - { - $record['extra']['process_id'] = getmypid(); - - return $record; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Processor/ProcessorInterface.php b/vendor/monolog/monolog/src/Monolog/Processor/ProcessorInterface.php deleted file mode 100644 index 5defb7eb..00000000 --- a/vendor/monolog/monolog/src/Monolog/Processor/ProcessorInterface.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -/** - * An optional interface to allow labelling Monolog processors. - * - * @author Nicolas Grekas <p@tchwork.com> - * - * @phpstan-import-type Record from \Monolog\Logger - */ -interface ProcessorInterface -{ - /** - * @return array The processed record - * - * @phpstan-param Record $record - * @phpstan-return Record - */ - public function __invoke(array $record); -} diff --git a/vendor/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php deleted file mode 100644 index 2c2a00e7..00000000 --- a/vendor/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php +++ /dev/null @@ -1,86 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -use Monolog\Utils; - -/** - * Processes a record's message according to PSR-3 rules - * - * It replaces {foo} with the value from $context['foo'] - * - * @author Jordi Boggiano <j.boggiano@seld.be> - */ -class PsrLogMessageProcessor implements ProcessorInterface -{ - public const SIMPLE_DATE = "Y-m-d\TH:i:s.uP"; - - /** @var string|null */ - private $dateFormat; - - /** @var bool */ - private $removeUsedContextFields; - - /** - * @param string|null $dateFormat The format of the timestamp: one supported by DateTime::format - * @param bool $removeUsedContextFields If set to true the fields interpolated into message gets unset - */ - public function __construct(?string $dateFormat = null, bool $removeUsedContextFields = false) - { - $this->dateFormat = $dateFormat; - $this->removeUsedContextFields = $removeUsedContextFields; - } - - /** - * {@inheritDoc} - */ - public function __invoke(array $record): array - { - if (false === strpos($record['message'], '{')) { - return $record; - } - - $replacements = []; - foreach ($record['context'] as $key => $val) { - $placeholder = '{' . $key . '}'; - if (strpos($record['message'], $placeholder) === false) { - continue; - } - - if (is_null($val) || is_scalar($val) || (is_object($val) && method_exists($val, "__toString"))) { - $replacements[$placeholder] = $val; - } elseif ($val instanceof \DateTimeInterface) { - if (!$this->dateFormat && $val instanceof \Monolog\DateTimeImmutable) { - // handle monolog dates using __toString if no specific dateFormat was asked for - // so that it follows the useMicroseconds flag - $replacements[$placeholder] = (string) $val; - } else { - $replacements[$placeholder] = $val->format($this->dateFormat ?: static::SIMPLE_DATE); - } - } elseif (is_object($val)) { - $replacements[$placeholder] = '[object '.Utils::getClass($val).']'; - } elseif (is_array($val)) { - $replacements[$placeholder] = 'array'.Utils::jsonEncode($val, null, true); - } else { - $replacements[$placeholder] = '['.gettype($val).']'; - } - - if ($this->removeUsedContextFields) { - unset($record['context'][$key]); - } - } - - $record['message'] = strtr($record['message'], $replacements); - - return $record; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Processor/TagProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/TagProcessor.php deleted file mode 100644 index 80f18747..00000000 --- a/vendor/monolog/monolog/src/Monolog/Processor/TagProcessor.php +++ /dev/null @@ -1,61 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -/** - * Adds a tags array into record - * - * @author Martijn Riemers - */ -class TagProcessor implements ProcessorInterface -{ - /** @var string[] */ - private $tags; - - /** - * @param string[] $tags - */ - public function __construct(array $tags = []) - { - $this->setTags($tags); - } - - /** - * @param string[] $tags - */ - public function addTags(array $tags = []): self - { - $this->tags = array_merge($this->tags, $tags); - - return $this; - } - - /** - * @param string[] $tags - */ - public function setTags(array $tags = []): self - { - $this->tags = $tags; - - return $this; - } - - /** - * {@inheritDoc} - */ - public function __invoke(array $record): array - { - $record['extra']['tags'] = $this->tags; - - return $record; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Processor/UidProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/UidProcessor.php deleted file mode 100644 index a27b74db..00000000 --- a/vendor/monolog/monolog/src/Monolog/Processor/UidProcessor.php +++ /dev/null @@ -1,59 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -use Monolog\ResettableInterface; - -/** - * Adds a unique identifier into records - * - * @author Simon Mönch <sm@webfactory.de> - */ -class UidProcessor implements ProcessorInterface, ResettableInterface -{ - /** @var string */ - private $uid; - - public function __construct(int $length = 7) - { - if ($length > 32 || $length < 1) { - throw new \InvalidArgumentException('The uid length must be an integer between 1 and 32'); - } - - $this->uid = $this->generateUid($length); - } - - /** - * {@inheritDoc} - */ - public function __invoke(array $record): array - { - $record['extra']['uid'] = $this->uid; - - return $record; - } - - public function getUid(): string - { - return $this->uid; - } - - public function reset() - { - $this->uid = $this->generateUid(strlen($this->uid)); - } - - private function generateUid(int $length): string - { - return substr(bin2hex(random_bytes((int) ceil($length / 2))), 0, $length); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php deleted file mode 100644 index 51850e17..00000000 --- a/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php +++ /dev/null @@ -1,111 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -/** - * Injects url/method and remote IP of the current web request in all records - * - * @author Jordi Boggiano <j.boggiano@seld.be> - */ -class WebProcessor implements ProcessorInterface -{ - /** - * @var array<string, mixed>|\ArrayAccess<string, mixed> - */ - protected $serverData; - - /** - * Default fields - * - * Array is structured as [key in record.extra => key in $serverData] - * - * @var array<string, string> - */ - protected $extraFields = [ - 'url' => 'REQUEST_URI', - 'ip' => 'REMOTE_ADDR', - 'http_method' => 'REQUEST_METHOD', - 'server' => 'SERVER_NAME', - 'referrer' => 'HTTP_REFERER', - 'user_agent' => 'HTTP_USER_AGENT', - ]; - - /** - * @param array<string, mixed>|\ArrayAccess<string, mixed>|null $serverData Array or object w/ ArrayAccess that provides access to the $_SERVER data - * @param array<string, string>|array<string>|null $extraFields Field names and the related key inside $serverData to be added (or just a list of field names to use the default configured $serverData mapping). If not provided it defaults to: [url, ip, http_method, server, referrer] + unique_id if present in server data - */ - public function __construct($serverData = null, array $extraFields = null) - { - if (null === $serverData) { - $this->serverData = &$_SERVER; - } elseif (is_array($serverData) || $serverData instanceof \ArrayAccess) { - $this->serverData = $serverData; - } else { - throw new \UnexpectedValueException('$serverData must be an array or object implementing ArrayAccess.'); - } - - $defaultEnabled = ['url', 'ip', 'http_method', 'server', 'referrer']; - if (isset($this->serverData['UNIQUE_ID'])) { - $this->extraFields['unique_id'] = 'UNIQUE_ID'; - $defaultEnabled[] = 'unique_id'; - } - - if (null === $extraFields) { - $extraFields = $defaultEnabled; - } - if (isset($extraFields[0])) { - foreach (array_keys($this->extraFields) as $fieldName) { - if (!in_array($fieldName, $extraFields)) { - unset($this->extraFields[$fieldName]); - } - } - } else { - $this->extraFields = $extraFields; - } - } - - /** - * {@inheritDoc} - */ - public function __invoke(array $record): array - { - // skip processing if for some reason request data - // is not present (CLI or wonky SAPIs) - if (!isset($this->serverData['REQUEST_URI'])) { - return $record; - } - - $record['extra'] = $this->appendExtraFields($record['extra']); - - return $record; - } - - public function addExtraField(string $extraName, string $serverName): self - { - $this->extraFields[$extraName] = $serverName; - - return $this; - } - - /** - * @param mixed[] $extra - * @return mixed[] - */ - private function appendExtraFields(array $extra): array - { - foreach ($this->extraFields as $extraName => $serverName) { - $extra[$extraName] = $this->serverData[$serverName] ?? null; - } - - return $extra; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Registry.php b/vendor/monolog/monolog/src/Monolog/Registry.php deleted file mode 100644 index ae94ae6c..00000000 --- a/vendor/monolog/monolog/src/Monolog/Registry.php +++ /dev/null @@ -1,134 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog; - -use InvalidArgumentException; - -/** - * Monolog log registry - * - * Allows to get `Logger` instances in the global scope - * via static method calls on this class. - * - * <code> - * $application = new Monolog\Logger('application'); - * $api = new Monolog\Logger('api'); - * - * Monolog\Registry::addLogger($application); - * Monolog\Registry::addLogger($api); - * - * function testLogger() - * { - * Monolog\Registry::api()->error('Sent to $api Logger instance'); - * Monolog\Registry::application()->error('Sent to $application Logger instance'); - * } - * </code> - * - * @author Tomas Tatarko <tomas@tatarko.sk> - */ -class Registry -{ - /** - * List of all loggers in the registry (by named indexes) - * - * @var Logger[] - */ - private static $loggers = []; - - /** - * Adds new logging channel to the registry - * - * @param Logger $logger Instance of the logging channel - * @param string|null $name Name of the logging channel ($logger->getName() by default) - * @param bool $overwrite Overwrite instance in the registry if the given name already exists? - * @throws \InvalidArgumentException If $overwrite set to false and named Logger instance already exists - * @return void - */ - public static function addLogger(Logger $logger, ?string $name = null, bool $overwrite = false) - { - $name = $name ?: $logger->getName(); - - if (isset(self::$loggers[$name]) && !$overwrite) { - throw new InvalidArgumentException('Logger with the given name already exists'); - } - - self::$loggers[$name] = $logger; - } - - /** - * Checks if such logging channel exists by name or instance - * - * @param string|Logger $logger Name or logger instance - */ - public static function hasLogger($logger): bool - { - if ($logger instanceof Logger) { - $index = array_search($logger, self::$loggers, true); - - return false !== $index; - } - - return isset(self::$loggers[$logger]); - } - - /** - * Removes instance from registry by name or instance - * - * @param string|Logger $logger Name or logger instance - */ - public static function removeLogger($logger): void - { - if ($logger instanceof Logger) { - if (false !== ($idx = array_search($logger, self::$loggers, true))) { - unset(self::$loggers[$idx]); - } - } else { - unset(self::$loggers[$logger]); - } - } - - /** - * Clears the registry - */ - public static function clear(): void - { - self::$loggers = []; - } - - /** - * Gets Logger instance from the registry - * - * @param string $name Name of the requested Logger instance - * @throws \InvalidArgumentException If named Logger instance is not in the registry - */ - public static function getInstance($name): Logger - { - if (!isset(self::$loggers[$name])) { - throw new InvalidArgumentException(sprintf('Requested "%s" logger instance is not in the registry', $name)); - } - - return self::$loggers[$name]; - } - - /** - * Gets Logger instance from the registry via static method call - * - * @param string $name Name of the requested Logger instance - * @param mixed[] $arguments Arguments passed to static method call - * @throws \InvalidArgumentException If named Logger instance is not in the registry - * @return Logger Requested instance of Logger - */ - public static function __callStatic($name, $arguments) - { - return self::getInstance($name); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/ResettableInterface.php b/vendor/monolog/monolog/src/Monolog/ResettableInterface.php deleted file mode 100644 index 2c5fd785..00000000 --- a/vendor/monolog/monolog/src/Monolog/ResettableInterface.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog; - -/** - * Handler or Processor implementing this interface will be reset when Logger::reset() is called. - * - * Resetting ends a log cycle gets them back to their initial state. - * - * Resetting a Handler or a Processor means flushing/cleaning all buffers, resetting internal - * state, and getting it back to a state in which it can receive log records again. - * - * This is useful in case you want to avoid logs leaking between two requests or jobs when you - * have a long running process like a worker or an application server serving multiple requests - * in one process. - * - * @author Grégoire Pineau <lyrixx@lyrixx.info> - */ -interface ResettableInterface -{ - /** - * @return void - */ - public function reset(); -} diff --git a/vendor/monolog/monolog/src/Monolog/SignalHandler.php b/vendor/monolog/monolog/src/Monolog/SignalHandler.php deleted file mode 100644 index d730eea3..00000000 --- a/vendor/monolog/monolog/src/Monolog/SignalHandler.php +++ /dev/null @@ -1,120 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog; - -use Psr\Log\LoggerInterface; -use Psr\Log\LogLevel; -use ReflectionExtension; - -/** - * Monolog POSIX signal handler - * - * @author Robert Gust-Bardon <robert@gust-bardon.org> - * - * @phpstan-import-type Level from \Monolog\Logger - * @phpstan-import-type LevelName from \Monolog\Logger - */ -class SignalHandler -{ - /** @var LoggerInterface */ - private $logger; - - /** @var array<int, callable|string|int> SIG_DFL, SIG_IGN or previous callable */ - private $previousSignalHandler = []; - /** @var array<int, int> */ - private $signalLevelMap = []; - /** @var array<int, bool> */ - private $signalRestartSyscalls = []; - - public function __construct(LoggerInterface $logger) - { - $this->logger = $logger; - } - - /** - * @param int|string $level Level or level name - * @param bool $callPrevious - * @param bool $restartSyscalls - * @param bool|null $async - * @return $this - * - * @phpstan-param Level|LevelName|LogLevel::* $level - */ - public function registerSignalHandler(int $signo, $level = LogLevel::CRITICAL, bool $callPrevious = true, bool $restartSyscalls = true, ?bool $async = true): self - { - if (!extension_loaded('pcntl') || !function_exists('pcntl_signal')) { - return $this; - } - - $level = Logger::toMonologLevel($level); - - if ($callPrevious) { - $handler = pcntl_signal_get_handler($signo); - $this->previousSignalHandler[$signo] = $handler; - } else { - unset($this->previousSignalHandler[$signo]); - } - $this->signalLevelMap[$signo] = $level; - $this->signalRestartSyscalls[$signo] = $restartSyscalls; - - if ($async !== null) { - pcntl_async_signals($async); - } - - pcntl_signal($signo, [$this, 'handleSignal'], $restartSyscalls); - - return $this; - } - - /** - * @param mixed $siginfo - */ - public function handleSignal(int $signo, $siginfo = null): void - { - static $signals = []; - - if (!$signals && extension_loaded('pcntl')) { - $pcntl = new ReflectionExtension('pcntl'); - // HHVM 3.24.2 returns an empty array. - foreach ($pcntl->getConstants() ?: get_defined_constants(true)['Core'] as $name => $value) { - if (substr($name, 0, 3) === 'SIG' && $name[3] !== '_' && is_int($value)) { - $signals[$value] = $name; - } - } - } - - $level = $this->signalLevelMap[$signo] ?? LogLevel::CRITICAL; - $signal = $signals[$signo] ?? $signo; - $context = $siginfo ?? []; - $this->logger->log($level, sprintf('Program received signal %s', $signal), $context); - - if (!isset($this->previousSignalHandler[$signo])) { - return; - } - - if ($this->previousSignalHandler[$signo] === SIG_DFL) { - if (extension_loaded('pcntl') && function_exists('pcntl_signal') && function_exists('pcntl_sigprocmask') && function_exists('pcntl_signal_dispatch') - && extension_loaded('posix') && function_exists('posix_getpid') && function_exists('posix_kill') - ) { - $restartSyscalls = $this->signalRestartSyscalls[$signo] ?? true; - pcntl_signal($signo, SIG_DFL, $restartSyscalls); - pcntl_sigprocmask(SIG_UNBLOCK, [$signo], $oldset); - posix_kill(posix_getpid(), $signo); - pcntl_signal_dispatch(); - pcntl_sigprocmask(SIG_SETMASK, $oldset); - pcntl_signal($signo, [$this, 'handleSignal'], $restartSyscalls); - } - } elseif (is_callable($this->previousSignalHandler[$signo])) { - $this->previousSignalHandler[$signo]($signo, $siginfo); - } - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Test/TestCase.php b/vendor/monolog/monolog/src/Monolog/Test/TestCase.php deleted file mode 100644 index bc0b425e..00000000 --- a/vendor/monolog/monolog/src/Monolog/Test/TestCase.php +++ /dev/null @@ -1,85 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Test; - -use Monolog\Logger; -use Monolog\DateTimeImmutable; -use Monolog\Formatter\FormatterInterface; - -/** - * Lets you easily generate log records and a dummy formatter for testing purposes - * - * @author Jordi Boggiano <j.boggiano@seld.be> - * - * @phpstan-import-type Record from \Monolog\Logger - * @phpstan-import-type Level from \Monolog\Logger - * - * @internal feel free to reuse this to test your own handlers, this is marked internal to avoid issues with PHPStorm https://github.com/Seldaek/monolog/issues/1677 - */ -class TestCase extends \PHPUnit\Framework\TestCase -{ - public function tearDown(): void - { - parent::tearDown(); - - if (isset($this->handler)) { - unset($this->handler); - } - } - - /** - * @param mixed[] $context - * - * @return array Record - * - * @phpstan-param Level $level - * @phpstan-return Record - */ - protected function getRecord(int $level = Logger::WARNING, string $message = 'test', array $context = []): array - { - return [ - 'message' => (string) $message, - 'context' => $context, - 'level' => $level, - 'level_name' => Logger::getLevelName($level), - 'channel' => 'test', - 'datetime' => new DateTimeImmutable(true), - 'extra' => [], - ]; - } - - /** - * @phpstan-return Record[] - */ - protected function getMultipleRecords(): array - { - return [ - $this->getRecord(Logger::DEBUG, 'debug message 1'), - $this->getRecord(Logger::DEBUG, 'debug message 2'), - $this->getRecord(Logger::INFO, 'information'), - $this->getRecord(Logger::WARNING, 'warning'), - $this->getRecord(Logger::ERROR, 'error'), - ]; - } - - protected function getIdentityFormatter(): FormatterInterface - { - $formatter = $this->createMock(FormatterInterface::class); - $formatter->expects($this->any()) - ->method('format') - ->will($this->returnCallback(function ($record) { - return $record['message']; - })); - - return $formatter; - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Utils.php b/vendor/monolog/monolog/src/Monolog/Utils.php deleted file mode 100644 index 360c4219..00000000 --- a/vendor/monolog/monolog/src/Monolog/Utils.php +++ /dev/null @@ -1,284 +0,0 @@ -<?php declare(strict_types=1); - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog; - -final class Utils -{ - const DEFAULT_JSON_FLAGS = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRESERVE_ZERO_FRACTION | JSON_INVALID_UTF8_SUBSTITUTE | JSON_PARTIAL_OUTPUT_ON_ERROR; - - public static function getClass(object $object): string - { - $class = \get_class($object); - - if (false === ($pos = \strpos($class, "@anonymous\0"))) { - return $class; - } - - if (false === ($parent = \get_parent_class($class))) { - return \substr($class, 0, $pos + 10); - } - - return $parent . '@anonymous'; - } - - public static function substr(string $string, int $start, ?int $length = null): string - { - if (extension_loaded('mbstring')) { - return mb_strcut($string, $start, $length); - } - - return substr($string, $start, (null === $length) ? strlen($string) : $length); - } - - /** - * Makes sure if a relative path is passed in it is turned into an absolute path - * - * @param string $streamUrl stream URL or path without protocol - */ - public static function canonicalizePath(string $streamUrl): string - { - $prefix = ''; - if ('file://' === substr($streamUrl, 0, 7)) { - $streamUrl = substr($streamUrl, 7); - $prefix = 'file://'; - } - - // other type of stream, not supported - if (false !== strpos($streamUrl, '://')) { - return $streamUrl; - } - - // already absolute - if (substr($streamUrl, 0, 1) === '/' || substr($streamUrl, 1, 1) === ':' || substr($streamUrl, 0, 2) === '\\\\') { - return $prefix.$streamUrl; - } - - $streamUrl = getcwd() . '/' . $streamUrl; - - return $prefix.$streamUrl; - } - - /** - * Return the JSON representation of a value - * - * @param mixed $data - * @param int $encodeFlags flags to pass to json encode, defaults to DEFAULT_JSON_FLAGS - * @param bool $ignoreErrors whether to ignore encoding errors or to throw on error, when ignored and the encoding fails, "null" is returned which is valid json for null - * @throws \RuntimeException if encoding fails and errors are not ignored - * @return string when errors are ignored and the encoding fails, "null" is returned which is valid json for null - */ - public static function jsonEncode($data, ?int $encodeFlags = null, bool $ignoreErrors = false): string - { - if (null === $encodeFlags) { - $encodeFlags = self::DEFAULT_JSON_FLAGS; - } - - if ($ignoreErrors) { - $json = @json_encode($data, $encodeFlags); - if (false === $json) { - return 'null'; - } - - return $json; - } - - $json = json_encode($data, $encodeFlags); - if (false === $json) { - $json = self::handleJsonError(json_last_error(), $data); - } - - return $json; - } - - /** - * Handle a json_encode failure. - * - * If the failure is due to invalid string encoding, try to clean the - * input and encode again. If the second encoding attempt fails, the - * initial error is not encoding related or the input can't be cleaned then - * raise a descriptive exception. - * - * @param int $code return code of json_last_error function - * @param mixed $data data that was meant to be encoded - * @param int $encodeFlags flags to pass to json encode, defaults to JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRESERVE_ZERO_FRACTION - * @throws \RuntimeException if failure can't be corrected - * @return string JSON encoded data after error correction - */ - public static function handleJsonError(int $code, $data, ?int $encodeFlags = null): string - { - if ($code !== JSON_ERROR_UTF8) { - self::throwEncodeError($code, $data); - } - - if (is_string($data)) { - self::detectAndCleanUtf8($data); - } elseif (is_array($data)) { - array_walk_recursive($data, array('Monolog\Utils', 'detectAndCleanUtf8')); - } else { - self::throwEncodeError($code, $data); - } - - if (null === $encodeFlags) { - $encodeFlags = self::DEFAULT_JSON_FLAGS; - } - - $json = json_encode($data, $encodeFlags); - - if ($json === false) { - self::throwEncodeError(json_last_error(), $data); - } - - return $json; - } - - /** - * @internal - */ - public static function pcreLastErrorMessage(int $code): string - { - if (PHP_VERSION_ID >= 80000) { - return preg_last_error_msg(); - } - - $constants = (get_defined_constants(true))['pcre']; - $constants = array_filter($constants, function ($key) { - return substr($key, -6) == '_ERROR'; - }, ARRAY_FILTER_USE_KEY); - - $constants = array_flip($constants); - - return $constants[$code] ?? 'UNDEFINED_ERROR'; - } - - /** - * Throws an exception according to a given code with a customized message - * - * @param int $code return code of json_last_error function - * @param mixed $data data that was meant to be encoded - * @throws \RuntimeException - * - * @return never - */ - private static function throwEncodeError(int $code, $data): void - { - switch ($code) { - case JSON_ERROR_DEPTH: - $msg = 'Maximum stack depth exceeded'; - break; - case JSON_ERROR_STATE_MISMATCH: - $msg = 'Underflow or the modes mismatch'; - break; - case JSON_ERROR_CTRL_CHAR: - $msg = 'Unexpected control character found'; - break; - case JSON_ERROR_UTF8: - $msg = 'Malformed UTF-8 characters, possibly incorrectly encoded'; - break; - default: - $msg = 'Unknown error'; - } - - throw new \RuntimeException('JSON encoding failed: '.$msg.'. Encoding: '.var_export($data, true)); - } - - /** - * Detect invalid UTF-8 string characters and convert to valid UTF-8. - * - * Valid UTF-8 input will be left unmodified, but strings containing - * invalid UTF-8 codepoints will be reencoded as UTF-8 with an assumed - * original encoding of ISO-8859-15. This conversion may result in - * incorrect output if the actual encoding was not ISO-8859-15, but it - * will be clean UTF-8 output and will not rely on expensive and fragile - * detection algorithms. - * - * Function converts the input in place in the passed variable so that it - * can be used as a callback for array_walk_recursive. - * - * @param mixed $data Input to check and convert if needed, passed by ref - */ - private static function detectAndCleanUtf8(&$data): void - { - if (is_string($data) && !preg_match('//u', $data)) { - $data = preg_replace_callback( - '/[\x80-\xFF]+/', - function ($m) { - return function_exists('mb_convert_encoding') ? mb_convert_encoding($m[0], 'UTF-8', 'ISO-8859-1') : utf8_encode($m[0]); - }, - $data - ); - if (!is_string($data)) { - $pcreErrorCode = preg_last_error(); - throw new \RuntimeException('Failed to preg_replace_callback: ' . $pcreErrorCode . ' / ' . self::pcreLastErrorMessage($pcreErrorCode)); - } - $data = str_replace( - ['¤', '¦', '¨', '´', '¸', '¼', '½', '¾'], - ['€', 'Š', 'š', 'Ž', 'ž', 'Œ', 'œ', 'Ÿ'], - $data - ); - } - } - - /** - * Converts a string with a valid 'memory_limit' format, to bytes. - * - * @param string|false $val - * @return int|false Returns an integer representing bytes. Returns FALSE in case of error. - */ - public static function expandIniShorthandBytes($val) - { - if (!is_string($val)) { - return false; - } - - // support -1 - if ((int) $val < 0) { - return (int) $val; - } - - if (!preg_match('/^\s*(?<val>\d+)(?:\.\d+)?\s*(?<unit>[gmk]?)\s*$/i', $val, $match)) { - return false; - } - - $val = (int) $match['val']; - switch (strtolower($match['unit'] ?? '')) { - case 'g': - $val *= 1024; - case 'm': - $val *= 1024; - case 'k': - $val *= 1024; - } - - return $val; - } - - /** - * @param array<mixed> $record - */ - public static function getRecordMessageForException(array $record): string - { - $context = ''; - $extra = ''; - try { - if ($record['context']) { - $context = "\nContext: " . json_encode($record['context']); - } - if ($record['extra']) { - $extra = "\nExtra: " . json_encode($record['extra']); - } - } catch (\Throwable $e) { - // noop - } - - return "\nThe exception occurred while attempting to log: " . $record['message'] . $context . $extra; - } -} diff --git a/vendor/myclabs/deep-copy/.github/FUNDING.yml b/vendor/myclabs/deep-copy/.github/FUNDING.yml deleted file mode 100644 index b8da664d..00000000 --- a/vendor/myclabs/deep-copy/.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: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: "packagist/myclabs/deep-copy" -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/myclabs/deep-copy/.github/workflows/ci.yaml b/vendor/myclabs/deep-copy/.github/workflows/ci.yaml deleted file mode 100644 index eac2812e..00000000 --- a/vendor/myclabs/deep-copy/.github/workflows/ci.yaml +++ /dev/null @@ -1,101 +0,0 @@ -name: "Continuous Integration" - -on: - - pull_request - - push - -env: - COMPOSER_ROOT_VERSION: 1.99 - -jobs: - composer-json-lint: - name: "Lint composer.json" - - runs-on: "ubuntu-latest" - - strategy: - matrix: - php-version: - - "8.1" - - steps: - - name: "Checkout" - uses: "actions/checkout@v2" - - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - with: - coverage: "none" - php-version: "${{ matrix.php-version }}" - tools: composer-normalize - - - name: "Get composer cache directory" - id: composercache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: "Cache dependencies" - uses: actions/cache@v2 - with: - path: ${{ steps.composercache.outputs.dir }} - key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer- - - - name: "Install dependencies" - run: "composer update --no-interaction --no-progress" - - - name: "Validate composer.json" - run: "composer validate --strict" - - - name: "Normalize composer.json" - run: "composer-normalize --dry-run" - - tests: - name: "Tests" - - runs-on: "ubuntu-latest" - - strategy: - matrix: - php-version: - - "7.1" - - "7.2" - - "7.3" - - "7.4" - - "8.0" - - "8.1" - dependencies: - - "lowest" - - "highest" - - steps: - - name: "Checkout" - uses: "actions/checkout@v2" - - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - with: - php-version: "${{ matrix.php-version }}" - ini-values: zend.assertions=1 - - - name: "Get composer cache directory" - id: composercache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: "Cache dependencies" - uses: actions/cache@v2 - with: - path: ${{ steps.composercache.outputs.dir }} - key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer- - - - name: "Install lowest dependencies" - if: ${{ matrix.dependencies == 'lowest' }} - run: "composer update --no-interaction --no-progress --prefer-lowest" - - - name: "Install highest dependencies" - if: ${{ matrix.dependencies == 'highest' }} - run: "composer update --no-interaction --no-progress" - - - name: "Run tests" - timeout-minutes: 3 - run: "vendor/bin/phpunit" diff --git a/vendor/myclabs/deep-copy/LICENSE b/vendor/myclabs/deep-copy/LICENSE deleted file mode 100644 index c3e83500..00000000 --- a/vendor/myclabs/deep-copy/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013 My C-Sense - -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/myclabs/deep-copy/README.md b/vendor/myclabs/deep-copy/README.md deleted file mode 100644 index 503e93df..00000000 --- a/vendor/myclabs/deep-copy/README.md +++ /dev/null @@ -1,373 +0,0 @@ -# DeepCopy - -DeepCopy helps you create deep copies (clones) of your objects. It is designed to handle cycles in the association graph. - -[![Total Downloads](https://poser.pugx.org/myclabs/deep-copy/downloads.svg)](https://packagist.org/packages/myclabs/deep-copy) -[![Integrate](https://github.com/myclabs/DeepCopy/workflows/ci/badge.svg?branch=1.x)](https://github.com/myclabs/DeepCopy/actions) - -## Table of Contents - -1. [How](#how) -1. [Why](#why) - 1. [Using simply `clone`](#using-simply-clone) - 1. [Overriding `__clone()`](#overriding-__clone) - 1. [With `DeepCopy`](#with-deepcopy) -1. [How it works](#how-it-works) -1. [Going further](#going-further) - 1. [Matchers](#matchers) - 1. [Property name](#property-name) - 1. [Specific property](#specific-property) - 1. [Type](#type) - 1. [Filters](#filters) - 1. [`SetNullFilter`](#setnullfilter-filter) - 1. [`KeepFilter`](#keepfilter-filter) - 1. [`DoctrineCollectionFilter`](#doctrinecollectionfilter-filter) - 1. [`DoctrineEmptyCollectionFilter`](#doctrineemptycollectionfilter-filter) - 1. [`DoctrineProxyFilter`](#doctrineproxyfilter-filter) - 1. [`ReplaceFilter`](#replacefilter-type-filter) - 1. [`ShallowCopyFilter`](#shallowcopyfilter-type-filter) -1. [Edge cases](#edge-cases) -1. [Contributing](#contributing) - 1. [Tests](#tests) - - -## How? - -Install with Composer: - -``` -composer require myclabs/deep-copy -``` - -Use it: - -```php -use DeepCopy\DeepCopy; - -$copier = new DeepCopy(); -$myCopy = $copier->copy($myObject); -``` - - -## Why? - -- How do you create copies of your objects? - -```php -$myCopy = clone $myObject; -``` - -- How do you create **deep** copies of your objects (i.e. copying also all the objects referenced in the properties)? - -You use [`__clone()`](http://www.php.net/manual/en/language.oop5.cloning.php#object.clone) and implement the behavior -yourself. - -- But how do you handle **cycles** in the association graph? - -Now you're in for a big mess :( - -![association graph](doc/graph.png) - - -### Using simply `clone` - -![Using clone](doc/clone.png) - - -### Overriding `__clone()` - -![Overriding __clone](doc/deep-clone.png) - - -### With `DeepCopy` - -![With DeepCopy](doc/deep-copy.png) - - -## How it works - -DeepCopy recursively traverses all the object's properties and clones them. To avoid cloning the same object twice it -keeps a hash map of all instances and thus preserves the object graph. - -To use it: - -```php -use function DeepCopy\deep_copy; - -$copy = deep_copy($var); -``` - -Alternatively, you can create your own `DeepCopy` instance to configure it differently for example: - -```php -use DeepCopy\DeepCopy; - -$copier = new DeepCopy(true); - -$copy = $copier->copy($var); -``` - -You may want to roll your own deep copy function: - -```php -namespace Acme; - -use DeepCopy\DeepCopy; - -function deep_copy($var) -{ - static $copier = null; - - if (null === $copier) { - $copier = new DeepCopy(true); - } - - return $copier->copy($var); -} -``` - - -## Going further - -You can add filters to customize the copy process. - -The method to add a filter is `DeepCopy\DeepCopy::addFilter($filter, $matcher)`, -with `$filter` implementing `DeepCopy\Filter\Filter` -and `$matcher` implementing `DeepCopy\Matcher\Matcher`. - -We provide some generic filters and matchers. - - -### Matchers - - - `DeepCopy\Matcher` applies on a object attribute. - - `DeepCopy\TypeMatcher` applies on any element found in graph, including array elements. - - -#### Property name - -The `PropertyNameMatcher` will match a property by its name: - -```php -use DeepCopy\Matcher\PropertyNameMatcher; - -// Will apply a filter to any property of any objects named "id" -$matcher = new PropertyNameMatcher('id'); -``` - - -#### Specific property - -The `PropertyMatcher` will match a specific property of a specific class: - -```php -use DeepCopy\Matcher\PropertyMatcher; - -// Will apply a filter to the property "id" of any objects of the class "MyClass" -$matcher = new PropertyMatcher('MyClass', 'id'); -``` - - -#### Type - -The `TypeMatcher` will match any element by its type (instance of a class or any value that could be parameter of -[gettype()](http://php.net/manual/en/function.gettype.php) function): - -```php -use DeepCopy\TypeMatcher\TypeMatcher; - -// Will apply a filter to any object that is an instance of Doctrine\Common\Collections\Collection -$matcher = new TypeMatcher('Doctrine\Common\Collections\Collection'); -``` - - -### Filters - -- `DeepCopy\Filter` applies a transformation to the object attribute matched by `DeepCopy\Matcher` -- `DeepCopy\TypeFilter` applies a transformation to any element matched by `DeepCopy\TypeMatcher` - - -#### `SetNullFilter` (filter) - -Let's say for example that you are copying a database record (or a Doctrine entity), so you want the copy not to have -any ID: - -```php -use DeepCopy\DeepCopy; -use DeepCopy\Filter\SetNullFilter; -use DeepCopy\Matcher\PropertyNameMatcher; - -$object = MyClass::load(123); -echo $object->id; // 123 - -$copier = new DeepCopy(); -$copier->addFilter(new SetNullFilter(), new PropertyNameMatcher('id')); - -$copy = $copier->copy($object); - -echo $copy->id; // null -``` - - -#### `KeepFilter` (filter) - -If you want a property to remain untouched (for example, an association to an object): - -```php -use DeepCopy\DeepCopy; -use DeepCopy\Filter\KeepFilter; -use DeepCopy\Matcher\PropertyMatcher; - -$copier = new DeepCopy(); -$copier->addFilter(new KeepFilter(), new PropertyMatcher('MyClass', 'category')); - -$copy = $copier->copy($object); -// $copy->category has not been touched -``` - - -#### `DoctrineCollectionFilter` (filter) - -If you use Doctrine and want to copy an entity, you will need to use the `DoctrineCollectionFilter`: - -```php -use DeepCopy\DeepCopy; -use DeepCopy\Filter\Doctrine\DoctrineCollectionFilter; -use DeepCopy\Matcher\PropertyTypeMatcher; - -$copier = new DeepCopy(); -$copier->addFilter(new DoctrineCollectionFilter(), new PropertyTypeMatcher('Doctrine\Common\Collections\Collection')); - -$copy = $copier->copy($object); -``` - - -#### `DoctrineEmptyCollectionFilter` (filter) - -If you use Doctrine and want to copy an entity who contains a `Collection` that you want to be reset, you can use the -`DoctrineEmptyCollectionFilter` - -```php -use DeepCopy\DeepCopy; -use DeepCopy\Filter\Doctrine\DoctrineEmptyCollectionFilter; -use DeepCopy\Matcher\PropertyMatcher; - -$copier = new DeepCopy(); -$copier->addFilter(new DoctrineEmptyCollectionFilter(), new PropertyMatcher('MyClass', 'myProperty')); - -$copy = $copier->copy($object); - -// $copy->myProperty will return an empty collection -``` - - -#### `DoctrineProxyFilter` (filter) - -If you use Doctrine and use cloning on lazy loaded entities, you might encounter errors mentioning missing fields on a -Doctrine proxy class (...\\\_\_CG\_\_\Proxy). -You can use the `DoctrineProxyFilter` to load the actual entity behind the Doctrine proxy class. -**Make sure, though, to put this as one of your very first filters in the filter chain so that the entity is loaded -before other filters are applied!** - -```php -use DeepCopy\DeepCopy; -use DeepCopy\Filter\Doctrine\DoctrineProxyFilter; -use DeepCopy\Matcher\Doctrine\DoctrineProxyMatcher; - -$copier = new DeepCopy(); -$copier->addFilter(new DoctrineProxyFilter(), new DoctrineProxyMatcher()); - -$copy = $copier->copy($object); - -// $copy should now contain a clone of all entities, including those that were not yet fully loaded. -``` - - -#### `ReplaceFilter` (type filter) - -1. If you want to replace the value of a property: - -```php -use DeepCopy\DeepCopy; -use DeepCopy\Filter\ReplaceFilter; -use DeepCopy\Matcher\PropertyMatcher; - -$copier = new DeepCopy(); -$callback = function ($currentValue) { - return $currentValue . ' (copy)' -}; -$copier->addFilter(new ReplaceFilter($callback), new PropertyMatcher('MyClass', 'title')); - -$copy = $copier->copy($object); - -// $copy->title will contain the data returned by the callback, e.g. 'The title (copy)' -``` - -2. If you want to replace whole element: - -```php -use DeepCopy\DeepCopy; -use DeepCopy\TypeFilter\ReplaceFilter; -use DeepCopy\TypeMatcher\TypeMatcher; - -$copier = new DeepCopy(); -$callback = function (MyClass $myClass) { - return get_class($myClass); -}; -$copier->addTypeFilter(new ReplaceFilter($callback), new TypeMatcher('MyClass')); - -$copy = $copier->copy([new MyClass, 'some string', new MyClass]); - -// $copy will contain ['MyClass', 'some string', 'MyClass'] -``` - - -The `$callback` parameter of the `ReplaceFilter` constructor accepts any PHP callable. - - -#### `ShallowCopyFilter` (type filter) - -Stop *DeepCopy* from recursively copying element, using standard `clone` instead: - -```php -use DeepCopy\DeepCopy; -use DeepCopy\TypeFilter\ShallowCopyFilter; -use DeepCopy\TypeMatcher\TypeMatcher; -use Mockery as m; - -$this->deepCopy = new DeepCopy(); -$this->deepCopy->addTypeFilter( - new ShallowCopyFilter, - new TypeMatcher(m\MockInterface::class) -); - -$myServiceWithMocks = new MyService(m::mock(MyDependency1::class), m::mock(MyDependency2::class)); -// All mocks will be just cloned, not deep copied -``` - - -## Edge cases - -The following structures cannot be deep-copied with PHP Reflection. As a result they are shallow cloned and filters are -not applied. There is two ways for you to handle them: - -- Implement your own `__clone()` method -- Use a filter with a type matcher - - -## Contributing - -DeepCopy is distributed under the MIT license. - - -### Tests - -Running the tests is simple: - -```php -vendor/bin/phpunit -``` - -### Support - -Get professional support via [the Tidelift Subscription](https://tidelift.com/subscription/pkg/packagist-myclabs-deep-copy?utm_source=packagist-myclabs-deep-copy&utm_medium=referral&utm_campaign=readme). diff --git a/vendor/myclabs/deep-copy/composer.json b/vendor/myclabs/deep-copy/composer.json deleted file mode 100644 index 66fb34a5..00000000 --- a/vendor/myclabs/deep-copy/composer.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "myclabs/deep-copy", - "description": "Create deep copies (clones) of your objects", - "license": "MIT", - "type": "library", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/collections": "^1.6.8", - "doctrine/common": "^2.13.3 || ^3.2.2", - "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" - }, - "conflict": { - "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" - }, - "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, - "files": [ - "src/DeepCopy/deep_copy.php" - ] - }, - "autoload-dev": { - "psr-4": { - "DeepCopy\\": "fixtures/", - "DeepCopyTest\\": "tests/DeepCopyTest/" - } - }, - "config": { - "sort-packages": true - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php b/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php deleted file mode 100644 index 5e68c64e..00000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php +++ /dev/null @@ -1,303 +0,0 @@ -<?php - -namespace DeepCopy; - -use ArrayObject; -use DateInterval; -use DateTimeInterface; -use DateTimeZone; -use DeepCopy\Exception\CloneException; -use DeepCopy\Filter\Filter; -use DeepCopy\Matcher\Matcher; -use DeepCopy\Reflection\ReflectionHelper; -use DeepCopy\TypeFilter\Date\DateIntervalFilter; -use DeepCopy\TypeFilter\Spl\ArrayObjectFilter; -use DeepCopy\TypeFilter\Spl\SplDoublyLinkedListFilter; -use DeepCopy\TypeFilter\TypeFilter; -use DeepCopy\TypeMatcher\TypeMatcher; -use ReflectionObject; -use ReflectionProperty; -use SplDoublyLinkedList; - -/** - * @final - */ -class DeepCopy -{ - /** - * @var object[] List of objects copied. - */ - private $hashMap = []; - - /** - * Filters to apply. - * - * @var array Array of ['filter' => Filter, 'matcher' => Matcher] pairs. - */ - private $filters = []; - - /** - * Type Filters to apply. - * - * @var array Array of ['filter' => Filter, 'matcher' => Matcher] pairs. - */ - private $typeFilters = []; - - /** - * @var bool - */ - private $skipUncloneable = false; - - /** - * @var bool - */ - private $useCloneMethod; - - /** - * @param bool $useCloneMethod If set to true, when an object implements the __clone() function, it will be used - * instead of the regular deep cloning. - */ - public function __construct($useCloneMethod = false) - { - $this->useCloneMethod = $useCloneMethod; - - $this->addTypeFilter(new ArrayObjectFilter($this), new TypeMatcher(ArrayObject::class)); - $this->addTypeFilter(new DateIntervalFilter(), new TypeMatcher(DateInterval::class)); - $this->addTypeFilter(new SplDoublyLinkedListFilter($this), new TypeMatcher(SplDoublyLinkedList::class)); - } - - /** - * If enabled, will not throw an exception when coming across an uncloneable property. - * - * @param $skipUncloneable - * - * @return $this - */ - public function skipUncloneable($skipUncloneable = true) - { - $this->skipUncloneable = $skipUncloneable; - - return $this; - } - - /** - * Deep copies the given object. - * - * @param mixed $object - * - * @return mixed - */ - public function copy($object) - { - $this->hashMap = []; - - return $this->recursiveCopy($object); - } - - public function addFilter(Filter $filter, Matcher $matcher) - { - $this->filters[] = [ - 'matcher' => $matcher, - 'filter' => $filter, - ]; - } - - public function prependFilter(Filter $filter, Matcher $matcher) - { - array_unshift($this->filters, [ - 'matcher' => $matcher, - 'filter' => $filter, - ]); - } - - public function addTypeFilter(TypeFilter $filter, TypeMatcher $matcher) - { - $this->typeFilters[] = [ - 'matcher' => $matcher, - 'filter' => $filter, - ]; - } - - private function recursiveCopy($var) - { - // Matches Type Filter - if ($filter = $this->getFirstMatchedTypeFilter($this->typeFilters, $var)) { - return $filter->apply($var); - } - - // Resource - if (is_resource($var)) { - return $var; - } - - // Array - if (is_array($var)) { - return $this->copyArray($var); - } - - // Scalar - if (! is_object($var)) { - return $var; - } - - // Enum - if (PHP_VERSION_ID >= 80100 && enum_exists(get_class($var))) { - return $var; - } - - // Object - return $this->copyObject($var); - } - - /** - * Copy an array - * @param array $array - * @return array - */ - private function copyArray(array $array) - { - foreach ($array as $key => $value) { - $array[$key] = $this->recursiveCopy($value); - } - - return $array; - } - - /** - * Copies an object. - * - * @param object $object - * - * @throws CloneException - * - * @return object - */ - private function copyObject($object) - { - $objectHash = spl_object_hash($object); - - if (isset($this->hashMap[$objectHash])) { - return $this->hashMap[$objectHash]; - } - - $reflectedObject = new ReflectionObject($object); - $isCloneable = $reflectedObject->isCloneable(); - - if (false === $isCloneable) { - if ($this->skipUncloneable) { - $this->hashMap[$objectHash] = $object; - - return $object; - } - - throw new CloneException( - sprintf( - 'The class "%s" is not cloneable.', - $reflectedObject->getName() - ) - ); - } - - $newObject = clone $object; - $this->hashMap[$objectHash] = $newObject; - - if ($this->useCloneMethod && $reflectedObject->hasMethod('__clone')) { - return $newObject; - } - - if ($newObject instanceof DateTimeInterface || $newObject instanceof DateTimeZone) { - return $newObject; - } - - foreach (ReflectionHelper::getProperties($reflectedObject) as $property) { - $this->copyObjectProperty($newObject, $property); - } - - return $newObject; - } - - private function copyObjectProperty($object, ReflectionProperty $property) - { - // Ignore static properties - if ($property->isStatic()) { - return; - } - - // Apply the filters - foreach ($this->filters as $item) { - /** @var Matcher $matcher */ - $matcher = $item['matcher']; - /** @var Filter $filter */ - $filter = $item['filter']; - - if ($matcher->matches($object, $property->getName())) { - $filter->apply( - $object, - $property->getName(), - function ($object) { - return $this->recursiveCopy($object); - } - ); - - // If a filter matches, we stop processing this property - return; - } - } - - $property->setAccessible(true); - - // Ignore uninitialized properties (for PHP >7.4) - if (method_exists($property, 'isInitialized') && !$property->isInitialized($object)) { - return; - } - - $propertyValue = $property->getValue($object); - - // Copy the property - $property->setValue($object, $this->recursiveCopy($propertyValue)); - } - - /** - * Returns first filter that matches variable, `null` if no such filter found. - * - * @param array $filterRecords Associative array with 2 members: 'filter' with value of type {@see TypeFilter} and - * 'matcher' with value of type {@see TypeMatcher} - * @param mixed $var - * - * @return TypeFilter|null - */ - private function getFirstMatchedTypeFilter(array $filterRecords, $var) - { - $matched = $this->first( - $filterRecords, - function (array $record) use ($var) { - /* @var TypeMatcher $matcher */ - $matcher = $record['matcher']; - - return $matcher->matches($var); - } - ); - - return isset($matched) ? $matched['filter'] : null; - } - - /** - * Returns first element that matches predicate, `null` if no such element found. - * - * @param array $elements Array of ['filter' => Filter, 'matcher' => Matcher] pairs. - * @param callable $predicate Predicate arguments are: element. - * - * @return array|null Associative array with 2 members: 'filter' with value of type {@see TypeFilter} and 'matcher' - * with value of type {@see TypeMatcher} or `null`. - */ - private function first(array $elements, callable $predicate) - { - foreach ($elements as $element) { - if (call_user_func($predicate, $element)) { - return $element; - } - } - - return null; - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Exception/CloneException.php b/vendor/myclabs/deep-copy/src/DeepCopy/Exception/CloneException.php deleted file mode 100644 index c046706a..00000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Exception/CloneException.php +++ /dev/null @@ -1,9 +0,0 @@ -<?php - -namespace DeepCopy\Exception; - -use UnexpectedValueException; - -class CloneException extends UnexpectedValueException -{ -} \ No newline at end of file diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Exception/PropertyException.php b/vendor/myclabs/deep-copy/src/DeepCopy/Exception/PropertyException.php deleted file mode 100644 index 9702101a..00000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Exception/PropertyException.php +++ /dev/null @@ -1,9 +0,0 @@ -<?php - -namespace DeepCopy\Exception; - -use ReflectionException; - -class PropertyException extends ReflectionException -{ -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineCollectionFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineCollectionFilter.php deleted file mode 100644 index e6d93771..00000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineCollectionFilter.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -namespace DeepCopy\Filter\Doctrine; - -use DeepCopy\Filter\Filter; -use DeepCopy\Reflection\ReflectionHelper; - -/** - * @final - */ -class DoctrineCollectionFilter implements Filter -{ - /** - * Copies the object property doctrine collection. - * - * {@inheritdoc} - */ - public function apply($object, $property, $objectCopier) - { - $reflectionProperty = ReflectionHelper::getProperty($object, $property); - - $reflectionProperty->setAccessible(true); - $oldCollection = $reflectionProperty->getValue($object); - - $newCollection = $oldCollection->map( - function ($item) use ($objectCopier) { - return $objectCopier($item); - } - ); - - $reflectionProperty->setValue($object, $newCollection); - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineEmptyCollectionFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineEmptyCollectionFilter.php deleted file mode 100644 index 7b33fd54..00000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineEmptyCollectionFilter.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -namespace DeepCopy\Filter\Doctrine; - -use DeepCopy\Filter\Filter; -use DeepCopy\Reflection\ReflectionHelper; -use Doctrine\Common\Collections\ArrayCollection; - -/** - * @final - */ -class DoctrineEmptyCollectionFilter implements Filter -{ - /** - * Sets the object property to an empty doctrine collection. - * - * @param object $object - * @param string $property - * @param callable $objectCopier - */ - public function apply($object, $property, $objectCopier) - { - $reflectionProperty = ReflectionHelper::getProperty($object, $property); - $reflectionProperty->setAccessible(true); - - $reflectionProperty->setValue($object, new ArrayCollection()); - } -} \ No newline at end of file diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineProxyFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineProxyFilter.php deleted file mode 100644 index 8bee8f76..00000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineProxyFilter.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -namespace DeepCopy\Filter\Doctrine; - -use DeepCopy\Filter\Filter; - -/** - * @final - */ -class DoctrineProxyFilter implements Filter -{ - /** - * Triggers the magic method __load() on a Doctrine Proxy class to load the - * actual entity from the database. - * - * {@inheritdoc} - */ - public function apply($object, $property, $objectCopier) - { - $object->__load(); - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Filter.php b/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Filter.php deleted file mode 100644 index 85ba18ce..00000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Filter.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php - -namespace DeepCopy\Filter; - -/** - * Filter to apply to a property while copying an object - */ -interface Filter -{ - /** - * Applies the filter to the object. - * - * @param object $object - * @param string $property - * @param callable $objectCopier - */ - public function apply($object, $property, $objectCopier); -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/KeepFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/Filter/KeepFilter.php deleted file mode 100644 index 4b11a081..00000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/KeepFilter.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -namespace DeepCopy\Filter; - -class KeepFilter implements Filter -{ - /** - * Keeps the value of the object property. - * - * {@inheritdoc} - */ - public function apply($object, $property, $objectCopier) - { - // Nothing to do - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/ReplaceFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/Filter/ReplaceFilter.php deleted file mode 100644 index 7aca593b..00000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/ReplaceFilter.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -namespace DeepCopy\Filter; - -use DeepCopy\Reflection\ReflectionHelper; - -/** - * @final - */ -class ReplaceFilter implements Filter -{ - /** - * @var callable - */ - protected $callback; - - /** - * @param callable $callable Will be called to get the new value for each property to replace - */ - public function __construct(callable $callable) - { - $this->callback = $callable; - } - - /** - * Replaces the object property by the result of the callback called with the object property. - * - * {@inheritdoc} - */ - public function apply($object, $property, $objectCopier) - { - $reflectionProperty = ReflectionHelper::getProperty($object, $property); - $reflectionProperty->setAccessible(true); - - $value = call_user_func($this->callback, $reflectionProperty->getValue($object)); - - $reflectionProperty->setValue($object, $value); - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/SetNullFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/Filter/SetNullFilter.php deleted file mode 100644 index bea86b88..00000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/SetNullFilter.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace DeepCopy\Filter; - -use DeepCopy\Reflection\ReflectionHelper; - -/** - * @final - */ -class SetNullFilter implements Filter -{ - /** - * Sets the object property to null. - * - * {@inheritdoc} - */ - public function apply($object, $property, $objectCopier) - { - $reflectionProperty = ReflectionHelper::getProperty($object, $property); - - $reflectionProperty->setAccessible(true); - $reflectionProperty->setValue($object, null); - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/Doctrine/DoctrineProxyMatcher.php b/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/Doctrine/DoctrineProxyMatcher.php deleted file mode 100644 index c5887b19..00000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/Doctrine/DoctrineProxyMatcher.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -namespace DeepCopy\Matcher\Doctrine; - -use DeepCopy\Matcher\Matcher; -use Doctrine\Persistence\Proxy; - -/** - * @final - */ -class DoctrineProxyMatcher implements Matcher -{ - /** - * Matches a Doctrine Proxy class. - * - * {@inheritdoc} - */ - public function matches($object, $property) - { - return $object instanceof Proxy; - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/Matcher.php b/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/Matcher.php deleted file mode 100644 index d67f3cac..00000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/Matcher.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -namespace DeepCopy\Matcher; - -interface Matcher -{ - /** - * @param object $object - * @param string $property - * - * @return boolean - */ - public function matches($object, $property); -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyMatcher.php b/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyMatcher.php deleted file mode 100644 index 073b20cb..00000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyMatcher.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -namespace DeepCopy\Matcher; - -/** - * @final - */ -class PropertyMatcher implements Matcher -{ - /** - * @var string - */ - private $class; - - /** - * @var string - */ - private $property; - - /** - * @param string $class Class name - * @param string $property Property name - */ - public function __construct($class, $property) - { - $this->class = $class; - $this->property = $property; - } - - /** - * Matches a specific property of a specific class. - * - * {@inheritdoc} - */ - public function matches($object, $property) - { - return ($object instanceof $this->class) && $property == $this->property; - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyNameMatcher.php b/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyNameMatcher.php deleted file mode 100644 index c8ec0d2b..00000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyNameMatcher.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -namespace DeepCopy\Matcher; - -/** - * @final - */ -class PropertyNameMatcher implements Matcher -{ - /** - * @var string - */ - private $property; - - /** - * @param string $property Property name - */ - public function __construct($property) - { - $this->property = $property; - } - - /** - * Matches a property by its name. - * - * {@inheritdoc} - */ - public function matches($object, $property) - { - return $property == $this->property; - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyTypeMatcher.php b/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyTypeMatcher.php deleted file mode 100644 index c7f46908..00000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyTypeMatcher.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php - -namespace DeepCopy\Matcher; - -use DeepCopy\Reflection\ReflectionHelper; -use ReflectionException; - -/** - * Matches a property by its type. - * - * It is recommended to use {@see DeepCopy\TypeFilter\TypeFilter} instead, as it applies on all occurrences - * of given type in copied context (eg. array elements), not just on object properties. - * - * @final - */ -class PropertyTypeMatcher implements Matcher -{ - /** - * @var string - */ - private $propertyType; - - /** - * @param string $propertyType Property type - */ - public function __construct($propertyType) - { - $this->propertyType = $propertyType; - } - - /** - * {@inheritdoc} - */ - public function matches($object, $property) - { - try { - $reflectionProperty = ReflectionHelper::getProperty($object, $property); - } catch (ReflectionException $exception) { - return false; - } - - $reflectionProperty->setAccessible(true); - - // Uninitialized properties (for PHP >7.4) - if (method_exists($reflectionProperty, 'isInitialized') && !$reflectionProperty->isInitialized($object)) { - // null instanceof $this->propertyType - return false; - } - - return $reflectionProperty->getValue($object) instanceof $this->propertyType; - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Reflection/ReflectionHelper.php b/vendor/myclabs/deep-copy/src/DeepCopy/Reflection/ReflectionHelper.php deleted file mode 100644 index 742410cb..00000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Reflection/ReflectionHelper.php +++ /dev/null @@ -1,78 +0,0 @@ -<?php - -namespace DeepCopy\Reflection; - -use DeepCopy\Exception\PropertyException; -use ReflectionClass; -use ReflectionException; -use ReflectionObject; -use ReflectionProperty; - -class ReflectionHelper -{ - /** - * Retrieves all properties (including private ones), from object and all its ancestors. - * - * Standard \ReflectionClass->getProperties() does not return private properties from ancestor classes. - * - * @author muratyaman@gmail.com - * @see http://php.net/manual/en/reflectionclass.getproperties.php - * - * @param ReflectionClass $ref - * - * @return ReflectionProperty[] - */ - public static function getProperties(ReflectionClass $ref) - { - $props = $ref->getProperties(); - $propsArr = array(); - - foreach ($props as $prop) { - $propertyName = $prop->getName(); - $propsArr[$propertyName] = $prop; - } - - if ($parentClass = $ref->getParentClass()) { - $parentPropsArr = self::getProperties($parentClass); - foreach ($propsArr as $key => $property) { - $parentPropsArr[$key] = $property; - } - - return $parentPropsArr; - } - - return $propsArr; - } - - /** - * Retrieves property by name from object and all its ancestors. - * - * @param object|string $object - * @param string $name - * - * @throws PropertyException - * @throws ReflectionException - * - * @return ReflectionProperty - */ - public static function getProperty($object, $name) - { - $reflection = is_object($object) ? new ReflectionObject($object) : new ReflectionClass($object); - - if ($reflection->hasProperty($name)) { - return $reflection->getProperty($name); - } - - if ($parentClass = $reflection->getParentClass()) { - return self::getProperty($parentClass->getName(), $name); - } - - throw new PropertyException( - sprintf( - 'The class "%s" doesn\'t have a property with the given name: "%s".', - is_object($object) ? get_class($object) : $object, - $name - ) - ); - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Date/DateIntervalFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Date/DateIntervalFilter.php deleted file mode 100644 index becd1cff..00000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Date/DateIntervalFilter.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -namespace DeepCopy\TypeFilter\Date; - -use DateInterval; -use DeepCopy\TypeFilter\TypeFilter; - -/** - * @final - * - * @deprecated Will be removed in 2.0. This filter will no longer be necessary in PHP 7.1+. - */ -class DateIntervalFilter implements TypeFilter -{ - - /** - * {@inheritdoc} - * - * @param DateInterval $element - * - * @see http://news.php.net/php.bugs/205076 - */ - public function apply($element) - { - $copy = new DateInterval('P0D'); - - foreach ($element as $propertyName => $propertyValue) { - $copy->{$propertyName} = $propertyValue; - } - - return $copy; - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/ReplaceFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/ReplaceFilter.php deleted file mode 100644 index 164f8b8e..00000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/ReplaceFilter.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php - -namespace DeepCopy\TypeFilter; - -/** - * @final - */ -class ReplaceFilter implements TypeFilter -{ - /** - * @var callable - */ - protected $callback; - - /** - * @param callable $callable Will be called to get the new value for each element to replace - */ - public function __construct(callable $callable) - { - $this->callback = $callable; - } - - /** - * {@inheritdoc} - */ - public function apply($element) - { - return call_user_func($this->callback, $element); - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/ShallowCopyFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/ShallowCopyFilter.php deleted file mode 100644 index a5fbd7a2..00000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/ShallowCopyFilter.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php - -namespace DeepCopy\TypeFilter; - -/** - * @final - */ -class ShallowCopyFilter implements TypeFilter -{ - /** - * {@inheritdoc} - */ - public function apply($element) - { - return clone $element; - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/ArrayObjectFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/ArrayObjectFilter.php deleted file mode 100644 index 17846017..00000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/ArrayObjectFilter.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php -namespace DeepCopy\TypeFilter\Spl; - -use DeepCopy\DeepCopy; -use DeepCopy\TypeFilter\TypeFilter; - -/** - * In PHP 7.4 the storage of an ArrayObject isn't returned as - * ReflectionProperty. So we deep copy its array copy. - */ -final class ArrayObjectFilter implements TypeFilter -{ - /** - * @var DeepCopy - */ - private $copier; - - public function __construct(DeepCopy $copier) - { - $this->copier = $copier; - } - - /** - * {@inheritdoc} - */ - public function apply($arrayObject) - { - $clone = clone $arrayObject; - foreach ($arrayObject->getArrayCopy() as $k => $v) { - $clone->offsetSet($k, $this->copier->copy($v)); - } - - return $clone; - } -} - diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/SplDoublyLinkedList.php b/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/SplDoublyLinkedList.php deleted file mode 100644 index c5644cff..00000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/SplDoublyLinkedList.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php - -namespace DeepCopy\TypeFilter\Spl; - -/** - * @deprecated Use {@see SplDoublyLinkedListFilter} instead. - */ -class SplDoublyLinkedList extends SplDoublyLinkedListFilter -{ -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/SplDoublyLinkedListFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/SplDoublyLinkedListFilter.php deleted file mode 100644 index c33be458..00000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/SplDoublyLinkedListFilter.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php - -namespace DeepCopy\TypeFilter\Spl; - -use Closure; -use DeepCopy\DeepCopy; -use DeepCopy\TypeFilter\TypeFilter; -use SplDoublyLinkedList; - -/** - * @final - */ -class SplDoublyLinkedListFilter implements TypeFilter -{ - private $copier; - - public function __construct(DeepCopy $copier) - { - $this->copier = $copier; - } - - /** - * {@inheritdoc} - */ - public function apply($element) - { - $newElement = clone $element; - - $copy = $this->createCopyClosure(); - - return $copy($newElement); - } - - private function createCopyClosure() - { - $copier = $this->copier; - - $copy = function (SplDoublyLinkedList $list) use ($copier) { - // Replace each element in the list with a deep copy of itself - for ($i = 1; $i <= $list->count(); $i++) { - $copy = $copier->recursiveCopy($list->shift()); - - $list->push($copy); - } - - return $list; - }; - - return Closure::bind($copy, null, DeepCopy::class); - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/TypeFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/TypeFilter.php deleted file mode 100644 index 5785a7da..00000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/TypeFilter.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php - -namespace DeepCopy\TypeFilter; - -interface TypeFilter -{ - /** - * Applies the filter to the object. - * - * @param mixed $element - */ - public function apply($element); -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/TypeMatcher/TypeMatcher.php b/vendor/myclabs/deep-copy/src/DeepCopy/TypeMatcher/TypeMatcher.php deleted file mode 100644 index a563cb29..00000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/TypeMatcher/TypeMatcher.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace DeepCopy\TypeMatcher; - -class TypeMatcher -{ - /** - * @var string - */ - private $type; - - /** - * @param string $type - */ - public function __construct($type) - { - $this->type = $type; - } - - /** - * @param mixed $element - * - * @return boolean - */ - public function matches($element) - { - return is_object($element) ? is_a($element, $this->type) : gettype($element) === $this->type; - } -} diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/deep_copy.php b/vendor/myclabs/deep-copy/src/DeepCopy/deep_copy.php deleted file mode 100644 index 55dcc926..00000000 --- a/vendor/myclabs/deep-copy/src/DeepCopy/deep_copy.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -namespace DeepCopy; - -use function function_exists; - -if (false === function_exists('DeepCopy\deep_copy')) { - /** - * Deep copies the given value. - * - * @param mixed $value - * @param bool $useCloneMethod - * - * @return mixed - */ - function deep_copy($value, $useCloneMethod = false) - { - return (new DeepCopy($useCloneMethod))->copy($value); - } -} diff --git a/vendor/nesbot/carbon/LICENSE b/vendor/nesbot/carbon/LICENSE deleted file mode 100644 index 6de45ebf..00000000 --- a/vendor/nesbot/carbon/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) Brian Nesbitt - -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/nesbot/carbon/bin/carbon b/vendor/nesbot/carbon/bin/carbon deleted file mode 100755 index b53ab738..00000000 --- a/vendor/nesbot/carbon/bin/carbon +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env php -<?php - -use Carbon\Cli\Invoker; - -$dir = __DIR__.'/..'; - -if (!file_exists($dir.'/autoload.php')) { - $dir = __DIR__.'/../vendor'; -} - -if (!file_exists($dir.'/autoload.php')) { - $dir = __DIR__.'/../../..'; -} - -if (!file_exists($dir.'/autoload.php')) { - echo 'Autoload not found.'; - exit(1); -} - -require $dir.'/autoload.php'; - -exit((new Invoker())(...$argv) ? 0 : 1); diff --git a/vendor/nesbot/carbon/bin/carbon.bat b/vendor/nesbot/carbon/bin/carbon.bat deleted file mode 100644 index 84599d34..00000000 --- a/vendor/nesbot/carbon/bin/carbon.bat +++ /dev/null @@ -1,4 +0,0 @@ -@ECHO OFF -setlocal DISABLEDELAYEDEXPANSION -SET BIN_TARGET=%~dp0/carbon -php "%BIN_TARGET%" %* diff --git a/vendor/nesbot/carbon/composer.json b/vendor/nesbot/carbon/composer.json deleted file mode 100644 index c7ca2def..00000000 --- a/vendor/nesbot/carbon/composer.json +++ /dev/null @@ -1,120 +0,0 @@ -{ - "name": "nesbot/carbon", - "description": "An API extension for DateTime that supports 281 different languages.", - "license": "MIT", - "type": "library", - "keywords": [ - "date", - "time", - "DateTime" - ], - "authors": [ - { - "name": "Brian Nesbitt", - "email": "brian@nesbot.com", - "homepage": "https://markido.com" - }, - { - "name": "kylekatarnls", - "homepage": "https://github.com/kylekatarnls" - } - ], - "homepage": "https://carbon.nesbot.com", - "support": { - "issues": "https://github.com/briannesbitt/Carbon/issues", - "source": "https://github.com/briannesbitt/Carbon", - "docs": "https://carbon.nesbot.com/docs" - }, - "funding": [ - { - "url": "https://github.com/sponsors/kylekatarnls", - "type": "github" - }, - { - "url": "https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme", - "type": "tidelift" - }, - { - "url": "https://opencollective.com/Carbon#sponsor", - "type": "opencollective" - } - ], - "require": { - "php": "^7.1.8 || ^8.0", - "ext-json": "*", - "symfony/polyfill-mbstring": "^1.0", - "symfony/polyfill-php80": "^1.16", - "symfony/translation": "^3.4 || ^4.0 || ^5.0 || ^6.0" - }, - "require-dev": { - "doctrine/dbal": "^2.0 || ^3.1.4", - "doctrine/orm": "^2.7", - "friendsofphp/php-cs-fixer": "^3.0", - "kylekatarnls/multi-tester": "^2.0", - "ondrejmirtes/better-reflection": "*", - "phpmd/phpmd": "^2.9", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12.99 || ^1.7.14", - "phpunit/php-file-iterator": "^2.0.5 || ^3.0.6", - "phpunit/phpunit": "^7.5.20 || ^8.5.26 || ^9.5.20", - "squizlabs/php_codesniffer": "^3.4" - }, - "minimum-stability": "dev", - "prefer-stable": true, - "autoload": { - "psr-4": { - "Carbon\\": "src/Carbon/" - } - }, - "autoload-dev": { - "psr-4": { - "Tests\\": "tests/" - }, - "files": [ - "tests/Laravel/ServiceProvider.php" - ] - }, - "bin": [ - "bin/carbon" - ], - "config": { - "allow-plugins": { - "phpstan/extension-installer": true, - "composer/package-versions-deprecated": true - }, - "process-timeout": 0, - "sort-packages": true - }, - "extra": { - "branch-alias": { - "dev-3.x": "3.x-dev", - "dev-master": "2.x-dev" - }, - "laravel": { - "providers": [ - "Carbon\\Laravel\\ServiceProvider" - ] - }, - "phpstan": { - "includes": [ - "extension.neon" - ] - } - }, - "scripts": { - "phpcs": "php-cs-fixer fix -v --diff --dry-run", - "phpdoc": "php phpdoc.php", - "phpmd": "phpmd src text /phpmd.xml", - "phpstan": "phpstan analyse --configuration phpstan.neon", - "phpunit": "phpunit --verbose", - "style-check": [ - "@phpcs", - "@phpstan", - "@phpmd" - ], - "test": [ - "@phpunit", - "@style-check" - ] - } -} diff --git a/vendor/nesbot/carbon/extension.neon b/vendor/nesbot/carbon/extension.neon deleted file mode 100644 index 33bf794f..00000000 --- a/vendor/nesbot/carbon/extension.neon +++ /dev/null @@ -1,5 +0,0 @@ -services: - - - class: Carbon\PHPStan\MacroExtension - tags: - - phpstan.broker.methodsClassReflectionExtension diff --git a/vendor/nesbot/carbon/lazy/Carbon/PHPStan/AbstractMacroBuiltin.php b/vendor/nesbot/carbon/lazy/Carbon/PHPStan/AbstractMacroBuiltin.php deleted file mode 100644 index ba7cf632..00000000 --- a/vendor/nesbot/carbon/lazy/Carbon/PHPStan/AbstractMacroBuiltin.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - -declare(strict_types=1); - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\PHPStan; - -use PHPStan\BetterReflection\Reflection; -use ReflectionMethod; - -if (!class_exists(AbstractReflectionMacro::class, false)) { - abstract class AbstractReflectionMacro extends AbstractMacro - { - /** - * {@inheritdoc} - */ - public function getReflection(): ?ReflectionMethod - { - if ($this->reflectionFunction instanceof Reflection\ReflectionMethod) { - return new Reflection\Adapter\ReflectionMethod($this->reflectionFunction); - } - - return $this->reflectionFunction instanceof ReflectionMethod - ? $this->reflectionFunction - : null; - } - } -} diff --git a/vendor/nesbot/carbon/lazy/Carbon/PHPStan/AbstractMacroStatic.php b/vendor/nesbot/carbon/lazy/Carbon/PHPStan/AbstractMacroStatic.php deleted file mode 100644 index bd4c8e80..00000000 --- a/vendor/nesbot/carbon/lazy/Carbon/PHPStan/AbstractMacroStatic.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -declare(strict_types=1); - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\PHPStan; - -use PHPStan\BetterReflection\Reflection; -use ReflectionMethod; - -if (!class_exists(AbstractReflectionMacro::class, false)) { - abstract class AbstractReflectionMacro extends AbstractMacro - { - /** - * {@inheritdoc} - */ - public function getReflection(): ?Reflection\Adapter\ReflectionMethod - { - if ($this->reflectionFunction instanceof Reflection\Adapter\ReflectionMethod) { - return $this->reflectionFunction; - } - - if ($this->reflectionFunction instanceof Reflection\ReflectionMethod) { - return new Reflection\Adapter\ReflectionMethod($this->reflectionFunction); - } - - return $this->reflectionFunction instanceof ReflectionMethod - ? new Reflection\Adapter\ReflectionMethod( - Reflection\ReflectionMethod::createFromName( - $this->reflectionFunction->getDeclaringClass()->getName(), - $this->reflectionFunction->getName() - ) - ) - : null; - } - } -} diff --git a/vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroStrongType.php b/vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroStrongType.php deleted file mode 100644 index f615b3a6..00000000 --- a/vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroStrongType.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -declare(strict_types=1); - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\PHPStan; - -if (!class_exists(LazyMacro::class, false)) { - abstract class LazyMacro extends AbstractReflectionMacro - { - /** - * {@inheritdoc} - */ - public function getFileName(): ?string - { - $file = $this->reflectionFunction->getFileName(); - - return (($file ? realpath($file) : null) ?: $file) ?: null; - } - - /** - * {@inheritdoc} - */ - public function getStartLine(): ?int - { - return $this->reflectionFunction->getStartLine(); - } - - /** - * {@inheritdoc} - */ - public function getEndLine(): ?int - { - return $this->reflectionFunction->getEndLine(); - } - } -} diff --git a/vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroWeakType.php b/vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroWeakType.php deleted file mode 100644 index bf64c1dd..00000000 --- a/vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroWeakType.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php - -declare(strict_types=1); - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\PHPStan; - -if (!class_exists(LazyMacro::class, false)) { - abstract class LazyMacro extends AbstractReflectionMacro - { - /** - * {@inheritdoc} - * - * @return string|false - */ - public function getFileName() - { - $file = $this->reflectionFunction->getFileName(); - - return (($file ? realpath($file) : null) ?: $file) ?: null; - } - - /** - * {@inheritdoc} - * - * @return int|false - */ - public function getStartLine() - { - return $this->reflectionFunction->getStartLine(); - } - - /** - * {@inheritdoc} - * - * @return int|false - */ - public function getEndLine() - { - return $this->reflectionFunction->getEndLine(); - } - } -} diff --git a/vendor/nesbot/carbon/lazy/Carbon/TranslatorStrongType.php b/vendor/nesbot/carbon/lazy/Carbon/TranslatorStrongType.php deleted file mode 100644 index d35308a6..00000000 --- a/vendor/nesbot/carbon/lazy/Carbon/TranslatorStrongType.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon; - -use Symfony\Component\Translation\MessageCatalogueInterface; - -if (!class_exists(LazyTranslator::class, false)) { - class LazyTranslator extends AbstractTranslator implements TranslatorStrongTypeInterface - { - public function trans(?string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string - { - return $this->translate($id, $parameters, $domain, $locale); - } - - public function getFromCatalogue(MessageCatalogueInterface $catalogue, string $id, string $domain = 'messages') - { - $messages = $this->getPrivateProperty($catalogue, 'messages'); - - if (isset($messages[$domain.MessageCatalogueInterface::INTL_DOMAIN_SUFFIX][$id])) { - return $messages[$domain.MessageCatalogueInterface::INTL_DOMAIN_SUFFIX][$id]; - } - - if (isset($messages[$domain][$id])) { - return $messages[$domain][$id]; - } - - $fallbackCatalogue = $this->getPrivateProperty($catalogue, 'fallbackCatalogue'); - - if ($fallbackCatalogue !== null) { - return $this->getFromCatalogue($fallbackCatalogue, $id, $domain); - } - - return $id; - } - - private function getPrivateProperty($instance, string $field) - { - return (function (string $field) { - return $this->$field; - })->call($instance, $field); - } - } -} diff --git a/vendor/nesbot/carbon/lazy/Carbon/TranslatorWeakType.php b/vendor/nesbot/carbon/lazy/Carbon/TranslatorWeakType.php deleted file mode 100644 index 94dbdc30..00000000 --- a/vendor/nesbot/carbon/lazy/Carbon/TranslatorWeakType.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon; - -if (!class_exists(LazyTranslator::class, false)) { - class LazyTranslator extends AbstractTranslator - { - /** - * Returns the translation. - * - * @param string|null $id - * @param array $parameters - * @param string|null $domain - * @param string|null $locale - * - * @return string - */ - public function trans($id, array $parameters = [], $domain = null, $locale = null) - { - return $this->translate($id, $parameters, $domain, $locale); - } - } -} diff --git a/vendor/nesbot/carbon/readme.md b/vendor/nesbot/carbon/readme.md deleted file mode 100644 index c04a0e95..00000000 --- a/vendor/nesbot/carbon/readme.md +++ /dev/null @@ -1,153 +0,0 @@ -# Carbon - -[![Latest Stable Version](https://img.shields.io/packagist/v/nesbot/carbon.svg?style=flat-square)](https://packagist.org/packages/nesbot/carbon) -[![Total Downloads](https://img.shields.io/packagist/dt/nesbot/carbon.svg?style=flat-square)](https://packagist.org/packages/nesbot/carbon) -[![GitHub Actions](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fbriannesbitt%2FCarbon%2Fbadge&style=flat-square&label=Build&logo=none)](https://actions-badge.atrox.dev/briannesbitt/Carbon/goto) -[![codecov.io](https://img.shields.io/codecov/c/github/briannesbitt/Carbon.svg?style=flat-square)](https://codecov.io/github/briannesbitt/Carbon?branch=master) -[![Tidelift](https://tidelift.com/badges/github/briannesbitt/Carbon)](https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme) - -An international PHP extension for DateTime. [https://carbon.nesbot.com](https://carbon.nesbot.com) - -```php -<?php - -use Carbon\Carbon; - -printf("Right now is %s", Carbon::now()->toDateTimeString()); -printf("Right now in Vancouver is %s", Carbon::now('America/Vancouver')); //implicit __toString() -$tomorrow = Carbon::now()->addDay(); -$lastWeek = Carbon::now()->subWeek(); -$nextSummerOlympics = Carbon::createFromDate(2016)->addYears(4); - -$officialDate = Carbon::now()->toRfc2822String(); - -$howOldAmI = Carbon::createFromDate(1975, 5, 21)->age; - -$noonTodayLondonTime = Carbon::createFromTime(12, 0, 0, 'Europe/London'); - -$internetWillBlowUpOn = Carbon::create(2038, 01, 19, 3, 14, 7, 'GMT'); - -// Don't really want this to happen so mock now -Carbon::setTestNow(Carbon::createFromDate(2000, 1, 1)); - -// comparisons are always done in UTC -if (Carbon::now()->gte($internetWillBlowUpOn)) { - die(); -} - -// Phew! Return to normal behaviour -Carbon::setTestNow(); - -if (Carbon::now()->isWeekend()) { - echo 'Party!'; -} -// Over 200 languages (and over 500 regional variants) supported: -echo Carbon::now()->subMinutes(2)->diffForHumans(); // '2 minutes ago' -echo Carbon::now()->subMinutes(2)->locale('zh_CN')->diffForHumans(); // '2分钟前' -echo Carbon::parse('2019-07-23 14:51')->isoFormat('LLLL'); // 'Tuesday, July 23, 2019 2:51 PM' -echo Carbon::parse('2019-07-23 14:51')->locale('fr_FR')->isoFormat('LLLL'); // 'mardi 23 juillet 2019 14:51' - -// ... but also does 'from now', 'after' and 'before' -// rolling up to seconds, minutes, hours, days, months, years - -$daysSinceEpoch = Carbon::createFromTimestamp(0)->diffInDays(); -``` - -[Get supported nesbot/carbon with the Tidelift Subscription](https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme) - -## Installation - -### With Composer - -``` -$ composer require nesbot/carbon -``` - -```json -{ - "require": { - "nesbot/carbon": "^2.16" - } -} -``` - -```php -<?php -require 'vendor/autoload.php'; - -use Carbon\Carbon; - -printf("Now: %s", Carbon::now()); -``` - -### Without Composer - -Why are you not using [composer](https://getcomposer.org/)? Download the Carbon [latest release](https://github.com/briannesbitt/Carbon/releases) and put the contents of the ZIP archive into a directory in your project. Then require the file `autoload.php` to get all classes and dependencies loaded on need. - -```php -<?php -require 'path-to-Carbon-directory/autoload.php'; - -use Carbon\Carbon; - -printf("Now: %s", Carbon::now()); -``` - -## Docs - -[https://carbon.nesbot.com/docs](https://carbon.nesbot.com/docs) - -## Security contact information - -To report a security vulnerability, please use the -[Tidelift security contact](https://tidelift.com/security). -Tidelift will coordinate the fix and disclosure. - -## Credits - -### Contributors - -This project exists thanks to all the people who contribute. - -<a href="https://github.com/briannesbitt/Carbon/graphs/contributors" target="_blank"><img src="https://opencollective.com/Carbon/contributors.svg?width=890&button=false" /></a> - -### Translators - -[Thanks to people helping us to translate Carbon in so many languages](https://carbon.nesbot.com/contribute/translators/) - -### Sponsors - -Support this project by becoming a sponsor. Your logo will show up here with a link to your website. - -<a href="https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme" target="_blank"><img src="https://carbon.nesbot.com/tidelift-brand.png" width="256" height="64"></a> -<a href="https://casinohex.org/canada/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img src="https://images.opencollective.com/hexcasinoca/2da3af2/logo/256.png" width="85" height="64"></a> - -<a href="https://github.com/taylorotwell" target="_blank"><img src="https://avatars.githubusercontent.com/u/463230?s=128&v=4" width="64" height="64"></a> -<a href="https://github.com/usefathom" target="_blank"><img src="https://avatars.githubusercontent.com/u/38684088?s=128&v=4" width="64" height="64"></a> -<a href="https://github.com/tobischulz" target="_blank"><img src="https://avatars.githubusercontent.com/u/576014?s=128&v=4" width="64" height="64"></a> - -<a href="https://opencollective.com/Carbon/sponsor/0/website" target="_blank"><img src="https://opencollective.com/Carbon/sponsor/0/avatar.svg"></a> -<a href="https://opencollective.com/Carbon/sponsor/1/website" target="_blank"><img src="https://opencollective.com/Carbon/sponsor/1/avatar.svg"></a> -<a href="https://opencollective.com/Carbon/sponsor/2/website" target="_blank"><img src="https://opencollective.com/Carbon/sponsor/2/avatar.svg"></a> -<a href="https://opencollective.com/Carbon/sponsor/3/website" target="_blank"><img src="https://opencollective.com/Carbon/sponsor/3/avatar.svg"></a> -<a href="https://opencollective.com/Carbon/sponsor/4/website" target="_blank"><img src="https://opencollective.com/Carbon/sponsor/4/avatar.svg"></a> -<a href="https://opencollective.com/Carbon/sponsor/5/website" target="_blank"><img src="https://opencollective.com/Carbon/sponsor/5/avatar.svg"></a> -<a href="https://opencollective.com/Carbon/sponsor/6/website" target="_blank"><img src="https://opencollective.com/Carbon/sponsor/6/avatar.svg"></a> -<a href="https://opencollective.com/Carbon/sponsor/7/website" target="_blank"><img src="https://opencollective.com/Carbon/sponsor/7/avatar.svg"></a> -<a href="https://opencollective.com/Carbon/sponsor/8/website" target="_blank"><img src="https://opencollective.com/Carbon/sponsor/8/avatar.svg"></a> - -[[Become a sponsor](https://opencollective.com/Carbon#sponsor)] - -### Backers - -Thank you to all our backers! 🙏 - -<a href="https://opencollective.com/Carbon#backers" target="_blank"><img src="https://opencollective.com/Carbon/backers.svg?width=890"></a> - -[[Become a backer](https://opencollective.com/Carbon#backer)] - -## Carbon for enterprise - -Available as part of the Tidelift Subscription. - -The maintainers of ``Carbon`` 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-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/vendor/nesbot/carbon/src/Carbon/AbstractTranslator.php b/vendor/nesbot/carbon/src/Carbon/AbstractTranslator.php deleted file mode 100644 index 949e159b..00000000 --- a/vendor/nesbot/carbon/src/Carbon/AbstractTranslator.php +++ /dev/null @@ -1,397 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon; - -use Closure; -use ReflectionException; -use ReflectionFunction; -use Symfony\Component\Translation; -use Symfony\Component\Translation\Formatter\MessageFormatterInterface; -use Symfony\Component\Translation\Loader\ArrayLoader; - -abstract class AbstractTranslator extends Translation\Translator -{ - /** - * Translator singletons for each language. - * - * @var array - */ - protected static $singletons = []; - - /** - * List of custom localized messages. - * - * @var array - */ - protected $messages = []; - - /** - * List of custom directories that contain translation files. - * - * @var string[] - */ - protected $directories = []; - - /** - * Set to true while constructing. - * - * @var bool - */ - protected $initializing = false; - - /** - * List of locales aliases. - * - * @var string[] - */ - protected $aliases = [ - 'me' => 'sr_Latn_ME', - 'scr' => 'sh', - ]; - - /** - * Return a singleton instance of Translator. - * - * @param string|null $locale optional initial locale ("en" - english by default) - * - * @return static - */ - public static function get($locale = null) - { - $locale = $locale ?: 'en'; - $key = static::class === Translator::class ? $locale : static::class.'|'.$locale; - - if (!isset(static::$singletons[$key])) { - static::$singletons[$key] = new static($locale); - } - - return static::$singletons[$key]; - } - - public function __construct($locale, MessageFormatterInterface $formatter = null, $cacheDir = null, $debug = false) - { - parent::setLocale($locale); - $this->initializing = true; - $this->directories = [__DIR__.'/Lang']; - $this->addLoader('array', new ArrayLoader()); - parent::__construct($locale, $formatter, $cacheDir, $debug); - $this->initializing = false; - } - - /** - * Returns the list of directories translation files are searched in. - * - * @return array - */ - public function getDirectories(): array - { - return $this->directories; - } - - /** - * Set list of directories translation files are searched in. - * - * @param array $directories new directories list - * - * @return $this - */ - public function setDirectories(array $directories) - { - $this->directories = $directories; - - return $this; - } - - /** - * Add a directory to the list translation files are searched in. - * - * @param string $directory new directory - * - * @return $this - */ - public function addDirectory(string $directory) - { - $this->directories[] = $directory; - - return $this; - } - - /** - * Remove a directory from the list translation files are searched in. - * - * @param string $directory directory path - * - * @return $this - */ - public function removeDirectory(string $directory) - { - $search = rtrim(strtr($directory, '\\', '/'), '/'); - - return $this->setDirectories(array_filter($this->getDirectories(), function ($item) use ($search) { - return rtrim(strtr($item, '\\', '/'), '/') !== $search; - })); - } - - /** - * Reset messages of a locale (all locale if no locale passed). - * Remove custom messages and reload initial messages from matching - * file in Lang directory. - * - * @param string|null $locale - * - * @return bool - */ - public function resetMessages($locale = null) - { - if ($locale === null) { - $this->messages = []; - - return true; - } - - foreach ($this->getDirectories() as $directory) { - $data = @include sprintf('%s/%s.php', rtrim($directory, '\\/'), $locale); - - if ($data !== false) { - $this->messages[$locale] = $data; - $this->addResource('array', $this->messages[$locale], $locale); - - return true; - } - } - - return false; - } - - /** - * Returns the list of files matching a given locale prefix (or all if empty). - * - * @param string $prefix prefix required to filter result - * - * @return array - */ - public function getLocalesFiles($prefix = '') - { - $files = []; - - foreach ($this->getDirectories() as $directory) { - $directory = rtrim($directory, '\\/'); - - foreach (glob("$directory/$prefix*.php") as $file) { - $files[] = $file; - } - } - - return array_unique($files); - } - - /** - * Returns the list of internally available locales and already loaded custom locales. - * (It will ignore custom translator dynamic loading.) - * - * @param string $prefix prefix required to filter result - * - * @return array - */ - public function getAvailableLocales($prefix = '') - { - $locales = []; - foreach ($this->getLocalesFiles($prefix) as $file) { - $locales[] = substr($file, strrpos($file, '/') + 1, -4); - } - - return array_unique(array_merge($locales, array_keys($this->messages))); - } - - protected function translate(?string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string - { - if ($domain === null) { - $domain = 'messages'; - } - - $catalogue = $this->getCatalogue($locale); - $format = $this instanceof TranslatorStrongTypeInterface - ? $this->getFromCatalogue($catalogue, (string) $id, $domain) - : $this->getCatalogue($locale)->get((string) $id, $domain); // @codeCoverageIgnore - - if ($format instanceof Closure) { - // @codeCoverageIgnoreStart - try { - $count = (new ReflectionFunction($format))->getNumberOfRequiredParameters(); - } catch (ReflectionException $exception) { - $count = 0; - } - // @codeCoverageIgnoreEnd - - return $format( - ...array_values($parameters), - ...array_fill(0, max(0, $count - \count($parameters)), null) - ); - } - - return parent::trans($id, $parameters, $domain, $locale); - } - - /** - * Init messages language from matching file in Lang directory. - * - * @param string $locale - * - * @return bool - */ - protected function loadMessagesFromFile($locale) - { - return isset($this->messages[$locale]) || $this->resetMessages($locale); - } - - /** - * Set messages of a locale and take file first if present. - * - * @param string $locale - * @param array $messages - * - * @return $this - */ - public function setMessages($locale, $messages) - { - $this->loadMessagesFromFile($locale); - $this->addResource('array', $messages, $locale); - $this->messages[$locale] = array_merge( - $this->messages[$locale] ?? [], - $messages - ); - - return $this; - } - - /** - * Set messages of the current locale and take file first if present. - * - * @param array $messages - * - * @return $this - */ - public function setTranslations($messages) - { - return $this->setMessages($this->getLocale(), $messages); - } - - /** - * Get messages of a locale, if none given, return all the - * languages. - * - * @param string|null $locale - * - * @return array - */ - public function getMessages($locale = null) - { - return $locale === null ? $this->messages : $this->messages[$locale]; - } - - /** - * Set the current translator locale and indicate if the source locale file exists - * - * @param string $locale locale ex. en - * - * @return bool - */ - public function setLocale($locale) - { - $locale = preg_replace_callback('/[-_]([a-z]{2,}|\d{2,})/', function ($matches) { - // _2-letters or YUE is a region, _3+-letters is a variant - $upper = strtoupper($matches[1]); - - if ($upper === 'YUE' || $upper === 'ISO' || \strlen($upper) < 3) { - return "_$upper"; - } - - return '_'.ucfirst($matches[1]); - }, strtolower($locale)); - - $previousLocale = $this->getLocale(); - - if ($previousLocale === $locale && isset($this->messages[$locale])) { - return true; - } - - unset(static::$singletons[$previousLocale]); - - if ($locale === 'auto') { - $completeLocale = setlocale(LC_TIME, '0'); - $locale = preg_replace('/^([^_.-]+).*$/', '$1', $completeLocale); - $locales = $this->getAvailableLocales($locale); - - $completeLocaleChunks = preg_split('/[_.-]+/', $completeLocale); - - $getScore = function ($language) use ($completeLocaleChunks) { - return self::compareChunkLists($completeLocaleChunks, preg_split('/[_.-]+/', $language)); - }; - - usort($locales, function ($first, $second) use ($getScore) { - return $getScore($second) <=> $getScore($first); - }); - - $locale = $locales[0]; - } - - if (isset($this->aliases[$locale])) { - $locale = $this->aliases[$locale]; - } - - // If subtag (ex: en_CA) first load the macro (ex: en) to have a fallback - if (str_contains($locale, '_') && - $this->loadMessagesFromFile($macroLocale = preg_replace('/^([^_]+).*$/', '$1', $locale)) - ) { - parent::setLocale($macroLocale); - } - - if (!$this->loadMessagesFromFile($locale) && !$this->initializing) { - return false; - } - - parent::setLocale($locale); - - return true; - } - - /** - * Show locale on var_dump(). - * - * @return array - */ - public function __debugInfo() - { - return [ - 'locale' => $this->getLocale(), - ]; - } - - private static function compareChunkLists($referenceChunks, $chunks) - { - $score = 0; - - foreach ($referenceChunks as $index => $chunk) { - if (!isset($chunks[$index])) { - $score++; - - continue; - } - - if (strtolower($chunks[$index]) === strtolower($chunk)) { - $score += 10; - } - } - - return $score; - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Carbon.php b/vendor/nesbot/carbon/src/Carbon/Carbon.php deleted file mode 100644 index e327590e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Carbon.php +++ /dev/null @@ -1,523 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon; - -use Carbon\Traits\Date; -use Carbon\Traits\DeprecatedProperties; -use DateTime; -use DateTimeInterface; -use DateTimeZone; - -/** - * A simple API extension for DateTime. - * - * @mixin DeprecatedProperties - * - * <autodoc generated by `composer phpdoc`> - * - * @property int $year - * @property int $yearIso - * @property int $month - * @property int $day - * @property int $hour - * @property int $minute - * @property int $second - * @property int $micro - * @property int $microsecond - * @property int|float|string $timestamp seconds since the Unix Epoch - * @property string $englishDayOfWeek the day of week in English - * @property string $shortEnglishDayOfWeek the abbreviated day of week in English - * @property string $englishMonth the month in English - * @property string $shortEnglishMonth the abbreviated month in English - * @property int $milliseconds - * @property int $millisecond - * @property int $milli - * @property int $week 1 through 53 - * @property int $isoWeek 1 through 53 - * @property int $weekYear year according to week format - * @property int $isoWeekYear year according to ISO week format - * @property int $dayOfYear 1 through 366 - * @property int $age does a diffInYears() with default parameters - * @property int $offset the timezone offset in seconds from UTC - * @property int $offsetMinutes the timezone offset in minutes from UTC - * @property int $offsetHours the timezone offset in hours from UTC - * @property CarbonTimeZone $timezone the current timezone - * @property CarbonTimeZone $tz alias of $timezone - * @property-read int $dayOfWeek 0 (for Sunday) through 6 (for Saturday) - * @property-read int $dayOfWeekIso 1 (for Monday) through 7 (for Sunday) - * @property-read int $weekOfYear ISO-8601 week number of year, weeks starting on Monday - * @property-read int $daysInMonth number of days in the given month - * @property-read string $latinMeridiem "am"/"pm" (Ante meridiem or Post meridiem latin lowercase mark) - * @property-read string $latinUpperMeridiem "AM"/"PM" (Ante meridiem or Post meridiem latin uppercase mark) - * @property-read string $timezoneAbbreviatedName the current timezone abbreviated name - * @property-read string $tzAbbrName alias of $timezoneAbbreviatedName - * @property-read string $dayName long name of weekday translated according to Carbon locale, in english if no translation available for current language - * @property-read string $shortDayName short name of weekday translated according to Carbon locale, in english if no translation available for current language - * @property-read string $minDayName very short name of weekday translated according to Carbon locale, in english if no translation available for current language - * @property-read string $monthName long name of month translated according to Carbon locale, in english if no translation available for current language - * @property-read string $shortMonthName short name of month translated according to Carbon locale, in english if no translation available for current language - * @property-read string $meridiem lowercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language - * @property-read string $upperMeridiem uppercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language - * @property-read int $noZeroHour current hour from 1 to 24 - * @property-read int $weeksInYear 51 through 53 - * @property-read int $isoWeeksInYear 51 through 53 - * @property-read int $weekOfMonth 1 through 5 - * @property-read int $weekNumberInMonth 1 through 5 - * @property-read int $firstWeekDay 0 through 6 - * @property-read int $lastWeekDay 0 through 6 - * @property-read int $daysInYear 365 or 366 - * @property-read int $quarter the quarter of this instance, 1 - 4 - * @property-read int $decade the decade of this instance - * @property-read int $century the century of this instance - * @property-read int $millennium the millennium of this instance - * @property-read bool $dst daylight savings time indicator, true if DST, false otherwise - * @property-read bool $local checks if the timezone is local, true if local, false otherwise - * @property-read bool $utc checks if the timezone is UTC, true if UTC, false otherwise - * @property-read string $timezoneName the current timezone name - * @property-read string $tzName alias of $timezoneName - * @property-read string $locale locale of the current instance - * - * @method bool isUtc() Check if the current instance has UTC timezone. (Both isUtc and isUTC cases are valid.) - * @method bool isLocal() Check if the current instance has non-UTC timezone. - * @method bool isValid() Check if the current instance is a valid date. - * @method bool isDST() Check if the current instance is in a daylight saving time. - * @method bool isSunday() Checks if the instance day is sunday. - * @method bool isMonday() Checks if the instance day is monday. - * @method bool isTuesday() Checks if the instance day is tuesday. - * @method bool isWednesday() Checks if the instance day is wednesday. - * @method bool isThursday() Checks if the instance day is thursday. - * @method bool isFriday() Checks if the instance day is friday. - * @method bool isSaturday() Checks if the instance day is saturday. - * @method bool isSameYear(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same year as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentYear() Checks if the instance is in the same year as the current moment. - * @method bool isNextYear() Checks if the instance is in the same year as the current moment next year. - * @method bool isLastYear() Checks if the instance is in the same year as the current moment last year. - * @method bool isSameWeek(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same week as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentWeek() Checks if the instance is in the same week as the current moment. - * @method bool isNextWeek() Checks if the instance is in the same week as the current moment next week. - * @method bool isLastWeek() Checks if the instance is in the same week as the current moment last week. - * @method bool isSameDay(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same day as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentDay() Checks if the instance is in the same day as the current moment. - * @method bool isNextDay() Checks if the instance is in the same day as the current moment next day. - * @method bool isLastDay() Checks if the instance is in the same day as the current moment last day. - * @method bool isSameHour(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same hour as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentHour() Checks if the instance is in the same hour as the current moment. - * @method bool isNextHour() Checks if the instance is in the same hour as the current moment next hour. - * @method bool isLastHour() Checks if the instance is in the same hour as the current moment last hour. - * @method bool isSameMinute(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same minute as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentMinute() Checks if the instance is in the same minute as the current moment. - * @method bool isNextMinute() Checks if the instance is in the same minute as the current moment next minute. - * @method bool isLastMinute() Checks if the instance is in the same minute as the current moment last minute. - * @method bool isSameSecond(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same second as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentSecond() Checks if the instance is in the same second as the current moment. - * @method bool isNextSecond() Checks if the instance is in the same second as the current moment next second. - * @method bool isLastSecond() Checks if the instance is in the same second as the current moment last second. - * @method bool isSameMicro(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentMicro() Checks if the instance is in the same microsecond as the current moment. - * @method bool isNextMicro() Checks if the instance is in the same microsecond as the current moment next microsecond. - * @method bool isLastMicro() Checks if the instance is in the same microsecond as the current moment last microsecond. - * @method bool isSameMicrosecond(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentMicrosecond() Checks if the instance is in the same microsecond as the current moment. - * @method bool isNextMicrosecond() Checks if the instance is in the same microsecond as the current moment next microsecond. - * @method bool isLastMicrosecond() Checks if the instance is in the same microsecond as the current moment last microsecond. - * @method bool isCurrentMonth() Checks if the instance is in the same month as the current moment. - * @method bool isNextMonth() Checks if the instance is in the same month as the current moment next month. - * @method bool isLastMonth() Checks if the instance is in the same month as the current moment last month. - * @method bool isCurrentQuarter() Checks if the instance is in the same quarter as the current moment. - * @method bool isNextQuarter() Checks if the instance is in the same quarter as the current moment next quarter. - * @method bool isLastQuarter() Checks if the instance is in the same quarter as the current moment last quarter. - * @method bool isSameDecade(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same decade as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentDecade() Checks if the instance is in the same decade as the current moment. - * @method bool isNextDecade() Checks if the instance is in the same decade as the current moment next decade. - * @method bool isLastDecade() Checks if the instance is in the same decade as the current moment last decade. - * @method bool isSameCentury(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same century as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentCentury() Checks if the instance is in the same century as the current moment. - * @method bool isNextCentury() Checks if the instance is in the same century as the current moment next century. - * @method bool isLastCentury() Checks if the instance is in the same century as the current moment last century. - * @method bool isSameMillennium(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same millennium as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentMillennium() Checks if the instance is in the same millennium as the current moment. - * @method bool isNextMillennium() Checks if the instance is in the same millennium as the current moment next millennium. - * @method bool isLastMillennium() Checks if the instance is in the same millennium as the current moment last millennium. - * @method $this years(int $value) Set current instance year to the given value. - * @method $this year(int $value) Set current instance year to the given value. - * @method $this setYears(int $value) Set current instance year to the given value. - * @method $this setYear(int $value) Set current instance year to the given value. - * @method $this months(int $value) Set current instance month to the given value. - * @method $this month(int $value) Set current instance month to the given value. - * @method $this setMonths(int $value) Set current instance month to the given value. - * @method $this setMonth(int $value) Set current instance month to the given value. - * @method $this days(int $value) Set current instance day to the given value. - * @method $this day(int $value) Set current instance day to the given value. - * @method $this setDays(int $value) Set current instance day to the given value. - * @method $this setDay(int $value) Set current instance day to the given value. - * @method $this hours(int $value) Set current instance hour to the given value. - * @method $this hour(int $value) Set current instance hour to the given value. - * @method $this setHours(int $value) Set current instance hour to the given value. - * @method $this setHour(int $value) Set current instance hour to the given value. - * @method $this minutes(int $value) Set current instance minute to the given value. - * @method $this minute(int $value) Set current instance minute to the given value. - * @method $this setMinutes(int $value) Set current instance minute to the given value. - * @method $this setMinute(int $value) Set current instance minute to the given value. - * @method $this seconds(int $value) Set current instance second to the given value. - * @method $this second(int $value) Set current instance second to the given value. - * @method $this setSeconds(int $value) Set current instance second to the given value. - * @method $this setSecond(int $value) Set current instance second to the given value. - * @method $this millis(int $value) Set current instance millisecond to the given value. - * @method $this milli(int $value) Set current instance millisecond to the given value. - * @method $this setMillis(int $value) Set current instance millisecond to the given value. - * @method $this setMilli(int $value) Set current instance millisecond to the given value. - * @method $this milliseconds(int $value) Set current instance millisecond to the given value. - * @method $this millisecond(int $value) Set current instance millisecond to the given value. - * @method $this setMilliseconds(int $value) Set current instance millisecond to the given value. - * @method $this setMillisecond(int $value) Set current instance millisecond to the given value. - * @method $this micros(int $value) Set current instance microsecond to the given value. - * @method $this micro(int $value) Set current instance microsecond to the given value. - * @method $this setMicros(int $value) Set current instance microsecond to the given value. - * @method $this setMicro(int $value) Set current instance microsecond to the given value. - * @method $this microseconds(int $value) Set current instance microsecond to the given value. - * @method $this microsecond(int $value) Set current instance microsecond to the given value. - * @method $this setMicroseconds(int $value) Set current instance microsecond to the given value. - * @method $this setMicrosecond(int $value) Set current instance microsecond to the given value. - * @method $this addYears(int $value = 1) Add years (the $value count passed in) to the instance (using date interval). - * @method $this addYear() Add one year to the instance (using date interval). - * @method $this subYears(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval). - * @method $this subYear() Sub one year to the instance (using date interval). - * @method $this addYearsWithOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method $this addYearWithOverflow() Add one year to the instance (using date interval) with overflow explicitly allowed. - * @method $this subYearsWithOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method $this subYearWithOverflow() Sub one year to the instance (using date interval) with overflow explicitly allowed. - * @method $this addYearsWithoutOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addYearWithoutOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subYearsWithoutOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subYearWithoutOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addYearsWithNoOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addYearWithNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subYearsWithNoOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subYearWithNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addYearsNoOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addYearNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subYearsNoOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subYearNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addMonths(int $value = 1) Add months (the $value count passed in) to the instance (using date interval). - * @method $this addMonth() Add one month to the instance (using date interval). - * @method $this subMonths(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval). - * @method $this subMonth() Sub one month to the instance (using date interval). - * @method $this addMonthsWithOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method $this addMonthWithOverflow() Add one month to the instance (using date interval) with overflow explicitly allowed. - * @method $this subMonthsWithOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method $this subMonthWithOverflow() Sub one month to the instance (using date interval) with overflow explicitly allowed. - * @method $this addMonthsWithoutOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addMonthWithoutOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subMonthsWithoutOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subMonthWithoutOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addMonthsWithNoOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addMonthWithNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subMonthsWithNoOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subMonthWithNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addMonthsNoOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addMonthNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subMonthsNoOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subMonthNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addDays(int $value = 1) Add days (the $value count passed in) to the instance (using date interval). - * @method $this addDay() Add one day to the instance (using date interval). - * @method $this subDays(int $value = 1) Sub days (the $value count passed in) to the instance (using date interval). - * @method $this subDay() Sub one day to the instance (using date interval). - * @method $this addHours(int $value = 1) Add hours (the $value count passed in) to the instance (using date interval). - * @method $this addHour() Add one hour to the instance (using date interval). - * @method $this subHours(int $value = 1) Sub hours (the $value count passed in) to the instance (using date interval). - * @method $this subHour() Sub one hour to the instance (using date interval). - * @method $this addMinutes(int $value = 1) Add minutes (the $value count passed in) to the instance (using date interval). - * @method $this addMinute() Add one minute to the instance (using date interval). - * @method $this subMinutes(int $value = 1) Sub minutes (the $value count passed in) to the instance (using date interval). - * @method $this subMinute() Sub one minute to the instance (using date interval). - * @method $this addSeconds(int $value = 1) Add seconds (the $value count passed in) to the instance (using date interval). - * @method $this addSecond() Add one second to the instance (using date interval). - * @method $this subSeconds(int $value = 1) Sub seconds (the $value count passed in) to the instance (using date interval). - * @method $this subSecond() Sub one second to the instance (using date interval). - * @method $this addMillis(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval). - * @method $this addMilli() Add one millisecond to the instance (using date interval). - * @method $this subMillis(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval). - * @method $this subMilli() Sub one millisecond to the instance (using date interval). - * @method $this addMilliseconds(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval). - * @method $this addMillisecond() Add one millisecond to the instance (using date interval). - * @method $this subMilliseconds(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval). - * @method $this subMillisecond() Sub one millisecond to the instance (using date interval). - * @method $this addMicros(int $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval). - * @method $this addMicro() Add one microsecond to the instance (using date interval). - * @method $this subMicros(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval). - * @method $this subMicro() Sub one microsecond to the instance (using date interval). - * @method $this addMicroseconds(int $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval). - * @method $this addMicrosecond() Add one microsecond to the instance (using date interval). - * @method $this subMicroseconds(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval). - * @method $this subMicrosecond() Sub one microsecond to the instance (using date interval). - * @method $this addMillennia(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval). - * @method $this addMillennium() Add one millennium to the instance (using date interval). - * @method $this subMillennia(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval). - * @method $this subMillennium() Sub one millennium to the instance (using date interval). - * @method $this addMillenniaWithOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method $this addMillenniumWithOverflow() Add one millennium to the instance (using date interval) with overflow explicitly allowed. - * @method $this subMillenniaWithOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method $this subMillenniumWithOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly allowed. - * @method $this addMillenniaWithoutOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addMillenniumWithoutOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subMillenniaWithoutOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subMillenniumWithoutOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addMillenniaWithNoOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addMillenniumWithNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subMillenniaWithNoOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subMillenniumWithNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addMillenniaNoOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addMillenniumNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subMillenniaNoOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subMillenniumNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addCenturies(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval). - * @method $this addCentury() Add one century to the instance (using date interval). - * @method $this subCenturies(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval). - * @method $this subCentury() Sub one century to the instance (using date interval). - * @method $this addCenturiesWithOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method $this addCenturyWithOverflow() Add one century to the instance (using date interval) with overflow explicitly allowed. - * @method $this subCenturiesWithOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method $this subCenturyWithOverflow() Sub one century to the instance (using date interval) with overflow explicitly allowed. - * @method $this addCenturiesWithoutOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addCenturyWithoutOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subCenturiesWithoutOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subCenturyWithoutOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addCenturiesWithNoOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addCenturyWithNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subCenturiesWithNoOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subCenturyWithNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addCenturiesNoOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addCenturyNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subCenturiesNoOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subCenturyNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addDecades(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval). - * @method $this addDecade() Add one decade to the instance (using date interval). - * @method $this subDecades(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval). - * @method $this subDecade() Sub one decade to the instance (using date interval). - * @method $this addDecadesWithOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method $this addDecadeWithOverflow() Add one decade to the instance (using date interval) with overflow explicitly allowed. - * @method $this subDecadesWithOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method $this subDecadeWithOverflow() Sub one decade to the instance (using date interval) with overflow explicitly allowed. - * @method $this addDecadesWithoutOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addDecadeWithoutOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subDecadesWithoutOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subDecadeWithoutOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addDecadesWithNoOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addDecadeWithNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subDecadesWithNoOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subDecadeWithNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addDecadesNoOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addDecadeNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subDecadesNoOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subDecadeNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addQuarters(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval). - * @method $this addQuarter() Add one quarter to the instance (using date interval). - * @method $this subQuarters(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval). - * @method $this subQuarter() Sub one quarter to the instance (using date interval). - * @method $this addQuartersWithOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method $this addQuarterWithOverflow() Add one quarter to the instance (using date interval) with overflow explicitly allowed. - * @method $this subQuartersWithOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method $this subQuarterWithOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly allowed. - * @method $this addQuartersWithoutOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addQuarterWithoutOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subQuartersWithoutOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subQuarterWithoutOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addQuartersWithNoOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addQuarterWithNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subQuartersWithNoOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subQuarterWithNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addQuartersNoOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addQuarterNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subQuartersNoOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subQuarterNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addWeeks(int $value = 1) Add weeks (the $value count passed in) to the instance (using date interval). - * @method $this addWeek() Add one week to the instance (using date interval). - * @method $this subWeeks(int $value = 1) Sub weeks (the $value count passed in) to the instance (using date interval). - * @method $this subWeek() Sub one week to the instance (using date interval). - * @method $this addWeekdays(int $value = 1) Add weekdays (the $value count passed in) to the instance (using date interval). - * @method $this addWeekday() Add one weekday to the instance (using date interval). - * @method $this subWeekdays(int $value = 1) Sub weekdays (the $value count passed in) to the instance (using date interval). - * @method $this subWeekday() Sub one weekday to the instance (using date interval). - * @method $this addRealMicros(int $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp). - * @method $this addRealMicro() Add one microsecond to the instance (using timestamp). - * @method $this subRealMicros(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp). - * @method $this subRealMicro() Sub one microsecond to the instance (using timestamp). - * @method CarbonPeriod microsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given. - * @method $this addRealMicroseconds(int $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp). - * @method $this addRealMicrosecond() Add one microsecond to the instance (using timestamp). - * @method $this subRealMicroseconds(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp). - * @method $this subRealMicrosecond() Sub one microsecond to the instance (using timestamp). - * @method CarbonPeriod microsecondsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given. - * @method $this addRealMillis(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp). - * @method $this addRealMilli() Add one millisecond to the instance (using timestamp). - * @method $this subRealMillis(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp). - * @method $this subRealMilli() Sub one millisecond to the instance (using timestamp). - * @method CarbonPeriod millisUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given. - * @method $this addRealMilliseconds(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp). - * @method $this addRealMillisecond() Add one millisecond to the instance (using timestamp). - * @method $this subRealMilliseconds(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp). - * @method $this subRealMillisecond() Sub one millisecond to the instance (using timestamp). - * @method CarbonPeriod millisecondsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given. - * @method $this addRealSeconds(int $value = 1) Add seconds (the $value count passed in) to the instance (using timestamp). - * @method $this addRealSecond() Add one second to the instance (using timestamp). - * @method $this subRealSeconds(int $value = 1) Sub seconds (the $value count passed in) to the instance (using timestamp). - * @method $this subRealSecond() Sub one second to the instance (using timestamp). - * @method CarbonPeriod secondsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each second or every X seconds if a factor is given. - * @method $this addRealMinutes(int $value = 1) Add minutes (the $value count passed in) to the instance (using timestamp). - * @method $this addRealMinute() Add one minute to the instance (using timestamp). - * @method $this subRealMinutes(int $value = 1) Sub minutes (the $value count passed in) to the instance (using timestamp). - * @method $this subRealMinute() Sub one minute to the instance (using timestamp). - * @method CarbonPeriod minutesUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each minute or every X minutes if a factor is given. - * @method $this addRealHours(int $value = 1) Add hours (the $value count passed in) to the instance (using timestamp). - * @method $this addRealHour() Add one hour to the instance (using timestamp). - * @method $this subRealHours(int $value = 1) Sub hours (the $value count passed in) to the instance (using timestamp). - * @method $this subRealHour() Sub one hour to the instance (using timestamp). - * @method CarbonPeriod hoursUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each hour or every X hours if a factor is given. - * @method $this addRealDays(int $value = 1) Add days (the $value count passed in) to the instance (using timestamp). - * @method $this addRealDay() Add one day to the instance (using timestamp). - * @method $this subRealDays(int $value = 1) Sub days (the $value count passed in) to the instance (using timestamp). - * @method $this subRealDay() Sub one day to the instance (using timestamp). - * @method CarbonPeriod daysUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each day or every X days if a factor is given. - * @method $this addRealWeeks(int $value = 1) Add weeks (the $value count passed in) to the instance (using timestamp). - * @method $this addRealWeek() Add one week to the instance (using timestamp). - * @method $this subRealWeeks(int $value = 1) Sub weeks (the $value count passed in) to the instance (using timestamp). - * @method $this subRealWeek() Sub one week to the instance (using timestamp). - * @method CarbonPeriod weeksUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each week or every X weeks if a factor is given. - * @method $this addRealMonths(int $value = 1) Add months (the $value count passed in) to the instance (using timestamp). - * @method $this addRealMonth() Add one month to the instance (using timestamp). - * @method $this subRealMonths(int $value = 1) Sub months (the $value count passed in) to the instance (using timestamp). - * @method $this subRealMonth() Sub one month to the instance (using timestamp). - * @method CarbonPeriod monthsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each month or every X months if a factor is given. - * @method $this addRealQuarters(int $value = 1) Add quarters (the $value count passed in) to the instance (using timestamp). - * @method $this addRealQuarter() Add one quarter to the instance (using timestamp). - * @method $this subRealQuarters(int $value = 1) Sub quarters (the $value count passed in) to the instance (using timestamp). - * @method $this subRealQuarter() Sub one quarter to the instance (using timestamp). - * @method CarbonPeriod quartersUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each quarter or every X quarters if a factor is given. - * @method $this addRealYears(int $value = 1) Add years (the $value count passed in) to the instance (using timestamp). - * @method $this addRealYear() Add one year to the instance (using timestamp). - * @method $this subRealYears(int $value = 1) Sub years (the $value count passed in) to the instance (using timestamp). - * @method $this subRealYear() Sub one year to the instance (using timestamp). - * @method CarbonPeriod yearsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each year or every X years if a factor is given. - * @method $this addRealDecades(int $value = 1) Add decades (the $value count passed in) to the instance (using timestamp). - * @method $this addRealDecade() Add one decade to the instance (using timestamp). - * @method $this subRealDecades(int $value = 1) Sub decades (the $value count passed in) to the instance (using timestamp). - * @method $this subRealDecade() Sub one decade to the instance (using timestamp). - * @method CarbonPeriod decadesUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each decade or every X decades if a factor is given. - * @method $this addRealCenturies(int $value = 1) Add centuries (the $value count passed in) to the instance (using timestamp). - * @method $this addRealCentury() Add one century to the instance (using timestamp). - * @method $this subRealCenturies(int $value = 1) Sub centuries (the $value count passed in) to the instance (using timestamp). - * @method $this subRealCentury() Sub one century to the instance (using timestamp). - * @method CarbonPeriod centuriesUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each century or every X centuries if a factor is given. - * @method $this addRealMillennia(int $value = 1) Add millennia (the $value count passed in) to the instance (using timestamp). - * @method $this addRealMillennium() Add one millennium to the instance (using timestamp). - * @method $this subRealMillennia(int $value = 1) Sub millennia (the $value count passed in) to the instance (using timestamp). - * @method $this subRealMillennium() Sub one millennium to the instance (using timestamp). - * @method CarbonPeriod millenniaUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millennium or every X millennia if a factor is given. - * @method $this roundYear(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. - * @method $this roundYears(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. - * @method $this floorYear(float $precision = 1) Truncate the current instance year with given precision. - * @method $this floorYears(float $precision = 1) Truncate the current instance year with given precision. - * @method $this ceilYear(float $precision = 1) Ceil the current instance year with given precision. - * @method $this ceilYears(float $precision = 1) Ceil the current instance year with given precision. - * @method $this roundMonth(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. - * @method $this roundMonths(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. - * @method $this floorMonth(float $precision = 1) Truncate the current instance month with given precision. - * @method $this floorMonths(float $precision = 1) Truncate the current instance month with given precision. - * @method $this ceilMonth(float $precision = 1) Ceil the current instance month with given precision. - * @method $this ceilMonths(float $precision = 1) Ceil the current instance month with given precision. - * @method $this roundDay(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. - * @method $this roundDays(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. - * @method $this floorDay(float $precision = 1) Truncate the current instance day with given precision. - * @method $this floorDays(float $precision = 1) Truncate the current instance day with given precision. - * @method $this ceilDay(float $precision = 1) Ceil the current instance day with given precision. - * @method $this ceilDays(float $precision = 1) Ceil the current instance day with given precision. - * @method $this roundHour(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. - * @method $this roundHours(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. - * @method $this floorHour(float $precision = 1) Truncate the current instance hour with given precision. - * @method $this floorHours(float $precision = 1) Truncate the current instance hour with given precision. - * @method $this ceilHour(float $precision = 1) Ceil the current instance hour with given precision. - * @method $this ceilHours(float $precision = 1) Ceil the current instance hour with given precision. - * @method $this roundMinute(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. - * @method $this roundMinutes(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. - * @method $this floorMinute(float $precision = 1) Truncate the current instance minute with given precision. - * @method $this floorMinutes(float $precision = 1) Truncate the current instance minute with given precision. - * @method $this ceilMinute(float $precision = 1) Ceil the current instance minute with given precision. - * @method $this ceilMinutes(float $precision = 1) Ceil the current instance minute with given precision. - * @method $this roundSecond(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. - * @method $this roundSeconds(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. - * @method $this floorSecond(float $precision = 1) Truncate the current instance second with given precision. - * @method $this floorSeconds(float $precision = 1) Truncate the current instance second with given precision. - * @method $this ceilSecond(float $precision = 1) Ceil the current instance second with given precision. - * @method $this ceilSeconds(float $precision = 1) Ceil the current instance second with given precision. - * @method $this roundMillennium(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. - * @method $this roundMillennia(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. - * @method $this floorMillennium(float $precision = 1) Truncate the current instance millennium with given precision. - * @method $this floorMillennia(float $precision = 1) Truncate the current instance millennium with given precision. - * @method $this ceilMillennium(float $precision = 1) Ceil the current instance millennium with given precision. - * @method $this ceilMillennia(float $precision = 1) Ceil the current instance millennium with given precision. - * @method $this roundCentury(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. - * @method $this roundCenturies(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. - * @method $this floorCentury(float $precision = 1) Truncate the current instance century with given precision. - * @method $this floorCenturies(float $precision = 1) Truncate the current instance century with given precision. - * @method $this ceilCentury(float $precision = 1) Ceil the current instance century with given precision. - * @method $this ceilCenturies(float $precision = 1) Ceil the current instance century with given precision. - * @method $this roundDecade(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. - * @method $this roundDecades(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. - * @method $this floorDecade(float $precision = 1) Truncate the current instance decade with given precision. - * @method $this floorDecades(float $precision = 1) Truncate the current instance decade with given precision. - * @method $this ceilDecade(float $precision = 1) Ceil the current instance decade with given precision. - * @method $this ceilDecades(float $precision = 1) Ceil the current instance decade with given precision. - * @method $this roundQuarter(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. - * @method $this roundQuarters(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. - * @method $this floorQuarter(float $precision = 1) Truncate the current instance quarter with given precision. - * @method $this floorQuarters(float $precision = 1) Truncate the current instance quarter with given precision. - * @method $this ceilQuarter(float $precision = 1) Ceil the current instance quarter with given precision. - * @method $this ceilQuarters(float $precision = 1) Ceil the current instance quarter with given precision. - * @method $this roundMillisecond(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. - * @method $this roundMilliseconds(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. - * @method $this floorMillisecond(float $precision = 1) Truncate the current instance millisecond with given precision. - * @method $this floorMilliseconds(float $precision = 1) Truncate the current instance millisecond with given precision. - * @method $this ceilMillisecond(float $precision = 1) Ceil the current instance millisecond with given precision. - * @method $this ceilMilliseconds(float $precision = 1) Ceil the current instance millisecond with given precision. - * @method $this roundMicrosecond(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. - * @method $this roundMicroseconds(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. - * @method $this floorMicrosecond(float $precision = 1) Truncate the current instance microsecond with given precision. - * @method $this floorMicroseconds(float $precision = 1) Truncate the current instance microsecond with given precision. - * @method $this ceilMicrosecond(float $precision = 1) Ceil the current instance microsecond with given precision. - * @method $this ceilMicroseconds(float $precision = 1) Ceil the current instance microsecond with given precision. - * @method string shortAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string longAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string shortRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string longRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string shortRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string longRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string shortRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string longRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method static Carbon|false createFromFormat(string $format, string $time, string|DateTimeZone $timezone = null) Parse a string into a new Carbon object according to the specified format. - * @method static Carbon __set_state(array $array) https://php.net/manual/en/datetime.set-state.php - * - * </autodoc> - */ -class Carbon extends DateTime implements CarbonInterface -{ - use Date; - - /** - * Returns true if the current class/instance is mutable. - * - * @return bool - */ - public static function isMutable() - { - return true; - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/CarbonConverterInterface.php b/vendor/nesbot/carbon/src/Carbon/CarbonConverterInterface.php deleted file mode 100644 index 1ce967b2..00000000 --- a/vendor/nesbot/carbon/src/Carbon/CarbonConverterInterface.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon; - -use DateTimeInterface; - -interface CarbonConverterInterface -{ - public function convertDate(DateTimeInterface $dateTime, bool $negated = false): CarbonInterface; -} diff --git a/vendor/nesbot/carbon/src/Carbon/CarbonImmutable.php b/vendor/nesbot/carbon/src/Carbon/CarbonImmutable.php deleted file mode 100644 index 6d1194ee..00000000 --- a/vendor/nesbot/carbon/src/Carbon/CarbonImmutable.php +++ /dev/null @@ -1,582 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon; - -use Carbon\Traits\Date; -use Carbon\Traits\DeprecatedProperties; -use DateTimeImmutable; -use DateTimeInterface; -use DateTimeZone; - -/** - * A simple API extension for DateTimeImmutable. - * - * @mixin DeprecatedProperties - * - * <autodoc generated by `composer phpdoc`> - * - * @property int $year - * @property int $yearIso - * @property int $month - * @property int $day - * @property int $hour - * @property int $minute - * @property int $second - * @property int $micro - * @property int $microsecond - * @property int|float|string $timestamp seconds since the Unix Epoch - * @property string $englishDayOfWeek the day of week in English - * @property string $shortEnglishDayOfWeek the abbreviated day of week in English - * @property string $englishMonth the month in English - * @property string $shortEnglishMonth the abbreviated month in English - * @property int $milliseconds - * @property int $millisecond - * @property int $milli - * @property int $week 1 through 53 - * @property int $isoWeek 1 through 53 - * @property int $weekYear year according to week format - * @property int $isoWeekYear year according to ISO week format - * @property int $dayOfYear 1 through 366 - * @property int $age does a diffInYears() with default parameters - * @property int $offset the timezone offset in seconds from UTC - * @property int $offsetMinutes the timezone offset in minutes from UTC - * @property int $offsetHours the timezone offset in hours from UTC - * @property CarbonTimeZone $timezone the current timezone - * @property CarbonTimeZone $tz alias of $timezone - * @property-read int $dayOfWeek 0 (for Sunday) through 6 (for Saturday) - * @property-read int $dayOfWeekIso 1 (for Monday) through 7 (for Sunday) - * @property-read int $weekOfYear ISO-8601 week number of year, weeks starting on Monday - * @property-read int $daysInMonth number of days in the given month - * @property-read string $latinMeridiem "am"/"pm" (Ante meridiem or Post meridiem latin lowercase mark) - * @property-read string $latinUpperMeridiem "AM"/"PM" (Ante meridiem or Post meridiem latin uppercase mark) - * @property-read string $timezoneAbbreviatedName the current timezone abbreviated name - * @property-read string $tzAbbrName alias of $timezoneAbbreviatedName - * @property-read string $dayName long name of weekday translated according to Carbon locale, in english if no translation available for current language - * @property-read string $shortDayName short name of weekday translated according to Carbon locale, in english if no translation available for current language - * @property-read string $minDayName very short name of weekday translated according to Carbon locale, in english if no translation available for current language - * @property-read string $monthName long name of month translated according to Carbon locale, in english if no translation available for current language - * @property-read string $shortMonthName short name of month translated according to Carbon locale, in english if no translation available for current language - * @property-read string $meridiem lowercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language - * @property-read string $upperMeridiem uppercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language - * @property-read int $noZeroHour current hour from 1 to 24 - * @property-read int $weeksInYear 51 through 53 - * @property-read int $isoWeeksInYear 51 through 53 - * @property-read int $weekOfMonth 1 through 5 - * @property-read int $weekNumberInMonth 1 through 5 - * @property-read int $firstWeekDay 0 through 6 - * @property-read int $lastWeekDay 0 through 6 - * @property-read int $daysInYear 365 or 366 - * @property-read int $quarter the quarter of this instance, 1 - 4 - * @property-read int $decade the decade of this instance - * @property-read int $century the century of this instance - * @property-read int $millennium the millennium of this instance - * @property-read bool $dst daylight savings time indicator, true if DST, false otherwise - * @property-read bool $local checks if the timezone is local, true if local, false otherwise - * @property-read bool $utc checks if the timezone is UTC, true if UTC, false otherwise - * @property-read string $timezoneName the current timezone name - * @property-read string $tzName alias of $timezoneName - * @property-read string $locale locale of the current instance - * - * @method bool isUtc() Check if the current instance has UTC timezone. (Both isUtc and isUTC cases are valid.) - * @method bool isLocal() Check if the current instance has non-UTC timezone. - * @method bool isValid() Check if the current instance is a valid date. - * @method bool isDST() Check if the current instance is in a daylight saving time. - * @method bool isSunday() Checks if the instance day is sunday. - * @method bool isMonday() Checks if the instance day is monday. - * @method bool isTuesday() Checks if the instance day is tuesday. - * @method bool isWednesday() Checks if the instance day is wednesday. - * @method bool isThursday() Checks if the instance day is thursday. - * @method bool isFriday() Checks if the instance day is friday. - * @method bool isSaturday() Checks if the instance day is saturday. - * @method bool isSameYear(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same year as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentYear() Checks if the instance is in the same year as the current moment. - * @method bool isNextYear() Checks if the instance is in the same year as the current moment next year. - * @method bool isLastYear() Checks if the instance is in the same year as the current moment last year. - * @method bool isSameWeek(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same week as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentWeek() Checks if the instance is in the same week as the current moment. - * @method bool isNextWeek() Checks if the instance is in the same week as the current moment next week. - * @method bool isLastWeek() Checks if the instance is in the same week as the current moment last week. - * @method bool isSameDay(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same day as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentDay() Checks if the instance is in the same day as the current moment. - * @method bool isNextDay() Checks if the instance is in the same day as the current moment next day. - * @method bool isLastDay() Checks if the instance is in the same day as the current moment last day. - * @method bool isSameHour(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same hour as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentHour() Checks if the instance is in the same hour as the current moment. - * @method bool isNextHour() Checks if the instance is in the same hour as the current moment next hour. - * @method bool isLastHour() Checks if the instance is in the same hour as the current moment last hour. - * @method bool isSameMinute(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same minute as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentMinute() Checks if the instance is in the same minute as the current moment. - * @method bool isNextMinute() Checks if the instance is in the same minute as the current moment next minute. - * @method bool isLastMinute() Checks if the instance is in the same minute as the current moment last minute. - * @method bool isSameSecond(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same second as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentSecond() Checks if the instance is in the same second as the current moment. - * @method bool isNextSecond() Checks if the instance is in the same second as the current moment next second. - * @method bool isLastSecond() Checks if the instance is in the same second as the current moment last second. - * @method bool isSameMicro(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentMicro() Checks if the instance is in the same microsecond as the current moment. - * @method bool isNextMicro() Checks if the instance is in the same microsecond as the current moment next microsecond. - * @method bool isLastMicro() Checks if the instance is in the same microsecond as the current moment last microsecond. - * @method bool isSameMicrosecond(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentMicrosecond() Checks if the instance is in the same microsecond as the current moment. - * @method bool isNextMicrosecond() Checks if the instance is in the same microsecond as the current moment next microsecond. - * @method bool isLastMicrosecond() Checks if the instance is in the same microsecond as the current moment last microsecond. - * @method bool isCurrentMonth() Checks if the instance is in the same month as the current moment. - * @method bool isNextMonth() Checks if the instance is in the same month as the current moment next month. - * @method bool isLastMonth() Checks if the instance is in the same month as the current moment last month. - * @method bool isCurrentQuarter() Checks if the instance is in the same quarter as the current moment. - * @method bool isNextQuarter() Checks if the instance is in the same quarter as the current moment next quarter. - * @method bool isLastQuarter() Checks if the instance is in the same quarter as the current moment last quarter. - * @method bool isSameDecade(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same decade as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentDecade() Checks if the instance is in the same decade as the current moment. - * @method bool isNextDecade() Checks if the instance is in the same decade as the current moment next decade. - * @method bool isLastDecade() Checks if the instance is in the same decade as the current moment last decade. - * @method bool isSameCentury(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same century as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentCentury() Checks if the instance is in the same century as the current moment. - * @method bool isNextCentury() Checks if the instance is in the same century as the current moment next century. - * @method bool isLastCentury() Checks if the instance is in the same century as the current moment last century. - * @method bool isSameMillennium(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same millennium as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentMillennium() Checks if the instance is in the same millennium as the current moment. - * @method bool isNextMillennium() Checks if the instance is in the same millennium as the current moment next millennium. - * @method bool isLastMillennium() Checks if the instance is in the same millennium as the current moment last millennium. - * @method CarbonImmutable years(int $value) Set current instance year to the given value. - * @method CarbonImmutable year(int $value) Set current instance year to the given value. - * @method CarbonImmutable setYears(int $value) Set current instance year to the given value. - * @method CarbonImmutable setYear(int $value) Set current instance year to the given value. - * @method CarbonImmutable months(int $value) Set current instance month to the given value. - * @method CarbonImmutable month(int $value) Set current instance month to the given value. - * @method CarbonImmutable setMonths(int $value) Set current instance month to the given value. - * @method CarbonImmutable setMonth(int $value) Set current instance month to the given value. - * @method CarbonImmutable days(int $value) Set current instance day to the given value. - * @method CarbonImmutable day(int $value) Set current instance day to the given value. - * @method CarbonImmutable setDays(int $value) Set current instance day to the given value. - * @method CarbonImmutable setDay(int $value) Set current instance day to the given value. - * @method CarbonImmutable hours(int $value) Set current instance hour to the given value. - * @method CarbonImmutable hour(int $value) Set current instance hour to the given value. - * @method CarbonImmutable setHours(int $value) Set current instance hour to the given value. - * @method CarbonImmutable setHour(int $value) Set current instance hour to the given value. - * @method CarbonImmutable minutes(int $value) Set current instance minute to the given value. - * @method CarbonImmutable minute(int $value) Set current instance minute to the given value. - * @method CarbonImmutable setMinutes(int $value) Set current instance minute to the given value. - * @method CarbonImmutable setMinute(int $value) Set current instance minute to the given value. - * @method CarbonImmutable seconds(int $value) Set current instance second to the given value. - * @method CarbonImmutable second(int $value) Set current instance second to the given value. - * @method CarbonImmutable setSeconds(int $value) Set current instance second to the given value. - * @method CarbonImmutable setSecond(int $value) Set current instance second to the given value. - * @method CarbonImmutable millis(int $value) Set current instance millisecond to the given value. - * @method CarbonImmutable milli(int $value) Set current instance millisecond to the given value. - * @method CarbonImmutable setMillis(int $value) Set current instance millisecond to the given value. - * @method CarbonImmutable setMilli(int $value) Set current instance millisecond to the given value. - * @method CarbonImmutable milliseconds(int $value) Set current instance millisecond to the given value. - * @method CarbonImmutable millisecond(int $value) Set current instance millisecond to the given value. - * @method CarbonImmutable setMilliseconds(int $value) Set current instance millisecond to the given value. - * @method CarbonImmutable setMillisecond(int $value) Set current instance millisecond to the given value. - * @method CarbonImmutable micros(int $value) Set current instance microsecond to the given value. - * @method CarbonImmutable micro(int $value) Set current instance microsecond to the given value. - * @method CarbonImmutable setMicros(int $value) Set current instance microsecond to the given value. - * @method CarbonImmutable setMicro(int $value) Set current instance microsecond to the given value. - * @method CarbonImmutable microseconds(int $value) Set current instance microsecond to the given value. - * @method CarbonImmutable microsecond(int $value) Set current instance microsecond to the given value. - * @method CarbonImmutable setMicroseconds(int $value) Set current instance microsecond to the given value. - * @method CarbonImmutable setMicrosecond(int $value) Set current instance microsecond to the given value. - * @method CarbonImmutable addYears(int $value = 1) Add years (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable addYear() Add one year to the instance (using date interval). - * @method CarbonImmutable subYears(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable subYear() Sub one year to the instance (using date interval). - * @method CarbonImmutable addYearsWithOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable addYearWithOverflow() Add one year to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable subYearsWithOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable subYearWithOverflow() Sub one year to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable addYearsWithoutOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addYearWithoutOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subYearsWithoutOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subYearWithoutOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addYearsWithNoOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addYearWithNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subYearsWithNoOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subYearWithNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addYearsNoOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addYearNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subYearsNoOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subYearNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addMonths(int $value = 1) Add months (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable addMonth() Add one month to the instance (using date interval). - * @method CarbonImmutable subMonths(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable subMonth() Sub one month to the instance (using date interval). - * @method CarbonImmutable addMonthsWithOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable addMonthWithOverflow() Add one month to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable subMonthsWithOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable subMonthWithOverflow() Sub one month to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable addMonthsWithoutOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addMonthWithoutOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subMonthsWithoutOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subMonthWithoutOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addMonthsWithNoOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addMonthWithNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subMonthsWithNoOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subMonthWithNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addMonthsNoOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addMonthNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subMonthsNoOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subMonthNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addDays(int $value = 1) Add days (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable addDay() Add one day to the instance (using date interval). - * @method CarbonImmutable subDays(int $value = 1) Sub days (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable subDay() Sub one day to the instance (using date interval). - * @method CarbonImmutable addHours(int $value = 1) Add hours (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable addHour() Add one hour to the instance (using date interval). - * @method CarbonImmutable subHours(int $value = 1) Sub hours (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable subHour() Sub one hour to the instance (using date interval). - * @method CarbonImmutable addMinutes(int $value = 1) Add minutes (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable addMinute() Add one minute to the instance (using date interval). - * @method CarbonImmutable subMinutes(int $value = 1) Sub minutes (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable subMinute() Sub one minute to the instance (using date interval). - * @method CarbonImmutable addSeconds(int $value = 1) Add seconds (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable addSecond() Add one second to the instance (using date interval). - * @method CarbonImmutable subSeconds(int $value = 1) Sub seconds (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable subSecond() Sub one second to the instance (using date interval). - * @method CarbonImmutable addMillis(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable addMilli() Add one millisecond to the instance (using date interval). - * @method CarbonImmutable subMillis(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable subMilli() Sub one millisecond to the instance (using date interval). - * @method CarbonImmutable addMilliseconds(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable addMillisecond() Add one millisecond to the instance (using date interval). - * @method CarbonImmutable subMilliseconds(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable subMillisecond() Sub one millisecond to the instance (using date interval). - * @method CarbonImmutable addMicros(int $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable addMicro() Add one microsecond to the instance (using date interval). - * @method CarbonImmutable subMicros(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable subMicro() Sub one microsecond to the instance (using date interval). - * @method CarbonImmutable addMicroseconds(int $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable addMicrosecond() Add one microsecond to the instance (using date interval). - * @method CarbonImmutable subMicroseconds(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable subMicrosecond() Sub one microsecond to the instance (using date interval). - * @method CarbonImmutable addMillennia(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable addMillennium() Add one millennium to the instance (using date interval). - * @method CarbonImmutable subMillennia(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable subMillennium() Sub one millennium to the instance (using date interval). - * @method CarbonImmutable addMillenniaWithOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable addMillenniumWithOverflow() Add one millennium to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable subMillenniaWithOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable subMillenniumWithOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable addMillenniaWithoutOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addMillenniumWithoutOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subMillenniaWithoutOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subMillenniumWithoutOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addMillenniaWithNoOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addMillenniumWithNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subMillenniaWithNoOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subMillenniumWithNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addMillenniaNoOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addMillenniumNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subMillenniaNoOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subMillenniumNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addCenturies(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable addCentury() Add one century to the instance (using date interval). - * @method CarbonImmutable subCenturies(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable subCentury() Sub one century to the instance (using date interval). - * @method CarbonImmutable addCenturiesWithOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable addCenturyWithOverflow() Add one century to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable subCenturiesWithOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable subCenturyWithOverflow() Sub one century to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable addCenturiesWithoutOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addCenturyWithoutOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subCenturiesWithoutOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subCenturyWithoutOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addCenturiesWithNoOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addCenturyWithNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subCenturiesWithNoOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subCenturyWithNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addCenturiesNoOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addCenturyNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subCenturiesNoOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subCenturyNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addDecades(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable addDecade() Add one decade to the instance (using date interval). - * @method CarbonImmutable subDecades(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable subDecade() Sub one decade to the instance (using date interval). - * @method CarbonImmutable addDecadesWithOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable addDecadeWithOverflow() Add one decade to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable subDecadesWithOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable subDecadeWithOverflow() Sub one decade to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable addDecadesWithoutOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addDecadeWithoutOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subDecadesWithoutOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subDecadeWithoutOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addDecadesWithNoOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addDecadeWithNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subDecadesWithNoOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subDecadeWithNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addDecadesNoOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addDecadeNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subDecadesNoOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subDecadeNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addQuarters(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable addQuarter() Add one quarter to the instance (using date interval). - * @method CarbonImmutable subQuarters(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable subQuarter() Sub one quarter to the instance (using date interval). - * @method CarbonImmutable addQuartersWithOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable addQuarterWithOverflow() Add one quarter to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable subQuartersWithOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable subQuarterWithOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable addQuartersWithoutOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addQuarterWithoutOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subQuartersWithoutOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subQuarterWithoutOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addQuartersWithNoOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addQuarterWithNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subQuartersWithNoOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subQuarterWithNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addQuartersNoOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addQuarterNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subQuartersNoOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subQuarterNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addWeeks(int $value = 1) Add weeks (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable addWeek() Add one week to the instance (using date interval). - * @method CarbonImmutable subWeeks(int $value = 1) Sub weeks (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable subWeek() Sub one week to the instance (using date interval). - * @method CarbonImmutable addWeekdays(int $value = 1) Add weekdays (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable addWeekday() Add one weekday to the instance (using date interval). - * @method CarbonImmutable subWeekdays(int $value = 1) Sub weekdays (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable subWeekday() Sub one weekday to the instance (using date interval). - * @method CarbonImmutable addRealMicros(int $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable addRealMicro() Add one microsecond to the instance (using timestamp). - * @method CarbonImmutable subRealMicros(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable subRealMicro() Sub one microsecond to the instance (using timestamp). - * @method CarbonPeriod microsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given. - * @method CarbonImmutable addRealMicroseconds(int $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable addRealMicrosecond() Add one microsecond to the instance (using timestamp). - * @method CarbonImmutable subRealMicroseconds(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable subRealMicrosecond() Sub one microsecond to the instance (using timestamp). - * @method CarbonPeriod microsecondsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given. - * @method CarbonImmutable addRealMillis(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable addRealMilli() Add one millisecond to the instance (using timestamp). - * @method CarbonImmutable subRealMillis(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable subRealMilli() Sub one millisecond to the instance (using timestamp). - * @method CarbonPeriod millisUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given. - * @method CarbonImmutable addRealMilliseconds(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable addRealMillisecond() Add one millisecond to the instance (using timestamp). - * @method CarbonImmutable subRealMilliseconds(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable subRealMillisecond() Sub one millisecond to the instance (using timestamp). - * @method CarbonPeriod millisecondsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given. - * @method CarbonImmutable addRealSeconds(int $value = 1) Add seconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable addRealSecond() Add one second to the instance (using timestamp). - * @method CarbonImmutable subRealSeconds(int $value = 1) Sub seconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable subRealSecond() Sub one second to the instance (using timestamp). - * @method CarbonPeriod secondsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each second or every X seconds if a factor is given. - * @method CarbonImmutable addRealMinutes(int $value = 1) Add minutes (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable addRealMinute() Add one minute to the instance (using timestamp). - * @method CarbonImmutable subRealMinutes(int $value = 1) Sub minutes (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable subRealMinute() Sub one minute to the instance (using timestamp). - * @method CarbonPeriod minutesUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each minute or every X minutes if a factor is given. - * @method CarbonImmutable addRealHours(int $value = 1) Add hours (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable addRealHour() Add one hour to the instance (using timestamp). - * @method CarbonImmutable subRealHours(int $value = 1) Sub hours (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable subRealHour() Sub one hour to the instance (using timestamp). - * @method CarbonPeriod hoursUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each hour or every X hours if a factor is given. - * @method CarbonImmutable addRealDays(int $value = 1) Add days (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable addRealDay() Add one day to the instance (using timestamp). - * @method CarbonImmutable subRealDays(int $value = 1) Sub days (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable subRealDay() Sub one day to the instance (using timestamp). - * @method CarbonPeriod daysUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each day or every X days if a factor is given. - * @method CarbonImmutable addRealWeeks(int $value = 1) Add weeks (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable addRealWeek() Add one week to the instance (using timestamp). - * @method CarbonImmutable subRealWeeks(int $value = 1) Sub weeks (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable subRealWeek() Sub one week to the instance (using timestamp). - * @method CarbonPeriod weeksUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each week or every X weeks if a factor is given. - * @method CarbonImmutable addRealMonths(int $value = 1) Add months (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable addRealMonth() Add one month to the instance (using timestamp). - * @method CarbonImmutable subRealMonths(int $value = 1) Sub months (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable subRealMonth() Sub one month to the instance (using timestamp). - * @method CarbonPeriod monthsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each month or every X months if a factor is given. - * @method CarbonImmutable addRealQuarters(int $value = 1) Add quarters (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable addRealQuarter() Add one quarter to the instance (using timestamp). - * @method CarbonImmutable subRealQuarters(int $value = 1) Sub quarters (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable subRealQuarter() Sub one quarter to the instance (using timestamp). - * @method CarbonPeriod quartersUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each quarter or every X quarters if a factor is given. - * @method CarbonImmutable addRealYears(int $value = 1) Add years (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable addRealYear() Add one year to the instance (using timestamp). - * @method CarbonImmutable subRealYears(int $value = 1) Sub years (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable subRealYear() Sub one year to the instance (using timestamp). - * @method CarbonPeriod yearsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each year or every X years if a factor is given. - * @method CarbonImmutable addRealDecades(int $value = 1) Add decades (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable addRealDecade() Add one decade to the instance (using timestamp). - * @method CarbonImmutable subRealDecades(int $value = 1) Sub decades (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable subRealDecade() Sub one decade to the instance (using timestamp). - * @method CarbonPeriod decadesUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each decade or every X decades if a factor is given. - * @method CarbonImmutable addRealCenturies(int $value = 1) Add centuries (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable addRealCentury() Add one century to the instance (using timestamp). - * @method CarbonImmutable subRealCenturies(int $value = 1) Sub centuries (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable subRealCentury() Sub one century to the instance (using timestamp). - * @method CarbonPeriod centuriesUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each century or every X centuries if a factor is given. - * @method CarbonImmutable addRealMillennia(int $value = 1) Add millennia (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable addRealMillennium() Add one millennium to the instance (using timestamp). - * @method CarbonImmutable subRealMillennia(int $value = 1) Sub millennia (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable subRealMillennium() Sub one millennium to the instance (using timestamp). - * @method CarbonPeriod millenniaUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millennium or every X millennia if a factor is given. - * @method CarbonImmutable roundYear(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. - * @method CarbonImmutable roundYears(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. - * @method CarbonImmutable floorYear(float $precision = 1) Truncate the current instance year with given precision. - * @method CarbonImmutable floorYears(float $precision = 1) Truncate the current instance year with given precision. - * @method CarbonImmutable ceilYear(float $precision = 1) Ceil the current instance year with given precision. - * @method CarbonImmutable ceilYears(float $precision = 1) Ceil the current instance year with given precision. - * @method CarbonImmutable roundMonth(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. - * @method CarbonImmutable roundMonths(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. - * @method CarbonImmutable floorMonth(float $precision = 1) Truncate the current instance month with given precision. - * @method CarbonImmutable floorMonths(float $precision = 1) Truncate the current instance month with given precision. - * @method CarbonImmutable ceilMonth(float $precision = 1) Ceil the current instance month with given precision. - * @method CarbonImmutable ceilMonths(float $precision = 1) Ceil the current instance month with given precision. - * @method CarbonImmutable roundDay(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. - * @method CarbonImmutable roundDays(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. - * @method CarbonImmutable floorDay(float $precision = 1) Truncate the current instance day with given precision. - * @method CarbonImmutable floorDays(float $precision = 1) Truncate the current instance day with given precision. - * @method CarbonImmutable ceilDay(float $precision = 1) Ceil the current instance day with given precision. - * @method CarbonImmutable ceilDays(float $precision = 1) Ceil the current instance day with given precision. - * @method CarbonImmutable roundHour(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. - * @method CarbonImmutable roundHours(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. - * @method CarbonImmutable floorHour(float $precision = 1) Truncate the current instance hour with given precision. - * @method CarbonImmutable floorHours(float $precision = 1) Truncate the current instance hour with given precision. - * @method CarbonImmutable ceilHour(float $precision = 1) Ceil the current instance hour with given precision. - * @method CarbonImmutable ceilHours(float $precision = 1) Ceil the current instance hour with given precision. - * @method CarbonImmutable roundMinute(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. - * @method CarbonImmutable roundMinutes(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. - * @method CarbonImmutable floorMinute(float $precision = 1) Truncate the current instance minute with given precision. - * @method CarbonImmutable floorMinutes(float $precision = 1) Truncate the current instance minute with given precision. - * @method CarbonImmutable ceilMinute(float $precision = 1) Ceil the current instance minute with given precision. - * @method CarbonImmutable ceilMinutes(float $precision = 1) Ceil the current instance minute with given precision. - * @method CarbonImmutable roundSecond(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. - * @method CarbonImmutable roundSeconds(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. - * @method CarbonImmutable floorSecond(float $precision = 1) Truncate the current instance second with given precision. - * @method CarbonImmutable floorSeconds(float $precision = 1) Truncate the current instance second with given precision. - * @method CarbonImmutable ceilSecond(float $precision = 1) Ceil the current instance second with given precision. - * @method CarbonImmutable ceilSeconds(float $precision = 1) Ceil the current instance second with given precision. - * @method CarbonImmutable roundMillennium(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. - * @method CarbonImmutable roundMillennia(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. - * @method CarbonImmutable floorMillennium(float $precision = 1) Truncate the current instance millennium with given precision. - * @method CarbonImmutable floorMillennia(float $precision = 1) Truncate the current instance millennium with given precision. - * @method CarbonImmutable ceilMillennium(float $precision = 1) Ceil the current instance millennium with given precision. - * @method CarbonImmutable ceilMillennia(float $precision = 1) Ceil the current instance millennium with given precision. - * @method CarbonImmutable roundCentury(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. - * @method CarbonImmutable roundCenturies(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. - * @method CarbonImmutable floorCentury(float $precision = 1) Truncate the current instance century with given precision. - * @method CarbonImmutable floorCenturies(float $precision = 1) Truncate the current instance century with given precision. - * @method CarbonImmutable ceilCentury(float $precision = 1) Ceil the current instance century with given precision. - * @method CarbonImmutable ceilCenturies(float $precision = 1) Ceil the current instance century with given precision. - * @method CarbonImmutable roundDecade(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. - * @method CarbonImmutable roundDecades(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. - * @method CarbonImmutable floorDecade(float $precision = 1) Truncate the current instance decade with given precision. - * @method CarbonImmutable floorDecades(float $precision = 1) Truncate the current instance decade with given precision. - * @method CarbonImmutable ceilDecade(float $precision = 1) Ceil the current instance decade with given precision. - * @method CarbonImmutable ceilDecades(float $precision = 1) Ceil the current instance decade with given precision. - * @method CarbonImmutable roundQuarter(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. - * @method CarbonImmutable roundQuarters(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. - * @method CarbonImmutable floorQuarter(float $precision = 1) Truncate the current instance quarter with given precision. - * @method CarbonImmutable floorQuarters(float $precision = 1) Truncate the current instance quarter with given precision. - * @method CarbonImmutable ceilQuarter(float $precision = 1) Ceil the current instance quarter with given precision. - * @method CarbonImmutable ceilQuarters(float $precision = 1) Ceil the current instance quarter with given precision. - * @method CarbonImmutable roundMillisecond(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. - * @method CarbonImmutable roundMilliseconds(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. - * @method CarbonImmutable floorMillisecond(float $precision = 1) Truncate the current instance millisecond with given precision. - * @method CarbonImmutable floorMilliseconds(float $precision = 1) Truncate the current instance millisecond with given precision. - * @method CarbonImmutable ceilMillisecond(float $precision = 1) Ceil the current instance millisecond with given precision. - * @method CarbonImmutable ceilMilliseconds(float $precision = 1) Ceil the current instance millisecond with given precision. - * @method CarbonImmutable roundMicrosecond(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. - * @method CarbonImmutable roundMicroseconds(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. - * @method CarbonImmutable floorMicrosecond(float $precision = 1) Truncate the current instance microsecond with given precision. - * @method CarbonImmutable floorMicroseconds(float $precision = 1) Truncate the current instance microsecond with given precision. - * @method CarbonImmutable ceilMicrosecond(float $precision = 1) Ceil the current instance microsecond with given precision. - * @method CarbonImmutable ceilMicroseconds(float $precision = 1) Ceil the current instance microsecond with given precision. - * @method string shortAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string longAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string shortRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string longRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string shortRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string longRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string shortRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string longRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method static CarbonImmutable|false createFromFormat(string $format, string $time, string|DateTimeZone $timezone = null) Parse a string into a new CarbonImmutable object according to the specified format. - * @method static CarbonImmutable __set_state(array $array) https://php.net/manual/en/datetime.set-state.php - * - * </autodoc> - */ -class CarbonImmutable extends DateTimeImmutable implements CarbonInterface -{ - use Date { - __clone as dateTraitClone; - } - - public function __clone() - { - $this->dateTraitClone(); - $this->endOfTime = false; - $this->startOfTime = false; - } - - /** - * Create a very old date representing start of time. - * - * @return static - */ - public static function startOfTime(): self - { - $date = static::parse('0001-01-01')->years(self::getStartOfTimeYear()); - $date->startOfTime = true; - - return $date; - } - - /** - * Create a very far date representing end of time. - * - * @return static - */ - public static function endOfTime(): self - { - $date = static::parse('9999-12-31 23:59:59.999999')->years(self::getEndOfTimeYear()); - $date->endOfTime = true; - - return $date; - } - - /** - * @codeCoverageIgnore - */ - private static function getEndOfTimeYear(): int - { - if (version_compare(PHP_VERSION, '7.3.0-dev', '<')) { - return 145261681241552; - } - - // Remove if https://bugs.php.net/bug.php?id=81107 is fixed - if (version_compare(PHP_VERSION, '8.1.0-dev', '>=')) { - return 1118290769066902787; - } - - return PHP_INT_MAX; - } - - /** - * @codeCoverageIgnore - */ - private static function getStartOfTimeYear(): int - { - if (version_compare(PHP_VERSION, '7.3.0-dev', '<')) { - return -135908816449551; - } - - // Remove if https://bugs.php.net/bug.php?id=81107 is fixed - if (version_compare(PHP_VERSION, '8.1.0-dev', '>=')) { - return -1118290769066898816; - } - - return max(PHP_INT_MIN, -9223372036854773760); - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/CarbonInterface.php b/vendor/nesbot/carbon/src/Carbon/CarbonInterface.php deleted file mode 100644 index c3db8504..00000000 --- a/vendor/nesbot/carbon/src/Carbon/CarbonInterface.php +++ /dev/null @@ -1,5078 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon; - -use BadMethodCallException; -use Carbon\Exceptions\BadComparisonUnitException; -use Carbon\Exceptions\ImmutableException; -use Carbon\Exceptions\InvalidDateException; -use Carbon\Exceptions\InvalidFormatException; -use Carbon\Exceptions\UnknownGetterException; -use Carbon\Exceptions\UnknownMethodException; -use Carbon\Exceptions\UnknownSetterException; -use Closure; -use DateInterval; -use DateTime; -use DateTimeImmutable; -use DateTimeInterface; -use DateTimeZone; -use JsonSerializable; -use ReflectionException; -use ReturnTypeWillChange; -use Symfony\Component\Translation\TranslatorInterface; -use Throwable; - -/** - * Common interface for Carbon and CarbonImmutable. - * - * <autodoc generated by `composer phpdoc`> - * - * @property int $year - * @property int $yearIso - * @property int $month - * @property int $day - * @property int $hour - * @property int $minute - * @property int $second - * @property int $micro - * @property int $microsecond - * @property int|float|string $timestamp seconds since the Unix Epoch - * @property string $englishDayOfWeek the day of week in English - * @property string $shortEnglishDayOfWeek the abbreviated day of week in English - * @property string $englishMonth the month in English - * @property string $shortEnglishMonth the abbreviated month in English - * @property int $milliseconds - * @property int $millisecond - * @property int $milli - * @property int $week 1 through 53 - * @property int $isoWeek 1 through 53 - * @property int $weekYear year according to week format - * @property int $isoWeekYear year according to ISO week format - * @property int $dayOfYear 1 through 366 - * @property int $age does a diffInYears() with default parameters - * @property int $offset the timezone offset in seconds from UTC - * @property int $offsetMinutes the timezone offset in minutes from UTC - * @property int $offsetHours the timezone offset in hours from UTC - * @property CarbonTimeZone $timezone the current timezone - * @property CarbonTimeZone $tz alias of $timezone - * @property-read int $dayOfWeek 0 (for Sunday) through 6 (for Saturday) - * @property-read int $dayOfWeekIso 1 (for Monday) through 7 (for Sunday) - * @property-read int $weekOfYear ISO-8601 week number of year, weeks starting on Monday - * @property-read int $daysInMonth number of days in the given month - * @property-read string $latinMeridiem "am"/"pm" (Ante meridiem or Post meridiem latin lowercase mark) - * @property-read string $latinUpperMeridiem "AM"/"PM" (Ante meridiem or Post meridiem latin uppercase mark) - * @property-read string $timezoneAbbreviatedName the current timezone abbreviated name - * @property-read string $tzAbbrName alias of $timezoneAbbreviatedName - * @property-read string $dayName long name of weekday translated according to Carbon locale, in english if no translation available for current language - * @property-read string $shortDayName short name of weekday translated according to Carbon locale, in english if no translation available for current language - * @property-read string $minDayName very short name of weekday translated according to Carbon locale, in english if no translation available for current language - * @property-read string $monthName long name of month translated according to Carbon locale, in english if no translation available for current language - * @property-read string $shortMonthName short name of month translated according to Carbon locale, in english if no translation available for current language - * @property-read string $meridiem lowercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language - * @property-read string $upperMeridiem uppercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language - * @property-read int $noZeroHour current hour from 1 to 24 - * @property-read int $weeksInYear 51 through 53 - * @property-read int $isoWeeksInYear 51 through 53 - * @property-read int $weekOfMonth 1 through 5 - * @property-read int $weekNumberInMonth 1 through 5 - * @property-read int $firstWeekDay 0 through 6 - * @property-read int $lastWeekDay 0 through 6 - * @property-read int $daysInYear 365 or 366 - * @property-read int $quarter the quarter of this instance, 1 - 4 - * @property-read int $decade the decade of this instance - * @property-read int $century the century of this instance - * @property-read int $millennium the millennium of this instance - * @property-read bool $dst daylight savings time indicator, true if DST, false otherwise - * @property-read bool $local checks if the timezone is local, true if local, false otherwise - * @property-read bool $utc checks if the timezone is UTC, true if UTC, false otherwise - * @property-read string $timezoneName the current timezone name - * @property-read string $tzName alias of $timezoneName - * @property-read string $locale locale of the current instance - * - * @method bool isUtc() Check if the current instance has UTC timezone. (Both isUtc and isUTC cases are valid.) - * @method bool isLocal() Check if the current instance has non-UTC timezone. - * @method bool isValid() Check if the current instance is a valid date. - * @method bool isDST() Check if the current instance is in a daylight saving time. - * @method bool isSunday() Checks if the instance day is sunday. - * @method bool isMonday() Checks if the instance day is monday. - * @method bool isTuesday() Checks if the instance day is tuesday. - * @method bool isWednesday() Checks if the instance day is wednesday. - * @method bool isThursday() Checks if the instance day is thursday. - * @method bool isFriday() Checks if the instance day is friday. - * @method bool isSaturday() Checks if the instance day is saturday. - * @method bool isSameYear(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same year as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentYear() Checks if the instance is in the same year as the current moment. - * @method bool isNextYear() Checks if the instance is in the same year as the current moment next year. - * @method bool isLastYear() Checks if the instance is in the same year as the current moment last year. - * @method bool isSameWeek(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same week as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentWeek() Checks if the instance is in the same week as the current moment. - * @method bool isNextWeek() Checks if the instance is in the same week as the current moment next week. - * @method bool isLastWeek() Checks if the instance is in the same week as the current moment last week. - * @method bool isSameDay(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same day as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentDay() Checks if the instance is in the same day as the current moment. - * @method bool isNextDay() Checks if the instance is in the same day as the current moment next day. - * @method bool isLastDay() Checks if the instance is in the same day as the current moment last day. - * @method bool isSameHour(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same hour as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentHour() Checks if the instance is in the same hour as the current moment. - * @method bool isNextHour() Checks if the instance is in the same hour as the current moment next hour. - * @method bool isLastHour() Checks if the instance is in the same hour as the current moment last hour. - * @method bool isSameMinute(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same minute as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentMinute() Checks if the instance is in the same minute as the current moment. - * @method bool isNextMinute() Checks if the instance is in the same minute as the current moment next minute. - * @method bool isLastMinute() Checks if the instance is in the same minute as the current moment last minute. - * @method bool isSameSecond(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same second as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentSecond() Checks if the instance is in the same second as the current moment. - * @method bool isNextSecond() Checks if the instance is in the same second as the current moment next second. - * @method bool isLastSecond() Checks if the instance is in the same second as the current moment last second. - * @method bool isSameMicro(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentMicro() Checks if the instance is in the same microsecond as the current moment. - * @method bool isNextMicro() Checks if the instance is in the same microsecond as the current moment next microsecond. - * @method bool isLastMicro() Checks if the instance is in the same microsecond as the current moment last microsecond. - * @method bool isSameMicrosecond(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentMicrosecond() Checks if the instance is in the same microsecond as the current moment. - * @method bool isNextMicrosecond() Checks if the instance is in the same microsecond as the current moment next microsecond. - * @method bool isLastMicrosecond() Checks if the instance is in the same microsecond as the current moment last microsecond. - * @method bool isCurrentMonth() Checks if the instance is in the same month as the current moment. - * @method bool isNextMonth() Checks if the instance is in the same month as the current moment next month. - * @method bool isLastMonth() Checks if the instance is in the same month as the current moment last month. - * @method bool isCurrentQuarter() Checks if the instance is in the same quarter as the current moment. - * @method bool isNextQuarter() Checks if the instance is in the same quarter as the current moment next quarter. - * @method bool isLastQuarter() Checks if the instance is in the same quarter as the current moment last quarter. - * @method bool isSameDecade(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same decade as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentDecade() Checks if the instance is in the same decade as the current moment. - * @method bool isNextDecade() Checks if the instance is in the same decade as the current moment next decade. - * @method bool isLastDecade() Checks if the instance is in the same decade as the current moment last decade. - * @method bool isSameCentury(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same century as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentCentury() Checks if the instance is in the same century as the current moment. - * @method bool isNextCentury() Checks if the instance is in the same century as the current moment next century. - * @method bool isLastCentury() Checks if the instance is in the same century as the current moment last century. - * @method bool isSameMillennium(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same millennium as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentMillennium() Checks if the instance is in the same millennium as the current moment. - * @method bool isNextMillennium() Checks if the instance is in the same millennium as the current moment next millennium. - * @method bool isLastMillennium() Checks if the instance is in the same millennium as the current moment last millennium. - * @method CarbonInterface years(int $value) Set current instance year to the given value. - * @method CarbonInterface year(int $value) Set current instance year to the given value. - * @method CarbonInterface setYears(int $value) Set current instance year to the given value. - * @method CarbonInterface setYear(int $value) Set current instance year to the given value. - * @method CarbonInterface months(int $value) Set current instance month to the given value. - * @method CarbonInterface month(int $value) Set current instance month to the given value. - * @method CarbonInterface setMonths(int $value) Set current instance month to the given value. - * @method CarbonInterface setMonth(int $value) Set current instance month to the given value. - * @method CarbonInterface days(int $value) Set current instance day to the given value. - * @method CarbonInterface day(int $value) Set current instance day to the given value. - * @method CarbonInterface setDays(int $value) Set current instance day to the given value. - * @method CarbonInterface setDay(int $value) Set current instance day to the given value. - * @method CarbonInterface hours(int $value) Set current instance hour to the given value. - * @method CarbonInterface hour(int $value) Set current instance hour to the given value. - * @method CarbonInterface setHours(int $value) Set current instance hour to the given value. - * @method CarbonInterface setHour(int $value) Set current instance hour to the given value. - * @method CarbonInterface minutes(int $value) Set current instance minute to the given value. - * @method CarbonInterface minute(int $value) Set current instance minute to the given value. - * @method CarbonInterface setMinutes(int $value) Set current instance minute to the given value. - * @method CarbonInterface setMinute(int $value) Set current instance minute to the given value. - * @method CarbonInterface seconds(int $value) Set current instance second to the given value. - * @method CarbonInterface second(int $value) Set current instance second to the given value. - * @method CarbonInterface setSeconds(int $value) Set current instance second to the given value. - * @method CarbonInterface setSecond(int $value) Set current instance second to the given value. - * @method CarbonInterface millis(int $value) Set current instance millisecond to the given value. - * @method CarbonInterface milli(int $value) Set current instance millisecond to the given value. - * @method CarbonInterface setMillis(int $value) Set current instance millisecond to the given value. - * @method CarbonInterface setMilli(int $value) Set current instance millisecond to the given value. - * @method CarbonInterface milliseconds(int $value) Set current instance millisecond to the given value. - * @method CarbonInterface millisecond(int $value) Set current instance millisecond to the given value. - * @method CarbonInterface setMilliseconds(int $value) Set current instance millisecond to the given value. - * @method CarbonInterface setMillisecond(int $value) Set current instance millisecond to the given value. - * @method CarbonInterface micros(int $value) Set current instance microsecond to the given value. - * @method CarbonInterface micro(int $value) Set current instance microsecond to the given value. - * @method CarbonInterface setMicros(int $value) Set current instance microsecond to the given value. - * @method CarbonInterface setMicro(int $value) Set current instance microsecond to the given value. - * @method CarbonInterface microseconds(int $value) Set current instance microsecond to the given value. - * @method CarbonInterface microsecond(int $value) Set current instance microsecond to the given value. - * @method CarbonInterface setMicroseconds(int $value) Set current instance microsecond to the given value. - * @method CarbonInterface setMicrosecond(int $value) Set current instance microsecond to the given value. - * @method CarbonInterface addYears(int $value = 1) Add years (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface addYear() Add one year to the instance (using date interval). - * @method CarbonInterface subYears(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface subYear() Sub one year to the instance (using date interval). - * @method CarbonInterface addYearsWithOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface addYearWithOverflow() Add one year to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface subYearsWithOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface subYearWithOverflow() Sub one year to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface addYearsWithoutOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addYearWithoutOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subYearsWithoutOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subYearWithoutOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addYearsWithNoOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addYearWithNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subYearsWithNoOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subYearWithNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addYearsNoOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addYearNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subYearsNoOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subYearNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addMonths(int $value = 1) Add months (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface addMonth() Add one month to the instance (using date interval). - * @method CarbonInterface subMonths(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface subMonth() Sub one month to the instance (using date interval). - * @method CarbonInterface addMonthsWithOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface addMonthWithOverflow() Add one month to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface subMonthsWithOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface subMonthWithOverflow() Sub one month to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface addMonthsWithoutOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addMonthWithoutOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subMonthsWithoutOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subMonthWithoutOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addMonthsWithNoOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addMonthWithNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subMonthsWithNoOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subMonthWithNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addMonthsNoOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addMonthNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subMonthsNoOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subMonthNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addDays(int $value = 1) Add days (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface addDay() Add one day to the instance (using date interval). - * @method CarbonInterface subDays(int $value = 1) Sub days (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface subDay() Sub one day to the instance (using date interval). - * @method CarbonInterface addHours(int $value = 1) Add hours (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface addHour() Add one hour to the instance (using date interval). - * @method CarbonInterface subHours(int $value = 1) Sub hours (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface subHour() Sub one hour to the instance (using date interval). - * @method CarbonInterface addMinutes(int $value = 1) Add minutes (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface addMinute() Add one minute to the instance (using date interval). - * @method CarbonInterface subMinutes(int $value = 1) Sub minutes (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface subMinute() Sub one minute to the instance (using date interval). - * @method CarbonInterface addSeconds(int $value = 1) Add seconds (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface addSecond() Add one second to the instance (using date interval). - * @method CarbonInterface subSeconds(int $value = 1) Sub seconds (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface subSecond() Sub one second to the instance (using date interval). - * @method CarbonInterface addMillis(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface addMilli() Add one millisecond to the instance (using date interval). - * @method CarbonInterface subMillis(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface subMilli() Sub one millisecond to the instance (using date interval). - * @method CarbonInterface addMilliseconds(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface addMillisecond() Add one millisecond to the instance (using date interval). - * @method CarbonInterface subMilliseconds(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface subMillisecond() Sub one millisecond to the instance (using date interval). - * @method CarbonInterface addMicros(int $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface addMicro() Add one microsecond to the instance (using date interval). - * @method CarbonInterface subMicros(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface subMicro() Sub one microsecond to the instance (using date interval). - * @method CarbonInterface addMicroseconds(int $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface addMicrosecond() Add one microsecond to the instance (using date interval). - * @method CarbonInterface subMicroseconds(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface subMicrosecond() Sub one microsecond to the instance (using date interval). - * @method CarbonInterface addMillennia(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface addMillennium() Add one millennium to the instance (using date interval). - * @method CarbonInterface subMillennia(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface subMillennium() Sub one millennium to the instance (using date interval). - * @method CarbonInterface addMillenniaWithOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface addMillenniumWithOverflow() Add one millennium to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface subMillenniaWithOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface subMillenniumWithOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface addMillenniaWithoutOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addMillenniumWithoutOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subMillenniaWithoutOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subMillenniumWithoutOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addMillenniaWithNoOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addMillenniumWithNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subMillenniaWithNoOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subMillenniumWithNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addMillenniaNoOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addMillenniumNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subMillenniaNoOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subMillenniumNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addCenturies(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface addCentury() Add one century to the instance (using date interval). - * @method CarbonInterface subCenturies(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface subCentury() Sub one century to the instance (using date interval). - * @method CarbonInterface addCenturiesWithOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface addCenturyWithOverflow() Add one century to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface subCenturiesWithOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface subCenturyWithOverflow() Sub one century to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface addCenturiesWithoutOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addCenturyWithoutOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subCenturiesWithoutOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subCenturyWithoutOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addCenturiesWithNoOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addCenturyWithNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subCenturiesWithNoOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subCenturyWithNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addCenturiesNoOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addCenturyNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subCenturiesNoOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subCenturyNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addDecades(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface addDecade() Add one decade to the instance (using date interval). - * @method CarbonInterface subDecades(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface subDecade() Sub one decade to the instance (using date interval). - * @method CarbonInterface addDecadesWithOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface addDecadeWithOverflow() Add one decade to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface subDecadesWithOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface subDecadeWithOverflow() Sub one decade to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface addDecadesWithoutOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addDecadeWithoutOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subDecadesWithoutOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subDecadeWithoutOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addDecadesWithNoOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addDecadeWithNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subDecadesWithNoOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subDecadeWithNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addDecadesNoOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addDecadeNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subDecadesNoOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subDecadeNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addQuarters(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface addQuarter() Add one quarter to the instance (using date interval). - * @method CarbonInterface subQuarters(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface subQuarter() Sub one quarter to the instance (using date interval). - * @method CarbonInterface addQuartersWithOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface addQuarterWithOverflow() Add one quarter to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface subQuartersWithOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface subQuarterWithOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface addQuartersWithoutOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addQuarterWithoutOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subQuartersWithoutOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subQuarterWithoutOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addQuartersWithNoOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addQuarterWithNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subQuartersWithNoOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subQuarterWithNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addQuartersNoOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addQuarterNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subQuartersNoOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subQuarterNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addWeeks(int $value = 1) Add weeks (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface addWeek() Add one week to the instance (using date interval). - * @method CarbonInterface subWeeks(int $value = 1) Sub weeks (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface subWeek() Sub one week to the instance (using date interval). - * @method CarbonInterface addWeekdays(int $value = 1) Add weekdays (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface addWeekday() Add one weekday to the instance (using date interval). - * @method CarbonInterface subWeekdays(int $value = 1) Sub weekdays (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface subWeekday() Sub one weekday to the instance (using date interval). - * @method CarbonInterface addRealMicros(int $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface addRealMicro() Add one microsecond to the instance (using timestamp). - * @method CarbonInterface subRealMicros(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface subRealMicro() Sub one microsecond to the instance (using timestamp). - * @method CarbonPeriod microsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given. - * @method CarbonInterface addRealMicroseconds(int $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface addRealMicrosecond() Add one microsecond to the instance (using timestamp). - * @method CarbonInterface subRealMicroseconds(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface subRealMicrosecond() Sub one microsecond to the instance (using timestamp). - * @method CarbonPeriod microsecondsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given. - * @method CarbonInterface addRealMillis(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface addRealMilli() Add one millisecond to the instance (using timestamp). - * @method CarbonInterface subRealMillis(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface subRealMilli() Sub one millisecond to the instance (using timestamp). - * @method CarbonPeriod millisUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given. - * @method CarbonInterface addRealMilliseconds(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface addRealMillisecond() Add one millisecond to the instance (using timestamp). - * @method CarbonInterface subRealMilliseconds(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface subRealMillisecond() Sub one millisecond to the instance (using timestamp). - * @method CarbonPeriod millisecondsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given. - * @method CarbonInterface addRealSeconds(int $value = 1) Add seconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface addRealSecond() Add one second to the instance (using timestamp). - * @method CarbonInterface subRealSeconds(int $value = 1) Sub seconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface subRealSecond() Sub one second to the instance (using timestamp). - * @method CarbonPeriod secondsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each second or every X seconds if a factor is given. - * @method CarbonInterface addRealMinutes(int $value = 1) Add minutes (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface addRealMinute() Add one minute to the instance (using timestamp). - * @method CarbonInterface subRealMinutes(int $value = 1) Sub minutes (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface subRealMinute() Sub one minute to the instance (using timestamp). - * @method CarbonPeriod minutesUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each minute or every X minutes if a factor is given. - * @method CarbonInterface addRealHours(int $value = 1) Add hours (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface addRealHour() Add one hour to the instance (using timestamp). - * @method CarbonInterface subRealHours(int $value = 1) Sub hours (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface subRealHour() Sub one hour to the instance (using timestamp). - * @method CarbonPeriod hoursUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each hour or every X hours if a factor is given. - * @method CarbonInterface addRealDays(int $value = 1) Add days (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface addRealDay() Add one day to the instance (using timestamp). - * @method CarbonInterface subRealDays(int $value = 1) Sub days (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface subRealDay() Sub one day to the instance (using timestamp). - * @method CarbonPeriod daysUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each day or every X days if a factor is given. - * @method CarbonInterface addRealWeeks(int $value = 1) Add weeks (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface addRealWeek() Add one week to the instance (using timestamp). - * @method CarbonInterface subRealWeeks(int $value = 1) Sub weeks (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface subRealWeek() Sub one week to the instance (using timestamp). - * @method CarbonPeriod weeksUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each week or every X weeks if a factor is given. - * @method CarbonInterface addRealMonths(int $value = 1) Add months (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface addRealMonth() Add one month to the instance (using timestamp). - * @method CarbonInterface subRealMonths(int $value = 1) Sub months (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface subRealMonth() Sub one month to the instance (using timestamp). - * @method CarbonPeriod monthsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each month or every X months if a factor is given. - * @method CarbonInterface addRealQuarters(int $value = 1) Add quarters (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface addRealQuarter() Add one quarter to the instance (using timestamp). - * @method CarbonInterface subRealQuarters(int $value = 1) Sub quarters (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface subRealQuarter() Sub one quarter to the instance (using timestamp). - * @method CarbonPeriod quartersUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each quarter or every X quarters if a factor is given. - * @method CarbonInterface addRealYears(int $value = 1) Add years (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface addRealYear() Add one year to the instance (using timestamp). - * @method CarbonInterface subRealYears(int $value = 1) Sub years (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface subRealYear() Sub one year to the instance (using timestamp). - * @method CarbonPeriod yearsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each year or every X years if a factor is given. - * @method CarbonInterface addRealDecades(int $value = 1) Add decades (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface addRealDecade() Add one decade to the instance (using timestamp). - * @method CarbonInterface subRealDecades(int $value = 1) Sub decades (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface subRealDecade() Sub one decade to the instance (using timestamp). - * @method CarbonPeriod decadesUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each decade or every X decades if a factor is given. - * @method CarbonInterface addRealCenturies(int $value = 1) Add centuries (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface addRealCentury() Add one century to the instance (using timestamp). - * @method CarbonInterface subRealCenturies(int $value = 1) Sub centuries (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface subRealCentury() Sub one century to the instance (using timestamp). - * @method CarbonPeriod centuriesUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each century or every X centuries if a factor is given. - * @method CarbonInterface addRealMillennia(int $value = 1) Add millennia (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface addRealMillennium() Add one millennium to the instance (using timestamp). - * @method CarbonInterface subRealMillennia(int $value = 1) Sub millennia (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface subRealMillennium() Sub one millennium to the instance (using timestamp). - * @method CarbonPeriod millenniaUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millennium or every X millennia if a factor is given. - * @method CarbonInterface roundYear(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. - * @method CarbonInterface roundYears(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. - * @method CarbonInterface floorYear(float $precision = 1) Truncate the current instance year with given precision. - * @method CarbonInterface floorYears(float $precision = 1) Truncate the current instance year with given precision. - * @method CarbonInterface ceilYear(float $precision = 1) Ceil the current instance year with given precision. - * @method CarbonInterface ceilYears(float $precision = 1) Ceil the current instance year with given precision. - * @method CarbonInterface roundMonth(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. - * @method CarbonInterface roundMonths(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. - * @method CarbonInterface floorMonth(float $precision = 1) Truncate the current instance month with given precision. - * @method CarbonInterface floorMonths(float $precision = 1) Truncate the current instance month with given precision. - * @method CarbonInterface ceilMonth(float $precision = 1) Ceil the current instance month with given precision. - * @method CarbonInterface ceilMonths(float $precision = 1) Ceil the current instance month with given precision. - * @method CarbonInterface roundDay(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. - * @method CarbonInterface roundDays(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. - * @method CarbonInterface floorDay(float $precision = 1) Truncate the current instance day with given precision. - * @method CarbonInterface floorDays(float $precision = 1) Truncate the current instance day with given precision. - * @method CarbonInterface ceilDay(float $precision = 1) Ceil the current instance day with given precision. - * @method CarbonInterface ceilDays(float $precision = 1) Ceil the current instance day with given precision. - * @method CarbonInterface roundHour(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. - * @method CarbonInterface roundHours(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. - * @method CarbonInterface floorHour(float $precision = 1) Truncate the current instance hour with given precision. - * @method CarbonInterface floorHours(float $precision = 1) Truncate the current instance hour with given precision. - * @method CarbonInterface ceilHour(float $precision = 1) Ceil the current instance hour with given precision. - * @method CarbonInterface ceilHours(float $precision = 1) Ceil the current instance hour with given precision. - * @method CarbonInterface roundMinute(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. - * @method CarbonInterface roundMinutes(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. - * @method CarbonInterface floorMinute(float $precision = 1) Truncate the current instance minute with given precision. - * @method CarbonInterface floorMinutes(float $precision = 1) Truncate the current instance minute with given precision. - * @method CarbonInterface ceilMinute(float $precision = 1) Ceil the current instance minute with given precision. - * @method CarbonInterface ceilMinutes(float $precision = 1) Ceil the current instance minute with given precision. - * @method CarbonInterface roundSecond(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. - * @method CarbonInterface roundSeconds(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. - * @method CarbonInterface floorSecond(float $precision = 1) Truncate the current instance second with given precision. - * @method CarbonInterface floorSeconds(float $precision = 1) Truncate the current instance second with given precision. - * @method CarbonInterface ceilSecond(float $precision = 1) Ceil the current instance second with given precision. - * @method CarbonInterface ceilSeconds(float $precision = 1) Ceil the current instance second with given precision. - * @method CarbonInterface roundMillennium(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. - * @method CarbonInterface roundMillennia(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. - * @method CarbonInterface floorMillennium(float $precision = 1) Truncate the current instance millennium with given precision. - * @method CarbonInterface floorMillennia(float $precision = 1) Truncate the current instance millennium with given precision. - * @method CarbonInterface ceilMillennium(float $precision = 1) Ceil the current instance millennium with given precision. - * @method CarbonInterface ceilMillennia(float $precision = 1) Ceil the current instance millennium with given precision. - * @method CarbonInterface roundCentury(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. - * @method CarbonInterface roundCenturies(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. - * @method CarbonInterface floorCentury(float $precision = 1) Truncate the current instance century with given precision. - * @method CarbonInterface floorCenturies(float $precision = 1) Truncate the current instance century with given precision. - * @method CarbonInterface ceilCentury(float $precision = 1) Ceil the current instance century with given precision. - * @method CarbonInterface ceilCenturies(float $precision = 1) Ceil the current instance century with given precision. - * @method CarbonInterface roundDecade(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. - * @method CarbonInterface roundDecades(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. - * @method CarbonInterface floorDecade(float $precision = 1) Truncate the current instance decade with given precision. - * @method CarbonInterface floorDecades(float $precision = 1) Truncate the current instance decade with given precision. - * @method CarbonInterface ceilDecade(float $precision = 1) Ceil the current instance decade with given precision. - * @method CarbonInterface ceilDecades(float $precision = 1) Ceil the current instance decade with given precision. - * @method CarbonInterface roundQuarter(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. - * @method CarbonInterface roundQuarters(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. - * @method CarbonInterface floorQuarter(float $precision = 1) Truncate the current instance quarter with given precision. - * @method CarbonInterface floorQuarters(float $precision = 1) Truncate the current instance quarter with given precision. - * @method CarbonInterface ceilQuarter(float $precision = 1) Ceil the current instance quarter with given precision. - * @method CarbonInterface ceilQuarters(float $precision = 1) Ceil the current instance quarter with given precision. - * @method CarbonInterface roundMillisecond(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. - * @method CarbonInterface roundMilliseconds(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. - * @method CarbonInterface floorMillisecond(float $precision = 1) Truncate the current instance millisecond with given precision. - * @method CarbonInterface floorMilliseconds(float $precision = 1) Truncate the current instance millisecond with given precision. - * @method CarbonInterface ceilMillisecond(float $precision = 1) Ceil the current instance millisecond with given precision. - * @method CarbonInterface ceilMilliseconds(float $precision = 1) Ceil the current instance millisecond with given precision. - * @method CarbonInterface roundMicrosecond(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. - * @method CarbonInterface roundMicroseconds(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. - * @method CarbonInterface floorMicrosecond(float $precision = 1) Truncate the current instance microsecond with given precision. - * @method CarbonInterface floorMicroseconds(float $precision = 1) Truncate the current instance microsecond with given precision. - * @method CarbonInterface ceilMicrosecond(float $precision = 1) Ceil the current instance microsecond with given precision. - * @method CarbonInterface ceilMicroseconds(float $precision = 1) Ceil the current instance microsecond with given precision. - * @method string shortAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string longAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string shortRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string longRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string shortRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string longRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string shortRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string longRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * - * </autodoc> - */ -interface CarbonInterface extends DateTimeInterface, JsonSerializable -{ - /** - * Diff wording options(expressed in octal). - */ - public const NO_ZERO_DIFF = 01; - public const JUST_NOW = 02; - public const ONE_DAY_WORDS = 04; - public const TWO_DAY_WORDS = 010; - public const SEQUENTIAL_PARTS_ONLY = 020; - public const ROUND = 040; - public const FLOOR = 0100; - public const CEIL = 0200; - - /** - * Diff syntax options. - */ - public const DIFF_ABSOLUTE = 1; // backward compatibility with true - public const DIFF_RELATIVE_AUTO = 0; // backward compatibility with false - public const DIFF_RELATIVE_TO_NOW = 2; - public const DIFF_RELATIVE_TO_OTHER = 3; - - /** - * Translate string options. - */ - public const TRANSLATE_MONTHS = 1; - public const TRANSLATE_DAYS = 2; - public const TRANSLATE_UNITS = 4; - public const TRANSLATE_MERIDIEM = 8; - public const TRANSLATE_DIFF = 0x10; - public const TRANSLATE_ALL = self::TRANSLATE_MONTHS | self::TRANSLATE_DAYS | self::TRANSLATE_UNITS | self::TRANSLATE_MERIDIEM | self::TRANSLATE_DIFF; - - /** - * The day constants. - */ - public const SUNDAY = 0; - public const MONDAY = 1; - public const TUESDAY = 2; - public const WEDNESDAY = 3; - public const THURSDAY = 4; - public const FRIDAY = 5; - public const SATURDAY = 6; - - /** - * The month constants. - * These aren't used by Carbon itself but exist for - * convenience sake alone. - */ - public const JANUARY = 1; - public const FEBRUARY = 2; - public const MARCH = 3; - public const APRIL = 4; - public const MAY = 5; - public const JUNE = 6; - public const JULY = 7; - public const AUGUST = 8; - public const SEPTEMBER = 9; - public const OCTOBER = 10; - public const NOVEMBER = 11; - public const DECEMBER = 12; - - /** - * Number of X in Y. - */ - public const YEARS_PER_MILLENNIUM = 1000; - public const YEARS_PER_CENTURY = 100; - public const YEARS_PER_DECADE = 10; - public const MONTHS_PER_YEAR = 12; - public const MONTHS_PER_QUARTER = 3; - public const QUARTERS_PER_YEAR = 4; - public const WEEKS_PER_YEAR = 52; - public const WEEKS_PER_MONTH = 4; - public const DAYS_PER_YEAR = 365; - public const DAYS_PER_WEEK = 7; - public const HOURS_PER_DAY = 24; - public const MINUTES_PER_HOUR = 60; - public const SECONDS_PER_MINUTE = 60; - public const MILLISECONDS_PER_SECOND = 1000; - public const MICROSECONDS_PER_MILLISECOND = 1000; - public const MICROSECONDS_PER_SECOND = 1000000; - - /** - * Special settings to get the start of week from current locale culture. - */ - public const WEEK_DAY_AUTO = 'auto'; - - /** - * RFC7231 DateTime format. - * - * @var string - */ - public const RFC7231_FORMAT = 'D, d M Y H:i:s \G\M\T'; - - /** - * Default format to use for __toString method when type juggling occurs. - * - * @var string - */ - public const DEFAULT_TO_STRING_FORMAT = 'Y-m-d H:i:s'; - - /** - * Format for converting mocked time, includes microseconds. - * - * @var string - */ - public const MOCK_DATETIME_FORMAT = 'Y-m-d H:i:s.u'; - - /** - * Pattern detection for ->isoFormat and ::createFromIsoFormat. - * - * @var string - */ - public const ISO_FORMAT_REGEXP = '(O[YMDHhms]|[Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY?|g{1,5}|G{1,5}|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?)'; - - // <methods> - - /** - * Dynamically handle calls to the class. - * - * @param string $method magic method name called - * @param array $parameters parameters list - * - * @throws UnknownMethodException|BadMethodCallException|ReflectionException|Throwable - * - * @return mixed - */ - public function __call($method, $parameters); - - /** - * Dynamically handle calls to the class. - * - * @param string $method magic method name called - * @param array $parameters parameters list - * - * @throws BadMethodCallException - * - * @return mixed - */ - public static function __callStatic($method, $parameters); - - /** - * Update constructedObjectId on cloned. - */ - public function __clone(); - - /** - * Create a new Carbon instance. - * - * Please see the testing aids section (specifically static::setTestNow()) - * for more on the possibility of this constructor returning a test instance. - * - * @param DateTimeInterface|string|null $time - * @param DateTimeZone|string|null $tz - * - * @throws InvalidFormatException - */ - public function __construct($time = null, $tz = null); - - /** - * Show truthy properties on var_dump(). - * - * @return array - */ - public function __debugInfo(); - - /** - * Get a part of the Carbon object - * - * @param string $name - * - * @throws UnknownGetterException - * - * @return string|int|bool|DateTimeZone|null - */ - public function __get($name); - - /** - * Check if an attribute exists on the object - * - * @param string $name - * - * @return bool - */ - public function __isset($name); - - /** - * Set a part of the Carbon object - * - * @param string $name - * @param string|int|DateTimeZone $value - * - * @throws UnknownSetterException|ReflectionException - * - * @return void - */ - public function __set($name, $value); - - /** - * The __set_state handler. - * - * @param string|array $dump - * - * @return static - */ - #[ReturnTypeWillChange] - public static function __set_state($dump); - - /** - * Returns the list of properties to dump on serialize() called on. - * - * @return array - */ - public function __sleep(); - - /** - * Format the instance as a string using the set format - * - * @example - * ``` - * echo Carbon::now(); // Carbon instances can be casted to string - * ``` - * - * @return string - */ - public function __toString(); - - /** - * Add given units or interval to the current instance. - * - * @example $date->add('hour', 3) - * @example $date->add(15, 'days') - * @example $date->add(CarbonInterval::days(4)) - * - * @param string|DateInterval|Closure|CarbonConverterInterface $unit - * @param int $value - * @param bool|null $overflow - * - * @return static - */ - #[ReturnTypeWillChange] - public function add($unit, $value = 1, $overflow = null); - - /** - * Add seconds to the instance using timestamp. Positive $value travels - * forward while negative $value travels into the past. - * - * @param string $unit - * @param int $value - * - * @return static - */ - public function addRealUnit($unit, $value = 1); - - /** - * Add given units to the current instance. - * - * @param string $unit - * @param int $value - * @param bool|null $overflow - * - * @return static - */ - public function addUnit($unit, $value = 1, $overflow = null); - - /** - * Add any unit to a new value without overflowing current other unit given. - * - * @param string $valueUnit unit name to modify - * @param int $value amount to add to the input unit - * @param string $overflowUnit unit name to not overflow - * - * @return static - */ - public function addUnitNoOverflow($valueUnit, $value, $overflowUnit); - - /** - * Get the difference in a human readable format in the current locale from an other - * instance given to now - * - * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: - * - 'syntax' entry (see below) - * - 'short' entry (see below) - * - 'parts' entry (see below) - * - 'options' entry (see below) - * - 'join' entry determines how to join multiple parts of the string - * ` - if $join is a string, it's used as a joiner glue - * ` - if $join is a callable/closure, it get the list of string and should return a string - * ` - if $join is an array, the first item will be the default glue, and the second item - * ` will be used instead of the glue for the last item - * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) - * ` - if $join is missing, a space will be used as glue - * if int passed, it add modifiers: - * Possible values: - * - CarbonInterface::DIFF_ABSOLUTE no modifiers - * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier - * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier - * Default value: CarbonInterface::DIFF_ABSOLUTE - * @param bool $short displays short format of time units - * @param int $parts maximum number of parts to display (default value: 1: single part) - * @param int $options human diff options - * - * @return string - */ - public function ago($syntax = null, $short = false, $parts = 1, $options = null); - - /** - * Modify the current instance to the average of a given instance (default now) and the current instance - * (second-precision). - * - * @param \Carbon\Carbon|\DateTimeInterface|null $date - * - * @return static - */ - public function average($date = null); - - /** - * Clone the current instance if it's mutable. - * - * This method is convenient to ensure you don't mutate the initial object - * but avoid to make a useless copy of it if it's already immutable. - * - * @return static - */ - public function avoidMutation(); - - /** - * Determines if the instance is between two others. - * - * The third argument allow you to specify if bounds are included or not (true by default) - * but for when you including/excluding bounds may produce different results in your application, - * we recommend to use the explicit methods ->betweenIncluded() or ->betweenExcluded() instead. - * - * @example - * ``` - * Carbon::parse('2018-07-25')->between('2018-07-14', '2018-08-01'); // true - * Carbon::parse('2018-07-25')->between('2018-08-01', '2018-08-20'); // false - * Carbon::parse('2018-07-25')->between('2018-07-25', '2018-08-01'); // true - * Carbon::parse('2018-07-25')->between('2018-07-25', '2018-08-01', false); // false - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date1 - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date2 - * @param bool $equal Indicates if an equal to comparison should be done - * - * @return bool - */ - public function between($date1, $date2, $equal = true): bool; - - /** - * Determines if the instance is between two others, bounds excluded. - * - * @example - * ``` - * Carbon::parse('2018-07-25')->betweenExcluded('2018-07-14', '2018-08-01'); // true - * Carbon::parse('2018-07-25')->betweenExcluded('2018-08-01', '2018-08-20'); // false - * Carbon::parse('2018-07-25')->betweenExcluded('2018-07-25', '2018-08-01'); // false - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date1 - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date2 - * - * @return bool - */ - public function betweenExcluded($date1, $date2): bool; - - /** - * Determines if the instance is between two others, bounds included. - * - * @example - * ``` - * Carbon::parse('2018-07-25')->betweenIncluded('2018-07-14', '2018-08-01'); // true - * Carbon::parse('2018-07-25')->betweenIncluded('2018-08-01', '2018-08-20'); // false - * Carbon::parse('2018-07-25')->betweenIncluded('2018-07-25', '2018-08-01'); // true - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date1 - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date2 - * - * @return bool - */ - public function betweenIncluded($date1, $date2): bool; - - /** - * Returns either day of week + time (e.g. "Last Friday at 3:30 PM") if reference time is within 7 days, - * or a calendar date (e.g. "10/29/2017") otherwise. - * - * Language, date and time formats will change according to the current locale. - * - * @param Carbon|\DateTimeInterface|string|null $referenceTime - * @param array $formats - * - * @return string - */ - public function calendar($referenceTime = null, array $formats = []); - - /** - * Checks if the (date)time string is in a given format and valid to create a - * new instance. - * - * @example - * ``` - * Carbon::canBeCreatedFromFormat('11:12:45', 'h:i:s'); // true - * Carbon::canBeCreatedFromFormat('13:12:45', 'h:i:s'); // false - * ``` - * - * @param string $date - * @param string $format - * - * @return bool - */ - public static function canBeCreatedFromFormat($date, $format); - - /** - * Return the Carbon instance passed through, a now instance in the same timezone - * if null given or parse the input if string given. - * - * @param Carbon|\Carbon\CarbonPeriod|\Carbon\CarbonInterval|\DateInterval|\DatePeriod|DateTimeInterface|string|null $date - * - * @return static - */ - public function carbonize($date = null); - - /** - * Cast the current instance into the given class. - * - * @param string $className The $className::instance() method will be called to cast the current object. - * - * @return DateTimeInterface - */ - public function cast(string $className); - - /** - * Ceil the current instance second with given precision if specified. - * - * @param float|int|string|\DateInterval|null $precision - * - * @return CarbonInterface - */ - public function ceil($precision = 1); - - /** - * Ceil the current instance at the given unit with given precision if specified. - * - * @param string $unit - * @param float|int $precision - * - * @return CarbonInterface - */ - public function ceilUnit($unit, $precision = 1); - - /** - * Ceil the current instance week. - * - * @param int $weekStartsAt optional start allow you to specify the day of week to use to start the week - * - * @return CarbonInterface - */ - public function ceilWeek($weekStartsAt = null); - - /** - * Similar to native modify() method of DateTime but can handle more grammars. - * - * @example - * ``` - * echo Carbon::now()->change('next 2pm'); - * ``` - * - * @link https://php.net/manual/en/datetime.modify.php - * - * @param string $modifier - * - * @return static - */ - public function change($modifier); - - /** - * Cleanup properties attached to the public scope of DateTime when a dump of the date is requested. - * foreach ($date as $_) {} - * serializer($date) - * var_export($date) - * get_object_vars($date) - */ - public function cleanupDumpProperties(); - - /** - * @alias copy - * - * Get a copy of the instance. - * - * @return static - */ - public function clone(); - - /** - * Get the closest date from the instance (second-precision). - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date1 - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date2 - * - * @return static - */ - public function closest($date1, $date2); - - /** - * Get a copy of the instance. - * - * @return static - */ - public function copy(); - - /** - * Create a new Carbon instance from a specific date and time. - * - * If any of $year, $month or $day are set to null their now() values will - * be used. - * - * If $hour is null it will be set to its now() value and the default - * values for $minute and $second will be their now() values. - * - * If $hour is not null then the default values for $minute and $second - * will be 0. - * - * @param int|null $year - * @param int|null $month - * @param int|null $day - * @param int|null $hour - * @param int|null $minute - * @param int|null $second - * @param DateTimeZone|string|null $tz - * - * @throws InvalidFormatException - * - * @return static|false - */ - public static function create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $tz = null); - - /** - * Create a Carbon instance from just a date. The time portion is set to now. - * - * @param int|null $year - * @param int|null $month - * @param int|null $day - * @param DateTimeZone|string|null $tz - * - * @throws InvalidFormatException - * - * @return static - */ - public static function createFromDate($year = null, $month = null, $day = null, $tz = null); - - /** - * Create a Carbon instance from a specific format. - * - * @param string $format Datetime format - * @param string $time - * @param DateTimeZone|string|false|null $tz - * - * @throws InvalidFormatException - * - * @return static|false - */ - #[ReturnTypeWillChange] - public static function createFromFormat($format, $time, $tz = null); - - /** - * Create a Carbon instance from a specific ISO format (same replacements as ->isoFormat()). - * - * @param string $format Datetime format - * @param string $time - * @param DateTimeZone|string|false|null $tz optional timezone - * @param string|null $locale locale to be used for LTS, LT, LL, LLL, etc. macro-formats (en by fault, unneeded if no such macro-format in use) - * @param \Symfony\Component\Translation\TranslatorInterface $translator optional custom translator to use for macro-formats - * - * @throws InvalidFormatException - * - * @return static|false - */ - public static function createFromIsoFormat($format, $time, $tz = null, $locale = 'en', $translator = null); - - /** - * Create a Carbon instance from a specific format and a string in a given language. - * - * @param string $format Datetime format - * @param string $locale - * @param string $time - * @param DateTimeZone|string|false|null $tz - * - * @throws InvalidFormatException - * - * @return static|false - */ - public static function createFromLocaleFormat($format, $locale, $time, $tz = null); - - /** - * Create a Carbon instance from a specific ISO format and a string in a given language. - * - * @param string $format Datetime ISO format - * @param string $locale - * @param string $time - * @param DateTimeZone|string|false|null $tz - * - * @throws InvalidFormatException - * - * @return static|false - */ - public static function createFromLocaleIsoFormat($format, $locale, $time, $tz = null); - - /** - * Create a Carbon instance from just a time. The date portion is set to today. - * - * @param int|null $hour - * @param int|null $minute - * @param int|null $second - * @param DateTimeZone|string|null $tz - * - * @throws InvalidFormatException - * - * @return static - */ - public static function createFromTime($hour = 0, $minute = 0, $second = 0, $tz = null); - - /** - * Create a Carbon instance from a time string. The date portion is set to today. - * - * @param string $time - * @param DateTimeZone|string|null $tz - * - * @throws InvalidFormatException - * - * @return static - */ - public static function createFromTimeString($time, $tz = null); - - /** - * Create a Carbon instance from a timestamp and set the timezone (use default one if not specified). - * - * Timestamp input can be given as int, float or a string containing one or more numbers. - * - * @param float|int|string $timestamp - * @param \DateTimeZone|string|null $tz - * - * @return static - */ - public static function createFromTimestamp($timestamp, $tz = null); - - /** - * Create a Carbon instance from a timestamp in milliseconds. - * - * Timestamp input can be given as int, float or a string containing one or more numbers. - * - * @param float|int|string $timestamp - * @param \DateTimeZone|string|null $tz - * - * @return static - */ - public static function createFromTimestampMs($timestamp, $tz = null); - - /** - * Create a Carbon instance from a timestamp in milliseconds. - * - * Timestamp input can be given as int, float or a string containing one or more numbers. - * - * @param float|int|string $timestamp - * - * @return static - */ - public static function createFromTimestampMsUTC($timestamp); - - /** - * Create a Carbon instance from an timestamp keeping the timezone to UTC. - * - * Timestamp input can be given as int, float or a string containing one or more numbers. - * - * @param float|int|string $timestamp - * - * @return static - */ - public static function createFromTimestampUTC($timestamp); - - /** - * Create a Carbon instance from just a date. The time portion is set to midnight. - * - * @param int|null $year - * @param int|null $month - * @param int|null $day - * @param DateTimeZone|string|null $tz - * - * @throws InvalidFormatException - * - * @return static - */ - public static function createMidnightDate($year = null, $month = null, $day = null, $tz = null); - - /** - * Create a new safe Carbon instance from a specific date and time. - * - * If any of $year, $month or $day are set to null their now() values will - * be used. - * - * If $hour is null it will be set to its now() value and the default - * values for $minute and $second will be their now() values. - * - * If $hour is not null then the default values for $minute and $second - * will be 0. - * - * If one of the set values is not valid, an InvalidDateException - * will be thrown. - * - * @param int|null $year - * @param int|null $month - * @param int|null $day - * @param int|null $hour - * @param int|null $minute - * @param int|null $second - * @param DateTimeZone|string|null $tz - * - * @throws InvalidDateException - * - * @return static|false - */ - public static function createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null); - - /** - * Create a new Carbon instance from a specific date and time using strict validation. - * - * @see create() - * - * @param int|null $year - * @param int|null $month - * @param int|null $day - * @param int|null $hour - * @param int|null $minute - * @param int|null $second - * @param DateTimeZone|string|null $tz - * - * @throws InvalidFormatException - * - * @return static - */ - public static function createStrict(?int $year = 0, ?int $month = 1, ?int $day = 1, ?int $hour = 0, ?int $minute = 0, ?int $second = 0, $tz = null); - - /** - * Get/set the day of year. - * - * @param int|null $value new value for day of year if using as setter. - * - * @return static|int - */ - public function dayOfYear($value = null); - - /** - * Get the difference as a CarbonInterval instance. - * Return relative interval (negative if $absolute flag is not set to true and the given date is before - * current one). - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return CarbonInterval - */ - public function diffAsCarbonInterval($date = null, $absolute = true); - - /** - * Get the difference by the given interval using a filter closure. - * - * @param CarbonInterval $ci An interval to traverse by - * @param Closure $callback - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffFiltered(CarbonInterval $ci, Closure $callback, $date = null, $absolute = true); - - /** - * Get the difference in a human readable format in the current locale from current instance to an other - * instance given (or now if null given). - * - * @example - * ``` - * echo Carbon::tomorrow()->diffForHumans() . "\n"; - * echo Carbon::tomorrow()->diffForHumans(['parts' => 2]) . "\n"; - * echo Carbon::tomorrow()->diffForHumans(['parts' => 3, 'join' => true]) . "\n"; - * echo Carbon::tomorrow()->diffForHumans(Carbon::yesterday()) . "\n"; - * echo Carbon::tomorrow()->diffForHumans(Carbon::yesterday(), ['short' => true]) . "\n"; - * ``` - * - * @param Carbon|\DateTimeInterface|string|array|null $other if array passed, will be used as parameters array, see $syntax below; - * if null passed, now will be used as comparison reference; - * if any other type, it will be converted to date and used as reference. - * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: - * - 'syntax' entry (see below) - * - 'short' entry (see below) - * - 'parts' entry (see below) - * - 'options' entry (see below) - * - 'skip' entry, list of units to skip (array of strings or a single string, - * ` it can be the unit name (singular or plural) or its shortcut - * ` (y, m, w, d, h, min, s, ms, µs). - * - 'aUnit' entry, prefer "an hour" over "1 hour" if true - * - 'join' entry determines how to join multiple parts of the string - * ` - if $join is a string, it's used as a joiner glue - * ` - if $join is a callable/closure, it get the list of string and should return a string - * ` - if $join is an array, the first item will be the default glue, and the second item - * ` will be used instead of the glue for the last item - * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) - * ` - if $join is missing, a space will be used as glue - * - 'other' entry (see above) - * - 'minimumUnit' entry determines the smallest unit of time to display can be long or - * ` short form of the units, e.g. 'hour' or 'h' (default value: s) - * if int passed, it add modifiers: - * Possible values: - * - CarbonInterface::DIFF_ABSOLUTE no modifiers - * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier - * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier - * Default value: CarbonInterface::DIFF_ABSOLUTE - * @param bool $short displays short format of time units - * @param int $parts maximum number of parts to display (default value: 1: single unit) - * @param int $options human diff options - * - * @return string - */ - public function diffForHumans($other = null, $syntax = null, $short = false, $parts = 1, $options = null); - - /** - * Get the difference in days rounded down. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInDays($date = null, $absolute = true); - - /** - * Get the difference in days using a filter closure rounded down. - * - * @param Closure $callback - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInDaysFiltered(Closure $callback, $date = null, $absolute = true); - - /** - * Get the difference in hours rounded down. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInHours($date = null, $absolute = true); - - /** - * Get the difference in hours using a filter closure rounded down. - * - * @param Closure $callback - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInHoursFiltered(Closure $callback, $date = null, $absolute = true); - - /** - * Get the difference in microseconds. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInMicroseconds($date = null, $absolute = true); - - /** - * Get the difference in milliseconds rounded down. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInMilliseconds($date = null, $absolute = true); - - /** - * Get the difference in minutes rounded down. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInMinutes($date = null, $absolute = true); - - /** - * Get the difference in months rounded down. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInMonths($date = null, $absolute = true); - - /** - * Get the difference in quarters rounded down. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInQuarters($date = null, $absolute = true); - - /** - * Get the difference in hours rounded down using timestamps. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInRealHours($date = null, $absolute = true); - - /** - * Get the difference in microseconds using timestamps. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInRealMicroseconds($date = null, $absolute = true); - - /** - * Get the difference in milliseconds rounded down using timestamps. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInRealMilliseconds($date = null, $absolute = true); - - /** - * Get the difference in minutes rounded down using timestamps. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInRealMinutes($date = null, $absolute = true); - - /** - * Get the difference in seconds using timestamps. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInRealSeconds($date = null, $absolute = true); - - /** - * Get the difference in seconds rounded down. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInSeconds($date = null, $absolute = true); - - /** - * Get the difference in weekdays rounded down. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInWeekdays($date = null, $absolute = true); - - /** - * Get the difference in weekend days using a filter rounded down. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInWeekendDays($date = null, $absolute = true); - - /** - * Get the difference in weeks rounded down. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInWeeks($date = null, $absolute = true); - - /** - * Get the difference in years - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInYears($date = null, $absolute = true); - - /** - * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @see settings - * - * @param int $humanDiffOption - */ - public static function disableHumanDiffOption($humanDiffOption); - - /** - * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @see settings - * - * @param int $humanDiffOption - */ - public static function enableHumanDiffOption($humanDiffOption); - - /** - * Modify to end of current given unit. - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16.334455') - * ->startOf('month') - * ->endOf('week', Carbon::FRIDAY); - * ``` - * - * @param string $unit - * @param array<int, mixed> $params - * - * @return static - */ - public function endOf($unit, ...$params); - - /** - * Resets the date to end of the century and time to 23:59:59.999999 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->endOfCentury(); - * ``` - * - * @return static - */ - public function endOfCentury(); - - /** - * Resets the time to 23:59:59.999999 end of day - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->endOfDay(); - * ``` - * - * @return static - */ - public function endOfDay(); - - /** - * Resets the date to end of the decade and time to 23:59:59.999999 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->endOfDecade(); - * ``` - * - * @return static - */ - public function endOfDecade(); - - /** - * Modify to end of current hour, minutes and seconds become 59 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->endOfHour(); - * ``` - * - * @return static - */ - public function endOfHour(); - - /** - * Resets the date to end of the millennium and time to 23:59:59.999999 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->endOfMillennium(); - * ``` - * - * @return static - */ - public function endOfMillennium(); - - /** - * Modify to end of current minute, seconds become 59 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->endOfMinute(); - * ``` - * - * @return static - */ - public function endOfMinute(); - - /** - * Resets the date to end of the month and time to 23:59:59.999999 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->endOfMonth(); - * ``` - * - * @return static - */ - public function endOfMonth(); - - /** - * Resets the date to end of the quarter and time to 23:59:59.999999 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->endOfQuarter(); - * ``` - * - * @return static - */ - public function endOfQuarter(); - - /** - * Modify to end of current second, microseconds become 999999 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16.334455') - * ->endOfSecond() - * ->format('H:i:s.u'); - * ``` - * - * @return static - */ - public function endOfSecond(); - - /** - * Resets the date to end of week (defined in $weekEndsAt) and time to 23:59:59.999999 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->endOfWeek() . "\n"; - * echo Carbon::parse('2018-07-25 12:45:16')->locale('ar')->endOfWeek() . "\n"; - * echo Carbon::parse('2018-07-25 12:45:16')->endOfWeek(Carbon::SATURDAY) . "\n"; - * ``` - * - * @param int $weekEndsAt optional start allow you to specify the day of week to use to end the week - * - * @return static - */ - public function endOfWeek($weekEndsAt = null); - - /** - * Resets the date to end of the year and time to 23:59:59.999999 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->endOfYear(); - * ``` - * - * @return static - */ - public function endOfYear(); - - /** - * Determines if the instance is equal to another - * - * @example - * ``` - * Carbon::parse('2018-07-25 12:45:16')->eq('2018-07-25 12:45:16'); // true - * Carbon::parse('2018-07-25 12:45:16')->eq(Carbon::parse('2018-07-25 12:45:16')); // true - * Carbon::parse('2018-07-25 12:45:16')->eq('2018-07-25 12:45:17'); // false - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @see equalTo() - * - * @return bool - */ - public function eq($date): bool; - - /** - * Determines if the instance is equal to another - * - * @example - * ``` - * Carbon::parse('2018-07-25 12:45:16')->equalTo('2018-07-25 12:45:16'); // true - * Carbon::parse('2018-07-25 12:45:16')->equalTo(Carbon::parse('2018-07-25 12:45:16')); // true - * Carbon::parse('2018-07-25 12:45:16')->equalTo('2018-07-25 12:45:17'); // false - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @return bool - */ - public function equalTo($date): bool; - - /** - * Set the current locale to the given, execute the passed function, reset the locale to previous one, - * then return the result of the closure (or null if the closure was void). - * - * @param string $locale locale ex. en - * @param callable $func - * - * @return mixed - */ - public static function executeWithLocale($locale, $func); - - /** - * Get the farthest date from the instance (second-precision). - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date1 - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date2 - * - * @return static - */ - public function farthest($date1, $date2); - - /** - * Modify to the first occurrence of a given day of the week - * in the current month. If no dayOfWeek is provided, modify to the - * first day of the current month. Use the supplied constants - * to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int|null $dayOfWeek - * - * @return static - */ - public function firstOfMonth($dayOfWeek = null); - - /** - * Modify to the first occurrence of a given day of the week - * in the current quarter. If no dayOfWeek is provided, modify to the - * first day of the current quarter. Use the supplied constants - * to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int|null $dayOfWeek day of the week default null - * - * @return static - */ - public function firstOfQuarter($dayOfWeek = null); - - /** - * Modify to the first occurrence of a given day of the week - * in the current year. If no dayOfWeek is provided, modify to the - * first day of the current year. Use the supplied constants - * to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int|null $dayOfWeek day of the week default null - * - * @return static - */ - public function firstOfYear($dayOfWeek = null); - - /** - * Get the difference in days as float (microsecond-precision). - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return float - */ - public function floatDiffInDays($date = null, $absolute = true); - - /** - * Get the difference in hours as float (microsecond-precision). - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return float - */ - public function floatDiffInHours($date = null, $absolute = true); - - /** - * Get the difference in minutes as float (microsecond-precision). - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return float - */ - public function floatDiffInMinutes($date = null, $absolute = true); - - /** - * Get the difference in months as float (microsecond-precision). - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return float - */ - public function floatDiffInMonths($date = null, $absolute = true); - - /** - * Get the difference in days as float (microsecond-precision). - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return float - */ - public function floatDiffInRealDays($date = null, $absolute = true); - - /** - * Get the difference in hours as float (microsecond-precision) using timestamps. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return float - */ - public function floatDiffInRealHours($date = null, $absolute = true); - - /** - * Get the difference in minutes as float (microsecond-precision) using timestamps. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return float - */ - public function floatDiffInRealMinutes($date = null, $absolute = true); - - /** - * Get the difference in months as float (microsecond-precision) using timestamps. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return float - */ - public function floatDiffInRealMonths($date = null, $absolute = true); - - /** - * Get the difference in seconds as float (microsecond-precision) using timestamps. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return float - */ - public function floatDiffInRealSeconds($date = null, $absolute = true); - - /** - * Get the difference in weeks as float (microsecond-precision). - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return float - */ - public function floatDiffInRealWeeks($date = null, $absolute = true); - - /** - * Get the difference in year as float (microsecond-precision) using timestamps. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return float - */ - public function floatDiffInRealYears($date = null, $absolute = true); - - /** - * Get the difference in seconds as float (microsecond-precision). - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return float - */ - public function floatDiffInSeconds($date = null, $absolute = true); - - /** - * Get the difference in weeks as float (microsecond-precision). - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return float - */ - public function floatDiffInWeeks($date = null, $absolute = true); - - /** - * Get the difference in year as float (microsecond-precision). - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return float - */ - public function floatDiffInYears($date = null, $absolute = true); - - /** - * Round the current instance second with given precision if specified. - * - * @param float|int|string|\DateInterval|null $precision - * - * @return CarbonInterface - */ - public function floor($precision = 1); - - /** - * Truncate the current instance at the given unit with given precision if specified. - * - * @param string $unit - * @param float|int $precision - * - * @return CarbonInterface - */ - public function floorUnit($unit, $precision = 1); - - /** - * Truncate the current instance week. - * - * @param int $weekStartsAt optional start allow you to specify the day of week to use to start the week - * - * @return CarbonInterface - */ - public function floorWeek($weekStartsAt = null); - - /** - * Format the instance with the current locale. You can set the current - * locale using setlocale() https://php.net/setlocale. - * - * @deprecated It uses OS language package and strftime() which is deprecated since PHP 8.1. - * Use ->isoFormat() instead. - * Deprecated since 2.55.0 - * - * @param string $format - * - * @return string - */ - public function formatLocalized($format); - - /** - * @alias diffForHumans - * - * Get the difference in a human readable format in the current locale from current instance to an other - * instance given (or now if null given). - * - * @param Carbon|\DateTimeInterface|string|array|null $other if array passed, will be used as parameters array, see $syntax below; - * if null passed, now will be used as comparison reference; - * if any other type, it will be converted to date and used as reference. - * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: - * - 'syntax' entry (see below) - * - 'short' entry (see below) - * - 'parts' entry (see below) - * - 'options' entry (see below) - * - 'join' entry determines how to join multiple parts of the string - * ` - if $join is a string, it's used as a joiner glue - * ` - if $join is a callable/closure, it get the list of string and should return a string - * ` - if $join is an array, the first item will be the default glue, and the second item - * ` will be used instead of the glue for the last item - * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) - * ` - if $join is missing, a space will be used as glue - * - 'other' entry (see above) - * if int passed, it add modifiers: - * Possible values: - * - CarbonInterface::DIFF_ABSOLUTE no modifiers - * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier - * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier - * Default value: CarbonInterface::DIFF_ABSOLUTE - * @param bool $short displays short format of time units - * @param int $parts maximum number of parts to display (default value: 1: single unit) - * @param int $options human diff options - * - * @return string - */ - public function from($other = null, $syntax = null, $short = false, $parts = 1, $options = null); - - /** - * Get the difference in a human readable format in the current locale from current - * instance to now. - * - * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: - * - 'syntax' entry (see below) - * - 'short' entry (see below) - * - 'parts' entry (see below) - * - 'options' entry (see below) - * - 'join' entry determines how to join multiple parts of the string - * ` - if $join is a string, it's used as a joiner glue - * ` - if $join is a callable/closure, it get the list of string and should return a string - * ` - if $join is an array, the first item will be the default glue, and the second item - * ` will be used instead of the glue for the last item - * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) - * ` - if $join is missing, a space will be used as glue - * if int passed, it add modifiers: - * Possible values: - * - CarbonInterface::DIFF_ABSOLUTE no modifiers - * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier - * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier - * Default value: CarbonInterface::DIFF_ABSOLUTE - * @param bool $short displays short format of time units - * @param int $parts maximum number of parts to display (default value: 1: single unit) - * @param int $options human diff options - * - * @return string - */ - public function fromNow($syntax = null, $short = false, $parts = 1, $options = null); - - /** - * Create an instance from a serialized string. - * - * @param string $value - * - * @throws InvalidFormatException - * - * @return static - */ - public static function fromSerialized($value); - - /** - * Register a custom macro. - * - * @param object|callable $macro - * @param int $priority marco with higher priority is tried first - * - * @return void - */ - public static function genericMacro($macro, $priority = 0); - - /** - * Get a part of the Carbon object - * - * @param string $name - * - * @throws UnknownGetterException - * - * @return string|int|bool|DateTimeZone|null - */ - public function get($name); - - /** - * Returns the alternative number for a given date property if available in the current locale. - * - * @param string $key date property - * - * @return string - */ - public function getAltNumber(string $key): string; - - /** - * Returns the list of internally available locales and already loaded custom locales. - * (It will ignore custom translator dynamic loading.) - * - * @return array - */ - public static function getAvailableLocales(); - - /** - * Returns list of Language object for each available locale. This object allow you to get the ISO name, native - * name, region and variant of the locale. - * - * @return Language[] - */ - public static function getAvailableLocalesInfo(); - - /** - * Returns list of calendar formats for ISO formatting. - * - * @param string|null $locale current locale used if null - * - * @return array - */ - public function getCalendarFormats($locale = null); - - /** - * Get the days of the week - * - * @return array - */ - public static function getDays(); - - /** - * Get the fallback locale. - * - * @see https://symfony.com/doc/current/components/translation.html#fallback-locales - * - * @return string|null - */ - public static function getFallbackLocale(); - - /** - * List of replacements from date() format to isoFormat(). - * - * @return array - */ - public static function getFormatsToIsoReplacements(); - - /** - * Return default humanDiff() options (merged flags as integer). - * - * @return int - */ - public static function getHumanDiffOptions(); - - /** - * Returns list of locale formats for ISO formatting. - * - * @param string|null $locale current locale used if null - * - * @return array - */ - public function getIsoFormats($locale = null); - - /** - * Returns list of locale units for ISO formatting. - * - * @return array - */ - public static function getIsoUnits(); - - /** - * {@inheritdoc} - * - * @return array - */ - #[ReturnTypeWillChange] - public static function getLastErrors(); - - /** - * Get the raw callable macro registered globally or locally for a given name. - * - * @param string $name - * - * @return callable|null - */ - public function getLocalMacro($name); - - /** - * Get the translator of the current instance or the default if none set. - * - * @return \Symfony\Component\Translation\TranslatorInterface - */ - public function getLocalTranslator(); - - /** - * Get the current translator locale. - * - * @return string - */ - public static function getLocale(); - - /** - * Get the raw callable macro registered globally for a given name. - * - * @param string $name - * - * @return callable|null - */ - public static function getMacro($name); - - /** - * get midday/noon hour - * - * @return int - */ - public static function getMidDayAt(); - - /** - * Returns the offset hour and minute formatted with +/- and a given separator (":" by default). - * For example, if the time zone is 9 hours 30 minutes, you'll get "+09:30", with "@@" as first - * argument, "+09@@30", with "" as first argument, "+0930". Negative offset will return something - * like "-12:00". - * - * @param string $separator string to place between hours and minutes (":" by default) - * - * @return string - */ - public function getOffsetString($separator = ':'); - - /** - * Returns a unit of the instance padded with 0 by default or any other string if specified. - * - * @param string $unit Carbon unit name - * @param int $length Length of the output (2 by default) - * @param string $padString String to use for padding ("0" by default) - * @param int $padType Side(s) to pad (STR_PAD_LEFT by default) - * - * @return string - */ - public function getPaddedUnit($unit, $length = 2, $padString = '0', $padType = 0); - - /** - * Returns a timestamp rounded with the given precision (6 by default). - * - * @example getPreciseTimestamp() 1532087464437474 (microsecond maximum precision) - * @example getPreciseTimestamp(6) 1532087464437474 - * @example getPreciseTimestamp(5) 153208746443747 (1/100000 second precision) - * @example getPreciseTimestamp(4) 15320874644375 (1/10000 second precision) - * @example getPreciseTimestamp(3) 1532087464437 (millisecond precision) - * @example getPreciseTimestamp(2) 153208746444 (1/100 second precision) - * @example getPreciseTimestamp(1) 15320874644 (1/10 second precision) - * @example getPreciseTimestamp(0) 1532087464 (second precision) - * @example getPreciseTimestamp(-1) 153208746 (10 second precision) - * @example getPreciseTimestamp(-2) 15320875 (100 second precision) - * - * @param int $precision - * - * @return float - */ - public function getPreciseTimestamp($precision = 6); - - /** - * Returns current local settings. - * - * @return array - */ - public function getSettings(); - - /** - * Get the Carbon instance (real or mock) to be returned when a "now" - * instance is created. - * - * @return Closure|static the current instance used for testing - */ - public static function getTestNow(); - - /** - * Return a format from H:i to H:i:s.u according to given unit precision. - * - * @param string $unitPrecision "minute", "second", "millisecond" or "microsecond" - * - * @return string - */ - public static function getTimeFormatByPrecision($unitPrecision); - - /** - * Returns the timestamp with millisecond precision. - * - * @return int - */ - public function getTimestampMs(); - - /** - * Get the translation of the current week day name (with context for languages with multiple forms). - * - * @param string|null $context whole format string - * @param string $keySuffix "", "_short" or "_min" - * @param string|null $defaultValue default value if translation missing - * - * @return string - */ - public function getTranslatedDayName($context = null, $keySuffix = '', $defaultValue = null); - - /** - * Get the translation of the current abbreviated week day name (with context for languages with multiple forms). - * - * @param string|null $context whole format string - * - * @return string - */ - public function getTranslatedMinDayName($context = null); - - /** - * Get the translation of the current month day name (with context for languages with multiple forms). - * - * @param string|null $context whole format string - * @param string $keySuffix "" or "_short" - * @param string|null $defaultValue default value if translation missing - * - * @return string - */ - public function getTranslatedMonthName($context = null, $keySuffix = '', $defaultValue = null); - - /** - * Get the translation of the current short week day name (with context for languages with multiple forms). - * - * @param string|null $context whole format string - * - * @return string - */ - public function getTranslatedShortDayName($context = null); - - /** - * Get the translation of the current short month day name (with context for languages with multiple forms). - * - * @param string|null $context whole format string - * - * @return string - */ - public function getTranslatedShortMonthName($context = null); - - /** - * Returns raw translation message for a given key. - * - * @param string $key key to find - * @param string|null $locale current locale used if null - * @param string|null $default default value if translation returns the key - * @param \Symfony\Component\Translation\TranslatorInterface $translator an optional translator to use - * - * @return string - */ - public function getTranslationMessage(string $key, ?string $locale = null, ?string $default = null, $translator = null); - - /** - * Returns raw translation message for a given key. - * - * @param \Symfony\Component\Translation\TranslatorInterface $translator the translator to use - * @param string $key key to find - * @param string|null $locale current locale used if null - * @param string|null $default default value if translation returns the key - * - * @return string - */ - public static function getTranslationMessageWith($translator, string $key, ?string $locale = null, ?string $default = null); - - /** - * Get the default translator instance in use. - * - * @return \Symfony\Component\Translation\TranslatorInterface - */ - public static function getTranslator(); - - /** - * Get the last day of week - * - * @return int - */ - public static function getWeekEndsAt(); - - /** - * Get the first day of week - * - * @return int - */ - public static function getWeekStartsAt(); - - /** - * Get weekend days - * - * @return array - */ - public static function getWeekendDays(); - - /** - * Determines if the instance is greater (after) than another - * - * @example - * ``` - * Carbon::parse('2018-07-25 12:45:16')->greaterThan('2018-07-25 12:45:15'); // true - * Carbon::parse('2018-07-25 12:45:16')->greaterThan('2018-07-25 12:45:16'); // false - * Carbon::parse('2018-07-25 12:45:16')->greaterThan('2018-07-25 12:45:17'); // false - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @return bool - */ - public function greaterThan($date): bool; - - /** - * Determines if the instance is greater (after) than or equal to another - * - * @example - * ``` - * Carbon::parse('2018-07-25 12:45:16')->greaterThanOrEqualTo('2018-07-25 12:45:15'); // true - * Carbon::parse('2018-07-25 12:45:16')->greaterThanOrEqualTo('2018-07-25 12:45:16'); // true - * Carbon::parse('2018-07-25 12:45:16')->greaterThanOrEqualTo('2018-07-25 12:45:17'); // false - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @return bool - */ - public function greaterThanOrEqualTo($date): bool; - - /** - * Determines if the instance is greater (after) than another - * - * @example - * ``` - * Carbon::parse('2018-07-25 12:45:16')->gt('2018-07-25 12:45:15'); // true - * Carbon::parse('2018-07-25 12:45:16')->gt('2018-07-25 12:45:16'); // false - * Carbon::parse('2018-07-25 12:45:16')->gt('2018-07-25 12:45:17'); // false - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @see greaterThan() - * - * @return bool - */ - public function gt($date): bool; - - /** - * Determines if the instance is greater (after) than or equal to another - * - * @example - * ``` - * Carbon::parse('2018-07-25 12:45:16')->gte('2018-07-25 12:45:15'); // true - * Carbon::parse('2018-07-25 12:45:16')->gte('2018-07-25 12:45:16'); // true - * Carbon::parse('2018-07-25 12:45:16')->gte('2018-07-25 12:45:17'); // false - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @see greaterThanOrEqualTo() - * - * @return bool - */ - public function gte($date): bool; - - /** - * Checks if the (date)time string is in a given format. - * - * @example - * ``` - * Carbon::hasFormat('11:12:45', 'h:i:s'); // true - * Carbon::hasFormat('13:12:45', 'h:i:s'); // false - * ``` - * - * @param string $date - * @param string $format - * - * @return bool - */ - public static function hasFormat($date, $format); - - /** - * Checks if the (date)time string is in a given format. - * - * @example - * ``` - * Carbon::hasFormatWithModifiers('31/08/2015', 'd#m#Y'); // true - * Carbon::hasFormatWithModifiers('31/08/2015', 'm#d#Y'); // false - * ``` - * - * @param string $date - * @param string $format - * - * @return bool - */ - public static function hasFormatWithModifiers($date, $format): bool; - - /** - * Checks if macro is registered globally or locally. - * - * @param string $name - * - * @return bool - */ - public function hasLocalMacro($name); - - /** - * Return true if the current instance has its own translator. - * - * @return bool - */ - public function hasLocalTranslator(); - - /** - * Checks if macro is registered globally. - * - * @param string $name - * - * @return bool - */ - public static function hasMacro($name); - - /** - * Determine if a time string will produce a relative date. - * - * @param string $time - * - * @return bool true if time match a relative date, false if absolute or invalid time string - */ - public static function hasRelativeKeywords($time); - - /** - * Determine if there is a valid test instance set. A valid test instance - * is anything that is not null. - * - * @return bool true if there is a test instance, otherwise false - */ - public static function hasTestNow(); - - /** - * Create a Carbon instance from a DateTime one. - * - * @param DateTimeInterface $date - * - * @return static - */ - public static function instance($date); - - /** - * Returns true if the current date matches the given string. - * - * @example - * ``` - * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('2019')); // true - * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('2018')); // false - * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('2019-06')); // true - * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('06-02')); // true - * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('2019-06-02')); // true - * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('Sunday')); // true - * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('June')); // true - * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('12:23')); // true - * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('12:23:45')); // true - * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('12:23:00')); // false - * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('12h')); // true - * var_dump(Carbon::parse('2019-06-02 15:23:45')->is('3pm')); // true - * var_dump(Carbon::parse('2019-06-02 15:23:45')->is('3am')); // false - * ``` - * - * @param string $tester day name, month name, hour, date, etc. as string - * - * @return bool - */ - public function is(string $tester); - - /** - * Determines if the instance is greater (after) than another - * - * @example - * ``` - * Carbon::parse('2018-07-25 12:45:16')->isAfter('2018-07-25 12:45:15'); // true - * Carbon::parse('2018-07-25 12:45:16')->isAfter('2018-07-25 12:45:16'); // false - * Carbon::parse('2018-07-25 12:45:16')->isAfter('2018-07-25 12:45:17'); // false - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @see greaterThan() - * - * @return bool - */ - public function isAfter($date): bool; - - /** - * Determines if the instance is less (before) than another - * - * @example - * ``` - * Carbon::parse('2018-07-25 12:45:16')->isBefore('2018-07-25 12:45:15'); // false - * Carbon::parse('2018-07-25 12:45:16')->isBefore('2018-07-25 12:45:16'); // false - * Carbon::parse('2018-07-25 12:45:16')->isBefore('2018-07-25 12:45:17'); // true - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @see lessThan() - * - * @return bool - */ - public function isBefore($date): bool; - - /** - * Determines if the instance is between two others - * - * @example - * ``` - * Carbon::parse('2018-07-25')->isBetween('2018-07-14', '2018-08-01'); // true - * Carbon::parse('2018-07-25')->isBetween('2018-08-01', '2018-08-20'); // false - * Carbon::parse('2018-07-25')->isBetween('2018-07-25', '2018-08-01'); // true - * Carbon::parse('2018-07-25')->isBetween('2018-07-25', '2018-08-01', false); // false - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date1 - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date2 - * @param bool $equal Indicates if an equal to comparison should be done - * - * @return bool - */ - public function isBetween($date1, $date2, $equal = true): bool; - - /** - * Check if its the birthday. Compares the date/month values of the two dates. - * - * @example - * ``` - * Carbon::now()->subYears(5)->isBirthday(); // true - * Carbon::now()->subYears(5)->subDay()->isBirthday(); // false - * Carbon::parse('2019-06-05')->isBirthday(Carbon::parse('2001-06-05')); // true - * Carbon::parse('2019-06-05')->isBirthday(Carbon::parse('2001-06-06')); // false - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|null $date The instance to compare with or null to use current day. - * - * @return bool - */ - public function isBirthday($date = null); - - /** - * Determines if the instance is in the current unit given. - * - * @example - * ``` - * Carbon::now()->isCurrentUnit('hour'); // true - * Carbon::now()->subHours(2)->isCurrentUnit('hour'); // false - * ``` - * - * @param string $unit The unit to test. - * - * @throws BadMethodCallException - * - * @return bool - */ - public function isCurrentUnit($unit); - - /** - * Checks if this day is a specific day of the week. - * - * @example - * ``` - * Carbon::parse('2019-07-17')->isDayOfWeek(Carbon::WEDNESDAY); // true - * Carbon::parse('2019-07-17')->isDayOfWeek(Carbon::FRIDAY); // false - * Carbon::parse('2019-07-17')->isDayOfWeek('Wednesday'); // true - * Carbon::parse('2019-07-17')->isDayOfWeek('Friday'); // false - * ``` - * - * @param int $dayOfWeek - * - * @return bool - */ - public function isDayOfWeek($dayOfWeek); - - /** - * Check if the instance is end of day. - * - * @example - * ``` - * Carbon::parse('2019-02-28 23:59:59.999999')->isEndOfDay(); // true - * Carbon::parse('2019-02-28 23:59:59.123456')->isEndOfDay(); // true - * Carbon::parse('2019-02-28 23:59:59')->isEndOfDay(); // true - * Carbon::parse('2019-02-28 23:59:58.999999')->isEndOfDay(); // false - * Carbon::parse('2019-02-28 23:59:59.999999')->isEndOfDay(true); // true - * Carbon::parse('2019-02-28 23:59:59.123456')->isEndOfDay(true); // false - * Carbon::parse('2019-02-28 23:59:59')->isEndOfDay(true); // false - * ``` - * - * @param bool $checkMicroseconds check time at microseconds precision - * - * @return bool - */ - public function isEndOfDay($checkMicroseconds = false); - - /** - * Returns true if the date was created using CarbonImmutable::endOfTime() - * - * @return bool - */ - public function isEndOfTime(): bool; - - /** - * Determines if the instance is in the future, ie. greater (after) than now. - * - * @example - * ``` - * Carbon::now()->addHours(5)->isFuture(); // true - * Carbon::now()->subHours(5)->isFuture(); // false - * ``` - * - * @return bool - */ - public function isFuture(); - - /** - * Returns true if the current class/instance is immutable. - * - * @return bool - */ - public static function isImmutable(); - - /** - * Check if today is the last day of the Month - * - * @example - * ``` - * Carbon::parse('2019-02-28')->isLastOfMonth(); // true - * Carbon::parse('2019-03-28')->isLastOfMonth(); // false - * Carbon::parse('2019-03-30')->isLastOfMonth(); // false - * Carbon::parse('2019-03-31')->isLastOfMonth(); // true - * Carbon::parse('2019-04-30')->isLastOfMonth(); // true - * ``` - * - * @return bool - */ - public function isLastOfMonth(); - - /** - * Determines if the instance is a leap year. - * - * @example - * ``` - * Carbon::parse('2020-01-01')->isLeapYear(); // true - * Carbon::parse('2019-01-01')->isLeapYear(); // false - * ``` - * - * @return bool - */ - public function isLeapYear(); - - /** - * Determines if the instance is a long year - * - * @example - * ``` - * Carbon::parse('2015-01-01')->isLongYear(); // true - * Carbon::parse('2016-01-01')->isLongYear(); // false - * ``` - * - * @see https://en.wikipedia.org/wiki/ISO_8601#Week_dates - * - * @return bool - */ - public function isLongYear(); - - /** - * Check if the instance is midday. - * - * @example - * ``` - * Carbon::parse('2019-02-28 11:59:59.999999')->isMidday(); // false - * Carbon::parse('2019-02-28 12:00:00')->isMidday(); // true - * Carbon::parse('2019-02-28 12:00:00.999999')->isMidday(); // true - * Carbon::parse('2019-02-28 12:00:01')->isMidday(); // false - * ``` - * - * @return bool - */ - public function isMidday(); - - /** - * Check if the instance is start of day / midnight. - * - * @example - * ``` - * Carbon::parse('2019-02-28 00:00:00')->isMidnight(); // true - * Carbon::parse('2019-02-28 00:00:00.999999')->isMidnight(); // true - * Carbon::parse('2019-02-28 00:00:01')->isMidnight(); // false - * ``` - * - * @return bool - */ - public function isMidnight(); - - /** - * Returns true if a property can be changed via setter. - * - * @param string $unit - * - * @return bool - */ - public static function isModifiableUnit($unit); - - /** - * Returns true if the current class/instance is mutable. - * - * @return bool - */ - public static function isMutable(); - - /** - * Determines if the instance is in the past, ie. less (before) than now. - * - * @example - * ``` - * Carbon::now()->subHours(5)->isPast(); // true - * Carbon::now()->addHours(5)->isPast(); // false - * ``` - * - * @return bool - */ - public function isPast(); - - /** - * Compares the formatted values of the two dates. - * - * @example - * ``` - * Carbon::parse('2019-06-13')->isSameAs('Y-d', Carbon::parse('2019-12-13')); // true - * Carbon::parse('2019-06-13')->isSameAs('Y-d', Carbon::parse('2019-06-14')); // false - * ``` - * - * @param string $format date formats to compare. - * @param \Carbon\Carbon|\DateTimeInterface|string|null $date instance to compare with or null to use current day. - * - * @return bool - */ - public function isSameAs($format, $date = null); - - /** - * Checks if the passed in date is in the same month as the instance´s month. - * - * @example - * ``` - * Carbon::parse('2019-01-12')->isSameMonth(Carbon::parse('2019-01-01')); // true - * Carbon::parse('2019-01-12')->isSameMonth(Carbon::parse('2019-02-01')); // false - * Carbon::parse('2019-01-12')->isSameMonth(Carbon::parse('2018-01-01')); // false - * Carbon::parse('2019-01-12')->isSameMonth(Carbon::parse('2018-01-01'), false); // true - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|null $date The instance to compare with or null to use the current date. - * @param bool $ofSameYear Check if it is the same month in the same year. - * - * @return bool - */ - public function isSameMonth($date = null, $ofSameYear = true); - - /** - * Checks if the passed in date is in the same quarter as the instance quarter (and year if needed). - * - * @example - * ``` - * Carbon::parse('2019-01-12')->isSameQuarter(Carbon::parse('2019-03-01')); // true - * Carbon::parse('2019-01-12')->isSameQuarter(Carbon::parse('2019-04-01')); // false - * Carbon::parse('2019-01-12')->isSameQuarter(Carbon::parse('2018-03-01')); // false - * Carbon::parse('2019-01-12')->isSameQuarter(Carbon::parse('2018-03-01'), false); // true - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|string|null $date The instance to compare with or null to use current day. - * @param bool $ofSameYear Check if it is the same month in the same year. - * - * @return bool - */ - public function isSameQuarter($date = null, $ofSameYear = true); - - /** - * Determines if the instance is in the current unit given. - * - * @example - * ``` - * Carbon::parse('2019-01-13')->isSameUnit('year', Carbon::parse('2019-12-25')); // true - * Carbon::parse('2018-12-13')->isSameUnit('year', Carbon::parse('2019-12-25')); // false - * ``` - * - * @param string $unit singular unit string - * @param \Carbon\Carbon|\DateTimeInterface|null $date instance to compare with or null to use current day. - * - * @throws BadComparisonUnitException - * - * @return bool - */ - public function isSameUnit($unit, $date = null); - - /** - * Check if the instance is start of day / midnight. - * - * @example - * ``` - * Carbon::parse('2019-02-28 00:00:00')->isStartOfDay(); // true - * Carbon::parse('2019-02-28 00:00:00.999999')->isStartOfDay(); // true - * Carbon::parse('2019-02-28 00:00:01')->isStartOfDay(); // false - * Carbon::parse('2019-02-28 00:00:00.000000')->isStartOfDay(true); // true - * Carbon::parse('2019-02-28 00:00:00.000012')->isStartOfDay(true); // false - * ``` - * - * @param bool $checkMicroseconds check time at microseconds precision - * - * @return bool - */ - public function isStartOfDay($checkMicroseconds = false); - - /** - * Returns true if the date was created using CarbonImmutable::startOfTime() - * - * @return bool - */ - public function isStartOfTime(): bool; - - /** - * Returns true if the strict mode is globally in use, false else. - * (It can be overridden in specific instances.) - * - * @return bool - */ - public static function isStrictModeEnabled(); - - /** - * Determines if the instance is today. - * - * @example - * ``` - * Carbon::today()->isToday(); // true - * Carbon::tomorrow()->isToday(); // false - * ``` - * - * @return bool - */ - public function isToday(); - - /** - * Determines if the instance is tomorrow. - * - * @example - * ``` - * Carbon::tomorrow()->isTomorrow(); // true - * Carbon::yesterday()->isTomorrow(); // false - * ``` - * - * @return bool - */ - public function isTomorrow(); - - /** - * Determines if the instance is a weekday. - * - * @example - * ``` - * Carbon::parse('2019-07-14')->isWeekday(); // false - * Carbon::parse('2019-07-15')->isWeekday(); // true - * ``` - * - * @return bool - */ - public function isWeekday(); - - /** - * Determines if the instance is a weekend day. - * - * @example - * ``` - * Carbon::parse('2019-07-14')->isWeekend(); // true - * Carbon::parse('2019-07-15')->isWeekend(); // false - * ``` - * - * @return bool - */ - public function isWeekend(); - - /** - * Determines if the instance is yesterday. - * - * @example - * ``` - * Carbon::yesterday()->isYesterday(); // true - * Carbon::tomorrow()->isYesterday(); // false - * ``` - * - * @return bool - */ - public function isYesterday(); - - /** - * Format in the current language using ISO replacement patterns. - * - * @param string $format - * @param string|null $originalFormat provide context if a chunk has been passed alone - * - * @return string - */ - public function isoFormat(string $format, ?string $originalFormat = null): string; - - /** - * Get/set the week number using given first day of week and first - * day of year included in the first week. Or use ISO format if no settings - * given. - * - * @param int|null $week - * @param int|null $dayOfWeek - * @param int|null $dayOfYear - * - * @return int|static - */ - public function isoWeek($week = null, $dayOfWeek = null, $dayOfYear = null); - - /** - * Set/get the week number of year using given first day of week and first - * day of year included in the first week. Or use ISO format if no settings - * given. - * - * @param int|null $year if null, act as a getter, if not null, set the year and return current instance. - * @param int|null $dayOfWeek first date of week from 0 (Sunday) to 6 (Saturday) - * @param int|null $dayOfYear first day of year included in the week #1 - * - * @return int|static - */ - public function isoWeekYear($year = null, $dayOfWeek = null, $dayOfYear = null); - - /** - * Get/set the ISO weekday from 1 (Monday) to 7 (Sunday). - * - * @param int|null $value new value for weekday if using as setter. - * - * @return static|int - */ - public function isoWeekday($value = null); - - /** - * Get the number of weeks of the current week-year using given first day of week and first - * day of year included in the first week. Or use ISO format if no settings - * given. - * - * @param int|null $dayOfWeek first date of week from 0 (Sunday) to 6 (Saturday) - * @param int|null $dayOfYear first day of year included in the week #1 - * - * @return int - */ - public function isoWeeksInYear($dayOfWeek = null, $dayOfYear = null); - - /** - * Prepare the object for JSON serialization. - * - * @return array|string - */ - #[ReturnTypeWillChange] - public function jsonSerialize(); - - /** - * Modify to the last occurrence of a given day of the week - * in the current month. If no dayOfWeek is provided, modify to the - * last day of the current month. Use the supplied constants - * to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int|null $dayOfWeek - * - * @return static - */ - public function lastOfMonth($dayOfWeek = null); - - /** - * Modify to the last occurrence of a given day of the week - * in the current quarter. If no dayOfWeek is provided, modify to the - * last day of the current quarter. Use the supplied constants - * to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int|null $dayOfWeek day of the week default null - * - * @return static - */ - public function lastOfQuarter($dayOfWeek = null); - - /** - * Modify to the last occurrence of a given day of the week - * in the current year. If no dayOfWeek is provided, modify to the - * last day of the current year. Use the supplied constants - * to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int|null $dayOfWeek day of the week default null - * - * @return static - */ - public function lastOfYear($dayOfWeek = null); - - /** - * Determines if the instance is less (before) than another - * - * @example - * ``` - * Carbon::parse('2018-07-25 12:45:16')->lessThan('2018-07-25 12:45:15'); // false - * Carbon::parse('2018-07-25 12:45:16')->lessThan('2018-07-25 12:45:16'); // false - * Carbon::parse('2018-07-25 12:45:16')->lessThan('2018-07-25 12:45:17'); // true - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @return bool - */ - public function lessThan($date): bool; - - /** - * Determines if the instance is less (before) or equal to another - * - * @example - * ``` - * Carbon::parse('2018-07-25 12:45:16')->lessThanOrEqualTo('2018-07-25 12:45:15'); // false - * Carbon::parse('2018-07-25 12:45:16')->lessThanOrEqualTo('2018-07-25 12:45:16'); // true - * Carbon::parse('2018-07-25 12:45:16')->lessThanOrEqualTo('2018-07-25 12:45:17'); // true - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @return bool - */ - public function lessThanOrEqualTo($date): bool; - - /** - * Get/set the locale for the current instance. - * - * @param string|null $locale - * @param string ...$fallbackLocales - * - * @return $this|string - */ - public function locale(?string $locale = null, ...$fallbackLocales); - - /** - * Returns true if the given locale is internally supported and has words for 1-day diff (just now, yesterday, tomorrow). - * Support is considered enabled if the 3 words are translated in the given locale. - * - * @param string $locale locale ex. en - * - * @return bool - */ - public static function localeHasDiffOneDayWords($locale); - - /** - * Returns true if the given locale is internally supported and has diff syntax support (ago, from now, before, after). - * Support is considered enabled if the 4 sentences are translated in the given locale. - * - * @param string $locale locale ex. en - * - * @return bool - */ - public static function localeHasDiffSyntax($locale); - - /** - * Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after tomorrow). - * Support is considered enabled if the 2 words are translated in the given locale. - * - * @param string $locale locale ex. en - * - * @return bool - */ - public static function localeHasDiffTwoDayWords($locale); - - /** - * Returns true if the given locale is internally supported and has period syntax support (X times, every X, from X, to X). - * Support is considered enabled if the 4 sentences are translated in the given locale. - * - * @param string $locale locale ex. en - * - * @return bool - */ - public static function localeHasPeriodSyntax($locale); - - /** - * Returns true if the given locale is internally supported and has short-units support. - * Support is considered enabled if either year, day or hour has a short variant translated. - * - * @param string $locale locale ex. en - * - * @return bool - */ - public static function localeHasShortUnits($locale); - - /** - * Determines if the instance is less (before) than another - * - * @example - * ``` - * Carbon::parse('2018-07-25 12:45:16')->lt('2018-07-25 12:45:15'); // false - * Carbon::parse('2018-07-25 12:45:16')->lt('2018-07-25 12:45:16'); // false - * Carbon::parse('2018-07-25 12:45:16')->lt('2018-07-25 12:45:17'); // true - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @see lessThan() - * - * @return bool - */ - public function lt($date): bool; - - /** - * Determines if the instance is less (before) or equal to another - * - * @example - * ``` - * Carbon::parse('2018-07-25 12:45:16')->lte('2018-07-25 12:45:15'); // false - * Carbon::parse('2018-07-25 12:45:16')->lte('2018-07-25 12:45:16'); // true - * Carbon::parse('2018-07-25 12:45:16')->lte('2018-07-25 12:45:17'); // true - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @see lessThanOrEqualTo() - * - * @return bool - */ - public function lte($date): bool; - - /** - * Register a custom macro. - * - * @example - * ``` - * $userSettings = [ - * 'locale' => 'pt', - * 'timezone' => 'America/Sao_Paulo', - * ]; - * Carbon::macro('userFormat', function () use ($userSettings) { - * return $this->copy()->locale($userSettings['locale'])->tz($userSettings['timezone'])->calendar(); - * }); - * echo Carbon::yesterday()->hours(11)->userFormat(); - * ``` - * - * @param string $name - * @param object|callable $macro - * - * @return void - */ - public static function macro($name, $macro); - - /** - * Make a Carbon instance from given variable if possible. - * - * Always return a new instance. Parse only strings and only these likely to be dates (skip intervals - * and recurrences). Throw an exception for invalid format, but otherwise return null. - * - * @param mixed $var - * - * @throws InvalidFormatException - * - * @return static|null - */ - public static function make($var); - - /** - * Get the maximum instance between a given instance (default now) and the current instance. - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @return static - */ - public function max($date = null); - - /** - * Create a Carbon instance for the greatest supported date. - * - * @return static - */ - public static function maxValue(); - - /** - * Get the maximum instance between a given instance (default now) and the current instance. - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @see max() - * - * @return static - */ - public function maximum($date = null); - - /** - * Return the meridiem of the current time in the current locale. - * - * @param bool $isLower if true, returns lowercase variant if available in the current locale. - * - * @return string - */ - public function meridiem(bool $isLower = false): string; - - /** - * Modify to midday, default to self::$midDayAt - * - * @return static - */ - public function midDay(); - - /** - * Get the minimum instance between a given instance (default now) and the current instance. - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @return static - */ - public function min($date = null); - - /** - * Create a Carbon instance for the lowest supported date. - * - * @return static - */ - public static function minValue(); - - /** - * Get the minimum instance between a given instance (default now) and the current instance. - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @see min() - * - * @return static - */ - public function minimum($date = null); - - /** - * Mix another object into the class. - * - * @example - * ``` - * Carbon::mixin(new class { - * public function addMoon() { - * return function () { - * return $this->addDays(30); - * }; - * } - * public function subMoon() { - * return function () { - * return $this->subDays(30); - * }; - * } - * }); - * $fullMoon = Carbon::create('2018-12-22'); - * $nextFullMoon = $fullMoon->addMoon(); - * $blackMoon = Carbon::create('2019-01-06'); - * $previousBlackMoon = $blackMoon->subMoon(); - * echo "$nextFullMoon\n"; - * echo "$previousBlackMoon\n"; - * ``` - * - * @param object|string $mixin - * - * @throws ReflectionException - * - * @return void - */ - public static function mixin($mixin); - - /** - * Calls \DateTime::modify if mutable or \DateTimeImmutable::modify else. - * - * @see https://php.net/manual/en/datetime.modify.php - * - * @return static|false - */ - #[ReturnTypeWillChange] - public function modify($modify); - - /** - * Determines if the instance is not equal to another - * - * @example - * ``` - * Carbon::parse('2018-07-25 12:45:16')->ne('2018-07-25 12:45:16'); // false - * Carbon::parse('2018-07-25 12:45:16')->ne(Carbon::parse('2018-07-25 12:45:16')); // false - * Carbon::parse('2018-07-25 12:45:16')->ne('2018-07-25 12:45:17'); // true - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @see notEqualTo() - * - * @return bool - */ - public function ne($date): bool; - - /** - * Modify to the next occurrence of a given modifier such as a day of - * the week. If no modifier is provided, modify to the next occurrence - * of the current day of the week. Use the supplied constants - * to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param string|int|null $modifier - * - * @return static - */ - public function next($modifier = null); - - /** - * Go forward to the next weekday. - * - * @return static - */ - public function nextWeekday(); - - /** - * Go forward to the next weekend day. - * - * @return static - */ - public function nextWeekendDay(); - - /** - * Determines if the instance is not equal to another - * - * @example - * ``` - * Carbon::parse('2018-07-25 12:45:16')->notEqualTo('2018-07-25 12:45:16'); // false - * Carbon::parse('2018-07-25 12:45:16')->notEqualTo(Carbon::parse('2018-07-25 12:45:16')); // false - * Carbon::parse('2018-07-25 12:45:16')->notEqualTo('2018-07-25 12:45:17'); // true - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @return bool - */ - public function notEqualTo($date): bool; - - /** - * Get a Carbon instance for the current date and time. - * - * @param DateTimeZone|string|null $tz - * - * @return static - */ - public static function now($tz = null); - - /** - * Returns a present instance in the same timezone. - * - * @return static - */ - public function nowWithSameTz(); - - /** - * Modify to the given occurrence of a given day of the week - * in the current month. If the calculated occurrence is outside the scope - * of the current month, then return false and no modifications are made. - * Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int $nth - * @param int $dayOfWeek - * - * @return mixed - */ - public function nthOfMonth($nth, $dayOfWeek); - - /** - * Modify to the given occurrence of a given day of the week - * in the current quarter. If the calculated occurrence is outside the scope - * of the current quarter, then return false and no modifications are made. - * Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int $nth - * @param int $dayOfWeek - * - * @return mixed - */ - public function nthOfQuarter($nth, $dayOfWeek); - - /** - * Modify to the given occurrence of a given day of the week - * in the current year. If the calculated occurrence is outside the scope - * of the current year, then return false and no modifications are made. - * Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int $nth - * @param int $dayOfWeek - * - * @return mixed - */ - public function nthOfYear($nth, $dayOfWeek); - - /** - * Return a property with its ordinal. - * - * @param string $key - * @param string|null $period - * - * @return string - */ - public function ordinal(string $key, ?string $period = null): string; - - /** - * Create a carbon instance from a string. - * - * This is an alias for the constructor that allows better fluent syntax - * as it allows you to do Carbon::parse('Monday next week')->fn() rather - * than (new Carbon('Monday next week'))->fn(). - * - * @param string|DateTimeInterface|null $time - * @param DateTimeZone|string|null $tz - * - * @throws InvalidFormatException - * - * @return static - */ - public static function parse($time = null, $tz = null); - - /** - * Create a carbon instance from a localized string (in French, Japanese, Arabic, etc.). - * - * @param string $time date/time string in the given language (may also contain English). - * @param string|null $locale if locale is null or not specified, current global locale will be - * used instead. - * @param DateTimeZone|string|null $tz optional timezone for the new instance. - * - * @throws InvalidFormatException - * - * @return static - */ - public static function parseFromLocale($time, $locale = null, $tz = null); - - /** - * Returns standardized plural of a given singular/plural unit name (in English). - * - * @param string $unit - * - * @return string - */ - public static function pluralUnit(string $unit): string; - - /** - * Modify to the previous occurrence of a given modifier such as a day of - * the week. If no dayOfWeek is provided, modify to the previous occurrence - * of the current day of the week. Use the supplied constants - * to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param string|int|null $modifier - * - * @return static - */ - public function previous($modifier = null); - - /** - * Go backward to the previous weekday. - * - * @return static - */ - public function previousWeekday(); - - /** - * Go backward to the previous weekend day. - * - * @return static - */ - public function previousWeekendDay(); - - /** - * Create a iterable CarbonPeriod object from current date to a given end date (and optional interval). - * - * @param \DateTimeInterface|Carbon|CarbonImmutable|null $end period end date - * @param int|\DateInterval|string|null $interval period default interval or number of the given $unit - * @param string|null $unit if specified, $interval must be an integer - * - * @return CarbonPeriod - */ - public function range($end = null, $interval = null, $unit = null); - - /** - * Call native PHP DateTime/DateTimeImmutable add() method. - * - * @param DateInterval $interval - * - * @return static - */ - public function rawAdd(DateInterval $interval); - - /** - * Create a Carbon instance from a specific format. - * - * @param string $format Datetime format - * @param string $time - * @param DateTimeZone|string|false|null $tz - * - * @throws InvalidFormatException - * - * @return static|false - */ - public static function rawCreateFromFormat($format, $time, $tz = null); - - /** - * @see https://php.net/manual/en/datetime.format.php - * - * @param string $format - * - * @return string - */ - public function rawFormat($format); - - /** - * Create a carbon instance from a string. - * - * This is an alias for the constructor that allows better fluent syntax - * as it allows you to do Carbon::parse('Monday next week')->fn() rather - * than (new Carbon('Monday next week'))->fn(). - * - * @param string|DateTimeInterface|null $time - * @param DateTimeZone|string|null $tz - * - * @throws InvalidFormatException - * - * @return static - */ - public static function rawParse($time = null, $tz = null); - - /** - * Call native PHP DateTime/DateTimeImmutable sub() method. - * - * @param DateInterval $interval - * - * @return static - */ - public function rawSub(DateInterval $interval); - - /** - * Remove all macros and generic macros. - */ - public static function resetMacros(); - - /** - * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @see settings - * - * Reset the month overflow behavior. - * - * @return void - */ - public static function resetMonthsOverflow(); - - /** - * Reset the format used to the default when type juggling a Carbon instance to a string - * - * @return void - */ - public static function resetToStringFormat(); - - /** - * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @see settings - * - * Reset the month overflow behavior. - * - * @return void - */ - public static function resetYearsOverflow(); - - /** - * Round the current instance second with given precision if specified. - * - * @param float|int|string|\DateInterval|null $precision - * @param string $function - * - * @return CarbonInterface - */ - public function round($precision = 1, $function = 'round'); - - /** - * Round the current instance at the given unit with given precision if specified and the given function. - * - * @param string $unit - * @param float|int $precision - * @param string $function - * - * @return CarbonInterface - */ - public function roundUnit($unit, $precision = 1, $function = 'round'); - - /** - * Round the current instance week. - * - * @param int $weekStartsAt optional start allow you to specify the day of week to use to start the week - * - * @return CarbonInterface - */ - public function roundWeek($weekStartsAt = null); - - /** - * The number of seconds since midnight. - * - * @return int - */ - public function secondsSinceMidnight(); - - /** - * The number of seconds until 23:59:59. - * - * @return int - */ - public function secondsUntilEndOfDay(); - - /** - * Return a serialized string of the instance. - * - * @return string - */ - public function serialize(); - - /** - * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather transform Carbon object before the serialization. - * - * JSON serialize all Carbon instances using the given callback. - * - * @param callable $callback - * - * @return void - */ - public static function serializeUsing($callback); - - /** - * Set a part of the Carbon object - * - * @param string|array $name - * @param string|int|DateTimeZone $value - * - * @throws ImmutableException|UnknownSetterException - * - * @return $this - */ - public function set($name, $value = null); - - /** - * Set the date with gregorian year, month and day numbers. - * - * @see https://php.net/manual/en/datetime.setdate.php - * - * @param int $year - * @param int $month - * @param int $day - * - * @return static - */ - #[ReturnTypeWillChange] - public function setDate($year, $month, $day); - - /** - * Set the year, month, and date for this instance to that of the passed instance. - * - * @param Carbon|DateTimeInterface $date now if null - * - * @return static - */ - public function setDateFrom($date = null); - - /** - * Set the date and time all together. - * - * @param int $year - * @param int $month - * @param int $day - * @param int $hour - * @param int $minute - * @param int $second - * @param int $microseconds - * - * @return static - */ - public function setDateTime($year, $month, $day, $hour, $minute, $second = 0, $microseconds = 0); - - /** - * Set the date and time for this instance to that of the passed instance. - * - * @param Carbon|DateTimeInterface $date - * - * @return static - */ - public function setDateTimeFrom($date = null); - - /** - * Set the fallback locale. - * - * @see https://symfony.com/doc/current/components/translation.html#fallback-locales - * - * @param string $locale - */ - public static function setFallbackLocale($locale); - - /** - * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @see settings - * - * @param int $humanDiffOptions - */ - public static function setHumanDiffOptions($humanDiffOptions); - - /** - * Set a date according to the ISO 8601 standard - using weeks and day offsets rather than specific dates. - * - * @see https://php.net/manual/en/datetime.setisodate.php - * - * @param int $year - * @param int $week - * @param int $day - * - * @return static - */ - #[ReturnTypeWillChange] - public function setISODate($year, $week, $day = 1); - - /** - * Set the translator for the current instance. - * - * @param \Symfony\Component\Translation\TranslatorInterface $translator - * - * @return $this - */ - public function setLocalTranslator(TranslatorInterface $translator); - - /** - * Set the current translator locale and indicate if the source locale file exists. - * Pass 'auto' as locale to use closest language from the current LC_TIME locale. - * - * @param string $locale locale ex. en - * - * @return bool - */ - public static function setLocale($locale); - - /** - * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather consider mid-day is always 12pm, then if you need to test if it's an other - * hour, test it explicitly: - * $date->format('G') == 13 - * or to set explicitly to a given hour: - * $date->setTime(13, 0, 0, 0) - * - * Set midday/noon hour - * - * @param int $hour midday hour - * - * @return void - */ - public static function setMidDayAt($hour); - - /** - * Set a Carbon instance (real or mock) to be returned when a "now" - * instance is created. The provided instance will be returned - * specifically under the following conditions: - * - A call to the static now() method, ex. Carbon::now() - * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) - * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') - * - When a string containing the desired time is passed to Carbon::parse(). - * - * Note the timezone parameter was left out of the examples above and - * has no affect as the mock value will be returned regardless of its value. - * - * Only the moment is mocked with setTestNow(), the timezone will still be the one passed - * as parameter of date_default_timezone_get() as a fallback (see setTestNowAndTimezone()). - * - * To clear the test instance call this method using the default - * parameter of null. - * - * /!\ Use this method for unit tests only. - * - * @param Closure|static|string|false|null $testNow real or mock Carbon instance - */ - public static function setTestNow($testNow = null); - - /** - * Set a Carbon instance (real or mock) to be returned when a "now" - * instance is created. The provided instance will be returned - * specifically under the following conditions: - * - A call to the static now() method, ex. Carbon::now() - * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) - * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') - * - When a string containing the desired time is passed to Carbon::parse(). - * - * It will also align default timezone (e.g. call date_default_timezone_set()) with - * the second argument or if null, with the timezone of the given date object. - * - * To clear the test instance call this method using the default - * parameter of null. - * - * /!\ Use this method for unit tests only. - * - * @param Closure|static|string|false|null $testNow real or mock Carbon instance - */ - public static function setTestNowAndTimezone($testNow = null, $tz = null); - - /** - * Resets the current time of the DateTime object to a different time. - * - * @see https://php.net/manual/en/datetime.settime.php - * - * @param int $hour - * @param int $minute - * @param int $second - * @param int $microseconds - * - * @return static - */ - #[ReturnTypeWillChange] - public function setTime($hour, $minute, $second = 0, $microseconds = 0); - - /** - * Set the hour, minute, second and microseconds for this instance to that of the passed instance. - * - * @param Carbon|DateTimeInterface $date now if null - * - * @return static - */ - public function setTimeFrom($date = null); - - /** - * Set the time by time string. - * - * @param string $time - * - * @return static - */ - public function setTimeFromTimeString($time); - - /** - * Set the instance's timestamp. - * - * Timestamp input can be given as int, float or a string containing one or more numbers. - * - * @param float|int|string $unixTimestamp - * - * @return static - */ - #[ReturnTypeWillChange] - public function setTimestamp($unixTimestamp); - - /** - * Set the instance's timezone from a string or object. - * - * @param DateTimeZone|string $value - * - * @return static - */ - #[ReturnTypeWillChange] - public function setTimezone($value); - - /** - * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather let Carbon object being casted to string with DEFAULT_TO_STRING_FORMAT, and - * use other method or custom format passed to format() method if you need to dump an other string - * format. - * - * Set the default format used when type juggling a Carbon instance to a string - * - * @param string|Closure|null $format - * - * @return void - */ - public static function setToStringFormat($format); - - /** - * Set the default translator instance to use. - * - * @param \Symfony\Component\Translation\TranslatorInterface $translator - * - * @return void - */ - public static function setTranslator(TranslatorInterface $translator); - - /** - * Set specified unit to new given value. - * - * @param string $unit year, month, day, hour, minute, second or microsecond - * @param int $value new value for given unit - * - * @return static - */ - public function setUnit($unit, $value = null); - - /** - * Set any unit to a new value without overflowing current other unit given. - * - * @param string $valueUnit unit name to modify - * @param int $value new value for the input unit - * @param string $overflowUnit unit name to not overflow - * - * @return static - */ - public function setUnitNoOverflow($valueUnit, $value, $overflowUnit); - - /** - * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use UTF-8 language packages on every machine. - * - * Set if UTF8 will be used for localized date/time. - * - * @param bool $utf8 - */ - public static function setUtf8($utf8); - - /** - * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * Use $weekStartsAt optional parameter instead when using startOfWeek, floorWeek, ceilWeek - * or roundWeek method. You can also use the 'first_day_of_week' locale setting to change the - * start of week according to current locale selected and implicitly the end of week. - * - * Set the last day of week - * - * @param int|string $day week end day (or 'auto' to get the day before the first day of week - * from Carbon::getLocale() culture). - * - * @return void - */ - public static function setWeekEndsAt($day); - - /** - * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * Use $weekEndsAt optional parameter instead when using endOfWeek method. You can also use the - * 'first_day_of_week' locale setting to change the start of week according to current locale - * selected and implicitly the end of week. - * - * Set the first day of week - * - * @param int|string $day week start day (or 'auto' to get the first day of week from Carbon::getLocale() culture). - * - * @return void - */ - public static function setWeekStartsAt($day); - - /** - * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather consider week-end is always saturday and sunday, and if you have some custom - * week-end days to handle, give to those days an other name and create a macro for them: - * - * ``` - * Carbon::macro('isDayOff', function ($date) { - * return $date->isSunday() || $date->isMonday(); - * }); - * Carbon::macro('isNotDayOff', function ($date) { - * return !$date->isDayOff(); - * }); - * if ($someDate->isDayOff()) ... - * if ($someDate->isNotDayOff()) ... - * // Add 5 not-off days - * $count = 5; - * while ($someDate->isDayOff() || ($count-- > 0)) { - * $someDate->addDay(); - * } - * ``` - * - * Set weekend days - * - * @param array $days - * - * @return void - */ - public static function setWeekendDays($days); - - /** - * Set specific options. - * - strictMode: true|false|null - * - monthOverflow: true|false|null - * - yearOverflow: true|false|null - * - humanDiffOptions: int|null - * - toStringFormat: string|Closure|null - * - toJsonFormat: string|Closure|null - * - locale: string|null - * - timezone: \DateTimeZone|string|int|null - * - macros: array|null - * - genericMacros: array|null - * - * @param array $settings - * - * @return $this|static - */ - public function settings(array $settings); - - /** - * Set the instance's timezone from a string or object and add/subtract the offset difference. - * - * @param DateTimeZone|string $value - * - * @return static - */ - public function shiftTimezone($value); - - /** - * Get the month overflow global behavior (can be overridden in specific instances). - * - * @return bool - */ - public static function shouldOverflowMonths(); - - /** - * Get the month overflow global behavior (can be overridden in specific instances). - * - * @return bool - */ - public static function shouldOverflowYears(); - - /** - * @alias diffForHumans - * - * Get the difference in a human readable format in the current locale from current instance to an other - * instance given (or now if null given). - */ - public function since($other = null, $syntax = null, $short = false, $parts = 1, $options = null); - - /** - * Returns standardized singular of a given singular/plural unit name (in English). - * - * @param string $unit - * - * @return string - */ - public static function singularUnit(string $unit): string; - - /** - * Modify to start of current given unit. - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16.334455') - * ->startOf('month') - * ->endOf('week', Carbon::FRIDAY); - * ``` - * - * @param string $unit - * @param array<int, mixed> $params - * - * @return static - */ - public function startOf($unit, ...$params); - - /** - * Resets the date to the first day of the century and the time to 00:00:00 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->startOfCentury(); - * ``` - * - * @return static - */ - public function startOfCentury(); - - /** - * Resets the time to 00:00:00 start of day - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->startOfDay(); - * ``` - * - * @return static - */ - public function startOfDay(); - - /** - * Resets the date to the first day of the decade and the time to 00:00:00 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->startOfDecade(); - * ``` - * - * @return static - */ - public function startOfDecade(); - - /** - * Modify to start of current hour, minutes and seconds become 0 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->startOfHour(); - * ``` - * - * @return static - */ - public function startOfHour(); - - /** - * Resets the date to the first day of the millennium and the time to 00:00:00 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->startOfMillennium(); - * ``` - * - * @return static - */ - public function startOfMillennium(); - - /** - * Modify to start of current minute, seconds become 0 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->startOfMinute(); - * ``` - * - * @return static - */ - public function startOfMinute(); - - /** - * Resets the date to the first day of the month and the time to 00:00:00 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->startOfMonth(); - * ``` - * - * @return static - */ - public function startOfMonth(); - - /** - * Resets the date to the first day of the quarter and the time to 00:00:00 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->startOfQuarter(); - * ``` - * - * @return static - */ - public function startOfQuarter(); - - /** - * Modify to start of current second, microseconds become 0 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16.334455') - * ->startOfSecond() - * ->format('H:i:s.u'); - * ``` - * - * @return static - */ - public function startOfSecond(); - - /** - * Resets the date to the first day of week (defined in $weekStartsAt) and the time to 00:00:00 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->startOfWeek() . "\n"; - * echo Carbon::parse('2018-07-25 12:45:16')->locale('ar')->startOfWeek() . "\n"; - * echo Carbon::parse('2018-07-25 12:45:16')->startOfWeek(Carbon::SUNDAY) . "\n"; - * ``` - * - * @param int $weekStartsAt optional start allow you to specify the day of week to use to start the week - * - * @return static - */ - public function startOfWeek($weekStartsAt = null); - - /** - * Resets the date to the first day of the year and the time to 00:00:00 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->startOfYear(); - * ``` - * - * @return static - */ - public function startOfYear(); - - /** - * Subtract given units or interval to the current instance. - * - * @example $date->sub('hour', 3) - * @example $date->sub(15, 'days') - * @example $date->sub(CarbonInterval::days(4)) - * - * @param string|DateInterval|Closure|CarbonConverterInterface $unit - * @param int $value - * @param bool|null $overflow - * - * @return static - */ - #[ReturnTypeWillChange] - public function sub($unit, $value = 1, $overflow = null); - - public function subRealUnit($unit, $value = 1); - - /** - * Subtract given units to the current instance. - * - * @param string $unit - * @param int $value - * @param bool|null $overflow - * - * @return static - */ - public function subUnit($unit, $value = 1, $overflow = null); - - /** - * Subtract any unit to a new value without overflowing current other unit given. - * - * @param string $valueUnit unit name to modify - * @param int $value amount to subtract to the input unit - * @param string $overflowUnit unit name to not overflow - * - * @return static - */ - public function subUnitNoOverflow($valueUnit, $value, $overflowUnit); - - /** - * Subtract given units or interval to the current instance. - * - * @see sub() - * - * @param string|DateInterval $unit - * @param int $value - * @param bool|null $overflow - * - * @return static - */ - public function subtract($unit, $value = 1, $overflow = null); - - /** - * Get the difference in a human readable format in the current locale from current instance to an other - * instance given (or now if null given). - * - * @return string - */ - public function timespan($other = null, $timezone = null); - - /** - * Set the instance's timestamp. - * - * Timestamp input can be given as int, float or a string containing one or more numbers. - * - * @param float|int|string $unixTimestamp - * - * @return static - */ - public function timestamp($unixTimestamp); - - /** - * @alias setTimezone - * - * @param DateTimeZone|string $value - * - * @return static - */ - public function timezone($value); - - /** - * Get the difference in a human readable format in the current locale from an other - * instance given (or now if null given) to current instance. - * - * When comparing a value in the past to default now: - * 1 hour from now - * 5 months from now - * - * When comparing a value in the future to default now: - * 1 hour ago - * 5 months ago - * - * When comparing a value in the past to another value: - * 1 hour after - * 5 months after - * - * When comparing a value in the future to another value: - * 1 hour before - * 5 months before - * - * @param Carbon|\DateTimeInterface|string|array|null $other if array passed, will be used as parameters array, see $syntax below; - * if null passed, now will be used as comparison reference; - * if any other type, it will be converted to date and used as reference. - * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: - * - 'syntax' entry (see below) - * - 'short' entry (see below) - * - 'parts' entry (see below) - * - 'options' entry (see below) - * - 'join' entry determines how to join multiple parts of the string - * ` - if $join is a string, it's used as a joiner glue - * ` - if $join is a callable/closure, it get the list of string and should return a string - * ` - if $join is an array, the first item will be the default glue, and the second item - * ` will be used instead of the glue for the last item - * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) - * ` - if $join is missing, a space will be used as glue - * - 'other' entry (see above) - * if int passed, it add modifiers: - * Possible values: - * - CarbonInterface::DIFF_ABSOLUTE no modifiers - * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier - * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier - * Default value: CarbonInterface::DIFF_ABSOLUTE - * @param bool $short displays short format of time units - * @param int $parts maximum number of parts to display (default value: 1: single unit) - * @param int $options human diff options - * - * @return string - */ - public function to($other = null, $syntax = null, $short = false, $parts = 1, $options = null); - - /** - * Get default array representation. - * - * @example - * ``` - * var_dump(Carbon::now()->toArray()); - * ``` - * - * @return array - */ - public function toArray(); - - /** - * Format the instance as ATOM - * - * @example - * ``` - * echo Carbon::now()->toAtomString(); - * ``` - * - * @return string - */ - public function toAtomString(); - - /** - * Format the instance as COOKIE - * - * @example - * ``` - * echo Carbon::now()->toCookieString(); - * ``` - * - * @return string - */ - public function toCookieString(); - - /** - * @alias toDateTime - * - * Return native DateTime PHP object matching the current instance. - * - * @example - * ``` - * var_dump(Carbon::now()->toDate()); - * ``` - * - * @return DateTime - */ - public function toDate(); - - /** - * Format the instance as date - * - * @example - * ``` - * echo Carbon::now()->toDateString(); - * ``` - * - * @return string - */ - public function toDateString(); - - /** - * Return native DateTime PHP object matching the current instance. - * - * @example - * ``` - * var_dump(Carbon::now()->toDateTime()); - * ``` - * - * @return DateTime - */ - public function toDateTime(); - - /** - * Return native toDateTimeImmutable PHP object matching the current instance. - * - * @example - * ``` - * var_dump(Carbon::now()->toDateTimeImmutable()); - * ``` - * - * @return DateTimeImmutable - */ - public function toDateTimeImmutable(); - - /** - * Format the instance as date and time T-separated with no timezone - * - * @example - * ``` - * echo Carbon::now()->toDateTimeLocalString(); - * echo "\n"; - * echo Carbon::now()->toDateTimeLocalString('minute'); // You can specify precision among: minute, second, millisecond and microsecond - * ``` - * - * @param string $unitPrecision - * - * @return string - */ - public function toDateTimeLocalString($unitPrecision = 'second'); - - /** - * Format the instance as date and time - * - * @example - * ``` - * echo Carbon::now()->toDateTimeString(); - * ``` - * - * @param string $unitPrecision - * - * @return string - */ - public function toDateTimeString($unitPrecision = 'second'); - - /** - * Format the instance with day, date and time - * - * @example - * ``` - * echo Carbon::now()->toDayDateTimeString(); - * ``` - * - * @return string - */ - public function toDayDateTimeString(); - - /** - * Format the instance as a readable date - * - * @example - * ``` - * echo Carbon::now()->toFormattedDateString(); - * ``` - * - * @return string - */ - public function toFormattedDateString(); - - /** - * Return the ISO-8601 string (ex: 1977-04-22T06:00:00Z, if $keepOffset truthy, offset will be kept: - * 1977-04-22T01:00:00-05:00). - * - * @example - * ``` - * echo Carbon::now('America/Toronto')->toISOString() . "\n"; - * echo Carbon::now('America/Toronto')->toISOString(true) . "\n"; - * ``` - * - * @param bool $keepOffset Pass true to keep the date offset. Else forced to UTC. - * - * @return null|string - */ - public function toISOString($keepOffset = false); - - /** - * Return a immutable copy of the instance. - * - * @return CarbonImmutable - */ - public function toImmutable(); - - /** - * Format the instance as ISO8601 - * - * @example - * ``` - * echo Carbon::now()->toIso8601String(); - * ``` - * - * @return string - */ - public function toIso8601String(); - - /** - * Convert the instance to UTC and return as Zulu ISO8601 - * - * @example - * ``` - * echo Carbon::now()->toIso8601ZuluString(); - * ``` - * - * @param string $unitPrecision - * - * @return string - */ - public function toIso8601ZuluString($unitPrecision = 'second'); - - /** - * Return the ISO-8601 string (ex: 1977-04-22T06:00:00Z) with UTC timezone. - * - * @example - * ``` - * echo Carbon::now('America/Toronto')->toJSON(); - * ``` - * - * @return null|string - */ - public function toJSON(); - - /** - * Return a mutable copy of the instance. - * - * @return Carbon - */ - public function toMutable(); - - /** - * Get the difference in a human readable format in the current locale from an other - * instance given to now - * - * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: - * - 'syntax' entry (see below) - * - 'short' entry (see below) - * - 'parts' entry (see below) - * - 'options' entry (see below) - * - 'join' entry determines how to join multiple parts of the string - * ` - if $join is a string, it's used as a joiner glue - * ` - if $join is a callable/closure, it get the list of string and should return a string - * ` - if $join is an array, the first item will be the default glue, and the second item - * ` will be used instead of the glue for the last item - * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) - * ` - if $join is missing, a space will be used as glue - * if int passed, it add modifiers: - * Possible values: - * - CarbonInterface::DIFF_ABSOLUTE no modifiers - * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier - * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier - * Default value: CarbonInterface::DIFF_ABSOLUTE - * @param bool $short displays short format of time units - * @param int $parts maximum number of parts to display (default value: 1: single part) - * @param int $options human diff options - * - * @return string - */ - public function toNow($syntax = null, $short = false, $parts = 1, $options = null); - - /** - * Get default object representation. - * - * @example - * ``` - * var_dump(Carbon::now()->toObject()); - * ``` - * - * @return object - */ - public function toObject(); - - /** - * Create a iterable CarbonPeriod object from current date to a given end date (and optional interval). - * - * @param \DateTimeInterface|Carbon|CarbonImmutable|int|null $end period end date or recurrences count if int - * @param int|\DateInterval|string|null $interval period default interval or number of the given $unit - * @param string|null $unit if specified, $interval must be an integer - * - * @return CarbonPeriod - */ - public function toPeriod($end = null, $interval = null, $unit = null); - - /** - * Format the instance as RFC1036 - * - * @example - * ``` - * echo Carbon::now()->toRfc1036String(); - * ``` - * - * @return string - */ - public function toRfc1036String(); - - /** - * Format the instance as RFC1123 - * - * @example - * ``` - * echo Carbon::now()->toRfc1123String(); - * ``` - * - * @return string - */ - public function toRfc1123String(); - - /** - * Format the instance as RFC2822 - * - * @example - * ``` - * echo Carbon::now()->toRfc2822String(); - * ``` - * - * @return string - */ - public function toRfc2822String(); - - /** - * Format the instance as RFC3339 - * - * @param bool $extended - * - * @example - * ``` - * echo Carbon::now()->toRfc3339String() . "\n"; - * echo Carbon::now()->toRfc3339String(true) . "\n"; - * ``` - * - * @return string - */ - public function toRfc3339String($extended = false); - - /** - * Format the instance as RFC7231 - * - * @example - * ``` - * echo Carbon::now()->toRfc7231String(); - * ``` - * - * @return string - */ - public function toRfc7231String(); - - /** - * Format the instance as RFC822 - * - * @example - * ``` - * echo Carbon::now()->toRfc822String(); - * ``` - * - * @return string - */ - public function toRfc822String(); - - /** - * Format the instance as RFC850 - * - * @example - * ``` - * echo Carbon::now()->toRfc850String(); - * ``` - * - * @return string - */ - public function toRfc850String(); - - /** - * Format the instance as RSS - * - * @example - * ``` - * echo Carbon::now()->toRssString(); - * ``` - * - * @return string - */ - public function toRssString(); - - /** - * Returns english human readable complete date string. - * - * @example - * ``` - * echo Carbon::now()->toString(); - * ``` - * - * @return string - */ - public function toString(); - - /** - * Format the instance as time - * - * @example - * ``` - * echo Carbon::now()->toTimeString(); - * ``` - * - * @param string $unitPrecision - * - * @return string - */ - public function toTimeString($unitPrecision = 'second'); - - /** - * Format the instance as W3C - * - * @example - * ``` - * echo Carbon::now()->toW3cString(); - * ``` - * - * @return string - */ - public function toW3cString(); - - /** - * Create a Carbon instance for today. - * - * @param DateTimeZone|string|null $tz - * - * @return static - */ - public static function today($tz = null); - - /** - * Create a Carbon instance for tomorrow. - * - * @param DateTimeZone|string|null $tz - * - * @return static - */ - public static function tomorrow($tz = null); - - /** - * Translate using translation string or callback available. - * - * @param string $key - * @param array $parameters - * @param string|int|float|null $number - * @param \Symfony\Component\Translation\TranslatorInterface|null $translator - * @param bool $altNumbers - * - * @return string - */ - public function translate(string $key, array $parameters = [], $number = null, ?TranslatorInterface $translator = null, bool $altNumbers = false): string; - - /** - * Returns the alternative number for a given integer if available in the current locale. - * - * @param int $number - * - * @return string - */ - public function translateNumber(int $number): string; - - /** - * Translate a time string from a locale to an other. - * - * @param string $timeString date/time/duration string to translate (may also contain English) - * @param string|null $from input locale of the $timeString parameter (`Carbon::getLocale()` by default) - * @param string|null $to output locale of the result returned (`"en"` by default) - * @param int $mode specify what to translate with options: - * - self::TRANSLATE_ALL (default) - * - CarbonInterface::TRANSLATE_MONTHS - * - CarbonInterface::TRANSLATE_DAYS - * - CarbonInterface::TRANSLATE_UNITS - * - CarbonInterface::TRANSLATE_MERIDIEM - * You can use pipe to group: CarbonInterface::TRANSLATE_MONTHS | CarbonInterface::TRANSLATE_DAYS - * - * @return string - */ - public static function translateTimeString($timeString, $from = null, $to = null, $mode = self::TRANSLATE_ALL); - - /** - * Translate a time string from the current locale (`$date->locale()`) to an other. - * - * @param string $timeString time string to translate - * @param string|null $to output locale of the result returned ("en" by default) - * - * @return string - */ - public function translateTimeStringTo($timeString, $to = null); - - /** - * Translate using translation string or callback available. - * - * @param \Symfony\Component\Translation\TranslatorInterface $translator - * @param string $key - * @param array $parameters - * @param null $number - * - * @return string - */ - public static function translateWith(TranslatorInterface $translator, string $key, array $parameters = [], $number = null): string; - - /** - * Format as ->format() do (using date replacements patterns from https://php.net/manual/en/function.date.php) - * but translate words whenever possible (months, day names, etc.) using the current locale. - * - * @param string $format - * - * @return string - */ - public function translatedFormat(string $format): string; - - /** - * Set the timezone or returns the timezone name if no arguments passed. - * - * @param DateTimeZone|string $value - * - * @return static|string - */ - public function tz($value = null); - - /** - * @alias getTimestamp - * - * Returns the UNIX timestamp for the current date. - * - * @return int - */ - public function unix(); - - /** - * @alias to - * - * Get the difference in a human readable format in the current locale from an other - * instance given (or now if null given) to current instance. - * - * @param Carbon|\DateTimeInterface|string|array|null $other if array passed, will be used as parameters array, see $syntax below; - * if null passed, now will be used as comparison reference; - * if any other type, it will be converted to date and used as reference. - * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: - * - 'syntax' entry (see below) - * - 'short' entry (see below) - * - 'parts' entry (see below) - * - 'options' entry (see below) - * - 'join' entry determines how to join multiple parts of the string - * ` - if $join is a string, it's used as a joiner glue - * ` - if $join is a callable/closure, it get the list of string and should return a string - * ` - if $join is an array, the first item will be the default glue, and the second item - * ` will be used instead of the glue for the last item - * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) - * ` - if $join is missing, a space will be used as glue - * - 'other' entry (see above) - * if int passed, it add modifiers: - * Possible values: - * - CarbonInterface::DIFF_ABSOLUTE no modifiers - * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier - * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier - * Default value: CarbonInterface::DIFF_ABSOLUTE - * @param bool $short displays short format of time units - * @param int $parts maximum number of parts to display (default value: 1: single unit) - * @param int $options human diff options - * - * @return string - */ - public function until($other = null, $syntax = null, $short = false, $parts = 1, $options = null); - - /** - * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @see settings - * - * Indicates if months should be calculated with overflow. - * - * @param bool $monthsOverflow - * - * @return void - */ - public static function useMonthsOverflow($monthsOverflow = true); - - /** - * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @see settings - * - * Enable the strict mode (or disable with passing false). - * - * @param bool $strictModeEnabled - */ - public static function useStrictMode($strictModeEnabled = true); - - /** - * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @see settings - * - * Indicates if years should be calculated with overflow. - * - * @param bool $yearsOverflow - * - * @return void - */ - public static function useYearsOverflow($yearsOverflow = true); - - /** - * Set the instance's timezone to UTC. - * - * @return static - */ - public function utc(); - - /** - * Returns the minutes offset to UTC if no arguments passed, else set the timezone with given minutes shift passed. - * - * @param int|null $minuteOffset - * - * @return int|static - */ - public function utcOffset(?int $minuteOffset = null); - - /** - * Returns the milliseconds timestamps used amongst other by Date javascript objects. - * - * @return float - */ - public function valueOf(); - - /** - * Get/set the week number using given first day of week and first - * day of year included in the first week. Or use US format if no settings - * given (Sunday / Jan 6). - * - * @param int|null $week - * @param int|null $dayOfWeek - * @param int|null $dayOfYear - * - * @return int|static - */ - public function week($week = null, $dayOfWeek = null, $dayOfYear = null); - - /** - * Set/get the week number of year using given first day of week and first - * day of year included in the first week. Or use US format if no settings - * given (Sunday / Jan 6). - * - * @param int|null $year if null, act as a getter, if not null, set the year and return current instance. - * @param int|null $dayOfWeek first date of week from 0 (Sunday) to 6 (Saturday) - * @param int|null $dayOfYear first day of year included in the week #1 - * - * @return int|static - */ - public function weekYear($year = null, $dayOfWeek = null, $dayOfYear = null); - - /** - * Get/set the weekday from 0 (Sunday) to 6 (Saturday). - * - * @param int|null $value new value for weekday if using as setter. - * - * @return static|int - */ - public function weekday($value = null); - - /** - * Get the number of weeks of the current week-year using given first day of week and first - * day of year included in the first week. Or use US format if no settings - * given (Sunday / Jan 6). - * - * @param int|null $dayOfWeek first date of week from 0 (Sunday) to 6 (Saturday) - * @param int|null $dayOfYear first day of year included in the week #1 - * - * @return int - */ - public function weeksInYear($dayOfWeek = null, $dayOfYear = null); - - /** - * Temporarily sets a static date to be used within the callback. - * Using setTestNow to set the date, executing the callback, then - * clearing the test instance. - * - * /!\ Use this method for unit tests only. - * - * @param Closure|static|string|false|null $testNow real or mock Carbon instance - * @param Closure|null $callback - * - * @return mixed - */ - public static function withTestNow($testNow = null, $callback = null); - - /** - * Create a Carbon instance for yesterday. - * - * @param DateTimeZone|string|null $tz - * - * @return static - */ - public static function yesterday($tz = null); - - // </methods> -} diff --git a/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php b/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php deleted file mode 100644 index 566b4f94..00000000 --- a/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php +++ /dev/null @@ -1,2823 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon; - -use Carbon\Exceptions\BadFluentConstructorException; -use Carbon\Exceptions\BadFluentSetterException; -use Carbon\Exceptions\InvalidCastException; -use Carbon\Exceptions\InvalidIntervalException; -use Carbon\Exceptions\ParseErrorException; -use Carbon\Exceptions\UnitNotConfiguredException; -use Carbon\Exceptions\UnknownGetterException; -use Carbon\Exceptions\UnknownSetterException; -use Carbon\Exceptions\UnknownUnitException; -use Carbon\Traits\IntervalRounding; -use Carbon\Traits\IntervalStep; -use Carbon\Traits\MagicParameter; -use Carbon\Traits\Mixin; -use Carbon\Traits\Options; -use Carbon\Traits\ToStringFormat; -use Closure; -use DateInterval; -use DateTimeInterface; -use DateTimeZone; -use Exception; -use ReflectionException; -use ReturnTypeWillChange; -use Throwable; - -/** - * A simple API extension for DateInterval. - * The implementation provides helpers to handle weeks but only days are saved. - * Weeks are calculated based on the total days of the current instance. - * - * @property int $years Total years of the current interval. - * @property int $months Total months of the current interval. - * @property int $weeks Total weeks of the current interval calculated from the days. - * @property int $dayz Total days of the current interval (weeks * 7 + days). - * @property int $hours Total hours of the current interval. - * @property int $minutes Total minutes of the current interval. - * @property int $seconds Total seconds of the current interval. - * @property int $microseconds Total microseconds of the current interval. - * @property int $milliseconds Total microseconds of the current interval. - * @property int $microExcludeMilli Remaining microseconds without the milliseconds. - * @property int $dayzExcludeWeeks Total days remaining in the final week of the current instance (days % 7). - * @property int $daysExcludeWeeks alias of dayzExcludeWeeks - * @property-read float $totalYears Number of years equivalent to the interval. - * @property-read float $totalMonths Number of months equivalent to the interval. - * @property-read float $totalWeeks Number of weeks equivalent to the interval. - * @property-read float $totalDays Number of days equivalent to the interval. - * @property-read float $totalDayz Alias for totalDays. - * @property-read float $totalHours Number of hours equivalent to the interval. - * @property-read float $totalMinutes Number of minutes equivalent to the interval. - * @property-read float $totalSeconds Number of seconds equivalent to the interval. - * @property-read float $totalMilliseconds Number of milliseconds equivalent to the interval. - * @property-read float $totalMicroseconds Number of microseconds equivalent to the interval. - * @property-read string $locale locale of the current instance - * - * @method static CarbonInterval years($years = 1) Create instance specifying a number of years or modify the number of years if called on an instance. - * @method static CarbonInterval year($years = 1) Alias for years() - * @method static CarbonInterval months($months = 1) Create instance specifying a number of months or modify the number of months if called on an instance. - * @method static CarbonInterval month($months = 1) Alias for months() - * @method static CarbonInterval weeks($weeks = 1) Create instance specifying a number of weeks or modify the number of weeks if called on an instance. - * @method static CarbonInterval week($weeks = 1) Alias for weeks() - * @method static CarbonInterval days($days = 1) Create instance specifying a number of days or modify the number of days if called on an instance. - * @method static CarbonInterval dayz($days = 1) Alias for days() - * @method static CarbonInterval daysExcludeWeeks($days = 1) Create instance specifying a number of days or modify the number of days (keeping the current number of weeks) if called on an instance. - * @method static CarbonInterval dayzExcludeWeeks($days = 1) Alias for daysExcludeWeeks() - * @method static CarbonInterval day($days = 1) Alias for days() - * @method static CarbonInterval hours($hours = 1) Create instance specifying a number of hours or modify the number of hours if called on an instance. - * @method static CarbonInterval hour($hours = 1) Alias for hours() - * @method static CarbonInterval minutes($minutes = 1) Create instance specifying a number of minutes or modify the number of minutes if called on an instance. - * @method static CarbonInterval minute($minutes = 1) Alias for minutes() - * @method static CarbonInterval seconds($seconds = 1) Create instance specifying a number of seconds or modify the number of seconds if called on an instance. - * @method static CarbonInterval second($seconds = 1) Alias for seconds() - * @method static CarbonInterval milliseconds($milliseconds = 1) Create instance specifying a number of milliseconds or modify the number of milliseconds if called on an instance. - * @method static CarbonInterval millisecond($milliseconds = 1) Alias for milliseconds() - * @method static CarbonInterval microseconds($microseconds = 1) Create instance specifying a number of microseconds or modify the number of microseconds if called on an instance. - * @method static CarbonInterval microsecond($microseconds = 1) Alias for microseconds() - * @method $this addYears(int $years) Add given number of years to the current interval - * @method $this subYears(int $years) Subtract given number of years to the current interval - * @method $this addMonths(int $months) Add given number of months to the current interval - * @method $this subMonths(int $months) Subtract given number of months to the current interval - * @method $this addWeeks(int|float $weeks) Add given number of weeks to the current interval - * @method $this subWeeks(int|float $weeks) Subtract given number of weeks to the current interval - * @method $this addDays(int|float $days) Add given number of days to the current interval - * @method $this subDays(int|float $days) Subtract given number of days to the current interval - * @method $this addHours(int|float $hours) Add given number of hours to the current interval - * @method $this subHours(int|float $hours) Subtract given number of hours to the current interval - * @method $this addMinutes(int|float $minutes) Add given number of minutes to the current interval - * @method $this subMinutes(int|float $minutes) Subtract given number of minutes to the current interval - * @method $this addSeconds(int|float $seconds) Add given number of seconds to the current interval - * @method $this subSeconds(int|float $seconds) Subtract given number of seconds to the current interval - * @method $this addMilliseconds(int|float $milliseconds) Add given number of milliseconds to the current interval - * @method $this subMilliseconds(int|float $milliseconds) Subtract given number of milliseconds to the current interval - * @method $this addMicroseconds(int|float $microseconds) Add given number of microseconds to the current interval - * @method $this subMicroseconds(int|float $microseconds) Subtract given number of microseconds to the current interval - * @method $this roundYear(int|float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. - * @method $this roundYears(int|float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. - * @method $this floorYear(int|float $precision = 1) Truncate the current instance year with given precision. - * @method $this floorYears(int|float $precision = 1) Truncate the current instance year with given precision. - * @method $this ceilYear(int|float $precision = 1) Ceil the current instance year with given precision. - * @method $this ceilYears(int|float $precision = 1) Ceil the current instance year with given precision. - * @method $this roundMonth(int|float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. - * @method $this roundMonths(int|float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. - * @method $this floorMonth(int|float $precision = 1) Truncate the current instance month with given precision. - * @method $this floorMonths(int|float $precision = 1) Truncate the current instance month with given precision. - * @method $this ceilMonth(int|float $precision = 1) Ceil the current instance month with given precision. - * @method $this ceilMonths(int|float $precision = 1) Ceil the current instance month with given precision. - * @method $this roundWeek(int|float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. - * @method $this roundWeeks(int|float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. - * @method $this floorWeek(int|float $precision = 1) Truncate the current instance day with given precision. - * @method $this floorWeeks(int|float $precision = 1) Truncate the current instance day with given precision. - * @method $this ceilWeek(int|float $precision = 1) Ceil the current instance day with given precision. - * @method $this ceilWeeks(int|float $precision = 1) Ceil the current instance day with given precision. - * @method $this roundDay(int|float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. - * @method $this roundDays(int|float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. - * @method $this floorDay(int|float $precision = 1) Truncate the current instance day with given precision. - * @method $this floorDays(int|float $precision = 1) Truncate the current instance day with given precision. - * @method $this ceilDay(int|float $precision = 1) Ceil the current instance day with given precision. - * @method $this ceilDays(int|float $precision = 1) Ceil the current instance day with given precision. - * @method $this roundHour(int|float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. - * @method $this roundHours(int|float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. - * @method $this floorHour(int|float $precision = 1) Truncate the current instance hour with given precision. - * @method $this floorHours(int|float $precision = 1) Truncate the current instance hour with given precision. - * @method $this ceilHour(int|float $precision = 1) Ceil the current instance hour with given precision. - * @method $this ceilHours(int|float $precision = 1) Ceil the current instance hour with given precision. - * @method $this roundMinute(int|float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. - * @method $this roundMinutes(int|float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. - * @method $this floorMinute(int|float $precision = 1) Truncate the current instance minute with given precision. - * @method $this floorMinutes(int|float $precision = 1) Truncate the current instance minute with given precision. - * @method $this ceilMinute(int|float $precision = 1) Ceil the current instance minute with given precision. - * @method $this ceilMinutes(int|float $precision = 1) Ceil the current instance minute with given precision. - * @method $this roundSecond(int|float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. - * @method $this roundSeconds(int|float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. - * @method $this floorSecond(int|float $precision = 1) Truncate the current instance second with given precision. - * @method $this floorSeconds(int|float $precision = 1) Truncate the current instance second with given precision. - * @method $this ceilSecond(int|float $precision = 1) Ceil the current instance second with given precision. - * @method $this ceilSeconds(int|float $precision = 1) Ceil the current instance second with given precision. - * @method $this roundMillennium(int|float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. - * @method $this roundMillennia(int|float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. - * @method $this floorMillennium(int|float $precision = 1) Truncate the current instance millennium with given precision. - * @method $this floorMillennia(int|float $precision = 1) Truncate the current instance millennium with given precision. - * @method $this ceilMillennium(int|float $precision = 1) Ceil the current instance millennium with given precision. - * @method $this ceilMillennia(int|float $precision = 1) Ceil the current instance millennium with given precision. - * @method $this roundCentury(int|float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. - * @method $this roundCenturies(int|float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. - * @method $this floorCentury(int|float $precision = 1) Truncate the current instance century with given precision. - * @method $this floorCenturies(int|float $precision = 1) Truncate the current instance century with given precision. - * @method $this ceilCentury(int|float $precision = 1) Ceil the current instance century with given precision. - * @method $this ceilCenturies(int|float $precision = 1) Ceil the current instance century with given precision. - * @method $this roundDecade(int|float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. - * @method $this roundDecades(int|float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. - * @method $this floorDecade(int|float $precision = 1) Truncate the current instance decade with given precision. - * @method $this floorDecades(int|float $precision = 1) Truncate the current instance decade with given precision. - * @method $this ceilDecade(int|float $precision = 1) Ceil the current instance decade with given precision. - * @method $this ceilDecades(int|float $precision = 1) Ceil the current instance decade with given precision. - * @method $this roundQuarter(int|float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. - * @method $this roundQuarters(int|float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. - * @method $this floorQuarter(int|float $precision = 1) Truncate the current instance quarter with given precision. - * @method $this floorQuarters(int|float $precision = 1) Truncate the current instance quarter with given precision. - * @method $this ceilQuarter(int|float $precision = 1) Ceil the current instance quarter with given precision. - * @method $this ceilQuarters(int|float $precision = 1) Ceil the current instance quarter with given precision. - * @method $this roundMillisecond(int|float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. - * @method $this roundMilliseconds(int|float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. - * @method $this floorMillisecond(int|float $precision = 1) Truncate the current instance millisecond with given precision. - * @method $this floorMilliseconds(int|float $precision = 1) Truncate the current instance millisecond with given precision. - * @method $this ceilMillisecond(int|float $precision = 1) Ceil the current instance millisecond with given precision. - * @method $this ceilMilliseconds(int|float $precision = 1) Ceil the current instance millisecond with given precision. - * @method $this roundMicrosecond(int|float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. - * @method $this roundMicroseconds(int|float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. - * @method $this floorMicrosecond(int|float $precision = 1) Truncate the current instance microsecond with given precision. - * @method $this floorMicroseconds(int|float $precision = 1) Truncate the current instance microsecond with given precision. - * @method $this ceilMicrosecond(int|float $precision = 1) Ceil the current instance microsecond with given precision. - * @method $this ceilMicroseconds(int|float $precision = 1) Ceil the current instance microsecond with given precision. - */ -class CarbonInterval extends DateInterval implements CarbonConverterInterface -{ - use IntervalRounding; - use IntervalStep; - use MagicParameter; - use Mixin { - Mixin::mixin as baseMixin; - } - use Options; - use ToStringFormat; - - /** - * Interval spec period designators - */ - public const PERIOD_PREFIX = 'P'; - public const PERIOD_YEARS = 'Y'; - public const PERIOD_MONTHS = 'M'; - public const PERIOD_DAYS = 'D'; - public const PERIOD_TIME_PREFIX = 'T'; - public const PERIOD_HOURS = 'H'; - public const PERIOD_MINUTES = 'M'; - public const PERIOD_SECONDS = 'S'; - - /** - * A translator to ... er ... translate stuff - * - * @var \Symfony\Component\Translation\TranslatorInterface - */ - protected static $translator; - - /** - * @var array|null - */ - protected static $cascadeFactors; - - /** - * @var array - */ - protected static $formats = [ - 'y' => 'y', - 'Y' => 'y', - 'o' => 'y', - 'm' => 'm', - 'n' => 'm', - 'W' => 'weeks', - 'd' => 'd', - 'j' => 'd', - 'z' => 'd', - 'h' => 'h', - 'g' => 'h', - 'H' => 'h', - 'G' => 'h', - 'i' => 'i', - 's' => 's', - 'u' => 'micro', - 'v' => 'milli', - ]; - - /** - * @var array|null - */ - private static $flipCascadeFactors; - - /** - * The registered macros. - * - * @var array - */ - protected static $macros = []; - - /** - * Timezone handler for settings() method. - * - * @var mixed - */ - protected $tzName; - - /** - * Set the instance's timezone from a string or object. - * - * @param \DateTimeZone|string $tzName - * - * @return static - */ - public function setTimezone($tzName) - { - $this->tzName = $tzName; - - return $this; - } - - /** - * @internal - * - * Set the instance's timezone from a string or object and add/subtract the offset difference. - * - * @param \DateTimeZone|string $tzName - * - * @return static - */ - public function shiftTimezone($tzName) - { - $this->tzName = $tzName; - - return $this; - } - - /** - * Mapping of units and factors for cascading. - * - * Should only be modified by changing the factors or referenced constants. - * - * @return array - */ - public static function getCascadeFactors() - { - return static::$cascadeFactors ?: [ - 'milliseconds' => [Carbon::MICROSECONDS_PER_MILLISECOND, 'microseconds'], - 'seconds' => [Carbon::MILLISECONDS_PER_SECOND, 'milliseconds'], - 'minutes' => [Carbon::SECONDS_PER_MINUTE, 'seconds'], - 'hours' => [Carbon::MINUTES_PER_HOUR, 'minutes'], - 'dayz' => [Carbon::HOURS_PER_DAY, 'hours'], - 'weeks' => [Carbon::DAYS_PER_WEEK, 'dayz'], - 'months' => [Carbon::WEEKS_PER_MONTH, 'weeks'], - 'years' => [Carbon::MONTHS_PER_YEAR, 'months'], - ]; - } - - private static function standardizeUnit($unit) - { - $unit = rtrim($unit, 'sz').'s'; - - return $unit === 'days' ? 'dayz' : $unit; - } - - private static function getFlipCascadeFactors() - { - if (!self::$flipCascadeFactors) { - self::$flipCascadeFactors = []; - - foreach (static::getCascadeFactors() as $to => [$factor, $from]) { - self::$flipCascadeFactors[self::standardizeUnit($from)] = [self::standardizeUnit($to), $factor]; - } - } - - return self::$flipCascadeFactors; - } - - /** - * Set default cascading factors for ->cascade() method. - * - * @param array $cascadeFactors - */ - public static function setCascadeFactors(array $cascadeFactors) - { - self::$flipCascadeFactors = null; - static::$cascadeFactors = $cascadeFactors; - } - - /////////////////////////////////////////////////////////////////// - //////////////////////////// CONSTRUCTORS ///////////////////////// - /////////////////////////////////////////////////////////////////// - - /** - * Create a new CarbonInterval instance. - * - * @param Closure|DateInterval|string|int|null $years - * @param int|null $months - * @param int|null $weeks - * @param int|null $days - * @param int|null $hours - * @param int|null $minutes - * @param int|null $seconds - * @param int|null $microseconds - * - * @throws Exception when the interval_spec (passed as $years) cannot be parsed as an interval. - */ - public function __construct($years = 1, $months = null, $weeks = null, $days = null, $hours = null, $minutes = null, $seconds = null, $microseconds = null) - { - if ($years instanceof Closure) { - $this->step = $years; - $years = null; - } - - if ($years instanceof DateInterval) { - parent::__construct(static::getDateIntervalSpec($years)); - $this->f = $years->f; - self::copyNegativeUnits($years, $this); - - return; - } - - $spec = $years; - - if (!\is_string($spec) || (float) $years || preg_match('/^[\d.]/', $years)) { - $spec = static::PERIOD_PREFIX; - - $spec .= $years > 0 ? $years.static::PERIOD_YEARS : ''; - $spec .= $months > 0 ? $months.static::PERIOD_MONTHS : ''; - - $specDays = 0; - $specDays += $weeks > 0 ? $weeks * static::getDaysPerWeek() : 0; - $specDays += $days > 0 ? $days : 0; - - $spec .= $specDays > 0 ? $specDays.static::PERIOD_DAYS : ''; - - if ($hours > 0 || $minutes > 0 || $seconds > 0) { - $spec .= static::PERIOD_TIME_PREFIX; - $spec .= $hours > 0 ? $hours.static::PERIOD_HOURS : ''; - $spec .= $minutes > 0 ? $minutes.static::PERIOD_MINUTES : ''; - $spec .= $seconds > 0 ? $seconds.static::PERIOD_SECONDS : ''; - } - - if ($spec === static::PERIOD_PREFIX) { - // Allow the zero interval. - $spec .= '0'.static::PERIOD_YEARS; - } - } - - parent::__construct($spec); - - if ($microseconds !== null) { - $this->f = $microseconds / Carbon::MICROSECONDS_PER_SECOND; - } - } - - /** - * Returns the factor for a given source-to-target couple. - * - * @param string $source - * @param string $target - * - * @return int|float|null - */ - public static function getFactor($source, $target) - { - $source = self::standardizeUnit($source); - $target = self::standardizeUnit($target); - $factors = self::getFlipCascadeFactors(); - - if (isset($factors[$source])) { - [$to, $factor] = $factors[$source]; - - if ($to === $target) { - return $factor; - } - - return $factor * static::getFactor($to, $target); - } - - return null; - } - - /** - * Returns the factor for a given source-to-target couple if set, - * else try to find the appropriate constant as the factor, such as Carbon::DAYS_PER_WEEK. - * - * @param string $source - * @param string $target - * - * @return int|float|null - */ - public static function getFactorWithDefault($source, $target) - { - $factor = self::getFactor($source, $target); - - if ($factor) { - return $factor; - } - - static $defaults = [ - 'month' => ['year' => Carbon::MONTHS_PER_YEAR], - 'week' => ['month' => Carbon::WEEKS_PER_MONTH], - 'day' => ['week' => Carbon::DAYS_PER_WEEK], - 'hour' => ['day' => Carbon::HOURS_PER_DAY], - 'minute' => ['hour' => Carbon::MINUTES_PER_HOUR], - 'second' => ['minute' => Carbon::SECONDS_PER_MINUTE], - 'millisecond' => ['second' => Carbon::MILLISECONDS_PER_SECOND], - 'microsecond' => ['millisecond' => Carbon::MICROSECONDS_PER_MILLISECOND], - ]; - - return $defaults[$source][$target] ?? null; - } - - /** - * Returns current config for days per week. - * - * @return int|float - */ - public static function getDaysPerWeek() - { - return static::getFactor('dayz', 'weeks') ?: Carbon::DAYS_PER_WEEK; - } - - /** - * Returns current config for hours per day. - * - * @return int|float - */ - public static function getHoursPerDay() - { - return static::getFactor('hours', 'dayz') ?: Carbon::HOURS_PER_DAY; - } - - /** - * Returns current config for minutes per hour. - * - * @return int|float - */ - public static function getMinutesPerHour() - { - return static::getFactor('minutes', 'hours') ?: Carbon::MINUTES_PER_HOUR; - } - - /** - * Returns current config for seconds per minute. - * - * @return int|float - */ - public static function getSecondsPerMinute() - { - return static::getFactor('seconds', 'minutes') ?: Carbon::SECONDS_PER_MINUTE; - } - - /** - * Returns current config for microseconds per second. - * - * @return int|float - */ - public static function getMillisecondsPerSecond() - { - return static::getFactor('milliseconds', 'seconds') ?: Carbon::MILLISECONDS_PER_SECOND; - } - - /** - * Returns current config for microseconds per second. - * - * @return int|float - */ - public static function getMicrosecondsPerMillisecond() - { - return static::getFactor('microseconds', 'milliseconds') ?: Carbon::MICROSECONDS_PER_MILLISECOND; - } - - /** - * Create a new CarbonInterval instance from specific values. - * This is an alias for the constructor that allows better fluent - * syntax as it allows you to do CarbonInterval::create(1)->fn() rather than - * (new CarbonInterval(1))->fn(). - * - * @param int $years - * @param int $months - * @param int $weeks - * @param int $days - * @param int $hours - * @param int $minutes - * @param int $seconds - * @param int $microseconds - * - * @throws Exception when the interval_spec (passed as $years) cannot be parsed as an interval. - * - * @return static - */ - public static function create($years = 1, $months = null, $weeks = null, $days = null, $hours = null, $minutes = null, $seconds = null, $microseconds = null) - { - return new static($years, $months, $weeks, $days, $hours, $minutes, $seconds, $microseconds); - } - - /** - * Parse a string into a new CarbonInterval object according to the specified format. - * - * @example - * ``` - * echo Carboninterval::createFromFormat('H:i', '1:30'); - * ``` - * - * @param string $format Format of the $interval input string - * @param string|null $interval Input string to convert into an interval - * - * @throws \Carbon\Exceptions\ParseErrorException when the $interval cannot be parsed as an interval. - * - * @return static - */ - public static function createFromFormat(string $format, ?string $interval) - { - $instance = new static(0); - $length = mb_strlen($format); - - if (preg_match('/s([,.])([uv])$/', $format, $match)) { - $interval = explode($match[1], $interval); - $index = \count($interval) - 1; - $interval[$index] = str_pad($interval[$index], $match[2] === 'v' ? 3 : 6, '0'); - $interval = implode($match[1], $interval); - } - - $interval = $interval ?? ''; - - for ($index = 0; $index < $length; $index++) { - $expected = mb_substr($format, $index, 1); - $nextCharacter = mb_substr($interval, 0, 1); - $unit = static::$formats[$expected] ?? null; - - if ($unit) { - if (!preg_match('/^-?\d+/', $interval, $match)) { - throw new ParseErrorException('number', $nextCharacter); - } - - $interval = mb_substr($interval, mb_strlen($match[0])); - $instance->$unit += (int) ($match[0]); - - continue; - } - - if ($nextCharacter !== $expected) { - throw new ParseErrorException( - "'$expected'", - $nextCharacter, - 'Allowed substitutes for interval formats are '.implode(', ', array_keys(static::$formats))."\n". - 'See https://php.net/manual/en/function.date.php for their meaning' - ); - } - - $interval = mb_substr($interval, 1); - } - - if ($interval !== '') { - throw new ParseErrorException( - 'end of string', - $interval - ); - } - - return $instance; - } - - /** - * Get a copy of the instance. - * - * @return static - */ - public function copy() - { - $date = new static(0); - $date->copyProperties($this); - $date->step = $this->step; - - return $date; - } - - /** - * Get a copy of the instance. - * - * @return static - */ - public function clone() - { - return $this->copy(); - } - - /** - * Provide static helpers to create instances. Allows CarbonInterval::years(3). - * - * Note: This is done using the magic method to allow static and instance methods to - * have the same names. - * - * @param string $method magic method name called - * @param array $parameters parameters list - * - * @return static|null - */ - public static function __callStatic($method, $parameters) - { - try { - $interval = new static(0); - $localStrictModeEnabled = $interval->localStrictModeEnabled; - $interval->localStrictModeEnabled = true; - - $result = static::hasMacro($method) - ? static::bindMacroContext(null, function () use (&$method, &$parameters, &$interval) { - return $interval->callMacro($method, $parameters); - }) - : $interval->$method(...$parameters); - - $interval->localStrictModeEnabled = $localStrictModeEnabled; - - return $result; - } catch (BadFluentSetterException $exception) { - if (Carbon::isStrictModeEnabled()) { - throw new BadFluentConstructorException($method, 0, $exception); - } - - return null; - } - } - - /** - * Return the current context from inside a macro callee or a new one if static. - * - * @return static - */ - protected static function this() - { - return end(static::$macroContextStack) ?: new static(0); - } - - /** - * Creates a CarbonInterval from string. - * - * Format: - * - * Suffix | Unit | Example | DateInterval expression - * -------|---------|---------|------------------------ - * y | years | 1y | P1Y - * mo | months | 3mo | P3M - * w | weeks | 2w | P2W - * d | days | 28d | P28D - * h | hours | 4h | PT4H - * m | minutes | 12m | PT12M - * s | seconds | 59s | PT59S - * - * e. g. `1w 3d 4h 32m 23s` is converted to 10 days 4 hours 32 minutes and 23 seconds. - * - * Special cases: - * - An empty string will return a zero interval - * - Fractions are allowed for weeks, days, hours and minutes and will be converted - * and rounded to the next smaller value (caution: 0.5w = 4d) - * - * @param string $intervalDefinition - * - * @return static - */ - public static function fromString($intervalDefinition) - { - if (empty($intervalDefinition)) { - return new static(0); - } - - $years = 0; - $months = 0; - $weeks = 0; - $days = 0; - $hours = 0; - $minutes = 0; - $seconds = 0; - $milliseconds = 0; - $microseconds = 0; - - $pattern = '/(\d+(?:\.\d+)?)\h*([^\d\h]*)/i'; - preg_match_all($pattern, $intervalDefinition, $parts, PREG_SET_ORDER); - - while ([$part, $value, $unit] = array_shift($parts)) { - $intValue = (int) $value; - $fraction = (float) $value - $intValue; - - // Fix calculation precision - switch (round($fraction, 6)) { - case 1: - $fraction = 0; - $intValue++; - - break; - case 0: - $fraction = 0; - - break; - } - - switch ($unit === 'µs' ? 'µs' : strtolower($unit)) { - case 'millennia': - case 'millennium': - $years += $intValue * CarbonInterface::YEARS_PER_MILLENNIUM; - - break; - - case 'century': - case 'centuries': - $years += $intValue * CarbonInterface::YEARS_PER_CENTURY; - - break; - - case 'decade': - case 'decades': - $years += $intValue * CarbonInterface::YEARS_PER_DECADE; - - break; - - case 'year': - case 'years': - case 'y': - case 'yr': - case 'yrs': - $years += $intValue; - - break; - - case 'quarter': - case 'quarters': - $months += $intValue * CarbonInterface::MONTHS_PER_QUARTER; - - break; - - case 'month': - case 'months': - case 'mo': - case 'mos': - $months += $intValue; - - break; - - case 'week': - case 'weeks': - case 'w': - $weeks += $intValue; - - if ($fraction) { - $parts[] = [null, $fraction * static::getDaysPerWeek(), 'd']; - } - - break; - - case 'day': - case 'days': - case 'd': - $days += $intValue; - - if ($fraction) { - $parts[] = [null, $fraction * static::getHoursPerDay(), 'h']; - } - - break; - - case 'hour': - case 'hours': - case 'h': - $hours += $intValue; - - if ($fraction) { - $parts[] = [null, $fraction * static::getMinutesPerHour(), 'm']; - } - - break; - - case 'minute': - case 'minutes': - case 'm': - $minutes += $intValue; - - if ($fraction) { - $parts[] = [null, $fraction * static::getSecondsPerMinute(), 's']; - } - - break; - - case 'second': - case 'seconds': - case 's': - $seconds += $intValue; - - if ($fraction) { - $parts[] = [null, $fraction * static::getMillisecondsPerSecond(), 'ms']; - } - - break; - - case 'millisecond': - case 'milliseconds': - case 'milli': - case 'ms': - $milliseconds += $intValue; - - if ($fraction) { - $microseconds += round($fraction * static::getMicrosecondsPerMillisecond()); - } - - break; - - case 'microsecond': - case 'microseconds': - case 'micro': - case 'µs': - $microseconds += $intValue; - - break; - - default: - throw new InvalidIntervalException( - sprintf('Invalid part %s in definition %s', $part, $intervalDefinition) - ); - } - } - - return new static($years, $months, $weeks, $days, $hours, $minutes, $seconds, $milliseconds * Carbon::MICROSECONDS_PER_MILLISECOND + $microseconds); - } - - /** - * Creates a CarbonInterval from string using a different locale. - * - * @param string $interval interval string in the given language (may also contain English). - * @param string|null $locale if locale is null or not specified, current global locale will be used instead. - * - * @return static - */ - public static function parseFromLocale($interval, $locale = null) - { - return static::fromString(Carbon::translateTimeString($interval, $locale ?: static::getLocale(), 'en')); - } - - private static function castIntervalToClass(DateInterval $interval, string $className, array $skip = []) - { - $mainClass = DateInterval::class; - - if (!is_a($className, $mainClass, true)) { - throw new InvalidCastException("$className is not a sub-class of $mainClass."); - } - - $microseconds = $interval->f; - $instance = new $className(static::getDateIntervalSpec($interval, false, $skip)); - - if ($microseconds) { - $instance->f = $microseconds; - } - - if ($interval instanceof self && is_a($className, self::class, true)) { - self::copyStep($interval, $instance); - } - - self::copyNegativeUnits($interval, $instance); - - return $instance; - } - - private static function copyNegativeUnits(DateInterval $from, DateInterval $to): void - { - $to->invert = $from->invert; - - foreach (['y', 'm', 'd', 'h', 'i', 's'] as $unit) { - if ($from->$unit < 0) { - $to->$unit *= -1; - } - } - } - - private static function copyStep(self $from, self $to): void - { - $to->setStep($from->getStep()); - } - - /** - * Cast the current instance into the given class. - * - * @param string $className The $className::instance() method will be called to cast the current object. - * - * @return DateInterval - */ - public function cast(string $className) - { - return self::castIntervalToClass($this, $className); - } - - /** - * Create a CarbonInterval instance from a DateInterval one. Can not instance - * DateInterval objects created from DateTime::diff() as you can't externally - * set the $days field. - * - * @param DateInterval $interval - * - * @return static - */ - public static function instance(DateInterval $interval, array $skip = []) - { - return self::castIntervalToClass($interval, static::class, $skip); - } - - /** - * Make a CarbonInterval instance from given variable if possible. - * - * Always return a new instance. Parse only strings and only these likely to be intervals (skip dates - * and recurrences). Throw an exception for invalid format, but otherwise return null. - * - * @param mixed|int|DateInterval|string|Closure|null $interval interval or number of the given $unit - * @param string|null $unit if specified, $interval must be an integer - * - * @return static|null - */ - public static function make($interval, $unit = null) - { - if ($unit) { - $interval = "$interval ".Carbon::pluralUnit($unit); - } - - if ($interval instanceof DateInterval) { - return static::instance($interval); - } - - if ($interval instanceof Closure) { - return new static($interval); - } - - if (!\is_string($interval)) { - return null; - } - - return static::makeFromString($interval); - } - - protected static function makeFromString(string $interval) - { - $interval = preg_replace('/\s+/', ' ', trim($interval)); - - if (preg_match('/^P[T\d]/', $interval)) { - return new static($interval); - } - - if (preg_match('/^(?:\h*\d+(?:\.\d+)?\h*[a-z]+)+$/i', $interval)) { - return static::fromString($interval); - } - - /** @var static $interval */ - $interval = static::createFromDateString($interval); - - return !$interval || $interval->isEmpty() ? null : $interval; - } - - protected function resolveInterval($interval) - { - if (!($interval instanceof self)) { - return self::make($interval); - } - - return $interval; - } - - /** - * Sets up a DateInterval from the relative parts of the string. - * - * @param string $time - * - * @return static - * - * @link https://php.net/manual/en/dateinterval.createfromdatestring.php - */ - #[ReturnTypeWillChange] - public static function createFromDateString($time) - { - $interval = @parent::createFromDateString(strtr($time, [ - ',' => ' ', - ' and ' => ' ', - ])); - - if ($interval instanceof DateInterval) { - $interval = static::instance($interval); - } - - return $interval; - } - - /////////////////////////////////////////////////////////////////// - ///////////////////////// GETTERS AND SETTERS ///////////////////// - /////////////////////////////////////////////////////////////////// - - /** - * Get a part of the CarbonInterval object. - * - * @param string $name - * - * @throws UnknownGetterException - * - * @return int|float|string - */ - public function get($name) - { - if (str_starts_with($name, 'total')) { - return $this->total(substr($name, 5)); - } - - switch ($name) { - case 'years': - return $this->y; - - case 'months': - return $this->m; - - case 'dayz': - return $this->d; - - case 'hours': - return $this->h; - - case 'minutes': - return $this->i; - - case 'seconds': - return $this->s; - - case 'milli': - case 'milliseconds': - return (int) (round($this->f * Carbon::MICROSECONDS_PER_SECOND) / Carbon::MICROSECONDS_PER_MILLISECOND); - - case 'micro': - case 'microseconds': - return (int) round($this->f * Carbon::MICROSECONDS_PER_SECOND); - - case 'microExcludeMilli': - return (int) round($this->f * Carbon::MICROSECONDS_PER_SECOND) % Carbon::MICROSECONDS_PER_MILLISECOND; - - case 'weeks': - return (int) ($this->d / (int) static::getDaysPerWeek()); - - case 'daysExcludeWeeks': - case 'dayzExcludeWeeks': - return $this->d % (int) static::getDaysPerWeek(); - - case 'locale': - return $this->getTranslatorLocale(); - - default: - throw new UnknownGetterException($name); - } - } - - /** - * Get a part of the CarbonInterval object. - * - * @param string $name - * - * @throws UnknownGetterException - * - * @return int|float|string - */ - public function __get($name) - { - return $this->get($name); - } - - /** - * Set a part of the CarbonInterval object. - * - * @param string|array $name - * @param int $value - * - * @throws UnknownSetterException - * - * @return $this - */ - public function set($name, $value = null) - { - $properties = \is_array($name) ? $name : [$name => $value]; - - foreach ($properties as $key => $value) { - switch (Carbon::singularUnit(rtrim($key, 'z'))) { - case 'year': - $this->y = $value; - - break; - - case 'month': - $this->m = $value; - - break; - - case 'week': - $this->d = $value * (int) static::getDaysPerWeek(); - - break; - - case 'day': - $this->d = $value; - - break; - - case 'daysexcludeweek': - case 'dayzexcludeweek': - $this->d = $this->weeks * (int) static::getDaysPerWeek() + $value; - - break; - - case 'hour': - $this->h = $value; - - break; - - case 'minute': - $this->i = $value; - - break; - - case 'second': - $this->s = $value; - - break; - - case 'milli': - case 'millisecond': - $this->microseconds = $value * Carbon::MICROSECONDS_PER_MILLISECOND + $this->microseconds % Carbon::MICROSECONDS_PER_MILLISECOND; - - break; - - case 'micro': - case 'microsecond': - $this->f = $value / Carbon::MICROSECONDS_PER_SECOND; - - break; - - default: - if ($this->localStrictModeEnabled ?? Carbon::isStrictModeEnabled()) { - throw new UnknownSetterException($key); - } - - $this->$key = $value; - } - } - - return $this; - } - - /** - * Set a part of the CarbonInterval object. - * - * @param string $name - * @param int $value - * - * @throws UnknownSetterException - */ - public function __set($name, $value) - { - $this->set($name, $value); - } - - /** - * Allow setting of weeks and days to be cumulative. - * - * @param int $weeks Number of weeks to set - * @param int $days Number of days to set - * - * @return static - */ - public function weeksAndDays($weeks, $days) - { - $this->dayz = ($weeks * static::getDaysPerWeek()) + $days; - - return $this; - } - - /** - * Returns true if the interval is empty for each unit. - * - * @return bool - */ - public function isEmpty() - { - return $this->years === 0 && - $this->months === 0 && - $this->dayz === 0 && - !$this->days && - $this->hours === 0 && - $this->minutes === 0 && - $this->seconds === 0 && - $this->microseconds === 0; - } - - /** - * Register a custom macro. - * - * @example - * ``` - * CarbonInterval::macro('twice', function () { - * return $this->times(2); - * }); - * echo CarbonInterval::hours(2)->twice(); - * ``` - * - * @param string $name - * @param object|callable $macro - * - * @return void - */ - public static function macro($name, $macro) - { - static::$macros[$name] = $macro; - } - - /** - * Register macros from a mixin object. - * - * @example - * ``` - * CarbonInterval::mixin(new class { - * public function daysToHours() { - * return function () { - * $this->hours += $this->days; - * $this->days = 0; - * - * return $this; - * }; - * } - * public function hoursToDays() { - * return function () { - * $this->days += $this->hours; - * $this->hours = 0; - * - * return $this; - * }; - * } - * }); - * echo CarbonInterval::hours(5)->hoursToDays() . "\n"; - * echo CarbonInterval::days(5)->daysToHours() . "\n"; - * ``` - * - * @param object|string $mixin - * - * @throws ReflectionException - * - * @return void - */ - public static function mixin($mixin) - { - static::baseMixin($mixin); - } - - /** - * Check if macro is registered. - * - * @param string $name - * - * @return bool - */ - public static function hasMacro($name) - { - return isset(static::$macros[$name]); - } - - /** - * Call given macro. - * - * @param string $name - * @param array $parameters - * - * @return mixed - */ - protected function callMacro($name, $parameters) - { - $macro = static::$macros[$name]; - - if ($macro instanceof Closure) { - $boundMacro = @$macro->bindTo($this, static::class) ?: @$macro->bindTo(null, static::class); - - return ($boundMacro ?: $macro)(...$parameters); - } - - return $macro(...$parameters); - } - - /** - * Allow fluent calls on the setters... CarbonInterval::years(3)->months(5)->day(). - * - * Note: This is done using the magic method to allow static and instance methods to - * have the same names. - * - * @param string $method magic method name called - * @param array $parameters parameters list - * - * @throws BadFluentSetterException|Throwable - * - * @return static - */ - public function __call($method, $parameters) - { - if (static::hasMacro($method)) { - return static::bindMacroContext($this, function () use (&$method, &$parameters) { - return $this->callMacro($method, $parameters); - }); - } - - $roundedValue = $this->callRoundMethod($method, $parameters); - - if ($roundedValue !== null) { - return $roundedValue; - } - - if (preg_match('/^(?<method>add|sub)(?<unit>[A-Z].*)$/', $method, $match)) { - $value = $this->getMagicParameter($parameters, 0, Carbon::pluralUnit($match['unit']), 0); - - return $this->{$match['method']}($value, $match['unit']); - } - - $value = $this->getMagicParameter($parameters, 0, Carbon::pluralUnit($method), 1); - - try { - $this->set($method, $value); - } catch (UnknownSetterException $exception) { - if ($this->localStrictModeEnabled ?? Carbon::isStrictModeEnabled()) { - throw new BadFluentSetterException($method, 0, $exception); - } - } - - return $this; - } - - protected function getForHumansInitialVariables($syntax, $short) - { - if (\is_array($syntax)) { - return $syntax; - } - - if (\is_int($short)) { - return [ - 'parts' => $short, - 'short' => false, - ]; - } - - if (\is_bool($syntax)) { - return [ - 'short' => $syntax, - 'syntax' => CarbonInterface::DIFF_ABSOLUTE, - ]; - } - - return []; - } - - /** - * @param mixed $syntax - * @param mixed $short - * @param mixed $parts - * @param mixed $options - * - * @return array - */ - protected function getForHumansParameters($syntax = null, $short = false, $parts = -1, $options = null) - { - $optionalSpace = ' '; - $default = $this->getTranslationMessage('list.0') ?? $this->getTranslationMessage('list') ?? ' '; - $join = $default === '' ? '' : ' '; - $altNumbers = false; - $aUnit = false; - $minimumUnit = 's'; - $skip = []; - extract($this->getForHumansInitialVariables($syntax, $short)); - $skip = array_map('strtolower', array_filter((array) $skip, static function ($value) { - return \is_string($value) && $value !== ''; - })); - - if ($syntax === null) { - $syntax = CarbonInterface::DIFF_ABSOLUTE; - } - - if ($parts === -1) { - $parts = INF; - } - - if ($options === null) { - $options = static::getHumanDiffOptions(); - } - - if ($join === false) { - $join = ' '; - } elseif ($join === true) { - $join = [ - $default, - $this->getTranslationMessage('list.1') ?? $default, - ]; - } - - if ($altNumbers && $altNumbers !== true) { - $language = new Language($this->locale); - $altNumbers = \in_array($language->getCode(), (array) $altNumbers, true); - } - - if (\is_array($join)) { - [$default, $last] = $join; - - if ($default !== ' ') { - $optionalSpace = ''; - } - - $join = function ($list) use ($default, $last) { - if (\count($list) < 2) { - return implode('', $list); - } - - $end = array_pop($list); - - return implode($default, $list).$last.$end; - }; - } - - if (\is_string($join)) { - if ($join !== ' ') { - $optionalSpace = ''; - } - - $glue = $join; - $join = function ($list) use ($glue) { - return implode($glue, $list); - }; - } - - $interpolations = [ - ':optional-space' => $optionalSpace, - ]; - - return [$syntax, $short, $parts, $options, $join, $aUnit, $altNumbers, $interpolations, $minimumUnit, $skip]; - } - - protected static function getRoundingMethodFromOptions(int $options): ?string - { - if ($options & CarbonInterface::ROUND) { - return 'round'; - } - - if ($options & CarbonInterface::CEIL) { - return 'ceil'; - } - - if ($options & CarbonInterface::FLOOR) { - return 'floor'; - } - - return null; - } - - /** - * Returns interval values as an array where key are the unit names and values the counts. - * - * @return int[] - */ - public function toArray() - { - return [ - 'years' => $this->years, - 'months' => $this->months, - 'weeks' => $this->weeks, - 'days' => $this->daysExcludeWeeks, - 'hours' => $this->hours, - 'minutes' => $this->minutes, - 'seconds' => $this->seconds, - 'microseconds' => $this->microseconds, - ]; - } - - /** - * Returns interval non-zero values as an array where key are the unit names and values the counts. - * - * @return int[] - */ - public function getNonZeroValues() - { - return array_filter($this->toArray(), 'intval'); - } - - /** - * Returns interval values as an array where key are the unit names and values the counts - * from the biggest non-zero one the the smallest non-zero one. - * - * @return int[] - */ - public function getValuesSequence() - { - $nonZeroValues = $this->getNonZeroValues(); - - if ($nonZeroValues === []) { - return []; - } - - $keys = array_keys($nonZeroValues); - $firstKey = $keys[0]; - $lastKey = $keys[\count($keys) - 1]; - $values = []; - $record = false; - - foreach ($this->toArray() as $unit => $count) { - if ($unit === $firstKey) { - $record = true; - } - - if ($record) { - $values[$unit] = $count; - } - - if ($unit === $lastKey) { - $record = false; - } - } - - return $values; - } - - /** - * Get the current interval in a human readable format in the current locale. - * - * @example - * ``` - * echo CarbonInterval::fromString('4d 3h 40m')->forHumans() . "\n"; - * echo CarbonInterval::fromString('4d 3h 40m')->forHumans(['parts' => 2]) . "\n"; - * echo CarbonInterval::fromString('4d 3h 40m')->forHumans(['parts' => 3, 'join' => true]) . "\n"; - * echo CarbonInterval::fromString('4d 3h 40m')->forHumans(['short' => true]) . "\n"; - * echo CarbonInterval::fromString('1d 24h')->forHumans(['join' => ' or ']) . "\n"; - * echo CarbonInterval::fromString('1d 24h')->forHumans(['minimumUnit' => 'hour']) . "\n"; - * ``` - * - * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: - * - 'syntax' entry (see below) - * - 'short' entry (see below) - * - 'parts' entry (see below) - * - 'options' entry (see below) - * - 'skip' entry, list of units to skip (array of strings or a single string, - * ` it can be the unit name (singular or plural) or its shortcut - * ` (y, m, w, d, h, min, s, ms, µs). - * - 'aUnit' entry, prefer "an hour" over "1 hour" if true - * - 'join' entry determines how to join multiple parts of the string - * ` - if $join is a string, it's used as a joiner glue - * ` - if $join is a callable/closure, it get the list of string and should return a string - * ` - if $join is an array, the first item will be the default glue, and the second item - * ` will be used instead of the glue for the last item - * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) - * ` - if $join is missing, a space will be used as glue - * - 'minimumUnit' entry determines the smallest unit of time to display can be long or - * ` short form of the units, e.g. 'hour' or 'h' (default value: s) - * if int passed, it add modifiers: - * Possible values: - * - CarbonInterface::DIFF_ABSOLUTE no modifiers - * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier - * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier - * Default value: CarbonInterface::DIFF_ABSOLUTE - * @param bool $short displays short format of time units - * @param int $parts maximum number of parts to display (default value: -1: no limits) - * @param int $options human diff options - * - * @throws Exception - * - * @return string - */ - public function forHumans($syntax = null, $short = false, $parts = -1, $options = null) - { - [$syntax, $short, $parts, $options, $join, $aUnit, $altNumbers, $interpolations, $minimumUnit, $skip] = $this - ->getForHumansParameters($syntax, $short, $parts, $options); - - $interval = []; - - $syntax = (int) ($syntax ?? CarbonInterface::DIFF_ABSOLUTE); - $absolute = $syntax === CarbonInterface::DIFF_ABSOLUTE; - $relativeToNow = $syntax === CarbonInterface::DIFF_RELATIVE_TO_NOW; - $count = 1; - $unit = $short ? 's' : 'second'; - $isFuture = $this->invert === 1; - $transId = $relativeToNow ? ($isFuture ? 'from_now' : 'ago') : ($isFuture ? 'after' : 'before'); - $declensionMode = null; - - /** @var \Symfony\Component\Translation\Translator $translator */ - $translator = $this->getLocalTranslator(); - - $handleDeclensions = function ($unit, $count, $index = 0, $parts = 1) use ($interpolations, $transId, $translator, $altNumbers, $absolute, &$declensionMode) { - if (!$absolute) { - $declensionMode = $declensionMode ?? $this->translate($transId.'_mode'); - - if ($this->needsDeclension($declensionMode, $index, $parts)) { - // Some languages have special pluralization for past and future tense. - $key = $unit.'_'.$transId; - $result = $this->translate($key, $interpolations, $count, $translator, $altNumbers); - - if ($result !== $key) { - return $result; - } - } - } - - $result = $this->translate($unit, $interpolations, $count, $translator, $altNumbers); - - if ($result !== $unit) { - return $result; - } - - return null; - }; - - $intervalValues = $this; - $method = static::getRoundingMethodFromOptions($options); - - if ($method) { - $previousCount = INF; - - while ( - \count($intervalValues->getNonZeroValues()) > $parts && - ($count = \count($keys = array_keys($intervalValues->getValuesSequence()))) > 1 - ) { - $index = min($count, $previousCount - 1) - 2; - - if ($index < 0) { - break; - } - - $intervalValues = $this->copy()->roundUnit( - $keys[$index], - 1, - $method - ); - $previousCount = $count; - } - } - - $diffIntervalArray = [ - ['value' => $intervalValues->years, 'unit' => 'year', 'unitShort' => 'y'], - ['value' => $intervalValues->months, 'unit' => 'month', 'unitShort' => 'm'], - ['value' => $intervalValues->weeks, 'unit' => 'week', 'unitShort' => 'w'], - ['value' => $intervalValues->daysExcludeWeeks, 'unit' => 'day', 'unitShort' => 'd'], - ['value' => $intervalValues->hours, 'unit' => 'hour', 'unitShort' => 'h'], - ['value' => $intervalValues->minutes, 'unit' => 'minute', 'unitShort' => 'min'], - ['value' => $intervalValues->seconds, 'unit' => 'second', 'unitShort' => 's'], - ['value' => $intervalValues->milliseconds, 'unit' => 'millisecond', 'unitShort' => 'ms'], - ['value' => $intervalValues->microExcludeMilli, 'unit' => 'microsecond', 'unitShort' => 'µs'], - ]; - - if (!empty($skip)) { - foreach ($diffIntervalArray as $index => &$unitData) { - $nextIndex = $index + 1; - - if ($unitData['value'] && - isset($diffIntervalArray[$nextIndex]) && - \count(array_intersect([$unitData['unit'], $unitData['unit'].'s', $unitData['unitShort']], $skip)) - ) { - $diffIntervalArray[$nextIndex]['value'] += $unitData['value'] * - self::getFactorWithDefault($diffIntervalArray[$nextIndex]['unit'], $unitData['unit']); - $unitData['value'] = 0; - } - } - } - - $transChoice = function ($short, $unitData, $index, $parts) use ($absolute, $handleDeclensions, $translator, $aUnit, $altNumbers, $interpolations) { - $count = $unitData['value']; - - if ($short) { - $result = $handleDeclensions($unitData['unitShort'], $count, $index, $parts); - - if ($result !== null) { - return $result; - } - } elseif ($aUnit) { - $result = $handleDeclensions('a_'.$unitData['unit'], $count, $index, $parts); - - if ($result !== null) { - return $result; - } - } - - if (!$absolute) { - return $handleDeclensions($unitData['unit'], $count, $index, $parts); - } - - return $this->translate($unitData['unit'], $interpolations, $count, $translator, $altNumbers); - }; - - $fallbackUnit = ['second', 's']; - - foreach ($diffIntervalArray as $diffIntervalData) { - if ($diffIntervalData['value'] > 0) { - $unit = $short ? $diffIntervalData['unitShort'] : $diffIntervalData['unit']; - $count = $diffIntervalData['value']; - $interval[] = [$short, $diffIntervalData]; - } elseif ($options & CarbonInterface::SEQUENTIAL_PARTS_ONLY && \count($interval) > 0) { - break; - } - - // break the loop after we get the required number of parts in array - if (\count($interval) >= $parts) { - break; - } - - // break the loop after we have reached the minimum unit - if (\in_array($minimumUnit, [$diffIntervalData['unit'], $diffIntervalData['unitShort']], true)) { - $fallbackUnit = [$diffIntervalData['unit'], $diffIntervalData['unitShort']]; - - break; - } - } - - $actualParts = \count($interval); - - foreach ($interval as $index => &$item) { - $item = $transChoice($item[0], $item[1], $index, $actualParts); - } - - if (\count($interval) === 0) { - if ($relativeToNow && $options & CarbonInterface::JUST_NOW) { - $key = 'diff_now'; - $translation = $this->translate($key, $interpolations, null, $translator); - - if ($translation !== $key) { - return $translation; - } - } - - $count = $options & CarbonInterface::NO_ZERO_DIFF ? 1 : 0; - $unit = $fallbackUnit[$short ? 1 : 0]; - $interval[] = $this->translate($unit, $interpolations, $count, $translator, $altNumbers); - } - - // join the interval parts by a space - $time = $join($interval); - - unset($diffIntervalArray, $interval); - - if ($absolute) { - return $time; - } - - $isFuture = $this->invert === 1; - - $transId = $relativeToNow ? ($isFuture ? 'from_now' : 'ago') : ($isFuture ? 'after' : 'before'); - - if ($parts === 1) { - if ($relativeToNow && $unit === 'day') { - if ($count === 1 && $options & CarbonInterface::ONE_DAY_WORDS) { - $key = $isFuture ? 'diff_tomorrow' : 'diff_yesterday'; - $translation = $this->translate($key, $interpolations, null, $translator); - - if ($translation !== $key) { - return $translation; - } - } - - if ($count === 2 && $options & CarbonInterface::TWO_DAY_WORDS) { - $key = $isFuture ? 'diff_after_tomorrow' : 'diff_before_yesterday'; - $translation = $this->translate($key, $interpolations, null, $translator); - - if ($translation !== $key) { - return $translation; - } - } - } - - $aTime = $aUnit ? $handleDeclensions('a_'.$unit, $count) : null; - - $time = $aTime ?: $handleDeclensions($unit, $count) ?: $time; - } - - $time = [':time' => $time]; - - return $this->translate($transId, array_merge($time, $interpolations, $time), null, $translator); - } - - /** - * Format the instance as a string using the forHumans() function. - * - * @throws Exception - * - * @return string - */ - public function __toString() - { - $format = $this->localToStringFormat ?? static::$toStringFormat; - - if (!$format) { - return $this->forHumans(); - } - - if ($format instanceof Closure) { - return $format($this); - } - - return $this->format($format); - } - - /** - * Return native DateInterval PHP object matching the current instance. - * - * @example - * ``` - * var_dump(CarbonInterval::hours(2)->toDateInterval()); - * ``` - * - * @return DateInterval - */ - public function toDateInterval() - { - return self::castIntervalToClass($this, DateInterval::class); - } - - /** - * Convert the interval to a CarbonPeriod. - * - * @param DateTimeInterface|string|int ...$params Start date, [end date or recurrences] and optional settings. - * - * @return CarbonPeriod - */ - public function toPeriod(...$params) - { - if ($this->tzName) { - $tz = \is_string($this->tzName) ? new DateTimeZone($this->tzName) : $this->tzName; - - if ($tz instanceof DateTimeZone) { - array_unshift($params, $tz); - } - } - - return CarbonPeriod::create($this, ...$params); - } - - /** - * Invert the interval. - * - * @param bool|int $inverted if a parameter is passed, the passed value casted as 1 or 0 is used - * as the new value of the ->invert property. - * - * @return $this - */ - public function invert($inverted = null) - { - $this->invert = (\func_num_args() === 0 ? !$this->invert : $inverted) ? 1 : 0; - - return $this; - } - - protected function solveNegativeInterval() - { - if (!$this->isEmpty() && $this->years <= 0 && $this->months <= 0 && $this->dayz <= 0 && $this->hours <= 0 && $this->minutes <= 0 && $this->seconds <= 0 && $this->microseconds <= 0) { - $this->years *= -1; - $this->months *= -1; - $this->dayz *= -1; - $this->hours *= -1; - $this->minutes *= -1; - $this->seconds *= -1; - $this->microseconds *= -1; - $this->invert(); - } - - return $this; - } - - /** - * Add the passed interval to the current instance. - * - * @param string|DateInterval $unit - * @param int|float $value - * - * @return $this - */ - public function add($unit, $value = 1) - { - if (is_numeric($unit)) { - [$value, $unit] = [$unit, $value]; - } - - if (\is_string($unit) && !preg_match('/^\s*\d/', $unit)) { - $unit = "$value $unit"; - $value = 1; - } - - $interval = static::make($unit); - - if (!$interval) { - throw new InvalidIntervalException('This type of data cannot be added/subtracted.'); - } - - if ($value !== 1) { - $interval->times($value); - } - - $sign = ($this->invert === 1) !== ($interval->invert === 1) ? -1 : 1; - $this->years += $interval->y * $sign; - $this->months += $interval->m * $sign; - $this->dayz += ($interval->days === false ? $interval->d : $interval->days) * $sign; - $this->hours += $interval->h * $sign; - $this->minutes += $interval->i * $sign; - $this->seconds += $interval->s * $sign; - $this->microseconds += $interval->microseconds * $sign; - - $this->solveNegativeInterval(); - - return $this; - } - - /** - * Subtract the passed interval to the current instance. - * - * @param string|DateInterval $unit - * @param int|float $value - * - * @return $this - */ - public function sub($unit, $value = 1) - { - if (is_numeric($unit)) { - [$value, $unit] = [$unit, $value]; - } - - return $this->add($unit, -(float) $value); - } - - /** - * Subtract the passed interval to the current instance. - * - * @param string|DateInterval $unit - * @param int|float $value - * - * @return $this - */ - public function subtract($unit, $value = 1) - { - return $this->sub($unit, $value); - } - - /** - * Add given parameters to the current interval. - * - * @param int $years - * @param int $months - * @param int|float $weeks - * @param int|float $days - * @param int|float $hours - * @param int|float $minutes - * @param int|float $seconds - * @param int|float $microseconds - * - * @return $this - */ - public function plus( - $years = 0, - $months = 0, - $weeks = 0, - $days = 0, - $hours = 0, - $minutes = 0, - $seconds = 0, - $microseconds = 0 - ): self { - return $this->add(" - $years years $months months $weeks weeks $days days - $hours hours $minutes minutes $seconds seconds $microseconds microseconds - "); - } - - /** - * Add given parameters to the current interval. - * - * @param int $years - * @param int $months - * @param int|float $weeks - * @param int|float $days - * @param int|float $hours - * @param int|float $minutes - * @param int|float $seconds - * @param int|float $microseconds - * - * @return $this - */ - public function minus( - $years = 0, - $months = 0, - $weeks = 0, - $days = 0, - $hours = 0, - $minutes = 0, - $seconds = 0, - $microseconds = 0 - ): self { - return $this->sub(" - $years years $months months $weeks weeks $days days - $hours hours $minutes minutes $seconds seconds $microseconds microseconds - "); - } - - /** - * Multiply current instance given number of times. times() is naive, it multiplies each unit - * (so day can be greater than 31, hour can be greater than 23, etc.) and the result is rounded - * separately for each unit. - * - * Use times() when you want a fast and approximated calculation that does not cascade units. - * - * For a precise and cascaded calculation, - * - * @see multiply() - * - * @param float|int $factor - * - * @return $this - */ - public function times($factor) - { - if ($factor < 0) { - $this->invert = $this->invert ? 0 : 1; - $factor = -$factor; - } - - $this->years = (int) round($this->years * $factor); - $this->months = (int) round($this->months * $factor); - $this->dayz = (int) round($this->dayz * $factor); - $this->hours = (int) round($this->hours * $factor); - $this->minutes = (int) round($this->minutes * $factor); - $this->seconds = (int) round($this->seconds * $factor); - $this->microseconds = (int) round($this->microseconds * $factor); - - return $this; - } - - /** - * Divide current instance by a given divider. shares() is naive, it divides each unit separately - * and the result is rounded for each unit. So 5 hours and 20 minutes shared by 3 becomes 2 hours - * and 7 minutes. - * - * Use shares() when you want a fast and approximated calculation that does not cascade units. - * - * For a precise and cascaded calculation, - * - * @see divide() - * - * @param float|int $divider - * - * @return $this - */ - public function shares($divider) - { - return $this->times(1 / $divider); - } - - protected function copyProperties(self $interval, $ignoreSign = false) - { - $this->years = $interval->years; - $this->months = $interval->months; - $this->dayz = $interval->dayz; - $this->hours = $interval->hours; - $this->minutes = $interval->minutes; - $this->seconds = $interval->seconds; - $this->microseconds = $interval->microseconds; - - if (!$ignoreSign) { - $this->invert = $interval->invert; - } - - return $this; - } - - /** - * Multiply and cascade current instance by a given factor. - * - * @param float|int $factor - * - * @return $this - */ - public function multiply($factor) - { - if ($factor < 0) { - $this->invert = $this->invert ? 0 : 1; - $factor = -$factor; - } - - $yearPart = (int) floor($this->years * $factor); // Split calculation to prevent imprecision - - if ($yearPart) { - $this->years -= $yearPart / $factor; - } - - return $this->copyProperties( - static::create($yearPart) - ->microseconds(abs($this->totalMicroseconds) * $factor) - ->cascade(), - true - ); - } - - /** - * Divide and cascade current instance by a given divider. - * - * @param float|int $divider - * - * @return $this - */ - public function divide($divider) - { - return $this->multiply(1 / $divider); - } - - /** - * Get the interval_spec string of a date interval. - * - * @param DateInterval $interval - * - * @return string - */ - public static function getDateIntervalSpec(DateInterval $interval, bool $microseconds = false, array $skip = []) - { - $date = array_filter([ - static::PERIOD_YEARS => abs($interval->y), - static::PERIOD_MONTHS => abs($interval->m), - static::PERIOD_DAYS => abs($interval->d), - ]); - - if ( - $interval->days >= CarbonInterface::DAYS_PER_WEEK * CarbonInterface::WEEKS_PER_MONTH && - (!isset($date[static::PERIOD_YEARS]) || \count(array_intersect(['y', 'year', 'years'], $skip))) && - (!isset($date[static::PERIOD_MONTHS]) || \count(array_intersect(['m', 'month', 'months'], $skip))) - ) { - $date = [ - static::PERIOD_DAYS => abs($interval->days), - ]; - } - - $seconds = abs($interval->s); - if ($microseconds && $interval->f > 0) { - $seconds = sprintf('%d.%06d', $seconds, abs($interval->f) * 1000000); - } - - $time = array_filter([ - static::PERIOD_HOURS => abs($interval->h), - static::PERIOD_MINUTES => abs($interval->i), - static::PERIOD_SECONDS => $seconds, - ]); - - $specString = static::PERIOD_PREFIX; - - foreach ($date as $key => $value) { - $specString .= $value.$key; - } - - if (\count($time) > 0) { - $specString .= static::PERIOD_TIME_PREFIX; - foreach ($time as $key => $value) { - $specString .= $value.$key; - } - } - - return $specString === static::PERIOD_PREFIX ? 'PT0S' : $specString; - } - - /** - * Get the interval_spec string. - * - * @return string - */ - public function spec(bool $microseconds = false) - { - return static::getDateIntervalSpec($this, $microseconds); - } - - /** - * Comparing 2 date intervals. - * - * @param DateInterval $first - * @param DateInterval $second - * - * @return int - */ - public static function compareDateIntervals(DateInterval $first, DateInterval $second) - { - $current = Carbon::now(); - $passed = $current->avoidMutation()->add($second); - $current->add($first); - - if ($current < $passed) { - return -1; - } - if ($current > $passed) { - return 1; - } - - return 0; - } - - /** - * Comparing with passed interval. - * - * @param DateInterval $interval - * - * @return int - */ - public function compare(DateInterval $interval) - { - return static::compareDateIntervals($this, $interval); - } - - private function invertCascade(array $values) - { - return $this->set(array_map(function ($value) { - return -$value; - }, $values))->doCascade(true)->invert(); - } - - private function doCascade(bool $deep) - { - $originalData = $this->toArray(); - $originalData['milliseconds'] = (int) ($originalData['microseconds'] / static::getMicrosecondsPerMillisecond()); - $originalData['microseconds'] = $originalData['microseconds'] % static::getMicrosecondsPerMillisecond(); - $originalData['weeks'] = (int) ($this->d / static::getDaysPerWeek()); - $originalData['daysExcludeWeeks'] = fmod($this->d, static::getDaysPerWeek()); - unset($originalData['days']); - $newData = $originalData; - $previous = []; - - foreach (self::getFlipCascadeFactors() as $source => [$target, $factor]) { - foreach (['source', 'target'] as $key) { - if ($$key === 'dayz') { - $$key = 'daysExcludeWeeks'; - } - } - - $value = $newData[$source]; - $modulo = fmod($factor + fmod($value, $factor), $factor); - $newData[$source] = $modulo; - $newData[$target] += ($value - $modulo) / $factor; - - $decimalPart = fmod($newData[$source], 1); - - if ($decimalPart !== 0.0) { - $unit = $source; - - foreach ($previous as [$subUnit, $subFactor]) { - $newData[$unit] -= $decimalPart; - $newData[$subUnit] += $decimalPart * $subFactor; - $decimalPart = fmod($newData[$subUnit], 1); - - if ($decimalPart === 0.0) { - break; - } - - $unit = $subUnit; - } - } - - array_unshift($previous, [$source, $factor]); - } - - $positive = null; - - if (!$deep) { - foreach ($newData as $value) { - if ($value) { - if ($positive === null) { - $positive = ($value > 0); - - continue; - } - - if (($value > 0) !== $positive) { - return $this->invertCascade($originalData) - ->solveNegativeInterval(); - } - } - } - } - - return $this->set($newData) - ->solveNegativeInterval(); - } - - /** - * Convert overflowed values into bigger units. - * - * @return $this - */ - public function cascade() - { - return $this->doCascade(false); - } - - public function hasNegativeValues(): bool - { - foreach ($this->toArray() as $value) { - if ($value < 0) { - return true; - } - } - - return false; - } - - public function hasPositiveValues(): bool - { - foreach ($this->toArray() as $value) { - if ($value > 0) { - return true; - } - } - - return false; - } - - /** - * Get amount of given unit equivalent to the interval. - * - * @param string $unit - * - * @throws UnknownUnitException|UnitNotConfiguredException - * - * @return float - */ - public function total($unit) - { - $realUnit = $unit = strtolower($unit); - - if (\in_array($unit, ['days', 'weeks'])) { - $realUnit = 'dayz'; - } elseif (!\in_array($unit, ['microseconds', 'milliseconds', 'seconds', 'minutes', 'hours', 'dayz', 'months', 'years'])) { - throw new UnknownUnitException($unit); - } - - $result = 0; - $cumulativeFactor = 0; - $unitFound = false; - $factors = self::getFlipCascadeFactors(); - $daysPerWeek = (int) static::getDaysPerWeek(); - - $values = [ - 'years' => $this->years, - 'months' => $this->months, - 'weeks' => (int) ($this->d / $daysPerWeek), - 'dayz' => fmod($this->d, $daysPerWeek), - 'hours' => $this->hours, - 'minutes' => $this->minutes, - 'seconds' => $this->seconds, - 'milliseconds' => (int) ($this->microseconds / Carbon::MICROSECONDS_PER_MILLISECOND), - 'microseconds' => $this->microseconds % Carbon::MICROSECONDS_PER_MILLISECOND, - ]; - - if (isset($factors['dayz']) && $factors['dayz'][0] !== 'weeks') { - $values['dayz'] += $values['weeks'] * $daysPerWeek; - $values['weeks'] = 0; - } - - foreach ($factors as $source => [$target, $factor]) { - if ($source === $realUnit) { - $unitFound = true; - $value = $values[$source]; - $result += $value; - $cumulativeFactor = 1; - } - - if ($factor === false) { - if ($unitFound) { - break; - } - - $result = 0; - $cumulativeFactor = 0; - - continue; - } - - if ($target === $realUnit) { - $unitFound = true; - } - - if ($cumulativeFactor) { - $cumulativeFactor *= $factor; - $result += $values[$target] * $cumulativeFactor; - - continue; - } - - $value = $values[$source]; - - $result = ($result + $value) / $factor; - } - - if (isset($target) && !$cumulativeFactor) { - $result += $values[$target]; - } - - if (!$unitFound) { - throw new UnitNotConfiguredException($unit); - } - - if ($this->invert) { - $result *= -1; - } - - if ($unit === 'weeks') { - $result /= $daysPerWeek; - } - - // Cast as int numbers with no decimal part - return fmod($result, 1) === 0.0 ? (int) $result : $result; - } - - /** - * Determines if the instance is equal to another - * - * @param CarbonInterval|DateInterval|mixed $interval - * - * @see equalTo() - * - * @return bool - */ - public function eq($interval): bool - { - return $this->equalTo($interval); - } - - /** - * Determines if the instance is equal to another - * - * @param CarbonInterval|DateInterval|mixed $interval - * - * @return bool - */ - public function equalTo($interval): bool - { - $interval = $this->resolveInterval($interval); - - return $interval !== null && $this->totalMicroseconds === $interval->totalMicroseconds; - } - - /** - * Determines if the instance is not equal to another - * - * @param CarbonInterval|DateInterval|mixed $interval - * - * @see notEqualTo() - * - * @return bool - */ - public function ne($interval): bool - { - return $this->notEqualTo($interval); - } - - /** - * Determines if the instance is not equal to another - * - * @param CarbonInterval|DateInterval|mixed $interval - * - * @return bool - */ - public function notEqualTo($interval): bool - { - return !$this->eq($interval); - } - - /** - * Determines if the instance is greater (longer) than another - * - * @param CarbonInterval|DateInterval|mixed $interval - * - * @see greaterThan() - * - * @return bool - */ - public function gt($interval): bool - { - return $this->greaterThan($interval); - } - - /** - * Determines if the instance is greater (longer) than another - * - * @param CarbonInterval|DateInterval|mixed $interval - * - * @return bool - */ - public function greaterThan($interval): bool - { - $interval = $this->resolveInterval($interval); - - return $interval === null || $this->totalMicroseconds > $interval->totalMicroseconds; - } - - /** - * Determines if the instance is greater (longer) than or equal to another - * - * @param CarbonInterval|DateInterval|mixed $interval - * - * @see greaterThanOrEqualTo() - * - * @return bool - */ - public function gte($interval): bool - { - return $this->greaterThanOrEqualTo($interval); - } - - /** - * Determines if the instance is greater (longer) than or equal to another - * - * @param CarbonInterval|DateInterval|mixed $interval - * - * @return bool - */ - public function greaterThanOrEqualTo($interval): bool - { - return $this->greaterThan($interval) || $this->equalTo($interval); - } - - /** - * Determines if the instance is less (shorter) than another - * - * @param CarbonInterval|DateInterval|mixed $interval - * - * @see lessThan() - * - * @return bool - */ - public function lt($interval): bool - { - return $this->lessThan($interval); - } - - /** - * Determines if the instance is less (shorter) than another - * - * @param CarbonInterval|DateInterval|mixed $interval - * - * @return bool - */ - public function lessThan($interval): bool - { - $interval = $this->resolveInterval($interval); - - return $interval !== null && $this->totalMicroseconds < $interval->totalMicroseconds; - } - - /** - * Determines if the instance is less (shorter) than or equal to another - * - * @param CarbonInterval|DateInterval|mixed $interval - * - * @see lessThanOrEqualTo() - * - * @return bool - */ - public function lte($interval): bool - { - return $this->lessThanOrEqualTo($interval); - } - - /** - * Determines if the instance is less (shorter) than or equal to another - * - * @param CarbonInterval|DateInterval|mixed $interval - * - * @return bool - */ - public function lessThanOrEqualTo($interval): bool - { - return $this->lessThan($interval) || $this->equalTo($interval); - } - - /** - * Determines if the instance is between two others. - * - * The third argument allow you to specify if bounds are included or not (true by default) - * but for when you including/excluding bounds may produce different results in your application, - * we recommend to use the explicit methods ->betweenIncluded() or ->betweenExcluded() instead. - * - * @example - * ``` - * CarbonInterval::hours(48)->between(CarbonInterval::day(), CarbonInterval::days(3)); // true - * CarbonInterval::hours(48)->between(CarbonInterval::day(), CarbonInterval::hours(36)); // false - * CarbonInterval::hours(48)->between(CarbonInterval::day(), CarbonInterval::days(2)); // true - * CarbonInterval::hours(48)->between(CarbonInterval::day(), CarbonInterval::days(2), false); // false - * ``` - * - * @param CarbonInterval|DateInterval|mixed $interval1 - * @param CarbonInterval|DateInterval|mixed $interval2 - * @param bool $equal Indicates if an equal to comparison should be done - * - * @return bool - */ - public function between($interval1, $interval2, $equal = true): bool - { - return $equal - ? $this->greaterThanOrEqualTo($interval1) && $this->lessThanOrEqualTo($interval2) - : $this->greaterThan($interval1) && $this->lessThan($interval2); - } - - /** - * Determines if the instance is between two others, bounds excluded. - * - * @example - * ``` - * CarbonInterval::hours(48)->betweenExcluded(CarbonInterval::day(), CarbonInterval::days(3)); // true - * CarbonInterval::hours(48)->betweenExcluded(CarbonInterval::day(), CarbonInterval::hours(36)); // false - * CarbonInterval::hours(48)->betweenExcluded(CarbonInterval::day(), CarbonInterval::days(2)); // true - * ``` - * - * @param CarbonInterval|DateInterval|mixed $interval1 - * @param CarbonInterval|DateInterval|mixed $interval2 - * - * @return bool - */ - public function betweenIncluded($interval1, $interval2): bool - { - return $this->between($interval1, $interval2, true); - } - - /** - * Determines if the instance is between two others, bounds excluded. - * - * @example - * ``` - * CarbonInterval::hours(48)->betweenExcluded(CarbonInterval::day(), CarbonInterval::days(3)); // true - * CarbonInterval::hours(48)->betweenExcluded(CarbonInterval::day(), CarbonInterval::hours(36)); // false - * CarbonInterval::hours(48)->betweenExcluded(CarbonInterval::day(), CarbonInterval::days(2)); // false - * ``` - * - * @param CarbonInterval|DateInterval|mixed $interval1 - * @param CarbonInterval|DateInterval|mixed $interval2 - * - * @return bool - */ - public function betweenExcluded($interval1, $interval2): bool - { - return $this->between($interval1, $interval2, false); - } - - /** - * Determines if the instance is between two others - * - * @example - * ``` - * CarbonInterval::hours(48)->isBetween(CarbonInterval::day(), CarbonInterval::days(3)); // true - * CarbonInterval::hours(48)->isBetween(CarbonInterval::day(), CarbonInterval::hours(36)); // false - * CarbonInterval::hours(48)->isBetween(CarbonInterval::day(), CarbonInterval::days(2)); // true - * CarbonInterval::hours(48)->isBetween(CarbonInterval::day(), CarbonInterval::days(2), false); // false - * ``` - * - * @param CarbonInterval|DateInterval|mixed $interval1 - * @param CarbonInterval|DateInterval|mixed $interval2 - * @param bool $equal Indicates if an equal to comparison should be done - * - * @return bool - */ - public function isBetween($interval1, $interval2, $equal = true): bool - { - return $this->between($interval1, $interval2, $equal); - } - - /** - * Round the current instance at the given unit with given precision if specified and the given function. - * - * @param string $unit - * @param float|int|string|DateInterval|null $precision - * @param string $function - * - * @throws Exception - * - * @return $this - */ - public function roundUnit($unit, $precision = 1, $function = 'round') - { - $base = CarbonImmutable::parse('2000-01-01 00:00:00', 'UTC') - ->roundUnit($unit, $precision, $function); - $next = $base->add($this); - $inverted = $next < $base; - - if ($inverted) { - $next = $base->sub($this); - } - - $this->copyProperties( - $next - ->roundUnit($unit, $precision, $function) - ->diffAsCarbonInterval($base) - ); - - return $this->invert($inverted); - } - - /** - * Truncate the current instance at the given unit with given precision if specified. - * - * @param string $unit - * @param float|int|string|DateInterval|null $precision - * - * @throws Exception - * - * @return $this - */ - public function floorUnit($unit, $precision = 1) - { - return $this->roundUnit($unit, $precision, 'floor'); - } - - /** - * Ceil the current instance at the given unit with given precision if specified. - * - * @param string $unit - * @param float|int|string|DateInterval|null $precision - * - * @throws Exception - * - * @return $this - */ - public function ceilUnit($unit, $precision = 1) - { - return $this->roundUnit($unit, $precision, 'ceil'); - } - - /** - * Round the current instance second with given precision if specified. - * - * @param float|int|string|DateInterval|null $precision - * @param string $function - * - * @throws Exception - * - * @return $this - */ - public function round($precision = 1, $function = 'round') - { - return $this->roundWith($precision, $function); - } - - /** - * Round the current instance second with given precision if specified. - * - * @param float|int|string|DateInterval|null $precision - * - * @throws Exception - * - * @return $this - */ - public function floor($precision = 1) - { - return $this->round($precision, 'floor'); - } - - /** - * Ceil the current instance second with given precision if specified. - * - * @param float|int|string|DateInterval|null $precision - * - * @throws Exception - * - * @return $this - */ - public function ceil($precision = 1) - { - return $this->round($precision, 'ceil'); - } - - private function needsDeclension(string $mode, int $index, int $parts): bool - { - switch ($mode) { - case 'last': - return $index === $parts - 1; - default: - return true; - } - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php b/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php deleted file mode 100644 index 36f04bf5..00000000 --- a/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php +++ /dev/null @@ -1,2686 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon; - -use Carbon\Exceptions\EndLessPeriodException; -use Carbon\Exceptions\InvalidCastException; -use Carbon\Exceptions\InvalidIntervalException; -use Carbon\Exceptions\InvalidPeriodDateException; -use Carbon\Exceptions\InvalidPeriodParameterException; -use Carbon\Exceptions\NotACarbonClassException; -use Carbon\Exceptions\NotAPeriodException; -use Carbon\Exceptions\UnknownGetterException; -use Carbon\Exceptions\UnknownMethodException; -use Carbon\Exceptions\UnreachableException; -use Carbon\Traits\IntervalRounding; -use Carbon\Traits\Mixin; -use Carbon\Traits\Options; -use Carbon\Traits\ToStringFormat; -use Closure; -use Countable; -use DateInterval; -use DatePeriod; -use DateTime; -use DateTimeImmutable; -use DateTimeInterface; -use DateTimeZone; -use InvalidArgumentException; -use Iterator; -use JsonSerializable; -use ReflectionException; -use ReturnTypeWillChange; -use RuntimeException; - -/** - * Substitution of DatePeriod with some modifications and many more features. - * - * @property-read int|float $recurrences number of recurrences (if end not set). - * @property-read bool $include_start_date rather the start date is included in the iteration. - * @property-read bool $include_end_date rather the end date is included in the iteration (if recurrences not set). - * @property-read CarbonInterface $start Period start date. - * @property-read CarbonInterface $current Current date from the iteration. - * @property-read CarbonInterface $end Period end date. - * @property-read CarbonInterval $interval Underlying date interval instance. Always present, one day by default. - * - * @method static CarbonPeriod start($date, $inclusive = null) Create instance specifying start date or modify the start date if called on an instance. - * @method static CarbonPeriod since($date, $inclusive = null) Alias for start(). - * @method static CarbonPeriod sinceNow($inclusive = null) Create instance with start date set to now or set the start date to now if called on an instance. - * @method static CarbonPeriod end($date = null, $inclusive = null) Create instance specifying end date or modify the end date if called on an instance. - * @method static CarbonPeriod until($date = null, $inclusive = null) Alias for end(). - * @method static CarbonPeriod untilNow($inclusive = null) Create instance with end date set to now or set the end date to now if called on an instance. - * @method static CarbonPeriod dates($start, $end = null) Create instance with start and end dates or modify the start and end dates if called on an instance. - * @method static CarbonPeriod between($start, $end = null) Create instance with start and end dates or modify the start and end dates if called on an instance. - * @method static CarbonPeriod recurrences($recurrences = null) Create instance with maximum number of recurrences or modify the number of recurrences if called on an instance. - * @method static CarbonPeriod times($recurrences = null) Alias for recurrences(). - * @method static CarbonPeriod options($options = null) Create instance with options or modify the options if called on an instance. - * @method static CarbonPeriod toggle($options, $state = null) Create instance with options toggled on or off, or toggle options if called on an instance. - * @method static CarbonPeriod filter($callback, $name = null) Create instance with filter added to the stack or append a filter if called on an instance. - * @method static CarbonPeriod push($callback, $name = null) Alias for filter(). - * @method static CarbonPeriod prepend($callback, $name = null) Create instance with filter prepended to the stack or prepend a filter if called on an instance. - * @method static CarbonPeriod filters(array $filters = []) Create instance with filters stack or replace the whole filters stack if called on an instance. - * @method static CarbonPeriod interval($interval) Create instance with given date interval or modify the interval if called on an instance. - * @method static CarbonPeriod each($interval) Create instance with given date interval or modify the interval if called on an instance. - * @method static CarbonPeriod every($interval) Create instance with given date interval or modify the interval if called on an instance. - * @method static CarbonPeriod step($interval) Create instance with given date interval or modify the interval if called on an instance. - * @method static CarbonPeriod stepBy($interval) Create instance with given date interval or modify the interval if called on an instance. - * @method static CarbonPeriod invert() Create instance with inverted date interval or invert the interval if called on an instance. - * @method static CarbonPeriod years($years = 1) Create instance specifying a number of years for date interval or replace the interval by the given a number of years if called on an instance. - * @method static CarbonPeriod year($years = 1) Alias for years(). - * @method static CarbonPeriod months($months = 1) Create instance specifying a number of months for date interval or replace the interval by the given a number of months if called on an instance. - * @method static CarbonPeriod month($months = 1) Alias for months(). - * @method static CarbonPeriod weeks($weeks = 1) Create instance specifying a number of weeks for date interval or replace the interval by the given a number of weeks if called on an instance. - * @method static CarbonPeriod week($weeks = 1) Alias for weeks(). - * @method static CarbonPeriod days($days = 1) Create instance specifying a number of days for date interval or replace the interval by the given a number of days if called on an instance. - * @method static CarbonPeriod dayz($days = 1) Alias for days(). - * @method static CarbonPeriod day($days = 1) Alias for days(). - * @method static CarbonPeriod hours($hours = 1) Create instance specifying a number of hours for date interval or replace the interval by the given a number of hours if called on an instance. - * @method static CarbonPeriod hour($hours = 1) Alias for hours(). - * @method static CarbonPeriod minutes($minutes = 1) Create instance specifying a number of minutes for date interval or replace the interval by the given a number of minutes if called on an instance. - * @method static CarbonPeriod minute($minutes = 1) Alias for minutes(). - * @method static CarbonPeriod seconds($seconds = 1) Create instance specifying a number of seconds for date interval or replace the interval by the given a number of seconds if called on an instance. - * @method static CarbonPeriod second($seconds = 1) Alias for seconds(). - * @method $this roundYear(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. - * @method $this roundYears(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. - * @method $this floorYear(float $precision = 1) Truncate the current instance year with given precision. - * @method $this floorYears(float $precision = 1) Truncate the current instance year with given precision. - * @method $this ceilYear(float $precision = 1) Ceil the current instance year with given precision. - * @method $this ceilYears(float $precision = 1) Ceil the current instance year with given precision. - * @method $this roundMonth(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. - * @method $this roundMonths(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. - * @method $this floorMonth(float $precision = 1) Truncate the current instance month with given precision. - * @method $this floorMonths(float $precision = 1) Truncate the current instance month with given precision. - * @method $this ceilMonth(float $precision = 1) Ceil the current instance month with given precision. - * @method $this ceilMonths(float $precision = 1) Ceil the current instance month with given precision. - * @method $this roundWeek(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. - * @method $this roundWeeks(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. - * @method $this floorWeek(float $precision = 1) Truncate the current instance day with given precision. - * @method $this floorWeeks(float $precision = 1) Truncate the current instance day with given precision. - * @method $this ceilWeek(float $precision = 1) Ceil the current instance day with given precision. - * @method $this ceilWeeks(float $precision = 1) Ceil the current instance day with given precision. - * @method $this roundDay(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. - * @method $this roundDays(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. - * @method $this floorDay(float $precision = 1) Truncate the current instance day with given precision. - * @method $this floorDays(float $precision = 1) Truncate the current instance day with given precision. - * @method $this ceilDay(float $precision = 1) Ceil the current instance day with given precision. - * @method $this ceilDays(float $precision = 1) Ceil the current instance day with given precision. - * @method $this roundHour(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. - * @method $this roundHours(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. - * @method $this floorHour(float $precision = 1) Truncate the current instance hour with given precision. - * @method $this floorHours(float $precision = 1) Truncate the current instance hour with given precision. - * @method $this ceilHour(float $precision = 1) Ceil the current instance hour with given precision. - * @method $this ceilHours(float $precision = 1) Ceil the current instance hour with given precision. - * @method $this roundMinute(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. - * @method $this roundMinutes(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. - * @method $this floorMinute(float $precision = 1) Truncate the current instance minute with given precision. - * @method $this floorMinutes(float $precision = 1) Truncate the current instance minute with given precision. - * @method $this ceilMinute(float $precision = 1) Ceil the current instance minute with given precision. - * @method $this ceilMinutes(float $precision = 1) Ceil the current instance minute with given precision. - * @method $this roundSecond(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. - * @method $this roundSeconds(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. - * @method $this floorSecond(float $precision = 1) Truncate the current instance second with given precision. - * @method $this floorSeconds(float $precision = 1) Truncate the current instance second with given precision. - * @method $this ceilSecond(float $precision = 1) Ceil the current instance second with given precision. - * @method $this ceilSeconds(float $precision = 1) Ceil the current instance second with given precision. - * @method $this roundMillennium(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. - * @method $this roundMillennia(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. - * @method $this floorMillennium(float $precision = 1) Truncate the current instance millennium with given precision. - * @method $this floorMillennia(float $precision = 1) Truncate the current instance millennium with given precision. - * @method $this ceilMillennium(float $precision = 1) Ceil the current instance millennium with given precision. - * @method $this ceilMillennia(float $precision = 1) Ceil the current instance millennium with given precision. - * @method $this roundCentury(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. - * @method $this roundCenturies(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. - * @method $this floorCentury(float $precision = 1) Truncate the current instance century with given precision. - * @method $this floorCenturies(float $precision = 1) Truncate the current instance century with given precision. - * @method $this ceilCentury(float $precision = 1) Ceil the current instance century with given precision. - * @method $this ceilCenturies(float $precision = 1) Ceil the current instance century with given precision. - * @method $this roundDecade(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. - * @method $this roundDecades(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. - * @method $this floorDecade(float $precision = 1) Truncate the current instance decade with given precision. - * @method $this floorDecades(float $precision = 1) Truncate the current instance decade with given precision. - * @method $this ceilDecade(float $precision = 1) Ceil the current instance decade with given precision. - * @method $this ceilDecades(float $precision = 1) Ceil the current instance decade with given precision. - * @method $this roundQuarter(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. - * @method $this roundQuarters(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. - * @method $this floorQuarter(float $precision = 1) Truncate the current instance quarter with given precision. - * @method $this floorQuarters(float $precision = 1) Truncate the current instance quarter with given precision. - * @method $this ceilQuarter(float $precision = 1) Ceil the current instance quarter with given precision. - * @method $this ceilQuarters(float $precision = 1) Ceil the current instance quarter with given precision. - * @method $this roundMillisecond(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. - * @method $this roundMilliseconds(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. - * @method $this floorMillisecond(float $precision = 1) Truncate the current instance millisecond with given precision. - * @method $this floorMilliseconds(float $precision = 1) Truncate the current instance millisecond with given precision. - * @method $this ceilMillisecond(float $precision = 1) Ceil the current instance millisecond with given precision. - * @method $this ceilMilliseconds(float $precision = 1) Ceil the current instance millisecond with given precision. - * @method $this roundMicrosecond(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. - * @method $this roundMicroseconds(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. - * @method $this floorMicrosecond(float $precision = 1) Truncate the current instance microsecond with given precision. - * @method $this floorMicroseconds(float $precision = 1) Truncate the current instance microsecond with given precision. - * @method $this ceilMicrosecond(float $precision = 1) Ceil the current instance microsecond with given precision. - * @method $this ceilMicroseconds(float $precision = 1) Ceil the current instance microsecond with given precision. - * - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) - */ -class CarbonPeriod implements Iterator, Countable, JsonSerializable -{ - use IntervalRounding; - use Mixin { - Mixin::mixin as baseMixin; - } - use Options; - use ToStringFormat; - - /** - * Built-in filter for limit by recurrences. - * - * @var callable - */ - public const RECURRENCES_FILTER = [self::class, 'filterRecurrences']; - - /** - * Built-in filter for limit to an end. - * - * @var callable - */ - public const END_DATE_FILTER = [self::class, 'filterEndDate']; - - /** - * Special value which can be returned by filters to end iteration. Also a filter. - * - * @var callable - */ - public const END_ITERATION = [self::class, 'endIteration']; - - /** - * Exclude start date from iteration. - * - * @var int - */ - public const EXCLUDE_START_DATE = 1; - - /** - * Exclude end date from iteration. - * - * @var int - */ - public const EXCLUDE_END_DATE = 2; - - /** - * Yield CarbonImmutable instances. - * - * @var int - */ - public const IMMUTABLE = 4; - - /** - * Number of maximum attempts before giving up on finding next valid date. - * - * @var int - */ - public const NEXT_MAX_ATTEMPTS = 1000; - - /** - * Number of maximum attempts before giving up on finding end date. - * - * @var int - */ - public const END_MAX_ATTEMPTS = 10000; - - /** - * The registered macros. - * - * @var array - */ - protected static $macros = []; - - /** - * Date class of iteration items. - * - * @var string - */ - protected $dateClass = Carbon::class; - - /** - * Underlying date interval instance. Always present, one day by default. - * - * @var CarbonInterval - */ - protected $dateInterval; - - /** - * Whether current date interval was set by default. - * - * @var bool - */ - protected $isDefaultInterval; - - /** - * The filters stack. - * - * @var array - */ - protected $filters = []; - - /** - * Period start date. Applied on rewind. Always present, now by default. - * - * @var CarbonInterface - */ - protected $startDate; - - /** - * Period end date. For inverted interval should be before the start date. Applied via a filter. - * - * @var CarbonInterface|null - */ - protected $endDate; - - /** - * Limit for number of recurrences. Applied via a filter. - * - * @var int|null - */ - protected $recurrences; - - /** - * Iteration options. - * - * @var int - */ - protected $options; - - /** - * Index of current date. Always sequential, even if some dates are skipped by filters. - * Equal to null only before the first iteration. - * - * @var int - */ - protected $key; - - /** - * Current date. May temporarily hold unaccepted value when looking for a next valid date. - * Equal to null only before the first iteration. - * - * @var CarbonInterface - */ - protected $current; - - /** - * Timezone of current date. Taken from the start date. - * - * @var \DateTimeZone|null - */ - protected $timezone; - - /** - * The cached validation result for current date. - * - * @var bool|string|null - */ - protected $validationResult; - - /** - * Timezone handler for settings() method. - * - * @var mixed - */ - protected $tzName; - - /** - * Make a CarbonPeriod instance from given variable if possible. - * - * @param mixed $var - * - * @return static|null - */ - public static function make($var) - { - try { - return static::instance($var); - } catch (NotAPeriodException $e) { - return static::create($var); - } - } - - /** - * Create a new instance from a DatePeriod or CarbonPeriod object. - * - * @param CarbonPeriod|DatePeriod $period - * - * @return static - */ - public static function instance($period) - { - if ($period instanceof static) { - return $period->copy(); - } - - if ($period instanceof self) { - return new static( - $period->getStartDate(), - $period->getEndDate() ?: $period->getRecurrences(), - $period->getDateInterval(), - $period->getOptions() - ); - } - - if ($period instanceof DatePeriod) { - return new static( - $period->start, - $period->end ?: ($period->recurrences - 1), - $period->interval, - $period->include_start_date ? 0 : static::EXCLUDE_START_DATE - ); - } - - $class = static::class; - $type = \gettype($period); - - throw new NotAPeriodException( - 'Argument 1 passed to '.$class.'::'.__METHOD__.'() '. - 'must be an instance of DatePeriod or '.$class.', '. - ($type === 'object' ? 'instance of '.\get_class($period) : $type).' given.' - ); - } - - /** - * Create a new instance. - * - * @return static - */ - public static function create(...$params) - { - return static::createFromArray($params); - } - - /** - * Create a new instance from an array of parameters. - * - * @param array $params - * - * @return static - */ - public static function createFromArray(array $params) - { - return new static(...$params); - } - - /** - * Create CarbonPeriod from ISO 8601 string. - * - * @param string $iso - * @param int|null $options - * - * @return static - */ - public static function createFromIso($iso, $options = null) - { - $params = static::parseIso8601($iso); - - $instance = static::createFromArray($params); - - if ($options !== null) { - $instance->setOptions($options); - } - - return $instance; - } - - /** - * Return whether given interval contains non zero value of any time unit. - * - * @param \DateInterval $interval - * - * @return bool - */ - protected static function intervalHasTime(DateInterval $interval) - { - return $interval->h || $interval->i || $interval->s || $interval->f; - } - - /** - * Return whether given variable is an ISO 8601 specification. - * - * Note: Check is very basic, as actual validation will be done later when parsing. - * We just want to ensure that variable is not any other type of a valid parameter. - * - * @param mixed $var - * - * @return bool - */ - protected static function isIso8601($var) - { - if (!\is_string($var)) { - return false; - } - - // Match slash but not within a timezone name. - $part = '[a-z]+(?:[_-][a-z]+)*'; - - preg_match("#\b$part/$part\b|(/)#i", $var, $match); - - return isset($match[1]); - } - - /** - * Parse given ISO 8601 string into an array of arguments. - * - * @SuppressWarnings(PHPMD.ElseExpression) - * - * @param string $iso - * - * @return array - */ - protected static function parseIso8601($iso) - { - $result = []; - - $interval = null; - $start = null; - $end = null; - - foreach (explode('/', $iso) as $key => $part) { - if ($key === 0 && preg_match('/^R(\d*|INF)$/', $part, $match)) { - $parsed = \strlen($match[1]) ? (($match[1] !== 'INF') ? (int) $match[1] : INF) : null; - } elseif ($interval === null && $parsed = CarbonInterval::make($part)) { - $interval = $part; - } elseif ($start === null && $parsed = Carbon::make($part)) { - $start = $part; - } elseif ($end === null && $parsed = Carbon::make(static::addMissingParts($start ?? '', $part))) { - $end = $part; - } else { - throw new InvalidPeriodParameterException("Invalid ISO 8601 specification: $iso."); - } - - $result[] = $parsed; - } - - return $result; - } - - /** - * Add missing parts of the target date from the soure date. - * - * @param string $source - * @param string $target - * - * @return string - */ - protected static function addMissingParts($source, $target) - { - $pattern = '/'.preg_replace('/\d+/', '[0-9]+', preg_quote($target, '/')).'$/'; - - $result = preg_replace($pattern, $target, $source, 1, $count); - - return $count ? $result : $target; - } - - /** - * Register a custom macro. - * - * @example - * ``` - * CarbonPeriod::macro('middle', function () { - * return $this->getStartDate()->average($this->getEndDate()); - * }); - * echo CarbonPeriod::since('2011-05-12')->until('2011-06-03')->middle(); - * ``` - * - * @param string $name - * @param object|callable $macro - * - * @return void - */ - public static function macro($name, $macro) - { - static::$macros[$name] = $macro; - } - - /** - * Register macros from a mixin object. - * - * @example - * ``` - * CarbonPeriod::mixin(new class { - * public function addDays() { - * return function ($count = 1) { - * return $this->setStartDate( - * $this->getStartDate()->addDays($count) - * )->setEndDate( - * $this->getEndDate()->addDays($count) - * ); - * }; - * } - * public function subDays() { - * return function ($count = 1) { - * return $this->setStartDate( - * $this->getStartDate()->subDays($count) - * )->setEndDate( - * $this->getEndDate()->subDays($count) - * ); - * }; - * } - * }); - * echo CarbonPeriod::create('2000-01-01', '2000-02-01')->addDays(5)->subDays(3); - * ``` - * - * @param object|string $mixin - * - * @throws ReflectionException - * - * @return void - */ - public static function mixin($mixin) - { - static::baseMixin($mixin); - } - - /** - * Check if macro is registered. - * - * @param string $name - * - * @return bool - */ - public static function hasMacro($name) - { - return isset(static::$macros[$name]); - } - - /** - * Provide static proxy for instance aliases. - * - * @param string $method - * @param array $parameters - * - * @return mixed - */ - public static function __callStatic($method, $parameters) - { - $date = new static(); - - if (static::hasMacro($method)) { - return static::bindMacroContext(null, function () use (&$method, &$parameters, &$date) { - return $date->callMacro($method, $parameters); - }); - } - - return $date->$method(...$parameters); - } - - /** - * CarbonPeriod constructor. - * - * @SuppressWarnings(PHPMD.ElseExpression) - * - * @throws InvalidArgumentException - */ - public function __construct(...$arguments) - { - // Parse and assign arguments one by one. First argument may be an ISO 8601 spec, - // which will be first parsed into parts and then processed the same way. - - $argumentsCount = \count($arguments); - - if ($argumentsCount && static::isIso8601($iso = $arguments[0])) { - array_splice($arguments, 0, 1, static::parseIso8601($iso)); - } - - if ($argumentsCount === 1) { - if ($arguments[0] instanceof DatePeriod) { - $arguments = [ - $arguments[0]->start, - $arguments[0]->end ?: ($arguments[0]->recurrences - 1), - $arguments[0]->interval, - $arguments[0]->include_start_date ? 0 : static::EXCLUDE_START_DATE, - ]; - } elseif ($arguments[0] instanceof self) { - $arguments = [ - $arguments[0]->getStartDate(), - $arguments[0]->getEndDate() ?: $arguments[0]->getRecurrences(), - $arguments[0]->getDateInterval(), - $arguments[0]->getOptions(), - ]; - } - } - - foreach ($arguments as $argument) { - $parsedDate = null; - - if ($argument instanceof DateTimeZone) { - $this->setTimezone($argument); - } elseif ($this->dateInterval === null && - ( - (\is_string($argument) && preg_match( - '/^(-?\d(\d(?![\/-])|[^\d\/-]([\/-])?)*|P[T\d].*|(?:\h*\d+(?:\.\d+)?\h*[a-z]+)+)$/i', - $argument - )) || - $argument instanceof DateInterval || - $argument instanceof Closure - ) && - $parsedInterval = @CarbonInterval::make($argument) - ) { - $this->setDateInterval($parsedInterval); - } elseif ($this->startDate === null && $parsedDate = $this->makeDateTime($argument)) { - $this->setStartDate($parsedDate); - } elseif ($this->endDate === null && ($parsedDate = $parsedDate ?? $this->makeDateTime($argument))) { - $this->setEndDate($parsedDate); - } elseif ($this->recurrences === null && $this->endDate === null && is_numeric($argument)) { - $this->setRecurrences($argument); - } elseif ($this->options === null && (\is_int($argument) || $argument === null)) { - $this->setOptions($argument); - } else { - throw new InvalidPeriodParameterException('Invalid constructor parameters.'); - } - } - - if ($this->startDate === null) { - $this->setStartDate(Carbon::now()); - } - - if ($this->dateInterval === null) { - $this->setDateInterval(CarbonInterval::day()); - - $this->isDefaultInterval = true; - } - - if ($this->options === null) { - $this->setOptions(0); - } - } - - /** - * Get a copy of the instance. - * - * @return static - */ - public function copy() - { - return clone $this; - } - - /** - * Get the getter for a property allowing both `DatePeriod` snakeCase and camelCase names. - * - * @param string $name - * - * @return callable|null - */ - protected function getGetter(string $name) - { - switch (strtolower(preg_replace('/[A-Z]/', '_$0', $name))) { - case 'start': - case 'start_date': - return [$this, 'getStartDate']; - case 'end': - case 'end_date': - return [$this, 'getEndDate']; - case 'interval': - case 'date_interval': - return [$this, 'getDateInterval']; - case 'recurrences': - return [$this, 'getRecurrences']; - case 'include_start_date': - return [$this, 'isStartIncluded']; - case 'include_end_date': - return [$this, 'isEndIncluded']; - case 'current': - return [$this, 'current']; - default: - return null; - } - } - - /** - * Get a property allowing both `DatePeriod` snakeCase and camelCase names. - * - * @param string $name - * - * @return bool|CarbonInterface|CarbonInterval|int|null - */ - public function get(string $name) - { - $getter = $this->getGetter($name); - - if ($getter) { - return $getter(); - } - - throw new UnknownGetterException($name); - } - - /** - * Get a property allowing both `DatePeriod` snakeCase and camelCase names. - * - * @param string $name - * - * @return bool|CarbonInterface|CarbonInterval|int|null - */ - public function __get(string $name) - { - return $this->get($name); - } - - /** - * Check if an attribute exists on the object - * - * @param string $name - * - * @return bool - */ - public function __isset(string $name): bool - { - return $this->getGetter($name) !== null; - } - - /** - * @alias copy - * - * Get a copy of the instance. - * - * @return static - */ - public function clone() - { - return clone $this; - } - - /** - * Set the iteration item class. - * - * @param string $dateClass - * - * @return $this - */ - public function setDateClass(string $dateClass) - { - if (!is_a($dateClass, CarbonInterface::class, true)) { - throw new NotACarbonClassException($dateClass); - } - - $this->dateClass = $dateClass; - - if (is_a($dateClass, Carbon::class, true)) { - $this->toggleOptions(static::IMMUTABLE, false); - } elseif (is_a($dateClass, CarbonImmutable::class, true)) { - $this->toggleOptions(static::IMMUTABLE, true); - } - - return $this; - } - - /** - * Returns iteration item date class. - * - * @return string - */ - public function getDateClass(): string - { - return $this->dateClass; - } - - /** - * Change the period date interval. - * - * @param DateInterval|string $interval - * - * @throws InvalidIntervalException - * - * @return $this - */ - public function setDateInterval($interval) - { - if (!$interval = CarbonInterval::make($interval)) { - throw new InvalidIntervalException('Invalid interval.'); - } - - if ($interval->spec() === 'PT0S' && !$interval->f && !$interval->getStep()) { - throw new InvalidIntervalException('Empty interval is not accepted.'); - } - - $this->dateInterval = $interval; - - $this->isDefaultInterval = false; - - $this->handleChangedParameters(); - - return $this; - } - - /** - * Invert the period date interval. - * - * @return $this - */ - public function invertDateInterval() - { - $interval = $this->dateInterval->invert(); - - return $this->setDateInterval($interval); - } - - /** - * Set start and end date. - * - * @param DateTime|DateTimeInterface|string $start - * @param DateTime|DateTimeInterface|string|null $end - * - * @return $this - */ - public function setDates($start, $end) - { - $this->setStartDate($start); - $this->setEndDate($end); - - return $this; - } - - /** - * Change the period options. - * - * @param int|null $options - * - * @throws InvalidArgumentException - * - * @return $this - */ - public function setOptions($options) - { - if (!\is_int($options) && $options !== null) { - throw new InvalidPeriodParameterException('Invalid options.'); - } - - $this->options = $options ?: 0; - - $this->handleChangedParameters(); - - return $this; - } - - /** - * Get the period options. - * - * @return int - */ - public function getOptions() - { - return $this->options; - } - - /** - * Toggle given options on or off. - * - * @param int $options - * @param bool|null $state - * - * @throws \InvalidArgumentException - * - * @return $this - */ - public function toggleOptions($options, $state = null) - { - if ($state === null) { - $state = ($this->options & $options) !== $options; - } - - return $this->setOptions( - $state ? - $this->options | $options : - $this->options & ~$options - ); - } - - /** - * Toggle EXCLUDE_START_DATE option. - * - * @param bool $state - * - * @return $this - */ - public function excludeStartDate($state = true) - { - return $this->toggleOptions(static::EXCLUDE_START_DATE, $state); - } - - /** - * Toggle EXCLUDE_END_DATE option. - * - * @param bool $state - * - * @return $this - */ - public function excludeEndDate($state = true) - { - return $this->toggleOptions(static::EXCLUDE_END_DATE, $state); - } - - /** - * Get the underlying date interval. - * - * @return CarbonInterval - */ - public function getDateInterval() - { - return $this->dateInterval->copy(); - } - - /** - * Get start date of the period. - * - * @param string|null $rounding Optional rounding 'floor', 'ceil', 'round' using the period interval. - * - * @return CarbonInterface - */ - public function getStartDate(string $rounding = null) - { - $date = $this->startDate->avoidMutation(); - - return $rounding ? $date->round($this->getDateInterval(), $rounding) : $date; - } - - /** - * Get end date of the period. - * - * @param string|null $rounding Optional rounding 'floor', 'ceil', 'round' using the period interval. - * - * @return CarbonInterface|null - */ - public function getEndDate(string $rounding = null) - { - if (!$this->endDate) { - return null; - } - - $date = $this->endDate->avoidMutation(); - - return $rounding ? $date->round($this->getDateInterval(), $rounding) : $date; - } - - /** - * Get number of recurrences. - * - * @return int|float|null - */ - public function getRecurrences() - { - return $this->recurrences; - } - - /** - * Returns true if the start date should be excluded. - * - * @return bool - */ - public function isStartExcluded() - { - return ($this->options & static::EXCLUDE_START_DATE) !== 0; - } - - /** - * Returns true if the end date should be excluded. - * - * @return bool - */ - public function isEndExcluded() - { - return ($this->options & static::EXCLUDE_END_DATE) !== 0; - } - - /** - * Returns true if the start date should be included. - * - * @return bool - */ - public function isStartIncluded() - { - return !$this->isStartExcluded(); - } - - /** - * Returns true if the end date should be included. - * - * @return bool - */ - public function isEndIncluded() - { - return !$this->isEndExcluded(); - } - - /** - * Return the start if it's included by option, else return the start + 1 period interval. - * - * @return CarbonInterface - */ - public function getIncludedStartDate() - { - $start = $this->getStartDate(); - - if ($this->isStartExcluded()) { - return $start->add($this->getDateInterval()); - } - - return $start; - } - - /** - * Return the end if it's included by option, else return the end - 1 period interval. - * Warning: if the period has no fixed end, this method will iterate the period to calculate it. - * - * @return CarbonInterface - */ - public function getIncludedEndDate() - { - $end = $this->getEndDate(); - - if (!$end) { - return $this->calculateEnd(); - } - - if ($this->isEndExcluded()) { - return $end->sub($this->getDateInterval()); - } - - return $end; - } - - /** - * Add a filter to the stack. - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - * - * @param callable $callback - * @param string $name - * - * @return $this - */ - public function addFilter($callback, $name = null) - { - $tuple = $this->createFilterTuple(\func_get_args()); - - $this->filters[] = $tuple; - - $this->handleChangedParameters(); - - return $this; - } - - /** - * Prepend a filter to the stack. - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - * - * @param callable $callback - * @param string $name - * - * @return $this - */ - public function prependFilter($callback, $name = null) - { - $tuple = $this->createFilterTuple(\func_get_args()); - - array_unshift($this->filters, $tuple); - - $this->handleChangedParameters(); - - return $this; - } - - /** - * Remove a filter by instance or name. - * - * @param callable|string $filter - * - * @return $this - */ - public function removeFilter($filter) - { - $key = \is_callable($filter) ? 0 : 1; - - $this->filters = array_values(array_filter( - $this->filters, - function ($tuple) use ($key, $filter) { - return $tuple[$key] !== $filter; - } - )); - - $this->updateInternalState(); - - $this->handleChangedParameters(); - - return $this; - } - - /** - * Return whether given instance or name is in the filter stack. - * - * @param callable|string $filter - * - * @return bool - */ - public function hasFilter($filter) - { - $key = \is_callable($filter) ? 0 : 1; - - foreach ($this->filters as $tuple) { - if ($tuple[$key] === $filter) { - return true; - } - } - - return false; - } - - /** - * Get filters stack. - * - * @return array - */ - public function getFilters() - { - return $this->filters; - } - - /** - * Set filters stack. - * - * @param array $filters - * - * @return $this - */ - public function setFilters(array $filters) - { - $this->filters = $filters; - - $this->updateInternalState(); - - $this->handleChangedParameters(); - - return $this; - } - - /** - * Reset filters stack. - * - * @return $this - */ - public function resetFilters() - { - $this->filters = []; - - if ($this->endDate !== null) { - $this->filters[] = [static::END_DATE_FILTER, null]; - } - - if ($this->recurrences !== null) { - $this->filters[] = [static::RECURRENCES_FILTER, null]; - } - - $this->handleChangedParameters(); - - return $this; - } - - /** - * Add a recurrences filter (set maximum number of recurrences). - * - * @param int|float|null $recurrences - * - * @throws InvalidArgumentException - * - * @return $this - */ - public function setRecurrences($recurrences) - { - if ((!is_numeric($recurrences) && $recurrences !== null) || $recurrences < 0) { - throw new InvalidPeriodParameterException('Invalid number of recurrences.'); - } - - if ($recurrences === null) { - return $this->removeFilter(static::RECURRENCES_FILTER); - } - - $this->recurrences = $recurrences === INF ? INF : (int) $recurrences; - - if (!$this->hasFilter(static::RECURRENCES_FILTER)) { - return $this->addFilter(static::RECURRENCES_FILTER); - } - - $this->handleChangedParameters(); - - return $this; - } - - /** - * Change the period start date. - * - * @param DateTime|DateTimeInterface|string $date - * @param bool|null $inclusive - * - * @throws InvalidPeriodDateException - * - * @return $this - */ - public function setStartDate($date, $inclusive = null) - { - if (!$this->isInfiniteDate($date) && !($date = ([$this->dateClass, 'make'])($date))) { - throw new InvalidPeriodDateException('Invalid start date.'); - } - - $this->startDate = $date; - - if ($inclusive !== null) { - $this->toggleOptions(static::EXCLUDE_START_DATE, !$inclusive); - } - - return $this; - } - - /** - * Change the period end date. - * - * @param DateTime|DateTimeInterface|string|null $date - * @param bool|null $inclusive - * - * @throws \InvalidArgumentException - * - * @return $this - */ - public function setEndDate($date, $inclusive = null) - { - if ($date !== null && !$this->isInfiniteDate($date) && !$date = ([$this->dateClass, 'make'])($date)) { - throw new InvalidPeriodDateException('Invalid end date.'); - } - - if (!$date) { - return $this->removeFilter(static::END_DATE_FILTER); - } - - $this->endDate = $date; - - if ($inclusive !== null) { - $this->toggleOptions(static::EXCLUDE_END_DATE, !$inclusive); - } - - if (!$this->hasFilter(static::END_DATE_FILTER)) { - return $this->addFilter(static::END_DATE_FILTER); - } - - $this->handleChangedParameters(); - - return $this; - } - - /** - * Check if the current position is valid. - * - * @return bool - */ - #[ReturnTypeWillChange] - public function valid() - { - return $this->validateCurrentDate() === true; - } - - /** - * Return the current key. - * - * @return int|null - */ - #[ReturnTypeWillChange] - public function key() - { - return $this->valid() - ? $this->key - : null; - } - - /** - * Return the current date. - * - * @return CarbonInterface|null - */ - #[ReturnTypeWillChange] - public function current() - { - return $this->valid() - ? $this->prepareForReturn($this->current) - : null; - } - - /** - * Move forward to the next date. - * - * @throws RuntimeException - * - * @return void - */ - #[ReturnTypeWillChange] - public function next() - { - if ($this->current === null) { - $this->rewind(); - } - - if ($this->validationResult !== static::END_ITERATION) { - $this->key++; - - $this->incrementCurrentDateUntilValid(); - } - } - - /** - * Rewind to the start date. - * - * Iterating over a date in the UTC timezone avoids bug during backward DST change. - * - * @see https://bugs.php.net/bug.php?id=72255 - * @see https://bugs.php.net/bug.php?id=74274 - * @see https://wiki.php.net/rfc/datetime_and_daylight_saving_time - * - * @throws RuntimeException - * - * @return void - */ - #[ReturnTypeWillChange] - public function rewind() - { - $this->key = 0; - $this->current = ([$this->dateClass, 'make'])($this->startDate); - $settings = $this->getSettings(); - - if ($this->hasLocalTranslator()) { - $settings['locale'] = $this->getTranslatorLocale(); - } - - $this->current->settings($settings); - $this->timezone = static::intervalHasTime($this->dateInterval) ? $this->current->getTimezone() : null; - - if ($this->timezone) { - $this->current = $this->current->utc(); - } - - $this->validationResult = null; - - if ($this->isStartExcluded() || $this->validateCurrentDate() === false) { - $this->incrementCurrentDateUntilValid(); - } - } - - /** - * Skip iterations and returns iteration state (false if ended, true if still valid). - * - * @param int $count steps number to skip (1 by default) - * - * @return bool - */ - public function skip($count = 1) - { - for ($i = $count; $this->valid() && $i > 0; $i--) { - $this->next(); - } - - return $this->valid(); - } - - /** - * Format the date period as ISO 8601. - * - * @return string - */ - public function toIso8601String() - { - $parts = []; - - if ($this->recurrences !== null) { - $parts[] = 'R'.$this->recurrences; - } - - $parts[] = $this->startDate->toIso8601String(); - - $parts[] = $this->dateInterval->spec(); - - if ($this->endDate !== null) { - $parts[] = $this->endDate->toIso8601String(); - } - - return implode('/', $parts); - } - - /** - * Convert the date period into a string. - * - * @return string - */ - public function toString() - { - $format = $this->localToStringFormat ?? static::$toStringFormat; - - if ($format instanceof Closure) { - return $format($this); - } - - $translator = ([$this->dateClass, 'getTranslator'])(); - - $parts = []; - - $format = $format ?? ( - !$this->startDate->isStartOfDay() || ($this->endDate && !$this->endDate->isStartOfDay()) - ? 'Y-m-d H:i:s' - : 'Y-m-d' - ); - - if ($this->recurrences !== null) { - $parts[] = $this->translate('period_recurrences', [], $this->recurrences, $translator); - } - - $parts[] = $this->translate('period_interval', [':interval' => $this->dateInterval->forHumans([ - 'join' => true, - ])], null, $translator); - - $parts[] = $this->translate('period_start_date', [':date' => $this->startDate->rawFormat($format)], null, $translator); - - if ($this->endDate !== null) { - $parts[] = $this->translate('period_end_date', [':date' => $this->endDate->rawFormat($format)], null, $translator); - } - - $result = implode(' ', $parts); - - return mb_strtoupper(mb_substr($result, 0, 1)).mb_substr($result, 1); - } - - /** - * Format the date period as ISO 8601. - * - * @return string - */ - public function spec() - { - return $this->toIso8601String(); - } - - /** - * Cast the current instance into the given class. - * - * @param string $className The $className::instance() method will be called to cast the current object. - * - * @return DatePeriod - */ - public function cast(string $className) - { - if (!method_exists($className, 'instance')) { - if (is_a($className, DatePeriod::class, true)) { - return new $className( - $this->rawDate($this->getStartDate()), - $this->getDateInterval(), - $this->getEndDate() ? $this->rawDate($this->getIncludedEndDate()) : $this->getRecurrences(), - $this->isStartExcluded() ? DatePeriod::EXCLUDE_START_DATE : 0 - ); - } - - throw new InvalidCastException("$className has not the instance() method needed to cast the date."); - } - - return $className::instance($this); - } - - /** - * Return native DatePeriod PHP object matching the current instance. - * - * @example - * ``` - * var_dump(CarbonPeriod::create('2021-01-05', '2021-02-15')->toDatePeriod()); - * ``` - * - * @return DatePeriod - */ - public function toDatePeriod() - { - return $this->cast(DatePeriod::class); - } - - /** - * Return `true` if the period has no custom filter and is guaranteed to be endless. - * - * Note that we can't check if a period is endless as soon as it has custom filters - * because filters can emit `CarbonPeriod::END_ITERATION` to stop the iteration in - * a way we can't predict without actually iterating the period. - */ - public function isUnfilteredAndEndLess(): bool - { - foreach ($this->filters as $filter) { - switch ($filter) { - case [static::RECURRENCES_FILTER, null]: - if ($this->recurrences !== null && is_finite($this->recurrences)) { - return false; - } - - break; - - case [static::END_DATE_FILTER, null]: - if ($this->endDate !== null && !$this->endDate->isEndOfTime()) { - return false; - } - - break; - - default: - return false; - } - } - - return true; - } - - /** - * Convert the date period into an array without changing current iteration state. - * - * @return CarbonInterface[] - */ - public function toArray() - { - if ($this->isUnfilteredAndEndLess()) { - throw new EndLessPeriodException("Endless period can't be converted to array nor counted."); - } - - $state = [ - $this->key, - $this->current ? $this->current->avoidMutation() : null, - $this->validationResult, - ]; - - $result = iterator_to_array($this); - - [$this->key, $this->current, $this->validationResult] = $state; - - return $result; - } - - /** - * Count dates in the date period. - * - * @return int - */ - #[ReturnTypeWillChange] - public function count() - { - return \count($this->toArray()); - } - - /** - * Return the first date in the date period. - * - * @return CarbonInterface|null - */ - public function first() - { - if ($this->isUnfilteredAndEndLess()) { - foreach ($this as $date) { - $this->rewind(); - - return $date; - } - - return null; - } - - return ($this->toArray() ?: [])[0] ?? null; - } - - /** - * Return the last date in the date period. - * - * @return CarbonInterface|null - */ - public function last() - { - $array = $this->toArray(); - - return $array ? $array[\count($array) - 1] : null; - } - - /** - * Convert the date period into a string. - * - * @return string - */ - public function __toString() - { - return $this->toString(); - } - - /** - * Add aliases for setters. - * - * CarbonPeriod::days(3)->hours(5)->invert() - * ->sinceNow()->until('2010-01-10') - * ->filter(...) - * ->count() - * - * Note: We use magic method to let static and instance aliases with the same names. - * - * @param string $method - * @param array $parameters - * - * @return mixed - */ - public function __call($method, $parameters) - { - if (static::hasMacro($method)) { - return static::bindMacroContext($this, function () use (&$method, &$parameters) { - return $this->callMacro($method, $parameters); - }); - } - - $roundedValue = $this->callRoundMethod($method, $parameters); - - if ($roundedValue !== null) { - return $roundedValue; - } - - switch ($method) { - case 'start': - case 'since': - self::setDefaultParameters($parameters, [ - [0, 'date', null], - ]); - - return $this->setStartDate(...$parameters); - - case 'sinceNow': - return $this->setStartDate(new Carbon(), ...$parameters); - - case 'end': - case 'until': - self::setDefaultParameters($parameters, [ - [0, 'date', null], - ]); - - return $this->setEndDate(...$parameters); - - case 'untilNow': - return $this->setEndDate(new Carbon(), ...$parameters); - - case 'dates': - case 'between': - self::setDefaultParameters($parameters, [ - [0, 'start', null], - [1, 'end', null], - ]); - - return $this->setDates(...$parameters); - - case 'recurrences': - case 'times': - self::setDefaultParameters($parameters, [ - [0, 'recurrences', null], - ]); - - return $this->setRecurrences(...$parameters); - - case 'options': - self::setDefaultParameters($parameters, [ - [0, 'options', null], - ]); - - return $this->setOptions(...$parameters); - - case 'toggle': - self::setDefaultParameters($parameters, [ - [0, 'options', null], - ]); - - return $this->toggleOptions(...$parameters); - - case 'filter': - case 'push': - return $this->addFilter(...$parameters); - - case 'prepend': - return $this->prependFilter(...$parameters); - - case 'filters': - self::setDefaultParameters($parameters, [ - [0, 'filters', []], - ]); - - return $this->setFilters(...$parameters); - - case 'interval': - case 'each': - case 'every': - case 'step': - case 'stepBy': - return $this->setDateInterval(...$parameters); - - case 'invert': - return $this->invertDateInterval(); - - case 'years': - case 'year': - case 'months': - case 'month': - case 'weeks': - case 'week': - case 'days': - case 'dayz': - case 'day': - case 'hours': - case 'hour': - case 'minutes': - case 'minute': - case 'seconds': - case 'second': - return $this->setDateInterval(( - // Override default P1D when instantiating via fluent setters. - [$this->isDefaultInterval ? new CarbonInterval('PT0S') : $this->dateInterval, $method] - )(...$parameters)); - } - - if ($this->localStrictModeEnabled ?? Carbon::isStrictModeEnabled()) { - throw new UnknownMethodException($method); - } - - return $this; - } - - /** - * Set the instance's timezone from a string or object and apply it to start/end. - * - * @param \DateTimeZone|string $timezone - * - * @return static - */ - public function setTimezone($timezone) - { - $this->tzName = $timezone; - $this->timezone = $timezone; - - if ($this->startDate) { - $this->setStartDate($this->startDate->setTimezone($timezone)); - } - - if ($this->endDate) { - $this->setEndDate($this->endDate->setTimezone($timezone)); - } - - return $this; - } - - /** - * Set the instance's timezone from a string or object and add/subtract the offset difference to start/end. - * - * @param \DateTimeZone|string $timezone - * - * @return static - */ - public function shiftTimezone($timezone) - { - $this->tzName = $timezone; - $this->timezone = $timezone; - - if ($this->startDate) { - $this->setStartDate($this->startDate->shiftTimezone($timezone)); - } - - if ($this->endDate) { - $this->setEndDate($this->endDate->shiftTimezone($timezone)); - } - - return $this; - } - - /** - * Returns the end is set, else calculated from start an recurrences. - * - * @param string|null $rounding Optional rounding 'floor', 'ceil', 'round' using the period interval. - * - * @return CarbonInterface - */ - public function calculateEnd(string $rounding = null) - { - if ($end = $this->getEndDate($rounding)) { - return $end; - } - - if ($this->dateInterval->isEmpty()) { - return $this->getStartDate($rounding); - } - - $date = $this->getEndFromRecurrences() ?? $this->iterateUntilEnd(); - - if ($date && $rounding) { - $date = $date->avoidMutation()->round($this->getDateInterval(), $rounding); - } - - return $date; - } - - /** - * @return CarbonInterface|null - */ - private function getEndFromRecurrences() - { - if ($this->recurrences === null) { - throw new UnreachableException( - "Could not calculate period end without either explicit end or recurrences.\n". - "If you're looking for a forever-period, use ->setRecurrences(INF)." - ); - } - - if ($this->recurrences === INF) { - $start = $this->getStartDate(); - - return $start < $start->avoidMutation()->add($this->getDateInterval()) - ? CarbonImmutable::endOfTime() - : CarbonImmutable::startOfTime(); - } - - if ($this->filters === [[static::RECURRENCES_FILTER, null]]) { - return $this->getStartDate()->avoidMutation()->add( - $this->getDateInterval()->times( - $this->recurrences - ($this->isStartExcluded() ? 0 : 1) - ) - ); - } - - return null; - } - - /** - * @return CarbonInterface|null - */ - private function iterateUntilEnd() - { - $attempts = 0; - $date = null; - - foreach ($this as $date) { - if (++$attempts > static::END_MAX_ATTEMPTS) { - throw new UnreachableException( - 'Could not calculate period end after iterating '.static::END_MAX_ATTEMPTS.' times.' - ); - } - } - - return $date; - } - - /** - * Returns true if the current period overlaps the given one (if 1 parameter passed) - * or the period between 2 dates (if 2 parameters passed). - * - * @param CarbonPeriod|\DateTimeInterface|Carbon|CarbonImmutable|string $rangeOrRangeStart - * @param \DateTimeInterface|Carbon|CarbonImmutable|string|null $rangeEnd - * - * @return bool - */ - public function overlaps($rangeOrRangeStart, $rangeEnd = null) - { - $range = $rangeEnd ? static::create($rangeOrRangeStart, $rangeEnd) : $rangeOrRangeStart; - - if (!($range instanceof self)) { - $range = static::create($range); - } - - [$start, $end] = $this->orderCouple($this->getStartDate(), $this->calculateEnd()); - [$rangeStart, $rangeEnd] = $this->orderCouple($range->getStartDate(), $range->calculateEnd()); - - return $end > $rangeStart && $rangeEnd > $start; - } - - /** - * Execute a given function on each date of the period. - * - * @example - * ``` - * Carbon::create('2020-11-29')->daysUntil('2020-12-24')->forEach(function (Carbon $date) { - * echo $date->diffInDays('2020-12-25')." days before Christmas!\n"; - * }); - * ``` - * - * @param callable $callback - */ - public function forEach(callable $callback) - { - foreach ($this as $date) { - $callback($date); - } - } - - /** - * Execute a given function on each date of the period and yield the result of this function. - * - * @example - * ``` - * $period = Carbon::create('2020-11-29')->daysUntil('2020-12-24'); - * echo implode("\n", iterator_to_array($period->map(function (Carbon $date) { - * return $date->diffInDays('2020-12-25').' days before Christmas!'; - * }))); - * ``` - * - * @param callable $callback - * - * @return \Generator - */ - public function map(callable $callback) - { - foreach ($this as $date) { - yield $callback($date); - } - } - - /** - * Determines if the instance is equal to another. - * Warning: if options differ, instances wil never be equal. - * - * @param mixed $period - * - * @see equalTo() - * - * @return bool - */ - public function eq($period): bool - { - return $this->equalTo($period); - } - - /** - * Determines if the instance is equal to another. - * Warning: if options differ, instances wil never be equal. - * - * @param mixed $period - * - * @return bool - */ - public function equalTo($period): bool - { - if (!($period instanceof self)) { - $period = self::make($period); - } - - $end = $this->getEndDate(); - - return $period !== null - && $this->getDateInterval()->eq($period->getDateInterval()) - && $this->getStartDate()->eq($period->getStartDate()) - && ($end ? $end->eq($period->getEndDate()) : $this->getRecurrences() === $period->getRecurrences()) - && ($this->getOptions() & (~static::IMMUTABLE)) === ($period->getOptions() & (~static::IMMUTABLE)); - } - - /** - * Determines if the instance is not equal to another. - * Warning: if options differ, instances wil never be equal. - * - * @param mixed $period - * - * @see notEqualTo() - * - * @return bool - */ - public function ne($period): bool - { - return $this->notEqualTo($period); - } - - /** - * Determines if the instance is not equal to another. - * Warning: if options differ, instances wil never be equal. - * - * @param mixed $period - * - * @return bool - */ - public function notEqualTo($period): bool - { - return !$this->eq($period); - } - - /** - * Determines if the start date is before an other given date. - * (Rather start/end are included by options is ignored.) - * - * @param mixed $date - * - * @return bool - */ - public function startsBefore($date = null): bool - { - return $this->getStartDate()->lessThan($this->resolveCarbon($date)); - } - - /** - * Determines if the start date is before or the same as a given date. - * (Rather start/end are included by options is ignored.) - * - * @param mixed $date - * - * @return bool - */ - public function startsBeforeOrAt($date = null): bool - { - return $this->getStartDate()->lessThanOrEqualTo($this->resolveCarbon($date)); - } - - /** - * Determines if the start date is after an other given date. - * (Rather start/end are included by options is ignored.) - * - * @param mixed $date - * - * @return bool - */ - public function startsAfter($date = null): bool - { - return $this->getStartDate()->greaterThan($this->resolveCarbon($date)); - } - - /** - * Determines if the start date is after or the same as a given date. - * (Rather start/end are included by options is ignored.) - * - * @param mixed $date - * - * @return bool - */ - public function startsAfterOrAt($date = null): bool - { - return $this->getStartDate()->greaterThanOrEqualTo($this->resolveCarbon($date)); - } - - /** - * Determines if the start date is the same as a given date. - * (Rather start/end are included by options is ignored.) - * - * @param mixed $date - * - * @return bool - */ - public function startsAt($date = null): bool - { - return $this->getStartDate()->equalTo($this->resolveCarbon($date)); - } - - /** - * Determines if the end date is before an other given date. - * (Rather start/end are included by options is ignored.) - * - * @param mixed $date - * - * @return bool - */ - public function endsBefore($date = null): bool - { - return $this->calculateEnd()->lessThan($this->resolveCarbon($date)); - } - - /** - * Determines if the end date is before or the same as a given date. - * (Rather start/end are included by options is ignored.) - * - * @param mixed $date - * - * @return bool - */ - public function endsBeforeOrAt($date = null): bool - { - return $this->calculateEnd()->lessThanOrEqualTo($this->resolveCarbon($date)); - } - - /** - * Determines if the end date is after an other given date. - * (Rather start/end are included by options is ignored.) - * - * @param mixed $date - * - * @return bool - */ - public function endsAfter($date = null): bool - { - return $this->calculateEnd()->greaterThan($this->resolveCarbon($date)); - } - - /** - * Determines if the end date is after or the same as a given date. - * (Rather start/end are included by options is ignored.) - * - * @param mixed $date - * - * @return bool - */ - public function endsAfterOrAt($date = null): bool - { - return $this->calculateEnd()->greaterThanOrEqualTo($this->resolveCarbon($date)); - } - - /** - * Determines if the end date is the same as a given date. - * (Rather start/end are included by options is ignored.) - * - * @param mixed $date - * - * @return bool - */ - public function endsAt($date = null): bool - { - return $this->calculateEnd()->equalTo($this->resolveCarbon($date)); - } - - /** - * Return true if start date is now or later. - * (Rather start/end are included by options is ignored.) - * - * @return bool - */ - public function isStarted(): bool - { - return $this->startsBeforeOrAt(); - } - - /** - * Return true if end date is now or later. - * (Rather start/end are included by options is ignored.) - * - * @return bool - */ - public function isEnded(): bool - { - return $this->endsBeforeOrAt(); - } - - /** - * Return true if now is between start date (included) and end date (excluded). - * (Rather start/end are included by options is ignored.) - * - * @return bool - */ - public function isInProgress(): bool - { - return $this->isStarted() && !$this->isEnded(); - } - - /** - * Round the current instance at the given unit with given precision if specified and the given function. - * - * @param string $unit - * @param float|int|string|\DateInterval|null $precision - * @param string $function - * - * @return $this - */ - public function roundUnit($unit, $precision = 1, $function = 'round') - { - $this->setStartDate($this->getStartDate()->roundUnit($unit, $precision, $function)); - - if ($this->endDate) { - $this->setEndDate($this->getEndDate()->roundUnit($unit, $precision, $function)); - } - - $this->setDateInterval($this->getDateInterval()->roundUnit($unit, $precision, $function)); - - return $this; - } - - /** - * Truncate the current instance at the given unit with given precision if specified. - * - * @param string $unit - * @param float|int|string|\DateInterval|null $precision - * - * @return $this - */ - public function floorUnit($unit, $precision = 1) - { - return $this->roundUnit($unit, $precision, 'floor'); - } - - /** - * Ceil the current instance at the given unit with given precision if specified. - * - * @param string $unit - * @param float|int|string|\DateInterval|null $precision - * - * @return $this - */ - public function ceilUnit($unit, $precision = 1) - { - return $this->roundUnit($unit, $precision, 'ceil'); - } - - /** - * Round the current instance second with given precision if specified (else period interval is used). - * - * @param float|int|string|\DateInterval|null $precision - * @param string $function - * - * @return $this - */ - public function round($precision = null, $function = 'round') - { - return $this->roundWith( - $precision ?? $this->getDateInterval()->setLocalTranslator(TranslatorImmutable::get('en'))->forHumans(), - $function - ); - } - - /** - * Round the current instance second with given precision if specified (else period interval is used). - * - * @param float|int|string|\DateInterval|null $precision - * - * @return $this - */ - public function floor($precision = null) - { - return $this->round($precision, 'floor'); - } - - /** - * Ceil the current instance second with given precision if specified (else period interval is used). - * - * @param float|int|string|\DateInterval|null $precision - * - * @return $this - */ - public function ceil($precision = null) - { - return $this->round($precision, 'ceil'); - } - - /** - * Specify data which should be serialized to JSON. - * - * @link https://php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return CarbonInterface[] - */ - #[ReturnTypeWillChange] - public function jsonSerialize() - { - return $this->toArray(); - } - - /** - * Return true if the given date is between start and end. - * - * @param \Carbon\Carbon|\Carbon\CarbonPeriod|\Carbon\CarbonInterval|\DateInterval|\DatePeriod|\DateTimeInterface|string|null $date - * - * @return bool - */ - public function contains($date = null): bool - { - $startMethod = 'startsBefore'.($this->isStartIncluded() ? 'OrAt' : ''); - $endMethod = 'endsAfter'.($this->isEndIncluded() ? 'OrAt' : ''); - - return $this->$startMethod($date) && $this->$endMethod($date); - } - - /** - * Return true if the current period follows a given other period (with no overlap). - * For instance, [2019-08-01 -> 2019-08-12] follows [2019-07-29 -> 2019-07-31] - * Note than in this example, follows() would be false if 2019-08-01 or 2019-07-31 was excluded by options. - * - * @param \Carbon\CarbonPeriod|\DatePeriod|string $period - * - * @return bool - */ - public function follows($period, ...$arguments): bool - { - $period = $this->resolveCarbonPeriod($period, ...$arguments); - - return $this->getIncludedStartDate()->equalTo($period->getIncludedEndDate()->add($period->getDateInterval())); - } - - /** - * Return true if the given other period follows the current one (with no overlap). - * For instance, [2019-07-29 -> 2019-07-31] is followed by [2019-08-01 -> 2019-08-12] - * Note than in this example, isFollowedBy() would be false if 2019-08-01 or 2019-07-31 was excluded by options. - * - * @param \Carbon\CarbonPeriod|\DatePeriod|string $period - * - * @return bool - */ - public function isFollowedBy($period, ...$arguments): bool - { - $period = $this->resolveCarbonPeriod($period, ...$arguments); - - return $period->follows($this); - } - - /** - * Return true if the given period either follows or is followed by the current one. - * - * @see follows() - * @see isFollowedBy() - * - * @param \Carbon\CarbonPeriod|\DatePeriod|string $period - * - * @return bool - */ - public function isConsecutiveWith($period, ...$arguments): bool - { - return $this->follows($period, ...$arguments) || $this->isFollowedBy($period, ...$arguments); - } - - /** - * Update properties after removing built-in filters. - * - * @return void - */ - protected function updateInternalState() - { - if (!$this->hasFilter(static::END_DATE_FILTER)) { - $this->endDate = null; - } - - if (!$this->hasFilter(static::RECURRENCES_FILTER)) { - $this->recurrences = null; - } - } - - /** - * Create a filter tuple from raw parameters. - * - * Will create an automatic filter callback for one of Carbon's is* methods. - * - * @param array $parameters - * - * @return array - */ - protected function createFilterTuple(array $parameters) - { - $method = array_shift($parameters); - - if (!$this->isCarbonPredicateMethod($method)) { - return [$method, array_shift($parameters)]; - } - - return [function ($date) use ($method, $parameters) { - return ([$date, $method])(...$parameters); - }, $method]; - } - - /** - * Return whether given callable is a string pointing to one of Carbon's is* methods - * and should be automatically converted to a filter callback. - * - * @param callable $callable - * - * @return bool - */ - protected function isCarbonPredicateMethod($callable) - { - return \is_string($callable) && str_starts_with($callable, 'is') && - (method_exists($this->dateClass, $callable) || ([$this->dateClass, 'hasMacro'])($callable)); - } - - /** - * Recurrences filter callback (limits number of recurrences). - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - * - * @param \Carbon\Carbon $current - * @param int $key - * - * @return bool|string - */ - protected function filterRecurrences($current, $key) - { - if ($key < $this->recurrences) { - return true; - } - - return static::END_ITERATION; - } - - /** - * End date filter callback. - * - * @param \Carbon\Carbon $current - * - * @return bool|string - */ - protected function filterEndDate($current) - { - if (!$this->isEndExcluded() && $current == $this->endDate) { - return true; - } - - if ($this->dateInterval->invert ? $current > $this->endDate : $current < $this->endDate) { - return true; - } - - return static::END_ITERATION; - } - - /** - * End iteration filter callback. - * - * @return string - */ - protected function endIteration() - { - return static::END_ITERATION; - } - - /** - * Handle change of the parameters. - */ - protected function handleChangedParameters() - { - if (($this->getOptions() & static::IMMUTABLE) && $this->dateClass === Carbon::class) { - $this->setDateClass(CarbonImmutable::class); - } elseif (!($this->getOptions() & static::IMMUTABLE) && $this->dateClass === CarbonImmutable::class) { - $this->setDateClass(Carbon::class); - } - - $this->validationResult = null; - } - - /** - * Validate current date and stop iteration when necessary. - * - * Returns true when current date is valid, false if it is not, or static::END_ITERATION - * when iteration should be stopped. - * - * @return bool|string - */ - protected function validateCurrentDate() - { - if ($this->current === null) { - $this->rewind(); - } - - // Check after the first rewind to avoid repeating the initial validation. - return $this->validationResult ?? ($this->validationResult = $this->checkFilters()); - } - - /** - * Check whether current value and key pass all the filters. - * - * @return bool|string - */ - protected function checkFilters() - { - $current = $this->prepareForReturn($this->current); - - foreach ($this->filters as $tuple) { - $result = \call_user_func( - $tuple[0], - $current->avoidMutation(), - $this->key, - $this - ); - - if ($result === static::END_ITERATION) { - return static::END_ITERATION; - } - - if (!$result) { - return false; - } - } - - return true; - } - - /** - * Prepare given date to be returned to the external logic. - * - * @param CarbonInterface $date - * - * @return CarbonInterface - */ - protected function prepareForReturn(CarbonInterface $date) - { - $date = ([$this->dateClass, 'make'])($date); - - if ($this->timezone) { - $date = $date->setTimezone($this->timezone); - } - - return $date; - } - - /** - * Keep incrementing the current date until a valid date is found or the iteration is ended. - * - * @throws RuntimeException - * - * @return void - */ - protected function incrementCurrentDateUntilValid() - { - $attempts = 0; - - do { - $this->current = $this->current->add($this->dateInterval); - - $this->validationResult = null; - - if (++$attempts > static::NEXT_MAX_ATTEMPTS) { - throw new UnreachableException('Could not find next valid date.'); - } - } while ($this->validateCurrentDate() === false); - } - - /** - * Call given macro. - * - * @param string $name - * @param array $parameters - * - * @return mixed - */ - protected function callMacro($name, $parameters) - { - $macro = static::$macros[$name]; - - if ($macro instanceof Closure) { - $boundMacro = @$macro->bindTo($this, static::class) ?: @$macro->bindTo(null, static::class); - - return ($boundMacro ?: $macro)(...$parameters); - } - - return $macro(...$parameters); - } - - /** - * Return the Carbon instance passed through, a now instance in the same timezone - * if null given or parse the input if string given. - * - * @param \Carbon\Carbon|\Carbon\CarbonPeriod|\Carbon\CarbonInterval|\DateInterval|\DatePeriod|\DateTimeInterface|string|null $date - * - * @return \Carbon\CarbonInterface - */ - protected function resolveCarbon($date = null) - { - return $this->getStartDate()->nowWithSameTz()->carbonize($date); - } - - /** - * Resolve passed arguments or DatePeriod to a CarbonPeriod object. - * - * @param mixed $period - * @param mixed ...$arguments - * - * @return static - */ - protected function resolveCarbonPeriod($period, ...$arguments) - { - if ($period instanceof self) { - return $period; - } - - return $period instanceof DatePeriod - ? static::instance($period) - : static::create($period, ...$arguments); - } - - private function orderCouple($first, $second): array - { - return $first > $second ? [$second, $first] : [$first, $second]; - } - - private function makeDateTime($value): ?DateTimeInterface - { - if ($value instanceof DateTimeInterface) { - return $value; - } - - if (\is_string($value)) { - $value = trim($value); - - if (!preg_match('/^P[\dT]/', $value) && - !preg_match('/^R\d/', $value) && - preg_match('/[a-z\d]/i', $value) - ) { - return Carbon::parse($value, $this->tzName); - } - } - - return null; - } - - private function isInfiniteDate($date): bool - { - return $date instanceof CarbonInterface && ($date->isEndOfTime() || $date->isStartOfTime()); - } - - private function rawDate($date): ?DateTimeInterface - { - if ($date === false || $date === null) { - return null; - } - - if ($date instanceof CarbonInterface) { - return $date->isMutable() - ? $date->toDateTime() - : $date->toDateTimeImmutable(); - } - - if (\in_array(\get_class($date), [DateTime::class, DateTimeImmutable::class], true)) { - return $date; - } - - $class = $date instanceof DateTime ? DateTime::class : DateTimeImmutable::class; - - return new $class($date->format('Y-m-d H:i:s.u'), $date->getTimezone()); - } - - private static function setDefaultParameters(array &$parameters, array $defaults): void - { - foreach ($defaults as [$index, $name, $value]) { - if (!\array_key_exists($index, $parameters) && !\array_key_exists($name, $parameters)) { - $parameters[$index] = $value; - } - } - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/CarbonTimeZone.php b/vendor/nesbot/carbon/src/Carbon/CarbonTimeZone.php deleted file mode 100644 index c81899f1..00000000 --- a/vendor/nesbot/carbon/src/Carbon/CarbonTimeZone.php +++ /dev/null @@ -1,320 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon; - -use Carbon\Exceptions\InvalidCastException; -use Carbon\Exceptions\InvalidTimeZoneException; -use DateTimeInterface; -use DateTimeZone; -use Throwable; - -class CarbonTimeZone extends DateTimeZone -{ - public function __construct($timezone = null) - { - parent::__construct(static::getDateTimeZoneNameFromMixed($timezone)); - } - - protected static function parseNumericTimezone($timezone) - { - if ($timezone <= -100 || $timezone >= 100) { - throw new InvalidTimeZoneException('Absolute timezone offset cannot be greater than 100.'); - } - - return ($timezone >= 0 ? '+' : '').ltrim($timezone, '+').':00'; - } - - protected static function getDateTimeZoneNameFromMixed($timezone) - { - if ($timezone === null) { - return date_default_timezone_get(); - } - - if (\is_string($timezone)) { - $timezone = preg_replace('/^\s*([+-]\d+)(\d{2})\s*$/', '$1:$2', $timezone); - } - - if (is_numeric($timezone)) { - return static::parseNumericTimezone($timezone); - } - - return $timezone; - } - - protected static function getDateTimeZoneFromName(&$name) - { - return @timezone_open($name = (string) static::getDateTimeZoneNameFromMixed($name)); - } - - /** - * Cast the current instance into the given class. - * - * @param string $className The $className::instance() method will be called to cast the current object. - * - * @return DateTimeZone - */ - public function cast(string $className) - { - if (!method_exists($className, 'instance')) { - if (is_a($className, DateTimeZone::class, true)) { - return new $className($this->getName()); - } - - throw new InvalidCastException("$className has not the instance() method needed to cast the date."); - } - - return $className::instance($this); - } - - /** - * Create a CarbonTimeZone from mixed input. - * - * @param DateTimeZone|string|int|null $object original value to get CarbonTimeZone from it. - * @param DateTimeZone|string|int|null $objectDump dump of the object for error messages. - * - * @throws InvalidTimeZoneException - * - * @return false|static - */ - public static function instance($object = null, $objectDump = null) - { - $tz = $object; - - if ($tz instanceof static) { - return $tz; - } - - if ($tz === null) { - return new static(); - } - - if (!$tz instanceof DateTimeZone) { - $tz = static::getDateTimeZoneFromName($object); - } - - if ($tz !== false) { - return new static($tz->getName()); - } - - if (Carbon::isStrictModeEnabled()) { - throw new InvalidTimeZoneException('Unknown or bad timezone ('.($objectDump ?: $object).')'); - } - - return false; - } - - /** - * Returns abbreviated name of the current timezone according to DST setting. - * - * @param bool $dst - * - * @return string - */ - public function getAbbreviatedName($dst = false) - { - $name = $this->getName(); - - foreach ($this->listAbbreviations() as $abbreviation => $zones) { - foreach ($zones as $zone) { - if ($zone['timezone_id'] === $name && $zone['dst'] == $dst) { - return $abbreviation; - } - } - } - - return 'unknown'; - } - - /** - * @alias getAbbreviatedName - * - * Returns abbreviated name of the current timezone according to DST setting. - * - * @param bool $dst - * - * @return string - */ - public function getAbbr($dst = false) - { - return $this->getAbbreviatedName($dst); - } - - /** - * Get the offset as string "sHH:MM" (such as "+00:00" or "-12:30"). - * - * @param DateTimeInterface|null $date - * - * @return string - */ - public function toOffsetName(DateTimeInterface $date = null) - { - return static::getOffsetNameFromMinuteOffset( - $this->getOffset($date ?: Carbon::now($this)) / 60 - ); - } - - /** - * Returns a new CarbonTimeZone object using the offset string instead of region string. - * - * @param DateTimeInterface|null $date - * - * @return CarbonTimeZone - */ - public function toOffsetTimeZone(DateTimeInterface $date = null) - { - return new static($this->toOffsetName($date)); - } - - /** - * Returns the first region string (such as "America/Toronto") that matches the current timezone or - * false if no match is found. - * - * @see timezone_name_from_abbr native PHP function. - * - * @param DateTimeInterface|null $date - * @param int $isDst - * - * @return string|false - */ - public function toRegionName(DateTimeInterface $date = null, $isDst = 1) - { - $name = $this->getName(); - $firstChar = substr($name, 0, 1); - - if ($firstChar !== '+' && $firstChar !== '-') { - return $name; - } - - $date = $date ?: Carbon::now($this); - - // Integer construction no longer supported since PHP 8 - // @codeCoverageIgnoreStart - try { - $offset = @$this->getOffset($date) ?: 0; - } catch (Throwable $e) { - $offset = 0; - } - // @codeCoverageIgnoreEnd - - $name = @timezone_name_from_abbr('', $offset, $isDst); - - if ($name) { - return $name; - } - - foreach (timezone_identifiers_list() as $timezone) { - if (Carbon::instance($date)->tz($timezone)->getOffset() === $offset) { - return $timezone; - } - } - - return false; - } - - /** - * Returns a new CarbonTimeZone object using the region string instead of offset string. - * - * @param DateTimeInterface|null $date - * - * @return CarbonTimeZone|false - */ - public function toRegionTimeZone(DateTimeInterface $date = null) - { - $tz = $this->toRegionName($date); - - if ($tz !== false) { - return new static($tz); - } - - if (Carbon::isStrictModeEnabled()) { - throw new InvalidTimeZoneException('Unknown timezone for offset '.$this->getOffset($date ?: Carbon::now($this)).' seconds.'); - } - - return false; - } - - /** - * Cast to string (get timezone name). - * - * @return string - */ - public function __toString() - { - return $this->getName(); - } - - /** - * Return the type number: - * - * Type 1; A UTC offset, such as -0300 - * Type 2; A timezone abbreviation, such as GMT - * Type 3: A timezone identifier, such as Europe/London - */ - public function getType(): int - { - return preg_match('/"timezone_type";i:(\d)/', serialize($this), $match) ? (int) $match[1] : 3; - } - - /** - * Create a CarbonTimeZone from mixed input. - * - * @param DateTimeZone|string|int|null $object - * - * @return false|static - */ - public static function create($object = null) - { - return static::instance($object); - } - - /** - * Create a CarbonTimeZone from int/float hour offset. - * - * @param float $hourOffset number of hour of the timezone shift (can be decimal). - * - * @return false|static - */ - public static function createFromHourOffset(float $hourOffset) - { - return static::createFromMinuteOffset($hourOffset * Carbon::MINUTES_PER_HOUR); - } - - /** - * Create a CarbonTimeZone from int/float minute offset. - * - * @param float $minuteOffset number of total minutes of the timezone shift. - * - * @return false|static - */ - public static function createFromMinuteOffset(float $minuteOffset) - { - return static::instance(static::getOffsetNameFromMinuteOffset($minuteOffset)); - } - - /** - * Convert a total minutes offset into a standardized timezone offset string. - * - * @param float $minutes number of total minutes of the timezone shift. - * - * @return string - */ - public static function getOffsetNameFromMinuteOffset(float $minutes): string - { - $minutes = round($minutes); - $unsignedMinutes = abs($minutes); - - return ($minutes < 0 ? '-' : '+'). - str_pad((string) floor($unsignedMinutes / 60), 2, '0', STR_PAD_LEFT). - ':'. - str_pad((string) ($unsignedMinutes % 60), 2, '0', STR_PAD_LEFT); - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Cli/Invoker.php b/vendor/nesbot/carbon/src/Carbon/Cli/Invoker.php deleted file mode 100644 index 4f35d6c6..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Cli/Invoker.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Cli; - -class Invoker -{ - public const CLI_CLASS_NAME = 'Carbon\\Cli'; - - protected function runWithCli(string $className, array $parameters): bool - { - $cli = new $className(); - - return $cli(...$parameters); - } - - public function __invoke(...$parameters): bool - { - if (class_exists(self::CLI_CLASS_NAME)) { - return $this->runWithCli(self::CLI_CLASS_NAME, $parameters); - } - - $function = (($parameters[1] ?? '') === 'install' ? ($parameters[2] ?? null) : null) ?: 'shell_exec'; - $function('composer require carbon-cli/carbon-cli --no-interaction'); - - echo 'Installation succeeded.'; - - return true; - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonDoctrineType.php b/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonDoctrineType.php deleted file mode 100644 index ccc457fc..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonDoctrineType.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Doctrine; - -use Doctrine\DBAL\Platforms\AbstractPlatform; - -interface CarbonDoctrineType -{ - public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform); - - public function convertToPHPValue($value, AbstractPlatform $platform); - - public function convertToDatabaseValue($value, AbstractPlatform $platform); -} diff --git a/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonImmutableType.php b/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonImmutableType.php deleted file mode 100644 index bf476a77..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonImmutableType.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Doctrine; - -use Doctrine\DBAL\Platforms\AbstractPlatform; - -class CarbonImmutableType extends DateTimeImmutableType implements CarbonDoctrineType -{ - /** - * {@inheritdoc} - * - * @return string - */ - public function getName() - { - return 'carbon_immutable'; - } - - /** - * {@inheritdoc} - * - * @return bool - */ - public function requiresSQLCommentHint(AbstractPlatform $platform) - { - return true; - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonType.php b/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonType.php deleted file mode 100644 index 9289d84d..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonType.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Doctrine; - -use Doctrine\DBAL\Platforms\AbstractPlatform; - -class CarbonType extends DateTimeType implements CarbonDoctrineType -{ - /** - * {@inheritdoc} - * - * @return string - */ - public function getName() - { - return 'carbon'; - } - - /** - * {@inheritdoc} - * - * @return bool - */ - public function requiresSQLCommentHint(AbstractPlatform $platform) - { - return true; - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonTypeConverter.php b/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonTypeConverter.php deleted file mode 100644 index ecfe17e7..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonTypeConverter.php +++ /dev/null @@ -1,123 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Doctrine; - -use Carbon\Carbon; -use Carbon\CarbonInterface; -use DateTimeInterface; -use Doctrine\DBAL\Platforms\AbstractPlatform; -use Doctrine\DBAL\Types\ConversionException; -use Exception; - -/** - * @template T of CarbonInterface - */ -trait CarbonTypeConverter -{ - /** - * @return class-string<T> - */ - protected function getCarbonClassName(): string - { - return Carbon::class; - } - - /** - * @return string - */ - public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) - { - $precision = $fieldDeclaration['precision'] ?: 10; - - if ($fieldDeclaration['secondPrecision'] ?? false) { - $precision = 0; - } - - if ($precision === 10) { - $precision = DateTimeDefaultPrecision::get(); - } - - $type = parent::getSQLDeclaration($fieldDeclaration, $platform); - - if (!$precision) { - return $type; - } - - if (str_contains($type, '(')) { - return preg_replace('/\(\d+\)/', "($precision)", $type); - } - - [$before, $after] = explode(' ', "$type "); - - return trim("$before($precision) $after"); - } - - /** - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - * - * @return T|null - */ - public function convertToPHPValue($value, AbstractPlatform $platform) - { - $class = $this->getCarbonClassName(); - - if ($value === null || is_a($value, $class)) { - return $value; - } - - if ($value instanceof DateTimeInterface) { - return $class::instance($value); - } - - $date = null; - $error = null; - - try { - $date = $class::parse($value); - } catch (Exception $exception) { - $error = $exception; - } - - if (!$date) { - throw ConversionException::conversionFailedFormat( - $value, - $this->getName(), - 'Y-m-d H:i:s.u or any format supported by '.$class.'::parse()', - $error - ); - } - - return $date; - } - - /** - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - * - * @return string|null - */ - public function convertToDatabaseValue($value, AbstractPlatform $platform) - { - if ($value === null) { - return $value; - } - - if ($value instanceof DateTimeInterface) { - return $value->format('Y-m-d H:i:s.u'); - } - - throw ConversionException::conversionFailedInvalidType( - $value, - $this->getName(), - ['null', 'DateTime', 'Carbon'] - ); - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeDefaultPrecision.php b/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeDefaultPrecision.php deleted file mode 100644 index 642fd413..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeDefaultPrecision.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Doctrine; - -class DateTimeDefaultPrecision -{ - private static $precision = 6; - - /** - * Change the default Doctrine datetime and datetime_immutable precision. - * - * @param int $precision - */ - public static function set(int $precision): void - { - self::$precision = $precision; - } - - /** - * Get the default Doctrine datetime and datetime_immutable precision. - * - * @return int - */ - public static function get(): int - { - return self::$precision; - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeImmutableType.php b/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeImmutableType.php deleted file mode 100644 index 49927103..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeImmutableType.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -/** - * Thanks to https://github.com/flaushi for his suggestion: - * https://github.com/doctrine/dbal/issues/2873#issuecomment-534956358 - */ -namespace Carbon\Doctrine; - -use Carbon\CarbonImmutable; -use Doctrine\DBAL\Types\VarDateTimeImmutableType; - -class DateTimeImmutableType extends VarDateTimeImmutableType implements CarbonDoctrineType -{ - /** @use CarbonTypeConverter<CarbonImmutable> */ - use CarbonTypeConverter; - - /** - * @return class-string<CarbonImmutable> - */ - protected function getCarbonClassName(): string - { - return CarbonImmutable::class; - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeType.php b/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeType.php deleted file mode 100644 index 29b0bb95..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeType.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -/** - * Thanks to https://github.com/flaushi for his suggestion: - * https://github.com/doctrine/dbal/issues/2873#issuecomment-534956358 - */ -namespace Carbon\Doctrine; - -use Carbon\Carbon; -use Doctrine\DBAL\Types\VarDateTimeType; - -class DateTimeType extends VarDateTimeType implements CarbonDoctrineType -{ - /** @use CarbonTypeConverter<Carbon> */ - use CarbonTypeConverter; -} diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/BadComparisonUnitException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/BadComparisonUnitException.php deleted file mode 100644 index 3ca8837d..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/BadComparisonUnitException.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Exceptions; - -use Throwable; - -class BadComparisonUnitException extends UnitException -{ - /** - * The unit. - * - * @var string - */ - protected $unit; - - /** - * Constructor. - * - * @param string $unit - * @param int $code - * @param Throwable|null $previous - */ - public function __construct($unit, $code = 0, Throwable $previous = null) - { - $this->unit = $unit; - - parent::__construct("Bad comparison unit: '$unit'", $code, $previous); - } - - /** - * Get the unit. - * - * @return string - */ - public function getUnit(): string - { - return $this->unit; - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentConstructorException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentConstructorException.php deleted file mode 100644 index 2e222e54..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentConstructorException.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Exceptions; - -use BadMethodCallException as BaseBadMethodCallException; -use Throwable; - -class BadFluentConstructorException extends BaseBadMethodCallException implements BadMethodCallException -{ - /** - * The method. - * - * @var string - */ - protected $method; - - /** - * Constructor. - * - * @param string $method - * @param int $code - * @param Throwable|null $previous - */ - public function __construct($method, $code = 0, Throwable $previous = null) - { - $this->method = $method; - - parent::__construct(sprintf("Unknown fluent constructor '%s'.", $method), $code, $previous); - } - - /** - * Get the method. - * - * @return string - */ - public function getMethod(): string - { - return $this->method; - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentSetterException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentSetterException.php deleted file mode 100644 index 4ceaa2ef..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentSetterException.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Exceptions; - -use BadMethodCallException as BaseBadMethodCallException; -use Throwable; - -class BadFluentSetterException extends BaseBadMethodCallException implements BadMethodCallException -{ - /** - * The setter. - * - * @var string - */ - protected $setter; - - /** - * Constructor. - * - * @param string $setter - * @param int $code - * @param Throwable|null $previous - */ - public function __construct($setter, $code = 0, Throwable $previous = null) - { - $this->setter = $setter; - - parent::__construct(sprintf("Unknown fluent setter '%s'", $setter), $code, $previous); - } - - /** - * Get the setter. - * - * @return string - */ - public function getSetter(): string - { - return $this->setter; - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/BadMethodCallException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/BadMethodCallException.php deleted file mode 100644 index 108206d3..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/BadMethodCallException.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Exceptions; - -interface BadMethodCallException extends Exception -{ - // -} diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/EndLessPeriodException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/EndLessPeriodException.php deleted file mode 100644 index e1049269..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/EndLessPeriodException.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Exceptions; - -use RuntimeException as BaseRuntimeException; - -final class EndLessPeriodException extends BaseRuntimeException implements RuntimeException -{ - // -} diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/Exception.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/Exception.php deleted file mode 100644 index 8ad747e7..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/Exception.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Exceptions; - -interface Exception -{ - // -} diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/ImmutableException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/ImmutableException.php deleted file mode 100644 index db334c6c..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/ImmutableException.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Exceptions; - -use RuntimeException as BaseRuntimeException; -use Throwable; - -class ImmutableException extends BaseRuntimeException implements RuntimeException -{ - /** - * The value. - * - * @var string - */ - protected $value; - - /** - * Constructor. - * - * @param string $value the immutable type/value - * @param int $code - * @param Throwable|null $previous - */ - public function __construct($value, $code = 0, Throwable $previous = null) - { - $this->value = $value; - parent::__construct("$value is immutable.", $code, $previous); - } - - /** - * Get the value. - * - * @return string - */ - public function getValue(): string - { - return $this->value; - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidArgumentException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidArgumentException.php deleted file mode 100644 index 5b013cd5..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidArgumentException.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Exceptions; - -interface InvalidArgumentException extends Exception -{ - // -} diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidCastException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidCastException.php deleted file mode 100644 index a421401f..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidCastException.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Exceptions; - -use InvalidArgumentException as BaseInvalidArgumentException; - -class InvalidCastException extends BaseInvalidArgumentException implements InvalidArgumentException -{ - // -} diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidDateException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidDateException.php deleted file mode 100644 index c9ecb6b0..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidDateException.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Exceptions; - -use InvalidArgumentException as BaseInvalidArgumentException; -use Throwable; - -class InvalidDateException extends BaseInvalidArgumentException implements InvalidArgumentException -{ - /** - * The invalid field. - * - * @var string - */ - private $field; - - /** - * The invalid value. - * - * @var mixed - */ - private $value; - - /** - * Constructor. - * - * @param string $field - * @param mixed $value - * @param int $code - * @param Throwable|null $previous - */ - public function __construct($field, $value, $code = 0, Throwable $previous = null) - { - $this->field = $field; - $this->value = $value; - parent::__construct($field.' : '.$value.' is not a valid value.', $code, $previous); - } - - /** - * Get the invalid field. - * - * @return string - */ - public function getField() - { - return $this->field; - } - - /** - * Get the invalid value. - * - * @return mixed - */ - public function getValue() - { - return $this->value; - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidFormatException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidFormatException.php deleted file mode 100644 index 92d55fe3..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidFormatException.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Exceptions; - -use InvalidArgumentException as BaseInvalidArgumentException; - -class InvalidFormatException extends BaseInvalidArgumentException implements InvalidArgumentException -{ - // -} diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidIntervalException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidIntervalException.php deleted file mode 100644 index 69cf4128..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidIntervalException.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Exceptions; - -use InvalidArgumentException as BaseInvalidArgumentException; - -class InvalidIntervalException extends BaseInvalidArgumentException implements InvalidArgumentException -{ - // -} diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodDateException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodDateException.php deleted file mode 100644 index 9bd84a96..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodDateException.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Exceptions; - -use InvalidArgumentException as BaseInvalidArgumentException; - -class InvalidPeriodDateException extends BaseInvalidArgumentException implements InvalidArgumentException -{ - // -} diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodParameterException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodParameterException.php deleted file mode 100644 index cf2c9024..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodParameterException.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Exceptions; - -use InvalidArgumentException as BaseInvalidArgumentException; - -class InvalidPeriodParameterException extends BaseInvalidArgumentException implements InvalidArgumentException -{ - // -} diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTimeZoneException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTimeZoneException.php deleted file mode 100644 index f7259558..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTimeZoneException.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Exceptions; - -use InvalidArgumentException as BaseInvalidArgumentException; - -class InvalidTimeZoneException extends BaseInvalidArgumentException implements InvalidArgumentException -{ - // -} diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTypeException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTypeException.php deleted file mode 100644 index 2c8ec9ba..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTypeException.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Exceptions; - -use InvalidArgumentException as BaseInvalidArgumentException; - -class InvalidTypeException extends BaseInvalidArgumentException implements InvalidArgumentException -{ - // -} diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/NotACarbonClassException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/NotACarbonClassException.php deleted file mode 100644 index 7a87632c..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/NotACarbonClassException.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Exceptions; - -use Carbon\CarbonInterface; -use InvalidArgumentException as BaseInvalidArgumentException; -use Throwable; - -class NotACarbonClassException extends BaseInvalidArgumentException implements InvalidArgumentException -{ - /** - * The className. - * - * @var string - */ - protected $className; - - /** - * Constructor. - * - * @param string $className - * @param int $code - * @param Throwable|null $previous - */ - public function __construct($className, $code = 0, Throwable $previous = null) - { - $this->className = $className; - - parent::__construct(sprintf('Given class does not implement %s: %s', CarbonInterface::class, $className), $code, $previous); - } - - /** - * Get the className. - * - * @return string - */ - public function getClassName(): string - { - return $this->className; - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/NotAPeriodException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/NotAPeriodException.php deleted file mode 100644 index 4edd7a48..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/NotAPeriodException.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Exceptions; - -use InvalidArgumentException as BaseInvalidArgumentException; - -class NotAPeriodException extends BaseInvalidArgumentException implements InvalidArgumentException -{ - // -} diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/NotLocaleAwareException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/NotLocaleAwareException.php deleted file mode 100644 index f2c54684..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/NotLocaleAwareException.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Exceptions; - -use InvalidArgumentException as BaseInvalidArgumentException; -use Throwable; - -class NotLocaleAwareException extends BaseInvalidArgumentException implements InvalidArgumentException -{ - /** - * Constructor. - * - * @param mixed $object - * @param int $code - * @param Throwable|null $previous - */ - public function __construct($object, $code = 0, Throwable $previous = null) - { - $dump = \is_object($object) ? \get_class($object) : \gettype($object); - - parent::__construct("$dump does neither implements Symfony\Contracts\Translation\LocaleAwareInterface nor getLocale() method.", $code, $previous); - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/OutOfRangeException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/OutOfRangeException.php deleted file mode 100644 index 2c586d0b..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/OutOfRangeException.php +++ /dev/null @@ -1,101 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Exceptions; - -use InvalidArgumentException as BaseInvalidArgumentException; -use Throwable; - -// This will extends OutOfRangeException instead of InvalidArgumentException since 3.0.0 -// use OutOfRangeException as BaseOutOfRangeException; - -class OutOfRangeException extends BaseInvalidArgumentException implements InvalidArgumentException -{ - /** - * The unit or name of the value. - * - * @var string - */ - private $unit; - - /** - * The range minimum. - * - * @var mixed - */ - private $min; - - /** - * The range maximum. - * - * @var mixed - */ - private $max; - - /** - * The invalid value. - * - * @var mixed - */ - private $value; - - /** - * Constructor. - * - * @param string $unit - * @param mixed $min - * @param mixed $max - * @param mixed $value - * @param int $code - * @param Throwable|null $previous - */ - public function __construct($unit, $min, $max, $value, $code = 0, Throwable $previous = null) - { - $this->unit = $unit; - $this->min = $min; - $this->max = $max; - $this->value = $value; - - parent::__construct("$unit must be between $min and $max, $value given", $code, $previous); - } - - /** - * @return mixed - */ - public function getMax() - { - return $this->max; - } - - /** - * @return mixed - */ - public function getMin() - { - return $this->min; - } - - /** - * @return mixed - */ - public function getUnit() - { - return $this->unit; - } - - /** - * @return mixed - */ - public function getValue() - { - return $this->value; - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/ParseErrorException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/ParseErrorException.php deleted file mode 100644 index 5416fd14..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/ParseErrorException.php +++ /dev/null @@ -1,88 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Exceptions; - -use InvalidArgumentException as BaseInvalidArgumentException; -use Throwable; - -class ParseErrorException extends BaseInvalidArgumentException implements InvalidArgumentException -{ - /** - * The expected. - * - * @var string - */ - protected $expected; - - /** - * The actual. - * - * @var string - */ - protected $actual; - - /** - * The help message. - * - * @var string - */ - protected $help; - - /** - * Constructor. - * - * @param string $expected - * @param string $actual - * @param int $code - * @param Throwable|null $previous - */ - public function __construct($expected, $actual, $help = '', $code = 0, Throwable $previous = null) - { - $this->expected = $expected; - $this->actual = $actual; - $this->help = $help; - - $actual = $actual === '' ? 'data is missing' : "get '$actual'"; - - parent::__construct(trim("Format expected $expected but $actual\n$help"), $code, $previous); - } - - /** - * Get the expected. - * - * @return string - */ - public function getExpected(): string - { - return $this->expected; - } - - /** - * Get the actual. - * - * @return string - */ - public function getActual(): string - { - return $this->actual; - } - - /** - * Get the help message. - * - * @return string - */ - public function getHelp(): string - { - return $this->help; - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/RuntimeException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/RuntimeException.php deleted file mode 100644 index ad196f79..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/RuntimeException.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Exceptions; - -interface RuntimeException extends Exception -{ - // -} diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitException.php deleted file mode 100644 index ee99953b..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitException.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Exceptions; - -use InvalidArgumentException as BaseInvalidArgumentException; - -class UnitException extends BaseInvalidArgumentException implements InvalidArgumentException -{ - // -} diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitNotConfiguredException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitNotConfiguredException.php deleted file mode 100644 index 0e723056..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitNotConfiguredException.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Exceptions; - -use Throwable; - -class UnitNotConfiguredException extends UnitException -{ - /** - * The unit. - * - * @var string - */ - protected $unit; - - /** - * Constructor. - * - * @param string $unit - * @param int $code - * @param Throwable|null $previous - */ - public function __construct($unit, $code = 0, Throwable $previous = null) - { - $this->unit = $unit; - - parent::__construct("Unit $unit have no configuration to get total from other units.", $code, $previous); - } - - /** - * Get the unit. - * - * @return string - */ - public function getUnit(): string - { - return $this->unit; - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownGetterException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownGetterException.php deleted file mode 100644 index 5c504975..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownGetterException.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Exceptions; - -use InvalidArgumentException as BaseInvalidArgumentException; -use Throwable; - -class UnknownGetterException extends BaseInvalidArgumentException implements InvalidArgumentException -{ - /** - * The getter. - * - * @var string - */ - protected $getter; - - /** - * Constructor. - * - * @param string $getter getter name - * @param int $code - * @param Throwable|null $previous - */ - public function __construct($getter, $code = 0, Throwable $previous = null) - { - $this->getter = $getter; - - parent::__construct("Unknown getter '$getter'", $code, $previous); - } - - /** - * Get the getter. - * - * @return string - */ - public function getGetter(): string - { - return $this->getter; - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownMethodException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownMethodException.php deleted file mode 100644 index 75273a70..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownMethodException.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Exceptions; - -use BadMethodCallException as BaseBadMethodCallException; -use Throwable; - -class UnknownMethodException extends BaseBadMethodCallException implements BadMethodCallException -{ - /** - * The method. - * - * @var string - */ - protected $method; - - /** - * Constructor. - * - * @param string $method - * @param int $code - * @param Throwable|null $previous - */ - public function __construct($method, $code = 0, Throwable $previous = null) - { - $this->method = $method; - - parent::__construct("Method $method does not exist.", $code, $previous); - } - - /** - * Get the method. - * - * @return string - */ - public function getMethod(): string - { - return $this->method; - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownSetterException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownSetterException.php deleted file mode 100644 index a795f5d7..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownSetterException.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Exceptions; - -use InvalidArgumentException as BaseInvalidArgumentException; -use Throwable; - -class UnknownSetterException extends BaseInvalidArgumentException implements BadMethodCallException -{ - /** - * The setter. - * - * @var string - */ - protected $setter; - - /** - * Constructor. - * - * @param string $setter setter name - * @param int $code - * @param Throwable|null $previous - */ - public function __construct($setter, $code = 0, Throwable $previous = null) - { - $this->setter = $setter; - - parent::__construct("Unknown setter '$setter'", $code, $previous); - } - - /** - * Get the setter. - * - * @return string - */ - public function getSetter(): string - { - return $this->setter; - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownUnitException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownUnitException.php deleted file mode 100644 index ecd7f7a5..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownUnitException.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Exceptions; - -use Throwable; - -class UnknownUnitException extends UnitException -{ - /** - * The unit. - * - * @var string - */ - protected $unit; - - /** - * Constructor. - * - * @param string $unit - * @param int $code - * @param Throwable|null $previous - */ - public function __construct($unit, $code = 0, Throwable $previous = null) - { - $this->unit = $unit; - - parent::__construct("Unknown unit '$unit'.", $code, $previous); - } - - /** - * Get the unit. - * - * @return string - */ - public function getUnit(): string - { - return $this->unit; - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnreachableException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnreachableException.php deleted file mode 100644 index 1654ab11..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnreachableException.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Exceptions; - -use RuntimeException as BaseRuntimeException; - -class UnreachableException extends BaseRuntimeException implements RuntimeException -{ - // -} diff --git a/vendor/nesbot/carbon/src/Carbon/Factory.php b/vendor/nesbot/carbon/src/Carbon/Factory.php deleted file mode 100644 index f8c72890..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Factory.php +++ /dev/null @@ -1,326 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon; - -use Closure; -use DateTimeInterface; -use ReflectionMethod; - -/** - * A factory to generate Carbon instances with common settings. - * - * <autodoc generated by `composer phpdoc`> - * - * @method bool canBeCreatedFromFormat($date, $format) Checks if the (date)time string is in a given format and valid to create a - * new instance. - * @method Carbon|false create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $tz = null) Create a new Carbon instance from a specific date and time. - * If any of $year, $month or $day are set to null their now() values will - * be used. - * If $hour is null it will be set to its now() value and the default - * values for $minute and $second will be their now() values. - * If $hour is not null then the default values for $minute and $second - * will be 0. - * @method Carbon createFromDate($year = null, $month = null, $day = null, $tz = null) Create a Carbon instance from just a date. The time portion is set to now. - * @method Carbon|false createFromFormat($format, $time, $tz = null) Create a Carbon instance from a specific format. - * @method Carbon|false createFromIsoFormat($format, $time, $tz = null, $locale = 'en', $translator = null) Create a Carbon instance from a specific ISO format (same replacements as ->isoFormat()). - * @method Carbon|false createFromLocaleFormat($format, $locale, $time, $tz = null) Create a Carbon instance from a specific format and a string in a given language. - * @method Carbon|false createFromLocaleIsoFormat($format, $locale, $time, $tz = null) Create a Carbon instance from a specific ISO format and a string in a given language. - * @method Carbon createFromTime($hour = 0, $minute = 0, $second = 0, $tz = null) Create a Carbon instance from just a time. The date portion is set to today. - * @method Carbon createFromTimeString($time, $tz = null) Create a Carbon instance from a time string. The date portion is set to today. - * @method Carbon createFromTimestamp($timestamp, $tz = null) Create a Carbon instance from a timestamp and set the timezone (use default one if not specified). - * Timestamp input can be given as int, float or a string containing one or more numbers. - * @method Carbon createFromTimestampMs($timestamp, $tz = null) Create a Carbon instance from a timestamp in milliseconds. - * Timestamp input can be given as int, float or a string containing one or more numbers. - * @method Carbon createFromTimestampMsUTC($timestamp) Create a Carbon instance from a timestamp in milliseconds. - * Timestamp input can be given as int, float or a string containing one or more numbers. - * @method Carbon createFromTimestampUTC($timestamp) Create a Carbon instance from an timestamp keeping the timezone to UTC. - * Timestamp input can be given as int, float or a string containing one or more numbers. - * @method Carbon createMidnightDate($year = null, $month = null, $day = null, $tz = null) Create a Carbon instance from just a date. The time portion is set to midnight. - * @method Carbon|false createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null) Create a new safe Carbon instance from a specific date and time. - * If any of $year, $month or $day are set to null their now() values will - * be used. - * If $hour is null it will be set to its now() value and the default - * values for $minute and $second will be their now() values. - * If $hour is not null then the default values for $minute and $second - * will be 0. - * If one of the set values is not valid, an InvalidDateException - * will be thrown. - * @method CarbonInterface createStrict(?int $year = 0, ?int $month = 1, ?int $day = 1, ?int $hour = 0, ?int $minute = 0, ?int $second = 0, $tz = null) Create a new Carbon instance from a specific date and time using strict validation. - * @method Carbon disableHumanDiffOption($humanDiffOption) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @method Carbon enableHumanDiffOption($humanDiffOption) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @method mixed executeWithLocale($locale, $func) Set the current locale to the given, execute the passed function, reset the locale to previous one, - * then return the result of the closure (or null if the closure was void). - * @method Carbon fromSerialized($value) Create an instance from a serialized string. - * @method void genericMacro($macro, $priority = 0) Register a custom macro. - * @method array getAvailableLocales() Returns the list of internally available locales and already loaded custom locales. - * (It will ignore custom translator dynamic loading.) - * @method Language[] getAvailableLocalesInfo() Returns list of Language object for each available locale. This object allow you to get the ISO name, native - * name, region and variant of the locale. - * @method array getDays() Get the days of the week - * @method string|null getFallbackLocale() Get the fallback locale. - * @method array getFormatsToIsoReplacements() List of replacements from date() format to isoFormat(). - * @method int getHumanDiffOptions() Return default humanDiff() options (merged flags as integer). - * @method array getIsoUnits() Returns list of locale units for ISO formatting. - * @method array getLastErrors() {@inheritdoc} - * @method string getLocale() Get the current translator locale. - * @method callable|null getMacro($name) Get the raw callable macro registered globally for a given name. - * @method int getMidDayAt() get midday/noon hour - * @method Closure|Carbon getTestNow() Get the Carbon instance (real or mock) to be returned when a "now" - * instance is created. - * @method string getTimeFormatByPrecision($unitPrecision) Return a format from H:i to H:i:s.u according to given unit precision. - * @method string getTranslationMessageWith($translator, string $key, ?string $locale = null, ?string $default = null) Returns raw translation message for a given key. - * @method \Symfony\Component\Translation\TranslatorInterface getTranslator() Get the default translator instance in use. - * @method int getWeekEndsAt() Get the last day of week - * @method int getWeekStartsAt() Get the first day of week - * @method array getWeekendDays() Get weekend days - * @method bool hasFormat($date, $format) Checks if the (date)time string is in a given format. - * @method bool hasFormatWithModifiers($date, $format) Checks if the (date)time string is in a given format. - * @method bool hasMacro($name) Checks if macro is registered globally. - * @method bool hasRelativeKeywords($time) Determine if a time string will produce a relative date. - * @method bool hasTestNow() Determine if there is a valid test instance set. A valid test instance - * is anything that is not null. - * @method Carbon instance($date) Create a Carbon instance from a DateTime one. - * @method bool isImmutable() Returns true if the current class/instance is immutable. - * @method bool isModifiableUnit($unit) Returns true if a property can be changed via setter. - * @method bool isMutable() Returns true if the current class/instance is mutable. - * @method bool isStrictModeEnabled() Returns true if the strict mode is globally in use, false else. - * (It can be overridden in specific instances.) - * @method bool localeHasDiffOneDayWords($locale) Returns true if the given locale is internally supported and has words for 1-day diff (just now, yesterday, tomorrow). - * Support is considered enabled if the 3 words are translated in the given locale. - * @method bool localeHasDiffSyntax($locale) Returns true if the given locale is internally supported and has diff syntax support (ago, from now, before, after). - * Support is considered enabled if the 4 sentences are translated in the given locale. - * @method bool localeHasDiffTwoDayWords($locale) Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after tomorrow). - * Support is considered enabled if the 2 words are translated in the given locale. - * @method bool localeHasPeriodSyntax($locale) Returns true if the given locale is internally supported and has period syntax support (X times, every X, from X, to X). - * Support is considered enabled if the 4 sentences are translated in the given locale. - * @method bool localeHasShortUnits($locale) Returns true if the given locale is internally supported and has short-units support. - * Support is considered enabled if either year, day or hour has a short variant translated. - * @method void macro($name, $macro) Register a custom macro. - * @method Carbon|null make($var) Make a Carbon instance from given variable if possible. - * Always return a new instance. Parse only strings and only these likely to be dates (skip intervals - * and recurrences). Throw an exception for invalid format, but otherwise return null. - * @method Carbon maxValue() Create a Carbon instance for the greatest supported date. - * @method Carbon minValue() Create a Carbon instance for the lowest supported date. - * @method void mixin($mixin) Mix another object into the class. - * @method Carbon now($tz = null) Get a Carbon instance for the current date and time. - * @method Carbon parse($time = null, $tz = null) Create a carbon instance from a string. - * This is an alias for the constructor that allows better fluent syntax - * as it allows you to do Carbon::parse('Monday next week')->fn() rather - * than (new Carbon('Monday next week'))->fn(). - * @method Carbon parseFromLocale($time, $locale = null, $tz = null) Create a carbon instance from a localized string (in French, Japanese, Arabic, etc.). - * @method string pluralUnit(string $unit) Returns standardized plural of a given singular/plural unit name (in English). - * @method Carbon|false rawCreateFromFormat($format, $time, $tz = null) Create a Carbon instance from a specific format. - * @method Carbon rawParse($time = null, $tz = null) Create a carbon instance from a string. - * This is an alias for the constructor that allows better fluent syntax - * as it allows you to do Carbon::parse('Monday next week')->fn() rather - * than (new Carbon('Monday next week'))->fn(). - * @method Carbon resetMacros() Remove all macros and generic macros. - * @method void resetMonthsOverflow() @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @method void resetToStringFormat() Reset the format used to the default when type juggling a Carbon instance to a string - * @method void resetYearsOverflow() @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @method void serializeUsing($callback) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather transform Carbon object before the serialization. - * JSON serialize all Carbon instances using the given callback. - * @method Carbon setFallbackLocale($locale) Set the fallback locale. - * @method Carbon setHumanDiffOptions($humanDiffOptions) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @method bool setLocale($locale) Set the current translator locale and indicate if the source locale file exists. - * Pass 'auto' as locale to use closest language from the current LC_TIME locale. - * @method void setMidDayAt($hour) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather consider mid-day is always 12pm, then if you need to test if it's an other - * hour, test it explicitly: - * $date->format('G') == 13 - * or to set explicitly to a given hour: - * $date->setTime(13, 0, 0, 0) - * Set midday/noon hour - * @method Carbon setTestNow($testNow = null) Set a Carbon instance (real or mock) to be returned when a "now" - * instance is created. The provided instance will be returned - * specifically under the following conditions: - * - A call to the static now() method, ex. Carbon::now() - * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) - * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') - * - When a string containing the desired time is passed to Carbon::parse(). - * Note the timezone parameter was left out of the examples above and - * has no affect as the mock value will be returned regardless of its value. - * Only the moment is mocked with setTestNow(), the timezone will still be the one passed - * as parameter of date_default_timezone_get() as a fallback (see setTestNowAndTimezone()). - * To clear the test instance call this method using the default - * parameter of null. - * /!\ Use this method for unit tests only. - * @method Carbon setTestNowAndTimezone($testNow = null, $tz = null) Set a Carbon instance (real or mock) to be returned when a "now" - * instance is created. The provided instance will be returned - * specifically under the following conditions: - * - A call to the static now() method, ex. Carbon::now() - * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) - * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') - * - When a string containing the desired time is passed to Carbon::parse(). - * It will also align default timezone (e.g. call date_default_timezone_set()) with - * the second argument or if null, with the timezone of the given date object. - * To clear the test instance call this method using the default - * parameter of null. - * /!\ Use this method for unit tests only. - * @method void setToStringFormat($format) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather let Carbon object being casted to string with DEFAULT_TO_STRING_FORMAT, and - * use other method or custom format passed to format() method if you need to dump an other string - * format. - * Set the default format used when type juggling a Carbon instance to a string - * @method void setTranslator(TranslatorInterface $translator) Set the default translator instance to use. - * @method Carbon setUtf8($utf8) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use UTF-8 language packages on every machine. - * Set if UTF8 will be used for localized date/time. - * @method void setWeekEndsAt($day) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * Use $weekStartsAt optional parameter instead when using startOfWeek, floorWeek, ceilWeek - * or roundWeek method. You can also use the 'first_day_of_week' locale setting to change the - * start of week according to current locale selected and implicitly the end of week. - * Set the last day of week - * @method void setWeekStartsAt($day) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * Use $weekEndsAt optional parameter instead when using endOfWeek method. You can also use the - * 'first_day_of_week' locale setting to change the start of week according to current locale - * selected and implicitly the end of week. - * Set the first day of week - * @method void setWeekendDays($days) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather consider week-end is always saturday and sunday, and if you have some custom - * week-end days to handle, give to those days an other name and create a macro for them: - * ``` - * Carbon::macro('isDayOff', function ($date) { - * return $date->isSunday() || $date->isMonday(); - * }); - * Carbon::macro('isNotDayOff', function ($date) { - * return !$date->isDayOff(); - * }); - * if ($someDate->isDayOff()) ... - * if ($someDate->isNotDayOff()) ... - * // Add 5 not-off days - * $count = 5; - * while ($someDate->isDayOff() || ($count-- > 0)) { - * $someDate->addDay(); - * } - * ``` - * Set weekend days - * @method bool shouldOverflowMonths() Get the month overflow global behavior (can be overridden in specific instances). - * @method bool shouldOverflowYears() Get the month overflow global behavior (can be overridden in specific instances). - * @method string singularUnit(string $unit) Returns standardized singular of a given singular/plural unit name (in English). - * @method Carbon today($tz = null) Create a Carbon instance for today. - * @method Carbon tomorrow($tz = null) Create a Carbon instance for tomorrow. - * @method string translateTimeString($timeString, $from = null, $to = null, $mode = CarbonInterface::TRANSLATE_ALL) Translate a time string from a locale to an other. - * @method string translateWith(TranslatorInterface $translator, string $key, array $parameters = [], $number = null) Translate using translation string or callback available. - * @method void useMonthsOverflow($monthsOverflow = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @method Carbon useStrictMode($strictModeEnabled = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @method void useYearsOverflow($yearsOverflow = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @method mixed withTestNow($testNow = null, $callback = null) Temporarily sets a static date to be used within the callback. - * Using setTestNow to set the date, executing the callback, then - * clearing the test instance. - * /!\ Use this method for unit tests only. - * @method Carbon yesterday($tz = null) Create a Carbon instance for yesterday. - * - * </autodoc> - */ -class Factory -{ - protected $className = Carbon::class; - - protected $settings = []; - - public function __construct(array $settings = [], ?string $className = null) - { - if ($className) { - $this->className = $className; - } - - $this->settings = $settings; - } - - public function getClassName() - { - return $this->className; - } - - public function setClassName(string $className) - { - $this->className = $className; - - return $this; - } - - public function className(string $className = null) - { - return $className === null ? $this->getClassName() : $this->setClassName($className); - } - - public function getSettings() - { - return $this->settings; - } - - public function setSettings(array $settings) - { - $this->settings = $settings; - - return $this; - } - - public function settings(array $settings = null) - { - return $settings === null ? $this->getSettings() : $this->setSettings($settings); - } - - public function mergeSettings(array $settings) - { - $this->settings = array_merge($this->settings, $settings); - - return $this; - } - - public function __call($name, $arguments) - { - $method = new ReflectionMethod($this->className, $name); - $settings = $this->settings; - - if ($settings && isset($settings['timezone'])) { - $tzParameters = array_filter($method->getParameters(), function ($parameter) { - return \in_array($parameter->getName(), ['tz', 'timezone'], true); - }); - - if (isset($arguments[0]) && \in_array($name, ['instance', 'make', 'create', 'parse'], true)) { - if ($arguments[0] instanceof DateTimeInterface) { - $settings['innerTimezone'] = $settings['timezone']; - } elseif (\is_string($arguments[0]) && date_parse($arguments[0])['is_localtime']) { - unset($settings['timezone'], $settings['innerTimezone']); - } - } elseif (\count($tzParameters)) { - array_splice($arguments, key($tzParameters), 0, [$settings['timezone']]); - unset($settings['timezone']); - } - } - - $result = $this->className::$name(...$arguments); - - return $result instanceof CarbonInterface && !empty($settings) - ? $result->settings($settings) - : $result; - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/FactoryImmutable.php b/vendor/nesbot/carbon/src/Carbon/FactoryImmutable.php deleted file mode 100644 index 596ee806..00000000 --- a/vendor/nesbot/carbon/src/Carbon/FactoryImmutable.php +++ /dev/null @@ -1,243 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon; - -use Closure; - -/** - * A factory to generate CarbonImmutable instances with common settings. - * - * <autodoc generated by `composer phpdoc`> - * - * @method bool canBeCreatedFromFormat($date, $format) Checks if the (date)time string is in a given format and valid to create a - * new instance. - * @method CarbonImmutable|false create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $tz = null) Create a new Carbon instance from a specific date and time. - * If any of $year, $month or $day are set to null their now() values will - * be used. - * If $hour is null it will be set to its now() value and the default - * values for $minute and $second will be their now() values. - * If $hour is not null then the default values for $minute and $second - * will be 0. - * @method CarbonImmutable createFromDate($year = null, $month = null, $day = null, $tz = null) Create a Carbon instance from just a date. The time portion is set to now. - * @method CarbonImmutable|false createFromFormat($format, $time, $tz = null) Create a Carbon instance from a specific format. - * @method CarbonImmutable|false createFromIsoFormat($format, $time, $tz = null, $locale = 'en', $translator = null) Create a Carbon instance from a specific ISO format (same replacements as ->isoFormat()). - * @method CarbonImmutable|false createFromLocaleFormat($format, $locale, $time, $tz = null) Create a Carbon instance from a specific format and a string in a given language. - * @method CarbonImmutable|false createFromLocaleIsoFormat($format, $locale, $time, $tz = null) Create a Carbon instance from a specific ISO format and a string in a given language. - * @method CarbonImmutable createFromTime($hour = 0, $minute = 0, $second = 0, $tz = null) Create a Carbon instance from just a time. The date portion is set to today. - * @method CarbonImmutable createFromTimeString($time, $tz = null) Create a Carbon instance from a time string. The date portion is set to today. - * @method CarbonImmutable createFromTimestamp($timestamp, $tz = null) Create a Carbon instance from a timestamp and set the timezone (use default one if not specified). - * Timestamp input can be given as int, float or a string containing one or more numbers. - * @method CarbonImmutable createFromTimestampMs($timestamp, $tz = null) Create a Carbon instance from a timestamp in milliseconds. - * Timestamp input can be given as int, float or a string containing one or more numbers. - * @method CarbonImmutable createFromTimestampMsUTC($timestamp) Create a Carbon instance from a timestamp in milliseconds. - * Timestamp input can be given as int, float or a string containing one or more numbers. - * @method CarbonImmutable createFromTimestampUTC($timestamp) Create a Carbon instance from an timestamp keeping the timezone to UTC. - * Timestamp input can be given as int, float or a string containing one or more numbers. - * @method CarbonImmutable createMidnightDate($year = null, $month = null, $day = null, $tz = null) Create a Carbon instance from just a date. The time portion is set to midnight. - * @method CarbonImmutable|false createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null) Create a new safe Carbon instance from a specific date and time. - * If any of $year, $month or $day are set to null their now() values will - * be used. - * If $hour is null it will be set to its now() value and the default - * values for $minute and $second will be their now() values. - * If $hour is not null then the default values for $minute and $second - * will be 0. - * If one of the set values is not valid, an InvalidDateException - * will be thrown. - * @method CarbonInterface createStrict(?int $year = 0, ?int $month = 1, ?int $day = 1, ?int $hour = 0, ?int $minute = 0, ?int $second = 0, $tz = null) Create a new Carbon instance from a specific date and time using strict validation. - * @method CarbonImmutable disableHumanDiffOption($humanDiffOption) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @method CarbonImmutable enableHumanDiffOption($humanDiffOption) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @method mixed executeWithLocale($locale, $func) Set the current locale to the given, execute the passed function, reset the locale to previous one, - * then return the result of the closure (or null if the closure was void). - * @method CarbonImmutable fromSerialized($value) Create an instance from a serialized string. - * @method void genericMacro($macro, $priority = 0) Register a custom macro. - * @method array getAvailableLocales() Returns the list of internally available locales and already loaded custom locales. - * (It will ignore custom translator dynamic loading.) - * @method Language[] getAvailableLocalesInfo() Returns list of Language object for each available locale. This object allow you to get the ISO name, native - * name, region and variant of the locale. - * @method array getDays() Get the days of the week - * @method string|null getFallbackLocale() Get the fallback locale. - * @method array getFormatsToIsoReplacements() List of replacements from date() format to isoFormat(). - * @method int getHumanDiffOptions() Return default humanDiff() options (merged flags as integer). - * @method array getIsoUnits() Returns list of locale units for ISO formatting. - * @method array getLastErrors() {@inheritdoc} - * @method string getLocale() Get the current translator locale. - * @method callable|null getMacro($name) Get the raw callable macro registered globally for a given name. - * @method int getMidDayAt() get midday/noon hour - * @method Closure|CarbonImmutable getTestNow() Get the Carbon instance (real or mock) to be returned when a "now" - * instance is created. - * @method string getTimeFormatByPrecision($unitPrecision) Return a format from H:i to H:i:s.u according to given unit precision. - * @method string getTranslationMessageWith($translator, string $key, ?string $locale = null, ?string $default = null) Returns raw translation message for a given key. - * @method \Symfony\Component\Translation\TranslatorInterface getTranslator() Get the default translator instance in use. - * @method int getWeekEndsAt() Get the last day of week - * @method int getWeekStartsAt() Get the first day of week - * @method array getWeekendDays() Get weekend days - * @method bool hasFormat($date, $format) Checks if the (date)time string is in a given format. - * @method bool hasFormatWithModifiers($date, $format) Checks if the (date)time string is in a given format. - * @method bool hasMacro($name) Checks if macro is registered globally. - * @method bool hasRelativeKeywords($time) Determine if a time string will produce a relative date. - * @method bool hasTestNow() Determine if there is a valid test instance set. A valid test instance - * is anything that is not null. - * @method CarbonImmutable instance($date) Create a Carbon instance from a DateTime one. - * @method bool isImmutable() Returns true if the current class/instance is immutable. - * @method bool isModifiableUnit($unit) Returns true if a property can be changed via setter. - * @method bool isMutable() Returns true if the current class/instance is mutable. - * @method bool isStrictModeEnabled() Returns true if the strict mode is globally in use, false else. - * (It can be overridden in specific instances.) - * @method bool localeHasDiffOneDayWords($locale) Returns true if the given locale is internally supported and has words for 1-day diff (just now, yesterday, tomorrow). - * Support is considered enabled if the 3 words are translated in the given locale. - * @method bool localeHasDiffSyntax($locale) Returns true if the given locale is internally supported and has diff syntax support (ago, from now, before, after). - * Support is considered enabled if the 4 sentences are translated in the given locale. - * @method bool localeHasDiffTwoDayWords($locale) Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after tomorrow). - * Support is considered enabled if the 2 words are translated in the given locale. - * @method bool localeHasPeriodSyntax($locale) Returns true if the given locale is internally supported and has period syntax support (X times, every X, from X, to X). - * Support is considered enabled if the 4 sentences are translated in the given locale. - * @method bool localeHasShortUnits($locale) Returns true if the given locale is internally supported and has short-units support. - * Support is considered enabled if either year, day or hour has a short variant translated. - * @method void macro($name, $macro) Register a custom macro. - * @method CarbonImmutable|null make($var) Make a Carbon instance from given variable if possible. - * Always return a new instance. Parse only strings and only these likely to be dates (skip intervals - * and recurrences). Throw an exception for invalid format, but otherwise return null. - * @method CarbonImmutable maxValue() Create a Carbon instance for the greatest supported date. - * @method CarbonImmutable minValue() Create a Carbon instance for the lowest supported date. - * @method void mixin($mixin) Mix another object into the class. - * @method CarbonImmutable now($tz = null) Get a Carbon instance for the current date and time. - * @method CarbonImmutable parse($time = null, $tz = null) Create a carbon instance from a string. - * This is an alias for the constructor that allows better fluent syntax - * as it allows you to do Carbon::parse('Monday next week')->fn() rather - * than (new Carbon('Monday next week'))->fn(). - * @method CarbonImmutable parseFromLocale($time, $locale = null, $tz = null) Create a carbon instance from a localized string (in French, Japanese, Arabic, etc.). - * @method string pluralUnit(string $unit) Returns standardized plural of a given singular/plural unit name (in English). - * @method CarbonImmutable|false rawCreateFromFormat($format, $time, $tz = null) Create a Carbon instance from a specific format. - * @method CarbonImmutable rawParse($time = null, $tz = null) Create a carbon instance from a string. - * This is an alias for the constructor that allows better fluent syntax - * as it allows you to do Carbon::parse('Monday next week')->fn() rather - * than (new Carbon('Monday next week'))->fn(). - * @method CarbonImmutable resetMacros() Remove all macros and generic macros. - * @method void resetMonthsOverflow() @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @method void resetToStringFormat() Reset the format used to the default when type juggling a Carbon instance to a string - * @method void resetYearsOverflow() @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @method void serializeUsing($callback) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather transform Carbon object before the serialization. - * JSON serialize all Carbon instances using the given callback. - * @method CarbonImmutable setFallbackLocale($locale) Set the fallback locale. - * @method CarbonImmutable setHumanDiffOptions($humanDiffOptions) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @method bool setLocale($locale) Set the current translator locale and indicate if the source locale file exists. - * Pass 'auto' as locale to use closest language from the current LC_TIME locale. - * @method void setMidDayAt($hour) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather consider mid-day is always 12pm, then if you need to test if it's an other - * hour, test it explicitly: - * $date->format('G') == 13 - * or to set explicitly to a given hour: - * $date->setTime(13, 0, 0, 0) - * Set midday/noon hour - * @method CarbonImmutable setTestNow($testNow = null) Set a Carbon instance (real or mock) to be returned when a "now" - * instance is created. The provided instance will be returned - * specifically under the following conditions: - * - A call to the static now() method, ex. Carbon::now() - * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) - * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') - * - When a string containing the desired time is passed to Carbon::parse(). - * Note the timezone parameter was left out of the examples above and - * has no affect as the mock value will be returned regardless of its value. - * Only the moment is mocked with setTestNow(), the timezone will still be the one passed - * as parameter of date_default_timezone_get() as a fallback (see setTestNowAndTimezone()). - * To clear the test instance call this method using the default - * parameter of null. - * /!\ Use this method for unit tests only. - * @method CarbonImmutable setTestNowAndTimezone($testNow = null, $tz = null) Set a Carbon instance (real or mock) to be returned when a "now" - * instance is created. The provided instance will be returned - * specifically under the following conditions: - * - A call to the static now() method, ex. Carbon::now() - * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) - * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') - * - When a string containing the desired time is passed to Carbon::parse(). - * It will also align default timezone (e.g. call date_default_timezone_set()) with - * the second argument or if null, with the timezone of the given date object. - * To clear the test instance call this method using the default - * parameter of null. - * /!\ Use this method for unit tests only. - * @method void setToStringFormat($format) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather let Carbon object being casted to string with DEFAULT_TO_STRING_FORMAT, and - * use other method or custom format passed to format() method if you need to dump an other string - * format. - * Set the default format used when type juggling a Carbon instance to a string - * @method void setTranslator(TranslatorInterface $translator) Set the default translator instance to use. - * @method CarbonImmutable setUtf8($utf8) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use UTF-8 language packages on every machine. - * Set if UTF8 will be used for localized date/time. - * @method void setWeekEndsAt($day) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * Use $weekStartsAt optional parameter instead when using startOfWeek, floorWeek, ceilWeek - * or roundWeek method. You can also use the 'first_day_of_week' locale setting to change the - * start of week according to current locale selected and implicitly the end of week. - * Set the last day of week - * @method void setWeekStartsAt($day) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * Use $weekEndsAt optional parameter instead when using endOfWeek method. You can also use the - * 'first_day_of_week' locale setting to change the start of week according to current locale - * selected and implicitly the end of week. - * Set the first day of week - * @method void setWeekendDays($days) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather consider week-end is always saturday and sunday, and if you have some custom - * week-end days to handle, give to those days an other name and create a macro for them: - * ``` - * Carbon::macro('isDayOff', function ($date) { - * return $date->isSunday() || $date->isMonday(); - * }); - * Carbon::macro('isNotDayOff', function ($date) { - * return !$date->isDayOff(); - * }); - * if ($someDate->isDayOff()) ... - * if ($someDate->isNotDayOff()) ... - * // Add 5 not-off days - * $count = 5; - * while ($someDate->isDayOff() || ($count-- > 0)) { - * $someDate->addDay(); - * } - * ``` - * Set weekend days - * @method bool shouldOverflowMonths() Get the month overflow global behavior (can be overridden in specific instances). - * @method bool shouldOverflowYears() Get the month overflow global behavior (can be overridden in specific instances). - * @method string singularUnit(string $unit) Returns standardized singular of a given singular/plural unit name (in English). - * @method CarbonImmutable today($tz = null) Create a Carbon instance for today. - * @method CarbonImmutable tomorrow($tz = null) Create a Carbon instance for tomorrow. - * @method string translateTimeString($timeString, $from = null, $to = null, $mode = CarbonInterface::TRANSLATE_ALL) Translate a time string from a locale to an other. - * @method string translateWith(TranslatorInterface $translator, string $key, array $parameters = [], $number = null) Translate using translation string or callback available. - * @method void useMonthsOverflow($monthsOverflow = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @method CarbonImmutable useStrictMode($strictModeEnabled = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @method void useYearsOverflow($yearsOverflow = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @method mixed withTestNow($testNow = null, $callback = null) Temporarily sets a static date to be used within the callback. - * Using setTestNow to set the date, executing the callback, then - * clearing the test instance. - * /!\ Use this method for unit tests only. - * @method CarbonImmutable yesterday($tz = null) Create a Carbon instance for yesterday. - * - * </autodoc> - */ -class FactoryImmutable extends Factory -{ - protected $className = CarbonImmutable::class; -} diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/aa.php b/vendor/nesbot/carbon/src/Carbon/Lang/aa.php deleted file mode 100644 index f3431e4b..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/aa.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/aa_DJ.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/aa_DJ.php b/vendor/nesbot/carbon/src/Carbon/Lang/aa_DJ.php deleted file mode 100644 index c6e23c0d..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/aa_DJ.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Ge'ez Frontier Foundation locales@geez.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD.MM.YYYY', - ], - 'months' => ['Qunxa Garablu', 'Kudo', 'Ciggilta Kudo', 'Agda Baxisso', 'Caxah Alsa', 'Qasa Dirri', 'Qado Dirri', 'Liiqen', 'Waysu', 'Diteli', 'Ximoli', 'Kaxxa Garablu'], - 'months_short' => ['qun', 'nah', 'cig', 'agd', 'cax', 'qas', 'qad', 'leq', 'way', 'dit', 'xim', 'kax'], - 'weekdays' => ['Acaada', 'Etleeni', 'Talaata', 'Arbaqa', 'Kamiisi', 'Gumqata', 'Sabti'], - 'weekdays_short' => ['aca', 'etl', 'tal', 'arb', 'kam', 'gum', 'sab'], - 'weekdays_min' => ['aca', 'etl', 'tal', 'arb', 'kam', 'gum', 'sab'], - 'first_day_of_week' => 6, - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['saaku', 'carra'], - - 'year' => ':count gaqambo', // less reliable - 'y' => ':count gaqambo', // less reliable - 'a_year' => ':count gaqambo', // less reliable - - 'month' => ':count àlsa', - 'm' => ':count àlsa', - 'a_month' => ':count àlsa', - - 'day' => ':count saaku', // less reliable - 'd' => ':count saaku', // less reliable - 'a_day' => ':count saaku', // less reliable - - 'hour' => ':count ayti', // less reliable - 'h' => ':count ayti', // less reliable - 'a_hour' => ':count ayti', // less reliable -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/aa_ER.php b/vendor/nesbot/carbon/src/Carbon/Lang/aa_ER.php deleted file mode 100644 index f8f395b7..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/aa_ER.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Ge'ez Frontier Foundation locales@geez.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YYYY', - ], - 'months' => ['Qunxa Garablu', 'Naharsi Kudo', 'Ciggilta Kudo', 'Agda Baxisso', 'Caxah Alsa', 'Qasa Dirri', 'Qado Dirri', 'Leqeeni', 'Waysu', 'Diteli', 'Ximoli', 'Kaxxa Garablu'], - 'months_short' => ['Qun', 'Nah', 'Cig', 'Agd', 'Cax', 'Qas', 'Qad', 'Leq', 'Way', 'Dit', 'Xim', 'Kax'], - 'weekdays' => ['Acaada', 'Etleeni', 'Talaata', 'Arbaqa', 'Kamiisi', 'Gumqata', 'Sabti'], - 'weekdays_short' => ['Aca', 'Etl', 'Tal', 'Arb', 'Kam', 'Gum', 'Sab'], - 'weekdays_min' => ['Aca', 'Etl', 'Tal', 'Arb', 'Kam', 'Gum', 'Sab'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['saaku', 'carra'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/aa_ER@saaho.php b/vendor/nesbot/carbon/src/Carbon/Lang/aa_ER@saaho.php deleted file mode 100644 index 64612253..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/aa_ER@saaho.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Ge'ez Frontier Foundation locales@geez.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YYYY', - ], - 'months' => ['Qunxa Garablu', 'Naharsi Kudo', 'Ciggilta Kudo', 'Agda Baxisso', 'Caxah Alsa', 'Qasa Dirri', 'Qado Dirri', 'Leqeeni', 'Waysu', 'Diteli', 'Ximoli', 'Kaxxa Garablu'], - 'months_short' => ['Qun', 'Nah', 'Cig', 'Agd', 'Cax', 'Qas', 'Qad', 'Leq', 'Way', 'Dit', 'Xim', 'Kax'], - 'weekdays' => ['Naba Sambat', 'Sani', 'Salus', 'Rabuq', 'Camus', 'Jumqata', 'Qunxa Sambat'], - 'weekdays_short' => ['Nab', 'San', 'Sal', 'Rab', 'Cam', 'Jum', 'Qun'], - 'weekdays_min' => ['Nab', 'San', 'Sal', 'Rab', 'Cam', 'Jum', 'Qun'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['saaku', 'carra'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/aa_ET.php b/vendor/nesbot/carbon/src/Carbon/Lang/aa_ET.php deleted file mode 100644 index e55e591b..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/aa_ET.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Ge'ez Frontier Foundation locales@geez.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YYYY', - ], - 'months' => ['Qunxa Garablu', 'Kudo', 'Ciggilta Kudo', 'Agda Baxisso', 'Caxah Alsa', 'Qasa Dirri', 'Qado Dirri', 'Liiqen', 'Waysu', 'Diteli', 'Ximoli', 'Kaxxa Garablu'], - 'months_short' => ['Qun', 'Kud', 'Cig', 'Agd', 'Cax', 'Qas', 'Qad', 'Leq', 'Way', 'Dit', 'Xim', 'Kax'], - 'weekdays' => ['Acaada', 'Etleeni', 'Talaata', 'Arbaqa', 'Kamiisi', 'Gumqata', 'Sabti'], - 'weekdays_short' => ['Aca', 'Etl', 'Tal', 'Arb', 'Kam', 'Gum', 'Sab'], - 'weekdays_min' => ['Aca', 'Etl', 'Tal', 'Arb', 'Kam', 'Gum', 'Sab'], - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['saaku', 'carra'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/af.php b/vendor/nesbot/carbon/src/Carbon/Lang/af.php deleted file mode 100644 index 27771d7a..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/af.php +++ /dev/null @@ -1,79 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - François B - * - JD Isaacks - * - Pierre du Plessis - */ -return [ - 'year' => ':count jaar', - 'a_year' => '\'n jaar|:count jaar', - 'y' => ':count j.', - 'month' => ':count maand|:count maande', - 'a_month' => '\'n maand|:count maande', - 'm' => ':count maa.', - 'week' => ':count week|:count weke', - 'a_week' => '\'n week|:count weke', - 'w' => ':count w.', - 'day' => ':count dag|:count dae', - 'a_day' => '\'n dag|:count dae', - 'd' => ':count d.', - 'hour' => ':count uur', - 'a_hour' => '\'n uur|:count uur', - 'h' => ':count u.', - 'minute' => ':count minuut|:count minute', - 'a_minute' => '\'n minuut|:count minute', - 'min' => ':count min.', - 'second' => ':count sekond|:count sekondes', - 'a_second' => '\'n paar sekondes|:count sekondes', - 's' => ':count s.', - 'ago' => ':time gelede', - 'from_now' => 'oor :time', - 'after' => ':time na', - 'before' => ':time voor', - 'diff_now' => 'Nou', - 'diff_today' => 'Vandag', - 'diff_today_regexp' => 'Vandag(?:\\s+om)?', - 'diff_yesterday' => 'Gister', - 'diff_yesterday_regexp' => 'Gister(?:\\s+om)?', - 'diff_tomorrow' => 'Môre', - 'diff_tomorrow_regexp' => 'Môre(?:\\s+om)?', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[Vandag om] LT', - 'nextDay' => '[Môre om] LT', - 'nextWeek' => 'dddd [om] LT', - 'lastDay' => '[Gister om] LT', - 'lastWeek' => '[Laas] dddd [om] LT', - 'sameElse' => 'L', - ], - 'ordinal' => function ($number) { - return $number.(($number === 1 || $number === 8 || $number >= 20) ? 'ste' : 'de'); - }, - 'meridiem' => ['VM', 'NM'], - 'months' => ['Januarie', 'Februarie', 'Maart', 'April', 'Mei', 'Junie', 'Julie', 'Augustus', 'September', 'Oktober', 'November', 'Desember'], - 'months_short' => ['Jan', 'Feb', 'Mrt', 'Apr', 'Mei', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Des'], - 'weekdays' => ['Sondag', 'Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrydag', 'Saterdag'], - 'weekdays_short' => ['Son', 'Maa', 'Din', 'Woe', 'Don', 'Vry', 'Sat'], - 'weekdays_min' => ['So', 'Ma', 'Di', 'Wo', 'Do', 'Vr', 'Sa'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' en '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/af_NA.php b/vendor/nesbot/carbon/src/Carbon/Lang/af_NA.php deleted file mode 100644 index f2fcf053..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/af_NA.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/af.php', [ - 'meridiem' => ['v', 'n'], - 'weekdays' => ['Sondag', 'Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrydag', 'Saterdag'], - 'weekdays_short' => ['So.', 'Ma.', 'Di.', 'Wo.', 'Do.', 'Vr.', 'Sa.'], - 'weekdays_min' => ['So.', 'Ma.', 'Di.', 'Wo.', 'Do.', 'Vr.', 'Sa.'], - 'months' => ['Januarie', 'Februarie', 'Maart', 'April', 'Mei', 'Junie', 'Julie', 'Augustus', 'September', 'Oktober', 'November', 'Desember'], - 'months_short' => ['Jan.', 'Feb.', 'Mrt.', 'Apr.', 'Mei', 'Jun.', 'Jul.', 'Aug.', 'Sep.', 'Okt.', 'Nov.', 'Des.'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'YYYY-MM-DD', - 'LL' => 'DD MMM YYYY', - 'LLL' => 'DD MMMM YYYY HH:mm', - 'LLLL' => 'dddd, DD MMMM YYYY HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/af_ZA.php b/vendor/nesbot/carbon/src/Carbon/Lang/af_ZA.php deleted file mode 100644 index 27896bd0..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/af_ZA.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/af.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/agq.php b/vendor/nesbot/carbon/src/Carbon/Lang/agq.php deleted file mode 100644 index 70114649..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/agq.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['a.g', 'a.k'], - 'weekdays' => ['tsuʔntsɨ', 'tsuʔukpà', 'tsuʔughɔe', 'tsuʔutɔ̀mlò', 'tsuʔumè', 'tsuʔughɨ̂m', 'tsuʔndzɨkɔʔɔ'], - 'weekdays_short' => ['nts', 'kpa', 'ghɔ', 'tɔm', 'ume', 'ghɨ', 'dzk'], - 'weekdays_min' => ['nts', 'kpa', 'ghɔ', 'tɔm', 'ume', 'ghɨ', 'dzk'], - 'months' => ['ndzɔ̀ŋɔ̀nùm', 'ndzɔ̀ŋɔ̀kƗ̀zùʔ', 'ndzɔ̀ŋɔ̀tƗ̀dʉ̀ghà', 'ndzɔ̀ŋɔ̀tǎafʉ̄ghā', 'ndzɔ̀ŋèsèe', 'ndzɔ̀ŋɔ̀nzùghò', 'ndzɔ̀ŋɔ̀dùmlo', 'ndzɔ̀ŋɔ̀kwîfɔ̀e', 'ndzɔ̀ŋɔ̀tƗ̀fʉ̀ghàdzughù', 'ndzɔ̀ŋɔ̀ghǔuwelɔ̀m', 'ndzɔ̀ŋɔ̀chwaʔàkaa wo', 'ndzɔ̀ŋèfwòo'], - 'months_short' => ['nùm', 'kɨz', 'tɨd', 'taa', 'see', 'nzu', 'dum', 'fɔe', 'dzu', 'lɔm', 'kaa', 'fwo'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'D/M/YYYY', - 'LL' => 'D MMM, YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/agr.php b/vendor/nesbot/carbon/src/Carbon/Lang/agr.php deleted file mode 100644 index 8f036ae8..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/agr.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/agr_PE.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/agr_PE.php b/vendor/nesbot/carbon/src/Carbon/Lang/agr_PE.php deleted file mode 100644 index 54a326af..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/agr_PE.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - somosazucar.org libc-alpha@sourceware.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YY', - ], - 'months' => ['Petsatin', 'Kupitin', 'Uyaitin', 'Tayutin', 'Kegketin', 'Tegmatin', 'Kuntutin', 'Yagkujutin', 'Daiktatin', 'Ipamtatin', 'Shinutin', 'Sakamtin'], - 'months_short' => ['Pet', 'Kup', 'Uya', 'Tay', 'Keg', 'Teg', 'Kun', 'Yag', 'Dait', 'Ipam', 'Shin', 'Sak'], - 'weekdays' => ['Tuntuamtin', 'Achutin', 'Kugkuktin', 'Saketin', 'Shimpitin', 'Imaptin', 'Bataetin'], - 'weekdays_short' => ['Tun', 'Ach', 'Kug', 'Sak', 'Shim', 'Im', 'Bat'], - 'weekdays_min' => ['Tun', 'Ach', 'Kug', 'Sak', 'Shim', 'Im', 'Bat'], - 'first_day_of_week' => 0, - 'day_of_first_week_of_year' => 7, - 'meridiem' => ['VM', 'NM'], - - 'year' => ':count yaya', // less reliable - 'y' => ':count yaya', // less reliable - 'a_year' => ':count yaya', // less reliable - - 'month' => ':count nantu', // less reliable - 'm' => ':count nantu', // less reliable - 'a_month' => ':count nantu', // less reliable - - 'day' => ':count nayaim', // less reliable - 'd' => ':count nayaim', // less reliable - 'a_day' => ':count nayaim', // less reliable - - 'hour' => ':count kuwiš', // less reliable - 'h' => ':count kuwiš', // less reliable - 'a_hour' => ':count kuwiš', // less reliable -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ak.php b/vendor/nesbot/carbon/src/Carbon/Lang/ak.php deleted file mode 100644 index 5a64be37..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ak.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/ak_GH.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ak_GH.php b/vendor/nesbot/carbon/src/Carbon/Lang/ak_GH.php deleted file mode 100644 index 13819467..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ak_GH.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Sugar Labs // OLPC sugarlabs.org libc-alpha@sourceware.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'YYYY/MM/DD', - ], - 'months' => ['Sanda-Ɔpɛpɔn', 'Kwakwar-Ɔgyefuo', 'Ebɔw-Ɔbenem', 'Ebɔbira-Oforisuo', 'Esusow Aketseaba-Kɔtɔnimba', 'Obirade-Ayɛwohomumu', 'Ayɛwoho-Kitawonsa', 'Difuu-Ɔsandaa', 'Fankwa-Ɛbɔ', 'Ɔbɛsɛ-Ahinime', 'Ɔberɛfɛw-Obubuo', 'Mumu-Ɔpɛnimba'], - 'months_short' => ['S-Ɔ', 'K-Ɔ', 'E-Ɔ', 'E-O', 'E-K', 'O-A', 'A-K', 'D-Ɔ', 'F-Ɛ', 'Ɔ-A', 'Ɔ-O', 'M-Ɔ'], - 'weekdays' => ['Kwesida', 'Dwowda', 'Benada', 'Wukuda', 'Yawda', 'Fida', 'Memeneda'], - 'weekdays_short' => ['Kwe', 'Dwo', 'Ben', 'Wuk', 'Yaw', 'Fia', 'Mem'], - 'weekdays_min' => ['Kwe', 'Dwo', 'Ben', 'Wuk', 'Yaw', 'Fia', 'Mem'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['AN', 'EW'], - - 'year' => ':count afe', - 'y' => ':count afe', - 'a_year' => ':count afe', - - 'month' => ':count bosume', - 'm' => ':count bosume', - 'a_month' => ':count bosume', - - 'day' => ':count ɛda', - 'd' => ':count ɛda', - 'a_day' => ':count ɛda', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/am.php b/vendor/nesbot/carbon/src/Carbon/Lang/am.php deleted file mode 100644 index 63bf72d2..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/am.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/am_ET.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/am_ET.php b/vendor/nesbot/carbon/src/Carbon/Lang/am_ET.php deleted file mode 100644 index ece80621..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/am_ET.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Ge'ez Frontier Foundation locales@geez.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YYYY', - ], - 'months' => ['ጃንዩወሪ', 'ፌብሩወሪ', 'ማርች', 'ኤፕሪል', 'ሜይ', 'ጁን', 'ጁላይ', 'ኦገስት', 'ሴፕቴምበር', 'ኦክቶበር', 'ኖቬምበር', 'ዲሴምበር'], - 'months_short' => ['ጃንዩ', 'ፌብሩ', 'ማርች', 'ኤፕረ', 'ሜይ ', 'ጁን ', 'ጁላይ', 'ኦገስ', 'ሴፕቴ', 'ኦክተ', 'ኖቬም', 'ዲሴም'], - 'weekdays' => ['እሑድ', 'ሰኞ', 'ማክሰኞ', 'ረቡዕ', 'ሐሙስ', 'ዓርብ', 'ቅዳሜ'], - 'weekdays_short' => ['እሑድ', 'ሰኞ ', 'ማክሰ', 'ረቡዕ', 'ሐሙስ', 'ዓርብ', 'ቅዳሜ'], - 'weekdays_min' => ['እሑድ', 'ሰኞ ', 'ማክሰ', 'ረቡዕ', 'ሐሙስ', 'ዓርብ', 'ቅዳሜ'], - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['ጡዋት', 'ከሰዓት'], - - 'year' => ':count አመት', - 'y' => ':count አመት', - 'a_year' => ':count አመት', - - 'month' => ':count ወር', - 'm' => ':count ወር', - 'a_month' => ':count ወር', - - 'week' => ':count ሳምንት', - 'w' => ':count ሳምንት', - 'a_week' => ':count ሳምንት', - - 'day' => ':count ቀን', - 'd' => ':count ቀን', - 'a_day' => ':count ቀን', - - 'hour' => ':count ሰዓት', - 'h' => ':count ሰዓት', - 'a_hour' => ':count ሰዓት', - - 'minute' => ':count ደቂቃ', - 'min' => ':count ደቂቃ', - 'a_minute' => ':count ደቂቃ', - - 'second' => ':count ሴኮንድ', - 's' => ':count ሴኮንድ', - 'a_second' => ':count ሴኮንድ', - - 'ago' => 'ከ:time በፊት', - 'from_now' => 'በ:time ውስጥ', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/an.php b/vendor/nesbot/carbon/src/Carbon/Lang/an.php deleted file mode 100644 index 565abf26..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/an.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/an_ES.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/an_ES.php b/vendor/nesbot/carbon/src/Carbon/Lang/an_ES.php deleted file mode 100644 index faf8ae07..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/an_ES.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Softaragones Jordi Mallach Pérez, Juan Pablo Martínez bug-glibc-locales@gnu.org, softaragones@softaragones.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YYYY', - ], - 'months' => ['chinero', 'febrero', 'marzo', 'abril', 'mayo', 'chunyo', 'chuliol', 'agosto', 'setiembre', 'octubre', 'noviembre', 'aviento'], - 'months_short' => ['chi', 'feb', 'mar', 'abr', 'may', 'chn', 'chl', 'ago', 'set', 'oct', 'nov', 'avi'], - 'weekdays' => ['domingo', 'luns', 'martes', 'mierques', 'chueves', 'viernes', 'sabado'], - 'weekdays_short' => ['dom', 'lun', 'mar', 'mie', 'chu', 'vie', 'sab'], - 'weekdays_min' => ['dom', 'lun', 'mar', 'mie', 'chu', 'vie', 'sab'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - - 'year' => ':count año', - 'y' => ':count año', - 'a_year' => ':count año', - - 'month' => ':count mes', - 'm' => ':count mes', - 'a_month' => ':count mes', - - 'week' => ':count semana', - 'w' => ':count semana', - 'a_week' => ':count semana', - - 'day' => ':count día', - 'd' => ':count día', - 'a_day' => ':count día', - - 'hour' => ':count reloch', // less reliable - 'h' => ':count reloch', // less reliable - 'a_hour' => ':count reloch', // less reliable - - 'minute' => ':count minuto', - 'min' => ':count minuto', - 'a_minute' => ':count minuto', - - 'second' => ':count segundo', - 's' => ':count segundo', - 'a_second' => ':count segundo', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/anp.php b/vendor/nesbot/carbon/src/Carbon/Lang/anp.php deleted file mode 100644 index b56c67bb..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/anp.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/anp_IN.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/anp_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/anp_IN.php deleted file mode 100644 index 11069be3..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/anp_IN.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - bhashaghar@googlegroups.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'D/M/YY', - ], - 'months' => ['जनवरी', 'फरवरी', 'मार्च', 'अप्रैल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितंबर', 'अक्टूबर', 'नवंबर', 'दिसंबर"'], - 'months_short' => ['जनवरी', 'फरवरी', 'मार्च', 'अप्रैल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितंबर', 'अक्टूबर', 'नवंबर', 'दिसंबर'], - 'weekdays' => ['रविवार', 'सोमवार', 'मंगलवार', 'बुधवार', 'बृहस्पतिवार', 'शुक्रवार', 'शनिवार'], - 'weekdays_short' => ['रवि', 'सोम', 'मंगल', 'बुध', 'बृहस्पति', 'शुक्र', 'शनि'], - 'weekdays_min' => ['रवि', 'सोम', 'मंगल', 'बुध', 'बृहस्पति', 'शुक्र', 'शनि'], - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['पूर्वाह्न', 'अपराह्न'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar.php deleted file mode 100644 index 5f73f639..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar.php +++ /dev/null @@ -1,93 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Atef Ben Ali (atefBB) - * - Ibrahim AshShohail - * - MLTDev - * - Mohamed Sabil (mohamedsabil83) - * - Yazan Alnugnugh (yazan-alnugnugh) - */ -$months = [ - 'يناير', - 'فبراير', - 'مارس', - 'أبريل', - 'مايو', - 'يونيو', - 'يوليو', - 'أغسطس', - 'سبتمبر', - 'أكتوبر', - 'نوفمبر', - 'ديسمبر', -]; - -return [ - 'year' => implode('|', ['{0}:count سنة', '{1}سنة', '{2}سنتين', ']2,11[:count سنوات', ']10,Inf[:count سنة']), - 'a_year' => implode('|', ['{0}:count سنة', '{1}سنة', '{2}سنتين', ']2,11[:count سنوات', ']10,Inf[:count سنة']), - 'month' => implode('|', ['{0}:count شهر', '{1}شهر', '{2}شهرين', ']2,11[:count أشهر', ']10,Inf[:count شهر']), - 'a_month' => implode('|', ['{0}:count شهر', '{1}شهر', '{2}شهرين', ']2,11[:count أشهر', ']10,Inf[:count شهر']), - 'week' => implode('|', ['{0}:count أسبوع', '{1}أسبوع', '{2}أسبوعين', ']2,11[:count أسابيع', ']10,Inf[:count أسبوع']), - 'a_week' => implode('|', ['{0}:count أسبوع', '{1}أسبوع', '{2}أسبوعين', ']2,11[:count أسابيع', ']10,Inf[:count أسبوع']), - 'day' => implode('|', ['{0}:count يوم', '{1}يوم', '{2}يومين', ']2,11[:count أيام', ']10,Inf[:count يوم']), - 'a_day' => implode('|', ['{0}:count يوم', '{1}يوم', '{2}يومين', ']2,11[:count أيام', ']10,Inf[:count يوم']), - 'hour' => implode('|', ['{0}:count ساعة', '{1}ساعة', '{2}ساعتين', ']2,11[:count ساعات', ']10,Inf[:count ساعة']), - 'a_hour' => implode('|', ['{0}:count ساعة', '{1}ساعة', '{2}ساعتين', ']2,11[:count ساعات', ']10,Inf[:count ساعة']), - 'minute' => implode('|', ['{0}:count دقيقة', '{1}دقيقة', '{2}دقيقتين', ']2,11[:count دقائق', ']10,Inf[:count دقيقة']), - 'a_minute' => implode('|', ['{0}:count دقيقة', '{1}دقيقة', '{2}دقيقتين', ']2,11[:count دقائق', ']10,Inf[:count دقيقة']), - 'second' => implode('|', ['{0}:count ثانية', '{1}ثانية', '{2}ثانيتين', ']2,11[:count ثواني', ']10,Inf[:count ثانية']), - 'a_second' => implode('|', ['{0}:count ثانية', '{1}ثانية', '{2}ثانيتين', ']2,11[:count ثواني', ']10,Inf[:count ثانية']), - 'ago' => 'منذ :time', - 'from_now' => ':time من الآن', - 'after' => 'بعد :time', - 'before' => 'قبل :time', - 'diff_now' => 'الآن', - 'diff_today' => 'اليوم', - 'diff_today_regexp' => 'اليوم(?:\\s+عند)?(?:\\s+الساعة)?', - 'diff_yesterday' => 'أمس', - 'diff_yesterday_regexp' => 'أمس(?:\\s+عند)?(?:\\s+الساعة)?', - 'diff_tomorrow' => 'غداً', - 'diff_tomorrow_regexp' => 'غدًا(?:\\s+عند)?(?:\\s+الساعة)?', - 'diff_before_yesterday' => 'قبل الأمس', - 'diff_after_tomorrow' => 'بعد غد', - 'period_recurrences' => implode('|', ['{0}مرة', '{1}مرة', '{2}:count مرتين', ']2,11[:count مرات', ']10,Inf[:count مرة']), - 'period_interval' => 'كل :interval', - 'period_start_date' => 'من :date', - 'period_end_date' => 'إلى :date', - 'months' => $months, - 'months_short' => $months, - 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], - 'weekdays_short' => ['أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'], - 'weekdays_min' => ['ح', 'اث', 'ثل', 'أر', 'خم', 'ج', 'س'], - 'list' => ['، ', ' و '], - 'first_day_of_week' => 6, - 'day_of_first_week_of_year' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'D/M/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[اليوم عند الساعة] LT', - 'nextDay' => '[غدًا عند الساعة] LT', - 'nextWeek' => 'dddd [عند الساعة] LT', - 'lastDay' => '[أمس عند الساعة] LT', - 'lastWeek' => 'dddd [عند الساعة] LT', - 'sameElse' => 'L', - ], - 'meridiem' => ['ص', 'م'], - 'weekend' => [5, 6], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_AE.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_AE.php deleted file mode 100644 index 75fe47f6..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_AE.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/ar.php', [ - 'formats' => [ - 'L' => 'DD MMM, YYYY', - ], - 'months' => ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'], - 'months_short' => ['ينا', 'فبر', 'مار', 'أبر', 'ماي', 'يون', 'يول', 'أغس', 'سبت', 'أكت', 'نوف', 'ديس'], - 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت '], - 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], - 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], - 'first_day_of_week' => 6, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_BH.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_BH.php deleted file mode 100644 index 362009e2..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_BH.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/ar.php', [ - 'formats' => [ - 'L' => 'DD MMM, YYYY', - ], - 'months' => ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'], - 'months_short' => ['ينا', 'فبر', 'مار', 'أبر', 'ماي', 'يون', 'يول', 'أغس', 'سبت', 'أكت', 'نوف', 'ديس'], - 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], - 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], - 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], - 'first_day_of_week' => 6, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_DJ.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_DJ.php deleted file mode 100644 index e790b99e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_DJ.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/ar.php', [ -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_DZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_DZ.php deleted file mode 100644 index aea4eeec..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_DZ.php +++ /dev/null @@ -1,92 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Authors: - * - Josh Soref - * - Noureddine LOUAHEDJ - * - JD Isaacks - * - Atef Ben Ali (atefBB) - * - Mohamed Sabil (mohamedsabil83) - */ -$months = [ - 'جانفي', - 'فيفري', - 'مارس', - 'أفريل', - 'ماي', - 'جوان', - 'جويلية', - 'أوت', - 'سبتمبر', - 'أكتوبر', - 'نوفمبر', - 'ديسمبر', -]; - -return [ - 'year' => implode('|', ['{0}:count سنة', '{1}سنة', '{2}سنتين', ']2,11[:count سنوات', ']10,Inf[:count سنة']), - 'a_year' => implode('|', ['{0}:count سنة', '{1}سنة', '{2}سنتين', ']2,11[:count سنوات', ']10,Inf[:count سنة']), - 'month' => implode('|', ['{0}:count شهر', '{1}شهر', '{2}شهرين', ']2,11[:count أشهر', ']10,Inf[:count شهر']), - 'a_month' => implode('|', ['{0}:count شهر', '{1}شهر', '{2}شهرين', ']2,11[:count أشهر', ']10,Inf[:count شهر']), - 'week' => implode('|', ['{0}:count أسبوع', '{1}أسبوع', '{2}أسبوعين', ']2,11[:count أسابيع', ']10,Inf[:count أسبوع']), - 'a_week' => implode('|', ['{0}:count أسبوع', '{1}أسبوع', '{2}أسبوعين', ']2,11[:count أسابيع', ']10,Inf[:count أسبوع']), - 'day' => implode('|', ['{0}:count يوم', '{1}يوم', '{2}يومين', ']2,11[:count أيام', ']10,Inf[:count يوم']), - 'a_day' => implode('|', ['{0}:count يوم', '{1}يوم', '{2}يومين', ']2,11[:count أيام', ']10,Inf[:count يوم']), - 'hour' => implode('|', ['{0}:count ساعة', '{1}ساعة', '{2}ساعتين', ']2,11[:count ساعات', ']10,Inf[:count ساعة']), - 'a_hour' => implode('|', ['{0}:count ساعة', '{1}ساعة', '{2}ساعتين', ']2,11[:count ساعات', ']10,Inf[:count ساعة']), - 'minute' => implode('|', ['{0}:count دقيقة', '{1}دقيقة', '{2}دقيقتين', ']2,11[:count دقائق', ']10,Inf[:count دقيقة']), - 'a_minute' => implode('|', ['{0}:count دقيقة', '{1}دقيقة', '{2}دقيقتين', ']2,11[:count دقائق', ']10,Inf[:count دقيقة']), - 'second' => implode('|', ['{0}:count ثانية', '{1}ثانية', '{2}ثانيتين', ']2,11[:count ثواني', ']10,Inf[:count ثانية']), - 'a_second' => implode('|', ['{0}:count ثانية', '{1}ثانية', '{2}ثانيتين', ']2,11[:count ثواني', ']10,Inf[:count ثانية']), - 'ago' => 'منذ :time', - 'from_now' => 'في :time', - 'after' => 'بعد :time', - 'before' => 'قبل :time', - 'diff_now' => 'الآن', - 'diff_today' => 'اليوم', - 'diff_today_regexp' => 'اليوم(?:\\s+على)?(?:\\s+الساعة)?', - 'diff_yesterday' => 'أمس', - 'diff_yesterday_regexp' => 'أمس(?:\\s+على)?(?:\\s+الساعة)?', - 'diff_tomorrow' => 'غداً', - 'diff_tomorrow_regexp' => 'غدا(?:\\s+على)?(?:\\s+الساعة)?', - 'diff_before_yesterday' => 'قبل الأمس', - 'diff_after_tomorrow' => 'بعد غد', - 'period_recurrences' => implode('|', ['{0}مرة', '{1}مرة', '{2}:count مرتين', ']2,11[:count مرات', ']10,Inf[:count مرة']), - 'period_interval' => 'كل :interval', - 'period_start_date' => 'من :date', - 'period_end_date' => 'إلى :date', - 'months' => $months, - 'months_short' => $months, - 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], - 'weekdays_short' => ['أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'], - 'weekdays_min' => ['أح', 'إث', 'ثلا', 'أر', 'خم', 'جم', 'سب'], - 'list' => ['، ', ' و '], - 'first_day_of_week' => 0, - 'day_of_first_week_of_year' => 4, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[اليوم على الساعة] LT', - 'nextDay' => '[غدا على الساعة] LT', - 'nextWeek' => 'dddd [على الساعة] LT', - 'lastDay' => '[أمس على الساعة] LT', - 'lastWeek' => 'dddd [على الساعة] LT', - 'sameElse' => 'L', - ], - 'meridiem' => ['ص', 'م'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_EG.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_EG.php deleted file mode 100644 index 362009e2..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_EG.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/ar.php', [ - 'formats' => [ - 'L' => 'DD MMM, YYYY', - ], - 'months' => ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'], - 'months_short' => ['ينا', 'فبر', 'مار', 'أبر', 'ماي', 'يون', 'يول', 'أغس', 'سبت', 'أكت', 'نوف', 'ديس'], - 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], - 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], - 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], - 'first_day_of_week' => 6, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_EH.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_EH.php deleted file mode 100644 index e790b99e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_EH.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/ar.php', [ -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_ER.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_ER.php deleted file mode 100644 index e790b99e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_ER.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/ar.php', [ -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_IL.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_IL.php deleted file mode 100644 index e790b99e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_IL.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/ar.php', [ -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_IN.php deleted file mode 100644 index 5fecf70f..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_IN.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/ar.php', [ - 'formats' => [ - 'L' => 'D/M/YY', - ], - 'months' => ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'], - 'months_short' => ['ينا', 'فبر', 'مار', 'أبر', 'ماي', 'يون', 'يول', 'أغس', 'سبت', 'أكت', 'نوف', 'ديس'], - 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], - 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], - 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_IQ.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_IQ.php deleted file mode 100644 index 0ac09958..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_IQ.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/ar.php', [ - 'formats' => [ - 'L' => 'DD MMM, YYYY', - ], - 'months' => ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'أيار', 'حزيران', 'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'], - 'months_short' => ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'أيار', 'حزيران', 'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'], - 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], - 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], - 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], - 'first_day_of_week' => 6, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_JO.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_JO.php deleted file mode 100644 index 0ac09958..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_JO.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/ar.php', [ - 'formats' => [ - 'L' => 'DD MMM, YYYY', - ], - 'months' => ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'أيار', 'حزيران', 'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'], - 'months_short' => ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'أيار', 'حزيران', 'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'], - 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], - 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], - 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], - 'first_day_of_week' => 6, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_KM.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_KM.php deleted file mode 100644 index e790b99e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_KM.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/ar.php', [ -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_KW.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_KW.php deleted file mode 100644 index e6f0531d..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_KW.php +++ /dev/null @@ -1,93 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Authors: - * - Josh Soref - * - Nusret Parlak - * - JD Isaacks - * - Atef Ben Ali (atefBB) - * - Mohamed Sabil (mohamedsabil83) - */ -$months = [ - 'يناير', - 'فبراير', - 'مارس', - 'أبريل', - 'ماي', - 'يونيو', - 'يوليوز', - 'غشت', - 'شتنبر', - 'أكتوبر', - 'نونبر', - 'دجنبر', -]; - -return [ - 'year' => implode('|', ['{0}:count سنة', '{1}سنة', '{2}سنتين', ']2,11[:count سنوات', ']10,Inf[:count سنة']), - 'a_year' => implode('|', ['{0}:count سنة', '{1}سنة', '{2}سنتين', ']2,11[:count سنوات', ']10,Inf[:count سنة']), - 'month' => implode('|', ['{0}:count شهر', '{1}شهر', '{2}شهرين', ']2,11[:count أشهر', ']10,Inf[:count شهر']), - 'a_month' => implode('|', ['{0}:count شهر', '{1}شهر', '{2}شهرين', ']2,11[:count أشهر', ']10,Inf[:count شهر']), - 'week' => implode('|', ['{0}:count أسبوع', '{1}أسبوع', '{2}أسبوعين', ']2,11[:count أسابيع', ']10,Inf[:count أسبوع']), - 'a_week' => implode('|', ['{0}:count أسبوع', '{1}أسبوع', '{2}أسبوعين', ']2,11[:count أسابيع', ']10,Inf[:count أسبوع']), - 'day' => implode('|', ['{0}:count يوم', '{1}يوم', '{2}يومين', ']2,11[:count أيام', ']10,Inf[:count يوم']), - 'a_day' => implode('|', ['{0}:count يوم', '{1}يوم', '{2}يومين', ']2,11[:count أيام', ']10,Inf[:count يوم']), - 'hour' => implode('|', ['{0}:count ساعة', '{1}ساعة', '{2}ساعتين', ']2,11[:count ساعات', ']10,Inf[:count ساعة']), - 'a_hour' => implode('|', ['{0}:count ساعة', '{1}ساعة', '{2}ساعتين', ']2,11[:count ساعات', ']10,Inf[:count ساعة']), - 'minute' => implode('|', ['{0}:count دقيقة', '{1}دقيقة', '{2}دقيقتين', ']2,11[:count دقائق', ']10,Inf[:count دقيقة']), - 'a_minute' => implode('|', ['{0}:count دقيقة', '{1}دقيقة', '{2}دقيقتين', ']2,11[:count دقائق', ']10,Inf[:count دقيقة']), - 'second' => implode('|', ['{0}:count ثانية', '{1}ثانية', '{2}ثانيتين', ']2,11[:count ثواني', ']10,Inf[:count ثانية']), - 'a_second' => implode('|', ['{0}:count ثانية', '{1}ثانية', '{2}ثانيتين', ']2,11[:count ثواني', ']10,Inf[:count ثانية']), - 'ago' => 'منذ :time', - 'from_now' => 'في :time', - 'after' => 'بعد :time', - 'before' => 'قبل :time', - 'diff_now' => 'الآن', - 'diff_today' => 'اليوم', - 'diff_today_regexp' => 'اليوم(?:\\s+على)?(?:\\s+الساعة)?', - 'diff_yesterday' => 'أمس', - 'diff_yesterday_regexp' => 'أمس(?:\\s+على)?(?:\\s+الساعة)?', - 'diff_tomorrow' => 'غداً', - 'diff_tomorrow_regexp' => 'غدا(?:\\s+على)?(?:\\s+الساعة)?', - 'diff_before_yesterday' => 'قبل الأمس', - 'diff_after_tomorrow' => 'بعد غد', - 'period_recurrences' => implode('|', ['{0}مرة', '{1}مرة', '{2}:count مرتين', ']2,11[:count مرات', ']10,Inf[:count مرة']), - 'period_interval' => 'كل :interval', - 'period_start_date' => 'من :date', - 'period_end_date' => 'إلى :date', - 'months' => $months, - 'months_short' => $months, - 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], - 'weekdays_short' => ['أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'], - 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], - 'list' => ['، ', ' و '], - 'first_day_of_week' => 0, - 'day_of_first_week_of_year' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[اليوم على الساعة] LT', - 'nextDay' => '[غدا على الساعة] LT', - 'nextWeek' => 'dddd [على الساعة] LT', - 'lastDay' => '[أمس على الساعة] LT', - 'lastWeek' => 'dddd [على الساعة] LT', - 'sameElse' => 'L', - ], - 'meridiem' => ['ص', 'م'], - 'weekend' => [5, 6], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_LB.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_LB.php deleted file mode 100644 index 55bb10c3..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_LB.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/ar.php', [ - 'formats' => [ - 'L' => 'DD MMM, YYYY', - ], - 'months' => ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'أيار', 'حزيران', 'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'], - 'months_short' => ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'أيار', 'حزيران', 'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'], - 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], - 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], - 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_LY.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_LY.php deleted file mode 100644 index 1f0af49d..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_LY.php +++ /dev/null @@ -1,92 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Atef Ben Ali (atefBB) - * - Ibrahim AshShohail - * - MLTDev - */ - -$months = [ - 'يناير', - 'فبراير', - 'مارس', - 'أبريل', - 'مايو', - 'يونيو', - 'يوليو', - 'أغسطس', - 'سبتمبر', - 'أكتوبر', - 'نوفمبر', - 'ديسمبر', -]; - -return [ - 'year' => implode('|', [':count سنة', 'سنة', 'سنتين', ':count سنوات', ':count سنة']), - 'a_year' => implode('|', [':count سنة', 'سنة', 'سنتين', ':count سنوات', ':count سنة']), - 'month' => implode('|', [':count شهر', 'شهر', 'شهرين', ':count أشهر', ':count شهر']), - 'a_month' => implode('|', [':count شهر', 'شهر', 'شهرين', ':count أشهر', ':count شهر']), - 'week' => implode('|', [':count أسبوع', 'أسبوع', 'أسبوعين', ':count أسابيع', ':count أسبوع']), - 'a_week' => implode('|', [':count أسبوع', 'أسبوع', 'أسبوعين', ':count أسابيع', ':count أسبوع']), - 'day' => implode('|', [':count يوم', 'يوم', 'يومين', ':count أيام', ':count يوم']), - 'a_day' => implode('|', [':count يوم', 'يوم', 'يومين', ':count أيام', ':count يوم']), - 'hour' => implode('|', [':count ساعة', 'ساعة', 'ساعتين', ':count ساعات', ':count ساعة']), - 'a_hour' => implode('|', [':count ساعة', 'ساعة', 'ساعتين', ':count ساعات', ':count ساعة']), - 'minute' => implode('|', [':count دقيقة', 'دقيقة', 'دقيقتين', ':count دقائق', ':count دقيقة']), - 'a_minute' => implode('|', [':count دقيقة', 'دقيقة', 'دقيقتين', ':count دقائق', ':count دقيقة']), - 'second' => implode('|', [':count ثانية', 'ثانية', 'ثانيتين', ':count ثواني', ':count ثانية']), - 'a_second' => implode('|', [':count ثانية', 'ثانية', 'ثانيتين', ':count ثواني', ':count ثانية']), - 'ago' => 'منذ :time', - 'from_now' => ':time من الآن', - 'after' => 'بعد :time', - 'before' => 'قبل :time', - 'diff_now' => 'الآن', - 'diff_today' => 'اليوم', - 'diff_today_regexp' => 'اليوم(?:\\s+عند)?(?:\\s+الساعة)?', - 'diff_yesterday' => 'أمس', - 'diff_yesterday_regexp' => 'أمس(?:\\s+عند)?(?:\\s+الساعة)?', - 'diff_tomorrow' => 'غداً', - 'diff_tomorrow_regexp' => 'غدًا(?:\\s+عند)?(?:\\s+الساعة)?', - 'diff_before_yesterday' => 'قبل الأمس', - 'diff_after_tomorrow' => 'بعد غد', - 'period_recurrences' => implode('|', ['مرة', 'مرة', ':count مرتين', ':count مرات', ':count مرة']), - 'period_interval' => 'كل :interval', - 'period_start_date' => 'من :date', - 'period_end_date' => 'إلى :date', - 'months' => $months, - 'months_short' => $months, - 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], - 'weekdays_short' => ['أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'], - 'weekdays_min' => ['ح', 'اث', 'ثل', 'أر', 'خم', 'ج', 'س'], - 'list' => ['، ', ' و '], - 'first_day_of_week' => 6, - 'day_of_first_week_of_year' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'D/M/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[اليوم عند الساعة] LT', - 'nextDay' => '[غدًا عند الساعة] LT', - 'nextWeek' => 'dddd [عند الساعة] LT', - 'lastDay' => '[أمس عند الساعة] LT', - 'lastWeek' => 'dddd [عند الساعة] LT', - 'sameElse' => 'L', - ], - 'meridiem' => ['ص', 'م'], - 'weekend' => [5, 6], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_MA.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_MA.php deleted file mode 100644 index 047ae05a..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_MA.php +++ /dev/null @@ -1,92 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Authors: - * - Josh Soref - * - JD Isaacks - * - Atef Ben Ali (atefBB) - * - Mohamed Sabil (mohamedsabil83) - */ -$months = [ - 'يناير', - 'فبراير', - 'مارس', - 'أبريل', - 'ماي', - 'يونيو', - 'يوليوز', - 'غشت', - 'شتنبر', - 'أكتوبر', - 'نونبر', - 'دجنبر', -]; - -return [ - 'year' => implode('|', ['{0}:count سنة', '{1}سنة', '{2}سنتين', ']2,11[:count سنوات', ']10,Inf[:count سنة']), - 'a_year' => implode('|', ['{0}:count سنة', '{1}سنة', '{2}سنتين', ']2,11[:count سنوات', ']10,Inf[:count سنة']), - 'month' => implode('|', ['{0}:count شهر', '{1}شهر', '{2}شهرين', ']2,11[:count أشهر', ']10,Inf[:count شهر']), - 'a_month' => implode('|', ['{0}:count شهر', '{1}شهر', '{2}شهرين', ']2,11[:count أشهر', ']10,Inf[:count شهر']), - 'week' => implode('|', ['{0}:count أسبوع', '{1}أسبوع', '{2}أسبوعين', ']2,11[:count أسابيع', ']10,Inf[:count أسبوع']), - 'a_week' => implode('|', ['{0}:count أسبوع', '{1}أسبوع', '{2}أسبوعين', ']2,11[:count أسابيع', ']10,Inf[:count أسبوع']), - 'day' => implode('|', ['{0}:count يوم', '{1}يوم', '{2}يومين', ']2,11[:count أيام', ']10,Inf[:count يوم']), - 'a_day' => implode('|', ['{0}:count يوم', '{1}يوم', '{2}يومين', ']2,11[:count أيام', ']10,Inf[:count يوم']), - 'hour' => implode('|', ['{0}:count ساعة', '{1}ساعة', '{2}ساعتين', ']2,11[:count ساعات', ']10,Inf[:count ساعة']), - 'a_hour' => implode('|', ['{0}:count ساعة', '{1}ساعة', '{2}ساعتين', ']2,11[:count ساعات', ']10,Inf[:count ساعة']), - 'minute' => implode('|', ['{0}:count دقيقة', '{1}دقيقة', '{2}دقيقتين', ']2,11[:count دقائق', ']10,Inf[:count دقيقة']), - 'a_minute' => implode('|', ['{0}:count دقيقة', '{1}دقيقة', '{2}دقيقتين', ']2,11[:count دقائق', ']10,Inf[:count دقيقة']), - 'second' => implode('|', ['{0}:count ثانية', '{1}ثانية', '{2}ثانيتين', ']2,11[:count ثواني', ']10,Inf[:count ثانية']), - 'a_second' => implode('|', ['{0}:count ثانية', '{1}ثانية', '{2}ثانيتين', ']2,11[:count ثواني', ']10,Inf[:count ثانية']), - 'ago' => 'منذ :time', - 'from_now' => 'في :time', - 'after' => 'بعد :time', - 'before' => 'قبل :time', - 'diff_now' => 'الآن', - 'diff_today' => 'اليوم', - 'diff_today_regexp' => 'اليوم(?:\\s+على)?(?:\\s+الساعة)?', - 'diff_yesterday' => 'أمس', - 'diff_yesterday_regexp' => 'أمس(?:\\s+على)?(?:\\s+الساعة)?', - 'diff_tomorrow' => 'غداً', - 'diff_tomorrow_regexp' => 'غدا(?:\\s+على)?(?:\\s+الساعة)?', - 'diff_before_yesterday' => 'قبل الأمس', - 'diff_after_tomorrow' => 'بعد غد', - 'period_recurrences' => implode('|', ['{0}مرة', '{1}مرة', '{2}:count مرتين', ']2,11[:count مرات', ']10,Inf[:count مرة']), - 'period_interval' => 'كل :interval', - 'period_start_date' => 'من :date', - 'period_end_date' => 'إلى :date', - 'months' => $months, - 'months_short' => $months, - 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], - 'weekdays_short' => ['أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'], - 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], - 'list' => ['، ', ' و '], - 'first_day_of_week' => 6, - 'day_of_first_week_of_year' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[اليوم على الساعة] LT', - 'nextDay' => '[غدا على الساعة] LT', - 'nextWeek' => 'dddd [على الساعة] LT', - 'lastDay' => '[أمس على الساعة] LT', - 'lastWeek' => 'dddd [على الساعة] LT', - 'sameElse' => 'L', - ], - 'meridiem' => ['ص', 'م'], - 'weekend' => [5, 6], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_MR.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_MR.php deleted file mode 100644 index e790b99e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_MR.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/ar.php', [ -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_OM.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_OM.php deleted file mode 100644 index 362009e2..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_OM.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/ar.php', [ - 'formats' => [ - 'L' => 'DD MMM, YYYY', - ], - 'months' => ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'], - 'months_short' => ['ينا', 'فبر', 'مار', 'أبر', 'ماي', 'يون', 'يول', 'أغس', 'سبت', 'أكت', 'نوف', 'ديس'], - 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], - 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], - 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], - 'first_day_of_week' => 6, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_PS.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_PS.php deleted file mode 100644 index e790b99e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_PS.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/ar.php', [ -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_QA.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_QA.php deleted file mode 100644 index 362009e2..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_QA.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/ar.php', [ - 'formats' => [ - 'L' => 'DD MMM, YYYY', - ], - 'months' => ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'], - 'months_short' => ['ينا', 'فبر', 'مار', 'أبر', 'ماي', 'يون', 'يول', 'أغس', 'سبت', 'أكت', 'نوف', 'ديس'], - 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], - 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], - 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], - 'first_day_of_week' => 6, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_SA.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_SA.php deleted file mode 100644 index 10aaa2ed..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_SA.php +++ /dev/null @@ -1,92 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Authors: - * - Josh Soref - * - JD Isaacks - * - Atef Ben Ali (atefBB) - * - Mohamed Sabil (mohamedsabil83) - */ -$months = [ - 'يناير', - 'فبراير', - 'مارس', - 'أبريل', - 'مايو', - 'يونيو', - 'يوليو', - 'أغسطس', - 'سبتمبر', - 'أكتوبر', - 'نوفمبر', - 'ديسمبر', -]; - -return [ - 'year' => implode('|', ['{0}:count سنة', '{1}سنة', '{2}سنتين', ']2,11[:count سنوات', ']10,Inf[:count سنة']), - 'a_year' => implode('|', ['{0}:count سنة', '{1}سنة', '{2}سنتين', ']2,11[:count سنوات', ']10,Inf[:count سنة']), - 'month' => implode('|', ['{0}:count شهر', '{1}شهر', '{2}شهرين', ']2,11[:count أشهر', ']10,Inf[:count شهر']), - 'a_month' => implode('|', ['{0}:count شهر', '{1}شهر', '{2}شهرين', ']2,11[:count أشهر', ']10,Inf[:count شهر']), - 'week' => implode('|', ['{0}:count أسبوع', '{1}أسبوع', '{2}أسبوعين', ']2,11[:count أسابيع', ']10,Inf[:count أسبوع']), - 'a_week' => implode('|', ['{0}:count أسبوع', '{1}أسبوع', '{2}أسبوعين', ']2,11[:count أسابيع', ']10,Inf[:count أسبوع']), - 'day' => implode('|', ['{0}:count يوم', '{1}يوم', '{2}يومين', ']2,11[:count أيام', ']10,Inf[:count يوم']), - 'a_day' => implode('|', ['{0}:count يوم', '{1}يوم', '{2}يومين', ']2,11[:count أيام', ']10,Inf[:count يوم']), - 'hour' => implode('|', ['{0}:count ساعة', '{1}ساعة', '{2}ساعتين', ']2,11[:count ساعات', ']10,Inf[:count ساعة']), - 'a_hour' => implode('|', ['{0}:count ساعة', '{1}ساعة', '{2}ساعتين', ']2,11[:count ساعات', ']10,Inf[:count ساعة']), - 'minute' => implode('|', ['{0}:count دقيقة', '{1}دقيقة', '{2}دقيقتين', ']2,11[:count دقائق', ']10,Inf[:count دقيقة']), - 'a_minute' => implode('|', ['{0}:count دقيقة', '{1}دقيقة', '{2}دقيقتين', ']2,11[:count دقائق', ']10,Inf[:count دقيقة']), - 'second' => implode('|', ['{0}:count ثانية', '{1}ثانية', '{2}ثانيتين', ']2,11[:count ثواني', ']10,Inf[:count ثانية']), - 'a_second' => implode('|', ['{0}:count ثانية', '{1}ثانية', '{2}ثانيتين', ']2,11[:count ثواني', ']10,Inf[:count ثانية']), - 'ago' => 'منذ :time', - 'from_now' => 'في :time', - 'after' => 'بعد :time', - 'before' => 'قبل :time', - 'diff_now' => 'الآن', - 'diff_today' => 'اليوم', - 'diff_today_regexp' => 'اليوم(?:\\s+على)?(?:\\s+الساعة)?', - 'diff_yesterday' => 'أمس', - 'diff_yesterday_regexp' => 'أمس(?:\\s+على)?(?:\\s+الساعة)?', - 'diff_tomorrow' => 'غداً', - 'diff_tomorrow_regexp' => 'غدا(?:\\s+على)?(?:\\s+الساعة)?', - 'diff_before_yesterday' => 'قبل الأمس', - 'diff_after_tomorrow' => 'بعد غد', - 'period_recurrences' => implode('|', ['{0}مرة', '{1}مرة', '{2}:count مرتين', ']2,11[:count مرات', ']10,Inf[:count مرة']), - 'period_interval' => 'كل :interval', - 'period_start_date' => 'من :date', - 'period_end_date' => 'إلى :date', - 'months' => $months, - 'months_short' => $months, - 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], - 'weekdays_short' => ['أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'], - 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], - 'list' => ['، ', ' و '], - 'first_day_of_week' => 6, - 'day_of_first_week_of_year' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[اليوم على الساعة] LT', - 'nextDay' => '[غدا على الساعة] LT', - 'nextWeek' => 'dddd [على الساعة] LT', - 'lastDay' => '[أمس على الساعة] LT', - 'lastWeek' => 'dddd [على الساعة] LT', - 'sameElse' => 'L', - ], - 'meridiem' => ['ص', 'م'], - 'weekend' => [5, 6], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_SD.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_SD.php deleted file mode 100644 index 362009e2..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_SD.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/ar.php', [ - 'formats' => [ - 'L' => 'DD MMM, YYYY', - ], - 'months' => ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'], - 'months_short' => ['ينا', 'فبر', 'مار', 'أبر', 'ماي', 'يون', 'يول', 'أغس', 'سبت', 'أكت', 'نوف', 'ديس'], - 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], - 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], - 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], - 'first_day_of_week' => 6, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_SO.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_SO.php deleted file mode 100644 index e790b99e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_SO.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/ar.php', [ -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_SS.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_SS.php deleted file mode 100644 index 32f32825..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_SS.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/ar.php', [ - 'formats' => [ - 'L' => 'DD MMM, YYYY', - ], - 'months' => ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'], - 'months_short' => ['ينا', 'فبر', 'مار', 'أبر', 'ماي', 'يون', 'يول', 'أغس', 'سبت', 'أكت', 'نوف', 'ديس'], - 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], - 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], - 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_SY.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_SY.php deleted file mode 100644 index 0ac09958..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_SY.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/ar.php', [ - 'formats' => [ - 'L' => 'DD MMM, YYYY', - ], - 'months' => ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'أيار', 'حزيران', 'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'], - 'months_short' => ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'أيار', 'حزيران', 'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'], - 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], - 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], - 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], - 'first_day_of_week' => 6, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_Shakl.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_Shakl.php deleted file mode 100644 index c2d4b43d..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_Shakl.php +++ /dev/null @@ -1,95 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Abdellah Chadidi - * - Atef Ben Ali (atefBB) - * - Mohamed Sabil (mohamedsabil83) - */ -// Same for long and short -$months = [ - // @TODO add shakl to months - 'يناير', - 'فبراير', - 'مارس', - 'أبريل', - 'مايو', - 'يونيو', - 'يوليو', - 'أغسطس', - 'سبتمبر', - 'أكتوبر', - 'نوفمبر', - 'ديسمبر', -]; - -return [ - 'year' => implode('|', ['{0}:count سَنَة', '{1}سَنَة', '{2}سَنَتَيْن', ']2,11[:count سَنَوَات', ']10,Inf[:count سَنَة']), - 'a_year' => implode('|', ['{0}:count سَنَة', '{1}سَنَة', '{2}سَنَتَيْن', ']2,11[:count سَنَوَات', ']10,Inf[:count سَنَة']), - 'month' => implode('|', ['{0}:count شَهْرَ', '{1}شَهْرَ', '{2}شَهْرَيْن', ']2,11[:count أَشْهُر', ']10,Inf[:count شَهْرَ']), - 'a_month' => implode('|', ['{0}:count شَهْرَ', '{1}شَهْرَ', '{2}شَهْرَيْن', ']2,11[:count أَشْهُر', ']10,Inf[:count شَهْرَ']), - 'week' => implode('|', ['{0}:count أُسْبُوع', '{1}أُسْبُوع', '{2}أُسْبُوعَيْن', ']2,11[:count أَسَابِيع', ']10,Inf[:count أُسْبُوع']), - 'a_week' => implode('|', ['{0}:count أُسْبُوع', '{1}أُسْبُوع', '{2}أُسْبُوعَيْن', ']2,11[:count أَسَابِيع', ']10,Inf[:count أُسْبُوع']), - 'day' => implode('|', ['{0}:count يَوْم', '{1}يَوْم', '{2}يَوْمَيْن', ']2,11[:count أَيَّام', ']10,Inf[:count يَوْم']), - 'a_day' => implode('|', ['{0}:count يَوْم', '{1}يَوْم', '{2}يَوْمَيْن', ']2,11[:count أَيَّام', ']10,Inf[:count يَوْم']), - 'hour' => implode('|', ['{0}:count سَاعَة', '{1}سَاعَة', '{2}سَاعَتَيْن', ']2,11[:count سَاعَات', ']10,Inf[:count سَاعَة']), - 'a_hour' => implode('|', ['{0}:count سَاعَة', '{1}سَاعَة', '{2}سَاعَتَيْن', ']2,11[:count سَاعَات', ']10,Inf[:count سَاعَة']), - 'minute' => implode('|', ['{0}:count دَقِيقَة', '{1}دَقِيقَة', '{2}دَقِيقَتَيْن', ']2,11[:count دَقَائِق', ']10,Inf[:count دَقِيقَة']), - 'a_minute' => implode('|', ['{0}:count دَقِيقَة', '{1}دَقِيقَة', '{2}دَقِيقَتَيْن', ']2,11[:count دَقَائِق', ']10,Inf[:count دَقِيقَة']), - 'second' => implode('|', ['{0}:count ثَانِيَة', '{1}ثَانِيَة', '{2}ثَانِيَتَيْن', ']2,11[:count ثَوَان', ']10,Inf[:count ثَانِيَة']), - 'a_second' => implode('|', ['{0}:count ثَانِيَة', '{1}ثَانِيَة', '{2}ثَانِيَتَيْن', ']2,11[:count ثَوَان', ']10,Inf[:count ثَانِيَة']), - 'ago' => 'مُنْذُ :time', - 'from_now' => 'مِنَ الْآن :time', - 'after' => 'بَعْدَ :time', - 'before' => 'قَبْلَ :time', - - // @TODO add shakl to translations below - 'diff_now' => 'الآن', - 'diff_today' => 'اليوم', - 'diff_today_regexp' => 'اليوم(?:\\s+عند)?(?:\\s+الساعة)?', - 'diff_yesterday' => 'أمس', - 'diff_yesterday_regexp' => 'أمس(?:\\s+عند)?(?:\\s+الساعة)?', - 'diff_tomorrow' => 'غداً', - 'diff_tomorrow_regexp' => 'غدًا(?:\\s+عند)?(?:\\s+الساعة)?', - 'diff_before_yesterday' => 'قبل الأمس', - 'diff_after_tomorrow' => 'بعد غد', - 'period_recurrences' => implode('|', ['{0}مرة', '{1}مرة', '{2}:count مرتين', ']2,11[:count مرات', ']10,Inf[:count مرة']), - 'period_interval' => 'كل :interval', - 'period_start_date' => 'من :date', - 'period_end_date' => 'إلى :date', - 'months' => $months, - 'months_short' => $months, - 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], - 'weekdays_short' => ['أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'], - 'weekdays_min' => ['ح', 'اث', 'ثل', 'أر', 'خم', 'ج', 'س'], - 'list' => ['، ', ' و '], - 'first_day_of_week' => 6, - 'day_of_first_week_of_year' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'D/M/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[اليوم عند الساعة] LT', - 'nextDay' => '[غدًا عند الساعة] LT', - 'nextWeek' => 'dddd [عند الساعة] LT', - 'lastDay' => '[أمس عند الساعة] LT', - 'lastWeek' => 'dddd [عند الساعة] LT', - 'sameElse' => 'L', - ], - 'meridiem' => ['ص', 'م'], - 'weekend' => [5, 6], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_TD.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_TD.php deleted file mode 100644 index e790b99e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_TD.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/ar.php', [ -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_TN.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_TN.php deleted file mode 100644 index f096678f..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_TN.php +++ /dev/null @@ -1,91 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Authors: - * - JD Isaacks - * - Atef Ben Ali (atefBB) - * - Mohamed Sabil (mohamedsabil83) - */ -$months = [ - 'جانفي', - 'فيفري', - 'مارس', - 'أفريل', - 'ماي', - 'جوان', - 'جويلية', - 'أوت', - 'سبتمبر', - 'أكتوبر', - 'نوفمبر', - 'ديسمبر', -]; - -return [ - 'year' => implode('|', ['{0}:count سنة', '{1}سنة', '{2}سنتين', ']2,11[:count سنوات', ']10,Inf[:count سنة']), - 'a_year' => implode('|', ['{0}:count سنة', '{1}سنة', '{2}سنتين', ']2,11[:count سنوات', ']10,Inf[:count سنة']), - 'month' => implode('|', ['{0}:count شهر', '{1}شهر', '{2}شهرين', ']2,11[:count أشهر', ']10,Inf[:count شهر']), - 'a_month' => implode('|', ['{0}:count شهر', '{1}شهر', '{2}شهرين', ']2,11[:count أشهر', ']10,Inf[:count شهر']), - 'week' => implode('|', ['{0}:count أسبوع', '{1}أسبوع', '{2}أسبوعين', ']2,11[:count أسابيع', ']10,Inf[:count أسبوع']), - 'a_week' => implode('|', ['{0}:count أسبوع', '{1}أسبوع', '{2}أسبوعين', ']2,11[:count أسابيع', ']10,Inf[:count أسبوع']), - 'day' => implode('|', ['{0}:count يوم', '{1}يوم', '{2}يومين', ']2,11[:count أيام', ']10,Inf[:count يوم']), - 'a_day' => implode('|', ['{0}:count يوم', '{1}يوم', '{2}يومين', ']2,11[:count أيام', ']10,Inf[:count يوم']), - 'hour' => implode('|', ['{0}:count ساعة', '{1}ساعة', '{2}ساعتين', ']2,11[:count ساعات', ']10,Inf[:count ساعة']), - 'a_hour' => implode('|', ['{0}:count ساعة', '{1}ساعة', '{2}ساعتين', ']2,11[:count ساعات', ']10,Inf[:count ساعة']), - 'minute' => implode('|', ['{0}:count دقيقة', '{1}دقيقة', '{2}دقيقتين', ']2,11[:count دقائق', ']10,Inf[:count دقيقة']), - 'a_minute' => implode('|', ['{0}:count دقيقة', '{1}دقيقة', '{2}دقيقتين', ']2,11[:count دقائق', ']10,Inf[:count دقيقة']), - 'second' => implode('|', ['{0}:count ثانية', '{1}ثانية', '{2}ثانيتين', ']2,11[:count ثواني', ']10,Inf[:count ثانية']), - 'a_second' => implode('|', ['{0}:count ثانية', '{1}ثانية', '{2}ثانيتين', ']2,11[:count ثواني', ']10,Inf[:count ثانية']), - 'ago' => 'منذ :time', - 'from_now' => 'في :time', - 'after' => 'بعد :time', - 'before' => 'قبل :time', - 'diff_now' => 'الآن', - 'diff_today' => 'اليوم', - 'diff_today_regexp' => 'اليوم(?:\\s+على)?(?:\\s+الساعة)?', - 'diff_yesterday' => 'أمس', - 'diff_yesterday_regexp' => 'أمس(?:\\s+على)?(?:\\s+الساعة)?', - 'diff_tomorrow' => 'غداً', - 'diff_tomorrow_regexp' => 'غدا(?:\\s+على)?(?:\\s+الساعة)?', - 'diff_before_yesterday' => 'قبل الأمس', - 'diff_after_tomorrow' => 'بعد غد', - 'period_recurrences' => implode('|', ['{0}مرة', '{1}مرة', '{2}:count مرتين', ']2,11[:count مرات', ']10,Inf[:count مرة']), - 'period_interval' => 'كل :interval', - 'period_start_date' => 'من :date', - 'period_end_date' => 'إلى :date', - 'months' => $months, - 'months_short' => $months, - 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], - 'weekdays_short' => ['أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'], - 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], - 'list' => ['، ', ' و '], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[اليوم على الساعة] LT', - 'nextDay' => '[غدا على الساعة] LT', - 'nextWeek' => 'dddd [على الساعة] LT', - 'lastDay' => '[أمس على الساعة] LT', - 'lastWeek' => 'dddd [على الساعة] LT', - 'sameElse' => 'L', - ], - 'meridiem' => ['ص', 'م'], - 'weekend' => [5, 6], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_YE.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_YE.php deleted file mode 100644 index 5dc29388..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_YE.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/ar.php', [ - 'formats' => [ - 'L' => 'DD MMM, YYYY', - ], - 'months' => ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'], - 'months_short' => ['ينا', 'فبر', 'مار', 'أبر', 'ماي', 'يون', 'يول', 'أغس', 'سبت', 'أكت', 'نوف', 'ديس'], - 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], - 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], - 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/as.php b/vendor/nesbot/carbon/src/Carbon/Lang/as.php deleted file mode 100644 index 04bc3dfd..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/as.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/as_IN.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/as_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/as_IN.php deleted file mode 100644 index 5fbc3dba..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/as_IN.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Amitakhya Phukan, Red Hat bug-glibc@gnu.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'D-MM-YYYY', - ], - 'months' => ['জানুৱাৰী', 'ফেব্ৰুৱাৰী', 'মাৰ্চ', 'এপ্ৰিল', 'মে', 'জুন', 'জুলাই', 'আগষ্ট', 'ছেপ্তেম্বৰ', 'অক্টোবৰ', 'নৱেম্বৰ', 'ডিচেম্বৰ'], - 'months_short' => ['জানু', 'ফেব্ৰু', 'মাৰ্চ', 'এপ্ৰিল', 'মে', 'জুন', 'জুলাই', 'আগ', 'সেপ্ট', 'অক্টো', 'নভে', 'ডিসে'], - 'weekdays' => ['দেওবাৰ', 'সোমবাৰ', 'মঙ্গলবাৰ', 'বুধবাৰ', 'বৃহষ্পতিবাৰ', 'শুক্ৰবাৰ', 'শনিবাৰ'], - 'weekdays_short' => ['দেও', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহষ্পতি', 'শুক্ৰ', 'শনি'], - 'weekdays_min' => ['দেও', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহষ্পতি', 'শুক্ৰ', 'শনি'], - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['পূৰ্ব্বাহ্ন', 'অপৰাহ্ন'], - - 'year' => ':count বছৰ', - 'y' => ':count বছৰ', - 'a_year' => ':count বছৰ', - - 'month' => ':count মাহ', - 'm' => ':count মাহ', - 'a_month' => ':count মাহ', - - 'week' => ':count সপ্তাহ', - 'w' => ':count সপ্তাহ', - 'a_week' => ':count সপ্তাহ', - - 'day' => ':count বাৰ', - 'd' => ':count বাৰ', - 'a_day' => ':count বাৰ', - - 'hour' => ':count ঘণ্টা', - 'h' => ':count ঘণ্টা', - 'a_hour' => ':count ঘণ্টা', - - 'minute' => ':count মিনিট', - 'min' => ':count মিনিট', - 'a_minute' => ':count মিনিট', - - 'second' => ':count দ্বিতীয়', - 's' => ':count দ্বিতীয়', - 'a_second' => ':count দ্বিতীয়', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/asa.php b/vendor/nesbot/carbon/src/Carbon/Lang/asa.php deleted file mode 100644 index 03bb4839..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/asa.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['icheheavo', 'ichamthi'], - 'weekdays' => ['Jumapili', 'Jumatatu', 'Jumanne', 'Jumatano', 'Alhamisi', 'Ijumaa', 'Jumamosi'], - 'weekdays_short' => ['Jpi', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Ijm', 'Jmo'], - 'weekdays_min' => ['Jpi', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Ijm', 'Jmo'], - 'months' => ['Januari', 'Februari', 'Machi', 'Aprili', 'Mei', 'Juni', 'Julai', 'Agosti', 'Septemba', 'Oktoba', 'Novemba', 'Desemba'], - 'months_short' => ['Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Sep', 'Okt', 'Nov', 'Dec'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ast.php b/vendor/nesbot/carbon/src/Carbon/Lang/ast.php deleted file mode 100644 index d9bdebe5..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ast.php +++ /dev/null @@ -1,59 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Jordi Mallach jordi@gnu.org - * - Adolfo Jayme-Barrientos (fitojb) - */ -return array_replace_recursive(require __DIR__.'/es.php', [ - 'formats' => [ - 'L' => 'DD/MM/YY', - ], - 'months' => ['de xineru', 'de febreru', 'de marzu', 'd’abril', 'de mayu', 'de xunu', 'de xunetu', 'd’agostu', 'de setiembre', 'd’ochobre', 'de payares', 'd’avientu'], - 'months_short' => ['xin', 'feb', 'mar', 'abr', 'may', 'xun', 'xnt', 'ago', 'set', 'och', 'pay', 'avi'], - 'weekdays' => ['domingu', 'llunes', 'martes', 'miércoles', 'xueves', 'vienres', 'sábadu'], - 'weekdays_short' => ['dom', 'llu', 'mar', 'mié', 'xue', 'vie', 'sáb'], - 'weekdays_min' => ['dom', 'llu', 'mar', 'mié', 'xue', 'vie', 'sáb'], - - 'year' => ':count añu|:count años', - 'y' => ':count añu|:count años', - 'a_year' => 'un añu|:count años', - - 'month' => ':count mes', - 'm' => ':count mes', - 'a_month' => 'un mes|:count mes', - - 'week' => ':count selmana|:count selmanes', - 'w' => ':count selmana|:count selmanes', - 'a_week' => 'una selmana|:count selmanes', - - 'day' => ':count día|:count díes', - 'd' => ':count día|:count díes', - 'a_day' => 'un día|:count díes', - - 'hour' => ':count hora|:count hores', - 'h' => ':count hora|:count hores', - 'a_hour' => 'una hora|:count hores', - - 'minute' => ':count minutu|:count minutos', - 'min' => ':count minutu|:count minutos', - 'a_minute' => 'un minutu|:count minutos', - - 'second' => ':count segundu|:count segundos', - 's' => ':count segundu|:count segundos', - 'a_second' => 'un segundu|:count segundos', - - 'ago' => 'hai :time', - 'from_now' => 'en :time', - 'after' => ':time dempués', - 'before' => ':time enantes', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ast_ES.php b/vendor/nesbot/carbon/src/Carbon/Lang/ast_ES.php deleted file mode 100644 index 04d75621..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ast_ES.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/ast.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ayc.php b/vendor/nesbot/carbon/src/Carbon/Lang/ayc.php deleted file mode 100644 index d6a6f638..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ayc.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/ayc_PE.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ayc_PE.php b/vendor/nesbot/carbon/src/Carbon/Lang/ayc_PE.php deleted file mode 100644 index ff18504f..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ayc_PE.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - runasimipi.org libc-alpha@sourceware.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YY', - ], - 'months' => ['inïru', 'phiwriru', 'marsu', 'awrila', 'mayu', 'junyu', 'julyu', 'awustu', 'sitimri', 'uktuwri', 'nuwimri', 'risimri'], - 'months_short' => ['ini', 'phi', 'mar', 'awr', 'may', 'jun', 'jul', 'awu', 'sit', 'ukt', 'nuw', 'ris'], - 'weekdays' => ['tuminku', 'lunisa', 'martisa', 'mirkulisa', 'juywisa', 'wirnisa', 'sawäru'], - 'weekdays_short' => ['tum', 'lun', 'mar', 'mir', 'juy', 'wir', 'saw'], - 'weekdays_min' => ['tum', 'lun', 'mar', 'mir', 'juy', 'wir', 'saw'], - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['VM', 'NM'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/az.php b/vendor/nesbot/carbon/src/Carbon/Lang/az.php deleted file mode 100644 index 1e92106d..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/az.php +++ /dev/null @@ -1,128 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Josh Soref - * - Kunal Marwaha - * - François B - * - JD Isaacks - * - Orxan - * - Şəhriyar İmanov - * - Baran Şengül - */ -return [ - 'year' => ':count il', - 'a_year' => '{1}bir il|]1,Inf[:count il', - 'y' => ':count il', - 'month' => ':count ay', - 'a_month' => '{1}bir ay|]1,Inf[:count ay', - 'm' => ':count ay', - 'week' => ':count həftə', - 'a_week' => '{1}bir həftə|]1,Inf[:count həftə', - 'w' => ':count h.', - 'day' => ':count gün', - 'a_day' => '{1}bir gün|]1,Inf[:count gün', - 'd' => ':count g.', - 'hour' => ':count saat', - 'a_hour' => '{1}bir saat|]1,Inf[:count saat', - 'h' => ':count saat', - 'minute' => ':count d.', - 'a_minute' => '{1}bir dəqiqə|]1,Inf[:count dəqiqə', - 'min' => ':count dəqiqə', - 'second' => ':count san.', - 'a_second' => '{1}birneçə saniyə|]1,Inf[:count saniyə', - 's' => ':count saniyə', - 'ago' => ':time əvvəl', - 'from_now' => ':time sonra', - 'after' => ':time sonra', - 'before' => ':time əvvəl', - 'diff_now' => 'indi', - 'diff_today' => 'bugün', - 'diff_today_regexp' => 'bugün(?:\\s+saat)?', - 'diff_yesterday' => 'dünən', - 'diff_tomorrow' => 'sabah', - 'diff_tomorrow_regexp' => 'sabah(?:\\s+saat)?', - 'diff_before_yesterday' => 'srağagün', - 'diff_after_tomorrow' => 'birisi gün', - 'period_recurrences' => ':count dəfədən bir', - 'period_interval' => 'hər :interval', - 'period_start_date' => ':date tarixindən başlayaraq', - 'period_end_date' => ':date tarixinədək', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD.MM.YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[bugün saat] LT', - 'nextDay' => '[sabah saat] LT', - 'nextWeek' => '[gələn həftə] dddd [saat] LT', - 'lastDay' => '[dünən] LT', - 'lastWeek' => '[keçən həftə] dddd [saat] LT', - 'sameElse' => 'L', - ], - 'ordinal' => function ($number) { - if ($number === 0) { // special case for zero - return "$number-ıncı"; - } - - static $suffixes = [ - 1 => '-inci', - 5 => '-inci', - 8 => '-inci', - 70 => '-inci', - 80 => '-inci', - 2 => '-nci', - 7 => '-nci', - 20 => '-nci', - 50 => '-nci', - 3 => '-üncü', - 4 => '-üncü', - 100 => '-üncü', - 6 => '-ncı', - 9 => '-uncu', - 10 => '-uncu', - 30 => '-uncu', - 60 => '-ıncı', - 90 => '-ıncı', - ]; - - $lastDigit = $number % 10; - - return $number.($suffixes[$lastDigit] ?? $suffixes[$number % 100 - $lastDigit] ?? $suffixes[$number >= 100 ? 100 : -1] ?? ''); - }, - 'meridiem' => function ($hour) { - if ($hour < 4) { - return 'gecə'; - } - if ($hour < 12) { - return 'səhər'; - } - if ($hour < 17) { - return 'gündüz'; - } - - return 'axşam'; - }, - 'months' => ['yanvar', 'fevral', 'mart', 'aprel', 'may', 'iyun', 'iyul', 'avqust', 'sentyabr', 'oktyabr', 'noyabr', 'dekabr'], - 'months_short' => ['yan', 'fev', 'mar', 'apr', 'may', 'iyn', 'iyl', 'avq', 'sen', 'okt', 'noy', 'dek'], - 'months_standalone' => ['Yanvar', 'Fevral', 'Mart', 'Aprel', 'May', 'İyun', 'İyul', 'Avqust', 'Sentyabr', 'Oktyabr', 'Noyabr', 'Dekabr'], - 'weekdays' => ['bazar', 'bazar ertəsi', 'çərşənbə axşamı', 'çərşənbə', 'cümə axşamı', 'cümə', 'şənbə'], - 'weekdays_short' => ['baz', 'bze', 'çax', 'çər', 'cax', 'cüm', 'şən'], - 'weekdays_min' => ['bz', 'be', 'ça', 'çə', 'ca', 'cü', 'şə'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'list' => [', ', ' və '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/az_AZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/az_AZ.php deleted file mode 100644 index 2acf881a..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/az_AZ.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Pablo Saratxaga pablo@mandrakesoft.com - */ -return array_replace_recursive(require __DIR__.'/az.php', [ - 'months_short' => ['Yan', 'Fev', 'Mar', 'Apr', 'May', 'İyn', 'İyl', 'Avq', 'Sen', 'Okt', 'Noy', 'Dek'], - 'weekdays' => ['bazar günü', 'bazar ertəsi', 'çərşənbə axşamı', 'çərşənbə', 'cümə axşamı', 'cümə', 'şənbə'], - 'weekdays_short' => ['baz', 'ber', 'çax', 'çər', 'cax', 'cüm', 'şnb'], - 'weekdays_min' => ['baz', 'ber', 'çax', 'çər', 'cax', 'cüm', 'şnb'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/az_Cyrl.php b/vendor/nesbot/carbon/src/Carbon/Lang/az_Cyrl.php deleted file mode 100644 index 28fc62fe..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/az_Cyrl.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/az.php', [ - 'weekdays' => ['базар', 'базар ертәси', 'чәршәнбә ахшамы', 'чәршәнбә', 'ҹүмә ахшамы', 'ҹүмә', 'шәнбә'], - 'weekdays_short' => ['Б.', 'Б.Е.', 'Ч.А.', 'Ч.', 'Ҹ.А.', 'Ҹ.', 'Ш.'], - 'weekdays_min' => ['Б.', 'Б.Е.', 'Ч.А.', 'Ч.', 'Ҹ.А.', 'Ҹ.', 'Ш.'], - 'months' => ['јанвар', 'феврал', 'март', 'апрел', 'май', 'ијун', 'ијул', 'август', 'сентјабр', 'октјабр', 'нојабр', 'декабр'], - 'months_short' => ['јан', 'фев', 'мар', 'апр', 'май', 'ијн', 'ијл', 'авг', 'сен', 'окт', 'ној', 'дек'], - 'months_standalone' => ['Јанвар', 'Феврал', 'Март', 'Апрел', 'Май', 'Ијун', 'Ијул', 'Август', 'Сентјабр', 'Октјабр', 'Нојабр', 'Декабр'], - 'meridiem' => ['а', 'п'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/az_IR.php b/vendor/nesbot/carbon/src/Carbon/Lang/az_IR.php deleted file mode 100644 index 991a0efb..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/az_IR.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Mousa Moradi mousamk@gmail.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'OY/OM/OD', - ], - 'months' => ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مئی', 'ژوئن', 'جولای', 'آقۇست', 'سپتامبر', 'اوْکتوْبر', 'نوْوامبر', 'دسامبر'], - 'months_short' => ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مئی', 'ژوئن', 'جولای', 'آقۇست', 'سپتامبر', 'اوْکتوْبر', 'نوْوامبر', 'دسامبر'], - 'weekdays' => ['یکشنبه', 'دوشنبه', 'سه‌شنبه', 'چارشنبه', 'جۆمعه آخشامی', 'جۆمعه', 'شنبه'], - 'weekdays_short' => ['یکشنبه', 'دوشنبه', 'سه‌شنبه', 'چارشنبه', 'جۆمعه آخشامی', 'جۆمعه', 'شنبه'], - 'weekdays_min' => ['یکشنبه', 'دوشنبه', 'سه‌شنبه', 'چارشنبه', 'جۆمعه آخشامی', 'جۆمعه', 'شنبه'], - 'first_day_of_week' => 6, - 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰۴', '۰۵', '۰۶', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱۴', '۱۵', '۱۶', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲۴', '۲۵', '۲۶', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳۴', '۳۵', '۳۶', '۳۷', '۳۸', '۳۹', '۴۰', '۴۱', '۴۲', '۴۳', '۴۴', '۴۵', '۴۶', '۴۷', '۴۸', '۴۹', '۵۰', '۵۱', '۵۲', '۵۳', '۵۴', '۵۵', '۵۶', '۵۷', '۵۸', '۵۹', '۶۰', '۶۱', '۶۲', '۶۳', '۶۴', '۶۵', '۶۶', '۶۷', '۶۸', '۶۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷۴', '۷۵', '۷۶', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸۴', '۸۵', '۸۶', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹۴', '۹۵', '۹۶', '۹۷', '۹۸', '۹۹'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/az_Latn.php b/vendor/nesbot/carbon/src/Carbon/Lang/az_Latn.php deleted file mode 100644 index 0be33914..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/az_Latn.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/az.php', [ - 'meridiem' => ['a', 'p'], - 'weekdays' => ['bazar', 'bazar ertəsi', 'çərşənbə axşamı', 'çərşənbə', 'cümə axşamı', 'cümə', 'şənbə'], - 'weekdays_short' => ['B.', 'B.E.', 'Ç.A.', 'Ç.', 'C.A.', 'C.', 'Ş.'], - 'weekdays_min' => ['B.', 'B.E.', 'Ç.A.', 'Ç.', 'C.A.', 'C.', 'Ş.'], - 'months' => ['yanvar', 'fevral', 'mart', 'aprel', 'may', 'iyun', 'iyul', 'avqust', 'sentyabr', 'oktyabr', 'noyabr', 'dekabr'], - 'months_short' => ['yan', 'fev', 'mar', 'apr', 'may', 'iyn', 'iyl', 'avq', 'sen', 'okt', 'noy', 'dek'], - 'months_standalone' => ['Yanvar', 'Fevral', 'Mart', 'Aprel', 'May', 'İyun', 'İyul', 'Avqust', 'Sentyabr', 'Oktyabr', 'Noyabr', 'Dekabr'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD.MM.YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'D MMMM YYYY, dddd HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bas.php b/vendor/nesbot/carbon/src/Carbon/Lang/bas.php deleted file mode 100644 index 41bfa1d8..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bas.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['I bikɛ̂glà', 'I ɓugajɔp'], - 'weekdays' => ['ŋgwà nɔ̂y', 'ŋgwà njaŋgumba', 'ŋgwà ûm', 'ŋgwà ŋgê', 'ŋgwà mbɔk', 'ŋgwà kɔɔ', 'ŋgwà jôn'], - 'weekdays_short' => ['nɔy', 'nja', 'uum', 'ŋge', 'mbɔ', 'kɔɔ', 'jon'], - 'weekdays_min' => ['nɔy', 'nja', 'uum', 'ŋge', 'mbɔ', 'kɔɔ', 'jon'], - 'months' => ['Kɔndɔŋ', 'Màcɛ̂l', 'Màtùmb', 'Màtop', 'M̀puyɛ', 'Hìlòndɛ̀', 'Njèbà', 'Hìkaŋ', 'Dìpɔ̀s', 'Bìòôm', 'Màyɛsèp', 'Lìbuy li ńyèe'], - 'months_short' => ['kɔn', 'mac', 'mat', 'mto', 'mpu', 'hil', 'nje', 'hik', 'dip', 'bio', 'may', 'liɓ'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'D/M/YYYY', - 'LL' => 'D MMM, YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], - - 'second' => ':count móndî', // less reliable - 's' => ':count móndî', // less reliable - 'a_second' => ':count móndî', // less reliable -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/be.php b/vendor/nesbot/carbon/src/Carbon/Lang/be.php deleted file mode 100644 index 51b4d0cc..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/be.php +++ /dev/null @@ -1,173 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -// @codeCoverageIgnoreStart - -use Carbon\CarbonInterface; -use Symfony\Component\Translation\PluralizationRules; - -if (class_exists('Symfony\\Component\\Translation\\PluralizationRules')) { - PluralizationRules::set(function ($number) { - return (($number % 10 == 1) && ($number % 100 != 11)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2); - }, 'be'); -} -// @codeCoverageIgnoreEnd - -/* - * Authors: - * - Josh Soref - * - SobakaSlava - * - François B - * - Serhan Apaydın - * - JD Isaacks - * - AbadonnaAbbys - * - Siomkin Alexander - */ -return [ - 'year' => ':count год|:count гады|:count гадоў', - 'a_year' => '{1}год|:count год|:count гады|:count гадоў', - 'y' => ':count год|:count гады|:count гадоў', - 'month' => ':count месяц|:count месяцы|:count месяцаў', - 'a_month' => '{1}месяц|:count месяц|:count месяцы|:count месяцаў', - 'm' => ':count месяц|:count месяцы|:count месяцаў', - 'week' => ':count тыдзень|:count тыдні|:count тыдняў', - 'a_week' => '{1}тыдзень|:count тыдзень|:count тыдні|:count тыдняў', - 'w' => ':count тыдзень|:count тыдні|:count тыдняў', - 'day' => ':count дзень|:count дні|:count дзён', - 'a_day' => '{1}дзень|:count дзень|:count дні|:count дзён', - 'd' => ':count дн', - 'hour' => ':count гадзіну|:count гадзіны|:count гадзін', - 'a_hour' => '{1}гадзіна|:count гадзіна|:count гадзіны|:count гадзін', - 'h' => ':count гадзіна|:count гадзіны|:count гадзін', - 'minute' => ':count хвіліна|:count хвіліны|:count хвілін', - 'a_minute' => '{1}хвіліна|:count хвіліна|:count хвіліны|:count хвілін', - 'min' => ':count хв', - 'second' => ':count секунда|:count секунды|:count секунд', - 'a_second' => '{1}некалькі секунд|:count секунда|:count секунды|:count секунд', - 's' => ':count сек', - - 'hour_ago' => ':count гадзіну|:count гадзіны|:count гадзін', - 'a_hour_ago' => '{1}гадзіну|:count гадзіну|:count гадзіны|:count гадзін', - 'h_ago' => ':count гадзіну|:count гадзіны|:count гадзін', - 'minute_ago' => ':count хвіліну|:count хвіліны|:count хвілін', - 'a_minute_ago' => '{1}хвіліну|:count хвіліну|:count хвіліны|:count хвілін', - 'min_ago' => ':count хвіліну|:count хвіліны|:count хвілін', - 'second_ago' => ':count секунду|:count секунды|:count секунд', - 'a_second_ago' => '{1}некалькі секунд|:count секунду|:count секунды|:count секунд', - 's_ago' => ':count секунду|:count секунды|:count секунд', - - 'hour_from_now' => ':count гадзіну|:count гадзіны|:count гадзін', - 'a_hour_from_now' => '{1}гадзіну|:count гадзіну|:count гадзіны|:count гадзін', - 'h_from_now' => ':count гадзіну|:count гадзіны|:count гадзін', - 'minute_from_now' => ':count хвіліну|:count хвіліны|:count хвілін', - 'a_minute_from_now' => '{1}хвіліну|:count хвіліну|:count хвіліны|:count хвілін', - 'min_from_now' => ':count хвіліну|:count хвіліны|:count хвілін', - 'second_from_now' => ':count секунду|:count секунды|:count секунд', - 'a_second_from_now' => '{1}некалькі секунд|:count секунду|:count секунды|:count секунд', - 's_from_now' => ':count секунду|:count секунды|:count секунд', - - 'hour_after' => ':count гадзіну|:count гадзіны|:count гадзін', - 'a_hour_after' => '{1}гадзіну|:count гадзіну|:count гадзіны|:count гадзін', - 'h_after' => ':count гадзіну|:count гадзіны|:count гадзін', - 'minute_after' => ':count хвіліну|:count хвіліны|:count хвілін', - 'a_minute_after' => '{1}хвіліну|:count хвіліну|:count хвіліны|:count хвілін', - 'min_after' => ':count хвіліну|:count хвіліны|:count хвілін', - 'second_after' => ':count секунду|:count секунды|:count секунд', - 'a_second_after' => '{1}некалькі секунд|:count секунду|:count секунды|:count секунд', - 's_after' => ':count секунду|:count секунды|:count секунд', - - 'hour_before' => ':count гадзіну|:count гадзіны|:count гадзін', - 'a_hour_before' => '{1}гадзіну|:count гадзіну|:count гадзіны|:count гадзін', - 'h_before' => ':count гадзіну|:count гадзіны|:count гадзін', - 'minute_before' => ':count хвіліну|:count хвіліны|:count хвілін', - 'a_minute_before' => '{1}хвіліну|:count хвіліну|:count хвіліны|:count хвілін', - 'min_before' => ':count хвіліну|:count хвіліны|:count хвілін', - 'second_before' => ':count секунду|:count секунды|:count секунд', - 'a_second_before' => '{1}некалькі секунд|:count секунду|:count секунды|:count секунд', - 's_before' => ':count секунду|:count секунды|:count секунд', - - 'ago' => ':time таму', - 'from_now' => 'праз :time', - 'after' => ':time пасля', - 'before' => ':time да', - 'diff_now' => 'цяпер', - 'diff_today' => 'Сёння', - 'diff_today_regexp' => 'Сёння(?:\\s+ў)?', - 'diff_yesterday' => 'учора', - 'diff_yesterday_regexp' => 'Учора(?:\\s+ў)?', - 'diff_tomorrow' => 'заўтра', - 'diff_tomorrow_regexp' => 'Заўтра(?:\\s+ў)?', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD.MM.YYYY', - 'LL' => 'D MMMM YYYY г.', - 'LLL' => 'D MMMM YYYY г., HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY г., HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[Сёння ў] LT', - 'nextDay' => '[Заўтра ў] LT', - 'nextWeek' => '[У] dddd [ў] LT', - 'lastDay' => '[Учора ў] LT', - 'lastWeek' => function (CarbonInterface $current) { - switch ($current->dayOfWeek) { - case 1: - case 2: - case 4: - return '[У мінулы] dddd [ў] LT'; - default: - return '[У мінулую] dddd [ў] LT'; - } - }, - 'sameElse' => 'L', - ], - 'ordinal' => function ($number, $period) { - switch ($period) { - case 'M': - case 'd': - case 'DDD': - case 'w': - case 'W': - return ($number % 10 === 2 || $number % 10 === 3) && ($number % 100 !== 12 && $number % 100 !== 13) ? $number.'-і' : $number.'-ы'; - case 'D': - return $number.'-га'; - default: - return $number; - } - }, - 'meridiem' => function ($hour) { - if ($hour < 4) { - return 'ночы'; - } - if ($hour < 12) { - return 'раніцы'; - } - if ($hour < 17) { - return 'дня'; - } - - return 'вечара'; - }, - 'months' => ['студзеня', 'лютага', 'сакавіка', 'красавіка', 'траўня', 'чэрвеня', 'ліпеня', 'жніўня', 'верасня', 'кастрычніка', 'лістапада', 'снежня'], - 'months_standalone' => ['студзень', 'люты', 'сакавік', 'красавік', 'травень', 'чэрвень', 'ліпень', 'жнівень', 'верасень', 'кастрычнік', 'лістапад', 'снежань'], - 'months_short' => ['студ', 'лют', 'сак', 'крас', 'трав', 'чэрв', 'ліп', 'жнів', 'вер', 'каст', 'ліст', 'снеж'], - 'months_regexp' => '/(DD?o?\.?(\[[^\[\]]*\]|\s)+MMMM?|L{2,4}|l{2,4})/', - 'weekdays' => ['нядзелю', 'панядзелак', 'аўторак', 'сераду', 'чацвер', 'пятніцу', 'суботу'], - 'weekdays_standalone' => ['нядзеля', 'панядзелак', 'аўторак', 'серада', 'чацвер', 'пятніца', 'субота'], - 'weekdays_short' => ['нд', 'пн', 'ат', 'ср', 'чц', 'пт', 'сб'], - 'weekdays_min' => ['нд', 'пн', 'ат', 'ср', 'чц', 'пт', 'сб'], - 'weekdays_regexp' => '/\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/', - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'list' => [', ', ' і '], - 'months_short_standalone' => ['сту', 'лют', 'сак', 'кра', 'май', 'чэр', 'ліп', 'жні', 'вер', 'кас', 'ліс', 'сне'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/be_BY.php b/vendor/nesbot/carbon/src/Carbon/Lang/be_BY.php deleted file mode 100644 index 26684b40..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/be_BY.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/be.php', [ - 'months' => ['студзеня', 'лютага', 'сакавіка', 'красавіка', 'мая', 'чэрвеня', 'ліпеня', 'жніўня', 'верасня', 'кастрычніка', 'лістапада', 'снежня'], - 'months_short' => ['сту', 'лют', 'сак', 'кра', 'мая', 'чэр', 'ліп', 'жні', 'вер', 'кас', 'ліс', 'сне'], - 'weekdays' => ['Нядзеля', 'Панядзелак', 'Аўторак', 'Серада', 'Чацвер', 'Пятніца', 'Субота'], - 'weekdays_short' => ['Няд', 'Пан', 'Аўт', 'Срд', 'Чцв', 'Пят', 'Суб'], - 'weekdays_min' => ['Няд', 'Пан', 'Аўт', 'Срд', 'Чцв', 'Пят', 'Суб'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/be_BY@latin.php b/vendor/nesbot/carbon/src/Carbon/Lang/be_BY@latin.php deleted file mode 100644 index 517ce83a..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/be_BY@latin.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD.MM.YYYY', - ], - 'months' => ['studzienia', 'lutaha', 'sakavika', 'krasavika', 'maja', 'červienia', 'lipienia', 'žniŭnia', 'vieraśnia', 'kastryčnika', 'listapada', 'śniežnia'], - 'months_short' => ['Stu', 'Lut', 'Sak', 'Kra', 'Maj', 'Čer', 'Lip', 'Žni', 'Vie', 'Kas', 'Lis', 'Śni'], - 'weekdays' => ['Niadziela', 'Paniadziełak', 'Aŭtorak', 'Sierada', 'Čaćvier', 'Piatnica', 'Subota'], - 'weekdays_short' => ['Nia', 'Pan', 'Aŭt', 'Sie', 'Čać', 'Pia', 'Sub'], - 'weekdays_min' => ['Nia', 'Pan', 'Aŭt', 'Sie', 'Čać', 'Pia', 'Sub'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bem.php b/vendor/nesbot/carbon/src/Carbon/Lang/bem.php deleted file mode 100644 index 1c3ef039..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bem.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/bem_ZM.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bem_ZM.php b/vendor/nesbot/carbon/src/Carbon/Lang/bem_ZM.php deleted file mode 100644 index 620b5795..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bem_ZM.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - ANLoc Martin Benjamin locales@africanlocalization.net - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'MM/DD/YYYY', - ], - 'months' => ['Januari', 'Februari', 'Machi', 'Epreo', 'Mei', 'Juni', 'Julai', 'Ogasti', 'Septemba', 'Oktoba', 'Novemba', 'Disemba'], - 'months_short' => ['Jan', 'Feb', 'Mac', 'Epr', 'Mei', 'Jun', 'Jul', 'Oga', 'Sep', 'Okt', 'Nov', 'Dis'], - 'weekdays' => ['Pa Mulungu', 'Palichimo', 'Palichibuli', 'Palichitatu', 'Palichine', 'Palichisano', 'Pachibelushi'], - 'weekdays_short' => ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], - 'weekdays_min' => ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['uluchelo', 'akasuba'], - - 'year' => 'myaka :count', - 'y' => 'myaka :count', - 'a_year' => 'myaka :count', - - 'month' => 'myeshi :count', - 'm' => 'myeshi :count', - 'a_month' => 'myeshi :count', - - 'week' => 'umulungu :count', - 'w' => 'umulungu :count', - 'a_week' => 'umulungu :count', - - 'day' => 'inshiku :count', - 'd' => 'inshiku :count', - 'a_day' => 'inshiku :count', - - 'hour' => 'awala :count', - 'h' => 'awala :count', - 'a_hour' => 'awala :count', - - 'minute' => 'miniti :count', - 'min' => 'miniti :count', - 'a_minute' => 'miniti :count', - - 'second' => 'sekondi :count', - 's' => 'sekondi :count', - 'a_second' => 'sekondi :count', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ber.php b/vendor/nesbot/carbon/src/Carbon/Lang/ber.php deleted file mode 100644 index 685603c0..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ber.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/ber_DZ.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ber_DZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/ber_DZ.php deleted file mode 100644 index 38de10ab..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ber_DZ.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Pablo Saratxaga pablo@mandrakesoft.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD.MM.YYYY', - ], - 'months' => ['yanvar', 'fevral', 'mart', 'aprel', 'may', 'iyun', 'iyul', 'avqust', 'sentyabr', 'oktyabr', 'noyabr', 'dekabr'], - 'months_short' => ['Yan', 'Fev', 'Mar', 'Apr', 'May', 'İyn', 'İyl', 'Avq', 'Sen', 'Okt', 'Noy', 'Dek'], - 'weekdays' => ['bazar günü', 'birinci gün', 'ikinci gün', 'üçüncü gün', 'dördüncü gün', 'beşinci gün', 'altıncı gün'], - 'weekdays_short' => ['baz', 'bir', 'iki', 'üçü', 'dör', 'beş', 'alt'], - 'weekdays_min' => ['baz', 'bir', 'iki', 'üçü', 'dör', 'beş', 'alt'], - 'first_day_of_week' => 6, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ber_MA.php b/vendor/nesbot/carbon/src/Carbon/Lang/ber_MA.php deleted file mode 100644 index 38de10ab..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ber_MA.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Pablo Saratxaga pablo@mandrakesoft.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD.MM.YYYY', - ], - 'months' => ['yanvar', 'fevral', 'mart', 'aprel', 'may', 'iyun', 'iyul', 'avqust', 'sentyabr', 'oktyabr', 'noyabr', 'dekabr'], - 'months_short' => ['Yan', 'Fev', 'Mar', 'Apr', 'May', 'İyn', 'İyl', 'Avq', 'Sen', 'Okt', 'Noy', 'Dek'], - 'weekdays' => ['bazar günü', 'birinci gün', 'ikinci gün', 'üçüncü gün', 'dördüncü gün', 'beşinci gün', 'altıncı gün'], - 'weekdays_short' => ['baz', 'bir', 'iki', 'üçü', 'dör', 'beş', 'alt'], - 'weekdays_min' => ['baz', 'bir', 'iki', 'üçü', 'dör', 'beş', 'alt'], - 'first_day_of_week' => 6, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bez.php b/vendor/nesbot/carbon/src/Carbon/Lang/bez.php deleted file mode 100644 index d59c5ef5..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bez.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['pamilau', 'pamunyi'], - 'weekdays' => ['pa mulungu', 'pa shahuviluha', 'pa hivili', 'pa hidatu', 'pa hitayi', 'pa hihanu', 'pa shahulembela'], - 'weekdays_short' => ['Mul', 'Vil', 'Hiv', 'Hid', 'Hit', 'Hih', 'Lem'], - 'weekdays_min' => ['Mul', 'Vil', 'Hiv', 'Hid', 'Hit', 'Hih', 'Lem'], - 'months' => ['pa mwedzi gwa hutala', 'pa mwedzi gwa wuvili', 'pa mwedzi gwa wudatu', 'pa mwedzi gwa wutai', 'pa mwedzi gwa wuhanu', 'pa mwedzi gwa sita', 'pa mwedzi gwa saba', 'pa mwedzi gwa nane', 'pa mwedzi gwa tisa', 'pa mwedzi gwa kumi', 'pa mwedzi gwa kumi na moja', 'pa mwedzi gwa kumi na mbili'], - 'months_short' => ['Hut', 'Vil', 'Dat', 'Tai', 'Han', 'Sit', 'Sab', 'Nan', 'Tis', 'Kum', 'Kmj', 'Kmb'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bg.php b/vendor/nesbot/carbon/src/Carbon/Lang/bg.php deleted file mode 100644 index f7680740..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bg.php +++ /dev/null @@ -1,114 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Josh Soref - * - François B - * - Serhan Apaydın - * - JD Isaacks - * - Glavić - */ - -use Carbon\CarbonInterface; - -return [ - 'year' => ':count година|:count години', - 'a_year' => 'година|:count години', - 'y' => ':count година|:count години', - 'month' => ':count месец|:count месеца', - 'a_month' => 'месец|:count месеца', - 'm' => ':count месец|:count месеца', - 'week' => ':count седмица|:count седмици', - 'a_week' => 'седмица|:count седмици', - 'w' => ':count седмица|:count седмици', - 'day' => ':count ден|:count дни', - 'a_day' => 'ден|:count дни', - 'd' => ':count ден|:count дни', - 'hour' => ':count час|:count часа', - 'a_hour' => 'час|:count часа', - 'h' => ':count час|:count часа', - 'minute' => ':count минута|:count минути', - 'a_minute' => 'минута|:count минути', - 'min' => ':count минута|:count минути', - 'second' => ':count секунда|:count секунди', - 'a_second' => 'няколко секунди|:count секунди', - 's' => ':count секунда|:count секунди', - 'ago' => 'преди :time', - 'from_now' => 'след :time', - 'after' => 'след :time', - 'before' => 'преди :time', - 'diff_now' => 'сега', - 'diff_today' => 'Днес', - 'diff_today_regexp' => 'Днес(?:\\s+в)?', - 'diff_yesterday' => 'вчера', - 'diff_yesterday_regexp' => 'Вчера(?:\\s+в)?', - 'diff_tomorrow' => 'утре', - 'diff_tomorrow_regexp' => 'Утре(?:\\s+в)?', - 'formats' => [ - 'LT' => 'H:mm', - 'LTS' => 'H:mm:ss', - 'L' => 'D.MM.YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY H:mm', - 'LLLL' => 'dddd, D MMMM YYYY H:mm', - ], - 'calendar' => [ - 'sameDay' => '[Днес в] LT', - 'nextDay' => '[Утре в] LT', - 'nextWeek' => 'dddd [в] LT', - 'lastDay' => '[Вчера в] LT', - 'lastWeek' => function (CarbonInterface $current) { - switch ($current->dayOfWeek) { - case 0: - case 3: - case 6: - return '[В изминалата] dddd [в] LT'; - default: - return '[В изминалия] dddd [в] LT'; - } - }, - 'sameElse' => 'L', - ], - 'ordinal' => function ($number) { - $lastDigit = $number % 10; - $last2Digits = $number % 100; - if ($number === 0) { - return "$number-ев"; - } - if ($last2Digits === 0) { - return "$number-ен"; - } - if ($last2Digits > 10 && $last2Digits < 20) { - return "$number-ти"; - } - if ($lastDigit === 1) { - return "$number-ви"; - } - if ($lastDigit === 2) { - return "$number-ри"; - } - if ($lastDigit === 7 || $lastDigit === 8) { - return "$number-ми"; - } - - return "$number-ти"; - }, - 'months' => ['януари', 'февруари', 'март', 'април', 'май', 'юни', 'юли', 'август', 'септември', 'октомври', 'ноември', 'декември'], - 'months_short' => ['яну', 'фев', 'мар', 'апр', 'май', 'юни', 'юли', 'авг', 'сеп', 'окт', 'ное', 'дек'], - 'weekdays' => ['неделя', 'понеделник', 'вторник', 'сряда', 'четвъртък', 'петък', 'събота'], - 'weekdays_short' => ['нед', 'пон', 'вто', 'сря', 'чет', 'пет', 'съб'], - 'weekdays_min' => ['нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'list' => [', ', ' и '], - 'meridiem' => ['преди обяд', 'следобед'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bg_BG.php b/vendor/nesbot/carbon/src/Carbon/Lang/bg_BG.php deleted file mode 100644 index b53874d3..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bg_BG.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/bg.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bhb.php b/vendor/nesbot/carbon/src/Carbon/Lang/bhb.php deleted file mode 100644 index 49f08032..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bhb.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/bhb_IN.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bhb_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/bhb_IN.php deleted file mode 100644 index ab557cbf..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bhb_IN.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Samsung Electronics Co., Ltd. alexey.merzlyakov@samsung.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'D/M/YY', - ], - 'months' => ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], - 'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], - 'weekdays' => ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], - 'weekdays_short' => ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], - 'weekdays_min' => ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bho.php b/vendor/nesbot/carbon/src/Carbon/Lang/bho.php deleted file mode 100644 index e9ed0b68..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bho.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/bho_IN.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bho_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/bho_IN.php deleted file mode 100644 index bc54f363..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bho_IN.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - bhashaghar@googlegroups.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'D/M/YY', - ], - 'months' => ['जनवरी', 'फरवरी', 'मार्च', 'अप्रैल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर"'], - 'months_short' => ['जनवरी', 'फरवरी', 'मार्च', 'अप्रैल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर"'], - 'weekdays' => ['रविवार', 'सोमवार', 'मंगलवार', 'बुधवार', 'गुरुवार', 'शुक्रवार', 'शनिवार'], - 'weekdays_short' => ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरु', 'शुक्र', 'शनि'], - 'weekdays_min' => ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरु', 'शुक्र', 'शनि'], - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['पूर्वाह्न', 'अपराह्न'], - - 'hour' => ':count मौसम', - 'h' => ':count मौसम', - 'a_hour' => ':count मौसम', - - 'minute' => ':count कला', - 'min' => ':count कला', - 'a_minute' => ':count कला', - - 'second' => ':count सोमार', - 's' => ':count सोमार', - 'a_second' => ':count सोमार', - - 'year' => ':count साल', - 'y' => ':count साल', - 'a_year' => ':count साल', - - 'month' => ':count महिना', - 'm' => ':count महिना', - 'a_month' => ':count महिना', - - 'week' => ':count सप्ताह', - 'w' => ':count सप्ताह', - 'a_week' => ':count सप्ताह', - - 'day' => ':count दिन', - 'd' => ':count दिन', - 'a_day' => ':count दिन', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bi.php b/vendor/nesbot/carbon/src/Carbon/Lang/bi.php deleted file mode 100644 index dd08128e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bi.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/bi_VU.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bi_VU.php b/vendor/nesbot/carbon/src/Carbon/Lang/bi_VU.php deleted file mode 100644 index 1fe77705..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bi_VU.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Samsung Electronics Co., Ltd. akhilesh.k@samsung.com & maninder1.s@samsung.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'dddd DD MMM YYYY', - ], - 'months' => ['jenuware', 'febwari', 'maj', 'epril', 'mei', 'jun', 'julae', 'ogis', 'septemba', 'oktoba', 'novemba', 'disemba'], - 'months_short' => ['jen', 'feb', 'maj', 'epr', 'mei', 'jun', 'jul', 'ogi', 'sep', 'okt', 'nov', 'dis'], - 'weekdays' => ['sande', 'mande', 'maj', 'wota', 'fraede', 'sarede'], - 'weekdays_short' => ['san', 'man', 'maj', 'wot', 'fra', 'sar'], - 'weekdays_min' => ['san', 'man', 'maj', 'wot', 'fra', 'sar'], - - 'year' => ':count seven', // less reliable - 'y' => ':count seven', // less reliable - 'a_year' => ':count seven', // less reliable - - 'month' => ':count mi', // less reliable - 'm' => ':count mi', // less reliable - 'a_month' => ':count mi', // less reliable - - 'week' => ':count sarede', // less reliable - 'w' => ':count sarede', // less reliable - 'a_week' => ':count sarede', // less reliable - - 'day' => ':count betde', // less reliable - 'd' => ':count betde', // less reliable - 'a_day' => ':count betde', // less reliable - - 'hour' => ':count klok', // less reliable - 'h' => ':count klok', // less reliable - 'a_hour' => ':count klok', // less reliable - - 'minute' => ':count smol', // less reliable - 'min' => ':count smol', // less reliable - 'a_minute' => ':count smol', // less reliable - - 'second' => ':count tu', // less reliable - 's' => ':count tu', // less reliable - 'a_second' => ':count tu', // less reliable -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bm.php b/vendor/nesbot/carbon/src/Carbon/Lang/bm.php deleted file mode 100644 index 92822d29..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bm.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Estelle Comment - */ -return [ - 'year' => 'san :count', - 'a_year' => '{1}san kelen|san :count', - 'y' => 'san :count', - 'month' => 'kalo :count', - 'a_month' => '{1}kalo kelen|kalo :count', - 'm' => 'k. :count', - 'week' => 'dɔgɔkun :count', - 'a_week' => 'dɔgɔkun kelen', - 'w' => 'd. :count', - 'day' => 'tile :count', - 'd' => 't. :count', - 'a_day' => '{1}tile kelen|tile :count', - 'hour' => 'lɛrɛ :count', - 'a_hour' => '{1}lɛrɛ kelen|lɛrɛ :count', - 'h' => 'l. :count', - 'minute' => 'miniti :count', - 'a_minute' => '{1}miniti kelen|miniti :count', - 'min' => 'm. :count', - 'second' => 'sekondi :count', - 'a_second' => '{1}sanga dama dama|sekondi :count', - 's' => 'sek. :count', - 'ago' => 'a bɛ :time bɔ', - 'from_now' => ':time kɔnɔ', - 'diff_today' => 'Bi', - 'diff_yesterday' => 'Kunu', - 'diff_yesterday_regexp' => 'Kunu(?:\\s+lɛrɛ)?', - 'diff_tomorrow' => 'Sini', - 'diff_tomorrow_regexp' => 'Sini(?:\\s+lɛrɛ)?', - 'diff_today_regexp' => 'Bi(?:\\s+lɛrɛ)?', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'MMMM [tile] D [san] YYYY', - 'LLL' => 'MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm', - 'LLLL' => 'dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[Bi lɛrɛ] LT', - 'nextDay' => '[Sini lɛrɛ] LT', - 'nextWeek' => 'dddd [don lɛrɛ] LT', - 'lastDay' => '[Kunu lɛrɛ] LT', - 'lastWeek' => 'dddd [tɛmɛnen lɛrɛ] LT', - 'sameElse' => 'L', - ], - 'months' => ['Zanwuyekalo', 'Fewuruyekalo', 'Marisikalo', 'Awirilikalo', 'Mɛkalo', 'Zuwɛnkalo', 'Zuluyekalo', 'Utikalo', 'Sɛtanburukalo', 'ɔkutɔburukalo', 'Nowanburukalo', 'Desanburukalo'], - 'months_short' => ['Zan', 'Few', 'Mar', 'Awi', 'Mɛ', 'Zuw', 'Zul', 'Uti', 'Sɛt', 'ɔku', 'Now', 'Des'], - 'weekdays' => ['Kari', 'Ntɛnɛn', 'Tarata', 'Araba', 'Alamisa', 'Juma', 'Sibiri'], - 'weekdays_short' => ['Kar', 'Ntɛ', 'Tar', 'Ara', 'Ala', 'Jum', 'Sib'], - 'weekdays_min' => ['Ka', 'Nt', 'Ta', 'Ar', 'Al', 'Ju', 'Si'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' ni '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bn.php b/vendor/nesbot/carbon/src/Carbon/Lang/bn.php deleted file mode 100644 index 8e147899..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bn.php +++ /dev/null @@ -1,100 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Josh Soref - * - Shakib Hossain - * - Raju - * - Aniruddha Adhikary - * - JD Isaacks - * - Saiful Islam - * - Faisal Islam - */ -return [ - 'year' => ':count বছর', - 'a_year' => 'এক বছর|:count বছর', - 'y' => '১ বছর|:count বছর', - 'month' => ':count মাস', - 'a_month' => 'এক মাস|:count মাস', - 'm' => '১ মাস|:count মাস', - 'week' => ':count সপ্তাহ', - 'a_week' => '১ সপ্তাহ|:count সপ্তাহ', - 'w' => '১ সপ্তাহ|:count সপ্তাহ', - 'day' => ':count দিন', - 'a_day' => 'এক দিন|:count দিন', - 'd' => '১ দিন|:count দিন', - 'hour' => ':count ঘন্টা', - 'a_hour' => 'এক ঘন্টা|:count ঘন্টা', - 'h' => '১ ঘন্টা|:count ঘন্টা', - 'minute' => ':count মিনিট', - 'a_minute' => 'এক মিনিট|:count মিনিট', - 'min' => '১ মিনিট|:count মিনিট', - 'second' => ':count সেকেন্ড', - 'a_second' => 'কয়েক সেকেন্ড|:count সেকেন্ড', - 's' => '১ সেকেন্ড|:count সেকেন্ড', - 'ago' => ':time আগে', - 'from_now' => ':time পরে', - 'after' => ':time পরে', - 'before' => ':time আগে', - 'diff_now' => 'এখন', - 'diff_today' => 'আজ', - 'diff_yesterday' => 'গতকাল', - 'diff_tomorrow' => 'আগামীকাল', - 'period_recurrences' => ':count বার|:count বার', - 'period_interval' => 'প্রতি :interval', - 'period_start_date' => ':date থেকে', - 'period_end_date' => ':date পর্যন্ত', - 'formats' => [ - 'LT' => 'A Oh:Om সময়', - 'LTS' => 'A Oh:Om:Os সময়', - 'L' => 'OD/OM/OY', - 'LL' => 'OD MMMM OY', - 'LLL' => 'OD MMMM OY, A Oh:Om সময়', - 'LLLL' => 'dddd, OD MMMM OY, A Oh:Om সময়', - ], - 'calendar' => [ - 'sameDay' => '[আজ] LT', - 'nextDay' => '[আগামীকাল] LT', - 'nextWeek' => 'dddd, LT', - 'lastDay' => '[গতকাল] LT', - 'lastWeek' => '[গত] dddd, LT', - 'sameElse' => 'L', - ], - 'meridiem' => function ($hour) { - if ($hour < 4) { - return 'রাত'; - } - if ($hour < 10) { - return 'সকাল'; - } - if ($hour < 17) { - return 'দুপুর'; - } - if ($hour < 20) { - return 'বিকাল'; - } - - return 'রাত'; - }, - 'months' => ['জানুয়ারী', 'ফেব্রুয়ারি', 'মার্চ', 'এপ্রিল', 'মে', 'জুন', 'জুলাই', 'আগস্ট', 'সেপ্টেম্বর', 'অক্টোবর', 'নভেম্বর', 'ডিসেম্বর'], - 'months_short' => ['জানু', 'ফেব', 'মার্চ', 'এপ্র', 'মে', 'জুন', 'জুল', 'আগ', 'সেপ্ট', 'অক্টো', 'নভে', 'ডিসে'], - 'weekdays' => ['রবিবার', 'সোমবার', 'মঙ্গলবার', 'বুধবার', 'বৃহস্পতিবার', 'শুক্রবার', 'শনিবার'], - 'weekdays_short' => ['রবি', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহস্পতি', 'শুক্র', 'শনি'], - 'weekdays_min' => ['রবি', 'সোম', 'মঙ্গ', 'বুধ', 'বৃহঃ', 'শুক্র', 'শনি'], - 'list' => [', ', ' এবং '], - 'first_day_of_week' => 0, - 'day_of_first_week_of_year' => 1, - 'weekdays_standalone' => ['রবিবার', 'সোমবার', 'মঙ্গলবার', 'বুধবার', 'বৃহষ্পতিবার', 'শুক্রবার', 'শনিবার'], - 'weekdays_min_standalone' => ['রঃ', 'সোঃ', 'মঃ', 'বুঃ', 'বৃঃ', 'শুঃ', 'শনি'], - 'months_short_standalone' => ['জানুয়ারী', 'ফেব্রুয়ারী', 'মার্চ', 'এপ্রিল', 'মে', 'জুন', 'জুলাই', 'আগস্ট', 'সেপ্টেম্বর', 'অক্টোবর', 'নভেম্বর', 'ডিসেম্বর'], - 'alt_numbers' => ['০', '১', '২', '৩', '৪', '৫', '৬', '৭', '৮', '৯'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bn_BD.php b/vendor/nesbot/carbon/src/Carbon/Lang/bn_BD.php deleted file mode 100644 index b5b28dd1..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bn_BD.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Ankur Group, Taneem Ahmed, Jamil Ahmed - */ -return array_replace_recursive(require __DIR__.'/bn.php', [ - 'formats' => [ - 'L' => 'D/M/YY', - ], - 'months' => ['জানুয়ারী', 'ফেব্রুয়ারী', 'মার্চ', 'এপ্রিল', 'মে', 'জুন', 'জুলাই', 'আগস্ট', 'সেপ্টেম্বর', 'অক্টোবর', 'নভেম্বর', 'ডিসেম্বর'], - 'months_short' => ['জানু', 'ফেব', 'মার্চ', 'এপ্রিল', 'মে', 'জুন', 'জুলাই', 'আগস্ট', 'সেপ্টেম্বর', 'অক্টোবর', 'নভেম্বর', 'ডিসেম্বর'], - 'weekdays' => ['রবিবার', 'সোমবার', 'মঙ্গলবার', 'বুধবার', 'বৃহস্পতিবার', 'শুক্রবার', 'শনিবার'], - 'weekdays_short' => ['রবি', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহঃ', 'শুক্র', 'শনি'], - 'weekdays_min' => ['রবি', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহঃ', 'শুক্র', 'শনি'], - 'first_day_of_week' => 5, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bn_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/bn_IN.php deleted file mode 100644 index 8b3a50e5..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bn_IN.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/bn.php', [ - 'formats' => [ - 'L' => 'D/M/YY', - ], - 'months' => ['জানুয়ারী', 'ফেব্রুয়ারী', 'মার্চ', 'এপ্রিল', 'মে', 'জুন', 'জুলাই', 'আগস্ট', 'সেপ্টেম্বর', 'অক্টোবর', 'নভেম্বর', 'ডিসেম্বর'], - 'months_short' => ['জানু', 'ফেব', 'মার্চ', 'এপ্রিল', 'মে', 'জুন', 'জুলাই', 'আগস্ট', 'সেপ্টেম্বর', 'অক্টোবর', 'নভেম্বর', 'ডিসেম্বর'], - 'weekdays' => ['রবিবার', 'সোমবার', 'মঙ্গলবার', 'বুধবার', 'বৃহস্পতিবার', 'শুক্রবার', 'শনিবার'], - 'weekdays_short' => ['রবি', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহস্পতি', 'শুক্র', 'শনি'], - 'weekdays_min' => ['রবি', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহস্পতি', 'শুক্র', 'শনি'], - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bo.php b/vendor/nesbot/carbon/src/Carbon/Lang/bo.php deleted file mode 100644 index 99e1bf4c..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bo.php +++ /dev/null @@ -1,71 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Josh Soref - * - JD Isaacks - */ -return [ - 'year' => '{1}ལོ་གཅིག|]1,Inf[:count ལོ', - 'month' => '{1}ཟླ་བ་གཅིག|]1,Inf[:count ཟླ་བ', - 'week' => ':count བདུན་ཕྲག', - 'day' => '{1}ཉིན་གཅིག|]1,Inf[:count ཉིན་', - 'hour' => '{1}ཆུ་ཚོད་གཅིག|]1,Inf[:count ཆུ་ཚོད', - 'minute' => '{1}སྐར་མ་གཅིག|]1,Inf[:count སྐར་མ', - 'second' => '{1}ལམ་སང|]1,Inf[:count སྐར་ཆ།', - 'ago' => ':time སྔན་ལ', - 'from_now' => ':time ལ་', - 'diff_yesterday' => 'ཁ་སང', - 'diff_today' => 'དི་རིང', - 'diff_tomorrow' => 'སང་ཉིན', - 'formats' => [ - 'LT' => 'A h:mm', - 'LTS' => 'A h:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY, A h:mm', - 'LLLL' => 'dddd, D MMMM YYYY, A h:mm', - ], - 'calendar' => [ - 'sameDay' => '[དི་རིང] LT', - 'nextDay' => '[སང་ཉིན] LT', - 'nextWeek' => '[བདུན་ཕྲག་རྗེས་མ], LT', - 'lastDay' => '[ཁ་སང] LT', - 'lastWeek' => '[བདུན་ཕྲག་མཐའ་མ] dddd, LT', - 'sameElse' => 'L', - ], - 'meridiem' => function ($hour) { - if ($hour < 4) { - return 'མཚན་མོ'; - } - if ($hour < 10) { - return 'ཞོགས་ཀས'; - } - if ($hour < 17) { - return 'ཉིན་གུང'; - } - if ($hour < 20) { - return 'དགོང་དག'; - } - - return 'མཚན་མོ'; - }, - 'months' => ['ཟླ་བ་དང་པོ', 'ཟླ་བ་གཉིས་པ', 'ཟླ་བ་གསུམ་པ', 'ཟླ་བ་བཞི་པ', 'ཟླ་བ་ལྔ་པ', 'ཟླ་བ་དྲུག་པ', 'ཟླ་བ་བདུན་པ', 'ཟླ་བ་བརྒྱད་པ', 'ཟླ་བ་དགུ་པ', 'ཟླ་བ་བཅུ་པ', 'ཟླ་བ་བཅུ་གཅིག་པ', 'ཟླ་བ་བཅུ་གཉིས་པ'], - 'months_short' => ['ཟླ་བ་དང་པོ', 'ཟླ་བ་གཉིས་པ', 'ཟླ་བ་གསུམ་པ', 'ཟླ་བ་བཞི་པ', 'ཟླ་བ་ལྔ་པ', 'ཟླ་བ་དྲུག་པ', 'ཟླ་བ་བདུན་པ', 'ཟླ་བ་བརྒྱད་པ', 'ཟླ་བ་དགུ་པ', 'ཟླ་བ་བཅུ་པ', 'ཟླ་བ་བཅུ་གཅིག་པ', 'ཟླ་བ་བཅུ་གཉིས་པ'], - 'weekdays' => ['གཟའ་ཉི་མ་', 'གཟའ་ཟླ་བ་', 'གཟའ་མིག་དམར་', 'གཟའ་ལྷག་པ་', 'གཟའ་ཕུར་བུ', 'གཟའ་པ་སངས་', 'གཟའ་སྤེན་པ་'], - 'weekdays_short' => ['ཉི་མ་', 'ཟླ་བ་', 'མིག་དམར་', 'ལྷག་པ་', 'ཕུར་བུ', 'པ་སངས་', 'སྤེན་པ་'], - 'weekdays_min' => ['ཉི་མ་', 'ཟླ་བ་', 'མིག་དམར་', 'ལྷག་པ་', 'ཕུར་བུ', 'པ་སངས་', 'སྤེན་པ་'], - 'list' => [', ', ' ཨནད་ '], - 'first_day_of_week' => 0, - 'day_of_first_week_of_year' => 1, - 'months_standalone' => ['ཟླ་བ་དང་པོ་', 'ཟླ་བ་གཉིས་པ་', 'ཟླ་བ་གསུམ་པ་', 'ཟླ་བ་བཞི་པ་', 'ཟླ་བ་ལྔ་པ་', 'ཟླ་བ་དྲུག་པ་', 'ཟླ་བ་བདུན་པ་', 'ཟླ་བ་བརྒྱད་པ་', 'ཟླ་བ་དགུ་པ་', 'ཟླ་བ་བཅུ་པ་', 'ཟླ་བ་བཅུ་གཅིག་པ་', 'ཟླ་བ་བཅུ་གཉིས་པ་'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bo_CN.php b/vendor/nesbot/carbon/src/Carbon/Lang/bo_CN.php deleted file mode 100644 index 380abb1e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bo_CN.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/bo.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bo_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/bo_IN.php deleted file mode 100644 index ca50d049..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bo_IN.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/bo.php', [ - 'meridiem' => ['སྔ་དྲོ་', 'ཕྱི་དྲོ་'], - 'weekdays' => ['གཟའ་ཉི་མ་', 'གཟའ་ཟླ་བ་', 'གཟའ་མིག་དམར་', 'གཟའ་ལྷག་པ་', 'གཟའ་ཕུར་བུ་', 'གཟའ་པ་སངས་', 'གཟའ་སྤེན་པ་'], - 'weekdays_short' => ['ཉི་མ་', 'ཟླ་བ་', 'མིག་དམར་', 'ལྷག་པ་', 'ཕུར་བུ་', 'པ་སངས་', 'སྤེན་པ་'], - 'weekdays_min' => ['ཉི་མ་', 'ཟླ་བ་', 'མིག་དམར་', 'ལྷག་པ་', 'ཕུར་བུ་', 'པ་སངས་', 'སྤེན་པ་'], - 'months' => ['ཟླ་བ་དང་པོ', 'ཟླ་བ་གཉིས་པ', 'ཟླ་བ་གསུམ་པ', 'ཟླ་བ་བཞི་པ', 'ཟླ་བ་ལྔ་པ', 'ཟླ་བ་དྲུག་པ', 'ཟླ་བ་བདུན་པ', 'ཟླ་བ་བརྒྱད་པ', 'ཟླ་བ་དགུ་པ', 'ཟླ་བ་བཅུ་པ', 'ཟླ་བ་བཅུ་གཅིག་པ', 'ཟླ་བ་བཅུ་གཉིས་པ'], - 'months_short' => ['ཟླ་༡', 'ཟླ་༢', 'ཟླ་༣', 'ཟླ་༤', 'ཟླ་༥', 'ཟླ་༦', 'ཟླ་༧', 'ཟླ་༨', 'ཟླ་༩', 'ཟླ་༡༠', 'ཟླ་༡༡', 'ཟླ་༡༢'], - 'months_standalone' => ['ཟླ་བ་དང་པོ་', 'ཟླ་བ་གཉིས་པ་', 'ཟླ་བ་གསུམ་པ་', 'ཟླ་བ་བཞི་པ་', 'ཟླ་བ་ལྔ་པ་', 'ཟླ་བ་དྲུག་པ་', 'ཟླ་བ་བདུན་པ་', 'ཟླ་བ་བརྒྱད་པ་', 'ཟླ་བ་དགུ་པ་', 'ཟླ་བ་བཅུ་པ་', 'ཟླ་བ་བཅུ་གཅིག་པ་', 'ཟླ་བ་བཅུ་གཉིས་པ་'], - 'weekend' => [0, 0], - 'formats' => [ - 'LT' => 'h:mm a', - 'LTS' => 'h:mm:ss a', - 'L' => 'YYYY-MM-DD', - 'LL' => 'YYYY ལོའི་MMMཚེས་D', - 'LLL' => 'སྤྱི་ལོ་YYYY MMMMའི་ཚེས་D h:mm a', - 'LLLL' => 'YYYY MMMMའི་ཚེས་D, dddd h:mm a', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/br.php b/vendor/nesbot/carbon/src/Carbon/Lang/br.php deleted file mode 100644 index 583472fb..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/br.php +++ /dev/null @@ -1,76 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - François B - * - Serhan Apaydın - * - JD Isaacks - */ -return [ - 'year' => '{1}:count bloaz|{3,4,5,9}:count bloaz|[0,Inf[:count vloaz', - 'a_year' => '{1}ur bloaz|{3,4,5,9}:count bloaz|[0,Inf[:count vloaz', - 'month' => '{1}:count miz|{2}:count viz|[0,Inf[:count miz', - 'a_month' => '{1}ur miz|{2}:count viz|[0,Inf[:count miz', - 'week' => ':count sizhun', - 'a_week' => '{1}ur sizhun|:count sizhun', - 'day' => '{1}:count devezh|{2}:count zevezh|[0,Inf[:count devezh', - 'a_day' => '{1}un devezh|{2}:count zevezh|[0,Inf[:count devezh', - 'hour' => ':count eur', - 'a_hour' => '{1}un eur|:count eur', - 'minute' => '{1}:count vunutenn|{2}:count vunutenn|[0,Inf[:count munutenn', - 'a_minute' => '{1}ur vunutenn|{2}:count vunutenn|[0,Inf[:count munutenn', - 'second' => ':count eilenn', - 'a_second' => '{1}un nebeud segondennoù|[0,Inf[:count eilenn', - 'ago' => ':time \'zo', - 'from_now' => 'a-benn :time', - 'diff_now' => 'bremañ', - 'diff_today' => 'Hiziv', - 'diff_today_regexp' => 'Hiziv(?:\\s+da)?', - 'diff_yesterday' => 'decʼh', - 'diff_yesterday_regexp' => 'Dec\'h(?:\\s+da)?', - 'diff_tomorrow' => 'warcʼhoazh', - 'diff_tomorrow_regexp' => 'Warc\'hoazh(?:\\s+da)?', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D [a viz] MMMM YYYY', - 'LLL' => 'D [a viz] MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D [a viz] MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[Hiziv da] LT', - 'nextDay' => '[Warc\'hoazh da] LT', - 'nextWeek' => 'dddd [da] LT', - 'lastDay' => '[Dec\'h da] LT', - 'lastWeek' => 'dddd [paset da] LT', - 'sameElse' => 'L', - ], - 'ordinal' => function ($number) { - return $number.($number === 1 ? 'añ' : 'vet'); - }, - 'months' => ['Genver', 'C\'hwevrer', 'Meurzh', 'Ebrel', 'Mae', 'Mezheven', 'Gouere', 'Eost', 'Gwengolo', 'Here', 'Du', 'Kerzu'], - 'months_short' => ['Gen', 'C\'hwe', 'Meu', 'Ebr', 'Mae', 'Eve', 'Gou', 'Eos', 'Gwe', 'Her', 'Du', 'Ker'], - 'weekdays' => ['Sul', 'Lun', 'Meurzh', 'Merc\'her', 'Yaou', 'Gwener', 'Sadorn'], - 'weekdays_short' => ['Sul', 'Lun', 'Meu', 'Mer', 'Yao', 'Gwe', 'Sad'], - 'weekdays_min' => ['Su', 'Lu', 'Me', 'Mer', 'Ya', 'Gw', 'Sa'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' hag '], - 'meridiem' => ['A.M.', 'G.M.'], - - 'y' => ':count bl.', - 'd' => ':count d', - 'h' => ':count e', - 'min' => ':count min', - 's' => ':count s', -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/br_FR.php b/vendor/nesbot/carbon/src/Carbon/Lang/br_FR.php deleted file mode 100644 index 7f541858..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/br_FR.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/br.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/brx.php b/vendor/nesbot/carbon/src/Carbon/Lang/brx.php deleted file mode 100644 index a0a7bf9b..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/brx.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/brx_IN.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/brx_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/brx_IN.php deleted file mode 100644 index 2d80ced2..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/brx_IN.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Red Hat Pune bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'M/D/YY', - ], - 'months' => ['जानुवारी', 'फेब्रुवारी', 'मार्स', 'एफ्रिल', 'मे', 'जुन', 'जुलाइ', 'आगस्थ', 'सेबथेज्ब़र', 'अखथबर', 'नबेज्ब़र', 'दिसेज्ब़र'], - 'months_short' => ['जानुवारी', 'फेब्रुवारी', 'मार्स', 'एप्रिल', 'मे', 'जुन', 'जुलाइ', 'आगस्थ', 'सेबथेज्ब़र', 'अखथबर', 'नबेज्ब़र', 'दिसेज्ब़र'], - 'weekdays' => ['रबिबार', 'सोबार', 'मंगलबार', 'बुदबार', 'बिसथिबार', 'सुखुरबार', 'सुनिबार'], - 'weekdays_short' => ['रबि', 'सम', 'मंगल', 'बुद', 'बिसथि', 'सुखुर', 'सुनि'], - 'weekdays_min' => ['रबि', 'सम', 'मंगल', 'बुद', 'बिसथि', 'सुखुर', 'सुनि'], - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['फुं.', 'बेलासे.'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bs.php b/vendor/nesbot/carbon/src/Carbon/Lang/bs.php deleted file mode 100644 index e5d68083..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bs.php +++ /dev/null @@ -1,97 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - bokideckonja - * - Josh Soref - * - François B - * - shaishavgandhi05 - * - Serhan Apaydın - * - JD Isaacks - */ - -use Carbon\CarbonInterface; - -return [ - 'year' => ':count godina|:count godine|:count godina', - 'y' => ':count godina|:count godine|:count godina', - 'month' => ':count mjesec|:count mjeseca|:count mjeseci', - 'm' => ':count mjesec|:count mjeseca|:count mjeseci', - 'week' => ':count sedmice|:count sedmicu|:count sedmica', - 'w' => ':count sedmice|:count sedmicu|:count sedmica', - 'day' => ':count dan|:count dana|:count dana', - 'd' => ':count dan|:count dana|:count dana', - 'hour' => ':count sat|:count sata|:count sati', - 'h' => ':count sat|:count sata|:count sati', - 'minute' => ':count minut|:count minuta|:count minuta', - 'min' => ':count minut|:count minuta|:count minuta', - 'second' => ':count sekund|:count sekunda|:count sekundi', - 's' => ':count sekund|:count sekunda|:count sekundi', - 'ago' => 'prije :time', - 'from_now' => 'za :time', - 'after' => 'nakon :time', - 'before' => ':time ranije', - 'diff_now' => 'sada', - 'diff_today' => 'danas', - 'diff_today_regexp' => 'danas(?:\\s+u)?', - 'diff_yesterday' => 'jučer', - 'diff_yesterday_regexp' => 'jučer(?:\\s+u)?', - 'diff_tomorrow' => 'sutra', - 'diff_tomorrow_regexp' => 'sutra(?:\\s+u)?', - 'formats' => [ - 'LT' => 'H:mm', - 'LTS' => 'H:mm:ss', - 'L' => 'DD.MM.YYYY', - 'LL' => 'D. MMMM YYYY', - 'LLL' => 'D. MMMM YYYY H:mm', - 'LLLL' => 'dddd, D. MMMM YYYY H:mm', - ], - 'calendar' => [ - 'sameDay' => '[danas u] LT', - 'nextDay' => '[sutra u] LT', - 'nextWeek' => function (CarbonInterface $current) { - switch ($current->dayOfWeek) { - case 0: - return '[u] [nedjelju] [u] LT'; - case 3: - return '[u] [srijedu] [u] LT'; - case 6: - return '[u] [subotu] [u] LT'; - default: - return '[u] dddd [u] LT'; - } - }, - 'lastDay' => '[jučer u] LT', - 'lastWeek' => function (CarbonInterface $current) { - switch ($current->dayOfWeek) { - case 0: - case 3: - return '[prošlu] dddd [u] LT'; - case 6: - return '[prošle] [subote] [u] LT'; - default: - return '[prošli] dddd [u] LT'; - } - }, - 'sameElse' => 'L', - ], - 'ordinal' => ':number.', - 'months' => ['januar', 'februar', 'mart', 'april', 'maj', 'juni', 'juli', 'august', 'septembar', 'oktobar', 'novembar', 'decembar'], - 'months_short' => ['jan.', 'feb.', 'mar.', 'apr.', 'maj.', 'jun.', 'jul.', 'aug.', 'sep.', 'okt.', 'nov.', 'dec.'], - 'weekdays' => ['nedjelja', 'ponedjeljak', 'utorak', 'srijeda', 'četvrtak', 'petak', 'subota'], - 'weekdays_short' => ['ned.', 'pon.', 'uto.', 'sri.', 'čet.', 'pet.', 'sub.'], - 'weekdays_min' => ['ne', 'po', 'ut', 'sr', 'če', 'pe', 'su'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'list' => [', ', ' i '], - 'meridiem' => ['prijepodne', 'popodne'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bs_BA.php b/vendor/nesbot/carbon/src/Carbon/Lang/bs_BA.php deleted file mode 100644 index 0a591176..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bs_BA.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/bs.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bs_Cyrl.php b/vendor/nesbot/carbon/src/Carbon/Lang/bs_Cyrl.php deleted file mode 100644 index e1a17447..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bs_Cyrl.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/bs.php', [ - 'meridiem' => ['пре подне', 'поподне'], - 'weekdays' => ['недјеља', 'понедјељак', 'уторак', 'сриједа', 'четвртак', 'петак', 'субота'], - 'weekdays_short' => ['нед', 'пон', 'уто', 'сри', 'чет', 'пет', 'суб'], - 'weekdays_min' => ['нед', 'пон', 'уто', 'сри', 'чет', 'пет', 'суб'], - 'months' => ['јануар', 'фебруар', 'март', 'април', 'мај', 'јуни', 'јули', 'аугуст', 'септембар', 'октобар', 'новембар', 'децембар'], - 'months_short' => ['јан', 'феб', 'мар', 'апр', 'мај', 'јун', 'јул', 'ауг', 'сеп', 'окт', 'нов', 'дец'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'D.M.YYYY.', - 'LL' => 'DD.MM.YYYY.', - 'LLL' => 'DD. MMMM YYYY. HH:mm', - 'LLLL' => 'dddd, DD. MMMM YYYY. HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bs_Latn.php b/vendor/nesbot/carbon/src/Carbon/Lang/bs_Latn.php deleted file mode 100644 index b4e363e7..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bs_Latn.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/bs.php', [ -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/byn.php b/vendor/nesbot/carbon/src/Carbon/Lang/byn.php deleted file mode 100644 index 7125f3d6..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/byn.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/byn_ER.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/byn_ER.php b/vendor/nesbot/carbon/src/Carbon/Lang/byn_ER.php deleted file mode 100644 index ad675334..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/byn_ER.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Ge'ez Frontier Foundation locales@geez.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YYYY', - ], - 'months' => ['ልደትሪ', 'ካብኽብቲ', 'ክብላ', 'ፋጅኺሪ', 'ክቢቅሪ', 'ምኪኤል ትጓ̅ኒሪ', 'ኰርኩ', 'ማርያም ትሪ', 'ያኸኒ መሳቅለሪ', 'መተሉ', 'ምኪኤል መሽወሪ', 'ተሕሳስሪ'], - 'months_short' => ['ልደት', 'ካብኽ', 'ክብላ', 'ፋጅኺ', 'ክቢቅ', 'ም/ት', 'ኰር', 'ማርያ', 'ያኸኒ', 'መተሉ', 'ም/ም', 'ተሕሳ'], - 'weekdays' => ['ሰንበር ቅዳዅ', 'ሰኑ', 'ሰሊጝ', 'ለጓ ወሪ ለብዋ', 'ኣምድ', 'ኣርብ', 'ሰንበር ሽጓዅ'], - 'weekdays_short' => ['ሰ/ቅ', 'ሰኑ', 'ሰሊጝ', 'ለጓ', 'ኣምድ', 'ኣርብ', 'ሰ/ሽ'], - 'weekdays_min' => ['ሰ/ቅ', 'ሰኑ', 'ሰሊጝ', 'ለጓ', 'ኣምድ', 'ኣርብ', 'ሰ/ሽ'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['ፋዱስ ጃብ', 'ፋዱስ ደምቢ'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ca.php b/vendor/nesbot/carbon/src/Carbon/Lang/ca.php deleted file mode 100644 index b8b19946..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ca.php +++ /dev/null @@ -1,117 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - mestremuten - * - François B - * - Marc Ordinas i Llopis - * - Pere Orga - * - JD Isaacks - * - Quentí - * - Víctor Díaz - * - Xavi - * - qcardona - */ - -use Carbon\CarbonInterface; - -return [ - 'year' => ':count any|:count anys', - 'a_year' => 'un any|:count anys', - 'y' => ':count any|:count anys', - 'month' => ':count mes|:count mesos', - 'a_month' => 'un mes|:count mesos', - 'm' => ':count mes|:count mesos', - 'week' => ':count setmana|:count setmanes', - 'a_week' => 'una setmana|:count setmanes', - 'w' => ':count setmana|:count setmanes', - 'day' => ':count dia|:count dies', - 'a_day' => 'un dia|:count dies', - 'd' => ':count d', - 'hour' => ':count hora|:count hores', - 'a_hour' => 'una hora|:count hores', - 'h' => ':count h', - 'minute' => ':count minut|:count minuts', - 'a_minute' => 'un minut|:count minuts', - 'min' => ':count min', - 'second' => ':count segon|:count segons', - 'a_second' => 'uns segons|:count segons', - 's' => ':count s', - 'ago' => 'fa :time', - 'from_now' => 'd\'aquí a :time', - 'after' => ':time després', - 'before' => ':time abans', - 'diff_now' => 'ara mateix', - 'diff_today' => 'avui', - 'diff_today_regexp' => 'avui(?:\\s+a)?(?:\\s+les)?', - 'diff_yesterday' => 'ahir', - 'diff_yesterday_regexp' => 'ahir(?:\\s+a)?(?:\\s+les)?', - 'diff_tomorrow' => 'demà', - 'diff_tomorrow_regexp' => 'demà(?:\\s+a)?(?:\\s+les)?', - 'diff_before_yesterday' => 'abans d\'ahir', - 'diff_after_tomorrow' => 'demà passat', - 'period_recurrences' => ':count cop|:count cops', - 'period_interval' => 'cada :interval', - 'period_start_date' => 'de :date', - 'period_end_date' => 'fins a :date', - 'formats' => [ - 'LT' => 'H:mm', - 'LTS' => 'H:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM [de] YYYY', - 'LLL' => 'D MMMM [de] YYYY [a les] H:mm', - 'LLLL' => 'dddd D MMMM [de] YYYY [a les] H:mm', - ], - 'calendar' => [ - 'sameDay' => function (CarbonInterface $current) { - return '[avui a '.($current->hour !== 1 ? 'les' : 'la').'] LT'; - }, - 'nextDay' => function (CarbonInterface $current) { - return '[demà a '.($current->hour !== 1 ? 'les' : 'la').'] LT'; - }, - 'nextWeek' => function (CarbonInterface $current) { - return 'dddd [a '.($current->hour !== 1 ? 'les' : 'la').'] LT'; - }, - 'lastDay' => function (CarbonInterface $current) { - return '[ahir a '.($current->hour !== 1 ? 'les' : 'la').'] LT'; - }, - 'lastWeek' => function (CarbonInterface $current) { - return '[el] dddd [passat a '.($current->hour !== 1 ? 'les' : 'la').'] LT'; - }, - 'sameElse' => 'L', - ], - 'ordinal' => function ($number, $period) { - return $number.( - ($period === 'w' || $period === 'W') ? 'a' : ( - ($number === 1) ? 'r' : ( - ($number === 2) ? 'n' : ( - ($number === 3) ? 'r' : ( - ($number === 4) ? 't' : 'è' - ) - ) - ) - ) - ); - }, - 'months' => ['de gener', 'de febrer', 'de març', 'd\'abril', 'de maig', 'de juny', 'de juliol', 'd\'agost', 'de setembre', 'd\'octubre', 'de novembre', 'de desembre'], - 'months_standalone' => ['gener', 'febrer', 'març', 'abril', 'maig', 'juny', 'juliol', 'agost', 'setembre', 'octubre', 'novembre', 'desembre'], - 'months_short' => ['de gen.', 'de febr.', 'de març', 'd\'abr.', 'de maig', 'de juny', 'de jul.', 'd\'ag.', 'de set.', 'd\'oct.', 'de nov.', 'de des.'], - 'months_short_standalone' => ['gen.', 'febr.', 'març', 'abr.', 'maig', 'juny', 'jul.', 'ag.', 'set.', 'oct.', 'nov.', 'des.'], - 'months_regexp' => '/(D[oD]?[\s,]+MMMM?|L{2,4}|l{2,4})/', - 'weekdays' => ['diumenge', 'dilluns', 'dimarts', 'dimecres', 'dijous', 'divendres', 'dissabte'], - 'weekdays_short' => ['dg.', 'dl.', 'dt.', 'dc.', 'dj.', 'dv.', 'ds.'], - 'weekdays_min' => ['dg', 'dl', 'dt', 'dc', 'dj', 'dv', 'ds'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' i '], - 'meridiem' => ['a. m.', 'p. m.'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ca_AD.php b/vendor/nesbot/carbon/src/Carbon/Lang/ca_AD.php deleted file mode 100644 index 861acd2a..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ca_AD.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/ca.php', [ -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES.php b/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES.php deleted file mode 100644 index 50049786..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/ca.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES_Valencia.php b/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES_Valencia.php deleted file mode 100644 index 861acd2a..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES_Valencia.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/ca.php', [ -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ca_FR.php b/vendor/nesbot/carbon/src/Carbon/Lang/ca_FR.php deleted file mode 100644 index 861acd2a..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ca_FR.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/ca.php', [ -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ca_IT.php b/vendor/nesbot/carbon/src/Carbon/Lang/ca_IT.php deleted file mode 100644 index 861acd2a..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ca_IT.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/ca.php', [ -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ccp.php b/vendor/nesbot/carbon/src/Carbon/Lang/ccp.php deleted file mode 100644 index 99c1dcac..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ccp.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'weekdays' => ['𑄢𑄧𑄝𑄨𑄝𑄢𑄴', '𑄥𑄧𑄟𑄴𑄝𑄢𑄴', '𑄟𑄧𑄁𑄉𑄧𑄣𑄴𑄝𑄢𑄴', '𑄝𑄪𑄖𑄴𑄝𑄢𑄴', '𑄝𑄳𑄢𑄨𑄥𑄪𑄛𑄴𑄝𑄢𑄴', '𑄥𑄪𑄇𑄴𑄇𑄮𑄢𑄴𑄝𑄢𑄴', '𑄥𑄧𑄚𑄨𑄝𑄢𑄴'], - 'weekdays_short' => ['𑄢𑄧𑄝𑄨', '𑄥𑄧𑄟𑄴', '𑄟𑄧𑄁𑄉𑄧𑄣𑄴', '𑄝𑄪𑄖𑄴', '𑄝𑄳𑄢𑄨𑄥𑄪𑄛𑄴', '𑄥𑄪𑄇𑄴𑄇𑄮𑄢𑄴', '𑄥𑄧𑄚𑄨'], - 'weekdays_min' => ['𑄢𑄧𑄝𑄨', '𑄥𑄧𑄟𑄴', '𑄟𑄧𑄁𑄉𑄧𑄣𑄴', '𑄝𑄪𑄖𑄴', '𑄝𑄳𑄢𑄨𑄥𑄪𑄛𑄴', '𑄥𑄪𑄇𑄴𑄇𑄮𑄢𑄴', '𑄥𑄧𑄚𑄨'], - 'months' => ['𑄎𑄚𑄪𑄠𑄢𑄨', '𑄜𑄬𑄛𑄴𑄝𑄳𑄢𑄪𑄠𑄢𑄨', '𑄟𑄢𑄴𑄌𑄧', '𑄃𑄬𑄛𑄳𑄢𑄨𑄣𑄴', '𑄟𑄬', '𑄎𑄪𑄚𑄴', '𑄎𑄪𑄣𑄭', '𑄃𑄉𑄧𑄌𑄴𑄑𑄴', '𑄥𑄬𑄛𑄴𑄑𑄬𑄟𑄴𑄝𑄧𑄢𑄴', '𑄃𑄧𑄇𑄴𑄑𑄬𑄝𑄧𑄢𑄴', '𑄚𑄧𑄞𑄬𑄟𑄴𑄝𑄧𑄢𑄴', '𑄓𑄨𑄥𑄬𑄟𑄴𑄝𑄧𑄢𑄴'], - 'months_short' => ['𑄎𑄚𑄪', '𑄜𑄬𑄛𑄴', '𑄟𑄢𑄴𑄌𑄧', '𑄃𑄬𑄛𑄳𑄢𑄨𑄣𑄴', '𑄟𑄬', '𑄎𑄪𑄚𑄴', '𑄎𑄪𑄣𑄭', '𑄃𑄉𑄧𑄌𑄴𑄑𑄴', '𑄥𑄬𑄛𑄴𑄑𑄬𑄟𑄴𑄝𑄧𑄢𑄴', '𑄃𑄧𑄇𑄴𑄑𑄮𑄝𑄧𑄢𑄴', '𑄚𑄧𑄞𑄬𑄟𑄴𑄝𑄧𑄢𑄴', '𑄓𑄨𑄥𑄬𑄟𑄴𑄝𑄢𑄴'], - 'months_short_standalone' => ['𑄎𑄚𑄪𑄠𑄢𑄨', '𑄜𑄬𑄛𑄴𑄝𑄳𑄢𑄪𑄠𑄢𑄨', '𑄟𑄢𑄴𑄌𑄧', '𑄃𑄬𑄛𑄳𑄢𑄨𑄣𑄴', '𑄟𑄬', '𑄎𑄪𑄚𑄴', '𑄎𑄪𑄣𑄭', '𑄃𑄉𑄧𑄌𑄴𑄑𑄴', '𑄥𑄬𑄛𑄴𑄑𑄬𑄟𑄴𑄝𑄧𑄢𑄴', '𑄃𑄧𑄇𑄴𑄑𑄮𑄝𑄧𑄢𑄴', '𑄚𑄧𑄞𑄬𑄟𑄴𑄝𑄧𑄢𑄴', '𑄓𑄨𑄥𑄬𑄟𑄴𑄝𑄧𑄢𑄴'], - 'formats' => [ - 'LT' => 'h:mm a', - 'LTS' => 'h:mm:ss a', - 'L' => 'D/M/YYYY', - 'LL' => 'D MMM, YYYY', - 'LLL' => 'D MMMM, YYYY h:mm a', - 'LLLL' => 'dddd, D MMMM, YYYY h:mm a', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ccp_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/ccp_IN.php deleted file mode 100644 index c1fa8af0..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ccp_IN.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/ccp.php', [ - 'weekend' => [0, 0], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ce.php b/vendor/nesbot/carbon/src/Carbon/Lang/ce.php deleted file mode 100644 index f99f6ffd..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ce.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/ce_RU.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ce_RU.php b/vendor/nesbot/carbon/src/Carbon/Lang/ce_RU.php deleted file mode 100644 index f7698562..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ce_RU.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - ANCHR - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'YYYY.DD.MM', - ], - 'months' => ['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'], - 'months_short' => ['янв', 'фев', 'мар', 'апр', 'май', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек'], - 'weekdays' => ['КӀиранан де', 'Оршотан де', 'Шинарин де', 'Кхаарин де', 'Еарин де', 'ПӀераскан де', 'Шот де'], - 'weekdays_short' => ['КӀ', 'Ор', 'Ши', 'Кх', 'Еа', 'ПӀ', 'Шо'], - 'weekdays_min' => ['КӀ', 'Ор', 'Ши', 'Кх', 'Еа', 'ПӀ', 'Шо'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - - 'year' => ':count шо', - 'y' => ':count шо', - 'a_year' => ':count шо', - - 'month' => ':count бутт', - 'm' => ':count бутт', - 'a_month' => ':count бутт', - - 'week' => ':count кӏира', - 'w' => ':count кӏира', - 'a_week' => ':count кӏира', - - 'day' => ':count де', - 'd' => ':count де', - 'a_day' => ':count де', - - 'hour' => ':count сахьт', - 'h' => ':count сахьт', - 'a_hour' => ':count сахьт', - - 'minute' => ':count минот', - 'min' => ':count минот', - 'a_minute' => ':count минот', - - 'second' => ':count секунд', - 's' => ':count секунд', - 'a_second' => ':count секунд', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/cgg.php b/vendor/nesbot/carbon/src/Carbon/Lang/cgg.php deleted file mode 100644 index 09bcc1c7..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/cgg.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'weekdays' => ['Sande', 'Orwokubanza', 'Orwakabiri', 'Orwakashatu', 'Orwakana', 'Orwakataano', 'Orwamukaaga'], - 'weekdays_short' => ['SAN', 'ORK', 'OKB', 'OKS', 'OKN', 'OKT', 'OMK'], - 'weekdays_min' => ['SAN', 'ORK', 'OKB', 'OKS', 'OKN', 'OKT', 'OMK'], - 'months' => ['Okwokubanza', 'Okwakabiri', 'Okwakashatu', 'Okwakana', 'Okwakataana', 'Okwamukaaga', 'Okwamushanju', 'Okwamunaana', 'Okwamwenda', 'Okwaikumi', 'Okwaikumi na kumwe', 'Okwaikumi na ibiri'], - 'months_short' => ['KBZ', 'KBR', 'KST', 'KKN', 'KTN', 'KMK', 'KMS', 'KMN', 'KMW', 'KKM', 'KNK', 'KNB'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], - - 'day' => ':count ruhanga', // less reliable - 'd' => ':count ruhanga', // less reliable - 'a_day' => ':count ruhanga', // less reliable -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/chr.php b/vendor/nesbot/carbon/src/Carbon/Lang/chr.php deleted file mode 100644 index e26190f1..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/chr.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/chr_US.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/chr_US.php b/vendor/nesbot/carbon/src/Carbon/Lang/chr_US.php deleted file mode 100644 index 371353ef..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/chr_US.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Cherokee Nation Joseph Erb josepherb7@gmail.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'MM/DD/YYYY', - ], - 'months' => ['ᎤᏃᎸᏔᏅ', 'ᎧᎦᎵ', 'ᎠᏅᏱ', 'ᎧᏬᏂ', 'ᎠᏂᏍᎬᏘ', 'ᏕᎭᎷᏱ', 'ᎫᏰᏉᏂ', 'ᎦᎶᏂ', 'ᏚᎵᏍᏗ', 'ᏚᏂᏅᏗ', 'ᏅᏓᏕᏆ', 'ᎥᏍᎩᏱ'], - 'months_short' => ['ᎤᏃ', 'ᎧᎦ', 'ᎠᏅ', 'ᎧᏬ', 'ᎠᏂ', 'ᏕᎭ', 'ᎫᏰ', 'ᎦᎶ', 'ᏚᎵ', 'ᏚᏂ', 'ᏅᏓ', 'ᎥᏍ'], - 'weekdays' => ['ᎤᎾᏙᏓᏆᏍᎬ', 'ᎤᎾᏙᏓᏉᏅᎯ', 'ᏔᎵᏁᎢᎦ', 'ᏦᎢᏁᎢᎦ', 'ᏅᎩᏁᎢᎦ', 'ᏧᎾᎩᎶᏍᏗ', 'ᎤᎾᏙᏓᏈᏕᎾ'], - 'weekdays_short' => ['ᏆᏍᎬ', 'ᏉᏅᎯ', 'ᏔᎵᏁ', 'ᏦᎢᏁ', 'ᏅᎩᏁ', 'ᏧᎾᎩ', 'ᏈᏕᎾ'], - 'weekdays_min' => ['ᏆᏍᎬ', 'ᏉᏅᎯ', 'ᏔᎵᏁ', 'ᏦᎢᏁ', 'ᏅᎩᏁ', 'ᏧᎾᎩ', 'ᏈᏕᎾ'], - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['ᏌᎾᎴ', 'ᏒᎯᏱᎢᏗᏢ', 'ꮜꮎꮄ', 'ꮢꭿᏹꭲꮧꮲ'], - - 'second' => ':count ᏐᎢ', // less reliable - 's' => ':count ᏐᎢ', // less reliable - 'a_second' => ':count ᏐᎢ', // less reliable - - 'year' => ':count ᏑᏕᏘᏴᏓ', - 'y' => ':count ᏑᏕᏘᏴᏓ', - 'a_year' => ':count ᏑᏕᏘᏴᏓ', - - 'month' => ':count ᏏᏅᏙ', - 'm' => ':count ᏏᏅᏙ', - 'a_month' => ':count ᏏᏅᏙ', - - 'week' => ':count ᏑᎾᏙᏓᏆᏍᏗ', - 'w' => ':count ᏑᎾᏙᏓᏆᏍᏗ', - 'a_week' => ':count ᏑᎾᏙᏓᏆᏍᏗ', - - 'day' => ':count ᎢᎦ', - 'd' => ':count ᎢᎦ', - 'a_day' => ':count ᎢᎦ', - - 'hour' => ':count ᏑᏟᎶᏛ', - 'h' => ':count ᏑᏟᎶᏛ', - 'a_hour' => ':count ᏑᏟᎶᏛ', - - 'minute' => ':count ᎢᏯᏔᏬᏍᏔᏅ', - 'min' => ':count ᎢᏯᏔᏬᏍᏔᏅ', - 'a_minute' => ':count ᎢᏯᏔᏬᏍᏔᏅ', - - 'ago' => ':time ᏥᎨᏒ', - 'from_now' => 'ᎾᎿ :time', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ckb.php b/vendor/nesbot/carbon/src/Carbon/Lang/ckb.php deleted file mode 100644 index acf4dc28..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ckb.php +++ /dev/null @@ -1,89 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Swara Mohammed - */ -$months = [ - 'ڕێبەندان', - 'ڕەشەمە', - 'نەورۆز', - 'گوڵان', - 'جۆزەردان', - 'پوشپەڕ', - 'گەلاوێژ', - 'خەرمانان', - 'ڕەزبەر', - 'گەڵاڕێزان', - 'سەرماوەرز', - 'بەفرانبار', -]; - -return [ - 'year' => implode('|', ['{0}:count ساڵێک', '{1}ساڵێک', '{2}دوو ساڵ', ']2,11[:count ساڵ', ']10,Inf[:count ساڵ']), - 'a_year' => implode('|', ['{0}:count ساڵێک', '{1}ساڵێک', '{2}دوو ساڵ', ']2,11[:count ساڵ', ']10,Inf[:count ساڵ']), - 'month' => implode('|', ['{0}:count مانگێک', '{1}مانگێک', '{2}دوو مانگ', ']2,11[:count مانگ', ']10,Inf[:count مانگ']), - 'a_month' => implode('|', ['{0}:count مانگێک', '{1}مانگێک', '{2}دوو مانگ', ']2,11[:count مانگ', ']10,Inf[:count مانگ']), - 'week' => implode('|', ['{0}:count هەفتەیەک', '{1}هەفتەیەک', '{2}دوو هەفتە', ']2,11[:count هەفتە', ']10,Inf[:count هەفتە']), - 'a_week' => implode('|', ['{0}:count هەفتەیەک', '{1}هەفتەیەک', '{2}دوو هەفتە', ']2,11[:count هەفتە', ']10,Inf[:count هەفتە']), - 'day' => implode('|', ['{0}:count ڕۆژێک', '{1}ڕۆژێک', '{2}دوو ڕۆژ', ']2,11[:count ڕۆژ', ']10,Inf[:count ڕۆژ']), - 'a_day' => implode('|', ['{0}:count ڕۆژێک', '{1}ڕۆژێک', '{2}دوو ڕۆژ', ']2,11[:count ڕۆژ', ']10,Inf[:count ڕۆژ']), - 'hour' => implode('|', ['{0}:count کاتژمێرێک', '{1}کاتژمێرێک', '{2}دوو کاتژمێر', ']2,11[:count کاتژمێر', ']10,Inf[:count کاتژمێر']), - 'a_hour' => implode('|', ['{0}:count کاتژمێرێک', '{1}کاتژمێرێک', '{2}دوو کاتژمێر', ']2,11[:count کاتژمێر', ']10,Inf[:count کاتژمێر']), - 'minute' => implode('|', ['{0}:count خولەکێک', '{1}خولەکێک', '{2}دوو خولەک', ']2,11[:count خولەک', ']10,Inf[:count خولەک']), - 'a_minute' => implode('|', ['{0}:count خولەکێک', '{1}خولەکێک', '{2}دوو خولەک', ']2,11[:count خولەک', ']10,Inf[:count خولەک']), - 'second' => implode('|', ['{0}:count چرکەیەک', '{1}چرکەیەک', '{2}دوو چرکە', ']2,11[:count چرکە', ']10,Inf[:count چرکە']), - 'a_second' => implode('|', ['{0}:count چرکەیەک', '{1}چرکەیەک', '{2}دوو چرکە', ']2,11[:count چرکە', ']10,Inf[:count چرکە']), - 'ago' => 'پێش :time', - 'from_now' => ':time لە ئێستاوە', - 'after' => 'دوای :time', - 'before' => 'پێش :time', - 'diff_now' => 'ئێستا', - 'diff_today' => 'ئەمڕۆ', - 'diff_today_regexp' => 'ڕۆژ(?:\\s+لە)?(?:\\s+کاتژمێر)?', - 'diff_yesterday' => 'دوێنێ', - 'diff_yesterday_regexp' => 'دوێنێ(?:\\s+لە)?(?:\\s+کاتژمێر)?', - 'diff_tomorrow' => 'سبەینێ', - 'diff_tomorrow_regexp' => 'سبەینێ(?:\\s+لە)?(?:\\s+کاتژمێر)?', - 'diff_before_yesterday' => 'پێش دوێنێ', - 'diff_after_tomorrow' => 'دوای سبەینێ', - 'period_recurrences' => implode('|', ['{0}جار', '{1}جار', '{2}:count دووجار', ']2,11[:count جار', ']10,Inf[:count جار']), - 'period_interval' => 'هەموو :interval', - 'period_start_date' => 'لە :date', - 'period_end_date' => 'بۆ :date', - 'months' => $months, - 'months_short' => $months, - 'weekdays' => ['یەکشەممە', 'دووشەممە', 'سێشەممە', 'چوارشەممە', 'پێنجشەممە', 'هەینی', 'شەممە'], - 'weekdays_short' => ['یەکشەممە', 'دووشەممە', 'سێشەممە', 'چوارشەممە', 'پێنجشەممە', 'هەینی', 'شەممە'], - 'weekdays_min' => ['یەکشەممە', 'دووشەممە', 'سێشەممە', 'چوارشەممە', 'پێنجشەممە', 'هەینی', 'شەممە'], - 'list' => ['، ', ' و '], - 'first_day_of_week' => 6, - 'day_of_first_week_of_year' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'D/M/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[ئەمڕۆ لە کاتژمێر] LT', - 'nextDay' => '[سبەینێ لە کاتژمێر] LT', - 'nextWeek' => 'dddd [لە کاتژمێر] LT', - 'lastDay' => '[دوێنێ لە کاتژمێر] LT', - 'lastWeek' => 'dddd [لە کاتژمێر] LT', - 'sameElse' => 'L', - ], - 'meridiem' => ['پ.ن', 'د.ن'], - 'weekend' => [5, 6], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/cmn.php b/vendor/nesbot/carbon/src/Carbon/Lang/cmn.php deleted file mode 100644 index 80b1d694..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/cmn.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/cmn_TW.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/cmn_TW.php b/vendor/nesbot/carbon/src/Carbon/Lang/cmn_TW.php deleted file mode 100644 index 7e43f9de..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/cmn_TW.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'YYYY年MM月DD號', - ], - 'months' => ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], - 'months_short' => [' 1月', ' 2月', ' 3月', ' 4月', ' 5月', ' 6月', ' 7月', ' 8月', ' 9月', '10月', '11月', '12月'], - 'weekdays' => ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'], - 'weekdays_short' => ['日', '一', '二', '三', '四', '五', '六'], - 'weekdays_min' => ['日', '一', '二', '三', '四', '五', '六'], - 'meridiem' => ['上午', '下午'], - - 'year' => ':count 年', - 'y' => ':count 年', - 'a_year' => ':count 年', - - 'month' => ':count 月', - 'm' => ':count 月', - 'a_month' => ':count 月', - - 'week' => ':count 周', - 'w' => ':count 周', - 'a_week' => ':count 周', - - 'day' => ':count 白天', - 'd' => ':count 白天', - 'a_day' => ':count 白天', - - 'hour' => ':count 小时', - 'h' => ':count 小时', - 'a_hour' => ':count 小时', - - 'minute' => ':count 分钟', - 'min' => ':count 分钟', - 'a_minute' => ':count 分钟', - - 'second' => ':count 秒', - 's' => ':count 秒', - 'a_second' => ':count 秒', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/crh.php b/vendor/nesbot/carbon/src/Carbon/Lang/crh.php deleted file mode 100644 index a1d7ce63..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/crh.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/crh_UA.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/crh_UA.php b/vendor/nesbot/carbon/src/Carbon/Lang/crh_UA.php deleted file mode 100644 index 05139331..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/crh_UA.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Reşat SABIQ tilde.birlik@gmail.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD.MM.YYYY', - ], - 'months' => ['Yanvar', 'Fevral', 'Mart', 'Aprel', 'Mayıs', 'İyun', 'İyul', 'Avgust', 'Sentâbr', 'Oktâbr', 'Noyabr', 'Dekabr'], - 'months_short' => ['Yan', 'Fev', 'Mar', 'Apr', 'May', 'İyn', 'İyl', 'Avg', 'Sen', 'Okt', 'Noy', 'Dek'], - 'weekdays' => ['Bazar', 'Bazarertesi', 'Salı', 'Çarşembe', 'Cumaaqşamı', 'Cuma', 'Cumaertesi'], - 'weekdays_short' => ['Baz', 'Ber', 'Sal', 'Çar', 'Caq', 'Cum', 'Cer'], - 'weekdays_min' => ['Baz', 'Ber', 'Sal', 'Çar', 'Caq', 'Cum', 'Cer'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['ÜE', 'ÜS'], - - 'year' => ':count yıl', - 'y' => ':count yıl', - 'a_year' => ':count yıl', - - 'month' => ':count ay', - 'm' => ':count ay', - 'a_month' => ':count ay', - - 'week' => ':count afta', - 'w' => ':count afta', - 'a_week' => ':count afta', - - 'day' => ':count kün', - 'd' => ':count kün', - 'a_day' => ':count kün', - - 'hour' => ':count saat', - 'h' => ':count saat', - 'a_hour' => ':count saat', - - 'minute' => ':count daqqa', - 'min' => ':count daqqa', - 'a_minute' => ':count daqqa', - - 'second' => ':count ekinci', - 's' => ':count ekinci', - 'a_second' => ':count ekinci', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/cs.php b/vendor/nesbot/carbon/src/Carbon/Lang/cs.php deleted file mode 100644 index c01e3ccc..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/cs.php +++ /dev/null @@ -1,123 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Philippe Vaucher - * - Jakub Tesinsky - * - Martin Suja - * - Nikos Timiopulos - * - Bohuslav Blín - * - Tsutomu Kuroda - * - tjku - * - Lukas Svoboda - * - Max Melentiev - * - Juanito Fatas - * - Akira Matsuda - * - Christopher Dell - * - Václav Pávek - * - CodeSkills - * - Tlapi - * - newman101 - * - Petr Kadlec - * - tommaskraus - * - Karel Sommer (calvera) - */ -$za = function ($time) { - return 'za '.strtr($time, [ - 'hodina' => 'hodinu', - 'minuta' => 'minutu', - 'sekunda' => 'sekundu', - ]); -}; - -$pred = function ($time) { - $time = strtr($time, [ - 'hodina' => 'hodinou', - 'minuta' => 'minutou', - 'sekunda' => 'sekundou', - ]); - $time = preg_replace('/hodiny?(?!\w)/', 'hodinami', $time); - $time = preg_replace('/minuty?(?!\w)/', 'minutami', $time); - $time = preg_replace('/sekundy?(?!\w)/', 'sekundami', $time); - - return "před $time"; -}; - -return [ - 'year' => ':count rok|:count roky|:count let', - 'y' => ':count rok|:count roky|:count let', - 'a_year' => 'rok|:count roky|:count let', - 'month' => ':count měsíc|:count měsíce|:count měsíců', - 'm' => ':count měs.', - 'a_month' => 'měsíc|:count měsíce|:count měsíců', - 'week' => ':count týden|:count týdny|:count týdnů', - 'w' => ':count týd.', - 'a_week' => 'týden|:count týdny|:count týdnů', - 'day' => ':count den|:count dny|:count dní', - 'd' => ':count den|:count dny|:count dní', - 'a_day' => 'den|:count dny|:count dní', - 'hour' => ':count hodina|:count hodiny|:count hodin', - 'h' => ':count hod.', - 'a_hour' => 'hodina|:count hodiny|:count hodin', - 'minute' => ':count minuta|:count minuty|:count minut', - 'min' => ':count min.', - 'a_minute' => 'minuta|:count minuty|:count minut', - 'second' => ':count sekunda|:count sekundy|:count sekund', - 's' => ':count sek.', - 'a_second' => 'pár sekund|:count sekundy|:count sekund', - - 'month_ago' => ':count měsícem|:count měsíci|:count měsíci', - 'a_month_ago' => 'měsícem|:count měsíci|:count měsíci', - 'day_ago' => ':count dnem|:count dny|:count dny', - 'a_day_ago' => 'dnem|:count dny|:count dny', - 'week_ago' => ':count týdnem|:count týdny|:count týdny', - 'a_week_ago' => 'týdnem|:count týdny|:count týdny', - 'year_ago' => ':count rokem|:count roky|:count lety', - 'y_ago' => ':count rok.|:count rok.|:count let.', - 'a_year_ago' => 'rokem|:count roky|:count lety', - - 'month_before' => ':count měsícem|:count měsíci|:count měsíci', - 'a_month_before' => 'měsícem|:count měsíci|:count měsíci', - 'day_before' => ':count dnem|:count dny|:count dny', - 'a_day_before' => 'dnem|:count dny|:count dny', - 'week_before' => ':count týdnem|:count týdny|:count týdny', - 'a_week_before' => 'týdnem|:count týdny|:count týdny', - 'year_before' => ':count rokem|:count roky|:count lety', - 'y_before' => ':count rok.|:count rok.|:count let.', - 'a_year_before' => 'rokem|:count roky|:count lety', - - 'ago' => $pred, - 'from_now' => $za, - 'before' => $pred, - 'after' => $za, - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'months' => ['ledna', 'února', 'března', 'dubna', 'května', 'června', 'července', 'srpna', 'září', 'října', 'listopadu', 'prosince'], - 'months_standalone' => ['leden', 'únor', 'březen', 'duben', 'květen', 'červen', 'červenec', 'srpen', 'září', 'říjen', 'listopad', 'prosinec'], - 'months_short' => ['led', 'úno', 'bře', 'dub', 'kvě', 'čvn', 'čvc', 'srp', 'zář', 'říj', 'lis', 'pro'], - 'weekdays' => ['neděle', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota'], - 'weekdays_short' => ['ned', 'pon', 'úte', 'stř', 'čtv', 'pát', 'sob'], - 'weekdays_min' => ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'], - 'list' => [', ', ' a '], - 'diff_now' => 'nyní', - 'diff_yesterday' => 'včera', - 'diff_tomorrow' => 'zítra', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD. MM. YYYY', - 'LL' => 'D. MMMM YYYY', - 'LLL' => 'D. MMMM YYYY HH:mm', - 'LLLL' => 'dddd D. MMMM YYYY HH:mm', - ], - 'meridiem' => ['dopoledne', 'odpoledne'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/cs_CZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/cs_CZ.php deleted file mode 100644 index ea2517e8..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/cs_CZ.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/cs.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/csb.php b/vendor/nesbot/carbon/src/Carbon/Lang/csb.php deleted file mode 100644 index a35d2815..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/csb.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/csb_PL.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/csb_PL.php b/vendor/nesbot/carbon/src/Carbon/Lang/csb_PL.php deleted file mode 100644 index 25e0ca89..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/csb_PL.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - csb_PL locale Michal Ostrowski bug-glibc-locales@gnu.org - */ -return [ - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'YYYY-MM-DD', - 'LL' => 'MMMM DD, YYYY', - 'LLL' => 'DD MMM HH:mm', - 'LLLL' => 'MMMM DD, YYYY HH:mm', - ], - 'months' => ['stëcznika', 'gromicznika', 'strëmiannika', 'łżëkwiata', 'maja', 'czerwińca', 'lëpińca', 'zélnika', 'séwnika', 'rujana', 'lëstopadnika', 'gòdnika'], - 'months_short' => ['stë', 'gro', 'str', 'łżë', 'maj', 'cze', 'lëp', 'zél', 'séw', 'ruj', 'lës', 'gòd'], - 'weekdays' => ['niedzela', 'pòniedzôłk', 'wtórk', 'strzoda', 'czwiôrtk', 'piątk', 'sobòta'], - 'weekdays_short' => ['nie', 'pòn', 'wtó', 'str', 'czw', 'pią', 'sob'], - 'weekdays_min' => ['nie', 'pòn', 'wtó', 'str', 'czw', 'pią', 'sob'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' a téż '], - 'two_words_connector' => ' a téż ', - 'year' => ':count rok', - 'month' => ':count miesiąc', - 'week' => ':count tidzéń', - 'day' => ':count dzéń', - 'hour' => ':count gòdzëna', - 'minute' => ':count minuta', - 'second' => ':count sekunda', -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/cu.php b/vendor/nesbot/carbon/src/Carbon/Lang/cu.php deleted file mode 100644 index d6d13128..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/cu.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'months' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'], - 'months_short' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'YYYY-MM-DD', - 'LL' => 'YYYY MMM D', - 'LLL' => 'YYYY MMMM D HH:mm', - 'LLLL' => 'YYYY MMMM D, dddd HH:mm', - ], - - 'year' => ':count лѣто', - 'y' => ':count лѣто', - 'a_year' => ':count лѣто', - - 'month' => ':count мѣсѧць', - 'm' => ':count мѣсѧць', - 'a_month' => ':count мѣсѧць', - - 'week' => ':count сєдмица', - 'w' => ':count сєдмица', - 'a_week' => ':count сєдмица', - - 'day' => ':count дьнь', - 'd' => ':count дьнь', - 'a_day' => ':count дьнь', - - 'hour' => ':count година', - 'h' => ':count година', - 'a_hour' => ':count година', - - 'minute' => ':count малъ', // less reliable - 'min' => ':count малъ', // less reliable - 'a_minute' => ':count малъ', // less reliable - - 'second' => ':count въторъ', - 's' => ':count въторъ', - 'a_second' => ':count въторъ', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/cv.php b/vendor/nesbot/carbon/src/Carbon/Lang/cv.php deleted file mode 100644 index 8aeb73aa..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/cv.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Josh Soref - * - François B - * - JD Isaacks - */ -return [ - 'year' => ':count ҫул', - 'a_year' => '{1}пӗр ҫул|:count ҫул', - 'month' => ':count уйӑх', - 'a_month' => '{1}пӗр уйӑх|:count уйӑх', - 'week' => ':count эрне', - 'a_week' => '{1}пӗр эрне|:count эрне', - 'day' => ':count кун', - 'a_day' => '{1}пӗр кун|:count кун', - 'hour' => ':count сехет', - 'a_hour' => '{1}пӗр сехет|:count сехет', - 'minute' => ':count минут', - 'a_minute' => '{1}пӗр минут|:count минут', - 'second' => ':count ҫеккунт', - 'a_second' => '{1}пӗр-ик ҫеккунт|:count ҫеккунт', - 'ago' => ':time каялла', - 'from_now' => function ($time) { - return $time.(preg_match('/сехет$/u', $time) ? 'рен' : (preg_match('/ҫул/u', $time) ? 'тан' : 'ран')); - }, - 'diff_yesterday' => 'Ӗнер', - 'diff_today' => 'Паян', - 'diff_tomorrow' => 'Ыран', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD-MM-YYYY', - 'LL' => 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]', - 'LLL' => 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm', - 'LLLL' => 'dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[Паян] LT [сехетре]', - 'nextDay' => '[Ыран] LT [сехетре]', - 'nextWeek' => '[Ҫитес] dddd LT [сехетре]', - 'lastDay' => '[Ӗнер] LT [сехетре]', - 'lastWeek' => '[Иртнӗ] dddd LT [сехетре]', - 'sameElse' => 'L', - ], - 'ordinal' => ':number-мӗш', - 'months' => ['кӑрлач', 'нарӑс', 'пуш', 'ака', 'май', 'ҫӗртме', 'утӑ', 'ҫурла', 'авӑн', 'юпа', 'чӳк', 'раштав'], - 'months_short' => ['кӑр', 'нар', 'пуш', 'ака', 'май', 'ҫӗр', 'утӑ', 'ҫур', 'авн', 'юпа', 'чӳк', 'раш'], - 'weekdays' => ['вырсарникун', 'тунтикун', 'ытларикун', 'юнкун', 'кӗҫнерникун', 'эрнекун', 'шӑматкун'], - 'weekdays_short' => ['выр', 'тун', 'ытл', 'юн', 'кӗҫ', 'эрн', 'шӑм'], - 'weekdays_min' => ['вр', 'тн', 'ыт', 'юн', 'кҫ', 'эр', 'шм'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'list' => [', ', ' тата '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/cv_RU.php b/vendor/nesbot/carbon/src/Carbon/Lang/cv_RU.php deleted file mode 100644 index 197bd8d3..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/cv_RU.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/cv.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/cy.php b/vendor/nesbot/carbon/src/Carbon/Lang/cy.php deleted file mode 100644 index 119274f0..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/cy.php +++ /dev/null @@ -1,79 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - François B - * - JD Isaacks - * - Daniel Monaghan - */ -return [ - 'year' => '{1}blwyddyn|]1,Inf[:count flynedd', - 'y' => ':countbl', - 'month' => '{1}mis|]1,Inf[:count mis', - 'm' => ':countmi', - 'week' => ':count wythnos', - 'w' => ':countw', - 'day' => '{1}diwrnod|]1,Inf[:count diwrnod', - 'd' => ':countd', - 'hour' => '{1}awr|]1,Inf[:count awr', - 'h' => ':counth', - 'minute' => '{1}munud|]1,Inf[:count munud', - 'min' => ':countm', - 'second' => '{1}ychydig eiliadau|]1,Inf[:count eiliad', - 's' => ':counts', - 'ago' => ':time yn ôl', - 'from_now' => 'mewn :time', - 'after' => ':time ar ôl', - 'before' => ':time o\'r blaen', - 'diff_now' => 'nawr', - 'diff_today' => 'Heddiw', - 'diff_today_regexp' => 'Heddiw(?:\\s+am)?', - 'diff_yesterday' => 'ddoe', - 'diff_yesterday_regexp' => 'Ddoe(?:\\s+am)?', - 'diff_tomorrow' => 'yfory', - 'diff_tomorrow_regexp' => 'Yfory(?:\\s+am)?', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[Heddiw am] LT', - 'nextDay' => '[Yfory am] LT', - 'nextWeek' => 'dddd [am] LT', - 'lastDay' => '[Ddoe am] LT', - 'lastWeek' => 'dddd [diwethaf am] LT', - 'sameElse' => 'L', - ], - 'ordinal' => function ($number) { - return $number.( - $number > 20 - ? (\in_array((int) $number, [40, 50, 60, 80, 100], true) ? 'fed' : 'ain') - : ([ - '', 'af', 'il', 'ydd', 'ydd', 'ed', 'ed', 'ed', 'fed', 'fed', 'fed', // 1af to 10fed - 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'fed', // 11eg to 20fed - ])[$number] ?? '' - ); - }, - 'months' => ['Ionawr', 'Chwefror', 'Mawrth', 'Ebrill', 'Mai', 'Mehefin', 'Gorffennaf', 'Awst', 'Medi', 'Hydref', 'Tachwedd', 'Rhagfyr'], - 'months_short' => ['Ion', 'Chwe', 'Maw', 'Ebr', 'Mai', 'Meh', 'Gor', 'Aws', 'Med', 'Hyd', 'Tach', 'Rhag'], - 'weekdays' => ['Dydd Sul', 'Dydd Llun', 'Dydd Mawrth', 'Dydd Mercher', 'Dydd Iau', 'Dydd Gwener', 'Dydd Sadwrn'], - 'weekdays_short' => ['Sul', 'Llun', 'Maw', 'Mer', 'Iau', 'Gwe', 'Sad'], - 'weekdays_min' => ['Su', 'Ll', 'Ma', 'Me', 'Ia', 'Gw', 'Sa'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' a '], - 'meridiem' => ['yb', 'yh'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/cy_GB.php b/vendor/nesbot/carbon/src/Carbon/Lang/cy_GB.php deleted file mode 100644 index 2c8148d0..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/cy_GB.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/cy.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/da.php b/vendor/nesbot/carbon/src/Carbon/Lang/da.php deleted file mode 100644 index 322f91d5..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/da.php +++ /dev/null @@ -1,81 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Rune Mønnike - * - François B - * - codenhagen - * - JD Isaacks - * - Jens Herlevsen - * - Ulrik McArdle (mcardle) - * - Frederik Sauer (FrittenKeeZ) - * - Janus Bahs Jacquet (kokoshneta) - */ -return [ - 'year' => ':count år|:count år', - 'a_year' => 'et år|:count år', - 'y' => ':count år|:count år', - 'month' => ':count måned|:count måneder', - 'a_month' => 'en måned|:count måneder', - 'm' => ':count mdr.', - 'week' => ':count uge|:count uger', - 'a_week' => 'en uge|:count uger', - 'w' => ':count u.', - 'day' => ':count dag|:count dage', - 'a_day' => ':count dag|:count dage', - 'd' => ':count d.', - 'hour' => ':count time|:count timer', - 'a_hour' => 'en time|:count timer', - 'h' => ':count t.', - 'minute' => ':count minut|:count minutter', - 'a_minute' => 'et minut|:count minutter', - 'min' => ':count min.', - 'second' => ':count sekund|:count sekunder', - 'a_second' => 'få sekunder|:count sekunder', - 's' => ':count s.', - 'ago' => 'for :time siden', - 'from_now' => 'om :time', - 'after' => ':time efter', - 'before' => ':time før', - 'diff_now' => 'nu', - 'diff_today' => 'i dag', - 'diff_today_regexp' => 'i dag(?:\\s+kl.)?', - 'diff_yesterday' => 'i går', - 'diff_yesterday_regexp' => 'i går(?:\\s+kl.)?', - 'diff_tomorrow' => 'i morgen', - 'diff_tomorrow_regexp' => 'i morgen(?:\\s+kl.)?', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD.MM.YYYY', - 'LL' => 'D. MMMM YYYY', - 'LLL' => 'D. MMMM YYYY HH:mm', - 'LLLL' => 'dddd [d.] D. MMMM YYYY [kl.] HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[i dag kl.] LT', - 'nextDay' => '[i morgen kl.] LT', - 'nextWeek' => 'på dddd [kl.] LT', - 'lastDay' => '[i går kl.] LT', - 'lastWeek' => '[i] dddd[s kl.] LT', - 'sameElse' => 'L', - ], - 'ordinal' => ':number.', - 'months' => ['januar', 'februar', 'marts', 'april', 'maj', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'december'], - 'months_short' => ['jan.', 'feb.', 'mar.', 'apr.', 'maj.', 'jun.', 'jul.', 'aug.', 'sep.', 'okt.', 'nov.', 'dec.'], - 'weekdays' => ['søndag', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag'], - 'weekdays_short' => ['søn.', 'man.', 'tir.', 'ons.', 'tor.', 'fre.', 'lør.'], - 'weekdays_min' => ['sø', 'ma', 'ti', 'on', 'to', 'fr', 'lø'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' og '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/da_DK.php b/vendor/nesbot/carbon/src/Carbon/Lang/da_DK.php deleted file mode 100644 index 392c4841..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/da_DK.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/da.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/da_GL.php b/vendor/nesbot/carbon/src/Carbon/Lang/da_GL.php deleted file mode 100644 index ea5698b9..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/da_GL.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/da.php', [ - 'formats' => [ - 'L' => 'DD/MM/YYYY', - 'LL' => 'D. MMM YYYY', - 'LLL' => 'D. MMMM YYYY HH.mm', - 'LLLL' => 'dddd [den] D. MMMM YYYY HH.mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/dav.php b/vendor/nesbot/carbon/src/Carbon/Lang/dav.php deleted file mode 100644 index e95ec4bb..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/dav.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['Luma lwa K', 'luma lwa p'], - 'weekdays' => ['Ituku ja jumwa', 'Kuramuka jimweri', 'Kuramuka kawi', 'Kuramuka kadadu', 'Kuramuka kana', 'Kuramuka kasanu', 'Kifula nguwo'], - 'weekdays_short' => ['Jum', 'Jim', 'Kaw', 'Kad', 'Kan', 'Kas', 'Ngu'], - 'weekdays_min' => ['Jum', 'Jim', 'Kaw', 'Kad', 'Kan', 'Kas', 'Ngu'], - 'months' => ['Mori ghwa imbiri', 'Mori ghwa kawi', 'Mori ghwa kadadu', 'Mori ghwa kana', 'Mori ghwa kasanu', 'Mori ghwa karandadu', 'Mori ghwa mfungade', 'Mori ghwa wunyanya', 'Mori ghwa ikenda', 'Mori ghwa ikumi', 'Mori ghwa ikumi na imweri', 'Mori ghwa ikumi na iwi'], - 'months_short' => ['Imb', 'Kaw', 'Kad', 'Kan', 'Kas', 'Kar', 'Mfu', 'Wun', 'Ike', 'Iku', 'Imw', 'Iwi'], - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/de.php b/vendor/nesbot/carbon/src/Carbon/Lang/de.php deleted file mode 100644 index 3b70750e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/de.php +++ /dev/null @@ -1,117 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Michael Hohl - * - sheriffmarley - * - dennisoderwald - * - Timo - * - Karag2006 - * - Pete Scopes (pdscopes) - */ -return [ - 'year' => ':count Jahr|:count Jahre', - 'a_year' => 'ein Jahr|:count Jahre', - 'y' => ':count J.', - 'month' => ':count Monat|:count Monate', - 'a_month' => 'ein Monat|:count Monate', - 'm' => ':count Mon.', - 'week' => ':count Woche|:count Wochen', - 'a_week' => 'eine Woche|:count Wochen', - 'w' => ':count Wo.', - 'day' => ':count Tag|:count Tage', - 'a_day' => 'ein Tag|:count Tage', - 'd' => ':count Tg.', - 'hour' => ':count Stunde|:count Stunden', - 'a_hour' => 'eine Stunde|:count Stunden', - 'h' => ':count Std.', - 'minute' => ':count Minute|:count Minuten', - 'a_minute' => 'eine Minute|:count Minuten', - 'min' => ':count Min.', - 'second' => ':count Sekunde|:count Sekunden', - 'a_second' => 'ein paar Sekunden|:count Sekunden', - 's' => ':count Sek.', - 'millisecond' => ':count Millisekunde|:count Millisekunden', - 'a_millisecond' => 'eine Millisekunde|:count Millisekunden', - 'ms' => ':countms', - 'microsecond' => ':count Mikrosekunde|:count Mikrosekunden', - 'a_microsecond' => 'eine Mikrosekunde|:count Mikrosekunden', - 'µs' => ':countµs', - 'ago' => 'vor :time', - 'from_now' => 'in :time', - 'after' => ':time später', - 'before' => ':time zuvor', - - 'year_from_now' => ':count Jahr|:count Jahren', - 'month_from_now' => ':count Monat|:count Monaten', - 'week_from_now' => ':count Woche|:count Wochen', - 'day_from_now' => ':count Tag|:count Tagen', - 'year_ago' => ':count Jahr|:count Jahren', - 'month_ago' => ':count Monat|:count Monaten', - 'week_ago' => ':count Woche|:count Wochen', - 'day_ago' => ':count Tag|:count Tagen', - 'a_year_from_now' => 'ein Jahr|:count Jahren', - 'a_month_from_now' => 'ein Monat|:count Monaten', - 'a_week_from_now' => 'eine Woche|:count Wochen', - 'a_day_from_now' => 'ein Tag|:count Tagen', - 'a_year_ago' => 'ein Jahr|:count Jahren', - 'a_month_ago' => 'ein Monat|:count Monaten', - 'a_week_ago' => 'eine Woche|:count Wochen', - 'a_day_ago' => 'ein Tag|:count Tagen', - - 'diff_now' => 'Gerade eben', - 'diff_today' => 'heute', - 'diff_today_regexp' => 'heute(?:\\s+um)?', - 'diff_yesterday' => 'Gestern', - 'diff_yesterday_regexp' => 'gestern(?:\\s+um)?', - 'diff_tomorrow' => 'Morgen', - 'diff_tomorrow_regexp' => 'morgen(?:\\s+um)?', - 'diff_before_yesterday' => 'Vorgestern', - 'diff_after_tomorrow' => 'Übermorgen', - - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD.MM.YYYY', - 'LL' => 'D. MMMM YYYY', - 'LLL' => 'D. MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D. MMMM YYYY HH:mm', - ], - - 'calendar' => [ - 'sameDay' => '[heute um] LT [Uhr]', - 'nextDay' => '[morgen um] LT [Uhr]', - 'nextWeek' => 'dddd [um] LT [Uhr]', - 'lastDay' => '[gestern um] LT [Uhr]', - 'lastWeek' => '[letzten] dddd [um] LT [Uhr]', - 'sameElse' => 'L', - ], - - 'months' => ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'], - 'months_short' => ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'], - 'weekdays' => ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'], - 'weekdays_short' => ['So.', 'Mo.', 'Di.', 'Mi.', 'Do.', 'Fr.', 'Sa.'], - 'weekdays_min' => ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'], - 'ordinal' => ':number.', - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' und '], - 'ordinal_words' => [ - 'of' => 'im', - 'first' => 'erster', - 'second' => 'zweiter', - 'third' => 'dritter', - 'fourth' => 'vierten', - 'fifth' => 'fünfter', - 'last' => 'letzten', - ], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/de_AT.php b/vendor/nesbot/carbon/src/Carbon/Lang/de_AT.php deleted file mode 100644 index a2ea4c08..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/de_AT.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - sheriffmarley - * - Timo - * - Michael Hohl - * - Namoshek - * - Bernhard Baumrock (BernhardBaumrock) - */ -return array_replace_recursive(require __DIR__.'/de.php', [ - 'months' => [ - 0 => 'Jänner', - ], - 'months_short' => [ - 0 => 'Jän', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/de_BE.php b/vendor/nesbot/carbon/src/Carbon/Lang/de_BE.php deleted file mode 100644 index 8ed8dc62..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/de_BE.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - RAP bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/de.php', [ - 'formats' => [ - 'L' => 'YYYY-MM-DD', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/de_CH.php b/vendor/nesbot/carbon/src/Carbon/Lang/de_CH.php deleted file mode 100644 index a869ab48..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/de_CH.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - sheriffmarley - * - Timo - * - Michael Hohl - */ -return array_replace_recursive(require __DIR__.'/de.php', [ - 'weekdays_short' => ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/de_DE.php b/vendor/nesbot/carbon/src/Carbon/Lang/de_DE.php deleted file mode 100644 index fb1209d2..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/de_DE.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Free Software Foundation, Inc. bug-glibc-locales@gnu.org - */ -return require __DIR__.'/de.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/de_IT.php b/vendor/nesbot/carbon/src/Carbon/Lang/de_IT.php deleted file mode 100644 index 604a8568..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/de_IT.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Matthias Dieter Wallno:fer libc-locales@sourceware.org - */ -return require __DIR__.'/de.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/de_LI.php b/vendor/nesbot/carbon/src/Carbon/Lang/de_LI.php deleted file mode 100644 index 03e606a6..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/de_LI.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/de.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/de_LU.php b/vendor/nesbot/carbon/src/Carbon/Lang/de_LU.php deleted file mode 100644 index 8ed8dc62..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/de_LU.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - RAP bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/de.php', [ - 'formats' => [ - 'L' => 'YYYY-MM-DD', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/dje.php b/vendor/nesbot/carbon/src/Carbon/Lang/dje.php deleted file mode 100644 index 74b7ac12..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/dje.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['Subbaahi', 'Zaarikay b'], - 'weekdays' => ['Alhadi', 'Atinni', 'Atalaata', 'Alarba', 'Alhamisi', 'Alzuma', 'Asibti'], - 'weekdays_short' => ['Alh', 'Ati', 'Ata', 'Ala', 'Alm', 'Alz', 'Asi'], - 'weekdays_min' => ['Alh', 'Ati', 'Ata', 'Ala', 'Alm', 'Alz', 'Asi'], - 'months' => ['Žanwiye', 'Feewiriye', 'Marsi', 'Awiril', 'Me', 'Žuweŋ', 'Žuyye', 'Ut', 'Sektanbur', 'Oktoobur', 'Noowanbur', 'Deesanbur'], - 'months_short' => ['Žan', 'Fee', 'Mar', 'Awi', 'Me', 'Žuw', 'Žuy', 'Ut', 'Sek', 'Okt', 'Noo', 'Dee'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'D/M/YYYY', - 'LL' => 'D MMM, YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], - - 'year' => ':count hari', // less reliable - 'y' => ':count hari', // less reliable - 'a_year' => ':count hari', // less reliable - - 'week' => ':count alzuma', // less reliable - 'w' => ':count alzuma', // less reliable - 'a_week' => ':count alzuma', // less reliable - - 'second' => ':count atinni', // less reliable - 's' => ':count atinni', // less reliable - 'a_second' => ':count atinni', // less reliable -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/doi.php b/vendor/nesbot/carbon/src/Carbon/Lang/doi.php deleted file mode 100644 index cb679c58..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/doi.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/doi_IN.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/doi_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/doi_IN.php deleted file mode 100644 index d3597214..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/doi_IN.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Red Hat Pune libc-alpha@sourceware.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'D/M/YY', - ], - 'months' => ['जनवरी', 'फरवरी', 'मार्च', 'एप्रैल', 'मेई', 'जून', 'जूलै', 'अगस्त', 'सितंबर', 'अक्तूबर', 'नवंबर', 'दिसंबर'], - 'months_short' => ['जनवरी', 'फरवरी', 'मार्च', 'एप्रैल', 'मेई', 'जून', 'जूलै', 'अगस्त', 'सितंबर', 'अक्तूबर', 'नवंबर', 'दिसंबर'], - 'weekdays' => ['ऐतबार', 'सोमबार', 'मंगलबर', 'बुधबार', 'बीरबार', 'शुक्करबार', 'श्नीचरबार'], - 'weekdays_short' => ['ऐत', 'सोम', 'मंगल', 'बुध', 'बीर', 'शुक्कर', 'श्नीचर'], - 'weekdays_min' => ['ऐत', 'सोम', 'मंगल', 'बुध', 'बीर', 'शुक्कर', 'श्नीचर'], - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['सञं', 'सबेर'], - - 'second' => ':count सङार', // less reliable - 's' => ':count सङार', // less reliable - 'a_second' => ':count सङार', // less reliable -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/dsb.php b/vendor/nesbot/carbon/src/Carbon/Lang/dsb.php deleted file mode 100644 index 1d214d56..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/dsb.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/dsb_DE.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/dsb_DE.php b/vendor/nesbot/carbon/src/Carbon/Lang/dsb_DE.php deleted file mode 100644 index 1b941870..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/dsb_DE.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Information from Michael Wolf bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD.MM.YYYY', - 'LL' => 'DD. MMMM YYYY', - 'LLL' => 'DD. MMMM, HH:mm [góź.]', - 'LLLL' => 'dddd, DD. MMMM YYYY, HH:mm [góź.]', - ], - 'months' => ['januara', 'februara', 'měrca', 'apryla', 'maja', 'junija', 'julija', 'awgusta', 'septembra', 'oktobra', 'nowembra', 'decembra'], - 'months_short' => ['Jan', 'Feb', 'Měr', 'Apr', 'Maj', 'Jun', 'Jul', 'Awg', 'Sep', 'Okt', 'Now', 'Dec'], - 'weekdays' => ['Njeźela', 'Pónjeźele', 'Wałtora', 'Srjoda', 'Stwórtk', 'Pětk', 'Sobota'], - 'weekdays_short' => ['Nj', 'Pó', 'Wa', 'Sr', 'St', 'Pě', 'So'], - 'weekdays_min' => ['Nj', 'Pó', 'Wa', 'Sr', 'St', 'Pě', 'So'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - - 'year' => ':count lěto', - 'y' => ':count lěto', - 'a_year' => ':count lěto', - - 'month' => ':count mjasec', - 'm' => ':count mjasec', - 'a_month' => ':count mjasec', - - 'week' => ':count tyźeń', - 'w' => ':count tyźeń', - 'a_week' => ':count tyźeń', - - 'day' => ':count źeń', - 'd' => ':count źeń', - 'a_day' => ':count źeń', - - 'hour' => ':count góźina', - 'h' => ':count góźina', - 'a_hour' => ':count góźina', - - 'minute' => ':count minuta', - 'min' => ':count minuta', - 'a_minute' => ':count minuta', - - 'second' => ':count drugi', - 's' => ':count drugi', - 'a_second' => ':count drugi', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/dua.php b/vendor/nesbot/carbon/src/Carbon/Lang/dua.php deleted file mode 100644 index 55e5c7c3..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/dua.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['idiɓa', 'ebyámu'], - 'weekdays' => ['éti', 'mɔ́sú', 'kwasú', 'mukɔ́sú', 'ŋgisú', 'ɗónɛsú', 'esaɓasú'], - 'weekdays_short' => ['ét', 'mɔ́s', 'kwa', 'muk', 'ŋgi', 'ɗón', 'esa'], - 'weekdays_min' => ['ét', 'mɔ́s', 'kwa', 'muk', 'ŋgi', 'ɗón', 'esa'], - 'months' => ['dimɔ́di', 'ŋgɔndɛ', 'sɔŋɛ', 'diɓáɓá', 'emiasele', 'esɔpɛsɔpɛ', 'madiɓɛ́díɓɛ́', 'diŋgindi', 'nyɛtɛki', 'mayésɛ́', 'tiníní', 'eláŋgɛ́'], - 'months_short' => ['di', 'ŋgɔn', 'sɔŋ', 'diɓ', 'emi', 'esɔ', 'mad', 'diŋ', 'nyɛt', 'may', 'tin', 'elá'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'D/M/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], - - 'year' => ':count ma mbu', // less reliable - 'y' => ':count ma mbu', // less reliable - 'a_year' => ':count ma mbu', // less reliable - - 'month' => ':count myo̱di', // less reliable - 'm' => ':count myo̱di', // less reliable - 'a_month' => ':count myo̱di', // less reliable - - 'week' => ':count woki', // less reliable - 'w' => ':count woki', // less reliable - 'a_week' => ':count woki', // less reliable - - 'day' => ':count buńa', // less reliable - 'd' => ':count buńa', // less reliable - 'a_day' => ':count buńa', // less reliable - - 'hour' => ':count ma awa', // less reliable - 'h' => ':count ma awa', // less reliable - 'a_hour' => ':count ma awa', // less reliable - - 'minute' => ':count minuti', // less reliable - 'min' => ':count minuti', // less reliable - 'a_minute' => ':count minuti', // less reliable - - 'second' => ':count maba', // less reliable - 's' => ':count maba', // less reliable - 'a_second' => ':count maba', // less reliable -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/dv.php b/vendor/nesbot/carbon/src/Carbon/Lang/dv.php deleted file mode 100644 index 4b8d7e1a..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/dv.php +++ /dev/null @@ -1,89 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -$months = [ - 'ޖެނުއަރީ', - 'ފެބްރުއަރީ', - 'މާރިޗު', - 'އޭޕްރީލު', - 'މޭ', - 'ޖޫން', - 'ޖުލައި', - 'އޯގަސްޓު', - 'ސެޕްޓެމްބަރު', - 'އޮކްޓޯބަރު', - 'ނޮވެމްބަރު', - 'ޑިސެމްބަރު', -]; - -$weekdays = [ - 'އާދިއްތަ', - 'ހޯމަ', - 'އަންގާރަ', - 'ބުދަ', - 'ބުރާސްފަތި', - 'ހުކުރު', - 'ހޮނިހިރު', -]; - -/* - * Authors: - * - Josh Soref - * - Jawish Hameed - */ -return [ - 'year' => ':count '.'އަހަރު', - 'a_year' => '{1}'.'އަހަރެއް'.'|:count '.'އަހަރު', - 'month' => ':count '.'މަސް', - 'a_month' => '{1}'.'މަހެއް'.'|:count '.'މަސް', - 'week' => ':count '.'ހަފްތާ', - 'a_week' => '{1}'.'ސިކުންތުކޮޅެއް'.'|:count '.'ހަފްތާ', - 'day' => ':count '.'ދުވަސް', - 'a_day' => '{1}'.'ދުވަހެއް'.'|:count '.'ދުވަސް', - 'hour' => ':count '.'ގަޑިއިރު', - 'a_hour' => '{1}'.'ގަޑިއިރެއް'.'|:count '.'ގަޑިއިރު', - 'minute' => ':count '.'މިނިޓު', - 'a_minute' => '{1}'.'މިނިޓެއް'.'|:count '.'މިނިޓު', - 'second' => ':count '.'ސިކުންތު', - 'a_second' => '{1}'.'ސިކުންތުކޮޅެއް'.'|:count '.'ސިކުންތު', - 'ago' => 'ކުރިން :time', - 'from_now' => 'ތެރޭގައި :time', - 'after' => ':time ފަހުން', - 'before' => ':time ކުރި', - 'diff_yesterday' => 'އިއްޔެ', - 'diff_today' => 'މިއަދު', - 'diff_tomorrow' => 'މާދަމާ', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'D/M/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[މިއަދު] LT', - 'nextDay' => '[މާދަމާ] LT', - 'nextWeek' => 'dddd LT', - 'lastDay' => '[އިއްޔެ] LT', - 'lastWeek' => '[ފާއިތުވި] dddd LT', - 'sameElse' => 'L', - ], - 'meridiem' => ['މކ', 'މފ'], - 'months' => $months, - 'months_short' => $months, - 'weekdays' => $weekdays, - 'weekdays_short' => $weekdays, - 'weekdays_min' => ['އާދި', 'ހޯމަ', 'އަން', 'ބުދަ', 'ބުރާ', 'ހުކު', 'ހޮނި'], - 'list' => [', ', ' އަދި '], - 'first_day_of_week' => 0, - 'day_of_first_week_of_year' => 1, -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/dv_MV.php b/vendor/nesbot/carbon/src/Carbon/Lang/dv_MV.php deleted file mode 100644 index 2668d5b0..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/dv_MV.php +++ /dev/null @@ -1,87 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Ahmed Ali - */ - -$months = [ - 'ޖެނުއަރީ', - 'ފެބްރުއަރީ', - 'މާރިޗު', - 'އޭޕްރީލު', - 'މޭ', - 'ޖޫން', - 'ޖުލައި', - 'އޯގަސްޓު', - 'ސެޕްޓެމްބަރު', - 'އޮކްޓޯބަރު', - 'ނޮވެމްބަރު', - 'ޑިސެމްބަރު', -]; - -$weekdays = [ - 'އާދިއްތަ', - 'ހޯމަ', - 'އަންގާރަ', - 'ބުދަ', - 'ބުރާސްފަތި', - 'ހުކުރު', - 'ހޮނިހިރު', -]; - -return [ - 'year' => '{0}އަހަރެއް|[1,Inf]:count އަހަރު', - 'y' => '{0}އަހަރެއް|[1,Inf]:count އަހަރު', - 'month' => '{0}މައްސަރެއް|[1,Inf]:count މަސް', - 'm' => '{0}މައްސަރެއް|[1,Inf]:count މަސް', - 'week' => '{0}ހަފްތާއެއް|[1,Inf]:count ހަފްތާ', - 'w' => '{0}ހަފްތާއެއް|[1,Inf]:count ހަފްތާ', - 'day' => '{0}ދުވަސް|[1,Inf]:count ދުވަސް', - 'd' => '{0}ދުވަސް|[1,Inf]:count ދުވަސް', - 'hour' => '{0}ގަޑިއިރެއް|[1,Inf]:count ގަޑި', - 'h' => '{0}ގަޑިއިރެއް|[1,Inf]:count ގަޑި', - 'minute' => '{0}މިނެޓެއް|[1,Inf]:count މިނެޓް', - 'min' => '{0}މިނެޓެއް|[1,Inf]:count މިނެޓް', - 'second' => '{0}ސިކުންތެއް|[1,Inf]:count ސިކުންތު', - 's' => '{0}ސިކުންތެއް|[1,Inf]:count ސިކުންތު', - 'ago' => ':time ކުރިން', - 'from_now' => ':time ފަހުން', - 'after' => ':time ފަހުން', - 'before' => ':time ކުރި', - 'diff_yesterday' => 'އިއްޔެ', - 'diff_today' => 'މިއަދު', - 'diff_tomorrow' => 'މާދަމާ', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'D/M/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[މިއަދު] LT', - 'nextDay' => '[މާދަމާ] LT', - 'nextWeek' => 'dddd LT', - 'lastDay' => '[އިއްޔެ] LT', - 'lastWeek' => '[ފާއިތުވި] dddd LT', - 'sameElse' => 'L', - ], - 'meridiem' => ['މކ', 'މފ'], - 'months' => $months, - 'months_short' => $months, - 'weekdays' => $weekdays, - 'weekdays_short' => $weekdays, - 'weekdays_min' => ['އާދި', 'ހޯމަ', 'އަން', 'ބުދަ', 'ބުރާ', 'ހުކު', 'ހޮނި'], - 'list' => [', ', ' އަދި '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/dyo.php b/vendor/nesbot/carbon/src/Carbon/Lang/dyo.php deleted file mode 100644 index 33082e67..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/dyo.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'weekdays' => ['Dimas', 'Teneŋ', 'Talata', 'Alarbay', 'Aramisay', 'Arjuma', 'Sibiti'], - 'weekdays_short' => ['Dim', 'Ten', 'Tal', 'Ala', 'Ara', 'Arj', 'Sib'], - 'weekdays_min' => ['Dim', 'Ten', 'Tal', 'Ala', 'Ara', 'Arj', 'Sib'], - 'months' => ['Sanvie', 'Fébirie', 'Mars', 'Aburil', 'Mee', 'Sueŋ', 'Súuyee', 'Ut', 'Settembar', 'Oktobar', 'Novembar', 'Disambar'], - 'months_short' => ['Sa', 'Fe', 'Ma', 'Ab', 'Me', 'Su', 'Sú', 'Ut', 'Se', 'Ok', 'No', 'De'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'D/M/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/dz.php b/vendor/nesbot/carbon/src/Carbon/Lang/dz.php deleted file mode 100644 index cc17e69e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/dz.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/dz_BT.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/dz_BT.php b/vendor/nesbot/carbon/src/Carbon/Lang/dz_BT.php deleted file mode 100644 index bfbcaf46..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/dz_BT.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Sherubtse College bug-glibc@gnu.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'པསྱི་ལོYYཟལMMཚེསDD', - ], - 'months' => ['ཟླ་བ་དང་པ་', 'ཟླ་བ་གཉིས་པ་', 'ཟླ་བ་གསུམ་པ་', 'ཟླ་བ་བཞི་པ་', 'ཟླ་བ་ལྔ་ཕ་', 'ཟླ་བ་དྲུག་པ་', 'ཟླ་བ་བདུནཔ་', 'ཟླ་བ་བརྒྱད་པ་', 'ཟླ་བ་དགུ་པ་', 'ཟླ་བ་བཅུ་པ་', 'ཟླ་བ་བཅུ་གཅིག་པ་', 'ཟླ་བ་བཅུ་གཉིས་པ་'], - 'months_short' => ['ཟླ་༡', 'ཟླ་༢', 'ཟླ་༣', 'ཟླ་༤', 'ཟླ་༥', 'ཟླ་༦', 'ཟླ་༧', 'ཟླ་༨', 'ཟླ་༩', 'ཟླ་༡༠', 'ཟླ་༡༡', 'ཟླ་༡༢'], - 'weekdays' => ['གཟའ་ཟླ་བ་', 'གཟའ་མིག་དམར་', 'གཟའ་ལྷག་ཕ་', 'གཟའ་པུར་བུ་', 'གཟའ་པ་སངས་', 'གཟའ་སྤེན་ཕ་', 'གཟའ་ཉི་མ་'], - 'weekdays_short' => ['ཟླ་', 'མིར་', 'ལྷག་', 'པུར་', 'སངས་', 'སྤེན་', 'ཉི་'], - 'weekdays_min' => ['ཟླ་', 'མིར་', 'ལྷག་', 'པུར་', 'སངས་', 'སྤེན་', 'ཉི་'], - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['ངས་ཆ', 'ཕྱི་ཆ'], - - 'year' => ':count ཆརཔ', // less reliable - 'y' => ':count ཆརཔ', // less reliable - 'a_year' => ':count ཆརཔ', // less reliable - - 'month' => ':count ཟླ་བ', // less reliable - 'm' => ':count ཟླ་བ', // less reliable - 'a_month' => ':count ཟླ་བ', // less reliable - - 'day' => ':count ཉི', // less reliable - 'd' => ':count ཉི', // less reliable - 'a_day' => ':count ཉི', // less reliable - - 'second' => ':count ཆ', // less reliable - 's' => ':count ཆ', // less reliable - 'a_second' => ':count ཆ', // less reliable -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ebu.php b/vendor/nesbot/carbon/src/Carbon/Lang/ebu.php deleted file mode 100644 index f60bc6f2..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ebu.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['KI', 'UT'], - 'weekdays' => ['Kiumia', 'Njumatatu', 'Njumaine', 'Njumatano', 'Aramithi', 'Njumaa', 'NJumamothii'], - 'weekdays_short' => ['Kma', 'Tat', 'Ine', 'Tan', 'Arm', 'Maa', 'NMM'], - 'weekdays_min' => ['Kma', 'Tat', 'Ine', 'Tan', 'Arm', 'Maa', 'NMM'], - 'months' => ['Mweri wa mbere', 'Mweri wa kaĩri', 'Mweri wa kathatũ', 'Mweri wa kana', 'Mweri wa gatano', 'Mweri wa gatantatũ', 'Mweri wa mũgwanja', 'Mweri wa kanana', 'Mweri wa kenda', 'Mweri wa ikũmi', 'Mweri wa ikũmi na ũmwe', 'Mweri wa ikũmi na Kaĩrĩ'], - 'months_short' => ['Mbe', 'Kai', 'Kat', 'Kan', 'Gat', 'Gan', 'Mug', 'Knn', 'Ken', 'Iku', 'Imw', 'Igi'], - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ee.php b/vendor/nesbot/carbon/src/Carbon/Lang/ee.php deleted file mode 100644 index f96c5c9d..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ee.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['ŋ', 'ɣ'], - 'weekdays' => ['kɔsiɖa', 'dzoɖa', 'blaɖa', 'kuɖa', 'yawoɖa', 'fiɖa', 'memleɖa'], - 'weekdays_short' => ['kɔs', 'dzo', 'bla', 'kuɖ', 'yaw', 'fiɖ', 'mem'], - 'weekdays_min' => ['kɔs', 'dzo', 'bla', 'kuɖ', 'yaw', 'fiɖ', 'mem'], - 'months' => ['dzove', 'dzodze', 'tedoxe', 'afɔfĩe', 'dama', 'masa', 'siamlɔm', 'deasiamime', 'anyɔnyɔ', 'kele', 'adeɛmekpɔxe', 'dzome'], - 'months_short' => ['dzv', 'dzd', 'ted', 'afɔ', 'dam', 'mas', 'sia', 'dea', 'any', 'kel', 'ade', 'dzm'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'a [ga] h:mm', - 'LTS' => 'a [ga] h:mm:ss', - 'L' => 'M/D/YYYY', - 'LL' => 'MMM D [lia], YYYY', - 'LLL' => 'a [ga] h:mm MMMM D [lia] YYYY', - 'LLLL' => 'a [ga] h:mm dddd, MMMM D [lia] YYYY', - ], - - 'year' => 'ƒe :count', - 'y' => 'ƒe :count', - 'a_year' => 'ƒe :count', - - 'month' => 'ɣleti :count', - 'm' => 'ɣleti :count', - 'a_month' => 'ɣleti :count', - - 'week' => 'kwasiɖa :count', - 'w' => 'kwasiɖa :count', - 'a_week' => 'kwasiɖa :count', - - 'day' => 'ŋkeke :count', - 'd' => 'ŋkeke :count', - 'a_day' => 'ŋkeke :count', - - 'hour' => 'gaƒoƒo :count', - 'h' => 'gaƒoƒo :count', - 'a_hour' => 'gaƒoƒo :count', - - 'minute' => 'miniti :count', // less reliable - 'min' => 'miniti :count', // less reliable - 'a_minute' => 'miniti :count', // less reliable - - 'second' => 'sɛkɛnd :count', // less reliable - 's' => 'sɛkɛnd :count', // less reliable - 'a_second' => 'sɛkɛnd :count', // less reliable -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ee_TG.php b/vendor/nesbot/carbon/src/Carbon/Lang/ee_TG.php deleted file mode 100644 index 7a8b36c9..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ee_TG.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/ee.php', [ - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'LLL' => 'HH:mm MMMM D [lia] YYYY', - 'LLLL' => 'HH:mm dddd, MMMM D [lia] YYYY', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/el.php b/vendor/nesbot/carbon/src/Carbon/Lang/el.php deleted file mode 100644 index 7c40f9c1..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/el.php +++ /dev/null @@ -1,93 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Alessandro Di Felice - * - François B - * - Tim Fish - * - Gabriel Monteagudo - * - JD Isaacks - * - yiannisdesp - * - Ilias Kasmeridis (iliaskasm) - */ - -use Carbon\CarbonInterface; - -return [ - 'year' => ':count χρόνος|:count χρόνια', - 'a_year' => 'ένας χρόνος|:count χρόνια', - 'y' => ':count χρ.', - 'month' => ':count μήνας|:count μήνες', - 'a_month' => 'ένας μήνας|:count μήνες', - 'm' => ':count μήν.', - 'week' => ':count εβδομάδα|:count εβδομάδες', - 'a_week' => 'μια εβδομάδα|:count εβδομάδες', - 'w' => ':count εβδ.', - 'day' => ':count μέρα|:count μέρες', - 'a_day' => 'μία μέρα|:count μέρες', - 'd' => ':count μέρ.', - 'hour' => ':count ώρα|:count ώρες', - 'a_hour' => 'μία ώρα|:count ώρες', - 'h' => ':count ώρα|:count ώρες', - 'minute' => ':count λεπτό|:count λεπτά', - 'a_minute' => 'ένα λεπτό|:count λεπτά', - 'min' => ':count λεπ.', - 'second' => ':count δευτερόλεπτο|:count δευτερόλεπτα', - 'a_second' => 'λίγα δευτερόλεπτα|:count δευτερόλεπτα', - 's' => ':count δευ.', - 'ago' => 'πριν :time', - 'from_now' => 'σε :time', - 'after' => ':time μετά', - 'before' => ':time πριν', - 'diff_now' => 'τώρα', - 'diff_today' => 'Σήμερα', - 'diff_today_regexp' => 'Σήμερα(?:\\s+{})?', - 'diff_yesterday' => 'χθες', - 'diff_yesterday_regexp' => 'Χθες(?:\\s+{})?', - 'diff_tomorrow' => 'αύριο', - 'diff_tomorrow_regexp' => 'Αύριο(?:\\s+{})?', - 'formats' => [ - 'LT' => 'h:mm A', - 'LTS' => 'h:mm:ss A', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY h:mm A', - 'LLLL' => 'dddd, D MMMM YYYY h:mm A', - ], - 'calendar' => [ - 'sameDay' => '[Σήμερα {}] LT', - 'nextDay' => '[Αύριο {}] LT', - 'nextWeek' => 'dddd [{}] LT', - 'lastDay' => '[Χθες {}] LT', - 'lastWeek' => function (CarbonInterface $current) { - switch ($current->dayOfWeek) { - case 6: - return '[το προηγούμενο] dddd [{}] LT'; - default: - return '[την προηγούμενη] dddd [{}] LT'; - } - }, - 'sameElse' => 'L', - ], - 'ordinal' => ':numberη', - 'meridiem' => ['ΠΜ', 'ΜΜ', 'πμ', 'μμ'], - 'months' => ['Ιανουαρίου', 'Φεβρουαρίου', 'Μαρτίου', 'Απριλίου', 'Μαΐου', 'Ιουνίου', 'Ιουλίου', 'Αυγούστου', 'Σεπτεμβρίου', 'Οκτωβρίου', 'Νοεμβρίου', 'Δεκεμβρίου'], - 'months_standalone' => ['Ιανουάριος', 'Φεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'Ιούνιος', 'Ιούλιος', 'Αύγουστος', 'Σεπτέμβριος', 'Οκτώβριος', 'Νοέμβριος', 'Δεκέμβριος'], - 'months_regexp' => '/(D[oD]?[\s,]+MMMM|L{2,4}|l{2,4})/', - 'months_short' => ['Ιαν', 'Φεβ', 'Μαρ', 'Απρ', 'Μαϊ', 'Ιουν', 'Ιουλ', 'Αυγ', 'Σεπ', 'Οκτ', 'Νοε', 'Δεκ'], - 'weekdays' => ['Κυριακή', 'Δευτέρα', 'Τρίτη', 'Τετάρτη', 'Πέμπτη', 'Παρασκευή', 'Σάββατο'], - 'weekdays_short' => ['Κυρ', 'Δευ', 'Τρι', 'Τετ', 'Πεμ', 'Παρ', 'Σαβ'], - 'weekdays_min' => ['Κυ', 'Δε', 'Τρ', 'Τε', 'Πε', 'Πα', 'Σα'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' και '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/el_CY.php b/vendor/nesbot/carbon/src/Carbon/Lang/el_CY.php deleted file mode 100644 index 8a693c15..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/el_CY.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Greek Debian Translation Team bug-glibc@gnu.org - */ -return array_replace_recursive(require __DIR__.'/el.php', [ - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/el_GR.php b/vendor/nesbot/carbon/src/Carbon/Lang/el_GR.php deleted file mode 100644 index df196af9..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/el_GR.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - RAP bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/el.php', [ - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en.php b/vendor/nesbot/carbon/src/Carbon/Lang/en.php deleted file mode 100644 index f81f617e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en.php +++ /dev/null @@ -1,87 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Milos Sakovic - * - Paul - * - Pete Scopes (pdscopes) - */ -return [ - /* - * {1}, {0} and ]1,Inf[ are not needed as it's the default for English pluralization. - * But as some languages are using en.php as a fallback, it's better to specify it - * explicitly so those languages also fallback to English pluralization when a unit - * is missing. - */ - 'year' => '{1}:count year|{0}:count years|]1,Inf[:count years', - 'a_year' => '{1}a year|{0}:count years|]1,Inf[:count years', - 'y' => '{1}:countyr|{0}:countyrs|]1,Inf[:countyrs', - 'month' => '{1}:count month|{0}:count months|]1,Inf[:count months', - 'a_month' => '{1}a month|{0}:count months|]1,Inf[:count months', - 'm' => '{1}:countmo|{0}:countmos|]1,Inf[:countmos', - 'week' => '{1}:count week|{0}:count weeks|]1,Inf[:count weeks', - 'a_week' => '{1}a week|{0}:count weeks|]1,Inf[:count weeks', - 'w' => ':countw', - 'day' => '{1}:count day|{0}:count days|]1,Inf[:count days', - 'a_day' => '{1}a day|{0}:count days|]1,Inf[:count days', - 'd' => ':countd', - 'hour' => '{1}:count hour|{0}:count hours|]1,Inf[:count hours', - 'a_hour' => '{1}an hour|{0}:count hours|]1,Inf[:count hours', - 'h' => ':counth', - 'minute' => '{1}:count minute|{0}:count minutes|]1,Inf[:count minutes', - 'a_minute' => '{1}a minute|{0}:count minutes|]1,Inf[:count minutes', - 'min' => ':countm', - 'second' => '{1}:count second|{0}:count seconds|]1,Inf[:count seconds', - 'a_second' => '{1}a few seconds|{0}:count seconds|]1,Inf[:count seconds', - 's' => ':counts', - 'millisecond' => '{1}:count millisecond|{0}:count milliseconds|]1,Inf[:count milliseconds', - 'a_millisecond' => '{1}a millisecond|{0}:count milliseconds|]1,Inf[:count milliseconds', - 'ms' => ':countms', - 'microsecond' => '{1}:count microsecond|{0}:count microseconds|]1,Inf[:count microseconds', - 'a_microsecond' => '{1}a microsecond|{0}:count microseconds|]1,Inf[:count microseconds', - 'µs' => ':countµs', - 'ago' => ':time ago', - 'from_now' => ':time from now', - 'after' => ':time after', - 'before' => ':time before', - 'diff_now' => 'just now', - 'diff_today' => 'today', - 'diff_yesterday' => 'yesterday', - 'diff_tomorrow' => 'tomorrow', - 'diff_before_yesterday' => 'before yesterday', - 'diff_after_tomorrow' => 'after tomorrow', - 'period_recurrences' => '{1}once|{0}:count times|]1,Inf[:count times', - 'period_interval' => 'every :interval', - 'period_start_date' => 'from :date', - 'period_end_date' => 'to :date', - 'months' => ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], - 'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], - 'weekdays' => ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], - 'weekdays_short' => ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], - 'weekdays_min' => ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'], - 'ordinal' => function ($number) { - $lastDigit = $number % 10; - - return $number.( - ((int) ($number % 100 / 10) === 1) ? 'th' : ( - ($lastDigit === 1) ? 'st' : ( - ($lastDigit === 2) ? 'nd' : ( - ($lastDigit === 3) ? 'rd' : 'th' - ) - ) - ) - ); - }, - 'list' => [', ', ' and '], - 'first_day_of_week' => 0, - 'day_of_first_week_of_year' => 1, -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_001.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_001.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_001.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_150.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_150.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_150.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_AG.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_AG.php deleted file mode 100644 index 2c1c64f0..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_AG.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Free Software Foundation, Inc. bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YY', - ], - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_AI.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_AI.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_AI.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_AS.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_AS.php deleted file mode 100644 index f086dc63..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_AS.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_AT.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_AT.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_AT.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_AU.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_AU.php deleted file mode 100644 index f16bd4f5..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_AU.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Kunal Marwaha - * - François B - * - Mayank Badola - * - JD Isaacks - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'from_now' => 'in :time', - 'formats' => [ - 'LT' => 'h:mm A', - 'LTS' => 'h:mm:ss A', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY h:mm A', - 'LLLL' => 'dddd, D MMMM YYYY h:mm A', - ], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_BB.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_BB.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_BB.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_BE.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_BE.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_BE.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_BI.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_BI.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_BI.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_BM.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_BM.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_BM.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_BS.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_BS.php deleted file mode 100644 index f086dc63..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_BS.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_BW.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_BW.php deleted file mode 100644 index f086dc63..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_BW.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_BZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_BZ.php deleted file mode 100644 index f086dc63..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_BZ.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_CA.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_CA.php deleted file mode 100644 index e6560868..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_CA.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - François B - * - Zhan Tong Zhang - * - Mayank Badola - * - JD Isaacks - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'from_now' => 'in :time', - 'formats' => [ - 'LT' => 'h:mm A', - 'LTS' => 'h:mm:ss A', - 'L' => 'YYYY-MM-DD', - 'LL' => 'MMMM D, YYYY', - 'LLL' => 'MMMM D, YYYY h:mm A', - 'LLLL' => 'dddd, MMMM D, YYYY h:mm A', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_CC.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_CC.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_CC.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_CH.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_CH.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_CH.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_CK.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_CK.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_CK.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_CM.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_CM.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_CM.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_CX.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_CX.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_CX.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_CY.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_CY.php deleted file mode 100644 index a44c3508..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_CY.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - NehaGautam - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'from_now' => 'in :time', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD-MM-YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_DE.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_DE.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_DE.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_DG.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_DG.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_DG.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_DK.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_DK.php deleted file mode 100644 index 9e8a8c68..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_DK.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Danish Standards Association bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'YYYY-MM-DD', - ], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_DM.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_DM.php deleted file mode 100644 index f086dc63..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_DM.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_ER.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_ER.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_ER.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_FI.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_FI.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_FI.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_FJ.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_FJ.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_FJ.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_FK.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_FK.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_FK.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_FM.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_FM.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_FM.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_GB.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_GB.php deleted file mode 100644 index 67d9fd64..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_GB.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - François B - * - Mayank Badola - * - JD Isaacks - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'from_now' => 'in :time', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_GD.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_GD.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_GD.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_GG.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_GG.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_GG.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_GH.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_GH.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_GH.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_GI.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_GI.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_GI.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_GM.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_GM.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_GM.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_GU.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_GU.php deleted file mode 100644 index f086dc63..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_GU.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_GY.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_GY.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_GY.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_HK.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_HK.php deleted file mode 100644 index 34aae989..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_HK.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_IE.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_IE.php deleted file mode 100644 index c8d3c2fc..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_IE.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Martin McWhorter - * - François B - * - Chris Cartlidge - * - JD Isaacks - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'from_now' => 'in :time', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD-MM-YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_IL.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_IL.php deleted file mode 100644 index e607924e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_IL.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Yoav Amit - * - François B - * - Mayank Badola - * - JD Isaacks - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'from_now' => 'in :time', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_IM.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_IM.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_IM.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_IN.php deleted file mode 100644 index 00414e9a..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_IN.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YY', - 'LL' => 'MMMM DD, YYYY', - 'LLL' => 'DD MMM HH:mm', - 'LLLL' => 'MMMM DD, YYYY HH:mm', - ], - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_IO.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_IO.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_IO.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_ISO.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_ISO.php deleted file mode 100644 index 11457b0c..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_ISO.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'YYYY-MM-dd', - 'LL' => 'YYYY MMM D', - 'LLL' => 'YYYY MMMM D HH:mm', - 'LLLL' => 'dddd, YYYY MMMM DD HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_JE.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_JE.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_JE.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_JM.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_JM.php deleted file mode 100644 index f086dc63..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_JM.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_KE.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_KE.php deleted file mode 100644 index f086dc63..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_KE.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_KI.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_KI.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_KI.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_KN.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_KN.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_KN.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_KY.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_KY.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_KY.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_LC.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_LC.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_LC.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_LR.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_LR.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_LR.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_LS.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_LS.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_LS.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_MG.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_MG.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_MG.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_MH.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_MH.php deleted file mode 100644 index f086dc63..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_MH.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_MO.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_MO.php deleted file mode 100644 index f086dc63..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_MO.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_MP.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_MP.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_MP.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_MS.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_MS.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_MS.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_MT.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_MT.php deleted file mode 100644 index f086dc63..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_MT.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_MU.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_MU.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_MU.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_MW.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_MW.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_MW.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_MY.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_MY.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_MY.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_NA.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_NA.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_NA.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_NF.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_NF.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_NF.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_NG.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_NG.php deleted file mode 100644 index 67bceaad..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_NG.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YY', - ], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_NL.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_NL.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_NL.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_NR.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_NR.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_NR.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_NU.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_NU.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_NU.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_NZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_NZ.php deleted file mode 100644 index 6a206a0d..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_NZ.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - François B - * - Mayank Badola - * - Luke McGregor - * - JD Isaacks - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'from_now' => 'in :time', - 'formats' => [ - 'LT' => 'h:mm A', - 'LTS' => 'h:mm:ss A', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY h:mm A', - 'LLLL' => 'dddd, D MMMM YYYY h:mm A', - ], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_PG.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_PG.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_PG.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_PH.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_PH.php deleted file mode 100644 index 34aae989..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_PH.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_PK.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_PK.php deleted file mode 100644 index f086dc63..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_PK.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_PN.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_PN.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_PN.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_PR.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_PR.php deleted file mode 100644 index f086dc63..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_PR.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_PW.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_PW.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_PW.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_RW.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_RW.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_RW.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_SB.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_SB.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_SB.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_SC.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_SC.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_SC.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_SD.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_SD.php deleted file mode 100644 index c4e2557e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_SD.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 6, - 'weekend' => [5, 6], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_SE.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_SE.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_SE.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_SG.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_SG.php deleted file mode 100644 index 5ee95241..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_SG.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'from_now' => 'in :time', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_SH.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_SH.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_SH.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_SI.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_SI.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_SI.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_SL.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_SL.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_SL.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_SS.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_SS.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_SS.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_SX.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_SX.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_SX.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_SZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_SZ.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_SZ.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_TC.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_TC.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_TC.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_TK.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_TK.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_TK.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_TO.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_TO.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_TO.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_TT.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_TT.php deleted file mode 100644 index f086dc63..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_TT.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_TV.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_TV.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_TV.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_TZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_TZ.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_TZ.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_UG.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_UG.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_UG.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_UM.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_UM.php deleted file mode 100644 index f086dc63..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_UM.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_US.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_US.php deleted file mode 100644 index f086dc63..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_US.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_US_Posix.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_US_Posix.php deleted file mode 100644 index f086dc63..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_US_Posix.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_VC.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_VC.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_VC.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_VG.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_VG.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_VG.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_VI.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_VI.php deleted file mode 100644 index f086dc63..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_VI.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_VU.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_VU.php deleted file mode 100644 index e2dd81db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_VU.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_WS.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_WS.php deleted file mode 100644 index f086dc63..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_WS.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_ZA.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_ZA.php deleted file mode 100644 index 48ea9471..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_ZA.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Zuza Software Foundation (Translate.org.za) Dwayne Bailey dwayne@translate.org.za - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YY', - 'LL' => 'MMMM DD, YYYY', - 'LLL' => 'DD MMM HH:mm', - 'LLLL' => 'MMMM DD, YYYY HH:mm', - ], - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_ZM.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_ZM.php deleted file mode 100644 index d8a8cb59..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_ZM.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - ANLoc Martin Benjamin locales@africanlocalization.net - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YY', - ], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_ZW.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_ZW.php deleted file mode 100644 index f086dc63..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_ZW.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/eo.php b/vendor/nesbot/carbon/src/Carbon/Lang/eo.php deleted file mode 100644 index 7c2efba2..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/eo.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Josh Soref - * - François B - * - Mia Nordentoft - * - JD Isaacks - */ -return [ - 'year' => ':count jaro|:count jaroj', - 'a_year' => 'jaro|:count jaroj', - 'y' => ':count j.', - 'month' => ':count monato|:count monatoj', - 'a_month' => 'monato|:count monatoj', - 'm' => ':count mo.', - 'week' => ':count semajno|:count semajnoj', - 'a_week' => 'semajno|:count semajnoj', - 'w' => ':count sem.', - 'day' => ':count tago|:count tagoj', - 'a_day' => 'tago|:count tagoj', - 'd' => ':count t.', - 'hour' => ':count horo|:count horoj', - 'a_hour' => 'horo|:count horoj', - 'h' => ':count h.', - 'minute' => ':count minuto|:count minutoj', - 'a_minute' => 'minuto|:count minutoj', - 'min' => ':count min.', - 'second' => ':count sekundo|:count sekundoj', - 'a_second' => 'sekundoj|:count sekundoj', - 's' => ':count sek.', - 'ago' => 'antaŭ :time', - 'from_now' => 'post :time', - 'after' => ':time poste', - 'before' => ':time antaŭe', - 'diff_yesterday' => 'Hieraŭ', - 'diff_yesterday_regexp' => 'Hieraŭ(?:\\s+je)?', - 'diff_today' => 'Hodiaŭ', - 'diff_today_regexp' => 'Hodiaŭ(?:\\s+je)?', - 'diff_tomorrow' => 'Morgaŭ', - 'diff_tomorrow_regexp' => 'Morgaŭ(?:\\s+je)?', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'YYYY-MM-DD', - 'LL' => 'D[-a de] MMMM, YYYY', - 'LLL' => 'D[-a de] MMMM, YYYY HH:mm', - 'LLLL' => 'dddd, [la] D[-a de] MMMM, YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[Hodiaŭ je] LT', - 'nextDay' => '[Morgaŭ je] LT', - 'nextWeek' => 'dddd [je] LT', - 'lastDay' => '[Hieraŭ je] LT', - 'lastWeek' => '[pasinta] dddd [je] LT', - 'sameElse' => 'L', - ], - 'ordinal' => ':numbera', - 'meridiem' => ['a.t.m.', 'p.t.m.'], - 'months' => ['januaro', 'februaro', 'marto', 'aprilo', 'majo', 'junio', 'julio', 'aŭgusto', 'septembro', 'oktobro', 'novembro', 'decembro'], - 'months_short' => ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aŭg', 'sep', 'okt', 'nov', 'dec'], - 'weekdays' => ['dimanĉo', 'lundo', 'mardo', 'merkredo', 'ĵaŭdo', 'vendredo', 'sabato'], - 'weekdays_short' => ['dim', 'lun', 'mard', 'merk', 'ĵaŭ', 'ven', 'sab'], - 'weekdays_min' => ['di', 'lu', 'ma', 'me', 'ĵa', 've', 'sa'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'list' => [', ', ' kaj '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es.php b/vendor/nesbot/carbon/src/Carbon/Lang/es.php deleted file mode 100644 index 1c4fcfd0..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es.php +++ /dev/null @@ -1,121 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Kunal Marwaha - * - kostas - * - François B - * - Tim Fish - * - Claire Coloma - * - Steven Heinrich - * - JD Isaacks - * - Raphael Amorim - * - Jorge Y. Castillo - * - Víctor Díaz - * - Diego - * - Sebastian Thierer - * - quinterocesar - * - Daniel Commesse Liévanos (danielcommesse) - * - Pete Scopes (pdscopes) - * - gam04 - */ - -use Carbon\CarbonInterface; - -return [ - 'year' => ':count año|:count años', - 'a_year' => 'un año|:count años', - 'y' => ':count año|:count años', - 'month' => ':count mes|:count meses', - 'a_month' => 'un mes|:count meses', - 'm' => ':count mes|:count meses', - 'week' => ':count semana|:count semanas', - 'a_week' => 'una semana|:count semanas', - 'w' => ':countsem', - 'day' => ':count día|:count días', - 'a_day' => 'un día|:count días', - 'd' => ':countd', - 'hour' => ':count hora|:count horas', - 'a_hour' => 'una hora|:count horas', - 'h' => ':counth', - 'minute' => ':count minuto|:count minutos', - 'a_minute' => 'un minuto|:count minutos', - 'min' => ':countm', - 'second' => ':count segundo|:count segundos', - 'a_second' => 'unos segundos|:count segundos', - 's' => ':counts', - 'millisecond' => ':count milisegundo|:count milisegundos', - 'a_millisecond' => 'un milisegundo|:count milisegundos', - 'ms' => ':countms', - 'microsecond' => ':count microsegundo|:count microsegundos', - 'a_microsecond' => 'un microsegundo|:count microsegundos', - 'µs' => ':countµs', - 'ago' => 'hace :time', - 'from_now' => 'en :time', - 'after' => ':time después', - 'before' => ':time antes', - 'diff_now' => 'ahora mismo', - 'diff_today' => 'hoy', - 'diff_today_regexp' => 'hoy(?:\\s+a)?(?:\\s+las)?', - 'diff_yesterday' => 'ayer', - 'diff_yesterday_regexp' => 'ayer(?:\\s+a)?(?:\\s+las)?', - 'diff_tomorrow' => 'mañana', - 'diff_tomorrow_regexp' => 'mañana(?:\\s+a)?(?:\\s+las)?', - 'diff_before_yesterday' => 'anteayer', - 'diff_after_tomorrow' => 'pasado mañana', - 'formats' => [ - 'LT' => 'H:mm', - 'LTS' => 'H:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D [de] MMMM [de] YYYY', - 'LLL' => 'D [de] MMMM [de] YYYY H:mm', - 'LLLL' => 'dddd, D [de] MMMM [de] YYYY H:mm', - ], - 'calendar' => [ - 'sameDay' => function (CarbonInterface $current) { - return '[hoy a la'.($current->hour !== 1 ? 's' : '').'] LT'; - }, - 'nextDay' => function (CarbonInterface $current) { - return '[mañana a la'.($current->hour !== 1 ? 's' : '').'] LT'; - }, - 'nextWeek' => function (CarbonInterface $current) { - return 'dddd [a la'.($current->hour !== 1 ? 's' : '').'] LT'; - }, - 'lastDay' => function (CarbonInterface $current) { - return '[ayer a la'.($current->hour !== 1 ? 's' : '').'] LT'; - }, - 'lastWeek' => function (CarbonInterface $current) { - return '[el] dddd [pasado a la'.($current->hour !== 1 ? 's' : '').'] LT'; - }, - 'sameElse' => 'L', - ], - 'months' => ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre'], - 'months_short' => ['ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'sep', 'oct', 'nov', 'dic'], - 'mmm_suffix' => '.', - 'ordinal' => ':numberº', - 'weekdays' => ['domingo', 'lunes', 'martes', 'miércoles', 'jueves', 'viernes', 'sábado'], - 'weekdays_short' => ['dom.', 'lun.', 'mar.', 'mié.', 'jue.', 'vie.', 'sáb.'], - 'weekdays_min' => ['do', 'lu', 'ma', 'mi', 'ju', 'vi', 'sá'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' y '], - 'meridiem' => ['a. m.', 'p. m.'], - 'ordinal_words' => [ - 'of' => 'de', - 'first' => 'primer', - 'second' => 'segundo', - 'third' => 'tercer', - 'fourth' => 'cuarto', - 'fifth' => 'quinto', - 'last' => 'último', - ], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_419.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_419.php deleted file mode 100644 index a74806e8..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_419.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - RAP bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/es.php', [ - 'first_day_of_week' => 0, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_AR.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_AR.php deleted file mode 100644 index a74806e8..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_AR.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - RAP bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/es.php', [ - 'first_day_of_week' => 0, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_BO.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_BO.php deleted file mode 100644 index c9b8432e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_BO.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - RAP bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/es.php', [ - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_BR.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_BR.php deleted file mode 100644 index 378d0547..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_BR.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/es.php', [ - 'first_day_of_week' => 0, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_BZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_BZ.php deleted file mode 100644 index 378d0547..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_BZ.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/es.php', [ - 'first_day_of_week' => 0, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_CL.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_CL.php deleted file mode 100644 index a74806e8..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_CL.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - RAP bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/es.php', [ - 'first_day_of_week' => 0, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_CO.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_CO.php deleted file mode 100644 index a74806e8..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_CO.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - RAP bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/es.php', [ - 'first_day_of_week' => 0, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_CR.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_CR.php deleted file mode 100644 index 553fc09f..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_CR.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Free Software Foundation, Inc. bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/es.php', [ - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_CU.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_CU.php deleted file mode 100644 index f02e1a66..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_CU.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/es.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_DO.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_DO.php deleted file mode 100644 index 0f855bac..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_DO.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - kostas - * - François B - * - Tim Fish - * - Chiel Robben - * - Claire Coloma - * - Steven Heinrich - * - JD Isaacks - * - Raphael Amorim - */ -return array_replace_recursive(require __DIR__.'/es.php', [ - 'diff_before_yesterday' => 'anteayer', - 'formats' => [ - 'LT' => 'h:mm A', - 'LTS' => 'h:mm:ss A', - 'LLL' => 'D [de] MMMM [de] YYYY h:mm A', - 'LLLL' => 'dddd, D [de] MMMM [de] YYYY h:mm A', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_EA.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_EA.php deleted file mode 100644 index f02e1a66..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_EA.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/es.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_EC.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_EC.php deleted file mode 100644 index a74806e8..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_EC.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - RAP bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/es.php', [ - 'first_day_of_week' => 0, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_ES.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_ES.php deleted file mode 100644 index 19217c27..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_ES.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - RAP bug-glibc-locales@gnu.org - */ -return require __DIR__.'/es.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_GQ.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_GQ.php deleted file mode 100644 index f02e1a66..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_GQ.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/es.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_GT.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_GT.php deleted file mode 100644 index a74806e8..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_GT.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - RAP bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/es.php', [ - 'first_day_of_week' => 0, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_HN.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_HN.php deleted file mode 100644 index a74806e8..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_HN.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - RAP bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/es.php', [ - 'first_day_of_week' => 0, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_IC.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_IC.php deleted file mode 100644 index f02e1a66..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_IC.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/es.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_MX.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_MX.php deleted file mode 100644 index 61e14cfa..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_MX.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - RAP bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/es.php', [ - 'diff_before_yesterday' => 'antier', - 'first_day_of_week' => 0, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_NI.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_NI.php deleted file mode 100644 index 6b964c14..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_NI.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Free Software Foundation, Inc. bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/es.php', [ - 'first_day_of_week' => 0, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_PA.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_PA.php deleted file mode 100644 index a74806e8..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_PA.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - RAP bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/es.php', [ - 'first_day_of_week' => 0, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_PE.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_PE.php deleted file mode 100644 index a74806e8..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_PE.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - RAP bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/es.php', [ - 'first_day_of_week' => 0, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_PH.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_PH.php deleted file mode 100644 index deae06a1..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_PH.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/es.php', [ - 'first_day_of_week' => 0, - 'formats' => [ - 'LT' => 'h:mm a', - 'LTS' => 'h:mm:ss a', - 'L' => 'D/M/yy', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D [de] MMMM [de] YYYY h:mm a', - 'LLLL' => 'dddd, D [de] MMMM [de] YYYY h:mm a', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_PR.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_PR.php deleted file mode 100644 index 6b964c14..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_PR.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Free Software Foundation, Inc. bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/es.php', [ - 'first_day_of_week' => 0, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_PY.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_PY.php deleted file mode 100644 index a74806e8..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_PY.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - RAP bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/es.php', [ - 'first_day_of_week' => 0, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_SV.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_SV.php deleted file mode 100644 index 00db08e2..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_SV.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - RAP bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/es.php', [ - 'months' => ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre'], - 'months_short' => ['ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'sep', 'oct', 'nov', 'dic'], - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_US.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_US.php deleted file mode 100644 index f333136f..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_US.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Kunal Marwaha - * - Josh Soref - * - Jørn Ølmheim - * - Craig Patik - * - bustta - * - François B - * - Tim Fish - * - Claire Coloma - * - Steven Heinrich - * - JD Isaacks - * - Raphael Amorim - */ -return array_replace_recursive(require __DIR__.'/es.php', [ - 'diff_before_yesterday' => 'anteayer', - 'formats' => [ - 'LT' => 'h:mm A', - 'LTS' => 'h:mm:ss A', - 'L' => 'MM/DD/YYYY', - 'LL' => 'MMMM [de] D [de] YYYY', - 'LLL' => 'MMMM [de] D [de] YYYY h:mm A', - 'LLLL' => 'dddd, MMMM [de] D [de] YYYY h:mm A', - ], - 'first_day_of_week' => 0, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_UY.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_UY.php deleted file mode 100644 index 39baff8b..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_UY.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - RAP bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/es.php', [ - 'months' => ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'setiembre', 'octubre', 'noviembre', 'diciembre'], - 'months_short' => ['ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'set', 'oct', 'nov', 'dic'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_VE.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_VE.php deleted file mode 100644 index a74806e8..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_VE.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - RAP bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/es.php', [ - 'first_day_of_week' => 0, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/et.php b/vendor/nesbot/carbon/src/Carbon/Lang/et.php deleted file mode 100644 index f49c8806..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/et.php +++ /dev/null @@ -1,93 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Philippe Vaucher - * - Andres Ivanov - * - Tsutomu Kuroda - * - tjku - * - Max Melentiev - * - Juanito Fatas - * - RM87 - * - Akira Matsuda - * - Christopher Dell - * - Enrique Vidal - * - Simone Carletti - * - Aaron Patterson - * - Esko Lehtme - * - Mart Karu - * - Nicolás Hock Isaza - * - Kevin Valdek - * - Zahhar Kirillov - * - João Magalhães - * - Ingmar - * - Illimar Tambek - * - Mihkel - */ -return [ - 'year' => ':count aasta|:count aastat', - 'y' => ':count a', - 'month' => ':count kuu|:count kuud', - 'm' => ':count k', - 'week' => ':count nädal|:count nädalat', - 'w' => ':count näd', - 'day' => ':count päev|:count päeva', - 'd' => ':count p', - 'hour' => ':count tund|:count tundi', - 'h' => ':count t', - 'minute' => ':count minut|:count minutit', - 'min' => ':count min', - 'second' => ':count sekund|:count sekundit', - 's' => ':count s', - 'ago' => ':time tagasi', - 'from_now' => ':time pärast', - 'after' => ':time pärast', - 'before' => ':time enne', - 'year_from_now' => ':count aasta', - 'month_from_now' => ':count kuu', - 'week_from_now' => ':count nädala', - 'day_from_now' => ':count päeva', - 'hour_from_now' => ':count tunni', - 'minute_from_now' => ':count minuti', - 'second_from_now' => ':count sekundi', - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'diff_now' => 'nüüd', - 'diff_today' => 'täna', - 'diff_yesterday' => 'eile', - 'diff_tomorrow' => 'homme', - 'diff_before_yesterday' => 'üleeile', - 'diff_after_tomorrow' => 'ülehomme', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD.MM.YYYY', - 'LL' => 'D. MMMM YYYY', - 'LLL' => 'D. MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D. MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[täna] LT', - 'nextDay' => '[homme] LT', - 'lastDay' => '[eile] LT', - 'nextWeek' => 'dddd LT', - 'lastWeek' => '[eelmine] dddd LT', - 'sameElse' => 'L', - ], - 'months' => ['jaanuar', 'veebruar', 'märts', 'aprill', 'mai', 'juuni', 'juuli', 'august', 'september', 'oktoober', 'november', 'detsember'], - 'months_short' => ['jaan', 'veebr', 'märts', 'apr', 'mai', 'juuni', 'juuli', 'aug', 'sept', 'okt', 'nov', 'dets'], - 'weekdays' => ['pühapäev', 'esmaspäev', 'teisipäev', 'kolmapäev', 'neljapäev', 'reede', 'laupäev'], - 'weekdays_short' => ['P', 'E', 'T', 'K', 'N', 'R', 'L'], - 'weekdays_min' => ['P', 'E', 'T', 'K', 'N', 'R', 'L'], - 'list' => [', ', ' ja '], - 'meridiem' => ['enne lõunat', 'pärast lõunat'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/et_EE.php b/vendor/nesbot/carbon/src/Carbon/Lang/et_EE.php deleted file mode 100644 index 0f112b34..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/et_EE.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/et.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/eu.php b/vendor/nesbot/carbon/src/Carbon/Lang/eu.php deleted file mode 100644 index a543f1a6..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/eu.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Josh Soref - * - François B - * - JD Isaacks - */ -return [ - 'year' => 'urte bat|:count urte', - 'y' => 'Urte 1|:count urte', - 'month' => 'hilabete bat|:count hilabete', - 'm' => 'Hile 1|:count hile', - 'week' => 'Aste 1|:count aste', - 'w' => 'Aste 1|:count aste', - 'day' => 'egun bat|:count egun', - 'd' => 'Egun 1|:count egun', - 'hour' => 'ordu bat|:count ordu', - 'h' => 'Ordu 1|:count ordu', - 'minute' => 'minutu bat|:count minutu', - 'min' => 'Minutu 1|:count minutu', - 'second' => 'segundo batzuk|:count segundo', - 's' => 'Segundu 1|:count segundu', - 'ago' => 'duela :time', - 'from_now' => ':time barru', - 'after' => ':time geroago', - 'before' => ':time lehenago', - 'diff_now' => 'orain', - 'diff_today' => 'gaur', - 'diff_yesterday' => 'atzo', - 'diff_tomorrow' => 'bihar', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'YYYY-MM-DD', - 'LL' => 'YYYY[ko] MMMM[ren] D[a]', - 'LLL' => 'YYYY[ko] MMMM[ren] D[a] HH:mm', - 'LLLL' => 'dddd, YYYY[ko] MMMM[ren] D[a] HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[gaur] LT[etan]', - 'nextDay' => '[bihar] LT[etan]', - 'nextWeek' => 'dddd LT[etan]', - 'lastDay' => '[atzo] LT[etan]', - 'lastWeek' => '[aurreko] dddd LT[etan]', - 'sameElse' => 'L', - ], - 'ordinal' => ':number.', - 'months' => ['urtarrila', 'otsaila', 'martxoa', 'apirila', 'maiatza', 'ekaina', 'uztaila', 'abuztua', 'iraila', 'urria', 'azaroa', 'abendua'], - 'months_short' => ['urt.', 'ots.', 'mar.', 'api.', 'mai.', 'eka.', 'uzt.', 'abu.', 'ira.', 'urr.', 'aza.', 'abe.'], - 'weekdays' => ['igandea', 'astelehena', 'asteartea', 'asteazkena', 'osteguna', 'ostirala', 'larunbata'], - 'weekdays_short' => ['ig.', 'al.', 'ar.', 'az.', 'og.', 'ol.', 'lr.'], - 'weekdays_min' => ['ig', 'al', 'ar', 'az', 'og', 'ol', 'lr'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'list' => [', ', ' eta '], - 'meridiem' => ['g', 'a'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/eu_ES.php b/vendor/nesbot/carbon/src/Carbon/Lang/eu_ES.php deleted file mode 100644 index 0d1e82a9..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/eu_ES.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/eu.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ewo.php b/vendor/nesbot/carbon/src/Carbon/Lang/ewo.php deleted file mode 100644 index 7808ab50..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ewo.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['kíkíríg', 'ngəgógəle'], - 'weekdays' => ['sɔ́ndɔ', 'mɔ́ndi', 'sɔ́ndɔ məlú mə́bɛ̌', 'sɔ́ndɔ məlú mə́lɛ́', 'sɔ́ndɔ məlú mə́nyi', 'fúladé', 'séradé'], - 'weekdays_short' => ['sɔ́n', 'mɔ́n', 'smb', 'sml', 'smn', 'fúl', 'sér'], - 'weekdays_min' => ['sɔ́n', 'mɔ́n', 'smb', 'sml', 'smn', 'fúl', 'sér'], - 'months' => ['ngɔn osú', 'ngɔn bɛ̌', 'ngɔn lála', 'ngɔn nyina', 'ngɔn tána', 'ngɔn saməna', 'ngɔn zamgbála', 'ngɔn mwom', 'ngɔn ebulú', 'ngɔn awóm', 'ngɔn awóm ai dziá', 'ngɔn awóm ai bɛ̌'], - 'months_short' => ['ngo', 'ngb', 'ngl', 'ngn', 'ngt', 'ngs', 'ngz', 'ngm', 'nge', 'nga', 'ngad', 'ngab'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'D/M/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], - - // Too unreliable - /* - 'year' => ':count mbu', // less reliable - 'y' => ':count mbu', // less reliable - 'a_year' => ':count mbu', // less reliable - - 'month' => ':count ngòn', // less reliable - 'm' => ':count ngòn', // less reliable - 'a_month' => ':count ngòn', // less reliable - - 'week' => ':count mësë', // less reliable - 'w' => ':count mësë', // less reliable - 'a_week' => ':count mësë', // less reliable - - 'day' => ':count mësë', // less reliable - 'd' => ':count mësë', // less reliable - 'a_day' => ':count mësë', // less reliable - - 'hour' => ':count awola', // less reliable - 'h' => ':count awola', // less reliable - 'a_hour' => ':count awola', // less reliable - - 'minute' => ':count awola', // less reliable - 'min' => ':count awola', // less reliable - 'a_minute' => ':count awola', // less reliable - */ -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fa.php b/vendor/nesbot/carbon/src/Carbon/Lang/fa.php deleted file mode 100644 index 72e03085..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fa.php +++ /dev/null @@ -1,84 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Josh Soref - * - François B - * - Nasser Ghiasi - * - JD Isaacks - * - Hossein Jabbari - * - nimamo - * - hafezdivandari - * - Hassan Pezeshk (hpez) - */ -return [ - 'year' => ':count سال', - 'a_year' => 'یک سال'.'|:count '.'سال', - 'y' => ':count سال', - 'month' => ':count ماه', - 'a_month' => 'یک ماه'.'|:count '.'ماه', - 'm' => ':count ماه', - 'week' => ':count هفته', - 'a_week' => 'یک هفته'.'|:count '.'هفته', - 'w' => ':count هفته', - 'day' => ':count روز', - 'a_day' => 'یک روز'.'|:count '.'روز', - 'd' => ':count روز', - 'hour' => ':count ساعت', - 'a_hour' => 'یک ساعت'.'|:count '.'ساعت', - 'h' => ':count ساعت', - 'minute' => ':count دقیقه', - 'a_minute' => 'یک دقیقه'.'|:count '.'دقیقه', - 'min' => ':count دقیقه', - 'second' => ':count ثانیه', - 's' => ':count ثانیه', - 'ago' => ':time پیش', - 'from_now' => ':time دیگر', - 'after' => ':time پس از', - 'before' => ':time پیش از', - 'diff_now' => 'اکنون', - 'diff_today' => 'امروز', - 'diff_today_regexp' => 'امروز(?:\\s+ساعت)?', - 'diff_yesterday' => 'دیروز', - 'diff_yesterday_regexp' => 'دیروز(?:\\s+ساعت)?', - 'diff_tomorrow' => 'فردا', - 'diff_tomorrow_regexp' => 'فردا(?:\\s+ساعت)?', - 'formats' => [ - 'LT' => 'OH:Om', - 'LTS' => 'OH:Om:Os', - 'L' => 'OD/OM/OY', - 'LL' => 'OD MMMM OY', - 'LLL' => 'OD MMMM OY OH:Om', - 'LLLL' => 'dddd, OD MMMM OY OH:Om', - ], - 'calendar' => [ - 'sameDay' => '[امروز ساعت] LT', - 'nextDay' => '[فردا ساعت] LT', - 'nextWeek' => 'dddd [ساعت] LT', - 'lastDay' => '[دیروز ساعت] LT', - 'lastWeek' => 'dddd [پیش] [ساعت] LT', - 'sameElse' => 'L', - ], - 'ordinal' => ':timeم', - 'meridiem' => ['قبل از ظهر', 'بعد از ظهر'], - 'months' => ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'], - 'months_short' => ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'], - 'weekdays' => ['یکشنبه', 'دوشنبه', 'سه‌شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه'], - 'weekdays_short' => ['یکشنبه', 'دوشنبه', 'سه‌شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه'], - 'weekdays_min' => ['ی', 'د', 'س', 'چ', 'پ', 'ج', 'ش'], - 'first_day_of_week' => 6, - 'day_of_first_week_of_year' => 1, - 'list' => ['، ', ' و '], - 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰۴', '۰۵', '۰۶', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱۴', '۱۵', '۱۶', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲۴', '۲۵', '۲۶', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳۴', '۳۵', '۳۶', '۳۷', '۳۸', '۳۹', '۴۰', '۴۱', '۴۲', '۴۳', '۴۴', '۴۵', '۴۶', '۴۷', '۴۸', '۴۹', '۵۰', '۵۱', '۵۲', '۵۳', '۵۴', '۵۵', '۵۶', '۵۷', '۵۸', '۵۹', '۶۰', '۶۱', '۶۲', '۶۳', '۶۴', '۶۵', '۶۶', '۶۷', '۶۸', '۶۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷۴', '۷۵', '۷۶', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸۴', '۸۵', '۸۶', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹۴', '۹۵', '۹۶', '۹۷', '۹۸', '۹۹'], - 'months_short_standalone' => ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'], - 'weekend' => [5, 5], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fa_AF.php b/vendor/nesbot/carbon/src/Carbon/Lang/fa_AF.php deleted file mode 100644 index 69471004..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fa_AF.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/fa.php', [ - 'meridiem' => ['ق', 'ب'], - 'weekend' => [4, 5], - 'formats' => [ - 'L' => 'OY/OM/OD', - 'LL' => 'OD MMM OY', - 'LLL' => 'OD MMMM OY،‏ H:mm', - 'LLLL' => 'dddd OD MMMM OY،‏ H:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fa_IR.php b/vendor/nesbot/carbon/src/Carbon/Lang/fa_IR.php deleted file mode 100644 index 08d01825..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fa_IR.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/fa.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ff.php b/vendor/nesbot/carbon/src/Carbon/Lang/ff.php deleted file mode 100644 index 9525c95a..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ff.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM, YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], - 'months' => ['siilo', 'colte', 'mbooy', 'seeɗto', 'duujal', 'korse', 'morso', 'juko', 'siilto', 'yarkomaa', 'jolal', 'bowte'], - 'months_short' => ['sii', 'col', 'mbo', 'see', 'duu', 'kor', 'mor', 'juk', 'slt', 'yar', 'jol', 'bow'], - 'weekdays' => ['dewo', 'aaɓnde', 'mawbaare', 'njeslaare', 'naasaande', 'mawnde', 'hoore-biir'], - 'weekdays_short' => ['dew', 'aaɓ', 'maw', 'nje', 'naa', 'mwd', 'hbi'], - 'weekdays_min' => ['dew', 'aaɓ', 'maw', 'nje', 'naa', 'mwd', 'hbi'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['subaka', 'kikiiɗe'], - - 'year' => ':count baret', // less reliable - 'y' => ':count baret', // less reliable - 'a_year' => ':count baret', // less reliable - - 'month' => ':count lewru', // less reliable - 'm' => ':count lewru', // less reliable - 'a_month' => ':count lewru', // less reliable - - 'week' => ':count naange', // less reliable - 'w' => ':count naange', // less reliable - 'a_week' => ':count naange', // less reliable - - 'day' => ':count dian', // less reliable - 'd' => ':count dian', // less reliable - 'a_day' => ':count dian', // less reliable - - 'hour' => ':count montor', // less reliable - 'h' => ':count montor', // less reliable - 'a_hour' => ':count montor', // less reliable - - 'minute' => ':count tokossuoum', // less reliable - 'min' => ':count tokossuoum', // less reliable - 'a_minute' => ':count tokossuoum', // less reliable - - 'second' => ':count tenen', // less reliable - 's' => ':count tenen', // less reliable - 'a_second' => ':count tenen', // less reliable -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ff_CM.php b/vendor/nesbot/carbon/src/Carbon/Lang/ff_CM.php deleted file mode 100644 index b797ac09..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ff_CM.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/ff.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ff_GN.php b/vendor/nesbot/carbon/src/Carbon/Lang/ff_GN.php deleted file mode 100644 index b797ac09..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ff_GN.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/ff.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ff_MR.php b/vendor/nesbot/carbon/src/Carbon/Lang/ff_MR.php deleted file mode 100644 index 2f4c29f6..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ff_MR.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/ff.php', [ - 'formats' => [ - 'LT' => 'h:mm a', - 'LTS' => 'h:mm:ss a', - 'L' => 'D/M/YYYY', - 'LL' => 'D MMM, YYYY', - 'LLL' => 'D MMMM YYYY h:mm a', - 'LLLL' => 'dddd D MMMM YYYY h:mm a', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ff_SN.php b/vendor/nesbot/carbon/src/Carbon/Lang/ff_SN.php deleted file mode 100644 index 1e4c8b6c..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ff_SN.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Pular-Fulfulde.org Ibrahima Sarr admin@pulaar-fulfulde.org - */ -return require __DIR__.'/ff.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fi.php b/vendor/nesbot/carbon/src/Carbon/Lang/fi.php deleted file mode 100644 index edf2d6d3..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fi.php +++ /dev/null @@ -1,88 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Philippe Vaucher - * - Janne Warén - * - digitalfrost - * - Tsutomu Kuroda - * - Roope Salmi - * - tjku - * - Max Melentiev - * - Sami Haahtinen - * - Teemu Leisti - * - Artem Ignatyev - * - Akira Matsuda - * - Christopher Dell - * - Enrique Vidal - * - Simone Carletti - * - Robert Bjarnason - * - Aaron Patterson - * - Nicolás Hock Isaza - * - Tom Hughes - * - Sven Fuchs - * - Petri Kivikangas - * - Nizar Jouini - * - Marko Seppae - * - Tomi Mynttinen (Pikseli) - * - Petteri (powergrip) - */ -return [ - 'year' => ':count vuosi|:count vuotta', - 'y' => ':count v', - 'month' => ':count kuukausi|:count kuukautta', - 'm' => ':count kk', - 'week' => ':count viikko|:count viikkoa', - 'w' => ':count vk', - 'day' => ':count päivä|:count päivää', - 'd' => ':count pv', - 'hour' => ':count tunti|:count tuntia', - 'h' => ':count t', - 'minute' => ':count minuutti|:count minuuttia', - 'min' => ':count min', - 'second' => ':count sekunti|:count sekuntia', - 'a_second' => 'muutama sekunti|:count sekuntia', - 's' => ':count s', - 'ago' => ':time sitten', - 'from_now' => ':time päästä', - 'year_from_now' => ':count vuoden', - 'month_from_now' => ':count kuukauden', - 'week_from_now' => ':count viikon', - 'day_from_now' => ':count päivän', - 'hour_from_now' => ':count tunnin', - 'minute_from_now' => ':count minuutin', - 'second_from_now' => ':count sekunnin', - 'after' => ':time sen jälkeen', - 'before' => ':time ennen', - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' ja '], - 'diff_now' => 'nyt', - 'diff_yesterday' => 'eilen', - 'diff_tomorrow' => 'huomenna', - 'formats' => [ - 'LT' => 'HH.mm', - 'LTS' => 'HH.mm:ss', - 'L' => 'D.M.YYYY', - 'LL' => 'dddd D. MMMM[ta] YYYY', - 'll' => 'ddd D. MMM YYYY', - 'LLL' => 'D.MM. HH.mm', - 'LLLL' => 'D. MMMM[ta] YYYY HH.mm', - 'llll' => 'D. MMM YY HH.mm', - ], - 'weekdays' => ['sunnuntai', 'maanantai', 'tiistai', 'keskiviikko', 'torstai', 'perjantai', 'lauantai'], - 'weekdays_short' => ['su', 'ma', 'ti', 'ke', 'to', 'pe', 'la'], - 'weekdays_min' => ['su', 'ma', 'ti', 'ke', 'to', 'pe', 'la'], - 'months' => ['tammikuu', 'helmikuu', 'maaliskuu', 'huhtikuu', 'toukokuu', 'kesäkuu', 'heinäkuu', 'elokuu', 'syyskuu', 'lokakuu', 'marraskuu', 'joulukuu'], - 'months_short' => ['tammi', 'helmi', 'maalis', 'huhti', 'touko', 'kesä', 'heinä', 'elo', 'syys', 'loka', 'marras', 'joulu'], - 'meridiem' => ['aamupäivä', 'iltapäivä'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fi_FI.php b/vendor/nesbot/carbon/src/Carbon/Lang/fi_FI.php deleted file mode 100644 index 920f1caa..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fi_FI.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/fi.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fil.php b/vendor/nesbot/carbon/src/Carbon/Lang/fil.php deleted file mode 100644 index 61114e3a..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fil.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/fil_PH.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fil_PH.php b/vendor/nesbot/carbon/src/Carbon/Lang/fil_PH.php deleted file mode 100644 index bcf15807..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fil_PH.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Rene Torres Rene Torres, Pablo Saratxaga rgtorre@rocketmail.com, pablo@mandrakesoft.com - * - Jaycee Mariano (alohajaycee) - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'MM/DD/YY', - ], - 'months' => ['Enero', 'Pebrero', 'Marso', 'Abril', 'Mayo', 'Hunyo', 'Hulyo', 'Agosto', 'Setyembre', 'Oktubre', 'Nobyembre', 'Disyembre'], - 'months_short' => ['Ene', 'Peb', 'Mar', 'Abr', 'May', 'Hun', 'Hul', 'Ago', 'Set', 'Okt', 'Nob', 'Dis'], - 'weekdays' => ['Linggo', 'Lunes', 'Martes', 'Miyerkoles', 'Huwebes', 'Biyernes', 'Sabado'], - 'weekdays_short' => ['Lin', 'Lun', 'Mar', 'Miy', 'Huw', 'Biy', 'Sab'], - 'weekdays_min' => ['Lin', 'Lun', 'Mar', 'Miy', 'Huw', 'Biy', 'Sab'], - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['N.U.', 'N.H.'], - - 'before' => ':time bago', - 'after' => ':time pagkatapos', - - 'year' => ':count taon', - 'y' => ':count taon', - 'a_year' => ':count taon', - - 'month' => ':count buwan', - 'm' => ':count buwan', - 'a_month' => ':count buwan', - - 'week' => ':count linggo', - 'w' => ':count linggo', - 'a_week' => ':count linggo', - - 'day' => ':count araw', - 'd' => ':count araw', - 'a_day' => ':count araw', - - 'hour' => ':count oras', - 'h' => ':count oras', - 'a_hour' => ':count oras', - - 'minute' => ':count minuto', - 'min' => ':count minuto', - 'a_minute' => ':count minuto', - - 'second' => ':count segundo', - 's' => ':count segundo', - 'a_second' => ':count segundo', - - 'ago' => ':time ang nakalipas', - 'from_now' => 'sa :time', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fo.php b/vendor/nesbot/carbon/src/Carbon/Lang/fo.php deleted file mode 100644 index 6a14a6fb..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fo.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Kristian Sakarisson - * - François B - * - JD Isaacks - * - Sverri Mohr Olsen - */ -return [ - 'year' => 'eitt ár|:count ár', - 'y' => ':count ár|:count ár', - 'month' => 'ein mánaði|:count mánaðir', - 'm' => ':count mánaður|:count mánaðir', - 'week' => ':count vika|:count vikur', - 'w' => ':count vika|:count vikur', - 'day' => 'ein dagur|:count dagar', - 'd' => ':count dag|:count dagar', - 'hour' => 'ein tími|:count tímar', - 'h' => ':count tími|:count tímar', - 'minute' => 'ein minutt|:count minuttir', - 'min' => ':count minutt|:count minuttir', - 'second' => 'fá sekund|:count sekundir', - 's' => ':count sekund|:count sekundir', - 'ago' => ':time síðani', - 'from_now' => 'um :time', - 'after' => ':time aftaná', - 'before' => ':time áðrenn', - 'diff_today' => 'Í', - 'diff_yesterday' => 'Í', - 'diff_yesterday_regexp' => 'Í(?:\\s+gjár)?(?:\\s+kl.)?', - 'diff_tomorrow' => 'Í', - 'diff_tomorrow_regexp' => 'Í(?:\\s+morgin)?(?:\\s+kl.)?', - 'diff_today_regexp' => 'Í(?:\\s+dag)?(?:\\s+kl.)?', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D. MMMM, YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[Í dag kl.] LT', - 'nextDay' => '[Í morgin kl.] LT', - 'nextWeek' => 'dddd [kl.] LT', - 'lastDay' => '[Í gjár kl.] LT', - 'lastWeek' => '[síðstu] dddd [kl] LT', - 'sameElse' => 'L', - ], - 'ordinal' => ':number.', - 'months' => ['januar', 'februar', 'mars', 'apríl', 'mai', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'desember'], - 'months_short' => ['jan', 'feb', 'mar', 'apr', 'mai', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'des'], - 'weekdays' => ['sunnudagur', 'mánadagur', 'týsdagur', 'mikudagur', 'hósdagur', 'fríggjadagur', 'leygardagur'], - 'weekdays_short' => ['sun', 'mán', 'týs', 'mik', 'hós', 'frí', 'ley'], - 'weekdays_min' => ['su', 'má', 'tý', 'mi', 'hó', 'fr', 'le'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' og '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fo_DK.php b/vendor/nesbot/carbon/src/Carbon/Lang/fo_DK.php deleted file mode 100644 index 657f2c5b..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fo_DK.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/fo.php', [ - 'formats' => [ - 'L' => 'DD.MM.yy', - 'LL' => 'DD.MM.YYYY', - 'LLL' => 'D. MMMM YYYY, HH:mm', - 'LLLL' => 'dddd, D. MMMM YYYY, HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fo_FO.php b/vendor/nesbot/carbon/src/Carbon/Lang/fo_FO.php deleted file mode 100644 index 6d736167..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fo_FO.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/fo.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr.php deleted file mode 100644 index f4c7247b..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr.php +++ /dev/null @@ -1,123 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Dieter Sting - * - François B - * - Maxime VALY - * - JD Isaacks - * - Dieter Sting - * - François B - * - JD Isaacks - * - Sebastian Thierer - * - Fastfuel - * - Pete Scopes (pdscopes) - */ -return [ - 'year' => ':count an|:count ans', - 'a_year' => 'un an|:count ans', - 'y' => ':count an|:count ans', - 'month' => ':count mois|:count mois', - 'a_month' => 'un mois|:count mois', - 'm' => ':count mois', - 'week' => ':count semaine|:count semaines', - 'a_week' => 'une semaine|:count semaines', - 'w' => ':count sem.', - 'day' => ':count jour|:count jours', - 'a_day' => 'un jour|:count jours', - 'd' => ':count j', - 'hour' => ':count heure|:count heures', - 'a_hour' => 'une heure|:count heures', - 'h' => ':count h', - 'minute' => ':count minute|:count minutes', - 'a_minute' => 'une minute|:count minutes', - 'min' => ':count min', - 'second' => ':count seconde|:count secondes', - 'a_second' => 'quelques secondes|:count secondes', - 's' => ':count s', - 'millisecond' => ':count milliseconde|:count millisecondes', - 'a_millisecond' => 'une milliseconde|:count millisecondes', - 'ms' => ':countms', - 'microsecond' => ':count microseconde|:count microsecondes', - 'a_microsecond' => 'une microseconde|:count microsecondes', - 'µs' => ':countµs', - 'ago' => 'il y a :time', - 'from_now' => 'dans :time', - 'after' => ':time après', - 'before' => ':time avant', - 'diff_now' => "à l'instant", - 'diff_today' => "aujourd'hui", - 'diff_today_regexp' => "aujourd'hui(?:\s+à)?", - 'diff_yesterday' => 'hier', - 'diff_yesterday_regexp' => 'hier(?:\s+à)?', - 'diff_tomorrow' => 'demain', - 'diff_tomorrow_regexp' => 'demain(?:\s+à)?', - 'diff_before_yesterday' => 'avant-hier', - 'diff_after_tomorrow' => 'après-demain', - 'period_recurrences' => ':count fois', - 'period_interval' => 'tous les :interval', - 'period_start_date' => 'de :date', - 'period_end_date' => 'à :date', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[Aujourd’hui à] LT', - 'nextDay' => '[Demain à] LT', - 'nextWeek' => 'dddd [à] LT', - 'lastDay' => '[Hier à] LT', - 'lastWeek' => 'dddd [dernier à] LT', - 'sameElse' => 'L', - ], - 'months' => ['janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre'], - 'months_short' => ['janv.', 'févr.', 'mars', 'avr.', 'mai', 'juin', 'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.'], - 'weekdays' => ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi'], - 'weekdays_short' => ['dim.', 'lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.'], - 'weekdays_min' => ['di', 'lu', 'ma', 'me', 'je', 've', 'sa'], - 'ordinal' => function ($number, $period) { - switch ($period) { - // In French, only the first has to be ordinal, other number remains cardinal - // @link https://fr.wikihow.com/%C3%A9crire-la-date-en-fran%C3%A7ais - case 'D': - return $number.($number === 1 ? 'er' : ''); - - default: - case 'M': - case 'Q': - case 'DDD': - case 'd': - return $number.($number === 1 ? 'er' : 'e'); - - // Words with feminine grammatical gender: semaine - case 'w': - case 'W': - return $number.($number === 1 ? 're' : 'e'); - } - }, - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' et '], - 'ordinal_words' => [ - 'of' => 'de', - 'first' => 'premier', - 'second' => 'deuxième', - 'third' => 'troisième', - 'fourth' => 'quatrième', - 'fifth' => 'cinquième', - 'last' => 'dernier', - ], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_BE.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_BE.php deleted file mode 100644 index f6cafe87..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_BE.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - RAP bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/fr.php', [ - 'months_short' => ['jan', 'fév', 'mar', 'avr', 'mai', 'jun', 'jui', 'aoû', 'sep', 'oct', 'nov', 'déc'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_BF.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_BF.php deleted file mode 100644 index ec3ee359..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_BF.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_BI.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_BI.php deleted file mode 100644 index ec3ee359..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_BI.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_BJ.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_BJ.php deleted file mode 100644 index ec3ee359..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_BJ.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_BL.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_BL.php deleted file mode 100644 index ec3ee359..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_BL.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_CA.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_CA.php deleted file mode 100644 index c9f6346f..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_CA.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Dieter Sting - * - François B - * - Maxime VALY - * - JD Isaacks - */ -return array_replace_recursive(require __DIR__.'/fr.php', [ - 'formats' => [ - 'L' => 'YYYY-MM-DD', - ], - 'first_day_of_week' => 0, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_CD.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_CD.php deleted file mode 100644 index ec3ee359..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_CD.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_CF.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_CF.php deleted file mode 100644 index ec3ee359..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_CF.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_CG.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_CG.php deleted file mode 100644 index ec3ee359..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_CG.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_CH.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_CH.php deleted file mode 100644 index 8674c27d..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_CH.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Dieter Sting - * - François B - * - Gaspard Bucher - * - Maxime VALY - * - JD Isaacks - */ -return array_replace_recursive(require __DIR__.'/fr.php', [ - 'formats' => [ - 'L' => 'DD.MM.YYYY', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_CI.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_CI.php deleted file mode 100644 index ec3ee359..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_CI.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_CM.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_CM.php deleted file mode 100644 index 67d37878..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_CM.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/fr.php', [ - 'meridiem' => ['mat.', 'soir'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_DJ.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_DJ.php deleted file mode 100644 index 2f060869..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_DJ.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/fr.php', [ - 'first_day_of_week' => 6, - 'formats' => [ - 'LT' => 'h:mm a', - 'LTS' => 'h:mm:ss a', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY h:mm a', - 'LLLL' => 'dddd D MMMM YYYY h:mm a', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_DZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_DZ.php deleted file mode 100644 index ae8db5fa..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_DZ.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/fr.php', [ - 'first_day_of_week' => 6, - 'weekend' => [5, 6], - 'formats' => [ - 'LT' => 'h:mm a', - 'LTS' => 'h:mm:ss a', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY h:mm a', - 'LLLL' => 'dddd D MMMM YYYY h:mm a', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_FR.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_FR.php deleted file mode 100644 index ec3ee359..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_FR.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_GA.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_GA.php deleted file mode 100644 index ec3ee359..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_GA.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_GF.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_GF.php deleted file mode 100644 index ec3ee359..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_GF.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_GN.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_GN.php deleted file mode 100644 index ec3ee359..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_GN.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_GP.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_GP.php deleted file mode 100644 index ec3ee359..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_GP.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_GQ.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_GQ.php deleted file mode 100644 index ec3ee359..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_GQ.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_HT.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_HT.php deleted file mode 100644 index ec3ee359..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_HT.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_KM.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_KM.php deleted file mode 100644 index ec3ee359..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_KM.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_LU.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_LU.php deleted file mode 100644 index 8e37d852..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_LU.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - RAP bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/fr.php', [ - 'formats' => [ - 'L' => 'DD.MM.YYYY', - ], - 'months_short' => ['jan', 'fév', 'mar', 'avr', 'mai', 'jun', 'jui', 'aoû', 'sep', 'oct', 'nov', 'déc'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MA.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_MA.php deleted file mode 100644 index 1bf034dc..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MA.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/fr.php', [ - 'first_day_of_week' => 6, - 'weekend' => [5, 6], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MC.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_MC.php deleted file mode 100644 index ec3ee359..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MC.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MF.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_MF.php deleted file mode 100644 index ec3ee359..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MF.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MG.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_MG.php deleted file mode 100644 index ec3ee359..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MG.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_ML.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_ML.php deleted file mode 100644 index ec3ee359..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_ML.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MQ.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_MQ.php deleted file mode 100644 index ec3ee359..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MQ.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MR.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_MR.php deleted file mode 100644 index 37cf83f0..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MR.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/fr.php', [ - 'formats' => [ - 'LT' => 'h:mm a', - 'LTS' => 'h:mm:ss a', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY h:mm a', - 'LLLL' => 'dddd D MMMM YYYY h:mm a', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MU.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_MU.php deleted file mode 100644 index ec3ee359..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MU.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_NC.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_NC.php deleted file mode 100644 index ec3ee359..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_NC.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_NE.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_NE.php deleted file mode 100644 index ec3ee359..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_NE.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_PF.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_PF.php deleted file mode 100644 index ec3ee359..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_PF.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_PM.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_PM.php deleted file mode 100644 index ec3ee359..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_PM.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_RE.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_RE.php deleted file mode 100644 index ec3ee359..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_RE.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_RW.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_RW.php deleted file mode 100644 index ec3ee359..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_RW.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_SC.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_SC.php deleted file mode 100644 index ec3ee359..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_SC.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_SN.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_SN.php deleted file mode 100644 index ec3ee359..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_SN.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_SY.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_SY.php deleted file mode 100644 index ae8db5fa..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_SY.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/fr.php', [ - 'first_day_of_week' => 6, - 'weekend' => [5, 6], - 'formats' => [ - 'LT' => 'h:mm a', - 'LTS' => 'h:mm:ss a', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY h:mm a', - 'LLLL' => 'dddd D MMMM YYYY h:mm a', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_TD.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_TD.php deleted file mode 100644 index 37cf83f0..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_TD.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/fr.php', [ - 'formats' => [ - 'LT' => 'h:mm a', - 'LTS' => 'h:mm:ss a', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY h:mm a', - 'LLLL' => 'dddd D MMMM YYYY h:mm a', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_TG.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_TG.php deleted file mode 100644 index ec3ee359..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_TG.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_TN.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_TN.php deleted file mode 100644 index 6905e7a8..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_TN.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/fr.php', [ - 'weekend' => [5, 6], - 'formats' => [ - 'LT' => 'h:mm a', - 'LTS' => 'h:mm:ss a', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY h:mm a', - 'LLLL' => 'dddd D MMMM YYYY h:mm a', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_VU.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_VU.php deleted file mode 100644 index 37cf83f0..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_VU.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/fr.php', [ - 'formats' => [ - 'LT' => 'h:mm a', - 'LTS' => 'h:mm:ss a', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY h:mm a', - 'LLLL' => 'dddd D MMMM YYYY h:mm a', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_WF.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_WF.php deleted file mode 100644 index ec3ee359..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_WF.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_YT.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_YT.php deleted file mode 100644 index ec3ee359..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_YT.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fur.php b/vendor/nesbot/carbon/src/Carbon/Lang/fur.php deleted file mode 100644 index 36c2564f..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fur.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/fur_IT.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fur_IT.php b/vendor/nesbot/carbon/src/Carbon/Lang/fur_IT.php deleted file mode 100644 index 0147a596..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fur_IT.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Pablo Saratxaga pablo@mandrakesoft.com - */ -return [ - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD. MM. YY', - 'LL' => 'DD di MMMM dal YYYY', - 'LLL' => 'DD di MMM HH:mm', - 'LLLL' => 'DD di MMMM dal YYYY HH:mm', - ], - 'months' => ['zenâr', 'fevrâr', 'març', 'avrîl', 'mai', 'jugn', 'lui', 'avost', 'setembar', 'otubar', 'novembar', 'dicembar'], - 'months_short' => ['zen', 'fev', 'mar', 'avr', 'mai', 'jug', 'lui', 'avo', 'set', 'otu', 'nov', 'dic'], - 'weekdays' => ['domenie', 'lunis', 'martars', 'miercus', 'joibe', 'vinars', 'sabide'], - 'weekdays_short' => ['dom', 'lun', 'mar', 'mie', 'joi', 'vin', 'sab'], - 'weekdays_min' => ['dom', 'lun', 'mar', 'mie', 'joi', 'vin', 'sab'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'year' => ':count an', - 'month' => ':count mês', - 'week' => ':count setemane', - 'day' => ':count zornade', - 'hour' => ':count ore', - 'minute' => ':count minût', - 'second' => ':count secont', -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fy.php b/vendor/nesbot/carbon/src/Carbon/Lang/fy.php deleted file mode 100644 index c1b54397..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fy.php +++ /dev/null @@ -1,76 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - François B - * - Tim Fish - * - JD Isaacks - */ -return [ - 'year' => ':count jier|:count jierren', - 'a_year' => 'ien jier|:count jierren', - 'y' => ':count j', - 'month' => ':count moanne|:count moannen', - 'a_month' => 'ien moanne|:count moannen', - 'm' => ':count moa.', - 'week' => ':count wike|:count wiken', - 'a_week' => 'in wike|:count wiken', - 'a' => ':count w.', - 'day' => ':count dei|:count dagen', - 'a_day' => 'ien dei|:count dagen', - 'd' => ':count d.', - 'hour' => ':count oere|:count oeren', - 'a_hour' => 'ien oere|:count oeren', - 'h' => ':count o.', - 'minute' => ':count minút|:count minuten', - 'a_minute' => 'ien minút|:count minuten', - 'min' => ':count min.', - 'second' => ':count sekonde|:count sekonden', - 'a_second' => 'in pear sekonden|:count sekonden', - 's' => ':count s.', - 'ago' => ':time lyn', - 'from_now' => 'oer :time', - 'diff_yesterday' => 'juster', - 'diff_yesterday_regexp' => 'juster(?:\\s+om)?', - 'diff_today' => 'hjoed', - 'diff_today_regexp' => 'hjoed(?:\\s+om)?', - 'diff_tomorrow' => 'moarn', - 'diff_tomorrow_regexp' => 'moarn(?:\\s+om)?', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD-MM-YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[hjoed om] LT', - 'nextDay' => '[moarn om] LT', - 'nextWeek' => 'dddd [om] LT', - 'lastDay' => '[juster om] LT', - 'lastWeek' => '[ôfrûne] dddd [om] LT', - 'sameElse' => 'L', - ], - 'ordinal' => function ($number) { - return $number.(($number === 1 || $number === 8 || $number >= 20) ? 'ste' : 'de'); - }, - 'months' => ['jannewaris', 'febrewaris', 'maart', 'april', 'maaie', 'juny', 'july', 'augustus', 'septimber', 'oktober', 'novimber', 'desimber'], - 'months_short' => ['jan', 'feb', 'mrt', 'apr', 'mai', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'des'], - 'mmm_suffix' => '.', - 'weekdays' => ['snein', 'moandei', 'tiisdei', 'woansdei', 'tongersdei', 'freed', 'sneon'], - 'weekdays_short' => ['si.', 'mo.', 'ti.', 'wo.', 'to.', 'fr.', 'so.'], - 'weekdays_min' => ['Si', 'Mo', 'Ti', 'Wo', 'To', 'Fr', 'So'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' en '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fy_DE.php b/vendor/nesbot/carbon/src/Carbon/Lang/fy_DE.php deleted file mode 100644 index 8559d5c2..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fy_DE.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - information from Kenneth Christiansen Kenneth Christiansen, Pablo Saratxaga kenneth@gnu.org, pablo@mandriva.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD.MM.YYYY', - ], - 'months' => ['Jaunuwoa', 'Februwoa', 'Moaz', 'Aprell', 'Mai', 'Juni', 'Juli', 'August', 'Septamba', 'Oktoba', 'Nowamba', 'Dezamba'], - 'months_short' => ['Jan', 'Feb', 'Moz', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Now', 'Dez'], - 'weekdays' => ['Sinndag', 'Mondag', 'Dingsdag', 'Meddwäakj', 'Donnadag', 'Friedag', 'Sinnowend'], - 'weekdays_short' => ['Sdg', 'Mdg', 'Dsg', 'Mwk', 'Ddg', 'Fdg', 'Swd'], - 'weekdays_min' => ['Sdg', 'Mdg', 'Dsg', 'Mwk', 'Ddg', 'Fdg', 'Swd'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fy_NL.php b/vendor/nesbot/carbon/src/Carbon/Lang/fy_NL.php deleted file mode 100644 index 01cc96c3..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fy_NL.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Free Software Foundation, Inc. bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/fy.php', [ - 'formats' => [ - 'L' => 'DD-MM-YY', - ], - 'months' => ['Jannewaris', 'Febrewaris', 'Maart', 'April', 'Maaie', 'Juny', 'July', 'Augustus', 'Septimber', 'Oktober', 'Novimber', 'Desimber'], - 'months_short' => ['Jan', 'Feb', 'Mrt', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Des'], - 'weekdays' => ['Snein', 'Moandei', 'Tiisdei', 'Woansdei', 'Tongersdei', 'Freed', 'Sneon'], - 'weekdays_short' => ['Sn', 'Mo', 'Ti', 'Wo', 'To', 'Fr', 'Sn'], - 'weekdays_min' => ['Sn', 'Mo', 'Ti', 'Wo', 'To', 'Fr', 'Sn'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ga.php b/vendor/nesbot/carbon/src/Carbon/Lang/ga.php deleted file mode 100644 index 9f07a26c..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ga.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Thanks to André Silva : https://github.com/askpt - */ - -return [ - 'year' => ':count bliain', - 'a_year' => '{1}bliain|:count bliain', - 'y' => ':countb', - 'month' => ':count mí', - 'a_month' => '{1}mí|:count mí', - 'm' => ':countm', - 'week' => ':count sheachtain', - 'a_week' => '{1}sheachtain|:count sheachtain', - 'w' => ':countsh', - 'day' => ':count lá', - 'a_day' => '{1}lá|:count lá', - 'd' => ':countl', - 'hour' => ':count uair an chloig', - 'a_hour' => '{1}uair an chloig|:count uair an chloig', - 'h' => ':countu', - 'minute' => ':count nóiméad', - 'a_minute' => '{1}nóiméad|:count nóiméad', - 'min' => ':countn', - 'second' => ':count soicind', - 'a_second' => '{1}cúpla soicind|:count soicind', - 's' => ':countso', - 'ago' => ':time ó shin', - 'from_now' => 'i :time', - 'after' => ':time tar éis', - 'before' => ':time roimh', - 'diff_now' => 'anois', - 'diff_today' => 'Inniu', - 'diff_today_regexp' => 'Inniu(?:\\s+ag)?', - 'diff_yesterday' => 'inné', - 'diff_yesterday_regexp' => 'Inné(?:\\s+aig)?', - 'diff_tomorrow' => 'amárach', - 'diff_tomorrow_regexp' => 'Amárach(?:\\s+ag)?', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[Inniu ag] LT', - 'nextDay' => '[Amárach ag] LT', - 'nextWeek' => 'dddd [ag] LT', - 'lastDay' => '[Inné aig] LT', - 'lastWeek' => 'dddd [seo caite] [ag] LT', - 'sameElse' => 'L', - ], - 'months' => ['Eanáir', 'Feabhra', 'Márta', 'Aibreán', 'Bealtaine', 'Méitheamh', 'Iúil', 'Lúnasa', 'Meán Fómhair', 'Deaireadh Fómhair', 'Samhain', 'Nollaig'], - 'months_short' => ['Eaná', 'Feab', 'Márt', 'Aibr', 'Beal', 'Méit', 'Iúil', 'Lúna', 'Meán', 'Deai', 'Samh', 'Noll'], - 'weekdays' => ['Dé Domhnaigh', 'Dé Luain', 'Dé Máirt', 'Dé Céadaoin', 'Déardaoin', 'Dé hAoine', 'Dé Satharn'], - 'weekdays_short' => ['Dom', 'Lua', 'Mái', 'Céa', 'Déa', 'hAo', 'Sat'], - 'weekdays_min' => ['Do', 'Lu', 'Má', 'Ce', 'Dé', 'hA', 'Sa'], - 'ordinal' => function ($number) { - return $number.($number === 1 ? 'd' : ($number % 10 === 2 ? 'na' : 'mh')); - }, - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' agus '], - 'meridiem' => ['r.n.', 'i.n.'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ga_IE.php b/vendor/nesbot/carbon/src/Carbon/Lang/ga_IE.php deleted file mode 100644 index 57b0c4fb..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ga_IE.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/ga.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gd.php b/vendor/nesbot/carbon/src/Carbon/Lang/gd.php deleted file mode 100644 index 63d064dd..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gd.php +++ /dev/null @@ -1,75 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - François B - * - Jon Ashdown - */ -return [ - 'year' => ':count bliadhna', - 'a_year' => '{1}bliadhna|:count bliadhna', - 'y' => ':count b.', - 'month' => ':count mìosan', - 'a_month' => '{1}mìos|:count mìosan', - 'm' => ':count ms.', - 'week' => ':count seachdainean', - 'a_week' => '{1}seachdain|:count seachdainean', - 'w' => ':count s.', - 'day' => ':count latha', - 'a_day' => '{1}latha|:count latha', - 'd' => ':count l.', - 'hour' => ':count uairean', - 'a_hour' => '{1}uair|:count uairean', - 'h' => ':count u.', - 'minute' => ':count mionaidean', - 'a_minute' => '{1}mionaid|:count mionaidean', - 'min' => ':count md.', - 'second' => ':count diogan', - 'a_second' => '{1}beagan diogan|:count diogan', - 's' => ':count d.', - 'ago' => 'bho chionn :time', - 'from_now' => 'ann an :time', - 'diff_yesterday' => 'An-dè', - 'diff_yesterday_regexp' => 'An-dè(?:\\s+aig)?', - 'diff_today' => 'An-diugh', - 'diff_today_regexp' => 'An-diugh(?:\\s+aig)?', - 'diff_tomorrow' => 'A-màireach', - 'diff_tomorrow_regexp' => 'A-màireach(?:\\s+aig)?', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[An-diugh aig] LT', - 'nextDay' => '[A-màireach aig] LT', - 'nextWeek' => 'dddd [aig] LT', - 'lastDay' => '[An-dè aig] LT', - 'lastWeek' => 'dddd [seo chaidh] [aig] LT', - 'sameElse' => 'L', - ], - 'ordinal' => function ($number) { - return $number.($number === 1 ? 'd' : ($number % 10 === 2 ? 'na' : 'mh')); - }, - 'months' => ['Am Faoilleach', 'An Gearran', 'Am Màrt', 'An Giblean', 'An Cèitean', 'An t-Ògmhios', 'An t-Iuchar', 'An Lùnastal', 'An t-Sultain', 'An Dàmhair', 'An t-Samhain', 'An Dùbhlachd'], - 'months_short' => ['Faoi', 'Gear', 'Màrt', 'Gibl', 'Cèit', 'Ògmh', 'Iuch', 'Lùn', 'Sult', 'Dàmh', 'Samh', 'Dùbh'], - 'weekdays' => ['Didòmhnaich', 'Diluain', 'Dimàirt', 'Diciadain', 'Diardaoin', 'Dihaoine', 'Disathairne'], - 'weekdays_short' => ['Did', 'Dil', 'Dim', 'Dic', 'Dia', 'Dih', 'Dis'], - 'weekdays_min' => ['Dò', 'Lu', 'Mà', 'Ci', 'Ar', 'Ha', 'Sa'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' agus '], - 'meridiem' => ['m', 'f'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gd_GB.php b/vendor/nesbot/carbon/src/Carbon/Lang/gd_GB.php deleted file mode 100644 index 4fc26b3d..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gd_GB.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/gd.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gez.php b/vendor/nesbot/carbon/src/Carbon/Lang/gez.php deleted file mode 100644 index b8a2f0eb..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gez.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/gez_ER.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gez_ER.php b/vendor/nesbot/carbon/src/Carbon/Lang/gez_ER.php deleted file mode 100644 index f19d1df1..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gez_ER.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Ge'ez Frontier Foundation locales@geez.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YYYY', - ], - 'months' => ['ጠሐረ', 'ከተተ', 'መገበ', 'አኀዘ', 'ግንባት', 'ሠንየ', 'ሐመለ', 'ነሐሰ', 'ከረመ', 'ጠቀመ', 'ኀደረ', 'ኀሠሠ'], - 'months_short' => ['ጠሐረ', 'ከተተ', 'መገበ', 'አኀዘ', 'ግንባ', 'ሠንየ', 'ሐመለ', 'ነሐሰ', 'ከረመ', 'ጠቀመ', 'ኀደረ', 'ኀሠሠ'], - 'weekdays' => ['እኁድ', 'ሰኑይ', 'ሠሉስ', 'ራብዕ', 'ሐሙስ', 'ዓርበ', 'ቀዳሚት'], - 'weekdays_short' => ['እኁድ', 'ሰኑይ', 'ሠሉስ', 'ራብዕ', 'ሐሙስ', 'ዓርበ', 'ቀዳሚ'], - 'weekdays_min' => ['እኁድ', 'ሰኑይ', 'ሠሉስ', 'ራብዕ', 'ሐሙስ', 'ዓርበ', 'ቀዳሚ'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['ጽባሕ', 'ምሴት'], - - 'month' => ':count ወርሕ', // less reliable - 'm' => ':count ወርሕ', // less reliable - 'a_month' => ':count ወርሕ', // less reliable - - 'week' => ':count ሰብዑ', // less reliable - 'w' => ':count ሰብዑ', // less reliable - 'a_week' => ':count ሰብዑ', // less reliable - - 'hour' => ':count አንትሙ', // less reliable - 'h' => ':count አንትሙ', // less reliable - 'a_hour' => ':count አንትሙ', // less reliable - - 'minute' => ':count ንኡስ', // less reliable - 'min' => ':count ንኡስ', // less reliable - 'a_minute' => ':count ንኡስ', // less reliable - - 'year' => ':count ዓመት', - 'y' => ':count ዓመት', - 'a_year' => ':count ዓመት', - - 'day' => ':count ዕለት', - 'd' => ':count ዕለት', - 'a_day' => ':count ዕለት', - - 'second' => ':count ካልእ', - 's' => ':count ካልእ', - 'a_second' => ':count ካልእ', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gez_ET.php b/vendor/nesbot/carbon/src/Carbon/Lang/gez_ET.php deleted file mode 100644 index 39330096..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gez_ET.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Ge'ez Frontier Foundation locales@geez.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YYYY', - ], - 'months' => ['ጃንዩወሪ', 'ፌብሩወሪ', 'ማርች', 'ኤፕረል', 'ሜይ', 'ጁን', 'ጁላይ', 'ኦገስት', 'ሴፕቴምበር', 'ኦክተውበር', 'ኖቬምበር', 'ዲሴምበር'], - 'months_short' => ['ጃንዩ', 'ፌብሩ', 'ማርች', 'ኤፕረ', 'ሜይ ', 'ጁን ', 'ጁላይ', 'ኦገስ', 'ሴፕቴ', 'ኦክተ', 'ኖቬም', 'ዲሴም'], - 'weekdays' => ['እኁድ', 'ሰኑይ', 'ሠሉስ', 'ራብዕ', 'ሐሙስ', 'ዓርበ', 'ቀዳሚት'], - 'weekdays_short' => ['እኁድ', 'ሰኑይ', 'ሠሉስ', 'ራብዕ', 'ሐሙስ', 'ዓርበ', 'ቀዳሚ'], - 'weekdays_min' => ['እኁድ', 'ሰኑይ', 'ሠሉስ', 'ራብዕ', 'ሐሙስ', 'ዓርበ', 'ቀዳሚ'], - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['ጽባሕ', 'ምሴት'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gl.php b/vendor/nesbot/carbon/src/Carbon/Lang/gl.php deleted file mode 100644 index 088b0f28..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gl.php +++ /dev/null @@ -1,98 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - François B - * - Fidel Pita - * - JD Isaacks - * - Diego Vilariño - * - Sebastian Thierer - */ - -use Carbon\CarbonInterface; - -return [ - 'year' => ':count ano|:count anos', - 'a_year' => 'un ano|:count anos', - 'y' => ':count a.', - 'month' => ':count mes|:count meses', - 'a_month' => 'un mes|:count meses', - 'm' => ':count mes.', - 'week' => ':count semana|:count semanas', - 'a_week' => 'unha semana|:count semanas', - 'w' => ':count sem.', - 'day' => ':count día|:count días', - 'a_day' => 'un día|:count días', - 'd' => ':count d.', - 'hour' => ':count hora|:count horas', - 'a_hour' => 'unha hora|:count horas', - 'h' => ':count h.', - 'minute' => ':count minuto|:count minutos', - 'a_minute' => 'un minuto|:count minutos', - 'min' => ':count min.', - 'second' => ':count segundo|:count segundos', - 'a_second' => 'uns segundos|:count segundos', - 's' => ':count seg.', - 'ago' => 'hai :time', - 'from_now' => function ($time) { - if (str_starts_with($time, 'un')) { - return "n$time"; - } - - return "en $time"; - }, - 'diff_now' => 'agora', - 'diff_today' => 'hoxe', - 'diff_today_regexp' => 'hoxe(?:\\s+ás)?', - 'diff_yesterday' => 'onte', - 'diff_yesterday_regexp' => 'onte(?:\\s+á)?', - 'diff_tomorrow' => 'mañá', - 'diff_tomorrow_regexp' => 'mañá(?:\\s+ás)?', - 'after' => ':time despois', - 'before' => ':time antes', - 'formats' => [ - 'LT' => 'H:mm', - 'LTS' => 'H:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D [de] MMMM [de] YYYY', - 'LLL' => 'D [de] MMMM [de] YYYY H:mm', - 'LLLL' => 'dddd, D [de] MMMM [de] YYYY H:mm', - ], - 'calendar' => [ - 'sameDay' => function (CarbonInterface $current) { - return '[hoxe '.($current->hour !== 1 ? 'ás' : 'á').'] LT'; - }, - 'nextDay' => function (CarbonInterface $current) { - return '[mañá '.($current->hour !== 1 ? 'ás' : 'á').'] LT'; - }, - 'nextWeek' => function (CarbonInterface $current) { - return 'dddd ['.($current->hour !== 1 ? 'ás' : 'á').'] LT'; - }, - 'lastDay' => function (CarbonInterface $current) { - return '[onte '.($current->hour !== 1 ? 'á' : 'a').'] LT'; - }, - 'lastWeek' => function (CarbonInterface $current) { - return '[o] dddd [pasado '.($current->hour !== 1 ? 'ás' : 'á').'] LT'; - }, - 'sameElse' => 'L', - ], - 'ordinal' => ':numberº', - 'months' => ['xaneiro', 'febreiro', 'marzo', 'abril', 'maio', 'xuño', 'xullo', 'agosto', 'setembro', 'outubro', 'novembro', 'decembro'], - 'months_short' => ['xan.', 'feb.', 'mar.', 'abr.', 'mai.', 'xuñ.', 'xul.', 'ago.', 'set.', 'out.', 'nov.', 'dec.'], - 'weekdays' => ['domingo', 'luns', 'martes', 'mércores', 'xoves', 'venres', 'sábado'], - 'weekdays_short' => ['dom.', 'lun.', 'mar.', 'mér.', 'xov.', 'ven.', 'sáb.'], - 'weekdays_min' => ['do', 'lu', 'ma', 'mé', 'xo', 've', 'sá'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' e '], - 'meridiem' => ['a.m.', 'p.m.'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gl_ES.php b/vendor/nesbot/carbon/src/Carbon/Lang/gl_ES.php deleted file mode 100644 index 9d6c1d96..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gl_ES.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/gl.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gom.php b/vendor/nesbot/carbon/src/Carbon/Lang/gom.php deleted file mode 100644 index 2a0584f8..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gom.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/gom_Latn.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gom_Latn.php b/vendor/nesbot/carbon/src/Carbon/Lang/gom_Latn.php deleted file mode 100644 index 612bb886..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gom_Latn.php +++ /dev/null @@ -1,79 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return [ - 'year' => ':count voros|:count vorsam', - 'y' => ':countv', - 'month' => ':count mhoino|:count mhoine', - 'm' => ':countmh', - 'week' => ':count satolleacho|:count satolleache', - 'w' => ':countsa|:countsa', - 'day' => ':count dis', - 'd' => ':countd', - 'hour' => ':count hor|:count horam', - 'h' => ':counth', - 'minute' => ':count minute|:count mintam', - 'min' => ':countm', - 'second' => ':count second', - 's' => ':counts', - - 'diff_today' => 'Aiz', - 'diff_yesterday' => 'Kal', - 'diff_tomorrow' => 'Faleam', - 'formats' => [ - 'LT' => 'A h:mm [vazta]', - 'LTS' => 'A h:mm:ss [vazta]', - 'L' => 'DD-MM-YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY A h:mm [vazta]', - 'LLLL' => 'dddd, MMMM[achea] Do, YYYY, A h:mm [vazta]', - 'llll' => 'ddd, D MMM YYYY, A h:mm [vazta]', - ], - - 'calendar' => [ - 'sameDay' => '[Aiz] LT', - 'nextDay' => '[Faleam] LT', - 'nextWeek' => '[Ieta to] dddd[,] LT', - 'lastDay' => '[Kal] LT', - 'lastWeek' => '[Fatlo] dddd[,] LT', - 'sameElse' => 'L', - ], - - 'months' => ['Janer', 'Febrer', 'Mars', 'Abril', 'Mai', 'Jun', 'Julai', 'Agost', 'Setembr', 'Otubr', 'Novembr', 'Dezembr'], - 'months_short' => ['Jan.', 'Feb.', 'Mars', 'Abr.', 'Mai', 'Jun', 'Jul.', 'Ago.', 'Set.', 'Otu.', 'Nov.', 'Dez.'], - 'weekdays' => ['Aitar', 'Somar', 'Mongllar', 'Budvar', 'Brestar', 'Sukrar', 'Son\'var'], - 'weekdays_short' => ['Ait.', 'Som.', 'Mon.', 'Bud.', 'Bre.', 'Suk.', 'Son.'], - 'weekdays_min' => ['Ai', 'Sm', 'Mo', 'Bu', 'Br', 'Su', 'Sn'], - - 'ordinal' => function ($number, $period) { - return $number.($period === 'D' ? 'er' : ''); - }, - - 'meridiem' => function ($hour) { - if ($hour < 4) { - return 'rati'; - } - if ($hour < 12) { - return 'sokalli'; - } - if ($hour < 16) { - return 'donparam'; - } - if ($hour < 20) { - return 'sanje'; - } - - return 'rati'; - }, - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' ani '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gsw.php b/vendor/nesbot/carbon/src/Carbon/Lang/gsw.php deleted file mode 100644 index c5c850ed..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gsw.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Christopher Dell - * - Akira Matsuda - * - Enrique Vidal - * - Simone Carletti - * - Henning Kiel - * - Aaron Patterson - * - Florian Hanke - */ -return [ - 'year' => ':count Johr', - 'month' => ':count Monet', - 'week' => ':count Woche', - 'day' => ':count Tag', - 'hour' => ':count Schtund', - 'minute' => ':count Minute', - 'second' => ':count Sekunde', - 'weekdays' => ['Sunntig', 'Mäntig', 'Ziischtig', 'Mittwuch', 'Dunschtig', 'Friitig', 'Samschtig'], - 'weekdays_short' => ['Su', 'Mä', 'Zi', 'Mi', 'Du', 'Fr', 'Sa'], - 'weekdays_min' => ['Su', 'Mä', 'Zi', 'Mi', 'Du', 'Fr', 'Sa'], - 'months' => ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'Auguscht', 'September', 'Oktober', 'November', 'Dezember'], - 'months_short' => ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'], - 'meridiem' => ['am Vormittag', 'am Namittag'], - 'ordinal' => ':number.', - 'list' => [', ', ' und '], - 'diff_now' => 'now', - 'diff_yesterday' => 'geschter', - 'diff_tomorrow' => 'moorn', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD.MM.YYYY', - 'LL' => 'Do MMMM YYYY', - 'LLL' => 'Do MMMM, HH:mm [Uhr]', - 'LLLL' => 'dddd, Do MMMM YYYY, HH:mm [Uhr]', - ], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gsw_CH.php b/vendor/nesbot/carbon/src/Carbon/Lang/gsw_CH.php deleted file mode 100644 index 594eb25d..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gsw_CH.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/gsw.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gsw_FR.php b/vendor/nesbot/carbon/src/Carbon/Lang/gsw_FR.php deleted file mode 100644 index 3581dcfb..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gsw_FR.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/gsw.php', [ - 'meridiem' => ['vorm.', 'nam.'], - 'months' => ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'Auguscht', 'Septämber', 'Oktoober', 'Novämber', 'Dezämber'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LLL' => 'Do MMMM YYYY HH:mm', - 'LLLL' => 'dddd, Do MMMM YYYY HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gsw_LI.php b/vendor/nesbot/carbon/src/Carbon/Lang/gsw_LI.php deleted file mode 100644 index 3581dcfb..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gsw_LI.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/gsw.php', [ - 'meridiem' => ['vorm.', 'nam.'], - 'months' => ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'Auguscht', 'Septämber', 'Oktoober', 'Novämber', 'Dezämber'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LLL' => 'Do MMMM YYYY HH:mm', - 'LLLL' => 'dddd, Do MMMM YYYY HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gu.php b/vendor/nesbot/carbon/src/Carbon/Lang/gu.php deleted file mode 100644 index 8bc43114..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gu.php +++ /dev/null @@ -1,82 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Josh Soref - * - Kaushik Thanki - * - Josh Soref - */ -return [ - 'year' => 'એક વર્ષ|:count વર્ષ', - 'y' => ':countવર્ષ|:countવર્ષો', - 'month' => 'એક મહિનો|:count મહિના', - 'm' => ':countમહિનો|:countમહિના', - 'week' => ':count અઠવાડિયું|:count અઠવાડિયા', - 'w' => ':countઅઠ.|:countઅઠ.', - 'day' => 'એક દિવસ|:count દિવસ', - 'd' => ':countદિ.|:countદિ.', - 'hour' => 'એક કલાક|:count કલાક', - 'h' => ':countક.|:countક.', - 'minute' => 'એક મિનિટ|:count મિનિટ', - 'min' => ':countમિ.|:countમિ.', - 'second' => 'અમુક પળો|:count સેકંડ', - 's' => ':countસે.|:countસે.', - 'ago' => ':time પેહલા', - 'from_now' => ':time મા', - 'after' => ':time પછી', - 'before' => ':time પહેલા', - 'diff_now' => 'હમણાં', - 'diff_today' => 'આજ', - 'diff_yesterday' => 'ગઇકાલે', - 'diff_tomorrow' => 'કાલે', - 'formats' => [ - 'LT' => 'A h:mm વાગ્યે', - 'LTS' => 'A h:mm:ss વાગ્યે', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY, A h:mm વાગ્યે', - 'LLLL' => 'dddd, D MMMM YYYY, A h:mm વાગ્યે', - ], - 'calendar' => [ - 'sameDay' => '[આજ] LT', - 'nextDay' => '[કાલે] LT', - 'nextWeek' => 'dddd, LT', - 'lastDay' => '[ગઇકાલે] LT', - 'lastWeek' => '[પાછલા] dddd, LT', - 'sameElse' => 'L', - ], - 'meridiem' => function ($hour) { - if ($hour < 4) { - return 'રાત'; - } - if ($hour < 10) { - return 'સવાર'; - } - if ($hour < 17) { - return 'બપોર'; - } - if ($hour < 20) { - return 'સાંજ'; - } - - return 'રાત'; - }, - 'months' => ['જાન્યુઆરી', 'ફેબ્રુઆરી', 'માર્ચ', 'એપ્રિલ', 'મે', 'જૂન', 'જુલાઈ', 'ઑગસ્ટ', 'સપ્ટેમ્બર', 'ઑક્ટ્બર', 'નવેમ્બર', 'ડિસેમ્બર'], - 'months_short' => ['જાન્યુ.', 'ફેબ્રુ.', 'માર્ચ', 'એપ્રિ.', 'મે', 'જૂન', 'જુલા.', 'ઑગ.', 'સપ્ટે.', 'ઑક્ટ્.', 'નવે.', 'ડિસે.'], - 'weekdays' => ['રવિવાર', 'સોમવાર', 'મંગળવાર', 'બુધ્વાર', 'ગુરુવાર', 'શુક્રવાર', 'શનિવાર'], - 'weekdays_short' => ['રવિ', 'સોમ', 'મંગળ', 'બુધ્', 'ગુરુ', 'શુક્ર', 'શનિ'], - 'weekdays_min' => ['ર', 'સો', 'મં', 'બુ', 'ગુ', 'શુ', 'શ'], - 'list' => [', ', ' અને '], - 'first_day_of_week' => 0, - 'day_of_first_week_of_year' => 1, - 'weekend' => [0, 0], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gu_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/gu_IN.php deleted file mode 100644 index 02654b1f..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gu_IN.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/gu.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/guz.php b/vendor/nesbot/carbon/src/Carbon/Lang/guz.php deleted file mode 100644 index 6230165c..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/guz.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['Ma', 'Mo'], - 'weekdays' => ['Chumapiri', 'Chumatato', 'Chumaine', 'Chumatano', 'Aramisi', 'Ichuma', 'Esabato'], - 'weekdays_short' => ['Cpr', 'Ctt', 'Cmn', 'Cmt', 'Ars', 'Icm', 'Est'], - 'weekdays_min' => ['Cpr', 'Ctt', 'Cmn', 'Cmt', 'Ars', 'Icm', 'Est'], - 'months' => ['Chanuari', 'Feburari', 'Machi', 'Apiriri', 'Mei', 'Juni', 'Chulai', 'Agosti', 'Septemba', 'Okitoba', 'Nobemba', 'Disemba'], - 'months_short' => ['Can', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Cul', 'Agt', 'Sep', 'Okt', 'Nob', 'Dis'], - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], - - 'month' => ':count omotunyi', // less reliable - 'm' => ':count omotunyi', // less reliable - 'a_month' => ':count omotunyi', // less reliable - - 'week' => ':count isano naibere', // less reliable - 'w' => ':count isano naibere', // less reliable - 'a_week' => ':count isano naibere', // less reliable - - 'second' => ':count ibere', // less reliable - 's' => ':count ibere', // less reliable - 'a_second' => ':count ibere', // less reliable - - 'year' => ':count omwaka', - 'y' => ':count omwaka', - 'a_year' => ':count omwaka', - - 'day' => ':count rituko', - 'd' => ':count rituko', - 'a_day' => ':count rituko', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gv.php b/vendor/nesbot/carbon/src/Carbon/Lang/gv.php deleted file mode 100644 index 7c52b940..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gv.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/gv_GB.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gv_GB.php b/vendor/nesbot/carbon/src/Carbon/Lang/gv_GB.php deleted file mode 100644 index 6b1168f9..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gv_GB.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Alastair McKinstry bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YY', - ], - 'months' => ['Jerrey-geuree', 'Toshiaght-arree', 'Mayrnt', 'Averil', 'Boaldyn', 'Mean-souree', 'Jerrey-souree', 'Luanistyn', 'Mean-fouyir', 'Jerrey-fouyir', 'Mee Houney', 'Mee ny Nollick'], - 'months_short' => ['J-guer', 'T-arree', 'Mayrnt', 'Avrril', 'Boaldyn', 'M-souree', 'J-souree', 'Luanistyn', 'M-fouyir', 'J-fouyir', 'M.Houney', 'M.Nollick'], - 'weekdays' => ['Jedoonee', 'Jelhein', 'Jemayrt', 'Jercean', 'Jerdein', 'Jeheiney', 'Jesarn'], - 'weekdays_short' => ['Jed', 'Jel', 'Jem', 'Jerc', 'Jerd', 'Jeh', 'Jes'], - 'weekdays_min' => ['Jed', 'Jel', 'Jem', 'Jerc', 'Jerd', 'Jeh', 'Jes'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - - 'year' => ':count blein', - 'y' => ':count blein', - 'a_year' => ':count blein', - - 'month' => ':count mee', - 'm' => ':count mee', - 'a_month' => ':count mee', - - 'week' => ':count shiaghtin', - 'w' => ':count shiaghtin', - 'a_week' => ':count shiaghtin', - - 'day' => ':count laa', - 'd' => ':count laa', - 'a_day' => ':count laa', - - 'hour' => ':count oor', - 'h' => ':count oor', - 'a_hour' => ':count oor', - - 'minute' => ':count feer veg', - 'min' => ':count feer veg', - 'a_minute' => ':count feer veg', - - 'second' => ':count derrey', - 's' => ':count derrey', - 'a_second' => ':count derrey', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ha.php b/vendor/nesbot/carbon/src/Carbon/Lang/ha.php deleted file mode 100644 index cd8e34d0..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ha.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - pablo@mandriva.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'D/M/YYYY', - 'LL' => 'D MMM, YYYY', - 'LLL' => 'D MMMM, YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM, YYYY HH:mm', - ], - 'months' => ['Janairu', 'Faburairu', 'Maris', 'Afirilu', 'Mayu', 'Yuni', 'Yuli', 'Agusta', 'Satumba', 'Oktoba', 'Nuwamba', 'Disamba'], - 'months_short' => ['Jan', 'Fab', 'Mar', 'Afi', 'May', 'Yun', 'Yul', 'Agu', 'Sat', 'Okt', 'Nuw', 'Dis'], - 'weekdays' => ['Lahadi', 'Litini', 'Talata', 'Laraba', 'Alhamis', 'Jumaʼa', 'Asabar'], - 'weekdays_short' => ['Lah', 'Lit', 'Tal', 'Lar', 'Alh', 'Jum', 'Asa'], - 'weekdays_min' => ['Lh', 'Li', 'Ta', 'Lr', 'Al', 'Ju', 'As'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - - 'year' => 'shekara :count', - 'y' => 'shekara :count', - 'a_year' => 'shekara :count', - - 'month' => ':count wátàa', - 'm' => ':count wátàa', - 'a_month' => ':count wátàa', - - 'week' => ':count mako', - 'w' => ':count mako', - 'a_week' => ':count mako', - - 'day' => ':count rana', - 'd' => ':count rana', - 'a_day' => ':count rana', - - 'hour' => ':count áwàa', - 'h' => ':count áwàa', - 'a_hour' => ':count áwàa', - - 'minute' => 'minti :count', - 'min' => 'minti :count', - 'a_minute' => 'minti :count', - - 'second' => ':count ná bíyú', - 's' => ':count ná bíyú', - 'a_second' => ':count ná bíyú', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ha_GH.php b/vendor/nesbot/carbon/src/Carbon/Lang/ha_GH.php deleted file mode 100644 index f9f99a73..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ha_GH.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/ha.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ha_NE.php b/vendor/nesbot/carbon/src/Carbon/Lang/ha_NE.php deleted file mode 100644 index f9f99a73..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ha_NE.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/ha.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ha_NG.php b/vendor/nesbot/carbon/src/Carbon/Lang/ha_NG.php deleted file mode 100644 index f9f99a73..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ha_NG.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/ha.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/hak.php b/vendor/nesbot/carbon/src/Carbon/Lang/hak.php deleted file mode 100644 index 6c3260e8..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/hak.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/hak_TW.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/hak_TW.php b/vendor/nesbot/carbon/src/Carbon/Lang/hak_TW.php deleted file mode 100644 index fe239865..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/hak_TW.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'YYYY年MM月DD日', - ], - 'months' => ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], - 'months_short' => [' 1月', ' 2月', ' 3月', ' 4月', ' 5月', ' 6月', ' 7月', ' 8月', ' 9月', '10月', '11月', '12月'], - 'weekdays' => ['禮拜日', '禮拜一', '禮拜二', '禮拜三', '禮拜四', '禮拜五', '禮拜六'], - 'weekdays_short' => ['日', '一', '二', '三', '四', '五', '六'], - 'weekdays_min' => ['日', '一', '二', '三', '四', '五', '六'], - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['上晝', '下晝'], - - 'year' => ':count ngien11', - 'y' => ':count ngien11', - 'a_year' => ':count ngien11', - - 'month' => ':count ngie̍t', - 'm' => ':count ngie̍t', - 'a_month' => ':count ngie̍t', - - 'week' => ':count lî-pai', - 'w' => ':count lî-pai', - 'a_week' => ':count lî-pai', - - 'day' => ':count ngit', - 'd' => ':count ngit', - 'a_day' => ':count ngit', - - 'hour' => ':count sṳ̀', - 'h' => ':count sṳ̀', - 'a_hour' => ':count sṳ̀', - - 'minute' => ':count fûn', - 'min' => ':count fûn', - 'a_minute' => ':count fûn', - - 'second' => ':count miéu', - 's' => ':count miéu', - 'a_second' => ':count miéu', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/haw.php b/vendor/nesbot/carbon/src/Carbon/Lang/haw.php deleted file mode 100644 index cdd36861..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/haw.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'months' => ['Ianuali', 'Pepeluali', 'Malaki', 'ʻApelila', 'Mei', 'Iune', 'Iulai', 'ʻAukake', 'Kepakemapa', 'ʻOkakopa', 'Nowemapa', 'Kekemapa'], - 'months_short' => ['Ian.', 'Pep.', 'Mal.', 'ʻAp.', 'Mei', 'Iun.', 'Iul.', 'ʻAu.', 'Kep.', 'ʻOk.', 'Now.', 'Kek.'], - 'weekdays' => ['Lāpule', 'Poʻakahi', 'Poʻalua', 'Poʻakolu', 'Poʻahā', 'Poʻalima', 'Poʻaono'], - 'weekdays_short' => ['LP', 'P1', 'P2', 'P3', 'P4', 'P5', 'P6'], - 'weekdays_min' => ['S', 'M', 'T', 'W', 'T', 'F', 'S'], - 'formats' => [ - 'LT' => 'h:mm a', - 'LTS' => 'h:mm:ss a', - 'L' => 'D/M/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY h:mm a', - 'LLLL' => 'dddd, D MMMM YYYY h:mm a', - ], - - 'year' => ':count makahiki', - 'y' => ':count makahiki', - 'a_year' => ':count makahiki', - - 'month' => ':count mahina', - 'm' => ':count mahina', - 'a_month' => ':count mahina', - - 'week' => ':count pule', - 'w' => ':count pule', - 'a_week' => ':count pule', - - 'day' => ':count lā', - 'd' => ':count lā', - 'a_day' => ':count lā', - - 'hour' => ':count hola', - 'h' => ':count hola', - 'a_hour' => ':count hola', - - 'minute' => ':count minuke', - 'min' => ':count minuke', - 'a_minute' => ':count minuke', - - 'second' => ':count lua', - 's' => ':count lua', - 'a_second' => ':count lua', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/he.php b/vendor/nesbot/carbon/src/Carbon/Lang/he.php deleted file mode 100644 index c3fb3e97..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/he.php +++ /dev/null @@ -1,86 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Daniel Cohen Gindi - * - JD Isaacks - * - Itai Nathaniel - * - GabMic - * - Yaakov Dahan (yakidahan) - */ -return [ - 'year' => 'שנה|{2}שנתיים|:count שנים', - 'y' => 'שנה|:count שנ׳', - 'month' => 'חודש|{2}חודשיים|:count חודשים', - 'm' => 'חודש|:count חו׳', - 'week' => 'שבוע|{2}שבועיים|:count שבועות', - 'w' => 'שבוע|:count שב׳', - 'day' => 'יום|{2}יומיים|:count ימים', - 'd' => 'יום|:count ימ׳', - 'hour' => 'שעה|{2}שעתיים|:count שעות', - 'h' => 'שעה|:count שע׳', - 'minute' => 'דקה|{2}שתי דקות|:count דקות', - 'min' => 'דקה|:count דק׳', - 'second' => 'שנייה|:count שניות', - 'a_second' => 'כמה שניות|:count שניות', - 's' => 'שניה|:count שנ׳', - 'ago' => 'לפני :time', - 'from_now' => 'בעוד :time מעכשיו', - 'after' => 'אחרי :time', - 'before' => 'לפני :time', - 'diff_now' => 'עכשיו', - 'diff_today' => 'היום', - 'diff_today_regexp' => 'היום(?:\\s+ב־)?', - 'diff_yesterday' => 'אתמול', - 'diff_yesterday_regexp' => 'אתמול(?:\\s+ב־)?', - 'diff_tomorrow' => 'מחר', - 'diff_tomorrow_regexp' => 'מחר(?:\\s+ב־)?', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D [ב]MMMM YYYY', - 'LLL' => 'D [ב]MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D [ב]MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[היום ב־]LT', - 'nextDay' => '[מחר ב־]LT', - 'nextWeek' => 'dddd [בשעה] LT', - 'lastDay' => '[אתמול ב־]LT', - 'lastWeek' => '[ביום] dddd [האחרון בשעה] LT', - 'sameElse' => 'L', - ], - 'meridiem' => function ($hour, $minute, $isLower) { - if ($hour < 5) { - return 'לפנות בוקר'; - } - if ($hour < 10) { - return 'בבוקר'; - } - if ($hour < 12) { - return $isLower ? 'לפנה"צ' : 'לפני הצהריים'; - } - if ($hour < 18) { - return $isLower ? 'אחה"צ' : 'אחרי הצהריים'; - } - - return 'בערב'; - }, - 'months' => ['ינואר', 'פברואר', 'מרץ', 'אפריל', 'מאי', 'יוני', 'יולי', 'אוגוסט', 'ספטמבר', 'אוקטובר', 'נובמבר', 'דצמבר'], - 'months_short' => ['ינו׳', 'פבר׳', 'מרץ', 'אפר׳', 'מאי', 'יוני', 'יולי', 'אוג׳', 'ספט׳', 'אוק׳', 'נוב׳', 'דצמ׳'], - 'weekdays' => ['ראשון', 'שני', 'שלישי', 'רביעי', 'חמישי', 'שישי', 'שבת'], - 'weekdays_short' => ['א׳', 'ב׳', 'ג׳', 'ד׳', 'ה׳', 'ו׳', 'ש׳'], - 'weekdays_min' => ['א', 'ב', 'ג', 'ד', 'ה', 'ו', 'ש'], - 'list' => [', ', ' ו -'], - 'weekend' => [5, 6], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/he_IL.php b/vendor/nesbot/carbon/src/Carbon/Lang/he_IL.php deleted file mode 100644 index 14fab3e9..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/he_IL.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/he.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/hi.php b/vendor/nesbot/carbon/src/Carbon/Lang/hi.php deleted file mode 100644 index 70c57a29..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/hi.php +++ /dev/null @@ -1,82 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - abhimanyu003 - * - Josh Soref - * - JD Isaacks - */ -return [ - 'year' => 'एक वर्ष|:count वर्ष', - 'y' => '1 वर्ष|:count वर्षों', - 'month' => 'एक महीने|:count महीने', - 'm' => '1 माह|:count महीने', - 'week' => '1 सप्ताह|:count सप्ताह', - 'w' => '1 सप्ताह|:count सप्ताह', - 'day' => 'एक दिन|:count दिन', - 'd' => '1 दिन|:count दिनों', - 'hour' => 'एक घंटा|:count घंटे', - 'h' => '1 घंटा|:count घंटे', - 'minute' => 'एक मिनट|:count मिनट', - 'min' => '1 मिनट|:count मिनटों', - 'second' => 'कुछ ही क्षण|:count सेकंड', - 's' => '1 सेकंड|:count सेकंड', - 'ago' => ':time पहले', - 'from_now' => ':time में', - 'after' => ':time के बाद', - 'before' => ':time के पहले', - 'diff_now' => 'अब', - 'diff_today' => 'आज', - 'diff_yesterday' => 'कल', - 'diff_tomorrow' => 'कल', - 'formats' => [ - 'LT' => 'A h:mm बजे', - 'LTS' => 'A h:mm:ss बजे', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY, A h:mm बजे', - 'LLLL' => 'dddd, D MMMM YYYY, A h:mm बजे', - ], - 'calendar' => [ - 'sameDay' => '[आज] LT', - 'nextDay' => '[कल] LT', - 'nextWeek' => 'dddd, LT', - 'lastDay' => '[कल] LT', - 'lastWeek' => '[पिछले] dddd, LT', - 'sameElse' => 'L', - ], - 'meridiem' => function ($hour) { - if ($hour < 4) { - return 'रात'; - } - if ($hour < 10) { - return 'सुबह'; - } - if ($hour < 17) { - return 'दोपहर'; - } - if ($hour < 20) { - return 'शाम'; - } - - return 'रात'; - }, - 'months' => ['जनवरी', 'फ़रवरी', 'मार्च', 'अप्रैल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर'], - 'months_short' => ['जन.', 'फ़र.', 'मार्च', 'अप्रै.', 'मई', 'जून', 'जुल.', 'अग.', 'सित.', 'अक्टू.', 'नव.', 'दिस.'], - 'weekdays' => ['रविवार', 'सोमवार', 'मंगलवार', 'बुधवार', 'गुरूवार', 'शुक्रवार', 'शनिवार'], - 'weekdays_short' => ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरू', 'शुक्र', 'शनि'], - 'weekdays_min' => ['र', 'सो', 'मं', 'बु', 'गु', 'शु', 'श'], - 'list' => [', ', ' और '], - 'first_day_of_week' => 0, - 'day_of_first_week_of_year' => 1, - 'weekend' => [0, 0], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/hi_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/hi_IN.php deleted file mode 100644 index 749dd97c..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/hi_IN.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/hi.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/hif.php b/vendor/nesbot/carbon/src/Carbon/Lang/hif.php deleted file mode 100644 index 65791dd4..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/hif.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/hif_FJ.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/hif_FJ.php b/vendor/nesbot/carbon/src/Carbon/Lang/hif_FJ.php deleted file mode 100644 index 30ad5e74..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/hif_FJ.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Samsung Electronics Co., Ltd. akhilesh.k@samsung.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'dddd DD MMM YYYY', - ], - 'months' => ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], - 'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], - 'weekdays' => ['Ravivar', 'Somvar', 'Mangalvar', 'Budhvar', 'Guruvar', 'Shukravar', 'Shanivar'], - 'weekdays_short' => ['Ravi', 'Som', 'Mangal', 'Budh', 'Guru', 'Shukra', 'Shani'], - 'weekdays_min' => ['Ravi', 'Som', 'Mangal', 'Budh', 'Guru', 'Shukra', 'Shani'], - 'meridiem' => ['Purvahan', 'Aparaahna'], - - 'hour' => ':count minit', // less reliable - 'h' => ':count minit', // less reliable - 'a_hour' => ':count minit', // less reliable - - 'year' => ':count saal', - 'y' => ':count saal', - 'a_year' => ':count saal', - - 'month' => ':count Mahina', - 'm' => ':count Mahina', - 'a_month' => ':count Mahina', - - 'week' => ':count Hafta', - 'w' => ':count Hafta', - 'a_week' => ':count Hafta', - - 'day' => ':count Din', - 'd' => ':count Din', - 'a_day' => ':count Din', - - 'minute' => ':count Minit', - 'min' => ':count Minit', - 'a_minute' => ':count Minit', - - 'second' => ':count Second', - 's' => ':count Second', - 'a_second' => ':count Second', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/hne.php b/vendor/nesbot/carbon/src/Carbon/Lang/hne.php deleted file mode 100644 index 4bcb05c7..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/hne.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/hne_IN.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/hne_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/hne_IN.php deleted file mode 100644 index a5ca758b..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/hne_IN.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Red Hat, Pune bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'D/M/YY', - ], - 'months' => ['जनवरी', 'फरवरी', 'मार्च', 'अपरेल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितमबर', 'अकटूबर', 'नवमबर', 'दिसमबर'], - 'months_short' => ['जन', 'फर', 'मार्च', 'अप', 'मई', 'जून', 'जुला', 'अग', 'सित', 'अकटू', 'नव', 'दिस'], - 'weekdays' => ['इतवार', 'सोमवार', 'मंगलवार', 'बुधवार', 'बिरसपत', 'सुकरवार', 'सनिवार'], - 'weekdays_short' => ['इत', 'सोम', 'मंग', 'बुध', 'बिर', 'सुक', 'सनि'], - 'weekdays_min' => ['इत', 'सोम', 'मंग', 'बुध', 'बिर', 'सुक', 'सनि'], - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['बिहिनियाँ', 'मंझनियाँ'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/hr.php b/vendor/nesbot/carbon/src/Carbon/Lang/hr.php deleted file mode 100644 index cfd85fd4..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/hr.php +++ /dev/null @@ -1,111 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Josh Soref - * - François B - * - Tim Fish - * - shaishavgandhi05 - * - Serhan Apaydın - * - JD Isaacks - * - tomhorvat - * - Josh Soref - * - François B - * - shaishavgandhi05 - * - Serhan Apaydın - * - JD Isaacks - * - tomhorvat - * - Stjepan Majdak - * - Vanja Retkovac (vr00) - */ - -use Carbon\CarbonInterface; - -return [ - 'year' => ':count godinu|:count godine|:count godina', - 'y' => ':count god.|:count god.|:count god.', - 'month' => ':count mjesec|:count mjeseca|:count mjeseci', - 'm' => ':count mj.|:count mj.|:count mj.', - 'week' => ':count tjedan|:count tjedna|:count tjedana', - 'w' => ':count tj.|:count tj.|:count tj.', - 'day' => ':count dan|:count dana|:count dana', - 'd' => ':count d.|:count d.|:count d.', - 'hour' => ':count sat|:count sata|:count sati', - 'h' => ':count sat|:count sata|:count sati', - 'minute' => ':count minutu|:count minute|:count minuta', - 'min' => ':count min.|:count min.|:count min.', - 'second' => ':count sekundu|:count sekunde|:count sekundi', - 'a_second' => 'nekoliko sekundi|:count sekunde|:count sekundi', - 's' => ':count sek.|:count sek.|:count sek.', - 'ago' => 'prije :time', - 'from_now' => 'za :time', - 'after' => ':time poslije', - 'before' => ':time prije', - 'diff_now' => 'sad', - 'diff_today' => 'danas', - 'diff_today_regexp' => 'danas(?:\\s+u)?', - 'diff_yesterday' => 'jučer', - 'diff_yesterday_regexp' => 'jučer(?:\\s+u)?', - 'diff_tomorrow' => 'sutra', - 'diff_tomorrow_regexp' => 'sutra(?:\\s+u)?', - 'diff_before_yesterday' => 'prekjučer', - 'diff_after_tomorrow' => 'prekosutra', - 'formats' => [ - 'LT' => 'H:mm', - 'LTS' => 'H:mm:ss', - 'L' => 'D. M. YYYY.', - 'LL' => 'D. MMMM YYYY.', - 'LLL' => 'D. MMMM YYYY. H:mm', - 'LLLL' => 'dddd, D. MMMM YYYY. H:mm', - ], - 'calendar' => [ - 'sameDay' => '[danas u] LT', - 'nextDay' => '[sutra u] LT', - 'nextWeek' => function (CarbonInterface $date) { - switch ($date->dayOfWeek) { - case 0: - return '[u] [nedjelju] [u] LT'; - case 3: - return '[u] [srijedu] [u] LT'; - case 6: - return '[u] [subotu] [u] LT'; - default: - return '[u] dddd [u] LT'; - } - }, - 'lastDay' => '[jučer u] LT', - 'lastWeek' => function (CarbonInterface $date) { - switch ($date->dayOfWeek) { - case 0: - case 3: - return '[prošlu] dddd [u] LT'; - case 6: - return '[prošle] [subote] [u] LT'; - default: - return '[prošli] dddd [u] LT'; - } - }, - 'sameElse' => 'L', - ], - 'ordinal' => ':number.', - 'months' => ['siječnja', 'veljače', 'ožujka', 'travnja', 'svibnja', 'lipnja', 'srpnja', 'kolovoza', 'rujna', 'listopada', 'studenoga', 'prosinca'], - 'months_standalone' => ['siječanj', 'veljača', 'ožujak', 'travanj', 'svibanj', 'lipanj', 'srpanj', 'kolovoz', 'rujan', 'listopad', 'studeni', 'prosinac'], - 'months_short' => ['sij.', 'velj.', 'ožu.', 'tra.', 'svi.', 'lip.', 'srp.', 'kol.', 'ruj.', 'lis.', 'stu.', 'pro.'], - 'months_regexp' => '/(D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|L{2,4}|l{2,4})/', - 'weekdays' => ['nedjelju', 'ponedjeljak', 'utorak', 'srijedu', 'četvrtak', 'petak', 'subotu'], - 'weekdays_standalone' => ['nedjelja', 'ponedjeljak', 'utorak', 'srijeda', 'četvrtak', 'petak', 'subota'], - 'weekdays_short' => ['ned.', 'pon.', 'uto.', 'sri.', 'čet.', 'pet.', 'sub.'], - 'weekdays_min' => ['ne', 'po', 'ut', 'sr', 'če', 'pe', 'su'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'list' => [', ', ' i '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/hr_BA.php b/vendor/nesbot/carbon/src/Carbon/Lang/hr_BA.php deleted file mode 100644 index 7763a458..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/hr_BA.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - DarkoDevelop - */ -return array_replace_recursive(require __DIR__.'/hr.php', [ - 'weekdays' => ['nedjelja', 'ponedjeljak', 'utorak', 'srijeda', 'četvrtak', 'petak', 'subota'], - 'weekdays_short' => ['ned', 'pon', 'uto', 'sri', 'čet', 'pet', 'sub'], - 'weekdays_min' => ['ned', 'pon', 'uto', 'sri', 'čet', 'pet', 'sub'], - 'months' => ['siječnja', 'veljače', 'ožujka', 'travnja', 'svibnja', 'lipnja', 'srpnja', 'kolovoza', 'rujna', 'listopada', 'studenoga', 'prosinca'], - 'months_short' => ['sij', 'velj', 'ožu', 'tra', 'svi', 'lip', 'srp', 'kol', 'ruj', 'lis', 'stu', 'pro'], - 'months_standalone' => ['siječanj', 'veljača', 'ožujak', 'travanj', 'svibanj', 'lipanj', 'srpanj', 'kolovoz', 'rujan', 'listopad', 'studeni', 'prosinac'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'D. M. yy.', - 'LL' => 'D. MMM YYYY.', - 'LLL' => 'D. MMMM YYYY. HH:mm', - 'LLLL' => 'dddd, D. MMMM YYYY. HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/hr_HR.php b/vendor/nesbot/carbon/src/Carbon/Lang/hr_HR.php deleted file mode 100644 index db74d8c7..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/hr_HR.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/hr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/hsb.php b/vendor/nesbot/carbon/src/Carbon/Lang/hsb.php deleted file mode 100644 index 3537b8ba..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/hsb.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/hsb_DE.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/hsb_DE.php b/vendor/nesbot/carbon/src/Carbon/Lang/hsb_DE.php deleted file mode 100644 index 6ba22716..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/hsb_DE.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Information from Michael Wolf Andrzej Krzysztofowicz ankry@mif.pg.gda.pl - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD.MM.YYYY', - 'LL' => 'DD. MMMM YYYY', - 'LLL' => 'DD. MMMM, HH:mm [hodź.]', - 'LLLL' => 'dddd, DD. MMMM YYYY, HH:mm [hodź.]', - ], - 'months' => ['januara', 'februara', 'měrca', 'apryla', 'meje', 'junija', 'julija', 'awgusta', 'septembra', 'oktobra', 'nowembra', 'decembra'], - 'months_short' => ['Jan', 'Feb', 'Měr', 'Apr', 'Mej', 'Jun', 'Jul', 'Awg', 'Sep', 'Okt', 'Now', 'Dec'], - 'weekdays' => ['Njedźela', 'Póndźela', 'Wutora', 'Srjeda', 'Štvórtk', 'Pjatk', 'Sobota'], - 'weekdays_short' => ['Nj', 'Pó', 'Wu', 'Sr', 'Št', 'Pj', 'So'], - 'weekdays_min' => ['Nj', 'Pó', 'Wu', 'Sr', 'Št', 'Pj', 'So'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - - 'year' => ':count lěto', - 'y' => ':count lěto', - 'a_year' => ':count lěto', - - 'month' => ':count měsac', - 'm' => ':count měsac', - 'a_month' => ':count měsac', - - 'week' => ':count tydźeń', - 'w' => ':count tydźeń', - 'a_week' => ':count tydźeń', - - 'day' => ':count dźeń', - 'd' => ':count dźeń', - 'a_day' => ':count dźeń', - - 'hour' => ':count hodźina', - 'h' => ':count hodźina', - 'a_hour' => ':count hodźina', - - 'minute' => ':count chwila', - 'min' => ':count chwila', - 'a_minute' => ':count chwila', - - 'second' => ':count druhi', - 's' => ':count druhi', - 'a_second' => ':count druhi', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ht.php b/vendor/nesbot/carbon/src/Carbon/Lang/ht.php deleted file mode 100644 index ebd12ad1..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ht.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/ht_HT.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ht_HT.php b/vendor/nesbot/carbon/src/Carbon/Lang/ht_HT.php deleted file mode 100644 index 139b813b..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ht_HT.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Sugar Labs // OLPC sugarlabs.org libc-alpha@sourceware.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YYYY', - ], - 'months' => ['janvye', 'fevriye', 'mas', 'avril', 'me', 'jen', 'jiyè', 'out', 'septanm', 'oktòb', 'novanm', 'desanm'], - 'months_short' => ['jan', 'fev', 'mas', 'avr', 'me', 'jen', 'jiy', 'out', 'sep', 'okt', 'nov', 'des'], - 'weekdays' => ['dimanch', 'lendi', 'madi', 'mèkredi', 'jedi', 'vandredi', 'samdi'], - 'weekdays_short' => ['dim', 'len', 'mad', 'mèk', 'jed', 'van', 'sam'], - 'weekdays_min' => ['dim', 'len', 'mad', 'mèk', 'jed', 'van', 'sam'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - - 'year' => ':count lane', - 'y' => ':count lane', - 'a_year' => ':count lane', - - 'month' => 'mwa :count', - 'm' => 'mwa :count', - 'a_month' => 'mwa :count', - - 'week' => 'semèn :count', - 'w' => 'semèn :count', - 'a_week' => 'semèn :count', - - 'day' => ':count jou', - 'd' => ':count jou', - 'a_day' => ':count jou', - - 'hour' => ':count lè', - 'h' => ':count lè', - 'a_hour' => ':count lè', - - 'minute' => ':count minit', - 'min' => ':count minit', - 'a_minute' => ':count minit', - - 'second' => ':count segonn', - 's' => ':count segonn', - 'a_second' => ':count segonn', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/hu.php b/vendor/nesbot/carbon/src/Carbon/Lang/hu.php deleted file mode 100644 index b2d2ac11..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/hu.php +++ /dev/null @@ -1,118 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Adam Brunner - * - Brett Johnson - * - balping - */ - -use Carbon\CarbonInterface; - -$huWeekEndings = ['vasárnap', 'hétfőn', 'kedden', 'szerdán', 'csütörtökön', 'pénteken', 'szombaton']; - -return [ - 'year' => ':count év', - 'y' => ':count év', - 'month' => ':count hónap', - 'm' => ':count hónap', - 'week' => ':count hét', - 'w' => ':count hét', - 'day' => ':count nap', - 'd' => ':count nap', - 'hour' => ':count óra', - 'h' => ':count óra', - 'minute' => ':count perc', - 'min' => ':count perc', - 'second' => ':count másodperc', - 's' => ':count másodperc', - 'ago' => ':time', - 'from_now' => ':time múlva', - 'after' => ':time később', - 'before' => ':time korábban', - 'year_ago' => ':count éve', - 'y_ago' => ':count éve', - 'month_ago' => ':count hónapja', - 'm_ago' => ':count hónapja', - 'week_ago' => ':count hete', - 'w_ago' => ':count hete', - 'day_ago' => ':count napja', - 'd_ago' => ':count napja', - 'hour_ago' => ':count órája', - 'h_ago' => ':count órája', - 'minute_ago' => ':count perce', - 'min_ago' => ':count perce', - 'second_ago' => ':count másodperce', - 's_ago' => ':count másodperce', - 'year_after' => ':count évvel', - 'y_after' => ':count évvel', - 'month_after' => ':count hónappal', - 'm_after' => ':count hónappal', - 'week_after' => ':count héttel', - 'w_after' => ':count héttel', - 'day_after' => ':count nappal', - 'd_after' => ':count nappal', - 'hour_after' => ':count órával', - 'h_after' => ':count órával', - 'minute_after' => ':count perccel', - 'min_after' => ':count perccel', - 'second_after' => ':count másodperccel', - 's_after' => ':count másodperccel', - 'year_before' => ':count évvel', - 'y_before' => ':count évvel', - 'month_before' => ':count hónappal', - 'm_before' => ':count hónappal', - 'week_before' => ':count héttel', - 'w_before' => ':count héttel', - 'day_before' => ':count nappal', - 'd_before' => ':count nappal', - 'hour_before' => ':count órával', - 'h_before' => ':count órával', - 'minute_before' => ':count perccel', - 'min_before' => ':count perccel', - 'second_before' => ':count másodperccel', - 's_before' => ':count másodperccel', - 'months' => ['január', 'február', 'március', 'április', 'május', 'június', 'július', 'augusztus', 'szeptember', 'október', 'november', 'december'], - 'months_short' => ['jan.', 'feb.', 'márc.', 'ápr.', 'máj.', 'jún.', 'júl.', 'aug.', 'szept.', 'okt.', 'nov.', 'dec.'], - 'weekdays' => ['vasárnap', 'hétfő', 'kedd', 'szerda', 'csütörtök', 'péntek', 'szombat'], - 'weekdays_short' => ['vas', 'hét', 'kedd', 'sze', 'csüt', 'pén', 'szo'], - 'weekdays_min' => ['v', 'h', 'k', 'sze', 'cs', 'p', 'sz'], - 'ordinal' => ':number.', - 'diff_now' => 'most', - 'diff_today' => 'ma', - 'diff_yesterday' => 'tegnap', - 'diff_tomorrow' => 'holnap', - 'formats' => [ - 'LT' => 'H:mm', - 'LTS' => 'H:mm:ss', - 'L' => 'YYYY.MM.DD.', - 'LL' => 'YYYY. MMMM D.', - 'LLL' => 'YYYY. MMMM D. H:mm', - 'LLLL' => 'YYYY. MMMM D., dddd H:mm', - ], - 'calendar' => [ - 'sameDay' => '[ma] LT[-kor]', - 'nextDay' => '[holnap] LT[-kor]', - 'nextWeek' => function (CarbonInterface $date) use ($huWeekEndings) { - return '['.$huWeekEndings[$date->dayOfWeek].'] LT[-kor]'; - }, - 'lastDay' => '[tegnap] LT[-kor]', - 'lastWeek' => function (CarbonInterface $date) use ($huWeekEndings) { - return '[múlt '.$huWeekEndings[$date->dayOfWeek].'] LT[-kor]'; - }, - 'sameElse' => 'L', - ], - 'meridiem' => ['DE', 'DU'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' és '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/hu_HU.php b/vendor/nesbot/carbon/src/Carbon/Lang/hu_HU.php deleted file mode 100644 index b1c48541..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/hu_HU.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/hu.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/hy.php b/vendor/nesbot/carbon/src/Carbon/Lang/hy.php deleted file mode 100644 index 8b129947..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/hy.php +++ /dev/null @@ -1,95 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - mhamlet - */ -return [ - 'year' => ':count տարի', - 'a_year' => 'տարի|:count տարի', - 'y' => ':countտ', - 'month' => ':count ամիս', - 'a_month' => 'ամիս|:count ամիս', - 'm' => ':countամ', - 'week' => ':count շաբաթ', - 'a_week' => 'շաբաթ|:count շաբաթ', - 'w' => ':countշ', - 'day' => ':count օր', - 'a_day' => 'օր|:count օր', - 'd' => ':countօր', - 'hour' => ':count ժամ', - 'a_hour' => 'ժամ|:count ժամ', - 'h' => ':countժ', - 'minute' => ':count րոպե', - 'a_minute' => 'րոպե|:count րոպե', - 'min' => ':countր', - 'second' => ':count վայրկյան', - 'a_second' => 'մի քանի վայրկյան|:count վայրկյան', - 's' => ':countվրկ', - 'ago' => ':time առաջ', - 'from_now' => ':timeից', - 'after' => ':time հետո', - 'before' => ':time առաջ', - 'diff_now' => 'հիմա', - 'diff_today' => 'այսօր', - 'diff_yesterday' => 'երեկ', - 'diff_tomorrow' => 'վաղը', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD.MM.YYYY', - 'LL' => 'D MMMM YYYY թ.', - 'LLL' => 'D MMMM YYYY թ., HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY թ., HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[այսօր] LT', - 'nextDay' => '[վաղը] LT', - 'nextWeek' => 'dddd [օրը ժամը] LT', - 'lastDay' => '[երեկ] LT', - 'lastWeek' => '[անցած] dddd [օրը ժամը] LT', - 'sameElse' => 'L', - ], - 'ordinal' => function ($number, $period) { - switch ($period) { - case 'DDD': - case 'w': - case 'W': - case 'DDDo': - return $number.($number === 1 ? '-ին' : '-րդ'); - default: - return $number; - } - }, - 'meridiem' => function ($hour) { - if ($hour < 4) { - return 'գիշերվա'; - } - if ($hour < 12) { - return 'առավոտվա'; - } - if ($hour < 17) { - return 'ցերեկվա'; - } - - return 'երեկոյան'; - }, - 'months' => ['հունվարի', 'փետրվարի', 'մարտի', 'ապրիլի', 'մայիսի', 'հունիսի', 'հուլիսի', 'օգոստոսի', 'սեպտեմբերի', 'հոկտեմբերի', 'նոյեմբերի', 'դեկտեմբերի'], - 'months_standalone' => ['հունվար', 'փետրվար', 'մարտ', 'ապրիլ', 'մայիս', 'հունիս', 'հուլիս', 'օգոստոս', 'սեպտեմբեր', 'հոկտեմբեր', 'նոյեմբեր', 'դեկտեմբեր'], - 'months_short' => ['հնվ', 'փտր', 'մրտ', 'ապր', 'մյս', 'հնս', 'հլս', 'օգս', 'սպտ', 'հկտ', 'նմբ', 'դկտ'], - 'months_regexp' => '/(D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|L{2,4}|l{2,4})/', - 'weekdays' => ['կիրակի', 'երկուշաբթի', 'երեքշաբթի', 'չորեքշաբթի', 'հինգշաբթի', 'ուրբաթ', 'շաբաթ'], - 'weekdays_short' => ['կրկ', 'երկ', 'երք', 'չրք', 'հնգ', 'ուրբ', 'շբթ'], - 'weekdays_min' => ['կրկ', 'երկ', 'երք', 'չրք', 'հնգ', 'ուրբ', 'շբթ'], - 'list' => [', ', ' եւ '], - 'first_day_of_week' => 1, -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/hy_AM.php b/vendor/nesbot/carbon/src/Carbon/Lang/hy_AM.php deleted file mode 100644 index 4587df56..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/hy_AM.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Josh Soref - * - François B - * - Tim Fish - * - Serhan Apaydın - * - JD Isaacks - */ -return array_replace_recursive(require __DIR__.'/hy.php', [ - 'from_now' => ':time հետո', - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/i18n.php b/vendor/nesbot/carbon/src/Carbon/Lang/i18n.php deleted file mode 100644 index e65449b8..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/i18n.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'YYYY-MM-DD', - ], - 'months' => ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'], - 'months_short' => ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'], - 'weekdays' => ['1', '2', '3', '4', '5', '6', '7'], - 'weekdays_short' => ['1', '2', '3', '4', '5', '6', '7'], - 'weekdays_min' => ['1', '2', '3', '4', '5', '6', '7'], - 'first_day_of_week' => 0, - 'day_of_first_week_of_year' => 4, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ia.php b/vendor/nesbot/carbon/src/Carbon/Lang/ia.php deleted file mode 100644 index 0a0d5e61..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ia.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/ia_FR.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ia_FR.php b/vendor/nesbot/carbon/src/Carbon/Lang/ia_FR.php deleted file mode 100644 index de4b2fa0..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ia_FR.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Fedora Project Nik Kalach nikka@fedoraproject.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD.MM.YYYY', - ], - 'months' => ['januario', 'februario', 'martio', 'april', 'maio', 'junio', 'julio', 'augusto', 'septembre', 'octobre', 'novembre', 'decembre'], - 'months_short' => ['jan', 'feb', 'mar', 'apr', 'mai', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'], - 'weekdays' => ['dominica', 'lunedi', 'martedi', 'mercuridi', 'jovedi', 'venerdi', 'sabbato'], - 'weekdays_short' => ['dom', 'lun', 'mar', 'mer', 'jov', 'ven', 'sab'], - 'weekdays_min' => ['dom', 'lun', 'mar', 'mer', 'jov', 'ven', 'sab'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - - 'year' => 'anno :count', - 'y' => 'anno :count', - 'a_year' => 'anno :count', - - 'month' => ':count mense', - 'm' => ':count mense', - 'a_month' => ':count mense', - - 'week' => ':count septimana', - 'w' => ':count septimana', - 'a_week' => ':count septimana', - - 'day' => ':count die', - 'd' => ':count die', - 'a_day' => ':count die', - - 'hour' => ':count hora', - 'h' => ':count hora', - 'a_hour' => ':count hora', - - 'minute' => ':count minuscule', - 'min' => ':count minuscule', - 'a_minute' => ':count minuscule', - - 'second' => ':count secunda', - 's' => ':count secunda', - 'a_second' => ':count secunda', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/id.php b/vendor/nesbot/carbon/src/Carbon/Lang/id.php deleted file mode 100644 index afaf78f2..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/id.php +++ /dev/null @@ -1,92 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Josh Soref - * - du - * - JD Isaacks - * - Nafies Luthfi - * - Raymundus Jati Primanda (mundusjp) - * - diankur313 - * - a-wip0 - */ -return [ - 'year' => ':count tahun', - 'a_year' => '{1}setahun|]1,Inf[:count tahun', - 'y' => ':countthn', - 'month' => ':count bulan', - 'a_month' => '{1}sebulan|]1,Inf[:count bulan', - 'm' => ':countbln', - 'week' => ':count minggu', - 'a_week' => '{1}seminggu|]1,Inf[:count minggu', - 'w' => ':countmgg', - 'day' => ':count hari', - 'a_day' => '{1}sehari|]1,Inf[:count hari', - 'd' => ':counthr', - 'hour' => ':count jam', - 'a_hour' => '{1}sejam|]1,Inf[:count jam', - 'h' => ':countj', - 'minute' => ':count menit', - 'a_minute' => '{1}semenit|]1,Inf[:count menit', - 'min' => ':countmnt', - 'second' => ':count detik', - 'a_second' => '{1}beberapa detik|]1,Inf[:count detik', - 's' => ':countdt', - 'ago' => ':time yang lalu', - 'from_now' => ':time dari sekarang', - 'after' => ':time setelahnya', - 'before' => ':time sebelumnya', - 'diff_now' => 'sekarang', - 'diff_today' => 'Hari', - 'diff_today_regexp' => 'Hari(?:\\s+ini)?(?:\\s+pukul)?', - 'diff_yesterday' => 'kemarin', - 'diff_yesterday_regexp' => 'Kemarin(?:\\s+pukul)?', - 'diff_tomorrow' => 'besok', - 'diff_tomorrow_regexp' => 'Besok(?:\\s+pukul)?', - 'formats' => [ - 'LT' => 'HH.mm', - 'LTS' => 'HH.mm.ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY [pukul] HH.mm', - 'LLLL' => 'dddd, D MMMM YYYY [pukul] HH.mm', - ], - 'calendar' => [ - 'sameDay' => '[Hari ini pukul] LT', - 'nextDay' => '[Besok pukul] LT', - 'nextWeek' => 'dddd [pukul] LT', - 'lastDay' => '[Kemarin pukul] LT', - 'lastWeek' => 'dddd [lalu pukul] LT', - 'sameElse' => 'L', - ], - 'meridiem' => function ($hour) { - if ($hour < 11) { - return 'pagi'; - } - if ($hour < 15) { - return 'siang'; - } - if ($hour < 19) { - return 'sore'; - } - - return 'malam'; - }, - 'months' => ['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember'], - 'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Agt', 'Sep', 'Okt', 'Nov', 'Des'], - 'weekdays' => ['Minggu', 'Senin', 'Selasa', 'Rabu', 'Kamis', 'Jumat', 'Sabtu'], - 'weekdays_short' => ['Min', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'], - 'weekdays_min' => ['Mg', 'Sn', 'Sl', 'Rb', 'Km', 'Jm', 'Sb'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'list' => [', ', ' dan '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/id_ID.php b/vendor/nesbot/carbon/src/Carbon/Lang/id_ID.php deleted file mode 100644 index d5953a14..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/id_ID.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/id.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ig.php b/vendor/nesbot/carbon/src/Carbon/Lang/ig.php deleted file mode 100644 index de51e9cc..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ig.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/ig_NG.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ig_NG.php b/vendor/nesbot/carbon/src/Carbon/Lang/ig_NG.php deleted file mode 100644 index 0034e35d..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ig_NG.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - pablo@mandriva.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YY', - ], - 'months' => ['Jenụwarị', 'Febrụwarị', 'Maachị', 'Eprel', 'Mee', 'Juun', 'Julaị', 'Ọgọọst', 'Septemba', 'Ọktoba', 'Novemba', 'Disemba'], - 'months_short' => ['Jen', 'Feb', 'Maa', 'Epr', 'Mee', 'Juu', 'Jul', 'Ọgọ', 'Sep', 'Ọkt', 'Nov', 'Dis'], - 'weekdays' => ['sọnde', 'mọnde', 'tuzde', 'wenzde', 'tọsde', 'fraịde', 'satọde'], - 'weekdays_short' => ['sọn', 'mọn', 'tuz', 'wen', 'tọs', 'fra', 'sat'], - 'weekdays_min' => ['sọn', 'mọn', 'tuz', 'wen', 'tọs', 'fra', 'sat'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - - 'year' => 'afo :count', - 'y' => 'afo :count', - 'a_year' => 'afo :count', - - 'month' => 'önwa :count', - 'm' => 'önwa :count', - 'a_month' => 'önwa :count', - - 'week' => 'izu :count', - 'w' => 'izu :count', - 'a_week' => 'izu :count', - - 'day' => 'ụbọchị :count', - 'd' => 'ụbọchị :count', - 'a_day' => 'ụbọchị :count', - - 'hour' => 'awa :count', - 'h' => 'awa :count', - 'a_hour' => 'awa :count', - - 'minute' => 'minit :count', - 'min' => 'minit :count', - 'a_minute' => 'minit :count', - - 'second' => 'sekọnd :count', - 's' => 'sekọnd :count', - 'a_second' => 'sekọnd :count', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ii.php b/vendor/nesbot/carbon/src/Carbon/Lang/ii.php deleted file mode 100644 index a4246c27..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ii.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['ꎸꄑ', 'ꁯꋒ'], - 'weekdays' => ['ꑭꆏꑍ', 'ꆏꊂꋍ', 'ꆏꊂꑍ', 'ꆏꊂꌕ', 'ꆏꊂꇖ', 'ꆏꊂꉬ', 'ꆏꊂꃘ'], - 'weekdays_short' => ['ꑭꆏ', 'ꆏꋍ', 'ꆏꑍ', 'ꆏꌕ', 'ꆏꇖ', 'ꆏꉬ', 'ꆏꃘ'], - 'weekdays_min' => ['ꑭꆏ', 'ꆏꋍ', 'ꆏꑍ', 'ꆏꌕ', 'ꆏꇖ', 'ꆏꉬ', 'ꆏꃘ'], - 'months' => null, - 'months_short' => ['ꋍꆪ', 'ꑍꆪ', 'ꌕꆪ', 'ꇖꆪ', 'ꉬꆪ', 'ꃘꆪ', 'ꏃꆪ', 'ꉆꆪ', 'ꈬꆪ', 'ꊰꆪ', 'ꊰꊪꆪ', 'ꊰꑋꆪ'], - 'formats' => [ - 'LT' => 'h:mm a', - 'LTS' => 'h:mm:ss a', - 'L' => 'YYYY-MM-dd', - 'LL' => 'YYYY MMM D', - 'LLL' => 'YYYY MMMM D h:mm a', - 'LLLL' => 'YYYY MMMM D, dddd h:mm a', - ], - - 'year' => ':count ꒉ', // less reliable - 'y' => ':count ꒉ', // less reliable - 'a_year' => ':count ꒉ', // less reliable - - 'month' => ':count ꆪ', - 'm' => ':count ꆪ', - 'a_month' => ':count ꆪ', - - 'week' => ':count ꏃ', // less reliable - 'w' => ':count ꏃ', // less reliable - 'a_week' => ':count ꏃ', // less reliable - - 'day' => ':count ꏜ', // less reliable - 'd' => ':count ꏜ', // less reliable - 'a_day' => ':count ꏜ', // less reliable - - 'hour' => ':count ꄮꈉ', - 'h' => ':count ꄮꈉ', - 'a_hour' => ':count ꄮꈉ', - - 'minute' => ':count ꀄꊭ', // less reliable - 'min' => ':count ꀄꊭ', // less reliable - 'a_minute' => ':count ꀄꊭ', // less reliable - - 'second' => ':count ꇅ', // less reliable - 's' => ':count ꇅ', // less reliable - 'a_second' => ':count ꇅ', // less reliable -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ik.php b/vendor/nesbot/carbon/src/Carbon/Lang/ik.php deleted file mode 100644 index 7a13aa2d..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ik.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/ik_CA.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ik_CA.php b/vendor/nesbot/carbon/src/Carbon/Lang/ik_CA.php deleted file mode 100644 index bb2a109b..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ik_CA.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - pablo@mandriva.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YY', - ], - 'months' => ['Siqiññaatchiaq', 'Siqiññaasrugruk', 'Paniqsiqsiivik', 'Qilġich Tatqiat', 'Suppivik', 'Iġñivik', 'Itchavik', 'Tiññivik', 'Amiġaiqsivik', 'Sikkuvik', 'Nippivik', 'Siqiñġiḷaq'], - 'months_short' => ['Sñt', 'Sñs', 'Pan', 'Qil', 'Sup', 'Iġñ', 'Itc', 'Tiñ', 'Ami', 'Sik', 'Nip', 'Siq'], - 'weekdays' => ['Minġuiqsioiq', 'Savałłiq', 'Ilaqtchiioiq', 'Qitchiioiq', 'Sisamiioiq', 'Tallimmiioiq', 'Maqinġuoiq'], - 'weekdays_short' => ['Min', 'Sav', 'Ila', 'Qit', 'Sis', 'Tal', 'Maq'], - 'weekdays_min' => ['Min', 'Sav', 'Ila', 'Qit', 'Sis', 'Tal', 'Maq'], - 'day_of_first_week_of_year' => 1, - - 'year' => ':count ukiuq', - 'y' => ':count ukiuq', - 'a_year' => ':count ukiuq', - - 'month' => ':count Tatqiat', - 'm' => ':count Tatqiat', - 'a_month' => ':count Tatqiat', - - 'week' => ':count tatqiat', // less reliable - 'w' => ':count tatqiat', // less reliable - 'a_week' => ':count tatqiat', // less reliable - - 'day' => ':count siqiñiq', // less reliable - 'd' => ':count siqiñiq', // less reliable - 'a_day' => ':count siqiñiq', // less reliable - - 'hour' => ':count Siḷa', // less reliable - 'h' => ':count Siḷa', // less reliable - 'a_hour' => ':count Siḷa', // less reliable - - 'second' => ':count iġñiq', // less reliable - 's' => ':count iġñiq', // less reliable - 'a_second' => ':count iġñiq', // less reliable -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/in.php b/vendor/nesbot/carbon/src/Carbon/Lang/in.php deleted file mode 100644 index d5953a14..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/in.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/id.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/is.php b/vendor/nesbot/carbon/src/Carbon/Lang/is.php deleted file mode 100644 index 9990168c..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/is.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Kristján Ingi Geirsson - */ -return [ - 'year' => '1 ár|:count ár', - 'y' => '1 ár|:count ár', - 'month' => '1 mánuður|:count mánuðir', - 'm' => '1 mánuður|:count mánuðir', - 'week' => '1 vika|:count vikur', - 'w' => '1 vika|:count vikur', - 'day' => '1 dagur|:count dagar', - 'd' => '1 dagur|:count dagar', - 'hour' => '1 klukkutími|:count klukkutímar', - 'h' => '1 klukkutími|:count klukkutímar', - 'minute' => '1 mínúta|:count mínútur', - 'min' => '1 mínúta|:count mínútur', - 'second' => '1 sekúnda|:count sekúndur', - 's' => '1 sekúnda|:count sekúndur', - 'ago' => ':time síðan', - 'from_now' => ':time síðan', - 'after' => ':time eftir', - 'before' => ':time fyrir', - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' og '], - 'meridiem' => ['fh', 'eh'], - 'diff_now' => 'núna', - 'diff_yesterday' => 'í gær', - 'diff_tomorrow' => 'á morgun', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD.MM.YYYY', - 'LL' => 'D. MMMM YYYY', - 'LLL' => 'D. MMMM [kl.] HH:mm', - 'LLLL' => 'dddd D. MMMM YYYY [kl.] HH:mm', - ], - 'weekdays' => ['sunnudaginn', 'mánudaginn', 'þriðjudaginn', 'miðvikudaginn', 'fimmtudaginn', 'föstudaginn', 'laugardaginn'], - 'weekdays_short' => ['sun', 'mán', 'þri', 'mið', 'fim', 'fös', 'lau'], - 'weekdays_min' => ['sun', 'mán', 'þri', 'mið', 'fim', 'fös', 'lau'], - 'months' => ['janúar', 'febrúar', 'mars', 'apríl', 'maí', 'júní', 'júlí', 'ágúst', 'september', 'október', 'nóvember', 'desember'], - 'months_short' => ['jan', 'feb', 'mar', 'apr', 'maí', 'jún', 'júl', 'ágú', 'sep', 'okt', 'nóv', 'des'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/is_IS.php b/vendor/nesbot/carbon/src/Carbon/Lang/is_IS.php deleted file mode 100644 index 4d35c448..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/is_IS.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/is.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/it.php b/vendor/nesbot/carbon/src/Carbon/Lang/it.php deleted file mode 100644 index 49875d7e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/it.php +++ /dev/null @@ -1,115 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Ash - * - François B - * - Marco Perrando - * - Massimiliano Caniparoli - * - JD Isaacks - * - Andrea Martini - * - Francesco Marasco - * - Tizianoz93 - * - Davide Casiraghi (davide-casiraghi) - * - Pete Scopes (pdscopes) - */ - -use Carbon\CarbonInterface; - -return [ - 'year' => ':count anno|:count anni', - 'a_year' => 'un anno|:count anni', - 'y' => ':count anno|:count anni', - 'month' => ':count mese|:count mesi', - 'a_month' => 'un mese|:count mesi', - 'm' => ':count mese|:count mesi', - 'week' => ':count settimana|:count settimane', - 'a_week' => 'una settimana|:count settimane', - 'w' => ':count set.', - 'day' => ':count giorno|:count giorni', - 'a_day' => 'un giorno|:count giorni', - 'd' => ':count g|:count gg', - 'hour' => ':count ora|:count ore', - 'a_hour' => 'un\'ora|:count ore', - 'h' => ':count h', - 'minute' => ':count minuto|:count minuti', - 'a_minute' => 'un minuto|:count minuti', - 'min' => ':count min.', - 'second' => ':count secondo|:count secondi', - 'a_second' => 'alcuni secondi|:count secondi', - 's' => ':count sec.', - 'millisecond' => ':count millisecondo|:count millisecondi', - 'a_millisecond' => 'un millisecondo|:count millisecondi', - 'ms' => ':countms', - 'microsecond' => ':count microsecondo|:count microsecondi', - 'a_microsecond' => 'un microsecondo|:count microsecondi', - 'µs' => ':countµs', - 'ago' => ':time fa', - 'from_now' => function ($time) { - return (preg_match('/^\d.+$/', $time) ? 'tra' : 'in')." $time"; - }, - 'after' => ':time dopo', - 'before' => ':time prima', - 'diff_now' => 'proprio ora', - 'diff_today' => 'Oggi', - 'diff_today_regexp' => 'Oggi(?:\\s+alle)?', - 'diff_yesterday' => 'ieri', - 'diff_yesterday_regexp' => 'Ieri(?:\\s+alle)?', - 'diff_tomorrow' => 'domani', - 'diff_tomorrow_regexp' => 'Domani(?:\\s+alle)?', - 'diff_before_yesterday' => 'l\'altro ieri', - 'diff_after_tomorrow' => 'dopodomani', - 'period_interval' => 'ogni :interval', - 'period_start_date' => 'dal :date', - 'period_end_date' => 'al :date', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[Oggi alle] LT', - 'nextDay' => '[Domani alle] LT', - 'nextWeek' => 'dddd [alle] LT', - 'lastDay' => '[Ieri alle] LT', - 'lastWeek' => function (CarbonInterface $date) { - switch ($date->dayOfWeek) { - case 0: - return '[la scorsa] dddd [alle] LT'; - default: - return '[lo scorso] dddd [alle] LT'; - } - }, - 'sameElse' => 'L', - ], - 'ordinal' => ':numberº', - 'months' => ['gennaio', 'febbraio', 'marzo', 'aprile', 'maggio', 'giugno', 'luglio', 'agosto', 'settembre', 'ottobre', 'novembre', 'dicembre'], - 'months_short' => ['gen', 'feb', 'mar', 'apr', 'mag', 'giu', 'lug', 'ago', 'set', 'ott', 'nov', 'dic'], - 'weekdays' => ['domenica', 'lunedì', 'martedì', 'mercoledì', 'giovedì', 'venerdì', 'sabato'], - 'weekdays_short' => ['dom', 'lun', 'mar', 'mer', 'gio', 'ven', 'sab'], - 'weekdays_min' => ['do', 'lu', 'ma', 'me', 'gi', 've', 'sa'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' e '], - 'ordinal_words' => [ - 'of' => 'di', - 'first' => 'primo', - 'second' => 'secondo', - 'third' => 'terzo', - 'fourth' => 'quarto', - 'fifth' => 'quinto', - 'last' => 'ultimo', - ], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/it_CH.php b/vendor/nesbot/carbon/src/Carbon/Lang/it_CH.php deleted file mode 100644 index c23cc50e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/it_CH.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Propaganistas - */ -return array_replace_recursive(require __DIR__.'/it.php', [ - 'formats' => [ - 'L' => 'DD.MM.YYYY', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/it_IT.php b/vendor/nesbot/carbon/src/Carbon/Lang/it_IT.php deleted file mode 100644 index a5d19818..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/it_IT.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - RAP bug-glibc-locales@gnu.org - */ -return require __DIR__.'/it.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/it_SM.php b/vendor/nesbot/carbon/src/Carbon/Lang/it_SM.php deleted file mode 100644 index 5e8fc92f..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/it_SM.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/it.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/it_VA.php b/vendor/nesbot/carbon/src/Carbon/Lang/it_VA.php deleted file mode 100644 index 5e8fc92f..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/it_VA.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/it.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/iu.php b/vendor/nesbot/carbon/src/Carbon/Lang/iu.php deleted file mode 100644 index 4fa97427..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/iu.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/iu_CA.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/iu_CA.php b/vendor/nesbot/carbon/src/Carbon/Lang/iu_CA.php deleted file mode 100644 index 6ab7e149..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/iu_CA.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Pablo Saratxaga pablo@mandriva.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'MM/DD/YY', - ], - 'months' => ['ᔮᓄᐊᓕ', 'ᕕᕗᐊᓕ', 'ᒪᔅᓯ', 'ᐃᐳᓗ', 'ᒪᐃ', 'ᔪᓂ', 'ᔪᓚᐃ', 'ᐊᒋᓯ', 'ᓯᑎᕙ', 'ᐊᑦᑐᕙ', 'ᓄᕕᕙ', 'ᑎᓯᕝᕙ'], - 'months_short' => ['ᔮᓄ', 'ᕕᕗ', 'ᒪᔅ', 'ᐃᐳ', 'ᒪᐃ', 'ᔪᓂ', 'ᔪᓚ', 'ᐊᒋ', 'ᓯᑎ', 'ᐊᑦ', 'ᓄᕕ', 'ᑎᓯ'], - 'weekdays' => ['ᓈᑦᑎᖑᔭᕐᕕᒃ', 'ᓇᒡᒐᔾᔭᐅ', 'ᓇᒡᒐᔾᔭᐅᓕᖅᑭᑦ', 'ᐱᖓᓲᓕᖅᓯᐅᑦ', 'ᕿᑎᖅᑰᑦ', 'ᐅᓪᓗᕈᓘᑐᐃᓇᖅ', 'ᓯᕙᑖᕕᒃ'], - 'weekdays_short' => ['ᓈ', 'ᓇ', 'ᓕ', 'ᐱ', 'ᕿ', 'ᐅ', 'ᓯ'], - 'weekdays_min' => ['ᓈ', 'ᓇ', 'ᓕ', 'ᐱ', 'ᕿ', 'ᐅ', 'ᓯ'], - 'day_of_first_week_of_year' => 1, - - 'year' => ':count ᐅᑭᐅᖅ', - 'y' => ':count ᐅᑭᐅᖅ', - 'a_year' => ':count ᐅᑭᐅᖅ', - - 'month' => ':count qaammat', - 'm' => ':count qaammat', - 'a_month' => ':count qaammat', - - 'week' => ':count sapaatip akunnera', - 'w' => ':count sapaatip akunnera', - 'a_week' => ':count sapaatip akunnera', - - 'day' => ':count ulloq', - 'd' => ':count ulloq', - 'a_day' => ':count ulloq', - - 'hour' => ':count ikarraq', - 'h' => ':count ikarraq', - 'a_hour' => ':count ikarraq', - - 'minute' => ':count titiqqaralaaq', // less reliable - 'min' => ':count titiqqaralaaq', // less reliable - 'a_minute' => ':count titiqqaralaaq', // less reliable - - 'second' => ':count marluk', // less reliable - 's' => ':count marluk', // less reliable - 'a_second' => ':count marluk', // less reliable -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/iw.php b/vendor/nesbot/carbon/src/Carbon/Lang/iw.php deleted file mode 100644 index a26e3506..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/iw.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'months' => ['ינואר', 'פברואר', 'מרץ', 'אפריל', 'מאי', 'יוני', 'יולי', 'אוגוסט', 'ספטמבר', 'אוקטובר', 'נובמבר', 'דצמבר'], - 'months_short' => ['ינו׳', 'פבר׳', 'מרץ', 'אפר׳', 'מאי', 'יוני', 'יולי', 'אוג׳', 'ספט׳', 'אוק׳', 'נוב׳', 'דצמ׳'], - 'weekdays' => ['יום ראשון', 'יום שני', 'יום שלישי', 'יום רביעי', 'יום חמישי', 'יום שישי', 'יום שבת'], - 'weekdays_short' => ['יום א׳', 'יום ב׳', 'יום ג׳', 'יום ד׳', 'יום ה׳', 'יום ו׳', 'שבת'], - 'weekdays_min' => ['א׳', 'ב׳', 'ג׳', 'ד׳', 'ה׳', 'ו׳', 'ש׳'], - 'meridiem' => ['לפנה״צ', 'אחה״צ'], - 'formats' => [ - 'LT' => 'H:mm', - 'LTS' => 'H:mm:ss', - 'L' => 'D.M.YYYY', - 'LL' => 'D בMMM YYYY', - 'LLL' => 'D בMMMM YYYY H:mm', - 'LLLL' => 'dddd, D בMMMM YYYY H:mm', - ], - - 'year' => ':count שנה', - 'y' => ':count שנה', - 'a_year' => ':count שנה', - - 'month' => ':count חודש', - 'm' => ':count חודש', - 'a_month' => ':count חודש', - - 'week' => ':count שבוע', - 'w' => ':count שבוע', - 'a_week' => ':count שבוע', - - 'day' => ':count יום', - 'd' => ':count יום', - 'a_day' => ':count יום', - - 'hour' => ':count שעה', - 'h' => ':count שעה', - 'a_hour' => ':count שעה', - - 'minute' => ':count דקה', - 'min' => ':count דקה', - 'a_minute' => ':count דקה', - - 'second' => ':count שניה', - 's' => ':count שניה', - 'a_second' => ':count שניה', - - 'ago' => 'לפני :time', - 'from_now' => 'בעוד :time', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ja.php b/vendor/nesbot/carbon/src/Carbon/Lang/ja.php deleted file mode 100644 index 1ca67519..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ja.php +++ /dev/null @@ -1,102 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Takuya Sawada - * - Atsushi Tanaka - * - François B - * - Jason Katz-Brown - * - Serhan Apaydın - * - XueWei - * - JD Isaacks - * - toyama satoshi - * - atakigawa - */ - -use Carbon\CarbonInterface; - -return [ - 'year' => ':count年', - 'y' => ':count年', - 'month' => ':countヶ月', - 'm' => ':countヶ月', - 'week' => ':count週間', - 'w' => ':count週間', - 'day' => ':count日', - 'd' => ':count日', - 'hour' => ':count時間', - 'h' => ':count時間', - 'minute' => ':count分', - 'min' => ':count分', - 'second' => ':count秒', - 'a_second' => '{1}数秒|]1,Inf[:count秒', - 's' => ':count秒', - 'ago' => ':time前', - 'from_now' => ':time後', - 'after' => ':time後', - 'before' => ':time前', - 'diff_now' => '今', - 'diff_today' => '今日', - 'diff_yesterday' => '昨日', - 'diff_tomorrow' => '明日', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'YYYY/MM/DD', - 'LL' => 'YYYY年M月D日', - 'LLL' => 'YYYY年M月D日 HH:mm', - 'LLLL' => 'YYYY年M月D日 dddd HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[今日] LT', - 'nextDay' => '[明日] LT', - 'nextWeek' => function (CarbonInterface $current, CarbonInterface $other) { - if ($other->week !== $current->week) { - return '[来週]dddd LT'; - } - - return 'dddd LT'; - }, - 'lastDay' => '[昨日] LT', - 'lastWeek' => function (CarbonInterface $current, CarbonInterface $other) { - if ($other->week !== $current->week) { - return '[先週]dddd LT'; - } - - return 'dddd LT'; - }, - 'sameElse' => 'L', - ], - 'ordinal' => function ($number, $period) { - switch ($period) { - case 'd': - case 'D': - case 'DDD': - return $number.'日'; - default: - return $number; - } - }, - 'meridiem' => ['午前', '午後'], - 'months' => ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], - 'months_short' => ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], - 'weekdays' => ['日曜日', '月曜日', '火曜日', '水曜日', '木曜日', '金曜日', '土曜日'], - 'weekdays_short' => ['日', '月', '火', '水', '木', '金', '土'], - 'weekdays_min' => ['日', '月', '火', '水', '木', '金', '土'], - 'list' => '、', - 'alt_numbers' => ['〇', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一', '十二', '十三', '十四', '十五', '十六', '十七', '十八', '十九', '二十', '二十一', '二十二', '二十三', '二十四', '二十五', '二十六', '二十七', '二十八', '二十九', '三十', '三十一', '三十二', '三十三', '三十四', '三十五', '三十六', '三十七', '三十八', '三十九', '四十', '四十一', '四十二', '四十三', '四十四', '四十五', '四十六', '四十七', '四十八', '四十九', '五十', '五十一', '五十二', '五十三', '五十四', '五十五', '五十六', '五十七', '五十八', '五十九', '六十', '六十一', '六十二', '六十三', '六十四', '六十五', '六十六', '六十七', '六十八', '六十九', '七十', '七十一', '七十二', '七十三', '七十四', '七十五', '七十六', '七十七', '七十八', '七十九', '八十', '八十一', '八十二', '八十三', '八十四', '八十五', '八十六', '八十七', '八十八', '八十九', '九十', '九十一', '九十二', '九十三', '九十四', '九十五', '九十六', '九十七', '九十八', '九十九'], - 'alt_numbers_pow' => [ - 10000 => '万', - 1000 => '千', - 100 => '百', - ], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ja_JP.php b/vendor/nesbot/carbon/src/Carbon/Lang/ja_JP.php deleted file mode 100644 index c2836253..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ja_JP.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/ja.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/jgo.php b/vendor/nesbot/carbon/src/Carbon/Lang/jgo.php deleted file mode 100644 index 6a1e77a8..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/jgo.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/jmc.php b/vendor/nesbot/carbon/src/Carbon/Lang/jmc.php deleted file mode 100644 index ed92e8e7..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/jmc.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['utuko', 'kyiukonyi'], - 'weekdays' => ['Jumapilyi', 'Jumatatuu', 'Jumanne', 'Jumatanu', 'Alhamisi', 'Ijumaa', 'Jumamosi'], - 'weekdays_short' => ['Jpi', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Iju', 'Jmo'], - 'weekdays_min' => ['Jpi', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Iju', 'Jmo'], - 'months' => ['Januari', 'Februari', 'Machi', 'Aprilyi', 'Mei', 'Junyi', 'Julyai', 'Agusti', 'Septemba', 'Oktoba', 'Novemba', 'Desemba'], - 'months_short' => ['Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Sep', 'Okt', 'Nov', 'Des'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/jv.php b/vendor/nesbot/carbon/src/Carbon/Lang/jv.php deleted file mode 100644 index bcbe044e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/jv.php +++ /dev/null @@ -1,71 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Josh Soref - * - tgfjt - * - JD Isaacks - */ -return [ - 'year' => '{1}setaun|]1,Inf[:count taun', - 'month' => '{1}sewulan|]1,Inf[:count wulan', - 'week' => '{1}sakminggu|]1,Inf[:count minggu', - 'day' => '{1}sedinten|]1,Inf[:count dinten', - 'hour' => '{1}setunggal jam|]1,Inf[:count jam', - 'minute' => '{1}setunggal menit|]1,Inf[:count menit', - 'second' => '{1}sawetawis detik|]1,Inf[:count detik', - 'ago' => ':time ingkang kepengker', - 'from_now' => 'wonten ing :time', - 'diff_today' => 'Dinten', - 'diff_yesterday' => 'Kala', - 'diff_yesterday_regexp' => 'Kala(?:\\s+wingi)?(?:\\s+pukul)?', - 'diff_tomorrow' => 'Mbenjang', - 'diff_tomorrow_regexp' => 'Mbenjang(?:\\s+pukul)?', - 'diff_today_regexp' => 'Dinten(?:\\s+puniko)?(?:\\s+pukul)?', - 'formats' => [ - 'LT' => 'HH.mm', - 'LTS' => 'HH.mm.ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY [pukul] HH.mm', - 'LLLL' => 'dddd, D MMMM YYYY [pukul] HH.mm', - ], - 'calendar' => [ - 'sameDay' => '[Dinten puniko pukul] LT', - 'nextDay' => '[Mbenjang pukul] LT', - 'nextWeek' => 'dddd [pukul] LT', - 'lastDay' => '[Kala wingi pukul] LT', - 'lastWeek' => 'dddd [kepengker pukul] LT', - 'sameElse' => 'L', - ], - 'meridiem' => function ($hour) { - if ($hour < 11) { - return 'enjing'; - } - if ($hour < 15) { - return 'siyang'; - } - if ($hour < 19) { - return 'sonten'; - } - - return 'ndalu'; - }, - 'months' => ['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'Nopember', 'Desember'], - 'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Ags', 'Sep', 'Okt', 'Nop', 'Des'], - 'weekdays' => ['Minggu', 'Senen', 'Seloso', 'Rebu', 'Kemis', 'Jemuwah', 'Septu'], - 'weekdays_short' => ['Min', 'Sen', 'Sel', 'Reb', 'Kem', 'Jem', 'Sep'], - 'weekdays_min' => ['Mg', 'Sn', 'Sl', 'Rb', 'Km', 'Jm', 'Sp'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'list' => [', ', ' lan '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ka.php b/vendor/nesbot/carbon/src/Carbon/Lang/ka.php deleted file mode 100644 index a5d563d3..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ka.php +++ /dev/null @@ -1,204 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Tornike Razmadze - * - François B - * - Lasha Dolidze - * - Tim Fish - * - JD Isaacks - * - Tornike Razmadze - * - François B - * - Lasha Dolidze - * - JD Isaacks - * - LONGMAN - * - Avtandil Kikabidze (akalongman) - * - Levan Velijanashvili (Stichoza) - */ - -use Carbon\CarbonInterface; - -return [ - 'year' => ':count წელი', - 'y' => ':count წელი', - 'a_year' => '{1}წელი|]1,Inf[:count წელი', - 'month' => ':count თვე', - 'm' => ':count თვე', - 'a_month' => '{1}თვე|]1,Inf[:count თვე', - 'week' => ':count კვირა', - 'w' => ':count კვირა', - 'a_week' => '{1}კვირა|]1,Inf[:count კვირა', - 'day' => ':count დღე', - 'd' => ':count დღე', - 'a_day' => '{1}დღე|]1,Inf[:count დღე', - 'hour' => ':count საათი', - 'h' => ':count საათი', - 'a_hour' => '{1}საათი|]1,Inf[:count საათი', - 'minute' => ':count წუთი', - 'min' => ':count წუთი', - 'a_minute' => '{1}წუთი|]1,Inf[:count წუთი', - 'second' => ':count წამი', - 's' => ':count წამი', - 'a_second' => '{1}რამდენიმე წამი|]1,Inf[:count წამი', - 'ago' => function ($time) { - $replacements = [ - // year - 'წელი' => 'წლის', - // month - 'თვე' => 'თვის', - // week - 'კვირა' => 'კვირის', - // day - 'დღე' => 'დღის', - // hour - 'საათი' => 'საათის', - // minute - 'წუთი' => 'წუთის', - // second - 'წამი' => 'წამის', - ]; - $time = strtr($time, array_flip($replacements)); - $time = strtr($time, $replacements); - - return "$time წინ"; - }, - 'from_now' => function ($time) { - $replacements = [ - // year - 'წელი' => 'წელიწადში', - // week - 'კვირა' => 'კვირაში', - // day - 'დღე' => 'დღეში', - // month - 'თვე' => 'თვეში', - // hour - 'საათი' => 'საათში', - // minute - 'წუთი' => 'წუთში', - // second - 'წამი' => 'წამში', - ]; - $time = strtr($time, array_flip($replacements)); - $time = strtr($time, $replacements); - - return $time; - }, - 'after' => function ($time) { - $replacements = [ - // year - 'წელი' => 'წლის', - // month - 'თვე' => 'თვის', - // week - 'კვირა' => 'კვირის', - // day - 'დღე' => 'დღის', - // hour - 'საათი' => 'საათის', - // minute - 'წუთი' => 'წუთის', - // second - 'წამი' => 'წამის', - ]; - $time = strtr($time, array_flip($replacements)); - $time = strtr($time, $replacements); - - return "$time შემდეგ"; - }, - 'before' => function ($time) { - $replacements = [ - // year - 'წელი' => 'წლით', - // month - 'თვე' => 'თვით', - // week - 'კვირა' => 'კვირით', - // day - 'დღე' => 'დღით', - // hour - 'საათი' => 'საათით', - // minute - 'წუთი' => 'წუთით', - // second - 'წამი' => 'წამით', - ]; - $time = strtr($time, array_flip($replacements)); - $time = strtr($time, $replacements); - - return "$time ადრე"; - }, - 'diff_now' => 'ახლა', - 'diff_today' => 'დღეს', - 'diff_yesterday' => 'გუშინ', - 'diff_tomorrow' => 'ხვალ', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[დღეს], LT[-ზე]', - 'nextDay' => '[ხვალ], LT[-ზე]', - 'nextWeek' => function (CarbonInterface $current, CarbonInterface $other) { - return ($current->isSameWeek($other) ? '' : '[შემდეგ] ').'dddd, LT[-ზე]'; - }, - 'lastDay' => '[გუშინ], LT[-ზე]', - 'lastWeek' => '[წინა] dddd, LT-ზე', - 'sameElse' => 'L', - ], - 'ordinal' => function ($number) { - if ($number === 0) { - return $number; - } - if ($number === 1) { - return $number.'-ლი'; - } - if (($number < 20) || ($number <= 100 && ($number % 20 === 0)) || ($number % 100 === 0)) { - return 'მე-'.$number; - } - - return $number.'-ე'; - }, - 'months' => ['იანვარი', 'თებერვალი', 'მარტი', 'აპრილი', 'მაისი', 'ივნისი', 'ივლისი', 'აგვისტო', 'სექტემბერი', 'ოქტომბერი', 'ნოემბერი', 'დეკემბერი'], - 'months_standalone' => ['იანვარს', 'თებერვალს', 'მარტს', 'აპრილს', 'მაისს', 'ივნისს', 'ივლისს', 'აგვისტოს', 'სექტემბერს', 'ოქტომბერს', 'ნოემბერს', 'დეკემბერს'], - 'months_short' => ['იან', 'თებ', 'მარ', 'აპრ', 'მაი', 'ივნ', 'ივლ', 'აგვ', 'სექ', 'ოქტ', 'ნოე', 'დეკ'], - 'months_regexp' => '/(D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|L{2,4}|l{2,4})/', - 'weekdays' => ['კვირას', 'ორშაბათს', 'სამშაბათს', 'ოთხშაბათს', 'ხუთშაბათს', 'პარასკევს', 'შაბათს'], - 'weekdays_standalone' => ['კვირა', 'ორშაბათი', 'სამშაბათი', 'ოთხშაბათი', 'ხუთშაბათი', 'პარასკევი', 'შაბათი'], - 'weekdays_short' => ['კვი', 'ორშ', 'სამ', 'ოთხ', 'ხუთ', 'პარ', 'შაბ'], - 'weekdays_min' => ['კვ', 'ორ', 'სა', 'ოთ', 'ხუ', 'პა', 'შა'], - 'weekdays_regexp' => '/^([^d].*|.*[^d])$/', - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'list' => [', ', ' და '], - 'meridiem' => function ($hour) { - if ($hour >= 4) { - if ($hour < 11) { - return 'დილის'; - } - - if ($hour < 16) { - return 'შუადღის'; - } - - if ($hour < 22) { - return 'საღამოს'; - } - } - - return 'ღამის'; - }, -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ka_GE.php b/vendor/nesbot/carbon/src/Carbon/Lang/ka_GE.php deleted file mode 100644 index a26d9305..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ka_GE.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/ka.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/kab.php b/vendor/nesbot/carbon/src/Carbon/Lang/kab.php deleted file mode 100644 index 94d64737..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/kab.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/kab_DZ.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/kab_DZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/kab_DZ.php deleted file mode 100644 index 796660be..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/kab_DZ.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - belkacem77@gmail.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YYYY', - ], - 'months' => ['Yennayer', 'Fuṛar', 'Meɣres', 'Yebrir', 'Mayyu', 'Yunyu', 'Yulyu', 'ɣuct', 'Ctembeṛ', 'Tubeṛ', 'Wambeṛ', 'Dujembeṛ'], - 'months_short' => ['Yen', 'Fur', 'Meɣ', 'Yeb', 'May', 'Yun', 'Yul', 'ɣuc', 'Cte', 'Tub', 'Wam', 'Duj'], - 'weekdays' => ['Acer', 'Arim', 'Aram', 'Ahad', 'Amhad', 'Sem', 'Sed'], - 'weekdays_short' => ['Ace', 'Ari', 'Ara', 'Aha', 'Amh', 'Sem', 'Sed'], - 'weekdays_min' => ['Ace', 'Ari', 'Ara', 'Aha', 'Amh', 'Sem', 'Sed'], - 'first_day_of_week' => 6, - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['FT', 'MD'], - - 'year' => ':count n yiseggasen', - 'y' => ':count n yiseggasen', - 'a_year' => ':count n yiseggasen', - - 'month' => ':count n wayyuren', - 'm' => ':count n wayyuren', - 'a_month' => ':count n wayyuren', - - 'week' => ':count n ledwaṛ', // less reliable - 'w' => ':count n ledwaṛ', // less reliable - 'a_week' => ':count n ledwaṛ', // less reliable - - 'day' => ':count n wussan', - 'd' => ':count n wussan', - 'a_day' => ':count n wussan', - - 'hour' => ':count n tsaɛtin', - 'h' => ':count n tsaɛtin', - 'a_hour' => ':count n tsaɛtin', - - 'minute' => ':count n tedqiqin', - 'min' => ':count n tedqiqin', - 'a_minute' => ':count n tedqiqin', - - 'second' => ':count tasdidt', // less reliable - 's' => ':count tasdidt', // less reliable - 'a_second' => ':count tasdidt', // less reliable -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/kam.php b/vendor/nesbot/carbon/src/Carbon/Lang/kam.php deleted file mode 100644 index 0fc70d70..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/kam.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['Ĩyakwakya', 'Ĩyawĩoo'], - 'weekdays' => ['Wa kyumwa', 'Wa kwambĩlĩlya', 'Wa kelĩ', 'Wa katatũ', 'Wa kana', 'Wa katano', 'Wa thanthatũ'], - 'weekdays_short' => ['Wky', 'Wkw', 'Wkl', 'Wtũ', 'Wkn', 'Wtn', 'Wth'], - 'weekdays_min' => ['Wky', 'Wkw', 'Wkl', 'Wtũ', 'Wkn', 'Wtn', 'Wth'], - 'months' => ['Mwai wa mbee', 'Mwai wa kelĩ', 'Mwai wa katatũ', 'Mwai wa kana', 'Mwai wa katano', 'Mwai wa thanthatũ', 'Mwai wa muonza', 'Mwai wa nyaanya', 'Mwai wa kenda', 'Mwai wa ĩkumi', 'Mwai wa ĩkumi na ĩmwe', 'Mwai wa ĩkumi na ilĩ'], - 'months_short' => ['Mbe', 'Kel', 'Ktũ', 'Kan', 'Ktn', 'Tha', 'Moo', 'Nya', 'Knd', 'Ĩku', 'Ĩkm', 'Ĩkl'], - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], - - // Too unreliable - /* - 'year' => ':count mbua', // less reliable - 'y' => ':count mbua', // less reliable - 'a_year' => ':count mbua', // less reliable - - 'month' => ':count ndakitali', // less reliable - 'm' => ':count ndakitali', // less reliable - 'a_month' => ':count ndakitali', // less reliable - - 'day' => ':count wia', // less reliable - 'd' => ':count wia', // less reliable - 'a_day' => ':count wia', // less reliable - - 'hour' => ':count orasan', // less reliable - 'h' => ':count orasan', // less reliable - 'a_hour' => ':count orasan', // less reliable - - 'minute' => ':count orasan', // less reliable - 'min' => ':count orasan', // less reliable - 'a_minute' => ':count orasan', // less reliable - */ -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/kde.php b/vendor/nesbot/carbon/src/Carbon/Lang/kde.php deleted file mode 100644 index fbcc9f3d..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/kde.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['Muhi', 'Chilo'], - 'weekdays' => ['Liduva lyapili', 'Liduva lyatatu', 'Liduva lyanchechi', 'Liduva lyannyano', 'Liduva lyannyano na linji', 'Liduva lyannyano na mavili', 'Liduva litandi'], - 'weekdays_short' => ['Ll2', 'Ll3', 'Ll4', 'Ll5', 'Ll6', 'Ll7', 'Ll1'], - 'weekdays_min' => ['Ll2', 'Ll3', 'Ll4', 'Ll5', 'Ll6', 'Ll7', 'Ll1'], - 'months' => ['Mwedi Ntandi', 'Mwedi wa Pili', 'Mwedi wa Tatu', 'Mwedi wa Nchechi', 'Mwedi wa Nnyano', 'Mwedi wa Nnyano na Umo', 'Mwedi wa Nnyano na Mivili', 'Mwedi wa Nnyano na Mitatu', 'Mwedi wa Nnyano na Nchechi', 'Mwedi wa Nnyano na Nnyano', 'Mwedi wa Nnyano na Nnyano na U', 'Mwedi wa Nnyano na Nnyano na M'], - 'months_short' => ['Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Sep', 'Okt', 'Nov', 'Des'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/kea.php b/vendor/nesbot/carbon/src/Carbon/Lang/kea.php deleted file mode 100644 index 8b6c21b9..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/kea.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['a', 'p'], - 'weekdays' => ['dumingu', 'sigunda-fera', 'tersa-fera', 'kuarta-fera', 'kinta-fera', 'sesta-fera', 'sabadu'], - 'weekdays_short' => ['dum', 'sig', 'ter', 'kua', 'kin', 'ses', 'sab'], - 'weekdays_min' => ['du', 'si', 'te', 'ku', 'ki', 'se', 'sa'], - 'weekdays_standalone' => ['dumingu', 'sigunda-fera', 'tersa-fera', 'kuarta-fera', 'kinta-fera', 'sesta-fera', 'sábadu'], - 'months' => ['Janeru', 'Febreru', 'Marsu', 'Abril', 'Maiu', 'Junhu', 'Julhu', 'Agostu', 'Setenbru', 'Otubru', 'Nuvenbru', 'Dizenbru'], - 'months_short' => ['Jan', 'Feb', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Otu', 'Nuv', 'Diz'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'D/M/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D [di] MMMM [di] YYYY HH:mm', - 'LLLL' => 'dddd, D [di] MMMM [di] YYYY HH:mm', - ], - - 'year' => ':count otunu', // less reliable - 'y' => ':count otunu', // less reliable - 'a_year' => ':count otunu', // less reliable - - 'week' => ':count día dumingu', // less reliable - 'w' => ':count día dumingu', // less reliable - 'a_week' => ':count día dumingu', // less reliable - - 'day' => ':count diâ', // less reliable - 'd' => ':count diâ', // less reliable - 'a_day' => ':count diâ', // less reliable - - 'minute' => ':count sugundu', // less reliable - 'min' => ':count sugundu', // less reliable - 'a_minute' => ':count sugundu', // less reliable - - 'second' => ':count dós', // less reliable - 's' => ':count dós', // less reliable - 'a_second' => ':count dós', // less reliable -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/khq.php b/vendor/nesbot/carbon/src/Carbon/Lang/khq.php deleted file mode 100644 index 7a834cf0..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/khq.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['Adduha', 'Aluula'], - 'weekdays' => ['Alhadi', 'Atini', 'Atalata', 'Alarba', 'Alhamiisa', 'Aljuma', 'Assabdu'], - 'weekdays_short' => ['Alh', 'Ati', 'Ata', 'Ala', 'Alm', 'Alj', 'Ass'], - 'weekdays_min' => ['Alh', 'Ati', 'Ata', 'Ala', 'Alm', 'Alj', 'Ass'], - 'months' => ['Žanwiye', 'Feewiriye', 'Marsi', 'Awiril', 'Me', 'Žuweŋ', 'Žuyye', 'Ut', 'Sektanbur', 'Oktoobur', 'Noowanbur', 'Deesanbur'], - 'months_short' => ['Žan', 'Fee', 'Mar', 'Awi', 'Me', 'Žuw', 'Žuy', 'Ut', 'Sek', 'Okt', 'Noo', 'Dee'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'D/M/YYYY', - 'LL' => 'D MMM, YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ki.php b/vendor/nesbot/carbon/src/Carbon/Lang/ki.php deleted file mode 100644 index d86afc50..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ki.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['Kiroko', 'Hwaĩ-inĩ'], - 'weekdays' => ['Kiumia', 'Njumatatũ', 'Njumaine', 'Njumatana', 'Aramithi', 'Njumaa', 'Njumamothi'], - 'weekdays_short' => ['KMA', 'NTT', 'NMN', 'NMT', 'ART', 'NMA', 'NMM'], - 'weekdays_min' => ['KMA', 'NTT', 'NMN', 'NMT', 'ART', 'NMA', 'NMM'], - 'months' => ['Njenuarĩ', 'Mwere wa kerĩ', 'Mwere wa gatatũ', 'Mwere wa kana', 'Mwere wa gatano', 'Mwere wa gatandatũ', 'Mwere wa mũgwanja', 'Mwere wa kanana', 'Mwere wa kenda', 'Mwere wa ikũmi', 'Mwere wa ikũmi na ũmwe', 'Ndithemba'], - 'months_short' => ['JEN', 'WKR', 'WGT', 'WKN', 'WTN', 'WTD', 'WMJ', 'WNN', 'WKD', 'WIK', 'WMW', 'DIT'], - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], - - 'year' => ':count mĩaka', // less reliable - 'y' => ':count mĩaka', // less reliable - 'a_year' => ':count mĩaka', // less reliable - - 'month' => ':count mweri', // less reliable - 'm' => ':count mweri', // less reliable - 'a_month' => ':count mweri', // less reliable - - 'week' => ':count kiumia', // less reliable - 'w' => ':count kiumia', // less reliable - 'a_week' => ':count kiumia', // less reliable - - 'day' => ':count mũthenya', // less reliable - 'd' => ':count mũthenya', // less reliable - 'a_day' => ':count mũthenya', // less reliable - - 'hour' => ':count thaa', // less reliable - 'h' => ':count thaa', // less reliable - 'a_hour' => ':count thaa', // less reliable - - 'minute' => ':count mundu', // less reliable - 'min' => ':count mundu', // less reliable - 'a_minute' => ':count mundu', // less reliable - - 'second' => ':count igego', // less reliable - 's' => ':count igego', // less reliable - 'a_second' => ':count igego', // less reliable -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/kk.php b/vendor/nesbot/carbon/src/Carbon/Lang/kk.php deleted file mode 100644 index 59fa9aff..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/kk.php +++ /dev/null @@ -1,103 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Josh Soref - * - François B - * - Talat Uspanov - * - Нурлан Рахимжанов - * - Toleugazy Kali - */ -return [ - 'year' => ':count жыл', - 'a_year' => '{1}бір жыл|:count жыл', - 'y' => ':count ж.', - 'month' => ':count ай', - 'a_month' => '{1}бір ай|:count ай', - 'm' => ':count ай', - 'week' => ':count апта', - 'a_week' => '{1}бір апта', - 'w' => ':count ап.', - 'day' => ':count күн', - 'a_day' => '{1}бір күн|:count күн', - 'd' => ':count к.', - 'hour' => ':count сағат', - 'a_hour' => '{1}бір сағат|:count сағат', - 'h' => ':count са.', - 'minute' => ':count минут', - 'a_minute' => '{1}бір минут|:count минут', - 'min' => ':count м.', - 'second' => ':count секунд', - 'a_second' => '{1}бірнеше секунд|:count секунд', - 's' => ':count се.', - 'ago' => ':time бұрын', - 'from_now' => ':time ішінде', - 'after' => ':time кейін', - 'before' => ':time бұрын', - 'diff_now' => 'қазір', - 'diff_today' => 'Бүгін', - 'diff_today_regexp' => 'Бүгін(?:\\s+сағат)?', - 'diff_yesterday' => 'кеше', - 'diff_yesterday_regexp' => 'Кеше(?:\\s+сағат)?', - 'diff_tomorrow' => 'ертең', - 'diff_tomorrow_regexp' => 'Ертең(?:\\s+сағат)?', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD.MM.YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[Бүгін сағат] LT', - 'nextDay' => '[Ертең сағат] LT', - 'nextWeek' => 'dddd [сағат] LT', - 'lastDay' => '[Кеше сағат] LT', - 'lastWeek' => '[Өткен аптаның] dddd [сағат] LT', - 'sameElse' => 'L', - ], - 'ordinal' => function ($number) { - static $suffixes = [ - 0 => '-ші', - 1 => '-ші', - 2 => '-ші', - 3 => '-ші', - 4 => '-ші', - 5 => '-ші', - 6 => '-шы', - 7 => '-ші', - 8 => '-ші', - 9 => '-шы', - 10 => '-шы', - 20 => '-шы', - 30 => '-шы', - 40 => '-шы', - 50 => '-ші', - 60 => '-шы', - 70 => '-ші', - 80 => '-ші', - 90 => '-шы', - 100 => '-ші', - ]; - - return $number.($suffixes[$number] ?? $suffixes[$number % 10] ?? $suffixes[$number >= 100 ? 100 : -1] ?? ''); - }, - 'months' => ['қаңтар', 'ақпан', 'наурыз', 'сәуір', 'мамыр', 'маусым', 'шілде', 'тамыз', 'қыркүйек', 'қазан', 'қараша', 'желтоқсан'], - 'months_short' => ['қаң', 'ақп', 'нау', 'сәу', 'мам', 'мау', 'шіл', 'там', 'қыр', 'қаз', 'қар', 'жел'], - 'weekdays' => ['жексенбі', 'дүйсенбі', 'сейсенбі', 'сәрсенбі', 'бейсенбі', 'жұма', 'сенбі'], - 'weekdays_short' => ['жек', 'дүй', 'сей', 'сәр', 'бей', 'жұм', 'сен'], - 'weekdays_min' => ['жк', 'дй', 'сй', 'ср', 'бй', 'жм', 'сн'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'list' => [', ', ' және '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/kk_KZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/kk_KZ.php deleted file mode 100644 index 7dc5ebcc..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/kk_KZ.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/kk.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/kkj.php b/vendor/nesbot/carbon/src/Carbon/Lang/kkj.php deleted file mode 100644 index 6a1e77a8..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/kkj.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/kl.php b/vendor/nesbot/carbon/src/Carbon/Lang/kl.php deleted file mode 100644 index 7329a075..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/kl.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/kl_GL.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/kl_GL.php b/vendor/nesbot/carbon/src/Carbon/Lang/kl_GL.php deleted file mode 100644 index 4fed720a..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/kl_GL.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Danish Standards Association bug-glibc-locales@gnu.org - * - John Eyðstein Johannesen (mashema) - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD.MM.YYYY', - 'LL' => 'D. MMMM YYYY', - 'LLL' => 'D. MMMM YYYY HH:mm', - 'LLLL' => 'dddd [d.] D. MMMM YYYY [kl.] HH:mm', - ], - 'months' => ['januaarip', 'februaarip', 'marsip', 'apriilip', 'maajip', 'juunip', 'juulip', 'aggustip', 'septembarip', 'oktobarip', 'novembarip', 'decembarip'], - 'months_short' => ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'], - 'weekdays' => ['sapaat', 'ataasinngorneq', 'marlunngorneq', 'pingasunngorneq', 'sisamanngorneq', 'tallimanngorneq', 'arfininngorneq'], - 'weekdays_short' => ['sap', 'ata', 'mar', 'pin', 'sis', 'tal', 'arf'], - 'weekdays_min' => ['sap', 'ata', 'mar', 'pin', 'sis', 'tal', 'arf'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - - 'year' => '{1}ukioq :count|{0}:count ukiut|]1,Inf[ukiut :count', - 'a_year' => '{1}ukioq|{0}:count ukiut|]1,Inf[ukiut :count', - 'y' => '{1}:countyr|{0}:countyrs|]1,Inf[:countyrs', - - 'month' => '{1}qaammat :count|{0}:count qaammatit|]1,Inf[qaammatit :count', - 'a_month' => '{1}qaammat|{0}:count qaammatit|]1,Inf[qaammatit :count', - 'm' => '{1}:countmo|{0}:countmos|]1,Inf[:countmos', - - 'week' => '{1}:count sap. ak.|{0}:count sap. ak.|]1,Inf[:count sap. ak.', - 'a_week' => '{1}a sap. ak.|{0}:count sap. ak.|]1,Inf[:count sap. ak.', - 'w' => ':countw', - - 'day' => '{1}:count ulloq|{0}:count ullut|]1,Inf[:count ullut', - 'a_day' => '{1}a ulloq|{0}:count ullut|]1,Inf[:count ullut', - 'd' => ':countd', - - 'hour' => '{1}:count tiimi|{0}:count tiimit|]1,Inf[:count tiimit', - 'a_hour' => '{1}tiimi|{0}:count tiimit|]1,Inf[:count tiimit', - 'h' => ':counth', - - 'minute' => '{1}:count minutsi|{0}:count minutsit|]1,Inf[:count minutsit', - 'a_minute' => '{1}a minutsi|{0}:count minutsit|]1,Inf[:count minutsit', - 'min' => ':countm', - - 'second' => '{1}:count sikunti|{0}:count sikuntit|]1,Inf[:count sikuntit', - 'a_second' => '{1}sikunti|{0}:count sikuntit|]1,Inf[:count sikuntit', - 's' => ':counts', - - 'ago' => ':time matuma siorna', - -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/kln.php b/vendor/nesbot/carbon/src/Carbon/Lang/kln.php deleted file mode 100644 index b9c39968..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/kln.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['krn', 'koosk'], - 'weekdays' => ['Kotisap', 'Kotaai', 'Koaeng’', 'Kosomok', 'Koang’wan', 'Komuut', 'Kolo'], - 'weekdays_short' => ['Kts', 'Kot', 'Koo', 'Kos', 'Koa', 'Kom', 'Kol'], - 'weekdays_min' => ['Kts', 'Kot', 'Koo', 'Kos', 'Koa', 'Kom', 'Kol'], - 'months' => ['Mulgul', 'Ng’atyaato', 'Kiptaamo', 'Iwootkuut', 'Mamuut', 'Paagi', 'Ng’eiyeet', 'Rooptui', 'Bureet', 'Epeeso', 'Kipsuunde ne taai', 'Kipsuunde nebo aeng’'], - 'months_short' => ['Mul', 'Ngat', 'Taa', 'Iwo', 'Mam', 'Paa', 'Nge', 'Roo', 'Bur', 'Epe', 'Kpt', 'Kpa'], - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], - - 'year' => ':count maghatiat', // less reliable - 'y' => ':count maghatiat', // less reliable - 'a_year' => ':count maghatiat', // less reliable -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/km.php b/vendor/nesbot/carbon/src/Carbon/Lang/km.php deleted file mode 100644 index da790ac8..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/km.php +++ /dev/null @@ -1,71 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Kruy Vanna - * - Sereysethy Touch - * - JD Isaacks - * - Sovichet Tep - */ -return [ - 'year' => '{1}មួយឆ្នាំ|]1,Inf[:count ឆ្នាំ', - 'y' => ':count ឆ្នាំ', - 'month' => '{1}មួយខែ|]1,Inf[:count ខែ', - 'm' => ':count ខែ', - 'week' => ':count សប្ដាហ៍', - 'w' => ':count សប្ដាហ៍', - 'day' => '{1}មួយថ្ងៃ|]1,Inf[:count ថ្ងៃ', - 'd' => ':count ថ្ងៃ', - 'hour' => '{1}មួយម៉ោង|]1,Inf[:count ម៉ោង', - 'h' => ':count ម៉ោង', - 'minute' => '{1}មួយនាទី|]1,Inf[:count នាទី', - 'min' => ':count នាទី', - 'second' => '{1}ប៉ុន្មានវិនាទី|]1,Inf[:count វិនាទី', - 's' => ':count វិនាទី', - 'ago' => ':timeមុន', - 'from_now' => ':timeទៀត', - 'after' => 'នៅ​ក្រោយ :time', - 'before' => 'នៅ​មុន :time', - 'diff_now' => 'ឥឡូវ', - 'diff_today' => 'ថ្ងៃនេះ', - 'diff_today_regexp' => 'ថ្ងៃនេះ(?:\\s+ម៉ោង)?', - 'diff_yesterday' => 'ម្សិលមិញ', - 'diff_yesterday_regexp' => 'ម្សិលមិញ(?:\\s+ម៉ោង)?', - 'diff_tomorrow' => 'ថ្ងៃ​ស្អែក', - 'diff_tomorrow_regexp' => 'ស្អែក(?:\\s+ម៉ោង)?', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[ថ្ងៃនេះ ម៉ោង] LT', - 'nextDay' => '[ស្អែក ម៉ោង] LT', - 'nextWeek' => 'dddd [ម៉ោង] LT', - 'lastDay' => '[ម្សិលមិញ ម៉ោង] LT', - 'lastWeek' => 'dddd [សប្តាហ៍មុន] [ម៉ោង] LT', - 'sameElse' => 'L', - ], - 'ordinal' => 'ទី:number', - 'meridiem' => ['ព្រឹក', 'ល្ងាច'], - 'months' => ['មករា', 'កុម្ភៈ', 'មីនា', 'មេសា', 'ឧសភា', 'មិថុនា', 'កក្កដា', 'សីហា', 'កញ្ញា', 'តុលា', 'វិច្ឆិកា', 'ធ្នូ'], - 'months_short' => ['មករា', 'កុម្ភៈ', 'មីនា', 'មេសា', 'ឧសភា', 'មិថុនា', 'កក្កដា', 'សីហា', 'កញ្ញា', 'តុលា', 'វិច្ឆិកា', 'ធ្នូ'], - 'weekdays' => ['អាទិត្យ', 'ច័ន្ទ', 'អង្គារ', 'ពុធ', 'ព្រហស្បតិ៍', 'សុក្រ', 'សៅរ៍'], - 'weekdays_short' => ['អា', 'ច', 'អ', 'ព', 'ព្រ', 'សុ', 'ស'], - 'weekdays_min' => ['អា', 'ច', 'អ', 'ព', 'ព្រ', 'សុ', 'ស'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', 'និង '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/km_KH.php b/vendor/nesbot/carbon/src/Carbon/Lang/km_KH.php deleted file mode 100644 index 92e5fdbd..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/km_KH.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/km.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/kn.php b/vendor/nesbot/carbon/src/Carbon/Lang/kn.php deleted file mode 100644 index 0d2ad08b..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/kn.php +++ /dev/null @@ -1,75 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Josh Soref - * - MOHAN M U - * - François B - * - rajeevnaikte - */ -return [ - 'year' => '{1}ಒಂದು ವರ್ಷ|]1,Inf[:count ವರ್ಷ', - 'month' => '{1}ಒಂದು ತಿಂಗಳು|]1,Inf[:count ತಿಂಗಳು', - 'week' => '{1}ಒಂದು ವಾರ|]1,Inf[:count ವಾರಗಳು', - 'day' => '{1}ಒಂದು ದಿನ|]1,Inf[:count ದಿನ', - 'hour' => '{1}ಒಂದು ಗಂಟೆ|]1,Inf[:count ಗಂಟೆ', - 'minute' => '{1}ಒಂದು ನಿಮಿಷ|]1,Inf[:count ನಿಮಿಷ', - 'second' => '{1}ಕೆಲವು ಕ್ಷಣಗಳು|]1,Inf[:count ಸೆಕೆಂಡುಗಳು', - 'ago' => ':time ಹಿಂದೆ', - 'from_now' => ':time ನಂತರ', - 'diff_now' => 'ಈಗ', - 'diff_today' => 'ಇಂದು', - 'diff_yesterday' => 'ನಿನ್ನೆ', - 'diff_tomorrow' => 'ನಾಳೆ', - 'formats' => [ - 'LT' => 'A h:mm', - 'LTS' => 'A h:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY, A h:mm', - 'LLLL' => 'dddd, D MMMM YYYY, A h:mm', - ], - 'calendar' => [ - 'sameDay' => '[ಇಂದು] LT', - 'nextDay' => '[ನಾಳೆ] LT', - 'nextWeek' => 'dddd, LT', - 'lastDay' => '[ನಿನ್ನೆ] LT', - 'lastWeek' => '[ಕೊನೆಯ] dddd, LT', - 'sameElse' => 'L', - ], - 'ordinal' => ':numberನೇ', - 'meridiem' => function ($hour) { - if ($hour < 4) { - return 'ರಾತ್ರಿ'; - } - if ($hour < 10) { - return 'ಬೆಳಿಗ್ಗೆ'; - } - if ($hour < 17) { - return 'ಮಧ್ಯಾಹ್ನ'; - } - if ($hour < 20) { - return 'ಸಂಜೆ'; - } - - return 'ರಾತ್ರಿ'; - }, - 'months' => ['ಜನವರಿ', 'ಫೆಬ್ರವರಿ', 'ಮಾರ್ಚ್', 'ಏಪ್ರಿಲ್', 'ಮೇ', 'ಜೂನ್', 'ಜುಲೈ', 'ಆಗಸ್ಟ್', 'ಸೆಪ್ಟೆಂಬರ್', 'ಅಕ್ಟೋಬರ್', 'ನವೆಂಬರ್', 'ಡಿಸೆಂಬರ್'], - 'months_short' => ['ಜನ', 'ಫೆಬ್ರ', 'ಮಾರ್ಚ್', 'ಏಪ್ರಿಲ್', 'ಮೇ', 'ಜೂನ್', 'ಜುಲೈ', 'ಆಗಸ್ಟ್', 'ಸೆಪ್ಟೆಂ', 'ಅಕ್ಟೋ', 'ನವೆಂ', 'ಡಿಸೆಂ'], - 'weekdays' => ['ಭಾನುವಾರ', 'ಸೋಮವಾರ', 'ಮಂಗಳವಾರ', 'ಬುಧವಾರ', 'ಗುರುವಾರ', 'ಶುಕ್ರವಾರ', 'ಶನಿವಾರ'], - 'weekdays_short' => ['ಭಾನು', 'ಸೋಮ', 'ಮಂಗಳ', 'ಬುಧ', 'ಗುರು', 'ಶುಕ್ರ', 'ಶನಿ'], - 'weekdays_min' => ['ಭಾ', 'ಸೋ', 'ಮಂ', 'ಬು', 'ಗು', 'ಶು', 'ಶ'], - 'list' => ', ', - 'first_day_of_week' => 0, - 'day_of_first_week_of_year' => 1, - 'weekend' => [0, 0], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/kn_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/kn_IN.php deleted file mode 100644 index 30e3d886..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/kn_IN.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/kn.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ko.php b/vendor/nesbot/carbon/src/Carbon/Lang/ko.php deleted file mode 100644 index 4fa62376..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ko.php +++ /dev/null @@ -1,91 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Kunal Marwaha - * - FourwingsY - * - François B - * - Jason Katz-Brown - * - Seokjun Kim - * - Junho Kim - * - JD Isaacks - * - Juwon Kim - */ -return [ - 'year' => ':count년', - 'a_year' => '{1}일년|]1,Inf[:count년', - 'y' => ':count년', - 'month' => ':count개월', - 'a_month' => '{1}한달|]1,Inf[:count개월', - 'm' => ':count개월', - 'week' => ':count주', - 'a_week' => '{1}일주일|]1,Inf[:count 주', - 'w' => ':count주일', - 'day' => ':count일', - 'a_day' => '{1}하루|]1,Inf[:count일', - 'd' => ':count일', - 'hour' => ':count시간', - 'a_hour' => '{1}한시간|]1,Inf[:count시간', - 'h' => ':count시간', - 'minute' => ':count분', - 'a_minute' => '{1}일분|]1,Inf[:count분', - 'min' => ':count분', - 'second' => ':count초', - 'a_second' => '{1}몇초|]1,Inf[:count초', - 's' => ':count초', - 'ago' => ':time 전', - 'from_now' => ':time 후', - 'after' => ':time 후', - 'before' => ':time 전', - 'diff_now' => '지금', - 'diff_today' => '오늘', - 'diff_yesterday' => '어제', - 'diff_tomorrow' => '내일', - 'formats' => [ - 'LT' => 'A h:mm', - 'LTS' => 'A h:mm:ss', - 'L' => 'YYYY.MM.DD.', - 'LL' => 'YYYY년 MMMM D일', - 'LLL' => 'YYYY년 MMMM D일 A h:mm', - 'LLLL' => 'YYYY년 MMMM D일 dddd A h:mm', - ], - 'calendar' => [ - 'sameDay' => '오늘 LT', - 'nextDay' => '내일 LT', - 'nextWeek' => 'dddd LT', - 'lastDay' => '어제 LT', - 'lastWeek' => '지난주 dddd LT', - 'sameElse' => 'L', - ], - 'ordinal' => function ($number, $period) { - switch ($period) { - case 'd': - case 'D': - case 'DDD': - return $number.'일'; - case 'M': - return $number.'월'; - case 'w': - case 'W': - return $number.'주'; - default: - return $number; - } - }, - 'meridiem' => ['오전', '오후'], - 'months' => ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], - 'months_short' => ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], - 'weekdays' => ['일요일', '월요일', '화요일', '수요일', '목요일', '금요일', '토요일'], - 'weekdays_short' => ['일', '월', '화', '수', '목', '금', '토'], - 'weekdays_min' => ['일', '월', '화', '수', '목', '금', '토'], - 'list' => ' ', -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ko_KP.php b/vendor/nesbot/carbon/src/Carbon/Lang/ko_KP.php deleted file mode 100644 index 4ba802b3..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ko_KP.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/ko.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ko_KR.php b/vendor/nesbot/carbon/src/Carbon/Lang/ko_KR.php deleted file mode 100644 index 9d873a27..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ko_KR.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/ko.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/kok.php b/vendor/nesbot/carbon/src/Carbon/Lang/kok.php deleted file mode 100644 index 4adcddcc..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/kok.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/kok_IN.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/kok_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/kok_IN.php deleted file mode 100644 index 92ba844c..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/kok_IN.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Red Hat, Pune bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'D-M-YY', - ], - 'months' => ['जानेवारी', 'फेब्रुवारी', 'मार्च', 'एप्रिल', 'मे', 'जून', 'जुलै', 'ओगस्ट', 'सेप्टेंबर', 'ओक्टोबर', 'नोव्हेंबर', 'डिसेंबर'], - 'months_short' => ['जानेवारी', 'फेब्रुवारी', 'मार्च', 'एप्रिल', 'मे', 'जून', 'जुलै', 'ओगस्ट', 'सेप्टेंबर', 'ओक्टोबर', 'नोव्हेंबर', 'डिसेंबर'], - 'weekdays' => ['आयतार', 'सोमार', 'मंगळवार', 'बुधवार', 'बेरेसतार', 'शुकरार', 'शेनवार'], - 'weekdays_short' => ['आयतार', 'सोमार', 'मंगळवार', 'बुधवार', 'बेरेसतार', 'शुकरार', 'शेनवार'], - 'weekdays_min' => ['आयतार', 'सोमार', 'मंगळवार', 'बुधवार', 'बेरेसतार', 'शुकरार', 'शेनवार'], - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['म.पू.', 'म.नं.'], - - 'year' => ':count वैशाकु', // less reliable - 'y' => ':count वैशाकु', // less reliable - 'a_year' => ':count वैशाकु', // less reliable - - 'week' => ':count आदित्यवार', // less reliable - 'w' => ':count आदित्यवार', // less reliable - 'a_week' => ':count आदित्यवार', // less reliable - - 'minute' => ':count नोंद', // less reliable - 'min' => ':count नोंद', // less reliable - 'a_minute' => ':count नोंद', // less reliable - - 'second' => ':count तेंको', // less reliable - 's' => ':count तेंको', // less reliable - 'a_second' => ':count तेंको', // less reliable - - 'month' => ':count मैनो', - 'm' => ':count मैनो', - 'a_month' => ':count मैनो', - - 'day' => ':count दिवसु', - 'd' => ':count दिवसु', - 'a_day' => ':count दिवसु', - - 'hour' => ':count घंते', - 'h' => ':count घंते', - 'a_hour' => ':count घंते', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ks.php b/vendor/nesbot/carbon/src/Carbon/Lang/ks.php deleted file mode 100644 index 98760790..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ks.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/ks_IN.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ks_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/ks_IN.php deleted file mode 100644 index ce9d5d4a..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ks_IN.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Red Hat, Pune bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'M/D/YY', - ], - 'months' => ['جنؤری', 'فرؤری', 'مارٕچ', 'اپریل', 'میٔ', 'جوٗن', 'جوٗلایی', 'اگست', 'ستمبر', 'اکتوٗبر', 'نومبر', 'دسمبر'], - 'months_short' => ['جنؤری', 'فرؤری', 'مارٕچ', 'اپریل', 'میٔ', 'جوٗن', 'جوٗلایی', 'اگست', 'ستمبر', 'اکتوٗبر', 'نومبر', 'دسمبر'], - 'weekdays' => ['آتهوار', 'ژءندروار', 'بوءںوار', 'بودهوار', 'برىسوار', 'جمع', 'بٹوار'], - 'weekdays_short' => ['آتهوار', 'ژءنتروار', 'بوءںوار', 'بودهوار', 'برىسوار', 'جمع', 'بٹوار'], - 'weekdays_min' => ['آتهوار', 'ژءنتروار', 'بوءںوار', 'بودهوار', 'برىسوار', 'جمع', 'بٹوار'], - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['دوپھربرونھ', 'دوپھرپتھ'], - - 'year' => ':count آب', // less reliable - 'y' => ':count آب', // less reliable - 'a_year' => ':count آب', // less reliable - - 'month' => ':count रान्', // less reliable - 'm' => ':count रान्', // less reliable - 'a_month' => ':count रान्', // less reliable - - 'week' => ':count آتھٕوار', // less reliable - 'w' => ':count آتھٕوار', // less reliable - 'a_week' => ':count آتھٕوار', // less reliable - - 'hour' => ':count سۄن', // less reliable - 'h' => ':count سۄن', // less reliable - 'a_hour' => ':count سۄن', // less reliable - - 'minute' => ':count فَن', // less reliable - 'min' => ':count فَن', // less reliable - 'a_minute' => ':count فَن', // less reliable - - 'second' => ':count दोʼयुम', // less reliable - 's' => ':count दोʼयुम', // less reliable - 'a_second' => ':count दोʼयुम', // less reliable -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ks_IN@devanagari.php b/vendor/nesbot/carbon/src/Carbon/Lang/ks_IN@devanagari.php deleted file mode 100644 index a2ae8b64..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ks_IN@devanagari.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - ks-gnome-trans-commits@lists.code.indlinux.net - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'M/D/YY', - ], - 'months' => ['जनवरी', 'फ़रवरी', 'मार्च', 'अप्रेल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर'], - 'months_short' => ['जनवरी', 'फ़रवरी', 'मार्च', 'अप्रेल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर'], - 'weekdays' => ['आथवार', 'चॅ़दुरवार', 'बोमवार', 'ब्वदवार', 'ब्रसवार', 'शोकुरवार', 'बटुवार'], - 'weekdays_short' => ['आथ ', 'चॅ़दुर', 'बोम', 'ब्वद', 'ब्रस', 'शोकुर', 'बटु'], - 'weekdays_min' => ['आथ ', 'चॅ़दुर', 'बोम', 'ब्वद', 'ब्रस', 'शोकुर', 'बटु'], - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['पूर्वाह्न', 'अपराह्न'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ksb.php b/vendor/nesbot/carbon/src/Carbon/Lang/ksb.php deleted file mode 100644 index aaa00614..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ksb.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['makeo', 'nyiaghuo'], - 'weekdays' => ['Jumaapii', 'Jumaatatu', 'Jumaane', 'Jumaatano', 'Alhamisi', 'Ijumaa', 'Jumaamosi'], - 'weekdays_short' => ['Jpi', 'Jtt', 'Jmn', 'Jtn', 'Alh', 'Iju', 'Jmo'], - 'weekdays_min' => ['Jpi', 'Jtt', 'Jmn', 'Jtn', 'Alh', 'Iju', 'Jmo'], - 'months' => ['Januali', 'Febluali', 'Machi', 'Aplili', 'Mei', 'Juni', 'Julai', 'Agosti', 'Septemba', 'Oktoba', 'Novemba', 'Desemba'], - 'months_short' => ['Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Sep', 'Okt', 'Nov', 'Des'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ksf.php b/vendor/nesbot/carbon/src/Carbon/Lang/ksf.php deleted file mode 100644 index 84a59672..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ksf.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['sárúwá', 'cɛɛ́nko'], - 'weekdays' => ['sɔ́ndǝ', 'lǝndí', 'maadí', 'mɛkrɛdí', 'jǝǝdí', 'júmbá', 'samdí'], - 'weekdays_short' => ['sɔ́n', 'lǝn', 'maa', 'mɛk', 'jǝǝ', 'júm', 'sam'], - 'weekdays_min' => ['sɔ́n', 'lǝn', 'maa', 'mɛk', 'jǝǝ', 'júm', 'sam'], - 'months' => ['ŋwíí a ntɔ́ntɔ', 'ŋwíí akǝ bɛ́ɛ', 'ŋwíí akǝ ráá', 'ŋwíí akǝ nin', 'ŋwíí akǝ táan', 'ŋwíí akǝ táafɔk', 'ŋwíí akǝ táabɛɛ', 'ŋwíí akǝ táaraa', 'ŋwíí akǝ táanin', 'ŋwíí akǝ ntɛk', 'ŋwíí akǝ ntɛk di bɔ́k', 'ŋwíí akǝ ntɛk di bɛ́ɛ'], - 'months_short' => ['ŋ1', 'ŋ2', 'ŋ3', 'ŋ4', 'ŋ5', 'ŋ6', 'ŋ7', 'ŋ8', 'ŋ9', 'ŋ10', 'ŋ11', 'ŋ12'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'D/M/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ksh.php b/vendor/nesbot/carbon/src/Carbon/Lang/ksh.php deleted file mode 100644 index 95457e24..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ksh.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['v.M.', 'n.M.'], - 'weekdays' => ['Sunndaach', 'Mohndaach', 'Dinnsdaach', 'Metwoch', 'Dunnersdaach', 'Friidaach', 'Samsdaach'], - 'weekdays_short' => ['Su.', 'Mo.', 'Di.', 'Me.', 'Du.', 'Fr.', 'Sa.'], - 'weekdays_min' => ['Su', 'Mo', 'Di', 'Me', 'Du', 'Fr', 'Sa'], - 'months' => ['Jannewa', 'Fäbrowa', 'Määz', 'Aprell', 'Mai', 'Juuni', 'Juuli', 'Oujoß', 'Septämber', 'Oktohber', 'Novämber', 'Dezämber'], - 'months_short' => ['Jan', 'Fäb', 'Mäz', 'Apr', 'Mai', 'Jun', 'Jul', 'Ouj', 'Säp', 'Okt', 'Nov', 'Dez'], - 'months_short_standalone' => ['Jan.', 'Fäb.', 'Mäz.', 'Apr.', 'Mai', 'Jun.', 'Jul.', 'Ouj.', 'Säp.', 'Okt.', 'Nov.', 'Dez.'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'D. M. YYYY', - 'LL' => 'D. MMM. YYYY', - 'LLL' => 'D. MMMM YYYY HH:mm', - 'LLLL' => 'dddd, [dä] D. MMMM YYYY HH:mm', - ], - - 'year' => ':count Johr', - 'y' => ':count Johr', - 'a_year' => ':count Johr', - - 'month' => ':count Moohnd', - 'm' => ':count Moohnd', - 'a_month' => ':count Moohnd', - - 'week' => ':count woch', - 'w' => ':count woch', - 'a_week' => ':count woch', - - 'day' => ':count Daach', - 'd' => ':count Daach', - 'a_day' => ':count Daach', - - 'hour' => ':count Uhr', - 'h' => ':count Uhr', - 'a_hour' => ':count Uhr', - - 'minute' => ':count Menutt', - 'min' => ':count Menutt', - 'a_minute' => ':count Menutt', - - 'second' => ':count Sekůndt', - 's' => ':count Sekůndt', - 'a_second' => ':count Sekůndt', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ku.php b/vendor/nesbot/carbon/src/Carbon/Lang/ku.php deleted file mode 100644 index 189960c8..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ku.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Unicode, Inc. - */ - -return [ - 'ago' => 'berî :time', - 'from_now' => 'di :time de', - 'after' => ':time piştî', - 'before' => ':time berê', - 'year' => ':count sal', - 'year_ago' => ':count salê|:count salan', - 'year_from_now' => 'salekê|:count salan', - 'month' => ':count meh', - 'week' => ':count hefte', - 'day' => ':count roj', - 'hour' => ':count saet', - 'minute' => ':count deqîqe', - 'second' => ':count saniye', - 'months' => ['rêbendanê', 'reşemiyê', 'adarê', 'avrêlê', 'gulanê', 'pûşperê', 'tîrmehê', 'gelawêjê', 'rezberê', 'kewçêrê', 'sermawezê', 'berfanbarê'], - 'months_standalone' => ['rêbendan', 'reşemî', 'adar', 'avrêl', 'gulan', 'pûşper', 'tîrmeh', 'gelawêj', 'rezber', 'kewçêr', 'sermawez', 'berfanbar'], - 'months_short' => ['rêb', 'reş', 'ada', 'avr', 'gul', 'pûş', 'tîr', 'gel', 'rez', 'kew', 'ser', 'ber'], - 'weekdays' => ['yekşem', 'duşem', 'sêşem', 'çarşem', 'pêncşem', 'în', 'şemî'], - 'weekdays_short' => ['yş', 'dş', 'sş', 'çş', 'pş', 'în', 'ş'], - 'weekdays_min' => ['Y', 'D', 'S', 'Ç', 'P', 'Î', 'Ş'], - 'list' => [', ', ' û '], - 'first_day_of_week' => 6, - 'day_of_first_week_of_year' => 1, -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ku_TR.php b/vendor/nesbot/carbon/src/Carbon/Lang/ku_TR.php deleted file mode 100644 index 4243a82f..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ku_TR.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/ku.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/kw.php b/vendor/nesbot/carbon/src/Carbon/Lang/kw.php deleted file mode 100644 index 26e242e7..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/kw.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/kw_GB.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/kw_GB.php b/vendor/nesbot/carbon/src/Carbon/Lang/kw_GB.php deleted file mode 100644 index 00bf52bd..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/kw_GB.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Alastair McKinstry bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YY', - ], - 'months' => ['mis Genver', 'mis Hwevrer', 'mis Meurth', 'mis Ebrel', 'mis Me', 'mis Metheven', 'mis Gortheren', 'mis Est', 'mis Gwynngala', 'mis Hedra', 'mis Du', 'mis Kevardhu'], - 'months_short' => ['Gen', 'Hwe', 'Meu', 'Ebr', 'Me', 'Met', 'Gor', 'Est', 'Gwn', 'Hed', 'Du', 'Kev'], - 'weekdays' => ['De Sul', 'De Lun', 'De Merth', 'De Merher', 'De Yow', 'De Gwener', 'De Sadorn'], - 'weekdays_short' => ['Sul', 'Lun', 'Mth', 'Mhr', 'Yow', 'Gwe', 'Sad'], - 'weekdays_min' => ['Sul', 'Lun', 'Mth', 'Mhr', 'Yow', 'Gwe', 'Sad'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - - 'year' => ':count bledhen', - 'y' => ':count bledhen', - 'a_year' => ':count bledhen', - - 'month' => ':count mis', - 'm' => ':count mis', - 'a_month' => ':count mis', - - 'week' => ':count seythen', - 'w' => ':count seythen', - 'a_week' => ':count seythen', - - 'day' => ':count dydh', - 'd' => ':count dydh', - 'a_day' => ':count dydh', - - 'hour' => ':count eur', - 'h' => ':count eur', - 'a_hour' => ':count eur', - - 'minute' => ':count mynysen', - 'min' => ':count mynysen', - 'a_minute' => ':count mynysen', - - 'second' => ':count pryjwyth', - 's' => ':count pryjwyth', - 'a_second' => ':count pryjwyth', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ky.php b/vendor/nesbot/carbon/src/Carbon/Lang/ky.php deleted file mode 100644 index e0d1af10..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ky.php +++ /dev/null @@ -1,106 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - acutexyz - * - Josh Soref - * - François B - * - Chyngyz Arystan uulu - * - Chyngyz - * - acutexyz - * - Josh Soref - * - François B - * - Chyngyz Arystan uulu - */ -return [ - 'year' => ':count жыл', - 'a_year' => '{1}бир жыл|:count жыл', - 'y' => ':count жыл', - 'month' => ':count ай', - 'a_month' => '{1}бир ай|:count ай', - 'm' => ':count ай', - 'week' => ':count апта', - 'a_week' => '{1}бир апта|:count апта', - 'w' => ':count апт.', - 'day' => ':count күн', - 'a_day' => '{1}бир күн|:count күн', - 'd' => ':count күн', - 'hour' => ':count саат', - 'a_hour' => '{1}бир саат|:count саат', - 'h' => ':count саат.', - 'minute' => ':count мүнөт', - 'a_minute' => '{1}бир мүнөт|:count мүнөт', - 'min' => ':count мүн.', - 'second' => ':count секунд', - 'a_second' => '{1}бирнече секунд|:count секунд', - 's' => ':count сек.', - 'ago' => ':time мурун', - 'from_now' => ':time ичинде', - 'diff_now' => 'азыр', - 'diff_today' => 'Бүгүн', - 'diff_today_regexp' => 'Бүгүн(?:\\s+саат)?', - 'diff_yesterday' => 'кечээ', - 'diff_yesterday_regexp' => 'Кече(?:\\s+саат)?', - 'diff_tomorrow' => 'эртең', - 'diff_tomorrow_regexp' => 'Эртең(?:\\s+саат)?', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD.MM.YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[Бүгүн саат] LT', - 'nextDay' => '[Эртең саат] LT', - 'nextWeek' => 'dddd [саат] LT', - 'lastDay' => '[Кече саат] LT', - 'lastWeek' => '[Өткен аптанын] dddd [күнү] [саат] LT', - 'sameElse' => 'L', - ], - 'ordinal' => function ($number) { - static $suffixes = [ - 0 => '-чү', - 1 => '-чи', - 2 => '-чи', - 3 => '-чү', - 4 => '-чү', - 5 => '-чи', - 6 => '-чы', - 7 => '-чи', - 8 => '-чи', - 9 => '-чу', - 10 => '-чу', - 20 => '-чы', - 30 => '-чу', - 40 => '-чы', - 50 => '-чү', - 60 => '-чы', - 70 => '-чи', - 80 => '-чи', - 90 => '-чу', - 100 => '-чү', - ]; - - return $number.($suffixes[$number] ?? $suffixes[$number % 10] ?? $suffixes[$number >= 100 ? 100 : -1] ?? ''); - }, - 'months' => ['январь', 'февраль', 'март', 'апрель', 'май', 'июнь', 'июль', 'август', 'сентябрь', 'октябрь', 'ноябрь', 'декабрь'], - 'months_short' => ['янв', 'фев', 'март', 'апр', 'май', 'июнь', 'июль', 'авг', 'сен', 'окт', 'ноя', 'дек'], - 'weekdays' => ['Жекшемби', 'Дүйшөмбү', 'Шейшемби', 'Шаршемби', 'Бейшемби', 'Жума', 'Ишемби'], - 'weekdays_short' => ['Жек', 'Дүй', 'Шей', 'Шар', 'Бей', 'Жум', 'Ише'], - 'weekdays_min' => ['Жк', 'Дй', 'Шй', 'Шр', 'Бй', 'Жм', 'Иш'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'list' => ' ', - 'meridiem' => ['таңкы', 'түштөн кийинки'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ky_KG.php b/vendor/nesbot/carbon/src/Carbon/Lang/ky_KG.php deleted file mode 100644 index 9923a31e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ky_KG.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/ky.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lag.php b/vendor/nesbot/carbon/src/Carbon/Lang/lag.php deleted file mode 100644 index f3f57f6a..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lag.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['TOO', 'MUU'], - 'weekdays' => ['Jumapíiri', 'Jumatátu', 'Jumaíne', 'Jumatáano', 'Alamíisi', 'Ijumáa', 'Jumamóosi'], - 'weekdays_short' => ['Píili', 'Táatu', 'Íne', 'Táano', 'Alh', 'Ijm', 'Móosi'], - 'weekdays_min' => ['Píili', 'Táatu', 'Íne', 'Táano', 'Alh', 'Ijm', 'Móosi'], - 'months' => ['Kʉfúngatɨ', 'Kʉnaanɨ', 'Kʉkeenda', 'Kwiikumi', 'Kwiinyambála', 'Kwiidwaata', 'Kʉmʉʉnchɨ', 'Kʉvɨɨrɨ', 'Kʉsaatʉ', 'Kwiinyi', 'Kʉsaano', 'Kʉsasatʉ'], - 'months_short' => ['Fúngatɨ', 'Naanɨ', 'Keenda', 'Ikúmi', 'Inyambala', 'Idwaata', 'Mʉʉnchɨ', 'Vɨɨrɨ', 'Saatʉ', 'Inyi', 'Saano', 'Sasatʉ'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lb.php b/vendor/nesbot/carbon/src/Carbon/Lang/lb.php deleted file mode 100644 index 7636655e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lb.php +++ /dev/null @@ -1,88 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Philippe Vaucher - * - Tsutomu Kuroda - * - dan-nl - * - Simon Lelorrain (slelorrain) - */ - -use Carbon\CarbonInterface; - -return [ - 'year' => ':count Joer', - 'y' => ':countJ', - 'month' => ':count Mount|:count Méint', - 'm' => ':countMo', - 'week' => ':count Woch|:count Wochen', - 'w' => ':countWo|:countWo', - 'day' => ':count Dag|:count Deeg', - 'd' => ':countD', - 'hour' => ':count Stonn|:count Stonnen', - 'h' => ':countSto', - 'minute' => ':count Minutt|:count Minutten', - 'min' => ':countM', - 'second' => ':count Sekonn|:count Sekonnen', - 's' => ':countSek', - - 'ago' => 'virun :time', - 'from_now' => 'an :time', - 'before' => ':time virdrun', - 'after' => ':time duerno', - - 'diff_today' => 'Haut', - 'diff_yesterday' => 'Gëschter', - 'diff_yesterday_regexp' => 'Gëschter(?:\\s+um)?', - 'diff_tomorrow' => 'Muer', - 'diff_tomorrow_regexp' => 'Muer(?:\\s+um)?', - 'diff_today_regexp' => 'Haut(?:\\s+um)?', - 'formats' => [ - 'LT' => 'H:mm [Auer]', - 'LTS' => 'H:mm:ss [Auer]', - 'L' => 'DD.MM.YYYY', - 'LL' => 'D. MMMM YYYY', - 'LLL' => 'D. MMMM YYYY H:mm [Auer]', - 'LLLL' => 'dddd, D. MMMM YYYY H:mm [Auer]', - ], - - 'calendar' => [ - 'sameDay' => '[Haut um] LT', - 'nextDay' => '[Muer um] LT', - 'nextWeek' => 'dddd [um] LT', - 'lastDay' => '[Gëschter um] LT', - 'lastWeek' => function (CarbonInterface $date) { - // Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) due to phonological rule - switch ($date->dayOfWeek) { - case 2: - case 4: - return '[Leschten] dddd [um] LT'; - default: - return '[Leschte] dddd [um] LT'; - } - }, - 'sameElse' => 'L', - ], - - 'months' => ['Januar', 'Februar', 'Mäerz', 'Abrëll', 'Mee', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'], - 'months_short' => ['Jan.', 'Febr.', 'Mrz.', 'Abr.', 'Mee', 'Jun.', 'Jul.', 'Aug.', 'Sept.', 'Okt.', 'Nov.', 'Dez.'], - 'weekdays' => ['Sonndeg', 'Méindeg', 'Dënschdeg', 'Mëttwoch', 'Donneschdeg', 'Freideg', 'Samschdeg'], - 'weekdays_short' => ['So.', 'Mé.', 'Dë.', 'Më.', 'Do.', 'Fr.', 'Sa.'], - 'weekdays_min' => ['So', 'Mé', 'Dë', 'Më', 'Do', 'Fr', 'Sa'], - 'ordinal' => ':number.', - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' an '], - 'meridiem' => ['moies', 'mëttes'], - 'weekdays_short_standalone' => ['Son', 'Méi', 'Dën', 'Mët', 'Don', 'Fre', 'Sam'], - 'months_short_standalone' => ['Jan', 'Feb', 'Mäe', 'Abr', 'Mee', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lb_LU.php b/vendor/nesbot/carbon/src/Carbon/Lang/lb_LU.php deleted file mode 100644 index 414bd4d0..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lb_LU.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/lb.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lg.php b/vendor/nesbot/carbon/src/Carbon/Lang/lg.php deleted file mode 100644 index 48bc68be..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lg.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/lg_UG.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lg_UG.php b/vendor/nesbot/carbon/src/Carbon/Lang/lg_UG.php deleted file mode 100644 index aa022140..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lg_UG.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Akademe ya Luganda Kizito Birabwa kompyuta@kizito.uklinux.net - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YY', - ], - 'months' => ['Janwaliyo', 'Febwaliyo', 'Marisi', 'Apuli', 'Maayi', 'Juuni', 'Julaayi', 'Agusito', 'Sebuttemba', 'Okitobba', 'Novemba', 'Desemba'], - 'months_short' => ['Jan', 'Feb', 'Mar', 'Apu', 'Maa', 'Juu', 'Jul', 'Agu', 'Seb', 'Oki', 'Nov', 'Des'], - 'weekdays' => ['Sabiiti', 'Balaza', 'Lwakubiri', 'Lwakusatu', 'Lwakuna', 'Lwakutaano', 'Lwamukaaga'], - 'weekdays_short' => ['Sab', 'Bal', 'Lw2', 'Lw3', 'Lw4', 'Lw5', 'Lw6'], - 'weekdays_min' => ['Sab', 'Bal', 'Lw2', 'Lw3', 'Lw4', 'Lw5', 'Lw6'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - - 'month' => ':count njuba', // less reliable - 'm' => ':count njuba', // less reliable - 'a_month' => ':count njuba', // less reliable - - 'year' => ':count mwaaka', - 'y' => ':count mwaaka', - 'a_year' => ':count mwaaka', - - 'week' => ':count sabbiiti', - 'w' => ':count sabbiiti', - 'a_week' => ':count sabbiiti', - - 'day' => ':count lunaku', - 'd' => ':count lunaku', - 'a_day' => ':count lunaku', - - 'hour' => 'saawa :count', - 'h' => 'saawa :count', - 'a_hour' => 'saawa :count', - - 'minute' => 'ddakiika :count', - 'min' => 'ddakiika :count', - 'a_minute' => 'ddakiika :count', - - 'second' => ':count kyʼokubiri', - 's' => ':count kyʼokubiri', - 'a_second' => ':count kyʼokubiri', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/li.php b/vendor/nesbot/carbon/src/Carbon/Lang/li.php deleted file mode 100644 index 86c3009e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/li.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/li_NL.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/li_NL.php b/vendor/nesbot/carbon/src/Carbon/Lang/li_NL.php deleted file mode 100644 index 6c5feb79..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/li_NL.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - information from Kenneth Christiansen Kenneth Christiansen, Pablo Saratxaga kenneth@gnu.org, pablo@mandriva.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD.MM.YYYY', - ], - 'months' => ['jannewarie', 'fibberwarie', 'miert', 'eprèl', 'meij', 'junie', 'julie', 'augustus', 'september', 'oktober', 'november', 'desember'], - 'months_short' => ['jan', 'fib', 'mie', 'epr', 'mei', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'des'], - 'weekdays' => ['zóndig', 'maondig', 'daensdig', 'goonsdig', 'dónderdig', 'vriedig', 'zaoterdig'], - 'weekdays_short' => ['zón', 'mao', 'dae', 'goo', 'dón', 'vri', 'zao'], - 'weekdays_min' => ['zón', 'mao', 'dae', 'goo', 'dón', 'vri', 'zao'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - - 'minute' => ':count momênt', // less reliable - 'min' => ':count momênt', // less reliable - 'a_minute' => ':count momênt', // less reliable - - 'year' => ':count jaor', - 'y' => ':count jaor', - 'a_year' => ':count jaor', - - 'month' => ':count maond', - 'm' => ':count maond', - 'a_month' => ':count maond', - - 'week' => ':count waek', - 'w' => ':count waek', - 'a_week' => ':count waek', - - 'day' => ':count daag', - 'd' => ':count daag', - 'a_day' => ':count daag', - - 'hour' => ':count oer', - 'h' => ':count oer', - 'a_hour' => ':count oer', - - 'second' => ':count Secónd', - 's' => ':count Secónd', - 'a_second' => ':count Secónd', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lij.php b/vendor/nesbot/carbon/src/Carbon/Lang/lij.php deleted file mode 100644 index 45732b55..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lij.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/lij_IT.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lij_IT.php b/vendor/nesbot/carbon/src/Carbon/Lang/lij_IT.php deleted file mode 100644 index f8726fd2..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lij_IT.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Gastaldi alessio.gastaldi@libero.it - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YYYY', - ], - 'months' => ['zenâ', 'fevrâ', 'marzo', 'avrî', 'mazzo', 'zûgno', 'lûggio', 'agosto', 'settembre', 'ottobre', 'novembre', 'dixembre'], - 'months_short' => ['zen', 'fev', 'mar', 'arv', 'maz', 'zûg', 'lûg', 'ago', 'set', 'ött', 'nov', 'dix'], - 'weekdays' => ['domenega', 'lûnedì', 'martedì', 'mercUrdì', 'zêggia', 'venardì', 'sabbo'], - 'weekdays_short' => ['dom', 'lûn', 'mar', 'mer', 'zêu', 'ven', 'sab'], - 'weekdays_min' => ['dom', 'lûn', 'mar', 'mer', 'zêu', 'ven', 'sab'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - - 'year' => ':count etæ', // less reliable - 'y' => ':count etæ', // less reliable - 'a_year' => ':count etæ', // less reliable - - 'month' => ':count meize', - 'm' => ':count meize', - 'a_month' => ':count meize', - - 'week' => ':count settemannha', - 'w' => ':count settemannha', - 'a_week' => ':count settemannha', - - 'day' => ':count giorno', - 'd' => ':count giorno', - 'a_day' => ':count giorno', - - 'hour' => ':count reléuio', // less reliable - 'h' => ':count reléuio', // less reliable - 'a_hour' => ':count reléuio', // less reliable - - 'minute' => ':count menûo', - 'min' => ':count menûo', - 'a_minute' => ':count menûo', - - 'second' => ':count segondo', - 's' => ':count segondo', - 'a_second' => ':count segondo', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lkt.php b/vendor/nesbot/carbon/src/Carbon/Lang/lkt.php deleted file mode 100644 index ae73a97b..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lkt.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - - 'month' => ':count haŋwí', // less reliable - 'm' => ':count haŋwí', // less reliable - 'a_month' => ':count haŋwí', // less reliable - - 'week' => ':count šakówiŋ', // less reliable - 'w' => ':count šakówiŋ', // less reliable - 'a_week' => ':count šakówiŋ', // less reliable - - 'hour' => ':count maza škaŋškaŋ', // less reliable - 'h' => ':count maza škaŋškaŋ', // less reliable - 'a_hour' => ':count maza škaŋškaŋ', // less reliable - - 'minute' => ':count číkʼala', // less reliable - 'min' => ':count číkʼala', // less reliable - 'a_minute' => ':count číkʼala', // less reliable - - 'year' => ':count waníyetu', - 'y' => ':count waníyetu', - 'a_year' => ':count waníyetu', - - 'day' => ':count aŋpétu', - 'd' => ':count aŋpétu', - 'a_day' => ':count aŋpétu', - - 'second' => ':count icinuŋpa', - 's' => ':count icinuŋpa', - 'a_second' => ':count icinuŋpa', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ln.php b/vendor/nesbot/carbon/src/Carbon/Lang/ln.php deleted file mode 100644 index 9d5c35dd..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ln.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Ubuntu René Manassé GALEKWA renemanasse@gmail.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'D/M/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], - 'months' => ['sánzá ya yambo', 'sánzá ya míbalé', 'sánzá ya mísáto', 'sánzá ya mínei', 'sánzá ya mítáno', 'sánzá ya motóbá', 'sánzá ya nsambo', 'sánzá ya mwambe', 'sánzá ya libwa', 'sánzá ya zómi', 'sánzá ya zómi na mɔ̌kɔ́', 'sánzá ya zómi na míbalé'], - 'months_short' => ['yan', 'fbl', 'msi', 'apl', 'mai', 'yun', 'yul', 'agt', 'stb', 'ɔtb', 'nvb', 'dsb'], - 'weekdays' => ['Lomíngo', 'Mosálá mɔ̌kɔ́', 'Misálá míbalé', 'Misálá mísáto', 'Misálá mínei', 'Misálá mítáno', 'Mpɔ́sɔ'], - 'weekdays_short' => ['m1.', 'm2.', 'm3.', 'm4.', 'm5.', 'm6.', 'm7.'], - 'weekdays_min' => ['m1.', 'm2.', 'm3.', 'm4.', 'm5.', 'm6.', 'm7.'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - - 'year' => 'mbula :count', - 'y' => 'mbula :count', - 'a_year' => 'mbula :count', - - 'month' => 'sánzá :count', - 'm' => 'sánzá :count', - 'a_month' => 'sánzá :count', - - 'week' => 'mpɔ́sɔ :count', - 'w' => 'mpɔ́sɔ :count', - 'a_week' => 'mpɔ́sɔ :count', - - 'day' => 'mokɔlɔ :count', - 'd' => 'mokɔlɔ :count', - 'a_day' => 'mokɔlɔ :count', - - 'hour' => 'ngonga :count', - 'h' => 'ngonga :count', - 'a_hour' => 'ngonga :count', - - 'minute' => 'miniti :count', - 'min' => 'miniti :count', - 'a_minute' => 'miniti :count', - - 'second' => 'segɔnde :count', - 's' => 'segɔnde :count', - 'a_second' => 'segɔnde :count', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ln_AO.php b/vendor/nesbot/carbon/src/Carbon/Lang/ln_AO.php deleted file mode 100644 index 7fdb7f1b..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ln_AO.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/ln.php', [ - 'weekdays' => ['eyenga', 'mokɔlɔ mwa yambo', 'mokɔlɔ mwa míbalé', 'mokɔlɔ mwa mísáto', 'mokɔlɔ ya mínéi', 'mokɔlɔ ya mítáno', 'mpɔ́sɔ'], - 'weekdays_short' => ['eye', 'ybo', 'mbl', 'mst', 'min', 'mtn', 'mps'], - 'weekdays_min' => ['eye', 'ybo', 'mbl', 'mst', 'min', 'mtn', 'mps'], - 'meridiem' => ['ntɔ́ngɔ́', 'mpókwa'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ln_CD.php b/vendor/nesbot/carbon/src/Carbon/Lang/ln_CD.php deleted file mode 100644 index 13635fcc..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ln_CD.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Ubuntu René Manassé GALEKWA renemanasse@gmail.com - */ -return require __DIR__.'/ln.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ln_CF.php b/vendor/nesbot/carbon/src/Carbon/Lang/ln_CF.php deleted file mode 100644 index 7fdb7f1b..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ln_CF.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/ln.php', [ - 'weekdays' => ['eyenga', 'mokɔlɔ mwa yambo', 'mokɔlɔ mwa míbalé', 'mokɔlɔ mwa mísáto', 'mokɔlɔ ya mínéi', 'mokɔlɔ ya mítáno', 'mpɔ́sɔ'], - 'weekdays_short' => ['eye', 'ybo', 'mbl', 'mst', 'min', 'mtn', 'mps'], - 'weekdays_min' => ['eye', 'ybo', 'mbl', 'mst', 'min', 'mtn', 'mps'], - 'meridiem' => ['ntɔ́ngɔ́', 'mpókwa'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ln_CG.php b/vendor/nesbot/carbon/src/Carbon/Lang/ln_CG.php deleted file mode 100644 index 7fdb7f1b..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ln_CG.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/ln.php', [ - 'weekdays' => ['eyenga', 'mokɔlɔ mwa yambo', 'mokɔlɔ mwa míbalé', 'mokɔlɔ mwa mísáto', 'mokɔlɔ ya mínéi', 'mokɔlɔ ya mítáno', 'mpɔ́sɔ'], - 'weekdays_short' => ['eye', 'ybo', 'mbl', 'mst', 'min', 'mtn', 'mps'], - 'weekdays_min' => ['eye', 'ybo', 'mbl', 'mst', 'min', 'mtn', 'mps'], - 'meridiem' => ['ntɔ́ngɔ́', 'mpókwa'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lo.php b/vendor/nesbot/carbon/src/Carbon/Lang/lo.php deleted file mode 100644 index 48715f5c..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lo.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - François B - * - ryanhart2 - */ -return [ - 'year' => ':count ປີ', - 'y' => ':count ປີ', - 'month' => ':count ເດືອນ', - 'm' => ':count ດ. ', - 'week' => ':count ອາທິດ', - 'w' => ':count ອທ. ', - 'day' => ':count ມື້', - 'd' => ':count ມື້', - 'hour' => ':count ຊົ່ວໂມງ', - 'h' => ':count ຊມ. ', - 'minute' => ':count ນາທີ', - 'min' => ':count ນທ. ', - 'second' => '{1}ບໍ່ເທົ່າໃດວິນາທີ|]1,Inf[:count ວິນາທີ', - 's' => ':count ວິ. ', - 'ago' => ':timeຜ່ານມາ', - 'from_now' => 'ອີກ :time', - 'diff_now' => 'ຕອນນີ້', - 'diff_today' => 'ມື້ນີ້ເວລາ', - 'diff_yesterday' => 'ມື້ວານນີ້ເວລາ', - 'diff_tomorrow' => 'ມື້ອື່ນເວລາ', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'ວັນdddd D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[ມື້ນີ້ເວລາ] LT', - 'nextDay' => '[ມື້ອື່ນເວລາ] LT', - 'nextWeek' => '[ວັນ]dddd[ໜ້າເວລາ] LT', - 'lastDay' => '[ມື້ວານນີ້ເວລາ] LT', - 'lastWeek' => '[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT', - 'sameElse' => 'L', - ], - 'ordinal' => 'ທີ່:number', - 'meridiem' => ['ຕອນເຊົ້າ', 'ຕອນແລງ'], - 'months' => ['ມັງກອນ', 'ກຸມພາ', 'ມີນາ', 'ເມສາ', 'ພຶດສະພາ', 'ມິຖຸນາ', 'ກໍລະກົດ', 'ສິງຫາ', 'ກັນຍາ', 'ຕຸລາ', 'ພະຈິກ', 'ທັນວາ'], - 'months_short' => ['ມັງກອນ', 'ກຸມພາ', 'ມີນາ', 'ເມສາ', 'ພຶດສະພາ', 'ມິຖຸນາ', 'ກໍລະກົດ', 'ສິງຫາ', 'ກັນຍາ', 'ຕຸລາ', 'ພະຈິກ', 'ທັນວາ'], - 'weekdays' => ['ອາທິດ', 'ຈັນ', 'ອັງຄານ', 'ພຸດ', 'ພະຫັດ', 'ສຸກ', 'ເສົາ'], - 'weekdays_short' => ['ທິດ', 'ຈັນ', 'ອັງຄານ', 'ພຸດ', 'ພະຫັດ', 'ສຸກ', 'ເສົາ'], - 'weekdays_min' => ['ທ', 'ຈ', 'ອຄ', 'ພ', 'ພຫ', 'ສກ', 'ສ'], - 'list' => [', ', 'ແລະ '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lo_LA.php b/vendor/nesbot/carbon/src/Carbon/Lang/lo_LA.php deleted file mode 100644 index 9b7fd9bf..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lo_LA.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/lo.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lrc.php b/vendor/nesbot/carbon/src/Carbon/Lang/lrc.php deleted file mode 100644 index 546e6791..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lrc.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - - 'minute' => ':count هنر', // less reliable - 'min' => ':count هنر', // less reliable - 'a_minute' => ':count هنر', // less reliable -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lrc_IQ.php b/vendor/nesbot/carbon/src/Carbon/Lang/lrc_IQ.php deleted file mode 100644 index d42f5e97..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lrc_IQ.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/lrc.php', [ -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lt.php b/vendor/nesbot/carbon/src/Carbon/Lang/lt.php deleted file mode 100644 index 7d1b6f74..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lt.php +++ /dev/null @@ -1,135 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Philippe Vaucher - * - Tsutomu Kuroda - * - tjku - * - valdas406 - * - Justas Palumickas - * - Max Melentiev - * - Andrius Janauskas - * - Juanito Fatas - * - Akira Matsuda - * - Christopher Dell - * - Enrique Vidal - * - Simone Carletti - * - Aaron Patterson - * - Nicolás Hock Isaza - * - Laurynas Butkus - * - Sven Fuchs - * - Dominykas Tijūnaitis - * - Justinas Bolys - * - Ričardas - * - Kirill Chalkin - * - Rolandas - * - Justinas (Gamesh) - */ -return [ - 'year' => ':count metai|:count metai|:count metų', - 'y' => ':count m.', - 'month' => ':count mėnuo|:count mėnesiai|:count mėnesį', - 'm' => ':count mėn.', - 'week' => ':count savaitė|:count savaitės|:count savaitę', - 'w' => ':count sav.', - 'day' => ':count diena|:count dienos|:count dienų', - 'd' => ':count d.', - 'hour' => ':count valanda|:count valandos|:count valandų', - 'h' => ':count val.', - 'minute' => ':count minutė|:count minutės|:count minutę', - 'min' => ':count min.', - 'second' => ':count sekundė|:count sekundės|:count sekundžių', - 's' => ':count sek.', - - 'year_ago' => ':count metus|:count metus|:count metų', - 'month_ago' => ':count mėnesį|:count mėnesius|:count mėnesių', - 'week_ago' => ':count savaitę|:count savaites|:count savaičių', - 'day_ago' => ':count dieną|:count dienas|:count dienų', - 'hour_ago' => ':count valandą|:count valandas|:count valandų', - 'minute_ago' => ':count minutę|:count minutes|:count minučių', - 'second_ago' => ':count sekundę|:count sekundes|:count sekundžių', - - 'year_from_now' => ':count metų', - 'month_from_now' => ':count mėnesio|:count mėnesių|:count mėnesių', - 'week_from_now' => ':count savaitės|:count savaičių|:count savaičių', - 'day_from_now' => ':count dienos|:count dienų|:count dienų', - 'hour_from_now' => ':count valandos|:count valandų|:count valandų', - 'minute_from_now' => ':count minutės|:count minučių|:count minučių', - 'second_from_now' => ':count sekundės|:count sekundžių|:count sekundžių', - - 'year_after' => ':count metų', - 'month_after' => ':count mėnesio|:count mėnesių|:count mėnesių', - 'week_after' => ':count savaitės|:count savaičių|:count savaičių', - 'day_after' => ':count dienos|:count dienų|:count dienų', - 'hour_after' => ':count valandos|:count valandų|:count valandų', - 'minute_after' => ':count minutės|:count minučių|:count minučių', - 'second_after' => ':count sekundės|:count sekundžių|:count sekundžių', - - 'ago' => 'prieš :time', - 'from_now' => ':time nuo dabar', - 'after' => 'po :time', - 'before' => 'už :time', - - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - - 'diff_now' => 'ką tik', - 'diff_today' => 'Šiandien', - 'diff_yesterday' => 'vakar', - 'diff_yesterday_regexp' => 'Vakar', - 'diff_tomorrow' => 'rytoj', - 'diff_tomorrow_regexp' => 'Rytoj', - 'diff_before_yesterday' => 'užvakar', - 'diff_after_tomorrow' => 'poryt', - - 'period_recurrences' => 'kartą|:count kartų', - 'period_interval' => 'kiekvieną :interval', - 'period_start_date' => 'nuo :date', - 'period_end_date' => 'iki :date', - - 'months' => ['sausio', 'vasario', 'kovo', 'balandžio', 'gegužės', 'birželio', 'liepos', 'rugpjūčio', 'rugsėjo', 'spalio', 'lapkričio', 'gruodžio'], - 'months_standalone' => ['sausis', 'vasaris', 'kovas', 'balandis', 'gegužė', 'birželis', 'liepa', 'rugpjūtis', 'rugsėjis', 'spalis', 'lapkritis', 'gruodis'], - 'months_regexp' => '/(L{2,4}|D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?)/', - 'months_short' => ['sau', 'vas', 'kov', 'bal', 'geg', 'bir', 'lie', 'rgp', 'rgs', 'spa', 'lap', 'gru'], - 'weekdays' => ['sekmadienį', 'pirmadienį', 'antradienį', 'trečiadienį', 'ketvirtadienį', 'penktadienį', 'šeštadienį'], - 'weekdays_standalone' => ['sekmadienis', 'pirmadienis', 'antradienis', 'trečiadienis', 'ketvirtadienis', 'penktadienis', 'šeštadienis'], - 'weekdays_short' => ['sek', 'pir', 'ant', 'tre', 'ket', 'pen', 'šeš'], - 'weekdays_min' => ['se', 'pi', 'an', 'tr', 'ke', 'pe', 'še'], - 'list' => [', ', ' ir '], - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'YYYY-MM-DD', - 'LL' => 'MMMM DD, YYYY', - 'LLL' => 'DD MMM HH:mm', - 'LLLL' => 'MMMM DD, YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[Šiandien] LT', - 'nextDay' => '[Rytoj] LT', - 'nextWeek' => 'dddd LT', - 'lastDay' => '[Vakar] LT', - 'lastWeek' => '[Paskutinį] dddd LT', - 'sameElse' => 'L', - ], - 'ordinal' => function ($number) { - switch ($number) { - case 0: - return '0-is'; - case 3: - return '3-ias'; - default: - return "$number-as"; - } - }, - 'meridiem' => ['priešpiet', 'popiet'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lt_LT.php b/vendor/nesbot/carbon/src/Carbon/Lang/lt_LT.php deleted file mode 100644 index f772d38b..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lt_LT.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/lt.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lu.php b/vendor/nesbot/carbon/src/Carbon/Lang/lu.php deleted file mode 100644 index c8cd83af..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lu.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['Dinda', 'Dilolo'], - 'weekdays' => ['Lumingu', 'Nkodya', 'Ndàayà', 'Ndangù', 'Njòwa', 'Ngòvya', 'Lubingu'], - 'weekdays_short' => ['Lum', 'Nko', 'Ndy', 'Ndg', 'Njw', 'Ngv', 'Lub'], - 'weekdays_min' => ['Lum', 'Nko', 'Ndy', 'Ndg', 'Njw', 'Ngv', 'Lub'], - 'months' => ['Ciongo', 'Lùishi', 'Lusòlo', 'Mùuyà', 'Lumùngùlù', 'Lufuimi', 'Kabàlàshìpù', 'Lùshìkà', 'Lutongolo', 'Lungùdi', 'Kaswèkèsè', 'Ciswà'], - 'months_short' => ['Cio', 'Lui', 'Lus', 'Muu', 'Lum', 'Luf', 'Kab', 'Lush', 'Lut', 'Lun', 'Kas', 'Cis'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'D/M/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/luo.php b/vendor/nesbot/carbon/src/Carbon/Lang/luo.php deleted file mode 100644 index b55af731..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/luo.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['OD', 'OT'], - 'weekdays' => ['Jumapil', 'Wuok Tich', 'Tich Ariyo', 'Tich Adek', 'Tich Ang’wen', 'Tich Abich', 'Ngeso'], - 'weekdays_short' => ['JMP', 'WUT', 'TAR', 'TAD', 'TAN', 'TAB', 'NGS'], - 'weekdays_min' => ['JMP', 'WUT', 'TAR', 'TAD', 'TAN', 'TAB', 'NGS'], - 'months' => ['Dwe mar Achiel', 'Dwe mar Ariyo', 'Dwe mar Adek', 'Dwe mar Ang’wen', 'Dwe mar Abich', 'Dwe mar Auchiel', 'Dwe mar Abiriyo', 'Dwe mar Aboro', 'Dwe mar Ochiko', 'Dwe mar Apar', 'Dwe mar gi achiel', 'Dwe mar Apar gi ariyo'], - 'months_short' => ['DAC', 'DAR', 'DAD', 'DAN', 'DAH', 'DAU', 'DAO', 'DAB', 'DOC', 'DAP', 'DGI', 'DAG'], - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], - - 'year' => 'higni :count', - 'y' => 'higni :count', - 'a_year' => ':higni :count', - - 'month' => 'dweche :count', - 'm' => 'dweche :count', - 'a_month' => 'dweche :count', - - 'week' => 'jumbe :count', - 'w' => 'jumbe :count', - 'a_week' => 'jumbe :count', - - 'day' => 'ndalo :count', - 'd' => 'ndalo :count', - 'a_day' => 'ndalo :count', - - 'hour' => 'seche :count', - 'h' => 'seche :count', - 'a_hour' => 'seche :count', - - 'minute' => 'dakika :count', - 'min' => 'dakika :count', - 'a_minute' => 'dakika :count', - - 'second' => 'nus dakika :count', - 's' => 'nus dakika :count', - 'a_second' => 'nus dakika :count', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/luy.php b/vendor/nesbot/carbon/src/Carbon/Lang/luy.php deleted file mode 100644 index 2b37e3e3..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/luy.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'weekdays' => ['Jumapiri', 'Jumatatu', 'Jumanne', 'Jumatano', 'Murwa wa Kanne', 'Murwa wa Katano', 'Jumamosi'], - 'weekdays_short' => ['J2', 'J3', 'J4', 'J5', 'Al', 'Ij', 'J1'], - 'weekdays_min' => ['J2', 'J3', 'J4', 'J5', 'Al', 'Ij', 'J1'], - 'months' => ['Januari', 'Februari', 'Machi', 'Aprili', 'Mei', 'Juni', 'Julai', 'Agosti', 'Septemba', 'Oktoba', 'Novemba', 'Desemba'], - 'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Sep', 'Okt', 'Nov', 'Des'], - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], - - // Too unreliable - /* - 'year' => ':count liliino', // less reliable - 'y' => ':count liliino', // less reliable - 'a_year' => ':count liliino', // less reliable - - 'month' => ':count kumwesi', // less reliable - 'm' => ':count kumwesi', // less reliable - 'a_month' => ':count kumwesi', // less reliable - - 'week' => ':count olutambi', // less reliable - 'w' => ':count olutambi', // less reliable - 'a_week' => ':count olutambi', // less reliable - - 'day' => ':count luno', // less reliable - 'd' => ':count luno', // less reliable - 'a_day' => ':count luno', // less reliable - - 'hour' => ':count ekengele', // less reliable - 'h' => ':count ekengele', // less reliable - 'a_hour' => ':count ekengele', // less reliable - - 'minute' => ':count omundu', // less reliable - 'min' => ':count omundu', // less reliable - 'a_minute' => ':count omundu', // less reliable - - 'second' => ':count liliino', // less reliable - 's' => ':count liliino', // less reliable - 'a_second' => ':count liliino', // less reliable - */ -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lv.php b/vendor/nesbot/carbon/src/Carbon/Lang/lv.php deleted file mode 100644 index d5cba7ca..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lv.php +++ /dev/null @@ -1,183 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Carbon\CarbonInterface; - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Philippe Vaucher - * - pirminis - * - Tsutomu Kuroda - * - tjku - * - Andris Zāģeris - * - Max Melentiev - * - Edgars Beigarts - * - Juanito Fatas - * - Vitauts Stočka - * - Akira Matsuda - * - Christopher Dell - * - Enrique Vidal - * - Simone Carletti - * - Aaron Patterson - * - Kaspars Bankovskis - * - Nicolás Hock Isaza - * - Viesturs Kavacs (Kavacky) - * - zakse - * - Janis Eglitis (janiseglitis) - * - Guntars - * - Juris Sudmalis - */ -$daysOfWeek = ['svētdiena', 'pirmdiena', 'otrdiena', 'trešdiena', 'ceturtdiena', 'piektdiena', 'sestdiena']; -$daysOfWeekLocativum = ['svētdien', 'pirmdien', 'otrdien', 'trešdien', 'ceturtdien', 'piektdien', 'sestdien']; - -$transformDiff = function ($input) { - return strtr($input, [ - // Nominative => "pirms/pēc" Dative - 'gads' => 'gada', - 'gadi' => 'gadiem', - 'gadu' => 'gadiem', - 'mēnesis' => 'mēneša', - 'mēneši' => 'mēnešiem', - 'mēnešu' => 'mēnešiem', - 'nedēļa' => 'nedēļas', - 'nedēļas' => 'nedēļām', - 'nedēļu' => 'nedēļām', - 'diena' => 'dienas', - 'dienas' => 'dienām', - 'dienu' => 'dienām', - 'stunda' => 'stundas', - 'stundas' => 'stundām', - 'stundu' => 'stundām', - 'minūte' => 'minūtes', - 'minūtes' => 'minūtēm', - 'minūšu' => 'minūtēm', - 'sekunde' => 'sekundes', - 'sekundes' => 'sekundēm', - 'sekunžu' => 'sekundēm', - ]); -}; - -return [ - 'ago' => function ($time) use ($transformDiff) { - return 'pirms '.$transformDiff($time); - }, - 'from_now' => function ($time) use ($transformDiff) { - return 'pēc '.$transformDiff($time); - }, - - 'year' => '0 gadu|:count gads|:count gadi', - 'y' => ':count g.', - 'a_year' => '{1}gads|0 gadu|:count gads|:count gadi', - 'month' => '0 mēnešu|:count mēnesis|:count mēneši', - 'm' => ':count mēn.', - 'a_month' => '{1}mēnesis|0 mēnešu|:count mēnesis|:count mēneši', - 'week' => '0 nedēļu|:count nedēļa|:count nedēļas', - 'w' => ':count ned.', - 'a_week' => '{1}nedēļa|0 nedēļu|:count nedēļa|:count nedēļas', - 'day' => '0 dienu|:count diena|:count dienas', - 'd' => ':count d.', - 'a_day' => '{1}diena|0 dienu|:count diena|:count dienas', - 'hour' => '0 stundu|:count stunda|:count stundas', - 'h' => ':count st.', - 'a_hour' => '{1}stunda|0 stundu|:count stunda|:count stundas', - 'minute' => '0 minūšu|:count minūte|:count minūtes', - 'min' => ':count min.', - 'a_minute' => '{1}minūte|0 minūšu|:count minūte|:count minūtes', - 'second' => '0 sekunžu|:count sekunde|:count sekundes', - 's' => ':count sek.', - 'a_second' => '{1}sekunde|0 sekunžu|:count sekunde|:count sekundes', - - 'after' => ':time vēlāk', - 'year_after' => '0 gadus|:count gadu|:count gadus', - 'a_year_after' => '{1}gadu|0 gadus|:count gadu|:count gadus', - 'month_after' => '0 mēnešus|:count mēnesi|:count mēnešus', - 'a_month_after' => '{1}mēnesi|0 mēnešus|:count mēnesi|:count mēnešus', - 'week_after' => '0 nedēļas|:count nedēļu|:count nedēļas', - 'a_week_after' => '{1}nedēļu|0 nedēļas|:count nedēļu|:count nedēļas', - 'day_after' => '0 dienas|:count dienu|:count dienas', - 'a_day_after' => '{1}dienu|0 dienas|:count dienu|:count dienas', - 'hour_after' => '0 stundas|:count stundu|:count stundas', - 'a_hour_after' => '{1}stundu|0 stundas|:count stundu|:count stundas', - 'minute_after' => '0 minūtes|:count minūti|:count minūtes', - 'a_minute_after' => '{1}minūti|0 minūtes|:count minūti|:count minūtes', - 'second_after' => '0 sekundes|:count sekundi|:count sekundes', - 'a_second_after' => '{1}sekundi|0 sekundes|:count sekundi|:count sekundes', - - 'before' => ':time agrāk', - 'year_before' => '0 gadus|:count gadu|:count gadus', - 'a_year_before' => '{1}gadu|0 gadus|:count gadu|:count gadus', - 'month_before' => '0 mēnešus|:count mēnesi|:count mēnešus', - 'a_month_before' => '{1}mēnesi|0 mēnešus|:count mēnesi|:count mēnešus', - 'week_before' => '0 nedēļas|:count nedēļu|:count nedēļas', - 'a_week_before' => '{1}nedēļu|0 nedēļas|:count nedēļu|:count nedēļas', - 'day_before' => '0 dienas|:count dienu|:count dienas', - 'a_day_before' => '{1}dienu|0 dienas|:count dienu|:count dienas', - 'hour_before' => '0 stundas|:count stundu|:count stundas', - 'a_hour_before' => '{1}stundu|0 stundas|:count stundu|:count stundas', - 'minute_before' => '0 minūtes|:count minūti|:count minūtes', - 'a_minute_before' => '{1}minūti|0 minūtes|:count minūti|:count minūtes', - 'second_before' => '0 sekundes|:count sekundi|:count sekundes', - 'a_second_before' => '{1}sekundi|0 sekundes|:count sekundi|:count sekundes', - - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' un '], - - 'diff_now' => 'tagad', - 'diff_today' => 'šodien', - 'diff_yesterday' => 'vakar', - 'diff_before_yesterday' => 'aizvakar', - 'diff_tomorrow' => 'rīt', - 'diff_after_tomorrow' => 'parīt', - - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD.MM.YYYY.', - 'LL' => 'YYYY. [gada] D. MMMM', - 'LLL' => 'DD.MM.YYYY., HH:mm', - 'LLLL' => 'YYYY. [gada] D. MMMM, HH:mm', - ], - - 'calendar' => [ - 'sameDay' => '[šodien] [plkst.] LT', - 'nextDay' => '[rīt] [plkst.] LT', - 'nextWeek' => function (CarbonInterface $current, CarbonInterface $other) use ($daysOfWeekLocativum) { - if ($current->week !== $other->week) { - return '[nākošo] ['.$daysOfWeekLocativum[$current->dayOfWeek].'] [plkst.] LT'; - } - - return '['.$daysOfWeekLocativum[$current->dayOfWeek].'] [plkst.] LT'; - }, - 'lastDay' => '[vakar] [plkst.] LT', - 'lastWeek' => function (CarbonInterface $current) use ($daysOfWeekLocativum) { - return '[pagājušo] ['.$daysOfWeekLocativum[$current->dayOfWeek].'] [plkst.] LT'; - }, - 'sameElse' => 'L', - ], - - 'weekdays' => $daysOfWeek, - 'weekdays_short' => ['Sv.', 'P.', 'O.', 'T.', 'C.', 'Pk.', 'S.'], - 'weekdays_min' => ['Sv.', 'P.', 'O.', 'T.', 'C.', 'Pk.', 'S.'], - 'months' => ['janvāris', 'februāris', 'marts', 'aprīlis', 'maijs', 'jūnijs', 'jūlijs', 'augusts', 'septembris', 'oktobris', 'novembris', 'decembris'], - 'months_standalone' => ['janvārī', 'februārī', 'martā', 'aprīlī', 'maijā', 'jūnijā', 'jūlijā', 'augustā', 'septembrī', 'oktobrī', 'novembrī', 'decembrī'], - 'months_short' => ['janv.', 'febr.', 'martā', 'apr.', 'maijā', 'jūn.', 'jūl.', 'aug.', 'sept.', 'okt.', 'nov.', 'dec.'], - 'meridiem' => ['priekšpusdiena', 'pēcpusdiena'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lv_LV.php b/vendor/nesbot/carbon/src/Carbon/Lang/lv_LV.php deleted file mode 100644 index ee91c369..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lv_LV.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/lv.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lzh.php b/vendor/nesbot/carbon/src/Carbon/Lang/lzh.php deleted file mode 100644 index 1180c6bb..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lzh.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/lzh_TW.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lzh_TW.php b/vendor/nesbot/carbon/src/Carbon/Lang/lzh_TW.php deleted file mode 100644 index 3b1493ee..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lzh_TW.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'OY[年]MMMMOD[日]', - ], - 'months' => ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], - 'months_short' => [' 一 ', ' 二 ', ' 三 ', ' 四 ', ' 五 ', ' 六 ', ' 七 ', ' 八 ', ' 九 ', ' 十 ', '十一', '十二'], - 'weekdays' => ['週日', '週一', '週二', '週三', '週四', '週五', '週六'], - 'weekdays_short' => ['日', '一', '二', '三', '四', '五', '六'], - 'weekdays_min' => ['日', '一', '二', '三', '四', '五', '六'], - 'day_of_first_week_of_year' => 1, - 'alt_numbers' => ['〇', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一', '十二', '十三', '十四', '十五', '十六', '十七', '十八', '十九', '廿', '廿一', '廿二', '廿三', '廿四', '廿五', '廿六', '廿七', '廿八', '廿九', '卅', '卅一'], - 'meridiem' => ['朝', '暮'], - - 'year' => ':count 夏', // less reliable - 'y' => ':count 夏', // less reliable - 'a_year' => ':count 夏', // less reliable - - 'month' => ':count 月', // less reliable - 'm' => ':count 月', // less reliable - 'a_month' => ':count 月', // less reliable - - 'hour' => ':count 氧', // less reliable - 'h' => ':count 氧', // less reliable - 'a_hour' => ':count 氧', // less reliable - - 'minute' => ':count 點', // less reliable - 'min' => ':count 點', // less reliable - 'a_minute' => ':count 點', // less reliable - - 'second' => ':count 楚', // less reliable - 's' => ':count 楚', // less reliable - 'a_second' => ':count 楚', // less reliable - - 'week' => ':count 星期', - 'w' => ':count 星期', - 'a_week' => ':count 星期', - - 'day' => ':count 日(曆法)', - 'd' => ':count 日(曆法)', - 'a_day' => ':count 日(曆法)', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mag.php b/vendor/nesbot/carbon/src/Carbon/Lang/mag.php deleted file mode 100644 index 7532436d..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mag.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/mag_IN.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mag_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/mag_IN.php deleted file mode 100644 index 193f67a7..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mag_IN.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - bhashaghar@googlegroups.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'D/M/YY', - ], - 'months' => ['जनवरी', 'फ़रवरी', 'मार्च', 'अप्रेल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर'], - 'months_short' => ['जनवरी', 'फ़रवरी', 'मार्च', 'अप्रेल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर'], - 'weekdays' => ['एतवार', 'सोमार', 'मंगर', 'बुध', 'बिफे', 'सूक', 'सनिचर'], - 'weekdays_short' => ['एतवार', 'सोमार', 'मंगर', 'बुध', 'बिफे', 'सूक', 'सनिचर'], - 'weekdays_min' => ['एतवार', 'सोमार', 'मंगर', 'बुध', 'बिफे', 'सूक', 'सनिचर'], - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['पूर्वाह्न', 'अपराह्न'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mai.php b/vendor/nesbot/carbon/src/Carbon/Lang/mai.php deleted file mode 100644 index 792b9739..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mai.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/mai_IN.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mai_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/mai_IN.php deleted file mode 100644 index 03049d45..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mai_IN.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Maithili Computing Research Center, Pune, India rajeshkajha@yahoo.com,akhilesh.k@samusng.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'D/M/YY', - ], - 'months' => ['बैसाख', 'जेठ', 'अषाढ़', 'सावोन', 'भादो', 'आसिन', 'कातिक', 'अगहन', 'पूस', 'माघ', 'फागुन', 'चैति'], - 'months_short' => ['बैसाख', 'जेठ', 'अषाढ़', 'सावोन', 'भादो', 'आसिन', 'कातिक', 'अगहन', 'पूस', 'माघ', 'फागुन', 'चैति'], - 'weekdays' => ['रविदिन', 'सोमदिन', 'मंगलदिन', 'बुधदिन', 'बृहस्पतीदिन', 'शुक्रदिन', 'शनीदिन'], - 'weekdays_short' => ['रवि', 'सोम', 'मंगल', 'बुध', 'बृहस्पती', 'शुक्र', 'शनी'], - 'weekdays_min' => ['रवि', 'सोम', 'मंगल', 'बुध', 'बृहस्पती', 'शुक्र', 'शनी'], - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['पूर्वाह्न', 'अपराह्न'], - - 'year' => ':count ऋतु', // less reliable - 'y' => ':count ऋतु', // less reliable - 'a_year' => ':count ऋतु', // less reliable - - 'month' => ':count महिना', - 'm' => ':count महिना', - 'a_month' => ':count महिना', - - 'week' => ':count श्रेणी:क्यालेन्डर', // less reliable - 'w' => ':count श्रेणी:क्यालेन्डर', // less reliable - 'a_week' => ':count श्रेणी:क्यालेन्डर', // less reliable - - 'day' => ':count दिन', - 'd' => ':count दिन', - 'a_day' => ':count दिन', - - 'hour' => ':count घण्टा', - 'h' => ':count घण्टा', - 'a_hour' => ':count घण्टा', - - 'minute' => ':count समय', // less reliable - 'min' => ':count समय', // less reliable - 'a_minute' => ':count समय', // less reliable -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mas.php b/vendor/nesbot/carbon/src/Carbon/Lang/mas.php deleted file mode 100644 index cbd610c2..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mas.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['Ɛnkakɛnyá', 'Ɛndámâ'], - 'weekdays' => ['Jumapílí', 'Jumatátu', 'Jumane', 'Jumatánɔ', 'Alaámisi', 'Jumáa', 'Jumamósi'], - 'weekdays_short' => ['Jpi', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Iju', 'Jmo'], - 'weekdays_min' => ['Jpi', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Iju', 'Jmo'], - 'months' => ['Oladalʉ́', 'Arát', 'Ɔɛnɨ́ɔɨŋɔk', 'Olodoyíóríê inkókúâ', 'Oloilépūnyīē inkókúâ', 'Kújúɔrɔk', 'Mórusásin', 'Ɔlɔ́ɨ́bɔ́rárɛ', 'Kúshîn', 'Olgísan', 'Pʉshʉ́ka', 'Ntʉ́ŋʉ́s'], - 'months_short' => ['Dal', 'Ará', 'Ɔɛn', 'Doy', 'Lép', 'Rok', 'Sás', 'Bɔ́r', 'Kús', 'Gís', 'Shʉ́', 'Ntʉ́'], - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], - - 'year' => ':count olameyu', // less reliable - 'y' => ':count olameyu', // less reliable - 'a_year' => ':count olameyu', // less reliable - - 'week' => ':count engolongeare orwiki', // less reliable - 'w' => ':count engolongeare orwiki', // less reliable - 'a_week' => ':count engolongeare orwiki', // less reliable - - 'hour' => ':count esahabu', // less reliable - 'h' => ':count esahabu', // less reliable - 'a_hour' => ':count esahabu', // less reliable - - 'second' => ':count are', // less reliable - 's' => ':count are', // less reliable - 'a_second' => ':count are', // less reliable - - 'month' => ':count olapa', - 'm' => ':count olapa', - 'a_month' => ':count olapa', - - 'day' => ':count enkolongʼ', - 'd' => ':count enkolongʼ', - 'a_day' => ':count enkolongʼ', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mas_TZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/mas_TZ.php deleted file mode 100644 index 56e29053..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mas_TZ.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/mas.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mer.php b/vendor/nesbot/carbon/src/Carbon/Lang/mer.php deleted file mode 100644 index 2e14597f..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mer.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['RŨ', 'ŨG'], - 'weekdays' => ['Kiumia', 'Muramuko', 'Wairi', 'Wethatu', 'Wena', 'Wetano', 'Jumamosi'], - 'weekdays_short' => ['KIU', 'MRA', 'WAI', 'WET', 'WEN', 'WTN', 'JUM'], - 'weekdays_min' => ['KIU', 'MRA', 'WAI', 'WET', 'WEN', 'WTN', 'JUM'], - 'months' => ['Januarĩ', 'Feburuarĩ', 'Machi', 'Ĩpurũ', 'Mĩĩ', 'Njuni', 'Njuraĩ', 'Agasti', 'Septemba', 'Oktũba', 'Novemba', 'Dicemba'], - 'months_short' => ['JAN', 'FEB', 'MAC', 'ĨPU', 'MĨĨ', 'NJU', 'NJR', 'AGA', 'SPT', 'OKT', 'NOV', 'DEC'], - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], - - 'year' => ':count murume', // less reliable - 'y' => ':count murume', // less reliable - 'a_year' => ':count murume', // less reliable - - 'month' => ':count muchaara', // less reliable - 'm' => ':count muchaara', // less reliable - 'a_month' => ':count muchaara', // less reliable - - 'minute' => ':count monto', // less reliable - 'min' => ':count monto', // less reliable - 'a_minute' => ':count monto', // less reliable - - 'second' => ':count gikeno', // less reliable - 's' => ':count gikeno', // less reliable - 'a_second' => ':count gikeno', // less reliable -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mfe.php b/vendor/nesbot/carbon/src/Carbon/Lang/mfe.php deleted file mode 100644 index 4d6e6b69..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mfe.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/mfe_MU.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mfe_MU.php b/vendor/nesbot/carbon/src/Carbon/Lang/mfe_MU.php deleted file mode 100644 index 2d27b457..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mfe_MU.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Samsung Electronics Co., Ltd. akhilesh.k@samsung.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YY', - ], - 'months' => ['zanvie', 'fevriye', 'mars', 'avril', 'me', 'zin', 'zilye', 'out', 'septam', 'oktob', 'novam', 'desam'], - 'months_short' => ['zan', 'fev', 'mar', 'avr', 'me', 'zin', 'zil', 'out', 'sep', 'okt', 'nov', 'des'], - 'weekdays' => ['dimans', 'lindi', 'mardi', 'merkredi', 'zedi', 'vandredi', 'samdi'], - 'weekdays_short' => ['dim', 'lin', 'mar', 'mer', 'ze', 'van', 'sam'], - 'weekdays_min' => ['dim', 'lin', 'mar', 'mer', 'ze', 'van', 'sam'], - - 'year' => ':count banané', - 'y' => ':count banané', - 'a_year' => ':count banané', - - 'month' => ':count mwa', - 'm' => ':count mwa', - 'a_month' => ':count mwa', - - 'week' => ':count sémenn', - 'w' => ':count sémenn', - 'a_week' => ':count sémenn', - - 'day' => ':count zour', - 'd' => ':count zour', - 'a_day' => ':count zour', - - 'hour' => ':count -er-tan', - 'h' => ':count -er-tan', - 'a_hour' => ':count -er-tan', - - 'minute' => ':count minitt', - 'min' => ':count minitt', - 'a_minute' => ':count minitt', - - 'second' => ':count déziém', - 's' => ':count déziém', - 'a_second' => ':count déziém', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mg.php b/vendor/nesbot/carbon/src/Carbon/Lang/mg.php deleted file mode 100644 index 40bc2a82..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mg.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/mg_MG.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mg_MG.php b/vendor/nesbot/carbon/src/Carbon/Lang/mg_MG.php deleted file mode 100644 index 6a14535a..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mg_MG.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - The Debian Project modified by GNU//Linux Malagasy Rado Ramarotafika,Do-Risika RAFIEFERANTSIARONJY rado@linuxmg.org,dourix@free.fr - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD.MM.YYYY', - ], - 'months' => ['Janoary', 'Febroary', 'Martsa', 'Aprily', 'Mey', 'Jona', 'Jolay', 'Aogositra', 'Septambra', 'Oktobra', 'Novambra', 'Desambra'], - 'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'Mey', 'Jon', 'Jol', 'Aog', 'Sep', 'Okt', 'Nov', 'Des'], - 'weekdays' => ['alahady', 'alatsinainy', 'talata', 'alarobia', 'alakamisy', 'zoma', 'sabotsy'], - 'weekdays_short' => ['lhd', 'lts', 'tlt', 'lrb', 'lkm', 'zom', 'sab'], - 'weekdays_min' => ['lhd', 'lts', 'tlt', 'lrb', 'lkm', 'zom', 'sab'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - - 'minute' => ':count minitra', // less reliable - 'min' => ':count minitra', // less reliable - 'a_minute' => ':count minitra', // less reliable - - 'year' => ':count taona', - 'y' => ':count taona', - 'a_year' => ':count taona', - - 'month' => ':count volana', - 'm' => ':count volana', - 'a_month' => ':count volana', - - 'week' => ':count herinandro', - 'w' => ':count herinandro', - 'a_week' => ':count herinandro', - - 'day' => ':count andro', - 'd' => ':count andro', - 'a_day' => ':count andro', - - 'hour' => ':count ora', - 'h' => ':count ora', - 'a_hour' => ':count ora', - - 'second' => ':count segondra', - 's' => ':count segondra', - 'a_second' => ':count segondra', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mgh.php b/vendor/nesbot/carbon/src/Carbon/Lang/mgh.php deleted file mode 100644 index 2a80960d..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mgh.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['wichishu', 'mchochil’l'], - 'weekdays' => ['Sabato', 'Jumatatu', 'Jumanne', 'Jumatano', 'Arahamisi', 'Ijumaa', 'Jumamosi'], - 'weekdays_short' => ['Sab', 'Jtt', 'Jnn', 'Jtn', 'Ara', 'Iju', 'Jmo'], - 'weekdays_min' => ['Sab', 'Jtt', 'Jnn', 'Jtn', 'Ara', 'Iju', 'Jmo'], - 'months' => ['Mweri wo kwanza', 'Mweri wo unayeli', 'Mweri wo uneraru', 'Mweri wo unecheshe', 'Mweri wo unethanu', 'Mweri wo thanu na mocha', 'Mweri wo saba', 'Mweri wo nane', 'Mweri wo tisa', 'Mweri wo kumi', 'Mweri wo kumi na moja', 'Mweri wo kumi na yel’li'], - 'months_short' => ['Kwa', 'Una', 'Rar', 'Che', 'Tha', 'Moc', 'Sab', 'Nan', 'Tis', 'Kum', 'Moj', 'Yel'], - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mgo.php b/vendor/nesbot/carbon/src/Carbon/Lang/mgo.php deleted file mode 100644 index a126c9ff..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mgo.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'weekdays' => ['Aneg 1', 'Aneg 2', 'Aneg 3', 'Aneg 4', 'Aneg 5', 'Aneg 6', 'Aneg 7'], - 'weekdays_short' => ['Aneg 1', 'Aneg 2', 'Aneg 3', 'Aneg 4', 'Aneg 5', 'Aneg 6', 'Aneg 7'], - 'weekdays_min' => ['1', '2', '3', '4', '5', '6', '7'], - 'months' => ['iməg mbegtug', 'imeg àbùbì', 'imeg mbəŋchubi', 'iməg ngwə̀t', 'iməg fog', 'iməg ichiibɔd', 'iməg àdùmbə̀ŋ', 'iməg ichika', 'iməg kud', 'iməg tèsiʼe', 'iməg zò', 'iməg krizmed'], - 'months_short' => ['mbegtug', 'imeg àbùbì', 'imeg mbəŋchubi', 'iməg ngwə̀t', 'iməg fog', 'iməg ichiibɔd', 'iməg àdùmbə̀ŋ', 'iməg ichika', 'iməg kud', 'iməg tèsiʼe', 'iməg zò', 'iməg krizmed'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'YYYY-MM-dd', - 'LL' => 'YYYY MMM D', - 'LLL' => 'YYYY MMMM D HH:mm', - 'LLLL' => 'dddd, YYYY MMMM DD HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mhr.php b/vendor/nesbot/carbon/src/Carbon/Lang/mhr.php deleted file mode 100644 index 6bbc9f6d..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mhr.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/mhr_RU.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mhr_RU.php b/vendor/nesbot/carbon/src/Carbon/Lang/mhr_RU.php deleted file mode 100644 index 309ead9d..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mhr_RU.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - PeshSajSoft Ltd. Vyacheslav Kileev slavakileev@yandex.ru - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'YYYY.MM.DD', - ], - 'months' => ['Шорыкйол', 'Пургыж', 'Ӱярня', 'Вӱдшор', 'Ага', 'Пеледыш', 'Сӱрем', 'Сорла', 'Идым', 'Шыжа', 'Кылме', 'Теле'], - 'months_short' => ['Шрк', 'Пгж', 'Ӱрн', 'Вшр', 'Ага', 'Пдш', 'Срм', 'Срл', 'Идм', 'Шыж', 'Клм', 'Тел'], - 'weekdays' => ['Рушарня', 'Шочмо', 'Кушкыжмо', 'Вӱргече', 'Изарня', 'Кугарня', 'Шуматкече'], - 'weekdays_short' => ['Ршр', 'Шчм', 'Кжм', 'Вгч', 'Изр', 'Кгр', 'Шмт'], - 'weekdays_min' => ['Ршр', 'Шчм', 'Кжм', 'Вгч', 'Изр', 'Кгр', 'Шмт'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - - 'year' => ':count идалык', - 'y' => ':count идалык', - 'a_year' => ':count идалык', - - 'month' => ':count Тылзе', - 'm' => ':count Тылзе', - 'a_month' => ':count Тылзе', - - 'week' => ':count арня', - 'w' => ':count арня', - 'a_week' => ':count арня', - - 'day' => ':count кече', - 'd' => ':count кече', - 'a_day' => ':count кече', - - 'hour' => ':count час', - 'h' => ':count час', - 'a_hour' => ':count час', - - 'minute' => ':count минут', - 'min' => ':count минут', - 'a_minute' => ':count минут', - - 'second' => ':count кокымшан', - 's' => ':count кокымшан', - 'a_second' => ':count кокымшан', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mi.php b/vendor/nesbot/carbon/src/Carbon/Lang/mi.php deleted file mode 100644 index b7f51ec2..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mi.php +++ /dev/null @@ -1,66 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - François B - * - John Corrigan - * - François B - */ -return [ - 'year' => ':count tau', - 'a_year' => '{1}he tau|:count tau', - 'month' => ':count marama', - 'a_month' => '{1}he marama|:count marama', - 'week' => ':count wiki', - 'a_week' => '{1}he wiki|:count wiki', - 'day' => ':count ra', - 'a_day' => '{1}he ra|:count ra', - 'hour' => ':count haora', - 'a_hour' => '{1}te haora|:count haora', - 'minute' => ':count meneti', - 'a_minute' => '{1}he meneti|:count meneti', - 'second' => ':count hēkona', - 'a_second' => '{1}te hēkona ruarua|:count hēkona', - 'ago' => ':time i mua', - 'from_now' => 'i roto i :time', - 'diff_yesterday' => 'inanahi', - 'diff_yesterday_regexp' => 'inanahi(?:\\s+i)?', - 'diff_today' => 'i teie', - 'diff_today_regexp' => 'i teie(?:\\s+mahana,)?(?:\\s+i)?', - 'diff_tomorrow' => 'apopo', - 'diff_tomorrow_regexp' => 'apopo(?:\\s+i)?', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY [i] HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY [i] HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[i teie mahana, i] LT', - 'nextDay' => '[apopo i] LT', - 'nextWeek' => 'dddd [i] LT', - 'lastDay' => '[inanahi i] LT', - 'lastWeek' => 'dddd [whakamutunga i] LT', - 'sameElse' => 'L', - ], - 'ordinal' => ':numberº', - 'months' => ['Kohi-tāte', 'Hui-tanguru', 'Poutū-te-rangi', 'Paenga-whāwhā', 'Haratua', 'Pipiri', 'Hōngoingoi', 'Here-turi-kōkā', 'Mahuru', 'Whiringa-ā-nuku', 'Whiringa-ā-rangi', 'Hakihea'], - 'months_short' => ['Kohi', 'Hui', 'Pou', 'Pae', 'Hara', 'Pipi', 'Hōngoi', 'Here', 'Mahu', 'Whi-nu', 'Whi-ra', 'Haki'], - 'weekdays' => ['Rātapu', 'Mane', 'Tūrei', 'Wenerei', 'Tāite', 'Paraire', 'Hātarei'], - 'weekdays_short' => ['Ta', 'Ma', 'Tū', 'We', 'Tāi', 'Pa', 'Hā'], - 'weekdays_min' => ['Ta', 'Ma', 'Tū', 'We', 'Tāi', 'Pa', 'Hā'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' me te '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mi_NZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/mi_NZ.php deleted file mode 100644 index 6b964e3a..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mi_NZ.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/mi.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/miq.php b/vendor/nesbot/carbon/src/Carbon/Lang/miq.php deleted file mode 100644 index 51e5a985..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/miq.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/miq_NI.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/miq_NI.php b/vendor/nesbot/carbon/src/Carbon/Lang/miq_NI.php deleted file mode 100644 index 57faa318..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/miq_NI.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YY', - ], - 'months' => ['siakwa kati', 'kuswa kati', 'kakamuk kati', 'lî wainhka kati', 'lih mairin kati', 'lî kati', 'pastara kati', 'sikla kati', 'wîs kati', 'waupasa kati', 'yahbra kati', 'trisu kati'], - 'months_short' => ['siakwa kati', 'kuswa kati', 'kakamuk kati', 'lî wainhka kati', 'lih mairin kati', 'lî kati', 'pastara kati', 'sikla kati', 'wîs kati', 'waupasa kati', 'yahbra kati', 'trisu kati'], - 'weekdays' => ['sandi', 'mundi', 'tiusdi', 'wensde', 'tausde', 'praidi', 'satadi'], - 'weekdays_short' => ['san', 'mun', 'tius', 'wens', 'taus', 'prai', 'sat'], - 'weekdays_min' => ['san', 'mun', 'tius', 'wens', 'taus', 'prai', 'sat'], - 'first_day_of_week' => 0, - 'day_of_first_week_of_year' => 7, - 'meridiem' => ['VM', 'NM'], - - 'month' => ':count kati', // less reliable - 'm' => ':count kati', // less reliable - 'a_month' => ':count kati', // less reliable -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mjw.php b/vendor/nesbot/carbon/src/Carbon/Lang/mjw.php deleted file mode 100644 index 617154cd..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mjw.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/mjw_IN.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mjw_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/mjw_IN.php deleted file mode 100644 index 58ed0d18..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mjw_IN.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Jor Teron bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'D/M/YY', - ], - 'months' => ['Arkoi', 'Thangthang', 'There', 'Jangmi', 'Aru', 'Vosik', 'Jakhong', 'Paipai', 'Chiti', 'Phere', 'Phaikuni', 'Matijong'], - 'months_short' => ['Ark', 'Thang', 'The', 'Jang', 'Aru', 'Vos', 'Jak', 'Pai', 'Chi', 'Phe', 'Phai', 'Mati'], - 'weekdays' => ['Bhomkuru', 'Urmi', 'Durmi', 'Thelang', 'Theman', 'Bhomta', 'Bhomti'], - 'weekdays_short' => ['Bhom', 'Ur', 'Dur', 'Tkel', 'Tkem', 'Bhta', 'Bhti'], - 'weekdays_min' => ['Bhom', 'Ur', 'Dur', 'Tkel', 'Tkem', 'Bhta', 'Bhti'], - 'first_day_of_week' => 0, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mk.php b/vendor/nesbot/carbon/src/Carbon/Lang/mk.php deleted file mode 100644 index d822de09..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mk.php +++ /dev/null @@ -1,116 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Sashko Todorov - * - Josh Soref - * - François B - * - Serhan Apaydın - * - Borislav Mickov - * - JD Isaacks - * - Tomi Atanasoski - */ - -use Carbon\CarbonInterface; - -return [ - 'year' => ':count година|:count години', - 'a_year' => 'година|:count години', - 'y' => ':count год.', - 'month' => ':count месец|:count месеци', - 'a_month' => 'месец|:count месеци', - 'm' => ':count месец|:count месеци', - 'week' => ':count седмица|:count седмици', - 'a_week' => 'седмица|:count седмици', - 'w' => ':count седмица|:count седмици', - 'day' => ':count ден|:count дена', - 'a_day' => 'ден|:count дена', - 'd' => ':count ден|:count дена', - 'hour' => ':count час|:count часа', - 'a_hour' => 'час|:count часа', - 'h' => ':count час|:count часа', - 'minute' => ':count минута|:count минути', - 'a_minute' => 'минута|:count минути', - 'min' => ':count мин.', - 'second' => ':count секунда|:count секунди', - 'a_second' => 'неколку секунди|:count секунди', - 's' => ':count сек.', - 'ago' => 'пред :time', - 'from_now' => 'после :time', - 'after' => 'по :time', - 'before' => 'пред :time', - 'diff_now' => 'сега', - 'diff_today' => 'Денес', - 'diff_today_regexp' => 'Денес(?:\\s+во)?', - 'diff_yesterday' => 'вчера', - 'diff_yesterday_regexp' => 'Вчера(?:\\s+во)?', - 'diff_tomorrow' => 'утре', - 'diff_tomorrow_regexp' => 'Утре(?:\\s+во)?', - 'formats' => [ - 'LT' => 'H:mm', - 'LTS' => 'H:mm:ss', - 'L' => 'D.MM.YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY H:mm', - 'LLLL' => 'dddd, D MMMM YYYY H:mm', - ], - 'calendar' => [ - 'sameDay' => '[Денес во] LT', - 'nextDay' => '[Утре во] LT', - 'nextWeek' => '[Во] dddd [во] LT', - 'lastDay' => '[Вчера во] LT', - 'lastWeek' => function (CarbonInterface $date) { - switch ($date->dayOfWeek) { - case 0: - case 3: - case 6: - return '[Изминатата] dddd [во] LT'; - default: - return '[Изминатиот] dddd [во] LT'; - } - }, - 'sameElse' => 'L', - ], - 'ordinal' => function ($number) { - $lastDigit = $number % 10; - $last2Digits = $number % 100; - if ($number === 0) { - return $number.'-ев'; - } - if ($last2Digits === 0) { - return $number.'-ен'; - } - if ($last2Digits > 10 && $last2Digits < 20) { - return $number.'-ти'; - } - if ($lastDigit === 1) { - return $number.'-ви'; - } - if ($lastDigit === 2) { - return $number.'-ри'; - } - if ($lastDigit === 7 || $lastDigit === 8) { - return $number.'-ми'; - } - - return $number.'-ти'; - }, - 'months' => ['јануари', 'февруари', 'март', 'април', 'мај', 'јуни', 'јули', 'август', 'септември', 'октомври', 'ноември', 'декември'], - 'months_short' => ['јан', 'фев', 'мар', 'апр', 'мај', 'јун', 'јул', 'авг', 'сеп', 'окт', 'ное', 'дек'], - 'weekdays' => ['недела', 'понеделник', 'вторник', 'среда', 'четврток', 'петок', 'сабота'], - 'weekdays_short' => ['нед', 'пон', 'вто', 'сре', 'чет', 'пет', 'саб'], - 'weekdays_min' => ['нe', 'пo', 'вт', 'ср', 'че', 'пе', 'сa'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'list' => [', ', ' и '], - 'meridiem' => ['АМ', 'ПМ'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mk_MK.php b/vendor/nesbot/carbon/src/Carbon/Lang/mk_MK.php deleted file mode 100644 index 95e2ff9c..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mk_MK.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/mk.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ml.php b/vendor/nesbot/carbon/src/Carbon/Lang/ml.php deleted file mode 100644 index 1abd6c44..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ml.php +++ /dev/null @@ -1,76 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - JD Isaacks - */ -return [ - 'year' => ':count വർഷം', - 'a_year' => 'ഒരു വർഷം|:count വർഷം', - 'month' => ':count മാസം', - 'a_month' => 'ഒരു മാസം|:count മാസം', - 'week' => ':count ആഴ്ച', - 'a_week' => 'ഒരാഴ്ച|:count ആഴ്ച', - 'day' => ':count ദിവസം', - 'a_day' => 'ഒരു ദിവസം|:count ദിവസം', - 'hour' => ':count മണിക്കൂർ', - 'a_hour' => 'ഒരു മണിക്കൂർ|:count മണിക്കൂർ', - 'minute' => ':count മിനിറ്റ്', - 'a_minute' => 'ഒരു മിനിറ്റ്|:count മിനിറ്റ്', - 'second' => ':count സെക്കൻഡ്', - 'a_second' => 'അൽപ നിമിഷങ്ങൾ|:count സെക്കൻഡ്', - 'ago' => ':time മുൻപ്', - 'from_now' => ':time കഴിഞ്ഞ്', - 'diff_now' => 'ഇപ്പോൾ', - 'diff_today' => 'ഇന്ന്', - 'diff_yesterday' => 'ഇന്നലെ', - 'diff_tomorrow' => 'നാളെ', - 'formats' => [ - 'LT' => 'A h:mm -നു', - 'LTS' => 'A h:mm:ss -നു', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY, A h:mm -നു', - 'LLLL' => 'dddd, D MMMM YYYY, A h:mm -നു', - ], - 'calendar' => [ - 'sameDay' => '[ഇന്ന്] LT', - 'nextDay' => '[നാളെ] LT', - 'nextWeek' => 'dddd, LT', - 'lastDay' => '[ഇന്നലെ] LT', - 'lastWeek' => '[കഴിഞ്ഞ] dddd, LT', - 'sameElse' => 'L', - ], - 'meridiem' => function ($hour) { - if ($hour < 4) { - return 'രാത്രി'; - } - if ($hour < 12) { - return 'രാവിലെ'; - } - if ($hour < 17) { - return 'ഉച്ച കഴിഞ്ഞ്'; - } - if ($hour < 20) { - return 'വൈകുന്നേരം'; - } - - return 'രാത്രി'; - }, - 'months' => ['ജനുവരി', 'ഫെബ്രുവരി', 'മാർച്ച്', 'ഏപ്രിൽ', 'മേയ്', 'ജൂൺ', 'ജൂലൈ', 'ഓഗസ്റ്റ്', 'സെപ്റ്റംബർ', 'ഒക്ടോബർ', 'നവംബർ', 'ഡിസംബർ'], - 'months_short' => ['ജനു.', 'ഫെബ്രു.', 'മാർ.', 'ഏപ്രി.', 'മേയ്', 'ജൂൺ', 'ജൂലൈ.', 'ഓഗ.', 'സെപ്റ്റ.', 'ഒക്ടോ.', 'നവം.', 'ഡിസം.'], - 'weekdays' => ['ഞായറാഴ്ച', 'തിങ്കളാഴ്ച', 'ചൊവ്വാഴ്ച', 'ബുധനാഴ്ച', 'വ്യാഴാഴ്ച', 'വെള്ളിയാഴ്ച', 'ശനിയാഴ്ച'], - 'weekdays_short' => ['ഞായർ', 'തിങ്കൾ', 'ചൊവ്വ', 'ബുധൻ', 'വ്യാഴം', 'വെള്ളി', 'ശനി'], - 'weekdays_min' => ['ഞാ', 'തി', 'ചൊ', 'ബു', 'വ്യാ', 'വെ', 'ശ'], - 'list' => ', ', - 'weekend' => [0, 0], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ml_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/ml_IN.php deleted file mode 100644 index 000e7958..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ml_IN.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/ml.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mn.php b/vendor/nesbot/carbon/src/Carbon/Lang/mn.php deleted file mode 100644 index 38c6434d..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mn.php +++ /dev/null @@ -1,116 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Philippe Vaucher - * - Tsutomu Kuroda - * - tjku - * - Max Melentiev - * - Zolzaya Erdenebaatar - * - Tom Hughes - * - Akira Matsuda - * - Christopher Dell - * - Michael Kessler - * - Enrique Vidal - * - Simone Carletti - * - Aaron Patterson - * - Nicolás Hock Isaza - * - Ochirkhuyag - * - Batmandakh - * - lucifer-crybaby - */ -return [ - 'year' => ':count жил', - 'y' => ':count жил', - 'month' => ':count сар', - 'm' => ':count сар', - 'week' => ':count долоо хоног', - 'w' => ':count долоо хоног', - 'day' => ':count өдөр', - 'd' => ':count өдөр', - 'hour' => ':count цаг', - 'h' => ':countц', - 'minute' => ':count минут', - 'min' => ':countм', - 'second' => ':count секунд', - 's' => ':countс', - - 'ago_mode' => 'last', - 'ago' => ':time өмнө', - 'year_ago' => ':count жилийн', - 'y_ago' => ':count жилийн', - 'month_ago' => ':count сарын', - 'm_ago' => ':count сарын', - 'day_ago' => ':count хоногийн', - 'd_ago' => ':count хоногийн', - 'week_ago' => ':count долоо хоногийн', - 'w_ago' => ':count долоо хоногийн', - 'hour_ago' => ':count цагийн', - 'minute_ago' => ':count минутын', - 'second_ago' => ':count секундын', - - 'from_now_mode' => 'last', - 'from_now' => 'одоогоос :time', - 'year_from_now' => ':count жилийн дараа', - 'y_from_now' => ':count жилийн дараа', - 'month_from_now' => ':count сарын дараа', - 'm_from_now' => ':count сарын дараа', - 'day_from_now' => ':count хоногийн дараа', - 'd_from_now' => ':count хоногийн дараа', - 'hour_from_now' => ':count цагийн дараа', - 'minute_from_now' => ':count минутын дараа', - 'second_from_now' => ':count секундын дараа', - - 'after_mode' => 'last', - 'after' => ':time дараа', - 'year_after' => ':count жилийн', - 'y_after' => ':count жилийн', - 'month_after' => ':count сарын', - 'm_after' => ':count сарын', - 'day_after' => ':count хоногийн', - 'd_after' => ':count хоногийн', - 'hour_after' => ':count цагийн', - 'minute_after' => ':count минутын', - 'second_after' => ':count секундын', - - 'before_mode' => 'last', - 'before' => ':time өмнө', - 'year_before' => ':count жилийн', - 'y_before' => ':count жилийн', - 'month_before' => ':count сарын', - 'm_before' => ':count сарын', - 'day_before' => ':count хоногийн', - 'd_before' => ':count хоногийн', - 'hour_before' => ':count цагийн', - 'minute_before' => ':count минутын', - 'second_before' => ':count секундын', - - 'list' => ', ', - 'diff_now' => 'одоо', - 'diff_yesterday' => 'өчигдөр', - 'diff_tomorrow' => 'маргааш', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'YYYY-MM-DD', - 'LL' => 'YYYY MMMM DD', - 'LLL' => 'YY-MM-DD, HH:mm', - 'LLLL' => 'YYYY MMMM DD, HH:mm', - ], - 'weekdays' => ['Ням', 'Даваа', 'Мягмар', 'Лхагва', 'Пүрэв', 'Баасан', 'Бямба'], - 'weekdays_short' => ['Ня', 'Да', 'Мя', 'Лх', 'Пү', 'Ба', 'Бя'], - 'weekdays_min' => ['Ня', 'Да', 'Мя', 'Лх', 'Пү', 'Ба', 'Бя'], - 'months' => ['1 сар', '2 сар', '3 сар', '4 сар', '5 сар', '6 сар', '7 сар', '8 сар', '9 сар', '10 сар', '11 сар', '12 сар'], - 'months_short' => ['1 сар', '2 сар', '3 сар', '4 сар', '5 сар', '6 сар', '7 сар', '8 сар', '9 сар', '10 сар', '11 сар', '12 сар'], - 'meridiem' => ['өглөө', 'орой'], - 'first_day_of_week' => 1, -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mn_MN.php b/vendor/nesbot/carbon/src/Carbon/Lang/mn_MN.php deleted file mode 100644 index e5ce426c..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mn_MN.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/mn.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mni.php b/vendor/nesbot/carbon/src/Carbon/Lang/mni.php deleted file mode 100644 index cafa2f87..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mni.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/mni_IN.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mni_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/mni_IN.php deleted file mode 100644 index 45d430ef..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mni_IN.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Red Hat Pune libc-alpha@sourceware.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'D/M/YY', - ], - 'months' => ['জানুৱারি', 'ফেব্রুৱারি', 'মার্চ', 'এপ্রিল', 'মে', 'জুন', 'জুলাই', 'আগষ্ট', 'সেপ্তেম্বর', 'ওক্তোবর', 'নবেম্বর', 'ডিসেম্বর'], - 'months_short' => ['জান', 'ফেব', 'মার', 'এপ্রি', 'মে', 'জুন', 'জুল', 'আগ', 'সেপ', 'ওক্ত', 'নবে', 'ডিস'], - 'weekdays' => ['নোংমাইজিং', 'নিংথৌকাবা', 'লৈবাকপোকপা', 'য়ুমশকৈশা', 'শগোলশেন', 'ইরাই', 'থাংজ'], - 'weekdays_short' => ['নোং', 'নিং', 'লৈবাক', 'য়ুম', 'শগোল', 'ইরা', 'থাং'], - 'weekdays_min' => ['নোং', 'নিং', 'লৈবাক', 'য়ুম', 'শগোল', 'ইরা', 'থাং'], - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['এ.ম.', 'প.ম.'], - - 'year' => ':count ইসিং', // less reliable - 'y' => ':count ইসিং', // less reliable - 'a_year' => ':count ইসিং', // less reliable - - 'second' => ':count ꯅꯤꯡꯊꯧꯀꯥꯕ', // less reliable - 's' => ':count ꯅꯤꯡꯊꯧꯀꯥꯕ', // less reliable - 'a_second' => ':count ꯅꯤꯡꯊꯧꯀꯥꯕ', // less reliable -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mo.php b/vendor/nesbot/carbon/src/Carbon/Lang/mo.php deleted file mode 100644 index 102afcde..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mo.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/ro.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mr.php b/vendor/nesbot/carbon/src/Carbon/Lang/mr.php deleted file mode 100644 index 4aaeafd0..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mr.php +++ /dev/null @@ -1,86 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Vikram-enyota - */ -return [ - 'year' => ':count वर्ष', - 'y' => ':count वर्ष', - 'month' => ':count महिना|:count महिने', - 'm' => ':count महिना|:count महिने', - 'week' => ':count आठवडा|:count आठवडे', - 'w' => ':count आठवडा|:count आठवडे', - 'day' => ':count दिवस', - 'd' => ':count दिवस', - 'hour' => ':count तास', - 'h' => ':count तास', - 'minute' => ':count मिनिटे', - 'min' => ':count मिनिटे', - 'second' => ':count सेकंद', - 's' => ':count सेकंद', - - 'ago' => ':timeपूर्वी', - 'from_now' => ':timeमध्ये', - 'before' => ':timeपूर्वी', - 'after' => ':timeनंतर', - - 'diff_now' => 'आत्ता', - 'diff_today' => 'आज', - 'diff_yesterday' => 'काल', - 'diff_tomorrow' => 'उद्या', - - 'formats' => [ - 'LT' => 'A h:mm वाजता', - 'LTS' => 'A h:mm:ss वाजता', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY, A h:mm वाजता', - 'LLLL' => 'dddd, D MMMM YYYY, A h:mm वाजता', - ], - - 'calendar' => [ - 'sameDay' => '[आज] LT', - 'nextDay' => '[उद्या] LT', - 'nextWeek' => 'dddd, LT', - 'lastDay' => '[काल] LT', - 'lastWeek' => '[मागील] dddd, LT', - 'sameElse' => 'L', - ], - - 'meridiem' => function ($hour) { - if ($hour < 4) { - return 'रात्री'; - } - if ($hour < 10) { - return 'सकाळी'; - } - if ($hour < 17) { - return 'दुपारी'; - } - if ($hour < 20) { - return 'सायंकाळी'; - } - - return 'रात्री'; - }, - - 'months' => ['जानेवारी', 'फेब्रुवारी', 'मार्च', 'एप्रिल', 'मे', 'जून', 'जुलै', 'ऑगस्ट', 'सप्टेंबर', 'ऑक्टोबर', 'नोव्हेंबर', 'डिसेंबर'], - 'months_short' => ['जाने.', 'फेब्रु.', 'मार्च.', 'एप्रि.', 'मे.', 'जून.', 'जुलै.', 'ऑग.', 'सप्टें.', 'ऑक्टो.', 'नोव्हें.', 'डिसें.'], - 'weekdays' => ['रविवार', 'सोमवार', 'मंगळवार', 'बुधवार', 'गुरूवार', 'शुक्रवार', 'शनिवार'], - 'weekdays_short' => ['रवि', 'सोम', 'मंगळ', 'बुध', 'गुरू', 'शुक्र', 'शनि'], - 'weekdays_min' => ['र', 'सो', 'मं', 'बु', 'गु', 'शु', 'श'], - 'list' => [', ', ' आणि '], - 'first_day_of_week' => 0, - 'day_of_first_week_of_year' => 1, - 'weekend' => [0, 0], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mr_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/mr_IN.php deleted file mode 100644 index 7bca919f..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mr_IN.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/mr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ms.php b/vendor/nesbot/carbon/src/Carbon/Lang/ms.php deleted file mode 100644 index 36934eeb..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ms.php +++ /dev/null @@ -1,104 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Josh Soref - * - Azri Jamil - * - JD Isaacks - * - Josh Soref - * - Azri Jamil - * - Hariadi Hinta - * - Ashraf Kamarudin - */ -return [ - 'year' => ':count tahun', - 'a_year' => '{1}setahun|]1,Inf[:count tahun', - 'y' => ':count tahun', - 'month' => ':count bulan', - 'a_month' => '{1}sebulan|]1,Inf[:count bulan', - 'm' => ':count bulan', - 'week' => ':count minggu', - 'a_week' => '{1}seminggu|]1,Inf[:count minggu', - 'w' => ':count minggu', - 'day' => ':count hari', - 'a_day' => '{1}sehari|]1,Inf[:count hari', - 'd' => ':count hari', - 'hour' => ':count jam', - 'a_hour' => '{1}sejam|]1,Inf[:count jam', - 'h' => ':count jam', - 'minute' => ':count minit', - 'a_minute' => '{1}seminit|]1,Inf[:count minit', - 'min' => ':count minit', - 'second' => ':count saat', - 'a_second' => '{1}beberapa saat|]1,Inf[:count saat', - 'millisecond' => ':count milisaat', - 'a_millisecond' => '{1}semilisaat|]1,Inf[:count milliseconds', - 'microsecond' => ':count mikrodetik', - 'a_microsecond' => '{1}semikrodetik|]1,Inf[:count mikrodetik', - 's' => ':count saat', - 'ago' => ':time yang lepas', - 'from_now' => ':time dari sekarang', - 'after' => ':time kemudian', - 'before' => ':time lepas', - 'diff_now' => 'sekarang', - 'diff_today' => 'Hari', - 'diff_today_regexp' => 'Hari(?:\\s+ini)?(?:\\s+pukul)?', - 'diff_yesterday' => 'semalam', - 'diff_yesterday_regexp' => 'Semalam(?:\\s+pukul)?', - 'diff_tomorrow' => 'esok', - 'diff_tomorrow_regexp' => 'Esok(?:\\s+pukul)?', - 'diff_before_yesterday' => 'kelmarin', - 'diff_after_tomorrow' => 'lusa', - 'formats' => [ - 'LT' => 'HH.mm', - 'LTS' => 'HH.mm.ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY [pukul] HH.mm', - 'LLLL' => 'dddd, D MMMM YYYY [pukul] HH.mm', - ], - 'calendar' => [ - 'sameDay' => '[Hari ini pukul] LT', - 'nextDay' => '[Esok pukul] LT', - 'nextWeek' => 'dddd [pukul] LT', - 'lastDay' => '[Kelmarin pukul] LT', - 'lastWeek' => 'dddd [lepas pukul] LT', - 'sameElse' => 'L', - ], - 'meridiem' => function ($hour) { - if ($hour < 1) { - return 'tengah malam'; - } - - if ($hour < 12) { - return 'pagi'; - } - - if ($hour < 13) { - return 'tengah hari'; - } - - if ($hour < 19) { - return 'petang'; - } - - return 'malam'; - }, - 'months' => ['Januari', 'Februari', 'Mac', 'April', 'Mei', 'Jun', 'Julai', 'Ogos', 'September', 'Oktober', 'November', 'Disember'], - 'months_short' => ['Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ogs', 'Sep', 'Okt', 'Nov', 'Dis'], - 'weekdays' => ['Ahad', 'Isnin', 'Selasa', 'Rabu', 'Khamis', 'Jumaat', 'Sabtu'], - 'weekdays_short' => ['Ahd', 'Isn', 'Sel', 'Rab', 'Kha', 'Jum', 'Sab'], - 'weekdays_min' => ['Ah', 'Is', 'Sl', 'Rb', 'Km', 'Jm', 'Sb'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'list' => [', ', ' dan '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ms_BN.php b/vendor/nesbot/carbon/src/Carbon/Lang/ms_BN.php deleted file mode 100644 index ef837a2d..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ms_BN.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/ms.php', [ - 'formats' => [ - 'LT' => 'h:mm a', - 'LTS' => 'h:mm:ss a', - 'L' => 'D/MM/yy', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY, h:mm a', - 'LLLL' => 'dd MMMM YYYY, h:mm a', - ], - 'meridiem' => ['a', 'p'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ms_MY.php b/vendor/nesbot/carbon/src/Carbon/Lang/ms_MY.php deleted file mode 100644 index 970d6048..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ms_MY.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Josh Soref - * - Azri Jamil - * - JD Isaacks - */ -return require __DIR__.'/ms.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ms_SG.php b/vendor/nesbot/carbon/src/Carbon/Lang/ms_SG.php deleted file mode 100644 index 77cb83d2..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ms_SG.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/ms.php', [ - 'formats' => [ - 'LT' => 'h:mm a', - 'LTS' => 'h:mm:ss a', - 'L' => 'D/MM/yy', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY, h:mm a', - 'LLLL' => 'dddd, D MMMM YYYY, h:mm a', - ], - 'meridiem' => ['a', 'p'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mt.php b/vendor/nesbot/carbon/src/Carbon/Lang/mt.php deleted file mode 100644 index e8aadcc9..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mt.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Alessandro Maruccia - */ -return [ - 'year' => 'sena|:count sni|:count sni|:count sni', - 'y' => 'sa sena|:count snin|:count snin|:count snin', - 'month' => 'xahar|:count xhur|:count xhur|:count xhur', - 'm' => ':count xahar|:count xhur|:count xhur|:count xhur', - 'week' => 'gimgħa|:count ġimgħat|:count ġimgħat|:count ġimgħat', - 'w' => 'ġimgħa|:count ġimgħat|:count ġimgħat|:count ġimgħat', - 'day' => 'ġurnata|:count ġranet|:count ġranet|:count ġranet', - 'd' => 'ġurnata|:count ġranet|:count ġranet|:count ġranet', - 'hour' => 'siegħa|:count siegħat|:count siegħat|:count siegħat', - 'h' => 'siegħa|:count sigħat|:count sigħat|:count sigħat', - 'minute' => 'minuta|:count minuti|:count minuti|:count minuti', - 'min' => 'min.|:count min.|:count min.|:count min.', - 'second' => 'ftit sekondi|:count sekondi|:count sekondi|:count sekondi', - 's' => 'sek.|:count sek.|:count sek.|:count sek.', - 'ago' => ':time ilu', - 'from_now' => 'f’ :time', - 'diff_now' => 'issa', - 'diff_today' => 'Illum', - 'diff_today_regexp' => 'Illum(?:\\s+fil-)?', - 'diff_yesterday' => 'lbieraħ', - 'diff_yesterday_regexp' => 'Il-bieraħ(?:\\s+fil-)?', - 'diff_tomorrow' => 'għada', - 'diff_tomorrow_regexp' => 'Għada(?:\\s+fil-)?', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[Illum fil-]LT', - 'nextDay' => '[Għada fil-]LT', - 'nextWeek' => 'dddd [fil-]LT', - 'lastDay' => '[Il-bieraħ fil-]LT', - 'lastWeek' => 'dddd [li għadda] [fil-]LT', - 'sameElse' => 'L', - ], - 'ordinal' => ':numberº', - 'months' => ['Jannar', 'Frar', 'Marzu', 'April', 'Mejju', 'Ġunju', 'Lulju', 'Awwissu', 'Settembru', 'Ottubru', 'Novembru', 'Diċembru'], - 'months_short' => ['Jan', 'Fra', 'Mar', 'Apr', 'Mej', 'Ġun', 'Lul', 'Aww', 'Set', 'Ott', 'Nov', 'Diċ'], - 'weekdays' => ['Il-Ħadd', 'It-Tnejn', 'It-Tlieta', 'L-Erbgħa', 'Il-Ħamis', 'Il-Ġimgħa', 'Is-Sibt'], - 'weekdays_short' => ['Ħad', 'Tne', 'Tli', 'Erb', 'Ħam', 'Ġim', 'Sib'], - 'weekdays_min' => ['Ħa', 'Tn', 'Tl', 'Er', 'Ħa', 'Ġi', 'Si'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' u '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mt_MT.php b/vendor/nesbot/carbon/src/Carbon/Lang/mt_MT.php deleted file mode 100644 index 9534f687..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mt_MT.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/mt.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mua.php b/vendor/nesbot/carbon/src/Carbon/Lang/mua.php deleted file mode 100644 index a3a3c6fd..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mua.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['comme', 'lilli'], - 'weekdays' => ['Com’yakke', 'Comlaaɗii', 'Comzyiiɗii', 'Comkolle', 'Comkaldǝɓlii', 'Comgaisuu', 'Comzyeɓsuu'], - 'weekdays_short' => ['Cya', 'Cla', 'Czi', 'Cko', 'Cka', 'Cga', 'Cze'], - 'weekdays_min' => ['Cya', 'Cla', 'Czi', 'Cko', 'Cka', 'Cga', 'Cze'], - 'months' => ['Fĩi Loo', 'Cokcwaklaŋne', 'Cokcwaklii', 'Fĩi Marfoo', 'Madǝǝuutǝbijaŋ', 'Mamǝŋgwãafahbii', 'Mamǝŋgwãalii', 'Madǝmbii', 'Fĩi Dǝɓlii', 'Fĩi Mundaŋ', 'Fĩi Gwahlle', 'Fĩi Yuru'], - 'months_short' => ['FLO', 'CLA', 'CKI', 'FMF', 'MAD', 'MBI', 'MLI', 'MAM', 'FDE', 'FMU', 'FGW', 'FYU'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'D/M/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/my.php b/vendor/nesbot/carbon/src/Carbon/Lang/my.php deleted file mode 100644 index bbdfba40..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/my.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Josh Soref - * - JD Isaacks - * - Nay Lin Aung - */ -return [ - 'year' => '{1}တစ်နှစ်|]1,Inf[:count နှစ်', - 'y' => ':count နှစ်', - 'month' => '{1}တစ်လ|]1,Inf[:count လ', - 'm' => ':count လ', - 'week' => ':count ပတ်', - 'w' => ':count ပတ်', - 'day' => '{1}တစ်ရက်|]1,Inf[:count ရက်', - 'd' => ':count ရက်', - 'hour' => '{1}တစ်နာရီ|]1,Inf[:count နာရီ', - 'h' => ':count နာရီ', - 'minute' => '{1}တစ်မိနစ်|]1,Inf[:count မိနစ်', - 'min' => ':count မိနစ်', - 'second' => '{1}စက္ကန်.အနည်းငယ်|]1,Inf[:count စက္ကန့်', - 's' => ':count စက္ကန့်', - 'ago' => 'လွန်ခဲ့သော :time က', - 'from_now' => 'လာမည့် :time မှာ', - 'after' => ':time ကြာပြီးနောက်', - 'before' => ':time မတိုင်ခင်', - 'diff_now' => 'အခုလေးတင်', - 'diff_today' => 'ယနေ.', - 'diff_yesterday' => 'မနေ့က', - 'diff_yesterday_regexp' => 'မနေ.က', - 'diff_tomorrow' => 'မနက်ဖြန်', - 'diff_before_yesterday' => 'တမြန်နေ့က', - 'diff_after_tomorrow' => 'တဘက်ခါ', - 'period_recurrences' => ':count ကြိမ်', - 'formats' => [ - 'LT' => 'Oh:Om A', - 'LTS' => 'Oh:Om:Os A', - 'L' => 'OD/OM/OY', - 'LL' => 'OD MMMM OY', - 'LLL' => 'OD MMMM OY Oh:Om A', - 'LLLL' => 'dddd OD MMMM OY Oh:Om A', - ], - 'calendar' => [ - 'sameDay' => '[ယနေ.] LT [မှာ]', - 'nextDay' => '[မနက်ဖြန်] LT [မှာ]', - 'nextWeek' => 'dddd LT [မှာ]', - 'lastDay' => '[မနေ.က] LT [မှာ]', - 'lastWeek' => '[ပြီးခဲ့သော] dddd LT [မှာ]', - 'sameElse' => 'L', - ], - 'months' => ['ဇန်နဝါရီ', 'ဖေဖော်ဝါရီ', 'မတ်', 'ဧပြီ', 'မေ', 'ဇွန်', 'ဇူလိုင်', 'သြဂုတ်', 'စက်တင်ဘာ', 'အောက်တိုဘာ', 'နိုဝင်ဘာ', 'ဒီဇင်ဘာ'], - 'months_short' => ['ဇန်', 'ဖေ', 'မတ်', 'ပြီ', 'မေ', 'ဇွန်', 'လိုင်', 'သြ', 'စက်', 'အောက်', 'နို', 'ဒီ'], - 'weekdays' => ['တနင်္ဂနွေ', 'တနင်္လာ', 'အင်္ဂါ', 'ဗုဒ္ဓဟူး', 'ကြာသပတေး', 'သောကြာ', 'စနေ'], - 'weekdays_short' => ['နွေ', 'လာ', 'ဂါ', 'ဟူး', 'ကြာ', 'သော', 'နေ'], - 'weekdays_min' => ['နွေ', 'လာ', 'ဂါ', 'ဟူး', 'ကြာ', 'သော', 'နေ'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'alt_numbers' => ['၀၀', '၀၁', '၀၂', '၀၃', '၀၄', '၀၅', '၀၆', '၀၇', '၀၈', '၀၉', '၁၀', '၁၁', '၁၂', '၁၃', '၁၄', '၁၅', '၁၆', '၁၇', '၁၈', '၁၉', '၂၀', '၂၁', '၂၂', '၂၃', '၂၄', '၂၅', '၂၆', '၂၇', '၂၈', '၂၉', '၃၀', '၃၁', '၃၂', '၃၃', '၃၄', '၃၅', '၃၆', '၃၇', '၃၈', '၃၉', '၄၀', '၄၁', '၄၂', '၄၃', '၄၄', '၄၅', '၄၆', '၄၇', '၄၈', '၄၉', '၅၀', '၅၁', '၅၂', '၅၃', '၅၄', '၅၅', '၅၆', '၅၇', '၅၈', '၅၉', '၆၀', '၆၁', '၆၂', '၆၃', '၆၄', '၆၅', '၆၆', '၆၇', '၆၈', '၆၉', '၇၀', '၇၁', '၇၂', '၇၃', '၇၄', '၇၅', '၇၆', '၇၇', '၇၈', '၇၉', '၈၀', '၈၁', '၈၂', '၈၃', '၈၄', '၈၅', '၈၆', '၈၇', '၈၈', '၈၉', '၉၀', '၉၁', '၉၂', '၉၃', '၉၄', '၉၅', '၉၆', '၉၇', '၉၈', '၉၉'], - 'meridiem' => ['နံနက်', 'ညနေ'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/my_MM.php b/vendor/nesbot/carbon/src/Carbon/Lang/my_MM.php deleted file mode 100644 index a0108dd4..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/my_MM.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/my.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mzn.php b/vendor/nesbot/carbon/src/Carbon/Lang/mzn.php deleted file mode 100644 index 70f5f23c..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mzn.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/fa.php', [ - 'months' => ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'], - 'months_short' => ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'], - 'first_day_of_week' => 6, - 'weekend' => [5, 5], - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'YYYY-MM-dd', - 'LL' => 'YYYY MMM D', - 'LLL' => 'YYYY MMMM D HH:mm', - 'LLLL' => 'YYYY MMMM D, dddd HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nan.php b/vendor/nesbot/carbon/src/Carbon/Lang/nan.php deleted file mode 100644 index 0affece8..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nan.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/nan_TW.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nan_TW.php b/vendor/nesbot/carbon/src/Carbon/Lang/nan_TW.php deleted file mode 100644 index 5c50aa48..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nan_TW.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'YYYY年MM月DD日', - ], - 'months' => ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], - 'months_short' => [' 1月', ' 2月', ' 3月', ' 4月', ' 5月', ' 6月', ' 7月', ' 8月', ' 9月', '10月', '11月', '12月'], - 'weekdays' => ['禮拜日', '禮拜一', '禮拜二', '禮拜三', '禮拜四', '禮拜五', '禮拜六'], - 'weekdays_short' => ['日', '一', '二', '三', '四', '五', '六'], - 'weekdays_min' => ['日', '一', '二', '三', '四', '五', '六'], - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['頂晡', '下晡'], - - 'year' => ':count 年', - 'y' => ':count 年', - 'a_year' => ':count 年', - - 'month' => ':count goe̍h', - 'm' => ':count goe̍h', - 'a_month' => ':count goe̍h', - - 'week' => ':count lé-pài', - 'w' => ':count lé-pài', - 'a_week' => ':count lé-pài', - - 'day' => ':count 日', - 'd' => ':count 日', - 'a_day' => ':count 日', - - 'hour' => ':count tiám-cheng', - 'h' => ':count tiám-cheng', - 'a_hour' => ':count tiám-cheng', - - 'minute' => ':count Hun-cheng', - 'min' => ':count Hun-cheng', - 'a_minute' => ':count Hun-cheng', - - 'second' => ':count Bió', - 's' => ':count Bió', - 'a_second' => ':count Bió', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nan_TW@latin.php b/vendor/nesbot/carbon/src/Carbon/Lang/nan_TW@latin.php deleted file mode 100644 index 99ca2a42..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nan_TW@latin.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Arne Goetje arne@canonical.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'YYYY-MM-DD', - ], - 'months' => ['1goe̍h', '2goe̍h', '3goe̍h', '4goe̍h', '5goe̍h', '6goe̍h', '7goe̍h', '8goe̍h', '9goe̍h', '10goe̍h', '11goe̍h', '12goe̍h'], - 'months_short' => ['1g', '2g', '3g', '4g', '5g', '6g', '7g', '8g', '9g', '10g', '11g', '12g'], - 'weekdays' => ['lé-pài-ji̍t', 'pài-it', 'pài-jī', 'pài-saⁿ', 'pài-sì', 'pài-gō͘', 'pài-la̍k'], - 'weekdays_short' => ['lp', 'p1', 'p2', 'p3', 'p4', 'p5', 'p6'], - 'weekdays_min' => ['lp', 'p1', 'p2', 'p3', 'p4', 'p5', 'p6'], - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['téng-po͘', 'ē-po͘'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/naq.php b/vendor/nesbot/carbon/src/Carbon/Lang/naq.php deleted file mode 100644 index fbd9be91..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/naq.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['ǁgoagas', 'ǃuias'], - 'weekdays' => ['Sontaxtsees', 'Mantaxtsees', 'Denstaxtsees', 'Wunstaxtsees', 'Dondertaxtsees', 'Fraitaxtsees', 'Satertaxtsees'], - 'weekdays_short' => ['Son', 'Ma', 'De', 'Wu', 'Do', 'Fr', 'Sat'], - 'weekdays_min' => ['Son', 'Ma', 'De', 'Wu', 'Do', 'Fr', 'Sat'], - 'months' => ['ǃKhanni', 'ǃKhanǀgôab', 'ǀKhuuǁkhâb', 'ǃHôaǂkhaib', 'ǃKhaitsâb', 'Gamaǀaeb', 'ǂKhoesaob', 'Aoǁkhuumûǁkhâb', 'Taraǀkhuumûǁkhâb', 'ǂNûǁnâiseb', 'ǀHooǂgaeb', 'Hôasoreǁkhâb'], - 'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'h:mm a', - 'LTS' => 'h:mm:ss a', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY h:mm a', - 'LLLL' => 'dddd, D MMMM YYYY h:mm a', - ], - - 'year' => ':count kurigu', - 'y' => ':count kurigu', - 'a_year' => ':count kurigu', - - 'month' => ':count ǁaub', // less reliable - 'm' => ':count ǁaub', // less reliable - 'a_month' => ':count ǁaub', // less reliable - - 'week' => ':count hû', // less reliable - 'w' => ':count hû', // less reliable - 'a_week' => ':count hû', // less reliable - - 'day' => ':count ǀhobas', // less reliable - 'd' => ':count ǀhobas', // less reliable - 'a_day' => ':count ǀhobas', // less reliable - - 'hour' => ':count ǂgaes', // less reliable - 'h' => ':count ǂgaes', // less reliable - 'a_hour' => ':count ǂgaes', // less reliable - - 'minute' => ':count minutga', // less reliable - 'min' => ':count minutga', // less reliable - 'a_minute' => ':count minutga', // less reliable -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nb.php b/vendor/nesbot/carbon/src/Carbon/Lang/nb.php deleted file mode 100644 index 371ee840..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nb.php +++ /dev/null @@ -1,84 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - François B - * - Alexander Tømmerås - * - Sigurd Gartmann - * - JD Isaacks - */ -return [ - 'year' => ':count år|:count år', - 'a_year' => 'ett år|:count år', - 'y' => ':count år|:count år', - 'month' => ':count måned|:count måneder', - 'a_month' => 'en måned|:count måneder', - 'm' => ':count md.', - 'week' => ':count uke|:count uker', - 'a_week' => 'en uke|:count uker', - 'w' => ':count u.', - 'day' => ':count dag|:count dager', - 'a_day' => 'en dag|:count dager', - 'd' => ':count d.', - 'hour' => ':count time|:count timer', - 'a_hour' => 'en time|:count timer', - 'h' => ':count t', - 'minute' => ':count minutt|:count minutter', - 'a_minute' => 'ett minutt|:count minutter', - 'min' => ':count min', - 'second' => ':count sekund|:count sekunder', - 'a_second' => 'noen sekunder|:count sekunder', - 's' => ':count sek', - 'ago' => ':time siden', - 'from_now' => 'om :time', - 'after' => ':time etter', - 'before' => ':time før', - 'diff_now' => 'akkurat nå', - 'diff_today' => 'i dag', - 'diff_today_regexp' => 'i dag(?:\\s+kl.)?', - 'diff_yesterday' => 'i går', - 'diff_yesterday_regexp' => 'i går(?:\\s+kl.)?', - 'diff_tomorrow' => 'i morgen', - 'diff_tomorrow_regexp' => 'i morgen(?:\\s+kl.)?', - 'diff_before_yesterday' => 'i forgårs', - 'diff_after_tomorrow' => 'i overmorgen', - 'period_recurrences' => 'en gang|:count ganger', - 'period_interval' => 'hver :interval', - 'period_start_date' => 'fra :date', - 'period_end_date' => 'til :date', - 'months' => ['januar', 'februar', 'mars', 'april', 'mai', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'desember'], - 'months_short' => ['jan', 'feb', 'mar', 'apr', 'mai', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'des'], - 'weekdays' => ['søndag', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag'], - 'weekdays_short' => ['søn', 'man', 'tir', 'ons', 'tor', 'fre', 'lør'], - 'weekdays_min' => ['sø', 'ma', 'ti', 'on', 'to', 'fr', 'lø'], - 'ordinal' => ':number.', - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD.MM.YYYY', - 'LL' => 'D. MMMM YYYY', - 'LLL' => 'D. MMMM YYYY [kl.] HH:mm', - 'LLLL' => 'dddd D. MMMM YYYY [kl.] HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[i dag kl.] LT', - 'nextDay' => '[i morgen kl.] LT', - 'nextWeek' => 'dddd [kl.] LT', - 'lastDay' => '[i går kl.] LT', - 'lastWeek' => '[forrige] dddd [kl.] LT', - 'sameElse' => 'L', - ], - 'list' => [', ', ' og '], - 'meridiem' => ['a.m.', 'p.m.'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nb_NO.php b/vendor/nesbot/carbon/src/Carbon/Lang/nb_NO.php deleted file mode 100644 index 31678c53..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nb_NO.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/nb.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nb_SJ.php b/vendor/nesbot/carbon/src/Carbon/Lang/nb_SJ.php deleted file mode 100644 index ce0210bc..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nb_SJ.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/nb.php', [ - 'formats' => [ - 'LL' => 'D. MMM YYYY', - 'LLL' => 'D. MMMM YYYY, HH:mm', - 'LLLL' => 'dddd D. MMMM YYYY, HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nd.php b/vendor/nesbot/carbon/src/Carbon/Lang/nd.php deleted file mode 100644 index f75d9a71..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nd.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'weekdays' => ['Sonto', 'Mvulo', 'Sibili', 'Sithathu', 'Sine', 'Sihlanu', 'Mgqibelo'], - 'weekdays_short' => ['Son', 'Mvu', 'Sib', 'Sit', 'Sin', 'Sih', 'Mgq'], - 'weekdays_min' => ['Son', 'Mvu', 'Sib', 'Sit', 'Sin', 'Sih', 'Mgq'], - 'months' => ['Zibandlela', 'Nhlolanja', 'Mbimbitho', 'Mabasa', 'Nkwenkwezi', 'Nhlangula', 'Ntulikazi', 'Ncwabakazi', 'Mpandula', 'Mfumfu', 'Lwezi', 'Mpalakazi'], - 'months_short' => ['Zib', 'Nhlo', 'Mbi', 'Mab', 'Nkw', 'Nhla', 'Ntu', 'Ncw', 'Mpan', 'Mfu', 'Lwe', 'Mpal'], - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], - - 'year' => 'okweminyaka engu-:count', // less reliable - 'y' => 'okweminyaka engu-:count', // less reliable - 'a_year' => 'okweminyaka engu-:count', // less reliable - - 'month' => 'inyanga ezingu-:count', - 'm' => 'inyanga ezingu-:count', - 'a_month' => 'inyanga ezingu-:count', - - 'week' => 'amaviki angu-:count', - 'w' => 'amaviki angu-:count', - 'a_week' => 'amaviki angu-:count', - - 'day' => 'kwamalanga angu-:count', - 'd' => 'kwamalanga angu-:count', - 'a_day' => 'kwamalanga angu-:count', - - 'hour' => 'amahola angu-:count', - 'h' => 'amahola angu-:count', - 'a_hour' => 'amahola angu-:count', - - 'minute' => 'imizuzu engu-:count', - 'min' => 'imizuzu engu-:count', - 'a_minute' => 'imizuzu engu-:count', - - 'second' => 'imizuzwana engu-:count', - 's' => 'imizuzwana engu-:count', - 'a_second' => 'imizuzwana engu-:count', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nds.php b/vendor/nesbot/carbon/src/Carbon/Lang/nds.php deleted file mode 100644 index c0b3775e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nds.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/nds_DE.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nds_DE.php b/vendor/nesbot/carbon/src/Carbon/Lang/nds_DE.php deleted file mode 100644 index a6c57a91..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nds_DE.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - information from Kenneth Christiansen Kenneth Christiansen, Pablo Saratxaga kenneth@gnu.org, pablo@mandrakesoft.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD.MM.YYYY', - ], - 'months' => ['Jannuaar', 'Feberwaar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'], - 'months_short' => ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'], - 'weekdays' => ['Sünndag', 'Maandag', 'Dingsdag', 'Middeweek', 'Dunnersdag', 'Freedag', 'Sünnavend'], - 'weekdays_short' => ['Sdag', 'Maan', 'Ding', 'Midd', 'Dunn', 'Free', 'Svd.'], - 'weekdays_min' => ['Sd', 'Ma', 'Di', 'Mi', 'Du', 'Fr', 'Sa'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - - 'year' => ':count Johr', - 'y' => ':countJ', - 'a_year' => '{1}een Johr|:count Johr', - - 'month' => ':count Maand', - 'm' => ':countM', - 'a_month' => '{1}een Maand|:count Maand', - - 'week' => ':count Week|:count Weken', - 'w' => ':countW', - 'a_week' => '{1}een Week|:count Week|:count Weken', - - 'day' => ':count Dag|:count Daag', - 'd' => ':countD', - 'a_day' => '{1}een Dag|:count Dag|:count Daag', - - 'hour' => ':count Stünn|:count Stünnen', - 'h' => ':countSt', - 'a_hour' => '{1}een Stünn|:count Stünn|:count Stünnen', - - 'minute' => ':count Minuut|:count Minuten', - 'min' => ':countm', - 'a_minute' => '{1}een Minuut|:count Minuut|:count Minuten', - - 'second' => ':count Sekunn|:count Sekunnen', - 's' => ':counts', - 'a_second' => 'en poor Sekunnen|:count Sekunn|:count Sekunnen', - - 'ago' => 'vör :time', - 'from_now' => 'in :time', - 'before' => ':time vörher', - 'after' => ':time later', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nds_NL.php b/vendor/nesbot/carbon/src/Carbon/Lang/nds_NL.php deleted file mode 100644 index de2c57bc..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nds_NL.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - information from Kenneth Christiansen Kenneth Christiansen, Pablo Saratxaga kenneth@gnu.org, pablo@mandrakesoft.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD.MM.YYYY', - ], - 'months' => ['Jaunuwoa', 'Februwoa', 'Moaz', 'Aprell', 'Mai', 'Juni', 'Juli', 'August', 'Septamba', 'Oktoba', 'Nowamba', 'Dezamba'], - 'months_short' => ['Jan', 'Feb', 'Moz', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Now', 'Dez'], - 'weekdays' => ['Sinndag', 'Mondag', 'Dingsdag', 'Meddwäakj', 'Donnadag', 'Friedag', 'Sinnowend'], - 'weekdays_short' => ['Sdg', 'Mdg', 'Dsg', 'Mwk', 'Ddg', 'Fdg', 'Swd'], - 'weekdays_min' => ['Sdg', 'Mdg', 'Dsg', 'Mwk', 'Ddg', 'Fdg', 'Swd'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ne.php b/vendor/nesbot/carbon/src/Carbon/Lang/ne.php deleted file mode 100644 index d4caf0e2..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ne.php +++ /dev/null @@ -1,82 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - nootanghimire - * - Josh Soref - * - Nj Subedi - * - JD Isaacks - */ -return [ - 'year' => 'एक बर्ष|:count बर्ष', - 'y' => ':count वर्ष', - 'month' => 'एक महिना|:count महिना', - 'm' => ':count महिना', - 'week' => ':count हप्ता', - 'w' => ':count हप्ता', - 'day' => 'एक दिन|:count दिन', - 'd' => ':count दिन', - 'hour' => 'एक घण्टा|:count घण्टा', - 'h' => ':count घण्टा', - 'minute' => 'एक मिनेट|:count मिनेट', - 'min' => ':count मिनेट', - 'second' => 'केही क्षण|:count सेकेण्ड', - 's' => ':count सेकेण्ड', - 'ago' => ':time अगाडि', - 'from_now' => ':timeमा', - 'after' => ':time पछि', - 'before' => ':time अघि', - 'diff_now' => 'अहिले', - 'diff_today' => 'आज', - 'diff_yesterday' => 'हिजो', - 'diff_tomorrow' => 'भोलि', - 'formats' => [ - 'LT' => 'Aको h:mm बजे', - 'LTS' => 'Aको h:mm:ss बजे', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY, Aको h:mm बजे', - 'LLLL' => 'dddd, D MMMM YYYY, Aको h:mm बजे', - ], - 'calendar' => [ - 'sameDay' => '[आज] LT', - 'nextDay' => '[भोलि] LT', - 'nextWeek' => '[आउँदो] dddd[,] LT', - 'lastDay' => '[हिजो] LT', - 'lastWeek' => '[गएको] dddd[,] LT', - 'sameElse' => 'L', - ], - 'meridiem' => function ($hour) { - if ($hour < 3) { - return 'राति'; - } - if ($hour < 12) { - return 'बिहान'; - } - if ($hour < 16) { - return 'दिउँसो'; - } - if ($hour < 20) { - return 'साँझ'; - } - - return 'राति'; - }, - 'months' => ['जनवरी', 'फेब्रुवरी', 'मार्च', 'अप्रिल', 'मई', 'जुन', 'जुलाई', 'अगष्ट', 'सेप्टेम्बर', 'अक्टोबर', 'नोभेम्बर', 'डिसेम्बर'], - 'months_short' => ['जन.', 'फेब्रु.', 'मार्च', 'अप्रि.', 'मई', 'जुन', 'जुलाई.', 'अग.', 'सेप्ट.', 'अक्टो.', 'नोभे.', 'डिसे.'], - 'weekdays' => ['आइतबार', 'सोमबार', 'मङ्गलबार', 'बुधबार', 'बिहिबार', 'शुक्रबार', 'शनिबार'], - 'weekdays_short' => ['आइत.', 'सोम.', 'मङ्गल.', 'बुध.', 'बिहि.', 'शुक्र.', 'शनि.'], - 'weekdays_min' => ['आ.', 'सो.', 'मं.', 'बु.', 'बि.', 'शु.', 'श.'], - 'list' => [', ', ' र '], - 'first_day_of_week' => 0, - 'day_of_first_week_of_year' => 1, -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ne_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/ne_IN.php deleted file mode 100644 index f68d00e3..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ne_IN.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/ne.php', [ - 'formats' => [ - 'LT' => 'h:mm a', - 'LTS' => 'h:mm:ss a', - 'L' => 'yy/M/d', - 'LL' => 'YYYY MMM D', - 'LLL' => 'YYYY MMMM D, h:mm a', - 'LLLL' => 'YYYY MMMM D, dddd, h:mm a', - ], - 'months' => ['जनवरी', 'फेब्रुअरी', 'मार्च', 'अप्रिल', 'मे', 'जुन', 'जुलाई', 'अगस्ट', 'सेप्टेम्बर', 'अक्टोबर', 'नोभेम्बर', 'डिसेम्बर'], - 'months_short' => ['जनवरी', 'फेब्रुअरी', 'मार्च', 'अप्रिल', 'मे', 'जुन', 'जुलाई', 'अगस्ट', 'सेप्टेम्बर', 'अक्टोबर', 'नोभेम्बर', 'डिसेम्बर'], - 'weekend' => [0, 0], - 'meridiem' => ['पूर्वाह्न', 'अपराह्न'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ne_NP.php b/vendor/nesbot/carbon/src/Carbon/Lang/ne_NP.php deleted file mode 100644 index 27840c0f..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ne_NP.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/ne.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nhn.php b/vendor/nesbot/carbon/src/Carbon/Lang/nhn.php deleted file mode 100644 index 5a858315..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nhn.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/nhn_MX.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nhn_MX.php b/vendor/nesbot/carbon/src/Carbon/Lang/nhn_MX.php deleted file mode 100644 index 9db88a12..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nhn_MX.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - RAP libc-alpha@sourceware.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YY', - ], - 'months' => ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre'], - 'months_short' => ['ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'sep', 'oct', 'nov', 'dic'], - 'weekdays' => ['teoilhuitl', 'ceilhuitl', 'omeilhuitl', 'yeilhuitl', 'nahuilhuitl', 'macuililhuitl', 'chicuaceilhuitl'], - 'weekdays_short' => ['teo', 'cei', 'ome', 'yei', 'nau', 'mac', 'chi'], - 'weekdays_min' => ['teo', 'cei', 'ome', 'yei', 'nau', 'mac', 'chi'], - 'day_of_first_week_of_year' => 1, - - 'month' => ':count metztli', // less reliable - 'm' => ':count metztli', // less reliable - 'a_month' => ':count metztli', // less reliable - - 'week' => ':count tonalli', // less reliable - 'w' => ':count tonalli', // less reliable - 'a_week' => ':count tonalli', // less reliable - - 'day' => ':count tonatih', // less reliable - 'd' => ':count tonatih', // less reliable - 'a_day' => ':count tonatih', // less reliable - - 'minute' => ':count toltecayotl', // less reliable - 'min' => ':count toltecayotl', // less reliable - 'a_minute' => ':count toltecayotl', // less reliable - - 'second' => ':count ome', // less reliable - 's' => ':count ome', // less reliable - 'a_second' => ':count ome', // less reliable - - 'year' => ':count xihuitl', - 'y' => ':count xihuitl', - 'a_year' => ':count xihuitl', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/niu.php b/vendor/nesbot/carbon/src/Carbon/Lang/niu.php deleted file mode 100644 index bd9be8aa..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/niu.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/niu_NU.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/niu_NU.php b/vendor/nesbot/carbon/src/Carbon/Lang/niu_NU.php deleted file mode 100644 index 6e7a697b..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/niu_NU.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - RockET Systems Emani Fakaotimanava-Lui emani@niue.nu - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YY', - ], - 'months' => ['Ianuali', 'Fepuali', 'Masi', 'Apelila', 'Me', 'Iuni', 'Iulai', 'Aokuso', 'Sepetema', 'Oketopa', 'Novema', 'Tesemo'], - 'months_short' => ['Ian', 'Fep', 'Mas', 'Ape', 'Me', 'Iun', 'Iul', 'Aok', 'Sep', 'Oke', 'Nov', 'Tes'], - 'weekdays' => ['Aho Tapu', 'Aho Gofua', 'Aho Ua', 'Aho Lotu', 'Aho Tuloto', 'Aho Falaile', 'Aho Faiumu'], - 'weekdays_short' => ['Tapu', 'Gofua', 'Ua', 'Lotu', 'Tuloto', 'Falaile', 'Faiumu'], - 'weekdays_min' => ['Tapu', 'Gofua', 'Ua', 'Lotu', 'Tuloto', 'Falaile', 'Faiumu'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - - 'year' => ':count tau', - 'y' => ':count tau', - 'a_year' => ':count tau', - - 'month' => ':count mahina', - 'm' => ':count mahina', - 'a_month' => ':count mahina', - - 'week' => ':count faahi tapu', - 'w' => ':count faahi tapu', - 'a_week' => ':count faahi tapu', - - 'day' => ':count aho', - 'd' => ':count aho', - 'a_day' => ':count aho', - - 'hour' => ':count e tulā', - 'h' => ':count e tulā', - 'a_hour' => ':count e tulā', - - 'minute' => ':count minuti', - 'min' => ':count minuti', - 'a_minute' => ':count minuti', - - 'second' => ':count sekone', - 's' => ':count sekone', - 'a_second' => ':count sekone', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nl.php b/vendor/nesbot/carbon/src/Carbon/Lang/nl.php deleted file mode 100644 index 2d737703..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nl.php +++ /dev/null @@ -1,113 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Roy - * - Stephan - * - François B - * - Tim Fish - * - Kevin Huang - * - Jacob Middag - * - JD Isaacks - * - Roy - * - Stephan - * - François B - * - Tim Fish - * - Jacob Middag - * - JD Isaacks - * - Propaganistas - * - MegaXLR - * - adriaanzon - * - MonkeyPhysics - * - JeroenG - * - RikSomers - * - proclame - * - Rik de Groot (hwdegroot) - */ -return [ - 'year' => ':count jaar|:count jaar', - 'a_year' => 'een jaar|:count jaar', - 'y' => ':countj', - 'month' => ':count maand|:count maanden', - 'a_month' => 'een maand|:count maanden', - 'm' => ':countmnd', - 'week' => ':count week|:count weken', - 'a_week' => 'een week|:count weken', - 'w' => ':countw', - 'day' => ':count dag|:count dagen', - 'a_day' => 'een dag|:count dagen', - 'd' => ':countd', - 'hour' => ':count uur|:count uur', - 'a_hour' => 'een uur|:count uur', - 'h' => ':countu', - 'minute' => ':count minuut|:count minuten', - 'a_minute' => 'een minuut|:count minuten', - 'min' => ':countmin', - 'second' => ':count seconde|:count seconden', - 'a_second' => 'een paar seconden|:count seconden', - 's' => ':counts', - 'ago' => ':time geleden', - 'from_now' => 'over :time', - 'after' => ':time later', - 'before' => ':time eerder', - 'diff_now' => 'nu', - 'diff_today' => 'vandaag', - 'diff_today_regexp' => 'vandaag(?:\\s+om)?', - 'diff_yesterday' => 'gisteren', - 'diff_yesterday_regexp' => 'gisteren(?:\\s+om)?', - 'diff_tomorrow' => 'morgen', - 'diff_tomorrow_regexp' => 'morgen(?:\\s+om)?', - 'diff_after_tomorrow' => 'overmorgen', - 'diff_before_yesterday' => 'eergisteren', - 'period_recurrences' => ':count keer', - 'period_interval' => function (string $interval = '') { - /** @var string $output */ - $output = preg_replace('/^(een|één|1)\s+/u', '', $interval); - - if (preg_match('/^(een|één|1)( jaar|j| uur|u)/u', $interval)) { - return "elk $output"; - } - - return "elke $output"; - }, - 'period_start_date' => 'van :date', - 'period_end_date' => 'tot :date', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD-MM-YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[vandaag om] LT', - 'nextDay' => '[morgen om] LT', - 'nextWeek' => 'dddd [om] LT', - 'lastDay' => '[gisteren om] LT', - 'lastWeek' => '[afgelopen] dddd [om] LT', - 'sameElse' => 'L', - ], - 'ordinal' => function ($number) { - return $number.(($number === 1 || $number === 8 || $number >= 20) ? 'ste' : 'de'); - }, - 'months' => ['januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december'], - 'months_short' => ['jan', 'feb', 'mrt', 'apr', 'mei', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'], - 'mmm_suffix' => '.', - 'weekdays' => ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'], - 'weekdays_short' => ['zo.', 'ma.', 'di.', 'wo.', 'do.', 'vr.', 'za.'], - 'weekdays_min' => ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' en '], - 'meridiem' => ['\'s ochtends', '\'s middags'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nl_AW.php b/vendor/nesbot/carbon/src/Carbon/Lang/nl_AW.php deleted file mode 100644 index 5ec136d1..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nl_AW.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Free Software Foundation, Inc. bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/nl.php', [ - 'formats' => [ - 'L' => 'DD-MM-YY', - ], - 'months' => ['januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december'], - 'months_short' => ['jan', 'feb', 'mrt', 'apr', 'mei', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'], - 'weekdays' => ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'], - 'weekdays_short' => ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'], - 'weekdays_min' => ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nl_BE.php b/vendor/nesbot/carbon/src/Carbon/Lang/nl_BE.php deleted file mode 100644 index 037f5b4a..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nl_BE.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Roy - * - Stephan - * - François B - * - Tim Fish - * - Kevin Huang - * - Jacob Middag - * - JD Isaacks - * - Propaganistas - */ -return array_replace_recursive(require __DIR__.'/nl.php', [ - 'formats' => [ - 'L' => 'DD/MM/YYYY', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nl_BQ.php b/vendor/nesbot/carbon/src/Carbon/Lang/nl_BQ.php deleted file mode 100644 index c269197b..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nl_BQ.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/nl.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nl_CW.php b/vendor/nesbot/carbon/src/Carbon/Lang/nl_CW.php deleted file mode 100644 index c269197b..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nl_CW.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/nl.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nl_NL.php b/vendor/nesbot/carbon/src/Carbon/Lang/nl_NL.php deleted file mode 100644 index 14e4853e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nl_NL.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - RAP bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/nl.php', [ - 'months' => ['januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december'], - 'months_short' => ['jan', 'feb', 'mrt', 'apr', 'mei', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'], - 'weekdays' => ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'], - 'weekdays_short' => ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'], - 'weekdays_min' => ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nl_SR.php b/vendor/nesbot/carbon/src/Carbon/Lang/nl_SR.php deleted file mode 100644 index c269197b..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nl_SR.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/nl.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nl_SX.php b/vendor/nesbot/carbon/src/Carbon/Lang/nl_SX.php deleted file mode 100644 index c269197b..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nl_SX.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/nl.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nmg.php b/vendor/nesbot/carbon/src/Carbon/Lang/nmg.php deleted file mode 100644 index 4d1df6e5..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nmg.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['maná', 'kugú'], - 'weekdays' => ['sɔ́ndɔ', 'mɔ́ndɔ', 'sɔ́ndɔ mafú mába', 'sɔ́ndɔ mafú málal', 'sɔ́ndɔ mafú mána', 'mabágá má sukul', 'sásadi'], - 'weekdays_short' => ['sɔ́n', 'mɔ́n', 'smb', 'sml', 'smn', 'mbs', 'sas'], - 'weekdays_min' => ['sɔ́n', 'mɔ́n', 'smb', 'sml', 'smn', 'mbs', 'sas'], - 'months' => ['ngwɛn matáhra', 'ngwɛn ńmba', 'ngwɛn ńlal', 'ngwɛn ńna', 'ngwɛn ńtan', 'ngwɛn ńtuó', 'ngwɛn hɛmbuɛrí', 'ngwɛn lɔmbi', 'ngwɛn rɛbvuâ', 'ngwɛn wum', 'ngwɛn wum navǔr', 'krísimin'], - 'months_short' => ['ng1', 'ng2', 'ng3', 'ng4', 'ng5', 'ng6', 'ng7', 'ng8', 'ng9', 'ng10', 'ng11', 'kris'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'D/M/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nn.php b/vendor/nesbot/carbon/src/Carbon/Lang/nn.php deleted file mode 100644 index 041f7b29..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nn.php +++ /dev/null @@ -1,78 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - François B - * - Alexander Tømmerås - * - Øystein - * - JD Isaacks - * - Gaute Hvoslef Kvalnes (gaute) - */ -return [ - 'year' => ':count år', - 'a_year' => 'eit år|:count år', - 'y' => ':count år', - 'month' => ':count månad|:count månader', - 'a_month' => 'ein månad|:count månader', - 'm' => ':count md', - 'week' => ':count veke|:count veker', - 'a_week' => 'ei veke|:count veker', - 'w' => ':countv', - 'day' => ':count dag|:count dagar', - 'a_day' => 'ein dag|:count dagar', - 'd' => ':countd', - 'hour' => ':count time|:count timar', - 'a_hour' => 'ein time|:count timar', - 'h' => ':countt', - 'minute' => ':count minutt', - 'a_minute' => 'eit minutt|:count minutt', - 'min' => ':countm', - 'second' => ':count sekund', - 'a_second' => 'nokre sekund|:count sekund', - 's' => ':counts', - 'ago' => ':time sidan', - 'from_now' => 'om :time', - 'after' => ':time etter', - 'before' => ':time før', - 'diff_today' => 'I dag', - 'diff_yesterday' => 'I går', - 'diff_yesterday_regexp' => 'I går(?:\\s+klokka)?', - 'diff_tomorrow' => 'I morgon', - 'diff_tomorrow_regexp' => 'I morgon(?:\\s+klokka)?', - 'diff_today_regexp' => 'I dag(?:\\s+klokka)?', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD.MM.YYYY', - 'LL' => 'D. MMMM YYYY', - 'LLL' => 'D. MMMM YYYY [kl.] H:mm', - 'LLLL' => 'dddd D. MMMM YYYY [kl.] HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[I dag klokka] LT', - 'nextDay' => '[I morgon klokka] LT', - 'nextWeek' => 'dddd [klokka] LT', - 'lastDay' => '[I går klokka] LT', - 'lastWeek' => '[Føregåande] dddd [klokka] LT', - 'sameElse' => 'L', - ], - 'ordinal' => ':number.', - 'months' => ['januar', 'februar', 'mars', 'april', 'mai', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'desember'], - 'months_short' => ['jan', 'feb', 'mar', 'apr', 'mai', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'des'], - 'weekdays' => ['sundag', 'måndag', 'tysdag', 'onsdag', 'torsdag', 'fredag', 'laurdag'], - 'weekdays_short' => ['sun', 'mån', 'tys', 'ons', 'tor', 'fre', 'lau'], - 'weekdays_min' => ['su', 'må', 'ty', 'on', 'to', 'fr', 'la'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' og '], - 'meridiem' => ['f.m.', 'e.m.'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nn_NO.php b/vendor/nesbot/carbon/src/Carbon/Lang/nn_NO.php deleted file mode 100644 index 8e168711..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nn_NO.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/nn.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nnh.php b/vendor/nesbot/carbon/src/Carbon/Lang/nnh.php deleted file mode 100644 index 007d2399..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nnh.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['mbaʼámbaʼ', 'ncwònzém'], - 'weekdays' => null, - 'weekdays_short' => ['lyɛʼɛ́ sẅíŋtè', 'mvfò lyɛ̌ʼ', 'mbɔ́ɔntè mvfò lyɛ̌ʼ', 'tsètsɛ̀ɛ lyɛ̌ʼ', 'mbɔ́ɔntè tsetsɛ̀ɛ lyɛ̌ʼ', 'mvfò màga lyɛ̌ʼ', 'màga lyɛ̌ʼ'], - 'weekdays_min' => null, - 'months' => null, - 'months_short' => ['saŋ tsetsɛ̀ɛ lùm', 'saŋ kàg ngwóŋ', 'saŋ lepyè shúm', 'saŋ cÿó', 'saŋ tsɛ̀ɛ cÿó', 'saŋ njÿoláʼ', 'saŋ tyɛ̀b tyɛ̀b mbʉ̀ŋ', 'saŋ mbʉ̀ŋ', 'saŋ ngwɔ̀ʼ mbÿɛ', 'saŋ tàŋa tsetsáʼ', 'saŋ mejwoŋó', 'saŋ lùm'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/yy', - 'LL' => 'D MMM, YYYY', - 'LLL' => '[lyɛ]̌ʼ d [na] MMMM, YYYY HH:mm', - 'LLLL' => 'dddd , [lyɛ]̌ʼ d [na] MMMM, YYYY HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/no.php b/vendor/nesbot/carbon/src/Carbon/Lang/no.php deleted file mode 100644 index f4497c75..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/no.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Daniel S. Billing - * - Paul - * - Jimmie Johansson - * - Jens Herlevsen - */ -return array_replace_recursive(require __DIR__.'/nb.php', [ - 'formats' => [ - 'LLL' => 'D. MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D. MMMM YYYY [kl.] HH:mm', - ], - 'calendar' => [ - 'nextWeek' => 'på dddd [kl.] LT', - 'lastWeek' => '[i] dddd[s kl.] LT', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nr.php b/vendor/nesbot/carbon/src/Carbon/Lang/nr.php deleted file mode 100644 index 1bc999f9..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nr.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/nr_ZA.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nr_ZA.php b/vendor/nesbot/carbon/src/Carbon/Lang/nr_ZA.php deleted file mode 100644 index f9a7be82..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nr_ZA.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Zuza Software Foundation (Translate.org.za) Dwayne Bailey dwayne@translate.org.za - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YYYY', - ], - 'months' => ['Janabari', 'uFeberbari', 'uMatjhi', 'u-Apreli', 'Meyi', 'Juni', 'Julayi', 'Arhostosi', 'Septemba', 'Oktoba', 'Usinyikhaba', 'Disemba'], - 'months_short' => ['Jan', 'Feb', 'Mat', 'Apr', 'Mey', 'Jun', 'Jul', 'Arh', 'Sep', 'Okt', 'Usi', 'Dis'], - 'weekdays' => ['uSonto', 'uMvulo', 'uLesibili', 'lesithathu', 'uLesine', 'ngoLesihlanu', 'umGqibelo'], - 'weekdays_short' => ['Son', 'Mvu', 'Bil', 'Tha', 'Ne', 'Hla', 'Gqi'], - 'weekdays_min' => ['Son', 'Mvu', 'Bil', 'Tha', 'Ne', 'Hla', 'Gqi'], - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nso.php b/vendor/nesbot/carbon/src/Carbon/Lang/nso.php deleted file mode 100644 index 2a6cabbf..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nso.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/nso_ZA.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nso_ZA.php b/vendor/nesbot/carbon/src/Carbon/Lang/nso_ZA.php deleted file mode 100644 index b08fe6dc..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nso_ZA.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Zuza Software Foundation (Translate.org.za) Dwayne Bailey dwayne@translate.org.za - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YYYY', - ], - 'months' => ['Janaware', 'Febereware', 'Matšhe', 'Aprele', 'Mei', 'June', 'Julae', 'Agostose', 'Setemere', 'Oktobere', 'Nofemere', 'Disemere'], - 'months_short' => ['Jan', 'Feb', 'Mat', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Set', 'Okt', 'Nof', 'Dis'], - 'weekdays' => ['LaMorena', 'Mošupologo', 'Labobedi', 'Laboraro', 'Labone', 'Labohlano', 'Mokibelo'], - 'weekdays_short' => ['Son', 'Moš', 'Bed', 'Rar', 'Ne', 'Hla', 'Mok'], - 'weekdays_min' => ['Son', 'Moš', 'Bed', 'Rar', 'Ne', 'Hla', 'Mok'], - 'day_of_first_week_of_year' => 1, - - 'year' => ':count ngwaga', - 'y' => ':count ngwaga', - 'a_year' => ':count ngwaga', - - 'month' => ':count Kgwedi', - 'm' => ':count Kgwedi', - 'a_month' => ':count Kgwedi', - - 'week' => ':count Beke', - 'w' => ':count Beke', - 'a_week' => ':count Beke', - - 'day' => ':count Letšatši', - 'd' => ':count Letšatši', - 'a_day' => ':count Letšatši', - - 'hour' => ':count Iri', - 'h' => ':count Iri', - 'a_hour' => ':count Iri', - - 'minute' => ':count Motsotso', - 'min' => ':count Motsotso', - 'a_minute' => ':count Motsotso', - - 'second' => ':count motsotswana', - 's' => ':count motsotswana', - 'a_second' => ':count motsotswana', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nus.php b/vendor/nesbot/carbon/src/Carbon/Lang/nus.php deleted file mode 100644 index 789bc391..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nus.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['RW', 'TŊ'], - 'weekdays' => ['Cäŋ kuɔth', 'Jiec la̱t', 'Rɛw lätni', 'Diɔ̱k lätni', 'Ŋuaan lätni', 'Dhieec lätni', 'Bäkɛl lätni'], - 'weekdays_short' => ['Cäŋ', 'Jiec', 'Rɛw', 'Diɔ̱k', 'Ŋuaan', 'Dhieec', 'Bäkɛl'], - 'weekdays_min' => ['Cäŋ', 'Jiec', 'Rɛw', 'Diɔ̱k', 'Ŋuaan', 'Dhieec', 'Bäkɛl'], - 'months' => ['Tiop thar pɛt', 'Pɛt', 'Duɔ̱ɔ̱ŋ', 'Guak', 'Duät', 'Kornyoot', 'Pay yie̱tni', 'Tho̱o̱r', 'Tɛɛr', 'Laath', 'Kur', 'Tio̱p in di̱i̱t'], - 'months_short' => ['Tiop', 'Pɛt', 'Duɔ̱ɔ̱', 'Guak', 'Duä', 'Kor', 'Pay', 'Thoo', 'Tɛɛ', 'Laa', 'Kur', 'Tid'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'h:mm a', - 'LTS' => 'h:mm:ss a', - 'L' => 'D/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY h:mm a', - 'LLLL' => 'dddd D MMMM YYYY h:mm a', - ], - - 'year' => ':count jiök', // less reliable - 'y' => ':count jiök', // less reliable - 'a_year' => ':count jiök', // less reliable - - 'month' => ':count pay', // less reliable - 'm' => ':count pay', // less reliable - 'a_month' => ':count pay', // less reliable -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nyn.php b/vendor/nesbot/carbon/src/Carbon/Lang/nyn.php deleted file mode 100644 index 8660ea42..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nyn.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'weekdays' => ['Sande', 'Orwokubanza', 'Orwakabiri', 'Orwakashatu', 'Orwakana', 'Orwakataano', 'Orwamukaaga'], - 'weekdays_short' => ['SAN', 'ORK', 'OKB', 'OKS', 'OKN', 'OKT', 'OMK'], - 'weekdays_min' => ['SAN', 'ORK', 'OKB', 'OKS', 'OKN', 'OKT', 'OMK'], - 'months' => ['Okwokubanza', 'Okwakabiri', 'Okwakashatu', 'Okwakana', 'Okwakataana', 'Okwamukaaga', 'Okwamushanju', 'Okwamunaana', 'Okwamwenda', 'Okwaikumi', 'Okwaikumi na kumwe', 'Okwaikumi na ibiri'], - 'months_short' => ['KBZ', 'KBR', 'KST', 'KKN', 'KTN', 'KMK', 'KMS', 'KMN', 'KMW', 'KKM', 'KNK', 'KNB'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/oc.php b/vendor/nesbot/carbon/src/Carbon/Lang/oc.php deleted file mode 100644 index 89693e67..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/oc.php +++ /dev/null @@ -1,100 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Quentí - */ -// @codeCoverageIgnoreStart -use Symfony\Component\Translation\PluralizationRules; - -if (class_exists('Symfony\\Component\\Translation\\PluralizationRules')) { - PluralizationRules::set(function ($number) { - return $number == 1 ? 0 : 1; - }, 'oc'); -} -// @codeCoverageIgnoreEnd - -return [ - 'year' => ':count an|:count ans', - 'a_year' => 'un an|:count ans', - 'y' => ':count an|:count ans', - 'month' => ':count mes|:count meses', - 'a_month' => 'un mes|:count meses', - 'm' => ':count mes|:count meses', - 'week' => ':count setmana|:count setmanas', - 'a_week' => 'una setmana|:count setmanas', - 'w' => ':count setmana|:count setmanas', - 'day' => ':count jorn|:count jorns', - 'a_day' => 'un jorn|:count jorns', - 'd' => ':count jorn|:count jorns', - 'hour' => ':count ora|:count oras', - 'a_hour' => 'una ora|:count oras', - 'h' => ':count ora|:count oras', - 'minute' => ':count minuta|:count minutas', - 'a_minute' => 'una minuta|:count minutas', - 'min' => ':count minuta|:count minutas', - 'second' => ':count segonda|:count segondas', - 'a_second' => 'una segonda|:count segondas', - 's' => ':count segonda|:count segondas', - 'ago' => 'fa :time', - 'from_now' => 'd\'aquí :time', - 'after' => ':time aprèp', - 'before' => ':time abans', - 'diff_now' => 'ara meteis', - 'diff_today' => 'Uèi', - 'diff_today_regexp' => 'Uèi(?:\\s+a)?', - 'diff_yesterday' => 'ièr', - 'diff_yesterday_regexp' => 'Ièr(?:\\s+a)?', - 'diff_tomorrow' => 'deman', - 'diff_tomorrow_regexp' => 'Deman(?:\\s+a)?', - 'diff_before_yesterday' => 'ièr delà', - 'diff_after_tomorrow' => 'deman passat', - 'period_recurrences' => ':count còp|:count còps', - 'period_interval' => 'cada :interval', - 'period_start_date' => 'de :date', - 'period_end_date' => 'fins a :date', - 'formats' => [ - 'LT' => 'H:mm', - 'LTS' => 'H:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM [de] YYYY', - 'LLL' => 'D MMMM [de] YYYY [a] H:mm', - 'LLLL' => 'dddd D MMMM [de] YYYY [a] H:mm', - ], - 'calendar' => [ - 'sameDay' => '[Uèi a] LT', - 'nextDay' => '[Deman a] LT', - 'nextWeek' => 'dddd [a] LT', - 'lastDay' => '[Ièr a] LT', - 'lastWeek' => 'dddd [passat a] LT', - 'sameElse' => 'L', - ], - 'months' => ['de genièr', 'de febrièr', 'de març', 'd\'abrial', 'de mai', 'de junh', 'de julhet', 'd\'agost', 'de setembre', 'd’octòbre', 'de novembre', 'de decembre'], - 'months_standalone' => ['genièr', 'febrièr', 'març', 'abrial', 'mai', 'junh', 'julh', 'agost', 'setembre', 'octòbre', 'novembre', 'decembre'], - 'months_short' => ['gen.', 'feb.', 'març', 'abr.', 'mai', 'junh', 'julh', 'ago.', 'sep.', 'oct.', 'nov.', 'dec.'], - 'weekdays' => ['dimenge', 'diluns', 'dimars', 'dimècres', 'dijòus', 'divendres', 'dissabte'], - 'weekdays_short' => ['dg', 'dl', 'dm', 'dc', 'dj', 'dv', 'ds'], - 'weekdays_min' => ['dg', 'dl', 'dm', 'dc', 'dj', 'dv', 'ds'], - 'ordinal' => function ($number, string $period = '') { - $ordinal = [1 => 'èr', 2 => 'nd'][(int) $number] ?? 'en'; - - // feminine for year, week, hour, minute, second - if (preg_match('/^[yYwWhHgGis]$/', $period)) { - $ordinal .= 'a'; - } - - return $number.$ordinal; - }, - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' e '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/oc_FR.php b/vendor/nesbot/carbon/src/Carbon/Lang/oc_FR.php deleted file mode 100644 index 01eb5c14..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/oc_FR.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/oc.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/om.php b/vendor/nesbot/carbon/src/Carbon/Lang/om.php deleted file mode 100644 index b8d5a0b0..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/om.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Ge'ez Frontier Foundation & Sagalee Oromoo Publishing Co. Inc. locales@geez.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'dd-MMM-YYYY', - 'LLL' => 'dd MMMM YYYY HH:mm', - 'LLLL' => 'dddd, MMMM D, YYYY HH:mm', - ], - 'months' => ['Amajjii', 'Guraandhala', 'Bitooteessa', 'Elba', 'Caamsa', 'Waxabajjii', 'Adooleessa', 'Hagayya', 'Fuulbana', 'Onkololeessa', 'Sadaasa', 'Muddee'], - 'months_short' => ['Ama', 'Gur', 'Bit', 'Elb', 'Cam', 'Wax', 'Ado', 'Hag', 'Ful', 'Onk', 'Sad', 'Mud'], - 'weekdays' => ['Dilbata', 'Wiixata', 'Qibxata', 'Roobii', 'Kamiisa', 'Jimaata', 'Sanbata'], - 'weekdays_short' => ['Dil', 'Wix', 'Qib', 'Rob', 'Kam', 'Jim', 'San'], - 'weekdays_min' => ['Dil', 'Wix', 'Qib', 'Rob', 'Kam', 'Jim', 'San'], - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['WD', 'WB'], - - 'year' => 'wggoota :count', - 'y' => 'wggoota :count', - 'a_year' => 'wggoota :count', - - 'month' => 'ji’a :count', - 'm' => 'ji’a :count', - 'a_month' => 'ji’a :count', - - 'week' => 'torban :count', - 'w' => 'torban :count', - 'a_week' => 'torban :count', - - 'day' => 'guyyaa :count', - 'd' => 'guyyaa :count', - 'a_day' => 'guyyaa :count', - - 'hour' => 'saʼaatii :count', - 'h' => 'saʼaatii :count', - 'a_hour' => 'saʼaatii :count', - - 'minute' => 'daqiiqaa :count', - 'min' => 'daqiiqaa :count', - 'a_minute' => 'daqiiqaa :count', - - 'second' => 'sekoondii :count', - 's' => 'sekoondii :count', - 'a_second' => 'sekoondii :count', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/om_ET.php b/vendor/nesbot/carbon/src/Carbon/Lang/om_ET.php deleted file mode 100644 index 044760e3..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/om_ET.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/om.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/om_KE.php b/vendor/nesbot/carbon/src/Carbon/Lang/om_KE.php deleted file mode 100644 index f5a4d1c9..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/om_KE.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/om.php', [ - 'day_of_first_week_of_year' => 0, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/or.php b/vendor/nesbot/carbon/src/Carbon/Lang/or.php deleted file mode 100644 index 3aa71732..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/or.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/or_IN.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/or_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/or_IN.php deleted file mode 100644 index 57a89f5d..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/or_IN.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - IBM AP Linux Technology Center, Yamato Software Laboratory bug-glibc@gnu.org - */ -return [ - 'diff_now' => 'ବର୍ତ୍ତମାନ', - 'diff_yesterday' => 'ଗତକାଲି', - 'diff_tomorrow' => 'ଆସନ୍ତାକାଲି', - 'formats' => [ - 'LT' => 'Oh:Om A', - 'LTS' => 'Oh:Om:Os A', - 'L' => 'OD-OM-OY', - 'LL' => 'OD MMMM OY', - 'LLL' => 'OD MMMM OY Oh:Om A', - 'LLLL' => 'dddd OD MMMM OY Oh:Om A', - ], - 'months' => ['ଜାନୁଆରୀ', 'ଫେବୃଆରୀ', 'ମାର୍ଚ୍ଚ', 'ଅପ୍ରେଲ', 'ମଇ', 'ଜୁନ', 'ଜୁଲାଇ', 'ଅଗଷ୍ଟ', 'ସେପ୍ଟେମ୍ବର', 'ଅକ୍ଟୋବର', 'ନଭେମ୍ବର', 'ଡିସେମ୍ବର'], - 'months_short' => ['ଜାନୁଆରୀ', 'ଫେବୃଆରୀ', 'ମାର୍ଚ୍ଚ', 'ଅପ୍ରେଲ', 'ମଇ', 'ଜୁନ', 'ଜୁଲାଇ', 'ଅଗଷ୍ଟ', 'ସେପ୍ଟେମ୍ବର', 'ଅକ୍ଟୋବର', 'ନଭେମ୍ବର', 'ଡିସେମ୍ବର'], - 'weekdays' => ['ରବିବାର', 'ସୋମବାର', 'ମଙ୍ଗଳବାର', 'ବୁଧବାର', 'ଗୁରୁବାର', 'ଶୁକ୍ରବାର', 'ଶନିବାର'], - 'weekdays_short' => ['ରବି', 'ସୋମ', 'ମଙ୍ଗଳ', 'ବୁଧ', 'ଗୁରୁ', 'ଶୁକ୍ର', 'ଶନି'], - 'weekdays_min' => ['ରବି', 'ସୋମ', 'ମଙ୍ଗଳ', 'ବୁଧ', 'ଗୁରୁ', 'ଶୁକ୍ର', 'ଶନି'], - 'day_of_first_week_of_year' => 1, - 'alt_numbers' => ['୦', '୧', '୨', '୩', '୪', '୫', '୬', '୭', '୮', '୯', '୧୦', '୧୧', '୧୨', '୧୩', '୧୪', '୧୫', '୧୬', '୧୭', '୧୮', '୧୯', '୨୦', '୨୧', '୨୨', '୨୩', '୨୪', '୨୫', '୨୬', '୨୭', '୨୮', '୨୯', '୩୦', '୩୧', '୩୨', '୩୩', '୩୪', '୩୫', '୩୬', '୩୭', '୩୮', '୩୯', '୪୦', '୪୧', '୪୨', '୪୩', '୪୪', '୪୫', '୪୬', '୪୭', '୪୮', '୪୯', '୫୦', '୫୧', '୫୨', '୫୩', '୫୪', '୫୫', '୫୬', '୫୭', '୫୮', '୫୯', '୬୦', '୬୧', '୬୨', '୬୩', '୬୪', '୬୫', '୬୬', '୬୭', '୬୮', '୬୯', '୭୦', '୭୧', '୭୨', '୭୩', '୭୪', '୭୫', '୭୬', '୭୭', '୭୮', '୭୯', '୮୦', '୮୧', '୮୨', '୮୩', '୮୪', '୮୫', '୮୬', '୮୭', '୮୮', '୮୯', '୯୦', '୯୧', '୯୨', '୯୩', '୯୪', '୯୫', '୯୬', '୯୭', '୯୮', '୯୯'], - 'year' => ':count ବର୍ଷ', - 'y' => ':count ବ.', - 'month' => ':count ମାସ', - 'm' => ':count ମା.', - 'week' => ':count ସପ୍ତାହ', - 'w' => ':count ସପ୍ତା.', - 'day' => ':count ଦିନ', - 'd' => ':count ଦିନ', - 'hour' => ':count ଘଣ୍ତ', - 'h' => ':count ଘ.', - 'minute' => ':count ମିନଟ', - 'min' => ':count ମି.', - 'second' => ':count ସେକଣ୍ଢ', - 's' => ':count ସେ.', - 'ago' => ':time ପୂର୍ବେ', - 'from_now' => ':timeରେ', -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/os.php b/vendor/nesbot/carbon/src/Carbon/Lang/os.php deleted file mode 100644 index 5f55e8a2..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/os.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/os_RU.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/os_RU.php b/vendor/nesbot/carbon/src/Carbon/Lang/os_RU.php deleted file mode 100644 index 9592d15d..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/os_RU.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD.MM.YYYY', - ], - 'months' => ['январы', 'февралы', 'мартъийы', 'апрелы', 'майы', 'июны', 'июлы', 'августы', 'сентябры', 'октябры', 'ноябры', 'декабры'], - 'months_short' => ['Янв', 'Фев', 'Мар', 'Апр', 'Май', 'Июн', 'Июл', 'Авг', 'Сен', 'Окт', 'Ноя', 'Дек'], - 'weekdays' => ['Хуыцаубон', 'Къуырисæр', 'Дыццæг', 'Æртыццæг', 'Цыппæрæм', 'Майрæмбон', 'Сабат'], - 'weekdays_short' => ['Хцб', 'Крс', 'Дцг', 'Æрт', 'Цпр', 'Мрб', 'Сбт'], - 'weekdays_min' => ['Хцб', 'Крс', 'Дцг', 'Æрт', 'Цпр', 'Мрб', 'Сбт'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - - 'minute' => ':count гыццыл', // less reliable - 'min' => ':count гыццыл', // less reliable - 'a_minute' => ':count гыццыл', // less reliable - - 'second' => ':count æндæр', // less reliable - 's' => ':count æндæр', // less reliable - 'a_second' => ':count æндæр', // less reliable - - 'year' => ':count аз', - 'y' => ':count аз', - 'a_year' => ':count аз', - - 'month' => ':count мӕй', - 'm' => ':count мӕй', - 'a_month' => ':count мӕй', - - 'week' => ':count къуыри', - 'w' => ':count къуыри', - 'a_week' => ':count къуыри', - - 'day' => ':count бон', - 'd' => ':count бон', - 'a_day' => ':count бон', - - 'hour' => ':count сахат', - 'h' => ':count сахат', - 'a_hour' => ':count сахат', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pa.php b/vendor/nesbot/carbon/src/Carbon/Lang/pa.php deleted file mode 100644 index 48b20331..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pa.php +++ /dev/null @@ -1,76 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Philippe Vaucher - * - Tsutomu Kuroda - * - Punjab - */ -return [ - 'year' => 'ਇੱਕ ਸਾਲ|:count ਸਾਲ', - 'month' => 'ਇੱਕ ਮਹੀਨਾ|:count ਮਹੀਨੇ', - 'week' => 'ਹਫਤਾ|:count ਹਫ਼ਤੇ', - 'day' => 'ਇੱਕ ਦਿਨ|:count ਦਿਨ', - 'hour' => 'ਇੱਕ ਘੰਟਾ|:count ਘੰਟੇ', - 'minute' => 'ਇਕ ਮਿੰਟ|:count ਮਿੰਟ', - 'second' => 'ਕੁਝ ਸਕਿੰਟ|:count ਸਕਿੰਟ', - 'ago' => ':time ਪਹਿਲਾਂ', - 'from_now' => ':time ਵਿੱਚ', - 'before' => ':time ਤੋਂ ਪਹਿਲਾਂ', - 'after' => ':time ਤੋਂ ਬਾਅਦ', - 'diff_now' => 'ਹੁਣ', - 'diff_today' => 'ਅਜ', - 'diff_yesterday' => 'ਕਲ', - 'diff_tomorrow' => 'ਕਲ', - 'formats' => [ - 'LT' => 'A h:mm ਵਜੇ', - 'LTS' => 'A h:mm:ss ਵਜੇ', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY, A h:mm ਵਜੇ', - 'LLLL' => 'dddd, D MMMM YYYY, A h:mm ਵਜੇ', - ], - 'calendar' => [ - 'sameDay' => '[ਅਜ] LT', - 'nextDay' => '[ਕਲ] LT', - 'nextWeek' => '[ਅਗਲਾ] dddd, LT', - 'lastDay' => '[ਕਲ] LT', - 'lastWeek' => '[ਪਿਛਲੇ] dddd, LT', - 'sameElse' => 'L', - ], - 'meridiem' => function ($hour) { - if ($hour < 4) { - return 'ਰਾਤ'; - } - if ($hour < 10) { - return 'ਸਵੇਰ'; - } - if ($hour < 17) { - return 'ਦੁਪਹਿਰ'; - } - if ($hour < 20) { - return 'ਸ਼ਾਮ'; - } - - return 'ਰਾਤ'; - }, - 'months' => ['ਜਨਵਰੀ', 'ਫ਼ਰਵਰੀ', 'ਮਾਰਚ', 'ਅਪ੍ਰੈਲ', 'ਮਈ', 'ਜੂਨ', 'ਜੁਲਾਈ', 'ਅਗਸਤ', 'ਸਤੰਬਰ', 'ਅਕਤੂਬਰ', 'ਨਵੰਬਰ', 'ਦਸੰਬਰ'], - 'months_short' => ['ਜਨਵਰੀ', 'ਫ਼ਰਵਰੀ', 'ਮਾਰਚ', 'ਅਪ੍ਰੈਲ', 'ਮਈ', 'ਜੂਨ', 'ਜੁਲਾਈ', 'ਅਗਸਤ', 'ਸਤੰਬਰ', 'ਅਕਤੂਬਰ', 'ਨਵੰਬਰ', 'ਦਸੰਬਰ'], - 'weekdays' => ['ਐਤਵਾਰ', 'ਸੋਮਵਾਰ', 'ਮੰਗਲਵਾਰ', 'ਬੁਧਵਾਰ', 'ਵੀਰਵਾਰ', 'ਸ਼ੁੱਕਰਵਾਰ', 'ਸ਼ਨੀਚਰਵਾਰ'], - 'weekdays_short' => ['ਐਤ', 'ਸੋਮ', 'ਮੰਗਲ', 'ਬੁਧ', 'ਵੀਰ', 'ਸ਼ੁਕਰ', 'ਸ਼ਨੀ'], - 'weekdays_min' => ['ਐਤ', 'ਸੋਮ', 'ਮੰਗਲ', 'ਬੁਧ', 'ਵੀਰ', 'ਸ਼ੁਕਰ', 'ਸ਼ਨੀ'], - 'first_day_of_week' => 0, - 'day_of_first_week_of_year' => 1, - 'list' => [', ', ' ਅਤੇ '], - 'weekend' => [0, 0], - 'alt_numbers' => ['੦', '੧', '੨', '੩', '੪', '੫', '੬', '੭', '੮', '੯'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pa_Arab.php b/vendor/nesbot/carbon/src/Carbon/Lang/pa_Arab.php deleted file mode 100644 index 39b06532..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pa_Arab.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/ur.php', [ - 'weekdays' => ['اتوار', 'پیر', 'منگل', 'بُدھ', 'جمعرات', 'جمعہ', 'ہفتہ'], - 'weekdays_short' => ['اتوار', 'پیر', 'منگل', 'بُدھ', 'جمعرات', 'جمعہ', 'ہفتہ'], - 'weekdays_min' => ['اتوار', 'پیر', 'منگل', 'بُدھ', 'جمعرات', 'جمعہ', 'ہفتہ'], - 'months' => ['جنوری', 'فروری', 'مارچ', 'اپریل', 'مئ', 'جون', 'جولائی', 'اگست', 'ستمبر', 'اکتوبر', 'نومبر', 'دسمبر'], - 'months_short' => ['جنوری', 'فروری', 'مارچ', 'اپریل', 'مئ', 'جون', 'جولائی', 'اگست', 'ستمبر', 'اکتوبر', 'نومبر', 'دسمبر'], - 'formats' => [ - 'LT' => 'h:mm a', - 'LTS' => 'h:mm:ss a', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY h:mm a', - 'LLLL' => 'dddd, DD MMMM YYYY h:mm a', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pa_Guru.php b/vendor/nesbot/carbon/src/Carbon/Lang/pa_Guru.php deleted file mode 100644 index 7adff5c3..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pa_Guru.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/pa.php', [ - 'formats' => [ - 'LT' => 'h:mm a', - 'LTS' => 'h:mm:ss a', - 'L' => 'D/M/yy', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY, h:mm a', - 'LLLL' => 'dddd, D MMMM YYYY, h:mm a', - ], - 'months' => ['ਜਨਵਰੀ', 'ਫ਼ਰਵਰੀ', 'ਮਾਰਚ', 'ਅਪ੍ਰੈਲ', 'ਮਈ', 'ਜੂਨ', 'ਜੁਲਾਈ', 'ਅਗਸਤ', 'ਸਤੰਬਰ', 'ਅਕਤੂਬਰ', 'ਨਵੰਬਰ', 'ਦਸੰਬਰ'], - 'months_short' => ['ਜਨ', 'ਫ਼ਰ', 'ਮਾਰਚ', 'ਅਪ੍ਰੈ', 'ਮਈ', 'ਜੂਨ', 'ਜੁਲਾ', 'ਅਗ', 'ਸਤੰ', 'ਅਕਤੂ', 'ਨਵੰ', 'ਦਸੰ'], - 'weekdays' => ['ਐਤਵਾਰ', 'ਸੋਮਵਾਰ', 'ਮੰਗਲਵਾਰ', 'ਬੁੱਧਵਾਰ', 'ਵੀਰਵਾਰ', 'ਸ਼ੁੱਕਰਵਾਰ', 'ਸ਼ਨਿੱਚਰਵਾਰ'], - 'weekdays_short' => ['ਐਤ', 'ਸੋਮ', 'ਮੰਗਲ', 'ਬੁੱਧ', 'ਵੀਰ', 'ਸ਼ੁੱਕਰ', 'ਸ਼ਨਿੱਚਰ'], - 'weekdays_min' => ['ਐਤ', 'ਸੋਮ', 'ਮੰਗ', 'ਬੁੱਧ', 'ਵੀਰ', 'ਸ਼ੁੱਕ', 'ਸ਼ਨਿੱ'], - 'weekend' => [0, 0], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pa_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/pa_IN.php deleted file mode 100644 index ca67642a..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pa_IN.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Guo Xiang Tan - * - Josh Soref - * - Ash - * - harpreetkhalsagtbit - */ -return require __DIR__.'/pa.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pa_PK.php b/vendor/nesbot/carbon/src/Carbon/Lang/pa_PK.php deleted file mode 100644 index f9af11c6..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pa_PK.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YYYY', - ], - 'months' => ['جنوري', 'فروري', 'مارچ', 'اپريل', 'مٓی', 'جون', 'جولاي', 'اگست', 'ستمبر', 'اكتوبر', 'نومبر', 'دسمبر'], - 'months_short' => ['جنوري', 'فروري', 'مارچ', 'اپريل', 'مٓی', 'جون', 'جولاي', 'اگست', 'ستمبر', 'اكتوبر', 'نومبر', 'دسمبر'], - 'weekdays' => ['اتوار', 'پير', 'منگل', 'بدھ', 'جمعرات', 'جمعه', 'هفته'], - 'weekdays_short' => ['اتوار', 'پير', 'منگل', 'بدھ', 'جمعرات', 'جمعه', 'هفته'], - 'weekdays_min' => ['اتوار', 'پير', 'منگل', 'بدھ', 'جمعرات', 'جمعه', 'هفته'], - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['ص', 'ش'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pap.php b/vendor/nesbot/carbon/src/Carbon/Lang/pap.php deleted file mode 100644 index b4c1706f..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pap.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return [ - 'formats' => [ - 'LT' => 'HH.mm', - 'LTS' => 'HH.mm:ss', - 'L' => 'DD-MM-YY', - 'LL' => 'MMMM [di] DD, YYYY', - 'LLL' => 'DD MMM HH.mm', - 'LLLL' => 'MMMM DD, YYYY HH.mm', - ], - 'months' => ['yanüari', 'febrüari', 'mart', 'aprel', 'mei', 'yüni', 'yüli', 'ougùstùs', 'sèptèmber', 'oktober', 'novèmber', 'desèmber'], - 'months_short' => ['yan', 'feb', 'mar', 'apr', 'mei', 'yün', 'yül', 'oug', 'sèp', 'okt', 'nov', 'des'], - 'weekdays' => ['djadomingo', 'djaluna', 'djamars', 'djawebs', 'djarason', 'djabierne', 'djasabra'], - 'weekdays_short' => ['do', 'lu', 'ma', 'we', 'ra', 'bi', 'sa'], - 'weekdays_min' => ['do', 'lu', 'ma', 'we', 'ra', 'bi', 'sa'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'year' => ':count aña', - 'month' => ':count luna', - 'week' => ':count siman', - 'day' => ':count dia', - 'hour' => ':count ora', - 'minute' => ':count minüt', - 'second' => ':count sekònde', - 'list' => [', ', ' i '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pap_AW.php b/vendor/nesbot/carbon/src/Carbon/Lang/pap_AW.php deleted file mode 100644 index e9a48ffc..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pap_AW.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - information from native speaker Pablo Saratxaga pablo@mandrakesoft.com - */ -return require __DIR__.'/pap.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pap_CW.php b/vendor/nesbot/carbon/src/Carbon/Lang/pap_CW.php deleted file mode 100644 index e9a48ffc..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pap_CW.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - information from native speaker Pablo Saratxaga pablo@mandrakesoft.com - */ -return require __DIR__.'/pap.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pl.php b/vendor/nesbot/carbon/src/Carbon/Lang/pl.php deleted file mode 100644 index f0196c0d..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pl.php +++ /dev/null @@ -1,126 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Wacław Jacek - * - François B - * - Tim Fish - * - Serhan Apaydın - * - Massimiliano Caniparoli - * - JD Isaacks - * - Jakub Szwacz - * - Jan - * - Paul - * - damlys - * - Marek (marast78) - * - Peter (UnrulyNatives) - * - Qrzysio - * - Jan (aso824) - * - diverpl - */ - -use Carbon\CarbonInterface; - -return [ - 'year' => ':count rok|:count lata|:count lat', - 'a_year' => 'rok|:count lata|:count lat', - 'y' => ':count r|:count l|:count l', - 'month' => ':count miesiąc|:count miesiące|:count miesięcy', - 'a_month' => 'miesiąc|:count miesiące|:count miesięcy', - 'm' => ':count mies.', - 'week' => ':count tydzień|:count tygodnie|:count tygodni', - 'a_week' => 'tydzień|:count tygodnie|:count tygodni', - 'w' => ':count tyg.', - 'day' => ':count dzień|:count dni|:count dni', - 'a_day' => 'dzień|:count dni|:count dni', - 'd' => ':count d', - 'hour' => ':count godzina|:count godziny|:count godzin', - 'a_hour' => 'godzina|:count godziny|:count godzin', - 'h' => ':count godz.', - 'minute' => ':count minuta|:count minuty|:count minut', - 'a_minute' => 'minuta|:count minuty|:count minut', - 'min' => ':count min', - 'second' => ':count sekunda|:count sekundy|:count sekund', - 'a_second' => '{1}kilka sekund|:count sekunda|:count sekundy|:count sekund', - 's' => ':count sek.', - 'ago' => ':time temu', - 'from_now' => static function ($time) { - return 'za '.strtr($time, [ - 'godzina' => 'godzinę', - 'minuta' => 'minutę', - 'sekunda' => 'sekundę', - ]); - }, - 'after' => ':time po', - 'before' => ':time przed', - 'diff_now' => 'przed chwilą', - 'diff_today' => 'Dziś', - 'diff_today_regexp' => 'Dziś(?:\\s+o)?', - 'diff_yesterday' => 'wczoraj', - 'diff_yesterday_regexp' => 'Wczoraj(?:\\s+o)?', - 'diff_tomorrow' => 'jutro', - 'diff_tomorrow_regexp' => 'Jutro(?:\\s+o)?', - 'diff_before_yesterday' => 'przedwczoraj', - 'diff_after_tomorrow' => 'pojutrze', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD.MM.YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[Dziś o] LT', - 'nextDay' => '[Jutro o] LT', - 'nextWeek' => function (CarbonInterface $date) { - switch ($date->dayOfWeek) { - case 0: - return '[W niedzielę o] LT'; - case 2: - return '[We wtorek o] LT'; - case 3: - return '[W środę o] LT'; - case 6: - return '[W sobotę o] LT'; - default: - return '[W] dddd [o] LT'; - } - }, - 'lastDay' => '[Wczoraj o] LT', - 'lastWeek' => function (CarbonInterface $date) { - switch ($date->dayOfWeek) { - case 0: - return '[W zeszłą niedzielę o] LT'; - case 3: - return '[W zeszłą środę o] LT'; - case 6: - return '[W zeszłą sobotę o] LT'; - default: - return '[W zeszły] dddd [o] LT'; - } - }, - 'sameElse' => 'L', - ], - 'ordinal' => ':number.', - 'months' => ['stycznia', 'lutego', 'marca', 'kwietnia', 'maja', 'czerwca', 'lipca', 'sierpnia', 'września', 'października', 'listopada', 'grudnia'], - 'months_standalone' => ['styczeń', 'luty', 'marzec', 'kwiecień', 'maj', 'czerwiec', 'lipiec', 'sierpień', 'wrzesień', 'październik', 'listopad', 'grudzień'], - 'months_short' => ['sty', 'lut', 'mar', 'kwi', 'maj', 'cze', 'lip', 'sie', 'wrz', 'paź', 'lis', 'gru'], - 'months_regexp' => '/(DD?o?\.?(\[[^\[\]]*\]|\s)+MMMM?|L{2,4}|l{2,4})/', - 'weekdays' => ['niedziela', 'poniedziałek', 'wtorek', 'środa', 'czwartek', 'piątek', 'sobota'], - 'weekdays_short' => ['ndz', 'pon', 'wt', 'śr', 'czw', 'pt', 'sob'], - 'weekdays_min' => ['Nd', 'Pn', 'Wt', 'Śr', 'Cz', 'Pt', 'So'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' i '], - 'meridiem' => ['przed południem', 'po południu'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pl_PL.php b/vendor/nesbot/carbon/src/Carbon/Lang/pl_PL.php deleted file mode 100644 index 222bcdb4..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pl_PL.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/pl.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/prg.php b/vendor/nesbot/carbon/src/Carbon/Lang/prg.php deleted file mode 100644 index 6e63f4ad..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/prg.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'months' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'], - 'months_short' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'YYYY-MM-dd', - 'LL' => 'YYYY MMM D', - 'LLL' => 'YYYY MMMM D HH:mm', - 'LLLL' => 'YYYY MMMM D, dddd HH:mm', - ], - - 'year' => ':count meta', - 'y' => ':count meta', - 'a_year' => ':count meta', - - 'month' => ':count mēniks', // less reliable - 'm' => ':count mēniks', // less reliable - 'a_month' => ':count mēniks', // less reliable - - 'week' => ':count sawaītin', // less reliable - 'w' => ':count sawaītin', // less reliable - 'a_week' => ':count sawaītin', // less reliable - - 'day' => ':count di', - 'd' => ':count di', - 'a_day' => ':count di', - - 'hour' => ':count bruktēt', // less reliable - 'h' => ':count bruktēt', // less reliable - 'a_hour' => ':count bruktēt', // less reliable - - 'minute' => ':count līkuts', // less reliable - 'min' => ':count līkuts', // less reliable - 'a_minute' => ':count līkuts', // less reliable - - 'second' => ':count kitan', // less reliable - 's' => ':count kitan', // less reliable - 'a_second' => ':count kitan', // less reliable -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ps.php b/vendor/nesbot/carbon/src/Carbon/Lang/ps.php deleted file mode 100644 index a928b28e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ps.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Muhammad Nasir Rahimi - * - Nassim Nasibullah (spinzar) - */ -return [ - 'year' => ':count کال|:count کاله', - 'y' => ':countکال|:countکاله', - 'month' => ':count مياشت|:count مياشتي', - 'm' => ':countمياشت|:countمياشتي', - 'week' => ':count اونۍ|:count اونۍ', - 'w' => ':countاونۍ|:countاونۍ', - 'day' => ':count ورځ|:count ورځي', - 'd' => ':countورځ|:countورځي', - 'hour' => ':count ساعت|:count ساعته', - 'h' => ':countساعت|:countساعته', - 'minute' => ':count دقيقه|:count دقيقې', - 'min' => ':countدقيقه|:countدقيقې', - 'second' => ':count ثانيه|:count ثانيې', - 's' => ':countثانيه|:countثانيې', - 'ago' => ':time دمخه', - 'from_now' => ':time له اوس څخه', - 'after' => ':time وروسته', - 'before' => ':time دمخه', - 'list' => ['، ', ' او '], - 'meridiem' => ['غ.م.', 'غ.و.'], - 'weekdays' => ['اتوار', 'ګل', 'نهه', 'شورو', 'زيارت', 'جمعه', 'خالي'], - 'weekdays_short' => ['ا', 'ګ', 'ن', 'ش', 'ز', 'ج', 'خ'], - 'weekdays_min' => ['ا', 'ګ', 'ن', 'ش', 'ز', 'ج', 'خ'], - 'months' => ['جنوري', 'فبروري', 'مارچ', 'اپریل', 'مۍ', 'جون', 'جولای', 'اگست', 'سېپتمبر', 'اکتوبر', 'نومبر', 'دسمبر'], - 'months_short' => ['جنوري', 'فبروري', 'مارچ', 'اپریل', 'مۍ', 'جون', 'جولای', 'اگست', 'سېپتمبر', 'اکتوبر', 'نومبر', 'دسمبر'], - 'months_standalone' => ['جنوري', 'فېبروري', 'مارچ', 'اپریل', 'مۍ', 'جون', 'جولای', 'اگست', 'سپتمبر', 'اکتوبر', 'نومبر', 'دسمبر'], - 'months_short_standalone' => ['جنوري', 'فبروري', 'مارچ', 'اپریل', 'مۍ', 'جون', 'جولای', 'اگست', 'سپتمبر', 'اکتوبر', 'نومبر', 'دسمبر'], - 'first_day_of_week' => 6, - 'weekend' => [4, 5], - 'formats' => [ - 'LT' => 'H:mm', - 'LTS' => 'H:mm:ss', - 'L' => 'YYYY/M/d', - 'LL' => 'YYYY MMM D', - 'LLL' => 'د YYYY د MMMM D H:mm', - 'LLLL' => 'dddd د YYYY د MMMM D H:mm', - ], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ps_AF.php b/vendor/nesbot/carbon/src/Carbon/Lang/ps_AF.php deleted file mode 100644 index 6ec51804..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ps_AF.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/ps.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt.php deleted file mode 100644 index bb6359b1..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt.php +++ /dev/null @@ -1,116 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Cassiano Montanari - * - Matt Pope - * - François B - * - Prodis - * - JD Isaacks - * - Raphael Amorim - * - João Magalhães - * - victortobias - * - Paulo Freitas - * - Sebastian Thierer - * - Claudson Martins (claudsonm) - */ - -use Carbon\CarbonInterface; - -return [ - 'year' => ':count ano|:count anos', - 'a_year' => 'um ano|:count anos', - 'y' => ':counta', - 'month' => ':count mês|:count meses', - 'a_month' => 'um mês|:count meses', - 'm' => ':countm', - 'week' => ':count semana|:count semanas', - 'a_week' => 'uma semana|:count semanas', - 'w' => ':countsem', - 'day' => ':count dia|:count dias', - 'a_day' => 'um dia|:count dias', - 'd' => ':countd', - 'hour' => ':count hora|:count horas', - 'a_hour' => 'uma hora|:count horas', - 'h' => ':counth', - 'minute' => ':count minuto|:count minutos', - 'a_minute' => 'um minuto|:count minutos', - 'min' => ':countmin', - 'second' => ':count segundo|:count segundos', - 'a_second' => 'alguns segundos|:count segundos', - 's' => ':counts', - 'millisecond' => ':count milissegundo|:count milissegundos', - 'a_millisecond' => 'um milissegundo|:count milissegundos', - 'ms' => ':countms', - 'microsecond' => ':count microssegundo|:count microssegundos', - 'a_microsecond' => 'um microssegundo|:count microssegundos', - 'µs' => ':countµs', - 'ago' => 'há :time', - 'from_now' => 'em :time', - 'after' => ':time depois', - 'before' => ':time antes', - 'diff_now' => 'agora', - 'diff_today' => 'Hoje', - 'diff_today_regexp' => 'Hoje(?:\\s+às)?', - 'diff_yesterday' => 'ontem', - 'diff_yesterday_regexp' => 'Ontem(?:\\s+às)?', - 'diff_tomorrow' => 'amanhã', - 'diff_tomorrow_regexp' => 'Amanhã(?:\\s+às)?', - 'diff_before_yesterday' => 'anteontem', - 'diff_after_tomorrow' => 'depois de amanhã', - 'period_recurrences' => 'uma vez|:count vezes', - 'period_interval' => 'cada :interval', - 'period_start_date' => 'de :date', - 'period_end_date' => 'até :date', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D [de] MMMM [de] YYYY', - 'LLL' => 'D [de] MMMM [de] YYYY HH:mm', - 'LLLL' => 'dddd, D [de] MMMM [de] YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[Hoje às] LT', - 'nextDay' => '[Amanhã às] LT', - 'nextWeek' => 'dddd [às] LT', - 'lastDay' => '[Ontem às] LT', - 'lastWeek' => function (CarbonInterface $date) { - switch ($date->dayOfWeek) { - case 0: - case 6: - return '[Último] dddd [às] LT'; - default: - return '[Última] dddd [às] LT'; - } - }, - 'sameElse' => 'L', - ], - 'ordinal' => ':numberº', - 'months' => ['janeiro', 'fevereiro', 'março', 'abril', 'maio', 'junho', 'julho', 'agosto', 'setembro', 'outubro', 'novembro', 'dezembro'], - 'months_short' => ['jan', 'fev', 'mar', 'abr', 'mai', 'jun', 'jul', 'ago', 'set', 'out', 'nov', 'dez'], - 'weekdays' => ['domingo', 'segunda-feira', 'terça-feira', 'quarta-feira', 'quinta-feira', 'sexta-feira', 'sábado'], - 'weekdays_short' => ['dom', 'seg', 'ter', 'qua', 'qui', 'sex', 'sáb'], - 'weekdays_min' => ['Do', '2ª', '3ª', '4ª', '5ª', '6ª', 'Sá'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' e '], - 'ordinal_words' => [ - 'of' => 'de', - 'first' => 'primeira', - 'second' => 'segunda', - 'third' => 'terceira', - 'fourth' => 'quarta', - 'fifth' => 'quinta', - 'last' => 'última', - ], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt_AO.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt_AO.php deleted file mode 100644 index 22c01ec5..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt_AO.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/pt.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt_BR.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt_BR.php deleted file mode 100644 index e917c5cd..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt_BR.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Cassiano Montanari - * - Eduardo Dalla Vecchia - * - David Rodrigues - * - Matt Pope - * - François B - * - Prodis - * - Marlon Maxwel - * - JD Isaacks - * - Raphael Amorim - * - Rafael Raupp - * - felipeleite1 - * - swalker - * - Lucas Macedo - * - Paulo Freitas - * - Sebastian Thierer - */ -return array_replace_recursive(require __DIR__.'/pt.php', [ - 'period_recurrences' => 'uma|:count vez', - 'period_interval' => 'toda :interval', - 'formats' => [ - 'LLL' => 'D [de] MMMM [de] YYYY [às] HH:mm', - 'LLLL' => 'dddd, D [de] MMMM [de] YYYY [às] HH:mm', - ], - 'first_day_of_week' => 0, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt_CH.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt_CH.php deleted file mode 100644 index 22c01ec5..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt_CH.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/pt.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt_CV.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt_CV.php deleted file mode 100644 index 22c01ec5..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt_CV.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/pt.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt_GQ.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt_GQ.php deleted file mode 100644 index 22c01ec5..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt_GQ.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/pt.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt_GW.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt_GW.php deleted file mode 100644 index 22c01ec5..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt_GW.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/pt.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt_LU.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt_LU.php deleted file mode 100644 index 22c01ec5..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt_LU.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/pt.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt_MO.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt_MO.php deleted file mode 100644 index f2b5eab7..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt_MO.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/pt.php', [ - 'formats' => [ - 'LT' => 'h:mm a', - 'LTS' => 'h:mm:ss a', - 'LLL' => 'D [de] MMMM [de] YYYY, h:mm a', - 'LLLL' => 'dddd, D [de] MMMM [de] YYYY, h:mm a', - ], - 'first_day_of_week' => 0, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt_MZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt_MZ.php deleted file mode 100644 index fbc0c97b..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt_MZ.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/pt.php', [ - 'first_day_of_week' => 0, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt_PT.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt_PT.php deleted file mode 100644 index 2a76fc1f..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt_PT.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - RAP bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/pt.php', [ - 'formats' => [ - 'L' => 'DD/MM/YYYY', - ], - 'months' => ['janeiro', 'fevereiro', 'março', 'abril', 'maio', 'junho', 'julho', 'agosto', 'setembro', 'outubro', 'novembro', 'dezembro'], - 'months_short' => ['jan', 'fev', 'mar', 'abr', 'mai', 'jun', 'jul', 'ago', 'set', 'out', 'nov', 'dez'], - 'weekdays' => ['domingo', 'segunda', 'terça', 'quarta', 'quinta', 'sexta', 'sábado'], - 'weekdays_short' => ['dom', 'seg', 'ter', 'qua', 'qui', 'sex', 'sáb'], - 'weekdays_min' => ['dom', 'seg', 'ter', 'qua', 'qui', 'sex', 'sáb'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt_ST.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt_ST.php deleted file mode 100644 index 22c01ec5..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt_ST.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/pt.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt_TL.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt_TL.php deleted file mode 100644 index 22c01ec5..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt_TL.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/pt.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/qu.php b/vendor/nesbot/carbon/src/Carbon/Lang/qu.php deleted file mode 100644 index 65278cd1..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/qu.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/es_UY.php', [ - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM, YYYY HH:mm', - ], - 'first_day_of_week' => 0, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/qu_BO.php b/vendor/nesbot/carbon/src/Carbon/Lang/qu_BO.php deleted file mode 100644 index d5db6bf5..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/qu_BO.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/qu.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/qu_EC.php b/vendor/nesbot/carbon/src/Carbon/Lang/qu_EC.php deleted file mode 100644 index d5db6bf5..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/qu_EC.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/qu.php', [ - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/quz.php b/vendor/nesbot/carbon/src/Carbon/Lang/quz.php deleted file mode 100644 index 1640c02f..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/quz.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/quz_PE.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/quz_PE.php b/vendor/nesbot/carbon/src/Carbon/Lang/quz_PE.php deleted file mode 100644 index d3229189..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/quz_PE.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Sugar Labs // OLPC sugarlabs.org libc-alpha@sourceware.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YY', - ], - 'months' => ['iniru', 'phiwriru', 'marsu', 'awril', 'mayu', 'huniyu', 'huliyu', 'agustu', 'siptiyimri', 'uktuwri', 'nuwiyimri', 'tisiyimri'], - 'months_short' => ['ini', 'phi', 'mar', 'awr', 'may', 'hun', 'hul', 'agu', 'sip', 'ukt', 'nuw', 'tis'], - 'weekdays' => ['tuminku', 'lunis', 'martis', 'miyirkulis', 'juywis', 'wiyirnis', 'sawatu'], - 'weekdays_short' => ['tum', 'lun', 'mar', 'miy', 'juy', 'wiy', 'saw'], - 'weekdays_min' => ['tum', 'lun', 'mar', 'miy', 'juy', 'wiy', 'saw'], - 'day_of_first_week_of_year' => 1, - - 'minute' => ':count uchuy', // less reliable - 'min' => ':count uchuy', // less reliable - 'a_minute' => ':count uchuy', // less reliable - - 'year' => ':count wata', - 'y' => ':count wata', - 'a_year' => ':count wata', - - 'month' => ':count killa', - 'm' => ':count killa', - 'a_month' => ':count killa', - - 'week' => ':count simana', - 'w' => ':count simana', - 'a_week' => ':count simana', - - 'day' => ':count pʼunchaw', - 'd' => ':count pʼunchaw', - 'a_day' => ':count pʼunchaw', - - 'hour' => ':count ura', - 'h' => ':count ura', - 'a_hour' => ':count ura', - - 'second' => ':count iskay ñiqin', - 's' => ':count iskay ñiqin', - 'a_second' => ':count iskay ñiqin', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/raj.php b/vendor/nesbot/carbon/src/Carbon/Lang/raj.php deleted file mode 100644 index 26138c9b..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/raj.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/raj_IN.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/raj_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/raj_IN.php deleted file mode 100644 index 7b4589cd..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/raj_IN.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - meghrajsuthar03@gmail.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'D/M/YY', - ], - 'months' => ['जनवरी', 'फरवरी', 'मार्च', 'अप्रैल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितंबर', 'अक्टूबर', 'नवंबर', 'दिसंबर'], - 'months_short' => ['जन', 'फर', 'मार्च', 'अप्रै', 'मई', 'जून', 'जुल', 'अग', 'सित', 'अक्टू', 'नव', 'दिस'], - 'weekdays' => ['रविवार', 'सोमवार', 'मंगल्लवार', 'बुधवार', 'बृहस्पतिवार', 'शुक्रवार', 'शनिवार'], - 'weekdays_short' => ['रवि', 'सोम', 'मंगल', 'बुध', 'बृहस्पति', 'शुक्र', 'शनि'], - 'weekdays_min' => ['रवि', 'सोम', 'मंगल', 'बुध', 'बृहस्पति', 'शुक्र', 'शनि'], - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['पूर्वाह्न', 'अपराह्न'], - - 'year' => ':count आंहू', // less reliable - 'y' => ':count आंहू', // less reliable - 'a_year' => ':count आंहू', // less reliable - - 'month' => ':count सूरज', // less reliable - 'm' => ':count सूरज', // less reliable - 'a_month' => ':count सूरज', // less reliable - - 'week' => ':count निवाज', // less reliable - 'w' => ':count निवाज', // less reliable - 'a_week' => ':count निवाज', // less reliable - - 'day' => ':count अेक', // less reliable - 'd' => ':count अेक', // less reliable - 'a_day' => ':count अेक', // less reliable - - 'hour' => ':count दुनियांण', // less reliable - 'h' => ':count दुनियांण', // less reliable - 'a_hour' => ':count दुनियांण', // less reliable -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/rm.php b/vendor/nesbot/carbon/src/Carbon/Lang/rm.php deleted file mode 100644 index 1843f456..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/rm.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Philippe Vaucher - * - tjku - * - Max Melentiev - * - Juanito Fatas - * - Tsutomu Kuroda - * - Akira Matsuda - * - Christopher Dell - * - Enrique Vidal - * - Simone Carletti - * - Aaron Patterson - * - Nicolás Hock Isaza - * - sebastian de castelberg - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD.MM.YYYY', - 'LL' => 'Do MMMM YYYY', - 'LLL' => 'Do MMMM, HH:mm [Uhr]', - 'LLLL' => 'dddd, Do MMMM YYYY, HH:mm [Uhr]', - ], - 'year' => ':count onn|:count onns', - 'month' => ':count mais', - 'week' => ':count emna|:count emnas', - 'day' => ':count di|:count dis', - 'hour' => ':count oura|:count ouras', - 'minute' => ':count minuta|:count minutas', - 'second' => ':count secunda|:count secundas', - 'weekdays' => ['dumengia', 'glindesdi', 'mardi', 'mesemna', 'gievgia', 'venderdi', 'sonda'], - 'weekdays_short' => ['du', 'gli', 'ma', 'me', 'gie', 've', 'so'], - 'weekdays_min' => ['du', 'gli', 'ma', 'me', 'gie', 've', 'so'], - 'months' => ['schaner', 'favrer', 'mars', 'avrigl', 'matg', 'zercladur', 'fanadur', 'avust', 'settember', 'october', 'november', 'december'], - 'months_short' => ['schan', 'favr', 'mars', 'avr', 'matg', 'zercl', 'fan', 'avust', 'sett', 'oct', 'nov', 'dec'], - 'meridiem' => ['avantmezdi', 'suentermezdi'], - 'list' => [', ', ' e '], - 'first_day_of_week' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/rn.php b/vendor/nesbot/carbon/src/Carbon/Lang/rn.php deleted file mode 100644 index 8ab958eb..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/rn.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['Z.MU.', 'Z.MW.'], - 'weekdays' => ['Ku w’indwi', 'Ku wa mbere', 'Ku wa kabiri', 'Ku wa gatatu', 'Ku wa kane', 'Ku wa gatanu', 'Ku wa gatandatu'], - 'weekdays_short' => ['cu.', 'mbe.', 'kab.', 'gtu.', 'kan.', 'gnu.', 'gnd.'], - 'weekdays_min' => ['cu.', 'mbe.', 'kab.', 'gtu.', 'kan.', 'gnu.', 'gnd.'], - 'months' => ['Nzero', 'Ruhuhuma', 'Ntwarante', 'Ndamukiza', 'Rusama', 'Ruheshi', 'Mukakaro', 'Nyandagaro', 'Nyakanga', 'Gitugutu', 'Munyonyo', 'Kigarama'], - 'months_short' => ['Mut.', 'Gas.', 'Wer.', 'Mat.', 'Gic.', 'Kam.', 'Nya.', 'Kan.', 'Nze.', 'Ukw.', 'Ugu.', 'Uku.'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'D/M/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], - - 'year' => 'imyaka :count', - 'y' => 'imyaka :count', - 'a_year' => 'imyaka :count', - - 'month' => 'amezi :count', - 'm' => 'amezi :count', - 'a_month' => 'amezi :count', - - 'week' => 'indwi :count', - 'w' => 'indwi :count', - 'a_week' => 'indwi :count', - - 'day' => 'imisi :count', - 'd' => 'imisi :count', - 'a_day' => 'imisi :count', - - 'hour' => 'amasaha :count', - 'h' => 'amasaha :count', - 'a_hour' => 'amasaha :count', - - 'minute' => 'iminuta :count', - 'min' => 'iminuta :count', - 'a_minute' => 'iminuta :count', - - 'second' => 'inguvu :count', // less reliable - 's' => 'inguvu :count', // less reliable - 'a_second' => 'inguvu :count', // less reliable -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ro.php b/vendor/nesbot/carbon/src/Carbon/Lang/ro.php deleted file mode 100644 index 868a3279..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ro.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Josh Soref - * - JD Isaacks - * - Cătălin Georgescu - * - Valentin Ivaşcu (oriceon) - */ -return [ - 'year' => ':count an|:count ani|:count ani', - 'a_year' => 'un an|:count ani|:count ani', - 'y' => ':count a.', - 'month' => ':count lună|:count luni|:count luni', - 'a_month' => 'o lună|:count luni|:count luni', - 'm' => ':count l.', - 'week' => ':count săptămână|:count săptămâni|:count săptămâni', - 'a_week' => 'o săptămână|:count săptămâni|:count săptămâni', - 'w' => ':count săp.', - 'day' => ':count zi|:count zile|:count zile', - 'a_day' => 'o zi|:count zile|:count zile', - 'd' => ':count z.', - 'hour' => ':count oră|:count ore|:count ore', - 'a_hour' => 'o oră|:count ore|:count ore', - 'h' => ':count o.', - 'minute' => ':count minut|:count minute|:count minute', - 'a_minute' => 'un minut|:count minute|:count minute', - 'min' => ':count m.', - 'second' => ':count secundă|:count secunde|:count secunde', - 'a_second' => 'câteva secunde|:count secunde|:count secunde', - 's' => ':count sec.', - 'ago' => ':time în urmă', - 'from_now' => 'peste :time', - 'after' => 'peste :time', - 'before' => 'acum :time', - 'diff_now' => 'acum', - 'diff_today' => 'azi', - 'diff_today_regexp' => 'azi(?:\\s+la)?', - 'diff_yesterday' => 'ieri', - 'diff_yesterday_regexp' => 'ieri(?:\\s+la)?', - 'diff_tomorrow' => 'mâine', - 'diff_tomorrow_regexp' => 'mâine(?:\\s+la)?', - 'formats' => [ - 'LT' => 'H:mm', - 'LTS' => 'H:mm:ss', - 'L' => 'DD.MM.YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY H:mm', - 'LLLL' => 'dddd, D MMMM YYYY H:mm', - ], - 'calendar' => [ - 'sameDay' => '[azi la] LT', - 'nextDay' => '[mâine la] LT', - 'nextWeek' => 'dddd [la] LT', - 'lastDay' => '[ieri la] LT', - 'lastWeek' => '[fosta] dddd [la] LT', - 'sameElse' => 'L', - ], - 'months' => ['ianuarie', 'februarie', 'martie', 'aprilie', 'mai', 'iunie', 'iulie', 'august', 'septembrie', 'octombrie', 'noiembrie', 'decembrie'], - 'months_short' => ['ian.', 'feb.', 'mar.', 'apr.', 'mai', 'iun.', 'iul.', 'aug.', 'sept.', 'oct.', 'nov.', 'dec.'], - 'weekdays' => ['duminică', 'luni', 'marți', 'miercuri', 'joi', 'vineri', 'sâmbătă'], - 'weekdays_short' => ['dum', 'lun', 'mar', 'mie', 'joi', 'vin', 'sâm'], - 'weekdays_min' => ['du', 'lu', 'ma', 'mi', 'jo', 'vi', 'sâ'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'list' => [', ', ' și '], - 'meridiem' => ['a.m.', 'p.m.'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ro_MD.php b/vendor/nesbot/carbon/src/Carbon/Lang/ro_MD.php deleted file mode 100644 index ad1d2fa8..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ro_MD.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/ro.php', [ - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD.MM.YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY, HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY, HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ro_RO.php b/vendor/nesbot/carbon/src/Carbon/Lang/ro_RO.php deleted file mode 100644 index 102afcde..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ro_RO.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/ro.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/rof.php b/vendor/nesbot/carbon/src/Carbon/Lang/rof.php deleted file mode 100644 index 205fc266..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/rof.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['kang’ama', 'kingoto'], - 'weekdays' => ['Ijumapili', 'Ijumatatu', 'Ijumanne', 'Ijumatano', 'Alhamisi', 'Ijumaa', 'Ijumamosi'], - 'weekdays_short' => ['Ijp', 'Ijt', 'Ijn', 'Ijtn', 'Alh', 'Iju', 'Ijm'], - 'weekdays_min' => ['Ijp', 'Ijt', 'Ijn', 'Ijtn', 'Alh', 'Iju', 'Ijm'], - 'months' => ['Mweri wa kwanza', 'Mweri wa kaili', 'Mweri wa katatu', 'Mweri wa kaana', 'Mweri wa tanu', 'Mweri wa sita', 'Mweri wa saba', 'Mweri wa nane', 'Mweri wa tisa', 'Mweri wa ikumi', 'Mweri wa ikumi na moja', 'Mweri wa ikumi na mbili'], - 'months_short' => ['M1', 'M2', 'M3', 'M4', 'M5', 'M6', 'M7', 'M8', 'M9', 'M10', 'M11', 'M12'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ru.php b/vendor/nesbot/carbon/src/Carbon/Lang/ru.php deleted file mode 100644 index 673b043b..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ru.php +++ /dev/null @@ -1,191 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Bari Badamshin - * - Jørn Ølmheim - * - François B - * - Tim Fish - * - Коренберг Марк (imac) - * - Serhan Apaydın - * - RomeroMsk - * - vsn4ik - * - JD Isaacks - * - Bari Badamshin - * - Jørn Ølmheim - * - François B - * - Коренберг Марк (imac) - * - Serhan Apaydın - * - RomeroMsk - * - vsn4ik - * - JD Isaacks - * - Fellzo - * - andrey-helldar - * - Pavel Skripkin (psxx) - * - AlexWalkerson - * - Vladislav UnsealedOne - * - dima-bzz - */ - -use Carbon\CarbonInterface; - -$transformDiff = function ($input) { - return strtr($input, [ - 'неделя' => 'неделю', - 'секунда' => 'секунду', - 'минута' => 'минуту', - ]); -}; - -return [ - 'year' => ':count год|:count года|:count лет', - 'y' => ':count г.|:count г.|:count л.', - 'a_year' => '{1}год|:count год|:count года|:count лет', - 'month' => ':count месяц|:count месяца|:count месяцев', - 'm' => ':count мес.', - 'a_month' => '{1}месяц|:count месяц|:count месяца|:count месяцев', - 'week' => ':count неделя|:count недели|:count недель', - 'w' => ':count нед.', - 'a_week' => '{1}неделя|:count неделю|:count недели|:count недель', - 'day' => ':count день|:count дня|:count дней', - 'd' => ':count д.', - 'a_day' => '{1}день|:count день|:count дня|:count дней', - 'hour' => ':count час|:count часа|:count часов', - 'h' => ':count ч.', - 'a_hour' => '{1}час|:count час|:count часа|:count часов', - 'minute' => ':count минута|:count минуты|:count минут', - 'min' => ':count мин.', - 'a_minute' => '{1}минута|:count минута|:count минуты|:count минут', - 'second' => ':count секунда|:count секунды|:count секунд', - 's' => ':count сек.', - 'a_second' => '{1}несколько секунд|:count секунду|:count секунды|:count секунд', - 'ago' => function ($time) use ($transformDiff) { - return $transformDiff($time).' назад'; - }, - 'from_now' => function ($time) use ($transformDiff) { - return 'через '.$transformDiff($time); - }, - 'after' => function ($time) use ($transformDiff) { - return $transformDiff($time).' после'; - }, - 'before' => function ($time) use ($transformDiff) { - return $transformDiff($time).' до'; - }, - 'diff_now' => 'только что', - 'diff_today' => 'Сегодня,', - 'diff_today_regexp' => 'Сегодня,?(?:\\s+в)?', - 'diff_yesterday' => 'вчера', - 'diff_yesterday_regexp' => 'Вчера,?(?:\\s+в)?', - 'diff_tomorrow' => 'завтра', - 'diff_tomorrow_regexp' => 'Завтра,?(?:\\s+в)?', - 'diff_before_yesterday' => 'позавчера', - 'diff_after_tomorrow' => 'послезавтра', - 'formats' => [ - 'LT' => 'H:mm', - 'LTS' => 'H:mm:ss', - 'L' => 'DD.MM.YYYY', - 'LL' => 'D MMMM YYYY г.', - 'LLL' => 'D MMMM YYYY г., H:mm', - 'LLLL' => 'dddd, D MMMM YYYY г., H:mm', - ], - 'calendar' => [ - 'sameDay' => '[Сегодня, в] LT', - 'nextDay' => '[Завтра, в] LT', - 'nextWeek' => function (CarbonInterface $current, CarbonInterface $other) { - if ($current->week !== $other->week) { - switch ($current->dayOfWeek) { - case 0: - return '[В следующее] dddd, [в] LT'; - case 1: - case 2: - case 4: - return '[В следующий] dddd, [в] LT'; - case 3: - case 5: - case 6: - return '[В следующую] dddd, [в] LT'; - } - } - - if ($current->dayOfWeek === 2) { - return '[Во] dddd, [в] LT'; - } - - return '[В] dddd, [в] LT'; - }, - 'lastDay' => '[Вчера, в] LT', - 'lastWeek' => function (CarbonInterface $current, CarbonInterface $other) { - if ($current->week !== $other->week) { - switch ($current->dayOfWeek) { - case 0: - return '[В прошлое] dddd, [в] LT'; - case 1: - case 2: - case 4: - return '[В прошлый] dddd, [в] LT'; - case 3: - case 5: - case 6: - return '[В прошлую] dddd, [в] LT'; - } - } - - if ($current->dayOfWeek === 2) { - return '[Во] dddd, [в] LT'; - } - - return '[В] dddd, [в] LT'; - }, - 'sameElse' => 'L', - ], - 'ordinal' => function ($number, $period) { - switch ($period) { - case 'M': - case 'd': - case 'DDD': - return $number.'-й'; - case 'D': - return $number.'-го'; - case 'w': - case 'W': - return $number.'-я'; - default: - return $number; - } - }, - 'meridiem' => function ($hour) { - if ($hour < 4) { - return 'ночи'; - } - if ($hour < 12) { - return 'утра'; - } - if ($hour < 17) { - return 'дня'; - } - - return 'вечера'; - }, - 'months' => ['января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря'], - 'months_standalone' => ['январь', 'февраль', 'март', 'апрель', 'май', 'июнь', 'июль', 'август', 'сентябрь', 'октябрь', 'ноябрь', 'декабрь'], - 'months_short' => ['янв', 'фев', 'мар', 'апр', 'мая', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек'], - 'months_short_standalone' => ['янв', 'фев', 'мар', 'апр', 'май', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек'], - 'months_regexp' => '/(DD?o?\.?(\[[^\[\]]*\]|\s)+MMMM?|L{2,4}|l{2,4})/', - 'weekdays' => ['воскресенье', 'понедельник', 'вторник', 'среду', 'четверг', 'пятницу', 'субботу'], - 'weekdays_standalone' => ['воскресенье', 'понедельник', 'вторник', 'среда', 'четверг', 'пятница', 'суббота'], - 'weekdays_short' => ['вск', 'пнд', 'втр', 'срд', 'чтв', 'птн', 'сбт'], - 'weekdays_min' => ['вс', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'], - 'weekdays_regexp' => '/\[\s*(В|в)\s*((?:прошлую|следующую|эту)\s*)?\]\s*dddd/', - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'list' => [', ', ' и '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ru_BY.php b/vendor/nesbot/carbon/src/Carbon/Lang/ru_BY.php deleted file mode 100644 index 8ca7df34..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ru_BY.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/ru.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ru_KG.php b/vendor/nesbot/carbon/src/Carbon/Lang/ru_KG.php deleted file mode 100644 index 8ca7df34..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ru_KG.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/ru.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ru_KZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/ru_KZ.php deleted file mode 100644 index 8ca7df34..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ru_KZ.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/ru.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ru_MD.php b/vendor/nesbot/carbon/src/Carbon/Lang/ru_MD.php deleted file mode 100644 index 8ca7df34..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ru_MD.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/ru.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ru_RU.php b/vendor/nesbot/carbon/src/Carbon/Lang/ru_RU.php deleted file mode 100644 index 8ca7df34..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ru_RU.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/ru.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ru_UA.php b/vendor/nesbot/carbon/src/Carbon/Lang/ru_UA.php deleted file mode 100644 index db958d68..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ru_UA.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - RFC 2319 bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/ru.php', [ - 'weekdays' => ['воскресенье', 'понедельник', 'вторник', 'среда', 'четверг', 'пятница', 'суббота'], - 'weekdays_short' => ['вск', 'пнд', 'вто', 'срд', 'чтв', 'птн', 'суб'], - 'weekdays_min' => ['вс', 'пн', 'вт', 'ср', 'чт', 'пт', 'су'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/rw.php b/vendor/nesbot/carbon/src/Carbon/Lang/rw.php deleted file mode 100644 index bc4a347f..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/rw.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/rw_RW.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/rw_RW.php b/vendor/nesbot/carbon/src/Carbon/Lang/rw_RW.php deleted file mode 100644 index 9b3e0682..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/rw_RW.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Rwanda Steve Murphy murf@e-tools.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD.MM.YYYY', - ], - 'months' => ['Mutarama', 'Gashyantare', 'Werurwe', 'Mata', 'Gicuransi', 'Kamena', 'Nyakanga', 'Kanama', 'Nzeli', 'Ukwakira', 'Ugushyingo', 'Ukuboza'], - 'months_short' => ['Mut', 'Gas', 'Wer', 'Mat', 'Gic', 'Kam', 'Nya', 'Kan', 'Nze', 'Ukw', 'Ugu', 'Uku'], - 'weekdays' => ['Ku cyumweru', 'Kuwa mbere', 'Kuwa kabiri', 'Kuwa gatatu', 'Kuwa kane', 'Kuwa gatanu', 'Kuwa gatandatu'], - 'weekdays_short' => ['Mwe', 'Mbe', 'Kab', 'Gtu', 'Kan', 'Gnu', 'Gnd'], - 'weekdays_min' => ['Mwe', 'Mbe', 'Kab', 'Gtu', 'Kan', 'Gnu', 'Gnd'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - - 'second' => ':count vuna', // less reliable - 's' => ':count vuna', // less reliable - 'a_second' => ':count vuna', // less reliable - - 'year' => 'aka :count', - 'y' => 'aka :count', - 'a_year' => 'aka :count', - - 'month' => 'ezi :count', - 'm' => 'ezi :count', - 'a_month' => 'ezi :count', - - 'week' => ':count icyumweru', - 'w' => ':count icyumweru', - 'a_week' => ':count icyumweru', - - 'day' => ':count nsi', - 'd' => ':count nsi', - 'a_day' => ':count nsi', - - 'hour' => 'saha :count', - 'h' => 'saha :count', - 'a_hour' => 'saha :count', - - 'minute' => ':count -nzinya', - 'min' => ':count -nzinya', - 'a_minute' => ':count -nzinya', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/rwk.php b/vendor/nesbot/carbon/src/Carbon/Lang/rwk.php deleted file mode 100644 index ed92e8e7..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/rwk.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['utuko', 'kyiukonyi'], - 'weekdays' => ['Jumapilyi', 'Jumatatuu', 'Jumanne', 'Jumatanu', 'Alhamisi', 'Ijumaa', 'Jumamosi'], - 'weekdays_short' => ['Jpi', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Iju', 'Jmo'], - 'weekdays_min' => ['Jpi', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Iju', 'Jmo'], - 'months' => ['Januari', 'Februari', 'Machi', 'Aprilyi', 'Mei', 'Junyi', 'Julyai', 'Agusti', 'Septemba', 'Oktoba', 'Novemba', 'Desemba'], - 'months_short' => ['Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Sep', 'Okt', 'Nov', 'Des'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sa.php b/vendor/nesbot/carbon/src/Carbon/Lang/sa.php deleted file mode 100644 index 1357c030..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sa.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/sa_IN.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sa_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/sa_IN.php deleted file mode 100644 index cfda9a63..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sa_IN.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - The Debian project Christian Perrier bubulle@debian.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'D-MM-YY', - ], - 'months' => ['जनवरी', 'फ़रवरी', 'मार्च', 'अप्रेल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर'], - 'months_short' => ['जनवरी', 'फ़रवरी', 'मार्च', 'अप्रेल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर'], - 'weekdays' => ['रविवासर:', 'सोमवासर:', 'मंगलवासर:', 'बुधवासर:', 'बृहस्पतिवासरः', 'शुक्रवासर', 'शनिवासर:'], - 'weekdays_short' => ['रविः', 'सोम:', 'मंगल:', 'बुध:', 'बृहस्पतिः', 'शुक्र', 'शनि:'], - 'weekdays_min' => ['रविः', 'सोम:', 'मंगल:', 'बुध:', 'बृहस्पतिः', 'शुक्र', 'शनि:'], - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['पूर्वाह्न', 'अपराह्न'], - - 'minute' => ':count होरा', // less reliable - 'min' => ':count होरा', // less reliable - 'a_minute' => ':count होरा', // less reliable - - 'year' => ':count वर्ष', - 'y' => ':count वर्ष', - 'a_year' => ':count वर्ष', - - 'month' => ':count मास', - 'm' => ':count मास', - 'a_month' => ':count मास', - - 'week' => ':count सप्ताहः saptahaĥ', - 'w' => ':count सप्ताहः saptahaĥ', - 'a_week' => ':count सप्ताहः saptahaĥ', - - 'day' => ':count दिन', - 'd' => ':count दिन', - 'a_day' => ':count दिन', - - 'hour' => ':count घण्टा', - 'h' => ':count घण्टा', - 'a_hour' => ':count घण्टा', - - 'second' => ':count द्वितीयः', - 's' => ':count द्वितीयः', - 'a_second' => ':count द्वितीयः', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sah.php b/vendor/nesbot/carbon/src/Carbon/Lang/sah.php deleted file mode 100644 index b8288242..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sah.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/sah_RU.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sah_RU.php b/vendor/nesbot/carbon/src/Carbon/Lang/sah_RU.php deleted file mode 100644 index 94cc0cb0..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sah_RU.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Valery Timiriliyev Valery Timiriliyev timiriliyev@gmail.com - */ -return array_replace_recursive(require __DIR__.'/ru.php', [ - 'formats' => [ - 'L' => 'YYYY.MM.DD', - ], - 'months' => ['тохсунньу', 'олунньу', 'кулун тутар', 'муус устар', 'ыам ыйын', 'бэс ыйын', 'от ыйын', 'атырдьах ыйын', 'балаҕан ыйын', 'алтынньы', 'сэтинньи', 'ахсынньы'], - 'months_short' => ['тохс', 'олун', 'кул', 'муус', 'ыам', 'бэс', 'от', 'атыр', 'бал', 'алт', 'сэт', 'ахс'], - 'weekdays' => ['баскыһыанньа', 'бэнидиэнньик', 'оптуорунньук', 'сэрэдэ', 'чэппиэр', 'бээтинсэ', 'субуота'], - 'weekdays_short' => ['бс', 'бн', 'оп', 'ср', 'чп', 'бт', 'сб'], - 'weekdays_min' => ['бс', 'бн', 'оп', 'ср', 'чп', 'бт', 'сб'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/saq.php b/vendor/nesbot/carbon/src/Carbon/Lang/saq.php deleted file mode 100644 index ff8bf604..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/saq.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['Tesiran', 'Teipa'], - 'weekdays' => ['Mderot ee are', 'Mderot ee kuni', 'Mderot ee ong’wan', 'Mderot ee inet', 'Mderot ee ile', 'Mderot ee sapa', 'Mderot ee kwe'], - 'weekdays_short' => ['Are', 'Kun', 'Ong', 'Ine', 'Ile', 'Sap', 'Kwe'], - 'weekdays_min' => ['Are', 'Kun', 'Ong', 'Ine', 'Ile', 'Sap', 'Kwe'], - 'months' => ['Lapa le obo', 'Lapa le waare', 'Lapa le okuni', 'Lapa le ong’wan', 'Lapa le imet', 'Lapa le ile', 'Lapa le sapa', 'Lapa le isiet', 'Lapa le saal', 'Lapa le tomon', 'Lapa le tomon obo', 'Lapa le tomon waare'], - 'months_short' => ['Obo', 'Waa', 'Oku', 'Ong', 'Ime', 'Ile', 'Sap', 'Isi', 'Saa', 'Tom', 'Tob', 'Tow'], - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sat.php b/vendor/nesbot/carbon/src/Carbon/Lang/sat.php deleted file mode 100644 index c9914c66..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sat.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/sat_IN.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sat_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/sat_IN.php deleted file mode 100644 index 632b1af6..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sat_IN.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Red Hat Pune libc-alpha@sourceware.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'D/M/YY', - ], - 'months' => ['जनवरी', 'फरवरी', 'मार्च', 'अप्रेल', 'मई', 'जुन', 'जुलाई', 'अगस्त', 'सितम्बर', 'अखथबर', 'नवम्बर', 'दिसम्बर'], - 'months_short' => ['जनवरी', 'फरवरी', 'मार्च', 'अप्रेल', 'मई', 'जुन', 'जुलाई', 'अगस्त', 'सितम्बर', 'अखथबर', 'नवम्बर', 'दिसम्बर'], - 'weekdays' => ['सिंगेमाँहाँ', 'ओतेमाँहाँ', 'बालेमाँहाँ', 'सागुनमाँहाँ', 'सारदीमाँहाँ', 'जारुममाँहाँ', 'ञुहुममाँहाँ'], - 'weekdays_short' => ['सिंगे', 'ओते', 'बाले', 'सागुन', 'सारदी', 'जारुम', 'ञुहुम'], - 'weekdays_min' => ['सिंगे', 'ओते', 'बाले', 'सागुन', 'सारदी', 'जारुम', 'ञुहुम'], - 'day_of_first_week_of_year' => 1, - - 'month' => ':count ńindạ cando', // less reliable - 'm' => ':count ńindạ cando', // less reliable - 'a_month' => ':count ńindạ cando', // less reliable - - 'week' => ':count mãhã', // less reliable - 'w' => ':count mãhã', // less reliable - 'a_week' => ':count mãhã', // less reliable - - 'hour' => ':count ᱥᱳᱱᱚ', // less reliable - 'h' => ':count ᱥᱳᱱᱚ', // less reliable - 'a_hour' => ':count ᱥᱳᱱᱚ', // less reliable - - 'minute' => ':count ᱯᱤᱞᱪᱩ', // less reliable - 'min' => ':count ᱯᱤᱞᱪᱩ', // less reliable - 'a_minute' => ':count ᱯᱤᱞᱪᱩ', // less reliable - - 'second' => ':count ar', // less reliable - 's' => ':count ar', // less reliable - 'a_second' => ':count ar', // less reliable - - 'year' => ':count ne̲s', - 'y' => ':count ne̲s', - 'a_year' => ':count ne̲s', - - 'day' => ':count ᱫᱤᱱ', - 'd' => ':count ᱫᱤᱱ', - 'a_day' => ':count ᱫᱤᱱ', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sbp.php b/vendor/nesbot/carbon/src/Carbon/Lang/sbp.php deleted file mode 100644 index e29ca379..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sbp.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['Lwamilawu', 'Pashamihe'], - 'weekdays' => ['Mulungu', 'Jumatatu', 'Jumanne', 'Jumatano', 'Alahamisi', 'Ijumaa', 'Jumamosi'], - 'weekdays_short' => ['Mul', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Iju', 'Jmo'], - 'weekdays_min' => ['Mul', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Iju', 'Jmo'], - 'months' => ['Mupalangulwa', 'Mwitope', 'Mushende', 'Munyi', 'Mushende Magali', 'Mujimbi', 'Mushipepo', 'Mupuguto', 'Munyense', 'Mokhu', 'Musongandembwe', 'Muhaano'], - 'months_short' => ['Mup', 'Mwi', 'Msh', 'Mun', 'Mag', 'Muj', 'Msp', 'Mpg', 'Mye', 'Mok', 'Mus', 'Muh'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sc.php b/vendor/nesbot/carbon/src/Carbon/Lang/sc.php deleted file mode 100644 index 7178cf4f..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sc.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/sc_IT.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sc_IT.php b/vendor/nesbot/carbon/src/Carbon/Lang/sc_IT.php deleted file mode 100644 index 5d1e4cec..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sc_IT.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Sardinian Translators Team Massimeddu Cireddu massimeddu@gmail.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD. MM. YY', - ], - 'months' => ['Ghennàrgiu', 'Freàrgiu', 'Martzu', 'Abrile', 'Maju', 'Làmpadas', 'Argiolas//Trìulas', 'Austu', 'Cabudanni', 'Santugaine//Ladàmine', 'Onniasantu//Santandria', 'Nadale//Idas'], - 'months_short' => ['Ghe', 'Fre', 'Mar', 'Abr', 'Maj', 'Làm', 'Arg', 'Aus', 'Cab', 'Lad', 'Onn', 'Nad'], - 'weekdays' => ['Domìnigu', 'Lunis', 'Martis', 'Mèrcuris', 'Giòbia', 'Chenàbura', 'Sàbadu'], - 'weekdays_short' => ['Dom', 'Lun', 'Mar', 'Mèr', 'Giò', 'Che', 'Sàb'], - 'weekdays_min' => ['Dom', 'Lun', 'Mar', 'Mèr', 'Giò', 'Che', 'Sàb'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - - 'minute' => ':count mementu', // less reliable - 'min' => ':count mementu', // less reliable - 'a_minute' => ':count mementu', // less reliable - - 'year' => ':count annu', - 'y' => ':count annu', - 'a_year' => ':count annu', - - 'month' => ':count mese', - 'm' => ':count mese', - 'a_month' => ':count mese', - - 'week' => ':count chida', - 'w' => ':count chida', - 'a_week' => ':count chida', - - 'day' => ':count dí', - 'd' => ':count dí', - 'a_day' => ':count dí', - - 'hour' => ':count ora', - 'h' => ':count ora', - 'a_hour' => ':count ora', - - 'second' => ':count secundu', - 's' => ':count secundu', - 'a_second' => ':count secundu', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sd.php b/vendor/nesbot/carbon/src/Carbon/Lang/sd.php deleted file mode 100644 index 0022c5a9..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sd.php +++ /dev/null @@ -1,81 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -$months = [ - 'جنوري', - 'فيبروري', - 'مارچ', - 'اپريل', - 'مئي', - 'جون', - 'جولاءِ', - 'آگسٽ', - 'سيپٽمبر', - 'آڪٽوبر', - 'نومبر', - 'ڊسمبر', -]; - -$weekdays = [ - 'آچر', - 'سومر', - 'اڱارو', - 'اربع', - 'خميس', - 'جمع', - 'ڇنڇر', -]; - -/* - * Authors: - * - Narain Sagar - * - Sawood Alam - * - Narain Sagar - */ -return [ - 'year' => '{1}'.'هڪ سال'.'|:count '.'سال', - 'month' => '{1}'.'هڪ مهينو'.'|:count '.'مهينا', - 'week' => '{1}'.'ھڪ ھفتو'.'|:count '.'هفتا', - 'day' => '{1}'.'هڪ ڏينهن'.'|:count '.'ڏينهن', - 'hour' => '{1}'.'هڪ ڪلاڪ'.'|:count '.'ڪلاڪ', - 'minute' => '{1}'.'هڪ منٽ'.'|:count '.'منٽ', - 'second' => '{1}'.'چند سيڪنڊ'.'|:count '.'سيڪنڊ', - 'ago' => ':time اڳ', - 'from_now' => ':time پوء', - 'diff_yesterday' => 'ڪالهه', - 'diff_today' => 'اڄ', - 'diff_tomorrow' => 'سڀاڻي', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd، D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[اڄ] LT', - 'nextDay' => '[سڀاڻي] LT', - 'nextWeek' => 'dddd [اڳين هفتي تي] LT', - 'lastDay' => '[ڪالهه] LT', - 'lastWeek' => '[گزريل هفتي] dddd [تي] LT', - 'sameElse' => 'L', - ], - 'meridiem' => ['صبح', 'شام'], - 'months' => $months, - 'months_short' => $months, - 'weekdays' => $weekdays, - 'weekdays_short' => $weekdays, - 'weekdays_min' => $weekdays, - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => ['، ', ' ۽ '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sd_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/sd_IN.php deleted file mode 100644 index de1dad05..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sd_IN.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Red Hat, Pune bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/sd.php', [ - 'formats' => [ - 'L' => 'D/M/YY', - ], - 'months' => ['جنوري', 'فبروري', 'مارچ', 'اپريل', 'مي', 'جون', 'جولاءِ', 'آگسٽ', 'سيپٽيمبر', 'آڪٽوبر', 'نومبر', 'ڊسمبر'], - 'months_short' => ['جنوري', 'فبروري', 'مارچ', 'اپريل', 'مي', 'جون', 'جولاءِ', 'آگسٽ', 'سيپٽيمبر', 'آڪٽوبر', 'نومبر', 'ڊسمبر'], - 'weekdays' => ['آرتوارُ', 'سومرُ', 'منگلُ', 'ٻُڌرُ', 'وسپت', 'جُمو', 'ڇنڇر'], - 'weekdays_short' => ['آرتوارُ', 'سومرُ', 'منگلُ', 'ٻُڌرُ', 'وسپت', 'جُمو', 'ڇنڇر'], - 'weekdays_min' => ['آرتوارُ', 'سومرُ', 'منگلُ', 'ٻُڌرُ', 'وسپت', 'جُمو', 'ڇنڇر'], - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sd_IN@devanagari.php b/vendor/nesbot/carbon/src/Carbon/Lang/sd_IN@devanagari.php deleted file mode 100644 index 061fcc16..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sd_IN@devanagari.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Red Hat, Pune bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/sd.php', [ - 'formats' => [ - 'L' => 'D/M/YY', - ], - 'months' => ['जनवरी', 'फबरवरी', 'मार्चि', 'अप्रेल', 'मे', 'जूनि', 'जूलाइ', 'आगस्टु', 'सेप्टेंबरू', 'आक्टूबरू', 'नवंबरू', 'ॾिसंबरू'], - 'months_short' => ['जनवरी', 'फबरवरी', 'मार्चि', 'अप्रेल', 'मे', 'जूनि', 'जूलाइ', 'आगस्टु', 'सेप्टेंबरू', 'आक्टूबरू', 'नवंबरू', 'ॾिसंबरू'], - 'weekdays' => ['आर्तवारू', 'सूमरू', 'मंगलू', 'ॿुधरू', 'विस्पति', 'जुमो', 'छंछस'], - 'weekdays_short' => ['आर्तवारू', 'सूमरू', 'मंगलू', 'ॿुधरू', 'विस्पति', 'जुमो', 'छंछस'], - 'weekdays_min' => ['आर्तवारू', 'सूमरू', 'मंगलू', 'ॿुधरू', 'विस्पति', 'जुमो', 'छंछस'], - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['म.पू.', 'म.नं.'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/se.php b/vendor/nesbot/carbon/src/Carbon/Lang/se.php deleted file mode 100644 index 7c4b92a5..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/se.php +++ /dev/null @@ -1,73 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - François B - * - Karamell - */ -return [ - 'year' => '{1}:count jahki|:count jagit', - 'a_year' => '{1}okta jahki|:count jagit', - 'y' => ':count j.', - 'month' => '{1}:count mánnu|:count mánut', - 'a_month' => '{1}okta mánnu|:count mánut', - 'm' => ':count mán.', - 'week' => '{1}:count vahkku|:count vahkku', - 'a_week' => '{1}okta vahkku|:count vahkku', - 'w' => ':count v.', - 'day' => '{1}:count beaivi|:count beaivvit', - 'a_day' => '{1}okta beaivi|:count beaivvit', - 'd' => ':count b.', - 'hour' => '{1}:count diimmu|:count diimmut', - 'a_hour' => '{1}okta diimmu|:count diimmut', - 'h' => ':count d.', - 'minute' => '{1}:count minuhta|:count minuhtat', - 'a_minute' => '{1}okta minuhta|:count minuhtat', - 'min' => ':count min.', - 'second' => '{1}:count sekunddat|:count sekunddat', - 'a_second' => '{1}moadde sekunddat|:count sekunddat', - 's' => ':count s.', - 'ago' => 'maŋit :time', - 'from_now' => ':time geažes', - 'diff_yesterday' => 'ikte', - 'diff_yesterday_regexp' => 'ikte(?:\\s+ti)?', - 'diff_today' => 'otne', - 'diff_today_regexp' => 'otne(?:\\s+ti)?', - 'diff_tomorrow' => 'ihttin', - 'diff_tomorrow_regexp' => 'ihttin(?:\\s+ti)?', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD.MM.YYYY', - 'LL' => 'MMMM D. [b.] YYYY', - 'LLL' => 'MMMM D. [b.] YYYY [ti.] HH:mm', - 'LLLL' => 'dddd, MMMM D. [b.] YYYY [ti.] HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[otne ti] LT', - 'nextDay' => '[ihttin ti] LT', - 'nextWeek' => 'dddd [ti] LT', - 'lastDay' => '[ikte ti] LT', - 'lastWeek' => '[ovddit] dddd [ti] LT', - 'sameElse' => 'L', - ], - 'ordinal' => ':number.', - 'months' => ['ođđajagemánnu', 'guovvamánnu', 'njukčamánnu', 'cuoŋománnu', 'miessemánnu', 'geassemánnu', 'suoidnemánnu', 'borgemánnu', 'čakčamánnu', 'golggotmánnu', 'skábmamánnu', 'juovlamánnu'], - 'months_short' => ['ođđj', 'guov', 'njuk', 'cuo', 'mies', 'geas', 'suoi', 'borg', 'čakč', 'golg', 'skáb', 'juov'], - 'weekdays' => ['sotnabeaivi', 'vuossárga', 'maŋŋebárga', 'gaskavahkku', 'duorastat', 'bearjadat', 'lávvardat'], - 'weekdays_short' => ['sotn', 'vuos', 'maŋ', 'gask', 'duor', 'bear', 'láv'], - 'weekdays_min' => ['s', 'v', 'm', 'g', 'd', 'b', 'L'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' ja '], - 'meridiem' => ['i.b.', 'e.b.'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/se_FI.php b/vendor/nesbot/carbon/src/Carbon/Lang/se_FI.php deleted file mode 100644 index cf01805d..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/se_FI.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/se.php', [ - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD.MM.YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], - 'months' => ['ođđajagemánnu', 'guovvamánnu', 'njukčamánnu', 'cuoŋománnu', 'miessemánnu', 'geassemánnu', 'suoidnemánnu', 'borgemánnu', 'čakčamánnu', 'golggotmánnu', 'skábmamánnu', 'juovlamánnu'], - 'months_short' => ['ođđj', 'guov', 'njuk', 'cuoŋ', 'mies', 'geas', 'suoi', 'borg', 'čakč', 'golg', 'skáb', 'juov'], - 'weekdays' => ['sotnabeaivi', 'mánnodat', 'disdat', 'gaskavahkku', 'duorastat', 'bearjadat', 'lávvordat'], - 'weekdays_short' => ['so', 'má', 'di', 'ga', 'du', 'be', 'lá'], - 'weekdays_min' => ['so', 'má', 'di', 'ga', 'du', 'be', 'lá'], - 'meridiem' => ['i', 'e'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/se_NO.php b/vendor/nesbot/carbon/src/Carbon/Lang/se_NO.php deleted file mode 100644 index 177c7e94..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/se_NO.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/se.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/se_SE.php b/vendor/nesbot/carbon/src/Carbon/Lang/se_SE.php deleted file mode 100644 index 177c7e94..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/se_SE.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/se.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/seh.php b/vendor/nesbot/carbon/src/Carbon/Lang/seh.php deleted file mode 100644 index babf9afb..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/seh.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'weekdays' => ['Dimingu', 'Chiposi', 'Chipiri', 'Chitatu', 'Chinai', 'Chishanu', 'Sabudu'], - 'weekdays_short' => ['Dim', 'Pos', 'Pir', 'Tat', 'Nai', 'Sha', 'Sab'], - 'weekdays_min' => ['Dim', 'Pos', 'Pir', 'Tat', 'Nai', 'Sha', 'Sab'], - 'months' => ['Janeiro', 'Fevreiro', 'Marco', 'Abril', 'Maio', 'Junho', 'Julho', 'Augusto', 'Setembro', 'Otubro', 'Novembro', 'Decembro'], - 'months_short' => ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Aug', 'Set', 'Otu', 'Nov', 'Dec'], - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'D/M/YYYY', - 'LL' => 'd [de] MMM [de] YYYY', - 'LLL' => 'd [de] MMMM [de] YYYY HH:mm', - 'LLLL' => 'dddd, d [de] MMMM [de] YYYY HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ses.php b/vendor/nesbot/carbon/src/Carbon/Lang/ses.php deleted file mode 100644 index e1099e65..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ses.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['Adduha', 'Aluula'], - 'weekdays' => ['Alhadi', 'Atinni', 'Atalaata', 'Alarba', 'Alhamiisa', 'Alzuma', 'Asibti'], - 'weekdays_short' => ['Alh', 'Ati', 'Ata', 'Ala', 'Alm', 'Alz', 'Asi'], - 'weekdays_min' => ['Alh', 'Ati', 'Ata', 'Ala', 'Alm', 'Alz', 'Asi'], - 'months' => ['Žanwiye', 'Feewiriye', 'Marsi', 'Awiril', 'Me', 'Žuweŋ', 'Žuyye', 'Ut', 'Sektanbur', 'Oktoobur', 'Noowanbur', 'Deesanbur'], - 'months_short' => ['Žan', 'Fee', 'Mar', 'Awi', 'Me', 'Žuw', 'Žuy', 'Ut', 'Sek', 'Okt', 'Noo', 'Dee'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'D/M/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], - - 'month' => ':count alaada', // less reliable - 'm' => ':count alaada', // less reliable - 'a_month' => ':count alaada', // less reliable - - 'hour' => ':count ɲaajin', // less reliable - 'h' => ':count ɲaajin', // less reliable - 'a_hour' => ':count ɲaajin', // less reliable - - 'minute' => ':count zarbu', // less reliable - 'min' => ':count zarbu', // less reliable - 'a_minute' => ':count zarbu', // less reliable - - 'year' => ':count jiiri', - 'y' => ':count jiiri', - 'a_year' => ':count jiiri', - - 'week' => ':count jirbiiyye', - 'w' => ':count jirbiiyye', - 'a_week' => ':count jirbiiyye', - - 'day' => ':count zaari', - 'd' => ':count zaari', - 'a_day' => ':count zaari', - - 'second' => ':count ihinkante', - 's' => ':count ihinkante', - 'a_second' => ':count ihinkante', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sg.php b/vendor/nesbot/carbon/src/Carbon/Lang/sg.php deleted file mode 100644 index 9264e893..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sg.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['ND', 'LK'], - 'weekdays' => ['Bikua-ôko', 'Bïkua-ûse', 'Bïkua-ptâ', 'Bïkua-usïö', 'Bïkua-okü', 'Lâpôsö', 'Lâyenga'], - 'weekdays_short' => ['Bk1', 'Bk2', 'Bk3', 'Bk4', 'Bk5', 'Lâp', 'Lây'], - 'weekdays_min' => ['Bk1', 'Bk2', 'Bk3', 'Bk4', 'Bk5', 'Lâp', 'Lây'], - 'months' => ['Nyenye', 'Fulundïgi', 'Mbängü', 'Ngubùe', 'Bêläwü', 'Föndo', 'Lengua', 'Kükürü', 'Mvuka', 'Ngberere', 'Nabändüru', 'Kakauka'], - 'months_short' => ['Nye', 'Ful', 'Mbä', 'Ngu', 'Bêl', 'Fön', 'Len', 'Kük', 'Mvu', 'Ngb', 'Nab', 'Kak'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'D/M/YYYY', - 'LL' => 'D MMM, YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], - - 'year' => ':count dā', // less reliable - 'y' => ':count dā', // less reliable - 'a_year' => ':count dā', // less reliable - - 'week' => ':count bïkua-okü', // less reliable - 'w' => ':count bïkua-okü', // less reliable - 'a_week' => ':count bïkua-okü', // less reliable - - 'day' => ':count ziggawâ', // less reliable - 'd' => ':count ziggawâ', // less reliable - 'a_day' => ':count ziggawâ', // less reliable - - 'hour' => ':count yângâködörö', // less reliable - 'h' => ':count yângâködörö', // less reliable - 'a_hour' => ':count yângâködörö', // less reliable - - 'second' => ':count bïkua-ôko', // less reliable - 's' => ':count bïkua-ôko', // less reliable - 'a_second' => ':count bïkua-ôko', // less reliable - - 'month' => ':count Nze tî ngu', - 'm' => ':count Nze tî ngu', - 'a_month' => ':count Nze tî ngu', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sgs.php b/vendor/nesbot/carbon/src/Carbon/Lang/sgs.php deleted file mode 100644 index 864b9892..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sgs.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/sgs_LT.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sgs_LT.php b/vendor/nesbot/carbon/src/Carbon/Lang/sgs_LT.php deleted file mode 100644 index aa9e942e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sgs_LT.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Arnas Udovičius bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'YYYY.MM.DD', - ], - 'months' => ['sausė', 'vasarė', 'kuova', 'balondė', 'gegožės', 'bėrželė', 'lëpas', 'rogpjūtė', 'siejės', 'spalė', 'lapkrėstė', 'grůdė'], - 'months_short' => ['Sau', 'Vas', 'Kuo', 'Bal', 'Geg', 'Bėr', 'Lëp', 'Rgp', 'Sie', 'Spa', 'Lap', 'Grd'], - 'weekdays' => ['nedielės dëna', 'panedielis', 'oterninks', 'sereda', 'četvergs', 'petnīčė', 'sobata'], - 'weekdays_short' => ['Nd', 'Pn', 'Ot', 'Sr', 'Čt', 'Pt', 'Sb'], - 'weekdays_min' => ['Nd', 'Pn', 'Ot', 'Sr', 'Čt', 'Pt', 'Sb'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - - 'minute' => ':count mažos', // less reliable - 'min' => ':count mažos', // less reliable - 'a_minute' => ':count mažos', // less reliable - - 'year' => ':count metā', - 'y' => ':count metā', - 'a_year' => ':count metā', - - 'month' => ':count mienou', - 'm' => ':count mienou', - 'a_month' => ':count mienou', - - 'week' => ':count nedielė', - 'w' => ':count nedielė', - 'a_week' => ':count nedielė', - - 'day' => ':count dīna', - 'd' => ':count dīna', - 'a_day' => ':count dīna', - - 'hour' => ':count adīna', - 'h' => ':count adīna', - 'a_hour' => ':count adīna', - - 'second' => ':count Sekondė', - 's' => ':count Sekondė', - 'a_second' => ':count Sekondė', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sh.php b/vendor/nesbot/carbon/src/Carbon/Lang/sh.php deleted file mode 100644 index e4aa5a1c..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sh.php +++ /dev/null @@ -1,68 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -// @codeCoverageIgnoreStart -use Symfony\Component\Translation\PluralizationRules; - -if (class_exists('Symfony\\Component\\Translation\\PluralizationRules')) { - PluralizationRules::set(function ($number) { - return (($number % 10 == 1) && ($number % 100 != 11)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2); - }, 'sh'); -} -// @codeCoverageIgnoreEnd - -/* - * Authors: - * - Томица Кораћ - * - Enrique Vidal - * - Christopher Dell - * - dmilisic - * - danijel - * - Miroslav Matkovic (mikki021) - */ -return [ - 'diff_now' => 'sada', - 'diff_yesterday' => 'juče', - 'diff_tomorrow' => 'sutra', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'MMMM D, YYYY', - 'LLL' => 'DD MMM HH:mm', - 'LLLL' => 'MMMM DD, YYYY HH:mm', - ], - 'year' => ':count godina|:count godine|:count godina', - 'y' => ':count g.', - 'month' => ':count mesec|:count meseca|:count meseci', - 'm' => ':count m.', - 'week' => ':count nedelja|:count nedelje|:count nedelja', - 'w' => ':count n.', - 'day' => ':count dan|:count dana|:count dana', - 'd' => ':count d.', - 'hour' => ':count sat|:count sata|:count sati', - 'h' => ':count č.', - 'minute' => ':count minut|:count minuta|:count minuta', - 'min' => ':count min.', - 'second' => ':count sekund|:count sekunde|:count sekundi', - 's' => ':count s.', - 'ago' => 'pre :time', - 'from_now' => 'za :time', - 'after' => 'nakon :time', - 'before' => ':time raniјe', - 'weekdays' => ['Nedelja', 'Ponedeljak', 'Utorak', 'Sreda', 'Četvrtak', 'Petak', 'Subota'], - 'weekdays_short' => ['Ned', 'Pon', 'Uto', 'Sre', 'Čet', 'Pet', 'Sub'], - 'weekdays_min' => ['Ned', 'Pon', 'Uto', 'Sre', 'Čet', 'Pet', 'Sub'], - 'months' => ['Januar', 'Februar', 'Mart', 'April', 'Maj', 'Jun', 'Jul', 'Avgust', 'Septembar', 'Oktobar', 'Novembar', 'Decembar'], - 'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'Maj', 'Jun', 'Jul', 'Avg', 'Sep', 'Okt', 'Nov', 'Dec'], - 'list' => [', ', ' i '], - 'meridiem' => ['pre podne', 'po podne'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/shi.php b/vendor/nesbot/carbon/src/Carbon/Lang/shi.php deleted file mode 100644 index 78151869..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/shi.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['ⵜⵉⴼⴰⵡⵜ', 'ⵜⴰⴷⴳⴳⵯⴰⵜ'], - 'weekdays' => ['ⴰⵙⴰⵎⴰⵙ', 'ⴰⵢⵏⴰⵙ', 'ⴰⵙⵉⵏⴰⵙ', 'ⴰⴽⵕⴰⵙ', 'ⴰⴽⵡⴰⵙ', 'ⵙⵉⵎⵡⴰⵙ', 'ⴰⵙⵉⴹⵢⴰⵙ'], - 'weekdays_short' => ['ⴰⵙⴰ', 'ⴰⵢⵏ', 'ⴰⵙⵉ', 'ⴰⴽⵕ', 'ⴰⴽⵡ', 'ⴰⵙⵉⵎ', 'ⴰⵙⵉⴹ'], - 'weekdays_min' => ['ⴰⵙⴰ', 'ⴰⵢⵏ', 'ⴰⵙⵉ', 'ⴰⴽⵕ', 'ⴰⴽⵡ', 'ⴰⵙⵉⵎ', 'ⴰⵙⵉⴹ'], - 'months' => ['ⵉⵏⵏⴰⵢⵔ', 'ⴱⵕⴰⵢⵕ', 'ⵎⴰⵕⵚ', 'ⵉⴱⵔⵉⵔ', 'ⵎⴰⵢⵢⵓ', 'ⵢⵓⵏⵢⵓ', 'ⵢⵓⵍⵢⵓⵣ', 'ⵖⵓⵛⵜ', 'ⵛⵓⵜⴰⵏⴱⵉⵔ', 'ⴽⵜⵓⴱⵔ', 'ⵏⵓⵡⴰⵏⴱⵉⵔ', 'ⴷⵓⵊⴰⵏⴱⵉⵔ'], - 'months_short' => ['ⵉⵏⵏ', 'ⴱⵕⴰ', 'ⵎⴰⵕ', 'ⵉⴱⵔ', 'ⵎⴰⵢ', 'ⵢⵓⵏ', 'ⵢⵓⵍ', 'ⵖⵓⵛ', 'ⵛⵓⵜ', 'ⴽⵜⵓ', 'ⵏⵓⵡ', 'ⴷⵓⵊ'], - 'first_day_of_week' => 6, - 'weekend' => [5, 6], - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'D/M/YYYY', - 'LL' => 'D MMM, YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], - - 'year' => ':count aseggwas', - 'y' => ':count aseggwas', - 'a_year' => ':count aseggwas', - - 'month' => ':count ayyur', - 'm' => ':count ayyur', - 'a_month' => ':count ayyur', - - 'week' => ':count imalass', - 'w' => ':count imalass', - 'a_week' => ':count imalass', - - 'day' => ':count ass', - 'd' => ':count ass', - 'a_day' => ':count ass', - - 'hour' => ':count urɣ', // less reliable - 'h' => ':count urɣ', // less reliable - 'a_hour' => ':count urɣ', // less reliable - - 'minute' => ':count ⴰⵎⵥⵉ', // less reliable - 'min' => ':count ⴰⵎⵥⵉ', // less reliable - 'a_minute' => ':count ⴰⵎⵥⵉ', // less reliable - - 'second' => ':count sin', // less reliable - 's' => ':count sin', // less reliable - 'a_second' => ':count sin', // less reliable -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/shi_Latn.php b/vendor/nesbot/carbon/src/Carbon/Lang/shi_Latn.php deleted file mode 100644 index cddfb242..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/shi_Latn.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/shi.php', [ - 'meridiem' => ['tifawt', 'tadggʷat'], - 'weekdays' => ['asamas', 'aynas', 'asinas', 'akṛas', 'akwas', 'asimwas', 'asiḍyas'], - 'weekdays_short' => ['asa', 'ayn', 'asi', 'akṛ', 'akw', 'asim', 'asiḍ'], - 'weekdays_min' => ['asa', 'ayn', 'asi', 'akṛ', 'akw', 'asim', 'asiḍ'], - 'months' => ['innayr', 'bṛayṛ', 'maṛṣ', 'ibrir', 'mayyu', 'yunyu', 'yulyuz', 'ɣuct', 'cutanbir', 'ktubr', 'nuwanbir', 'dujanbir'], - 'months_short' => ['inn', 'bṛa', 'maṛ', 'ibr', 'may', 'yun', 'yul', 'ɣuc', 'cut', 'ktu', 'nuw', 'duj'], - 'first_day_of_week' => 6, - 'weekend' => [5, 6], - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'D/M/YYYY', - 'LL' => 'D MMM, YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], - - 'minute' => ':count agur', // less reliable - 'min' => ':count agur', // less reliable - 'a_minute' => ':count agur', // less reliable -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/shi_Tfng.php b/vendor/nesbot/carbon/src/Carbon/Lang/shi_Tfng.php deleted file mode 100644 index f3df1f2c..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/shi_Tfng.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/shi.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/shn.php b/vendor/nesbot/carbon/src/Carbon/Lang/shn.php deleted file mode 100644 index fe7b1ea5..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/shn.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/shn_MM.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/shn_MM.php b/vendor/nesbot/carbon/src/Carbon/Lang/shn_MM.php deleted file mode 100644 index f399acf0..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/shn_MM.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - ubuntu Myanmar LoCo Team https://ubuntu-mm.net Bone Pyae Sone bone.burma@mail.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'OY MMM OD dddd', - ], - 'months' => ['လိူၼ်ၵမ်', 'လိူၼ်သၢမ်', 'လိူၼ်သီ', 'လိူၼ်ႁႃႈ', 'လိူၼ်ႁူၵ်း', 'လိူၼ်ၸဵတ်း', 'လိူၼ်ပႅတ်ႇ', 'လိူၼ်ၵဝ်ႈ', 'လိူၼ်သိပ်း', 'လိူၼ်သိပ်းဢိတ်း', 'လိူၼ်သိပ်းဢိတ်းသွင်', 'လိူၼ်ၸဵင်'], - 'months_short' => ['လိူၼ်ၵမ်', 'လိူၼ်သၢမ်', 'လိူၼ်သီ', 'လိူၼ်ႁႃႈ', 'လိူၼ်ႁူၵ်း', 'လိူၼ်ၸဵတ်း', 'လိူၼ်ပႅတ်ႇ', 'လိူၼ်ၵဝ်ႈ', 'လိူၼ်သိပ်း', 'လိူၼ်သိပ်းဢိတ်း', 'လိူၼ်သိပ်းဢိတ်းသွင်', 'လိူၼ်ၸဵင်'], - 'weekdays' => ['ဝၼ်းဢႃးတိတ်ႉ', 'ဝၼ်းၸၼ်', 'ဝၼ်း​ဢၢင်း​ၵၢၼ်း', 'ဝၼ်းပူတ်ႉ', 'ဝၼ်းၽတ်း', 'ဝၼ်းသုၵ်း', 'ဝၼ်းသဝ်'], - 'weekdays_short' => ['တိတ့်', 'ၸၼ်', 'ၵၢၼ်း', 'ပုတ့်', 'ၽတ်း', 'သုၵ်း', 'သဝ်'], - 'weekdays_min' => ['တိတ့်', 'ၸၼ်', 'ၵၢၼ်း', 'ပုတ့်', 'ၽတ်း', 'သုၵ်း', 'သဝ်'], - 'alt_numbers' => ['႐႐', '႐႑', '႐႒', '႐႓', '႐႔', '႐႕', '႐႖', '႐႗', '႐႘', '႐႙', '႑႐', '႑႑', '႑႒', '႑႓', '႑႔', '႑႕', '႑႖', '႑႗', '႑႘', '႑႙', '႒႐', '႒႑', '႒႒', '႒႓', '႒႔', '႒႕', '႒႖', '႒႗', '႒႘', '႒႙', '႓႐', '႓႑', '႓႒', '႓႓', '႓႔', '႓႕', '႓႖', '႓႗', '႓႘', '႓႙', '႔႐', '႔႑', '႔႒', '႔႓', '႔႔', '႔႕', '႔႖', '႔႗', '႔႘', '႔႙', '႕႐', '႕႑', '႕႒', '႕႓', '႕႔', '႕႕', '႕႖', '႕႗', '႕႘', '႕႙', '႖႐', '႖႑', '႖႒', '႖႓', '႖႔', '႖႕', '႖႖', '႖႗', '႖႘', '႖႙', '႗႐', '႗႑', '႗႒', '႗႓', '႗႔', '႗႕', '႗႖', '႗႗', '႗႘', '႗႙', '႘႐', '႘႑', '႘႒', '႘႓', '႘႔', '႘႕', '႘႖', '႘႗', '႘႘', '႘႙', '႙႐', '႙႑', '႙႒', '႙႓', '႙႔', '႙႕', '႙႖', '႙႗', '႙႘', '႙႙'], - 'meridiem' => ['ၵၢင်ၼႂ်', 'တၢမ်းၶမ်ႈ'], - - 'month' => ':count လိူၼ်', // less reliable - 'm' => ':count လိူၼ်', // less reliable - 'a_month' => ':count လိူၼ်', // less reliable - - 'week' => ':count ဝၼ်း', // less reliable - 'w' => ':count ဝၼ်း', // less reliable - 'a_week' => ':count ဝၼ်း', // less reliable - - 'hour' => ':count ຕີ', // less reliable - 'h' => ':count ຕີ', // less reliable - 'a_hour' => ':count ຕີ', // less reliable - - 'minute' => ':count ເດັກ', // less reliable - 'min' => ':count ເດັກ', // less reliable - 'a_minute' => ':count ເດັກ', // less reliable - - 'second' => ':count ဢိုၼ်ႇ', // less reliable - 's' => ':count ဢိုၼ်ႇ', // less reliable - 'a_second' => ':count ဢိုၼ်ႇ', // less reliable - - 'year' => ':count ပီ', - 'y' => ':count ပီ', - 'a_year' => ':count ပီ', - - 'day' => ':count ກາງວັນ', - 'd' => ':count ກາງວັນ', - 'a_day' => ':count ກາງວັນ', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/shs.php b/vendor/nesbot/carbon/src/Carbon/Lang/shs.php deleted file mode 100644 index 8d2e1d7d..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/shs.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/shs_CA.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/shs_CA.php b/vendor/nesbot/carbon/src/Carbon/Lang/shs_CA.php deleted file mode 100644 index 08d385e6..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/shs_CA.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Neskie Manuel bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YY', - ], - 'months' => ['Pellkwet̓min', 'Pelctsipwen̓ten', 'Pellsqépts', 'Peslléwten', 'Pell7ell7é7llqten', 'Pelltspéntsk', 'Pelltqwelq̓wél̓t', 'Pellct̓éxel̓cten', 'Pesqelqlélten', 'Pesllwélsten', 'Pellc7ell7é7llcwten̓', 'Pelltetétq̓em'], - 'months_short' => ['Kwe', 'Tsi', 'Sqe', 'Éwt', 'Ell', 'Tsp', 'Tqw', 'Ct̓é', 'Qel', 'Wél', 'U7l', 'Tet'], - 'weekdays' => ['Sxetspesq̓t', 'Spetkesq̓t', 'Selesq̓t', 'Skellesq̓t', 'Smesesq̓t', 'Stselkstesq̓t', 'Stqmekstesq̓t'], - 'weekdays_short' => ['Sxe', 'Spe', 'Sel', 'Ske', 'Sme', 'Sts', 'Stq'], - 'weekdays_min' => ['Sxe', 'Spe', 'Sel', 'Ske', 'Sme', 'Sts', 'Stq'], - 'day_of_first_week_of_year' => 1, - - 'year' => ':count sqlélten', // less reliable - 'y' => ':count sqlélten', // less reliable - 'a_year' => ':count sqlélten', // less reliable - - 'month' => ':count swewll', // less reliable - 'm' => ':count swewll', // less reliable - 'a_month' => ':count swewll', // less reliable - - 'hour' => ':count seqwlút', // less reliable - 'h' => ':count seqwlút', // less reliable - 'a_hour' => ':count seqwlút', // less reliable -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/si.php b/vendor/nesbot/carbon/src/Carbon/Lang/si.php deleted file mode 100644 index 636bf691..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/si.php +++ /dev/null @@ -1,78 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - François B - * - Serhan Apaydın - * - JD Isaacks - * - Malinda Weerasinghe (MalindaWMD) - */ -return [ - 'year' => '{1}වසර 1|වසර :count', - 'a_year' => '{1}වසරක්|වසර :count', - 'month' => '{1}මාස 1|මාස :count', - 'a_month' => '{1}මාසය|මාස :count', - 'week' => '{1}සති 1|සති :count', - 'a_week' => '{1}සතියක්|සති :count', - 'day' => '{1}දින 1|දින :count', - 'a_day' => '{1}දිනක්|දින :count', - 'hour' => '{1}පැය 1|පැය :count', - 'a_hour' => '{1}පැයක්|පැය :count', - 'minute' => '{1}මිනිත්තු 1|මිනිත්තු :count', - 'a_minute' => '{1}මිනිත්තුවක්|මිනිත්තු :count', - 'second' => '{1}තත්පර 1|තත්පර :count', - 'a_second' => '{1}තත්පර කිහිපයකට|තත්පර :count', - 'ago' => ':time කට පෙර', - 'from_now' => function ($time) { - if (preg_match('/දින \d/u', $time)) { - return $time.' න්'; - } - - return $time.' කින්'; - }, - 'before' => ':time කට පෙර', - 'after' => function ($time) { - if (preg_match('/දින \d/u', $time)) { - return $time.' න්'; - } - - return $time.' කින්'; - }, - 'diff_now' => 'දැන්', - 'diff_today' => 'අද', - 'diff_yesterday' => 'ඊයේ', - 'diff_tomorrow' => 'හෙට', - 'formats' => [ - 'LT' => 'a h:mm', - 'LTS' => 'a h:mm:ss', - 'L' => 'YYYY/MM/DD', - 'LL' => 'YYYY MMMM D', - 'LLL' => 'YYYY MMMM D, a h:mm', - 'LLLL' => 'YYYY MMMM D [වැනි] dddd, a h:mm:ss', - ], - 'calendar' => [ - 'sameDay' => '[අද] LT[ට]', - 'nextDay' => '[හෙට] LT[ට]', - 'nextWeek' => 'dddd LT[ට]', - 'lastDay' => '[ඊයේ] LT[ට]', - 'lastWeek' => '[පසුගිය] dddd LT[ට]', - 'sameElse' => 'L', - ], - 'ordinal' => ':number වැනි', - 'meridiem' => ['පෙර වරු', 'පස් වරු', 'පෙ.ව.', 'ප.ව.'], - 'months' => ['ජනවාරි', 'පෙබරවාරි', 'මාර්තු', 'අප්‍රේල්', 'මැයි', 'ජූනි', 'ජූලි', 'අගෝස්තු', 'සැප්තැම්බර්', 'ඔක්තෝබර්', 'නොවැම්බර්', 'දෙසැම්බර්'], - 'months_short' => ['ජන', 'පෙබ', 'මාර්', 'අප්', 'මැයි', 'ජූනි', 'ජූලි', 'අගෝ', 'සැප්', 'ඔක්', 'නොවැ', 'දෙසැ'], - 'weekdays' => ['ඉරිදා', 'සඳුදා', 'අඟහරුවාදා', 'බදාදා', 'බ්‍රහස්පතින්දා', 'සිකුරාදා', 'සෙනසුරාදා'], - 'weekdays_short' => ['ඉරි', 'සඳු', 'අඟ', 'බදා', 'බ්‍රහ', 'සිකු', 'සෙන'], - 'weekdays_min' => ['ඉ', 'ස', 'අ', 'බ', 'බ්‍ර', 'සි', 'සෙ'], - 'first_day_of_week' => 1, -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/si_LK.php b/vendor/nesbot/carbon/src/Carbon/Lang/si_LK.php deleted file mode 100644 index 81c44e0e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/si_LK.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/si.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sid.php b/vendor/nesbot/carbon/src/Carbon/Lang/sid.php deleted file mode 100644 index b1c65218..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sid.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/sid_ET.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sid_ET.php b/vendor/nesbot/carbon/src/Carbon/Lang/sid_ET.php deleted file mode 100644 index 1296f9be..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sid_ET.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Ge'ez Frontier Foundation locales@geez.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YYYY', - ], - 'months' => ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], - 'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], - 'weekdays' => ['Sambata', 'Sanyo', 'Maakisanyo', 'Roowe', 'Hamuse', 'Arbe', 'Qidaame'], - 'weekdays_short' => ['Sam', 'San', 'Mak', 'Row', 'Ham', 'Arb', 'Qid'], - 'weekdays_min' => ['Sam', 'San', 'Mak', 'Row', 'Ham', 'Arb', 'Qid'], - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['soodo', 'hawwaro'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sk.php b/vendor/nesbot/carbon/src/Carbon/Lang/sk.php deleted file mode 100644 index 08af197c..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sk.php +++ /dev/null @@ -1,83 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Philippe Vaucher - * - Martin Suja - * - Tsutomu Kuroda - * - tjku - * - Max Melentiev - * - Juanito Fatas - * - Ivan Stana - * - Akira Matsuda - * - Christopher Dell - * - James McKinney - * - Enrique Vidal - * - Simone Carletti - * - Aaron Patterson - * - Jozef Fulop - * - Nicolás Hock Isaza - * - Tom Hughes - * - Simon Hürlimann (CyT) - * - jofi - * - Jakub ADAMEC - * - Marek Adamický - * - AlterwebStudio - */ -return [ - 'year' => 'rok|:count roky|:count rokov', - 'y' => ':count r', - 'month' => 'mesiac|:count mesiace|:count mesiacov', - 'm' => ':count m', - 'week' => 'týždeň|:count týždne|:count týždňov', - 'w' => ':count t', - 'day' => 'deň|:count dni|:count dní', - 'd' => ':count d', - 'hour' => 'hodinu|:count hodiny|:count hodín', - 'h' => ':count h', - 'minute' => 'minútu|:count minúty|:count minút', - 'min' => ':count min', - 'second' => 'sekundu|:count sekundy|:count sekúnd', - 'a_second' => 'pár sekúnd|:count sekundy|:count sekúnd', - 's' => ':count s', - 'ago' => 'pred :time', - 'from_now' => 'o :time', - 'after' => ':time po', - 'before' => ':time pred', - 'year_ago' => 'rokom|:count rokmi|:count rokmi', - 'month_ago' => 'mesiacom|:count mesiacmi|:count mesiacmi', - 'week_ago' => 'týždňom|:count týždňami|:count týždňami', - 'day_ago' => 'dňom|:count dňami|:count dňami', - 'hour_ago' => 'hodinou|:count hodinami|:count hodinami', - 'minute_ago' => 'minútou|:count minútami|:count minútami', - 'second_ago' => 'sekundou|:count sekundami|:count sekundami', - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' a '], - 'diff_now' => 'teraz', - 'diff_yesterday' => 'včera', - 'diff_tomorrow' => 'zajtra', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD.MM.YYYY', - 'LL' => 'DD. MMMM YYYY', - 'LLL' => 'D. M. HH:mm', - 'LLLL' => 'dddd D. MMMM YYYY HH:mm', - ], - 'weekdays' => ['nedeľa', 'pondelok', 'utorok', 'streda', 'štvrtok', 'piatok', 'sobota'], - 'weekdays_short' => ['ned', 'pod', 'uto', 'str', 'štv', 'pia', 'sob'], - 'weekdays_min' => ['ne', 'po', 'ut', 'st', 'št', 'pi', 'so'], - 'months' => ['január', 'február', 'marec', 'apríl', 'máj', 'jún', 'júl', 'august', 'september', 'október', 'november', 'december'], - 'months_short' => ['jan', 'feb', 'mar', 'apr', 'máj', 'jún', 'júl', 'aug', 'sep', 'okt', 'nov', 'dec'], - 'meridiem' => ['dopoludnia', 'popoludní'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sk_SK.php b/vendor/nesbot/carbon/src/Carbon/Lang/sk_SK.php deleted file mode 100644 index 0515601a..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sk_SK.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/sk.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sl.php b/vendor/nesbot/carbon/src/Carbon/Lang/sl.php deleted file mode 100644 index b000e30e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sl.php +++ /dev/null @@ -1,129 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Philippe Vaucher - * - Tsutomu Kuroda - * - tjku - * - Max Melentiev - * - Juanito Fatas - * - Akira Matsuda - * - Christopher Dell - * - Enrique Vidal - * - Simone Carletti - * - Aaron Patterson - * - Nicolás Hock Isaza - * - Miha Rebernik - * - Gal Jakič (morpheus7CS) - * - Glavić - * - Anže Časar - * - Lovro Tramšek (Lovro1107) - * - burut13 - */ - -use Carbon\CarbonInterface; - -return [ - 'year' => ':count leto|:count leti|:count leta|:count let', - 'y' => ':count leto|:count leti|:count leta|:count let', - 'month' => ':count mesec|:count meseca|:count mesece|:count mesecev', - 'm' => ':count mes.', - 'week' => ':count teden|:count tedna|:count tedne|:count tednov', - 'w' => ':count ted.', - 'day' => ':count dan|:count dni|:count dni|:count dni', - 'd' => ':count dan|:count dni|:count dni|:count dni', - 'hour' => ':count ura|:count uri|:count ure|:count ur', - 'h' => ':count h', - 'minute' => ':count minuta|:count minuti|:count minute|:count minut', - 'min' => ':count min.', - 'second' => ':count sekunda|:count sekundi|:count sekunde|:count sekund', - 'a_second' => '{1}nekaj sekund|:count sekunda|:count sekundi|:count sekunde|:count sekund', - 's' => ':count s', - - 'year_ago' => ':count letom|:count letoma|:count leti|:count leti', - 'y_ago' => ':count letom|:count letoma|:count leti|:count leti', - 'month_ago' => ':count mesecem|:count meseci|:count meseci|:count meseci', - 'week_ago' => ':count tednom|:count tednoma|:count tedni|:count tedni', - 'day_ago' => ':count dnem|:count dnevoma|:count dnevi|:count dnevi', - 'd_ago' => ':count dnem|:count dnevoma|:count dnevi|:count dnevi', - 'hour_ago' => ':count uro|:count urama|:count urami|:count urami', - 'minute_ago' => ':count minuto|:count minutama|:count minutami|:count minutami', - 'second_ago' => ':count sekundo|:count sekundama|:count sekundami|:count sekundami', - - 'day_from_now' => ':count dan|:count dneva|:count dni|:count dni', - 'd_from_now' => ':count dan|:count dneva|:count dni|:count dni', - 'hour_from_now' => ':count uro|:count uri|:count ure|:count ur', - 'minute_from_now' => ':count minuto|:count minuti|:count minute|:count minut', - 'second_from_now' => ':count sekundo|:count sekundi|:count sekunde|:count sekund', - - 'ago' => 'pred :time', - 'from_now' => 'čez :time', - 'after' => ':time kasneje', - 'before' => ':time prej', - - 'diff_now' => 'ravnokar', - 'diff_today' => 'danes', - 'diff_today_regexp' => 'danes(?:\\s+ob)?', - 'diff_yesterday' => 'včeraj', - 'diff_yesterday_regexp' => 'včeraj(?:\\s+ob)?', - 'diff_tomorrow' => 'jutri', - 'diff_tomorrow_regexp' => 'jutri(?:\\s+ob)?', - 'diff_before_yesterday' => 'predvčerajšnjim', - 'diff_after_tomorrow' => 'pojutrišnjem', - - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - - 'period_start_date' => 'od :date', - 'period_end_date' => 'do :date', - - 'formats' => [ - 'LT' => 'H:mm', - 'LTS' => 'H:mm:ss', - 'L' => 'DD.MM.YYYY', - 'LL' => 'D. MMMM YYYY', - 'LLL' => 'D. MMMM YYYY H:mm', - 'LLLL' => 'dddd, D. MMMM YYYY H:mm', - ], - 'calendar' => [ - 'sameDay' => '[danes ob] LT', - 'nextDay' => '[jutri ob] LT', - 'nextWeek' => 'dddd [ob] LT', - 'lastDay' => '[včeraj ob] LT', - 'lastWeek' => function (CarbonInterface $date) { - switch ($date->dayOfWeek) { - case 0: - return '[preteklo] [nedeljo] [ob] LT'; - case 1: - return '[pretekli] [ponedeljek] [ob] LT'; - case 2: - return '[pretekli] [torek] [ob] LT'; - case 3: - return '[preteklo] [sredo] [ob] LT'; - case 4: - return '[pretekli] [četrtek] [ob] LT'; - case 5: - return '[pretekli] [petek] [ob] LT'; - case 6: - return '[preteklo] [soboto] [ob] LT'; - } - }, - 'sameElse' => 'L', - ], - 'months' => ['januar', 'februar', 'marec', 'april', 'maj', 'junij', 'julij', 'avgust', 'september', 'oktober', 'november', 'december'], - 'months_short' => ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'avg', 'sep', 'okt', 'nov', 'dec'], - 'weekdays' => ['nedelja', 'ponedeljek', 'torek', 'sreda', 'četrtek', 'petek', 'sobota'], - 'weekdays_short' => ['ned', 'pon', 'tor', 'sre', 'čet', 'pet', 'sob'], - 'weekdays_min' => ['ne', 'po', 'to', 'sr', 'če', 'pe', 'so'], - 'list' => [', ', ' in '], - 'meridiem' => ['dopoldan', 'popoldan'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sl_SI.php b/vendor/nesbot/carbon/src/Carbon/Lang/sl_SI.php deleted file mode 100644 index 5dad8c81..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sl_SI.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/sl.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sm.php b/vendor/nesbot/carbon/src/Carbon/Lang/sm.php deleted file mode 100644 index e8c118ac..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sm.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/sm_WS.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sm_WS.php b/vendor/nesbot/carbon/src/Carbon/Lang/sm_WS.php deleted file mode 100644 index f0660687..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sm_WS.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Samsung Electronics Co., Ltd. akhilesh.k@samsung.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YYYY', - ], - 'months' => ['Ianuari', 'Fepuari', 'Mati', 'Aperila', 'Me', 'Iuni', 'Iulai', 'Auguso', 'Setema', 'Oketopa', 'Novema', 'Tesema'], - 'months_short' => ['Ian', 'Fep', 'Mat', 'Ape', 'Me', 'Iun', 'Iul', 'Aug', 'Set', 'Oke', 'Nov', 'Tes'], - 'weekdays' => ['Aso Sa', 'Aso Gafua', 'Aso Lua', 'Aso Lulu', 'Aso Tofi', 'Aso Farail', 'Aso To\'ana\'i'], - 'weekdays_short' => ['Aso Sa', 'Aso Gaf', 'Aso Lua', 'Aso Lul', 'Aso Tof', 'Aso Far', 'Aso To\''], - 'weekdays_min' => ['Aso Sa', 'Aso Gaf', 'Aso Lua', 'Aso Lul', 'Aso Tof', 'Aso Far', 'Aso To\''], - - 'hour' => ':count uati', // less reliable - 'h' => ':count uati', // less reliable - 'a_hour' => ':count uati', // less reliable - - 'minute' => ':count itiiti', // less reliable - 'min' => ':count itiiti', // less reliable - 'a_minute' => ':count itiiti', // less reliable - - 'second' => ':count lua', // less reliable - 's' => ':count lua', // less reliable - 'a_second' => ':count lua', // less reliable - - 'year' => ':count tausaga', - 'y' => ':count tausaga', - 'a_year' => ':count tausaga', - - 'month' => ':count māsina', - 'm' => ':count māsina', - 'a_month' => ':count māsina', - - 'week' => ':count vaiaso', - 'w' => ':count vaiaso', - 'a_week' => ':count vaiaso', - - 'day' => ':count aso', - 'd' => ':count aso', - 'a_day' => ':count aso', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/smn.php b/vendor/nesbot/carbon/src/Carbon/Lang/smn.php deleted file mode 100644 index 20add023..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/smn.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['ip.', 'ep.'], - 'weekdays' => ['pasepeeivi', 'vuossaargâ', 'majebaargâ', 'koskoho', 'tuorâstuv', 'vástuppeeivi', 'lávurduv'], - 'weekdays_short' => ['pas', 'vuo', 'maj', 'kos', 'tuo', 'vás', 'láv'], - 'weekdays_min' => ['pa', 'vu', 'ma', 'ko', 'tu', 'vá', 'lá'], - 'weekdays_standalone' => ['pasepeivi', 'vuossargâ', 'majebargâ', 'koskokko', 'tuorâstâh', 'vástuppeivi', 'lávurdâh'], - 'months' => ['uđđâivemáánu', 'kuovâmáánu', 'njuhčâmáánu', 'cuáŋuimáánu', 'vyesimáánu', 'kesimáánu', 'syeinimáánu', 'porgemáánu', 'čohčâmáánu', 'roovvâdmáánu', 'skammâmáánu', 'juovlâmáánu'], - 'months_short' => ['uđiv', 'kuovâ', 'njuhčâ', 'cuáŋui', 'vyesi', 'kesi', 'syeini', 'porge', 'čohčâ', 'roovvâd', 'skammâ', 'juovlâ'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'H.mm', - 'LTS' => 'H.mm.ss', - 'L' => 'D.M.YYYY', - 'LL' => 'MMM D. YYYY', - 'LLL' => 'MMMM D. YYYY H.mm', - 'LLLL' => 'dddd, MMMM D. YYYY H.mm', - ], - - 'hour' => ':count äigi', // less reliable - 'h' => ':count äigi', // less reliable - 'a_hour' => ':count äigi', // less reliable - - 'year' => ':count ihe', - 'y' => ':count ihe', - 'a_year' => ':count ihe', - - 'month' => ':count mánuppaje', - 'm' => ':count mánuppaje', - 'a_month' => ':count mánuppaje', - - 'week' => ':count okko', - 'w' => ':count okko', - 'a_week' => ':count okko', - - 'day' => ':count peivi', - 'd' => ':count peivi', - 'a_day' => ':count peivi', - - 'minute' => ':count miinut', - 'min' => ':count miinut', - 'a_minute' => ':count miinut', - - 'second' => ':count nubbe', - 's' => ':count nubbe', - 'a_second' => ':count nubbe', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sn.php b/vendor/nesbot/carbon/src/Carbon/Lang/sn.php deleted file mode 100644 index 4f25028a..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sn.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['a', 'p'], - 'weekdays' => ['Svondo', 'Muvhuro', 'Chipiri', 'Chitatu', 'China', 'Chishanu', 'Mugovera'], - 'weekdays_short' => ['Svo', 'Muv', 'Chp', 'Cht', 'Chn', 'Chs', 'Mug'], - 'weekdays_min' => ['Sv', 'Mu', 'Cp', 'Ct', 'Cn', 'Cs', 'Mg'], - 'months' => ['Ndira', 'Kukadzi', 'Kurume', 'Kubvumbi', 'Chivabvu', 'Chikumi', 'Chikunguru', 'Nyamavhuvhu', 'Gunyana', 'Gumiguru', 'Mbudzi', 'Zvita'], - 'months_short' => ['Ndi', 'Kuk', 'Kur', 'Kub', 'Chv', 'Chk', 'Chg', 'Nya', 'Gun', 'Gum', 'Mbu', 'Zvi'], - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'YYYY-MM-dd', - 'LL' => 'YYYY MMM D', - 'LLL' => 'YYYY MMMM D HH:mm', - 'LLLL' => 'YYYY MMMM D, dddd HH:mm', - ], - - 'year' => 'makore :count', - 'y' => 'makore :count', - 'a_year' => 'makore :count', - - 'month' => 'mwedzi :count', - 'm' => 'mwedzi :count', - 'a_month' => 'mwedzi :count', - - 'week' => 'vhiki :count', - 'w' => 'vhiki :count', - 'a_week' => 'vhiki :count', - - 'day' => 'mazuva :count', - 'd' => 'mazuva :count', - 'a_day' => 'mazuva :count', - - 'hour' => 'maawa :count', - 'h' => 'maawa :count', - 'a_hour' => 'maawa :count', - - 'minute' => 'minitsi :count', - 'min' => 'minitsi :count', - 'a_minute' => 'minitsi :count', - - 'second' => 'sekonzi :count', - 's' => 'sekonzi :count', - 'a_second' => 'sekonzi :count', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/so.php b/vendor/nesbot/carbon/src/Carbon/Lang/so.php deleted file mode 100644 index 57852719..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/so.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Author: - * - Abdifatah Abdilahi(@abdifatahz) - */ -return [ - 'year' => ':count sanad|:count sanadood', - 'a_year' => 'sanad|:count sanadood', - 'y' => '{1}:countsn|{0}:countsns|]1,Inf[:countsn', - 'month' => ':count bil|:count bilood', - 'a_month' => 'bil|:count bilood', - 'm' => ':countbil', - 'week' => ':count isbuuc', - 'a_week' => 'isbuuc|:count isbuuc', - 'w' => ':countis', - 'day' => ':count maalin|:count maalmood', - 'a_day' => 'maalin|:count maalmood', - 'd' => ':countml', - 'hour' => ':count saac', - 'a_hour' => 'saacad|:count saac', - 'h' => ':countsc', - 'minute' => ':count daqiiqo', - 'a_minute' => 'daqiiqo|:count daqiiqo', - 'min' => ':countdq', - 'second' => ':count ilbidhiqsi', - 'a_second' => 'xooga ilbidhiqsiyo|:count ilbidhiqsi', - 's' => ':countil', - 'ago' => ':time kahor', - 'from_now' => ':time gudahood', - 'after' => ':time kedib', - 'before' => ':time kahor', - 'diff_now' => 'hada', - 'diff_today' => 'maanta', - 'diff_today_regexp' => 'maanta(?:\s+markay\s+(?:tahay|ahayd))?', - 'diff_yesterday' => 'shalayto', - 'diff_yesterday_regexp' => 'shalayto(?:\s+markay\s+ahayd)?', - 'diff_tomorrow' => 'beri', - 'diff_tomorrow_regexp' => 'beri(?:\s+markay\s+tahay)?', - 'diff_before_yesterday' => 'doraato', - 'diff_after_tomorrow' => 'saadanbe', - 'period_recurrences' => 'mar|:count jeer', - 'period_interval' => ':interval kasta', - 'period_start_date' => 'laga bilaabo :date', - 'period_end_date' => 'ilaa :date', - 'months' => ['Janaayo', 'Febraayo', 'Abriil', 'Maajo', 'Juun', 'Luuliyo', 'Agoosto', 'Sebteembar', 'Oktoobar', 'Nofeembar', 'Diseembar'], - 'months_short' => ['Jan', 'Feb', 'Mar', 'Abr', 'Mjo', 'Jun', 'Lyo', 'Agt', 'Seb', 'Okt', 'Nof', 'Dis'], - 'weekdays' => ['Axad', 'Isniin', 'Talaada', 'Arbaca', 'Khamiis', 'Jimce', 'Sabti'], - 'weekdays_short' => ['Axd', 'Isn', 'Tal', 'Arb', 'Kha', 'Jim', 'Sbt'], - 'weekdays_min' => ['Ax', 'Is', 'Ta', 'Ar', 'Kh', 'Ji', 'Sa'], - 'list' => [', ', ' and '], - 'first_day_of_week' => 6, - 'day_of_first_week_of_year' => 1, - 'formats' => [ - 'L' => 'DD/MM/YYYY', - ], - 'calendar' => [ - 'sameDay' => '[Maanta markay tahay] LT', - 'nextDay' => '[Beri markay tahay] LT', - 'nextWeek' => 'dddd [markay tahay] LT', - 'lastDay' => '[Shalay markay ahayd] LT', - 'lastWeek' => '[Hore] dddd [Markay ahayd] LT', - 'sameElse' => 'L', - ], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/so_DJ.php b/vendor/nesbot/carbon/src/Carbon/Lang/so_DJ.php deleted file mode 100644 index 273dda8d..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/so_DJ.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Ge'ez Frontier Foundation locales@geez.org - */ -return array_replace_recursive(require __DIR__.'/so.php', [ - 'formats' => [ - 'L' => 'DD.MM.YYYY', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/so_ET.php b/vendor/nesbot/carbon/src/Carbon/Lang/so_ET.php deleted file mode 100644 index 7b699715..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/so_ET.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Ge'ez Frontier Foundation locales@geez.org - */ -return require __DIR__.'/so.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/so_KE.php b/vendor/nesbot/carbon/src/Carbon/Lang/so_KE.php deleted file mode 100644 index 7b699715..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/so_KE.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Ge'ez Frontier Foundation locales@geez.org - */ -return require __DIR__.'/so.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/so_SO.php b/vendor/nesbot/carbon/src/Carbon/Lang/so_SO.php deleted file mode 100644 index 7b699715..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/so_SO.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Ge'ez Frontier Foundation locales@geez.org - */ -return require __DIR__.'/so.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sq.php b/vendor/nesbot/carbon/src/Carbon/Lang/sq.php deleted file mode 100644 index ffa592ec..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sq.php +++ /dev/null @@ -1,79 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - François B - * - JD Isaacks - * - Fadion Dashi - */ -return [ - 'year' => ':count vit|:count vjet', - 'a_year' => 'një vit|:count vite', - 'y' => ':count v.', - 'month' => ':count muaj', - 'a_month' => 'një muaj|:count muaj', - 'm' => ':count muaj', - 'week' => ':count javë', - 'a_week' => ':count javë|:count javë', - 'w' => ':count j.', - 'day' => ':count ditë', - 'a_day' => 'një ditë|:count ditë', - 'd' => ':count d.', - 'hour' => ':count orë', - 'a_hour' => 'një orë|:count orë', - 'h' => ':count o.', - 'minute' => ':count minutë|:count minuta', - 'a_minute' => 'një minutë|:count minuta', - 'min' => ':count min.', - 'second' => ':count sekondë|:count sekonda', - 'a_second' => 'disa sekonda|:count sekonda', - 's' => ':count s.', - 'ago' => ':time më parë', - 'from_now' => 'në :time', - 'after' => ':time pas', - 'before' => ':time para', - 'diff_now' => 'tani', - 'diff_today' => 'Sot', - 'diff_today_regexp' => 'Sot(?:\\s+në)?', - 'diff_yesterday' => 'dje', - 'diff_yesterday_regexp' => 'Dje(?:\\s+në)?', - 'diff_tomorrow' => 'nesër', - 'diff_tomorrow_regexp' => 'Nesër(?:\\s+në)?', - 'diff_before_yesterday' => 'pardje', - 'diff_after_tomorrow' => 'pasnesër', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[Sot në] LT', - 'nextDay' => '[Nesër në] LT', - 'nextWeek' => 'dddd [në] LT', - 'lastDay' => '[Dje në] LT', - 'lastWeek' => 'dddd [e kaluar në] LT', - 'sameElse' => 'L', - ], - 'ordinal' => ':number.', - 'meridiem' => ['PD', 'MD'], - 'months' => ['janar', 'shkurt', 'mars', 'prill', 'maj', 'qershor', 'korrik', 'gusht', 'shtator', 'tetor', 'nëntor', 'dhjetor'], - 'months_short' => ['jan', 'shk', 'mar', 'pri', 'maj', 'qer', 'kor', 'gus', 'sht', 'tet', 'nën', 'dhj'], - 'weekdays' => ['e diel', 'e hënë', 'e martë', 'e mërkurë', 'e enjte', 'e premte', 'e shtunë'], - 'weekdays_short' => ['die', 'hën', 'mar', 'mër', 'enj', 'pre', 'sht'], - 'weekdays_min' => ['d', 'h', 'ma', 'më', 'e', 'p', 'sh'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' dhe '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sq_AL.php b/vendor/nesbot/carbon/src/Carbon/Lang/sq_AL.php deleted file mode 100644 index ea5df3f2..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sq_AL.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/sq.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sq_MK.php b/vendor/nesbot/carbon/src/Carbon/Lang/sq_MK.php deleted file mode 100644 index 62f752c4..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sq_MK.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/sq.php', [ - 'formats' => [ - 'L' => 'D.M.YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY, HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY, HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sq_XK.php b/vendor/nesbot/carbon/src/Carbon/Lang/sq_XK.php deleted file mode 100644 index 62f752c4..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sq_XK.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/sq.php', [ - 'formats' => [ - 'L' => 'D.M.YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY, HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY, HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr.php deleted file mode 100644 index 68ba663a..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr.php +++ /dev/null @@ -1,112 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Josh Soref - * - François B - * - shaishavgandhi05 - * - Serhan Apaydın - * - JD Isaacks - * - Glavić - * - Milos Sakovic - */ - -use Carbon\CarbonInterface; - -return [ - 'year' => ':count godina|:count godine|:count godina', - 'y' => ':count g.', - 'month' => ':count mesec|:count meseca|:count meseci', - 'm' => ':count mj.', - 'week' => ':count nedelja|:count nedelje|:count nedelja', - 'w' => ':count ned.', - 'day' => ':count dan|:count dana|:count dana', - 'd' => ':count d.', - 'hour' => ':count sat|:count sata|:count sati', - 'h' => ':count č.', - 'minute' => ':count minut|:count minuta|:count minuta', - 'min' => ':count min.', - 'second' => ':count sekundu|:count sekunde|:count sekundi', - 's' => ':count sek.', - 'ago' => 'pre :time', - 'from_now' => 'za :time', - 'after' => 'nakon :time', - 'before' => 'pre :time', - - 'year_from_now' => ':count godinu|:count godine|:count godina', - 'year_ago' => ':count godinu|:count godine|:count godina', - 'week_from_now' => ':count nedelju|:count nedelje|:count nedelja', - 'week_ago' => ':count nedelju|:count nedelje|:count nedelja', - - 'diff_now' => 'upravo sada', - 'diff_today' => 'danas', - 'diff_today_regexp' => 'danas(?:\\s+u)?', - 'diff_yesterday' => 'juče', - 'diff_yesterday_regexp' => 'juče(?:\\s+u)?', - 'diff_tomorrow' => 'sutra', - 'diff_tomorrow_regexp' => 'sutra(?:\\s+u)?', - 'diff_before_yesterday' => 'prekjuče', - 'diff_after_tomorrow' => 'preksutra', - 'formats' => [ - 'LT' => 'H:mm', - 'LTS' => 'H:mm:ss', - 'L' => 'DD.MM.YYYY', - 'LL' => 'D. MMMM YYYY', - 'LLL' => 'D. MMMM YYYY H:mm', - 'LLLL' => 'dddd, D. MMMM YYYY H:mm', - ], - 'calendar' => [ - 'sameDay' => '[danas u] LT', - 'nextDay' => '[sutra u] LT', - 'nextWeek' => function (CarbonInterface $date) { - switch ($date->dayOfWeek) { - case 0: - return '[u nedelju u] LT'; - case 3: - return '[u sredu u] LT'; - case 6: - return '[u subotu u] LT'; - default: - return '[u] dddd [u] LT'; - } - }, - 'lastDay' => '[juče u] LT', - 'lastWeek' => function (CarbonInterface $date) { - switch ($date->dayOfWeek) { - case 0: - return '[prošle nedelje u] LT'; - case 1: - return '[prošlog ponedeljka u] LT'; - case 2: - return '[prošlog utorka u] LT'; - case 3: - return '[prošle srede u] LT'; - case 4: - return '[prošlog četvrtka u] LT'; - case 5: - return '[prošlog petka u] LT'; - default: - return '[prošle subote u] LT'; - } - }, - 'sameElse' => 'L', - ], - 'ordinal' => ':number.', - 'months' => ['januar', 'februar', 'mart', 'april', 'maj', 'jun', 'jul', 'avgust', 'septembar', 'oktobar', 'novembar', 'decembar'], - 'months_short' => ['jan.', 'feb.', 'mar.', 'apr.', 'maj', 'jun', 'jul', 'avg.', 'sep.', 'okt.', 'nov.', 'dec.'], - 'weekdays' => ['nedelja', 'ponedeljak', 'utorak', 'sreda', 'četvrtak', 'petak', 'subota'], - 'weekdays_short' => ['ned.', 'pon.', 'uto.', 'sre.', 'čet.', 'pet.', 'sub.'], - 'weekdays_min' => ['ne', 'po', 'ut', 'sr', 'če', 'pe', 'su'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'list' => [', ', ' i '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl.php deleted file mode 100644 index c09df19c..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl.php +++ /dev/null @@ -1,112 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Josh Soref - * - François B - * - shaishavgandhi05 - * - Serhan Apaydın - * - JD Isaacks - * - Glavić - * - Nikola Zeravcic - * - Milos Sakovic - */ - -use Carbon\CarbonInterface; - -return [ - 'year' => '{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count године|[0,Inf[:count година', - 'y' => ':count г.', - 'month' => '{1}:count месец|{2,3,4}:count месеца|[0,Inf[:count месеци', - 'm' => ':count м.', - 'week' => '{1}:count недеља|{2,3,4}:count недеље|[0,Inf[:count недеља', - 'w' => ':count нед.', - 'day' => '{1,21,31}:count дан|[0,Inf[:count дана', - 'd' => ':count д.', - 'hour' => '{1,21}:count сат|{2,3,4,22,23,24}:count сата|[0,Inf[:count сати', - 'h' => ':count ч.', - 'minute' => '{1,21,31,41,51}:count минут|[0,Inf[:count минута', - 'min' => ':count мин.', - 'second' => '{1,21,31,41,51}:count секунд|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count секунде|[0,Inf[:count секунди', - 's' => ':count сек.', - 'ago' => 'пре :time', - 'from_now' => 'за :time', - 'after' => ':time након', - 'before' => ':time пре', - 'year_from_now' => '{1,21,31,41,51}:count годину|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count године|[0,Inf[:count година', - 'year_ago' => '{1,21,31,41,51}:count годину|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count године|[0,Inf[:count година', - 'week_from_now' => '{1}:count недељу|{2,3,4}:count недеље|[0,Inf[:count недеља', - 'week_ago' => '{1}:count недељу|{2,3,4}:count недеље|[0,Inf[:count недеља', - 'diff_now' => 'управо сада', - 'diff_today' => 'данас', - 'diff_today_regexp' => 'данас(?:\\s+у)?', - 'diff_yesterday' => 'јуче', - 'diff_yesterday_regexp' => 'јуче(?:\\s+у)?', - 'diff_tomorrow' => 'сутра', - 'diff_tomorrow_regexp' => 'сутра(?:\\s+у)?', - 'diff_before_yesterday' => 'прекјуче', - 'diff_after_tomorrow' => 'прекосутра', - 'formats' => [ - 'LT' => 'H:mm', - 'LTS' => 'H:mm:ss', - 'L' => 'DD.MM.YYYY', - 'LL' => 'D. MMMM YYYY', - 'LLL' => 'D. MMMM YYYY H:mm', - 'LLLL' => 'dddd, D. MMMM YYYY H:mm', - ], - 'calendar' => [ - 'sameDay' => '[данас у] LT', - 'nextDay' => '[сутра у] LT', - 'nextWeek' => function (CarbonInterface $date) { - switch ($date->dayOfWeek) { - case 0: - return '[у недељу у] LT'; - case 3: - return '[у среду у] LT'; - case 6: - return '[у суботу у] LT'; - default: - return '[у] dddd [у] LT'; - } - }, - 'lastDay' => '[јуче у] LT', - 'lastWeek' => function (CarbonInterface $date) { - switch ($date->dayOfWeek) { - case 0: - return '[прошле недеље у] LT'; - case 1: - return '[прошлог понедељка у] LT'; - case 2: - return '[прошлог уторка у] LT'; - case 3: - return '[прошле среде у] LT'; - case 4: - return '[прошлог четвртка у] LT'; - case 5: - return '[прошлог петка у] LT'; - default: - return '[прошле суботе у] LT'; - } - }, - 'sameElse' => 'L', - ], - 'ordinal' => ':number.', - 'months' => ['јануар', 'фебруар', 'март', 'април', 'мај', 'јун', 'јул', 'август', 'септембар', 'октобар', 'новембар', 'децембар'], - 'months_short' => ['јан.', 'феб.', 'мар.', 'апр.', 'мај', 'јун', 'јул', 'авг.', 'сеп.', 'окт.', 'нов.', 'дец.'], - 'weekdays' => ['недеља', 'понедељак', 'уторак', 'среда', 'четвртак', 'петак', 'субота'], - 'weekdays_short' => ['нед.', 'пон.', 'уто.', 'сре.', 'чет.', 'пет.', 'суб.'], - 'weekdays_min' => ['не', 'по', 'ут', 'ср', 'че', 'пе', 'су'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'list' => [', ', ' и '], - 'meridiem' => ['АМ', 'ПМ'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_BA.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_BA.php deleted file mode 100644 index 0fb63d76..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_BA.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/sr_Cyrl.php', [ - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'D.M.yy.', - 'LL' => 'DD.MM.YYYY.', - 'LLL' => 'DD. MMMM YYYY. HH:mm', - 'LLLL' => 'dddd, DD. MMMM YYYY. HH:mm', - ], - 'weekdays' => ['недјеља', 'понедељак', 'уторак', 'сриједа', 'четвртак', 'петак', 'субота'], - 'weekdays_short' => ['нед.', 'пон.', 'ут.', 'ср.', 'чет.', 'пет.', 'суб.'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_ME.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_ME.php deleted file mode 100644 index d13229ab..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_ME.php +++ /dev/null @@ -1,109 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Glavić - * - Milos Sakovic - */ - -use Carbon\CarbonInterface; - -return [ - 'year' => '{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count године|[0,Inf[:count година', - 'y' => ':count г.', - 'month' => '{1}:count мјесец|{2,3,4}:count мјесеца|[0,Inf[:count мјесеци', - 'm' => ':count мј.', - 'week' => '{1}:count недјеља|{2,3,4}:count недјеље|[0,Inf[:count недјеља', - 'w' => ':count нед.', - 'day' => '{1,21,31}:count дан|[0,Inf[:count дана', - 'd' => ':count д.', - 'hour' => '{1,21}:count сат|{2,3,4,22,23,24}:count сата|[0,Inf[:count сати', - 'h' => ':count ч.', - 'minute' => '{1,21,31,41,51}:count минут|[0,Inf[:count минута', - 'min' => ':count мин.', - 'second' => '{1,21,31,41,51}:count секунд|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count секунде|[0,Inf[:count секунди', - 's' => ':count сек.', - 'ago' => 'прије :time', - 'from_now' => 'за :time', - 'after' => ':time након', - 'before' => ':time прије', - - 'year_from_now' => '{1,21,31,41,51}:count годину|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count године|[0,Inf[:count година', - 'year_ago' => '{1,21,31,41,51}:count годину|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count године|[0,Inf[:count година', - - 'week_from_now' => '{1}:count недјељу|{2,3,4}:count недјеље|[0,Inf[:count недјеља', - 'week_ago' => '{1}:count недјељу|{2,3,4}:count недјеље|[0,Inf[:count недјеља', - - 'diff_now' => 'управо сада', - 'diff_today' => 'данас', - 'diff_today_regexp' => 'данас(?:\\s+у)?', - 'diff_yesterday' => 'јуче', - 'diff_yesterday_regexp' => 'јуче(?:\\s+у)?', - 'diff_tomorrow' => 'сутра', - 'diff_tomorrow_regexp' => 'сутра(?:\\s+у)?', - 'diff_before_yesterday' => 'прекјуче', - 'diff_after_tomorrow' => 'прекосјутра', - 'formats' => [ - 'LT' => 'H:mm', - 'LTS' => 'H:mm:ss', - 'L' => 'DD.MM.YYYY', - 'LL' => 'D. MMMM YYYY', - 'LLL' => 'D. MMMM YYYY H:mm', - 'LLLL' => 'dddd, D. MMMM YYYY H:mm', - ], - 'calendar' => [ - 'sameDay' => '[данас у] LT', - 'nextDay' => '[сутра у] LT', - 'nextWeek' => function (CarbonInterface $date) { - switch ($date->dayOfWeek) { - case 0: - return '[у недељу у] LT'; - case 3: - return '[у среду у] LT'; - case 6: - return '[у суботу у] LT'; - default: - return '[у] dddd [у] LT'; - } - }, - 'lastDay' => '[јуче у] LT', - 'lastWeek' => function (CarbonInterface $date) { - switch ($date->dayOfWeek) { - case 0: - return '[прошле недеље у] LT'; - case 1: - return '[прошлог понедељка у] LT'; - case 2: - return '[прошлог уторка у] LT'; - case 3: - return '[прошле среде у] LT'; - case 4: - return '[прошлог четвртка у] LT'; - case 5: - return '[прошлог петка у] LT'; - default: - return '[прошле суботе у] LT'; - } - }, - 'sameElse' => 'L', - ], - 'ordinal' => ':number.', - 'months' => ['јануар', 'фебруар', 'март', 'април', 'мај', 'јун', 'јул', 'август', 'септембар', 'октобар', 'новембар', 'децембар'], - 'months_short' => ['јан.', 'феб.', 'мар.', 'апр.', 'мај', 'јун', 'јул', 'авг.', 'сеп.', 'окт.', 'нов.', 'дец.'], - 'weekdays' => ['недеља', 'понедељак', 'уторак', 'среда', 'четвртак', 'петак', 'субота'], - 'weekdays_short' => ['нед.', 'пон.', 'уто.', 'сре.', 'чет.', 'пет.', 'суб.'], - 'weekdays_min' => ['не', 'по', 'ут', 'ср', 'че', 'пе', 'су'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'list' => [', ', ' и '], - 'meridiem' => ['АМ', 'ПМ'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_XK.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_XK.php deleted file mode 100644 index 492baf0c..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_XK.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/sr_Cyrl_BA.php', [ - 'weekdays' => ['недеља', 'понедељак', 'уторак', 'среда', 'четвртак', 'петак', 'субота'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn.php deleted file mode 100644 index 99716747..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/sr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_BA.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_BA.php deleted file mode 100644 index 897c674a..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_BA.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/sr_Latn.php', [ - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'D.M.yy.', - 'LL' => 'DD.MM.YYYY.', - 'LLL' => 'DD. MMMM YYYY. HH:mm', - 'LLLL' => 'dddd, DD. MMMM YYYY. HH:mm', - ], - 'weekdays' => ['nedjelja', 'ponedeljak', 'utorak', 'srijeda', 'četvrtak', 'petak', 'subota'], - 'weekdays_short' => ['ned.', 'pon.', 'ut.', 'sr.', 'čet.', 'pet.', 'sub.'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_ME.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_ME.php deleted file mode 100644 index e2133ef1..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_ME.php +++ /dev/null @@ -1,66 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Glavić - * - Milos Sakovic - */ - -use Carbon\CarbonInterface; - -return array_replace_recursive(require __DIR__.'/sr.php', [ - 'month' => ':count mjesec|:count mjeseca|:count mjeseci', - 'week' => ':count nedjelja|:count nedjelje|:count nedjelja', - 'second' => ':count sekund|:count sekunde|:count sekundi', - 'ago' => 'prije :time', - 'from_now' => 'za :time', - 'after' => ':time nakon', - 'before' => ':time prije', - 'week_from_now' => ':count nedjelju|:count nedjelje|:count nedjelja', - 'week_ago' => ':count nedjelju|:count nedjelje|:count nedjelja', - 'diff_tomorrow' => 'sjutra', - 'calendar' => [ - 'nextDay' => '[sjutra u] LT', - 'nextWeek' => function (CarbonInterface $date) { - switch ($date->dayOfWeek) { - case 0: - return '[u nedjelju u] LT'; - case 3: - return '[u srijedu u] LT'; - case 6: - return '[u subotu u] LT'; - default: - return '[u] dddd [u] LT'; - } - }, - 'lastWeek' => function (CarbonInterface $date) { - switch ($date->dayOfWeek) { - case 0: - return '[prošle nedjelje u] LT'; - case 1: - return '[prošle nedjelje u] LT'; - case 2: - return '[prošlog utorka u] LT'; - case 3: - return '[prošle srijede u] LT'; - case 4: - return '[prošlog četvrtka u] LT'; - case 5: - return '[prošlog petka u] LT'; - default: - return '[prošle subote u] LT'; - } - }, - ], - 'weekdays' => ['nedjelja', 'ponedjeljak', 'utorak', 'srijeda', 'četvrtak', 'petak', 'subota'], - 'weekdays_short' => ['ned.', 'pon.', 'uto.', 'sri.', 'čet.', 'pet.', 'sub.'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_XK.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_XK.php deleted file mode 100644 index d0b9d10b..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_XK.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/sr_Latn_BA.php', [ - 'weekdays' => ['nedelja', 'ponedeljak', 'utorak', 'sreda', 'četvrtak', 'petak', 'subota'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr_ME.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr_ME.php deleted file mode 100644 index d7c65b91..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr_ME.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/sr_Latn_ME.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr_RS.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr_RS.php deleted file mode 100644 index bc5e04bf..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr_RS.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - sr_YU, sr_CS locale Danilo Segan bug-glibc-locales@gnu.org - */ -return require __DIR__.'/sr_Cyrl.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr_RS@latin.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr_RS@latin.php deleted file mode 100644 index 99716747..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr_RS@latin.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/sr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ss.php b/vendor/nesbot/carbon/src/Carbon/Lang/ss.php deleted file mode 100644 index 1c52c9bf..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ss.php +++ /dev/null @@ -1,78 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - François B - * - Nicolai Davies - */ -return [ - 'year' => '{1}umnyaka|:count iminyaka', - 'month' => '{1}inyanga|:count tinyanga', - 'week' => '{1}:count liviki|:count emaviki', - 'day' => '{1}lilanga|:count emalanga', - 'hour' => '{1}lihora|:count emahora', - 'minute' => '{1}umzuzu|:count emizuzu', - 'second' => '{1}emizuzwana lomcane|:count mzuzwana', - 'ago' => 'wenteka nga :time', - 'from_now' => 'nga :time', - 'diff_yesterday' => 'Itolo', - 'diff_yesterday_regexp' => 'Itolo(?:\\s+nga)?', - 'diff_today' => 'Namuhla', - 'diff_today_regexp' => 'Namuhla(?:\\s+nga)?', - 'diff_tomorrow' => 'Kusasa', - 'diff_tomorrow_regexp' => 'Kusasa(?:\\s+nga)?', - 'formats' => [ - 'LT' => 'h:mm A', - 'LTS' => 'h:mm:ss A', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY h:mm A', - 'LLLL' => 'dddd, D MMMM YYYY h:mm A', - ], - 'calendar' => [ - 'sameDay' => '[Namuhla nga] LT', - 'nextDay' => '[Kusasa nga] LT', - 'nextWeek' => 'dddd [nga] LT', - 'lastDay' => '[Itolo nga] LT', - 'lastWeek' => 'dddd [leliphelile] [nga] LT', - 'sameElse' => 'L', - ], - 'ordinal' => function ($number) { - $lastDigit = $number % 10; - - return $number.( - ((int) ($number % 100 / 10) === 1) ? 'e' : ( - ($lastDigit === 1 || $lastDigit === 2) ? 'a' : 'e' - ) - ); - }, - 'meridiem' => function ($hour) { - if ($hour < 11) { - return 'ekuseni'; - } - if ($hour < 15) { - return 'emini'; - } - if ($hour < 19) { - return 'entsambama'; - } - - return 'ebusuku'; - }, - 'months' => ['Bhimbidvwane', 'Indlovana', 'Indlov\'lenkhulu', 'Mabasa', 'Inkhwekhweti', 'Inhlaba', 'Kholwane', 'Ingci', 'Inyoni', 'Imphala', 'Lweti', 'Ingongoni'], - 'months_short' => ['Bhi', 'Ina', 'Inu', 'Mab', 'Ink', 'Inh', 'Kho', 'Igc', 'Iny', 'Imp', 'Lwe', 'Igo'], - 'weekdays' => ['Lisontfo', 'Umsombuluko', 'Lesibili', 'Lesitsatfu', 'Lesine', 'Lesihlanu', 'Umgcibelo'], - 'weekdays_short' => ['Lis', 'Umb', 'Lsb', 'Les', 'Lsi', 'Lsh', 'Umg'], - 'weekdays_min' => ['Li', 'Us', 'Lb', 'Lt', 'Ls', 'Lh', 'Ug'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ss_ZA.php b/vendor/nesbot/carbon/src/Carbon/Lang/ss_ZA.php deleted file mode 100644 index ba89527c..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ss_ZA.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/ss.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/st.php b/vendor/nesbot/carbon/src/Carbon/Lang/st.php deleted file mode 100644 index b065445b..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/st.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/st_ZA.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/st_ZA.php b/vendor/nesbot/carbon/src/Carbon/Lang/st_ZA.php deleted file mode 100644 index 5bce7f20..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/st_ZA.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Zuza Software Foundation (Translate.org.za) Dwayne Bailey dwayne@translate.org.za - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YYYY', - ], - 'months' => ['Pherekgong', 'Hlakola', 'Tlhakubele', 'Mmese', 'Motsheanong', 'Phupjane', 'Phupu', 'Phato', 'Leotse', 'Mphalane', 'Pudungwana', 'Tshitwe'], - 'months_short' => ['Phe', 'Hla', 'TlH', 'Mme', 'Mot', 'Jan', 'Upu', 'Pha', 'Leo', 'Mph', 'Pud', 'Tsh'], - 'weekdays' => ['Sontaha', 'Mantaha', 'Labobedi', 'Laboraro', 'Labone', 'Labohlano', 'Moqebelo'], - 'weekdays_short' => ['Son', 'Mma', 'Bed', 'Rar', 'Ne', 'Hla', 'Moq'], - 'weekdays_min' => ['Son', 'Mma', 'Bed', 'Rar', 'Ne', 'Hla', 'Moq'], - 'day_of_first_week_of_year' => 1, - - 'week' => ':count Sontaha', // less reliable - 'w' => ':count Sontaha', // less reliable - 'a_week' => ':count Sontaha', // less reliable - - 'day' => ':count letsatsi', // less reliable - 'd' => ':count letsatsi', // less reliable - 'a_day' => ':count letsatsi', // less reliable - - 'hour' => ':count sešupanako', // less reliable - 'h' => ':count sešupanako', // less reliable - 'a_hour' => ':count sešupanako', // less reliable - - 'minute' => ':count menyane', // less reliable - 'min' => ':count menyane', // less reliable - 'a_minute' => ':count menyane', // less reliable - - 'second' => ':count thusa', // less reliable - 's' => ':count thusa', // less reliable - 'a_second' => ':count thusa', // less reliable - - 'year' => ':count selemo', - 'y' => ':count selemo', - 'a_year' => ':count selemo', - - 'month' => ':count kgwedi', - 'm' => ':count kgwedi', - 'a_month' => ':count kgwedi', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sv.php b/vendor/nesbot/carbon/src/Carbon/Lang/sv.php deleted file mode 100644 index 1706c719..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sv.php +++ /dev/null @@ -1,87 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - François B - * - Kristoffer Snabb - * - JD Isaacks - * - Jens Herlevsen - * - Nightpine - * - Anders Nygren (litemerafrukt) - */ -return [ - 'year' => ':count år', - 'a_year' => 'ett år|:count år', - 'y' => ':count år', - 'month' => ':count månad|:count månader', - 'a_month' => 'en månad|:count månader', - 'm' => ':count mån', - 'week' => ':count vecka|:count veckor', - 'a_week' => 'en vecka|:count veckor', - 'w' => ':count v', - 'day' => ':count dag|:count dagar', - 'a_day' => 'en dag|:count dagar', - 'd' => ':count dgr', - 'hour' => ':count timme|:count timmar', - 'a_hour' => 'en timme|:count timmar', - 'h' => ':count tim', - 'minute' => ':count minut|:count minuter', - 'a_minute' => 'en minut|:count minuter', - 'min' => ':count min', - 'second' => ':count sekund|:count sekunder', - 'a_second' => 'några sekunder|:count sekunder', - 's' => ':count s', - 'ago' => 'för :time sedan', - 'from_now' => 'om :time', - 'after' => ':time efter', - 'before' => ':time före', - 'diff_now' => 'nu', - 'diff_today' => 'I dag', - 'diff_yesterday' => 'i går', - 'diff_yesterday_regexp' => 'I går', - 'diff_tomorrow' => 'i morgon', - 'diff_tomorrow_regexp' => 'I morgon', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'YYYY-MM-DD', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY [kl.] HH:mm', - 'LLLL' => 'dddd D MMMM YYYY [kl.] HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[I dag] LT', - 'nextDay' => '[I morgon] LT', - 'nextWeek' => '[På] dddd LT', - 'lastDay' => '[I går] LT', - 'lastWeek' => '[I] dddd[s] LT', - 'sameElse' => 'L', - ], - 'ordinal' => function ($number) { - $lastDigit = $number % 10; - - return $number.( - ((int) ($number % 100 / 10) === 1) ? 'e' : ( - ($lastDigit === 1 || $lastDigit === 2) ? 'a' : 'e' - ) - ); - }, - 'months' => ['januari', 'februari', 'mars', 'april', 'maj', 'juni', 'juli', 'augusti', 'september', 'oktober', 'november', 'december'], - 'months_short' => ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'], - 'weekdays' => ['söndag', 'måndag', 'tisdag', 'onsdag', 'torsdag', 'fredag', 'lördag'], - 'weekdays_short' => ['sön', 'mån', 'tis', 'ons', 'tors', 'fre', 'lör'], - 'weekdays_min' => ['sö', 'må', 'ti', 'on', 'to', 'fr', 'lö'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' och '], - 'meridiem' => ['fm', 'em'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sv_AX.php b/vendor/nesbot/carbon/src/Carbon/Lang/sv_AX.php deleted file mode 100644 index 70cc5585..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sv_AX.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/sv.php', [ - 'formats' => [ - 'L' => 'YYYY-MM-dd', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sv_FI.php b/vendor/nesbot/carbon/src/Carbon/Lang/sv_FI.php deleted file mode 100644 index d7182c83..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sv_FI.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/sv.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sv_SE.php b/vendor/nesbot/carbon/src/Carbon/Lang/sv_SE.php deleted file mode 100644 index d7182c83..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sv_SE.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/sv.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sw.php b/vendor/nesbot/carbon/src/Carbon/Lang/sw.php deleted file mode 100644 index f8630d53..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sw.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - leyluj - * - Josh Soref - * - ryanhart2 - */ -return [ - 'year' => 'mwaka :count|miaka :count', - 'a_year' => 'mwaka mmoja|miaka :count', - 'y' => 'mwaka :count|miaka :count', - 'month' => 'mwezi :count|miezi :count', - 'a_month' => 'mwezi mmoja|miezi :count', - 'm' => 'mwezi :count|miezi :count', - 'week' => 'wiki :count', - 'a_week' => 'wiki mmoja|wiki :count', - 'w' => 'w. :count', - 'day' => 'siku :count', - 'a_day' => 'siku moja|masiku :count', - 'd' => 'si. :count', - 'hour' => 'saa :count|masaa :count', - 'a_hour' => 'saa limoja|masaa :count', - 'h' => 'saa :count|masaa :count', - 'minute' => 'dakika :count', - 'a_minute' => 'dakika moja|dakika :count', - 'min' => 'd. :count', - 'second' => 'sekunde :count', - 'a_second' => 'hivi punde|sekunde :count', - 's' => 'se. :count', - 'ago' => 'tokea :time', - 'from_now' => ':time baadaye', - 'after' => ':time baada', - 'before' => ':time kabla', - 'diff_now' => 'sasa hivi', - 'diff_today' => 'leo', - 'diff_today_regexp' => 'leo(?:\\s+saa)?', - 'diff_yesterday' => 'jana', - 'diff_tomorrow' => 'kesho', - 'diff_tomorrow_regexp' => 'kesho(?:\\s+saa)?', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD.MM.YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[leo saa] LT', - 'nextDay' => '[kesho saa] LT', - 'nextWeek' => '[wiki ijayo] dddd [saat] LT', - 'lastDay' => '[jana] LT', - 'lastWeek' => '[wiki iliyopita] dddd [saat] LT', - 'sameElse' => 'L', - ], - 'months' => ['Januari', 'Februari', 'Machi', 'Aprili', 'Mei', 'Juni', 'Julai', 'Agosti', 'Septemba', 'Oktoba', 'Novemba', 'Desemba'], - 'months_short' => ['Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Sep', 'Okt', 'Nov', 'Des'], - 'weekdays' => ['Jumapili', 'Jumatatu', 'Jumanne', 'Jumatano', 'Alhamisi', 'Ijumaa', 'Jumamosi'], - 'weekdays_short' => ['Jpl', 'Jtat', 'Jnne', 'Jtan', 'Alh', 'Ijm', 'Jmos'], - 'weekdays_min' => ['J2', 'J3', 'J4', 'J5', 'Al', 'Ij', 'J1'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'list' => [', ', ' na '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sw_CD.php b/vendor/nesbot/carbon/src/Carbon/Lang/sw_CD.php deleted file mode 100644 index ec9117b5..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sw_CD.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/sw.php', [ - 'formats' => [ - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sw_KE.php b/vendor/nesbot/carbon/src/Carbon/Lang/sw_KE.php deleted file mode 100644 index 2ace0db2..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sw_KE.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Kamusi Project Martin Benjamin locales@kamusi.org - */ -return array_replace_recursive(require __DIR__.'/sw.php', [ - 'formats' => [ - 'L' => 'DD/MM/YYYY', - ], - 'months' => ['Januari', 'Februari', 'Machi', 'Aprili', 'Mei', 'Juni', 'Julai', 'Agosti', 'Septemba', 'Oktoba', 'Novemba', 'Desemba'], - 'months_short' => ['Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Sep', 'Okt', 'Nov', 'Des'], - 'weekdays' => ['Jumapili', 'Jumatatu', 'Jumanne', 'Jumatano', 'Alhamisi', 'Ijumaa', 'Jumamosi'], - 'weekdays_short' => ['J2', 'J3', 'J4', 'J5', 'Alh', 'Ij', 'J1'], - 'weekdays_min' => ['J2', 'J3', 'J4', 'J5', 'Alh', 'Ij', 'J1'], - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['asubuhi', 'alasiri'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sw_TZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/sw_TZ.php deleted file mode 100644 index fab3cd68..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sw_TZ.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Kamusi Project Martin Benjamin locales@kamusi.org - */ -return array_replace_recursive(require __DIR__.'/sw.php', [ - 'formats' => [ - 'L' => 'DD/MM/YYYY', - ], - 'months' => ['Januari', 'Februari', 'Machi', 'Aprili', 'Mei', 'Juni', 'Julai', 'Agosti', 'Septemba', 'Oktoba', 'Novemba', 'Desemba'], - 'months_short' => ['Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Sep', 'Okt', 'Nov', 'Des'], - 'weekdays' => ['Jumapili', 'Jumatatu', 'Jumanne', 'Jumatano', 'Alhamisi', 'Ijumaa', 'Jumamosi'], - 'weekdays_short' => ['J2', 'J3', 'J4', 'J5', 'Alh', 'Ij', 'J1'], - 'weekdays_min' => ['J2', 'J3', 'J4', 'J5', 'Alh', 'Ij', 'J1'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['asubuhi', 'alasiri'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sw_UG.php b/vendor/nesbot/carbon/src/Carbon/Lang/sw_UG.php deleted file mode 100644 index ec9117b5..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sw_UG.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/sw.php', [ - 'formats' => [ - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/szl.php b/vendor/nesbot/carbon/src/Carbon/Lang/szl.php deleted file mode 100644 index 4429c4f5..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/szl.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/szl_PL.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/szl_PL.php b/vendor/nesbot/carbon/src/Carbon/Lang/szl_PL.php deleted file mode 100644 index 9adddcf8..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/szl_PL.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - szl_PL locale Przemyslaw Buczkowski libc-alpha@sourceware.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD.MM.YYYY', - ], - 'months' => ['styczyń', 'luty', 'merc', 'kwjeciyń', 'moj', 'czyrwjyń', 'lipjyń', 'siyrpjyń', 'wrzesiyń', 'październik', 'listopad', 'grudziyń'], - 'months_short' => ['sty', 'lut', 'mer', 'kwj', 'moj', 'czy', 'lip', 'siy', 'wrz', 'paź', 'lis', 'gru'], - 'weekdays' => ['niydziela', 'pyńdziŏek', 'wtŏrek', 'strzŏda', 'sztwortek', 'pjōntek', 'sobŏta'], - 'weekdays_short' => ['niy', 'pyń', 'wtŏ', 'str', 'szt', 'pjō', 'sob'], - 'weekdays_min' => ['niy', 'pyń', 'wtŏ', 'str', 'szt', 'pjō', 'sob'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - - 'year' => ':count rok', - 'y' => ':count rok', - 'a_year' => ':count rok', - - 'month' => ':count mjeśůnc', - 'm' => ':count mjeśůnc', - 'a_month' => ':count mjeśůnc', - - 'week' => ':count tydźyń', - 'w' => ':count tydźyń', - 'a_week' => ':count tydźyń', - - 'day' => ':count dźyń', - 'd' => ':count dźyń', - 'a_day' => ':count dźyń', - - 'hour' => ':count godzina', - 'h' => ':count godzina', - 'a_hour' => ':count godzina', - - 'minute' => ':count minuta', - 'min' => ':count minuta', - 'a_minute' => ':count minuta', - - 'second' => ':count sekůnda', - 's' => ':count sekůnda', - 'a_second' => ':count sekůnda', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ta.php b/vendor/nesbot/carbon/src/Carbon/Lang/ta.php deleted file mode 100644 index c1d89cbb..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ta.php +++ /dev/null @@ -1,97 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Josh Soref - * - François B - * - JD Isaacks - * - Satheez - */ -return [ - 'year' => ':count வருடம்|:count ஆண்டுகள்', - 'a_year' => 'ஒரு வருடம்|:count ஆண்டுகள்', - 'y' => ':count வருட.|:count ஆண்.', - 'month' => ':count மாதம்|:count மாதங்கள்', - 'a_month' => 'ஒரு மாதம்|:count மாதங்கள்', - 'm' => ':count மாத.', - 'week' => ':count வாரம்|:count வாரங்கள்', - 'a_week' => 'ஒரு வாரம்|:count வாரங்கள்', - 'w' => ':count வார.', - 'day' => ':count நாள்|:count நாட்கள்', - 'a_day' => 'ஒரு நாள்|:count நாட்கள்', - 'd' => ':count நாள்|:count நாட்.', - 'hour' => ':count மணி நேரம்|:count மணி நேரம்', - 'a_hour' => 'ஒரு மணி நேரம்|:count மணி நேரம்', - 'h' => ':count மணி.', - 'minute' => ':count நிமிடம்|:count நிமிடங்கள்', - 'a_minute' => 'ஒரு நிமிடம்|:count நிமிடங்கள்', - 'min' => ':count நிமி.', - 'second' => ':count சில விநாடிகள்|:count விநாடிகள்', - 'a_second' => 'ஒரு சில விநாடிகள்|:count விநாடிகள்', - 's' => ':count விநா.', - 'ago' => ':time முன்', - 'from_now' => ':time இல்', - 'before' => ':time முன்', - 'after' => ':time பின்', - 'diff_now' => 'இப்போது', - 'diff_today' => 'இன்று', - 'diff_yesterday' => 'நேற்று', - 'diff_tomorrow' => 'நாளை', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY, HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY, HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[இன்று] LT', - 'nextDay' => '[நாளை] LT', - 'nextWeek' => 'dddd, LT', - 'lastDay' => '[நேற்று] LT', - 'lastWeek' => '[கடந்த வாரம்] dddd, LT', - 'sameElse' => 'L', - ], - 'ordinal' => ':numberவது', - 'meridiem' => function ($hour) { - if ($hour < 2) { - return ' யாமம்'; - } - if ($hour < 6) { - return ' வைகறை'; - } - if ($hour < 10) { - return ' காலை'; - } - if ($hour < 14) { - return ' நண்பகல்'; - } - if ($hour < 18) { - return ' எற்பாடு'; - } - if ($hour < 22) { - return ' மாலை'; - } - - return ' யாமம்'; - }, - 'months' => ['ஜனவரி', 'பிப்ரவரி', 'மார்ச்', 'ஏப்ரல்', 'மே', 'ஜூன்', 'ஜூலை', 'ஆகஸ்ட்', 'செப்டெம்பர்', 'அக்டோபர்', 'நவம்பர்', 'டிசம்பர்'], - 'months_short' => ['ஜனவரி', 'பிப்ரவரி', 'மார்ச்', 'ஏப்ரல்', 'மே', 'ஜூன்', 'ஜூலை', 'ஆகஸ்ட்', 'செப்டெம்பர்', 'அக்டோபர்', 'நவம்பர்', 'டிசம்பர்'], - 'weekdays' => ['ஞாயிற்றுக்கிழமை', 'திங்கட்கிழமை', 'செவ்வாய்கிழமை', 'புதன்கிழமை', 'வியாழக்கிழமை', 'வெள்ளிக்கிழமை', 'சனிக்கிழமை'], - 'weekdays_short' => ['ஞாயிறு', 'திங்கள்', 'செவ்வாய்', 'புதன்', 'வியாழன்', 'வெள்ளி', 'சனி'], - 'weekdays_min' => ['ஞா', 'தி', 'செ', 'பு', 'வி', 'வெ', 'ச'], - 'first_day_of_week' => 0, - 'day_of_first_week_of_year' => 1, - 'list' => [', ', ' மற்றும் '], - 'weekend' => [0, 0], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ta_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/ta_IN.php deleted file mode 100644 index 492d4c56..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ta_IN.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/ta.php', [ - 'formats' => [ - 'L' => 'D/M/YY', - ], - 'months' => ['ஜனவரி', 'பிப்ரவரி', 'மார்ச்', 'ஏப்ரல்', 'மே', 'ஜூன்', 'ஜூலை', 'ஆகஸ்ட்', 'செப்டம்பர்', 'அக்டோபர்', 'நவம்பர்', 'டிசம்பர்'], - 'months_short' => ['ஜன.', 'பிப்.', 'மார்.', 'ஏப்.', 'மே', 'ஜூன்', 'ஜூலை', 'ஆக.', 'செப்.', 'அக்.', 'நவ.', 'டிச.'], - 'weekdays' => ['ஞாயிறு', 'திங்கள்', 'செவ்வாய்', 'புதன்', 'வியாழன்', 'வெள்ளி', 'சனி'], - 'weekdays_short' => ['ஞா', 'தி', 'செ', 'பு', 'வி', 'வெ', 'ச'], - 'weekdays_min' => ['ஞா', 'தி', 'செ', 'பு', 'வி', 'வெ', 'ச'], - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['காலை', 'மாலை'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ta_LK.php b/vendor/nesbot/carbon/src/Carbon/Lang/ta_LK.php deleted file mode 100644 index 8e2afbf6..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ta_LK.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - J.Yogaraj 94-777-315206 yogaraj.ubuntu@gmail.com - */ -return array_replace_recursive(require __DIR__.'/ta.php', [ - 'formats' => [ - 'L' => 'D/M/YY', - ], - 'months' => ['ஜனவரி', 'பிப்ரவரி', 'மார்ச்', 'ஏப்ரல்', 'மே', 'ஜூன்', 'ஜூலை', 'ஆகஸ்ட்', 'செப்டம்பர்', 'அக்டோபர்', 'நவம்பர்', 'டிசம்பர்'], - 'months_short' => ['ஜன', 'பிப்', 'மார்', 'ஏப்', 'மே', 'ஜூன்', 'ஜூலை', 'ஆக', 'செப்', 'அக்', 'நவ', 'டிச'], - 'weekdays' => ['ஞாயிறு', 'திங்கள்', 'செவ்வாய்', 'புதன்', 'வியாழன்', 'வெள்ளி', 'சனி'], - 'weekdays_short' => ['ஞா', 'தி', 'செ', 'பு', 'வி', 'வெ', 'ச'], - 'weekdays_min' => ['ஞா', 'தி', 'செ', 'பு', 'வி', 'வெ', 'ச'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['காலை', 'மாலை'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ta_MY.php b/vendor/nesbot/carbon/src/Carbon/Lang/ta_MY.php deleted file mode 100644 index a6cd8b51..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ta_MY.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/ta.php', [ - 'formats' => [ - 'LT' => 'a h:mm', - 'LTS' => 'a h:mm:ss', - 'L' => 'D/M/yy', - 'LL' => 'D MMM, YYYY', - 'LLL' => 'D MMMM, YYYY, a h:mm', - 'LLLL' => 'dddd, D MMMM, YYYY, a h:mm', - ], - 'months' => ['ஜனவரி', 'பிப்ரவரி', 'மார்ச்', 'ஏப்ரல்', 'மே', 'ஜூன்', 'ஜூலை', 'ஆகஸ்ட்', 'செப்டம்பர்', 'அக்டோபர்', 'நவம்பர்', 'டிசம்பர்'], - 'months_short' => ['ஜன.', 'பிப்.', 'மார்.', 'ஏப்.', 'மே', 'ஜூன்', 'ஜூலை', 'ஆக.', 'செப்.', 'அக்.', 'நவ.', 'டிச.'], - 'weekdays' => ['ஞாயிறு', 'திங்கள்', 'செவ்வாய்', 'புதன்', 'வியாழன்', 'வெள்ளி', 'சனி'], - 'weekdays_short' => ['ஞாயி.', 'திங்.', 'செவ்.', 'புத.', 'வியா.', 'வெள்.', 'சனி'], - 'weekdays_min' => ['ஞா', 'தி', 'செ', 'பு', 'வி', 'வெ', 'ச'], - 'first_day_of_week' => 1, - 'meridiem' => ['மு.ப', 'பி.ப'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ta_SG.php b/vendor/nesbot/carbon/src/Carbon/Lang/ta_SG.php deleted file mode 100644 index 7dbedeee..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ta_SG.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/ta.php', [ - 'formats' => [ - 'LT' => 'a h:mm', - 'LTS' => 'a h:mm:ss', - 'L' => 'D/M/yy', - 'LL' => 'D MMM, YYYY', - 'LLL' => 'D MMMM, YYYY, a h:mm', - 'LLLL' => 'dddd, D MMMM, YYYY, a h:mm', - ], - 'months' => ['ஜனவரி', 'பிப்ரவரி', 'மார்ச்', 'ஏப்ரல்', 'மே', 'ஜூன்', 'ஜூலை', 'ஆகஸ்ட்', 'செப்டம்பர்', 'அக்டோபர்', 'நவம்பர்', 'டிசம்பர்'], - 'months_short' => ['ஜன.', 'பிப்.', 'மார்.', 'ஏப்.', 'மே', 'ஜூன்', 'ஜூலை', 'ஆக.', 'செப்.', 'அக்.', 'நவ.', 'டிச.'], - 'weekdays' => ['ஞாயிறு', 'திங்கள்', 'செவ்வாய்', 'புதன்', 'வியாழன்', 'வெள்ளி', 'சனி'], - 'weekdays_short' => ['ஞாயி.', 'திங்.', 'செவ்.', 'புத.', 'வியா.', 'வெள்.', 'சனி'], - 'weekdays_min' => ['ஞா', 'தி', 'செ', 'பு', 'வி', 'வெ', 'ச'], - 'meridiem' => ['மு.ப', 'பி.ப'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/tcy.php b/vendor/nesbot/carbon/src/Carbon/Lang/tcy.php deleted file mode 100644 index 2eb99057..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/tcy.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/tcy_IN.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/tcy_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/tcy_IN.php deleted file mode 100644 index 2ff20e0e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/tcy_IN.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - IndLinux.org, Samsung Electronics Co., Ltd. alexey.merzlyakov@samsung.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'D/M/YY', - ], - 'months' => ['ಜನವರಿ', 'ಫೆಬ್ರುವರಿ', 'ಮಾರ್ಚ್', 'ಏಪ್ರಿಲ್‌‌', 'ಮೇ', 'ಜೂನ್', 'ಜುಲೈ', 'ಆಗಸ್ಟ್', 'ಸೆಪ್ಟೆಂಬರ್‌', 'ಅಕ್ಟೋಬರ್', 'ನವೆಂಬರ್', 'ಡಿಸೆಂಬರ್'], - 'months_short' => ['ಜ', 'ಫೆ', 'ಮಾ', 'ಏ', 'ಮೇ', 'ಜೂ', 'ಜು', 'ಆ', 'ಸೆ', 'ಅ', 'ನ', 'ಡಿ'], - 'weekdays' => ['ಐಥಾರ', 'ಸೋಮಾರ', 'ಅಂಗರೆ', 'ಬುಧಾರ', 'ಗುರುವಾರ', 'ಶುಕ್ರರ', 'ಶನಿವಾರ'], - 'weekdays_short' => ['ಐ', 'ಸೋ', 'ಅಂ', 'ಬು', 'ಗು', 'ಶು', 'ಶ'], - 'weekdays_min' => ['ಐ', 'ಸೋ', 'ಅಂ', 'ಬು', 'ಗು', 'ಶು', 'ಶ'], - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['ಕಾಂಡೆ', 'ಬಯ್ಯ'], - - 'year' => ':count ನೀರ್', // less reliable - 'y' => ':count ನೀರ್', // less reliable - 'a_year' => ':count ನೀರ್', // less reliable - - 'month' => ':count ಮೀನ್', // less reliable - 'm' => ':count ಮೀನ್', // less reliable - 'a_month' => ':count ಮೀನ್', // less reliable - - 'day' => ':count ಸುಗ್ಗಿ', // less reliable - 'd' => ':count ಸುಗ್ಗಿ', // less reliable - 'a_day' => ':count ಸುಗ್ಗಿ', // less reliable -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/te.php b/vendor/nesbot/carbon/src/Carbon/Lang/te.php deleted file mode 100644 index ac38218f..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/te.php +++ /dev/null @@ -1,89 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Kunal Marwaha - * - Josh Soref - * - François B - * - kc - */ -return [ - 'year' => ':count సంవత్సరం|:count సంవత్సరాలు', - 'a_year' => 'ఒక సంవత్సరం|:count సంవత్సరాలు', - 'y' => ':count సం.', - 'month' => ':count నెల|:count నెలలు', - 'a_month' => 'ఒక నెల|:count నెలలు', - 'm' => ':count నెల|:count నెల.', - 'week' => ':count వారం|:count వారాలు', - 'a_week' => 'ఒక వారం|:count వారాలు', - 'w' => ':count వార.|:count వారా.', - 'day' => ':count రోజు|:count రోజులు', - 'a_day' => 'ఒక రోజు|:count రోజులు', - 'd' => ':count రోజు|:count రోజు.', - 'hour' => ':count గంట|:count గంటలు', - 'a_hour' => 'ఒక గంట|:count గంటలు', - 'h' => ':count గం.', - 'minute' => ':count నిమిషం|:count నిమిషాలు', - 'a_minute' => 'ఒక నిమిషం|:count నిమిషాలు', - 'min' => ':count నిమి.', - 'second' => ':count సెకను|:count సెకన్లు', - 'a_second' => 'కొన్ని క్షణాలు|:count సెకన్లు', - 's' => ':count సెక.', - 'ago' => ':time క్రితం', - 'from_now' => ':time లో', - 'diff_now' => 'ప్రస్తుతం', - 'diff_today' => 'నేడు', - 'diff_yesterday' => 'నిన్న', - 'diff_tomorrow' => 'రేపు', - 'formats' => [ - 'LT' => 'A h:mm', - 'LTS' => 'A h:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY, A h:mm', - 'LLLL' => 'dddd, D MMMM YYYY, A h:mm', - ], - 'calendar' => [ - 'sameDay' => '[నేడు] LT', - 'nextDay' => '[రేపు] LT', - 'nextWeek' => 'dddd, LT', - 'lastDay' => '[నిన్న] LT', - 'lastWeek' => '[గత] dddd, LT', - 'sameElse' => 'L', - ], - 'ordinal' => ':numberవ', - 'meridiem' => function ($hour) { - if ($hour < 4) { - return 'రాత్రి'; - } - if ($hour < 10) { - return 'ఉదయం'; - } - if ($hour < 17) { - return 'మధ్యాహ్నం'; - } - if ($hour < 20) { - return 'సాయంత్రం'; - } - - return ' రాత్రి'; - }, - 'months' => ['జనవరి', 'ఫిబ్రవరి', 'మార్చి', 'ఏప్రిల్', 'మే', 'జూన్', 'జూలై', 'ఆగస్టు', 'సెప్టెంబర్', 'అక్టోబర్', 'నవంబర్', 'డిసెంబర్'], - 'months_short' => ['జన.', 'ఫిబ్ర.', 'మార్చి', 'ఏప్రి.', 'మే', 'జూన్', 'జూలై', 'ఆగ.', 'సెప్.', 'అక్టో.', 'నవ.', 'డిసె.'], - 'weekdays' => ['ఆదివారం', 'సోమవారం', 'మంగళవారం', 'బుధవారం', 'గురువారం', 'శుక్రవారం', 'శనివారం'], - 'weekdays_short' => ['ఆది', 'సోమ', 'మంగళ', 'బుధ', 'గురు', 'శుక్ర', 'శని'], - 'weekdays_min' => ['ఆ', 'సో', 'మం', 'బు', 'గు', 'శు', 'శ'], - 'list' => ', ', - 'first_day_of_week' => 0, - 'day_of_first_week_of_year' => 1, - 'weekend' => [0, 0], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/te_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/te_IN.php deleted file mode 100644 index 3963f8d5..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/te_IN.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/te.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/teo.php b/vendor/nesbot/carbon/src/Carbon/Lang/teo.php deleted file mode 100644 index ca30c37d..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/teo.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/ta.php', [ - 'meridiem' => ['Taparachu', 'Ebongi'], - 'weekdays' => ['Nakaejuma', 'Nakaebarasa', 'Nakaare', 'Nakauni', 'Nakaung’on', 'Nakakany', 'Nakasabiti'], - 'weekdays_short' => ['Jum', 'Bar', 'Aar', 'Uni', 'Ung', 'Kan', 'Sab'], - 'weekdays_min' => ['Jum', 'Bar', 'Aar', 'Uni', 'Ung', 'Kan', 'Sab'], - 'months' => ['Orara', 'Omuk', 'Okwamg’', 'Odung’el', 'Omaruk', 'Omodok’king’ol', 'Ojola', 'Opedel', 'Osokosokoma', 'Otibar', 'Olabor', 'Opoo'], - 'months_short' => ['Rar', 'Muk', 'Kwa', 'Dun', 'Mar', 'Mod', 'Jol', 'Ped', 'Sok', 'Tib', 'Lab', 'Poo'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/teo_KE.php b/vendor/nesbot/carbon/src/Carbon/Lang/teo_KE.php deleted file mode 100644 index 010a04f5..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/teo_KE.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/teo.php', [ - 'first_day_of_week' => 0, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/tet.php b/vendor/nesbot/carbon/src/Carbon/Lang/tet.php deleted file mode 100644 index d0544d4e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/tet.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Joshua Brooks - * - François B - */ -return [ - 'year' => 'tinan :count', - 'a_year' => '{1}tinan ida|tinan :count', - 'month' => 'fulan :count', - 'a_month' => '{1}fulan ida|fulan :count', - 'week' => 'semana :count', - 'a_week' => '{1}semana ida|semana :count', - 'day' => 'loron :count', - 'a_day' => '{1}loron ida|loron :count', - 'hour' => 'oras :count', - 'a_hour' => '{1}oras ida|oras :count', - 'minute' => 'minutu :count', - 'a_minute' => '{1}minutu ida|minutu :count', - 'second' => 'segundu :count', - 'a_second' => '{1}segundu balun|segundu :count', - 'ago' => ':time liuba', - 'from_now' => 'iha :time', - 'diff_yesterday' => 'Horiseik', - 'diff_yesterday_regexp' => 'Horiseik(?:\\s+iha)?', - 'diff_today' => 'Ohin', - 'diff_today_regexp' => 'Ohin(?:\\s+iha)?', - 'diff_tomorrow' => 'Aban', - 'diff_tomorrow_regexp' => 'Aban(?:\\s+iha)?', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[Ohin iha] LT', - 'nextDay' => '[Aban iha] LT', - 'nextWeek' => 'dddd [iha] LT', - 'lastDay' => '[Horiseik iha] LT', - 'lastWeek' => 'dddd [semana kotuk] [iha] LT', - 'sameElse' => 'L', - ], - 'ordinal' => ':numberº', - 'months' => ['Janeiru', 'Fevereiru', 'Marsu', 'Abril', 'Maiu', 'Juñu', 'Jullu', 'Agustu', 'Setembru', 'Outubru', 'Novembru', 'Dezembru'], - 'months_short' => ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'], - 'weekdays' => ['Domingu', 'Segunda', 'Tersa', 'Kuarta', 'Kinta', 'Sesta', 'Sabadu'], - 'weekdays_short' => ['Dom', 'Seg', 'Ters', 'Kua', 'Kint', 'Sest', 'Sab'], - 'weekdays_min' => ['Do', 'Seg', 'Te', 'Ku', 'Ki', 'Ses', 'Sa'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/tg.php b/vendor/nesbot/carbon/src/Carbon/Lang/tg.php deleted file mode 100644 index b7df893c..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/tg.php +++ /dev/null @@ -1,104 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Orif N. Jr - */ -return [ - 'year' => '{1}як сол|:count сол', - 'month' => '{1}як моҳ|:count моҳ', - 'week' => '{1}як ҳафта|:count ҳафта', - 'day' => '{1}як рӯз|:count рӯз', - 'hour' => '{1}як соат|:count соат', - 'minute' => '{1}як дақиқа|:count дақиқа', - 'second' => '{1}якчанд сония|:count сония', - 'ago' => ':time пеш', - 'from_now' => 'баъди :time', - 'diff_today' => 'Имрӯз', - 'diff_yesterday' => 'Дирӯз', - 'diff_yesterday_regexp' => 'Дирӯз(?:\\s+соати)?', - 'diff_tomorrow' => 'Пагоҳ', - 'diff_tomorrow_regexp' => 'Пагоҳ(?:\\s+соати)?', - 'diff_today_regexp' => 'Имрӯз(?:\\s+соати)?', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[Имрӯз соати] LT', - 'nextDay' => '[Пагоҳ соати] LT', - 'nextWeek' => 'dddd[и] [ҳафтаи оянда соати] LT', - 'lastDay' => '[Дирӯз соати] LT', - 'lastWeek' => 'dddd[и] [ҳафтаи гузашта соати] LT', - 'sameElse' => 'L', - ], - 'ordinal' => function ($number) { - if ($number === 0) { // special case for zero - return "$number-ıncı"; - } - - static $suffixes = [ - 0 => '-ум', - 1 => '-ум', - 2 => '-юм', - 3 => '-юм', - 4 => '-ум', - 5 => '-ум', - 6 => '-ум', - 7 => '-ум', - 8 => '-ум', - 9 => '-ум', - 10 => '-ум', - 12 => '-ум', - 13 => '-ум', - 20 => '-ум', - 30 => '-юм', - 40 => '-ум', - 50 => '-ум', - 60 => '-ум', - 70 => '-ум', - 80 => '-ум', - 90 => '-ум', - 100 => '-ум', - ]; - - return $number.($suffixes[$number] ?? $suffixes[$number % 10] ?? $suffixes[$number >= 100 ? 100 : -1] ?? ''); - }, - 'meridiem' => function ($hour) { - if ($hour < 4) { - return 'шаб'; - } - if ($hour < 11) { - return 'субҳ'; - } - if ($hour < 16) { - return 'рӯз'; - } - if ($hour < 19) { - return 'бегоҳ'; - } - - return 'шаб'; - }, - 'months' => ['январ', 'феврал', 'март', 'апрел', 'май', 'июн', 'июл', 'август', 'сентябр', 'октябр', 'ноябр', 'декабр'], - 'months_short' => ['янв', 'фев', 'мар', 'апр', 'май', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек'], - 'weekdays' => ['якшанбе', 'душанбе', 'сешанбе', 'чоршанбе', 'панҷшанбе', 'ҷумъа', 'шанбе'], - 'weekdays_short' => ['яшб', 'дшб', 'сшб', 'чшб', 'пшб', 'ҷум', 'шнб'], - 'weekdays_min' => ['яш', 'дш', 'сш', 'чш', 'пш', 'ҷм', 'шб'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'list' => [', ', ' ва '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/tg_TJ.php b/vendor/nesbot/carbon/src/Carbon/Lang/tg_TJ.php deleted file mode 100644 index badc7d1f..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/tg_TJ.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/tg.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/th.php b/vendor/nesbot/carbon/src/Carbon/Lang/th.php deleted file mode 100644 index 6397f6e4..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/th.php +++ /dev/null @@ -1,73 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Nate Whittaker - * - John MacAslan - * - Chanintorn Asavavichairoj - * - JD Isaacks - * - ROKAISAKKON - * - RO'KAISAKKON - * - Andreas Möller - * - nithisa - */ -return [ - 'year' => ':count ปี', - 'y' => ':count ปี', - 'month' => ':count เดือน', - 'm' => ':count เดือน', - 'week' => ':count สัปดาห์', - 'w' => ':count สัปดาห์', - 'day' => ':count วัน', - 'd' => ':count วัน', - 'hour' => ':count ชั่วโมง', - 'h' => ':count ชั่วโมง', - 'minute' => ':count นาที', - 'min' => ':count นาที', - 'second' => ':count วินาที', - 'a_second' => '{1}ไม่กี่วินาที|]1,Inf[:count วินาที', - 's' => ':count วินาที', - 'ago' => ':timeที่แล้ว', - 'from_now' => 'อีก :time', - 'after' => ':timeหลังจากนี้', - 'before' => ':timeก่อน', - 'diff_now' => 'ขณะนี้', - 'diff_today' => 'วันนี้', - 'diff_today_regexp' => 'วันนี้(?:\\s+เวลา)?', - 'diff_yesterday' => 'เมื่อวาน', - 'diff_yesterday_regexp' => 'เมื่อวานนี้(?:\\s+เวลา)?', - 'diff_tomorrow' => 'พรุ่งนี้', - 'diff_tomorrow_regexp' => 'พรุ่งนี้(?:\\s+เวลา)?', - 'formats' => [ - 'LT' => 'H:mm', - 'LTS' => 'H:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY เวลา H:mm', - 'LLLL' => 'วันddddที่ D MMMM YYYY เวลา H:mm', - ], - 'calendar' => [ - 'sameDay' => '[วันนี้ เวลา] LT', - 'nextDay' => '[พรุ่งนี้ เวลา] LT', - 'nextWeek' => 'dddd[หน้า เวลา] LT', - 'lastDay' => '[เมื่อวานนี้ เวลา] LT', - 'lastWeek' => '[วัน]dddd[ที่แล้ว เวลา] LT', - 'sameElse' => 'L', - ], - 'meridiem' => ['ก่อนเที่ยง', 'หลังเที่ยง'], - 'months' => ['มกราคม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', 'กรกฎาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน', 'ธันวาคม'], - 'months_short' => ['ม.ค.', 'ก.พ.', 'มี.ค.', 'เม.ย.', 'พ.ค.', 'มิ.ย.', 'ก.ค.', 'ส.ค.', 'ก.ย.', 'ต.ค.', 'พ.ย.', 'ธ.ค.'], - 'weekdays' => ['อาทิตย์', 'จันทร์', 'อังคาร', 'พุธ', 'พฤหัสบดี', 'ศุกร์', 'เสาร์'], - 'weekdays_short' => ['อาทิตย์', 'จันทร์', 'อังคาร', 'พุธ', 'พฤหัส', 'ศุกร์', 'เสาร์'], - 'weekdays_min' => ['อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.'], - 'list' => [', ', ' และ '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/th_TH.php b/vendor/nesbot/carbon/src/Carbon/Lang/th_TH.php deleted file mode 100644 index b9f94b2d..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/th_TH.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/th.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/the.php b/vendor/nesbot/carbon/src/Carbon/Lang/the.php deleted file mode 100644 index 85f8333b..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/the.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/the_NP.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/the_NP.php b/vendor/nesbot/carbon/src/Carbon/Lang/the_NP.php deleted file mode 100644 index 34da1627..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/the_NP.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Chitwanix OS Development info@chitwanix.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'dddd DD MMM YYYY', - ], - 'months' => ['जनवरी', 'फ़रवरी', 'मार्च', 'अप्रेल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर'], - 'months_short' => ['जनवरी', 'फ़रवरी', 'मार्च', 'अप्रेल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर'], - 'weekdays' => ['आइतबार', 'सोमबार', 'मंगलबार', 'बुधबार', 'बिहिबार', 'शुक्रबार', 'शनिबार'], - 'weekdays_short' => ['आइत', 'सोम', 'मंगल', 'बुध', 'बिहि', 'शुक्र', 'शनि'], - 'weekdays_min' => ['आइत', 'सोम', 'मंगल', 'बुध', 'बिहि', 'शुक्र', 'शनि'], - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['पूर्वाह्न', 'अपराह्न'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ti.php b/vendor/nesbot/carbon/src/Carbon/Lang/ti.php deleted file mode 100644 index ffd32369..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ti.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/ti_ER.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ti_ER.php b/vendor/nesbot/carbon/src/Carbon/Lang/ti_ER.php deleted file mode 100644 index 310c51cc..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ti_ER.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Ge'ez Frontier Foundation locales@geez.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YYYY', - ], - 'months' => ['ጥሪ', 'ለካቲት', 'መጋቢት', 'ሚያዝያ', 'ግንቦት', 'ሰነ', 'ሓምለ', 'ነሓሰ', 'መስከረም', 'ጥቅምቲ', 'ሕዳር', 'ታሕሳስ'], - 'months_short' => ['ጥሪ ', 'ለካቲ', 'መጋቢ', 'ሚያዝ', 'ግንቦ', 'ሰነ ', 'ሓምለ', 'ነሓሰ', 'መስከ', 'ጥቅም', 'ሕዳር', 'ታሕሳ'], - 'weekdays' => ['ሰንበት', 'ሰኑይ', 'ሰሉስ', 'ረቡዕ', 'ሓሙስ', 'ዓርቢ', 'ቀዳም'], - 'weekdays_short' => ['ሰንበ', 'ሰኑይ', 'ሰሉስ', 'ረቡዕ', 'ሓሙስ', 'ዓርቢ', 'ቀዳም'], - 'weekdays_min' => ['ሰንበ', 'ሰኑይ', 'ሰሉስ', 'ረቡዕ', 'ሓሙስ', 'ዓርቢ', 'ቀዳም'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['ንጉሆ ሰዓተ', 'ድሕር ሰዓት'], - - 'year' => ':count ዓመት', - 'y' => ':count ዓመት', - 'a_year' => ':count ዓመት', - - 'month' => 'ወርሒ :count', - 'm' => 'ወርሒ :count', - 'a_month' => 'ወርሒ :count', - - 'week' => ':count ሰሙን', - 'w' => ':count ሰሙን', - 'a_week' => ':count ሰሙን', - - 'day' => ':count መዓልቲ', - 'd' => ':count መዓልቲ', - 'a_day' => ':count መዓልቲ', - - 'hour' => ':count ሰዓት', - 'h' => ':count ሰዓት', - 'a_hour' => ':count ሰዓት', - - 'minute' => ':count ደቒቕ', - 'min' => ':count ደቒቕ', - 'a_minute' => ':count ደቒቕ', - - 'second' => ':count ሰከንድ', - 's' => ':count ሰከንድ', - 'a_second' => ':count ሰከንድ', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ti_ET.php b/vendor/nesbot/carbon/src/Carbon/Lang/ti_ET.php deleted file mode 100644 index 024217f2..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ti_ET.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Ge'ez Frontier Foundation locales@geez.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YYYY', - ], - 'months' => ['ጃንዩወሪ', 'ፌብሩወሪ', 'ማርች', 'ኤፕረል', 'ሜይ', 'ጁን', 'ጁላይ', 'ኦገስት', 'ሴፕቴምበር', 'ኦክተውበር', 'ኖቬምበር', 'ዲሴምበር'], - 'months_short' => ['ጃንዩ', 'ፌብሩ', 'ማርች', 'ኤፕረ', 'ሜይ ', 'ጁን ', 'ጁላይ', 'ኦገስ', 'ሴፕቴ', 'ኦክተ', 'ኖቬም', 'ዲሴም'], - 'weekdays' => ['ሰንበት', 'ሰኑይ', 'ሰሉስ', 'ረቡዕ', 'ሓሙስ', 'ዓርቢ', 'ቀዳም'], - 'weekdays_short' => ['ሰንበ', 'ሰኑይ', 'ሰሉስ', 'ረቡዕ', 'ሓሙስ', 'ዓርቢ', 'ቀዳም'], - 'weekdays_min' => ['ሰንበ', 'ሰኑይ', 'ሰሉስ', 'ረቡዕ', 'ሓሙስ', 'ዓርቢ', 'ቀዳም'], - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['ንጉሆ ሰዓተ', 'ድሕር ሰዓት'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/tig.php b/vendor/nesbot/carbon/src/Carbon/Lang/tig.php deleted file mode 100644 index 186fe713..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/tig.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/tig_ER.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/tig_ER.php b/vendor/nesbot/carbon/src/Carbon/Lang/tig_ER.php deleted file mode 100644 index 46887b05..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/tig_ER.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Ge'ez Frontier Foundation locales@geez.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YYYY', - ], - 'months' => ['ጥሪ', 'ለካቲት', 'መጋቢት', 'ሚያዝያ', 'ግንቦት', 'ሰነ', 'ሓምለ', 'ነሓሰ', 'መስከረም', 'ጥቅምቲ', 'ሕዳር', 'ታሕሳስ'], - 'months_short' => ['ጥሪ ', 'ለካቲ', 'መጋቢ', 'ሚያዝ', 'ግንቦ', 'ሰነ ', 'ሓምለ', 'ነሓሰ', 'መስከ', 'ጥቅም', 'ሕዳር', 'ታሕሳ'], - 'weekdays' => ['ሰንበት ዓባይ', 'ሰኖ', 'ታላሸኖ', 'ኣረርባዓ', 'ከሚሽ', 'ጅምዓት', 'ሰንበት ንኢሽ'], - 'weekdays_short' => ['ሰ//ዓ', 'ሰኖ ', 'ታላሸ', 'ኣረር', 'ከሚሽ', 'ጅምዓ', 'ሰ//ን'], - 'weekdays_min' => ['ሰ//ዓ', 'ሰኖ ', 'ታላሸ', 'ኣረር', 'ከሚሽ', 'ጅምዓ', 'ሰ//ን'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['ቀደም ሰር ምዕል', 'ሓቆ ሰር ምዕል'], - - 'year' => ':count ማይ', // less reliable - 'y' => ':count ማይ', // less reliable - 'a_year' => ':count ማይ', // less reliable - - 'month' => ':count ሸምሽ', // less reliable - 'm' => ':count ሸምሽ', // less reliable - 'a_month' => ':count ሸምሽ', // less reliable - - 'week' => ':count ሰቡዕ', // less reliable - 'w' => ':count ሰቡዕ', // less reliable - 'a_week' => ':count ሰቡዕ', // less reliable - - 'day' => ':count ዎሮ', // less reliable - 'd' => ':count ዎሮ', // less reliable - 'a_day' => ':count ዎሮ', // less reliable - - 'hour' => ':count ሰዓት', // less reliable - 'h' => ':count ሰዓት', // less reliable - 'a_hour' => ':count ሰዓት', // less reliable - - 'minute' => ':count ካልኣይት', // less reliable - 'min' => ':count ካልኣይት', // less reliable - 'a_minute' => ':count ካልኣይት', // less reliable - - 'second' => ':count ካልኣይ', - 's' => ':count ካልኣይ', - 'a_second' => ':count ካልኣይ', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/tk.php b/vendor/nesbot/carbon/src/Carbon/Lang/tk.php deleted file mode 100644 index d8f7d19d..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/tk.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/tk_TM.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/tk_TM.php b/vendor/nesbot/carbon/src/Carbon/Lang/tk_TM.php deleted file mode 100644 index f949a430..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/tk_TM.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Authors: - * - Ghorban M. Tavakoly Pablo Saratxaga & Ghorban M. Tavakoly pablo@walon.org & gmt314@yahoo.com - * - SuperManPHP - * - Maksat Meredow (isadma) - */ -$transformDiff = function ($input) { - return strtr($input, [ - 'sekunt' => 'sekunt', - 'hepde' => 'hepde', - ]); -}; - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD.MM.YYYY', - ], - 'months' => ['Ýanwar', 'Fewral', 'Mart', 'Aprel', 'Maý', 'Iýun', 'Iýul', 'Awgust', 'Sentýabr', 'Oktýabr', 'Noýabr', 'Dekabr'], - 'months_short' => ['Ýan', 'Few', 'Mar', 'Apr', 'Maý', 'Iýn', 'Iýl', 'Awg', 'Sen', 'Okt', 'Noý', 'Dek'], - 'weekdays' => ['Duşenbe', 'Sişenbe', 'Çarşenbe', 'Penşenbe', 'Anna', 'Şenbe', 'Ýekşenbe'], - 'weekdays_short' => ['Duş', 'Siş', 'Çar', 'Pen', 'Ann', 'Şen', 'Ýek'], - 'weekdays_min' => ['Du', 'Si', 'Ça', 'Pe', 'An', 'Şe', 'Ýe'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - - 'year' => ':count ýyl', - 'y' => ':count ýyl', - 'a_year' => ':count ýyl', - - 'month' => ':count aý', - 'm' => ':count aý', - 'a_month' => ':count aý', - - 'week' => ':count hepde', - 'w' => ':count hepde', - 'a_week' => ':count hepde', - - 'day' => ':count gün', - 'd' => ':count gün', - 'a_day' => ':count gün', - - 'hour' => ':count sagat', - 'h' => ':count sagat', - 'a_hour' => ':count sagat', - - 'minute' => ':count minut', - 'min' => ':count minut', - 'a_minute' => ':count minut', - - 'second' => ':count sekunt', - 's' => ':count sekunt', - 'a_second' => ':count sekunt', - - 'ago' => function ($time) use ($transformDiff) { - return $transformDiff($time).' ozal'; - }, - 'from_now' => function ($time) use ($transformDiff) { - return $transformDiff($time).' soňra'; - }, - 'after' => function ($time) use ($transformDiff) { - return $transformDiff($time).' soň'; - }, - 'before' => function ($time) use ($transformDiff) { - return $transformDiff($time).' öň'; - }, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/tl.php b/vendor/nesbot/carbon/src/Carbon/Lang/tl.php deleted file mode 100644 index 410a2660..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/tl.php +++ /dev/null @@ -1,61 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return [ - 'year' => ':count taon', - 'a_year' => '{1}isang taon|:count taon', - 'month' => ':count buwan', - 'a_month' => '{1}isang buwan|:count buwan', - 'week' => ':count linggo', - 'a_week' => '{1}isang linggo|:count linggo', - 'day' => ':count araw', - 'a_day' => '{1}isang araw|:count araw', - 'hour' => ':count oras', - 'a_hour' => '{1}isang oras|:count oras', - 'minute' => ':count minuto', - 'a_minute' => '{1}isang minuto|:count minuto', - 'min' => ':count min.', - 'second' => ':count segundo', - 'a_second' => '{1}ilang segundo|:count segundo', - 's' => ':count seg.', - 'ago' => ':time ang nakalipas', - 'from_now' => 'sa loob ng :time', - 'diff_now' => 'ngayon', - 'diff_today' => 'ngayong', - 'diff_today_regexp' => 'ngayong(?:\\s+araw)?', - 'diff_yesterday' => 'kahapon', - 'diff_tomorrow' => 'bukas', - 'diff_tomorrow_regexp' => 'Bukas(?:\\s+ng)?', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'MM/D/YYYY', - 'LL' => 'MMMM D, YYYY', - 'LLL' => 'MMMM D, YYYY HH:mm', - 'LLLL' => 'dddd, MMMM DD, YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => 'LT [ngayong araw]', - 'nextDay' => '[Bukas ng] LT', - 'nextWeek' => 'LT [sa susunod na] dddd', - 'lastDay' => 'LT [kahapon]', - 'lastWeek' => 'LT [noong nakaraang] dddd', - 'sameElse' => 'L', - ], - 'months' => ['Enero', 'Pebrero', 'Marso', 'Abril', 'Mayo', 'Hunyo', 'Hulyo', 'Agosto', 'Setyembre', 'Oktubre', 'Nobyembre', 'Disyembre'], - 'months_short' => ['Ene', 'Peb', 'Mar', 'Abr', 'May', 'Hun', 'Hul', 'Ago', 'Set', 'Okt', 'Nob', 'Dis'], - 'weekdays' => ['Linggo', 'Lunes', 'Martes', 'Miyerkules', 'Huwebes', 'Biyernes', 'Sabado'], - 'weekdays_short' => ['Lin', 'Lun', 'Mar', 'Miy', 'Huw', 'Biy', 'Sab'], - 'weekdays_min' => ['Li', 'Lu', 'Ma', 'Mi', 'Hu', 'Bi', 'Sab'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' at '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/tl_PH.php b/vendor/nesbot/carbon/src/Carbon/Lang/tl_PH.php deleted file mode 100644 index 95f508c3..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/tl_PH.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - François B - * - Ian De La Cruz - * - JD Isaacks - */ -return require __DIR__.'/tl.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/tlh.php b/vendor/nesbot/carbon/src/Carbon/Lang/tlh.php deleted file mode 100644 index fbf9e6f7..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/tlh.php +++ /dev/null @@ -1,72 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - François B - * - Serhan Apaydın - * - Dominika - */ -return [ - 'year' => '{1}wa’ DIS|:count DIS', - 'month' => '{1}wa’ jar|:count jar', - 'week' => '{1}wa’ hogh|:count hogh', - 'day' => '{1}wa’ jaj|:count jaj', - 'hour' => '{1}wa’ rep|:count rep', - 'minute' => '{1}wa’ tup|:count tup', - 'second' => '{1}puS lup|:count lup', - 'ago' => function ($time) { - $output = strtr($time, [ - 'jaj' => 'Hu’', - 'jar' => 'wen', - 'DIS' => 'ben', - ]); - - return $output === $time ? "$time ret" : $output; - }, - 'from_now' => function ($time) { - $output = strtr($time, [ - 'jaj' => 'leS', - 'jar' => 'waQ', - 'DIS' => 'nem', - ]); - - return $output === $time ? "$time pIq" : $output; - }, - 'diff_yesterday' => 'wa’Hu’', - 'diff_today' => 'DaHjaj', - 'diff_tomorrow' => 'wa’leS', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD.MM.YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[DaHjaj] LT', - 'nextDay' => '[wa’leS] LT', - 'nextWeek' => 'LLL', - 'lastDay' => '[wa’Hu’] LT', - 'lastWeek' => 'LLL', - 'sameElse' => 'L', - ], - 'ordinal' => ':number.', - 'months' => ['tera’ jar wa’', 'tera’ jar cha’', 'tera’ jar wej', 'tera’ jar loS', 'tera’ jar vagh', 'tera’ jar jav', 'tera’ jar Soch', 'tera’ jar chorgh', 'tera’ jar Hut', 'tera’ jar wa’maH', 'tera’ jar wa’maH wa’', 'tera’ jar wa’maH cha’'], - 'months_short' => ['jar wa’', 'jar cha’', 'jar wej', 'jar loS', 'jar vagh', 'jar jav', 'jar Soch', 'jar chorgh', 'jar Hut', 'jar wa’maH', 'jar wa’maH wa’', 'jar wa’maH cha’'], - 'weekdays' => ['lojmItjaj', 'DaSjaj', 'povjaj', 'ghItlhjaj', 'loghjaj', 'buqjaj', 'ghInjaj'], - 'weekdays_short' => ['lojmItjaj', 'DaSjaj', 'povjaj', 'ghItlhjaj', 'loghjaj', 'buqjaj', 'ghInjaj'], - 'weekdays_min' => ['lojmItjaj', 'DaSjaj', 'povjaj', 'ghItlhjaj', 'loghjaj', 'buqjaj', 'ghInjaj'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' ’ej '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/tn.php b/vendor/nesbot/carbon/src/Carbon/Lang/tn.php deleted file mode 100644 index f29bdf68..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/tn.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/tn_ZA.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/tn_ZA.php b/vendor/nesbot/carbon/src/Carbon/Lang/tn_ZA.php deleted file mode 100644 index aada7db5..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/tn_ZA.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Zuza Software Foundation (Translate.org.za) Dwayne Bailey dwayne@translate.org.za - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YYYY', - ], - 'months' => ['Ferikgong', 'Tlhakole', 'Mopitlwe', 'Moranang', 'Motsheganong', 'Seetebosigo', 'Phukwi', 'Phatwe', 'Lwetse', 'Diphalane', 'Ngwanatsele', 'Sedimonthole'], - 'months_short' => ['Fer', 'Tlh', 'Mop', 'Mor', 'Mot', 'See', 'Phu', 'Pha', 'Lwe', 'Dip', 'Ngw', 'Sed'], - 'weekdays' => ['laTshipi', 'Mosupologo', 'Labobedi', 'Laboraro', 'Labone', 'Labotlhano', 'Lamatlhatso'], - 'weekdays_short' => ['Tsh', 'Mos', 'Bed', 'Rar', 'Ne', 'Tlh', 'Mat'], - 'weekdays_min' => ['Tsh', 'Mos', 'Bed', 'Rar', 'Ne', 'Tlh', 'Mat'], - 'day_of_first_week_of_year' => 1, - - 'year' => 'dingwaga di le :count', - 'y' => 'dingwaga di le :count', - 'a_year' => 'dingwaga di le :count', - - 'month' => 'dikgwedi di le :count', - 'm' => 'dikgwedi di le :count', - 'a_month' => 'dikgwedi di le :count', - - 'week' => 'dibeke di le :count', - 'w' => 'dibeke di le :count', - 'a_week' => 'dibeke di le :count', - - 'day' => 'malatsi :count', - 'd' => 'malatsi :count', - 'a_day' => 'malatsi :count', - - 'hour' => 'diura di le :count', - 'h' => 'diura di le :count', - 'a_hour' => 'diura di le :count', - - 'minute' => 'metsotso e le :count', - 'min' => 'metsotso e le :count', - 'a_minute' => 'metsotso e le :count', - - 'second' => 'metsotswana e le :count', - 's' => 'metsotswana e le :count', - 'a_second' => 'metsotswana e le :count', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/to.php b/vendor/nesbot/carbon/src/Carbon/Lang/to.php deleted file mode 100644 index 20581bba..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/to.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/to_TO.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/to_TO.php b/vendor/nesbot/carbon/src/Carbon/Lang/to_TO.php deleted file mode 100644 index 335c69a8..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/to_TO.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - International Components for Unicode akhilesh.k@samsung.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'dddd DD MMM YYYY', - ], - 'months' => ['Sānuali', 'Fēpueli', 'Maʻasi', 'ʻEpeleli', 'Mē', 'Sune', 'Siulai', 'ʻAokosi', 'Sepitema', 'ʻOkatopa', 'Nōvema', 'Tīsema'], - 'months_short' => ['Sān', 'Fēp', 'Maʻa', 'ʻEpe', 'Mē', 'Sun', 'Siu', 'ʻAok', 'Sep', 'ʻOka', 'Nōv', 'Tīs'], - 'weekdays' => ['Sāpate', 'Mōnite', 'Tūsite', 'Pulelulu', 'Tuʻapulelulu', 'Falaite', 'Tokonaki'], - 'weekdays_short' => ['Sāp', 'Mōn', 'Tūs', 'Pul', 'Tuʻa', 'Fal', 'Tok'], - 'weekdays_min' => ['Sāp', 'Mōn', 'Tūs', 'Pul', 'Tuʻa', 'Fal', 'Tok'], - 'meridiem' => ['hengihengi', 'efiafi'], - - 'year' => ':count fitu', // less reliable - 'y' => ':count fitu', // less reliable - 'a_year' => ':count fitu', // less reliable - - 'month' => ':count mahina', // less reliable - 'm' => ':count mahina', // less reliable - 'a_month' => ':count mahina', // less reliable - - 'week' => ':count Sapate', // less reliable - 'w' => ':count Sapate', // less reliable - 'a_week' => ':count Sapate', // less reliable - - 'day' => ':count ʻaho', // less reliable - 'd' => ':count ʻaho', // less reliable - 'a_day' => ':count ʻaho', // less reliable - - 'hour' => ':count houa', - 'h' => ':count houa', - 'a_hour' => ':count houa', - - 'minute' => ':count miniti', - 'min' => ':count miniti', - 'a_minute' => ':count miniti', - - 'second' => ':count sekoni', - 's' => ':count sekoni', - 'a_second' => ':count sekoni', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/tpi.php b/vendor/nesbot/carbon/src/Carbon/Lang/tpi.php deleted file mode 100644 index 7d38daed..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/tpi.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/tpi_PG.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/tpi_PG.php b/vendor/nesbot/carbon/src/Carbon/Lang/tpi_PG.php deleted file mode 100644 index 5f58c44c..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/tpi_PG.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Samsung Electronics Co., Ltd. akhilesh.k@samsung.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YYYY', - ], - 'months' => ['Janueri', 'Februeri', 'Mas', 'Epril', 'Me', 'Jun', 'Julai', 'Ogas', 'Septemba', 'Oktoba', 'Novemba', 'Desemba'], - 'months_short' => ['Jan', 'Feb', 'Mas', 'Epr', 'Me', 'Jun', 'Jul', 'Oga', 'Sep', 'Okt', 'Nov', 'Des'], - 'weekdays' => ['Sande', 'Mande', 'Tunde', 'Trinde', 'Fonde', 'Fraide', 'Sarere'], - 'weekdays_short' => ['San', 'Man', 'Tun', 'Tri', 'Fon', 'Fra', 'Sar'], - 'weekdays_min' => ['San', 'Man', 'Tun', 'Tri', 'Fon', 'Fra', 'Sar'], - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['biknait', 'apinun'], - - 'year' => 'yia :count', - 'y' => 'yia :count', - 'a_year' => 'yia :count', - - 'month' => ':count mun', - 'm' => ':count mun', - 'a_month' => ':count mun', - - 'week' => ':count wik', - 'w' => ':count wik', - 'a_week' => ':count wik', - - 'day' => ':count de', - 'd' => ':count de', - 'a_day' => ':count de', - - 'hour' => ':count aua', - 'h' => ':count aua', - 'a_hour' => ':count aua', - - 'minute' => ':count minit', - 'min' => ':count minit', - 'a_minute' => ':count minit', - - 'second' => ':count namba tu', - 's' => ':count namba tu', - 'a_second' => ':count namba tu', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/tr.php b/vendor/nesbot/carbon/src/Carbon/Lang/tr.php deleted file mode 100644 index f5d9f4cc..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/tr.php +++ /dev/null @@ -1,121 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Josh Soref - * - Alan Agius - * - Erhan Gundogan - * - François B - * - JD Isaacks - * - Murat Yüksel - * - Baran Şengül - * - Selami (selamialtin) - * - TeomanBey - */ -return [ - 'year' => ':count yıl', - 'a_year' => '{1}bir yıl|]1,Inf[:count yıl', - 'y' => ':county', - 'month' => ':count ay', - 'a_month' => '{1}bir ay|]1,Inf[:count ay', - 'm' => ':countay', - 'week' => ':count hafta', - 'a_week' => '{1}bir hafta|]1,Inf[:count hafta', - 'w' => ':counth', - 'day' => ':count gün', - 'a_day' => '{1}bir gün|]1,Inf[:count gün', - 'd' => ':countg', - 'hour' => ':count saat', - 'a_hour' => '{1}bir saat|]1,Inf[:count saat', - 'h' => ':countsa', - 'minute' => ':count dakika', - 'a_minute' => '{1}bir dakika|]1,Inf[:count dakika', - 'min' => ':countdk', - 'second' => ':count saniye', - 'a_second' => '{1}birkaç saniye|]1,Inf[:count saniye', - 's' => ':countsn', - 'ago' => ':time önce', - 'from_now' => ':time sonra', - 'after' => ':time sonra', - 'before' => ':time önce', - 'diff_now' => 'şimdi', - 'diff_today' => 'bugün', - 'diff_today_regexp' => 'bugün(?:\\s+saat)?', - 'diff_yesterday' => 'dün', - 'diff_tomorrow' => 'yarın', - 'diff_tomorrow_regexp' => 'yarın(?:\\s+saat)?', - 'diff_before_yesterday' => 'evvelsi gün', - 'diff_after_tomorrow' => 'öbür gün', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD.MM.YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[bugün saat] LT', - 'nextDay' => '[yarın saat] LT', - 'nextWeek' => '[gelecek] dddd [saat] LT', - 'lastDay' => '[dün] LT', - 'lastWeek' => '[geçen] dddd [saat] LT', - 'sameElse' => 'L', - ], - 'ordinal' => function ($number, $period) { - switch ($period) { - case 'd': - case 'D': - case 'Do': - case 'DD': - return $number; - default: - if ($number === 0) { // special case for zero - return "$number'ıncı"; - } - - static $suffixes = [ - 1 => '\'inci', - 5 => '\'inci', - 8 => '\'inci', - 70 => '\'inci', - 80 => '\'inci', - 2 => '\'nci', - 7 => '\'nci', - 20 => '\'nci', - 50 => '\'nci', - 3 => '\'üncü', - 4 => '\'üncü', - 100 => '\'üncü', - 6 => '\'ncı', - 9 => '\'uncu', - 10 => '\'uncu', - 30 => '\'uncu', - 60 => '\'ıncı', - 90 => '\'ıncı', - ]; - - $lastDigit = $number % 10; - - return $number.($suffixes[$lastDigit] ?? $suffixes[$number % 100 - $lastDigit] ?? $suffixes[$number >= 100 ? 100 : -1] ?? ''); - } - }, - 'meridiem' => ['ÖÖ', 'ÖS', 'öö', 'ös'], - 'months' => ['Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran', 'Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım', 'Aralık'], - 'months_short' => ['Oca', 'Şub', 'Mar', 'Nis', 'May', 'Haz', 'Tem', 'Ağu', 'Eyl', 'Eki', 'Kas', 'Ara'], - 'weekdays' => ['Pazar', 'Pazartesi', 'Salı', 'Çarşamba', 'Perşembe', 'Cuma', 'Cumartesi'], - 'weekdays_short' => ['Paz', 'Pts', 'Sal', 'Çar', 'Per', 'Cum', 'Cts'], - 'weekdays_min' => ['Pz', 'Pt', 'Sa', 'Ça', 'Pe', 'Cu', 'Ct'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'list' => [', ', ' ve '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/tr_CY.php b/vendor/nesbot/carbon/src/Carbon/Lang/tr_CY.php deleted file mode 100644 index 23f11449..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/tr_CY.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/tr.php', [ - 'weekdays_short' => ['Paz', 'Pzt', 'Sal', 'Çar', 'Per', 'Cum', 'Cmt'], - 'weekdays_min' => ['Pa', 'Pt', 'Sa', 'Ça', 'Pe', 'Cu', 'Ct'], - 'formats' => [ - 'LT' => 'h:mm a', - 'LTS' => 'h:mm:ss a', - 'L' => 'D.MM.YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY h:mm a', - 'LLLL' => 'D MMMM YYYY dddd h:mm a', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/tr_TR.php b/vendor/nesbot/carbon/src/Carbon/Lang/tr_TR.php deleted file mode 100644 index 9e994824..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/tr_TR.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/tr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ts.php b/vendor/nesbot/carbon/src/Carbon/Lang/ts.php deleted file mode 100644 index 525736bf..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ts.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/ts_ZA.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ts_ZA.php b/vendor/nesbot/carbon/src/Carbon/Lang/ts_ZA.php deleted file mode 100644 index 37a24ec4..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ts_ZA.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Zuza Software Foundation (Translate.org.za) Dwayne Bailey dwayne@translate.org.za - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YYYY', - ], - 'months' => ['Sunguti', 'Nyenyenyani', 'Nyenyankulu', 'Dzivamisoko', 'Mudyaxihi', 'Khotavuxika', 'Mawuwani', 'Mhawuri', 'Ndzhati', 'Nhlangula', 'Hukuri', 'N\'wendzamhala'], - 'months_short' => ['Sun', 'Yan', 'Kul', 'Dzi', 'Mud', 'Kho', 'Maw', 'Mha', 'Ndz', 'Nhl', 'Huk', 'N\'w'], - 'weekdays' => ['Sonto', 'Musumbhunuku', 'Ravumbirhi', 'Ravunharhu', 'Ravumune', 'Ravuntlhanu', 'Mugqivela'], - 'weekdays_short' => ['Son', 'Mus', 'Bir', 'Har', 'Ne', 'Tlh', 'Mug'], - 'weekdays_min' => ['Son', 'Mus', 'Bir', 'Har', 'Ne', 'Tlh', 'Mug'], - 'day_of_first_week_of_year' => 1, - - 'year' => 'malembe ya :count', - 'y' => 'malembe ya :count', - 'a_year' => 'malembe ya :count', - - 'month' => 'tin’hweti ta :count', - 'm' => 'tin’hweti ta :count', - 'a_month' => 'tin’hweti ta :count', - - 'week' => 'mavhiki ya :count', - 'w' => 'mavhiki ya :count', - 'a_week' => 'mavhiki ya :count', - - 'day' => 'masiku :count', - 'd' => 'masiku :count', - 'a_day' => 'masiku :count', - - 'hour' => 'tiawara ta :count', - 'h' => 'tiawara ta :count', - 'a_hour' => 'tiawara ta :count', - - 'minute' => 'timinete ta :count', - 'min' => 'timinete ta :count', - 'a_minute' => 'timinete ta :count', - - 'second' => 'tisekoni ta :count', - 's' => 'tisekoni ta :count', - 'a_second' => 'tisekoni ta :count', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/tt.php b/vendor/nesbot/carbon/src/Carbon/Lang/tt.php deleted file mode 100644 index d67d896e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/tt.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/tt_RU.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/tt_RU.php b/vendor/nesbot/carbon/src/Carbon/Lang/tt_RU.php deleted file mode 100644 index 38e42d05..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/tt_RU.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Rinat Norkin Pablo Saratxaga, Rinat Norkin pablo@mandrakesoft.com, rinat@taif.ru - */ -return [ - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD.MM.YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'DD MMM, HH:mm', - 'LLLL' => 'DD MMMM YYYY, HH:mm', - ], - 'months' => ['января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря'], - 'months_short' => ['янв', 'фев', 'мар', 'апр', 'май', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек'], - 'weekdays' => ['якшәмбе', 'дышәмбе', 'сишәмбе', 'чәршәәмбе', 'пәнҗешмбе', 'җомга', 'шимбә'], - 'weekdays_short' => ['якш', 'дыш', 'сиш', 'чәрш', 'пәнҗ', 'җом', 'шим'], - 'weekdays_min' => ['якш', 'дыш', 'сиш', 'чәрш', 'пәнҗ', 'җом', 'шим'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'year' => ':count ел', - 'month' => ':count ай', - 'week' => ':count атна', - 'day' => ':count көн', - 'hour' => ':count сәгать', - 'minute' => ':count минут', - 'second' => ':count секунд', -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/tt_RU@iqtelif.php b/vendor/nesbot/carbon/src/Carbon/Lang/tt_RU@iqtelif.php deleted file mode 100644 index 16b8efb1..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/tt_RU@iqtelif.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Reshat Sabiq tatar.iqtelif.i18n@gmail.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD.MM.YYYY', - ], - 'months' => ['Ğınwar', 'Fiwral\'', 'Mart', 'April', 'May', 'Yün', 'Yül', 'Awgust', 'Sintebír', 'Üktebír', 'Noyebír', 'Dikebír'], - 'months_short' => ['Ğın', 'Fiw', 'Mar', 'Apr', 'May', 'Yün', 'Yül', 'Awg', 'Sin', 'Ükt', 'Noy', 'Dik'], - 'weekdays' => ['Yekşembí', 'Düşembí', 'Sişembí', 'Çerşembí', 'Pencíşembí', 'Comğa', 'Şimbe'], - 'weekdays_short' => ['Yek', 'Düş', 'Siş', 'Çer', 'Pen', 'Com', 'Şim'], - 'weekdays_min' => ['Yek', 'Düş', 'Siş', 'Çer', 'Pen', 'Com', 'Şim'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['ÖA', 'ÖS'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/twq.php b/vendor/nesbot/carbon/src/Carbon/Lang/twq.php deleted file mode 100644 index 5cbb46e0..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/twq.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/ses.php', [ - 'meridiem' => ['Subbaahi', 'Zaarikay b'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/tzl.php b/vendor/nesbot/carbon/src/Carbon/Lang/tzl.php deleted file mode 100644 index 50bf26d2..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/tzl.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return [ - 'year' => '[0,1]:count ar|:count ars', - 'y' => '[0,1]:count ar|:count ars', - 'month' => '[0,1]:count mes|:count mesen', - 'm' => '[0,1]:count mes|:count mesen', - 'week' => '[0,1]:count seifetziua|:count seifetziuas', - 'w' => '[0,1]:count seifetziua|:count seifetziuas', - 'day' => '[0,1]:count ziua|:count ziuas', - 'd' => '[0,1]:count ziua|:count ziuas', - 'hour' => '[0,1]:count þora|:count þoras', - 'h' => '[0,1]:count þora|:count þoras', - 'minute' => '[0,1]:count míut|:count míuts', - 'min' => '[0,1]:count míut|:count míuts', - 'second' => ':count secunds', - 's' => ':count secunds', - - 'ago' => 'ja :time', - 'from_now' => 'osprei :time', - - 'diff_yesterday' => 'ieiri', - 'diff_yesterday_regexp' => 'ieiri(?:\\s+à)?', - 'diff_today' => 'oxhi', - 'diff_today_regexp' => 'oxhi(?:\\s+à)?', - 'diff_tomorrow' => 'demà', - 'diff_tomorrow_regexp' => 'demà(?:\\s+à)?', - - 'formats' => [ - 'LT' => 'HH.mm', - 'LTS' => 'HH.mm.ss', - 'L' => 'DD.MM.YYYY', - 'LL' => 'D. MMMM [dallas] YYYY', - 'LLL' => 'D. MMMM [dallas] YYYY HH.mm', - 'LLLL' => 'dddd, [li] D. MMMM [dallas] YYYY HH.mm', - ], - - 'calendar' => [ - 'sameDay' => '[oxhi à] LT', - 'nextDay' => '[demà à] LT', - 'nextWeek' => 'dddd [à] LT', - 'lastDay' => '[ieiri à] LT', - 'lastWeek' => '[sür el] dddd [lasteu à] LT', - 'sameElse' => 'L', - ], - - 'meridiem' => ["D'A", "D'O"], - 'months' => ['Januar', 'Fevraglh', 'Març', 'Avrïu', 'Mai', 'Gün', 'Julia', 'Guscht', 'Setemvar', 'Listopäts', 'Noemvar', 'Zecemvar'], - 'months_short' => ['Jan', 'Fev', 'Mar', 'Avr', 'Mai', 'Gün', 'Jul', 'Gus', 'Set', 'Lis', 'Noe', 'Zec'], - 'weekdays' => ['Súladi', 'Lúneçi', 'Maitzi', 'Márcuri', 'Xhúadi', 'Viénerçi', 'Sáturi'], - 'weekdays_short' => ['Súl', 'Lún', 'Mai', 'Már', 'Xhú', 'Vié', 'Sát'], - 'weekdays_min' => ['Sú', 'Lú', 'Ma', 'Má', 'Xh', 'Vi', 'Sá'], - 'ordinal' => ':number.', - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/tzm.php b/vendor/nesbot/carbon/src/Carbon/Lang/tzm.php deleted file mode 100644 index 2a1a0f2b..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/tzm.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Josh Soref - * - JD Isaacks - */ -return [ - 'year' => '{1}ⴰⵙⴳⴰⵙ|:count ⵉⵙⴳⴰⵙⵏ', - 'month' => '{1}ⴰⵢoⵓⵔ|:count ⵉⵢⵢⵉⵔⵏ', - 'week' => ':count ⵉⵎⴰⵍⴰⵙⵙ', - 'day' => '{1}ⴰⵙⵙ|:count oⵙⵙⴰⵏ', - 'hour' => '{1}ⵙⴰⵄⴰ|:count ⵜⴰⵙⵙⴰⵄⵉⵏ', - 'minute' => '{1}ⵎⵉⵏⵓⴺ|:count ⵎⵉⵏⵓⴺ', - 'second' => '{1}ⵉⵎⵉⴽ|:count ⵉⵎⵉⴽ', - 'ago' => 'ⵢⴰⵏ :time', - 'from_now' => 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ :time', - 'diff_today' => 'ⴰⵙⴷⵅ', - 'diff_yesterday' => 'ⴰⵚⴰⵏⵜ', - 'diff_yesterday_regexp' => 'ⴰⵚⴰⵏⵜ(?:\\s+ⴴ)?', - 'diff_tomorrow' => 'ⴰⵙⴽⴰ', - 'diff_tomorrow_regexp' => 'ⴰⵙⴽⴰ(?:\\s+ⴴ)?', - 'diff_today_regexp' => 'ⴰⵙⴷⵅ(?:\\s+ⴴ)?', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[ⴰⵙⴷⵅ ⴴ] LT', - 'nextDay' => '[ⴰⵙⴽⴰ ⴴ] LT', - 'nextWeek' => 'dddd [ⴴ] LT', - 'lastDay' => '[ⴰⵚⴰⵏⵜ ⴴ] LT', - 'lastWeek' => 'dddd [ⴴ] LT', - 'sameElse' => 'L', - ], - 'months' => ['ⵉⵏⵏⴰⵢⵔ', 'ⴱⵕⴰⵢⵕ', 'ⵎⴰⵕⵚ', 'ⵉⴱⵔⵉⵔ', 'ⵎⴰⵢⵢⵓ', 'ⵢⵓⵏⵢⵓ', 'ⵢⵓⵍⵢⵓⵣ', 'ⵖⵓⵛⵜ', 'ⵛⵓⵜⴰⵏⴱⵉⵔ', 'ⴽⵟⵓⴱⵕ', 'ⵏⵓⵡⴰⵏⴱⵉⵔ', 'ⴷⵓⵊⵏⴱⵉⵔ'], - 'months_short' => ['ⵉⵏⵏⴰⵢⵔ', 'ⴱⵕⴰⵢⵕ', 'ⵎⴰⵕⵚ', 'ⵉⴱⵔⵉⵔ', 'ⵎⴰⵢⵢⵓ', 'ⵢⵓⵏⵢⵓ', 'ⵢⵓⵍⵢⵓⵣ', 'ⵖⵓⵛⵜ', 'ⵛⵓⵜⴰⵏⴱⵉⵔ', 'ⴽⵟⵓⴱⵕ', 'ⵏⵓⵡⴰⵏⴱⵉⵔ', 'ⴷⵓⵊⵏⴱⵉⵔ'], - 'weekdays' => ['ⴰⵙⴰⵎⴰⵙ', 'ⴰⵢⵏⴰⵙ', 'ⴰⵙⵉⵏⴰⵙ', 'ⴰⴽⵔⴰⵙ', 'ⴰⴽⵡⴰⵙ', 'ⴰⵙⵉⵎⵡⴰⵙ', 'ⴰⵙⵉⴹⵢⴰⵙ'], - 'weekdays_short' => ['ⴰⵙⴰⵎⴰⵙ', 'ⴰⵢⵏⴰⵙ', 'ⴰⵙⵉⵏⴰⵙ', 'ⴰⴽⵔⴰⵙ', 'ⴰⴽⵡⴰⵙ', 'ⴰⵙⵉⵎⵡⴰⵙ', 'ⴰⵙⵉⴹⵢⴰⵙ'], - 'weekdays_min' => ['ⴰⵙⴰⵎⴰⵙ', 'ⴰⵢⵏⴰⵙ', 'ⴰⵙⵉⵏⴰⵙ', 'ⴰⴽⵔⴰⵙ', 'ⴰⴽⵡⴰⵙ', 'ⴰⵙⵉⵎⵡⴰⵙ', 'ⴰⵙⵉⴹⵢⴰⵙ'], - 'first_day_of_week' => 6, - 'day_of_first_week_of_year' => 1, - 'weekend' => [5, 6], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/tzm_Latn.php b/vendor/nesbot/carbon/src/Carbon/Lang/tzm_Latn.php deleted file mode 100644 index 5840d209..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/tzm_Latn.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Josh Soref - * - JD Isaacks - */ -return [ - 'year' => '{1}:count asgas|:count isgasn', - 'a_year' => 'asgas|:count isgasn', - 'month' => '{1}:count ayowr|:count iyyirn', - 'a_month' => 'ayowr|:count iyyirn', - 'week' => ':count imalass', - 'a_week' => ':imalass', - 'day' => '{1}:count ass|:count ossan', - 'a_day' => 'ass|:count ossan', - 'hour' => '{1}:count saɛa|:count tassaɛin', - 'a_hour' => '{1}saɛa|:count tassaɛin', - 'minute' => ':count minuḍ', - 'a_minute' => '{1}minuḍ|:count minuḍ', - 'second' => ':count imik', - 'a_second' => '{1}imik|:count imik', - 'ago' => 'yan :time', - 'from_now' => 'dadkh s yan :time', - 'diff_yesterday' => 'assant', - 'diff_yesterday_regexp' => 'assant(?:\\s+g)?', - 'diff_today' => 'asdkh', - 'diff_today_regexp' => 'asdkh(?:\\s+g)?', - 'diff_tomorrow' => 'aska', - 'diff_tomorrow_regexp' => 'aska(?:\\s+g)?', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[asdkh g] LT', - 'nextDay' => '[aska g] LT', - 'nextWeek' => 'dddd [g] LT', - 'lastDay' => '[assant g] LT', - 'lastWeek' => 'dddd [g] LT', - 'sameElse' => 'L', - ], - 'months' => ['innayr', 'brˤayrˤ', 'marˤsˤ', 'ibrir', 'mayyw', 'ywnyw', 'ywlywz', 'ɣwšt', 'šwtanbir', 'ktˤwbrˤ', 'nwwanbir', 'dwjnbir'], - 'months_short' => ['innayr', 'brˤayrˤ', 'marˤsˤ', 'ibrir', 'mayyw', 'ywnyw', 'ywlywz', 'ɣwšt', 'šwtanbir', 'ktˤwbrˤ', 'nwwanbir', 'dwjnbir'], - 'weekdays' => ['asamas', 'aynas', 'asinas', 'akras', 'akwas', 'asimwas', 'asiḍyas'], - 'weekdays_short' => ['asamas', 'aynas', 'asinas', 'akras', 'akwas', 'asimwas', 'asiḍyas'], - 'weekdays_min' => ['asamas', 'aynas', 'asinas', 'akras', 'akwas', 'asimwas', 'asiḍyas'], - 'meridiem' => ['Zdat azal', 'Ḍeffir aza'], - 'first_day_of_week' => 6, - 'day_of_first_week_of_year' => 1, -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ug.php b/vendor/nesbot/carbon/src/Carbon/Lang/ug.php deleted file mode 100644 index 259b99a4..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ug.php +++ /dev/null @@ -1,90 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Philippe Vaucher - * - Tsutomu Kuroda - * - yasinn - */ -return [ - 'year' => '{1}'.'بىر يىل'.'|:count '.'يىل', - 'month' => '{1}'.'بىر ئاي'.'|:count '.'ئاي', - 'week' => '{1}'.'بىر ھەپتە'.'|:count '.'ھەپتە', - 'day' => '{1}'.'بىر كۈن'.'|:count '.'كۈن', - 'hour' => '{1}'.'بىر سائەت'.'|:count '.'سائەت', - 'minute' => '{1}'.'بىر مىنۇت'.'|:count '.'مىنۇت', - 'second' => '{1}'.'نەچچە سېكونت'.'|:count '.'سېكونت', - 'ago' => ':time بۇرۇن', - 'from_now' => ':time كېيىن', - 'diff_today' => 'بۈگۈن', - 'diff_yesterday' => 'تۆنۈگۈن', - 'diff_tomorrow' => 'ئەتە', - 'diff_tomorrow_regexp' => 'ئەتە(?:\\s+سائەت)?', - 'diff_today_regexp' => 'بۈگۈن(?:\\s+سائەت)?', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'YYYY-MM-DD', - 'LL' => 'YYYY-يىلىM-ئاينىڭD-كۈنى', - 'LLL' => 'YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm', - 'LLLL' => 'dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[بۈگۈن سائەت] LT', - 'nextDay' => '[ئەتە سائەت] LT', - 'nextWeek' => '[كېلەركى] dddd [سائەت] LT', - 'lastDay' => '[تۆنۈگۈن] LT', - 'lastWeek' => '[ئالدىنقى] dddd [سائەت] LT', - 'sameElse' => 'L', - ], - 'ordinal' => function ($number, $period) { - switch ($period) { - case 'd': - case 'D': - case 'DDD': - return $number.'-كۈنى'; - case 'w': - case 'W': - return $number.'-ھەپتە'; - default: - return $number; - } - }, - 'meridiem' => function ($hour, $minute) { - $time = $hour * 100 + $minute; - if ($time < 600) { - return 'يېرىم كېچە'; - } - if ($time < 900) { - return 'سەھەر'; - } - if ($time < 1130) { - return 'چۈشتىن بۇرۇن'; - } - if ($time < 1230) { - return 'چۈش'; - } - if ($time < 1800) { - return 'چۈشتىن كېيىن'; - } - - return 'كەچ'; - }, - 'months' => ['يانۋار', 'فېۋرال', 'مارت', 'ئاپرېل', 'ماي', 'ئىيۇن', 'ئىيۇل', 'ئاۋغۇست', 'سېنتەبىر', 'ئۆكتەبىر', 'نويابىر', 'دېكابىر'], - 'months_short' => ['يانۋار', 'فېۋرال', 'مارت', 'ئاپرېل', 'ماي', 'ئىيۇن', 'ئىيۇل', 'ئاۋغۇست', 'سېنتەبىر', 'ئۆكتەبىر', 'نويابىر', 'دېكابىر'], - 'weekdays' => ['يەكشەنبە', 'دۈشەنبە', 'سەيشەنبە', 'چارشەنبە', 'پەيشەنبە', 'جۈمە', 'شەنبە'], - 'weekdays_short' => ['يە', 'دۈ', 'سە', 'چا', 'پە', 'جۈ', 'شە'], - 'weekdays_min' => ['يە', 'دۈ', 'سە', 'چا', 'پە', 'جۈ', 'شە'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'list' => [', ', ' ۋە '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ug_CN.php b/vendor/nesbot/carbon/src/Carbon/Lang/ug_CN.php deleted file mode 100644 index deb828c5..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ug_CN.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Kunal Marwaha - * - Alim Boyaq - */ -return require __DIR__.'/ug.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/uk.php b/vendor/nesbot/carbon/src/Carbon/Lang/uk.php deleted file mode 100644 index 1d5ba703..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/uk.php +++ /dev/null @@ -1,212 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Carbon\CarbonInterface; - -$processHoursFunction = function (CarbonInterface $date, string $format) { - return $format.'о'.($date->hour === 11 ? 'б' : '').'] LT'; -}; - -/* - * Authors: - * - Kunal Marwaha - * - Josh Soref - * - François B - * - Tim Fish - * - Serhan Apaydın - * - Max Mykhailenko - * - JD Isaacks - * - Max Kovpak - * - AucT - * - Philippe Vaucher - * - Ilya Shaplyko - * - Vadym Ievsieiev - * - Denys Kurets - * - Igor Kasyanchuk - * - Tsutomu Kuroda - * - tjku - * - Max Melentiev - * - Oleh - * - epaminond - * - Juanito Fatas - * - Vitalii Khustochka - * - Akira Matsuda - * - Christopher Dell - * - Enrique Vidal - * - Simone Carletti - * - Aaron Patterson - * - Andriy Tyurnikov - * - Nicolás Hock Isaza - * - Iwakura Taro - * - Andrii Ponomarov - * - alecrabbit - * - vystepanenko - * - AlexWalkerson - * - Andre Havryliuk (Andrend) - * - Max Datsenko (datsenko-md) - */ -return [ - 'year' => ':count рік|:count роки|:count років', - 'y' => ':countр', - 'a_year' => '{1}рік|:count рік|:count роки|:count років', - 'month' => ':count місяць|:count місяці|:count місяців', - 'm' => ':countм', - 'a_month' => '{1}місяць|:count місяць|:count місяці|:count місяців', - 'week' => ':count тиждень|:count тижні|:count тижнів', - 'w' => ':countт', - 'a_week' => '{1}тиждень|:count тиждень|:count тижні|:count тижнів', - 'day' => ':count день|:count дні|:count днів', - 'd' => ':countд', - 'a_day' => '{1}день|:count день|:count дні|:count днів', - 'hour' => ':count година|:count години|:count годин', - 'h' => ':countг', - 'a_hour' => '{1}година|:count година|:count години|:count годин', - 'minute' => ':count хвилина|:count хвилини|:count хвилин', - 'min' => ':countхв', - 'a_minute' => '{1}хвилина|:count хвилина|:count хвилини|:count хвилин', - 'second' => ':count секунда|:count секунди|:count секунд', - 's' => ':countсек', - 'a_second' => '{1}декілька секунд|:count секунда|:count секунди|:count секунд', - - 'hour_ago' => ':count годину|:count години|:count годин', - 'a_hour_ago' => '{1}годину|:count годину|:count години|:count годин', - 'minute_ago' => ':count хвилину|:count хвилини|:count хвилин', - 'a_minute_ago' => '{1}хвилину|:count хвилину|:count хвилини|:count хвилин', - 'second_ago' => ':count секунду|:count секунди|:count секунд', - 'a_second_ago' => '{1}декілька секунд|:count секунду|:count секунди|:count секунд', - - 'hour_from_now' => ':count годину|:count години|:count годин', - 'a_hour_from_now' => '{1}годину|:count годину|:count години|:count годин', - 'minute_from_now' => ':count хвилину|:count хвилини|:count хвилин', - 'a_minute_from_now' => '{1}хвилину|:count хвилину|:count хвилини|:count хвилин', - 'second_from_now' => ':count секунду|:count секунди|:count секунд', - 'a_second_from_now' => '{1}декілька секунд|:count секунду|:count секунди|:count секунд', - - 'hour_after' => ':count годину|:count години|:count годин', - 'a_hour_after' => '{1}годину|:count годину|:count години|:count годин', - 'minute_after' => ':count хвилину|:count хвилини|:count хвилин', - 'a_minute_after' => '{1}хвилину|:count хвилину|:count хвилини|:count хвилин', - 'second_after' => ':count секунду|:count секунди|:count секунд', - 'a_second_after' => '{1}декілька секунд|:count секунду|:count секунди|:count секунд', - - 'hour_before' => ':count годину|:count години|:count годин', - 'a_hour_before' => '{1}годину|:count годину|:count години|:count годин', - 'minute_before' => ':count хвилину|:count хвилини|:count хвилин', - 'a_minute_before' => '{1}хвилину|:count хвилину|:count хвилини|:count хвилин', - 'second_before' => ':count секунду|:count секунди|:count секунд', - 'a_second_before' => '{1}декілька секунд|:count секунду|:count секунди|:count секунд', - - 'ago' => ':time тому', - 'from_now' => 'за :time', - 'after' => ':time після', - 'before' => ':time до', - 'diff_now' => 'щойно', - 'diff_today' => 'Сьогодні', - 'diff_today_regexp' => 'Сьогодні(?:\\s+о)?', - 'diff_yesterday' => 'вчора', - 'diff_yesterday_regexp' => 'Вчора(?:\\s+о)?', - 'diff_tomorrow' => 'завтра', - 'diff_tomorrow_regexp' => 'Завтра(?:\\s+о)?', - 'diff_before_yesterday' => 'позавчора', - 'diff_after_tomorrow' => 'післязавтра', - 'period_recurrences' => 'один раз|:count рази|:count разів', - 'period_interval' => 'кожні :interval', - 'period_start_date' => 'з :date', - 'period_end_date' => 'до :date', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD.MM.YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY, HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY, HH:mm', - ], - 'calendar' => [ - 'sameDay' => function (CarbonInterface $date) use ($processHoursFunction) { - return $processHoursFunction($date, '[Сьогодні '); - }, - 'nextDay' => function (CarbonInterface $date) use ($processHoursFunction) { - return $processHoursFunction($date, '[Завтра '); - }, - 'nextWeek' => function (CarbonInterface $date) use ($processHoursFunction) { - return $processHoursFunction($date, '[У] dddd ['); - }, - 'lastDay' => function (CarbonInterface $date) use ($processHoursFunction) { - return $processHoursFunction($date, '[Вчора '); - }, - 'lastWeek' => function (CarbonInterface $date) use ($processHoursFunction) { - switch ($date->dayOfWeek) { - case 0: - case 3: - case 5: - case 6: - return $processHoursFunction($date, '[Минулої] dddd ['); - default: - return $processHoursFunction($date, '[Минулого] dddd ['); - } - }, - 'sameElse' => 'L', - ], - 'ordinal' => function ($number, $period) { - switch ($period) { - case 'M': - case 'd': - case 'DDD': - case 'w': - case 'W': - return $number.'-й'; - case 'D': - return $number.'-го'; - default: - return $number; - } - }, - 'meridiem' => function ($hour) { - if ($hour < 4) { - return 'ночі'; - } - if ($hour < 12) { - return 'ранку'; - } - if ($hour < 17) { - return 'дня'; - } - - return 'вечора'; - }, - 'months' => ['січня', 'лютого', 'березня', 'квітня', 'травня', 'червня', 'липня', 'серпня', 'вересня', 'жовтня', 'листопада', 'грудня'], - 'months_standalone' => ['січень', 'лютий', 'березень', 'квітень', 'травень', 'червень', 'липень', 'серпень', 'вересень', 'жовтень', 'листопад', 'грудень'], - 'months_short' => ['січ', 'лют', 'бер', 'кві', 'тра', 'чер', 'лип', 'сер', 'вер', 'жов', 'лис', 'гру'], - 'months_regexp' => '/(D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|L{2,4}|l{2,4})/', - 'weekdays' => function (CarbonInterface $date, $format, $index) { - static $words = [ - 'nominative' => ['неділя', 'понеділок', 'вівторок', 'середа', 'четвер', 'п’ятниця', 'субота'], - 'accusative' => ['неділю', 'понеділок', 'вівторок', 'середу', 'четвер', 'п’ятницю', 'суботу'], - 'genitive' => ['неділі', 'понеділка', 'вівторка', 'середи', 'четверга', 'п’ятниці', 'суботи'], - ]; - - $format = $format ?? ''; - $nounCase = preg_match('/(\[(В|в|У|у)\])\s+dddd/u', $format) - ? 'accusative' - : ( - preg_match('/\[?(?:минулої|наступної)?\s*\]\s+dddd/u', $format) - ? 'genitive' - : 'nominative' - ); - - return $words[$nounCase][$index] ?? null; - }, - 'weekdays_short' => ['нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'], - 'weekdays_min' => ['нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'list' => [', ', ' i '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/uk_UA.php b/vendor/nesbot/carbon/src/Carbon/Lang/uk_UA.php deleted file mode 100644 index bd11d86e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/uk_UA.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/uk.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/unm.php b/vendor/nesbot/carbon/src/Carbon/Lang/unm.php deleted file mode 100644 index d3f19f06..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/unm.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/unm_US.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/unm_US.php b/vendor/nesbot/carbon/src/Carbon/Lang/unm_US.php deleted file mode 100644 index fa5c374e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/unm_US.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YY', - ], - 'months' => ['enikwsi', 'chkwali', 'xamokhwite', 'kwetayoxe', 'tainipen', 'kichinipen', 'lainipen', 'winaminke', 'kichitahkok', 'puksit', 'wini', 'muxkotae'], - 'months_short' => ['eni', 'chk', 'xam', 'kwe', 'tai', 'nip', 'lai', 'win', 'tah', 'puk', 'kun', 'mux'], - 'weekdays' => ['kentuwei', 'manteke', 'tusteke', 'lelai', 'tasteke', 'pelaiteke', 'sateteke'], - 'weekdays_short' => ['ken', 'man', 'tus', 'lel', 'tas', 'pel', 'sat'], - 'weekdays_min' => ['ken', 'man', 'tus', 'lel', 'tas', 'pel', 'sat'], - 'day_of_first_week_of_year' => 1, - - // Too unreliable - /* - 'year' => ':count kaxtëne', - 'y' => ':count kaxtëne', - 'a_year' => ':count kaxtëne', - - 'month' => ':count piskewëni kishux', // less reliable - 'm' => ':count piskewëni kishux', // less reliable - 'a_month' => ':count piskewëni kishux', // less reliable - - 'week' => ':count kishku', // less reliable - 'w' => ':count kishku', // less reliable - 'a_week' => ':count kishku', // less reliable - - 'day' => ':count kishku', - 'd' => ':count kishku', - 'a_day' => ':count kishku', - - 'hour' => ':count xkuk', // less reliable - 'h' => ':count xkuk', // less reliable - 'a_hour' => ':count xkuk', // less reliable - - 'minute' => ':count txituwàk', // less reliable - 'min' => ':count txituwàk', // less reliable - 'a_minute' => ':count txituwàk', // less reliable - - 'second' => ':count nisha', // less reliable - 's' => ':count nisha', // less reliable - 'a_second' => ':count nisha', // less reliable - */ -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ur.php b/vendor/nesbot/carbon/src/Carbon/Lang/ur.php deleted file mode 100644 index dc16c2c3..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ur.php +++ /dev/null @@ -1,94 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -$months = [ - 'جنوری', - 'فروری', - 'مارچ', - 'اپریل', - 'مئی', - 'جون', - 'جولائی', - 'اگست', - 'ستمبر', - 'اکتوبر', - 'نومبر', - 'دسمبر', -]; - -$weekdays = [ - 'اتوار', - 'پیر', - 'منگل', - 'بدھ', - 'جمعرات', - 'جمعہ', - 'ہفتہ', -]; - -/* - * Authors: - * - Sawood Alam - * - Mehshan - * - Philippe Vaucher - * - Tsutomu Kuroda - * - tjku - * - Zaid Akram - * - Max Melentiev - * - hafezdivandari - * - Hossein Jabbari - * - nimamo - */ -return [ - 'year' => 'ایک سال|:count سال', - 'month' => 'ایک ماہ|:count ماہ', - 'week' => ':count ہفتے', - 'day' => 'ایک دن|:count دن', - 'hour' => 'ایک گھنٹہ|:count گھنٹے', - 'minute' => 'ایک منٹ|:count منٹ', - 'second' => 'چند سیکنڈ|:count سیکنڈ', - 'ago' => ':time قبل', - 'from_now' => ':time بعد', - 'after' => ':time بعد', - 'before' => ':time پہلے', - 'diff_now' => 'اب', - 'diff_today' => 'آج', - 'diff_today_regexp' => 'آج(?:\\s+بوقت)?', - 'diff_yesterday' => 'گزشتہ کل', - 'diff_yesterday_regexp' => 'گذشتہ(?:\\s+روز)?(?:\\s+بوقت)?', - 'diff_tomorrow' => 'آئندہ کل', - 'diff_tomorrow_regexp' => 'کل(?:\\s+بوقت)?', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd، D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[آج بوقت] LT', - 'nextDay' => '[کل بوقت] LT', - 'nextWeek' => 'dddd [بوقت] LT', - 'lastDay' => '[گذشتہ روز بوقت] LT', - 'lastWeek' => '[گذشتہ] dddd [بوقت] LT', - 'sameElse' => 'L', - ], - 'meridiem' => ['صبح', 'شام'], - 'months' => $months, - 'months_short' => $months, - 'weekdays' => $weekdays, - 'weekdays_short' => $weekdays, - 'weekdays_min' => $weekdays, - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => ['، ', ' اور '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ur_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/ur_IN.php deleted file mode 100644 index f81c84d3..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ur_IN.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Red Hat, Pune bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/ur.php', [ - 'formats' => [ - 'L' => 'D/M/YY', - ], - 'months' => ['جنوری', 'فروری', 'مارچ', 'اپریل', 'مئی', 'جون', 'جولائی', 'اگست', 'ستمبر', 'اکتوبر', 'نومبر', 'دسمبر'], - 'months_short' => ['جنوری', 'فروری', 'مارچ', 'اپریل', 'مئی', 'جون', 'جولائی', 'اگست', 'ستمبر', 'اکتوبر', 'نومبر', 'دسمبر'], - 'weekdays' => ['اتوار', 'پیر', 'منگل', 'بدھ', 'جمعرات', 'جمعہ', 'سنیچر'], - 'weekdays_short' => ['اتوار', 'پیر', 'منگل', 'بدھ', 'جمعرات', 'جمعہ', 'سنیچر'], - 'weekdays_min' => ['اتوار', 'پیر', 'منگل', 'بدھ', 'جمعرات', 'جمعہ', 'سنیچر'], - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ur_PK.php b/vendor/nesbot/carbon/src/Carbon/Lang/ur_PK.php deleted file mode 100644 index 8cd593db..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ur_PK.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/ur.php', [ - 'formats' => [ - 'L' => 'DD/MM/YYYY', - ], - 'months' => ['جنوری', 'فروری', 'مارچ', 'اپریل', 'مئی', 'جون', 'جولائی', 'اگست', 'ستمبر', 'اکتوبر', 'نومبر', 'دسمبر'], - 'months_short' => ['جنوری', 'فروری', 'مارچ', 'اپریل', 'مئی', 'جون', 'جولائی', 'اگست', 'ستمبر', 'اکتوبر', 'نومبر', 'دسمبر'], - 'weekdays' => ['اتوار', 'پير', 'منگل', 'بدھ', 'جمعرات', 'جمعه', 'هفته'], - 'weekdays_short' => ['اتوار', 'پير', 'منگل', 'بدھ', 'جمعرات', 'جمعه', 'هفته'], - 'weekdays_min' => ['اتوار', 'پير', 'منگل', 'بدھ', 'جمعرات', 'جمعه', 'هفته'], - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['ص', 'ش'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/uz.php b/vendor/nesbot/carbon/src/Carbon/Lang/uz.php deleted file mode 100644 index 61f3b64b..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/uz.php +++ /dev/null @@ -1,85 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Dmitriy Shabanov - * - JD Isaacks - * - Inoyatulloh - * - Jamshid - * - aarkhipov - * - Philippe Vaucher - * - felixthemagnificent - * - Tsutomu Kuroda - * - tjku - * - Max Melentiev - * - Juanito Fatas - * - Alisher Ulugbekov - * - Ergashev Adizbek - */ -return [ - 'year' => ':count йил', - 'a_year' => '{1}бир йил|:count йил', - 'y' => ':count й', - 'month' => ':count ой', - 'a_month' => '{1}бир ой|:count ой', - 'm' => ':count о', - 'week' => ':count ҳафта', - 'a_week' => '{1}бир ҳафта|:count ҳафта', - 'w' => ':count ҳ', - 'day' => ':count кун', - 'a_day' => '{1}бир кун|:count кун', - 'd' => ':count к', - 'hour' => ':count соат', - 'a_hour' => '{1}бир соат|:count соат', - 'h' => ':count с', - 'minute' => ':count дақиқа', - 'a_minute' => '{1}бир дақиқа|:count дақиқа', - 'min' => ':count д', - 'second' => ':count сония', - 'a_second' => '{1}сония|:count сония', - 's' => ':count с', - 'ago' => ':time аввал', - 'from_now' => 'Якин :time ичида', - 'after' => ':timeдан кейин', - 'before' => ':time олдин', - 'diff_now' => 'ҳозир', - 'diff_today' => 'Бугун', - 'diff_today_regexp' => 'Бугун(?:\\s+соат)?', - 'diff_yesterday' => 'Кеча', - 'diff_yesterday_regexp' => 'Кеча(?:\\s+соат)?', - 'diff_tomorrow' => 'Эртага', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'D MMMM YYYY, dddd HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[Бугун соат] LT [да]', - 'nextDay' => '[Эртага] LT [да]', - 'nextWeek' => 'dddd [куни соат] LT [да]', - 'lastDay' => '[Кеча соат] LT [да]', - 'lastWeek' => '[Утган] dddd [куни соат] LT [да]', - 'sameElse' => 'L', - ], - 'months' => ['январ', 'феврал', 'март', 'апрел', 'май', 'июн', 'июл', 'август', 'сентябр', 'октябр', 'ноябр', 'декабр'], - 'months_short' => ['янв', 'фев', 'мар', 'апр', 'май', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек'], - 'weekdays' => ['якшанба', 'душанба', 'сешанба', 'чоршанба', 'пайшанба', 'жума', 'шанба'], - 'weekdays_short' => ['якш', 'душ', 'сеш', 'чор', 'пай', 'жум', 'шан'], - 'weekdays_min' => ['як', 'ду', 'се', 'чо', 'па', 'жу', 'ша'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['эрталаб', 'кечаси'], - 'list' => [', ', ' ва '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/uz_Arab.php b/vendor/nesbot/carbon/src/Carbon/Lang/uz_Arab.php deleted file mode 100644 index ffb51319..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/uz_Arab.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/fa.php', [ - 'weekdays' => ['یکشنبه', 'دوشنبه', 'سه‌شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه'], - 'weekdays_short' => ['ی.', 'د.', 'س.', 'چ.', 'پ.', 'ج.', 'ش.'], - 'weekdays_min' => ['ی.', 'د.', 'س.', 'چ.', 'پ.', 'ج.', 'ش.'], - 'months' => ['جنوری', 'فبروری', 'مارچ', 'اپریل', 'می', 'جون', 'جولای', 'اگست', 'سپتمبر', 'اکتوبر', 'نومبر', 'دسمبر'], - 'months_short' => ['جنو', 'فبر', 'مار', 'اپر', 'می', 'جون', 'جول', 'اگس', 'سپت', 'اکت', 'نوم', 'دسم'], - 'first_day_of_week' => 6, - 'weekend' => [4, 5], - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'YYYY-MM-dd', - 'LL' => 'YYYY MMM D', - 'LLL' => 'YYYY MMMM D HH:mm', - 'LLLL' => 'YYYY MMMM D, dddd HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/uz_Cyrl.php b/vendor/nesbot/carbon/src/Carbon/Lang/uz_Cyrl.php deleted file mode 100644 index 89e99718..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/uz_Cyrl.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/uz.php', [ - 'formats' => [ - 'L' => 'DD/MM/yy', - 'LL' => 'D MMM, YYYY', - 'LLL' => 'D MMMM, YYYY HH:mm', - 'LLLL' => 'dddd, DD MMMM, YYYY HH:mm', - ], - 'meridiem' => ['ТО', 'ТК'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/uz_Latn.php b/vendor/nesbot/carbon/src/Carbon/Lang/uz_Latn.php deleted file mode 100644 index ecceeaa3..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/uz_Latn.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Josh Soref - * - Rasulbek - * - Ilyosjon Kamoldinov (ilyosjon09) - */ -return [ - 'year' => ':count yil', - 'a_year' => '{1}bir yil|:count yil', - 'y' => ':count y', - 'month' => ':count oy', - 'a_month' => '{1}bir oy|:count oy', - 'm' => ':count o', - 'week' => ':count hafta', - 'a_week' => '{1}bir hafta|:count hafta', - 'w' => ':count h', - 'day' => ':count kun', - 'a_day' => '{1}bir kun|:count kun', - 'd' => ':count k', - 'hour' => ':count soat', - 'a_hour' => '{1}bir soat|:count soat', - 'h' => ':count soat', - 'minute' => ':count daqiqa', - 'a_minute' => '{1}bir daqiqa|:count daqiqa', - 'min' => ':count d', - 'second' => ':count soniya', - 'a_second' => '{1}soniya|:count soniya', - 's' => ':count son.', - 'ago' => ':time avval', - 'from_now' => 'Yaqin :time ichida', - 'after' => ':timedan keyin', - 'before' => ':time oldin', - 'diff_yesterday' => 'Kecha', - 'diff_yesterday_regexp' => 'Kecha(?:\\s+soat)?', - 'diff_today' => 'Bugun', - 'diff_today_regexp' => 'Bugun(?:\\s+soat)?', - 'diff_tomorrow' => 'Ertaga', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'D MMMM YYYY, dddd HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[Bugun soat] LT [da]', - 'nextDay' => '[Ertaga] LT [da]', - 'nextWeek' => 'dddd [kuni soat] LT [da]', - 'lastDay' => '[Kecha soat] LT [da]', - 'lastWeek' => '[O\'tgan] dddd [kuni soat] LT [da]', - 'sameElse' => 'L', - ], - 'months' => ['Yanvar', 'Fevral', 'Mart', 'Aprel', 'May', 'Iyun', 'Iyul', 'Avgust', 'Sentabr', 'Oktabr', 'Noyabr', 'Dekabr'], - 'months_short' => ['Yan', 'Fev', 'Mar', 'Apr', 'May', 'Iyun', 'Iyul', 'Avg', 'Sen', 'Okt', 'Noy', 'Dek'], - 'weekdays' => ['Yakshanba', 'Dushanba', 'Seshanba', 'Chorshanba', 'Payshanba', 'Juma', 'Shanba'], - 'weekdays_short' => ['Yak', 'Dush', 'Sesh', 'Chor', 'Pay', 'Jum', 'Shan'], - 'weekdays_min' => ['Ya', 'Du', 'Se', 'Cho', 'Pa', 'Ju', 'Sha'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'list' => [', ', ' va '], - 'meridiem' => ['TO', 'TK'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/uz_UZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/uz_UZ.php deleted file mode 100644 index d41bfee2..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/uz_UZ.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Bobir Ismailov Bobir Ismailov, Pablo Saratxaga, Mashrab Kuvatov bobir_is@yahoo.com, pablo@mandrakesoft.com, kmashrab@uni-bremen.de - */ -return array_replace_recursive(require __DIR__.'/uz_Latn.php', [ - 'formats' => [ - 'L' => 'DD/MM/YY', - ], - 'months' => ['Yanvar', 'Fevral', 'Mart', 'Aprel', 'May', 'Iyun', 'Iyul', 'Avgust', 'Sentabr', 'Oktabr', 'Noyabr', 'Dekabr'], - 'months_short' => ['Yan', 'Fev', 'Mar', 'Apr', 'May', 'Iyn', 'Iyl', 'Avg', 'Sen', 'Okt', 'Noy', 'Dek'], - 'weekdays' => ['Yakshanba', 'Dushanba', 'Seshanba', 'Chorshanba', 'Payshanba', 'Juma', 'Shanba'], - 'weekdays_short' => ['Yak', 'Du', 'Se', 'Cho', 'Pay', 'Ju', 'Sha'], - 'weekdays_min' => ['Yak', 'Du', 'Se', 'Cho', 'Pay', 'Ju', 'Sha'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/uz_UZ@cyrillic.php b/vendor/nesbot/carbon/src/Carbon/Lang/uz_UZ@cyrillic.php deleted file mode 100644 index 2fa967c9..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/uz_UZ@cyrillic.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Mashrab Kuvatov Mashrab Kuvatov, Pablo Saratxaga kmashrab@uni-bremen.de, pablo@mandrakesoft.com - */ -return array_replace_recursive(require __DIR__.'/uz.php', [ - 'formats' => [ - 'L' => 'DD/MM/YY', - ], - 'months' => ['Январ', 'Феврал', 'Март', 'Апрел', 'Май', 'Июн', 'Июл', 'Август', 'Сентябр', 'Октябр', 'Ноябр', 'Декабр'], - 'months_short' => ['Янв', 'Фев', 'Мар', 'Апр', 'Май', 'Июн', 'Июл', 'Авг', 'Сен', 'Окт', 'Ноя', 'Дек'], - 'weekdays' => ['Якшанба', 'Душанба', 'Сешанба', 'Чоршанба', 'Пайшанба', 'Жума', 'Шанба'], - 'weekdays_short' => ['Якш', 'Душ', 'Сеш', 'Чор', 'Пай', 'Жум', 'Шан'], - 'weekdays_min' => ['Якш', 'Душ', 'Сеш', 'Чор', 'Пай', 'Жум', 'Шан'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/vai.php b/vendor/nesbot/carbon/src/Carbon/Lang/vai.php deleted file mode 100644 index 3c378dfb..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/vai.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'weekdays' => ['ꕞꕌꔵ', 'ꗳꗡꘉ', 'ꕚꕞꕚ', 'ꕉꕞꕒ', 'ꕉꔤꕆꕢ', 'ꕉꔤꕀꕮ', 'ꔻꔬꔳ'], - 'weekdays_short' => ['ꕞꕌꔵ', 'ꗳꗡꘉ', 'ꕚꕞꕚ', 'ꕉꕞꕒ', 'ꕉꔤꕆꕢ', 'ꕉꔤꕀꕮ', 'ꔻꔬꔳ'], - 'weekdays_min' => ['ꕞꕌꔵ', 'ꗳꗡꘉ', 'ꕚꕞꕚ', 'ꕉꕞꕒ', 'ꕉꔤꕆꕢ', 'ꕉꔤꕀꕮ', 'ꔻꔬꔳ'], - 'months' => ['ꖨꖕ ꕪꕴ ꔞꔀꕮꕊ', 'ꕒꕡꖝꖕ', 'ꕾꖺ', 'ꖢꖕ', 'ꖑꕱ', 'ꖱꘋ', 'ꖱꕞꔤ', 'ꗛꔕ', 'ꕢꕌ', 'ꕭꖃ', 'ꔞꘋꕔꕿ ꕸꖃꗏ', 'ꖨꖕ ꕪꕴ ꗏꖺꕮꕊ'], - 'months_short' => ['ꖨꖕꔞ', 'ꕒꕡ', 'ꕾꖺ', 'ꖢꖕ', 'ꖑꕱ', 'ꖱꘋ', 'ꖱꕞ', 'ꗛꔕ', 'ꕢꕌ', 'ꕭꖃ', 'ꔞꘋ', 'ꖨꖕꗏ'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'h:mm a', - 'LTS' => 'h:mm:ss a', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY h:mm a', - 'LLLL' => 'dddd, D MMMM YYYY h:mm a', - ], - - 'year' => ':count ꕀ', // less reliable - 'y' => ':count ꕀ', // less reliable - 'a_year' => ':count ꕀ', // less reliable - - 'second' => ':count ꗱꕞꕯꕊ', // less reliable - 's' => ':count ꗱꕞꕯꕊ', // less reliable - 'a_second' => ':count ꗱꕞꕯꕊ', // less reliable -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/vai_Latn.php b/vendor/nesbot/carbon/src/Carbon/Lang/vai_Latn.php deleted file mode 100644 index 51e83cc5..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/vai_Latn.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'weekdays' => ['lahadi', 'tɛɛnɛɛ', 'talata', 'alaba', 'aimisa', 'aijima', 'siɓiti'], - 'weekdays_short' => ['lahadi', 'tɛɛnɛɛ', 'talata', 'alaba', 'aimisa', 'aijima', 'siɓiti'], - 'weekdays_min' => ['lahadi', 'tɛɛnɛɛ', 'talata', 'alaba', 'aimisa', 'aijima', 'siɓiti'], - 'months' => ['luukao kemã', 'ɓandaɓu', 'vɔɔ', 'fulu', 'goo', '6', '7', 'kɔnde', 'saah', 'galo', 'kenpkato ɓololɔ', 'luukao lɔma'], - 'months_short' => ['luukao kemã', 'ɓandaɓu', 'vɔɔ', 'fulu', 'goo', '6', '7', 'kɔnde', 'saah', 'galo', 'kenpkato ɓololɔ', 'luukao lɔma'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'h:mm a', - 'LTS' => 'h:mm:ss a', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY h:mm a', - 'LLLL' => 'dddd, D MMMM YYYY h:mm a', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/vai_Vaii.php b/vendor/nesbot/carbon/src/Carbon/Lang/vai_Vaii.php deleted file mode 100644 index b4bb533f..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/vai_Vaii.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/vai.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ve.php b/vendor/nesbot/carbon/src/Carbon/Lang/ve.php deleted file mode 100644 index 7f10aeb9..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ve.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/ve_ZA.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ve_ZA.php b/vendor/nesbot/carbon/src/Carbon/Lang/ve_ZA.php deleted file mode 100644 index 5eb2b912..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ve_ZA.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Zuza Software Foundation (Translate.org.za) Dwayne Bailey dwayne@translate.org.za - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YYYY', - ], - 'months' => ['Phando', 'Luhuhi', 'Ṱhafamuhwe', 'Lambamai', 'Shundunthule', 'Fulwi', 'Fulwana', 'Ṱhangule', 'Khubvumedzi', 'Tshimedzi', 'Ḽara', 'Nyendavhusiku'], - 'months_short' => ['Pha', 'Luh', 'Fam', 'Lam', 'Shu', 'Lwi', 'Lwa', 'Ngu', 'Khu', 'Tsh', 'Ḽar', 'Nye'], - 'weekdays' => ['Swondaha', 'Musumbuluwo', 'Ḽavhuvhili', 'Ḽavhuraru', 'Ḽavhuṋa', 'Ḽavhuṱanu', 'Mugivhela'], - 'weekdays_short' => ['Swo', 'Mus', 'Vhi', 'Rar', 'ṋa', 'Ṱan', 'Mug'], - 'weekdays_min' => ['Swo', 'Mus', 'Vhi', 'Rar', 'ṋa', 'Ṱan', 'Mug'], - 'day_of_first_week_of_year' => 1, - - // Too unreliable - /* - 'day' => ':count vhege', // less reliable - 'd' => ':count vhege', // less reliable - 'a_day' => ':count vhege', // less reliable - - 'hour' => ':count watshi', // less reliable - 'h' => ':count watshi', // less reliable - 'a_hour' => ':count watshi', // less reliable - - 'minute' => ':count watshi', // less reliable - 'min' => ':count watshi', // less reliable - 'a_minute' => ':count watshi', // less reliable - - 'second' => ':count Mu', // less reliable - 's' => ':count Mu', // less reliable - 'a_second' => ':count Mu', // less reliable - - 'week' => ':count vhege', - 'w' => ':count vhege', - 'a_week' => ':count vhege', - */ -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/vi.php b/vendor/nesbot/carbon/src/Carbon/Lang/vi.php deleted file mode 100644 index 73e2852e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/vi.php +++ /dev/null @@ -1,76 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - François B - * - Andre Polykanine A.K.A. Menelion Elensúlë - * - JD Isaacks - */ -return [ - 'year' => ':count năm', - 'a_year' => '{1}một năm|]1, Inf[:count năm', - 'y' => ':count năm', - 'month' => ':count tháng', - 'a_month' => '{1}một tháng|]1, Inf[:count tháng', - 'm' => ':count tháng', - 'week' => ':count tuần', - 'a_week' => '{1}một tuần|]1, Inf[:count tuần', - 'w' => ':count tuần', - 'day' => ':count ngày', - 'a_day' => '{1}một ngày|]1, Inf[:count ngày', - 'd' => ':count ngày', - 'hour' => ':count giờ', - 'a_hour' => '{1}một giờ|]1, Inf[:count giờ', - 'h' => ':count giờ', - 'minute' => ':count phút', - 'a_minute' => '{1}một phút|]1, Inf[:count phút', - 'min' => ':count phút', - 'second' => ':count giây', - 'a_second' => '{1}vài giây|]1, Inf[:count giây', - 's' => ':count giây', - 'ago' => ':time trước', - 'from_now' => ':time tới', - 'after' => ':time sau', - 'before' => ':time trước', - 'diff_now' => 'bây giờ', - 'diff_today' => 'Hôm', - 'diff_today_regexp' => 'Hôm(?:\\s+nay)?(?:\\s+lúc)?', - 'diff_yesterday' => 'Hôm qua', - 'diff_yesterday_regexp' => 'Hôm(?:\\s+qua)?(?:\\s+lúc)?', - 'diff_tomorrow' => 'Ngày mai', - 'diff_tomorrow_regexp' => 'Ngày(?:\\s+mai)?(?:\\s+lúc)?', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM [năm] YYYY', - 'LLL' => 'D MMMM [năm] YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM [năm] YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[Hôm nay lúc] LT', - 'nextDay' => '[Ngày mai lúc] LT', - 'nextWeek' => 'dddd [tuần tới lúc] LT', - 'lastDay' => '[Hôm qua lúc] LT', - 'lastWeek' => 'dddd [tuần trước lúc] LT', - 'sameElse' => 'L', - ], - 'meridiem' => ['SA', 'CH'], - 'months' => ['tháng 1', 'tháng 2', 'tháng 3', 'tháng 4', 'tháng 5', 'tháng 6', 'tháng 7', 'tháng 8', 'tháng 9', 'tháng 10', 'tháng 11', 'tháng 12'], - 'months_short' => ['Th01', 'Th02', 'Th03', 'Th04', 'Th05', 'Th06', 'Th07', 'Th08', 'Th09', 'Th10', 'Th11', 'Th12'], - 'weekdays' => ['chủ nhật', 'thứ hai', 'thứ ba', 'thứ tư', 'thứ năm', 'thứ sáu', 'thứ bảy'], - 'weekdays_short' => ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'], - 'weekdays_min' => ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => [', ', ' và '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/vi_VN.php b/vendor/nesbot/carbon/src/Carbon/Lang/vi_VN.php deleted file mode 100644 index 18d89876..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/vi_VN.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/vi.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/vo.php b/vendor/nesbot/carbon/src/Carbon/Lang/vo.php deleted file mode 100644 index e273033f..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/vo.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'months' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'], - 'months_short' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'YYYY-MM-dd', - 'LL' => 'YYYY MMM D', - 'LLL' => 'YYYY MMMM D HH:mm', - 'LLLL' => 'YYYY MMMM D, dddd HH:mm', - ], - - 'year' => ':count yel', - 'y' => ':count yel', - 'a_year' => ':count yel', - - 'month' => ':count mul', - 'm' => ':count mul', - 'a_month' => ':count mul', - - 'week' => ':count vig', - 'w' => ':count vig', - 'a_week' => ':count vig', - - 'day' => ':count del', - 'd' => ':count del', - 'a_day' => ':count del', - - 'hour' => ':count düp', - 'h' => ':count düp', - 'a_hour' => ':count düp', - - 'minute' => ':count minut', - 'min' => ':count minut', - 'a_minute' => ':count minut', - - 'second' => ':count sekun', - 's' => ':count sekun', - 'a_second' => ':count sekun', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/vun.php b/vendor/nesbot/carbon/src/Carbon/Lang/vun.php deleted file mode 100644 index ed92e8e7..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/vun.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['utuko', 'kyiukonyi'], - 'weekdays' => ['Jumapilyi', 'Jumatatuu', 'Jumanne', 'Jumatanu', 'Alhamisi', 'Ijumaa', 'Jumamosi'], - 'weekdays_short' => ['Jpi', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Iju', 'Jmo'], - 'weekdays_min' => ['Jpi', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Iju', 'Jmo'], - 'months' => ['Januari', 'Februari', 'Machi', 'Aprilyi', 'Mei', 'Junyi', 'Julyai', 'Agusti', 'Septemba', 'Oktoba', 'Novemba', 'Desemba'], - 'months_short' => ['Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Sep', 'Okt', 'Nov', 'Des'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/wa.php b/vendor/nesbot/carbon/src/Carbon/Lang/wa.php deleted file mode 100644 index f6dc4ccd..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/wa.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/wa_BE.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/wa_BE.php b/vendor/nesbot/carbon/src/Carbon/Lang/wa_BE.php deleted file mode 100644 index a76d80d9..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/wa_BE.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Djan SACRE Pablo Saratxaga pablo@mandrakesoft.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YYYY', - ], - 'months' => ['di djanvî', 'di fevrî', 'di måss', 'd’ avri', 'di may', 'di djun', 'di djulete', 'd’ awousse', 'di setimbe', 'd’ octôbe', 'di nôvimbe', 'di decimbe'], - 'months_short' => ['dja', 'fev', 'mås', 'avr', 'may', 'djn', 'djl', 'awo', 'set', 'oct', 'nôv', 'dec'], - 'weekdays' => ['dimegne', 'londi', 'mårdi', 'mierkidi', 'djudi', 'vénrdi', 'semdi'], - 'weekdays_short' => ['dim', 'lon', 'mår', 'mie', 'dju', 'vén', 'sem'], - 'weekdays_min' => ['dim', 'lon', 'mår', 'mie', 'dju', 'vén', 'sem'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - - 'year' => ':count anêye', - 'y' => ':count anêye', - 'a_year' => ':count anêye', - - 'month' => ':count meûs', - 'm' => ':count meûs', - 'a_month' => ':count meûs', - - 'week' => ':count samwinne', - 'w' => ':count samwinne', - 'a_week' => ':count samwinne', - - 'day' => ':count djoû', - 'd' => ':count djoû', - 'a_day' => ':count djoû', - - 'hour' => ':count eure', - 'h' => ':count eure', - 'a_hour' => ':count eure', - - 'minute' => ':count munute', - 'min' => ':count munute', - 'a_minute' => ':count munute', - - 'second' => ':count Sigonde', - 's' => ':count Sigonde', - 'a_second' => ':count Sigonde', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/wae.php b/vendor/nesbot/carbon/src/Carbon/Lang/wae.php deleted file mode 100644 index bf57f23e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/wae.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/wae_CH.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/wae_CH.php b/vendor/nesbot/carbon/src/Carbon/Lang/wae_CH.php deleted file mode 100644 index 2af50b4b..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/wae_CH.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Walser Translation Team ml@translate-wae.ch - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'YYYY-MM-DD', - ], - 'months' => ['Jenner', 'Hornig', 'Märze', 'Abrille', 'Meije', 'Bráčet', 'Heiwet', 'Öigšte', 'Herbštmánet', 'Wímánet', 'Wintermánet', 'Chrištmánet'], - 'months_short' => ['Jen', 'Hor', 'Mär', 'Abr', 'Mei', 'Brá', 'Hei', 'Öig', 'Her', 'Wím', 'Win', 'Chr'], - 'weekdays' => ['Suntag', 'Mäntag', 'Zischtag', 'Mittwuch', 'Frontag', 'Fritag', 'Samschtag'], - 'weekdays_short' => ['Sun', 'Män', 'Zis', 'Mit', 'Fro', 'Fri', 'Sam'], - 'weekdays_min' => ['Sun', 'Män', 'Zis', 'Mit', 'Fro', 'Fri', 'Sam'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - - 'month' => ':count Maano', // less reliable - 'm' => ':count Maano', // less reliable - 'a_month' => ':count Maano', // less reliable -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/wal.php b/vendor/nesbot/carbon/src/Carbon/Lang/wal.php deleted file mode 100644 index e8ec40ff..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/wal.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/wal_ET.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/wal_ET.php b/vendor/nesbot/carbon/src/Carbon/Lang/wal_ET.php deleted file mode 100644 index a4e619a8..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/wal_ET.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Ge'ez Frontier Foundation locales@geez.org - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YYYY', - ], - 'months' => ['ጃንዩወሪ', 'ፌብሩወሪ', 'ማርች', 'ኤፕረል', 'ሜይ', 'ጁን', 'ጁላይ', 'ኦገስት', 'ሴፕቴምበር', 'ኦክተውበር', 'ኖቬምበር', 'ዲሴምበር'], - 'months_short' => ['ጃንዩ', 'ፌብሩ', 'ማርች', 'ኤፕረ', 'ሜይ ', 'ጁን ', 'ጁላይ', 'ኦገስ', 'ሴፕቴ', 'ኦክተ', 'ኖቬም', 'ዲሴም'], - 'weekdays' => ['ወጋ', 'ሳይኖ', 'ማቆሳኛ', 'አሩዋ', 'ሃሙሳ', 'አርባ', 'ቄራ'], - 'weekdays_short' => ['ወጋ ', 'ሳይኖ', 'ማቆሳ', 'አሩዋ', 'ሃሙሳ', 'አርባ', 'ቄራ '], - 'weekdays_min' => ['ወጋ ', 'ሳይኖ', 'ማቆሳ', 'አሩዋ', 'ሃሙሳ', 'አርባ', 'ቄራ '], - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['ማለዶ', 'ቃማ'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/wo.php b/vendor/nesbot/carbon/src/Carbon/Lang/wo.php deleted file mode 100644 index 74b95df0..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/wo.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/wo_SN.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/wo_SN.php b/vendor/nesbot/carbon/src/Carbon/Lang/wo_SN.php deleted file mode 100644 index f8a85b3e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/wo_SN.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - The Debian Project Christian Perrier bubulle@debian.org - */ -return [ - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD.MM.YYYY', - 'LL' => 'MMMM DD, YYYY', - 'LLL' => 'DD MMM HH:mm', - 'LLLL' => 'MMMM DD, YYYY HH:mm', - ], - 'months' => ['sanwiy\'e', 'feebriy\'e', 'mars', 'awril', 'me', 'suwen', 'sulet', 'uut', 'septaambar', 'oktoobar', 'nowaambar', 'desaambar'], - 'months_short' => ['san', 'fee', 'mar', 'awr', 'me ', 'suw', 'sul', 'uut', 'sep', 'okt', 'now', 'des'], - 'weekdays' => ['dib\'eer', 'altine', 'talaata', 'allarba', 'alxames', 'ajjuma', 'gaawu'], - 'weekdays_short' => ['dib', 'alt', 'tal', 'all', 'alx', 'ajj', 'gaa'], - 'weekdays_min' => ['dib', 'alt', 'tal', 'all', 'alx', 'ajj', 'gaa'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'year' => ':count at', - 'month' => ':count wèr', - 'week' => ':count ayubés', - 'day' => ':count bés', - 'hour' => ':count waxtu', - 'minute' => ':count simili', - 'second' => ':count saa', -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/xh.php b/vendor/nesbot/carbon/src/Carbon/Lang/xh.php deleted file mode 100644 index e88c78d9..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/xh.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/xh_ZA.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/xh_ZA.php b/vendor/nesbot/carbon/src/Carbon/Lang/xh_ZA.php deleted file mode 100644 index 910f8311..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/xh_ZA.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Zuza Software Foundation (Translate.org.za) Dwayne Bailey dwayne@translate.org.za - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YYYY', - ], - 'months' => ['eyoMqungu', 'eyoMdumba', 'eyoKwindla', 'uTshazimpuzi', 'uCanzibe', 'eyeSilimela', 'eyeKhala', 'eyeThupa', 'eyoMsintsi', 'eyeDwarha', 'eyeNkanga', 'eyoMnga'], - 'months_short' => ['Mqu', 'Mdu', 'Kwi', 'Tsh', 'Can', 'Sil', 'Kha', 'Thu', 'Msi', 'Dwa', 'Nka', 'Mng'], - 'weekdays' => ['iCawa', 'uMvulo', 'lwesiBini', 'lwesiThathu', 'ulweSine', 'lwesiHlanu', 'uMgqibelo'], - 'weekdays_short' => ['Caw', 'Mvu', 'Bin', 'Tha', 'Sin', 'Hla', 'Mgq'], - 'weekdays_min' => ['Caw', 'Mvu', 'Bin', 'Tha', 'Sin', 'Hla', 'Mgq'], - 'day_of_first_week_of_year' => 1, - - 'year' => ':count ihlobo', // less reliable - 'y' => ':count ihlobo', // less reliable - 'a_year' => ':count ihlobo', // less reliable - - 'hour' => ':count iwotshi', // less reliable - 'h' => ':count iwotshi', // less reliable - 'a_hour' => ':count iwotshi', // less reliable - - 'minute' => ':count ingqalelo', // less reliable - 'min' => ':count ingqalelo', // less reliable - 'a_minute' => ':count ingqalelo', // less reliable - - 'second' => ':count nceda', // less reliable - 's' => ':count nceda', // less reliable - 'a_second' => ':count nceda', // less reliable - - 'month' => ':count inyanga', - 'm' => ':count inyanga', - 'a_month' => ':count inyanga', - - 'week' => ':count veki', - 'w' => ':count veki', - 'a_week' => ':count veki', - - 'day' => ':count imini', - 'd' => ':count imini', - 'a_day' => ':count imini', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/xog.php b/vendor/nesbot/carbon/src/Carbon/Lang/xog.php deleted file mode 100644 index eb55b4ab..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/xog.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['Munkyo', 'Eigulo'], - 'weekdays' => ['Sabiiti', 'Balaza', 'Owokubili', 'Owokusatu', 'Olokuna', 'Olokutaanu', 'Olomukaaga'], - 'weekdays_short' => ['Sabi', 'Bala', 'Kubi', 'Kusa', 'Kuna', 'Kuta', 'Muka'], - 'weekdays_min' => ['Sabi', 'Bala', 'Kubi', 'Kusa', 'Kuna', 'Kuta', 'Muka'], - 'months' => ['Janwaliyo', 'Febwaliyo', 'Marisi', 'Apuli', 'Maayi', 'Juuni', 'Julaayi', 'Agusito', 'Sebuttemba', 'Okitobba', 'Novemba', 'Desemba'], - 'months_short' => ['Jan', 'Feb', 'Mar', 'Apu', 'Maa', 'Juu', 'Jul', 'Agu', 'Seb', 'Oki', 'Nov', 'Des'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/yav.php b/vendor/nesbot/carbon/src/Carbon/Lang/yav.php deleted file mode 100644 index 225a20d8..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/yav.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/en.php', [ - 'meridiem' => ['kiɛmɛ́ɛm', 'kisɛ́ndɛ'], - 'weekdays' => ['sɔ́ndiɛ', 'móndie', 'muányáŋmóndie', 'metúkpíápɛ', 'kúpélimetúkpiapɛ', 'feléte', 'séselé'], - 'weekdays_short' => ['sd', 'md', 'mw', 'et', 'kl', 'fl', 'ss'], - 'weekdays_min' => ['sd', 'md', 'mw', 'et', 'kl', 'fl', 'ss'], - 'months' => ['pikítíkítie, oólí ú kutúan', 'siɛyɛ́, oóli ú kándíɛ', 'ɔnsúmbɔl, oóli ú kátátúɛ', 'mesiŋ, oóli ú kénie', 'ensil, oóli ú kátánuɛ', 'ɔsɔn', 'efute', 'pisuyú', 'imɛŋ i puɔs', 'imɛŋ i putúk,oóli ú kátíɛ', 'makandikɛ', 'pilɔndɔ́'], - 'months_short' => ['o.1', 'o.2', 'o.3', 'o.4', 'o.5', 'o.6', 'o.7', 'o.8', 'o.9', 'o.10', 'o.11', 'o.12'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'D/M/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/yi.php b/vendor/nesbot/carbon/src/Carbon/Lang/yi.php deleted file mode 100644 index 8f320229..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/yi.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/yi_US.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/yi_US.php b/vendor/nesbot/carbon/src/Carbon/Lang/yi_US.php deleted file mode 100644 index f764d36f..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/yi_US.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - http://www.uyip.org/ Pablo Saratxaga pablo@mandrakesoft.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YY', - ], - 'months' => ['יאַנואַר', 'פֿעברואַר', 'מערץ', 'אַפּריל', 'מיי', 'יוני', 'יולי', 'אויגוסט', 'סעפּטעמבער', 'אקטאבער', 'נאוועמבער', 'דעצעמבער'], - 'months_short' => ['יאַנ', 'פֿעב', 'מאַר', 'אַפּר', 'מײַ ', 'יונ', 'יול', 'אױג', 'סעפּ', 'אָקט', 'נאָװ', 'דעצ'], - 'weekdays' => ['זונטיק', 'מאָנטיק', 'דינסטיק', 'מיטװאָך', 'דאָנערשטיק', 'פֿרײַטיק', 'שבת'], - 'weekdays_short' => ['זונ\'', 'מאָנ\'', 'דינ\'', 'מיט\'', 'דאָנ\'', 'פֿרײַ\'', 'שבת'], - 'weekdays_min' => ['זונ\'', 'מאָנ\'', 'דינ\'', 'מיט\'', 'דאָנ\'', 'פֿרײַ\'', 'שבת'], - 'day_of_first_week_of_year' => 1, - - 'year' => ':count יאר', - 'y' => ':count יאר', - 'a_year' => ':count יאר', - - 'month' => ':count חודש', - 'm' => ':count חודש', - 'a_month' => ':count חודש', - - 'week' => ':count וואָך', - 'w' => ':count וואָך', - 'a_week' => ':count וואָך', - - 'day' => ':count טאָג', - 'd' => ':count טאָג', - 'a_day' => ':count טאָג', - - 'hour' => ':count שעה', - 'h' => ':count שעה', - 'a_hour' => ':count שעה', - - 'minute' => ':count מינוט', - 'min' => ':count מינוט', - 'a_minute' => ':count מינוט', - - 'second' => ':count סעקונדע', - 's' => ':count סעקונדע', - 'a_second' => ':count סעקונדע', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/yo.php b/vendor/nesbot/carbon/src/Carbon/Lang/yo.php deleted file mode 100644 index 0a829810..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/yo.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - François B - * - Atolagbe Abisoye - */ -return [ - 'year' => 'ọdún :count', - 'a_year' => '{1}ọdún kan|ọdún :count', - 'month' => 'osù :count', - 'a_month' => '{1}osù kan|osù :count', - 'week' => 'ọsẹ :count', - 'a_week' => '{1}ọsẹ kan|ọsẹ :count', - 'day' => 'ọjọ́ :count', - 'a_day' => '{1}ọjọ́ kan|ọjọ́ :count', - 'hour' => 'wákati :count', - 'a_hour' => '{1}wákati kan|wákati :count', - 'minute' => 'ìsẹjú :count', - 'a_minute' => '{1}ìsẹjú kan|ìsẹjú :count', - 'second' => 'iaayá :count', - 'a_second' => '{1}ìsẹjú aayá die|aayá :count', - 'ago' => ':time kọjá', - 'from_now' => 'ní :time', - 'diff_yesterday' => 'Àna', - 'diff_yesterday_regexp' => 'Àna(?:\\s+ni)?', - 'diff_today' => 'Ònì', - 'diff_today_regexp' => 'Ònì(?:\\s+ni)?', - 'diff_tomorrow' => 'Ọ̀la', - 'diff_tomorrow_regexp' => 'Ọ̀la(?:\\s+ni)?', - 'formats' => [ - 'LT' => 'h:mm A', - 'LTS' => 'h:mm:ss A', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY h:mm A', - 'LLLL' => 'dddd, D MMMM YYYY h:mm A', - ], - 'calendar' => [ - 'sameDay' => '[Ònì ni] LT', - 'nextDay' => '[Ọ̀la ni] LT', - 'nextWeek' => 'dddd [Ọsẹ̀ tón\'bọ] [ni] LT', - 'lastDay' => '[Àna ni] LT', - 'lastWeek' => 'dddd [Ọsẹ̀ tólọ́] [ni] LT', - 'sameElse' => 'L', - ], - 'ordinal' => 'ọjọ́ :number', - 'months' => ['Sẹ́rẹ́', 'Èrèlè', 'Ẹrẹ̀nà', 'Ìgbé', 'Èbibi', 'Òkùdu', 'Agẹmo', 'Ògún', 'Owewe', 'Ọ̀wàrà', 'Bélú', 'Ọ̀pẹ̀̀'], - 'months_short' => ['Sẹ́r', 'Èrl', 'Ẹrn', 'Ìgb', 'Èbi', 'Òkù', 'Agẹ', 'Ògú', 'Owe', 'Ọ̀wà', 'Bél', 'Ọ̀pẹ̀̀'], - 'weekdays' => ['Àìkú', 'Ajé', 'Ìsẹ́gun', 'Ọjọ́rú', 'Ọjọ́bọ', 'Ẹtì', 'Àbámẹ́ta'], - 'weekdays_short' => ['Àìk', 'Ajé', 'Ìsẹ́', 'Ọjr', 'Ọjb', 'Ẹtì', 'Àbá'], - 'weekdays_min' => ['Àì', 'Aj', 'Ìs', 'Ọr', 'Ọb', 'Ẹt', 'Àb'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'meridiem' => ['Àárọ̀', 'Ọ̀sán'], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/yo_BJ.php b/vendor/nesbot/carbon/src/Carbon/Lang/yo_BJ.php deleted file mode 100644 index 12b9e815..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/yo_BJ.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array_replace_recursive(require __DIR__.'/yo.php', [ - 'meridiem' => ['Àárɔ̀', 'Ɔ̀sán'], - 'weekdays' => ['Ɔjɔ́ Àìkú', 'Ɔjɔ́ Ajé', 'Ɔjɔ́ Ìsɛ́gun', 'Ɔjɔ́rú', 'Ɔjɔ́bɔ', 'Ɔjɔ́ Ɛtì', 'Ɔjɔ́ Àbámɛ́ta'], - 'weekdays_short' => ['Àìkú', 'Ajé', 'Ìsɛ́gun', 'Ɔjɔ́rú', 'Ɔjɔ́bɔ', 'Ɛtì', 'Àbámɛ́ta'], - 'weekdays_min' => ['Àìkú', 'Ajé', 'Ìsɛ́gun', 'Ɔjɔ́rú', 'Ɔjɔ́bɔ', 'Ɛtì', 'Àbámɛ́ta'], - 'months' => ['Oshù Shɛ́rɛ́', 'Oshù Èrèlè', 'Oshù Ɛrɛ̀nà', 'Oshù Ìgbé', 'Oshù Ɛ̀bibi', 'Oshù Òkúdu', 'Oshù Agɛmɔ', 'Oshù Ògún', 'Oshù Owewe', 'Oshù Ɔ̀wàrà', 'Oshù Bélú', 'Oshù Ɔ̀pɛ̀'], - 'months_short' => ['Shɛ́rɛ́', 'Èrèlè', 'Ɛrɛ̀nà', 'Ìgbé', 'Ɛ̀bibi', 'Òkúdu', 'Agɛmɔ', 'Ògún', 'Owewe', 'Ɔ̀wàrà', 'Bélú', 'Ɔ̀pɛ̀'], - 'first_day_of_week' => 1, - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd, D MMMM YYYY HH:mm', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/yo_NG.php b/vendor/nesbot/carbon/src/Carbon/Lang/yo_NG.php deleted file mode 100644 index 6860bc1a..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/yo_NG.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/yo.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/yue.php b/vendor/nesbot/carbon/src/Carbon/Lang/yue.php deleted file mode 100644 index ce233a4f..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/yue.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/yue_HK.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/yue_HK.php b/vendor/nesbot/carbon/src/Carbon/Lang/yue_HK.php deleted file mode 100644 index 4e7d5c36..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/yue_HK.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/zh_HK.php', [ - 'formats' => [ - 'L' => 'YYYY年MM月DD日 dddd', - ], - 'months' => ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], - 'months_short' => ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], - 'weekdays' => ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'], - 'weekdays_short' => ['日', '一', '二', '三', '四', '五', '六'], - 'weekdays_min' => ['日', '一', '二', '三', '四', '五', '六'], - 'first_day_of_week' => 0, - 'day_of_first_week_of_year' => 1, - 'meridiem' => ['上午', '下午'], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/yue_Hans.php b/vendor/nesbot/carbon/src/Carbon/Lang/yue_Hans.php deleted file mode 100644 index db913caa..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/yue_Hans.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/zh_Hans.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/yue_Hant.php b/vendor/nesbot/carbon/src/Carbon/Lang/yue_Hant.php deleted file mode 100644 index e2526f13..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/yue_Hant.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/zh_Hant.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/yuw.php b/vendor/nesbot/carbon/src/Carbon/Lang/yuw.php deleted file mode 100644 index 8efdc937..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/yuw.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/yuw_PG.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/yuw_PG.php b/vendor/nesbot/carbon/src/Carbon/Lang/yuw_PG.php deleted file mode 100644 index b99ad2e8..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/yuw_PG.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Information from native speakers Hannah Sarvasy nungon.localization@gmail.com - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YY', - ], - 'months' => ['jenuari', 'febuari', 'mas', 'epril', 'mei', 'jun', 'julai', 'ögus', 'septemba', 'öktoba', 'nöwemba', 'diksemba'], - 'months_short' => ['jen', 'feb', 'mas', 'epr', 'mei', 'jun', 'jul', 'ögu', 'sep', 'ökt', 'nöw', 'dis'], - 'weekdays' => ['sönda', 'mönda', 'sinda', 'mitiwö', 'sogipbono', 'nenggo', 'söndanggie'], - 'weekdays_short' => ['sön', 'mön', 'sin', 'mit', 'soi', 'nen', 'sab'], - 'weekdays_min' => ['sön', 'mön', 'sin', 'mit', 'soi', 'nen', 'sab'], - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/zgh.php b/vendor/nesbot/carbon/src/Carbon/Lang/zgh.php deleted file mode 100644 index 4d2c3b37..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/zgh.php +++ /dev/null @@ -1,80 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - BAKTETE Miloud - */ -return [ - 'year' => ':count ⵓⵙⴳⴳⵯⴰⵙ|:count ⵉⵙⴳⴳⵓⵙⴰ', - 'a_year' => 'ⵓⵙⴳⴳⵯⴰⵙ|:count ⵉⵙⴳⴳⵓⵙⴰ', - 'y' => ':count ⵓⵙⴳⴳⵯⴰⵙ|:count ⵉⵙⴳⴳⵓⵙⴰ', - 'month' => ':count ⵡⴰⵢⵢⵓⵔ|:count ⴰⵢⵢⵓⵔⵏ', - 'a_month' => 'ⵉⴷⵊ ⵡⴰⵢⵢⵓⵔ|:count ⴰⵢⵢⵓⵔⵏ', - 'm' => ':count ⴰⵢⵢⵓⵔⵏ', - 'week' => ':count ⵉⵎⴰⵍⴰⵙⵙ|:count ⵉⵎⴰⵍⴰⵙⵙⵏ', - 'a_week' => 'ⵉⵛⵜ ⵉⵎⴰⵍⴰⵙⵙ|:count ⵉⵎⴰⵍⴰⵙⵙⵏ', - 'w' => ':count ⵉⵎⴰⵍⴰⵙⵙ.', - 'day' => ':count ⵡⴰⵙⵙ|:count ⵓⵙⵙⴰⵏ', - 'a_day' => 'ⵉⴷⵊ ⵡⴰⵙⵙ|:count ⵓⵙⵙⴰⵏ', - 'd' => ':count ⵓ', - 'hour' => ':count ⵜⵙⵔⴰⴳⵜ|:count ⵜⵉⵙⵔⴰⴳⵉⵏ', - 'a_hour' => 'ⵉⵛⵜ ⵜⵙⵔⴰⴳⵜ|:count ⵜⵉⵙⵔⴰⴳⵉⵏ', - 'h' => ':count ⵜ', - 'minute' => ':count ⵜⵓⵙⴷⵉⴷⵜ|:count ⵜⵓⵙⴷⵉⴷⵉⵏ', - 'a_minute' => 'ⵉⵛⵜ ⵜⵓⵙⴷⵉⴷⵜ|:count ⵜⵓⵙⴷⵉⴷⵉⵏ', - 'min' => ':count ⵜⵓⵙ', - 'second' => ':count ⵜⵙⵉⵏⵜ|:count ⵜⵉⵙⵉⵏⴰ', - 'a_second' => 'ⴽⵔⴰ ⵜⵉⵙⵉⵏⴰ|:count ⵜⵉⵙⵉⵏⴰ', - 's' => ':count ⵜ', - 'ago' => 'ⵣⴳ :time', - 'from_now' => 'ⴷⴳ :time', - 'after' => ':time ⴰⵡⴰⵔ', - 'before' => ':time ⴷⴰⵜ', - 'diff_now' => 'ⴰⴷⵡⴰⵍⵉ', - 'diff_today' => 'ⴰⵙⵙ', - 'diff_today_regexp' => 'ⴰⵙⵙ(?:\\s+ⴰ/ⴰⴷ)?(?:\\s+ⴳ)?', - 'diff_yesterday' => 'ⴰⵙⵙⵏⵏⴰⵟ', - 'diff_yesterday_regexp' => 'ⴰⵙⵙⵏⵏⴰⵟ(?:\\s+ⴳ)?', - 'diff_tomorrow' => 'ⴰⵙⴽⴽⴰ', - 'diff_tomorrow_regexp' => 'ⴰⵙⴽⴽⴰ(?:\\s+ⴳ)?', - 'diff_before_yesterday' => 'ⴼⵔ ⵉⴹⵏⵏⴰⵟ', - 'diff_after_tomorrow' => 'ⵏⴰⴼ ⵓⵙⴽⴽⴰ', - 'period_recurrences' => ':count ⵜⵉⴽⴽⴰⵍ', - 'period_interval' => 'ⴽⵓ :interval', - 'period_start_date' => 'ⴳ :date', - 'period_end_date' => 'ⵉ :date', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/YYYY', - 'LL' => 'D MMMM YYYY', - 'LLL' => 'D MMMM YYYY HH:mm', - 'LLLL' => 'dddd D MMMM YYYY HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[ⴰⵙⵙ ⴰ/ⴰⴷ ⴳ] LT', - 'nextDay' => '[ⴰⵙⴽⴽⴰ ⴳ] LT', - 'nextWeek' => 'dddd [ⴳ] LT', - 'lastDay' => '[ⴰⵙⵙⵏⵏⴰⵟ ⴳ] LT', - 'lastWeek' => 'dddd [ⴰⵎⴳⴳⴰⵔⵓ ⴳ] LT', - 'sameElse' => 'L', - ], - 'meridiem' => ['ⵜⵉⴼⴰⵡⵜ', 'ⵜⴰⴷⴳⴳⵯⴰⵜ'], - 'months' => ['ⵉⵏⵏⴰⵢⵔ', 'ⴱⵕⴰⵢⵕ', 'ⵎⴰⵕⵚ', 'ⵉⴱⵔⵉⵔ', 'ⵎⴰⵢⵢⵓ', 'ⵢⵓⵏⵢⵓ', 'ⵢⵓⵍⵢⵓⵣ', 'ⵖⵓⵛⵜ', 'ⵛⵓⵜⴰⵏⴱⵉⵔ', 'ⴽⵟⵓⴱⵕ', 'ⵏⵓⵡⴰⵏⴱⵉⵔ', 'ⴷⵓⵊⴰⵏⴱⵉⵔ'], - 'months_short' => ['ⵉⵏⵏ', 'ⴱⵕⴰ', 'ⵎⴰⵕ', 'ⵉⴱⵔ', 'ⵎⴰⵢ', 'ⵢⵓⵏ', 'ⵢⵓⵍ', 'ⵖⵓⵛ', 'ⵛⵓⵜ', 'ⴽⵟⵓ', 'ⵏⵓⵡ', 'ⴷⵓⵊ'], - 'weekdays' => ['ⵓⵙⴰⵎⴰⵙ', 'ⵡⴰⵢⵏⴰⵙ', 'ⵓⵙⵉⵏⴰⵙ', 'ⵡⴰⴽⵕⴰⵙ', 'ⵓⴽⵡⴰⵙ', 'ⵓⵙⵉⵎⵡⴰⵙ', 'ⵓⵙⵉⴹⵢⴰⵙ'], - 'weekdays_short' => ['ⵓⵙⴰ', 'ⵡⴰⵢ', 'ⵓⵙⵉ', 'ⵡⴰⴽ', 'ⵓⴽⵡ', 'ⵓⵙⵉⵎ', 'ⵓⵙⵉⴹ'], - 'weekdays_min' => ['ⵓⵙⴰ', 'ⵡⴰⵢ', 'ⵓⵙⵉ', 'ⵡⴰⴽ', 'ⵓⴽⵡ', 'ⵓⵙⵉⵎ', 'ⵓⵙⵉⴹ'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 1, - 'list' => [', ', ' ⴷ '], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/zh.php b/vendor/nesbot/carbon/src/Carbon/Lang/zh.php deleted file mode 100644 index 1187c3d7..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/zh.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - xuri - * - sycuato - * - bokideckonja - * - Luo Ning - * - William Yang (williamyang233) - */ -return array_merge(require __DIR__.'/zh_Hans.php', [ - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'YYYY/MM/DD', - 'LL' => 'YYYY年M月D日', - 'LLL' => 'YYYY年M月D日 A h点mm分', - 'LLLL' => 'YYYY年M月D日dddd A h点mm分', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/zh_CN.php b/vendor/nesbot/carbon/src/Carbon/Lang/zh_CN.php deleted file mode 100644 index 9c05d5a8..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/zh_CN.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - monkeycon - * - François B - * - Jason Katz-Brown - * - Serhan Apaydın - * - Matt Johnson - * - JD Isaacks - * - Zeno Zeng - * - Chris Hemp - * - shankesgk2 - */ -return array_merge(require __DIR__.'/zh.php', [ - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'YYYY/MM/DD', - 'LL' => 'YYYY年M月D日', - 'LLL' => 'YYYY年M月D日Ah点mm分', - 'LLLL' => 'YYYY年M月D日ddddAh点mm分', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/zh_HK.php b/vendor/nesbot/carbon/src/Carbon/Lang/zh_HK.php deleted file mode 100644 index c3ee9fcb..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/zh_HK.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/zh_Hant_HK.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans.php b/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans.php deleted file mode 100644 index 9b91785e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans.php +++ /dev/null @@ -1,109 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - monkeycon - * - François B - * - Jason Katz-Brown - * - Konstantin Konev - * - Chris Lam - * - Serhan Apaydın - * - Gary Lo - * - JD Isaacks - * - Chris Hemp - * - shankesgk2 - * - Daniel Cheung (danvim) - */ -return [ - 'year' => ':count:optional-space年', - 'y' => ':count:optional-space年', - 'month' => ':count:optional-space个月', - 'm' => ':count:optional-space个月', - 'week' => ':count:optional-space周', - 'w' => ':count:optional-space周', - 'day' => ':count:optional-space天', - 'd' => ':count:optional-space天', - 'hour' => ':count:optional-space小时', - 'h' => ':count:optional-space小时', - 'minute' => ':count:optional-space分钟', - 'min' => ':count:optional-space分钟', - 'second' => ':count:optional-space秒', - 'a_second' => '{1}几秒|]1,Inf[:count:optional-space秒', - 's' => ':count:optional-space秒', - 'ago' => ':time前', - 'from_now' => ':time后', - 'after' => ':time后', - 'before' => ':time前', - 'diff_now' => '现在', - 'diff_today' => '今天', - 'diff_yesterday' => '昨天', - 'diff_tomorrow' => '明天', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'YYYY/MM/DD', - 'LL' => 'YYYY年M月D日', - 'LLL' => 'YYYY年M月D日 HH:mm', - 'LLLL' => 'YYYY年M月D日dddd HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[今天]LT', - 'nextDay' => '[明天]LT', - 'nextWeek' => '[下]ddddLT', - 'lastDay' => '[昨天]LT', - 'lastWeek' => '[上]ddddLT', - 'sameElse' => 'L', - ], - 'ordinal' => function ($number, $period) { - switch ($period) { - case 'd': - case 'D': - case 'DDD': - return $number.'日'; - case 'M': - return $number.'月'; - case 'w': - case 'W': - return $number.'周'; - default: - return $number; - } - }, - 'meridiem' => function ($hour, $minute) { - $time = $hour * 100 + $minute; - if ($time < 600) { - return '凌晨'; - } - if ($time < 900) { - return '早上'; - } - if ($time < 1130) { - return '上午'; - } - if ($time < 1230) { - return '中午'; - } - if ($time < 1800) { - return '下午'; - } - - return '晚上'; - }, - 'months' => ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], - 'months_short' => ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], - 'weekdays' => ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'], - 'weekdays_short' => ['周日', '周一', '周二', '周三', '周四', '周五', '周六'], - 'weekdays_min' => ['日', '一', '二', '三', '四', '五', '六'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => '', -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_HK.php b/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_HK.php deleted file mode 100644 index db913caa..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_HK.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/zh_Hans.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_MO.php b/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_MO.php deleted file mode 100644 index db913caa..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_MO.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/zh_Hans.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_SG.php b/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_SG.php deleted file mode 100644 index db913caa..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_SG.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/zh_Hans.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant.php b/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant.php deleted file mode 100644 index a27b6109..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant.php +++ /dev/null @@ -1,111 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Adam - * - monkeycon - * - François B - * - Jason Katz-Brown - * - Chris Lam - * - Serhan Apaydın - * - Gary Lo - * - JD Isaacks - * - Chris Hemp - * - Eddie - * - KID - * - shankesgk2 - * - Daniel Cheung (danvim) - */ -return [ - 'year' => ':count:optional-space年', - 'y' => ':count:optional-space年', - 'month' => ':count:optional-space個月', - 'm' => ':count:optional-space月', - 'week' => ':count:optional-space週', - 'w' => ':count:optional-space週', - 'day' => ':count:optional-space天', - 'd' => ':count:optional-space天', - 'hour' => ':count:optional-space小時', - 'h' => ':count:optional-space小時', - 'minute' => ':count:optional-space分鐘', - 'min' => ':count:optional-space分鐘', - 'second' => ':count:optional-space秒', - 'a_second' => '{1}幾秒|]1,Inf[:count:optional-space秒', - 's' => ':count:optional-space秒', - 'ago' => ':time前', - 'from_now' => ':time後', - 'after' => ':time後', - 'before' => ':time前', - 'diff_now' => '現在', - 'diff_today' => '今天', - 'diff_yesterday' => '昨天', - 'diff_tomorrow' => '明天', - 'formats' => [ - 'LT' => 'HH:mm', - 'LTS' => 'HH:mm:ss', - 'L' => 'YYYY/MM/DD', - 'LL' => 'YYYY年M月D日', - 'LLL' => 'YYYY年M月D日 HH:mm', - 'LLLL' => 'YYYY年M月D日dddd HH:mm', - ], - 'calendar' => [ - 'sameDay' => '[今天] LT', - 'nextDay' => '[明天] LT', - 'nextWeek' => '[下]dddd LT', - 'lastDay' => '[昨天] LT', - 'lastWeek' => '[上]dddd LT', - 'sameElse' => 'L', - ], - 'ordinal' => function ($number, $period) { - switch ($period) { - case 'd': - case 'D': - case 'DDD': - return $number.'日'; - case 'M': - return $number.'月'; - case 'w': - case 'W': - return $number.'周'; - default: - return $number; - } - }, - 'meridiem' => function ($hour, $minute) { - $time = $hour * 100 + $minute; - if ($time < 600) { - return '凌晨'; - } - if ($time < 900) { - return '早上'; - } - if ($time < 1130) { - return '上午'; - } - if ($time < 1230) { - return '中午'; - } - if ($time < 1800) { - return '下午'; - } - - return '晚上'; - }, - 'months' => ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], - 'months_short' => ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], - 'weekdays' => ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'], - 'weekdays_short' => ['週日', '週一', '週二', '週三', '週四', '週五', '週六'], - 'weekdays_min' => ['日', '一', '二', '三', '四', '五', '六'], - 'first_day_of_week' => 1, - 'day_of_first_week_of_year' => 4, - 'list' => '', -]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_HK.php b/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_HK.php deleted file mode 100644 index e2526f13..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_HK.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/zh_Hant.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_MO.php b/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_MO.php deleted file mode 100644 index e2526f13..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_MO.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/zh_Hant.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_TW.php b/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_TW.php deleted file mode 100644 index e2526f13..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_TW.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/zh_Hant.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/zh_MO.php b/vendor/nesbot/carbon/src/Carbon/Lang/zh_MO.php deleted file mode 100644 index 1c86d477..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/zh_MO.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - tarunvelli - * - Eddie - * - KID - * - shankesgk2 - */ -return array_replace_recursive(require __DIR__.'/zh_Hant.php', [ - 'after' => ':time后', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/zh_SG.php b/vendor/nesbot/carbon/src/Carbon/Lang/zh_SG.php deleted file mode 100644 index c451a562..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/zh_SG.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/zh.php', [ - 'formats' => [ - 'L' => 'YYYY年MM月DD日', - ], - 'months' => ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], - 'months_short' => ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], - 'weekdays' => ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'], - 'weekdays_short' => ['日', '一', '二', '三', '四', '五', '六'], - 'weekdays_min' => ['日', '一', '二', '三', '四', '五', '六'], - 'day_of_first_week_of_year' => 1, -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/zh_TW.php b/vendor/nesbot/carbon/src/Carbon/Lang/zh_TW.php deleted file mode 100644 index c6789ed2..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/zh_TW.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/zh_Hant_TW.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/zh_YUE.php b/vendor/nesbot/carbon/src/Carbon/Lang/zh_YUE.php deleted file mode 100644 index b0d9ba86..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/zh_YUE.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org - */ -return array_replace_recursive(require __DIR__.'/zh.php', [ - 'formats' => [ - 'L' => 'YYYY-MM-DD', - ], -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/zu.php b/vendor/nesbot/carbon/src/Carbon/Lang/zu.php deleted file mode 100644 index 9a6cce02..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/zu.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Unknown default region, use the first alphabetically. - */ -return require __DIR__.'/zu_ZA.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/zu_ZA.php b/vendor/nesbot/carbon/src/Carbon/Lang/zu_ZA.php deleted file mode 100644 index 6bfb72f0..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/zu_ZA.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Authors: - * - Zuza Software Foundation (Translate.org.za) Dwayne Bailey dwayne@translate.org.za - */ -return array_replace_recursive(require __DIR__.'/en.php', [ - 'formats' => [ - 'L' => 'DD/MM/YYYY', - ], - 'months' => ['Januwari', 'Februwari', 'Mashi', 'Ephreli', 'Meyi', 'Juni', 'Julayi', 'Agasti', 'Septhemba', 'Okthoba', 'Novemba', 'Disemba'], - 'months_short' => ['Jan', 'Feb', 'Mas', 'Eph', 'Mey', 'Jun', 'Jul', 'Aga', 'Sep', 'Okt', 'Nov', 'Dis'], - 'weekdays' => ['iSonto', 'uMsombuluko', 'uLwesibili', 'uLwesithathu', 'uLwesine', 'uLwesihlanu', 'uMgqibelo'], - 'weekdays_short' => ['Son', 'Mso', 'Bil', 'Tha', 'Sin', 'Hla', 'Mgq'], - 'weekdays_min' => ['Son', 'Mso', 'Bil', 'Tha', 'Sin', 'Hla', 'Mgq'], - 'day_of_first_week_of_year' => 1, - - 'year' => 'kweminyaka engu-:count', - 'y' => 'kweminyaka engu-:count', - 'a_year' => 'kweminyaka engu-:count', - - 'month' => 'izinyanga ezingu-:count', - 'm' => 'izinyanga ezingu-:count', - 'a_month' => 'izinyanga ezingu-:count', - - 'week' => 'lwamasonto angu-:count', - 'w' => 'lwamasonto angu-:count', - 'a_week' => 'lwamasonto angu-:count', - - 'day' => 'ezingaba ngu-:count', - 'd' => 'ezingaba ngu-:count', - 'a_day' => 'ezingaba ngu-:count', - - 'hour' => 'amahora angu-:count', - 'h' => 'amahora angu-:count', - 'a_hour' => 'amahora angu-:count', - - 'minute' => 'ngemizuzu engu-:count', - 'min' => 'ngemizuzu engu-:count', - 'a_minute' => 'ngemizuzu engu-:count', - - 'second' => 'imizuzwana engu-:count', - 's' => 'imizuzwana engu-:count', - 'a_second' => 'imizuzwana engu-:count', -]); diff --git a/vendor/nesbot/carbon/src/Carbon/Language.php b/vendor/nesbot/carbon/src/Carbon/Language.php deleted file mode 100644 index 1fb5bafd..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Language.php +++ /dev/null @@ -1,342 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon; - -use JsonSerializable; -use ReturnTypeWillChange; - -class Language implements JsonSerializable -{ - /** - * @var array - */ - protected static $languagesNames; - - /** - * @var array - */ - protected static $regionsNames; - - /** - * @var string - */ - protected $id; - - /** - * @var string - */ - protected $code; - - /** - * @var string|null - */ - protected $variant; - - /** - * @var string|null - */ - protected $region; - - /** - * @var array - */ - protected $names; - - /** - * @var string - */ - protected $isoName; - - /** - * @var string - */ - protected $nativeName; - - public function __construct(string $id) - { - $this->id = str_replace('-', '_', $id); - $parts = explode('_', $this->id); - $this->code = $parts[0]; - - if (isset($parts[1])) { - if (!preg_match('/^[A-Z]+$/', $parts[1])) { - $this->variant = $parts[1]; - $parts[1] = $parts[2] ?? null; - } - if ($parts[1]) { - $this->region = $parts[1]; - } - } - } - - /** - * Get the list of the known languages. - * - * @return array - */ - public static function all() - { - if (!static::$languagesNames) { - static::$languagesNames = require __DIR__.'/List/languages.php'; - } - - return static::$languagesNames; - } - - /** - * Get the list of the known regions. - * - * @return array - */ - public static function regions() - { - if (!static::$regionsNames) { - static::$regionsNames = require __DIR__.'/List/regions.php'; - } - - return static::$regionsNames; - } - - /** - * Get both isoName and nativeName as an array. - * - * @return array - */ - public function getNames(): array - { - if (!$this->names) { - $this->names = static::all()[$this->code] ?? [ - 'isoName' => $this->code, - 'nativeName' => $this->code, - ]; - } - - return $this->names; - } - - /** - * Returns the original locale ID. - * - * @return string - */ - public function getId(): string - { - return $this->id; - } - - /** - * Returns the code of the locale "en"/"fr". - * - * @return string - */ - public function getCode(): string - { - return $this->code; - } - - /** - * Returns the variant code such as cyrl/latn. - * - * @return string|null - */ - public function getVariant(): ?string - { - return $this->variant; - } - - /** - * Returns the variant such as Cyrillic/Latin. - * - * @return string|null - */ - public function getVariantName(): ?string - { - if ($this->variant === 'Latn') { - return 'Latin'; - } - - if ($this->variant === 'Cyrl') { - return 'Cyrillic'; - } - - return $this->variant; - } - - /** - * Returns the region part of the locale. - * - * @return string|null - */ - public function getRegion(): ?string - { - return $this->region; - } - - /** - * Returns the region name for the current language. - * - * @return string|null - */ - public function getRegionName(): ?string - { - return $this->region ? (static::regions()[$this->region] ?? $this->region) : null; - } - - /** - * Returns the long ISO language name. - * - * @return string - */ - public function getFullIsoName(): string - { - if (!$this->isoName) { - $this->isoName = $this->getNames()['isoName']; - } - - return $this->isoName; - } - - /** - * Set the ISO language name. - * - * @param string $isoName - */ - public function setIsoName(string $isoName): self - { - $this->isoName = $isoName; - - return $this; - } - - /** - * Return the full name of the language in this language. - * - * @return string - */ - public function getFullNativeName(): string - { - if (!$this->nativeName) { - $this->nativeName = $this->getNames()['nativeName']; - } - - return $this->nativeName; - } - - /** - * Set the name of the language in this language. - * - * @param string $nativeName - */ - public function setNativeName(string $nativeName): self - { - $this->nativeName = $nativeName; - - return $this; - } - - /** - * Returns the short ISO language name. - * - * @return string - */ - public function getIsoName(): string - { - $name = $this->getFullIsoName(); - - return trim(strstr($name, ',', true) ?: $name); - } - - /** - * Get the short name of the language in this language. - * - * @return string - */ - public function getNativeName(): string - { - $name = $this->getFullNativeName(); - - return trim(strstr($name, ',', true) ?: $name); - } - - /** - * Get a string with short ISO name, region in parentheses if applicable, variant in parentheses if applicable. - * - * @return string - */ - public function getIsoDescription() - { - $region = $this->getRegionName(); - $variant = $this->getVariantName(); - - return $this->getIsoName().($region ? ' ('.$region.')' : '').($variant ? ' ('.$variant.')' : ''); - } - - /** - * Get a string with short native name, region in parentheses if applicable, variant in parentheses if applicable. - * - * @return string - */ - public function getNativeDescription() - { - $region = $this->getRegionName(); - $variant = $this->getVariantName(); - - return $this->getNativeName().($region ? ' ('.$region.')' : '').($variant ? ' ('.$variant.')' : ''); - } - - /** - * Get a string with long ISO name, region in parentheses if applicable, variant in parentheses if applicable. - * - * @return string - */ - public function getFullIsoDescription() - { - $region = $this->getRegionName(); - $variant = $this->getVariantName(); - - return $this->getFullIsoName().($region ? ' ('.$region.')' : '').($variant ? ' ('.$variant.')' : ''); - } - - /** - * Get a string with long native name, region in parentheses if applicable, variant in parentheses if applicable. - * - * @return string - */ - public function getFullNativeDescription() - { - $region = $this->getRegionName(); - $variant = $this->getVariantName(); - - return $this->getFullNativeName().($region ? ' ('.$region.')' : '').($variant ? ' ('.$variant.')' : ''); - } - - /** - * Returns the original locale ID. - * - * @return string - */ - public function __toString() - { - return $this->getId(); - } - - /** - * Get a string with short ISO name, region in parentheses if applicable, variant in parentheses if applicable. - * - * @return string - */ - #[ReturnTypeWillChange] - public function jsonSerialize() - { - return $this->getIsoDescription(); - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php b/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php deleted file mode 100644 index 84e241e3..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php +++ /dev/null @@ -1,127 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Laravel; - -use Carbon\Carbon; -use Carbon\CarbonImmutable; -use Carbon\CarbonInterval; -use Carbon\CarbonPeriod; -use Illuminate\Contracts\Events\Dispatcher as DispatcherContract; -use Illuminate\Events\Dispatcher; -use Illuminate\Events\EventDispatcher; -use Illuminate\Support\Carbon as IlluminateCarbon; -use Illuminate\Support\Facades\Date; -use Throwable; - -class ServiceProvider extends \Illuminate\Support\ServiceProvider -{ - /** @var callable|null */ - protected $appGetter = null; - - /** @var callable|null */ - protected $localeGetter = null; - - public function setAppGetter(?callable $appGetter): void - { - $this->appGetter = $appGetter; - } - - public function setLocaleGetter(?callable $localeGetter): void - { - $this->localeGetter = $localeGetter; - } - - public function boot() - { - $this->updateLocale(); - - if (!$this->app->bound('events')) { - return; - } - - $service = $this; - $events = $this->app['events']; - - if ($this->isEventDispatcher($events)) { - $events->listen(class_exists('Illuminate\Foundation\Events\LocaleUpdated') ? 'Illuminate\Foundation\Events\LocaleUpdated' : 'locale.changed', function () use ($service) { - $service->updateLocale(); - }); - } - } - - public function updateLocale() - { - $locale = $this->getLocale(); - - if ($locale === null) { - return; - } - - Carbon::setLocale($locale); - CarbonImmutable::setLocale($locale); - CarbonPeriod::setLocale($locale); - CarbonInterval::setLocale($locale); - - if (class_exists(IlluminateCarbon::class)) { - IlluminateCarbon::setLocale($locale); - } - - if (class_exists(Date::class)) { - try { - $root = Date::getFacadeRoot(); - $root->setLocale($locale); - } catch (Throwable $e) { - // Non Carbon class in use in Date facade - } - } - } - - public function register() - { - // Needed for Laravel < 5.3 compatibility - } - - protected function getLocale() - { - if ($this->localeGetter) { - return ($this->localeGetter)(); - } - - $app = $this->getApp(); - $app = $app && method_exists($app, 'getLocale') - ? $app - : $this->getGlobalApp('translator'); - - return $app ? $app->getLocale() : null; - } - - protected function getApp() - { - if ($this->appGetter) { - return ($this->appGetter)(); - } - - return $this->app ?? $this->getGlobalApp(); - } - - protected function getGlobalApp(...$args) - { - return \function_exists('app') ? \app(...$args) : null; - } - - protected function isEventDispatcher($instance) - { - return $instance instanceof EventDispatcher - || $instance instanceof Dispatcher - || $instance instanceof DispatcherContract; - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/List/languages.php b/vendor/nesbot/carbon/src/Carbon/List/languages.php deleted file mode 100644 index 5b5d9a1e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/List/languages.php +++ /dev/null @@ -1,1239 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return [ - /* - * ISO 639-2 - */ - 'ab' => [ - 'isoName' => 'Abkhazian', - 'nativeName' => 'аҧсуа бызшәа, аҧсшәа', - ], - 'aa' => [ - 'isoName' => 'Afar', - 'nativeName' => 'Afaraf', - ], - 'af' => [ - 'isoName' => 'Afrikaans', - 'nativeName' => 'Afrikaans', - ], - 'ak' => [ - 'isoName' => 'Akan', - 'nativeName' => 'Akan', - ], - 'sq' => [ - 'isoName' => 'Albanian', - 'nativeName' => 'Shqip', - ], - 'am' => [ - 'isoName' => 'Amharic', - 'nativeName' => 'አማርኛ', - ], - 'ar' => [ - 'isoName' => 'Arabic', - 'nativeName' => 'العربية', - ], - 'an' => [ - 'isoName' => 'Aragonese', - 'nativeName' => 'aragonés', - ], - 'hy' => [ - 'isoName' => 'Armenian', - 'nativeName' => 'Հայերեն', - ], - 'as' => [ - 'isoName' => 'Assamese', - 'nativeName' => 'অসমীয়া', - ], - 'av' => [ - 'isoName' => 'Avaric', - 'nativeName' => 'авар мацӀ, магӀарул мацӀ', - ], - 'ae' => [ - 'isoName' => 'Avestan', - 'nativeName' => 'avesta', - ], - 'ay' => [ - 'isoName' => 'Aymara', - 'nativeName' => 'aymar aru', - ], - 'az' => [ - 'isoName' => 'Azerbaijani', - 'nativeName' => 'azərbaycan dili', - ], - 'bm' => [ - 'isoName' => 'Bambara', - 'nativeName' => 'bamanankan', - ], - 'ba' => [ - 'isoName' => 'Bashkir', - 'nativeName' => 'башҡорт теле', - ], - 'eu' => [ - 'isoName' => 'Basque', - 'nativeName' => 'euskara, euskera', - ], - 'be' => [ - 'isoName' => 'Belarusian', - 'nativeName' => 'беларуская мова', - ], - 'bn' => [ - 'isoName' => 'Bengali', - 'nativeName' => 'বাংলা', - ], - 'bh' => [ - 'isoName' => 'Bihari languages', - 'nativeName' => 'भोजपुरी', - ], - 'bi' => [ - 'isoName' => 'Bislama', - 'nativeName' => 'Bislama', - ], - 'bs' => [ - 'isoName' => 'Bosnian', - 'nativeName' => 'bosanski jezik', - ], - 'br' => [ - 'isoName' => 'Breton', - 'nativeName' => 'brezhoneg', - ], - 'bg' => [ - 'isoName' => 'Bulgarian', - 'nativeName' => 'български език', - ], - 'my' => [ - 'isoName' => 'Burmese', - 'nativeName' => 'ဗမာစာ', - ], - 'ca' => [ - 'isoName' => 'Catalan, Valencian', - 'nativeName' => 'català, valencià', - ], - 'ch' => [ - 'isoName' => 'Chamorro', - 'nativeName' => 'Chamoru', - ], - 'ce' => [ - 'isoName' => 'Chechen', - 'nativeName' => 'нохчийн мотт', - ], - 'ny' => [ - 'isoName' => 'Chichewa, Chewa, Nyanja', - 'nativeName' => 'chiCheŵa, chinyanja', - ], - 'zh' => [ - 'isoName' => 'Chinese', - 'nativeName' => '中文 (Zhōngwén), 汉语, 漢語', - ], - 'cv' => [ - 'isoName' => 'Chuvash', - 'nativeName' => 'чӑваш чӗлхи', - ], - 'kw' => [ - 'isoName' => 'Cornish', - 'nativeName' => 'Kernewek', - ], - 'co' => [ - 'isoName' => 'Corsican', - 'nativeName' => 'corsu, lingua corsa', - ], - 'cr' => [ - 'isoName' => 'Cree', - 'nativeName' => 'ᓀᐦᐃᔭᐍᐏᐣ', - ], - 'hr' => [ - 'isoName' => 'Croatian', - 'nativeName' => 'hrvatski jezik', - ], - 'cs' => [ - 'isoName' => 'Czech', - 'nativeName' => 'čeština, český jazyk', - ], - 'da' => [ - 'isoName' => 'Danish', - 'nativeName' => 'dansk', - ], - 'dv' => [ - 'isoName' => 'Divehi, Dhivehi, Maldivian', - 'nativeName' => 'ދިވެހި', - ], - 'nl' => [ - 'isoName' => 'Dutch, Flemish', - 'nativeName' => 'Nederlands, Vlaams', - ], - 'dz' => [ - 'isoName' => 'Dzongkha', - 'nativeName' => 'རྫོང་ཁ', - ], - 'en' => [ - 'isoName' => 'English', - 'nativeName' => 'English', - ], - 'eo' => [ - 'isoName' => 'Esperanto', - 'nativeName' => 'Esperanto', - ], - 'et' => [ - 'isoName' => 'Estonian', - 'nativeName' => 'eesti, eesti keel', - ], - 'ee' => [ - 'isoName' => 'Ewe', - 'nativeName' => 'Eʋegbe', - ], - 'fo' => [ - 'isoName' => 'Faroese', - 'nativeName' => 'føroyskt', - ], - 'fj' => [ - 'isoName' => 'Fijian', - 'nativeName' => 'vosa Vakaviti', - ], - 'fi' => [ - 'isoName' => 'Finnish', - 'nativeName' => 'suomi, suomen kieli', - ], - 'fr' => [ - 'isoName' => 'French', - 'nativeName' => 'français', - ], - 'ff' => [ - 'isoName' => 'Fulah', - 'nativeName' => 'Fulfulde, Pulaar, Pular', - ], - 'gl' => [ - 'isoName' => 'Galician', - 'nativeName' => 'Galego', - ], - 'ka' => [ - 'isoName' => 'Georgian', - 'nativeName' => 'ქართული', - ], - 'de' => [ - 'isoName' => 'German', - 'nativeName' => 'Deutsch', - ], - 'el' => [ - 'isoName' => 'Greek (modern)', - 'nativeName' => 'ελληνικά', - ], - 'gn' => [ - 'isoName' => 'Guaraní', - 'nativeName' => 'Avañe\'ẽ', - ], - 'gu' => [ - 'isoName' => 'Gujarati', - 'nativeName' => 'ગુજરાતી', - ], - 'ht' => [ - 'isoName' => 'Haitian, Haitian Creole', - 'nativeName' => 'Kreyòl ayisyen', - ], - 'ha' => [ - 'isoName' => 'Hausa', - 'nativeName' => '(Hausa) هَوُسَ', - ], - 'he' => [ - 'isoName' => 'Hebrew (modern)', - 'nativeName' => 'עברית', - ], - 'hz' => [ - 'isoName' => 'Herero', - 'nativeName' => 'Otjiherero', - ], - 'hi' => [ - 'isoName' => 'Hindi', - 'nativeName' => 'हिन्दी, हिंदी', - ], - 'ho' => [ - 'isoName' => 'Hiri Motu', - 'nativeName' => 'Hiri Motu', - ], - 'hu' => [ - 'isoName' => 'Hungarian', - 'nativeName' => 'magyar', - ], - 'ia' => [ - 'isoName' => 'Interlingua', - 'nativeName' => 'Interlingua', - ], - 'id' => [ - 'isoName' => 'Indonesian', - 'nativeName' => 'Bahasa Indonesia', - ], - 'ie' => [ - 'isoName' => 'Interlingue', - 'nativeName' => 'Originally called Occidental; then Interlingue after WWII', - ], - 'ga' => [ - 'isoName' => 'Irish', - 'nativeName' => 'Gaeilge', - ], - 'ig' => [ - 'isoName' => 'Igbo', - 'nativeName' => 'Asụsụ Igbo', - ], - 'ik' => [ - 'isoName' => 'Inupiaq', - 'nativeName' => 'Iñupiaq, Iñupiatun', - ], - 'io' => [ - 'isoName' => 'Ido', - 'nativeName' => 'Ido', - ], - 'is' => [ - 'isoName' => 'Icelandic', - 'nativeName' => 'Íslenska', - ], - 'it' => [ - 'isoName' => 'Italian', - 'nativeName' => 'Italiano', - ], - 'iu' => [ - 'isoName' => 'Inuktitut', - 'nativeName' => 'ᐃᓄᒃᑎᑐᑦ', - ], - 'ja' => [ - 'isoName' => 'Japanese', - 'nativeName' => '日本語 (にほんご)', - ], - 'jv' => [ - 'isoName' => 'Javanese', - 'nativeName' => 'ꦧꦱꦗꦮ, Basa Jawa', - ], - 'kl' => [ - 'isoName' => 'Kalaallisut, Greenlandic', - 'nativeName' => 'kalaallisut, kalaallit oqaasii', - ], - 'kn' => [ - 'isoName' => 'Kannada', - 'nativeName' => 'ಕನ್ನಡ', - ], - 'kr' => [ - 'isoName' => 'Kanuri', - 'nativeName' => 'Kanuri', - ], - 'ks' => [ - 'isoName' => 'Kashmiri', - 'nativeName' => 'कश्मीरी, كشميري‎', - ], - 'kk' => [ - 'isoName' => 'Kazakh', - 'nativeName' => 'қазақ тілі', - ], - 'km' => [ - 'isoName' => 'Central Khmer', - 'nativeName' => 'ខ្មែរ, ខេមរភាសា, ភាសាខ្មែរ', - ], - 'ki' => [ - 'isoName' => 'Kikuyu, Gikuyu', - 'nativeName' => 'Gĩkũyũ', - ], - 'rw' => [ - 'isoName' => 'Kinyarwanda', - 'nativeName' => 'Ikinyarwanda', - ], - 'ky' => [ - 'isoName' => 'Kirghiz, Kyrgyz', - 'nativeName' => 'Кыргызча, Кыргыз тили', - ], - 'kv' => [ - 'isoName' => 'Komi', - 'nativeName' => 'коми кыв', - ], - 'kg' => [ - 'isoName' => 'Kongo', - 'nativeName' => 'Kikongo', - ], - 'ko' => [ - 'isoName' => 'Korean', - 'nativeName' => '한국어', - ], - 'ku' => [ - 'isoName' => 'Kurdish', - 'nativeName' => 'Kurdî, کوردی‎', - ], - 'kj' => [ - 'isoName' => 'Kuanyama, Kwanyama', - 'nativeName' => 'Kuanyama', - ], - 'la' => [ - 'isoName' => 'Latin', - 'nativeName' => 'latine, lingua latina', - ], - 'lb' => [ - 'isoName' => 'Luxembourgish, Letzeburgesch', - 'nativeName' => 'Lëtzebuergesch', - ], - 'lg' => [ - 'isoName' => 'Ganda', - 'nativeName' => 'Luganda', - ], - 'li' => [ - 'isoName' => 'Limburgan, Limburger, Limburgish', - 'nativeName' => 'Limburgs', - ], - 'ln' => [ - 'isoName' => 'Lingala', - 'nativeName' => 'Lingála', - ], - 'lo' => [ - 'isoName' => 'Lao', - 'nativeName' => 'ພາສາລາວ', - ], - 'lt' => [ - 'isoName' => 'Lithuanian', - 'nativeName' => 'lietuvių kalba', - ], - 'lu' => [ - 'isoName' => 'Luba-Katanga', - 'nativeName' => 'Kiluba', - ], - 'lv' => [ - 'isoName' => 'Latvian', - 'nativeName' => 'latviešu valoda', - ], - 'gv' => [ - 'isoName' => 'Manx', - 'nativeName' => 'Gaelg, Gailck', - ], - 'mk' => [ - 'isoName' => 'Macedonian', - 'nativeName' => 'македонски јазик', - ], - 'mg' => [ - 'isoName' => 'Malagasy', - 'nativeName' => 'fiteny malagasy', - ], - 'ms' => [ - 'isoName' => 'Malay', - 'nativeName' => 'Bahasa Melayu, بهاس ملايو‎', - ], - 'ml' => [ - 'isoName' => 'Malayalam', - 'nativeName' => 'മലയാളം', - ], - 'mt' => [ - 'isoName' => 'Maltese', - 'nativeName' => 'Malti', - ], - 'mi' => [ - 'isoName' => 'Maori', - 'nativeName' => 'te reo Māori', - ], - 'mr' => [ - 'isoName' => 'Marathi', - 'nativeName' => 'मराठी', - ], - 'mh' => [ - 'isoName' => 'Marshallese', - 'nativeName' => 'Kajin M̧ajeļ', - ], - 'mn' => [ - 'isoName' => 'Mongolian', - 'nativeName' => 'Монгол хэл', - ], - 'na' => [ - 'isoName' => 'Nauru', - 'nativeName' => 'Dorerin Naoero', - ], - 'nv' => [ - 'isoName' => 'Navajo, Navaho', - 'nativeName' => 'Diné bizaad', - ], - 'nd' => [ - 'isoName' => 'North Ndebele', - 'nativeName' => 'isiNdebele', - ], - 'ne' => [ - 'isoName' => 'Nepali', - 'nativeName' => 'नेपाली', - ], - 'ng' => [ - 'isoName' => 'Ndonga', - 'nativeName' => 'Owambo', - ], - 'nb' => [ - 'isoName' => 'Norwegian Bokmål', - 'nativeName' => 'Norsk Bokmål', - ], - 'nn' => [ - 'isoName' => 'Norwegian Nynorsk', - 'nativeName' => 'Norsk Nynorsk', - ], - 'no' => [ - 'isoName' => 'Norwegian', - 'nativeName' => 'Norsk', - ], - 'ii' => [ - 'isoName' => 'Sichuan Yi, Nuosu', - 'nativeName' => 'ꆈꌠ꒿ Nuosuhxop', - ], - 'nr' => [ - 'isoName' => 'South Ndebele', - 'nativeName' => 'isiNdebele', - ], - 'oc' => [ - 'isoName' => 'Occitan', - 'nativeName' => 'occitan, lenga d\'òc', - ], - 'oj' => [ - 'isoName' => 'Ojibwa', - 'nativeName' => 'ᐊᓂᔑᓈᐯᒧᐎᓐ', - ], - 'cu' => [ - 'isoName' => 'Church Slavic, Church Slavonic, Old Church Slavonic, Old Slavonic, Old Bulgarian', - 'nativeName' => 'ѩзыкъ словѣньскъ', - ], - 'om' => [ - 'isoName' => 'Oromo', - 'nativeName' => 'Afaan Oromoo', - ], - 'or' => [ - 'isoName' => 'Oriya', - 'nativeName' => 'ଓଡ଼ିଆ', - ], - 'os' => [ - 'isoName' => 'Ossetian, Ossetic', - 'nativeName' => 'ирон æвзаг', - ], - 'pa' => [ - 'isoName' => 'Panjabi, Punjabi', - 'nativeName' => 'ਪੰਜਾਬੀ', - ], - 'pi' => [ - 'isoName' => 'Pali', - 'nativeName' => 'पाऴि', - ], - 'fa' => [ - 'isoName' => 'Persian', - 'nativeName' => 'فارسی', - ], - 'pl' => [ - 'isoName' => 'Polish', - 'nativeName' => 'język polski, polszczyzna', - ], - 'ps' => [ - 'isoName' => 'Pashto, Pushto', - 'nativeName' => 'پښتو', - ], - 'pt' => [ - 'isoName' => 'Portuguese', - 'nativeName' => 'Português', - ], - 'qu' => [ - 'isoName' => 'Quechua', - 'nativeName' => 'Runa Simi, Kichwa', - ], - 'rm' => [ - 'isoName' => 'Romansh', - 'nativeName' => 'Rumantsch Grischun', - ], - 'rn' => [ - 'isoName' => 'Rundi', - 'nativeName' => 'Ikirundi', - ], - 'ro' => [ - 'isoName' => 'Romanian, Moldavian, Moldovan', - 'nativeName' => 'Română', - ], - 'ru' => [ - 'isoName' => 'Russian', - 'nativeName' => 'русский', - ], - 'sa' => [ - 'isoName' => 'Sanskrit', - 'nativeName' => 'संस्कृतम्', - ], - 'sc' => [ - 'isoName' => 'Sardinian', - 'nativeName' => 'sardu', - ], - 'sd' => [ - 'isoName' => 'Sindhi', - 'nativeName' => 'सिन्धी, سنڌي، سندھی‎', - ], - 'se' => [ - 'isoName' => 'Northern Sami', - 'nativeName' => 'Davvisámegiella', - ], - 'sm' => [ - 'isoName' => 'Samoan', - 'nativeName' => 'gagana fa\'a Samoa', - ], - 'sg' => [ - 'isoName' => 'Sango', - 'nativeName' => 'yângâ tî sängö', - ], - 'sr' => [ - 'isoName' => 'Serbian', - 'nativeName' => 'српски језик', - ], - 'gd' => [ - 'isoName' => 'Gaelic, Scottish Gaelic', - 'nativeName' => 'Gàidhlig', - ], - 'sn' => [ - 'isoName' => 'Shona', - 'nativeName' => 'chiShona', - ], - 'si' => [ - 'isoName' => 'Sinhala, Sinhalese', - 'nativeName' => 'සිංහල', - ], - 'sk' => [ - 'isoName' => 'Slovak', - 'nativeName' => 'Slovenčina, Slovenský Jazyk', - ], - 'sl' => [ - 'isoName' => 'Slovene', - 'nativeName' => 'Slovenski Jezik, Slovenščina', - ], - 'so' => [ - 'isoName' => 'Somali', - 'nativeName' => 'Soomaaliga, af Soomaali', - ], - 'st' => [ - 'isoName' => 'Southern Sotho', - 'nativeName' => 'Sesotho', - ], - 'es' => [ - 'isoName' => 'Spanish, Castilian', - 'nativeName' => 'Español', - ], - 'su' => [ - 'isoName' => 'Sundanese', - 'nativeName' => 'Basa Sunda', - ], - 'sw' => [ - 'isoName' => 'Swahili', - 'nativeName' => 'Kiswahili', - ], - 'ss' => [ - 'isoName' => 'Swati', - 'nativeName' => 'SiSwati', - ], - 'sv' => [ - 'isoName' => 'Swedish', - 'nativeName' => 'Svenska', - ], - 'ta' => [ - 'isoName' => 'Tamil', - 'nativeName' => 'தமிழ்', - ], - 'te' => [ - 'isoName' => 'Telugu', - 'nativeName' => 'తెలుగు', - ], - 'tg' => [ - 'isoName' => 'Tajik', - 'nativeName' => 'тоҷикӣ, toçikī, تاجیکی‎', - ], - 'th' => [ - 'isoName' => 'Thai', - 'nativeName' => 'ไทย', - ], - 'ti' => [ - 'isoName' => 'Tigrinya', - 'nativeName' => 'ትግርኛ', - ], - 'bo' => [ - 'isoName' => 'Tibetan', - 'nativeName' => 'བོད་ཡིག', - ], - 'tk' => [ - 'isoName' => 'Turkmen', - 'nativeName' => 'Türkmen, Түркмен', - ], - 'tl' => [ - 'isoName' => 'Tagalog', - 'nativeName' => 'Wikang Tagalog', - ], - 'tn' => [ - 'isoName' => 'Tswana', - 'nativeName' => 'Setswana', - ], - 'to' => [ - 'isoName' => 'Tongan (Tonga Islands)', - 'nativeName' => 'Faka Tonga', - ], - 'tr' => [ - 'isoName' => 'Turkish', - 'nativeName' => 'Türkçe', - ], - 'ts' => [ - 'isoName' => 'Tsonga', - 'nativeName' => 'Xitsonga', - ], - 'tt' => [ - 'isoName' => 'Tatar', - 'nativeName' => 'татар теле, tatar tele', - ], - 'tw' => [ - 'isoName' => 'Twi', - 'nativeName' => 'Twi', - ], - 'ty' => [ - 'isoName' => 'Tahitian', - 'nativeName' => 'Reo Tahiti', - ], - 'ug' => [ - 'isoName' => 'Uighur, Uyghur', - 'nativeName' => 'Uyƣurqə, ‫ئۇيغۇرچ', - ], - 'uk' => [ - 'isoName' => 'Ukrainian', - 'nativeName' => 'Українська', - ], - 'ur' => [ - 'isoName' => 'Urdu', - 'nativeName' => 'اردو', - ], - 'uz' => [ - 'isoName' => 'Uzbek', - 'nativeName' => 'Oʻzbek, Ўзбек, أۇزبېك‎', - ], - 've' => [ - 'isoName' => 'Venda', - 'nativeName' => 'Tshivenḓa', - ], - 'vi' => [ - 'isoName' => 'Vietnamese', - 'nativeName' => 'Tiếng Việt', - ], - 'vo' => [ - 'isoName' => 'Volapük', - 'nativeName' => 'Volapük', - ], - 'wa' => [ - 'isoName' => 'Walloon', - 'nativeName' => 'Walon', - ], - 'cy' => [ - 'isoName' => 'Welsh', - 'nativeName' => 'Cymraeg', - ], - 'wo' => [ - 'isoName' => 'Wolof', - 'nativeName' => 'Wollof', - ], - 'fy' => [ - 'isoName' => 'Western Frisian', - 'nativeName' => 'Frysk', - ], - 'xh' => [ - 'isoName' => 'Xhosa', - 'nativeName' => 'isiXhosa', - ], - 'yi' => [ - 'isoName' => 'Yiddish', - 'nativeName' => 'ייִדיש', - ], - 'yo' => [ - 'isoName' => 'Yoruba', - 'nativeName' => 'Yorùbá', - ], - 'za' => [ - 'isoName' => 'Zhuang, Chuang', - 'nativeName' => 'Saɯ cueŋƅ, Saw cuengh', - ], - 'zu' => [ - 'isoName' => 'Zulu', - 'nativeName' => 'isiZulu', - ], - /* - * Add ISO 639-3 languages available in Carbon - */ - 'agq' => [ - 'isoName' => 'Aghem', - 'nativeName' => 'Aghem', - ], - 'agr' => [ - 'isoName' => 'Aguaruna', - 'nativeName' => 'Aguaruna', - ], - 'anp' => [ - 'isoName' => 'Angika', - 'nativeName' => 'Angika', - ], - 'asa' => [ - 'isoName' => 'Asu', - 'nativeName' => 'Asu', - ], - 'ast' => [ - 'isoName' => 'Asturian', - 'nativeName' => 'Asturian', - ], - 'ayc' => [ - 'isoName' => 'Southern Aymara', - 'nativeName' => 'Southern Aymara', - ], - 'bas' => [ - 'isoName' => 'Basaa', - 'nativeName' => 'Basaa', - ], - 'bem' => [ - 'isoName' => 'Bemba', - 'nativeName' => 'Bemba', - ], - 'bez' => [ - 'isoName' => 'Bena', - 'nativeName' => 'Bena', - ], - 'bhb' => [ - 'isoName' => 'Bhili', - 'nativeName' => 'Bhili', - ], - 'bho' => [ - 'isoName' => 'Bhojpuri', - 'nativeName' => 'Bhojpuri', - ], - 'brx' => [ - 'isoName' => 'Bodo', - 'nativeName' => 'Bodo', - ], - 'byn' => [ - 'isoName' => 'Bilin', - 'nativeName' => 'Bilin', - ], - 'ccp' => [ - 'isoName' => 'Chakma', - 'nativeName' => 'Chakma', - ], - 'cgg' => [ - 'isoName' => 'Chiga', - 'nativeName' => 'Chiga', - ], - 'chr' => [ - 'isoName' => 'Cherokee', - 'nativeName' => 'Cherokee', - ], - 'cmn' => [ - 'isoName' => 'Chinese', - 'nativeName' => 'Chinese', - ], - 'crh' => [ - 'isoName' => 'Crimean Turkish', - 'nativeName' => 'Crimean Turkish', - ], - 'csb' => [ - 'isoName' => 'Kashubian', - 'nativeName' => 'Kashubian', - ], - 'dav' => [ - 'isoName' => 'Taita', - 'nativeName' => 'Taita', - ], - 'dje' => [ - 'isoName' => 'Zarma', - 'nativeName' => 'Zarma', - ], - 'doi' => [ - 'isoName' => 'Dogri (macrolanguage)', - 'nativeName' => 'Dogri (macrolanguage)', - ], - 'dsb' => [ - 'isoName' => 'Lower Sorbian', - 'nativeName' => 'Lower Sorbian', - ], - 'dua' => [ - 'isoName' => 'Duala', - 'nativeName' => 'Duala', - ], - 'dyo' => [ - 'isoName' => 'Jola-Fonyi', - 'nativeName' => 'Jola-Fonyi', - ], - 'ebu' => [ - 'isoName' => 'Embu', - 'nativeName' => 'Embu', - ], - 'ewo' => [ - 'isoName' => 'Ewondo', - 'nativeName' => 'Ewondo', - ], - 'fil' => [ - 'isoName' => 'Filipino', - 'nativeName' => 'Filipino', - ], - 'fur' => [ - 'isoName' => 'Friulian', - 'nativeName' => 'Friulian', - ], - 'gez' => [ - 'isoName' => 'Geez', - 'nativeName' => 'Geez', - ], - 'gom' => [ - 'isoName' => 'Konkani, Goan', - 'nativeName' => 'ಕೊಂಕಣಿ', - ], - 'gsw' => [ - 'isoName' => 'Swiss German', - 'nativeName' => 'Swiss German', - ], - 'guz' => [ - 'isoName' => 'Gusii', - 'nativeName' => 'Gusii', - ], - 'hak' => [ - 'isoName' => 'Hakka Chinese', - 'nativeName' => 'Hakka Chinese', - ], - 'haw' => [ - 'isoName' => 'Hawaiian', - 'nativeName' => 'Hawaiian', - ], - 'hif' => [ - 'isoName' => 'Fiji Hindi', - 'nativeName' => 'Fiji Hindi', - ], - 'hne' => [ - 'isoName' => 'Chhattisgarhi', - 'nativeName' => 'Chhattisgarhi', - ], - 'hsb' => [ - 'isoName' => 'Upper Sorbian', - 'nativeName' => 'Upper Sorbian', - ], - 'jgo' => [ - 'isoName' => 'Ngomba', - 'nativeName' => 'Ngomba', - ], - 'jmc' => [ - 'isoName' => 'Machame', - 'nativeName' => 'Machame', - ], - 'kab' => [ - 'isoName' => 'Kabyle', - 'nativeName' => 'Kabyle', - ], - 'kam' => [ - 'isoName' => 'Kamba', - 'nativeName' => 'Kamba', - ], - 'kde' => [ - 'isoName' => 'Makonde', - 'nativeName' => 'Makonde', - ], - 'kea' => [ - 'isoName' => 'Kabuverdianu', - 'nativeName' => 'Kabuverdianu', - ], - 'khq' => [ - 'isoName' => 'Koyra Chiini', - 'nativeName' => 'Koyra Chiini', - ], - 'kkj' => [ - 'isoName' => 'Kako', - 'nativeName' => 'Kako', - ], - 'kln' => [ - 'isoName' => 'Kalenjin', - 'nativeName' => 'Kalenjin', - ], - 'kok' => [ - 'isoName' => 'Konkani', - 'nativeName' => 'Konkani', - ], - 'ksb' => [ - 'isoName' => 'Shambala', - 'nativeName' => 'Shambala', - ], - 'ksf' => [ - 'isoName' => 'Bafia', - 'nativeName' => 'Bafia', - ], - 'ksh' => [ - 'isoName' => 'Colognian', - 'nativeName' => 'Colognian', - ], - 'lag' => [ - 'isoName' => 'Langi', - 'nativeName' => 'Langi', - ], - 'lij' => [ - 'isoName' => 'Ligurian', - 'nativeName' => 'Ligurian', - ], - 'lkt' => [ - 'isoName' => 'Lakota', - 'nativeName' => 'Lakota', - ], - 'lrc' => [ - 'isoName' => 'Northern Luri', - 'nativeName' => 'Northern Luri', - ], - 'luo' => [ - 'isoName' => 'Luo', - 'nativeName' => 'Luo', - ], - 'luy' => [ - 'isoName' => 'Luyia', - 'nativeName' => 'Luyia', - ], - 'lzh' => [ - 'isoName' => 'Literary Chinese', - 'nativeName' => 'Literary Chinese', - ], - 'mag' => [ - 'isoName' => 'Magahi', - 'nativeName' => 'Magahi', - ], - 'mai' => [ - 'isoName' => 'Maithili', - 'nativeName' => 'Maithili', - ], - 'mas' => [ - 'isoName' => 'Masai', - 'nativeName' => 'Masai', - ], - 'mer' => [ - 'isoName' => 'Meru', - 'nativeName' => 'Meru', - ], - 'mfe' => [ - 'isoName' => 'Morisyen', - 'nativeName' => 'Morisyen', - ], - 'mgh' => [ - 'isoName' => 'Makhuwa-Meetto', - 'nativeName' => 'Makhuwa-Meetto', - ], - 'mgo' => [ - 'isoName' => 'Metaʼ', - 'nativeName' => 'Metaʼ', - ], - 'mhr' => [ - 'isoName' => 'Eastern Mari', - 'nativeName' => 'Eastern Mari', - ], - 'miq' => [ - 'isoName' => 'Mískito', - 'nativeName' => 'Mískito', - ], - 'mjw' => [ - 'isoName' => 'Karbi', - 'nativeName' => 'Karbi', - ], - 'mni' => [ - 'isoName' => 'Manipuri', - 'nativeName' => 'Manipuri', - ], - 'mua' => [ - 'isoName' => 'Mundang', - 'nativeName' => 'Mundang', - ], - 'mzn' => [ - 'isoName' => 'Mazanderani', - 'nativeName' => 'Mazanderani', - ], - 'nan' => [ - 'isoName' => 'Min Nan Chinese', - 'nativeName' => 'Min Nan Chinese', - ], - 'naq' => [ - 'isoName' => 'Nama', - 'nativeName' => 'Nama', - ], - 'nds' => [ - 'isoName' => 'Low German', - 'nativeName' => 'Low German', - ], - 'nhn' => [ - 'isoName' => 'Central Nahuatl', - 'nativeName' => 'Central Nahuatl', - ], - 'niu' => [ - 'isoName' => 'Niuean', - 'nativeName' => 'Niuean', - ], - 'nmg' => [ - 'isoName' => 'Kwasio', - 'nativeName' => 'Kwasio', - ], - 'nnh' => [ - 'isoName' => 'Ngiemboon', - 'nativeName' => 'Ngiemboon', - ], - 'nso' => [ - 'isoName' => 'Northern Sotho', - 'nativeName' => 'Northern Sotho', - ], - 'nus' => [ - 'isoName' => 'Nuer', - 'nativeName' => 'Nuer', - ], - 'nyn' => [ - 'isoName' => 'Nyankole', - 'nativeName' => 'Nyankole', - ], - 'pap' => [ - 'isoName' => 'Papiamento', - 'nativeName' => 'Papiamento', - ], - 'prg' => [ - 'isoName' => 'Prussian', - 'nativeName' => 'Prussian', - ], - 'quz' => [ - 'isoName' => 'Cusco Quechua', - 'nativeName' => 'Cusco Quechua', - ], - 'raj' => [ - 'isoName' => 'Rajasthani', - 'nativeName' => 'Rajasthani', - ], - 'rof' => [ - 'isoName' => 'Rombo', - 'nativeName' => 'Rombo', - ], - 'rwk' => [ - 'isoName' => 'Rwa', - 'nativeName' => 'Rwa', - ], - 'sah' => [ - 'isoName' => 'Sakha', - 'nativeName' => 'Sakha', - ], - 'saq' => [ - 'isoName' => 'Samburu', - 'nativeName' => 'Samburu', - ], - 'sat' => [ - 'isoName' => 'Santali', - 'nativeName' => 'Santali', - ], - 'sbp' => [ - 'isoName' => 'Sangu', - 'nativeName' => 'Sangu', - ], - 'scr' => [ - 'isoName' => 'Serbo Croatian', - 'nativeName' => 'Serbo Croatian', - ], - 'seh' => [ - 'isoName' => 'Sena', - 'nativeName' => 'Sena', - ], - 'ses' => [ - 'isoName' => 'Koyraboro Senni', - 'nativeName' => 'Koyraboro Senni', - ], - 'sgs' => [ - 'isoName' => 'Samogitian', - 'nativeName' => 'Samogitian', - ], - 'shi' => [ - 'isoName' => 'Tachelhit', - 'nativeName' => 'Tachelhit', - ], - 'shn' => [ - 'isoName' => 'Shan', - 'nativeName' => 'Shan', - ], - 'shs' => [ - 'isoName' => 'Shuswap', - 'nativeName' => 'Shuswap', - ], - 'sid' => [ - 'isoName' => 'Sidamo', - 'nativeName' => 'Sidamo', - ], - 'smn' => [ - 'isoName' => 'Inari Sami', - 'nativeName' => 'Inari Sami', - ], - 'szl' => [ - 'isoName' => 'Silesian', - 'nativeName' => 'Silesian', - ], - 'tcy' => [ - 'isoName' => 'Tulu', - 'nativeName' => 'Tulu', - ], - 'teo' => [ - 'isoName' => 'Teso', - 'nativeName' => 'Teso', - ], - 'tet' => [ - 'isoName' => 'Tetum', - 'nativeName' => 'Tetum', - ], - 'the' => [ - 'isoName' => 'Chitwania Tharu', - 'nativeName' => 'Chitwania Tharu', - ], - 'tig' => [ - 'isoName' => 'Tigre', - 'nativeName' => 'Tigre', - ], - 'tlh' => [ - 'isoName' => 'Klingon', - 'nativeName' => 'tlhIngan Hol', - ], - 'tpi' => [ - 'isoName' => 'Tok Pisin', - 'nativeName' => 'Tok Pisin', - ], - 'twq' => [ - 'isoName' => 'Tasawaq', - 'nativeName' => 'Tasawaq', - ], - 'tzl' => [ - 'isoName' => 'Talossan', - 'nativeName' => 'Talossan', - ], - 'tzm' => [ - 'isoName' => 'Tamazight, Central Atlas', - 'nativeName' => 'ⵜⵎⴰⵣⵉⵖⵜ', - ], - 'unm' => [ - 'isoName' => 'Unami', - 'nativeName' => 'Unami', - ], - 'vai' => [ - 'isoName' => 'Vai', - 'nativeName' => 'Vai', - ], - 'vun' => [ - 'isoName' => 'Vunjo', - 'nativeName' => 'Vunjo', - ], - 'wae' => [ - 'isoName' => 'Walser', - 'nativeName' => 'Walser', - ], - 'wal' => [ - 'isoName' => 'Wolaytta', - 'nativeName' => 'Wolaytta', - ], - 'xog' => [ - 'isoName' => 'Soga', - 'nativeName' => 'Soga', - ], - 'yav' => [ - 'isoName' => 'Yangben', - 'nativeName' => 'Yangben', - ], - 'yue' => [ - 'isoName' => 'Cantonese', - 'nativeName' => 'Cantonese', - ], - 'yuw' => [ - 'isoName' => 'Yau (Morobe Province)', - 'nativeName' => 'Yau (Morobe Province)', - ], - 'zgh' => [ - 'isoName' => 'Standard Moroccan Tamazight', - 'nativeName' => 'Standard Moroccan Tamazight', - ], -]; diff --git a/vendor/nesbot/carbon/src/Carbon/List/regions.php b/vendor/nesbot/carbon/src/Carbon/List/regions.php deleted file mode 100644 index 8ab8a9e3..00000000 --- a/vendor/nesbot/carbon/src/Carbon/List/regions.php +++ /dev/null @@ -1,265 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * ISO 3166-2 - */ -return [ - 'AD' => 'Andorra', - 'AE' => 'United Arab Emirates', - 'AF' => 'Afghanistan', - 'AG' => 'Antigua and Barbuda', - 'AI' => 'Anguilla', - 'AL' => 'Albania', - 'AM' => 'Armenia', - 'AO' => 'Angola', - 'AQ' => 'Antarctica', - 'AR' => 'Argentina', - 'AS' => 'American Samoa', - 'AT' => 'Austria', - 'AU' => 'Australia', - 'AW' => 'Aruba', - 'AX' => 'Åland Islands', - 'AZ' => 'Azerbaijan', - 'BA' => 'Bosnia and Herzegovina', - 'BB' => 'Barbados', - 'BD' => 'Bangladesh', - 'BE' => 'Belgium', - 'BF' => 'Burkina Faso', - 'BG' => 'Bulgaria', - 'BH' => 'Bahrain', - 'BI' => 'Burundi', - 'BJ' => 'Benin', - 'BL' => 'Saint Barthélemy', - 'BM' => 'Bermuda', - 'BN' => 'Brunei Darussalam', - 'BO' => 'Bolivia (Plurinational State of)', - 'BQ' => 'Bonaire, Sint Eustatius and Saba', - 'BR' => 'Brazil', - 'BS' => 'Bahamas', - 'BT' => 'Bhutan', - 'BV' => 'Bouvet Island', - 'BW' => 'Botswana', - 'BY' => 'Belarus', - 'BZ' => 'Belize', - 'CA' => 'Canada', - 'CC' => 'Cocos (Keeling) Islands', - 'CD' => 'Congo, Democratic Republic of the', - 'CF' => 'Central African Republic', - 'CG' => 'Congo', - 'CH' => 'Switzerland', - 'CI' => 'Côte d\'Ivoire', - 'CK' => 'Cook Islands', - 'CL' => 'Chile', - 'CM' => 'Cameroon', - 'CN' => 'China', - 'CO' => 'Colombia', - 'CR' => 'Costa Rica', - 'CU' => 'Cuba', - 'CV' => 'Cabo Verde', - 'CW' => 'Curaçao', - 'CX' => 'Christmas Island', - 'CY' => 'Cyprus', - 'CZ' => 'Czechia', - 'DE' => 'Germany', - 'DJ' => 'Djibouti', - 'DK' => 'Denmark', - 'DM' => 'Dominica', - 'DO' => 'Dominican Republic', - 'DZ' => 'Algeria', - 'EC' => 'Ecuador', - 'EE' => 'Estonia', - 'EG' => 'Egypt', - 'EH' => 'Western Sahara', - 'ER' => 'Eritrea', - 'ES' => 'Spain', - 'ET' => 'Ethiopia', - 'FI' => 'Finland', - 'FJ' => 'Fiji', - 'FK' => 'Falkland Islands (Malvinas)', - 'FM' => 'Micronesia (Federated States of)', - 'FO' => 'Faroe Islands', - 'FR' => 'France', - 'GA' => 'Gabon', - 'GB' => 'United Kingdom of Great Britain and Northern Ireland', - 'GD' => 'Grenada', - 'GE' => 'Georgia', - 'GF' => 'French Guiana', - 'GG' => 'Guernsey', - 'GH' => 'Ghana', - 'GI' => 'Gibraltar', - 'GL' => 'Greenland', - 'GM' => 'Gambia', - 'GN' => 'Guinea', - 'GP' => 'Guadeloupe', - 'GQ' => 'Equatorial Guinea', - 'GR' => 'Greece', - 'GS' => 'South Georgia and the South Sandwich Islands', - 'GT' => 'Guatemala', - 'GU' => 'Guam', - 'GW' => 'Guinea-Bissau', - 'GY' => 'Guyana', - 'HK' => 'Hong Kong', - 'HM' => 'Heard Island and McDonald Islands', - 'HN' => 'Honduras', - 'HR' => 'Croatia', - 'HT' => 'Haiti', - 'HU' => 'Hungary', - 'ID' => 'Indonesia', - 'IE' => 'Ireland', - 'IL' => 'Israel', - 'IM' => 'Isle of Man', - 'IN' => 'India', - 'IO' => 'British Indian Ocean Territory', - 'IQ' => 'Iraq', - 'IR' => 'Iran (Islamic Republic of)', - 'IS' => 'Iceland', - 'IT' => 'Italy', - 'JE' => 'Jersey', - 'JM' => 'Jamaica', - 'JO' => 'Jordan', - 'JP' => 'Japan', - 'KE' => 'Kenya', - 'KG' => 'Kyrgyzstan', - 'KH' => 'Cambodia', - 'KI' => 'Kiribati', - 'KM' => 'Comoros', - 'KN' => 'Saint Kitts and Nevis', - 'KP' => 'Korea (Democratic People\'s Republic of)', - 'KR' => 'Korea, Republic of', - 'KW' => 'Kuwait', - 'KY' => 'Cayman Islands', - 'KZ' => 'Kazakhstan', - 'LA' => 'Lao People\'s Democratic Republic', - 'LB' => 'Lebanon', - 'LC' => 'Saint Lucia', - 'LI' => 'Liechtenstein', - 'LK' => 'Sri Lanka', - 'LR' => 'Liberia', - 'LS' => 'Lesotho', - 'LT' => 'Lithuania', - 'LU' => 'Luxembourg', - 'LV' => 'Latvia', - 'LY' => 'Libya', - 'MA' => 'Morocco', - 'MC' => 'Monaco', - 'MD' => 'Moldova, Republic of', - 'ME' => 'Montenegro', - 'MF' => 'Saint Martin (French part)', - 'MG' => 'Madagascar', - 'MH' => 'Marshall Islands', - 'MK' => 'Macedonia, the former Yugoslav Republic of', - 'ML' => 'Mali', - 'MM' => 'Myanmar', - 'MN' => 'Mongolia', - 'MO' => 'Macao', - 'MP' => 'Northern Mariana Islands', - 'MQ' => 'Martinique', - 'MR' => 'Mauritania', - 'MS' => 'Montserrat', - 'MT' => 'Malta', - 'MU' => 'Mauritius', - 'MV' => 'Maldives', - 'MW' => 'Malawi', - 'MX' => 'Mexico', - 'MY' => 'Malaysia', - 'MZ' => 'Mozambique', - 'NA' => 'Namibia', - 'NC' => 'New Caledonia', - 'NE' => 'Niger', - 'NF' => 'Norfolk Island', - 'NG' => 'Nigeria', - 'NI' => 'Nicaragua', - 'NL' => 'Netherlands', - 'NO' => 'Norway', - 'NP' => 'Nepal', - 'NR' => 'Nauru', - 'NU' => 'Niue', - 'NZ' => 'New Zealand', - 'OM' => 'Oman', - 'PA' => 'Panama', - 'PE' => 'Peru', - 'PF' => 'French Polynesia', - 'PG' => 'Papua New Guinea', - 'PH' => 'Philippines', - 'PK' => 'Pakistan', - 'PL' => 'Poland', - 'PM' => 'Saint Pierre and Miquelon', - 'PN' => 'Pitcairn', - 'PR' => 'Puerto Rico', - 'PS' => 'Palestine, State of', - 'PT' => 'Portugal', - 'PW' => 'Palau', - 'PY' => 'Paraguay', - 'QA' => 'Qatar', - 'RE' => 'Réunion', - 'RO' => 'Romania', - 'RS' => 'Serbia', - 'RU' => 'Russian Federation', - 'RW' => 'Rwanda', - 'SA' => 'Saudi Arabia', - 'SB' => 'Solomon Islands', - 'SC' => 'Seychelles', - 'SD' => 'Sudan', - 'SE' => 'Sweden', - 'SG' => 'Singapore', - 'SH' => 'Saint Helena, Ascension and Tristan da Cunha', - 'SI' => 'Slovenia', - 'SJ' => 'Svalbard and Jan Mayen', - 'SK' => 'Slovakia', - 'SL' => 'Sierra Leone', - 'SM' => 'San Marino', - 'SN' => 'Senegal', - 'SO' => 'Somalia', - 'SR' => 'Suriname', - 'SS' => 'South Sudan', - 'ST' => 'Sao Tome and Principe', - 'SV' => 'El Salvador', - 'SX' => 'Sint Maarten (Dutch part)', - 'SY' => 'Syrian Arab Republic', - 'SZ' => 'Eswatini', - 'TC' => 'Turks and Caicos Islands', - 'TD' => 'Chad', - 'TF' => 'French Southern Territories', - 'TG' => 'Togo', - 'TH' => 'Thailand', - 'TJ' => 'Tajikistan', - 'TK' => 'Tokelau', - 'TL' => 'Timor-Leste', - 'TM' => 'Turkmenistan', - 'TN' => 'Tunisia', - 'TO' => 'Tonga', - 'TR' => 'Turkey', - 'TT' => 'Trinidad and Tobago', - 'TV' => 'Tuvalu', - 'TW' => 'Taiwan, Province of China', - 'TZ' => 'Tanzania, United Republic of', - 'UA' => 'Ukraine', - 'UG' => 'Uganda', - 'UM' => 'United States Minor Outlying Islands', - 'US' => 'United States of America', - 'UY' => 'Uruguay', - 'UZ' => 'Uzbekistan', - 'VA' => 'Holy See', - 'VC' => 'Saint Vincent and the Grenadines', - 'VE' => 'Venezuela (Bolivarian Republic of)', - 'VG' => 'Virgin Islands (British)', - 'VI' => 'Virgin Islands (U.S.)', - 'VN' => 'Viet Nam', - 'VU' => 'Vanuatu', - 'WF' => 'Wallis and Futuna', - 'WS' => 'Samoa', - 'YE' => 'Yemen', - 'YT' => 'Mayotte', - 'ZA' => 'South Africa', - 'ZM' => 'Zambia', - 'ZW' => 'Zimbabwe', -]; diff --git a/vendor/nesbot/carbon/src/Carbon/PHPStan/AbstractMacro.php b/vendor/nesbot/carbon/src/Carbon/PHPStan/AbstractMacro.php deleted file mode 100644 index 5123d1e7..00000000 --- a/vendor/nesbot/carbon/src/Carbon/PHPStan/AbstractMacro.php +++ /dev/null @@ -1,288 +0,0 @@ -<?php - -declare(strict_types=1); - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\PHPStan; - -use Closure; -use InvalidArgumentException; -use PHPStan\BetterReflection\Reflection\Adapter\ReflectionParameter as AdapterReflectionParameter; -use PHPStan\BetterReflection\Reflection\Adapter\ReflectionType as AdapterReflectionType; -use PHPStan\BetterReflection\Reflection\ReflectionClass as BetterReflectionClass; -use PHPStan\BetterReflection\Reflection\ReflectionFunction as BetterReflectionFunction; -use PHPStan\BetterReflection\Reflection\ReflectionParameter as BetterReflectionParameter; -use PHPStan\Reflection\Php\BuiltinMethodReflection; -use PHPStan\TrinaryLogic; -use ReflectionClass; -use ReflectionFunction; -use ReflectionMethod; -use ReflectionParameter; -use ReflectionType; -use stdClass; -use Throwable; - -abstract class AbstractMacro implements BuiltinMethodReflection -{ - /** - * The reflection function/method. - * - * @var ReflectionFunction|ReflectionMethod - */ - protected $reflectionFunction; - - /** - * The class name. - * - * @var class-string - */ - private $className; - - /** - * The method name. - * - * @var string - */ - private $methodName; - - /** - * The parameters. - * - * @var ReflectionParameter[] - */ - private $parameters; - - /** - * The is static. - * - * @var bool - */ - private $static = false; - - /** - * Macro constructor. - * - * @param string $className - * @phpstan-param class-string $className - * - * @param string $methodName - * @param callable $macro - */ - public function __construct(string $className, string $methodName, $macro) - { - $this->className = $className; - $this->methodName = $methodName; - $rawReflectionFunction = \is_array($macro) - ? new ReflectionMethod($macro[0], $macro[1]) - : new ReflectionFunction($macro); - $this->reflectionFunction = self::hasModernParser() - ? $this->getReflectionFunction($macro) - : $rawReflectionFunction; // @codeCoverageIgnore - $this->parameters = array_map( - function ($parameter) { - if ($parameter instanceof BetterReflectionParameter) { - return new AdapterReflectionParameter($parameter); - } - - return $parameter; // @codeCoverageIgnore - }, - $this->reflectionFunction->getParameters() - ); - - if ($rawReflectionFunction->isClosure()) { - try { - $closure = $rawReflectionFunction->getClosure(); - $boundClosure = Closure::bind($closure, new stdClass()); - $this->static = (!$boundClosure || (new ReflectionFunction($boundClosure))->getClosureThis() === null); - } catch (Throwable $e) { - $this->static = true; - } - } - } - - private function getReflectionFunction($spec) - { - if (\is_array($spec) && \count($spec) === 2 && \is_string($spec[1])) { - \assert($spec[1] !== ''); - - if (\is_object($spec[0])) { - return BetterReflectionClass::createFromInstance($spec[0]) - ->getMethod($spec[1]); - } - - return BetterReflectionClass::createFromName($spec[0]) - ->getMethod($spec[1]); - } - - if (\is_string($spec)) { - return BetterReflectionFunction::createFromName($spec); - } - - if ($spec instanceof Closure) { - return BetterReflectionFunction::createFromClosure($spec); - } - - throw new InvalidArgumentException('Could not create reflection from the spec given'); // @codeCoverageIgnore - } - - /** - * {@inheritdoc} - */ - public function getDeclaringClass(): ReflectionClass - { - return new ReflectionClass($this->className); - } - - /** - * {@inheritdoc} - */ - public function isPrivate(): bool - { - return false; - } - - /** - * {@inheritdoc} - */ - public function isPublic(): bool - { - return true; - } - - /** - * {@inheritdoc} - */ - public function isFinal(): bool - { - return false; - } - - /** - * {@inheritdoc} - */ - public function isInternal(): bool - { - return false; - } - - /** - * {@inheritdoc} - */ - public function isAbstract(): bool - { - return false; - } - - /** - * {@inheritdoc} - */ - public function isStatic(): bool - { - return $this->static; - } - - /** - * {@inheritdoc} - */ - public function getDocComment(): ?string - { - return $this->reflectionFunction->getDocComment() ?: null; - } - - /** - * {@inheritdoc} - */ - public function getName(): string - { - return $this->methodName; - } - - /** - * {@inheritdoc} - */ - public function getParameters(): array - { - return $this->parameters; - } - - /** - * {@inheritdoc} - */ - public function getReturnType(): ?ReflectionType - { - $type = $this->reflectionFunction->getReturnType(); - - if ($type instanceof ReflectionType) { - return $type; // @codeCoverageIgnore - } - - return self::adaptType($type); - } - - /** - * {@inheritdoc} - */ - public function isDeprecated(): TrinaryLogic - { - return TrinaryLogic::createFromBoolean( - $this->reflectionFunction->isDeprecated() || - preg_match('/@deprecated/i', $this->getDocComment() ?: '') - ); - } - - /** - * {@inheritdoc} - */ - public function isVariadic(): bool - { - return $this->reflectionFunction->isVariadic(); - } - - /** - * {@inheritdoc} - */ - public function getPrototype(): BuiltinMethodReflection - { - return $this; - } - - public function getTentativeReturnType(): ?ReflectionType - { - return null; - } - - public function returnsByReference(): TrinaryLogic - { - return TrinaryLogic::createNo(); - } - - private static function adaptType($type) - { - $method = method_exists(AdapterReflectionType::class, 'fromTypeOrNull') - ? 'fromTypeOrNull' - : 'fromReturnTypeOrNull'; // @codeCoverageIgnore - - return AdapterReflectionType::$method($type); - } - - private static function hasModernParser(): bool - { - static $modernParser = null; - - if ($modernParser !== null) { - return $modernParser; - } - - $modernParser = method_exists(AdapterReflectionType::class, 'fromTypeOrNull'); - - return $modernParser; - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/PHPStan/Macro.php b/vendor/nesbot/carbon/src/Carbon/PHPStan/Macro.php deleted file mode 100644 index de3e51f6..00000000 --- a/vendor/nesbot/carbon/src/Carbon/PHPStan/Macro.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php - -declare(strict_types=1); - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\PHPStan; - -use PHPStan\BetterReflection\Reflection\Adapter; -use PHPStan\Reflection\Php\BuiltinMethodReflection; -use ReflectionMethod; - -$method = new ReflectionMethod(BuiltinMethodReflection::class, 'getReflection'); - -require $method->hasReturnType() && $method->getReturnType()->getName() === Adapter\ReflectionMethod::class - ? __DIR__.'/../../../lazy/Carbon/PHPStan/AbstractMacroStatic.php' - : __DIR__.'/../../../lazy/Carbon/PHPStan/AbstractMacroBuiltin.php'; - -$method = new ReflectionMethod(BuiltinMethodReflection::class, 'getFileName'); - -require $method->hasReturnType() - ? __DIR__.'/../../../lazy/Carbon/PHPStan/MacroStrongType.php' - : __DIR__.'/../../../lazy/Carbon/PHPStan/MacroWeakType.php'; - -final class Macro extends LazyMacro -{ -} diff --git a/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroExtension.php b/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroExtension.php deleted file mode 100644 index 2cd6fce5..00000000 --- a/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroExtension.php +++ /dev/null @@ -1,88 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\PHPStan; - -use PHPStan\Reflection\Assertions; -use PHPStan\Reflection\ClassReflection; -use PHPStan\Reflection\MethodReflection; -use PHPStan\Reflection\MethodsClassReflectionExtension; -use PHPStan\Reflection\Php\PhpMethodReflectionFactory; -use PHPStan\Reflection\ReflectionProvider; -use PHPStan\Type\TypehintHelper; - -/** - * Class MacroExtension. - * - * @codeCoverageIgnore Pure PHPStan wrapper. - */ -final class MacroExtension implements MethodsClassReflectionExtension -{ - /** - * @var PhpMethodReflectionFactory - */ - protected $methodReflectionFactory; - - /** - * @var MacroScanner - */ - protected $scanner; - - /** - * Extension constructor. - * - * @param PhpMethodReflectionFactory $methodReflectionFactory - * @param ReflectionProvider $reflectionProvider - */ - public function __construct( - PhpMethodReflectionFactory $methodReflectionFactory, - ReflectionProvider $reflectionProvider - ) { - $this->scanner = new MacroScanner($reflectionProvider); - $this->methodReflectionFactory = $methodReflectionFactory; - } - - /** - * {@inheritdoc} - */ - public function hasMethod(ClassReflection $classReflection, string $methodName): bool - { - return $this->scanner->hasMethod($classReflection->getName(), $methodName); - } - - /** - * {@inheritdoc} - */ - public function getMethod(ClassReflection $classReflection, string $methodName): MethodReflection - { - $builtinMacro = $this->scanner->getMethod($classReflection->getName(), $methodName); - $supportAssertions = class_exists(Assertions::class); - - return $this->methodReflectionFactory->create( - $classReflection, - null, - $builtinMacro, - $classReflection->getActiveTemplateTypeMap(), - [], - TypehintHelper::decideTypeFromReflection($builtinMacro->getReturnType()), - null, - null, - $builtinMacro->isDeprecated()->yes(), - $builtinMacro->isInternal(), - $builtinMacro->isFinal(), - $supportAssertions ? null : $builtinMacro->getDocComment(), - $supportAssertions ? Assertions::createEmpty() : null, - null, - $builtinMacro->getDocComment(), - [] - ); - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroScanner.php b/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroScanner.php deleted file mode 100644 index c88e49e5..00000000 --- a/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroScanner.php +++ /dev/null @@ -1,87 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\PHPStan; - -use Carbon\CarbonInterface; -use PHPStan\Reflection\ReflectionProvider; -use ReflectionClass; -use ReflectionException; - -final class MacroScanner -{ - /** - * @var \PHPStan\Reflection\ReflectionProvider - */ - private $reflectionProvider; - - /** - * MacroScanner constructor. - * - * @param \PHPStan\Reflection\ReflectionProvider $reflectionProvider - */ - public function __construct(ReflectionProvider $reflectionProvider) - { - $this->reflectionProvider = $reflectionProvider; - } - - /** - * Return true if the given pair class-method is a Carbon macro. - * - * @param string $className - * @phpstan-param class-string $className - * - * @param string $methodName - * - * @return bool - */ - public function hasMethod(string $className, string $methodName): bool - { - $classReflection = $this->reflectionProvider->getClass($className); - - if ( - $classReflection->getName() !== CarbonInterface::class && - !$classReflection->isSubclassOf(CarbonInterface::class) - ) { - return false; - } - - return \is_callable([$className, 'hasMacro']) && - $className::hasMacro($methodName); - } - - /** - * Return the Macro for a given pair class-method. - * - * @param string $className - * @phpstan-param class-string $className - * - * @param string $methodName - * - * @throws ReflectionException - * - * @return Macro - */ - public function getMethod(string $className, string $methodName): Macro - { - $reflectionClass = new ReflectionClass($className); - $property = $reflectionClass->getProperty('globalMacros'); - - $property->setAccessible(true); - $macro = $property->getValue()[$methodName]; - - return new Macro( - $className, - $methodName, - $macro - ); - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Boundaries.php b/vendor/nesbot/carbon/src/Carbon/Traits/Boundaries.php deleted file mode 100644 index 71bbb723..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Boundaries.php +++ /dev/null @@ -1,443 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Traits; - -use Carbon\Exceptions\UnknownUnitException; - -/** - * Trait Boundaries. - * - * startOf, endOf and derived method for each unit. - * - * Depends on the following properties: - * - * @property int $year - * @property int $month - * @property int $daysInMonth - * @property int $quarter - * - * Depends on the following methods: - * - * @method $this setTime(int $hour, int $minute, int $second = 0, int $microseconds = 0) - * @method $this setDate(int $year, int $month, int $day) - * @method $this addMonths(int $value = 1) - */ -trait Boundaries -{ - /** - * Resets the time to 00:00:00 start of day - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->startOfDay(); - * ``` - * - * @return static - */ - public function startOfDay() - { - return $this->setTime(0, 0, 0, 0); - } - - /** - * Resets the time to 23:59:59.999999 end of day - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->endOfDay(); - * ``` - * - * @return static - */ - public function endOfDay() - { - return $this->setTime(static::HOURS_PER_DAY - 1, static::MINUTES_PER_HOUR - 1, static::SECONDS_PER_MINUTE - 1, static::MICROSECONDS_PER_SECOND - 1); - } - - /** - * Resets the date to the first day of the month and the time to 00:00:00 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->startOfMonth(); - * ``` - * - * @return static - */ - public function startOfMonth() - { - return $this->setDate($this->year, $this->month, 1)->startOfDay(); - } - - /** - * Resets the date to end of the month and time to 23:59:59.999999 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->endOfMonth(); - * ``` - * - * @return static - */ - public function endOfMonth() - { - return $this->setDate($this->year, $this->month, $this->daysInMonth)->endOfDay(); - } - - /** - * Resets the date to the first day of the quarter and the time to 00:00:00 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->startOfQuarter(); - * ``` - * - * @return static - */ - public function startOfQuarter() - { - $month = ($this->quarter - 1) * static::MONTHS_PER_QUARTER + 1; - - return $this->setDate($this->year, $month, 1)->startOfDay(); - } - - /** - * Resets the date to end of the quarter and time to 23:59:59.999999 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->endOfQuarter(); - * ``` - * - * @return static - */ - public function endOfQuarter() - { - return $this->startOfQuarter()->addMonths(static::MONTHS_PER_QUARTER - 1)->endOfMonth(); - } - - /** - * Resets the date to the first day of the year and the time to 00:00:00 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->startOfYear(); - * ``` - * - * @return static - */ - public function startOfYear() - { - return $this->setDate($this->year, 1, 1)->startOfDay(); - } - - /** - * Resets the date to end of the year and time to 23:59:59.999999 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->endOfYear(); - * ``` - * - * @return static - */ - public function endOfYear() - { - return $this->setDate($this->year, 12, 31)->endOfDay(); - } - - /** - * Resets the date to the first day of the decade and the time to 00:00:00 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->startOfDecade(); - * ``` - * - * @return static - */ - public function startOfDecade() - { - $year = $this->year - $this->year % static::YEARS_PER_DECADE; - - return $this->setDate($year, 1, 1)->startOfDay(); - } - - /** - * Resets the date to end of the decade and time to 23:59:59.999999 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->endOfDecade(); - * ``` - * - * @return static - */ - public function endOfDecade() - { - $year = $this->year - $this->year % static::YEARS_PER_DECADE + static::YEARS_PER_DECADE - 1; - - return $this->setDate($year, 12, 31)->endOfDay(); - } - - /** - * Resets the date to the first day of the century and the time to 00:00:00 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->startOfCentury(); - * ``` - * - * @return static - */ - public function startOfCentury() - { - $year = $this->year - ($this->year - 1) % static::YEARS_PER_CENTURY; - - return $this->setDate($year, 1, 1)->startOfDay(); - } - - /** - * Resets the date to end of the century and time to 23:59:59.999999 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->endOfCentury(); - * ``` - * - * @return static - */ - public function endOfCentury() - { - $year = $this->year - 1 - ($this->year - 1) % static::YEARS_PER_CENTURY + static::YEARS_PER_CENTURY; - - return $this->setDate($year, 12, 31)->endOfDay(); - } - - /** - * Resets the date to the first day of the millennium and the time to 00:00:00 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->startOfMillennium(); - * ``` - * - * @return static - */ - public function startOfMillennium() - { - $year = $this->year - ($this->year - 1) % static::YEARS_PER_MILLENNIUM; - - return $this->setDate($year, 1, 1)->startOfDay(); - } - - /** - * Resets the date to end of the millennium and time to 23:59:59.999999 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->endOfMillennium(); - * ``` - * - * @return static - */ - public function endOfMillennium() - { - $year = $this->year - 1 - ($this->year - 1) % static::YEARS_PER_MILLENNIUM + static::YEARS_PER_MILLENNIUM; - - return $this->setDate($year, 12, 31)->endOfDay(); - } - - /** - * Resets the date to the first day of week (defined in $weekStartsAt) and the time to 00:00:00 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->startOfWeek() . "\n"; - * echo Carbon::parse('2018-07-25 12:45:16')->locale('ar')->startOfWeek() . "\n"; - * echo Carbon::parse('2018-07-25 12:45:16')->startOfWeek(Carbon::SUNDAY) . "\n"; - * ``` - * - * @param int $weekStartsAt optional start allow you to specify the day of week to use to start the week - * - * @return static - */ - public function startOfWeek($weekStartsAt = null) - { - return $this->subDays((7 + $this->dayOfWeek - ($weekStartsAt ?? $this->firstWeekDay)) % 7)->startOfDay(); - } - - /** - * Resets the date to end of week (defined in $weekEndsAt) and time to 23:59:59.999999 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->endOfWeek() . "\n"; - * echo Carbon::parse('2018-07-25 12:45:16')->locale('ar')->endOfWeek() . "\n"; - * echo Carbon::parse('2018-07-25 12:45:16')->endOfWeek(Carbon::SATURDAY) . "\n"; - * ``` - * - * @param int $weekEndsAt optional start allow you to specify the day of week to use to end the week - * - * @return static - */ - public function endOfWeek($weekEndsAt = null) - { - return $this->addDays((7 - $this->dayOfWeek + ($weekEndsAt ?? $this->lastWeekDay)) % 7)->endOfDay(); - } - - /** - * Modify to start of current hour, minutes and seconds become 0 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->startOfHour(); - * ``` - * - * @return static - */ - public function startOfHour() - { - return $this->setTime($this->hour, 0, 0, 0); - } - - /** - * Modify to end of current hour, minutes and seconds become 59 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->endOfHour(); - * ``` - * - * @return static - */ - public function endOfHour() - { - return $this->setTime($this->hour, static::MINUTES_PER_HOUR - 1, static::SECONDS_PER_MINUTE - 1, static::MICROSECONDS_PER_SECOND - 1); - } - - /** - * Modify to start of current minute, seconds become 0 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->startOfMinute(); - * ``` - * - * @return static - */ - public function startOfMinute() - { - return $this->setTime($this->hour, $this->minute, 0, 0); - } - - /** - * Modify to end of current minute, seconds become 59 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16')->endOfMinute(); - * ``` - * - * @return static - */ - public function endOfMinute() - { - return $this->setTime($this->hour, $this->minute, static::SECONDS_PER_MINUTE - 1, static::MICROSECONDS_PER_SECOND - 1); - } - - /** - * Modify to start of current second, microseconds become 0 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16.334455') - * ->startOfSecond() - * ->format('H:i:s.u'); - * ``` - * - * @return static - */ - public function startOfSecond() - { - return $this->setTime($this->hour, $this->minute, $this->second, 0); - } - - /** - * Modify to end of current second, microseconds become 999999 - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16.334455') - * ->endOfSecond() - * ->format('H:i:s.u'); - * ``` - * - * @return static - */ - public function endOfSecond() - { - return $this->setTime($this->hour, $this->minute, $this->second, static::MICROSECONDS_PER_SECOND - 1); - } - - /** - * Modify to start of current given unit. - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16.334455') - * ->startOf('month') - * ->endOf('week', Carbon::FRIDAY); - * ``` - * - * @param string $unit - * @param array<int, mixed> $params - * - * @return static - */ - public function startOf($unit, ...$params) - { - $ucfUnit = ucfirst(static::singularUnit($unit)); - $method = "startOf$ucfUnit"; - if (!method_exists($this, $method)) { - throw new UnknownUnitException($unit); - } - - return $this->$method(...$params); - } - - /** - * Modify to end of current given unit. - * - * @example - * ``` - * echo Carbon::parse('2018-07-25 12:45:16.334455') - * ->startOf('month') - * ->endOf('week', Carbon::FRIDAY); - * ``` - * - * @param string $unit - * @param array<int, mixed> $params - * - * @return static - */ - public function endOf($unit, ...$params) - { - $ucfUnit = ucfirst(static::singularUnit($unit)); - $method = "endOf$ucfUnit"; - if (!method_exists($this, $method)) { - throw new UnknownUnitException($unit); - } - - return $this->$method(...$params); - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Cast.php b/vendor/nesbot/carbon/src/Carbon/Traits/Cast.php deleted file mode 100644 index 5f7c7c01..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Cast.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Traits; - -use Carbon\Exceptions\InvalidCastException; -use DateTimeInterface; - -/** - * Trait Cast. - * - * Utils to cast into an other class. - */ -trait Cast -{ - /** - * Cast the current instance into the given class. - * - * @param string $className The $className::instance() method will be called to cast the current object. - * - * @return DateTimeInterface - */ - public function cast(string $className) - { - if (!method_exists($className, 'instance')) { - if (is_a($className, DateTimeInterface::class, true)) { - return new $className($this->rawFormat('Y-m-d H:i:s.u'), $this->getTimezone()); - } - - throw new InvalidCastException("$className has not the instance() method needed to cast the date."); - } - - return $className::instance($this); - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Comparison.php b/vendor/nesbot/carbon/src/Carbon/Traits/Comparison.php deleted file mode 100644 index d4c2d8c8..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Comparison.php +++ /dev/null @@ -1,1099 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Traits; - -use BadMethodCallException; -use Carbon\CarbonInterface; -use Carbon\Exceptions\BadComparisonUnitException; -use InvalidArgumentException; - -/** - * Trait Comparison. - * - * Comparison utils and testers. All the following methods return booleans. - * nowWithSameTz - * - * Depends on the following methods: - * - * @method static resolveCarbon($date) - * @method static copy() - * @method static nowWithSameTz() - * @method static static yesterday($timezone = null) - * @method static static tomorrow($timezone = null) - */ -trait Comparison -{ - /** @var bool */ - protected $endOfTime = false; - - /** @var bool */ - protected $startOfTime = false; - - /** - * Determines if the instance is equal to another - * - * @example - * ``` - * Carbon::parse('2018-07-25 12:45:16')->eq('2018-07-25 12:45:16'); // true - * Carbon::parse('2018-07-25 12:45:16')->eq(Carbon::parse('2018-07-25 12:45:16')); // true - * Carbon::parse('2018-07-25 12:45:16')->eq('2018-07-25 12:45:17'); // false - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @see equalTo() - * - * @return bool - */ - public function eq($date): bool - { - return $this->equalTo($date); - } - - /** - * Determines if the instance is equal to another - * - * @example - * ``` - * Carbon::parse('2018-07-25 12:45:16')->equalTo('2018-07-25 12:45:16'); // true - * Carbon::parse('2018-07-25 12:45:16')->equalTo(Carbon::parse('2018-07-25 12:45:16')); // true - * Carbon::parse('2018-07-25 12:45:16')->equalTo('2018-07-25 12:45:17'); // false - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @return bool - */ - public function equalTo($date): bool - { - $this->discourageNull($date); - $this->discourageBoolean($date); - - return $this == $this->resolveCarbon($date); - } - - /** - * Determines if the instance is not equal to another - * - * @example - * ``` - * Carbon::parse('2018-07-25 12:45:16')->ne('2018-07-25 12:45:16'); // false - * Carbon::parse('2018-07-25 12:45:16')->ne(Carbon::parse('2018-07-25 12:45:16')); // false - * Carbon::parse('2018-07-25 12:45:16')->ne('2018-07-25 12:45:17'); // true - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @see notEqualTo() - * - * @return bool - */ - public function ne($date): bool - { - return $this->notEqualTo($date); - } - - /** - * Determines if the instance is not equal to another - * - * @example - * ``` - * Carbon::parse('2018-07-25 12:45:16')->notEqualTo('2018-07-25 12:45:16'); // false - * Carbon::parse('2018-07-25 12:45:16')->notEqualTo(Carbon::parse('2018-07-25 12:45:16')); // false - * Carbon::parse('2018-07-25 12:45:16')->notEqualTo('2018-07-25 12:45:17'); // true - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @return bool - */ - public function notEqualTo($date): bool - { - return !$this->equalTo($date); - } - - /** - * Determines if the instance is greater (after) than another - * - * @example - * ``` - * Carbon::parse('2018-07-25 12:45:16')->gt('2018-07-25 12:45:15'); // true - * Carbon::parse('2018-07-25 12:45:16')->gt('2018-07-25 12:45:16'); // false - * Carbon::parse('2018-07-25 12:45:16')->gt('2018-07-25 12:45:17'); // false - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @see greaterThan() - * - * @return bool - */ - public function gt($date): bool - { - return $this->greaterThan($date); - } - - /** - * Determines if the instance is greater (after) than another - * - * @example - * ``` - * Carbon::parse('2018-07-25 12:45:16')->greaterThan('2018-07-25 12:45:15'); // true - * Carbon::parse('2018-07-25 12:45:16')->greaterThan('2018-07-25 12:45:16'); // false - * Carbon::parse('2018-07-25 12:45:16')->greaterThan('2018-07-25 12:45:17'); // false - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @return bool - */ - public function greaterThan($date): bool - { - $this->discourageNull($date); - $this->discourageBoolean($date); - - return $this > $this->resolveCarbon($date); - } - - /** - * Determines if the instance is greater (after) than another - * - * @example - * ``` - * Carbon::parse('2018-07-25 12:45:16')->isAfter('2018-07-25 12:45:15'); // true - * Carbon::parse('2018-07-25 12:45:16')->isAfter('2018-07-25 12:45:16'); // false - * Carbon::parse('2018-07-25 12:45:16')->isAfter('2018-07-25 12:45:17'); // false - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @see greaterThan() - * - * @return bool - */ - public function isAfter($date): bool - { - return $this->greaterThan($date); - } - - /** - * Determines if the instance is greater (after) than or equal to another - * - * @example - * ``` - * Carbon::parse('2018-07-25 12:45:16')->gte('2018-07-25 12:45:15'); // true - * Carbon::parse('2018-07-25 12:45:16')->gte('2018-07-25 12:45:16'); // true - * Carbon::parse('2018-07-25 12:45:16')->gte('2018-07-25 12:45:17'); // false - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @see greaterThanOrEqualTo() - * - * @return bool - */ - public function gte($date): bool - { - return $this->greaterThanOrEqualTo($date); - } - - /** - * Determines if the instance is greater (after) than or equal to another - * - * @example - * ``` - * Carbon::parse('2018-07-25 12:45:16')->greaterThanOrEqualTo('2018-07-25 12:45:15'); // true - * Carbon::parse('2018-07-25 12:45:16')->greaterThanOrEqualTo('2018-07-25 12:45:16'); // true - * Carbon::parse('2018-07-25 12:45:16')->greaterThanOrEqualTo('2018-07-25 12:45:17'); // false - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @return bool - */ - public function greaterThanOrEqualTo($date): bool - { - $this->discourageNull($date); - $this->discourageBoolean($date); - - return $this >= $this->resolveCarbon($date); - } - - /** - * Determines if the instance is less (before) than another - * - * @example - * ``` - * Carbon::parse('2018-07-25 12:45:16')->lt('2018-07-25 12:45:15'); // false - * Carbon::parse('2018-07-25 12:45:16')->lt('2018-07-25 12:45:16'); // false - * Carbon::parse('2018-07-25 12:45:16')->lt('2018-07-25 12:45:17'); // true - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @see lessThan() - * - * @return bool - */ - public function lt($date): bool - { - return $this->lessThan($date); - } - - /** - * Determines if the instance is less (before) than another - * - * @example - * ``` - * Carbon::parse('2018-07-25 12:45:16')->lessThan('2018-07-25 12:45:15'); // false - * Carbon::parse('2018-07-25 12:45:16')->lessThan('2018-07-25 12:45:16'); // false - * Carbon::parse('2018-07-25 12:45:16')->lessThan('2018-07-25 12:45:17'); // true - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @return bool - */ - public function lessThan($date): bool - { - $this->discourageNull($date); - $this->discourageBoolean($date); - - return $this < $this->resolveCarbon($date); - } - - /** - * Determines if the instance is less (before) than another - * - * @example - * ``` - * Carbon::parse('2018-07-25 12:45:16')->isBefore('2018-07-25 12:45:15'); // false - * Carbon::parse('2018-07-25 12:45:16')->isBefore('2018-07-25 12:45:16'); // false - * Carbon::parse('2018-07-25 12:45:16')->isBefore('2018-07-25 12:45:17'); // true - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @see lessThan() - * - * @return bool - */ - public function isBefore($date): bool - { - return $this->lessThan($date); - } - - /** - * Determines if the instance is less (before) or equal to another - * - * @example - * ``` - * Carbon::parse('2018-07-25 12:45:16')->lte('2018-07-25 12:45:15'); // false - * Carbon::parse('2018-07-25 12:45:16')->lte('2018-07-25 12:45:16'); // true - * Carbon::parse('2018-07-25 12:45:16')->lte('2018-07-25 12:45:17'); // true - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @see lessThanOrEqualTo() - * - * @return bool - */ - public function lte($date): bool - { - return $this->lessThanOrEqualTo($date); - } - - /** - * Determines if the instance is less (before) or equal to another - * - * @example - * ``` - * Carbon::parse('2018-07-25 12:45:16')->lessThanOrEqualTo('2018-07-25 12:45:15'); // false - * Carbon::parse('2018-07-25 12:45:16')->lessThanOrEqualTo('2018-07-25 12:45:16'); // true - * Carbon::parse('2018-07-25 12:45:16')->lessThanOrEqualTo('2018-07-25 12:45:17'); // true - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @return bool - */ - public function lessThanOrEqualTo($date): bool - { - $this->discourageNull($date); - $this->discourageBoolean($date); - - return $this <= $this->resolveCarbon($date); - } - - /** - * Determines if the instance is between two others. - * - * The third argument allow you to specify if bounds are included or not (true by default) - * but for when you including/excluding bounds may produce different results in your application, - * we recommend to use the explicit methods ->betweenIncluded() or ->betweenExcluded() instead. - * - * @example - * ``` - * Carbon::parse('2018-07-25')->between('2018-07-14', '2018-08-01'); // true - * Carbon::parse('2018-07-25')->between('2018-08-01', '2018-08-20'); // false - * Carbon::parse('2018-07-25')->between('2018-07-25', '2018-08-01'); // true - * Carbon::parse('2018-07-25')->between('2018-07-25', '2018-08-01', false); // false - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date1 - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date2 - * @param bool $equal Indicates if an equal to comparison should be done - * - * @return bool - */ - public function between($date1, $date2, $equal = true): bool - { - $date1 = $this->resolveCarbon($date1); - $date2 = $this->resolveCarbon($date2); - - if ($date1->greaterThan($date2)) { - [$date1, $date2] = [$date2, $date1]; - } - - if ($equal) { - return $this >= $date1 && $this <= $date2; - } - - return $this > $date1 && $this < $date2; - } - - /** - * Determines if the instance is between two others, bounds included. - * - * @example - * ``` - * Carbon::parse('2018-07-25')->betweenIncluded('2018-07-14', '2018-08-01'); // true - * Carbon::parse('2018-07-25')->betweenIncluded('2018-08-01', '2018-08-20'); // false - * Carbon::parse('2018-07-25')->betweenIncluded('2018-07-25', '2018-08-01'); // true - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date1 - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date2 - * - * @return bool - */ - public function betweenIncluded($date1, $date2): bool - { - return $this->between($date1, $date2, true); - } - - /** - * Determines if the instance is between two others, bounds excluded. - * - * @example - * ``` - * Carbon::parse('2018-07-25')->betweenExcluded('2018-07-14', '2018-08-01'); // true - * Carbon::parse('2018-07-25')->betweenExcluded('2018-08-01', '2018-08-20'); // false - * Carbon::parse('2018-07-25')->betweenExcluded('2018-07-25', '2018-08-01'); // false - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date1 - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date2 - * - * @return bool - */ - public function betweenExcluded($date1, $date2): bool - { - return $this->between($date1, $date2, false); - } - - /** - * Determines if the instance is between two others - * - * @example - * ``` - * Carbon::parse('2018-07-25')->isBetween('2018-07-14', '2018-08-01'); // true - * Carbon::parse('2018-07-25')->isBetween('2018-08-01', '2018-08-20'); // false - * Carbon::parse('2018-07-25')->isBetween('2018-07-25', '2018-08-01'); // true - * Carbon::parse('2018-07-25')->isBetween('2018-07-25', '2018-08-01', false); // false - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date1 - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date2 - * @param bool $equal Indicates if an equal to comparison should be done - * - * @return bool - */ - public function isBetween($date1, $date2, $equal = true): bool - { - return $this->between($date1, $date2, $equal); - } - - /** - * Determines if the instance is a weekday. - * - * @example - * ``` - * Carbon::parse('2019-07-14')->isWeekday(); // false - * Carbon::parse('2019-07-15')->isWeekday(); // true - * ``` - * - * @return bool - */ - public function isWeekday() - { - return !$this->isWeekend(); - } - - /** - * Determines if the instance is a weekend day. - * - * @example - * ``` - * Carbon::parse('2019-07-14')->isWeekend(); // true - * Carbon::parse('2019-07-15')->isWeekend(); // false - * ``` - * - * @return bool - */ - public function isWeekend() - { - return \in_array($this->dayOfWeek, static::$weekendDays, true); - } - - /** - * Determines if the instance is yesterday. - * - * @example - * ``` - * Carbon::yesterday()->isYesterday(); // true - * Carbon::tomorrow()->isYesterday(); // false - * ``` - * - * @return bool - */ - public function isYesterday() - { - return $this->toDateString() === static::yesterday($this->getTimezone())->toDateString(); - } - - /** - * Determines if the instance is today. - * - * @example - * ``` - * Carbon::today()->isToday(); // true - * Carbon::tomorrow()->isToday(); // false - * ``` - * - * @return bool - */ - public function isToday() - { - return $this->toDateString() === $this->nowWithSameTz()->toDateString(); - } - - /** - * Determines if the instance is tomorrow. - * - * @example - * ``` - * Carbon::tomorrow()->isTomorrow(); // true - * Carbon::yesterday()->isTomorrow(); // false - * ``` - * - * @return bool - */ - public function isTomorrow() - { - return $this->toDateString() === static::tomorrow($this->getTimezone())->toDateString(); - } - - /** - * Determines if the instance is in the future, ie. greater (after) than now. - * - * @example - * ``` - * Carbon::now()->addHours(5)->isFuture(); // true - * Carbon::now()->subHours(5)->isFuture(); // false - * ``` - * - * @return bool - */ - public function isFuture() - { - return $this->greaterThan($this->nowWithSameTz()); - } - - /** - * Determines if the instance is in the past, ie. less (before) than now. - * - * @example - * ``` - * Carbon::now()->subHours(5)->isPast(); // true - * Carbon::now()->addHours(5)->isPast(); // false - * ``` - * - * @return bool - */ - public function isPast() - { - return $this->lessThan($this->nowWithSameTz()); - } - - /** - * Determines if the instance is a leap year. - * - * @example - * ``` - * Carbon::parse('2020-01-01')->isLeapYear(); // true - * Carbon::parse('2019-01-01')->isLeapYear(); // false - * ``` - * - * @return bool - */ - public function isLeapYear() - { - return $this->rawFormat('L') === '1'; - } - - /** - * Determines if the instance is a long year - * - * @example - * ``` - * Carbon::parse('2015-01-01')->isLongYear(); // true - * Carbon::parse('2016-01-01')->isLongYear(); // false - * ``` - * - * @see https://en.wikipedia.org/wiki/ISO_8601#Week_dates - * - * @return bool - */ - public function isLongYear() - { - return static::create($this->year, 12, 28, 0, 0, 0, $this->tz)->weekOfYear === 53; - } - - /** - * Compares the formatted values of the two dates. - * - * @example - * ``` - * Carbon::parse('2019-06-13')->isSameAs('Y-d', Carbon::parse('2019-12-13')); // true - * Carbon::parse('2019-06-13')->isSameAs('Y-d', Carbon::parse('2019-06-14')); // false - * ``` - * - * @param string $format date formats to compare. - * @param \Carbon\Carbon|\DateTimeInterface|string|null $date instance to compare with or null to use current day. - * - * @return bool - */ - public function isSameAs($format, $date = null) - { - return $this->rawFormat($format) === $this->resolveCarbon($date)->rawFormat($format); - } - - /** - * Determines if the instance is in the current unit given. - * - * @example - * ``` - * Carbon::parse('2019-01-13')->isSameUnit('year', Carbon::parse('2019-12-25')); // true - * Carbon::parse('2018-12-13')->isSameUnit('year', Carbon::parse('2019-12-25')); // false - * ``` - * - * @param string $unit singular unit string - * @param \Carbon\Carbon|\DateTimeInterface|null $date instance to compare with or null to use current day. - * - * @throws BadComparisonUnitException - * - * @return bool - */ - public function isSameUnit($unit, $date = null) - { - $units = [ - // @call isSameUnit - 'year' => 'Y', - // @call isSameUnit - 'week' => 'o-W', - // @call isSameUnit - 'day' => 'Y-m-d', - // @call isSameUnit - 'hour' => 'Y-m-d H', - // @call isSameUnit - 'minute' => 'Y-m-d H:i', - // @call isSameUnit - 'second' => 'Y-m-d H:i:s', - // @call isSameUnit - 'micro' => 'Y-m-d H:i:s.u', - // @call isSameUnit - 'microsecond' => 'Y-m-d H:i:s.u', - ]; - - if (isset($units[$unit])) { - return $this->isSameAs($units[$unit], $date); - } - - if (isset($this->$unit)) { - return $this->resolveCarbon($date)->$unit === $this->$unit; - } - - if ($this->localStrictModeEnabled ?? static::isStrictModeEnabled()) { - throw new BadComparisonUnitException($unit); - } - - return false; - } - - /** - * Determines if the instance is in the current unit given. - * - * @example - * ``` - * Carbon::now()->isCurrentUnit('hour'); // true - * Carbon::now()->subHours(2)->isCurrentUnit('hour'); // false - * ``` - * - * @param string $unit The unit to test. - * - * @throws BadMethodCallException - * - * @return bool - */ - public function isCurrentUnit($unit) - { - return $this->{'isSame'.ucfirst($unit)}(); - } - - /** - * Checks if the passed in date is in the same quarter as the instance quarter (and year if needed). - * - * @example - * ``` - * Carbon::parse('2019-01-12')->isSameQuarter(Carbon::parse('2019-03-01')); // true - * Carbon::parse('2019-01-12')->isSameQuarter(Carbon::parse('2019-04-01')); // false - * Carbon::parse('2019-01-12')->isSameQuarter(Carbon::parse('2018-03-01')); // false - * Carbon::parse('2019-01-12')->isSameQuarter(Carbon::parse('2018-03-01'), false); // true - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|string|null $date The instance to compare with or null to use current day. - * @param bool $ofSameYear Check if it is the same month in the same year. - * - * @return bool - */ - public function isSameQuarter($date = null, $ofSameYear = true) - { - $date = $this->resolveCarbon($date); - - return $this->quarter === $date->quarter && (!$ofSameYear || $this->isSameYear($date)); - } - - /** - * Checks if the passed in date is in the same month as the instance´s month. - * - * @example - * ``` - * Carbon::parse('2019-01-12')->isSameMonth(Carbon::parse('2019-01-01')); // true - * Carbon::parse('2019-01-12')->isSameMonth(Carbon::parse('2019-02-01')); // false - * Carbon::parse('2019-01-12')->isSameMonth(Carbon::parse('2018-01-01')); // false - * Carbon::parse('2019-01-12')->isSameMonth(Carbon::parse('2018-01-01'), false); // true - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|null $date The instance to compare with or null to use the current date. - * @param bool $ofSameYear Check if it is the same month in the same year. - * - * @return bool - */ - public function isSameMonth($date = null, $ofSameYear = true) - { - return $this->isSameAs($ofSameYear ? 'Y-m' : 'm', $date); - } - - /** - * Checks if this day is a specific day of the week. - * - * @example - * ``` - * Carbon::parse('2019-07-17')->isDayOfWeek(Carbon::WEDNESDAY); // true - * Carbon::parse('2019-07-17')->isDayOfWeek(Carbon::FRIDAY); // false - * Carbon::parse('2019-07-17')->isDayOfWeek('Wednesday'); // true - * Carbon::parse('2019-07-17')->isDayOfWeek('Friday'); // false - * ``` - * - * @param int $dayOfWeek - * - * @return bool - */ - public function isDayOfWeek($dayOfWeek) - { - if (\is_string($dayOfWeek) && \defined($constant = static::class.'::'.strtoupper($dayOfWeek))) { - $dayOfWeek = \constant($constant); - } - - return $this->dayOfWeek === $dayOfWeek; - } - - /** - * Check if its the birthday. Compares the date/month values of the two dates. - * - * @example - * ``` - * Carbon::now()->subYears(5)->isBirthday(); // true - * Carbon::now()->subYears(5)->subDay()->isBirthday(); // false - * Carbon::parse('2019-06-05')->isBirthday(Carbon::parse('2001-06-05')); // true - * Carbon::parse('2019-06-05')->isBirthday(Carbon::parse('2001-06-06')); // false - * ``` - * - * @param \Carbon\Carbon|\DateTimeInterface|null $date The instance to compare with or null to use current day. - * - * @return bool - */ - public function isBirthday($date = null) - { - return $this->isSameAs('md', $date); - } - - /** - * Check if today is the last day of the Month - * - * @example - * ``` - * Carbon::parse('2019-02-28')->isLastOfMonth(); // true - * Carbon::parse('2019-03-28')->isLastOfMonth(); // false - * Carbon::parse('2019-03-30')->isLastOfMonth(); // false - * Carbon::parse('2019-03-31')->isLastOfMonth(); // true - * Carbon::parse('2019-04-30')->isLastOfMonth(); // true - * ``` - * - * @return bool - */ - public function isLastOfMonth() - { - return $this->day === $this->daysInMonth; - } - - /** - * Check if the instance is start of day / midnight. - * - * @example - * ``` - * Carbon::parse('2019-02-28 00:00:00')->isStartOfDay(); // true - * Carbon::parse('2019-02-28 00:00:00.999999')->isStartOfDay(); // true - * Carbon::parse('2019-02-28 00:00:01')->isStartOfDay(); // false - * Carbon::parse('2019-02-28 00:00:00.000000')->isStartOfDay(true); // true - * Carbon::parse('2019-02-28 00:00:00.000012')->isStartOfDay(true); // false - * ``` - * - * @param bool $checkMicroseconds check time at microseconds precision - * - * @return bool - */ - public function isStartOfDay($checkMicroseconds = false) - { - /* @var CarbonInterface $this */ - return $checkMicroseconds - ? $this->rawFormat('H:i:s.u') === '00:00:00.000000' - : $this->rawFormat('H:i:s') === '00:00:00'; - } - - /** - * Check if the instance is end of day. - * - * @example - * ``` - * Carbon::parse('2019-02-28 23:59:59.999999')->isEndOfDay(); // true - * Carbon::parse('2019-02-28 23:59:59.123456')->isEndOfDay(); // true - * Carbon::parse('2019-02-28 23:59:59')->isEndOfDay(); // true - * Carbon::parse('2019-02-28 23:59:58.999999')->isEndOfDay(); // false - * Carbon::parse('2019-02-28 23:59:59.999999')->isEndOfDay(true); // true - * Carbon::parse('2019-02-28 23:59:59.123456')->isEndOfDay(true); // false - * Carbon::parse('2019-02-28 23:59:59')->isEndOfDay(true); // false - * ``` - * - * @param bool $checkMicroseconds check time at microseconds precision - * - * @return bool - */ - public function isEndOfDay($checkMicroseconds = false) - { - /* @var CarbonInterface $this */ - return $checkMicroseconds - ? $this->rawFormat('H:i:s.u') === '23:59:59.999999' - : $this->rawFormat('H:i:s') === '23:59:59'; - } - - /** - * Check if the instance is start of day / midnight. - * - * @example - * ``` - * Carbon::parse('2019-02-28 00:00:00')->isMidnight(); // true - * Carbon::parse('2019-02-28 00:00:00.999999')->isMidnight(); // true - * Carbon::parse('2019-02-28 00:00:01')->isMidnight(); // false - * ``` - * - * @return bool - */ - public function isMidnight() - { - return $this->isStartOfDay(); - } - - /** - * Check if the instance is midday. - * - * @example - * ``` - * Carbon::parse('2019-02-28 11:59:59.999999')->isMidday(); // false - * Carbon::parse('2019-02-28 12:00:00')->isMidday(); // true - * Carbon::parse('2019-02-28 12:00:00.999999')->isMidday(); // true - * Carbon::parse('2019-02-28 12:00:01')->isMidday(); // false - * ``` - * - * @return bool - */ - public function isMidday() - { - /* @var CarbonInterface $this */ - return $this->rawFormat('G:i:s') === static::$midDayAt.':00:00'; - } - - /** - * Checks if the (date)time string is in a given format. - * - * @example - * ``` - * Carbon::hasFormat('11:12:45', 'h:i:s'); // true - * Carbon::hasFormat('13:12:45', 'h:i:s'); // false - * ``` - * - * @param string $date - * @param string $format - * - * @return bool - */ - public static function hasFormat($date, $format) - { - // createFromFormat() is known to handle edge cases silently. - // E.g. "1975-5-1" (Y-n-j) will still be parsed correctly when "Y-m-d" is supplied as the format. - // To ensure we're really testing against our desired format, perform an additional regex validation. - - return self::matchFormatPattern((string) $date, preg_quote((string) $format, '/'), static::$regexFormats); - } - - /** - * Checks if the (date)time string is in a given format. - * - * @example - * ``` - * Carbon::hasFormatWithModifiers('31/08/2015', 'd#m#Y'); // true - * Carbon::hasFormatWithModifiers('31/08/2015', 'm#d#Y'); // false - * ``` - * - * @param string $date - * @param string $format - * - * @return bool - */ - public static function hasFormatWithModifiers($date, $format): bool - { - return self::matchFormatPattern((string) $date, (string) $format, array_merge(static::$regexFormats, static::$regexFormatModifiers)); - } - - /** - * Checks if the (date)time string is in a given format and valid to create a - * new instance. - * - * @example - * ``` - * Carbon::canBeCreatedFromFormat('11:12:45', 'h:i:s'); // true - * Carbon::canBeCreatedFromFormat('13:12:45', 'h:i:s'); // false - * ``` - * - * @param string $date - * @param string $format - * - * @return bool - */ - public static function canBeCreatedFromFormat($date, $format) - { - try { - // Try to create a DateTime object. Throws an InvalidArgumentException if the provided time string - // doesn't match the format in any way. - if (!static::rawCreateFromFormat($format, $date)) { - return false; - } - } catch (InvalidArgumentException $e) { - return false; - } - - return static::hasFormatWithModifiers($date, $format); - } - - /** - * Returns true if the current date matches the given string. - * - * @example - * ``` - * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('2019')); // true - * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('2018')); // false - * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('2019-06')); // true - * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('06-02')); // true - * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('2019-06-02')); // true - * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('Sunday')); // true - * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('June')); // true - * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('12:23')); // true - * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('12:23:45')); // true - * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('12:23:00')); // false - * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('12h')); // true - * var_dump(Carbon::parse('2019-06-02 15:23:45')->is('3pm')); // true - * var_dump(Carbon::parse('2019-06-02 15:23:45')->is('3am')); // false - * ``` - * - * @param string $tester day name, month name, hour, date, etc. as string - * - * @return bool - */ - public function is(string $tester) - { - $tester = trim($tester); - - if (preg_match('/^\d+$/', $tester)) { - return $this->year === (int) $tester; - } - - if (preg_match('/^\d{3,}-\d{1,2}$/', $tester)) { - return $this->isSameMonth(static::parse($tester)); - } - - if (preg_match('/^\d{1,2}-\d{1,2}$/', $tester)) { - return $this->isSameDay(static::parse($this->year.'-'.$tester)); - } - - $modifier = preg_replace('/(\d)h$/i', '$1:00', $tester); - - /* @var CarbonInterface $max */ - $median = static::parse('5555-06-15 12:30:30.555555')->modify($modifier); - $current = $this->avoidMutation(); - /* @var CarbonInterface $other */ - $other = $this->avoidMutation()->modify($modifier); - - if ($current->eq($other)) { - return true; - } - - if (preg_match('/\d:\d{1,2}:\d{1,2}$/', $tester)) { - return $current->startOfSecond()->eq($other); - } - - if (preg_match('/\d:\d{1,2}$/', $tester)) { - return $current->startOfMinute()->eq($other); - } - - if (preg_match('/\d(h|am|pm)$/', $tester)) { - return $current->startOfHour()->eq($other); - } - - if (preg_match( - '/^(january|february|march|april|may|june|july|august|september|october|november|december)\s+\d+$/i', - $tester - )) { - return $current->startOfMonth()->eq($other->startOfMonth()); - } - - $units = [ - 'month' => [1, 'year'], - 'day' => [1, 'month'], - 'hour' => [0, 'day'], - 'minute' => [0, 'hour'], - 'second' => [0, 'minute'], - 'microsecond' => [0, 'second'], - ]; - - foreach ($units as $unit => [$minimum, $startUnit]) { - if ($minimum === $median->$unit) { - $current = $current->startOf($startUnit); - - break; - } - } - - return $current->eq($other); - } - - /** - * Checks if the (date)time string is in a given format with - * given list of pattern replacements. - * - * @example - * ``` - * Carbon::hasFormat('11:12:45', 'h:i:s'); // true - * Carbon::hasFormat('13:12:45', 'h:i:s'); // false - * ``` - * - * @param string $date - * @param string $format - * @param array $replacements - * - * @return bool - */ - private static function matchFormatPattern(string $date, string $format, array $replacements): bool - { - // Preg quote, but remove escaped backslashes since we'll deal with escaped characters in the format string. - $regex = str_replace('\\\\', '\\', $format); - // Replace not-escaped letters - $regex = preg_replace_callback( - '/(?<!\\\\)((?:\\\\{2})*)(['.implode('', array_keys($replacements)).'])/', - function ($match) use ($replacements) { - return $match[1].strtr($match[2], $replacements); - }, - $regex - ); - // Replace escaped letters by the letter itself - $regex = preg_replace('/(?<!\\\\)((?:\\\\{2})*)\\\\(\w)/', '$1$2', $regex); - // Escape not escaped slashes - $regex = preg_replace('#(?<!\\\\)((?:\\\\{2})*)/#', '$1\\/', $regex); - - return (bool) @preg_match('/^'.$regex.'$/', $date); - } - - /** - * Returns true if the date was created using CarbonImmutable::startOfTime() - * - * @return bool - */ - public function isStartOfTime(): bool - { - return $this->startOfTime ?? false; - } - - /** - * Returns true if the date was created using CarbonImmutable::endOfTime() - * - * @return bool - */ - public function isEndOfTime(): bool - { - return $this->endOfTime ?? false; - } - - private function discourageNull($value): void - { - if ($value === null) { - @trigger_error("Since 2.61.0, it's deprecated to compare a date to null, meaning of such comparison is ambiguous and will no longer be possible in 3.0.0, you should explicitly pass 'now' or make an other check to eliminate null values.", \E_USER_DEPRECATED); - } - } - - private function discourageBoolean($value): void - { - if (\is_bool($value)) { - @trigger_error("Since 2.61.0, it's deprecated to compare a date to true or false, meaning of such comparison is ambiguous and will no longer be possible in 3.0.0, you should explicitly pass 'now' or make an other check to eliminate boolean values.", \E_USER_DEPRECATED); - } - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Converter.php b/vendor/nesbot/carbon/src/Carbon/Traits/Converter.php deleted file mode 100644 index 05598d57..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Converter.php +++ /dev/null @@ -1,636 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Traits; - -use Carbon\Carbon; -use Carbon\CarbonImmutable; -use Carbon\CarbonInterface; -use Carbon\CarbonInterval; -use Carbon\CarbonPeriod; -use Carbon\Exceptions\UnitException; -use Closure; -use DateTime; -use DateTimeImmutable; -use ReturnTypeWillChange; - -/** - * Trait Converter. - * - * Change date into different string formats and types and - * handle the string cast. - * - * Depends on the following methods: - * - * @method static copy() - */ -trait Converter -{ - use ToStringFormat; - - /** - * Returns the formatted date string on success or FALSE on failure. - * - * @see https://php.net/manual/en/datetime.format.php - * - * @param string $format - * - * @return string - */ - #[ReturnTypeWillChange] - public function format($format) - { - $function = $this->localFormatFunction ?: static::$formatFunction; - - if (!$function) { - return $this->rawFormat($format); - } - - if (\is_string($function) && method_exists($this, $function)) { - $function = [$this, $function]; - } - - return $function(...\func_get_args()); - } - - /** - * @see https://php.net/manual/en/datetime.format.php - * - * @param string $format - * - * @return string - */ - public function rawFormat($format) - { - return parent::format($format); - } - - /** - * Format the instance as a string using the set format - * - * @example - * ``` - * echo Carbon::now(); // Carbon instances can be cast to string - * ``` - * - * @return string - */ - public function __toString() - { - $format = $this->localToStringFormat ?? static::$toStringFormat; - - return $format instanceof Closure - ? $format($this) - : $this->rawFormat($format ?: ( - \defined('static::DEFAULT_TO_STRING_FORMAT') - ? static::DEFAULT_TO_STRING_FORMAT - : CarbonInterface::DEFAULT_TO_STRING_FORMAT - )); - } - - /** - * Format the instance as date - * - * @example - * ``` - * echo Carbon::now()->toDateString(); - * ``` - * - * @return string - */ - public function toDateString() - { - return $this->rawFormat('Y-m-d'); - } - - /** - * Format the instance as a readable date - * - * @example - * ``` - * echo Carbon::now()->toFormattedDateString(); - * ``` - * - * @return string - */ - public function toFormattedDateString() - { - return $this->rawFormat('M j, Y'); - } - - /** - * Format the instance with the day, and a readable date - * - * @example - * ``` - * echo Carbon::now()->toFormattedDayDateString(); - * ``` - * - * @return string - */ - public function toFormattedDayDateString(): string - { - return $this->rawFormat('D, M j, Y'); - } - - /** - * Format the instance as time - * - * @example - * ``` - * echo Carbon::now()->toTimeString(); - * ``` - * - * @param string $unitPrecision - * - * @return string - */ - public function toTimeString($unitPrecision = 'second') - { - return $this->rawFormat(static::getTimeFormatByPrecision($unitPrecision)); - } - - /** - * Format the instance as date and time - * - * @example - * ``` - * echo Carbon::now()->toDateTimeString(); - * ``` - * - * @param string $unitPrecision - * - * @return string - */ - public function toDateTimeString($unitPrecision = 'second') - { - return $this->rawFormat('Y-m-d '.static::getTimeFormatByPrecision($unitPrecision)); - } - - /** - * Return a format from H:i to H:i:s.u according to given unit precision. - * - * @param string $unitPrecision "minute", "second", "millisecond" or "microsecond" - * - * @return string - */ - public static function getTimeFormatByPrecision($unitPrecision) - { - switch (static::singularUnit($unitPrecision)) { - case 'minute': - return 'H:i'; - case 'second': - return 'H:i:s'; - case 'm': - case 'millisecond': - return 'H:i:s.v'; - case 'µ': - case 'microsecond': - return 'H:i:s.u'; - } - - throw new UnitException('Precision unit expected among: minute, second, millisecond and microsecond.'); - } - - /** - * Format the instance as date and time T-separated with no timezone - * - * @example - * ``` - * echo Carbon::now()->toDateTimeLocalString(); - * echo "\n"; - * echo Carbon::now()->toDateTimeLocalString('minute'); // You can specify precision among: minute, second, millisecond and microsecond - * ``` - * - * @param string $unitPrecision - * - * @return string - */ - public function toDateTimeLocalString($unitPrecision = 'second') - { - return $this->rawFormat('Y-m-d\T'.static::getTimeFormatByPrecision($unitPrecision)); - } - - /** - * Format the instance with day, date and time - * - * @example - * ``` - * echo Carbon::now()->toDayDateTimeString(); - * ``` - * - * @return string - */ - public function toDayDateTimeString() - { - return $this->rawFormat('D, M j, Y g:i A'); - } - - /** - * Format the instance as ATOM - * - * @example - * ``` - * echo Carbon::now()->toAtomString(); - * ``` - * - * @return string - */ - public function toAtomString() - { - return $this->rawFormat(DateTime::ATOM); - } - - /** - * Format the instance as COOKIE - * - * @example - * ``` - * echo Carbon::now()->toCookieString(); - * ``` - * - * @return string - */ - public function toCookieString() - { - return $this->rawFormat(DateTime::COOKIE); - } - - /** - * Format the instance as ISO8601 - * - * @example - * ``` - * echo Carbon::now()->toIso8601String(); - * ``` - * - * @return string - */ - public function toIso8601String() - { - return $this->toAtomString(); - } - - /** - * Format the instance as RFC822 - * - * @example - * ``` - * echo Carbon::now()->toRfc822String(); - * ``` - * - * @return string - */ - public function toRfc822String() - { - return $this->rawFormat(DateTime::RFC822); - } - - /** - * Convert the instance to UTC and return as Zulu ISO8601 - * - * @example - * ``` - * echo Carbon::now()->toIso8601ZuluString(); - * ``` - * - * @param string $unitPrecision - * - * @return string - */ - public function toIso8601ZuluString($unitPrecision = 'second') - { - return $this->avoidMutation() - ->utc() - ->rawFormat('Y-m-d\T'.static::getTimeFormatByPrecision($unitPrecision).'\Z'); - } - - /** - * Format the instance as RFC850 - * - * @example - * ``` - * echo Carbon::now()->toRfc850String(); - * ``` - * - * @return string - */ - public function toRfc850String() - { - return $this->rawFormat(DateTime::RFC850); - } - - /** - * Format the instance as RFC1036 - * - * @example - * ``` - * echo Carbon::now()->toRfc1036String(); - * ``` - * - * @return string - */ - public function toRfc1036String() - { - return $this->rawFormat(DateTime::RFC1036); - } - - /** - * Format the instance as RFC1123 - * - * @example - * ``` - * echo Carbon::now()->toRfc1123String(); - * ``` - * - * @return string - */ - public function toRfc1123String() - { - return $this->rawFormat(DateTime::RFC1123); - } - - /** - * Format the instance as RFC2822 - * - * @example - * ``` - * echo Carbon::now()->toRfc2822String(); - * ``` - * - * @return string - */ - public function toRfc2822String() - { - return $this->rawFormat(DateTime::RFC2822); - } - - /** - * Format the instance as RFC3339 - * - * @param bool $extended - * - * @example - * ``` - * echo Carbon::now()->toRfc3339String() . "\n"; - * echo Carbon::now()->toRfc3339String(true) . "\n"; - * ``` - * - * @return string - */ - public function toRfc3339String($extended = false) - { - $format = DateTime::RFC3339; - if ($extended) { - $format = DateTime::RFC3339_EXTENDED; - } - - return $this->rawFormat($format); - } - - /** - * Format the instance as RSS - * - * @example - * ``` - * echo Carbon::now()->toRssString(); - * ``` - * - * @return string - */ - public function toRssString() - { - return $this->rawFormat(DateTime::RSS); - } - - /** - * Format the instance as W3C - * - * @example - * ``` - * echo Carbon::now()->toW3cString(); - * ``` - * - * @return string - */ - public function toW3cString() - { - return $this->rawFormat(DateTime::W3C); - } - - /** - * Format the instance as RFC7231 - * - * @example - * ``` - * echo Carbon::now()->toRfc7231String(); - * ``` - * - * @return string - */ - public function toRfc7231String() - { - return $this->avoidMutation() - ->setTimezone('GMT') - ->rawFormat(\defined('static::RFC7231_FORMAT') ? static::RFC7231_FORMAT : CarbonInterface::RFC7231_FORMAT); - } - - /** - * Get default array representation. - * - * @example - * ``` - * var_dump(Carbon::now()->toArray()); - * ``` - * - * @return array - */ - public function toArray() - { - return [ - 'year' => $this->year, - 'month' => $this->month, - 'day' => $this->day, - 'dayOfWeek' => $this->dayOfWeek, - 'dayOfYear' => $this->dayOfYear, - 'hour' => $this->hour, - 'minute' => $this->minute, - 'second' => $this->second, - 'micro' => $this->micro, - 'timestamp' => $this->timestamp, - 'formatted' => $this->rawFormat(\defined('static::DEFAULT_TO_STRING_FORMAT') ? static::DEFAULT_TO_STRING_FORMAT : CarbonInterface::DEFAULT_TO_STRING_FORMAT), - 'timezone' => $this->timezone, - ]; - } - - /** - * Get default object representation. - * - * @example - * ``` - * var_dump(Carbon::now()->toObject()); - * ``` - * - * @return object - */ - public function toObject() - { - return (object) $this->toArray(); - } - - /** - * Returns english human readable complete date string. - * - * @example - * ``` - * echo Carbon::now()->toString(); - * ``` - * - * @return string - */ - public function toString() - { - return $this->avoidMutation()->locale('en')->isoFormat('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ'); - } - - /** - * Return the ISO-8601 string (ex: 1977-04-22T06:00:00Z, if $keepOffset truthy, offset will be kept: - * 1977-04-22T01:00:00-05:00). - * - * @example - * ``` - * echo Carbon::now('America/Toronto')->toISOString() . "\n"; - * echo Carbon::now('America/Toronto')->toISOString(true) . "\n"; - * ``` - * - * @param bool $keepOffset Pass true to keep the date offset. Else forced to UTC. - * - * @return null|string - */ - public function toISOString($keepOffset = false) - { - if (!$this->isValid()) { - return null; - } - - $yearFormat = $this->year < 0 || $this->year > 9999 ? 'YYYYYY' : 'YYYY'; - $tzFormat = $keepOffset ? 'Z' : '[Z]'; - $date = $keepOffset ? $this : $this->avoidMutation()->utc(); - - return $date->isoFormat("$yearFormat-MM-DD[T]HH:mm:ss.SSSSSS$tzFormat"); - } - - /** - * Return the ISO-8601 string (ex: 1977-04-22T06:00:00Z) with UTC timezone. - * - * @example - * ``` - * echo Carbon::now('America/Toronto')->toJSON(); - * ``` - * - * @return null|string - */ - public function toJSON() - { - return $this->toISOString(); - } - - /** - * Return native DateTime PHP object matching the current instance. - * - * @example - * ``` - * var_dump(Carbon::now()->toDateTime()); - * ``` - * - * @return DateTime - */ - public function toDateTime() - { - return new DateTime($this->rawFormat('Y-m-d H:i:s.u'), $this->getTimezone()); - } - - /** - * Return native toDateTimeImmutable PHP object matching the current instance. - * - * @example - * ``` - * var_dump(Carbon::now()->toDateTimeImmutable()); - * ``` - * - * @return DateTimeImmutable - */ - public function toDateTimeImmutable() - { - return new DateTimeImmutable($this->rawFormat('Y-m-d H:i:s.u'), $this->getTimezone()); - } - - /** - * @alias toDateTime - * - * Return native DateTime PHP object matching the current instance. - * - * @example - * ``` - * var_dump(Carbon::now()->toDate()); - * ``` - * - * @return DateTime - */ - public function toDate() - { - return $this->toDateTime(); - } - - /** - * Create a iterable CarbonPeriod object from current date to a given end date (and optional interval). - * - * @param \DateTimeInterface|Carbon|CarbonImmutable|int|null $end period end date or recurrences count if int - * @param int|\DateInterval|string|null $interval period default interval or number of the given $unit - * @param string|null $unit if specified, $interval must be an integer - * - * @return CarbonPeriod - */ - public function toPeriod($end = null, $interval = null, $unit = null) - { - if ($unit) { - $interval = CarbonInterval::make("$interval ".static::pluralUnit($unit)); - } - - $period = (new CarbonPeriod())->setDateClass(static::class)->setStartDate($this); - - if ($interval) { - $period->setDateInterval($interval); - } - - if (\is_int($end) || (\is_string($end) && ctype_digit($end))) { - $period->setRecurrences($end); - } elseif ($end) { - $period->setEndDate($end); - } - - return $period; - } - - /** - * Create a iterable CarbonPeriod object from current date to a given end date (and optional interval). - * - * @param \DateTimeInterface|Carbon|CarbonImmutable|null $end period end date - * @param int|\DateInterval|string|null $interval period default interval or number of the given $unit - * @param string|null $unit if specified, $interval must be an integer - * - * @return CarbonPeriod - */ - public function range($end = null, $interval = null, $unit = null) - { - return $this->toPeriod($end, $interval, $unit); - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php b/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php deleted file mode 100644 index be2c0f7c..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php +++ /dev/null @@ -1,950 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Traits; - -use Carbon\Carbon; -use Carbon\CarbonImmutable; -use Carbon\CarbonInterface; -use Carbon\Exceptions\InvalidDateException; -use Carbon\Exceptions\InvalidFormatException; -use Carbon\Exceptions\OutOfRangeException; -use Carbon\Translator; -use Closure; -use DateTimeInterface; -use DateTimeZone; -use Exception; -use ReturnTypeWillChange; - -/** - * Trait Creator. - * - * Static creators. - * - * Depends on the following methods: - * - * @method static Carbon|CarbonImmutable getTestNow() - */ -trait Creator -{ - use ObjectInitialisation; - - /** - * The errors that can occur. - * - * @var array - */ - protected static $lastErrors; - - /** - * Create a new Carbon instance. - * - * Please see the testing aids section (specifically static::setTestNow()) - * for more on the possibility of this constructor returning a test instance. - * - * @param DateTimeInterface|string|null $time - * @param DateTimeZone|string|null $tz - * - * @throws InvalidFormatException - */ - public function __construct($time = null, $tz = null) - { - if ($time instanceof DateTimeInterface) { - $time = $this->constructTimezoneFromDateTime($time, $tz)->format('Y-m-d H:i:s.u'); - } - - if (is_numeric($time) && (!\is_string($time) || !preg_match('/^\d{1,14}$/', $time))) { - $time = static::createFromTimestampUTC($time)->format('Y-m-d\TH:i:s.uP'); - } - - // If the class has a test now set and we are trying to create a now() - // instance then override as required - $isNow = empty($time) || $time === 'now'; - - if (method_exists(static::class, 'hasTestNow') && - method_exists(static::class, 'getTestNow') && - static::hasTestNow() && - ($isNow || static::hasRelativeKeywords($time)) - ) { - static::mockConstructorParameters($time, $tz); - } - - // Work-around for PHP bug https://bugs.php.net/bug.php?id=67127 - if (!str_contains((string) .1, '.')) { - $locale = setlocale(LC_NUMERIC, '0'); // @codeCoverageIgnore - setlocale(LC_NUMERIC, 'C'); // @codeCoverageIgnore - } - - try { - parent::__construct($time ?: 'now', static::safeCreateDateTimeZone($tz) ?: null); - } catch (Exception $exception) { - throw new InvalidFormatException($exception->getMessage(), 0, $exception); - } - - $this->constructedObjectId = spl_object_hash($this); - - if (isset($locale)) { - setlocale(LC_NUMERIC, $locale); // @codeCoverageIgnore - } - - self::setLastErrors(parent::getLastErrors()); - } - - /** - * Get timezone from a datetime instance. - * - * @param DateTimeInterface $date - * @param DateTimeZone|string|null $tz - * - * @return DateTimeInterface - */ - private function constructTimezoneFromDateTime(DateTimeInterface $date, &$tz) - { - if ($tz !== null) { - $safeTz = static::safeCreateDateTimeZone($tz); - - if ($safeTz) { - return $date->setTimezone($safeTz); - } - - return $date; - } - - $tz = $date->getTimezone(); - - return $date; - } - - /** - * Update constructedObjectId on cloned. - */ - public function __clone() - { - $this->constructedObjectId = spl_object_hash($this); - } - - /** - * Create a Carbon instance from a DateTime one. - * - * @param DateTimeInterface $date - * - * @return static - */ - public static function instance($date) - { - if ($date instanceof static) { - return clone $date; - } - - static::expectDateTime($date); - - $instance = new static($date->format('Y-m-d H:i:s.u'), $date->getTimezone()); - - if ($date instanceof CarbonInterface) { - $settings = $date->getSettings(); - - if (!$date->hasLocalTranslator()) { - unset($settings['locale']); - } - - $instance->settings($settings); - } - - return $instance; - } - - /** - * Create a carbon instance from a string. - * - * This is an alias for the constructor that allows better fluent syntax - * as it allows you to do Carbon::parse('Monday next week')->fn() rather - * than (new Carbon('Monday next week'))->fn(). - * - * @param string|DateTimeInterface|null $time - * @param DateTimeZone|string|null $tz - * - * @throws InvalidFormatException - * - * @return static - */ - public static function rawParse($time = null, $tz = null) - { - if ($time instanceof DateTimeInterface) { - return static::instance($time); - } - - try { - return new static($time, $tz); - } catch (Exception $exception) { - $date = @static::now($tz)->change($time); - - if (!$date) { - throw new InvalidFormatException("Could not parse '$time': ".$exception->getMessage(), 0, $exception); - } - - return $date; - } - } - - /** - * Create a carbon instance from a string. - * - * This is an alias for the constructor that allows better fluent syntax - * as it allows you to do Carbon::parse('Monday next week')->fn() rather - * than (new Carbon('Monday next week'))->fn(). - * - * @param string|DateTimeInterface|null $time - * @param DateTimeZone|string|null $tz - * - * @throws InvalidFormatException - * - * @return static - */ - public static function parse($time = null, $tz = null) - { - $function = static::$parseFunction; - - if (!$function) { - return static::rawParse($time, $tz); - } - - if (\is_string($function) && method_exists(static::class, $function)) { - $function = [static::class, $function]; - } - - return $function(...\func_get_args()); - } - - /** - * Create a carbon instance from a localized string (in French, Japanese, Arabic, etc.). - * - * @param string $time date/time string in the given language (may also contain English). - * @param string|null $locale if locale is null or not specified, current global locale will be - * used instead. - * @param DateTimeZone|string|null $tz optional timezone for the new instance. - * - * @throws InvalidFormatException - * - * @return static - */ - public static function parseFromLocale($time, $locale = null, $tz = null) - { - return static::rawParse(static::translateTimeString($time, $locale, 'en'), $tz); - } - - /** - * Get a Carbon instance for the current date and time. - * - * @param DateTimeZone|string|null $tz - * - * @return static - */ - public static function now($tz = null) - { - return new static(null, $tz); - } - - /** - * Create a Carbon instance for today. - * - * @param DateTimeZone|string|null $tz - * - * @return static - */ - public static function today($tz = null) - { - return static::rawParse('today', $tz); - } - - /** - * Create a Carbon instance for tomorrow. - * - * @param DateTimeZone|string|null $tz - * - * @return static - */ - public static function tomorrow($tz = null) - { - return static::rawParse('tomorrow', $tz); - } - - /** - * Create a Carbon instance for yesterday. - * - * @param DateTimeZone|string|null $tz - * - * @return static - */ - public static function yesterday($tz = null) - { - return static::rawParse('yesterday', $tz); - } - - /** - * Create a Carbon instance for the greatest supported date. - * - * @return static - */ - public static function maxValue() - { - if (self::$PHPIntSize === 4) { - // 32 bit - return static::createFromTimestamp(PHP_INT_MAX); // @codeCoverageIgnore - } - - // 64 bit - return static::create(9999, 12, 31, 23, 59, 59); - } - - /** - * Create a Carbon instance for the lowest supported date. - * - * @return static - */ - public static function minValue() - { - if (self::$PHPIntSize === 4) { - // 32 bit - return static::createFromTimestamp(~PHP_INT_MAX); // @codeCoverageIgnore - } - - // 64 bit - return static::create(1, 1, 1, 0, 0, 0); - } - - private static function assertBetween($unit, $value, $min, $max) - { - if (static::isStrictModeEnabled() && ($value < $min || $value > $max)) { - throw new OutOfRangeException($unit, $min, $max, $value); - } - } - - private static function createNowInstance($tz) - { - if (!static::hasTestNow()) { - return static::now($tz); - } - - $now = static::getTestNow(); - - if ($now instanceof Closure) { - return $now(static::now($tz)); - } - - return $now->avoidMutation()->tz($tz); - } - - /** - * Create a new Carbon instance from a specific date and time. - * - * If any of $year, $month or $day are set to null their now() values will - * be used. - * - * If $hour is null it will be set to its now() value and the default - * values for $minute and $second will be their now() values. - * - * If $hour is not null then the default values for $minute and $second - * will be 0. - * - * @param int|null $year - * @param int|null $month - * @param int|null $day - * @param int|null $hour - * @param int|null $minute - * @param int|null $second - * @param DateTimeZone|string|null $tz - * - * @throws InvalidFormatException - * - * @return static|false - */ - public static function create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $tz = null) - { - if ((\is_string($year) && !is_numeric($year)) || $year instanceof DateTimeInterface) { - return static::parse($year, $tz ?: (\is_string($month) || $month instanceof DateTimeZone ? $month : null)); - } - - $defaults = null; - $getDefault = function ($unit) use ($tz, &$defaults) { - if ($defaults === null) { - $now = self::createNowInstance($tz); - - $defaults = array_combine([ - 'year', - 'month', - 'day', - 'hour', - 'minute', - 'second', - ], explode('-', $now->rawFormat('Y-n-j-G-i-s.u'))); - } - - return $defaults[$unit]; - }; - - $year = $year ?? $getDefault('year'); - $month = $month ?? $getDefault('month'); - $day = $day ?? $getDefault('day'); - $hour = $hour ?? $getDefault('hour'); - $minute = $minute ?? $getDefault('minute'); - $second = (float) ($second ?? $getDefault('second')); - - self::assertBetween('month', $month, 0, 99); - self::assertBetween('day', $day, 0, 99); - self::assertBetween('hour', $hour, 0, 99); - self::assertBetween('minute', $minute, 0, 99); - self::assertBetween('second', $second, 0, 99); - - $fixYear = null; - - if ($year < 0) { - $fixYear = $year; - $year = 0; - } elseif ($year > 9999) { - $fixYear = $year - 9999; - $year = 9999; - } - - $second = ($second < 10 ? '0' : '').number_format($second, 6); - $instance = static::rawCreateFromFormat('!Y-n-j G:i:s.u', sprintf('%s-%s-%s %s:%02s:%02s', $year, $month, $day, $hour, $minute, $second), $tz); - - if ($fixYear !== null) { - $instance = $instance->addYears($fixYear); - } - - return $instance; - } - - /** - * Create a new safe Carbon instance from a specific date and time. - * - * If any of $year, $month or $day are set to null their now() values will - * be used. - * - * If $hour is null it will be set to its now() value and the default - * values for $minute and $second will be their now() values. - * - * If $hour is not null then the default values for $minute and $second - * will be 0. - * - * If one of the set values is not valid, an InvalidDateException - * will be thrown. - * - * @param int|null $year - * @param int|null $month - * @param int|null $day - * @param int|null $hour - * @param int|null $minute - * @param int|null $second - * @param DateTimeZone|string|null $tz - * - * @throws InvalidDateException - * - * @return static|false - */ - public static function createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null) - { - $fields = static::getRangesByUnit(); - - foreach ($fields as $field => $range) { - if ($$field !== null && (!\is_int($$field) || $$field < $range[0] || $$field > $range[1])) { - if (static::isStrictModeEnabled()) { - throw new InvalidDateException($field, $$field); - } - - return false; - } - } - - $instance = static::create($year, $month, $day, $hour, $minute, $second, $tz); - - foreach (array_reverse($fields) as $field => $range) { - if ($$field !== null && (!\is_int($$field) || $$field !== $instance->$field)) { - if (static::isStrictModeEnabled()) { - throw new InvalidDateException($field, $$field); - } - - return false; - } - } - - return $instance; - } - - /** - * Create a new Carbon instance from a specific date and time using strict validation. - * - * @see create() - * - * @param int|null $year - * @param int|null $month - * @param int|null $day - * @param int|null $hour - * @param int|null $minute - * @param int|null $second - * @param DateTimeZone|string|null $tz - * - * @throws InvalidFormatException - * - * @return static - */ - public static function createStrict(?int $year = 0, ?int $month = 1, ?int $day = 1, ?int $hour = 0, ?int $minute = 0, ?int $second = 0, $tz = null): self - { - $initialStrictMode = static::isStrictModeEnabled(); - static::useStrictMode(true); - - try { - $date = static::create($year, $month, $day, $hour, $minute, $second, $tz); - } finally { - static::useStrictMode($initialStrictMode); - } - - return $date; - } - - /** - * Create a Carbon instance from just a date. The time portion is set to now. - * - * @param int|null $year - * @param int|null $month - * @param int|null $day - * @param DateTimeZone|string|null $tz - * - * @throws InvalidFormatException - * - * @return static - */ - public static function createFromDate($year = null, $month = null, $day = null, $tz = null) - { - return static::create($year, $month, $day, null, null, null, $tz); - } - - /** - * Create a Carbon instance from just a date. The time portion is set to midnight. - * - * @param int|null $year - * @param int|null $month - * @param int|null $day - * @param DateTimeZone|string|null $tz - * - * @throws InvalidFormatException - * - * @return static - */ - public static function createMidnightDate($year = null, $month = null, $day = null, $tz = null) - { - return static::create($year, $month, $day, 0, 0, 0, $tz); - } - - /** - * Create a Carbon instance from just a time. The date portion is set to today. - * - * @param int|null $hour - * @param int|null $minute - * @param int|null $second - * @param DateTimeZone|string|null $tz - * - * @throws InvalidFormatException - * - * @return static - */ - public static function createFromTime($hour = 0, $minute = 0, $second = 0, $tz = null) - { - return static::create(null, null, null, $hour, $minute, $second, $tz); - } - - /** - * Create a Carbon instance from a time string. The date portion is set to today. - * - * @param string $time - * @param DateTimeZone|string|null $tz - * - * @throws InvalidFormatException - * - * @return static - */ - public static function createFromTimeString($time, $tz = null) - { - return static::today($tz)->setTimeFromTimeString($time); - } - - /** - * @param string $format Datetime format - * @param string $time - * @param DateTimeZone|string|false|null $originalTz - * - * @return DateTimeInterface|false - */ - private static function createFromFormatAndTimezone($format, $time, $originalTz) - { - // Work-around for https://bugs.php.net/bug.php?id=75577 - // @codeCoverageIgnoreStart - if (version_compare(PHP_VERSION, '7.3.0-dev', '<')) { - $format = str_replace('.v', '.u', $format); - } - // @codeCoverageIgnoreEnd - - if ($originalTz === null) { - return parent::createFromFormat($format, (string) $time); - } - - $tz = \is_int($originalTz) - ? @timezone_name_from_abbr('', (int) ($originalTz * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE), 1) - : $originalTz; - - $tz = static::safeCreateDateTimeZone($tz, $originalTz); - - if ($tz === false) { - return false; - } - - return parent::createFromFormat($format, (string) $time, $tz); - } - - /** - * Create a Carbon instance from a specific format. - * - * @param string $format Datetime format - * @param string $time - * @param DateTimeZone|string|false|null $tz - * - * @throws InvalidFormatException - * - * @return static|false - */ - public static function rawCreateFromFormat($format, $time, $tz = null) - { - // Work-around for https://bugs.php.net/bug.php?id=80141 - $format = preg_replace('/(?<!\\\\)((?:\\\\{2})*)c/', '$1Y-m-d\TH:i:sP', $format); - - if (preg_match('/(?<!\\\\)(?:\\\\{2})*(a|A)/', $format, $aMatches, PREG_OFFSET_CAPTURE) && - preg_match('/(?<!\\\\)(?:\\\\{2})*(h|g|H|G)/', $format, $hMatches, PREG_OFFSET_CAPTURE) && - $aMatches[1][1] < $hMatches[1][1] && - preg_match('/(am|pm|AM|PM)/', $time) - ) { - $format = preg_replace('/^(.*)(?<!\\\\)((?:\\\\{2})*)(a|A)(.*)$/U', '$1$2$4 $3', $format); - $time = preg_replace('/^(.*)(am|pm|AM|PM)(.*)$/U', '$1$3 $2', $time); - } - - // First attempt to create an instance, so that error messages are based on the unmodified format. - $date = self::createFromFormatAndTimezone($format, $time, $tz); - $lastErrors = parent::getLastErrors(); - /** @var \Carbon\CarbonImmutable|\Carbon\Carbon|null $mock */ - $mock = static::getMockedTestNow($tz); - - if ($mock && $date instanceof DateTimeInterface) { - // Set timezone from mock if custom timezone was neither given directly nor as a part of format. - // First let's skip the part that will be ignored by the parser. - $nonEscaped = '(?<!\\\\)(\\\\{2})*'; - - $nonIgnored = preg_replace("/^.*{$nonEscaped}!/s", '', $format); - - if ($tz === null && !preg_match("/{$nonEscaped}[eOPT]/", $nonIgnored)) { - $tz = clone $mock->getTimezone(); - } - - // Set microseconds to zero to match behavior of DateTime::createFromFormat() - // See https://bugs.php.net/bug.php?id=74332 - $mock = $mock->copy()->microsecond(0); - - // Prepend mock datetime only if the format does not contain non escaped unix epoch reset flag. - if (!preg_match("/{$nonEscaped}[!|]/", $format)) { - $format = static::MOCK_DATETIME_FORMAT.' '.$format; - $time = ($mock instanceof self ? $mock->rawFormat(static::MOCK_DATETIME_FORMAT) : $mock->format(static::MOCK_DATETIME_FORMAT)).' '.$time; - } - - // Regenerate date from the modified format to base result on the mocked instance instead of now. - $date = self::createFromFormatAndTimezone($format, $time, $tz); - } - - if ($date instanceof DateTimeInterface) { - $instance = static::instance($date); - $instance::setLastErrors($lastErrors); - - return $instance; - } - - if (static::isStrictModeEnabled()) { - throw new InvalidFormatException(implode(PHP_EOL, $lastErrors['errors'])); - } - - return false; - } - - /** - * Create a Carbon instance from a specific format. - * - * @param string $format Datetime format - * @param string $time - * @param DateTimeZone|string|false|null $tz - * - * @throws InvalidFormatException - * - * @return static|false - */ - #[ReturnTypeWillChange] - public static function createFromFormat($format, $time, $tz = null) - { - $function = static::$createFromFormatFunction; - - if (!$function) { - return static::rawCreateFromFormat($format, $time, $tz); - } - - if (\is_string($function) && method_exists(static::class, $function)) { - $function = [static::class, $function]; - } - - return $function(...\func_get_args()); - } - - /** - * Create a Carbon instance from a specific ISO format (same replacements as ->isoFormat()). - * - * @param string $format Datetime format - * @param string $time - * @param DateTimeZone|string|false|null $tz optional timezone - * @param string|null $locale locale to be used for LTS, LT, LL, LLL, etc. macro-formats (en by fault, unneeded if no such macro-format in use) - * @param \Symfony\Component\Translation\TranslatorInterface $translator optional custom translator to use for macro-formats - * - * @throws InvalidFormatException - * - * @return static|false - */ - public static function createFromIsoFormat($format, $time, $tz = null, $locale = 'en', $translator = null) - { - $format = preg_replace_callback('/(?<!\\\\)(\\\\{2})*(LTS|LT|[Ll]{1,4})/', function ($match) use ($locale, $translator) { - [$code] = $match; - - static $formats = null; - - if ($formats === null) { - $translator = $translator ?: Translator::get($locale); - - $formats = [ - 'LT' => static::getTranslationMessageWith($translator, 'formats.LT', $locale, 'h:mm A'), - 'LTS' => static::getTranslationMessageWith($translator, 'formats.LTS', $locale, 'h:mm:ss A'), - 'L' => static::getTranslationMessageWith($translator, 'formats.L', $locale, 'MM/DD/YYYY'), - 'LL' => static::getTranslationMessageWith($translator, 'formats.LL', $locale, 'MMMM D, YYYY'), - 'LLL' => static::getTranslationMessageWith($translator, 'formats.LLL', $locale, 'MMMM D, YYYY h:mm A'), - 'LLLL' => static::getTranslationMessageWith($translator, 'formats.LLLL', $locale, 'dddd, MMMM D, YYYY h:mm A'), - ]; - } - - return $formats[$code] ?? preg_replace_callback( - '/MMMM|MM|DD|dddd/', - function ($code) { - return mb_substr($code[0], 1); - }, - $formats[strtoupper($code)] ?? '' - ); - }, $format); - - $format = preg_replace_callback('/(?<!\\\\)(\\\\{2})*('.CarbonInterface::ISO_FORMAT_REGEXP.'|[A-Za-z])/', function ($match) { - [$code] = $match; - - static $replacements = null; - - if ($replacements === null) { - $replacements = [ - 'OD' => 'd', - 'OM' => 'M', - 'OY' => 'Y', - 'OH' => 'G', - 'Oh' => 'g', - 'Om' => 'i', - 'Os' => 's', - 'D' => 'd', - 'DD' => 'd', - 'Do' => 'd', - 'd' => '!', - 'dd' => '!', - 'ddd' => 'D', - 'dddd' => 'D', - 'DDD' => 'z', - 'DDDD' => 'z', - 'DDDo' => 'z', - 'e' => '!', - 'E' => '!', - 'H' => 'G', - 'HH' => 'H', - 'h' => 'g', - 'hh' => 'h', - 'k' => 'G', - 'kk' => 'G', - 'hmm' => 'gi', - 'hmmss' => 'gis', - 'Hmm' => 'Gi', - 'Hmmss' => 'Gis', - 'm' => 'i', - 'mm' => 'i', - 'a' => 'a', - 'A' => 'a', - 's' => 's', - 'ss' => 's', - 'S' => '*', - 'SS' => '*', - 'SSS' => '*', - 'SSSS' => '*', - 'SSSSS' => '*', - 'SSSSSS' => 'u', - 'SSSSSSS' => 'u*', - 'SSSSSSSS' => 'u*', - 'SSSSSSSSS' => 'u*', - 'M' => 'm', - 'MM' => 'm', - 'MMM' => 'M', - 'MMMM' => 'M', - 'Mo' => 'm', - 'Q' => '!', - 'Qo' => '!', - 'G' => '!', - 'GG' => '!', - 'GGG' => '!', - 'GGGG' => '!', - 'GGGGG' => '!', - 'g' => '!', - 'gg' => '!', - 'ggg' => '!', - 'gggg' => '!', - 'ggggg' => '!', - 'W' => '!', - 'WW' => '!', - 'Wo' => '!', - 'w' => '!', - 'ww' => '!', - 'wo' => '!', - 'x' => 'U???', - 'X' => 'U', - 'Y' => 'Y', - 'YY' => 'y', - 'YYYY' => 'Y', - 'YYYYY' => 'Y', - 'YYYYYY' => 'Y', - 'z' => 'e', - 'zz' => 'e', - 'Z' => 'e', - 'ZZ' => 'e', - ]; - } - - $format = $replacements[$code] ?? '?'; - - if ($format === '!') { - throw new InvalidFormatException("Format $code not supported for creation."); - } - - return $format; - }, $format); - - return static::rawCreateFromFormat($format, $time, $tz); - } - - /** - * Create a Carbon instance from a specific format and a string in a given language. - * - * @param string $format Datetime format - * @param string $locale - * @param string $time - * @param DateTimeZone|string|false|null $tz - * - * @throws InvalidFormatException - * - * @return static|false - */ - public static function createFromLocaleFormat($format, $locale, $time, $tz = null) - { - return static::rawCreateFromFormat($format, static::translateTimeString($time, $locale, 'en'), $tz); - } - - /** - * Create a Carbon instance from a specific ISO format and a string in a given language. - * - * @param string $format Datetime ISO format - * @param string $locale - * @param string $time - * @param DateTimeZone|string|false|null $tz - * - * @throws InvalidFormatException - * - * @return static|false - */ - public static function createFromLocaleIsoFormat($format, $locale, $time, $tz = null) - { - $time = static::translateTimeString($time, $locale, 'en', CarbonInterface::TRANSLATE_MONTHS | CarbonInterface::TRANSLATE_DAYS | CarbonInterface::TRANSLATE_MERIDIEM); - - return static::createFromIsoFormat($format, $time, $tz, $locale); - } - - /** - * Make a Carbon instance from given variable if possible. - * - * Always return a new instance. Parse only strings and only these likely to be dates (skip intervals - * and recurrences). Throw an exception for invalid format, but otherwise return null. - * - * @param mixed $var - * - * @throws InvalidFormatException - * - * @return static|null - */ - public static function make($var) - { - if ($var instanceof DateTimeInterface) { - return static::instance($var); - } - - $date = null; - - if (\is_string($var)) { - $var = trim($var); - - if (!preg_match('/^P[\dT]/', $var) && - !preg_match('/^R\d/', $var) && - preg_match('/[a-z\d]/i', $var) - ) { - $date = static::parse($var); - } - } - - return $date; - } - - /** - * Set last errors. - * - * @param array|bool $lastErrors - * - * @return void - */ - private static function setLastErrors($lastErrors) - { - if (\is_array($lastErrors) || $lastErrors === false) { - static::$lastErrors = \is_array($lastErrors) ? $lastErrors : [ - 'warning_count' => 0, - 'warnings' => [], - 'error_count' => 0, - 'errors' => [], - ]; - } - } - - /** - * {@inheritdoc} - * - * @return array - */ - #[ReturnTypeWillChange] - public static function getLastErrors() - { - return static::$lastErrors; - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Date.php b/vendor/nesbot/carbon/src/Carbon/Traits/Date.php deleted file mode 100644 index da3775c2..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Date.php +++ /dev/null @@ -1,2746 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Traits; - -use BadMethodCallException; -use Carbon\Carbon; -use Carbon\CarbonInterface; -use Carbon\CarbonPeriod; -use Carbon\CarbonTimeZone; -use Carbon\Exceptions\BadComparisonUnitException; -use Carbon\Exceptions\ImmutableException; -use Carbon\Exceptions\InvalidTimeZoneException; -use Carbon\Exceptions\InvalidTypeException; -use Carbon\Exceptions\UnknownGetterException; -use Carbon\Exceptions\UnknownMethodException; -use Carbon\Exceptions\UnknownSetterException; -use Carbon\Exceptions\UnknownUnitException; -use Closure; -use DateInterval; -use DatePeriod; -use DateTime; -use DateTimeImmutable; -use DateTimeInterface; -use DateTimeZone; -use InvalidArgumentException; -use ReflectionException; -use ReturnTypeWillChange; -use Throwable; - -/** - * A simple API extension for DateTime. - * - * @mixin DeprecatedProperties - * - * <autodoc generated by `composer phpdoc`> - * - * @property int $year - * @property int $yearIso - * @property int $month - * @property int $day - * @property int $hour - * @property int $minute - * @property int $second - * @property int $micro - * @property int $microsecond - * @property int|float|string $timestamp seconds since the Unix Epoch - * @property string $englishDayOfWeek the day of week in English - * @property string $shortEnglishDayOfWeek the abbreviated day of week in English - * @property string $englishMonth the month in English - * @property string $shortEnglishMonth the abbreviated month in English - * @property int $milliseconds - * @property int $millisecond - * @property int $milli - * @property int $week 1 through 53 - * @property int $isoWeek 1 through 53 - * @property int $weekYear year according to week format - * @property int $isoWeekYear year according to ISO week format - * @property int $dayOfYear 1 through 366 - * @property int $age does a diffInYears() with default parameters - * @property int $offset the timezone offset in seconds from UTC - * @property int $offsetMinutes the timezone offset in minutes from UTC - * @property int $offsetHours the timezone offset in hours from UTC - * @property CarbonTimeZone $timezone the current timezone - * @property CarbonTimeZone $tz alias of $timezone - * @property-read int $dayOfWeek 0 (for Sunday) through 6 (for Saturday) - * @property-read int $dayOfWeekIso 1 (for Monday) through 7 (for Sunday) - * @property-read int $weekOfYear ISO-8601 week number of year, weeks starting on Monday - * @property-read int $daysInMonth number of days in the given month - * @property-read string $latinMeridiem "am"/"pm" (Ante meridiem or Post meridiem latin lowercase mark) - * @property-read string $latinUpperMeridiem "AM"/"PM" (Ante meridiem or Post meridiem latin uppercase mark) - * @property-read string $timezoneAbbreviatedName the current timezone abbreviated name - * @property-read string $tzAbbrName alias of $timezoneAbbreviatedName - * @property-read string $dayName long name of weekday translated according to Carbon locale, in english if no translation available for current language - * @property-read string $shortDayName short name of weekday translated according to Carbon locale, in english if no translation available for current language - * @property-read string $minDayName very short name of weekday translated according to Carbon locale, in english if no translation available for current language - * @property-read string $monthName long name of month translated according to Carbon locale, in english if no translation available for current language - * @property-read string $shortMonthName short name of month translated according to Carbon locale, in english if no translation available for current language - * @property-read string $meridiem lowercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language - * @property-read string $upperMeridiem uppercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language - * @property-read int $noZeroHour current hour from 1 to 24 - * @property-read int $weeksInYear 51 through 53 - * @property-read int $isoWeeksInYear 51 through 53 - * @property-read int $weekOfMonth 1 through 5 - * @property-read int $weekNumberInMonth 1 through 5 - * @property-read int $firstWeekDay 0 through 6 - * @property-read int $lastWeekDay 0 through 6 - * @property-read int $daysInYear 365 or 366 - * @property-read int $quarter the quarter of this instance, 1 - 4 - * @property-read int $decade the decade of this instance - * @property-read int $century the century of this instance - * @property-read int $millennium the millennium of this instance - * @property-read bool $dst daylight savings time indicator, true if DST, false otherwise - * @property-read bool $local checks if the timezone is local, true if local, false otherwise - * @property-read bool $utc checks if the timezone is UTC, true if UTC, false otherwise - * @property-read string $timezoneName the current timezone name - * @property-read string $tzName alias of $timezoneName - * @property-read string $locale locale of the current instance - * - * @method bool isUtc() Check if the current instance has UTC timezone. (Both isUtc and isUTC cases are valid.) - * @method bool isLocal() Check if the current instance has non-UTC timezone. - * @method bool isValid() Check if the current instance is a valid date. - * @method bool isDST() Check if the current instance is in a daylight saving time. - * @method bool isSunday() Checks if the instance day is sunday. - * @method bool isMonday() Checks if the instance day is monday. - * @method bool isTuesday() Checks if the instance day is tuesday. - * @method bool isWednesday() Checks if the instance day is wednesday. - * @method bool isThursday() Checks if the instance day is thursday. - * @method bool isFriday() Checks if the instance day is friday. - * @method bool isSaturday() Checks if the instance day is saturday. - * @method bool isSameYear(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same year as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentYear() Checks if the instance is in the same year as the current moment. - * @method bool isNextYear() Checks if the instance is in the same year as the current moment next year. - * @method bool isLastYear() Checks if the instance is in the same year as the current moment last year. - * @method bool isSameWeek(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same week as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentWeek() Checks if the instance is in the same week as the current moment. - * @method bool isNextWeek() Checks if the instance is in the same week as the current moment next week. - * @method bool isLastWeek() Checks if the instance is in the same week as the current moment last week. - * @method bool isSameDay(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same day as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentDay() Checks if the instance is in the same day as the current moment. - * @method bool isNextDay() Checks if the instance is in the same day as the current moment next day. - * @method bool isLastDay() Checks if the instance is in the same day as the current moment last day. - * @method bool isSameHour(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same hour as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentHour() Checks if the instance is in the same hour as the current moment. - * @method bool isNextHour() Checks if the instance is in the same hour as the current moment next hour. - * @method bool isLastHour() Checks if the instance is in the same hour as the current moment last hour. - * @method bool isSameMinute(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same minute as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentMinute() Checks if the instance is in the same minute as the current moment. - * @method bool isNextMinute() Checks if the instance is in the same minute as the current moment next minute. - * @method bool isLastMinute() Checks if the instance is in the same minute as the current moment last minute. - * @method bool isSameSecond(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same second as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentSecond() Checks if the instance is in the same second as the current moment. - * @method bool isNextSecond() Checks if the instance is in the same second as the current moment next second. - * @method bool isLastSecond() Checks if the instance is in the same second as the current moment last second. - * @method bool isSameMicro(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentMicro() Checks if the instance is in the same microsecond as the current moment. - * @method bool isNextMicro() Checks if the instance is in the same microsecond as the current moment next microsecond. - * @method bool isLastMicro() Checks if the instance is in the same microsecond as the current moment last microsecond. - * @method bool isSameMicrosecond(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentMicrosecond() Checks if the instance is in the same microsecond as the current moment. - * @method bool isNextMicrosecond() Checks if the instance is in the same microsecond as the current moment next microsecond. - * @method bool isLastMicrosecond() Checks if the instance is in the same microsecond as the current moment last microsecond. - * @method bool isCurrentMonth() Checks if the instance is in the same month as the current moment. - * @method bool isNextMonth() Checks if the instance is in the same month as the current moment next month. - * @method bool isLastMonth() Checks if the instance is in the same month as the current moment last month. - * @method bool isCurrentQuarter() Checks if the instance is in the same quarter as the current moment. - * @method bool isNextQuarter() Checks if the instance is in the same quarter as the current moment next quarter. - * @method bool isLastQuarter() Checks if the instance is in the same quarter as the current moment last quarter. - * @method bool isSameDecade(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same decade as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentDecade() Checks if the instance is in the same decade as the current moment. - * @method bool isNextDecade() Checks if the instance is in the same decade as the current moment next decade. - * @method bool isLastDecade() Checks if the instance is in the same decade as the current moment last decade. - * @method bool isSameCentury(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same century as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentCentury() Checks if the instance is in the same century as the current moment. - * @method bool isNextCentury() Checks if the instance is in the same century as the current moment next century. - * @method bool isLastCentury() Checks if the instance is in the same century as the current moment last century. - * @method bool isSameMillennium(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same millennium as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentMillennium() Checks if the instance is in the same millennium as the current moment. - * @method bool isNextMillennium() Checks if the instance is in the same millennium as the current moment next millennium. - * @method bool isLastMillennium() Checks if the instance is in the same millennium as the current moment last millennium. - * @method CarbonInterface years(int $value) Set current instance year to the given value. - * @method CarbonInterface year(int $value) Set current instance year to the given value. - * @method CarbonInterface setYears(int $value) Set current instance year to the given value. - * @method CarbonInterface setYear(int $value) Set current instance year to the given value. - * @method CarbonInterface months(int $value) Set current instance month to the given value. - * @method CarbonInterface month(int $value) Set current instance month to the given value. - * @method CarbonInterface setMonths(int $value) Set current instance month to the given value. - * @method CarbonInterface setMonth(int $value) Set current instance month to the given value. - * @method CarbonInterface days(int $value) Set current instance day to the given value. - * @method CarbonInterface day(int $value) Set current instance day to the given value. - * @method CarbonInterface setDays(int $value) Set current instance day to the given value. - * @method CarbonInterface setDay(int $value) Set current instance day to the given value. - * @method CarbonInterface hours(int $value) Set current instance hour to the given value. - * @method CarbonInterface hour(int $value) Set current instance hour to the given value. - * @method CarbonInterface setHours(int $value) Set current instance hour to the given value. - * @method CarbonInterface setHour(int $value) Set current instance hour to the given value. - * @method CarbonInterface minutes(int $value) Set current instance minute to the given value. - * @method CarbonInterface minute(int $value) Set current instance minute to the given value. - * @method CarbonInterface setMinutes(int $value) Set current instance minute to the given value. - * @method CarbonInterface setMinute(int $value) Set current instance minute to the given value. - * @method CarbonInterface seconds(int $value) Set current instance second to the given value. - * @method CarbonInterface second(int $value) Set current instance second to the given value. - * @method CarbonInterface setSeconds(int $value) Set current instance second to the given value. - * @method CarbonInterface setSecond(int $value) Set current instance second to the given value. - * @method CarbonInterface millis(int $value) Set current instance millisecond to the given value. - * @method CarbonInterface milli(int $value) Set current instance millisecond to the given value. - * @method CarbonInterface setMillis(int $value) Set current instance millisecond to the given value. - * @method CarbonInterface setMilli(int $value) Set current instance millisecond to the given value. - * @method CarbonInterface milliseconds(int $value) Set current instance millisecond to the given value. - * @method CarbonInterface millisecond(int $value) Set current instance millisecond to the given value. - * @method CarbonInterface setMilliseconds(int $value) Set current instance millisecond to the given value. - * @method CarbonInterface setMillisecond(int $value) Set current instance millisecond to the given value. - * @method CarbonInterface micros(int $value) Set current instance microsecond to the given value. - * @method CarbonInterface micro(int $value) Set current instance microsecond to the given value. - * @method CarbonInterface setMicros(int $value) Set current instance microsecond to the given value. - * @method CarbonInterface setMicro(int $value) Set current instance microsecond to the given value. - * @method CarbonInterface microseconds(int $value) Set current instance microsecond to the given value. - * @method CarbonInterface microsecond(int $value) Set current instance microsecond to the given value. - * @method CarbonInterface setMicroseconds(int $value) Set current instance microsecond to the given value. - * @method CarbonInterface setMicrosecond(int $value) Set current instance microsecond to the given value. - * @method CarbonInterface addYears(int $value = 1) Add years (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface addYear() Add one year to the instance (using date interval). - * @method CarbonInterface subYears(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface subYear() Sub one year to the instance (using date interval). - * @method CarbonInterface addYearsWithOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface addYearWithOverflow() Add one year to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface subYearsWithOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface subYearWithOverflow() Sub one year to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface addYearsWithoutOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addYearWithoutOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subYearsWithoutOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subYearWithoutOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addYearsWithNoOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addYearWithNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subYearsWithNoOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subYearWithNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addYearsNoOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addYearNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subYearsNoOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subYearNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addMonths(int $value = 1) Add months (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface addMonth() Add one month to the instance (using date interval). - * @method CarbonInterface subMonths(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface subMonth() Sub one month to the instance (using date interval). - * @method CarbonInterface addMonthsWithOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface addMonthWithOverflow() Add one month to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface subMonthsWithOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface subMonthWithOverflow() Sub one month to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface addMonthsWithoutOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addMonthWithoutOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subMonthsWithoutOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subMonthWithoutOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addMonthsWithNoOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addMonthWithNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subMonthsWithNoOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subMonthWithNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addMonthsNoOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addMonthNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subMonthsNoOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subMonthNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addDays(int $value = 1) Add days (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface addDay() Add one day to the instance (using date interval). - * @method CarbonInterface subDays(int $value = 1) Sub days (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface subDay() Sub one day to the instance (using date interval). - * @method CarbonInterface addHours(int $value = 1) Add hours (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface addHour() Add one hour to the instance (using date interval). - * @method CarbonInterface subHours(int $value = 1) Sub hours (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface subHour() Sub one hour to the instance (using date interval). - * @method CarbonInterface addMinutes(int $value = 1) Add minutes (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface addMinute() Add one minute to the instance (using date interval). - * @method CarbonInterface subMinutes(int $value = 1) Sub minutes (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface subMinute() Sub one minute to the instance (using date interval). - * @method CarbonInterface addSeconds(int $value = 1) Add seconds (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface addSecond() Add one second to the instance (using date interval). - * @method CarbonInterface subSeconds(int $value = 1) Sub seconds (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface subSecond() Sub one second to the instance (using date interval). - * @method CarbonInterface addMillis(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface addMilli() Add one millisecond to the instance (using date interval). - * @method CarbonInterface subMillis(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface subMilli() Sub one millisecond to the instance (using date interval). - * @method CarbonInterface addMilliseconds(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface addMillisecond() Add one millisecond to the instance (using date interval). - * @method CarbonInterface subMilliseconds(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface subMillisecond() Sub one millisecond to the instance (using date interval). - * @method CarbonInterface addMicros(int $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface addMicro() Add one microsecond to the instance (using date interval). - * @method CarbonInterface subMicros(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface subMicro() Sub one microsecond to the instance (using date interval). - * @method CarbonInterface addMicroseconds(int $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface addMicrosecond() Add one microsecond to the instance (using date interval). - * @method CarbonInterface subMicroseconds(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface subMicrosecond() Sub one microsecond to the instance (using date interval). - * @method CarbonInterface addMillennia(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface addMillennium() Add one millennium to the instance (using date interval). - * @method CarbonInterface subMillennia(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface subMillennium() Sub one millennium to the instance (using date interval). - * @method CarbonInterface addMillenniaWithOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface addMillenniumWithOverflow() Add one millennium to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface subMillenniaWithOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface subMillenniumWithOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface addMillenniaWithoutOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addMillenniumWithoutOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subMillenniaWithoutOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subMillenniumWithoutOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addMillenniaWithNoOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addMillenniumWithNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subMillenniaWithNoOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subMillenniumWithNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addMillenniaNoOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addMillenniumNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subMillenniaNoOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subMillenniumNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addCenturies(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface addCentury() Add one century to the instance (using date interval). - * @method CarbonInterface subCenturies(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface subCentury() Sub one century to the instance (using date interval). - * @method CarbonInterface addCenturiesWithOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface addCenturyWithOverflow() Add one century to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface subCenturiesWithOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface subCenturyWithOverflow() Sub one century to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface addCenturiesWithoutOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addCenturyWithoutOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subCenturiesWithoutOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subCenturyWithoutOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addCenturiesWithNoOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addCenturyWithNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subCenturiesWithNoOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subCenturyWithNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addCenturiesNoOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addCenturyNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subCenturiesNoOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subCenturyNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addDecades(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface addDecade() Add one decade to the instance (using date interval). - * @method CarbonInterface subDecades(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface subDecade() Sub one decade to the instance (using date interval). - * @method CarbonInterface addDecadesWithOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface addDecadeWithOverflow() Add one decade to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface subDecadesWithOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface subDecadeWithOverflow() Sub one decade to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface addDecadesWithoutOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addDecadeWithoutOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subDecadesWithoutOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subDecadeWithoutOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addDecadesWithNoOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addDecadeWithNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subDecadesWithNoOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subDecadeWithNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addDecadesNoOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addDecadeNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subDecadesNoOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subDecadeNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addQuarters(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface addQuarter() Add one quarter to the instance (using date interval). - * @method CarbonInterface subQuarters(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface subQuarter() Sub one quarter to the instance (using date interval). - * @method CarbonInterface addQuartersWithOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface addQuarterWithOverflow() Add one quarter to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface subQuartersWithOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface subQuarterWithOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonInterface addQuartersWithoutOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addQuarterWithoutOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subQuartersWithoutOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subQuarterWithoutOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addQuartersWithNoOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addQuarterWithNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subQuartersWithNoOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subQuarterWithNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addQuartersNoOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addQuarterNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subQuartersNoOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface subQuarterNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonInterface addWeeks(int $value = 1) Add weeks (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface addWeek() Add one week to the instance (using date interval). - * @method CarbonInterface subWeeks(int $value = 1) Sub weeks (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface subWeek() Sub one week to the instance (using date interval). - * @method CarbonInterface addWeekdays(int $value = 1) Add weekdays (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface addWeekday() Add one weekday to the instance (using date interval). - * @method CarbonInterface subWeekdays(int $value = 1) Sub weekdays (the $value count passed in) to the instance (using date interval). - * @method CarbonInterface subWeekday() Sub one weekday to the instance (using date interval). - * @method CarbonInterface addRealMicros(int $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface addRealMicro() Add one microsecond to the instance (using timestamp). - * @method CarbonInterface subRealMicros(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface subRealMicro() Sub one microsecond to the instance (using timestamp). - * @method CarbonPeriod microsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given. - * @method CarbonInterface addRealMicroseconds(int $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface addRealMicrosecond() Add one microsecond to the instance (using timestamp). - * @method CarbonInterface subRealMicroseconds(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface subRealMicrosecond() Sub one microsecond to the instance (using timestamp). - * @method CarbonPeriod microsecondsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given. - * @method CarbonInterface addRealMillis(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface addRealMilli() Add one millisecond to the instance (using timestamp). - * @method CarbonInterface subRealMillis(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface subRealMilli() Sub one millisecond to the instance (using timestamp). - * @method CarbonPeriod millisUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given. - * @method CarbonInterface addRealMilliseconds(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface addRealMillisecond() Add one millisecond to the instance (using timestamp). - * @method CarbonInterface subRealMilliseconds(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface subRealMillisecond() Sub one millisecond to the instance (using timestamp). - * @method CarbonPeriod millisecondsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given. - * @method CarbonInterface addRealSeconds(int $value = 1) Add seconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface addRealSecond() Add one second to the instance (using timestamp). - * @method CarbonInterface subRealSeconds(int $value = 1) Sub seconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface subRealSecond() Sub one second to the instance (using timestamp). - * @method CarbonPeriod secondsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each second or every X seconds if a factor is given. - * @method CarbonInterface addRealMinutes(int $value = 1) Add minutes (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface addRealMinute() Add one minute to the instance (using timestamp). - * @method CarbonInterface subRealMinutes(int $value = 1) Sub minutes (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface subRealMinute() Sub one minute to the instance (using timestamp). - * @method CarbonPeriod minutesUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each minute or every X minutes if a factor is given. - * @method CarbonInterface addRealHours(int $value = 1) Add hours (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface addRealHour() Add one hour to the instance (using timestamp). - * @method CarbonInterface subRealHours(int $value = 1) Sub hours (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface subRealHour() Sub one hour to the instance (using timestamp). - * @method CarbonPeriod hoursUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each hour or every X hours if a factor is given. - * @method CarbonInterface addRealDays(int $value = 1) Add days (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface addRealDay() Add one day to the instance (using timestamp). - * @method CarbonInterface subRealDays(int $value = 1) Sub days (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface subRealDay() Sub one day to the instance (using timestamp). - * @method CarbonPeriod daysUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each day or every X days if a factor is given. - * @method CarbonInterface addRealWeeks(int $value = 1) Add weeks (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface addRealWeek() Add one week to the instance (using timestamp). - * @method CarbonInterface subRealWeeks(int $value = 1) Sub weeks (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface subRealWeek() Sub one week to the instance (using timestamp). - * @method CarbonPeriod weeksUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each week or every X weeks if a factor is given. - * @method CarbonInterface addRealMonths(int $value = 1) Add months (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface addRealMonth() Add one month to the instance (using timestamp). - * @method CarbonInterface subRealMonths(int $value = 1) Sub months (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface subRealMonth() Sub one month to the instance (using timestamp). - * @method CarbonPeriod monthsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each month or every X months if a factor is given. - * @method CarbonInterface addRealQuarters(int $value = 1) Add quarters (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface addRealQuarter() Add one quarter to the instance (using timestamp). - * @method CarbonInterface subRealQuarters(int $value = 1) Sub quarters (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface subRealQuarter() Sub one quarter to the instance (using timestamp). - * @method CarbonPeriod quartersUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each quarter or every X quarters if a factor is given. - * @method CarbonInterface addRealYears(int $value = 1) Add years (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface addRealYear() Add one year to the instance (using timestamp). - * @method CarbonInterface subRealYears(int $value = 1) Sub years (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface subRealYear() Sub one year to the instance (using timestamp). - * @method CarbonPeriod yearsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each year or every X years if a factor is given. - * @method CarbonInterface addRealDecades(int $value = 1) Add decades (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface addRealDecade() Add one decade to the instance (using timestamp). - * @method CarbonInterface subRealDecades(int $value = 1) Sub decades (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface subRealDecade() Sub one decade to the instance (using timestamp). - * @method CarbonPeriod decadesUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each decade or every X decades if a factor is given. - * @method CarbonInterface addRealCenturies(int $value = 1) Add centuries (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface addRealCentury() Add one century to the instance (using timestamp). - * @method CarbonInterface subRealCenturies(int $value = 1) Sub centuries (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface subRealCentury() Sub one century to the instance (using timestamp). - * @method CarbonPeriod centuriesUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each century or every X centuries if a factor is given. - * @method CarbonInterface addRealMillennia(int $value = 1) Add millennia (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface addRealMillennium() Add one millennium to the instance (using timestamp). - * @method CarbonInterface subRealMillennia(int $value = 1) Sub millennia (the $value count passed in) to the instance (using timestamp). - * @method CarbonInterface subRealMillennium() Sub one millennium to the instance (using timestamp). - * @method CarbonPeriod millenniaUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millennium or every X millennia if a factor is given. - * @method CarbonInterface roundYear(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. - * @method CarbonInterface roundYears(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. - * @method CarbonInterface floorYear(float $precision = 1) Truncate the current instance year with given precision. - * @method CarbonInterface floorYears(float $precision = 1) Truncate the current instance year with given precision. - * @method CarbonInterface ceilYear(float $precision = 1) Ceil the current instance year with given precision. - * @method CarbonInterface ceilYears(float $precision = 1) Ceil the current instance year with given precision. - * @method CarbonInterface roundMonth(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. - * @method CarbonInterface roundMonths(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. - * @method CarbonInterface floorMonth(float $precision = 1) Truncate the current instance month with given precision. - * @method CarbonInterface floorMonths(float $precision = 1) Truncate the current instance month with given precision. - * @method CarbonInterface ceilMonth(float $precision = 1) Ceil the current instance month with given precision. - * @method CarbonInterface ceilMonths(float $precision = 1) Ceil the current instance month with given precision. - * @method CarbonInterface roundDay(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. - * @method CarbonInterface roundDays(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. - * @method CarbonInterface floorDay(float $precision = 1) Truncate the current instance day with given precision. - * @method CarbonInterface floorDays(float $precision = 1) Truncate the current instance day with given precision. - * @method CarbonInterface ceilDay(float $precision = 1) Ceil the current instance day with given precision. - * @method CarbonInterface ceilDays(float $precision = 1) Ceil the current instance day with given precision. - * @method CarbonInterface roundHour(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. - * @method CarbonInterface roundHours(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. - * @method CarbonInterface floorHour(float $precision = 1) Truncate the current instance hour with given precision. - * @method CarbonInterface floorHours(float $precision = 1) Truncate the current instance hour with given precision. - * @method CarbonInterface ceilHour(float $precision = 1) Ceil the current instance hour with given precision. - * @method CarbonInterface ceilHours(float $precision = 1) Ceil the current instance hour with given precision. - * @method CarbonInterface roundMinute(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. - * @method CarbonInterface roundMinutes(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. - * @method CarbonInterface floorMinute(float $precision = 1) Truncate the current instance minute with given precision. - * @method CarbonInterface floorMinutes(float $precision = 1) Truncate the current instance minute with given precision. - * @method CarbonInterface ceilMinute(float $precision = 1) Ceil the current instance minute with given precision. - * @method CarbonInterface ceilMinutes(float $precision = 1) Ceil the current instance minute with given precision. - * @method CarbonInterface roundSecond(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. - * @method CarbonInterface roundSeconds(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. - * @method CarbonInterface floorSecond(float $precision = 1) Truncate the current instance second with given precision. - * @method CarbonInterface floorSeconds(float $precision = 1) Truncate the current instance second with given precision. - * @method CarbonInterface ceilSecond(float $precision = 1) Ceil the current instance second with given precision. - * @method CarbonInterface ceilSeconds(float $precision = 1) Ceil the current instance second with given precision. - * @method CarbonInterface roundMillennium(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. - * @method CarbonInterface roundMillennia(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. - * @method CarbonInterface floorMillennium(float $precision = 1) Truncate the current instance millennium with given precision. - * @method CarbonInterface floorMillennia(float $precision = 1) Truncate the current instance millennium with given precision. - * @method CarbonInterface ceilMillennium(float $precision = 1) Ceil the current instance millennium with given precision. - * @method CarbonInterface ceilMillennia(float $precision = 1) Ceil the current instance millennium with given precision. - * @method CarbonInterface roundCentury(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. - * @method CarbonInterface roundCenturies(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. - * @method CarbonInterface floorCentury(float $precision = 1) Truncate the current instance century with given precision. - * @method CarbonInterface floorCenturies(float $precision = 1) Truncate the current instance century with given precision. - * @method CarbonInterface ceilCentury(float $precision = 1) Ceil the current instance century with given precision. - * @method CarbonInterface ceilCenturies(float $precision = 1) Ceil the current instance century with given precision. - * @method CarbonInterface roundDecade(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. - * @method CarbonInterface roundDecades(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. - * @method CarbonInterface floorDecade(float $precision = 1) Truncate the current instance decade with given precision. - * @method CarbonInterface floorDecades(float $precision = 1) Truncate the current instance decade with given precision. - * @method CarbonInterface ceilDecade(float $precision = 1) Ceil the current instance decade with given precision. - * @method CarbonInterface ceilDecades(float $precision = 1) Ceil the current instance decade with given precision. - * @method CarbonInterface roundQuarter(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. - * @method CarbonInterface roundQuarters(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. - * @method CarbonInterface floorQuarter(float $precision = 1) Truncate the current instance quarter with given precision. - * @method CarbonInterface floorQuarters(float $precision = 1) Truncate the current instance quarter with given precision. - * @method CarbonInterface ceilQuarter(float $precision = 1) Ceil the current instance quarter with given precision. - * @method CarbonInterface ceilQuarters(float $precision = 1) Ceil the current instance quarter with given precision. - * @method CarbonInterface roundMillisecond(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. - * @method CarbonInterface roundMilliseconds(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. - * @method CarbonInterface floorMillisecond(float $precision = 1) Truncate the current instance millisecond with given precision. - * @method CarbonInterface floorMilliseconds(float $precision = 1) Truncate the current instance millisecond with given precision. - * @method CarbonInterface ceilMillisecond(float $precision = 1) Ceil the current instance millisecond with given precision. - * @method CarbonInterface ceilMilliseconds(float $precision = 1) Ceil the current instance millisecond with given precision. - * @method CarbonInterface roundMicrosecond(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. - * @method CarbonInterface roundMicroseconds(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. - * @method CarbonInterface floorMicrosecond(float $precision = 1) Truncate the current instance microsecond with given precision. - * @method CarbonInterface floorMicroseconds(float $precision = 1) Truncate the current instance microsecond with given precision. - * @method CarbonInterface ceilMicrosecond(float $precision = 1) Ceil the current instance microsecond with given precision. - * @method CarbonInterface ceilMicroseconds(float $precision = 1) Ceil the current instance microsecond with given precision. - * @method string shortAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string longAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string shortRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string longRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string shortRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string longRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string shortRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string longRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * - * </autodoc> - */ -trait Date -{ - use Boundaries; - use Comparison; - use Converter; - use Creator; - use Difference; - use Macro; - use MagicParameter; - use Modifiers; - use Mutability; - use ObjectInitialisation; - use Options; - use Rounding; - use Serialization; - use Test; - use Timestamp; - use Units; - use Week; - - /** - * Names of days of the week. - * - * @var array - */ - protected static $days = [ - // @call isDayOfWeek - CarbonInterface::SUNDAY => 'Sunday', - // @call isDayOfWeek - CarbonInterface::MONDAY => 'Monday', - // @call isDayOfWeek - CarbonInterface::TUESDAY => 'Tuesday', - // @call isDayOfWeek - CarbonInterface::WEDNESDAY => 'Wednesday', - // @call isDayOfWeek - CarbonInterface::THURSDAY => 'Thursday', - // @call isDayOfWeek - CarbonInterface::FRIDAY => 'Friday', - // @call isDayOfWeek - CarbonInterface::SATURDAY => 'Saturday', - ]; - - /** - * Will UTF8 encoding be used to print localized date/time ? - * - * @var bool - */ - protected static $utf8 = false; - - /** - * List of unit and magic methods associated as doc-comments. - * - * @var array - */ - protected static $units = [ - // @call setUnit - // @call addUnit - 'year', - // @call setUnit - // @call addUnit - 'month', - // @call setUnit - // @call addUnit - 'day', - // @call setUnit - // @call addUnit - 'hour', - // @call setUnit - // @call addUnit - 'minute', - // @call setUnit - // @call addUnit - 'second', - // @call setUnit - // @call addUnit - 'milli', - // @call setUnit - // @call addUnit - 'millisecond', - // @call setUnit - // @call addUnit - 'micro', - // @call setUnit - // @call addUnit - 'microsecond', - ]; - - /** - * Creates a DateTimeZone from a string, DateTimeZone or integer offset. - * - * @param DateTimeZone|string|int|null $object original value to get CarbonTimeZone from it. - * @param DateTimeZone|string|int|null $objectDump dump of the object for error messages. - * - * @throws InvalidTimeZoneException - * - * @return CarbonTimeZone|false - */ - protected static function safeCreateDateTimeZone($object, $objectDump = null) - { - return CarbonTimeZone::instance($object, $objectDump); - } - - /** - * Get the TimeZone associated with the Carbon instance (as CarbonTimeZone). - * - * @return CarbonTimeZone - * - * @link https://php.net/manual/en/datetime.gettimezone.php - */ - #[ReturnTypeWillChange] - public function getTimezone() - { - return CarbonTimeZone::instance(parent::getTimezone()); - } - - /** - * List of minimum and maximums for each unit. - * - * @param int $daysInMonth - * - * @return array - */ - protected static function getRangesByUnit(int $daysInMonth = 31): array - { - return [ - // @call roundUnit - 'year' => [1, 9999], - // @call roundUnit - 'month' => [1, static::MONTHS_PER_YEAR], - // @call roundUnit - 'day' => [1, $daysInMonth], - // @call roundUnit - 'hour' => [0, static::HOURS_PER_DAY - 1], - // @call roundUnit - 'minute' => [0, static::MINUTES_PER_HOUR - 1], - // @call roundUnit - 'second' => [0, static::SECONDS_PER_MINUTE - 1], - ]; - } - - /** - * Get a copy of the instance. - * - * @return static - */ - public function copy() - { - return clone $this; - } - - /** - * @alias copy - * - * Get a copy of the instance. - * - * @return static - */ - public function clone() - { - return clone $this; - } - - /** - * Clone the current instance if it's mutable. - * - * This method is convenient to ensure you don't mutate the initial object - * but avoid to make a useless copy of it if it's already immutable. - * - * @return static - */ - public function avoidMutation(): self - { - if ($this instanceof DateTimeImmutable) { - return $this; - } - - return clone $this; - } - - /** - * Returns a present instance in the same timezone. - * - * @return static - */ - public function nowWithSameTz() - { - return static::now($this->getTimezone()); - } - - /** - * Throws an exception if the given object is not a DateTime and does not implement DateTimeInterface. - * - * @param mixed $date - * @param string|array $other - * - * @throws InvalidTypeException - */ - protected static function expectDateTime($date, $other = []) - { - $message = 'Expected '; - foreach ((array) $other as $expect) { - $message .= "$expect, "; - } - - if (!$date instanceof DateTime && !$date instanceof DateTimeInterface) { - throw new InvalidTypeException( - $message.'DateTime or DateTimeInterface, '. - (\is_object($date) ? \get_class($date) : \gettype($date)).' given' - ); - } - } - - /** - * Return the Carbon instance passed through, a now instance in the same timezone - * if null given or parse the input if string given. - * - * @param Carbon|DateTimeInterface|string|null $date - * - * @return static - */ - protected function resolveCarbon($date = null) - { - if (!$date) { - return $this->nowWithSameTz(); - } - - if (\is_string($date)) { - return static::parse($date, $this->getTimezone()); - } - - static::expectDateTime($date, ['null', 'string']); - - return $date instanceof self ? $date : static::instance($date); - } - - /** - * Return the Carbon instance passed through, a now instance in UTC - * if null given or parse the input if string given (using current timezone - * then switching to UTC). - * - * @param Carbon|DateTimeInterface|string|null $date - * - * @return static - */ - protected function resolveUTC($date = null): self - { - if (!$date) { - return static::now('UTC'); - } - - if (\is_string($date)) { - return static::parse($date, $this->getTimezone())->utc(); - } - - static::expectDateTime($date, ['null', 'string']); - - return $date instanceof self ? $date : static::instance($date)->utc(); - } - - /** - * Return the Carbon instance passed through, a now instance in the same timezone - * if null given or parse the input if string given. - * - * @param Carbon|\Carbon\CarbonPeriod|\Carbon\CarbonInterval|\DateInterval|\DatePeriod|DateTimeInterface|string|null $date - * - * @return static - */ - public function carbonize($date = null) - { - if ($date instanceof DateInterval) { - return $this->avoidMutation()->add($date); - } - - if ($date instanceof DatePeriod || $date instanceof CarbonPeriod) { - $date = $date->getStartDate(); - } - - return $this->resolveCarbon($date); - } - - /////////////////////////////////////////////////////////////////// - ///////////////////////// GETTERS AND SETTERS ///////////////////// - /////////////////////////////////////////////////////////////////// - - /** - * Get a part of the Carbon object - * - * @param string $name - * - * @throws UnknownGetterException - * - * @return string|int|bool|DateTimeZone|null - */ - public function __get($name) - { - return $this->get($name); - } - - /** - * Get a part of the Carbon object - * - * @param string $name - * - * @throws UnknownGetterException - * - * @return string|int|bool|DateTimeZone|null - */ - public function get($name) - { - static $formats = [ - // @property int - 'year' => 'Y', - // @property int - 'yearIso' => 'o', - // @property int - // @call isSameUnit - 'month' => 'n', - // @property int - 'day' => 'j', - // @property int - 'hour' => 'G', - // @property int - 'minute' => 'i', - // @property int - 'second' => 's', - // @property int - 'micro' => 'u', - // @property int - 'microsecond' => 'u', - // @property-read int 0 (for Sunday) through 6 (for Saturday) - 'dayOfWeek' => 'w', - // @property-read int 1 (for Monday) through 7 (for Sunday) - 'dayOfWeekIso' => 'N', - // @property-read int ISO-8601 week number of year, weeks starting on Monday - 'weekOfYear' => 'W', - // @property-read int number of days in the given month - 'daysInMonth' => 't', - // @property int|float|string seconds since the Unix Epoch - 'timestamp' => 'U', - // @property-read string "am"/"pm" (Ante meridiem or Post meridiem latin lowercase mark) - 'latinMeridiem' => 'a', - // @property-read string "AM"/"PM" (Ante meridiem or Post meridiem latin uppercase mark) - 'latinUpperMeridiem' => 'A', - // @property string the day of week in English - 'englishDayOfWeek' => 'l', - // @property string the abbreviated day of week in English - 'shortEnglishDayOfWeek' => 'D', - // @property string the month in English - 'englishMonth' => 'F', - // @property string the abbreviated month in English - 'shortEnglishMonth' => 'M', - // @property string the day of week in current locale LC_TIME - // @deprecated - // reason: It uses OS language package and strftime() which is deprecated since PHP 8.1. - // replacement: Use ->isoFormat('MMM') instead. - // since: 2.55.0 - 'localeDayOfWeek' => '%A', - // @property string the abbreviated day of week in current locale LC_TIME - // @deprecated - // reason: It uses OS language package and strftime() which is deprecated since PHP 8.1. - // replacement: Use ->isoFormat('dddd') instead. - // since: 2.55.0 - 'shortLocaleDayOfWeek' => '%a', - // @property string the month in current locale LC_TIME - // @deprecated - // reason: It uses OS language package and strftime() which is deprecated since PHP 8.1. - // replacement: Use ->isoFormat('ddd') instead. - // since: 2.55.0 - 'localeMonth' => '%B', - // @property string the abbreviated month in current locale LC_TIME - // @deprecated - // reason: It uses OS language package and strftime() which is deprecated since PHP 8.1. - // replacement: Use ->isoFormat('MMMM') instead. - // since: 2.55.0 - 'shortLocaleMonth' => '%b', - // @property-read string $timezoneAbbreviatedName the current timezone abbreviated name - 'timezoneAbbreviatedName' => 'T', - // @property-read string $tzAbbrName alias of $timezoneAbbreviatedName - 'tzAbbrName' => 'T', - ]; - - switch (true) { - case isset($formats[$name]): - $format = $formats[$name]; - $method = str_starts_with($format, '%') ? 'formatLocalized' : 'rawFormat'; - $value = $this->$method($format); - - return is_numeric($value) ? (int) $value : $value; - - // @property-read string long name of weekday translated according to Carbon locale, in english if no translation available for current language - case $name === 'dayName': - return $this->getTranslatedDayName(); - // @property-read string short name of weekday translated according to Carbon locale, in english if no translation available for current language - case $name === 'shortDayName': - return $this->getTranslatedShortDayName(); - // @property-read string very short name of weekday translated according to Carbon locale, in english if no translation available for current language - case $name === 'minDayName': - return $this->getTranslatedMinDayName(); - // @property-read string long name of month translated according to Carbon locale, in english if no translation available for current language - case $name === 'monthName': - return $this->getTranslatedMonthName(); - // @property-read string short name of month translated according to Carbon locale, in english if no translation available for current language - case $name === 'shortMonthName': - return $this->getTranslatedShortMonthName(); - // @property-read string lowercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language - case $name === 'meridiem': - return $this->meridiem(true); - // @property-read string uppercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language - case $name === 'upperMeridiem': - return $this->meridiem(); - // @property-read int current hour from 1 to 24 - case $name === 'noZeroHour': - return $this->hour ?: 24; - // @property int - case $name === 'milliseconds': - // @property int - case $name === 'millisecond': - // @property int - case $name === 'milli': - return (int) floor(((int) $this->rawFormat('u')) / 1000); - - // @property int 1 through 53 - case $name === 'week': - return (int) $this->week(); - - // @property int 1 through 53 - case $name === 'isoWeek': - return (int) $this->isoWeek(); - - // @property int year according to week format - case $name === 'weekYear': - return (int) $this->weekYear(); - - // @property int year according to ISO week format - case $name === 'isoWeekYear': - return (int) $this->isoWeekYear(); - - // @property-read int 51 through 53 - case $name === 'weeksInYear': - return $this->weeksInYear(); - - // @property-read int 51 through 53 - case $name === 'isoWeeksInYear': - return $this->isoWeeksInYear(); - - // @property-read int 1 through 5 - case $name === 'weekOfMonth': - return (int) ceil($this->day / static::DAYS_PER_WEEK); - - // @property-read int 1 through 5 - case $name === 'weekNumberInMonth': - return (int) ceil(($this->day + $this->avoidMutation()->startOfMonth()->dayOfWeekIso - 1) / static::DAYS_PER_WEEK); - - // @property-read int 0 through 6 - case $name === 'firstWeekDay': - return $this->localTranslator ? ($this->getTranslationMessage('first_day_of_week') ?? 0) : static::getWeekStartsAt(); - - // @property-read int 0 through 6 - case $name === 'lastWeekDay': - return $this->localTranslator ? (($this->getTranslationMessage('first_day_of_week') ?? 0) + static::DAYS_PER_WEEK - 1) % static::DAYS_PER_WEEK : static::getWeekEndsAt(); - - // @property int 1 through 366 - case $name === 'dayOfYear': - return 1 + (int) ($this->rawFormat('z')); - - // @property-read int 365 or 366 - case $name === 'daysInYear': - return $this->isLeapYear() ? 366 : 365; - - // @property int does a diffInYears() with default parameters - case $name === 'age': - return $this->diffInYears(); - - // @property-read int the quarter of this instance, 1 - 4 - // @call isSameUnit - case $name === 'quarter': - return (int) ceil($this->month / static::MONTHS_PER_QUARTER); - - // @property-read int the decade of this instance - // @call isSameUnit - case $name === 'decade': - return (int) ceil($this->year / static::YEARS_PER_DECADE); - - // @property-read int the century of this instance - // @call isSameUnit - case $name === 'century': - $factor = 1; - $year = $this->year; - if ($year < 0) { - $year = -$year; - $factor = -1; - } - - return (int) ($factor * ceil($year / static::YEARS_PER_CENTURY)); - - // @property-read int the millennium of this instance - // @call isSameUnit - case $name === 'millennium': - $factor = 1; - $year = $this->year; - if ($year < 0) { - $year = -$year; - $factor = -1; - } - - return (int) ($factor * ceil($year / static::YEARS_PER_MILLENNIUM)); - - // @property int the timezone offset in seconds from UTC - case $name === 'offset': - return $this->getOffset(); - - // @property int the timezone offset in minutes from UTC - case $name === 'offsetMinutes': - return $this->getOffset() / static::SECONDS_PER_MINUTE; - - // @property int the timezone offset in hours from UTC - case $name === 'offsetHours': - return $this->getOffset() / static::SECONDS_PER_MINUTE / static::MINUTES_PER_HOUR; - - // @property-read bool daylight savings time indicator, true if DST, false otherwise - case $name === 'dst': - return $this->rawFormat('I') === '1'; - - // @property-read bool checks if the timezone is local, true if local, false otherwise - case $name === 'local': - return $this->getOffset() === $this->avoidMutation()->setTimezone(date_default_timezone_get())->getOffset(); - - // @property-read bool checks if the timezone is UTC, true if UTC, false otherwise - case $name === 'utc': - return $this->getOffset() === 0; - - // @property CarbonTimeZone $timezone the current timezone - // @property CarbonTimeZone $tz alias of $timezone - case $name === 'timezone' || $name === 'tz': - return CarbonTimeZone::instance($this->getTimezone()); - - // @property-read string $timezoneName the current timezone name - // @property-read string $tzName alias of $timezoneName - case $name === 'timezoneName' || $name === 'tzName': - return $this->getTimezone()->getName(); - - // @property-read string locale of the current instance - case $name === 'locale': - return $this->getTranslatorLocale(); - - default: - $macro = $this->getLocalMacro('get'.ucfirst($name)); - - if ($macro) { - return $this->executeCallableWithContext($macro); - } - - throw new UnknownGetterException($name); - } - } - - /** - * Check if an attribute exists on the object - * - * @param string $name - * - * @return bool - */ - public function __isset($name) - { - try { - $this->__get($name); - } catch (UnknownGetterException | ReflectionException $e) { - return false; - } - - return true; - } - - /** - * Set a part of the Carbon object - * - * @param string $name - * @param string|int|DateTimeZone $value - * - * @throws UnknownSetterException|ReflectionException - * - * @return void - */ - public function __set($name, $value) - { - if ($this->constructedObjectId === spl_object_hash($this)) { - $this->set($name, $value); - - return; - } - - $this->$name = $value; - } - - /** - * Set a part of the Carbon object - * - * @param string|array $name - * @param string|int|DateTimeZone $value - * - * @throws ImmutableException|UnknownSetterException - * - * @return $this - */ - public function set($name, $value = null) - { - if ($this->isImmutable()) { - throw new ImmutableException(sprintf('%s class', static::class)); - } - - if (\is_array($name)) { - foreach ($name as $key => $value) { - $this->set($key, $value); - } - - return $this; - } - - switch ($name) { - case 'milliseconds': - case 'millisecond': - case 'milli': - case 'microseconds': - case 'microsecond': - case 'micro': - if (str_starts_with($name, 'milli')) { - $value *= 1000; - } - - while ($value < 0) { - $this->subSecond(); - $value += static::MICROSECONDS_PER_SECOND; - } - - while ($value >= static::MICROSECONDS_PER_SECOND) { - $this->addSecond(); - $value -= static::MICROSECONDS_PER_SECOND; - } - - $this->modify($this->rawFormat('H:i:s.').str_pad((string) round($value), 6, '0', STR_PAD_LEFT)); - - break; - - case 'year': - case 'month': - case 'day': - case 'hour': - case 'minute': - case 'second': - [$year, $month, $day, $hour, $minute, $second] = array_map('intval', explode('-', $this->rawFormat('Y-n-j-G-i-s'))); - $$name = $value; - $this->setDateTime($year, $month, $day, $hour, $minute, $second); - - break; - - case 'week': - $this->week($value); - - break; - - case 'isoWeek': - $this->isoWeek($value); - - break; - - case 'weekYear': - $this->weekYear($value); - - break; - - case 'isoWeekYear': - $this->isoWeekYear($value); - - break; - - case 'dayOfYear': - $this->addDays($value - $this->dayOfYear); - - break; - - case 'timestamp': - $this->setTimestamp($value); - - break; - - case 'offset': - $this->setTimezone(static::safeCreateDateTimeZone($value / static::SECONDS_PER_MINUTE / static::MINUTES_PER_HOUR)); - - break; - - case 'offsetMinutes': - $this->setTimezone(static::safeCreateDateTimeZone($value / static::MINUTES_PER_HOUR)); - - break; - - case 'offsetHours': - $this->setTimezone(static::safeCreateDateTimeZone($value)); - - break; - - case 'timezone': - case 'tz': - $this->setTimezone($value); - - break; - - default: - $macro = $this->getLocalMacro('set'.ucfirst($name)); - - if ($macro) { - $this->executeCallableWithContext($macro, $value); - - break; - } - - if ($this->localStrictModeEnabled ?? static::isStrictModeEnabled()) { - throw new UnknownSetterException($name); - } - - $this->$name = $value; - } - - return $this; - } - - protected function getTranslatedFormByRegExp($baseKey, $keySuffix, $context, $subKey, $defaultValue) - { - $key = $baseKey.$keySuffix; - $standaloneKey = "{$key}_standalone"; - $baseTranslation = $this->getTranslationMessage($key); - - if ($baseTranslation instanceof Closure) { - return $baseTranslation($this, $context, $subKey) ?: $defaultValue; - } - - if ( - $this->getTranslationMessage("$standaloneKey.$subKey") && - (!$context || (($regExp = $this->getTranslationMessage("{$baseKey}_regexp")) && !preg_match($regExp, $context))) - ) { - $key = $standaloneKey; - } - - return $this->getTranslationMessage("$key.$subKey", null, $defaultValue); - } - - /** - * Get the translation of the current week day name (with context for languages with multiple forms). - * - * @param string|null $context whole format string - * @param string $keySuffix "", "_short" or "_min" - * @param string|null $defaultValue default value if translation missing - * - * @return string - */ - public function getTranslatedDayName($context = null, $keySuffix = '', $defaultValue = null) - { - return $this->getTranslatedFormByRegExp('weekdays', $keySuffix, $context, $this->dayOfWeek, $defaultValue ?: $this->englishDayOfWeek); - } - - /** - * Get the translation of the current short week day name (with context for languages with multiple forms). - * - * @param string|null $context whole format string - * - * @return string - */ - public function getTranslatedShortDayName($context = null) - { - return $this->getTranslatedDayName($context, '_short', $this->shortEnglishDayOfWeek); - } - - /** - * Get the translation of the current abbreviated week day name (with context for languages with multiple forms). - * - * @param string|null $context whole format string - * - * @return string - */ - public function getTranslatedMinDayName($context = null) - { - return $this->getTranslatedDayName($context, '_min', $this->shortEnglishDayOfWeek); - } - - /** - * Get the translation of the current month day name (with context for languages with multiple forms). - * - * @param string|null $context whole format string - * @param string $keySuffix "" or "_short" - * @param string|null $defaultValue default value if translation missing - * - * @return string - */ - public function getTranslatedMonthName($context = null, $keySuffix = '', $defaultValue = null) - { - return $this->getTranslatedFormByRegExp('months', $keySuffix, $context, $this->month - 1, $defaultValue ?: $this->englishMonth); - } - - /** - * Get the translation of the current short month day name (with context for languages with multiple forms). - * - * @param string|null $context whole format string - * - * @return string - */ - public function getTranslatedShortMonthName($context = null) - { - return $this->getTranslatedMonthName($context, '_short', $this->shortEnglishMonth); - } - - /** - * Get/set the day of year. - * - * @param int|null $value new value for day of year if using as setter. - * - * @return static|int - */ - public function dayOfYear($value = null) - { - $dayOfYear = $this->dayOfYear; - - return $value === null ? $dayOfYear : $this->addDays($value - $dayOfYear); - } - - /** - * Get/set the weekday from 0 (Sunday) to 6 (Saturday). - * - * @param int|null $value new value for weekday if using as setter. - * - * @return static|int - */ - public function weekday($value = null) - { - if ($value === null) { - return $this->dayOfWeek; - } - - $firstDay = (int) ($this->getTranslationMessage('first_day_of_week') ?? 0); - $dayOfWeek = ($this->dayOfWeek + 7 - $firstDay) % 7; - - return $this->addDays((($value + 7 - $firstDay) % 7) - $dayOfWeek); - } - - /** - * Get/set the ISO weekday from 1 (Monday) to 7 (Sunday). - * - * @param int|null $value new value for weekday if using as setter. - * - * @return static|int - */ - public function isoWeekday($value = null) - { - $dayOfWeekIso = $this->dayOfWeekIso; - - return $value === null ? $dayOfWeekIso : $this->addDays($value - $dayOfWeekIso); - } - - /** - * Return the number of days since the start of the week (using the current locale or the first parameter - * if explicitly given). - * - * @param int|null $weekStartsAt optional start allow you to specify the day of week to use to start the week, - * if not provided, start of week is inferred from the locale - * (Sunday for en_US, Monday for de_DE, etc.) - * - * @return int - */ - public function getDaysFromStartOfWeek(int $weekStartsAt = null): int - { - $firstDay = (int) ($weekStartsAt ?? $this->getTranslationMessage('first_day_of_week') ?? 0); - - return ($this->dayOfWeek + 7 - $firstDay) % 7; - } - - /** - * Set the day (keeping the current time) to the start of the week + the number of days passed as the first - * parameter. First day of week is driven by the locale unless explicitly set with the second parameter. - * - * @param int $numberOfDays number of days to add after the start of the current week - * @param int|null $weekStartsAt optional start allow you to specify the day of week to use to start the week, - * if not provided, start of week is inferred from the locale - * (Sunday for en_US, Monday for de_DE, etc.) - * - * @return static - */ - public function setDaysFromStartOfWeek(int $numberOfDays, int $weekStartsAt = null) - { - return $this->addDays($numberOfDays - $this->getDaysFromStartOfWeek($weekStartsAt)); - } - - /** - * Set any unit to a new value without overflowing current other unit given. - * - * @param string $valueUnit unit name to modify - * @param int $value new value for the input unit - * @param string $overflowUnit unit name to not overflow - * - * @return static - */ - public function setUnitNoOverflow($valueUnit, $value, $overflowUnit) - { - try { - $original = $this->avoidMutation(); - /** @var static $date */ - $date = $this->$valueUnit($value); - $end = $original->avoidMutation()->endOf($overflowUnit); - $start = $original->avoidMutation()->startOf($overflowUnit); - if ($date < $start) { - $date = $date->setDateTimeFrom($start); - } elseif ($date > $end) { - $date = $date->setDateTimeFrom($end); - } - - return $date; - } catch (BadMethodCallException | ReflectionException $exception) { - throw new UnknownUnitException($valueUnit, 0, $exception); - } - } - - /** - * Add any unit to a new value without overflowing current other unit given. - * - * @param string $valueUnit unit name to modify - * @param int $value amount to add to the input unit - * @param string $overflowUnit unit name to not overflow - * - * @return static - */ - public function addUnitNoOverflow($valueUnit, $value, $overflowUnit) - { - return $this->setUnitNoOverflow($valueUnit, $this->$valueUnit + $value, $overflowUnit); - } - - /** - * Subtract any unit to a new value without overflowing current other unit given. - * - * @param string $valueUnit unit name to modify - * @param int $value amount to subtract to the input unit - * @param string $overflowUnit unit name to not overflow - * - * @return static - */ - public function subUnitNoOverflow($valueUnit, $value, $overflowUnit) - { - return $this->setUnitNoOverflow($valueUnit, $this->$valueUnit - $value, $overflowUnit); - } - - /** - * Returns the minutes offset to UTC if no arguments passed, else set the timezone with given minutes shift passed. - * - * @param int|null $minuteOffset - * - * @return int|static - */ - public function utcOffset(int $minuteOffset = null) - { - if (\func_num_args() < 1) { - return $this->offsetMinutes; - } - - return $this->setTimezone(CarbonTimeZone::createFromMinuteOffset($minuteOffset)); - } - - /** - * Set the date with gregorian year, month and day numbers. - * - * @see https://php.net/manual/en/datetime.setdate.php - * - * @param int $year - * @param int $month - * @param int $day - * - * @return static - */ - #[ReturnTypeWillChange] - public function setDate($year, $month, $day) - { - return parent::setDate((int) $year, (int) $month, (int) $day); - } - - /** - * Set a date according to the ISO 8601 standard - using weeks and day offsets rather than specific dates. - * - * @see https://php.net/manual/en/datetime.setisodate.php - * - * @param int $year - * @param int $week - * @param int $day - * - * @return static - */ - #[ReturnTypeWillChange] - public function setISODate($year, $week, $day = 1) - { - return parent::setISODate((int) $year, (int) $week, (int) $day); - } - - /** - * Set the date and time all together. - * - * @param int $year - * @param int $month - * @param int $day - * @param int $hour - * @param int $minute - * @param int $second - * @param int $microseconds - * - * @return static - */ - public function setDateTime($year, $month, $day, $hour, $minute, $second = 0, $microseconds = 0) - { - return $this->setDate($year, $month, $day)->setTime((int) $hour, (int) $minute, (int) $second, (int) $microseconds); - } - - /** - * Resets the current time of the DateTime object to a different time. - * - * @see https://php.net/manual/en/datetime.settime.php - * - * @param int $hour - * @param int $minute - * @param int $second - * @param int $microseconds - * - * @return static - */ - #[ReturnTypeWillChange] - public function setTime($hour, $minute, $second = 0, $microseconds = 0) - { - return parent::setTime((int) $hour, (int) $minute, (int) $second, (int) $microseconds); - } - - /** - * Set the instance's timestamp. - * - * Timestamp input can be given as int, float or a string containing one or more numbers. - * - * @param float|int|string $unixTimestamp - * - * @return static - */ - #[ReturnTypeWillChange] - public function setTimestamp($unixTimestamp) - { - [$timestamp, $microseconds] = self::getIntegerAndDecimalParts($unixTimestamp); - - return parent::setTimestamp((int) $timestamp)->setMicroseconds((int) $microseconds); - } - - /** - * Set the time by time string. - * - * @param string $time - * - * @return static - */ - public function setTimeFromTimeString($time) - { - if (!str_contains($time, ':')) { - $time .= ':0'; - } - - return $this->modify($time); - } - - /** - * @alias setTimezone - * - * @param DateTimeZone|string $value - * - * @return static - */ - public function timezone($value) - { - return $this->setTimezone($value); - } - - /** - * Set the timezone or returns the timezone name if no arguments passed. - * - * @param DateTimeZone|string $value - * - * @return static|string - */ - public function tz($value = null) - { - if (\func_num_args() < 1) { - return $this->tzName; - } - - return $this->setTimezone($value); - } - - /** - * Set the instance's timezone from a string or object. - * - * @param DateTimeZone|string $value - * - * @return static - */ - #[ReturnTypeWillChange] - public function setTimezone($value) - { - $tz = static::safeCreateDateTimeZone($value); - - if ($tz === false && !self::isStrictModeEnabled()) { - $tz = new CarbonTimeZone(); - } - - return parent::setTimezone($tz); - } - - /** - * Set the instance's timezone from a string or object and add/subtract the offset difference. - * - * @param DateTimeZone|string $value - * - * @return static - */ - public function shiftTimezone($value) - { - $dateTimeString = $this->format('Y-m-d H:i:s.u'); - - return $this - ->setTimezone($value) - ->modify($dateTimeString); - } - - /** - * Set the instance's timezone to UTC. - * - * @return static - */ - public function utc() - { - return $this->setTimezone('UTC'); - } - - /** - * Set the year, month, and date for this instance to that of the passed instance. - * - * @param Carbon|DateTimeInterface $date now if null - * - * @return static - */ - public function setDateFrom($date = null) - { - $date = $this->resolveCarbon($date); - - return $this->setDate($date->year, $date->month, $date->day); - } - - /** - * Set the hour, minute, second and microseconds for this instance to that of the passed instance. - * - * @param Carbon|DateTimeInterface $date now if null - * - * @return static - */ - public function setTimeFrom($date = null) - { - $date = $this->resolveCarbon($date); - - return $this->setTime($date->hour, $date->minute, $date->second, $date->microsecond); - } - - /** - * Set the date and time for this instance to that of the passed instance. - * - * @param Carbon|DateTimeInterface $date - * - * @return static - */ - public function setDateTimeFrom($date = null) - { - $date = $this->resolveCarbon($date); - - return $this->modify($date->rawFormat('Y-m-d H:i:s.u')); - } - - /** - * Get the days of the week - * - * @return array - */ - public static function getDays() - { - return static::$days; - } - - /////////////////////////////////////////////////////////////////// - /////////////////////// WEEK SPECIAL DAYS ///////////////////////// - /////////////////////////////////////////////////////////////////// - - private static function getFirstDayOfWeek(): int - { - return (int) static::getTranslationMessageWith( - static::getTranslator(), - 'first_day_of_week' - ); - } - - /** - * Get the first day of week - * - * @return int - */ - public static function getWeekStartsAt() - { - if (static::$weekStartsAt === static::WEEK_DAY_AUTO) { - return self::getFirstDayOfWeek(); - } - - return static::$weekStartsAt; - } - - /** - * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * Use $weekEndsAt optional parameter instead when using endOfWeek method. You can also use the - * 'first_day_of_week' locale setting to change the start of week according to current locale - * selected and implicitly the end of week. - * - * Set the first day of week - * - * @param int|string $day week start day (or 'auto' to get the first day of week from Carbon::getLocale() culture). - * - * @return void - */ - public static function setWeekStartsAt($day) - { - static::$weekStartsAt = $day === static::WEEK_DAY_AUTO ? $day : max(0, (7 + $day) % 7); - } - - /** - * Get the last day of week - * - * @return int - */ - public static function getWeekEndsAt() - { - if (static::$weekStartsAt === static::WEEK_DAY_AUTO) { - return (int) (static::DAYS_PER_WEEK - 1 + self::getFirstDayOfWeek()) % static::DAYS_PER_WEEK; - } - - return static::$weekEndsAt; - } - - /** - * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * Use $weekStartsAt optional parameter instead when using startOfWeek, floorWeek, ceilWeek - * or roundWeek method. You can also use the 'first_day_of_week' locale setting to change the - * start of week according to current locale selected and implicitly the end of week. - * - * Set the last day of week - * - * @param int|string $day week end day (or 'auto' to get the day before the first day of week - * from Carbon::getLocale() culture). - * - * @return void - */ - public static function setWeekEndsAt($day) - { - static::$weekEndsAt = $day === static::WEEK_DAY_AUTO ? $day : max(0, (7 + $day) % 7); - } - - /** - * Get weekend days - * - * @return array - */ - public static function getWeekendDays() - { - return static::$weekendDays; - } - - /** - * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather consider week-end is always saturday and sunday, and if you have some custom - * week-end days to handle, give to those days an other name and create a macro for them: - * - * ``` - * Carbon::macro('isDayOff', function ($date) { - * return $date->isSunday() || $date->isMonday(); - * }); - * Carbon::macro('isNotDayOff', function ($date) { - * return !$date->isDayOff(); - * }); - * if ($someDate->isDayOff()) ... - * if ($someDate->isNotDayOff()) ... - * // Add 5 not-off days - * $count = 5; - * while ($someDate->isDayOff() || ($count-- > 0)) { - * $someDate->addDay(); - * } - * ``` - * - * Set weekend days - * - * @param array $days - * - * @return void - */ - public static function setWeekendDays($days) - { - static::$weekendDays = $days; - } - - /** - * Determine if a time string will produce a relative date. - * - * @param string $time - * - * @return bool true if time match a relative date, false if absolute or invalid time string - */ - public static function hasRelativeKeywords($time) - { - if (!$time || strtotime($time) === false) { - return false; - } - - $date1 = new DateTime('2000-01-01T00:00:00Z'); - $date1->modify($time); - $date2 = new DateTime('2001-12-25T00:00:00Z'); - $date2->modify($time); - - return $date1 != $date2; - } - - /////////////////////////////////////////////////////////////////// - /////////////////////// STRING FORMATTING ///////////////////////// - /////////////////////////////////////////////////////////////////// - - /** - * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use UTF-8 language packages on every machine. - * - * Set if UTF8 will be used for localized date/time. - * - * @param bool $utf8 - */ - public static function setUtf8($utf8) - { - static::$utf8 = $utf8; - } - - /** - * Format the instance with the current locale. You can set the current - * locale using setlocale() https://php.net/setlocale. - * - * @deprecated It uses OS language package and strftime() which is deprecated since PHP 8.1. - * Use ->isoFormat() instead. - * Deprecated since 2.55.0 - * - * @param string $format - * - * @return string - */ - public function formatLocalized($format) - { - // Check for Windows to find and replace the %e modifier correctly. - if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { - $format = preg_replace('#(?<!%)((?:%%)*)%e#', '\1%#d', $format); // @codeCoverageIgnore - } - - $time = strtotime($this->toDateTimeString()); - $formatted = ($this->localStrictModeEnabled ?? static::isStrictModeEnabled()) - ? strftime($format, $time) - : @strftime($format, $time); - - return static::$utf8 - ? ( - \function_exists('mb_convert_encoding') - ? mb_convert_encoding($formatted, 'UTF-8', mb_list_encodings()) - : utf8_encode($formatted) - ) - : $formatted; - } - - /** - * Returns list of locale formats for ISO formatting. - * - * @param string|null $locale current locale used if null - * - * @return array - */ - public function getIsoFormats($locale = null) - { - return [ - 'LT' => $this->getTranslationMessage('formats.LT', $locale, 'h:mm A'), - 'LTS' => $this->getTranslationMessage('formats.LTS', $locale, 'h:mm:ss A'), - 'L' => $this->getTranslationMessage('formats.L', $locale, 'MM/DD/YYYY'), - 'LL' => $this->getTranslationMessage('formats.LL', $locale, 'MMMM D, YYYY'), - 'LLL' => $this->getTranslationMessage('formats.LLL', $locale, 'MMMM D, YYYY h:mm A'), - 'LLLL' => $this->getTranslationMessage('formats.LLLL', $locale, 'dddd, MMMM D, YYYY h:mm A'), - 'l' => $this->getTranslationMessage('formats.l', $locale), - 'll' => $this->getTranslationMessage('formats.ll', $locale), - 'lll' => $this->getTranslationMessage('formats.lll', $locale), - 'llll' => $this->getTranslationMessage('formats.llll', $locale), - ]; - } - - /** - * Returns list of calendar formats for ISO formatting. - * - * @param string|null $locale current locale used if null - * - * @return array - */ - public function getCalendarFormats($locale = null) - { - return [ - 'sameDay' => $this->getTranslationMessage('calendar.sameDay', $locale, '[Today at] LT'), - 'nextDay' => $this->getTranslationMessage('calendar.nextDay', $locale, '[Tomorrow at] LT'), - 'nextWeek' => $this->getTranslationMessage('calendar.nextWeek', $locale, 'dddd [at] LT'), - 'lastDay' => $this->getTranslationMessage('calendar.lastDay', $locale, '[Yesterday at] LT'), - 'lastWeek' => $this->getTranslationMessage('calendar.lastWeek', $locale, '[Last] dddd [at] LT'), - 'sameElse' => $this->getTranslationMessage('calendar.sameElse', $locale, 'L'), - ]; - } - - /** - * Returns list of locale units for ISO formatting. - * - * @return array - */ - public static function getIsoUnits() - { - static $units = null; - - if ($units === null) { - $units = [ - 'OD' => ['getAltNumber', ['day']], - 'OM' => ['getAltNumber', ['month']], - 'OY' => ['getAltNumber', ['year']], - 'OH' => ['getAltNumber', ['hour']], - 'Oh' => ['getAltNumber', ['h']], - 'Om' => ['getAltNumber', ['minute']], - 'Os' => ['getAltNumber', ['second']], - 'D' => 'day', - 'DD' => ['rawFormat', ['d']], - 'Do' => ['ordinal', ['day', 'D']], - 'd' => 'dayOfWeek', - 'dd' => function (CarbonInterface $date, $originalFormat = null) { - return $date->getTranslatedMinDayName($originalFormat); - }, - 'ddd' => function (CarbonInterface $date, $originalFormat = null) { - return $date->getTranslatedShortDayName($originalFormat); - }, - 'dddd' => function (CarbonInterface $date, $originalFormat = null) { - return $date->getTranslatedDayName($originalFormat); - }, - 'DDD' => 'dayOfYear', - 'DDDD' => ['getPaddedUnit', ['dayOfYear', 3]], - 'DDDo' => ['ordinal', ['dayOfYear', 'DDD']], - 'e' => ['weekday', []], - 'E' => 'dayOfWeekIso', - 'H' => ['rawFormat', ['G']], - 'HH' => ['rawFormat', ['H']], - 'h' => ['rawFormat', ['g']], - 'hh' => ['rawFormat', ['h']], - 'k' => 'noZeroHour', - 'kk' => ['getPaddedUnit', ['noZeroHour']], - 'hmm' => ['rawFormat', ['gi']], - 'hmmss' => ['rawFormat', ['gis']], - 'Hmm' => ['rawFormat', ['Gi']], - 'Hmmss' => ['rawFormat', ['Gis']], - 'm' => 'minute', - 'mm' => ['rawFormat', ['i']], - 'a' => 'meridiem', - 'A' => 'upperMeridiem', - 's' => 'second', - 'ss' => ['getPaddedUnit', ['second']], - 'S' => function (CarbonInterface $date) { - return (string) floor($date->micro / 100000); - }, - 'SS' => function (CarbonInterface $date) { - return str_pad((string) floor($date->micro / 10000), 2, '0', STR_PAD_LEFT); - }, - 'SSS' => function (CarbonInterface $date) { - return str_pad((string) floor($date->micro / 1000), 3, '0', STR_PAD_LEFT); - }, - 'SSSS' => function (CarbonInterface $date) { - return str_pad((string) floor($date->micro / 100), 4, '0', STR_PAD_LEFT); - }, - 'SSSSS' => function (CarbonInterface $date) { - return str_pad((string) floor($date->micro / 10), 5, '0', STR_PAD_LEFT); - }, - 'SSSSSS' => ['getPaddedUnit', ['micro', 6]], - 'SSSSSSS' => function (CarbonInterface $date) { - return str_pad((string) floor($date->micro * 10), 7, '0', STR_PAD_LEFT); - }, - 'SSSSSSSS' => function (CarbonInterface $date) { - return str_pad((string) floor($date->micro * 100), 8, '0', STR_PAD_LEFT); - }, - 'SSSSSSSSS' => function (CarbonInterface $date) { - return str_pad((string) floor($date->micro * 1000), 9, '0', STR_PAD_LEFT); - }, - 'M' => 'month', - 'MM' => ['rawFormat', ['m']], - 'MMM' => function (CarbonInterface $date, $originalFormat = null) { - $month = $date->getTranslatedShortMonthName($originalFormat); - $suffix = $date->getTranslationMessage('mmm_suffix'); - if ($suffix && $month !== $date->monthName) { - $month .= $suffix; - } - - return $month; - }, - 'MMMM' => function (CarbonInterface $date, $originalFormat = null) { - return $date->getTranslatedMonthName($originalFormat); - }, - 'Mo' => ['ordinal', ['month', 'M']], - 'Q' => 'quarter', - 'Qo' => ['ordinal', ['quarter', 'M']], - 'G' => 'isoWeekYear', - 'GG' => ['getPaddedUnit', ['isoWeekYear']], - 'GGG' => ['getPaddedUnit', ['isoWeekYear', 3]], - 'GGGG' => ['getPaddedUnit', ['isoWeekYear', 4]], - 'GGGGG' => ['getPaddedUnit', ['isoWeekYear', 5]], - 'g' => 'weekYear', - 'gg' => ['getPaddedUnit', ['weekYear']], - 'ggg' => ['getPaddedUnit', ['weekYear', 3]], - 'gggg' => ['getPaddedUnit', ['weekYear', 4]], - 'ggggg' => ['getPaddedUnit', ['weekYear', 5]], - 'W' => 'isoWeek', - 'WW' => ['getPaddedUnit', ['isoWeek']], - 'Wo' => ['ordinal', ['isoWeek', 'W']], - 'w' => 'week', - 'ww' => ['getPaddedUnit', ['week']], - 'wo' => ['ordinal', ['week', 'w']], - 'x' => ['valueOf', []], - 'X' => 'timestamp', - 'Y' => 'year', - 'YY' => ['rawFormat', ['y']], - 'YYYY' => ['getPaddedUnit', ['year', 4]], - 'YYYYY' => ['getPaddedUnit', ['year', 5]], - 'YYYYYY' => function (CarbonInterface $date) { - return ($date->year < 0 ? '' : '+').$date->getPaddedUnit('year', 6); - }, - 'z' => ['rawFormat', ['T']], - 'zz' => 'tzName', - 'Z' => ['getOffsetString', []], - 'ZZ' => ['getOffsetString', ['']], - ]; - } - - return $units; - } - - /** - * Returns a unit of the instance padded with 0 by default or any other string if specified. - * - * @param string $unit Carbon unit name - * @param int $length Length of the output (2 by default) - * @param string $padString String to use for padding ("0" by default) - * @param int $padType Side(s) to pad (STR_PAD_LEFT by default) - * - * @return string - */ - public function getPaddedUnit($unit, $length = 2, $padString = '0', $padType = STR_PAD_LEFT) - { - return ($this->$unit < 0 ? '-' : '').str_pad((string) abs($this->$unit), $length, $padString, $padType); - } - - /** - * Return a property with its ordinal. - * - * @param string $key - * @param string|null $period - * - * @return string - */ - public function ordinal(string $key, ?string $period = null): string - { - $number = $this->$key; - $result = $this->translate('ordinal', [ - ':number' => $number, - ':period' => (string) $period, - ]); - - return (string) ($result === 'ordinal' ? $number : $result); - } - - /** - * Return the meridiem of the current time in the current locale. - * - * @param bool $isLower if true, returns lowercase variant if available in the current locale. - * - * @return string - */ - public function meridiem(bool $isLower = false): string - { - $hour = $this->hour; - $index = $hour < 12 ? 0 : 1; - - if ($isLower) { - $key = 'meridiem.'.($index + 2); - $result = $this->translate($key); - - if ($result !== $key) { - return $result; - } - } - - $key = "meridiem.$index"; - $result = $this->translate($key); - if ($result === $key) { - $result = $this->translate('meridiem', [ - ':hour' => $this->hour, - ':minute' => $this->minute, - ':isLower' => $isLower, - ]); - - if ($result === 'meridiem') { - return $isLower ? $this->latinMeridiem : $this->latinUpperMeridiem; - } - } elseif ($isLower) { - $result = mb_strtolower($result); - } - - return $result; - } - - /** - * Returns the alternative number for a given date property if available in the current locale. - * - * @param string $key date property - * - * @return string - */ - public function getAltNumber(string $key): string - { - return $this->translateNumber(\strlen($key) > 1 ? $this->$key : $this->rawFormat('h')); - } - - /** - * Format in the current language using ISO replacement patterns. - * - * @param string $format - * @param string|null $originalFormat provide context if a chunk has been passed alone - * - * @return string - */ - public function isoFormat(string $format, ?string $originalFormat = null): string - { - $result = ''; - $length = mb_strlen($format); - $originalFormat = $originalFormat ?: $format; - $inEscaped = false; - $formats = null; - $units = null; - - for ($i = 0; $i < $length; $i++) { - $char = mb_substr($format, $i, 1); - - if ($char === '\\') { - $result .= mb_substr($format, ++$i, 1); - - continue; - } - - if ($char === '[' && !$inEscaped) { - $inEscaped = true; - - continue; - } - - if ($char === ']' && $inEscaped) { - $inEscaped = false; - - continue; - } - - if ($inEscaped) { - $result .= $char; - - continue; - } - - $input = mb_substr($format, $i); - - if (preg_match('/^(LTS|LT|l{1,4}|L{1,4})/', $input, $match)) { - if ($formats === null) { - $formats = $this->getIsoFormats(); - } - - $code = $match[0]; - $sequence = $formats[$code] ?? preg_replace_callback( - '/MMMM|MM|DD|dddd/', - function ($code) { - return mb_substr($code[0], 1); - }, - $formats[strtoupper($code)] ?? '' - ); - $rest = mb_substr($format, $i + mb_strlen($code)); - $format = mb_substr($format, 0, $i).$sequence.$rest; - $length = mb_strlen($format); - $input = $sequence.$rest; - } - - if (preg_match('/^'.CarbonInterface::ISO_FORMAT_REGEXP.'/', $input, $match)) { - $code = $match[0]; - - if ($units === null) { - $units = static::getIsoUnits(); - } - - $sequence = $units[$code] ?? ''; - - if ($sequence instanceof Closure) { - $sequence = $sequence($this, $originalFormat); - } elseif (\is_array($sequence)) { - try { - $sequence = $this->{$sequence[0]}(...$sequence[1]); - } catch (ReflectionException | InvalidArgumentException | BadMethodCallException $e) { - $sequence = ''; - } - } elseif (\is_string($sequence)) { - $sequence = $this->$sequence ?? $code; - } - - $format = mb_substr($format, 0, $i).$sequence.mb_substr($format, $i + mb_strlen($code)); - $i += mb_strlen((string) $sequence) - 1; - $length = mb_strlen($format); - $char = $sequence; - } - - $result .= $char; - } - - return $result; - } - - /** - * List of replacements from date() format to isoFormat(). - * - * @return array - */ - public static function getFormatsToIsoReplacements() - { - static $replacements = null; - - if ($replacements === null) { - $replacements = [ - 'd' => true, - 'D' => 'ddd', - 'j' => true, - 'l' => 'dddd', - 'N' => true, - 'S' => function ($date) { - $day = $date->rawFormat('j'); - - return str_replace((string) $day, '', $date->isoFormat('Do')); - }, - 'w' => true, - 'z' => true, - 'W' => true, - 'F' => 'MMMM', - 'm' => true, - 'M' => 'MMM', - 'n' => true, - 't' => true, - 'L' => true, - 'o' => true, - 'Y' => true, - 'y' => true, - 'a' => 'a', - 'A' => 'A', - 'B' => true, - 'g' => true, - 'G' => true, - 'h' => true, - 'H' => true, - 'i' => true, - 's' => true, - 'u' => true, - 'v' => true, - 'E' => true, - 'I' => true, - 'O' => true, - 'P' => true, - 'Z' => true, - 'c' => true, - 'r' => true, - 'U' => true, - ]; - } - - return $replacements; - } - - /** - * Format as ->format() do (using date replacements patterns from https://php.net/manual/en/function.date.php) - * but translate words whenever possible (months, day names, etc.) using the current locale. - * - * @param string $format - * - * @return string - */ - public function translatedFormat(string $format): string - { - $replacements = static::getFormatsToIsoReplacements(); - $context = ''; - $isoFormat = ''; - $length = mb_strlen($format); - - for ($i = 0; $i < $length; $i++) { - $char = mb_substr($format, $i, 1); - - if ($char === '\\') { - $replacement = mb_substr($format, $i, 2); - $isoFormat .= $replacement; - $i++; - - continue; - } - - if (!isset($replacements[$char])) { - $replacement = preg_match('/^[A-Za-z]$/', $char) ? "\\$char" : $char; - $isoFormat .= $replacement; - $context .= $replacement; - - continue; - } - - $replacement = $replacements[$char]; - - if ($replacement === true) { - static $contextReplacements = null; - - if ($contextReplacements === null) { - $contextReplacements = [ - 'm' => 'MM', - 'd' => 'DD', - 't' => 'D', - 'j' => 'D', - 'N' => 'e', - 'w' => 'e', - 'n' => 'M', - 'o' => 'YYYY', - 'Y' => 'YYYY', - 'y' => 'YY', - 'g' => 'h', - 'G' => 'H', - 'h' => 'hh', - 'H' => 'HH', - 'i' => 'mm', - 's' => 'ss', - ]; - } - - $isoFormat .= '['.$this->rawFormat($char).']'; - $context .= $contextReplacements[$char] ?? ' '; - - continue; - } - - if ($replacement instanceof Closure) { - $replacement = '['.$replacement($this).']'; - $isoFormat .= $replacement; - $context .= $replacement; - - continue; - } - - $isoFormat .= $replacement; - $context .= $replacement; - } - - return $this->isoFormat($isoFormat, $context); - } - - /** - * Returns the offset hour and minute formatted with +/- and a given separator (":" by default). - * For example, if the time zone is 9 hours 30 minutes, you'll get "+09:30", with "@@" as first - * argument, "+09@@30", with "" as first argument, "+0930". Negative offset will return something - * like "-12:00". - * - * @param string $separator string to place between hours and minutes (":" by default) - * - * @return string - */ - public function getOffsetString($separator = ':') - { - $second = $this->getOffset(); - $symbol = $second < 0 ? '-' : '+'; - $minute = abs($second) / static::SECONDS_PER_MINUTE; - $hour = str_pad((string) floor($minute / static::MINUTES_PER_HOUR), 2, '0', STR_PAD_LEFT); - $minute = str_pad((string) (((int) $minute) % static::MINUTES_PER_HOUR), 2, '0', STR_PAD_LEFT); - - return "$symbol$hour$separator$minute"; - } - - protected static function executeStaticCallable($macro, ...$parameters) - { - return static::bindMacroContext(null, function () use (&$macro, &$parameters) { - if ($macro instanceof Closure) { - $boundMacro = @Closure::bind($macro, null, static::class); - - return ($boundMacro ?: $macro)(...$parameters); - } - - return $macro(...$parameters); - }); - } - - /** - * Dynamically handle calls to the class. - * - * @param string $method magic method name called - * @param array $parameters parameters list - * - * @throws BadMethodCallException - * - * @return mixed - */ - public static function __callStatic($method, $parameters) - { - if (!static::hasMacro($method)) { - foreach (static::getGenericMacros() as $callback) { - try { - return static::executeStaticCallable($callback, $method, ...$parameters); - } catch (BadMethodCallException $exception) { - continue; - } - } - if (static::isStrictModeEnabled()) { - throw new UnknownMethodException(sprintf('%s::%s', static::class, $method)); - } - - return null; - } - - return static::executeStaticCallable(static::$globalMacros[$method], ...$parameters); - } - - /** - * Set specified unit to new given value. - * - * @param string $unit year, month, day, hour, minute, second or microsecond - * @param int $value new value for given unit - * - * @return static - */ - public function setUnit($unit, $value = null) - { - $unit = static::singularUnit($unit); - $dateUnits = ['year', 'month', 'day']; - if (\in_array($unit, $dateUnits)) { - return $this->setDate(...array_map(function ($name) use ($unit, $value) { - return (int) ($name === $unit ? $value : $this->$name); - }, $dateUnits)); - } - - $units = ['hour', 'minute', 'second', 'micro']; - if ($unit === 'millisecond' || $unit === 'milli') { - $value *= 1000; - $unit = 'micro'; - } elseif ($unit === 'microsecond') { - $unit = 'micro'; - } - - return $this->setTime(...array_map(function ($name) use ($unit, $value) { - return (int) ($name === $unit ? $value : $this->$name); - }, $units)); - } - - /** - * Returns standardized singular of a given singular/plural unit name (in English). - * - * @param string $unit - * - * @return string - */ - public static function singularUnit(string $unit): string - { - $unit = rtrim(mb_strtolower($unit), 's'); - - if ($unit === 'centurie') { - return 'century'; - } - - if ($unit === 'millennia') { - return 'millennium'; - } - - return $unit; - } - - /** - * Returns standardized plural of a given singular/plural unit name (in English). - * - * @param string $unit - * - * @return string - */ - public static function pluralUnit(string $unit): string - { - $unit = rtrim(strtolower($unit), 's'); - - if ($unit === 'century') { - return 'centuries'; - } - - if ($unit === 'millennium' || $unit === 'millennia') { - return 'millennia'; - } - - return "{$unit}s"; - } - - protected function executeCallable($macro, ...$parameters) - { - if ($macro instanceof Closure) { - $boundMacro = @$macro->bindTo($this, static::class) ?: @$macro->bindTo(null, static::class); - - return ($boundMacro ?: $macro)(...$parameters); - } - - return $macro(...$parameters); - } - - protected function executeCallableWithContext($macro, ...$parameters) - { - return static::bindMacroContext($this, function () use (&$macro, &$parameters) { - return $this->executeCallable($macro, ...$parameters); - }); - } - - protected static function getGenericMacros() - { - foreach (static::$globalGenericMacros as $list) { - foreach ($list as $macro) { - yield $macro; - } - } - } - - /** - * Dynamically handle calls to the class. - * - * @param string $method magic method name called - * @param array $parameters parameters list - * - * @throws UnknownMethodException|BadMethodCallException|ReflectionException|Throwable - * - * @return mixed - */ - public function __call($method, $parameters) - { - $diffSizes = [ - // @mode diffForHumans - 'short' => true, - // @mode diffForHumans - 'long' => false, - ]; - $diffSyntaxModes = [ - // @call diffForHumans - 'Absolute' => CarbonInterface::DIFF_ABSOLUTE, - // @call diffForHumans - 'Relative' => CarbonInterface::DIFF_RELATIVE_AUTO, - // @call diffForHumans - 'RelativeToNow' => CarbonInterface::DIFF_RELATIVE_TO_NOW, - // @call diffForHumans - 'RelativeToOther' => CarbonInterface::DIFF_RELATIVE_TO_OTHER, - ]; - $sizePattern = implode('|', array_keys($diffSizes)); - $syntaxPattern = implode('|', array_keys($diffSyntaxModes)); - - if (preg_match("/^(?<size>$sizePattern)(?<syntax>$syntaxPattern)DiffForHumans$/", $method, $match)) { - $dates = array_filter($parameters, function ($parameter) { - return $parameter instanceof DateTimeInterface; - }); - $other = null; - - if (\count($dates)) { - $key = key($dates); - $other = current($dates); - array_splice($parameters, $key, 1); - } - - return $this->diffForHumans($other, $diffSyntaxModes[$match['syntax']], $diffSizes[$match['size']], ...$parameters); - } - - $roundedValue = $this->callRoundMethod($method, $parameters); - - if ($roundedValue !== null) { - return $roundedValue; - } - - $unit = rtrim($method, 's'); - - if (str_starts_with($unit, 'is')) { - $word = substr($unit, 2); - - if (\in_array($word, static::$days, true)) { - return $this->isDayOfWeek($word); - } - - switch ($word) { - // @call is Check if the current instance has UTC timezone. (Both isUtc and isUTC cases are valid.) - case 'Utc': - case 'UTC': - return $this->utc; - // @call is Check if the current instance has non-UTC timezone. - case 'Local': - return $this->local; - // @call is Check if the current instance is a valid date. - case 'Valid': - return $this->year !== 0; - // @call is Check if the current instance is in a daylight saving time. - case 'DST': - return $this->dst; - } - } - - $action = substr($unit, 0, 3); - $overflow = null; - - if ($action === 'set') { - $unit = strtolower(substr($unit, 3)); - } - - if (\in_array($unit, static::$units, true)) { - return $this->setUnit($unit, ...$parameters); - } - - if ($action === 'add' || $action === 'sub') { - $unit = substr($unit, 3); - - if (str_starts_with($unit, 'Real')) { - $unit = static::singularUnit(substr($unit, 4)); - - return $this->{"{$action}RealUnit"}($unit, ...$parameters); - } - - if (preg_match('/^(Month|Quarter|Year|Decade|Century|Centurie|Millennium|Millennia)s?(No|With|Without|WithNo)Overflow$/', $unit, $match)) { - $unit = $match[1]; - $overflow = $match[2] === 'With'; - } - - $unit = static::singularUnit($unit); - } - - if (static::isModifiableUnit($unit)) { - return $this->{"{$action}Unit"}($unit, $this->getMagicParameter($parameters, 0, 'value', 1), $overflow); - } - - $sixFirstLetters = substr($unit, 0, 6); - $factor = -1; - - if ($sixFirstLetters === 'isLast') { - $sixFirstLetters = 'isNext'; - $factor = 1; - } - - if ($sixFirstLetters === 'isNext') { - $lowerUnit = strtolower(substr($unit, 6)); - - if (static::isModifiableUnit($lowerUnit)) { - return $this->copy()->addUnit($lowerUnit, $factor, false)->isSameUnit($lowerUnit, ...$parameters); - } - } - - if ($sixFirstLetters === 'isSame') { - try { - return $this->isSameUnit(strtolower(substr($unit, 6)), ...$parameters); - } catch (BadComparisonUnitException $exception) { - // Try next - } - } - - if (str_starts_with($unit, 'isCurrent')) { - try { - return $this->isCurrentUnit(strtolower(substr($unit, 9))); - } catch (BadComparisonUnitException | BadMethodCallException $exception) { - // Try next - } - } - - if (str_ends_with($method, 'Until')) { - try { - $unit = static::singularUnit(substr($method, 0, -5)); - - return $this->range( - $this->getMagicParameter($parameters, 0, 'endDate', $this), - $this->getMagicParameter($parameters, 1, 'factor', 1), - $unit - ); - } catch (InvalidArgumentException $exception) { - // Try macros - } - } - - return static::bindMacroContext($this, function () use (&$method, &$parameters) { - $macro = $this->getLocalMacro($method); - - if (!$macro) { - foreach ([$this->localGenericMacros ?: [], static::getGenericMacros()] as $list) { - foreach ($list as $callback) { - try { - return $this->executeCallable($callback, $method, ...$parameters); - } catch (BadMethodCallException $exception) { - continue; - } - } - } - - if ($this->localStrictModeEnabled ?? static::isStrictModeEnabled()) { - throw new UnknownMethodException($method); - } - - return null; - } - - return $this->executeCallable($macro, ...$parameters); - }); - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/DeprecatedProperties.php b/vendor/nesbot/carbon/src/Carbon/Traits/DeprecatedProperties.php deleted file mode 100644 index 5acc6f5c..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Traits/DeprecatedProperties.php +++ /dev/null @@ -1,61 +0,0 @@ -<?php - -declare(strict_types=1); - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Traits; - -trait DeprecatedProperties -{ - /** - * the day of week in current locale LC_TIME - * - * @var string - * - * @deprecated It uses OS language package and strftime() which is deprecated since PHP 8.1. - * Use ->isoFormat('MMM') instead. - * Deprecated since 2.55.0 - */ - public $localeDayOfWeek; - - /** - * the abbreviated day of week in current locale LC_TIME - * - * @var string - * - * @deprecated It uses OS language package and strftime() which is deprecated since PHP 8.1. - * Use ->isoFormat('dddd') instead. - * Deprecated since 2.55.0 - */ - public $shortLocaleDayOfWeek; - - /** - * the month in current locale LC_TIME - * - * @var string - * - * @deprecated It uses OS language package and strftime() which is deprecated since PHP 8.1. - * Use ->isoFormat('ddd') instead. - * Deprecated since 2.55.0 - */ - public $localeMonth; - - /** - * the abbreviated month in current locale LC_TIME - * - * @var string - * - * @deprecated It uses OS language package and strftime() which is deprecated since PHP 8.1. - * Use ->isoFormat('MMMM') instead. - * Deprecated since 2.55.0 - */ - public $shortLocaleMonth; -} diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php b/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php deleted file mode 100644 index 4f1fceca..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php +++ /dev/null @@ -1,1182 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Traits; - -use Carbon\Carbon; -use Carbon\CarbonImmutable; -use Carbon\CarbonInterface; -use Carbon\CarbonInterval; -use Carbon\CarbonPeriod; -use Carbon\Translator; -use Closure; -use DateInterval; -use DateTimeInterface; -use ReturnTypeWillChange; - -/** - * Trait Difference. - * - * Depends on the following methods: - * - * @method bool lessThan($date) - * @method static copy() - * @method static resolveCarbon($date = null) - * @method static Translator translator() - */ -trait Difference -{ - /** - * @codeCoverageIgnore - * - * @param CarbonInterval $diff - */ - protected static function fixNegativeMicroseconds(CarbonInterval $diff) - { - if ($diff->s !== 0 || $diff->i !== 0 || $diff->h !== 0 || $diff->d !== 0 || $diff->m !== 0 || $diff->y !== 0) { - $diff->f = (round($diff->f * 1000000) + 1000000) / 1000000; - $diff->s--; - - if ($diff->s < 0) { - $diff->s += 60; - $diff->i--; - - if ($diff->i < 0) { - $diff->i += 60; - $diff->h--; - - if ($diff->h < 0) { - $diff->h += 24; - $diff->d--; - - if ($diff->d < 0) { - $diff->d += 30; - $diff->m--; - - if ($diff->m < 0) { - $diff->m += 12; - $diff->y--; - } - } - } - } - } - - return; - } - - $diff->f *= -1; - $diff->invert(); - } - - /** - * @param DateInterval $diff - * @param bool $absolute - * - * @return CarbonInterval - */ - protected static function fixDiffInterval(DateInterval $diff, $absolute, array $skip = []) - { - $diff = CarbonInterval::instance($diff, $skip); - - // Work-around for https://bugs.php.net/bug.php?id=77145 - // @codeCoverageIgnoreStart - if ($diff->f > 0 && $diff->y === -1 && $diff->m === 11 && $diff->d >= 27 && $diff->h === 23 && $diff->i === 59 && $diff->s === 59) { - $diff->y = 0; - $diff->m = 0; - $diff->d = 0; - $diff->h = 0; - $diff->i = 0; - $diff->s = 0; - $diff->f = (1000000 - round($diff->f * 1000000)) / 1000000; - $diff->invert(); - } elseif ($diff->f < 0) { - static::fixNegativeMicroseconds($diff); - } - // @codeCoverageIgnoreEnd - - if ($absolute && $diff->invert) { - $diff->invert(); - } - - return $diff; - } - - /** - * Get the difference as a DateInterval instance. - * Return relative interval (negative if $absolute flag is not set to true and the given date is before - * current one). - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return DateInterval - */ - #[ReturnTypeWillChange] - public function diff($date = null, $absolute = false) - { - $other = $this->resolveCarbon($date); - - // Work-around for https://bugs.php.net/bug.php?id=81458 - // It was initially introduced for https://bugs.php.net/bug.php?id=80998 - // The very specific case of 80998 was fixed in PHP 8.1beta3, but it introduced 81458 - // So we still need to keep this for now - // @codeCoverageIgnoreStart - if (version_compare(PHP_VERSION, '8.1.0-dev', '>=') && $other->tz !== $this->tz) { - $other = $other->avoidMutation()->tz($this->tz); - } - // @codeCoverageIgnoreEnd - - return parent::diff($other, (bool) $absolute); - } - - /** - * Get the difference as a CarbonInterval instance. - * Return relative interval (negative if $absolute flag is not set to true and the given date is before - * current one). - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return CarbonInterval - */ - public function diffAsCarbonInterval($date = null, $absolute = true, array $skip = []) - { - return static::fixDiffInterval($this->diff($this->resolveCarbon($date), $absolute), $absolute, $skip); - } - - /** - * Get the difference in years - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInYears($date = null, $absolute = true) - { - return (int) $this->diff($this->resolveCarbon($date), $absolute)->format('%r%y'); - } - - /** - * Get the difference in quarters rounded down. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInQuarters($date = null, $absolute = true) - { - return (int) ($this->diffInMonths($date, $absolute) / static::MONTHS_PER_QUARTER); - } - - /** - * Get the difference in months rounded down. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInMonths($date = null, $absolute = true) - { - $date = $this->resolveCarbon($date)->avoidMutation()->tz($this->tz); - - [$yearStart, $monthStart, $dayStart] = explode('-', $this->format('Y-m-dHisu')); - [$yearEnd, $monthEnd, $dayEnd] = explode('-', $date->format('Y-m-dHisu')); - - $diff = (((int) $yearEnd) - ((int) $yearStart)) * static::MONTHS_PER_YEAR + - ((int) $monthEnd) - ((int) $monthStart); - - if ($diff > 0) { - $diff -= ($dayStart > $dayEnd ? 1 : 0); - } elseif ($diff < 0) { - $diff += ($dayStart < $dayEnd ? 1 : 0); - } - - return $absolute ? abs($diff) : $diff; - } - - /** - * Get the difference in weeks rounded down. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInWeeks($date = null, $absolute = true) - { - return (int) ($this->diffInDays($date, $absolute) / static::DAYS_PER_WEEK); - } - - /** - * Get the difference in days rounded down. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInDays($date = null, $absolute = true) - { - return $this->getIntervalDayDiff($this->diff($this->resolveCarbon($date), $absolute)); - } - - /** - * Get the difference in days using a filter closure rounded down. - * - * @param Closure $callback - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInDaysFiltered(Closure $callback, $date = null, $absolute = true) - { - return $this->diffFiltered(CarbonInterval::day(), $callback, $date, $absolute); - } - - /** - * Get the difference in hours using a filter closure rounded down. - * - * @param Closure $callback - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInHoursFiltered(Closure $callback, $date = null, $absolute = true) - { - return $this->diffFiltered(CarbonInterval::hour(), $callback, $date, $absolute); - } - - /** - * Get the difference by the given interval using a filter closure. - * - * @param CarbonInterval $ci An interval to traverse by - * @param Closure $callback - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffFiltered(CarbonInterval $ci, Closure $callback, $date = null, $absolute = true) - { - $start = $this; - $end = $this->resolveCarbon($date); - $inverse = false; - - if ($end < $start) { - $start = $end; - $end = $this; - $inverse = true; - } - - $options = CarbonPeriod::EXCLUDE_END_DATE | ($this->isMutable() ? 0 : CarbonPeriod::IMMUTABLE); - $diff = $ci->toPeriod($start, $end, $options)->filter($callback)->count(); - - return $inverse && !$absolute ? -$diff : $diff; - } - - /** - * Get the difference in weekdays rounded down. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInWeekdays($date = null, $absolute = true) - { - return $this->diffInDaysFiltered(function (CarbonInterface $date) { - return $date->isWeekday(); - }, $date, $absolute); - } - - /** - * Get the difference in weekend days using a filter rounded down. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInWeekendDays($date = null, $absolute = true) - { - return $this->diffInDaysFiltered(function (CarbonInterface $date) { - return $date->isWeekend(); - }, $date, $absolute); - } - - /** - * Get the difference in hours rounded down. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInHours($date = null, $absolute = true) - { - return (int) ($this->diffInSeconds($date, $absolute) / static::SECONDS_PER_MINUTE / static::MINUTES_PER_HOUR); - } - - /** - * Get the difference in hours rounded down using timestamps. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInRealHours($date = null, $absolute = true) - { - return (int) ($this->diffInRealSeconds($date, $absolute) / static::SECONDS_PER_MINUTE / static::MINUTES_PER_HOUR); - } - - /** - * Get the difference in minutes rounded down. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInMinutes($date = null, $absolute = true) - { - return (int) ($this->diffInSeconds($date, $absolute) / static::SECONDS_PER_MINUTE); - } - - /** - * Get the difference in minutes rounded down using timestamps. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInRealMinutes($date = null, $absolute = true) - { - return (int) ($this->diffInRealSeconds($date, $absolute) / static::SECONDS_PER_MINUTE); - } - - /** - * Get the difference in seconds rounded down. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInSeconds($date = null, $absolute = true) - { - $diff = $this->diff($date); - - if ($diff->days === 0) { - $diff = static::fixDiffInterval($diff, $absolute); - } - - $value = (((($diff->m || $diff->y ? $diff->days : $diff->d) * static::HOURS_PER_DAY) + - $diff->h) * static::MINUTES_PER_HOUR + - $diff->i) * static::SECONDS_PER_MINUTE + - $diff->s; - - return $absolute || !$diff->invert ? $value : -$value; - } - - /** - * Get the difference in microseconds. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInMicroseconds($date = null, $absolute = true) - { - $diff = $this->diff($date); - $value = (int) round(((((($diff->m || $diff->y ? $diff->days : $diff->d) * static::HOURS_PER_DAY) + - $diff->h) * static::MINUTES_PER_HOUR + - $diff->i) * static::SECONDS_PER_MINUTE + - ($diff->f + $diff->s)) * static::MICROSECONDS_PER_SECOND); - - return $absolute || !$diff->invert ? $value : -$value; - } - - /** - * Get the difference in milliseconds rounded down. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInMilliseconds($date = null, $absolute = true) - { - return (int) ($this->diffInMicroseconds($date, $absolute) / static::MICROSECONDS_PER_MILLISECOND); - } - - /** - * Get the difference in seconds using timestamps. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInRealSeconds($date = null, $absolute = true) - { - /** @var CarbonInterface $date */ - $date = $this->resolveCarbon($date); - $value = $date->getTimestamp() - $this->getTimestamp(); - - return $absolute ? abs($value) : $value; - } - - /** - * Get the difference in microseconds using timestamps. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInRealMicroseconds($date = null, $absolute = true) - { - /** @var CarbonInterface $date */ - $date = $this->resolveCarbon($date); - $value = ($date->timestamp - $this->timestamp) * static::MICROSECONDS_PER_SECOND + - $date->micro - $this->micro; - - return $absolute ? abs($value) : $value; - } - - /** - * Get the difference in milliseconds rounded down using timestamps. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInRealMilliseconds($date = null, $absolute = true) - { - return (int) ($this->diffInRealMicroseconds($date, $absolute) / static::MICROSECONDS_PER_MILLISECOND); - } - - /** - * Get the difference in seconds as float (microsecond-precision). - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return float - */ - public function floatDiffInSeconds($date = null, $absolute = true) - { - return (float) ($this->diffInMicroseconds($date, $absolute) / static::MICROSECONDS_PER_SECOND); - } - - /** - * Get the difference in minutes as float (microsecond-precision). - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return float - */ - public function floatDiffInMinutes($date = null, $absolute = true) - { - return $this->floatDiffInSeconds($date, $absolute) / static::SECONDS_PER_MINUTE; - } - - /** - * Get the difference in hours as float (microsecond-precision). - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return float - */ - public function floatDiffInHours($date = null, $absolute = true) - { - return $this->floatDiffInMinutes($date, $absolute) / static::MINUTES_PER_HOUR; - } - - /** - * Get the difference in days as float (microsecond-precision). - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return float - */ - public function floatDiffInDays($date = null, $absolute = true) - { - $hoursDiff = $this->floatDiffInHours($date, $absolute); - $interval = $this->diff($date, $absolute); - - if ($interval->y === 0 && $interval->m === 0 && $interval->d === 0) { - return $hoursDiff / static::HOURS_PER_DAY; - } - - $daysDiff = $this->getIntervalDayDiff($interval); - - return $daysDiff + fmod($hoursDiff, static::HOURS_PER_DAY) / static::HOURS_PER_DAY; - } - - /** - * Get the difference in weeks as float (microsecond-precision). - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return float - */ - public function floatDiffInWeeks($date = null, $absolute = true) - { - return $this->floatDiffInDays($date, $absolute) / static::DAYS_PER_WEEK; - } - - /** - * Get the difference in months as float (microsecond-precision). - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return float - */ - public function floatDiffInMonths($date = null, $absolute = true) - { - $start = $this; - $end = $this->resolveCarbon($date); - $ascending = ($start <= $end); - $sign = $absolute || $ascending ? 1 : -1; - if (!$ascending) { - [$start, $end] = [$end, $start]; - } - $monthsDiff = $start->diffInMonths($end); - /** @var Carbon|CarbonImmutable $floorEnd */ - $floorEnd = $start->avoidMutation()->addMonths($monthsDiff); - - if ($floorEnd >= $end) { - return $sign * $monthsDiff; - } - - /** @var Carbon|CarbonImmutable $startOfMonthAfterFloorEnd */ - $startOfMonthAfterFloorEnd = $floorEnd->avoidMutation()->addMonth()->startOfMonth(); - - if ($startOfMonthAfterFloorEnd > $end) { - return $sign * ($monthsDiff + $floorEnd->floatDiffInDays($end) / $floorEnd->daysInMonth); - } - - return $sign * ($monthsDiff + $floorEnd->floatDiffInDays($startOfMonthAfterFloorEnd) / $floorEnd->daysInMonth + $startOfMonthAfterFloorEnd->floatDiffInDays($end) / $end->daysInMonth); - } - - /** - * Get the difference in year as float (microsecond-precision). - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return float - */ - public function floatDiffInYears($date = null, $absolute = true) - { - $start = $this; - $end = $this->resolveCarbon($date); - $ascending = ($start <= $end); - $sign = $absolute || $ascending ? 1 : -1; - if (!$ascending) { - [$start, $end] = [$end, $start]; - } - $yearsDiff = $start->diffInYears($end); - /** @var Carbon|CarbonImmutable $floorEnd */ - $floorEnd = $start->avoidMutation()->addYears($yearsDiff); - - if ($floorEnd >= $end) { - return $sign * $yearsDiff; - } - - /** @var Carbon|CarbonImmutable $startOfYearAfterFloorEnd */ - $startOfYearAfterFloorEnd = $floorEnd->avoidMutation()->addYear()->startOfYear(); - - if ($startOfYearAfterFloorEnd > $end) { - return $sign * ($yearsDiff + $floorEnd->floatDiffInDays($end) / $floorEnd->daysInYear); - } - - return $sign * ($yearsDiff + $floorEnd->floatDiffInDays($startOfYearAfterFloorEnd) / $floorEnd->daysInYear + $startOfYearAfterFloorEnd->floatDiffInDays($end) / $end->daysInYear); - } - - /** - * Get the difference in seconds as float (microsecond-precision) using timestamps. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return float - */ - public function floatDiffInRealSeconds($date = null, $absolute = true) - { - return $this->diffInRealMicroseconds($date, $absolute) / static::MICROSECONDS_PER_SECOND; - } - - /** - * Get the difference in minutes as float (microsecond-precision) using timestamps. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return float - */ - public function floatDiffInRealMinutes($date = null, $absolute = true) - { - return $this->floatDiffInRealSeconds($date, $absolute) / static::SECONDS_PER_MINUTE; - } - - /** - * Get the difference in hours as float (microsecond-precision) using timestamps. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return float - */ - public function floatDiffInRealHours($date = null, $absolute = true) - { - return $this->floatDiffInRealMinutes($date, $absolute) / static::MINUTES_PER_HOUR; - } - - /** - * Get the difference in days as float (microsecond-precision). - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return float - */ - public function floatDiffInRealDays($date = null, $absolute = true) - { - $date = $this->resolveUTC($date); - $utc = $this->avoidMutation()->utc(); - $hoursDiff = $utc->floatDiffInRealHours($date, $absolute); - - return ($hoursDiff < 0 ? -1 : 1) * $utc->diffInDays($date) + fmod($hoursDiff, static::HOURS_PER_DAY) / static::HOURS_PER_DAY; - } - - /** - * Get the difference in weeks as float (microsecond-precision). - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return float - */ - public function floatDiffInRealWeeks($date = null, $absolute = true) - { - return $this->floatDiffInRealDays($date, $absolute) / static::DAYS_PER_WEEK; - } - - /** - * Get the difference in months as float (microsecond-precision) using timestamps. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return float - */ - public function floatDiffInRealMonths($date = null, $absolute = true) - { - $start = $this; - $end = $this->resolveCarbon($date); - $ascending = ($start <= $end); - $sign = $absolute || $ascending ? 1 : -1; - if (!$ascending) { - [$start, $end] = [$end, $start]; - } - $monthsDiff = $start->diffInMonths($end); - /** @var Carbon|CarbonImmutable $floorEnd */ - $floorEnd = $start->avoidMutation()->addMonths($monthsDiff); - - if ($floorEnd >= $end) { - return $sign * $monthsDiff; - } - - /** @var Carbon|CarbonImmutable $startOfMonthAfterFloorEnd */ - $startOfMonthAfterFloorEnd = $floorEnd->avoidMutation()->addMonth()->startOfMonth(); - - if ($startOfMonthAfterFloorEnd > $end) { - return $sign * ($monthsDiff + $floorEnd->floatDiffInRealDays($end) / $floorEnd->daysInMonth); - } - - return $sign * ($monthsDiff + $floorEnd->floatDiffInRealDays($startOfMonthAfterFloorEnd) / $floorEnd->daysInMonth + $startOfMonthAfterFloorEnd->floatDiffInRealDays($end) / $end->daysInMonth); - } - - /** - * Get the difference in year as float (microsecond-precision) using timestamps. - * - * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return float - */ - public function floatDiffInRealYears($date = null, $absolute = true) - { - $start = $this; - $end = $this->resolveCarbon($date); - $ascending = ($start <= $end); - $sign = $absolute || $ascending ? 1 : -1; - if (!$ascending) { - [$start, $end] = [$end, $start]; - } - $yearsDiff = $start->diffInYears($end); - /** @var Carbon|CarbonImmutable $floorEnd */ - $floorEnd = $start->avoidMutation()->addYears($yearsDiff); - - if ($floorEnd >= $end) { - return $sign * $yearsDiff; - } - - /** @var Carbon|CarbonImmutable $startOfYearAfterFloorEnd */ - $startOfYearAfterFloorEnd = $floorEnd->avoidMutation()->addYear()->startOfYear(); - - if ($startOfYearAfterFloorEnd > $end) { - return $sign * ($yearsDiff + $floorEnd->floatDiffInRealDays($end) / $floorEnd->daysInYear); - } - - return $sign * ($yearsDiff + $floorEnd->floatDiffInRealDays($startOfYearAfterFloorEnd) / $floorEnd->daysInYear + $startOfYearAfterFloorEnd->floatDiffInRealDays($end) / $end->daysInYear); - } - - /** - * The number of seconds since midnight. - * - * @return int - */ - public function secondsSinceMidnight() - { - return $this->diffInSeconds($this->avoidMutation()->startOfDay()); - } - - /** - * The number of seconds until 23:59:59. - * - * @return int - */ - public function secondsUntilEndOfDay() - { - return $this->diffInSeconds($this->avoidMutation()->endOfDay()); - } - - /** - * Get the difference in a human readable format in the current locale from current instance to an other - * instance given (or now if null given). - * - * @example - * ``` - * echo Carbon::tomorrow()->diffForHumans() . "\n"; - * echo Carbon::tomorrow()->diffForHumans(['parts' => 2]) . "\n"; - * echo Carbon::tomorrow()->diffForHumans(['parts' => 3, 'join' => true]) . "\n"; - * echo Carbon::tomorrow()->diffForHumans(Carbon::yesterday()) . "\n"; - * echo Carbon::tomorrow()->diffForHumans(Carbon::yesterday(), ['short' => true]) . "\n"; - * ``` - * - * @param Carbon|\DateTimeInterface|string|array|null $other if array passed, will be used as parameters array, see $syntax below; - * if null passed, now will be used as comparison reference; - * if any other type, it will be converted to date and used as reference. - * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: - * - 'syntax' entry (see below) - * - 'short' entry (see below) - * - 'parts' entry (see below) - * - 'options' entry (see below) - * - 'skip' entry, list of units to skip (array of strings or a single string, - * ` it can be the unit name (singular or plural) or its shortcut - * ` (y, m, w, d, h, min, s, ms, µs). - * - 'aUnit' entry, prefer "an hour" over "1 hour" if true - * - 'join' entry determines how to join multiple parts of the string - * ` - if $join is a string, it's used as a joiner glue - * ` - if $join is a callable/closure, it get the list of string and should return a string - * ` - if $join is an array, the first item will be the default glue, and the second item - * ` will be used instead of the glue for the last item - * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) - * ` - if $join is missing, a space will be used as glue - * - 'other' entry (see above) - * - 'minimumUnit' entry determines the smallest unit of time to display can be long or - * ` short form of the units, e.g. 'hour' or 'h' (default value: s) - * if int passed, it add modifiers: - * Possible values: - * - CarbonInterface::DIFF_ABSOLUTE no modifiers - * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier - * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier - * Default value: CarbonInterface::DIFF_ABSOLUTE - * @param bool $short displays short format of time units - * @param int $parts maximum number of parts to display (default value: 1: single unit) - * @param int $options human diff options - * - * @return string - */ - public function diffForHumans($other = null, $syntax = null, $short = false, $parts = 1, $options = null) - { - /* @var CarbonInterface $this */ - if (\is_array($other)) { - $other['syntax'] = \array_key_exists('syntax', $other) ? $other['syntax'] : $syntax; - $syntax = $other; - $other = $syntax['other'] ?? null; - } - - $intSyntax = &$syntax; - if (\is_array($syntax)) { - $syntax['syntax'] = $syntax['syntax'] ?? null; - $intSyntax = &$syntax['syntax']; - } - $intSyntax = (int) ($intSyntax ?? static::DIFF_RELATIVE_AUTO); - $intSyntax = $intSyntax === static::DIFF_RELATIVE_AUTO && $other === null ? static::DIFF_RELATIVE_TO_NOW : $intSyntax; - - $parts = min(7, max(1, (int) $parts)); - $skip = \is_array($syntax) ? ($syntax['skip'] ?? []) : []; - - return $this->diffAsCarbonInterval($other, false, $skip) - ->setLocalTranslator($this->getLocalTranslator()) - ->forHumans($syntax, (bool) $short, $parts, $options ?? $this->localHumanDiffOptions ?? static::getHumanDiffOptions()); - } - - /** - * @alias diffForHumans - * - * Get the difference in a human readable format in the current locale from current instance to an other - * instance given (or now if null given). - * - * @param Carbon|\DateTimeInterface|string|array|null $other if array passed, will be used as parameters array, see $syntax below; - * if null passed, now will be used as comparison reference; - * if any other type, it will be converted to date and used as reference. - * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: - * - 'syntax' entry (see below) - * - 'short' entry (see below) - * - 'parts' entry (see below) - * - 'options' entry (see below) - * - 'join' entry determines how to join multiple parts of the string - * ` - if $join is a string, it's used as a joiner glue - * ` - if $join is a callable/closure, it get the list of string and should return a string - * ` - if $join is an array, the first item will be the default glue, and the second item - * ` will be used instead of the glue for the last item - * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) - * ` - if $join is missing, a space will be used as glue - * - 'other' entry (see above) - * if int passed, it add modifiers: - * Possible values: - * - CarbonInterface::DIFF_ABSOLUTE no modifiers - * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier - * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier - * Default value: CarbonInterface::DIFF_ABSOLUTE - * @param bool $short displays short format of time units - * @param int $parts maximum number of parts to display (default value: 1: single unit) - * @param int $options human diff options - * - * @return string - */ - public function from($other = null, $syntax = null, $short = false, $parts = 1, $options = null) - { - return $this->diffForHumans($other, $syntax, $short, $parts, $options); - } - - /** - * @alias diffForHumans - * - * Get the difference in a human readable format in the current locale from current instance to an other - * instance given (or now if null given). - */ - public function since($other = null, $syntax = null, $short = false, $parts = 1, $options = null) - { - return $this->diffForHumans($other, $syntax, $short, $parts, $options); - } - - /** - * Get the difference in a human readable format in the current locale from an other - * instance given (or now if null given) to current instance. - * - * When comparing a value in the past to default now: - * 1 hour from now - * 5 months from now - * - * When comparing a value in the future to default now: - * 1 hour ago - * 5 months ago - * - * When comparing a value in the past to another value: - * 1 hour after - * 5 months after - * - * When comparing a value in the future to another value: - * 1 hour before - * 5 months before - * - * @param Carbon|\DateTimeInterface|string|array|null $other if array passed, will be used as parameters array, see $syntax below; - * if null passed, now will be used as comparison reference; - * if any other type, it will be converted to date and used as reference. - * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: - * - 'syntax' entry (see below) - * - 'short' entry (see below) - * - 'parts' entry (see below) - * - 'options' entry (see below) - * - 'join' entry determines how to join multiple parts of the string - * ` - if $join is a string, it's used as a joiner glue - * ` - if $join is a callable/closure, it get the list of string and should return a string - * ` - if $join is an array, the first item will be the default glue, and the second item - * ` will be used instead of the glue for the last item - * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) - * ` - if $join is missing, a space will be used as glue - * - 'other' entry (see above) - * if int passed, it add modifiers: - * Possible values: - * - CarbonInterface::DIFF_ABSOLUTE no modifiers - * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier - * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier - * Default value: CarbonInterface::DIFF_ABSOLUTE - * @param bool $short displays short format of time units - * @param int $parts maximum number of parts to display (default value: 1: single unit) - * @param int $options human diff options - * - * @return string - */ - public function to($other = null, $syntax = null, $short = false, $parts = 1, $options = null) - { - if (!$syntax && !$other) { - $syntax = CarbonInterface::DIFF_RELATIVE_TO_NOW; - } - - return $this->resolveCarbon($other)->diffForHumans($this, $syntax, $short, $parts, $options); - } - - /** - * @alias to - * - * Get the difference in a human readable format in the current locale from an other - * instance given (or now if null given) to current instance. - * - * @param Carbon|\DateTimeInterface|string|array|null $other if array passed, will be used as parameters array, see $syntax below; - * if null passed, now will be used as comparison reference; - * if any other type, it will be converted to date and used as reference. - * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: - * - 'syntax' entry (see below) - * - 'short' entry (see below) - * - 'parts' entry (see below) - * - 'options' entry (see below) - * - 'join' entry determines how to join multiple parts of the string - * ` - if $join is a string, it's used as a joiner glue - * ` - if $join is a callable/closure, it get the list of string and should return a string - * ` - if $join is an array, the first item will be the default glue, and the second item - * ` will be used instead of the glue for the last item - * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) - * ` - if $join is missing, a space will be used as glue - * - 'other' entry (see above) - * if int passed, it add modifiers: - * Possible values: - * - CarbonInterface::DIFF_ABSOLUTE no modifiers - * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier - * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier - * Default value: CarbonInterface::DIFF_ABSOLUTE - * @param bool $short displays short format of time units - * @param int $parts maximum number of parts to display (default value: 1: single unit) - * @param int $options human diff options - * - * @return string - */ - public function until($other = null, $syntax = null, $short = false, $parts = 1, $options = null) - { - return $this->to($other, $syntax, $short, $parts, $options); - } - - /** - * Get the difference in a human readable format in the current locale from current - * instance to now. - * - * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: - * - 'syntax' entry (see below) - * - 'short' entry (see below) - * - 'parts' entry (see below) - * - 'options' entry (see below) - * - 'join' entry determines how to join multiple parts of the string - * ` - if $join is a string, it's used as a joiner glue - * ` - if $join is a callable/closure, it get the list of string and should return a string - * ` - if $join is an array, the first item will be the default glue, and the second item - * ` will be used instead of the glue for the last item - * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) - * ` - if $join is missing, a space will be used as glue - * if int passed, it add modifiers: - * Possible values: - * - CarbonInterface::DIFF_ABSOLUTE no modifiers - * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier - * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier - * Default value: CarbonInterface::DIFF_ABSOLUTE - * @param bool $short displays short format of time units - * @param int $parts maximum number of parts to display (default value: 1: single unit) - * @param int $options human diff options - * - * @return string - */ - public function fromNow($syntax = null, $short = false, $parts = 1, $options = null) - { - $other = null; - - if ($syntax instanceof DateTimeInterface) { - [$other, $syntax, $short, $parts, $options] = array_pad(\func_get_args(), 5, null); - } - - return $this->from($other, $syntax, $short, $parts, $options); - } - - /** - * Get the difference in a human readable format in the current locale from an other - * instance given to now - * - * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: - * - 'syntax' entry (see below) - * - 'short' entry (see below) - * - 'parts' entry (see below) - * - 'options' entry (see below) - * - 'join' entry determines how to join multiple parts of the string - * ` - if $join is a string, it's used as a joiner glue - * ` - if $join is a callable/closure, it get the list of string and should return a string - * ` - if $join is an array, the first item will be the default glue, and the second item - * ` will be used instead of the glue for the last item - * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) - * ` - if $join is missing, a space will be used as glue - * if int passed, it add modifiers: - * Possible values: - * - CarbonInterface::DIFF_ABSOLUTE no modifiers - * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier - * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier - * Default value: CarbonInterface::DIFF_ABSOLUTE - * @param bool $short displays short format of time units - * @param int $parts maximum number of parts to display (default value: 1: single part) - * @param int $options human diff options - * - * @return string - */ - public function toNow($syntax = null, $short = false, $parts = 1, $options = null) - { - return $this->to(null, $syntax, $short, $parts, $options); - } - - /** - * Get the difference in a human readable format in the current locale from an other - * instance given to now - * - * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: - * - 'syntax' entry (see below) - * - 'short' entry (see below) - * - 'parts' entry (see below) - * - 'options' entry (see below) - * - 'join' entry determines how to join multiple parts of the string - * ` - if $join is a string, it's used as a joiner glue - * ` - if $join is a callable/closure, it get the list of string and should return a string - * ` - if $join is an array, the first item will be the default glue, and the second item - * ` will be used instead of the glue for the last item - * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) - * ` - if $join is missing, a space will be used as glue - * if int passed, it add modifiers: - * Possible values: - * - CarbonInterface::DIFF_ABSOLUTE no modifiers - * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier - * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier - * Default value: CarbonInterface::DIFF_ABSOLUTE - * @param bool $short displays short format of time units - * @param int $parts maximum number of parts to display (default value: 1: single part) - * @param int $options human diff options - * - * @return string - */ - public function ago($syntax = null, $short = false, $parts = 1, $options = null) - { - $other = null; - - if ($syntax instanceof DateTimeInterface) { - [$other, $syntax, $short, $parts, $options] = array_pad(\func_get_args(), 5, null); - } - - return $this->from($other, $syntax, $short, $parts, $options); - } - - /** - * Get the difference in a human readable format in the current locale from current instance to an other - * instance given (or now if null given). - * - * @return string - */ - public function timespan($other = null, $timezone = null) - { - if (!$other instanceof DateTimeInterface) { - $other = static::parse($other, $timezone); - } - - return $this->diffForHumans($other, [ - 'join' => ', ', - 'syntax' => CarbonInterface::DIFF_ABSOLUTE, - 'options' => CarbonInterface::NO_ZERO_DIFF, - 'parts' => -1, - ]); - } - - /** - * Returns either day of week + time (e.g. "Last Friday at 3:30 PM") if reference time is within 7 days, - * or a calendar date (e.g. "10/29/2017") otherwise. - * - * Language, date and time formats will change according to the current locale. - * - * @param Carbon|\DateTimeInterface|string|null $referenceTime - * @param array $formats - * - * @return string - */ - public function calendar($referenceTime = null, array $formats = []) - { - /** @var CarbonInterface $current */ - $current = $this->avoidMutation()->startOfDay(); - /** @var CarbonInterface $other */ - $other = $this->resolveCarbon($referenceTime)->avoidMutation()->setTimezone($this->getTimezone())->startOfDay(); - $diff = $other->diffInDays($current, false); - $format = $diff < -6 ? 'sameElse' : ( - $diff < -1 ? 'lastWeek' : ( - $diff < 0 ? 'lastDay' : ( - $diff < 1 ? 'sameDay' : ( - $diff < 2 ? 'nextDay' : ( - $diff < 7 ? 'nextWeek' : 'sameElse' - ) - ) - ) - ) - ); - $format = array_merge($this->getCalendarFormats(), $formats)[$format]; - if ($format instanceof Closure) { - $format = $format($current, $other) ?? ''; - } - - return $this->isoFormat((string) $format); - } - - private function getIntervalDayDiff(DateInterval $interval): int - { - $daysDiff = (int) $interval->format('%a'); - $sign = $interval->format('%r') === '-' ? -1 : 1; - - if (\is_int($interval->days) && - $interval->y === 0 && - $interval->m === 0 && - version_compare(PHP_VERSION, '8.1.0-dev', '<') && - abs($interval->d - $daysDiff) === 1 - ) { - $daysDiff = abs($interval->d); // @codeCoverageIgnore - } - - return $daysDiff * $sign; - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/IntervalRounding.php b/vendor/nesbot/carbon/src/Carbon/Traits/IntervalRounding.php deleted file mode 100644 index 4cd66b67..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Traits/IntervalRounding.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Traits; - -use Carbon\CarbonInterval; -use Carbon\Exceptions\InvalidIntervalException; -use DateInterval; - -/** - * Trait to call rounding methods to interval or the interval of a period. - */ -trait IntervalRounding -{ - protected function callRoundMethod(string $method, array $parameters) - { - $action = substr($method, 0, 4); - - if ($action !== 'ceil') { - $action = substr($method, 0, 5); - } - - if (\in_array($action, ['round', 'floor', 'ceil'])) { - return $this->{$action.'Unit'}(substr($method, \strlen($action)), ...$parameters); - } - - return null; - } - - protected function roundWith($precision, $function) - { - $unit = 'second'; - - if ($precision instanceof DateInterval) { - $precision = (string) CarbonInterval::instance($precision); - } - - if (\is_string($precision) && preg_match('/^\s*(?<precision>\d+)?\s*(?<unit>\w+)(?<other>\W.*)?$/', $precision, $match)) { - if (trim($match['other'] ?? '') !== '') { - throw new InvalidIntervalException('Rounding is only possible with single unit intervals.'); - } - - $precision = (int) ($match['precision'] ?: 1); - $unit = $match['unit']; - } - - return $this->roundUnit($unit, $precision, $function); - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/IntervalStep.php b/vendor/nesbot/carbon/src/Carbon/Traits/IntervalStep.php deleted file mode 100644 index 82d7c326..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Traits/IntervalStep.php +++ /dev/null @@ -1,93 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Traits; - -use Carbon\Carbon; -use Carbon\CarbonImmutable; -use Carbon\CarbonInterface; -use Closure; -use DateTimeImmutable; -use DateTimeInterface; - -trait IntervalStep -{ - /** - * Step to apply instead of a fixed interval to get the new date. - * - * @var Closure|null - */ - protected $step; - - /** - * Get the dynamic step in use. - * - * @return Closure - */ - public function getStep(): ?Closure - { - return $this->step; - } - - /** - * Set a step to apply instead of a fixed interval to get the new date. - * - * Or pass null to switch to fixed interval. - * - * @param Closure|null $step - */ - public function setStep(?Closure $step): void - { - $this->step = $step; - } - - /** - * Take a date and apply either the step if set, or the current interval else. - * - * The interval/step is applied negatively (typically subtraction instead of addition) if $negated is true. - * - * @param DateTimeInterface $dateTime - * @param bool $negated - * - * @return CarbonInterface - */ - public function convertDate(DateTimeInterface $dateTime, bool $negated = false): CarbonInterface - { - /** @var CarbonInterface $carbonDate */ - $carbonDate = $dateTime instanceof CarbonInterface ? $dateTime : $this->resolveCarbon($dateTime); - - if ($this->step) { - return $carbonDate->setDateTimeFrom(($this->step)($carbonDate->avoidMutation(), $negated)); - } - - if ($negated) { - return $carbonDate->rawSub($this); - } - - return $carbonDate->rawAdd($this); - } - - /** - * Convert DateTimeImmutable instance to CarbonImmutable instance and DateTime instance to Carbon instance. - * - * @param DateTimeInterface $dateTime - * - * @return Carbon|CarbonImmutable - */ - private function resolveCarbon(DateTimeInterface $dateTime) - { - if ($dateTime instanceof DateTimeImmutable) { - return CarbonImmutable::instance($dateTime); - } - - return Carbon::instance($dateTime); - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php b/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php deleted file mode 100644 index ff249566..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php +++ /dev/null @@ -1,838 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Traits; - -use Carbon\CarbonInterface; -use Carbon\Exceptions\InvalidTypeException; -use Carbon\Exceptions\NotLocaleAwareException; -use Carbon\Language; -use Carbon\Translator; -use Carbon\TranslatorStrongTypeInterface; -use Closure; -use Symfony\Component\Translation\TranslatorBagInterface; -use Symfony\Component\Translation\TranslatorInterface; -use Symfony\Contracts\Translation\LocaleAwareInterface; -use Symfony\Contracts\Translation\TranslatorInterface as ContractsTranslatorInterface; - -if (interface_exists('Symfony\\Contracts\\Translation\\TranslatorInterface') && - !interface_exists('Symfony\\Component\\Translation\\TranslatorInterface') -) { - class_alias( - 'Symfony\\Contracts\\Translation\\TranslatorInterface', - 'Symfony\\Component\\Translation\\TranslatorInterface' - ); -} - -/** - * Trait Localization. - * - * Embed default and locale translators and translation base methods. - */ -trait Localization -{ - /** - * Default translator. - * - * @var \Symfony\Component\Translation\TranslatorInterface - */ - protected static $translator; - - /** - * Specific translator of the current instance. - * - * @var \Symfony\Component\Translation\TranslatorInterface - */ - protected $localTranslator; - - /** - * Options for diffForHumans(). - * - * @var int - */ - protected static $humanDiffOptions = CarbonInterface::NO_ZERO_DIFF; - - /** - * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @see settings - * - * @param int $humanDiffOptions - */ - public static function setHumanDiffOptions($humanDiffOptions) - { - static::$humanDiffOptions = $humanDiffOptions; - } - - /** - * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @see settings - * - * @param int $humanDiffOption - */ - public static function enableHumanDiffOption($humanDiffOption) - { - static::$humanDiffOptions = static::getHumanDiffOptions() | $humanDiffOption; - } - - /** - * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @see settings - * - * @param int $humanDiffOption - */ - public static function disableHumanDiffOption($humanDiffOption) - { - static::$humanDiffOptions = static::getHumanDiffOptions() & ~$humanDiffOption; - } - - /** - * Return default humanDiff() options (merged flags as integer). - * - * @return int - */ - public static function getHumanDiffOptions() - { - return static::$humanDiffOptions; - } - - /** - * Get the default translator instance in use. - * - * @return \Symfony\Component\Translation\TranslatorInterface - */ - public static function getTranslator() - { - return static::translator(); - } - - /** - * Set the default translator instance to use. - * - * @param \Symfony\Component\Translation\TranslatorInterface $translator - * - * @return void - */ - public static function setTranslator(TranslatorInterface $translator) - { - static::$translator = $translator; - } - - /** - * Return true if the current instance has its own translator. - * - * @return bool - */ - public function hasLocalTranslator() - { - return isset($this->localTranslator); - } - - /** - * Get the translator of the current instance or the default if none set. - * - * @return \Symfony\Component\Translation\TranslatorInterface - */ - public function getLocalTranslator() - { - return $this->localTranslator ?: static::translator(); - } - - /** - * Set the translator for the current instance. - * - * @param \Symfony\Component\Translation\TranslatorInterface $translator - * - * @return $this - */ - public function setLocalTranslator(TranslatorInterface $translator) - { - $this->localTranslator = $translator; - - return $this; - } - - /** - * Returns raw translation message for a given key. - * - * @param \Symfony\Component\Translation\TranslatorInterface $translator the translator to use - * @param string $key key to find - * @param string|null $locale current locale used if null - * @param string|null $default default value if translation returns the key - * - * @return string - */ - public static function getTranslationMessageWith($translator, string $key, ?string $locale = null, ?string $default = null) - { - if (!($translator instanceof TranslatorBagInterface && $translator instanceof TranslatorInterface)) { - throw new InvalidTypeException( - 'Translator does not implement '.TranslatorInterface::class.' and '.TranslatorBagInterface::class.'. '. - (\is_object($translator) ? \get_class($translator) : \gettype($translator)).' has been given.' - ); - } - - if (!$locale && $translator instanceof LocaleAwareInterface) { - $locale = $translator->getLocale(); - } - - $result = self::getFromCatalogue($translator, $translator->getCatalogue($locale), $key); - - return $result === $key ? $default : $result; - } - - /** - * Returns raw translation message for a given key. - * - * @param string $key key to find - * @param string|null $locale current locale used if null - * @param string|null $default default value if translation returns the key - * @param \Symfony\Component\Translation\TranslatorInterface $translator an optional translator to use - * - * @return string - */ - public function getTranslationMessage(string $key, ?string $locale = null, ?string $default = null, $translator = null) - { - return static::getTranslationMessageWith($translator ?: $this->getLocalTranslator(), $key, $locale, $default); - } - - /** - * Translate using translation string or callback available. - * - * @param \Symfony\Component\Translation\TranslatorInterface $translator - * @param string $key - * @param array $parameters - * @param null $number - * - * @return string - */ - public static function translateWith(TranslatorInterface $translator, string $key, array $parameters = [], $number = null): string - { - $message = static::getTranslationMessageWith($translator, $key, null, $key); - if ($message instanceof Closure) { - return (string) $message(...array_values($parameters)); - } - - if ($number !== null) { - $parameters['%count%'] = $number; - } - if (isset($parameters['%count%'])) { - $parameters[':count'] = $parameters['%count%']; - } - - // @codeCoverageIgnoreStart - $choice = $translator instanceof ContractsTranslatorInterface - ? $translator->trans($key, $parameters) - : $translator->transChoice($key, $number, $parameters); - // @codeCoverageIgnoreEnd - - return (string) $choice; - } - - /** - * Translate using translation string or callback available. - * - * @param string $key - * @param array $parameters - * @param string|int|float|null $number - * @param \Symfony\Component\Translation\TranslatorInterface|null $translator - * @param bool $altNumbers - * - * @return string - */ - public function translate(string $key, array $parameters = [], $number = null, ?TranslatorInterface $translator = null, bool $altNumbers = false): string - { - $translation = static::translateWith($translator ?: $this->getLocalTranslator(), $key, $parameters, $number); - - if ($number !== null && $altNumbers) { - return str_replace($number, $this->translateNumber($number), $translation); - } - - return $translation; - } - - /** - * Returns the alternative number for a given integer if available in the current locale. - * - * @param int $number - * - * @return string - */ - public function translateNumber(int $number): string - { - $translateKey = "alt_numbers.$number"; - $symbol = $this->translate($translateKey); - - if ($symbol !== $translateKey) { - return $symbol; - } - - if ($number > 99 && $this->translate('alt_numbers.99') !== 'alt_numbers.99') { - $start = ''; - foreach ([10000, 1000, 100] as $exp) { - $key = "alt_numbers_pow.$exp"; - if ($number >= $exp && $number < $exp * 10 && ($pow = $this->translate($key)) !== $key) { - $unit = floor($number / $exp); - $number -= $unit * $exp; - $start .= ($unit > 1 ? $this->translate("alt_numbers.$unit") : '').$pow; - } - } - $result = ''; - while ($number) { - $chunk = $number % 100; - $result = $this->translate("alt_numbers.$chunk").$result; - $number = floor($number / 100); - } - - return "$start$result"; - } - - if ($number > 9 && $this->translate('alt_numbers.9') !== 'alt_numbers.9') { - $result = ''; - while ($number) { - $chunk = $number % 10; - $result = $this->translate("alt_numbers.$chunk").$result; - $number = floor($number / 10); - } - - return $result; - } - - return (string) $number; - } - - /** - * Translate a time string from a locale to an other. - * - * @param string $timeString date/time/duration string to translate (may also contain English) - * @param string|null $from input locale of the $timeString parameter (`Carbon::getLocale()` by default) - * @param string|null $to output locale of the result returned (`"en"` by default) - * @param int $mode specify what to translate with options: - * - CarbonInterface::TRANSLATE_ALL (default) - * - CarbonInterface::TRANSLATE_MONTHS - * - CarbonInterface::TRANSLATE_DAYS - * - CarbonInterface::TRANSLATE_UNITS - * - CarbonInterface::TRANSLATE_MERIDIEM - * You can use pipe to group: CarbonInterface::TRANSLATE_MONTHS | CarbonInterface::TRANSLATE_DAYS - * - * @return string - */ - public static function translateTimeString($timeString, $from = null, $to = null, $mode = CarbonInterface::TRANSLATE_ALL) - { - // Fallback source and destination locales - $from = $from ?: static::getLocale(); - $to = $to ?: 'en'; - - if ($from === $to) { - return $timeString; - } - - // Standardize apostrophe - $timeString = strtr($timeString, ['’' => "'"]); - - $fromTranslations = []; - $toTranslations = []; - - foreach (['from', 'to'] as $key) { - $language = $$key; - $translator = Translator::get($language); - $translations = $translator->getMessages(); - - if (!isset($translations[$language])) { - return $timeString; - } - - $translationKey = $key.'Translations'; - $messages = $translations[$language]; - $months = $messages['months'] ?? []; - $weekdays = $messages['weekdays'] ?? []; - $meridiem = $messages['meridiem'] ?? ['AM', 'PM']; - - if (isset($messages['ordinal_words'])) { - $timeString = self::replaceOrdinalWords( - $timeString, - $key === 'from' ? array_flip($messages['ordinal_words']) : $messages['ordinal_words'] - ); - } - - if ($key === 'from') { - foreach (['months', 'weekdays'] as $variable) { - $list = $messages[$variable.'_standalone'] ?? null; - - if ($list) { - foreach ($$variable as $index => &$name) { - $name .= '|'.$messages[$variable.'_standalone'][$index]; - } - } - } - } - - $$translationKey = array_merge( - $mode & CarbonInterface::TRANSLATE_MONTHS ? static::getTranslationArray($months, 12, $timeString) : [], - $mode & CarbonInterface::TRANSLATE_MONTHS ? static::getTranslationArray($messages['months_short'] ?? [], 12, $timeString) : [], - $mode & CarbonInterface::TRANSLATE_DAYS ? static::getTranslationArray($weekdays, 7, $timeString) : [], - $mode & CarbonInterface::TRANSLATE_DAYS ? static::getTranslationArray($messages['weekdays_short'] ?? [], 7, $timeString) : [], - $mode & CarbonInterface::TRANSLATE_DIFF ? static::translateWordsByKeys([ - 'diff_now', - 'diff_today', - 'diff_yesterday', - 'diff_tomorrow', - 'diff_before_yesterday', - 'diff_after_tomorrow', - ], $messages, $key) : [], - $mode & CarbonInterface::TRANSLATE_UNITS ? static::translateWordsByKeys([ - 'year', - 'month', - 'week', - 'day', - 'hour', - 'minute', - 'second', - ], $messages, $key) : [], - $mode & CarbonInterface::TRANSLATE_MERIDIEM ? array_map(function ($hour) use ($meridiem) { - if (\is_array($meridiem)) { - return $meridiem[$hour < 12 ? 0 : 1]; - } - - return $meridiem($hour, 0, false); - }, range(0, 23)) : [] - ); - } - - return substr(preg_replace_callback('/(?<=[\d\s+.\/,_-])('.implode('|', $fromTranslations).')(?=[\d\s+.\/,_-])/iu', function ($match) use ($fromTranslations, $toTranslations) { - [$chunk] = $match; - - foreach ($fromTranslations as $index => $word) { - if (preg_match("/^$word\$/iu", $chunk)) { - return $toTranslations[$index] ?? ''; - } - } - - return $chunk; // @codeCoverageIgnore - }, " $timeString "), 1, -1); - } - - /** - * Translate a time string from the current locale (`$date->locale()`) to an other. - * - * @param string $timeString time string to translate - * @param string|null $to output locale of the result returned ("en" by default) - * - * @return string - */ - public function translateTimeStringTo($timeString, $to = null) - { - return static::translateTimeString($timeString, $this->getTranslatorLocale(), $to); - } - - /** - * Get/set the locale for the current instance. - * - * @param string|null $locale - * @param string ...$fallbackLocales - * - * @return $this|string - */ - public function locale(string $locale = null, ...$fallbackLocales) - { - if ($locale === null) { - return $this->getTranslatorLocale(); - } - - if (!$this->localTranslator || $this->getTranslatorLocale($this->localTranslator) !== $locale) { - $translator = Translator::get($locale); - - if (!empty($fallbackLocales)) { - $translator->setFallbackLocales($fallbackLocales); - - foreach ($fallbackLocales as $fallbackLocale) { - $messages = Translator::get($fallbackLocale)->getMessages(); - - if (isset($messages[$fallbackLocale])) { - $translator->setMessages($fallbackLocale, $messages[$fallbackLocale]); - } - } - } - - $this->localTranslator = $translator; - } - - return $this; - } - - /** - * Get the current translator locale. - * - * @return string - */ - public static function getLocale() - { - return static::getLocaleAwareTranslator()->getLocale(); - } - - /** - * Set the current translator locale and indicate if the source locale file exists. - * Pass 'auto' as locale to use closest language from the current LC_TIME locale. - * - * @param string $locale locale ex. en - * - * @return bool - */ - public static function setLocale($locale) - { - return static::getLocaleAwareTranslator()->setLocale($locale) !== false; - } - - /** - * Set the fallback locale. - * - * @see https://symfony.com/doc/current/components/translation.html#fallback-locales - * - * @param string $locale - */ - public static function setFallbackLocale($locale) - { - $translator = static::getTranslator(); - - if (method_exists($translator, 'setFallbackLocales')) { - $translator->setFallbackLocales([$locale]); - - if ($translator instanceof Translator) { - $preferredLocale = $translator->getLocale(); - $translator->setMessages($preferredLocale, array_replace_recursive( - $translator->getMessages()[$locale] ?? [], - Translator::get($locale)->getMessages()[$locale] ?? [], - $translator->getMessages($preferredLocale) - )); - } - } - } - - /** - * Get the fallback locale. - * - * @see https://symfony.com/doc/current/components/translation.html#fallback-locales - * - * @return string|null - */ - public static function getFallbackLocale() - { - $translator = static::getTranslator(); - - if (method_exists($translator, 'getFallbackLocales')) { - return $translator->getFallbackLocales()[0] ?? null; - } - - return null; - } - - /** - * Set the current locale to the given, execute the passed function, reset the locale to previous one, - * then return the result of the closure (or null if the closure was void). - * - * @param string $locale locale ex. en - * @param callable $func - * - * @return mixed - */ - public static function executeWithLocale($locale, $func) - { - $currentLocale = static::getLocale(); - $result = $func(static::setLocale($locale) ? static::getLocale() : false, static::translator()); - static::setLocale($currentLocale); - - return $result; - } - - /** - * Returns true if the given locale is internally supported and has short-units support. - * Support is considered enabled if either year, day or hour has a short variant translated. - * - * @param string $locale locale ex. en - * - * @return bool - */ - public static function localeHasShortUnits($locale) - { - return static::executeWithLocale($locale, function ($newLocale, TranslatorInterface $translator) { - return ($newLocale && (($y = static::translateWith($translator, 'y')) !== 'y' && $y !== static::translateWith($translator, 'year'))) || ( - ($y = static::translateWith($translator, 'd')) !== 'd' && - $y !== static::translateWith($translator, 'day') - ) || ( - ($y = static::translateWith($translator, 'h')) !== 'h' && - $y !== static::translateWith($translator, 'hour') - ); - }); - } - - /** - * Returns true if the given locale is internally supported and has diff syntax support (ago, from now, before, after). - * Support is considered enabled if the 4 sentences are translated in the given locale. - * - * @param string $locale locale ex. en - * - * @return bool - */ - public static function localeHasDiffSyntax($locale) - { - return static::executeWithLocale($locale, function ($newLocale, TranslatorInterface $translator) { - if (!$newLocale) { - return false; - } - - foreach (['ago', 'from_now', 'before', 'after'] as $key) { - if ($translator instanceof TranslatorBagInterface && - self::getFromCatalogue($translator, $translator->getCatalogue($newLocale), $key) instanceof Closure - ) { - continue; - } - - if ($translator->trans($key) === $key) { - return false; - } - } - - return true; - }); - } - - /** - * Returns true if the given locale is internally supported and has words for 1-day diff (just now, yesterday, tomorrow). - * Support is considered enabled if the 3 words are translated in the given locale. - * - * @param string $locale locale ex. en - * - * @return bool - */ - public static function localeHasDiffOneDayWords($locale) - { - return static::executeWithLocale($locale, function ($newLocale, TranslatorInterface $translator) { - return $newLocale && - $translator->trans('diff_now') !== 'diff_now' && - $translator->trans('diff_yesterday') !== 'diff_yesterday' && - $translator->trans('diff_tomorrow') !== 'diff_tomorrow'; - }); - } - - /** - * Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after tomorrow). - * Support is considered enabled if the 2 words are translated in the given locale. - * - * @param string $locale locale ex. en - * - * @return bool - */ - public static function localeHasDiffTwoDayWords($locale) - { - return static::executeWithLocale($locale, function ($newLocale, TranslatorInterface $translator) { - return $newLocale && - $translator->trans('diff_before_yesterday') !== 'diff_before_yesterday' && - $translator->trans('diff_after_tomorrow') !== 'diff_after_tomorrow'; - }); - } - - /** - * Returns true if the given locale is internally supported and has period syntax support (X times, every X, from X, to X). - * Support is considered enabled if the 4 sentences are translated in the given locale. - * - * @param string $locale locale ex. en - * - * @return bool - */ - public static function localeHasPeriodSyntax($locale) - { - return static::executeWithLocale($locale, function ($newLocale, TranslatorInterface $translator) { - return $newLocale && - $translator->trans('period_recurrences') !== 'period_recurrences' && - $translator->trans('period_interval') !== 'period_interval' && - $translator->trans('period_start_date') !== 'period_start_date' && - $translator->trans('period_end_date') !== 'period_end_date'; - }); - } - - /** - * Returns the list of internally available locales and already loaded custom locales. - * (It will ignore custom translator dynamic loading.) - * - * @return array - */ - public static function getAvailableLocales() - { - $translator = static::getLocaleAwareTranslator(); - - return $translator instanceof Translator - ? $translator->getAvailableLocales() - : [$translator->getLocale()]; - } - - /** - * Returns list of Language object for each available locale. This object allow you to get the ISO name, native - * name, region and variant of the locale. - * - * @return Language[] - */ - public static function getAvailableLocalesInfo() - { - $languages = []; - foreach (static::getAvailableLocales() as $id) { - $languages[$id] = new Language($id); - } - - return $languages; - } - - /** - * Initialize the default translator instance if necessary. - * - * @return \Symfony\Component\Translation\TranslatorInterface - */ - protected static function translator() - { - if (static::$translator === null) { - static::$translator = Translator::get(); - } - - return static::$translator; - } - - /** - * Get the locale of a given translator. - * - * If null or omitted, current local translator is used. - * If no local translator is in use, current global translator is used. - * - * @param null $translator - * - * @return string|null - */ - protected function getTranslatorLocale($translator = null): ?string - { - if (\func_num_args() === 0) { - $translator = $this->getLocalTranslator(); - } - - $translator = static::getLocaleAwareTranslator($translator); - - return $translator ? $translator->getLocale() : null; - } - - /** - * Throw an error if passed object is not LocaleAwareInterface. - * - * @param LocaleAwareInterface|null $translator - * - * @return LocaleAwareInterface|null - */ - protected static function getLocaleAwareTranslator($translator = null) - { - if (\func_num_args() === 0) { - $translator = static::translator(); - } - - if ($translator && !($translator instanceof LocaleAwareInterface || method_exists($translator, 'getLocale'))) { - throw new NotLocaleAwareException($translator); // @codeCoverageIgnore - } - - return $translator; - } - - /** - * @param mixed $translator - * @param \Symfony\Component\Translation\MessageCatalogueInterface $catalogue - * - * @return mixed - */ - private static function getFromCatalogue($translator, $catalogue, string $id, string $domain = 'messages') - { - return $translator instanceof TranslatorStrongTypeInterface - ? $translator->getFromCatalogue($catalogue, $id, $domain) // @codeCoverageIgnore - : $catalogue->get($id, $domain); - } - - /** - * Return the word cleaned from its translation codes. - * - * @param string $word - * - * @return string - */ - private static function cleanWordFromTranslationString($word) - { - $word = str_replace([':count', '%count', ':time'], '', $word); - $word = strtr($word, ['’' => "'"]); - $word = preg_replace('/({\d+(,(\d+|Inf))?}|[\[\]]\d+(,(\d+|Inf))?[\[\]])/', '', $word); - - return trim($word); - } - - /** - * Translate a list of words. - * - * @param string[] $keys keys to translate. - * @param string[] $messages messages bag handling translations. - * @param string $key 'to' (to get the translation) or 'from' (to get the detection RegExp pattern). - * - * @return string[] - */ - private static function translateWordsByKeys($keys, $messages, $key): array - { - return array_map(function ($wordKey) use ($messages, $key) { - $message = $key === 'from' && isset($messages[$wordKey.'_regexp']) - ? $messages[$wordKey.'_regexp'] - : ($messages[$wordKey] ?? null); - - if (!$message) { - return '>>DO NOT REPLACE<<'; - } - - $parts = explode('|', $message); - - return $key === 'to' - ? self::cleanWordFromTranslationString(end($parts)) - : '(?:'.implode('|', array_map([static::class, 'cleanWordFromTranslationString'], $parts)).')'; - }, $keys); - } - - /** - * Get an array of translations based on the current date. - * - * @param callable $translation - * @param int $length - * @param string $timeString - * - * @return string[] - */ - private static function getTranslationArray($translation, $length, $timeString): array - { - $filler = '>>DO NOT REPLACE<<'; - - if (\is_array($translation)) { - return array_pad($translation, $length, $filler); - } - - $list = []; - $date = static::now(); - - for ($i = 0; $i < $length; $i++) { - $list[] = $translation($date, $timeString, $i) ?? $filler; - } - - return $list; - } - - private static function replaceOrdinalWords(string $timeString, array $ordinalWords): string - { - return preg_replace_callback('/(?<![a-z])[a-z]+(?![a-z])/i', function (array $match) use ($ordinalWords) { - return $ordinalWords[mb_strtolower($match[0])] ?? $match[0]; - }, $timeString); - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Macro.php b/vendor/nesbot/carbon/src/Carbon/Traits/Macro.php deleted file mode 100644 index 92b6c9d8..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Macro.php +++ /dev/null @@ -1,136 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Traits; - -/** - * Trait Macros. - * - * Allows users to register macros within the Carbon class. - */ -trait Macro -{ - use Mixin; - - /** - * The registered macros. - * - * @var array - */ - protected static $globalMacros = []; - - /** - * The registered generic macros. - * - * @var array - */ - protected static $globalGenericMacros = []; - - /** - * Register a custom macro. - * - * @example - * ``` - * $userSettings = [ - * 'locale' => 'pt', - * 'timezone' => 'America/Sao_Paulo', - * ]; - * Carbon::macro('userFormat', function () use ($userSettings) { - * return $this->copy()->locale($userSettings['locale'])->tz($userSettings['timezone'])->calendar(); - * }); - * echo Carbon::yesterday()->hours(11)->userFormat(); - * ``` - * - * @param string $name - * @param object|callable $macro - * - * @return void - */ - public static function macro($name, $macro) - { - static::$globalMacros[$name] = $macro; - } - - /** - * Remove all macros and generic macros. - */ - public static function resetMacros() - { - static::$globalMacros = []; - static::$globalGenericMacros = []; - } - - /** - * Register a custom macro. - * - * @param object|callable $macro - * @param int $priority marco with higher priority is tried first - * - * @return void - */ - public static function genericMacro($macro, $priority = 0) - { - if (!isset(static::$globalGenericMacros[$priority])) { - static::$globalGenericMacros[$priority] = []; - krsort(static::$globalGenericMacros, SORT_NUMERIC); - } - - static::$globalGenericMacros[$priority][] = $macro; - } - - /** - * Checks if macro is registered globally. - * - * @param string $name - * - * @return bool - */ - public static function hasMacro($name) - { - return isset(static::$globalMacros[$name]); - } - - /** - * Get the raw callable macro registered globally for a given name. - * - * @param string $name - * - * @return callable|null - */ - public static function getMacro($name) - { - return static::$globalMacros[$name] ?? null; - } - - /** - * Checks if macro is registered globally or locally. - * - * @param string $name - * - * @return bool - */ - public function hasLocalMacro($name) - { - return ($this->localMacros && isset($this->localMacros[$name])) || static::hasMacro($name); - } - - /** - * Get the raw callable macro registered globally or locally for a given name. - * - * @param string $name - * - * @return callable|null - */ - public function getLocalMacro($name) - { - return ($this->localMacros ?? [])[$name] ?? static::getMacro($name); - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/MagicParameter.php b/vendor/nesbot/carbon/src/Carbon/Traits/MagicParameter.php deleted file mode 100644 index 310a44d0..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Traits/MagicParameter.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Traits; - -/** - * Trait MagicParameter. - * - * Allows to retrieve parameter in magic calls by index or name. - */ -trait MagicParameter -{ - private function getMagicParameter(array $parameters, int $index, string $key, $default) - { - if (\array_key_exists($index, $parameters)) { - return $parameters[$index]; - } - - if (\array_key_exists($key, $parameters)) { - return $parameters[$key]; - } - - return $default; - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Mixin.php b/vendor/nesbot/carbon/src/Carbon/Traits/Mixin.php deleted file mode 100644 index 88b251df..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Mixin.php +++ /dev/null @@ -1,191 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Traits; - -use Closure; -use Generator; -use ReflectionClass; -use ReflectionException; -use ReflectionMethod; -use Throwable; - -/** - * Trait Mixin. - * - * Allows mixing in entire classes with multiple macros. - */ -trait Mixin -{ - /** - * Stack of macro instance contexts. - * - * @var array - */ - protected static $macroContextStack = []; - - /** - * Mix another object into the class. - * - * @example - * ``` - * Carbon::mixin(new class { - * public function addMoon() { - * return function () { - * return $this->addDays(30); - * }; - * } - * public function subMoon() { - * return function () { - * return $this->subDays(30); - * }; - * } - * }); - * $fullMoon = Carbon::create('2018-12-22'); - * $nextFullMoon = $fullMoon->addMoon(); - * $blackMoon = Carbon::create('2019-01-06'); - * $previousBlackMoon = $blackMoon->subMoon(); - * echo "$nextFullMoon\n"; - * echo "$previousBlackMoon\n"; - * ``` - * - * @param object|string $mixin - * - * @throws ReflectionException - * - * @return void - */ - public static function mixin($mixin) - { - \is_string($mixin) && trait_exists($mixin) - ? self::loadMixinTrait($mixin) - : self::loadMixinClass($mixin); - } - - /** - * @param object|string $mixin - * - * @throws ReflectionException - */ - private static function loadMixinClass($mixin) - { - $methods = (new ReflectionClass($mixin))->getMethods( - ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PROTECTED - ); - - foreach ($methods as $method) { - if ($method->isConstructor() || $method->isDestructor()) { - continue; - } - - $method->setAccessible(true); - - static::macro($method->name, $method->invoke($mixin)); - } - } - - /** - * @param string $trait - */ - private static function loadMixinTrait($trait) - { - $context = eval(self::getAnonymousClassCodeForTrait($trait)); - $className = \get_class($context); - - foreach (self::getMixableMethods($context) as $name) { - $closureBase = Closure::fromCallable([$context, $name]); - - static::macro($name, function () use ($closureBase, $className) { - /** @phpstan-ignore-next-line */ - $context = isset($this) ? $this->cast($className) : new $className(); - - try { - // @ is required to handle error if not converted into exceptions - $closure = @$closureBase->bindTo($context); - } catch (Throwable $throwable) { // @codeCoverageIgnore - $closure = $closureBase; // @codeCoverageIgnore - } - - // in case of errors not converted into exceptions - $closure = $closure ?: $closureBase; - - return $closure(...\func_get_args()); - }); - } - } - - private static function getAnonymousClassCodeForTrait(string $trait) - { - return 'return new class() extends '.static::class.' {use '.$trait.';};'; - } - - private static function getMixableMethods(self $context): Generator - { - foreach (get_class_methods($context) as $name) { - if (method_exists(static::class, $name)) { - continue; - } - - yield $name; - } - } - - /** - * Stack a Carbon context from inside calls of self::this() and execute a given action. - * - * @param static|null $context - * @param callable $callable - * - * @throws Throwable - * - * @return mixed - */ - protected static function bindMacroContext($context, callable $callable) - { - static::$macroContextStack[] = $context; - $exception = null; - $result = null; - - try { - $result = $callable(); - } catch (Throwable $throwable) { - $exception = $throwable; - } - - array_pop(static::$macroContextStack); - - if ($exception) { - throw $exception; - } - - return $result; - } - - /** - * Return the current context from inside a macro callee or a null if static. - * - * @return static|null - */ - protected static function context() - { - return end(static::$macroContextStack) ?: null; - } - - /** - * Return the current context from inside a macro callee or a new one if static. - * - * @return static - */ - protected static function this() - { - return end(static::$macroContextStack) ?: new static(); - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Modifiers.php b/vendor/nesbot/carbon/src/Carbon/Traits/Modifiers.php deleted file mode 100644 index 164dbbd1..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Modifiers.php +++ /dev/null @@ -1,472 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Traits; - -use Carbon\CarbonInterface; -use ReturnTypeWillChange; - -/** - * Trait Modifiers. - * - * Returns dates relative to current date using modifier short-hand. - */ -trait Modifiers -{ - /** - * Midday/noon hour. - * - * @var int - */ - protected static $midDayAt = 12; - - /** - * get midday/noon hour - * - * @return int - */ - public static function getMidDayAt() - { - return static::$midDayAt; - } - - /** - * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather consider mid-day is always 12pm, then if you need to test if it's an other - * hour, test it explicitly: - * $date->format('G') == 13 - * or to set explicitly to a given hour: - * $date->setTime(13, 0, 0, 0) - * - * Set midday/noon hour - * - * @param int $hour midday hour - * - * @return void - */ - public static function setMidDayAt($hour) - { - static::$midDayAt = $hour; - } - - /** - * Modify to midday, default to self::$midDayAt - * - * @return static - */ - public function midDay() - { - return $this->setTime(static::$midDayAt, 0, 0, 0); - } - - /** - * Modify to the next occurrence of a given modifier such as a day of - * the week. If no modifier is provided, modify to the next occurrence - * of the current day of the week. Use the supplied constants - * to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param string|int|null $modifier - * - * @return static - */ - public function next($modifier = null) - { - if ($modifier === null) { - $modifier = $this->dayOfWeek; - } - - return $this->change( - 'next '.(\is_string($modifier) ? $modifier : static::$days[$modifier]) - ); - } - - /** - * Go forward or backward to the next week- or weekend-day. - * - * @param bool $weekday - * @param bool $forward - * - * @return static - */ - private function nextOrPreviousDay($weekday = true, $forward = true) - { - /** @var CarbonInterface $date */ - $date = $this; - $step = $forward ? 1 : -1; - - do { - $date = $date->addDays($step); - } while ($weekday ? $date->isWeekend() : $date->isWeekday()); - - return $date; - } - - /** - * Go forward to the next weekday. - * - * @return static - */ - public function nextWeekday() - { - return $this->nextOrPreviousDay(); - } - - /** - * Go backward to the previous weekday. - * - * @return static - */ - public function previousWeekday() - { - return $this->nextOrPreviousDay(true, false); - } - - /** - * Go forward to the next weekend day. - * - * @return static - */ - public function nextWeekendDay() - { - return $this->nextOrPreviousDay(false); - } - - /** - * Go backward to the previous weekend day. - * - * @return static - */ - public function previousWeekendDay() - { - return $this->nextOrPreviousDay(false, false); - } - - /** - * Modify to the previous occurrence of a given modifier such as a day of - * the week. If no dayOfWeek is provided, modify to the previous occurrence - * of the current day of the week. Use the supplied constants - * to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param string|int|null $modifier - * - * @return static - */ - public function previous($modifier = null) - { - if ($modifier === null) { - $modifier = $this->dayOfWeek; - } - - return $this->change( - 'last '.(\is_string($modifier) ? $modifier : static::$days[$modifier]) - ); - } - - /** - * Modify to the first occurrence of a given day of the week - * in the current month. If no dayOfWeek is provided, modify to the - * first day of the current month. Use the supplied constants - * to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int|null $dayOfWeek - * - * @return static - */ - public function firstOfMonth($dayOfWeek = null) - { - $date = $this->startOfDay(); - - if ($dayOfWeek === null) { - return $date->day(1); - } - - return $date->modify('first '.static::$days[$dayOfWeek].' of '.$date->rawFormat('F').' '.$date->year); - } - - /** - * Modify to the last occurrence of a given day of the week - * in the current month. If no dayOfWeek is provided, modify to the - * last day of the current month. Use the supplied constants - * to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int|null $dayOfWeek - * - * @return static - */ - public function lastOfMonth($dayOfWeek = null) - { - $date = $this->startOfDay(); - - if ($dayOfWeek === null) { - return $date->day($date->daysInMonth); - } - - return $date->modify('last '.static::$days[$dayOfWeek].' of '.$date->rawFormat('F').' '.$date->year); - } - - /** - * Modify to the given occurrence of a given day of the week - * in the current month. If the calculated occurrence is outside the scope - * of the current month, then return false and no modifications are made. - * Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int $nth - * @param int $dayOfWeek - * - * @return mixed - */ - public function nthOfMonth($nth, $dayOfWeek) - { - $date = $this->avoidMutation()->firstOfMonth(); - $check = $date->rawFormat('Y-m'); - $date = $date->modify('+'.$nth.' '.static::$days[$dayOfWeek]); - - return $date->rawFormat('Y-m') === $check ? $this->modify((string) $date) : false; - } - - /** - * Modify to the first occurrence of a given day of the week - * in the current quarter. If no dayOfWeek is provided, modify to the - * first day of the current quarter. Use the supplied constants - * to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int|null $dayOfWeek day of the week default null - * - * @return static - */ - public function firstOfQuarter($dayOfWeek = null) - { - return $this->setDate($this->year, $this->quarter * static::MONTHS_PER_QUARTER - 2, 1)->firstOfMonth($dayOfWeek); - } - - /** - * Modify to the last occurrence of a given day of the week - * in the current quarter. If no dayOfWeek is provided, modify to the - * last day of the current quarter. Use the supplied constants - * to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int|null $dayOfWeek day of the week default null - * - * @return static - */ - public function lastOfQuarter($dayOfWeek = null) - { - return $this->setDate($this->year, $this->quarter * static::MONTHS_PER_QUARTER, 1)->lastOfMonth($dayOfWeek); - } - - /** - * Modify to the given occurrence of a given day of the week - * in the current quarter. If the calculated occurrence is outside the scope - * of the current quarter, then return false and no modifications are made. - * Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int $nth - * @param int $dayOfWeek - * - * @return mixed - */ - public function nthOfQuarter($nth, $dayOfWeek) - { - $date = $this->avoidMutation()->day(1)->month($this->quarter * static::MONTHS_PER_QUARTER); - $lastMonth = $date->month; - $year = $date->year; - $date = $date->firstOfQuarter()->modify('+'.$nth.' '.static::$days[$dayOfWeek]); - - return ($lastMonth < $date->month || $year !== $date->year) ? false : $this->modify((string) $date); - } - - /** - * Modify to the first occurrence of a given day of the week - * in the current year. If no dayOfWeek is provided, modify to the - * first day of the current year. Use the supplied constants - * to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int|null $dayOfWeek day of the week default null - * - * @return static - */ - public function firstOfYear($dayOfWeek = null) - { - return $this->month(1)->firstOfMonth($dayOfWeek); - } - - /** - * Modify to the last occurrence of a given day of the week - * in the current year. If no dayOfWeek is provided, modify to the - * last day of the current year. Use the supplied constants - * to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int|null $dayOfWeek day of the week default null - * - * @return static - */ - public function lastOfYear($dayOfWeek = null) - { - return $this->month(static::MONTHS_PER_YEAR)->lastOfMonth($dayOfWeek); - } - - /** - * Modify to the given occurrence of a given day of the week - * in the current year. If the calculated occurrence is outside the scope - * of the current year, then return false and no modifications are made. - * Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int $nth - * @param int $dayOfWeek - * - * @return mixed - */ - public function nthOfYear($nth, $dayOfWeek) - { - $date = $this->avoidMutation()->firstOfYear()->modify('+'.$nth.' '.static::$days[$dayOfWeek]); - - return $this->year === $date->year ? $this->modify((string) $date) : false; - } - - /** - * Modify the current instance to the average of a given instance (default now) and the current instance - * (second-precision). - * - * @param \Carbon\Carbon|\DateTimeInterface|null $date - * - * @return static - */ - public function average($date = null) - { - return $this->addRealMicroseconds((int) ($this->diffInRealMicroseconds($this->resolveCarbon($date), false) / 2)); - } - - /** - * Get the closest date from the instance (second-precision). - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date1 - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date2 - * - * @return static - */ - public function closest($date1, $date2) - { - return $this->diffInRealMicroseconds($date1) < $this->diffInRealMicroseconds($date2) ? $date1 : $date2; - } - - /** - * Get the farthest date from the instance (second-precision). - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date1 - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date2 - * - * @return static - */ - public function farthest($date1, $date2) - { - return $this->diffInRealMicroseconds($date1) > $this->diffInRealMicroseconds($date2) ? $date1 : $date2; - } - - /** - * Get the minimum instance between a given instance (default now) and the current instance. - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @return static - */ - public function min($date = null) - { - $date = $this->resolveCarbon($date); - - return $this->lt($date) ? $this : $date; - } - - /** - * Get the minimum instance between a given instance (default now) and the current instance. - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @see min() - * - * @return static - */ - public function minimum($date = null) - { - return $this->min($date); - } - - /** - * Get the maximum instance between a given instance (default now) and the current instance. - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @return static - */ - public function max($date = null) - { - $date = $this->resolveCarbon($date); - - return $this->gt($date) ? $this : $date; - } - - /** - * Get the maximum instance between a given instance (default now) and the current instance. - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @see max() - * - * @return static - */ - public function maximum($date = null) - { - return $this->max($date); - } - - /** - * Calls \DateTime::modify if mutable or \DateTimeImmutable::modify else. - * - * @see https://php.net/manual/en/datetime.modify.php - * - * @return static|false - */ - #[ReturnTypeWillChange] - public function modify($modify) - { - return parent::modify((string) $modify); - } - - /** - * Similar to native modify() method of DateTime but can handle more grammars. - * - * @example - * ``` - * echo Carbon::now()->change('next 2pm'); - * ``` - * - * @link https://php.net/manual/en/datetime.modify.php - * - * @param string $modifier - * - * @return static - */ - public function change($modifier) - { - return $this->modify(preg_replace_callback('/^(next|previous|last)\s+(\d{1,2}(h|am|pm|:\d{1,2}(:\d{1,2})?))$/i', function ($match) { - $match[2] = str_replace('h', ':00', $match[2]); - $test = $this->avoidMutation()->modify($match[2]); - $method = $match[1] === 'next' ? 'lt' : 'gt'; - $match[1] = $test->$method($this) ? $match[1].' day' : 'today'; - - return $match[1].' '.$match[2]; - }, strtr(trim($modifier), [ - ' at ' => ' ', - 'just now' => 'now', - 'after tomorrow' => 'tomorrow +1 day', - 'before yesterday' => 'yesterday -1 day', - ]))); - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Mutability.php b/vendor/nesbot/carbon/src/Carbon/Traits/Mutability.php deleted file mode 100644 index 561c867d..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Mutability.php +++ /dev/null @@ -1,71 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Traits; - -use Carbon\Carbon; -use Carbon\CarbonImmutable; - -/** - * Trait Mutability. - * - * Utils to know if the current object is mutable or immutable and convert it. - */ -trait Mutability -{ - use Cast; - - /** - * Returns true if the current class/instance is mutable. - * - * @return bool - */ - public static function isMutable() - { - return false; - } - - /** - * Returns true if the current class/instance is immutable. - * - * @return bool - */ - public static function isImmutable() - { - return !static::isMutable(); - } - - /** - * Return a mutable copy of the instance. - * - * @return Carbon - */ - public function toMutable() - { - /** @var Carbon $date */ - $date = $this->cast(Carbon::class); - - return $date; - } - - /** - * Return a immutable copy of the instance. - * - * @return CarbonImmutable - */ - public function toImmutable() - { - /** @var CarbonImmutable $date */ - $date = $this->cast(CarbonImmutable::class); - - return $date; - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/ObjectInitialisation.php b/vendor/nesbot/carbon/src/Carbon/Traits/ObjectInitialisation.php deleted file mode 100644 index c77a1024..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Traits/ObjectInitialisation.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Traits; - -trait ObjectInitialisation -{ - /** - * True when parent::__construct has been called. - * - * @var string - */ - protected $constructedObjectId; -} diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Options.php b/vendor/nesbot/carbon/src/Carbon/Traits/Options.php deleted file mode 100644 index 0ddee8dd..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Options.php +++ /dev/null @@ -1,471 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Traits; - -use Carbon\CarbonInterface; -use DateTimeInterface; -use Throwable; - -/** - * Trait Options. - * - * Embed base methods to change settings of Carbon classes. - * - * Depends on the following methods: - * - * @method \Carbon\Carbon|\Carbon\CarbonImmutable shiftTimezone($timezone) Set the timezone - */ -trait Options -{ - use Localization; - - /** - * Customizable PHP_INT_SIZE override. - * - * @var int - */ - public static $PHPIntSize = PHP_INT_SIZE; - - /** - * First day of week. - * - * @var int|string - */ - protected static $weekStartsAt = CarbonInterface::MONDAY; - - /** - * Last day of week. - * - * @var int|string - */ - protected static $weekEndsAt = CarbonInterface::SUNDAY; - - /** - * Days of weekend. - * - * @var array - */ - protected static $weekendDays = [ - CarbonInterface::SATURDAY, - CarbonInterface::SUNDAY, - ]; - - /** - * Format regex patterns. - * - * @var array<string, string> - */ - protected static $regexFormats = [ - 'd' => '(3[01]|[12][0-9]|0[1-9])', - 'D' => '(Sun|Mon|Tue|Wed|Thu|Fri|Sat)', - 'j' => '([123][0-9]|[1-9])', - 'l' => '([a-zA-Z]{2,})', - 'N' => '([1-7])', - 'S' => '(st|nd|rd|th)', - 'w' => '([0-6])', - 'z' => '(36[0-5]|3[0-5][0-9]|[12][0-9]{2}|[1-9]?[0-9])', - 'W' => '(5[012]|[1-4][0-9]|0?[1-9])', - 'F' => '([a-zA-Z]{2,})', - 'm' => '(1[012]|0[1-9])', - 'M' => '([a-zA-Z]{3})', - 'n' => '(1[012]|[1-9])', - 't' => '(2[89]|3[01])', - 'L' => '(0|1)', - 'o' => '([1-9][0-9]{0,4})', - 'Y' => '([1-9]?[0-9]{4})', - 'y' => '([0-9]{2})', - 'a' => '(am|pm)', - 'A' => '(AM|PM)', - 'B' => '([0-9]{3})', - 'g' => '(1[012]|[1-9])', - 'G' => '(2[0-3]|1?[0-9])', - 'h' => '(1[012]|0[1-9])', - 'H' => '(2[0-3]|[01][0-9])', - 'i' => '([0-5][0-9])', - 's' => '([0-5][0-9])', - 'u' => '([0-9]{1,6})', - 'v' => '([0-9]{1,3})', - 'e' => '([a-zA-Z]{1,5})|([a-zA-Z]*\\/[a-zA-Z]*)', - 'I' => '(0|1)', - 'O' => '([+-](1[012]|0[0-9])[0134][05])', - 'P' => '([+-](1[012]|0[0-9]):[0134][05])', - 'p' => '(Z|[+-](1[012]|0[0-9]):[0134][05])', - 'T' => '([a-zA-Z]{1,5})', - 'Z' => '(-?[1-5]?[0-9]{1,4})', - 'U' => '([0-9]*)', - - // The formats below are combinations of the above formats. - 'c' => '(([1-9]?[0-9]{4})-(1[012]|0[1-9])-(3[01]|[12][0-9]|0[1-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])[+-](1[012]|0[0-9]):([0134][05]))', // Y-m-dTH:i:sP - 'r' => '(([a-zA-Z]{3}), ([123][0-9]|0[1-9]) ([a-zA-Z]{3}) ([1-9]?[0-9]{4}) (2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9]) [+-](1[012]|0[0-9])([0134][05]))', // D, d M Y H:i:s O - ]; - - /** - * Format modifiers (such as available in createFromFormat) regex patterns. - * - * @var array - */ - protected static $regexFormatModifiers = [ - '*' => '.+', - ' ' => '[ ]', - '#' => '[;:\\/.,()-]', - '?' => '([^a]|[a])', - '!' => '', - '|' => '', - '+' => '', - ]; - - /** - * Indicates if months should be calculated with overflow. - * Global setting. - * - * @var bool - */ - protected static $monthsOverflow = true; - - /** - * Indicates if years should be calculated with overflow. - * Global setting. - * - * @var bool - */ - protected static $yearsOverflow = true; - - /** - * Indicates if the strict mode is in use. - * Global setting. - * - * @var bool - */ - protected static $strictModeEnabled = true; - - /** - * Function to call instead of format. - * - * @var string|callable|null - */ - protected static $formatFunction; - - /** - * Function to call instead of createFromFormat. - * - * @var string|callable|null - */ - protected static $createFromFormatFunction; - - /** - * Function to call instead of parse. - * - * @var string|callable|null - */ - protected static $parseFunction; - - /** - * Indicates if months should be calculated with overflow. - * Specific setting. - * - * @var bool|null - */ - protected $localMonthsOverflow; - - /** - * Indicates if years should be calculated with overflow. - * Specific setting. - * - * @var bool|null - */ - protected $localYearsOverflow; - - /** - * Indicates if the strict mode is in use. - * Specific setting. - * - * @var bool|null - */ - protected $localStrictModeEnabled; - - /** - * Options for diffForHumans and forHumans methods. - * - * @var bool|null - */ - protected $localHumanDiffOptions; - - /** - * Format to use on string cast. - * - * @var string|null - */ - protected $localToStringFormat; - - /** - * Format to use on JSON serialization. - * - * @var string|null - */ - protected $localSerializer; - - /** - * Instance-specific macros. - * - * @var array|null - */ - protected $localMacros; - - /** - * Instance-specific generic macros. - * - * @var array|null - */ - protected $localGenericMacros; - - /** - * Function to call instead of format. - * - * @var string|callable|null - */ - protected $localFormatFunction; - - /** - * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @see settings - * - * Enable the strict mode (or disable with passing false). - * - * @param bool $strictModeEnabled - */ - public static function useStrictMode($strictModeEnabled = true) - { - static::$strictModeEnabled = $strictModeEnabled; - } - - /** - * Returns true if the strict mode is globally in use, false else. - * (It can be overridden in specific instances.) - * - * @return bool - */ - public static function isStrictModeEnabled() - { - return static::$strictModeEnabled; - } - - /** - * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @see settings - * - * Indicates if months should be calculated with overflow. - * - * @param bool $monthsOverflow - * - * @return void - */ - public static function useMonthsOverflow($monthsOverflow = true) - { - static::$monthsOverflow = $monthsOverflow; - } - - /** - * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @see settings - * - * Reset the month overflow behavior. - * - * @return void - */ - public static function resetMonthsOverflow() - { - static::$monthsOverflow = true; - } - - /** - * Get the month overflow global behavior (can be overridden in specific instances). - * - * @return bool - */ - public static function shouldOverflowMonths() - { - return static::$monthsOverflow; - } - - /** - * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @see settings - * - * Indicates if years should be calculated with overflow. - * - * @param bool $yearsOverflow - * - * @return void - */ - public static function useYearsOverflow($yearsOverflow = true) - { - static::$yearsOverflow = $yearsOverflow; - } - - /** - * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @see settings - * - * Reset the month overflow behavior. - * - * @return void - */ - public static function resetYearsOverflow() - { - static::$yearsOverflow = true; - } - - /** - * Get the month overflow global behavior (can be overridden in specific instances). - * - * @return bool - */ - public static function shouldOverflowYears() - { - return static::$yearsOverflow; - } - - /** - * Set specific options. - * - strictMode: true|false|null - * - monthOverflow: true|false|null - * - yearOverflow: true|false|null - * - humanDiffOptions: int|null - * - toStringFormat: string|Closure|null - * - toJsonFormat: string|Closure|null - * - locale: string|null - * - timezone: \DateTimeZone|string|int|null - * - macros: array|null - * - genericMacros: array|null - * - * @param array $settings - * - * @return $this|static - */ - public function settings(array $settings) - { - $this->localStrictModeEnabled = $settings['strictMode'] ?? null; - $this->localMonthsOverflow = $settings['monthOverflow'] ?? null; - $this->localYearsOverflow = $settings['yearOverflow'] ?? null; - $this->localHumanDiffOptions = $settings['humanDiffOptions'] ?? null; - $this->localToStringFormat = $settings['toStringFormat'] ?? null; - $this->localSerializer = $settings['toJsonFormat'] ?? null; - $this->localMacros = $settings['macros'] ?? null; - $this->localGenericMacros = $settings['genericMacros'] ?? null; - $this->localFormatFunction = $settings['formatFunction'] ?? null; - - if (isset($settings['locale'])) { - $locales = $settings['locale']; - - if (!\is_array($locales)) { - $locales = [$locales]; - } - - $this->locale(...$locales); - } - - if (isset($settings['innerTimezone'])) { - return $this->setTimezone($settings['innerTimezone']); - } - - if (isset($settings['timezone'])) { - return $this->shiftTimezone($settings['timezone']); - } - - return $this; - } - - /** - * Returns current local settings. - * - * @return array - */ - public function getSettings() - { - $settings = []; - $map = [ - 'localStrictModeEnabled' => 'strictMode', - 'localMonthsOverflow' => 'monthOverflow', - 'localYearsOverflow' => 'yearOverflow', - 'localHumanDiffOptions' => 'humanDiffOptions', - 'localToStringFormat' => 'toStringFormat', - 'localSerializer' => 'toJsonFormat', - 'localMacros' => 'macros', - 'localGenericMacros' => 'genericMacros', - 'locale' => 'locale', - 'tzName' => 'timezone', - 'localFormatFunction' => 'formatFunction', - ]; - - foreach ($map as $property => $key) { - $value = $this->$property ?? null; - - if ($value !== null) { - $settings[$key] = $value; - } - } - - return $settings; - } - - /** - * Show truthy properties on var_dump(). - * - * @return array - */ - public function __debugInfo() - { - $infos = array_filter(get_object_vars($this), function ($var) { - return $var; - }); - - foreach (['dumpProperties', 'constructedObjectId'] as $property) { - if (isset($infos[$property])) { - unset($infos[$property]); - } - } - - $this->addExtraDebugInfos($infos); - - return $infos; - } - - protected function addExtraDebugInfos(&$infos): void - { - if ($this instanceof DateTimeInterface) { - try { - if (!isset($infos['date'])) { - $infos['date'] = $this->format(CarbonInterface::MOCK_DATETIME_FORMAT); - } - - if (!isset($infos['timezone'])) { - $infos['timezone'] = $this->tzName; - } - } catch (Throwable $exception) { - // noop - } - } - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php b/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php deleted file mode 100644 index f98c2a32..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php +++ /dev/null @@ -1,258 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Traits; - -use Carbon\CarbonInterface; -use Carbon\Exceptions\UnknownUnitException; - -/** - * Trait Rounding. - * - * Round, ceil, floor units. - * - * Depends on the following methods: - * - * @method static copy() - * @method static startOfWeek(int $weekStartsAt = null) - */ -trait Rounding -{ - use IntervalRounding; - - /** - * Round the current instance at the given unit with given precision if specified and the given function. - * - * @param string $unit - * @param float|int $precision - * @param string $function - * - * @return CarbonInterface - */ - public function roundUnit($unit, $precision = 1, $function = 'round') - { - $metaUnits = [ - // @call roundUnit - 'millennium' => [static::YEARS_PER_MILLENNIUM, 'year'], - // @call roundUnit - 'century' => [static::YEARS_PER_CENTURY, 'year'], - // @call roundUnit - 'decade' => [static::YEARS_PER_DECADE, 'year'], - // @call roundUnit - 'quarter' => [static::MONTHS_PER_QUARTER, 'month'], - // @call roundUnit - 'millisecond' => [1000, 'microsecond'], - ]; - $normalizedUnit = static::singularUnit($unit); - $ranges = array_merge(static::getRangesByUnit($this->daysInMonth), [ - // @call roundUnit - 'microsecond' => [0, 999999], - ]); - $factor = 1; - $initialMonth = $this->month; - - if ($normalizedUnit === 'week') { - $normalizedUnit = 'day'; - $precision *= static::DAYS_PER_WEEK; - } - - if (isset($metaUnits[$normalizedUnit])) { - [$factor, $normalizedUnit] = $metaUnits[$normalizedUnit]; - } - - $precision *= $factor; - - if (!isset($ranges[$normalizedUnit])) { - throw new UnknownUnitException($unit); - } - - $found = false; - $fraction = 0; - $arguments = null; - $initialValue = null; - $factor = $this->year < 0 ? -1 : 1; - $changes = []; - $minimumInc = null; - - foreach ($ranges as $unit => [$minimum, $maximum]) { - if ($normalizedUnit === $unit) { - $arguments = [$this->$unit, $minimum]; - $initialValue = $this->$unit; - $fraction = $precision - floor($precision); - $found = true; - - continue; - } - - if ($found) { - $delta = $maximum + 1 - $minimum; - $factor /= $delta; - $fraction *= $delta; - $inc = ($this->$unit - $minimum) * $factor; - - if ($inc !== 0.0) { - $minimumInc = $minimumInc ?? ($arguments[0] / pow(2, 52)); - - // If value is still the same when adding a non-zero increment/decrement, - // it means precision got lost in the addition - if (abs($inc) < $minimumInc) { - $inc = $minimumInc * ($inc < 0 ? -1 : 1); - } - - // If greater than $precision, assume precision loss caused an overflow - if ($function !== 'floor' || abs($arguments[0] + $inc - $initialValue) >= $precision) { - $arguments[0] += $inc; - } - } - - $changes[$unit] = round( - $minimum + ($fraction ? $fraction * $function(($this->$unit - $minimum) / $fraction) : 0) - ); - - // Cannot use modulo as it lose double precision - while ($changes[$unit] >= $delta) { - $changes[$unit] -= $delta; - } - - $fraction -= floor($fraction); - } - } - - [$value, $minimum] = $arguments; - $normalizedValue = floor($function(($value - $minimum) / $precision) * $precision + $minimum); - - /** @var CarbonInterface $result */ - $result = $this->$normalizedUnit($normalizedValue); - - foreach ($changes as $unit => $value) { - $result = $result->$unit($value); - } - - return $normalizedUnit === 'month' && $precision <= 1 && abs($result->month - $initialMonth) === 2 - // Re-run the change in case an overflow occurred - ? $result->$normalizedUnit($normalizedValue) - : $result; - } - - /** - * Truncate the current instance at the given unit with given precision if specified. - * - * @param string $unit - * @param float|int $precision - * - * @return CarbonInterface - */ - public function floorUnit($unit, $precision = 1) - { - return $this->roundUnit($unit, $precision, 'floor'); - } - - /** - * Ceil the current instance at the given unit with given precision if specified. - * - * @param string $unit - * @param float|int $precision - * - * @return CarbonInterface - */ - public function ceilUnit($unit, $precision = 1) - { - return $this->roundUnit($unit, $precision, 'ceil'); - } - - /** - * Round the current instance second with given precision if specified. - * - * @param float|int|string|\DateInterval|null $precision - * @param string $function - * - * @return CarbonInterface - */ - public function round($precision = 1, $function = 'round') - { - return $this->roundWith($precision, $function); - } - - /** - * Round the current instance second with given precision if specified. - * - * @param float|int|string|\DateInterval|null $precision - * - * @return CarbonInterface - */ - public function floor($precision = 1) - { - return $this->round($precision, 'floor'); - } - - /** - * Ceil the current instance second with given precision if specified. - * - * @param float|int|string|\DateInterval|null $precision - * - * @return CarbonInterface - */ - public function ceil($precision = 1) - { - return $this->round($precision, 'ceil'); - } - - /** - * Round the current instance week. - * - * @param int $weekStartsAt optional start allow you to specify the day of week to use to start the week - * - * @return CarbonInterface - */ - public function roundWeek($weekStartsAt = null) - { - return $this->closest( - $this->avoidMutation()->floorWeek($weekStartsAt), - $this->avoidMutation()->ceilWeek($weekStartsAt) - ); - } - - /** - * Truncate the current instance week. - * - * @param int $weekStartsAt optional start allow you to specify the day of week to use to start the week - * - * @return CarbonInterface - */ - public function floorWeek($weekStartsAt = null) - { - return $this->startOfWeek($weekStartsAt); - } - - /** - * Ceil the current instance week. - * - * @param int $weekStartsAt optional start allow you to specify the day of week to use to start the week - * - * @return CarbonInterface - */ - public function ceilWeek($weekStartsAt = null) - { - if ($this->isMutable()) { - $startOfWeek = $this->avoidMutation()->startOfWeek($weekStartsAt); - - return $startOfWeek != $this ? - $this->startOfWeek($weekStartsAt)->addWeek() : - $this; - } - - $startOfWeek = $this->startOfWeek($weekStartsAt); - - return $startOfWeek != $this ? - $startOfWeek->addWeek() : - $this->avoidMutation(); - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php b/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php deleted file mode 100644 index 9e86bd3e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php +++ /dev/null @@ -1,304 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Traits; - -use Carbon\Exceptions\InvalidFormatException; -use ReturnTypeWillChange; -use Throwable; - -/** - * Trait Serialization. - * - * Serialization and JSON stuff. - * - * Depends on the following properties: - * - * @property int $year - * @property int $month - * @property int $daysInMonth - * @property int $quarter - * - * Depends on the following methods: - * - * @method string|static locale(string $locale = null, string ...$fallbackLocales) - * @method string toJSON() - */ -trait Serialization -{ - use ObjectInitialisation; - - /** - * The custom Carbon JSON serializer. - * - * @var callable|null - */ - protected static $serializer; - - /** - * List of key to use for dump/serialization. - * - * @var string[] - */ - protected $dumpProperties = ['date', 'timezone_type', 'timezone']; - - /** - * Locale to dump comes here before serialization. - * - * @var string|null - */ - protected $dumpLocale; - - /** - * Embed date properties to dump in a dedicated variables so it won't overlap native - * DateTime ones. - * - * @var array|null - */ - protected $dumpDateProperties; - - /** - * Return a serialized string of the instance. - * - * @return string - */ - public function serialize() - { - return serialize($this); - } - - /** - * Create an instance from a serialized string. - * - * @param string $value - * - * @throws InvalidFormatException - * - * @return static - */ - public static function fromSerialized($value) - { - $instance = @unserialize((string) $value); - - if (!$instance instanceof static) { - throw new InvalidFormatException("Invalid serialized value: $value"); - } - - return $instance; - } - - /** - * The __set_state handler. - * - * @param string|array $dump - * - * @return static - */ - #[ReturnTypeWillChange] - public static function __set_state($dump) - { - if (\is_string($dump)) { - return static::parse($dump); - } - - /** @var \DateTimeInterface $date */ - $date = get_parent_class(static::class) && method_exists(parent::class, '__set_state') - ? parent::__set_state((array) $dump) - : (object) $dump; - - return static::instance($date); - } - - /** - * Returns the list of properties to dump on serialize() called on. - * - * @return array - */ - public function __sleep() - { - $properties = $this->getSleepProperties(); - - if ($this->localTranslator ?? null) { - $properties[] = 'dumpLocale'; - $this->dumpLocale = $this->locale ?? null; - } - - return $properties; - } - - public function __serialize(): array - { - if (isset($this->timezone_type)) { - return [ - 'date' => $this->date ?? null, - 'timezone_type' => $this->timezone_type, - 'timezone' => $this->timezone ?? null, - ]; - } - - $timezone = $this->getTimezone(); - $export = [ - 'date' => $this->format('Y-m-d H:i:s.u'), - 'timezone_type' => $timezone->getType(), - 'timezone' => $timezone->getName(), - ]; - - // @codeCoverageIgnoreStart - if (\extension_loaded('msgpack') && isset($this->constructedObjectId)) { - $export['dumpDateProperties'] = [ - 'date' => $this->format('Y-m-d H:i:s.u'), - 'timezone' => serialize($this->timezone ?? null), - ]; - } - // @codeCoverageIgnoreEnd - - if ($this->localTranslator ?? null) { - $export['dumpLocale'] = $this->locale ?? null; - } - - return $export; - } - - /** - * Set locale if specified on unserialize() called. - * - * @return void - */ - #[ReturnTypeWillChange] - public function __wakeup() - { - if (parent::class && method_exists(parent::class, '__wakeup')) { - // @codeCoverageIgnoreStart - try { - parent::__wakeup(); - } catch (Throwable $exception) { - try { - // FatalError occurs when calling msgpack_unpack() in PHP 7.4 or later. - ['date' => $date, 'timezone' => $timezone] = $this->dumpDateProperties; - parent::__construct($date, unserialize($timezone)); - } catch (Throwable $ignoredException) { - throw $exception; - } - } - // @codeCoverageIgnoreEnd - } - - $this->constructedObjectId = spl_object_hash($this); - - if (isset($this->dumpLocale)) { - $this->locale($this->dumpLocale); - $this->dumpLocale = null; - } - - $this->cleanupDumpProperties(); - } - - public function __unserialize(array $data): void - { - // @codeCoverageIgnoreStart - try { - $this->__construct($data['date'] ?? null, $data['timezone'] ?? null); - } catch (Throwable $exception) { - if (!isset($data['dumpDateProperties']['date'], $data['dumpDateProperties']['timezone'])) { - throw $exception; - } - - try { - // FatalError occurs when calling msgpack_unpack() in PHP 7.4 or later. - ['date' => $date, 'timezone' => $timezone] = $data['dumpDateProperties']; - $this->__construct($date, unserialize($timezone)); - } catch (Throwable $ignoredException) { - throw $exception; - } - } - // @codeCoverageIgnoreEnd - - if (isset($data['dumpLocale'])) { - $this->locale($data['dumpLocale']); - } - } - - /** - * Prepare the object for JSON serialization. - * - * @return array|string - */ - #[ReturnTypeWillChange] - public function jsonSerialize() - { - $serializer = $this->localSerializer ?? static::$serializer; - - if ($serializer) { - return \is_string($serializer) - ? $this->rawFormat($serializer) - : $serializer($this); - } - - return $this->toJSON(); - } - - /** - * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather transform Carbon object before the serialization. - * - * JSON serialize all Carbon instances using the given callback. - * - * @param callable $callback - * - * @return void - */ - public static function serializeUsing($callback) - { - static::$serializer = $callback; - } - - /** - * Cleanup properties attached to the public scope of DateTime when a dump of the date is requested. - * foreach ($date as $_) {} - * serializer($date) - * var_export($date) - * get_object_vars($date) - */ - public function cleanupDumpProperties() - { - if (PHP_VERSION < 8.2) { - foreach ($this->dumpProperties as $property) { - if (isset($this->$property)) { - unset($this->$property); - } - } - } - - return $this; - } - - private function getSleepProperties(): array - { - $properties = $this->dumpProperties; - - // @codeCoverageIgnoreStart - if (!\extension_loaded('msgpack')) { - return $properties; - } - - if (isset($this->constructedObjectId)) { - $this->dumpDateProperties = [ - 'date' => $this->format('Y-m-d H:i:s.u'), - 'timezone' => serialize($this->timezone ?? null), - ]; - - $properties[] = 'dumpDateProperties'; - } - - return $properties; - // @codeCoverageIgnoreEnd - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Test.php b/vendor/nesbot/carbon/src/Carbon/Traits/Test.php deleted file mode 100644 index e0c9e806..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Test.php +++ /dev/null @@ -1,226 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Traits; - -use Carbon\CarbonInterface; -use Carbon\CarbonTimeZone; -use Closure; -use DateTimeImmutable; -use DateTimeInterface; -use InvalidArgumentException; -use Throwable; - -trait Test -{ - /////////////////////////////////////////////////////////////////// - ///////////////////////// TESTING AIDS //////////////////////////// - /////////////////////////////////////////////////////////////////// - - /** - * A test Carbon instance to be returned when now instances are created. - * - * @var Closure|static|null - */ - protected static $testNow; - - /** - * The timezone to resto to when clearing the time mock. - * - * @var string|null - */ - protected static $testDefaultTimezone; - - /** - * Set a Carbon instance (real or mock) to be returned when a "now" - * instance is created. The provided instance will be returned - * specifically under the following conditions: - * - A call to the static now() method, ex. Carbon::now() - * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) - * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') - * - When a string containing the desired time is passed to Carbon::parse(). - * - * Note the timezone parameter was left out of the examples above and - * has no affect as the mock value will be returned regardless of its value. - * - * Only the moment is mocked with setTestNow(), the timezone will still be the one passed - * as parameter of date_default_timezone_get() as a fallback (see setTestNowAndTimezone()). - * - * To clear the test instance call this method using the default - * parameter of null. - * - * /!\ Use this method for unit tests only. - * - * @param DateTimeInterface|Closure|static|string|false|null $testNow real or mock Carbon instance - */ - public static function setTestNow($testNow = null) - { - static::$testNow = $testNow instanceof self || $testNow instanceof Closure - ? $testNow - : static::make($testNow); - } - - /** - * Set a Carbon instance (real or mock) to be returned when a "now" - * instance is created. The provided instance will be returned - * specifically under the following conditions: - * - A call to the static now() method, ex. Carbon::now() - * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) - * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') - * - When a string containing the desired time is passed to Carbon::parse(). - * - * It will also align default timezone (e.g. call date_default_timezone_set()) with - * the second argument or if null, with the timezone of the given date object. - * - * To clear the test instance call this method using the default - * parameter of null. - * - * /!\ Use this method for unit tests only. - * - * @param DateTimeInterface|Closure|static|string|false|null $testNow real or mock Carbon instance - */ - public static function setTestNowAndTimezone($testNow = null, $tz = null) - { - if ($testNow) { - self::$testDefaultTimezone = self::$testDefaultTimezone ?? date_default_timezone_get(); - } - - $useDateInstanceTimezone = $testNow instanceof DateTimeInterface; - - if ($useDateInstanceTimezone) { - self::setDefaultTimezone($testNow->getTimezone()->getName(), $testNow); - } - - static::setTestNow($testNow); - - if (!$useDateInstanceTimezone) { - $now = static::getMockedTestNow(\func_num_args() === 1 ? null : $tz); - $tzName = $now ? $now->tzName : null; - self::setDefaultTimezone($tzName ?? self::$testDefaultTimezone ?? 'UTC', $now); - } - - if (!$testNow) { - self::$testDefaultTimezone = null; - } - } - - /** - * Temporarily sets a static date to be used within the callback. - * Using setTestNow to set the date, executing the callback, then - * clearing the test instance. - * - * /!\ Use this method for unit tests only. - * - * @param DateTimeInterface|Closure|static|string|false|null $testNow real or mock Carbon instance - * @param Closure|null $callback - * - * @return mixed - */ - public static function withTestNow($testNow = null, $callback = null) - { - static::setTestNow($testNow); - - try { - $result = $callback(); - } finally { - static::setTestNow(); - } - - return $result; - } - - /** - * Get the Carbon instance (real or mock) to be returned when a "now" - * instance is created. - * - * @return Closure|static the current instance used for testing - */ - public static function getTestNow() - { - return static::$testNow; - } - - /** - * Determine if there is a valid test instance set. A valid test instance - * is anything that is not null. - * - * @return bool true if there is a test instance, otherwise false - */ - public static function hasTestNow() - { - return static::getTestNow() !== null; - } - - /** - * Get the mocked date passed in setTestNow() and if it's a Closure, execute it. - * - * @param string|\DateTimeZone $tz - * - * @return \Carbon\CarbonImmutable|\Carbon\Carbon|null - */ - protected static function getMockedTestNow($tz) - { - $testNow = static::getTestNow(); - - if ($testNow instanceof Closure) { - $realNow = new DateTimeImmutable('now'); - $testNow = $testNow(static::parse( - $realNow->format('Y-m-d H:i:s.u'), - $tz ?: $realNow->getTimezone() - )); - } - /* @var \Carbon\CarbonImmutable|\Carbon\Carbon|null $testNow */ - - return $testNow instanceof CarbonInterface - ? $testNow->avoidMutation()->tz($tz) - : $testNow; - } - - protected static function mockConstructorParameters(&$time, $tz) - { - /** @var \Carbon\CarbonImmutable|\Carbon\Carbon $testInstance */ - $testInstance = clone static::getMockedTestNow($tz); - - if (static::hasRelativeKeywords($time)) { - $testInstance = $testInstance->modify($time); - } - - $time = $testInstance instanceof self - ? $testInstance->rawFormat(static::MOCK_DATETIME_FORMAT) - : $testInstance->format(static::MOCK_DATETIME_FORMAT); - } - - private static function setDefaultTimezone($timezone, DateTimeInterface $date = null) - { - $previous = null; - $success = false; - - try { - $success = date_default_timezone_set($timezone); - } catch (Throwable $exception) { - $previous = $exception; - } - - if (!$success) { - $suggestion = @CarbonTimeZone::create($timezone)->toRegionName($date); - - throw new InvalidArgumentException( - "Timezone ID '$timezone' is invalid". - ($suggestion && $suggestion !== $timezone ? ", did you mean '$suggestion'?" : '.')."\n". - "It must be one of the IDs from DateTimeZone::listIdentifiers(),\n". - 'For the record, hours/minutes offset are relevant only for a particular moment, '. - 'but not as a default timezone.', - 0, - $previous - ); - } - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Timestamp.php b/vendor/nesbot/carbon/src/Carbon/Traits/Timestamp.php deleted file mode 100644 index 88a465c9..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Timestamp.php +++ /dev/null @@ -1,198 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Traits; - -/** - * Trait Timestamp. - */ -trait Timestamp -{ - /** - * Create a Carbon instance from a timestamp and set the timezone (use default one if not specified). - * - * Timestamp input can be given as int, float or a string containing one or more numbers. - * - * @param float|int|string $timestamp - * @param \DateTimeZone|string|null $tz - * - * @return static - */ - public static function createFromTimestamp($timestamp, $tz = null) - { - return static::createFromTimestampUTC($timestamp)->setTimezone($tz); - } - - /** - * Create a Carbon instance from an timestamp keeping the timezone to UTC. - * - * Timestamp input can be given as int, float or a string containing one or more numbers. - * - * @param float|int|string $timestamp - * - * @return static - */ - public static function createFromTimestampUTC($timestamp) - { - [$integer, $decimal] = self::getIntegerAndDecimalParts($timestamp); - $delta = floor($decimal / static::MICROSECONDS_PER_SECOND); - $integer += $delta; - $decimal -= $delta * static::MICROSECONDS_PER_SECOND; - $decimal = str_pad((string) $decimal, 6, '0', STR_PAD_LEFT); - - return static::rawCreateFromFormat('U u', "$integer $decimal"); - } - - /** - * Create a Carbon instance from a timestamp in milliseconds. - * - * Timestamp input can be given as int, float or a string containing one or more numbers. - * - * @param float|int|string $timestamp - * - * @return static - */ - public static function createFromTimestampMsUTC($timestamp) - { - [$milliseconds, $microseconds] = self::getIntegerAndDecimalParts($timestamp, 3); - $sign = $milliseconds < 0 || ($milliseconds === 0.0 && $microseconds < 0) ? -1 : 1; - $milliseconds = abs($milliseconds); - $microseconds = $sign * abs($microseconds) + static::MICROSECONDS_PER_MILLISECOND * ($milliseconds % static::MILLISECONDS_PER_SECOND); - $seconds = $sign * floor($milliseconds / static::MILLISECONDS_PER_SECOND); - $delta = floor($microseconds / static::MICROSECONDS_PER_SECOND); - $seconds += $delta; - $microseconds -= $delta * static::MICROSECONDS_PER_SECOND; - $microseconds = str_pad($microseconds, 6, '0', STR_PAD_LEFT); - - return static::rawCreateFromFormat('U u', "$seconds $microseconds"); - } - - /** - * Create a Carbon instance from a timestamp in milliseconds. - * - * Timestamp input can be given as int, float or a string containing one or more numbers. - * - * @param float|int|string $timestamp - * @param \DateTimeZone|string|null $tz - * - * @return static - */ - public static function createFromTimestampMs($timestamp, $tz = null) - { - return static::createFromTimestampMsUTC($timestamp) - ->setTimezone($tz); - } - - /** - * Set the instance's timestamp. - * - * Timestamp input can be given as int, float or a string containing one or more numbers. - * - * @param float|int|string $unixTimestamp - * - * @return static - */ - public function timestamp($unixTimestamp) - { - return $this->setTimestamp($unixTimestamp); - } - - /** - * Returns a timestamp rounded with the given precision (6 by default). - * - * @example getPreciseTimestamp() 1532087464437474 (microsecond maximum precision) - * @example getPreciseTimestamp(6) 1532087464437474 - * @example getPreciseTimestamp(5) 153208746443747 (1/100000 second precision) - * @example getPreciseTimestamp(4) 15320874644375 (1/10000 second precision) - * @example getPreciseTimestamp(3) 1532087464437 (millisecond precision) - * @example getPreciseTimestamp(2) 153208746444 (1/100 second precision) - * @example getPreciseTimestamp(1) 15320874644 (1/10 second precision) - * @example getPreciseTimestamp(0) 1532087464 (second precision) - * @example getPreciseTimestamp(-1) 153208746 (10 second precision) - * @example getPreciseTimestamp(-2) 15320875 (100 second precision) - * - * @param int $precision - * - * @return float - */ - public function getPreciseTimestamp($precision = 6) - { - return round(((float) $this->rawFormat('Uu')) / pow(10, 6 - $precision)); - } - - /** - * Returns the milliseconds timestamps used amongst other by Date javascript objects. - * - * @return float - */ - public function valueOf() - { - return $this->getPreciseTimestamp(3); - } - - /** - * Returns the timestamp with millisecond precision. - * - * @return int - */ - public function getTimestampMs() - { - return (int) $this->getPreciseTimestamp(3); - } - - /** - * @alias getTimestamp - * - * Returns the UNIX timestamp for the current date. - * - * @return int - */ - public function unix() - { - return $this->getTimestamp(); - } - - /** - * Return an array with integer part digits and decimals digits split from one or more positive numbers - * (such as timestamps) as string with the given number of decimals (6 by default). - * - * By splitting integer and decimal, this method obtain a better precision than - * number_format when the input is a string. - * - * @param float|int|string $numbers one or more numbers - * @param int $decimals number of decimals precision (6 by default) - * - * @return array 0-index is integer part, 1-index is decimal part digits - */ - private static function getIntegerAndDecimalParts($numbers, $decimals = 6) - { - if (\is_int($numbers) || \is_float($numbers)) { - $numbers = number_format($numbers, $decimals, '.', ''); - } - - $sign = str_starts_with($numbers, '-') ? -1 : 1; - $integer = 0; - $decimal = 0; - - foreach (preg_split('`[^\d.]+`', $numbers) as $chunk) { - [$integerPart, $decimalPart] = explode('.', "$chunk."); - - $integer += (int) $integerPart; - $decimal += (float) ("0.$decimalPart"); - } - - $overflow = floor($decimal); - $integer += $overflow; - $decimal -= $overflow; - - return [$sign * $integer, $decimal === 0.0 ? 0.0 : $sign * round($decimal * pow(10, $decimals))]; - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/ToStringFormat.php b/vendor/nesbot/carbon/src/Carbon/Traits/ToStringFormat.php deleted file mode 100644 index 38cb2406..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Traits/ToStringFormat.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Traits; - -use Closure; - -/** - * Trait ToStringFormat. - * - * Handle global format customization for string cast of the object. - */ -trait ToStringFormat -{ - /** - * Format to use for __toString method when type juggling occurs. - * - * @var string|Closure|null - */ - protected static $toStringFormat; - - /** - * Reset the format used to the default when type juggling a Carbon instance to a string - * - * @return void - */ - public static function resetToStringFormat() - { - static::setToStringFormat(null); - } - - /** - * @param string|Closure|null $format - * - * @return void - * - * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather let Carbon object being cast to string with DEFAULT_TO_STRING_FORMAT, and - * use other method or custom format passed to format() method if you need to dump another string - * format. - * - * Set the default format used when type juggling a Carbon instance to a string. - */ - public static function setToStringFormat($format) - { - static::$toStringFormat = $format; - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Units.php b/vendor/nesbot/carbon/src/Carbon/Traits/Units.php deleted file mode 100644 index f4f797d9..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Units.php +++ /dev/null @@ -1,406 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Traits; - -use Carbon\CarbonConverterInterface; -use Carbon\CarbonInterface; -use Carbon\CarbonInterval; -use Carbon\Exceptions\UnitException; -use Closure; -use DateInterval; -use ReturnTypeWillChange; - -/** - * Trait Units. - * - * Add, subtract and set units. - */ -trait Units -{ - /** - * Add seconds to the instance using timestamp. Positive $value travels - * forward while negative $value travels into the past. - * - * @param string $unit - * @param int $value - * - * @return static - */ - public function addRealUnit($unit, $value = 1) - { - switch ($unit) { - // @call addRealUnit - case 'micro': - - // @call addRealUnit - case 'microsecond': - /* @var CarbonInterface $this */ - $diff = $this->microsecond + $value; - $time = $this->getTimestamp(); - $seconds = (int) floor($diff / static::MICROSECONDS_PER_SECOND); - $time += $seconds; - $diff -= $seconds * static::MICROSECONDS_PER_SECOND; - $microtime = str_pad((string) $diff, 6, '0', STR_PAD_LEFT); - $tz = $this->tz; - - return $this->tz('UTC')->modify("@$time.$microtime")->tz($tz); - - // @call addRealUnit - case 'milli': - // @call addRealUnit - case 'millisecond': - return $this->addRealUnit('microsecond', $value * static::MICROSECONDS_PER_MILLISECOND); - - // @call addRealUnit - case 'second': - break; - - // @call addRealUnit - case 'minute': - $value *= static::SECONDS_PER_MINUTE; - - break; - - // @call addRealUnit - case 'hour': - $value *= static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE; - - break; - - // @call addRealUnit - case 'day': - $value *= static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE; - - break; - - // @call addRealUnit - case 'week': - $value *= static::DAYS_PER_WEEK * static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE; - - break; - - // @call addRealUnit - case 'month': - $value *= 30 * static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE; - - break; - - // @call addRealUnit - case 'quarter': - $value *= static::MONTHS_PER_QUARTER * 30 * static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE; - - break; - - // @call addRealUnit - case 'year': - $value *= 365 * static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE; - - break; - - // @call addRealUnit - case 'decade': - $value *= static::YEARS_PER_DECADE * 365 * static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE; - - break; - - // @call addRealUnit - case 'century': - $value *= static::YEARS_PER_CENTURY * 365 * static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE; - - break; - - // @call addRealUnit - case 'millennium': - $value *= static::YEARS_PER_MILLENNIUM * 365 * static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE; - - break; - - default: - if ($this->localStrictModeEnabled ?? static::isStrictModeEnabled()) { - throw new UnitException("Invalid unit for real timestamp add/sub: '$unit'"); - } - - return $this; - } - - /* @var CarbonInterface $this */ - return $this->setTimestamp((int) ($this->getTimestamp() + $value)); - } - - public function subRealUnit($unit, $value = 1) - { - return $this->addRealUnit($unit, -$value); - } - - /** - * Returns true if a property can be changed via setter. - * - * @param string $unit - * - * @return bool - */ - public static function isModifiableUnit($unit) - { - static $modifiableUnits = [ - // @call addUnit - 'millennium', - // @call addUnit - 'century', - // @call addUnit - 'decade', - // @call addUnit - 'quarter', - // @call addUnit - 'week', - // @call addUnit - 'weekday', - ]; - - return \in_array($unit, $modifiableUnits, true) || \in_array($unit, static::$units, true); - } - - /** - * Call native PHP DateTime/DateTimeImmutable add() method. - * - * @param DateInterval $interval - * - * @return static - */ - public function rawAdd(DateInterval $interval) - { - return parent::add($interval); - } - - /** - * Add given units or interval to the current instance. - * - * @example $date->add('hour', 3) - * @example $date->add(15, 'days') - * @example $date->add(CarbonInterval::days(4)) - * - * @param string|DateInterval|Closure|CarbonConverterInterface $unit - * @param int $value - * @param bool|null $overflow - * - * @return static - */ - #[ReturnTypeWillChange] - public function add($unit, $value = 1, $overflow = null) - { - if (\is_string($unit) && \func_num_args() === 1) { - $unit = CarbonInterval::make($unit); - } - - if ($unit instanceof CarbonConverterInterface) { - return $this->resolveCarbon($unit->convertDate($this, false)); - } - - if ($unit instanceof Closure) { - return $this->resolveCarbon($unit($this, false)); - } - - if ($unit instanceof DateInterval) { - return parent::add($unit); - } - - if (is_numeric($unit)) { - [$value, $unit] = [$unit, $value]; - } - - return $this->addUnit($unit, $value, $overflow); - } - - /** - * Add given units to the current instance. - * - * @param string $unit - * @param int $value - * @param bool|null $overflow - * - * @return static - */ - public function addUnit($unit, $value = 1, $overflow = null) - { - $originalArgs = \func_get_args(); - - $date = $this; - - if (!is_numeric($value) || !(float) $value) { - return $date->isMutable() ? $date : $date->avoidMutation(); - } - - $unit = self::singularUnit($unit); - $metaUnits = [ - 'millennium' => [static::YEARS_PER_MILLENNIUM, 'year'], - 'century' => [static::YEARS_PER_CENTURY, 'year'], - 'decade' => [static::YEARS_PER_DECADE, 'year'], - 'quarter' => [static::MONTHS_PER_QUARTER, 'month'], - ]; - - if (isset($metaUnits[$unit])) { - [$factor, $unit] = $metaUnits[$unit]; - $value *= $factor; - } - - if ($unit === 'weekday') { - $weekendDays = static::getWeekendDays(); - - if ($weekendDays !== [static::SATURDAY, static::SUNDAY]) { - $absoluteValue = abs($value); - $sign = $value / max(1, $absoluteValue); - $weekDaysCount = 7 - min(6, \count(array_unique($weekendDays))); - $weeks = floor($absoluteValue / $weekDaysCount); - - for ($diff = $absoluteValue % $weekDaysCount; $diff; $diff--) { - /** @var static $date */ - $date = $date->addDays($sign); - - while (\in_array($date->dayOfWeek, $weekendDays, true)) { - $date = $date->addDays($sign); - } - } - - $value = $weeks * $sign; - $unit = 'week'; - } - - $timeString = $date->toTimeString(); - } elseif ($canOverflow = (\in_array($unit, [ - 'month', - 'year', - ]) && ($overflow === false || ( - $overflow === null && - ($ucUnit = ucfirst($unit).'s') && - !($this->{'local'.$ucUnit.'Overflow'} ?? static::{'shouldOverflow'.$ucUnit}()) - )))) { - $day = $date->day; - } - - $value = (int) $value; - - if ($unit === 'milli' || $unit === 'millisecond') { - $unit = 'microsecond'; - $value *= static::MICROSECONDS_PER_MILLISECOND; - } - - // Work-around for bug https://bugs.php.net/bug.php?id=75642 - if ($unit === 'micro' || $unit === 'microsecond') { - $microseconds = $this->micro + $value; - $second = (int) floor($microseconds / static::MICROSECONDS_PER_SECOND); - $microseconds %= static::MICROSECONDS_PER_SECOND; - if ($microseconds < 0) { - $microseconds += static::MICROSECONDS_PER_SECOND; - } - $date = $date->microseconds($microseconds); - $unit = 'second'; - $value = $second; - } - $date = $date->modify("$value $unit"); - - if (isset($timeString)) { - $date = $date->setTimeFromTimeString($timeString); - } elseif (isset($canOverflow, $day) && $canOverflow && $day !== $date->day) { - $date = $date->modify('last day of previous month'); - } - - if (!$date) { - throw new UnitException('Unable to add unit '.var_export($originalArgs, true)); - } - - return $date; - } - - /** - * Subtract given units to the current instance. - * - * @param string $unit - * @param int $value - * @param bool|null $overflow - * - * @return static - */ - public function subUnit($unit, $value = 1, $overflow = null) - { - return $this->addUnit($unit, -$value, $overflow); - } - - /** - * Call native PHP DateTime/DateTimeImmutable sub() method. - * - * @param DateInterval $interval - * - * @return static - */ - public function rawSub(DateInterval $interval) - { - return parent::sub($interval); - } - - /** - * Subtract given units or interval to the current instance. - * - * @example $date->sub('hour', 3) - * @example $date->sub(15, 'days') - * @example $date->sub(CarbonInterval::days(4)) - * - * @param string|DateInterval|Closure|CarbonConverterInterface $unit - * @param int $value - * @param bool|null $overflow - * - * @return static - */ - #[ReturnTypeWillChange] - public function sub($unit, $value = 1, $overflow = null) - { - if (\is_string($unit) && \func_num_args() === 1) { - $unit = CarbonInterval::make($unit); - } - - if ($unit instanceof CarbonConverterInterface) { - return $this->resolveCarbon($unit->convertDate($this, true)); - } - - if ($unit instanceof Closure) { - return $this->resolveCarbon($unit($this, true)); - } - - if ($unit instanceof DateInterval) { - return parent::sub($unit); - } - - if (is_numeric($unit)) { - [$value, $unit] = [$unit, $value]; - } - - return $this->addUnit($unit, -(float) $value, $overflow); - } - - /** - * Subtract given units or interval to the current instance. - * - * @see sub() - * - * @param string|DateInterval $unit - * @param int $value - * @param bool|null $overflow - * - * @return static - */ - public function subtract($unit, $value = 1, $overflow = null) - { - if (\is_string($unit) && \func_num_args() === 1) { - $unit = CarbonInterval::make($unit); - } - - return $this->sub($unit, $value, $overflow); - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Week.php b/vendor/nesbot/carbon/src/Carbon/Traits/Week.php deleted file mode 100644 index 6f148145..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Week.php +++ /dev/null @@ -1,219 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Traits; - -/** - * Trait Week. - * - * week and ISO week number, year and count in year. - * - * Depends on the following properties: - * - * @property int $daysInYear - * @property int $dayOfWeek - * @property int $dayOfYear - * @property int $year - * - * Depends on the following methods: - * - * @method static addWeeks(int $weeks = 1) - * @method static copy() - * @method static dayOfYear(int $dayOfYear) - * @method string getTranslationMessage(string $key, ?string $locale = null, ?string $default = null, $translator = null) - * @method static next(int|string $day = null) - * @method static startOfWeek(int $day = 1) - * @method static subWeeks(int $weeks = 1) - * @method static year(int $year = null) - */ -trait Week -{ - /** - * Set/get the week number of year using given first day of week and first - * day of year included in the first week. Or use ISO format if no settings - * given. - * - * @param int|null $year if null, act as a getter, if not null, set the year and return current instance. - * @param int|null $dayOfWeek first date of week from 0 (Sunday) to 6 (Saturday) - * @param int|null $dayOfYear first day of year included in the week #1 - * - * @return int|static - */ - public function isoWeekYear($year = null, $dayOfWeek = null, $dayOfYear = null) - { - return $this->weekYear( - $year, - $dayOfWeek ?? 1, - $dayOfYear ?? 4 - ); - } - - /** - * Set/get the week number of year using given first day of week and first - * day of year included in the first week. Or use US format if no settings - * given (Sunday / Jan 6). - * - * @param int|null $year if null, act as a getter, if not null, set the year and return current instance. - * @param int|null $dayOfWeek first date of week from 0 (Sunday) to 6 (Saturday) - * @param int|null $dayOfYear first day of year included in the week #1 - * - * @return int|static - */ - public function weekYear($year = null, $dayOfWeek = null, $dayOfYear = null) - { - $dayOfWeek = $dayOfWeek ?? $this->getTranslationMessage('first_day_of_week') ?? 0; - $dayOfYear = $dayOfYear ?? $this->getTranslationMessage('day_of_first_week_of_year') ?? 1; - - if ($year !== null) { - $year = (int) round($year); - - if ($this->weekYear(null, $dayOfWeek, $dayOfYear) === $year) { - return $this->avoidMutation(); - } - - $week = $this->week(null, $dayOfWeek, $dayOfYear); - $day = $this->dayOfWeek; - $date = $this->year($year); - switch ($date->weekYear(null, $dayOfWeek, $dayOfYear) - $year) { - case 1: - $date = $date->subWeeks(26); - - break; - case -1: - $date = $date->addWeeks(26); - - break; - } - - $date = $date->addWeeks($week - $date->week(null, $dayOfWeek, $dayOfYear))->startOfWeek($dayOfWeek); - - if ($date->dayOfWeek === $day) { - return $date; - } - - return $date->next($day); - } - - $year = $this->year; - $day = $this->dayOfYear; - $date = $this->avoidMutation()->dayOfYear($dayOfYear)->startOfWeek($dayOfWeek); - - if ($date->year === $year && $day < $date->dayOfYear) { - return $year - 1; - } - - $date = $this->avoidMutation()->addYear()->dayOfYear($dayOfYear)->startOfWeek($dayOfWeek); - - if ($date->year === $year && $day >= $date->dayOfYear) { - return $year + 1; - } - - return $year; - } - - /** - * Get the number of weeks of the current week-year using given first day of week and first - * day of year included in the first week. Or use ISO format if no settings - * given. - * - * @param int|null $dayOfWeek first date of week from 0 (Sunday) to 6 (Saturday) - * @param int|null $dayOfYear first day of year included in the week #1 - * - * @return int - */ - public function isoWeeksInYear($dayOfWeek = null, $dayOfYear = null) - { - return $this->weeksInYear( - $dayOfWeek ?? 1, - $dayOfYear ?? 4 - ); - } - - /** - * Get the number of weeks of the current week-year using given first day of week and first - * day of year included in the first week. Or use US format if no settings - * given (Sunday / Jan 6). - * - * @param int|null $dayOfWeek first date of week from 0 (Sunday) to 6 (Saturday) - * @param int|null $dayOfYear first day of year included in the week #1 - * - * @return int - */ - public function weeksInYear($dayOfWeek = null, $dayOfYear = null) - { - $dayOfWeek = $dayOfWeek ?? $this->getTranslationMessage('first_day_of_week') ?? 0; - $dayOfYear = $dayOfYear ?? $this->getTranslationMessage('day_of_first_week_of_year') ?? 1; - $year = $this->year; - $start = $this->avoidMutation()->dayOfYear($dayOfYear)->startOfWeek($dayOfWeek); - $startDay = $start->dayOfYear; - if ($start->year !== $year) { - $startDay -= $start->daysInYear; - } - $end = $this->avoidMutation()->addYear()->dayOfYear($dayOfYear)->startOfWeek($dayOfWeek); - $endDay = $end->dayOfYear; - if ($end->year !== $year) { - $endDay += $this->daysInYear; - } - - return (int) round(($endDay - $startDay) / 7); - } - - /** - * Get/set the week number using given first day of week and first - * day of year included in the first week. Or use US format if no settings - * given (Sunday / Jan 6). - * - * @param int|null $week - * @param int|null $dayOfWeek - * @param int|null $dayOfYear - * - * @return int|static - */ - public function week($week = null, $dayOfWeek = null, $dayOfYear = null) - { - $date = $this; - $dayOfWeek = $dayOfWeek ?? $this->getTranslationMessage('first_day_of_week') ?? 0; - $dayOfYear = $dayOfYear ?? $this->getTranslationMessage('day_of_first_week_of_year') ?? 1; - - if ($week !== null) { - return $date->addWeeks(round($week) - $this->week(null, $dayOfWeek, $dayOfYear)); - } - - $start = $date->avoidMutation()->dayOfYear($dayOfYear)->startOfWeek($dayOfWeek); - $end = $date->avoidMutation()->startOfWeek($dayOfWeek); - if ($start > $end) { - $start = $start->subWeeks(26)->dayOfYear($dayOfYear)->startOfWeek($dayOfWeek); - } - $week = (int) ($start->diffInDays($end) / 7 + 1); - - return $week > $end->weeksInYear($dayOfWeek, $dayOfYear) ? 1 : $week; - } - - /** - * Get/set the week number using given first day of week and first - * day of year included in the first week. Or use ISO format if no settings - * given. - * - * @param int|null $week - * @param int|null $dayOfWeek - * @param int|null $dayOfYear - * - * @return int|static - */ - public function isoWeek($week = null, $dayOfWeek = null, $dayOfYear = null) - { - return $this->week( - $week, - $dayOfWeek ?? 1, - $dayOfYear ?? 4 - ); - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Translator.php b/vendor/nesbot/carbon/src/Carbon/Translator.php deleted file mode 100644 index 491c9e72..00000000 --- a/vendor/nesbot/carbon/src/Carbon/Translator.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon; - -use ReflectionMethod; -use Symfony\Component\Translation; -use Symfony\Contracts\Translation\TranslatorInterface; - -$transMethod = new ReflectionMethod( - class_exists(TranslatorInterface::class) - ? TranslatorInterface::class - : Translation\Translator::class, - 'trans' -); - -require $transMethod->hasReturnType() - ? __DIR__.'/../../lazy/Carbon/TranslatorStrongType.php' - : __DIR__.'/../../lazy/Carbon/TranslatorWeakType.php'; - -class Translator extends LazyTranslator -{ - // Proxy dynamically loaded LazyTranslator in a static way -} diff --git a/vendor/nesbot/carbon/src/Carbon/TranslatorImmutable.php b/vendor/nesbot/carbon/src/Carbon/TranslatorImmutable.php deleted file mode 100644 index ad36c670..00000000 --- a/vendor/nesbot/carbon/src/Carbon/TranslatorImmutable.php +++ /dev/null @@ -1,99 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon; - -use Carbon\Exceptions\ImmutableException; -use Symfony\Component\Config\ConfigCacheFactoryInterface; -use Symfony\Component\Translation\Formatter\MessageFormatterInterface; - -class TranslatorImmutable extends Translator -{ - /** @var bool */ - private $constructed = false; - - public function __construct($locale, MessageFormatterInterface $formatter = null, $cacheDir = null, $debug = false) - { - parent::__construct($locale, $formatter, $cacheDir, $debug); - $this->constructed = true; - } - - /** - * @codeCoverageIgnore - */ - public function setDirectories(array $directories) - { - $this->disallowMutation(__METHOD__); - - return parent::setDirectories($directories); - } - - public function setLocale($locale) - { - $this->disallowMutation(__METHOD__); - - return parent::setLocale($locale); - } - - /** - * @codeCoverageIgnore - */ - public function setMessages($locale, $messages) - { - $this->disallowMutation(__METHOD__); - - return parent::setMessages($locale, $messages); - } - - /** - * @codeCoverageIgnore - */ - public function setTranslations($messages) - { - $this->disallowMutation(__METHOD__); - - return parent::setTranslations($messages); - } - - /** - * @codeCoverageIgnore - */ - public function setConfigCacheFactory(ConfigCacheFactoryInterface $configCacheFactory) - { - $this->disallowMutation(__METHOD__); - - parent::setConfigCacheFactory($configCacheFactory); - } - - public function resetMessages($locale = null) - { - $this->disallowMutation(__METHOD__); - - return parent::resetMessages($locale); - } - - /** - * @codeCoverageIgnore - */ - public function setFallbackLocales(array $locales) - { - $this->disallowMutation(__METHOD__); - - parent::setFallbackLocales($locales); - } - - private function disallowMutation($method) - { - if ($this->constructed) { - throw new ImmutableException($method.' not allowed on '.static::class); - } - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/TranslatorStrongTypeInterface.php b/vendor/nesbot/carbon/src/Carbon/TranslatorStrongTypeInterface.php deleted file mode 100644 index ef4dee8e..00000000 --- a/vendor/nesbot/carbon/src/Carbon/TranslatorStrongTypeInterface.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon; - -use Symfony\Component\Translation\MessageCatalogueInterface; - -/** - * Mark translator using strong type from symfony/translation >= 6. - */ -interface TranslatorStrongTypeInterface -{ - public function getFromCatalogue(MessageCatalogueInterface $catalogue, string $id, string $domain = 'messages'); -} diff --git a/vendor/nette/schema/composer.json b/vendor/nette/schema/composer.json deleted file mode 100644 index bece68ac..00000000 --- a/vendor/nette/schema/composer.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "nette/schema", - "description": "📐 Nette Schema: validating data structures against a given Schema.", - "keywords": ["nette", "config"], - "homepage": "https://nette.org", - "license": ["BSD-3-Clause", "GPL-2.0-only", "GPL-3.0-only"], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "require": { - "php": ">=7.1 <8.3", - "nette/utils": "^2.5.7 || ^3.1.5 || ^4.0" - }, - "require-dev": { - "nette/tester": "^2.3 || ^2.4", - "tracy/tracy": "^2.7", - "phpstan/phpstan-nette": "^1.0" - }, - "autoload": { - "classmap": ["src/"] - }, - "minimum-stability": "dev", - "scripts": { - "phpstan": "phpstan analyse", - "tester": "tester tests -s" - }, - "extra": { - "branch-alias": { - "dev-master": "1.2-dev" - } - } -} diff --git a/vendor/nette/schema/contributing.md b/vendor/nette/schema/contributing.md deleted file mode 100644 index 184152c0..00000000 --- a/vendor/nette/schema/contributing.md +++ /dev/null @@ -1,33 +0,0 @@ -How to contribute & use the issue tracker -========================================= - -Nette welcomes your contributions. There are several ways to help out: - -* Create an issue on GitHub, if you have found a bug -* Write test cases for open bug issues -* Write fixes for open bug/feature issues, preferably with test cases included -* Contribute to the [documentation](https://nette.org/en/writing) - -Issues ------- - -Please **do not use the issue tracker to ask questions**. We will be happy to help you -on [Nette forum](https://forum.nette.org) or chat with us on [Gitter](https://gitter.im/nette/nette). - -A good bug report shouldn't leave others needing to chase you up for more -information. Please try to be as detailed as possible in your report. - -**Feature requests** are welcome. But take a moment to find out whether your idea -fits with the scope and aims of the project. It's up to *you* to make a strong -case to convince the project's developers of the merits of this feature. - -Contributing ------------- - -If you'd like to contribute, please take a moment to read [the contributing guide](https://nette.org/en/contributing). - -The best way to propose a feature is to discuss your ideas on [Nette forum](https://forum.nette.org) before implementing them. - -Please do not fix whitespace, format code, or make a purely cosmetic patch. - -Thanks! :heart: diff --git a/vendor/nette/schema/license.md b/vendor/nette/schema/license.md deleted file mode 100644 index cf741bd0..00000000 --- a/vendor/nette/schema/license.md +++ /dev/null @@ -1,60 +0,0 @@ -Licenses -======== - -Good news! You may use Nette Framework under the terms of either -the New BSD License or the GNU General Public License (GPL) version 2 or 3. - -The BSD License is recommended for most projects. It is easy to understand and it -places almost no restrictions on what you can do with the framework. If the GPL -fits better to your project, you can use the framework under this license. - -You don't have to notify anyone which license you are using. You can freely -use Nette Framework in commercial projects as long as the copyright header -remains intact. - -Please be advised that the name "Nette Framework" is a protected trademark and its -usage has some limitations. So please do not use word "Nette" in the name of your -project or top-level domain, and choose a name that stands on its own merits. -If your stuff is good, it will not take long to establish a reputation for yourselves. - - -New BSD License ---------------- - -Copyright (c) 2004, 2014 David Grudl (https://davidgrudl.com) -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 "Nette Framework" nor the names of its 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. - - -GNU General Public License --------------------------- - -GPL licenses are very very long, so instead of including them here we offer -you URLs with full text: - -- [GPL version 2](http://www.gnu.org/licenses/gpl-2.0.html) -- [GPL version 3](http://www.gnu.org/licenses/gpl-3.0.html) diff --git a/vendor/nette/schema/readme.md b/vendor/nette/schema/readme.md deleted file mode 100644 index 20b5de2a..00000000 --- a/vendor/nette/schema/readme.md +++ /dev/null @@ -1,441 +0,0 @@ -Nette Schema -************ - -[![Downloads this Month](https://img.shields.io/packagist/dm/nette/schema.svg)](https://packagist.org/packages/nette/schema) -[![Tests](https://github.com/nette/schema/workflows/Tests/badge.svg?branch=master)](https://github.com/nette/schema/actions) -[![Coverage Status](https://coveralls.io/repos/github/nette/schema/badge.svg?branch=master)](https://coveralls.io/github/nette/schema?branch=master) -[![Latest Stable Version](https://poser.pugx.org/nette/schema/v/stable)](https://github.com/nette/schema/releases) -[![License](https://img.shields.io/badge/license-New%20BSD-blue.svg)](https://github.com/nette/schema/blob/master/license.md) - - -Introduction -============ - -A practical library for validation and normalization of data structures against a given schema with a smart & easy-to-understand API. - -Documentation can be found on the [website](https://doc.nette.org/schema). - -Installation: - -```shell -composer require nette/schema -``` - -It requires PHP version 7.1 and supports PHP up to 8.2. - - -[Support Me](https://github.com/sponsors/dg) --------------------------------------------- - -Do you like Nette Schema? Are you looking forward to the new features? - -[![Buy me a coffee](https://files.nette.org/icons/donation-3.svg)](https://github.com/sponsors/dg) - -Thank you! - - -Basic Usage ------------ - -In variable `$schema` we have a validation schema (what exactly this means and how to create it we will say later) and in variable `$data` we have a data structure that we want to validate and normalize. This can be, for example, data sent by the user through an API, configuration file, etc. - -The task is handled by the [Nette\Schema\Processor](https://api.nette.org/3.0/Nette/Schema/Processor.html) class, which processes the input and either returns normalized data or throws an [Nette\Schema\ValidationException](https://api.nette.org/3.0/Nette/Schema/ValidationException.html) exception on error. - -```php -$processor = new Nette\Schema\Processor; - -try { - $normalized = $processor->process($schema, $data); -} catch (Nette\Schema\ValidationException $e) { - echo 'Data is invalid: ' . $e->getMessage(); -} -``` - -Method `$e->getMessages()` returns array of all message strings and `$e->getMessageObjects()` return all messages as [Nette\Schema\Message](https://api.nette.org/3.1/Nette/Schema/Message.html) objects. - - -Defining Schema ---------------- - -And now let's create a schema. The class [Nette\Schema\Expect](https://api.nette.org/3.0/Nette/Schema/Expect.html) is used to define it, we actually define expectations of what the data should look like. Let's say that the input data must be a structure (e.g. an array) containing elements `processRefund` of type bool and `refundAmount` of type int. - -```php -use Nette\Schema\Expect; - -$schema = Expect::structure([ - 'processRefund' => Expect::bool(), - 'refundAmount' => Expect::int(), -]); -``` - -We believe that the schema definition looks clear, even if you see it for the very first time. - -Lets send the following data for validation: - -```php -$data = [ - 'processRefund' => true, - 'refundAmount' => 17, -]; - -$normalized = $processor->process($schema, $data); // OK, it passes -``` - -The output, i.e. the value `$normalized`, is the object `stdClass`. If we want the output to be an array, we add a cast to schema `Expect::structure([...])->castTo('array')`. - -All elements of the structure are optional and have a default value `null`. Example: - -```php -$data = [ - 'refundAmount' => 17, -]; - -$normalized = $processor->process($schema, $data); // OK, it passes -// $normalized = {'processRefund' => null, 'refundAmount' => 17} -``` - -The fact that the default value is `null` does not mean that it would be accepted in the input data `'processRefund' => null`. No, the input must be boolean, i.e. only `true` or `false`. We would have to explicitly allow `null` via `Expect::bool()->nullable()`. - -An item can be made mandatory using `Expect::bool()->required()`. We change the default value to `false` using `Expect::bool()->default(false)` or shortly using `Expect::bool(false)`. - -And what if we wanted to accept `1` and `0` besides booleans? Then we list the allowed values, which we will also normalize to boolean: - -```php -$schema = Expect::structure([ - 'processRefund' => Expect::anyOf(true, false, 1, 0)->castTo('bool'), - 'refundAmount' => Expect::int(), -]); - -$normalized = $processor->process($schema, $data); -is_bool($normalized->processRefund); // true -``` - -Now you know the basics of how the schema is defined and how the individual elements of the structure behave. We will now show what all the other elements can be used in defining a schema. - - - -Data Types: type() ------------------- - -All standard PHP data types can be listed in the schema: - -```php -Expect::string($default = null) -Expect::int($default = null) -Expect::float($default = null) -Expect::bool($default = null) -Expect::null() -Expect::array($default = []) -``` - -And then all types [supported by the Validators](https://doc.nette.org/validators#toc-validation-rules) via `Expect::type('scalar')` or abbreviated `Expect::scalar()`. Also class or interface names are accepted, e.g. `Expect::type('AddressEntity')`. - -You can also use union notation: - -```php -Expect::type('bool|string|array') -``` - -The default value is always `null` except for `array` and `list`, where it is an empty array. (A list is an array indexed in ascending order of numeric keys from zero, that is, a non-associative array). - - -Array of Values: arrayOf() listOf() ------------------------------------ - -The array is too general structure, it is more useful to specify exactly what elements it can contain. For example, an array whose elements can only be strings: - -```php -$schema = Expect::arrayOf('string'); - -$processor->process($schema, ['hello', 'world']); // OK -$processor->process($schema, ['a' => 'hello', 'b' => 'world']); // OK -$processor->process($schema, ['key' => 123]); // ERROR: 123 is not a string -``` - -The list is an indexed array: - -```php -$schema = Expect::listOf('string'); - -$processor->process($schema, ['a', 'b']); // OK -$processor->process($schema, ['a', 123]); // ERROR: 123 is not a string -$processor->process($schema, ['key' => 'a']); // ERROR: is not a list -$processor->process($schema, [1 => 'a', 0 => 'b']); // ERROR: is not a list -``` - -The parameter can also be a schema, so we can write: - -```php -Expect::arrayOf(Expect::bool()) -``` - -The default value is an empty array. If you specify default value, it will be merged with the passed data. This can be disabled using `mergeDefaults(false)`. - - -Enumeration: anyOf() --------------------- - -`anyOf()` is a set of values ​​or schemas that a value can be. Here's how to write an array of elements that can be either `'a'`, `true`, or `null`: - -```php -$schema = Expect::listOf( - Expect::anyOf('a', true, null) -); - -$processor->process($schema, ['a', true, null, 'a']); // OK -$processor->process($schema, ['a', false]); // ERROR: false does not belong there -``` - -The enumeration elements can also be schemas: - -```php -$schema = Expect::listOf( - Expect::anyOf(Expect::string(), true, null) -); - -$processor->process($schema, ['foo', true, null, 'bar']); // OK -$processor->process($schema, [123]); // ERROR -``` - -The default value is `null`. - - -Structures ----------- - -Structures are objects with defined keys. Each of these key => value pairs is referred to as a "property": - -Structures accept arrays and objects and return objects `stdClass` (unless you change it with `castTo('array')`, etc.). - -By default, all properties are optional and have a default value of `null`. You can define mandatory properties using `required()`: - -```php -$schema = Expect::structure([ - 'required' => Expect::string()->required(), - 'optional' => Expect::string(), // the default value is null -]); - -$processor->process($schema, ['optional' => '']); -// ERROR: item 'required' is missing - -$processor->process($schema, ['required' => 'foo']); -// OK, returns {'required' => 'foo', 'optional' => null} -``` - -Although `null` is the default value of the `optional` property, it is not allowed in the input data (the value must be a string). Properties accepting `null` are defined using `nullable()`: - -```php -$schema = Expect::structure([ - 'optional' => Expect::string(), - 'nullable' => Expect::string()->nullable(), -]); - -$processor->process($schema, ['optional' => null]); -// ERROR: 'optional' expects to be string, null given. - -$processor->process($schema, ['nullable' => null]); -// OK, returns {'optional' => null, 'nullable' => null} -``` - -By default, there can be no extra items in the input data: - -```php -$schema = Expect::structure([ - 'key' => Expect::string(), -]); - -$processor->process($schema, ['additional' => 1]); -// ERROR: Unexpected item 'additional' -``` - -Which we can change with `otherItems()`. As a parameter, we will specify the schema for each extra element: - -```php -$schema = Expect::structure([ - 'key' => Expect::string(), -])->otherItems(Expect::int()); - -$processor->process($schema, ['additional' => 1]); // OK -$processor->process($schema, ['additional' => true]); // ERROR -``` - -Deprecations ------------- - -You can deprecate property using the `deprecated([string $message])` method. Deprecation notices are returned by `$processor->getWarnings()` (since v1.1): - -```php -$schema = Expect::structure([ - 'old' => Expect::int()->deprecated('The item %path% is deprecated'), -]); - -$processor->process($schema, ['old' => 1]); // OK -$processor->getWarnings(); // ["The item 'old' is deprecated"] -``` - -Ranges: min() max() -------------------- - -Use `min()` and `max()` to limit the number of elements for arrays: - -```php -// array, at least 10 items, maximum 20 items -Expect::array()->min(10)->max(20); -``` - -For strings, limit their length: - -```php -// string, at least 10 characters long, maximum 20 characters -Expect::string()->min(10)->max(20); -``` - -For numbers, limit their value: - -```php -// integer, between 10 and 20 inclusive -Expect::int()->min(10)->max(20); -``` - -Of course, it is possible to mention only `min()`, or only `max()`: - -```php -// string, maximum 20 characters -Expect::string()->max(20); -``` - - -Regular Expressions: pattern() ------------------------------- - -Using `pattern()`, you can specify a regular expression which the **whole** input string must match (i.e. as if it were wrapped in characters `^` a `$`): - -```php -// just 9 digits -Expect::string()->pattern('\d{9}'); -``` - - -Custom Assertions: assert() ---------------------------- - -You can add any other restrictions using `assert(callable $fn)`. - -```php -$countIsEven = function ($v) { return count($v) % 2 === 0; }; - -$schema = Expect::arrayOf('string') - ->assert($countIsEven); // the count must be even - -$processor->process($schema, ['a', 'b']); // OK -$processor->process($schema, ['a', 'b', 'c']); // ERROR: 3 is not even -``` - -Or - -```php -Expect::string()->assert('is_file'); // the file must exist -``` - -You can add your own description for each assertions. It will be part of the error message. - -```php -$schema = Expect::arrayOf('string') - ->assert($countIsEven, 'Even items in array'); - -$processor->process($schema, ['a', 'b', 'c']); -// Failed assertion "Even items in array" for item with value array. -``` - -The method can be called repeatedly to add more assertions. - - -Mapping to Objects: from() --------------------------- - -You can generate structure schema from the class. Example: - -```php -class Config -{ - /** @var string */ - public $name; - /** @var string|null */ - public $password; - /** @var bool */ - public $admin = false; -} - -$schema = Expect::from(new Config); - -$data = [ - 'name' => 'jeff', -]; - -$normalized = $processor->process($schema, $data); -// $normalized instanceof Config -// $normalized = {'name' => 'jeff', 'password' => null, 'admin' => false} -``` - -If you are using PHP 7.4 or higher, you can use native types: - -```php -class Config -{ - public string $name; - public ?string $password; - public bool $admin = false; -} - -$schema = Expect::from(new Config); -``` - -Anonymous classes are also supported: - -```php -$schema = Expect::from(new class { - public string $name; - public ?string $password; - public bool $admin = false; -}); -``` - -Because the information obtained from the class definition may not be sufficient, you can add a custom schema for the elements with the second parameter: - -```php -$schema = Expect::from(new Config, [ - 'name' => Expect::string()->pattern('\w:.*'), -]); -``` - - -Casting: castTo() ------------------ - -Successfully validated data can be cast: - -```php -Expect::scalar()->castTo('string'); -``` - -In addition to native PHP types, you can also cast to classes: - -```php -Expect::scalar()->castTo('AddressEntity'); -``` - - -Normalization: before() ------------------------ - -Prior to the validation itself, the data can be normalized using the method `before()`. As an example, let's have an element that must be an array of strings (eg `['a', 'b', 'c']`), but receives input in the form of a string `a b c`: - -```php -$explode = function ($v) { return explode(' ', $v); }; - -$schema = Expect::arrayOf('string') - ->before($explode); - -$normalized = $processor->process($schema, 'a b c'); -// OK, returns ['a', 'b', 'c'] -``` diff --git a/vendor/nette/schema/src/Schema/Context.php b/vendor/nette/schema/src/Schema/Context.php deleted file mode 100644 index e486d2e5..00000000 --- a/vendor/nette/schema/src/Schema/Context.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette\Schema; - -use Nette; - - -final class Context -{ - use Nette\SmartObject; - - /** @var bool */ - public $skipDefaults = false; - - /** @var string[] */ - public $path = []; - - /** @var bool */ - public $isKey = false; - - /** @var Message[] */ - public $errors = []; - - /** @var Message[] */ - public $warnings = []; - - /** @var array[] */ - public $dynamics = []; - - - public function addError(string $message, string $code, array $variables = []): Message - { - $variables['isKey'] = $this->isKey; - return $this->errors[] = new Message($message, $code, $this->path, $variables); - } - - - public function addWarning(string $message, string $code, array $variables = []): Message - { - return $this->warnings[] = new Message($message, $code, $this->path, $variables); - } -} diff --git a/vendor/nette/schema/src/Schema/DynamicParameter.php b/vendor/nette/schema/src/Schema/DynamicParameter.php deleted file mode 100644 index 8dd61050..00000000 --- a/vendor/nette/schema/src/Schema/DynamicParameter.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette\Schema; - - -interface DynamicParameter -{ -} diff --git a/vendor/nette/schema/src/Schema/Elements/AnyOf.php b/vendor/nette/schema/src/Schema/Elements/AnyOf.php deleted file mode 100644 index 475b3e22..00000000 --- a/vendor/nette/schema/src/Schema/Elements/AnyOf.php +++ /dev/null @@ -1,141 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette\Schema\Elements; - -use Nette; -use Nette\Schema\Context; -use Nette\Schema\Helpers; -use Nette\Schema\Schema; - - -final class AnyOf implements Schema -{ - use Base; - use Nette\SmartObject; - - /** @var array */ - private $set; - - - /** - * @param mixed|Schema ...$set - */ - public function __construct(...$set) - { - if (!$set) { - throw new Nette\InvalidStateException('The enumeration must not be empty.'); - } - - $this->set = $set; - } - - - public function firstIsDefault(): self - { - $this->default = $this->set[0]; - return $this; - } - - - public function nullable(): self - { - $this->set[] = null; - return $this; - } - - - public function dynamic(): self - { - $this->set[] = new Type(Nette\Schema\DynamicParameter::class); - return $this; - } - - - /********************* processing ****************d*g**/ - - - public function normalize($value, Context $context) - { - return $this->doNormalize($value, $context); - } - - - public function merge($value, $base) - { - if (is_array($value) && isset($value[Helpers::PREVENT_MERGING])) { - unset($value[Helpers::PREVENT_MERGING]); - return $value; - } - - return Helpers::merge($value, $base); - } - - - public function complete($value, Context $context) - { - $expecteds = $innerErrors = []; - foreach ($this->set as $item) { - if ($item instanceof Schema) { - $dolly = new Context; - $dolly->path = $context->path; - $res = $item->complete($item->normalize($value, $dolly), $dolly); - if (!$dolly->errors) { - $context->warnings = array_merge($context->warnings, $dolly->warnings); - return $this->doFinalize($res, $context); - } - - foreach ($dolly->errors as $error) { - if ($error->path !== $context->path || empty($error->variables['expected'])) { - $innerErrors[] = $error; - } else { - $expecteds[] = $error->variables['expected']; - } - } - } else { - if ($item === $value) { - return $this->doFinalize($value, $context); - } - - $expecteds[] = Nette\Schema\Helpers::formatValue($item); - } - } - - if ($innerErrors) { - $context->errors = array_merge($context->errors, $innerErrors); - } else { - $context->addError( - 'The %label% %path% expects to be %expected%, %value% given.', - Nette\Schema\Message::TYPE_MISMATCH, - [ - 'value' => $value, - 'expected' => implode('|', array_unique($expecteds)), - ] - ); - } - } - - - public function completeDefault(Context $context) - { - if ($this->required) { - $context->addError( - 'The mandatory item %path% is missing.', - Nette\Schema\Message::MISSING_ITEM - ); - return null; - } - - if ($this->default instanceof Schema) { - return $this->default->completeDefault($context); - } - - return $this->default; - } -} diff --git a/vendor/nette/schema/src/Schema/Elements/Base.php b/vendor/nette/schema/src/Schema/Elements/Base.php deleted file mode 100644 index 60817612..00000000 --- a/vendor/nette/schema/src/Schema/Elements/Base.php +++ /dev/null @@ -1,200 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette\Schema\Elements; - -use Nette; -use Nette\Schema\Context; - - -/** - * @internal - */ -trait Base -{ - /** @var bool */ - private $required = false; - - /** @var mixed */ - private $default; - - /** @var callable|null */ - private $before; - - /** @var array[] */ - private $asserts = []; - - /** @var string|null */ - private $castTo; - - /** @var string|null */ - private $deprecated; - - - public function default($value): self - { - $this->default = $value; - return $this; - } - - - public function required(bool $state = true): self - { - $this->required = $state; - return $this; - } - - - public function before(callable $handler): self - { - $this->before = $handler; - return $this; - } - - - public function castTo(string $type): self - { - $this->castTo = $type; - return $this; - } - - - public function assert(callable $handler, ?string $description = null): self - { - $this->asserts[] = [$handler, $description]; - return $this; - } - - - /** Marks as deprecated */ - public function deprecated(string $message = 'The item %path% is deprecated.'): self - { - $this->deprecated = $message; - return $this; - } - - - public function completeDefault(Context $context) - { - if ($this->required) { - $context->addError( - 'The mandatory item %path% is missing.', - Nette\Schema\Message::MISSING_ITEM - ); - return null; - } - - return $this->default; - } - - - public function doNormalize($value, Context $context) - { - if ($this->before) { - $value = ($this->before)($value); - } - - return $value; - } - - - private function doDeprecation(Context $context): void - { - if ($this->deprecated !== null) { - $context->addWarning( - $this->deprecated, - Nette\Schema\Message::DEPRECATED - ); - } - } - - - private function doValidate($value, string $expected, Context $context): bool - { - if (!Nette\Utils\Validators::is($value, $expected)) { - $expected = str_replace(['|', ':'], [' or ', ' in range '], $expected); - $context->addError( - 'The %label% %path% expects to be %expected%, %value% given.', - Nette\Schema\Message::TYPE_MISMATCH, - ['value' => $value, 'expected' => $expected] - ); - return false; - } - - return true; - } - - - private function doValidateRange($value, array $range, Context $context, string $types = ''): bool - { - if (is_array($value) || is_string($value)) { - [$length, $label] = is_array($value) - ? [count($value), 'items'] - : (in_array('unicode', explode('|', $types), true) - ? [Nette\Utils\Strings::length($value), 'characters'] - : [strlen($value), 'bytes']); - - if (!self::isInRange($length, $range)) { - $context->addError( - "The length of %label% %path% expects to be in range %expected%, %length% $label given.", - Nette\Schema\Message::LENGTH_OUT_OF_RANGE, - ['value' => $value, 'length' => $length, 'expected' => implode('..', $range)] - ); - return false; - } - } elseif ((is_int($value) || is_float($value)) && !self::isInRange($value, $range)) { - $context->addError( - 'The %label% %path% expects to be in range %expected%, %value% given.', - Nette\Schema\Message::VALUE_OUT_OF_RANGE, - ['value' => $value, 'expected' => implode('..', $range)] - ); - return false; - } - - return true; - } - - - private function isInRange($value, array $range): bool - { - return ($range[0] === null || $value >= $range[0]) - && ($range[1] === null || $value <= $range[1]); - } - - - private function doFinalize($value, Context $context) - { - if ($this->castTo) { - if (Nette\Utils\Reflection::isBuiltinType($this->castTo)) { - settype($value, $this->castTo); - } else { - $object = new $this->castTo; - foreach ($value as $k => $v) { - $object->$k = $v; - } - - $value = $object; - } - } - - foreach ($this->asserts as $i => [$handler, $description]) { - if (!$handler($value)) { - $expected = $description ?: (is_string($handler) ? "$handler()" : "#$i"); - $context->addError( - 'Failed assertion ' . ($description ? "'%assertion%'" : '%assertion%') . ' for %label% %path% with value %value%.', - Nette\Schema\Message::FAILED_ASSERTION, - ['value' => $value, 'assertion' => $expected] - ); - return; - } - } - - return $value; - } -} diff --git a/vendor/nette/schema/src/Schema/Elements/Structure.php b/vendor/nette/schema/src/Schema/Elements/Structure.php deleted file mode 100644 index a622dc1b..00000000 --- a/vendor/nette/schema/src/Schema/Elements/Structure.php +++ /dev/null @@ -1,208 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette\Schema\Elements; - -use Nette; -use Nette\Schema\Context; -use Nette\Schema\Helpers; -use Nette\Schema\Schema; - - -final class Structure implements Schema -{ - use Base; - use Nette\SmartObject; - - /** @var Schema[] */ - private $items; - - /** @var Schema|null for array|list */ - private $otherItems; - - /** @var array{?int, ?int} */ - private $range = [null, null]; - - /** @var bool */ - private $skipDefaults = false; - - - /** - * @param Schema[] $items - */ - public function __construct(array $items) - { - (function (Schema ...$items) {})(...array_values($items)); - $this->items = $items; - $this->castTo = 'object'; - $this->required = true; - } - - - public function default($value): self - { - throw new Nette\InvalidStateException('Structure cannot have default value.'); - } - - - public function min(?int $min): self - { - $this->range[0] = $min; - return $this; - } - - - public function max(?int $max): self - { - $this->range[1] = $max; - return $this; - } - - - /** - * @param string|Schema $type - */ - public function otherItems($type = 'mixed'): self - { - $this->otherItems = $type instanceof Schema ? $type : new Type($type); - return $this; - } - - - public function skipDefaults(bool $state = true): self - { - $this->skipDefaults = $state; - return $this; - } - - - /********************* processing ****************d*g**/ - - - public function normalize($value, Context $context) - { - if ($prevent = (is_array($value) && isset($value[Helpers::PREVENT_MERGING]))) { - unset($value[Helpers::PREVENT_MERGING]); - } - - $value = $this->doNormalize($value, $context); - if (is_object($value)) { - $value = (array) $value; - } - - if (is_array($value)) { - foreach ($value as $key => $val) { - $itemSchema = $this->items[$key] ?? $this->otherItems; - if ($itemSchema) { - $context->path[] = $key; - $value[$key] = $itemSchema->normalize($val, $context); - array_pop($context->path); - } - } - - if ($prevent) { - $value[Helpers::PREVENT_MERGING] = true; - } - } - - return $value; - } - - - public function merge($value, $base) - { - if (is_array($value) && isset($value[Helpers::PREVENT_MERGING])) { - unset($value[Helpers::PREVENT_MERGING]); - $base = null; - } - - if (is_array($value) && is_array($base)) { - $index = 0; - foreach ($value as $key => $val) { - if ($key === $index) { - $base[] = $val; - $index++; - } elseif (array_key_exists($key, $base)) { - $itemSchema = $this->items[$key] ?? $this->otherItems; - $base[$key] = $itemSchema - ? $itemSchema->merge($val, $base[$key]) - : Helpers::merge($val, $base[$key]); - } else { - $base[$key] = $val; - } - } - - return $base; - } - - return Helpers::merge($value, $base); - } - - - public function complete($value, Context $context) - { - if ($value === null) { - $value = []; // is unable to distinguish null from array in NEON - } - - $this->doDeprecation($context); - - if (!$this->doValidate($value, 'array', $context) - || !$this->doValidateRange($value, $this->range, $context) - ) { - return; - } - - $errCount = count($context->errors); - $items = $this->items; - if ($extraKeys = array_keys(array_diff_key($value, $items))) { - if ($this->otherItems) { - $items += array_fill_keys($extraKeys, $this->otherItems); - } else { - $keys = array_map('strval', array_keys($items)); - foreach ($extraKeys as $key) { - $hint = Nette\Utils\ObjectHelpers::getSuggestion($keys, (string) $key); - $context->addError( - 'Unexpected item %path%' . ($hint ? ", did you mean '%hint%'?" : '.'), - Nette\Schema\Message::UNEXPECTED_ITEM, - ['hint' => $hint] - )->path[] = $key; - } - } - } - - foreach ($items as $itemKey => $itemVal) { - $context->path[] = $itemKey; - if (array_key_exists($itemKey, $value)) { - $value[$itemKey] = $itemVal->complete($value[$itemKey], $context); - } else { - $default = $itemVal->completeDefault($context); // checks required item - if (!$context->skipDefaults && !$this->skipDefaults) { - $value[$itemKey] = $default; - } - } - - array_pop($context->path); - } - - if (count($context->errors) > $errCount) { - return; - } - - return $this->doFinalize($value, $context); - } - - - public function completeDefault(Context $context) - { - return $this->required - ? $this->complete([], $context) - : null; - } -} diff --git a/vendor/nette/schema/src/Schema/Elements/Type.php b/vendor/nette/schema/src/Schema/Elements/Type.php deleted file mode 100644 index 5d8b2c09..00000000 --- a/vendor/nette/schema/src/Schema/Elements/Type.php +++ /dev/null @@ -1,230 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette\Schema\Elements; - -use Nette; -use Nette\Schema\Context; -use Nette\Schema\DynamicParameter; -use Nette\Schema\Helpers; -use Nette\Schema\Schema; - - -final class Type implements Schema -{ - use Base; - use Nette\SmartObject; - - /** @var string */ - private $type; - - /** @var Schema|null for arrays */ - private $itemsValue; - - /** @var Schema|null for arrays */ - private $itemsKey; - - /** @var array{?float, ?float} */ - private $range = [null, null]; - - /** @var string|null */ - private $pattern; - - /** @var bool */ - private $merge = true; - - - public function __construct(string $type) - { - $defaults = ['list' => [], 'array' => []]; - $this->type = $type; - $this->default = strpos($type, '[]') ? [] : $defaults[$type] ?? null; - } - - - public function nullable(): self - { - $this->type = 'null|' . $this->type; - return $this; - } - - - public function mergeDefaults(bool $state = true): self - { - $this->merge = $state; - return $this; - } - - - public function dynamic(): self - { - $this->type = DynamicParameter::class . '|' . $this->type; - return $this; - } - - - public function min(?float $min): self - { - $this->range[0] = $min; - return $this; - } - - - public function max(?float $max): self - { - $this->range[1] = $max; - return $this; - } - - - /** - * @param string|Schema $valueType - * @param string|Schema|null $keyType - * @internal use arrayOf() or listOf() - */ - public function items($valueType = 'mixed', $keyType = null): self - { - $this->itemsValue = $valueType instanceof Schema - ? $valueType - : new self($valueType); - $this->itemsKey = $keyType instanceof Schema || $keyType === null - ? $keyType - : new self($keyType); - return $this; - } - - - public function pattern(?string $pattern): self - { - $this->pattern = $pattern; - return $this; - } - - - /********************* processing ****************d*g**/ - - - public function normalize($value, Context $context) - { - if ($prevent = (is_array($value) && isset($value[Helpers::PREVENT_MERGING]))) { - unset($value[Helpers::PREVENT_MERGING]); - } - - $value = $this->doNormalize($value, $context); - if (is_array($value) && $this->itemsValue) { - $res = []; - foreach ($value as $key => $val) { - $context->path[] = $key; - $context->isKey = true; - $key = $this->itemsKey - ? $this->itemsKey->normalize($key, $context) - : $key; - $context->isKey = false; - $res[$key] = $this->itemsValue->normalize($val, $context); - array_pop($context->path); - } - - $value = $res; - } - - if ($prevent && is_array($value)) { - $value[Helpers::PREVENT_MERGING] = true; - } - - return $value; - } - - - public function merge($value, $base) - { - if (is_array($value) && isset($value[Helpers::PREVENT_MERGING])) { - unset($value[Helpers::PREVENT_MERGING]); - return $value; - } - - if (is_array($value) && is_array($base) && $this->itemsValue) { - $index = 0; - foreach ($value as $key => $val) { - if ($key === $index) { - $base[] = $val; - $index++; - } else { - $base[$key] = array_key_exists($key, $base) - ? $this->itemsValue->merge($val, $base[$key]) - : $val; - } - } - - return $base; - } - - return Helpers::merge($value, $base); - } - - - public function complete($value, Context $context) - { - $merge = $this->merge; - if (is_array($value) && isset($value[Helpers::PREVENT_MERGING])) { - unset($value[Helpers::PREVENT_MERGING]); - $merge = false; - } - - if ($value === null && is_array($this->default)) { - $value = []; // is unable to distinguish null from array in NEON - } - - $this->doDeprecation($context); - - if (!$this->doValidate($value, $this->type, $context) - || !$this->doValidateRange($value, $this->range, $context, $this->type) - ) { - return; - } - - if ($value !== null && $this->pattern !== null && !preg_match("\x01^(?:$this->pattern)$\x01Du", $value)) { - $context->addError( - "The %label% %path% expects to match pattern '%pattern%', %value% given.", - Nette\Schema\Message::PATTERN_MISMATCH, - ['value' => $value, 'pattern' => $this->pattern] - ); - return; - } - - if ($value instanceof DynamicParameter) { - $expected = $this->type . ($this->range === [null, null] ? '' : ':' . implode('..', $this->range)); - $context->dynamics[] = [$value, str_replace(DynamicParameter::class . '|', '', $expected)]; - } - - if ($this->itemsValue) { - $errCount = count($context->errors); - $res = []; - foreach ($value as $key => $val) { - $context->path[] = $key; - $context->isKey = true; - $key = $this->itemsKey ? $this->itemsKey->complete($key, $context) : $key; - $context->isKey = false; - $res[$key] = $this->itemsValue->complete($val, $context); - array_pop($context->path); - } - - if (count($context->errors) > $errCount) { - return null; - } - - $value = $res; - } - - if ($merge) { - $value = Helpers::merge($value, $this->default); - } - - return $this->doFinalize($value, $context); - } -} diff --git a/vendor/nette/schema/src/Schema/Expect.php b/vendor/nette/schema/src/Schema/Expect.php deleted file mode 100644 index f2999502..00000000 --- a/vendor/nette/schema/src/Schema/Expect.php +++ /dev/null @@ -1,119 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette\Schema; - -use Nette; -use Nette\Schema\Elements\AnyOf; -use Nette\Schema\Elements\Structure; -use Nette\Schema\Elements\Type; - - -/** - * Schema generator. - * - * @method static Type scalar($default = null) - * @method static Type string($default = null) - * @method static Type int($default = null) - * @method static Type float($default = null) - * @method static Type bool($default = null) - * @method static Type null() - * @method static Type array($default = []) - * @method static Type list($default = []) - * @method static Type mixed($default = null) - * @method static Type email($default = null) - * @method static Type unicode($default = null) - */ -final class Expect -{ - use Nette\SmartObject; - - public static function __callStatic(string $name, array $args): Type - { - $type = new Type($name); - if ($args) { - $type->default($args[0]); - } - - return $type; - } - - - public static function type(string $type): Type - { - return new Type($type); - } - - - /** - * @param mixed|Schema ...$set - */ - public static function anyOf(...$set): AnyOf - { - return new AnyOf(...$set); - } - - - /** - * @param Schema[] $items - */ - public static function structure(array $items): Structure - { - return new Structure($items); - } - - - /** - * @param object $object - */ - public static function from($object, array $items = []): Structure - { - $ro = new \ReflectionObject($object); - foreach ($ro->getProperties() as $prop) { - $type = Helpers::getPropertyType($prop) ?? 'mixed'; - $item = &$items[$prop->getName()]; - if (!$item) { - $item = new Type($type); - if (PHP_VERSION_ID >= 70400 && !$prop->isInitialized($object)) { - $item->required(); - } else { - $def = $prop->getValue($object); - if (is_object($def)) { - $item = static::from($def); - } elseif ($def === null && !Nette\Utils\Validators::is(null, $type)) { - $item->required(); - } else { - $item->default($def); - } - } - } - } - - return (new Structure($items))->castTo($ro->getName()); - } - - - /** - * @param string|Schema $valueType - * @param string|Schema|null $keyType - */ - public static function arrayOf($valueType, $keyType = null): Type - { - return (new Type('array'))->items($valueType, $keyType); - } - - - /** - * @param string|Schema $type - */ - public static function listOf($type): Type - { - return (new Type('list'))->items($type); - } -} diff --git a/vendor/nette/schema/src/Schema/Helpers.php b/vendor/nette/schema/src/Schema/Helpers.php deleted file mode 100644 index 0d2f12c4..00000000 --- a/vendor/nette/schema/src/Schema/Helpers.php +++ /dev/null @@ -1,110 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette\Schema; - -use Nette; -use Nette\Utils\Reflection; - - -/** - * @internal - */ -final class Helpers -{ - use Nette\StaticClass; - - public const PREVENT_MERGING = '_prevent_merging'; - - - /** - * Merges dataset. Left has higher priority than right one. - * @return array|string - */ - public static function merge($value, $base) - { - if (is_array($value) && isset($value[self::PREVENT_MERGING])) { - unset($value[self::PREVENT_MERGING]); - return $value; - } - - if (is_array($value) && is_array($base)) { - $index = 0; - foreach ($value as $key => $val) { - if ($key === $index) { - $base[] = $val; - $index++; - } else { - $base[$key] = static::merge($val, $base[$key] ?? null); - } - } - - return $base; - - } elseif ($value === null && is_array($base)) { - return $base; - - } else { - return $value; - } - } - - - public static function getPropertyType(\ReflectionProperty $prop): ?string - { - if (!class_exists(Nette\Utils\Type::class)) { - throw new Nette\NotSupportedException('Expect::from() requires nette/utils 3.x'); - } elseif ($type = Nette\Utils\Type::fromReflection($prop)) { - return (string) $type; - } elseif ($type = preg_replace('#\s.*#', '', (string) self::parseAnnotation($prop, 'var'))) { - $class = Reflection::getPropertyDeclaringClass($prop); - return preg_replace_callback('#[\w\\\\]+#', function ($m) use ($class) { - return Reflection::expandClassName($m[0], $class); - }, $type); - } - - return null; - } - - - /** - * Returns an annotation value. - * @param \ReflectionProperty $ref - */ - public static function parseAnnotation(\Reflector $ref, string $name): ?string - { - if (!Reflection::areCommentsAvailable()) { - throw new Nette\InvalidStateException('You have to enable phpDoc comments in opcode cache.'); - } - - $re = '#[\s*]@' . preg_quote($name, '#') . '(?=\s|$)(?:[ \t]+([^@\s]\S*))?#'; - if ($ref->getDocComment() && preg_match($re, trim($ref->getDocComment(), '/*'), $m)) { - return $m[1] ?? ''; - } - - return null; - } - - - /** - * @param mixed $value - */ - public static function formatValue($value): string - { - if (is_object($value)) { - return 'object ' . get_class($value); - } elseif (is_string($value)) { - return "'" . Nette\Utils\Strings::truncate($value, 15, '...') . "'"; - } elseif (is_scalar($value)) { - return var_export($value, true); - } else { - return strtolower(gettype($value)); - } - } -} diff --git a/vendor/nette/schema/src/Schema/Message.php b/vendor/nette/schema/src/Schema/Message.php deleted file mode 100644 index 49c32bd5..00000000 --- a/vendor/nette/schema/src/Schema/Message.php +++ /dev/null @@ -1,79 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette\Schema; - -use Nette; - - -final class Message -{ - use Nette\SmartObject; - - /** variables: {value: mixed, expected: string} */ - public const TYPE_MISMATCH = 'schema.typeMismatch'; - - /** variables: {value: mixed, expected: string} */ - public const VALUE_OUT_OF_RANGE = 'schema.valueOutOfRange'; - - /** variables: {value: mixed, length: int, expected: string} */ - public const LENGTH_OUT_OF_RANGE = 'schema.lengthOutOfRange'; - - /** variables: {value: string, pattern: string} */ - public const PATTERN_MISMATCH = 'schema.patternMismatch'; - - /** variables: {value: mixed, assertion: string} */ - public const FAILED_ASSERTION = 'schema.failedAssertion'; - - /** no variables */ - public const MISSING_ITEM = 'schema.missingItem'; - - /** variables: {hint: string} */ - public const UNEXPECTED_ITEM = 'schema.unexpectedItem'; - - /** no variables */ - public const DEPRECATED = 'schema.deprecated'; - - /** @var string */ - public $message; - - /** @var string */ - public $code; - - /** @var string[] */ - public $path; - - /** @var string[] */ - public $variables; - - - public function __construct(string $message, string $code, array $path, array $variables = []) - { - $this->message = $message; - $this->code = $code; - $this->path = $path; - $this->variables = $variables; - } - - - public function toString(): string - { - $vars = $this->variables; - $vars['label'] = empty($vars['isKey']) ? 'item' : 'key of item'; - $vars['path'] = $this->path - ? "'" . implode("\u{a0}›\u{a0}", $this->path) . "'" - : null; - $vars['value'] = Helpers::formatValue($vars['value'] ?? null); - - return preg_replace_callback('~( ?)%(\w+)%~', function ($m) use ($vars) { - [, $space, $key] = $m; - return $vars[$key] === null ? '' : $space . $vars[$key]; - }, $this->message); - } -} diff --git a/vendor/nette/schema/src/Schema/Processor.php b/vendor/nette/schema/src/Schema/Processor.php deleted file mode 100644 index a10a0ef6..00000000 --- a/vendor/nette/schema/src/Schema/Processor.php +++ /dev/null @@ -1,105 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette\Schema; - -use Nette; - - -/** - * Schema validator. - */ -final class Processor -{ - use Nette\SmartObject; - - /** @var array */ - public $onNewContext = []; - - /** @var Context|null */ - private $context; - - /** @var bool */ - private $skipDefaults; - - - public function skipDefaults(bool $value = true) - { - $this->skipDefaults = $value; - } - - - /** - * Normalizes and validates data. Result is a clean completed data. - * @return mixed - * @throws ValidationException - */ - public function process(Schema $schema, $data) - { - $this->createContext(); - $data = $schema->normalize($data, $this->context); - $this->throwsErrors(); - $data = $schema->complete($data, $this->context); - $this->throwsErrors(); - return $data; - } - - - /** - * Normalizes and validates and merges multiple data. Result is a clean completed data. - * @return mixed - * @throws ValidationException - */ - public function processMultiple(Schema $schema, array $dataset) - { - $this->createContext(); - $flatten = null; - $first = true; - foreach ($dataset as $data) { - $data = $schema->normalize($data, $this->context); - $this->throwsErrors(); - $flatten = $first ? $data : $schema->merge($data, $flatten); - $first = false; - } - - $data = $schema->complete($flatten, $this->context); - $this->throwsErrors(); - return $data; - } - - - /** - * @return string[] - */ - public function getWarnings(): array - { - $res = []; - foreach ($this->context->warnings as $message) { - $res[] = $message->toString(); - } - - return $res; - } - - - private function throwsErrors(): void - { - if ($this->context->errors) { - throw new ValidationException(null, $this->context->errors); - } - } - - - private function createContext() - { - $this->context = new Context; - $this->context->skipDefaults = $this->skipDefaults; - $this->onNewContext($this->context); - } -} diff --git a/vendor/nette/schema/src/Schema/Schema.php b/vendor/nette/schema/src/Schema/Schema.php deleted file mode 100644 index bbd8bd09..00000000 --- a/vendor/nette/schema/src/Schema/Schema.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette\Schema; - - -interface Schema -{ - /** - * Normalization. - * @return mixed - */ - function normalize($value, Context $context); - - /** - * Merging. - * @return mixed - */ - function merge($value, $base); - - /** - * Validation and finalization. - * @return mixed - */ - function complete($value, Context $context); - - /** - * @return mixed - */ - function completeDefault(Context $context); -} diff --git a/vendor/nette/schema/src/Schema/ValidationException.php b/vendor/nette/schema/src/Schema/ValidationException.php deleted file mode 100644 index 04c581f9..00000000 --- a/vendor/nette/schema/src/Schema/ValidationException.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette\Schema; - -use Nette; - - -/** - * Validation error. - */ -class ValidationException extends Nette\InvalidStateException -{ - /** @var Message[] */ - private $messages; - - - /** - * @param Message[] $messages - */ - public function __construct(?string $message, array $messages = []) - { - parent::__construct($message ?: $messages[0]->toString()); - $this->messages = $messages; - } - - - /** - * @return string[] - */ - public function getMessages(): array - { - $res = []; - foreach ($this->messages as $message) { - $res[] = $message->toString(); - } - - return $res; - } - - - /** - * @return Message[] - */ - public function getMessageObjects(): array - { - return $this->messages; - } -} diff --git a/vendor/nette/utils/.phpstorm.meta.php b/vendor/nette/utils/.phpstorm.meta.php deleted file mode 100644 index 7810b4cc..00000000 --- a/vendor/nette/utils/.phpstorm.meta.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace PHPSTORM_META; - -override(\Nette\Utils\Arrays::get(0), elementType(0)); -override(\Nette\Utils\Arrays::getRef(0), elementType(0)); -override(\Nette\Utils\Arrays::grep(0), type(0)); -override(\Nette\Utils\Arrays::toObject(0), type(1)); - -expectedArguments(\Nette\Utils\Arrays::grep(), 2, PREG_GREP_INVERT); -expectedArguments(\Nette\Utils\Image::resize(), 2, \Nette\Utils\Image::SHRINK_ONLY, \Nette\Utils\Image::STRETCH, \Nette\Utils\Image::FIT, \Nette\Utils\Image::FILL, \Nette\Utils\Image::EXACT); -expectedArguments(\Nette\Utils\Image::calculateSize(), 4, \Nette\Utils\Image::SHRINK_ONLY, \Nette\Utils\Image::STRETCH, \Nette\Utils\Image::FIT, \Nette\Utils\Image::FILL, \Nette\Utils\Image::EXACT); -expectedArguments(\Nette\Utils\Json::encode(), 1, \Nette\Utils\Json::PRETTY); -expectedArguments(\Nette\Utils\Json::decode(), 1, \Nette\Utils\Json::FORCE_ARRAY); -expectedArguments(\Nette\Utils\Strings::split(), 2, \PREG_SPLIT_NO_EMPTY | \PREG_OFFSET_CAPTURE); -expectedArguments(\Nette\Utils\Strings::match(), 2, \PREG_OFFSET_CAPTURE | \PREG_UNMATCHED_AS_NULL); -expectedArguments(\Nette\Utils\Strings::matchAll(), 2, \PREG_OFFSET_CAPTURE | \PREG_UNMATCHED_AS_NULL | \PREG_PATTERN_ORDER); diff --git a/vendor/nette/utils/composer.json b/vendor/nette/utils/composer.json deleted file mode 100644 index 19840793..00000000 --- a/vendor/nette/utils/composer.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "nette/utils", - "description": "🛠 Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.", - "keywords": ["nette", "images", "json", "password", "validation", "utility", "string", "array", "core", "slugify", "utf-8", "unicode", "paginator", "datetime"], - "homepage": "https://nette.org", - "license": ["BSD-3-Clause", "GPL-2.0-only", "GPL-3.0-only"], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "require": { - "php": ">=7.2 <8.3" - }, - "require-dev": { - "nette/tester": "~2.0", - "tracy/tracy": "^2.3", - "phpstan/phpstan": "^1.0" - }, - "conflict": { - "nette/di": "<3.0.6" - }, - "suggest": { - "ext-iconv": "to use Strings::webalize(), toAscii(), chr() and reverse()", - "ext-json": "to use Nette\\Utils\\Json", - "ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()", - "ext-mbstring": "to use Strings::lower() etc...", - "ext-xml": "to use Strings::length() etc. when mbstring is not available", - "ext-gd": "to use Image", - "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()" - }, - "autoload": { - "classmap": ["src/"] - }, - "minimum-stability": "dev", - "scripts": { - "phpstan": "phpstan analyse", - "tester": "tester tests -s" - }, - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - } -} diff --git a/vendor/nette/utils/contributing.md b/vendor/nette/utils/contributing.md deleted file mode 100644 index 184152c0..00000000 --- a/vendor/nette/utils/contributing.md +++ /dev/null @@ -1,33 +0,0 @@ -How to contribute & use the issue tracker -========================================= - -Nette welcomes your contributions. There are several ways to help out: - -* Create an issue on GitHub, if you have found a bug -* Write test cases for open bug issues -* Write fixes for open bug/feature issues, preferably with test cases included -* Contribute to the [documentation](https://nette.org/en/writing) - -Issues ------- - -Please **do not use the issue tracker to ask questions**. We will be happy to help you -on [Nette forum](https://forum.nette.org) or chat with us on [Gitter](https://gitter.im/nette/nette). - -A good bug report shouldn't leave others needing to chase you up for more -information. Please try to be as detailed as possible in your report. - -**Feature requests** are welcome. But take a moment to find out whether your idea -fits with the scope and aims of the project. It's up to *you* to make a strong -case to convince the project's developers of the merits of this feature. - -Contributing ------------- - -If you'd like to contribute, please take a moment to read [the contributing guide](https://nette.org/en/contributing). - -The best way to propose a feature is to discuss your ideas on [Nette forum](https://forum.nette.org) before implementing them. - -Please do not fix whitespace, format code, or make a purely cosmetic patch. - -Thanks! :heart: diff --git a/vendor/nette/utils/license.md b/vendor/nette/utils/license.md deleted file mode 100644 index cf741bd0..00000000 --- a/vendor/nette/utils/license.md +++ /dev/null @@ -1,60 +0,0 @@ -Licenses -======== - -Good news! You may use Nette Framework under the terms of either -the New BSD License or the GNU General Public License (GPL) version 2 or 3. - -The BSD License is recommended for most projects. It is easy to understand and it -places almost no restrictions on what you can do with the framework. If the GPL -fits better to your project, you can use the framework under this license. - -You don't have to notify anyone which license you are using. You can freely -use Nette Framework in commercial projects as long as the copyright header -remains intact. - -Please be advised that the name "Nette Framework" is a protected trademark and its -usage has some limitations. So please do not use word "Nette" in the name of your -project or top-level domain, and choose a name that stands on its own merits. -If your stuff is good, it will not take long to establish a reputation for yourselves. - - -New BSD License ---------------- - -Copyright (c) 2004, 2014 David Grudl (https://davidgrudl.com) -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 "Nette Framework" nor the names of its 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. - - -GNU General Public License --------------------------- - -GPL licenses are very very long, so instead of including them here we offer -you URLs with full text: - -- [GPL version 2](http://www.gnu.org/licenses/gpl-2.0.html) -- [GPL version 3](http://www.gnu.org/licenses/gpl-3.0.html) diff --git a/vendor/nette/utils/ncs.php b/vendor/nette/utils/ncs.php deleted file mode 100644 index 8f86bacb..00000000 --- a/vendor/nette/utils/ncs.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * Rules for Nette Coding Standard - * https://github.com/nette/coding-standard - */ - -declare(strict_types=1); - -return [ - // use function in Arrays.php, Callback.php, Html.php, Strings.php - 'single_import_per_statement' => false, - 'ordered_imports' => false, -]; diff --git a/vendor/nette/utils/ncs.xml b/vendor/nette/utils/ncs.xml deleted file mode 100644 index 6f360cb0..00000000 --- a/vendor/nette/utils/ncs.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0"?> -<ruleset name="Custom" namespace="Nette"> - <rule ref="$presets/php72.xml"/> - - <!-- bug in SlevomatCodingStandard --> - <rule ref="SlevomatCodingStandard.Operators.RequireCombinedAssignmentOperator"> - <severity>0</severity> - </rule> - - <!-- bug in FunctionSpacingSniff --> - <exclude-pattern>./tests/Utils/Reflection.getDeclaringMethod.alias.phpt</exclude-pattern> - <exclude-pattern>./tests/Utils/Reflection.getDeclaringMethod.insteadof.phpt</exclude-pattern> - - <!-- use function in Arrays.php, Callback.php, Html.php, Strings.php --> - <rule ref="SlevomatCodingStandard.Namespaces.MultipleUsesPerLine.MultipleUsesPerLine"> - <severity>0</severity> - </rule> -</ruleset> diff --git a/vendor/nette/utils/readme.md b/vendor/nette/utils/readme.md deleted file mode 100644 index 2064aa8a..00000000 --- a/vendor/nette/utils/readme.md +++ /dev/null @@ -1,54 +0,0 @@ -Nette Utility Classes -===================== - -[![Downloads this Month](https://img.shields.io/packagist/dm/nette/utils.svg)](https://packagist.org/packages/nette/utils) -[![Tests](https://github.com/nette/utils/workflows/Tests/badge.svg?branch=master)](https://github.com/nette/utils/actions) -[![Coverage Status](https://coveralls.io/repos/github/nette/utils/badge.svg?branch=master)](https://coveralls.io/github/nette/utils?branch=master) -[![Latest Stable Version](https://poser.pugx.org/nette/utils/v/stable)](https://github.com/nette/utils/releases) -[![License](https://img.shields.io/badge/license-New%20BSD-blue.svg)](https://github.com/nette/utils/blob/master/license.md) - - -Introduction ------------- - -In package nette/utils you will find a set of [useful classes](https://doc.nette.org/utils) for everyday use: - -- [Arrays](https://doc.nette.org/arrays) - manipulate arrays -- [Callback](https://doc.nette.org/callback) - PHP callbacks -- [Date and Time](https://doc.nette.org/datetime) - modify times and dates -- [Filesystem](https://doc.nette.org/filesystem) - copying, renaming, … -- [Helper Functions](https://doc.nette.org/helpers) -- [HTML elements](https://doc.nette.org/html-elements) - generate HTML -- [Images](https://doc.nette.org/images) - crop, resize, rotate images -- [JSON](https://doc.nette.org/json) - encoding and decoding -- [Generating Random Strings](https://doc.nette.org/random) -- [Paginator](https://doc.nette.org/paginator) - pagination math -- [PHP Reflection](https://doc.nette.org/reflection) -- [Strings](https://doc.nette.org/strings) - useful text functions -- [SmartObject](https://doc.nette.org/smartobject) - PHP object enhancements -- [Validation](https://doc.nette.org/validators) - validate inputs -- [Type](https://doc.nette.org/type) - PHP data type - - -Installation ------------- - -The recommended way to install is via Composer: - -``` -composer require nette/utils -``` - -- Nette Utils 3.2 is compatible with PHP 7.2 to 8.2 -- Nette Utils 3.1 is compatible with PHP 7.1 to 8.0 -- Nette Utils 3.0 is compatible with PHP 7.1 to 8.0 -- Nette Utils 2.5 is compatible with PHP 5.6 to 8.0 - -[Support Me](https://github.com/sponsors/dg) --------------------------------------------- - -Do you like Nette Utils? Are you looking forward to the new features? - -[![Buy me a coffee](https://files.nette.org/icons/donation-3.svg)](https://github.com/sponsors/dg) - -Thank you! diff --git a/vendor/nette/utils/src/HtmlStringable.php b/vendor/nette/utils/src/HtmlStringable.php deleted file mode 100644 index d749d4ee..00000000 --- a/vendor/nette/utils/src/HtmlStringable.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette; - - -interface HtmlStringable -{ - /** - * Returns string in HTML format - */ - function __toString(): string; -} - - -interface_exists(Utils\IHtmlString::class); diff --git a/vendor/nette/utils/src/Iterators/CachingIterator.php b/vendor/nette/utils/src/Iterators/CachingIterator.php deleted file mode 100644 index b07bbbfa..00000000 --- a/vendor/nette/utils/src/Iterators/CachingIterator.php +++ /dev/null @@ -1,167 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette\Iterators; - -use Nette; - - -/** - * Smarter caching iterator. - * - * @property-read bool $first - * @property-read bool $last - * @property-read bool $empty - * @property-read bool $odd - * @property-read bool $even - * @property-read int $counter - * @property-read mixed $nextKey - * @property-read mixed $nextValue - */ -class CachingIterator extends \CachingIterator implements \Countable -{ - use Nette\SmartObject; - - /** @var int */ - private $counter = 0; - - - public function __construct($iterator) - { - if (is_array($iterator) || $iterator instanceof \stdClass) { - $iterator = new \ArrayIterator($iterator); - - } elseif ($iterator instanceof \IteratorAggregate) { - do { - $iterator = $iterator->getIterator(); - } while ($iterator instanceof \IteratorAggregate); - - assert($iterator instanceof \Iterator); - - } elseif ($iterator instanceof \Iterator) { - } elseif ($iterator instanceof \Traversable) { - $iterator = new \IteratorIterator($iterator); - } else { - throw new Nette\InvalidArgumentException(sprintf('Invalid argument passed to %s; array or Traversable expected, %s given.', self::class, is_object($iterator) ? get_class($iterator) : gettype($iterator))); - } - - parent::__construct($iterator, 0); - } - - - /** - * Is the current element the first one? - */ - public function isFirst(?int $gridWidth = null): bool - { - return $this->counter === 1 || ($gridWidth && $this->counter !== 0 && (($this->counter - 1) % $gridWidth) === 0); - } - - - /** - * Is the current element the last one? - */ - public function isLast(?int $gridWidth = null): bool - { - return !$this->hasNext() || ($gridWidth && ($this->counter % $gridWidth) === 0); - } - - - /** - * Is the iterator empty? - */ - public function isEmpty(): bool - { - return $this->counter === 0; - } - - - /** - * Is the counter odd? - */ - public function isOdd(): bool - { - return $this->counter % 2 === 1; - } - - - /** - * Is the counter even? - */ - public function isEven(): bool - { - return $this->counter % 2 === 0; - } - - - /** - * Returns the counter. - */ - public function getCounter(): int - { - return $this->counter; - } - - - /** - * Returns the count of elements. - */ - public function count(): int - { - $inner = $this->getInnerIterator(); - if ($inner instanceof \Countable) { - return $inner->count(); - - } else { - throw new Nette\NotSupportedException('Iterator is not countable.'); - } - } - - - /** - * Forwards to the next element. - */ - public function next(): void - { - parent::next(); - if (parent::valid()) { - $this->counter++; - } - } - - - /** - * Rewinds the Iterator. - */ - public function rewind(): void - { - parent::rewind(); - $this->counter = parent::valid() ? 1 : 0; - } - - - /** - * Returns the next key. - * @return mixed - */ - public function getNextKey() - { - return $this->getInnerIterator()->key(); - } - - - /** - * Returns the next element. - * @return mixed - */ - public function getNextValue() - { - return $this->getInnerIterator()->current(); - } -} diff --git a/vendor/nette/utils/src/Iterators/Mapper.php b/vendor/nette/utils/src/Iterators/Mapper.php deleted file mode 100644 index 1a8647c6..00000000 --- a/vendor/nette/utils/src/Iterators/Mapper.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette\Iterators; - - - -/** - * Applies the callback to the elements of the inner iterator. - */ -class Mapper extends \IteratorIterator -{ - /** @var callable */ - private $callback; - - - public function __construct(\Traversable $iterator, callable $callback) - { - parent::__construct($iterator); - $this->callback = $callback; - } - - - #[\ReturnTypeWillChange] - public function current() - { - return ($this->callback)(parent::current(), parent::key()); - } -} diff --git a/vendor/nette/utils/src/SmartObject.php b/vendor/nette/utils/src/SmartObject.php deleted file mode 100644 index 7d4f3036..00000000 --- a/vendor/nette/utils/src/SmartObject.php +++ /dev/null @@ -1,140 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette; - -use Nette\Utils\ObjectHelpers; - - -/** - * Strict class for better experience. - * - 'did you mean' hints - * - access to undeclared members throws exceptions - * - support for @property annotations - * - support for calling event handlers stored in $onEvent via onEvent() - */ -trait SmartObject -{ - /** - * @throws MemberAccessException - */ - public function __call(string $name, array $args) - { - $class = static::class; - - if (ObjectHelpers::hasProperty($class, $name) === 'event') { // calling event handlers - $handlers = $this->$name ?? null; - if (is_iterable($handlers)) { - foreach ($handlers as $handler) { - $handler(...$args); - } - } elseif ($handlers !== null) { - throw new UnexpectedValueException("Property $class::$$name must be iterable or null, " . gettype($handlers) . ' given.'); - } - } else { - ObjectHelpers::strictCall($class, $name); - } - } - - - /** - * @throws MemberAccessException - */ - public static function __callStatic(string $name, array $args) - { - ObjectHelpers::strictStaticCall(static::class, $name); - } - - - /** - * @return mixed - * @throws MemberAccessException if the property is not defined. - */ - public function &__get(string $name) - { - $class = static::class; - - if ($prop = ObjectHelpers::getMagicProperties($class)[$name] ?? null) { // property getter - if (!($prop & 0b0001)) { - throw new MemberAccessException("Cannot read a write-only property $class::\$$name."); - } - - $m = ($prop & 0b0010 ? 'get' : 'is') . ucfirst($name); - if ($prop & 0b10000) { - $trace = debug_backtrace(0, 1)[0]; // suppose this method is called from __call() - $loc = isset($trace['file'], $trace['line']) - ? " in $trace[file] on line $trace[line]" - : ''; - trigger_error("Property $class::\$$name is deprecated, use $class::$m() method$loc.", E_USER_DEPRECATED); - } - - if ($prop & 0b0100) { // return by reference - return $this->$m(); - } else { - $val = $this->$m(); - return $val; - } - } else { - ObjectHelpers::strictGet($class, $name); - } - } - - - /** - * @param mixed $value - * @return void - * @throws MemberAccessException if the property is not defined or is read-only - */ - public function __set(string $name, $value) - { - $class = static::class; - - if (ObjectHelpers::hasProperty($class, $name)) { // unsetted property - $this->$name = $value; - - } elseif ($prop = ObjectHelpers::getMagicProperties($class)[$name] ?? null) { // property setter - if (!($prop & 0b1000)) { - throw new MemberAccessException("Cannot write to a read-only property $class::\$$name."); - } - - $m = 'set' . ucfirst($name); - if ($prop & 0b10000) { - $trace = debug_backtrace(0, 1)[0]; // suppose this method is called from __call() - $loc = isset($trace['file'], $trace['line']) - ? " in $trace[file] on line $trace[line]" - : ''; - trigger_error("Property $class::\$$name is deprecated, use $class::$m() method$loc.", E_USER_DEPRECATED); - } - - $this->$m($value); - - } else { - ObjectHelpers::strictSet($class, $name); - } - } - - - /** - * @return void - * @throws MemberAccessException - */ - public function __unset(string $name) - { - $class = static::class; - if (!ObjectHelpers::hasProperty($class, $name)) { - throw new MemberAccessException("Cannot unset the property $class::\$$name."); - } - } - - - public function __isset(string $name): bool - { - return isset(ObjectHelpers::getMagicProperties(static::class)[$name]); - } -} diff --git a/vendor/nette/utils/src/StaticClass.php b/vendor/nette/utils/src/StaticClass.php deleted file mode 100644 index 8fed0ef3..00000000 --- a/vendor/nette/utils/src/StaticClass.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette; - - -/** - * Static class. - */ -trait StaticClass -{ - /** - * @return never - * @throws \Error - */ - final public function __construct() - { - throw new \Error('Class ' . static::class . ' is static and cannot be instantiated.'); - } - - - /** - * Call to undefined static method. - * @return void - * @throws MemberAccessException - */ - public static function __callStatic(string $name, array $args) - { - Utils\ObjectHelpers::strictStaticCall(static::class, $name); - } -} diff --git a/vendor/nette/utils/src/Translator.php b/vendor/nette/utils/src/Translator.php deleted file mode 100644 index 0f343a27..00000000 --- a/vendor/nette/utils/src/Translator.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette\Localization; - - -/** - * Translator adapter. - */ -interface Translator -{ - /** - * Translates the given string. - * @param mixed $message - * @param mixed ...$parameters - */ - function translate($message, ...$parameters): string; -} - - -interface_exists(ITranslator::class); diff --git a/vendor/nette/utils/src/Utils/ArrayHash.php b/vendor/nette/utils/src/Utils/ArrayHash.php deleted file mode 100644 index 46cad2ba..00000000 --- a/vendor/nette/utils/src/Utils/ArrayHash.php +++ /dev/null @@ -1,103 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette\Utils; - -use Nette; - - -/** - * Provides objects to work as array. - * @template T - */ -class ArrayHash extends \stdClass implements \ArrayAccess, \Countable, \IteratorAggregate -{ - /** - * Transforms array to ArrayHash. - * @param array<T> $array - * @return static - */ - public static function from(array $array, bool $recursive = true) - { - $obj = new static; - foreach ($array as $key => $value) { - $obj->$key = $recursive && is_array($value) - ? static::from($value, true) - : $value; - } - - return $obj; - } - - - /** - * Returns an iterator over all items. - * @return \RecursiveArrayIterator<array-key, T> - */ - public function getIterator(): \RecursiveArrayIterator - { - return new \RecursiveArrayIterator((array) $this); - } - - - /** - * Returns items count. - */ - public function count(): int - { - return count((array) $this); - } - - - /** - * Replaces or appends a item. - * @param string|int $key - * @param T $value - */ - public function offsetSet($key, $value): void - { - if (!is_scalar($key)) { // prevents null - throw new Nette\InvalidArgumentException(sprintf('Key must be either a string or an integer, %s given.', gettype($key))); - } - - $this->$key = $value; - } - - - /** - * Returns a item. - * @param string|int $key - * @return T - */ - #[\ReturnTypeWillChange] - public function offsetGet($key) - { - return $this->$key; - } - - - /** - * Determines whether a item exists. - * @param string|int $key - */ - public function offsetExists($key): bool - { - return isset($this->$key); - } - - - /** - * Removes the element from this list. - * @param string|int $key - */ - public function offsetUnset($key): void - { - unset($this->$key); - } -} diff --git a/vendor/nette/utils/src/Utils/ArrayList.php b/vendor/nette/utils/src/Utils/ArrayList.php deleted file mode 100644 index de922092..00000000 --- a/vendor/nette/utils/src/Utils/ArrayList.php +++ /dev/null @@ -1,135 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette\Utils; - -use Nette; - - -/** - * Provides the base class for a generic list (items can be accessed by index). - * @template T - */ -class ArrayList implements \ArrayAccess, \Countable, \IteratorAggregate -{ - use Nette\SmartObject; - - /** @var mixed[] */ - private $list = []; - - - /** - * Transforms array to ArrayList. - * @param array<T> $array - * @return static - */ - public static function from(array $array) - { - if (!Arrays::isList($array)) { - throw new Nette\InvalidArgumentException('Array is not valid list.'); - } - - $obj = new static; - $obj->list = $array; - return $obj; - } - - - /** - * Returns an iterator over all items. - * @return \ArrayIterator<int, T> - */ - public function getIterator(): \ArrayIterator - { - return new \ArrayIterator($this->list); - } - - - /** - * Returns items count. - */ - public function count(): int - { - return count($this->list); - } - - - /** - * Replaces or appends a item. - * @param int|null $index - * @param T $value - * @throws Nette\OutOfRangeException - */ - public function offsetSet($index, $value): void - { - if ($index === null) { - $this->list[] = $value; - - } elseif (!is_int($index) || $index < 0 || $index >= count($this->list)) { - throw new Nette\OutOfRangeException('Offset invalid or out of range'); - - } else { - $this->list[$index] = $value; - } - } - - - /** - * Returns a item. - * @param int $index - * @return T - * @throws Nette\OutOfRangeException - */ - #[\ReturnTypeWillChange] - public function offsetGet($index) - { - if (!is_int($index) || $index < 0 || $index >= count($this->list)) { - throw new Nette\OutOfRangeException('Offset invalid or out of range'); - } - - return $this->list[$index]; - } - - - /** - * Determines whether a item exists. - * @param int $index - */ - public function offsetExists($index): bool - { - return is_int($index) && $index >= 0 && $index < count($this->list); - } - - - /** - * Removes the element at the specified position in this list. - * @param int $index - * @throws Nette\OutOfRangeException - */ - public function offsetUnset($index): void - { - if (!is_int($index) || $index < 0 || $index >= count($this->list)) { - throw new Nette\OutOfRangeException('Offset invalid or out of range'); - } - - array_splice($this->list, $index, 1); - } - - - /** - * Prepends a item. - * @param T $value - */ - public function prepend($value): void - { - $first = array_slice($this->list, 0, 1); - $this->offsetSet(0, $value); - array_splice($this->list, 1, 0, $first); - } -} diff --git a/vendor/nette/utils/src/Utils/Arrays.php b/vendor/nette/utils/src/Utils/Arrays.php deleted file mode 100644 index 2aea25fa..00000000 --- a/vendor/nette/utils/src/Utils/Arrays.php +++ /dev/null @@ -1,454 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette\Utils; - -use Nette; -use function is_array, is_int, is_object, count; - - -/** - * Array tools library. - */ -class Arrays -{ - use Nette\StaticClass; - - /** - * Returns item from array. If it does not exist, it throws an exception, unless a default value is set. - * @template T - * @param array<T> $array - * @param array-key|array-key[] $key - * @param ?T $default - * @return ?T - * @throws Nette\InvalidArgumentException if item does not exist and default value is not provided - */ - public static function get(array $array, $key, $default = null) - { - foreach (is_array($key) ? $key : [$key] as $k) { - if (is_array($array) && array_key_exists($k, $array)) { - $array = $array[$k]; - } else { - if (func_num_args() < 3) { - throw new Nette\InvalidArgumentException("Missing item '$k'."); - } - - return $default; - } - } - - return $array; - } - - - /** - * Returns reference to array item. If the index does not exist, new one is created with value null. - * @template T - * @param array<T> $array - * @param array-key|array-key[] $key - * @return ?T - * @throws Nette\InvalidArgumentException if traversed item is not an array - */ - public static function &getRef(array &$array, $key) - { - foreach (is_array($key) ? $key : [$key] as $k) { - if (is_array($array) || $array === null) { - $array = &$array[$k]; - } else { - throw new Nette\InvalidArgumentException('Traversed item is not an array.'); - } - } - - return $array; - } - - - /** - * Recursively merges two fields. It is useful, for example, for merging tree structures. It behaves as - * the + operator for array, ie. it adds a key/value pair from the second array to the first one and retains - * the value from the first array in the case of a key collision. - * @template T1 - * @template T2 - * @param array<T1> $array1 - * @param array<T2> $array2 - * @return array<T1|T2> - */ - public static function mergeTree(array $array1, array $array2): array - { - $res = $array1 + $array2; - foreach (array_intersect_key($array1, $array2) as $k => $v) { - if (is_array($v) && is_array($array2[$k])) { - $res[$k] = self::mergeTree($v, $array2[$k]); - } - } - - return $res; - } - - - /** - * Returns zero-indexed position of given array key. Returns null if key is not found. - * @param array-key $key - * @return int|null offset if it is found, null otherwise - */ - public static function getKeyOffset(array $array, $key): ?int - { - return Helpers::falseToNull(array_search(self::toKey($key), array_keys($array), true)); - } - - - /** - * @deprecated use getKeyOffset() - */ - public static function searchKey(array $array, $key): ?int - { - return self::getKeyOffset($array, $key); - } - - - /** - * Tests an array for the presence of value. - * @param mixed $value - */ - public static function contains(array $array, $value): bool - { - return in_array($value, $array, true); - } - - - /** - * Returns the first item from the array or null if array is empty. - * @template T - * @param array<T> $array - * @return ?T - */ - public static function first(array $array) - { - return count($array) ? reset($array) : null; - } - - - /** - * Returns the last item from the array or null if array is empty. - * @template T - * @param array<T> $array - * @return ?T - */ - public static function last(array $array) - { - return count($array) ? end($array) : null; - } - - - /** - * Inserts the contents of the $inserted array into the $array immediately after the $key. - * If $key is null (or does not exist), it is inserted at the beginning. - * @param array-key|null $key - */ - public static function insertBefore(array &$array, $key, array $inserted): void - { - $offset = $key === null ? 0 : (int) self::getKeyOffset($array, $key); - $array = array_slice($array, 0, $offset, true) - + $inserted - + array_slice($array, $offset, count($array), true); - } - - - /** - * Inserts the contents of the $inserted array into the $array before the $key. - * If $key is null (or does not exist), it is inserted at the end. - * @param array-key|null $key - */ - public static function insertAfter(array &$array, $key, array $inserted): void - { - if ($key === null || ($offset = self::getKeyOffset($array, $key)) === null) { - $offset = count($array) - 1; - } - - $array = array_slice($array, 0, $offset + 1, true) - + $inserted - + array_slice($array, $offset + 1, count($array), true); - } - - - /** - * Renames key in array. - * @param array-key $oldKey - * @param array-key $newKey - */ - public static function renameKey(array &$array, $oldKey, $newKey): bool - { - $offset = self::getKeyOffset($array, $oldKey); - if ($offset === null) { - return false; - } - - $val = &$array[$oldKey]; - $keys = array_keys($array); - $keys[$offset] = $newKey; - $array = array_combine($keys, $array); - $array[$newKey] = &$val; - return true; - } - - - /** - * Returns only those array items, which matches a regular expression $pattern. - * @param string[] $array - * @return string[] - */ - public static function grep(array $array, string $pattern, int $flags = 0): array - { - return Strings::pcre('preg_grep', [$pattern, $array, $flags]); - } - - - /** - * Transforms multidimensional array to flat array. - */ - public static function flatten(array $array, bool $preserveKeys = false): array - { - $res = []; - $cb = $preserveKeys - ? function ($v, $k) use (&$res): void { $res[$k] = $v; } - : function ($v) use (&$res): void { $res[] = $v; }; - array_walk_recursive($array, $cb); - return $res; - } - - - /** - * Checks if the array is indexed in ascending order of numeric keys from zero, a.k.a list. - * @param mixed $value - */ - public static function isList($value): bool - { - return is_array($value) && (PHP_VERSION_ID < 80100 - ? !$value || array_keys($value) === range(0, count($value) - 1) - : array_is_list($value) - ); - } - - - /** - * Reformats table to associative tree. Path looks like 'field|field[]field->field=field'. - * @param string|string[] $path - * @return array|\stdClass - */ - public static function associate(array $array, $path) - { - $parts = is_array($path) - ? $path - : preg_split('#(\[\]|->|=|\|)#', $path, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); - - if (!$parts || $parts === ['->'] || $parts[0] === '=' || $parts[0] === '|') { - throw new Nette\InvalidArgumentException("Invalid path '$path'."); - } - - $res = $parts[0] === '->' ? new \stdClass : []; - - foreach ($array as $rowOrig) { - $row = (array) $rowOrig; - $x = &$res; - - for ($i = 0; $i < count($parts); $i++) { - $part = $parts[$i]; - if ($part === '[]') { - $x = &$x[]; - - } elseif ($part === '=') { - if (isset($parts[++$i])) { - $x = $row[$parts[$i]]; - $row = null; - } - } elseif ($part === '->') { - if (isset($parts[++$i])) { - if ($x === null) { - $x = new \stdClass; - } - - $x = &$x->{$row[$parts[$i]]}; - } else { - $row = is_object($rowOrig) ? $rowOrig : (object) $row; - } - } elseif ($part !== '|') { - $x = &$x[(string) $row[$part]]; - } - } - - if ($x === null) { - $x = $row; - } - } - - return $res; - } - - - /** - * Normalizes array to associative array. Replace numeric keys with their values, the new value will be $filling. - * @param mixed $filling - */ - public static function normalize(array $array, $filling = null): array - { - $res = []; - foreach ($array as $k => $v) { - $res[is_int($k) ? $v : $k] = is_int($k) ? $filling : $v; - } - - return $res; - } - - - /** - * Returns and removes the value of an item from an array. If it does not exist, it throws an exception, - * or returns $default, if provided. - * @template T - * @param array<T> $array - * @param array-key $key - * @param ?T $default - * @return ?T - * @throws Nette\InvalidArgumentException if item does not exist and default value is not provided - */ - public static function pick(array &$array, $key, $default = null) - { - if (array_key_exists($key, $array)) { - $value = $array[$key]; - unset($array[$key]); - return $value; - - } elseif (func_num_args() < 3) { - throw new Nette\InvalidArgumentException("Missing item '$key'."); - - } else { - return $default; - } - } - - - /** - * Tests whether at least one element in the array passes the test implemented by the - * provided callback with signature `function ($value, $key, array $array): bool`. - */ - public static function some(iterable $array, callable $callback): bool - { - foreach ($array as $k => $v) { - if ($callback($v, $k, $array)) { - return true; - } - } - - return false; - } - - - /** - * Tests whether all elements in the array pass the test implemented by the provided function, - * which has the signature `function ($value, $key, array $array): bool`. - */ - public static function every(iterable $array, callable $callback): bool - { - foreach ($array as $k => $v) { - if (!$callback($v, $k, $array)) { - return false; - } - } - - return true; - } - - - /** - * Calls $callback on all elements in the array and returns the array of return values. - * The callback has the signature `function ($value, $key, array $array): bool`. - */ - public static function map(iterable $array, callable $callback): array - { - $res = []; - foreach ($array as $k => $v) { - $res[$k] = $callback($v, $k, $array); - } - - return $res; - } - - - /** - * Invokes all callbacks and returns array of results. - * @param callable[] $callbacks - */ - public static function invoke(iterable $callbacks, ...$args): array - { - $res = []; - foreach ($callbacks as $k => $cb) { - $res[$k] = $cb(...$args); - } - - return $res; - } - - - /** - * Invokes method on every object in an array and returns array of results. - * @param object[] $objects - */ - public static function invokeMethod(iterable $objects, string $method, ...$args): array - { - $res = []; - foreach ($objects as $k => $obj) { - $res[$k] = $obj->$method(...$args); - } - - return $res; - } - - - /** - * Copies the elements of the $array array to the $object object and then returns it. - * @template T of object - * @param T $object - * @return T - */ - public static function toObject(iterable $array, $object) - { - foreach ($array as $k => $v) { - $object->$k = $v; - } - - return $object; - } - - - /** - * Converts value to array key. - * @param mixed $value - * @return array-key - */ - public static function toKey($value) - { - return key([$value => null]); - } - - - /** - * Returns copy of the $array where every item is converted to string - * and prefixed by $prefix and suffixed by $suffix. - * @param string[] $array - * @return string[] - */ - public static function wrap(array $array, string $prefix = '', string $suffix = ''): array - { - $res = []; - foreach ($array as $k => $v) { - $res[$k] = $prefix . $v . $suffix; - } - - return $res; - } -} diff --git a/vendor/nette/utils/src/Utils/Callback.php b/vendor/nette/utils/src/Utils/Callback.php deleted file mode 100644 index 83b6e268..00000000 --- a/vendor/nette/utils/src/Utils/Callback.php +++ /dev/null @@ -1,184 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette\Utils; - -use Nette; -use function is_array, is_object, is_string; - - -/** - * PHP callable tools. - */ -final class Callback -{ - use Nette\StaticClass; - - /** - * @param string|object|callable $callable class, object, callable - * @deprecated use Closure::fromCallable() - */ - public static function closure($callable, ?string $method = null): \Closure - { - trigger_error(__METHOD__ . '() is deprecated, use Closure::fromCallable().', E_USER_DEPRECATED); - try { - return \Closure::fromCallable($method === null ? $callable : [$callable, $method]); - } catch (\TypeError $e) { - throw new Nette\InvalidArgumentException($e->getMessage()); - } - } - - - /** - * Invokes callback. - * @return mixed - * @deprecated - */ - public static function invoke($callable, ...$args) - { - trigger_error(__METHOD__ . '() is deprecated, use native invoking.', E_USER_DEPRECATED); - self::check($callable); - return $callable(...$args); - } - - - /** - * Invokes callback with an array of parameters. - * @return mixed - * @deprecated - */ - public static function invokeArgs($callable, array $args = []) - { - trigger_error(__METHOD__ . '() is deprecated, use native invoking.', E_USER_DEPRECATED); - self::check($callable); - return $callable(...$args); - } - - - /** - * Invokes internal PHP function with own error handler. - * @return mixed - */ - public static function invokeSafe(string $function, array $args, callable $onError) - { - $prev = set_error_handler(function ($severity, $message, $file) use ($onError, &$prev, $function): ?bool { - if ($file === __FILE__) { - $msg = ini_get('html_errors') - ? Html::htmlToText($message) - : $message; - $msg = preg_replace("#^$function\\(.*?\\): #", '', $msg); - if ($onError($msg, $severity) !== false) { - return null; - } - } - - return $prev ? $prev(...func_get_args()) : false; - }); - - try { - return $function(...$args); - } finally { - restore_error_handler(); - } - } - - - /** - * Checks that $callable is valid PHP callback. Otherwise throws exception. If the $syntax is set to true, only verifies - * that $callable has a valid structure to be used as a callback, but does not verify if the class or method actually exists. - * @param mixed $callable - * @return callable - * @throws Nette\InvalidArgumentException - */ - public static function check($callable, bool $syntax = false) - { - if (!is_callable($callable, $syntax)) { - throw new Nette\InvalidArgumentException( - $syntax - ? 'Given value is not a callable type.' - : sprintf("Callback '%s' is not callable.", self::toString($callable)) - ); - } - - return $callable; - } - - - /** - * Converts PHP callback to textual form. Class or method may not exists. - * @param mixed $callable - */ - public static function toString($callable): string - { - if ($callable instanceof \Closure) { - $inner = self::unwrap($callable); - return '{closure' . ($inner instanceof \Closure ? '}' : ' ' . self::toString($inner) . '}'); - } elseif (is_string($callable) && $callable[0] === "\0") { - return '{lambda}'; - } else { - is_callable(is_object($callable) ? [$callable, '__invoke'] : $callable, true, $textual); - return $textual; - } - } - - - /** - * Returns reflection for method or function used in PHP callback. - * @param callable $callable type check is escalated to ReflectionException - * @return \ReflectionMethod|\ReflectionFunction - * @throws \ReflectionException if callback is not valid - */ - public static function toReflection($callable): \ReflectionFunctionAbstract - { - if ($callable instanceof \Closure) { - $callable = self::unwrap($callable); - } - - if (is_string($callable) && strpos($callable, '::')) { - return new \ReflectionMethod($callable); - } elseif (is_array($callable)) { - return new \ReflectionMethod($callable[0], $callable[1]); - } elseif (is_object($callable) && !$callable instanceof \Closure) { - return new \ReflectionMethod($callable, '__invoke'); - } else { - return new \ReflectionFunction($callable); - } - } - - - /** - * Checks whether PHP callback is function or static method. - */ - public static function isStatic(callable $callable): bool - { - return is_array($callable) ? is_string($callable[0]) : is_string($callable); - } - - - /** - * Unwraps closure created by Closure::fromCallable(). - * @return callable|array - */ - public static function unwrap(\Closure $closure) - { - $r = new \ReflectionFunction($closure); - if (substr($r->name, -1) === '}') { - return $closure; - - } elseif ($obj = $r->getClosureThis()) { - return [$obj, $r->name]; - - } elseif ($class = $r->getClosureScopeClass()) { - return [$class->name, $r->name]; - - } else { - return $r->name; - } - } -} diff --git a/vendor/nette/utils/src/Utils/DateTime.php b/vendor/nette/utils/src/Utils/DateTime.php deleted file mode 100644 index aa61a4b4..00000000 --- a/vendor/nette/utils/src/Utils/DateTime.php +++ /dev/null @@ -1,147 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette\Utils; - -use Nette; - - -/** - * DateTime. - */ -class DateTime extends \DateTime implements \JsonSerializable -{ - use Nette\SmartObject; - - /** minute in seconds */ - public const MINUTE = 60; - - /** hour in seconds */ - public const HOUR = 60 * self::MINUTE; - - /** day in seconds */ - public const DAY = 24 * self::HOUR; - - /** week in seconds */ - public const WEEK = 7 * self::DAY; - - /** average month in seconds */ - public const MONTH = 2629800; - - /** average year in seconds */ - public const YEAR = 31557600; - - - /** - * Creates a DateTime object from a string, UNIX timestamp, or other DateTimeInterface object. - * @param string|int|\DateTimeInterface $time - * @return static - * @throws \Exception if the date and time are not valid. - */ - public static function from($time) - { - if ($time instanceof \DateTimeInterface) { - return new static($time->format('Y-m-d H:i:s.u'), $time->getTimezone()); - - } elseif (is_numeric($time)) { - if ($time <= self::YEAR) { - $time += time(); - } - - return (new static('@' . $time))->setTimezone(new \DateTimeZone(date_default_timezone_get())); - - } else { // textual or null - return new static((string) $time); - } - } - - - /** - * Creates DateTime object. - * @return static - * @throws Nette\InvalidArgumentException if the date and time are not valid. - */ - public static function fromParts( - int $year, - int $month, - int $day, - int $hour = 0, - int $minute = 0, - float $second = 0.0 - ) { - $s = sprintf('%04d-%02d-%02d %02d:%02d:%02.5F', $year, $month, $day, $hour, $minute, $second); - if ( - !checkdate($month, $day, $year) - || $hour < 0 - || $hour > 23 - || $minute < 0 - || $minute > 59 - || $second < 0 - || $second >= 60 - ) { - throw new Nette\InvalidArgumentException("Invalid date '$s'"); - } - - return new static($s); - } - - - /** - * Returns new DateTime object formatted according to the specified format. - * @param string $format The format the $time parameter should be in - * @param string $time - * @param string|\DateTimeZone $timezone (default timezone is used if null is passed) - * @return static|false - */ - #[\ReturnTypeWillChange] - public static function createFromFormat($format, $time, $timezone = null) - { - if ($timezone === null) { - $timezone = new \DateTimeZone(date_default_timezone_get()); - - } elseif (is_string($timezone)) { - $timezone = new \DateTimeZone($timezone); - - } elseif (!$timezone instanceof \DateTimeZone) { - throw new Nette\InvalidArgumentException('Invalid timezone given'); - } - - $date = parent::createFromFormat($format, $time, $timezone); - return $date ? static::from($date) : false; - } - - - /** - * Returns JSON representation in ISO 8601 (used by JavaScript). - */ - public function jsonSerialize(): string - { - return $this->format('c'); - } - - - /** - * Returns the date and time in the format 'Y-m-d H:i:s'. - */ - public function __toString(): string - { - return $this->format('Y-m-d H:i:s'); - } - - - /** - * Creates a copy with a modified time. - * @return static - */ - public function modifyClone(string $modify = '') - { - $dolly = clone $this; - return $modify ? $dolly->modify($modify) : $dolly; - } -} diff --git a/vendor/nette/utils/src/Utils/FileSystem.php b/vendor/nette/utils/src/Utils/FileSystem.php deleted file mode 100644 index c6160338..00000000 --- a/vendor/nette/utils/src/Utils/FileSystem.php +++ /dev/null @@ -1,261 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette\Utils; - -use Nette; - - -/** - * File system tool. - */ -final class FileSystem -{ - use Nette\StaticClass; - - /** - * Creates a directory if it doesn't exist. - * @throws Nette\IOException on error occurred - */ - public static function createDir(string $dir, int $mode = 0777): void - { - if (!is_dir($dir) && !@mkdir($dir, $mode, true) && !is_dir($dir)) { // @ - dir may already exist - throw new Nette\IOException(sprintf( - "Unable to create directory '%s' with mode %s. %s", - self::normalizePath($dir), - decoct($mode), - Helpers::getLastError() - )); - } - } - - - /** - * Copies a file or a directory. Overwrites existing files and directories by default. - * @throws Nette\IOException on error occurred - * @throws Nette\InvalidStateException if $overwrite is set to false and destination already exists - */ - public static function copy(string $origin, string $target, bool $overwrite = true): void - { - if (stream_is_local($origin) && !file_exists($origin)) { - throw new Nette\IOException(sprintf("File or directory '%s' not found.", self::normalizePath($origin))); - - } elseif (!$overwrite && file_exists($target)) { - throw new Nette\InvalidStateException(sprintf("File or directory '%s' already exists.", self::normalizePath($target))); - - } elseif (is_dir($origin)) { - static::createDir($target); - foreach (new \FilesystemIterator($target) as $item) { - static::delete($item->getPathname()); - } - - foreach ($iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($origin, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST) as $item) { - if ($item->isDir()) { - static::createDir($target . '/' . $iterator->getSubPathName()); - } else { - static::copy($item->getPathname(), $target . '/' . $iterator->getSubPathName()); - } - } - } else { - static::createDir(dirname($target)); - if ( - ($s = @fopen($origin, 'rb')) - && ($d = @fopen($target, 'wb')) - && @stream_copy_to_stream($s, $d) === false - ) { // @ is escalated to exception - throw new Nette\IOException(sprintf( - "Unable to copy file '%s' to '%s'. %s", - self::normalizePath($origin), - self::normalizePath($target), - Helpers::getLastError() - )); - } - } - } - - - /** - * Deletes a file or directory if exists. - * @throws Nette\IOException on error occurred - */ - public static function delete(string $path): void - { - if (is_file($path) || is_link($path)) { - $func = DIRECTORY_SEPARATOR === '\\' && is_dir($path) ? 'rmdir' : 'unlink'; - if (!@$func($path)) { // @ is escalated to exception - throw new Nette\IOException(sprintf( - "Unable to delete '%s'. %s", - self::normalizePath($path), - Helpers::getLastError() - )); - } - } elseif (is_dir($path)) { - foreach (new \FilesystemIterator($path) as $item) { - static::delete($item->getPathname()); - } - - if (!@rmdir($path)) { // @ is escalated to exception - throw new Nette\IOException(sprintf( - "Unable to delete directory '%s'. %s", - self::normalizePath($path), - Helpers::getLastError() - )); - } - } - } - - - /** - * Renames or moves a file or a directory. Overwrites existing files and directories by default. - * @throws Nette\IOException on error occurred - * @throws Nette\InvalidStateException if $overwrite is set to false and destination already exists - */ - public static function rename(string $origin, string $target, bool $overwrite = true): void - { - if (!$overwrite && file_exists($target)) { - throw new Nette\InvalidStateException(sprintf("File or directory '%s' already exists.", self::normalizePath($target))); - - } elseif (!file_exists($origin)) { - throw new Nette\IOException(sprintf("File or directory '%s' not found.", self::normalizePath($origin))); - - } else { - static::createDir(dirname($target)); - if (realpath($origin) !== realpath($target)) { - static::delete($target); - } - - if (!@rename($origin, $target)) { // @ is escalated to exception - throw new Nette\IOException(sprintf( - "Unable to rename file or directory '%s' to '%s'. %s", - self::normalizePath($origin), - self::normalizePath($target), - Helpers::getLastError() - )); - } - } - } - - - /** - * Reads the content of a file. - * @throws Nette\IOException on error occurred - */ - public static function read(string $file): string - { - $content = @file_get_contents($file); // @ is escalated to exception - if ($content === false) { - throw new Nette\IOException(sprintf( - "Unable to read file '%s'. %s", - self::normalizePath($file), - Helpers::getLastError() - )); - } - - return $content; - } - - - /** - * Writes the string to a file. - * @throws Nette\IOException on error occurred - */ - public static function write(string $file, string $content, ?int $mode = 0666): void - { - static::createDir(dirname($file)); - if (@file_put_contents($file, $content) === false) { // @ is escalated to exception - throw new Nette\IOException(sprintf( - "Unable to write file '%s'. %s", - self::normalizePath($file), - Helpers::getLastError() - )); - } - - if ($mode !== null && !@chmod($file, $mode)) { // @ is escalated to exception - throw new Nette\IOException(sprintf( - "Unable to chmod file '%s' to mode %s. %s", - self::normalizePath($file), - decoct($mode), - Helpers::getLastError() - )); - } - } - - - /** - * Fixes permissions to a specific file or directory. Directories can be fixed recursively. - * @throws Nette\IOException on error occurred - */ - public static function makeWritable(string $path, int $dirMode = 0777, int $fileMode = 0666): void - { - if (is_file($path)) { - if (!@chmod($path, $fileMode)) { // @ is escalated to exception - throw new Nette\IOException(sprintf( - "Unable to chmod file '%s' to mode %s. %s", - self::normalizePath($path), - decoct($fileMode), - Helpers::getLastError() - )); - } - } elseif (is_dir($path)) { - foreach (new \FilesystemIterator($path) as $item) { - static::makeWritable($item->getPathname(), $dirMode, $fileMode); - } - - if (!@chmod($path, $dirMode)) { // @ is escalated to exception - throw new Nette\IOException(sprintf( - "Unable to chmod directory '%s' to mode %s. %s", - self::normalizePath($path), - decoct($dirMode), - Helpers::getLastError() - )); - } - } else { - throw new Nette\IOException(sprintf("File or directory '%s' not found.", self::normalizePath($path))); - } - } - - - /** - * Determines if the path is absolute. - */ - public static function isAbsolute(string $path): bool - { - return (bool) preg_match('#([a-z]:)?[/\\\\]|[a-z][a-z0-9+.-]*://#Ai', $path); - } - - - /** - * Normalizes `..` and `.` and directory separators in path. - */ - public static function normalizePath(string $path): string - { - $parts = $path === '' ? [] : preg_split('~[/\\\\]+~', $path); - $res = []; - foreach ($parts as $part) { - if ($part === '..' && $res && end($res) !== '..' && end($res) !== '') { - array_pop($res); - } elseif ($part !== '.') { - $res[] = $part; - } - } - - return $res === [''] - ? DIRECTORY_SEPARATOR - : implode(DIRECTORY_SEPARATOR, $res); - } - - - /** - * Joins all segments of the path and normalizes the result. - */ - public static function joinPaths(string ...$paths): string - { - return self::normalizePath(implode('/', $paths)); - } -} diff --git a/vendor/nette/utils/src/Utils/Floats.php b/vendor/nette/utils/src/Utils/Floats.php deleted file mode 100644 index cc2781d7..00000000 --- a/vendor/nette/utils/src/Utils/Floats.php +++ /dev/null @@ -1,107 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette\Utils; - -use Nette; - - -/** - * Floating-point numbers comparison. - */ -class Floats -{ - use Nette\StaticClass; - - private const Epsilon = 1e-10; - - - public static function isZero(float $value): bool - { - return abs($value) < self::Epsilon; - } - - - public static function isInteger(float $value): bool - { - return abs(round($value) - $value) < self::Epsilon; - } - - - /** - * Compare two floats. If $a < $b it returns -1, if they are equal it returns 0 and if $a > $b it returns 1 - * @throws \LogicException if one of parameters is NAN - */ - public static function compare(float $a, float $b): int - { - if (is_nan($a) || is_nan($b)) { - throw new \LogicException('Trying to compare NAN'); - - } elseif (!is_finite($a) && !is_finite($b) && $a === $b) { - return 0; - } - - $diff = abs($a - $b); - if (($diff < self::Epsilon || ($diff / max(abs($a), abs($b)) < self::Epsilon))) { - return 0; - } - - return $a < $b ? -1 : 1; - } - - - /** - * Returns true if $a = $b - * @throws \LogicException if one of parameters is NAN - */ - public static function areEqual(float $a, float $b): bool - { - return self::compare($a, $b) === 0; - } - - - /** - * Returns true if $a < $b - * @throws \LogicException if one of parameters is NAN - */ - public static function isLessThan(float $a, float $b): bool - { - return self::compare($a, $b) < 0; - } - - - /** - * Returns true if $a <= $b - * @throws \LogicException if one of parameters is NAN - */ - public static function isLessThanOrEqualTo(float $a, float $b): bool - { - return self::compare($a, $b) <= 0; - } - - - /** - * Returns true if $a > $b - * @throws \LogicException if one of parameters is NAN - */ - public static function isGreaterThan(float $a, float $b): bool - { - return self::compare($a, $b) > 0; - } - - - /** - * Returns true if $a >= $b - * @throws \LogicException if one of parameters is NAN - */ - public static function isGreaterThanOrEqualTo(float $a, float $b): bool - { - return self::compare($a, $b) >= 0; - } -} diff --git a/vendor/nette/utils/src/Utils/Helpers.php b/vendor/nette/utils/src/Utils/Helpers.php deleted file mode 100644 index 224a1fe5..00000000 --- a/vendor/nette/utils/src/Utils/Helpers.php +++ /dev/null @@ -1,91 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette\Utils; - -use Nette; - - -class Helpers -{ - /** - * Executes a callback and returns the captured output as a string. - */ - public static function capture(callable $func): string - { - ob_start(function () {}); - try { - $func(); - return ob_get_clean(); - } catch (\Throwable $e) { - ob_end_clean(); - throw $e; - } - } - - - /** - * Returns the last occurred PHP error or an empty string if no error occurred. Unlike error_get_last(), - * it is nit affected by the PHP directive html_errors and always returns text, not HTML. - */ - public static function getLastError(): string - { - $message = error_get_last()['message'] ?? ''; - $message = ini_get('html_errors') ? Html::htmlToText($message) : $message; - $message = preg_replace('#^\w+\(.*?\): #', '', $message); - return $message; - } - - - /** - * Converts false to null, does not change other values. - * @param mixed $value - * @return mixed - */ - public static function falseToNull($value) - { - return $value === false ? null : $value; - } - - - /** - * Returns value clamped to the inclusive range of min and max. - * @param int|float $value - * @param int|float $min - * @param int|float $max - * @return int|float - */ - public static function clamp($value, $min, $max) - { - if ($min > $max) { - throw new Nette\InvalidArgumentException("Minimum ($min) is not less than maximum ($max)."); - } - - return min(max($value, $min), $max); - } - - - /** - * Looks for a string from possibilities that is most similar to value, but not the same (for 8-bit encoding). - * @param string[] $possibilities - */ - public static function getSuggestion(array $possibilities, string $value): ?string - { - $best = null; - $min = (strlen($value) / 4 + 1) * 10 + .1; - foreach (array_unique($possibilities) as $item) { - if ($item !== $value && ($len = levenshtein($item, $value, 10, 11, 10)) < $min) { - $min = $len; - $best = $item; - } - } - - return $best; - } -} diff --git a/vendor/nette/utils/src/Utils/Html.php b/vendor/nette/utils/src/Utils/Html.php deleted file mode 100644 index 0e1f6436..00000000 --- a/vendor/nette/utils/src/Utils/Html.php +++ /dev/null @@ -1,887 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette\Utils; - -use Nette; -use Nette\HtmlStringable; -use function is_array, is_float, is_object, is_string; - - -/** - * HTML helper. - * - * @property string|null $accept - * @property string|null $accesskey - * @property string|null $action - * @property string|null $align - * @property string|null $allow - * @property string|null $alt - * @property bool|null $async - * @property string|null $autocapitalize - * @property string|null $autocomplete - * @property bool|null $autofocus - * @property bool|null $autoplay - * @property string|null $charset - * @property bool|null $checked - * @property string|null $cite - * @property string|null $class - * @property int|null $cols - * @property int|null $colspan - * @property string|null $content - * @property bool|null $contenteditable - * @property bool|null $controls - * @property string|null $coords - * @property string|null $crossorigin - * @property string|null $data - * @property string|null $datetime - * @property string|null $decoding - * @property bool|null $default - * @property bool|null $defer - * @property string|null $dir - * @property string|null $dirname - * @property bool|null $disabled - * @property bool|null $download - * @property string|null $draggable - * @property string|null $dropzone - * @property string|null $enctype - * @property string|null $for - * @property string|null $form - * @property string|null $formaction - * @property string|null $formenctype - * @property string|null $formmethod - * @property bool|null $formnovalidate - * @property string|null $formtarget - * @property string|null $headers - * @property int|null $height - * @property bool|null $hidden - * @property float|null $high - * @property string|null $href - * @property string|null $hreflang - * @property string|null $id - * @property string|null $integrity - * @property string|null $inputmode - * @property bool|null $ismap - * @property string|null $itemprop - * @property string|null $kind - * @property string|null $label - * @property string|null $lang - * @property string|null $list - * @property bool|null $loop - * @property float|null $low - * @property float|null $max - * @property int|null $maxlength - * @property int|null $minlength - * @property string|null $media - * @property string|null $method - * @property float|null $min - * @property bool|null $multiple - * @property bool|null $muted - * @property string|null $name - * @property bool|null $novalidate - * @property bool|null $open - * @property float|null $optimum - * @property string|null $pattern - * @property string|null $ping - * @property string|null $placeholder - * @property string|null $poster - * @property string|null $preload - * @property string|null $radiogroup - * @property bool|null $readonly - * @property string|null $rel - * @property bool|null $required - * @property bool|null $reversed - * @property int|null $rows - * @property int|null $rowspan - * @property string|null $sandbox - * @property string|null $scope - * @property bool|null $selected - * @property string|null $shape - * @property int|null $size - * @property string|null $sizes - * @property string|null $slot - * @property int|null $span - * @property string|null $spellcheck - * @property string|null $src - * @property string|null $srcdoc - * @property string|null $srclang - * @property string|null $srcset - * @property int|null $start - * @property float|null $step - * @property string|null $style - * @property int|null $tabindex - * @property string|null $target - * @property string|null $title - * @property string|null $translate - * @property string|null $type - * @property string|null $usemap - * @property string|null $value - * @property int|null $width - * @property string|null $wrap - * - * @method self accept(?string $val) - * @method self accesskey(?string $val, bool $state = null) - * @method self action(?string $val) - * @method self align(?string $val) - * @method self allow(?string $val, bool $state = null) - * @method self alt(?string $val) - * @method self async(?bool $val) - * @method self autocapitalize(?string $val) - * @method self autocomplete(?string $val) - * @method self autofocus(?bool $val) - * @method self autoplay(?bool $val) - * @method self charset(?string $val) - * @method self checked(?bool $val) - * @method self cite(?string $val) - * @method self class(?string $val, bool $state = null) - * @method self cols(?int $val) - * @method self colspan(?int $val) - * @method self content(?string $val) - * @method self contenteditable(?bool $val) - * @method self controls(?bool $val) - * @method self coords(?string $val) - * @method self crossorigin(?string $val) - * @method self datetime(?string $val) - * @method self decoding(?string $val) - * @method self default(?bool $val) - * @method self defer(?bool $val) - * @method self dir(?string $val) - * @method self dirname(?string $val) - * @method self disabled(?bool $val) - * @method self download(?bool $val) - * @method self draggable(?string $val) - * @method self dropzone(?string $val) - * @method self enctype(?string $val) - * @method self for(?string $val) - * @method self form(?string $val) - * @method self formaction(?string $val) - * @method self formenctype(?string $val) - * @method self formmethod(?string $val) - * @method self formnovalidate(?bool $val) - * @method self formtarget(?string $val) - * @method self headers(?string $val, bool $state = null) - * @method self height(?int $val) - * @method self hidden(?bool $val) - * @method self high(?float $val) - * @method self hreflang(?string $val) - * @method self id(?string $val) - * @method self integrity(?string $val) - * @method self inputmode(?string $val) - * @method self ismap(?bool $val) - * @method self itemprop(?string $val) - * @method self kind(?string $val) - * @method self label(?string $val) - * @method self lang(?string $val) - * @method self list(?string $val) - * @method self loop(?bool $val) - * @method self low(?float $val) - * @method self max(?float $val) - * @method self maxlength(?int $val) - * @method self minlength(?int $val) - * @method self media(?string $val) - * @method self method(?string $val) - * @method self min(?float $val) - * @method self multiple(?bool $val) - * @method self muted(?bool $val) - * @method self name(?string $val) - * @method self novalidate(?bool $val) - * @method self open(?bool $val) - * @method self optimum(?float $val) - * @method self pattern(?string $val) - * @method self ping(?string $val, bool $state = null) - * @method self placeholder(?string $val) - * @method self poster(?string $val) - * @method self preload(?string $val) - * @method self radiogroup(?string $val) - * @method self readonly(?bool $val) - * @method self rel(?string $val) - * @method self required(?bool $val) - * @method self reversed(?bool $val) - * @method self rows(?int $val) - * @method self rowspan(?int $val) - * @method self sandbox(?string $val, bool $state = null) - * @method self scope(?string $val) - * @method self selected(?bool $val) - * @method self shape(?string $val) - * @method self size(?int $val) - * @method self sizes(?string $val) - * @method self slot(?string $val) - * @method self span(?int $val) - * @method self spellcheck(?string $val) - * @method self src(?string $val) - * @method self srcdoc(?string $val) - * @method self srclang(?string $val) - * @method self srcset(?string $val) - * @method self start(?int $val) - * @method self step(?float $val) - * @method self style(?string $property, string $val = null) - * @method self tabindex(?int $val) - * @method self target(?string $val) - * @method self title(?string $val) - * @method self translate(?string $val) - * @method self type(?string $val) - * @method self usemap(?string $val) - * @method self value(?string $val) - * @method self width(?int $val) - * @method self wrap(?string $val) - */ -class Html implements \ArrayAccess, \Countable, \IteratorAggregate, HtmlStringable -{ - use Nette\SmartObject; - - /** @var array<string, mixed> element's attributes */ - public $attrs = []; - - /** @var bool use XHTML syntax? */ - public static $xhtml = false; - - /** @var array<string, int> void elements */ - public static $emptyElements = [ - 'img' => 1, 'hr' => 1, 'br' => 1, 'input' => 1, 'meta' => 1, 'area' => 1, 'embed' => 1, 'keygen' => 1, - 'source' => 1, 'base' => 1, 'col' => 1, 'link' => 1, 'param' => 1, 'basefont' => 1, 'frame' => 1, - 'isindex' => 1, 'wbr' => 1, 'command' => 1, 'track' => 1, - ]; - - /** @var array<int, HtmlStringable|string> nodes */ - protected $children = []; - - /** @var string element's name */ - private $name; - - /** @var bool is element empty? */ - private $isEmpty; - - - /** - * Constructs new HTML element. - * @param array|string $attrs element's attributes or plain text content - * @return static - */ - public static function el(?string $name = null, $attrs = null) - { - $el = new static; - $parts = explode(' ', (string) $name, 2); - $el->setName($parts[0]); - - if (is_array($attrs)) { - $el->attrs = $attrs; - - } elseif ($attrs !== null) { - $el->setText($attrs); - } - - if (isset($parts[1])) { - foreach (Strings::matchAll($parts[1] . ' ', '#([a-z0-9:-]+)(?:=(["\'])?(.*?)(?(2)\2|\s))?#i') as $m) { - $el->attrs[$m[1]] = $m[3] ?? true; - } - } - - return $el; - } - - - /** - * Returns an object representing HTML text. - */ - public static function fromHtml(string $html): self - { - return (new static)->setHtml($html); - } - - - /** - * Returns an object representing plain text. - */ - public static function fromText(string $text): self - { - return (new static)->setText($text); - } - - - /** - * Converts to HTML. - */ - final public function toHtml(): string - { - return $this->render(); - } - - - /** - * Converts to plain text. - */ - final public function toText(): string - { - return $this->getText(); - } - - - /** - * Converts given HTML code to plain text. - */ - public static function htmlToText(string $html): string - { - return html_entity_decode(strip_tags($html), ENT_QUOTES | ENT_HTML5, 'UTF-8'); - } - - - /** - * Changes element's name. - * @return static - */ - final public function setName(string $name, ?bool $isEmpty = null) - { - $this->name = $name; - $this->isEmpty = $isEmpty ?? isset(static::$emptyElements[$name]); - return $this; - } - - - /** - * Returns element's name. - */ - final public function getName(): string - { - return $this->name; - } - - - /** - * Is element empty? - */ - final public function isEmpty(): bool - { - return $this->isEmpty; - } - - - /** - * Sets multiple attributes. - * @return static - */ - public function addAttributes(array $attrs) - { - $this->attrs = array_merge($this->attrs, $attrs); - return $this; - } - - - /** - * Appends value to element's attribute. - * @param mixed $value - * @param mixed $option - * @return static - */ - public function appendAttribute(string $name, $value, $option = true) - { - if (is_array($value)) { - $prev = isset($this->attrs[$name]) ? (array) $this->attrs[$name] : []; - $this->attrs[$name] = $value + $prev; - - } elseif ((string) $value === '') { - $tmp = &$this->attrs[$name]; // appending empty value? -> ignore, but ensure it exists - - } elseif (!isset($this->attrs[$name]) || is_array($this->attrs[$name])) { // needs array - $this->attrs[$name][$value] = $option; - - } else { - $this->attrs[$name] = [$this->attrs[$name] => true, $value => $option]; - } - - return $this; - } - - - /** - * Sets element's attribute. - * @param mixed $value - * @return static - */ - public function setAttribute(string $name, $value) - { - $this->attrs[$name] = $value; - return $this; - } - - - /** - * Returns element's attribute. - * @return mixed - */ - public function getAttribute(string $name) - { - return $this->attrs[$name] ?? null; - } - - - /** - * Unsets element's attribute. - * @return static - */ - public function removeAttribute(string $name) - { - unset($this->attrs[$name]); - return $this; - } - - - /** - * Unsets element's attributes. - * @return static - */ - public function removeAttributes(array $attributes) - { - foreach ($attributes as $name) { - unset($this->attrs[$name]); - } - - return $this; - } - - - /** - * Overloaded setter for element's attribute. - * @param mixed $value - */ - final public function __set(string $name, $value): void - { - $this->attrs[$name] = $value; - } - - - /** - * Overloaded getter for element's attribute. - * @return mixed - */ - final public function &__get(string $name) - { - return $this->attrs[$name]; - } - - - /** - * Overloaded tester for element's attribute. - */ - final public function __isset(string $name): bool - { - return isset($this->attrs[$name]); - } - - - /** - * Overloaded unsetter for element's attribute. - */ - final public function __unset(string $name): void - { - unset($this->attrs[$name]); - } - - - /** - * Overloaded setter for element's attribute. - * @return mixed - */ - final public function __call(string $m, array $args) - { - $p = substr($m, 0, 3); - if ($p === 'get' || $p === 'set' || $p === 'add') { - $m = substr($m, 3); - $m[0] = $m[0] | "\x20"; - if ($p === 'get') { - return $this->attrs[$m] ?? null; - - } elseif ($p === 'add') { - $args[] = true; - } - } - - if (count($args) === 0) { // invalid - - } elseif (count($args) === 1) { // set - $this->attrs[$m] = $args[0]; - - } else { // add - $this->appendAttribute($m, $args[0], $args[1]); - } - - return $this; - } - - - /** - * Special setter for element's attribute. - * @return static - */ - final public function href(string $path, ?array $query = null) - { - if ($query) { - $query = http_build_query($query, '', '&'); - if ($query !== '') { - $path .= '?' . $query; - } - } - - $this->attrs['href'] = $path; - return $this; - } - - - /** - * Setter for data-* attributes. Booleans are converted to 'true' resp. 'false'. - * @param mixed $value - * @return static - */ - public function data(string $name, $value = null) - { - if (func_num_args() === 1) { - $this->attrs['data'] = $name; - } else { - $this->attrs["data-$name"] = is_bool($value) - ? json_encode($value) - : $value; - } - - return $this; - } - - - /** - * Sets element's HTML content. - * @param HtmlStringable|string $html - * @return static - */ - final public function setHtml($html) - { - $this->children = [(string) $html]; - return $this; - } - - - /** - * Returns element's HTML content. - */ - final public function getHtml(): string - { - return implode('', $this->children); - } - - - /** - * Sets element's textual content. - * @param HtmlStringable|string|int|float $text - * @return static - */ - final public function setText($text) - { - if (!$text instanceof HtmlStringable) { - $text = htmlspecialchars((string) $text, ENT_NOQUOTES, 'UTF-8'); - } - - $this->children = [(string) $text]; - return $this; - } - - - /** - * Returns element's textual content. - */ - final public function getText(): string - { - return self::htmlToText($this->getHtml()); - } - - - /** - * Adds new element's child. - * @param HtmlStringable|string $child Html node or raw HTML string - * @return static - */ - final public function addHtml($child) - { - return $this->insert(null, $child); - } - - - /** - * Appends plain-text string to element content. - * @param HtmlStringable|string|int|float $text - * @return static - */ - public function addText($text) - { - if (!$text instanceof HtmlStringable) { - $text = htmlspecialchars((string) $text, ENT_NOQUOTES, 'UTF-8'); - } - - return $this->insert(null, $text); - } - - - /** - * Creates and adds a new Html child. - * @param array|string $attrs element's attributes or raw HTML string - * @return static created element - */ - final public function create(string $name, $attrs = null) - { - $this->insert(null, $child = static::el($name, $attrs)); - return $child; - } - - - /** - * Inserts child node. - * @param HtmlStringable|string $child Html node or raw HTML string - * @return static - */ - public function insert(?int $index, $child, bool $replace = false) - { - $child = $child instanceof self ? $child : (string) $child; - if ($index === null) { // append - $this->children[] = $child; - - } else { // insert or replace - array_splice($this->children, $index, $replace ? 1 : 0, [$child]); - } - - return $this; - } - - - /** - * Inserts (replaces) child node (\ArrayAccess implementation). - * @param int|null $index position or null for appending - * @param Html|string $child Html node or raw HTML string - */ - final public function offsetSet($index, $child): void - { - $this->insert($index, $child, true); - } - - - /** - * Returns child node (\ArrayAccess implementation). - * @param int $index - * @return HtmlStringable|string - */ - #[\ReturnTypeWillChange] - final public function offsetGet($index) - { - return $this->children[$index]; - } - - - /** - * Exists child node? (\ArrayAccess implementation). - * @param int $index - */ - final public function offsetExists($index): bool - { - return isset($this->children[$index]); - } - - - /** - * Removes child node (\ArrayAccess implementation). - * @param int $index - */ - public function offsetUnset($index): void - { - if (isset($this->children[$index])) { - array_splice($this->children, $index, 1); - } - } - - - /** - * Returns children count. - */ - final public function count(): int - { - return count($this->children); - } - - - /** - * Removes all children. - */ - public function removeChildren(): void - { - $this->children = []; - } - - - /** - * Iterates over elements. - * @return \ArrayIterator<int, HtmlStringable|string> - */ - final public function getIterator(): \ArrayIterator - { - return new \ArrayIterator($this->children); - } - - - /** - * Returns all children. - */ - final public function getChildren(): array - { - return $this->children; - } - - - /** - * Renders element's start tag, content and end tag. - */ - final public function render(?int $indent = null): string - { - $s = $this->startTag(); - - if (!$this->isEmpty) { - // add content - if ($indent !== null) { - $indent++; - } - - foreach ($this->children as $child) { - if ($child instanceof self) { - $s .= $child->render($indent); - } else { - $s .= $child; - } - } - - // add end tag - $s .= $this->endTag(); - } - - if ($indent !== null) { - return "\n" . str_repeat("\t", $indent - 1) . $s . "\n" . str_repeat("\t", max(0, $indent - 2)); - } - - return $s; - } - - - final public function __toString(): string - { - try { - return $this->render(); - } catch (\Throwable $e) { - if (PHP_VERSION_ID >= 70400) { - throw $e; - } - - trigger_error('Exception in ' . __METHOD__ . "(): {$e->getMessage()} in {$e->getFile()}:{$e->getLine()}", E_USER_ERROR); - return ''; - } - } - - - /** - * Returns element's start tag. - */ - final public function startTag(): string - { - return $this->name - ? '<' . $this->name . $this->attributes() . (static::$xhtml && $this->isEmpty ? ' />' : '>') - : ''; - } - - - /** - * Returns element's end tag. - */ - final public function endTag(): string - { - return $this->name && !$this->isEmpty ? '</' . $this->name . '>' : ''; - } - - - /** - * Returns element's attributes. - * @internal - */ - final public function attributes(): string - { - if (!is_array($this->attrs)) { - return ''; - } - - $s = ''; - $attrs = $this->attrs; - foreach ($attrs as $key => $value) { - if ($value === null || $value === false) { - continue; - - } elseif ($value === true) { - if (static::$xhtml) { - $s .= ' ' . $key . '="' . $key . '"'; - } else { - $s .= ' ' . $key; - } - - continue; - - } elseif (is_array($value)) { - if (strncmp($key, 'data-', 5) === 0) { - $value = Json::encode($value); - - } else { - $tmp = null; - foreach ($value as $k => $v) { - if ($v != null) { // intentionally ==, skip nulls & empty string - // composite 'style' vs. 'others' - $tmp[] = $v === true - ? $k - : (is_string($k) ? $k . ':' . $v : $v); - } - } - - if ($tmp === null) { - continue; - } - - $value = implode($key === 'style' || !strncmp($key, 'on', 2) ? ';' : ' ', $tmp); - } - } elseif (is_float($value)) { - $value = rtrim(rtrim(number_format($value, 10, '.', ''), '0'), '.'); - - } else { - $value = (string) $value; - } - - $q = strpos($value, '"') === false ? '"' : "'"; - $s .= ' ' . $key . '=' . $q - . str_replace( - ['&', $q, '<'], - ['&', $q === '"' ? '"' : ''', self::$xhtml ? '<' : '<'], - $value - ) - . (strpos($value, '`') !== false && strpbrk($value, ' <>"\'') === false ? ' ' : '') - . $q; - } - - $s = str_replace('@', '@', $s); - return $s; - } - - - /** - * Clones all children too. - */ - public function __clone() - { - foreach ($this->children as $key => $value) { - if (is_object($value)) { - $this->children[$key] = clone $value; - } - } - } -} diff --git a/vendor/nette/utils/src/Utils/Image.php b/vendor/nette/utils/src/Utils/Image.php deleted file mode 100644 index b993ceec..00000000 --- a/vendor/nette/utils/src/Utils/Image.php +++ /dev/null @@ -1,767 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette\Utils; - -use Nette; - - -/** - * Basic manipulation with images. Supported types are JPEG, PNG, GIF, WEBP, AVIF and BMP. - * - * <code> - * $image = Image::fromFile('nette.jpg'); - * $image->resize(150, 100); - * $image->sharpen(); - * $image->send(); - * </code> - * - * @method Image affine(array $affine, array $clip = null) - * @method array affineMatrixConcat(array $m1, array $m2) - * @method array affineMatrixGet(int $type, mixed $options = null) - * @method void alphaBlending(bool $on) - * @method void antialias(bool $on) - * @method void arc($x, $y, $w, $h, $start, $end, $color) - * @method void char(int $font, $x, $y, string $char, $color) - * @method void charUp(int $font, $x, $y, string $char, $color) - * @method int colorAllocate($red, $green, $blue) - * @method int colorAllocateAlpha($red, $green, $blue, $alpha) - * @method int colorAt($x, $y) - * @method int colorClosest($red, $green, $blue) - * @method int colorClosestAlpha($red, $green, $blue, $alpha) - * @method int colorClosestHWB($red, $green, $blue) - * @method void colorDeallocate($color) - * @method int colorExact($red, $green, $blue) - * @method int colorExactAlpha($red, $green, $blue, $alpha) - * @method void colorMatch(Image $image2) - * @method int colorResolve($red, $green, $blue) - * @method int colorResolveAlpha($red, $green, $blue, $alpha) - * @method void colorSet($index, $red, $green, $blue) - * @method array colorsForIndex($index) - * @method int colorsTotal() - * @method int colorTransparent($color = null) - * @method void convolution(array $matrix, float $div, float $offset) - * @method void copy(Image $src, $dstX, $dstY, $srcX, $srcY, $srcW, $srcH) - * @method void copyMerge(Image $src, $dstX, $dstY, $srcX, $srcY, $srcW, $srcH, $opacity) - * @method void copyMergeGray(Image $src, $dstX, $dstY, $srcX, $srcY, $srcW, $srcH, $opacity) - * @method void copyResampled(Image $src, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH) - * @method void copyResized(Image $src, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH) - * @method Image cropAuto(int $mode = -1, float $threshold = .5, int $color = -1) - * @method void ellipse($cx, $cy, $w, $h, $color) - * @method void fill($x, $y, $color) - * @method void filledArc($cx, $cy, $w, $h, $s, $e, $color, $style) - * @method void filledEllipse($cx, $cy, $w, $h, $color) - * @method void filledPolygon(array $points, $numPoints, $color) - * @method void filledRectangle($x1, $y1, $x2, $y2, $color) - * @method void fillToBorder($x, $y, $border, $color) - * @method void filter($filtertype) - * @method void flip(int $mode) - * @method array ftText($size, $angle, $x, $y, $col, string $fontFile, string $text, array $extrainfo = null) - * @method void gammaCorrect(float $inputgamma, float $outputgamma) - * @method array getClip() - * @method int interlace($interlace = null) - * @method bool isTrueColor() - * @method void layerEffect($effect) - * @method void line($x1, $y1, $x2, $y2, $color) - * @method void openPolygon(array $points, int $num_points, int $color) - * @method void paletteCopy(Image $source) - * @method void paletteToTrueColor() - * @method void polygon(array $points, $numPoints, $color) - * @method array psText(string $text, $font, $size, $color, $backgroundColor, $x, $y, $space = null, $tightness = null, float $angle = null, $antialiasSteps = null) - * @method void rectangle($x1, $y1, $x2, $y2, $col) - * @method mixed resolution(int $res_x = null, int $res_y = null) - * @method Image rotate(float $angle, $backgroundColor) - * @method void saveAlpha(bool $saveflag) - * @method Image scale(int $newWidth, int $newHeight = -1, int $mode = IMG_BILINEAR_FIXED) - * @method void setBrush(Image $brush) - * @method void setClip(int $x1, int $y1, int $x2, int $y2) - * @method void setInterpolation(int $method = IMG_BILINEAR_FIXED) - * @method void setPixel($x, $y, $color) - * @method void setStyle(array $style) - * @method void setThickness($thickness) - * @method void setTile(Image $tile) - * @method void string($font, $x, $y, string $s, $col) - * @method void stringUp($font, $x, $y, string $s, $col) - * @method void trueColorToPalette(bool $dither, $ncolors) - * @method array ttfText($size, $angle, $x, $y, $color, string $fontfile, string $text) - * @property-read int $width - * @property-read int $height - * @property-read resource|\GdImage $imageResource - */ -class Image -{ - use Nette\SmartObject; - - /** {@link resize()} only shrinks images */ - public const SHRINK_ONLY = 0b0001; - - /** {@link resize()} will ignore aspect ratio */ - public const STRETCH = 0b0010; - - /** {@link resize()} fits in given area so its dimensions are less than or equal to the required dimensions */ - public const FIT = 0b0000; - - /** {@link resize()} fills given area so its dimensions are greater than or equal to the required dimensions */ - public const FILL = 0b0100; - - /** {@link resize()} fills given area exactly */ - public const EXACT = 0b1000; - - /** image types */ - public const - JPEG = IMAGETYPE_JPEG, - PNG = IMAGETYPE_PNG, - GIF = IMAGETYPE_GIF, - WEBP = IMAGETYPE_WEBP, - AVIF = 19, // IMAGETYPE_AVIF, - BMP = IMAGETYPE_BMP; - - public const EMPTY_GIF = "GIF89a\x01\x00\x01\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00!\xf9\x04\x01\x00\x00\x00\x00,\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02D\x01\x00;"; - - private const Formats = [self::JPEG => 'jpeg', self::PNG => 'png', self::GIF => 'gif', self::WEBP => 'webp', self::AVIF => 'avif', self::BMP => 'bmp']; - - /** @var resource|\GdImage */ - private $image; - - - /** - * Returns RGB color (0..255) and transparency (0..127). - */ - public static function rgb(int $red, int $green, int $blue, int $transparency = 0): array - { - return [ - 'red' => max(0, min(255, $red)), - 'green' => max(0, min(255, $green)), - 'blue' => max(0, min(255, $blue)), - 'alpha' => max(0, min(127, $transparency)), - ]; - } - - - /** - * Reads an image from a file and returns its type in $type. - * @throws Nette\NotSupportedException if gd extension is not loaded - * @throws UnknownImageFileException if file not found or file type is not known - * @return static - */ - public static function fromFile(string $file, ?int &$type = null) - { - if (!extension_loaded('gd')) { - throw new Nette\NotSupportedException('PHP extension GD is not loaded.'); - } - - $type = self::detectTypeFromFile($file); - if (!$type) { - throw new UnknownImageFileException(is_file($file) ? "Unknown type of file '$file'." : "File '$file' not found."); - } - - return self::invokeSafe('imagecreatefrom' . self::Formats[$type], $file, "Unable to open file '$file'.", __METHOD__); - } - - - /** - * Reads an image from a string and returns its type in $type. - * @return static - * @throws Nette\NotSupportedException if gd extension is not loaded - * @throws ImageException - */ - public static function fromString(string $s, ?int &$type = null) - { - if (!extension_loaded('gd')) { - throw new Nette\NotSupportedException('PHP extension GD is not loaded.'); - } - - $type = self::detectTypeFromString($s); - if (!$type) { - throw new UnknownImageFileException('Unknown type of image.'); - } - - return self::invokeSafe('imagecreatefromstring', $s, 'Unable to open image from string.', __METHOD__); - } - - - private static function invokeSafe(string $func, string $arg, string $message, string $callee): self - { - $errors = []; - $res = Callback::invokeSafe($func, [$arg], function (string $message) use (&$errors): void { - $errors[] = $message; - }); - - if (!$res) { - throw new ImageException($message . ' Errors: ' . implode(', ', $errors)); - } elseif ($errors) { - trigger_error($callee . '(): ' . implode(', ', $errors), E_USER_WARNING); - } - - return new static($res); - } - - - /** - * Creates a new true color image of the given dimensions. The default color is black. - * @return static - * @throws Nette\NotSupportedException if gd extension is not loaded - */ - public static function fromBlank(int $width, int $height, ?array $color = null) - { - if (!extension_loaded('gd')) { - throw new Nette\NotSupportedException('PHP extension GD is not loaded.'); - } - - if ($width < 1 || $height < 1) { - throw new Nette\InvalidArgumentException('Image width and height must be greater than zero.'); - } - - $image = imagecreatetruecolor($width, $height); - if ($color) { - $color += ['alpha' => 0]; - $color = imagecolorresolvealpha($image, $color['red'], $color['green'], $color['blue'], $color['alpha']); - imagealphablending($image, false); - imagefilledrectangle($image, 0, 0, $width - 1, $height - 1, $color); - imagealphablending($image, true); - } - - return new static($image); - } - - - /** - * Returns the type of image from file. - */ - public static function detectTypeFromFile(string $file, &$width = null, &$height = null): ?int - { - [$width, $height, $type] = @getimagesize($file); // @ - files smaller than 12 bytes causes read error - return isset(self::Formats[$type]) ? $type : null; - } - - - /** - * Returns the type of image from string. - */ - public static function detectTypeFromString(string $s, &$width = null, &$height = null): ?int - { - [$width, $height, $type] = @getimagesizefromstring($s); // @ - strings smaller than 12 bytes causes read error - return isset(self::Formats[$type]) ? $type : null; - } - - - /** - * Returns the file extension for the given `Image::XXX` constant. - */ - public static function typeToExtension(int $type): string - { - if (!isset(self::Formats[$type])) { - throw new Nette\InvalidArgumentException("Unsupported image type '$type'."); - } - - return self::Formats[$type]; - } - - - /** - * Returns the `Image::XXX` constant for given file extension. - */ - public static function extensionToType(string $extension): int - { - $extensions = array_flip(self::Formats) + ['jpg' => self::JPEG]; - $extension = strtolower($extension); - if (!isset($extensions[$extension])) { - throw new Nette\InvalidArgumentException("Unsupported file extension '$extension'."); - } - - return $extensions[$extension]; - } - - - /** - * Returns the mime type for the given `Image::XXX` constant. - */ - public static function typeToMimeType(int $type): string - { - return 'image/' . self::typeToExtension($type); - } - - - /** - * Wraps GD image. - * @param resource|\GdImage $image - */ - public function __construct($image) - { - $this->setImageResource($image); - imagesavealpha($image, true); - } - - - /** - * Returns image width. - */ - public function getWidth(): int - { - return imagesx($this->image); - } - - - /** - * Returns image height. - */ - public function getHeight(): int - { - return imagesy($this->image); - } - - - /** - * Sets image resource. - * @param resource|\GdImage $image - * @return static - */ - protected function setImageResource($image) - { - if (!$image instanceof \GdImage && !(is_resource($image) && get_resource_type($image) === 'gd')) { - throw new Nette\InvalidArgumentException('Image is not valid.'); - } - - $this->image = $image; - return $this; - } - - - /** - * Returns image GD resource. - * @return resource|\GdImage - */ - public function getImageResource() - { - return $this->image; - } - - - /** - * Scales an image. - * @param int|string|null $width in pixels or percent - * @param int|string|null $height in pixels or percent - * @return static - */ - public function resize($width, $height, int $flags = self::FIT) - { - if ($flags & self::EXACT) { - return $this->resize($width, $height, self::FILL)->crop('50%', '50%', $width, $height); - } - - [$newWidth, $newHeight] = static::calculateSize($this->getWidth(), $this->getHeight(), $width, $height, $flags); - - if ($newWidth !== $this->getWidth() || $newHeight !== $this->getHeight()) { // resize - $newImage = static::fromBlank($newWidth, $newHeight, self::rgb(0, 0, 0, 127))->getImageResource(); - imagecopyresampled( - $newImage, - $this->image, - 0, - 0, - 0, - 0, - $newWidth, - $newHeight, - $this->getWidth(), - $this->getHeight() - ); - $this->image = $newImage; - } - - if ($width < 0 || $height < 0) { - imageflip($this->image, $width < 0 ? ($height < 0 ? IMG_FLIP_BOTH : IMG_FLIP_HORIZONTAL) : IMG_FLIP_VERTICAL); - } - - return $this; - } - - - /** - * Calculates dimensions of resized image. - * @param int|string|null $newWidth in pixels or percent - * @param int|string|null $newHeight in pixels or percent - */ - public static function calculateSize( - int $srcWidth, - int $srcHeight, - $newWidth, - $newHeight, - int $flags = self::FIT - ): array { - if ($newWidth === null) { - } elseif (self::isPercent($newWidth)) { - $newWidth = (int) round($srcWidth / 100 * abs($newWidth)); - $percents = true; - } else { - $newWidth = abs($newWidth); - } - - if ($newHeight === null) { - } elseif (self::isPercent($newHeight)) { - $newHeight = (int) round($srcHeight / 100 * abs($newHeight)); - $flags |= empty($percents) ? 0 : self::STRETCH; - } else { - $newHeight = abs($newHeight); - } - - if ($flags & self::STRETCH) { // non-proportional - if (!$newWidth || !$newHeight) { - throw new Nette\InvalidArgumentException('For stretching must be both width and height specified.'); - } - - if ($flags & self::SHRINK_ONLY) { - $newWidth = (int) round($srcWidth * min(1, $newWidth / $srcWidth)); - $newHeight = (int) round($srcHeight * min(1, $newHeight / $srcHeight)); - } - } else { // proportional - if (!$newWidth && !$newHeight) { - throw new Nette\InvalidArgumentException('At least width or height must be specified.'); - } - - $scale = []; - if ($newWidth > 0) { // fit width - $scale[] = $newWidth / $srcWidth; - } - - if ($newHeight > 0) { // fit height - $scale[] = $newHeight / $srcHeight; - } - - if ($flags & self::FILL) { - $scale = [max($scale)]; - } - - if ($flags & self::SHRINK_ONLY) { - $scale[] = 1; - } - - $scale = min($scale); - $newWidth = (int) round($srcWidth * $scale); - $newHeight = (int) round($srcHeight * $scale); - } - - return [max($newWidth, 1), max($newHeight, 1)]; - } - - - /** - * Crops image. - * @param int|string $left in pixels or percent - * @param int|string $top in pixels or percent - * @param int|string $width in pixels or percent - * @param int|string $height in pixels or percent - * @return static - */ - public function crop($left, $top, $width, $height) - { - [$r['x'], $r['y'], $r['width'], $r['height']] - = static::calculateCutout($this->getWidth(), $this->getHeight(), $left, $top, $width, $height); - if (gd_info()['GD Version'] === 'bundled (2.1.0 compatible)') { - $this->image = imagecrop($this->image, $r); - imagesavealpha($this->image, true); - } else { - $newImage = static::fromBlank($r['width'], $r['height'], self::RGB(0, 0, 0, 127))->getImageResource(); - imagecopy($newImage, $this->image, 0, 0, $r['x'], $r['y'], $r['width'], $r['height']); - $this->image = $newImage; - } - - return $this; - } - - - /** - * Calculates dimensions of cutout in image. - * @param int|string $left in pixels or percent - * @param int|string $top in pixels or percent - * @param int|string $newWidth in pixels or percent - * @param int|string $newHeight in pixels or percent - */ - public static function calculateCutout(int $srcWidth, int $srcHeight, $left, $top, $newWidth, $newHeight): array - { - if (self::isPercent($newWidth)) { - $newWidth = (int) round($srcWidth / 100 * $newWidth); - } - - if (self::isPercent($newHeight)) { - $newHeight = (int) round($srcHeight / 100 * $newHeight); - } - - if (self::isPercent($left)) { - $left = (int) round(($srcWidth - $newWidth) / 100 * $left); - } - - if (self::isPercent($top)) { - $top = (int) round(($srcHeight - $newHeight) / 100 * $top); - } - - if ($left < 0) { - $newWidth += $left; - $left = 0; - } - - if ($top < 0) { - $newHeight += $top; - $top = 0; - } - - $newWidth = min($newWidth, $srcWidth - $left); - $newHeight = min($newHeight, $srcHeight - $top); - return [$left, $top, $newWidth, $newHeight]; - } - - - /** - * Sharpens image a little bit. - * @return static - */ - public function sharpen() - { - imageconvolution($this->image, [ // my magic numbers ;) - [-1, -1, -1], - [-1, 24, -1], - [-1, -1, -1], - ], 16, 0); - return $this; - } - - - /** - * Puts another image into this image. - * @param int|string $left in pixels or percent - * @param int|string $top in pixels or percent - * @param int $opacity 0..100 - * @return static - */ - public function place(self $image, $left = 0, $top = 0, int $opacity = 100) - { - $opacity = max(0, min(100, $opacity)); - if ($opacity === 0) { - return $this; - } - - $width = $image->getWidth(); - $height = $image->getHeight(); - - if (self::isPercent($left)) { - $left = (int) round(($this->getWidth() - $width) / 100 * $left); - } - - if (self::isPercent($top)) { - $top = (int) round(($this->getHeight() - $height) / 100 * $top); - } - - $output = $input = $image->image; - if ($opacity < 100) { - $tbl = []; - for ($i = 0; $i < 128; $i++) { - $tbl[$i] = round(127 - (127 - $i) * $opacity / 100); - } - - $output = imagecreatetruecolor($width, $height); - imagealphablending($output, false); - if (!$image->isTrueColor()) { - $input = $output; - imagefilledrectangle($output, 0, 0, $width, $height, imagecolorallocatealpha($output, 0, 0, 0, 127)); - imagecopy($output, $image->image, 0, 0, 0, 0, $width, $height); - } - - for ($x = 0; $x < $width; $x++) { - for ($y = 0; $y < $height; $y++) { - $c = \imagecolorat($input, $x, $y); - $c = ($c & 0xFFFFFF) + ($tbl[$c >> 24] << 24); - \imagesetpixel($output, $x, $y, $c); - } - } - - imagealphablending($output, true); - } - - imagecopy( - $this->image, - $output, - $left, - $top, - 0, - 0, - $width, - $height - ); - return $this; - } - - - /** - * Saves image to the file. Quality is in the range 0..100 for JPEG (default 85), WEBP (default 80) and AVIF (default 30) and 0..9 for PNG (default 9). - * @throws ImageException - */ - public function save(string $file, ?int $quality = null, ?int $type = null): void - { - $type = $type ?? self::extensionToType(pathinfo($file, PATHINFO_EXTENSION)); - $this->output($type, $quality, $file); - } - - - /** - * Outputs image to string. Quality is in the range 0..100 for JPEG (default 85), WEBP (default 80) and AVIF (default 30) and 0..9 for PNG (default 9). - */ - public function toString(int $type = self::JPEG, ?int $quality = null): string - { - return Helpers::capture(function () use ($type, $quality) { - $this->output($type, $quality); - }); - } - - - /** - * Outputs image to string. - */ - public function __toString(): string - { - try { - return $this->toString(); - } catch (\Throwable $e) { - if (func_num_args() || PHP_VERSION_ID >= 70400) { - throw $e; - } - - trigger_error('Exception in ' . __METHOD__ . "(): {$e->getMessage()} in {$e->getFile()}:{$e->getLine()}", E_USER_ERROR); - return ''; - } - } - - - /** - * Outputs image to browser. Quality is in the range 0..100 for JPEG (default 85), WEBP (default 80) and AVIF (default 30) and 0..9 for PNG (default 9). - * @throws ImageException - */ - public function send(int $type = self::JPEG, ?int $quality = null): void - { - header('Content-Type: ' . self::typeToMimeType($type)); - $this->output($type, $quality); - } - - - /** - * Outputs image to browser or file. - * @throws ImageException - */ - private function output(int $type, ?int $quality, ?string $file = null): void - { - switch ($type) { - case self::JPEG: - $quality = $quality === null ? 85 : max(0, min(100, $quality)); - $success = @imagejpeg($this->image, $file, $quality); // @ is escalated to exception - break; - - case self::PNG: - $quality = $quality === null ? 9 : max(0, min(9, $quality)); - $success = @imagepng($this->image, $file, $quality); // @ is escalated to exception - break; - - case self::GIF: - $success = @imagegif($this->image, $file); // @ is escalated to exception - break; - - case self::WEBP: - $quality = $quality === null ? 80 : max(0, min(100, $quality)); - $success = @imagewebp($this->image, $file, $quality); // @ is escalated to exception - break; - - case self::AVIF: - $quality = $quality === null ? 30 : max(0, min(100, $quality)); - $success = @imageavif($this->image, $file, $quality); // @ is escalated to exception - break; - - case self::BMP: - $success = @imagebmp($this->image, $file); // @ is escalated to exception - break; - - default: - throw new Nette\InvalidArgumentException("Unsupported image type '$type'."); - } - - if (!$success) { - throw new ImageException(Helpers::getLastError() ?: 'Unknown error'); - } - } - - - /** - * Call to undefined method. - * @return mixed - * @throws Nette\MemberAccessException - */ - public function __call(string $name, array $args) - { - $function = 'image' . $name; - if (!function_exists($function)) { - ObjectHelpers::strictCall(static::class, $name); - } - - foreach ($args as $key => $value) { - if ($value instanceof self) { - $args[$key] = $value->getImageResource(); - - } elseif (is_array($value) && isset($value['red'])) { // rgb - $args[$key] = imagecolorallocatealpha( - $this->image, - $value['red'], - $value['green'], - $value['blue'], - $value['alpha'] - ) ?: imagecolorresolvealpha( - $this->image, - $value['red'], - $value['green'], - $value['blue'], - $value['alpha'] - ); - } - } - - $res = $function($this->image, ...$args); - return $res instanceof \GdImage || (is_resource($res) && get_resource_type($res) === 'gd') - ? $this->setImageResource($res) - : $res; - } - - - public function __clone() - { - ob_start(function () {}); - imagepng($this->image, null, 0); - $this->setImageResource(imagecreatefromstring(ob_get_clean())); - } - - - /** - * @param int|string $num in pixels or percent - */ - private static function isPercent(&$num): bool - { - if (is_string($num) && substr($num, -1) === '%') { - $num = (float) substr($num, 0, -1); - return true; - } elseif (is_int($num) || $num === (string) (int) $num) { - $num = (int) $num; - return false; - } - - throw new Nette\InvalidArgumentException("Expected dimension in int|string, '$num' given."); - } - - - /** - * Prevents serialization. - */ - public function __sleep(): array - { - throw new Nette\NotSupportedException('You cannot serialize or unserialize ' . self::class . ' instances.'); - } -} diff --git a/vendor/nette/utils/src/Utils/Json.php b/vendor/nette/utils/src/Utils/Json.php deleted file mode 100644 index 91b8f56d..00000000 --- a/vendor/nette/utils/src/Utils/Json.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette\Utils; - -use Nette; - - -/** - * JSON encoder and decoder. - */ -final class Json -{ - use Nette\StaticClass; - - public const FORCE_ARRAY = JSON_OBJECT_AS_ARRAY; - public const PRETTY = JSON_PRETTY_PRINT; - public const ESCAPE_UNICODE = 1 << 19; - - - /** - * Converts value to JSON format. The flag can be Json::PRETTY, which formats JSON for easier reading and clarity, - * and Json::ESCAPE_UNICODE for ASCII output. - * @param mixed $value - * @throws JsonException - */ - public static function encode($value, int $flags = 0): string - { - $flags = ($flags & self::ESCAPE_UNICODE ? 0 : JSON_UNESCAPED_UNICODE) - | JSON_UNESCAPED_SLASHES - | ($flags & ~self::ESCAPE_UNICODE) - | (defined('JSON_PRESERVE_ZERO_FRACTION') ? JSON_PRESERVE_ZERO_FRACTION : 0); // since PHP 5.6.6 & PECL JSON-C 1.3.7 - - $json = json_encode($value, $flags); - if ($error = json_last_error()) { - throw new JsonException(json_last_error_msg(), $error); - } - - return $json; - } - - - /** - * Parses JSON to PHP value. The flag can be Json::FORCE_ARRAY, which forces an array instead of an object as the return value. - * @return mixed - * @throws JsonException - */ - public static function decode(string $json, int $flags = 0) - { - $value = json_decode($json, null, 512, $flags | JSON_BIGINT_AS_STRING); - if ($error = json_last_error()) { - throw new JsonException(json_last_error_msg(), $error); - } - - return $value; - } -} diff --git a/vendor/nette/utils/src/Utils/ObjectHelpers.php b/vendor/nette/utils/src/Utils/ObjectHelpers.php deleted file mode 100644 index 6cdfc585..00000000 --- a/vendor/nette/utils/src/Utils/ObjectHelpers.php +++ /dev/null @@ -1,228 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette\Utils; - -use Nette; -use Nette\MemberAccessException; - - -/** - * Nette\SmartObject helpers. - */ -final class ObjectHelpers -{ - use Nette\StaticClass; - - /** - * @return never - * @throws MemberAccessException - */ - public static function strictGet(string $class, string $name): void - { - $rc = new \ReflectionClass($class); - $hint = self::getSuggestion(array_merge( - array_filter($rc->getProperties(\ReflectionProperty::IS_PUBLIC), function ($p) { return !$p->isStatic(); }), - self::parseFullDoc($rc, '~^[ \t*]*@property(?:-read)?[ \t]+(?:\S+[ \t]+)??\$(\w+)~m') - ), $name); - throw new MemberAccessException("Cannot read an undeclared property $class::\$$name" . ($hint ? ", did you mean \$$hint?" : '.')); - } - - - /** - * @return never - * @throws MemberAccessException - */ - public static function strictSet(string $class, string $name): void - { - $rc = new \ReflectionClass($class); - $hint = self::getSuggestion(array_merge( - array_filter($rc->getProperties(\ReflectionProperty::IS_PUBLIC), function ($p) { return !$p->isStatic(); }), - self::parseFullDoc($rc, '~^[ \t*]*@property(?:-write)?[ \t]+(?:\S+[ \t]+)??\$(\w+)~m') - ), $name); - throw new MemberAccessException("Cannot write to an undeclared property $class::\$$name" . ($hint ? ", did you mean \$$hint?" : '.')); - } - - - /** - * @return never - * @throws MemberAccessException - */ - public static function strictCall(string $class, string $method, array $additionalMethods = []): void - { - $trace = debug_backtrace(0, 3); // suppose this method is called from __call() - $context = ($trace[1]['function'] ?? null) === '__call' - ? ($trace[2]['class'] ?? null) - : null; - - if ($context && is_a($class, $context, true) && method_exists($context, $method)) { // called parent::$method() - $class = get_parent_class($context); - } - - if (method_exists($class, $method)) { // insufficient visibility - $rm = new \ReflectionMethod($class, $method); - $visibility = $rm->isPrivate() - ? 'private ' - : ($rm->isProtected() ? 'protected ' : ''); - throw new MemberAccessException("Call to {$visibility}method $class::$method() from " . ($context ? "scope $context." : 'global scope.')); - - } else { - $hint = self::getSuggestion(array_merge( - get_class_methods($class), - self::parseFullDoc(new \ReflectionClass($class), '~^[ \t*]*@method[ \t]+(?:static[ \t]+)?(?:\S+[ \t]+)??(\w+)\(~m'), - $additionalMethods - ), $method); - throw new MemberAccessException("Call to undefined method $class::$method()" . ($hint ? ", did you mean $hint()?" : '.')); - } - } - - - /** - * @return never - * @throws MemberAccessException - */ - public static function strictStaticCall(string $class, string $method): void - { - $trace = debug_backtrace(0, 3); // suppose this method is called from __callStatic() - $context = ($trace[1]['function'] ?? null) === '__callStatic' - ? ($trace[2]['class'] ?? null) - : null; - - if ($context && is_a($class, $context, true) && method_exists($context, $method)) { // called parent::$method() - $class = get_parent_class($context); - } - - if (method_exists($class, $method)) { // insufficient visibility - $rm = new \ReflectionMethod($class, $method); - $visibility = $rm->isPrivate() - ? 'private ' - : ($rm->isProtected() ? 'protected ' : ''); - throw new MemberAccessException("Call to {$visibility}method $class::$method() from " . ($context ? "scope $context." : 'global scope.')); - - } else { - $hint = self::getSuggestion( - array_filter((new \ReflectionClass($class))->getMethods(\ReflectionMethod::IS_PUBLIC), function ($m) { return $m->isStatic(); }), - $method - ); - throw new MemberAccessException("Call to undefined static method $class::$method()" . ($hint ? ", did you mean $hint()?" : '.')); - } - } - - - /** - * Returns array of magic properties defined by annotation @property. - * @return array of [name => bit mask] - * @internal - */ - public static function getMagicProperties(string $class): array - { - static $cache; - $props = &$cache[$class]; - if ($props !== null) { - return $props; - } - - $rc = new \ReflectionClass($class); - preg_match_all( - '~^ [ \t*]* @property(|-read|-write|-deprecated) [ \t]+ [^\s$]+ [ \t]+ \$ (\w+) ()~mx', - (string) $rc->getDocComment(), - $matches, - PREG_SET_ORDER - ); - - $props = []; - foreach ($matches as [, $type, $name]) { - $uname = ucfirst($name); - $write = $type !== '-read' - && $rc->hasMethod($nm = 'set' . $uname) - && ($rm = $rc->getMethod($nm))->name === $nm && !$rm->isPrivate() && !$rm->isStatic(); - $read = $type !== '-write' - && ($rc->hasMethod($nm = 'get' . $uname) || $rc->hasMethod($nm = 'is' . $uname)) - && ($rm = $rc->getMethod($nm))->name === $nm && !$rm->isPrivate() && !$rm->isStatic(); - - if ($read || $write) { - $props[$name] = $read << 0 | ($nm[0] === 'g') << 1 | $rm->returnsReference() << 2 | $write << 3 | ($type === '-deprecated') << 4; - } - } - - foreach ($rc->getTraits() as $trait) { - $props += self::getMagicProperties($trait->name); - } - - if ($parent = get_parent_class($class)) { - $props += self::getMagicProperties($parent); - } - - return $props; - } - - - /** - * Finds the best suggestion (for 8-bit encoding). - * @param (\ReflectionFunctionAbstract|\ReflectionParameter|\ReflectionClass|\ReflectionProperty|string)[] $possibilities - * @internal - */ - public static function getSuggestion(array $possibilities, string $value): ?string - { - $norm = preg_replace($re = '#^(get|set|has|is|add)(?=[A-Z])#', '+', $value); - $best = null; - $min = (strlen($value) / 4 + 1) * 10 + .1; - foreach (array_unique($possibilities, SORT_REGULAR) as $item) { - $item = $item instanceof \Reflector ? $item->name : $item; - if ($item !== $value && ( - ($len = levenshtein($item, $value, 10, 11, 10)) < $min - || ($len = levenshtein(preg_replace($re, '*', $item), $norm, 10, 11, 10)) < $min - )) { - $min = $len; - $best = $item; - } - } - - return $best; - } - - - private static function parseFullDoc(\ReflectionClass $rc, string $pattern): array - { - do { - $doc[] = $rc->getDocComment(); - $traits = $rc->getTraits(); - while ($trait = array_pop($traits)) { - $doc[] = $trait->getDocComment(); - $traits += $trait->getTraits(); - } - } while ($rc = $rc->getParentClass()); - - return preg_match_all($pattern, implode($doc), $m) ? $m[1] : []; - } - - - /** - * Checks if the public non-static property exists. - * @return bool|string returns 'event' if the property exists and has event like name - * @internal - */ - public static function hasProperty(string $class, string $name) - { - static $cache; - $prop = &$cache[$class][$name]; - if ($prop === null) { - $prop = false; - try { - $rp = new \ReflectionProperty($class, $name); - if ($rp->isPublic() && !$rp->isStatic()) { - $prop = $name >= 'onA' && $name < 'on_' ? 'event' : true; - } - } catch (\ReflectionException $e) { - } - } - - return $prop; - } -} diff --git a/vendor/nette/utils/src/Utils/ObjectMixin.php b/vendor/nette/utils/src/Utils/ObjectMixin.php deleted file mode 100644 index 33249509..00000000 --- a/vendor/nette/utils/src/Utils/ObjectMixin.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette\Utils; - -use Nette; - - -/** - * Nette\Object behaviour mixin. - * @deprecated - */ -final class ObjectMixin -{ - use Nette\StaticClass; - - /** @deprecated use ObjectHelpers::getSuggestion() */ - public static function getSuggestion(array $possibilities, string $value): ?string - { - trigger_error(__METHOD__ . '() has been renamed to Nette\Utils\ObjectHelpers::getSuggestion()', E_USER_DEPRECATED); - return ObjectHelpers::getSuggestion($possibilities, $value); - } - - - public static function setExtensionMethod(): void - { - trigger_error('Class Nette\Utils\ObjectMixin is deprecated', E_USER_DEPRECATED); - } - - - public static function getExtensionMethod(): void - { - trigger_error('Class Nette\Utils\ObjectMixin is deprecated', E_USER_DEPRECATED); - } -} diff --git a/vendor/nette/utils/src/Utils/Paginator.php b/vendor/nette/utils/src/Utils/Paginator.php deleted file mode 100644 index 4517a8cc..00000000 --- a/vendor/nette/utils/src/Utils/Paginator.php +++ /dev/null @@ -1,242 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette\Utils; - -use Nette; - - -/** - * Paginating math. - * - * @property int $page - * @property-read int $firstPage - * @property-read int|null $lastPage - * @property-read int $firstItemOnPage - * @property-read int $lastItemOnPage - * @property int $base - * @property-read bool $first - * @property-read bool $last - * @property-read int|null $pageCount - * @property int $itemsPerPage - * @property int|null $itemCount - * @property-read int $offset - * @property-read int|null $countdownOffset - * @property-read int $length - */ -class Paginator -{ - use Nette\SmartObject; - - /** @var int */ - private $base = 1; - - /** @var int */ - private $itemsPerPage = 1; - - /** @var int */ - private $page = 1; - - /** @var int|null */ - private $itemCount; - - - /** - * Sets current page number. - * @return static - */ - public function setPage(int $page) - { - $this->page = $page; - return $this; - } - - - /** - * Returns current page number. - */ - public function getPage(): int - { - return $this->base + $this->getPageIndex(); - } - - - /** - * Returns first page number. - */ - public function getFirstPage(): int - { - return $this->base; - } - - - /** - * Returns last page number. - */ - public function getLastPage(): ?int - { - return $this->itemCount === null - ? null - : $this->base + max(0, $this->getPageCount() - 1); - } - - - /** - * Returns the sequence number of the first element on the page - */ - public function getFirstItemOnPage(): int - { - return $this->itemCount !== 0 - ? $this->offset + 1 - : 0; - } - - - /** - * Returns the sequence number of the last element on the page - */ - public function getLastItemOnPage(): int - { - return $this->offset + $this->length; - } - - - /** - * Sets first page (base) number. - * @return static - */ - public function setBase(int $base) - { - $this->base = $base; - return $this; - } - - - /** - * Returns first page (base) number. - */ - public function getBase(): int - { - return $this->base; - } - - - /** - * Returns zero-based page number. - */ - protected function getPageIndex(): int - { - $index = max(0, $this->page - $this->base); - return $this->itemCount === null - ? $index - : min($index, max(0, $this->getPageCount() - 1)); - } - - - /** - * Is the current page the first one? - */ - public function isFirst(): bool - { - return $this->getPageIndex() === 0; - } - - - /** - * Is the current page the last one? - */ - public function isLast(): bool - { - return $this->itemCount === null - ? false - : $this->getPageIndex() >= $this->getPageCount() - 1; - } - - - /** - * Returns the total number of pages. - */ - public function getPageCount(): ?int - { - return $this->itemCount === null - ? null - : (int) ceil($this->itemCount / $this->itemsPerPage); - } - - - /** - * Sets the number of items to display on a single page. - * @return static - */ - public function setItemsPerPage(int $itemsPerPage) - { - $this->itemsPerPage = max(1, $itemsPerPage); - return $this; - } - - - /** - * Returns the number of items to display on a single page. - */ - public function getItemsPerPage(): int - { - return $this->itemsPerPage; - } - - - /** - * Sets the total number of items. - * @return static - */ - public function setItemCount(?int $itemCount = null) - { - $this->itemCount = $itemCount === null ? null : max(0, $itemCount); - return $this; - } - - - /** - * Returns the total number of items. - */ - public function getItemCount(): ?int - { - return $this->itemCount; - } - - - /** - * Returns the absolute index of the first item on current page. - */ - public function getOffset(): int - { - return $this->getPageIndex() * $this->itemsPerPage; - } - - - /** - * Returns the absolute index of the first item on current page in countdown paging. - */ - public function getCountdownOffset(): ?int - { - return $this->itemCount === null - ? null - : max(0, $this->itemCount - ($this->getPageIndex() + 1) * $this->itemsPerPage); - } - - - /** - * Returns the number of items on current page. - */ - public function getLength(): int - { - return $this->itemCount === null - ? $this->itemsPerPage - : min($this->itemsPerPage, $this->itemCount - $this->getPageIndex() * $this->itemsPerPage); - } -} diff --git a/vendor/nette/utils/src/Utils/Random.php b/vendor/nette/utils/src/Utils/Random.php deleted file mode 100644 index f900628a..00000000 --- a/vendor/nette/utils/src/Utils/Random.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette\Utils; - -use Nette; - - -/** - * Secure random string generator. - */ -final class Random -{ - use Nette\StaticClass; - - /** - * Generates a random string of given length from characters specified in second argument. - * Supports intervals, such as `0-9` or `A-Z`. - */ - public static function generate(int $length = 10, string $charlist = '0-9a-z'): string - { - $charlist = count_chars(preg_replace_callback('#.-.#', function (array $m): string { - return implode('', range($m[0][0], $m[0][2])); - }, $charlist), 3); - $chLen = strlen($charlist); - - if ($length < 1) { - throw new Nette\InvalidArgumentException('Length must be greater than zero.'); - } elseif ($chLen < 2) { - throw new Nette\InvalidArgumentException('Character list must contain at least two chars.'); - } - - $res = ''; - for ($i = 0; $i < $length; $i++) { - $res .= $charlist[random_int(0, $chLen - 1)]; - } - - return $res; - } -} diff --git a/vendor/nette/utils/src/Utils/Reflection.php b/vendor/nette/utils/src/Utils/Reflection.php deleted file mode 100644 index a69ed126..00000000 --- a/vendor/nette/utils/src/Utils/Reflection.php +++ /dev/null @@ -1,425 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette\Utils; - -use Nette; - - -/** - * PHP reflection helpers. - */ -final class Reflection -{ - use Nette\StaticClass; - - private const BuiltinTypes = [ - 'string' => 1, 'int' => 1, 'float' => 1, 'bool' => 1, 'array' => 1, 'object' => 1, - 'callable' => 1, 'iterable' => 1, 'void' => 1, 'null' => 1, 'mixed' => 1, 'false' => 1, - 'never' => 1, - ]; - - private const ClassKeywords = [ - 'self' => 1, 'parent' => 1, 'static' => 1, - ]; - - - /** - * Determines if type is PHP built-in type. Otherwise, it is the class name. - */ - public static function isBuiltinType(string $type): bool - { - return isset(self::BuiltinTypes[strtolower($type)]); - } - - - /** - * Determines if type is special class name self/parent/static. - */ - public static function isClassKeyword(string $name): bool - { - return isset(self::ClassKeywords[strtolower($name)]); - } - - - /** - * Returns the type of return value of given function or method and normalizes `self`, `static`, and `parent` to actual class names. - * If the function does not have a return type, it returns null. - * If the function has union or intersection type, it throws Nette\InvalidStateException. - */ - public static function getReturnType(\ReflectionFunctionAbstract $func): ?string - { - $type = $func->getReturnType() ?? (PHP_VERSION_ID >= 80100 && $func instanceof \ReflectionMethod ? $func->getTentativeReturnType() : null); - return self::getType($func, $type); - } - - - /** - * @deprecated - */ - public static function getReturnTypes(\ReflectionFunctionAbstract $func): array - { - $type = Type::fromReflection($func); - return $type ? $type->getNames() : []; - } - - - /** - * Returns the type of given parameter and normalizes `self` and `parent` to the actual class names. - * If the parameter does not have a type, it returns null. - * If the parameter has union or intersection type, it throws Nette\InvalidStateException. - */ - public static function getParameterType(\ReflectionParameter $param): ?string - { - return self::getType($param, $param->getType()); - } - - - /** - * @deprecated - */ - public static function getParameterTypes(\ReflectionParameter $param): array - { - $type = Type::fromReflection($param); - return $type ? $type->getNames() : []; - } - - - /** - * Returns the type of given property and normalizes `self` and `parent` to the actual class names. - * If the property does not have a type, it returns null. - * If the property has union or intersection type, it throws Nette\InvalidStateException. - */ - public static function getPropertyType(\ReflectionProperty $prop): ?string - { - return self::getType($prop, PHP_VERSION_ID >= 70400 ? $prop->getType() : null); - } - - - /** - * @deprecated - */ - public static function getPropertyTypes(\ReflectionProperty $prop): array - { - $type = Type::fromReflection($prop); - return $type ? $type->getNames() : []; - } - - - /** - * @param \ReflectionFunction|\ReflectionMethod|\ReflectionParameter|\ReflectionProperty $reflection - */ - private static function getType($reflection, ?\ReflectionType $type): ?string - { - if ($type === null) { - return null; - - } elseif ($type instanceof \ReflectionNamedType) { - return Type::resolve($type->getName(), $reflection); - - } elseif ($type instanceof \ReflectionUnionType || $type instanceof \ReflectionIntersectionType) { - throw new Nette\InvalidStateException('The ' . self::toString($reflection) . ' is not expected to have a union or intersection type.'); - - } else { - throw new Nette\InvalidStateException('Unexpected type of ' . self::toString($reflection)); - } - } - - - /** - * Returns the default value of parameter. If it is a constant, it returns its value. - * @return mixed - * @throws \ReflectionException If the parameter does not have a default value or the constant cannot be resolved - */ - public static function getParameterDefaultValue(\ReflectionParameter $param) - { - if ($param->isDefaultValueConstant()) { - $const = $orig = $param->getDefaultValueConstantName(); - $pair = explode('::', $const); - if (isset($pair[1])) { - $pair[0] = Type::resolve($pair[0], $param); - try { - $rcc = new \ReflectionClassConstant($pair[0], $pair[1]); - } catch (\ReflectionException $e) { - $name = self::toString($param); - throw new \ReflectionException("Unable to resolve constant $orig used as default value of $name.", 0, $e); - } - - return $rcc->getValue(); - - } elseif (!defined($const)) { - $const = substr((string) strrchr($const, '\\'), 1); - if (!defined($const)) { - $name = self::toString($param); - throw new \ReflectionException("Unable to resolve constant $orig used as default value of $name."); - } - } - - return constant($const); - } - - return $param->getDefaultValue(); - } - - - /** - * Returns a reflection of a class or trait that contains a declaration of given property. Property can also be declared in the trait. - */ - public static function getPropertyDeclaringClass(\ReflectionProperty $prop): \ReflectionClass - { - foreach ($prop->getDeclaringClass()->getTraits() as $trait) { - if ($trait->hasProperty($prop->name) - // doc-comment guessing as workaround for insufficient PHP reflection - && $trait->getProperty($prop->name)->getDocComment() === $prop->getDocComment() - ) { - return self::getPropertyDeclaringClass($trait->getProperty($prop->name)); - } - } - - return $prop->getDeclaringClass(); - } - - - /** - * Returns a reflection of a method that contains a declaration of $method. - * Usually, each method is its own declaration, but the body of the method can also be in the trait and under a different name. - */ - public static function getMethodDeclaringMethod(\ReflectionMethod $method): \ReflectionMethod - { - // file & line guessing as workaround for insufficient PHP reflection - $decl = $method->getDeclaringClass(); - if ($decl->getFileName() === $method->getFileName() - && $decl->getStartLine() <= $method->getStartLine() - && $decl->getEndLine() >= $method->getEndLine() - ) { - return $method; - } - - $hash = [$method->getFileName(), $method->getStartLine(), $method->getEndLine()]; - if (($alias = $decl->getTraitAliases()[$method->name] ?? null) - && ($m = new \ReflectionMethod($alias)) - && $hash === [$m->getFileName(), $m->getStartLine(), $m->getEndLine()] - ) { - return self::getMethodDeclaringMethod($m); - } - - foreach ($decl->getTraits() as $trait) { - if ($trait->hasMethod($method->name) - && ($m = $trait->getMethod($method->name)) - && $hash === [$m->getFileName(), $m->getStartLine(), $m->getEndLine()] - ) { - return self::getMethodDeclaringMethod($m); - } - } - - return $method; - } - - - /** - * Finds out if reflection has access to PHPdoc comments. Comments may not be available due to the opcode cache. - */ - public static function areCommentsAvailable(): bool - { - static $res; - return $res ?? $res = (bool) (new \ReflectionMethod(__METHOD__))->getDocComment(); - } - - - public static function toString(\Reflector $ref): string - { - if ($ref instanceof \ReflectionClass) { - return $ref->name; - } elseif ($ref instanceof \ReflectionMethod) { - return $ref->getDeclaringClass()->name . '::' . $ref->name . '()'; - } elseif ($ref instanceof \ReflectionFunction) { - return $ref->name . '()'; - } elseif ($ref instanceof \ReflectionProperty) { - return self::getPropertyDeclaringClass($ref)->name . '::$' . $ref->name; - } elseif ($ref instanceof \ReflectionParameter) { - return '$' . $ref->name . ' in ' . self::toString($ref->getDeclaringFunction()); - } else { - throw new Nette\InvalidArgumentException; - } - } - - - /** - * Expands the name of the class to full name in the given context of given class. - * Thus, it returns how the PHP parser would understand $name if it were written in the body of the class $context. - * @throws Nette\InvalidArgumentException - */ - public static function expandClassName(string $name, \ReflectionClass $context): string - { - $lower = strtolower($name); - if (empty($name)) { - throw new Nette\InvalidArgumentException('Class name must not be empty.'); - - } elseif (isset(self::BuiltinTypes[$lower])) { - return $lower; - - } elseif ($lower === 'self' || $lower === 'static') { - return $context->name; - - } elseif ($lower === 'parent') { - return $context->getParentClass() - ? $context->getParentClass()->name - : 'parent'; - - } elseif ($name[0] === '\\') { // fully qualified name - return ltrim($name, '\\'); - } - - $uses = self::getUseStatements($context); - $parts = explode('\\', $name, 2); - if (isset($uses[$parts[0]])) { - $parts[0] = $uses[$parts[0]]; - return implode('\\', $parts); - - } elseif ($context->inNamespace()) { - return $context->getNamespaceName() . '\\' . $name; - - } else { - return $name; - } - } - - - /** @return array of [alias => class] */ - public static function getUseStatements(\ReflectionClass $class): array - { - if ($class->isAnonymous()) { - throw new Nette\NotImplementedException('Anonymous classes are not supported.'); - } - - static $cache = []; - if (!isset($cache[$name = $class->name])) { - if ($class->isInternal()) { - $cache[$name] = []; - } else { - $code = file_get_contents($class->getFileName()); - $cache = self::parseUseStatements($code, $name) + $cache; - } - } - - return $cache[$name]; - } - - - /** - * Parses PHP code to [class => [alias => class, ...]] - */ - private static function parseUseStatements(string $code, ?string $forClass = null): array - { - try { - $tokens = token_get_all($code, TOKEN_PARSE); - } catch (\ParseError $e) { - trigger_error($e->getMessage(), E_USER_NOTICE); - $tokens = []; - } - - $namespace = $class = $classLevel = $level = null; - $res = $uses = []; - - $nameTokens = PHP_VERSION_ID < 80000 - ? [T_STRING, T_NS_SEPARATOR] - : [T_STRING, T_NS_SEPARATOR, T_NAME_QUALIFIED, T_NAME_FULLY_QUALIFIED]; - - while ($token = current($tokens)) { - next($tokens); - switch (is_array($token) ? $token[0] : $token) { - case T_NAMESPACE: - $namespace = ltrim(self::fetch($tokens, $nameTokens) . '\\', '\\'); - $uses = []; - break; - - case T_CLASS: - case T_INTERFACE: - case T_TRAIT: - case PHP_VERSION_ID < 80100 - ? T_CLASS - : T_ENUM: - if ($name = self::fetch($tokens, T_STRING)) { - $class = $namespace . $name; - $classLevel = $level + 1; - $res[$class] = $uses; - if ($class === $forClass) { - return $res; - } - } - - break; - - case T_USE: - while (!$class && ($name = self::fetch($tokens, $nameTokens))) { - $name = ltrim($name, '\\'); - if (self::fetch($tokens, '{')) { - while ($suffix = self::fetch($tokens, $nameTokens)) { - if (self::fetch($tokens, T_AS)) { - $uses[self::fetch($tokens, T_STRING)] = $name . $suffix; - } else { - $tmp = explode('\\', $suffix); - $uses[end($tmp)] = $name . $suffix; - } - - if (!self::fetch($tokens, ',')) { - break; - } - } - } elseif (self::fetch($tokens, T_AS)) { - $uses[self::fetch($tokens, T_STRING)] = $name; - - } else { - $tmp = explode('\\', $name); - $uses[end($tmp)] = $name; - } - - if (!self::fetch($tokens, ',')) { - break; - } - } - - break; - - case T_CURLY_OPEN: - case T_DOLLAR_OPEN_CURLY_BRACES: - case '{': - $level++; - break; - - case '}': - if ($level === $classLevel) { - $class = $classLevel = null; - } - - $level--; - } - } - - return $res; - } - - - private static function fetch(array &$tokens, $take): ?string - { - $res = null; - while ($token = current($tokens)) { - [$token, $s] = is_array($token) ? $token : [$token, $token]; - if (in_array($token, (array) $take, true)) { - $res .= $s; - } elseif (!in_array($token, [T_DOC_COMMENT, T_WHITESPACE, T_COMMENT], true)) { - break; - } - - next($tokens); - } - - return $res; - } -} diff --git a/vendor/nette/utils/src/Utils/Strings.php b/vendor/nette/utils/src/Utils/Strings.php deleted file mode 100644 index 1314c62f..00000000 --- a/vendor/nette/utils/src/Utils/Strings.php +++ /dev/null @@ -1,569 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette\Utils; - -use Nette; -use function is_array, is_object, strlen; - - -/** - * String tools library. - */ -class Strings -{ - use Nette\StaticClass; - - public const TRIM_CHARACTERS = " \t\n\r\0\x0B\u{A0}"; - - - /** - * Checks if the string is valid in UTF-8 encoding. - */ - public static function checkEncoding(string $s): bool - { - return $s === self::fixEncoding($s); - } - - - /** - * Removes all invalid UTF-8 characters from a string. - */ - public static function fixEncoding(string $s): string - { - // removes xD800-xDFFF, x110000 and higher - return htmlspecialchars_decode(htmlspecialchars($s, ENT_NOQUOTES | ENT_IGNORE, 'UTF-8'), ENT_NOQUOTES); - } - - - /** - * Returns a specific character in UTF-8 from code point (number in range 0x0000..D7FF or 0xE000..10FFFF). - * @throws Nette\InvalidArgumentException if code point is not in valid range - */ - public static function chr(int $code): string - { - if ($code < 0 || ($code >= 0xD800 && $code <= 0xDFFF) || $code > 0x10FFFF) { - throw new Nette\InvalidArgumentException('Code point must be in range 0x0 to 0xD7FF or 0xE000 to 0x10FFFF.'); - } elseif (!extension_loaded('iconv')) { - throw new Nette\NotSupportedException(__METHOD__ . '() requires ICONV extension that is not loaded.'); - } - - return iconv('UTF-32BE', 'UTF-8//IGNORE', pack('N', $code)); - } - - - /** - * Starts the $haystack string with the prefix $needle? - */ - public static function startsWith(string $haystack, string $needle): bool - { - return strncmp($haystack, $needle, strlen($needle)) === 0; - } - - - /** - * Ends the $haystack string with the suffix $needle? - */ - public static function endsWith(string $haystack, string $needle): bool - { - return $needle === '' || substr($haystack, -strlen($needle)) === $needle; - } - - - /** - * Does $haystack contain $needle? - */ - public static function contains(string $haystack, string $needle): bool - { - return strpos($haystack, $needle) !== false; - } - - - /** - * Returns a part of UTF-8 string specified by starting position and length. If start is negative, - * the returned string will start at the start'th character from the end of string. - */ - public static function substring(string $s, int $start, ?int $length = null): string - { - if (function_exists('mb_substr')) { - return mb_substr($s, $start, $length, 'UTF-8'); // MB is much faster - } elseif (!extension_loaded('iconv')) { - throw new Nette\NotSupportedException(__METHOD__ . '() requires extension ICONV or MBSTRING, neither is loaded.'); - } elseif ($length === null) { - $length = self::length($s); - } elseif ($start < 0 && $length < 0) { - $start += self::length($s); // unifies iconv_substr behavior with mb_substr - } - - return iconv_substr($s, $start, $length, 'UTF-8'); - } - - - /** - * Removes control characters, normalizes line breaks to `\n`, removes leading and trailing blank lines, - * trims end spaces on lines, normalizes UTF-8 to the normal form of NFC. - */ - public static function normalize(string $s): string - { - // convert to compressed normal form (NFC) - if (class_exists('Normalizer', false) && ($n = \Normalizer::normalize($s, \Normalizer::FORM_C)) !== false) { - $s = $n; - } - - $s = self::normalizeNewLines($s); - - // remove control characters; leave \t + \n - $s = self::pcre('preg_replace', ['#[\x00-\x08\x0B-\x1F\x7F-\x9F]+#u', '', $s]); - - // right trim - $s = self::pcre('preg_replace', ['#[\t ]+$#m', '', $s]); - - // leading and trailing blank lines - $s = trim($s, "\n"); - - return $s; - } - - - /** - * Standardize line endings to unix-like. - */ - public static function normalizeNewLines(string $s): string - { - return str_replace(["\r\n", "\r"], "\n", $s); - } - - - /** - * Converts UTF-8 string to ASCII, ie removes diacritics etc. - */ - public static function toAscii(string $s): string - { - $iconv = defined('ICONV_IMPL') ? trim(ICONV_IMPL, '"\'') : null; - static $transliterator = null; - if ($transliterator === null) { - if (class_exists('Transliterator', false)) { - $transliterator = \Transliterator::create('Any-Latin; Latin-ASCII'); - } else { - trigger_error(__METHOD__ . "(): it is recommended to enable PHP extensions 'intl'.", E_USER_NOTICE); - $transliterator = false; - } - } - - // remove control characters and check UTF-8 validity - $s = self::pcre('preg_replace', ['#[^\x09\x0A\x0D\x20-\x7E\xA0-\x{2FF}\x{370}-\x{10FFFF}]#u', '', $s]); - - // transliteration (by Transliterator and iconv) is not optimal, replace some characters directly - $s = strtr($s, ["\u{201E}" => '"', "\u{201C}" => '"', "\u{201D}" => '"', "\u{201A}" => "'", "\u{2018}" => "'", "\u{2019}" => "'", "\u{B0}" => '^', "\u{42F}" => 'Ya', "\u{44F}" => 'ya', "\u{42E}" => 'Yu', "\u{44E}" => 'yu', "\u{c4}" => 'Ae', "\u{d6}" => 'Oe', "\u{dc}" => 'Ue', "\u{1e9e}" => 'Ss', "\u{e4}" => 'ae', "\u{f6}" => 'oe', "\u{fc}" => 'ue', "\u{df}" => 'ss']); // „ “ ” ‚ ‘ ’ ° Я я Ю ю Ä Ö Ü ẞ ä ö ü ß - if ($iconv !== 'libiconv') { - $s = strtr($s, ["\u{AE}" => '(R)', "\u{A9}" => '(c)', "\u{2026}" => '...', "\u{AB}" => '<<', "\u{BB}" => '>>', "\u{A3}" => 'lb', "\u{A5}" => 'yen', "\u{B2}" => '^2', "\u{B3}" => '^3', "\u{B5}" => 'u', "\u{B9}" => '^1', "\u{BA}" => 'o', "\u{BF}" => '?', "\u{2CA}" => "'", "\u{2CD}" => '_', "\u{2DD}" => '"', "\u{1FEF}" => '', "\u{20AC}" => 'EUR', "\u{2122}" => 'TM', "\u{212E}" => 'e', "\u{2190}" => '<-', "\u{2191}" => '^', "\u{2192}" => '->', "\u{2193}" => 'V', "\u{2194}" => '<->']); // ® © … « » £ ¥ ² ³ µ ¹ º ¿ ˊ ˍ ˝ ` € ™ ℮ ← ↑ → ↓ ↔ - } - - if ($transliterator) { - $s = $transliterator->transliterate($s); - // use iconv because The transliterator leaves some characters out of ASCII, eg → ʾ - if ($iconv === 'glibc') { - $s = strtr($s, '?', "\x01"); // temporarily hide ? to distinguish them from the garbage that iconv creates - $s = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $s); - $s = str_replace(['?', "\x01"], ['', '?'], $s); // remove garbage and restore ? characters - } elseif ($iconv === 'libiconv') { - $s = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $s); - } else { // null or 'unknown' (#216) - $s = self::pcre('preg_replace', ['#[^\x00-\x7F]++#', '', $s]); // remove non-ascii chars - } - } elseif ($iconv === 'glibc' || $iconv === 'libiconv') { - // temporarily hide these characters to distinguish them from the garbage that iconv creates - $s = strtr($s, '`\'"^~?', "\x01\x02\x03\x04\x05\x06"); - if ($iconv === 'glibc') { - // glibc implementation is very limited. transliterate into Windows-1250 and then into ASCII, so most Eastern European characters are preserved - $s = iconv('UTF-8', 'WINDOWS-1250//TRANSLIT//IGNORE', $s); - $s = strtr( - $s, - "\xa5\xa3\xbc\x8c\xa7\x8a\xaa\x8d\x8f\x8e\xaf\xb9\xb3\xbe\x9c\x9a\xba\x9d\x9f\x9e\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe\x96\xa0\x8b\x97\x9b\xa6\xad\xb7", - 'ALLSSSSTZZZallssstzzzRAAAALCCCEEEEIIDDNNOOOOxRUUUUYTsraaaalccceeeeiiddnnooooruuuuyt- <->|-.' - ); - $s = self::pcre('preg_replace', ['#[^\x00-\x7F]++#', '', $s]); - } else { - $s = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $s); - } - - // remove garbage that iconv creates during transliteration (eg Ý -> Y') - $s = str_replace(['`', "'", '"', '^', '~', '?'], '', $s); - // restore temporarily hidden characters - $s = strtr($s, "\x01\x02\x03\x04\x05\x06", '`\'"^~?'); - } else { - $s = self::pcre('preg_replace', ['#[^\x00-\x7F]++#', '', $s]); // remove non-ascii chars - } - - return $s; - } - - - /** - * Modifies the UTF-8 string to the form used in the URL, ie removes diacritics and replaces all characters - * except letters of the English alphabet and numbers with a hyphens. - */ - public static function webalize(string $s, ?string $charlist = null, bool $lower = true): string - { - $s = self::toAscii($s); - if ($lower) { - $s = strtolower($s); - } - - $s = self::pcre('preg_replace', ['#[^a-z0-9' . ($charlist !== null ? preg_quote($charlist, '#') : '') . ']+#i', '-', $s]); - $s = trim($s, '-'); - return $s; - } - - - /** - * Truncates a UTF-8 string to given maximal length, while trying not to split whole words. Only if the string is truncated, - * an ellipsis (or something else set with third argument) is appended to the string. - */ - public static function truncate(string $s, int $maxLen, string $append = "\u{2026}"): string - { - if (self::length($s) > $maxLen) { - $maxLen -= self::length($append); - if ($maxLen < 1) { - return $append; - - } elseif ($matches = self::match($s, '#^.{1,' . $maxLen . '}(?=[\s\x00-/:-@\[-`{-~])#us')) { - return $matches[0] . $append; - - } else { - return self::substring($s, 0, $maxLen) . $append; - } - } - - return $s; - } - - - /** - * Indents a multiline text from the left. Second argument sets how many indentation chars should be used, - * while the indent itself is the third argument (*tab* by default). - */ - public static function indent(string $s, int $level = 1, string $chars = "\t"): string - { - if ($level > 0) { - $s = self::replace($s, '#(?:^|[\r\n]+)(?=[^\r\n])#', '$0' . str_repeat($chars, $level)); - } - - return $s; - } - - - /** - * Converts all characters of UTF-8 string to lower case. - */ - public static function lower(string $s): string - { - return mb_strtolower($s, 'UTF-8'); - } - - - /** - * Converts the first character of a UTF-8 string to lower case and leaves the other characters unchanged. - */ - public static function firstLower(string $s): string - { - return self::lower(self::substring($s, 0, 1)) . self::substring($s, 1); - } - - - /** - * Converts all characters of a UTF-8 string to upper case. - */ - public static function upper(string $s): string - { - return mb_strtoupper($s, 'UTF-8'); - } - - - /** - * Converts the first character of a UTF-8 string to upper case and leaves the other characters unchanged. - */ - public static function firstUpper(string $s): string - { - return self::upper(self::substring($s, 0, 1)) . self::substring($s, 1); - } - - - /** - * Converts the first character of every word of a UTF-8 string to upper case and the others to lower case. - */ - public static function capitalize(string $s): string - { - return mb_convert_case($s, MB_CASE_TITLE, 'UTF-8'); - } - - - /** - * Compares two UTF-8 strings or their parts, without taking character case into account. If length is null, whole strings are compared, - * if it is negative, the corresponding number of characters from the end of the strings is compared, - * otherwise the appropriate number of characters from the beginning is compared. - */ - public static function compare(string $left, string $right, ?int $length = null): bool - { - if (class_exists('Normalizer', false)) { - $left = \Normalizer::normalize($left, \Normalizer::FORM_D); // form NFD is faster - $right = \Normalizer::normalize($right, \Normalizer::FORM_D); // form NFD is faster - } - - if ($length < 0) { - $left = self::substring($left, $length, -$length); - $right = self::substring($right, $length, -$length); - } elseif ($length !== null) { - $left = self::substring($left, 0, $length); - $right = self::substring($right, 0, $length); - } - - return self::lower($left) === self::lower($right); - } - - - /** - * Finds the common prefix of strings or returns empty string if the prefix was not found. - * @param string[] $strings - */ - public static function findPrefix(array $strings): string - { - $first = array_shift($strings); - for ($i = 0; $i < strlen($first); $i++) { - foreach ($strings as $s) { - if (!isset($s[$i]) || $first[$i] !== $s[$i]) { - while ($i && $first[$i - 1] >= "\x80" && $first[$i] >= "\x80" && $first[$i] < "\xC0") { - $i--; - } - - return substr($first, 0, $i); - } - } - } - - return $first; - } - - - /** - * Returns number of characters (not bytes) in UTF-8 string. - * That is the number of Unicode code points which may differ from the number of graphemes. - */ - public static function length(string $s): int - { - return function_exists('mb_strlen') - ? mb_strlen($s, 'UTF-8') - : strlen(utf8_decode($s)); - } - - - /** - * Removes all left and right side spaces (or the characters passed as second argument) from a UTF-8 encoded string. - */ - public static function trim(string $s, string $charlist = self::TRIM_CHARACTERS): string - { - $charlist = preg_quote($charlist, '#'); - return self::replace($s, '#^[' . $charlist . ']+|[' . $charlist . ']+$#Du', ''); - } - - - /** - * Pads a UTF-8 string to given length by prepending the $pad string to the beginning. - */ - public static function padLeft(string $s, int $length, string $pad = ' '): string - { - $length = max(0, $length - self::length($s)); - $padLen = self::length($pad); - return str_repeat($pad, (int) ($length / $padLen)) . self::substring($pad, 0, $length % $padLen) . $s; - } - - - /** - * Pads UTF-8 string to given length by appending the $pad string to the end. - */ - public static function padRight(string $s, int $length, string $pad = ' '): string - { - $length = max(0, $length - self::length($s)); - $padLen = self::length($pad); - return $s . str_repeat($pad, (int) ($length / $padLen)) . self::substring($pad, 0, $length % $padLen); - } - - - /** - * Reverses UTF-8 string. - */ - public static function reverse(string $s): string - { - if (!extension_loaded('iconv')) { - throw new Nette\NotSupportedException(__METHOD__ . '() requires ICONV extension that is not loaded.'); - } - - return iconv('UTF-32LE', 'UTF-8', strrev(iconv('UTF-8', 'UTF-32BE', $s))); - } - - - /** - * Returns part of $haystack before $nth occurence of $needle or returns null if the needle was not found. - * Negative value means searching from the end. - */ - public static function before(string $haystack, string $needle, int $nth = 1): ?string - { - $pos = self::pos($haystack, $needle, $nth); - return $pos === null - ? null - : substr($haystack, 0, $pos); - } - - - /** - * Returns part of $haystack after $nth occurence of $needle or returns null if the needle was not found. - * Negative value means searching from the end. - */ - public static function after(string $haystack, string $needle, int $nth = 1): ?string - { - $pos = self::pos($haystack, $needle, $nth); - return $pos === null - ? null - : substr($haystack, $pos + strlen($needle)); - } - - - /** - * Returns position in characters of $nth occurence of $needle in $haystack or null if the $needle was not found. - * Negative value of `$nth` means searching from the end. - */ - public static function indexOf(string $haystack, string $needle, int $nth = 1): ?int - { - $pos = self::pos($haystack, $needle, $nth); - return $pos === null - ? null - : self::length(substr($haystack, 0, $pos)); - } - - - /** - * Returns position in characters of $nth occurence of $needle in $haystack or null if the needle was not found. - */ - private static function pos(string $haystack, string $needle, int $nth = 1): ?int - { - if (!$nth) { - return null; - } elseif ($nth > 0) { - if ($needle === '') { - return 0; - } - - $pos = 0; - while (($pos = strpos($haystack, $needle, $pos)) !== false && --$nth) { - $pos++; - } - } else { - $len = strlen($haystack); - if ($needle === '') { - return $len; - } elseif ($len === 0) { - return null; - } - - $pos = $len - 1; - while (($pos = strrpos($haystack, $needle, $pos - $len)) !== false && ++$nth) { - $pos--; - } - } - - return Helpers::falseToNull($pos); - } - - - /** - * Splits a string into array by the regular expression. Parenthesized expression in the delimiter are captured. - * Parameter $flags can be any combination of PREG_SPLIT_NO_EMPTY and PREG_OFFSET_CAPTURE flags. - */ - public static function split(string $subject, string $pattern, int $flags = 0): array - { - return self::pcre('preg_split', [$pattern, $subject, -1, $flags | PREG_SPLIT_DELIM_CAPTURE]); - } - - - /** - * Checks if given string matches a regular expression pattern and returns an array with first found match and each subpattern. - * Parameter $flags can be any combination of PREG_OFFSET_CAPTURE and PREG_UNMATCHED_AS_NULL flags. - */ - public static function match(string $subject, string $pattern, int $flags = 0, int $offset = 0): ?array - { - if ($offset > strlen($subject)) { - return null; - } - - return self::pcre('preg_match', [$pattern, $subject, &$m, $flags, $offset]) - ? $m - : null; - } - - - /** - * Finds all occurrences matching regular expression pattern and returns a two-dimensional array. Result is array of matches (ie uses by default PREG_SET_ORDER). - * Parameter $flags can be any combination of PREG_OFFSET_CAPTURE, PREG_UNMATCHED_AS_NULL and PREG_PATTERN_ORDER flags. - */ - public static function matchAll(string $subject, string $pattern, int $flags = 0, int $offset = 0): array - { - if ($offset > strlen($subject)) { - return []; - } - - self::pcre('preg_match_all', [ - $pattern, $subject, &$m, - ($flags & PREG_PATTERN_ORDER) ? $flags : ($flags | PREG_SET_ORDER), - $offset, - ]); - return $m; - } - - - /** - * Replaces all occurrences matching regular expression $pattern which can be string or array in the form `pattern => replacement`. - * @param string|array $pattern - * @param string|callable $replacement - */ - public static function replace(string $subject, $pattern, $replacement = '', int $limit = -1): string - { - if (is_object($replacement) || is_array($replacement)) { - if (!is_callable($replacement, false, $textual)) { - throw new Nette\InvalidStateException("Callback '$textual' is not callable."); - } - - return self::pcre('preg_replace_callback', [$pattern, $replacement, $subject, $limit]); - - } elseif (is_array($pattern) && is_string(key($pattern))) { - $replacement = array_values($pattern); - $pattern = array_keys($pattern); - } - - return self::pcre('preg_replace', [$pattern, $replacement, $subject, $limit]); - } - - - /** @internal */ - public static function pcre(string $func, array $args) - { - $res = Callback::invokeSafe($func, $args, function (string $message) use ($args): void { - // compile-time error, not detectable by preg_last_error - throw new RegexpException($message . ' in pattern: ' . implode(' or ', (array) $args[0])); - }); - - if (($code = preg_last_error()) // run-time error, but preg_last_error & return code are liars - && ($res === null || !in_array($func, ['preg_filter', 'preg_replace_callback', 'preg_replace'], true)) - ) { - throw new RegexpException((RegexpException::MESSAGES[$code] ?? 'Unknown error') - . ' (pattern: ' . implode(' or ', (array) $args[0]) . ')', $code); - } - - return $res; - } -} diff --git a/vendor/nette/utils/src/Utils/Type.php b/vendor/nette/utils/src/Utils/Type.php deleted file mode 100644 index 2d61e5a0..00000000 --- a/vendor/nette/utils/src/Utils/Type.php +++ /dev/null @@ -1,252 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette\Utils; - -use Nette; - - -/** - * PHP type reflection. - */ -final class Type -{ - /** @var array */ - private $types; - - /** @var bool */ - private $single; - - /** @var string |, & */ - private $kind; - - - /** - * Creates a Type object based on reflection. Resolves self, static and parent to the actual class name. - * If the subject has no type, it returns null. - * @param \ReflectionFunctionAbstract|\ReflectionParameter|\ReflectionProperty $reflection - */ - public static function fromReflection($reflection): ?self - { - if ($reflection instanceof \ReflectionProperty && PHP_VERSION_ID < 70400) { - return null; - } elseif ($reflection instanceof \ReflectionMethod) { - $type = $reflection->getReturnType() ?? (PHP_VERSION_ID >= 80100 ? $reflection->getTentativeReturnType() : null); - } else { - $type = $reflection instanceof \ReflectionFunctionAbstract - ? $reflection->getReturnType() - : $reflection->getType(); - } - - if ($type === null) { - return null; - - } elseif ($type instanceof \ReflectionNamedType) { - $name = self::resolve($type->getName(), $reflection); - return new self($type->allowsNull() && $type->getName() !== 'mixed' ? [$name, 'null'] : [$name]); - - } elseif ($type instanceof \ReflectionUnionType || $type instanceof \ReflectionIntersectionType) { - return new self( - array_map( - function ($t) use ($reflection) { return self::resolve($t->getName(), $reflection); }, - $type->getTypes() - ), - $type instanceof \ReflectionUnionType ? '|' : '&' - ); - - } else { - throw new Nette\InvalidStateException('Unexpected type of ' . Reflection::toString($reflection)); - } - } - - - /** - * Creates the Type object according to the text notation. - */ - public static function fromString(string $type): self - { - if (!preg_match('#(?: - \?([\w\\\\]+)| - [\w\\\\]+ (?: (&[\w\\\\]+)* | (\|[\w\\\\]+)* ) - )()$#xAD', $type, $m)) { - throw new Nette\InvalidArgumentException("Invalid type '$type'."); - } - - [, $nType, $iType] = $m; - if ($nType) { - return new self([$nType, 'null']); - } elseif ($iType) { - return new self(explode('&', $type), '&'); - } else { - return new self(explode('|', $type)); - } - } - - - /** - * Resolves 'self', 'static' and 'parent' to the actual class name. - * @param \ReflectionFunctionAbstract|\ReflectionParameter|\ReflectionProperty $reflection - */ - public static function resolve(string $type, $reflection): string - { - $lower = strtolower($type); - if ($reflection instanceof \ReflectionFunction) { - return $type; - } elseif ($lower === 'self' || $lower === 'static') { - return $reflection->getDeclaringClass()->name; - } elseif ($lower === 'parent' && $reflection->getDeclaringClass()->getParentClass()) { - return $reflection->getDeclaringClass()->getParentClass()->name; - } else { - return $type; - } - } - - - private function __construct(array $types, string $kind = '|') - { - if ($types[0] === 'null') { // null as last - array_push($types, array_shift($types)); - } - - $this->types = $types; - $this->single = ($types[1] ?? 'null') === 'null'; - $this->kind = count($types) > 1 ? $kind : ''; - } - - - public function __toString(): string - { - return $this->single - ? (count($this->types) > 1 ? '?' : '') . $this->types[0] - : implode($this->kind, $this->types); - } - - - /** - * Returns the array of subtypes that make up the compound type as strings. - * @return string[] - */ - public function getNames(): array - { - return $this->types; - } - - - /** - * Returns the array of subtypes that make up the compound type as Type objects: - * @return self[] - */ - public function getTypes(): array - { - return array_map(function ($name) { return self::fromString($name); }, $this->types); - } - - - /** - * Returns the type name for single types, otherwise null. - */ - public function getSingleName(): ?string - { - return $this->single - ? $this->types[0] - : null; - } - - - /** - * Returns true whether it is a union type. - */ - public function isUnion(): bool - { - return $this->kind === '|'; - } - - - /** - * Returns true whether it is an intersection type. - */ - public function isIntersection(): bool - { - return $this->kind === '&'; - } - - - /** - * Returns true whether it is a single type. Simple nullable types are also considered to be single types. - */ - public function isSingle(): bool - { - return $this->single; - } - - - /** - * Returns true whether the type is both a single and a PHP built-in type. - */ - public function isBuiltin(): bool - { - return $this->single && Reflection::isBuiltinType($this->types[0]); - } - - - /** - * Returns true whether the type is both a single and a class name. - */ - public function isClass(): bool - { - return $this->single && !Reflection::isBuiltinType($this->types[0]); - } - - - /** - * Determines if type is special class name self/parent/static. - */ - public function isClassKeyword(): bool - { - return $this->single && Reflection::isClassKeyword($this->types[0]); - } - - - /** - * Verifies type compatibility. For example, it checks if a value of a certain type could be passed as a parameter. - */ - public function allows(string $type): bool - { - if ($this->types === ['mixed']) { - return true; - } - - $type = self::fromString($type); - - if ($this->isIntersection()) { - if (!$type->isIntersection()) { - return false; - } - - return Arrays::every($this->types, function ($currentType) use ($type) { - $builtin = Reflection::isBuiltinType($currentType); - return Arrays::some($type->types, function ($testedType) use ($currentType, $builtin) { - return $builtin - ? strcasecmp($currentType, $testedType) === 0 - : is_a($testedType, $currentType, true); - }); - }); - } - - $method = $type->isIntersection() ? 'some' : 'every'; - return Arrays::$method($type->types, function ($testedType) { - $builtin = Reflection::isBuiltinType($testedType); - return Arrays::some($this->types, function ($currentType) use ($testedType, $builtin) { - return $builtin - ? strcasecmp($currentType, $testedType) === 0 - : is_a($testedType, $currentType, true); - }); - }); - } -} diff --git a/vendor/nette/utils/src/Utils/Validators.php b/vendor/nette/utils/src/Utils/Validators.php deleted file mode 100644 index 143480a8..00000000 --- a/vendor/nette/utils/src/Utils/Validators.php +++ /dev/null @@ -1,383 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette\Utils; - -use Nette; - - -/** - * Validation utilities. - */ -class Validators -{ - use Nette\StaticClass; - - /** @var array<string,?callable> */ - protected static $validators = [ - // PHP types - 'array' => 'is_array', - 'bool' => 'is_bool', - 'boolean' => 'is_bool', - 'float' => 'is_float', - 'int' => 'is_int', - 'integer' => 'is_int', - 'null' => 'is_null', - 'object' => 'is_object', - 'resource' => 'is_resource', - 'scalar' => 'is_scalar', - 'string' => 'is_string', - - // pseudo-types - 'callable' => [self::class, 'isCallable'], - 'iterable' => 'is_iterable', - 'list' => [Arrays::class, 'isList'], - 'mixed' => [self::class, 'isMixed'], - 'none' => [self::class, 'isNone'], - 'number' => [self::class, 'isNumber'], - 'numeric' => [self::class, 'isNumeric'], - 'numericint' => [self::class, 'isNumericInt'], - - // string patterns - 'alnum' => 'ctype_alnum', - 'alpha' => 'ctype_alpha', - 'digit' => 'ctype_digit', - 'lower' => 'ctype_lower', - 'pattern' => null, - 'space' => 'ctype_space', - 'unicode' => [self::class, 'isUnicode'], - 'upper' => 'ctype_upper', - 'xdigit' => 'ctype_xdigit', - - // syntax validation - 'email' => [self::class, 'isEmail'], - 'identifier' => [self::class, 'isPhpIdentifier'], - 'uri' => [self::class, 'isUri'], - 'url' => [self::class, 'isUrl'], - - // environment validation - 'class' => 'class_exists', - 'interface' => 'interface_exists', - 'directory' => 'is_dir', - 'file' => 'is_file', - 'type' => [self::class, 'isType'], - ]; - - /** @var array<string,callable> */ - protected static $counters = [ - 'string' => 'strlen', - 'unicode' => [Strings::class, 'length'], - 'array' => 'count', - 'list' => 'count', - 'alnum' => 'strlen', - 'alpha' => 'strlen', - 'digit' => 'strlen', - 'lower' => 'strlen', - 'space' => 'strlen', - 'upper' => 'strlen', - 'xdigit' => 'strlen', - ]; - - - /** - * Verifies that the value is of expected types separated by pipe. - * @param mixed $value - * @throws AssertionException - */ - public static function assert($value, string $expected, string $label = 'variable'): void - { - if (!static::is($value, $expected)) { - $expected = str_replace(['|', ':'], [' or ', ' in range '], $expected); - $translate = ['boolean' => 'bool', 'integer' => 'int', 'double' => 'float', 'NULL' => 'null']; - $type = $translate[gettype($value)] ?? gettype($value); - if (is_int($value) || is_float($value) || (is_string($value) && strlen($value) < 40)) { - $type .= ' ' . var_export($value, true); - } elseif (is_object($value)) { - $type .= ' ' . get_class($value); - } - - throw new AssertionException("The $label expects to be $expected, $type given."); - } - } - - - /** - * Verifies that element $key in array is of expected types separated by pipe. - * @param mixed[] $array - * @param int|string $key - * @throws AssertionException - */ - public static function assertField( - array $array, - $key, - ?string $expected = null, - string $label = "item '%' in array" - ): void { - if (!array_key_exists($key, $array)) { - throw new AssertionException('Missing ' . str_replace('%', $key, $label) . '.'); - - } elseif ($expected) { - static::assert($array[$key], $expected, str_replace('%', $key, $label)); - } - } - - - /** - * Verifies that the value is of expected types separated by pipe. - * @param mixed $value - */ - public static function is($value, string $expected): bool - { - foreach (explode('|', $expected) as $item) { - if (substr($item, -2) === '[]') { - if (is_iterable($value) && self::everyIs($value, substr($item, 0, -2))) { - return true; - } - - continue; - } elseif (substr($item, 0, 1) === '?') { - $item = substr($item, 1); - if ($value === null) { - return true; - } - } - - [$type] = $item = explode(':', $item, 2); - if (isset(static::$validators[$type])) { - try { - if (!static::$validators[$type]($value)) { - continue; - } - } catch (\TypeError $e) { - continue; - } - } elseif ($type === 'pattern') { - if (Strings::match($value, '|^' . ($item[1] ?? '') . '$|D')) { - return true; - } - - continue; - } elseif (!$value instanceof $type) { - continue; - } - - if (isset($item[1])) { - $length = $value; - if (isset(static::$counters[$type])) { - $length = static::$counters[$type]($value); - } - - $range = explode('..', $item[1]); - if (!isset($range[1])) { - $range[1] = $range[0]; - } - - if (($range[0] !== '' && $length < $range[0]) || ($range[1] !== '' && $length > $range[1])) { - continue; - } - } - - return true; - } - - return false; - } - - - /** - * Finds whether all values are of expected types separated by pipe. - * @param mixed[] $values - */ - public static function everyIs(iterable $values, string $expected): bool - { - foreach ($values as $value) { - if (!static::is($value, $expected)) { - return false; - } - } - - return true; - } - - - /** - * Checks if the value is an integer or a float. - * @param mixed $value - */ - public static function isNumber($value): bool - { - return is_int($value) || is_float($value); - } - - - /** - * Checks if the value is an integer or a integer written in a string. - * @param mixed $value - */ - public static function isNumericInt($value): bool - { - return is_int($value) || (is_string($value) && preg_match('#^[+-]?[0-9]+$#D', $value)); - } - - - /** - * Checks if the value is a number or a number written in a string. - * @param mixed $value - */ - public static function isNumeric($value): bool - { - return is_float($value) || is_int($value) || (is_string($value) && preg_match('#^[+-]?([0-9]++\.?[0-9]*|\.[0-9]+)$#D', $value)); - } - - - /** - * Checks if the value is a syntactically correct callback. - * @param mixed $value - */ - public static function isCallable($value): bool - { - return $value && is_callable($value, true); - } - - - /** - * Checks if the value is a valid UTF-8 string. - * @param mixed $value - */ - public static function isUnicode($value): bool - { - return is_string($value) && preg_match('##u', $value); - } - - - /** - * Checks if the value is 0, '', false or null. - * @param mixed $value - */ - public static function isNone($value): bool - { - return $value == null; // intentionally == - } - - - /** @internal */ - public static function isMixed(): bool - { - return true; - } - - - /** - * Checks if a variable is a zero-based integer indexed array. - * @param mixed $value - * @deprecated use Nette\Utils\Arrays::isList - */ - public static function isList($value): bool - { - return Arrays::isList($value); - } - - - /** - * Checks if the value is in the given range [min, max], where the upper or lower limit can be omitted (null). - * Numbers, strings and DateTime objects can be compared. - * @param mixed $value - */ - public static function isInRange($value, array $range): bool - { - if ($value === null || !(isset($range[0]) || isset($range[1]))) { - return false; - } - - $limit = $range[0] ?? $range[1]; - if (is_string($limit)) { - $value = (string) $value; - } elseif ($limit instanceof \DateTimeInterface) { - if (!$value instanceof \DateTimeInterface) { - return false; - } - } elseif (is_numeric($value)) { - $value *= 1; - } else { - return false; - } - - return (!isset($range[0]) || ($value >= $range[0])) && (!isset($range[1]) || ($value <= $range[1])); - } - - - /** - * Checks if the value is a valid email address. It does not verify that the domain actually exists, only the syntax is verified. - */ - public static function isEmail(string $value): bool - { - $atom = "[-a-z0-9!#$%&'*+/=?^_`{|}~]"; // RFC 5322 unquoted characters in local-part - $alpha = "a-z\x80-\xFF"; // superset of IDN - return (bool) preg_match(<<<XX - (^ - ("([ !#-[\\]-~]*|\\\\[ -~])+"|$atom+(\\.$atom+)*) # quoted or unquoted - @ - ([0-9$alpha]([-0-9$alpha]{0,61}[0-9$alpha])?\\.)+ # domain - RFC 1034 - [$alpha]([-0-9$alpha]{0,17}[$alpha])? # top domain - $)Dix -XX -, $value); - } - - - /** - * Checks if the value is a valid URL address. - */ - public static function isUrl(string $value): bool - { - $alpha = "a-z\x80-\xFF"; - return (bool) preg_match(<<<XX - (^ - https?://( - (([-_0-9$alpha]+\\.)* # subdomain - [0-9$alpha]([-0-9$alpha]{0,61}[0-9$alpha])?\\.)? # domain - [$alpha]([-0-9$alpha]{0,17}[$alpha])? # top domain - |\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3} # IPv4 - |\\[[0-9a-f:]{3,39}\\] # IPv6 - )(:\\d{1,5})? # port - (/\\S*)? # path - (\\?\\S*)? # query - (\\#\\S*)? # fragment - $)Dix -XX -, $value); - } - - - /** - * Checks if the value is a valid URI address, that is, actually a string beginning with a syntactically valid schema. - */ - public static function isUri(string $value): bool - { - return (bool) preg_match('#^[a-z\d+\.-]+:\S+$#Di', $value); - } - - - /** - * Checks whether the input is a class, interface or trait. - */ - public static function isType(string $type): bool - { - return class_exists($type) || interface_exists($type) || trait_exists($type); - } - - - /** - * Checks whether the input is a valid PHP identifier. - */ - public static function isPhpIdentifier(string $value): bool - { - return preg_match('#^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$#D', $value) === 1; - } -} diff --git a/vendor/nette/utils/src/Utils/exceptions.php b/vendor/nette/utils/src/Utils/exceptions.php deleted file mode 100644 index c45e5430..00000000 --- a/vendor/nette/utils/src/Utils/exceptions.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette\Utils; - - -/** - * The exception that is thrown when an image error occurs. - */ -class ImageException extends \Exception -{ -} - - -/** - * The exception that indicates invalid image file. - */ -class UnknownImageFileException extends ImageException -{ -} - - -/** - * The exception that indicates error of JSON encoding/decoding. - */ -class JsonException extends \Exception -{ -} - - -/** - * The exception that indicates error of the last Regexp execution. - */ -class RegexpException extends \Exception -{ - public const MESSAGES = [ - PREG_INTERNAL_ERROR => 'Internal error', - PREG_BACKTRACK_LIMIT_ERROR => 'Backtrack limit was exhausted', - PREG_RECURSION_LIMIT_ERROR => 'Recursion limit was exhausted', - PREG_BAD_UTF8_ERROR => 'Malformed UTF-8 data', - PREG_BAD_UTF8_OFFSET_ERROR => 'Offset didn\'t correspond to the begin of a valid UTF-8 code point', - 6 => 'Failed due to limited JIT stack space', // PREG_JIT_STACKLIMIT_ERROR - ]; -} - - -/** - * The exception that indicates assertion error. - */ -class AssertionException extends \Exception -{ -} diff --git a/vendor/nette/utils/src/compatibility.php b/vendor/nette/utils/src/compatibility.php deleted file mode 100644 index 9df54801..00000000 --- a/vendor/nette/utils/src/compatibility.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette\Utils; - -use Nette; - -if (false) { - /** @deprecated use Nette\HtmlStringable */ - interface IHtmlString extends Nette\HtmlStringable - { - } -} elseif (!interface_exists(IHtmlString::class)) { - class_alias(Nette\HtmlStringable::class, IHtmlString::class); -} - -namespace Nette\Localization; - -if (false) { - /** @deprecated use Nette\Localization\Translator */ - interface ITranslator extends Translator - { - } -} elseif (!interface_exists(ITranslator::class)) { - class_alias(Translator::class, ITranslator::class); -} diff --git a/vendor/nette/utils/src/exceptions.php b/vendor/nette/utils/src/exceptions.php deleted file mode 100644 index bbda7ddc..00000000 --- a/vendor/nette/utils/src/exceptions.php +++ /dev/null @@ -1,109 +0,0 @@ -<?php - -/** - * This file is part of the Nette Framework (https://nette.org) - * Copyright (c) 2004 David Grudl (https://davidgrudl.com) - */ - -declare(strict_types=1); - -namespace Nette; - - -/** - * The exception that is thrown when the value of an argument is - * outside the allowable range of values as defined by the invoked method. - */ -class ArgumentOutOfRangeException extends \InvalidArgumentException -{ -} - - -/** - * The exception that is thrown when a method call is invalid for the object's - * current state, method has been invoked at an illegal or inappropriate time. - */ -class InvalidStateException extends \RuntimeException -{ -} - - -/** - * The exception that is thrown when a requested method or operation is not implemented. - */ -class NotImplementedException extends \LogicException -{ -} - - -/** - * The exception that is thrown when an invoked method is not supported. For scenarios where - * it is sometimes possible to perform the requested operation, see InvalidStateException. - */ -class NotSupportedException extends \LogicException -{ -} - - -/** - * The exception that is thrown when a requested method or operation is deprecated. - */ -class DeprecatedException extends NotSupportedException -{ -} - - -/** - * The exception that is thrown when accessing a class member (property or method) fails. - */ -class MemberAccessException extends \Error -{ -} - - -/** - * The exception that is thrown when an I/O error occurs. - */ -class IOException extends \RuntimeException -{ -} - - -/** - * The exception that is thrown when accessing a file that does not exist on disk. - */ -class FileNotFoundException extends IOException -{ -} - - -/** - * The exception that is thrown when part of a file or directory cannot be found. - */ -class DirectoryNotFoundException extends IOException -{ -} - - -/** - * The exception that is thrown when an argument does not match with the expected value. - */ -class InvalidArgumentException extends \InvalidArgumentException -{ -} - - -/** - * The exception that is thrown when an illegal index was requested. - */ -class OutOfRangeException extends \OutOfRangeException -{ -} - - -/** - * The exception that is thrown when a value (typically returned by function) does not match with the expected value. - */ -class UnexpectedValueException extends \UnexpectedValueException -{ -} diff --git a/vendor/nikic/php-parser/LICENSE b/vendor/nikic/php-parser/LICENSE deleted file mode 100644 index 2e567183..00000000 --- a/vendor/nikic/php-parser/LICENSE +++ /dev/null @@ -1,29 +0,0 @@ -BSD 3-Clause License - -Copyright (c) 2011, Nikita Popov -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. - -3. Neither the name of the copyright holder nor the names of its - 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 HOLDER 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/nikic/php-parser/README.md b/vendor/nikic/php-parser/README.md deleted file mode 100644 index 36de23cd..00000000 --- a/vendor/nikic/php-parser/README.md +++ /dev/null @@ -1,225 +0,0 @@ -PHP Parser -========== - -[![Coverage Status](https://coveralls.io/repos/github/nikic/PHP-Parser/badge.svg?branch=master)](https://coveralls.io/github/nikic/PHP-Parser?branch=master) - -This is a PHP 5.2 to PHP 8.2 parser written in PHP. Its purpose is to simplify static code analysis and -manipulation. - -[**Documentation for version 4.x**][doc_4_x] (stable; for running on PHP >= 7.0; for parsing PHP 5.2 to PHP 8.2). - -[Documentation for version 3.x][doc_3_x] (unsupported; for running on PHP >= 5.5; for parsing PHP 5.2 to PHP 7.2). - -Features --------- - -The main features provided by this library are: - - * Parsing PHP 5, PHP 7, and PHP 8 code into an abstract syntax tree (AST). - * Invalid code can be parsed into a partial AST. - * The AST contains accurate location information. - * Dumping the AST in human-readable form. - * Converting an AST back to PHP code. - * Experimental: Formatting can be preserved for partially changed ASTs. - * Infrastructure to traverse and modify ASTs. - * Resolution of namespaced names. - * Evaluation of constant expressions. - * Builders to simplify AST construction for code generation. - * Converting an AST into JSON and back. - -Quick Start ------------ - -Install the library using [composer](https://getcomposer.org): - - php composer.phar require nikic/php-parser - -Parse some PHP code into an AST and dump the result in human-readable form: - -```php -<?php -use PhpParser\Error; -use PhpParser\NodeDumper; -use PhpParser\ParserFactory; - -$code = <<<'CODE' -<?php - -function test($foo) -{ - var_dump($foo); -} -CODE; - -$parser = (new ParserFactory)->create(ParserFactory::PREFER_PHP7); -try { - $ast = $parser->parse($code); -} catch (Error $error) { - echo "Parse error: {$error->getMessage()}\n"; - return; -} - -$dumper = new NodeDumper; -echo $dumper->dump($ast) . "\n"; -``` - -This dumps an AST looking something like this: - -``` -array( - 0: Stmt_Function( - byRef: false - name: Identifier( - name: test - ) - params: array( - 0: Param( - type: null - byRef: false - variadic: false - var: Expr_Variable( - name: foo - ) - default: null - ) - ) - returnType: null - stmts: array( - 0: Stmt_Expression( - expr: Expr_FuncCall( - name: Name( - parts: array( - 0: var_dump - ) - ) - args: array( - 0: Arg( - value: Expr_Variable( - name: foo - ) - byRef: false - unpack: false - ) - ) - ) - ) - ) - ) -) -``` - -Let's traverse the AST and perform some kind of modification. For example, drop all function bodies: - -```php -use PhpParser\Node; -use PhpParser\Node\Stmt\Function_; -use PhpParser\NodeTraverser; -use PhpParser\NodeVisitorAbstract; - -$traverser = new NodeTraverser(); -$traverser->addVisitor(new class extends NodeVisitorAbstract { - public function enterNode(Node $node) { - if ($node instanceof Function_) { - // Clean out the function body - $node->stmts = []; - } - } -}); - -$ast = $traverser->traverse($ast); -echo $dumper->dump($ast) . "\n"; -``` - -This gives us an AST where the `Function_::$stmts` are empty: - -``` -array( - 0: Stmt_Function( - byRef: false - name: Identifier( - name: test - ) - params: array( - 0: Param( - type: null - byRef: false - variadic: false - var: Expr_Variable( - name: foo - ) - default: null - ) - ) - returnType: null - stmts: array( - ) - ) -) -``` - -Finally, we can convert the new AST back to PHP code: - -```php -use PhpParser\PrettyPrinter; - -$prettyPrinter = new PrettyPrinter\Standard; -echo $prettyPrinter->prettyPrintFile($ast); -``` - -This gives us our original code, minus the `var_dump()` call inside the function: - -```php -<?php - -function test($foo) -{ -} -``` - -For a more comprehensive introduction, see the documentation. - -Documentation -------------- - - 1. [Introduction](doc/0_Introduction.markdown) - 2. [Usage of basic components](doc/2_Usage_of_basic_components.markdown) - -Component documentation: - - * [Walking the AST](doc/component/Walking_the_AST.markdown) - * Node visitors - * Modifying the AST from a visitor - * Short-circuiting traversals - * Interleaved visitors - * Simple node finding API - * Parent and sibling references - * [Name resolution](doc/component/Name_resolution.markdown) - * Name resolver options - * Name resolution context - * [Pretty printing](doc/component/Pretty_printing.markdown) - * Converting AST back to PHP code - * Customizing formatting - * Formatting-preserving code transformations - * [AST builders](doc/component/AST_builders.markdown) - * Fluent builders for AST nodes - * [Lexer](doc/component/Lexer.markdown) - * Lexer options - * Token and file positions for nodes - * Custom attributes - * [Error handling](doc/component/Error_handling.markdown) - * Column information for errors - * Error recovery (parsing of syntactically incorrect code) - * [Constant expression evaluation](doc/component/Constant_expression_evaluation.markdown) - * Evaluating constant/property/etc initializers - * Handling errors and unsupported expressions - * [JSON representation](doc/component/JSON_representation.markdown) - * JSON encoding and decoding of ASTs - * [Performance](doc/component/Performance.markdown) - * Disabling Xdebug - * Reusing objects - * Garbage collection impact - * [Frequently asked questions](doc/component/FAQ.markdown) - * Parent and sibling references - - [doc_3_x]: https://github.com/nikic/PHP-Parser/tree/3.x/doc - [doc_4_x]: https://github.com/nikic/PHP-Parser/tree/4.x/doc diff --git a/vendor/nikic/php-parser/bin/php-parse b/vendor/nikic/php-parser/bin/php-parse deleted file mode 100755 index bb3e46df..00000000 --- a/vendor/nikic/php-parser/bin/php-parse +++ /dev/null @@ -1,205 +0,0 @@ -#!/usr/bin/env php -<?php - -foreach ([__DIR__ . '/../../../autoload.php', __DIR__ . '/../vendor/autoload.php'] as $file) { - if (file_exists($file)) { - require $file; - break; - } -} - -ini_set('xdebug.max_nesting_level', 3000); - -// Disable Xdebug var_dump() output truncation -ini_set('xdebug.var_display_max_children', -1); -ini_set('xdebug.var_display_max_data', -1); -ini_set('xdebug.var_display_max_depth', -1); - -list($operations, $files, $attributes) = parseArgs($argv); - -/* Dump nodes by default */ -if (empty($operations)) { - $operations[] = 'dump'; -} - -if (empty($files)) { - showHelp("Must specify at least one file."); -} - -$lexer = new PhpParser\Lexer\Emulative(['usedAttributes' => [ - 'startLine', 'endLine', 'startFilePos', 'endFilePos', 'comments' -]]); -$parser = (new PhpParser\ParserFactory)->create( - PhpParser\ParserFactory::PREFER_PHP7, - $lexer -); -$dumper = new PhpParser\NodeDumper([ - 'dumpComments' => true, - 'dumpPositions' => $attributes['with-positions'], -]); -$prettyPrinter = new PhpParser\PrettyPrinter\Standard; - -$traverser = new PhpParser\NodeTraverser(); -$traverser->addVisitor(new PhpParser\NodeVisitor\NameResolver); - -foreach ($files as $file) { - if (strpos($file, '<?php') === 0) { - $code = $file; - fwrite(STDERR, "====> Code $code\n"); - } else { - if (!file_exists($file)) { - fwrite(STDERR, "File $file does not exist.\n"); - exit(1); - } - - $code = file_get_contents($file); - fwrite(STDERR, "====> File $file:\n"); - } - - if ($attributes['with-recovery']) { - $errorHandler = new PhpParser\ErrorHandler\Collecting; - $stmts = $parser->parse($code, $errorHandler); - foreach ($errorHandler->getErrors() as $error) { - $message = formatErrorMessage($error, $code, $attributes['with-column-info']); - fwrite(STDERR, $message . "\n"); - } - if (null === $stmts) { - continue; - } - } else { - try { - $stmts = $parser->parse($code); - } catch (PhpParser\Error $error) { - $message = formatErrorMessage($error, $code, $attributes['with-column-info']); - fwrite(STDERR, $message . "\n"); - exit(1); - } - } - - foreach ($operations as $operation) { - if ('dump' === $operation) { - fwrite(STDERR, "==> Node dump:\n"); - echo $dumper->dump($stmts, $code), "\n"; - } elseif ('pretty-print' === $operation) { - fwrite(STDERR, "==> Pretty print:\n"); - echo $prettyPrinter->prettyPrintFile($stmts), "\n"; - } elseif ('json-dump' === $operation) { - fwrite(STDERR, "==> JSON dump:\n"); - echo json_encode($stmts, JSON_PRETTY_PRINT), "\n"; - } elseif ('var-dump' === $operation) { - fwrite(STDERR, "==> var_dump():\n"); - var_dump($stmts); - } elseif ('resolve-names' === $operation) { - fwrite(STDERR, "==> Resolved names.\n"); - $stmts = $traverser->traverse($stmts); - } - } -} - -function formatErrorMessage(PhpParser\Error $e, $code, $withColumnInfo) { - if ($withColumnInfo && $e->hasColumnInfo()) { - return $e->getMessageWithColumnInfo($code); - } else { - return $e->getMessage(); - } -} - -function showHelp($error = '') { - if ($error) { - fwrite(STDERR, $error . "\n\n"); - } - fwrite($error ? STDERR : STDOUT, <<<OUTPUT -Usage: php-parse [operations] file1.php [file2.php ...] - or: php-parse [operations] "<?php code" -Turn PHP source code into an abstract syntax tree. - -Operations is a list of the following options (--dump by default): - - -d, --dump Dump nodes using NodeDumper - -p, --pretty-print Pretty print file using PrettyPrinter\Standard - -j, --json-dump Print json_encode() result - --var-dump var_dump() nodes (for exact structure) - -N, --resolve-names Resolve names using NodeVisitor\NameResolver - -c, --with-column-info Show column-numbers for errors (if available) - -P, --with-positions Show positions in node dumps - -r, --with-recovery Use parsing with error recovery - -h, --help Display this page - -Example: - php-parse -d -p -N -d file.php - - Dumps nodes, pretty prints them, then resolves names and dumps them again. - - -OUTPUT - ); - exit($error ? 1 : 0); -} - -function parseArgs($args) { - $operations = []; - $files = []; - $attributes = [ - 'with-column-info' => false, - 'with-positions' => false, - 'with-recovery' => false, - ]; - - array_shift($args); - $parseOptions = true; - foreach ($args as $arg) { - if (!$parseOptions) { - $files[] = $arg; - continue; - } - - switch ($arg) { - case '--dump': - case '-d': - $operations[] = 'dump'; - break; - case '--pretty-print': - case '-p': - $operations[] = 'pretty-print'; - break; - case '--json-dump': - case '-j': - $operations[] = 'json-dump'; - break; - case '--var-dump': - $operations[] = 'var-dump'; - break; - case '--resolve-names': - case '-N'; - $operations[] = 'resolve-names'; - break; - case '--with-column-info': - case '-c'; - $attributes['with-column-info'] = true; - break; - case '--with-positions': - case '-P': - $attributes['with-positions'] = true; - break; - case '--with-recovery': - case '-r': - $attributes['with-recovery'] = true; - break; - case '--help': - case '-h'; - showHelp(); - break; - case '--': - $parseOptions = false; - break; - default: - if ($arg[0] === '-') { - showHelp("Invalid operation $arg."); - } else { - $files[] = $arg; - } - } - } - - return [$operations, $files, $attributes]; -} diff --git a/vendor/nikic/php-parser/composer.json b/vendor/nikic/php-parser/composer.json deleted file mode 100644 index 2fd064a2..00000000 --- a/vendor/nikic/php-parser/composer.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "nikic/php-parser", - "type": "library", - "description": "A PHP parser written in PHP", - "keywords": [ - "php", - "parser" - ], - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Nikita Popov" - } - ], - "require": { - "php": ">=7.0", - "ext-tokenizer": "*" - }, - "require-dev": { - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0", - "ircmaxell/php-yacc": "^0.0.7" - }, - "extra": { - "branch-alias": { - "dev-master": "4.9-dev" - } - }, - "autoload": { - "psr-4": { - "PhpParser\\": "lib/PhpParser" - } - }, - "autoload-dev": { - "psr-4": { - "PhpParser\\": "test/PhpParser/" - } - }, - "bin": [ - "bin/php-parse" - ] -} diff --git a/vendor/nikic/php-parser/grammar/README.md b/vendor/nikic/php-parser/grammar/README.md deleted file mode 100644 index 4bae11d8..00000000 --- a/vendor/nikic/php-parser/grammar/README.md +++ /dev/null @@ -1,30 +0,0 @@ -What do all those files mean? -============================= - - * `php5.y`: PHP 5 grammar written in a pseudo language - * `php7.y`: PHP 7 grammar written in a pseudo language - * `tokens.y`: Tokens definition shared between PHP 5 and PHP 7 grammars - * `parser.template`: A `kmyacc` parser prototype file for PHP - * `tokens.template`: A `kmyacc` prototype file for the `Tokens` class - * `rebuildParsers.php`: Preprocesses the grammar and builds the parser using `kmyacc` - -.phpy pseudo language -===================== - -The `.y` file is a normal grammar in `kmyacc` (`yacc`) style, with some transformations -applied to it: - - * Nodes are created using the syntax `Name[..., ...]`. This is transformed into - `new Name(..., ..., attributes())` - * Some function-like constructs are resolved (see `rebuildParsers.php` for a list) - -Building the parser -=================== - -Run `php grammar/rebuildParsers.php` to rebuild the parsers. Additional options: - - * The `KMYACC` environment variable can be used to specify an alternative `kmyacc` binary. - By default the `phpyacc` dev dependency will be used. To use the original `kmyacc`, you - need to compile [moriyoshi's fork](https://github.com/moriyoshi/kmyacc-forked). - * The `--debug` option enables emission of debug symbols and creates the `y.output` file. - * The `--keep-tmp-grammar` option preserves the preprocessed grammar file. diff --git a/vendor/nikic/php-parser/grammar/parser.template b/vendor/nikic/php-parser/grammar/parser.template deleted file mode 100644 index 6166607c..00000000 --- a/vendor/nikic/php-parser/grammar/parser.template +++ /dev/null @@ -1,106 +0,0 @@ -<?php -$meta # -#semval($) $this->semValue -#semval($,%t) $this->semValue -#semval(%n) $stackPos-(%l-%n) -#semval(%n,%t) $stackPos-(%l-%n) - -namespace PhpParser\Parser; - -use PhpParser\Error; -use PhpParser\Node; -use PhpParser\Node\Expr; -use PhpParser\Node\Name; -use PhpParser\Node\Scalar; -use PhpParser\Node\Stmt; -#include; - -/* This is an automatically GENERATED file, which should not be manually edited. - * Instead edit one of the following: - * * the grammar files grammar/php5.y or grammar/php7.y - * * the skeleton file grammar/parser.template - * * the preprocessing script grammar/rebuildParsers.php - */ -class #(-p) extends \PhpParser\ParserAbstract -{ - protected $tokenToSymbolMapSize = #(YYMAXLEX); - protected $actionTableSize = #(YYLAST); - protected $gotoTableSize = #(YYGLAST); - - protected $invalidSymbol = #(YYBADCH); - protected $errorSymbol = #(YYINTERRTOK); - protected $defaultAction = #(YYDEFAULT); - protected $unexpectedTokenRule = #(YYUNEXPECTED); - - protected $YY2TBLSTATE = #(YY2TBLSTATE); - protected $numNonLeafStates = #(YYNLSTATES); - - protected $symbolToName = array( - #listvar terminals - ); - - protected $tokenToSymbol = array( - #listvar yytranslate - ); - - protected $action = array( - #listvar yyaction - ); - - protected $actionCheck = array( - #listvar yycheck - ); - - protected $actionBase = array( - #listvar yybase - ); - - protected $actionDefault = array( - #listvar yydefault - ); - - protected $goto = array( - #listvar yygoto - ); - - protected $gotoCheck = array( - #listvar yygcheck - ); - - protected $gotoBase = array( - #listvar yygbase - ); - - protected $gotoDefault = array( - #listvar yygdefault - ); - - protected $ruleToNonTerminal = array( - #listvar yylhs - ); - - protected $ruleToLength = array( - #listvar yylen - ); -#if -t - - protected $productions = array( - #production-strings; - ); -#endif - - protected function initReduceCallbacks() { - $this->reduceCallbacks = [ -#reduce - %n => function ($stackPos) { - %b - }, -#noact - %n => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, -#endreduce - ]; - } -} -#tailcode; diff --git a/vendor/nikic/php-parser/grammar/php5.y b/vendor/nikic/php-parser/grammar/php5.y deleted file mode 100644 index a62e9a31..00000000 --- a/vendor/nikic/php-parser/grammar/php5.y +++ /dev/null @@ -1,1036 +0,0 @@ -%pure_parser -%expect 6 - -%tokens - -%% - -start: - top_statement_list { $$ = $this->handleNamespaces($1); } -; - -top_statement_list_ex: - top_statement_list_ex top_statement { pushNormalizing($1, $2); } - | /* empty */ { init(); } -; - -top_statement_list: - top_statement_list_ex - { makeZeroLengthNop($nop, $this->lookaheadStartAttributes); - if ($nop !== null) { $1[] = $nop; } $$ = $1; } -; - -ampersand: - T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG - | T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG -; - -reserved_non_modifiers: - T_INCLUDE | T_INCLUDE_ONCE | T_EVAL | T_REQUIRE | T_REQUIRE_ONCE | T_LOGICAL_OR | T_LOGICAL_XOR | T_LOGICAL_AND - | T_INSTANCEOF | T_NEW | T_CLONE | T_EXIT | T_IF | T_ELSEIF | T_ELSE | T_ENDIF | T_ECHO | T_DO | T_WHILE - | T_ENDWHILE | T_FOR | T_ENDFOR | T_FOREACH | T_ENDFOREACH | T_DECLARE | T_ENDDECLARE | T_AS | T_TRY | T_CATCH - | T_FINALLY | T_THROW | T_USE | T_INSTEADOF | T_GLOBAL | T_VAR | T_UNSET | T_ISSET | T_EMPTY | T_CONTINUE | T_GOTO - | T_FUNCTION | T_CONST | T_RETURN | T_PRINT | T_YIELD | T_LIST | T_SWITCH | T_ENDSWITCH | T_CASE | T_DEFAULT - | T_BREAK | T_ARRAY | T_CALLABLE | T_EXTENDS | T_IMPLEMENTS | T_NAMESPACE | T_TRAIT | T_INTERFACE | T_CLASS - | T_CLASS_C | T_TRAIT_C | T_FUNC_C | T_METHOD_C | T_LINE | T_FILE | T_DIR | T_NS_C | T_HALT_COMPILER | T_FN - | T_MATCH -; - -semi_reserved: - reserved_non_modifiers - | T_STATIC | T_ABSTRACT | T_FINAL | T_PRIVATE | T_PROTECTED | T_PUBLIC -; - -identifier_ex: - T_STRING { $$ = Node\Identifier[$1]; } - | semi_reserved { $$ = Node\Identifier[$1]; } -; - -identifier: - T_STRING { $$ = Node\Identifier[$1]; } -; - -reserved_non_modifiers_identifier: - reserved_non_modifiers { $$ = Node\Identifier[$1]; } -; - -namespace_name: - T_STRING { $$ = Name[$1]; } - | T_NAME_QUALIFIED { $$ = Name[$1]; } -; - -legacy_namespace_name: - namespace_name { $$ = $1; } - | T_NAME_FULLY_QUALIFIED { $$ = Name[substr($1, 1)]; } -; - -plain_variable: - T_VARIABLE { $$ = Expr\Variable[parseVar($1)]; } -; - -top_statement: - statement { $$ = $1; } - | function_declaration_statement { $$ = $1; } - | class_declaration_statement { $$ = $1; } - | T_HALT_COMPILER - { $$ = Stmt\HaltCompiler[$this->lexer->handleHaltCompiler()]; } - | T_NAMESPACE namespace_name ';' - { $$ = Stmt\Namespace_[$2, null]; - $$->setAttribute('kind', Stmt\Namespace_::KIND_SEMICOLON); - $this->checkNamespace($$); } - | T_NAMESPACE namespace_name '{' top_statement_list '}' - { $$ = Stmt\Namespace_[$2, $4]; - $$->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); - $this->checkNamespace($$); } - | T_NAMESPACE '{' top_statement_list '}' - { $$ = Stmt\Namespace_[null, $3]; - $$->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); - $this->checkNamespace($$); } - | T_USE use_declarations ';' { $$ = Stmt\Use_[$2, Stmt\Use_::TYPE_NORMAL]; } - | T_USE use_type use_declarations ';' { $$ = Stmt\Use_[$3, $2]; } - | group_use_declaration ';' { $$ = $1; } - | T_CONST constant_declaration_list ';' { $$ = Stmt\Const_[$2]; } -; - -use_type: - T_FUNCTION { $$ = Stmt\Use_::TYPE_FUNCTION; } - | T_CONST { $$ = Stmt\Use_::TYPE_CONSTANT; } -; - -group_use_declaration: - T_USE use_type legacy_namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations '}' - { $$ = Stmt\GroupUse[$3, $6, $2]; } - | T_USE legacy_namespace_name T_NS_SEPARATOR '{' inline_use_declarations '}' - { $$ = Stmt\GroupUse[$2, $5, Stmt\Use_::TYPE_UNKNOWN]; } -; - -unprefixed_use_declarations: - unprefixed_use_declarations ',' unprefixed_use_declaration - { push($1, $3); } - | unprefixed_use_declaration { init($1); } -; - -use_declarations: - use_declarations ',' use_declaration { push($1, $3); } - | use_declaration { init($1); } -; - -inline_use_declarations: - inline_use_declarations ',' inline_use_declaration { push($1, $3); } - | inline_use_declaration { init($1); } -; - -unprefixed_use_declaration: - namespace_name - { $$ = Stmt\UseUse[$1, null, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #1); } - | namespace_name T_AS identifier - { $$ = Stmt\UseUse[$1, $3, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #3); } -; - -use_declaration: - legacy_namespace_name - { $$ = Stmt\UseUse[$1, null, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #1); } - | legacy_namespace_name T_AS identifier - { $$ = Stmt\UseUse[$1, $3, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #3); } -; - -inline_use_declaration: - unprefixed_use_declaration { $$ = $1; $$->type = Stmt\Use_::TYPE_NORMAL; } - | use_type unprefixed_use_declaration { $$ = $2; $$->type = $1; } -; - -constant_declaration_list: - constant_declaration_list ',' constant_declaration { push($1, $3); } - | constant_declaration { init($1); } -; - -constant_declaration: - identifier '=' static_scalar { $$ = Node\Const_[$1, $3]; } -; - -class_const_list: - class_const_list ',' class_const { push($1, $3); } - | class_const { init($1); } -; - -class_const: - identifier_ex '=' static_scalar { $$ = Node\Const_[$1, $3]; } -; - -inner_statement_list_ex: - inner_statement_list_ex inner_statement { pushNormalizing($1, $2); } - | /* empty */ { init(); } -; - -inner_statement_list: - inner_statement_list_ex - { makeZeroLengthNop($nop, $this->lookaheadStartAttributes); - if ($nop !== null) { $1[] = $nop; } $$ = $1; } -; - -inner_statement: - statement { $$ = $1; } - | function_declaration_statement { $$ = $1; } - | class_declaration_statement { $$ = $1; } - | T_HALT_COMPILER - { throw new Error('__HALT_COMPILER() can only be used from the outermost scope', attributes()); } -; - -non_empty_statement: - '{' inner_statement_list '}' - { - if ($2) { - $$ = $2; prependLeadingComments($$); - } else { - makeNop($$, $this->startAttributeStack[#1], $this->endAttributes); - if (null === $$) { $$ = array(); } - } - } - | T_IF parentheses_expr statement elseif_list else_single - { $$ = Stmt\If_[$2, ['stmts' => toArray($3), 'elseifs' => $4, 'else' => $5]]; } - | T_IF parentheses_expr ':' inner_statement_list new_elseif_list new_else_single T_ENDIF ';' - { $$ = Stmt\If_[$2, ['stmts' => $4, 'elseifs' => $5, 'else' => $6]]; } - | T_WHILE parentheses_expr while_statement { $$ = Stmt\While_[$2, $3]; } - | T_DO statement T_WHILE parentheses_expr ';' { $$ = Stmt\Do_ [$4, toArray($2)]; } - | T_FOR '(' for_expr ';' for_expr ';' for_expr ')' for_statement - { $$ = Stmt\For_[['init' => $3, 'cond' => $5, 'loop' => $7, 'stmts' => $9]]; } - | T_SWITCH parentheses_expr switch_case_list { $$ = Stmt\Switch_[$2, $3]; } - | T_BREAK ';' { $$ = Stmt\Break_[null]; } - | T_BREAK expr ';' { $$ = Stmt\Break_[$2]; } - | T_CONTINUE ';' { $$ = Stmt\Continue_[null]; } - | T_CONTINUE expr ';' { $$ = Stmt\Continue_[$2]; } - | T_RETURN ';' { $$ = Stmt\Return_[null]; } - | T_RETURN expr ';' { $$ = Stmt\Return_[$2]; } - | T_GLOBAL global_var_list ';' { $$ = Stmt\Global_[$2]; } - | T_STATIC static_var_list ';' { $$ = Stmt\Static_[$2]; } - | T_ECHO expr_list ';' { $$ = Stmt\Echo_[$2]; } - | T_INLINE_HTML { $$ = Stmt\InlineHTML[$1]; } - | yield_expr ';' { $$ = Stmt\Expression[$1]; } - | expr ';' { $$ = Stmt\Expression[$1]; } - | T_UNSET '(' variables_list ')' ';' { $$ = Stmt\Unset_[$3]; } - | T_FOREACH '(' expr T_AS foreach_variable ')' foreach_statement - { $$ = Stmt\Foreach_[$3, $5[0], ['keyVar' => null, 'byRef' => $5[1], 'stmts' => $7]]; } - | T_FOREACH '(' expr T_AS variable T_DOUBLE_ARROW foreach_variable ')' foreach_statement - { $$ = Stmt\Foreach_[$3, $7[0], ['keyVar' => $5, 'byRef' => $7[1], 'stmts' => $9]]; } - | T_DECLARE '(' declare_list ')' declare_statement { $$ = Stmt\Declare_[$3, $5]; } - | T_TRY '{' inner_statement_list '}' catches optional_finally - { $$ = Stmt\TryCatch[$3, $5, $6]; $this->checkTryCatch($$); } - | T_THROW expr ';' { $$ = Stmt\Throw_[$2]; } - | T_GOTO identifier ';' { $$ = Stmt\Goto_[$2]; } - | identifier ':' { $$ = Stmt\Label[$1]; } - | expr error { $$ = Stmt\Expression[$1]; } - | error { $$ = array(); /* means: no statement */ } -; - -statement: - non_empty_statement { $$ = $1; } - | ';' - { makeNop($$, $this->startAttributeStack[#1], $this->endAttributes); - if ($$ === null) $$ = array(); /* means: no statement */ } -; - -catches: - /* empty */ { init(); } - | catches catch { push($1, $2); } -; - -catch: - T_CATCH '(' name plain_variable ')' '{' inner_statement_list '}' - { $$ = Stmt\Catch_[array($3), $4, $7]; } -; - -optional_finally: - /* empty */ { $$ = null; } - | T_FINALLY '{' inner_statement_list '}' { $$ = Stmt\Finally_[$3]; } -; - -variables_list: - variable { init($1); } - | variables_list ',' variable { push($1, $3); } -; - -optional_ref: - /* empty */ { $$ = false; } - | ampersand { $$ = true; } -; - -optional_arg_ref: - /* empty */ { $$ = false; } - | T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG { $$ = true; } -; - -optional_ellipsis: - /* empty */ { $$ = false; } - | T_ELLIPSIS { $$ = true; } -; - -function_declaration_statement: - T_FUNCTION optional_ref identifier '(' parameter_list ')' optional_return_type '{' inner_statement_list '}' - { $$ = Stmt\Function_[$3, ['byRef' => $2, 'params' => $5, 'returnType' => $7, 'stmts' => $9]]; } -; - -class_declaration_statement: - class_entry_type identifier extends_from implements_list '{' class_statement_list '}' - { $$ = Stmt\Class_[$2, ['type' => $1, 'extends' => $3, 'implements' => $4, 'stmts' => $6]]; - $this->checkClass($$, #2); } - | T_INTERFACE identifier interface_extends_list '{' class_statement_list '}' - { $$ = Stmt\Interface_[$2, ['extends' => $3, 'stmts' => $5]]; - $this->checkInterface($$, #2); } - | T_TRAIT identifier '{' class_statement_list '}' - { $$ = Stmt\Trait_[$2, ['stmts' => $4]]; } -; - -class_entry_type: - T_CLASS { $$ = 0; } - | T_ABSTRACT T_CLASS { $$ = Stmt\Class_::MODIFIER_ABSTRACT; } - | T_FINAL T_CLASS { $$ = Stmt\Class_::MODIFIER_FINAL; } -; - -extends_from: - /* empty */ { $$ = null; } - | T_EXTENDS class_name { $$ = $2; } -; - -interface_extends_list: - /* empty */ { $$ = array(); } - | T_EXTENDS class_name_list { $$ = $2; } -; - -implements_list: - /* empty */ { $$ = array(); } - | T_IMPLEMENTS class_name_list { $$ = $2; } -; - -class_name_list: - class_name { init($1); } - | class_name_list ',' class_name { push($1, $3); } -; - -for_statement: - statement { $$ = toArray($1); } - | ':' inner_statement_list T_ENDFOR ';' { $$ = $2; } -; - -foreach_statement: - statement { $$ = toArray($1); } - | ':' inner_statement_list T_ENDFOREACH ';' { $$ = $2; } -; - -declare_statement: - non_empty_statement { $$ = toArray($1); } - | ';' { $$ = null; } - | ':' inner_statement_list T_ENDDECLARE ';' { $$ = $2; } -; - -declare_list: - declare_list_element { init($1); } - | declare_list ',' declare_list_element { push($1, $3); } -; - -declare_list_element: - identifier '=' static_scalar { $$ = Stmt\DeclareDeclare[$1, $3]; } -; - -switch_case_list: - '{' case_list '}' { $$ = $2; } - | '{' ';' case_list '}' { $$ = $3; } - | ':' case_list T_ENDSWITCH ';' { $$ = $2; } - | ':' ';' case_list T_ENDSWITCH ';' { $$ = $3; } -; - -case_list: - /* empty */ { init(); } - | case_list case { push($1, $2); } -; - -case: - T_CASE expr case_separator inner_statement_list_ex { $$ = Stmt\Case_[$2, $4]; } - | T_DEFAULT case_separator inner_statement_list_ex { $$ = Stmt\Case_[null, $3]; } -; - -case_separator: - ':' - | ';' -; - -while_statement: - statement { $$ = toArray($1); } - | ':' inner_statement_list T_ENDWHILE ';' { $$ = $2; } -; - -elseif_list: - /* empty */ { init(); } - | elseif_list elseif { push($1, $2); } -; - -elseif: - T_ELSEIF parentheses_expr statement { $$ = Stmt\ElseIf_[$2, toArray($3)]; } -; - -new_elseif_list: - /* empty */ { init(); } - | new_elseif_list new_elseif { push($1, $2); } -; - -new_elseif: - T_ELSEIF parentheses_expr ':' inner_statement_list { $$ = Stmt\ElseIf_[$2, $4]; } -; - -else_single: - /* empty */ { $$ = null; } - | T_ELSE statement { $$ = Stmt\Else_[toArray($2)]; } -; - -new_else_single: - /* empty */ { $$ = null; } - | T_ELSE ':' inner_statement_list { $$ = Stmt\Else_[$3]; } -; - -foreach_variable: - variable { $$ = array($1, false); } - | ampersand variable { $$ = array($2, true); } - | list_expr { $$ = array($1, false); } -; - -parameter_list: - non_empty_parameter_list { $$ = $1; } - | /* empty */ { $$ = array(); } -; - -non_empty_parameter_list: - parameter { init($1); } - | non_empty_parameter_list ',' parameter { push($1, $3); } -; - -parameter: - optional_param_type optional_arg_ref optional_ellipsis plain_variable - { $$ = Node\Param[$4, null, $1, $2, $3]; $this->checkParam($$); } - | optional_param_type optional_arg_ref optional_ellipsis plain_variable '=' static_scalar - { $$ = Node\Param[$4, $6, $1, $2, $3]; $this->checkParam($$); } -; - -type: - name { $$ = $1; } - | T_ARRAY { $$ = Node\Identifier['array']; } - | T_CALLABLE { $$ = Node\Identifier['callable']; } -; - -optional_param_type: - /* empty */ { $$ = null; } - | type { $$ = $1; } -; - -optional_return_type: - /* empty */ { $$ = null; } - | ':' type { $$ = $2; } -; - -argument_list: - '(' ')' { $$ = array(); } - | '(' non_empty_argument_list ')' { $$ = $2; } - | '(' yield_expr ')' { $$ = array(Node\Arg[$2, false, false]); } -; - -non_empty_argument_list: - argument { init($1); } - | non_empty_argument_list ',' argument { push($1, $3); } -; - -argument: - expr { $$ = Node\Arg[$1, false, false]; } - | ampersand variable { $$ = Node\Arg[$2, true, false]; } - | T_ELLIPSIS expr { $$ = Node\Arg[$2, false, true]; } -; - -global_var_list: - global_var_list ',' global_var { push($1, $3); } - | global_var { init($1); } -; - -global_var: - plain_variable { $$ = $1; } - | '$' variable { $$ = Expr\Variable[$2]; } - | '$' '{' expr '}' { $$ = Expr\Variable[$3]; } -; - -static_var_list: - static_var_list ',' static_var { push($1, $3); } - | static_var { init($1); } -; - -static_var: - plain_variable { $$ = Stmt\StaticVar[$1, null]; } - | plain_variable '=' static_scalar { $$ = Stmt\StaticVar[$1, $3]; } -; - -class_statement_list_ex: - class_statement_list_ex class_statement { if ($2 !== null) { push($1, $2); } } - | /* empty */ { init(); } -; - -class_statement_list: - class_statement_list_ex - { makeZeroLengthNop($nop, $this->lookaheadStartAttributes); - if ($nop !== null) { $1[] = $nop; } $$ = $1; } -; - -class_statement: - variable_modifiers property_declaration_list ';' - { $$ = Stmt\Property[$1, $2]; $this->checkProperty($$, #1); } - | T_CONST class_const_list ';' { $$ = Stmt\ClassConst[$2, 0]; } - | method_modifiers T_FUNCTION optional_ref identifier_ex '(' parameter_list ')' optional_return_type method_body - { $$ = Stmt\ClassMethod[$4, ['type' => $1, 'byRef' => $3, 'params' => $6, 'returnType' => $8, 'stmts' => $9]]; - $this->checkClassMethod($$, #1); } - | T_USE class_name_list trait_adaptations { $$ = Stmt\TraitUse[$2, $3]; } -; - -trait_adaptations: - ';' { $$ = array(); } - | '{' trait_adaptation_list '}' { $$ = $2; } -; - -trait_adaptation_list: - /* empty */ { init(); } - | trait_adaptation_list trait_adaptation { push($1, $2); } -; - -trait_adaptation: - trait_method_reference_fully_qualified T_INSTEADOF class_name_list ';' - { $$ = Stmt\TraitUseAdaptation\Precedence[$1[0], $1[1], $3]; } - | trait_method_reference T_AS member_modifier identifier_ex ';' - { $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], $3, $4]; } - | trait_method_reference T_AS member_modifier ';' - { $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], $3, null]; } - | trait_method_reference T_AS identifier ';' - { $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], null, $3]; } - | trait_method_reference T_AS reserved_non_modifiers_identifier ';' - { $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], null, $3]; } -; - -trait_method_reference_fully_qualified: - name T_PAAMAYIM_NEKUDOTAYIM identifier_ex { $$ = array($1, $3); } -; -trait_method_reference: - trait_method_reference_fully_qualified { $$ = $1; } - | identifier_ex { $$ = array(null, $1); } -; - -method_body: - ';' /* abstract method */ { $$ = null; } - | '{' inner_statement_list '}' { $$ = $2; } -; - -variable_modifiers: - non_empty_member_modifiers { $$ = $1; } - | T_VAR { $$ = 0; } -; - -method_modifiers: - /* empty */ { $$ = 0; } - | non_empty_member_modifiers { $$ = $1; } -; - -non_empty_member_modifiers: - member_modifier { $$ = $1; } - | non_empty_member_modifiers member_modifier { $this->checkModifier($1, $2, #2); $$ = $1 | $2; } -; - -member_modifier: - T_PUBLIC { $$ = Stmt\Class_::MODIFIER_PUBLIC; } - | T_PROTECTED { $$ = Stmt\Class_::MODIFIER_PROTECTED; } - | T_PRIVATE { $$ = Stmt\Class_::MODIFIER_PRIVATE; } - | T_STATIC { $$ = Stmt\Class_::MODIFIER_STATIC; } - | T_ABSTRACT { $$ = Stmt\Class_::MODIFIER_ABSTRACT; } - | T_FINAL { $$ = Stmt\Class_::MODIFIER_FINAL; } -; - -property_declaration_list: - property_declaration { init($1); } - | property_declaration_list ',' property_declaration { push($1, $3); } -; - -property_decl_name: - T_VARIABLE { $$ = Node\VarLikeIdentifier[parseVar($1)]; } -; - -property_declaration: - property_decl_name { $$ = Stmt\PropertyProperty[$1, null]; } - | property_decl_name '=' static_scalar { $$ = Stmt\PropertyProperty[$1, $3]; } -; - -expr_list: - expr_list ',' expr { push($1, $3); } - | expr { init($1); } -; - -for_expr: - /* empty */ { $$ = array(); } - | expr_list { $$ = $1; } -; - -expr: - variable { $$ = $1; } - | list_expr '=' expr { $$ = Expr\Assign[$1, $3]; } - | variable '=' expr { $$ = Expr\Assign[$1, $3]; } - | variable '=' ampersand variable { $$ = Expr\AssignRef[$1, $4]; } - | variable '=' ampersand new_expr { $$ = Expr\AssignRef[$1, $4]; } - | new_expr { $$ = $1; } - | T_CLONE expr { $$ = Expr\Clone_[$2]; } - | variable T_PLUS_EQUAL expr { $$ = Expr\AssignOp\Plus [$1, $3]; } - | variable T_MINUS_EQUAL expr { $$ = Expr\AssignOp\Minus [$1, $3]; } - | variable T_MUL_EQUAL expr { $$ = Expr\AssignOp\Mul [$1, $3]; } - | variable T_DIV_EQUAL expr { $$ = Expr\AssignOp\Div [$1, $3]; } - | variable T_CONCAT_EQUAL expr { $$ = Expr\AssignOp\Concat [$1, $3]; } - | variable T_MOD_EQUAL expr { $$ = Expr\AssignOp\Mod [$1, $3]; } - | variable T_AND_EQUAL expr { $$ = Expr\AssignOp\BitwiseAnd[$1, $3]; } - | variable T_OR_EQUAL expr { $$ = Expr\AssignOp\BitwiseOr [$1, $3]; } - | variable T_XOR_EQUAL expr { $$ = Expr\AssignOp\BitwiseXor[$1, $3]; } - | variable T_SL_EQUAL expr { $$ = Expr\AssignOp\ShiftLeft [$1, $3]; } - | variable T_SR_EQUAL expr { $$ = Expr\AssignOp\ShiftRight[$1, $3]; } - | variable T_POW_EQUAL expr { $$ = Expr\AssignOp\Pow [$1, $3]; } - | variable T_COALESCE_EQUAL expr { $$ = Expr\AssignOp\Coalesce [$1, $3]; } - | variable T_INC { $$ = Expr\PostInc[$1]; } - | T_INC variable { $$ = Expr\PreInc [$2]; } - | variable T_DEC { $$ = Expr\PostDec[$1]; } - | T_DEC variable { $$ = Expr\PreDec [$2]; } - | expr T_BOOLEAN_OR expr { $$ = Expr\BinaryOp\BooleanOr [$1, $3]; } - | expr T_BOOLEAN_AND expr { $$ = Expr\BinaryOp\BooleanAnd[$1, $3]; } - | expr T_LOGICAL_OR expr { $$ = Expr\BinaryOp\LogicalOr [$1, $3]; } - | expr T_LOGICAL_AND expr { $$ = Expr\BinaryOp\LogicalAnd[$1, $3]; } - | expr T_LOGICAL_XOR expr { $$ = Expr\BinaryOp\LogicalXor[$1, $3]; } - | expr '|' expr { $$ = Expr\BinaryOp\BitwiseOr [$1, $3]; } - | expr T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG expr { $$ = Expr\BinaryOp\BitwiseAnd[$1, $3]; } - | expr T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG expr { $$ = Expr\BinaryOp\BitwiseAnd[$1, $3]; } - | expr '^' expr { $$ = Expr\BinaryOp\BitwiseXor[$1, $3]; } - | expr '.' expr { $$ = Expr\BinaryOp\Concat [$1, $3]; } - | expr '+' expr { $$ = Expr\BinaryOp\Plus [$1, $3]; } - | expr '-' expr { $$ = Expr\BinaryOp\Minus [$1, $3]; } - | expr '*' expr { $$ = Expr\BinaryOp\Mul [$1, $3]; } - | expr '/' expr { $$ = Expr\BinaryOp\Div [$1, $3]; } - | expr '%' expr { $$ = Expr\BinaryOp\Mod [$1, $3]; } - | expr T_SL expr { $$ = Expr\BinaryOp\ShiftLeft [$1, $3]; } - | expr T_SR expr { $$ = Expr\BinaryOp\ShiftRight[$1, $3]; } - | expr T_POW expr { $$ = Expr\BinaryOp\Pow [$1, $3]; } - | '+' expr %prec T_INC { $$ = Expr\UnaryPlus [$2]; } - | '-' expr %prec T_INC { $$ = Expr\UnaryMinus[$2]; } - | '!' expr { $$ = Expr\BooleanNot[$2]; } - | '~' expr { $$ = Expr\BitwiseNot[$2]; } - | expr T_IS_IDENTICAL expr { $$ = Expr\BinaryOp\Identical [$1, $3]; } - | expr T_IS_NOT_IDENTICAL expr { $$ = Expr\BinaryOp\NotIdentical [$1, $3]; } - | expr T_IS_EQUAL expr { $$ = Expr\BinaryOp\Equal [$1, $3]; } - | expr T_IS_NOT_EQUAL expr { $$ = Expr\BinaryOp\NotEqual [$1, $3]; } - | expr T_SPACESHIP expr { $$ = Expr\BinaryOp\Spaceship [$1, $3]; } - | expr '<' expr { $$ = Expr\BinaryOp\Smaller [$1, $3]; } - | expr T_IS_SMALLER_OR_EQUAL expr { $$ = Expr\BinaryOp\SmallerOrEqual[$1, $3]; } - | expr '>' expr { $$ = Expr\BinaryOp\Greater [$1, $3]; } - | expr T_IS_GREATER_OR_EQUAL expr { $$ = Expr\BinaryOp\GreaterOrEqual[$1, $3]; } - | expr T_INSTANCEOF class_name_reference { $$ = Expr\Instanceof_[$1, $3]; } - | parentheses_expr { $$ = $1; } - /* we need a separate '(' new_expr ')' rule to avoid problems caused by a s/r conflict */ - | '(' new_expr ')' { $$ = $2; } - | expr '?' expr ':' expr { $$ = Expr\Ternary[$1, $3, $5]; } - | expr '?' ':' expr { $$ = Expr\Ternary[$1, null, $4]; } - | expr T_COALESCE expr { $$ = Expr\BinaryOp\Coalesce[$1, $3]; } - | T_ISSET '(' variables_list ')' { $$ = Expr\Isset_[$3]; } - | T_EMPTY '(' expr ')' { $$ = Expr\Empty_[$3]; } - | T_INCLUDE expr { $$ = Expr\Include_[$2, Expr\Include_::TYPE_INCLUDE]; } - | T_INCLUDE_ONCE expr { $$ = Expr\Include_[$2, Expr\Include_::TYPE_INCLUDE_ONCE]; } - | T_EVAL parentheses_expr { $$ = Expr\Eval_[$2]; } - | T_REQUIRE expr { $$ = Expr\Include_[$2, Expr\Include_::TYPE_REQUIRE]; } - | T_REQUIRE_ONCE expr { $$ = Expr\Include_[$2, Expr\Include_::TYPE_REQUIRE_ONCE]; } - | T_INT_CAST expr { $$ = Expr\Cast\Int_ [$2]; } - | T_DOUBLE_CAST expr - { $attrs = attributes(); - $attrs['kind'] = $this->getFloatCastKind($1); - $$ = new Expr\Cast\Double($2, $attrs); } - | T_STRING_CAST expr { $$ = Expr\Cast\String_ [$2]; } - | T_ARRAY_CAST expr { $$ = Expr\Cast\Array_ [$2]; } - | T_OBJECT_CAST expr { $$ = Expr\Cast\Object_ [$2]; } - | T_BOOL_CAST expr { $$ = Expr\Cast\Bool_ [$2]; } - | T_UNSET_CAST expr { $$ = Expr\Cast\Unset_ [$2]; } - | T_EXIT exit_expr - { $attrs = attributes(); - $attrs['kind'] = strtolower($1) === 'exit' ? Expr\Exit_::KIND_EXIT : Expr\Exit_::KIND_DIE; - $$ = new Expr\Exit_($2, $attrs); } - | '@' expr { $$ = Expr\ErrorSuppress[$2]; } - | scalar { $$ = $1; } - | array_expr { $$ = $1; } - | scalar_dereference { $$ = $1; } - | '`' backticks_expr '`' { $$ = Expr\ShellExec[$2]; } - | T_PRINT expr { $$ = Expr\Print_[$2]; } - | T_YIELD { $$ = Expr\Yield_[null, null]; } - | T_YIELD_FROM expr { $$ = Expr\YieldFrom[$2]; } - | T_FUNCTION optional_ref '(' parameter_list ')' lexical_vars optional_return_type - '{' inner_statement_list '}' - { $$ = Expr\Closure[['static' => false, 'byRef' => $2, 'params' => $4, 'uses' => $6, 'returnType' => $7, 'stmts' => $9]]; } - | T_STATIC T_FUNCTION optional_ref '(' parameter_list ')' lexical_vars optional_return_type - '{' inner_statement_list '}' - { $$ = Expr\Closure[['static' => true, 'byRef' => $3, 'params' => $5, 'uses' => $7, 'returnType' => $8, 'stmts' => $10]]; } -; - -parentheses_expr: - '(' expr ')' { $$ = $2; } - | '(' yield_expr ')' { $$ = $2; } -; - -yield_expr: - T_YIELD expr { $$ = Expr\Yield_[$2, null]; } - | T_YIELD expr T_DOUBLE_ARROW expr { $$ = Expr\Yield_[$4, $2]; } -; - -array_expr: - T_ARRAY '(' array_pair_list ')' - { $attrs = attributes(); $attrs['kind'] = Expr\Array_::KIND_LONG; - $$ = new Expr\Array_($3, $attrs); } - | '[' array_pair_list ']' - { $attrs = attributes(); $attrs['kind'] = Expr\Array_::KIND_SHORT; - $$ = new Expr\Array_($2, $attrs); } -; - -scalar_dereference: - array_expr '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | T_CONSTANT_ENCAPSED_STRING '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[Scalar\String_::fromString($1, attributes()), $3]; } - | constant '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | scalar_dereference '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - /* alternative array syntax missing intentionally */ -; - -anonymous_class: - T_CLASS ctor_arguments extends_from implements_list '{' class_statement_list '}' - { $$ = array(Stmt\Class_[null, ['type' => 0, 'extends' => $3, 'implements' => $4, 'stmts' => $6]], $2); - $this->checkClass($$[0], -1); } -; - -new_expr: - T_NEW class_name_reference ctor_arguments { $$ = Expr\New_[$2, $3]; } - | T_NEW anonymous_class - { list($class, $ctorArgs) = $2; $$ = Expr\New_[$class, $ctorArgs]; } -; - -lexical_vars: - /* empty */ { $$ = array(); } - | T_USE '(' lexical_var_list ')' { $$ = $3; } -; - -lexical_var_list: - lexical_var { init($1); } - | lexical_var_list ',' lexical_var { push($1, $3); } -; - -lexical_var: - optional_ref plain_variable { $$ = Expr\ClosureUse[$2, $1]; } -; - -function_call: - name argument_list { $$ = Expr\FuncCall[$1, $2]; } - | class_name_or_var T_PAAMAYIM_NEKUDOTAYIM identifier_ex argument_list - { $$ = Expr\StaticCall[$1, $3, $4]; } - | class_name_or_var T_PAAMAYIM_NEKUDOTAYIM '{' expr '}' argument_list - { $$ = Expr\StaticCall[$1, $4, $6]; } - | static_property argument_list - { $$ = $this->fixupPhp5StaticPropCall($1, $2, attributes()); } - | variable_without_objects argument_list - { $$ = Expr\FuncCall[$1, $2]; } - | function_call '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - /* alternative array syntax missing intentionally */ -; - -class_name: - T_STATIC { $$ = Name[$1]; } - | name { $$ = $1; } -; - -name: - T_STRING { $$ = Name[$1]; } - | T_NAME_QUALIFIED { $$ = Name[$1]; } - | T_NAME_FULLY_QUALIFIED { $$ = Name\FullyQualified[substr($1, 1)]; } - | T_NAME_RELATIVE { $$ = Name\Relative[substr($1, 10)]; } -; - -class_name_reference: - class_name { $$ = $1; } - | dynamic_class_name_reference { $$ = $1; } -; - -dynamic_class_name_reference: - object_access_for_dcnr { $$ = $1; } - | base_variable { $$ = $1; } -; - -class_name_or_var: - class_name { $$ = $1; } - | reference_variable { $$ = $1; } -; - -object_access_for_dcnr: - base_variable T_OBJECT_OPERATOR object_property - { $$ = Expr\PropertyFetch[$1, $3]; } - | object_access_for_dcnr T_OBJECT_OPERATOR object_property - { $$ = Expr\PropertyFetch[$1, $3]; } - | object_access_for_dcnr '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | object_access_for_dcnr '{' expr '}' { $$ = Expr\ArrayDimFetch[$1, $3]; } -; - -exit_expr: - /* empty */ { $$ = null; } - | '(' ')' { $$ = null; } - | parentheses_expr { $$ = $1; } -; - -backticks_expr: - /* empty */ { $$ = array(); } - | T_ENCAPSED_AND_WHITESPACE - { $$ = array(Scalar\EncapsedStringPart[Scalar\String_::parseEscapeSequences($1, '`', false)]); } - | encaps_list { parseEncapsed($1, '`', false); $$ = $1; } -; - -ctor_arguments: - /* empty */ { $$ = array(); } - | argument_list { $$ = $1; } -; - -common_scalar: - T_LNUMBER { $$ = $this->parseLNumber($1, attributes(), true); } - | T_DNUMBER { $$ = Scalar\DNumber::fromString($1, attributes()); } - | T_CONSTANT_ENCAPSED_STRING { $$ = Scalar\String_::fromString($1, attributes(), false); } - | T_LINE { $$ = Scalar\MagicConst\Line[]; } - | T_FILE { $$ = Scalar\MagicConst\File[]; } - | T_DIR { $$ = Scalar\MagicConst\Dir[]; } - | T_CLASS_C { $$ = Scalar\MagicConst\Class_[]; } - | T_TRAIT_C { $$ = Scalar\MagicConst\Trait_[]; } - | T_METHOD_C { $$ = Scalar\MagicConst\Method[]; } - | T_FUNC_C { $$ = Scalar\MagicConst\Function_[]; } - | T_NS_C { $$ = Scalar\MagicConst\Namespace_[]; } - | T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC - { $$ = $this->parseDocString($1, $2, $3, attributes(), stackAttributes(#3), false); } - | T_START_HEREDOC T_END_HEREDOC - { $$ = $this->parseDocString($1, '', $2, attributes(), stackAttributes(#2), false); } -; - -static_scalar: - common_scalar { $$ = $1; } - | class_name T_PAAMAYIM_NEKUDOTAYIM identifier_ex { $$ = Expr\ClassConstFetch[$1, $3]; } - | name { $$ = Expr\ConstFetch[$1]; } - | T_ARRAY '(' static_array_pair_list ')' { $$ = Expr\Array_[$3]; } - | '[' static_array_pair_list ']' { $$ = Expr\Array_[$2]; } - | static_operation { $$ = $1; } -; - -static_operation: - static_scalar T_BOOLEAN_OR static_scalar { $$ = Expr\BinaryOp\BooleanOr [$1, $3]; } - | static_scalar T_BOOLEAN_AND static_scalar { $$ = Expr\BinaryOp\BooleanAnd[$1, $3]; } - | static_scalar T_LOGICAL_OR static_scalar { $$ = Expr\BinaryOp\LogicalOr [$1, $3]; } - | static_scalar T_LOGICAL_AND static_scalar { $$ = Expr\BinaryOp\LogicalAnd[$1, $3]; } - | static_scalar T_LOGICAL_XOR static_scalar { $$ = Expr\BinaryOp\LogicalXor[$1, $3]; } - | static_scalar '|' static_scalar { $$ = Expr\BinaryOp\BitwiseOr [$1, $3]; } - | static_scalar T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG static_scalar - { $$ = Expr\BinaryOp\BitwiseAnd[$1, $3]; } - | static_scalar T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG static_scalar - { $$ = Expr\BinaryOp\BitwiseAnd[$1, $3]; } - | static_scalar '^' static_scalar { $$ = Expr\BinaryOp\BitwiseXor[$1, $3]; } - | static_scalar '.' static_scalar { $$ = Expr\BinaryOp\Concat [$1, $3]; } - | static_scalar '+' static_scalar { $$ = Expr\BinaryOp\Plus [$1, $3]; } - | static_scalar '-' static_scalar { $$ = Expr\BinaryOp\Minus [$1, $3]; } - | static_scalar '*' static_scalar { $$ = Expr\BinaryOp\Mul [$1, $3]; } - | static_scalar '/' static_scalar { $$ = Expr\BinaryOp\Div [$1, $3]; } - | static_scalar '%' static_scalar { $$ = Expr\BinaryOp\Mod [$1, $3]; } - | static_scalar T_SL static_scalar { $$ = Expr\BinaryOp\ShiftLeft [$1, $3]; } - | static_scalar T_SR static_scalar { $$ = Expr\BinaryOp\ShiftRight[$1, $3]; } - | static_scalar T_POW static_scalar { $$ = Expr\BinaryOp\Pow [$1, $3]; } - | '+' static_scalar %prec T_INC { $$ = Expr\UnaryPlus [$2]; } - | '-' static_scalar %prec T_INC { $$ = Expr\UnaryMinus[$2]; } - | '!' static_scalar { $$ = Expr\BooleanNot[$2]; } - | '~' static_scalar { $$ = Expr\BitwiseNot[$2]; } - | static_scalar T_IS_IDENTICAL static_scalar { $$ = Expr\BinaryOp\Identical [$1, $3]; } - | static_scalar T_IS_NOT_IDENTICAL static_scalar { $$ = Expr\BinaryOp\NotIdentical [$1, $3]; } - | static_scalar T_IS_EQUAL static_scalar { $$ = Expr\BinaryOp\Equal [$1, $3]; } - | static_scalar T_IS_NOT_EQUAL static_scalar { $$ = Expr\BinaryOp\NotEqual [$1, $3]; } - | static_scalar '<' static_scalar { $$ = Expr\BinaryOp\Smaller [$1, $3]; } - | static_scalar T_IS_SMALLER_OR_EQUAL static_scalar { $$ = Expr\BinaryOp\SmallerOrEqual[$1, $3]; } - | static_scalar '>' static_scalar { $$ = Expr\BinaryOp\Greater [$1, $3]; } - | static_scalar T_IS_GREATER_OR_EQUAL static_scalar { $$ = Expr\BinaryOp\GreaterOrEqual[$1, $3]; } - | static_scalar '?' static_scalar ':' static_scalar { $$ = Expr\Ternary[$1, $3, $5]; } - | static_scalar '?' ':' static_scalar { $$ = Expr\Ternary[$1, null, $4]; } - | static_scalar '[' static_scalar ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | '(' static_scalar ')' { $$ = $2; } -; - -constant: - name { $$ = Expr\ConstFetch[$1]; } - | class_name_or_var T_PAAMAYIM_NEKUDOTAYIM identifier_ex - { $$ = Expr\ClassConstFetch[$1, $3]; } -; - -scalar: - common_scalar { $$ = $1; } - | constant { $$ = $1; } - | '"' encaps_list '"' - { $attrs = attributes(); $attrs['kind'] = Scalar\String_::KIND_DOUBLE_QUOTED; - parseEncapsed($2, '"', true); $$ = new Scalar\Encapsed($2, $attrs); } - | T_START_HEREDOC encaps_list T_END_HEREDOC - { $$ = $this->parseDocString($1, $2, $3, attributes(), stackAttributes(#3), true); } -; - -static_array_pair_list: - /* empty */ { $$ = array(); } - | non_empty_static_array_pair_list optional_comma { $$ = $1; } -; - -optional_comma: - /* empty */ - | ',' -; - -non_empty_static_array_pair_list: - non_empty_static_array_pair_list ',' static_array_pair { push($1, $3); } - | static_array_pair { init($1); } -; - -static_array_pair: - static_scalar T_DOUBLE_ARROW static_scalar { $$ = Expr\ArrayItem[$3, $1, false]; } - | static_scalar { $$ = Expr\ArrayItem[$1, null, false]; } -; - -variable: - object_access { $$ = $1; } - | base_variable { $$ = $1; } - | function_call { $$ = $1; } - | new_expr_array_deref { $$ = $1; } -; - -new_expr_array_deref: - '(' new_expr ')' '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$2, $5]; } - | new_expr_array_deref '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - /* alternative array syntax missing intentionally */ -; - -object_access: - variable_or_new_expr T_OBJECT_OPERATOR object_property - { $$ = Expr\PropertyFetch[$1, $3]; } - | variable_or_new_expr T_OBJECT_OPERATOR object_property argument_list - { $$ = Expr\MethodCall[$1, $3, $4]; } - | object_access argument_list { $$ = Expr\FuncCall[$1, $2]; } - | object_access '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | object_access '{' expr '}' { $$ = Expr\ArrayDimFetch[$1, $3]; } -; - -variable_or_new_expr: - variable { $$ = $1; } - | '(' new_expr ')' { $$ = $2; } -; - -variable_without_objects: - reference_variable { $$ = $1; } - | '$' variable_without_objects { $$ = Expr\Variable[$2]; } -; - -base_variable: - variable_without_objects { $$ = $1; } - | static_property { $$ = $1; } -; - -static_property: - class_name_or_var T_PAAMAYIM_NEKUDOTAYIM '$' reference_variable - { $$ = Expr\StaticPropertyFetch[$1, $4]; } - | static_property_with_arrays { $$ = $1; } -; - -static_property_simple_name: - T_VARIABLE - { $var = parseVar($1); $$ = \is_string($var) ? Node\VarLikeIdentifier[$var] : $var; } -; - -static_property_with_arrays: - class_name_or_var T_PAAMAYIM_NEKUDOTAYIM static_property_simple_name - { $$ = Expr\StaticPropertyFetch[$1, $3]; } - | class_name_or_var T_PAAMAYIM_NEKUDOTAYIM '$' '{' expr '}' - { $$ = Expr\StaticPropertyFetch[$1, $5]; } - | static_property_with_arrays '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | static_property_with_arrays '{' expr '}' { $$ = Expr\ArrayDimFetch[$1, $3]; } -; - -reference_variable: - reference_variable '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | reference_variable '{' expr '}' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | plain_variable { $$ = $1; } - | '$' '{' expr '}' { $$ = Expr\Variable[$3]; } -; - -dim_offset: - /* empty */ { $$ = null; } - | expr { $$ = $1; } -; - -object_property: - identifier { $$ = $1; } - | '{' expr '}' { $$ = $2; } - | variable_without_objects { $$ = $1; } - | error { $$ = Expr\Error[]; $this->errorState = 2; } -; - -list_expr: - T_LIST '(' list_expr_elements ')' { $$ = Expr\List_[$3]; } -; - -list_expr_elements: - list_expr_elements ',' list_expr_element { push($1, $3); } - | list_expr_element { init($1); } -; - -list_expr_element: - variable { $$ = Expr\ArrayItem[$1, null, false]; } - | list_expr { $$ = Expr\ArrayItem[$1, null, false]; } - | /* empty */ { $$ = null; } -; - -array_pair_list: - /* empty */ { $$ = array(); } - | non_empty_array_pair_list optional_comma { $$ = $1; } -; - -non_empty_array_pair_list: - non_empty_array_pair_list ',' array_pair { push($1, $3); } - | array_pair { init($1); } -; - -array_pair: - expr T_DOUBLE_ARROW expr { $$ = Expr\ArrayItem[$3, $1, false]; } - | expr { $$ = Expr\ArrayItem[$1, null, false]; } - | expr T_DOUBLE_ARROW ampersand variable { $$ = Expr\ArrayItem[$4, $1, true]; } - | ampersand variable { $$ = Expr\ArrayItem[$2, null, true]; } - | T_ELLIPSIS expr { $$ = Expr\ArrayItem[$2, null, false, attributes(), true]; } -; - -encaps_list: - encaps_list encaps_var { push($1, $2); } - | encaps_list encaps_string_part { push($1, $2); } - | encaps_var { init($1); } - | encaps_string_part encaps_var { init($1, $2); } -; - -encaps_string_part: - T_ENCAPSED_AND_WHITESPACE { $$ = Scalar\EncapsedStringPart[$1]; } -; - -encaps_str_varname: - T_STRING_VARNAME { $$ = Expr\Variable[$1]; } -; - -encaps_var: - plain_variable { $$ = $1; } - | plain_variable '[' encaps_var_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | plain_variable T_OBJECT_OPERATOR identifier { $$ = Expr\PropertyFetch[$1, $3]; } - | T_DOLLAR_OPEN_CURLY_BRACES expr '}' { $$ = Expr\Variable[$2]; } - | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}' { $$ = Expr\Variable[$2]; } - | T_DOLLAR_OPEN_CURLY_BRACES encaps_str_varname '[' expr ']' '}' - { $$ = Expr\ArrayDimFetch[$2, $4]; } - | T_CURLY_OPEN variable '}' { $$ = $2; } -; - -encaps_var_offset: - T_STRING { $$ = Scalar\String_[$1]; } - | T_NUM_STRING { $$ = $this->parseNumString($1, attributes()); } - | plain_variable { $$ = $1; } -; - -%% diff --git a/vendor/nikic/php-parser/grammar/php7.y b/vendor/nikic/php-parser/grammar/php7.y deleted file mode 100644 index 5d5fff21..00000000 --- a/vendor/nikic/php-parser/grammar/php7.y +++ /dev/null @@ -1,1222 +0,0 @@ -%pure_parser -%expect 2 - -%tokens - -%% - -start: - top_statement_list { $$ = $this->handleNamespaces($1); } -; - -top_statement_list_ex: - top_statement_list_ex top_statement { pushNormalizing($1, $2); } - | /* empty */ { init(); } -; - -top_statement_list: - top_statement_list_ex - { makeZeroLengthNop($nop, $this->lookaheadStartAttributes); - if ($nop !== null) { $1[] = $nop; } $$ = $1; } -; - -ampersand: - T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG - | T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG -; - -reserved_non_modifiers: - T_INCLUDE | T_INCLUDE_ONCE | T_EVAL | T_REQUIRE | T_REQUIRE_ONCE | T_LOGICAL_OR | T_LOGICAL_XOR | T_LOGICAL_AND - | T_INSTANCEOF | T_NEW | T_CLONE | T_EXIT | T_IF | T_ELSEIF | T_ELSE | T_ENDIF | T_ECHO | T_DO | T_WHILE - | T_ENDWHILE | T_FOR | T_ENDFOR | T_FOREACH | T_ENDFOREACH | T_DECLARE | T_ENDDECLARE | T_AS | T_TRY | T_CATCH - | T_FINALLY | T_THROW | T_USE | T_INSTEADOF | T_GLOBAL | T_VAR | T_UNSET | T_ISSET | T_EMPTY | T_CONTINUE | T_GOTO - | T_FUNCTION | T_CONST | T_RETURN | T_PRINT | T_YIELD | T_LIST | T_SWITCH | T_ENDSWITCH | T_CASE | T_DEFAULT - | T_BREAK | T_ARRAY | T_CALLABLE | T_EXTENDS | T_IMPLEMENTS | T_NAMESPACE | T_TRAIT | T_INTERFACE | T_CLASS - | T_CLASS_C | T_TRAIT_C | T_FUNC_C | T_METHOD_C | T_LINE | T_FILE | T_DIR | T_NS_C | T_HALT_COMPILER | T_FN - | T_MATCH | T_ENUM -; - -semi_reserved: - reserved_non_modifiers - | T_STATIC | T_ABSTRACT | T_FINAL | T_PRIVATE | T_PROTECTED | T_PUBLIC | T_READONLY -; - -identifier_maybe_reserved: - T_STRING { $$ = Node\Identifier[$1]; } - | semi_reserved { $$ = Node\Identifier[$1]; } -; - -identifier_not_reserved: - T_STRING { $$ = Node\Identifier[$1]; } -; - -reserved_non_modifiers_identifier: - reserved_non_modifiers { $$ = Node\Identifier[$1]; } -; - -namespace_declaration_name: - T_STRING { $$ = Name[$1]; } - | semi_reserved { $$ = Name[$1]; } - | T_NAME_QUALIFIED { $$ = Name[$1]; } -; - -namespace_name: - T_STRING { $$ = Name[$1]; } - | T_NAME_QUALIFIED { $$ = Name[$1]; } -; - -legacy_namespace_name: - namespace_name { $$ = $1; } - | T_NAME_FULLY_QUALIFIED { $$ = Name[substr($1, 1)]; } -; - -plain_variable: - T_VARIABLE { $$ = Expr\Variable[parseVar($1)]; } -; - -semi: - ';' { /* nothing */ } - | error { /* nothing */ } -; - -no_comma: - /* empty */ { /* nothing */ } - | ',' { $this->emitError(new Error('A trailing comma is not allowed here', attributes())); } -; - -optional_comma: - /* empty */ - | ',' -; - -attribute_decl: - class_name { $$ = Node\Attribute[$1, []]; } - | class_name argument_list { $$ = Node\Attribute[$1, $2]; } -; - -attribute_group: - attribute_decl { init($1); } - | attribute_group ',' attribute_decl { push($1, $3); } -; - -attribute: - T_ATTRIBUTE attribute_group optional_comma ']' { $$ = Node\AttributeGroup[$2]; } -; - -attributes: - attribute { init($1); } - | attributes attribute { push($1, $2); } -; - -optional_attributes: - /* empty */ { $$ = []; } - | attributes { $$ = $1; } -; - -top_statement: - statement { $$ = $1; } - | function_declaration_statement { $$ = $1; } - | class_declaration_statement { $$ = $1; } - | T_HALT_COMPILER - { $$ = Stmt\HaltCompiler[$this->lexer->handleHaltCompiler()]; } - | T_NAMESPACE namespace_declaration_name semi - { $$ = Stmt\Namespace_[$2, null]; - $$->setAttribute('kind', Stmt\Namespace_::KIND_SEMICOLON); - $this->checkNamespace($$); } - | T_NAMESPACE namespace_declaration_name '{' top_statement_list '}' - { $$ = Stmt\Namespace_[$2, $4]; - $$->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); - $this->checkNamespace($$); } - | T_NAMESPACE '{' top_statement_list '}' - { $$ = Stmt\Namespace_[null, $3]; - $$->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); - $this->checkNamespace($$); } - | T_USE use_declarations semi { $$ = Stmt\Use_[$2, Stmt\Use_::TYPE_NORMAL]; } - | T_USE use_type use_declarations semi { $$ = Stmt\Use_[$3, $2]; } - | group_use_declaration semi { $$ = $1; } - | T_CONST constant_declaration_list semi { $$ = Stmt\Const_[$2]; } -; - -use_type: - T_FUNCTION { $$ = Stmt\Use_::TYPE_FUNCTION; } - | T_CONST { $$ = Stmt\Use_::TYPE_CONSTANT; } -; - -group_use_declaration: - T_USE use_type legacy_namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations '}' - { $$ = Stmt\GroupUse[$3, $6, $2]; } - | T_USE legacy_namespace_name T_NS_SEPARATOR '{' inline_use_declarations '}' - { $$ = Stmt\GroupUse[$2, $5, Stmt\Use_::TYPE_UNKNOWN]; } -; - -unprefixed_use_declarations: - non_empty_unprefixed_use_declarations optional_comma { $$ = $1; } -; - -non_empty_unprefixed_use_declarations: - non_empty_unprefixed_use_declarations ',' unprefixed_use_declaration - { push($1, $3); } - | unprefixed_use_declaration { init($1); } -; - -use_declarations: - non_empty_use_declarations no_comma { $$ = $1; } -; - -non_empty_use_declarations: - non_empty_use_declarations ',' use_declaration { push($1, $3); } - | use_declaration { init($1); } -; - -inline_use_declarations: - non_empty_inline_use_declarations optional_comma { $$ = $1; } -; - -non_empty_inline_use_declarations: - non_empty_inline_use_declarations ',' inline_use_declaration - { push($1, $3); } - | inline_use_declaration { init($1); } -; - -unprefixed_use_declaration: - namespace_name - { $$ = Stmt\UseUse[$1, null, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #1); } - | namespace_name T_AS identifier_not_reserved - { $$ = Stmt\UseUse[$1, $3, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #3); } -; - -use_declaration: - legacy_namespace_name - { $$ = Stmt\UseUse[$1, null, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #1); } - | legacy_namespace_name T_AS identifier_not_reserved - { $$ = Stmt\UseUse[$1, $3, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #3); } -; - -inline_use_declaration: - unprefixed_use_declaration { $$ = $1; $$->type = Stmt\Use_::TYPE_NORMAL; } - | use_type unprefixed_use_declaration { $$ = $2; $$->type = $1; } -; - -constant_declaration_list: - non_empty_constant_declaration_list no_comma { $$ = $1; } -; - -non_empty_constant_declaration_list: - non_empty_constant_declaration_list ',' constant_declaration - { push($1, $3); } - | constant_declaration { init($1); } -; - -constant_declaration: - identifier_not_reserved '=' expr { $$ = Node\Const_[$1, $3]; } -; - -class_const_list: - non_empty_class_const_list no_comma { $$ = $1; } -; - -non_empty_class_const_list: - non_empty_class_const_list ',' class_const { push($1, $3); } - | class_const { init($1); } -; - -class_const: - identifier_maybe_reserved '=' expr { $$ = Node\Const_[$1, $3]; } -; - -inner_statement_list_ex: - inner_statement_list_ex inner_statement { pushNormalizing($1, $2); } - | /* empty */ { init(); } -; - -inner_statement_list: - inner_statement_list_ex - { makeZeroLengthNop($nop, $this->lookaheadStartAttributes); - if ($nop !== null) { $1[] = $nop; } $$ = $1; } -; - -inner_statement: - statement { $$ = $1; } - | function_declaration_statement { $$ = $1; } - | class_declaration_statement { $$ = $1; } - | T_HALT_COMPILER - { throw new Error('__HALT_COMPILER() can only be used from the outermost scope', attributes()); } -; - -non_empty_statement: - '{' inner_statement_list '}' - { - if ($2) { - $$ = $2; prependLeadingComments($$); - } else { - makeNop($$, $this->startAttributeStack[#1], $this->endAttributes); - if (null === $$) { $$ = array(); } - } - } - | T_IF '(' expr ')' statement elseif_list else_single - { $$ = Stmt\If_[$3, ['stmts' => toArray($5), 'elseifs' => $6, 'else' => $7]]; } - | T_IF '(' expr ')' ':' inner_statement_list new_elseif_list new_else_single T_ENDIF ';' - { $$ = Stmt\If_[$3, ['stmts' => $6, 'elseifs' => $7, 'else' => $8]]; } - | T_WHILE '(' expr ')' while_statement { $$ = Stmt\While_[$3, $5]; } - | T_DO statement T_WHILE '(' expr ')' ';' { $$ = Stmt\Do_ [$5, toArray($2)]; } - | T_FOR '(' for_expr ';' for_expr ';' for_expr ')' for_statement - { $$ = Stmt\For_[['init' => $3, 'cond' => $5, 'loop' => $7, 'stmts' => $9]]; } - | T_SWITCH '(' expr ')' switch_case_list { $$ = Stmt\Switch_[$3, $5]; } - | T_BREAK optional_expr semi { $$ = Stmt\Break_[$2]; } - | T_CONTINUE optional_expr semi { $$ = Stmt\Continue_[$2]; } - | T_RETURN optional_expr semi { $$ = Stmt\Return_[$2]; } - | T_GLOBAL global_var_list semi { $$ = Stmt\Global_[$2]; } - | T_STATIC static_var_list semi { $$ = Stmt\Static_[$2]; } - | T_ECHO expr_list_forbid_comma semi { $$ = Stmt\Echo_[$2]; } - | T_INLINE_HTML { $$ = Stmt\InlineHTML[$1]; } - | expr semi { - $e = $1; - if ($e instanceof Expr\Throw_) { - // For backwards-compatibility reasons, convert throw in statement position into - // Stmt\Throw_ rather than Stmt\Expression(Expr\Throw_). - $$ = Stmt\Throw_[$e->expr]; - } else { - $$ = Stmt\Expression[$e]; - } - } - | T_UNSET '(' variables_list ')' semi { $$ = Stmt\Unset_[$3]; } - | T_FOREACH '(' expr T_AS foreach_variable ')' foreach_statement - { $$ = Stmt\Foreach_[$3, $5[0], ['keyVar' => null, 'byRef' => $5[1], 'stmts' => $7]]; } - | T_FOREACH '(' expr T_AS variable T_DOUBLE_ARROW foreach_variable ')' foreach_statement - { $$ = Stmt\Foreach_[$3, $7[0], ['keyVar' => $5, 'byRef' => $7[1], 'stmts' => $9]]; } - | T_FOREACH '(' expr error ')' foreach_statement - { $$ = Stmt\Foreach_[$3, new Expr\Error(stackAttributes(#4)), ['stmts' => $6]]; } - | T_DECLARE '(' declare_list ')' declare_statement { $$ = Stmt\Declare_[$3, $5]; } - | T_TRY '{' inner_statement_list '}' catches optional_finally - { $$ = Stmt\TryCatch[$3, $5, $6]; $this->checkTryCatch($$); } - | T_GOTO identifier_not_reserved semi { $$ = Stmt\Goto_[$2]; } - | identifier_not_reserved ':' { $$ = Stmt\Label[$1]; } - | error { $$ = array(); /* means: no statement */ } -; - -statement: - non_empty_statement { $$ = $1; } - | ';' - { makeNop($$, $this->startAttributeStack[#1], $this->endAttributes); - if ($$ === null) $$ = array(); /* means: no statement */ } -; - -catches: - /* empty */ { init(); } - | catches catch { push($1, $2); } -; - -name_union: - name { init($1); } - | name_union '|' name { push($1, $3); } -; - -catch: - T_CATCH '(' name_union optional_plain_variable ')' '{' inner_statement_list '}' - { $$ = Stmt\Catch_[$3, $4, $7]; } -; - -optional_finally: - /* empty */ { $$ = null; } - | T_FINALLY '{' inner_statement_list '}' { $$ = Stmt\Finally_[$3]; } -; - -variables_list: - non_empty_variables_list optional_comma { $$ = $1; } -; - -non_empty_variables_list: - variable { init($1); } - | non_empty_variables_list ',' variable { push($1, $3); } -; - -optional_ref: - /* empty */ { $$ = false; } - | ampersand { $$ = true; } -; - -optional_arg_ref: - /* empty */ { $$ = false; } - | T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG { $$ = true; } -; - -optional_ellipsis: - /* empty */ { $$ = false; } - | T_ELLIPSIS { $$ = true; } -; - -block_or_error: - '{' inner_statement_list '}' { $$ = $2; } - | error { $$ = []; } -; - -function_declaration_statement: - T_FUNCTION optional_ref identifier_not_reserved '(' parameter_list ')' optional_return_type block_or_error - { $$ = Stmt\Function_[$3, ['byRef' => $2, 'params' => $5, 'returnType' => $7, 'stmts' => $8, 'attrGroups' => []]]; } - | attributes T_FUNCTION optional_ref identifier_not_reserved '(' parameter_list ')' optional_return_type block_or_error - { $$ = Stmt\Function_[$4, ['byRef' => $3, 'params' => $6, 'returnType' => $8, 'stmts' => $9, 'attrGroups' => $1]]; } -; - -class_declaration_statement: - optional_attributes class_entry_type identifier_not_reserved extends_from implements_list '{' class_statement_list '}' - { $$ = Stmt\Class_[$3, ['type' => $2, 'extends' => $4, 'implements' => $5, 'stmts' => $7, 'attrGroups' => $1]]; - $this->checkClass($$, #3); } - | optional_attributes T_INTERFACE identifier_not_reserved interface_extends_list '{' class_statement_list '}' - { $$ = Stmt\Interface_[$3, ['extends' => $4, 'stmts' => $6, 'attrGroups' => $1]]; - $this->checkInterface($$, #3); } - | optional_attributes T_TRAIT identifier_not_reserved '{' class_statement_list '}' - { $$ = Stmt\Trait_[$3, ['stmts' => $5, 'attrGroups' => $1]]; } - | optional_attributes T_ENUM identifier_not_reserved enum_scalar_type implements_list '{' class_statement_list '}' - { $$ = Stmt\Enum_[$3, ['scalarType' => $4, 'implements' => $5, 'stmts' => $7, 'attrGroups' => $1]]; - $this->checkEnum($$, #3); } -; - -enum_scalar_type: - /* empty */ { $$ = null; } - | ':' type { $$ = $2; } - -enum_case_expr: - /* empty */ { $$ = null; } - | '=' expr { $$ = $2; } -; - -class_entry_type: - T_CLASS { $$ = 0; } - | class_modifiers T_CLASS { $$ = $1; } -; - -class_modifiers: - class_modifier { $$ = $1; } - | class_modifiers class_modifier { $this->checkClassModifier($1, $2, #2); $$ = $1 | $2; } -; - -class_modifier: - T_ABSTRACT { $$ = Stmt\Class_::MODIFIER_ABSTRACT; } - | T_FINAL { $$ = Stmt\Class_::MODIFIER_FINAL; } - | T_READONLY { $$ = Stmt\Class_::MODIFIER_READONLY; } -; - -extends_from: - /* empty */ { $$ = null; } - | T_EXTENDS class_name { $$ = $2; } -; - -interface_extends_list: - /* empty */ { $$ = array(); } - | T_EXTENDS class_name_list { $$ = $2; } -; - -implements_list: - /* empty */ { $$ = array(); } - | T_IMPLEMENTS class_name_list { $$ = $2; } -; - -class_name_list: - non_empty_class_name_list no_comma { $$ = $1; } -; - -non_empty_class_name_list: - class_name { init($1); } - | non_empty_class_name_list ',' class_name { push($1, $3); } -; - -for_statement: - statement { $$ = toArray($1); } - | ':' inner_statement_list T_ENDFOR ';' { $$ = $2; } -; - -foreach_statement: - statement { $$ = toArray($1); } - | ':' inner_statement_list T_ENDFOREACH ';' { $$ = $2; } -; - -declare_statement: - non_empty_statement { $$ = toArray($1); } - | ';' { $$ = null; } - | ':' inner_statement_list T_ENDDECLARE ';' { $$ = $2; } -; - -declare_list: - non_empty_declare_list no_comma { $$ = $1; } -; - -non_empty_declare_list: - declare_list_element { init($1); } - | non_empty_declare_list ',' declare_list_element { push($1, $3); } -; - -declare_list_element: - identifier_not_reserved '=' expr { $$ = Stmt\DeclareDeclare[$1, $3]; } -; - -switch_case_list: - '{' case_list '}' { $$ = $2; } - | '{' ';' case_list '}' { $$ = $3; } - | ':' case_list T_ENDSWITCH ';' { $$ = $2; } - | ':' ';' case_list T_ENDSWITCH ';' { $$ = $3; } -; - -case_list: - /* empty */ { init(); } - | case_list case { push($1, $2); } -; - -case: - T_CASE expr case_separator inner_statement_list_ex { $$ = Stmt\Case_[$2, $4]; } - | T_DEFAULT case_separator inner_statement_list_ex { $$ = Stmt\Case_[null, $3]; } -; - -case_separator: - ':' - | ';' -; - -match: - T_MATCH '(' expr ')' '{' match_arm_list '}' { $$ = Expr\Match_[$3, $6]; } -; - -match_arm_list: - /* empty */ { $$ = []; } - | non_empty_match_arm_list optional_comma { $$ = $1; } -; - -non_empty_match_arm_list: - match_arm { init($1); } - | non_empty_match_arm_list ',' match_arm { push($1, $3); } -; - -match_arm: - expr_list_allow_comma T_DOUBLE_ARROW expr { $$ = Node\MatchArm[$1, $3]; } - | T_DEFAULT optional_comma T_DOUBLE_ARROW expr { $$ = Node\MatchArm[null, $4]; } -; - -while_statement: - statement { $$ = toArray($1); } - | ':' inner_statement_list T_ENDWHILE ';' { $$ = $2; } -; - -elseif_list: - /* empty */ { init(); } - | elseif_list elseif { push($1, $2); } -; - -elseif: - T_ELSEIF '(' expr ')' statement { $$ = Stmt\ElseIf_[$3, toArray($5)]; } -; - -new_elseif_list: - /* empty */ { init(); } - | new_elseif_list new_elseif { push($1, $2); } -; - -new_elseif: - T_ELSEIF '(' expr ')' ':' inner_statement_list { $$ = Stmt\ElseIf_[$3, $6]; } -; - -else_single: - /* empty */ { $$ = null; } - | T_ELSE statement { $$ = Stmt\Else_[toArray($2)]; } -; - -new_else_single: - /* empty */ { $$ = null; } - | T_ELSE ':' inner_statement_list { $$ = Stmt\Else_[$3]; } -; - -foreach_variable: - variable { $$ = array($1, false); } - | ampersand variable { $$ = array($2, true); } - | list_expr { $$ = array($1, false); } - | array_short_syntax { $$ = array($1, false); } -; - -parameter_list: - non_empty_parameter_list optional_comma { $$ = $1; } - | /* empty */ { $$ = array(); } -; - -non_empty_parameter_list: - parameter { init($1); } - | non_empty_parameter_list ',' parameter { push($1, $3); } -; - -optional_property_modifiers: - /* empty */ { $$ = 0; } - | optional_property_modifiers property_modifier - { $this->checkModifier($1, $2, #2); $$ = $1 | $2; } -; - -property_modifier: - T_PUBLIC { $$ = Stmt\Class_::MODIFIER_PUBLIC; } - | T_PROTECTED { $$ = Stmt\Class_::MODIFIER_PROTECTED; } - | T_PRIVATE { $$ = Stmt\Class_::MODIFIER_PRIVATE; } - | T_READONLY { $$ = Stmt\Class_::MODIFIER_READONLY; } -; - -parameter: - optional_attributes optional_property_modifiers optional_type_without_static - optional_arg_ref optional_ellipsis plain_variable - { $$ = new Node\Param($6, null, $3, $4, $5, attributes(), $2, $1); - $this->checkParam($$); } - | optional_attributes optional_property_modifiers optional_type_without_static - optional_arg_ref optional_ellipsis plain_variable '=' expr - { $$ = new Node\Param($6, $8, $3, $4, $5, attributes(), $2, $1); - $this->checkParam($$); } - | optional_attributes optional_property_modifiers optional_type_without_static - optional_arg_ref optional_ellipsis error - { $$ = new Node\Param(Expr\Error[], null, $3, $4, $5, attributes(), $2, $1); } -; - -type_expr: - type { $$ = $1; } - | '?' type { $$ = Node\NullableType[$2]; } - | union_type { $$ = Node\UnionType[$1]; } - | intersection_type { $$ = $1; } -; - -type: - type_without_static { $$ = $1; } - | T_STATIC { $$ = Node\Name['static']; } -; - -type_without_static: - name { $$ = $this->handleBuiltinTypes($1); } - | T_ARRAY { $$ = Node\Identifier['array']; } - | T_CALLABLE { $$ = Node\Identifier['callable']; } -; - -union_type_element: - type { $$ = $1; } - | '(' intersection_type ')' { $$ = $2; } -; - -union_type: - union_type_element '|' union_type_element { init($1, $3); } - | union_type '|' union_type_element { push($1, $3); } -; - -union_type_without_static_element: - type_without_static { $$ = $1; } - | '(' intersection_type_without_static ')' { $$ = $2; } -; - -union_type_without_static: - union_type_without_static_element '|' union_type_without_static_element { init($1, $3); } - | union_type_without_static '|' union_type_without_static_element { push($1, $3); } -; - -intersection_type_list: - type T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type { init($1, $3); } - | intersection_type_list T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type - { push($1, $3); } -; - -intersection_type: - intersection_type_list { $$ = Node\IntersectionType[$1]; } -; - -intersection_type_without_static_list: - type_without_static T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type_without_static - { init($1, $3); } - | intersection_type_without_static_list T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type_without_static - { push($1, $3); } -; - -intersection_type_without_static: - intersection_type_without_static_list { $$ = Node\IntersectionType[$1]; } -; - -type_expr_without_static: - type_without_static { $$ = $1; } - | '?' type_without_static { $$ = Node\NullableType[$2]; } - | union_type_without_static { $$ = Node\UnionType[$1]; } - | intersection_type_without_static { $$ = $1; } -; - -optional_type_without_static: - /* empty */ { $$ = null; } - | type_expr_without_static { $$ = $1; } -; - -optional_return_type: - /* empty */ { $$ = null; } - | ':' type_expr { $$ = $2; } - | ':' error { $$ = null; } -; - -argument_list: - '(' ')' { $$ = array(); } - | '(' non_empty_argument_list optional_comma ')' { $$ = $2; } - | '(' variadic_placeholder ')' { init($2); } -; - -variadic_placeholder: - T_ELLIPSIS { $$ = Node\VariadicPlaceholder[]; } -; - -non_empty_argument_list: - argument { init($1); } - | non_empty_argument_list ',' argument { push($1, $3); } -; - -argument: - expr { $$ = Node\Arg[$1, false, false]; } - | ampersand variable { $$ = Node\Arg[$2, true, false]; } - | T_ELLIPSIS expr { $$ = Node\Arg[$2, false, true]; } - | identifier_maybe_reserved ':' expr - { $$ = new Node\Arg($3, false, false, attributes(), $1); } -; - -global_var_list: - non_empty_global_var_list no_comma { $$ = $1; } -; - -non_empty_global_var_list: - non_empty_global_var_list ',' global_var { push($1, $3); } - | global_var { init($1); } -; - -global_var: - simple_variable { $$ = $1; } -; - -static_var_list: - non_empty_static_var_list no_comma { $$ = $1; } -; - -non_empty_static_var_list: - non_empty_static_var_list ',' static_var { push($1, $3); } - | static_var { init($1); } -; - -static_var: - plain_variable { $$ = Stmt\StaticVar[$1, null]; } - | plain_variable '=' expr { $$ = Stmt\StaticVar[$1, $3]; } -; - -class_statement_list_ex: - class_statement_list_ex class_statement { if ($2 !== null) { push($1, $2); } } - | /* empty */ { init(); } -; - -class_statement_list: - class_statement_list_ex - { makeZeroLengthNop($nop, $this->lookaheadStartAttributes); - if ($nop !== null) { $1[] = $nop; } $$ = $1; } -; - -class_statement: - optional_attributes variable_modifiers optional_type_without_static property_declaration_list semi - { $$ = new Stmt\Property($2, $4, attributes(), $3, $1); - $this->checkProperty($$, #2); } - | optional_attributes method_modifiers T_CONST class_const_list semi - { $$ = new Stmt\ClassConst($4, $2, attributes(), $1); - $this->checkClassConst($$, #2); } - | optional_attributes method_modifiers T_FUNCTION optional_ref identifier_maybe_reserved '(' parameter_list ')' - optional_return_type method_body - { $$ = Stmt\ClassMethod[$5, ['type' => $2, 'byRef' => $4, 'params' => $7, 'returnType' => $9, 'stmts' => $10, 'attrGroups' => $1]]; - $this->checkClassMethod($$, #2); } - | T_USE class_name_list trait_adaptations { $$ = Stmt\TraitUse[$2, $3]; } - | optional_attributes T_CASE identifier_maybe_reserved enum_case_expr semi - { $$ = Stmt\EnumCase[$3, $4, $1]; } - | error { $$ = null; /* will be skipped */ } -; - -trait_adaptations: - ';' { $$ = array(); } - | '{' trait_adaptation_list '}' { $$ = $2; } -; - -trait_adaptation_list: - /* empty */ { init(); } - | trait_adaptation_list trait_adaptation { push($1, $2); } -; - -trait_adaptation: - trait_method_reference_fully_qualified T_INSTEADOF class_name_list ';' - { $$ = Stmt\TraitUseAdaptation\Precedence[$1[0], $1[1], $3]; } - | trait_method_reference T_AS member_modifier identifier_maybe_reserved ';' - { $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], $3, $4]; } - | trait_method_reference T_AS member_modifier ';' - { $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], $3, null]; } - | trait_method_reference T_AS identifier_not_reserved ';' - { $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], null, $3]; } - | trait_method_reference T_AS reserved_non_modifiers_identifier ';' - { $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], null, $3]; } -; - -trait_method_reference_fully_qualified: - name T_PAAMAYIM_NEKUDOTAYIM identifier_maybe_reserved { $$ = array($1, $3); } -; -trait_method_reference: - trait_method_reference_fully_qualified { $$ = $1; } - | identifier_maybe_reserved { $$ = array(null, $1); } -; - -method_body: - ';' /* abstract method */ { $$ = null; } - | block_or_error { $$ = $1; } -; - -variable_modifiers: - non_empty_member_modifiers { $$ = $1; } - | T_VAR { $$ = 0; } -; - -method_modifiers: - /* empty */ { $$ = 0; } - | non_empty_member_modifiers { $$ = $1; } -; - -non_empty_member_modifiers: - member_modifier { $$ = $1; } - | non_empty_member_modifiers member_modifier { $this->checkModifier($1, $2, #2); $$ = $1 | $2; } -; - -member_modifier: - T_PUBLIC { $$ = Stmt\Class_::MODIFIER_PUBLIC; } - | T_PROTECTED { $$ = Stmt\Class_::MODIFIER_PROTECTED; } - | T_PRIVATE { $$ = Stmt\Class_::MODIFIER_PRIVATE; } - | T_STATIC { $$ = Stmt\Class_::MODIFIER_STATIC; } - | T_ABSTRACT { $$ = Stmt\Class_::MODIFIER_ABSTRACT; } - | T_FINAL { $$ = Stmt\Class_::MODIFIER_FINAL; } - | T_READONLY { $$ = Stmt\Class_::MODIFIER_READONLY; } -; - -property_declaration_list: - non_empty_property_declaration_list no_comma { $$ = $1; } -; - -non_empty_property_declaration_list: - property_declaration { init($1); } - | non_empty_property_declaration_list ',' property_declaration - { push($1, $3); } -; - -property_decl_name: - T_VARIABLE { $$ = Node\VarLikeIdentifier[parseVar($1)]; } -; - -property_declaration: - property_decl_name { $$ = Stmt\PropertyProperty[$1, null]; } - | property_decl_name '=' expr { $$ = Stmt\PropertyProperty[$1, $3]; } -; - -expr_list_forbid_comma: - non_empty_expr_list no_comma { $$ = $1; } -; - -expr_list_allow_comma: - non_empty_expr_list optional_comma { $$ = $1; } -; - -non_empty_expr_list: - non_empty_expr_list ',' expr { push($1, $3); } - | expr { init($1); } -; - -for_expr: - /* empty */ { $$ = array(); } - | expr_list_forbid_comma { $$ = $1; } -; - -expr: - variable { $$ = $1; } - | list_expr '=' expr { $$ = Expr\Assign[$1, $3]; } - | array_short_syntax '=' expr { $$ = Expr\Assign[$1, $3]; } - | variable '=' expr { $$ = Expr\Assign[$1, $3]; } - | variable '=' ampersand variable { $$ = Expr\AssignRef[$1, $4]; } - | new_expr { $$ = $1; } - | match { $$ = $1; } - | T_CLONE expr { $$ = Expr\Clone_[$2]; } - | variable T_PLUS_EQUAL expr { $$ = Expr\AssignOp\Plus [$1, $3]; } - | variable T_MINUS_EQUAL expr { $$ = Expr\AssignOp\Minus [$1, $3]; } - | variable T_MUL_EQUAL expr { $$ = Expr\AssignOp\Mul [$1, $3]; } - | variable T_DIV_EQUAL expr { $$ = Expr\AssignOp\Div [$1, $3]; } - | variable T_CONCAT_EQUAL expr { $$ = Expr\AssignOp\Concat [$1, $3]; } - | variable T_MOD_EQUAL expr { $$ = Expr\AssignOp\Mod [$1, $3]; } - | variable T_AND_EQUAL expr { $$ = Expr\AssignOp\BitwiseAnd[$1, $3]; } - | variable T_OR_EQUAL expr { $$ = Expr\AssignOp\BitwiseOr [$1, $3]; } - | variable T_XOR_EQUAL expr { $$ = Expr\AssignOp\BitwiseXor[$1, $3]; } - | variable T_SL_EQUAL expr { $$ = Expr\AssignOp\ShiftLeft [$1, $3]; } - | variable T_SR_EQUAL expr { $$ = Expr\AssignOp\ShiftRight[$1, $3]; } - | variable T_POW_EQUAL expr { $$ = Expr\AssignOp\Pow [$1, $3]; } - | variable T_COALESCE_EQUAL expr { $$ = Expr\AssignOp\Coalesce [$1, $3]; } - | variable T_INC { $$ = Expr\PostInc[$1]; } - | T_INC variable { $$ = Expr\PreInc [$2]; } - | variable T_DEC { $$ = Expr\PostDec[$1]; } - | T_DEC variable { $$ = Expr\PreDec [$2]; } - | expr T_BOOLEAN_OR expr { $$ = Expr\BinaryOp\BooleanOr [$1, $3]; } - | expr T_BOOLEAN_AND expr { $$ = Expr\BinaryOp\BooleanAnd[$1, $3]; } - | expr T_LOGICAL_OR expr { $$ = Expr\BinaryOp\LogicalOr [$1, $3]; } - | expr T_LOGICAL_AND expr { $$ = Expr\BinaryOp\LogicalAnd[$1, $3]; } - | expr T_LOGICAL_XOR expr { $$ = Expr\BinaryOp\LogicalXor[$1, $3]; } - | expr '|' expr { $$ = Expr\BinaryOp\BitwiseOr [$1, $3]; } - | expr T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG expr { $$ = Expr\BinaryOp\BitwiseAnd[$1, $3]; } - | expr T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG expr { $$ = Expr\BinaryOp\BitwiseAnd[$1, $3]; } - | expr '^' expr { $$ = Expr\BinaryOp\BitwiseXor[$1, $3]; } - | expr '.' expr { $$ = Expr\BinaryOp\Concat [$1, $3]; } - | expr '+' expr { $$ = Expr\BinaryOp\Plus [$1, $3]; } - | expr '-' expr { $$ = Expr\BinaryOp\Minus [$1, $3]; } - | expr '*' expr { $$ = Expr\BinaryOp\Mul [$1, $3]; } - | expr '/' expr { $$ = Expr\BinaryOp\Div [$1, $3]; } - | expr '%' expr { $$ = Expr\BinaryOp\Mod [$1, $3]; } - | expr T_SL expr { $$ = Expr\BinaryOp\ShiftLeft [$1, $3]; } - | expr T_SR expr { $$ = Expr\BinaryOp\ShiftRight[$1, $3]; } - | expr T_POW expr { $$ = Expr\BinaryOp\Pow [$1, $3]; } - | '+' expr %prec T_INC { $$ = Expr\UnaryPlus [$2]; } - | '-' expr %prec T_INC { $$ = Expr\UnaryMinus[$2]; } - | '!' expr { $$ = Expr\BooleanNot[$2]; } - | '~' expr { $$ = Expr\BitwiseNot[$2]; } - | expr T_IS_IDENTICAL expr { $$ = Expr\BinaryOp\Identical [$1, $3]; } - | expr T_IS_NOT_IDENTICAL expr { $$ = Expr\BinaryOp\NotIdentical [$1, $3]; } - | expr T_IS_EQUAL expr { $$ = Expr\BinaryOp\Equal [$1, $3]; } - | expr T_IS_NOT_EQUAL expr { $$ = Expr\BinaryOp\NotEqual [$1, $3]; } - | expr T_SPACESHIP expr { $$ = Expr\BinaryOp\Spaceship [$1, $3]; } - | expr '<' expr { $$ = Expr\BinaryOp\Smaller [$1, $3]; } - | expr T_IS_SMALLER_OR_EQUAL expr { $$ = Expr\BinaryOp\SmallerOrEqual[$1, $3]; } - | expr '>' expr { $$ = Expr\BinaryOp\Greater [$1, $3]; } - | expr T_IS_GREATER_OR_EQUAL expr { $$ = Expr\BinaryOp\GreaterOrEqual[$1, $3]; } - | expr T_INSTANCEOF class_name_reference { $$ = Expr\Instanceof_[$1, $3]; } - | '(' expr ')' { $$ = $2; } - | expr '?' expr ':' expr { $$ = Expr\Ternary[$1, $3, $5]; } - | expr '?' ':' expr { $$ = Expr\Ternary[$1, null, $4]; } - | expr T_COALESCE expr { $$ = Expr\BinaryOp\Coalesce[$1, $3]; } - | T_ISSET '(' expr_list_allow_comma ')' { $$ = Expr\Isset_[$3]; } - | T_EMPTY '(' expr ')' { $$ = Expr\Empty_[$3]; } - | T_INCLUDE expr { $$ = Expr\Include_[$2, Expr\Include_::TYPE_INCLUDE]; } - | T_INCLUDE_ONCE expr { $$ = Expr\Include_[$2, Expr\Include_::TYPE_INCLUDE_ONCE]; } - | T_EVAL '(' expr ')' { $$ = Expr\Eval_[$3]; } - | T_REQUIRE expr { $$ = Expr\Include_[$2, Expr\Include_::TYPE_REQUIRE]; } - | T_REQUIRE_ONCE expr { $$ = Expr\Include_[$2, Expr\Include_::TYPE_REQUIRE_ONCE]; } - | T_INT_CAST expr { $$ = Expr\Cast\Int_ [$2]; } - | T_DOUBLE_CAST expr - { $attrs = attributes(); - $attrs['kind'] = $this->getFloatCastKind($1); - $$ = new Expr\Cast\Double($2, $attrs); } - | T_STRING_CAST expr { $$ = Expr\Cast\String_ [$2]; } - | T_ARRAY_CAST expr { $$ = Expr\Cast\Array_ [$2]; } - | T_OBJECT_CAST expr { $$ = Expr\Cast\Object_ [$2]; } - | T_BOOL_CAST expr { $$ = Expr\Cast\Bool_ [$2]; } - | T_UNSET_CAST expr { $$ = Expr\Cast\Unset_ [$2]; } - | T_EXIT exit_expr - { $attrs = attributes(); - $attrs['kind'] = strtolower($1) === 'exit' ? Expr\Exit_::KIND_EXIT : Expr\Exit_::KIND_DIE; - $$ = new Expr\Exit_($2, $attrs); } - | '@' expr { $$ = Expr\ErrorSuppress[$2]; } - | scalar { $$ = $1; } - | '`' backticks_expr '`' { $$ = Expr\ShellExec[$2]; } - | T_PRINT expr { $$ = Expr\Print_[$2]; } - | T_YIELD { $$ = Expr\Yield_[null, null]; } - | T_YIELD expr { $$ = Expr\Yield_[$2, null]; } - | T_YIELD expr T_DOUBLE_ARROW expr { $$ = Expr\Yield_[$4, $2]; } - | T_YIELD_FROM expr { $$ = Expr\YieldFrom[$2]; } - | T_THROW expr { $$ = Expr\Throw_[$2]; } - - | T_FN optional_ref '(' parameter_list ')' optional_return_type T_DOUBLE_ARROW expr %prec T_THROW - { $$ = Expr\ArrowFunction[['static' => false, 'byRef' => $2, 'params' => $4, 'returnType' => $6, 'expr' => $8, 'attrGroups' => []]]; } - | T_STATIC T_FN optional_ref '(' parameter_list ')' optional_return_type T_DOUBLE_ARROW expr %prec T_THROW - { $$ = Expr\ArrowFunction[['static' => true, 'byRef' => $3, 'params' => $5, 'returnType' => $7, 'expr' => $9, 'attrGroups' => []]]; } - | T_FUNCTION optional_ref '(' parameter_list ')' lexical_vars optional_return_type block_or_error - { $$ = Expr\Closure[['static' => false, 'byRef' => $2, 'params' => $4, 'uses' => $6, 'returnType' => $7, 'stmts' => $8, 'attrGroups' => []]]; } - | T_STATIC T_FUNCTION optional_ref '(' parameter_list ')' lexical_vars optional_return_type block_or_error - { $$ = Expr\Closure[['static' => true, 'byRef' => $3, 'params' => $5, 'uses' => $7, 'returnType' => $8, 'stmts' => $9, 'attrGroups' => []]]; } - - | attributes T_FN optional_ref '(' parameter_list ')' optional_return_type T_DOUBLE_ARROW expr %prec T_THROW - { $$ = Expr\ArrowFunction[['static' => false, 'byRef' => $3, 'params' => $5, 'returnType' => $7, 'expr' => $9, 'attrGroups' => $1]]; } - | attributes T_STATIC T_FN optional_ref '(' parameter_list ')' optional_return_type T_DOUBLE_ARROW expr %prec T_THROW - { $$ = Expr\ArrowFunction[['static' => true, 'byRef' => $4, 'params' => $6, 'returnType' => $8, 'expr' => $10, 'attrGroups' => $1]]; } - | attributes T_FUNCTION optional_ref '(' parameter_list ')' lexical_vars optional_return_type block_or_error - { $$ = Expr\Closure[['static' => false, 'byRef' => $3, 'params' => $5, 'uses' => $7, 'returnType' => $8, 'stmts' => $9, 'attrGroups' => $1]]; } - | attributes T_STATIC T_FUNCTION optional_ref '(' parameter_list ')' lexical_vars optional_return_type block_or_error - { $$ = Expr\Closure[['static' => true, 'byRef' => $4, 'params' => $6, 'uses' => $8, 'returnType' => $9, 'stmts' => $10, 'attrGroups' => $1]]; } -; - -anonymous_class: - optional_attributes T_CLASS ctor_arguments extends_from implements_list '{' class_statement_list '}' - { $$ = array(Stmt\Class_[null, ['type' => 0, 'extends' => $4, 'implements' => $5, 'stmts' => $7, 'attrGroups' => $1]], $3); - $this->checkClass($$[0], -1); } -; - -new_expr: - T_NEW class_name_reference ctor_arguments { $$ = Expr\New_[$2, $3]; } - | T_NEW anonymous_class - { list($class, $ctorArgs) = $2; $$ = Expr\New_[$class, $ctorArgs]; } -; - -lexical_vars: - /* empty */ { $$ = array(); } - | T_USE '(' lexical_var_list ')' { $$ = $3; } -; - -lexical_var_list: - non_empty_lexical_var_list optional_comma { $$ = $1; } -; - -non_empty_lexical_var_list: - lexical_var { init($1); } - | non_empty_lexical_var_list ',' lexical_var { push($1, $3); } -; - -lexical_var: - optional_ref plain_variable { $$ = Expr\ClosureUse[$2, $1]; } -; - -function_call: - name argument_list { $$ = Expr\FuncCall[$1, $2]; } - | callable_expr argument_list { $$ = Expr\FuncCall[$1, $2]; } - | class_name_or_var T_PAAMAYIM_NEKUDOTAYIM member_name argument_list - { $$ = Expr\StaticCall[$1, $3, $4]; } -; - -class_name: - T_STATIC { $$ = Name[$1]; } - | name { $$ = $1; } -; - -name: - T_STRING { $$ = Name[$1]; } - | T_NAME_QUALIFIED { $$ = Name[$1]; } - | T_NAME_FULLY_QUALIFIED { $$ = Name\FullyQualified[substr($1, 1)]; } - | T_NAME_RELATIVE { $$ = Name\Relative[substr($1, 10)]; } -; - -class_name_reference: - class_name { $$ = $1; } - | new_variable { $$ = $1; } - | '(' expr ')' { $$ = $2; } - | error { $$ = Expr\Error[]; $this->errorState = 2; } -; - -class_name_or_var: - class_name { $$ = $1; } - | fully_dereferencable { $$ = $1; } -; - -exit_expr: - /* empty */ { $$ = null; } - | '(' optional_expr ')' { $$ = $2; } -; - -backticks_expr: - /* empty */ { $$ = array(); } - | T_ENCAPSED_AND_WHITESPACE - { $$ = array(Scalar\EncapsedStringPart[Scalar\String_::parseEscapeSequences($1, '`')]); } - | encaps_list { parseEncapsed($1, '`', true); $$ = $1; } -; - -ctor_arguments: - /* empty */ { $$ = array(); } - | argument_list { $$ = $1; } -; - -constant: - name { $$ = Expr\ConstFetch[$1]; } - | T_LINE { $$ = Scalar\MagicConst\Line[]; } - | T_FILE { $$ = Scalar\MagicConst\File[]; } - | T_DIR { $$ = Scalar\MagicConst\Dir[]; } - | T_CLASS_C { $$ = Scalar\MagicConst\Class_[]; } - | T_TRAIT_C { $$ = Scalar\MagicConst\Trait_[]; } - | T_METHOD_C { $$ = Scalar\MagicConst\Method[]; } - | T_FUNC_C { $$ = Scalar\MagicConst\Function_[]; } - | T_NS_C { $$ = Scalar\MagicConst\Namespace_[]; } -; - -class_constant: - class_name_or_var T_PAAMAYIM_NEKUDOTAYIM identifier_maybe_reserved - { $$ = Expr\ClassConstFetch[$1, $3]; } - /* We interpret an isolated FOO:: as an unfinished class constant fetch. It could also be - an unfinished static property fetch or unfinished scoped call. */ - | class_name_or_var T_PAAMAYIM_NEKUDOTAYIM error - { $$ = Expr\ClassConstFetch[$1, new Expr\Error(stackAttributes(#3))]; $this->errorState = 2; } -; - -array_short_syntax: - '[' array_pair_list ']' - { $attrs = attributes(); $attrs['kind'] = Expr\Array_::KIND_SHORT; - $$ = new Expr\Array_($2, $attrs); } -; - -dereferencable_scalar: - T_ARRAY '(' array_pair_list ')' - { $attrs = attributes(); $attrs['kind'] = Expr\Array_::KIND_LONG; - $$ = new Expr\Array_($3, $attrs); } - | array_short_syntax { $$ = $1; } - | T_CONSTANT_ENCAPSED_STRING { $$ = Scalar\String_::fromString($1, attributes()); } - | '"' encaps_list '"' - { $attrs = attributes(); $attrs['kind'] = Scalar\String_::KIND_DOUBLE_QUOTED; - parseEncapsed($2, '"', true); $$ = new Scalar\Encapsed($2, $attrs); } -; - -scalar: - T_LNUMBER { $$ = $this->parseLNumber($1, attributes()); } - | T_DNUMBER { $$ = Scalar\DNumber::fromString($1, attributes()); } - | dereferencable_scalar { $$ = $1; } - | constant { $$ = $1; } - | class_constant { $$ = $1; } - | T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC - { $$ = $this->parseDocString($1, $2, $3, attributes(), stackAttributes(#3), true); } - | T_START_HEREDOC T_END_HEREDOC - { $$ = $this->parseDocString($1, '', $2, attributes(), stackAttributes(#2), true); } - | T_START_HEREDOC encaps_list T_END_HEREDOC - { $$ = $this->parseDocString($1, $2, $3, attributes(), stackAttributes(#3), true); } -; - -optional_expr: - /* empty */ { $$ = null; } - | expr { $$ = $1; } -; - -fully_dereferencable: - variable { $$ = $1; } - | '(' expr ')' { $$ = $2; } - | dereferencable_scalar { $$ = $1; } - | class_constant { $$ = $1; } -; - -array_object_dereferencable: - fully_dereferencable { $$ = $1; } - | constant { $$ = $1; } -; - -callable_expr: - callable_variable { $$ = $1; } - | '(' expr ')' { $$ = $2; } - | dereferencable_scalar { $$ = $1; } -; - -callable_variable: - simple_variable { $$ = $1; } - | array_object_dereferencable '[' optional_expr ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | array_object_dereferencable '{' expr '}' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | function_call { $$ = $1; } - | array_object_dereferencable T_OBJECT_OPERATOR property_name argument_list - { $$ = Expr\MethodCall[$1, $3, $4]; } - | array_object_dereferencable T_NULLSAFE_OBJECT_OPERATOR property_name argument_list - { $$ = Expr\NullsafeMethodCall[$1, $3, $4]; } -; - -optional_plain_variable: - /* empty */ { $$ = null; } - | plain_variable { $$ = $1; } -; - -variable: - callable_variable { $$ = $1; } - | static_member { $$ = $1; } - | array_object_dereferencable T_OBJECT_OPERATOR property_name - { $$ = Expr\PropertyFetch[$1, $3]; } - | array_object_dereferencable T_NULLSAFE_OBJECT_OPERATOR property_name - { $$ = Expr\NullsafePropertyFetch[$1, $3]; } -; - -simple_variable: - plain_variable { $$ = $1; } - | '$' '{' expr '}' { $$ = Expr\Variable[$3]; } - | '$' simple_variable { $$ = Expr\Variable[$2]; } - | '$' error { $$ = Expr\Variable[Expr\Error[]]; $this->errorState = 2; } -; - -static_member_prop_name: - simple_variable - { $var = $1->name; $$ = \is_string($var) ? Node\VarLikeIdentifier[$var] : $var; } -; - -static_member: - class_name_or_var T_PAAMAYIM_NEKUDOTAYIM static_member_prop_name - { $$ = Expr\StaticPropertyFetch[$1, $3]; } -; - -new_variable: - simple_variable { $$ = $1; } - | new_variable '[' optional_expr ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | new_variable '{' expr '}' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | new_variable T_OBJECT_OPERATOR property_name { $$ = Expr\PropertyFetch[$1, $3]; } - | new_variable T_NULLSAFE_OBJECT_OPERATOR property_name { $$ = Expr\NullsafePropertyFetch[$1, $3]; } - | class_name T_PAAMAYIM_NEKUDOTAYIM static_member_prop_name - { $$ = Expr\StaticPropertyFetch[$1, $3]; } - | new_variable T_PAAMAYIM_NEKUDOTAYIM static_member_prop_name - { $$ = Expr\StaticPropertyFetch[$1, $3]; } -; - -member_name: - identifier_maybe_reserved { $$ = $1; } - | '{' expr '}' { $$ = $2; } - | simple_variable { $$ = $1; } -; - -property_name: - identifier_not_reserved { $$ = $1; } - | '{' expr '}' { $$ = $2; } - | simple_variable { $$ = $1; } - | error { $$ = Expr\Error[]; $this->errorState = 2; } -; - -list_expr: - T_LIST '(' inner_array_pair_list ')' { $$ = Expr\List_[$3]; } -; - -array_pair_list: - inner_array_pair_list - { $$ = $1; $end = count($$)-1; if ($$[$end] === null) array_pop($$); } -; - -comma_or_error: - ',' - | error - { /* do nothing -- prevent default action of $$=$1. See #551. */ } -; - -inner_array_pair_list: - inner_array_pair_list comma_or_error array_pair { push($1, $3); } - | array_pair { init($1); } -; - -array_pair: - expr { $$ = Expr\ArrayItem[$1, null, false]; } - | ampersand variable { $$ = Expr\ArrayItem[$2, null, true]; } - | list_expr { $$ = Expr\ArrayItem[$1, null, false]; } - | expr T_DOUBLE_ARROW expr { $$ = Expr\ArrayItem[$3, $1, false]; } - | expr T_DOUBLE_ARROW ampersand variable { $$ = Expr\ArrayItem[$4, $1, true]; } - | expr T_DOUBLE_ARROW list_expr { $$ = Expr\ArrayItem[$3, $1, false]; } - | T_ELLIPSIS expr { $$ = Expr\ArrayItem[$2, null, false, attributes(), true]; } - | /* empty */ { $$ = null; } -; - -encaps_list: - encaps_list encaps_var { push($1, $2); } - | encaps_list encaps_string_part { push($1, $2); } - | encaps_var { init($1); } - | encaps_string_part encaps_var { init($1, $2); } -; - -encaps_string_part: - T_ENCAPSED_AND_WHITESPACE { $$ = Scalar\EncapsedStringPart[$1]; } -; - -encaps_str_varname: - T_STRING_VARNAME { $$ = Expr\Variable[$1]; } -; - -encaps_var: - plain_variable { $$ = $1; } - | plain_variable '[' encaps_var_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | plain_variable T_OBJECT_OPERATOR identifier_not_reserved - { $$ = Expr\PropertyFetch[$1, $3]; } - | plain_variable T_NULLSAFE_OBJECT_OPERATOR identifier_not_reserved - { $$ = Expr\NullsafePropertyFetch[$1, $3]; } - | T_DOLLAR_OPEN_CURLY_BRACES expr '}' { $$ = Expr\Variable[$2]; } - | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}' { $$ = Expr\Variable[$2]; } - | T_DOLLAR_OPEN_CURLY_BRACES encaps_str_varname '[' expr ']' '}' - { $$ = Expr\ArrayDimFetch[$2, $4]; } - | T_CURLY_OPEN variable '}' { $$ = $2; } -; - -encaps_var_offset: - T_STRING { $$ = Scalar\String_[$1]; } - | T_NUM_STRING { $$ = $this->parseNumString($1, attributes()); } - | '-' T_NUM_STRING { $$ = $this->parseNumString('-' . $2, attributes()); } - | plain_variable { $$ = $1; } -; - -%% diff --git a/vendor/nikic/php-parser/grammar/phpyLang.php b/vendor/nikic/php-parser/grammar/phpyLang.php deleted file mode 100644 index 663c2a14..00000000 --- a/vendor/nikic/php-parser/grammar/phpyLang.php +++ /dev/null @@ -1,184 +0,0 @@ -<?php - -/////////////////////////////// -/// Utility regex constants /// -/////////////////////////////// - -const LIB = '(?(DEFINE) - (?<singleQuotedString>\'[^\\\\\']*+(?:\\\\.[^\\\\\']*+)*+\') - (?<doubleQuotedString>"[^\\\\"]*+(?:\\\\.[^\\\\"]*+)*+") - (?<string>(?&singleQuotedString)|(?&doubleQuotedString)) - (?<comment>/\*[^*]*+(?:\*(?!/)[^*]*+)*+\*/) - (?<code>\{[^\'"/{}]*+(?:(?:(?&string)|(?&comment)|(?&code)|/)[^\'"/{}]*+)*+}) -)'; - -const PARAMS = '\[(?<params>[^[\]]*+(?:\[(?¶ms)\][^[\]]*+)*+)\]'; -const ARGS = '\((?<args>[^()]*+(?:\((?&args)\)[^()]*+)*+)\)'; - -/////////////////////////////// -/// Preprocessing functions /// -/////////////////////////////// - -function preprocessGrammar($code) { - $code = resolveNodes($code); - $code = resolveMacros($code); - $code = resolveStackAccess($code); - - return $code; -} - -function resolveNodes($code) { - return preg_replace_callback( - '~\b(?<name>[A-Z][a-zA-Z_\\\\]++)\s*' . PARAMS . '~', - function($matches) { - // recurse - $matches['params'] = resolveNodes($matches['params']); - - $params = magicSplit( - '(?:' . PARAMS . '|' . ARGS . ')(*SKIP)(*FAIL)|,', - $matches['params'] - ); - - $paramCode = ''; - foreach ($params as $param) { - $paramCode .= $param . ', '; - } - - return 'new ' . $matches['name'] . '(' . $paramCode . 'attributes())'; - }, - $code - ); -} - -function resolveMacros($code) { - return preg_replace_callback( - '~\b(?<!::|->)(?!array\()(?<name>[a-z][A-Za-z]++)' . ARGS . '~', - function($matches) { - // recurse - $matches['args'] = resolveMacros($matches['args']); - - $name = $matches['name']; - $args = magicSplit( - '(?:' . PARAMS . '|' . ARGS . ')(*SKIP)(*FAIL)|,', - $matches['args'] - ); - - if ('attributes' === $name) { - assertArgs(0, $args, $name); - return '$this->startAttributeStack[#1] + $this->endAttributes'; - } - - if ('stackAttributes' === $name) { - assertArgs(1, $args, $name); - return '$this->startAttributeStack[' . $args[0] . ']' - . ' + $this->endAttributeStack[' . $args[0] . ']'; - } - - if ('init' === $name) { - return '$$ = array(' . implode(', ', $args) . ')'; - } - - if ('push' === $name) { - assertArgs(2, $args, $name); - - return $args[0] . '[] = ' . $args[1] . '; $$ = ' . $args[0]; - } - - if ('pushNormalizing' === $name) { - assertArgs(2, $args, $name); - - return 'if (is_array(' . $args[1] . ')) { $$ = array_merge(' . $args[0] . ', ' . $args[1] . '); }' - . ' else { ' . $args[0] . '[] = ' . $args[1] . '; $$ = ' . $args[0] . '; }'; - } - - if ('toArray' == $name) { - assertArgs(1, $args, $name); - - return 'is_array(' . $args[0] . ') ? ' . $args[0] . ' : array(' . $args[0] . ')'; - } - - if ('parseVar' === $name) { - assertArgs(1, $args, $name); - - return 'substr(' . $args[0] . ', 1)'; - } - - if ('parseEncapsed' === $name) { - assertArgs(3, $args, $name); - - return 'foreach (' . $args[0] . ' as $s) { if ($s instanceof Node\Scalar\EncapsedStringPart) {' - . ' $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, ' . $args[1] . ', ' . $args[2] . '); } }'; - } - - if ('makeNop' === $name) { - assertArgs(3, $args, $name); - - return '$startAttributes = ' . $args[1] . ';' - . ' if (isset($startAttributes[\'comments\']))' - . ' { ' . $args[0] . ' = new Stmt\Nop($startAttributes + ' . $args[2] . '); }' - . ' else { ' . $args[0] . ' = null; }'; - } - - if ('makeZeroLengthNop' == $name) { - assertArgs(2, $args, $name); - - return '$startAttributes = ' . $args[1] . ';' - . ' if (isset($startAttributes[\'comments\']))' - . ' { ' . $args[0] . ' = new Stmt\Nop($this->createCommentNopAttributes($startAttributes[\'comments\'])); }' - . ' else { ' . $args[0] . ' = null; }'; - } - - if ('prependLeadingComments' === $name) { - assertArgs(1, $args, $name); - - return '$attrs = $this->startAttributeStack[#1]; $stmts = ' . $args[0] . '; ' - . 'if (!empty($attrs[\'comments\'])) {' - . '$stmts[0]->setAttribute(\'comments\', ' - . 'array_merge($attrs[\'comments\'], $stmts[0]->getAttribute(\'comments\', []))); }'; - } - - return $matches[0]; - }, - $code - ); -} - -function assertArgs($num, $args, $name) { - if ($num != count($args)) { - die('Wrong argument count for ' . $name . '().'); - } -} - -function resolveStackAccess($code) { - $code = preg_replace('/\$\d+/', '$this->semStack[$0]', $code); - $code = preg_replace('/#(\d+)/', '$$1', $code); - return $code; -} - -function removeTrailingWhitespace($code) { - $lines = explode("\n", $code); - $lines = array_map('rtrim', $lines); - return implode("\n", $lines); -} - -////////////////////////////// -/// Regex helper functions /// -////////////////////////////// - -function regex($regex) { - return '~' . LIB . '(?:' . str_replace('~', '\~', $regex) . ')~'; -} - -function magicSplit($regex, $string) { - $pieces = preg_split(regex('(?:(?&string)|(?&comment)|(?&code))(*SKIP)(*FAIL)|' . $regex), $string); - - foreach ($pieces as &$piece) { - $piece = trim($piece); - } - - if ($pieces === ['']) { - return []; - } - - return $pieces; -} diff --git a/vendor/nikic/php-parser/grammar/rebuildParsers.php b/vendor/nikic/php-parser/grammar/rebuildParsers.php deleted file mode 100644 index 2d0c6b14..00000000 --- a/vendor/nikic/php-parser/grammar/rebuildParsers.php +++ /dev/null @@ -1,81 +0,0 @@ -<?php - -require __DIR__ . '/phpyLang.php'; - -$grammarFileToName = [ - __DIR__ . '/php5.y' => 'Php5', - __DIR__ . '/php7.y' => 'Php7', -]; - -$tokensFile = __DIR__ . '/tokens.y'; -$tokensTemplate = __DIR__ . '/tokens.template'; -$skeletonFile = __DIR__ . '/parser.template'; -$tmpGrammarFile = __DIR__ . '/tmp_parser.phpy'; -$tmpResultFile = __DIR__ . '/tmp_parser.php'; -$resultDir = __DIR__ . '/../lib/PhpParser/Parser'; -$tokensResultsFile = $resultDir . '/Tokens.php'; - -$kmyacc = getenv('KMYACC'); -if (!$kmyacc) { - // Use phpyacc from dev dependencies by default. - $kmyacc = __DIR__ . '/../vendor/bin/phpyacc'; -} - -$options = array_flip($argv); -$optionDebug = isset($options['--debug']); -$optionKeepTmpGrammar = isset($options['--keep-tmp-grammar']); - -/////////////////// -/// Main script /// -/////////////////// - -$tokens = file_get_contents($tokensFile); - -foreach ($grammarFileToName as $grammarFile => $name) { - echo "Building temporary $name grammar file.\n"; - - $grammarCode = file_get_contents($grammarFile); - $grammarCode = str_replace('%tokens', $tokens, $grammarCode); - $grammarCode = preprocessGrammar($grammarCode); - - file_put_contents($tmpGrammarFile, $grammarCode); - - $additionalArgs = $optionDebug ? '-t -v' : ''; - - echo "Building $name parser.\n"; - $output = execCmd("$kmyacc $additionalArgs -m $skeletonFile -p $name $tmpGrammarFile"); - - $resultCode = file_get_contents($tmpResultFile); - $resultCode = removeTrailingWhitespace($resultCode); - - ensureDirExists($resultDir); - file_put_contents("$resultDir/$name.php", $resultCode); - unlink($tmpResultFile); - - echo "Building token definition.\n"; - $output = execCmd("$kmyacc -m $tokensTemplate $tmpGrammarFile"); - rename($tmpResultFile, $tokensResultsFile); - - if (!$optionKeepTmpGrammar) { - unlink($tmpGrammarFile); - } -} - -//////////////////////////////// -/// Utility helper functions /// -//////////////////////////////// - -function ensureDirExists($dir) { - if (!is_dir($dir)) { - mkdir($dir, 0777, true); - } -} - -function execCmd($cmd) { - $output = trim(shell_exec("$cmd 2>&1")); - if ($output !== "") { - echo "> " . $cmd . "\n"; - echo $output; - } - return $output; -} diff --git a/vendor/nikic/php-parser/grammar/tokens.template b/vendor/nikic/php-parser/grammar/tokens.template deleted file mode 100644 index ba4e4901..00000000 --- a/vendor/nikic/php-parser/grammar/tokens.template +++ /dev/null @@ -1,17 +0,0 @@ -<?php -$meta # -#semval($) $this->semValue -#semval($,%t) $this->semValue -#semval(%n) $this->stackPos-(%l-%n) -#semval(%n,%t) $this->stackPos-(%l-%n) - -namespace PhpParser\Parser; -#include; - -/* GENERATED file based on grammar/tokens.y */ -final class Tokens -{ -#tokenval - const %s = %n; -#endtokenval -} diff --git a/vendor/nikic/php-parser/grammar/tokens.y b/vendor/nikic/php-parser/grammar/tokens.y deleted file mode 100644 index 8f0b2172..00000000 --- a/vendor/nikic/php-parser/grammar/tokens.y +++ /dev/null @@ -1,115 +0,0 @@ -/* We currently rely on the token ID mapping to be the same between PHP 5 and PHP 7 - so the same lexer can be used for - * both. This is enforced by sharing this token file. */ - -%right T_THROW -%left T_INCLUDE T_INCLUDE_ONCE T_EVAL T_REQUIRE T_REQUIRE_ONCE -%left ',' -%left T_LOGICAL_OR -%left T_LOGICAL_XOR -%left T_LOGICAL_AND -%right T_PRINT -%right T_YIELD -%right T_DOUBLE_ARROW -%right T_YIELD_FROM -%left '=' T_PLUS_EQUAL T_MINUS_EQUAL T_MUL_EQUAL T_DIV_EQUAL T_CONCAT_EQUAL T_MOD_EQUAL T_AND_EQUAL T_OR_EQUAL T_XOR_EQUAL T_SL_EQUAL T_SR_EQUAL T_POW_EQUAL T_COALESCE_EQUAL -%left '?' ':' -%right T_COALESCE -%left T_BOOLEAN_OR -%left T_BOOLEAN_AND -%left '|' -%left '^' -%left T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG -%nonassoc T_IS_EQUAL T_IS_NOT_EQUAL T_IS_IDENTICAL T_IS_NOT_IDENTICAL T_SPACESHIP -%nonassoc '<' T_IS_SMALLER_OR_EQUAL '>' T_IS_GREATER_OR_EQUAL -%left T_SL T_SR -%left '+' '-' '.' -%left '*' '/' '%' -%right '!' -%nonassoc T_INSTANCEOF -%right '~' T_INC T_DEC T_INT_CAST T_DOUBLE_CAST T_STRING_CAST T_ARRAY_CAST T_OBJECT_CAST T_BOOL_CAST T_UNSET_CAST '@' -%right T_POW -%right '[' -%nonassoc T_NEW T_CLONE -%token T_EXIT -%token T_IF -%left T_ELSEIF -%left T_ELSE -%left T_ENDIF -%token T_LNUMBER -%token T_DNUMBER -%token T_STRING -%token T_STRING_VARNAME -%token T_VARIABLE -%token T_NUM_STRING -%token T_INLINE_HTML -%token T_ENCAPSED_AND_WHITESPACE -%token T_CONSTANT_ENCAPSED_STRING -%token T_ECHO -%token T_DO -%token T_WHILE -%token T_ENDWHILE -%token T_FOR -%token T_ENDFOR -%token T_FOREACH -%token T_ENDFOREACH -%token T_DECLARE -%token T_ENDDECLARE -%token T_AS -%token T_SWITCH -%token T_MATCH -%token T_ENDSWITCH -%token T_CASE -%token T_DEFAULT -%token T_BREAK -%token T_CONTINUE -%token T_GOTO -%token T_FUNCTION -%token T_FN -%token T_CONST -%token T_RETURN -%token T_TRY -%token T_CATCH -%token T_FINALLY -%token T_THROW -%token T_USE -%token T_INSTEADOF -%token T_GLOBAL -%right T_STATIC T_ABSTRACT T_FINAL T_PRIVATE T_PROTECTED T_PUBLIC T_READONLY -%token T_VAR -%token T_UNSET -%token T_ISSET -%token T_EMPTY -%token T_HALT_COMPILER -%token T_CLASS -%token T_TRAIT -%token T_INTERFACE -%token T_ENUM -%token T_EXTENDS -%token T_IMPLEMENTS -%token T_OBJECT_OPERATOR -%token T_NULLSAFE_OBJECT_OPERATOR -%token T_DOUBLE_ARROW -%token T_LIST -%token T_ARRAY -%token T_CALLABLE -%token T_CLASS_C -%token T_TRAIT_C -%token T_METHOD_C -%token T_FUNC_C -%token T_LINE -%token T_FILE -%token T_START_HEREDOC -%token T_END_HEREDOC -%token T_DOLLAR_OPEN_CURLY_BRACES -%token T_CURLY_OPEN -%token T_PAAMAYIM_NEKUDOTAYIM -%token T_NAMESPACE -%token T_NS_C -%token T_DIR -%token T_NS_SEPARATOR -%token T_ELLIPSIS -%token T_NAME_FULLY_QUALIFIED -%token T_NAME_QUALIFIED -%token T_NAME_RELATIVE -%token T_ATTRIBUTE -%token T_ENUM diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder.php b/vendor/nikic/php-parser/lib/PhpParser/Builder.php deleted file mode 100644 index 26d8921e..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser; - -interface Builder -{ - /** - * Returns the built node. - * - * @return Node The built node - */ - public function getNode() : Node; -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/ClassConst.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/ClassConst.php deleted file mode 100644 index f616c627..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/ClassConst.php +++ /dev/null @@ -1,132 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace PhpParser\Builder; - -use PhpParser; -use PhpParser\BuilderHelpers; -use PhpParser\Node; -use PhpParser\Node\Const_; -use PhpParser\Node\Identifier; -use PhpParser\Node\Stmt; - -class ClassConst implements PhpParser\Builder -{ - protected $flags = 0; - protected $attributes = []; - protected $constants = []; - - /** @var Node\AttributeGroup[] */ - protected $attributeGroups = []; - - /** - * Creates a class constant builder - * - * @param string|Identifier $name Name - * @param Node\Expr|bool|null|int|float|string|array $value Value - */ - public function __construct($name, $value) { - $this->constants = [new Const_($name, BuilderHelpers::normalizeValue($value))]; - } - - /** - * Add another constant to const group - * - * @param string|Identifier $name Name - * @param Node\Expr|bool|null|int|float|string|array $value Value - * - * @return $this The builder instance (for fluid interface) - */ - public function addConst($name, $value) { - $this->constants[] = new Const_($name, BuilderHelpers::normalizeValue($value)); - - return $this; - } - - /** - * Makes the constant public. - * - * @return $this The builder instance (for fluid interface) - */ - public function makePublic() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PUBLIC); - - return $this; - } - - /** - * Makes the constant protected. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeProtected() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PROTECTED); - - return $this; - } - - /** - * Makes the constant private. - * - * @return $this The builder instance (for fluid interface) - */ - public function makePrivate() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PRIVATE); - - return $this; - } - - /** - * Makes the constant final. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeFinal() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_FINAL); - - return $this; - } - - /** - * Sets doc comment for the constant. - * - * @param PhpParser\Comment\Doc|string $docComment Doc comment to set - * - * @return $this The builder instance (for fluid interface) - */ - public function setDocComment($docComment) { - $this->attributes = [ - 'comments' => [BuilderHelpers::normalizeDocComment($docComment)] - ]; - - return $this; - } - - /** - * Adds an attribute group. - * - * @param Node\Attribute|Node\AttributeGroup $attribute - * - * @return $this The builder instance (for fluid interface) - */ - public function addAttribute($attribute) { - $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); - - return $this; - } - - /** - * Returns the built class node. - * - * @return Stmt\ClassConst The built constant node - */ - public function getNode(): PhpParser\Node { - return new Stmt\ClassConst( - $this->constants, - $this->flags, - $this->attributes, - $this->attributeGroups - ); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Class_.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Class_.php deleted file mode 100644 index 35b54d04..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/Class_.php +++ /dev/null @@ -1,146 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Builder; - -use PhpParser; -use PhpParser\BuilderHelpers; -use PhpParser\Node; -use PhpParser\Node\Name; -use PhpParser\Node\Stmt; - -class Class_ extends Declaration -{ - protected $name; - - protected $extends = null; - protected $implements = []; - protected $flags = 0; - - protected $uses = []; - protected $constants = []; - protected $properties = []; - protected $methods = []; - - /** @var Node\AttributeGroup[] */ - protected $attributeGroups = []; - - /** - * Creates a class builder. - * - * @param string $name Name of the class - */ - public function __construct(string $name) { - $this->name = $name; - } - - /** - * Extends a class. - * - * @param Name|string $class Name of class to extend - * - * @return $this The builder instance (for fluid interface) - */ - public function extend($class) { - $this->extends = BuilderHelpers::normalizeName($class); - - return $this; - } - - /** - * Implements one or more interfaces. - * - * @param Name|string ...$interfaces Names of interfaces to implement - * - * @return $this The builder instance (for fluid interface) - */ - public function implement(...$interfaces) { - foreach ($interfaces as $interface) { - $this->implements[] = BuilderHelpers::normalizeName($interface); - } - - return $this; - } - - /** - * Makes the class abstract. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeAbstract() { - $this->flags = BuilderHelpers::addClassModifier($this->flags, Stmt\Class_::MODIFIER_ABSTRACT); - - return $this; - } - - /** - * Makes the class final. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeFinal() { - $this->flags = BuilderHelpers::addClassModifier($this->flags, Stmt\Class_::MODIFIER_FINAL); - - return $this; - } - - public function makeReadonly() { - $this->flags = BuilderHelpers::addClassModifier($this->flags, Stmt\Class_::MODIFIER_READONLY); - - return $this; - } - - /** - * Adds a statement. - * - * @param Stmt|PhpParser\Builder $stmt The statement to add - * - * @return $this The builder instance (for fluid interface) - */ - public function addStmt($stmt) { - $stmt = BuilderHelpers::normalizeNode($stmt); - - $targets = [ - Stmt\TraitUse::class => &$this->uses, - Stmt\ClassConst::class => &$this->constants, - Stmt\Property::class => &$this->properties, - Stmt\ClassMethod::class => &$this->methods, - ]; - - $class = \get_class($stmt); - if (!isset($targets[$class])) { - throw new \LogicException(sprintf('Unexpected node of type "%s"', $stmt->getType())); - } - - $targets[$class][] = $stmt; - - return $this; - } - - /** - * Adds an attribute group. - * - * @param Node\Attribute|Node\AttributeGroup $attribute - * - * @return $this The builder instance (for fluid interface) - */ - public function addAttribute($attribute) { - $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); - - return $this; - } - - /** - * Returns the built class node. - * - * @return Stmt\Class_ The built class node - */ - public function getNode() : PhpParser\Node { - return new Stmt\Class_($this->name, [ - 'flags' => $this->flags, - 'extends' => $this->extends, - 'implements' => $this->implements, - 'stmts' => array_merge($this->uses, $this->constants, $this->properties, $this->methods), - 'attrGroups' => $this->attributeGroups, - ], $this->attributes); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Declaration.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Declaration.php deleted file mode 100644 index 83094992..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/Declaration.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Builder; - -use PhpParser; -use PhpParser\BuilderHelpers; - -abstract class Declaration implements PhpParser\Builder -{ - protected $attributes = []; - - abstract public function addStmt($stmt); - - /** - * Adds multiple statements. - * - * @param array $stmts The statements to add - * - * @return $this The builder instance (for fluid interface) - */ - public function addStmts(array $stmts) { - foreach ($stmts as $stmt) { - $this->addStmt($stmt); - } - - return $this; - } - - /** - * Sets doc comment for the declaration. - * - * @param PhpParser\Comment\Doc|string $docComment Doc comment to set - * - * @return $this The builder instance (for fluid interface) - */ - public function setDocComment($docComment) { - $this->attributes['comments'] = [ - BuilderHelpers::normalizeDocComment($docComment) - ]; - - return $this; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/EnumCase.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/EnumCase.php deleted file mode 100644 index 02fa83e6..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/EnumCase.php +++ /dev/null @@ -1,85 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace PhpParser\Builder; - -use PhpParser; -use PhpParser\BuilderHelpers; -use PhpParser\Node; -use PhpParser\Node\Identifier; -use PhpParser\Node\Stmt; - -class EnumCase implements PhpParser\Builder -{ - protected $name; - protected $value = null; - protected $attributes = []; - - /** @var Node\AttributeGroup[] */ - protected $attributeGroups = []; - - /** - * Creates an enum case builder. - * - * @param string|Identifier $name Name - */ - public function __construct($name) { - $this->name = $name; - } - - /** - * Sets the value. - * - * @param Node\Expr|string|int $value - * - * @return $this - */ - public function setValue($value) { - $this->value = BuilderHelpers::normalizeValue($value); - - return $this; - } - - /** - * Sets doc comment for the constant. - * - * @param PhpParser\Comment\Doc|string $docComment Doc comment to set - * - * @return $this The builder instance (for fluid interface) - */ - public function setDocComment($docComment) { - $this->attributes = [ - 'comments' => [BuilderHelpers::normalizeDocComment($docComment)] - ]; - - return $this; - } - - /** - * Adds an attribute group. - * - * @param Node\Attribute|Node\AttributeGroup $attribute - * - * @return $this The builder instance (for fluid interface) - */ - public function addAttribute($attribute) { - $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); - - return $this; - } - - /** - * Returns the built enum case node. - * - * @return Stmt\EnumCase The built constant node - */ - public function getNode(): PhpParser\Node { - return new Stmt\EnumCase( - $this->name, - $this->value, - $this->attributes, - $this->attributeGroups - ); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Enum_.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Enum_.php deleted file mode 100644 index be7eef95..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/Enum_.php +++ /dev/null @@ -1,117 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Builder; - -use PhpParser; -use PhpParser\BuilderHelpers; -use PhpParser\Node; -use PhpParser\Node\Identifier; -use PhpParser\Node\Name; -use PhpParser\Node\Stmt; - -class Enum_ extends Declaration -{ - protected $name; - protected $scalarType = null; - - protected $implements = []; - - protected $uses = []; - protected $enumCases = []; - protected $constants = []; - protected $methods = []; - - /** @var Node\AttributeGroup[] */ - protected $attributeGroups = []; - - /** - * Creates an enum builder. - * - * @param string $name Name of the enum - */ - public function __construct(string $name) { - $this->name = $name; - } - - /** - * Sets the scalar type. - * - * @param string|Identifier $type - * - * @return $this - */ - public function setScalarType($scalarType) { - $this->scalarType = BuilderHelpers::normalizeType($scalarType); - - return $this; - } - - /** - * Implements one or more interfaces. - * - * @param Name|string ...$interfaces Names of interfaces to implement - * - * @return $this The builder instance (for fluid interface) - */ - public function implement(...$interfaces) { - foreach ($interfaces as $interface) { - $this->implements[] = BuilderHelpers::normalizeName($interface); - } - - return $this; - } - - /** - * Adds a statement. - * - * @param Stmt|PhpParser\Builder $stmt The statement to add - * - * @return $this The builder instance (for fluid interface) - */ - public function addStmt($stmt) { - $stmt = BuilderHelpers::normalizeNode($stmt); - - $targets = [ - Stmt\TraitUse::class => &$this->uses, - Stmt\EnumCase::class => &$this->enumCases, - Stmt\ClassConst::class => &$this->constants, - Stmt\ClassMethod::class => &$this->methods, - ]; - - $class = \get_class($stmt); - if (!isset($targets[$class])) { - throw new \LogicException(sprintf('Unexpected node of type "%s"', $stmt->getType())); - } - - $targets[$class][] = $stmt; - - return $this; - } - - /** - * Adds an attribute group. - * - * @param Node\Attribute|Node\AttributeGroup $attribute - * - * @return $this The builder instance (for fluid interface) - */ - public function addAttribute($attribute) { - $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); - - return $this; - } - - /** - * Returns the built class node. - * - * @return Stmt\Enum_ The built enum node - */ - public function getNode() : PhpParser\Node { - return new Stmt\Enum_($this->name, [ - 'scalarType' => $this->scalarType, - 'implements' => $this->implements, - 'stmts' => array_merge($this->uses, $this->enumCases, $this->constants, $this->methods), - 'attrGroups' => $this->attributeGroups, - ], $this->attributes); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.php deleted file mode 100644 index 98ea9d33..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.php +++ /dev/null @@ -1,73 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Builder; - -use PhpParser\BuilderHelpers; -use PhpParser\Node; - -abstract class FunctionLike extends Declaration -{ - protected $returnByRef = false; - protected $params = []; - - /** @var string|Node\Name|Node\NullableType|null */ - protected $returnType = null; - - /** - * Make the function return by reference. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeReturnByRef() { - $this->returnByRef = true; - - return $this; - } - - /** - * Adds a parameter. - * - * @param Node\Param|Param $param The parameter to add - * - * @return $this The builder instance (for fluid interface) - */ - public function addParam($param) { - $param = BuilderHelpers::normalizeNode($param); - - if (!$param instanceof Node\Param) { - throw new \LogicException(sprintf('Expected parameter node, got "%s"', $param->getType())); - } - - $this->params[] = $param; - - return $this; - } - - /** - * Adds multiple parameters. - * - * @param array $params The parameters to add - * - * @return $this The builder instance (for fluid interface) - */ - public function addParams(array $params) { - foreach ($params as $param) { - $this->addParam($param); - } - - return $this; - } - - /** - * Sets the return type for PHP 7. - * - * @param string|Node\Name|Node\Identifier|Node\ComplexType $type - * - * @return $this The builder instance (for fluid interface) - */ - public function setReturnType($type) { - $this->returnType = BuilderHelpers::normalizeType($type); - - return $this; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Function_.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Function_.php deleted file mode 100644 index 1cd73c0d..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/Function_.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Builder; - -use PhpParser; -use PhpParser\BuilderHelpers; -use PhpParser\Node; -use PhpParser\Node\Stmt; - -class Function_ extends FunctionLike -{ - protected $name; - protected $stmts = []; - - /** @var Node\AttributeGroup[] */ - protected $attributeGroups = []; - - /** - * Creates a function builder. - * - * @param string $name Name of the function - */ - public function __construct(string $name) { - $this->name = $name; - } - - /** - * Adds a statement. - * - * @param Node|PhpParser\Builder $stmt The statement to add - * - * @return $this The builder instance (for fluid interface) - */ - public function addStmt($stmt) { - $this->stmts[] = BuilderHelpers::normalizeStmt($stmt); - - return $this; - } - - /** - * Adds an attribute group. - * - * @param Node\Attribute|Node\AttributeGroup $attribute - * - * @return $this The builder instance (for fluid interface) - */ - public function addAttribute($attribute) { - $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); - - return $this; - } - - /** - * Returns the built function node. - * - * @return Stmt\Function_ The built function node - */ - public function getNode() : Node { - return new Stmt\Function_($this->name, [ - 'byRef' => $this->returnByRef, - 'params' => $this->params, - 'returnType' => $this->returnType, - 'stmts' => $this->stmts, - 'attrGroups' => $this->attributeGroups, - ], $this->attributes); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Interface_.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Interface_.php deleted file mode 100644 index 7806e85f..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/Interface_.php +++ /dev/null @@ -1,93 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Builder; - -use PhpParser; -use PhpParser\BuilderHelpers; -use PhpParser\Node; -use PhpParser\Node\Name; -use PhpParser\Node\Stmt; - -class Interface_ extends Declaration -{ - protected $name; - protected $extends = []; - protected $constants = []; - protected $methods = []; - - /** @var Node\AttributeGroup[] */ - protected $attributeGroups = []; - - /** - * Creates an interface builder. - * - * @param string $name Name of the interface - */ - public function __construct(string $name) { - $this->name = $name; - } - - /** - * Extends one or more interfaces. - * - * @param Name|string ...$interfaces Names of interfaces to extend - * - * @return $this The builder instance (for fluid interface) - */ - public function extend(...$interfaces) { - foreach ($interfaces as $interface) { - $this->extends[] = BuilderHelpers::normalizeName($interface); - } - - return $this; - } - - /** - * Adds a statement. - * - * @param Stmt|PhpParser\Builder $stmt The statement to add - * - * @return $this The builder instance (for fluid interface) - */ - public function addStmt($stmt) { - $stmt = BuilderHelpers::normalizeNode($stmt); - - if ($stmt instanceof Stmt\ClassConst) { - $this->constants[] = $stmt; - } elseif ($stmt instanceof Stmt\ClassMethod) { - // we erase all statements in the body of an interface method - $stmt->stmts = null; - $this->methods[] = $stmt; - } else { - throw new \LogicException(sprintf('Unexpected node of type "%s"', $stmt->getType())); - } - - return $this; - } - - /** - * Adds an attribute group. - * - * @param Node\Attribute|Node\AttributeGroup $attribute - * - * @return $this The builder instance (for fluid interface) - */ - public function addAttribute($attribute) { - $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); - - return $this; - } - - /** - * Returns the built interface node. - * - * @return Stmt\Interface_ The built interface node - */ - public function getNode() : PhpParser\Node { - return new Stmt\Interface_($this->name, [ - 'extends' => $this->extends, - 'stmts' => array_merge($this->constants, $this->methods), - 'attrGroups' => $this->attributeGroups, - ], $this->attributes); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Method.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Method.php deleted file mode 100644 index 232d7cb8..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/Method.php +++ /dev/null @@ -1,146 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Builder; - -use PhpParser; -use PhpParser\BuilderHelpers; -use PhpParser\Node; -use PhpParser\Node\Stmt; - -class Method extends FunctionLike -{ - protected $name; - protected $flags = 0; - - /** @var array|null */ - protected $stmts = []; - - /** @var Node\AttributeGroup[] */ - protected $attributeGroups = []; - - /** - * Creates a method builder. - * - * @param string $name Name of the method - */ - public function __construct(string $name) { - $this->name = $name; - } - - /** - * Makes the method public. - * - * @return $this The builder instance (for fluid interface) - */ - public function makePublic() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PUBLIC); - - return $this; - } - - /** - * Makes the method protected. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeProtected() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PROTECTED); - - return $this; - } - - /** - * Makes the method private. - * - * @return $this The builder instance (for fluid interface) - */ - public function makePrivate() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PRIVATE); - - return $this; - } - - /** - * Makes the method static. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeStatic() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_STATIC); - - return $this; - } - - /** - * Makes the method abstract. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeAbstract() { - if (!empty($this->stmts)) { - throw new \LogicException('Cannot make method with statements abstract'); - } - - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_ABSTRACT); - $this->stmts = null; // abstract methods don't have statements - - return $this; - } - - /** - * Makes the method final. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeFinal() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_FINAL); - - return $this; - } - - /** - * Adds a statement. - * - * @param Node|PhpParser\Builder $stmt The statement to add - * - * @return $this The builder instance (for fluid interface) - */ - public function addStmt($stmt) { - if (null === $this->stmts) { - throw new \LogicException('Cannot add statements to an abstract method'); - } - - $this->stmts[] = BuilderHelpers::normalizeStmt($stmt); - - return $this; - } - - /** - * Adds an attribute group. - * - * @param Node\Attribute|Node\AttributeGroup $attribute - * - * @return $this The builder instance (for fluid interface) - */ - public function addAttribute($attribute) { - $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); - - return $this; - } - - /** - * Returns the built method node. - * - * @return Stmt\ClassMethod The built method node - */ - public function getNode() : Node { - return new Stmt\ClassMethod($this->name, [ - 'flags' => $this->flags, - 'byRef' => $this->returnByRef, - 'params' => $this->params, - 'returnType' => $this->returnType, - 'stmts' => $this->stmts, - 'attrGroups' => $this->attributeGroups, - ], $this->attributes); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Namespace_.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Namespace_.php deleted file mode 100644 index 1c751e16..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/Namespace_.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Builder; - -use PhpParser; -use PhpParser\BuilderHelpers; -use PhpParser\Node; -use PhpParser\Node\Stmt; - -class Namespace_ extends Declaration -{ - private $name; - private $stmts = []; - - /** - * Creates a namespace builder. - * - * @param Node\Name|string|null $name Name of the namespace - */ - public function __construct($name) { - $this->name = null !== $name ? BuilderHelpers::normalizeName($name) : null; - } - - /** - * Adds a statement. - * - * @param Node|PhpParser\Builder $stmt The statement to add - * - * @return $this The builder instance (for fluid interface) - */ - public function addStmt($stmt) { - $this->stmts[] = BuilderHelpers::normalizeStmt($stmt); - - return $this; - } - - /** - * Returns the built node. - * - * @return Stmt\Namespace_ The built node - */ - public function getNode() : Node { - return new Stmt\Namespace_($this->name, $this->stmts, $this->attributes); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php deleted file mode 100644 index de9aae7e..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php +++ /dev/null @@ -1,122 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Builder; - -use PhpParser; -use PhpParser\BuilderHelpers; -use PhpParser\Node; - -class Param implements PhpParser\Builder -{ - protected $name; - - protected $default = null; - - /** @var Node\Identifier|Node\Name|Node\NullableType|null */ - protected $type = null; - - protected $byRef = false; - - protected $variadic = false; - - /** @var Node\AttributeGroup[] */ - protected $attributeGroups = []; - - /** - * Creates a parameter builder. - * - * @param string $name Name of the parameter - */ - public function __construct(string $name) { - $this->name = $name; - } - - /** - * Sets default value for the parameter. - * - * @param mixed $value Default value to use - * - * @return $this The builder instance (for fluid interface) - */ - public function setDefault($value) { - $this->default = BuilderHelpers::normalizeValue($value); - - return $this; - } - - /** - * Sets type for the parameter. - * - * @param string|Node\Name|Node\Identifier|Node\ComplexType $type Parameter type - * - * @return $this The builder instance (for fluid interface) - */ - public function setType($type) { - $this->type = BuilderHelpers::normalizeType($type); - if ($this->type == 'void') { - throw new \LogicException('Parameter type cannot be void'); - } - - return $this; - } - - /** - * Sets type for the parameter. - * - * @param string|Node\Name|Node\Identifier|Node\ComplexType $type Parameter type - * - * @return $this The builder instance (for fluid interface) - * - * @deprecated Use setType() instead - */ - public function setTypeHint($type) { - return $this->setType($type); - } - - /** - * Make the parameter accept the value by reference. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeByRef() { - $this->byRef = true; - - return $this; - } - - /** - * Make the parameter variadic - * - * @return $this The builder instance (for fluid interface) - */ - public function makeVariadic() { - $this->variadic = true; - - return $this; - } - - /** - * Adds an attribute group. - * - * @param Node\Attribute|Node\AttributeGroup $attribute - * - * @return $this The builder instance (for fluid interface) - */ - public function addAttribute($attribute) { - $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); - - return $this; - } - - /** - * Returns the built parameter node. - * - * @return Node\Param The built parameter node - */ - public function getNode() : Node { - return new Node\Param( - new Node\Expr\Variable($this->name), - $this->default, $this->type, $this->byRef, $this->variadic, [], 0, $this->attributeGroups - ); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Property.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Property.php deleted file mode 100644 index 68e31856..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/Property.php +++ /dev/null @@ -1,161 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Builder; - -use PhpParser; -use PhpParser\BuilderHelpers; -use PhpParser\Node; -use PhpParser\Node\Identifier; -use PhpParser\Node\Name; -use PhpParser\Node\Stmt; -use PhpParser\Node\ComplexType; - -class Property implements PhpParser\Builder -{ - protected $name; - - protected $flags = 0; - protected $default = null; - protected $attributes = []; - - /** @var null|Identifier|Name|NullableType */ - protected $type; - - /** @var Node\AttributeGroup[] */ - protected $attributeGroups = []; - - /** - * Creates a property builder. - * - * @param string $name Name of the property - */ - public function __construct(string $name) { - $this->name = $name; - } - - /** - * Makes the property public. - * - * @return $this The builder instance (for fluid interface) - */ - public function makePublic() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PUBLIC); - - return $this; - } - - /** - * Makes the property protected. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeProtected() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PROTECTED); - - return $this; - } - - /** - * Makes the property private. - * - * @return $this The builder instance (for fluid interface) - */ - public function makePrivate() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PRIVATE); - - return $this; - } - - /** - * Makes the property static. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeStatic() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_STATIC); - - return $this; - } - - /** - * Makes the property readonly. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeReadonly() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_READONLY); - - return $this; - } - - /** - * Sets default value for the property. - * - * @param mixed $value Default value to use - * - * @return $this The builder instance (for fluid interface) - */ - public function setDefault($value) { - $this->default = BuilderHelpers::normalizeValue($value); - - return $this; - } - - /** - * Sets doc comment for the property. - * - * @param PhpParser\Comment\Doc|string $docComment Doc comment to set - * - * @return $this The builder instance (for fluid interface) - */ - public function setDocComment($docComment) { - $this->attributes = [ - 'comments' => [BuilderHelpers::normalizeDocComment($docComment)] - ]; - - return $this; - } - - /** - * Sets the property type for PHP 7.4+. - * - * @param string|Name|Identifier|ComplexType $type - * - * @return $this - */ - public function setType($type) { - $this->type = BuilderHelpers::normalizeType($type); - - return $this; - } - - /** - * Adds an attribute group. - * - * @param Node\Attribute|Node\AttributeGroup $attribute - * - * @return $this The builder instance (for fluid interface) - */ - public function addAttribute($attribute) { - $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); - - return $this; - } - - /** - * Returns the built class node. - * - * @return Stmt\Property The built property node - */ - public function getNode() : PhpParser\Node { - return new Stmt\Property( - $this->flags !== 0 ? $this->flags : Stmt\Class_::MODIFIER_PUBLIC, - [ - new Stmt\PropertyProperty($this->name, $this->default) - ], - $this->attributes, - $this->type, - $this->attributeGroups - ); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUse.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUse.php deleted file mode 100644 index 311e8cd7..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUse.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Builder; - -use PhpParser\Builder; -use PhpParser\BuilderHelpers; -use PhpParser\Node; -use PhpParser\Node\Stmt; - -class TraitUse implements Builder -{ - protected $traits = []; - protected $adaptations = []; - - /** - * Creates a trait use builder. - * - * @param Node\Name|string ...$traits Names of used traits - */ - public function __construct(...$traits) { - foreach ($traits as $trait) { - $this->and($trait); - } - } - - /** - * Adds used trait. - * - * @param Node\Name|string $trait Trait name - * - * @return $this The builder instance (for fluid interface) - */ - public function and($trait) { - $this->traits[] = BuilderHelpers::normalizeName($trait); - return $this; - } - - /** - * Adds trait adaptation. - * - * @param Stmt\TraitUseAdaptation|Builder\TraitUseAdaptation $adaptation Trait adaptation - * - * @return $this The builder instance (for fluid interface) - */ - public function with($adaptation) { - $adaptation = BuilderHelpers::normalizeNode($adaptation); - - if (!$adaptation instanceof Stmt\TraitUseAdaptation) { - throw new \LogicException('Adaptation must have type TraitUseAdaptation'); - } - - $this->adaptations[] = $adaptation; - return $this; - } - - /** - * Returns the built node. - * - * @return Node The built node - */ - public function getNode() : Node { - return new Stmt\TraitUse($this->traits, $this->adaptations); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUseAdaptation.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUseAdaptation.php deleted file mode 100644 index eb6c0b62..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUseAdaptation.php +++ /dev/null @@ -1,148 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Builder; - -use PhpParser\Builder; -use PhpParser\BuilderHelpers; -use PhpParser\Node; -use PhpParser\Node\Stmt; - -class TraitUseAdaptation implements Builder -{ - const TYPE_UNDEFINED = 0; - const TYPE_ALIAS = 1; - const TYPE_PRECEDENCE = 2; - - /** @var int Type of building adaptation */ - protected $type; - - protected $trait; - protected $method; - - protected $modifier = null; - protected $alias = null; - - protected $insteadof = []; - - /** - * Creates a trait use adaptation builder. - * - * @param Node\Name|string|null $trait Name of adaptated trait - * @param Node\Identifier|string $method Name of adaptated method - */ - public function __construct($trait, $method) { - $this->type = self::TYPE_UNDEFINED; - - $this->trait = is_null($trait)? null: BuilderHelpers::normalizeName($trait); - $this->method = BuilderHelpers::normalizeIdentifier($method); - } - - /** - * Sets alias of method. - * - * @param Node\Identifier|string $alias Alias for adaptated method - * - * @return $this The builder instance (for fluid interface) - */ - public function as($alias) { - if ($this->type === self::TYPE_UNDEFINED) { - $this->type = self::TYPE_ALIAS; - } - - if ($this->type !== self::TYPE_ALIAS) { - throw new \LogicException('Cannot set alias for not alias adaptation buider'); - } - - $this->alias = $alias; - return $this; - } - - /** - * Sets adaptated method public. - * - * @return $this The builder instance (for fluid interface) - */ - public function makePublic() { - $this->setModifier(Stmt\Class_::MODIFIER_PUBLIC); - return $this; - } - - /** - * Sets adaptated method protected. - * - * @return $this The builder instance (for fluid interface) - */ - public function makeProtected() { - $this->setModifier(Stmt\Class_::MODIFIER_PROTECTED); - return $this; - } - - /** - * Sets adaptated method private. - * - * @return $this The builder instance (for fluid interface) - */ - public function makePrivate() { - $this->setModifier(Stmt\Class_::MODIFIER_PRIVATE); - return $this; - } - - /** - * Adds overwritten traits. - * - * @param Node\Name|string ...$traits Traits for overwrite - * - * @return $this The builder instance (for fluid interface) - */ - public function insteadof(...$traits) { - if ($this->type === self::TYPE_UNDEFINED) { - if (is_null($this->trait)) { - throw new \LogicException('Precedence adaptation must have trait'); - } - - $this->type = self::TYPE_PRECEDENCE; - } - - if ($this->type !== self::TYPE_PRECEDENCE) { - throw new \LogicException('Cannot add overwritten traits for not precedence adaptation buider'); - } - - foreach ($traits as $trait) { - $this->insteadof[] = BuilderHelpers::normalizeName($trait); - } - - return $this; - } - - protected function setModifier(int $modifier) { - if ($this->type === self::TYPE_UNDEFINED) { - $this->type = self::TYPE_ALIAS; - } - - if ($this->type !== self::TYPE_ALIAS) { - throw new \LogicException('Cannot set access modifier for not alias adaptation buider'); - } - - if (is_null($this->modifier)) { - $this->modifier = $modifier; - } else { - throw new \LogicException('Multiple access type modifiers are not allowed'); - } - } - - /** - * Returns the built node. - * - * @return Node The built node - */ - public function getNode() : Node { - switch ($this->type) { - case self::TYPE_ALIAS: - return new Stmt\TraitUseAdaptation\Alias($this->trait, $this->method, $this->modifier, $this->alias); - case self::TYPE_PRECEDENCE: - return new Stmt\TraitUseAdaptation\Precedence($this->trait, $this->method, $this->insteadof); - default: - throw new \LogicException('Type of adaptation is not defined'); - } - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Trait_.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Trait_.php deleted file mode 100644 index 97f32f98..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/Trait_.php +++ /dev/null @@ -1,78 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Builder; - -use PhpParser; -use PhpParser\BuilderHelpers; -use PhpParser\Node; -use PhpParser\Node\Stmt; - -class Trait_ extends Declaration -{ - protected $name; - protected $uses = []; - protected $properties = []; - protected $methods = []; - - /** @var Node\AttributeGroup[] */ - protected $attributeGroups = []; - - /** - * Creates an interface builder. - * - * @param string $name Name of the interface - */ - public function __construct(string $name) { - $this->name = $name; - } - - /** - * Adds a statement. - * - * @param Stmt|PhpParser\Builder $stmt The statement to add - * - * @return $this The builder instance (for fluid interface) - */ - public function addStmt($stmt) { - $stmt = BuilderHelpers::normalizeNode($stmt); - - if ($stmt instanceof Stmt\Property) { - $this->properties[] = $stmt; - } elseif ($stmt instanceof Stmt\ClassMethod) { - $this->methods[] = $stmt; - } elseif ($stmt instanceof Stmt\TraitUse) { - $this->uses[] = $stmt; - } else { - throw new \LogicException(sprintf('Unexpected node of type "%s"', $stmt->getType())); - } - - return $this; - } - - /** - * Adds an attribute group. - * - * @param Node\Attribute|Node\AttributeGroup $attribute - * - * @return $this The builder instance (for fluid interface) - */ - public function addAttribute($attribute) { - $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute); - - return $this; - } - - /** - * Returns the built trait node. - * - * @return Stmt\Trait_ The built interface node - */ - public function getNode() : PhpParser\Node { - return new Stmt\Trait_( - $this->name, [ - 'stmts' => array_merge($this->uses, $this->properties, $this->methods), - 'attrGroups' => $this->attributeGroups, - ], $this->attributes - ); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Use_.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Use_.php deleted file mode 100644 index 4bd3d12d..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/Use_.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Builder; - -use PhpParser\Builder; -use PhpParser\BuilderHelpers; -use PhpParser\Node; -use PhpParser\Node\Stmt; - -class Use_ implements Builder -{ - protected $name; - protected $type; - protected $alias = null; - - /** - * Creates a name use (alias) builder. - * - * @param Node\Name|string $name Name of the entity (namespace, class, function, constant) to alias - * @param int $type One of the Stmt\Use_::TYPE_* constants - */ - public function __construct($name, int $type) { - $this->name = BuilderHelpers::normalizeName($name); - $this->type = $type; - } - - /** - * Sets alias for used name. - * - * @param string $alias Alias to use (last component of full name by default) - * - * @return $this The builder instance (for fluid interface) - */ - public function as(string $alias) { - $this->alias = $alias; - return $this; - } - - /** - * Returns the built node. - * - * @return Stmt\Use_ The built node - */ - public function getNode() : Node { - return new Stmt\Use_([ - new Stmt\UseUse($this->name, $this->alias) - ], $this->type); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/BuilderFactory.php b/vendor/nikic/php-parser/lib/PhpParser/BuilderFactory.php deleted file mode 100644 index fef2579b..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/BuilderFactory.php +++ /dev/null @@ -1,399 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser; - -use PhpParser\Node\Arg; -use PhpParser\Node\Expr; -use PhpParser\Node\Expr\BinaryOp\Concat; -use PhpParser\Node\Identifier; -use PhpParser\Node\Name; -use PhpParser\Node\Scalar\String_; -use PhpParser\Node\Stmt\Use_; - -class BuilderFactory -{ - /** - * Creates an attribute node. - * - * @param string|Name $name Name of the attribute - * @param array $args Attribute named arguments - * - * @return Node\Attribute - */ - public function attribute($name, array $args = []) : Node\Attribute { - return new Node\Attribute( - BuilderHelpers::normalizeName($name), - $this->args($args) - ); - } - - /** - * Creates a namespace builder. - * - * @param null|string|Node\Name $name Name of the namespace - * - * @return Builder\Namespace_ The created namespace builder - */ - public function namespace($name) : Builder\Namespace_ { - return new Builder\Namespace_($name); - } - - /** - * Creates a class builder. - * - * @param string $name Name of the class - * - * @return Builder\Class_ The created class builder - */ - public function class(string $name) : Builder\Class_ { - return new Builder\Class_($name); - } - - /** - * Creates an interface builder. - * - * @param string $name Name of the interface - * - * @return Builder\Interface_ The created interface builder - */ - public function interface(string $name) : Builder\Interface_ { - return new Builder\Interface_($name); - } - - /** - * Creates a trait builder. - * - * @param string $name Name of the trait - * - * @return Builder\Trait_ The created trait builder - */ - public function trait(string $name) : Builder\Trait_ { - return new Builder\Trait_($name); - } - - /** - * Creates an enum builder. - * - * @param string $name Name of the enum - * - * @return Builder\Enum_ The created enum builder - */ - public function enum(string $name) : Builder\Enum_ { - return new Builder\Enum_($name); - } - - /** - * Creates a trait use builder. - * - * @param Node\Name|string ...$traits Trait names - * - * @return Builder\TraitUse The create trait use builder - */ - public function useTrait(...$traits) : Builder\TraitUse { - return new Builder\TraitUse(...$traits); - } - - /** - * Creates a trait use adaptation builder. - * - * @param Node\Name|string|null $trait Trait name - * @param Node\Identifier|string $method Method name - * - * @return Builder\TraitUseAdaptation The create trait use adaptation builder - */ - public function traitUseAdaptation($trait, $method = null) : Builder\TraitUseAdaptation { - if ($method === null) { - $method = $trait; - $trait = null; - } - - return new Builder\TraitUseAdaptation($trait, $method); - } - - /** - * Creates a method builder. - * - * @param string $name Name of the method - * - * @return Builder\Method The created method builder - */ - public function method(string $name) : Builder\Method { - return new Builder\Method($name); - } - - /** - * Creates a parameter builder. - * - * @param string $name Name of the parameter - * - * @return Builder\Param The created parameter builder - */ - public function param(string $name) : Builder\Param { - return new Builder\Param($name); - } - - /** - * Creates a property builder. - * - * @param string $name Name of the property - * - * @return Builder\Property The created property builder - */ - public function property(string $name) : Builder\Property { - return new Builder\Property($name); - } - - /** - * Creates a function builder. - * - * @param string $name Name of the function - * - * @return Builder\Function_ The created function builder - */ - public function function(string $name) : Builder\Function_ { - return new Builder\Function_($name); - } - - /** - * Creates a namespace/class use builder. - * - * @param Node\Name|string $name Name of the entity (namespace or class) to alias - * - * @return Builder\Use_ The created use builder - */ - public function use($name) : Builder\Use_ { - return new Builder\Use_($name, Use_::TYPE_NORMAL); - } - - /** - * Creates a function use builder. - * - * @param Node\Name|string $name Name of the function to alias - * - * @return Builder\Use_ The created use function builder - */ - public function useFunction($name) : Builder\Use_ { - return new Builder\Use_($name, Use_::TYPE_FUNCTION); - } - - /** - * Creates a constant use builder. - * - * @param Node\Name|string $name Name of the const to alias - * - * @return Builder\Use_ The created use const builder - */ - public function useConst($name) : Builder\Use_ { - return new Builder\Use_($name, Use_::TYPE_CONSTANT); - } - - /** - * Creates a class constant builder. - * - * @param string|Identifier $name Name - * @param Node\Expr|bool|null|int|float|string|array $value Value - * - * @return Builder\ClassConst The created use const builder - */ - public function classConst($name, $value) : Builder\ClassConst { - return new Builder\ClassConst($name, $value); - } - - /** - * Creates an enum case builder. - * - * @param string|Identifier $name Name - * - * @return Builder\EnumCase The created use const builder - */ - public function enumCase($name) : Builder\EnumCase { - return new Builder\EnumCase($name); - } - - /** - * Creates node a for a literal value. - * - * @param Expr|bool|null|int|float|string|array $value $value - * - * @return Expr - */ - public function val($value) : Expr { - return BuilderHelpers::normalizeValue($value); - } - - /** - * Creates variable node. - * - * @param string|Expr $name Name - * - * @return Expr\Variable - */ - public function var($name) : Expr\Variable { - if (!\is_string($name) && !$name instanceof Expr) { - throw new \LogicException('Variable name must be string or Expr'); - } - - return new Expr\Variable($name); - } - - /** - * Normalizes an argument list. - * - * Creates Arg nodes for all arguments and converts literal values to expressions. - * - * @param array $args List of arguments to normalize - * - * @return Arg[] - */ - public function args(array $args) : array { - $normalizedArgs = []; - foreach ($args as $key => $arg) { - if (!($arg instanceof Arg)) { - $arg = new Arg(BuilderHelpers::normalizeValue($arg)); - } - if (\is_string($key)) { - $arg->name = BuilderHelpers::normalizeIdentifier($key); - } - $normalizedArgs[] = $arg; - } - return $normalizedArgs; - } - - /** - * Creates a function call node. - * - * @param string|Name|Expr $name Function name - * @param array $args Function arguments - * - * @return Expr\FuncCall - */ - public function funcCall($name, array $args = []) : Expr\FuncCall { - return new Expr\FuncCall( - BuilderHelpers::normalizeNameOrExpr($name), - $this->args($args) - ); - } - - /** - * Creates a method call node. - * - * @param Expr $var Variable the method is called on - * @param string|Identifier|Expr $name Method name - * @param array $args Method arguments - * - * @return Expr\MethodCall - */ - public function methodCall(Expr $var, $name, array $args = []) : Expr\MethodCall { - return new Expr\MethodCall( - $var, - BuilderHelpers::normalizeIdentifierOrExpr($name), - $this->args($args) - ); - } - - /** - * Creates a static method call node. - * - * @param string|Name|Expr $class Class name - * @param string|Identifier|Expr $name Method name - * @param array $args Method arguments - * - * @return Expr\StaticCall - */ - public function staticCall($class, $name, array $args = []) : Expr\StaticCall { - return new Expr\StaticCall( - BuilderHelpers::normalizeNameOrExpr($class), - BuilderHelpers::normalizeIdentifierOrExpr($name), - $this->args($args) - ); - } - - /** - * Creates an object creation node. - * - * @param string|Name|Expr $class Class name - * @param array $args Constructor arguments - * - * @return Expr\New_ - */ - public function new($class, array $args = []) : Expr\New_ { - return new Expr\New_( - BuilderHelpers::normalizeNameOrExpr($class), - $this->args($args) - ); - } - - /** - * Creates a constant fetch node. - * - * @param string|Name $name Constant name - * - * @return Expr\ConstFetch - */ - public function constFetch($name) : Expr\ConstFetch { - return new Expr\ConstFetch(BuilderHelpers::normalizeName($name)); - } - - /** - * Creates a property fetch node. - * - * @param Expr $var Variable holding object - * @param string|Identifier|Expr $name Property name - * - * @return Expr\PropertyFetch - */ - public function propertyFetch(Expr $var, $name) : Expr\PropertyFetch { - return new Expr\PropertyFetch($var, BuilderHelpers::normalizeIdentifierOrExpr($name)); - } - - /** - * Creates a class constant fetch node. - * - * @param string|Name|Expr $class Class name - * @param string|Identifier $name Constant name - * - * @return Expr\ClassConstFetch - */ - public function classConstFetch($class, $name): Expr\ClassConstFetch { - return new Expr\ClassConstFetch( - BuilderHelpers::normalizeNameOrExpr($class), - BuilderHelpers::normalizeIdentifier($name) - ); - } - - /** - * Creates nested Concat nodes from a list of expressions. - * - * @param Expr|string ...$exprs Expressions or literal strings - * - * @return Concat - */ - public function concat(...$exprs) : Concat { - $numExprs = count($exprs); - if ($numExprs < 2) { - throw new \LogicException('Expected at least two expressions'); - } - - $lastConcat = $this->normalizeStringExpr($exprs[0]); - for ($i = 1; $i < $numExprs; $i++) { - $lastConcat = new Concat($lastConcat, $this->normalizeStringExpr($exprs[$i])); - } - return $lastConcat; - } - - /** - * @param string|Expr $expr - * @return Expr - */ - private function normalizeStringExpr($expr) : Expr { - if ($expr instanceof Expr) { - return $expr; - } - - if (\is_string($expr)) { - return new String_($expr); - } - - throw new \LogicException('Expected string or Expr'); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php b/vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php deleted file mode 100644 index af6ceb99..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php +++ /dev/null @@ -1,335 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser; - -use PhpParser\Node\ComplexType; -use PhpParser\Node\Expr; -use PhpParser\Node\Identifier; -use PhpParser\Node\Name; -use PhpParser\Node\NullableType; -use PhpParser\Node\Scalar; -use PhpParser\Node\Stmt; - -/** - * This class defines helpers used in the implementation of builders. Don't use it directly. - * - * @internal - */ -final class BuilderHelpers -{ - /** - * Normalizes a node: Converts builder objects to nodes. - * - * @param Node|Builder $node The node to normalize - * - * @return Node The normalized node - */ - public static function normalizeNode($node) : Node { - if ($node instanceof Builder) { - return $node->getNode(); - } - - if ($node instanceof Node) { - return $node; - } - - throw new \LogicException('Expected node or builder object'); - } - - /** - * Normalizes a node to a statement. - * - * Expressions are wrapped in a Stmt\Expression node. - * - * @param Node|Builder $node The node to normalize - * - * @return Stmt The normalized statement node - */ - public static function normalizeStmt($node) : Stmt { - $node = self::normalizeNode($node); - if ($node instanceof Stmt) { - return $node; - } - - if ($node instanceof Expr) { - return new Stmt\Expression($node); - } - - throw new \LogicException('Expected statement or expression node'); - } - - /** - * Normalizes strings to Identifier. - * - * @param string|Identifier $name The identifier to normalize - * - * @return Identifier The normalized identifier - */ - public static function normalizeIdentifier($name) : Identifier { - if ($name instanceof Identifier) { - return $name; - } - - if (\is_string($name)) { - return new Identifier($name); - } - - throw new \LogicException('Expected string or instance of Node\Identifier'); - } - - /** - * Normalizes strings to Identifier, also allowing expressions. - * - * @param string|Identifier|Expr $name The identifier to normalize - * - * @return Identifier|Expr The normalized identifier or expression - */ - public static function normalizeIdentifierOrExpr($name) { - if ($name instanceof Identifier || $name instanceof Expr) { - return $name; - } - - if (\is_string($name)) { - return new Identifier($name); - } - - throw new \LogicException('Expected string or instance of Node\Identifier or Node\Expr'); - } - - /** - * Normalizes a name: Converts string names to Name nodes. - * - * @param Name|string $name The name to normalize - * - * @return Name The normalized name - */ - public static function normalizeName($name) : Name { - if ($name instanceof Name) { - return $name; - } - - if (is_string($name)) { - if (!$name) { - throw new \LogicException('Name cannot be empty'); - } - - if ($name[0] === '\\') { - return new Name\FullyQualified(substr($name, 1)); - } - - if (0 === strpos($name, 'namespace\\')) { - return new Name\Relative(substr($name, strlen('namespace\\'))); - } - - return new Name($name); - } - - throw new \LogicException('Name must be a string or an instance of Node\Name'); - } - - /** - * Normalizes a name: Converts string names to Name nodes, while also allowing expressions. - * - * @param Expr|Name|string $name The name to normalize - * - * @return Name|Expr The normalized name or expression - */ - public static function normalizeNameOrExpr($name) { - if ($name instanceof Expr) { - return $name; - } - - if (!is_string($name) && !($name instanceof Name)) { - throw new \LogicException( - 'Name must be a string or an instance of Node\Name or Node\Expr' - ); - } - - return self::normalizeName($name); - } - - /** - * Normalizes a type: Converts plain-text type names into proper AST representation. - * - * In particular, builtin types become Identifiers, custom types become Names and nullables - * are wrapped in NullableType nodes. - * - * @param string|Name|Identifier|ComplexType $type The type to normalize - * - * @return Name|Identifier|ComplexType The normalized type - */ - public static function normalizeType($type) { - if (!is_string($type)) { - if ( - !$type instanceof Name && !$type instanceof Identifier && - !$type instanceof ComplexType - ) { - throw new \LogicException( - 'Type must be a string, or an instance of Name, Identifier or ComplexType' - ); - } - return $type; - } - - $nullable = false; - if (strlen($type) > 0 && $type[0] === '?') { - $nullable = true; - $type = substr($type, 1); - } - - $builtinTypes = [ - 'array', - 'callable', - 'bool', - 'int', - 'float', - 'string', - 'iterable', - 'void', - 'object', - 'null', - 'false', - 'mixed', - 'never', - 'true', - ]; - - $lowerType = strtolower($type); - if (in_array($lowerType, $builtinTypes)) { - $type = new Identifier($lowerType); - } else { - $type = self::normalizeName($type); - } - - $notNullableTypes = [ - 'void', 'mixed', 'never', - ]; - if ($nullable && in_array((string) $type, $notNullableTypes)) { - throw new \LogicException(sprintf('%s type cannot be nullable', $type)); - } - - return $nullable ? new NullableType($type) : $type; - } - - /** - * Normalizes a value: Converts nulls, booleans, integers, - * floats, strings and arrays into their respective nodes - * - * @param Node\Expr|bool|null|int|float|string|array $value The value to normalize - * - * @return Expr The normalized value - */ - public static function normalizeValue($value) : Expr { - if ($value instanceof Node\Expr) { - return $value; - } - - if (is_null($value)) { - return new Expr\ConstFetch( - new Name('null') - ); - } - - if (is_bool($value)) { - return new Expr\ConstFetch( - new Name($value ? 'true' : 'false') - ); - } - - if (is_int($value)) { - return new Scalar\LNumber($value); - } - - if (is_float($value)) { - return new Scalar\DNumber($value); - } - - if (is_string($value)) { - return new Scalar\String_($value); - } - - if (is_array($value)) { - $items = []; - $lastKey = -1; - foreach ($value as $itemKey => $itemValue) { - // for consecutive, numeric keys don't generate keys - if (null !== $lastKey && ++$lastKey === $itemKey) { - $items[] = new Expr\ArrayItem( - self::normalizeValue($itemValue) - ); - } else { - $lastKey = null; - $items[] = new Expr\ArrayItem( - self::normalizeValue($itemValue), - self::normalizeValue($itemKey) - ); - } - } - - return new Expr\Array_($items); - } - - throw new \LogicException('Invalid value'); - } - - /** - * Normalizes a doc comment: Converts plain strings to PhpParser\Comment\Doc. - * - * @param Comment\Doc|string $docComment The doc comment to normalize - * - * @return Comment\Doc The normalized doc comment - */ - public static function normalizeDocComment($docComment) : Comment\Doc { - if ($docComment instanceof Comment\Doc) { - return $docComment; - } - - if (is_string($docComment)) { - return new Comment\Doc($docComment); - } - - throw new \LogicException('Doc comment must be a string or an instance of PhpParser\Comment\Doc'); - } - - /** - * Normalizes a attribute: Converts attribute to the Attribute Group if needed. - * - * @param Node\Attribute|Node\AttributeGroup $attribute - * - * @return Node\AttributeGroup The Attribute Group - */ - public static function normalizeAttribute($attribute) : Node\AttributeGroup - { - if ($attribute instanceof Node\AttributeGroup) { - return $attribute; - } - - if (!($attribute instanceof Node\Attribute)) { - throw new \LogicException('Attribute must be an instance of PhpParser\Node\Attribute or PhpParser\Node\AttributeGroup'); - } - - return new Node\AttributeGroup([$attribute]); - } - - /** - * Adds a modifier and returns new modifier bitmask. - * - * @param int $modifiers Existing modifiers - * @param int $modifier Modifier to set - * - * @return int New modifiers - */ - public static function addModifier(int $modifiers, int $modifier) : int { - Stmt\Class_::verifyModifier($modifiers, $modifier); - return $modifiers | $modifier; - } - - /** - * Adds a modifier and returns new modifier bitmask. - * @return int New modifiers - */ - public static function addClassModifier(int $existingModifiers, int $modifierToSet) : int { - Stmt\Class_::verifyClassModifier($existingModifiers, $modifierToSet); - return $existingModifiers | $modifierToSet; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Comment.php b/vendor/nikic/php-parser/lib/PhpParser/Comment.php deleted file mode 100644 index 61e98d3d..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Comment.php +++ /dev/null @@ -1,239 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser; - -class Comment implements \JsonSerializable -{ - protected $text; - protected $startLine; - protected $startFilePos; - protected $startTokenPos; - protected $endLine; - protected $endFilePos; - protected $endTokenPos; - - /** - * Constructs a comment node. - * - * @param string $text Comment text (including comment delimiters like /*) - * @param int $startLine Line number the comment started on - * @param int $startFilePos File offset the comment started on - * @param int $startTokenPos Token offset the comment started on - */ - public function __construct( - string $text, - int $startLine = -1, int $startFilePos = -1, int $startTokenPos = -1, - int $endLine = -1, int $endFilePos = -1, int $endTokenPos = -1 - ) { - $this->text = $text; - $this->startLine = $startLine; - $this->startFilePos = $startFilePos; - $this->startTokenPos = $startTokenPos; - $this->endLine = $endLine; - $this->endFilePos = $endFilePos; - $this->endTokenPos = $endTokenPos; - } - - /** - * Gets the comment text. - * - * @return string The comment text (including comment delimiters like /*) - */ - public function getText() : string { - return $this->text; - } - - /** - * Gets the line number the comment started on. - * - * @return int Line number (or -1 if not available) - */ - public function getStartLine() : int { - return $this->startLine; - } - - /** - * Gets the file offset the comment started on. - * - * @return int File offset (or -1 if not available) - */ - public function getStartFilePos() : int { - return $this->startFilePos; - } - - /** - * Gets the token offset the comment started on. - * - * @return int Token offset (or -1 if not available) - */ - public function getStartTokenPos() : int { - return $this->startTokenPos; - } - - /** - * Gets the line number the comment ends on. - * - * @return int Line number (or -1 if not available) - */ - public function getEndLine() : int { - return $this->endLine; - } - - /** - * Gets the file offset the comment ends on. - * - * @return int File offset (or -1 if not available) - */ - public function getEndFilePos() : int { - return $this->endFilePos; - } - - /** - * Gets the token offset the comment ends on. - * - * @return int Token offset (or -1 if not available) - */ - public function getEndTokenPos() : int { - return $this->endTokenPos; - } - - /** - * Gets the line number the comment started on. - * - * @deprecated Use getStartLine() instead - * - * @return int Line number - */ - public function getLine() : int { - return $this->startLine; - } - - /** - * Gets the file offset the comment started on. - * - * @deprecated Use getStartFilePos() instead - * - * @return int File offset - */ - public function getFilePos() : int { - return $this->startFilePos; - } - - /** - * Gets the token offset the comment started on. - * - * @deprecated Use getStartTokenPos() instead - * - * @return int Token offset - */ - public function getTokenPos() : int { - return $this->startTokenPos; - } - - /** - * Gets the comment text. - * - * @return string The comment text (including comment delimiters like /*) - */ - public function __toString() : string { - return $this->text; - } - - /** - * Gets the reformatted comment text. - * - * "Reformatted" here means that we try to clean up the whitespace at the - * starts of the lines. This is necessary because we receive the comments - * without trailing whitespace on the first line, but with trailing whitespace - * on all subsequent lines. - * - * @return mixed|string - */ - public function getReformattedText() { - $text = trim($this->text); - $newlinePos = strpos($text, "\n"); - if (false === $newlinePos) { - // Single line comments don't need further processing - return $text; - } elseif (preg_match('((*BSR_ANYCRLF)(*ANYCRLF)^.*(?:\R\s+\*.*)+$)', $text)) { - // Multi line comment of the type - // - // /* - // * Some text. - // * Some more text. - // */ - // - // is handled by replacing the whitespace sequences before the * by a single space - return preg_replace('(^\s+\*)m', ' *', $this->text); - } elseif (preg_match('(^/\*\*?\s*[\r\n])', $text) && preg_match('(\n(\s*)\*/$)', $text, $matches)) { - // Multi line comment of the type - // - // /* - // Some text. - // Some more text. - // */ - // - // is handled by removing the whitespace sequence on the line before the closing - // */ on all lines. So if the last line is " */", then " " is removed at the - // start of all lines. - return preg_replace('(^' . preg_quote($matches[1]) . ')m', '', $text); - } elseif (preg_match('(^/\*\*?\s*(?!\s))', $text, $matches)) { - // Multi line comment of the type - // - // /* Some text. - // Some more text. - // Indented text. - // Even more text. */ - // - // is handled by removing the difference between the shortest whitespace prefix on all - // lines and the length of the "/* " opening sequence. - $prefixLen = $this->getShortestWhitespacePrefixLen(substr($text, $newlinePos + 1)); - $removeLen = $prefixLen - strlen($matches[0]); - return preg_replace('(^\s{' . $removeLen . '})m', '', $text); - } - - // No idea how to format this comment, so simply return as is - return $text; - } - - /** - * Get length of shortest whitespace prefix (at the start of a line). - * - * If there is a line with no prefix whitespace, 0 is a valid return value. - * - * @param string $str String to check - * @return int Length in characters. Tabs count as single characters. - */ - private function getShortestWhitespacePrefixLen(string $str) : int { - $lines = explode("\n", $str); - $shortestPrefixLen = \INF; - foreach ($lines as $line) { - preg_match('(^\s*)', $line, $matches); - $prefixLen = strlen($matches[0]); - if ($prefixLen < $shortestPrefixLen) { - $shortestPrefixLen = $prefixLen; - } - } - return $shortestPrefixLen; - } - - /** - * @return array - * @psalm-return array{nodeType:string, text:mixed, line:mixed, filePos:mixed} - */ - public function jsonSerialize() : array { - // Technically not a node, but we make it look like one anyway - $type = $this instanceof Comment\Doc ? 'Comment_Doc' : 'Comment'; - return [ - 'nodeType' => $type, - 'text' => $this->text, - // TODO: Rename these to include "start". - 'line' => $this->startLine, - 'filePos' => $this->startFilePos, - 'tokenPos' => $this->startTokenPos, - 'endLine' => $this->endLine, - 'endFilePos' => $this->endFilePos, - 'endTokenPos' => $this->endTokenPos, - ]; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Comment/Doc.php b/vendor/nikic/php-parser/lib/PhpParser/Comment/Doc.php deleted file mode 100644 index a9db6128..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Comment/Doc.php +++ /dev/null @@ -1,7 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Comment; - -class Doc extends \PhpParser\Comment -{ -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/ConstExprEvaluationException.php b/vendor/nikic/php-parser/lib/PhpParser/ConstExprEvaluationException.php deleted file mode 100644 index 49c92d59..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/ConstExprEvaluationException.php +++ /dev/null @@ -1,6 +0,0 @@ -<?php - -namespace PhpParser; - -class ConstExprEvaluationException extends \Exception -{} diff --git a/vendor/nikic/php-parser/lib/PhpParser/ConstExprEvaluator.php b/vendor/nikic/php-parser/lib/PhpParser/ConstExprEvaluator.php deleted file mode 100644 index 7131c3d2..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/ConstExprEvaluator.php +++ /dev/null @@ -1,229 +0,0 @@ -<?php - -namespace PhpParser; - -use function array_merge; -use PhpParser\Node\Expr; -use PhpParser\Node\Scalar; - -/** - * Evaluates constant expressions. - * - * This evaluator is able to evaluate all constant expressions (as defined by PHP), which can be - * evaluated without further context. If a subexpression is not of this type, a user-provided - * fallback evaluator is invoked. To support all constant expressions that are also supported by - * PHP (and not already handled by this class), the fallback evaluator must be able to handle the - * following node types: - * - * * All Scalar\MagicConst\* nodes. - * * Expr\ConstFetch nodes. Only null/false/true are already handled by this class. - * * Expr\ClassConstFetch nodes. - * - * The fallback evaluator should throw ConstExprEvaluationException for nodes it cannot evaluate. - * - * The evaluation is dependent on runtime configuration in two respects: Firstly, floating - * point to string conversions are affected by the precision ini setting. Secondly, they are also - * affected by the LC_NUMERIC locale. - */ -class ConstExprEvaluator -{ - private $fallbackEvaluator; - - /** - * Create a constant expression evaluator. - * - * The provided fallback evaluator is invoked whenever a subexpression cannot be evaluated. See - * class doc comment for more information. - * - * @param callable|null $fallbackEvaluator To call if subexpression cannot be evaluated - */ - public function __construct(callable $fallbackEvaluator = null) { - $this->fallbackEvaluator = $fallbackEvaluator ?? function(Expr $expr) { - throw new ConstExprEvaluationException( - "Expression of type {$expr->getType()} cannot be evaluated" - ); - }; - } - - /** - * Silently evaluates a constant expression into a PHP value. - * - * Thrown Errors, warnings or notices will be converted into a ConstExprEvaluationException. - * The original source of the exception is available through getPrevious(). - * - * If some part of the expression cannot be evaluated, the fallback evaluator passed to the - * constructor will be invoked. By default, if no fallback is provided, an exception of type - * ConstExprEvaluationException is thrown. - * - * See class doc comment for caveats and limitations. - * - * @param Expr $expr Constant expression to evaluate - * @return mixed Result of evaluation - * - * @throws ConstExprEvaluationException if the expression cannot be evaluated or an error occurred - */ - public function evaluateSilently(Expr $expr) { - set_error_handler(function($num, $str, $file, $line) { - throw new \ErrorException($str, 0, $num, $file, $line); - }); - - try { - return $this->evaluate($expr); - } catch (\Throwable $e) { - if (!$e instanceof ConstExprEvaluationException) { - $e = new ConstExprEvaluationException( - "An error occurred during constant expression evaluation", 0, $e); - } - throw $e; - } finally { - restore_error_handler(); - } - } - - /** - * Directly evaluates a constant expression into a PHP value. - * - * May generate Error exceptions, warnings or notices. Use evaluateSilently() to convert these - * into a ConstExprEvaluationException. - * - * If some part of the expression cannot be evaluated, the fallback evaluator passed to the - * constructor will be invoked. By default, if no fallback is provided, an exception of type - * ConstExprEvaluationException is thrown. - * - * See class doc comment for caveats and limitations. - * - * @param Expr $expr Constant expression to evaluate - * @return mixed Result of evaluation - * - * @throws ConstExprEvaluationException if the expression cannot be evaluated - */ - public function evaluateDirectly(Expr $expr) { - return $this->evaluate($expr); - } - - private function evaluate(Expr $expr) { - if ($expr instanceof Scalar\LNumber - || $expr instanceof Scalar\DNumber - || $expr instanceof Scalar\String_ - ) { - return $expr->value; - } - - if ($expr instanceof Expr\Array_) { - return $this->evaluateArray($expr); - } - - // Unary operators - if ($expr instanceof Expr\UnaryPlus) { - return +$this->evaluate($expr->expr); - } - if ($expr instanceof Expr\UnaryMinus) { - return -$this->evaluate($expr->expr); - } - if ($expr instanceof Expr\BooleanNot) { - return !$this->evaluate($expr->expr); - } - if ($expr instanceof Expr\BitwiseNot) { - return ~$this->evaluate($expr->expr); - } - - if ($expr instanceof Expr\BinaryOp) { - return $this->evaluateBinaryOp($expr); - } - - if ($expr instanceof Expr\Ternary) { - return $this->evaluateTernary($expr); - } - - if ($expr instanceof Expr\ArrayDimFetch && null !== $expr->dim) { - return $this->evaluate($expr->var)[$this->evaluate($expr->dim)]; - } - - if ($expr instanceof Expr\ConstFetch) { - return $this->evaluateConstFetch($expr); - } - - return ($this->fallbackEvaluator)($expr); - } - - private function evaluateArray(Expr\Array_ $expr) { - $array = []; - foreach ($expr->items as $item) { - if (null !== $item->key) { - $array[$this->evaluate($item->key)] = $this->evaluate($item->value); - } elseif ($item->unpack) { - $array = array_merge($array, $this->evaluate($item->value)); - } else { - $array[] = $this->evaluate($item->value); - } - } - return $array; - } - - private function evaluateTernary(Expr\Ternary $expr) { - if (null === $expr->if) { - return $this->evaluate($expr->cond) ?: $this->evaluate($expr->else); - } - - return $this->evaluate($expr->cond) - ? $this->evaluate($expr->if) - : $this->evaluate($expr->else); - } - - private function evaluateBinaryOp(Expr\BinaryOp $expr) { - if ($expr instanceof Expr\BinaryOp\Coalesce - && $expr->left instanceof Expr\ArrayDimFetch - ) { - // This needs to be special cased to respect BP_VAR_IS fetch semantics - return $this->evaluate($expr->left->var)[$this->evaluate($expr->left->dim)] - ?? $this->evaluate($expr->right); - } - - // The evaluate() calls are repeated in each branch, because some of the operators are - // short-circuiting and evaluating the RHS in advance may be illegal in that case - $l = $expr->left; - $r = $expr->right; - switch ($expr->getOperatorSigil()) { - case '&': return $this->evaluate($l) & $this->evaluate($r); - case '|': return $this->evaluate($l) | $this->evaluate($r); - case '^': return $this->evaluate($l) ^ $this->evaluate($r); - case '&&': return $this->evaluate($l) && $this->evaluate($r); - case '||': return $this->evaluate($l) || $this->evaluate($r); - case '??': return $this->evaluate($l) ?? $this->evaluate($r); - case '.': return $this->evaluate($l) . $this->evaluate($r); - case '/': return $this->evaluate($l) / $this->evaluate($r); - case '==': return $this->evaluate($l) == $this->evaluate($r); - case '>': return $this->evaluate($l) > $this->evaluate($r); - case '>=': return $this->evaluate($l) >= $this->evaluate($r); - case '===': return $this->evaluate($l) === $this->evaluate($r); - case 'and': return $this->evaluate($l) and $this->evaluate($r); - case 'or': return $this->evaluate($l) or $this->evaluate($r); - case 'xor': return $this->evaluate($l) xor $this->evaluate($r); - case '-': return $this->evaluate($l) - $this->evaluate($r); - case '%': return $this->evaluate($l) % $this->evaluate($r); - case '*': return $this->evaluate($l) * $this->evaluate($r); - case '!=': return $this->evaluate($l) != $this->evaluate($r); - case '!==': return $this->evaluate($l) !== $this->evaluate($r); - case '+': return $this->evaluate($l) + $this->evaluate($r); - case '**': return $this->evaluate($l) ** $this->evaluate($r); - case '<<': return $this->evaluate($l) << $this->evaluate($r); - case '>>': return $this->evaluate($l) >> $this->evaluate($r); - case '<': return $this->evaluate($l) < $this->evaluate($r); - case '<=': return $this->evaluate($l) <= $this->evaluate($r); - case '<=>': return $this->evaluate($l) <=> $this->evaluate($r); - } - - throw new \Exception('Should not happen'); - } - - private function evaluateConstFetch(Expr\ConstFetch $expr) { - $name = $expr->name->toLowerString(); - switch ($name) { - case 'null': return null; - case 'false': return false; - case 'true': return true; - } - - return ($this->fallbackEvaluator)($expr); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Error.php b/vendor/nikic/php-parser/lib/PhpParser/Error.php deleted file mode 100644 index d1fb959d..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Error.php +++ /dev/null @@ -1,180 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser; - -class Error extends \RuntimeException -{ - protected $rawMessage; - protected $attributes; - - /** - * Creates an Exception signifying a parse error. - * - * @param string $message Error message - * @param array|int $attributes Attributes of node/token where error occurred - * (or start line of error -- deprecated) - */ - public function __construct(string $message, $attributes = []) { - $this->rawMessage = $message; - if (is_array($attributes)) { - $this->attributes = $attributes; - } else { - $this->attributes = ['startLine' => $attributes]; - } - $this->updateMessage(); - } - - /** - * Gets the error message - * - * @return string Error message - */ - public function getRawMessage() : string { - return $this->rawMessage; - } - - /** - * Gets the line the error starts in. - * - * @return int Error start line - */ - public function getStartLine() : int { - return $this->attributes['startLine'] ?? -1; - } - - /** - * Gets the line the error ends in. - * - * @return int Error end line - */ - public function getEndLine() : int { - return $this->attributes['endLine'] ?? -1; - } - - /** - * Gets the attributes of the node/token the error occurred at. - * - * @return array - */ - public function getAttributes() : array { - return $this->attributes; - } - - /** - * Sets the attributes of the node/token the error occurred at. - * - * @param array $attributes - */ - public function setAttributes(array $attributes) { - $this->attributes = $attributes; - $this->updateMessage(); - } - - /** - * Sets the line of the PHP file the error occurred in. - * - * @param string $message Error message - */ - public function setRawMessage(string $message) { - $this->rawMessage = $message; - $this->updateMessage(); - } - - /** - * Sets the line the error starts in. - * - * @param int $line Error start line - */ - public function setStartLine(int $line) { - $this->attributes['startLine'] = $line; - $this->updateMessage(); - } - - /** - * Returns whether the error has start and end column information. - * - * For column information enable the startFilePos and endFilePos in the lexer options. - * - * @return bool - */ - public function hasColumnInfo() : bool { - return isset($this->attributes['startFilePos'], $this->attributes['endFilePos']); - } - - /** - * Gets the start column (1-based) into the line where the error started. - * - * @param string $code Source code of the file - * @return int - */ - public function getStartColumn(string $code) : int { - if (!$this->hasColumnInfo()) { - throw new \RuntimeException('Error does not have column information'); - } - - return $this->toColumn($code, $this->attributes['startFilePos']); - } - - /** - * Gets the end column (1-based) into the line where the error ended. - * - * @param string $code Source code of the file - * @return int - */ - public function getEndColumn(string $code) : int { - if (!$this->hasColumnInfo()) { - throw new \RuntimeException('Error does not have column information'); - } - - return $this->toColumn($code, $this->attributes['endFilePos']); - } - - /** - * Formats message including line and column information. - * - * @param string $code Source code associated with the error, for calculation of the columns - * - * @return string Formatted message - */ - public function getMessageWithColumnInfo(string $code) : string { - return sprintf( - '%s from %d:%d to %d:%d', $this->getRawMessage(), - $this->getStartLine(), $this->getStartColumn($code), - $this->getEndLine(), $this->getEndColumn($code) - ); - } - - /** - * Converts a file offset into a column. - * - * @param string $code Source code that $pos indexes into - * @param int $pos 0-based position in $code - * - * @return int 1-based column (relative to start of line) - */ - private function toColumn(string $code, int $pos) : int { - if ($pos > strlen($code)) { - throw new \RuntimeException('Invalid position information'); - } - - $lineStartPos = strrpos($code, "\n", $pos - strlen($code)); - if (false === $lineStartPos) { - $lineStartPos = -1; - } - - return $pos - $lineStartPos; - } - - /** - * Updates the exception message after a change to rawMessage or rawLine. - */ - protected function updateMessage() { - $this->message = $this->rawMessage; - - if (-1 === $this->getStartLine()) { - $this->message .= ' on unknown line'; - } else { - $this->message .= ' on line ' . $this->getStartLine(); - } - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler.php b/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler.php deleted file mode 100644 index d620e745..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser; - -interface ErrorHandler -{ - /** - * Handle an error generated during lexing, parsing or some other operation. - * - * @param Error $error The error that needs to be handled - */ - public function handleError(Error $error); -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Collecting.php b/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Collecting.php deleted file mode 100644 index 784b61b1..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Collecting.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\ErrorHandler; - -use PhpParser\Error; -use PhpParser\ErrorHandler; - -/** - * Error handler that collects all errors into an array. - * - * This allows graceful handling of errors. - */ -class Collecting implements ErrorHandler -{ - /** @var Error[] Collected errors */ - private $errors = []; - - public function handleError(Error $error) { - $this->errors[] = $error; - } - - /** - * Get collected errors. - * - * @return Error[] - */ - public function getErrors() : array { - return $this->errors; - } - - /** - * Check whether there are any errors. - * - * @return bool - */ - public function hasErrors() : bool { - return !empty($this->errors); - } - - /** - * Reset/clear collected errors. - */ - public function clearErrors() { - $this->errors = []; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Throwing.php b/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Throwing.php deleted file mode 100644 index aeee989b..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Throwing.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\ErrorHandler; - -use PhpParser\Error; -use PhpParser\ErrorHandler; - -/** - * Error handler that handles all errors by throwing them. - * - * This is the default strategy used by all components. - */ -class Throwing implements ErrorHandler -{ - public function handleError(Error $error) { - throw $error; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Internal/DiffElem.php b/vendor/nikic/php-parser/lib/PhpParser/Internal/DiffElem.php deleted file mode 100644 index a38b57ba..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Internal/DiffElem.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Internal; - -/** - * @internal - */ -class DiffElem -{ - const TYPE_KEEP = 0; - const TYPE_REMOVE = 1; - const TYPE_ADD = 2; - const TYPE_REPLACE = 3; - - /** @var int One of the TYPE_* constants */ - public $type; - /** @var mixed Is null for add operations */ - public $old; - /** @var mixed Is null for remove operations */ - public $new; - - public function __construct(int $type, $old, $new) { - $this->type = $type; - $this->old = $old; - $this->new = $new; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Internal/Differ.php b/vendor/nikic/php-parser/lib/PhpParser/Internal/Differ.php deleted file mode 100644 index 7f218c74..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Internal/Differ.php +++ /dev/null @@ -1,164 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Internal; - -/** - * Implements the Myers diff algorithm. - * - * Myers, Eugene W. "An O (ND) difference algorithm and its variations." - * Algorithmica 1.1 (1986): 251-266. - * - * @internal - */ -class Differ -{ - private $isEqual; - - /** - * Create differ over the given equality relation. - * - * @param callable $isEqual Equality relation with signature function($a, $b) : bool - */ - public function __construct(callable $isEqual) { - $this->isEqual = $isEqual; - } - - /** - * Calculate diff (edit script) from $old to $new. - * - * @param array $old Original array - * @param array $new New array - * - * @return DiffElem[] Diff (edit script) - */ - public function diff(array $old, array $new) { - list($trace, $x, $y) = $this->calculateTrace($old, $new); - return $this->extractDiff($trace, $x, $y, $old, $new); - } - - /** - * Calculate diff, including "replace" operations. - * - * If a sequence of remove operations is followed by the same number of add operations, these - * will be coalesced into replace operations. - * - * @param array $old Original array - * @param array $new New array - * - * @return DiffElem[] Diff (edit script), including replace operations - */ - public function diffWithReplacements(array $old, array $new) { - return $this->coalesceReplacements($this->diff($old, $new)); - } - - private function calculateTrace(array $a, array $b) { - $n = \count($a); - $m = \count($b); - $max = $n + $m; - $v = [1 => 0]; - $trace = []; - for ($d = 0; $d <= $max; $d++) { - $trace[] = $v; - for ($k = -$d; $k <= $d; $k += 2) { - if ($k === -$d || ($k !== $d && $v[$k-1] < $v[$k+1])) { - $x = $v[$k+1]; - } else { - $x = $v[$k-1] + 1; - } - - $y = $x - $k; - while ($x < $n && $y < $m && ($this->isEqual)($a[$x], $b[$y])) { - $x++; - $y++; - } - - $v[$k] = $x; - if ($x >= $n && $y >= $m) { - return [$trace, $x, $y]; - } - } - } - throw new \Exception('Should not happen'); - } - - private function extractDiff(array $trace, int $x, int $y, array $a, array $b) { - $result = []; - for ($d = \count($trace) - 1; $d >= 0; $d--) { - $v = $trace[$d]; - $k = $x - $y; - - if ($k === -$d || ($k !== $d && $v[$k-1] < $v[$k+1])) { - $prevK = $k + 1; - } else { - $prevK = $k - 1; - } - - $prevX = $v[$prevK]; - $prevY = $prevX - $prevK; - - while ($x > $prevX && $y > $prevY) { - $result[] = new DiffElem(DiffElem::TYPE_KEEP, $a[$x-1], $b[$y-1]); - $x--; - $y--; - } - - if ($d === 0) { - break; - } - - while ($x > $prevX) { - $result[] = new DiffElem(DiffElem::TYPE_REMOVE, $a[$x-1], null); - $x--; - } - - while ($y > $prevY) { - $result[] = new DiffElem(DiffElem::TYPE_ADD, null, $b[$y-1]); - $y--; - } - } - return array_reverse($result); - } - - /** - * Coalesce equal-length sequences of remove+add into a replace operation. - * - * @param DiffElem[] $diff - * @return DiffElem[] - */ - private function coalesceReplacements(array $diff) { - $newDiff = []; - $c = \count($diff); - for ($i = 0; $i < $c; $i++) { - $diffType = $diff[$i]->type; - if ($diffType !== DiffElem::TYPE_REMOVE) { - $newDiff[] = $diff[$i]; - continue; - } - - $j = $i; - while ($j < $c && $diff[$j]->type === DiffElem::TYPE_REMOVE) { - $j++; - } - - $k = $j; - while ($k < $c && $diff[$k]->type === DiffElem::TYPE_ADD) { - $k++; - } - - if ($j - $i === $k - $j) { - $len = $j - $i; - for ($n = 0; $n < $len; $n++) { - $newDiff[] = new DiffElem( - DiffElem::TYPE_REPLACE, $diff[$i + $n]->old, $diff[$j + $n]->new - ); - } - } else { - for (; $i < $k; $i++) { - $newDiff[] = $diff[$i]; - } - } - $i = $k - 1; - } - return $newDiff; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php b/vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php deleted file mode 100644 index 3eeac04a..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php +++ /dev/null @@ -1,61 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Internal; - -use PhpParser\Node; -use PhpParser\Node\Expr; - -/** - * This node is used internally by the format-preserving pretty printer to print anonymous classes. - * - * The normal anonymous class structure violates assumptions about the order of token offsets. - * Namely, the constructor arguments are part of the Expr\New_ node and follow the class node, even - * though they are actually interleaved with them. This special node type is used temporarily to - * restore a sane token offset order. - * - * @internal - */ -class PrintableNewAnonClassNode extends Expr -{ - /** @var Node\AttributeGroup[] PHP attribute groups */ - public $attrGroups; - /** @var Node\Arg[] Arguments */ - public $args; - /** @var null|Node\Name Name of extended class */ - public $extends; - /** @var Node\Name[] Names of implemented interfaces */ - public $implements; - /** @var Node\Stmt[] Statements */ - public $stmts; - - public function __construct( - array $attrGroups, array $args, Node\Name $extends = null, array $implements, - array $stmts, array $attributes - ) { - parent::__construct($attributes); - $this->attrGroups = $attrGroups; - $this->args = $args; - $this->extends = $extends; - $this->implements = $implements; - $this->stmts = $stmts; - } - - public static function fromNewNode(Expr\New_ $newNode) { - $class = $newNode->class; - assert($class instanceof Node\Stmt\Class_); - // We don't assert that $class->name is null here, to allow consumers to assign unique names - // to anonymous classes for their own purposes. We simplify ignore the name here. - return new self( - $class->attrGroups, $newNode->args, $class->extends, $class->implements, - $class->stmts, $newNode->getAttributes() - ); - } - - public function getType() : string { - return 'Expr_PrintableNewAnonClass'; - } - - public function getSubNodeNames() : array { - return ['attrGroups', 'args', 'extends', 'implements', 'stmts']; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Internal/TokenStream.php b/vendor/nikic/php-parser/lib/PhpParser/Internal/TokenStream.php deleted file mode 100644 index 7e0a5de0..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Internal/TokenStream.php +++ /dev/null @@ -1,286 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Internal; - -/** - * Provides operations on token streams, for use by pretty printer. - * - * @internal - */ -class TokenStream -{ - /** @var array Tokens (in token_get_all format) */ - private $tokens; - /** @var int[] Map from position to indentation */ - private $indentMap; - - /** - * Create token stream instance. - * - * @param array $tokens Tokens in token_get_all() format - */ - public function __construct(array $tokens) { - $this->tokens = $tokens; - $this->indentMap = $this->calcIndentMap(); - } - - /** - * Whether the given position is immediately surrounded by parenthesis. - * - * @param int $startPos Start position - * @param int $endPos End position - * - * @return bool - */ - public function haveParens(int $startPos, int $endPos) : bool { - return $this->haveTokenImmediatelyBefore($startPos, '(') - && $this->haveTokenImmediatelyAfter($endPos, ')'); - } - - /** - * Whether the given position is immediately surrounded by braces. - * - * @param int $startPos Start position - * @param int $endPos End position - * - * @return bool - */ - public function haveBraces(int $startPos, int $endPos) : bool { - return ($this->haveTokenImmediatelyBefore($startPos, '{') - || $this->haveTokenImmediatelyBefore($startPos, T_CURLY_OPEN)) - && $this->haveTokenImmediatelyAfter($endPos, '}'); - } - - /** - * Check whether the position is directly preceded by a certain token type. - * - * During this check whitespace and comments are skipped. - * - * @param int $pos Position before which the token should occur - * @param int|string $expectedTokenType Token to check for - * - * @return bool Whether the expected token was found - */ - public function haveTokenImmediatelyBefore(int $pos, $expectedTokenType) : bool { - $tokens = $this->tokens; - $pos--; - for (; $pos >= 0; $pos--) { - $tokenType = $tokens[$pos][0]; - if ($tokenType === $expectedTokenType) { - return true; - } - if ($tokenType !== \T_WHITESPACE - && $tokenType !== \T_COMMENT && $tokenType !== \T_DOC_COMMENT) { - break; - } - } - return false; - } - - /** - * Check whether the position is directly followed by a certain token type. - * - * During this check whitespace and comments are skipped. - * - * @param int $pos Position after which the token should occur - * @param int|string $expectedTokenType Token to check for - * - * @return bool Whether the expected token was found - */ - public function haveTokenImmediatelyAfter(int $pos, $expectedTokenType) : bool { - $tokens = $this->tokens; - $pos++; - for (; $pos < \count($tokens); $pos++) { - $tokenType = $tokens[$pos][0]; - if ($tokenType === $expectedTokenType) { - return true; - } - if ($tokenType !== \T_WHITESPACE - && $tokenType !== \T_COMMENT && $tokenType !== \T_DOC_COMMENT) { - break; - } - } - return false; - } - - public function skipLeft(int $pos, $skipTokenType) { - $tokens = $this->tokens; - - $pos = $this->skipLeftWhitespace($pos); - if ($skipTokenType === \T_WHITESPACE) { - return $pos; - } - - if ($tokens[$pos][0] !== $skipTokenType) { - // Shouldn't happen. The skip token MUST be there - throw new \Exception('Encountered unexpected token'); - } - $pos--; - - return $this->skipLeftWhitespace($pos); - } - - public function skipRight(int $pos, $skipTokenType) { - $tokens = $this->tokens; - - $pos = $this->skipRightWhitespace($pos); - if ($skipTokenType === \T_WHITESPACE) { - return $pos; - } - - if ($tokens[$pos][0] !== $skipTokenType) { - // Shouldn't happen. The skip token MUST be there - throw new \Exception('Encountered unexpected token'); - } - $pos++; - - return $this->skipRightWhitespace($pos); - } - - /** - * Return first non-whitespace token position smaller or equal to passed position. - * - * @param int $pos Token position - * @return int Non-whitespace token position - */ - public function skipLeftWhitespace(int $pos) { - $tokens = $this->tokens; - for (; $pos >= 0; $pos--) { - $type = $tokens[$pos][0]; - if ($type !== \T_WHITESPACE && $type !== \T_COMMENT && $type !== \T_DOC_COMMENT) { - break; - } - } - return $pos; - } - - /** - * Return first non-whitespace position greater or equal to passed position. - * - * @param int $pos Token position - * @return int Non-whitespace token position - */ - public function skipRightWhitespace(int $pos) { - $tokens = $this->tokens; - for ($count = \count($tokens); $pos < $count; $pos++) { - $type = $tokens[$pos][0]; - if ($type !== \T_WHITESPACE && $type !== \T_COMMENT && $type !== \T_DOC_COMMENT) { - break; - } - } - return $pos; - } - - public function findRight(int $pos, $findTokenType) { - $tokens = $this->tokens; - for ($count = \count($tokens); $pos < $count; $pos++) { - $type = $tokens[$pos][0]; - if ($type === $findTokenType) { - return $pos; - } - } - return -1; - } - - /** - * Whether the given position range contains a certain token type. - * - * @param int $startPos Starting position (inclusive) - * @param int $endPos Ending position (exclusive) - * @param int|string $tokenType Token type to look for - * @return bool Whether the token occurs in the given range - */ - public function haveTokenInRange(int $startPos, int $endPos, $tokenType) { - $tokens = $this->tokens; - for ($pos = $startPos; $pos < $endPos; $pos++) { - if ($tokens[$pos][0] === $tokenType) { - return true; - } - } - return false; - } - - public function haveBracesInRange(int $startPos, int $endPos) { - return $this->haveTokenInRange($startPos, $endPos, '{') - || $this->haveTokenInRange($startPos, $endPos, T_CURLY_OPEN) - || $this->haveTokenInRange($startPos, $endPos, '}'); - } - - public function haveTagInRange(int $startPos, int $endPos): bool { - return $this->haveTokenInRange($startPos, $endPos, \T_OPEN_TAG) - || $this->haveTokenInRange($startPos, $endPos, \T_CLOSE_TAG); - } - - /** - * Get indentation before token position. - * - * @param int $pos Token position - * - * @return int Indentation depth (in spaces) - */ - public function getIndentationBefore(int $pos) : int { - return $this->indentMap[$pos]; - } - - /** - * Get the code corresponding to a token offset range, optionally adjusted for indentation. - * - * @param int $from Token start position (inclusive) - * @param int $to Token end position (exclusive) - * @param int $indent By how much the code should be indented (can be negative as well) - * - * @return string Code corresponding to token range, adjusted for indentation - */ - public function getTokenCode(int $from, int $to, int $indent) : string { - $tokens = $this->tokens; - $result = ''; - for ($pos = $from; $pos < $to; $pos++) { - $token = $tokens[$pos]; - if (\is_array($token)) { - $type = $token[0]; - $content = $token[1]; - if ($type === \T_CONSTANT_ENCAPSED_STRING || $type === \T_ENCAPSED_AND_WHITESPACE) { - $result .= $content; - } else { - // TODO Handle non-space indentation - if ($indent < 0) { - $result .= str_replace("\n" . str_repeat(" ", -$indent), "\n", $content); - } elseif ($indent > 0) { - $result .= str_replace("\n", "\n" . str_repeat(" ", $indent), $content); - } else { - $result .= $content; - } - } - } else { - $result .= $token; - } - } - return $result; - } - - /** - * Precalculate the indentation at every token position. - * - * @return int[] Token position to indentation map - */ - private function calcIndentMap() { - $indentMap = []; - $indent = 0; - foreach ($this->tokens as $token) { - $indentMap[] = $indent; - - if ($token[0] === \T_WHITESPACE) { - $content = $token[1]; - $newlinePos = \strrpos($content, "\n"); - if (false !== $newlinePos) { - $indent = \strlen($content) - $newlinePos - 1; - } - } - } - - // Add a sentinel for one past end of the file - $indentMap[] = $indent; - - return $indentMap; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/JsonDecoder.php b/vendor/nikic/php-parser/lib/PhpParser/JsonDecoder.php deleted file mode 100644 index 47d2003d..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/JsonDecoder.php +++ /dev/null @@ -1,103 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser; - -class JsonDecoder -{ - /** @var \ReflectionClass[] Node type to reflection class map */ - private $reflectionClassCache; - - public function decode(string $json) { - $value = json_decode($json, true); - if (json_last_error()) { - throw new \RuntimeException('JSON decoding error: ' . json_last_error_msg()); - } - - return $this->decodeRecursive($value); - } - - private function decodeRecursive($value) { - if (\is_array($value)) { - if (isset($value['nodeType'])) { - if ($value['nodeType'] === 'Comment' || $value['nodeType'] === 'Comment_Doc') { - return $this->decodeComment($value); - } - return $this->decodeNode($value); - } - return $this->decodeArray($value); - } - return $value; - } - - private function decodeArray(array $array) : array { - $decodedArray = []; - foreach ($array as $key => $value) { - $decodedArray[$key] = $this->decodeRecursive($value); - } - return $decodedArray; - } - - private function decodeNode(array $value) : Node { - $nodeType = $value['nodeType']; - if (!\is_string($nodeType)) { - throw new \RuntimeException('Node type must be a string'); - } - - $reflectionClass = $this->reflectionClassFromNodeType($nodeType); - /** @var Node $node */ - $node = $reflectionClass->newInstanceWithoutConstructor(); - - if (isset($value['attributes'])) { - if (!\is_array($value['attributes'])) { - throw new \RuntimeException('Attributes must be an array'); - } - - $node->setAttributes($this->decodeArray($value['attributes'])); - } - - foreach ($value as $name => $subNode) { - if ($name === 'nodeType' || $name === 'attributes') { - continue; - } - - $node->$name = $this->decodeRecursive($subNode); - } - - return $node; - } - - private function decodeComment(array $value) : Comment { - $className = $value['nodeType'] === 'Comment' ? Comment::class : Comment\Doc::class; - if (!isset($value['text'])) { - throw new \RuntimeException('Comment must have text'); - } - - return new $className( - $value['text'], - $value['line'] ?? -1, $value['filePos'] ?? -1, $value['tokenPos'] ?? -1, - $value['endLine'] ?? -1, $value['endFilePos'] ?? -1, $value['endTokenPos'] ?? -1 - ); - } - - private function reflectionClassFromNodeType(string $nodeType) : \ReflectionClass { - if (!isset($this->reflectionClassCache[$nodeType])) { - $className = $this->classNameFromNodeType($nodeType); - $this->reflectionClassCache[$nodeType] = new \ReflectionClass($className); - } - return $this->reflectionClassCache[$nodeType]; - } - - private function classNameFromNodeType(string $nodeType) : string { - $className = 'PhpParser\\Node\\' . strtr($nodeType, '_', '\\'); - if (class_exists($className)) { - return $className; - } - - $className .= '_'; - if (class_exists($className)) { - return $className; - } - - throw new \RuntimeException("Unknown node type \"$nodeType\""); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer.php deleted file mode 100644 index e15dd0a5..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer.php +++ /dev/null @@ -1,560 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser; - -use PhpParser\Parser\Tokens; - -class Lexer -{ - protected $code; - protected $tokens; - protected $pos; - protected $line; - protected $filePos; - protected $prevCloseTagHasNewline; - - protected $tokenMap; - protected $dropTokens; - protected $identifierTokens; - - private $attributeStartLineUsed; - private $attributeEndLineUsed; - private $attributeStartTokenPosUsed; - private $attributeEndTokenPosUsed; - private $attributeStartFilePosUsed; - private $attributeEndFilePosUsed; - private $attributeCommentsUsed; - - /** - * Creates a Lexer. - * - * @param array $options Options array. Currently only the 'usedAttributes' option is supported, - * which is an array of attributes to add to the AST nodes. Possible - * attributes are: 'comments', 'startLine', 'endLine', 'startTokenPos', - * 'endTokenPos', 'startFilePos', 'endFilePos'. The option defaults to the - * first three. For more info see getNextToken() docs. - */ - public function __construct(array $options = []) { - // Create Map from internal tokens to PhpParser tokens. - $this->defineCompatibilityTokens(); - $this->tokenMap = $this->createTokenMap(); - $this->identifierTokens = $this->createIdentifierTokenMap(); - - // map of tokens to drop while lexing (the map is only used for isset lookup, - // that's why the value is simply set to 1; the value is never actually used.) - $this->dropTokens = array_fill_keys( - [\T_WHITESPACE, \T_OPEN_TAG, \T_COMMENT, \T_DOC_COMMENT, \T_BAD_CHARACTER], 1 - ); - - $defaultAttributes = ['comments', 'startLine', 'endLine']; - $usedAttributes = array_fill_keys($options['usedAttributes'] ?? $defaultAttributes, true); - - // Create individual boolean properties to make these checks faster. - $this->attributeStartLineUsed = isset($usedAttributes['startLine']); - $this->attributeEndLineUsed = isset($usedAttributes['endLine']); - $this->attributeStartTokenPosUsed = isset($usedAttributes['startTokenPos']); - $this->attributeEndTokenPosUsed = isset($usedAttributes['endTokenPos']); - $this->attributeStartFilePosUsed = isset($usedAttributes['startFilePos']); - $this->attributeEndFilePosUsed = isset($usedAttributes['endFilePos']); - $this->attributeCommentsUsed = isset($usedAttributes['comments']); - } - - /** - * Initializes the lexer for lexing the provided source code. - * - * This function does not throw if lexing errors occur. Instead, errors may be retrieved using - * the getErrors() method. - * - * @param string $code The source code to lex - * @param ErrorHandler|null $errorHandler Error handler to use for lexing errors. Defaults to - * ErrorHandler\Throwing - */ - public function startLexing(string $code, ErrorHandler $errorHandler = null) { - if (null === $errorHandler) { - $errorHandler = new ErrorHandler\Throwing(); - } - - $this->code = $code; // keep the code around for __halt_compiler() handling - $this->pos = -1; - $this->line = 1; - $this->filePos = 0; - - // If inline HTML occurs without preceding code, treat it as if it had a leading newline. - // This ensures proper composability, because having a newline is the "safe" assumption. - $this->prevCloseTagHasNewline = true; - - $scream = ini_set('xdebug.scream', '0'); - - $this->tokens = @token_get_all($code); - $this->postprocessTokens($errorHandler); - - if (false !== $scream) { - ini_set('xdebug.scream', $scream); - } - } - - private function handleInvalidCharacterRange($start, $end, $line, ErrorHandler $errorHandler) { - $tokens = []; - for ($i = $start; $i < $end; $i++) { - $chr = $this->code[$i]; - if ($chr === "\0") { - // PHP cuts error message after null byte, so need special case - $errorMsg = 'Unexpected null byte'; - } else { - $errorMsg = sprintf( - 'Unexpected character "%s" (ASCII %d)', $chr, ord($chr) - ); - } - - $tokens[] = [\T_BAD_CHARACTER, $chr, $line]; - $errorHandler->handleError(new Error($errorMsg, [ - 'startLine' => $line, - 'endLine' => $line, - 'startFilePos' => $i, - 'endFilePos' => $i, - ])); - } - return $tokens; - } - - /** - * Check whether comment token is unterminated. - * - * @return bool - */ - private function isUnterminatedComment($token) : bool { - return ($token[0] === \T_COMMENT || $token[0] === \T_DOC_COMMENT) - && substr($token[1], 0, 2) === '/*' - && substr($token[1], -2) !== '*/'; - } - - protected function postprocessTokens(ErrorHandler $errorHandler) { - // PHP's error handling for token_get_all() is rather bad, so if we want detailed - // error information we need to compute it ourselves. Invalid character errors are - // detected by finding "gaps" in the token array. Unterminated comments are detected - // by checking if a trailing comment has a "*/" at the end. - // - // Additionally, we perform a number of canonicalizations here: - // * Use the PHP 8.0 comment format, which does not include trailing whitespace anymore. - // * Use PHP 8.0 T_NAME_* tokens. - // * Use PHP 8.1 T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG and - // T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG tokens used to disambiguate intersection types. - - $filePos = 0; - $line = 1; - $numTokens = \count($this->tokens); - for ($i = 0; $i < $numTokens; $i++) { - $token = $this->tokens[$i]; - - // Since PHP 7.4 invalid characters are represented by a T_BAD_CHARACTER token. - // In this case we only need to emit an error. - if ($token[0] === \T_BAD_CHARACTER) { - $this->handleInvalidCharacterRange($filePos, $filePos + 1, $line, $errorHandler); - } - - if ($token[0] === \T_COMMENT && substr($token[1], 0, 2) !== '/*' - && preg_match('/(\r\n|\n|\r)$/D', $token[1], $matches)) { - $trailingNewline = $matches[0]; - $token[1] = substr($token[1], 0, -strlen($trailingNewline)); - $this->tokens[$i] = $token; - if (isset($this->tokens[$i + 1]) && $this->tokens[$i + 1][0] === \T_WHITESPACE) { - // Move trailing newline into following T_WHITESPACE token, if it already exists. - $this->tokens[$i + 1][1] = $trailingNewline . $this->tokens[$i + 1][1]; - $this->tokens[$i + 1][2]--; - } else { - // Otherwise, we need to create a new T_WHITESPACE token. - array_splice($this->tokens, $i + 1, 0, [ - [\T_WHITESPACE, $trailingNewline, $line], - ]); - $numTokens++; - } - } - - // Emulate PHP 8 T_NAME_* tokens, by combining sequences of T_NS_SEPARATOR and T_STRING - // into a single token. - if (\is_array($token) - && ($token[0] === \T_NS_SEPARATOR || isset($this->identifierTokens[$token[0]]))) { - $lastWasSeparator = $token[0] === \T_NS_SEPARATOR; - $text = $token[1]; - for ($j = $i + 1; isset($this->tokens[$j]); $j++) { - if ($lastWasSeparator) { - if (!isset($this->identifierTokens[$this->tokens[$j][0]])) { - break; - } - $lastWasSeparator = false; - } else { - if ($this->tokens[$j][0] !== \T_NS_SEPARATOR) { - break; - } - $lastWasSeparator = true; - } - $text .= $this->tokens[$j][1]; - } - if ($lastWasSeparator) { - // Trailing separator is not part of the name. - $j--; - $text = substr($text, 0, -1); - } - if ($j > $i + 1) { - if ($token[0] === \T_NS_SEPARATOR) { - $type = \T_NAME_FULLY_QUALIFIED; - } else if ($token[0] === \T_NAMESPACE) { - $type = \T_NAME_RELATIVE; - } else { - $type = \T_NAME_QUALIFIED; - } - $token = [$type, $text, $line]; - array_splice($this->tokens, $i, $j - $i, [$token]); - $numTokens -= $j - $i - 1; - } - } - - if ($token === '&') { - $next = $i + 1; - while (isset($this->tokens[$next]) && $this->tokens[$next][0] === \T_WHITESPACE) { - $next++; - } - $followedByVarOrVarArg = isset($this->tokens[$next]) && - ($this->tokens[$next][0] === \T_VARIABLE || $this->tokens[$next][0] === \T_ELLIPSIS); - $this->tokens[$i] = $token = [ - $followedByVarOrVarArg - ? \T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG - : \T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG, - '&', - $line, - ]; - } - - $tokenValue = \is_string($token) ? $token : $token[1]; - $tokenLen = \strlen($tokenValue); - - if (substr($this->code, $filePos, $tokenLen) !== $tokenValue) { - // Something is missing, must be an invalid character - $nextFilePos = strpos($this->code, $tokenValue, $filePos); - $badCharTokens = $this->handleInvalidCharacterRange( - $filePos, $nextFilePos, $line, $errorHandler); - $filePos = (int) $nextFilePos; - - array_splice($this->tokens, $i, 0, $badCharTokens); - $numTokens += \count($badCharTokens); - $i += \count($badCharTokens); - } - - $filePos += $tokenLen; - $line += substr_count($tokenValue, "\n"); - } - - if ($filePos !== \strlen($this->code)) { - if (substr($this->code, $filePos, 2) === '/*') { - // Unlike PHP, HHVM will drop unterminated comments entirely - $comment = substr($this->code, $filePos); - $errorHandler->handleError(new Error('Unterminated comment', [ - 'startLine' => $line, - 'endLine' => $line + substr_count($comment, "\n"), - 'startFilePos' => $filePos, - 'endFilePos' => $filePos + \strlen($comment), - ])); - - // Emulate the PHP behavior - $isDocComment = isset($comment[3]) && $comment[3] === '*'; - $this->tokens[] = [$isDocComment ? \T_DOC_COMMENT : \T_COMMENT, $comment, $line]; - } else { - // Invalid characters at the end of the input - $badCharTokens = $this->handleInvalidCharacterRange( - $filePos, \strlen($this->code), $line, $errorHandler); - $this->tokens = array_merge($this->tokens, $badCharTokens); - } - return; - } - - if (count($this->tokens) > 0) { - // Check for unterminated comment - $lastToken = $this->tokens[count($this->tokens) - 1]; - if ($this->isUnterminatedComment($lastToken)) { - $errorHandler->handleError(new Error('Unterminated comment', [ - 'startLine' => $line - substr_count($lastToken[1], "\n"), - 'endLine' => $line, - 'startFilePos' => $filePos - \strlen($lastToken[1]), - 'endFilePos' => $filePos, - ])); - } - } - } - - /** - * Fetches the next token. - * - * The available attributes are determined by the 'usedAttributes' option, which can - * be specified in the constructor. The following attributes are supported: - * - * * 'comments' => Array of PhpParser\Comment or PhpParser\Comment\Doc instances, - * representing all comments that occurred between the previous - * non-discarded token and the current one. - * * 'startLine' => Line in which the node starts. - * * 'endLine' => Line in which the node ends. - * * 'startTokenPos' => Offset into the token array of the first token in the node. - * * 'endTokenPos' => Offset into the token array of the last token in the node. - * * 'startFilePos' => Offset into the code string of the first character that is part of the node. - * * 'endFilePos' => Offset into the code string of the last character that is part of the node. - * - * @param mixed $value Variable to store token content in - * @param mixed $startAttributes Variable to store start attributes in - * @param mixed $endAttributes Variable to store end attributes in - * - * @return int Token id - */ - public function getNextToken(&$value = null, &$startAttributes = null, &$endAttributes = null) : int { - $startAttributes = []; - $endAttributes = []; - - while (1) { - if (isset($this->tokens[++$this->pos])) { - $token = $this->tokens[$this->pos]; - } else { - // EOF token with ID 0 - $token = "\0"; - } - - if ($this->attributeStartLineUsed) { - $startAttributes['startLine'] = $this->line; - } - if ($this->attributeStartTokenPosUsed) { - $startAttributes['startTokenPos'] = $this->pos; - } - if ($this->attributeStartFilePosUsed) { - $startAttributes['startFilePos'] = $this->filePos; - } - - if (\is_string($token)) { - $value = $token; - if (isset($token[1])) { - // bug in token_get_all - $this->filePos += 2; - $id = ord('"'); - } else { - $this->filePos += 1; - $id = ord($token); - } - } elseif (!isset($this->dropTokens[$token[0]])) { - $value = $token[1]; - $id = $this->tokenMap[$token[0]]; - if (\T_CLOSE_TAG === $token[0]) { - $this->prevCloseTagHasNewline = false !== strpos($token[1], "\n") - || false !== strpos($token[1], "\r"); - } elseif (\T_INLINE_HTML === $token[0]) { - $startAttributes['hasLeadingNewline'] = $this->prevCloseTagHasNewline; - } - - $this->line += substr_count($value, "\n"); - $this->filePos += \strlen($value); - } else { - $origLine = $this->line; - $origFilePos = $this->filePos; - $this->line += substr_count($token[1], "\n"); - $this->filePos += \strlen($token[1]); - - if (\T_COMMENT === $token[0] || \T_DOC_COMMENT === $token[0]) { - if ($this->attributeCommentsUsed) { - $comment = \T_DOC_COMMENT === $token[0] - ? new Comment\Doc($token[1], - $origLine, $origFilePos, $this->pos, - $this->line, $this->filePos - 1, $this->pos) - : new Comment($token[1], - $origLine, $origFilePos, $this->pos, - $this->line, $this->filePos - 1, $this->pos); - $startAttributes['comments'][] = $comment; - } - } - continue; - } - - if ($this->attributeEndLineUsed) { - $endAttributes['endLine'] = $this->line; - } - if ($this->attributeEndTokenPosUsed) { - $endAttributes['endTokenPos'] = $this->pos; - } - if ($this->attributeEndFilePosUsed) { - $endAttributes['endFilePos'] = $this->filePos - 1; - } - - return $id; - } - - throw new \RuntimeException('Reached end of lexer loop'); - } - - /** - * Returns the token array for current code. - * - * The token array is in the same format as provided by the - * token_get_all() function and does not discard tokens (i.e. - * whitespace and comments are included). The token position - * attributes are against this token array. - * - * @return array Array of tokens in token_get_all() format - */ - public function getTokens() : array { - return $this->tokens; - } - - /** - * Handles __halt_compiler() by returning the text after it. - * - * @return string Remaining text - */ - public function handleHaltCompiler() : string { - // text after T_HALT_COMPILER, still including (); - $textAfter = substr($this->code, $this->filePos); - - // ensure that it is followed by (); - // this simplifies the situation, by not allowing any comments - // in between of the tokens. - if (!preg_match('~^\s*\(\s*\)\s*(?:;|\?>\r?\n?)~', $textAfter, $matches)) { - throw new Error('__HALT_COMPILER must be followed by "();"'); - } - - // prevent the lexer from returning any further tokens - $this->pos = count($this->tokens); - - // return with (); removed - return substr($textAfter, strlen($matches[0])); - } - - private function defineCompatibilityTokens() { - static $compatTokensDefined = false; - if ($compatTokensDefined) { - return; - } - - $compatTokens = [ - // PHP 7.4 - 'T_BAD_CHARACTER', - 'T_FN', - 'T_COALESCE_EQUAL', - // PHP 8.0 - 'T_NAME_QUALIFIED', - 'T_NAME_FULLY_QUALIFIED', - 'T_NAME_RELATIVE', - 'T_MATCH', - 'T_NULLSAFE_OBJECT_OPERATOR', - 'T_ATTRIBUTE', - // PHP 8.1 - 'T_ENUM', - 'T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG', - 'T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG', - 'T_READONLY', - ]; - - // PHP-Parser might be used together with another library that also emulates some or all - // of these tokens. Perform a sanity-check that all already defined tokens have been - // assigned a unique ID. - $usedTokenIds = []; - foreach ($compatTokens as $token) { - if (\defined($token)) { - $tokenId = \constant($token); - $clashingToken = $usedTokenIds[$tokenId] ?? null; - if ($clashingToken !== null) { - throw new \Error(sprintf( - 'Token %s has same ID as token %s, ' . - 'you may be using a library with broken token emulation', - $token, $clashingToken - )); - } - $usedTokenIds[$tokenId] = $token; - } - } - - // Now define any tokens that have not yet been emulated. Try to assign IDs from -1 - // downwards, but skip any IDs that may already be in use. - $newTokenId = -1; - foreach ($compatTokens as $token) { - if (!\defined($token)) { - while (isset($usedTokenIds[$newTokenId])) { - $newTokenId--; - } - \define($token, $newTokenId); - $newTokenId--; - } - } - - $compatTokensDefined = true; - } - - /** - * Creates the token map. - * - * The token map maps the PHP internal token identifiers - * to the identifiers used by the Parser. Additionally it - * maps T_OPEN_TAG_WITH_ECHO to T_ECHO and T_CLOSE_TAG to ';'. - * - * @return array The token map - */ - protected function createTokenMap() : array { - $tokenMap = []; - - // 256 is the minimum possible token number, as everything below - // it is an ASCII value - for ($i = 256; $i < 1000; ++$i) { - if (\T_DOUBLE_COLON === $i) { - // T_DOUBLE_COLON is equivalent to T_PAAMAYIM_NEKUDOTAYIM - $tokenMap[$i] = Tokens::T_PAAMAYIM_NEKUDOTAYIM; - } elseif(\T_OPEN_TAG_WITH_ECHO === $i) { - // T_OPEN_TAG_WITH_ECHO with dropped T_OPEN_TAG results in T_ECHO - $tokenMap[$i] = Tokens::T_ECHO; - } elseif(\T_CLOSE_TAG === $i) { - // T_CLOSE_TAG is equivalent to ';' - $tokenMap[$i] = ord(';'); - } elseif ('UNKNOWN' !== $name = token_name($i)) { - if ('T_HASHBANG' === $name) { - // HHVM uses a special token for #! hashbang lines - $tokenMap[$i] = Tokens::T_INLINE_HTML; - } elseif (defined($name = Tokens::class . '::' . $name)) { - // Other tokens can be mapped directly - $tokenMap[$i] = constant($name); - } - } - } - - // HHVM uses a special token for numbers that overflow to double - if (defined('T_ONUMBER')) { - $tokenMap[\T_ONUMBER] = Tokens::T_DNUMBER; - } - // HHVM also has a separate token for the __COMPILER_HALT_OFFSET__ constant - if (defined('T_COMPILER_HALT_OFFSET')) { - $tokenMap[\T_COMPILER_HALT_OFFSET] = Tokens::T_STRING; - } - - // Assign tokens for which we define compatibility constants, as token_name() does not know them. - $tokenMap[\T_FN] = Tokens::T_FN; - $tokenMap[\T_COALESCE_EQUAL] = Tokens::T_COALESCE_EQUAL; - $tokenMap[\T_NAME_QUALIFIED] = Tokens::T_NAME_QUALIFIED; - $tokenMap[\T_NAME_FULLY_QUALIFIED] = Tokens::T_NAME_FULLY_QUALIFIED; - $tokenMap[\T_NAME_RELATIVE] = Tokens::T_NAME_RELATIVE; - $tokenMap[\T_MATCH] = Tokens::T_MATCH; - $tokenMap[\T_NULLSAFE_OBJECT_OPERATOR] = Tokens::T_NULLSAFE_OBJECT_OPERATOR; - $tokenMap[\T_ATTRIBUTE] = Tokens::T_ATTRIBUTE; - $tokenMap[\T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG] = Tokens::T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG; - $tokenMap[\T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG] = Tokens::T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG; - $tokenMap[\T_ENUM] = Tokens::T_ENUM; - $tokenMap[\T_READONLY] = Tokens::T_READONLY; - - return $tokenMap; - } - - private function createIdentifierTokenMap(): array { - // Based on semi_reserved production. - return array_fill_keys([ - \T_STRING, - \T_STATIC, \T_ABSTRACT, \T_FINAL, \T_PRIVATE, \T_PROTECTED, \T_PUBLIC, \T_READONLY, - \T_INCLUDE, \T_INCLUDE_ONCE, \T_EVAL, \T_REQUIRE, \T_REQUIRE_ONCE, \T_LOGICAL_OR, \T_LOGICAL_XOR, \T_LOGICAL_AND, - \T_INSTANCEOF, \T_NEW, \T_CLONE, \T_EXIT, \T_IF, \T_ELSEIF, \T_ELSE, \T_ENDIF, \T_ECHO, \T_DO, \T_WHILE, - \T_ENDWHILE, \T_FOR, \T_ENDFOR, \T_FOREACH, \T_ENDFOREACH, \T_DECLARE, \T_ENDDECLARE, \T_AS, \T_TRY, \T_CATCH, - \T_FINALLY, \T_THROW, \T_USE, \T_INSTEADOF, \T_GLOBAL, \T_VAR, \T_UNSET, \T_ISSET, \T_EMPTY, \T_CONTINUE, \T_GOTO, - \T_FUNCTION, \T_CONST, \T_RETURN, \T_PRINT, \T_YIELD, \T_LIST, \T_SWITCH, \T_ENDSWITCH, \T_CASE, \T_DEFAULT, - \T_BREAK, \T_ARRAY, \T_CALLABLE, \T_EXTENDS, \T_IMPLEMENTS, \T_NAMESPACE, \T_TRAIT, \T_INTERFACE, \T_CLASS, - \T_CLASS_C, \T_TRAIT_C, \T_FUNC_C, \T_METHOD_C, \T_LINE, \T_FILE, \T_DIR, \T_NS_C, \T_HALT_COMPILER, \T_FN, - \T_MATCH, - ], true); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php deleted file mode 100644 index 5c56e026..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php +++ /dev/null @@ -1,248 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Lexer; - -use PhpParser\Error; -use PhpParser\ErrorHandler; -use PhpParser\Lexer; -use PhpParser\Lexer\TokenEmulator\AttributeEmulator; -use PhpParser\Lexer\TokenEmulator\EnumTokenEmulator; -use PhpParser\Lexer\TokenEmulator\CoaleseEqualTokenEmulator; -use PhpParser\Lexer\TokenEmulator\ExplicitOctalEmulator; -use PhpParser\Lexer\TokenEmulator\FlexibleDocStringEmulator; -use PhpParser\Lexer\TokenEmulator\FnTokenEmulator; -use PhpParser\Lexer\TokenEmulator\MatchTokenEmulator; -use PhpParser\Lexer\TokenEmulator\NullsafeTokenEmulator; -use PhpParser\Lexer\TokenEmulator\NumericLiteralSeparatorEmulator; -use PhpParser\Lexer\TokenEmulator\ReadonlyTokenEmulator; -use PhpParser\Lexer\TokenEmulator\ReverseEmulator; -use PhpParser\Lexer\TokenEmulator\TokenEmulator; - -class Emulative extends Lexer -{ - const PHP_7_3 = '7.3dev'; - const PHP_7_4 = '7.4dev'; - const PHP_8_0 = '8.0dev'; - const PHP_8_1 = '8.1dev'; - - /** @var mixed[] Patches used to reverse changes introduced in the code */ - private $patches = []; - - /** @var TokenEmulator[] */ - private $emulators = []; - - /** @var string */ - private $targetPhpVersion; - - /** - * @param mixed[] $options Lexer options. In addition to the usual options, - * accepts a 'phpVersion' string that specifies the - * version to emulate. Defaults to newest supported. - */ - public function __construct(array $options = []) - { - $this->targetPhpVersion = $options['phpVersion'] ?? Emulative::PHP_8_1; - unset($options['phpVersion']); - - parent::__construct($options); - - $emulators = [ - new FlexibleDocStringEmulator(), - new FnTokenEmulator(), - new MatchTokenEmulator(), - new CoaleseEqualTokenEmulator(), - new NumericLiteralSeparatorEmulator(), - new NullsafeTokenEmulator(), - new AttributeEmulator(), - new EnumTokenEmulator(), - new ReadonlyTokenEmulator(), - new ExplicitOctalEmulator(), - ]; - - // Collect emulators that are relevant for the PHP version we're running - // and the PHP version we're targeting for emulation. - foreach ($emulators as $emulator) { - $emulatorPhpVersion = $emulator->getPhpVersion(); - if ($this->isForwardEmulationNeeded($emulatorPhpVersion)) { - $this->emulators[] = $emulator; - } else if ($this->isReverseEmulationNeeded($emulatorPhpVersion)) { - $this->emulators[] = new ReverseEmulator($emulator); - } - } - } - - public function startLexing(string $code, ErrorHandler $errorHandler = null) { - $emulators = array_filter($this->emulators, function($emulator) use($code) { - return $emulator->isEmulationNeeded($code); - }); - - if (empty($emulators)) { - // Nothing to emulate, yay - parent::startLexing($code, $errorHandler); - return; - } - - $this->patches = []; - foreach ($emulators as $emulator) { - $code = $emulator->preprocessCode($code, $this->patches); - } - - $collector = new ErrorHandler\Collecting(); - parent::startLexing($code, $collector); - $this->sortPatches(); - $this->fixupTokens(); - - $errors = $collector->getErrors(); - if (!empty($errors)) { - $this->fixupErrors($errors); - foreach ($errors as $error) { - $errorHandler->handleError($error); - } - } - - foreach ($emulators as $emulator) { - $this->tokens = $emulator->emulate($code, $this->tokens); - } - } - - private function isForwardEmulationNeeded(string $emulatorPhpVersion): bool { - return version_compare(\PHP_VERSION, $emulatorPhpVersion, '<') - && version_compare($this->targetPhpVersion, $emulatorPhpVersion, '>='); - } - - private function isReverseEmulationNeeded(string $emulatorPhpVersion): bool { - return version_compare(\PHP_VERSION, $emulatorPhpVersion, '>=') - && version_compare($this->targetPhpVersion, $emulatorPhpVersion, '<'); - } - - private function sortPatches() - { - // Patches may be contributed by different emulators. - // Make sure they are sorted by increasing patch position. - usort($this->patches, function($p1, $p2) { - return $p1[0] <=> $p2[0]; - }); - } - - private function fixupTokens() - { - if (\count($this->patches) === 0) { - return; - } - - // Load first patch - $patchIdx = 0; - - list($patchPos, $patchType, $patchText) = $this->patches[$patchIdx]; - - // We use a manual loop over the tokens, because we modify the array on the fly - $pos = 0; - for ($i = 0, $c = \count($this->tokens); $i < $c; $i++) { - $token = $this->tokens[$i]; - if (\is_string($token)) { - if ($patchPos === $pos) { - // Only support replacement for string tokens. - assert($patchType === 'replace'); - $this->tokens[$i] = $patchText; - - // Fetch the next patch - $patchIdx++; - if ($patchIdx >= \count($this->patches)) { - // No more patches, we're done - return; - } - list($patchPos, $patchType, $patchText) = $this->patches[$patchIdx]; - } - - $pos += \strlen($token); - continue; - } - - $len = \strlen($token[1]); - $posDelta = 0; - while ($patchPos >= $pos && $patchPos < $pos + $len) { - $patchTextLen = \strlen($patchText); - if ($patchType === 'remove') { - if ($patchPos === $pos && $patchTextLen === $len) { - // Remove token entirely - array_splice($this->tokens, $i, 1, []); - $i--; - $c--; - } else { - // Remove from token string - $this->tokens[$i][1] = substr_replace( - $token[1], '', $patchPos - $pos + $posDelta, $patchTextLen - ); - $posDelta -= $patchTextLen; - } - } elseif ($patchType === 'add') { - // Insert into the token string - $this->tokens[$i][1] = substr_replace( - $token[1], $patchText, $patchPos - $pos + $posDelta, 0 - ); - $posDelta += $patchTextLen; - } else if ($patchType === 'replace') { - // Replace inside the token string - $this->tokens[$i][1] = substr_replace( - $token[1], $patchText, $patchPos - $pos + $posDelta, $patchTextLen - ); - } else { - assert(false); - } - - // Fetch the next patch - $patchIdx++; - if ($patchIdx >= \count($this->patches)) { - // No more patches, we're done - return; - } - - list($patchPos, $patchType, $patchText) = $this->patches[$patchIdx]; - - // Multiple patches may apply to the same token. Reload the current one to check - // If the new patch applies - $token = $this->tokens[$i]; - } - - $pos += $len; - } - - // A patch did not apply - assert(false); - } - - /** - * Fixup line and position information in errors. - * - * @param Error[] $errors - */ - private function fixupErrors(array $errors) { - foreach ($errors as $error) { - $attrs = $error->getAttributes(); - - $posDelta = 0; - $lineDelta = 0; - foreach ($this->patches as $patch) { - list($patchPos, $patchType, $patchText) = $patch; - if ($patchPos >= $attrs['startFilePos']) { - // No longer relevant - break; - } - - if ($patchType === 'add') { - $posDelta += strlen($patchText); - $lineDelta += substr_count($patchText, "\n"); - } else if ($patchType === 'remove') { - $posDelta -= strlen($patchText); - $lineDelta -= substr_count($patchText, "\n"); - } - } - - $attrs['startFilePos'] += $posDelta; - $attrs['endFilePos'] += $posDelta; - $attrs['startLine'] += $lineDelta; - $attrs['endLine'] += $lineDelta; - $error->setAttributes($attrs); - } - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php deleted file mode 100644 index 6776a519..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Lexer\TokenEmulator; - -use PhpParser\Lexer\Emulative; - -final class AttributeEmulator extends TokenEmulator -{ - public function getPhpVersion(): string - { - return Emulative::PHP_8_0; - } - - public function isEmulationNeeded(string $code) : bool - { - return strpos($code, '#[') !== false; - } - - public function emulate(string $code, array $tokens): array - { - // We need to manually iterate and manage a count because we'll change - // the tokens array on the way. - $line = 1; - for ($i = 0, $c = count($tokens); $i < $c; ++$i) { - if ($tokens[$i] === '#' && isset($tokens[$i + 1]) && $tokens[$i + 1] === '[') { - array_splice($tokens, $i, 2, [ - [\T_ATTRIBUTE, '#[', $line] - ]); - $c--; - continue; - } - if (\is_array($tokens[$i])) { - $line += substr_count($tokens[$i][1], "\n"); - } - } - - return $tokens; - } - - public function reverseEmulate(string $code, array $tokens): array - { - // TODO - return $tokens; - } - - public function preprocessCode(string $code, array &$patches): string { - $pos = 0; - while (false !== $pos = strpos($code, '#[', $pos)) { - // Replace #[ with %[ - $code[$pos] = '%'; - $patches[] = [$pos, 'replace', '#']; - $pos += 2; - } - return $code; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/CoaleseEqualTokenEmulator.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/CoaleseEqualTokenEmulator.php deleted file mode 100644 index d91da921..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/CoaleseEqualTokenEmulator.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Lexer\TokenEmulator; - -use PhpParser\Lexer\Emulative; - -final class CoaleseEqualTokenEmulator extends TokenEmulator -{ - public function getPhpVersion(): string - { - return Emulative::PHP_7_4; - } - - public function isEmulationNeeded(string $code): bool - { - return strpos($code, '??=') !== false; - } - - public function emulate(string $code, array $tokens): array - { - // We need to manually iterate and manage a count because we'll change - // the tokens array on the way - $line = 1; - for ($i = 0, $c = count($tokens); $i < $c; ++$i) { - if (isset($tokens[$i + 1])) { - if ($tokens[$i][0] === T_COALESCE && $tokens[$i + 1] === '=') { - array_splice($tokens, $i, 2, [ - [\T_COALESCE_EQUAL, '??=', $line] - ]); - $c--; - continue; - } - } - if (\is_array($tokens[$i])) { - $line += substr_count($tokens[$i][1], "\n"); - } - } - - return $tokens; - } - - public function reverseEmulate(string $code, array $tokens): array - { - // ??= was not valid code previously, don't bother. - return $tokens; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/EnumTokenEmulator.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/EnumTokenEmulator.php deleted file mode 100644 index 4ddc0b17..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/EnumTokenEmulator.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Lexer\TokenEmulator; - -use PhpParser\Lexer\Emulative; - -final class EnumTokenEmulator extends KeywordEmulator -{ - public function getPhpVersion(): string - { - return Emulative::PHP_8_1; - } - - public function getKeywordString(): string - { - return 'enum'; - } - - public function getKeywordToken(): int - { - return \T_ENUM; - } - - protected function isKeywordContext(array $tokens, int $pos): bool - { - return parent::isKeywordContext($tokens, $pos) - && isset($tokens[$pos + 2]) - && $tokens[$pos + 1][0] === \T_WHITESPACE - && $tokens[$pos + 2][0] === \T_STRING; - } -} \ No newline at end of file diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.php deleted file mode 100644 index f5f6805b..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Lexer\TokenEmulator; - -use PhpParser\Lexer\Emulative; - -class ExplicitOctalEmulator extends TokenEmulator { - public function getPhpVersion(): string { - return Emulative::PHP_8_1; - } - - public function isEmulationNeeded(string $code): bool { - return strpos($code, '0o') !== false || strpos($code, '0O') !== false; - } - - public function emulate(string $code, array $tokens): array { - for ($i = 0, $c = count($tokens); $i < $c; ++$i) { - if ($tokens[$i][0] == \T_LNUMBER && $tokens[$i][1] === '0' && - isset($tokens[$i + 1]) && $tokens[$i + 1][0] == \T_STRING && - preg_match('/[oO][0-7]+(?:_[0-7]+)*/', $tokens[$i + 1][1]) - ) { - $tokenKind = $this->resolveIntegerOrFloatToken($tokens[$i + 1][1]); - array_splice($tokens, $i, 2, [ - [$tokenKind, '0' . $tokens[$i + 1][1], $tokens[$i][2]], - ]); - $c--; - } - } - return $tokens; - } - - private function resolveIntegerOrFloatToken(string $str): int - { - $str = substr($str, 1); - $str = str_replace('_', '', $str); - $num = octdec($str); - return is_float($num) ? \T_DNUMBER : \T_LNUMBER; - } - - public function reverseEmulate(string $code, array $tokens): array { - // Explicit octals were not legal code previously, don't bother. - return $tokens; - } -} \ No newline at end of file diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FlexibleDocStringEmulator.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FlexibleDocStringEmulator.php deleted file mode 100644 index c15d6271..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FlexibleDocStringEmulator.php +++ /dev/null @@ -1,76 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Lexer\TokenEmulator; - -use PhpParser\Lexer\Emulative; - -final class FlexibleDocStringEmulator extends TokenEmulator -{ - const FLEXIBLE_DOC_STRING_REGEX = <<<'REGEX' -/<<<[ \t]*(['"]?)([a-zA-Z_\x80-\xff][a-zA-Z0-9_\x80-\xff]*)\1\r?\n -(?:.*\r?\n)*? -(?<indentation>\h*)\2(?![a-zA-Z0-9_\x80-\xff])(?<separator>(?:;?[\r\n])?)/x -REGEX; - - public function getPhpVersion(): string - { - return Emulative::PHP_7_3; - } - - public function isEmulationNeeded(string $code) : bool - { - return strpos($code, '<<<') !== false; - } - - public function emulate(string $code, array $tokens): array - { - // Handled by preprocessing + fixup. - return $tokens; - } - - public function reverseEmulate(string $code, array $tokens): array - { - // Not supported. - return $tokens; - } - - public function preprocessCode(string $code, array &$patches): string { - if (!preg_match_all(self::FLEXIBLE_DOC_STRING_REGEX, $code, $matches, PREG_SET_ORDER|PREG_OFFSET_CAPTURE)) { - // No heredoc/nowdoc found - return $code; - } - - // Keep track of how much we need to adjust string offsets due to the modifications we - // already made - $posDelta = 0; - foreach ($matches as $match) { - $indentation = $match['indentation'][0]; - $indentationStart = $match['indentation'][1]; - - $separator = $match['separator'][0]; - $separatorStart = $match['separator'][1]; - - if ($indentation === '' && $separator !== '') { - // Ordinary heredoc/nowdoc - continue; - } - - if ($indentation !== '') { - // Remove indentation - $indentationLen = strlen($indentation); - $code = substr_replace($code, '', $indentationStart + $posDelta, $indentationLen); - $patches[] = [$indentationStart + $posDelta, 'add', $indentation]; - $posDelta -= $indentationLen; - } - - if ($separator === '') { - // Insert newline as separator - $code = substr_replace($code, "\n", $separatorStart + $posDelta, 0); - $patches[] = [$separatorStart + $posDelta, 'remove', "\n"]; - $posDelta += 1; - } - } - - return $code; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FnTokenEmulator.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FnTokenEmulator.php deleted file mode 100644 index eb7e4963..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FnTokenEmulator.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Lexer\TokenEmulator; - -use PhpParser\Lexer\Emulative; - -final class FnTokenEmulator extends KeywordEmulator -{ - public function getPhpVersion(): string - { - return Emulative::PHP_7_4; - } - - public function getKeywordString(): string - { - return 'fn'; - } - - public function getKeywordToken(): int - { - return \T_FN; - } -} \ No newline at end of file diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/KeywordEmulator.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/KeywordEmulator.php deleted file mode 100644 index f8e83629..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/KeywordEmulator.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Lexer\TokenEmulator; - -abstract class KeywordEmulator extends TokenEmulator -{ - abstract function getKeywordString(): string; - abstract function getKeywordToken(): int; - - public function isEmulationNeeded(string $code): bool - { - return strpos(strtolower($code), $this->getKeywordString()) !== false; - } - - protected function isKeywordContext(array $tokens, int $pos): bool - { - $previousNonSpaceToken = $this->getPreviousNonSpaceToken($tokens, $pos); - return $previousNonSpaceToken === null || $previousNonSpaceToken[0] !== \T_OBJECT_OPERATOR; - } - - public function emulate(string $code, array $tokens): array - { - $keywordString = $this->getKeywordString(); - foreach ($tokens as $i => $token) { - if ($token[0] === T_STRING && strtolower($token[1]) === $keywordString - && $this->isKeywordContext($tokens, $i)) { - $tokens[$i][0] = $this->getKeywordToken(); - } - } - - return $tokens; - } - - /** - * @param mixed[] $tokens - * @return array|string|null - */ - private function getPreviousNonSpaceToken(array $tokens, int $start) - { - for ($i = $start - 1; $i >= 0; --$i) { - if ($tokens[$i][0] === T_WHITESPACE) { - continue; - } - - return $tokens[$i]; - } - - return null; - } - - public function reverseEmulate(string $code, array $tokens): array - { - $keywordToken = $this->getKeywordToken(); - foreach ($tokens as $i => $token) { - if ($token[0] === $keywordToken) { - $tokens[$i][0] = \T_STRING; - } - } - - return $tokens; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php deleted file mode 100644 index 902a46df..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Lexer\TokenEmulator; - -use PhpParser\Lexer\Emulative; - -final class MatchTokenEmulator extends KeywordEmulator -{ - public function getPhpVersion(): string - { - return Emulative::PHP_8_0; - } - - public function getKeywordString(): string - { - return 'match'; - } - - public function getKeywordToken(): int - { - return \T_MATCH; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NullsafeTokenEmulator.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NullsafeTokenEmulator.php deleted file mode 100644 index 1a29c676..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NullsafeTokenEmulator.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Lexer\TokenEmulator; - -use PhpParser\Lexer\Emulative; - -final class NullsafeTokenEmulator extends TokenEmulator -{ - public function getPhpVersion(): string - { - return Emulative::PHP_8_0; - } - - public function isEmulationNeeded(string $code): bool - { - return strpos($code, '?->') !== false; - } - - public function emulate(string $code, array $tokens): array - { - // We need to manually iterate and manage a count because we'll change - // the tokens array on the way - $line = 1; - for ($i = 0, $c = count($tokens); $i < $c; ++$i) { - if ($tokens[$i] === '?' && isset($tokens[$i + 1]) && $tokens[$i + 1][0] === \T_OBJECT_OPERATOR) { - array_splice($tokens, $i, 2, [ - [\T_NULLSAFE_OBJECT_OPERATOR, '?->', $line] - ]); - $c--; - continue; - } - - // Handle ?-> inside encapsed string. - if ($tokens[$i][0] === \T_ENCAPSED_AND_WHITESPACE && isset($tokens[$i - 1]) - && $tokens[$i - 1][0] === \T_VARIABLE - && preg_match('/^\?->([a-zA-Z_\x80-\xff][a-zA-Z0-9_\x80-\xff]*)/', $tokens[$i][1], $matches) - ) { - $replacement = [ - [\T_NULLSAFE_OBJECT_OPERATOR, '?->', $line], - [\T_STRING, $matches[1], $line], - ]; - if (\strlen($matches[0]) !== \strlen($tokens[$i][1])) { - $replacement[] = [ - \T_ENCAPSED_AND_WHITESPACE, - \substr($tokens[$i][1], \strlen($matches[0])), - $line - ]; - } - array_splice($tokens, $i, 1, $replacement); - $c += \count($replacement) - 1; - continue; - } - - if (\is_array($tokens[$i])) { - $line += substr_count($tokens[$i][1], "\n"); - } - } - - return $tokens; - } - - public function reverseEmulate(string $code, array $tokens): array - { - // ?-> was not valid code previously, don't bother. - return $tokens; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NumericLiteralSeparatorEmulator.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NumericLiteralSeparatorEmulator.php deleted file mode 100644 index cdf793e4..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NumericLiteralSeparatorEmulator.php +++ /dev/null @@ -1,105 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Lexer\TokenEmulator; - -use PhpParser\Lexer\Emulative; - -final class NumericLiteralSeparatorEmulator extends TokenEmulator -{ - const BIN = '(?:0b[01]+(?:_[01]+)*)'; - const HEX = '(?:0x[0-9a-f]+(?:_[0-9a-f]+)*)'; - const DEC = '(?:[0-9]+(?:_[0-9]+)*)'; - const SIMPLE_FLOAT = '(?:' . self::DEC . '\.' . self::DEC . '?|\.' . self::DEC . ')'; - const EXP = '(?:e[+-]?' . self::DEC . ')'; - const FLOAT = '(?:' . self::SIMPLE_FLOAT . self::EXP . '?|' . self::DEC . self::EXP . ')'; - const NUMBER = '~' . self::FLOAT . '|' . self::BIN . '|' . self::HEX . '|' . self::DEC . '~iA'; - - public function getPhpVersion(): string - { - return Emulative::PHP_7_4; - } - - public function isEmulationNeeded(string $code) : bool - { - return preg_match('~[0-9]_[0-9]~', $code) - || preg_match('~0x[0-9a-f]+_[0-9a-f]~i', $code); - } - - public function emulate(string $code, array $tokens): array - { - // We need to manually iterate and manage a count because we'll change - // the tokens array on the way - $codeOffset = 0; - for ($i = 0, $c = count($tokens); $i < $c; ++$i) { - $token = $tokens[$i]; - $tokenLen = \strlen(\is_array($token) ? $token[1] : $token); - - if ($token[0] !== T_LNUMBER && $token[0] !== T_DNUMBER) { - $codeOffset += $tokenLen; - continue; - } - - $res = preg_match(self::NUMBER, $code, $matches, 0, $codeOffset); - assert($res, "No number at number token position"); - - $match = $matches[0]; - $matchLen = \strlen($match); - if ($matchLen === $tokenLen) { - // Original token already holds the full number. - $codeOffset += $tokenLen; - continue; - } - - $tokenKind = $this->resolveIntegerOrFloatToken($match); - $newTokens = [[$tokenKind, $match, $token[2]]]; - - $numTokens = 1; - $len = $tokenLen; - while ($matchLen > $len) { - $nextToken = $tokens[$i + $numTokens]; - $nextTokenText = \is_array($nextToken) ? $nextToken[1] : $nextToken; - $nextTokenLen = \strlen($nextTokenText); - - $numTokens++; - if ($matchLen < $len + $nextTokenLen) { - // Split trailing characters into a partial token. - assert(is_array($nextToken), "Partial token should be an array token"); - $partialText = substr($nextTokenText, $matchLen - $len); - $newTokens[] = [$nextToken[0], $partialText, $nextToken[2]]; - break; - } - - $len += $nextTokenLen; - } - - array_splice($tokens, $i, $numTokens, $newTokens); - $c -= $numTokens - \count($newTokens); - $codeOffset += $matchLen; - } - - return $tokens; - } - - private function resolveIntegerOrFloatToken(string $str): int - { - $str = str_replace('_', '', $str); - - if (stripos($str, '0b') === 0) { - $num = bindec($str); - } elseif (stripos($str, '0x') === 0) { - $num = hexdec($str); - } elseif (stripos($str, '0') === 0 && ctype_digit($str)) { - $num = octdec($str); - } else { - $num = +$str; - } - - return is_float($num) ? T_DNUMBER : T_LNUMBER; - } - - public function reverseEmulate(string $code, array $tokens): array - { - // Numeric separators were not legal code previously, don't bother. - return $tokens; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyTokenEmulator.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyTokenEmulator.php deleted file mode 100644 index 539a2bcf..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyTokenEmulator.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Lexer\TokenEmulator; - -use PhpParser\Lexer\Emulative; - -final class ReadonlyTokenEmulator extends KeywordEmulator -{ - public function getPhpVersion(): string - { - return Emulative::PHP_8_1; - } - - public function getKeywordString(): string - { - return 'readonly'; - } - - public function getKeywordToken(): int - { - return \T_READONLY; - } - - protected function isKeywordContext(array $tokens, int $pos): bool - { - if (!parent::isKeywordContext($tokens, $pos)) { - return false; - } - // Support "function readonly(" - return !(isset($tokens[$pos + 1]) && - ($tokens[$pos + 1][0] === '(' || - ($tokens[$pos + 1][0] === \T_WHITESPACE && - isset($tokens[$pos + 2]) && - $tokens[$pos + 2][0] === '('))); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReverseEmulator.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReverseEmulator.php deleted file mode 100644 index 90093f66..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReverseEmulator.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Lexer\TokenEmulator; - -/** - * Reverses emulation direction of the inner emulator. - */ -final class ReverseEmulator extends TokenEmulator -{ - /** @var TokenEmulator Inner emulator */ - private $emulator; - - public function __construct(TokenEmulator $emulator) { - $this->emulator = $emulator; - } - - public function getPhpVersion(): string { - return $this->emulator->getPhpVersion(); - } - - public function isEmulationNeeded(string $code): bool { - return $this->emulator->isEmulationNeeded($code); - } - - public function emulate(string $code, array $tokens): array { - return $this->emulator->reverseEmulate($code, $tokens); - } - - public function reverseEmulate(string $code, array $tokens): array { - return $this->emulator->emulate($code, $tokens); - } - - public function preprocessCode(string $code, array &$patches): string { - return $code; - } -} \ No newline at end of file diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/TokenEmulator.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/TokenEmulator.php deleted file mode 100644 index a020bc0f..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/TokenEmulator.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Lexer\TokenEmulator; - -/** @internal */ -abstract class TokenEmulator -{ - abstract public function getPhpVersion(): string; - - abstract public function isEmulationNeeded(string $code): bool; - - /** - * @return array Modified Tokens - */ - abstract public function emulate(string $code, array $tokens): array; - - /** - * @return array Modified Tokens - */ - abstract public function reverseEmulate(string $code, array $tokens): array; - - public function preprocessCode(string $code, array &$patches): string { - return $code; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NameContext.php b/vendor/nikic/php-parser/lib/PhpParser/NameContext.php deleted file mode 100644 index 777a4afd..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NameContext.php +++ /dev/null @@ -1,285 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser; - -use PhpParser\Node\Name; -use PhpParser\Node\Name\FullyQualified; -use PhpParser\Node\Stmt; - -class NameContext -{ - /** @var null|Name Current namespace */ - protected $namespace; - - /** @var Name[][] Map of format [aliasType => [aliasName => originalName]] */ - protected $aliases = []; - - /** @var Name[][] Same as $aliases but preserving original case */ - protected $origAliases = []; - - /** @var ErrorHandler Error handler */ - protected $errorHandler; - - /** - * Create a name context. - * - * @param ErrorHandler $errorHandler Error handling used to report errors - */ - public function __construct(ErrorHandler $errorHandler) { - $this->errorHandler = $errorHandler; - } - - /** - * Start a new namespace. - * - * This also resets the alias table. - * - * @param Name|null $namespace Null is the global namespace - */ - public function startNamespace(Name $namespace = null) { - $this->namespace = $namespace; - $this->origAliases = $this->aliases = [ - Stmt\Use_::TYPE_NORMAL => [], - Stmt\Use_::TYPE_FUNCTION => [], - Stmt\Use_::TYPE_CONSTANT => [], - ]; - } - - /** - * Add an alias / import. - * - * @param Name $name Original name - * @param string $aliasName Aliased name - * @param int $type One of Stmt\Use_::TYPE_* - * @param array $errorAttrs Attributes to use to report an error - */ - public function addAlias(Name $name, string $aliasName, int $type, array $errorAttrs = []) { - // Constant names are case sensitive, everything else case insensitive - if ($type === Stmt\Use_::TYPE_CONSTANT) { - $aliasLookupName = $aliasName; - } else { - $aliasLookupName = strtolower($aliasName); - } - - if (isset($this->aliases[$type][$aliasLookupName])) { - $typeStringMap = [ - Stmt\Use_::TYPE_NORMAL => '', - Stmt\Use_::TYPE_FUNCTION => 'function ', - Stmt\Use_::TYPE_CONSTANT => 'const ', - ]; - - $this->errorHandler->handleError(new Error( - sprintf( - 'Cannot use %s%s as %s because the name is already in use', - $typeStringMap[$type], $name, $aliasName - ), - $errorAttrs - )); - return; - } - - $this->aliases[$type][$aliasLookupName] = $name; - $this->origAliases[$type][$aliasName] = $name; - } - - /** - * Get current namespace. - * - * @return null|Name Namespace (or null if global namespace) - */ - public function getNamespace() { - return $this->namespace; - } - - /** - * Get resolved name. - * - * @param Name $name Name to resolve - * @param int $type One of Stmt\Use_::TYPE_{FUNCTION|CONSTANT} - * - * @return null|Name Resolved name, or null if static resolution is not possible - */ - public function getResolvedName(Name $name, int $type) { - // don't resolve special class names - if ($type === Stmt\Use_::TYPE_NORMAL && $name->isSpecialClassName()) { - if (!$name->isUnqualified()) { - $this->errorHandler->handleError(new Error( - sprintf("'\\%s' is an invalid class name", $name->toString()), - $name->getAttributes() - )); - } - return $name; - } - - // fully qualified names are already resolved - if ($name->isFullyQualified()) { - return $name; - } - - // Try to resolve aliases - if (null !== $resolvedName = $this->resolveAlias($name, $type)) { - return $resolvedName; - } - - if ($type !== Stmt\Use_::TYPE_NORMAL && $name->isUnqualified()) { - if (null === $this->namespace) { - // outside of a namespace unaliased unqualified is same as fully qualified - return new FullyQualified($name, $name->getAttributes()); - } - - // Cannot resolve statically - return null; - } - - // if no alias exists prepend current namespace - return FullyQualified::concat($this->namespace, $name, $name->getAttributes()); - } - - /** - * Get resolved class name. - * - * @param Name $name Class ame to resolve - * - * @return Name Resolved name - */ - public function getResolvedClassName(Name $name) : Name { - return $this->getResolvedName($name, Stmt\Use_::TYPE_NORMAL); - } - - /** - * Get possible ways of writing a fully qualified name (e.g., by making use of aliases). - * - * @param string $name Fully-qualified name (without leading namespace separator) - * @param int $type One of Stmt\Use_::TYPE_* - * - * @return Name[] Possible representations of the name - */ - public function getPossibleNames(string $name, int $type) : array { - $lcName = strtolower($name); - - if ($type === Stmt\Use_::TYPE_NORMAL) { - // self, parent and static must always be unqualified - if ($lcName === "self" || $lcName === "parent" || $lcName === "static") { - return [new Name($name)]; - } - } - - // Collect possible ways to write this name, starting with the fully-qualified name - $possibleNames = [new FullyQualified($name)]; - - if (null !== $nsRelativeName = $this->getNamespaceRelativeName($name, $lcName, $type)) { - // Make sure there is no alias that makes the normally namespace-relative name - // into something else - if (null === $this->resolveAlias($nsRelativeName, $type)) { - $possibleNames[] = $nsRelativeName; - } - } - - // Check for relevant namespace use statements - foreach ($this->origAliases[Stmt\Use_::TYPE_NORMAL] as $alias => $orig) { - $lcOrig = $orig->toLowerString(); - if (0 === strpos($lcName, $lcOrig . '\\')) { - $possibleNames[] = new Name($alias . substr($name, strlen($lcOrig))); - } - } - - // Check for relevant type-specific use statements - foreach ($this->origAliases[$type] as $alias => $orig) { - if ($type === Stmt\Use_::TYPE_CONSTANT) { - // Constants are are complicated-sensitive - $normalizedOrig = $this->normalizeConstName($orig->toString()); - if ($normalizedOrig === $this->normalizeConstName($name)) { - $possibleNames[] = new Name($alias); - } - } else { - // Everything else is case-insensitive - if ($orig->toLowerString() === $lcName) { - $possibleNames[] = new Name($alias); - } - } - } - - return $possibleNames; - } - - /** - * Get shortest representation of this fully-qualified name. - * - * @param string $name Fully-qualified name (without leading namespace separator) - * @param int $type One of Stmt\Use_::TYPE_* - * - * @return Name Shortest representation - */ - public function getShortName(string $name, int $type) : Name { - $possibleNames = $this->getPossibleNames($name, $type); - - // Find shortest name - $shortestName = null; - $shortestLength = \INF; - foreach ($possibleNames as $possibleName) { - $length = strlen($possibleName->toCodeString()); - if ($length < $shortestLength) { - $shortestName = $possibleName; - $shortestLength = $length; - } - } - - return $shortestName; - } - - private function resolveAlias(Name $name, $type) { - $firstPart = $name->getFirst(); - - if ($name->isQualified()) { - // resolve aliases for qualified names, always against class alias table - $checkName = strtolower($firstPart); - if (isset($this->aliases[Stmt\Use_::TYPE_NORMAL][$checkName])) { - $alias = $this->aliases[Stmt\Use_::TYPE_NORMAL][$checkName]; - return FullyQualified::concat($alias, $name->slice(1), $name->getAttributes()); - } - } elseif ($name->isUnqualified()) { - // constant aliases are case-sensitive, function aliases case-insensitive - $checkName = $type === Stmt\Use_::TYPE_CONSTANT ? $firstPart : strtolower($firstPart); - if (isset($this->aliases[$type][$checkName])) { - // resolve unqualified aliases - return new FullyQualified($this->aliases[$type][$checkName], $name->getAttributes()); - } - } - - // No applicable aliases - return null; - } - - private function getNamespaceRelativeName(string $name, string $lcName, int $type) { - if (null === $this->namespace) { - return new Name($name); - } - - if ($type === Stmt\Use_::TYPE_CONSTANT) { - // The constants true/false/null always resolve to the global symbols, even inside a - // namespace, so they may be used without qualification - if ($lcName === "true" || $lcName === "false" || $lcName === "null") { - return new Name($name); - } - } - - $namespacePrefix = strtolower($this->namespace . '\\'); - if (0 === strpos($lcName, $namespacePrefix)) { - return new Name(substr($name, strlen($namespacePrefix))); - } - - return null; - } - - private function normalizeConstName(string $name) { - $nsSep = strrpos($name, '\\'); - if (false === $nsSep) { - return $name; - } - - // Constants have case-insensitive namespace and case-sensitive short-name - $ns = substr($name, 0, $nsSep); - $shortName = substr($name, $nsSep + 1); - return strtolower($ns) . '\\' . $shortName; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node.php b/vendor/nikic/php-parser/lib/PhpParser/Node.php deleted file mode 100644 index befb2565..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node.php +++ /dev/null @@ -1,151 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser; - -interface Node -{ - /** - * Gets the type of the node. - * - * @return string Type of the node - */ - public function getType() : string; - - /** - * Gets the names of the sub nodes. - * - * @return array Names of sub nodes - */ - public function getSubNodeNames() : array; - - /** - * Gets line the node started in (alias of getStartLine). - * - * @return int Start line (or -1 if not available) - */ - public function getLine() : int; - - /** - * Gets line the node started in. - * - * Requires the 'startLine' attribute to be enabled in the lexer (enabled by default). - * - * @return int Start line (or -1 if not available) - */ - public function getStartLine() : int; - - /** - * Gets the line the node ended in. - * - * Requires the 'endLine' attribute to be enabled in the lexer (enabled by default). - * - * @return int End line (or -1 if not available) - */ - public function getEndLine() : int; - - /** - * Gets the token offset of the first token that is part of this node. - * - * The offset is an index into the array returned by Lexer::getTokens(). - * - * Requires the 'startTokenPos' attribute to be enabled in the lexer (DISABLED by default). - * - * @return int Token start position (or -1 if not available) - */ - public function getStartTokenPos() : int; - - /** - * Gets the token offset of the last token that is part of this node. - * - * The offset is an index into the array returned by Lexer::getTokens(). - * - * Requires the 'endTokenPos' attribute to be enabled in the lexer (DISABLED by default). - * - * @return int Token end position (or -1 if not available) - */ - public function getEndTokenPos() : int; - - /** - * Gets the file offset of the first character that is part of this node. - * - * Requires the 'startFilePos' attribute to be enabled in the lexer (DISABLED by default). - * - * @return int File start position (or -1 if not available) - */ - public function getStartFilePos() : int; - - /** - * Gets the file offset of the last character that is part of this node. - * - * Requires the 'endFilePos' attribute to be enabled in the lexer (DISABLED by default). - * - * @return int File end position (or -1 if not available) - */ - public function getEndFilePos() : int; - - /** - * Gets all comments directly preceding this node. - * - * The comments are also available through the "comments" attribute. - * - * @return Comment[] - */ - public function getComments() : array; - - /** - * Gets the doc comment of the node. - * - * @return null|Comment\Doc Doc comment object or null - */ - public function getDocComment(); - - /** - * Sets the doc comment of the node. - * - * This will either replace an existing doc comment or add it to the comments array. - * - * @param Comment\Doc $docComment Doc comment to set - */ - public function setDocComment(Comment\Doc $docComment); - - /** - * Sets an attribute on a node. - * - * @param string $key - * @param mixed $value - */ - public function setAttribute(string $key, $value); - - /** - * Returns whether an attribute exists. - * - * @param string $key - * - * @return bool - */ - public function hasAttribute(string $key) : bool; - - /** - * Returns the value of an attribute. - * - * @param string $key - * @param mixed $default - * - * @return mixed - */ - public function getAttribute(string $key, $default = null); - - /** - * Returns all the attributes of this node. - * - * @return array - */ - public function getAttributes() : array; - - /** - * Replaces all the attributes of this node. - * - * @param array $attributes - */ - public function setAttributes(array $attributes); -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Arg.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Arg.php deleted file mode 100644 index bcf130e6..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Arg.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node; - -use PhpParser\Node\VariadicPlaceholder; -use PhpParser\NodeAbstract; - -class Arg extends NodeAbstract -{ - /** @var Identifier|null Parameter name (for named parameters) */ - public $name; - /** @var Expr Value to pass */ - public $value; - /** @var bool Whether to pass by ref */ - public $byRef; - /** @var bool Whether to unpack the argument */ - public $unpack; - - /** - * Constructs a function call argument node. - * - * @param Expr $value Value to pass - * @param bool $byRef Whether to pass by ref - * @param bool $unpack Whether to unpack the argument - * @param array $attributes Additional attributes - * @param Identifier|null $name Parameter name (for named parameters) - */ - public function __construct( - Expr $value, bool $byRef = false, bool $unpack = false, array $attributes = [], - Identifier $name = null - ) { - $this->attributes = $attributes; - $this->name = $name; - $this->value = $value; - $this->byRef = $byRef; - $this->unpack = $unpack; - } - - public function getSubNodeNames() : array { - return ['name', 'value', 'byRef', 'unpack']; - } - - public function getType() : string { - return 'Arg'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Attribute.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Attribute.php deleted file mode 100644 index c96f66e5..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Attribute.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node; - -use PhpParser\Node; -use PhpParser\NodeAbstract; - -class Attribute extends NodeAbstract -{ - /** @var Name Attribute name */ - public $name; - - /** @var Arg[] Attribute arguments */ - public $args; - - /** - * @param Node\Name $name Attribute name - * @param Arg[] $args Attribute arguments - * @param array $attributes Additional node attributes - */ - public function __construct(Name $name, array $args = [], array $attributes = []) { - $this->attributes = $attributes; - $this->name = $name; - $this->args = $args; - } - - public function getSubNodeNames() : array { - return ['name', 'args']; - } - - public function getType() : string { - return 'Attribute'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/AttributeGroup.php b/vendor/nikic/php-parser/lib/PhpParser/Node/AttributeGroup.php deleted file mode 100644 index 613bfc41..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/AttributeGroup.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node; - -use PhpParser\Node; -use PhpParser\NodeAbstract; - -class AttributeGroup extends NodeAbstract -{ - /** @var Attribute[] Attributes */ - public $attrs; - - /** - * @param Attribute[] $attrs PHP attributes - * @param array $attributes Additional node attributes - */ - public function __construct(array $attrs, array $attributes = []) { - $this->attributes = $attributes; - $this->attrs = $attrs; - } - - public function getSubNodeNames() : array { - return ['attrs']; - } - - public function getType() : string { - return 'AttributeGroup'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/ComplexType.php b/vendor/nikic/php-parser/lib/PhpParser/Node/ComplexType.php deleted file mode 100644 index 9505532a..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/ComplexType.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node; - -use PhpParser\NodeAbstract; - -/** - * This is a base class for complex types, including nullable types and union types. - * - * It does not provide any shared behavior and exists only for type-checking purposes. - */ -abstract class ComplexType extends NodeAbstract -{ -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Const_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Const_.php deleted file mode 100644 index 07a74df8..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Const_.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node; - -use PhpParser\NodeAbstract; - -class Const_ extends NodeAbstract -{ - /** @var Identifier Name */ - public $name; - /** @var Expr Value */ - public $value; - - /** @var Name|null Namespaced name (if using NameResolver) */ - public $namespacedName; - - /** - * Constructs a const node for use in class const and const statements. - * - * @param string|Identifier $name Name - * @param Expr $value Value - * @param array $attributes Additional attributes - */ - public function __construct($name, Expr $value, array $attributes = []) { - $this->attributes = $attributes; - $this->name = \is_string($name) ? new Identifier($name) : $name; - $this->value = $value; - } - - public function getSubNodeNames() : array { - return ['name', 'value']; - } - - public function getType() : string { - return 'Const'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr.php deleted file mode 100644 index 6cf4df22..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr.php +++ /dev/null @@ -1,9 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node; - -use PhpParser\NodeAbstract; - -abstract class Expr extends NodeAbstract -{ -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayDimFetch.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayDimFetch.php deleted file mode 100644 index 71694478..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayDimFetch.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; - -class ArrayDimFetch extends Expr -{ - /** @var Expr Variable */ - public $var; - /** @var null|Expr Array index / dim */ - public $dim; - - /** - * Constructs an array index fetch node. - * - * @param Expr $var Variable - * @param null|Expr $dim Array index / dim - * @param array $attributes Additional attributes - */ - public function __construct(Expr $var, Expr $dim = null, array $attributes = []) { - $this->attributes = $attributes; - $this->var = $var; - $this->dim = $dim; - } - - public function getSubNodeNames() : array { - return ['var', 'dim']; - } - - public function getType() : string { - return 'Expr_ArrayDimFetch'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php deleted file mode 100644 index 1b078f82..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; - -class ArrayItem extends Expr -{ - /** @var null|Expr Key */ - public $key; - /** @var Expr Value */ - public $value; - /** @var bool Whether to assign by reference */ - public $byRef; - /** @var bool Whether to unpack the argument */ - public $unpack; - - /** - * Constructs an array item node. - * - * @param Expr $value Value - * @param null|Expr $key Key - * @param bool $byRef Whether to assign by reference - * @param array $attributes Additional attributes - */ - public function __construct(Expr $value, Expr $key = null, bool $byRef = false, array $attributes = [], bool $unpack = false) { - $this->attributes = $attributes; - $this->key = $key; - $this->value = $value; - $this->byRef = $byRef; - $this->unpack = $unpack; - } - - public function getSubNodeNames() : array { - return ['key', 'value', 'byRef', 'unpack']; - } - - public function getType() : string { - return 'Expr_ArrayItem'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Array_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Array_.php deleted file mode 100644 index e6eaa283..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Array_.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; - -class Array_ extends Expr -{ - // For use in "kind" attribute - const KIND_LONG = 1; // array() syntax - const KIND_SHORT = 2; // [] syntax - - /** @var (ArrayItem|null)[] Items */ - public $items; - - /** - * Constructs an array node. - * - * @param (ArrayItem|null)[] $items Items of the array - * @param array $attributes Additional attributes - */ - public function __construct(array $items = [], array $attributes = []) { - $this->attributes = $attributes; - $this->items = $items; - } - - public function getSubNodeNames() : array { - return ['items']; - } - - public function getType() : string { - return 'Expr_Array'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php deleted file mode 100644 index c273fb7e..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php +++ /dev/null @@ -1,79 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node; -use PhpParser\Node\Expr; -use PhpParser\Node\FunctionLike; - -class ArrowFunction extends Expr implements FunctionLike -{ - /** @var bool */ - public $static; - - /** @var bool */ - public $byRef; - - /** @var Node\Param[] */ - public $params = []; - - /** @var null|Node\Identifier|Node\Name|Node\ComplexType */ - public $returnType; - - /** @var Expr */ - public $expr; - /** @var Node\AttributeGroup[] */ - public $attrGroups; - - /** - * @param array $subNodes Array of the following optional subnodes: - * 'static' => false : Whether the closure is static - * 'byRef' => false : Whether to return by reference - * 'params' => array() : Parameters - * 'returnType' => null : Return type - * 'expr' => Expr : Expression body - * 'attrGroups' => array() : PHP attribute groups - * @param array $attributes Additional attributes - */ - public function __construct(array $subNodes = [], array $attributes = []) { - $this->attributes = $attributes; - $this->static = $subNodes['static'] ?? false; - $this->byRef = $subNodes['byRef'] ?? false; - $this->params = $subNodes['params'] ?? []; - $returnType = $subNodes['returnType'] ?? null; - $this->returnType = \is_string($returnType) ? new Node\Identifier($returnType) : $returnType; - $this->expr = $subNodes['expr']; - $this->attrGroups = $subNodes['attrGroups'] ?? []; - } - - public function getSubNodeNames() : array { - return ['attrGroups', 'static', 'byRef', 'params', 'returnType', 'expr']; - } - - public function returnsByRef() : bool { - return $this->byRef; - } - - public function getParams() : array { - return $this->params; - } - - public function getReturnType() { - return $this->returnType; - } - - public function getAttrGroups() : array { - return $this->attrGroups; - } - - /** - * @return Node\Stmt\Return_[] - */ - public function getStmts() : array { - return [new Node\Stmt\Return_($this->expr)]; - } - - public function getType() : string { - return 'Expr_ArrowFunction'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php deleted file mode 100644 index cf9e6e82..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; - -class Assign extends Expr -{ - /** @var Expr Variable */ - public $var; - /** @var Expr Expression */ - public $expr; - - /** - * Constructs an assignment node. - * - * @param Expr $var Variable - * @param Expr $expr Expression - * @param array $attributes Additional attributes - */ - public function __construct(Expr $var, Expr $expr, array $attributes = []) { - $this->attributes = $attributes; - $this->var = $var; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['var', 'expr']; - } - - public function getType() : string { - return 'Expr_Assign'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp.php deleted file mode 100644 index bce8604f..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; - -abstract class AssignOp extends Expr -{ - /** @var Expr Variable */ - public $var; - /** @var Expr Expression */ - public $expr; - - /** - * Constructs a compound assignment operation node. - * - * @param Expr $var Variable - * @param Expr $expr Expression - * @param array $attributes Additional attributes - */ - public function __construct(Expr $var, Expr $expr, array $attributes = []) { - $this->attributes = $attributes; - $this->var = $var; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['var', 'expr']; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php deleted file mode 100644 index 420284cd..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\AssignOp; - -use PhpParser\Node\Expr\AssignOp; - -class BitwiseAnd extends AssignOp -{ - public function getType() : string { - return 'Expr_AssignOp_BitwiseAnd'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseOr.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseOr.php deleted file mode 100644 index 481ad3bb..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseOr.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\AssignOp; - -use PhpParser\Node\Expr\AssignOp; - -class BitwiseOr extends AssignOp -{ - public function getType() : string { - return 'Expr_AssignOp_BitwiseOr'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseXor.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseXor.php deleted file mode 100644 index f41d4c8e..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseXor.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\AssignOp; - -use PhpParser\Node\Expr\AssignOp; - -class BitwiseXor extends AssignOp -{ - public function getType() : string { - return 'Expr_AssignOp_BitwiseXor'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Coalesce.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Coalesce.php deleted file mode 100644 index c0e9b316..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Coalesce.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\AssignOp; - -use PhpParser\Node\Expr\AssignOp; - -class Coalesce extends AssignOp -{ - public function getType() : string { - return 'Expr_AssignOp_Coalesce'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Concat.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Concat.php deleted file mode 100644 index ac168207..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Concat.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\AssignOp; - -use PhpParser\Node\Expr\AssignOp; - -class Concat extends AssignOp -{ - public function getType() : string { - return 'Expr_AssignOp_Concat'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Div.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Div.php deleted file mode 100644 index f1fcfc09..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Div.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\AssignOp; - -use PhpParser\Node\Expr\AssignOp; - -class Div extends AssignOp -{ - public function getType() : string { - return 'Expr_AssignOp_Div'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Minus.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Minus.php deleted file mode 100644 index 82ef4517..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Minus.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\AssignOp; - -use PhpParser\Node\Expr\AssignOp; - -class Minus extends AssignOp -{ - public function getType() : string { - return 'Expr_AssignOp_Minus'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mod.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mod.php deleted file mode 100644 index be3b4a0a..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mod.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\AssignOp; - -use PhpParser\Node\Expr\AssignOp; - -class Mod extends AssignOp -{ - public function getType() : string { - return 'Expr_AssignOp_Mod'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mul.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mul.php deleted file mode 100644 index 5c196c3b..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mul.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\AssignOp; - -use PhpParser\Node\Expr\AssignOp; - -class Mul extends AssignOp -{ - public function getType() : string { - return 'Expr_AssignOp_Mul'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Plus.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Plus.php deleted file mode 100644 index dd101c61..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Plus.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\AssignOp; - -use PhpParser\Node\Expr\AssignOp; - -class Plus extends AssignOp -{ - public function getType() : string { - return 'Expr_AssignOp_Plus'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Pow.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Pow.php deleted file mode 100644 index 5e1307d1..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Pow.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\AssignOp; - -use PhpParser\Node\Expr\AssignOp; - -class Pow extends AssignOp -{ - public function getType() : string { - return 'Expr_AssignOp_Pow'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftLeft.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftLeft.php deleted file mode 100644 index b8f88269..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftLeft.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\AssignOp; - -use PhpParser\Node\Expr\AssignOp; - -class ShiftLeft extends AssignOp -{ - public function getType() : string { - return 'Expr_AssignOp_ShiftLeft'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftRight.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftRight.php deleted file mode 100644 index e0cc67b7..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftRight.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\AssignOp; - -use PhpParser\Node\Expr\AssignOp; - -class ShiftRight extends AssignOp -{ - public function getType() : string { - return 'Expr_AssignOp_ShiftRight'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignRef.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignRef.php deleted file mode 100644 index de3c644c..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignRef.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; - -class AssignRef extends Expr -{ - /** @var Expr Variable reference is assigned to */ - public $var; - /** @var Expr Variable which is referenced */ - public $expr; - - /** - * Constructs an assignment node. - * - * @param Expr $var Variable - * @param Expr $expr Expression - * @param array $attributes Additional attributes - */ - public function __construct(Expr $var, Expr $expr, array $attributes = []) { - $this->attributes = $attributes; - $this->var = $var; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['var', 'expr']; - } - - public function getType() : string { - return 'Expr_AssignRef'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp.php deleted file mode 100644 index d9c582b0..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; - -abstract class BinaryOp extends Expr -{ - /** @var Expr The left hand side expression */ - public $left; - /** @var Expr The right hand side expression */ - public $right; - - /** - * Constructs a binary operator node. - * - * @param Expr $left The left hand side expression - * @param Expr $right The right hand side expression - * @param array $attributes Additional attributes - */ - public function __construct(Expr $left, Expr $right, array $attributes = []) { - $this->attributes = $attributes; - $this->left = $left; - $this->right = $right; - } - - public function getSubNodeNames() : array { - return ['left', 'right']; - } - - /** - * Get the operator sigil for this binary operation. - * - * In the case there are multiple possible sigils for an operator, this method does not - * necessarily return the one used in the parsed code. - * - * @return string - */ - abstract public function getOperatorSigil() : string; -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php deleted file mode 100644 index d907393b..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\BinaryOp; - -use PhpParser\Node\Expr\BinaryOp; - -class BitwiseAnd extends BinaryOp -{ - public function getOperatorSigil() : string { - return '&'; - } - - public function getType() : string { - return 'Expr_BinaryOp_BitwiseAnd'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseOr.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseOr.php deleted file mode 100644 index d92069f3..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseOr.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\BinaryOp; - -use PhpParser\Node\Expr\BinaryOp; - -class BitwiseOr extends BinaryOp -{ - public function getOperatorSigil() : string { - return '|'; - } - - public function getType() : string { - return 'Expr_BinaryOp_BitwiseOr'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseXor.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseXor.php deleted file mode 100644 index 40fa94f8..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseXor.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\BinaryOp; - -use PhpParser\Node\Expr\BinaryOp; - -class BitwiseXor extends BinaryOp -{ - public function getOperatorSigil() : string { - return '^'; - } - - public function getType() : string { - return 'Expr_BinaryOp_BitwiseXor'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanAnd.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanAnd.php deleted file mode 100644 index 4c3c9e9b..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanAnd.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\BinaryOp; - -use PhpParser\Node\Expr\BinaryOp; - -class BooleanAnd extends BinaryOp -{ - public function getOperatorSigil() : string { - return '&&'; - } - - public function getType() : string { - return 'Expr_BinaryOp_BooleanAnd'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanOr.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanOr.php deleted file mode 100644 index 5ad41727..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanOr.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\BinaryOp; - -use PhpParser\Node\Expr\BinaryOp; - -class BooleanOr extends BinaryOp -{ - public function getOperatorSigil() : string { - return '||'; - } - - public function getType() : string { - return 'Expr_BinaryOp_BooleanOr'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Coalesce.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Coalesce.php deleted file mode 100644 index b8cf6f45..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Coalesce.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\BinaryOp; - -use PhpParser\Node\Expr\BinaryOp; - -class Coalesce extends BinaryOp -{ - public function getOperatorSigil() : string { - return '??'; - } - - public function getType() : string { - return 'Expr_BinaryOp_Coalesce'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Concat.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Concat.php deleted file mode 100644 index 9a8d9873..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Concat.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\BinaryOp; - -use PhpParser\Node\Expr\BinaryOp; - -class Concat extends BinaryOp -{ - public function getOperatorSigil() : string { - return '.'; - } - - public function getType() : string { - return 'Expr_BinaryOp_Concat'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Div.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Div.php deleted file mode 100644 index d38df0db..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Div.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\BinaryOp; - -use PhpParser\Node\Expr\BinaryOp; - -class Div extends BinaryOp -{ - public function getOperatorSigil() : string { - return '/'; - } - - public function getType() : string { - return 'Expr_BinaryOp_Div'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Equal.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Equal.php deleted file mode 100644 index e7b11dc8..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Equal.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\BinaryOp; - -use PhpParser\Node\Expr\BinaryOp; - -class Equal extends BinaryOp -{ - public function getOperatorSigil() : string { - return '=='; - } - - public function getType() : string { - return 'Expr_BinaryOp_Equal'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Greater.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Greater.php deleted file mode 100644 index da01f7a1..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Greater.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\BinaryOp; - -use PhpParser\Node\Expr\BinaryOp; - -class Greater extends BinaryOp -{ - public function getOperatorSigil() : string { - return '>'; - } - - public function getType() : string { - return 'Expr_BinaryOp_Greater'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php deleted file mode 100644 index d677502c..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\BinaryOp; - -use PhpParser\Node\Expr\BinaryOp; - -class GreaterOrEqual extends BinaryOp -{ - public function getOperatorSigil() : string { - return '>='; - } - - public function getType() : string { - return 'Expr_BinaryOp_GreaterOrEqual'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Identical.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Identical.php deleted file mode 100644 index 3d96285c..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Identical.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\BinaryOp; - -use PhpParser\Node\Expr\BinaryOp; - -class Identical extends BinaryOp -{ - public function getOperatorSigil() : string { - return '==='; - } - - public function getType() : string { - return 'Expr_BinaryOp_Identical'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalAnd.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalAnd.php deleted file mode 100644 index 2a3afd54..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalAnd.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\BinaryOp; - -use PhpParser\Node\Expr\BinaryOp; - -class LogicalAnd extends BinaryOp -{ - public function getOperatorSigil() : string { - return 'and'; - } - - public function getType() : string { - return 'Expr_BinaryOp_LogicalAnd'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalOr.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalOr.php deleted file mode 100644 index 21507dba..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalOr.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\BinaryOp; - -use PhpParser\Node\Expr\BinaryOp; - -class LogicalOr extends BinaryOp -{ - public function getOperatorSigil() : string { - return 'or'; - } - - public function getType() : string { - return 'Expr_BinaryOp_LogicalOr'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalXor.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalXor.php deleted file mode 100644 index 261c6a91..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalXor.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\BinaryOp; - -use PhpParser\Node\Expr\BinaryOp; - -class LogicalXor extends BinaryOp -{ - public function getOperatorSigil() : string { - return 'xor'; - } - - public function getType() : string { - return 'Expr_BinaryOp_LogicalXor'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Minus.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Minus.php deleted file mode 100644 index 54b3c6e9..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Minus.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\BinaryOp; - -use PhpParser\Node\Expr\BinaryOp; - -class Minus extends BinaryOp -{ - public function getOperatorSigil() : string { - return '-'; - } - - public function getType() : string { - return 'Expr_BinaryOp_Minus'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mod.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mod.php deleted file mode 100644 index 10340404..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mod.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\BinaryOp; - -use PhpParser\Node\Expr\BinaryOp; - -class Mod extends BinaryOp -{ - public function getOperatorSigil() : string { - return '%'; - } - - public function getType() : string { - return 'Expr_BinaryOp_Mod'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mul.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mul.php deleted file mode 100644 index b82d0b2f..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mul.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\BinaryOp; - -use PhpParser\Node\Expr\BinaryOp; - -class Mul extends BinaryOp -{ - public function getOperatorSigil() : string { - return '*'; - } - - public function getType() : string { - return 'Expr_BinaryOp_Mul'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotEqual.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotEqual.php deleted file mode 100644 index 51075da5..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotEqual.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\BinaryOp; - -use PhpParser\Node\Expr\BinaryOp; - -class NotEqual extends BinaryOp -{ - public function getOperatorSigil() : string { - return '!='; - } - - public function getType() : string { - return 'Expr_BinaryOp_NotEqual'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotIdentical.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotIdentical.php deleted file mode 100644 index fa4050e0..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotIdentical.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\BinaryOp; - -use PhpParser\Node\Expr\BinaryOp; - -class NotIdentical extends BinaryOp -{ - public function getOperatorSigil() : string { - return '!=='; - } - - public function getType() : string { - return 'Expr_BinaryOp_NotIdentical'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Plus.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Plus.php deleted file mode 100644 index 62f02299..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Plus.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\BinaryOp; - -use PhpParser\Node\Expr\BinaryOp; - -class Plus extends BinaryOp -{ - public function getOperatorSigil() : string { - return '+'; - } - - public function getType() : string { - return 'Expr_BinaryOp_Plus'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Pow.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Pow.php deleted file mode 100644 index 572a1e8e..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Pow.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\BinaryOp; - -use PhpParser\Node\Expr\BinaryOp; - -class Pow extends BinaryOp -{ - public function getOperatorSigil() : string { - return '**'; - } - - public function getType() : string { - return 'Expr_BinaryOp_Pow'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftLeft.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftLeft.php deleted file mode 100644 index 4e70b4ef..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftLeft.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\BinaryOp; - -use PhpParser\Node\Expr\BinaryOp; - -class ShiftLeft extends BinaryOp -{ - public function getOperatorSigil() : string { - return '<<'; - } - - public function getType() : string { - return 'Expr_BinaryOp_ShiftLeft'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftRight.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftRight.php deleted file mode 100644 index 45acbd04..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftRight.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\BinaryOp; - -use PhpParser\Node\Expr\BinaryOp; - -class ShiftRight extends BinaryOp -{ - public function getOperatorSigil() : string { - return '>>'; - } - - public function getType() : string { - return 'Expr_BinaryOp_ShiftRight'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Smaller.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Smaller.php deleted file mode 100644 index 3cb8e7e0..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Smaller.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\BinaryOp; - -use PhpParser\Node\Expr\BinaryOp; - -class Smaller extends BinaryOp -{ - public function getOperatorSigil() : string { - return '<'; - } - - public function getType() : string { - return 'Expr_BinaryOp_Smaller'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/SmallerOrEqual.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/SmallerOrEqual.php deleted file mode 100644 index 83e8e214..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/SmallerOrEqual.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\BinaryOp; - -use PhpParser\Node\Expr\BinaryOp; - -class SmallerOrEqual extends BinaryOp -{ - public function getOperatorSigil() : string { - return '<='; - } - - public function getType() : string { - return 'Expr_BinaryOp_SmallerOrEqual'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Spaceship.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Spaceship.php deleted file mode 100644 index 8c6d787f..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Spaceship.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\BinaryOp; - -use PhpParser\Node\Expr\BinaryOp; - -class Spaceship extends BinaryOp -{ - public function getOperatorSigil() : string { - return '<=>'; - } - - public function getType() : string { - return 'Expr_BinaryOp_Spaceship'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BitwiseNot.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BitwiseNot.php deleted file mode 100644 index ed44984b..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BitwiseNot.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; - -class BitwiseNot extends Expr -{ - /** @var Expr Expression */ - public $expr; - - /** - * Constructs a bitwise not node. - * - * @param Expr $expr Expression - * @param array $attributes Additional attributes - */ - public function __construct(Expr $expr, array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['expr']; - } - - public function getType() : string { - return 'Expr_BitwiseNot'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BooleanNot.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BooleanNot.php deleted file mode 100644 index bf27e9f6..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BooleanNot.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; - -class BooleanNot extends Expr -{ - /** @var Expr Expression */ - public $expr; - - /** - * Constructs a boolean not node. - * - * @param Expr $expr Expression - * @param array $attributes Additional attributes - */ - public function __construct(Expr $expr, array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['expr']; - } - - public function getType() : string { - return 'Expr_BooleanNot'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/CallLike.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/CallLike.php deleted file mode 100644 index 78e1cf34..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/CallLike.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Arg; -use PhpParser\Node\Expr; -use PhpParser\Node\VariadicPlaceholder; - -abstract class CallLike extends Expr { - /** - * Return raw arguments, which may be actual Args, or VariadicPlaceholders for first-class - * callables. - * - * @return array<Arg|VariadicPlaceholder> - */ - abstract public function getRawArgs(): array; - - /** - * Returns whether this call expression is actually a first class callable. - */ - public function isFirstClassCallable(): bool { - foreach ($this->getRawArgs() as $arg) { - if ($arg instanceof VariadicPlaceholder) { - return true; - } - } - return false; - } - - /** - * Assert that this is not a first-class callable and return only ordinary Args. - * - * @return Arg[] - */ - public function getArgs(): array { - assert(!$this->isFirstClassCallable()); - return $this->getRawArgs(); - } -} \ No newline at end of file diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast.php deleted file mode 100644 index 36769d4f..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; - -abstract class Cast extends Expr -{ - /** @var Expr Expression */ - public $expr; - - /** - * Constructs a cast node. - * - * @param Expr $expr Expression - * @param array $attributes Additional attributes - */ - public function __construct(Expr $expr, array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['expr']; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Array_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Array_.php deleted file mode 100644 index 57cc473b..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Array_.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\Cast; - -use PhpParser\Node\Expr\Cast; - -class Array_ extends Cast -{ - public function getType() : string { - return 'Expr_Cast_Array'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Bool_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Bool_.php deleted file mode 100644 index 04eb4af5..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Bool_.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\Cast; - -use PhpParser\Node\Expr\Cast; - -class Bool_ extends Cast -{ - public function getType() : string { - return 'Expr_Cast_Bool'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Double.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Double.php deleted file mode 100644 index 891ba5f8..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Double.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\Cast; - -use PhpParser\Node\Expr\Cast; - -class Double extends Cast -{ - // For use in "kind" attribute - const KIND_DOUBLE = 1; // "double" syntax - const KIND_FLOAT = 2; // "float" syntax - const KIND_REAL = 3; // "real" syntax - - public function getType() : string { - return 'Expr_Cast_Double'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Int_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Int_.php deleted file mode 100644 index 01ed594b..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Int_.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\Cast; - -use PhpParser\Node\Expr\Cast; - -class Int_ extends Cast -{ - public function getType() : string { - return 'Expr_Cast_Int'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Object_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Object_.php deleted file mode 100644 index 163752be..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Object_.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\Cast; - -use PhpParser\Node\Expr\Cast; - -class Object_ extends Cast -{ - public function getType() : string { - return 'Expr_Cast_Object'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/String_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/String_.php deleted file mode 100644 index b3d99270..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/String_.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\Cast; - -use PhpParser\Node\Expr\Cast; - -class String_ extends Cast -{ - public function getType() : string { - return 'Expr_Cast_String'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Unset_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Unset_.php deleted file mode 100644 index accda3e4..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Unset_.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr\Cast; - -use PhpParser\Node\Expr\Cast; - -class Unset_ extends Cast -{ - public function getType() : string { - return 'Expr_Cast_Unset'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClassConstFetch.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClassConstFetch.php deleted file mode 100644 index faf832f9..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClassConstFetch.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; -use PhpParser\Node\Identifier; -use PhpParser\Node\Name; - -class ClassConstFetch extends Expr -{ - /** @var Name|Expr Class name */ - public $class; - /** @var Identifier|Error Constant name */ - public $name; - - /** - * Constructs a class const fetch node. - * - * @param Name|Expr $class Class name - * @param string|Identifier|Error $name Constant name - * @param array $attributes Additional attributes - */ - public function __construct($class, $name, array $attributes = []) { - $this->attributes = $attributes; - $this->class = $class; - $this->name = \is_string($name) ? new Identifier($name) : $name; - } - - public function getSubNodeNames() : array { - return ['class', 'name']; - } - - public function getType() : string { - return 'Expr_ClassConstFetch'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Clone_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Clone_.php deleted file mode 100644 index db216b8f..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Clone_.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; - -class Clone_ extends Expr -{ - /** @var Expr Expression */ - public $expr; - - /** - * Constructs a clone node. - * - * @param Expr $expr Expression - * @param array $attributes Additional attributes - */ - public function __construct(Expr $expr, array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['expr']; - } - - public function getType() : string { - return 'Expr_Clone'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php deleted file mode 100644 index 56ddea6a..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php +++ /dev/null @@ -1,79 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node; -use PhpParser\Node\Expr; -use PhpParser\Node\FunctionLike; - -class Closure extends Expr implements FunctionLike -{ - /** @var bool Whether the closure is static */ - public $static; - /** @var bool Whether to return by reference */ - public $byRef; - /** @var Node\Param[] Parameters */ - public $params; - /** @var ClosureUse[] use()s */ - public $uses; - /** @var null|Node\Identifier|Node\Name|Node\ComplexType Return type */ - public $returnType; - /** @var Node\Stmt[] Statements */ - public $stmts; - /** @var Node\AttributeGroup[] PHP attribute groups */ - public $attrGroups; - - /** - * Constructs a lambda function node. - * - * @param array $subNodes Array of the following optional subnodes: - * 'static' => false : Whether the closure is static - * 'byRef' => false : Whether to return by reference - * 'params' => array(): Parameters - * 'uses' => array(): use()s - * 'returnType' => null : Return type - * 'stmts' => array(): Statements - * 'attrGroups' => array(): PHP attributes groups - * @param array $attributes Additional attributes - */ - public function __construct(array $subNodes = [], array $attributes = []) { - $this->attributes = $attributes; - $this->static = $subNodes['static'] ?? false; - $this->byRef = $subNodes['byRef'] ?? false; - $this->params = $subNodes['params'] ?? []; - $this->uses = $subNodes['uses'] ?? []; - $returnType = $subNodes['returnType'] ?? null; - $this->returnType = \is_string($returnType) ? new Node\Identifier($returnType) : $returnType; - $this->stmts = $subNodes['stmts'] ?? []; - $this->attrGroups = $subNodes['attrGroups'] ?? []; - } - - public function getSubNodeNames() : array { - return ['attrGroups', 'static', 'byRef', 'params', 'uses', 'returnType', 'stmts']; - } - - public function returnsByRef() : bool { - return $this->byRef; - } - - public function getParams() : array { - return $this->params; - } - - public function getReturnType() { - return $this->returnType; - } - - /** @return Node\Stmt[] */ - public function getStmts() : array { - return $this->stmts; - } - - public function getAttrGroups() : array { - return $this->attrGroups; - } - - public function getType() : string { - return 'Expr_Closure'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClosureUse.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClosureUse.php deleted file mode 100644 index 2b8a0966..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClosureUse.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; - -class ClosureUse extends Expr -{ - /** @var Expr\Variable Variable to use */ - public $var; - /** @var bool Whether to use by reference */ - public $byRef; - - /** - * Constructs a closure use node. - * - * @param Expr\Variable $var Variable to use - * @param bool $byRef Whether to use by reference - * @param array $attributes Additional attributes - */ - public function __construct(Expr\Variable $var, bool $byRef = false, array $attributes = []) { - $this->attributes = $attributes; - $this->var = $var; - $this->byRef = $byRef; - } - - public function getSubNodeNames() : array { - return ['var', 'byRef']; - } - - public function getType() : string { - return 'Expr_ClosureUse'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ConstFetch.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ConstFetch.php deleted file mode 100644 index 14ebd16b..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ConstFetch.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; -use PhpParser\Node\Name; - -class ConstFetch extends Expr -{ - /** @var Name Constant name */ - public $name; - - /** - * Constructs a const fetch node. - * - * @param Name $name Constant name - * @param array $attributes Additional attributes - */ - public function __construct(Name $name, array $attributes = []) { - $this->attributes = $attributes; - $this->name = $name; - } - - public function getSubNodeNames() : array { - return ['name']; - } - - public function getType() : string { - return 'Expr_ConstFetch'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Empty_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Empty_.php deleted file mode 100644 index 4042ec93..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Empty_.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; - -class Empty_ extends Expr -{ - /** @var Expr Expression */ - public $expr; - - /** - * Constructs an empty() node. - * - * @param Expr $expr Expression - * @param array $attributes Additional attributes - */ - public function __construct(Expr $expr, array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['expr']; - } - - public function getType() : string { - return 'Expr_Empty'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php deleted file mode 100644 index 1637f3ae..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; - -/** - * Error node used during parsing with error recovery. - * - * An error node may be placed at a position where an expression is required, but an error occurred. - * Error nodes will not be present if the parser is run in throwOnError mode (the default). - */ -class Error extends Expr -{ - /** - * Constructs an error node. - * - * @param array $attributes Additional attributes - */ - public function __construct(array $attributes = []) { - $this->attributes = $attributes; - } - - public function getSubNodeNames() : array { - return []; - } - - public function getType() : string { - return 'Expr_Error'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ErrorSuppress.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ErrorSuppress.php deleted file mode 100644 index c44ff6f9..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ErrorSuppress.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; - -class ErrorSuppress extends Expr -{ - /** @var Expr Expression */ - public $expr; - - /** - * Constructs an error suppress node. - * - * @param Expr $expr Expression - * @param array $attributes Additional attributes - */ - public function __construct(Expr $expr, array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['expr']; - } - - public function getType() : string { - return 'Expr_ErrorSuppress'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Eval_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Eval_.php deleted file mode 100644 index 85685474..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Eval_.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; - -class Eval_ extends Expr -{ - /** @var Expr Expression */ - public $expr; - - /** - * Constructs an eval() node. - * - * @param Expr $expr Expression - * @param array $attributes Additional attributes - */ - public function __construct(Expr $expr, array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['expr']; - } - - public function getType() : string { - return 'Expr_Eval'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php deleted file mode 100644 index b88a8f7e..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; - -class Exit_ extends Expr -{ - /* For use in "kind" attribute */ - const KIND_EXIT = 1; - const KIND_DIE = 2; - - /** @var null|Expr Expression */ - public $expr; - - /** - * Constructs an exit() node. - * - * @param null|Expr $expr Expression - * @param array $attributes Additional attributes - */ - public function __construct(Expr $expr = null, array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['expr']; - } - - public function getType() : string { - return 'Expr_Exit'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php deleted file mode 100644 index 2de4d0dd..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node; -use PhpParser\Node\Expr; - -class FuncCall extends CallLike -{ - /** @var Node\Name|Expr Function name */ - public $name; - /** @var array<Node\Arg|Node\VariadicPlaceholder> Arguments */ - public $args; - - /** - * Constructs a function call node. - * - * @param Node\Name|Expr $name Function name - * @param array<Node\Arg|Node\VariadicPlaceholder> $args Arguments - * @param array $attributes Additional attributes - */ - public function __construct($name, array $args = [], array $attributes = []) { - $this->attributes = $attributes; - $this->name = $name; - $this->args = $args; - } - - public function getSubNodeNames() : array { - return ['name', 'args']; - } - - public function getType() : string { - return 'Expr_FuncCall'; - } - - public function getRawArgs(): array { - return $this->args; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Include_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Include_.php deleted file mode 100644 index 07ce5968..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Include_.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; - -class Include_ extends Expr -{ - const TYPE_INCLUDE = 1; - const TYPE_INCLUDE_ONCE = 2; - const TYPE_REQUIRE = 3; - const TYPE_REQUIRE_ONCE = 4; - - /** @var Expr Expression */ - public $expr; - /** @var int Type of include */ - public $type; - - /** - * Constructs an include node. - * - * @param Expr $expr Expression - * @param int $type Type of include - * @param array $attributes Additional attributes - */ - public function __construct(Expr $expr, int $type, array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - $this->type = $type; - } - - public function getSubNodeNames() : array { - return ['expr', 'type']; - } - - public function getType() : string { - return 'Expr_Include'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Instanceof_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Instanceof_.php deleted file mode 100644 index 9000d47b..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Instanceof_.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; -use PhpParser\Node\Name; - -class Instanceof_ extends Expr -{ - /** @var Expr Expression */ - public $expr; - /** @var Name|Expr Class name */ - public $class; - - /** - * Constructs an instanceof check node. - * - * @param Expr $expr Expression - * @param Name|Expr $class Class name - * @param array $attributes Additional attributes - */ - public function __construct(Expr $expr, $class, array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - $this->class = $class; - } - - public function getSubNodeNames() : array { - return ['expr', 'class']; - } - - public function getType() : string { - return 'Expr_Instanceof'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Isset_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Isset_.php deleted file mode 100644 index 76b73875..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Isset_.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; - -class Isset_ extends Expr -{ - /** @var Expr[] Variables */ - public $vars; - - /** - * Constructs an array node. - * - * @param Expr[] $vars Variables - * @param array $attributes Additional attributes - */ - public function __construct(array $vars, array $attributes = []) { - $this->attributes = $attributes; - $this->vars = $vars; - } - - public function getSubNodeNames() : array { - return ['vars']; - } - - public function getType() : string { - return 'Expr_Isset'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/List_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/List_.php deleted file mode 100644 index c27a27b9..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/List_.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; - -class List_ extends Expr -{ - /** @var (ArrayItem|null)[] List of items to assign to */ - public $items; - - /** - * Constructs a list() destructuring node. - * - * @param (ArrayItem|null)[] $items List of items to assign to - * @param array $attributes Additional attributes - */ - public function __construct(array $items, array $attributes = []) { - $this->attributes = $attributes; - $this->items = $items; - } - - public function getSubNodeNames() : array { - return ['items']; - } - - public function getType() : string { - return 'Expr_List'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Match_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Match_.php deleted file mode 100644 index 2455a302..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Match_.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node; -use PhpParser\Node\MatchArm; - -class Match_ extends Node\Expr -{ - /** @var Node\Expr */ - public $cond; - /** @var MatchArm[] */ - public $arms; - - /** - * @param MatchArm[] $arms - */ - public function __construct(Node\Expr $cond, array $arms = [], array $attributes = []) { - $this->attributes = $attributes; - $this->cond = $cond; - $this->arms = $arms; - } - - public function getSubNodeNames() : array { - return ['cond', 'arms']; - } - - public function getType() : string { - return 'Expr_Match'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.php deleted file mode 100644 index 49ca4835..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Arg; -use PhpParser\Node\Expr; -use PhpParser\Node\Identifier; -use PhpParser\Node\VariadicPlaceholder; - -class MethodCall extends CallLike -{ - /** @var Expr Variable holding object */ - public $var; - /** @var Identifier|Expr Method name */ - public $name; - /** @var array<Arg|VariadicPlaceholder> Arguments */ - public $args; - - /** - * Constructs a function call node. - * - * @param Expr $var Variable holding object - * @param string|Identifier|Expr $name Method name - * @param array<Arg|VariadicPlaceholder> $args Arguments - * @param array $attributes Additional attributes - */ - public function __construct(Expr $var, $name, array $args = [], array $attributes = []) { - $this->attributes = $attributes; - $this->var = $var; - $this->name = \is_string($name) ? new Identifier($name) : $name; - $this->args = $args; - } - - public function getSubNodeNames() : array { - return ['var', 'name', 'args']; - } - - public function getType() : string { - return 'Expr_MethodCall'; - } - - public function getRawArgs(): array { - return $this->args; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php deleted file mode 100644 index e2bb6492..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node; -use PhpParser\Node\Arg; -use PhpParser\Node\Expr; -use PhpParser\Node\VariadicPlaceholder; - -class New_ extends CallLike -{ - /** @var Node\Name|Expr|Node\Stmt\Class_ Class name */ - public $class; - /** @var array<Arg|VariadicPlaceholder> Arguments */ - public $args; - - /** - * Constructs a function call node. - * - * @param Node\Name|Expr|Node\Stmt\Class_ $class Class name (or class node for anonymous classes) - * @param array<Arg|VariadicPlaceholder> $args Arguments - * @param array $attributes Additional attributes - */ - public function __construct($class, array $args = [], array $attributes = []) { - $this->attributes = $attributes; - $this->class = $class; - $this->args = $args; - } - - public function getSubNodeNames() : array { - return ['class', 'args']; - } - - public function getType() : string { - return 'Expr_New'; - } - - public function getRawArgs(): array { - return $this->args; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafeMethodCall.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafeMethodCall.php deleted file mode 100644 index 07a571fd..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafeMethodCall.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Arg; -use PhpParser\Node\Expr; -use PhpParser\Node\Identifier; -use PhpParser\Node\VariadicPlaceholder; - -class NullsafeMethodCall extends CallLike -{ - /** @var Expr Variable holding object */ - public $var; - /** @var Identifier|Expr Method name */ - public $name; - /** @var array<Arg|VariadicPlaceholder> Arguments */ - public $args; - - /** - * Constructs a nullsafe method call node. - * - * @param Expr $var Variable holding object - * @param string|Identifier|Expr $name Method name - * @param array<Arg|VariadicPlaceholder> $args Arguments - * @param array $attributes Additional attributes - */ - public function __construct(Expr $var, $name, array $args = [], array $attributes = []) { - $this->attributes = $attributes; - $this->var = $var; - $this->name = \is_string($name) ? new Identifier($name) : $name; - $this->args = $args; - } - - public function getSubNodeNames() : array { - return ['var', 'name', 'args']; - } - - public function getType() : string { - return 'Expr_NullsafeMethodCall'; - } - - public function getRawArgs(): array { - return $this->args; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafePropertyFetch.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafePropertyFetch.php deleted file mode 100644 index 9317eb3b..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafePropertyFetch.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; -use PhpParser\Node\Identifier; - -class NullsafePropertyFetch extends Expr -{ - /** @var Expr Variable holding object */ - public $var; - /** @var Identifier|Expr Property name */ - public $name; - - /** - * Constructs a nullsafe property fetch node. - * - * @param Expr $var Variable holding object - * @param string|Identifier|Expr $name Property name - * @param array $attributes Additional attributes - */ - public function __construct(Expr $var, $name, array $attributes = []) { - $this->attributes = $attributes; - $this->var = $var; - $this->name = \is_string($name) ? new Identifier($name) : $name; - } - - public function getSubNodeNames() : array { - return ['var', 'name']; - } - - public function getType() : string { - return 'Expr_NullsafePropertyFetch'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostDec.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostDec.php deleted file mode 100644 index 94d6c296..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostDec.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; - -class PostDec extends Expr -{ - /** @var Expr Variable */ - public $var; - - /** - * Constructs a post decrement node. - * - * @param Expr $var Variable - * @param array $attributes Additional attributes - */ - public function __construct(Expr $var, array $attributes = []) { - $this->attributes = $attributes; - $this->var = $var; - } - - public function getSubNodeNames() : array { - return ['var']; - } - - public function getType() : string { - return 'Expr_PostDec'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostInc.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostInc.php deleted file mode 100644 index 005c443a..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostInc.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; - -class PostInc extends Expr -{ - /** @var Expr Variable */ - public $var; - - /** - * Constructs a post increment node. - * - * @param Expr $var Variable - * @param array $attributes Additional attributes - */ - public function __construct(Expr $var, array $attributes = []) { - $this->attributes = $attributes; - $this->var = $var; - } - - public function getSubNodeNames() : array { - return ['var']; - } - - public function getType() : string { - return 'Expr_PostInc'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreDec.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreDec.php deleted file mode 100644 index a5ca685a..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreDec.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; - -class PreDec extends Expr -{ - /** @var Expr Variable */ - public $var; - - /** - * Constructs a pre decrement node. - * - * @param Expr $var Variable - * @param array $attributes Additional attributes - */ - public function __construct(Expr $var, array $attributes = []) { - $this->attributes = $attributes; - $this->var = $var; - } - - public function getSubNodeNames() : array { - return ['var']; - } - - public function getType() : string { - return 'Expr_PreDec'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.php deleted file mode 100644 index 0986c447..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; - -class PreInc extends Expr -{ - /** @var Expr Variable */ - public $var; - - /** - * Constructs a pre increment node. - * - * @param Expr $var Variable - * @param array $attributes Additional attributes - */ - public function __construct(Expr $var, array $attributes = []) { - $this->attributes = $attributes; - $this->var = $var; - } - - public function getSubNodeNames() : array { - return ['var']; - } - - public function getType() : string { - return 'Expr_PreInc'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Print_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Print_.php deleted file mode 100644 index 2d43c2ac..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Print_.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; - -class Print_ extends Expr -{ - /** @var Expr Expression */ - public $expr; - - /** - * Constructs an print() node. - * - * @param Expr $expr Expression - * @param array $attributes Additional attributes - */ - public function __construct(Expr $expr, array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['expr']; - } - - public function getType() : string { - return 'Expr_Print'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PropertyFetch.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PropertyFetch.php deleted file mode 100644 index 4281f31c..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PropertyFetch.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; -use PhpParser\Node\Identifier; - -class PropertyFetch extends Expr -{ - /** @var Expr Variable holding object */ - public $var; - /** @var Identifier|Expr Property name */ - public $name; - - /** - * Constructs a function call node. - * - * @param Expr $var Variable holding object - * @param string|Identifier|Expr $name Property name - * @param array $attributes Additional attributes - */ - public function __construct(Expr $var, $name, array $attributes = []) { - $this->attributes = $attributes; - $this->var = $var; - $this->name = \is_string($name) ? new Identifier($name) : $name; - } - - public function getSubNodeNames() : array { - return ['var', 'name']; - } - - public function getType() : string { - return 'Expr_PropertyFetch'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ShellExec.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ShellExec.php deleted file mode 100644 index 537a7cc8..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ShellExec.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; - -class ShellExec extends Expr -{ - /** @var array Encapsed string array */ - public $parts; - - /** - * Constructs a shell exec (backtick) node. - * - * @param array $parts Encapsed string array - * @param array $attributes Additional attributes - */ - public function __construct(array $parts, array $attributes = []) { - $this->attributes = $attributes; - $this->parts = $parts; - } - - public function getSubNodeNames() : array { - return ['parts']; - } - - public function getType() : string { - return 'Expr_ShellExec'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.php deleted file mode 100644 index d0d099c4..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node; -use PhpParser\Node\Arg; -use PhpParser\Node\Expr; -use PhpParser\Node\Identifier; -use PhpParser\Node\VariadicPlaceholder; - -class StaticCall extends CallLike -{ - /** @var Node\Name|Expr Class name */ - public $class; - /** @var Identifier|Expr Method name */ - public $name; - /** @var array<Arg|VariadicPlaceholder> Arguments */ - public $args; - - /** - * Constructs a static method call node. - * - * @param Node\Name|Expr $class Class name - * @param string|Identifier|Expr $name Method name - * @param array<Arg|VariadicPlaceholder> $args Arguments - * @param array $attributes Additional attributes - */ - public function __construct($class, $name, array $args = [], array $attributes = []) { - $this->attributes = $attributes; - $this->class = $class; - $this->name = \is_string($name) ? new Identifier($name) : $name; - $this->args = $args; - } - - public function getSubNodeNames() : array { - return ['class', 'name', 'args']; - } - - public function getType() : string { - return 'Expr_StaticCall'; - } - - public function getRawArgs(): array { - return $this->args; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.php deleted file mode 100644 index 1ee1a25e..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; -use PhpParser\Node\Name; -use PhpParser\Node\VarLikeIdentifier; - -class StaticPropertyFetch extends Expr -{ - /** @var Name|Expr Class name */ - public $class; - /** @var VarLikeIdentifier|Expr Property name */ - public $name; - - /** - * Constructs a static property fetch node. - * - * @param Name|Expr $class Class name - * @param string|VarLikeIdentifier|Expr $name Property name - * @param array $attributes Additional attributes - */ - public function __construct($class, $name, array $attributes = []) { - $this->attributes = $attributes; - $this->class = $class; - $this->name = \is_string($name) ? new VarLikeIdentifier($name) : $name; - } - - public function getSubNodeNames() : array { - return ['class', 'name']; - } - - public function getType() : string { - return 'Expr_StaticPropertyFetch'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Ternary.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Ternary.php deleted file mode 100644 index 9316f47d..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Ternary.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; - -class Ternary extends Expr -{ - /** @var Expr Condition */ - public $cond; - /** @var null|Expr Expression for true */ - public $if; - /** @var Expr Expression for false */ - public $else; - - /** - * Constructs a ternary operator node. - * - * @param Expr $cond Condition - * @param null|Expr $if Expression for true - * @param Expr $else Expression for false - * @param array $attributes Additional attributes - */ - public function __construct(Expr $cond, $if, Expr $else, array $attributes = []) { - $this->attributes = $attributes; - $this->cond = $cond; - $this->if = $if; - $this->else = $else; - } - - public function getSubNodeNames() : array { - return ['cond', 'if', 'else']; - } - - public function getType() : string { - return 'Expr_Ternary'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Throw_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Throw_.php deleted file mode 100644 index 5c97f0e2..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Throw_.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node; - -class Throw_ extends Node\Expr -{ - /** @var Node\Expr Expression */ - public $expr; - - /** - * Constructs a throw expression node. - * - * @param Node\Expr $expr Expression - * @param array $attributes Additional attributes - */ - public function __construct(Node\Expr $expr, array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['expr']; - } - - public function getType() : string { - return 'Expr_Throw'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryMinus.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryMinus.php deleted file mode 100644 index ce8808bc..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryMinus.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; - -class UnaryMinus extends Expr -{ - /** @var Expr Expression */ - public $expr; - - /** - * Constructs a unary minus node. - * - * @param Expr $expr Expression - * @param array $attributes Additional attributes - */ - public function __construct(Expr $expr, array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['expr']; - } - - public function getType() : string { - return 'Expr_UnaryMinus'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryPlus.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryPlus.php deleted file mode 100644 index d23047e5..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryPlus.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; - -class UnaryPlus extends Expr -{ - /** @var Expr Expression */ - public $expr; - - /** - * Constructs a unary plus node. - * - * @param Expr $expr Expression - * @param array $attributes Additional attributes - */ - public function __construct(Expr $expr, array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['expr']; - } - - public function getType() : string { - return 'Expr_UnaryPlus'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Variable.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Variable.php deleted file mode 100644 index b47d38e9..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Variable.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; - -class Variable extends Expr -{ - /** @var string|Expr Name */ - public $name; - - /** - * Constructs a variable node. - * - * @param string|Expr $name Name - * @param array $attributes Additional attributes - */ - public function __construct($name, array $attributes = []) { - $this->attributes = $attributes; - $this->name = $name; - } - - public function getSubNodeNames() : array { - return ['name']; - } - - public function getType() : string { - return 'Expr_Variable'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/YieldFrom.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/YieldFrom.php deleted file mode 100644 index a3efce61..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/YieldFrom.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; - -class YieldFrom extends Expr -{ - /** @var Expr Expression to yield from */ - public $expr; - - /** - * Constructs an "yield from" node. - * - * @param Expr $expr Expression - * @param array $attributes Additional attributes - */ - public function __construct(Expr $expr, array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['expr']; - } - - public function getType() : string { - return 'Expr_YieldFrom'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php deleted file mode 100644 index aef8fc33..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Expr; - -use PhpParser\Node\Expr; - -class Yield_ extends Expr -{ - /** @var null|Expr Key expression */ - public $key; - /** @var null|Expr Value expression */ - public $value; - - /** - * Constructs a yield expression node. - * - * @param null|Expr $value Value expression - * @param null|Expr $key Key expression - * @param array $attributes Additional attributes - */ - public function __construct(Expr $value = null, Expr $key = null, array $attributes = []) { - $this->attributes = $attributes; - $this->key = $key; - $this->value = $value; - } - - public function getSubNodeNames() : array { - return ['key', 'value']; - } - - public function getType() : string { - return 'Expr_Yield'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/FunctionLike.php b/vendor/nikic/php-parser/lib/PhpParser/Node/FunctionLike.php deleted file mode 100644 index 5a825e73..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/FunctionLike.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node; - -use PhpParser\Node; - -interface FunctionLike extends Node -{ - /** - * Whether to return by reference - * - * @return bool - */ - public function returnsByRef() : bool; - - /** - * List of parameters - * - * @return Param[] - */ - public function getParams() : array; - - /** - * Get the declared return type or null - * - * @return null|Identifier|Name|ComplexType - */ - public function getReturnType(); - - /** - * The function body - * - * @return Stmt[]|null - */ - public function getStmts(); - - /** - * Get PHP attribute groups. - * - * @return AttributeGroup[] - */ - public function getAttrGroups() : array; -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Identifier.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Identifier.php deleted file mode 100644 index 2f262db0..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Identifier.php +++ /dev/null @@ -1,75 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node; - -use PhpParser\NodeAbstract; - -/** - * Represents a non-namespaced name. Namespaced names are represented using Name nodes. - */ -class Identifier extends NodeAbstract -{ - /** @var string Identifier as string */ - public $name; - - private static $specialClassNames = [ - 'self' => true, - 'parent' => true, - 'static' => true, - ]; - - /** - * Constructs an identifier node. - * - * @param string $name Identifier as string - * @param array $attributes Additional attributes - */ - public function __construct(string $name, array $attributes = []) { - $this->attributes = $attributes; - $this->name = $name; - } - - public function getSubNodeNames() : array { - return ['name']; - } - - /** - * Get identifier as string. - * - * @return string Identifier as string. - */ - public function toString() : string { - return $this->name; - } - - /** - * Get lowercased identifier as string. - * - * @return string Lowercased identifier as string - */ - public function toLowerString() : string { - return strtolower($this->name); - } - - /** - * Checks whether the identifier is a special class name (self, parent or static). - * - * @return bool Whether identifier is a special class name - */ - public function isSpecialClassName() : bool { - return isset(self::$specialClassNames[strtolower($this->name)]); - } - - /** - * Get identifier as string. - * - * @return string Identifier as string - */ - public function __toString() : string { - return $this->name; - } - - public function getType() : string { - return 'Identifier'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/IntersectionType.php b/vendor/nikic/php-parser/lib/PhpParser/Node/IntersectionType.php deleted file mode 100644 index 9208e139..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/IntersectionType.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node; - -use PhpParser\NodeAbstract; - -class IntersectionType extends ComplexType -{ - /** @var (Identifier|Name)[] Types */ - public $types; - - /** - * Constructs an intersection type. - * - * @param (Identifier|Name)[] $types Types - * @param array $attributes Additional attributes - */ - public function __construct(array $types, array $attributes = []) { - $this->attributes = $attributes; - $this->types = $types; - } - - public function getSubNodeNames() : array { - return ['types']; - } - - public function getType() : string { - return 'IntersectionType'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/MatchArm.php b/vendor/nikic/php-parser/lib/PhpParser/Node/MatchArm.php deleted file mode 100644 index 2ae1c86b..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/MatchArm.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node; - -use PhpParser\Node; -use PhpParser\NodeAbstract; - -class MatchArm extends NodeAbstract -{ - /** @var null|Node\Expr[] */ - public $conds; - /** @var Node\Expr */ - public $body; - - /** - * @param null|Node\Expr[] $conds - */ - public function __construct($conds, Node\Expr $body, array $attributes = []) { - $this->conds = $conds; - $this->body = $body; - $this->attributes = $attributes; - } - - public function getSubNodeNames() : array { - return ['conds', 'body']; - } - - public function getType() : string { - return 'MatchArm'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php deleted file mode 100644 index 17bd1c0f..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php +++ /dev/null @@ -1,242 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node; - -use PhpParser\NodeAbstract; - -class Name extends NodeAbstract -{ - /** @var string[] Parts of the name */ - public $parts; - - private static $specialClassNames = [ - 'self' => true, - 'parent' => true, - 'static' => true, - ]; - - /** - * Constructs a name node. - * - * @param string|string[]|self $name Name as string, part array or Name instance (copy ctor) - * @param array $attributes Additional attributes - */ - public function __construct($name, array $attributes = []) { - $this->attributes = $attributes; - $this->parts = self::prepareName($name); - } - - public function getSubNodeNames() : array { - return ['parts']; - } - - /** - * Gets the first part of the name, i.e. everything before the first namespace separator. - * - * @return string First part of the name - */ - public function getFirst() : string { - return $this->parts[0]; - } - - /** - * Gets the last part of the name, i.e. everything after the last namespace separator. - * - * @return string Last part of the name - */ - public function getLast() : string { - return $this->parts[count($this->parts) - 1]; - } - - /** - * Checks whether the name is unqualified. (E.g. Name) - * - * @return bool Whether the name is unqualified - */ - public function isUnqualified() : bool { - return 1 === count($this->parts); - } - - /** - * Checks whether the name is qualified. (E.g. Name\Name) - * - * @return bool Whether the name is qualified - */ - public function isQualified() : bool { - return 1 < count($this->parts); - } - - /** - * Checks whether the name is fully qualified. (E.g. \Name) - * - * @return bool Whether the name is fully qualified - */ - public function isFullyQualified() : bool { - return false; - } - - /** - * Checks whether the name is explicitly relative to the current namespace. (E.g. namespace\Name) - * - * @return bool Whether the name is relative - */ - public function isRelative() : bool { - return false; - } - - /** - * Returns a string representation of the name itself, without taking the name type into - * account (e.g., not including a leading backslash for fully qualified names). - * - * @return string String representation - */ - public function toString() : string { - return implode('\\', $this->parts); - } - - /** - * Returns a string representation of the name as it would occur in code (e.g., including - * leading backslash for fully qualified names. - * - * @return string String representation - */ - public function toCodeString() : string { - return $this->toString(); - } - - /** - * Returns lowercased string representation of the name, without taking the name type into - * account (e.g., no leading backslash for fully qualified names). - * - * @return string Lowercased string representation - */ - public function toLowerString() : string { - return strtolower(implode('\\', $this->parts)); - } - - /** - * Checks whether the identifier is a special class name (self, parent or static). - * - * @return bool Whether identifier is a special class name - */ - public function isSpecialClassName() : bool { - return count($this->parts) === 1 - && isset(self::$specialClassNames[strtolower($this->parts[0])]); - } - - /** - * Returns a string representation of the name by imploding the namespace parts with the - * namespace separator. - * - * @return string String representation - */ - public function __toString() : string { - return implode('\\', $this->parts); - } - - /** - * Gets a slice of a name (similar to array_slice). - * - * This method returns a new instance of the same type as the original and with the same - * attributes. - * - * If the slice is empty, null is returned. The null value will be correctly handled in - * concatenations using concat(). - * - * Offset and length have the same meaning as in array_slice(). - * - * @param int $offset Offset to start the slice at (may be negative) - * @param int|null $length Length of the slice (may be negative) - * - * @return static|null Sliced name - */ - public function slice(int $offset, int $length = null) { - $numParts = count($this->parts); - - $realOffset = $offset < 0 ? $offset + $numParts : $offset; - if ($realOffset < 0 || $realOffset > $numParts) { - throw new \OutOfBoundsException(sprintf('Offset %d is out of bounds', $offset)); - } - - if (null === $length) { - $realLength = $numParts - $realOffset; - } else { - $realLength = $length < 0 ? $length + $numParts - $realOffset : $length; - if ($realLength < 0 || $realLength > $numParts - $realOffset) { - throw new \OutOfBoundsException(sprintf('Length %d is out of bounds', $length)); - } - } - - if ($realLength === 0) { - // Empty slice is represented as null - return null; - } - - return new static(array_slice($this->parts, $realOffset, $realLength), $this->attributes); - } - - /** - * Concatenate two names, yielding a new Name instance. - * - * The type of the generated instance depends on which class this method is called on, for - * example Name\FullyQualified::concat() will yield a Name\FullyQualified instance. - * - * If one of the arguments is null, a new instance of the other name will be returned. If both - * arguments are null, null will be returned. As such, writing - * Name::concat($namespace, $shortName) - * where $namespace is a Name node or null will work as expected. - * - * @param string|string[]|self|null $name1 The first name - * @param string|string[]|self|null $name2 The second name - * @param array $attributes Attributes to assign to concatenated name - * - * @return static|null Concatenated name - */ - public static function concat($name1, $name2, array $attributes = []) { - if (null === $name1 && null === $name2) { - return null; - } elseif (null === $name1) { - return new static(self::prepareName($name2), $attributes); - } elseif (null === $name2) { - return new static(self::prepareName($name1), $attributes); - } else { - return new static( - array_merge(self::prepareName($name1), self::prepareName($name2)), $attributes - ); - } - } - - /** - * Prepares a (string, array or Name node) name for use in name changing methods by converting - * it to an array. - * - * @param string|string[]|self $name Name to prepare - * - * @return string[] Prepared name - */ - private static function prepareName($name) : array { - if (\is_string($name)) { - if ('' === $name) { - throw new \InvalidArgumentException('Name cannot be empty'); - } - - return explode('\\', $name); - } elseif (\is_array($name)) { - if (empty($name)) { - throw new \InvalidArgumentException('Name cannot be empty'); - } - - return $name; - } elseif ($name instanceof self) { - return $name->parts; - } - - throw new \InvalidArgumentException( - 'Expected string, array of parts or Name instance' - ); - } - - public function getType() : string { - return 'Name'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php deleted file mode 100644 index 1df93a56..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Name; - -class FullyQualified extends \PhpParser\Node\Name -{ - /** - * Checks whether the name is unqualified. (E.g. Name) - * - * @return bool Whether the name is unqualified - */ - public function isUnqualified() : bool { - return false; - } - - /** - * Checks whether the name is qualified. (E.g. Name\Name) - * - * @return bool Whether the name is qualified - */ - public function isQualified() : bool { - return false; - } - - /** - * Checks whether the name is fully qualified. (E.g. \Name) - * - * @return bool Whether the name is fully qualified - */ - public function isFullyQualified() : bool { - return true; - } - - /** - * Checks whether the name is explicitly relative to the current namespace. (E.g. namespace\Name) - * - * @return bool Whether the name is relative - */ - public function isRelative() : bool { - return false; - } - - public function toCodeString() : string { - return '\\' . $this->toString(); - } - - public function getType() : string { - return 'Name_FullyQualified'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php deleted file mode 100644 index 57bf7af2..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Name; - -class Relative extends \PhpParser\Node\Name -{ - /** - * Checks whether the name is unqualified. (E.g. Name) - * - * @return bool Whether the name is unqualified - */ - public function isUnqualified() : bool { - return false; - } - - /** - * Checks whether the name is qualified. (E.g. Name\Name) - * - * @return bool Whether the name is qualified - */ - public function isQualified() : bool { - return false; - } - - /** - * Checks whether the name is fully qualified. (E.g. \Name) - * - * @return bool Whether the name is fully qualified - */ - public function isFullyQualified() : bool { - return false; - } - - /** - * Checks whether the name is explicitly relative to the current namespace. (E.g. namespace\Name) - * - * @return bool Whether the name is relative - */ - public function isRelative() : bool { - return true; - } - - public function toCodeString() : string { - return 'namespace\\' . $this->toString(); - } - - public function getType() : string { - return 'Name_Relative'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/NullableType.php b/vendor/nikic/php-parser/lib/PhpParser/Node/NullableType.php deleted file mode 100644 index d68e26a3..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/NullableType.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node; - -class NullableType extends ComplexType -{ - /** @var Identifier|Name Type */ - public $type; - - /** - * Constructs a nullable type (wrapping another type). - * - * @param string|Identifier|Name $type Type - * @param array $attributes Additional attributes - */ - public function __construct($type, array $attributes = []) { - $this->attributes = $attributes; - $this->type = \is_string($type) ? new Identifier($type) : $type; - } - - public function getSubNodeNames() : array { - return ['type']; - } - - public function getType() : string { - return 'NullableType'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Param.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Param.php deleted file mode 100644 index 1e90b794..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Param.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node; - -use PhpParser\NodeAbstract; - -class Param extends NodeAbstract -{ - /** @var null|Identifier|Name|ComplexType Type declaration */ - public $type; - /** @var bool Whether parameter is passed by reference */ - public $byRef; - /** @var bool Whether this is a variadic argument */ - public $variadic; - /** @var Expr\Variable|Expr\Error Parameter variable */ - public $var; - /** @var null|Expr Default value */ - public $default; - /** @var int */ - public $flags; - /** @var AttributeGroup[] PHP attribute groups */ - public $attrGroups; - - /** - * Constructs a parameter node. - * - * @param Expr\Variable|Expr\Error $var Parameter variable - * @param null|Expr $default Default value - * @param null|string|Identifier|Name|ComplexType $type Type declaration - * @param bool $byRef Whether is passed by reference - * @param bool $variadic Whether this is a variadic argument - * @param array $attributes Additional attributes - * @param int $flags Optional visibility flags - * @param AttributeGroup[] $attrGroups PHP attribute groups - */ - public function __construct( - $var, Expr $default = null, $type = null, - bool $byRef = false, bool $variadic = false, - array $attributes = [], - int $flags = 0, - array $attrGroups = [] - ) { - $this->attributes = $attributes; - $this->type = \is_string($type) ? new Identifier($type) : $type; - $this->byRef = $byRef; - $this->variadic = $variadic; - $this->var = $var; - $this->default = $default; - $this->flags = $flags; - $this->attrGroups = $attrGroups; - } - - public function getSubNodeNames() : array { - return ['attrGroups', 'flags', 'type', 'byRef', 'variadic', 'var', 'default']; - } - - public function getType() : string { - return 'Param'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar.php deleted file mode 100644 index 8117909b..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar.php +++ /dev/null @@ -1,7 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node; - -abstract class Scalar extends Expr -{ -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/DNumber.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/DNumber.php deleted file mode 100644 index 8a15c6f1..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/DNumber.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Scalar; - -use PhpParser\Node\Scalar; - -class DNumber extends Scalar -{ - /** @var float Number value */ - public $value; - - /** - * Constructs a float number scalar node. - * - * @param float $value Value of the number - * @param array $attributes Additional attributes - */ - public function __construct(float $value, array $attributes = []) { - $this->attributes = $attributes; - $this->value = $value; - } - - public function getSubNodeNames() : array { - return ['value']; - } - - /** - * @param mixed[] $attributes - */ - public static function fromString(string $str, array $attributes = []): DNumber - { - $attributes['rawValue'] = $str; - $float = self::parse($str); - - return new DNumber($float, $attributes); - } - - /** - * @internal - * - * Parses a DNUMBER token like PHP would. - * - * @param string $str A string number - * - * @return float The parsed number - */ - public static function parse(string $str) : float { - $str = str_replace('_', '', $str); - - // Check whether this is one of the special integer notations. - if ('0' === $str[0]) { - // hex - if ('x' === $str[1] || 'X' === $str[1]) { - return hexdec($str); - } - - // bin - if ('b' === $str[1] || 'B' === $str[1]) { - return bindec($str); - } - - // oct, but only if the string does not contain any of '.eE'. - if (false === strpbrk($str, '.eE')) { - // substr($str, 0, strcspn($str, '89')) cuts the string at the first invalid digit - // (8 or 9) so that only the digits before that are used. - return octdec(substr($str, 0, strcspn($str, '89'))); - } - } - - // dec - return (float) $str; - } - - public function getType() : string { - return 'Scalar_DNumber'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Encapsed.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Encapsed.php deleted file mode 100644 index fa5d2e26..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Encapsed.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Scalar; - -use PhpParser\Node\Expr; -use PhpParser\Node\Scalar; - -class Encapsed extends Scalar -{ - /** @var Expr[] list of string parts */ - public $parts; - - /** - * Constructs an encapsed string node. - * - * @param Expr[] $parts Encaps list - * @param array $attributes Additional attributes - */ - public function __construct(array $parts, array $attributes = []) { - $this->attributes = $attributes; - $this->parts = $parts; - } - - public function getSubNodeNames() : array { - return ['parts']; - } - - public function getType() : string { - return 'Scalar_Encapsed'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/EncapsedStringPart.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/EncapsedStringPart.php deleted file mode 100644 index bb3194c1..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/EncapsedStringPart.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Scalar; - -use PhpParser\Node\Scalar; - -class EncapsedStringPart extends Scalar -{ - /** @var string String value */ - public $value; - - /** - * Constructs a node representing a string part of an encapsed string. - * - * @param string $value String value - * @param array $attributes Additional attributes - */ - public function __construct(string $value, array $attributes = []) { - $this->attributes = $attributes; - $this->value = $value; - } - - public function getSubNodeNames() : array { - return ['value']; - } - - public function getType() : string { - return 'Scalar_EncapsedStringPart'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php deleted file mode 100644 index 2cc2b22c..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php +++ /dev/null @@ -1,80 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Scalar; - -use PhpParser\Error; -use PhpParser\Node\Scalar; - -class LNumber extends Scalar -{ - /* For use in "kind" attribute */ - const KIND_BIN = 2; - const KIND_OCT = 8; - const KIND_DEC = 10; - const KIND_HEX = 16; - - /** @var int Number value */ - public $value; - - /** - * Constructs an integer number scalar node. - * - * @param int $value Value of the number - * @param array $attributes Additional attributes - */ - public function __construct(int $value, array $attributes = []) { - $this->attributes = $attributes; - $this->value = $value; - } - - public function getSubNodeNames() : array { - return ['value']; - } - - /** - * Constructs an LNumber node from a string number literal. - * - * @param string $str String number literal (decimal, octal, hex or binary) - * @param array $attributes Additional attributes - * @param bool $allowInvalidOctal Whether to allow invalid octal numbers (PHP 5) - * - * @return LNumber The constructed LNumber, including kind attribute - */ - public static function fromString(string $str, array $attributes = [], bool $allowInvalidOctal = false) : LNumber { - $attributes['rawValue'] = $str; - - $str = str_replace('_', '', $str); - - if ('0' !== $str[0] || '0' === $str) { - $attributes['kind'] = LNumber::KIND_DEC; - return new LNumber((int) $str, $attributes); - } - - if ('x' === $str[1] || 'X' === $str[1]) { - $attributes['kind'] = LNumber::KIND_HEX; - return new LNumber(hexdec($str), $attributes); - } - - if ('b' === $str[1] || 'B' === $str[1]) { - $attributes['kind'] = LNumber::KIND_BIN; - return new LNumber(bindec($str), $attributes); - } - - if (!$allowInvalidOctal && strpbrk($str, '89')) { - throw new Error('Invalid numeric literal', $attributes); - } - - // Strip optional explicit octal prefix. - if ('o' === $str[1] || 'O' === $str[1]) { - $str = substr($str, 2); - } - - // use intval instead of octdec to get proper cutting behavior with malformed numbers - $attributes['kind'] = LNumber::KIND_OCT; - return new LNumber(intval($str, 8), $attributes); - } - - public function getType() : string { - return 'Scalar_LNumber'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst.php deleted file mode 100644 index 941f0c76..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Scalar; - -use PhpParser\Node\Scalar; - -abstract class MagicConst extends Scalar -{ - /** - * Constructs a magic constant node. - * - * @param array $attributes Additional attributes - */ - public function __construct(array $attributes = []) { - $this->attributes = $attributes; - } - - public function getSubNodeNames() : array { - return []; - } - - /** - * Get name of magic constant. - * - * @return string Name of magic constant - */ - abstract public function getName() : string; -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Class_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Class_.php deleted file mode 100644 index 24432847..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Class_.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Scalar\MagicConst; - -use PhpParser\Node\Scalar\MagicConst; - -class Class_ extends MagicConst -{ - public function getName() : string { - return '__CLASS__'; - } - - public function getType() : string { - return 'Scalar_MagicConst_Class'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Dir.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Dir.php deleted file mode 100644 index 2b618473..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Dir.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Scalar\MagicConst; - -use PhpParser\Node\Scalar\MagicConst; - -class Dir extends MagicConst -{ - public function getName() : string { - return '__DIR__'; - } - - public function getType() : string { - return 'Scalar_MagicConst_Dir'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/File.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/File.php deleted file mode 100644 index 3422db06..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/File.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Scalar\MagicConst; - -use PhpParser\Node\Scalar\MagicConst; - -class File extends MagicConst -{ - public function getName() : string { - return '__FILE__'; - } - - public function getType() : string { - return 'Scalar_MagicConst_File'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Function_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Function_.php deleted file mode 100644 index 1db65a15..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Function_.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Scalar\MagicConst; - -use PhpParser\Node\Scalar\MagicConst; - -class Function_ extends MagicConst -{ - public function getName() : string { - return '__FUNCTION__'; - } - - public function getType() : string { - return 'Scalar_MagicConst_Function'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Line.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Line.php deleted file mode 100644 index 25d3de57..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Line.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Scalar\MagicConst; - -use PhpParser\Node\Scalar\MagicConst; - -class Line extends MagicConst -{ - public function getName() : string { - return '__LINE__'; - } - - public function getType() : string { - return 'Scalar_MagicConst_Line'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Method.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Method.php deleted file mode 100644 index d168d56f..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Method.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Scalar\MagicConst; - -use PhpParser\Node\Scalar\MagicConst; - -class Method extends MagicConst -{ - public function getName() : string { - return '__METHOD__'; - } - - public function getType() : string { - return 'Scalar_MagicConst_Method'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Namespace_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Namespace_.php deleted file mode 100644 index 4fabb751..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Namespace_.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Scalar\MagicConst; - -use PhpParser\Node\Scalar\MagicConst; - -class Namespace_ extends MagicConst -{ - public function getName() : string { - return '__NAMESPACE__'; - } - - public function getType() : string { - return 'Scalar_MagicConst_Namespace'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Trait_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Trait_.php deleted file mode 100644 index 5ee7e40a..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Trait_.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Scalar\MagicConst; - -use PhpParser\Node\Scalar\MagicConst; - -class Trait_ extends MagicConst -{ - public function getName() : string { - return '__TRAIT__'; - } - - public function getType() : string { - return 'Scalar_MagicConst_Trait'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/String_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/String_.php deleted file mode 100644 index 6690a16b..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/String_.php +++ /dev/null @@ -1,157 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Scalar; - -use PhpParser\Error; -use PhpParser\Node\Scalar; - -class String_ extends Scalar -{ - /* For use in "kind" attribute */ - const KIND_SINGLE_QUOTED = 1; - const KIND_DOUBLE_QUOTED = 2; - const KIND_HEREDOC = 3; - const KIND_NOWDOC = 4; - - /** @var string String value */ - public $value; - - protected static $replacements = [ - '\\' => '\\', - '$' => '$', - 'n' => "\n", - 'r' => "\r", - 't' => "\t", - 'f' => "\f", - 'v' => "\v", - 'e' => "\x1B", - ]; - - /** - * Constructs a string scalar node. - * - * @param string $value Value of the string - * @param array $attributes Additional attributes - */ - public function __construct(string $value, array $attributes = []) { - $this->attributes = $attributes; - $this->value = $value; - } - - public function getSubNodeNames() : array { - return ['value']; - } - - /** - * @param bool $parseUnicodeEscape Whether to parse PHP 7 \u escapes - */ - public static function fromString(string $str, array $attributes = [], bool $parseUnicodeEscape = true): self - { - $attributes['kind'] = ($str[0] === "'" || ($str[1] === "'" && ($str[0] === 'b' || $str[0] === 'B'))) - ? Scalar\String_::KIND_SINGLE_QUOTED - : Scalar\String_::KIND_DOUBLE_QUOTED; - - $attributes['rawValue'] = $str; - - $string = self::parse($str, $parseUnicodeEscape); - - return new self($string, $attributes); - } - - /** - * @internal - * - * Parses a string token. - * - * @param string $str String token content - * @param bool $parseUnicodeEscape Whether to parse PHP 7 \u escapes - * - * @return string The parsed string - */ - public static function parse(string $str, bool $parseUnicodeEscape = true) : string { - $bLength = 0; - if ('b' === $str[0] || 'B' === $str[0]) { - $bLength = 1; - } - - if ('\'' === $str[$bLength]) { - return str_replace( - ['\\\\', '\\\''], - ['\\', '\''], - substr($str, $bLength + 1, -1) - ); - } else { - return self::parseEscapeSequences( - substr($str, $bLength + 1, -1), '"', $parseUnicodeEscape - ); - } - } - - /** - * @internal - * - * Parses escape sequences in strings (all string types apart from single quoted). - * - * @param string $str String without quotes - * @param null|string $quote Quote type - * @param bool $parseUnicodeEscape Whether to parse PHP 7 \u escapes - * - * @return string String with escape sequences parsed - */ - public static function parseEscapeSequences(string $str, $quote, bool $parseUnicodeEscape = true) : string { - if (null !== $quote) { - $str = str_replace('\\' . $quote, $quote, $str); - } - - $extra = ''; - if ($parseUnicodeEscape) { - $extra = '|u\{([0-9a-fA-F]+)\}'; - } - - return preg_replace_callback( - '~\\\\([\\\\$nrtfve]|[xX][0-9a-fA-F]{1,2}|[0-7]{1,3}' . $extra . ')~', - function($matches) { - $str = $matches[1]; - - if (isset(self::$replacements[$str])) { - return self::$replacements[$str]; - } elseif ('x' === $str[0] || 'X' === $str[0]) { - return chr(hexdec(substr($str, 1))); - } elseif ('u' === $str[0]) { - return self::codePointToUtf8(hexdec($matches[2])); - } else { - return chr(octdec($str)); - } - }, - $str - ); - } - - /** - * Converts a Unicode code point to its UTF-8 encoded representation. - * - * @param int $num Code point - * - * @return string UTF-8 representation of code point - */ - private static function codePointToUtf8(int $num) : string { - if ($num <= 0x7F) { - return chr($num); - } - if ($num <= 0x7FF) { - return chr(($num>>6) + 0xC0) . chr(($num&0x3F) + 0x80); - } - if ($num <= 0xFFFF) { - return chr(($num>>12) + 0xE0) . chr((($num>>6)&0x3F) + 0x80) . chr(($num&0x3F) + 0x80); - } - if ($num <= 0x1FFFFF) { - return chr(($num>>18) + 0xF0) . chr((($num>>12)&0x3F) + 0x80) - . chr((($num>>6)&0x3F) + 0x80) . chr(($num&0x3F) + 0x80); - } - throw new Error('Invalid UTF-8 codepoint escape sequence: Codepoint too large'); - } - - public function getType() : string { - return 'Scalar_String'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt.php deleted file mode 100644 index 69d33e57..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt.php +++ /dev/null @@ -1,9 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node; - -use PhpParser\NodeAbstract; - -abstract class Stmt extends NodeAbstract -{ -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Break_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Break_.php deleted file mode 100644 index 6adc5a6c..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Break_.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; - -class Break_ extends Node\Stmt -{ - /** @var null|Node\Expr Number of loops to break */ - public $num; - - /** - * Constructs a break node. - * - * @param null|Node\Expr $num Number of loops to break - * @param array $attributes Additional attributes - */ - public function __construct(Node\Expr $num = null, array $attributes = []) { - $this->attributes = $attributes; - $this->num = $num; - } - - public function getSubNodeNames() : array { - return ['num']; - } - - public function getType() : string { - return 'Stmt_Break'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php deleted file mode 100644 index 2bf044c9..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; - -class Case_ extends Node\Stmt -{ - /** @var null|Node\Expr Condition (null for default) */ - public $cond; - /** @var Node\Stmt[] Statements */ - public $stmts; - - /** - * Constructs a case node. - * - * @param null|Node\Expr $cond Condition (null for default) - * @param Node\Stmt[] $stmts Statements - * @param array $attributes Additional attributes - */ - public function __construct($cond, array $stmts = [], array $attributes = []) { - $this->attributes = $attributes; - $this->cond = $cond; - $this->stmts = $stmts; - } - - public function getSubNodeNames() : array { - return ['cond', 'stmts']; - } - - public function getType() : string { - return 'Stmt_Case'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php deleted file mode 100644 index 9b9c0947..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; -use PhpParser\Node\Expr; - -class Catch_ extends Node\Stmt -{ - /** @var Node\Name[] Types of exceptions to catch */ - public $types; - /** @var Expr\Variable|null Variable for exception */ - public $var; - /** @var Node\Stmt[] Statements */ - public $stmts; - - /** - * Constructs a catch node. - * - * @param Node\Name[] $types Types of exceptions to catch - * @param Expr\Variable|null $var Variable for exception - * @param Node\Stmt[] $stmts Statements - * @param array $attributes Additional attributes - */ - public function __construct( - array $types, Expr\Variable $var = null, array $stmts = [], array $attributes = [] - ) { - $this->attributes = $attributes; - $this->types = $types; - $this->var = $var; - $this->stmts = $stmts; - } - - public function getSubNodeNames() : array { - return ['types', 'var', 'stmts']; - } - - public function getType() : string { - return 'Stmt_Catch'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php deleted file mode 100644 index 1fc7f336..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php +++ /dev/null @@ -1,80 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; - -class ClassConst extends Node\Stmt -{ - /** @var int Modifiers */ - public $flags; - /** @var Node\Const_[] Constant declarations */ - public $consts; - /** @var Node\AttributeGroup[] */ - public $attrGroups; - - /** - * Constructs a class const list node. - * - * @param Node\Const_[] $consts Constant declarations - * @param int $flags Modifiers - * @param array $attributes Additional attributes - * @param Node\AttributeGroup[] $attrGroups PHP attribute groups - */ - public function __construct( - array $consts, - int $flags = 0, - array $attributes = [], - array $attrGroups = [] - ) { - $this->attributes = $attributes; - $this->flags = $flags; - $this->consts = $consts; - $this->attrGroups = $attrGroups; - } - - public function getSubNodeNames() : array { - return ['attrGroups', 'flags', 'consts']; - } - - /** - * Whether constant is explicitly or implicitly public. - * - * @return bool - */ - public function isPublic() : bool { - return ($this->flags & Class_::MODIFIER_PUBLIC) !== 0 - || ($this->flags & Class_::VISIBILITY_MODIFIER_MASK) === 0; - } - - /** - * Whether constant is protected. - * - * @return bool - */ - public function isProtected() : bool { - return (bool) ($this->flags & Class_::MODIFIER_PROTECTED); - } - - /** - * Whether constant is private. - * - * @return bool - */ - public function isPrivate() : bool { - return (bool) ($this->flags & Class_::MODIFIER_PRIVATE); - } - - /** - * Whether constant is final. - * - * @return bool - */ - public function isFinal() : bool { - return (bool) ($this->flags & Class_::MODIFIER_FINAL); - } - - public function getType() : string { - return 'Stmt_ClassConst'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.php deleted file mode 100644 index 2fa4e861..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.php +++ /dev/null @@ -1,109 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; - -abstract class ClassLike extends Node\Stmt -{ - /** @var Node\Identifier|null Name */ - public $name; - /** @var Node\Stmt[] Statements */ - public $stmts; - /** @var Node\AttributeGroup[] PHP attribute groups */ - public $attrGroups; - - /** @var Node\Name|null Namespaced name (if using NameResolver) */ - public $namespacedName; - - /** - * @return TraitUse[] - */ - public function getTraitUses() : array { - $traitUses = []; - foreach ($this->stmts as $stmt) { - if ($stmt instanceof TraitUse) { - $traitUses[] = $stmt; - } - } - return $traitUses; - } - - /** - * @return ClassConst[] - */ - public function getConstants() : array { - $constants = []; - foreach ($this->stmts as $stmt) { - if ($stmt instanceof ClassConst) { - $constants[] = $stmt; - } - } - return $constants; - } - - /** - * @return Property[] - */ - public function getProperties() : array { - $properties = []; - foreach ($this->stmts as $stmt) { - if ($stmt instanceof Property) { - $properties[] = $stmt; - } - } - return $properties; - } - - /** - * Gets property with the given name defined directly in this class/interface/trait. - * - * @param string $name Name of the property - * - * @return Property|null Property node or null if the property does not exist - */ - public function getProperty(string $name) { - foreach ($this->stmts as $stmt) { - if ($stmt instanceof Property) { - foreach ($stmt->props as $prop) { - if ($prop instanceof PropertyProperty && $name === $prop->name->toString()) { - return $stmt; - } - } - } - } - return null; - } - - /** - * Gets all methods defined directly in this class/interface/trait - * - * @return ClassMethod[] - */ - public function getMethods() : array { - $methods = []; - foreach ($this->stmts as $stmt) { - if ($stmt instanceof ClassMethod) { - $methods[] = $stmt; - } - } - return $methods; - } - - /** - * Gets method with the given name defined directly in this class/interface/trait. - * - * @param string $name Name of the method (compared case-insensitively) - * - * @return ClassMethod|null Method node or null if the method does not exist - */ - public function getMethod(string $name) { - $lowerName = strtolower($name); - foreach ($this->stmts as $stmt) { - if ($stmt instanceof ClassMethod && $lowerName === $stmt->name->toLowerString()) { - return $stmt; - } - } - return null; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php deleted file mode 100644 index 6e85161e..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php +++ /dev/null @@ -1,161 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; -use PhpParser\Node\FunctionLike; - -class ClassMethod extends Node\Stmt implements FunctionLike -{ - /** @var int Flags */ - public $flags; - /** @var bool Whether to return by reference */ - public $byRef; - /** @var Node\Identifier Name */ - public $name; - /** @var Node\Param[] Parameters */ - public $params; - /** @var null|Node\Identifier|Node\Name|Node\ComplexType Return type */ - public $returnType; - /** @var Node\Stmt[]|null Statements */ - public $stmts; - /** @var Node\AttributeGroup[] PHP attribute groups */ - public $attrGroups; - - private static $magicNames = [ - '__construct' => true, - '__destruct' => true, - '__call' => true, - '__callstatic' => true, - '__get' => true, - '__set' => true, - '__isset' => true, - '__unset' => true, - '__sleep' => true, - '__wakeup' => true, - '__tostring' => true, - '__set_state' => true, - '__clone' => true, - '__invoke' => true, - '__debuginfo' => true, - '__serialize' => true, - '__unserialize' => true, - ]; - - /** - * Constructs a class method node. - * - * @param string|Node\Identifier $name Name - * @param array $subNodes Array of the following optional subnodes: - * 'flags => MODIFIER_PUBLIC: Flags - * 'byRef' => false : Whether to return by reference - * 'params' => array() : Parameters - * 'returnType' => null : Return type - * 'stmts' => array() : Statements - * 'attrGroups' => array() : PHP attribute groups - * @param array $attributes Additional attributes - */ - public function __construct($name, array $subNodes = [], array $attributes = []) { - $this->attributes = $attributes; - $this->flags = $subNodes['flags'] ?? $subNodes['type'] ?? 0; - $this->byRef = $subNodes['byRef'] ?? false; - $this->name = \is_string($name) ? new Node\Identifier($name) : $name; - $this->params = $subNodes['params'] ?? []; - $returnType = $subNodes['returnType'] ?? null; - $this->returnType = \is_string($returnType) ? new Node\Identifier($returnType) : $returnType; - $this->stmts = array_key_exists('stmts', $subNodes) ? $subNodes['stmts'] : []; - $this->attrGroups = $subNodes['attrGroups'] ?? []; - } - - public function getSubNodeNames() : array { - return ['attrGroups', 'flags', 'byRef', 'name', 'params', 'returnType', 'stmts']; - } - - public function returnsByRef() : bool { - return $this->byRef; - } - - public function getParams() : array { - return $this->params; - } - - public function getReturnType() { - return $this->returnType; - } - - public function getStmts() { - return $this->stmts; - } - - public function getAttrGroups() : array { - return $this->attrGroups; - } - - /** - * Whether the method is explicitly or implicitly public. - * - * @return bool - */ - public function isPublic() : bool { - return ($this->flags & Class_::MODIFIER_PUBLIC) !== 0 - || ($this->flags & Class_::VISIBILITY_MODIFIER_MASK) === 0; - } - - /** - * Whether the method is protected. - * - * @return bool - */ - public function isProtected() : bool { - return (bool) ($this->flags & Class_::MODIFIER_PROTECTED); - } - - /** - * Whether the method is private. - * - * @return bool - */ - public function isPrivate() : bool { - return (bool) ($this->flags & Class_::MODIFIER_PRIVATE); - } - - /** - * Whether the method is abstract. - * - * @return bool - */ - public function isAbstract() : bool { - return (bool) ($this->flags & Class_::MODIFIER_ABSTRACT); - } - - /** - * Whether the method is final. - * - * @return bool - */ - public function isFinal() : bool { - return (bool) ($this->flags & Class_::MODIFIER_FINAL); - } - - /** - * Whether the method is static. - * - * @return bool - */ - public function isStatic() : bool { - return (bool) ($this->flags & Class_::MODIFIER_STATIC); - } - - /** - * Whether the method is magic. - * - * @return bool - */ - public function isMagic() : bool { - return isset(self::$magicNames[$this->name->toLowerString()]); - } - - public function getType() : string { - return 'Stmt_ClassMethod'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php deleted file mode 100644 index 52ed6c6c..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php +++ /dev/null @@ -1,137 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Error; -use PhpParser\Node; - -class Class_ extends ClassLike -{ - const MODIFIER_PUBLIC = 1; - const MODIFIER_PROTECTED = 2; - const MODIFIER_PRIVATE = 4; - const MODIFIER_STATIC = 8; - const MODIFIER_ABSTRACT = 16; - const MODIFIER_FINAL = 32; - const MODIFIER_READONLY = 64; - - const VISIBILITY_MODIFIER_MASK = 7; // 1 | 2 | 4 - - /** @var int Type */ - public $flags; - /** @var null|Node\Name Name of extended class */ - public $extends; - /** @var Node\Name[] Names of implemented interfaces */ - public $implements; - - /** - * Constructs a class node. - * - * @param string|Node\Identifier|null $name Name - * @param array $subNodes Array of the following optional subnodes: - * 'flags' => 0 : Flags - * 'extends' => null : Name of extended class - * 'implements' => array(): Names of implemented interfaces - * 'stmts' => array(): Statements - * 'attrGroups' => array(): PHP attribute groups - * @param array $attributes Additional attributes - */ - public function __construct($name, array $subNodes = [], array $attributes = []) { - $this->attributes = $attributes; - $this->flags = $subNodes['flags'] ?? $subNodes['type'] ?? 0; - $this->name = \is_string($name) ? new Node\Identifier($name) : $name; - $this->extends = $subNodes['extends'] ?? null; - $this->implements = $subNodes['implements'] ?? []; - $this->stmts = $subNodes['stmts'] ?? []; - $this->attrGroups = $subNodes['attrGroups'] ?? []; - } - - public function getSubNodeNames() : array { - return ['attrGroups', 'flags', 'name', 'extends', 'implements', 'stmts']; - } - - /** - * Whether the class is explicitly abstract. - * - * @return bool - */ - public function isAbstract() : bool { - return (bool) ($this->flags & self::MODIFIER_ABSTRACT); - } - - /** - * Whether the class is final. - * - * @return bool - */ - public function isFinal() : bool { - return (bool) ($this->flags & self::MODIFIER_FINAL); - } - - public function isReadonly() : bool { - return (bool) ($this->flags & self::MODIFIER_READONLY); - } - - /** - * Whether the class is anonymous. - * - * @return bool - */ - public function isAnonymous() : bool { - return null === $this->name; - } - - /** - * @internal - */ - public static function verifyClassModifier($a, $b) { - if ($a & self::MODIFIER_ABSTRACT && $b & self::MODIFIER_ABSTRACT) { - throw new Error('Multiple abstract modifiers are not allowed'); - } - - if ($a & self::MODIFIER_FINAL && $b & self::MODIFIER_FINAL) { - throw new Error('Multiple final modifiers are not allowed'); - } - - if ($a & self::MODIFIER_READONLY && $b & self::MODIFIER_READONLY) { - throw new Error('Multiple readonly modifiers are not allowed'); - } - - if ($a & 48 && $b & 48) { - throw new Error('Cannot use the final modifier on an abstract class'); - } - } - - /** - * @internal - */ - public static function verifyModifier($a, $b) { - if ($a & self::VISIBILITY_MODIFIER_MASK && $b & self::VISIBILITY_MODIFIER_MASK) { - throw new Error('Multiple access type modifiers are not allowed'); - } - - if ($a & self::MODIFIER_ABSTRACT && $b & self::MODIFIER_ABSTRACT) { - throw new Error('Multiple abstract modifiers are not allowed'); - } - - if ($a & self::MODIFIER_STATIC && $b & self::MODIFIER_STATIC) { - throw new Error('Multiple static modifiers are not allowed'); - } - - if ($a & self::MODIFIER_FINAL && $b & self::MODIFIER_FINAL) { - throw new Error('Multiple final modifiers are not allowed'); - } - - if ($a & self::MODIFIER_READONLY && $b & self::MODIFIER_READONLY) { - throw new Error('Multiple readonly modifiers are not allowed'); - } - - if ($a & 48 && $b & 48) { - throw new Error('Cannot use the final modifier on an abstract class member'); - } - } - - public function getType() : string { - return 'Stmt_Class'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Const_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Const_.php deleted file mode 100644 index e6316345..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Const_.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; - -class Const_ extends Node\Stmt -{ - /** @var Node\Const_[] Constant declarations */ - public $consts; - - /** - * Constructs a const list node. - * - * @param Node\Const_[] $consts Constant declarations - * @param array $attributes Additional attributes - */ - public function __construct(array $consts, array $attributes = []) { - $this->attributes = $attributes; - $this->consts = $consts; - } - - public function getSubNodeNames() : array { - return ['consts']; - } - - public function getType() : string { - return 'Stmt_Const'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php deleted file mode 100644 index 24882683..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; - -class Continue_ extends Node\Stmt -{ - /** @var null|Node\Expr Number of loops to continue */ - public $num; - - /** - * Constructs a continue node. - * - * @param null|Node\Expr $num Number of loops to continue - * @param array $attributes Additional attributes - */ - public function __construct(Node\Expr $num = null, array $attributes = []) { - $this->attributes = $attributes; - $this->num = $num; - } - - public function getSubNodeNames() : array { - return ['num']; - } - - public function getType() : string { - return 'Stmt_Continue'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/DeclareDeclare.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/DeclareDeclare.php deleted file mode 100644 index ac07f30c..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/DeclareDeclare.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; - -class DeclareDeclare extends Node\Stmt -{ - /** @var Node\Identifier Key */ - public $key; - /** @var Node\Expr Value */ - public $value; - - /** - * Constructs a declare key=>value pair node. - * - * @param string|Node\Identifier $key Key - * @param Node\Expr $value Value - * @param array $attributes Additional attributes - */ - public function __construct($key, Node\Expr $value, array $attributes = []) { - $this->attributes = $attributes; - $this->key = \is_string($key) ? new Node\Identifier($key) : $key; - $this->value = $value; - } - - public function getSubNodeNames() : array { - return ['key', 'value']; - } - - public function getType() : string { - return 'Stmt_DeclareDeclare'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Declare_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Declare_.php deleted file mode 100644 index f46ff0ba..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Declare_.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; - -class Declare_ extends Node\Stmt -{ - /** @var DeclareDeclare[] List of declares */ - public $declares; - /** @var Node\Stmt[]|null Statements */ - public $stmts; - - /** - * Constructs a declare node. - * - * @param DeclareDeclare[] $declares List of declares - * @param Node\Stmt[]|null $stmts Statements - * @param array $attributes Additional attributes - */ - public function __construct(array $declares, array $stmts = null, array $attributes = []) { - $this->attributes = $attributes; - $this->declares = $declares; - $this->stmts = $stmts; - } - - public function getSubNodeNames() : array { - return ['declares', 'stmts']; - } - - public function getType() : string { - return 'Stmt_Declare'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Do_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Do_.php deleted file mode 100644 index 78e90da0..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Do_.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; - -class Do_ extends Node\Stmt -{ - /** @var Node\Stmt[] Statements */ - public $stmts; - /** @var Node\Expr Condition */ - public $cond; - - /** - * Constructs a do while node. - * - * @param Node\Expr $cond Condition - * @param Node\Stmt[] $stmts Statements - * @param array $attributes Additional attributes - */ - public function __construct(Node\Expr $cond, array $stmts = [], array $attributes = []) { - $this->attributes = $attributes; - $this->cond = $cond; - $this->stmts = $stmts; - } - - public function getSubNodeNames() : array { - return ['stmts', 'cond']; - } - - public function getType() : string { - return 'Stmt_Do'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Echo_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Echo_.php deleted file mode 100644 index 7cc50d5d..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Echo_.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; - -class Echo_ extends Node\Stmt -{ - /** @var Node\Expr[] Expressions */ - public $exprs; - - /** - * Constructs an echo node. - * - * @param Node\Expr[] $exprs Expressions - * @param array $attributes Additional attributes - */ - public function __construct(array $exprs, array $attributes = []) { - $this->attributes = $attributes; - $this->exprs = $exprs; - } - - public function getSubNodeNames() : array { - return ['exprs']; - } - - public function getType() : string { - return 'Stmt_Echo'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ElseIf_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ElseIf_.php deleted file mode 100644 index eef1ece3..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ElseIf_.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; - -class ElseIf_ extends Node\Stmt -{ - /** @var Node\Expr Condition */ - public $cond; - /** @var Node\Stmt[] Statements */ - public $stmts; - - /** - * Constructs an elseif node. - * - * @param Node\Expr $cond Condition - * @param Node\Stmt[] $stmts Statements - * @param array $attributes Additional attributes - */ - public function __construct(Node\Expr $cond, array $stmts = [], array $attributes = []) { - $this->attributes = $attributes; - $this->cond = $cond; - $this->stmts = $stmts; - } - - public function getSubNodeNames() : array { - return ['cond', 'stmts']; - } - - public function getType() : string { - return 'Stmt_ElseIf'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Else_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Else_.php deleted file mode 100644 index 0e61778e..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Else_.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; - -class Else_ extends Node\Stmt -{ - /** @var Node\Stmt[] Statements */ - public $stmts; - - /** - * Constructs an else node. - * - * @param Node\Stmt[] $stmts Statements - * @param array $attributes Additional attributes - */ - public function __construct(array $stmts = [], array $attributes = []) { - $this->attributes = $attributes; - $this->stmts = $stmts; - } - - public function getSubNodeNames() : array { - return ['stmts']; - } - - public function getType() : string { - return 'Stmt_Else'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php deleted file mode 100644 index 5beff8b3..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; -use PhpParser\Node\AttributeGroup; - -class EnumCase extends Node\Stmt -{ - /** @var Node\Identifier Enum case name */ - public $name; - /** @var Node\Expr|null Enum case expression */ - public $expr; - /** @var Node\AttributeGroup[] PHP attribute groups */ - public $attrGroups; - - /** - * @param string|Node\Identifier $name Enum case name - * @param Node\Expr|null $expr Enum case expression - * @param AttributeGroup[] $attrGroups PHP attribute groups - * @param array $attributes Additional attributes - */ - public function __construct($name, Node\Expr $expr = null, array $attrGroups = [], array $attributes = []) { - parent::__construct($attributes); - $this->name = \is_string($name) ? new Node\Identifier($name) : $name; - $this->expr = $expr; - $this->attrGroups = $attrGroups; - } - - public function getSubNodeNames() : array { - return ['attrGroups', 'name', 'expr']; - } - - public function getType() : string { - return 'Stmt_EnumCase'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Enum_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Enum_.php deleted file mode 100644 index 3a50c225..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Enum_.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; - -class Enum_ extends ClassLike -{ - /** @var null|Node\Identifier Scalar Type */ - public $scalarType; - /** @var Node\Name[] Names of implemented interfaces */ - public $implements; - - /** - * @param string|Node\Identifier|null $name Name - * @param array $subNodes Array of the following optional subnodes: - * 'scalarType' => null : Scalar type - * 'implements' => array() : Names of implemented interfaces - * 'stmts' => array() : Statements - * 'attrGroups' => array() : PHP attribute groups - * @param array $attributes Additional attributes - */ - public function __construct($name, array $subNodes = [], array $attributes = []) { - $this->name = \is_string($name) ? new Node\Identifier($name) : $name; - $this->scalarType = $subNodes['scalarType'] ?? null; - $this->implements = $subNodes['implements'] ?? []; - $this->stmts = $subNodes['stmts'] ?? []; - $this->attrGroups = $subNodes['attrGroups'] ?? []; - - parent::__construct($attributes); - } - - public function getSubNodeNames() : array { - return ['attrGroups', 'name', 'scalarType', 'implements', 'stmts']; - } - - public function getType() : string { - return 'Stmt_Enum'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Expression.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Expression.php deleted file mode 100644 index 99d1687d..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Expression.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; - -/** - * Represents statements of type "expr;" - */ -class Expression extends Node\Stmt -{ - /** @var Node\Expr Expression */ - public $expr; - - /** - * Constructs an expression statement. - * - * @param Node\Expr $expr Expression - * @param array $attributes Additional attributes - */ - public function __construct(Node\Expr $expr, array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['expr']; - } - - public function getType() : string { - return 'Stmt_Expression'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Finally_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Finally_.php deleted file mode 100644 index d55b8b68..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Finally_.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; - -class Finally_ extends Node\Stmt -{ - /** @var Node\Stmt[] Statements */ - public $stmts; - - /** - * Constructs a finally node. - * - * @param Node\Stmt[] $stmts Statements - * @param array $attributes Additional attributes - */ - public function __construct(array $stmts = [], array $attributes = []) { - $this->attributes = $attributes; - $this->stmts = $stmts; - } - - public function getSubNodeNames() : array { - return ['stmts']; - } - - public function getType() : string { - return 'Stmt_Finally'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/For_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/For_.php deleted file mode 100644 index 1323d37c..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/For_.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; - -class For_ extends Node\Stmt -{ - /** @var Node\Expr[] Init expressions */ - public $init; - /** @var Node\Expr[] Loop conditions */ - public $cond; - /** @var Node\Expr[] Loop expressions */ - public $loop; - /** @var Node\Stmt[] Statements */ - public $stmts; - - /** - * Constructs a for loop node. - * - * @param array $subNodes Array of the following optional subnodes: - * 'init' => array(): Init expressions - * 'cond' => array(): Loop conditions - * 'loop' => array(): Loop expressions - * 'stmts' => array(): Statements - * @param array $attributes Additional attributes - */ - public function __construct(array $subNodes = [], array $attributes = []) { - $this->attributes = $attributes; - $this->init = $subNodes['init'] ?? []; - $this->cond = $subNodes['cond'] ?? []; - $this->loop = $subNodes['loop'] ?? []; - $this->stmts = $subNodes['stmts'] ?? []; - } - - public function getSubNodeNames() : array { - return ['init', 'cond', 'loop', 'stmts']; - } - - public function getType() : string { - return 'Stmt_For'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Foreach_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Foreach_.php deleted file mode 100644 index 0556a7ce..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Foreach_.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; - -class Foreach_ extends Node\Stmt -{ - /** @var Node\Expr Expression to iterate */ - public $expr; - /** @var null|Node\Expr Variable to assign key to */ - public $keyVar; - /** @var bool Whether to assign value by reference */ - public $byRef; - /** @var Node\Expr Variable to assign value to */ - public $valueVar; - /** @var Node\Stmt[] Statements */ - public $stmts; - - /** - * Constructs a foreach node. - * - * @param Node\Expr $expr Expression to iterate - * @param Node\Expr $valueVar Variable to assign value to - * @param array $subNodes Array of the following optional subnodes: - * 'keyVar' => null : Variable to assign key to - * 'byRef' => false : Whether to assign value by reference - * 'stmts' => array(): Statements - * @param array $attributes Additional attributes - */ - public function __construct(Node\Expr $expr, Node\Expr $valueVar, array $subNodes = [], array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - $this->keyVar = $subNodes['keyVar'] ?? null; - $this->byRef = $subNodes['byRef'] ?? false; - $this->valueVar = $valueVar; - $this->stmts = $subNodes['stmts'] ?? []; - } - - public function getSubNodeNames() : array { - return ['expr', 'keyVar', 'byRef', 'valueVar', 'stmts']; - } - - public function getType() : string { - return 'Stmt_Foreach'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Function_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Function_.php deleted file mode 100644 index c2ccae24..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Function_.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; -use PhpParser\Node\FunctionLike; - -class Function_ extends Node\Stmt implements FunctionLike -{ - /** @var bool Whether function returns by reference */ - public $byRef; - /** @var Node\Identifier Name */ - public $name; - /** @var Node\Param[] Parameters */ - public $params; - /** @var null|Node\Identifier|Node\Name|Node\ComplexType Return type */ - public $returnType; - /** @var Node\Stmt[] Statements */ - public $stmts; - /** @var Node\AttributeGroup[] PHP attribute groups */ - public $attrGroups; - - /** @var Node\Name|null Namespaced name (if using NameResolver) */ - public $namespacedName; - - /** - * Constructs a function node. - * - * @param string|Node\Identifier $name Name - * @param array $subNodes Array of the following optional subnodes: - * 'byRef' => false : Whether to return by reference - * 'params' => array(): Parameters - * 'returnType' => null : Return type - * 'stmts' => array(): Statements - * 'attrGroups' => array(): PHP attribute groups - * @param array $attributes Additional attributes - */ - public function __construct($name, array $subNodes = [], array $attributes = []) { - $this->attributes = $attributes; - $this->byRef = $subNodes['byRef'] ?? false; - $this->name = \is_string($name) ? new Node\Identifier($name) : $name; - $this->params = $subNodes['params'] ?? []; - $returnType = $subNodes['returnType'] ?? null; - $this->returnType = \is_string($returnType) ? new Node\Identifier($returnType) : $returnType; - $this->stmts = $subNodes['stmts'] ?? []; - $this->attrGroups = $subNodes['attrGroups'] ?? []; - } - - public function getSubNodeNames() : array { - return ['attrGroups', 'byRef', 'name', 'params', 'returnType', 'stmts']; - } - - public function returnsByRef() : bool { - return $this->byRef; - } - - public function getParams() : array { - return $this->params; - } - - public function getReturnType() { - return $this->returnType; - } - - public function getAttrGroups() : array { - return $this->attrGroups; - } - - /** @return Node\Stmt[] */ - public function getStmts() : array { - return $this->stmts; - } - - public function getType() : string { - return 'Stmt_Function'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Global_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Global_.php deleted file mode 100644 index a0022ad9..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Global_.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; - -class Global_ extends Node\Stmt -{ - /** @var Node\Expr[] Variables */ - public $vars; - - /** - * Constructs a global variables list node. - * - * @param Node\Expr[] $vars Variables to unset - * @param array $attributes Additional attributes - */ - public function __construct(array $vars, array $attributes = []) { - $this->attributes = $attributes; - $this->vars = $vars; - } - - public function getSubNodeNames() : array { - return ['vars']; - } - - public function getType() : string { - return 'Stmt_Global'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Goto_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Goto_.php deleted file mode 100644 index 24a57f78..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Goto_.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node\Identifier; -use PhpParser\Node\Stmt; - -class Goto_ extends Stmt -{ - /** @var Identifier Name of label to jump to */ - public $name; - - /** - * Constructs a goto node. - * - * @param string|Identifier $name Name of label to jump to - * @param array $attributes Additional attributes - */ - public function __construct($name, array $attributes = []) { - $this->attributes = $attributes; - $this->name = \is_string($name) ? new Identifier($name) : $name; - } - - public function getSubNodeNames() : array { - return ['name']; - } - - public function getType() : string { - return 'Stmt_Goto'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/GroupUse.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/GroupUse.php deleted file mode 100644 index 24520d22..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/GroupUse.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node\Name; -use PhpParser\Node\Stmt; - -class GroupUse extends Stmt -{ - /** @var int Type of group use */ - public $type; - /** @var Name Prefix for uses */ - public $prefix; - /** @var UseUse[] Uses */ - public $uses; - - /** - * Constructs a group use node. - * - * @param Name $prefix Prefix for uses - * @param UseUse[] $uses Uses - * @param int $type Type of group use - * @param array $attributes Additional attributes - */ - public function __construct(Name $prefix, array $uses, int $type = Use_::TYPE_NORMAL, array $attributes = []) { - $this->attributes = $attributes; - $this->type = $type; - $this->prefix = $prefix; - $this->uses = $uses; - } - - public function getSubNodeNames() : array { - return ['type', 'prefix', 'uses']; - } - - public function getType() : string { - return 'Stmt_GroupUse'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/HaltCompiler.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/HaltCompiler.php deleted file mode 100644 index 8e624e0f..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/HaltCompiler.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node\Stmt; - -class HaltCompiler extends Stmt -{ - /** @var string Remaining text after halt compiler statement. */ - public $remaining; - - /** - * Constructs a __halt_compiler node. - * - * @param string $remaining Remaining text after halt compiler statement. - * @param array $attributes Additional attributes - */ - public function __construct(string $remaining, array $attributes = []) { - $this->attributes = $attributes; - $this->remaining = $remaining; - } - - public function getSubNodeNames() : array { - return ['remaining']; - } - - public function getType() : string { - return 'Stmt_HaltCompiler'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/If_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/If_.php deleted file mode 100644 index a1bae4bf..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/If_.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; - -class If_ extends Node\Stmt -{ - /** @var Node\Expr Condition expression */ - public $cond; - /** @var Node\Stmt[] Statements */ - public $stmts; - /** @var ElseIf_[] Elseif clauses */ - public $elseifs; - /** @var null|Else_ Else clause */ - public $else; - - /** - * Constructs an if node. - * - * @param Node\Expr $cond Condition - * @param array $subNodes Array of the following optional subnodes: - * 'stmts' => array(): Statements - * 'elseifs' => array(): Elseif clauses - * 'else' => null : Else clause - * @param array $attributes Additional attributes - */ - public function __construct(Node\Expr $cond, array $subNodes = [], array $attributes = []) { - $this->attributes = $attributes; - $this->cond = $cond; - $this->stmts = $subNodes['stmts'] ?? []; - $this->elseifs = $subNodes['elseifs'] ?? []; - $this->else = $subNodes['else'] ?? null; - } - - public function getSubNodeNames() : array { - return ['cond', 'stmts', 'elseifs', 'else']; - } - - public function getType() : string { - return 'Stmt_If'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.php deleted file mode 100644 index 0711d284..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node\Stmt; - -class InlineHTML extends Stmt -{ - /** @var string String */ - public $value; - - /** - * Constructs an inline HTML node. - * - * @param string $value String - * @param array $attributes Additional attributes - */ - public function __construct(string $value, array $attributes = []) { - $this->attributes = $attributes; - $this->value = $value; - } - - public function getSubNodeNames() : array { - return ['value']; - } - - public function getType() : string { - return 'Stmt_InlineHTML'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Interface_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Interface_.php deleted file mode 100644 index 4d587dd4..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Interface_.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; - -class Interface_ extends ClassLike -{ - /** @var Node\Name[] Extended interfaces */ - public $extends; - - /** - * Constructs a class node. - * - * @param string|Node\Identifier $name Name - * @param array $subNodes Array of the following optional subnodes: - * 'extends' => array(): Name of extended interfaces - * 'stmts' => array(): Statements - * 'attrGroups' => array(): PHP attribute groups - * @param array $attributes Additional attributes - */ - public function __construct($name, array $subNodes = [], array $attributes = []) { - $this->attributes = $attributes; - $this->name = \is_string($name) ? new Node\Identifier($name) : $name; - $this->extends = $subNodes['extends'] ?? []; - $this->stmts = $subNodes['stmts'] ?? []; - $this->attrGroups = $subNodes['attrGroups'] ?? []; - } - - public function getSubNodeNames() : array { - return ['attrGroups', 'name', 'extends', 'stmts']; - } - - public function getType() : string { - return 'Stmt_Interface'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Label.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Label.php deleted file mode 100644 index 3edcb3be..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Label.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node\Identifier; -use PhpParser\Node\Stmt; - -class Label extends Stmt -{ - /** @var Identifier Name */ - public $name; - - /** - * Constructs a label node. - * - * @param string|Identifier $name Name - * @param array $attributes Additional attributes - */ - public function __construct($name, array $attributes = []) { - $this->attributes = $attributes; - $this->name = \is_string($name) ? new Identifier($name) : $name; - } - - public function getSubNodeNames() : array { - return ['name']; - } - - public function getType() : string { - return 'Stmt_Label'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php deleted file mode 100644 index c6320457..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; - -class Namespace_ extends Node\Stmt -{ - /* For use in the "kind" attribute */ - const KIND_SEMICOLON = 1; - const KIND_BRACED = 2; - - /** @var null|Node\Name Name */ - public $name; - /** @var Node\Stmt[] Statements */ - public $stmts; - - /** - * Constructs a namespace node. - * - * @param null|Node\Name $name Name - * @param null|Node\Stmt[] $stmts Statements - * @param array $attributes Additional attributes - */ - public function __construct(Node\Name $name = null, $stmts = [], array $attributes = []) { - $this->attributes = $attributes; - $this->name = $name; - $this->stmts = $stmts; - } - - public function getSubNodeNames() : array { - return ['name', 'stmts']; - } - - public function getType() : string { - return 'Stmt_Namespace'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Nop.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Nop.php deleted file mode 100644 index f86f8df7..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Nop.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; - -/** Nop/empty statement (;). */ -class Nop extends Node\Stmt -{ - public function getSubNodeNames() : array { - return []; - } - - public function getType() : string { - return 'Stmt_Nop'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.php deleted file mode 100644 index bc781bbf..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.php +++ /dev/null @@ -1,91 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; -use PhpParser\Node\ComplexType; -use PhpParser\Node\Identifier; -use PhpParser\Node\Name; - -class Property extends Node\Stmt -{ - /** @var int Modifiers */ - public $flags; - /** @var PropertyProperty[] Properties */ - public $props; - /** @var null|Identifier|Name|ComplexType Type declaration */ - public $type; - /** @var Node\AttributeGroup[] PHP attribute groups */ - public $attrGroups; - - /** - * Constructs a class property list node. - * - * @param int $flags Modifiers - * @param PropertyProperty[] $props Properties - * @param array $attributes Additional attributes - * @param null|string|Identifier|Name|ComplexType $type Type declaration - * @param Node\AttributeGroup[] $attrGroups PHP attribute groups - */ - public function __construct(int $flags, array $props, array $attributes = [], $type = null, array $attrGroups = []) { - $this->attributes = $attributes; - $this->flags = $flags; - $this->props = $props; - $this->type = \is_string($type) ? new Identifier($type) : $type; - $this->attrGroups = $attrGroups; - } - - public function getSubNodeNames() : array { - return ['attrGroups', 'flags', 'type', 'props']; - } - - /** - * Whether the property is explicitly or implicitly public. - * - * @return bool - */ - public function isPublic() : bool { - return ($this->flags & Class_::MODIFIER_PUBLIC) !== 0 - || ($this->flags & Class_::VISIBILITY_MODIFIER_MASK) === 0; - } - - /** - * Whether the property is protected. - * - * @return bool - */ - public function isProtected() : bool { - return (bool) ($this->flags & Class_::MODIFIER_PROTECTED); - } - - /** - * Whether the property is private. - * - * @return bool - */ - public function isPrivate() : bool { - return (bool) ($this->flags & Class_::MODIFIER_PRIVATE); - } - - /** - * Whether the property is static. - * - * @return bool - */ - public function isStatic() : bool { - return (bool) ($this->flags & Class_::MODIFIER_STATIC); - } - - /** - * Whether the property is readonly. - * - * @return bool - */ - public function isReadonly() : bool { - return (bool) ($this->flags & Class_::MODIFIER_READONLY); - } - - public function getType() : string { - return 'Stmt_Property'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php deleted file mode 100644 index 205731e2..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; - -class PropertyProperty extends Node\Stmt -{ - /** @var Node\VarLikeIdentifier Name */ - public $name; - /** @var null|Node\Expr Default */ - public $default; - - /** - * Constructs a class property node. - * - * @param string|Node\VarLikeIdentifier $name Name - * @param null|Node\Expr $default Default value - * @param array $attributes Additional attributes - */ - public function __construct($name, Node\Expr $default = null, array $attributes = []) { - $this->attributes = $attributes; - $this->name = \is_string($name) ? new Node\VarLikeIdentifier($name) : $name; - $this->default = $default; - } - - public function getSubNodeNames() : array { - return ['name', 'default']; - } - - public function getType() : string { - return 'Stmt_PropertyProperty'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Return_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Return_.php deleted file mode 100644 index efc578c5..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Return_.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; - -class Return_ extends Node\Stmt -{ - /** @var null|Node\Expr Expression */ - public $expr; - - /** - * Constructs a return node. - * - * @param null|Node\Expr $expr Expression - * @param array $attributes Additional attributes - */ - public function __construct(Node\Expr $expr = null, array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['expr']; - } - - public function getType() : string { - return 'Stmt_Return'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php deleted file mode 100644 index 29584560..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; -use PhpParser\Node\Expr; - -class StaticVar extends Node\Stmt -{ - /** @var Expr\Variable Variable */ - public $var; - /** @var null|Node\Expr Default value */ - public $default; - - /** - * Constructs a static variable node. - * - * @param Expr\Variable $var Name - * @param null|Node\Expr $default Default value - * @param array $attributes Additional attributes - */ - public function __construct( - Expr\Variable $var, Node\Expr $default = null, array $attributes = [] - ) { - $this->attributes = $attributes; - $this->var = $var; - $this->default = $default; - } - - public function getSubNodeNames() : array { - return ['var', 'default']; - } - - public function getType() : string { - return 'Stmt_StaticVar'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Static_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Static_.php deleted file mode 100644 index 464898ff..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Static_.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node\Stmt; - -class Static_ extends Stmt -{ - /** @var StaticVar[] Variable definitions */ - public $vars; - - /** - * Constructs a static variables list node. - * - * @param StaticVar[] $vars Variable definitions - * @param array $attributes Additional attributes - */ - public function __construct(array $vars, array $attributes = []) { - $this->attributes = $attributes; - $this->vars = $vars; - } - - public function getSubNodeNames() : array { - return ['vars']; - } - - public function getType() : string { - return 'Stmt_Static'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Switch_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Switch_.php deleted file mode 100644 index 2c8dae02..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Switch_.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; - -class Switch_ extends Node\Stmt -{ - /** @var Node\Expr Condition */ - public $cond; - /** @var Case_[] Case list */ - public $cases; - - /** - * Constructs a case node. - * - * @param Node\Expr $cond Condition - * @param Case_[] $cases Case list - * @param array $attributes Additional attributes - */ - public function __construct(Node\Expr $cond, array $cases, array $attributes = []) { - $this->attributes = $attributes; - $this->cond = $cond; - $this->cases = $cases; - } - - public function getSubNodeNames() : array { - return ['cond', 'cases']; - } - - public function getType() : string { - return 'Stmt_Switch'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Throw_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Throw_.php deleted file mode 100644 index a34e2b36..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Throw_.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; - -class Throw_ extends Node\Stmt -{ - /** @var Node\Expr Expression */ - public $expr; - - /** - * Constructs a legacy throw statement node. - * - * @param Node\Expr $expr Expression - * @param array $attributes Additional attributes - */ - public function __construct(Node\Expr $expr, array $attributes = []) { - $this->attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['expr']; - } - - public function getType() : string { - return 'Stmt_Throw'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php deleted file mode 100644 index 9e97053b..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; - -class TraitUse extends Node\Stmt -{ - /** @var Node\Name[] Traits */ - public $traits; - /** @var TraitUseAdaptation[] Adaptations */ - public $adaptations; - - /** - * Constructs a trait use node. - * - * @param Node\Name[] $traits Traits - * @param TraitUseAdaptation[] $adaptations Adaptations - * @param array $attributes Additional attributes - */ - public function __construct(array $traits, array $adaptations = [], array $attributes = []) { - $this->attributes = $attributes; - $this->traits = $traits; - $this->adaptations = $adaptations; - } - - public function getSubNodeNames() : array { - return ['traits', 'adaptations']; - } - - public function getType() : string { - return 'Stmt_TraitUse'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation.php deleted file mode 100644 index 8bdd2c04..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; - -abstract class TraitUseAdaptation extends Node\Stmt -{ - /** @var Node\Name|null Trait name */ - public $trait; - /** @var Node\Identifier Method name */ - public $method; -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Alias.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Alias.php deleted file mode 100644 index a3bccbd1..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Alias.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt\TraitUseAdaptation; - -use PhpParser\Node; - -class Alias extends Node\Stmt\TraitUseAdaptation -{ - /** @var null|int New modifier */ - public $newModifier; - /** @var null|Node\Identifier New name */ - public $newName; - - /** - * Constructs a trait use precedence adaptation node. - * - * @param null|Node\Name $trait Trait name - * @param string|Node\Identifier $method Method name - * @param null|int $newModifier New modifier - * @param null|string|Node\Identifier $newName New name - * @param array $attributes Additional attributes - */ - public function __construct($trait, $method, $newModifier, $newName, array $attributes = []) { - $this->attributes = $attributes; - $this->trait = $trait; - $this->method = \is_string($method) ? new Node\Identifier($method) : $method; - $this->newModifier = $newModifier; - $this->newName = \is_string($newName) ? new Node\Identifier($newName) : $newName; - } - - public function getSubNodeNames() : array { - return ['trait', 'method', 'newModifier', 'newName']; - } - - public function getType() : string { - return 'Stmt_TraitUseAdaptation_Alias'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php deleted file mode 100644 index 80385f64..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt\TraitUseAdaptation; - -use PhpParser\Node; - -class Precedence extends Node\Stmt\TraitUseAdaptation -{ - /** @var Node\Name[] Overwritten traits */ - public $insteadof; - - /** - * Constructs a trait use precedence adaptation node. - * - * @param Node\Name $trait Trait name - * @param string|Node\Identifier $method Method name - * @param Node\Name[] $insteadof Overwritten traits - * @param array $attributes Additional attributes - */ - public function __construct(Node\Name $trait, $method, array $insteadof, array $attributes = []) { - $this->attributes = $attributes; - $this->trait = $trait; - $this->method = \is_string($method) ? new Node\Identifier($method) : $method; - $this->insteadof = $insteadof; - } - - public function getSubNodeNames() : array { - return ['trait', 'method', 'insteadof']; - } - - public function getType() : string { - return 'Stmt_TraitUseAdaptation_Precedence'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Trait_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Trait_.php deleted file mode 100644 index 0cec203a..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Trait_.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; - -class Trait_ extends ClassLike -{ - /** - * Constructs a trait node. - * - * @param string|Node\Identifier $name Name - * @param array $subNodes Array of the following optional subnodes: - * 'stmts' => array(): Statements - * 'attrGroups' => array(): PHP attribute groups - * @param array $attributes Additional attributes - */ - public function __construct($name, array $subNodes = [], array $attributes = []) { - $this->attributes = $attributes; - $this->name = \is_string($name) ? new Node\Identifier($name) : $name; - $this->stmts = $subNodes['stmts'] ?? []; - $this->attrGroups = $subNodes['attrGroups'] ?? []; - } - - public function getSubNodeNames() : array { - return ['attrGroups', 'name', 'stmts']; - } - - public function getType() : string { - return 'Stmt_Trait'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php deleted file mode 100644 index 7fc158c5..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; - -class TryCatch extends Node\Stmt -{ - /** @var Node\Stmt[] Statements */ - public $stmts; - /** @var Catch_[] Catches */ - public $catches; - /** @var null|Finally_ Optional finally node */ - public $finally; - - /** - * Constructs a try catch node. - * - * @param Node\Stmt[] $stmts Statements - * @param Catch_[] $catches Catches - * @param null|Finally_ $finally Optional finally node - * @param array $attributes Additional attributes - */ - public function __construct(array $stmts, array $catches, Finally_ $finally = null, array $attributes = []) { - $this->attributes = $attributes; - $this->stmts = $stmts; - $this->catches = $catches; - $this->finally = $finally; - } - - public function getSubNodeNames() : array { - return ['stmts', 'catches', 'finally']; - } - - public function getType() : string { - return 'Stmt_TryCatch'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Unset_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Unset_.php deleted file mode 100644 index 310e427a..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Unset_.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; - -class Unset_ extends Node\Stmt -{ - /** @var Node\Expr[] Variables to unset */ - public $vars; - - /** - * Constructs an unset node. - * - * @param Node\Expr[] $vars Variables to unset - * @param array $attributes Additional attributes - */ - public function __construct(array $vars, array $attributes = []) { - $this->attributes = $attributes; - $this->vars = $vars; - } - - public function getSubNodeNames() : array { - return ['vars']; - } - - public function getType() : string { - return 'Stmt_Unset'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/UseUse.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/UseUse.php deleted file mode 100644 index 32bd7847..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/UseUse.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; -use PhpParser\Node\Identifier; - -class UseUse extends Node\Stmt -{ - /** @var int One of the Stmt\Use_::TYPE_* constants. Will only differ from TYPE_UNKNOWN for mixed group uses */ - public $type; - /** @var Node\Name Namespace, class, function or constant to alias */ - public $name; - /** @var Identifier|null Alias */ - public $alias; - - /** - * Constructs an alias (use) node. - * - * @param Node\Name $name Namespace/Class to alias - * @param null|string|Identifier $alias Alias - * @param int $type Type of the use element (for mixed group use only) - * @param array $attributes Additional attributes - */ - public function __construct(Node\Name $name, $alias = null, int $type = Use_::TYPE_UNKNOWN, array $attributes = []) { - $this->attributes = $attributes; - $this->type = $type; - $this->name = $name; - $this->alias = \is_string($alias) ? new Identifier($alias) : $alias; - } - - public function getSubNodeNames() : array { - return ['type', 'name', 'alias']; - } - - /** - * Get alias. If not explicitly given this is the last component of the used name. - * - * @return Identifier - */ - public function getAlias() : Identifier { - if (null !== $this->alias) { - return $this->alias; - } - - return new Identifier($this->name->getLast()); - } - - public function getType() : string { - return 'Stmt_UseUse'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Use_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Use_.php deleted file mode 100644 index 8753da31..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Use_.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node\Stmt; - -class Use_ extends Stmt -{ - /** - * Unknown type. Both Stmt\Use_ / Stmt\GroupUse and Stmt\UseUse have a $type property, one of them will always be - * TYPE_UNKNOWN while the other has one of the three other possible types. For normal use statements the type on the - * Stmt\UseUse is unknown. It's only the other way around for mixed group use declarations. - */ - const TYPE_UNKNOWN = 0; - /** Class or namespace import */ - const TYPE_NORMAL = 1; - /** Function import */ - const TYPE_FUNCTION = 2; - /** Constant import */ - const TYPE_CONSTANT = 3; - - /** @var int Type of alias */ - public $type; - /** @var UseUse[] Aliases */ - public $uses; - - /** - * Constructs an alias (use) list node. - * - * @param UseUse[] $uses Aliases - * @param int $type Type of alias - * @param array $attributes Additional attributes - */ - public function __construct(array $uses, int $type = self::TYPE_NORMAL, array $attributes = []) { - $this->attributes = $attributes; - $this->type = $type; - $this->uses = $uses; - } - - public function getSubNodeNames() : array { - return ['type', 'uses']; - } - - public function getType() : string { - return 'Stmt_Use'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/While_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/While_.php deleted file mode 100644 index f41034f8..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/While_.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node\Stmt; - -use PhpParser\Node; - -class While_ extends Node\Stmt -{ - /** @var Node\Expr Condition */ - public $cond; - /** @var Node\Stmt[] Statements */ - public $stmts; - - /** - * Constructs a while node. - * - * @param Node\Expr $cond Condition - * @param Node\Stmt[] $stmts Statements - * @param array $attributes Additional attributes - */ - public function __construct(Node\Expr $cond, array $stmts = [], array $attributes = []) { - $this->attributes = $attributes; - $this->cond = $cond; - $this->stmts = $stmts; - } - - public function getSubNodeNames() : array { - return ['cond', 'stmts']; - } - - public function getType() : string { - return 'Stmt_While'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/UnionType.php b/vendor/nikic/php-parser/lib/PhpParser/Node/UnionType.php deleted file mode 100644 index 93cecd23..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/UnionType.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node; - -class UnionType extends ComplexType -{ - /** @var (Identifier|Name|IntersectionType)[] Types */ - public $types; - - /** - * Constructs a union type. - * - * @param (Identifier|Name|IntersectionType)[] $types Types - * @param array $attributes Additional attributes - */ - public function __construct(array $types, array $attributes = []) { - $this->attributes = $attributes; - $this->types = $types; - } - - public function getSubNodeNames() : array { - return ['types']; - } - - public function getType() : string { - return 'UnionType'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/VarLikeIdentifier.php b/vendor/nikic/php-parser/lib/PhpParser/Node/VarLikeIdentifier.php deleted file mode 100644 index a30807a6..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/VarLikeIdentifier.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node; - -/** - * Represents a name that is written in source code with a leading dollar, - * but is not a proper variable. The leading dollar is not stored as part of the name. - * - * Examples: Names in property declarations are formatted as variables. Names in static property - * lookups are also formatted as variables. - */ -class VarLikeIdentifier extends Identifier -{ - public function getType() : string { - return 'VarLikeIdentifier'; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/VariadicPlaceholder.php b/vendor/nikic/php-parser/lib/PhpParser/Node/VariadicPlaceholder.php deleted file mode 100644 index 403a24df..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/VariadicPlaceholder.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Node; - -use PhpParser\NodeAbstract; - -/** - * Represents the "..." in "foo(...)" of the first-class callable syntax. - */ -class VariadicPlaceholder extends NodeAbstract { - /** - * Create a variadic argument placeholder (first-class callable syntax). - * - * @param array $attributes Additional attributes - */ - public function __construct(array $attributes = []) { - $this->attributes = $attributes; - } - - public function getType(): string { - return 'VariadicPlaceholder'; - } - - public function getSubNodeNames(): array { - return []; - } -} \ No newline at end of file diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php b/vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php deleted file mode 100644 index 04514da1..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php +++ /dev/null @@ -1,178 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser; - -abstract class NodeAbstract implements Node, \JsonSerializable -{ - protected $attributes; - - /** - * Creates a Node. - * - * @param array $attributes Array of attributes - */ - public function __construct(array $attributes = []) { - $this->attributes = $attributes; - } - - /** - * Gets line the node started in (alias of getStartLine). - * - * @return int Start line (or -1 if not available) - */ - public function getLine() : int { - return $this->attributes['startLine'] ?? -1; - } - - /** - * Gets line the node started in. - * - * Requires the 'startLine' attribute to be enabled in the lexer (enabled by default). - * - * @return int Start line (or -1 if not available) - */ - public function getStartLine() : int { - return $this->attributes['startLine'] ?? -1; - } - - /** - * Gets the line the node ended in. - * - * Requires the 'endLine' attribute to be enabled in the lexer (enabled by default). - * - * @return int End line (or -1 if not available) - */ - public function getEndLine() : int { - return $this->attributes['endLine'] ?? -1; - } - - /** - * Gets the token offset of the first token that is part of this node. - * - * The offset is an index into the array returned by Lexer::getTokens(). - * - * Requires the 'startTokenPos' attribute to be enabled in the lexer (DISABLED by default). - * - * @return int Token start position (or -1 if not available) - */ - public function getStartTokenPos() : int { - return $this->attributes['startTokenPos'] ?? -1; - } - - /** - * Gets the token offset of the last token that is part of this node. - * - * The offset is an index into the array returned by Lexer::getTokens(). - * - * Requires the 'endTokenPos' attribute to be enabled in the lexer (DISABLED by default). - * - * @return int Token end position (or -1 if not available) - */ - public function getEndTokenPos() : int { - return $this->attributes['endTokenPos'] ?? -1; - } - - /** - * Gets the file offset of the first character that is part of this node. - * - * Requires the 'startFilePos' attribute to be enabled in the lexer (DISABLED by default). - * - * @return int File start position (or -1 if not available) - */ - public function getStartFilePos() : int { - return $this->attributes['startFilePos'] ?? -1; - } - - /** - * Gets the file offset of the last character that is part of this node. - * - * Requires the 'endFilePos' attribute to be enabled in the lexer (DISABLED by default). - * - * @return int File end position (or -1 if not available) - */ - public function getEndFilePos() : int { - return $this->attributes['endFilePos'] ?? -1; - } - - /** - * Gets all comments directly preceding this node. - * - * The comments are also available through the "comments" attribute. - * - * @return Comment[] - */ - public function getComments() : array { - return $this->attributes['comments'] ?? []; - } - - /** - * Gets the doc comment of the node. - * - * @return null|Comment\Doc Doc comment object or null - */ - public function getDocComment() { - $comments = $this->getComments(); - for ($i = count($comments) - 1; $i >= 0; $i--) { - $comment = $comments[$i]; - if ($comment instanceof Comment\Doc) { - return $comment; - } - } - - return null; - } - - /** - * Sets the doc comment of the node. - * - * This will either replace an existing doc comment or add it to the comments array. - * - * @param Comment\Doc $docComment Doc comment to set - */ - public function setDocComment(Comment\Doc $docComment) { - $comments = $this->getComments(); - for ($i = count($comments) - 1; $i >= 0; $i--) { - if ($comments[$i] instanceof Comment\Doc) { - // Replace existing doc comment. - $comments[$i] = $docComment; - $this->setAttribute('comments', $comments); - return; - } - } - - // Append new doc comment. - $comments[] = $docComment; - $this->setAttribute('comments', $comments); - } - - public function setAttribute(string $key, $value) { - $this->attributes[$key] = $value; - } - - public function hasAttribute(string $key) : bool { - return array_key_exists($key, $this->attributes); - } - - public function getAttribute(string $key, $default = null) { - if (array_key_exists($key, $this->attributes)) { - return $this->attributes[$key]; - } - - return $default; - } - - public function getAttributes() : array { - return $this->attributes; - } - - public function setAttributes(array $attributes) { - $this->attributes = $attributes; - } - - /** - * @return array - */ - public function jsonSerialize() : array { - return ['nodeType' => $this->getType()] + get_object_vars($this); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeDumper.php b/vendor/nikic/php-parser/lib/PhpParser/NodeDumper.php deleted file mode 100644 index ba622efd..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeDumper.php +++ /dev/null @@ -1,206 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser; - -use PhpParser\Node\Expr\Include_; -use PhpParser\Node\Stmt\Class_; -use PhpParser\Node\Stmt\GroupUse; -use PhpParser\Node\Stmt\Use_; -use PhpParser\Node\Stmt\UseUse; - -class NodeDumper -{ - private $dumpComments; - private $dumpPositions; - private $code; - - /** - * Constructs a NodeDumper. - * - * Supported options: - * * bool dumpComments: Whether comments should be dumped. - * * bool dumpPositions: Whether line/offset information should be dumped. To dump offset - * information, the code needs to be passed to dump(). - * - * @param array $options Options (see description) - */ - public function __construct(array $options = []) { - $this->dumpComments = !empty($options['dumpComments']); - $this->dumpPositions = !empty($options['dumpPositions']); - } - - /** - * Dumps a node or array. - * - * @param array|Node $node Node or array to dump - * @param string|null $code Code corresponding to dumped AST. This only needs to be passed if - * the dumpPositions option is enabled and the dumping of node offsets - * is desired. - * - * @return string Dumped value - */ - public function dump($node, string $code = null) : string { - $this->code = $code; - return $this->dumpRecursive($node); - } - - protected function dumpRecursive($node) { - if ($node instanceof Node) { - $r = $node->getType(); - if ($this->dumpPositions && null !== $p = $this->dumpPosition($node)) { - $r .= $p; - } - $r .= '('; - - foreach ($node->getSubNodeNames() as $key) { - $r .= "\n " . $key . ': '; - - $value = $node->$key; - if (null === $value) { - $r .= 'null'; - } elseif (false === $value) { - $r .= 'false'; - } elseif (true === $value) { - $r .= 'true'; - } elseif (is_scalar($value)) { - if ('flags' === $key || 'newModifier' === $key) { - $r .= $this->dumpFlags($value); - } elseif ('type' === $key && $node instanceof Include_) { - $r .= $this->dumpIncludeType($value); - } elseif ('type' === $key - && ($node instanceof Use_ || $node instanceof UseUse || $node instanceof GroupUse)) { - $r .= $this->dumpUseType($value); - } else { - $r .= $value; - } - } else { - $r .= str_replace("\n", "\n ", $this->dumpRecursive($value)); - } - } - - if ($this->dumpComments && $comments = $node->getComments()) { - $r .= "\n comments: " . str_replace("\n", "\n ", $this->dumpRecursive($comments)); - } - } elseif (is_array($node)) { - $r = 'array('; - - foreach ($node as $key => $value) { - $r .= "\n " . $key . ': '; - - if (null === $value) { - $r .= 'null'; - } elseif (false === $value) { - $r .= 'false'; - } elseif (true === $value) { - $r .= 'true'; - } elseif (is_scalar($value)) { - $r .= $value; - } else { - $r .= str_replace("\n", "\n ", $this->dumpRecursive($value)); - } - } - } elseif ($node instanceof Comment) { - return $node->getReformattedText(); - } else { - throw new \InvalidArgumentException('Can only dump nodes and arrays.'); - } - - return $r . "\n)"; - } - - protected function dumpFlags($flags) { - $strs = []; - if ($flags & Class_::MODIFIER_PUBLIC) { - $strs[] = 'MODIFIER_PUBLIC'; - } - if ($flags & Class_::MODIFIER_PROTECTED) { - $strs[] = 'MODIFIER_PROTECTED'; - } - if ($flags & Class_::MODIFIER_PRIVATE) { - $strs[] = 'MODIFIER_PRIVATE'; - } - if ($flags & Class_::MODIFIER_ABSTRACT) { - $strs[] = 'MODIFIER_ABSTRACT'; - } - if ($flags & Class_::MODIFIER_STATIC) { - $strs[] = 'MODIFIER_STATIC'; - } - if ($flags & Class_::MODIFIER_FINAL) { - $strs[] = 'MODIFIER_FINAL'; - } - if ($flags & Class_::MODIFIER_READONLY) { - $strs[] = 'MODIFIER_READONLY'; - } - - if ($strs) { - return implode(' | ', $strs) . ' (' . $flags . ')'; - } else { - return $flags; - } - } - - protected function dumpIncludeType($type) { - $map = [ - Include_::TYPE_INCLUDE => 'TYPE_INCLUDE', - Include_::TYPE_INCLUDE_ONCE => 'TYPE_INCLUDE_ONCE', - Include_::TYPE_REQUIRE => 'TYPE_REQUIRE', - Include_::TYPE_REQUIRE_ONCE => 'TYPE_REQUIRE_ONCE', - ]; - - if (!isset($map[$type])) { - return $type; - } - return $map[$type] . ' (' . $type . ')'; - } - - protected function dumpUseType($type) { - $map = [ - Use_::TYPE_UNKNOWN => 'TYPE_UNKNOWN', - Use_::TYPE_NORMAL => 'TYPE_NORMAL', - Use_::TYPE_FUNCTION => 'TYPE_FUNCTION', - Use_::TYPE_CONSTANT => 'TYPE_CONSTANT', - ]; - - if (!isset($map[$type])) { - return $type; - } - return $map[$type] . ' (' . $type . ')'; - } - - /** - * Dump node position, if possible. - * - * @param Node $node Node for which to dump position - * - * @return string|null Dump of position, or null if position information not available - */ - protected function dumpPosition(Node $node) { - if (!$node->hasAttribute('startLine') || !$node->hasAttribute('endLine')) { - return null; - } - - $start = $node->getStartLine(); - $end = $node->getEndLine(); - if ($node->hasAttribute('startFilePos') && $node->hasAttribute('endFilePos') - && null !== $this->code - ) { - $start .= ':' . $this->toColumn($this->code, $node->getStartFilePos()); - $end .= ':' . $this->toColumn($this->code, $node->getEndFilePos()); - } - return "[$start - $end]"; - } - - // Copied from Error class - private function toColumn($code, $pos) { - if ($pos > strlen($code)) { - throw new \RuntimeException('Invalid position information'); - } - - $lineStartPos = strrpos($code, "\n", $pos - strlen($code)); - if (false === $lineStartPos) { - $lineStartPos = -1; - } - - return $pos - $lineStartPos; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeFinder.php b/vendor/nikic/php-parser/lib/PhpParser/NodeFinder.php deleted file mode 100644 index 2e7cfdad..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeFinder.php +++ /dev/null @@ -1,81 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser; - -use PhpParser\NodeVisitor\FindingVisitor; -use PhpParser\NodeVisitor\FirstFindingVisitor; - -class NodeFinder -{ - /** - * Find all nodes satisfying a filter callback. - * - * @param Node|Node[] $nodes Single node or array of nodes to search in - * @param callable $filter Filter callback: function(Node $node) : bool - * - * @return Node[] Found nodes satisfying the filter callback - */ - public function find($nodes, callable $filter) : array { - if (!is_array($nodes)) { - $nodes = [$nodes]; - } - - $visitor = new FindingVisitor($filter); - - $traverser = new NodeTraverser; - $traverser->addVisitor($visitor); - $traverser->traverse($nodes); - - return $visitor->getFoundNodes(); - } - - /** - * Find all nodes that are instances of a certain class. - * - * @param Node|Node[] $nodes Single node or array of nodes to search in - * @param string $class Class name - * - * @return Node[] Found nodes (all instances of $class) - */ - public function findInstanceOf($nodes, string $class) : array { - return $this->find($nodes, function ($node) use ($class) { - return $node instanceof $class; - }); - } - - /** - * Find first node satisfying a filter callback. - * - * @param Node|Node[] $nodes Single node or array of nodes to search in - * @param callable $filter Filter callback: function(Node $node) : bool - * - * @return null|Node Found node (or null if none found) - */ - public function findFirst($nodes, callable $filter) { - if (!is_array($nodes)) { - $nodes = [$nodes]; - } - - $visitor = new FirstFindingVisitor($filter); - - $traverser = new NodeTraverser; - $traverser->addVisitor($visitor); - $traverser->traverse($nodes); - - return $visitor->getFoundNode(); - } - - /** - * Find first node that is an instance of a certain class. - * - * @param Node|Node[] $nodes Single node or array of nodes to search in - * @param string $class Class name - * - * @return null|Node Found node, which is an instance of $class (or null if none found) - */ - public function findFirstInstanceOf($nodes, string $class) { - return $this->findFirst($nodes, function ($node) use ($class) { - return $node instanceof $class; - }); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php b/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php deleted file mode 100644 index 97d45bda..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php +++ /dev/null @@ -1,291 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser; - -class NodeTraverser implements NodeTraverserInterface -{ - /** - * If NodeVisitor::enterNode() returns DONT_TRAVERSE_CHILDREN, child nodes - * of the current node will not be traversed for any visitors. - * - * For subsequent visitors enterNode() will still be called on the current - * node and leaveNode() will also be invoked for the current node. - */ - const DONT_TRAVERSE_CHILDREN = 1; - - /** - * If NodeVisitor::enterNode() or NodeVisitor::leaveNode() returns - * STOP_TRAVERSAL, traversal is aborted. - * - * The afterTraverse() method will still be invoked. - */ - const STOP_TRAVERSAL = 2; - - /** - * If NodeVisitor::leaveNode() returns REMOVE_NODE for a node that occurs - * in an array, it will be removed from the array. - * - * For subsequent visitors leaveNode() will still be invoked for the - * removed node. - */ - const REMOVE_NODE = 3; - - /** - * If NodeVisitor::enterNode() returns DONT_TRAVERSE_CURRENT_AND_CHILDREN, child nodes - * of the current node will not be traversed for any visitors. - * - * For subsequent visitors enterNode() will not be called as well. - * leaveNode() will be invoked for visitors that has enterNode() method invoked. - */ - const DONT_TRAVERSE_CURRENT_AND_CHILDREN = 4; - - /** @var NodeVisitor[] Visitors */ - protected $visitors = []; - - /** @var bool Whether traversal should be stopped */ - protected $stopTraversal; - - public function __construct() { - // for BC - } - - /** - * Adds a visitor. - * - * @param NodeVisitor $visitor Visitor to add - */ - public function addVisitor(NodeVisitor $visitor) { - $this->visitors[] = $visitor; - } - - /** - * Removes an added visitor. - * - * @param NodeVisitor $visitor - */ - public function removeVisitor(NodeVisitor $visitor) { - foreach ($this->visitors as $index => $storedVisitor) { - if ($storedVisitor === $visitor) { - unset($this->visitors[$index]); - break; - } - } - } - - /** - * Traverses an array of nodes using the registered visitors. - * - * @param Node[] $nodes Array of nodes - * - * @return Node[] Traversed array of nodes - */ - public function traverse(array $nodes) : array { - $this->stopTraversal = false; - - foreach ($this->visitors as $visitor) { - if (null !== $return = $visitor->beforeTraverse($nodes)) { - $nodes = $return; - } - } - - $nodes = $this->traverseArray($nodes); - - foreach ($this->visitors as $visitor) { - if (null !== $return = $visitor->afterTraverse($nodes)) { - $nodes = $return; - } - } - - return $nodes; - } - - /** - * Recursively traverse a node. - * - * @param Node $node Node to traverse. - * - * @return Node Result of traversal (may be original node or new one) - */ - protected function traverseNode(Node $node) : Node { - foreach ($node->getSubNodeNames() as $name) { - $subNode =& $node->$name; - - if (\is_array($subNode)) { - $subNode = $this->traverseArray($subNode); - if ($this->stopTraversal) { - break; - } - } elseif ($subNode instanceof Node) { - $traverseChildren = true; - $breakVisitorIndex = null; - - foreach ($this->visitors as $visitorIndex => $visitor) { - $return = $visitor->enterNode($subNode); - if (null !== $return) { - if ($return instanceof Node) { - $this->ensureReplacementReasonable($subNode, $return); - $subNode = $return; - } elseif (self::DONT_TRAVERSE_CHILDREN === $return) { - $traverseChildren = false; - } elseif (self::DONT_TRAVERSE_CURRENT_AND_CHILDREN === $return) { - $traverseChildren = false; - $breakVisitorIndex = $visitorIndex; - break; - } elseif (self::STOP_TRAVERSAL === $return) { - $this->stopTraversal = true; - break 2; - } else { - throw new \LogicException( - 'enterNode() returned invalid value of type ' . gettype($return) - ); - } - } - } - - if ($traverseChildren) { - $subNode = $this->traverseNode($subNode); - if ($this->stopTraversal) { - break; - } - } - - foreach ($this->visitors as $visitorIndex => $visitor) { - $return = $visitor->leaveNode($subNode); - - if (null !== $return) { - if ($return instanceof Node) { - $this->ensureReplacementReasonable($subNode, $return); - $subNode = $return; - } elseif (self::STOP_TRAVERSAL === $return) { - $this->stopTraversal = true; - break 2; - } elseif (\is_array($return)) { - throw new \LogicException( - 'leaveNode() may only return an array ' . - 'if the parent structure is an array' - ); - } else { - throw new \LogicException( - 'leaveNode() returned invalid value of type ' . gettype($return) - ); - } - } - - if ($breakVisitorIndex === $visitorIndex) { - break; - } - } - } - } - - return $node; - } - - /** - * Recursively traverse array (usually of nodes). - * - * @param array $nodes Array to traverse - * - * @return array Result of traversal (may be original array or changed one) - */ - protected function traverseArray(array $nodes) : array { - $doNodes = []; - - foreach ($nodes as $i => &$node) { - if ($node instanceof Node) { - $traverseChildren = true; - $breakVisitorIndex = null; - - foreach ($this->visitors as $visitorIndex => $visitor) { - $return = $visitor->enterNode($node); - if (null !== $return) { - if ($return instanceof Node) { - $this->ensureReplacementReasonable($node, $return); - $node = $return; - } elseif (self::DONT_TRAVERSE_CHILDREN === $return) { - $traverseChildren = false; - } elseif (self::DONT_TRAVERSE_CURRENT_AND_CHILDREN === $return) { - $traverseChildren = false; - $breakVisitorIndex = $visitorIndex; - break; - } elseif (self::STOP_TRAVERSAL === $return) { - $this->stopTraversal = true; - break 2; - } else { - throw new \LogicException( - 'enterNode() returned invalid value of type ' . gettype($return) - ); - } - } - } - - if ($traverseChildren) { - $node = $this->traverseNode($node); - if ($this->stopTraversal) { - break; - } - } - - foreach ($this->visitors as $visitorIndex => $visitor) { - $return = $visitor->leaveNode($node); - - if (null !== $return) { - if ($return instanceof Node) { - $this->ensureReplacementReasonable($node, $return); - $node = $return; - } elseif (\is_array($return)) { - $doNodes[] = [$i, $return]; - break; - } elseif (self::REMOVE_NODE === $return) { - $doNodes[] = [$i, []]; - break; - } elseif (self::STOP_TRAVERSAL === $return) { - $this->stopTraversal = true; - break 2; - } elseif (false === $return) { - throw new \LogicException( - 'bool(false) return from leaveNode() no longer supported. ' . - 'Return NodeTraverser::REMOVE_NODE instead' - ); - } else { - throw new \LogicException( - 'leaveNode() returned invalid value of type ' . gettype($return) - ); - } - } - - if ($breakVisitorIndex === $visitorIndex) { - break; - } - } - } elseif (\is_array($node)) { - throw new \LogicException('Invalid node structure: Contains nested arrays'); - } - } - - if (!empty($doNodes)) { - while (list($i, $replace) = array_pop($doNodes)) { - array_splice($nodes, $i, 1, $replace); - } - } - - return $nodes; - } - - private function ensureReplacementReasonable($old, $new) { - if ($old instanceof Node\Stmt && $new instanceof Node\Expr) { - throw new \LogicException( - "Trying to replace statement ({$old->getType()}) " . - "with expression ({$new->getType()}). Are you missing a " . - "Stmt_Expression wrapper?" - ); - } - - if ($old instanceof Node\Expr && $new instanceof Node\Stmt) { - throw new \LogicException( - "Trying to replace expression ({$old->getType()}) " . - "with statement ({$new->getType()})" - ); - } - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeTraverserInterface.php b/vendor/nikic/php-parser/lib/PhpParser/NodeTraverserInterface.php deleted file mode 100644 index 77ff3d27..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeTraverserInterface.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser; - -interface NodeTraverserInterface -{ - /** - * Adds a visitor. - * - * @param NodeVisitor $visitor Visitor to add - */ - public function addVisitor(NodeVisitor $visitor); - - /** - * Removes an added visitor. - * - * @param NodeVisitor $visitor - */ - public function removeVisitor(NodeVisitor $visitor); - - /** - * Traverses an array of nodes using the registered visitors. - * - * @param Node[] $nodes Array of nodes - * - * @return Node[] Traversed array of nodes - */ - public function traverse(array $nodes) : array; -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor.php b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor.php deleted file mode 100644 index f1f7f3e3..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor.php +++ /dev/null @@ -1,72 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser; - -interface NodeVisitor -{ - /** - * Called once before traversal. - * - * Return value semantics: - * * null: $nodes stays as-is - * * otherwise: $nodes is set to the return value - * - * @param Node[] $nodes Array of nodes - * - * @return null|Node[] Array of nodes - */ - public function beforeTraverse(array $nodes); - - /** - * Called when entering a node. - * - * Return value semantics: - * * null - * => $node stays as-is - * * NodeTraverser::DONT_TRAVERSE_CHILDREN - * => Children of $node are not traversed. $node stays as-is - * * NodeTraverser::STOP_TRAVERSAL - * => Traversal is aborted. $node stays as-is - * * otherwise - * => $node is set to the return value - * - * @param Node $node Node - * - * @return null|int|Node Replacement node (or special return value) - */ - public function enterNode(Node $node); - - /** - * Called when leaving a node. - * - * Return value semantics: - * * null - * => $node stays as-is - * * NodeTraverser::REMOVE_NODE - * => $node is removed from the parent array - * * NodeTraverser::STOP_TRAVERSAL - * => Traversal is aborted. $node stays as-is - * * array (of Nodes) - * => The return value is merged into the parent array (at the position of the $node) - * * otherwise - * => $node is set to the return value - * - * @param Node $node Node - * - * @return null|int|Node|Node[] Replacement node (or special return value) - */ - public function leaveNode(Node $node); - - /** - * Called once after traversal. - * - * Return value semantics: - * * null: $nodes stays as-is - * * otherwise: $nodes is set to the return value - * - * @param Node[] $nodes Array of nodes - * - * @return null|Node[] Array of nodes - */ - public function afterTraverse(array $nodes); -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CloningVisitor.php b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CloningVisitor.php deleted file mode 100644 index a85fa493..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CloningVisitor.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\NodeVisitor; - -use PhpParser\Node; -use PhpParser\NodeVisitorAbstract; - -/** - * Visitor cloning all nodes and linking to the original nodes using an attribute. - * - * This visitor is required to perform format-preserving pretty prints. - */ -class CloningVisitor extends NodeVisitorAbstract -{ - public function enterNode(Node $origNode) { - $node = clone $origNode; - $node->setAttribute('origNode', $origNode); - return $node; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FindingVisitor.php b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FindingVisitor.php deleted file mode 100644 index 9531edbc..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FindingVisitor.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\NodeVisitor; - -use PhpParser\Node; -use PhpParser\NodeVisitorAbstract; - -/** - * This visitor can be used to find and collect all nodes satisfying some criterion determined by - * a filter callback. - */ -class FindingVisitor extends NodeVisitorAbstract -{ - /** @var callable Filter callback */ - protected $filterCallback; - /** @var Node[] Found nodes */ - protected $foundNodes; - - public function __construct(callable $filterCallback) { - $this->filterCallback = $filterCallback; - } - - /** - * Get found nodes satisfying the filter callback. - * - * Nodes are returned in pre-order. - * - * @return Node[] Found nodes - */ - public function getFoundNodes() : array { - return $this->foundNodes; - } - - public function beforeTraverse(array $nodes) { - $this->foundNodes = []; - - return null; - } - - public function enterNode(Node $node) { - $filterCallback = $this->filterCallback; - if ($filterCallback($node)) { - $this->foundNodes[] = $node; - } - - return null; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FirstFindingVisitor.php b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FirstFindingVisitor.php deleted file mode 100644 index 596a7d7f..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FirstFindingVisitor.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\NodeVisitor; - -use PhpParser\Node; -use PhpParser\NodeTraverser; -use PhpParser\NodeVisitorAbstract; - -/** - * This visitor can be used to find the first node satisfying some criterion determined by - * a filter callback. - */ -class FirstFindingVisitor extends NodeVisitorAbstract -{ - /** @var callable Filter callback */ - protected $filterCallback; - /** @var null|Node Found node */ - protected $foundNode; - - public function __construct(callable $filterCallback) { - $this->filterCallback = $filterCallback; - } - - /** - * Get found node satisfying the filter callback. - * - * Returns null if no node satisfies the filter callback. - * - * @return null|Node Found node (or null if not found) - */ - public function getFoundNode() { - return $this->foundNode; - } - - public function beforeTraverse(array $nodes) { - $this->foundNode = null; - - return null; - } - - public function enterNode(Node $node) { - $filterCallback = $this->filterCallback; - if ($filterCallback($node)) { - $this->foundNode = $node; - return NodeTraverser::STOP_TRAVERSAL; - } - - return null; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php deleted file mode 100644 index 8e259c57..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php +++ /dev/null @@ -1,257 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\NodeVisitor; - -use PhpParser\ErrorHandler; -use PhpParser\NameContext; -use PhpParser\Node; -use PhpParser\Node\Expr; -use PhpParser\Node\Name; -use PhpParser\Node\Name\FullyQualified; -use PhpParser\Node\Stmt; -use PhpParser\NodeVisitorAbstract; - -class NameResolver extends NodeVisitorAbstract -{ - /** @var NameContext Naming context */ - protected $nameContext; - - /** @var bool Whether to preserve original names */ - protected $preserveOriginalNames; - - /** @var bool Whether to replace resolved nodes in place, or to add resolvedNode attributes */ - protected $replaceNodes; - - /** - * Constructs a name resolution visitor. - * - * Options: - * * preserveOriginalNames (default false): An "originalName" attribute will be added to - * all name nodes that underwent resolution. - * * replaceNodes (default true): Resolved names are replaced in-place. Otherwise, a - * resolvedName attribute is added. (Names that cannot be statically resolved receive a - * namespacedName attribute, as usual.) - * - * @param ErrorHandler|null $errorHandler Error handler - * @param array $options Options - */ - public function __construct(ErrorHandler $errorHandler = null, array $options = []) { - $this->nameContext = new NameContext($errorHandler ?? new ErrorHandler\Throwing); - $this->preserveOriginalNames = $options['preserveOriginalNames'] ?? false; - $this->replaceNodes = $options['replaceNodes'] ?? true; - } - - /** - * Get name resolution context. - * - * @return NameContext - */ - public function getNameContext() : NameContext { - return $this->nameContext; - } - - public function beforeTraverse(array $nodes) { - $this->nameContext->startNamespace(); - return null; - } - - public function enterNode(Node $node) { - if ($node instanceof Stmt\Namespace_) { - $this->nameContext->startNamespace($node->name); - } elseif ($node instanceof Stmt\Use_) { - foreach ($node->uses as $use) { - $this->addAlias($use, $node->type, null); - } - } elseif ($node instanceof Stmt\GroupUse) { - foreach ($node->uses as $use) { - $this->addAlias($use, $node->type, $node->prefix); - } - } elseif ($node instanceof Stmt\Class_) { - if (null !== $node->extends) { - $node->extends = $this->resolveClassName($node->extends); - } - - foreach ($node->implements as &$interface) { - $interface = $this->resolveClassName($interface); - } - - $this->resolveAttrGroups($node); - if (null !== $node->name) { - $this->addNamespacedName($node); - } - } elseif ($node instanceof Stmt\Interface_) { - foreach ($node->extends as &$interface) { - $interface = $this->resolveClassName($interface); - } - - $this->resolveAttrGroups($node); - $this->addNamespacedName($node); - } elseif ($node instanceof Stmt\Enum_) { - foreach ($node->implements as &$interface) { - $interface = $this->resolveClassName($interface); - } - - $this->resolveAttrGroups($node); - if (null !== $node->name) { - $this->addNamespacedName($node); - } - } elseif ($node instanceof Stmt\Trait_) { - $this->resolveAttrGroups($node); - $this->addNamespacedName($node); - } elseif ($node instanceof Stmt\Function_) { - $this->resolveSignature($node); - $this->resolveAttrGroups($node); - $this->addNamespacedName($node); - } elseif ($node instanceof Stmt\ClassMethod - || $node instanceof Expr\Closure - || $node instanceof Expr\ArrowFunction - ) { - $this->resolveSignature($node); - $this->resolveAttrGroups($node); - } elseif ($node instanceof Stmt\Property) { - if (null !== $node->type) { - $node->type = $this->resolveType($node->type); - } - $this->resolveAttrGroups($node); - } elseif ($node instanceof Stmt\Const_) { - foreach ($node->consts as $const) { - $this->addNamespacedName($const); - } - } else if ($node instanceof Stmt\ClassConst) { - $this->resolveAttrGroups($node); - } else if ($node instanceof Stmt\EnumCase) { - $this->resolveAttrGroups($node); - } elseif ($node instanceof Expr\StaticCall - || $node instanceof Expr\StaticPropertyFetch - || $node instanceof Expr\ClassConstFetch - || $node instanceof Expr\New_ - || $node instanceof Expr\Instanceof_ - ) { - if ($node->class instanceof Name) { - $node->class = $this->resolveClassName($node->class); - } - } elseif ($node instanceof Stmt\Catch_) { - foreach ($node->types as &$type) { - $type = $this->resolveClassName($type); - } - } elseif ($node instanceof Expr\FuncCall) { - if ($node->name instanceof Name) { - $node->name = $this->resolveName($node->name, Stmt\Use_::TYPE_FUNCTION); - } - } elseif ($node instanceof Expr\ConstFetch) { - $node->name = $this->resolveName($node->name, Stmt\Use_::TYPE_CONSTANT); - } elseif ($node instanceof Stmt\TraitUse) { - foreach ($node->traits as &$trait) { - $trait = $this->resolveClassName($trait); - } - - foreach ($node->adaptations as $adaptation) { - if (null !== $adaptation->trait) { - $adaptation->trait = $this->resolveClassName($adaptation->trait); - } - - if ($adaptation instanceof Stmt\TraitUseAdaptation\Precedence) { - foreach ($adaptation->insteadof as &$insteadof) { - $insteadof = $this->resolveClassName($insteadof); - } - } - } - } - - return null; - } - - private function addAlias(Stmt\UseUse $use, $type, Name $prefix = null) { - // Add prefix for group uses - $name = $prefix ? Name::concat($prefix, $use->name) : $use->name; - // Type is determined either by individual element or whole use declaration - $type |= $use->type; - - $this->nameContext->addAlias( - $name, (string) $use->getAlias(), $type, $use->getAttributes() - ); - } - - /** @param Stmt\Function_|Stmt\ClassMethod|Expr\Closure $node */ - private function resolveSignature($node) { - foreach ($node->params as $param) { - $param->type = $this->resolveType($param->type); - $this->resolveAttrGroups($param); - } - $node->returnType = $this->resolveType($node->returnType); - } - - private function resolveType($node) { - if ($node instanceof Name) { - return $this->resolveClassName($node); - } - if ($node instanceof Node\NullableType) { - $node->type = $this->resolveType($node->type); - return $node; - } - if ($node instanceof Node\UnionType || $node instanceof Node\IntersectionType) { - foreach ($node->types as &$type) { - $type = $this->resolveType($type); - } - return $node; - } - return $node; - } - - /** - * Resolve name, according to name resolver options. - * - * @param Name $name Function or constant name to resolve - * @param int $type One of Stmt\Use_::TYPE_* - * - * @return Name Resolved name, or original name with attribute - */ - protected function resolveName(Name $name, int $type) : Name { - if (!$this->replaceNodes) { - $resolvedName = $this->nameContext->getResolvedName($name, $type); - if (null !== $resolvedName) { - $name->setAttribute('resolvedName', $resolvedName); - } else { - $name->setAttribute('namespacedName', FullyQualified::concat( - $this->nameContext->getNamespace(), $name, $name->getAttributes())); - } - return $name; - } - - if ($this->preserveOriginalNames) { - // Save the original name - $originalName = $name; - $name = clone $originalName; - $name->setAttribute('originalName', $originalName); - } - - $resolvedName = $this->nameContext->getResolvedName($name, $type); - if (null !== $resolvedName) { - return $resolvedName; - } - - // unqualified names inside a namespace cannot be resolved at compile-time - // add the namespaced version of the name as an attribute - $name->setAttribute('namespacedName', FullyQualified::concat( - $this->nameContext->getNamespace(), $name, $name->getAttributes())); - return $name; - } - - protected function resolveClassName(Name $name) { - return $this->resolveName($name, Stmt\Use_::TYPE_NORMAL); - } - - protected function addNamespacedName(Node $node) { - $node->namespacedName = Name::concat( - $this->nameContext->getNamespace(), (string) $node->name); - } - - protected function resolveAttrGroups(Node $node) - { - foreach ($node->attrGroups as $attrGroup) { - foreach ($attrGroup->attrs as $attr) { - $attr->name = $this->resolveClassName($attr->name); - } - } - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php deleted file mode 100644 index ea372e5b..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\NodeVisitor; - -use PhpParser\Node; -use PhpParser\NodeVisitorAbstract; - -/** - * Visitor that connects a child node to its parent node - * as well as its sibling nodes. - * - * On the child node, the parent node can be accessed through - * <code>$node->getAttribute('parent')</code>, the previous - * node can be accessed through <code>$node->getAttribute('previous')</code>, - * and the next node can be accessed through <code>$node->getAttribute('next')</code>. - */ -final class NodeConnectingVisitor extends NodeVisitorAbstract -{ - /** - * @var Node[] - */ - private $stack = []; - - /** - * @var ?Node - */ - private $previous; - - public function beforeTraverse(array $nodes) { - $this->stack = []; - $this->previous = null; - } - - public function enterNode(Node $node) { - if (!empty($this->stack)) { - $node->setAttribute('parent', $this->stack[count($this->stack) - 1]); - } - - if ($this->previous !== null && $this->previous->getAttribute('parent') === $node->getAttribute('parent')) { - $node->setAttribute('previous', $this->previous); - $this->previous->setAttribute('next', $node); - } - - $this->stack[] = $node; - } - - public function leaveNode(Node $node) { - $this->previous = $node; - - array_pop($this->stack); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php deleted file mode 100644 index b98d2bfa..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\NodeVisitor; - -use function array_pop; -use function count; -use PhpParser\Node; -use PhpParser\NodeVisitorAbstract; - -/** - * Visitor that connects a child node to its parent node. - * - * On the child node, the parent node can be accessed through - * <code>$node->getAttribute('parent')</code>. - */ -final class ParentConnectingVisitor extends NodeVisitorAbstract -{ - /** - * @var Node[] - */ - private $stack = []; - - public function beforeTraverse(array $nodes) - { - $this->stack = []; - } - - public function enterNode(Node $node) - { - if (!empty($this->stack)) { - $node->setAttribute('parent', $this->stack[count($this->stack) - 1]); - } - - $this->stack[] = $node; - } - - public function leaveNode(Node $node) - { - array_pop($this->stack); - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php deleted file mode 100644 index d378d670..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser; - -/** - * @codeCoverageIgnore - */ -class NodeVisitorAbstract implements NodeVisitor -{ - public function beforeTraverse(array $nodes) { - return null; - } - - public function enterNode(Node $node) { - return null; - } - - public function leaveNode(Node $node) { - return null; - } - - public function afterTraverse(array $nodes) { - return null; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Parser.php b/vendor/nikic/php-parser/lib/PhpParser/Parser.php deleted file mode 100644 index 8956c767..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Parser.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser; - -interface Parser -{ - /** - * Parses PHP code into a node tree. - * - * @param string $code The source code to parse - * @param ErrorHandler|null $errorHandler Error handler to use for lexer/parser errors, defaults - * to ErrorHandler\Throwing. - * - * @return Node\Stmt[]|null Array of statements (or null non-throwing error handler is used and - * the parser was unable to recover from an error). - */ - public function parse(string $code, ErrorHandler $errorHandler = null); -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Parser/Multiple.php b/vendor/nikic/php-parser/lib/PhpParser/Parser/Multiple.php deleted file mode 100644 index 77fd1f3f..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Parser/Multiple.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\Parser; - -use PhpParser\Error; -use PhpParser\ErrorHandler; -use PhpParser\Parser; - -class Multiple implements Parser -{ - /** @var Parser[] List of parsers to try, in order of preference */ - private $parsers; - - /** - * Create a parser which will try multiple parsers in an order of preference. - * - * Parsers will be invoked in the order they're provided to the constructor. If one of the - * parsers runs without throwing, it's output is returned. Otherwise the exception that the - * first parser generated is thrown. - * - * @param Parser[] $parsers - */ - public function __construct(array $parsers) { - $this->parsers = $parsers; - } - - public function parse(string $code, ErrorHandler $errorHandler = null) { - if (null === $errorHandler) { - $errorHandler = new ErrorHandler\Throwing; - } - - list($firstStmts, $firstError) = $this->tryParse($this->parsers[0], $errorHandler, $code); - if ($firstError === null) { - return $firstStmts; - } - - for ($i = 1, $c = count($this->parsers); $i < $c; ++$i) { - list($stmts, $error) = $this->tryParse($this->parsers[$i], $errorHandler, $code); - if ($error === null) { - return $stmts; - } - } - - throw $firstError; - } - - private function tryParse(Parser $parser, ErrorHandler $errorHandler, $code) { - $stmts = null; - $error = null; - try { - $stmts = $parser->parse($code, $errorHandler); - } catch (Error $error) {} - return [$stmts, $error]; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Parser/Php5.php b/vendor/nikic/php-parser/lib/PhpParser/Parser/Php5.php deleted file mode 100644 index d9c8fe04..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Parser/Php5.php +++ /dev/null @@ -1,2672 +0,0 @@ -<?php - -namespace PhpParser\Parser; - -use PhpParser\Error; -use PhpParser\Node; -use PhpParser\Node\Expr; -use PhpParser\Node\Name; -use PhpParser\Node\Scalar; -use PhpParser\Node\Stmt; - -/* This is an automatically GENERATED file, which should not be manually edited. - * Instead edit one of the following: - * * the grammar files grammar/php5.y or grammar/php7.y - * * the skeleton file grammar/parser.template - * * the preprocessing script grammar/rebuildParsers.php - */ -class Php5 extends \PhpParser\ParserAbstract -{ - protected $tokenToSymbolMapSize = 396; - protected $actionTableSize = 1093; - protected $gotoTableSize = 643; - - protected $invalidSymbol = 168; - protected $errorSymbol = 1; - protected $defaultAction = -32766; - protected $unexpectedTokenRule = 32767; - - protected $YY2TBLSTATE = 415; - protected $numNonLeafStates = 662; - - protected $symbolToName = array( - "EOF", - "error", - "T_THROW", - "T_INCLUDE", - "T_INCLUDE_ONCE", - "T_EVAL", - "T_REQUIRE", - "T_REQUIRE_ONCE", - "','", - "T_LOGICAL_OR", - "T_LOGICAL_XOR", - "T_LOGICAL_AND", - "T_PRINT", - "T_YIELD", - "T_DOUBLE_ARROW", - "T_YIELD_FROM", - "'='", - "T_PLUS_EQUAL", - "T_MINUS_EQUAL", - "T_MUL_EQUAL", - "T_DIV_EQUAL", - "T_CONCAT_EQUAL", - "T_MOD_EQUAL", - "T_AND_EQUAL", - "T_OR_EQUAL", - "T_XOR_EQUAL", - "T_SL_EQUAL", - "T_SR_EQUAL", - "T_POW_EQUAL", - "T_COALESCE_EQUAL", - "'?'", - "':'", - "T_COALESCE", - "T_BOOLEAN_OR", - "T_BOOLEAN_AND", - "'|'", - "'^'", - "T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG", - "T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG", - "T_IS_EQUAL", - "T_IS_NOT_EQUAL", - "T_IS_IDENTICAL", - "T_IS_NOT_IDENTICAL", - "T_SPACESHIP", - "'<'", - "T_IS_SMALLER_OR_EQUAL", - "'>'", - "T_IS_GREATER_OR_EQUAL", - "T_SL", - "T_SR", - "'+'", - "'-'", - "'.'", - "'*'", - "'/'", - "'%'", - "'!'", - "T_INSTANCEOF", - "'~'", - "T_INC", - "T_DEC", - "T_INT_CAST", - "T_DOUBLE_CAST", - "T_STRING_CAST", - "T_ARRAY_CAST", - "T_OBJECT_CAST", - "T_BOOL_CAST", - "T_UNSET_CAST", - "'@'", - "T_POW", - "'['", - "T_NEW", - "T_CLONE", - "T_EXIT", - "T_IF", - "T_ELSEIF", - "T_ELSE", - "T_ENDIF", - "T_LNUMBER", - "T_DNUMBER", - "T_STRING", - "T_STRING_VARNAME", - "T_VARIABLE", - "T_NUM_STRING", - "T_INLINE_HTML", - "T_ENCAPSED_AND_WHITESPACE", - "T_CONSTANT_ENCAPSED_STRING", - "T_ECHO", - "T_DO", - "T_WHILE", - "T_ENDWHILE", - "T_FOR", - "T_ENDFOR", - "T_FOREACH", - "T_ENDFOREACH", - "T_DECLARE", - "T_ENDDECLARE", - "T_AS", - "T_SWITCH", - "T_MATCH", - "T_ENDSWITCH", - "T_CASE", - "T_DEFAULT", - "T_BREAK", - "T_CONTINUE", - "T_GOTO", - "T_FUNCTION", - "T_FN", - "T_CONST", - "T_RETURN", - "T_TRY", - "T_CATCH", - "T_FINALLY", - "T_USE", - "T_INSTEADOF", - "T_GLOBAL", - "T_STATIC", - "T_ABSTRACT", - "T_FINAL", - "T_PRIVATE", - "T_PROTECTED", - "T_PUBLIC", - "T_VAR", - "T_UNSET", - "T_ISSET", - "T_EMPTY", - "T_HALT_COMPILER", - "T_CLASS", - "T_TRAIT", - "T_INTERFACE", - "T_EXTENDS", - "T_IMPLEMENTS", - "T_OBJECT_OPERATOR", - "T_LIST", - "T_ARRAY", - "T_CALLABLE", - "T_CLASS_C", - "T_TRAIT_C", - "T_METHOD_C", - "T_FUNC_C", - "T_LINE", - "T_FILE", - "T_START_HEREDOC", - "T_END_HEREDOC", - "T_DOLLAR_OPEN_CURLY_BRACES", - "T_CURLY_OPEN", - "T_PAAMAYIM_NEKUDOTAYIM", - "T_NAMESPACE", - "T_NS_C", - "T_DIR", - "T_NS_SEPARATOR", - "T_ELLIPSIS", - "T_NAME_FULLY_QUALIFIED", - "T_NAME_QUALIFIED", - "T_NAME_RELATIVE", - "';'", - "'{'", - "'}'", - "'('", - "')'", - "'$'", - "'`'", - "']'", - "'\"'", - "T_READONLY", - "T_ENUM", - "T_NULLSAFE_OBJECT_OPERATOR", - "T_ATTRIBUTE" - ); - - protected $tokenToSymbol = array( - 0, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 56, 163, 168, 160, 55, 168, 168, - 158, 159, 53, 50, 8, 51, 52, 54, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 31, 155, - 44, 16, 46, 30, 68, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 70, 168, 162, 36, 168, 161, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 156, 35, 157, 58, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 1, 2, 3, 4, - 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 32, 33, 34, 37, 38, 39, 40, - 41, 42, 43, 45, 47, 48, 49, 57, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 69, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 164, - 122, 123, 124, 125, 126, 127, 128, 129, 165, 130, - 131, 132, 166, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 167 - ); - - protected $action = array( - 699, 669, 670, 671, 672, 673, 286, 674, 675, 676, - 712, 713, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 0, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244,-32766,-32766,-32766,-32766,-32766, - -32766,-32766,-32766,-32766,-32767,-32767,-32767,-32767, 245, 246, - 242, 243, 244,-32766,-32766, 677,-32766, 750,-32766,-32766, - -32766,-32766,-32766,-32766,-32766, 1224, 245, 246, 1225, 678, - 679, 680, 681, 682, 683, 684,-32766, 48, 746,-32766, - -32766,-32766,-32766,-32766,-32766, 685, 686, 687, 688, 689, - 690, 691, 692, 693, 694, 695, 715, 738, 716, 717, - 718, 719, 707, 708, 709, 737, 710, 711, 696, 697, - 698, 700, 701, 702, 740, 741, 742, 743, 744, 745, - 703, 704, 705, 706, 736, 727, 725, 726, 722, 723, - 751, 714, 720, 721, 728, 729, 731, 730, 732, 733, - 55, 56, 425, 57, 58, 724, 735, 734, 1073, 59, - 60, -224, 61,-32766,-32766,-32766,-32766,-32766,-32766,-32766, - -32766,-32766,-32766, 121,-32767,-32767,-32767,-32767, 29, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 1043, 766, 1071, 767, 580, 62, 63,-32766, - -32766,-32766,-32766, 64, 516, 65, 294, 295, 66, 67, - 68, 69, 70, 71, 72, 73, 822, 25, 302, 74, - 418, 981, 983, 1043, 1181, 1095, 1096, 1073, 748, 754, - 1075, 1074, 1076, 469,-32766,-32766,-32766, 337, 823, 54, - -32767,-32767,-32767,-32767, 98, 99, 100, 101, 102, 220, - 221, 222, 78, 361, 1107,-32766, 341,-32766,-32766,-32766, - -32766,-32766, 1107, 492, 949, 950, 951, 948, 947, 946, - 207, 477, 478, 949, 950, 951, 948, 947, 946, 1043, - 479, 480, 52, 1101, 1102, 1103, 1104, 1098, 1099, 319, - 872, 668, 667, 27, -511, 1105, 1100,-32766, 130, 1075, - 1074, 1076, 345, 668, 667, 41, 126, 341, 334, 369, - 336, 426, -128, -128, -128, 896, 897, 468, 220, 221, - 222, 811, 1195, 619, 40, 21, 427, -128, 470, -128, - 471, -128, 472, -128, 802, 428, -4, 823, 54, 207, - 33, 34, 429, 360, 317, 28, 35, 473,-32766,-32766, - -32766, 211, 356, 357, 474, 475,-32766,-32766,-32766, 754, - 476, 49, 313, 794, 843, 430, 431, 289, 125,-32766, - 813,-32766,-32766,-32766,-32766,-32766,-32766,-32766,-32767,-32767, - -32767,-32767,-32767,-32766,-32766,-32766, 769, 103, 104, 105, - 327, 307, 825, 633, -128, 1075, 1074, 1076, 221, 222, - 927, 748, 1146, 106,-32766, 129,-32766,-32766,-32766,-32766, - 426, 823, 54, 902, 873, 302, 468, 75, 207, 359, - 811, 668, 667, 40, 21, 427, 754, 470, 754, 471, - 423, 472, 1043, 127, 428, 435, 1043, 341, 1043, 33, - 34, 429, 360, 1181, 415, 35, 473, 122, 10, 315, - 128, 356, 357, 474, 475,-32766,-32766,-32766, 768, 476, - 668, 667, 758, 843, 430, 431, 754, 1043, 1147,-32766, - -32766,-32766, 754, 419, 342, 1215,-32766, 131,-32766,-32766, - -32766, 341, 363, 346, 426, 823, 54, 100, 101, 102, - 468, 825, 633, -4, 811, 442, 903, 40, 21, 427, - 754, 470, 435, 471, 341, 472, 341, 766, 428, 767, - -209, -209, -209, 33, 34, 429, 360, 479, 1196, 35, - 473, 345,-32766,-32766,-32766, 356, 357, 474, 475, 220, - 221, 222, 421, 476, 32, 297, 794, 843, 430, 431, - 754, 754, 435,-32766, 341,-32766,-32766, 9, 300, 51, - 207, 249, 324, 753, 120, 220, 221, 222, 426, 30, - 247, 941, 422, 424, 468, 825, 633, -209, 811, 1043, - 1061, 40, 21, 427, 129, 470, 207, 471, 341, 472, - 804, 20, 428, 124, -208, -208, -208, 33, 34, 429, - 360, 479, 212, 35, 473, 923, -259, 823, 54, 356, - 357, 474, 475,-32766,-32766,-32766, 1043, 476, 213, 806, - 794, 843, 430, 431,-32766,-32766, 435, 435, 341, 341, - 443, 79, 80, 81,-32766, 668, 667, 636, 344, 808, - 668, 667, 239, 240, 241, 123, 214, 538, 250, 825, - 633, -208, 36, 251, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 252, 307, - 426, 220, 221, 222, 823, 54, 468,-32766, 222, 765, - 811, 106, 134, 40, 21, 427, 571, 470, 207, 471, - 445, 472, 207,-32766, 428, 896, 897, 207, 307, 33, - 34, 429, 245, 246, 637, 35, 473, 452, 22, 809, - 922, 356, 357, 457, 588, 135, 374, 595, 596, 476, - -228, 759, 639, 938, 653, 926, 661, -86, 823, 54, - 314, 644, 647, 821, 133, 836, 43, 106, 603, 44, - 45, 46, 47, 748, 50, 53, 132, 426, 302,-32766, - 520, 825, 633, 468, -84, 607, 577, 811, 641, 362, - 40, 21, 427, -278, 470, 754, 471, 954, 472, 441, - 627, 428, 823, 54, 574, 844, 33, 34, 429, 11, - 615, 845, 35, 473, 444, 461, 285, -511, 356, 357, - 592, -419, 593, 1106, 1153, -410, 476, 368, 838, 38, - 658, 426, 645, 795, 1052, 0, 325, 468, 0,-32766, - 0, 811, 0, 0, 40, 21, 427, 0, 470, 0, - 471, 0, 472, 0, 322, 428, 823, 54, 825, 633, - 33, 34, 429, 0, 326, 0, 35, 473, 323, 0, - 316, 318, 356, 357, -512, 426, 0, 753, 531, 0, - 476, 468, 6, 0, 0, 811, 650, 7, 40, 21, - 427, 12, 470, 14, 471, 373, 472, -420, 562, 428, - 823, 54, 78, -225, 33, 34, 429, 39, 656, 657, - 35, 473, 859, 633, 764, 812, 356, 357, 820, 799, - 814, 875, 866, 867, 476, 797, 860, 857, 855, 426, - 933, 934, 931, 819, 803, 468, 805, 807, 810, 811, - 930, 762, 40, 21, 427, 763, 470, 932, 471, 335, - 472, 358, 634, 428, 638, 640, 825, 633, 33, 34, - 429, 642, 643, 646, 35, 473, 648, 649, 651, 652, - 356, 357, 635, 426, 1221, 1223, 761, 842, 476, 468, - 248, 760, 841, 811, 1222, 840, 40, 21, 427, 1057, - 470, 830, 471, 1045, 472, 839, 1046, 428, 828, 215, - 216, 939, 33, 34, 429, 217, 864, 218, 35, 473, - 825, 633, 24, 865, 356, 357, 456, 1220, 1189, 209, - 1187, 1172, 476, 1185, 215, 216, 1086, 1095, 1096, 914, - 217, 1193, 218, 1183, -224, 1097, 26, 31, 37, 42, - 76, 77, 210, 288, 209, 292, 293, 308, 309, 310, - 311, 339, 1095, 1096, 825, 633, 355, 291, 416, 1152, - 1097, 16, 17, 18, 393, 453, 460, 462, 466, 552, - 624, 1048, 1051, 904, 1111, 1047, 1023, 563, 1022, 1088, - 0, 0, -429, 558, 1041, 1101, 1102, 1103, 1104, 1098, - 1099, 398, 1054, 1053, 1056, 1055, 1070, 1105, 1100, 1186, - 1171, 1167, 1184, 1085, 1218, 1112, 1166, 219, 558, 599, - 1101, 1102, 1103, 1104, 1098, 1099, 398, 0, 0, 0, - 0, 0, 1105, 1100, 0, 0, 0, 0, 0, 0, - 0, 0, 219 - ); - - protected $actionCheck = array( - 2, 3, 4, 5, 6, 7, 14, 9, 10, 11, - 12, 13, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 0, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 9, 10, 11, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 69, 70, - 53, 54, 55, 9, 10, 57, 30, 80, 32, 33, - 34, 35, 36, 37, 38, 80, 69, 70, 83, 71, - 72, 73, 74, 75, 76, 77, 9, 70, 80, 33, - 34, 35, 36, 37, 38, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 153, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 3, 4, 5, 6, 7, 147, 148, 149, 80, 12, - 13, 159, 15, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 156, 44, 45, 46, 47, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 13, 106, 116, 108, 85, 50, 51, 33, - 34, 35, 36, 56, 85, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 1, 70, 71, 72, - 73, 59, 60, 13, 82, 78, 79, 80, 80, 82, - 152, 153, 154, 86, 9, 10, 11, 8, 1, 2, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 9, - 10, 11, 156, 106, 143, 30, 160, 32, 33, 34, - 35, 36, 143, 116, 116, 117, 118, 119, 120, 121, - 30, 124, 125, 116, 117, 118, 119, 120, 121, 13, - 133, 134, 70, 136, 137, 138, 139, 140, 141, 142, - 31, 37, 38, 8, 132, 148, 149, 116, 156, 152, - 153, 154, 160, 37, 38, 158, 8, 160, 161, 8, - 163, 74, 75, 76, 77, 134, 135, 80, 9, 10, - 11, 84, 1, 80, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 155, 98, 0, 1, 2, 30, - 103, 104, 105, 106, 132, 8, 109, 110, 9, 10, - 11, 8, 115, 116, 117, 118, 9, 10, 11, 82, - 123, 70, 8, 126, 127, 128, 129, 8, 156, 30, - 155, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 9, 10, 11, 157, 53, 54, 55, - 8, 57, 155, 156, 157, 152, 153, 154, 10, 11, - 157, 80, 162, 69, 30, 151, 32, 33, 34, 35, - 74, 1, 2, 159, 155, 71, 80, 151, 30, 8, - 84, 37, 38, 87, 88, 89, 82, 91, 82, 93, - 8, 95, 13, 156, 98, 158, 13, 160, 13, 103, - 104, 105, 106, 82, 108, 109, 110, 156, 8, 113, - 31, 115, 116, 117, 118, 9, 10, 11, 157, 123, - 37, 38, 126, 127, 128, 129, 82, 13, 159, 33, - 34, 35, 82, 127, 8, 85, 30, 156, 32, 33, - 34, 160, 8, 147, 74, 1, 2, 50, 51, 52, - 80, 155, 156, 157, 84, 31, 159, 87, 88, 89, - 82, 91, 158, 93, 160, 95, 160, 106, 98, 108, - 100, 101, 102, 103, 104, 105, 106, 133, 159, 109, - 110, 160, 9, 10, 11, 115, 116, 117, 118, 9, - 10, 11, 8, 123, 144, 145, 126, 127, 128, 129, - 82, 82, 158, 30, 160, 32, 33, 108, 8, 70, - 30, 31, 113, 152, 16, 9, 10, 11, 74, 14, - 14, 122, 8, 8, 80, 155, 156, 157, 84, 13, - 159, 87, 88, 89, 151, 91, 30, 93, 160, 95, - 155, 159, 98, 14, 100, 101, 102, 103, 104, 105, - 106, 133, 16, 109, 110, 155, 157, 1, 2, 115, - 116, 117, 118, 9, 10, 11, 13, 123, 16, 155, - 126, 127, 128, 129, 33, 34, 158, 158, 160, 160, - 156, 9, 10, 11, 30, 37, 38, 31, 70, 155, - 37, 38, 50, 51, 52, 156, 16, 81, 16, 155, - 156, 157, 30, 16, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 16, 57, - 74, 9, 10, 11, 1, 2, 80, 116, 11, 155, - 84, 69, 156, 87, 88, 89, 160, 91, 30, 93, - 132, 95, 30, 33, 98, 134, 135, 30, 57, 103, - 104, 105, 69, 70, 31, 109, 110, 75, 76, 155, - 155, 115, 116, 75, 76, 101, 102, 111, 112, 123, - 159, 155, 156, 155, 156, 155, 156, 31, 1, 2, - 31, 31, 31, 31, 31, 38, 70, 69, 77, 70, - 70, 70, 70, 80, 70, 70, 70, 74, 71, 85, - 85, 155, 156, 80, 97, 96, 100, 84, 31, 106, - 87, 88, 89, 82, 91, 82, 93, 82, 95, 89, - 92, 98, 1, 2, 90, 127, 103, 104, 105, 97, - 94, 127, 109, 110, 97, 97, 97, 132, 115, 116, - 100, 146, 113, 143, 143, 146, 123, 106, 151, 155, - 157, 74, 31, 157, 162, -1, 114, 80, -1, 116, - -1, 84, -1, -1, 87, 88, 89, -1, 91, -1, - 93, -1, 95, -1, 130, 98, 1, 2, 155, 156, - 103, 104, 105, -1, 130, -1, 109, 110, 131, -1, - 132, 132, 115, 116, 132, 74, -1, 152, 150, -1, - 123, 80, 146, -1, -1, 84, 31, 146, 87, 88, - 89, 146, 91, 146, 93, 146, 95, 146, 150, 98, - 1, 2, 156, 159, 103, 104, 105, 155, 155, 155, - 109, 110, 155, 156, 155, 155, 115, 116, 155, 155, - 155, 155, 155, 155, 123, 155, 155, 155, 155, 74, - 155, 155, 155, 155, 155, 80, 155, 155, 155, 84, - 155, 155, 87, 88, 89, 155, 91, 155, 93, 156, - 95, 156, 156, 98, 156, 156, 155, 156, 103, 104, - 105, 156, 156, 156, 109, 110, 156, 156, 156, 156, - 115, 116, 156, 74, 157, 157, 157, 157, 123, 80, - 31, 157, 157, 84, 157, 157, 87, 88, 89, 157, - 91, 157, 93, 157, 95, 157, 157, 98, 157, 50, - 51, 157, 103, 104, 105, 56, 157, 58, 109, 110, - 155, 156, 158, 157, 115, 116, 157, 157, 157, 70, - 157, 157, 123, 157, 50, 51, 157, 78, 79, 157, - 56, 157, 58, 157, 159, 86, 158, 158, 158, 158, - 158, 158, 158, 158, 70, 158, 158, 158, 158, 158, - 158, 158, 78, 79, 155, 156, 158, 160, 158, 163, - 86, 159, 159, 159, 159, 159, 159, 159, 159, 159, - 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, - -1, -1, 161, 134, 161, 136, 137, 138, 139, 140, - 141, 142, 162, 162, 162, 162, 162, 148, 149, 162, - 162, 162, 162, 162, 162, 162, 162, 158, 134, 162, - 136, 137, 138, 139, 140, 141, 142, -1, -1, -1, - -1, -1, 148, 149, -1, -1, -1, -1, -1, -1, - -1, -1, 158 - ); - - protected $actionBase = array( - 0, 227, 326, 400, 474, 233, 132, 132, 752, -2, - -2, 138, -2, -2, -2, 663, 761, 815, 761, 586, - 717, 859, 859, 859, 244, 256, 256, 256, 413, 583, - 583, 880, 546, 169, 415, 444, 409, 200, 200, 200, - 200, 137, 137, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 249, 205, 738, 559, - 535, 739, 741, 742, 876, 679, 877, 820, 821, 693, - 823, 824, 826, 829, 832, 819, 834, 907, 836, 602, - 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, - 602, 67, 536, 299, 510, 230, 44, 652, 652, 652, - 652, 652, 652, 652, 337, 337, 337, 337, 337, 337, - 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, - 337, 337, 378, 584, 584, 584, 657, 909, 648, 934, - 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, - 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, - 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, - 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, - 934, 934, 934, 503, -21, -21, 436, 650, 364, 571, - 215, 426, 156, 26, 26, 329, 329, 329, 329, 329, - 46, 46, 5, 5, 5, 5, 152, 186, 186, 186, - 186, 120, 120, 120, 120, 374, 374, 429, 448, 448, - 334, 267, 449, 449, 449, 449, 449, 449, 449, 449, - 449, 449, 336, 427, 427, 572, 572, 408, 551, 551, - 551, 551, 671, 171, 171, 391, 311, 311, 311, 109, - 641, 856, 68, 68, 68, 68, 68, 68, 324, 324, - 324, -3, -3, -3, 655, 77, 380, 77, 380, 683, - 685, 86, 685, 654, -15, 516, 776, 281, 646, 809, - 680, 816, 560, 711, 202, 578, 857, 643, -23, 578, - 578, 578, 578, 857, 622, 628, 596, -23, 578, -23, - 639, 454, 849, 351, 249, 558, 469, 631, 743, 514, - 688, 746, 464, 544, 548, 556, 7, 412, 708, 750, - 878, 879, 349, 702, 631, 631, 631, 327, 101, 7, - -8, 623, 623, 623, 623, 219, 623, 623, 623, 623, - 291, 430, 545, 401, 745, 653, 653, 675, 839, 814, - 814, 653, 673, 653, 675, 841, 841, 841, 841, 653, - 653, 653, 653, 814, 814, 667, 814, 275, 684, 694, - 694, 841, 713, 714, 653, 653, 697, 814, 814, 814, - 697, 687, 841, 669, 637, 333, 814, 841, 689, 673, - 689, 653, 669, 689, 673, 673, 689, 22, 686, 656, - 840, 842, 860, 756, 638, 644, 847, 848, 843, 845, - 838, 692, 719, 720, 528, 659, 660, 661, 662, 696, - 664, 698, 643, 658, 658, 658, 645, 701, 645, 658, - 658, 658, 658, 658, 658, 658, 658, 632, 635, 709, - 699, 670, 723, 566, 582, 758, 640, 636, 872, 865, - 881, 883, 849, 870, 645, 890, 634, 288, 610, 850, - 633, 753, 645, 851, 645, 759, 645, 873, 777, 666, - 778, 779, 658, 874, 891, 892, 893, 894, 897, 898, - 899, 900, 665, 901, 724, 674, 866, 344, 844, 639, - 705, 677, 755, 725, 780, 372, 902, 784, 645, 645, - 765, 706, 645, 766, 726, 712, 862, 727, 867, 903, - 640, 678, 868, 645, 681, 785, 904, 372, 690, 651, - 704, 649, 728, 858, 875, 853, 767, 612, 617, 787, - 788, 792, 691, 730, 863, 864, 835, 731, 770, 642, - 771, 676, 794, 772, 852, 732, 796, 798, 871, 647, - 707, 682, 672, 668, 773, 799, 869, 733, 735, 736, - 801, 737, 804, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 137, 137, 137, 137, -2, -2, -2, - -2, 0, 0, -2, 0, 0, 0, 137, 137, 137, - 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, - 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, - 137, 137, 137, 0, 0, 137, 137, 137, 137, 137, - 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, - 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, - 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, - 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, - 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, - 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, - 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, - 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, - 137, 137, 137, 137, 137, 137, 137, 137, 602, 602, - 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, - 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, - 602, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 602, -21, -21, -21, -21, 602, -21, - -21, -21, -21, -21, -21, -21, 602, 602, 602, 602, - 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, - 602, 602, 602, 602, -21, 602, 602, 602, -21, 68, - -21, 68, 68, 68, 68, 68, 68, 68, 68, 68, - 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, - 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, - 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, - 68, 68, 68, 68, 68, 602, 0, 0, 602, -21, - 602, -21, 602, -21, -21, 602, 602, 602, 602, 602, - 602, 602, -21, -21, -21, -21, -21, -21, 0, 324, - 324, 324, 324, -21, -21, -21, -21, 68, 68, 147, - 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, - 68, 68, 68, 68, 68, 324, 324, -3, -3, 68, - 68, 68, 68, 68, 147, 68, 68, -23, 673, 673, - 673, 380, 380, 380, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 380, -23, 0, -23, - 0, 68, -23, 673, -23, 380, 673, 673, -23, 814, - 604, 604, 604, 604, 372, 7, 0, 0, 673, 673, - 0, 0, 0, 0, 0, 673, 0, 0, 0, 0, - 0, 0, 814, 0, 653, 0, 0, 0, 0, 658, - 288, 0, 677, 456, 0, 0, 0, 0, 0, 0, - 677, 456, 530, 530, 0, 665, 658, 658, 658, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 372 - ); - - protected $actionDefault = array( - 3,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767, 540, 540, 495,32767,32767, - 32767,32767,32767,32767,32767,32767,32767, 297, 297, 297, - 32767,32767,32767, 528, 528, 528, 528, 528, 528, 528, - 528, 528, 528, 528,32767,32767,32767,32767,32767,32767, - 381,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767, 387, - 545,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767, 362, - 363, 365, 366, 296, 548, 529, 245, 388, 544, 295, - 247, 325, 499,32767,32767,32767, 327, 122, 256, 201, - 498, 125, 294, 232, 380, 382, 326, 301, 306, 307, - 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, - 318, 300, 454, 359, 358, 357, 456,32767, 455, 492, - 492, 495,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767, 323, 483, 482, 324, 452, 328, 453, - 331, 457, 460, 329, 330, 347, 348, 345, 346, 349, - 458, 459, 476, 477, 474, 475, 299, 350, 351, 352, - 353, 478, 479, 480, 481,32767,32767, 280, 539, 539, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767, 338, 339, 467, 468,32767, 236, 236, - 236, 236, 281, 236,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767, 333, 334, - 332, 462, 463, 461, 428,32767,32767,32767, 430,32767, - 32767,32767,32767,32767,32767,32767,32767, 500,32767,32767, - 32767,32767,32767, 513, 417, 171,32767, 409,32767, 171, - 171, 171, 171,32767, 220, 222, 167,32767, 171,32767, - 486,32767,32767,32767,32767,32767, 518, 343,32767,32767, - 116,32767,32767,32767, 555,32767, 513,32767, 116,32767, - 32767,32767,32767, 356, 335, 336, 337,32767,32767, 517, - 511, 470, 471, 472, 473,32767, 464, 465, 466, 469, - 32767,32767,32767,32767,32767,32767,32767,32767, 425, 431, - 431,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767, 516, 515,32767, 410, 494, 186, 184, - 184,32767, 206, 206,32767,32767, 188, 487, 506,32767, - 188, 173,32767, 398, 175, 494,32767,32767, 238,32767, - 238,32767, 398, 238,32767,32767, 238,32767, 411, 435, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767, 377, 378, 489, 502,32767, - 503,32767, 409, 341, 342, 344, 320,32767, 322, 367, - 368, 369, 370, 371, 372, 373, 375,32767, 415,32767, - 418,32767,32767,32767, 255,32767, 553,32767,32767, 304, - 553,32767,32767,32767, 547,32767,32767, 298,32767,32767, - 32767,32767, 251,32767, 169,32767, 537,32767, 554,32767, - 511,32767, 340,32767,32767,32767,32767,32767,32767,32767, - 32767,32767, 512,32767,32767,32767,32767, 227,32767, 448, - 32767, 116,32767,32767,32767, 187,32767,32767, 302, 246, - 32767,32767, 546,32767,32767,32767,32767,32767,32767,32767, - 32767, 114,32767, 170,32767,32767,32767, 189,32767,32767, - 511,32767,32767,32767,32767,32767,32767,32767, 293,32767, - 32767,32767,32767,32767,32767,32767, 511,32767,32767, 231, - 32767,32767,32767,32767,32767,32767,32767,32767,32767, 411, - 32767, 274,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767, 127, 127, 3, 127, 127, 258, 3, - 258, 127, 258, 258, 127, 127, 127, 127, 127, 127, - 127, 127, 127, 127, 214, 217, 206, 206, 164, 127, - 127, 266 - ); - - protected $goto = array( - 166, 140, 140, 140, 166, 187, 168, 144, 147, 141, - 142, 143, 149, 163, 163, 163, 163, 144, 144, 165, - 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, - 138, 159, 160, 161, 162, 184, 139, 185, 493, 494, - 377, 495, 499, 500, 501, 502, 503, 504, 505, 506, - 967, 164, 145, 146, 148, 171, 176, 186, 203, 253, - 256, 258, 260, 263, 264, 265, 266, 267, 268, 269, - 277, 278, 279, 280, 303, 304, 328, 329, 330, 394, - 395, 396, 542, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 150, 151, 152, - 167, 153, 169, 154, 204, 170, 155, 156, 157, 205, - 158, 136, 620, 560, 756, 560, 560, 560, 560, 560, - 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, - 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, - 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, - 560, 560, 560, 560, 560, 560, 560, 560, 560, 1108, - 628, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, - 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, - 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, - 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, - 1108, 1108, 1108, 1108, 1108, 757, 888, 888, 508, 1200, - 1200, 400, 606, 508, 536, 536, 568, 532, 534, 534, - 496, 498, 524, 540, 569, 572, 583, 590, 852, 852, - 852, 852, 847, 853, 174, 585, 519, 600, 601, 177, - 178, 179, 401, 402, 403, 404, 173, 202, 206, 208, - 257, 259, 261, 262, 270, 271, 272, 273, 274, 275, - 281, 282, 283, 284, 305, 306, 331, 332, 333, 406, - 407, 408, 409, 175, 180, 254, 255, 181, 182, 183, - 497, 497, 785, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 509, 578, 582, - 626, 749, 509, 544, 545, 546, 547, 548, 549, 550, - 551, 553, 586, 338, 559, 321, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - 530, 349, 655, 555, 587, 352, 414, 591, 575, 604, - 885, 611, 612, 881, 616, 617, 623, 625, 630, 632, - 298, 296, 296, 296, 298, 290, 299, 944, 610, 816, - 1170, 613, 436, 436, 375, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 1072, - 1084, 1083, 945, 1065, 1072, 895, 895, 895, 895, 1178, - 895, 895, 1212, 1212, 1178, 388, 858, 561, 755, 1072, - 1072, 1072, 1072, 1072, 1072, 3, 4, 384, 384, 384, - 1212, 874, 856, 854, 856, 654, 465, 511, 883, 878, - 1089, 541, 384, 537, 384, 567, 384, 1026, 19, 15, - 371, 384, 1226, 510, 1204, 1192, 1192, 1192, 510, 906, - 372, 522, 533, 554, 912, 514, 1068, 1069, 13, 1065, - 378, 912, 1158, 594, 23, 965, 386, 386, 386, 602, - 1066, 1169, 1066, 937, 447, 449, 631, 752, 1177, 1067, - 1109, 614, 935, 1177, 605, 1197, 391, 1211, 1211, 543, - 892, 386, 1194, 1194, 1194, 399, 518, 1016, 901, 389, - 771, 529, 752, 340, 752, 1211, 518, 518, 385, 781, - 1214, 770, 772, 1063, 910, 774, 1058, 1176, 659, 953, - 514, 782, 862, 915, 450, 573, 1155, 0, 463, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 513, 528, 0, 0, 0, 0, - 513, 0, 528, 0, 350, 351, 0, 609, 512, 515, - 438, 439, 1064, 618, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 779, 1219, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 777, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 523, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 301, 301 - ); - - protected $gotoCheck = array( - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 57, 68, 15, 68, 68, 68, 68, 68, - 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, - 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, - 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, - 68, 68, 68, 68, 68, 68, 68, 68, 68, 126, - 9, 126, 126, 126, 126, 126, 126, 126, 126, 126, - 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, - 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, - 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, - 126, 126, 126, 126, 126, 16, 76, 76, 68, 76, - 76, 51, 51, 68, 51, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 51, 68, 68, - 68, 68, 68, 68, 27, 66, 101, 66, 66, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 117, 117, 29, 117, 117, 117, 117, 117, 117, 117, - 117, 117, 117, 117, 117, 117, 117, 117, 61, 61, - 61, 6, 117, 110, 110, 110, 110, 110, 110, 110, - 110, 110, 110, 125, 57, 125, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 32, 71, 32, 32, 69, 69, 69, 32, 40, 40, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 5, 5, 5, 5, 5, 5, 5, 97, 62, 50, - 81, 62, 57, 57, 62, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 124, 124, 97, 81, 57, 57, 57, 57, 57, 118, - 57, 57, 142, 142, 118, 12, 33, 12, 14, 57, - 57, 57, 57, 57, 57, 30, 30, 13, 13, 13, - 142, 14, 14, 14, 14, 14, 57, 14, 14, 14, - 34, 2, 13, 109, 13, 2, 13, 34, 34, 34, - 34, 13, 13, 122, 140, 9, 9, 9, 122, 83, - 58, 58, 58, 34, 13, 13, 81, 81, 58, 81, - 46, 13, 131, 127, 34, 101, 123, 123, 123, 34, - 81, 81, 81, 8, 8, 8, 8, 11, 119, 81, - 8, 8, 8, 119, 49, 138, 48, 141, 141, 47, - 78, 123, 119, 119, 119, 123, 47, 102, 80, 17, - 23, 9, 11, 18, 11, 141, 47, 47, 11, 23, - 141, 23, 24, 115, 84, 25, 113, 119, 73, 99, - 13, 26, 70, 85, 64, 65, 130, -1, 108, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 9, 9, -1, -1, -1, -1, - 9, -1, 9, -1, 71, 71, -1, 13, 9, 9, - 9, 9, 13, 13, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 9, 9, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 101, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 5, 5 - ); - - protected $gotoBase = array( - 0, 0, -184, 0, 0, 356, 290, 0, 488, 149, - 0, 182, 85, 118, 426, 112, 203, 179, 208, 0, - 0, 0, 0, 162, 190, 198, 120, 27, 0, 272, - -224, 0, -274, 406, 32, 0, 0, 0, 0, 0, - 330, 0, 0, -24, 0, 0, 440, 485, 213, 218, - 371, -74, 0, 0, 0, 0, 0, 107, 110, 0, - 0, -11, -72, 0, 104, 95, -405, 0, -94, 41, - 119, -82, 0, 164, 0, 0, -79, 0, 197, 0, - 204, 43, 0, 441, 171, 121, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 100, 0, 115, - 0, 195, 210, 0, 0, 0, 0, 0, 86, 427, - 259, 0, 0, 116, 0, 174, 0, -5, 117, 196, - 0, 0, 161, 170, 93, -21, -48, 273, 0, 0, - 91, 271, 0, 0, 0, 0, 0, 0, 216, 0, - 437, 187, 102, 0, 0 - ); - - protected $gotoDefault = array( - -32768, 467, 663, 2, 664, 834, 739, 747, 597, 481, - 629, 581, 380, 1188, 791, 792, 793, 381, 367, 482, - 379, 410, 405, 780, 773, 775, 783, 172, 411, 786, - 1, 788, 517, 824, 1017, 364, 796, 365, 589, 798, - 526, 800, 801, 137, 382, 383, 527, 483, 390, 576, - 815, 276, 387, 817, 366, 818, 827, 370, 464, 454, - 459, 556, 608, 432, 446, 570, 564, 535, 1081, 565, - 861, 348, 869, 660, 877, 880, 484, 557, 891, 451, - 899, 1094, 397, 905, 911, 916, 287, 919, 417, 412, - 584, 924, 925, 5, 929, 621, 622, 8, 312, 952, - 598, 966, 420, 1036, 1038, 485, 486, 521, 458, 507, - 525, 487, 1059, 440, 413, 1062, 488, 489, 433, 434, - 1078, 354, 1163, 353, 448, 320, 1150, 579, 1113, 455, - 1203, 1159, 347, 490, 491, 376, 1182, 392, 1198, 437, - 1205, 1213, 343, 539, 566 - ); - - protected $ruleToNonTerminal = array( - 0, 1, 3, 3, 2, 5, 5, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, - 7, 7, 7, 7, 8, 8, 9, 10, 11, 11, - 12, 12, 13, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 18, 18, 19, 19, 21, 21, - 17, 17, 22, 22, 23, 23, 24, 24, 25, 25, - 20, 20, 26, 28, 28, 29, 30, 30, 32, 31, - 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 14, 14, 54, 54, 56, 55, 55, 48, - 48, 58, 58, 59, 59, 60, 60, 15, 16, 16, - 16, 63, 63, 63, 64, 64, 67, 67, 65, 65, - 69, 69, 41, 41, 50, 50, 53, 53, 53, 52, - 52, 70, 42, 42, 42, 42, 71, 71, 72, 72, - 73, 73, 39, 39, 35, 35, 74, 37, 37, 75, - 36, 36, 38, 38, 49, 49, 49, 61, 61, 77, - 77, 78, 78, 80, 80, 80, 79, 79, 62, 62, - 81, 81, 81, 82, 82, 83, 83, 83, 44, 44, - 84, 84, 84, 45, 45, 85, 85, 86, 86, 66, - 87, 87, 87, 87, 92, 92, 93, 93, 94, 94, - 94, 94, 94, 95, 96, 96, 91, 91, 88, 88, - 90, 90, 98, 98, 97, 97, 97, 97, 97, 97, - 89, 89, 100, 99, 99, 46, 46, 40, 40, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 34, 34, 47, 47, 105, - 105, 106, 106, 106, 106, 112, 101, 101, 108, 108, - 114, 114, 115, 116, 116, 116, 116, 116, 116, 68, - 68, 57, 57, 57, 57, 102, 102, 120, 120, 117, - 117, 121, 121, 121, 121, 103, 103, 103, 107, 107, - 107, 113, 113, 126, 126, 126, 126, 126, 126, 126, - 126, 126, 126, 126, 126, 126, 27, 27, 27, 27, - 27, 27, 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 111, 111, 104, 104, - 104, 104, 127, 127, 130, 130, 129, 129, 131, 131, - 51, 51, 51, 51, 133, 133, 132, 132, 132, 132, - 132, 134, 134, 119, 119, 122, 122, 118, 118, 136, - 135, 135, 135, 135, 123, 123, 123, 123, 110, 110, - 124, 124, 124, 124, 76, 137, 137, 138, 138, 138, - 109, 109, 139, 139, 140, 140, 140, 140, 140, 125, - 125, 125, 125, 142, 143, 141, 141, 141, 141, 141, - 141, 141, 144, 144, 144 - ); - - protected $ruleToLength = array( - 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 3, 5, 4, - 3, 4, 2, 3, 1, 1, 7, 6, 3, 1, - 3, 1, 3, 1, 1, 3, 1, 3, 1, 2, - 3, 1, 3, 3, 1, 3, 2, 0, 1, 1, - 1, 1, 1, 3, 5, 8, 3, 5, 9, 3, - 2, 3, 2, 3, 2, 3, 3, 3, 3, 1, - 2, 2, 5, 7, 9, 5, 6, 3, 3, 2, - 2, 1, 1, 1, 0, 2, 8, 0, 4, 1, - 3, 0, 1, 0, 1, 0, 1, 10, 7, 6, - 5, 1, 2, 2, 0, 2, 0, 2, 0, 2, - 1, 3, 1, 4, 1, 4, 1, 1, 4, 1, - 3, 3, 3, 4, 4, 5, 0, 2, 4, 3, - 1, 1, 1, 4, 0, 2, 3, 0, 2, 4, - 0, 2, 0, 3, 1, 2, 1, 1, 0, 1, - 3, 4, 6, 1, 1, 1, 0, 1, 0, 2, - 2, 3, 3, 1, 3, 1, 2, 2, 3, 1, - 1, 2, 4, 3, 1, 1, 3, 2, 0, 1, - 3, 3, 9, 3, 1, 3, 0, 2, 4, 5, - 4, 4, 4, 3, 1, 1, 1, 3, 1, 1, - 0, 1, 1, 2, 1, 1, 1, 1, 1, 1, - 1, 3, 1, 1, 3, 3, 1, 0, 1, 1, - 3, 3, 4, 4, 1, 2, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, - 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 2, 2, 2, 2, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 1, 3, 5, 4, 3, - 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 1, 1, 3, - 2, 1, 2, 10, 11, 3, 3, 2, 4, 4, - 3, 4, 4, 4, 4, 7, 3, 2, 0, 4, - 1, 3, 2, 2, 4, 6, 2, 2, 4, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 3, 3, 4, 4, 0, 2, 1, 0, 1, - 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 3, 2, 1, 3, 1, 4, - 3, 1, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, - 3, 3, 5, 4, 4, 3, 1, 3, 1, 1, - 3, 3, 0, 2, 0, 1, 3, 1, 3, 1, - 1, 1, 1, 1, 6, 4, 3, 4, 2, 4, - 4, 1, 3, 1, 2, 1, 1, 4, 1, 1, - 3, 6, 4, 4, 4, 4, 1, 4, 0, 1, - 1, 3, 1, 1, 4, 3, 1, 1, 1, 0, - 0, 2, 3, 1, 3, 1, 4, 2, 2, 2, - 2, 1, 2, 1, 1, 1, 4, 3, 3, 3, - 6, 3, 1, 1, 1 - ); - - protected function initReduceCallbacks() { - $this->reduceCallbacks = [ - 0 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 1 => function ($stackPos) { - $this->semValue = $this->handleNamespaces($this->semStack[$stackPos-(1-1)]); - }, - 2 => function ($stackPos) { - if (is_array($this->semStack[$stackPos-(2-2)])) { $this->semValue = array_merge($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); } else { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }; - }, - 3 => function ($stackPos) { - $this->semValue = array(); - }, - 4 => function ($stackPos) { - $startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; }; - if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 5 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 6 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 7 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 8 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 9 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 10 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 11 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 12 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 13 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 14 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 15 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 16 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 17 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 18 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 19 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 20 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 21 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 22 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 23 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 24 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 25 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 26 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 27 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 28 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 29 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 30 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 31 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 32 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 33 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 34 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 35 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 36 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 37 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 38 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 39 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 40 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 41 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 42 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 43 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 44 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 45 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 46 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 47 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 48 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 49 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 50 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 51 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 52 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 53 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 54 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 55 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 56 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 57 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 58 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 59 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 60 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 61 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 62 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 63 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 64 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 65 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 66 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 67 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 68 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 69 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 70 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 71 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 72 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 73 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 74 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 75 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 76 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 77 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 78 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 79 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 80 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 81 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 82 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 83 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 84 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 85 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 86 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 87 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 88 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 89 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 90 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 91 => function ($stackPos) { - $this->semValue = new Name(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 92 => function ($stackPos) { - $this->semValue = new Expr\Variable(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 93 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 94 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 95 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 96 => function ($stackPos) { - $this->semValue = new Stmt\HaltCompiler($this->lexer->handleHaltCompiler(), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 97 => function ($stackPos) { - $this->semValue = new Stmt\Namespace_($this->semStack[$stackPos-(3-2)], null, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_SEMICOLON); - $this->checkNamespace($this->semValue); - }, - 98 => function ($stackPos) { - $this->semValue = new Stmt\Namespace_($this->semStack[$stackPos-(5-2)], $this->semStack[$stackPos-(5-4)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); - $this->checkNamespace($this->semValue); - }, - 99 => function ($stackPos) { - $this->semValue = new Stmt\Namespace_(null, $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); - $this->checkNamespace($this->semValue); - }, - 100 => function ($stackPos) { - $this->semValue = new Stmt\Use_($this->semStack[$stackPos-(3-2)], Stmt\Use_::TYPE_NORMAL, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 101 => function ($stackPos) { - $this->semValue = new Stmt\Use_($this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-2)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 102 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 103 => function ($stackPos) { - $this->semValue = new Stmt\Const_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 104 => function ($stackPos) { - $this->semValue = Stmt\Use_::TYPE_FUNCTION; - }, - 105 => function ($stackPos) { - $this->semValue = Stmt\Use_::TYPE_CONSTANT; - }, - 106 => function ($stackPos) { - $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-6)], $this->semStack[$stackPos-(7-2)], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); - }, - 107 => function ($stackPos) { - $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-5)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); - }, - 108 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 109 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 110 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 111 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 112 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 113 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 114 => function ($stackPos) { - $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(1-1)], null, Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(1-1)); - }, - 115 => function ($stackPos) { - $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(3-3)); - }, - 116 => function ($stackPos) { - $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(1-1)], null, Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(1-1)); - }, - 117 => function ($stackPos) { - $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(3-3)); - }, - 118 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; $this->semValue->type = Stmt\Use_::TYPE_NORMAL; - }, - 119 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; $this->semValue->type = $this->semStack[$stackPos-(2-1)]; - }, - 120 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 121 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 122 => function ($stackPos) { - $this->semValue = new Node\Const_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 123 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 124 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 125 => function ($stackPos) { - $this->semValue = new Node\Const_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 126 => function ($stackPos) { - if (is_array($this->semStack[$stackPos-(2-2)])) { $this->semValue = array_merge($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); } else { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }; - }, - 127 => function ($stackPos) { - $this->semValue = array(); - }, - 128 => function ($stackPos) { - $startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; }; - if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 129 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 130 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 131 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 132 => function ($stackPos) { - throw new Error('__HALT_COMPILER() can only be used from the outermost scope', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 133 => function ($stackPos) { - - if ($this->semStack[$stackPos-(3-2)]) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; $attrs = $this->startAttributeStack[$stackPos-(3-1)]; $stmts = $this->semValue; if (!empty($attrs['comments'])) {$stmts[0]->setAttribute('comments', array_merge($attrs['comments'], $stmts[0]->getAttribute('comments', []))); }; - } else { - $startAttributes = $this->startAttributeStack[$stackPos-(3-1)]; if (isset($startAttributes['comments'])) { $this->semValue = new Stmt\Nop($startAttributes + $this->endAttributes); } else { $this->semValue = null; }; - if (null === $this->semValue) { $this->semValue = array(); } - } - - }, - 134 => function ($stackPos) { - $this->semValue = new Stmt\If_($this->semStack[$stackPos-(5-2)], ['stmts' => is_array($this->semStack[$stackPos-(5-3)]) ? $this->semStack[$stackPos-(5-3)] : array($this->semStack[$stackPos-(5-3)]), 'elseifs' => $this->semStack[$stackPos-(5-4)], 'else' => $this->semStack[$stackPos-(5-5)]], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 135 => function ($stackPos) { - $this->semValue = new Stmt\If_($this->semStack[$stackPos-(8-2)], ['stmts' => $this->semStack[$stackPos-(8-4)], 'elseifs' => $this->semStack[$stackPos-(8-5)], 'else' => $this->semStack[$stackPos-(8-6)]], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); - }, - 136 => function ($stackPos) { - $this->semValue = new Stmt\While_($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 137 => function ($stackPos) { - $this->semValue = new Stmt\Do_($this->semStack[$stackPos-(5-4)], is_array($this->semStack[$stackPos-(5-2)]) ? $this->semStack[$stackPos-(5-2)] : array($this->semStack[$stackPos-(5-2)]), $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 138 => function ($stackPos) { - $this->semValue = new Stmt\For_(['init' => $this->semStack[$stackPos-(9-3)], 'cond' => $this->semStack[$stackPos-(9-5)], 'loop' => $this->semStack[$stackPos-(9-7)], 'stmts' => $this->semStack[$stackPos-(9-9)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); - }, - 139 => function ($stackPos) { - $this->semValue = new Stmt\Switch_($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 140 => function ($stackPos) { - $this->semValue = new Stmt\Break_(null, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 141 => function ($stackPos) { - $this->semValue = new Stmt\Break_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 142 => function ($stackPos) { - $this->semValue = new Stmt\Continue_(null, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 143 => function ($stackPos) { - $this->semValue = new Stmt\Continue_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 144 => function ($stackPos) { - $this->semValue = new Stmt\Return_(null, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 145 => function ($stackPos) { - $this->semValue = new Stmt\Return_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 146 => function ($stackPos) { - $this->semValue = new Stmt\Global_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 147 => function ($stackPos) { - $this->semValue = new Stmt\Static_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 148 => function ($stackPos) { - $this->semValue = new Stmt\Echo_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 149 => function ($stackPos) { - $this->semValue = new Stmt\InlineHTML($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 150 => function ($stackPos) { - $this->semValue = new Stmt\Expression($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 151 => function ($stackPos) { - $this->semValue = new Stmt\Expression($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 152 => function ($stackPos) { - $this->semValue = new Stmt\Unset_($this->semStack[$stackPos-(5-3)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 153 => function ($stackPos) { - $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-5)][0], ['keyVar' => null, 'byRef' => $this->semStack[$stackPos-(7-5)][1], 'stmts' => $this->semStack[$stackPos-(7-7)]], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); - }, - 154 => function ($stackPos) { - $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(9-3)], $this->semStack[$stackPos-(9-7)][0], ['keyVar' => $this->semStack[$stackPos-(9-5)], 'byRef' => $this->semStack[$stackPos-(9-7)][1], 'stmts' => $this->semStack[$stackPos-(9-9)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); - }, - 155 => function ($stackPos) { - $this->semValue = new Stmt\Declare_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 156 => function ($stackPos) { - $this->semValue = new Stmt\TryCatch($this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-5)], $this->semStack[$stackPos-(6-6)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); $this->checkTryCatch($this->semValue); - }, - 157 => function ($stackPos) { - $this->semValue = new Stmt\Throw_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 158 => function ($stackPos) { - $this->semValue = new Stmt\Goto_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 159 => function ($stackPos) { - $this->semValue = new Stmt\Label($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 160 => function ($stackPos) { - $this->semValue = new Stmt\Expression($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 161 => function ($stackPos) { - $this->semValue = array(); /* means: no statement */ - }, - 162 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 163 => function ($stackPos) { - $startAttributes = $this->startAttributeStack[$stackPos-(1-1)]; if (isset($startAttributes['comments'])) { $this->semValue = new Stmt\Nop($startAttributes + $this->endAttributes); } else { $this->semValue = null; }; - if ($this->semValue === null) $this->semValue = array(); /* means: no statement */ - }, - 164 => function ($stackPos) { - $this->semValue = array(); - }, - 165 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 166 => function ($stackPos) { - $this->semValue = new Stmt\Catch_(array($this->semStack[$stackPos-(8-3)]), $this->semStack[$stackPos-(8-4)], $this->semStack[$stackPos-(8-7)], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); - }, - 167 => function ($stackPos) { - $this->semValue = null; - }, - 168 => function ($stackPos) { - $this->semValue = new Stmt\Finally_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 169 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 170 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 171 => function ($stackPos) { - $this->semValue = false; - }, - 172 => function ($stackPos) { - $this->semValue = true; - }, - 173 => function ($stackPos) { - $this->semValue = false; - }, - 174 => function ($stackPos) { - $this->semValue = true; - }, - 175 => function ($stackPos) { - $this->semValue = false; - }, - 176 => function ($stackPos) { - $this->semValue = true; - }, - 177 => function ($stackPos) { - $this->semValue = new Stmt\Function_($this->semStack[$stackPos-(10-3)], ['byRef' => $this->semStack[$stackPos-(10-2)], 'params' => $this->semStack[$stackPos-(10-5)], 'returnType' => $this->semStack[$stackPos-(10-7)], 'stmts' => $this->semStack[$stackPos-(10-9)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); - }, - 178 => function ($stackPos) { - $this->semValue = new Stmt\Class_($this->semStack[$stackPos-(7-2)], ['type' => $this->semStack[$stackPos-(7-1)], 'extends' => $this->semStack[$stackPos-(7-3)], 'implements' => $this->semStack[$stackPos-(7-4)], 'stmts' => $this->semStack[$stackPos-(7-6)]], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); - $this->checkClass($this->semValue, $stackPos-(7-2)); - }, - 179 => function ($stackPos) { - $this->semValue = new Stmt\Interface_($this->semStack[$stackPos-(6-2)], ['extends' => $this->semStack[$stackPos-(6-3)], 'stmts' => $this->semStack[$stackPos-(6-5)]], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); - $this->checkInterface($this->semValue, $stackPos-(6-2)); - }, - 180 => function ($stackPos) { - $this->semValue = new Stmt\Trait_($this->semStack[$stackPos-(5-2)], ['stmts' => $this->semStack[$stackPos-(5-4)]], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 181 => function ($stackPos) { - $this->semValue = 0; - }, - 182 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT; - }, - 183 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_FINAL; - }, - 184 => function ($stackPos) { - $this->semValue = null; - }, - 185 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 186 => function ($stackPos) { - $this->semValue = array(); - }, - 187 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 188 => function ($stackPos) { - $this->semValue = array(); - }, - 189 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 190 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 191 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 192 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); - }, - 193 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 194 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); - }, - 195 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 196 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); - }, - 197 => function ($stackPos) { - $this->semValue = null; - }, - 198 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 199 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 200 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 201 => function ($stackPos) { - $this->semValue = new Stmt\DeclareDeclare($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 202 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 203 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-3)]; - }, - 204 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 205 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(5-3)]; - }, - 206 => function ($stackPos) { - $this->semValue = array(); - }, - 207 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 208 => function ($stackPos) { - $this->semValue = new Stmt\Case_($this->semStack[$stackPos-(4-2)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 209 => function ($stackPos) { - $this->semValue = new Stmt\Case_(null, $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 210 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 211 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 212 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); - }, - 213 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 214 => function ($stackPos) { - $this->semValue = array(); - }, - 215 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 216 => function ($stackPos) { - $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos-(3-2)], is_array($this->semStack[$stackPos-(3-3)]) ? $this->semStack[$stackPos-(3-3)] : array($this->semStack[$stackPos-(3-3)]), $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 217 => function ($stackPos) { - $this->semValue = array(); - }, - 218 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 219 => function ($stackPos) { - $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos-(4-2)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 220 => function ($stackPos) { - $this->semValue = null; - }, - 221 => function ($stackPos) { - $this->semValue = new Stmt\Else_(is_array($this->semStack[$stackPos-(2-2)]) ? $this->semStack[$stackPos-(2-2)] : array($this->semStack[$stackPos-(2-2)]), $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 222 => function ($stackPos) { - $this->semValue = null; - }, - 223 => function ($stackPos) { - $this->semValue = new Stmt\Else_($this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 224 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)], false); - }, - 225 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(2-2)], true); - }, - 226 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)], false); - }, - 227 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 228 => function ($stackPos) { - $this->semValue = array(); - }, - 229 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 230 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 231 => function ($stackPos) { - $this->semValue = new Node\Param($this->semStack[$stackPos-(4-4)], null, $this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-2)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); $this->checkParam($this->semValue); - }, - 232 => function ($stackPos) { - $this->semValue = new Node\Param($this->semStack[$stackPos-(6-4)], $this->semStack[$stackPos-(6-6)], $this->semStack[$stackPos-(6-1)], $this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-3)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); $this->checkParam($this->semValue); - }, - 233 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 234 => function ($stackPos) { - $this->semValue = new Node\Identifier('array', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 235 => function ($stackPos) { - $this->semValue = new Node\Identifier('callable', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 236 => function ($stackPos) { - $this->semValue = null; - }, - 237 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 238 => function ($stackPos) { - $this->semValue = null; - }, - 239 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 240 => function ($stackPos) { - $this->semValue = array(); - }, - 241 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 242 => function ($stackPos) { - $this->semValue = array(new Node\Arg($this->semStack[$stackPos-(3-2)], false, false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes)); - }, - 243 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 244 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 245 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(1-1)], false, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 246 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], true, false, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 247 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], false, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 248 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 249 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 250 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 251 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 252 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 253 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 254 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 255 => function ($stackPos) { - $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos-(1-1)], null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 256 => function ($stackPos) { - $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 257 => function ($stackPos) { - if ($this->semStack[$stackPos-(2-2)] !== null) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; } - }, - 258 => function ($stackPos) { - $this->semValue = array(); - }, - 259 => function ($stackPos) { - $startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; }; - if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 260 => function ($stackPos) { - $this->semValue = new Stmt\Property($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->checkProperty($this->semValue, $stackPos-(3-1)); - }, - 261 => function ($stackPos) { - $this->semValue = new Stmt\ClassConst($this->semStack[$stackPos-(3-2)], 0, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 262 => function ($stackPos) { - $this->semValue = new Stmt\ClassMethod($this->semStack[$stackPos-(9-4)], ['type' => $this->semStack[$stackPos-(9-1)], 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-6)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); - $this->checkClassMethod($this->semValue, $stackPos-(9-1)); - }, - 263 => function ($stackPos) { - $this->semValue = new Stmt\TraitUse($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 264 => function ($stackPos) { - $this->semValue = array(); - }, - 265 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 266 => function ($stackPos) { - $this->semValue = array(); - }, - 267 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 268 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Precedence($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 269 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(5-1)][0], $this->semStack[$stackPos-(5-1)][1], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-4)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 270 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], $this->semStack[$stackPos-(4-3)], null, $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 271 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], null, $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 272 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], null, $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 273 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); - }, - 274 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 275 => function ($stackPos) { - $this->semValue = array(null, $this->semStack[$stackPos-(1-1)]); - }, - 276 => function ($stackPos) { - $this->semValue = null; - }, - 277 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 278 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 279 => function ($stackPos) { - $this->semValue = 0; - }, - 280 => function ($stackPos) { - $this->semValue = 0; - }, - 281 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 282 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 283 => function ($stackPos) { - $this->checkModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)]; - }, - 284 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PUBLIC; - }, - 285 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PROTECTED; - }, - 286 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PRIVATE; - }, - 287 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_STATIC; - }, - 288 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT; - }, - 289 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_FINAL; - }, - 290 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 291 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 292 => function ($stackPos) { - $this->semValue = new Node\VarLikeIdentifier(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 293 => function ($stackPos) { - $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos-(1-1)], null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 294 => function ($stackPos) { - $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 295 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 296 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 297 => function ($stackPos) { - $this->semValue = array(); - }, - 298 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 299 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 300 => function ($stackPos) { - $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 301 => function ($stackPos) { - $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 302 => function ($stackPos) { - $this->semValue = new Expr\AssignRef($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 303 => function ($stackPos) { - $this->semValue = new Expr\AssignRef($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 304 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 305 => function ($stackPos) { - $this->semValue = new Expr\Clone_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 306 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 307 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 308 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 309 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 310 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 311 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 312 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 313 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 314 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 315 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 316 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 317 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 318 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Coalesce($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 319 => function ($stackPos) { - $this->semValue = new Expr\PostInc($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 320 => function ($stackPos) { - $this->semValue = new Expr\PreInc($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 321 => function ($stackPos) { - $this->semValue = new Expr\PostDec($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 322 => function ($stackPos) { - $this->semValue = new Expr\PreDec($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 323 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BooleanOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 324 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BooleanAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 325 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 326 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 327 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 328 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 329 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 330 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 331 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 332 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 333 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 334 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 335 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 336 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 337 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 338 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 339 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 340 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 341 => function ($stackPos) { - $this->semValue = new Expr\UnaryPlus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 342 => function ($stackPos) { - $this->semValue = new Expr\UnaryMinus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 343 => function ($stackPos) { - $this->semValue = new Expr\BooleanNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 344 => function ($stackPos) { - $this->semValue = new Expr\BitwiseNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 345 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Identical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 346 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\NotIdentical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 347 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Equal($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 348 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\NotEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 349 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Spaceship($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 350 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Smaller($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 351 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\SmallerOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 352 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Greater($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 353 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\GreaterOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 354 => function ($stackPos) { - $this->semValue = new Expr\Instanceof_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 355 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 356 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 357 => function ($stackPos) { - $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(5-1)], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 358 => function ($stackPos) { - $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(4-1)], null, $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 359 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Coalesce($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 360 => function ($stackPos) { - $this->semValue = new Expr\Isset_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 361 => function ($stackPos) { - $this->semValue = new Expr\Empty_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 362 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 363 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE_ONCE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 364 => function ($stackPos) { - $this->semValue = new Expr\Eval_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 365 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 366 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE_ONCE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 367 => function ($stackPos) { - $this->semValue = new Expr\Cast\Int_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 368 => function ($stackPos) { - $attrs = $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes; - $attrs['kind'] = $this->getFloatCastKind($this->semStack[$stackPos-(2-1)]); - $this->semValue = new Expr\Cast\Double($this->semStack[$stackPos-(2-2)], $attrs); - }, - 369 => function ($stackPos) { - $this->semValue = new Expr\Cast\String_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 370 => function ($stackPos) { - $this->semValue = new Expr\Cast\Array_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 371 => function ($stackPos) { - $this->semValue = new Expr\Cast\Object_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 372 => function ($stackPos) { - $this->semValue = new Expr\Cast\Bool_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 373 => function ($stackPos) { - $this->semValue = new Expr\Cast\Unset_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 374 => function ($stackPos) { - $attrs = $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes; - $attrs['kind'] = strtolower($this->semStack[$stackPos-(2-1)]) === 'exit' ? Expr\Exit_::KIND_EXIT : Expr\Exit_::KIND_DIE; - $this->semValue = new Expr\Exit_($this->semStack[$stackPos-(2-2)], $attrs); - }, - 375 => function ($stackPos) { - $this->semValue = new Expr\ErrorSuppress($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 376 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 377 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 378 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 379 => function ($stackPos) { - $this->semValue = new Expr\ShellExec($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 380 => function ($stackPos) { - $this->semValue = new Expr\Print_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 381 => function ($stackPos) { - $this->semValue = new Expr\Yield_(null, null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 382 => function ($stackPos) { - $this->semValue = new Expr\YieldFrom($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 383 => function ($stackPos) { - $this->semValue = new Expr\Closure(['static' => false, 'byRef' => $this->semStack[$stackPos-(10-2)], 'params' => $this->semStack[$stackPos-(10-4)], 'uses' => $this->semStack[$stackPos-(10-6)], 'returnType' => $this->semStack[$stackPos-(10-7)], 'stmts' => $this->semStack[$stackPos-(10-9)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); - }, - 384 => function ($stackPos) { - $this->semValue = new Expr\Closure(['static' => true, 'byRef' => $this->semStack[$stackPos-(11-3)], 'params' => $this->semStack[$stackPos-(11-5)], 'uses' => $this->semStack[$stackPos-(11-7)], 'returnType' => $this->semStack[$stackPos-(11-8)], 'stmts' => $this->semStack[$stackPos-(11-10)]], $this->startAttributeStack[$stackPos-(11-1)] + $this->endAttributes); - }, - 385 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 386 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 387 => function ($stackPos) { - $this->semValue = new Expr\Yield_($this->semStack[$stackPos-(2-2)], null, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 388 => function ($stackPos) { - $this->semValue = new Expr\Yield_($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-2)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 389 => function ($stackPos) { - $attrs = $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes; $attrs['kind'] = Expr\Array_::KIND_LONG; - $this->semValue = new Expr\Array_($this->semStack[$stackPos-(4-3)], $attrs); - }, - 390 => function ($stackPos) { - $attrs = $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes; $attrs['kind'] = Expr\Array_::KIND_SHORT; - $this->semValue = new Expr\Array_($this->semStack[$stackPos-(3-2)], $attrs); - }, - 391 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 392 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch(Scalar\String_::fromString($this->semStack[$stackPos-(4-1)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes), $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 393 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 394 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 395 => function ($stackPos) { - $this->semValue = array(new Stmt\Class_(null, ['type' => 0, 'extends' => $this->semStack[$stackPos-(7-3)], 'implements' => $this->semStack[$stackPos-(7-4)], 'stmts' => $this->semStack[$stackPos-(7-6)]], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes), $this->semStack[$stackPos-(7-2)]); - $this->checkClass($this->semValue[0], -1); - }, - 396 => function ($stackPos) { - $this->semValue = new Expr\New_($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 397 => function ($stackPos) { - list($class, $ctorArgs) = $this->semStack[$stackPos-(2-2)]; $this->semValue = new Expr\New_($class, $ctorArgs, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 398 => function ($stackPos) { - $this->semValue = array(); - }, - 399 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-3)]; - }, - 400 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 401 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 402 => function ($stackPos) { - $this->semValue = new Expr\ClosureUse($this->semStack[$stackPos-(2-2)], $this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 403 => function ($stackPos) { - $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 404 => function ($stackPos) { - $this->semValue = new Expr\StaticCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 405 => function ($stackPos) { - $this->semValue = new Expr\StaticCall($this->semStack[$stackPos-(6-1)], $this->semStack[$stackPos-(6-4)], $this->semStack[$stackPos-(6-6)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); - }, - 406 => function ($stackPos) { - $this->semValue = $this->fixupPhp5StaticPropCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 407 => function ($stackPos) { - $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 408 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 409 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 410 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 411 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 412 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 413 => function ($stackPos) { - $this->semValue = new Name\FullyQualified(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 414 => function ($stackPos) { - $this->semValue = new Name\Relative(substr($this->semStack[$stackPos-(1-1)], 10), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 415 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 416 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 417 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 418 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 419 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 420 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 421 => function ($stackPos) { - $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 422 => function ($stackPos) { - $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 423 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 424 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 425 => function ($stackPos) { - $this->semValue = null; - }, - 426 => function ($stackPos) { - $this->semValue = null; - }, - 427 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 428 => function ($stackPos) { - $this->semValue = array(); - }, - 429 => function ($stackPos) { - $this->semValue = array(new Scalar\EncapsedStringPart(Scalar\String_::parseEscapeSequences($this->semStack[$stackPos-(1-1)], '`', false), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes)); - }, - 430 => function ($stackPos) { - foreach ($this->semStack[$stackPos-(1-1)] as $s) { if ($s instanceof Node\Scalar\EncapsedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '`', false); } }; $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 431 => function ($stackPos) { - $this->semValue = array(); - }, - 432 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 433 => function ($stackPos) { - $this->semValue = $this->parseLNumber($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes, true); - }, - 434 => function ($stackPos) { - $this->semValue = Scalar\DNumber::fromString($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 435 => function ($stackPos) { - $this->semValue = Scalar\String_::fromString($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes, false); - }, - 436 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Line($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 437 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\File($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 438 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Dir($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 439 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Class_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 440 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Trait_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 441 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Method($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 442 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Function_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 443 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Namespace_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 444 => function ($stackPos) { - $this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)], false); - }, - 445 => function ($stackPos) { - $this->semValue = $this->parseDocString($this->semStack[$stackPos-(2-1)], '', $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(2-2)] + $this->endAttributeStack[$stackPos-(2-2)], false); - }, - 446 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 447 => function ($stackPos) { - $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 448 => function ($stackPos) { - $this->semValue = new Expr\ConstFetch($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 449 => function ($stackPos) { - $this->semValue = new Expr\Array_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 450 => function ($stackPos) { - $this->semValue = new Expr\Array_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 451 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 452 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BooleanOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 453 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BooleanAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 454 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 455 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 456 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 457 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 458 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 459 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 460 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 461 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 462 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 463 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 464 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 465 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 466 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 467 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 468 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 469 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 470 => function ($stackPos) { - $this->semValue = new Expr\UnaryPlus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 471 => function ($stackPos) { - $this->semValue = new Expr\UnaryMinus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 472 => function ($stackPos) { - $this->semValue = new Expr\BooleanNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 473 => function ($stackPos) { - $this->semValue = new Expr\BitwiseNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 474 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Identical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 475 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\NotIdentical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 476 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Equal($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 477 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\NotEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 478 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Smaller($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 479 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\SmallerOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 480 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Greater($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 481 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\GreaterOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 482 => function ($stackPos) { - $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(5-1)], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 483 => function ($stackPos) { - $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(4-1)], null, $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 484 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 485 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 486 => function ($stackPos) { - $this->semValue = new Expr\ConstFetch($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 487 => function ($stackPos) { - $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 488 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 489 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 490 => function ($stackPos) { - $attrs = $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes; $attrs['kind'] = Scalar\String_::KIND_DOUBLE_QUOTED; - foreach ($this->semStack[$stackPos-(3-2)] as $s) { if ($s instanceof Node\Scalar\EncapsedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '"', true); } }; $this->semValue = new Scalar\Encapsed($this->semStack[$stackPos-(3-2)], $attrs); - }, - 491 => function ($stackPos) { - $this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)], true); - }, - 492 => function ($stackPos) { - $this->semValue = array(); - }, - 493 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 494 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 495 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 496 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 497 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 498 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 499 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 500 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 501 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 502 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 503 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 504 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-5)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); - }, - 505 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 506 => function ($stackPos) { - $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 507 => function ($stackPos) { - $this->semValue = new Expr\MethodCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 508 => function ($stackPos) { - $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 509 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 510 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 511 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 512 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 513 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 514 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 515 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 516 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 517 => function ($stackPos) { - $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 518 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 519 => function ($stackPos) { - $var = substr($this->semStack[$stackPos-(1-1)], 1); $this->semValue = \is_string($var) ? new Node\VarLikeIdentifier($var, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes) : $var; - }, - 520 => function ($stackPos) { - $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 521 => function ($stackPos) { - $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(6-1)], $this->semStack[$stackPos-(6-5)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); - }, - 522 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 523 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 524 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 525 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 526 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 527 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 528 => function ($stackPos) { - $this->semValue = null; - }, - 529 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 530 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 531 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 532 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 533 => function ($stackPos) { - $this->semValue = new Expr\Error($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->errorState = 2; - }, - 534 => function ($stackPos) { - $this->semValue = new Expr\List_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 535 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 536 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 537 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 538 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 539 => function ($stackPos) { - $this->semValue = null; - }, - 540 => function ($stackPos) { - $this->semValue = array(); - }, - 541 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 542 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 543 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 544 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 545 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 546 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-1)], true, $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 547 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 548 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, false, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 549 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 550 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 551 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 552 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); - }, - 553 => function ($stackPos) { - $this->semValue = new Scalar\EncapsedStringPart($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 554 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 555 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 556 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 557 => function ($stackPos) { - $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 558 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 559 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 560 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-4)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); - }, - 561 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 562 => function ($stackPos) { - $this->semValue = new Scalar\String_($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 563 => function ($stackPos) { - $this->semValue = $this->parseNumString($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 564 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - ]; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php b/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php deleted file mode 100644 index 91eefac8..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php +++ /dev/null @@ -1,2856 +0,0 @@ -<?php - -namespace PhpParser\Parser; - -use PhpParser\Error; -use PhpParser\Node; -use PhpParser\Node\Expr; -use PhpParser\Node\Name; -use PhpParser\Node\Scalar; -use PhpParser\Node\Stmt; - -/* This is an automatically GENERATED file, which should not be manually edited. - * Instead edit one of the following: - * * the grammar files grammar/php5.y or grammar/php7.y - * * the skeleton file grammar/parser.template - * * the preprocessing script grammar/rebuildParsers.php - */ -class Php7 extends \PhpParser\ParserAbstract -{ - protected $tokenToSymbolMapSize = 396; - protected $actionTableSize = 1217; - protected $gotoTableSize = 604; - - protected $invalidSymbol = 168; - protected $errorSymbol = 1; - protected $defaultAction = -32766; - protected $unexpectedTokenRule = 32767; - - protected $YY2TBLSTATE = 429; - protected $numNonLeafStates = 717; - - protected $symbolToName = array( - "EOF", - "error", - "T_THROW", - "T_INCLUDE", - "T_INCLUDE_ONCE", - "T_EVAL", - "T_REQUIRE", - "T_REQUIRE_ONCE", - "','", - "T_LOGICAL_OR", - "T_LOGICAL_XOR", - "T_LOGICAL_AND", - "T_PRINT", - "T_YIELD", - "T_DOUBLE_ARROW", - "T_YIELD_FROM", - "'='", - "T_PLUS_EQUAL", - "T_MINUS_EQUAL", - "T_MUL_EQUAL", - "T_DIV_EQUAL", - "T_CONCAT_EQUAL", - "T_MOD_EQUAL", - "T_AND_EQUAL", - "T_OR_EQUAL", - "T_XOR_EQUAL", - "T_SL_EQUAL", - "T_SR_EQUAL", - "T_POW_EQUAL", - "T_COALESCE_EQUAL", - "'?'", - "':'", - "T_COALESCE", - "T_BOOLEAN_OR", - "T_BOOLEAN_AND", - "'|'", - "'^'", - "T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG", - "T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG", - "T_IS_EQUAL", - "T_IS_NOT_EQUAL", - "T_IS_IDENTICAL", - "T_IS_NOT_IDENTICAL", - "T_SPACESHIP", - "'<'", - "T_IS_SMALLER_OR_EQUAL", - "'>'", - "T_IS_GREATER_OR_EQUAL", - "T_SL", - "T_SR", - "'+'", - "'-'", - "'.'", - "'*'", - "'/'", - "'%'", - "'!'", - "T_INSTANCEOF", - "'~'", - "T_INC", - "T_DEC", - "T_INT_CAST", - "T_DOUBLE_CAST", - "T_STRING_CAST", - "T_ARRAY_CAST", - "T_OBJECT_CAST", - "T_BOOL_CAST", - "T_UNSET_CAST", - "'@'", - "T_POW", - "'['", - "T_NEW", - "T_CLONE", - "T_EXIT", - "T_IF", - "T_ELSEIF", - "T_ELSE", - "T_ENDIF", - "T_LNUMBER", - "T_DNUMBER", - "T_STRING", - "T_STRING_VARNAME", - "T_VARIABLE", - "T_NUM_STRING", - "T_INLINE_HTML", - "T_ENCAPSED_AND_WHITESPACE", - "T_CONSTANT_ENCAPSED_STRING", - "T_ECHO", - "T_DO", - "T_WHILE", - "T_ENDWHILE", - "T_FOR", - "T_ENDFOR", - "T_FOREACH", - "T_ENDFOREACH", - "T_DECLARE", - "T_ENDDECLARE", - "T_AS", - "T_SWITCH", - "T_MATCH", - "T_ENDSWITCH", - "T_CASE", - "T_DEFAULT", - "T_BREAK", - "T_CONTINUE", - "T_GOTO", - "T_FUNCTION", - "T_FN", - "T_CONST", - "T_RETURN", - "T_TRY", - "T_CATCH", - "T_FINALLY", - "T_USE", - "T_INSTEADOF", - "T_GLOBAL", - "T_STATIC", - "T_ABSTRACT", - "T_FINAL", - "T_PRIVATE", - "T_PROTECTED", - "T_PUBLIC", - "T_READONLY", - "T_VAR", - "T_UNSET", - "T_ISSET", - "T_EMPTY", - "T_HALT_COMPILER", - "T_CLASS", - "T_TRAIT", - "T_INTERFACE", - "T_ENUM", - "T_EXTENDS", - "T_IMPLEMENTS", - "T_OBJECT_OPERATOR", - "T_NULLSAFE_OBJECT_OPERATOR", - "T_LIST", - "T_ARRAY", - "T_CALLABLE", - "T_CLASS_C", - "T_TRAIT_C", - "T_METHOD_C", - "T_FUNC_C", - "T_LINE", - "T_FILE", - "T_START_HEREDOC", - "T_END_HEREDOC", - "T_DOLLAR_OPEN_CURLY_BRACES", - "T_CURLY_OPEN", - "T_PAAMAYIM_NEKUDOTAYIM", - "T_NAMESPACE", - "T_NS_C", - "T_DIR", - "T_NS_SEPARATOR", - "T_ELLIPSIS", - "T_NAME_FULLY_QUALIFIED", - "T_NAME_QUALIFIED", - "T_NAME_RELATIVE", - "T_ATTRIBUTE", - "';'", - "']'", - "'{'", - "'}'", - "'('", - "')'", - "'`'", - "'\"'", - "'$'" - ); - - protected $tokenToSymbol = array( - 0, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 56, 166, 168, 167, 55, 168, 168, - 163, 164, 53, 50, 8, 51, 52, 54, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 31, 159, - 44, 16, 46, 30, 68, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 70, 168, 160, 36, 168, 165, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 161, 35, 162, 58, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 1, 2, 3, 4, - 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 32, 33, 34, 37, 38, 39, 40, - 41, 42, 43, 45, 47, 48, 49, 57, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 69, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158 - ); - - protected $action = array( - 132, 133, 134, 570, 135, 136, 0, 729, 730, 731, - 137, 37, 929, 450, 451, 452,-32766,-32766,-32766,-32767, - -32767,-32767,-32767, 101, 102, 103, 104, 105, 1085, 1086, - 1087, 1084, 1083, 1082, 1088, 723, 722,-32766, 1275,-32766, - -32766,-32766,-32766,-32766,-32766,-32766,-32767,-32767,-32767,-32767, - -32767, 373, 374, 918, 2, 732,-32766,-32766,-32766, 1001, - 472, 417, 150,-32766,-32766,-32766, 375, 374, 12, 267, - 138, 399, 736, 737, 738, 739, 417,-32766, 423,-32766, - -32766,-32766,-32766,-32766,-32766, 740, 741, 742, 743, 744, - 745, 746, 747, 748, 749, 750, 770, 571, 771, 772, - 773, 774, 762, 763, 339, 340, 765, 766, 751, 752, - 753, 755, 756, 757, 349, 797, 798, 799, 800, 801, - 802, 758, 759, 572, 573, 791, 782, 780, 781, 794, - 777, 778, 323, 423, 574, 575, 776, 576, 577, 578, - 579, 580, 581, -324, -585, 810, 34, 805, 779, 582, - 583, -585, 139,-32766,-32766,-32766, 132, 133, 134, 570, - 135, 136, 1034, 729, 730, 731, 137, 37,-32766,-32766, - -32766, 544, 814, 126,-32766, 1310,-32766,-32766,-32766,-32766, - -32766,-32766,-32766, 1085, 1086, 1087, 1084, 1083, 1082, 1088, - 473, 723, 722,-32766,-32766,-32766, 458, 459, 81,-32766, - -32766,-32766, -193, -192, 322, 898, 240, 599, 1210, 1209, - 1211, 732, 816, 703,-32766, 1063,-32766,-32766,-32766,-32766, - -32766, 811,-32766,-32766,-32766, 267, 138, 399, 736, 737, - 738, 739, 1247, 1295, 423, 694, 1320, 35, 249, 1321, - 1294, 740, 741, 742, 743, 744, 745, 746, 747, 748, - 749, 750, 770, 571, 771, 772, 773, 774, 762, 763, - 339, 340, 765, 766, 751, 752, 753, 755, 756, 757, - 349, 797, 798, 799, 800, 801, 802, 758, 759, 572, - 573, 791, 782, 780, 781, 794, 777, 778, 888, 593, - 574, 575, 776, 576, 577, 578, 579, 580, 581, -324, - 82, 83, 84, -585, 779, 582, 583, -585, 148, 754, - 724, 725, 726, 727, 728, -582, 729, 730, 731, 767, - 768, 36, -582, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, -362, 271, -362, - -32766,-32766,-32766, 106, 107, 108, -268, 271, -193, -192, - 109, 933, 934, 900, 732, 689, 935, 14, 288, 109, - 815,-32766, 1061,-32766,-32766, 964, -86, 288, 733, 734, - 735, 736, 737, 738, 739, 239, 384, 803, 11, 1077, - -539,-32766,-32766,-32766, 740, 741, 742, 743, 744, 745, - 746, 747, 748, 749, 750, 770, 793, 771, 772, 773, - 774, 762, 763, 764, 792, 765, 766, 751, 752, 753, - 755, 756, 757, 796, 797, 798, 799, 800, 801, 802, - 758, 759, 760, 761, 791, 782, 780, 781, 794, 777, - 778, 128, -86, 769, 775, 776, 783, 784, 786, 785, - 787, 788, -576, 144, -539, -539, -576, 779, 790, 789, - 49, 50, 51, 503, 52, 53, 997, 996, 995, 998, - 54, 55, -111, 56, -582, 1033, 1010, -111, -582, -111, - 1291, -539,-32766,-32766, 302, 1010, 1010, -111, -111, -111, - -111, -111, -111, -111, -111, 1208, 841, 898, 842, 253, - 807, 287, 306, 965, 284, 898, 723, 722, 57, 58, - 287, 287, 1007, -536, 59, 308, 60, 246, 247, 61, - 62, 63, 64, 65, 66, 67, 68, 695, 27, 269, - 69, 439, 504, -338, 1010, 696, 1241, 1242, 505, 898, - 814, 640, 25, 898, 1239, 41, 24, 506, 320, 507, - 1235, 508, 1009, 509, 149, 402, 510, 511, 841, 805, - 842, 43, 44, 440, 370, 369, 898, 45, 512, 698, - 1210, 1209, 1211, 361, 335, 1215, 809, -536, -536, 336, - 888, 691, 513, 514, 515, 1215, 1007, 1062, 888, 715, - 1007, 337, -536, 363, 516, 517, 705, 1229, 1230, 1231, - 1232, 1226, 1227, 294, -536, -16, -542, 813, 1010, 1233, - 1228, 367, 1010, 1210, 1209, 1211, 295, -153, -153, -153, - 382, 70, 888, 318, 319, 322, 888, 659, 660, -535, - 1206, 814, -153, 279, -153, 435, -153, 279, -153, 436, - 141, 103, 104, 105, 632, 633, 322, 437, 368, 888, - -32766,-32766, 371, 372, 438, 900, 814, 689, 820, -111, - -111, 376, 377, 950, -111, 689, 814, -88, 151, 874, - -111, -111, -111, -111, 31, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 723, 722, - 1206, 153, 154, -535, -535, 155, 898, 900, 157, 689, - 1206, 900, -111, 689, -153, 32, 123, 898, -535, 124, - 140,-32766, -537, 129, 130, 143, 322, 1122, 1124, 158, - -535,-32766, -541, -534, 900,-32766, 689, 159, -534, 723, - 722, 1208, 295, 160, 161, -79, -75, 74,-32766,-32766, - -32766, 322,-32766, -73,-32766, -298,-32766, 74, -294,-32766, - -72, 322, -71, -70,-32766,-32766,-32766, -69, -68, -67, - -32766,-32766, 27, -66, -47, 1215,-32766, 414, -18, 147, - 275, 270, 281, 704, 814,-32766, -537, -537, 1239, 888, - 707, 897, 146, 276, 48, -4, 898, -534, -534, 282, - 888, -537, -534, -534, 283, -246, -246, -246, 329, 285, - 271, 368, -534, -537, 286, 73, 289, -534, 1206, 47, - 723, 722, -111, -111, -534, 290, 109, -111, 914, -534, - 550, 669, 874, -111, -111, -111, -111, 145, 516, 517, - -32766, 1229, 1230, 1231, 1232, 1226, 1227, 814, 805, 1322, - 662, 300, 1092, 1233, 1228, 682, 814,-32766, 298, 299, - 546, 641, 647, 1208, 900, 72, 689, -246, 319, 322, - -32766,-32766,-32766, 366,-32766, 900,-32766, 689,-32766, 888, - 646,-32766, 13, 296, 297, 127,-32766,-32766,-32766, 455, - 1206, -51,-32766,-32766, 483, 630, 663, 556,-32766, 414, - 303, 368, -111, 430, 434, 39, 930,-32766, 293, 0, - 125,-32766, -111, -111, 301, 0, 0, -111, 1010, 307, - 0, 0, 833, -111, -111, -111, -111, 0,-32766, 131, - 0, 0, 295, 0,-32766, 1246, 0, 74, 0, 1248, - 1208, 322, 0, -500, 0, 9, 0,-32766,-32766,-32766, - -490,-32766, 7,-32766, 900,-32766, 689, -4,-32766, 16, - 365, 597, 813,-32766,-32766,-32766, 916, 295, 709,-32766, - -32766, 1240,-32766, 40, 712,-32766, 414, 713, 1208, 879, - 898, 974, 951, 958,-32766,-32766,-32766,-32766, 948,-32766, - 959,-32766, 877,-32766, 946, 1066,-32766, 1069, 1070, 1067, - 1068,-32766,-32766,-32766,-32766, 1074, 33,-32766,-32766, 1236, - 1208, 825, 1261,-32766, 414, 1279, 1313,-32766,-32766,-32766, - 317,-32766,-32766,-32766, 635,-32766, 364, 690,-32766, 693, - 697, 699, 478,-32766,-32766,-32766,-32766, 700, 701,-32766, - -32766, 702, 1208, 562, 706,-32766, 414, 692, -570,-32766, - -32766,-32766, 875,-32766,-32766,-32766, 1317,-32766, 1319, 836, - -32766, 835, 844, 888, 923,-32766,-32766,-32766, 966, 843, - 1318,-32766,-32766, 922, 924, 921, 1194,-32766, 414, -245, - -245, -245, 907, 917, 905, 368,-32766, 956, 957, 1316, - 1273, 1262, 0, 1280, 1286, 1289, -111, -111, -568, 27, - -542, -111, -541, -540, 1, 28, 874, -111, -111, -111, - -111, 814, 29,-32766, 38, 1239, 42, 46, 71, 1208, - 75, 76, 77, 78, 79, 0,-32766,-32766,-32766, 80, - -32766, 142,-32766, 152,-32766, 156, 245,-32766, 900, 324, - 689, -245,-32766,-32766,-32766, 1206, 350, 351,-32766,-32766, - 352, 353, 354, 355,-32766, 414, 356, 357, 358, 359, - 360, 362, 431,-32766, -271, -269, 517, -268, 1229, 1230, - 1231, 1232, 1226, 1227, 18, 19, 20, 21, 23, 401, - 1233, 1228, 474, 475, 482, 485, 486, 487, 488, 492, - 493, 494, 72, -504, 501, 319, 322, 676, 1219, 1162, - 1237, 1036, 1035, 0, 1016, 1198, 1012, -273, -103, 17, - 22, 26, 292, 400, 590, 594, 621, 681, 1166, 1214, - 1163, 1292, 0, 1179, 0, 0, 322 - ); - - protected $actionCheck = array( - 2, 3, 4, 5, 6, 7, 0, 9, 10, 11, - 12, 13, 128, 129, 130, 131, 9, 10, 11, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 116, 117, - 118, 119, 120, 121, 122, 37, 38, 30, 1, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 106, 107, 1, 8, 57, 9, 10, 11, 1, - 31, 116, 14, 9, 10, 11, 106, 107, 8, 71, - 72, 73, 74, 75, 76, 77, 116, 30, 80, 32, - 33, 34, 35, 36, 30, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 70, 80, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 8, 1, 80, 8, 80, 150, 151, - 152, 8, 154, 9, 10, 11, 2, 3, 4, 5, - 6, 7, 164, 9, 10, 11, 12, 13, 9, 10, - 11, 85, 82, 14, 30, 85, 32, 33, 34, 35, - 36, 37, 38, 116, 117, 118, 119, 120, 121, 122, - 161, 37, 38, 9, 10, 11, 134, 135, 161, 9, - 10, 11, 8, 8, 167, 1, 14, 51, 155, 156, - 157, 57, 1, 161, 30, 162, 32, 33, 34, 35, - 30, 156, 32, 33, 34, 71, 72, 73, 74, 75, - 76, 77, 146, 1, 80, 31, 80, 147, 148, 83, - 8, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 84, 1, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 164, - 9, 10, 11, 160, 150, 151, 152, 164, 154, 2, - 3, 4, 5, 6, 7, 1, 9, 10, 11, 12, - 13, 30, 8, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 106, 57, 108, - 9, 10, 11, 53, 54, 55, 164, 57, 164, 164, - 69, 117, 118, 159, 57, 161, 122, 101, 30, 69, - 159, 30, 1, 32, 33, 31, 31, 30, 71, 72, - 73, 74, 75, 76, 77, 97, 106, 80, 108, 123, - 70, 9, 10, 11, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 8, 97, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 160, 8, 134, 135, 164, 150, 151, 152, - 2, 3, 4, 5, 6, 7, 119, 120, 121, 122, - 12, 13, 101, 15, 160, 1, 138, 106, 164, 108, - 1, 161, 9, 10, 113, 138, 138, 116, 117, 118, - 119, 120, 121, 122, 123, 80, 106, 1, 108, 8, - 80, 163, 8, 159, 30, 1, 37, 38, 50, 51, - 163, 163, 116, 70, 56, 8, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 31, 70, 71, - 72, 73, 74, 162, 138, 31, 78, 79, 80, 1, - 82, 75, 76, 1, 86, 87, 88, 89, 8, 91, - 1, 93, 137, 95, 101, 102, 98, 99, 106, 80, - 108, 103, 104, 105, 106, 107, 1, 109, 110, 31, - 155, 156, 157, 115, 116, 1, 156, 134, 135, 8, - 84, 161, 124, 125, 126, 1, 116, 159, 84, 161, - 116, 8, 149, 8, 136, 137, 31, 139, 140, 141, - 142, 143, 144, 145, 161, 31, 163, 155, 138, 151, - 152, 8, 138, 155, 156, 157, 158, 75, 76, 77, - 8, 163, 84, 165, 166, 167, 84, 75, 76, 70, - 116, 82, 90, 163, 92, 8, 94, 163, 96, 8, - 161, 50, 51, 52, 111, 112, 167, 8, 106, 84, - 9, 137, 106, 107, 8, 159, 82, 161, 8, 117, - 118, 106, 107, 159, 122, 161, 82, 31, 14, 127, - 128, 129, 130, 131, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 37, 38, - 116, 14, 14, 134, 135, 14, 1, 159, 14, 161, - 116, 159, 128, 161, 162, 14, 16, 1, 149, 16, - 161, 137, 70, 16, 16, 16, 167, 59, 60, 16, - 161, 137, 163, 70, 159, 74, 161, 16, 70, 37, - 38, 80, 158, 16, 16, 31, 31, 163, 87, 88, - 89, 167, 91, 31, 93, 35, 95, 163, 35, 98, - 31, 167, 31, 31, 103, 104, 105, 31, 31, 31, - 109, 110, 70, 31, 31, 1, 115, 116, 31, 31, - 35, 31, 31, 31, 82, 124, 134, 135, 86, 84, - 31, 31, 31, 35, 70, 0, 1, 134, 135, 35, - 84, 149, 134, 135, 35, 100, 101, 102, 35, 37, - 57, 106, 149, 161, 37, 154, 37, 149, 116, 70, - 37, 38, 117, 118, 161, 37, 69, 122, 38, 161, - 89, 77, 127, 128, 129, 130, 131, 70, 136, 137, - 85, 139, 140, 141, 142, 143, 144, 82, 80, 83, - 94, 132, 82, 151, 152, 92, 82, 74, 134, 135, - 85, 90, 100, 80, 159, 163, 161, 162, 166, 167, - 87, 88, 89, 149, 91, 159, 93, 161, 95, 84, - 96, 98, 97, 134, 135, 161, 103, 104, 105, 97, - 116, 31, 109, 110, 97, 113, 100, 153, 115, 116, - 114, 106, 128, 108, 128, 159, 128, 124, 113, -1, - 161, 137, 117, 118, 133, -1, -1, 122, 138, 132, - -1, -1, 127, 128, 129, 130, 131, -1, 137, 31, - -1, -1, 158, -1, 74, 146, -1, 163, -1, 146, - 80, 167, -1, 149, -1, 150, -1, 87, 88, 89, - 149, 91, 149, 93, 159, 95, 161, 162, 98, 149, - 149, 153, 155, 103, 104, 105, 154, 158, 162, 109, - 110, 166, 74, 159, 159, 115, 116, 159, 80, 159, - 1, 159, 159, 159, 124, 87, 88, 89, 159, 91, - 159, 93, 159, 95, 159, 159, 98, 159, 159, 159, - 159, 103, 104, 105, 74, 159, 161, 109, 110, 160, - 80, 160, 160, 115, 116, 160, 160, 87, 88, 89, - 161, 91, 124, 93, 160, 95, 161, 161, 98, 161, - 161, 161, 102, 103, 104, 105, 74, 161, 161, 109, - 110, 161, 80, 81, 161, 115, 116, 161, 163, 87, - 88, 89, 162, 91, 124, 93, 162, 95, 162, 162, - 98, 162, 162, 84, 162, 103, 104, 105, 162, 162, - 162, 109, 110, 162, 162, 162, 162, 115, 116, 100, - 101, 102, 162, 162, 162, 106, 124, 162, 162, 162, - 162, 162, -1, 162, 162, 162, 117, 118, 163, 70, - 163, 122, 163, 163, 163, 163, 127, 128, 129, 130, - 131, 82, 163, 74, 163, 86, 163, 163, 163, 80, - 163, 163, 163, 163, 163, -1, 87, 88, 89, 163, - 91, 163, 93, 163, 95, 163, 163, 98, 159, 163, - 161, 162, 103, 104, 105, 116, 163, 163, 109, 110, - 163, 163, 163, 163, 115, 116, 163, 163, 163, 163, - 163, 163, 163, 124, 164, 164, 137, 164, 139, 140, - 141, 142, 143, 144, 164, 164, 164, 164, 164, 164, - 151, 152, 164, 164, 164, 164, 164, 164, 164, 164, - 164, 164, 163, 165, 164, 166, 167, 164, 164, 164, - 164, 164, 164, -1, 164, 164, 164, 164, 164, 164, - 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, - 164, 164, -1, 165, -1, -1, 167 - ); - - protected $actionBase = array( - 0, -2, 154, 542, 785, 695, 969, 549, 53, 420, - 831, 307, 307, 67, 307, 307, 307, 496, 538, 538, - 565, 538, 204, 504, 706, 706, 706, 651, 651, 651, - 651, 773, 773, 920, 920, 952, 888, 850, 1029, 1029, - 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, - 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, - 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, - 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, - 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, - 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, - 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, - 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, - 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, - 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, - 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, - 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, - 1029, 1029, 211, 344, 288, 691, 1038, 1044, 1040, 1045, - 1036, 1035, 1039, 1041, 1046, 917, 918, 751, 919, 921, - 922, 923, 1042, 854, 1037, 1043, 291, 291, 291, 291, - 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, - 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, - 291, 291, 641, 159, 473, 382, 382, 382, 382, 382, - 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, - 382, 382, 382, 382, 382, 54, 54, 54, 341, 692, - 692, 190, 184, 658, 47, 1019, 1019, 1019, 1019, 1019, - 1019, 1019, 1019, 1019, 1019, 144, 144, 7, 7, 7, - 7, 7, 371, -25, -25, -25, -25, 574, 347, 764, - 474, 584, 266, 241, 338, 470, 470, 591, 591, 396, - -116, 396, 348, 348, 396, 396, 396, 770, 770, 770, - 770, 443, 559, 452, 86, 514, 479, 479, 479, 479, - 514, 514, 514, 514, 783, 795, 514, 514, 514, 642, - 653, 653, 714, 300, 300, 300, 653, 390, 765, 90, - 390, 90, 37, 156, 781, -55, -40, 292, 768, 781, - 320, 739, 314, 143, 797, 546, 797, 1034, 745, 733, - 705, 836, 876, 1047, 752, 915, 786, 916, 62, 704, - 1033, 1033, 1033, 1033, 1033, 1033, 1033, 1033, 1033, 1033, - 1033, 1049, 469, 1034, 65, 1049, 1049, 1049, 469, 469, - 469, 469, 469, 469, 469, 469, 469, 469, 533, 65, - 466, 552, 65, 763, 469, 211, 791, 211, 211, 211, - 211, 973, 211, 211, 211, 211, 211, 211, 980, 737, - 29, 211, 344, 52, 52, 428, 58, 52, 52, 52, - 52, 211, 211, 211, 546, 743, 734, 555, 798, 195, - 743, 743, 743, 345, 135, 192, 194, 710, 713, 280, - 758, 758, 760, 931, 931, 758, 755, 758, 760, 944, - 758, 931, 799, 433, 627, 571, 603, 631, 931, 494, - 758, 758, 758, 758, 639, 758, 491, 445, 758, 758, - 709, 741, 777, 46, 931, 931, 931, 777, 585, 771, - 771, 771, 805, 808, 772, 740, 540, 507, 650, 138, - 780, 740, 740, 758, 612, 772, 740, 772, 740, 802, - 740, 740, 740, 772, 740, 755, 583, 740, 703, 646, - 60, 740, 6, 945, 947, 636, 948, 941, 949, 989, - 950, 951, 856, 963, 943, 956, 939, 932, 750, 690, - 693, 793, 784, 930, 747, 747, 747, 927, 747, 747, - 747, 747, 747, 747, 747, 747, 690, 839, 801, 766, - 731, 974, 697, 698, 779, 880, 1018, 1048, 973, 1024, - 958, 736, 699, 1004, 977, 796, 849, 978, 979, 1005, - 1025, 1026, 884, 757, 886, 887, 841, 983, 858, 747, - 945, 951, 943, 956, 939, 932, 732, 728, 726, 727, - 722, 721, 712, 719, 738, 1027, 925, 875, 842, 980, - 929, 690, 845, 1000, 835, 1008, 1009, 855, 782, 756, - 846, 889, 984, 985, 986, 859, 1028, 804, 1001, 990, - 1010, 787, 890, 1011, 1012, 1013, 1014, 892, 860, 866, - 867, 810, 761, 991, 774, 896, 48, 754, 759, 778, - 988, 654, 966, 870, 897, 898, 1015, 1016, 1017, 901, - 960, 812, 1002, 746, 1003, 993, 813, 814, 677, 769, - 1030, 735, 748, 767, 678, 681, 902, 903, 904, 962, - 742, 744, 819, 821, 1031, 762, 1032, 910, 684, 823, - 711, 911, 1023, 717, 718, 753, 873, 800, 776, 775, - 987, 749, 825, 912, 826, 828, 829, 1020, 830, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 458, 458, - 458, 458, 458, 458, 307, 307, 307, 307, 0, 0, - 307, 0, 0, 0, 458, 458, 458, 458, 458, 458, - 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, - 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, - 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, - 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, - 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, - 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, - 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, - 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, - 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, - 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, - 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, - 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, - 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, - 458, 458, 458, 458, 458, 458, 458, 458, 458, 291, - 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, - 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, - 291, 291, 291, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 291, - 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, - 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, - 291, 291, 291, 291, 291, 291, 415, 415, 291, 291, - 0, 291, 415, 415, 415, 415, 415, 415, 415, 415, - 415, 415, 291, 291, 291, 291, 291, 291, 291, 799, - 300, 300, 300, 300, 415, 415, 415, 415, 415, -88, - -88, 415, 415, 415, 300, 300, 415, 244, 415, 415, - 415, 415, 415, 415, 415, 415, 415, 415, 0, 0, - 65, 90, 415, 755, 755, 755, 755, 415, 415, 415, - 415, 90, 90, 415, 415, 415, 0, 0, 0, 0, - 0, 0, 0, 0, 65, 90, 0, 65, 0, 755, - 755, 415, 799, 799, 232, 244, 415, 0, 0, 0, - 0, 65, 755, 65, 469, 90, 469, 469, 52, 211, - 232, 453, 453, 453, 453, 0, 546, 799, 799, 799, - 799, 799, 799, 799, 799, 799, 799, 799, 755, 0, - 799, 0, 755, 755, 755, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 755, 0, 0, 931, 0, 0, 0, 0, 758, 0, - 0, 0, 0, 0, 0, 758, 944, 0, 0, 0, - 0, 0, 0, 755, 0, 0, 0, 0, 0, 0, - 0, 0, 747, 782, 0, 782, 0, 747, 747, 747, - 0, 0, 0, 0, 769, 762 - ); - - protected $actionDefault = array( - 3,32767, 103,32767,32767,32767,32767,32767,32767,32767, - 32767,32767, 101,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767, 588, 588, 588, - 588,32767,32767, 250, 103,32767,32767, 464, 382, 382, - 382,32767,32767, 532, 532, 532, 532, 532, 532,32767, - 32767,32767,32767,32767,32767, 464,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767, 101,32767, - 32767,32767, 37, 7, 8, 10, 11, 50, 17, 320, - 32767,32767,32767,32767, 103,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767, 581,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767, 468, 447, 448, 450, - 451, 381, 533, 587, 323, 584, 380, 146, 335, 325, - 238, 326, 254, 469, 255, 470, 473, 474, 211, 283, - 377, 150, 411, 465, 413, 463, 467, 412, 387, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 385, 386, 466, 444, 443, 442, 409,32767, - 32767, 410, 414, 384, 417,32767,32767,32767,32767,32767, - 32767,32767,32767, 103,32767, 415, 416, 433, 434, 431, - 432, 435,32767, 436, 437, 438, 439,32767, 312,32767, - 32767,32767, 361, 359, 312,32767,32767, 424, 425,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767, 526, 441,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767, 103,32767, 101, 528, - 406, 408, 496, 419, 420, 418, 388,32767, 503,32767, - 103, 505,32767,32767,32767, 112,32767,32767,32767,32767, - 527,32767, 534, 534,32767, 489, 101, 194,32767, 194, - 194,32767,32767,32767,32767,32767,32767,32767, 595, 489, - 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, - 111,32767, 194, 111,32767,32767,32767, 101, 194, 194, - 194, 194, 194, 194, 194, 194, 194, 194, 189,32767, - 264, 266, 103, 549, 194,32767, 508,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767, 501, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767, 489, 429, 139,32767, 139, 534, - 421, 422, 423, 491, 534, 534, 534, 308, 285,32767, - 32767,32767,32767, 506, 506, 101, 101, 101, 101, 501, - 32767,32767, 112, 100, 100, 100, 100, 100, 104, 102, - 32767,32767,32767,32767, 100,32767, 102, 102,32767,32767, - 221, 208, 219, 102,32767, 553, 554, 219, 102, 223, - 223, 223, 243, 243, 480, 314, 102, 100, 102, 102, - 196, 314, 314,32767, 102, 480, 314, 480, 314, 198, - 314, 314, 314, 480, 314,32767, 102, 314, 210, 100, - 100, 314,32767,32767,32767, 491,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 521,32767, 538, 551, 427, 428, 430, 536, 452, 453, - 454, 455, 456, 457, 458, 460, 583,32767, 495,32767, - 32767,32767,32767, 334, 593,32767, 593,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767, 594,32767, 534,32767,32767,32767,32767, 426, - 9, 76, 43, 44, 52, 58, 512, 513, 514, 515, - 509, 510, 516, 511,32767,32767, 517, 559,32767,32767, - 535, 586,32767,32767,32767,32767,32767,32767, 139,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767, 521, - 32767, 137,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767, 534,32767,32767,32767,32767, 310, 307, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767, 534,32767,32767,32767,32767, - 32767, 287,32767, 304,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 282,32767,32767, 376,32767,32767,32767,32767, 355,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767, 152, - 152, 3, 3, 337, 152, 152, 152, 337, 152, 337, - 337, 337, 152, 152, 152, 152, 152, 152, 276, 184, - 258, 261, 243, 243, 152, 347, 152 - ); - - protected $goto = array( - 194, 194, 677, 466, 1281, 1282, 345, 428, 325, 325, - 325, 325, 536, 536, 536, 536, 665, 591, 926, 1039, - 685, 1003, 1019, 1020, 1080, 1081, 165, 165, 165, 165, - 218, 195, 191, 191, 175, 177, 213, 191, 191, 191, - 191, 191, 192, 192, 192, 192, 192, 192, 186, 187, - 188, 189, 190, 215, 213, 216, 524, 525, 415, 526, - 528, 529, 530, 531, 532, 533, 534, 535, 1108, 166, - 167, 168, 193, 169, 170, 171, 164, 172, 173, 174, - 176, 212, 214, 217, 235, 238, 241, 242, 244, 255, - 256, 257, 258, 259, 260, 261, 263, 264, 265, 266, - 277, 278, 313, 314, 315, 420, 421, 422, 569, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 178, 234, 179, 196, 197, 198, - 236, 186, 187, 188, 189, 190, 215, 1108, 199, 180, - 181, 182, 200, 196, 183, 237, 201, 199, 163, 202, - 203, 184, 204, 205, 206, 185, 207, 208, 209, 210, - 211, 834, 587, 425, 645, 548, 541, 830, 831, 419, - 310, 311, 332, 564, 316, 424, 333, 426, 623, 832, - 973, 947, 947, 945, 947, 710, 808, 540, 982, 977, - 827, 827, 607, 642, 391, 541, 548, 557, 558, 398, - 567, 589, 603, 604, 839, 865, 887, 882, 883, 896, - 15, 840, 884, 837, 885, 886, 838, 457, 457, 639, - 890, 656, 657, 658, 987, 987, 457, 609, 609, 806, - 1060, 1056, 1057, 1238, 1238, 1238, 1238, 1238, 1238, 1238, - 1238, 1238, 1238, 1256, 1256, 346, 347, 812, 949, 1256, - 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1014, - 1013, 1207, 1008, 1207, 1008, 1207, 561, 442, 1008, 1008, - 1008, 343, 442, 1008, 442, 1008, 1008, 1008, 1008, 1008, - 1008, 1008, 1008, 1008, 1008, 251, 251, 1296, 812, 1207, - 812, 1307, 1307, 970, 1207, 1207, 1207, 1207, 1017, 1018, - 1207, 1207, 1207, 1288, 1288, 1288, 1288, 827, 1307, 321, - 305, 248, 248, 248, 248, 250, 252, 387, 903, 1254, - 1254, 619, 620, 904, 1203, 1254, 1254, 1254, 1254, 1254, - 1254, 1254, 1254, 1254, 1254, 527, 527, 280, 280, 280, - 280, 527, 527, 527, 527, 527, 527, 527, 527, 527, - 527, 941, 405, 684, 560, 442, 442, 442, 442, 442, - 442, 442, 442, 442, 442, 442, 348, 644, 442, 389, - 393, 549, 588, 592, 847, 1157, 348, 348, 538, 1204, - 538, 891, 538, 892, 432, 418, 822, 598, 666, 859, - 348, 348, 846, 348, 5, 1323, 6, 824, 554, 1283, - 1284, 650, 1205, 1264, 1265, 602, 448, 543, 565, 601, - 348, 943, 943, 943, 943, 334, 932, 448, 937, 944, - 403, 404, 1278, 852, 1278, 654, 1278, 655, 397, 407, - 408, 409, 1200, 668, 849, 1045, 410, 542, 552, 992, - 341, 490, 542, 491, 552, 714, 467, 390, 861, 497, - 1049, 1290, 1290, 1290, 1290, 1267, 954, 568, 460, 461, - 462, 1091, 857, 471, 0, 1314, 1315, 555, 0, 0, - 0, 711, 622, 624, 0, 643, 0, 1274, 670, 667, - 671, 984, 675, 683, 980, 0, 0, 0, 0, 0, - 855, 596, 610, 613, 614, 615, 616, 636, 637, 638, - 687, 860, 848, 1044, 1048, 908, 1096, 0, 543, 0, - 0, 952, 606, 1306, 1306, 0, 1047, 989, 0, 0, - 1276, 1276, 1047, 254, 254, 851, 0, 648, 968, 427, - 1306, 0, 0, 845, 942, 427, 0, 0, 0, 0, - 0, 0, 0, 1015, 1015, 1199, 0, 1309, 649, 1026, - 1022, 1023, 0, 0, 0, 0, 1089, 864, 0, 0, - 0, 586, 1073, 0, 688, 674, 674, 1202, 498, 680, - 1071, 1188, 919, 0, 0, 1189, 1192, 920, 1193, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 272, 0, 0, 0, - 0, 539, 0, 539 - ); - - protected $gotoCheck = array( - 42, 42, 72, 172, 172, 172, 95, 87, 23, 23, - 23, 23, 105, 105, 105, 105, 87, 105, 87, 125, - 9, 87, 87, 87, 142, 142, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 15, 128, 65, 65, 75, 75, 25, 26, 65, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 27, - 25, 25, 25, 25, 25, 25, 7, 25, 25, 25, - 22, 22, 55, 55, 75, 75, 75, 75, 75, 75, - 75, 75, 75, 75, 15, 45, 15, 15, 15, 15, - 75, 15, 15, 15, 15, 15, 15, 147, 147, 84, - 15, 84, 84, 84, 105, 105, 147, 106, 106, 6, - 15, 15, 15, 106, 106, 106, 106, 106, 106, 106, - 106, 106, 106, 166, 166, 95, 95, 12, 49, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 116, - 116, 72, 72, 72, 72, 72, 168, 23, 72, 72, - 72, 175, 23, 72, 23, 72, 72, 72, 72, 72, - 72, 72, 72, 72, 72, 5, 5, 177, 12, 72, - 12, 179, 179, 101, 72, 72, 72, 72, 117, 117, - 72, 72, 72, 9, 9, 9, 9, 22, 179, 165, - 165, 5, 5, 5, 5, 5, 5, 61, 72, 167, - 167, 83, 83, 72, 20, 167, 167, 167, 167, 167, - 167, 167, 167, 167, 167, 169, 169, 24, 24, 24, - 24, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 91, 91, 91, 102, 23, 23, 23, 23, 23, - 23, 23, 23, 23, 23, 23, 14, 63, 23, 58, - 58, 58, 58, 58, 35, 149, 14, 14, 19, 20, - 19, 64, 19, 64, 111, 13, 20, 13, 114, 35, - 14, 14, 35, 14, 46, 14, 46, 18, 9, 174, - 174, 118, 20, 20, 20, 9, 19, 14, 2, 2, - 14, 19, 19, 19, 19, 29, 90, 19, 19, 19, - 80, 80, 128, 39, 128, 80, 128, 80, 28, 80, - 80, 80, 158, 80, 37, 127, 80, 9, 9, 108, - 80, 153, 9, 153, 9, 97, 155, 9, 41, 153, - 130, 128, 128, 128, 128, 14, 94, 9, 9, 9, - 9, 145, 9, 82, -1, 9, 9, 48, -1, -1, - -1, 48, 48, 48, -1, 48, -1, 128, 14, 48, - 48, 48, 48, 48, 48, -1, -1, -1, -1, -1, - 9, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 79, 16, 16, 16, 16, 17, 17, -1, 14, -1, - -1, 16, 17, 178, 178, -1, 128, 17, -1, -1, - 128, 128, 128, 5, 5, 17, -1, 17, 17, 115, - 178, -1, -1, 17, 16, 115, -1, -1, -1, -1, - -1, -1, -1, 115, 115, 17, -1, 178, 115, 115, - 115, 115, -1, -1, -1, -1, 16, 16, -1, -1, - -1, 8, 8, -1, 8, 8, 8, 14, 8, 8, - 8, 78, 78, -1, -1, 78, 78, 78, 78, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 24, -1, -1, -1, - -1, 24, -1, 24 - ); - - protected $gotoBase = array( - 0, 0, -283, 0, 0, 284, 216, 177, 554, 7, - 0, 0, -46, 51, 72, -181, 57, 49, 91, 111, - -62, 0, -135, 5, 334, 163, 164, 175, 94, 122, - 0, 0, 0, 0, 0, 10, 0, 98, 0, 103, - 0, 13, -1, 0, 0, 193, -320, 0, -223, 225, - 0, 0, 0, 0, 0, 153, 0, 0, 325, 0, - 0, 276, 0, 127, 362, -76, 0, 0, 0, 0, - 0, 0, -6, 0, 0, -174, 0, 0, 168, 140, - -61, 0, -4, -149, -478, 0, 0, -263, 0, 0, - 88, 50, 0, 0, 19, -467, 0, 43, 0, 0, - 0, 259, 312, 0, 0, -15, -12, 0, 76, 0, - 0, 110, 0, 0, 109, 261, -16, 16, 114, 0, - 0, 0, 0, 0, 0, 17, 0, 68, 155, 0, - 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, -248, 0, 0, 23, 0, 184, 0, 104, - 0, 0, 0, -44, 0, 12, 0, 0, 70, 0, - 0, 0, 0, 0, 0, -9, 4, 80, 238, 96, - 0, 0, -294, 0, 34, 242, 0, 257, 209, -13, - 0, 0 - ); - - protected $gotoDefault = array( - -32768, 502, 718, 4, 719, 912, 795, 804, 584, 518, - 686, 342, 611, 416, 1272, 889, 1095, 566, 823, 1216, - 1224, 449, 826, 326, 708, 871, 872, 873, 394, 379, - 385, 392, 634, 612, 484, 858, 445, 850, 476, 853, - 444, 862, 162, 413, 500, 866, 3, 868, 545, 899, - 380, 876, 381, 661, 878, 551, 880, 881, 388, 395, - 396, 1100, 559, 608, 893, 243, 553, 894, 378, 895, - 902, 383, 386, 672, 456, 495, 489, 406, 1075, 595, - 631, 453, 470, 618, 617, 605, 469, 1011, 411, 328, - 931, 939, 477, 454, 953, 344, 961, 716, 1107, 625, - 479, 969, 626, 976, 979, 519, 520, 468, 991, 268, - 994, 480, 1032, 651, 1005, 1006, 652, 627, 1028, 628, - 653, 629, 1030, 463, 585, 1038, 446, 1046, 1260, 447, - 1050, 262, 1053, 274, 412, 429, 1058, 1059, 8, 1065, - 678, 679, 10, 273, 499, 1090, 673, 443, 1106, 433, - 1176, 1178, 547, 481, 1196, 1195, 664, 496, 1201, 1263, - 441, 521, 464, 312, 522, 304, 330, 309, 537, 291, - 331, 523, 465, 1269, 1277, 327, 30, 1297, 1308, 338, - 563, 600 - ); - - protected $ruleToNonTerminal = array( - 0, 1, 3, 3, 2, 5, 5, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, - 7, 7, 7, 7, 7, 7, 8, 8, 9, 10, - 11, 11, 11, 12, 12, 13, 13, 14, 15, 15, - 16, 16, 17, 17, 18, 18, 21, 21, 22, 23, - 23, 24, 24, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 29, 29, 30, 30, 32, 34, - 34, 28, 36, 36, 33, 38, 38, 35, 35, 37, - 37, 39, 39, 31, 40, 40, 41, 43, 44, 44, - 45, 46, 46, 48, 47, 47, 47, 47, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 25, 25, 68, 68, 71, 71, 70, 69, - 69, 62, 74, 74, 75, 75, 76, 76, 77, 77, - 78, 78, 26, 26, 27, 27, 27, 27, 86, 86, - 88, 88, 81, 81, 89, 89, 90, 90, 90, 82, - 82, 85, 85, 83, 83, 91, 92, 92, 56, 56, - 64, 64, 67, 67, 67, 66, 93, 93, 94, 57, - 57, 57, 57, 95, 95, 96, 96, 97, 97, 98, - 99, 99, 100, 100, 101, 101, 54, 54, 50, 50, - 103, 52, 52, 104, 51, 51, 53, 53, 63, 63, - 63, 63, 79, 79, 107, 107, 109, 109, 110, 110, - 110, 110, 108, 108, 108, 112, 112, 112, 112, 87, - 87, 115, 115, 115, 116, 116, 113, 113, 117, 117, - 119, 119, 120, 120, 114, 121, 121, 118, 122, 122, - 122, 122, 111, 111, 80, 80, 80, 20, 20, 20, - 124, 123, 123, 125, 125, 125, 125, 59, 126, 126, - 127, 60, 129, 129, 130, 130, 131, 131, 84, 132, - 132, 132, 132, 132, 132, 137, 137, 138, 138, 139, - 139, 139, 139, 139, 140, 141, 141, 136, 136, 133, - 133, 135, 135, 143, 143, 142, 142, 142, 142, 142, - 142, 142, 134, 144, 144, 146, 145, 145, 61, 102, - 147, 147, 55, 55, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 154, 148, 148, - 153, 153, 156, 157, 157, 158, 159, 159, 159, 19, - 19, 72, 72, 72, 72, 149, 149, 149, 149, 161, - 161, 150, 150, 152, 152, 152, 155, 155, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 167, 167, 106, - 169, 169, 169, 169, 151, 151, 151, 151, 151, 151, - 151, 151, 58, 58, 164, 164, 164, 164, 170, 170, - 160, 160, 160, 171, 171, 171, 171, 171, 171, 73, - 73, 65, 65, 65, 65, 128, 128, 128, 128, 174, - 173, 163, 163, 163, 163, 163, 163, 163, 162, 162, - 162, 172, 172, 172, 172, 105, 168, 176, 176, 175, - 175, 177, 177, 177, 177, 177, 177, 177, 177, 165, - 165, 165, 165, 179, 180, 178, 178, 178, 178, 178, - 178, 178, 178, 181, 181, 181, 181 - ); - - protected $ruleToLength = array( - 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0, 1, 0, 1, 1, 2, 1, 3, 4, 1, - 2, 0, 1, 1, 1, 1, 1, 3, 5, 4, - 3, 4, 2, 3, 1, 1, 7, 6, 2, 3, - 1, 2, 3, 1, 2, 3, 1, 1, 3, 1, - 3, 1, 2, 2, 3, 1, 3, 2, 3, 1, - 3, 2, 0, 1, 1, 1, 1, 1, 3, 7, - 10, 5, 7, 9, 5, 3, 3, 3, 3, 3, - 3, 1, 2, 5, 7, 9, 6, 5, 6, 3, - 2, 1, 1, 1, 0, 2, 1, 3, 8, 0, - 4, 2, 1, 3, 0, 1, 0, 1, 0, 1, - 3, 1, 8, 9, 8, 7, 6, 8, 0, 2, - 0, 2, 1, 2, 1, 2, 1, 1, 1, 0, - 2, 0, 2, 0, 2, 2, 1, 3, 1, 4, - 1, 4, 1, 1, 4, 2, 1, 3, 3, 3, - 4, 4, 5, 0, 2, 4, 3, 1, 1, 7, - 0, 2, 1, 3, 3, 4, 1, 4, 0, 2, - 5, 0, 2, 6, 0, 2, 0, 3, 1, 2, - 1, 1, 2, 0, 1, 3, 0, 2, 1, 1, - 1, 1, 6, 8, 6, 1, 2, 1, 1, 1, - 1, 1, 1, 1, 1, 3, 3, 3, 1, 3, - 3, 3, 3, 3, 1, 3, 3, 1, 1, 2, - 1, 1, 0, 1, 0, 2, 2, 2, 4, 3, - 1, 1, 3, 1, 2, 2, 3, 2, 3, 1, - 1, 2, 3, 1, 1, 3, 2, 0, 1, 5, - 5, 10, 3, 5, 1, 1, 3, 0, 2, 4, - 5, 4, 4, 4, 3, 1, 1, 1, 1, 1, - 1, 0, 1, 1, 2, 1, 1, 1, 1, 1, - 1, 1, 2, 1, 3, 1, 1, 3, 2, 2, - 3, 1, 0, 1, 1, 3, 3, 3, 4, 1, - 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 2, 2, 2, 2, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, - 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 5, 4, 3, 4, 4, 2, 2, 4, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 1, 3, 2, 1, 2, 4, 2, 2, 8, - 9, 8, 9, 9, 10, 9, 10, 8, 3, 2, - 0, 4, 2, 1, 3, 2, 2, 2, 4, 1, - 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, - 1, 0, 3, 0, 1, 1, 0, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, - 4, 1, 1, 3, 1, 1, 1, 1, 1, 3, - 2, 3, 0, 1, 1, 3, 1, 1, 1, 1, - 1, 3, 1, 1, 4, 4, 1, 4, 4, 0, - 1, 1, 1, 3, 3, 1, 4, 2, 2, 1, - 3, 1, 4, 4, 3, 3, 3, 3, 1, 3, - 1, 1, 3, 1, 1, 4, 1, 1, 1, 3, - 1, 1, 2, 1, 3, 4, 3, 2, 0, 2, - 2, 1, 2, 1, 1, 1, 4, 3, 3, 3, - 3, 6, 3, 1, 1, 2, 1 - ); - - protected function initReduceCallbacks() { - $this->reduceCallbacks = [ - 0 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 1 => function ($stackPos) { - $this->semValue = $this->handleNamespaces($this->semStack[$stackPos-(1-1)]); - }, - 2 => function ($stackPos) { - if (is_array($this->semStack[$stackPos-(2-2)])) { $this->semValue = array_merge($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); } else { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }; - }, - 3 => function ($stackPos) { - $this->semValue = array(); - }, - 4 => function ($stackPos) { - $startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; }; - if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 5 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 6 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 7 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 8 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 9 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 10 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 11 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 12 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 13 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 14 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 15 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 16 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 17 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 18 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 19 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 20 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 21 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 22 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 23 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 24 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 25 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 26 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 27 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 28 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 29 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 30 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 31 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 32 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 33 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 34 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 35 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 36 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 37 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 38 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 39 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 40 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 41 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 42 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 43 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 44 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 45 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 46 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 47 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 48 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 49 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 50 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 51 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 52 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 53 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 54 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 55 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 56 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 57 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 58 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 59 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 60 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 61 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 62 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 63 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 64 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 65 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 66 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 67 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 68 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 69 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 70 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 71 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 72 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 73 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 74 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 75 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 76 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 77 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 78 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 79 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 80 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 81 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 82 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 83 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 84 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 85 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 86 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 87 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 88 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 89 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 90 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 91 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 92 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 93 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 94 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 95 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 96 => function ($stackPos) { - $this->semValue = new Name(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 97 => function ($stackPos) { - $this->semValue = new Expr\Variable(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 98 => function ($stackPos) { - /* nothing */ - }, - 99 => function ($stackPos) { - /* nothing */ - }, - 100 => function ($stackPos) { - /* nothing */ - }, - 101 => function ($stackPos) { - $this->emitError(new Error('A trailing comma is not allowed here', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes)); - }, - 102 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 103 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 104 => function ($stackPos) { - $this->semValue = new Node\Attribute($this->semStack[$stackPos-(1-1)], [], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 105 => function ($stackPos) { - $this->semValue = new Node\Attribute($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 106 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 107 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 108 => function ($stackPos) { - $this->semValue = new Node\AttributeGroup($this->semStack[$stackPos-(4-2)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 109 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 110 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 111 => function ($stackPos) { - $this->semValue = []; - }, - 112 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 113 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 114 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 115 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 116 => function ($stackPos) { - $this->semValue = new Stmt\HaltCompiler($this->lexer->handleHaltCompiler(), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 117 => function ($stackPos) { - $this->semValue = new Stmt\Namespace_($this->semStack[$stackPos-(3-2)], null, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_SEMICOLON); - $this->checkNamespace($this->semValue); - }, - 118 => function ($stackPos) { - $this->semValue = new Stmt\Namespace_($this->semStack[$stackPos-(5-2)], $this->semStack[$stackPos-(5-4)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); - $this->checkNamespace($this->semValue); - }, - 119 => function ($stackPos) { - $this->semValue = new Stmt\Namespace_(null, $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); - $this->checkNamespace($this->semValue); - }, - 120 => function ($stackPos) { - $this->semValue = new Stmt\Use_($this->semStack[$stackPos-(3-2)], Stmt\Use_::TYPE_NORMAL, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 121 => function ($stackPos) { - $this->semValue = new Stmt\Use_($this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-2)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 122 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 123 => function ($stackPos) { - $this->semValue = new Stmt\Const_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 124 => function ($stackPos) { - $this->semValue = Stmt\Use_::TYPE_FUNCTION; - }, - 125 => function ($stackPos) { - $this->semValue = Stmt\Use_::TYPE_CONSTANT; - }, - 126 => function ($stackPos) { - $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-6)], $this->semStack[$stackPos-(7-2)], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); - }, - 127 => function ($stackPos) { - $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-5)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); - }, - 128 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 129 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 130 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 131 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 132 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 133 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 134 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 135 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 136 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 137 => function ($stackPos) { - $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(1-1)], null, Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(1-1)); - }, - 138 => function ($stackPos) { - $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(3-3)); - }, - 139 => function ($stackPos) { - $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(1-1)], null, Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(1-1)); - }, - 140 => function ($stackPos) { - $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(3-3)); - }, - 141 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; $this->semValue->type = Stmt\Use_::TYPE_NORMAL; - }, - 142 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; $this->semValue->type = $this->semStack[$stackPos-(2-1)]; - }, - 143 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 144 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 145 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 146 => function ($stackPos) { - $this->semValue = new Node\Const_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 147 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 148 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 149 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 150 => function ($stackPos) { - $this->semValue = new Node\Const_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 151 => function ($stackPos) { - if (is_array($this->semStack[$stackPos-(2-2)])) { $this->semValue = array_merge($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); } else { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }; - }, - 152 => function ($stackPos) { - $this->semValue = array(); - }, - 153 => function ($stackPos) { - $startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; }; - if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 154 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 155 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 156 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 157 => function ($stackPos) { - throw new Error('__HALT_COMPILER() can only be used from the outermost scope', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 158 => function ($stackPos) { - - if ($this->semStack[$stackPos-(3-2)]) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; $attrs = $this->startAttributeStack[$stackPos-(3-1)]; $stmts = $this->semValue; if (!empty($attrs['comments'])) {$stmts[0]->setAttribute('comments', array_merge($attrs['comments'], $stmts[0]->getAttribute('comments', []))); }; - } else { - $startAttributes = $this->startAttributeStack[$stackPos-(3-1)]; if (isset($startAttributes['comments'])) { $this->semValue = new Stmt\Nop($startAttributes + $this->endAttributes); } else { $this->semValue = null; }; - if (null === $this->semValue) { $this->semValue = array(); } - } - - }, - 159 => function ($stackPos) { - $this->semValue = new Stmt\If_($this->semStack[$stackPos-(7-3)], ['stmts' => is_array($this->semStack[$stackPos-(7-5)]) ? $this->semStack[$stackPos-(7-5)] : array($this->semStack[$stackPos-(7-5)]), 'elseifs' => $this->semStack[$stackPos-(7-6)], 'else' => $this->semStack[$stackPos-(7-7)]], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); - }, - 160 => function ($stackPos) { - $this->semValue = new Stmt\If_($this->semStack[$stackPos-(10-3)], ['stmts' => $this->semStack[$stackPos-(10-6)], 'elseifs' => $this->semStack[$stackPos-(10-7)], 'else' => $this->semStack[$stackPos-(10-8)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); - }, - 161 => function ($stackPos) { - $this->semValue = new Stmt\While_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 162 => function ($stackPos) { - $this->semValue = new Stmt\Do_($this->semStack[$stackPos-(7-5)], is_array($this->semStack[$stackPos-(7-2)]) ? $this->semStack[$stackPos-(7-2)] : array($this->semStack[$stackPos-(7-2)]), $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); - }, - 163 => function ($stackPos) { - $this->semValue = new Stmt\For_(['init' => $this->semStack[$stackPos-(9-3)], 'cond' => $this->semStack[$stackPos-(9-5)], 'loop' => $this->semStack[$stackPos-(9-7)], 'stmts' => $this->semStack[$stackPos-(9-9)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); - }, - 164 => function ($stackPos) { - $this->semValue = new Stmt\Switch_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 165 => function ($stackPos) { - $this->semValue = new Stmt\Break_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 166 => function ($stackPos) { - $this->semValue = new Stmt\Continue_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 167 => function ($stackPos) { - $this->semValue = new Stmt\Return_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 168 => function ($stackPos) { - $this->semValue = new Stmt\Global_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 169 => function ($stackPos) { - $this->semValue = new Stmt\Static_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 170 => function ($stackPos) { - $this->semValue = new Stmt\Echo_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 171 => function ($stackPos) { - $this->semValue = new Stmt\InlineHTML($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 172 => function ($stackPos) { - - $e = $this->semStack[$stackPos-(2-1)]; - if ($e instanceof Expr\Throw_) { - // For backwards-compatibility reasons, convert throw in statement position into - // Stmt\Throw_ rather than Stmt\Expression(Expr\Throw_). - $this->semValue = new Stmt\Throw_($e->expr, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - } else { - $this->semValue = new Stmt\Expression($e, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - } - - }, - 173 => function ($stackPos) { - $this->semValue = new Stmt\Unset_($this->semStack[$stackPos-(5-3)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 174 => function ($stackPos) { - $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-5)][0], ['keyVar' => null, 'byRef' => $this->semStack[$stackPos-(7-5)][1], 'stmts' => $this->semStack[$stackPos-(7-7)]], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); - }, - 175 => function ($stackPos) { - $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(9-3)], $this->semStack[$stackPos-(9-7)][0], ['keyVar' => $this->semStack[$stackPos-(9-5)], 'byRef' => $this->semStack[$stackPos-(9-7)][1], 'stmts' => $this->semStack[$stackPos-(9-9)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); - }, - 176 => function ($stackPos) { - $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(6-3)], new Expr\Error($this->startAttributeStack[$stackPos-(6-4)] + $this->endAttributeStack[$stackPos-(6-4)]), ['stmts' => $this->semStack[$stackPos-(6-6)]], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); - }, - 177 => function ($stackPos) { - $this->semValue = new Stmt\Declare_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 178 => function ($stackPos) { - $this->semValue = new Stmt\TryCatch($this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-5)], $this->semStack[$stackPos-(6-6)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); $this->checkTryCatch($this->semValue); - }, - 179 => function ($stackPos) { - $this->semValue = new Stmt\Goto_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 180 => function ($stackPos) { - $this->semValue = new Stmt\Label($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 181 => function ($stackPos) { - $this->semValue = array(); /* means: no statement */ - }, - 182 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 183 => function ($stackPos) { - $startAttributes = $this->startAttributeStack[$stackPos-(1-1)]; if (isset($startAttributes['comments'])) { $this->semValue = new Stmt\Nop($startAttributes + $this->endAttributes); } else { $this->semValue = null; }; - if ($this->semValue === null) $this->semValue = array(); /* means: no statement */ - }, - 184 => function ($stackPos) { - $this->semValue = array(); - }, - 185 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 186 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 187 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 188 => function ($stackPos) { - $this->semValue = new Stmt\Catch_($this->semStack[$stackPos-(8-3)], $this->semStack[$stackPos-(8-4)], $this->semStack[$stackPos-(8-7)], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); - }, - 189 => function ($stackPos) { - $this->semValue = null; - }, - 190 => function ($stackPos) { - $this->semValue = new Stmt\Finally_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 191 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 192 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 193 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 194 => function ($stackPos) { - $this->semValue = false; - }, - 195 => function ($stackPos) { - $this->semValue = true; - }, - 196 => function ($stackPos) { - $this->semValue = false; - }, - 197 => function ($stackPos) { - $this->semValue = true; - }, - 198 => function ($stackPos) { - $this->semValue = false; - }, - 199 => function ($stackPos) { - $this->semValue = true; - }, - 200 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 201 => function ($stackPos) { - $this->semValue = []; - }, - 202 => function ($stackPos) { - $this->semValue = new Stmt\Function_($this->semStack[$stackPos-(8-3)], ['byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-5)], 'returnType' => $this->semStack[$stackPos-(8-7)], 'stmts' => $this->semStack[$stackPos-(8-8)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); - }, - 203 => function ($stackPos) { - $this->semValue = new Stmt\Function_($this->semStack[$stackPos-(9-4)], ['byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-6)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => $this->semStack[$stackPos-(9-1)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); - }, - 204 => function ($stackPos) { - $this->semValue = new Stmt\Class_($this->semStack[$stackPos-(8-3)], ['type' => $this->semStack[$stackPos-(8-2)], 'extends' => $this->semStack[$stackPos-(8-4)], 'implements' => $this->semStack[$stackPos-(8-5)], 'stmts' => $this->semStack[$stackPos-(8-7)], 'attrGroups' => $this->semStack[$stackPos-(8-1)]], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); - $this->checkClass($this->semValue, $stackPos-(8-3)); - }, - 205 => function ($stackPos) { - $this->semValue = new Stmt\Interface_($this->semStack[$stackPos-(7-3)], ['extends' => $this->semStack[$stackPos-(7-4)], 'stmts' => $this->semStack[$stackPos-(7-6)], 'attrGroups' => $this->semStack[$stackPos-(7-1)]], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); - $this->checkInterface($this->semValue, $stackPos-(7-3)); - }, - 206 => function ($stackPos) { - $this->semValue = new Stmt\Trait_($this->semStack[$stackPos-(6-3)], ['stmts' => $this->semStack[$stackPos-(6-5)], 'attrGroups' => $this->semStack[$stackPos-(6-1)]], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); - }, - 207 => function ($stackPos) { - $this->semValue = new Stmt\Enum_($this->semStack[$stackPos-(8-3)], ['scalarType' => $this->semStack[$stackPos-(8-4)], 'implements' => $this->semStack[$stackPos-(8-5)], 'stmts' => $this->semStack[$stackPos-(8-7)], 'attrGroups' => $this->semStack[$stackPos-(8-1)]], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); - $this->checkEnum($this->semValue, $stackPos-(8-3)); - }, - 208 => function ($stackPos) { - $this->semValue = null; - }, - 209 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 210 => function ($stackPos) { - $this->semValue = null; - }, - 211 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 212 => function ($stackPos) { - $this->semValue = 0; - }, - 213 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 214 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 215 => function ($stackPos) { - $this->checkClassModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)]; - }, - 216 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT; - }, - 217 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_FINAL; - }, - 218 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_READONLY; - }, - 219 => function ($stackPos) { - $this->semValue = null; - }, - 220 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 221 => function ($stackPos) { - $this->semValue = array(); - }, - 222 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 223 => function ($stackPos) { - $this->semValue = array(); - }, - 224 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 225 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 226 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 227 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 228 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); - }, - 229 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 230 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); - }, - 231 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 232 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); - }, - 233 => function ($stackPos) { - $this->semValue = null; - }, - 234 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 235 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 236 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 237 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 238 => function ($stackPos) { - $this->semValue = new Stmt\DeclareDeclare($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 239 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 240 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-3)]; - }, - 241 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 242 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(5-3)]; - }, - 243 => function ($stackPos) { - $this->semValue = array(); - }, - 244 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 245 => function ($stackPos) { - $this->semValue = new Stmt\Case_($this->semStack[$stackPos-(4-2)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 246 => function ($stackPos) { - $this->semValue = new Stmt\Case_(null, $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 247 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 248 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 249 => function ($stackPos) { - $this->semValue = new Expr\Match_($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-6)], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); - }, - 250 => function ($stackPos) { - $this->semValue = []; - }, - 251 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 252 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 253 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 254 => function ($stackPos) { - $this->semValue = new Node\MatchArm($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 255 => function ($stackPos) { - $this->semValue = new Node\MatchArm(null, $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 256 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); - }, - 257 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 258 => function ($stackPos) { - $this->semValue = array(); - }, - 259 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 260 => function ($stackPos) { - $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos-(5-3)], is_array($this->semStack[$stackPos-(5-5)]) ? $this->semStack[$stackPos-(5-5)] : array($this->semStack[$stackPos-(5-5)]), $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 261 => function ($stackPos) { - $this->semValue = array(); - }, - 262 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 263 => function ($stackPos) { - $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-6)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); - }, - 264 => function ($stackPos) { - $this->semValue = null; - }, - 265 => function ($stackPos) { - $this->semValue = new Stmt\Else_(is_array($this->semStack[$stackPos-(2-2)]) ? $this->semStack[$stackPos-(2-2)] : array($this->semStack[$stackPos-(2-2)]), $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 266 => function ($stackPos) { - $this->semValue = null; - }, - 267 => function ($stackPos) { - $this->semValue = new Stmt\Else_($this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 268 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)], false); - }, - 269 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(2-2)], true); - }, - 270 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)], false); - }, - 271 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)], false); - }, - 272 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 273 => function ($stackPos) { - $this->semValue = array(); - }, - 274 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 275 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 276 => function ($stackPos) { - $this->semValue = 0; - }, - 277 => function ($stackPos) { - $this->checkModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)]; - }, - 278 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PUBLIC; - }, - 279 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PROTECTED; - }, - 280 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PRIVATE; - }, - 281 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_READONLY; - }, - 282 => function ($stackPos) { - $this->semValue = new Node\Param($this->semStack[$stackPos-(6-6)], null, $this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-4)], $this->semStack[$stackPos-(6-5)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes, $this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-1)]); - $this->checkParam($this->semValue); - }, - 283 => function ($stackPos) { - $this->semValue = new Node\Param($this->semStack[$stackPos-(8-6)], $this->semStack[$stackPos-(8-8)], $this->semStack[$stackPos-(8-3)], $this->semStack[$stackPos-(8-4)], $this->semStack[$stackPos-(8-5)], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes, $this->semStack[$stackPos-(8-2)], $this->semStack[$stackPos-(8-1)]); - $this->checkParam($this->semValue); - }, - 284 => function ($stackPos) { - $this->semValue = new Node\Param(new Expr\Error($this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes), null, $this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-4)], $this->semStack[$stackPos-(6-5)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes, $this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-1)]); - }, - 285 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 286 => function ($stackPos) { - $this->semValue = new Node\NullableType($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 287 => function ($stackPos) { - $this->semValue = new Node\UnionType($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 288 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 289 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 290 => function ($stackPos) { - $this->semValue = new Node\Name('static', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 291 => function ($stackPos) { - $this->semValue = $this->handleBuiltinTypes($this->semStack[$stackPos-(1-1)]); - }, - 292 => function ($stackPos) { - $this->semValue = new Node\Identifier('array', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 293 => function ($stackPos) { - $this->semValue = new Node\Identifier('callable', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 294 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 295 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 296 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); - }, - 297 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 298 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 299 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 300 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); - }, - 301 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 302 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); - }, - 303 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 304 => function ($stackPos) { - $this->semValue = new Node\IntersectionType($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 305 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); - }, - 306 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 307 => function ($stackPos) { - $this->semValue = new Node\IntersectionType($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 308 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 309 => function ($stackPos) { - $this->semValue = new Node\NullableType($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 310 => function ($stackPos) { - $this->semValue = new Node\UnionType($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 311 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 312 => function ($stackPos) { - $this->semValue = null; - }, - 313 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 314 => function ($stackPos) { - $this->semValue = null; - }, - 315 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 316 => function ($stackPos) { - $this->semValue = null; - }, - 317 => function ($stackPos) { - $this->semValue = array(); - }, - 318 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 319 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-2)]); - }, - 320 => function ($stackPos) { - $this->semValue = new Node\VariadicPlaceholder($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 321 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 322 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 323 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(1-1)], false, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 324 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], true, false, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 325 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], false, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 326 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(3-3)], false, false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->semStack[$stackPos-(3-1)]); - }, - 327 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 328 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 329 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 330 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 331 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 332 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 333 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 334 => function ($stackPos) { - $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos-(1-1)], null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 335 => function ($stackPos) { - $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 336 => function ($stackPos) { - if ($this->semStack[$stackPos-(2-2)] !== null) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; } - }, - 337 => function ($stackPos) { - $this->semValue = array(); - }, - 338 => function ($stackPos) { - $startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; }; - if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 339 => function ($stackPos) { - $this->semValue = new Stmt\Property($this->semStack[$stackPos-(5-2)], $this->semStack[$stackPos-(5-4)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes, $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-1)]); - $this->checkProperty($this->semValue, $stackPos-(5-2)); - }, - 340 => function ($stackPos) { - $this->semValue = new Stmt\ClassConst($this->semStack[$stackPos-(5-4)], $this->semStack[$stackPos-(5-2)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes, $this->semStack[$stackPos-(5-1)]); - $this->checkClassConst($this->semValue, $stackPos-(5-2)); - }, - 341 => function ($stackPos) { - $this->semValue = new Stmt\ClassMethod($this->semStack[$stackPos-(10-5)], ['type' => $this->semStack[$stackPos-(10-2)], 'byRef' => $this->semStack[$stackPos-(10-4)], 'params' => $this->semStack[$stackPos-(10-7)], 'returnType' => $this->semStack[$stackPos-(10-9)], 'stmts' => $this->semStack[$stackPos-(10-10)], 'attrGroups' => $this->semStack[$stackPos-(10-1)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); - $this->checkClassMethod($this->semValue, $stackPos-(10-2)); - }, - 342 => function ($stackPos) { - $this->semValue = new Stmt\TraitUse($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 343 => function ($stackPos) { - $this->semValue = new Stmt\EnumCase($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-4)], $this->semStack[$stackPos-(5-1)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 344 => function ($stackPos) { - $this->semValue = null; /* will be skipped */ - }, - 345 => function ($stackPos) { - $this->semValue = array(); - }, - 346 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 347 => function ($stackPos) { - $this->semValue = array(); - }, - 348 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 349 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Precedence($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 350 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(5-1)][0], $this->semStack[$stackPos-(5-1)][1], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-4)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 351 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], $this->semStack[$stackPos-(4-3)], null, $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 352 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], null, $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 353 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], null, $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 354 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); - }, - 355 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 356 => function ($stackPos) { - $this->semValue = array(null, $this->semStack[$stackPos-(1-1)]); - }, - 357 => function ($stackPos) { - $this->semValue = null; - }, - 358 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 359 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 360 => function ($stackPos) { - $this->semValue = 0; - }, - 361 => function ($stackPos) { - $this->semValue = 0; - }, - 362 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 363 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 364 => function ($stackPos) { - $this->checkModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)]; - }, - 365 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PUBLIC; - }, - 366 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PROTECTED; - }, - 367 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PRIVATE; - }, - 368 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_STATIC; - }, - 369 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT; - }, - 370 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_FINAL; - }, - 371 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_READONLY; - }, - 372 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 373 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 374 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 375 => function ($stackPos) { - $this->semValue = new Node\VarLikeIdentifier(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 376 => function ($stackPos) { - $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos-(1-1)], null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 377 => function ($stackPos) { - $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 378 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 379 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 380 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 381 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 382 => function ($stackPos) { - $this->semValue = array(); - }, - 383 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 384 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 385 => function ($stackPos) { - $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 386 => function ($stackPos) { - $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 387 => function ($stackPos) { - $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 388 => function ($stackPos) { - $this->semValue = new Expr\AssignRef($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 389 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 390 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 391 => function ($stackPos) { - $this->semValue = new Expr\Clone_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 392 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 393 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 394 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 395 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 396 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 397 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 398 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 399 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 400 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 401 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 402 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 403 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 404 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Coalesce($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 405 => function ($stackPos) { - $this->semValue = new Expr\PostInc($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 406 => function ($stackPos) { - $this->semValue = new Expr\PreInc($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 407 => function ($stackPos) { - $this->semValue = new Expr\PostDec($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 408 => function ($stackPos) { - $this->semValue = new Expr\PreDec($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 409 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BooleanOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 410 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BooleanAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 411 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 412 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 413 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 414 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 415 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 416 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 417 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 418 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 419 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 420 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 421 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 422 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 423 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 424 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 425 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 426 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 427 => function ($stackPos) { - $this->semValue = new Expr\UnaryPlus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 428 => function ($stackPos) { - $this->semValue = new Expr\UnaryMinus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 429 => function ($stackPos) { - $this->semValue = new Expr\BooleanNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 430 => function ($stackPos) { - $this->semValue = new Expr\BitwiseNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 431 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Identical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 432 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\NotIdentical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 433 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Equal($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 434 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\NotEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 435 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Spaceship($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 436 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Smaller($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 437 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\SmallerOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 438 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Greater($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 439 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\GreaterOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 440 => function ($stackPos) { - $this->semValue = new Expr\Instanceof_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 441 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 442 => function ($stackPos) { - $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(5-1)], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 443 => function ($stackPos) { - $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(4-1)], null, $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 444 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Coalesce($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 445 => function ($stackPos) { - $this->semValue = new Expr\Isset_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 446 => function ($stackPos) { - $this->semValue = new Expr\Empty_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 447 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 448 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE_ONCE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 449 => function ($stackPos) { - $this->semValue = new Expr\Eval_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 450 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 451 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE_ONCE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 452 => function ($stackPos) { - $this->semValue = new Expr\Cast\Int_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 453 => function ($stackPos) { - $attrs = $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes; - $attrs['kind'] = $this->getFloatCastKind($this->semStack[$stackPos-(2-1)]); - $this->semValue = new Expr\Cast\Double($this->semStack[$stackPos-(2-2)], $attrs); - }, - 454 => function ($stackPos) { - $this->semValue = new Expr\Cast\String_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 455 => function ($stackPos) { - $this->semValue = new Expr\Cast\Array_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 456 => function ($stackPos) { - $this->semValue = new Expr\Cast\Object_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 457 => function ($stackPos) { - $this->semValue = new Expr\Cast\Bool_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 458 => function ($stackPos) { - $this->semValue = new Expr\Cast\Unset_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 459 => function ($stackPos) { - $attrs = $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes; - $attrs['kind'] = strtolower($this->semStack[$stackPos-(2-1)]) === 'exit' ? Expr\Exit_::KIND_EXIT : Expr\Exit_::KIND_DIE; - $this->semValue = new Expr\Exit_($this->semStack[$stackPos-(2-2)], $attrs); - }, - 460 => function ($stackPos) { - $this->semValue = new Expr\ErrorSuppress($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 461 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 462 => function ($stackPos) { - $this->semValue = new Expr\ShellExec($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 463 => function ($stackPos) { - $this->semValue = new Expr\Print_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 464 => function ($stackPos) { - $this->semValue = new Expr\Yield_(null, null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 465 => function ($stackPos) { - $this->semValue = new Expr\Yield_($this->semStack[$stackPos-(2-2)], null, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 466 => function ($stackPos) { - $this->semValue = new Expr\Yield_($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-2)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 467 => function ($stackPos) { - $this->semValue = new Expr\YieldFrom($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 468 => function ($stackPos) { - $this->semValue = new Expr\Throw_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 469 => function ($stackPos) { - $this->semValue = new Expr\ArrowFunction(['static' => false, 'byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-4)], 'returnType' => $this->semStack[$stackPos-(8-6)], 'expr' => $this->semStack[$stackPos-(8-8)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); - }, - 470 => function ($stackPos) { - $this->semValue = new Expr\ArrowFunction(['static' => true, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'returnType' => $this->semStack[$stackPos-(9-7)], 'expr' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); - }, - 471 => function ($stackPos) { - $this->semValue = new Expr\Closure(['static' => false, 'byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-4)], 'uses' => $this->semStack[$stackPos-(8-6)], 'returnType' => $this->semStack[$stackPos-(8-7)], 'stmts' => $this->semStack[$stackPos-(8-8)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); - }, - 472 => function ($stackPos) { - $this->semValue = new Expr\Closure(['static' => true, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'uses' => $this->semStack[$stackPos-(9-7)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); - }, - 473 => function ($stackPos) { - $this->semValue = new Expr\ArrowFunction(['static' => false, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'returnType' => $this->semStack[$stackPos-(9-7)], 'expr' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => $this->semStack[$stackPos-(9-1)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); - }, - 474 => function ($stackPos) { - $this->semValue = new Expr\ArrowFunction(['static' => true, 'byRef' => $this->semStack[$stackPos-(10-4)], 'params' => $this->semStack[$stackPos-(10-6)], 'returnType' => $this->semStack[$stackPos-(10-8)], 'expr' => $this->semStack[$stackPos-(10-10)], 'attrGroups' => $this->semStack[$stackPos-(10-1)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); - }, - 475 => function ($stackPos) { - $this->semValue = new Expr\Closure(['static' => false, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'uses' => $this->semStack[$stackPos-(9-7)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => $this->semStack[$stackPos-(9-1)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); - }, - 476 => function ($stackPos) { - $this->semValue = new Expr\Closure(['static' => true, 'byRef' => $this->semStack[$stackPos-(10-4)], 'params' => $this->semStack[$stackPos-(10-6)], 'uses' => $this->semStack[$stackPos-(10-8)], 'returnType' => $this->semStack[$stackPos-(10-9)], 'stmts' => $this->semStack[$stackPos-(10-10)], 'attrGroups' => $this->semStack[$stackPos-(10-1)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); - }, - 477 => function ($stackPos) { - $this->semValue = array(new Stmt\Class_(null, ['type' => 0, 'extends' => $this->semStack[$stackPos-(8-4)], 'implements' => $this->semStack[$stackPos-(8-5)], 'stmts' => $this->semStack[$stackPos-(8-7)], 'attrGroups' => $this->semStack[$stackPos-(8-1)]], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes), $this->semStack[$stackPos-(8-3)]); - $this->checkClass($this->semValue[0], -1); - }, - 478 => function ($stackPos) { - $this->semValue = new Expr\New_($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 479 => function ($stackPos) { - list($class, $ctorArgs) = $this->semStack[$stackPos-(2-2)]; $this->semValue = new Expr\New_($class, $ctorArgs, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 480 => function ($stackPos) { - $this->semValue = array(); - }, - 481 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-3)]; - }, - 482 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 483 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 484 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 485 => function ($stackPos) { - $this->semValue = new Expr\ClosureUse($this->semStack[$stackPos-(2-2)], $this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 486 => function ($stackPos) { - $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 487 => function ($stackPos) { - $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 488 => function ($stackPos) { - $this->semValue = new Expr\StaticCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 489 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 490 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 491 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 492 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 493 => function ($stackPos) { - $this->semValue = new Name\FullyQualified(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 494 => function ($stackPos) { - $this->semValue = new Name\Relative(substr($this->semStack[$stackPos-(1-1)], 10), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 495 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 496 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 497 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 498 => function ($stackPos) { - $this->semValue = new Expr\Error($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->errorState = 2; - }, - 499 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 500 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 501 => function ($stackPos) { - $this->semValue = null; - }, - 502 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 503 => function ($stackPos) { - $this->semValue = array(); - }, - 504 => function ($stackPos) { - $this->semValue = array(new Scalar\EncapsedStringPart(Scalar\String_::parseEscapeSequences($this->semStack[$stackPos-(1-1)], '`'), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes)); - }, - 505 => function ($stackPos) { - foreach ($this->semStack[$stackPos-(1-1)] as $s) { if ($s instanceof Node\Scalar\EncapsedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '`', true); } }; $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 506 => function ($stackPos) { - $this->semValue = array(); - }, - 507 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 508 => function ($stackPos) { - $this->semValue = new Expr\ConstFetch($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 509 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Line($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 510 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\File($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 511 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Dir($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 512 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Class_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 513 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Trait_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 514 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Method($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 515 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Function_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 516 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Namespace_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 517 => function ($stackPos) { - $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 518 => function ($stackPos) { - $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], new Expr\Error($this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)]), $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->errorState = 2; - }, - 519 => function ($stackPos) { - $attrs = $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes; $attrs['kind'] = Expr\Array_::KIND_SHORT; - $this->semValue = new Expr\Array_($this->semStack[$stackPos-(3-2)], $attrs); - }, - 520 => function ($stackPos) { - $attrs = $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes; $attrs['kind'] = Expr\Array_::KIND_LONG; - $this->semValue = new Expr\Array_($this->semStack[$stackPos-(4-3)], $attrs); - }, - 521 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 522 => function ($stackPos) { - $this->semValue = Scalar\String_::fromString($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 523 => function ($stackPos) { - $attrs = $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes; $attrs['kind'] = Scalar\String_::KIND_DOUBLE_QUOTED; - foreach ($this->semStack[$stackPos-(3-2)] as $s) { if ($s instanceof Node\Scalar\EncapsedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '"', true); } }; $this->semValue = new Scalar\Encapsed($this->semStack[$stackPos-(3-2)], $attrs); - }, - 524 => function ($stackPos) { - $this->semValue = $this->parseLNumber($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 525 => function ($stackPos) { - $this->semValue = Scalar\DNumber::fromString($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 526 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 527 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 528 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 529 => function ($stackPos) { - $this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)], true); - }, - 530 => function ($stackPos) { - $this->semValue = $this->parseDocString($this->semStack[$stackPos-(2-1)], '', $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(2-2)] + $this->endAttributeStack[$stackPos-(2-2)], true); - }, - 531 => function ($stackPos) { - $this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)], true); - }, - 532 => function ($stackPos) { - $this->semValue = null; - }, - 533 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 534 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 535 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 536 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 537 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 538 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 539 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 540 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 541 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 542 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 543 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 544 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 545 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 546 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 547 => function ($stackPos) { - $this->semValue = new Expr\MethodCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 548 => function ($stackPos) { - $this->semValue = new Expr\NullsafeMethodCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 549 => function ($stackPos) { - $this->semValue = null; - }, - 550 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 551 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 552 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 553 => function ($stackPos) { - $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 554 => function ($stackPos) { - $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 555 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 556 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 557 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 558 => function ($stackPos) { - $this->semValue = new Expr\Variable(new Expr\Error($this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes), $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); $this->errorState = 2; - }, - 559 => function ($stackPos) { - $var = $this->semStack[$stackPos-(1-1)]->name; $this->semValue = \is_string($var) ? new Node\VarLikeIdentifier($var, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes) : $var; - }, - 560 => function ($stackPos) { - $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 561 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 562 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 563 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 564 => function ($stackPos) { - $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 565 => function ($stackPos) { - $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 566 => function ($stackPos) { - $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 567 => function ($stackPos) { - $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 568 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 569 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 570 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 571 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 572 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 573 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 574 => function ($stackPos) { - $this->semValue = new Expr\Error($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->errorState = 2; - }, - 575 => function ($stackPos) { - $this->semValue = new Expr\List_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 576 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; $end = count($this->semValue)-1; if ($this->semValue[$end] === null) array_pop($this->semValue); - }, - 577 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 578 => function ($stackPos) { - /* do nothing -- prevent default action of $$=$this->semStack[$1]. See $551. */ - }, - 579 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 580 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 581 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 582 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 583 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 584 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 585 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-1)], true, $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 586 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 587 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, false, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 588 => function ($stackPos) { - $this->semValue = null; - }, - 589 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 590 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 591 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 592 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); - }, - 593 => function ($stackPos) { - $this->semValue = new Scalar\EncapsedStringPart($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 594 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 595 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 596 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 597 => function ($stackPos) { - $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 598 => function ($stackPos) { - $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 599 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 600 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 601 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-4)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); - }, - 602 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 603 => function ($stackPos) { - $this->semValue = new Scalar\String_($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 604 => function ($stackPos) { - $this->semValue = $this->parseNumString($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 605 => function ($stackPos) { - $this->semValue = $this->parseNumString('-' . $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 606 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - ]; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Parser/Tokens.php b/vendor/nikic/php-parser/lib/PhpParser/Parser/Tokens.php deleted file mode 100644 index b76a5d94..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/Parser/Tokens.php +++ /dev/null @@ -1,148 +0,0 @@ -<?php - -namespace PhpParser\Parser; - -/* GENERATED file based on grammar/tokens.y */ -final class Tokens -{ - const YYERRTOK = 256; - const T_THROW = 257; - const T_INCLUDE = 258; - const T_INCLUDE_ONCE = 259; - const T_EVAL = 260; - const T_REQUIRE = 261; - const T_REQUIRE_ONCE = 262; - const T_LOGICAL_OR = 263; - const T_LOGICAL_XOR = 264; - const T_LOGICAL_AND = 265; - const T_PRINT = 266; - const T_YIELD = 267; - const T_DOUBLE_ARROW = 268; - const T_YIELD_FROM = 269; - const T_PLUS_EQUAL = 270; - const T_MINUS_EQUAL = 271; - const T_MUL_EQUAL = 272; - const T_DIV_EQUAL = 273; - const T_CONCAT_EQUAL = 274; - const T_MOD_EQUAL = 275; - const T_AND_EQUAL = 276; - const T_OR_EQUAL = 277; - const T_XOR_EQUAL = 278; - const T_SL_EQUAL = 279; - const T_SR_EQUAL = 280; - const T_POW_EQUAL = 281; - const T_COALESCE_EQUAL = 282; - const T_COALESCE = 283; - const T_BOOLEAN_OR = 284; - const T_BOOLEAN_AND = 285; - const T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG = 286; - const T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG = 287; - const T_IS_EQUAL = 288; - const T_IS_NOT_EQUAL = 289; - const T_IS_IDENTICAL = 290; - const T_IS_NOT_IDENTICAL = 291; - const T_SPACESHIP = 292; - const T_IS_SMALLER_OR_EQUAL = 293; - const T_IS_GREATER_OR_EQUAL = 294; - const T_SL = 295; - const T_SR = 296; - const T_INSTANCEOF = 297; - const T_INC = 298; - const T_DEC = 299; - const T_INT_CAST = 300; - const T_DOUBLE_CAST = 301; - const T_STRING_CAST = 302; - const T_ARRAY_CAST = 303; - const T_OBJECT_CAST = 304; - const T_BOOL_CAST = 305; - const T_UNSET_CAST = 306; - const T_POW = 307; - const T_NEW = 308; - const T_CLONE = 309; - const T_EXIT = 310; - const T_IF = 311; - const T_ELSEIF = 312; - const T_ELSE = 313; - const T_ENDIF = 314; - const T_LNUMBER = 315; - const T_DNUMBER = 316; - const T_STRING = 317; - const T_STRING_VARNAME = 318; - const T_VARIABLE = 319; - const T_NUM_STRING = 320; - const T_INLINE_HTML = 321; - const T_ENCAPSED_AND_WHITESPACE = 322; - const T_CONSTANT_ENCAPSED_STRING = 323; - const T_ECHO = 324; - const T_DO = 325; - const T_WHILE = 326; - const T_ENDWHILE = 327; - const T_FOR = 328; - const T_ENDFOR = 329; - const T_FOREACH = 330; - const T_ENDFOREACH = 331; - const T_DECLARE = 332; - const T_ENDDECLARE = 333; - const T_AS = 334; - const T_SWITCH = 335; - const T_MATCH = 336; - const T_ENDSWITCH = 337; - const T_CASE = 338; - const T_DEFAULT = 339; - const T_BREAK = 340; - const T_CONTINUE = 341; - const T_GOTO = 342; - const T_FUNCTION = 343; - const T_FN = 344; - const T_CONST = 345; - const T_RETURN = 346; - const T_TRY = 347; - const T_CATCH = 348; - const T_FINALLY = 349; - const T_USE = 350; - const T_INSTEADOF = 351; - const T_GLOBAL = 352; - const T_STATIC = 353; - const T_ABSTRACT = 354; - const T_FINAL = 355; - const T_PRIVATE = 356; - const T_PROTECTED = 357; - const T_PUBLIC = 358; - const T_READONLY = 359; - const T_VAR = 360; - const T_UNSET = 361; - const T_ISSET = 362; - const T_EMPTY = 363; - const T_HALT_COMPILER = 364; - const T_CLASS = 365; - const T_TRAIT = 366; - const T_INTERFACE = 367; - const T_ENUM = 368; - const T_EXTENDS = 369; - const T_IMPLEMENTS = 370; - const T_OBJECT_OPERATOR = 371; - const T_NULLSAFE_OBJECT_OPERATOR = 372; - const T_LIST = 373; - const T_ARRAY = 374; - const T_CALLABLE = 375; - const T_CLASS_C = 376; - const T_TRAIT_C = 377; - const T_METHOD_C = 378; - const T_FUNC_C = 379; - const T_LINE = 380; - const T_FILE = 381; - const T_START_HEREDOC = 382; - const T_END_HEREDOC = 383; - const T_DOLLAR_OPEN_CURLY_BRACES = 384; - const T_CURLY_OPEN = 385; - const T_PAAMAYIM_NEKUDOTAYIM = 386; - const T_NAMESPACE = 387; - const T_NS_C = 388; - const T_DIR = 389; - const T_NS_SEPARATOR = 390; - const T_ELLIPSIS = 391; - const T_NAME_FULLY_QUALIFIED = 392; - const T_NAME_QUALIFIED = 393; - const T_NAME_RELATIVE = 394; - const T_ATTRIBUTE = 395; -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php b/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php deleted file mode 100644 index 301d3c6a..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php +++ /dev/null @@ -1,1039 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser; - -/* - * This parser is based on a skeleton written by Moriyoshi Koizumi, which in - * turn is based on work by Masato Bito. - */ -use PhpParser\Node\Expr; -use PhpParser\Node\Expr\Cast\Double; -use PhpParser\Node\Name; -use PhpParser\Node\Param; -use PhpParser\Node\Scalar\Encapsed; -use PhpParser\Node\Scalar\LNumber; -use PhpParser\Node\Scalar\String_; -use PhpParser\Node\Stmt\Class_; -use PhpParser\Node\Stmt\ClassConst; -use PhpParser\Node\Stmt\ClassMethod; -use PhpParser\Node\Stmt\Enum_; -use PhpParser\Node\Stmt\Interface_; -use PhpParser\Node\Stmt\Namespace_; -use PhpParser\Node\Stmt\Property; -use PhpParser\Node\Stmt\TryCatch; -use PhpParser\Node\Stmt\UseUse; -use PhpParser\Node\VarLikeIdentifier; - -abstract class ParserAbstract implements Parser -{ - const SYMBOL_NONE = -1; - - /* - * The following members will be filled with generated parsing data: - */ - - /** @var int Size of $tokenToSymbol map */ - protected $tokenToSymbolMapSize; - /** @var int Size of $action table */ - protected $actionTableSize; - /** @var int Size of $goto table */ - protected $gotoTableSize; - - /** @var int Symbol number signifying an invalid token */ - protected $invalidSymbol; - /** @var int Symbol number of error recovery token */ - protected $errorSymbol; - /** @var int Action number signifying default action */ - protected $defaultAction; - /** @var int Rule number signifying that an unexpected token was encountered */ - protected $unexpectedTokenRule; - - protected $YY2TBLSTATE; - /** @var int Number of non-leaf states */ - protected $numNonLeafStates; - - /** @var int[] Map of lexer tokens to internal symbols */ - protected $tokenToSymbol; - /** @var string[] Map of symbols to their names */ - protected $symbolToName; - /** @var array Names of the production rules (only necessary for debugging) */ - protected $productions; - - /** @var int[] Map of states to a displacement into the $action table. The corresponding action for this - * state/symbol pair is $action[$actionBase[$state] + $symbol]. If $actionBase[$state] is 0, the - * action is defaulted, i.e. $actionDefault[$state] should be used instead. */ - protected $actionBase; - /** @var int[] Table of actions. Indexed according to $actionBase comment. */ - protected $action; - /** @var int[] Table indexed analogously to $action. If $actionCheck[$actionBase[$state] + $symbol] != $symbol - * then the action is defaulted, i.e. $actionDefault[$state] should be used instead. */ - protected $actionCheck; - /** @var int[] Map of states to their default action */ - protected $actionDefault; - /** @var callable[] Semantic action callbacks */ - protected $reduceCallbacks; - - /** @var int[] Map of non-terminals to a displacement into the $goto table. The corresponding goto state for this - * non-terminal/state pair is $goto[$gotoBase[$nonTerminal] + $state] (unless defaulted) */ - protected $gotoBase; - /** @var int[] Table of states to goto after reduction. Indexed according to $gotoBase comment. */ - protected $goto; - /** @var int[] Table indexed analogously to $goto. If $gotoCheck[$gotoBase[$nonTerminal] + $state] != $nonTerminal - * then the goto state is defaulted, i.e. $gotoDefault[$nonTerminal] should be used. */ - protected $gotoCheck; - /** @var int[] Map of non-terminals to the default state to goto after their reduction */ - protected $gotoDefault; - - /** @var int[] Map of rules to the non-terminal on their left-hand side, i.e. the non-terminal to use for - * determining the state to goto after reduction. */ - protected $ruleToNonTerminal; - /** @var int[] Map of rules to the length of their right-hand side, which is the number of elements that have to - * be popped from the stack(s) on reduction. */ - protected $ruleToLength; - - /* - * The following members are part of the parser state: - */ - - /** @var Lexer Lexer that is used when parsing */ - protected $lexer; - /** @var mixed Temporary value containing the result of last semantic action (reduction) */ - protected $semValue; - /** @var array Semantic value stack (contains values of tokens and semantic action results) */ - protected $semStack; - /** @var array[] Start attribute stack */ - protected $startAttributeStack; - /** @var array[] End attribute stack */ - protected $endAttributeStack; - /** @var array End attributes of last *shifted* token */ - protected $endAttributes; - /** @var array Start attributes of last *read* token */ - protected $lookaheadStartAttributes; - - /** @var ErrorHandler Error handler */ - protected $errorHandler; - /** @var int Error state, used to avoid error floods */ - protected $errorState; - - /** - * Initialize $reduceCallbacks map. - */ - abstract protected function initReduceCallbacks(); - - /** - * Creates a parser instance. - * - * Options: Currently none. - * - * @param Lexer $lexer A lexer - * @param array $options Options array. - */ - public function __construct(Lexer $lexer, array $options = []) { - $this->lexer = $lexer; - - if (isset($options['throwOnError'])) { - throw new \LogicException( - '"throwOnError" is no longer supported, use "errorHandler" instead'); - } - - $this->initReduceCallbacks(); - } - - /** - * Parses PHP code into a node tree. - * - * If a non-throwing error handler is used, the parser will continue parsing after an error - * occurred and attempt to build a partial AST. - * - * @param string $code The source code to parse - * @param ErrorHandler|null $errorHandler Error handler to use for lexer/parser errors, defaults - * to ErrorHandler\Throwing. - * - * @return Node\Stmt[]|null Array of statements (or null non-throwing error handler is used and - * the parser was unable to recover from an error). - */ - public function parse(string $code, ErrorHandler $errorHandler = null) { - $this->errorHandler = $errorHandler ?: new ErrorHandler\Throwing; - - $this->lexer->startLexing($code, $this->errorHandler); - $result = $this->doParse(); - - // Clear out some of the interior state, so we don't hold onto unnecessary - // memory between uses of the parser - $this->startAttributeStack = []; - $this->endAttributeStack = []; - $this->semStack = []; - $this->semValue = null; - - return $result; - } - - protected function doParse() { - // We start off with no lookahead-token - $symbol = self::SYMBOL_NONE; - - // The attributes for a node are taken from the first and last token of the node. - // From the first token only the startAttributes are taken and from the last only - // the endAttributes. Both are merged using the array union operator (+). - $startAttributes = []; - $endAttributes = []; - $this->endAttributes = $endAttributes; - - // Keep stack of start and end attributes - $this->startAttributeStack = []; - $this->endAttributeStack = [$endAttributes]; - - // Start off in the initial state and keep a stack of previous states - $state = 0; - $stateStack = [$state]; - - // Semantic value stack (contains values of tokens and semantic action results) - $this->semStack = []; - - // Current position in the stack(s) - $stackPos = 0; - - $this->errorState = 0; - - for (;;) { - //$this->traceNewState($state, $symbol); - - if ($this->actionBase[$state] === 0) { - $rule = $this->actionDefault[$state]; - } else { - if ($symbol === self::SYMBOL_NONE) { - // Fetch the next token id from the lexer and fetch additional info by-ref. - // The end attributes are fetched into a temporary variable and only set once the token is really - // shifted (not during read). Otherwise you would sometimes get off-by-one errors, when a rule is - // reduced after a token was read but not yet shifted. - $tokenId = $this->lexer->getNextToken($tokenValue, $startAttributes, $endAttributes); - - // map the lexer token id to the internally used symbols - $symbol = $tokenId >= 0 && $tokenId < $this->tokenToSymbolMapSize - ? $this->tokenToSymbol[$tokenId] - : $this->invalidSymbol; - - if ($symbol === $this->invalidSymbol) { - throw new \RangeException(sprintf( - 'The lexer returned an invalid token (id=%d, value=%s)', - $tokenId, $tokenValue - )); - } - - // Allow productions to access the start attributes of the lookahead token. - $this->lookaheadStartAttributes = $startAttributes; - - //$this->traceRead($symbol); - } - - $idx = $this->actionBase[$state] + $symbol; - if ((($idx >= 0 && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $symbol) - || ($state < $this->YY2TBLSTATE - && ($idx = $this->actionBase[$state + $this->numNonLeafStates] + $symbol) >= 0 - && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $symbol)) - && ($action = $this->action[$idx]) !== $this->defaultAction) { - /* - * >= numNonLeafStates: shift and reduce - * > 0: shift - * = 0: accept - * < 0: reduce - * = -YYUNEXPECTED: error - */ - if ($action > 0) { - /* shift */ - //$this->traceShift($symbol); - - ++$stackPos; - $stateStack[$stackPos] = $state = $action; - $this->semStack[$stackPos] = $tokenValue; - $this->startAttributeStack[$stackPos] = $startAttributes; - $this->endAttributeStack[$stackPos] = $endAttributes; - $this->endAttributes = $endAttributes; - $symbol = self::SYMBOL_NONE; - - if ($this->errorState) { - --$this->errorState; - } - - if ($action < $this->numNonLeafStates) { - continue; - } - - /* $yyn >= numNonLeafStates means shift-and-reduce */ - $rule = $action - $this->numNonLeafStates; - } else { - $rule = -$action; - } - } else { - $rule = $this->actionDefault[$state]; - } - } - - for (;;) { - if ($rule === 0) { - /* accept */ - //$this->traceAccept(); - return $this->semValue; - } elseif ($rule !== $this->unexpectedTokenRule) { - /* reduce */ - //$this->traceReduce($rule); - - try { - $this->reduceCallbacks[$rule]($stackPos); - } catch (Error $e) { - if (-1 === $e->getStartLine() && isset($startAttributes['startLine'])) { - $e->setStartLine($startAttributes['startLine']); - } - - $this->emitError($e); - // Can't recover from this type of error - return null; - } - - /* Goto - shift nonterminal */ - $lastEndAttributes = $this->endAttributeStack[$stackPos]; - $ruleLength = $this->ruleToLength[$rule]; - $stackPos -= $ruleLength; - $nonTerminal = $this->ruleToNonTerminal[$rule]; - $idx = $this->gotoBase[$nonTerminal] + $stateStack[$stackPos]; - if ($idx >= 0 && $idx < $this->gotoTableSize && $this->gotoCheck[$idx] === $nonTerminal) { - $state = $this->goto[$idx]; - } else { - $state = $this->gotoDefault[$nonTerminal]; - } - - ++$stackPos; - $stateStack[$stackPos] = $state; - $this->semStack[$stackPos] = $this->semValue; - $this->endAttributeStack[$stackPos] = $lastEndAttributes; - if ($ruleLength === 0) { - // Empty productions use the start attributes of the lookahead token. - $this->startAttributeStack[$stackPos] = $this->lookaheadStartAttributes; - } - } else { - /* error */ - switch ($this->errorState) { - case 0: - $msg = $this->getErrorMessage($symbol, $state); - $this->emitError(new Error($msg, $startAttributes + $endAttributes)); - // Break missing intentionally - case 1: - case 2: - $this->errorState = 3; - - // Pop until error-expecting state uncovered - while (!( - (($idx = $this->actionBase[$state] + $this->errorSymbol) >= 0 - && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $this->errorSymbol) - || ($state < $this->YY2TBLSTATE - && ($idx = $this->actionBase[$state + $this->numNonLeafStates] + $this->errorSymbol) >= 0 - && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $this->errorSymbol) - ) || ($action = $this->action[$idx]) === $this->defaultAction) { // Not totally sure about this - if ($stackPos <= 0) { - // Could not recover from error - return null; - } - $state = $stateStack[--$stackPos]; - //$this->tracePop($state); - } - - //$this->traceShift($this->errorSymbol); - ++$stackPos; - $stateStack[$stackPos] = $state = $action; - - // We treat the error symbol as being empty, so we reset the end attributes - // to the end attributes of the last non-error symbol - $this->startAttributeStack[$stackPos] = $this->lookaheadStartAttributes; - $this->endAttributeStack[$stackPos] = $this->endAttributeStack[$stackPos - 1]; - $this->endAttributes = $this->endAttributeStack[$stackPos - 1]; - break; - - case 3: - if ($symbol === 0) { - // Reached EOF without recovering from error - return null; - } - - //$this->traceDiscard($symbol); - $symbol = self::SYMBOL_NONE; - break 2; - } - } - - if ($state < $this->numNonLeafStates) { - break; - } - - /* >= numNonLeafStates means shift-and-reduce */ - $rule = $state - $this->numNonLeafStates; - } - } - - throw new \RuntimeException('Reached end of parser loop'); - } - - protected function emitError(Error $error) { - $this->errorHandler->handleError($error); - } - - /** - * Format error message including expected tokens. - * - * @param int $symbol Unexpected symbol - * @param int $state State at time of error - * - * @return string Formatted error message - */ - protected function getErrorMessage(int $symbol, int $state) : string { - $expectedString = ''; - if ($expected = $this->getExpectedTokens($state)) { - $expectedString = ', expecting ' . implode(' or ', $expected); - } - - return 'Syntax error, unexpected ' . $this->symbolToName[$symbol] . $expectedString; - } - - /** - * Get limited number of expected tokens in given state. - * - * @param int $state State - * - * @return string[] Expected tokens. If too many, an empty array is returned. - */ - protected function getExpectedTokens(int $state) : array { - $expected = []; - - $base = $this->actionBase[$state]; - foreach ($this->symbolToName as $symbol => $name) { - $idx = $base + $symbol; - if ($idx >= 0 && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $symbol - || $state < $this->YY2TBLSTATE - && ($idx = $this->actionBase[$state + $this->numNonLeafStates] + $symbol) >= 0 - && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $symbol - ) { - if ($this->action[$idx] !== $this->unexpectedTokenRule - && $this->action[$idx] !== $this->defaultAction - && $symbol !== $this->errorSymbol - ) { - if (count($expected) === 4) { - /* Too many expected tokens */ - return []; - } - - $expected[] = $name; - } - } - } - - return $expected; - } - - /* - * Tracing functions used for debugging the parser. - */ - - /* - protected function traceNewState($state, $symbol) { - echo '% State ' . $state - . ', Lookahead ' . ($symbol == self::SYMBOL_NONE ? '--none--' : $this->symbolToName[$symbol]) . "\n"; - } - - protected function traceRead($symbol) { - echo '% Reading ' . $this->symbolToName[$symbol] . "\n"; - } - - protected function traceShift($symbol) { - echo '% Shift ' . $this->symbolToName[$symbol] . "\n"; - } - - protected function traceAccept() { - echo "% Accepted.\n"; - } - - protected function traceReduce($n) { - echo '% Reduce by (' . $n . ') ' . $this->productions[$n] . "\n"; - } - - protected function tracePop($state) { - echo '% Recovering, uncovered state ' . $state . "\n"; - } - - protected function traceDiscard($symbol) { - echo '% Discard ' . $this->symbolToName[$symbol] . "\n"; - } - */ - - /* - * Helper functions invoked by semantic actions - */ - - /** - * Moves statements of semicolon-style namespaces into $ns->stmts and checks various error conditions. - * - * @param Node\Stmt[] $stmts - * @return Node\Stmt[] - */ - protected function handleNamespaces(array $stmts) : array { - $hasErrored = false; - $style = $this->getNamespacingStyle($stmts); - if (null === $style) { - // not namespaced, nothing to do - return $stmts; - } elseif ('brace' === $style) { - // For braced namespaces we only have to check that there are no invalid statements between the namespaces - $afterFirstNamespace = false; - foreach ($stmts as $stmt) { - if ($stmt instanceof Node\Stmt\Namespace_) { - $afterFirstNamespace = true; - } elseif (!$stmt instanceof Node\Stmt\HaltCompiler - && !$stmt instanceof Node\Stmt\Nop - && $afterFirstNamespace && !$hasErrored) { - $this->emitError(new Error( - 'No code may exist outside of namespace {}', $stmt->getAttributes())); - $hasErrored = true; // Avoid one error for every statement - } - } - return $stmts; - } else { - // For semicolon namespaces we have to move the statements after a namespace declaration into ->stmts - $resultStmts = []; - $targetStmts =& $resultStmts; - $lastNs = null; - foreach ($stmts as $stmt) { - if ($stmt instanceof Node\Stmt\Namespace_) { - if ($lastNs !== null) { - $this->fixupNamespaceAttributes($lastNs); - } - if ($stmt->stmts === null) { - $stmt->stmts = []; - $targetStmts =& $stmt->stmts; - $resultStmts[] = $stmt; - } else { - // This handles the invalid case of mixed style namespaces - $resultStmts[] = $stmt; - $targetStmts =& $resultStmts; - } - $lastNs = $stmt; - } elseif ($stmt instanceof Node\Stmt\HaltCompiler) { - // __halt_compiler() is not moved into the namespace - $resultStmts[] = $stmt; - } else { - $targetStmts[] = $stmt; - } - } - if ($lastNs !== null) { - $this->fixupNamespaceAttributes($lastNs); - } - return $resultStmts; - } - } - - private function fixupNamespaceAttributes(Node\Stmt\Namespace_ $stmt) { - // We moved the statements into the namespace node, as such the end of the namespace node - // needs to be extended to the end of the statements. - if (empty($stmt->stmts)) { - return; - } - - // We only move the builtin end attributes here. This is the best we can do with the - // knowledge we have. - $endAttributes = ['endLine', 'endFilePos', 'endTokenPos']; - $lastStmt = $stmt->stmts[count($stmt->stmts) - 1]; - foreach ($endAttributes as $endAttribute) { - if ($lastStmt->hasAttribute($endAttribute)) { - $stmt->setAttribute($endAttribute, $lastStmt->getAttribute($endAttribute)); - } - } - } - - /** - * Determine namespacing style (semicolon or brace) - * - * @param Node[] $stmts Top-level statements. - * - * @return null|string One of "semicolon", "brace" or null (no namespaces) - */ - private function getNamespacingStyle(array $stmts) { - $style = null; - $hasNotAllowedStmts = false; - foreach ($stmts as $i => $stmt) { - if ($stmt instanceof Node\Stmt\Namespace_) { - $currentStyle = null === $stmt->stmts ? 'semicolon' : 'brace'; - if (null === $style) { - $style = $currentStyle; - if ($hasNotAllowedStmts) { - $this->emitError(new Error( - 'Namespace declaration statement has to be the very first statement in the script', - $stmt->getLine() // Avoid marking the entire namespace as an error - )); - } - } elseif ($style !== $currentStyle) { - $this->emitError(new Error( - 'Cannot mix bracketed namespace declarations with unbracketed namespace declarations', - $stmt->getLine() // Avoid marking the entire namespace as an error - )); - // Treat like semicolon style for namespace normalization - return 'semicolon'; - } - continue; - } - - /* declare(), __halt_compiler() and nops can be used before a namespace declaration */ - if ($stmt instanceof Node\Stmt\Declare_ - || $stmt instanceof Node\Stmt\HaltCompiler - || $stmt instanceof Node\Stmt\Nop) { - continue; - } - - /* There may be a hashbang line at the very start of the file */ - if ($i === 0 && $stmt instanceof Node\Stmt\InlineHTML && preg_match('/\A#!.*\r?\n\z/', $stmt->value)) { - continue; - } - - /* Everything else if forbidden before namespace declarations */ - $hasNotAllowedStmts = true; - } - return $style; - } - - /** - * Fix up parsing of static property calls in PHP 5. - * - * In PHP 5 A::$b[c][d] and A::$b[c][d]() have very different interpretation. The former is - * interpreted as (A::$b)[c][d], while the latter is the same as A::{$b[c][d]}(). We parse the - * latter as the former initially and this method fixes the AST into the correct form when we - * encounter the "()". - * - * @param Node\Expr\StaticPropertyFetch|Node\Expr\ArrayDimFetch $prop - * @param Node\Arg[] $args - * @param array $attributes - * - * @return Expr\StaticCall - */ - protected function fixupPhp5StaticPropCall($prop, array $args, array $attributes) : Expr\StaticCall { - if ($prop instanceof Node\Expr\StaticPropertyFetch) { - $name = $prop->name instanceof VarLikeIdentifier - ? $prop->name->toString() : $prop->name; - $var = new Expr\Variable($name, $prop->name->getAttributes()); - return new Expr\StaticCall($prop->class, $var, $args, $attributes); - } elseif ($prop instanceof Node\Expr\ArrayDimFetch) { - $tmp = $prop; - while ($tmp->var instanceof Node\Expr\ArrayDimFetch) { - $tmp = $tmp->var; - } - - /** @var Expr\StaticPropertyFetch $staticProp */ - $staticProp = $tmp->var; - - // Set start attributes to attributes of innermost node - $tmp = $prop; - $this->fixupStartAttributes($tmp, $staticProp->name); - while ($tmp->var instanceof Node\Expr\ArrayDimFetch) { - $tmp = $tmp->var; - $this->fixupStartAttributes($tmp, $staticProp->name); - } - - $name = $staticProp->name instanceof VarLikeIdentifier - ? $staticProp->name->toString() : $staticProp->name; - $tmp->var = new Expr\Variable($name, $staticProp->name->getAttributes()); - return new Expr\StaticCall($staticProp->class, $prop, $args, $attributes); - } else { - throw new \Exception; - } - } - - protected function fixupStartAttributes(Node $to, Node $from) { - $startAttributes = ['startLine', 'startFilePos', 'startTokenPos']; - foreach ($startAttributes as $startAttribute) { - if ($from->hasAttribute($startAttribute)) { - $to->setAttribute($startAttribute, $from->getAttribute($startAttribute)); - } - } - } - - protected function handleBuiltinTypes(Name $name) { - $builtinTypes = [ - 'bool' => true, - 'int' => true, - 'float' => true, - 'string' => true, - 'iterable' => true, - 'void' => true, - 'object' => true, - 'null' => true, - 'false' => true, - 'mixed' => true, - 'never' => true, - 'true' => true, - ]; - - if (!$name->isUnqualified()) { - return $name; - } - - $lowerName = $name->toLowerString(); - if (!isset($builtinTypes[$lowerName])) { - return $name; - } - - return new Node\Identifier($lowerName, $name->getAttributes()); - } - - /** - * Get combined start and end attributes at a stack location - * - * @param int $pos Stack location - * - * @return array Combined start and end attributes - */ - protected function getAttributesAt(int $pos) : array { - return $this->startAttributeStack[$pos] + $this->endAttributeStack[$pos]; - } - - protected function getFloatCastKind(string $cast): int - { - $cast = strtolower($cast); - if (strpos($cast, 'float') !== false) { - return Double::KIND_FLOAT; - } - - if (strpos($cast, 'real') !== false) { - return Double::KIND_REAL; - } - - return Double::KIND_DOUBLE; - } - - protected function parseLNumber($str, $attributes, $allowInvalidOctal = false) { - try { - return LNumber::fromString($str, $attributes, $allowInvalidOctal); - } catch (Error $error) { - $this->emitError($error); - // Use dummy value - return new LNumber(0, $attributes); - } - } - - /** - * Parse a T_NUM_STRING token into either an integer or string node. - * - * @param string $str Number string - * @param array $attributes Attributes - * - * @return LNumber|String_ Integer or string node. - */ - protected function parseNumString(string $str, array $attributes) { - if (!preg_match('/^(?:0|-?[1-9][0-9]*)$/', $str)) { - return new String_($str, $attributes); - } - - $num = +$str; - if (!is_int($num)) { - return new String_($str, $attributes); - } - - return new LNumber($num, $attributes); - } - - protected function stripIndentation( - string $string, int $indentLen, string $indentChar, - bool $newlineAtStart, bool $newlineAtEnd, array $attributes - ) { - if ($indentLen === 0) { - return $string; - } - - $start = $newlineAtStart ? '(?:(?<=\n)|\A)' : '(?<=\n)'; - $end = $newlineAtEnd ? '(?:(?=[\r\n])|\z)' : '(?=[\r\n])'; - $regex = '/' . $start . '([ \t]*)(' . $end . ')?/'; - return preg_replace_callback( - $regex, - function ($matches) use ($indentLen, $indentChar, $attributes) { - $prefix = substr($matches[1], 0, $indentLen); - if (false !== strpos($prefix, $indentChar === " " ? "\t" : " ")) { - $this->emitError(new Error( - 'Invalid indentation - tabs and spaces cannot be mixed', $attributes - )); - } elseif (strlen($prefix) < $indentLen && !isset($matches[2])) { - $this->emitError(new Error( - 'Invalid body indentation level ' . - '(expecting an indentation level of at least ' . $indentLen . ')', - $attributes - )); - } - return substr($matches[0], strlen($prefix)); - }, - $string - ); - } - - protected function parseDocString( - string $startToken, $contents, string $endToken, - array $attributes, array $endTokenAttributes, bool $parseUnicodeEscape - ) { - $kind = strpos($startToken, "'") === false - ? String_::KIND_HEREDOC : String_::KIND_NOWDOC; - - $regex = '/\A[bB]?<<<[ \t]*[\'"]?([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)[\'"]?(?:\r\n|\n|\r)\z/'; - $result = preg_match($regex, $startToken, $matches); - assert($result === 1); - $label = $matches[1]; - - $result = preg_match('/\A[ \t]*/', $endToken, $matches); - assert($result === 1); - $indentation = $matches[0]; - - $attributes['kind'] = $kind; - $attributes['docLabel'] = $label; - $attributes['docIndentation'] = $indentation; - - $indentHasSpaces = false !== strpos($indentation, " "); - $indentHasTabs = false !== strpos($indentation, "\t"); - if ($indentHasSpaces && $indentHasTabs) { - $this->emitError(new Error( - 'Invalid indentation - tabs and spaces cannot be mixed', - $endTokenAttributes - )); - - // Proceed processing as if this doc string is not indented - $indentation = ''; - } - - $indentLen = \strlen($indentation); - $indentChar = $indentHasSpaces ? " " : "\t"; - - if (\is_string($contents)) { - if ($contents === '') { - return new String_('', $attributes); - } - - $contents = $this->stripIndentation( - $contents, $indentLen, $indentChar, true, true, $attributes - ); - $contents = preg_replace('~(\r\n|\n|\r)\z~', '', $contents); - - if ($kind === String_::KIND_HEREDOC) { - $contents = String_::parseEscapeSequences($contents, null, $parseUnicodeEscape); - } - - return new String_($contents, $attributes); - } else { - assert(count($contents) > 0); - if (!$contents[0] instanceof Node\Scalar\EncapsedStringPart) { - // If there is no leading encapsed string part, pretend there is an empty one - $this->stripIndentation( - '', $indentLen, $indentChar, true, false, $contents[0]->getAttributes() - ); - } - - $newContents = []; - foreach ($contents as $i => $part) { - if ($part instanceof Node\Scalar\EncapsedStringPart) { - $isLast = $i === \count($contents) - 1; - $part->value = $this->stripIndentation( - $part->value, $indentLen, $indentChar, - $i === 0, $isLast, $part->getAttributes() - ); - $part->value = String_::parseEscapeSequences($part->value, null, $parseUnicodeEscape); - if ($isLast) { - $part->value = preg_replace('~(\r\n|\n|\r)\z~', '', $part->value); - } - if ('' === $part->value) { - continue; - } - } - $newContents[] = $part; - } - return new Encapsed($newContents, $attributes); - } - } - - /** - * Create attributes for a zero-length common-capturing nop. - * - * @param Comment[] $comments - * @return array - */ - protected function createCommentNopAttributes(array $comments) { - $comment = $comments[count($comments) - 1]; - $commentEndLine = $comment->getEndLine(); - $commentEndFilePos = $comment->getEndFilePos(); - $commentEndTokenPos = $comment->getEndTokenPos(); - - $attributes = ['comments' => $comments]; - if (-1 !== $commentEndLine) { - $attributes['startLine'] = $commentEndLine; - $attributes['endLine'] = $commentEndLine; - } - if (-1 !== $commentEndFilePos) { - $attributes['startFilePos'] = $commentEndFilePos + 1; - $attributes['endFilePos'] = $commentEndFilePos; - } - if (-1 !== $commentEndTokenPos) { - $attributes['startTokenPos'] = $commentEndTokenPos + 1; - $attributes['endTokenPos'] = $commentEndTokenPos; - } - return $attributes; - } - - protected function checkClassModifier($a, $b, $modifierPos) { - try { - Class_::verifyClassModifier($a, $b); - } catch (Error $error) { - $error->setAttributes($this->getAttributesAt($modifierPos)); - $this->emitError($error); - } - } - - protected function checkModifier($a, $b, $modifierPos) { - // Jumping through some hoops here because verifyModifier() is also used elsewhere - try { - Class_::verifyModifier($a, $b); - } catch (Error $error) { - $error->setAttributes($this->getAttributesAt($modifierPos)); - $this->emitError($error); - } - } - - protected function checkParam(Param $node) { - if ($node->variadic && null !== $node->default) { - $this->emitError(new Error( - 'Variadic parameter cannot have a default value', - $node->default->getAttributes() - )); - } - } - - protected function checkTryCatch(TryCatch $node) { - if (empty($node->catches) && null === $node->finally) { - $this->emitError(new Error( - 'Cannot use try without catch or finally', $node->getAttributes() - )); - } - } - - protected function checkNamespace(Namespace_ $node) { - if (null !== $node->stmts) { - foreach ($node->stmts as $stmt) { - if ($stmt instanceof Namespace_) { - $this->emitError(new Error( - 'Namespace declarations cannot be nested', $stmt->getAttributes() - )); - } - } - } - } - - private function checkClassName($name, $namePos) { - if (null !== $name && $name->isSpecialClassName()) { - $this->emitError(new Error( - sprintf('Cannot use \'%s\' as class name as it is reserved', $name), - $this->getAttributesAt($namePos) - )); - } - } - - private function checkImplementedInterfaces(array $interfaces) { - foreach ($interfaces as $interface) { - if ($interface->isSpecialClassName()) { - $this->emitError(new Error( - sprintf('Cannot use \'%s\' as interface name as it is reserved', $interface), - $interface->getAttributes() - )); - } - } - } - - protected function checkClass(Class_ $node, $namePos) { - $this->checkClassName($node->name, $namePos); - - if ($node->extends && $node->extends->isSpecialClassName()) { - $this->emitError(new Error( - sprintf('Cannot use \'%s\' as class name as it is reserved', $node->extends), - $node->extends->getAttributes() - )); - } - - $this->checkImplementedInterfaces($node->implements); - } - - protected function checkInterface(Interface_ $node, $namePos) { - $this->checkClassName($node->name, $namePos); - $this->checkImplementedInterfaces($node->extends); - } - - protected function checkEnum(Enum_ $node, $namePos) { - $this->checkClassName($node->name, $namePos); - $this->checkImplementedInterfaces($node->implements); - } - - protected function checkClassMethod(ClassMethod $node, $modifierPos) { - if ($node->flags & Class_::MODIFIER_STATIC) { - switch ($node->name->toLowerString()) { - case '__construct': - $this->emitError(new Error( - sprintf('Constructor %s() cannot be static', $node->name), - $this->getAttributesAt($modifierPos))); - break; - case '__destruct': - $this->emitError(new Error( - sprintf('Destructor %s() cannot be static', $node->name), - $this->getAttributesAt($modifierPos))); - break; - case '__clone': - $this->emitError(new Error( - sprintf('Clone method %s() cannot be static', $node->name), - $this->getAttributesAt($modifierPos))); - break; - } - } - - if ($node->flags & Class_::MODIFIER_READONLY) { - $this->emitError(new Error( - sprintf('Method %s() cannot be readonly', $node->name), - $this->getAttributesAt($modifierPos))); - } - } - - protected function checkClassConst(ClassConst $node, $modifierPos) { - if ($node->flags & Class_::MODIFIER_STATIC) { - $this->emitError(new Error( - "Cannot use 'static' as constant modifier", - $this->getAttributesAt($modifierPos))); - } - if ($node->flags & Class_::MODIFIER_ABSTRACT) { - $this->emitError(new Error( - "Cannot use 'abstract' as constant modifier", - $this->getAttributesAt($modifierPos))); - } - if ($node->flags & Class_::MODIFIER_READONLY) { - $this->emitError(new Error( - "Cannot use 'readonly' as constant modifier", - $this->getAttributesAt($modifierPos))); - } - } - - protected function checkProperty(Property $node, $modifierPos) { - if ($node->flags & Class_::MODIFIER_ABSTRACT) { - $this->emitError(new Error('Properties cannot be declared abstract', - $this->getAttributesAt($modifierPos))); - } - - if ($node->flags & Class_::MODIFIER_FINAL) { - $this->emitError(new Error('Properties cannot be declared final', - $this->getAttributesAt($modifierPos))); - } - } - - protected function checkUseUse(UseUse $node, $namePos) { - if ($node->alias && $node->alias->isSpecialClassName()) { - $this->emitError(new Error( - sprintf( - 'Cannot use %s as %s because \'%2$s\' is a special class name', - $node->name, $node->alias - ), - $this->getAttributesAt($namePos) - )); - } - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/ParserFactory.php b/vendor/nikic/php-parser/lib/PhpParser/ParserFactory.php deleted file mode 100644 index f041e7ff..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/ParserFactory.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser; - -class ParserFactory -{ - const PREFER_PHP7 = 1; - const PREFER_PHP5 = 2; - const ONLY_PHP7 = 3; - const ONLY_PHP5 = 4; - - /** - * Creates a Parser instance, according to the provided kind. - * - * @param int $kind One of ::PREFER_PHP7, ::PREFER_PHP5, ::ONLY_PHP7 or ::ONLY_PHP5 - * @param Lexer|null $lexer Lexer to use. Defaults to emulative lexer when not specified - * @param array $parserOptions Parser options. See ParserAbstract::__construct() argument - * - * @return Parser The parser instance - */ - public function create(int $kind, Lexer $lexer = null, array $parserOptions = []) : Parser { - if (null === $lexer) { - $lexer = new Lexer\Emulative(); - } - switch ($kind) { - case self::PREFER_PHP7: - return new Parser\Multiple([ - new Parser\Php7($lexer, $parserOptions), new Parser\Php5($lexer, $parserOptions) - ]); - case self::PREFER_PHP5: - return new Parser\Multiple([ - new Parser\Php5($lexer, $parserOptions), new Parser\Php7($lexer, $parserOptions) - ]); - case self::ONLY_PHP7: - return new Parser\Php7($lexer, $parserOptions); - case self::ONLY_PHP5: - return new Parser\Php5($lexer, $parserOptions); - default: - throw new \LogicException( - 'Kind must be one of ::PREFER_PHP7, ::PREFER_PHP5, ::ONLY_PHP7 or ::ONLY_PHP5' - ); - } - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php b/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php deleted file mode 100644 index c256e897..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php +++ /dev/null @@ -1,1113 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser\PrettyPrinter; - -use PhpParser\Node; -use PhpParser\Node\Expr; -use PhpParser\Node\Expr\AssignOp; -use PhpParser\Node\Expr\BinaryOp; -use PhpParser\Node\Expr\Cast; -use PhpParser\Node\Name; -use PhpParser\Node\Scalar; -use PhpParser\Node\Scalar\MagicConst; -use PhpParser\Node\Stmt; -use PhpParser\PrettyPrinterAbstract; - -class Standard extends PrettyPrinterAbstract -{ - // Special nodes - - protected function pParam(Node\Param $node) { - return $this->pAttrGroups($node->attrGroups, true) - . $this->pModifiers($node->flags) - . ($node->type ? $this->p($node->type) . ' ' : '') - . ($node->byRef ? '&' : '') - . ($node->variadic ? '...' : '') - . $this->p($node->var) - . ($node->default ? ' = ' . $this->p($node->default) : ''); - } - - protected function pArg(Node\Arg $node) { - return ($node->name ? $node->name->toString() . ': ' : '') - . ($node->byRef ? '&' : '') . ($node->unpack ? '...' : '') - . $this->p($node->value); - } - - protected function pVariadicPlaceholder(Node\VariadicPlaceholder $node) { - return '...'; - } - - protected function pConst(Node\Const_ $node) { - return $node->name . ' = ' . $this->p($node->value); - } - - protected function pNullableType(Node\NullableType $node) { - return '?' . $this->p($node->type); - } - - protected function pUnionType(Node\UnionType $node) { - $types = []; - foreach ($node->types as $typeNode) { - if ($typeNode instanceof Node\IntersectionType) { - $types[] = '('. $this->p($typeNode) . ')'; - continue; - } - $types[] = $this->p($typeNode); - } - return implode('|', $types); - } - - protected function pIntersectionType(Node\IntersectionType $node) { - return $this->pImplode($node->types, '&'); - } - - protected function pIdentifier(Node\Identifier $node) { - return $node->name; - } - - protected function pVarLikeIdentifier(Node\VarLikeIdentifier $node) { - return '$' . $node->name; - } - - protected function pAttribute(Node\Attribute $node) { - return $this->p($node->name) - . ($node->args ? '(' . $this->pCommaSeparated($node->args) . ')' : ''); - } - - protected function pAttributeGroup(Node\AttributeGroup $node) { - return '#[' . $this->pCommaSeparated($node->attrs) . ']'; - } - - // Names - - protected function pName(Name $node) { - return implode('\\', $node->parts); - } - - protected function pName_FullyQualified(Name\FullyQualified $node) { - return '\\' . implode('\\', $node->parts); - } - - protected function pName_Relative(Name\Relative $node) { - return 'namespace\\' . implode('\\', $node->parts); - } - - // Magic Constants - - protected function pScalar_MagicConst_Class(MagicConst\Class_ $node) { - return '__CLASS__'; - } - - protected function pScalar_MagicConst_Dir(MagicConst\Dir $node) { - return '__DIR__'; - } - - protected function pScalar_MagicConst_File(MagicConst\File $node) { - return '__FILE__'; - } - - protected function pScalar_MagicConst_Function(MagicConst\Function_ $node) { - return '__FUNCTION__'; - } - - protected function pScalar_MagicConst_Line(MagicConst\Line $node) { - return '__LINE__'; - } - - protected function pScalar_MagicConst_Method(MagicConst\Method $node) { - return '__METHOD__'; - } - - protected function pScalar_MagicConst_Namespace(MagicConst\Namespace_ $node) { - return '__NAMESPACE__'; - } - - protected function pScalar_MagicConst_Trait(MagicConst\Trait_ $node) { - return '__TRAIT__'; - } - - // Scalars - - protected function pScalar_String(Scalar\String_ $node) { - $kind = $node->getAttribute('kind', Scalar\String_::KIND_SINGLE_QUOTED); - switch ($kind) { - case Scalar\String_::KIND_NOWDOC: - $label = $node->getAttribute('docLabel'); - if ($label && !$this->containsEndLabel($node->value, $label)) { - if ($node->value === '') { - return "<<<'$label'\n$label" . $this->docStringEndToken; - } - - return "<<<'$label'\n$node->value\n$label" - . $this->docStringEndToken; - } - /* break missing intentionally */ - case Scalar\String_::KIND_SINGLE_QUOTED: - return $this->pSingleQuotedString($node->value); - case Scalar\String_::KIND_HEREDOC: - $label = $node->getAttribute('docLabel'); - if ($label && !$this->containsEndLabel($node->value, $label)) { - if ($node->value === '') { - return "<<<$label\n$label" . $this->docStringEndToken; - } - - $escaped = $this->escapeString($node->value, null); - return "<<<$label\n" . $escaped . "\n$label" - . $this->docStringEndToken; - } - /* break missing intentionally */ - case Scalar\String_::KIND_DOUBLE_QUOTED: - return '"' . $this->escapeString($node->value, '"') . '"'; - } - throw new \Exception('Invalid string kind'); - } - - protected function pScalar_Encapsed(Scalar\Encapsed $node) { - if ($node->getAttribute('kind') === Scalar\String_::KIND_HEREDOC) { - $label = $node->getAttribute('docLabel'); - if ($label && !$this->encapsedContainsEndLabel($node->parts, $label)) { - if (count($node->parts) === 1 - && $node->parts[0] instanceof Scalar\EncapsedStringPart - && $node->parts[0]->value === '' - ) { - return "<<<$label\n$label" . $this->docStringEndToken; - } - - return "<<<$label\n" . $this->pEncapsList($node->parts, null) . "\n$label" - . $this->docStringEndToken; - } - } - return '"' . $this->pEncapsList($node->parts, '"') . '"'; - } - - protected function pScalar_LNumber(Scalar\LNumber $node) { - if ($node->value === -\PHP_INT_MAX-1) { - // PHP_INT_MIN cannot be represented as a literal, - // because the sign is not part of the literal - return '(-' . \PHP_INT_MAX . '-1)'; - } - - $kind = $node->getAttribute('kind', Scalar\LNumber::KIND_DEC); - if (Scalar\LNumber::KIND_DEC === $kind) { - return (string) $node->value; - } - - if ($node->value < 0) { - $sign = '-'; - $str = (string) -$node->value; - } else { - $sign = ''; - $str = (string) $node->value; - } - switch ($kind) { - case Scalar\LNumber::KIND_BIN: - return $sign . '0b' . base_convert($str, 10, 2); - case Scalar\LNumber::KIND_OCT: - return $sign . '0' . base_convert($str, 10, 8); - case Scalar\LNumber::KIND_HEX: - return $sign . '0x' . base_convert($str, 10, 16); - } - throw new \Exception('Invalid number kind'); - } - - protected function pScalar_DNumber(Scalar\DNumber $node) { - if (!is_finite($node->value)) { - if ($node->value === \INF) { - return '\INF'; - } elseif ($node->value === -\INF) { - return '-\INF'; - } else { - return '\NAN'; - } - } - - // Try to find a short full-precision representation - $stringValue = sprintf('%.16G', $node->value); - if ($node->value !== (double) $stringValue) { - $stringValue = sprintf('%.17G', $node->value); - } - - // %G is locale dependent and there exists no locale-independent alternative. We don't want - // mess with switching locales here, so let's assume that a comma is the only non-standard - // decimal separator we may encounter... - $stringValue = str_replace(',', '.', $stringValue); - - // ensure that number is really printed as float - return preg_match('/^-?[0-9]+$/', $stringValue) ? $stringValue . '.0' : $stringValue; - } - - protected function pScalar_EncapsedStringPart(Scalar\EncapsedStringPart $node) { - throw new \LogicException('Cannot directly print EncapsedStringPart'); - } - - // Assignments - - protected function pExpr_Assign(Expr\Assign $node) { - return $this->pInfixOp(Expr\Assign::class, $node->var, ' = ', $node->expr); - } - - protected function pExpr_AssignRef(Expr\AssignRef $node) { - return $this->pInfixOp(Expr\AssignRef::class, $node->var, ' =& ', $node->expr); - } - - protected function pExpr_AssignOp_Plus(AssignOp\Plus $node) { - return $this->pInfixOp(AssignOp\Plus::class, $node->var, ' += ', $node->expr); - } - - protected function pExpr_AssignOp_Minus(AssignOp\Minus $node) { - return $this->pInfixOp(AssignOp\Minus::class, $node->var, ' -= ', $node->expr); - } - - protected function pExpr_AssignOp_Mul(AssignOp\Mul $node) { - return $this->pInfixOp(AssignOp\Mul::class, $node->var, ' *= ', $node->expr); - } - - protected function pExpr_AssignOp_Div(AssignOp\Div $node) { - return $this->pInfixOp(AssignOp\Div::class, $node->var, ' /= ', $node->expr); - } - - protected function pExpr_AssignOp_Concat(AssignOp\Concat $node) { - return $this->pInfixOp(AssignOp\Concat::class, $node->var, ' .= ', $node->expr); - } - - protected function pExpr_AssignOp_Mod(AssignOp\Mod $node) { - return $this->pInfixOp(AssignOp\Mod::class, $node->var, ' %= ', $node->expr); - } - - protected function pExpr_AssignOp_BitwiseAnd(AssignOp\BitwiseAnd $node) { - return $this->pInfixOp(AssignOp\BitwiseAnd::class, $node->var, ' &= ', $node->expr); - } - - protected function pExpr_AssignOp_BitwiseOr(AssignOp\BitwiseOr $node) { - return $this->pInfixOp(AssignOp\BitwiseOr::class, $node->var, ' |= ', $node->expr); - } - - protected function pExpr_AssignOp_BitwiseXor(AssignOp\BitwiseXor $node) { - return $this->pInfixOp(AssignOp\BitwiseXor::class, $node->var, ' ^= ', $node->expr); - } - - protected function pExpr_AssignOp_ShiftLeft(AssignOp\ShiftLeft $node) { - return $this->pInfixOp(AssignOp\ShiftLeft::class, $node->var, ' <<= ', $node->expr); - } - - protected function pExpr_AssignOp_ShiftRight(AssignOp\ShiftRight $node) { - return $this->pInfixOp(AssignOp\ShiftRight::class, $node->var, ' >>= ', $node->expr); - } - - protected function pExpr_AssignOp_Pow(AssignOp\Pow $node) { - return $this->pInfixOp(AssignOp\Pow::class, $node->var, ' **= ', $node->expr); - } - - protected function pExpr_AssignOp_Coalesce(AssignOp\Coalesce $node) { - return $this->pInfixOp(AssignOp\Coalesce::class, $node->var, ' ??= ', $node->expr); - } - - // Binary expressions - - protected function pExpr_BinaryOp_Plus(BinaryOp\Plus $node) { - return $this->pInfixOp(BinaryOp\Plus::class, $node->left, ' + ', $node->right); - } - - protected function pExpr_BinaryOp_Minus(BinaryOp\Minus $node) { - return $this->pInfixOp(BinaryOp\Minus::class, $node->left, ' - ', $node->right); - } - - protected function pExpr_BinaryOp_Mul(BinaryOp\Mul $node) { - return $this->pInfixOp(BinaryOp\Mul::class, $node->left, ' * ', $node->right); - } - - protected function pExpr_BinaryOp_Div(BinaryOp\Div $node) { - return $this->pInfixOp(BinaryOp\Div::class, $node->left, ' / ', $node->right); - } - - protected function pExpr_BinaryOp_Concat(BinaryOp\Concat $node) { - return $this->pInfixOp(BinaryOp\Concat::class, $node->left, ' . ', $node->right); - } - - protected function pExpr_BinaryOp_Mod(BinaryOp\Mod $node) { - return $this->pInfixOp(BinaryOp\Mod::class, $node->left, ' % ', $node->right); - } - - protected function pExpr_BinaryOp_BooleanAnd(BinaryOp\BooleanAnd $node) { - return $this->pInfixOp(BinaryOp\BooleanAnd::class, $node->left, ' && ', $node->right); - } - - protected function pExpr_BinaryOp_BooleanOr(BinaryOp\BooleanOr $node) { - return $this->pInfixOp(BinaryOp\BooleanOr::class, $node->left, ' || ', $node->right); - } - - protected function pExpr_BinaryOp_BitwiseAnd(BinaryOp\BitwiseAnd $node) { - return $this->pInfixOp(BinaryOp\BitwiseAnd::class, $node->left, ' & ', $node->right); - } - - protected function pExpr_BinaryOp_BitwiseOr(BinaryOp\BitwiseOr $node) { - return $this->pInfixOp(BinaryOp\BitwiseOr::class, $node->left, ' | ', $node->right); - } - - protected function pExpr_BinaryOp_BitwiseXor(BinaryOp\BitwiseXor $node) { - return $this->pInfixOp(BinaryOp\BitwiseXor::class, $node->left, ' ^ ', $node->right); - } - - protected function pExpr_BinaryOp_ShiftLeft(BinaryOp\ShiftLeft $node) { - return $this->pInfixOp(BinaryOp\ShiftLeft::class, $node->left, ' << ', $node->right); - } - - protected function pExpr_BinaryOp_ShiftRight(BinaryOp\ShiftRight $node) { - return $this->pInfixOp(BinaryOp\ShiftRight::class, $node->left, ' >> ', $node->right); - } - - protected function pExpr_BinaryOp_Pow(BinaryOp\Pow $node) { - return $this->pInfixOp(BinaryOp\Pow::class, $node->left, ' ** ', $node->right); - } - - protected function pExpr_BinaryOp_LogicalAnd(BinaryOp\LogicalAnd $node) { - return $this->pInfixOp(BinaryOp\LogicalAnd::class, $node->left, ' and ', $node->right); - } - - protected function pExpr_BinaryOp_LogicalOr(BinaryOp\LogicalOr $node) { - return $this->pInfixOp(BinaryOp\LogicalOr::class, $node->left, ' or ', $node->right); - } - - protected function pExpr_BinaryOp_LogicalXor(BinaryOp\LogicalXor $node) { - return $this->pInfixOp(BinaryOp\LogicalXor::class, $node->left, ' xor ', $node->right); - } - - protected function pExpr_BinaryOp_Equal(BinaryOp\Equal $node) { - return $this->pInfixOp(BinaryOp\Equal::class, $node->left, ' == ', $node->right); - } - - protected function pExpr_BinaryOp_NotEqual(BinaryOp\NotEqual $node) { - return $this->pInfixOp(BinaryOp\NotEqual::class, $node->left, ' != ', $node->right); - } - - protected function pExpr_BinaryOp_Identical(BinaryOp\Identical $node) { - return $this->pInfixOp(BinaryOp\Identical::class, $node->left, ' === ', $node->right); - } - - protected function pExpr_BinaryOp_NotIdentical(BinaryOp\NotIdentical $node) { - return $this->pInfixOp(BinaryOp\NotIdentical::class, $node->left, ' !== ', $node->right); - } - - protected function pExpr_BinaryOp_Spaceship(BinaryOp\Spaceship $node) { - return $this->pInfixOp(BinaryOp\Spaceship::class, $node->left, ' <=> ', $node->right); - } - - protected function pExpr_BinaryOp_Greater(BinaryOp\Greater $node) { - return $this->pInfixOp(BinaryOp\Greater::class, $node->left, ' > ', $node->right); - } - - protected function pExpr_BinaryOp_GreaterOrEqual(BinaryOp\GreaterOrEqual $node) { - return $this->pInfixOp(BinaryOp\GreaterOrEqual::class, $node->left, ' >= ', $node->right); - } - - protected function pExpr_BinaryOp_Smaller(BinaryOp\Smaller $node) { - return $this->pInfixOp(BinaryOp\Smaller::class, $node->left, ' < ', $node->right); - } - - protected function pExpr_BinaryOp_SmallerOrEqual(BinaryOp\SmallerOrEqual $node) { - return $this->pInfixOp(BinaryOp\SmallerOrEqual::class, $node->left, ' <= ', $node->right); - } - - protected function pExpr_BinaryOp_Coalesce(BinaryOp\Coalesce $node) { - return $this->pInfixOp(BinaryOp\Coalesce::class, $node->left, ' ?? ', $node->right); - } - - protected function pExpr_Instanceof(Expr\Instanceof_ $node) { - list($precedence, $associativity) = $this->precedenceMap[Expr\Instanceof_::class]; - return $this->pPrec($node->expr, $precedence, $associativity, -1) - . ' instanceof ' - . $this->pNewVariable($node->class); - } - - // Unary expressions - - protected function pExpr_BooleanNot(Expr\BooleanNot $node) { - return $this->pPrefixOp(Expr\BooleanNot::class, '!', $node->expr); - } - - protected function pExpr_BitwiseNot(Expr\BitwiseNot $node) { - return $this->pPrefixOp(Expr\BitwiseNot::class, '~', $node->expr); - } - - protected function pExpr_UnaryMinus(Expr\UnaryMinus $node) { - if ($node->expr instanceof Expr\UnaryMinus || $node->expr instanceof Expr\PreDec) { - // Enforce -(-$expr) instead of --$expr - return '-(' . $this->p($node->expr) . ')'; - } - return $this->pPrefixOp(Expr\UnaryMinus::class, '-', $node->expr); - } - - protected function pExpr_UnaryPlus(Expr\UnaryPlus $node) { - if ($node->expr instanceof Expr\UnaryPlus || $node->expr instanceof Expr\PreInc) { - // Enforce +(+$expr) instead of ++$expr - return '+(' . $this->p($node->expr) . ')'; - } - return $this->pPrefixOp(Expr\UnaryPlus::class, '+', $node->expr); - } - - protected function pExpr_PreInc(Expr\PreInc $node) { - return $this->pPrefixOp(Expr\PreInc::class, '++', $node->var); - } - - protected function pExpr_PreDec(Expr\PreDec $node) { - return $this->pPrefixOp(Expr\PreDec::class, '--', $node->var); - } - - protected function pExpr_PostInc(Expr\PostInc $node) { - return $this->pPostfixOp(Expr\PostInc::class, $node->var, '++'); - } - - protected function pExpr_PostDec(Expr\PostDec $node) { - return $this->pPostfixOp(Expr\PostDec::class, $node->var, '--'); - } - - protected function pExpr_ErrorSuppress(Expr\ErrorSuppress $node) { - return $this->pPrefixOp(Expr\ErrorSuppress::class, '@', $node->expr); - } - - protected function pExpr_YieldFrom(Expr\YieldFrom $node) { - return $this->pPrefixOp(Expr\YieldFrom::class, 'yield from ', $node->expr); - } - - protected function pExpr_Print(Expr\Print_ $node) { - return $this->pPrefixOp(Expr\Print_::class, 'print ', $node->expr); - } - - // Casts - - protected function pExpr_Cast_Int(Cast\Int_ $node) { - return $this->pPrefixOp(Cast\Int_::class, '(int) ', $node->expr); - } - - protected function pExpr_Cast_Double(Cast\Double $node) { - $kind = $node->getAttribute('kind', Cast\Double::KIND_DOUBLE); - if ($kind === Cast\Double::KIND_DOUBLE) { - $cast = '(double)'; - } elseif ($kind === Cast\Double::KIND_FLOAT) { - $cast = '(float)'; - } elseif ($kind === Cast\Double::KIND_REAL) { - $cast = '(real)'; - } - return $this->pPrefixOp(Cast\Double::class, $cast . ' ', $node->expr); - } - - protected function pExpr_Cast_String(Cast\String_ $node) { - return $this->pPrefixOp(Cast\String_::class, '(string) ', $node->expr); - } - - protected function pExpr_Cast_Array(Cast\Array_ $node) { - return $this->pPrefixOp(Cast\Array_::class, '(array) ', $node->expr); - } - - protected function pExpr_Cast_Object(Cast\Object_ $node) { - return $this->pPrefixOp(Cast\Object_::class, '(object) ', $node->expr); - } - - protected function pExpr_Cast_Bool(Cast\Bool_ $node) { - return $this->pPrefixOp(Cast\Bool_::class, '(bool) ', $node->expr); - } - - protected function pExpr_Cast_Unset(Cast\Unset_ $node) { - return $this->pPrefixOp(Cast\Unset_::class, '(unset) ', $node->expr); - } - - // Function calls and similar constructs - - protected function pExpr_FuncCall(Expr\FuncCall $node) { - return $this->pCallLhs($node->name) - . '(' . $this->pMaybeMultiline($node->args) . ')'; - } - - protected function pExpr_MethodCall(Expr\MethodCall $node) { - return $this->pDereferenceLhs($node->var) . '->' . $this->pObjectProperty($node->name) - . '(' . $this->pMaybeMultiline($node->args) . ')'; - } - - protected function pExpr_NullsafeMethodCall(Expr\NullsafeMethodCall $node) { - return $this->pDereferenceLhs($node->var) . '?->' . $this->pObjectProperty($node->name) - . '(' . $this->pMaybeMultiline($node->args) . ')'; - } - - protected function pExpr_StaticCall(Expr\StaticCall $node) { - return $this->pDereferenceLhs($node->class) . '::' - . ($node->name instanceof Expr - ? ($node->name instanceof Expr\Variable - ? $this->p($node->name) - : '{' . $this->p($node->name) . '}') - : $node->name) - . '(' . $this->pMaybeMultiline($node->args) . ')'; - } - - protected function pExpr_Empty(Expr\Empty_ $node) { - return 'empty(' . $this->p($node->expr) . ')'; - } - - protected function pExpr_Isset(Expr\Isset_ $node) { - return 'isset(' . $this->pCommaSeparated($node->vars) . ')'; - } - - protected function pExpr_Eval(Expr\Eval_ $node) { - return 'eval(' . $this->p($node->expr) . ')'; - } - - protected function pExpr_Include(Expr\Include_ $node) { - static $map = [ - Expr\Include_::TYPE_INCLUDE => 'include', - Expr\Include_::TYPE_INCLUDE_ONCE => 'include_once', - Expr\Include_::TYPE_REQUIRE => 'require', - Expr\Include_::TYPE_REQUIRE_ONCE => 'require_once', - ]; - - return $map[$node->type] . ' ' . $this->p($node->expr); - } - - protected function pExpr_List(Expr\List_ $node) { - return 'list(' . $this->pCommaSeparated($node->items) . ')'; - } - - // Other - - protected function pExpr_Error(Expr\Error $node) { - throw new \LogicException('Cannot pretty-print AST with Error nodes'); - } - - protected function pExpr_Variable(Expr\Variable $node) { - if ($node->name instanceof Expr) { - return '${' . $this->p($node->name) . '}'; - } else { - return '$' . $node->name; - } - } - - protected function pExpr_Array(Expr\Array_ $node) { - $syntax = $node->getAttribute('kind', - $this->options['shortArraySyntax'] ? Expr\Array_::KIND_SHORT : Expr\Array_::KIND_LONG); - if ($syntax === Expr\Array_::KIND_SHORT) { - return '[' . $this->pMaybeMultiline($node->items, true) . ']'; - } else { - return 'array(' . $this->pMaybeMultiline($node->items, true) . ')'; - } - } - - protected function pExpr_ArrayItem(Expr\ArrayItem $node) { - return (null !== $node->key ? $this->p($node->key) . ' => ' : '') - . ($node->byRef ? '&' : '') - . ($node->unpack ? '...' : '') - . $this->p($node->value); - } - - protected function pExpr_ArrayDimFetch(Expr\ArrayDimFetch $node) { - return $this->pDereferenceLhs($node->var) - . '[' . (null !== $node->dim ? $this->p($node->dim) : '') . ']'; - } - - protected function pExpr_ConstFetch(Expr\ConstFetch $node) { - return $this->p($node->name); - } - - protected function pExpr_ClassConstFetch(Expr\ClassConstFetch $node) { - return $this->pDereferenceLhs($node->class) . '::' . $this->p($node->name); - } - - protected function pExpr_PropertyFetch(Expr\PropertyFetch $node) { - return $this->pDereferenceLhs($node->var) . '->' . $this->pObjectProperty($node->name); - } - - protected function pExpr_NullsafePropertyFetch(Expr\NullsafePropertyFetch $node) { - return $this->pDereferenceLhs($node->var) . '?->' . $this->pObjectProperty($node->name); - } - - protected function pExpr_StaticPropertyFetch(Expr\StaticPropertyFetch $node) { - return $this->pDereferenceLhs($node->class) . '::$' . $this->pObjectProperty($node->name); - } - - protected function pExpr_ShellExec(Expr\ShellExec $node) { - return '`' . $this->pEncapsList($node->parts, '`') . '`'; - } - - protected function pExpr_Closure(Expr\Closure $node) { - return $this->pAttrGroups($node->attrGroups, true) - . ($node->static ? 'static ' : '') - . 'function ' . ($node->byRef ? '&' : '') - . '(' . $this->pCommaSeparated($node->params) . ')' - . (!empty($node->uses) ? ' use(' . $this->pCommaSeparated($node->uses) . ')' : '') - . (null !== $node->returnType ? ' : ' . $this->p($node->returnType) : '') - . ' {' . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pExpr_Match(Expr\Match_ $node) { - return 'match (' . $this->p($node->cond) . ') {' - . $this->pCommaSeparatedMultiline($node->arms, true) - . $this->nl - . '}'; - } - - protected function pMatchArm(Node\MatchArm $node) { - return ($node->conds ? $this->pCommaSeparated($node->conds) : 'default') - . ' => ' . $this->p($node->body); - } - - protected function pExpr_ArrowFunction(Expr\ArrowFunction $node) { - return $this->pAttrGroups($node->attrGroups, true) - . ($node->static ? 'static ' : '') - . 'fn' . ($node->byRef ? '&' : '') - . '(' . $this->pCommaSeparated($node->params) . ')' - . (null !== $node->returnType ? ': ' . $this->p($node->returnType) : '') - . ' => ' - . $this->p($node->expr); - } - - protected function pExpr_ClosureUse(Expr\ClosureUse $node) { - return ($node->byRef ? '&' : '') . $this->p($node->var); - } - - protected function pExpr_New(Expr\New_ $node) { - if ($node->class instanceof Stmt\Class_) { - $args = $node->args ? '(' . $this->pMaybeMultiline($node->args) . ')' : ''; - return 'new ' . $this->pClassCommon($node->class, $args); - } - return 'new ' . $this->pNewVariable($node->class) - . '(' . $this->pMaybeMultiline($node->args) . ')'; - } - - protected function pExpr_Clone(Expr\Clone_ $node) { - return 'clone ' . $this->p($node->expr); - } - - protected function pExpr_Ternary(Expr\Ternary $node) { - // a bit of cheating: we treat the ternary as a binary op where the ?...: part is the operator. - // this is okay because the part between ? and : never needs parentheses. - return $this->pInfixOp(Expr\Ternary::class, - $node->cond, ' ?' . (null !== $node->if ? ' ' . $this->p($node->if) . ' ' : '') . ': ', $node->else - ); - } - - protected function pExpr_Exit(Expr\Exit_ $node) { - $kind = $node->getAttribute('kind', Expr\Exit_::KIND_DIE); - return ($kind === Expr\Exit_::KIND_EXIT ? 'exit' : 'die') - . (null !== $node->expr ? '(' . $this->p($node->expr) . ')' : ''); - } - - protected function pExpr_Throw(Expr\Throw_ $node) { - return 'throw ' . $this->p($node->expr); - } - - protected function pExpr_Yield(Expr\Yield_ $node) { - if ($node->value === null) { - return 'yield'; - } else { - // this is a bit ugly, but currently there is no way to detect whether the parentheses are necessary - return '(yield ' - . ($node->key !== null ? $this->p($node->key) . ' => ' : '') - . $this->p($node->value) - . ')'; - } - } - - // Declarations - - protected function pStmt_Namespace(Stmt\Namespace_ $node) { - if ($this->canUseSemicolonNamespaces) { - return 'namespace ' . $this->p($node->name) . ';' - . $this->nl . $this->pStmts($node->stmts, false); - } else { - return 'namespace' . (null !== $node->name ? ' ' . $this->p($node->name) : '') - . ' {' . $this->pStmts($node->stmts) . $this->nl . '}'; - } - } - - protected function pStmt_Use(Stmt\Use_ $node) { - return 'use ' . $this->pUseType($node->type) - . $this->pCommaSeparated($node->uses) . ';'; - } - - protected function pStmt_GroupUse(Stmt\GroupUse $node) { - return 'use ' . $this->pUseType($node->type) . $this->pName($node->prefix) - . '\{' . $this->pCommaSeparated($node->uses) . '};'; - } - - protected function pStmt_UseUse(Stmt\UseUse $node) { - return $this->pUseType($node->type) . $this->p($node->name) - . (null !== $node->alias ? ' as ' . $node->alias : ''); - } - - protected function pUseType($type) { - return $type === Stmt\Use_::TYPE_FUNCTION ? 'function ' - : ($type === Stmt\Use_::TYPE_CONSTANT ? 'const ' : ''); - } - - protected function pStmt_Interface(Stmt\Interface_ $node) { - return $this->pAttrGroups($node->attrGroups) - . 'interface ' . $node->name - . (!empty($node->extends) ? ' extends ' . $this->pCommaSeparated($node->extends) : '') - . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pStmt_Enum(Stmt\Enum_ $node) { - return $this->pAttrGroups($node->attrGroups) - . 'enum ' . $node->name - . ($node->scalarType ? " : $node->scalarType" : '') - . (!empty($node->implements) ? ' implements ' . $this->pCommaSeparated($node->implements) : '') - . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pStmt_Class(Stmt\Class_ $node) { - return $this->pClassCommon($node, ' ' . $node->name); - } - - protected function pStmt_Trait(Stmt\Trait_ $node) { - return $this->pAttrGroups($node->attrGroups) - . 'trait ' . $node->name - . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pStmt_EnumCase(Stmt\EnumCase $node) { - return $this->pAttrGroups($node->attrGroups) - . 'case ' . $node->name - . ($node->expr ? ' = ' . $this->p($node->expr) : '') - . ';'; - } - - protected function pStmt_TraitUse(Stmt\TraitUse $node) { - return 'use ' . $this->pCommaSeparated($node->traits) - . (empty($node->adaptations) - ? ';' - : ' {' . $this->pStmts($node->adaptations) . $this->nl . '}'); - } - - protected function pStmt_TraitUseAdaptation_Precedence(Stmt\TraitUseAdaptation\Precedence $node) { - return $this->p($node->trait) . '::' . $node->method - . ' insteadof ' . $this->pCommaSeparated($node->insteadof) . ';'; - } - - protected function pStmt_TraitUseAdaptation_Alias(Stmt\TraitUseAdaptation\Alias $node) { - return (null !== $node->trait ? $this->p($node->trait) . '::' : '') - . $node->method . ' as' - . (null !== $node->newModifier ? ' ' . rtrim($this->pModifiers($node->newModifier), ' ') : '') - . (null !== $node->newName ? ' ' . $node->newName : '') - . ';'; - } - - protected function pStmt_Property(Stmt\Property $node) { - return $this->pAttrGroups($node->attrGroups) - . (0 === $node->flags ? 'var ' : $this->pModifiers($node->flags)) - . ($node->type ? $this->p($node->type) . ' ' : '') - . $this->pCommaSeparated($node->props) . ';'; - } - - protected function pStmt_PropertyProperty(Stmt\PropertyProperty $node) { - return '$' . $node->name - . (null !== $node->default ? ' = ' . $this->p($node->default) : ''); - } - - protected function pStmt_ClassMethod(Stmt\ClassMethod $node) { - return $this->pAttrGroups($node->attrGroups) - . $this->pModifiers($node->flags) - . 'function ' . ($node->byRef ? '&' : '') . $node->name - . '(' . $this->pMaybeMultiline($node->params) . ')' - . (null !== $node->returnType ? ' : ' . $this->p($node->returnType) : '') - . (null !== $node->stmts - ? $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}' - : ';'); - } - - protected function pStmt_ClassConst(Stmt\ClassConst $node) { - return $this->pAttrGroups($node->attrGroups) - . $this->pModifiers($node->flags) - . 'const ' . $this->pCommaSeparated($node->consts) . ';'; - } - - protected function pStmt_Function(Stmt\Function_ $node) { - return $this->pAttrGroups($node->attrGroups) - . 'function ' . ($node->byRef ? '&' : '') . $node->name - . '(' . $this->pCommaSeparated($node->params) . ')' - . (null !== $node->returnType ? ' : ' . $this->p($node->returnType) : '') - . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pStmt_Const(Stmt\Const_ $node) { - return 'const ' . $this->pCommaSeparated($node->consts) . ';'; - } - - protected function pStmt_Declare(Stmt\Declare_ $node) { - return 'declare (' . $this->pCommaSeparated($node->declares) . ')' - . (null !== $node->stmts ? ' {' . $this->pStmts($node->stmts) . $this->nl . '}' : ';'); - } - - protected function pStmt_DeclareDeclare(Stmt\DeclareDeclare $node) { - return $node->key . '=' . $this->p($node->value); - } - - // Control flow - - protected function pStmt_If(Stmt\If_ $node) { - return 'if (' . $this->p($node->cond) . ') {' - . $this->pStmts($node->stmts) . $this->nl . '}' - . ($node->elseifs ? ' ' . $this->pImplode($node->elseifs, ' ') : '') - . (null !== $node->else ? ' ' . $this->p($node->else) : ''); - } - - protected function pStmt_ElseIf(Stmt\ElseIf_ $node) { - return 'elseif (' . $this->p($node->cond) . ') {' - . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pStmt_Else(Stmt\Else_ $node) { - return 'else {' . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pStmt_For(Stmt\For_ $node) { - return 'for (' - . $this->pCommaSeparated($node->init) . ';' . (!empty($node->cond) ? ' ' : '') - . $this->pCommaSeparated($node->cond) . ';' . (!empty($node->loop) ? ' ' : '') - . $this->pCommaSeparated($node->loop) - . ') {' . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pStmt_Foreach(Stmt\Foreach_ $node) { - return 'foreach (' . $this->p($node->expr) . ' as ' - . (null !== $node->keyVar ? $this->p($node->keyVar) . ' => ' : '') - . ($node->byRef ? '&' : '') . $this->p($node->valueVar) . ') {' - . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pStmt_While(Stmt\While_ $node) { - return 'while (' . $this->p($node->cond) . ') {' - . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pStmt_Do(Stmt\Do_ $node) { - return 'do {' . $this->pStmts($node->stmts) . $this->nl - . '} while (' . $this->p($node->cond) . ');'; - } - - protected function pStmt_Switch(Stmt\Switch_ $node) { - return 'switch (' . $this->p($node->cond) . ') {' - . $this->pStmts($node->cases) . $this->nl . '}'; - } - - protected function pStmt_Case(Stmt\Case_ $node) { - return (null !== $node->cond ? 'case ' . $this->p($node->cond) : 'default') . ':' - . $this->pStmts($node->stmts); - } - - protected function pStmt_TryCatch(Stmt\TryCatch $node) { - return 'try {' . $this->pStmts($node->stmts) . $this->nl . '}' - . ($node->catches ? ' ' . $this->pImplode($node->catches, ' ') : '') - . ($node->finally !== null ? ' ' . $this->p($node->finally) : ''); - } - - protected function pStmt_Catch(Stmt\Catch_ $node) { - return 'catch (' . $this->pImplode($node->types, '|') - . ($node->var !== null ? ' ' . $this->p($node->var) : '') - . ') {' . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pStmt_Finally(Stmt\Finally_ $node) { - return 'finally {' . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pStmt_Break(Stmt\Break_ $node) { - return 'break' . ($node->num !== null ? ' ' . $this->p($node->num) : '') . ';'; - } - - protected function pStmt_Continue(Stmt\Continue_ $node) { - return 'continue' . ($node->num !== null ? ' ' . $this->p($node->num) : '') . ';'; - } - - protected function pStmt_Return(Stmt\Return_ $node) { - return 'return' . (null !== $node->expr ? ' ' . $this->p($node->expr) : '') . ';'; - } - - protected function pStmt_Throw(Stmt\Throw_ $node) { - return 'throw ' . $this->p($node->expr) . ';'; - } - - protected function pStmt_Label(Stmt\Label $node) { - return $node->name . ':'; - } - - protected function pStmt_Goto(Stmt\Goto_ $node) { - return 'goto ' . $node->name . ';'; - } - - // Other - - protected function pStmt_Expression(Stmt\Expression $node) { - return $this->p($node->expr) . ';'; - } - - protected function pStmt_Echo(Stmt\Echo_ $node) { - return 'echo ' . $this->pCommaSeparated($node->exprs) . ';'; - } - - protected function pStmt_Static(Stmt\Static_ $node) { - return 'static ' . $this->pCommaSeparated($node->vars) . ';'; - } - - protected function pStmt_Global(Stmt\Global_ $node) { - return 'global ' . $this->pCommaSeparated($node->vars) . ';'; - } - - protected function pStmt_StaticVar(Stmt\StaticVar $node) { - return $this->p($node->var) - . (null !== $node->default ? ' = ' . $this->p($node->default) : ''); - } - - protected function pStmt_Unset(Stmt\Unset_ $node) { - return 'unset(' . $this->pCommaSeparated($node->vars) . ');'; - } - - protected function pStmt_InlineHTML(Stmt\InlineHTML $node) { - $newline = $node->getAttribute('hasLeadingNewline', true) ? "\n" : ''; - return '?>' . $newline . $node->value . '<?php '; - } - - protected function pStmt_HaltCompiler(Stmt\HaltCompiler $node) { - return '__halt_compiler();' . $node->remaining; - } - - protected function pStmt_Nop(Stmt\Nop $node) { - return ''; - } - - // Helpers - - protected function pClassCommon(Stmt\Class_ $node, $afterClassToken) { - return $this->pAttrGroups($node->attrGroups, $node->name === null) - . $this->pModifiers($node->flags) - . 'class' . $afterClassToken - . (null !== $node->extends ? ' extends ' . $this->p($node->extends) : '') - . (!empty($node->implements) ? ' implements ' . $this->pCommaSeparated($node->implements) : '') - . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}'; - } - - protected function pObjectProperty($node) { - if ($node instanceof Expr) { - return '{' . $this->p($node) . '}'; - } else { - return $node; - } - } - - protected function pEncapsList(array $encapsList, $quote) { - $return = ''; - foreach ($encapsList as $element) { - if ($element instanceof Scalar\EncapsedStringPart) { - $return .= $this->escapeString($element->value, $quote); - } else { - $return .= '{' . $this->p($element) . '}'; - } - } - - return $return; - } - - protected function pSingleQuotedString(string $string) { - return '\'' . addcslashes($string, '\'\\') . '\''; - } - - protected function escapeString($string, $quote) { - if (null === $quote) { - // For doc strings, don't escape newlines - $escaped = addcslashes($string, "\t\f\v$\\"); - } else { - $escaped = addcslashes($string, "\n\r\t\f\v$" . $quote . "\\"); - } - - // Escape control characters and non-UTF-8 characters. - // Regex based on https://stackoverflow.com/a/11709412/385378. - $regex = '/( - [\x00-\x08\x0E-\x1F] # Control characters - | [\xC0-\xC1] # Invalid UTF-8 Bytes - | [\xF5-\xFF] # Invalid UTF-8 Bytes - | \xE0(?=[\x80-\x9F]) # Overlong encoding of prior code point - | \xF0(?=[\x80-\x8F]) # Overlong encoding of prior code point - | [\xC2-\xDF](?![\x80-\xBF]) # Invalid UTF-8 Sequence Start - | [\xE0-\xEF](?![\x80-\xBF]{2}) # Invalid UTF-8 Sequence Start - | [\xF0-\xF4](?![\x80-\xBF]{3}) # Invalid UTF-8 Sequence Start - | (?<=[\x00-\x7F\xF5-\xFF])[\x80-\xBF] # Invalid UTF-8 Sequence Middle - | (?<![\xC2-\xDF]|[\xE0-\xEF]|[\xE0-\xEF][\x80-\xBF]|[\xF0-\xF4]|[\xF0-\xF4][\x80-\xBF]|[\xF0-\xF4][\x80-\xBF]{2})[\x80-\xBF] # Overlong Sequence - | (?<=[\xE0-\xEF])[\x80-\xBF](?![\x80-\xBF]) # Short 3 byte sequence - | (?<=[\xF0-\xF4])[\x80-\xBF](?![\x80-\xBF]{2}) # Short 4 byte sequence - | (?<=[\xF0-\xF4][\x80-\xBF])[\x80-\xBF](?![\x80-\xBF]) # Short 4 byte sequence (2) - )/x'; - return preg_replace_callback($regex, function ($matches) { - assert(strlen($matches[0]) === 1); - $hex = dechex(ord($matches[0]));; - return '\\x' . str_pad($hex, 2, '0', \STR_PAD_LEFT); - }, $escaped); - } - - protected function containsEndLabel($string, $label, $atStart = true, $atEnd = true) { - $start = $atStart ? '(?:^|[\r\n])' : '[\r\n]'; - $end = $atEnd ? '(?:$|[;\r\n])' : '[;\r\n]'; - return false !== strpos($string, $label) - && preg_match('/' . $start . $label . $end . '/', $string); - } - - protected function encapsedContainsEndLabel(array $parts, $label) { - foreach ($parts as $i => $part) { - $atStart = $i === 0; - $atEnd = $i === count($parts) - 1; - if ($part instanceof Scalar\EncapsedStringPart - && $this->containsEndLabel($part->value, $label, $atStart, $atEnd) - ) { - return true; - } - } - return false; - } - - protected function pDereferenceLhs(Node $node) { - if (!$this->dereferenceLhsRequiresParens($node)) { - return $this->p($node); - } else { - return '(' . $this->p($node) . ')'; - } - } - - protected function pCallLhs(Node $node) { - if (!$this->callLhsRequiresParens($node)) { - return $this->p($node); - } else { - return '(' . $this->p($node) . ')'; - } - } - - protected function pNewVariable(Node $node) { - // TODO: This is not fully accurate. - return $this->pDereferenceLhs($node); - } - - /** - * @param Node[] $nodes - * @return bool - */ - protected function hasNodeWithComments(array $nodes) { - foreach ($nodes as $node) { - if ($node && $node->getComments()) { - return true; - } - } - return false; - } - - protected function pMaybeMultiline(array $nodes, bool $trailingComma = false) { - if (!$this->hasNodeWithComments($nodes)) { - return $this->pCommaSeparated($nodes); - } else { - return $this->pCommaSeparatedMultiline($nodes, $trailingComma) . $this->nl; - } - } - - protected function pAttrGroups(array $nodes, bool $inline = false): string { - $result = ''; - $sep = $inline ? ' ' : $this->nl; - foreach ($nodes as $node) { - $result .= $this->p($node) . $sep; - } - - return $result; - } -} diff --git a/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php b/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php deleted file mode 100644 index 6ed936fe..00000000 --- a/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php +++ /dev/null @@ -1,1521 +0,0 @@ -<?php declare(strict_types=1); - -namespace PhpParser; - -use PhpParser\Internal\DiffElem; -use PhpParser\Internal\PrintableNewAnonClassNode; -use PhpParser\Internal\TokenStream; -use PhpParser\Node\Expr; -use PhpParser\Node\Expr\AssignOp; -use PhpParser\Node\Expr\BinaryOp; -use PhpParser\Node\Expr\Cast; -use PhpParser\Node\Scalar; -use PhpParser\Node\Stmt; - -abstract class PrettyPrinterAbstract -{ - const FIXUP_PREC_LEFT = 0; // LHS operand affected by precedence - const FIXUP_PREC_RIGHT = 1; // RHS operand affected by precedence - const FIXUP_CALL_LHS = 2; // LHS of call - const FIXUP_DEREF_LHS = 3; // LHS of dereferencing operation - const FIXUP_BRACED_NAME = 4; // Name operand that may require bracing - const FIXUP_VAR_BRACED_NAME = 5; // Name operand that may require ${} bracing - const FIXUP_ENCAPSED = 6; // Encapsed string part - - protected $precedenceMap = [ - // [precedence, associativity] - // where for precedence -1 is %left, 0 is %nonassoc and 1 is %right - BinaryOp\Pow::class => [ 0, 1], - Expr\BitwiseNot::class => [ 10, 1], - Expr\PreInc::class => [ 10, 1], - Expr\PreDec::class => [ 10, 1], - Expr\PostInc::class => [ 10, -1], - Expr\PostDec::class => [ 10, -1], - Expr\UnaryPlus::class => [ 10, 1], - Expr\UnaryMinus::class => [ 10, 1], - Cast\Int_::class => [ 10, 1], - Cast\Double::class => [ 10, 1], - Cast\String_::class => [ 10, 1], - Cast\Array_::class => [ 10, 1], - Cast\Object_::class => [ 10, 1], - Cast\Bool_::class => [ 10, 1], - Cast\Unset_::class => [ 10, 1], - Expr\ErrorSuppress::class => [ 10, 1], - Expr\Instanceof_::class => [ 20, 0], - Expr\BooleanNot::class => [ 30, 1], - BinaryOp\Mul::class => [ 40, -1], - BinaryOp\Div::class => [ 40, -1], - BinaryOp\Mod::class => [ 40, -1], - BinaryOp\Plus::class => [ 50, -1], - BinaryOp\Minus::class => [ 50, -1], - BinaryOp\Concat::class => [ 50, -1], - BinaryOp\ShiftLeft::class => [ 60, -1], - BinaryOp\ShiftRight::class => [ 60, -1], - BinaryOp\Smaller::class => [ 70, 0], - BinaryOp\SmallerOrEqual::class => [ 70, 0], - BinaryOp\Greater::class => [ 70, 0], - BinaryOp\GreaterOrEqual::class => [ 70, 0], - BinaryOp\Equal::class => [ 80, 0], - BinaryOp\NotEqual::class => [ 80, 0], - BinaryOp\Identical::class => [ 80, 0], - BinaryOp\NotIdentical::class => [ 80, 0], - BinaryOp\Spaceship::class => [ 80, 0], - BinaryOp\BitwiseAnd::class => [ 90, -1], - BinaryOp\BitwiseXor::class => [100, -1], - BinaryOp\BitwiseOr::class => [110, -1], - BinaryOp\BooleanAnd::class => [120, -1], - BinaryOp\BooleanOr::class => [130, -1], - BinaryOp\Coalesce::class => [140, 1], - Expr\Ternary::class => [150, 0], - // parser uses %left for assignments, but they really behave as %right - Expr\Assign::class => [160, 1], - Expr\AssignRef::class => [160, 1], - AssignOp\Plus::class => [160, 1], - AssignOp\Minus::class => [160, 1], - AssignOp\Mul::class => [160, 1], - AssignOp\Div::class => [160, 1], - AssignOp\Concat::class => [160, 1], - AssignOp\Mod::class => [160, 1], - AssignOp\BitwiseAnd::class => [160, 1], - AssignOp\BitwiseOr::class => [160, 1], - AssignOp\BitwiseXor::class => [160, 1], - AssignOp\ShiftLeft::class => [160, 1], - AssignOp\ShiftRight::class => [160, 1], - AssignOp\Pow::class => [160, 1], - AssignOp\Coalesce::class => [160, 1], - Expr\YieldFrom::class => [165, 1], - Expr\Print_::class => [168, 1], - BinaryOp\LogicalAnd::class => [170, -1], - BinaryOp\LogicalXor::class => [180, -1], - BinaryOp\LogicalOr::class => [190, -1], - Expr\Include_::class => [200, -1], - ]; - - /** @var int Current indentation level. */ - protected $indentLevel; - /** @var string Newline including current indentation. */ - protected $nl; - /** @var string Token placed at end of doc string to ensure it is followed by a newline. */ - protected $docStringEndToken; - /** @var bool Whether semicolon namespaces can be used (i.e. no global namespace is used) */ - protected $canUseSemicolonNamespaces; - /** @var array Pretty printer options */ - protected $options; - - /** @var TokenStream Original tokens for use in format-preserving pretty print */ - protected $origTokens; - /** @var Internal\Differ Differ for node lists */ - protected $nodeListDiffer; - /** @var bool[] Map determining whether a certain character is a label character */ - protected $labelCharMap; - /** - * @var int[][] Map from token classes and subnode names to FIXUP_* constants. This is used - * during format-preserving prints to place additional parens/braces if necessary. - */ - protected $fixupMap; - /** - * @var int[][] Map from "{$node->getType()}->{$subNode}" to ['left' => $l, 'right' => $r], - * where $l and $r specify the token type that needs to be stripped when removing - * this node. - */ - protected $removalMap; - /** - * @var mixed[] Map from "{$node->getType()}->{$subNode}" to [$find, $beforeToken, $extraLeft, $extraRight]. - * $find is an optional token after which the insertion occurs. $extraLeft/Right - * are optionally added before/after the main insertions. - */ - protected $insertionMap; - /** - * @var string[] Map From "{$node->getType()}->{$subNode}" to string that should be inserted - * between elements of this list subnode. - */ - protected $listInsertionMap; - protected $emptyListInsertionMap; - /** @var int[] Map from "{$node->getType()}->{$subNode}" to token before which the modifiers - * should be reprinted. */ - protected $modifierChangeMap; - - /** - * Creates a pretty printer instance using the given options. - * - * Supported options: - * * bool $shortArraySyntax = false: Whether to use [] instead of array() as the default array - * syntax, if the node does not specify a format. - * - * @param array $options Dictionary of formatting options - */ - public function __construct(array $options = []) { - $this->docStringEndToken = '_DOC_STRING_END_' . mt_rand(); - - $defaultOptions = ['shortArraySyntax' => false]; - $this->options = $options + $defaultOptions; - } - - /** - * Reset pretty printing state. - */ - protected function resetState() { - $this->indentLevel = 0; - $this->nl = "\n"; - $this->origTokens = null; - } - - /** - * Set indentation level - * - * @param int $level Level in number of spaces - */ - protected function setIndentLevel(int $level) { - $this->indentLevel = $level; - $this->nl = "\n" . \str_repeat(' ', $level); - } - - /** - * Increase indentation level. - */ - protected function indent() { - $this->indentLevel += 4; - $this->nl .= ' '; - } - - /** - * Decrease indentation level. - */ - protected function outdent() { - assert($this->indentLevel >= 4); - $this->indentLevel -= 4; - $this->nl = "\n" . str_repeat(' ', $this->indentLevel); - } - - /** - * Pretty prints an array of statements. - * - * @param Node[] $stmts Array of statements - * - * @return string Pretty printed statements - */ - public function prettyPrint(array $stmts) : string { - $this->resetState(); - $this->preprocessNodes($stmts); - - return ltrim($this->handleMagicTokens($this->pStmts($stmts, false))); - } - - /** - * Pretty prints an expression. - * - * @param Expr $node Expression node - * - * @return string Pretty printed node - */ - public function prettyPrintExpr(Expr $node) : string { - $this->resetState(); - return $this->handleMagicTokens($this->p($node)); - } - - /** - * Pretty prints a file of statements (includes the opening <?php tag if it is required). - * - * @param Node[] $stmts Array of statements - * - * @return string Pretty printed statements - */ - public function prettyPrintFile(array $stmts) : string { - if (!$stmts) { - return "<?php\n\n"; - } - - $p = "<?php\n\n" . $this->prettyPrint($stmts); - - if ($stmts[0] instanceof Stmt\InlineHTML) { - $p = preg_replace('/^<\?php\s+\?>\n?/', '', $p); - } - if ($stmts[count($stmts) - 1] instanceof Stmt\InlineHTML) { - $p = preg_replace('/<\?php$/', '', rtrim($p)); - } - - return $p; - } - - /** - * Preprocesses the top-level nodes to initialize pretty printer state. - * - * @param Node[] $nodes Array of nodes - */ - protected function preprocessNodes(array $nodes) { - /* We can use semicolon-namespaces unless there is a global namespace declaration */ - $this->canUseSemicolonNamespaces = true; - foreach ($nodes as $node) { - if ($node instanceof Stmt\Namespace_ && null === $node->name) { - $this->canUseSemicolonNamespaces = false; - break; - } - } - } - - /** - * Handles (and removes) no-indent and doc-string-end tokens. - * - * @param string $str - * @return string - */ - protected function handleMagicTokens(string $str) : string { - // Replace doc-string-end tokens with nothing or a newline - $str = str_replace($this->docStringEndToken . ";\n", ";\n", $str); - $str = str_replace($this->docStringEndToken, "\n", $str); - - return $str; - } - - /** - * Pretty prints an array of nodes (statements) and indents them optionally. - * - * @param Node[] $nodes Array of nodes - * @param bool $indent Whether to indent the printed nodes - * - * @return string Pretty printed statements - */ - protected function pStmts(array $nodes, bool $indent = true) : string { - if ($indent) { - $this->indent(); - } - - $result = ''; - foreach ($nodes as $node) { - $comments = $node->getComments(); - if ($comments) { - $result .= $this->nl . $this->pComments($comments); - if ($node instanceof Stmt\Nop) { - continue; - } - } - - $result .= $this->nl . $this->p($node); - } - - if ($indent) { - $this->outdent(); - } - - return $result; - } - - /** - * Pretty-print an infix operation while taking precedence into account. - * - * @param string $class Node class of operator - * @param Node $leftNode Left-hand side node - * @param string $operatorString String representation of the operator - * @param Node $rightNode Right-hand side node - * - * @return string Pretty printed infix operation - */ - protected function pInfixOp(string $class, Node $leftNode, string $operatorString, Node $rightNode) : string { - list($precedence, $associativity) = $this->precedenceMap[$class]; - - return $this->pPrec($leftNode, $precedence, $associativity, -1) - . $operatorString - . $this->pPrec($rightNode, $precedence, $associativity, 1); - } - - /** - * Pretty-print a prefix operation while taking precedence into account. - * - * @param string $class Node class of operator - * @param string $operatorString String representation of the operator - * @param Node $node Node - * - * @return string Pretty printed prefix operation - */ - protected function pPrefixOp(string $class, string $operatorString, Node $node) : string { - list($precedence, $associativity) = $this->precedenceMap[$class]; - return $operatorString . $this->pPrec($node, $precedence, $associativity, 1); - } - - /** - * Pretty-print a postfix operation while taking precedence into account. - * - * @param string $class Node class of operator - * @param string $operatorString String representation of the operator - * @param Node $node Node - * - * @return string Pretty printed postfix operation - */ - protected function pPostfixOp(string $class, Node $node, string $operatorString) : string { - list($precedence, $associativity) = $this->precedenceMap[$class]; - return $this->pPrec($node, $precedence, $associativity, -1) . $operatorString; - } - - /** - * Prints an expression node with the least amount of parentheses necessary to preserve the meaning. - * - * @param Node $node Node to pretty print - * @param int $parentPrecedence Precedence of the parent operator - * @param int $parentAssociativity Associativity of parent operator - * (-1 is left, 0 is nonassoc, 1 is right) - * @param int $childPosition Position of the node relative to the operator - * (-1 is left, 1 is right) - * - * @return string The pretty printed node - */ - protected function pPrec(Node $node, int $parentPrecedence, int $parentAssociativity, int $childPosition) : string { - $class = \get_class($node); - if (isset($this->precedenceMap[$class])) { - $childPrecedence = $this->precedenceMap[$class][0]; - if ($childPrecedence > $parentPrecedence - || ($parentPrecedence === $childPrecedence && $parentAssociativity !== $childPosition) - ) { - return '(' . $this->p($node) . ')'; - } - } - - return $this->p($node); - } - - /** - * Pretty prints an array of nodes and implodes the printed values. - * - * @param Node[] $nodes Array of Nodes to be printed - * @param string $glue Character to implode with - * - * @return string Imploded pretty printed nodes - */ - protected function pImplode(array $nodes, string $glue = '') : string { - $pNodes = []; - foreach ($nodes as $node) { - if (null === $node) { - $pNodes[] = ''; - } else { - $pNodes[] = $this->p($node); - } - } - - return implode($glue, $pNodes); - } - - /** - * Pretty prints an array of nodes and implodes the printed values with commas. - * - * @param Node[] $nodes Array of Nodes to be printed - * - * @return string Comma separated pretty printed nodes - */ - protected function pCommaSeparated(array $nodes) : string { - return $this->pImplode($nodes, ', '); - } - - /** - * Pretty prints a comma-separated list of nodes in multiline style, including comments. - * - * The result includes a leading newline and one level of indentation (same as pStmts). - * - * @param Node[] $nodes Array of Nodes to be printed - * @param bool $trailingComma Whether to use a trailing comma - * - * @return string Comma separated pretty printed nodes in multiline style - */ - protected function pCommaSeparatedMultiline(array $nodes, bool $trailingComma) : string { - $this->indent(); - - $result = ''; - $lastIdx = count($nodes) - 1; - foreach ($nodes as $idx => $node) { - if ($node !== null) { - $comments = $node->getComments(); - if ($comments) { - $result .= $this->nl . $this->pComments($comments); - } - - $result .= $this->nl . $this->p($node); - } else { - $result .= $this->nl; - } - if ($trailingComma || $idx !== $lastIdx) { - $result .= ','; - } - } - - $this->outdent(); - return $result; - } - - /** - * Prints reformatted text of the passed comments. - * - * @param Comment[] $comments List of comments - * - * @return string Reformatted text of comments - */ - protected function pComments(array $comments) : string { - $formattedComments = []; - - foreach ($comments as $comment) { - $formattedComments[] = str_replace("\n", $this->nl, $comment->getReformattedText()); - } - - return implode($this->nl, $formattedComments); - } - - /** - * Perform a format-preserving pretty print of an AST. - * - * The format preservation is best effort. For some changes to the AST the formatting will not - * be preserved (at least not locally). - * - * In order to use this method a number of prerequisites must be satisfied: - * * The startTokenPos and endTokenPos attributes in the lexer must be enabled. - * * The CloningVisitor must be run on the AST prior to modification. - * * The original tokens must be provided, using the getTokens() method on the lexer. - * - * @param Node[] $stmts Modified AST with links to original AST - * @param Node[] $origStmts Original AST with token offset information - * @param array $origTokens Tokens of the original code - * - * @return string - */ - public function printFormatPreserving(array $stmts, array $origStmts, array $origTokens) : string { - $this->initializeNodeListDiffer(); - $this->initializeLabelCharMap(); - $this->initializeFixupMap(); - $this->initializeRemovalMap(); - $this->initializeInsertionMap(); - $this->initializeListInsertionMap(); - $this->initializeEmptyListInsertionMap(); - $this->initializeModifierChangeMap(); - - $this->resetState(); - $this->origTokens = new TokenStream($origTokens); - - $this->preprocessNodes($stmts); - - $pos = 0; - $result = $this->pArray($stmts, $origStmts, $pos, 0, 'File', 'stmts', null); - if (null !== $result) { - $result .= $this->origTokens->getTokenCode($pos, count($origTokens), 0); - } else { - // Fallback - // TODO Add <?php properly - $result = "<?php\n" . $this->pStmts($stmts, false); - } - - return ltrim($this->handleMagicTokens($result)); - } - - protected function pFallback(Node $node) { - return $this->{'p' . $node->getType()}($node); - } - - /** - * Pretty prints a node. - * - * This method also handles formatting preservation for nodes. - * - * @param Node $node Node to be pretty printed - * @param bool $parentFormatPreserved Whether parent node has preserved formatting - * - * @return string Pretty printed node - */ - protected function p(Node $node, $parentFormatPreserved = false) : string { - // No orig tokens means this is a normal pretty print without preservation of formatting - if (!$this->origTokens) { - return $this->{'p' . $node->getType()}($node); - } - - /** @var Node $origNode */ - $origNode = $node->getAttribute('origNode'); - if (null === $origNode) { - return $this->pFallback($node); - } - - $class = \get_class($node); - \assert($class === \get_class($origNode)); - - $startPos = $origNode->getStartTokenPos(); - $endPos = $origNode->getEndTokenPos(); - \assert($startPos >= 0 && $endPos >= 0); - - $fallbackNode = $node; - if ($node instanceof Expr\New_ && $node->class instanceof Stmt\Class_) { - // Normalize node structure of anonymous classes - $node = PrintableNewAnonClassNode::fromNewNode($node); - $origNode = PrintableNewAnonClassNode::fromNewNode($origNode); - } - - // InlineHTML node does not contain closing and opening PHP tags. If the parent formatting - // is not preserved, then we need to use the fallback code to make sure the tags are - // printed. - if ($node instanceof Stmt\InlineHTML && !$parentFormatPreserved) { - return $this->pFallback($fallbackNode); - } - - $indentAdjustment = $this->indentLevel - $this->origTokens->getIndentationBefore($startPos); - - $type = $node->getType(); - $fixupInfo = $this->fixupMap[$class] ?? null; - - $result = ''; - $pos = $startPos; - foreach ($node->getSubNodeNames() as $subNodeName) { - $subNode = $node->$subNodeName; - $origSubNode = $origNode->$subNodeName; - - if ((!$subNode instanceof Node && $subNode !== null) - || (!$origSubNode instanceof Node && $origSubNode !== null) - ) { - if ($subNode === $origSubNode) { - // Unchanged, can reuse old code - continue; - } - - if (is_array($subNode) && is_array($origSubNode)) { - // Array subnode changed, we might be able to reconstruct it - $listResult = $this->pArray( - $subNode, $origSubNode, $pos, $indentAdjustment, $type, $subNodeName, - $fixupInfo[$subNodeName] ?? null - ); - if (null === $listResult) { - return $this->pFallback($fallbackNode); - } - - $result .= $listResult; - continue; - } - - if (is_int($subNode) && is_int($origSubNode)) { - // Check if this is a modifier change - $key = $type . '->' . $subNodeName; - if (!isset($this->modifierChangeMap[$key])) { - return $this->pFallback($fallbackNode); - } - - $findToken = $this->modifierChangeMap[$key]; - $result .= $this->pModifiers($subNode); - $pos = $this->origTokens->findRight($pos, $findToken); - continue; - } - - // If a non-node, non-array subnode changed, we don't be able to do a partial - // reconstructions, as we don't have enough offset information. Pretty print the - // whole node instead. - return $this->pFallback($fallbackNode); - } - - $extraLeft = ''; - $extraRight = ''; - if ($origSubNode !== null) { - $subStartPos = $origSubNode->getStartTokenPos(); - $subEndPos = $origSubNode->getEndTokenPos(); - \assert($subStartPos >= 0 && $subEndPos >= 0); - } else { - if ($subNode === null) { - // Both null, nothing to do - continue; - } - - // A node has been inserted, check if we have insertion information for it - $key = $type . '->' . $subNodeName; - if (!isset($this->insertionMap[$key])) { - return $this->pFallback($fallbackNode); - } - - list($findToken, $beforeToken, $extraLeft, $extraRight) = $this->insertionMap[$key]; - if (null !== $findToken) { - $subStartPos = $this->origTokens->findRight($pos, $findToken) - + (int) !$beforeToken; - } else { - $subStartPos = $pos; - } - - if (null === $extraLeft && null !== $extraRight) { - // If inserting on the right only, skipping whitespace looks better - $subStartPos = $this->origTokens->skipRightWhitespace($subStartPos); - } - $subEndPos = $subStartPos - 1; - } - - if (null === $subNode) { - // A node has been removed, check if we have removal information for it - $key = $type . '->' . $subNodeName; - if (!isset($this->removalMap[$key])) { - return $this->pFallback($fallbackNode); - } - - // Adjust positions to account for additional tokens that must be skipped - $removalInfo = $this->removalMap[$key]; - if (isset($removalInfo['left'])) { - $subStartPos = $this->origTokens->skipLeft($subStartPos - 1, $removalInfo['left']) + 1; - } - if (isset($removalInfo['right'])) { - $subEndPos = $this->origTokens->skipRight($subEndPos + 1, $removalInfo['right']) - 1; - } - } - - $result .= $this->origTokens->getTokenCode($pos, $subStartPos, $indentAdjustment); - - if (null !== $subNode) { - $result .= $extraLeft; - - $origIndentLevel = $this->indentLevel; - $this->setIndentLevel($this->origTokens->getIndentationBefore($subStartPos) + $indentAdjustment); - - // If it's the same node that was previously in this position, it certainly doesn't - // need fixup. It's important to check this here, because our fixup checks are more - // conservative than strictly necessary. - if (isset($fixupInfo[$subNodeName]) - && $subNode->getAttribute('origNode') !== $origSubNode - ) { - $fixup = $fixupInfo[$subNodeName]; - $res = $this->pFixup($fixup, $subNode, $class, $subStartPos, $subEndPos); - } else { - $res = $this->p($subNode, true); - } - - $this->safeAppend($result, $res); - $this->setIndentLevel($origIndentLevel); - - $result .= $extraRight; - } - - $pos = $subEndPos + 1; - } - - $result .= $this->origTokens->getTokenCode($pos, $endPos + 1, $indentAdjustment); - return $result; - } - - /** - * Perform a format-preserving pretty print of an array. - * - * @param array $nodes New nodes - * @param array $origNodes Original nodes - * @param int $pos Current token position (updated by reference) - * @param int $indentAdjustment Adjustment for indentation - * @param string $parentNodeType Type of the containing node. - * @param string $subNodeName Name of array subnode. - * @param null|int $fixup Fixup information for array item nodes - * - * @return null|string Result of pretty print or null if cannot preserve formatting - */ - protected function pArray( - array $nodes, array $origNodes, int &$pos, int $indentAdjustment, - string $parentNodeType, string $subNodeName, $fixup - ) { - $diff = $this->nodeListDiffer->diffWithReplacements($origNodes, $nodes); - - $mapKey = $parentNodeType . '->' . $subNodeName; - $insertStr = $this->listInsertionMap[$mapKey] ?? null; - $isStmtList = $subNodeName === 'stmts'; - - $beforeFirstKeepOrReplace = true; - $skipRemovedNode = false; - $delayedAdd = []; - $lastElemIndentLevel = $this->indentLevel; - - $insertNewline = false; - if ($insertStr === "\n") { - $insertStr = ''; - $insertNewline = true; - } - - if ($isStmtList && \count($origNodes) === 1 && \count($nodes) !== 1) { - $startPos = $origNodes[0]->getStartTokenPos(); - $endPos = $origNodes[0]->getEndTokenPos(); - \assert($startPos >= 0 && $endPos >= 0); - if (!$this->origTokens->haveBraces($startPos, $endPos)) { - // This was a single statement without braces, but either additional statements - // have been added, or the single statement has been removed. This requires the - // addition of braces. For now fall back. - // TODO: Try to preserve formatting - return null; - } - } - - $result = ''; - foreach ($diff as $i => $diffElem) { - $diffType = $diffElem->type; - /** @var Node|null $arrItem */ - $arrItem = $diffElem->new; - /** @var Node|null $origArrItem */ - $origArrItem = $diffElem->old; - - if ($diffType === DiffElem::TYPE_KEEP || $diffType === DiffElem::TYPE_REPLACE) { - $beforeFirstKeepOrReplace = false; - - if ($origArrItem === null || $arrItem === null) { - // We can only handle the case where both are null - if ($origArrItem === $arrItem) { - continue; - } - return null; - } - - if (!$arrItem instanceof Node || !$origArrItem instanceof Node) { - // We can only deal with nodes. This can occur for Names, which use string arrays. - return null; - } - - $itemStartPos = $origArrItem->getStartTokenPos(); - $itemEndPos = $origArrItem->getEndTokenPos(); - \assert($itemStartPos >= 0 && $itemEndPos >= 0 && $itemStartPos >= $pos); - - $origIndentLevel = $this->indentLevel; - $lastElemIndentLevel = $this->origTokens->getIndentationBefore($itemStartPos) + $indentAdjustment; - $this->setIndentLevel($lastElemIndentLevel); - - $comments = $arrItem->getComments(); - $origComments = $origArrItem->getComments(); - $commentStartPos = $origComments ? $origComments[0]->getStartTokenPos() : $itemStartPos; - \assert($commentStartPos >= 0); - - if ($commentStartPos < $pos) { - // Comments may be assigned to multiple nodes if they start at the same position. - // Make sure we don't try to print them multiple times. - $commentStartPos = $itemStartPos; - } - - if ($skipRemovedNode) { - if ($isStmtList && ($this->origTokens->haveBracesInRange($pos, $itemStartPos) || - $this->origTokens->haveTagInRange($pos, $itemStartPos))) { - // We'd remove the brace of a code block. - // TODO: Preserve formatting. - $this->setIndentLevel($origIndentLevel); - return null; - } - } else { - $result .= $this->origTokens->getTokenCode( - $pos, $commentStartPos, $indentAdjustment); - } - - if (!empty($delayedAdd)) { - /** @var Node $delayedAddNode */ - foreach ($delayedAdd as $delayedAddNode) { - if ($insertNewline) { - $delayedAddComments = $delayedAddNode->getComments(); - if ($delayedAddComments) { - $result .= $this->pComments($delayedAddComments) . $this->nl; - } - } - - $this->safeAppend($result, $this->p($delayedAddNode, true)); - - if ($insertNewline) { - $result .= $insertStr . $this->nl; - } else { - $result .= $insertStr; - } - } - - $delayedAdd = []; - } - - if ($comments !== $origComments) { - if ($comments) { - $result .= $this->pComments($comments) . $this->nl; - } - } else { - $result .= $this->origTokens->getTokenCode( - $commentStartPos, $itemStartPos, $indentAdjustment); - } - - // If we had to remove anything, we have done so now. - $skipRemovedNode = false; - } elseif ($diffType === DiffElem::TYPE_ADD) { - if (null === $insertStr) { - // We don't have insertion information for this list type - return null; - } - - // We go multiline if the original code was multiline, - // or if it's an array item with a comment above it. - if ($insertStr === ', ' && - ($this->isMultiline($origNodes) || $arrItem->getComments()) - ) { - $insertStr = ','; - $insertNewline = true; - } - - if ($beforeFirstKeepOrReplace) { - // Will be inserted at the next "replace" or "keep" element - $delayedAdd[] = $arrItem; - continue; - } - - $itemStartPos = $pos; - $itemEndPos = $pos - 1; - - $origIndentLevel = $this->indentLevel; - $this->setIndentLevel($lastElemIndentLevel); - - if ($insertNewline) { - $result .= $insertStr . $this->nl; - $comments = $arrItem->getComments(); - if ($comments) { - $result .= $this->pComments($comments) . $this->nl; - } - } else { - $result .= $insertStr; - } - } elseif ($diffType === DiffElem::TYPE_REMOVE) { - if (!$origArrItem instanceof Node) { - // We only support removal for nodes - return null; - } - - $itemStartPos = $origArrItem->getStartTokenPos(); - $itemEndPos = $origArrItem->getEndTokenPos(); - \assert($itemStartPos >= 0 && $itemEndPos >= 0); - - // Consider comments part of the node. - $origComments = $origArrItem->getComments(); - if ($origComments) { - $itemStartPos = $origComments[0]->getStartTokenPos(); - } - - if ($i === 0) { - // If we're removing from the start, keep the tokens before the node and drop those after it, - // instead of the other way around. - $result .= $this->origTokens->getTokenCode( - $pos, $itemStartPos, $indentAdjustment); - $skipRemovedNode = true; - } else { - if ($isStmtList && ($this->origTokens->haveBracesInRange($pos, $itemStartPos) || - $this->origTokens->haveTagInRange($pos, $itemStartPos))) { - // We'd remove the brace of a code block. - // TODO: Preserve formatting. - return null; - } - } - - $pos = $itemEndPos + 1; - continue; - } else { - throw new \Exception("Shouldn't happen"); - } - - if (null !== $fixup && $arrItem->getAttribute('origNode') !== $origArrItem) { - $res = $this->pFixup($fixup, $arrItem, null, $itemStartPos, $itemEndPos); - } else { - $res = $this->p($arrItem, true); - } - $this->safeAppend($result, $res); - - $this->setIndentLevel($origIndentLevel); - $pos = $itemEndPos + 1; - } - - if ($skipRemovedNode) { - // TODO: Support removing single node. - return null; - } - - if (!empty($delayedAdd)) { - if (!isset($this->emptyListInsertionMap[$mapKey])) { - return null; - } - - list($findToken, $extraLeft, $extraRight) = $this->emptyListInsertionMap[$mapKey]; - if (null !== $findToken) { - $insertPos = $this->origTokens->findRight($pos, $findToken) + 1; - $result .= $this->origTokens->getTokenCode($pos, $insertPos, $indentAdjustment); - $pos = $insertPos; - } - - $first = true; - $result .= $extraLeft; - foreach ($delayedAdd as $delayedAddNode) { - if (!$first) { - $result .= $insertStr; - if ($insertNewline) { - $result .= $this->nl; - } - } - $result .= $this->p($delayedAddNode, true); - $first = false; - } - $result .= $extraRight === "\n" ? $this->nl : $extraRight; - } - - return $result; - } - - /** - * Print node with fixups. - * - * Fixups here refer to the addition of extra parentheses, braces or other characters, that - * are required to preserve program semantics in a certain context (e.g. to maintain precedence - * or because only certain expressions are allowed in certain places). - * - * @param int $fixup Fixup type - * @param Node $subNode Subnode to print - * @param string|null $parentClass Class of parent node - * @param int $subStartPos Original start pos of subnode - * @param int $subEndPos Original end pos of subnode - * - * @return string Result of fixed-up print of subnode - */ - protected function pFixup(int $fixup, Node $subNode, $parentClass, int $subStartPos, int $subEndPos) : string { - switch ($fixup) { - case self::FIXUP_PREC_LEFT: - case self::FIXUP_PREC_RIGHT: - if (!$this->origTokens->haveParens($subStartPos, $subEndPos)) { - list($precedence, $associativity) = $this->precedenceMap[$parentClass]; - return $this->pPrec($subNode, $precedence, $associativity, - $fixup === self::FIXUP_PREC_LEFT ? -1 : 1); - } - break; - case self::FIXUP_CALL_LHS: - if ($this->callLhsRequiresParens($subNode) - && !$this->origTokens->haveParens($subStartPos, $subEndPos) - ) { - return '(' . $this->p($subNode) . ')'; - } - break; - case self::FIXUP_DEREF_LHS: - if ($this->dereferenceLhsRequiresParens($subNode) - && !$this->origTokens->haveParens($subStartPos, $subEndPos) - ) { - return '(' . $this->p($subNode) . ')'; - } - break; - case self::FIXUP_BRACED_NAME: - case self::FIXUP_VAR_BRACED_NAME: - if ($subNode instanceof Expr - && !$this->origTokens->haveBraces($subStartPos, $subEndPos) - ) { - return ($fixup === self::FIXUP_VAR_BRACED_NAME ? '$' : '') - . '{' . $this->p($subNode) . '}'; - } - break; - case self::FIXUP_ENCAPSED: - if (!$subNode instanceof Scalar\EncapsedStringPart - && !$this->origTokens->haveBraces($subStartPos, $subEndPos) - ) { - return '{' . $this->p($subNode) . '}'; - } - break; - default: - throw new \Exception('Cannot happen'); - } - - // Nothing special to do - return $this->p($subNode); - } - - /** - * Appends to a string, ensuring whitespace between label characters. - * - * Example: "echo" and "$x" result in "echo$x", but "echo" and "x" result in "echo x". - * Without safeAppend the result would be "echox", which does not preserve semantics. - * - * @param string $str - * @param string $append - */ - protected function safeAppend(string &$str, string $append) { - if ($str === "") { - $str = $append; - return; - } - - if ($append === "") { - return; - } - - if (!$this->labelCharMap[$append[0]] - || !$this->labelCharMap[$str[\strlen($str) - 1]]) { - $str .= $append; - } else { - $str .= " " . $append; - } - } - - /** - * Determines whether the LHS of a call must be wrapped in parenthesis. - * - * @param Node $node LHS of a call - * - * @return bool Whether parentheses are required - */ - protected function callLhsRequiresParens(Node $node) : bool { - return !($node instanceof Node\Name - || $node instanceof Expr\Variable - || $node instanceof Expr\ArrayDimFetch - || $node instanceof Expr\FuncCall - || $node instanceof Expr\MethodCall - || $node instanceof Expr\NullsafeMethodCall - || $node instanceof Expr\StaticCall - || $node instanceof Expr\Array_); - } - - /** - * Determines whether the LHS of a dereferencing operation must be wrapped in parenthesis. - * - * @param Node $node LHS of dereferencing operation - * - * @return bool Whether parentheses are required - */ - protected function dereferenceLhsRequiresParens(Node $node) : bool { - return !($node instanceof Expr\Variable - || $node instanceof Node\Name - || $node instanceof Expr\ArrayDimFetch - || $node instanceof Expr\PropertyFetch - || $node instanceof Expr\NullsafePropertyFetch - || $node instanceof Expr\StaticPropertyFetch - || $node instanceof Expr\FuncCall - || $node instanceof Expr\MethodCall - || $node instanceof Expr\NullsafeMethodCall - || $node instanceof Expr\StaticCall - || $node instanceof Expr\Array_ - || $node instanceof Scalar\String_ - || $node instanceof Expr\ConstFetch - || $node instanceof Expr\ClassConstFetch); - } - - /** - * Print modifiers, including trailing whitespace. - * - * @param int $modifiers Modifier mask to print - * - * @return string Printed modifiers - */ - protected function pModifiers(int $modifiers) { - return ($modifiers & Stmt\Class_::MODIFIER_PUBLIC ? 'public ' : '') - . ($modifiers & Stmt\Class_::MODIFIER_PROTECTED ? 'protected ' : '') - . ($modifiers & Stmt\Class_::MODIFIER_PRIVATE ? 'private ' : '') - . ($modifiers & Stmt\Class_::MODIFIER_STATIC ? 'static ' : '') - . ($modifiers & Stmt\Class_::MODIFIER_ABSTRACT ? 'abstract ' : '') - . ($modifiers & Stmt\Class_::MODIFIER_FINAL ? 'final ' : '') - . ($modifiers & Stmt\Class_::MODIFIER_READONLY ? 'readonly ' : ''); - } - - /** - * Determine whether a list of nodes uses multiline formatting. - * - * @param (Node|null)[] $nodes Node list - * - * @return bool Whether multiline formatting is used - */ - protected function isMultiline(array $nodes) : bool { - if (\count($nodes) < 2) { - return false; - } - - $pos = -1; - foreach ($nodes as $node) { - if (null === $node) { - continue; - } - - $endPos = $node->getEndTokenPos() + 1; - if ($pos >= 0) { - $text = $this->origTokens->getTokenCode($pos, $endPos, 0); - if (false === strpos($text, "\n")) { - // We require that a newline is present between *every* item. If the formatting - // is inconsistent, with only some items having newlines, we don't consider it - // as multiline - return false; - } - } - $pos = $endPos; - } - - return true; - } - - /** - * Lazily initializes label char map. - * - * The label char map determines whether a certain character may occur in a label. - */ - protected function initializeLabelCharMap() { - if ($this->labelCharMap) return; - - $this->labelCharMap = []; - for ($i = 0; $i < 256; $i++) { - // Since PHP 7.1 The lower range is 0x80. However, we also want to support code for - // older versions. - $chr = chr($i); - $this->labelCharMap[$chr] = $i >= 0x7f || ctype_alnum($chr); - } - } - - /** - * Lazily initializes node list differ. - * - * The node list differ is used to determine differences between two array subnodes. - */ - protected function initializeNodeListDiffer() { - if ($this->nodeListDiffer) return; - - $this->nodeListDiffer = new Internal\Differ(function ($a, $b) { - if ($a instanceof Node && $b instanceof Node) { - return $a === $b->getAttribute('origNode'); - } - // Can happen for array destructuring - return $a === null && $b === null; - }); - } - - /** - * Lazily initializes fixup map. - * - * The fixup map is used to determine whether a certain subnode of a certain node may require - * some kind of "fixup" operation, e.g. the addition of parenthesis or braces. - */ - protected function initializeFixupMap() { - if ($this->fixupMap) return; - - $this->fixupMap = [ - Expr\PreInc::class => ['var' => self::FIXUP_PREC_RIGHT], - Expr\PreDec::class => ['var' => self::FIXUP_PREC_RIGHT], - Expr\PostInc::class => ['var' => self::FIXUP_PREC_LEFT], - Expr\PostDec::class => ['var' => self::FIXUP_PREC_LEFT], - Expr\Instanceof_::class => [ - 'expr' => self::FIXUP_PREC_LEFT, - 'class' => self::FIXUP_PREC_RIGHT, // TODO: FIXUP_NEW_VARIABLE - ], - Expr\Ternary::class => [ - 'cond' => self::FIXUP_PREC_LEFT, - 'else' => self::FIXUP_PREC_RIGHT, - ], - - Expr\FuncCall::class => ['name' => self::FIXUP_CALL_LHS], - Expr\StaticCall::class => ['class' => self::FIXUP_DEREF_LHS], - Expr\ArrayDimFetch::class => ['var' => self::FIXUP_DEREF_LHS], - Expr\ClassConstFetch::class => ['var' => self::FIXUP_DEREF_LHS], - Expr\New_::class => ['class' => self::FIXUP_DEREF_LHS], // TODO: FIXUP_NEW_VARIABLE - Expr\MethodCall::class => [ - 'var' => self::FIXUP_DEREF_LHS, - 'name' => self::FIXUP_BRACED_NAME, - ], - Expr\NullsafeMethodCall::class => [ - 'var' => self::FIXUP_DEREF_LHS, - 'name' => self::FIXUP_BRACED_NAME, - ], - Expr\StaticPropertyFetch::class => [ - 'class' => self::FIXUP_DEREF_LHS, - 'name' => self::FIXUP_VAR_BRACED_NAME, - ], - Expr\PropertyFetch::class => [ - 'var' => self::FIXUP_DEREF_LHS, - 'name' => self::FIXUP_BRACED_NAME, - ], - Expr\NullsafePropertyFetch::class => [ - 'var' => self::FIXUP_DEREF_LHS, - 'name' => self::FIXUP_BRACED_NAME, - ], - Scalar\Encapsed::class => [ - 'parts' => self::FIXUP_ENCAPSED, - ], - ]; - - $binaryOps = [ - BinaryOp\Pow::class, BinaryOp\Mul::class, BinaryOp\Div::class, BinaryOp\Mod::class, - BinaryOp\Plus::class, BinaryOp\Minus::class, BinaryOp\Concat::class, - BinaryOp\ShiftLeft::class, BinaryOp\ShiftRight::class, BinaryOp\Smaller::class, - BinaryOp\SmallerOrEqual::class, BinaryOp\Greater::class, BinaryOp\GreaterOrEqual::class, - BinaryOp\Equal::class, BinaryOp\NotEqual::class, BinaryOp\Identical::class, - BinaryOp\NotIdentical::class, BinaryOp\Spaceship::class, BinaryOp\BitwiseAnd::class, - BinaryOp\BitwiseXor::class, BinaryOp\BitwiseOr::class, BinaryOp\BooleanAnd::class, - BinaryOp\BooleanOr::class, BinaryOp\Coalesce::class, BinaryOp\LogicalAnd::class, - BinaryOp\LogicalXor::class, BinaryOp\LogicalOr::class, - ]; - foreach ($binaryOps as $binaryOp) { - $this->fixupMap[$binaryOp] = [ - 'left' => self::FIXUP_PREC_LEFT, - 'right' => self::FIXUP_PREC_RIGHT - ]; - } - - $assignOps = [ - Expr\Assign::class, Expr\AssignRef::class, AssignOp\Plus::class, AssignOp\Minus::class, - AssignOp\Mul::class, AssignOp\Div::class, AssignOp\Concat::class, AssignOp\Mod::class, - AssignOp\BitwiseAnd::class, AssignOp\BitwiseOr::class, AssignOp\BitwiseXor::class, - AssignOp\ShiftLeft::class, AssignOp\ShiftRight::class, AssignOp\Pow::class, AssignOp\Coalesce::class - ]; - foreach ($assignOps as $assignOp) { - $this->fixupMap[$assignOp] = [ - 'var' => self::FIXUP_PREC_LEFT, - 'expr' => self::FIXUP_PREC_RIGHT, - ]; - } - - $prefixOps = [ - Expr\BitwiseNot::class, Expr\BooleanNot::class, Expr\UnaryPlus::class, Expr\UnaryMinus::class, - Cast\Int_::class, Cast\Double::class, Cast\String_::class, Cast\Array_::class, - Cast\Object_::class, Cast\Bool_::class, Cast\Unset_::class, Expr\ErrorSuppress::class, - Expr\YieldFrom::class, Expr\Print_::class, Expr\Include_::class, - ]; - foreach ($prefixOps as $prefixOp) { - $this->fixupMap[$prefixOp] = ['expr' => self::FIXUP_PREC_RIGHT]; - } - } - - /** - * Lazily initializes the removal map. - * - * The removal map is used to determine which additional tokens should be removed when a - * certain node is replaced by null. - */ - protected function initializeRemovalMap() { - if ($this->removalMap) return; - - $stripBoth = ['left' => \T_WHITESPACE, 'right' => \T_WHITESPACE]; - $stripLeft = ['left' => \T_WHITESPACE]; - $stripRight = ['right' => \T_WHITESPACE]; - $stripDoubleArrow = ['right' => \T_DOUBLE_ARROW]; - $stripColon = ['left' => ':']; - $stripEquals = ['left' => '=']; - $this->removalMap = [ - 'Expr_ArrayDimFetch->dim' => $stripBoth, - 'Expr_ArrayItem->key' => $stripDoubleArrow, - 'Expr_ArrowFunction->returnType' => $stripColon, - 'Expr_Closure->returnType' => $stripColon, - 'Expr_Exit->expr' => $stripBoth, - 'Expr_Ternary->if' => $stripBoth, - 'Expr_Yield->key' => $stripDoubleArrow, - 'Expr_Yield->value' => $stripBoth, - 'Param->type' => $stripRight, - 'Param->default' => $stripEquals, - 'Stmt_Break->num' => $stripBoth, - 'Stmt_Catch->var' => $stripLeft, - 'Stmt_ClassMethod->returnType' => $stripColon, - 'Stmt_Class->extends' => ['left' => \T_EXTENDS], - 'Stmt_Enum->scalarType' => $stripColon, - 'Stmt_EnumCase->expr' => $stripEquals, - 'Expr_PrintableNewAnonClass->extends' => ['left' => \T_EXTENDS], - 'Stmt_Continue->num' => $stripBoth, - 'Stmt_Foreach->keyVar' => $stripDoubleArrow, - 'Stmt_Function->returnType' => $stripColon, - 'Stmt_If->else' => $stripLeft, - 'Stmt_Namespace->name' => $stripLeft, - 'Stmt_Property->type' => $stripRight, - 'Stmt_PropertyProperty->default' => $stripEquals, - 'Stmt_Return->expr' => $stripBoth, - 'Stmt_StaticVar->default' => $stripEquals, - 'Stmt_TraitUseAdaptation_Alias->newName' => $stripLeft, - 'Stmt_TryCatch->finally' => $stripLeft, - // 'Stmt_Case->cond': Replace with "default" - // 'Stmt_Class->name': Unclear what to do - // 'Stmt_Declare->stmts': Not a plain node - // 'Stmt_TraitUseAdaptation_Alias->newModifier': Not a plain node - ]; - } - - protected function initializeInsertionMap() { - if ($this->insertionMap) return; - - // TODO: "yield" where both key and value are inserted doesn't work - // [$find, $beforeToken, $extraLeft, $extraRight] - $this->insertionMap = [ - 'Expr_ArrayDimFetch->dim' => ['[', false, null, null], - 'Expr_ArrayItem->key' => [null, false, null, ' => '], - 'Expr_ArrowFunction->returnType' => [')', false, ' : ', null], - 'Expr_Closure->returnType' => [')', false, ' : ', null], - 'Expr_Ternary->if' => ['?', false, ' ', ' '], - 'Expr_Yield->key' => [\T_YIELD, false, null, ' => '], - 'Expr_Yield->value' => [\T_YIELD, false, ' ', null], - 'Param->type' => [null, false, null, ' '], - 'Param->default' => [null, false, ' = ', null], - 'Stmt_Break->num' => [\T_BREAK, false, ' ', null], - 'Stmt_Catch->var' => [null, false, ' ', null], - 'Stmt_ClassMethod->returnType' => [')', false, ' : ', null], - 'Stmt_Class->extends' => [null, false, ' extends ', null], - 'Stmt_Enum->scalarType' => [null, false, ' : ', null], - 'Stmt_EnumCase->expr' => [null, false, ' = ', null], - 'Expr_PrintableNewAnonClass->extends' => [null, ' extends ', null], - 'Stmt_Continue->num' => [\T_CONTINUE, false, ' ', null], - 'Stmt_Foreach->keyVar' => [\T_AS, false, null, ' => '], - 'Stmt_Function->returnType' => [')', false, ' : ', null], - 'Stmt_If->else' => [null, false, ' ', null], - 'Stmt_Namespace->name' => [\T_NAMESPACE, false, ' ', null], - 'Stmt_Property->type' => [\T_VARIABLE, true, null, ' '], - 'Stmt_PropertyProperty->default' => [null, false, ' = ', null], - 'Stmt_Return->expr' => [\T_RETURN, false, ' ', null], - 'Stmt_StaticVar->default' => [null, false, ' = ', null], - //'Stmt_TraitUseAdaptation_Alias->newName' => [T_AS, false, ' ', null], // TODO - 'Stmt_TryCatch->finally' => [null, false, ' ', null], - - // 'Expr_Exit->expr': Complicated due to optional () - // 'Stmt_Case->cond': Conversion from default to case - // 'Stmt_Class->name': Unclear - // 'Stmt_Declare->stmts': Not a proper node - // 'Stmt_TraitUseAdaptation_Alias->newModifier': Not a proper node - ]; - } - - protected function initializeListInsertionMap() { - if ($this->listInsertionMap) return; - - $this->listInsertionMap = [ - // special - //'Expr_ShellExec->parts' => '', // TODO These need to be treated more carefully - //'Scalar_Encapsed->parts' => '', - 'Stmt_Catch->types' => '|', - 'UnionType->types' => '|', - 'IntersectionType->types' => '&', - 'Stmt_If->elseifs' => ' ', - 'Stmt_TryCatch->catches' => ' ', - - // comma-separated lists - 'Expr_Array->items' => ', ', - 'Expr_ArrowFunction->params' => ', ', - 'Expr_Closure->params' => ', ', - 'Expr_Closure->uses' => ', ', - 'Expr_FuncCall->args' => ', ', - 'Expr_Isset->vars' => ', ', - 'Expr_List->items' => ', ', - 'Expr_MethodCall->args' => ', ', - 'Expr_NullsafeMethodCall->args' => ', ', - 'Expr_New->args' => ', ', - 'Expr_PrintableNewAnonClass->args' => ', ', - 'Expr_StaticCall->args' => ', ', - 'Stmt_ClassConst->consts' => ', ', - 'Stmt_ClassMethod->params' => ', ', - 'Stmt_Class->implements' => ', ', - 'Stmt_Enum->implements' => ', ', - 'Expr_PrintableNewAnonClass->implements' => ', ', - 'Stmt_Const->consts' => ', ', - 'Stmt_Declare->declares' => ', ', - 'Stmt_Echo->exprs' => ', ', - 'Stmt_For->init' => ', ', - 'Stmt_For->cond' => ', ', - 'Stmt_For->loop' => ', ', - 'Stmt_Function->params' => ', ', - 'Stmt_Global->vars' => ', ', - 'Stmt_GroupUse->uses' => ', ', - 'Stmt_Interface->extends' => ', ', - 'Stmt_Match->arms' => ', ', - 'Stmt_Property->props' => ', ', - 'Stmt_StaticVar->vars' => ', ', - 'Stmt_TraitUse->traits' => ', ', - 'Stmt_TraitUseAdaptation_Precedence->insteadof' => ', ', - 'Stmt_Unset->vars' => ', ', - 'Stmt_Use->uses' => ', ', - 'MatchArm->conds' => ', ', - 'AttributeGroup->attrs' => ', ', - - // statement lists - 'Expr_Closure->stmts' => "\n", - 'Stmt_Case->stmts' => "\n", - 'Stmt_Catch->stmts' => "\n", - 'Stmt_Class->stmts' => "\n", - 'Stmt_Enum->stmts' => "\n", - 'Expr_PrintableNewAnonClass->stmts' => "\n", - 'Stmt_Interface->stmts' => "\n", - 'Stmt_Trait->stmts' => "\n", - 'Stmt_ClassMethod->stmts' => "\n", - 'Stmt_Declare->stmts' => "\n", - 'Stmt_Do->stmts' => "\n", - 'Stmt_ElseIf->stmts' => "\n", - 'Stmt_Else->stmts' => "\n", - 'Stmt_Finally->stmts' => "\n", - 'Stmt_Foreach->stmts' => "\n", - 'Stmt_For->stmts' => "\n", - 'Stmt_Function->stmts' => "\n", - 'Stmt_If->stmts' => "\n", - 'Stmt_Namespace->stmts' => "\n", - 'Stmt_Class->attrGroups' => "\n", - 'Stmt_Enum->attrGroups' => "\n", - 'Stmt_EnumCase->attrGroups' => "\n", - 'Stmt_Interface->attrGroups' => "\n", - 'Stmt_Trait->attrGroups' => "\n", - 'Stmt_Function->attrGroups' => "\n", - 'Stmt_ClassMethod->attrGroups' => "\n", - 'Stmt_ClassConst->attrGroups' => "\n", - 'Stmt_Property->attrGroups' => "\n", - 'Expr_PrintableNewAnonClass->attrGroups' => ' ', - 'Expr_Closure->attrGroups' => ' ', - 'Expr_ArrowFunction->attrGroups' => ' ', - 'Param->attrGroups' => ' ', - 'Stmt_Switch->cases' => "\n", - 'Stmt_TraitUse->adaptations' => "\n", - 'Stmt_TryCatch->stmts' => "\n", - 'Stmt_While->stmts' => "\n", - - // dummy for top-level context - 'File->stmts' => "\n", - ]; - } - - protected function initializeEmptyListInsertionMap() { - if ($this->emptyListInsertionMap) return; - - // TODO Insertion into empty statement lists. - - // [$find, $extraLeft, $extraRight] - $this->emptyListInsertionMap = [ - 'Expr_ArrowFunction->params' => ['(', '', ''], - 'Expr_Closure->uses' => [')', ' use(', ')'], - 'Expr_Closure->params' => ['(', '', ''], - 'Expr_FuncCall->args' => ['(', '', ''], - 'Expr_MethodCall->args' => ['(', '', ''], - 'Expr_NullsafeMethodCall->args' => ['(', '', ''], - 'Expr_New->args' => ['(', '', ''], - 'Expr_PrintableNewAnonClass->args' => ['(', '', ''], - 'Expr_PrintableNewAnonClass->implements' => [null, ' implements ', ''], - 'Expr_StaticCall->args' => ['(', '', ''], - 'Stmt_Class->implements' => [null, ' implements ', ''], - 'Stmt_Enum->implements' => [null, ' implements ', ''], - 'Stmt_ClassMethod->params' => ['(', '', ''], - 'Stmt_Interface->extends' => [null, ' extends ', ''], - 'Stmt_Function->params' => ['(', '', ''], - 'Stmt_Interface->attrGroups' => [null, '', "\n"], - 'Stmt_Class->attrGroups' => [null, '', "\n"], - 'Stmt_ClassConst->attrGroups' => [null, '', "\n"], - 'Stmt_ClassMethod->attrGroups' => [null, '', "\n"], - 'Stmt_Function->attrGroups' => [null, '', "\n"], - 'Stmt_Property->attrGroups' => [null, '', "\n"], - 'Stmt_Trait->attrGroups' => [null, '', "\n"], - 'Expr_ArrowFunction->attrGroups' => [null, '', ' '], - 'Expr_Closure->attrGroups' => [null, '', ' '], - 'Expr_PrintableNewAnonClass->attrGroups' => [\T_NEW, ' ', ''], - - /* These cannot be empty to start with: - * Expr_Isset->vars - * Stmt_Catch->types - * Stmt_Const->consts - * Stmt_ClassConst->consts - * Stmt_Declare->declares - * Stmt_Echo->exprs - * Stmt_Global->vars - * Stmt_GroupUse->uses - * Stmt_Property->props - * Stmt_StaticVar->vars - * Stmt_TraitUse->traits - * Stmt_TraitUseAdaptation_Precedence->insteadof - * Stmt_Unset->vars - * Stmt_Use->uses - * UnionType->types - */ - - /* TODO - * Stmt_If->elseifs - * Stmt_TryCatch->catches - * Expr_Array->items - * Expr_List->items - * Stmt_For->init - * Stmt_For->cond - * Stmt_For->loop - */ - ]; - } - - protected function initializeModifierChangeMap() { - if ($this->modifierChangeMap) return; - - $this->modifierChangeMap = [ - 'Stmt_ClassConst->flags' => \T_CONST, - 'Stmt_ClassMethod->flags' => \T_FUNCTION, - 'Stmt_Class->flags' => \T_CLASS, - 'Stmt_Property->flags' => \T_VARIABLE, - 'Param->flags' => \T_VARIABLE, - //'Stmt_TraitUseAdaptation_Alias->newModifier' => 0, // TODO - ]; - - // List of integer subnodes that are not modifiers: - // Expr_Include->type - // Stmt_GroupUse->type - // Stmt_Use->type - // Stmt_UseUse->type - } -} diff --git a/vendor/nunomaduro/termwind/LICENSE.md b/vendor/nunomaduro/termwind/LICENSE.md deleted file mode 100755 index 14b90ed4..00000000 --- a/vendor/nunomaduro/termwind/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Nuno Maduro <enunomaduro@gmail.com> - -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/nunomaduro/termwind/composer.json b/vendor/nunomaduro/termwind/composer.json deleted file mode 100644 index 6c4f59b6..00000000 --- a/vendor/nunomaduro/termwind/composer.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "name": "nunomaduro/termwind", - "description": "Its like Tailwind CSS, but for the console.", - "keywords": ["php", "cli", "package", "console", "css", "style"], - "license": "MIT", - "authors": [ - { - "name": "Nuno Maduro", - "email": "enunomaduro@gmail.com" - } - ], - "require": { - "php": "^8.0", - "ext-mbstring": "*", - "symfony/console": "^5.3.0|^6.0.0" - }, - "require-dev": { - "ergebnis/phpstan-rules": "^1.0.", - "illuminate/console": "^8.0|^9.0", - "illuminate/support": "^8.0|^9.0", - "laravel/pint": "^1.0.0", - "pestphp/pest": "^1.21.0", - "pestphp/pest-plugin-mock": "^1.0", - "phpstan/phpstan": "^1.4.6", - "phpstan/phpstan-strict-rules": "^1.1.0", - "symfony/var-dumper": "^5.2.7|^6.0.0", - "thecodingmachine/phpstan-strict-rules": "^1.0.0" - }, - "autoload": { - "psr-4": { - "Termwind\\": "src/" - }, - "files": [ - "src/Functions.php" - ] - }, - "autoload-dev": { - "psr-4": { - "Tests\\": "tests/" - } - }, - "minimum-stability": "dev", - "prefer-stable": true, - "config": { - "sort-packages": true, - "preferred-install": "dist", - "allow-plugins": { - "pestphp/pest-plugin": true - } - }, - "scripts": { - "lint": "pint -v", - "test:lint": "pint --test -v", - "test:types": "phpstan analyse --ansi", - "test:unit": "pest --colors=always", - "test": [ - "@test:lint", - "@test:types", - "@test:unit" - ] - }, - "extra": { - "laravel": { - "providers": [ - "Termwind\\Laravel\\TermwindServiceProvider" - ] - } - } -} diff --git a/vendor/nunomaduro/termwind/playground.php b/vendor/nunomaduro/termwind/playground.php deleted file mode 100644 index 9e6b8100..00000000 --- a/vendor/nunomaduro/termwind/playground.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -require_once __DIR__.'/vendor/autoload.php'; - -use function Termwind\render; - -render(<<<'HTML' - <div class="mx-2 my-1"> - <div class="flex space-x-1"> - <span class="flex-1 truncate">Lorem ipsum dolor, sit amet consectetur adipisicing elit. Sunt illo et nisi omnis porro at, mollitia harum quas esse, aperiam dolorem ab recusandae fugiat nesciunt doloribus rem eaque nostrum itaque.</span> - <span class="text-green">DONE</span> - </div> - </div> -HTML); diff --git a/vendor/nunomaduro/termwind/src/Actions/StyleToMethod.php b/vendor/nunomaduro/termwind/src/Actions/StyleToMethod.php deleted file mode 100644 index 6debb8fd..00000000 --- a/vendor/nunomaduro/termwind/src/Actions/StyleToMethod.php +++ /dev/null @@ -1,154 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Termwind\Actions; - -use Termwind\Exceptions\StyleNotFound; -use Termwind\Repositories\Styles as StyleRepository; -use Termwind\Terminal; -use Termwind\ValueObjects\Styles; - -/** - * @internal - */ -final class StyleToMethod -{ - /** - * Finds if there is any media query on the style class. - */ - private const MEDIA_QUERIES_REGEX = "/^(sm|md|lg|xl|2xl)\:(.*)/"; - - /** - * Defines the Media Query Breakpoints. - */ - public const MEDIA_QUERY_BREAKPOINTS = [ - 'sm' => 64, - 'md' => 76, - 'lg' => 102, - 'xl' => 128, - '2xl' => 153, - ]; - - /** - * Creates a new action instance. - */ - public function __construct( - private Styles $styles, - private string $style, - ) { - // .. - } - - /** - * Applies multiple styles to the given styles. - */ - public static function multiple(Styles $styles, string $stylesString): Styles - { - $stylesString = self::sortStyles(array_merge( - $styles->defaultStyles(), - array_filter((array) preg_split('/(?![^\[]*\])\s/', $stylesString)) - )); - - foreach ($stylesString as $style) { - $styles = (new self($styles, $style))->__invoke(); - } - - return $styles; - } - - /** - * Converts the given style to a method name. - * - * @return Styles - */ - public function __invoke(string|int ...$arguments): Styles - { - if (StyleRepository::has($this->style)) { - return StyleRepository::get($this->style)($this->styles, ...$arguments); - } - - $method = $this->applyMediaQuery($this->style); - - if ($method === '') { - return $this->styles; - } - - $method = array_filter( - (array) preg_split('/(?![^\[]*\])-/', $method), - fn ($item) => $item !== false - ); - - $method = array_slice($method, 0, count($method) - count($arguments)); - - $methodName = implode(' ', $method); - $methodName = ucwords($methodName); - $methodName = lcfirst($methodName); - $methodName = str_replace(' ', '', $methodName); - - if ($methodName === '') { - throw StyleNotFound::fromStyle($this->style); - } - - if (! method_exists($this->styles, $methodName)) { - $argument = array_pop($method); - - $arguments[] = is_numeric($argument) ? (int) $argument : (string) $argument; - - return $this->__invoke(...$arguments); - } - - return $this->styles - ->setStyle($this->style) - ->$methodName(...array_reverse($arguments)); - } - - /** - * Sorts all the styles based on the correct render order. - * - * @param string[] $styles - * @return string[] - */ - private static function sortStyles(array $styles): array - { - $keys = array_keys(self::MEDIA_QUERY_BREAKPOINTS); - - usort($styles, function ($a, $b) use ($keys) { - $existsA = (bool) preg_match(self::MEDIA_QUERIES_REGEX, $a, $matchesA); - $existsB = (bool) preg_match(self::MEDIA_QUERIES_REGEX, $b, $matchesB); - - if ($existsA && ! $existsB) { - return 1; - } - - if ($existsA && array_search($matchesA[1], $keys, true) > array_search($matchesB[1], $keys, true)) { - return 1; - } - - return -1; - }); - - return $styles; - } - - /** - * Applies the media query if exists. - */ - private function applyMediaQuery(string $method): string - { - $matches = []; - preg_match(self::MEDIA_QUERIES_REGEX, $method, $matches); - - if (count($matches) < 1) { - return $method; - } - - [, $size, $method] = $matches; - - if ((new Terminal)->width() >= self::MEDIA_QUERY_BREAKPOINTS[$size]) { - return $method; - } - - return ''; - } -} diff --git a/vendor/nunomaduro/termwind/src/Components/Anchor.php b/vendor/nunomaduro/termwind/src/Components/Anchor.php deleted file mode 100644 index aa29fa20..00000000 --- a/vendor/nunomaduro/termwind/src/Components/Anchor.php +++ /dev/null @@ -1,9 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Termwind\Components; - -final class Anchor extends Element -{ -} diff --git a/vendor/nunomaduro/termwind/src/Components/BreakLine.php b/vendor/nunomaduro/termwind/src/Components/BreakLine.php deleted file mode 100644 index a979a715..00000000 --- a/vendor/nunomaduro/termwind/src/Components/BreakLine.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Termwind\Components; - -final class BreakLine extends Element -{ - /** - * Get the string representation of the element. - */ - public function toString(): string - { - $display = $this->styles->getProperties()['styles']['display'] ?? 'inline'; - - if ($display === 'hidden') { - return ''; - } - - if ($display === 'block') { - return parent::toString(); - } - - return parent::toString()."\r"; - } -} diff --git a/vendor/nunomaduro/termwind/src/Components/Dd.php b/vendor/nunomaduro/termwind/src/Components/Dd.php deleted file mode 100644 index 9f6cafed..00000000 --- a/vendor/nunomaduro/termwind/src/Components/Dd.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Termwind\Components; - -final class Dd extends Element -{ - protected static array $defaultStyles = ['block', 'ml-4']; -} diff --git a/vendor/nunomaduro/termwind/src/Components/Div.php b/vendor/nunomaduro/termwind/src/Components/Div.php deleted file mode 100644 index 657d0ce0..00000000 --- a/vendor/nunomaduro/termwind/src/Components/Div.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Termwind\Components; - -final class Div extends Element -{ - protected static array $defaultStyles = ['block']; -} diff --git a/vendor/nunomaduro/termwind/src/Components/Dl.php b/vendor/nunomaduro/termwind/src/Components/Dl.php deleted file mode 100644 index 6594edab..00000000 --- a/vendor/nunomaduro/termwind/src/Components/Dl.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Termwind\Components; - -final class Dl extends Element -{ - protected static array $defaultStyles = ['block']; -} diff --git a/vendor/nunomaduro/termwind/src/Components/Dt.php b/vendor/nunomaduro/termwind/src/Components/Dt.php deleted file mode 100644 index 42b29dac..00000000 --- a/vendor/nunomaduro/termwind/src/Components/Dt.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Termwind\Components; - -final class Dt extends Element -{ - protected static array $defaultStyles = ['block', 'font-bold']; -} diff --git a/vendor/nunomaduro/termwind/src/Components/Element.php b/vendor/nunomaduro/termwind/src/Components/Element.php deleted file mode 100644 index 9ec8fbfc..00000000 --- a/vendor/nunomaduro/termwind/src/Components/Element.php +++ /dev/null @@ -1,121 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Termwind\Components; - -use Symfony\Component\Console\Output\OutputInterface; -use Termwind\Actions\StyleToMethod; -use Termwind\Html\InheritStyles; -use Termwind\ValueObjects\Styles; - -/** - * @internal - * - * @method Element inheritFromStyles(Styles $styles) - * @method Element fontBold() - * @method Element strong() - * @method Element italic() - * @method Element underline() - * @method Element lineThrough() - * @method int getLength() - * @method int getInnerWidth() - * @method array getProperties() - * @method Element href(string $href) - * @method bool hasStyle(string $style) - * @method Element addStyle(string $style) - */ -abstract class Element -{ - /** @var string[] */ - protected static array $defaultStyles = []; - - protected Styles $styles; - - /** - * Creates an element instance. - * - * @param array<int, Element|string>|string $content - */ - final public function __construct( - protected OutputInterface $output, - protected array|string $content, - Styles|null $styles = null - ) { - $this->styles = $styles ?? new Styles(defaultStyles: static::$defaultStyles); - $this->styles->setElement($this); - } - - /** - * Creates an element instance with the given styles. - * - * @param array<int, Element|string>|string $content - * @param array<string, mixed> $properties - */ - final public static function fromStyles(OutputInterface $output, array|string $content, string $styles = '', array $properties = []): static - { - $element = new static($output, $content); - if ($properties !== []) { - $element->styles->setProperties($properties); - } - - $elementStyles = StyleToMethod::multiple($element->styles, $styles); - - return new static($output, $content, $elementStyles); - } - - /** - * Get the string representation of the element. - */ - public function toString(): string - { - if (is_array($this->content)) { - $inheritance = new InheritStyles(); - $this->content = implode('', $inheritance($this->content, $this->styles)); - } - - return $this->styles->format($this->content); - } - - /** - * @param array<int, mixed> $arguments - */ - public function __call(string $name, array $arguments): mixed - { - if (method_exists($this->styles, $name)) { - $result = $this->styles->{$name}(...$arguments); - - if (str_starts_with($name, 'get') || str_starts_with($name, 'has')) { - return $result; - } - } - - return $this; - } - - /** - * Sets the content of the element. - * - * @param array<int, Element|string>|string $content - */ - final public function setContent(array|string $content): static - { - return new static($this->output, $content, $this->styles); - } - - /** - * Renders the string representation of the element on the output. - */ - final public function render(int $options): void - { - $this->output->writeln($this->toString(), $options); - } - - /** - * Get the string representation of the element. - */ - final public function __toString(): string - { - return $this->toString(); - } -} diff --git a/vendor/nunomaduro/termwind/src/Components/Hr.php b/vendor/nunomaduro/termwind/src/Components/Hr.php deleted file mode 100644 index e7fcc0f1..00000000 --- a/vendor/nunomaduro/termwind/src/Components/Hr.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Termwind\Components; - -final class Hr extends Element -{ - protected static array $defaultStyles = ['block', 'border-t']; -} diff --git a/vendor/nunomaduro/termwind/src/Components/Li.php b/vendor/nunomaduro/termwind/src/Components/Li.php deleted file mode 100644 index 40b4a15a..00000000 --- a/vendor/nunomaduro/termwind/src/Components/Li.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Termwind\Components; - -final class Li extends Element -{ - protected static array $defaultStyles = ['block']; -} diff --git a/vendor/nunomaduro/termwind/src/Components/Ol.php b/vendor/nunomaduro/termwind/src/Components/Ol.php deleted file mode 100644 index 37774e91..00000000 --- a/vendor/nunomaduro/termwind/src/Components/Ol.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Termwind\Components; - -final class Ol extends Element -{ - protected static array $defaultStyles = ['block', 'list-decimal']; -} diff --git a/vendor/nunomaduro/termwind/src/Components/Paragraph.php b/vendor/nunomaduro/termwind/src/Components/Paragraph.php deleted file mode 100644 index 5c39dbe2..00000000 --- a/vendor/nunomaduro/termwind/src/Components/Paragraph.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Termwind\Components; - -final class Paragraph extends Element -{ - protected static array $defaultStyles = ['block', 'my-1']; -} diff --git a/vendor/nunomaduro/termwind/src/Components/Raw.php b/vendor/nunomaduro/termwind/src/Components/Raw.php deleted file mode 100644 index a69467f2..00000000 --- a/vendor/nunomaduro/termwind/src/Components/Raw.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Termwind\Components; - -/** - * @internal - */ -final class Raw extends Element -{ - /** - * Get the string representation of the element. - */ - public function toString(): string - { - return is_array($this->content) ? implode('', $this->content) : $this->content; - } -} diff --git a/vendor/nunomaduro/termwind/src/Components/Span.php b/vendor/nunomaduro/termwind/src/Components/Span.php deleted file mode 100644 index 9f50a636..00000000 --- a/vendor/nunomaduro/termwind/src/Components/Span.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Termwind\Components; - -final class Span extends Element -{ - // .. -} diff --git a/vendor/nunomaduro/termwind/src/Components/Ul.php b/vendor/nunomaduro/termwind/src/Components/Ul.php deleted file mode 100644 index c2261105..00000000 --- a/vendor/nunomaduro/termwind/src/Components/Ul.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Termwind\Components; - -final class Ul extends Element -{ - protected static array $defaultStyles = ['block', 'list-disc']; -} diff --git a/vendor/nunomaduro/termwind/src/Enums/Color.php b/vendor/nunomaduro/termwind/src/Enums/Color.php deleted file mode 100644 index ea920150..00000000 --- a/vendor/nunomaduro/termwind/src/Enums/Color.php +++ /dev/null @@ -1,482 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Termwind\Enums; - -final class Color -{ - public const BLACK = 'black'; - - public const WHITE = 'white'; - - public const BRIGHTWHITE = 'bright-white'; - - public const SLATE_50 = '#f8fafc'; - - public const SLATE_100 = '#f1f5f9'; - - public const SLATE_200 = '#e2e8f0'; - - public const SLATE_300 = '#cbd5e1'; - - public const SLATE_400 = '#94a3b8'; - - public const SLATE_500 = '#64748b'; - - public const SLATE_600 = '#475569'; - - public const SLATE_700 = '#334155'; - - public const SLATE_800 = '#1e293b'; - - public const SLATE_900 = '#0f172a'; - - public const GRAY = 'gray'; - - public const GRAY_50 = '#f9fafb'; - - public const GRAY_100 = '#f3f4f6'; - - public const GRAY_200 = '#e5e7eb'; - - public const GRAY_300 = '#d1d5db'; - - public const GRAY_400 = '#9ca3af'; - - public const GRAY_500 = '#6b7280'; - - public const GRAY_600 = '#4b5563'; - - public const GRAY_700 = '#374151'; - - public const GRAY_800 = '#1f2937'; - - public const GRAY_900 = '#111827'; - - public const ZINC_50 = '#fafafa'; - - public const ZINC_100 = '#f4f4f5'; - - public const ZINC_200 = '#e4e4e7'; - - public const ZINC_300 = '#d4d4d8'; - - public const ZINC_400 = '#a1a1aa'; - - public const ZINC_500 = '#71717a'; - - public const ZINC_600 = '#52525b'; - - public const ZINC_700 = '#3f3f46'; - - public const ZINC_800 = '#27272a'; - - public const ZINC_900 = '#18181b'; - - public const NEUTRAL_50 = '#fafafa'; - - public const NEUTRAL_100 = '#f5f5f5'; - - public const NEUTRAL_200 = '#e5e5e5'; - - public const NEUTRAL_300 = '#d4d4d4'; - - public const NEUTRAL_400 = '#a3a3a3'; - - public const NEUTRAL_500 = '#737373'; - - public const NEUTRAL_600 = '#525252'; - - public const NEUTRAL_700 = '#404040'; - - public const NEUTRAL_800 = '#262626'; - - public const NEUTRAL_900 = '#171717'; - - public const STONE_50 = '#fafaf9'; - - public const STONE_100 = '#f5f5f4'; - - public const STONE_200 = '#e7e5e4'; - - public const STONE_300 = '#d6d3d1'; - - public const STONE_400 = '#a8a29e'; - - public const STONE_500 = '#78716c'; - - public const STONE_600 = '#57534e'; - - public const STONE_700 = '#44403c'; - - public const STONE_800 = '#292524'; - - public const STONE_900 = '#1c1917'; - - public const RED = 'red'; - - public const BRIGHTRED = 'bright-red'; - - public const RED_50 = '#fef2f2'; - - public const RED_100 = '#fee2e2'; - - public const RED_200 = '#fecaca'; - - public const RED_300 = '#fca5a5'; - - public const RED_400 = '#f87171'; - - public const RED_500 = '#ef4444'; - - public const RED_600 = '#dc2626'; - - public const RED_700 = '#b91c1c'; - - public const RED_800 = '#991b1b'; - - public const RED_900 = '#7f1d1d'; - - public const ORANGE = '#f97316'; - - public const ORANGE_50 = '#fff7ed'; - - public const ORANGE_100 = '#ffedd5'; - - public const ORANGE_200 = '#fed7aa'; - - public const ORANGE_300 = '#fdba74'; - - public const ORANGE_400 = '#fb923c'; - - public const ORANGE_500 = '#f97316'; - - public const ORANGE_600 = '#ea580c'; - - public const ORANGE_700 = '#c2410c'; - - public const ORANGE_800 = '#9a3412'; - - public const ORANGE_900 = '#7c2d12'; - - public const AMBER_50 = '#fffbeb'; - - public const AMBER_100 = '#fef3c7'; - - public const AMBER_200 = '#fde68a'; - - public const AMBER_300 = '#fcd34d'; - - public const AMBER_400 = '#fbbf24'; - - public const AMBER_500 = '#f59e0b'; - - public const AMBER_600 = '#d97706'; - - public const AMBER_700 = '#b45309'; - - public const AMBER_800 = '#92400e'; - - public const AMBER_900 = '#78350f'; - - public const YELLOW = 'yellow'; - - public const BRIGHTYELLOW = 'bright-yellow'; - - public const YELLOW_50 = '#fefce8'; - - public const YELLOW_100 = '#fef9c3'; - - public const YELLOW_200 = '#fef08a'; - - public const YELLOW_300 = '#fde047'; - - public const YELLOW_400 = '#facc15'; - - public const YELLOW_500 = '#eab308'; - - public const YELLOW_600 = '#ca8a04'; - - public const YELLOW_700 = '#a16207'; - - public const YELLOW_800 = '#854d0e'; - - public const YELLOW_900 = '#713f12'; - - public const LIME_50 = '#f7fee7'; - - public const LIME_100 = '#ecfccb'; - - public const LIME_200 = '#d9f99d'; - - public const LIME_300 = '#bef264'; - - public const LIME_400 = '#a3e635'; - - public const LIME_500 = '#84cc16'; - - public const LIME_600 = '#65a30d'; - - public const LIME_700 = '#4d7c0f'; - - public const LIME_800 = '#3f6212'; - - public const LIME_900 = '#365314'; - - public const GREEN = 'green'; - - public const BRIGHTGREEN = 'bright-green'; - - public const GREEN_50 = '#f0fdf4'; - - public const GREEN_100 = '#dcfce7'; - - public const GREEN_200 = '#bbf7d0'; - - public const GREEN_300 = '#86efac'; - - public const GREEN_400 = '#4ade80'; - - public const GREEN_500 = '#22c55e'; - - public const GREEN_600 = '#16a34a'; - - public const GREEN_700 = '#15803d'; - - public const GREEN_800 = '#166534'; - - public const GREEN_900 = '#14532d'; - - public const EMERALD_50 = '#ecfdf5'; - - public const EMERALD_100 = '#d1fae5'; - - public const EMERALD_200 = '#a7f3d0'; - - public const EMERALD_300 = '#6ee7b7'; - - public const EMERALD_400 = '#34d399'; - - public const EMERALD_500 = '#10b981'; - - public const EMERALD_600 = '#059669'; - - public const EMERALD_700 = '#047857'; - - public const EMERALD_800 = '#065f46'; - - public const EMERALD_900 = '#064e3b'; - - public const TEAL_50 = '#f0fdfa'; - - public const TEAL_100 = '#ccfbf1'; - - public const TEAL_200 = '#99f6e4'; - - public const TEAL_300 = '#5eead4'; - - public const TEAL_400 = '#2dd4bf'; - - public const TEAL_500 = '#14b8a6'; - - public const TEAL_600 = '#0d9488'; - - public const TEAL_700 = '#0f766e'; - - public const TEAL_800 = '#115e59'; - - public const TEAL_900 = '#134e4a'; - - public const CYAN = 'cyan'; - - public const BRIGHTCYAN = 'bright-cyan'; - - public const CYAN_50 = '#ecfeff'; - - public const CYAN_100 = '#cffafe'; - - public const CYAN_200 = '#a5f3fc'; - - public const CYAN_300 = '#67e8f9'; - - public const CYAN_400 = '#22d3ee'; - - public const CYAN_500 = '#06b6d4'; - - public const CYAN_600 = '#0891b2'; - - public const CYAN_700 = '#0e7490'; - - public const CYAN_800 = '#155e75'; - - public const CYAN_900 = '#164e63'; - - public const SKY_50 = '#f0f9ff'; - - public const SKY_100 = '#e0f2fe'; - - public const SKY_200 = '#bae6fd'; - - public const SKY_300 = '#7dd3fc'; - - public const SKY_400 = '#38bdf8'; - - public const SKY_500 = '#0ea5e9'; - - public const SKY_600 = '#0284c7'; - - public const SKY_700 = '#0369a1'; - - public const SKY_800 = '#075985'; - - public const SKY_900 = '#0c4a6e'; - - public const BLUE = 'blue'; - - public const BRIGHTBLUE = 'bright-blue'; - - public const BLUE_50 = '#eff6ff'; - - public const BLUE_100 = '#dbeafe'; - - public const BLUE_200 = '#bfdbfe'; - - public const BLUE_300 = '#93c5fd'; - - public const BLUE_400 = '#60a5fa'; - - public const BLUE_500 = '#3b82f6'; - - public const BLUE_600 = '#2563eb'; - - public const BLUE_700 = '#1d4ed8'; - - public const BLUE_800 = '#1e40af'; - - public const BLUE_900 = '#1e3a8a'; - - public const INDIGO_50 = '#eef2ff'; - - public const INDIGO_100 = '#e0e7ff'; - - public const INDIGO_200 = '#c7d2fe'; - - public const INDIGO_300 = '#a5b4fc'; - - public const INDIGO_400 = '#818cf8'; - - public const INDIGO_500 = '#6366f1'; - - public const INDIGO_600 = '#4f46e5'; - - public const INDIGO_700 = '#4338ca'; - - public const INDIGO_800 = '#3730a3'; - - public const INDIGO_900 = '#312e81'; - - public const VIOLET_50 = '#f5f3ff'; - - public const VIOLET_100 = '#ede9fe'; - - public const VIOLET_200 = '#ddd6fe'; - - public const VIOLET_300 = '#c4b5fd'; - - public const VIOLET_400 = '#a78bfa'; - - public const VIOLET_500 = '#8b5cf6'; - - public const VIOLET_600 = '#7c3aed'; - - public const VIOLET_700 = '#6d28d9'; - - public const VIOLET_800 = '#5b21b6'; - - public const VIOLET_900 = '#4c1d95'; - - public const PURPLE_50 = '#faf5ff'; - - public const PURPLE_100 = '#f3e8ff'; - - public const PURPLE_200 = '#e9d5ff'; - - public const PURPLE_300 = '#d8b4fe'; - - public const PURPLE_400 = '#c084fc'; - - public const PURPLE_500 = '#a855f7'; - - public const PURPLE_600 = '#9333ea'; - - public const PURPLE_700 = '#7e22ce'; - - public const PURPLE_800 = '#6b21a8'; - - public const PURPLE_900 = '#581c87'; - - public const FUCHSIA_50 = '#fdf4ff'; - - public const FUCHSIA_100 = '#fae8ff'; - - public const FUCHSIA_200 = '#f5d0fe'; - - public const FUCHSIA_300 = '#f0abfc'; - - public const FUCHSIA_400 = '#e879f9'; - - public const FUCHSIA_500 = '#d946ef'; - - public const FUCHSIA_600 = '#c026d3'; - - public const FUCHSIA_700 = '#a21caf'; - - public const FUCHSIA_800 = '#86198f'; - - public const FUCHSIA_900 = '#701a75'; - - public const PINK_50 = '#fdf2f8'; - - public const PINK_100 = '#fce7f3'; - - public const PINK_200 = '#fbcfe8'; - - public const PINK_300 = '#f9a8d4'; - - public const PINK_400 = '#f472b6'; - - public const PINK_500 = '#ec4899'; - - public const PINK_600 = '#db2777'; - - public const PINK_700 = '#be185d'; - - public const PINK_800 = '#9d174d'; - - public const PINK_900 = '#831843'; - - public const ROSE_50 = '#fff1f2'; - - public const ROSE_100 = '#ffe4e6'; - - public const ROSE_200 = '#fecdd3'; - - public const ROSE_300 = '#fda4af'; - - public const ROSE_400 = '#fb7185'; - - public const ROSE_500 = '#f43f5e'; - - public const ROSE_600 = '#e11d48'; - - public const ROSE_700 = '#be123c'; - - public const ROSE_800 = '#9f1239'; - - public const ROSE_900 = '#881337'; - - public const MAGENTA = 'magenta'; - - public const BRIGHTMAGENTA = 'bright-magenta'; -} diff --git a/vendor/nunomaduro/termwind/src/Exceptions/ColorNotFound.php b/vendor/nunomaduro/termwind/src/Exceptions/ColorNotFound.php deleted file mode 100644 index 0f753dd0..00000000 --- a/vendor/nunomaduro/termwind/src/Exceptions/ColorNotFound.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Termwind\Exceptions; - -use InvalidArgumentException; - -/** - * @internal - */ -final class ColorNotFound extends InvalidArgumentException -{ -} diff --git a/vendor/nunomaduro/termwind/src/Exceptions/InvalidChild.php b/vendor/nunomaduro/termwind/src/Exceptions/InvalidChild.php deleted file mode 100644 index cb32e996..00000000 --- a/vendor/nunomaduro/termwind/src/Exceptions/InvalidChild.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Termwind\Exceptions; - -use InvalidArgumentException; - -/** - * @internal - */ -final class InvalidChild extends InvalidArgumentException -{ -} diff --git a/vendor/nunomaduro/termwind/src/Exceptions/InvalidColor.php b/vendor/nunomaduro/termwind/src/Exceptions/InvalidColor.php deleted file mode 100644 index d45afa1f..00000000 --- a/vendor/nunomaduro/termwind/src/Exceptions/InvalidColor.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Termwind\Exceptions; - -use InvalidArgumentException; - -/** - * @internal - */ -final class InvalidColor extends InvalidArgumentException -{ -} diff --git a/vendor/nunomaduro/termwind/src/Exceptions/InvalidStyle.php b/vendor/nunomaduro/termwind/src/Exceptions/InvalidStyle.php deleted file mode 100644 index 6bcc6dd7..00000000 --- a/vendor/nunomaduro/termwind/src/Exceptions/InvalidStyle.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Termwind\Exceptions; - -use InvalidArgumentException; - -/** - * @internal - */ -final class InvalidStyle extends InvalidArgumentException -{ -} diff --git a/vendor/nunomaduro/termwind/src/Exceptions/StyleNotFound.php b/vendor/nunomaduro/termwind/src/Exceptions/StyleNotFound.php deleted file mode 100644 index e528ffdd..00000000 --- a/vendor/nunomaduro/termwind/src/Exceptions/StyleNotFound.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Termwind\Exceptions; - -use InvalidArgumentException; - -/** - * @internal - */ -final class StyleNotFound extends InvalidArgumentException -{ - /** - * Creates a new style not found instance. - */ - private function __construct(string $message) - { - parent::__construct($message, 0, $this->getPrevious()); - } - - /** - * Creates a new style not found instance from the given style. - */ - public static function fromStyle(string $style): self - { - return new self(sprintf('Style [%s] not found.', $style)); - } -} diff --git a/vendor/nunomaduro/termwind/src/Functions.php b/vendor/nunomaduro/termwind/src/Functions.php deleted file mode 100644 index 7ce10393..00000000 --- a/vendor/nunomaduro/termwind/src/Functions.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Termwind; - -use Closure; -use Symfony\Component\Console\Output\OutputInterface; -use Termwind\Repositories\Styles as StyleRepository; -use Termwind\ValueObjects\Style; -use Termwind\ValueObjects\Styles; - -if (! function_exists('Termwind\renderUsing')) { - /** - * Sets the renderer implementation. - */ - function renderUsing(OutputInterface|null $renderer): void - { - Termwind::renderUsing($renderer); - } -} - -if (! function_exists('Termwind\style')) { - /** - * Creates a new style. - * - * @param (Closure(Styles $renderable, string|int ...$arguments): Styles)|null $callback - */ - function style(string $name, Closure $callback = null): Style - { - return StyleRepository::create($name, $callback); - } -} - -if (! function_exists('Termwind\render')) { - /** - * Render HTML to a string. - */ - function render(string $html, int $options = OutputInterface::OUTPUT_NORMAL): void - { - (new HtmlRenderer)->render($html, $options); - } -} - -if (! function_exists('Termwind\terminal')) { - /** - * Returns a Terminal instance. - */ - function terminal(): Terminal - { - return new Terminal; - } -} - -if (! function_exists('Termwind\ask')) { - /** - * Renders a prompt to the user. - * - * @param iterable<array-key, string>|null $autocomplete - */ - function ask(string $question, iterable $autocomplete = null): mixed - { - return (new Question)->ask($question, $autocomplete); - } -} diff --git a/vendor/nunomaduro/termwind/src/Helpers/QuestionHelper.php b/vendor/nunomaduro/termwind/src/Helpers/QuestionHelper.php deleted file mode 100644 index e6bd7c5d..00000000 --- a/vendor/nunomaduro/termwind/src/Helpers/QuestionHelper.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Termwind\Helpers; - -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Helper\SymfonyQuestionHelper; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Question\Question; - -/** - * @internal - */ -final class QuestionHelper extends SymfonyQuestionHelper -{ - /** - * {@inheritdoc} - */ - protected function writePrompt(OutputInterface $output, Question $question): void - { - $text = OutputFormatter::escapeTrailingBackslash($question->getQuestion()); - $output->write($text); - } -} diff --git a/vendor/nunomaduro/termwind/src/Html/CodeRenderer.php b/vendor/nunomaduro/termwind/src/Html/CodeRenderer.php deleted file mode 100644 index 6950cfdb..00000000 --- a/vendor/nunomaduro/termwind/src/Html/CodeRenderer.php +++ /dev/null @@ -1,282 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Termwind\Html; - -use Termwind\Components\Element; -use Termwind\Termwind; -use Termwind\ValueObjects\Node; - -/** - * @internal - */ -final class CodeRenderer -{ - public const TOKEN_DEFAULT = 'token_default'; - - public const TOKEN_COMMENT = 'token_comment'; - - public const TOKEN_STRING = 'token_string'; - - public const TOKEN_HTML = 'token_html'; - - public const TOKEN_KEYWORD = 'token_keyword'; - - public const ACTUAL_LINE_MARK = 'actual_line_mark'; - - public const LINE_NUMBER = 'line_number'; - - private const ARROW_SYMBOL_UTF8 = '➜'; - - private const DELIMITER_UTF8 = '▕ '; // '▶'; - - private const LINE_NUMBER_DIVIDER = 'line_divider'; - - private const MARKED_LINE_NUMBER = 'marked_line'; - - private const WIDTH = 3; - - /** - * Holds the theme. - * - * @var array<string, string> - */ - private const THEME = [ - self::TOKEN_STRING => 'text-gray', - self::TOKEN_COMMENT => 'text-gray italic', - self::TOKEN_KEYWORD => 'text-magenta strong', - self::TOKEN_DEFAULT => 'strong', - self::TOKEN_HTML => 'text-blue strong', - - self::ACTUAL_LINE_MARK => 'text-red strong', - self::LINE_NUMBER => 'text-gray', - self::MARKED_LINE_NUMBER => 'italic strong', - self::LINE_NUMBER_DIVIDER => 'text-gray', - ]; - - private string $delimiter = self::DELIMITER_UTF8; - - private string $arrow = self::ARROW_SYMBOL_UTF8; - - private const NO_MARK = ' '; - - /** - * Highlights HTML content from a given node and converts to the content element. - */ - public function toElement(Node $node): Element - { - $line = max((int) $node->getAttribute('line'), 0); - $startLine = max((int) $node->getAttribute('start-line'), 1); - - $html = $node->getHtml(); - $lines = explode("\n", $html); - $extraSpaces = $this->findExtraSpaces($lines); - - if ($extraSpaces !== '') { - $lines = array_map(static function (string $line) use ($extraSpaces): string { - return str_starts_with($line, $extraSpaces) ? substr($line, strlen($extraSpaces)) : $line; - }, $lines); - $html = implode("\n", $lines); - } - - $tokenLines = $this->getHighlightedLines(trim($html, "\n"), $startLine); - $lines = $this->colorLines($tokenLines); - $lines = $this->lineNumbers($lines, $line); - - return Termwind::div(trim($lines, "\n")); - } - - /** - * Finds extra spaces which should be removed from HTML. - * - * @param array<int, string> $lines - */ - private function findExtraSpaces(array $lines): string - { - foreach ($lines as $line) { - if ($line === '') { - continue; - } - - if (preg_replace('/\s+/', '', $line) === '') { - return $line; - } - } - - return ''; - } - - /** - * Returns content split into lines with numbers. - * - * @return array<int, array<int, array{0: string, 1: non-empty-string}>> - */ - private function getHighlightedLines(string $source, int $startLine): array - { - $source = str_replace(["\r\n", "\r"], "\n", $source); - $tokens = $this->tokenize($source); - - return $this->splitToLines($tokens, $startLine - 1); - } - - /** - * Splits content into tokens. - * - * @return array<int, array{0: string, 1: string}> - */ - private function tokenize(string $source): array - { - $tokens = token_get_all($source); - - $output = []; - $currentType = null; - $newType = self::TOKEN_KEYWORD; - $buffer = ''; - - foreach ($tokens as $token) { - if (is_array($token)) { - if ($token[0] !== T_WHITESPACE) { - $newType = match ($token[0]) { - T_OPEN_TAG, T_OPEN_TAG_WITH_ECHO, T_CLOSE_TAG, T_STRING, T_VARIABLE, - T_DIR, T_FILE, T_METHOD_C, T_DNUMBER, T_LNUMBER, T_NS_C, - T_LINE, T_CLASS_C, T_FUNC_C, T_TRAIT_C => self::TOKEN_DEFAULT, - T_COMMENT, T_DOC_COMMENT => self::TOKEN_COMMENT, - T_ENCAPSED_AND_WHITESPACE, T_CONSTANT_ENCAPSED_STRING => self::TOKEN_STRING, - T_INLINE_HTML => self::TOKEN_HTML, - default => self::TOKEN_KEYWORD - }; - } - } else { - $newType = $token === '"' ? self::TOKEN_STRING : self::TOKEN_KEYWORD; - } - - if ($currentType === null) { - $currentType = $newType; - } - - if ($currentType !== $newType) { - $output[] = [$currentType, $buffer]; - $buffer = ''; - $currentType = $newType; - } - - $buffer .= is_array($token) ? $token[1] : $token; - } - - $output[] = [$newType, $buffer]; - - return $output; - } - - /** - * Splits tokens into lines. - * - * @param array<int, array{0: string, 1: string}> $tokens - * @param int $startLine - * @return array<int, array<int, array{0: string, 1: non-empty-string}>> - */ - private function splitToLines(array $tokens, int $startLine): array - { - $lines = []; - - $line = []; - foreach ($tokens as $token) { - foreach (explode("\n", $token[1]) as $count => $tokenLine) { - if ($count > 0) { - $lines[$startLine++] = $line; - $line = []; - } - - if ($tokenLine === '') { - continue; - } - - $line[] = [$token[0], $tokenLine]; - } - } - - $lines[$startLine++] = $line; - - return $lines; - } - - /** - * Applies colors to tokens according to a color schema. - * - * @param array<int, array<int, array{0: string, 1: non-empty-string}>> $tokenLines - * @return array<int, string> - */ - private function colorLines(array $tokenLines): array - { - $lines = []; - - foreach ($tokenLines as $lineCount => $tokenLine) { - $line = ''; - foreach ($tokenLine as $token) { - [$tokenType, $tokenValue] = $token; - $line .= $this->styleToken($tokenType, $tokenValue); - } - - $lines[$lineCount] = $line; - } - - return $lines; - } - - /** - * Prepends line numbers into lines. - * - * @param array<int, string> $lines - * @param int $markLine - * @return string - */ - private function lineNumbers(array $lines, int $markLine): string - { - $lastLine = (int) array_key_last($lines); - $lineLength = strlen((string) ($lastLine + 1)); - $lineLength = $lineLength < self::WIDTH ? self::WIDTH : $lineLength; - - $snippet = ''; - $mark = ' '.$this->arrow.' '; - foreach ($lines as $i => $line) { - $coloredLineNumber = $this->coloredLineNumber(self::LINE_NUMBER, $i, $lineLength); - - if (0 !== $markLine) { - $snippet .= ($markLine === $i + 1 - ? $this->styleToken(self::ACTUAL_LINE_MARK, $mark) - : self::NO_MARK - ); - - $coloredLineNumber = ($markLine === $i + 1 ? - $this->coloredLineNumber(self::MARKED_LINE_NUMBER, $i, $lineLength) : - $coloredLineNumber - ); - } - - $snippet .= $coloredLineNumber; - $snippet .= $this->styleToken(self::LINE_NUMBER_DIVIDER, $this->delimiter); - $snippet .= $line.PHP_EOL; - } - - return $snippet; - } - - /** - * Formats line number and applies color according to a color schema. - */ - private function coloredLineNumber(string $token, int $lineNumber, int $length): string - { - return $this->styleToken( - $token, str_pad((string) ($lineNumber + 1), $length, ' ', STR_PAD_LEFT) - ); - } - - /** - * Formats string and applies color according to a color schema. - */ - private function styleToken(string $token, string $string): string - { - return (string) Termwind::span($string, self::THEME[$token]); - } -} diff --git a/vendor/nunomaduro/termwind/src/Html/InheritStyles.php b/vendor/nunomaduro/termwind/src/Html/InheritStyles.php deleted file mode 100644 index fc84221e..00000000 --- a/vendor/nunomaduro/termwind/src/Html/InheritStyles.php +++ /dev/null @@ -1,210 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Termwind\Html; - -use Termwind\Components\Element; -use Termwind\Termwind; -use Termwind\ValueObjects\Styles; - -/** - * @internal - */ -final class InheritStyles -{ - /** - * Applies styles from parent element to child elements. - * - * @param array<int, Element|string> $elements - * @return array<int, Element|string> - */ - public function __invoke(array $elements, Styles $styles): array - { - $elements = array_values($elements); - - foreach ($elements as &$element) { - if (is_string($element)) { - $element = Termwind::raw($element); - } - - $element->inheritFromStyles($styles); - } - - /** @var Element[] $elements */ - if (($styles->getProperties()['styles']['display'] ?? 'inline') === 'flex') { - $elements = $this->applyFlex($elements); - } - - return match ($styles->getProperties()['styles']['justifyContent'] ?? false) { - 'between' => $this->applyJustifyBetween($elements), - 'evenly' => $this->applyJustifyEvenly($elements), - 'around' => $this->applyJustifyAround($elements), - 'center' => $this->applyJustifyCenter($elements), - default => $elements, - }; - } - - /** - * Applies flex-1 to child elements with the class. - * - * @param array<int, Element> $elements - * @return array<int, Element> - */ - private function applyFlex(array $elements): array - { - [$totalWidth, $parentWidth] = $this->getWidthFromElements($elements); - - $width = max(0, array_reduce($elements, function ($carry, $element) { - return $carry += $element->hasStyle('flex-1') ? $element->getInnerWidth() : 0; - }, $parentWidth - $totalWidth)); - - $flexed = array_values(array_filter( - $elements, fn ($element) => $element->hasStyle('flex-1') - )); - - foreach ($flexed as $index => &$element) { - if ($width === 0 && ! ($element->getProperties()['styles']['contentRepeat'] ?? false)) { - continue; - } - - $float = $width / count($flexed); - $elementWidth = floor($float); - - if ($index === count($flexed) - 1) { - $elementWidth += ($float - floor($float)) * count($flexed); - } - - $element->addStyle("w-{$elementWidth}"); - } - - return $elements; - } - - /** - * Applies the space between the elements. - * - * @param array<int, Element> $elements - * @return array<int, Element|string> - */ - private function applyJustifyBetween(array $elements): array - { - [$totalWidth, $parentWidth] = $this->getWidthFromElements($elements); - $space = ($parentWidth - $totalWidth) / (count($elements) - 1); - - if ($space < 1) { - return $elements; - } - - $arr = []; - - foreach ($elements as $index => &$element) { - if ($index !== 0) { - // Since there is no float pixel, on the last one it should round up... - $length = $index === count($elements) - 1 ? ceil($space) : floor($space); - $arr[] = str_repeat(' ', (int) $length); - } - - $arr[] = $element; - } - - return $arr; - } - - /** - * Applies the space between and around the elements. - * - * @param array<int, Element> $elements - * @return array<int, Element|string> - */ - private function applyJustifyEvenly(array $elements): array - { - [$totalWidth, $parentWidth] = $this->getWidthFromElements($elements); - $space = ($parentWidth - $totalWidth) / (count($elements) + 1); - - if ($space < 1) { - return $elements; - } - - $arr = []; - foreach ($elements as &$element) { - $arr[] = str_repeat(' ', (int) floor($space)); - $arr[] = $element; - } - - $decimals = ceil(($space - floor($space)) * (count($elements) + 1)); - $arr[] = str_repeat(' ', (int) (floor($space) + $decimals)); - - return $arr; - } - - /** - * Applies the space around the elements. - * - * @param array<int, Element> $elements - * @return array<int, Element|string> - */ - private function applyJustifyAround(array $elements): array - { - [$totalWidth, $parentWidth] = $this->getWidthFromElements($elements); - $space = ($parentWidth - $totalWidth) / count($elements); - - if ($space < 1) { - return $elements; - } - - $contentSize = $totalWidth; - $arr = []; - - foreach ($elements as $index => &$element) { - if ($index !== 0) { - $arr[] = str_repeat(' ', (int) ceil($space)); - $contentSize += ceil($space); - } - - $arr[] = $element; - } - - return [ - str_repeat(' ', (int) floor(($parentWidth - $contentSize) / 2)), - ...$arr, - str_repeat(' ', (int) ceil(($parentWidth - $contentSize) / 2)), - ]; - } - - /** - * Applies the space on before first element and after last element. - * - * @param array<int, Element> $elements - * @return array<int, Element|string> - */ - private function applyJustifyCenter(array $elements): array - { - [$totalWidth, $parentWidth] = $this->getWidthFromElements($elements); - $space = $parentWidth - $totalWidth; - - if ($space < 1) { - return $elements; - } - - return [ - str_repeat(' ', (int) floor($space / 2)), - ...$elements, - str_repeat(' ', (int) ceil($space / 2)), - ]; - } - - /** - * Gets the total width for the elements and their parent width. - * - * @param array<int, Element> $elements - * @return int[] - */ - private function getWidthFromElements(array $elements) - { - $totalWidth = (int) array_reduce($elements, fn ($carry, $element) => $carry += $element->getLength(), 0); - $parentWidth = Styles::getParentWidth($elements[0]->getProperties()['parentStyles'] ?? []); - - return [$totalWidth, $parentWidth]; - } -} diff --git a/vendor/nunomaduro/termwind/src/Html/PreRenderer.php b/vendor/nunomaduro/termwind/src/Html/PreRenderer.php deleted file mode 100644 index e97048cb..00000000 --- a/vendor/nunomaduro/termwind/src/Html/PreRenderer.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Termwind\Html; - -use Termwind\Components\Element; -use Termwind\Termwind; -use Termwind\ValueObjects\Node; - -/** - * @internal - */ -final class PreRenderer -{ - /** - * Gets HTML content from a given node and converts to the content element. - */ - public function toElement(Node $node): Element - { - $lines = explode("\n", $node->getHtml()); - if (reset($lines) === '') { - array_shift($lines); - } - - if (end($lines) === '') { - array_pop($lines); - } - - $maxStrLen = array_reduce( - $lines, - static fn (int $max, string $line) => ($max < strlen($line)) ? strlen($line) : $max, - 0 - ); - - $styles = $node->getClassAttribute(); - $html = array_map( - static fn (string $line) => (string) Termwind::div(str_pad($line, $maxStrLen + 3), $styles), - $lines - ); - - return Termwind::raw( - implode('', $html) - ); - } -} diff --git a/vendor/nunomaduro/termwind/src/Html/TableRenderer.php b/vendor/nunomaduro/termwind/src/Html/TableRenderer.php deleted file mode 100644 index 60b73d4e..00000000 --- a/vendor/nunomaduro/termwind/src/Html/TableRenderer.php +++ /dev/null @@ -1,251 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Termwind\Html; - -use Iterator; -use Symfony\Component\Console\Helper\Table; -use Symfony\Component\Console\Helper\TableCell; -use Symfony\Component\Console\Helper\TableCellStyle; -use Symfony\Component\Console\Helper\TableSeparator; -use Symfony\Component\Console\Output\BufferedOutput; -use Symfony\Component\Console\Output\OutputInterface; -use Termwind\Components\Element; -use Termwind\HtmlRenderer; -use Termwind\Termwind; -use Termwind\ValueObjects\Node; -use Termwind\ValueObjects\Styles; - -/** - * @internal - */ -final class TableRenderer -{ - /** - * Symfony table object uses for table generation. - */ - private Table $table; - - /** - * This object is used for accumulating output data from Symfony table object and return it as a string. - */ - private BufferedOutput $output; - - public function __construct() - { - $this->output = new BufferedOutput( - // Content should output as is, without changes - OutputInterface::VERBOSITY_NORMAL | OutputInterface::OUTPUT_RAW, - true - ); - - $this->table = new Table($this->output); - } - - /** - * Converts table output to the content element. - */ - public function toElement(Node $node): Element - { - $this->parseTable($node); - $this->table->render(); - - $content = preg_replace('/\n$/', '', $this->output->fetch()) ?? ''; - - return Termwind::div($content, '', [ - 'isFirstChild' => $node->isFirstChild(), - ]); - } - - /** - * Looks for thead, tfoot, tbody, tr elements in a given DOM and appends rows from them to the Symfony table object. - */ - private function parseTable(Node $node): void - { - $style = $node->getAttribute('style'); - if ($style !== '') { - $this->table->setStyle($style); - } - - foreach ($node->getChildNodes() as $child) { - match ($child->getName()) { - 'thead' => $this->parseHeader($child), - 'tfoot' => $this->parseFoot($child), - 'tbody' => $this->parseBody($child), - default => $this->parseRows($child) - }; - } - } - - /** - * Looks for table header title and tr elements in a given thead DOM node and adds them to the Symfony table object. - */ - private function parseHeader(Node $node): void - { - $title = $node->getAttribute('title'); - - if ($title !== '') { - $this->table->getStyle()->setHeaderTitleFormat( - $this->parseTitleStyle($node) - ); - $this->table->setHeaderTitle($title); - } - - foreach ($node->getChildNodes() as $child) { - if ($child->isName('tr')) { - foreach ($this->parseRow($child) as $row) { - if (! is_array($row)) { - continue; - } - $this->table->setHeaders($row); - } - } - } - } - - /** - * Looks for table footer and tr elements in a given tfoot DOM node and adds them to the Symfony table object. - */ - private function parseFoot(Node $node): void - { - $title = $node->getAttribute('title'); - - if ($title !== '') { - $this->table->getStyle()->setFooterTitleFormat( - $this->parseTitleStyle($node) - ); - $this->table->setFooterTitle($title); - } - - foreach ($node->getChildNodes() as $child) { - if ($child->isName('tr')) { - $rows = iterator_to_array($this->parseRow($child)); - if (count($rows) > 0) { - $this->table->addRow(new TableSeparator()); - $this->table->addRows($rows); - } - } - } - } - - /** - * Looks for tr elements in a given DOM node and adds them to the Symfony table object. - */ - private function parseBody(Node $node): void - { - foreach ($node->getChildNodes() as $child) { - if ($child->isName('tr')) { - $this->parseRows($child); - } - } - } - - /** - * Parses table tr elements. - */ - private function parseRows(Node $node): void - { - foreach ($this->parseRow($node) as $row) { - $this->table->addRow($row); - } - } - - /** - * Looks for th, td elements in a given DOM node and converts them to a table cells. - * - * @return Iterator<array<int, TableCell>|TableSeparator> - */ - private function parseRow(Node $node): Iterator - { - $row = []; - - foreach ($node->getChildNodes() as $child) { - if ($child->isName('th') || $child->isName('td')) { - $align = $child->getAttribute('align'); - - $class = $child->getClassAttribute(); - - if ($child->isName('th')) { - $class .= ' strong'; - } - - $text = (string) (new HtmlRenderer)->parse( - trim(preg_replace('/<br\s?+\/?>/', "\n", $child->getHtml()) ?? '') - ); - - if ((bool) preg_match(Styles::STYLING_REGEX, $text)) { - $class .= ' font-normal'; - } - - $row[] = new TableCell( - // I need only spaces after applying margin, padding and width except tags. - // There is no place for tags, they broke cell formatting. - (string) Termwind::span($text, $class), - [ - // Gets rowspan and colspan from tr and td tag attributes - 'colspan' => max((int) $child->getAttribute('colspan'), 1), - 'rowspan' => max((int) $child->getAttribute('rowspan'), 1), - - // There are background and foreground and options - 'style' => $this->parseCellStyle( - $class, - $align === '' ? TableCellStyle::DEFAULT_ALIGN : $align - ), - ] - ); - } - } - - if ($row !== []) { - yield $row; - } - - $border = (int) $node->getAttribute('border'); - for ($i = $border; $i--; $i > 0) { - yield new TableSeparator(); - } - } - - /** - * Parses tr, td tag class attribute and passes bg, fg and options to a table cell style. - */ - private function parseCellStyle(string $styles, string $align = TableCellStyle::DEFAULT_ALIGN): TableCellStyle - { - // I use this empty span for getting styles for bg, fg and options - // It will be a good idea to get properties without element object and then pass them to an element object - $element = Termwind::span('%s', $styles); - - $styles = []; - - $colors = $element->getProperties()['colors'] ?? []; - - foreach ($colors as $option => $content) { - if (in_array($option, ['fg', 'bg'], true)) { - $content = is_array($content) ? array_pop($content) : $content; - - $styles[] = "$option=$content"; - } - } - - // If there are no styles we don't need extra tags - if ($styles === []) { - $cellFormat = '%s'; - } else { - $cellFormat = '<'.implode(';', $styles).'>%s</>'; - } - - return new TableCellStyle([ - 'align' => $align, - 'cellFormat' => $cellFormat, - ]); - } - - /** - * Get styled representation of title. - */ - private function parseTitleStyle(Node $node): string - { - return (string) Termwind::span(' %s ', $node->getClassAttribute()); - } -} diff --git a/vendor/nunomaduro/termwind/src/HtmlRenderer.php b/vendor/nunomaduro/termwind/src/HtmlRenderer.php deleted file mode 100644 index 568c946a..00000000 --- a/vendor/nunomaduro/termwind/src/HtmlRenderer.php +++ /dev/null @@ -1,116 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Termwind; - -use DOMDocument; -use DOMNode; -use Termwind\Html\CodeRenderer; -use Termwind\Html\PreRenderer; -use Termwind\Html\TableRenderer; -use Termwind\ValueObjects\Node; - -/** - * @internal - */ -final class HtmlRenderer -{ - /** - * Renders the given html. - */ - public function render(string $html, int $options): void - { - $this->parse($html)->render($options); - } - - /** - * Parses the given html. - */ - public function parse(string $html): Components\Element - { - $dom = new DOMDocument(); - - if (strip_tags($html) === $html) { - return Termwind::span($html); - } - - $html = '<?xml encoding="UTF-8">'.trim($html); - $dom->loadHTML($html, LIBXML_NOERROR | LIBXML_COMPACT | LIBXML_HTML_NODEFDTD | LIBXML_NOBLANKS | LIBXML_NOXMLDECL); - - /** @var DOMNode $body */ - $body = $dom->getElementsByTagName('body')->item(0); - $el = $this->convert(new Node($body)); - - // @codeCoverageIgnoreStart - return is_string($el) - ? Termwind::span($el) - : $el; - // @codeCoverageIgnoreEnd - } - - /** - * Convert a tree of DOM nodes to a tree of termwind elements. - */ - private function convert(Node $node): Components\Element|string - { - $children = []; - - if ($node->isName('table')) { - return (new TableRenderer)->toElement($node); - } elseif ($node->isName('code')) { - return (new CodeRenderer)->toElement($node); - } elseif ($node->isName('pre')) { - return (new PreRenderer)->toElement($node); - } - - foreach ($node->getChildNodes() as $child) { - $children[] = $this->convert($child); - } - - $children = array_filter($children, fn ($child) => $child !== ''); - - return $this->toElement($node, $children); - } - - /** - * Convert a given DOM node to it's termwind element equivalent. - * - * @param array<int, Components\Element|string> $children - */ - private function toElement(Node $node, array $children): Components\Element|string - { - if ($node->isText() || $node->isComment()) { - return (string) $node; - } - - /** @var array<string, mixed> $properties */ - $properties = [ - 'isFirstChild' => $node->isFirstChild(), - ]; - - $styles = $node->getClassAttribute(); - - return match ($node->getName()) { - 'body' => $children[0], // Pick only the first element from the body node - 'div' => Termwind::div($children, $styles, $properties), - 'p' => Termwind::paragraph($children, $styles, $properties), - 'ul' => Termwind::ul($children, $styles, $properties), - 'ol' => Termwind::ol($children, $styles, $properties), - 'li' => Termwind::li($children, $styles, $properties), - 'dl' => Termwind::dl($children, $styles, $properties), - 'dt' => Termwind::dt($children, $styles, $properties), - 'dd' => Termwind::dd($children, $styles, $properties), - 'span' => Termwind::span($children, $styles, $properties), - 'br' => Termwind::breakLine($styles, $properties), - 'strong' => Termwind::span($children, $styles, $properties)->strong(), - 'b' => Termwind::span($children, $styles, $properties)->fontBold(), - 'em', 'i' => Termwind::span($children, $styles, $properties)->italic(), - 'u' => Termwind::span($children, $styles, $properties)->underline(), - 's' => Termwind::span($children, $styles, $properties)->lineThrough(), - 'a' => Termwind::anchor($children, $styles, $properties)->href($node->getAttribute('href')), - 'hr' => Termwind::hr($styles, $properties), - default => Termwind::div($children, $styles, $properties), - }; - } -} diff --git a/vendor/nunomaduro/termwind/src/Laravel/TermwindServiceProvider.php b/vendor/nunomaduro/termwind/src/Laravel/TermwindServiceProvider.php deleted file mode 100644 index d071ec02..00000000 --- a/vendor/nunomaduro/termwind/src/Laravel/TermwindServiceProvider.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Termwind\Laravel; - -use Illuminate\Console\OutputStyle; -use Illuminate\Support\ServiceProvider; -use Termwind\Termwind; - -final class TermwindServiceProvider extends ServiceProvider -{ - /** - * Sets the correct renderer to be used. - */ - public function register(): void - { - $this->app->resolving(OutputStyle::class, function ($style): void { - Termwind::renderUsing($style->getOutput()); - }); - } -} diff --git a/vendor/nunomaduro/termwind/src/Question.php b/vendor/nunomaduro/termwind/src/Question.php deleted file mode 100644 index 289f8667..00000000 --- a/vendor/nunomaduro/termwind/src/Question.php +++ /dev/null @@ -1,93 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Termwind; - -use ReflectionClass; -use Symfony\Component\Console\Helper\SymfonyQuestionHelper; -use Symfony\Component\Console\Input\ArgvInput; -use Symfony\Component\Console\Input\StreamableInputInterface; -use Symfony\Component\Console\Question\Question as SymfonyQuestion; -use Symfony\Component\Console\Style\SymfonyStyle; -use Termwind\Helpers\QuestionHelper; - -/** - * @internal - */ -final class Question -{ - /** - * The streamable input to receive the input from the user. - */ - private static StreamableInputInterface|null $streamableInput; - - /** - * An instance of Symfony's question helper. - */ - private SymfonyQuestionHelper $helper; - - public function __construct(SymfonyQuestionHelper $helper = null) - { - $this->helper = $helper ?? new QuestionHelper(); - } - - /** - * Sets the streamable input implementation. - */ - public static function setStreamableInput(StreamableInputInterface|null $streamableInput): void - { - self::$streamableInput = $streamableInput ?? new ArgvInput(); - } - - /** - * Gets the streamable input implementation. - */ - public static function getStreamableInput(): StreamableInputInterface - { - return self::$streamableInput ??= new ArgvInput(); - } - - /** - * Renders a prompt to the user. - * - * @param iterable<array-key, string>|null $autocomplete - */ - public function ask(string $question, iterable $autocomplete = null): mixed - { - $html = (new HtmlRenderer)->parse($question)->toString(); - - $question = new SymfonyQuestion($html); - - if ($autocomplete !== null) { - $question->setAutocompleterValues($autocomplete); - } - - $output = Termwind::getRenderer(); - - if ($output instanceof SymfonyStyle) { - $property = (new ReflectionClass(SymfonyStyle::class)) - ->getProperty('questionHelper'); - - $property->setAccessible(true); - - $currentHelper = $property->isInitialized($output) - ? $property->getValue($output) - : new SymfonyQuestionHelper(); - - $property->setValue($output, new QuestionHelper); - - try { - return $output->askQuestion($question); - } finally { - $property->setValue($output, $currentHelper); - } - } - - return $this->helper->ask( - self::getStreamableInput(), - Termwind::getRenderer(), - $question, - ); - } -} diff --git a/vendor/nunomaduro/termwind/src/Repositories/Styles.php b/vendor/nunomaduro/termwind/src/Repositories/Styles.php deleted file mode 100644 index 6dbada5e..00000000 --- a/vendor/nunomaduro/termwind/src/Repositories/Styles.php +++ /dev/null @@ -1,59 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Termwind\Repositories; - -use Closure; -use Termwind\ValueObjects\Style; -use Termwind\ValueObjects\Styles as StylesValueObject; - -/** - * @internal - */ -final class Styles -{ - /** - * @var array<string, Style> - */ - private static array $storage = []; - - /** - * Creates a new style from the given arguments. - * - * @param (Closure(StylesValueObject $element, string|int ...$arguments): StylesValueObject)|null $callback - * @return Style - */ - public static function create(string $name, Closure $callback = null): Style - { - self::$storage[$name] = $style = new Style( - $callback ?? static fn (StylesValueObject $styles) => $styles - ); - - return $style; - } - - /** - * Removes all existing styles. - */ - public static function flush(): void - { - self::$storage = []; - } - - /** - * Checks a style with the given name exists. - */ - public static function has(string $name): bool - { - return array_key_exists($name, self::$storage); - } - - /** - * Gets the style with the given name. - */ - public static function get(string $name): Style - { - return self::$storage[$name]; - } -} diff --git a/vendor/nunomaduro/termwind/src/Terminal.php b/vendor/nunomaduro/termwind/src/Terminal.php deleted file mode 100644 index 6b74885b..00000000 --- a/vendor/nunomaduro/termwind/src/Terminal.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Termwind; - -use Symfony\Component\Console\Terminal as ConsoleTerminal; - -/** - * @internal - */ -final class Terminal -{ - /** - * An instance of Symfony's console terminal. - */ - private ConsoleTerminal $terminal; - - /** - * Creates a new terminal instance. - */ - public function __construct(ConsoleTerminal $terminal = null) - { - $this->terminal = $terminal ?? new ConsoleTerminal(); - } - - /** - * Gets the terminal width. - */ - public function width(): int - { - return $this->terminal->getWidth(); - } - - /** - * Gets the terminal height. - */ - public function height(): int - { - return $this->terminal->getHeight(); - } - - /** - * Clears the terminal screen. - */ - public function clear(): void - { - Termwind::getRenderer()->write("\ec"); - } -} diff --git a/vendor/nunomaduro/termwind/src/Termwind.php b/vendor/nunomaduro/termwind/src/Termwind.php deleted file mode 100644 index 0ce1b515..00000000 --- a/vendor/nunomaduro/termwind/src/Termwind.php +++ /dev/null @@ -1,300 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Termwind; - -use Closure; -use Symfony\Component\Console\Output\ConsoleOutput; -use Symfony\Component\Console\Output\OutputInterface; -use Termwind\Components\Element; -use Termwind\Exceptions\InvalidChild; - -/** - * @internal - */ -final class Termwind -{ - /** - * The implementation of the output. - */ - private static OutputInterface|null $renderer; - - /** - * Sets the renderer implementation. - */ - public static function renderUsing(OutputInterface|null $renderer): void - { - self::$renderer = $renderer ?? new ConsoleOutput(); - } - - /** - * Creates a div element instance. - * - * @param array<int, Element|string>|string $content - * @param array<string, mixed> $properties - */ - public static function div(array|string $content = '', string $styles = '', array $properties = []): Components\Div - { - $content = self::prepareElements($content, $styles); - - return Components\Div::fromStyles( - self::getRenderer(), $content, $styles, $properties - ); - } - - /** - * Creates a paragraph element instance. - * - * @param array<int, Element|string>|string $content - * @param array<string, mixed> $properties - */ - public static function paragraph(array|string $content = '', string $styles = '', array $properties = []): Components\Paragraph - { - $content = self::prepareElements($content, $styles); - - return Components\Paragraph::fromStyles( - self::getRenderer(), $content, $styles, $properties - ); - } - - /** - * Creates a span element instance with the given style. - * - * @param array<int, Element|string>|string $content - * @param array<string, mixed> $properties - */ - public static function span(array|string $content = '', string $styles = '', array $properties = []): Components\Span - { - $content = self::prepareElements($content, $styles); - - return Components\Span::fromStyles( - self::getRenderer(), $content, $styles, $properties - ); - } - - /** - * Creates an element instance with raw content. - * - * @param array<int, Element|string>|string $content - */ - public static function raw(array|string $content = ''): Components\Raw - { - return Components\Raw::fromStyles( - self::getRenderer(), $content - ); - } - - /** - * Creates an anchor element instance with the given style. - * - * @param array<int, Element|string>|string $content - * @param array<string, mixed> $properties - */ - public static function anchor(array|string $content = '', string $styles = '', array $properties = []): Components\Anchor - { - $content = self::prepareElements($content, $styles); - - return Components\Anchor::fromStyles( - self::getRenderer(), $content, $styles, $properties - ); - } - - /** - * Creates an unordered list instance. - * - * @param array<int, string|Element> $content - * @param array<string, mixed> $properties - */ - public static function ul(array $content = [], string $styles = '', array $properties = []): Components\Ul - { - $ul = Components\Ul::fromStyles( - self::getRenderer(), '', $styles, $properties - ); - - $content = self::prepareElements( - $content, - $styles, - static function ($li) use ($ul): string|Element { - if (is_string($li)) { - return $li; - } - - if (! $li instanceof Components\Li) { - throw new InvalidChild('Unordered lists only accept `li` as child'); - } - - return match (true) { - $li->hasStyle('list-none') => $li, - $ul->hasStyle('list-none') => $li->addStyle('list-none'), - $ul->hasStyle('list-square') => $li->addStyle('list-square'), - $ul->hasStyle('list-disc') => $li->addStyle('list-disc'), - default => $li->addStyle('list-none'), - }; - } - ); - - return $ul->setContent($content); - } - - /** - * Creates an ordered list instance. - * - * @param array<int, string|Element> $content - * @param array<string, mixed> $properties - */ - public static function ol(array $content = [], string $styles = '', array $properties = []): Components\Ol - { - $ol = Components\Ol::fromStyles( - self::getRenderer(), '', $styles, $properties - ); - - $index = 0; - - $content = self::prepareElements( - $content, - $styles, - static function ($li) use ($ol, &$index): string|Element { - if (is_string($li)) { - return $li; - } - - if (! $li instanceof Components\Li) { - throw new InvalidChild('Ordered lists only accept `li` as child'); - } - - return match (true) { - $li->hasStyle('list-none') => $li->addStyle('list-none'), - $ol->hasStyle('list-none') => $li->addStyle('list-none'), - $ol->hasStyle('list-decimal') => $li->addStyle('list-decimal-'.(++$index)), - default => $li->addStyle('list-none'), - }; - } - ); - - return $ol->setContent($content); - } - - /** - * Creates a list item instance. - * - * @param array<int, Element|string>|string $content - * @param array<string, mixed> $properties - */ - public static function li(array|string $content = '', string $styles = '', array $properties = []): Components\Li - { - $content = self::prepareElements($content, $styles); - - return Components\Li::fromStyles( - self::getRenderer(), $content, $styles, $properties - ); - } - - /** - * Creates a description list instance. - * - * @param array<int, string|Element> $content - * @param array<string, mixed> $properties - */ - public static function dl(array $content = [], string $styles = '', array $properties = []): Components\Dl - { - $content = self::prepareElements( - $content, - $styles, - static function ($element): string|Element { - if (is_string($element)) { - return $element; - } - - if (! $element instanceof Components\Dt && ! $element instanceof Components\Dd) { - throw new InvalidChild('Description lists only accept `dt` and `dd` as children'); - } - - return $element; - } - ); - - return Components\Dl::fromStyles( - self::getRenderer(), $content, $styles, $properties - ); - } - - /** - * Creates a description term instance. - * - * @param array<int, Element|string>|string $content - * @param array<string, mixed> $properties - */ - public static function dt(array|string $content = '', string $styles = '', array $properties = []): Components\Dt - { - $content = self::prepareElements($content, $styles); - - return Components\Dt::fromStyles( - self::getRenderer(), $content, $styles, $properties - ); - } - - /** - * Creates a description details instance. - * - * @param array<int, Element|string>|string $content - * @param array<string, mixed> $properties - */ - public static function dd(array|string $content = '', string $styles = '', array $properties = []): Components\Dd - { - $content = self::prepareElements($content, $styles); - - return Components\Dd::fromStyles( - self::getRenderer(), $content, $styles, $properties - ); - } - - /** - * Creates a horizontal rule instance. - * - * @param array<string, mixed> $properties - */ - public static function hr(string $styles = '', array $properties = []): Components\Hr - { - return Components\Hr::fromStyles( - self::getRenderer(), '', $styles, $properties - ); - } - - /** - * Creates an break line element instance. - * - * @param array<string, mixed> $properties - */ - public static function breakLine(string $styles = '', array $properties = []): Components\BreakLine - { - return Components\BreakLine::fromStyles( - self::getRenderer(), '', $styles, $properties - ); - } - - /** - * Gets the current renderer instance. - */ - public static function getRenderer(): OutputInterface - { - return self::$renderer ??= new ConsoleOutput(); - } - - /** - * Convert child elements to a string. - * - * @param array<int, string|Element>|string $elements - * @return array<int, string|Element> - */ - private static function prepareElements($elements, string $styles = '', Closure|null $callback = null): array - { - if ($callback === null) { - $callback = static fn ($element): string|Element => $element; - } - - $elements = is_array($elements) ? $elements : [$elements]; - - return array_map($callback, $elements); - } -} diff --git a/vendor/nunomaduro/termwind/src/ValueObjects/Node.php b/vendor/nunomaduro/termwind/src/ValueObjects/Node.php deleted file mode 100644 index 4f82a5d2..00000000 --- a/vendor/nunomaduro/termwind/src/ValueObjects/Node.php +++ /dev/null @@ -1,205 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Termwind\ValueObjects; - -use Generator; - -/** - * @internal - */ -final class Node -{ - /** - * A value object with helper methods for working with DOM node. - */ - public function __construct(private \DOMNode $node) - { - } - - /** - * Gets the value of the node. - */ - public function getValue(): string - { - return $this->node->nodeValue ?? ''; - } - - /** - * Gets child nodes of the node. - * - * @return Generator<Node> - */ - public function getChildNodes(): Generator - { - foreach ($this->node->childNodes as $node) { - yield new static($node); - } - } - - /** - * Checks if the node is a text. - */ - public function isText(): bool - { - return $this->node instanceof \DOMText; - } - - /** - * Checks if the node is a comment. - */ - public function isComment(): bool - { - return $this->node instanceof \DOMComment; - } - - /** - * Compares the current node name with a given name. - */ - public function isName(string $name): bool - { - return $this->getName() === $name; - } - - /** - * Returns the current node type name. - */ - public function getName(): string - { - return $this->node->nodeName; - } - - /** - * Returns value of [class] attribute. - */ - public function getClassAttribute(): string - { - return $this->getAttribute('class'); - } - - /** - * Returns value of attribute with a given name. - */ - public function getAttribute(string $name): string - { - if ($this->node instanceof \DOMElement) { - return $this->node->getAttribute($name); - } - - return ''; - } - - /** - * Checks if the node is empty. - */ - public function isEmpty(): bool - { - return $this->isText() && preg_replace('/\s+/', '', $this->getValue()) === ''; - } - - /** - * Gets the previous sibling from the node. - */ - public function getPreviousSibling(): static|null - { - $node = $this->node; - - while ($node = $node->previousSibling) { - $node = new static($node); - - if ($node->isEmpty()) { - $node = $node->node; - - continue; - } - - if (! $node->isComment()) { - return $node; - } - - $node = $node->node; - } - - return is_null($node) ? null : new static($node); - } - - /** - * Gets the next sibling from the node. - */ - public function getNextSibling(): static|null - { - $node = $this->node; - - while ($node = $node->nextSibling) { - $node = new static($node); - - if ($node->isEmpty()) { - $node = $node->node; - - continue; - } - - if (! $node->isComment()) { - return $node; - } - - $node = $node->node; - } - - return is_null($node) ? null : new static($node); - } - - /** - * Checks if the node is the first child. - */ - public function isFirstChild(): bool - { - return is_null($this->getPreviousSibling()); - } - - /** - * Gets the inner HTML representation of the node including child nodes. - */ - public function getHtml(): string - { - $html = ''; - foreach ($this->node->childNodes as $child) { - if ($child->ownerDocument instanceof \DOMDocument) { - $html .= $child->ownerDocument->saveXML($child); - } - } - - return html_entity_decode($html); - } - - /** - * Converts the node to a string. - */ - public function __toString(): string - { - if ($this->isComment()) { - return ''; - } - - if ($this->getValue() === ' ') { - return ' '; - } - - if ($this->isEmpty()) { - return ''; - } - - $text = preg_replace('/\s+/', ' ', $this->getValue()) ?? ''; - - if (is_null($this->getPreviousSibling())) { - $text = ltrim($text); - } - - if (is_null($this->getNextSibling())) { - $text = rtrim($text); - } - - return $text; - } -} diff --git a/vendor/nunomaduro/termwind/src/ValueObjects/Style.php b/vendor/nunomaduro/termwind/src/ValueObjects/Style.php deleted file mode 100644 index bc96e58a..00000000 --- a/vendor/nunomaduro/termwind/src/ValueObjects/Style.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Termwind\ValueObjects; - -use Closure; -use Termwind\Actions\StyleToMethod; -use Termwind\Exceptions\InvalidColor; - -/** - * @internal - */ -final class Style -{ - /** - * Creates a new value object instance. - * - * @param Closure(Styles $styles, string|int ...$argument): Styles $callback - */ - public function __construct(private Closure $callback, private string $color = '') - { - // .. - } - - /** - * Apply the given set of styles to the styles. - */ - public function apply(string $styles): void - { - $callback = clone $this->callback; - - $this->callback = static function ( - Styles $formatter, - string|int ...$arguments - ) use ($callback, $styles): Styles { - $formatter = $callback($formatter, ...$arguments); - - return StyleToMethod::multiple($formatter, $styles); - }; - } - - /** - * Sets the color to the style. - */ - public function color(string $color): void - { - if (preg_match('/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/', $color) < 1) { - throw new InvalidColor(sprintf('The color %s is invalid.', $color)); - } - - $this->color = $color; - } - - /** - * Gets the color. - */ - public function getColor(): string - { - return $this->color; - } - - /** - * Styles the given formatter with this style. - */ - public function __invoke(Styles $styles, string|int ...$arguments): Styles - { - return ($this->callback)($styles, ...$arguments); - } -} diff --git a/vendor/nunomaduro/termwind/src/ValueObjects/Styles.php b/vendor/nunomaduro/termwind/src/ValueObjects/Styles.php deleted file mode 100644 index 04140cff..00000000 --- a/vendor/nunomaduro/termwind/src/ValueObjects/Styles.php +++ /dev/null @@ -1,1061 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Termwind\ValueObjects; - -use Closure; -use Termwind\Actions\StyleToMethod; -use Termwind\Components\Element; -use Termwind\Components\Hr; -use Termwind\Components\Li; -use Termwind\Components\Ol; -use Termwind\Components\Ul; -use Termwind\Enums\Color; -use Termwind\Exceptions\ColorNotFound; -use Termwind\Exceptions\InvalidStyle; -use Termwind\Repositories\Styles as StyleRepository; -use function Termwind\terminal; - -/** - * @internal - */ -final class Styles -{ - /** - * Finds all the styling on a string. - */ - public const STYLING_REGEX = "/\<[\w=#\/\;,:.&,%?-]+\>|\\e\[\d+m/"; - - /** @var array<int, string> */ - private array $styles = []; - - private ?Element $element = null; - - /** - * Creates a Style formatter instance. - * - * @param array<string, mixed> $properties - * @param array<string, Closure(string, array<string, string|int>, array<string, int[]>): string> $textModifiers - * @param array<string, Closure(string, array<string, string|int>): string> $styleModifiers - * @param string[] $defaultStyles - */ - final public function __construct( - private array $properties = [ - 'colors' => [], - 'options' => [], - 'isFirstChild' => false, - ], - private array $textModifiers = [], - private array $styleModifiers = [], - private array $defaultStyles = [] - ) { - } - - /** - * @param Element $element - * @return $this - */ - public function setElement(Element $element): self - { - $this->element = $element; - - return $this; - } - - /** - * Gets default styles. - * - * @return string[] - */ - public function defaultStyles(): array - { - return $this->defaultStyles; - } - - /** - * Gets the element's style properties. - * - * @return array<string, mixed> - */ - final public function getProperties(): array - { - return $this->properties; - } - - /** - * Sets the element's style properties. - * - * @param array<string, mixed> $properties - */ - public function setProperties(array $properties): self - { - $this->properties = $properties; - - return $this; - } - - /** - * Sets the styles to the element. - */ - final public function setStyle(string $style): self - { - $this->styles = array_unique(array_merge($this->styles, [$style])); - - return $this; - } - - /** - * Checks if the element has the style. - */ - final public function hasStyle(string $style): bool - { - return in_array($style, $this->styles, true); - } - - /** - * Adds a style to the element. - */ - final public function addStyle(string $style): self - { - return StyleToMethod::multiple($this, $style); - } - - /** - * Inherit styles from given Styles object. - */ - final public function inheritFromStyles(self $styles): self - { - foreach (['ml', 'mr', 'pl', 'pr', 'width', 'minWidth', 'maxWidth', 'spaceY', 'spaceX'] as $style) { - $this->properties['parentStyles'][$style] = array_merge( - $this->properties['parentStyles'][$style] ?? [], - $styles->properties['parentStyles'][$style] ?? [] - ); - - $this->properties['parentStyles'][$style][] = $styles->properties['styles'][$style] ?? 0; - } - - $this->properties['parentStyles']['justifyContent'] = $styles->properties['styles']['justifyContent'] ?? false; - - foreach (['bg', 'fg'] as $colorType) { - $value = (array) ($this->properties['colors'][$colorType] ?? []); - $parentValue = (array) ($styles->properties['colors'][$colorType] ?? []); - - if ($value === [] && $parentValue !== []) { - $this->properties['colors'][$colorType] = $styles->properties['colors'][$colorType]; - } - } - - if (! is_null($this->properties['options']['bold'] ?? null) || - ! is_null($styles->properties['options']['bold'] ?? null)) { - $this->properties['options']['bold'] = $this->properties['options']['bold'] - ?? $styles->properties['options']['bold'] - ?? false; - } - - return $this; - } - - /** - * Adds a background color to the element. - */ - final public function bg(string $color, int $variant = 0): self - { - return $this->with(['colors' => [ - 'bg' => $this->getColorVariant($color, $variant), - ]]); - } - - /** - * Adds a bold style to the element. - */ - final public function fontBold(): self - { - return $this->with(['options' => [ - 'bold' => true, - ]]); - } - - /** - * Removes the bold style on the element. - */ - final public function fontNormal(): self - { - return $this->with(['options' => [ - 'bold' => false, - ]]); - } - - /** - * Adds a bold style to the element. - */ - final public function strong(): self - { - $this->styleModifiers[__METHOD__] = static fn ($text): string => sprintf("\e[1m%s\e[0m", $text); - - return $this; - } - - /** - * Adds an italic style to the element. - */ - final public function italic(): self - { - $this->styleModifiers[__METHOD__] = static fn ($text): string => sprintf("\e[3m%s\e[0m", $text); - - return $this; - } - - /** - * Adds an underline style. - */ - final public function underline(): self - { - $this->styleModifiers[__METHOD__] = static fn ($text): string => sprintf("\e[4m%s\e[0m", $text); - - return $this; - } - - /** - * Adds the given margin left to the element. - */ - final public function ml(int $margin): self - { - return $this->with(['styles' => [ - 'ml' => $margin, - ]]); - } - - /** - * Adds the given margin right to the element. - */ - final public function mr(int $margin): self - { - return $this->with(['styles' => [ - 'mr' => $margin, - ]]); - } - - /** - * Adds the given margin bottom to the element. - */ - final public function mb(int $margin): self - { - return $this->with(['styles' => [ - 'mb' => $margin, - ]]); - } - - /** - * Adds the given margin top to the element. - */ - final public function mt(int $margin): self - { - return $this->with(['styles' => [ - 'mt' => $margin, - ]]); - } - - /** - * Adds the given horizontal margin to the element. - */ - final public function mx(int $margin): self - { - return $this->with(['styles' => [ - 'ml' => $margin, - 'mr' => $margin, - ]]); - } - - /** - * Adds the given vertical margin to the element. - */ - final public function my(int $margin): self - { - return $this->with(['styles' => [ - 'mt' => $margin, - 'mb' => $margin, - ]]); - } - - /** - * Adds the given margin to the element. - */ - final public function m(int $margin): self - { - return $this->my($margin)->mx($margin); - } - - /** - * Adds the given padding left to the element. - */ - final public function pl(int $padding): static - { - return $this->with(['styles' => [ - 'pl' => $padding, - ]]); - } - - /** - * Adds the given padding right. - */ - final public function pr(int $padding): static - { - return $this->with(['styles' => [ - 'pr' => $padding, - ]]); - } - - /** - * Adds the given horizontal padding. - */ - final public function px(int $padding): self - { - return $this->pl($padding)->pr($padding); - } - - /** - * Adds the given padding top. - */ - final public function pt(int $padding): static - { - return $this->with(['styles' => [ - 'pt' => $padding, - ]]); - } - - /** - * Adds the given padding bottom. - */ - final public function pb(int $padding): static - { - return $this->with(['styles' => [ - 'pb' => $padding, - ]]); - } - - /** - * Adds the given vertical padding. - */ - final public function py(int $padding): self - { - return $this->pt($padding)->pb($padding); - } - - /** - * Adds the given padding. - */ - final public function p(int $padding): self - { - return $this->pt($padding)->pr($padding)->pb($padding)->pl($padding); - } - - /** - * Adds the given vertical margin to the childs, ignoring the first child. - */ - final public function spaceY(int $space): self - { - return $this->with(['styles' => [ - 'spaceY' => $space, - ]]); - } - - /** - * Adds the given horizontal margin to the childs, ignoring the first child. - */ - final public function spaceX(int $space): self - { - return $this->with(['styles' => [ - 'spaceX' => $space, - ]]); - } - - /** - * Adds a border on top of each element. - */ - final public function borderT(int $width = 1): self - { - if (! $this->element instanceof Hr) { - throw new InvalidStyle('`border-t` can only be used on an "hr" element.'); - } - - $this->styleModifiers[__METHOD__] = function ($text, $styles): string { - $length = $this->getLength($text); - if ($length < 1) { - $margins = (int) ($styles['ml'] ?? 0) + ($styles['mr'] ?? 0); - - return str_repeat('─', self::getParentWidth($this->properties['parentStyles'] ?? []) - $margins); - } - - return str_repeat('─', $length); - }; - - return $this; - } - - /** - * Adds a text alignment or color to the element. - */ - final public function text(string $value, int $variant = 0): self - { - if (in_array($value, ['left', 'right', 'center'], true)) { - return $this->with(['styles' => [ - 'text-align' => $value, - ]]); - } - - return $this->with(['colors' => [ - 'fg' => $this->getColorVariant($value, $variant), - ]]); - } - - /** - * Truncates the text of the element. - */ - final public function truncate(int $limit = 0, string $end = '…'): self - { - $this->textModifiers[__METHOD__] = function ($text, $styles) use ($limit, $end): string { - $width = $styles['width'] ?? 0; - - if (is_string($width)) { - $width = self::calcWidthFromFraction( - $width, - $styles, - $this->properties['parentStyles'] ?? [] - ); - } - - [, $paddingRight, , $paddingLeft] = $this->getPaddings(); - $width -= $paddingRight + $paddingLeft; - - $limit = $limit > 0 ? $limit : $width; - if ($limit === 0) { - return $text; - } - - $limit -= mb_strwidth($end, 'UTF-8'); - - if ($this->getLength($text) <= $limit) { - return $text; - } - - return rtrim(self::trimText($text, $limit).$end); - }; - - return $this; - } - - /** - * Forces the width of the element. - */ - final public function w(int|string $width): static - { - return $this->with(['styles' => [ - 'width' => $width, - ]]); - } - - /** - * Forces the element width to the full width of the terminal. - */ - final public function wFull(): static - { - return $this->w('1/1'); - } - - /** - * Removes the width set on the element. - */ - final public function wAuto(): static - { - return $this->with(['styles' => [ - 'width' => null, - ]]); - } - - /** - * Defines a minimum width of an element. - */ - final public function minW(int|string $width): static - { - return $this->with(['styles' => [ - 'minWidth' => $width, - ]]); - } - - /** - * Defines a maximum width of an element. - */ - final public function maxW(int|string $width): static - { - return $this->with(['styles' => [ - 'maxWidth' => $width, - ]]); - } - - /** - * Makes the element's content uppercase. - */ - final public function uppercase(): self - { - $this->textModifiers[__METHOD__] = static fn ($text): string => mb_strtoupper($text, 'UTF-8'); - - return $this; - } - - /** - * Makes the element's content lowercase. - */ - final public function lowercase(): self - { - $this->textModifiers[__METHOD__] = static fn ($text): string => mb_strtolower($text, 'UTF-8'); - - return $this; - } - - /** - * Makes the element's content capitalize. - */ - final public function capitalize(): self - { - $this->textModifiers[__METHOD__] = static fn ($text): string => mb_convert_case($text, MB_CASE_TITLE, 'UTF-8'); - - return $this; - } - - /** - * Makes the element's content in snakecase. - */ - final public function snakecase(): self - { - $this->textModifiers[__METHOD__] = static fn ($text): string => mb_strtolower( - (string) preg_replace(['/([a-z\d])([A-Z])/', '/([^_])([A-Z][a-z])/'], '$1_$2', $text), - 'UTF-8' - ); - - return $this; - } - - /** - * Makes the element's content with a line through. - */ - final public function lineThrough(): self - { - $this->styleModifiers[__METHOD__] = static fn ($text): string => sprintf("\e[9m%s\e[0m", $text); - - return $this; - } - - /** - * Makes the element's content invisible. - */ - final public function invisible(): self - { - $this->styleModifiers[__METHOD__] = static fn ($text): string => sprintf("\e[8m%s\e[0m", $text); - - return $this; - } - - /** - * Do not display element's content. - */ - final public function hidden(): self - { - return $this->with(['styles' => [ - 'display' => 'hidden', - ]]); - } - - /** - * Makes a line break before the element's content. - */ - final public function block(): self - { - return $this->with(['styles' => [ - 'display' => 'block', - ]]); - } - - /** - * Makes an element eligible to work with flex-1 element's style. - */ - final public function flex(): self - { - return $this->with(['styles' => [ - 'display' => 'flex', - ]]); - } - - /** - * Makes an element grow and shrink as needed, ignoring the initial size. - */ - final public function flex1(): self - { - return $this->with(['styles' => [ - 'flex-1' => true, - ]]); - } - - /** - * Justifies childs along the element with an equal amount of space between. - */ - final public function justifyBetween(): self - { - return $this->with(['styles' => [ - 'justifyContent' => 'between', - ]]); - } - - /** - * Justifies childs along the element with an equal amount of space between - * each item and half around. - */ - final public function justifyAround(): self - { - return $this->with(['styles' => [ - 'justifyContent' => 'around', - ]]); - } - - /** - * Justifies childs along the element with an equal amount of space around each item. - */ - final public function justifyEvenly(): self - { - return $this->with(['styles' => [ - 'justifyContent' => 'evenly', - ]]); - } - - /** - * Justifies childs along the center of the container’s main axis. - */ - final public function justifyCenter(): self - { - return $this->with(['styles' => [ - 'justifyContent' => 'center', - ]]); - } - - /** - * Repeats the string given until it fills all the content. - */ - final public function contentRepeat(string $string): self - { - $string = preg_replace("/\[?'?([^'|\]]+)'?\]?/", '$1', $string) ?? ''; - - $this->textModifiers[__METHOD__] = static fn (): string => str_repeat($string, (int) floor(terminal()->width() / mb_strlen($string, 'UTF-8'))); - - return $this->with(['styles' => [ - 'contentRepeat' => true, - ]]); - } - - /** - * Prepends text to the content. - */ - final public function prepend(string $string): self - { - $this->textModifiers[__METHOD__] = static fn ($text): string => $string.$text; - - return $this; - } - - /** - * Appends text to the content. - */ - final public function append(string $string): self - { - $this->textModifiers[__METHOD__] = static fn ($text): string => $text.$string; - - return $this; - } - - /** - * Prepends the list style type to the content. - */ - final public function list(string $type, int $index = 0): self - { - if (! $this->element instanceof Ul && ! $this->element instanceof Ol && ! $this->element instanceof Li) { - throw new InvalidStyle(sprintf( - 'Style list-none cannot be used with %s', - $this->element !== null ? $this->element::class : 'unknown element' - )); - } - - if (! $this->element instanceof Li) { - return $this; - } - - return match ($type) { - 'square' => $this->prepend('▪ '), - 'disc' => $this->prepend('• '), - 'decimal' => $this->prepend(sprintf('%d. ', $index)), - default => $this, - }; - } - - /** - * Adds the given properties to the element. - * - * @param array<string, mixed> $properties - */ - public function with(array $properties): self - { - $this->properties = array_replace_recursive($this->properties, $properties); - - return $this; - } - - /** - * Sets the href property to the element. - */ - final public function href(string $href): self - { - $href = str_replace('%', '%%', $href); - - return $this->with(['href' => array_filter([$href])]); - } - - /** - * Formats a given string. - */ - final public function format(string $content): string - { - foreach ($this->textModifiers as $modifier) { - $content = $modifier( - $content, - $this->properties['styles'] ?? [], - $this->properties['parentStyles'] ?? [] - ); - } - - $content = $this->applyWidth($content); - - foreach ($this->styleModifiers as $modifier) { - $content = $modifier($content, $this->properties['styles'] ?? []); - } - - return $this->applyStyling($content); - } - - /** - * Get the format string including required styles. - */ - private function getFormatString(): string - { - $styles = []; - - /** @var array<int, string> $href */ - $href = $this->properties['href'] ?? []; - if ($href !== []) { - $styles[] = sprintf('href=%s', array_pop($href)); - } - - $colors = $this->properties['colors'] ?? []; - - foreach ($colors as $option => $content) { - if (in_array($option, ['fg', 'bg'], true)) { - $content = is_array($content) ? array_pop($content) : $content; - - $styles[] = "$option=$content"; - } - } - - $options = $this->properties['options'] ?? []; - - if ($options !== []) { - $options = array_keys(array_filter( - $options, fn ($option) => $option === true - )); - $styles[] = count($options) > 0 - ? 'options='.implode(',', $options) - : 'options=,'; - } - - // If there are no styles we don't need extra tags - if ($styles === []) { - return '%s%s%s%s%s'; - } - - return '%s<'.implode(';', $styles).'>%s%s%s</>%s'; - } - - /** - * Get the margins applied to the element. - * - * @return array{0: int, 1: int, 2: int, 3: int} - */ - private function getMargins(): array - { - $isFirstChild = (bool) $this->properties['isFirstChild']; - - $spaceY = $this->properties['parentStyles']['spaceY'] ?? []; - $spaceY = ! $isFirstChild ? end($spaceY) : 0; - - $spaceX = $this->properties['parentStyles']['spaceX'] ?? []; - $spaceX = ! $isFirstChild ? end($spaceX) : 0; - - return [ - $spaceY > 0 ? $spaceY : $this->properties['styles']['mt'] ?? 0, - $this->properties['styles']['mr'] ?? 0, - $this->properties['styles']['mb'] ?? 0, - $spaceX > 0 ? $spaceX : $this->properties['styles']['ml'] ?? 0, - ]; - } - - /** - * Get the paddings applied to the element. - * - * @return array{0: int, 1: int, 2: int, 3: int} - */ - private function getPaddings(): array - { - return [ - $this->properties['styles']['pt'] ?? 0, - $this->properties['styles']['pr'] ?? 0, - $this->properties['styles']['pb'] ?? 0, - $this->properties['styles']['pl'] ?? 0, - ]; - } - - /** - * It applies the correct width for the content. - */ - private function applyWidth(string $content): string - { - $styles = $this->properties['styles'] ?? []; - $minWidth = $styles['minWidth'] ?? -1; - $width = max($styles['width'] ?? -1, $minWidth); - $maxWidth = $styles['maxWidth'] ?? 0; - - if ($width < 0) { - return $content; - } - - if ($width === 0) { - return ''; - } - - if (is_string($width)) { - $width = self::calcWidthFromFraction( - $width, - $styles, - $this->properties['parentStyles'] ?? [] - ); - } - - if ($maxWidth > 0) { - $width = min($styles['maxWidth'], $width); - } - - $width -= ($styles['pl'] ?? 0) + ($styles['pr'] ?? 0); - $length = $this->getLength($content); - - preg_match_all("/\n+/", $content, $matches); - - $width *= count($matches[0] ?? []) + 1; - $width += mb_strlen($matches[0][0] ?? '', 'UTF-8'); - - if ($length <= $width) { - $space = $width - $length; - - return match ($styles['text-align'] ?? '') { - 'right' => str_repeat(' ', $space).$content, - 'center' => str_repeat(' ', (int) floor($space / 2)).$content.str_repeat(' ', (int) ceil($space / 2)), - default => $content.str_repeat(' ', $space), - }; - } - - return self::trimText($content, $width); - } - - /** - * It applies the styling for the content. - */ - private function applyStyling(string $content): string - { - $display = $this->properties['styles']['display'] ?? 'inline'; - - if ($display === 'hidden') { - return ''; - } - - $isFirstChild = (bool) $this->properties['isFirstChild']; - - [$marginTop, $marginRight, $marginBottom, $marginLeft] = $this->getMargins(); - [$paddingTop, $paddingRight, $paddingBottom, $paddingLeft] = $this->getPaddings(); - - $content = (string) preg_replace('/\r[ \t]?/', "\n", - (string) preg_replace( - '/\n/', - str_repeat(' ', $marginRight + $paddingRight) - ."\n". - str_repeat(' ', $marginLeft + $paddingLeft), - $content) - ); - - $formatted = sprintf( - $this->getFormatString(), - str_repeat(' ', $marginLeft), - str_repeat(' ', $paddingLeft), - $content, - str_repeat(' ', $paddingRight), - str_repeat(' ', $marginRight), - ); - - $empty = str_replace( - $content, - str_repeat(' ', $this->getLength($content)), - $formatted - ); - - $items = []; - - if (in_array($display, ['block', 'flex'], true) && ! $isFirstChild) { - $items[] = "\n"; - } - - if ($marginTop > 0) { - $items[] = str_repeat("\n", $marginTop); - } - - if ($paddingTop > 0) { - $items[] = $empty."\n"; - } - - $items[] = $formatted; - - if ($paddingBottom > 0) { - $items[] = "\n".$empty; - } - - if ($marginBottom > 0) { - $items[] = str_repeat("\n", $marginBottom); - } - - return implode('', $items); - } - - /** - * Get the length of the text provided without the styling tags. - */ - public function getLength(string $text = null): int - { - return mb_strlen(preg_replace( - self::STYLING_REGEX, - '', - $text ?? $this->element?->toString() ?? '' - ) ?? '', 'UTF-8'); - } - - /** - * Get the length of the element without margins. - */ - public function getInnerWidth(): int - { - $innerLength = $this->getLength(); - [, $marginRight, , $marginLeft] = $this->getMargins(); - - return $innerLength - $marginLeft - $marginRight; - } - - /** - * Get the constant variant color from Color class. - */ - private function getColorVariant(string $color, int $variant): string - { - if ($variant > 0) { - $color .= '-'.$variant; - } - - if (StyleRepository::has($color)) { - return StyleRepository::get($color)->getColor(); - } - - $colorConstant = mb_strtoupper(str_replace('-', '_', $color), 'UTF-8'); - - if (! defined(Color::class."::$colorConstant")) { - throw new ColorNotFound($colorConstant); - } - - return constant(Color::class."::$colorConstant"); - } - - /** - * Calculates the width based on the fraction provided. - * - * @param array<string, int> $styles - * @param array<string, array<int, int|string>> $parentStyles - */ - private static function calcWidthFromFraction(string $fraction, array $styles, array $parentStyles): int - { - $width = self::getParentWidth($parentStyles); - - preg_match('/(\d+)\/(\d+)/', $fraction, $matches); - - if (count($matches) !== 3 || $matches[2] === '0') { - throw new InvalidStyle(sprintf('Style [%s] is invalid.', "w-$fraction")); - } - - /** @@phpstan-ignore-next-line */ - $width = (int) floor($width * $matches[1] / $matches[2]); - $width -= ($styles['ml'] ?? 0) + ($styles['mr'] ?? 0); - - return $width; - } - - /** - * Gets the width of the parent element. - * - * @param array<string, array<int|string>> $styles - */ - public static function getParentWidth(array $styles): int - { - $width = terminal()->width(); - foreach ($styles['width'] ?? [] as $index => $parentWidth) { - $minWidth = (int) $styles['minWidth'][$index]; - $maxWidth = (int) $styles['maxWidth'][$index]; - $margins = (int) $styles['ml'][$index] + (int) $styles['mr'][$index]; - - $parentWidth = max($parentWidth, $minWidth); - - if ($parentWidth < 1) { - $parentWidth = $width; - } elseif (is_int($parentWidth)) { - $parentWidth += $margins; - } - - preg_match('/(\d+)\/(\d+)/', (string) $parentWidth, $matches); - - $width = count($matches) !== 3 - ? (int) $parentWidth - : (int) floor($width * $matches[1] / $matches[2]); //@phpstan-ignore-line - - if ($maxWidth > 0) { - $width = min($maxWidth, $width); - } - - $width -= $margins; - $width -= (int) $styles['pl'][$index] + (int) $styles['pr'][$index]; - } - - return $width; - } - - /** - * It trims the text properly ignoring all escape codes and - * `<bg;fg;options>` tags. - */ - private static function trimText(string $text, int $width): string - { - preg_match_all(self::STYLING_REGEX, $text, $matches, PREG_OFFSET_CAPTURE); - $text = rtrim(mb_strimwidth(preg_replace(self::STYLING_REGEX, '', $text) ?? '', 0, $width, '', 'UTF-8')); - - foreach ($matches[0] ?? [] as [$part, $index]) { - $text = substr($text, 0, $index).$part.substr($text, $index, null); - } - - return $text; - } -} diff --git a/vendor/orchestra/testbench-core/composer.json b/vendor/orchestra/testbench-core/composer.json deleted file mode 100644 index 1464e126..00000000 --- a/vendor/orchestra/testbench-core/composer.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "name": "orchestra/testbench-core", - "description": "Testing Helper for Laravel Development", - "homepage": "https://packages.tools/testbench", - "keywords": ["laravel", "orchestral", "orchestra-platform", "testing", "tdd", "bdd"], - "license": "MIT", - "support": { - "issues": "https://github.com/orchestral/testbench/issues", - "source": "https://github.com/orchestral/testbench-core" - }, - "authors": [ - { - "name": "Mior Muhammad Zaki", - "email": "crynobone@gmail.com", - "homepage": "https://github.com/crynobone" - } - ], - "autoload": { - "psr-4": { - "Orchestra\\Testbench\\" : "src/" - }, - "files": [ - "src/helpers.php" - ] - }, - "autoload-dev": { - "psr-4": { - "Orchestra\\Testbench\\Tests\\": "tests/" - } - }, - "bin": [ - "testbench" - ], - "require": { - "php": "^8.0" - }, - "require-dev": { - "fakerphp/faker": "^1.21", - "laravel/framework": "^9.45", - "laravel/laravel": "9.x-dev", - "laravel/pint": "^1.1", - "mockery/mockery": "^1.5.1", - "orchestra/canvas": "^7.0", - "phpstan/phpstan": "^1.8", - "phpunit/phpunit": "^9.5.10", - "spatie/laravel-ray": "^1.28", - "symfony/process": "^6.0.9", - "symfony/yaml": "^6.0.9", - "vlucas/phpdotenv": "^5.4.1" - }, - "suggest": { - "brianium/paratest": "Allow using parallel tresting (^6.4).", - "fakerphp/faker": "Allow using Faker for testing (^1.21).", - "laravel/framework": "Required for testing (^9.45).", - "mockery/mockery": "Allow using Mockery for testing (^1.5.1).", - "nunomaduro/collision": "Allow using Laravel style tests output and parallel testing (^6.2).", - "orchestra/testbench-browser-kit": "Allow using legacy Laravel BrowserKit for testing (^7.0).", - "orchestra/testbench-dusk": "Allow using Laravel Dusk for testing (^7.0).", - "phpunit/phpunit": "Allow using PHPUnit for testing (^9.5.10).", - "symfony/yaml": "Required for CLI Commander (^6.0.9).", - "vlucas/phpdotenv": "Required for CLI Commander (^5.4.1)." - }, - "extra": { - "branch-alias": { - "dev-master": "7.0-dev" - } - }, - "scripts": { - "post-autoload-dump": "@composer run prepare", - "prepare": "@php testbench package:discover --ansi", - "ci": [ - "@composer run prepare", - "@php vendor/bin/phpstan analyse", - "@php vendor/bin/pint", - "@composer run test" - ], - "test": "@php vendor/bin/phpunit -c ./ --color" - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev" -} diff --git a/vendor/orchestra/testbench-core/create-sqlite-db b/vendor/orchestra/testbench-core/create-sqlite-db deleted file mode 100755 index def8bc38..00000000 --- a/vendor/orchestra/testbench-core/create-sqlite-db +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env php -<?php - -define('TESTBENCH_WORKING_PATH', $workingPath = getcwd()); - -$skeletonPath = realpath(__DIR__).'/laravel'; - -if (file_exists(__DIR__.'/vendor/autoload.php')) { - // Development environment. - require __DIR__.'/vendor/autoload.php'; -} else { - // Installation environment. - require __DIR__.'/../../autoload.php'; -} - -$config = Orchestra\Testbench\Foundation\Config::loadFromYaml( - workingPath: $workingPath, - defaults: [ - 'providers' => [], - 'dont-discover' => [], - ], -); - -$directory = ($config['laravel'] ? $config['laravel'] : $skeletonPath).'/database'; - -if (! file_exists("{$directory}/database.sqlite")) { - copy("{$skeletonPath}/database/database.sqlite.example", "{$directory}/database.sqlite"); -} diff --git a/vendor/orchestra/testbench-core/drop-sqlite-db b/vendor/orchestra/testbench-core/drop-sqlite-db deleted file mode 100755 index 381c72da..00000000 --- a/vendor/orchestra/testbench-core/drop-sqlite-db +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env php -<?php - -define('TESTBENCH_WORKING_PATH', $workingPath = getcwd()); - -$skeletonPath = realpath(__DIR__).'/laravel'; - -if (file_exists(__DIR__.'/vendor/autoload.php')) { - // Development environment. - require __DIR__.'/vendor/autoload.php'; -} else { - // Installation environment. - require __DIR__.'/../../autoload.php'; -} - -$config = Orchestra\Testbench\Foundation\Config::loadFromYaml( - workingPath: $workingPath, - defaults: [ - 'providers' => [], - 'dont-discover' => [], - ], -); - -$directory = ($config['laravel'] ? $config['laravel'] : $skeletonPath).'/database'; - -if (file_exists("{$directory}/database.sqlite")) { - @unlink("{$directory}/database.sqlite"); -} diff --git a/vendor/orchestra/testbench-core/laravel/.env.example b/vendor/orchestra/testbench-core/laravel/.env.example deleted file mode 100644 index a4a02051..00000000 --- a/vendor/orchestra/testbench-core/laravel/.env.example +++ /dev/null @@ -1,58 +0,0 @@ -APP_NAME=Laravel -APP_ENV=local -APP_KEY=AckfSECXIvnK5r28GVIWUAxmbBSjTsmF -APP_DEBUG=true -APP_URL=http://localhost - -LOG_CHANNEL=stack -LOG_DEPRECATIONS_CHANNEL=null -LOG_LEVEL=debug - -DB_CONNECTION=sqlite -# DB_HOST=127.0.0.1 -# DB_PORT=3306 -# DB_DATABASE=laravel -# DB_USERNAME=root -# DB_PASSWORD= - -BROADCAST_DRIVER=log -CACHE_DRIVER=file -FILESYSTEM_DISK=local -QUEUE_CONNECTION=sync -SESSION_DRIVER=file -SESSION_LIFETIME=120 - -MEMCACHED_HOST=127.0.0.1 - -REDIS_HOST=127.0.0.1 -REDIS_PASSWORD=null -REDIS_PORT=6379 - -MAIL_MAILER=smtp -MAIL_HOST=mailhog -MAIL_PORT=1025 -MAIL_USERNAME=null -MAIL_PASSWORD=null -MAIL_ENCRYPTION=null -MAIL_FROM_ADDRESS="hello@example.com" -MAIL_FROM_NAME="${APP_NAME}" - -AWS_ACCESS_KEY_ID= -AWS_SECRET_ACCESS_KEY= -AWS_DEFAULT_REGION=us-east-1 -AWS_BUCKET= -AWS_USE_PATH_STYLE_ENDPOINT=false - -PUSHER_APP_ID= -PUSHER_APP_KEY= -PUSHER_APP_SECRET= -PUSHER_HOST= -PUSHER_PORT=443 -PUSHER_SCHEME=https -PUSHER_APP_CLUSTER=mt1 - -VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}" -VITE_PUSHER_HOST="${PUSHER_HOST}" -VITE_PUSHER_PORT="${PUSHER_PORT}" -VITE_PUSHER_SCHEME="${PUSHER_SCHEME}" -VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" diff --git a/vendor/orchestra/testbench-core/laravel/.gitignore b/vendor/orchestra/testbench-core/laravel/.gitignore deleted file mode 100644 index 8548e2b5..00000000 --- a/vendor/orchestra/testbench-core/laravel/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -.env -.env.* -!.env.example - -testbench.yaml -testbench.yaml.backup diff --git a/vendor/orchestra/testbench-core/laravel/app/.gitkeep b/vendor/orchestra/testbench-core/laravel/app/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/vendor/orchestra/testbench-core/laravel/app/Console/.gitkeep b/vendor/orchestra/testbench-core/laravel/app/Console/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/vendor/orchestra/testbench-core/laravel/app/Exceptions/.gitkeep b/vendor/orchestra/testbench-core/laravel/app/Exceptions/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/vendor/orchestra/testbench-core/laravel/app/Http/Controllers/.gitkeep b/vendor/orchestra/testbench-core/laravel/app/Http/Controllers/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/vendor/orchestra/testbench-core/laravel/app/Http/Middleware/.gitkeep b/vendor/orchestra/testbench-core/laravel/app/Http/Middleware/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/vendor/orchestra/testbench-core/laravel/app/Models/.gitkeep b/vendor/orchestra/testbench-core/laravel/app/Models/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/vendor/orchestra/testbench-core/laravel/app/Providers/.gitkeep b/vendor/orchestra/testbench-core/laravel/app/Providers/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/vendor/orchestra/testbench-core/laravel/bootstrap/app.php b/vendor/orchestra/testbench-core/laravel/bootstrap/app.php deleted file mode 100644 index 7ace469d..00000000 --- a/vendor/orchestra/testbench-core/laravel/bootstrap/app.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -use Orchestra\Testbench\Foundation\Application; -use Orchestra\Testbench\Foundation\Config; - -/** - * Create Laravel application. - * - * @param string $workingPath - * @return \Illuminate\Foundation\Application - */ -$createApp = function (string $workingPath) { - $config = Config::loadFromYaml( - defined('TESTBENCH_WORKING_PATH') ? TESTBENCH_WORKING_PATH : $workingPath - ); - - $hasEnvironmentFile = file_exists("{$workingPath}/.env"); - - return Application::create( - basePath: $config['laravel'], - options: ['load_environment_variables' => $hasEnvironmentFile, 'extra' => $config->getExtraAttributes()], - ); -}; - -$app = $createApp(realpath(__DIR__.'/../')); - -unset($createApp); - -/** @var \Illuminate\Routing\Router $router */ -$router = $app->make('router'); - -collect(glob(__DIR__.'/../routes/testbench-*.php')) - ->each(function ($routeFile) use ($app, $router) { - require $routeFile; - }); - -return $app; diff --git a/vendor/orchestra/testbench-core/laravel/bootstrap/cache/.gitignore b/vendor/orchestra/testbench-core/laravel/bootstrap/cache/.gitignore deleted file mode 100644 index d6b7ef32..00000000 --- a/vendor/orchestra/testbench-core/laravel/bootstrap/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/vendor/orchestra/testbench-core/laravel/composer.json b/vendor/orchestra/testbench-core/laravel/composer.json deleted file mode 100644 index 6d4fa5b0..00000000 --- a/vendor/orchestra/testbench-core/laravel/composer.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "laravel/laravel", - "description": "The Laravel Framework.", - "keywords": ["framework", "laravel"], - "license": "MIT", - "type": "project", - "require": { - "laravel/framework": "~5.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "autoload": { - "classmap": [ - "database", - "tests/TestCase.php" - ], - "psr-4": { - "App\\": "app/" - } - }, - "extra": { - "laravel": { - "dont-discover": [] - } - }, - "minimum-stability": "dev" -} diff --git a/vendor/orchestra/testbench-core/laravel/config/app.php b/vendor/orchestra/testbench-core/laravel/config/app.php deleted file mode 100644 index 75372239..00000000 --- a/vendor/orchestra/testbench-core/laravel/config/app.php +++ /dev/null @@ -1,215 +0,0 @@ -<?php - -use Illuminate\Support\Facades\Facade; - -return [ - - /* - |-------------------------------------------------------------------------- - | Application Name - |-------------------------------------------------------------------------- - | - | This value is the name of your application. This value is used when the - | framework needs to place the application's name in a notification or - | any other location as required by the application or its packages. - | - */ - - 'name' => env('APP_NAME', 'Laravel'), - - /* - |-------------------------------------------------------------------------- - | Application Environment - |-------------------------------------------------------------------------- - | - | This value determines the "environment" your application is currently - | running in. This may determine how you prefer to configure various - | services the application utilizes. Set this in your ".env" file. - | - */ - - 'env' => env('APP_ENV', 'testing'), - - /* - |-------------------------------------------------------------------------- - | Application Debug Mode - |-------------------------------------------------------------------------- - | - | When your application is in debug mode, detailed error messages with - | stack traces will be shown on every error that occurs within your - | application. If disabled, a simple generic error page is shown. - | - */ - - 'debug' => (bool) env('APP_DEBUG', false), - - /* - |-------------------------------------------------------------------------- - | Application URL - |-------------------------------------------------------------------------- - | - | This URL is used by the console to properly generate URLs when using - | the Artisan command line tool. You should set this to the root of - | your application so that it is used when running Artisan tasks. - | - */ - - 'url' => env('APP_URL', 'http://localhost'), - - 'asset_url' => env('ASSET_URL'), - - /* - |-------------------------------------------------------------------------- - | Application Timezone - |-------------------------------------------------------------------------- - | - | Here you may specify the default timezone for your application, which - | will be used by the PHP date and date-time functions. We have gone - | ahead and set this to a sensible default for you out of the box. - | - */ - - 'timezone' => 'UTC', - - /* - |-------------------------------------------------------------------------- - | Application Locale Configuration - |-------------------------------------------------------------------------- - | - | The application locale determines the default locale that will be used - | by the translation service provider. You are free to set this value - | to any of the locales which will be supported by the application. - | - */ - - 'locale' => 'en', - - /* - |-------------------------------------------------------------------------- - | Application Fallback Locale - |-------------------------------------------------------------------------- - | - | The fallback locale determines the locale to use when the current one - | is not available. You may change the value to correspond to any of - | the language folders that are provided through your application. - | - */ - - 'fallback_locale' => 'en', - - /* - |-------------------------------------------------------------------------- - | Faker Locale - |-------------------------------------------------------------------------- - | - | This locale will be used by the Faker PHP library when generating fake - | data for your database seeds. For example, this will be used to get - | localized telephone numbers, street address information and more. - | - */ - - 'faker_locale' => 'en_US', - - /* - |-------------------------------------------------------------------------- - | Encryption Key - |-------------------------------------------------------------------------- - | - | This key is used by the Illuminate encrypter service and should be set - | to a random, 32 character string, otherwise these encrypted strings - | will not be safe. Please do this before deploying an application! - | - */ - - 'key' => env('APP_KEY'), - - 'cipher' => 'AES-256-CBC', - - /* - |-------------------------------------------------------------------------- - | Maintenance Mode Driver - |-------------------------------------------------------------------------- - | - | These configuration options determine the driver used to determine and - | manage Laravel's "maintenance mode" status. The "cache" driver will - | allow maintenance mode to be controlled across multiple machines. - | - | Supported drivers: "file", "cache" - | - */ - - 'maintenance' => [ - 'driver' => 'file', - // 'store' => 'redis', - ], - - /* - |-------------------------------------------------------------------------- - | Autoloaded Service Providers - |-------------------------------------------------------------------------- - | - | The service providers listed here will be automatically loaded on the - | request to your application. Feel free to add your own services to - | this array to grant expanded functionality to your applications. - | - */ - - 'providers' => [ - - /* - * Laravel Framework Service Providers... - */ - Illuminate\Auth\AuthServiceProvider::class, - Illuminate\Broadcasting\BroadcastServiceProvider::class, - Illuminate\Bus\BusServiceProvider::class, - Illuminate\Cache\CacheServiceProvider::class, - Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, - Illuminate\Cookie\CookieServiceProvider::class, - Illuminate\Database\DatabaseServiceProvider::class, - Illuminate\Encryption\EncryptionServiceProvider::class, - Illuminate\Filesystem\FilesystemServiceProvider::class, - Illuminate\Foundation\Providers\FoundationServiceProvider::class, - Illuminate\Hashing\HashServiceProvider::class, - Illuminate\Mail\MailServiceProvider::class, - Illuminate\Notifications\NotificationServiceProvider::class, - Illuminate\Pagination\PaginationServiceProvider::class, - Illuminate\Pipeline\PipelineServiceProvider::class, - Illuminate\Queue\QueueServiceProvider::class, - Illuminate\Redis\RedisServiceProvider::class, - Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, - Illuminate\Session\SessionServiceProvider::class, - Illuminate\Translation\TranslationServiceProvider::class, - Illuminate\Validation\ValidationServiceProvider::class, - Illuminate\View\ViewServiceProvider::class, - - /* - * Package Service Providers... - */ - - /* - * Application Service Providers... - */ - // App\Providers\AppServiceProvider::class, - // App\Providers\AuthServiceProvider::class, - // // App\Providers\BroadcastServiceProvider::class, - // App\Providers\EventServiceProvider::class, - // App\Providers\RouteServiceProvider::class, - - ], - - /* - |-------------------------------------------------------------------------- - | Class Aliases - |-------------------------------------------------------------------------- - | - | This array of class aliases will be registered when this application - | is started. However, feel free to register as many as you wish as - | the aliases are "lazy" loaded so they don't hinder performance. - | - */ - - 'aliases' => Facade::defaultAliases()->merge([ - // 'ExampleClass' => App\Example\ExampleClass::class, - ])->toArray(), - -]; diff --git a/vendor/orchestra/testbench-core/laravel/config/auth.php b/vendor/orchestra/testbench-core/laravel/config/auth.php deleted file mode 100644 index bbc09ec3..00000000 --- a/vendor/orchestra/testbench-core/laravel/config/auth.php +++ /dev/null @@ -1,111 +0,0 @@ -<?php - -return [ - - /* - |-------------------------------------------------------------------------- - | Authentication Defaults - |-------------------------------------------------------------------------- - | - | This option controls the default authentication "guard" and password - | reset options for your application. You may change these defaults - | as required, but they're a perfect start for most applications. - | - */ - - 'defaults' => [ - 'guard' => 'web', - 'passwords' => 'users', - ], - - /* - |-------------------------------------------------------------------------- - | Authentication Guards - |-------------------------------------------------------------------------- - | - | Next, you may define every authentication guard for your application. - | Of course, a great default configuration has been defined for you - | here which uses session storage and the Eloquent user provider. - | - | All authentication drivers have a user provider. This defines how the - | users are actually retrieved out of your database or other storage - | mechanisms used by this application to persist your user's data. - | - | Supported: "session" - | - */ - - 'guards' => [ - 'web' => [ - 'driver' => 'session', - 'provider' => 'users', - ], - ], - - /* - |-------------------------------------------------------------------------- - | User Providers - |-------------------------------------------------------------------------- - | - | All authentication drivers have a user provider. This defines how the - | users are actually retrieved out of your database or other storage - | mechanisms used by this application to persist your user's data. - | - | If you have multiple user tables or models you may configure multiple - | sources which represent each model / table. These sources may then - | be assigned to any extra authentication guards you have defined. - | - | Supported: "database", "eloquent" - | - */ - - 'providers' => [ - 'users' => [ - 'driver' => 'eloquent', - 'model' => Illuminate\Foundation\Auth\User::class, - ], - - // 'users' => [ - // 'driver' => 'database', - // 'table' => 'users', - // ], - ], - - /* - |-------------------------------------------------------------------------- - | Resetting Passwords - |-------------------------------------------------------------------------- - | - | You may specify multiple password reset configurations if you have more - | than one user table or model in the application and you want to have - | separate password reset settings based on the specific user types. - | - | The expire time is the number of minutes that each reset token will be - | considered valid. This security feature keeps tokens short-lived so - | they have less time to be guessed. You may change this as needed. - | - */ - - 'passwords' => [ - 'users' => [ - 'provider' => 'users', - 'table' => 'password_resets', - 'expire' => 60, - 'throttle' => 60, - ], - ], - - /* - |-------------------------------------------------------------------------- - | Password Confirmation Timeout - |-------------------------------------------------------------------------- - | - | Here you may define the amount of seconds before a password confirmation - | times out and the user is prompted to re-enter their password via the - | confirmation screen. By default, the timeout lasts for three hours. - | - */ - - 'password_timeout' => 10800, - -]; diff --git a/vendor/orchestra/testbench-core/laravel/config/broadcasting.php b/vendor/orchestra/testbench-core/laravel/config/broadcasting.php deleted file mode 100644 index 9e4d4aa4..00000000 --- a/vendor/orchestra/testbench-core/laravel/config/broadcasting.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php - -return [ - - /* - |-------------------------------------------------------------------------- - | Default Broadcaster - |-------------------------------------------------------------------------- - | - | This option controls the default broadcaster that will be used by the - | framework when an event needs to be broadcast. You may set this to - | any of the connections defined in the "connections" array below. - | - | Supported: "pusher", "ably", "redis", "log", "null" - | - */ - - 'default' => env('BROADCAST_DRIVER', 'null'), - - /* - |-------------------------------------------------------------------------- - | Broadcast Connections - |-------------------------------------------------------------------------- - | - | Here you may define all of the broadcast connections that will be used - | to broadcast events to other systems or over websockets. Samples of - | each available type of connection are provided inside this array. - | - */ - - 'connections' => [ - - 'pusher' => [ - 'driver' => 'pusher', - 'key' => env('PUSHER_APP_KEY'), - 'secret' => env('PUSHER_APP_SECRET'), - 'app_id' => env('PUSHER_APP_ID'), - 'options' => [ - 'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com', - 'port' => env('PUSHER_PORT', 443), - 'scheme' => env('PUSHER_SCHEME', 'https'), - 'encrypted' => true, - 'useTLS' => env('PUSHER_SCHEME', 'https') === 'https', - ], - 'client_options' => [ - // Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html - ], - ], - - 'ably' => [ - 'driver' => 'ably', - 'key' => env('ABLY_KEY'), - ], - - 'redis' => [ - 'driver' => 'redis', - 'connection' => 'default', - ], - - 'log' => [ - 'driver' => 'log', - ], - - 'null' => [ - 'driver' => 'null', - ], - - ], - -]; diff --git a/vendor/orchestra/testbench-core/laravel/config/cache.php b/vendor/orchestra/testbench-core/laravel/config/cache.php deleted file mode 100644 index d09f66a8..00000000 --- a/vendor/orchestra/testbench-core/laravel/config/cache.php +++ /dev/null @@ -1,110 +0,0 @@ -<?php - -use Illuminate\Support\Str; - -return [ - - /* - |-------------------------------------------------------------------------- - | Default Cache Store - |-------------------------------------------------------------------------- - | - | This option controls the default cache connection that gets used while - | using this caching library. This connection is used when another is - | not explicitly specified when executing a given caching function. - | - */ - - 'default' => env('CACHE_DRIVER', 'array'), - - /* - |-------------------------------------------------------------------------- - | Cache Stores - |-------------------------------------------------------------------------- - | - | Here you may define all of the cache "stores" for your application as - | well as their drivers. You may even define multiple stores for the - | same cache driver to group types of items stored in your caches. - | - | Supported drivers: "apc", "array", "database", "file", - | "memcached", "redis", "dynamodb", "octane", "null" - | - */ - - 'stores' => [ - - 'apc' => [ - 'driver' => 'apc', - ], - - 'array' => [ - 'driver' => 'array', - 'serialize' => false, - ], - - 'database' => [ - 'driver' => 'database', - 'table' => 'cache', - 'connection' => null, - 'lock_connection' => null, - ], - - 'file' => [ - 'driver' => 'file', - 'path' => storage_path('framework/cache/data'), - ], - - 'memcached' => [ - 'driver' => 'memcached', - 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), - 'sasl' => [ - env('MEMCACHED_USERNAME'), - env('MEMCACHED_PASSWORD'), - ], - 'options' => [ - // Memcached::OPT_CONNECT_TIMEOUT => 2000, - ], - 'servers' => [ - [ - 'host' => env('MEMCACHED_HOST', '127.0.0.1'), - 'port' => env('MEMCACHED_PORT', 11211), - 'weight' => 100, - ], - ], - ], - - 'redis' => [ - 'driver' => 'redis', - 'connection' => 'cache', - 'lock_connection' => 'default', - ], - - 'dynamodb' => [ - 'driver' => 'dynamodb', - 'key' => env('AWS_ACCESS_KEY_ID'), - 'secret' => env('AWS_SECRET_ACCESS_KEY'), - 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), - 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), - 'endpoint' => env('DYNAMODB_ENDPOINT'), - ], - - 'octane' => [ - 'driver' => 'octane', - ], - - ], - - /* - |-------------------------------------------------------------------------- - | Cache Key Prefix - |-------------------------------------------------------------------------- - | - | When utilizing the APC, database, memcached, Redis, or DynamoDB cache - | stores there might be other applications using the same cache. For - | that reason, you may prefix every cache key to avoid collisions. - | - */ - - 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'), - -]; diff --git a/vendor/orchestra/testbench-core/laravel/config/cors.php b/vendor/orchestra/testbench-core/laravel/config/cors.php deleted file mode 100644 index 8a39e6da..00000000 --- a/vendor/orchestra/testbench-core/laravel/config/cors.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php - -return [ - - /* - |-------------------------------------------------------------------------- - | Cross-Origin Resource Sharing (CORS) Configuration - |-------------------------------------------------------------------------- - | - | Here you may configure your settings for cross-origin resource sharing - | or "CORS". This determines what cross-origin operations may execute - | in web browsers. You are free to adjust these settings as needed. - | - | To learn more: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS - | - */ - - 'paths' => ['api/*', 'sanctum/csrf-cookie'], - - 'allowed_methods' => ['*'], - - 'allowed_origins' => ['*'], - - 'allowed_origins_patterns' => [], - - 'allowed_headers' => ['*'], - - 'exposed_headers' => [], - - 'max_age' => 0, - - 'supports_credentials' => false, - -]; diff --git a/vendor/orchestra/testbench-core/laravel/config/database.php b/vendor/orchestra/testbench-core/laravel/config/database.php deleted file mode 100644 index 137ad18c..00000000 --- a/vendor/orchestra/testbench-core/laravel/config/database.php +++ /dev/null @@ -1,151 +0,0 @@ -<?php - -use Illuminate\Support\Str; - -return [ - - /* - |-------------------------------------------------------------------------- - | Default Database Connection Name - |-------------------------------------------------------------------------- - | - | Here you may specify which of the database connections below you wish - | to use as your default connection for all database work. Of course - | you may use many connections at once using the Database library. - | - */ - - 'default' => env('DB_CONNECTION', 'mysql'), - - /* - |-------------------------------------------------------------------------- - | Database Connections - |-------------------------------------------------------------------------- - | - | Here are each of the database connections setup for your application. - | Of course, examples of configuring each database platform that is - | supported by Laravel is shown below to make development simple. - | - | - | All database work in Laravel is done through the PHP PDO facilities - | so make sure you have the driver for your particular database of - | choice installed on your machine before you begin development. - | - */ - - 'connections' => [ - - 'sqlite' => [ - 'driver' => 'sqlite', - 'url' => env('DATABASE_URL'), - 'database' => env('DB_DATABASE', database_path('database.sqlite')), - 'prefix' => '', - 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true), - ], - - 'mysql' => [ - 'driver' => 'mysql', - 'url' => env('DATABASE_URL'), - 'host' => env('DB_HOST', '127.0.0.1'), - 'port' => env('DB_PORT', '3306'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'unix_socket' => env('DB_SOCKET', ''), - 'charset' => 'utf8mb4', - 'collation' => 'utf8mb4_unicode_ci', - 'prefix' => '', - 'prefix_indexes' => true, - 'strict' => true, - 'engine' => null, - 'options' => extension_loaded('pdo_mysql') ? array_filter([ - PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), - ]) : [], - ], - - 'pgsql' => [ - 'driver' => 'pgsql', - 'url' => env('DATABASE_URL'), - 'host' => env('DB_HOST', '127.0.0.1'), - 'port' => env('DB_PORT', '5432'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', - 'prefix' => '', - 'prefix_indexes' => true, - 'search_path' => 'public', - 'sslmode' => 'prefer', - ], - - 'sqlsrv' => [ - 'driver' => 'sqlsrv', - 'url' => env('DATABASE_URL'), - 'host' => env('DB_HOST', 'localhost'), - 'port' => env('DB_PORT', '1433'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', - 'prefix' => '', - 'prefix_indexes' => true, - // 'encrypt' => env('DB_ENCRYPT', 'yes'), - // 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'), - ], - - ], - - /* - |-------------------------------------------------------------------------- - | Migration Repository Table - |-------------------------------------------------------------------------- - | - | This table keeps track of all the migrations that have already run for - | your application. Using this information, we can determine which of - | the migrations on disk haven't actually been run in the database. - | - */ - - 'migrations' => 'migrations', - - /* - |-------------------------------------------------------------------------- - | Redis Databases - |-------------------------------------------------------------------------- - | - | Redis is an open source, fast, and advanced key-value store that also - | provides a richer body of commands than a typical key-value system - | such as APC or Memcached. Laravel makes it easy to dig right in. - | - */ - - 'redis' => [ - - 'client' => env('REDIS_CLIENT', 'phpredis'), - - 'options' => [ - 'cluster' => env('REDIS_CLUSTER', 'redis'), - 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'), - ], - - 'default' => [ - 'url' => env('REDIS_URL'), - 'host' => env('REDIS_HOST', '127.0.0.1'), - 'username' => env('REDIS_USERNAME'), - 'password' => env('REDIS_PASSWORD'), - 'port' => env('REDIS_PORT', '6379'), - 'database' => env('REDIS_DB', '0'), - ], - - 'cache' => [ - 'url' => env('REDIS_URL'), - 'host' => env('REDIS_HOST', '127.0.0.1'), - 'username' => env('REDIS_USERNAME'), - 'password' => env('REDIS_PASSWORD'), - 'port' => env('REDIS_PORT', '6379'), - 'database' => env('REDIS_CACHE_DB', '1'), - ], - - ], - -]; diff --git a/vendor/orchestra/testbench-core/laravel/config/filesystems.php b/vendor/orchestra/testbench-core/laravel/config/filesystems.php deleted file mode 100644 index e9d9dbdb..00000000 --- a/vendor/orchestra/testbench-core/laravel/config/filesystems.php +++ /dev/null @@ -1,76 +0,0 @@ -<?php - -return [ - - /* - |-------------------------------------------------------------------------- - | Default Filesystem Disk - |-------------------------------------------------------------------------- - | - | Here you may specify the default filesystem disk that should be used - | by the framework. The "local" disk, as well as a variety of cloud - | based disks are available to your application. Just store away! - | - */ - - 'default' => env('FILESYSTEM_DISK', 'local'), - - /* - |-------------------------------------------------------------------------- - | Filesystem Disks - |-------------------------------------------------------------------------- - | - | Here you may configure as many filesystem "disks" as you wish, and you - | may even configure multiple disks of the same driver. Defaults have - | been set up for each driver as an example of the required values. - | - | Supported Drivers: "local", "ftp", "sftp", "s3" - | - */ - - 'disks' => [ - - 'local' => [ - 'driver' => 'local', - 'root' => storage_path('app'), - 'throw' => false, - ], - - 'public' => [ - 'driver' => 'local', - 'root' => storage_path('app/public'), - 'url' => env('APP_URL').'/storage', - 'visibility' => 'public', - 'throw' => false, - ], - - 's3' => [ - 'driver' => 's3', - 'key' => env('AWS_ACCESS_KEY_ID'), - 'secret' => env('AWS_SECRET_ACCESS_KEY'), - 'region' => env('AWS_DEFAULT_REGION'), - 'bucket' => env('AWS_BUCKET'), - 'url' => env('AWS_URL'), - 'endpoint' => env('AWS_ENDPOINT'), - 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), - 'throw' => false, - ], - - ], - - /* - |-------------------------------------------------------------------------- - | Symbolic Links - |-------------------------------------------------------------------------- - | - | Here you may configure the symbolic links that will be created when the - | `storage:link` Artisan command is executed. The array keys should be - | the locations of the links and the values should be their targets. - | - */ - - 'links' => [ - public_path('storage') => storage_path('app/public'), - ], - -]; diff --git a/vendor/orchestra/testbench-core/laravel/config/hashing.php b/vendor/orchestra/testbench-core/laravel/config/hashing.php deleted file mode 100644 index bcd3be4c..00000000 --- a/vendor/orchestra/testbench-core/laravel/config/hashing.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php - -return [ - - /* - |-------------------------------------------------------------------------- - | Default Hash Driver - |-------------------------------------------------------------------------- - | - | This option controls the default hash driver that will be used to hash - | passwords for your application. By default, the bcrypt algorithm is - | used; however, you remain free to modify this option if you wish. - | - | Supported: "bcrypt", "argon", "argon2id" - | - */ - - 'driver' => 'bcrypt', - - /* - |-------------------------------------------------------------------------- - | Bcrypt Options - |-------------------------------------------------------------------------- - | - | Here you may specify the configuration options that should be used when - | passwords are hashed using the Bcrypt algorithm. This will allow you - | to control the amount of time it takes to hash the given password. - | - */ - - 'bcrypt' => [ - 'rounds' => env('BCRYPT_ROUNDS', 10), - ], - - /* - |-------------------------------------------------------------------------- - | Argon Options - |-------------------------------------------------------------------------- - | - | Here you may specify the configuration options that should be used when - | passwords are hashed using the Argon algorithm. These will allow you - | to control the amount of time it takes to hash the given password. - | - */ - - 'argon' => [ - 'memory' => 65536, - 'threads' => 1, - 'time' => 4, - ], - -]; diff --git a/vendor/orchestra/testbench-core/laravel/config/logging.php b/vendor/orchestra/testbench-core/laravel/config/logging.php deleted file mode 100644 index 5aa1dbb7..00000000 --- a/vendor/orchestra/testbench-core/laravel/config/logging.php +++ /dev/null @@ -1,122 +0,0 @@ -<?php - -use Monolog\Handler\NullHandler; -use Monolog\Handler\StreamHandler; -use Monolog\Handler\SyslogUdpHandler; - -return [ - - /* - |-------------------------------------------------------------------------- - | Default Log Channel - |-------------------------------------------------------------------------- - | - | This option defines the default log channel that gets used when writing - | messages to the logs. The name specified in this option should match - | one of the channels defined in the "channels" configuration array. - | - */ - - 'default' => env('LOG_CHANNEL', 'stack'), - - /* - |-------------------------------------------------------------------------- - | Deprecations Log Channel - |-------------------------------------------------------------------------- - | - | This option controls the log channel that should be used to log warnings - | regarding deprecated PHP and library features. This allows you to get - | your application ready for upcoming major versions of dependencies. - | - */ - - 'deprecations' => [ - 'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'), - 'trace' => false, - ], - - /* - |-------------------------------------------------------------------------- - | Log Channels - |-------------------------------------------------------------------------- - | - | Here you may configure the log channels for your application. Out of - | the box, Laravel uses the Monolog PHP logging library. This gives - | you a variety of powerful log handlers / formatters to utilize. - | - | Available Drivers: "single", "daily", "slack", "syslog", - | "errorlog", "monolog", - | "custom", "stack" - | - */ - - 'channels' => [ - 'stack' => [ - 'driver' => 'stack', - 'channels' => ['single'], - 'ignore_exceptions' => false, - ], - - 'single' => [ - 'driver' => 'single', - 'path' => storage_path('logs/laravel.log'), - 'level' => env('LOG_LEVEL', 'debug'), - ], - - 'daily' => [ - 'driver' => 'daily', - 'path' => storage_path('logs/laravel.log'), - 'level' => env('LOG_LEVEL', 'debug'), - 'days' => 14, - ], - - 'slack' => [ - 'driver' => 'slack', - 'url' => env('LOG_SLACK_WEBHOOK_URL'), - 'username' => 'Laravel Log', - 'emoji' => ':boom:', - 'level' => env('LOG_LEVEL', 'critical'), - ], - - 'papertrail' => [ - 'driver' => 'monolog', - 'level' => env('LOG_LEVEL', 'debug'), - 'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class), - 'handler_with' => [ - 'host' => env('PAPERTRAIL_URL'), - 'port' => env('PAPERTRAIL_PORT'), - 'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'), - ], - ], - - 'stderr' => [ - 'driver' => 'monolog', - 'level' => env('LOG_LEVEL', 'debug'), - 'handler' => StreamHandler::class, - 'formatter' => env('LOG_STDERR_FORMATTER'), - 'with' => [ - 'stream' => 'php://stderr', - ], - ], - - 'syslog' => [ - 'driver' => 'syslog', - 'level' => env('LOG_LEVEL', 'debug'), - ], - - 'errorlog' => [ - 'driver' => 'errorlog', - 'level' => env('LOG_LEVEL', 'debug'), - ], - - 'null' => [ - 'driver' => 'monolog', - 'handler' => NullHandler::class, - ], - - 'emergency' => [ - 'path' => storage_path('logs/laravel.log'), - ], - ], - -]; diff --git a/vendor/orchestra/testbench-core/laravel/config/mail.php b/vendor/orchestra/testbench-core/laravel/config/mail.php deleted file mode 100644 index 534395a3..00000000 --- a/vendor/orchestra/testbench-core/laravel/config/mail.php +++ /dev/null @@ -1,118 +0,0 @@ -<?php - -return [ - - /* - |-------------------------------------------------------------------------- - | Default Mailer - |-------------------------------------------------------------------------- - | - | This option controls the default mailer that is used to send any email - | messages sent by your application. Alternative mailers may be setup - | and used as needed; however, this mailer will be used by default. - | - */ - - 'default' => env('MAIL_MAILER', 'smtp'), - - /* - |-------------------------------------------------------------------------- - | Mailer Configurations - |-------------------------------------------------------------------------- - | - | Here you may configure all of the mailers used by your application plus - | their respective settings. Several examples have been configured for - | you and you are free to add your own as your application requires. - | - | Laravel supports a variety of mail "transport" drivers to be used while - | sending an e-mail. You will specify which one you are using for your - | mailers below. You are free to add additional mailers as required. - | - | Supported: "smtp", "sendmail", "mailgun", "ses", - | "postmark", "log", "array", "failover" - | - */ - - 'mailers' => [ - 'smtp' => [ - 'transport' => 'smtp', - 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), - 'port' => env('MAIL_PORT', 587), - 'encryption' => env('MAIL_ENCRYPTION', 'tls'), - 'username' => env('MAIL_USERNAME'), - 'password' => env('MAIL_PASSWORD'), - 'timeout' => null, - 'local_domain' => env('MAIL_EHLO_DOMAIN'), - ], - - 'ses' => [ - 'transport' => 'ses', - ], - - 'mailgun' => [ - 'transport' => 'mailgun', - ], - - 'postmark' => [ - 'transport' => 'postmark', - ], - - 'sendmail' => [ - 'transport' => 'sendmail', - 'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'), - ], - - 'log' => [ - 'transport' => 'log', - 'channel' => env('MAIL_LOG_CHANNEL'), - ], - - 'array' => [ - 'transport' => 'array', - ], - - 'failover' => [ - 'transport' => 'failover', - 'mailers' => [ - 'smtp', - 'log', - ], - ], - ], - - /* - |-------------------------------------------------------------------------- - | Global "From" Address - |-------------------------------------------------------------------------- - | - | You may wish for all e-mails sent by your application to be sent from - | the same address. Here, you may specify a name and address that is - | used globally for all e-mails that are sent by your application. - | - */ - - 'from' => [ - 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), - 'name' => env('MAIL_FROM_NAME', 'Example'), - ], - - /* - |-------------------------------------------------------------------------- - | Markdown Mail Settings - |-------------------------------------------------------------------------- - | - | If you are using Markdown based email rendering, you may configure your - | theme and component paths here, allowing you to customize the design - | of the emails. Or, you may simply stick with the Laravel defaults! - | - */ - - 'markdown' => [ - 'theme' => 'default', - - 'paths' => [ - resource_path('views/vendor/mail'), - ], - ], - -]; diff --git a/vendor/orchestra/testbench-core/laravel/config/queue.php b/vendor/orchestra/testbench-core/laravel/config/queue.php deleted file mode 100644 index 25ea5a81..00000000 --- a/vendor/orchestra/testbench-core/laravel/config/queue.php +++ /dev/null @@ -1,93 +0,0 @@ -<?php - -return [ - - /* - |-------------------------------------------------------------------------- - | Default Queue Connection Name - |-------------------------------------------------------------------------- - | - | Laravel's queue API supports an assortment of back-ends via a single - | API, giving you convenient access to each back-end using the same - | syntax for every one. Here you may define a default connection. - | - */ - - 'default' => env('QUEUE_CONNECTION', 'sync'), - - /* - |-------------------------------------------------------------------------- - | Queue Connections - |-------------------------------------------------------------------------- - | - | Here you may configure the connection information for each server that - | is used by your application. A default configuration has been added - | for each back-end shipped with Laravel. You are free to add more. - | - | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" - | - */ - - 'connections' => [ - - 'sync' => [ - 'driver' => 'sync', - ], - - 'database' => [ - 'driver' => 'database', - 'table' => 'jobs', - 'queue' => 'default', - 'retry_after' => 90, - 'after_commit' => false, - ], - - 'beanstalkd' => [ - 'driver' => 'beanstalkd', - 'host' => 'localhost', - 'queue' => 'default', - 'retry_after' => 90, - 'block_for' => 0, - 'after_commit' => false, - ], - - 'sqs' => [ - 'driver' => 'sqs', - 'key' => env('AWS_ACCESS_KEY_ID'), - 'secret' => env('AWS_SECRET_ACCESS_KEY'), - 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), - 'queue' => env('SQS_QUEUE', 'default'), - 'suffix' => env('SQS_SUFFIX'), - 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), - 'after_commit' => false, - ], - - 'redis' => [ - 'driver' => 'redis', - 'connection' => 'default', - 'queue' => env('REDIS_QUEUE', 'default'), - 'retry_after' => 90, - 'block_for' => null, - 'after_commit' => false, - ], - - ], - - /* - |-------------------------------------------------------------------------- - | Failed Queue Jobs - |-------------------------------------------------------------------------- - | - | These options configure the behavior of failed queue job logging so you - | can control which database and table are used to store the jobs that - | have failed. You may change them to any database / table you wish. - | - */ - - 'failed' => [ - 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'), - 'database' => env('DB_CONNECTION', 'mysql'), - 'table' => 'failed_jobs', - ], - -]; diff --git a/vendor/orchestra/testbench-core/laravel/config/services.php b/vendor/orchestra/testbench-core/laravel/config/services.php deleted file mode 100644 index 0ace530e..00000000 --- a/vendor/orchestra/testbench-core/laravel/config/services.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php - -return [ - - /* - |-------------------------------------------------------------------------- - | Third Party Services - |-------------------------------------------------------------------------- - | - | This file is for storing the credentials for third party services such - | as Mailgun, Postmark, AWS and more. This file provides the de facto - | location for this type of information, allowing packages to have - | a conventional file to locate the various service credentials. - | - */ - - 'mailgun' => [ - 'domain' => env('MAILGUN_DOMAIN'), - 'secret' => env('MAILGUN_SECRET'), - 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), - 'scheme' => 'https', - ], - - 'postmark' => [ - 'token' => env('POSTMARK_TOKEN'), - ], - - 'ses' => [ - 'key' => env('AWS_ACCESS_KEY_ID'), - 'secret' => env('AWS_SECRET_ACCESS_KEY'), - 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), - ], - -]; diff --git a/vendor/orchestra/testbench-core/laravel/config/session.php b/vendor/orchestra/testbench-core/laravel/config/session.php deleted file mode 100644 index 9e7c7b3a..00000000 --- a/vendor/orchestra/testbench-core/laravel/config/session.php +++ /dev/null @@ -1,201 +0,0 @@ -<?php - -use Illuminate\Support\Str; - -return [ - - /* - |-------------------------------------------------------------------------- - | Default Session Driver - |-------------------------------------------------------------------------- - | - | This option controls the default session "driver" that will be used on - | requests. By default, we will use the lightweight native driver but - | you may specify any of the other wonderful drivers provided here. - | - | Supported: "file", "cookie", "database", "apc", - | "memcached", "redis", "dynamodb", "array" - | - */ - - 'driver' => env('SESSION_DRIVER', 'array'), - - /* - |-------------------------------------------------------------------------- - | Session Lifetime - |-------------------------------------------------------------------------- - | - | Here you may specify the number of minutes that you wish the session - | to be allowed to remain idle before it expires. If you want them - | to immediately expire on the browser closing, set that option. - | - */ - - 'lifetime' => env('SESSION_LIFETIME', 120), - - 'expire_on_close' => false, - - /* - |-------------------------------------------------------------------------- - | Session Encryption - |-------------------------------------------------------------------------- - | - | This option allows you to easily specify that all of your session data - | should be encrypted before it is stored. All encryption will be run - | automatically by Laravel and you can use the Session like normal. - | - */ - - 'encrypt' => false, - - /* - |-------------------------------------------------------------------------- - | Session File Location - |-------------------------------------------------------------------------- - | - | When using the native session driver, we need a location where session - | files may be stored. A default has been set for you but a different - | location may be specified. This is only needed for file sessions. - | - */ - - 'files' => storage_path('framework/sessions'), - - /* - |-------------------------------------------------------------------------- - | Session Database Connection - |-------------------------------------------------------------------------- - | - | When using the "database" or "redis" session drivers, you may specify a - | connection that should be used to manage these sessions. This should - | correspond to a connection in your database configuration options. - | - */ - - 'connection' => env('SESSION_CONNECTION'), - - /* - |-------------------------------------------------------------------------- - | Session Database Table - |-------------------------------------------------------------------------- - | - | When using the "database" session driver, you may specify the table we - | should use to manage the sessions. Of course, a sensible default is - | provided for you; however, you are free to change this as needed. - | - */ - - 'table' => 'sessions', - - /* - |-------------------------------------------------------------------------- - | Session Cache Store - |-------------------------------------------------------------------------- - | - | While using one of the framework's cache driven session backends you may - | list a cache store that should be used for these sessions. This value - | must match with one of the application's configured cache "stores". - | - | Affects: "apc", "dynamodb", "memcached", "redis" - | - */ - - 'store' => env('SESSION_STORE'), - - /* - |-------------------------------------------------------------------------- - | Session Sweeping Lottery - |-------------------------------------------------------------------------- - | - | Some session drivers must manually sweep their storage location to get - | rid of old sessions from storage. Here are the chances that it will - | happen on a given request. By default, the odds are 2 out of 100. - | - */ - - 'lottery' => [2, 100], - - /* - |-------------------------------------------------------------------------- - | Session Cookie Name - |-------------------------------------------------------------------------- - | - | Here you may change the name of the cookie used to identify a session - | instance by ID. The name specified here will get used every time a - | new session cookie is created by the framework for every driver. - | - */ - - 'cookie' => env( - 'SESSION_COOKIE', - Str::slug(env('APP_NAME', 'laravel'), '_').'_session' - ), - - /* - |-------------------------------------------------------------------------- - | Session Cookie Path - |-------------------------------------------------------------------------- - | - | The session cookie path determines the path for which the cookie will - | be regarded as available. Typically, this will be the root path of - | your application but you are free to change this when necessary. - | - */ - - 'path' => '/', - - /* - |-------------------------------------------------------------------------- - | Session Cookie Domain - |-------------------------------------------------------------------------- - | - | Here you may change the domain of the cookie used to identify a session - | in your application. This will determine which domains the cookie is - | available to in your application. A sensible default has been set. - | - */ - - 'domain' => env('SESSION_DOMAIN'), - - /* - |-------------------------------------------------------------------------- - | HTTPS Only Cookies - |-------------------------------------------------------------------------- - | - | By setting this option to true, session cookies will only be sent back - | to the server if the browser has a HTTPS connection. This will keep - | the cookie from being sent to you when it can't be done securely. - | - */ - - 'secure' => env('SESSION_SECURE_COOKIE'), - - /* - |-------------------------------------------------------------------------- - | HTTP Access Only - |-------------------------------------------------------------------------- - | - | Setting this value to true will prevent JavaScript from accessing the - | value of the cookie and the cookie will only be accessible through - | the HTTP protocol. You are free to modify this option if needed. - | - */ - - 'http_only' => true, - - /* - |-------------------------------------------------------------------------- - | Same-Site Cookies - |-------------------------------------------------------------------------- - | - | This option determines how your cookies behave when cross-site requests - | take place, and can be used to mitigate CSRF attacks. By default, we - | will set this value to "lax" since this is a secure default value. - | - | Supported: "lax", "strict", "none", null - | - */ - - 'same_site' => 'lax', - -]; diff --git a/vendor/orchestra/testbench-core/laravel/config/view.php b/vendor/orchestra/testbench-core/laravel/config/view.php deleted file mode 100644 index 22b8a18d..00000000 --- a/vendor/orchestra/testbench-core/laravel/config/view.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - -return [ - - /* - |-------------------------------------------------------------------------- - | View Storage Paths - |-------------------------------------------------------------------------- - | - | Most templating systems load templates from disk. Here you may specify - | an array of paths that should be checked for your views. Of course - | the usual Laravel view path has already been registered for you. - | - */ - - 'paths' => [ - resource_path('views'), - ], - - /* - |-------------------------------------------------------------------------- - | Compiled View Path - |-------------------------------------------------------------------------- - | - | This option determines where all the compiled Blade templates will be - | stored for your application. Typically, this is within the storage - | directory. However, as usual, you are free to change this value. - | - */ - - 'compiled' => env( - 'VIEW_COMPILED_PATH', - realpath(storage_path('framework/views')) - ), - -]; diff --git a/vendor/orchestra/testbench-core/laravel/database/.gitignore b/vendor/orchestra/testbench-core/laravel/database/.gitignore deleted file mode 100644 index 9b19b93c..00000000 --- a/vendor/orchestra/testbench-core/laravel/database/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.sqlite* diff --git a/vendor/orchestra/testbench-core/laravel/database/factories/.gitkeep b/vendor/orchestra/testbench-core/laravel/database/factories/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/vendor/orchestra/testbench-core/laravel/database/migrations/.gitkeep b/vendor/orchestra/testbench-core/laravel/database/migrations/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/vendor/orchestra/testbench-core/laravel/database/seeders/.gitkeep b/vendor/orchestra/testbench-core/laravel/database/seeders/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/vendor/orchestra/testbench-core/laravel/lang/en.json b/vendor/orchestra/testbench-core/laravel/lang/en.json deleted file mode 100644 index 577680dd..00000000 --- a/vendor/orchestra/testbench-core/laravel/lang/en.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "The :attribute must contain at least one letter.": "The :attribute must contain at least one letter.", - "The :attribute must contain at least one number.": "The :attribute must contain at least one number.", - "The :attribute must contain at least one symbol.": "The :attribute must contain at least one symbol.", - "The :attribute must contain at least one uppercase and one lowercase letter.": "The :attribute must contain at least one uppercase and one lowercase letter.", - "The given :attribute has appeared in a data leak. Please choose a different :attribute.": "The given :attribute has appeared in a data leak. Please choose a different :attribute." -} diff --git a/vendor/orchestra/testbench-core/laravel/lang/en/auth.php b/vendor/orchestra/testbench-core/laravel/lang/en/auth.php deleted file mode 100644 index 6598e2c0..00000000 --- a/vendor/orchestra/testbench-core/laravel/lang/en/auth.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -return [ - - /* - |-------------------------------------------------------------------------- - | Authentication Language Lines - |-------------------------------------------------------------------------- - | - | The following language lines are used during authentication for various - | messages that we need to display to the user. You are free to modify - | these language lines according to your application's requirements. - | - */ - - 'failed' => 'These credentials do not match our records.', - 'password' => 'The provided password is incorrect.', - 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', - -]; diff --git a/vendor/orchestra/testbench-core/laravel/lang/en/pagination.php b/vendor/orchestra/testbench-core/laravel/lang/en/pagination.php deleted file mode 100644 index d4814118..00000000 --- a/vendor/orchestra/testbench-core/laravel/lang/en/pagination.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -return [ - - /* - |-------------------------------------------------------------------------- - | Pagination Language Lines - |-------------------------------------------------------------------------- - | - | The following language lines are used by the paginator library to build - | the simple pagination links. You are free to change them to anything - | you want to customize your views to better match your application. - | - */ - - 'previous' => '« Previous', - 'next' => 'Next »', - -]; diff --git a/vendor/orchestra/testbench-core/laravel/lang/en/passwords.php b/vendor/orchestra/testbench-core/laravel/lang/en/passwords.php deleted file mode 100644 index 2345a56b..00000000 --- a/vendor/orchestra/testbench-core/laravel/lang/en/passwords.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -return [ - - /* - |-------------------------------------------------------------------------- - | Password Reset Language Lines - |-------------------------------------------------------------------------- - | - | The following language lines are the default lines which match reasons - | that are given by the password broker for a password update attempt - | has failed, such as for an invalid token or invalid new password. - | - */ - - 'reset' => 'Your password has been reset!', - 'sent' => 'We have emailed your password reset link!', - 'throttled' => 'Please wait before retrying.', - 'token' => 'This password reset token is invalid.', - 'user' => "We can't find a user with that email address.", - -]; diff --git a/vendor/orchestra/testbench-core/laravel/lang/en/validation.php b/vendor/orchestra/testbench-core/laravel/lang/en/validation.php deleted file mode 100644 index af94bd42..00000000 --- a/vendor/orchestra/testbench-core/laravel/lang/en/validation.php +++ /dev/null @@ -1,179 +0,0 @@ -<?php - -return [ - - /* - |-------------------------------------------------------------------------- - | Validation Language Lines - |-------------------------------------------------------------------------- - | - | The following language lines contain the default error messages used by - | the validator class. Some of these rules have multiple versions such - | as the size rules. Feel free to tweak each of these messages here. - | - */ - - 'accepted' => 'The :attribute must be accepted.', - 'accepted_if' => 'The :attribute must be accepted when :other is :value.', - 'active_url' => 'The :attribute is not a valid URL.', - 'after' => 'The :attribute must be a date after :date.', - 'after_or_equal' => 'The :attribute must be a date after or equal to :date.', - 'alpha' => 'The :attribute must only contain letters.', - 'alpha_dash' => 'The :attribute must only contain letters, numbers, dashes and underscores.', - 'alpha_num' => 'The :attribute must only contain letters and numbers.', - 'array' => 'The :attribute must be an array.', - 'ascii' => 'The :attribute must only contain single-byte alphanumeric characters and symbols.', - 'before' => 'The :attribute must be a date before :date.', - 'before_or_equal' => 'The :attribute must be a date before or equal to :date.', - 'between' => [ - 'array' => 'The :attribute must have between :min and :max items.', - 'file' => 'The :attribute must be between :min and :max kilobytes.', - 'numeric' => 'The :attribute must be between :min and :max.', - 'string' => 'The :attribute must be between :min and :max characters.', - ], - 'boolean' => 'The :attribute field must be true or false.', - 'confirmed' => 'The :attribute confirmation does not match.', - 'current_password' => 'The password is incorrect.', - 'date' => 'The :attribute is not a valid date.', - 'date_equals' => 'The :attribute must be a date equal to :date.', - 'date_format' => 'The :attribute does not match the format :format.', - 'decimal' => 'The :attribute must have :decimal decimal places.', - 'declined' => 'The :attribute must be declined.', - 'declined_if' => 'The :attribute must be declined when :other is :value.', - 'different' => 'The :attribute and :other must be different.', - 'digits' => 'The :attribute must be :digits digits.', - 'digits_between' => 'The :attribute must be between :min and :max digits.', - 'dimensions' => 'The :attribute has invalid image dimensions.', - 'distinct' => 'The :attribute field has a duplicate value.', - 'doesnt_end_with' => 'The :attribute may not end with one of the following: :values.', - 'doesnt_start_with' => 'The :attribute may not start with one of the following: :values.', - 'email' => 'The :attribute must be a valid email address.', - 'ends_with' => 'The :attribute must end with one of the following: :values.', - 'enum' => 'The selected :attribute is invalid.', - 'exists' => 'The selected :attribute is invalid.', - 'file' => 'The :attribute must be a file.', - 'filled' => 'The :attribute field must have a value.', - 'gt' => [ - 'array' => 'The :attribute must have more than :value items.', - 'file' => 'The :attribute must be greater than :value kilobytes.', - 'numeric' => 'The :attribute must be greater than :value.', - 'string' => 'The :attribute must be greater than :value characters.', - ], - 'gte' => [ - 'array' => 'The :attribute must have :value items or more.', - 'file' => 'The :attribute must be greater than or equal to :value kilobytes.', - 'numeric' => 'The :attribute must be greater than or equal to :value.', - 'string' => 'The :attribute must be greater than or equal to :value characters.', - ], - 'image' => 'The :attribute must be an image.', - 'in' => 'The selected :attribute is invalid.', - 'in_array' => 'The :attribute field does not exist in :other.', - 'integer' => 'The :attribute must be an integer.', - 'ip' => 'The :attribute must be a valid IP address.', - 'ipv4' => 'The :attribute must be a valid IPv4 address.', - 'ipv6' => 'The :attribute must be a valid IPv6 address.', - 'json' => 'The :attribute must be a valid JSON string.', - 'lowercase' => 'The :attribute must be lowercase.', - 'lt' => [ - 'array' => 'The :attribute must have less than :value items.', - 'file' => 'The :attribute must be less than :value kilobytes.', - 'numeric' => 'The :attribute must be less than :value.', - 'string' => 'The :attribute must be less than :value characters.', - ], - 'lte' => [ - 'array' => 'The :attribute must not have more than :value items.', - 'file' => 'The :attribute must be less than or equal to :value kilobytes.', - 'numeric' => 'The :attribute must be less than or equal to :value.', - 'string' => 'The :attribute must be less than or equal to :value characters.', - ], - 'mac_address' => 'The :attribute must be a valid MAC address.', - 'max' => [ - 'array' => 'The :attribute must not have more than :max items.', - 'file' => 'The :attribute must not be greater than :max kilobytes.', - 'numeric' => 'The :attribute must not be greater than :max.', - 'string' => 'The :attribute must not be greater than :max characters.', - ], - 'max_digits' => 'The :attribute must not have more than :max digits.', - 'mimes' => 'The :attribute must be a file of type: :values.', - 'mimetypes' => 'The :attribute must be a file of type: :values.', - 'min' => [ - 'array' => 'The :attribute must have at least :min items.', - 'file' => 'The :attribute must be at least :min kilobytes.', - 'numeric' => 'The :attribute must be at least :min.', - 'string' => 'The :attribute must be at least :min characters.', - ], - 'min_digits' => 'The :attribute must have at least :min digits.', - 'multiple_of' => 'The :attribute must be a multiple of :value.', - 'not_in' => 'The selected :attribute is invalid.', - 'not_regex' => 'The :attribute format is invalid.', - 'numeric' => 'The :attribute must be a number.', - 'password' => [ - 'letters' => 'The :attribute must contain at least one letter.', - 'mixed' => 'The :attribute must contain at least one uppercase and one lowercase letter.', - 'numbers' => 'The :attribute must contain at least one number.', - 'symbols' => 'The :attribute must contain at least one symbol.', - 'uncompromised' => 'The given :attribute has appeared in a data leak. Please choose a different :attribute.', - ], - 'present' => 'The :attribute field must be present.', - 'prohibited' => 'The :attribute field is prohibited.', - 'prohibited_if' => 'The :attribute field is prohibited when :other is :value.', - 'prohibited_unless' => 'The :attribute field is prohibited unless :other is in :values.', - 'prohibits' => 'The :attribute field prohibits :other from being present.', - 'regex' => 'The :attribute format is invalid.', - 'required' => 'The :attribute field is required.', - 'required_array_keys' => 'The :attribute field must contain entries for: :values.', - 'required_if' => 'The :attribute field is required when :other is :value.', - 'required_if_accepted' => 'The :attribute field is required when :other is accepted.', - 'required_unless' => 'The :attribute field is required unless :other is in :values.', - 'required_with' => 'The :attribute field is required when :values is present.', - 'required_with_all' => 'The :attribute field is required when :values are present.', - 'required_without' => 'The :attribute field is required when :values is not present.', - 'required_without_all' => 'The :attribute field is required when none of :values are present.', - 'same' => 'The :attribute and :other must match.', - 'size' => [ - 'array' => 'The :attribute must contain :size items.', - 'file' => 'The :attribute must be :size kilobytes.', - 'numeric' => 'The :attribute must be :size.', - 'string' => 'The :attribute must be :size characters.', - ], - 'starts_with' => 'The :attribute must start with one of the following: :values.', - 'string' => 'The :attribute must be a string.', - 'timezone' => 'The :attribute must be a valid timezone.', - 'unique' => 'The :attribute has already been taken.', - 'uploaded' => 'The :attribute failed to upload.', - 'uppercase' => 'The :attribute must be uppercase.', - 'url' => 'The :attribute must be a valid URL.', - 'ulid' => 'The :attribute must be a valid ULID.', - 'uuid' => 'The :attribute must be a valid UUID.', - - /* - |-------------------------------------------------------------------------- - | Custom Validation Language Lines - |-------------------------------------------------------------------------- - | - | Here you may specify custom validation messages for attributes using the - | convention "attribute.rule" to name the lines. This makes it quick to - | specify a specific custom language line for a given attribute rule. - | - */ - - 'custom' => [ - 'attribute-name' => [ - 'rule-name' => 'custom-message', - ], - ], - - /* - |-------------------------------------------------------------------------- - | Custom Validation Attributes - |-------------------------------------------------------------------------- - | - | The following language lines are used to swap our attribute placeholder - | with something more reader friendly such as "E-Mail Address" instead - | of "email". This simply helps us make our message more expressive. - | - */ - - 'attributes' => [], - -]; diff --git a/vendor/orchestra/testbench-core/laravel/migrations/2014_10_12_000000_testbench_create_users_table.php b/vendor/orchestra/testbench-core/laravel/migrations/2014_10_12_000000_testbench_create_users_table.php deleted file mode 100644 index cf6b7766..00000000 --- a/vendor/orchestra/testbench-core/laravel/migrations/2014_10_12_000000_testbench_create_users_table.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - -use Illuminate\Database\Migrations\Migration; -use Illuminate\Database\Schema\Blueprint; -use Illuminate\Support\Facades\Schema; - -return new class extends Migration -{ - /** - * Run the migrations. - * - * @return void - */ - public function up() - { - Schema::create('users', function (Blueprint $table) { - $table->id(); - $table->string('name'); - $table->string('email')->unique(); - $table->timestamp('email_verified_at')->nullable(); - $table->string('password'); - $table->rememberToken(); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('users'); - } -}; diff --git a/vendor/orchestra/testbench-core/laravel/migrations/2014_10_12_100000_testbench_create_password_resets_table.php b/vendor/orchestra/testbench-core/laravel/migrations/2014_10_12_100000_testbench_create_password_resets_table.php deleted file mode 100644 index fcacb80b..00000000 --- a/vendor/orchestra/testbench-core/laravel/migrations/2014_10_12_100000_testbench_create_password_resets_table.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -use Illuminate\Database\Migrations\Migration; -use Illuminate\Database\Schema\Blueprint; -use Illuminate\Support\Facades\Schema; - -return new class extends Migration -{ - /** - * Run the migrations. - * - * @return void - */ - public function up() - { - Schema::create('password_resets', function (Blueprint $table) { - $table->string('email')->index(); - $table->string('token'); - $table->timestamp('created_at')->nullable(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('password_resets'); - } -}; diff --git a/vendor/orchestra/testbench-core/laravel/migrations/2019_08_19_000000_testbench_create_failed_jobs_table.php b/vendor/orchestra/testbench-core/laravel/migrations/2019_08_19_000000_testbench_create_failed_jobs_table.php deleted file mode 100644 index 17191986..00000000 --- a/vendor/orchestra/testbench-core/laravel/migrations/2019_08_19_000000_testbench_create_failed_jobs_table.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - -use Illuminate\Database\Migrations\Migration; -use Illuminate\Database\Schema\Blueprint; -use Illuminate\Support\Facades\Schema; - -return new class extends Migration -{ - /** - * Run the migrations. - * - * @return void - */ - public function up() - { - Schema::create('failed_jobs', function (Blueprint $table) { - $table->id(); - $table->string('uuid')->unique(); - $table->text('connection'); - $table->text('queue'); - $table->longText('payload'); - $table->longText('exception'); - $table->timestamp('failed_at')->useCurrent(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('failed_jobs'); - } -}; diff --git a/vendor/orchestra/testbench-core/laravel/public/.gitignore b/vendor/orchestra/testbench-core/laravel/public/.gitignore deleted file mode 100644 index d723e54d..00000000 --- a/vendor/orchestra/testbench-core/laravel/public/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -* -!index.php -!.gitignore diff --git a/vendor/orchestra/testbench-core/laravel/public/index.php b/vendor/orchestra/testbench-core/laravel/public/index.php deleted file mode 100644 index 1d69f3a2..00000000 --- a/vendor/orchestra/testbench-core/laravel/public/index.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -use Illuminate\Contracts\Http\Kernel; -use Illuminate\Http\Request; - -define('LARAVEL_START', microtime(true)); - -/* -|-------------------------------------------------------------------------- -| Check If The Application Is Under Maintenance -|-------------------------------------------------------------------------- -| -| If the application is in maintenance / demo mode via the "down" command -| we will load this file so that any pre-rendered content can be shown -| instead of starting the framework, which could cause an exception. -| -*/ - -if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) { - require $maintenance; -} - -/* -|-------------------------------------------------------------------------- -| Register The Auto Loader -|-------------------------------------------------------------------------- -| -| Composer provides a convenient, automatically generated class loader for -| this application. We just need to utilize it! We'll simply require it -| into the script here so we don't need to manually load our classes. -| -*/ - -require __DIR__.'/../vendor/autoload.php'; - -/* -|-------------------------------------------------------------------------- -| Run The Application -|-------------------------------------------------------------------------- -| -| Once we have the application, we can handle the incoming request using -| the application's HTTP kernel. Then, we will send the response back -| to this client's browser, allowing them to enjoy our application. -| -*/ - -$app = require_once __DIR__.'/../bootstrap/app.php'; - -$kernel = $app->make(Kernel::class); - -$response = $kernel->handle( - $request = Request::capture() -)->send(); - -$kernel->terminate($request, $response); diff --git a/vendor/orchestra/testbench-core/laravel/resources/views/errors/503.blade.php b/vendor/orchestra/testbench-core/laravel/resources/views/errors/503.blade.php deleted file mode 100644 index 336936b2..00000000 --- a/vendor/orchestra/testbench-core/laravel/resources/views/errors/503.blade.php +++ /dev/null @@ -1,43 +0,0 @@ -<html> - <head> - <title>Be right back. - - - - - - -
-
-
Be right back.
-
-
- - diff --git a/vendor/orchestra/testbench-core/laravel/resources/views/welcome.blade.php b/vendor/orchestra/testbench-core/laravel/resources/views/welcome.blade.php deleted file mode 100644 index 0ad6097c..00000000 --- a/vendor/orchestra/testbench-core/laravel/resources/views/welcome.blade.php +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - Laravel - - - - - - - - - - -
- @if (Route::has('login')) - - @endif - -
-
- - - - - -
- -
-
-
- - -
-
- Laravel has wonderful, thorough documentation covering every aspect of the framework. Whether you are new to the framework or have previous experience with Laravel, we recommend reading all of the documentation from beginning to end. -
-
-
- -
-
- - -
- -
-
- Laracasts offers thousands of video tutorials on Laravel, PHP, and JavaScript development. Check them out, see for yourself, and massively level up your development skills in the process. -
-
-
- -
-
- - -
- -
-
- Laravel News is a community driven portal and newsletter aggregating all of the latest and most important news in the Laravel ecosystem, including new package releases and tutorials. -
-
-
- -
-
- -
Vibrant Ecosystem
-
- -
-
- Laravel's robust library of first-party tools and libraries, such as Forge, Vapor, Nova, and Envoyer help you take your projects to the next level. Pair them with powerful open source libraries like Cashier, Dusk, Echo, Horizon, Sanctum, Telescope, and more. -
-
-
-
-
- -
-
-
- - - - - - Shop - - - - - - - - Sponsor - -
-
- -
- Laravel v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }}) -
-
-
-
- - diff --git a/vendor/orchestra/testbench-core/laravel/routes/.gitignore b/vendor/orchestra/testbench-core/laravel/routes/.gitignore deleted file mode 100644 index d6b7ef32..00000000 --- a/vendor/orchestra/testbench-core/laravel/routes/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/vendor/orchestra/testbench-core/laravel/server.php b/vendor/orchestra/testbench-core/laravel/server.php deleted file mode 100644 index 05cdbf05..00000000 --- a/vendor/orchestra/testbench-core/laravel/server.php +++ /dev/null @@ -1,16 +0,0 @@ -make(Kernel::class)->bootstrap(); - - return $app; - } -} diff --git a/vendor/orchestra/testbench-core/src/Bootstrap/ConfigureRay.php b/vendor/orchestra/testbench-core/src/Bootstrap/ConfigureRay.php deleted file mode 100644 index a03a47f5..00000000 --- a/vendor/orchestra/testbench-core/src/Bootstrap/ConfigureRay.php +++ /dev/null @@ -1,52 +0,0 @@ -callAfterResolvingSettings($app, function ($settings, $app) { - /** @var \Spatie\Ray\Settings\Settings $settings */ - /** @var \Illuminate\Contracts\Config\Repository $config */ - $config = $app->make('config'); - - if ($config->get('database.default') === 'sqlite' && ! file_exists($config->get('database.connections.sqlite.database'))) { - $settings->send_queries_to_ray = false; - $settings->send_duplicate_queries_to_ray = false; - $settings->send_slow_queries_to_ray = false; - } - }); - } - - /** - * Setup an after resolving listener, or fire immediately if already resolved. - * - * @param TLaravel $app - * @param \Closure(\Spatie\Ray\Settings\Settings, TLaravel):void $callback - * @return void - */ - protected function callAfterResolvingSettings(Application $app, Closure $callback): void - { - $settings = Settings::class; - - $app->afterResolving($settings, $callback); - - if ($app->resolved($settings)) { - $callback($app->make($settings), $app); - } - } -} diff --git a/vendor/orchestra/testbench-core/src/Bootstrap/HandleExceptions.php b/vendor/orchestra/testbench-core/src/Bootstrap/HandleExceptions.php deleted file mode 100644 index 0db5e34f..00000000 --- a/vendor/orchestra/testbench-core/src/Bootstrap/HandleExceptions.php +++ /dev/null @@ -1,115 +0,0 @@ -testbench = $testbench; - } - - /** - * Reports a deprecation to the "deprecations" logger. - * - * @param string $message - * @param string $file - * @param int $line - * @param int $level - * @return void - * - * @throws \ErrorException - * @throws \PHPUnit\Framework\Error\Deprecated - */ - public function handleDeprecationError($message, $file, $line, $level = E_DEPRECATED) - { - parent::handleDeprecationError($message, $file, $line, $level); - - $testbenchConvertDeprecationsToExceptions = Env::get('TESTBENCH_CONVERT_DEPRECATIONS_TO_EXCEPTIONS'); - - $error = new DeprecatedException($message, $level, $file, $line); - - if ($testbenchConvertDeprecationsToExceptions === true) { - throw $error; - } - - if ($testbenchConvertDeprecationsToExceptions !== false && $this->getPhpUnitConvertDeprecationsToExceptions() === true) { - throw $error; - } - } - - /** - * Ensure the "deprecations" logger is configured. - * - * @return void - */ - protected function ensureDeprecationLoggerIsConfigured() - { - with(static::$app['config'], function ($config) { - if ($config->get('logging.channels.deprecations')) { - return; - } - - if (\is_array($options = $config->get('logging.deprecations'))) { - $driver = $options['channel'] ?? 'null'; - } else { - $driver = $options ?? 'null'; - } - - if ($driver === 'single') { - $config->set('logging.channels.deprecations', array_merge($config->get('logging.channels.single'), [ - 'path' => static::$app->storagePath('logs/deprecations.log'), - ])); - } else { - $config->set('logging.channels.deprecations', $config->get("logging.channels.{$driver}")); - } - - $config->set('logging.deprecations', [ - 'channel' => 'deprecations', - 'trace' => true, - ]); - }); - } - - /** - * Get PHPUnit convert deprecations to exceptions from TestResult. - * - * @phpunit-overrides - * - * @return bool - */ - protected function getPhpUnitConvertDeprecationsToExceptions(): bool - { - /** @var \PHPUnit\Framework\TestResult|null $testResult */ - $testResult = $this->testbench?->getTestResultObject(); - - return $testResult?->getConvertDeprecationsToExceptions() ?? false; - } - - /** - * Determine if deprecation error should be ignored. - * - * @return bool - */ - protected function shouldIgnoreDeprecationErrors() - { - return ! class_exists(LogManager::class) - || ! static::$app->hasBeenBootstrapped(); - } -} diff --git a/vendor/orchestra/testbench-core/src/Bootstrap/LoadConfiguration.php b/vendor/orchestra/testbench-core/src/Bootstrap/LoadConfiguration.php deleted file mode 100644 index a1da852e..00000000 --- a/vendor/orchestra/testbench-core/src/Bootstrap/LoadConfiguration.php +++ /dev/null @@ -1,75 +0,0 @@ -instance('config', $config = new Repository([])); - - $this->loadConfigurationFiles($app, $config); - - if (\is_null($config->get('database.connections.testing'))) { - $config->set('database.connections.testing', [ - 'driver' => 'sqlite', - 'database' => ':memory:', - 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', false), - ]); - } - - if ($config->get('database.default') === 'sqlite' && ! file_exists($config->get('database.connections.sqlite.database'))) { - $config->set('database.default', 'testing'); - } - - mb_internal_encoding('UTF-8'); - } - - /** - * Load the configuration items from all of the files. - * - * @param TLaravel $app - * @param \Illuminate\Contracts\Config\Repository $config - * @return void - */ - private function loadConfigurationFiles(Application $app, RepositoryContract $config): void - { - foreach ($this->getConfigurationFiles($app) as $key => $path) { - $config->set($key, require $path); - } - } - - /** - * Get all of the configuration files for the application. - * - * @param TLaravel $app - * @return \Generator - */ - private function getConfigurationFiles(Application $app): Generator - { - $path = is_dir($app->basePath('config')) - ? $app->basePath('config') - : realpath(__DIR__.'/../../laravel/config'); - - if (\is_string($path)) { - foreach (Finder::create()->files()->name('*.php')->in($path) as $file) { - yield basename($file->getRealPath(), '.php') => $file->getRealPath(); - } - } - } -} diff --git a/vendor/orchestra/testbench-core/src/Concerns/CreatesApplication.php b/vendor/orchestra/testbench-core/src/Concerns/CreatesApplication.php deleted file mode 100644 index 9cf39fd6..00000000 --- a/vendor/orchestra/testbench-core/src/Concerns/CreatesApplication.php +++ /dev/null @@ -1,419 +0,0 @@ - - */ - public function ignorePackageDiscoveriesFrom() - { - if (property_exists($this, 'enablesPackageDiscoveries') && $this->enablesPackageDiscoveries === true) { - return []; - } - - return ['*']; - } - - /** - * Get application timezone. - * - * @param \Illuminate\Foundation\Application $app - * @return string|null - */ - protected function getApplicationTimezone($app) - { - return $app['config']['app.timezone']; - } - - /** - * Override application bindings. - * - * @param \Illuminate\Foundation\Application $app - * @return array - */ - protected function overrideApplicationBindings($app) - { - return []; - } - - /** - * Resolve application bindings. - * - * @param \Illuminate\Foundation\Application $app - * @return void - */ - final protected function resolveApplicationBindings($app): void - { - foreach ($this->overrideApplicationBindings($app) as $original => $replacement) { - $app->bind($original, $replacement); - } - } - - /** - * Get application aliases. - * - * @param \Illuminate\Foundation\Application $app - * @return array - */ - protected function getApplicationAliases($app) - { - return $app['config']['app.aliases']; - } - - /** - * Override application aliases. - * - * @param \Illuminate\Foundation\Application $app - * @return array - */ - protected function overrideApplicationAliases($app) - { - return []; - } - - /** - * Resolve application aliases. - * - * @param \Illuminate\Foundation\Application $app - * @return array - */ - final protected function resolveApplicationAliases($app): array - { - $aliases = new Collection($this->getApplicationAliases($app)); - $overrides = $this->overrideApplicationAliases($app); - - if (! empty($overrides)) { - $aliases->transform(static function ($alias, $name) use ($overrides) { - return $overrides[$name] ?? $alias; - }); - } - - return $aliases->merge($this->getPackageAliases($app))->all(); - } - - /** - * Get package aliases. - * - * @param \Illuminate\Foundation\Application $app - * @return array - */ - protected function getPackageAliases($app) - { - return []; - } - - /** - * Get package bootstrapper. - * - * @param \Illuminate\Foundation\Application $app - * @return array - */ - protected function getPackageBootstrappers($app) - { - return []; - } - - /** - * Get application providers. - * - * @param \Illuminate\Foundation\Application $app - * @return array - */ - protected function getApplicationProviders($app) - { - return $app['config']['app.providers']; - } - - /** - * Override application aliases. - * - * @param \Illuminate\Foundation\Application $app - * @return array - */ - protected function overrideApplicationProviders($app) - { - return []; - } - - /** - * Resolve application aliases. - * - * @param \Illuminate\Foundation\Application $app - * @return array - */ - final protected function resolveApplicationProviders($app): array - { - $providers = new Collection($this->getApplicationProviders($app)); - $overrides = $this->overrideApplicationProviders($app); - - if (! empty($overrides)) { - $providers->transform( - fn ($provider) => $overrides[$provider] ?? $provider - ); - } - - return $providers->merge($this->getPackageProviders($app))->all(); - } - - /** - * Get package providers. - * - * @param \Illuminate\Foundation\Application $app - * @return array - */ - protected function getPackageProviders($app) - { - return []; - } - - /** - * Get base path. - * - * @return string - */ - protected function getBasePath() - { - return static::applicationBasePath(); - } - - /** - * Creates the application. - * - * Needs to be implemented by subclasses. - * - * @return \Illuminate\Foundation\Application - */ - public function createApplication() - { - $app = $this->resolveApplication(); - - $this->resolveApplicationBindings($app); - $this->resolveApplicationExceptionHandler($app); - $this->resolveApplicationCore($app); - $this->resolveApplicationEnvironmentVariables($app); - $this->resolveApplicationConfiguration($app); - $this->resolveApplicationHttpKernel($app); - $this->resolveApplicationConsoleKernel($app); - $this->resolveApplicationBootstrappers($app); - - return $app; - } - - /** - * Resolve application implementation. - * - * @return \Illuminate\Foundation\Application - */ - protected function resolveApplication() - { - return tap(new Application($this->getBasePath()), function ($app) { - $app->bind( - 'Illuminate\Foundation\Bootstrap\LoadConfiguration', - 'Orchestra\Testbench\Bootstrap\LoadConfiguration' - ); - - PackageManifest::swap($app, $this); - }); - } - - /** - * Resolve application core environment variables implementation. - * - * @param \Illuminate\Foundation\Application $app - * @return void - */ - protected function resolveApplicationEnvironmentVariables($app) - { - if (property_exists($this, 'loadEnvironmentVariables') && $this->loadEnvironmentVariables === true) { - $app->make('Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables')->bootstrap($app); - } - } - - /** - * Resolve application core configuration implementation. - * - * @param \Illuminate\Foundation\Application $app - * @return void - */ - protected function resolveApplicationConfiguration($app) - { - $app->make('Illuminate\Foundation\Bootstrap\LoadConfiguration')->bootstrap($app); - $app->make('Orchestra\Testbench\Bootstrap\ConfigureRay')->bootstrap($app); - - tap($this->getApplicationTimezone($app), static function ($timezone) { - ! \is_null($timezone) && date_default_timezone_set($timezone); - }); - - $app['config']['app.aliases'] = $this->resolveApplicationAliases($app); - $app['config']['app.providers'] = $this->resolveApplicationProviders($app); - } - - /** - * Resolve application core implementation. - * - * @param \Illuminate\Foundation\Application $app - * @return void - */ - protected function resolveApplicationCore($app) - { - Facade::clearResolvedInstances(); - Facade::setFacadeApplication($app); - - $app->detectEnvironment(fn () => 'testing'); - } - - /** - * Resolve application Console Kernel implementation. - * - * @param \Illuminate\Foundation\Application $app - * @return void - */ - protected function resolveApplicationConsoleKernel($app) - { - $app->singleton('Illuminate\Contracts\Console\Kernel', 'Orchestra\Testbench\Console\Kernel'); - } - - /** - * Resolve application HTTP Kernel implementation. - * - * @param \Illuminate\Foundation\Application $app - * @return void - */ - protected function resolveApplicationHttpKernel($app) - { - $app->singleton('Illuminate\Contracts\Http\Kernel', 'Orchestra\Testbench\Http\Kernel'); - } - - /** - * Resolve application HTTP exception handler. - * - * @param \Illuminate\Foundation\Application $app - * @return void - */ - protected function resolveApplicationExceptionHandler($app) - { - $app->singleton('Illuminate\Contracts\Debug\ExceptionHandler', 'Orchestra\Testbench\Exceptions\Handler'); - } - - /** - * Resolve application bootstrapper. - * - * @param \Illuminate\Foundation\Application $app - * @return void - */ - protected function resolveApplicationBootstrappers($app) - { - if ($this instanceof PHPUnitTestCase) { - $app->make('Orchestra\Testbench\Bootstrap\HandleExceptions', ['testbench' => $this])->bootstrap($app); - } else { - $app->make('Illuminate\Foundation\Bootstrap\HandleExceptions')->bootstrap($app); - } - - $app->make('Illuminate\Foundation\Bootstrap\RegisterFacades')->bootstrap($app); - $app->make('Illuminate\Foundation\Bootstrap\SetRequestForConsole')->bootstrap($app); - $app->make('Illuminate\Foundation\Bootstrap\RegisterProviders')->bootstrap($app); - - if (class_exists('Illuminate\Database\Eloquent\LegacyFactoryServiceProvider')) { - $app->register('Illuminate\Database\Eloquent\LegacyFactoryServiceProvider'); - } - - if (method_exists($this, 'parseTestMethodAnnotations')) { - $this->parseTestMethodAnnotations($app, 'environment-setup'); - $this->parseTestMethodAnnotations($app, 'define-env'); - } - - $this->defineEnvironment($app); - $this->getEnvironmentSetUp($app); - - $this->resolveApplicationRateLimiting($app); - - $app->make('Illuminate\Foundation\Bootstrap\BootProviders')->bootstrap($app); - - foreach ($this->getPackageBootstrappers($app) as $bootstrap) { - $app->make($bootstrap)->bootstrap($app); - } - - $app->make('Illuminate\Contracts\Console\Kernel')->bootstrap(); - - $refreshNameLookups = static function ($app) { - $app['router']->getRoutes()->refreshNameLookups(); - }; - - $refreshNameLookups($app); - - $app->resolving('url', fn ($url, $app) => $refreshNameLookups($app)); - } - - /** - * Resolve application rate limiting configuration. - * - * @param \Illuminate\Foundation\Application $app - * @return void - */ - protected function resolveApplicationRateLimiting($app) - { - RateLimiter::for('api', function (Request $request) { - return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip()); - }); - } - - /** - * Reset artisan commands for the application. - * - * @param \Illuminate\Foundation\Application $app - * @return void - */ - final protected function resetApplicationArtisanCommands($app) - { - $app['Illuminate\Contracts\Console\Kernel']->setArtisan(null); - } - - /** - * Define environment setup. - * - * @param \Illuminate\Foundation\Application $app - * @return void - */ - protected function defineEnvironment($app) - { - // Define environment. - } - - /** - * Define environment setup. - * - * @param \Illuminate\Foundation\Application $app - * @return void - */ - protected function getEnvironmentSetUp($app) - { - // Define your environment setup. - } -} diff --git a/vendor/orchestra/testbench-core/src/Concerns/Database/HandlesConnections.php b/vendor/orchestra/testbench-core/src/Concerns/Database/HandlesConnections.php deleted file mode 100644 index 47496826..00000000 --- a/vendor/orchestra/testbench-core/src/Concerns/Database/HandlesConnections.php +++ /dev/null @@ -1,44 +0,0 @@ - 'URL', - 'host' => 'HOST', - 'port' => 'PORT', - 'database' => ['DB', 'DATABASE'], - 'username' => ['USER', 'USERNAME'], - 'password' => 'PASSWORD', - ]; - - $config->set( - Collection::make($options) - ->mapWithKeys(function ($value, $key) use ($driver, $keyword, $config) { - $name = "database.connections.{$driver}.{$key}"; - - /** @var mixed $configuration */ - $configuration = Collection::make(Arr::wrap($value)) - ->transform(fn ($value) => env("{$keyword}_{$value}")) - ->first(fn ($value) => ! \is_null($value)) ?? $config->get($name); - - return [ - "{$name}" => $configuration, - ]; - })->all() - ); - } -} diff --git a/vendor/orchestra/testbench-core/src/Concerns/Database/WithSqlite.php b/vendor/orchestra/testbench-core/src/Concerns/Database/WithSqlite.php deleted file mode 100644 index 00faf40d..00000000 --- a/vendor/orchestra/testbench-core/src/Concerns/Database/WithSqlite.php +++ /dev/null @@ -1,47 +0,0 @@ -schemaGrammar === null) { - $this->useDefaultSchemaGrammar(); - } - - return new class($this) extends SQLiteBuilder - { - protected function createBlueprint($table, Closure $callback = null) - { - return new class($table, $callback) extends Blueprint - { - public function dropForeign($index) - { - return new Fluent(); - } - }; - } - }; - } - }; - }); - } -} diff --git a/vendor/orchestra/testbench-core/src/Concerns/HandlesAnnotations.php b/vendor/orchestra/testbench-core/src/Concerns/HandlesAnnotations.php deleted file mode 100644 index 2db9e76f..00000000 --- a/vendor/orchestra/testbench-core/src/Concerns/HandlesAnnotations.php +++ /dev/null @@ -1,51 +0,0 @@ -isAnonymous()) { - return; - } - - if (class_exists(Version::class) && version_compare(Version::id(), '10', '>=')) { - /** @phpstan-ignore-next-line */ - $registry = \PHPUnit\Metadata\Annotation\Parser\Registry::getInstance(); - } else { - /** @phpstan-ignore-next-line */ - $registry = \PHPUnit\Util\Annotation\Registry::getInstance(); - } - - /** @var array $annotations */ - $annotations = rescue( - fn () => $registry->forMethod(static::class, $this->getName(false))->symbolAnnotations(), [], false - ); - - Collection::make($annotations) - ->filter(fn ($actions, $key) => $key === $name) - ->each(function ($actions) use ($app) { - (new Collection($actions ?? [])) - ->filter(fn ($method) => \is_string($method) && method_exists($this, $method)) - ->each(function ($method) use ($app) { - $this->{$method}($app); - }); - }); - } -} diff --git a/vendor/orchestra/testbench-core/src/Concerns/HandlesDatabases.php b/vendor/orchestra/testbench-core/src/Concerns/HandlesDatabases.php deleted file mode 100644 index b6bb93a9..00000000 --- a/vendor/orchestra/testbench-core/src/Concerns/HandlesDatabases.php +++ /dev/null @@ -1,88 +0,0 @@ -app)) { - throw ApplicationNotAvailableException::make(__METHOD__); - } - - tap($app['config'], function ($config) { - $this->usesDatabaseConnectionsEnvironmentVariables($config, 'mysql', 'MYSQL'); - $this->usesDatabaseConnectionsEnvironmentVariables($config, 'pgsql', 'POSTGRES'); - $this->usesDatabaseConnectionsEnvironmentVariables($config, 'sqlsrv', 'MSSQL'); - }); - - $app['events']->listen(DatabaseRefreshed::class, function () { - $this->defineDatabaseMigrationsAfterDatabaseRefreshed(); - }); - - $this->defineDatabaseMigrations(); - - if (method_exists($this, 'parseTestMethodAnnotations')) { - $this->parseTestMethodAnnotations($app, 'define-db'); - } - - $callback(); - - $this->defineDatabaseSeeders(); - - $this->beforeApplicationDestroyed(function () { - $this->destroyDatabaseMigrations(); - }); - } - - /** - * Define database migrations. - * - * @return void - */ - protected function defineDatabaseMigrations() - { - // Define database migrations. - } - - /** - * Define database migrations after database refreshed. - * - * @return void - */ - protected function defineDatabaseMigrationsAfterDatabaseRefreshed() - { - // Define database migrations after database refreshed. - } - - /** - * Destroy database migrations. - * - * @return void - */ - protected function destroyDatabaseMigrations() - { - // Destroy database migrations. - } - - /** - * Define database seeders. - * - * @return void - */ - protected function defineDatabaseSeeders() - { - // Define database seeders. - } -} diff --git a/vendor/orchestra/testbench-core/src/Concerns/HandlesRoutes.php b/vendor/orchestra/testbench-core/src/Concerns/HandlesRoutes.php deleted file mode 100644 index 13ae587d..00000000 --- a/vendor/orchestra/testbench-core/src/Concerns/HandlesRoutes.php +++ /dev/null @@ -1,114 +0,0 @@ -app)) { - throw ApplicationNotAvailableException::make(__METHOD__); - } - - if ($app->routesAreCached()) { - return; - } - - /** @var \Illuminate\Routing\Router $router */ - $router = $app['router']; - - $this->defineRoutes($router); - - $router->middleware('web') - ->group(fn ($router) => $this->defineWebRoutes($router)); - - if (method_exists($this, 'parseTestMethodAnnotations')) { - $this->parseTestMethodAnnotations($app, 'define-route'); - } - - $router->getRoutes()->refreshNameLookups(); - } - - /** - * Define routes setup. - * - * @param \Illuminate\Routing\Router $router - * @return void - */ - protected function defineRoutes($router) - { - // Define routes. - } - - /** - * Define web routes setup. - * - * @param \Illuminate\Routing\Router $router - * @return void - */ - protected function defineWebRoutes($router) - { - // Define routes. - } - - /** - * Define cache routes setup. - * - * @param string $route - * @return void - */ - protected function defineCacheRoutes(string $route) - { - $files = new Filesystem(); - - $time = time(); - - $laravel = Application::create($this->getBasePath()); - - $files->put( - $laravel->basePath("routes/testbench-{$time}.php"), $route - ); - - $laravel->make(Kernel::class)->call('route:cache'); - - $this->assertTrue( - $files->exists(base_path('bootstrap/cache/routes-v7.php')) - ); - - if ($this->app instanceof LaravelApplication) { - $this->reloadApplication(); - } - - $this->requireApplicationCachedRoutes($files); - } - - /** - * Require application cached routes. - */ - protected function requireApplicationCachedRoutes(Filesystem $files): void - { - $this->afterApplicationCreated(function () { - if ($this->app instanceof LaravelApplication) { - require $this->app->getCachedRoutesPath(); - } - }); - - $this->beforeApplicationDestroyed(function () use ($files) { - $files->delete( - base_path('bootstrap/cache/routes-v7.php'), - ...$files->glob(base_path('routes/testbench-*.php')) - ); - - sleep(1); - }); - } -} diff --git a/vendor/orchestra/testbench-core/src/Concerns/InteractsWithPublishedFiles.php b/vendor/orchestra/testbench-core/src/Concerns/InteractsWithPublishedFiles.php deleted file mode 100644 index 933dcfae..00000000 --- a/vendor/orchestra/testbench-core/src/Concerns/InteractsWithPublishedFiles.php +++ /dev/null @@ -1,146 +0,0 @@ -cleanUpFiles(); - $this->cleanUpMigrationFiles(); - } - - /** - * Teardown Interacts with Published Files environment. - */ - protected function tearDownInteractsWithPublishedFiles(): void - { - $this->cleanUpFiles(); - $this->cleanUpMigrationFiles(); - } - - /** - * Assert file does contains data. - * - * @param array $contains - */ - protected function assertFileContains(array $contains, string $file, string $message = ''): void - { - $this->assertFilenameExists($file); - - $haystack = $this->app['files']->get( - $this->app->basePath($file) - ); - - foreach ($contains as $needle) { - $this->assertStringContainsString($needle, $haystack, $message); - } - } - - /** - * Assert file doesn't contains data. - * - * @param array $contains - */ - protected function assertFileNotContains(array $contains, string $file, string $message = ''): void - { - $this->assertFilenameExists($file); - - $haystack = $this->app['files']->get( - $this->app->basePath($file) - ); - - foreach ($contains as $needle) { - $this->assertStringNotContainsString($needle, $haystack, $message); - } - } - - /** - * Assert file does contains data. - * - * @param array $contains - */ - protected function assertMigrationFileContains(array $contains, string $file, string $message = ''): void - { - $haystack = $this->app['files']->get($this->getMigrationFile($file)); - - foreach ($contains as $needle) { - $this->assertStringContainsString($needle, $haystack, $message); - } - } - - /** - * Assert file doesn't contains data. - * - * @param array $contains - */ - protected function assertMigrationFileNotContains(array $contains, string $file, string $message = ''): void - { - $haystack = $this->app['files']->get($this->getMigrationFile($file)); - - foreach ($contains as $needle) { - $this->assertStringNotContainsString($needle, $haystack, $message); - } - } - - /** - * Assert filename exists. - */ - protected function assertFilenameExists(string $file): void - { - $appFile = $this->app->basePath($file); - - $this->assertTrue($this->app['files']->exists($appFile), "Assert file {$file} does exist"); - } - - /** - * Assert filename not exists. - */ - protected function assertFilenameNotExists(string $file): void - { - $appFile = $this->app->basePath($file); - - $this->assertTrue(! $this->app['files']->exists($appFile), "Assert file {$file} doesn't exist"); - } - - /** - * Removes generated files. - */ - protected function cleanUpFiles(): void - { - $this->app['files']->delete( - Collection::make($this->files ?? []) - ->transform(fn ($file) => $this->app->basePath($file)) - ->filter(fn ($file) => $this->app['files']->exists($file)) - ->all() - ); - } - - /** - * Removes generated migration files. - */ - protected function getMigrationFile(string $filename): string - { - $migrationPath = $this->app->databasePath('migrations'); - - return $this->app['files']->glob("{$migrationPath}/*{$filename}")[0]; - } - - /** - * Removes generated migration files. - */ - protected function cleanUpMigrationFiles(): void - { - $this->app['files']->delete( - Collection::make($this->app['files']->files($this->app->databasePath('migrations'))) - ->filter(fn ($file) => Str::endsWith($file, '.php')) - ->all() - ); - } -} diff --git a/vendor/orchestra/testbench-core/src/Concerns/Testing.php b/vendor/orchestra/testbench-core/src/Concerns/Testing.php deleted file mode 100644 index 3ea993dd..00000000 --- a/vendor/orchestra/testbench-core/src/Concerns/Testing.php +++ /dev/null @@ -1,319 +0,0 @@ - - */ - protected $afterApplicationCreatedCallbacks = []; - - /** - * The callbacks that should be run after the application is refreshed. - * - * @var array - */ - protected $afterApplicationRefreshedCallbacks = []; - - /** - * The callbacks that should be run before the application is destroyed. - * - * @var array - */ - protected $beforeApplicationDestroyedCallbacks = []; - - /** - * The exception thrown while running an application destruction callback. - * - * @var \Throwable|null - */ - protected $callbackException; - - /** - * Indicates if we have made it through the base setUp function. - * - * @var bool - */ - protected $setUpHasRun = false; - - /** - * Setup the test environment. - * - * @return void - */ - final protected function setUpTheTestEnvironment(): void - { - if (! $this->app) { - $this->refreshApplication(); - - $this->setUpParallelTestingCallbacks(); - } - - /** @var \Illuminate\Foundation\Application $app */ - $app = $this->app; - - foreach ($this->afterApplicationRefreshedCallbacks as $callback) { - \call_user_func($callback); - } - - $this->setUpTraits(); - - foreach ($this->afterApplicationCreatedCallbacks as $callback) { - \call_user_func($callback); - } - - Model::setEventDispatcher($app['events']); - - $this->setUpApplicationRoutes(); - - $this->setUpHasRun = true; - } - - /** - * Clean up the testing environment before the next test. - * - * @return void - */ - final protected function tearDownTheTestEnvironment(): void - { - if ($this->app) { - $this->callBeforeApplicationDestroyedCallbacks(); - - $this->tearDownParallelTestingCallbacks(); - - $this->app?->flush(); - - $this->app = null; - } - - $this->setUpHasRun = false; - - if (property_exists($this, 'serverVariables')) { - $this->serverVariables = []; - } - - if (property_exists($this, 'defaultHeaders')) { - $this->defaultHeaders = []; - } - - if (class_exists(Mockery::class)) { - /** @phpstan-ignore-next-line */ - if ($container = Mockery::getContainer()) { - $this->addToAssertionCount($container->mockery_getExpectationCount()); - } - - Mockery::close(); - } - - Carbon::setTestNow(); - - if (class_exists(CarbonImmutable::class)) { - CarbonImmutable::setTestNow(); - } - - $this->afterApplicationCreatedCallbacks = []; - $this->beforeApplicationDestroyedCallbacks = []; - - if (property_exists($this, 'originalExceptionHandler')) { - $this->originalExceptionHandler = null; - } - - if (property_exists($this, 'originalDeprecationHandler')) { - $this->originalDeprecationHandler = null; - } - - Artisan::forgetBootstrappers(); - Component::flushCache(); - Component::forgetComponentsResolver(); - Component::forgetFactory(); - Queue::createPayloadUsing(null); - HandleExceptions::forgetApp(); - - if ($this->callbackException) { - throw $this->callbackException; - } - } - - /** - * Boot the testing helper traits. - * - * @param array $uses - * @return array - */ - final protected function setUpTheTestEnvironmentTraits(array $uses): array - { - $this->setUpDatabaseRequirements(function () use ($uses) { - if (isset($uses[RefreshDatabase::class])) { - /** @phpstan-ignore-next-line */ - $this->refreshDatabase(); - } - - if (isset($uses[DatabaseMigrations::class])) { - /** @phpstan-ignore-next-line */ - $this->runDatabaseMigrations(); - } - }); - - if (isset($uses[DatabaseTransactions::class])) { - /** @phpstan-ignore-next-line */ - $this->beginDatabaseTransaction(); - } - - if (isset($uses[WithoutMiddleware::class])) { - /** @phpstan-ignore-next-line */ - $this->disableMiddlewareForAllTests(); - } - - if (isset($uses[WithoutEvents::class])) { - /** @phpstan-ignore-next-line */ - $this->disableEventsForAllTests(); - } - - if (isset($uses[WithFaker::class])) { - /** @phpstan-ignore-next-line */ - $this->setUpFaker(); - } - - return $uses; - } - - /** - * Setup parallel testing callback. - */ - protected function setUpParallelTestingCallbacks(): void - { - if (class_exists(ParallelTesting::class) && $this instanceof TestCase) { - /** @phpstan-ignore-next-line */ - ParallelTesting::callSetUpTestCaseCallbacks($this); - } - } - - /** - * Teardown parallel testing callback. - */ - protected function tearDownParallelTestingCallbacks(): void - { - if (class_exists(ParallelTesting::class) && $this instanceof TestCase) { - /** @phpstan-ignore-next-line */ - ParallelTesting::callTearDownTestCaseCallbacks($this); - } - } - - /** - * Register a callback to be run after the application is refreshed. - * - * @param callable():void $callback - * @return void - */ - protected function afterApplicationRefreshed(callable $callback): void - { - $this->afterApplicationRefreshedCallbacks[] = $callback; - - if ($this->setUpHasRun) { - \call_user_func($callback); - } - } - - /** - * Register a callback to be run after the application is created. - * - * @param callable():void $callback - * @return void - */ - protected function afterApplicationCreated(callable $callback): void - { - $this->afterApplicationCreatedCallbacks[] = $callback; - - if ($this->setUpHasRun) { - \call_user_func($callback); - } - } - - /** - * Register a callback to be run before the application is destroyed. - * - * @param callable():void $callback - * @return void - */ - protected function beforeApplicationDestroyed(callable $callback): void - { - array_unshift($this->beforeApplicationDestroyedCallbacks, $callback); - } - - /** - * Execute the application's pre-destruction callbacks. - * - * @return void - */ - protected function callBeforeApplicationDestroyedCallbacks() - { - foreach ($this->beforeApplicationDestroyedCallbacks as $callback) { - try { - \call_user_func($callback); - } catch (Throwable $e) { - if (! $this->callbackException) { - $this->callbackException = $e; - } - } - } - } - - /** - * Reload the application instance with cached routes. - */ - protected function reloadApplication(): void - { - $this->tearDownTheTestEnvironment(); - $this->setUpTheTestEnvironment(); - } - - /** - * Boot the testing helper traits. - * - * @return array - */ - abstract protected function setUpTraits(); - - /** - * Refresh the application instance. - * - * @return void - */ - abstract protected function refreshApplication(); -} diff --git a/vendor/orchestra/testbench-core/src/Concerns/WithFactories.php b/vendor/orchestra/testbench-core/src/Concerns/WithFactories.php deleted file mode 100644 index e516bf6e..00000000 --- a/vendor/orchestra/testbench-core/src/Concerns/WithFactories.php +++ /dev/null @@ -1,49 +0,0 @@ -app)) { - throw ApplicationNotAvailableException::make(__METHOD__); - } - - return $this->loadFactoriesUsing($this->app, $path); - } - - /** - * Load model factories from path using Application. - * - * @param \Illuminate\Contracts\Foundation\Application $app - * @param string $path - * @return $this - * - * @throws \Exception - */ - protected function loadFactoriesUsing($app, string $path) - { - if (! class_exists(ModelFactory::class)) { - throw new Exception(<<<'requirement' -Missing `laravel/legacy-factories` in composer.json. Please refer to -requirement); - } - - $app->make(ModelFactory::class)->load($path); - - return $this; - } -} diff --git a/vendor/orchestra/testbench-core/src/Concerns/WithLaravelMigrations.php b/vendor/orchestra/testbench-core/src/Concerns/WithLaravelMigrations.php deleted file mode 100644 index f8680f26..00000000 --- a/vendor/orchestra/testbench-core/src/Concerns/WithLaravelMigrations.php +++ /dev/null @@ -1,92 +0,0 @@ - $database - * @return void - */ - protected function loadLaravelMigrations($database = []): void - { - $this->loadLaravelMigrationsWithoutRollback($database); - - $this->beforeApplicationDestroyed(function () use ($database) { - $options = $this->resolveLaravelMigrationsOptions($database); - $options['--path'] = 'migrations'; - - (new MigrateProcessor($this, $options))->rollback(); - }); - } - - /** - * Migrate Laravel's default migrations without rollback. - * - * @param string|array $database - * @return void - */ - protected function loadLaravelMigrationsWithoutRollback($database = []): void - { - if (\is_null($this->app)) { - throw ApplicationNotAvailableException::make(__METHOD__); - } - - $options = $this->resolveLaravelMigrationsOptions($database); - $options['--path'] = 'migrations'; - - (new MigrateProcessor($this, $options))->up(); - - $this->resetApplicationArtisanCommands($this->app); - } - - /** - * Migrate all Laravel's migrations. - * - * @param string|array $database - * @return void - */ - protected function runLaravelMigrations($database = []): void - { - $this->runLaravelMigrationsWithoutRollback($database); - - $this->beforeApplicationDestroyed(function () use ($database) { - (new MigrateProcessor($this, $this->resolveLaravelMigrationsOptions($database)))->rollback(); - }); - } - - /** - * Migrate all Laravel's migrations without rollback. - * - * @param string|array $database - * @return void - */ - protected function runLaravelMigrationsWithoutRollback($database = []): void - { - if (\is_null($this->app)) { - throw ApplicationNotAvailableException::make(__METHOD__); - } - - (new MigrateProcessor($this, $this->resolveLaravelMigrationsOptions($database)))->up(); - - $this->resetApplicationArtisanCommands($this->app); - } - - /** - * Resolve Laravel Migrations Artisan command options. - * - * @param string|array $database - * @return array - */ - protected function resolveLaravelMigrationsOptions($database = []): array - { - $options = \is_array($database) ? $database : ['--database' => $database]; - - return $options; - } -} diff --git a/vendor/orchestra/testbench-core/src/Concerns/WithLoadMigrationsFrom.php b/vendor/orchestra/testbench-core/src/Concerns/WithLoadMigrationsFrom.php deleted file mode 100644 index 64302f94..00000000 --- a/vendor/orchestra/testbench-core/src/Concerns/WithLoadMigrationsFrom.php +++ /dev/null @@ -1,64 +0,0 @@ - $paths - * @return void - * - * @throws \InvalidArgumentException - */ - protected function loadMigrationsFrom($paths): void - { - $this->loadMigrationsWithoutRollbackFrom($paths); - - $this->beforeApplicationDestroyed(function () use ($paths) { - (new MigrateProcessor($this, $this->resolvePackageMigrationsOptions($paths)))->rollback(); - }); - } - - /** - * Define hooks to migrate the database before each test without rollback after. - * - * @param string|array $paths - * @return void - */ - protected function loadMigrationsWithoutRollbackFrom($paths): void - { - if (\is_null($this->app)) { - throw ApplicationNotAvailableException::make(__METHOD__); - } - - $migrator = new MigrateProcessor($this, $this->resolvePackageMigrationsOptions($paths)); - $migrator->up(); - - $this->resetApplicationArtisanCommands($this->app); - } - - /** - * Resolve Package Migrations Artisan command options. - * - * @param string|array $paths - * @return array - */ - protected function resolvePackageMigrationsOptions($paths = []): array - { - $options = \is_array($paths) ? $paths : ['--path' => $paths]; - - if (isset($options['--realpath']) && ! \is_bool($options['--realpath'])) { - throw new InvalidArgumentException('Expect --realpath to be a boolean.'); - } - - $options['--realpath'] = true; - - return $options; - } -} diff --git a/vendor/orchestra/testbench-core/src/Console/Commander.php b/vendor/orchestra/testbench-core/src/Console/Commander.php deleted file mode 100644 index 7082bea2..00000000 --- a/vendor/orchestra/testbench-core/src/Console/Commander.php +++ /dev/null @@ -1,223 +0,0 @@ - null, - 'env' => [], - 'providers' => [], - 'dont-discover' => [], - ]; - - /** - * Working path. - * - * @var string - */ - protected $workingPath; - - /** - * The environment file name. - * - * @var string - */ - protected $environmentFile = '.env'; - - /** - * Construct a new Commander. - * - * @param TConfig $config - * @param string $workingPath - */ - public function __construct(array $config, string $workingPath) - { - $this->config = $config; - $this->workingPath = $workingPath; - } - - /** - * Handle the command. - * - * @return void - */ - public function handle() - { - $input = new ArgvInput(); - $output = new ConsoleOutput(); - - try { - $laravel = $this->laravel(); - $kernel = $laravel->make(ConsoleKernel::class); - - $this->prepareCommandSignals(); - - $status = $kernel->handle($input, $output); - - $kernel->terminate($input, $status); - } catch (Throwable $error) { - $status = $this->handleException($output, $error); - } finally { - $this->handleTerminatingConsole(); - } - - exit($status); - } - - /** - * Create Laravel application. - * - * @return \Illuminate\Foundation\Application - */ - public function laravel() - { - if (! $this->app instanceof LaravelApplication) { - $laravelBasePath = $this->getBasePath(); - - tap(Application::createVendorSymlink($laravelBasePath, $this->workingPath.'/vendor'), function ($app) use ($laravelBasePath) { - $filesystem = new Filesystem(); - - $this->copyTestbenchConfigurationFile($app, $filesystem, $this->workingPath); - - if (! file_exists("{$laravelBasePath}/.env")) { - $this->copyTestbenchDotEnvFile($app, $filesystem, $this->workingPath); - } - }); - - $hasEnvironmentFile = file_exists("{$laravelBasePath}/.env"); - - $options = array_filter([ - 'load_environment_variables' => $hasEnvironmentFile, - 'extra' => [ - 'providers' => Arr::get($this->config, 'providers', []), - 'dont-discover' => Arr::get($this->config, 'dont-discover', []), - 'env' => Arr::get($this->config, 'env', []), - ], - ]); - - $this->app = Application::create( - basePath: $this->getBasePath(), - resolvingCallback: $this->resolveApplicationCallback(), - options: $options - ); - } - - return $this->app; - } - - /** - * Resolve application implementation. - * - * @return \Closure - */ - protected function resolveApplicationCallback() - { - return function ($app) { - $app->register(TestbenchServiceProvider::class); - }; - } - - /** - * Get base path. - * - * @return string - */ - protected function getBasePath() - { - $laravelBasePath = $this->config['laravel'] ?? null; - - if (! \is_null($laravelBasePath)) { - return tap(str_replace('./', $this->workingPath.'/', $laravelBasePath), static function ($path) { - $_ENV['APP_BASE_PATH'] = $path; - }); - } - - return static::applicationBasePath(); - } - - /** - * Get Application base path. - * - * @return string - */ - public static function applicationBasePath() - { - return Application::applicationBasePath(); - } - - /** - * Render an exception to the console. - * - * @param \Symfony\Component\Console\Output\OutputInterface $output - * @param \Throwable $error - * @return int - */ - protected function handleException(OutputInterface $output, Throwable $error) - { - $laravel = $this->laravel(); - - tap($laravel->make(ExceptionHandler::class), static function ($handler) use ($error, $output) { - $handler->report($error); - $handler->renderForConsole($output, $error); - }); - - return 1; - } - - /** - * Prepare command signals. - * - * @return void - */ - protected function prepareCommandSignals(): void - { - Signals::resolveAvailabilityUsing(function () { - return \extension_loaded('pcntl'); - }); - - Signals::whenAvailable(function () { - $this->signals ??= new Signals(new SignalRegistry()); - - Collection::make(Arr::wrap([SIGINT])) - ->each( - fn ($signal) => $this->signals->register($signal, fn () => $this->handleTerminatingConsole()) - ); - }); - } -} diff --git a/vendor/orchestra/testbench-core/src/Console/Kernel.php b/vendor/orchestra/testbench-core/src/Console/Kernel.php deleted file mode 100644 index 8ec4bd85..00000000 --- a/vendor/orchestra/testbench-core/src/Console/Kernel.php +++ /dev/null @@ -1,41 +0,0 @@ - - */ - protected function overrideApplicationBindings($app); - - /** - * Get application aliases. - * - * @param \Illuminate\Foundation\Application $app - * @return array - */ - protected function getApplicationAliases($app); - - /** - * Override application aliases. - * - * @param \Illuminate\Foundation\Application $app - * @return array - */ - protected function overrideApplicationAliases($app); - - /** - * Get package aliases. - * - * @param \Illuminate\Foundation\Application $app - * @return array - */ - protected function getPackageAliases($app); - - /** - * Get package bootstrapper. - * - * @param \Illuminate\Foundation\Application $app - * @return array - */ - protected function getPackageBootstrappers($app); - - /** - * Get application providers. - * - * @param \Illuminate\Foundation\Application $app - * @return array - */ - protected function getApplicationProviders($app); - - /** - * Override application aliases. - * - * @param \Illuminate\Foundation\Application $app - * @return array - */ - protected function overrideApplicationProviders($app); - - /** - * Get package providers. - * - * @param \Illuminate\Foundation\Application $app - * @return array - */ - protected function getPackageProviders($app); - - /** - * Get Application's base path. - * - * @return string - */ - public static function applicationBasePath(); - - /** - * Resolve application core configuration implementation. - * - * @param \Illuminate\Foundation\Application $app - * @return void - */ - protected function resolveApplicationConfiguration($app); - - /** - * Resolve application rate limiting configuration. - * - * @param \Illuminate\Foundation\Application $app - * - * @return void - */ - protected function resolveApplicationRateLimiting($app); - - /** - * Resolve application core implementation. - * - * @param \Illuminate\Foundation\Application $app - * @return void - */ - protected function resolveApplicationCore($app); - - /** - * Resolve application Console Kernel implementation. - * - * @param \Illuminate\Foundation\Application $app - * - * @return void - */ - protected function resolveApplicationConsoleKernel($app); - - /** - * Resolve application HTTP Kernel implementation. - * - * @param \Illuminate\Foundation\Application $app - * @return void - */ - protected function resolveApplicationHttpKernel($app); - - /** - * Resolve application HTTP exception handler. - * - * @param \Illuminate\Foundation\Application $app - * @return void - */ - protected function resolveApplicationExceptionHandler($app); -} diff --git a/vendor/orchestra/testbench-core/src/Contracts/TestCase.php b/vendor/orchestra/testbench-core/src/Contracts/TestCase.php deleted file mode 100644 index 58af6b30..00000000 --- a/vendor/orchestra/testbench-core/src/Contracts/TestCase.php +++ /dev/null @@ -1,57 +0,0 @@ - - */ - protected $options = []; - - /** - * Construct a new schema migrator. - * - * @param \Orchestra\Testbench\Contracts\TestCase $testbench - * @param array $options - */ - public function __construct(TestCase $testbench, array $options = []) - { - $this->testbench = $testbench; - $this->options = $options; - } - - /** - * Run migration. - * - * @return $this - */ - public function up() - { - $this->dispatch('migrate'); - - return $this; - } - - /** - * Rollback migration. - * - * @return $this - */ - public function rollback() - { - $this->dispatch('migrate:rollback'); - - return $this; - } - - /** - * Dispatch artisan command. - * - * @param string $command - * @return void - */ - protected function dispatch(string $command): void - { - artisan($this->testbench, $command, $this->options); - } -} diff --git a/vendor/orchestra/testbench-core/src/Exceptions/ApplicationNotAvailableException.php b/vendor/orchestra/testbench-core/src/Exceptions/ApplicationNotAvailableException.php deleted file mode 100644 index 3d1ae8b5..00000000 --- a/vendor/orchestra/testbench-core/src/Exceptions/ApplicationNotAvailableException.php +++ /dev/null @@ -1,19 +0,0 @@ - - */ - protected function testbenchExceptionHandlers() - { - return [ - \Illuminate\Foundation\Bootstrap\HandleExceptions::class, - \Orchestra\Testbench\Bootstrap\HandleExceptions::class, - ]; - } - - /** - * Convert exception to string. - * - * @return string - */ - public function __toString(): string - { - $traces = collect($this->getTrace()) - ->transform(function (array $trace): ?string { - if ((isset($trace['class']) && \in_array($trace['class'], $this->testbenchExceptionHandlers())) - || ! isset($trace['file']) - || ! isset($trace['line'])) { - return null; - } - - return sprintf('%s:%d', $trace['file'], $trace['line']); - })->filter() - ->values(); - - return sprintf('%s'.PHP_EOL.PHP_EOL.'%s', $this->getMessage(), $traces->join(PHP_EOL)); - } -} diff --git a/vendor/orchestra/testbench-core/src/Exceptions/Handler.php b/vendor/orchestra/testbench-core/src/Exceptions/Handler.php deleted file mode 100644 index 5b98e710..00000000 --- a/vendor/orchestra/testbench-core/src/Exceptions/Handler.php +++ /dev/null @@ -1,62 +0,0 @@ -, \Psr\Log\LogLevel::*> - */ - protected $levels = [ - // - ]; - - /** - * A list of the exception types that should not be reported. - * - * @var array> - */ - protected $dontReport = [ - // - ]; - - /** - * A list of the inputs that are never flashed for validation exceptions. - * - * @var array - */ - protected $dontFlash = [ - 'password', - 'password_confirmation', - ]; - - /** - * Report or log an exception. - * - * This is a great spot to send exceptions to Sentry, Bugsnag, etc. - * - * @param \Throwable $e - * @return void - */ - public function report(Throwable $e) - { - parent::report($e); - } - - /** - * Render an exception into an HTTP response. - * - * @param \Illuminate\Http\Request $request - * @param \Throwable $e - * @return \Symfony\Component\HttpFoundation\Response|\Illuminate\Http\Response - */ - public function render($request, Throwable $e) - { - return parent::render($request, $e); - } -} diff --git a/vendor/orchestra/testbench-core/src/Factories/UserFactory.php b/vendor/orchestra/testbench-core/src/Factories/UserFactory.php deleted file mode 100644 index be51c326..00000000 --- a/vendor/orchestra/testbench-core/src/Factories/UserFactory.php +++ /dev/null @@ -1,49 +0,0 @@ - - */ -class UserFactory extends Factory -{ - /** - * The name of the factory's corresponding model. - * - * @var class-string - */ - protected $model = \Illuminate\Foundation\Auth\User::class; - - /** - * Define the model's default state. - * - * @return array - */ - public function definition() - { - return [ - 'name' => fake()->name(), - 'email' => fake()->unique()->safeEmail(), - 'email_verified_at' => now(), - 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password - 'remember_token' => Str::random(10), - ]; - } - - /** - * Indicate that the model's email address should be unverified. - * - * @return static - */ - public function unverified() - { - return $this->state(fn (array $attributes) => [ - 'email_verified_at' => null, - ]); - } -} diff --git a/vendor/orchestra/testbench-core/src/Foundation/Application.php b/vendor/orchestra/testbench-core/src/Foundation/Application.php deleted file mode 100644 index 5bc5b2e1..00000000 --- a/vendor/orchestra/testbench-core/src/Foundation/Application.php +++ /dev/null @@ -1,215 +0,0 @@ - [], - 'dont-discover' => [], - ]; - - /** - * The application resolving callback. - * - * @var (callable(\Illuminate\Foundation\Application):(void))|null - */ - protected $resolvingCallback; - - /** - * Load Environment variables. - * - * @var bool - */ - protected $loadEnvironmentVariables = false; - - /** - * Create new application resolver. - * - * @param string|null $basePath - * @param (callable(\Illuminate\Foundation\Application):(void))|null $resolvingCallback - */ - public function __construct(?string $basePath = null, ?callable $resolvingCallback = null) - { - $this->basePath = $basePath; - $this->resolvingCallback = $resolvingCallback; - } - - /** - * Create symlink to vendor path via new application instance. - * - * @param string|null $basePath - * @param string $workingVendorPath - * @return \Illuminate\Foundation\Application - */ - public static function createVendorSymlink(?string $basePath, string $workingVendorPath) - { - $app = static::create(basePath: $basePath, options: ['extra' => ['dont-discover' => ['*']]]); - - (new Bootstrap\CreateVendorSymlink($workingVendorPath))->bootstrap($app); - - return $app; - } - - /** - * Create new application instance. - * - * @param string|null $basePath - * @param (callable(\Illuminate\Foundation\Application):(void))|null $resolvingCallback - * @param array $options - * @return \Illuminate\Foundation\Application - * - * @phpstan-param TConfig $options - */ - public static function create(?string $basePath = null, ?callable $resolvingCallback = null, array $options = []) - { - return (new static($basePath, $resolvingCallback))->configure($options)->createApplication(); - } - - /** - * Configure the application options. - * - * @param array $options - * @return $this - * - * @phpstan-param TConfig $options - */ - public function configure(array $options) - { - if (isset($options['load_environment_variables']) && \is_bool($options['load_environment_variables'])) { - $this->loadEnvironmentVariables = $options['load_environment_variables']; - } - - if (isset($options['enables_package_discoveries']) && \is_bool($options['enables_package_discoveries'])) { - Arr::set($options, 'extra.dont-discover', []); - } - - $this->config = Arr::only( - $options['extra'] ?? [], ['dont-discover', 'providers', 'env'] - ); - - return $this; - } - - /** - * Ignore package discovery from. - * - * @return array - */ - public function ignorePackageDiscoveriesFrom() - { - return $this->config['dont-discover'] ?? []; - } - - /** - * Get package providers. - * - * @param \Illuminate\Foundation\Application $app - * @return array - */ - protected function getPackageProviders($app) - { - return $this->config['providers'] ?? []; - } - - /** - * Resolve application implementation. - * - * @return \Illuminate\Foundation\Application - */ - protected function resolveApplication() - { - return tap($this->resolveApplicationFromTrait(), function ($app) { - if (\is_callable($this->resolvingCallback)) { - \call_user_func($this->resolvingCallback, $app); - } - }); - } - - /** - * Get base path. - * - * @return string - */ - protected function getBasePath() - { - return $this->basePath ?? static::applicationBasePath(); - } - - /** - * Resolve application core environment variables implementation. - * - * @param \Illuminate\Foundation\Application $app - * @return void - */ - protected function resolveApplicationEnvironmentVariables($app) - { - $this->resolveApplicationEnvironmentVariablesFromTrait($app); - - $variables = array_merge( - ($this->config['env'] ?? []), - default_environment_variables() - ); - - (new Bootstrap\LoadEnvironmentVariablesFromArray($variables))->bootstrap($app); - } - - /** - * Resolve application Console Kernel implementation. - * - * @param \Illuminate\Foundation\Application $app - * @return void - */ - protected function resolveApplicationConsoleKernel($app) - { - $kernel = 'Orchestra\Testbench\Console\Kernel'; - - if (file_exists($app->basePath('app/Console/Kernel.php')) && class_exists('App\Console\Kernel')) { - $kernel = 'App\Console\Kernel'; - } - - $app->singleton('Illuminate\Contracts\Console\Kernel', $kernel); - } - - /** - * Resolve application HTTP Kernel implementation. - * - * @param \Illuminate\Foundation\Application $app - * @return void - */ - protected function resolveApplicationHttpKernel($app) - { - $kernel = 'Orchestra\Testbench\Http\Kernel'; - - if (file_exists($app->basePath('app/Http/Kernel.php')) && class_exists('App\Http\Kernel')) { - $kernel = 'App\Http\Kernel'; - } - - $app->singleton('Illuminate\Contracts\Http\Kernel', $kernel); - } -} diff --git a/vendor/orchestra/testbench-core/src/Foundation/Bootstrap/CreateVendorSymlink.php b/vendor/orchestra/testbench-core/src/Foundation/Bootstrap/CreateVendorSymlink.php deleted file mode 100644 index 05ee9ec5..00000000 --- a/vendor/orchestra/testbench-core/src/Foundation/Bootstrap/CreateVendorSymlink.php +++ /dev/null @@ -1,61 +0,0 @@ -workingPath = $workingPath; - } - - /** - * Bootstrap the given application. - * - * @param \Illuminate\Contracts\Foundation\Application $app - * @return void - */ - public function bootstrap(Application $app): void - { - $filesystem = new Filesystem(); - - $appVendorPath = $app->basePath('vendor'); - - if ( - ! $filesystem->isFile("{$appVendorPath}/autoload.php") || - $filesystem->hash("{$appVendorPath}/autoload.php") !== $filesystem->hash("{$this->workingPath}/autoload.php") - ) { - if ($filesystem->exists($app->basePath('bootstrap/cache/packages.php'))) { - $filesystem->delete($app->basePath('bootstrap/cache/packages.php')); - } - - if (is_link($appVendorPath)) { - $filesystem->delete($appVendorPath); - } - - try { - $filesystem->link($this->workingPath, $appVendorPath); - } catch (ErrorException $e) { - // - } - } - - $app->flush(); - } -} diff --git a/vendor/orchestra/testbench-core/src/Foundation/Bootstrap/LoadEnvironmentVariablesFromArray.php b/vendor/orchestra/testbench-core/src/Foundation/Bootstrap/LoadEnvironmentVariablesFromArray.php deleted file mode 100644 index 6a8d6bce..00000000 --- a/vendor/orchestra/testbench-core/src/Foundation/Bootstrap/LoadEnvironmentVariablesFromArray.php +++ /dev/null @@ -1,49 +0,0 @@ - - */ - public $environmentVariables; - - /** - * Construct a new Create Vendor Symlink bootstrapper. - * - * @param array $environmentVariables - */ - public function __construct(array $environmentVariables) - { - $this->environmentVariables = $environmentVariables; - } - - /** - * Bootstrap the given application. - * - * @param \Illuminate\Contracts\Foundation\Application $app - * @return void - */ - public function bootstrap(Application $app): void - { - $store = new StringStore(implode("\n", $this->environmentVariables)); - $parser = new Parser(); - - collect($parser->parse($store->read())) - ->filter(function ($entry) { - /** @var \Dotenv\Parser\Entry $entry */ - return $entry->getValue()->isDefined(); - })->each(function ($entry) { - /** @var \Dotenv\Parser\Entry $entry */ - Env::getRepository()->set($entry->getName(), $entry->getValue()->get()->getChars()); - }); - } -} diff --git a/vendor/orchestra/testbench-core/src/Foundation/Config.php b/vendor/orchestra/testbench-core/src/Foundation/Config.php deleted file mode 100644 index 4aca596d..00000000 --- a/vendor/orchestra/testbench-core/src/Foundation/Config.php +++ /dev/null @@ -1,77 +0,0 @@ - null, - 'env' => [], - 'providers' => [], - 'dont-discover' => [], - ]; - - /** - * Load configuration from Yaml file. - * - * @param string $workingPath - * @param string|null $filename - * @param array $defaults - * @return static - */ - public static function loadFromYaml(string $workingPath, ?string $filename = 'testbench.yaml', array $defaults = []) - { - $filename ??= 'testbench.yaml'; - $config = $defaults; - - if (file_exists("{$workingPath}/{$filename}")) { - /** @var TOptionalConfig $config */ - $config = Yaml::parseFile("{$workingPath}/{$filename}"); - - $config['laravel'] = transform(Arr::get($config, 'laravel'), function ($basePath) use ($workingPath) { - return str_replace('./', $workingPath.'/', $basePath); - }); - } - - return new static($config); - } - - /** - * Add additional service providers. - * - * @param array> $providers - * @return $this - */ - public function addProviders(array $providers) - { - $this->attributes['providers'] = array_unique($this->attributes['providers'] + $providers); - - return $this; - } - - /** - * Get extra attributes. - * - * @return array{providers: array, dont-discover: array} - */ - public function getExtraAttributes(): array - { - /** @var array{providers: array, dont-discover: array} $extra */ - $extra = Arr::only($this->attributes, ['providers', 'dont-discover', 'env']); - - return $extra; - } -} diff --git a/vendor/orchestra/testbench-core/src/Foundation/Console/Concerns/CopyTestbenchFiles.php b/vendor/orchestra/testbench-core/src/Foundation/Console/Concerns/CopyTestbenchFiles.php deleted file mode 100644 index c49c3240..00000000 --- a/vendor/orchestra/testbench-core/src/Foundation/Console/Concerns/CopyTestbenchFiles.php +++ /dev/null @@ -1,89 +0,0 @@ -map(fn ($file) => "{$workingPath}/{$file}") - ->filter(fn ($file) => $filesystem->exists($file)) - ->first(); - - $testbenchFile = $app->basePath('testbench.yaml'); - - if ($filesystem->exists($testbenchFile)) { - $filesystem->copy($testbenchFile, "{$testbenchFile}.backup"); - - $this->beforeTerminating(function () use ($filesystem, $testbenchFile) { - $filesystem->move("{$testbenchFile}.backup", $testbenchFile); - }); - } - - if (! \is_null($configurationFile)) { - $filesystem->copy($configurationFile, $testbenchFile); - - $this->beforeTerminating(function () use ($filesystem, $testbenchFile) { - if ($filesystem->exists($testbenchFile)) { - $filesystem->delete($testbenchFile); - } - }); - } - } - - /** - * Copy the ".env" file. - * - * @param \Illuminate\Contracts\Foundation\Application $app - * @param \Illuminate\Filesystem\Filesystem $filesystem - * @param string $workingPath - * @return void - */ - protected function copyTestbenchDotEnvFile(Application $app, Filesystem $filesystem, string $workingPath): void - { - $configurationFile = Collection::make([ - $this->environmentFile, - "{$this->environmentFile}.example", - "{$this->environmentFile}.dist", - ])->map(fn ($file) => "{$workingPath}/{$file}") - ->push($app->basePath('.env.example')) - ->filter(fn ($file) => $filesystem->exists($file)) - ->first(); - - $environmentFile = $app->basePath('.env'); - - if ($filesystem->exists($environmentFile)) { - $filesystem->copy($environmentFile, "{$this->environmentFile}.backup"); - - $this->beforeTerminating(function () use ($filesystem, $environmentFile) { - $filesystem->move("{$this->environmentFile}.backup", $environmentFile); - }); - } - - if (! \is_null($configurationFile) && ! $filesystem->exists($environmentFile)) { - $filesystem->copy($configurationFile, $environmentFile); - - $this->beforeTerminating(function () use ($filesystem, $environmentFile) { - $filesystem->delete($environmentFile); - }); - } - } -} diff --git a/vendor/orchestra/testbench-core/src/Foundation/Console/Concerns/HandleTerminatingConsole.php b/vendor/orchestra/testbench-core/src/Foundation/Console/Concerns/HandleTerminatingConsole.php deleted file mode 100644 index 4d28066f..00000000 --- a/vendor/orchestra/testbench-core/src/Foundation/Console/Concerns/HandleTerminatingConsole.php +++ /dev/null @@ -1,39 +0,0 @@ - - */ - protected $beforeTerminatingCallbacks = []; - - /** - * Register a callback to be run before terminating the command. - * - * @param callable(\Illuminate\Filesystem\Filesystem):void $callback - * @return void - */ - protected function beforeTerminating(callable $callback): void - { - array_unshift($this->beforeTerminatingCallbacks, $callback); - } - - /** - * Handle terminating console. - * - * @return void - */ - protected function handleTerminatingConsole(): void - { - Collection::make($this->beforeTerminatingCallbacks) - ->each(function ($callback) { - \call_user_func($callback); - }); - } -} diff --git a/vendor/orchestra/testbench-core/src/Foundation/Console/Concerns/InteractsWithIO.php b/vendor/orchestra/testbench-core/src/Foundation/Console/Concerns/InteractsWithIO.php deleted file mode 100644 index dc5c2376..00000000 --- a/vendor/orchestra/testbench-core/src/Foundation/Console/Concerns/InteractsWithIO.php +++ /dev/null @@ -1,32 +0,0 @@ -components->task(sprintf( - 'Copying %s [%s] to [%s]', - $type, - $from, - $to, - )); - } -} diff --git a/vendor/orchestra/testbench-core/src/Foundation/Console/CreateSqliteDbCommand.php b/vendor/orchestra/testbench-core/src/Foundation/Console/CreateSqliteDbCommand.php deleted file mode 100644 index 2cf33d56..00000000 --- a/vendor/orchestra/testbench-core/src/Foundation/Console/CreateSqliteDbCommand.php +++ /dev/null @@ -1,56 +0,0 @@ -laravel->basePath(); - $databasePath = $this->laravel->databasePath(); - - $from = $filesystem->exists("{$databasePath}/database.sqlite.example") - ? "{$databasePath}/database.sqlite.example" - : (string) realpath(__DIR__.'/stubs/database.sqlite.example'); - $to = "{$databasePath}/database.sqlite"; - - if ($this->option('force') || ! $filesystem->exists($to)) { - $filesystem->copy($from, $to); - - $this->status($from, $to, 'file', $workingPath); - } else { - $this->components->twoColumnDetail( - sprintf('File [%s] already exists', str_replace($workingPath.'/', '', $to)), - 'SKIPPED' - ); - } - - return Command::SUCCESS; - } -} diff --git a/vendor/orchestra/testbench-core/src/Foundation/Console/DevToolCommand.php b/vendor/orchestra/testbench-core/src/Foundation/Console/DevToolCommand.php deleted file mode 100644 index d0bf2296..00000000 --- a/vendor/orchestra/testbench-core/src/Foundation/Console/DevToolCommand.php +++ /dev/null @@ -1,131 +0,0 @@ -copyTestbenchConfigurationFile($filesystem, $workingPath); - $this->copyTestbenchDotEnvFile($filesystem, $workingPath); - - $this->call('package:create-sqlite-db', ['--force' => true]); - - return Command::SUCCESS; - } - - /** - * Copy the "testbench.yaml" file. - * - * @param \Illuminate\Filesystem\Filesystem $filesystem - * @param string $workingPath - * @return void - */ - protected function copyTestbenchConfigurationFile(Filesystem $filesystem, string $workingPath): void - { - $from = (string) realpath(__DIR__.'/stubs/testbench.yaml'); - $to = "{$workingPath}/testbench.yaml"; - - if ($this->option('force') || ! $filesystem->exists($to)) { - $filesystem->copy($from, $to); - - $this->status($from, $to, 'file'); - } else { - $this->components->twoColumnDetail( - sprintf('File [%s] already exists', str_replace($workingPath.'/', '', $to)), - 'SKIPPED' - ); - } - } - - /** - * Copy the ".env" file. - * - * @param \Illuminate\Filesystem\Filesystem $filesystem - * @param string $workingPath - * @return void - */ - protected function copyTestbenchDotEnvFile(Filesystem $filesystem, string $workingPath): void - { - $from = $this->laravel->basePath('.env.example'); - - if (! $filesystem->exists($from)) { - return; - } - - $choices = Collection::make([ - $this->environmentFile, - "{$this->environmentFile}.example", - "{$this->environmentFile}.dist", - ])->filter(fn ($file) => ! $filesystem->exists("{$workingPath}/{$file}")) - ->values() - ->prepend('Skip exporting .env') - ->all(); - - if (! $this->option('force') && empty($choices)) { - $this->components->twoColumnDetail( - 'File [.env] already exists', 'SKIPPED' - ); - - return; - } - - $choice = $this->components->choice( - "Export '.env' file as?", - $choices, - ); - - if ($choice === 'Skip exporting .env') { - return; - } - - $to = "{$workingPath}/{$choice}"; - - if ($this->option('force') || ! $filesystem->exists($to)) { - $filesystem->copy($from, $to); - - $this->status($from, $to, 'file'); - } else { - $this->components->twoColumnDetail( - sprintf('File [%s] already exists', str_replace($workingPath.'/', '', $to)), - 'SKIPPED' - ); - } - } -} diff --git a/vendor/orchestra/testbench-core/src/Foundation/Console/DropSqliteDbCommand.php b/vendor/orchestra/testbench-core/src/Foundation/Console/DropSqliteDbCommand.php deleted file mode 100644 index 934fd0b7..00000000 --- a/vendor/orchestra/testbench-core/src/Foundation/Console/DropSqliteDbCommand.php +++ /dev/null @@ -1,55 +0,0 @@ -laravel->basePath(); - $databasePath = $this->laravel->databasePath(); - - $from = realpath(__DIR__.'/stubs/database.sqlite.example'); - $to = "{$databasePath}/database.sqlite"; - - if (! $filesystem->exists($to)) { - $this->components->twoColumnDetail( - sprintf('File [%s] does not exists', str_replace($workingPath.'/', '', $to)), - 'SKIPPED' - ); - } else { - $filesystem->delete($to); - - $this->components->twoColumnDetail( - sprintf('File [%s] has been deleted', str_replace($workingPath.'/', '', $to)), - 'DONE' - ); - } - - return Command::SUCCESS; - } -} diff --git a/vendor/orchestra/testbench-core/src/Foundation/Console/Kernel.php b/vendor/orchestra/testbench-core/src/Foundation/Console/Kernel.php deleted file mode 100644 index 2e07aefc..00000000 --- a/vendor/orchestra/testbench-core/src/Foundation/Console/Kernel.php +++ /dev/null @@ -1,18 +0,0 @@ -setHidden(true); - } - } - - /** - * Get the array of arguments for running PHPUnit. - * - * @param array $options - * @return array - */ - protected function phpunitArguments($options) - { - $options = Collection::make($options) - ->merge(['--printer=NunoMaduro\\Collision\\Adapters\\Phpunit\\Printer']) - ->reject(static function ($option) { - return Str::startsWith($option, '--env=') - || $option == '--coverage' - || Str::startsWith($option, '--min'); - })->values()->all(); - - return array_merge($this->commonArguments(), ['--configuration=./'], $options); - } - - /** - * Get the array of arguments for running Paratest. - * - * @param array $options - * @return array - */ - protected function paratestArguments($options) - { - $options = Collection::make($options) - ->reject(static function ($option) { - return Str::startsWith($option, '--env=') - || $option == '--coverage' - || Str::startsWith($option, '--min') - || Str::startsWith($option, '-p') - || Str::startsWith($option, '--parallel') - || Str::startsWith($option, '--recreate-databases') - || Str::startsWith($option, '--drop-databases'); - })->values()->all(); - - return array_merge([ - '--configuration=./', - "--runner=\Orchestra\Testbench\Foundation\ParallelRunner", - ], $options); - } - - /** - * Get the array of environment variables for running PHPUnit. - * - * @return array - */ - protected function phpunitEnvironmentVariables() - { - return array_merge([ - 'TESTBENCH_PACKAGE_TESTER' => 1, - ], parent::phpunitEnvironmentVariables()); - } - - /** - * Get the array of environment variables for running Paratest. - * - * @return array - */ - protected function paratestEnvironmentVariables() - { - return array_merge([ - 'TESTBENCH_PACKAGE_TESTER' => 1, - ], parent::paratestEnvironmentVariables()); - } -} diff --git a/vendor/orchestra/testbench-core/src/Foundation/Console/TestFallbackCommand.php b/vendor/orchestra/testbench-core/src/Foundation/Console/TestFallbackCommand.php deleted file mode 100644 index 3f3cb0f7..00000000 --- a/vendor/orchestra/testbench-core/src/Foundation/Console/TestFallbackCommand.php +++ /dev/null @@ -1,109 +0,0 @@ -setHidden(true); - } - } - - /** - * Execute the console command. - * - * @return int - */ - public function handle() - { - if (! $this->confirm('Running tests requires "nunomaduro/collision". Do you wish to install it as a dev dependency?')) { - return 1; - } - - $this->installCollisionDependencies(); - - return 0; - } - - /** - * Install testing needed dependencies. - * - * @return void - */ - protected function installCollisionDependencies() - { - $command = $this->findComposer().' require "nunomaduro/collision:^6.2" --dev'; - - $process = Process::fromShellCommandline($command, null, null, null, null); - - if ('\\' !== DIRECTORY_SEPARATOR && file_exists('/dev/tty') && is_readable('/dev/tty')) { - try { - $process->setTty(true); - } catch (RuntimeException $e) { - $this->output->writeln('Warning: '.$e->getMessage()); - } - } - - try { - $process->run(function ($type, $line) { - $this->output->write($line); - }); - } catch (ProcessSignaledException $e) { - if (\extension_loaded('pcntl') && $e->getSignal() !== SIGINT) { - throw $e; - } - } - } - - /** - * Get the composer command for the environment. - * - * @return string - */ - protected function findComposer() - { - /** @phpstan-ignore-next-line */ - $composerPath = TESTBENCH_WORKING_PATH.'/composer.phar'; - - if (file_exists($composerPath)) { - return '"'.PHP_BINARY.'" '.$composerPath; - } - - return 'composer'; - } -} diff --git a/vendor/orchestra/testbench-core/src/Foundation/Console/stubs/database.sqlite.example b/vendor/orchestra/testbench-core/src/Foundation/Console/stubs/database.sqlite.example deleted file mode 100644 index e69de29b..00000000 diff --git a/vendor/orchestra/testbench-core/src/Foundation/Console/stubs/testbench.yaml b/vendor/orchestra/testbench-core/src/Foundation/Console/stubs/testbench.yaml deleted file mode 100644 index e69de29b..00000000 diff --git a/vendor/orchestra/testbench-core/src/Foundation/Http/Kernel.php b/vendor/orchestra/testbench-core/src/Foundation/Http/Kernel.php deleted file mode 100644 index 54cbedd5..00000000 --- a/vendor/orchestra/testbench-core/src/Foundation/Http/Kernel.php +++ /dev/null @@ -1,18 +0,0 @@ - - */ - protected $requiredPackages = [ - 'spatie/laravel-ray', - ]; - - /** - * Create a new package manifest instance. - * - * @param \Illuminate\Filesystem\Filesystem $files - * @param string $basePath - * @param string $manifestPath - * @param \Orchestra\Testbench\Contracts\TestCase|object|null $testbench - */ - public function __construct(Filesystem $files, $basePath, $manifestPath, $testbench = null) - { - parent::__construct($files, $basePath, $manifestPath); - - $this->setTestbench($testbench); - } - - /** - * Create a new package manifest instance from base. - * - * @param \Illuminate\Foundation\Application $app - * @param object|null $testbench - * @return void - */ - public static function swap($app, $testbench = null) - { - /** @var \Illuminate\Foundation\PackageManifest $base */ - $base = $app->make(IlluminatePackageManifest::class); - - $app->instance( - IlluminatePackageManifest::class, - new static( - $base->files, $base->basePath, $base->manifestPath, $testbench - ) - ); - } - - /** - * Set Testbench instance. - * - * @param object|null $testbench - * @return void - */ - public function setTestbench($testbench): void - { - $this->testbench = \is_object($testbench) ? $testbench : null; - } - - /** - * Requires packages. - * - * @param string[] $packages - * @return $this - */ - public function requires(...$packages) - { - $this->requiredPackages = array_merge($this->requiredPackages, Arr::wrap($packages)); - - return $this; - } - - /** - * Get the current package manifest. - * - * @return array - */ - protected function getManifest() - { - $ignore = ! \is_null($this->testbench) && method_exists($this->testbench, 'ignorePackageDiscoveriesFrom') - ? ($this->testbench->ignorePackageDiscoveriesFrom() ?? []) - : []; - - $ignoreAll = \in_array('*', $ignore); - - return Collection::make(parent::getManifest()) - ->reject(function ($configuration, $package) use ($ignore, $ignoreAll) { - return ($ignoreAll && ! \in_array($package, $this->requiredPackages)) - || \in_array($package, $ignore); - })->map(static function ($configuration, $key) { - foreach ($configuration['providers'] ?? [] as $provider) { - if (! class_exists($provider)) { - return null; - } - } - - return $configuration; - })->filter()->all(); - } - - /** - * Get all of the package names that should be ignored. - * - * @return array - */ - protected function packagesToIgnore() - { - return []; - } - - /** - * Get all of the package names from root. - * - * @return array - */ - protected function providersFromRoot() - { - if (! \defined('TESTBENCH_WORKING_PATH') || ! is_file(TESTBENCH_WORKING_PATH.'/composer.json')) { - return []; - } - - $package = transform(file_get_contents(TESTBENCH_WORKING_PATH.'/composer.json'), function ($json) { - return json_decode($json, true); - }); - - return [ - $this->format($package['name']) => $package['extra']['laravel'] ?? [], - ]; - } - - /** - * Write the given manifest array to disk. - * - * @param array $manifest - * @return void - * - * @throws \Exception - */ - protected function write(array $manifest) - { - parent::write( - Collection::make($manifest)->merge($this->providersFromRoot())->filter()->all() - ); - } -} diff --git a/vendor/orchestra/testbench-core/src/Foundation/ParallelRunner.php b/vendor/orchestra/testbench-core/src/Foundation/ParallelRunner.php deleted file mode 100644 index 5830b60d..00000000 --- a/vendor/orchestra/testbench-core/src/Foundation/ParallelRunner.php +++ /dev/null @@ -1,18 +0,0 @@ -createApplication(); - } -} diff --git a/vendor/orchestra/testbench-core/src/Foundation/TestbenchServiceProvider.php b/vendor/orchestra/testbench-core/src/Foundation/TestbenchServiceProvider.php deleted file mode 100644 index d845cf9f..00000000 --- a/vendor/orchestra/testbench-core/src/Foundation/TestbenchServiceProvider.php +++ /dev/null @@ -1,60 +0,0 @@ - [ - 'Core Version' => class_exists(InstalledVersions::class) ? InstalledVersions::getPrettyVersion('orchestra/testbench-core') : '-', - 'Skeleton Path' => str_replace($workingPath, '', $this->app->basePath()), - ]); - } - - /** - * Bootstrap any application services. - * - * @return void - */ - public function boot() - { - if (file_exists($this->app->basePath('migrations'))) { - $this->loadMigrationsFrom($this->app->basePath('migrations')); - } - - if ($this->app->runningInConsole()) { - $this->commands([ - $this->isCollisionDependenciesInstalled() - ? Console\TestCommand::class - : Console\TestFallbackCommand::class, - Console\CreateSqliteDbCommand::class, - Console\DropSqliteDbCommand::class, - Console\DevToolCommand::class, - Console\ServeCommand::class, - ]); - } - } - - /** - * Check if the parallel dependencies are installed. - * - * @return bool - */ - protected function isCollisionDependenciesInstalled(): bool - { - return class_exists(CollisionTestCommand::class); - } -} diff --git a/vendor/orchestra/testbench-core/src/Http/Kernel.php b/vendor/orchestra/testbench-core/src/Http/Kernel.php deleted file mode 100644 index 91b897f5..00000000 --- a/vendor/orchestra/testbench-core/src/Http/Kernel.php +++ /dev/null @@ -1,66 +0,0 @@ - - */ - protected $middleware = [ - // Middleware\TrustHosts::class, - // Middleware\TrustProxies::class, - Middleware\PreventRequestsDuringMaintenance::class, - \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, - Middleware\TrimStrings::class, - \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, - ]; - - /** - * The application's route middleware groups. - * - * @var array> - */ - protected $middlewareGroups = [ - 'web' => [ - \Illuminate\Cookie\Middleware\EncryptCookies::class, - \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, - \Illuminate\Session\Middleware\StartSession::class, - // \Illuminate\Session\Middleware\AuthenticateSession::class, - \Illuminate\View\Middleware\ShareErrorsFromSession::class, - Middleware\VerifyCsrfToken::class, - \Illuminate\Routing\Middleware\SubstituteBindings::class, - ], - - 'api' => [ - 'throttle:api', - \Illuminate\Routing\Middleware\SubstituteBindings::class, - ], - ]; - - /** - * The application's route middleware. - * - * These middleware may be assigned to groups or used individually. - * - * @var array - */ - protected $routeMiddleware = [ - 'auth' => Middleware\Authenticate::class, - 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, - 'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class, - 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, - 'can' => \Illuminate\Auth\Middleware\Authorize::class, - 'guest' => Middleware\RedirectIfAuthenticated::class, - 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, - 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, - 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, - 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, - ]; -} diff --git a/vendor/orchestra/testbench-core/src/Http/Middleware/Authenticate.php b/vendor/orchestra/testbench-core/src/Http/Middleware/Authenticate.php deleted file mode 100644 index 9fa90a4b..00000000 --- a/vendor/orchestra/testbench-core/src/Http/Middleware/Authenticate.php +++ /dev/null @@ -1,21 +0,0 @@ -expectsJson()) { - return route('login'); - } - } -} diff --git a/vendor/orchestra/testbench-core/src/Http/Middleware/PreventRequestsDuringMaintenance.php b/vendor/orchestra/testbench-core/src/Http/Middleware/PreventRequestsDuringMaintenance.php deleted file mode 100644 index 6bf18a25..00000000 --- a/vendor/orchestra/testbench-core/src/Http/Middleware/PreventRequestsDuringMaintenance.php +++ /dev/null @@ -1,17 +0,0 @@ - - */ - protected $except = [ - // - ]; -} diff --git a/vendor/orchestra/testbench-core/src/Http/Middleware/RedirectIfAuthenticated.php b/vendor/orchestra/testbench-core/src/Http/Middleware/RedirectIfAuthenticated.php deleted file mode 100644 index e8d08146..00000000 --- a/vendor/orchestra/testbench-core/src/Http/Middleware/RedirectIfAuthenticated.php +++ /dev/null @@ -1,26 +0,0 @@ -check()) { - return redirect('/home'); - } - - return $next($request); - } -} diff --git a/vendor/orchestra/testbench-core/src/Http/Middleware/TrimStrings.php b/vendor/orchestra/testbench-core/src/Http/Middleware/TrimStrings.php deleted file mode 100644 index f7eb134e..00000000 --- a/vendor/orchestra/testbench-core/src/Http/Middleware/TrimStrings.php +++ /dev/null @@ -1,18 +0,0 @@ - - */ - protected $except = [ - 'password', - 'password_confirmation', - ]; -} diff --git a/vendor/orchestra/testbench-core/src/Http/Middleware/TrustHosts.php b/vendor/orchestra/testbench-core/src/Http/Middleware/TrustHosts.php deleted file mode 100644 index 8d740dfe..00000000 --- a/vendor/orchestra/testbench-core/src/Http/Middleware/TrustHosts.php +++ /dev/null @@ -1,20 +0,0 @@ - - */ - public function hosts() - { - return [ - $this->allSubdomainsOfApplicationUrl(), - ]; - } -} diff --git a/vendor/orchestra/testbench-core/src/Http/Middleware/TrustProxies.php b/vendor/orchestra/testbench-core/src/Http/Middleware/TrustProxies.php deleted file mode 100644 index 48102a5a..00000000 --- a/vendor/orchestra/testbench-core/src/Http/Middleware/TrustProxies.php +++ /dev/null @@ -1,28 +0,0 @@ -|string|null - */ - protected $proxies; - - /** - * The headers that should be used to detect proxies. - * - * @var int - */ - protected $headers = - Request::HEADER_X_FORWARDED_FOR | - Request::HEADER_X_FORWARDED_HOST | - Request::HEADER_X_FORWARDED_PORT | - Request::HEADER_X_FORWARDED_PROTO | - Request::HEADER_X_FORWARDED_AWS_ELB; -} diff --git a/vendor/orchestra/testbench-core/src/Http/Middleware/VerifyCsrfToken.php b/vendor/orchestra/testbench-core/src/Http/Middleware/VerifyCsrfToken.php deleted file mode 100644 index f665e639..00000000 --- a/vendor/orchestra/testbench-core/src/Http/Middleware/VerifyCsrfToken.php +++ /dev/null @@ -1,24 +0,0 @@ -setUpTheTestEnvironment(); - } - - /** - * Clean up the testing environment before the next test. - * - * @return void - */ - protected function tearDown(): void - { - $this->tearDownTheTestEnvironment(); - } - - /** - * Boot the testing helper traits. - * - * @return array - */ - protected function setUpTraits() - { - /** @var array $uses */ - $uses = array_flip(class_uses_recursive(static::class)); - - return $this->setUpTheTestEnvironmentTraits($uses); - } - - /** - * Refresh the application instance. - * - * @return void - */ - protected function refreshApplication() - { - $this->app = $this->createApplication(); - } - - /** - * Clean up the testing environment before the next test case. - * - * @return void - */ - public static function tearDownAfterClass(): void - { - static::$latestResponse = null; - - (function () { - $this->classDocBlocks = []; - $this->methodDocBlocks = []; - })->call(Registry::getInstance()); - } - - /** - * This method is called when a test method did not execute successfully. - * - * @param \Throwable $exception - * @return void - */ - protected function onNotSuccessfulTest(Throwable $exception): void - { - parent::onNotSuccessfulTest( - ! \is_null(static::$latestResponse) - ? static::$latestResponse->transformNotSuccessfulException($exception) - : $exception - ); - } -} diff --git a/vendor/orchestra/testbench-core/src/helpers.php b/vendor/orchestra/testbench-core/src/helpers.php deleted file mode 100644 index 6bd58efd..00000000 --- a/vendor/orchestra/testbench-core/src/helpers.php +++ /dev/null @@ -1,50 +0,0 @@ -configure($options); -} - -/** - * Run artisan command. - * - * @param \Orchestra\Testbench\Contracts\TestCase $testbench - * @param string $command - * @param array $parameters - * @return int - */ -function artisan(Contracts\TestCase $testbench, string $command, array $parameters = []): int -{ - $command = $testbench->artisan($command, $parameters); - - return $command instanceof PendingCommand ? $command->run() : $command; -} - -/** - * Get default environment variables. - * - * @return array - */ -function default_environment_variables(): array -{ - return collect(['APP_KEY' => 'AckfSECXIvnK5r28GVIWUAxmbBSjTsmF', 'APP_DEBUG' => 'true', 'DB_CONNECTION' => null]) - ->transform(fn ($value, $key) => ($_SERVER[$key] ?? $_ENV[$key] ?? $value)) - ->filter(fn ($value) => ! \is_null($value)) - ->transform(function ($value, $key) { - $value = $key === 'APP_DEBUG' ? "({$value})" : "'{$value}'"; - - return "{$key}={$value}"; - })->values()->all(); -} diff --git a/vendor/orchestra/testbench-core/testbench b/vendor/orchestra/testbench-core/testbench deleted file mode 100755 index 60ca4095..00000000 --- a/vendor/orchestra/testbench-core/testbench +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env php - [], - 'dont-discover' => [], - ], -); - -$commander = new Orchestra\Testbench\Console\Commander($config->getAttributes(), $workingPath); - -$commander->handle(); diff --git a/vendor/orchestra/testbench/composer.json b/vendor/orchestra/testbench/composer.json deleted file mode 100644 index 450b8f95..00000000 --- a/vendor/orchestra/testbench/composer.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "name": "orchestra/testbench", - "description": "Laravel Testing Helper for Packages Development", - "homepage": "https://packages.tools/testbench/", - "keywords": ["laravel", "orchestral", "orchestra-platform", "testing", "tdd", "bdd"], - "license": "MIT", - "authors": [ - { - "name": "Mior Muhammad Zaki", - "email": "crynobone@gmail.com", - "homepage": "https://github.com/crynobone" - } - ], - "autoload-dev": { - "psr-4": { - "Orchestra\\Testbench\\Tests\\": "core/tests/" - } - }, - "require": { - "php": "^8.0", - "fakerphp/faker": "^1.21", - "laravel/framework": "^9.45", - "mockery/mockery": "^1.5.1", - "orchestra/testbench-core": "^7.17", - "phpunit/phpunit": "^9.5.10", - "spatie/laravel-ray": "^1.28", - "symfony/process": "^6.0.9", - "symfony/yaml": "^6.0.9", - "vlucas/phpdotenv": "^5.4.1" - }, - "extra": { - "branch-alias": { - "dev-master": "7.0-dev" - } - }, - "scripts": { - "prepare": [ - "@composer run post-autoload-dump" - ], - "test": [ - "@php vendor/bin/phpunit -c ./ --color" - ], - "post-autoload-dump": [ - "@php vendor/bin/testbench package:discover --ansi" - ] - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev" -} diff --git a/vendor/phar-io/manifest/CHANGELOG.md b/vendor/phar-io/manifest/CHANGELOG.md deleted file mode 100644 index a403e093..00000000 --- a/vendor/phar-io/manifest/CHANGELOG.md +++ /dev/null @@ -1,36 +0,0 @@ -# Changelog - -All notable changes to phar-io/manifest are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. - -## [2.0.3] - 20.07.2021 - -- Fixed PHP 7.2 / PHP 7.3 incompatibility introduced in previous release - -## [2.0.2] - 20.07.2021 - -- Fixed PHP 8.1 deprecation notice - -## [2.0.1] - 27.06.2020 - -This release now supports the use of PHP 7.2+ and ^8.0 - -## [2.0.0] - 10.05.2020 - -This release now requires PHP 7.2+ - -### Changed - -- Upgraded to phar-io/version 3.0 - - Version strings `v1.2.3` will now be converted to valid semantic version strings `1.2.3` - - Abreviated strings like `1.0` will get expaneded to `1.0.0` - -### Unreleased - -[Unreleased]: https://github.com/phar-io/manifest/compare/2.0.3...HEAD -[2.0.3]: https://github.com/phar-io/manifest/compare/2.0.2...2.0.3 -[2.0.2]: https://github.com/phar-io/manifest/compare/2.0.1...2.0.2 -[2.0.1]: https://github.com/phar-io/manifest/compare/2.0.0...2.0.1 -[2.0.0]: https://github.com/phar-io/manifest/compare/1.0.1...2.0.0 -[1.0.3]: https://github.com/phar-io/manifest/compare/1.0.2...1.0.3 -[1.0.2]: https://github.com/phar-io/manifest/compare/1.0.1...1.0.2 -[1.0.1]: https://github.com/phar-io/manifest/compare/1.0.0...1.0.1 diff --git a/vendor/phar-io/manifest/LICENSE b/vendor/phar-io/manifest/LICENSE deleted file mode 100644 index 64690cf2..00000000 --- a/vendor/phar-io/manifest/LICENSE +++ /dev/null @@ -1,31 +0,0 @@ -Phar.io - Manifest - -Copyright (c) 2016-2019 Arne Blankerts , Sebastian Heuer , Sebastian Bergmann , and contributors -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 Arne Blankerts nor the names of 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 HOLDER 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/phar-io/manifest/README.md b/vendor/phar-io/manifest/README.md deleted file mode 100644 index e6d0b055..00000000 --- a/vendor/phar-io/manifest/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# Manifest - -Component for reading [phar.io](https://phar.io/) manifest information from a [PHP Archive (PHAR)](http://php.net/phar). - -[![Build Status](https://travis-ci.org/phar-io/manifest.svg?branch=master)](https://travis-ci.org/phar-io/manifest) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/phar-io/manifest/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/phar-io/manifest/?branch=master) -[![SensioLabsInsight](https://insight.sensiolabs.com/projects/d8cc6035-69ad-477d-bd1a-ccc605480fd7/mini.png)](https://insight.sensiolabs.com/projects/d8cc6035-69ad-477d-bd1a-ccc605480fd7) - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - - composer require phar-io/manifest - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - - composer require --dev phar-io/manifest - -## Usage - -```php -use PharIo\Manifest\ManifestLoader; -use PharIo\Manifest\ManifestSerializer; - -$manifest = ManifestLoader::fromFile('manifest.xml'); - -var_dump($manifest); - -echo (new ManifestSerializer)->serializeToString($manifest); -``` diff --git a/vendor/phar-io/manifest/composer.json b/vendor/phar-io/manifest/composer.json deleted file mode 100644 index a2521193..00000000 --- a/vendor/phar-io/manifest/composer.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "phar-io/manifest", - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "support": { - "issues": "https://github.com/phar-io/manifest/issues" - }, - "require": { - "php": "^7.2 || ^8.0", - "ext-dom": "*", - "ext-phar": "*", - "ext-xmlwriter": "*", - "phar-io/version": "^3.0.1" - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - } -} diff --git a/vendor/phar-io/manifest/composer.lock b/vendor/phar-io/manifest/composer.lock deleted file mode 100644 index e0e6db76..00000000 --- a/vendor/phar-io/manifest/composer.lock +++ /dev/null @@ -1,70 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "f2ac4614ce4f7273fd54a64b65fd047a", - "packages": [ - { - "name": "phar-io/version", - "version": "3.0.1", - "source": { - "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "d06a5000ac1a258a7d035295f0bd4ae7c859bc4f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/d06a5000ac1a258a7d035295f0bd4ae7c859bc4f", - "reference": "d06a5000ac1a258a7d035295f0bd4ae7c859bc4f", - "shasum": "" - }, - "require": { - "php": "^7.2" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Library for handling version information and constraints", - "time": "2020-05-09T21:27:55+00:00" - } - ], - "packages-dev": [], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": "^7.2", - "ext-dom": "*", - "ext-phar": "*", - "ext-xmlwriter": "*" - }, - "platform-dev": [] -} diff --git a/vendor/phar-io/manifest/src/ManifestDocumentMapper.php b/vendor/phar-io/manifest/src/ManifestDocumentMapper.php deleted file mode 100644 index 8e539d5f..00000000 --- a/vendor/phar-io/manifest/src/ManifestDocumentMapper.php +++ /dev/null @@ -1,150 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -use PharIo\Version\Exception as VersionException; -use PharIo\Version\Version; -use PharIo\Version\VersionConstraintParser; - -class ManifestDocumentMapper { - public function map(ManifestDocument $document): Manifest { - try { - $contains = $document->getContainsElement(); - $type = $this->mapType($contains); - $copyright = $this->mapCopyright($document->getCopyrightElement()); - $requirements = $this->mapRequirements($document->getRequiresElement()); - $bundledComponents = $this->mapBundledComponents($document); - - return new Manifest( - new ApplicationName($contains->getName()), - new Version($contains->getVersion()), - $type, - $copyright, - $requirements, - $bundledComponents - ); - } catch (VersionException $e) { - throw new ManifestDocumentMapperException($e->getMessage(), (int)$e->getCode(), $e); - } catch (Exception $e) { - throw new ManifestDocumentMapperException($e->getMessage(), (int)$e->getCode(), $e); - } - } - - private function mapType(ContainsElement $contains): Type { - switch ($contains->getType()) { - case 'application': - return Type::application(); - case 'library': - return Type::library(); - case 'extension': - return $this->mapExtension($contains->getExtensionElement()); - } - - throw new ManifestDocumentMapperException( - \sprintf('Unsupported type %s', $contains->getType()) - ); - } - - private function mapCopyright(CopyrightElement $copyright): CopyrightInformation { - $authors = new AuthorCollection(); - - foreach ($copyright->getAuthorElements() as $authorElement) { - $authors->add( - new Author( - $authorElement->getName(), - new Email($authorElement->getEmail()) - ) - ); - } - - $licenseElement = $copyright->getLicenseElement(); - $license = new License( - $licenseElement->getType(), - new Url($licenseElement->getUrl()) - ); - - return new CopyrightInformation( - $authors, - $license - ); - } - - private function mapRequirements(RequiresElement $requires): RequirementCollection { - $collection = new RequirementCollection(); - $phpElement = $requires->getPHPElement(); - $parser = new VersionConstraintParser; - - try { - $versionConstraint = $parser->parse($phpElement->getVersion()); - } catch (VersionException $e) { - throw new ManifestDocumentMapperException( - \sprintf('Unsupported version constraint - %s', $e->getMessage()), - (int)$e->getCode(), - $e - ); - } - - $collection->add( - new PhpVersionRequirement( - $versionConstraint - ) - ); - - if (!$phpElement->hasExtElements()) { - return $collection; - } - - foreach ($phpElement->getExtElements() as $extElement) { - $collection->add( - new PhpExtensionRequirement($extElement->getName()) - ); - } - - return $collection; - } - - private function mapBundledComponents(ManifestDocument $document): BundledComponentCollection { - $collection = new BundledComponentCollection(); - - if (!$document->hasBundlesElement()) { - return $collection; - } - - foreach ($document->getBundlesElement()->getComponentElements() as $componentElement) { - $collection->add( - new BundledComponent( - $componentElement->getName(), - new Version( - $componentElement->getVersion() - ) - ) - ); - } - - return $collection; - } - - private function mapExtension(ExtensionElement $extension): Extension { - try { - $versionConstraint = (new VersionConstraintParser)->parse($extension->getCompatible()); - - return Type::extension( - new ApplicationName($extension->getFor()), - $versionConstraint - ); - } catch (VersionException $e) { - throw new ManifestDocumentMapperException( - \sprintf('Unsupported version constraint - %s', $e->getMessage()), - (int)$e->getCode(), - $e - ); - } - } -} diff --git a/vendor/phar-io/manifest/src/ManifestLoader.php b/vendor/phar-io/manifest/src/ManifestLoader.php deleted file mode 100644 index ae884e49..00000000 --- a/vendor/phar-io/manifest/src/ManifestLoader.php +++ /dev/null @@ -1,44 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class ManifestLoader { - public static function fromFile(string $filename): Manifest { - try { - return (new ManifestDocumentMapper())->map( - ManifestDocument::fromFile($filename) - ); - } catch (Exception $e) { - throw new ManifestLoaderException( - \sprintf('Loading %s failed.', $filename), - (int)$e->getCode(), - $e - ); - } - } - - public static function fromPhar(string $filename): Manifest { - return self::fromFile('phar://' . $filename . '/manifest.xml'); - } - - public static function fromString(string $manifest): Manifest { - try { - return (new ManifestDocumentMapper())->map( - ManifestDocument::fromString($manifest) - ); - } catch (Exception $e) { - throw new ManifestLoaderException( - 'Processing string failed', - (int)$e->getCode(), - $e - ); - } - } -} diff --git a/vendor/phar-io/manifest/src/ManifestSerializer.php b/vendor/phar-io/manifest/src/ManifestSerializer.php deleted file mode 100644 index e236b598..00000000 --- a/vendor/phar-io/manifest/src/ManifestSerializer.php +++ /dev/null @@ -1,168 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -use PharIo\Version\AnyVersionConstraint; -use PharIo\Version\Version; -use PharIo\Version\VersionConstraint; -use XMLWriter; - -/** @psalm-suppress MissingConstructor */ -class ManifestSerializer { - /** @var XMLWriter */ - private $xmlWriter; - - public function serializeToFile(Manifest $manifest, string $filename): void { - \file_put_contents( - $filename, - $this->serializeToString($manifest) - ); - } - - public function serializeToString(Manifest $manifest): string { - $this->startDocument(); - - $this->addContains($manifest->getName(), $manifest->getVersion(), $manifest->getType()); - $this->addCopyright($manifest->getCopyrightInformation()); - $this->addRequirements($manifest->getRequirements()); - $this->addBundles($manifest->getBundledComponents()); - - return $this->finishDocument(); - } - - private function startDocument(): void { - $xmlWriter = new XMLWriter(); - $xmlWriter->openMemory(); - $xmlWriter->setIndent(true); - $xmlWriter->setIndentString(\str_repeat(' ', 4)); - $xmlWriter->startDocument('1.0', 'UTF-8'); - $xmlWriter->startElement('phar'); - $xmlWriter->writeAttribute('xmlns', 'https://phar.io/xml/manifest/1.0'); - - $this->xmlWriter = $xmlWriter; - } - - private function finishDocument(): string { - $this->xmlWriter->endElement(); - $this->xmlWriter->endDocument(); - - return $this->xmlWriter->outputMemory(); - } - - private function addContains(ApplicationName $name, Version $version, Type $type): void { - $this->xmlWriter->startElement('contains'); - $this->xmlWriter->writeAttribute('name', $name->asString()); - $this->xmlWriter->writeAttribute('version', $version->getVersionString()); - - switch (true) { - case $type->isApplication(): { - $this->xmlWriter->writeAttribute('type', 'application'); - - break; - } - - case $type->isLibrary(): { - $this->xmlWriter->writeAttribute('type', 'library'); - - break; - } - - case $type->isExtension(): { - $this->xmlWriter->writeAttribute('type', 'extension'); - /* @var $type Extension */ - $this->addExtension( - $type->getApplicationName(), - $type->getVersionConstraint() - ); - - break; - } - - default: { - $this->xmlWriter->writeAttribute('type', 'custom'); - } - } - - $this->xmlWriter->endElement(); - } - - private function addCopyright(CopyrightInformation $copyrightInformation): void { - $this->xmlWriter->startElement('copyright'); - - foreach ($copyrightInformation->getAuthors() as $author) { - $this->xmlWriter->startElement('author'); - $this->xmlWriter->writeAttribute('name', $author->getName()); - $this->xmlWriter->writeAttribute('email', $author->getEmail()->asString()); - $this->xmlWriter->endElement(); - } - - $license = $copyrightInformation->getLicense(); - - $this->xmlWriter->startElement('license'); - $this->xmlWriter->writeAttribute('type', $license->getName()); - $this->xmlWriter->writeAttribute('url', $license->getUrl()->asString()); - $this->xmlWriter->endElement(); - - $this->xmlWriter->endElement(); - } - - private function addRequirements(RequirementCollection $requirementCollection): void { - $phpRequirement = new AnyVersionConstraint(); - $extensions = []; - - foreach ($requirementCollection as $requirement) { - if ($requirement instanceof PhpVersionRequirement) { - $phpRequirement = $requirement->getVersionConstraint(); - - continue; - } - - if ($requirement instanceof PhpExtensionRequirement) { - $extensions[] = $requirement->asString(); - } - } - - $this->xmlWriter->startElement('requires'); - $this->xmlWriter->startElement('php'); - $this->xmlWriter->writeAttribute('version', $phpRequirement->asString()); - - foreach ($extensions as $extension) { - $this->xmlWriter->startElement('ext'); - $this->xmlWriter->writeAttribute('name', $extension); - $this->xmlWriter->endElement(); - } - - $this->xmlWriter->endElement(); - $this->xmlWriter->endElement(); - } - - private function addBundles(BundledComponentCollection $bundledComponentCollection): void { - if (\count($bundledComponentCollection) === 0) { - return; - } - $this->xmlWriter->startElement('bundles'); - - foreach ($bundledComponentCollection as $bundledComponent) { - $this->xmlWriter->startElement('component'); - $this->xmlWriter->writeAttribute('name', $bundledComponent->getName()); - $this->xmlWriter->writeAttribute('version', $bundledComponent->getVersion()->getVersionString()); - $this->xmlWriter->endElement(); - } - - $this->xmlWriter->endElement(); - } - - private function addExtension(ApplicationName $applicationName, VersionConstraint $versionConstraint): void { - $this->xmlWriter->startElement('extension'); - $this->xmlWriter->writeAttribute('for', $applicationName->asString()); - $this->xmlWriter->writeAttribute('compatible', $versionConstraint->asString()); - $this->xmlWriter->endElement(); - } -} diff --git a/vendor/phar-io/manifest/src/exceptions/ElementCollectionException.php b/vendor/phar-io/manifest/src/exceptions/ElementCollectionException.php deleted file mode 100644 index 766fc0e6..00000000 --- a/vendor/phar-io/manifest/src/exceptions/ElementCollectionException.php +++ /dev/null @@ -1,13 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class ElementCollectionException extends \InvalidArgumentException implements Exception { -} diff --git a/vendor/phar-io/manifest/src/exceptions/Exception.php b/vendor/phar-io/manifest/src/exceptions/Exception.php deleted file mode 100644 index e7f12209..00000000 --- a/vendor/phar-io/manifest/src/exceptions/Exception.php +++ /dev/null @@ -1,13 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -interface Exception extends \Throwable { -} diff --git a/vendor/phar-io/manifest/src/exceptions/InvalidApplicationNameException.php b/vendor/phar-io/manifest/src/exceptions/InvalidApplicationNameException.php deleted file mode 100644 index 952901eb..00000000 --- a/vendor/phar-io/manifest/src/exceptions/InvalidApplicationNameException.php +++ /dev/null @@ -1,14 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class InvalidApplicationNameException extends \InvalidArgumentException implements Exception { - public const InvalidFormat = 2; -} diff --git a/vendor/phar-io/manifest/src/exceptions/InvalidEmailException.php b/vendor/phar-io/manifest/src/exceptions/InvalidEmailException.php deleted file mode 100644 index 3cbe0822..00000000 --- a/vendor/phar-io/manifest/src/exceptions/InvalidEmailException.php +++ /dev/null @@ -1,13 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class InvalidEmailException extends \InvalidArgumentException implements Exception { -} diff --git a/vendor/phar-io/manifest/src/exceptions/InvalidUrlException.php b/vendor/phar-io/manifest/src/exceptions/InvalidUrlException.php deleted file mode 100644 index 8f77e294..00000000 --- a/vendor/phar-io/manifest/src/exceptions/InvalidUrlException.php +++ /dev/null @@ -1,13 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class InvalidUrlException extends \InvalidArgumentException implements Exception { -} diff --git a/vendor/phar-io/manifest/src/exceptions/ManifestDocumentException.php b/vendor/phar-io/manifest/src/exceptions/ManifestDocumentException.php deleted file mode 100644 index cf1c314c..00000000 --- a/vendor/phar-io/manifest/src/exceptions/ManifestDocumentException.php +++ /dev/null @@ -1,5 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -use LibXMLError; - -class ManifestDocumentLoadingException extends \Exception implements Exception { - /** @var LibXMLError[] */ - private $libxmlErrors; - - /** - * ManifestDocumentLoadingException constructor. - * - * @param LibXMLError[] $libxmlErrors - */ - public function __construct(array $libxmlErrors) { - $this->libxmlErrors = $libxmlErrors; - $first = $this->libxmlErrors[0]; - - parent::__construct( - \sprintf( - '%s (Line: %d / Column: %d / File: %s)', - $first->message, - $first->line, - $first->column, - $first->file - ), - $first->code - ); - } - - /** - * @return LibXMLError[] - */ - public function getLibxmlErrors(): array { - return $this->libxmlErrors; - } -} diff --git a/vendor/phar-io/manifest/src/exceptions/ManifestDocumentMapperException.php b/vendor/phar-io/manifest/src/exceptions/ManifestDocumentMapperException.php deleted file mode 100644 index 43373bd3..00000000 --- a/vendor/phar-io/manifest/src/exceptions/ManifestDocumentMapperException.php +++ /dev/null @@ -1,5 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class Application extends Type { - public function isApplication(): bool { - return true; - } -} diff --git a/vendor/phar-io/manifest/src/values/ApplicationName.php b/vendor/phar-io/manifest/src/values/ApplicationName.php deleted file mode 100644 index d71744ab..00000000 --- a/vendor/phar-io/manifest/src/values/ApplicationName.php +++ /dev/null @@ -1,37 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class ApplicationName { - /** @var string */ - private $name; - - public function __construct(string $name) { - $this->ensureValidFormat($name); - $this->name = $name; - } - - public function asString(): string { - return $this->name; - } - - public function isEqual(ApplicationName $name): bool { - return $this->name === $name->name; - } - - private function ensureValidFormat(string $name): void { - if (!\preg_match('#\w/\w#', $name)) { - throw new InvalidApplicationNameException( - \sprintf('Format of name "%s" is not valid - expected: vendor/packagename', $name), - InvalidApplicationNameException::InvalidFormat - ); - } - } -} diff --git a/vendor/phar-io/manifest/src/values/Author.php b/vendor/phar-io/manifest/src/values/Author.php deleted file mode 100644 index 82b666e7..00000000 --- a/vendor/phar-io/manifest/src/values/Author.php +++ /dev/null @@ -1,39 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class Author { - /** @var string */ - private $name; - - /** @var Email */ - private $email; - - public function __construct(string $name, Email $email) { - $this->name = $name; - $this->email = $email; - } - - public function asString(): string { - return \sprintf( - '%s <%s>', - $this->name, - $this->email->asString() - ); - } - - public function getName(): string { - return $this->name; - } - - public function getEmail(): Email { - return $this->email; - } -} diff --git a/vendor/phar-io/manifest/src/values/AuthorCollection.php b/vendor/phar-io/manifest/src/values/AuthorCollection.php deleted file mode 100644 index 27e50ad8..00000000 --- a/vendor/phar-io/manifest/src/values/AuthorCollection.php +++ /dev/null @@ -1,34 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class AuthorCollection implements \Countable, \IteratorAggregate { - /** @var Author[] */ - private $authors = []; - - public function add(Author $author): void { - $this->authors[] = $author; - } - - /** - * @return Author[] - */ - public function getAuthors(): array { - return $this->authors; - } - - public function count(): int { - return \count($this->authors); - } - - public function getIterator(): AuthorCollectionIterator { - return new AuthorCollectionIterator($this); - } -} diff --git a/vendor/phar-io/manifest/src/values/AuthorCollectionIterator.php b/vendor/phar-io/manifest/src/values/AuthorCollectionIterator.php deleted file mode 100644 index 4ff3c394..00000000 --- a/vendor/phar-io/manifest/src/values/AuthorCollectionIterator.php +++ /dev/null @@ -1,42 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class AuthorCollectionIterator implements \Iterator { - /** @var Author[] */ - private $authors; - - /** @var int */ - private $position = 0; - - public function __construct(AuthorCollection $authors) { - $this->authors = $authors->getAuthors(); - } - - public function rewind(): void { - $this->position = 0; - } - - public function valid(): bool { - return $this->position < \count($this->authors); - } - - public function key(): int { - return $this->position; - } - - public function current(): Author { - return $this->authors[$this->position]; - } - - public function next(): void { - $this->position++; - } -} diff --git a/vendor/phar-io/manifest/src/values/BundledComponent.php b/vendor/phar-io/manifest/src/values/BundledComponent.php deleted file mode 100644 index ea77b440..00000000 --- a/vendor/phar-io/manifest/src/values/BundledComponent.php +++ /dev/null @@ -1,33 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -use PharIo\Version\Version; - -class BundledComponent { - /** @var string */ - private $name; - - /** @var Version */ - private $version; - - public function __construct(string $name, Version $version) { - $this->name = $name; - $this->version = $version; - } - - public function getName(): string { - return $this->name; - } - - public function getVersion(): Version { - return $this->version; - } -} diff --git a/vendor/phar-io/manifest/src/values/BundledComponentCollection.php b/vendor/phar-io/manifest/src/values/BundledComponentCollection.php deleted file mode 100644 index b628eaa3..00000000 --- a/vendor/phar-io/manifest/src/values/BundledComponentCollection.php +++ /dev/null @@ -1,34 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class BundledComponentCollection implements \Countable, \IteratorAggregate { - /** @var BundledComponent[] */ - private $bundledComponents = []; - - public function add(BundledComponent $bundledComponent): void { - $this->bundledComponents[] = $bundledComponent; - } - - /** - * @return BundledComponent[] - */ - public function getBundledComponents(): array { - return $this->bundledComponents; - } - - public function count(): int { - return \count($this->bundledComponents); - } - - public function getIterator(): BundledComponentCollectionIterator { - return new BundledComponentCollectionIterator($this); - } -} diff --git a/vendor/phar-io/manifest/src/values/BundledComponentCollectionIterator.php b/vendor/phar-io/manifest/src/values/BundledComponentCollectionIterator.php deleted file mode 100644 index 462db45a..00000000 --- a/vendor/phar-io/manifest/src/values/BundledComponentCollectionIterator.php +++ /dev/null @@ -1,42 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class BundledComponentCollectionIterator implements \Iterator { - /** @var BundledComponent[] */ - private $bundledComponents; - - /** @var int */ - private $position = 0; - - public function __construct(BundledComponentCollection $bundledComponents) { - $this->bundledComponents = $bundledComponents->getBundledComponents(); - } - - public function rewind(): void { - $this->position = 0; - } - - public function valid(): bool { - return $this->position < \count($this->bundledComponents); - } - - public function key(): int { - return $this->position; - } - - public function current(): BundledComponent { - return $this->bundledComponents[$this->position]; - } - - public function next(): void { - $this->position++; - } -} diff --git a/vendor/phar-io/manifest/src/values/CopyrightInformation.php b/vendor/phar-io/manifest/src/values/CopyrightInformation.php deleted file mode 100644 index d26f9472..00000000 --- a/vendor/phar-io/manifest/src/values/CopyrightInformation.php +++ /dev/null @@ -1,31 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class CopyrightInformation { - /** @var AuthorCollection */ - private $authors; - - /** @var License */ - private $license; - - public function __construct(AuthorCollection $authors, License $license) { - $this->authors = $authors; - $this->license = $license; - } - - public function getAuthors(): AuthorCollection { - return $this->authors; - } - - public function getLicense(): License { - return $this->license; - } -} diff --git a/vendor/phar-io/manifest/src/values/Email.php b/vendor/phar-io/manifest/src/values/Email.php deleted file mode 100644 index 588348d8..00000000 --- a/vendor/phar-io/manifest/src/values/Email.php +++ /dev/null @@ -1,31 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class Email { - /** @var string */ - private $email; - - public function __construct(string $email) { - $this->ensureEmailIsValid($email); - - $this->email = $email; - } - - public function asString(): string { - return $this->email; - } - - private function ensureEmailIsValid(string $url): void { - if (\filter_var($url, \FILTER_VALIDATE_EMAIL) === false) { - throw new InvalidEmailException; - } - } -} diff --git a/vendor/phar-io/manifest/src/values/Extension.php b/vendor/phar-io/manifest/src/values/Extension.php deleted file mode 100644 index 4c5726f8..00000000 --- a/vendor/phar-io/manifest/src/values/Extension.php +++ /dev/null @@ -1,46 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -use PharIo\Version\Version; -use PharIo\Version\VersionConstraint; - -class Extension extends Type { - /** @var ApplicationName */ - private $application; - - /** @var VersionConstraint */ - private $versionConstraint; - - public function __construct(ApplicationName $application, VersionConstraint $versionConstraint) { - $this->application = $application; - $this->versionConstraint = $versionConstraint; - } - - public function getApplicationName(): ApplicationName { - return $this->application; - } - - public function getVersionConstraint(): VersionConstraint { - return $this->versionConstraint; - } - - public function isExtension(): bool { - return true; - } - - public function isExtensionFor(ApplicationName $name): bool { - return $this->application->isEqual($name); - } - - public function isCompatibleWith(ApplicationName $name, Version $version): bool { - return $this->isExtensionFor($name) && $this->versionConstraint->complies($version); - } -} diff --git a/vendor/phar-io/manifest/src/values/Library.php b/vendor/phar-io/manifest/src/values/Library.php deleted file mode 100644 index 21849e13..00000000 --- a/vendor/phar-io/manifest/src/values/Library.php +++ /dev/null @@ -1,16 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class Library extends Type { - public function isLibrary(): bool { - return true; - } -} diff --git a/vendor/phar-io/manifest/src/values/License.php b/vendor/phar-io/manifest/src/values/License.php deleted file mode 100644 index 39542fe8..00000000 --- a/vendor/phar-io/manifest/src/values/License.php +++ /dev/null @@ -1,31 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class License { - /** @var string */ - private $name; - - /** @var Url */ - private $url; - - public function __construct(string $name, Url $url) { - $this->name = $name; - $this->url = $url; - } - - public function getName(): string { - return $this->name; - } - - public function getUrl(): Url { - return $this->url; - } -} diff --git a/vendor/phar-io/manifest/src/values/Manifest.php b/vendor/phar-io/manifest/src/values/Manifest.php deleted file mode 100644 index 0140b842..00000000 --- a/vendor/phar-io/manifest/src/values/Manifest.php +++ /dev/null @@ -1,92 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -use PharIo\Version\Version; - -class Manifest { - /** @var ApplicationName */ - private $name; - - /** @var Version */ - private $version; - - /** @var Type */ - private $type; - - /** @var CopyrightInformation */ - private $copyrightInformation; - - /** @var RequirementCollection */ - private $requirements; - - /** @var BundledComponentCollection */ - private $bundledComponents; - - public function __construct(ApplicationName $name, Version $version, Type $type, CopyrightInformation $copyrightInformation, RequirementCollection $requirements, BundledComponentCollection $bundledComponents) { - $this->name = $name; - $this->version = $version; - $this->type = $type; - $this->copyrightInformation = $copyrightInformation; - $this->requirements = $requirements; - $this->bundledComponents = $bundledComponents; - } - - public function getName(): ApplicationName { - return $this->name; - } - - public function getVersion(): Version { - return $this->version; - } - - public function getType(): Type { - return $this->type; - } - - public function getCopyrightInformation(): CopyrightInformation { - return $this->copyrightInformation; - } - - public function getRequirements(): RequirementCollection { - return $this->requirements; - } - - public function getBundledComponents(): BundledComponentCollection { - return $this->bundledComponents; - } - - public function isApplication(): bool { - return $this->type->isApplication(); - } - - public function isLibrary(): bool { - return $this->type->isLibrary(); - } - - public function isExtension(): bool { - return $this->type->isExtension(); - } - - public function isExtensionFor(ApplicationName $application, Version $version = null): bool { - if (!$this->isExtension()) { - return false; - } - - /** @var Extension $type */ - $type = $this->type; - - if ($version !== null) { - return $type->isCompatibleWith($application, $version); - } - - return $type->isExtensionFor($application); - } -} diff --git a/vendor/phar-io/manifest/src/values/PhpExtensionRequirement.php b/vendor/phar-io/manifest/src/values/PhpExtensionRequirement.php deleted file mode 100644 index 088f3858..00000000 --- a/vendor/phar-io/manifest/src/values/PhpExtensionRequirement.php +++ /dev/null @@ -1,23 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class PhpExtensionRequirement implements Requirement { - /** @var string */ - private $extension; - - public function __construct(string $extension) { - $this->extension = $extension; - } - - public function asString(): string { - return $this->extension; - } -} diff --git a/vendor/phar-io/manifest/src/values/PhpVersionRequirement.php b/vendor/phar-io/manifest/src/values/PhpVersionRequirement.php deleted file mode 100644 index f8d6f6d1..00000000 --- a/vendor/phar-io/manifest/src/values/PhpVersionRequirement.php +++ /dev/null @@ -1,25 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -use PharIo\Version\VersionConstraint; - -class PhpVersionRequirement implements Requirement { - /** @var VersionConstraint */ - private $versionConstraint; - - public function __construct(VersionConstraint $versionConstraint) { - $this->versionConstraint = $versionConstraint; - } - - public function getVersionConstraint(): VersionConstraint { - return $this->versionConstraint; - } -} diff --git a/vendor/phar-io/manifest/src/values/Requirement.php b/vendor/phar-io/manifest/src/values/Requirement.php deleted file mode 100644 index 8b845d6a..00000000 --- a/vendor/phar-io/manifest/src/values/Requirement.php +++ /dev/null @@ -1,13 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -interface Requirement { -} diff --git a/vendor/phar-io/manifest/src/values/RequirementCollection.php b/vendor/phar-io/manifest/src/values/RequirementCollection.php deleted file mode 100644 index b82cd955..00000000 --- a/vendor/phar-io/manifest/src/values/RequirementCollection.php +++ /dev/null @@ -1,34 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class RequirementCollection implements \Countable, \IteratorAggregate { - /** @var Requirement[] */ - private $requirements = []; - - public function add(Requirement $requirement): void { - $this->requirements[] = $requirement; - } - - /** - * @return Requirement[] - */ - public function getRequirements(): array { - return $this->requirements; - } - - public function count(): int { - return \count($this->requirements); - } - - public function getIterator(): RequirementCollectionIterator { - return new RequirementCollectionIterator($this); - } -} diff --git a/vendor/phar-io/manifest/src/values/RequirementCollectionIterator.php b/vendor/phar-io/manifest/src/values/RequirementCollectionIterator.php deleted file mode 100644 index 5614eaf7..00000000 --- a/vendor/phar-io/manifest/src/values/RequirementCollectionIterator.php +++ /dev/null @@ -1,42 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class RequirementCollectionIterator implements \Iterator { - /** @var Requirement[] */ - private $requirements; - - /** @var int */ - private $position = 0; - - public function __construct(RequirementCollection $requirements) { - $this->requirements = $requirements->getRequirements(); - } - - public function rewind(): void { - $this->position = 0; - } - - public function valid(): bool { - return $this->position < \count($this->requirements); - } - - public function key(): int { - return $this->position; - } - - public function current(): Requirement { - return $this->requirements[$this->position]; - } - - public function next(): void { - $this->position++; - } -} diff --git a/vendor/phar-io/manifest/src/values/Type.php b/vendor/phar-io/manifest/src/values/Type.php deleted file mode 100644 index 23b28980..00000000 --- a/vendor/phar-io/manifest/src/values/Type.php +++ /dev/null @@ -1,41 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -use PharIo\Version\VersionConstraint; - -abstract class Type { - public static function application(): Application { - return new Application; - } - - public static function library(): Library { - return new Library; - } - - public static function extension(ApplicationName $application, VersionConstraint $versionConstraint): Extension { - return new Extension($application, $versionConstraint); - } - - /** @psalm-assert-if-true Application $this */ - public function isApplication(): bool { - return false; - } - - /** @psalm-assert-if-true Library $this */ - public function isLibrary(): bool { - return false; - } - - /** @psalm-assert-if-true Extension $this */ - public function isExtension(): bool { - return false; - } -} diff --git a/vendor/phar-io/manifest/src/values/Url.php b/vendor/phar-io/manifest/src/values/Url.php deleted file mode 100644 index 63952533..00000000 --- a/vendor/phar-io/manifest/src/values/Url.php +++ /dev/null @@ -1,36 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class Url { - /** @var string */ - private $url; - - public function __construct(string $url) { - $this->ensureUrlIsValid($url); - - $this->url = $url; - } - - public function asString(): string { - return $this->url; - } - - /** - * @param string $url - * - * @throws InvalidUrlException - */ - private function ensureUrlIsValid($url): void { - if (\filter_var($url, \FILTER_VALIDATE_URL) === false) { - throw new InvalidUrlException; - } - } -} diff --git a/vendor/phar-io/manifest/src/xml/AuthorElement.php b/vendor/phar-io/manifest/src/xml/AuthorElement.php deleted file mode 100644 index c454b271..00000000 --- a/vendor/phar-io/manifest/src/xml/AuthorElement.php +++ /dev/null @@ -1,20 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class AuthorElement extends ManifestElement { - public function getName(): string { - return $this->getAttributeValue('name'); - } - - public function getEmail(): string { - return $this->getAttributeValue('email'); - } -} diff --git a/vendor/phar-io/manifest/src/xml/AuthorElementCollection.php b/vendor/phar-io/manifest/src/xml/AuthorElementCollection.php deleted file mode 100644 index a54147eb..00000000 --- a/vendor/phar-io/manifest/src/xml/AuthorElementCollection.php +++ /dev/null @@ -1,18 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class AuthorElementCollection extends ElementCollection { - public function current(): AuthorElement { - return new AuthorElement( - $this->getCurrentElement() - ); - } -} diff --git a/vendor/phar-io/manifest/src/xml/BundlesElement.php b/vendor/phar-io/manifest/src/xml/BundlesElement.php deleted file mode 100644 index eb2105ac..00000000 --- a/vendor/phar-io/manifest/src/xml/BundlesElement.php +++ /dev/null @@ -1,18 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class BundlesElement extends ManifestElement { - public function getComponentElements(): ComponentElementCollection { - return new ComponentElementCollection( - $this->getChildrenByName('component') - ); - } -} diff --git a/vendor/phar-io/manifest/src/xml/ComponentElement.php b/vendor/phar-io/manifest/src/xml/ComponentElement.php deleted file mode 100644 index 7f6a5ec9..00000000 --- a/vendor/phar-io/manifest/src/xml/ComponentElement.php +++ /dev/null @@ -1,20 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class ComponentElement extends ManifestElement { - public function getName(): string { - return $this->getAttributeValue('name'); - } - - public function getVersion(): string { - return $this->getAttributeValue('version'); - } -} diff --git a/vendor/phar-io/manifest/src/xml/ComponentElementCollection.php b/vendor/phar-io/manifest/src/xml/ComponentElementCollection.php deleted file mode 100644 index 23bcbd2f..00000000 --- a/vendor/phar-io/manifest/src/xml/ComponentElementCollection.php +++ /dev/null @@ -1,18 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class ComponentElementCollection extends ElementCollection { - public function current(): ComponentElement { - return new ComponentElement( - $this->getCurrentElement() - ); - } -} diff --git a/vendor/phar-io/manifest/src/xml/ContainsElement.php b/vendor/phar-io/manifest/src/xml/ContainsElement.php deleted file mode 100644 index ebef49d9..00000000 --- a/vendor/phar-io/manifest/src/xml/ContainsElement.php +++ /dev/null @@ -1,30 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class ContainsElement extends ManifestElement { - public function getName(): string { - return $this->getAttributeValue('name'); - } - - public function getVersion(): string { - return $this->getAttributeValue('version'); - } - - public function getType(): string { - return $this->getAttributeValue('type'); - } - - public function getExtensionElement(): ExtensionElement { - return new ExtensionElement( - $this->getChildByName('extension') - ); - } -} diff --git a/vendor/phar-io/manifest/src/xml/CopyrightElement.php b/vendor/phar-io/manifest/src/xml/CopyrightElement.php deleted file mode 100644 index 3debe7dc..00000000 --- a/vendor/phar-io/manifest/src/xml/CopyrightElement.php +++ /dev/null @@ -1,24 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class CopyrightElement extends ManifestElement { - public function getAuthorElements(): AuthorElementCollection { - return new AuthorElementCollection( - $this->getChildrenByName('author') - ); - } - - public function getLicenseElement(): LicenseElement { - return new LicenseElement( - $this->getChildByName('license') - ); - } -} diff --git a/vendor/phar-io/manifest/src/xml/ElementCollection.php b/vendor/phar-io/manifest/src/xml/ElementCollection.php deleted file mode 100644 index 26d9250f..00000000 --- a/vendor/phar-io/manifest/src/xml/ElementCollection.php +++ /dev/null @@ -1,61 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -use DOMElement; -use DOMNodeList; - -abstract class ElementCollection implements \Iterator { - /** @var DOMElement[] */ - private $nodes = []; - - /** @var int */ - private $position; - - public function __construct(DOMNodeList $nodeList) { - $this->position = 0; - $this->importNodes($nodeList); - } - - #[\ReturnTypeWillChange] - abstract public function current(); - - public function next(): void { - $this->position++; - } - - public function key(): int { - return $this->position; - } - - public function valid(): bool { - return $this->position < \count($this->nodes); - } - - public function rewind(): void { - $this->position = 0; - } - - protected function getCurrentElement(): DOMElement { - return $this->nodes[$this->position]; - } - - private function importNodes(DOMNodeList $nodeList): void { - foreach ($nodeList as $node) { - if (!$node instanceof DOMElement) { - throw new ElementCollectionException( - \sprintf('\DOMElement expected, got \%s', \get_class($node)) - ); - } - - $this->nodes[] = $node; - } - } -} diff --git a/vendor/phar-io/manifest/src/xml/ExtElement.php b/vendor/phar-io/manifest/src/xml/ExtElement.php deleted file mode 100644 index 257853c4..00000000 --- a/vendor/phar-io/manifest/src/xml/ExtElement.php +++ /dev/null @@ -1,16 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class ExtElement extends ManifestElement { - public function getName(): string { - return $this->getAttributeValue('name'); - } -} diff --git a/vendor/phar-io/manifest/src/xml/ExtElementCollection.php b/vendor/phar-io/manifest/src/xml/ExtElementCollection.php deleted file mode 100644 index 05977349..00000000 --- a/vendor/phar-io/manifest/src/xml/ExtElementCollection.php +++ /dev/null @@ -1,18 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class ExtElementCollection extends ElementCollection { - public function current(): ExtElement { - return new ExtElement( - $this->getCurrentElement() - ); - } -} diff --git a/vendor/phar-io/manifest/src/xml/ExtensionElement.php b/vendor/phar-io/manifest/src/xml/ExtensionElement.php deleted file mode 100644 index db067f99..00000000 --- a/vendor/phar-io/manifest/src/xml/ExtensionElement.php +++ /dev/null @@ -1,20 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class ExtensionElement extends ManifestElement { - public function getFor(): string { - return $this->getAttributeValue('for'); - } - - public function getCompatible(): string { - return $this->getAttributeValue('compatible'); - } -} diff --git a/vendor/phar-io/manifest/src/xml/LicenseElement.php b/vendor/phar-io/manifest/src/xml/LicenseElement.php deleted file mode 100644 index 658c3d1c..00000000 --- a/vendor/phar-io/manifest/src/xml/LicenseElement.php +++ /dev/null @@ -1,20 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class LicenseElement extends ManifestElement { - public function getType(): string { - return $this->getAttributeValue('type'); - } - - public function getUrl(): string { - return $this->getAttributeValue('url'); - } -} diff --git a/vendor/phar-io/manifest/src/xml/ManifestDocument.php b/vendor/phar-io/manifest/src/xml/ManifestDocument.php deleted file mode 100644 index f88b2829..00000000 --- a/vendor/phar-io/manifest/src/xml/ManifestDocument.php +++ /dev/null @@ -1,103 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -use DOMDocument; -use DOMElement; - -class ManifestDocument { - public const XMLNS = 'https://phar.io/xml/manifest/1.0'; - - /** @var DOMDocument */ - private $dom; - - public static function fromFile(string $filename): ManifestDocument { - if (!\file_exists($filename)) { - throw new ManifestDocumentException( - \sprintf('File "%s" not found', $filename) - ); - } - - return self::fromString( - \file_get_contents($filename) - ); - } - - public static function fromString(string $xmlString): ManifestDocument { - $prev = \libxml_use_internal_errors(true); - \libxml_clear_errors(); - - $dom = new DOMDocument(); - $dom->loadXML($xmlString); - - $errors = \libxml_get_errors(); - \libxml_use_internal_errors($prev); - - if (\count($errors) !== 0) { - throw new ManifestDocumentLoadingException($errors); - } - - return new self($dom); - } - - private function __construct(DOMDocument $dom) { - $this->ensureCorrectDocumentType($dom); - - $this->dom = $dom; - } - - public function getContainsElement(): ContainsElement { - return new ContainsElement( - $this->fetchElementByName('contains') - ); - } - - public function getCopyrightElement(): CopyrightElement { - return new CopyrightElement( - $this->fetchElementByName('copyright') - ); - } - - public function getRequiresElement(): RequiresElement { - return new RequiresElement( - $this->fetchElementByName('requires') - ); - } - - public function hasBundlesElement(): bool { - return $this->dom->getElementsByTagNameNS(self::XMLNS, 'bundles')->length === 1; - } - - public function getBundlesElement(): BundlesElement { - return new BundlesElement( - $this->fetchElementByName('bundles') - ); - } - - private function ensureCorrectDocumentType(DOMDocument $dom): void { - $root = $dom->documentElement; - - if ($root->localName !== 'phar' || $root->namespaceURI !== self::XMLNS) { - throw new ManifestDocumentException('Not a phar.io manifest document'); - } - } - - private function fetchElementByName(string $elementName): DOMElement { - $element = $this->dom->getElementsByTagNameNS(self::XMLNS, $elementName)->item(0); - - if (!$element instanceof DOMElement) { - throw new ManifestDocumentException( - \sprintf('Element %s missing', $elementName) - ); - } - - return $element; - } -} diff --git a/vendor/phar-io/manifest/src/xml/ManifestElement.php b/vendor/phar-io/manifest/src/xml/ManifestElement.php deleted file mode 100644 index 1f57f547..00000000 --- a/vendor/phar-io/manifest/src/xml/ManifestElement.php +++ /dev/null @@ -1,66 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -use DOMElement; -use DOMNodeList; - -class ManifestElement { - public const XMLNS = 'https://phar.io/xml/manifest/1.0'; - - /** @var DOMElement */ - private $element; - - public function __construct(DOMElement $element) { - $this->element = $element; - } - - protected function getAttributeValue(string $name): string { - if (!$this->element->hasAttribute($name)) { - throw new ManifestElementException( - \sprintf( - 'Attribute %s not set on element %s', - $name, - $this->element->localName - ) - ); - } - - return $this->element->getAttribute($name); - } - - protected function getChildByName(string $elementName): DOMElement { - $element = $this->element->getElementsByTagNameNS(self::XMLNS, $elementName)->item(0); - - if (!$element instanceof DOMElement) { - throw new ManifestElementException( - \sprintf('Element %s missing', $elementName) - ); - } - - return $element; - } - - protected function getChildrenByName(string $elementName): DOMNodeList { - $elementList = $this->element->getElementsByTagNameNS(self::XMLNS, $elementName); - - if ($elementList->length === 0) { - throw new ManifestElementException( - \sprintf('Element(s) %s missing', $elementName) - ); - } - - return $elementList; - } - - protected function hasChild(string $elementName): bool { - return $this->element->getElementsByTagNameNS(self::XMLNS, $elementName)->length !== 0; - } -} diff --git a/vendor/phar-io/manifest/src/xml/PhpElement.php b/vendor/phar-io/manifest/src/xml/PhpElement.php deleted file mode 100644 index c5c906c9..00000000 --- a/vendor/phar-io/manifest/src/xml/PhpElement.php +++ /dev/null @@ -1,26 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class PhpElement extends ManifestElement { - public function getVersion(): string { - return $this->getAttributeValue('version'); - } - - public function hasExtElements(): bool { - return $this->hasChild('ext'); - } - - public function getExtElements(): ExtElementCollection { - return new ExtElementCollection( - $this->getChildrenByName('ext') - ); - } -} diff --git a/vendor/phar-io/manifest/src/xml/RequiresElement.php b/vendor/phar-io/manifest/src/xml/RequiresElement.php deleted file mode 100644 index b7cd41ef..00000000 --- a/vendor/phar-io/manifest/src/xml/RequiresElement.php +++ /dev/null @@ -1,18 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Manifest; - -class RequiresElement extends ManifestElement { - public function getPHPElement(): PhpElement { - return new PhpElement( - $this->getChildByName('php') - ); - } -} diff --git a/vendor/phar-io/version/CHANGELOG.md b/vendor/phar-io/version/CHANGELOG.md deleted file mode 100644 index 4c0edfa7..00000000 --- a/vendor/phar-io/version/CHANGELOG.md +++ /dev/null @@ -1,142 +0,0 @@ -# Changelog - -All notable changes to phar-io/version are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. - -## [3.2.1] - 2022-02-21 - -### Fixed - -- Have ExactVersionConstraint honor build metadata (added in 3.2.0) - - -## [3.2.0] - 2022-02-21 - -### Added - -- Build metadata is now supported and considered for equality checks only - - -## [3.1.1] - 2022-02-07 - -### Fixed - -- [#28](https://github.com/phar-io/version/issues/28): `VersionConstraintParser` does not support logical OR represented by single pipe (|) (Thanks @llaville) - - -## [3.1.0] - 2021-02-23 - -### Changed - -- Internal Refactoring -- More scalar types - -### Added - -- [#24](https://github.com/phar-io/version/issues/24): `Version::getOriginalString()` added (Thanks @addshore) -- Version constraints using the caret operator (`^`) now honor pre-1.0 releases, e.g. `^0.3` translates to `0.3.*`) -- Various integration tests for version constraint processing - -### Fixed - -- [#23](https://github.com/phar-io/version/pull/23): Tilde operator without patch level - - - -## [3.0.4] - 14.12.2020 - -### Fixed - -- [#22](https://github.com/phar-io/version/pull/22): make dev suffix rank works for uppercase too - -## [3.0.3] - 30.11.2020 - -### Added - -- Comparator method `Version::equals()` added - - -## [3.0.2] - 27.06.2020 - -This release now supports PHP 7.2+ and PHP ^8.0. No other changes included. - - -## [3.0.1] - 09.05.2020 - -__Potential BC Break Notice:__ -`Version::getVersionString()` no longer returns `v` prefixes in case the "input" -string contained one. These are not part of the semver specs -(see https://semver.org/#is-v123-a-semantic-version) and get stripped out. -As of Version 3.1.0 `Version::getOriginalString()` can be used to still -retrieve it as given. - -### Changed - -- Internal Refactoring -- More scalar types - -### Fixed - -- Fixed Constraint processing Regression for ^1.2 and ~1.2 - - -## [3.0.0] - 05.05.2020 - -### Changed - -- Require PHP 7.2+ -- All code now uses strict mode -- Scalar types have been added as needed - -### Added - -- The technically invalid format using 'v' prefix ("v1.2.3") is now properly supported - - -## [2.0.1] - 08.07.2018 - -### Fixed - -- Versions without a pre-release suffix are now always considered greater -than versions with a pre-release suffix. Example: `3.0.0 > 3.0.0-alpha.1` - - -## [2.0.0] - 23.06.2018 - -Changes to public API: - -- `PreReleaseSuffix::construct()`: optional parameter `$number` removed -- `PreReleaseSuffix::isGreaterThan()`: introduced -- `Version::hasPreReleaseSuffix()`: introduced - -### Added - -- [#11](https://github.com/phar-io/version/issues/11): Added support for pre-release version suffixes. Supported values are: - - `dev` - - `beta` (also abbreviated form `b`) - - `rc` - - `alpha` (also abbreviated form `a`) - - `patch` (also abbreviated form `p`) - - All values can be followed by a number, e.g. `beta3`. - - When comparing versions, the pre-release suffix is taken into account. Example: -`1.5.0 > 1.5.0-beta1 > 1.5.0-alpha3 > 1.5.0-alpha2 > 1.5.0-dev11` - -### Changed - -- reorganized the source directories - -### Fixed - -- [#10](https://github.com/phar-io/version/issues/10): Version numbers containing -a numeric suffix as seen in Debian packages are now supported. - - -[3.1.0]: https://github.com/phar-io/version/compare/3.0.4...3.1.0 -[3.0.4]: https://github.com/phar-io/version/compare/3.0.3...3.0.4 -[3.0.3]: https://github.com/phar-io/version/compare/3.0.2...3.0.3 -[3.0.2]: https://github.com/phar-io/version/compare/3.0.1...3.0.2 -[3.0.1]: https://github.com/phar-io/version/compare/3.0.0...3.0.1 -[3.0.0]: https://github.com/phar-io/version/compare/2.0.1...3.0.0 -[2.0.1]: https://github.com/phar-io/version/compare/2.0.0...2.0.1 -[2.0.0]: https://github.com/phar-io/version/compare/1.0.1...2.0.0 diff --git a/vendor/phar-io/version/LICENSE b/vendor/phar-io/version/LICENSE deleted file mode 100644 index ce32758a..00000000 --- a/vendor/phar-io/version/LICENSE +++ /dev/null @@ -1,29 +0,0 @@ -Copyright (c) 2016-2017 Arne Blankerts , Sebastian Heuer and contributors -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 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 HOLDER 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/phar-io/version/README.md b/vendor/phar-io/version/README.md deleted file mode 100644 index 76e6e985..00000000 --- a/vendor/phar-io/version/README.md +++ /dev/null @@ -1,61 +0,0 @@ -# Version - -Library for handling version information and constraints - -[![Build Status](https://travis-ci.org/phar-io/version.svg?branch=master)](https://travis-ci.org/phar-io/version) - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - - composer require phar-io/version - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - - composer require --dev phar-io/version - -## Version constraints - -A Version constraint describes a range of versions or a discrete version number. The format of version numbers follows the schema of [semantic versioning](http://semver.org): `..`. A constraint might contain an operator that describes the range. - -Beside the typical mathematical operators like `<=`, `>=`, there are two special operators: - -*Caret operator*: `^1.0` -can be written as `>=1.0.0 <2.0.0` and read as »every Version within major version `1`«. - -*Tilde operator*: `~1.0.0` -can be written as `>=1.0.0 <1.1.0` and read as »every version within minor version `1.1`. The behavior of tilde operator depends on whether a patch level version is provided or not. If no patch level is provided, tilde operator behaves like the caret operator: `~1.0` is identical to `^1.0`. - -## Usage examples - -Parsing version constraints and check discrete versions for compliance: - -```php - -use PharIo\Version\Version; -use PharIo\Version\VersionConstraintParser; - -$parser = new VersionConstraintParser(); -$caret_constraint = $parser->parse( '^7.0' ); - -$caret_constraint->complies( new Version( '7.0.17' ) ); // true -$caret_constraint->complies( new Version( '7.1.0' ) ); // true -$caret_constraint->complies( new Version( '6.4.34' ) ); // false - -$tilde_constraint = $parser->parse( '~1.1.0' ); - -$tilde_constraint->complies( new Version( '1.1.4' ) ); // true -$tilde_constraint->complies( new Version( '1.2.0' ) ); // false -``` - -As of version 2.0.0, pre-release labels are supported and taken into account when comparing versions: - -```php - -$leftVersion = new PharIo\Version\Version('3.0.0-alpha.1'); -$rightVersion = new PharIo\Version\Version('3.0.0-alpha.2'); - -$leftVersion->isGreaterThan($rightVersion); // false -$rightVersion->isGreaterThan($leftVersion); // true - -``` diff --git a/vendor/phar-io/version/composer.json b/vendor/phar-io/version/composer.json deleted file mode 100644 index 22687dcd..00000000 --- a/vendor/phar-io/version/composer.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "phar-io/version", - "description": "Library for handling version information and constraints", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "support": { - "issues": "https://github.com/phar-io/version/issues" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "autoload": { - "classmap": [ - "src/" - ] - } -} - diff --git a/vendor/phar-io/version/src/BuildMetaData.php b/vendor/phar-io/version/src/BuildMetaData.php deleted file mode 100644 index d42f0363..00000000 --- a/vendor/phar-io/version/src/BuildMetaData.php +++ /dev/null @@ -1,28 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -class BuildMetaData { - - /** @var string */ - private $value; - - public function __construct(string $value) { - $this->value = $value; - } - - public function asString(): string { - return $this->value; - } - - public function equals(BuildMetaData $other): bool { - return $this->asString() === $other->asString(); - } -} diff --git a/vendor/phar-io/version/src/PreReleaseSuffix.php b/vendor/phar-io/version/src/PreReleaseSuffix.php deleted file mode 100644 index 00563008..00000000 --- a/vendor/phar-io/version/src/PreReleaseSuffix.php +++ /dev/null @@ -1,82 +0,0 @@ - 0, - 'a' => 1, - 'alpha' => 1, - 'b' => 2, - 'beta' => 2, - 'rc' => 3, - 'p' => 4, - 'pl' => 4, - 'patch' => 4, - ]; - - /** @var string */ - private $value; - - /** @var int */ - private $valueScore; - - /** @var int */ - private $number = 0; - - /** @var string */ - private $full; - - /** - * @throws InvalidPreReleaseSuffixException - */ - public function __construct(string $value) { - $this->parseValue($value); - } - - public function asString(): string { - return $this->full; - } - - public function getValue(): string { - return $this->value; - } - - public function getNumber(): ?int { - return $this->number; - } - - public function isGreaterThan(PreReleaseSuffix $suffix): bool { - if ($this->valueScore > $suffix->valueScore) { - return true; - } - - if ($this->valueScore < $suffix->valueScore) { - return false; - } - - return $this->getNumber() > $suffix->getNumber(); - } - - private function mapValueToScore(string $value): int { - $value = \strtolower($value); - - return self::valueScoreMap[$value]; - } - - private function parseValue(string $value): void { - $regex = '/-?((dev|beta|b|rc|alpha|a|patch|p|pl)\.?(\d*)).*$/i'; - - if (\preg_match($regex, $value, $matches) !== 1) { - throw new InvalidPreReleaseSuffixException(\sprintf('Invalid label %s', $value)); - } - - $this->full = $matches[1]; - $this->value = $matches[2]; - - if ($matches[3] !== '') { - $this->number = (int)$matches[3]; - } - - $this->valueScore = $this->mapValueToScore($matches[2]); - } -} diff --git a/vendor/phar-io/version/src/Version.php b/vendor/phar-io/version/src/Version.php deleted file mode 100644 index 644af5ca..00000000 --- a/vendor/phar-io/version/src/Version.php +++ /dev/null @@ -1,208 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -class Version { - /** @var string */ - private $originalVersionString; - - /** @var VersionNumber */ - private $major; - - /** @var VersionNumber */ - private $minor; - - /** @var VersionNumber */ - private $patch; - - /** @var null|PreReleaseSuffix */ - private $preReleaseSuffix; - - /** @var null|BuildMetaData */ - private $buildMetadata; - - public function __construct(string $versionString) { - $this->ensureVersionStringIsValid($versionString); - $this->originalVersionString = $versionString; - } - - /** - * @throws NoPreReleaseSuffixException - */ - public function getPreReleaseSuffix(): PreReleaseSuffix { - if ($this->preReleaseSuffix === null) { - throw new NoPreReleaseSuffixException('No pre-release suffix set'); - } - - return $this->preReleaseSuffix; - } - - public function getOriginalString(): string { - return $this->originalVersionString; - } - - public function getVersionString(): string { - $str = \sprintf( - '%d.%d.%d', - $this->getMajor()->getValue() ?? 0, - $this->getMinor()->getValue() ?? 0, - $this->getPatch()->getValue() ?? 0 - ); - - if (!$this->hasPreReleaseSuffix()) { - return $str; - } - - return $str . '-' . $this->getPreReleaseSuffix()->asString(); - } - - public function hasPreReleaseSuffix(): bool { - return $this->preReleaseSuffix !== null; - } - - public function equals(Version $other): bool { - if ($this->getVersionString() !== $other->getVersionString()) { - return false; - } - - if ($this->hasBuildMetaData() !== $other->hasBuildMetaData()) { - return false; - } - - if ($this->hasBuildMetaData() && $other->hasBuildMetaData() && - !$this->getBuildMetaData()->equals($other->getBuildMetaData())) { - return false; - } - - return true; - } - - public function isGreaterThan(Version $version): bool { - if ($version->getMajor()->getValue() > $this->getMajor()->getValue()) { - return false; - } - - if ($version->getMajor()->getValue() < $this->getMajor()->getValue()) { - return true; - } - - if ($version->getMinor()->getValue() > $this->getMinor()->getValue()) { - return false; - } - - if ($version->getMinor()->getValue() < $this->getMinor()->getValue()) { - return true; - } - - if ($version->getPatch()->getValue() > $this->getPatch()->getValue()) { - return false; - } - - if ($version->getPatch()->getValue() < $this->getPatch()->getValue()) { - return true; - } - - if (!$version->hasPreReleaseSuffix() && !$this->hasPreReleaseSuffix()) { - return false; - } - - if ($version->hasPreReleaseSuffix() && !$this->hasPreReleaseSuffix()) { - return true; - } - - if (!$version->hasPreReleaseSuffix() && $this->hasPreReleaseSuffix()) { - return false; - } - - return $this->getPreReleaseSuffix()->isGreaterThan($version->getPreReleaseSuffix()); - } - - public function getMajor(): VersionNumber { - return $this->major; - } - - public function getMinor(): VersionNumber { - return $this->minor; - } - - public function getPatch(): VersionNumber { - return $this->patch; - } - - /** - * @psalm-assert-if-true BuildMetaData $this->buildMetadata - * @psalm-assert-if-true BuildMetaData $this->getBuildMetaData() - */ - public function hasBuildMetaData(): bool { - return $this->buildMetadata !== null; - } - - /** - * @throws NoBuildMetaDataException - */ - public function getBuildMetaData(): BuildMetaData { - if (!$this->hasBuildMetaData()) { - throw new NoBuildMetaDataException('No build metadata set'); - } - - return $this->buildMetadata; - } - - /** - * @param string[] $matches - * - * @throws InvalidPreReleaseSuffixException - */ - private function parseVersion(array $matches): void { - $this->major = new VersionNumber((int)$matches['Major']); - $this->minor = new VersionNumber((int)$matches['Minor']); - $this->patch = isset($matches['Patch']) ? new VersionNumber((int)$matches['Patch']) : new VersionNumber(0); - - if (isset($matches['PreReleaseSuffix']) && $matches['PreReleaseSuffix'] !== '') { - $this->preReleaseSuffix = new PreReleaseSuffix($matches['PreReleaseSuffix']); - } - - if (isset($matches['BuildMetadata'])) { - $this->buildMetadata = new BuildMetaData($matches['BuildMetadata']); - } - } - - /** - * @param string $version - * - * @throws InvalidVersionException - */ - private function ensureVersionStringIsValid($version): void { - $regex = '/^v? - (?P0|[1-9]\d*) - \\. - (?P0|[1-9]\d*) - (\\. - (?P0|[1-9]\d*) - )? - (?: - - - (?(?:(dev|beta|b|rc|alpha|a|patch|p|pl)\.?\d*)) - )? - (?: - \\+ - (?P[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-@]+)*) - )? - $/xi'; - - if (\preg_match($regex, $version, $matches) !== 1) { - throw new InvalidVersionException( - \sprintf("Version string '%s' does not follow SemVer semantics", $version) - ); - } - - $this->parseVersion($matches); - } -} diff --git a/vendor/phar-io/version/src/VersionConstraintParser.php b/vendor/phar-io/version/src/VersionConstraintParser.php deleted file mode 100644 index 03d6a095..00000000 --- a/vendor/phar-io/version/src/VersionConstraintParser.php +++ /dev/null @@ -1,115 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -class VersionConstraintParser { - /** - * @throws UnsupportedVersionConstraintException - */ - public function parse(string $value): VersionConstraint { - if (\strpos($value, '|') !== false) { - return $this->handleOrGroup($value); - } - - if (!\preg_match('/^[\^~*]?v?[\d.*]+(?:-.*)?$/i', $value)) { - throw new UnsupportedVersionConstraintException( - \sprintf('Version constraint %s is not supported.', $value) - ); - } - - switch ($value[0]) { - case '~': - return $this->handleTildeOperator($value); - case '^': - return $this->handleCaretOperator($value); - } - - $constraint = new VersionConstraintValue($value); - - if ($constraint->getMajor()->isAny()) { - return new AnyVersionConstraint(); - } - - if ($constraint->getMinor()->isAny()) { - return new SpecificMajorVersionConstraint( - $constraint->getVersionString(), - $constraint->getMajor()->getValue() ?? 0 - ); - } - - if ($constraint->getPatch()->isAny()) { - return new SpecificMajorAndMinorVersionConstraint( - $constraint->getVersionString(), - $constraint->getMajor()->getValue() ?? 0, - $constraint->getMinor()->getValue() ?? 0 - ); - } - - return new ExactVersionConstraint($constraint->getVersionString()); - } - - private function handleOrGroup(string $value): OrVersionConstraintGroup { - $constraints = []; - - foreach (\preg_split('{\s*\|\|?\s*}', \trim($value)) as $groupSegment) { - $constraints[] = $this->parse(\trim($groupSegment)); - } - - return new OrVersionConstraintGroup($value, $constraints); - } - - private function handleTildeOperator(string $value): AndVersionConstraintGroup { - $constraintValue = new VersionConstraintValue(\substr($value, 1)); - - if ($constraintValue->getPatch()->isAny()) { - return $this->handleCaretOperator($value); - } - - $constraints = [ - new GreaterThanOrEqualToVersionConstraint( - $value, - new Version(\substr($value, 1)) - ), - new SpecificMajorAndMinorVersionConstraint( - $value, - $constraintValue->getMajor()->getValue() ?? 0, - $constraintValue->getMinor()->getValue() ?? 0 - ) - ]; - - return new AndVersionConstraintGroup($value, $constraints); - } - - private function handleCaretOperator(string $value): AndVersionConstraintGroup { - $constraintValue = new VersionConstraintValue(\substr($value, 1)); - - $constraints = [ - new GreaterThanOrEqualToVersionConstraint($value, new Version(\substr($value, 1))) - ]; - - if ($constraintValue->getMajor()->getValue() === 0) { - $constraints[] = new SpecificMajorAndMinorVersionConstraint( - $value, - $constraintValue->getMajor()->getValue() ?? 0, - $constraintValue->getMinor()->getValue() ?? 0 - ); - } else { - $constraints[] = new SpecificMajorVersionConstraint( - $value, - $constraintValue->getMajor()->getValue() ?? 0 - ); - } - - return new AndVersionConstraintGroup( - $value, - $constraints - ); - } -} diff --git a/vendor/phar-io/version/src/VersionConstraintValue.php b/vendor/phar-io/version/src/VersionConstraintValue.php deleted file mode 100644 index 0762e7c0..00000000 --- a/vendor/phar-io/version/src/VersionConstraintValue.php +++ /dev/null @@ -1,88 +0,0 @@ -versionString = $versionString; - - $this->parseVersion($versionString); - } - - public function getLabel(): string { - return $this->label; - } - - public function getBuildMetaData(): string { - return $this->buildMetaData; - } - - public function getVersionString(): string { - return $this->versionString; - } - - public function getMajor(): VersionNumber { - return $this->major; - } - - public function getMinor(): VersionNumber { - return $this->minor; - } - - public function getPatch(): VersionNumber { - return $this->patch; - } - - private function parseVersion(string $versionString): void { - $this->extractBuildMetaData($versionString); - $this->extractLabel($versionString); - $this->stripPotentialVPrefix($versionString); - - $versionSegments = \explode('.', $versionString); - $this->major = new VersionNumber(\is_numeric($versionSegments[0]) ? (int)$versionSegments[0] : null); - - $minorValue = isset($versionSegments[1]) && \is_numeric($versionSegments[1]) ? (int)$versionSegments[1] : null; - $patchValue = isset($versionSegments[2]) && \is_numeric($versionSegments[2]) ? (int)$versionSegments[2] : null; - - $this->minor = new VersionNumber($minorValue); - $this->patch = new VersionNumber($patchValue); - } - - private function extractBuildMetaData(string &$versionString): void { - if (\preg_match('/\+(.*)/', $versionString, $matches) === 1) { - $this->buildMetaData = $matches[1]; - $versionString = \str_replace($matches[0], '', $versionString); - } - } - - private function extractLabel(string &$versionString): void { - if (\preg_match('/-(.*)/', $versionString, $matches) === 1) { - $this->label = $matches[1]; - $versionString = \str_replace($matches[0], '', $versionString); - } - } - - private function stripPotentialVPrefix(string &$versionString): void { - if ($versionString[0] !== 'v') { - return; - } - $versionString = \substr($versionString, 1); - } -} diff --git a/vendor/phar-io/version/src/VersionNumber.php b/vendor/phar-io/version/src/VersionNumber.php deleted file mode 100644 index 4833a9b0..00000000 --- a/vendor/phar-io/version/src/VersionNumber.php +++ /dev/null @@ -1,28 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -class VersionNumber { - - /** @var ?int */ - private $value; - - public function __construct(?int $value) { - $this->value = $value; - } - - public function isAny(): bool { - return $this->value === null; - } - - public function getValue(): ?int { - return $this->value; - } -} diff --git a/vendor/phar-io/version/src/constraints/AbstractVersionConstraint.php b/vendor/phar-io/version/src/constraints/AbstractVersionConstraint.php deleted file mode 100644 index 66201a14..00000000 --- a/vendor/phar-io/version/src/constraints/AbstractVersionConstraint.php +++ /dev/null @@ -1,23 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -abstract class AbstractVersionConstraint implements VersionConstraint { - /** @var string */ - private $originalValue; - - public function __construct(string $originalValue) { - $this->originalValue = $originalValue; - } - - public function asString(): string { - return $this->originalValue; - } -} diff --git a/vendor/phar-io/version/src/constraints/AndVersionConstraintGroup.php b/vendor/phar-io/version/src/constraints/AndVersionConstraintGroup.php deleted file mode 100644 index 5096f2fb..00000000 --- a/vendor/phar-io/version/src/constraints/AndVersionConstraintGroup.php +++ /dev/null @@ -1,34 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -class AndVersionConstraintGroup extends AbstractVersionConstraint { - /** @var VersionConstraint[] */ - private $constraints = []; - - /** - * @param VersionConstraint[] $constraints - */ - public function __construct(string $originalValue, array $constraints) { - parent::__construct($originalValue); - - $this->constraints = $constraints; - } - - public function complies(Version $version): bool { - foreach ($this->constraints as $constraint) { - if (!$constraint->complies($version)) { - return false; - } - } - - return true; - } -} diff --git a/vendor/phar-io/version/src/constraints/AnyVersionConstraint.php b/vendor/phar-io/version/src/constraints/AnyVersionConstraint.php deleted file mode 100644 index 1499f071..00000000 --- a/vendor/phar-io/version/src/constraints/AnyVersionConstraint.php +++ /dev/null @@ -1,20 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -class AnyVersionConstraint implements VersionConstraint { - public function complies(Version $version): bool { - return true; - } - - public function asString(): string { - return '*'; - } -} diff --git a/vendor/phar-io/version/src/constraints/ExactVersionConstraint.php b/vendor/phar-io/version/src/constraints/ExactVersionConstraint.php deleted file mode 100644 index 1d675c9c..00000000 --- a/vendor/phar-io/version/src/constraints/ExactVersionConstraint.php +++ /dev/null @@ -1,22 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -class ExactVersionConstraint extends AbstractVersionConstraint { - public function complies(Version $version): bool { - $other = $version->getVersionString(); - - if ($version->hasBuildMetaData()) { - $other .= '+' . $version->getBuildMetaData()->asString(); - } - - return $this->asString() === $other; - } -} diff --git a/vendor/phar-io/version/src/constraints/GreaterThanOrEqualToVersionConstraint.php b/vendor/phar-io/version/src/constraints/GreaterThanOrEqualToVersionConstraint.php deleted file mode 100644 index ec371723..00000000 --- a/vendor/phar-io/version/src/constraints/GreaterThanOrEqualToVersionConstraint.php +++ /dev/null @@ -1,26 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -class GreaterThanOrEqualToVersionConstraint extends AbstractVersionConstraint { - /** @var Version */ - private $minimalVersion; - - public function __construct(string $originalValue, Version $minimalVersion) { - parent::__construct($originalValue); - - $this->minimalVersion = $minimalVersion; - } - - public function complies(Version $version): bool { - return $version->getVersionString() === $this->minimalVersion->getVersionString() - || $version->isGreaterThan($this->minimalVersion); - } -} diff --git a/vendor/phar-io/version/src/constraints/OrVersionConstraintGroup.php b/vendor/phar-io/version/src/constraints/OrVersionConstraintGroup.php deleted file mode 100644 index 59fd382f..00000000 --- a/vendor/phar-io/version/src/constraints/OrVersionConstraintGroup.php +++ /dev/null @@ -1,35 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -class OrVersionConstraintGroup extends AbstractVersionConstraint { - /** @var VersionConstraint[] */ - private $constraints = []; - - /** - * @param string $originalValue - * @param VersionConstraint[] $constraints - */ - public function __construct($originalValue, array $constraints) { - parent::__construct($originalValue); - - $this->constraints = $constraints; - } - - public function complies(Version $version): bool { - foreach ($this->constraints as $constraint) { - if ($constraint->complies($version)) { - return true; - } - } - - return false; - } -} diff --git a/vendor/phar-io/version/src/constraints/SpecificMajorAndMinorVersionConstraint.php b/vendor/phar-io/version/src/constraints/SpecificMajorAndMinorVersionConstraint.php deleted file mode 100644 index 302aa311..00000000 --- a/vendor/phar-io/version/src/constraints/SpecificMajorAndMinorVersionConstraint.php +++ /dev/null @@ -1,33 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -class SpecificMajorAndMinorVersionConstraint extends AbstractVersionConstraint { - /** @var int */ - private $major; - - /** @var int */ - private $minor; - - public function __construct(string $originalValue, int $major, int $minor) { - parent::__construct($originalValue); - - $this->major = $major; - $this->minor = $minor; - } - - public function complies(Version $version): bool { - if ($version->getMajor()->getValue() !== $this->major) { - return false; - } - - return $version->getMinor()->getValue() === $this->minor; - } -} diff --git a/vendor/phar-io/version/src/constraints/SpecificMajorVersionConstraint.php b/vendor/phar-io/version/src/constraints/SpecificMajorVersionConstraint.php deleted file mode 100644 index 968b809c..00000000 --- a/vendor/phar-io/version/src/constraints/SpecificMajorVersionConstraint.php +++ /dev/null @@ -1,25 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -class SpecificMajorVersionConstraint extends AbstractVersionConstraint { - /** @var int */ - private $major; - - public function __construct(string $originalValue, int $major) { - parent::__construct($originalValue); - - $this->major = $major; - } - - public function complies(Version $version): bool { - return $version->getMajor()->getValue() === $this->major; - } -} diff --git a/vendor/phar-io/version/src/constraints/VersionConstraint.php b/vendor/phar-io/version/src/constraints/VersionConstraint.php deleted file mode 100644 index e94f9e00..00000000 --- a/vendor/phar-io/version/src/constraints/VersionConstraint.php +++ /dev/null @@ -1,16 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -interface VersionConstraint { - public function complies(Version $version): bool; - - public function asString(): string; -} diff --git a/vendor/phar-io/version/src/exceptions/Exception.php b/vendor/phar-io/version/src/exceptions/Exception.php deleted file mode 100644 index 3ea458f3..00000000 --- a/vendor/phar-io/version/src/exceptions/Exception.php +++ /dev/null @@ -1,15 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -use Throwable; - -interface Exception extends Throwable { -} diff --git a/vendor/phar-io/version/src/exceptions/InvalidPreReleaseSuffixException.php b/vendor/phar-io/version/src/exceptions/InvalidPreReleaseSuffixException.php deleted file mode 100644 index bc0b0c3e..00000000 --- a/vendor/phar-io/version/src/exceptions/InvalidPreReleaseSuffixException.php +++ /dev/null @@ -1,5 +0,0 @@ -, Sebastian Heuer , Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PharIo\Version; - -final class UnsupportedVersionConstraintException extends \RuntimeException implements Exception { -} diff --git a/vendor/phpoption/phpoption/LICENSE b/vendor/phpoption/phpoption/LICENSE deleted file mode 100644 index f49a4e16..00000000 --- a/vendor/phpoption/phpoption/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. \ No newline at end of file diff --git a/vendor/phpoption/phpoption/composer.json b/vendor/phpoption/phpoption/composer.json deleted file mode 100644 index 0106c977..00000000 --- a/vendor/phpoption/phpoption/composer.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "phpoption/phpoption", - "description": "Option Type for PHP", - "keywords": ["php", "option", "language", "type"], - "license": "Apache-2.0", - "authors": [ - { - "name": "Johannes M. Schmitt", - "email": "schmittjoh@gmail.com", - "homepage": "https://github.com/schmittjoh" - }, - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - } - ], - "require": { - "php": "^7.2.5 || ^8.0" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.8", - "phpunit/phpunit": "^8.5.28 || ^9.5.21" - }, - "autoload": { - "psr-4": { - "PhpOption\\": "src/PhpOption/" - } - }, - "autoload-dev": { - "psr-4": { - "PhpOption\\Tests\\": "tests/PhpOption/Tests/" - } - }, - "config": { - "allow-plugins": { - "bamarni/composer-bin-plugin": true - }, - "preferred-install": "dist" - }, - "extra": { - "bamarni-bin": { - "bin-links": true, - "forward-command": true - }, - "branch-alias": { - "dev-master": "1.9-dev" - } - }, - "minimum-stability": "dev", - "prefer-stable": true -} diff --git a/vendor/phpoption/phpoption/src/PhpOption/LazyOption.php b/vendor/phpoption/phpoption/src/PhpOption/LazyOption.php deleted file mode 100644 index 9cb77c86..00000000 --- a/vendor/phpoption/phpoption/src/PhpOption/LazyOption.php +++ /dev/null @@ -1,175 +0,0 @@ - - * - * 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. - */ - -namespace PhpOption; - -use Traversable; - -/** - * @template T - * - * @extends Option - */ -final class LazyOption extends Option -{ - /** @var callable(mixed...):(Option) */ - private $callback; - - /** @var array */ - private $arguments; - - /** @var Option|null */ - private $option; - - /** - * @template S - * @param callable(mixed...):(Option) $callback - * @param array $arguments - * - * @return LazyOption - */ - public static function create($callback, array $arguments = []): self - { - return new self($callback, $arguments); - } - - /** - * @param callable(mixed...):(Option) $callback - * @param array $arguments - */ - public function __construct($callback, array $arguments = []) - { - if (!is_callable($callback)) { - throw new \InvalidArgumentException('Invalid callback given'); - } - - $this->callback = $callback; - $this->arguments = $arguments; - } - - public function isDefined(): bool - { - return $this->option()->isDefined(); - } - - public function isEmpty(): bool - { - return $this->option()->isEmpty(); - } - - public function get() - { - return $this->option()->get(); - } - - public function getOrElse($default) - { - return $this->option()->getOrElse($default); - } - - public function getOrCall($callable) - { - return $this->option()->getOrCall($callable); - } - - public function getOrThrow(\Exception $ex) - { - return $this->option()->getOrThrow($ex); - } - - public function orElse(Option $else) - { - return $this->option()->orElse($else); - } - - public function ifDefined($callable) - { - $this->option()->forAll($callable); - } - - public function forAll($callable) - { - return $this->option()->forAll($callable); - } - - public function map($callable) - { - return $this->option()->map($callable); - } - - public function flatMap($callable) - { - return $this->option()->flatMap($callable); - } - - public function filter($callable) - { - return $this->option()->filter($callable); - } - - public function filterNot($callable) - { - return $this->option()->filterNot($callable); - } - - public function select($value) - { - return $this->option()->select($value); - } - - public function reject($value) - { - return $this->option()->reject($value); - } - - /** - * @return Traversable - */ - public function getIterator(): Traversable - { - return $this->option()->getIterator(); - } - - public function foldLeft($initialValue, $callable) - { - return $this->option()->foldLeft($initialValue, $callable); - } - - public function foldRight($initialValue, $callable) - { - return $this->option()->foldRight($initialValue, $callable); - } - - /** - * @return Option - */ - private function option(): Option - { - if (null === $this->option) { - /** @var mixed */ - $option = call_user_func_array($this->callback, $this->arguments); - if ($option instanceof Option) { - $this->option = $option; - } else { - throw new \RuntimeException(sprintf('Expected instance of %s', Option::class)); - } - } - - return $this->option; - } -} diff --git a/vendor/phpoption/phpoption/src/PhpOption/None.php b/vendor/phpoption/phpoption/src/PhpOption/None.php deleted file mode 100644 index 4b85d22d..00000000 --- a/vendor/phpoption/phpoption/src/PhpOption/None.php +++ /dev/null @@ -1,136 +0,0 @@ - - * - * 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. - */ - -namespace PhpOption; - -use EmptyIterator; - -/** - * @extends Option - */ -final class None extends Option -{ - /** @var None|null */ - private static $instance; - - /** - * @return None - */ - public static function create(): self - { - if (null === self::$instance) { - self::$instance = new self(); - } - - return self::$instance; - } - - public function get() - { - throw new \RuntimeException('None has no value.'); - } - - public function getOrCall($callable) - { - return $callable(); - } - - public function getOrElse($default) - { - return $default; - } - - public function getOrThrow(\Exception $ex) - { - throw $ex; - } - - public function isEmpty(): bool - { - return true; - } - - public function isDefined(): bool - { - return false; - } - - public function orElse(Option $else) - { - return $else; - } - - public function ifDefined($callable) - { - // Just do nothing in that case. - } - - public function forAll($callable) - { - return $this; - } - - public function map($callable) - { - return $this; - } - - public function flatMap($callable) - { - return $this; - } - - public function filter($callable) - { - return $this; - } - - public function filterNot($callable) - { - return $this; - } - - public function select($value) - { - return $this; - } - - public function reject($value) - { - return $this; - } - - public function getIterator(): EmptyIterator - { - return new EmptyIterator(); - } - - public function foldLeft($initialValue, $callable) - { - return $initialValue; - } - - public function foldRight($initialValue, $callable) - { - return $initialValue; - } - - private function __construct() - { - } -} diff --git a/vendor/phpoption/phpoption/src/PhpOption/Option.php b/vendor/phpoption/phpoption/src/PhpOption/Option.php deleted file mode 100644 index 172924cf..00000000 --- a/vendor/phpoption/phpoption/src/PhpOption/Option.php +++ /dev/null @@ -1,434 +0,0 @@ - - * - * 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. - */ - -namespace PhpOption; - -use ArrayAccess; -use IteratorAggregate; - -/** - * @template T - * - * @implements IteratorAggregate - */ -abstract class Option implements IteratorAggregate -{ - /** - * Creates an option given a return value. - * - * This is intended for consuming existing APIs and allows you to easily - * convert them to an option. By default, we treat ``null`` as the None - * case, and everything else as Some. - * - * @template S - * - * @param S $value The actual return value. - * @param S $noneValue The value which should be considered "None"; null by - * default. - * - * @return Option - */ - public static function fromValue($value, $noneValue = null) - { - if ($value === $noneValue) { - return None::create(); - } - - return new Some($value); - } - - /** - * Creates an option from an array's value. - * - * If the key does not exist in the array, the array is not actually an - * array, or the array's value at the given key is null, None is returned. - * Otherwise, Some is returned wrapping the value at the given key. - * - * @template S - * - * @param array|ArrayAccess|null $array A potential array or \ArrayAccess value. - * @param string $key The key to check. - * - * @return Option - */ - public static function fromArraysValue($array, $key) - { - if (!(is_array($array) || $array instanceof ArrayAccess) || !isset($array[$key])) { - return None::create(); - } - - return new Some($array[$key]); - } - - /** - * Creates a lazy-option with the given callback. - * - * This is also a helper constructor for lazy-consuming existing APIs where - * the return value is not yet an option. By default, we treat ``null`` as - * None case, and everything else as Some. - * - * @template S - * - * @param callable $callback The callback to evaluate. - * @param array $arguments The arguments for the callback. - * @param S $noneValue The value which should be considered "None"; - * null by default. - * - * @return LazyOption - */ - public static function fromReturn($callback, array $arguments = [], $noneValue = null) - { - return new LazyOption(static function () use ($callback, $arguments, $noneValue) { - /** @var mixed */ - $return = call_user_func_array($callback, $arguments); - - if ($return === $noneValue) { - return None::create(); - } - - return new Some($return); - }); - } - - /** - * Option factory, which creates new option based on passed value. - * - * If value is already an option, it simply returns. If value is callable, - * LazyOption with passed callback created and returned. If Option - * returned from callback, it returns directly. On other case value passed - * to Option::fromValue() method. - * - * @template S - * - * @param Option|callable|S $value - * @param S $noneValue Used when $value is mixed or - * callable, for None-check. - * - * @return Option|LazyOption - */ - public static function ensure($value, $noneValue = null) - { - if ($value instanceof self) { - return $value; - } elseif (is_callable($value)) { - return new LazyOption(static function () use ($value, $noneValue) { - /** @var mixed */ - $return = $value(); - - if ($return instanceof self) { - return $return; - } else { - return self::fromValue($return, $noneValue); - } - }); - } else { - return self::fromValue($value, $noneValue); - } - } - - /** - * Lift a function so that it accepts Option as parameters. - * - * We return a new closure that wraps the original callback. If any of the - * parameters passed to the lifted function is empty, the function will - * return a value of None. Otherwise, we will pass all parameters to the - * original callback and return the value inside a new Option, unless an - * Option is returned from the function, in which case, we use that. - * - * @template S - * - * @param callable $callback - * @param mixed $noneValue - * - * @return callable - */ - public static function lift($callback, $noneValue = null) - { - return static function () use ($callback, $noneValue) { - /** @var array */ - $args = func_get_args(); - - $reduced_args = array_reduce( - $args, - /** @param bool $status */ - static function ($status, self $o) { - return $o->isEmpty() ? true : $status; - }, - false - ); - // if at least one parameter is empty, return None - if ($reduced_args) { - return None::create(); - } - - $args = array_map( - /** @return T */ - static function (self $o) { - // it is safe to do so because the fold above checked - // that all arguments are of type Some - /** @var T */ - return $o->get(); - }, - $args - ); - - return self::ensure(call_user_func_array($callback, $args), $noneValue); - }; - } - - /** - * Returns the value if available, or throws an exception otherwise. - * - * @throws \RuntimeException If value is not available. - * - * @return T - */ - abstract public function get(); - - /** - * Returns the value if available, or the default value if not. - * - * @template S - * - * @param S $default - * - * @return T|S - */ - abstract public function getOrElse($default); - - /** - * Returns the value if available, or the results of the callable. - * - * This is preferable over ``getOrElse`` if the computation of the default - * value is expensive. - * - * @template S - * - * @param callable():S $callable - * - * @return T|S - */ - abstract public function getOrCall($callable); - - /** - * Returns the value if available, or throws the passed exception. - * - * @param \Exception $ex - * - * @return T - */ - abstract public function getOrThrow(\Exception $ex); - - /** - * Returns true if no value is available, false otherwise. - * - * @return bool - */ - abstract public function isEmpty(); - - /** - * Returns true if a value is available, false otherwise. - * - * @return bool - */ - abstract public function isDefined(); - - /** - * Returns this option if non-empty, or the passed option otherwise. - * - * This can be used to try multiple alternatives, and is especially useful - * with lazy evaluating options: - * - * ```php - * $repo->findSomething() - * ->orElse(new LazyOption(array($repo, 'findSomethingElse'))) - * ->orElse(new LazyOption(array($repo, 'createSomething'))); - * ``` - * - * @param Option $else - * - * @return Option - */ - abstract public function orElse(self $else); - - /** - * This is similar to map() below except that the return value has no meaning; - * the passed callable is simply executed if the option is non-empty, and - * ignored if the option is empty. - * - * In all cases, the return value of the callable is discarded. - * - * ```php - * $comment->getMaybeFile()->ifDefined(function($file) { - * // Do something with $file here. - * }); - * ``` - * - * If you're looking for something like ``ifEmpty``, you can use ``getOrCall`` - * and ``getOrElse`` in these cases. - * - * @deprecated Use forAll() instead. - * - * @param callable(T):mixed $callable - * - * @return void - */ - abstract public function ifDefined($callable); - - /** - * This is similar to map() except that the return value of the callable has no meaning. - * - * The passed callable is simply executed if the option is non-empty, and ignored if the - * option is empty. This method is preferred for callables with side-effects, while map() - * is intended for callables without side-effects. - * - * @param callable(T):mixed $callable - * - * @return Option - */ - abstract public function forAll($callable); - - /** - * Applies the callable to the value of the option if it is non-empty, - * and returns the return value of the callable wrapped in Some(). - * - * If the option is empty, then the callable is not applied. - * - * ```php - * (new Some("foo"))->map('strtoupper')->get(); // "FOO" - * ``` - * - * @template S - * - * @param callable(T):S $callable - * - * @return Option - */ - abstract public function map($callable); - - /** - * Applies the callable to the value of the option if it is non-empty, and - * returns the return value of the callable directly. - * - * In contrast to ``map``, the return value of the callable is expected to - * be an Option itself; it is not automatically wrapped in Some(). - * - * @template S - * - * @param callable(T):Option $callable must return an Option - * - * @return Option - */ - abstract public function flatMap($callable); - - /** - * If the option is empty, it is returned immediately without applying the callable. - * - * If the option is non-empty, the callable is applied, and if it returns true, - * the option itself is returned; otherwise, None is returned. - * - * @param callable(T):bool $callable - * - * @return Option - */ - abstract public function filter($callable); - - /** - * If the option is empty, it is returned immediately without applying the callable. - * - * If the option is non-empty, the callable is applied, and if it returns false, - * the option itself is returned; otherwise, None is returned. - * - * @param callable(T):bool $callable - * - * @return Option - */ - abstract public function filterNot($callable); - - /** - * If the option is empty, it is returned immediately. - * - * If the option is non-empty, and its value does not equal the passed value - * (via a shallow comparison ===), then None is returned. Otherwise, the - * Option is returned. - * - * In other words, this will filter all but the passed value. - * - * @param T $value - * - * @return Option - */ - abstract public function select($value); - - /** - * If the option is empty, it is returned immediately. - * - * If the option is non-empty, and its value does equal the passed value (via - * a shallow comparison ===), then None is returned; otherwise, the Option is - * returned. - * - * In other words, this will let all values through except the passed value. - * - * @param T $value - * - * @return Option - */ - abstract public function reject($value); - - /** - * Binary operator for the initial value and the option's value. - * - * If empty, the initial value is returned. If non-empty, the callable - * receives the initial value and the option's value as arguments. - * - * ```php - * - * $some = new Some(5); - * $none = None::create(); - * $result = $some->foldLeft(1, function($a, $b) { return $a + $b; }); // int(6) - * $result = $none->foldLeft(1, function($a, $b) { return $a + $b; }); // int(1) - * - * // This can be used instead of something like the following: - * $option = Option::fromValue($integerOrNull); - * $result = 1; - * if ( ! $option->isEmpty()) { - * $result += $option->get(); - * } - * ``` - * - * @template S - * - * @param S $initialValue - * @param callable(S, T):S $callable - * - * @return S - */ - abstract public function foldLeft($initialValue, $callable); - - /** - * foldLeft() but with reversed arguments for the callable. - * - * @template S - * - * @param S $initialValue - * @param callable(T, S):S $callable - * - * @return S - */ - abstract public function foldRight($initialValue, $callable); -} diff --git a/vendor/phpoption/phpoption/src/PhpOption/Some.php b/vendor/phpoption/phpoption/src/PhpOption/Some.php deleted file mode 100644 index 032632ea..00000000 --- a/vendor/phpoption/phpoption/src/PhpOption/Some.php +++ /dev/null @@ -1,169 +0,0 @@ - - * - * 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. - */ - -namespace PhpOption; - -use ArrayIterator; - -/** - * @template T - * - * @extends Option - */ -final class Some extends Option -{ - /** @var T */ - private $value; - - /** - * @param T $value - */ - public function __construct($value) - { - $this->value = $value; - } - - /** - * @template U - * - * @param U $value - * - * @return Some - */ - public static function create($value): self - { - return new self($value); - } - - public function isDefined(): bool - { - return true; - } - - public function isEmpty(): bool - { - return false; - } - - public function get() - { - return $this->value; - } - - public function getOrElse($default) - { - return $this->value; - } - - public function getOrCall($callable) - { - return $this->value; - } - - public function getOrThrow(\Exception $ex) - { - return $this->value; - } - - public function orElse(Option $else) - { - return $this; - } - - public function ifDefined($callable) - { - $this->forAll($callable); - } - - public function forAll($callable) - { - $callable($this->value); - - return $this; - } - - public function map($callable) - { - return new self($callable($this->value)); - } - - public function flatMap($callable) - { - /** @var mixed */ - $rs = $callable($this->value); - if (!$rs instanceof Option) { - throw new \RuntimeException('Callables passed to flatMap() must return an Option. Maybe you should use map() instead?'); - } - - return $rs; - } - - public function filter($callable) - { - if (true === $callable($this->value)) { - return $this; - } - - return None::create(); - } - - public function filterNot($callable) - { - if (false === $callable($this->value)) { - return $this; - } - - return None::create(); - } - - public function select($value) - { - if ($this->value === $value) { - return $this; - } - - return None::create(); - } - - public function reject($value) - { - if ($this->value === $value) { - return None::create(); - } - - return $this; - } - - /** - * @return ArrayIterator - */ - public function getIterator(): ArrayIterator - { - return new ArrayIterator([$this->value]); - } - - public function foldLeft($initialValue, $callable) - { - return $callable($initialValue, $this->value); - } - - public function foldRight($initialValue, $callable) - { - return $callable($this->value, $initialValue); - } -} diff --git a/vendor/phpunit/php-code-coverage/ChangeLog.md b/vendor/phpunit/php-code-coverage/ChangeLog.md deleted file mode 100644 index aa6bd4e3..00000000 --- a/vendor/phpunit/php-code-coverage/ChangeLog.md +++ /dev/null @@ -1,508 +0,0 @@ -# ChangeLog - -All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. - -## [9.2.22] - 2022-12-18 - -### Fixed - -* [#969](https://github.com/sebastianbergmann/php-code-coverage/pull/969): Fixed identifying line with `throw` as executable - -## [9.2.21] - 2022-12-14 - -### Changed - -* [#964](https://github.com/sebastianbergmann/php-code-coverage/pull/964): Changed how executable lines are identified - -## [9.2.20] - 2022-12-13 - -### Fixed - -* [#960](https://github.com/sebastianbergmann/php-code-coverage/issues/960): New body font-size is way too big - -## [9.2.19] - 2022-11-18 - -### Fixed - -* [#949](https://github.com/sebastianbergmann/php-code-coverage/pull/949): Various issues related to identifying executable lines - -### Changed - -* Tweaked CSS for HTML report -* Updated bundled CSS/JavaScript components used for HTML report: Bootstrap 4.6.2 and jQuery 3.6.1 - -## [9.2.18] - 2022-10-27 - -### Fixed - -* [#935](https://github.com/sebastianbergmann/php-code-coverage/pull/935): Cobertura package name attribute is always empty -* [#946](https://github.com/sebastianbergmann/php-code-coverage/issues/946): `return` with multiline constant expression must only contain the last line - -## [9.2.17] - 2022-08-30 - -### Changed - -* [#928](https://github.com/sebastianbergmann/php-code-coverage/pull/928): Avoid unnecessary `is_file()` calls -* [#931](https://github.com/sebastianbergmann/php-code-coverage/pull/931): Use MD5 instead of CRC32 for static analysis cache file identifier - -### Fixed - -* [#926](https://github.com/sebastianbergmann/php-code-coverage/pull/926): Static Analysis cache does not work with `open_basedir` - -## [9.2.16] - 2022-08-20 - -### Fixed - -* [#926](https://github.com/sebastianbergmann/php-code-coverage/issues/926): File view has wrong colouring for the first column - -## [9.2.15] - 2022-03-07 - -### Fixed - -* [#885](https://github.com/sebastianbergmann/php-code-coverage/issues/885): Files that have only `\r` (CR, 0x0d) EOL characters are not handled correctly -* [#907](https://github.com/sebastianbergmann/php-code-coverage/issues/907): Line with only `return [` is not recognized as executable - -## [9.2.14] - 2022-02-28 - -### Fixed - -* [#904](https://github.com/sebastianbergmann/php-code-coverage/issues/904): Lines of code containing the `match` keyword were not recognized as executable correctly -* [#905](https://github.com/sebastianbergmann/php-code-coverage/issues/905): Lines of code in constructors were not recognized as executable correctly when constructor property promotion is used - -## [9.2.13] - 2022-02-23 - -### Changed - -* The contents of the static analysis sourcecode files is now used to generate the static analysis cache version identifier - -### Fixed - -* Reverted rename of `SebastianBergmann\CodeCoverage\ProcessedCodeCoverageData` to `SebastianBergmann\CodeCoverage\Data\ProcessedCodeCoverageData` (this class is marked as `@internal` and not covered by the backward compatibility promise, but it is (still) used directly by PHPUnit) -* Reverted rename of `SebastianBergmann\CodeCoverage\RawCodeCoverageData` to `SebastianBergmann\CodeCoverage\Data\RawCodeCoverageData` (this class is marked as `@internal` and not covered by the backward compatibility promise, but it is (still) used directly by PHPUnit) -* The `ArrayDim`, `Cast`, and `MethodCall` nodes are now considered when determining whether a line of code is executable or not - -## [9.2.12] - 2022-02-23 [YANKED] - -### Changed - -* [#898](https://github.com/sebastianbergmann/php-code-coverage/pull/898): Use content hash instead of `filemtime()` to determine cache hit/miss - -### Fixed - -* [#736](https://github.com/sebastianbergmann/php-code-coverage/issues/736): HTML report generator allows invalid values for low upper bound and high lower bound -* [#854](https://github.com/sebastianbergmann/php-code-coverage/issues/854): "Class Coverage Distribution" and "Class Complexity" graphs are not displayed at full width -* [#897](https://github.com/sebastianbergmann/php-code-coverage/issues/897): `declare(strict_types=1)` marked as uncovered - -## [9.2.11] - 2022-02-18 - -### Changed - -* `CoveredFileAnalyser` and `UncoveredFileAnalyser` have been combined to `FileAnalyser` -* Updated bundled CSS/JavaScript components used for HTML report: Bootstrap 4.6.1, jQuery 3.6.0, and popper.js 1.16.1 - -### Fixed - -* [#889](https://github.com/sebastianbergmann/php-code-coverage/issues/889): Code Coverage depends on autoload order - -## [9.2.10] - 2021-12-05 - -### Fixed - -* [#887](https://github.com/sebastianbergmann/php-code-coverage/issues/887): Document return type of `CodeUnitFindingVisitor::enterNode()` so that Symfony's DebugClassLoader does not trigger a deprecation warning - -## [9.2.9] - 2021-11-19 - -### Fixed - -* [#882](https://github.com/sebastianbergmann/php-code-coverage/issues/882): PHPUnit 9.2.8 has wrong version number - -## [9.2.8] - 2021-10-30 - -### Fixed - -* [#866](https://github.com/sebastianbergmann/php-code-coverage/issues/866): `CodeUnitFindingVisitor` does not handle `enum` type introduced in PHP 8.1 -* [#868](https://github.com/sebastianbergmann/php-code-coverage/pull/868): Uncovered files should be ignored unless requested -* [#876](https://github.com/sebastianbergmann/php-code-coverage/issues/876): PCOV driver causes 2x slowdown after upgrade to PHPUnit 9.5 - -## [9.2.7] - 2021-09-17 - -### Fixed - -* [#860](https://github.com/sebastianbergmann/php-code-coverage/pull/860): Empty value for `XDEBUG_MODE` environment variable is not handled correctly - -## [9.2.6] - 2021-03-28 - -### Fixed - -* [#846](https://github.com/sebastianbergmann/php-code-coverage/issues/846): Method name should not appear in the method signature attribute of Cobertura XML - -## [9.2.5] - 2020-11-28 - -### Fixed - -* [#831](https://github.com/sebastianbergmann/php-code-coverage/issues/831): Files that do not contain a newline are not handled correctly - -## [9.2.4] - 2020-11-27 - -### Added - -* [#834](https://github.com/sebastianbergmann/php-code-coverage/issues/834): Support `XDEBUG_MODE` environment variable - -## [9.2.3] - 2020-10-30 - -### Changed - -* Bumped required version of `nikic/php-parser` - -## [9.2.2] - 2020-10-28 - -### Fixed - -* [#820](https://github.com/sebastianbergmann/php-code-coverage/issues/820): Hidden dependency on PHPUnit - -## [9.2.1] - 2020-10-26 - -### Fixed - -* `SebastianBergmann\CodeCoverage\Exception` now correctly extends `\Throwable` - -## [9.2.0] - 2020-10-02 - -### Added - -* [#812](https://github.com/sebastianbergmann/php-code-coverage/pull/812): Support for Cobertura XML report format - -### Changed - -* Reduced the number of I/O operations performed by the static analysis cache - -## [9.1.11] - 2020-09-19 - -### Fixed - -* [#811](https://github.com/sebastianbergmann/php-code-coverage/issues/811): `T_FN` constant is used on PHP 7.3 where it is not available - -## [9.1.10] - 2020-09-18 - -### Added - -* `SebastianBergmann\CodeCoverage\Driver\Selector::forLineCoverage()` and `SebastianBergmann\CodeCoverage\Driver\Selector::forLineAndPathCoverage()` have been added - -### Fixed - -* [#810](https://github.com/sebastianbergmann/php-code-coverage/issues/810): `SebastianBergmann\CodeCoverage\Driver\Driver::forLineCoverage()` and `SebastianBergmann\CodeCoverage\Driver\Driver::forLineAndPathCoverage()` are marked as internal - -### Removed - -* `SebastianBergmann\CodeCoverage\Driver\Driver::forLineCoverage()` and `SebastianBergmann\CodeCoverage\Driver\Driver::forLineAndPathCoverage()` are now deprecated - -## [9.1.9] - 2020-09-15 - -### Fixed - -* [#808](https://github.com/sebastianbergmann/php-code-coverage/issues/808): `PHP Warning: Use of undefined constant T_MATCH` - -## [9.1.8] - 2020-09-07 - -### Changed - -* [#800](https://github.com/sebastianbergmann/php-code-coverage/pull/800): All files on the inclusion list are no longer loaded when `SebastianBergmann\CodeCoverage::start()` is called for the first time and `processUncoveredFiles` is set to `true` - -### Fixed - -* [#799](https://github.com/sebastianbergmann/php-code-coverage/issues/799): Uncovered new line at end of file - -## [9.1.7] - 2020-09-03 - -### Fixed - -* Fixed regressions introduced in versions 9.1.5 and 9.1.6 - -## [9.1.6] - 2020-08-31 - -### Fixed - -* [#799](https://github.com/sebastianbergmann/php-code-coverage/issues/799): Uncovered new line at end of file -* [#803](https://github.com/sebastianbergmann/php-code-coverage/issues/803): HTML report does not sort directories and files anymore - -## [9.1.5] - 2020-08-27 - -### Changed - -* [#800](https://github.com/sebastianbergmann/php-code-coverage/pull/800): All files on the inclusion list are no longer loaded when `SebastianBergmann\CodeCoverage::start()` is called for the first time and `processUncoveredFiles` is set to `true` - -### Fixed - -* [#797](https://github.com/sebastianbergmann/php-code-coverage/pull/797): Class name is wrongly removed from namespace name - -## [9.1.4] - 2020-08-13 - -### Fixed - -* [#793](https://github.com/sebastianbergmann/php-code-coverage/issues/793): Lines with `::class` constant are not covered - -## [9.1.3] - 2020-08-10 - -### Changed - -* Changed PHP-Parser usage to parse sourcecode according to the PHP version we are currently running on instead of using emulative lexing - -## [9.1.2] - 2020-08-10 - -### Fixed - -* [#791](https://github.com/sebastianbergmann/php-code-coverage/pull/791): Cache Warmer does not warm all caches - -## [9.1.1] - 2020-08-10 - -### Added - -* Added `SebastianBergmann\CodeCoverage::cacheDirectory()` method for querying where the cache writes its files - -## [9.1.0] - 2020-08-10 - -### Added - -* Implemented a persistent cache for information gathered using PHP-Parser based static analysis (hereinafter referred to as "cache") -* Added `SebastianBergmann\CodeCoverage::cacheStaticAnalysis(string $cacheDirectory)` method for enabling the cache; it will write its files to `$directory` -* Added `SebastianBergmann\CodeCoverage::doNotCacheStaticAnalysis` method for disabling the cache -* Added `SebastianBergmann\CodeCoverage::cachesStaticAnalysis()` method for querying whether the cache is enabled -* Added `SebastianBergmann\CodeCoverage\StaticAnalysis\CacheWarmer::warmCache()` method for warming the cache - -## [9.0.0] - 2020-08-07 - -### Added - -* [#761](https://github.com/sebastianbergmann/php-code-coverage/pull/761): Support for Branch Coverage and Path Coverage -* Added `SebastianBergmann\CodeCoverage\Driver\Driver::forLineCoverage()` for selecting the best available driver for line coverage -* Added `SebastianBergmann\CodeCoverage\Driver\Driver::forLineAndPathCoverage()` for selecting the best available driver for path coverage -* This component is now supported on PHP 8 -* This component now supports Xdebug 3 - -### Changed - -* [#746](https://github.com/sebastianbergmann/php-code-coverage/pull/746): Remove some ancient workarounds for very old Xdebug versions -* [#747](https://github.com/sebastianbergmann/php-code-coverage/pull/747): Use native filtering in PCOV and Xdebug drivers -* [#748](https://github.com/sebastianbergmann/php-code-coverage/pull/748): Store raw code coverage in value objects instead of arrays -* [#749](https://github.com/sebastianbergmann/php-code-coverage/pull/749): Store processed code coverage in value objects instead of arrays -* [#752](https://github.com/sebastianbergmann/php-code-coverage/pull/752): Rework how code coverage settings are propagated to the driver -* [#754](https://github.com/sebastianbergmann/php-code-coverage/pull/754): Implement collection of raw branch and path coverage -* [#755](https://github.com/sebastianbergmann/php-code-coverage/pull/755): Implement processing of raw branch and path coverage -* [#756](https://github.com/sebastianbergmann/php-code-coverage/pull/756): Improve handling of uncovered files -* `SebastianBergmann\CodeCoverage\Filter::addDirectoryToWhitelist()` has been renamed to `SebastianBergmann\CodeCoverage\Filter::includeDirectory()` -* `SebastianBergmann\CodeCoverage\Filter::addFilesToWhitelist()` has been renamed to `SebastianBergmann\CodeCoverage\Filter::includeFiles()` -* `SebastianBergmann\CodeCoverage\Filter::addFileToWhitelist()` has been renamed to `SebastianBergmann\CodeCoverage\Filter::includeFile()` -* `SebastianBergmann\CodeCoverage\Filter::removeDirectoryFromWhitelist()` has been renamed to `SebastianBergmann\CodeCoverage\Filter::excludeDirectory()` -* `SebastianBergmann\CodeCoverage\Filter::removeFileFromWhitelist()` has been renamed to `SebastianBergmann\CodeCoverage\Filter::excludeFile()` -* `SebastianBergmann\CodeCoverage\Filter::isFiltered()` has been renamed to `SebastianBergmann\CodeCoverage\Filter::isExcluded()` -* `SebastianBergmann\CodeCoverage\Filter::getWhitelist()` has been renamed to `SebastianBergmann\CodeCoverage\Filter::files()` -* The arguments for `CodeCoverage::__construct()` are no longer optional - -### Fixed - -* [#700](https://github.com/sebastianbergmann/php-code-coverage/pull/700): Throw an exception if code coverage fails to write to disk - -### Removed - -* `SebastianBergmann\CodeCoverage\CodeCoverage::setCacheTokens()` and `SebastianBergmann\CodeCoverage\CodeCoverage::getCacheTokens()` have been removed -* `SebastianBergmann\CodeCoverage\CodeCoverage::setCheckForUnintentionallyCoveredCode()` has been removed, please use `SebastianBergmann\CodeCoverage\CodeCoverage::enableCheckForUnintentionallyCoveredCode()` or `SebastianBergmann\CodeCoverage\CodeCoverage::disableCheckForUnintentionallyCoveredCode()` instead -* `SebastianBergmann\CodeCoverage\CodeCoverage::setSubclassesExcludedFromUnintentionallyCoveredCodeCheck()` has been removed, please use `SebastianBergmann\CodeCoverage\CodeCoverage::excludeSubclassesOfThisClassFromUnintentionallyCoveredCodeCheck()` instead -* `SebastianBergmann\CodeCoverage\CodeCoverage::setAddUncoveredFilesFromWhitelist()` has been removed, please use `SebastianBergmann\CodeCoverage\CodeCoverage::includeUncoveredFiles()` or `SebastianBergmann\CodeCoverage\CodeCoverage::excludeUncoveredFiles()` instead -* `SebastianBergmann\CodeCoverage\CodeCoverage::setProcessUncoveredFiles()` has been removed, please use `SebastianBergmann\CodeCoverage\CodeCoverage::processUncoveredFiles()` or `SebastianBergmann\CodeCoverage\CodeCoverage::doNotProcessUncoveredFiles()` instead -* `SebastianBergmann\CodeCoverage\CodeCoverage::setIgnoreDeprecatedCode()` has been removed, please use `SebastianBergmann\CodeCoverage\CodeCoverage::ignoreDeprecatedCode()` or `SebastianBergmann\CodeCoverage\CodeCoverage::doNotIgnoreDeprecatedCode()` instead -* `SebastianBergmann\CodeCoverage\CodeCoverage::setDisableIgnoredLines()` has been removed, please use `SebastianBergmann\CodeCoverage\CodeCoverage::enableAnnotationsForIgnoringCode()` or `SebastianBergmann\CodeCoverage\CodeCoverage::disableAnnotationsForIgnoringCode()` instead -* `SebastianBergmann\CodeCoverage\CodeCoverage::setCheckForMissingCoversAnnotation()` has been removed -* `SebastianBergmann\CodeCoverage\CodeCoverage::setCheckForUnexecutedCoveredCode()` has been removed -* `SebastianBergmann\CodeCoverage\CodeCoverage::setForceCoversAnnotation()` has been removed -* `SebastianBergmann\CodeCoverage\Filter::hasWhitelist()` has been removed, please use `SebastianBergmann\CodeCoverage\Filter::isEmpty()` instead -* `SebastianBergmann\CodeCoverage\Filter::getWhitelistedFiles()` has been removed -* `SebastianBergmann\CodeCoverage\Filter::setWhitelistedFiles()` has been removed - -## [8.0.2] - 2020-05-23 - -### Fixed - -* [#750](https://github.com/sebastianbergmann/php-code-coverage/pull/750): Inconsistent handling of namespaces -* [#751](https://github.com/sebastianbergmann/php-code-coverage/pull/751): Dead code is not highlighted correctly -* [#753](https://github.com/sebastianbergmann/php-code-coverage/issues/753): Do not use `$_SERVER['REQUEST_TIME']` because the test(ed) code might unset it - -## [8.0.1] - 2020-02-19 - -### Fixed - -* [#731](https://github.com/sebastianbergmann/php-code-coverage/pull/731): Confusing footer in the HTML report - -## [8.0.0] - 2020-02-07 - -### Fixed - -* [#721](https://github.com/sebastianbergmann/php-code-coverage/pull/721): Workaround for PHP bug [#79191](https://bugs.php.net/bug.php?id=79191) - -### Removed - -* This component is no longer supported on PHP 7.2 - -## [7.0.15] - 2021-07-26 - -### Changed - -* Bumped required version of php-token-stream - -## [7.0.14] - 2020-12-02 - -### Changed - -* [#837](https://github.com/sebastianbergmann/php-code-coverage/issues/837): Allow version 4 of php-token-stream - -## [7.0.13] - 2020-11-30 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.2` to `>=7.2` to allow installation of this version of this library on PHP 8. However, this version of this library does not work on PHP 8. PHPUnit 8.5, which uses this version of this library, does not call into this library and instead shows a message that code coverage functionality is not available for PHPUnit 8.5 on PHP 8. - -## [7.0.12] - 2020-11-27 - -### Added - -* [#834](https://github.com/sebastianbergmann/php-code-coverage/issues/834): Support `XDEBUG_MODE` environment variable - -## [7.0.11] - 2020-11-27 - -### Added - -* Support for Xdebug 3 - -## [7.0.10] - 2019-11-20 - -### Fixed - -* [#710](https://github.com/sebastianbergmann/php-code-coverage/pull/710): Code Coverage does not work in PhpStorm - -## [7.0.9] - 2019-11-20 - -### Changed - -* [#709](https://github.com/sebastianbergmann/php-code-coverage/pull/709): Prioritize PCOV over Xdebug - -## [7.0.8] - 2019-09-17 - -### Changed - -* Updated bundled CSS/JavaScript components used for HTML report: Bootstrap 4.3.1, jQuery 3.4.1, and popper.js 1.15.0 - -## [7.0.7] - 2019-07-25 - -### Changed - -* Bumped required version of php-token-stream - -## [7.0.6] - 2019-07-08 - -### Changed - -* Bumped required version of php-token-stream - -## [7.0.5] - 2019-06-06 - -### Fixed - -* [#681](https://github.com/sebastianbergmann/php-code-coverage/pull/681): `use function` statements are not ignored - -## [7.0.4] - 2019-05-29 - -### Fixed - -* [#682](https://github.com/sebastianbergmann/php-code-coverage/pull/682): Code that is not executed is reported as being executed when using PCOV - -## [7.0.3] - 2019-02-26 - -### Fixed - -* [#671](https://github.com/sebastianbergmann/php-code-coverage/issues/671): `TypeError` when directory name is a number - -## [7.0.2] - 2019-02-15 - -### Changed - -* Updated bundled CSS/JavaScript components used for HTML report: Bootstrap 4.3.0 - -### Fixed - -* [#667](https://github.com/sebastianbergmann/php-code-coverage/pull/667): `TypeError` in PHP reporter - -## [7.0.1] - 2019-02-01 - -### Fixed - -* [#664](https://github.com/sebastianbergmann/php-code-coverage/issues/664): `TypeError` when whitelisted file does not exist - -## [7.0.0] - 2019-02-01 - -### Added - -* [#663](https://github.com/sebastianbergmann/php-code-coverage/pull/663): Support for PCOV - -### Fixed - -* [#654](https://github.com/sebastianbergmann/php-code-coverage/issues/654): HTML report fails to load assets -* [#655](https://github.com/sebastianbergmann/php-code-coverage/issues/655): Popin pops in outside of screen - -### Removed - -* This component is no longer supported on PHP 7.1 - -[9.2.22]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.21...9.2.22 -[9.2.21]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.20...9.2.21 -[9.2.20]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.19...9.2.20 -[9.2.19]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.18...9.2.19 -[9.2.18]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.17...9.2.18 -[9.2.17]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.16...9.2.17 -[9.2.16]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.15...9.2.16 -[9.2.15]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.14...9.2.15 -[9.2.14]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.13...9.2.14 -[9.2.13]: https://github.com/sebastianbergmann/php-code-coverage/compare/c011a0b6aaa4acd2f39b7f51fb4ad4442b6ec631...9.2.13 -[9.2.12]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.11...c011a0b6aaa4acd2f39b7f51fb4ad4442b6ec631 -[9.2.11]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.10...9.2.11 -[9.2.10]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.9...9.2.10 -[9.2.9]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.8...9.2.9 -[9.2.8]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.7...9.2.8 -[9.2.7]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.6...9.2.7 -[9.2.6]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.5...9.2.6 -[9.2.5]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.4...9.2.5 -[9.2.4]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.3...9.2.4 -[9.2.3]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.2...9.2.3 -[9.2.2]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.1...9.2.2 -[9.2.1]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.0...9.2.1 -[9.2.0]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.1.11...9.2.0 -[9.1.11]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.1.10...9.1.11 -[9.1.10]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.1.9...9.1.10 -[9.1.9]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.1.8...9.1.9 -[9.1.8]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.1.7...9.1.8 -[9.1.7]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.1.6...9.1.7 -[9.1.6]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.1.5...9.1.6 -[9.1.5]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.1.4...9.1.5 -[9.1.4]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.1.3...9.1.4 -[9.1.3]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.1.2...9.1.3 -[9.1.2]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.1.1...9.1.2 -[9.1.1]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.1.0...9.1.1 -[9.1.0]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.0.0...9.1.0 -[9.0.0]: https://github.com/sebastianbergmann/php-code-coverage/compare/8.0...9.0.0 -[8.0.2]: https://github.com/sebastianbergmann/php-code-coverage/compare/8.0.1...8.0.2 -[8.0.1]: https://github.com/sebastianbergmann/php-code-coverage/compare/8.0.0...8.0.1 -[8.0.0]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.10...8.0.0 -[7.0.15]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.14...7.0.15 -[7.0.14]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.13...7.0.14 -[7.0.13]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.12...7.0.13 -[7.0.12]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.11...7.0.12 -[7.0.11]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.10...7.0.11 -[7.0.10]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.9...7.0.10 -[7.0.9]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.8...7.0.9 -[7.0.8]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.7...7.0.8 -[7.0.7]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.6...7.0.7 -[7.0.6]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.5...7.0.6 -[7.0.5]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.4...7.0.5 -[7.0.4]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.3...7.0.4 -[7.0.3]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.2...7.0.3 -[7.0.2]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.1...7.0.2 -[7.0.1]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.0...7.0.1 -[7.0.0]: https://github.com/sebastianbergmann/php-code-coverage/compare/6.1.4...7.0.0 diff --git a/vendor/phpunit/php-code-coverage/LICENSE b/vendor/phpunit/php-code-coverage/LICENSE deleted file mode 100644 index c4a1db2c..00000000 --- a/vendor/phpunit/php-code-coverage/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -php-code-coverage - -Copyright (c) 2009-2022, Sebastian Bergmann . -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 Sebastian Bergmann nor the names of his - 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/phpunit/php-code-coverage/README.md b/vendor/phpunit/php-code-coverage/README.md deleted file mode 100644 index 53ce9b33..00000000 --- a/vendor/phpunit/php-code-coverage/README.md +++ /dev/null @@ -1,48 +0,0 @@ -# phpunit/php-code-coverage - -[![Latest Stable Version](https://poser.pugx.org/phpunit/php-code-coverage/v/stable.png)](https://packagist.org/packages/phpunit/php-code-coverage) -[![CI Status](https://github.com/sebastianbergmann/php-code-coverage/workflows/CI/badge.svg)](https://github.com/sebastianbergmann/php-code-coverage/actions) -[![Type Coverage](https://shepherd.dev/github/sebastianbergmann/php-code-coverage/coverage.svg)](https://shepherd.dev/github/sebastianbergmann/php-code-coverage) - -Provides collection, processing, and rendering functionality for PHP code coverage information. - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - -``` -composer require phpunit/php-code-coverage -``` - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - -``` -composer require --dev phpunit/php-code-coverage -``` - -## Usage - -```php -includeDirectory('/path/to/directory'); - -$coverage = new CodeCoverage( - (new Selector)->forLineCoverage($filter), - $filter -); - -$coverage->start(''); - -// ... - -$coverage->stop(); - - -(new HtmlReport)->process($coverage, '/tmp/code-coverage-report'); -``` diff --git a/vendor/phpunit/php-code-coverage/composer.json b/vendor/phpunit/php-code-coverage/composer.json deleted file mode 100644 index b09bd647..00000000 --- a/vendor/phpunit/php-code-coverage/composer.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "name": "phpunit/php-code-coverage", - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "type": "library", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues" - }, - "config": { - "platform": { - "php": "7.3.0" - }, - "optimize-autoloader": true, - "sort-packages": true - }, - "prefer-stable": true, - "require": { - "php": ">=7.3", - "ext-dom": "*", - "ext-libxml": "*", - "ext-xmlwriter": "*", - "nikic/php-parser": "^4.14", - "phpunit/php-file-iterator": "^3.0.3", - "phpunit/php-text-template": "^2.0.2", - "sebastian/code-unit-reverse-lookup": "^2.0.2", - "sebastian/complexity": "^2.0", - "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0.3", - "sebastian/version": "^3.0.1", - "theseer/tokenizer": "^1.2.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-pcov": "*", - "ext-xdebug": "*" - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "autoload-dev": { - "files": [ - "tests/TestCase.php", - "tests/_files/BankAccountTest.php" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "9.2-dev" - } - } -} diff --git a/vendor/phpunit/php-code-coverage/src/CodeCoverage.php b/vendor/phpunit/php-code-coverage/src/CodeCoverage.php deleted file mode 100644 index c35f27c8..00000000 --- a/vendor/phpunit/php-code-coverage/src/CodeCoverage.php +++ /dev/null @@ -1,682 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage; - -use function array_diff; -use function array_diff_key; -use function array_flip; -use function array_keys; -use function array_merge; -use function array_unique; -use function array_values; -use function count; -use function explode; -use function get_class; -use function is_array; -use function sort; -use PHPUnit\Framework\TestCase; -use PHPUnit\Runner\PhptTestCase; -use PHPUnit\Util\Test; -use ReflectionClass; -use SebastianBergmann\CodeCoverage\Driver\Driver; -use SebastianBergmann\CodeCoverage\Node\Builder; -use SebastianBergmann\CodeCoverage\Node\Directory; -use SebastianBergmann\CodeCoverage\StaticAnalysis\CachingFileAnalyser; -use SebastianBergmann\CodeCoverage\StaticAnalysis\FileAnalyser; -use SebastianBergmann\CodeCoverage\StaticAnalysis\ParsingFileAnalyser; -use SebastianBergmann\CodeUnitReverseLookup\Wizard; - -/** - * Provides collection functionality for PHP code coverage information. - */ -final class CodeCoverage -{ - private const UNCOVERED_FILES = 'UNCOVERED_FILES'; - - /** - * @var Driver - */ - private $driver; - - /** - * @var Filter - */ - private $filter; - - /** - * @var Wizard - */ - private $wizard; - - /** - * @var bool - */ - private $checkForUnintentionallyCoveredCode = false; - - /** - * @var bool - */ - private $includeUncoveredFiles = true; - - /** - * @var bool - */ - private $processUncoveredFiles = false; - - /** - * @var bool - */ - private $ignoreDeprecatedCode = false; - - /** - * @var null|PhptTestCase|string|TestCase - */ - private $currentId; - - /** - * Code coverage data. - * - * @var ProcessedCodeCoverageData - */ - private $data; - - /** - * @var bool - */ - private $useAnnotationsForIgnoringCode = true; - - /** - * Test data. - * - * @var array - */ - private $tests = []; - - /** - * @psalm-var list - */ - private $parentClassesExcludedFromUnintentionallyCoveredCodeCheck = []; - - /** - * @var ?FileAnalyser - */ - private $analyser; - - /** - * @var ?string - */ - private $cacheDirectory; - - public function __construct(Driver $driver, Filter $filter) - { - $this->driver = $driver; - $this->filter = $filter; - $this->data = new ProcessedCodeCoverageData; - $this->wizard = new Wizard; - } - - /** - * Returns the code coverage information as a graph of node objects. - */ - public function getReport(): Directory - { - return (new Builder($this->analyser()))->build($this); - } - - /** - * Clears collected code coverage data. - */ - public function clear(): void - { - $this->currentId = null; - $this->data = new ProcessedCodeCoverageData; - $this->tests = []; - } - - /** - * Returns the filter object used. - */ - public function filter(): Filter - { - return $this->filter; - } - - /** - * Returns the collected code coverage data. - */ - public function getData(bool $raw = false): ProcessedCodeCoverageData - { - if (!$raw) { - if ($this->processUncoveredFiles) { - $this->processUncoveredFilesFromFilter(); - } elseif ($this->includeUncoveredFiles) { - $this->addUncoveredFilesFromFilter(); - } - } - - return $this->data; - } - - /** - * Sets the coverage data. - */ - public function setData(ProcessedCodeCoverageData $data): void - { - $this->data = $data; - } - - /** - * Returns the test data. - */ - public function getTests(): array - { - return $this->tests; - } - - /** - * Sets the test data. - */ - public function setTests(array $tests): void - { - $this->tests = $tests; - } - - /** - * Start collection of code coverage information. - * - * @param PhptTestCase|string|TestCase $id - */ - public function start($id, bool $clear = false): void - { - if ($clear) { - $this->clear(); - } - - $this->currentId = $id; - - $this->driver->start(); - } - - /** - * Stop collection of code coverage information. - * - * @param array|false $linesToBeCovered - */ - public function stop(bool $append = true, $linesToBeCovered = [], array $linesToBeUsed = []): RawCodeCoverageData - { - if (!is_array($linesToBeCovered) && $linesToBeCovered !== false) { - throw new InvalidArgumentException( - '$linesToBeCovered must be an array or false' - ); - } - - $data = $this->driver->stop(); - $this->append($data, null, $append, $linesToBeCovered, $linesToBeUsed); - - $this->currentId = null; - - return $data; - } - - /** - * Appends code coverage data. - * - * @param PhptTestCase|string|TestCase $id - * @param array|false $linesToBeCovered - * - * @throws ReflectionException - * @throws TestIdMissingException - * @throws UnintentionallyCoveredCodeException - */ - public function append(RawCodeCoverageData $rawData, $id = null, bool $append = true, $linesToBeCovered = [], array $linesToBeUsed = []): void - { - if ($id === null) { - $id = $this->currentId; - } - - if ($id === null) { - throw new TestIdMissingException; - } - - $this->applyFilter($rawData); - - $this->applyExecutableLinesFilter($rawData); - - if ($this->useAnnotationsForIgnoringCode) { - $this->applyIgnoredLinesFilter($rawData); - } - - $this->data->initializeUnseenData($rawData); - - if (!$append) { - return; - } - - if ($id !== self::UNCOVERED_FILES) { - $this->applyCoversAnnotationFilter( - $rawData, - $linesToBeCovered, - $linesToBeUsed - ); - - if (empty($rawData->lineCoverage())) { - return; - } - - $size = 'unknown'; - $status = -1; - $fromTestcase = false; - - if ($id instanceof TestCase) { - $fromTestcase = true; - $_size = $id->getSize(); - - if ($_size === Test::SMALL) { - $size = 'small'; - } elseif ($_size === Test::MEDIUM) { - $size = 'medium'; - } elseif ($_size === Test::LARGE) { - $size = 'large'; - } - - $status = $id->getStatus(); - $id = get_class($id) . '::' . $id->getName(); - } elseif ($id instanceof PhptTestCase) { - $fromTestcase = true; - $size = 'large'; - $id = $id->getName(); - } - - $this->tests[$id] = ['size' => $size, 'status' => $status, 'fromTestcase' => $fromTestcase]; - - $this->data->markCodeAsExecutedByTestCase($id, $rawData); - } - } - - /** - * Merges the data from another instance. - */ - public function merge(self $that): void - { - $this->filter->includeFiles( - $that->filter()->files() - ); - - $this->data->merge($that->data); - - $this->tests = array_merge($this->tests, $that->getTests()); - } - - public function enableCheckForUnintentionallyCoveredCode(): void - { - $this->checkForUnintentionallyCoveredCode = true; - } - - public function disableCheckForUnintentionallyCoveredCode(): void - { - $this->checkForUnintentionallyCoveredCode = false; - } - - public function includeUncoveredFiles(): void - { - $this->includeUncoveredFiles = true; - } - - public function excludeUncoveredFiles(): void - { - $this->includeUncoveredFiles = false; - } - - public function processUncoveredFiles(): void - { - $this->processUncoveredFiles = true; - } - - public function doNotProcessUncoveredFiles(): void - { - $this->processUncoveredFiles = false; - } - - public function enableAnnotationsForIgnoringCode(): void - { - $this->useAnnotationsForIgnoringCode = true; - } - - public function disableAnnotationsForIgnoringCode(): void - { - $this->useAnnotationsForIgnoringCode = false; - } - - public function ignoreDeprecatedCode(): void - { - $this->ignoreDeprecatedCode = true; - } - - public function doNotIgnoreDeprecatedCode(): void - { - $this->ignoreDeprecatedCode = false; - } - - /** - * @psalm-assert-if-true !null $this->cacheDirectory - */ - public function cachesStaticAnalysis(): bool - { - return $this->cacheDirectory !== null; - } - - public function cacheStaticAnalysis(string $directory): void - { - $this->cacheDirectory = $directory; - } - - public function doNotCacheStaticAnalysis(): void - { - $this->cacheDirectory = null; - } - - /** - * @throws StaticAnalysisCacheNotConfiguredException - */ - public function cacheDirectory(): string - { - if (!$this->cachesStaticAnalysis()) { - throw new StaticAnalysisCacheNotConfiguredException( - 'The static analysis cache is not configured' - ); - } - - return $this->cacheDirectory; - } - - /** - * @psalm-param class-string $className - */ - public function excludeSubclassesOfThisClassFromUnintentionallyCoveredCodeCheck(string $className): void - { - $this->parentClassesExcludedFromUnintentionallyCoveredCodeCheck[] = $className; - } - - public function enableBranchAndPathCoverage(): void - { - $this->driver->enableBranchAndPathCoverage(); - } - - public function disableBranchAndPathCoverage(): void - { - $this->driver->disableBranchAndPathCoverage(); - } - - public function collectsBranchAndPathCoverage(): bool - { - return $this->driver->collectsBranchAndPathCoverage(); - } - - public function detectsDeadCode(): bool - { - return $this->driver->detectsDeadCode(); - } - - /** - * Applies the @covers annotation filtering. - * - * @param array|false $linesToBeCovered - * - * @throws ReflectionException - * @throws UnintentionallyCoveredCodeException - */ - private function applyCoversAnnotationFilter(RawCodeCoverageData $rawData, $linesToBeCovered, array $linesToBeUsed): void - { - if ($linesToBeCovered === false) { - $rawData->clear(); - - return; - } - - if (empty($linesToBeCovered)) { - return; - } - - if ($this->checkForUnintentionallyCoveredCode && - (!$this->currentId instanceof TestCase || - (!$this->currentId->isMedium() && !$this->currentId->isLarge()))) { - $this->performUnintentionallyCoveredCodeCheck($rawData, $linesToBeCovered, $linesToBeUsed); - } - - $rawLineData = $rawData->lineCoverage(); - $filesWithNoCoverage = array_diff_key($rawLineData, $linesToBeCovered); - - foreach (array_keys($filesWithNoCoverage) as $fileWithNoCoverage) { - $rawData->removeCoverageDataForFile($fileWithNoCoverage); - } - - if (is_array($linesToBeCovered)) { - foreach ($linesToBeCovered as $fileToBeCovered => $includedLines) { - $rawData->keepLineCoverageDataOnlyForLines($fileToBeCovered, $includedLines); - $rawData->keepFunctionCoverageDataOnlyForLines($fileToBeCovered, $includedLines); - } - } - } - - private function applyFilter(RawCodeCoverageData $data): void - { - if ($this->filter->isEmpty()) { - return; - } - - foreach (array_keys($data->lineCoverage()) as $filename) { - if ($this->filter->isExcluded($filename)) { - $data->removeCoverageDataForFile($filename); - } - } - } - - private function applyExecutableLinesFilter(RawCodeCoverageData $data): void - { - foreach (array_keys($data->lineCoverage()) as $filename) { - if (!$this->filter->isFile($filename)) { - continue; - } - - $linesToBranchMap = $this->analyser()->executableLinesIn($filename); - - $data->keepLineCoverageDataOnlyForLines( - $filename, - array_keys($linesToBranchMap) - ); - - $data->markExecutableLineByBranch( - $filename, - $linesToBranchMap - ); - } - } - - private function applyIgnoredLinesFilter(RawCodeCoverageData $data): void - { - foreach (array_keys($data->lineCoverage()) as $filename) { - if (!$this->filter->isFile($filename)) { - continue; - } - - $data->removeCoverageDataForLines( - $filename, - $this->analyser()->ignoredLinesFor($filename) - ); - } - } - - /** - * @throws UnintentionallyCoveredCodeException - */ - private function addUncoveredFilesFromFilter(): void - { - $uncoveredFiles = array_diff( - $this->filter->files(), - $this->data->coveredFiles() - ); - - foreach ($uncoveredFiles as $uncoveredFile) { - if ($this->filter->isFile($uncoveredFile)) { - $this->append( - RawCodeCoverageData::fromUncoveredFile( - $uncoveredFile, - $this->analyser() - ), - self::UNCOVERED_FILES - ); - } - } - } - - /** - * @throws UnintentionallyCoveredCodeException - */ - private function processUncoveredFilesFromFilter(): void - { - $uncoveredFiles = array_diff( - $this->filter->files(), - $this->data->coveredFiles() - ); - - $this->driver->start(); - - foreach ($uncoveredFiles as $uncoveredFile) { - if ($this->filter->isFile($uncoveredFile)) { - include_once $uncoveredFile; - } - } - - $this->append($this->driver->stop(), self::UNCOVERED_FILES); - } - - /** - * @throws ReflectionException - * @throws UnintentionallyCoveredCodeException - */ - private function performUnintentionallyCoveredCodeCheck(RawCodeCoverageData $data, array $linesToBeCovered, array $linesToBeUsed): void - { - $allowedLines = $this->getAllowedLines( - $linesToBeCovered, - $linesToBeUsed - ); - - $unintentionallyCoveredUnits = []; - - foreach ($data->lineCoverage() as $file => $_data) { - foreach ($_data as $line => $flag) { - if ($flag === 1 && !isset($allowedLines[$file][$line])) { - $unintentionallyCoveredUnits[] = $this->wizard->lookup($file, $line); - } - } - } - - $unintentionallyCoveredUnits = $this->processUnintentionallyCoveredUnits($unintentionallyCoveredUnits); - - if (!empty($unintentionallyCoveredUnits)) { - throw new UnintentionallyCoveredCodeException( - $unintentionallyCoveredUnits - ); - } - } - - private function getAllowedLines(array $linesToBeCovered, array $linesToBeUsed): array - { - $allowedLines = []; - - foreach (array_keys($linesToBeCovered) as $file) { - if (!isset($allowedLines[$file])) { - $allowedLines[$file] = []; - } - - $allowedLines[$file] = array_merge( - $allowedLines[$file], - $linesToBeCovered[$file] - ); - } - - foreach (array_keys($linesToBeUsed) as $file) { - if (!isset($allowedLines[$file])) { - $allowedLines[$file] = []; - } - - $allowedLines[$file] = array_merge( - $allowedLines[$file], - $linesToBeUsed[$file] - ); - } - - foreach (array_keys($allowedLines) as $file) { - $allowedLines[$file] = array_flip( - array_unique($allowedLines[$file]) - ); - } - - return $allowedLines; - } - - /** - * @throws ReflectionException - */ - private function processUnintentionallyCoveredUnits(array $unintentionallyCoveredUnits): array - { - $unintentionallyCoveredUnits = array_unique($unintentionallyCoveredUnits); - sort($unintentionallyCoveredUnits); - - foreach (array_keys($unintentionallyCoveredUnits) as $k => $v) { - $unit = explode('::', $unintentionallyCoveredUnits[$k]); - - if (count($unit) !== 2) { - continue; - } - - try { - $class = new ReflectionClass($unit[0]); - - foreach ($this->parentClassesExcludedFromUnintentionallyCoveredCodeCheck as $parentClass) { - if ($class->isSubclassOf($parentClass)) { - unset($unintentionallyCoveredUnits[$k]); - - break; - } - } - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - } - - return array_values($unintentionallyCoveredUnits); - } - - private function analyser(): FileAnalyser - { - if ($this->analyser !== null) { - return $this->analyser; - } - - $this->analyser = new ParsingFileAnalyser( - $this->useAnnotationsForIgnoringCode, - $this->ignoreDeprecatedCode - ); - - if ($this->cachesStaticAnalysis()) { - $this->analyser = new CachingFileAnalyser( - $this->cacheDirectory, - $this->analyser - ); - } - - return $this->analyser; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Driver/Driver.php b/vendor/phpunit/php-code-coverage/src/Driver/Driver.php deleted file mode 100644 index dc2de68f..00000000 --- a/vendor/phpunit/php-code-coverage/src/Driver/Driver.php +++ /dev/null @@ -1,167 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Driver; - -use function sprintf; -use SebastianBergmann\CodeCoverage\BranchAndPathCoverageNotSupportedException; -use SebastianBergmann\CodeCoverage\DeadCodeDetectionNotSupportedException; -use SebastianBergmann\CodeCoverage\Filter; -use SebastianBergmann\CodeCoverage\NoCodeCoverageDriverAvailableException; -use SebastianBergmann\CodeCoverage\NoCodeCoverageDriverWithPathCoverageSupportAvailableException; -use SebastianBergmann\CodeCoverage\RawCodeCoverageData; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -abstract class Driver -{ - /** - * @var int - * - * @see http://xdebug.org/docs/code_coverage - */ - public const LINE_NOT_EXECUTABLE = -2; - - /** - * @var int - * - * @see http://xdebug.org/docs/code_coverage - */ - public const LINE_NOT_EXECUTED = -1; - - /** - * @var int - * - * @see http://xdebug.org/docs/code_coverage - */ - public const LINE_EXECUTED = 1; - - /** - * @var int - * - * @see http://xdebug.org/docs/code_coverage - */ - public const BRANCH_NOT_HIT = 0; - - /** - * @var int - * - * @see http://xdebug.org/docs/code_coverage - */ - public const BRANCH_HIT = 1; - - /** - * @var bool - */ - private $collectBranchAndPathCoverage = false; - - /** - * @var bool - */ - private $detectDeadCode = false; - - /** - * @throws NoCodeCoverageDriverAvailableException - * @throws PcovNotAvailableException - * @throws PhpdbgNotAvailableException - * @throws Xdebug2NotEnabledException - * @throws Xdebug3NotEnabledException - * @throws XdebugNotAvailableException - * - * @deprecated Use DriverSelector::forLineCoverage() instead - */ - public static function forLineCoverage(Filter $filter): self - { - return (new Selector)->forLineCoverage($filter); - } - - /** - * @throws NoCodeCoverageDriverWithPathCoverageSupportAvailableException - * @throws Xdebug2NotEnabledException - * @throws Xdebug3NotEnabledException - * @throws XdebugNotAvailableException - * - * @deprecated Use DriverSelector::forLineAndPathCoverage() instead - */ - public static function forLineAndPathCoverage(Filter $filter): self - { - return (new Selector)->forLineAndPathCoverage($filter); - } - - public function canCollectBranchAndPathCoverage(): bool - { - return false; - } - - public function collectsBranchAndPathCoverage(): bool - { - return $this->collectBranchAndPathCoverage; - } - - /** - * @throws BranchAndPathCoverageNotSupportedException - */ - public function enableBranchAndPathCoverage(): void - { - if (!$this->canCollectBranchAndPathCoverage()) { - throw new BranchAndPathCoverageNotSupportedException( - sprintf( - '%s does not support branch and path coverage', - $this->nameAndVersion() - ) - ); - } - - $this->collectBranchAndPathCoverage = true; - } - - public function disableBranchAndPathCoverage(): void - { - $this->collectBranchAndPathCoverage = false; - } - - public function canDetectDeadCode(): bool - { - return false; - } - - public function detectsDeadCode(): bool - { - return $this->detectDeadCode; - } - - /** - * @throws DeadCodeDetectionNotSupportedException - */ - public function enableDeadCodeDetection(): void - { - if (!$this->canDetectDeadCode()) { - throw new DeadCodeDetectionNotSupportedException( - sprintf( - '%s does not support dead code detection', - $this->nameAndVersion() - ) - ); - } - - $this->detectDeadCode = true; - } - - public function disableDeadCodeDetection(): void - { - $this->detectDeadCode = false; - } - - abstract public function nameAndVersion(): string; - - abstract public function start(): void; - - abstract public function stop(): RawCodeCoverageData; -} diff --git a/vendor/phpunit/php-code-coverage/src/Driver/PcovDriver.php b/vendor/phpunit/php-code-coverage/src/Driver/PcovDriver.php deleted file mode 100644 index c30b30c4..00000000 --- a/vendor/phpunit/php-code-coverage/src/Driver/PcovDriver.php +++ /dev/null @@ -1,75 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Driver; - -use const pcov\inclusive; -use function array_intersect; -use function extension_loaded; -use function pcov\clear; -use function pcov\collect; -use function pcov\start; -use function pcov\stop; -use function pcov\waiting; -use function phpversion; -use SebastianBergmann\CodeCoverage\Filter; -use SebastianBergmann\CodeCoverage\RawCodeCoverageData; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -final class PcovDriver extends Driver -{ - /** - * @var Filter - */ - private $filter; - - /** - * @throws PcovNotAvailableException - */ - public function __construct(Filter $filter) - { - if (!extension_loaded('pcov')) { - throw new PcovNotAvailableException; - } - - $this->filter = $filter; - } - - public function start(): void - { - start(); - } - - public function stop(): RawCodeCoverageData - { - stop(); - - $filesToCollectCoverageFor = waiting(); - $collected = []; - - if ($filesToCollectCoverageFor) { - if (!$this->filter->isEmpty()) { - $filesToCollectCoverageFor = array_intersect($filesToCollectCoverageFor, $this->filter->files()); - } - - $collected = collect(inclusive, $filesToCollectCoverageFor); - - clear(); - } - - return RawCodeCoverageData::fromXdebugWithoutPathCoverage($collected); - } - - public function nameAndVersion(): string - { - return 'PCOV ' . phpversion('pcov'); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Driver/PhpdbgDriver.php b/vendor/phpunit/php-code-coverage/src/Driver/PhpdbgDriver.php deleted file mode 100644 index 7ee13b00..00000000 --- a/vendor/phpunit/php-code-coverage/src/Driver/PhpdbgDriver.php +++ /dev/null @@ -1,93 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Driver; - -use const PHP_SAPI; -use const PHP_VERSION; -use function array_diff; -use function array_keys; -use function array_merge; -use function get_included_files; -use function phpdbg_end_oplog; -use function phpdbg_get_executable; -use function phpdbg_start_oplog; -use SebastianBergmann\CodeCoverage\RawCodeCoverageData; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -final class PhpdbgDriver extends Driver -{ - /** - * @throws PhpdbgNotAvailableException - */ - public function __construct() - { - if (PHP_SAPI !== 'phpdbg') { - throw new PhpdbgNotAvailableException; - } - } - - public function start(): void - { - phpdbg_start_oplog(); - } - - public function stop(): RawCodeCoverageData - { - static $fetchedLines = []; - - $dbgData = phpdbg_end_oplog(); - - if ($fetchedLines === []) { - $sourceLines = phpdbg_get_executable(); - } else { - $newFiles = array_diff(get_included_files(), array_keys($fetchedLines)); - - $sourceLines = []; - - if ($newFiles) { - $sourceLines = phpdbg_get_executable(['files' => $newFiles]); - } - } - - foreach ($sourceLines as $file => $lines) { - foreach ($lines as $lineNo => $numExecuted) { - $sourceLines[$file][$lineNo] = self::LINE_NOT_EXECUTED; - } - } - - $fetchedLines = array_merge($fetchedLines, $sourceLines); - - return RawCodeCoverageData::fromXdebugWithoutPathCoverage( - $this->detectExecutedLines($fetchedLines, $dbgData) - ); - } - - public function nameAndVersion(): string - { - return 'PHPDBG ' . PHP_VERSION; - } - - private function detectExecutedLines(array $sourceLines, array $dbgData): array - { - foreach ($dbgData as $file => $coveredLines) { - foreach ($coveredLines as $lineNo => $numExecuted) { - // phpdbg also reports $lineNo=0 when e.g. exceptions get thrown. - // make sure we only mark lines executed which are actually executable. - if (isset($sourceLines[$file][$lineNo])) { - $sourceLines[$file][$lineNo] = self::LINE_EXECUTED; - } - } - } - - return $sourceLines; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Driver/Selector.php b/vendor/phpunit/php-code-coverage/src/Driver/Selector.php deleted file mode 100644 index 936ee898..00000000 --- a/vendor/phpunit/php-code-coverage/src/Driver/Selector.php +++ /dev/null @@ -1,79 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Driver; - -use function phpversion; -use function version_compare; -use SebastianBergmann\CodeCoverage\Filter; -use SebastianBergmann\CodeCoverage\NoCodeCoverageDriverAvailableException; -use SebastianBergmann\CodeCoverage\NoCodeCoverageDriverWithPathCoverageSupportAvailableException; -use SebastianBergmann\Environment\Runtime; - -final class Selector -{ - /** - * @throws NoCodeCoverageDriverAvailableException - * @throws PcovNotAvailableException - * @throws PhpdbgNotAvailableException - * @throws Xdebug2NotEnabledException - * @throws Xdebug3NotEnabledException - * @throws XdebugNotAvailableException - */ - public function forLineCoverage(Filter $filter): Driver - { - $runtime = new Runtime; - - if ($runtime->hasPHPDBGCodeCoverage()) { - return new PhpdbgDriver; - } - - if ($runtime->hasPCOV()) { - return new PcovDriver($filter); - } - - if ($runtime->hasXdebug()) { - if (version_compare(phpversion('xdebug'), '3', '>=')) { - $driver = new Xdebug3Driver($filter); - } else { - $driver = new Xdebug2Driver($filter); - } - - $driver->enableDeadCodeDetection(); - - return $driver; - } - - throw new NoCodeCoverageDriverAvailableException; - } - - /** - * @throws NoCodeCoverageDriverWithPathCoverageSupportAvailableException - * @throws Xdebug2NotEnabledException - * @throws Xdebug3NotEnabledException - * @throws XdebugNotAvailableException - */ - public function forLineAndPathCoverage(Filter $filter): Driver - { - if ((new Runtime)->hasXdebug()) { - if (version_compare(phpversion('xdebug'), '3', '>=')) { - $driver = new Xdebug3Driver($filter); - } else { - $driver = new Xdebug2Driver($filter); - } - - $driver->enableDeadCodeDetection(); - $driver->enableBranchAndPathCoverage(); - - return $driver; - } - - throw new NoCodeCoverageDriverWithPathCoverageSupportAvailableException; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Driver/Xdebug2Driver.php b/vendor/phpunit/php-code-coverage/src/Driver/Xdebug2Driver.php deleted file mode 100644 index 74cbbfbc..00000000 --- a/vendor/phpunit/php-code-coverage/src/Driver/Xdebug2Driver.php +++ /dev/null @@ -1,128 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Driver; - -use const XDEBUG_CC_BRANCH_CHECK; -use const XDEBUG_CC_DEAD_CODE; -use const XDEBUG_CC_UNUSED; -use const XDEBUG_FILTER_CODE_COVERAGE; -use const XDEBUG_PATH_INCLUDE; -use const XDEBUG_PATH_WHITELIST; -use function defined; -use function extension_loaded; -use function ini_get; -use function phpversion; -use function sprintf; -use function version_compare; -use function xdebug_get_code_coverage; -use function xdebug_set_filter; -use function xdebug_start_code_coverage; -use function xdebug_stop_code_coverage; -use SebastianBergmann\CodeCoverage\Filter; -use SebastianBergmann\CodeCoverage\RawCodeCoverageData; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -final class Xdebug2Driver extends Driver -{ - /** - * @var bool - */ - private $pathCoverageIsMixedCoverage; - - /** - * @throws WrongXdebugVersionException - * @throws Xdebug2NotEnabledException - * @throws XdebugNotAvailableException - */ - public function __construct(Filter $filter) - { - if (!extension_loaded('xdebug')) { - throw new XdebugNotAvailableException; - } - - if (version_compare(phpversion('xdebug'), '3', '>=')) { - throw new WrongXdebugVersionException( - sprintf( - 'This driver requires Xdebug 2 but version %s is loaded', - phpversion('xdebug') - ) - ); - } - - if (!ini_get('xdebug.coverage_enable')) { - throw new Xdebug2NotEnabledException; - } - - if (!$filter->isEmpty()) { - if (defined('XDEBUG_PATH_WHITELIST')) { - $listType = XDEBUG_PATH_WHITELIST; - } else { - $listType = XDEBUG_PATH_INCLUDE; - } - - xdebug_set_filter( - XDEBUG_FILTER_CODE_COVERAGE, - $listType, - $filter->files() - ); - } - - $this->pathCoverageIsMixedCoverage = version_compare(phpversion('xdebug'), '2.9.6', '<'); - } - - public function canCollectBranchAndPathCoverage(): bool - { - return true; - } - - public function canDetectDeadCode(): bool - { - return true; - } - - public function start(): void - { - $flags = XDEBUG_CC_UNUSED; - - if ($this->detectsDeadCode() || $this->collectsBranchAndPathCoverage()) { - $flags |= XDEBUG_CC_DEAD_CODE; - } - - if ($this->collectsBranchAndPathCoverage()) { - $flags |= XDEBUG_CC_BRANCH_CHECK; - } - - xdebug_start_code_coverage($flags); - } - - public function stop(): RawCodeCoverageData - { - $data = xdebug_get_code_coverage(); - - xdebug_stop_code_coverage(); - - if ($this->collectsBranchAndPathCoverage()) { - if ($this->pathCoverageIsMixedCoverage) { - return RawCodeCoverageData::fromXdebugWithMixedCoverage($data); - } - - return RawCodeCoverageData::fromXdebugWithPathCoverage($data); - } - - return RawCodeCoverageData::fromXdebugWithoutPathCoverage($data); - } - - public function nameAndVersion(): string - { - return 'Xdebug ' . phpversion('xdebug'); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Driver/Xdebug3Driver.php b/vendor/phpunit/php-code-coverage/src/Driver/Xdebug3Driver.php deleted file mode 100644 index b85db403..00000000 --- a/vendor/phpunit/php-code-coverage/src/Driver/Xdebug3Driver.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 SebastianBergmann\CodeCoverage\Driver; - -use const XDEBUG_CC_BRANCH_CHECK; -use const XDEBUG_CC_DEAD_CODE; -use const XDEBUG_CC_UNUSED; -use const XDEBUG_FILTER_CODE_COVERAGE; -use const XDEBUG_PATH_INCLUDE; -use function explode; -use function extension_loaded; -use function getenv; -use function in_array; -use function ini_get; -use function phpversion; -use function sprintf; -use function version_compare; -use function xdebug_get_code_coverage; -use function xdebug_set_filter; -use function xdebug_start_code_coverage; -use function xdebug_stop_code_coverage; -use SebastianBergmann\CodeCoverage\Filter; -use SebastianBergmann\CodeCoverage\RawCodeCoverageData; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -final class Xdebug3Driver extends Driver -{ - /** - * @throws WrongXdebugVersionException - * @throws Xdebug3NotEnabledException - * @throws XdebugNotAvailableException - */ - public function __construct(Filter $filter) - { - if (!extension_loaded('xdebug')) { - throw new XdebugNotAvailableException; - } - - if (version_compare(phpversion('xdebug'), '3', '<')) { - throw new WrongXdebugVersionException( - sprintf( - 'This driver requires Xdebug 3 but version %s is loaded', - phpversion('xdebug') - ) - ); - } - - $mode = getenv('XDEBUG_MODE'); - - if ($mode === false || $mode === '') { - $mode = ini_get('xdebug.mode'); - } - - if ($mode === false || - !in_array('coverage', explode(',', $mode), true)) { - throw new Xdebug3NotEnabledException; - } - - if (!$filter->isEmpty()) { - xdebug_set_filter( - XDEBUG_FILTER_CODE_COVERAGE, - XDEBUG_PATH_INCLUDE, - $filter->files() - ); - } - } - - public function canCollectBranchAndPathCoverage(): bool - { - return true; - } - - public function canDetectDeadCode(): bool - { - return true; - } - - public function start(): void - { - $flags = XDEBUG_CC_UNUSED; - - if ($this->detectsDeadCode() || $this->collectsBranchAndPathCoverage()) { - $flags |= XDEBUG_CC_DEAD_CODE; - } - - if ($this->collectsBranchAndPathCoverage()) { - $flags |= XDEBUG_CC_BRANCH_CHECK; - } - - xdebug_start_code_coverage($flags); - } - - public function stop(): RawCodeCoverageData - { - $data = xdebug_get_code_coverage(); - - xdebug_stop_code_coverage(); - - if ($this->collectsBranchAndPathCoverage()) { - return RawCodeCoverageData::fromXdebugWithPathCoverage($data); - } - - return RawCodeCoverageData::fromXdebugWithoutPathCoverage($data); - } - - public function nameAndVersion(): string - { - return 'Xdebug ' . phpversion('xdebug'); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Exception/BranchAndPathCoverageNotSupportedException.php b/vendor/phpunit/php-code-coverage/src/Exception/BranchAndPathCoverageNotSupportedException.php deleted file mode 100644 index ab208919..00000000 --- a/vendor/phpunit/php-code-coverage/src/Exception/BranchAndPathCoverageNotSupportedException.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. - */ -namespace SebastianBergmann\CodeCoverage; - -use RuntimeException; - -final class BranchAndPathCoverageNotSupportedException extends RuntimeException implements Exception -{ -} diff --git a/vendor/phpunit/php-code-coverage/src/Exception/DeadCodeDetectionNotSupportedException.php b/vendor/phpunit/php-code-coverage/src/Exception/DeadCodeDetectionNotSupportedException.php deleted file mode 100644 index d3600648..00000000 --- a/vendor/phpunit/php-code-coverage/src/Exception/DeadCodeDetectionNotSupportedException.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. - */ -namespace SebastianBergmann\CodeCoverage; - -use RuntimeException; - -final class DeadCodeDetectionNotSupportedException extends RuntimeException implements Exception -{ -} diff --git a/vendor/phpunit/php-code-coverage/src/Exception/DirectoryCouldNotBeCreatedException.php b/vendor/phpunit/php-code-coverage/src/Exception/DirectoryCouldNotBeCreatedException.php deleted file mode 100644 index fdd9bfdf..00000000 --- a/vendor/phpunit/php-code-coverage/src/Exception/DirectoryCouldNotBeCreatedException.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Util; - -use RuntimeException; -use SebastianBergmann\CodeCoverage\Exception; - -final class DirectoryCouldNotBeCreatedException extends RuntimeException implements Exception -{ -} diff --git a/vendor/phpunit/php-code-coverage/src/Exception/Exception.php b/vendor/phpunit/php-code-coverage/src/Exception/Exception.php deleted file mode 100644 index 28dc48b8..00000000 --- a/vendor/phpunit/php-code-coverage/src/Exception/Exception.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. - */ -namespace SebastianBergmann\CodeCoverage; - -use Throwable; - -interface Exception extends Throwable -{ -} diff --git a/vendor/phpunit/php-code-coverage/src/Exception/InvalidArgumentException.php b/vendor/phpunit/php-code-coverage/src/Exception/InvalidArgumentException.php deleted file mode 100644 index 17e4b707..00000000 --- a/vendor/phpunit/php-code-coverage/src/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage; - -final class InvalidArgumentException extends \InvalidArgumentException implements Exception -{ -} diff --git a/vendor/phpunit/php-code-coverage/src/Exception/NoCodeCoverageDriverAvailableException.php b/vendor/phpunit/php-code-coverage/src/Exception/NoCodeCoverageDriverAvailableException.php deleted file mode 100644 index b1494e26..00000000 --- a/vendor/phpunit/php-code-coverage/src/Exception/NoCodeCoverageDriverAvailableException.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. - */ -namespace SebastianBergmann\CodeCoverage; - -use RuntimeException; - -final class NoCodeCoverageDriverAvailableException extends RuntimeException implements Exception -{ - public function __construct() - { - parent::__construct('No code coverage driver available'); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Exception/NoCodeCoverageDriverWithPathCoverageSupportAvailableException.php b/vendor/phpunit/php-code-coverage/src/Exception/NoCodeCoverageDriverWithPathCoverageSupportAvailableException.php deleted file mode 100644 index 0065b740..00000000 --- a/vendor/phpunit/php-code-coverage/src/Exception/NoCodeCoverageDriverWithPathCoverageSupportAvailableException.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. - */ -namespace SebastianBergmann\CodeCoverage; - -use RuntimeException; - -final class NoCodeCoverageDriverWithPathCoverageSupportAvailableException extends RuntimeException implements Exception -{ - public function __construct() - { - parent::__construct('No code coverage driver with path coverage support available'); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Exception/ParserException.php b/vendor/phpunit/php-code-coverage/src/Exception/ParserException.php deleted file mode 100644 index a907e34e..00000000 --- a/vendor/phpunit/php-code-coverage/src/Exception/ParserException.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. - */ -namespace SebastianBergmann\CodeCoverage; - -use RuntimeException; - -final class ParserException extends RuntimeException implements Exception -{ -} diff --git a/vendor/phpunit/php-code-coverage/src/Exception/PathExistsButIsNotDirectoryException.php b/vendor/phpunit/php-code-coverage/src/Exception/PathExistsButIsNotDirectoryException.php deleted file mode 100644 index 54bd73f5..00000000 --- a/vendor/phpunit/php-code-coverage/src/Exception/PathExistsButIsNotDirectoryException.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Driver; - -use function sprintf; -use RuntimeException; -use SebastianBergmann\CodeCoverage\Exception; - -final class PathExistsButIsNotDirectoryException extends RuntimeException implements Exception -{ - public function __construct(string $path) - { - parent::__construct(sprintf('"%s" exists but is not a directory', $path)); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Exception/PcovNotAvailableException.php b/vendor/phpunit/php-code-coverage/src/Exception/PcovNotAvailableException.php deleted file mode 100644 index 2f0a66e5..00000000 --- a/vendor/phpunit/php-code-coverage/src/Exception/PcovNotAvailableException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Driver; - -use RuntimeException; -use SebastianBergmann\CodeCoverage\Exception; - -final class PcovNotAvailableException extends RuntimeException implements Exception -{ - public function __construct() - { - parent::__construct('The PCOV extension is not available'); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Exception/PhpdbgNotAvailableException.php b/vendor/phpunit/php-code-coverage/src/Exception/PhpdbgNotAvailableException.php deleted file mode 100644 index bfb183d5..00000000 --- a/vendor/phpunit/php-code-coverage/src/Exception/PhpdbgNotAvailableException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Driver; - -use RuntimeException; -use SebastianBergmann\CodeCoverage\Exception; - -final class PhpdbgNotAvailableException extends RuntimeException implements Exception -{ - public function __construct() - { - parent::__construct('The PHPDBG SAPI is not available'); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Exception/ReflectionException.php b/vendor/phpunit/php-code-coverage/src/Exception/ReflectionException.php deleted file mode 100644 index 78db430b..00000000 --- a/vendor/phpunit/php-code-coverage/src/Exception/ReflectionException.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. - */ -namespace SebastianBergmann\CodeCoverage; - -use RuntimeException; - -final class ReflectionException extends RuntimeException implements Exception -{ -} diff --git a/vendor/phpunit/php-code-coverage/src/Exception/ReportAlreadyFinalizedException.php b/vendor/phpunit/php-code-coverage/src/Exception/ReportAlreadyFinalizedException.php deleted file mode 100644 index 0481f161..00000000 --- a/vendor/phpunit/php-code-coverage/src/Exception/ReportAlreadyFinalizedException.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. - */ -namespace SebastianBergmann\CodeCoverage; - -use RuntimeException; - -final class ReportAlreadyFinalizedException extends RuntimeException implements Exception -{ - public function __construct() - { - parent::__construct('The code coverage report has already been finalized'); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Exception/StaticAnalysisCacheNotConfiguredException.php b/vendor/phpunit/php-code-coverage/src/Exception/StaticAnalysisCacheNotConfiguredException.php deleted file mode 100644 index fd58fd6b..00000000 --- a/vendor/phpunit/php-code-coverage/src/Exception/StaticAnalysisCacheNotConfiguredException.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. - */ -namespace SebastianBergmann\CodeCoverage; - -use RuntimeException; - -final class StaticAnalysisCacheNotConfiguredException extends RuntimeException implements Exception -{ -} diff --git a/vendor/phpunit/php-code-coverage/src/Exception/TestIdMissingException.php b/vendor/phpunit/php-code-coverage/src/Exception/TestIdMissingException.php deleted file mode 100644 index 4cc3e0c2..00000000 --- a/vendor/phpunit/php-code-coverage/src/Exception/TestIdMissingException.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. - */ -namespace SebastianBergmann\CodeCoverage; - -use RuntimeException; - -final class TestIdMissingException extends RuntimeException implements Exception -{ - public function __construct() - { - parent::__construct('Test ID is missing'); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Exception/UnintentionallyCoveredCodeException.php b/vendor/phpunit/php-code-coverage/src/Exception/UnintentionallyCoveredCodeException.php deleted file mode 100644 index cb7a975f..00000000 --- a/vendor/phpunit/php-code-coverage/src/Exception/UnintentionallyCoveredCodeException.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 SebastianBergmann\CodeCoverage; - -use RuntimeException; - -final class UnintentionallyCoveredCodeException extends RuntimeException implements Exception -{ - /** - * @var array - */ - private $unintentionallyCoveredUnits; - - public function __construct(array $unintentionallyCoveredUnits) - { - $this->unintentionallyCoveredUnits = $unintentionallyCoveredUnits; - - parent::__construct($this->toString()); - } - - public function getUnintentionallyCoveredUnits(): array - { - return $this->unintentionallyCoveredUnits; - } - - private function toString(): string - { - $message = ''; - - foreach ($this->unintentionallyCoveredUnits as $unit) { - $message .= '- ' . $unit . "\n"; - } - - return $message; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Exception/WriteOperationFailedException.php b/vendor/phpunit/php-code-coverage/src/Exception/WriteOperationFailedException.php deleted file mode 100644 index be549e17..00000000 --- a/vendor/phpunit/php-code-coverage/src/Exception/WriteOperationFailedException.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Driver; - -use function sprintf; -use RuntimeException; -use SebastianBergmann\CodeCoverage\Exception; - -final class WriteOperationFailedException extends RuntimeException implements Exception -{ - public function __construct(string $path) - { - parent::__construct(sprintf('Cannot write to "%s"', $path)); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Exception/WrongXdebugVersionException.php b/vendor/phpunit/php-code-coverage/src/Exception/WrongXdebugVersionException.php deleted file mode 100644 index 6e8f10a9..00000000 --- a/vendor/phpunit/php-code-coverage/src/Exception/WrongXdebugVersionException.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Driver; - -use RuntimeException; -use SebastianBergmann\CodeCoverage\Exception; - -final class WrongXdebugVersionException extends RuntimeException implements Exception -{ -} diff --git a/vendor/phpunit/php-code-coverage/src/Exception/Xdebug2NotEnabledException.php b/vendor/phpunit/php-code-coverage/src/Exception/Xdebug2NotEnabledException.php deleted file mode 100644 index 3039e77c..00000000 --- a/vendor/phpunit/php-code-coverage/src/Exception/Xdebug2NotEnabledException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Driver; - -use RuntimeException; -use SebastianBergmann\CodeCoverage\Exception; - -final class Xdebug2NotEnabledException extends RuntimeException implements Exception -{ - public function __construct() - { - parent::__construct('xdebug.coverage_enable=On has to be set'); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Exception/Xdebug3NotEnabledException.php b/vendor/phpunit/php-code-coverage/src/Exception/Xdebug3NotEnabledException.php deleted file mode 100644 index 5d3b106c..00000000 --- a/vendor/phpunit/php-code-coverage/src/Exception/Xdebug3NotEnabledException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Driver; - -use RuntimeException; -use SebastianBergmann\CodeCoverage\Exception; - -final class Xdebug3NotEnabledException extends RuntimeException implements Exception -{ - public function __construct() - { - parent::__construct('XDEBUG_MODE=coverage or xdebug.mode=coverage has to be set'); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Exception/XdebugNotAvailableException.php b/vendor/phpunit/php-code-coverage/src/Exception/XdebugNotAvailableException.php deleted file mode 100644 index 1622c5a6..00000000 --- a/vendor/phpunit/php-code-coverage/src/Exception/XdebugNotAvailableException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Driver; - -use RuntimeException; -use SebastianBergmann\CodeCoverage\Exception; - -final class XdebugNotAvailableException extends RuntimeException implements Exception -{ - public function __construct() - { - parent::__construct('The Xdebug extension is not available'); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Exception/XmlException.php b/vendor/phpunit/php-code-coverage/src/Exception/XmlException.php deleted file mode 100644 index 31e4623d..00000000 --- a/vendor/phpunit/php-code-coverage/src/Exception/XmlException.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. - */ -namespace SebastianBergmann\CodeCoverage; - -use RuntimeException; - -final class XmlException extends RuntimeException implements Exception -{ -} diff --git a/vendor/phpunit/php-code-coverage/src/Filter.php b/vendor/phpunit/php-code-coverage/src/Filter.php deleted file mode 100644 index 5a0a142a..00000000 --- a/vendor/phpunit/php-code-coverage/src/Filter.php +++ /dev/null @@ -1,118 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage; - -use function array_keys; -use function is_file; -use function realpath; -use function strpos; -use SebastianBergmann\FileIterator\Facade as FileIteratorFacade; - -final class Filter -{ - /** - * @psalm-var array - */ - private $files = []; - - /** - * @psalm-var array - */ - private $isFileCache = []; - - public function includeDirectory(string $directory, string $suffix = '.php', string $prefix = ''): void - { - foreach ((new FileIteratorFacade)->getFilesAsArray($directory, $suffix, $prefix) as $file) { - $this->includeFile($file); - } - } - - /** - * @psalm-param list $files - */ - public function includeFiles(array $filenames): void - { - foreach ($filenames as $filename) { - $this->includeFile($filename); - } - } - - public function includeFile(string $filename): void - { - $filename = realpath($filename); - - if (!$filename) { - return; - } - - $this->files[$filename] = true; - } - - public function excludeDirectory(string $directory, string $suffix = '.php', string $prefix = ''): void - { - foreach ((new FileIteratorFacade)->getFilesAsArray($directory, $suffix, $prefix) as $file) { - $this->excludeFile($file); - } - } - - public function excludeFile(string $filename): void - { - $filename = realpath($filename); - - if (!$filename || !isset($this->files[$filename])) { - return; - } - - unset($this->files[$filename]); - } - - public function isFile(string $filename): bool - { - if (isset($this->isFileCache[$filename])) { - return $this->isFileCache[$filename]; - } - - if ($filename === '-' || - strpos($filename, 'vfs://') === 0 || - strpos($filename, 'xdebug://debug-eval') !== false || - strpos($filename, 'eval()\'d code') !== false || - strpos($filename, 'runtime-created function') !== false || - strpos($filename, 'runkit created function') !== false || - strpos($filename, 'assert code') !== false || - strpos($filename, 'regexp code') !== false || - strpos($filename, 'Standard input code') !== false) { - $isFile = false; - } else { - $isFile = is_file($filename); - } - - $this->isFileCache[$filename] = $isFile; - - return $isFile; - } - - public function isExcluded(string $filename): bool - { - return !isset($this->files[$filename]) || !$this->isFile($filename); - } - - /** - * @psalm-return list - */ - public function files(): array - { - return array_keys($this->files); - } - - public function isEmpty(): bool - { - return empty($this->files); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Node/AbstractNode.php b/vendor/phpunit/php-code-coverage/src/Node/AbstractNode.php deleted file mode 100644 index 60d6391d..00000000 --- a/vendor/phpunit/php-code-coverage/src/Node/AbstractNode.php +++ /dev/null @@ -1,253 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Node; - -use const DIRECTORY_SEPARATOR; -use function array_merge; -use function str_replace; -use function substr; -use Countable; -use SebastianBergmann\CodeCoverage\Util\Percentage; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -abstract class AbstractNode implements Countable -{ - /** - * @var string - */ - private $name; - - /** - * @var string - */ - private $pathAsString; - - /** - * @var array - */ - private $pathAsArray; - - /** - * @var AbstractNode - */ - private $parent; - - /** - * @var string - */ - private $id; - - public function __construct(string $name, self $parent = null) - { - if (substr($name, -1) === DIRECTORY_SEPARATOR) { - $name = substr($name, 0, -1); - } - - $this->name = $name; - $this->parent = $parent; - } - - public function name(): string - { - return $this->name; - } - - public function id(): string - { - if ($this->id === null) { - $parent = $this->parent(); - - if ($parent === null) { - $this->id = 'index'; - } else { - $parentId = $parent->id(); - - if ($parentId === 'index') { - $this->id = str_replace(':', '_', $this->name); - } else { - $this->id = $parentId . '/' . $this->name; - } - } - } - - return $this->id; - } - - public function pathAsString(): string - { - if ($this->pathAsString === null) { - if ($this->parent === null) { - $this->pathAsString = $this->name; - } else { - $this->pathAsString = $this->parent->pathAsString() . DIRECTORY_SEPARATOR . $this->name; - } - } - - return $this->pathAsString; - } - - public function pathAsArray(): array - { - if ($this->pathAsArray === null) { - if ($this->parent === null) { - $this->pathAsArray = []; - } else { - $this->pathAsArray = $this->parent->pathAsArray(); - } - - $this->pathAsArray[] = $this; - } - - return $this->pathAsArray; - } - - public function parent(): ?self - { - return $this->parent; - } - - public function percentageOfTestedClasses(): Percentage - { - return Percentage::fromFractionAndTotal( - $this->numberOfTestedClasses(), - $this->numberOfClasses(), - ); - } - - public function percentageOfTestedTraits(): Percentage - { - return Percentage::fromFractionAndTotal( - $this->numberOfTestedTraits(), - $this->numberOfTraits(), - ); - } - - public function percentageOfTestedClassesAndTraits(): Percentage - { - return Percentage::fromFractionAndTotal( - $this->numberOfTestedClassesAndTraits(), - $this->numberOfClassesAndTraits(), - ); - } - - public function percentageOfTestedFunctions(): Percentage - { - return Percentage::fromFractionAndTotal( - $this->numberOfTestedFunctions(), - $this->numberOfFunctions(), - ); - } - - public function percentageOfTestedMethods(): Percentage - { - return Percentage::fromFractionAndTotal( - $this->numberOfTestedMethods(), - $this->numberOfMethods(), - ); - } - - public function percentageOfTestedFunctionsAndMethods(): Percentage - { - return Percentage::fromFractionAndTotal( - $this->numberOfTestedFunctionsAndMethods(), - $this->numberOfFunctionsAndMethods(), - ); - } - - public function percentageOfExecutedLines(): Percentage - { - return Percentage::fromFractionAndTotal( - $this->numberOfExecutedLines(), - $this->numberOfExecutableLines(), - ); - } - - public function percentageOfExecutedBranches(): Percentage - { - return Percentage::fromFractionAndTotal( - $this->numberOfExecutedBranches(), - $this->numberOfExecutableBranches() - ); - } - - public function percentageOfExecutedPaths(): Percentage - { - return Percentage::fromFractionAndTotal( - $this->numberOfExecutedPaths(), - $this->numberOfExecutablePaths() - ); - } - - public function numberOfClassesAndTraits(): int - { - return $this->numberOfClasses() + $this->numberOfTraits(); - } - - public function numberOfTestedClassesAndTraits(): int - { - return $this->numberOfTestedClasses() + $this->numberOfTestedTraits(); - } - - public function classesAndTraits(): array - { - return array_merge($this->classes(), $this->traits()); - } - - public function numberOfFunctionsAndMethods(): int - { - return $this->numberOfFunctions() + $this->numberOfMethods(); - } - - public function numberOfTestedFunctionsAndMethods(): int - { - return $this->numberOfTestedFunctions() + $this->numberOfTestedMethods(); - } - - abstract public function classes(): array; - - abstract public function traits(): array; - - abstract public function functions(): array; - - /** - * @psalm-return array{linesOfCode: int, commentLinesOfCode: int, nonCommentLinesOfCode: int} - */ - abstract public function linesOfCode(): array; - - abstract public function numberOfExecutableLines(): int; - - abstract public function numberOfExecutedLines(): int; - - abstract public function numberOfExecutableBranches(): int; - - abstract public function numberOfExecutedBranches(): int; - - abstract public function numberOfExecutablePaths(): int; - - abstract public function numberOfExecutedPaths(): int; - - abstract public function numberOfClasses(): int; - - abstract public function numberOfTestedClasses(): int; - - abstract public function numberOfTraits(): int; - - abstract public function numberOfTestedTraits(): int; - - abstract public function numberOfMethods(): int; - - abstract public function numberOfTestedMethods(): int; - - abstract public function numberOfFunctions(): int; - - abstract public function numberOfTestedFunctions(): int; -} diff --git a/vendor/phpunit/php-code-coverage/src/Node/Builder.php b/vendor/phpunit/php-code-coverage/src/Node/Builder.php deleted file mode 100644 index 6d11c779..00000000 --- a/vendor/phpunit/php-code-coverage/src/Node/Builder.php +++ /dev/null @@ -1,264 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Node; - -use const DIRECTORY_SEPARATOR; -use function array_shift; -use function basename; -use function count; -use function dirname; -use function explode; -use function implode; -use function is_file; -use function str_replace; -use function strpos; -use function substr; -use SebastianBergmann\CodeCoverage\CodeCoverage; -use SebastianBergmann\CodeCoverage\ProcessedCodeCoverageData; -use SebastianBergmann\CodeCoverage\StaticAnalysis\FileAnalyser; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -final class Builder -{ - /** - * @var FileAnalyser - */ - private $analyser; - - public function __construct(FileAnalyser $analyser) - { - $this->analyser = $analyser; - } - - public function build(CodeCoverage $coverage): Directory - { - $data = clone $coverage->getData(); // clone because path munging is destructive to the original data - $commonPath = $this->reducePaths($data); - $root = new Directory( - $commonPath, - null - ); - - $this->addItems( - $root, - $this->buildDirectoryStructure($data), - $coverage->getTests() - ); - - return $root; - } - - private function addItems(Directory $root, array $items, array $tests): void - { - foreach ($items as $key => $value) { - $key = (string) $key; - - if (substr($key, -2) === '/f') { - $key = substr($key, 0, -2); - $filename = $root->pathAsString() . DIRECTORY_SEPARATOR . $key; - - if (is_file($filename)) { - $root->addFile( - new File( - $key, - $root, - $value['lineCoverage'], - $value['functionCoverage'], - $tests, - $this->analyser->classesIn($filename), - $this->analyser->traitsIn($filename), - $this->analyser->functionsIn($filename), - $this->analyser->linesOfCodeFor($filename) - ) - ); - } - } else { - $child = $root->addDirectory($key); - - $this->addItems($child, $value, $tests); - } - } - } - - /** - * Builds an array representation of the directory structure. - * - * For instance, - * - * - * Array - * ( - * [Money.php] => Array - * ( - * ... - * ) - * - * [MoneyBag.php] => Array - * ( - * ... - * ) - * ) - * - * - * is transformed into - * - * - * Array - * ( - * [.] => Array - * ( - * [Money.php] => Array - * ( - * ... - * ) - * - * [MoneyBag.php] => Array - * ( - * ... - * ) - * ) - * ) - * - */ - private function buildDirectoryStructure(ProcessedCodeCoverageData $data): array - { - $result = []; - - foreach ($data->coveredFiles() as $originalPath) { - $path = explode(DIRECTORY_SEPARATOR, $originalPath); - $pointer = &$result; - $max = count($path); - - for ($i = 0; $i < $max; $i++) { - $type = ''; - - if ($i === ($max - 1)) { - $type = '/f'; - } - - $pointer = &$pointer[$path[$i] . $type]; - } - - $pointer = [ - 'lineCoverage' => $data->lineCoverage()[$originalPath] ?? [], - 'functionCoverage' => $data->functionCoverage()[$originalPath] ?? [], - ]; - } - - return $result; - } - - /** - * Reduces the paths by cutting the longest common start path. - * - * For instance, - * - * - * Array - * ( - * [/home/sb/Money/Money.php] => Array - * ( - * ... - * ) - * - * [/home/sb/Money/MoneyBag.php] => Array - * ( - * ... - * ) - * ) - * - * - * is reduced to - * - * - * Array - * ( - * [Money.php] => Array - * ( - * ... - * ) - * - * [MoneyBag.php] => Array - * ( - * ... - * ) - * ) - * - */ - private function reducePaths(ProcessedCodeCoverageData $coverage): string - { - if (empty($coverage->coveredFiles())) { - return '.'; - } - - $commonPath = ''; - $paths = $coverage->coveredFiles(); - - if (count($paths) === 1) { - $commonPath = dirname($paths[0]) . DIRECTORY_SEPARATOR; - $coverage->renameFile($paths[0], basename($paths[0])); - - return $commonPath; - } - - $max = count($paths); - - for ($i = 0; $i < $max; $i++) { - // strip phar:// prefixes - if (strpos($paths[$i], 'phar://') === 0) { - $paths[$i] = substr($paths[$i], 7); - $paths[$i] = str_replace('/', DIRECTORY_SEPARATOR, $paths[$i]); - } - $paths[$i] = explode(DIRECTORY_SEPARATOR, $paths[$i]); - - if (empty($paths[$i][0])) { - $paths[$i][0] = DIRECTORY_SEPARATOR; - } - } - - $done = false; - $max = count($paths); - - while (!$done) { - for ($i = 0; $i < $max - 1; $i++) { - if (!isset($paths[$i][0]) || - !isset($paths[$i + 1][0]) || - $paths[$i][0] !== $paths[$i + 1][0]) { - $done = true; - - break; - } - } - - if (!$done) { - $commonPath .= $paths[0][0]; - - if ($paths[0][0] !== DIRECTORY_SEPARATOR) { - $commonPath .= DIRECTORY_SEPARATOR; - } - - for ($i = 0; $i < $max; $i++) { - array_shift($paths[$i]); - } - } - } - - $original = $coverage->coveredFiles(); - $max = count($original); - - for ($i = 0; $i < $max; $i++) { - $coverage->renameFile($original[$i], implode(DIRECTORY_SEPARATOR, $paths[$i])); - } - - return substr($commonPath, 0, -1); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Node/CrapIndex.php b/vendor/phpunit/php-code-coverage/src/Node/CrapIndex.php deleted file mode 100644 index 30b86b7d..00000000 --- a/vendor/phpunit/php-code-coverage/src/Node/CrapIndex.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Node; - -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -final class CrapIndex -{ - /** - * @var int - */ - private $cyclomaticComplexity; - - /** - * @var float - */ - private $codeCoverage; - - public function __construct(int $cyclomaticComplexity, float $codeCoverage) - { - $this->cyclomaticComplexity = $cyclomaticComplexity; - $this->codeCoverage = $codeCoverage; - } - - public function asString(): string - { - if ($this->codeCoverage === 0.0) { - return (string) ($this->cyclomaticComplexity ** 2 + $this->cyclomaticComplexity); - } - - if ($this->codeCoverage >= 95) { - return (string) $this->cyclomaticComplexity; - } - - return sprintf( - '%01.2F', - $this->cyclomaticComplexity ** 2 * (1 - $this->codeCoverage / 100) ** 3 + $this->cyclomaticComplexity - ); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Node/Directory.php b/vendor/phpunit/php-code-coverage/src/Node/Directory.php deleted file mode 100644 index d6ee07e4..00000000 --- a/vendor/phpunit/php-code-coverage/src/Node/Directory.php +++ /dev/null @@ -1,440 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Node; - -use function array_merge; -use function count; -use IteratorAggregate; -use RecursiveIteratorIterator; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -final class Directory extends AbstractNode implements IteratorAggregate -{ - /** - * @var AbstractNode[] - */ - private $children = []; - - /** - * @var Directory[] - */ - private $directories = []; - - /** - * @var File[] - */ - private $files = []; - - /** - * @var array - */ - private $classes; - - /** - * @var array - */ - private $traits; - - /** - * @var array - */ - private $functions; - - /** - * @psalm-var null|array{linesOfCode: int, commentLinesOfCode: int, nonCommentLinesOfCode: int} - */ - private $linesOfCode; - - /** - * @var int - */ - private $numFiles = -1; - - /** - * @var int - */ - private $numExecutableLines = -1; - - /** - * @var int - */ - private $numExecutedLines = -1; - - /** - * @var int - */ - private $numExecutableBranches = -1; - - /** - * @var int - */ - private $numExecutedBranches = -1; - - /** - * @var int - */ - private $numExecutablePaths = -1; - - /** - * @var int - */ - private $numExecutedPaths = -1; - - /** - * @var int - */ - private $numClasses = -1; - - /** - * @var int - */ - private $numTestedClasses = -1; - - /** - * @var int - */ - private $numTraits = -1; - - /** - * @var int - */ - private $numTestedTraits = -1; - - /** - * @var int - */ - private $numMethods = -1; - - /** - * @var int - */ - private $numTestedMethods = -1; - - /** - * @var int - */ - private $numFunctions = -1; - - /** - * @var int - */ - private $numTestedFunctions = -1; - - public function count(): int - { - if ($this->numFiles === -1) { - $this->numFiles = 0; - - foreach ($this->children as $child) { - $this->numFiles += count($child); - } - } - - return $this->numFiles; - } - - public function getIterator(): RecursiveIteratorIterator - { - return new RecursiveIteratorIterator( - new Iterator($this), - RecursiveIteratorIterator::SELF_FIRST - ); - } - - public function addDirectory(string $name): self - { - $directory = new self($name, $this); - - $this->children[] = $directory; - $this->directories[] = &$this->children[count($this->children) - 1]; - - return $directory; - } - - public function addFile(File $file): void - { - $this->children[] = $file; - $this->files[] = &$this->children[count($this->children) - 1]; - - $this->numExecutableLines = -1; - $this->numExecutedLines = -1; - } - - public function directories(): array - { - return $this->directories; - } - - public function files(): array - { - return $this->files; - } - - public function children(): array - { - return $this->children; - } - - public function classes(): array - { - if ($this->classes === null) { - $this->classes = []; - - foreach ($this->children as $child) { - $this->classes = array_merge( - $this->classes, - $child->classes() - ); - } - } - - return $this->classes; - } - - public function traits(): array - { - if ($this->traits === null) { - $this->traits = []; - - foreach ($this->children as $child) { - $this->traits = array_merge( - $this->traits, - $child->traits() - ); - } - } - - return $this->traits; - } - - public function functions(): array - { - if ($this->functions === null) { - $this->functions = []; - - foreach ($this->children as $child) { - $this->functions = array_merge( - $this->functions, - $child->functions() - ); - } - } - - return $this->functions; - } - - /** - * @psalm-return array{linesOfCode: int, commentLinesOfCode: int, nonCommentLinesOfCode: int} - */ - public function linesOfCode(): array - { - if ($this->linesOfCode === null) { - $this->linesOfCode = [ - 'linesOfCode' => 0, - 'commentLinesOfCode' => 0, - 'nonCommentLinesOfCode' => 0, - ]; - - foreach ($this->children as $child) { - $childLinesOfCode = $child->linesOfCode(); - - $this->linesOfCode['linesOfCode'] += $childLinesOfCode['linesOfCode']; - $this->linesOfCode['commentLinesOfCode'] += $childLinesOfCode['commentLinesOfCode']; - $this->linesOfCode['nonCommentLinesOfCode'] += $childLinesOfCode['nonCommentLinesOfCode']; - } - } - - return $this->linesOfCode; - } - - public function numberOfExecutableLines(): int - { - if ($this->numExecutableLines === -1) { - $this->numExecutableLines = 0; - - foreach ($this->children as $child) { - $this->numExecutableLines += $child->numberOfExecutableLines(); - } - } - - return $this->numExecutableLines; - } - - public function numberOfExecutedLines(): int - { - if ($this->numExecutedLines === -1) { - $this->numExecutedLines = 0; - - foreach ($this->children as $child) { - $this->numExecutedLines += $child->numberOfExecutedLines(); - } - } - - return $this->numExecutedLines; - } - - public function numberOfExecutableBranches(): int - { - if ($this->numExecutableBranches === -1) { - $this->numExecutableBranches = 0; - - foreach ($this->children as $child) { - $this->numExecutableBranches += $child->numberOfExecutableBranches(); - } - } - - return $this->numExecutableBranches; - } - - public function numberOfExecutedBranches(): int - { - if ($this->numExecutedBranches === -1) { - $this->numExecutedBranches = 0; - - foreach ($this->children as $child) { - $this->numExecutedBranches += $child->numberOfExecutedBranches(); - } - } - - return $this->numExecutedBranches; - } - - public function numberOfExecutablePaths(): int - { - if ($this->numExecutablePaths === -1) { - $this->numExecutablePaths = 0; - - foreach ($this->children as $child) { - $this->numExecutablePaths += $child->numberOfExecutablePaths(); - } - } - - return $this->numExecutablePaths; - } - - public function numberOfExecutedPaths(): int - { - if ($this->numExecutedPaths === -1) { - $this->numExecutedPaths = 0; - - foreach ($this->children as $child) { - $this->numExecutedPaths += $child->numberOfExecutedPaths(); - } - } - - return $this->numExecutedPaths; - } - - public function numberOfClasses(): int - { - if ($this->numClasses === -1) { - $this->numClasses = 0; - - foreach ($this->children as $child) { - $this->numClasses += $child->numberOfClasses(); - } - } - - return $this->numClasses; - } - - public function numberOfTestedClasses(): int - { - if ($this->numTestedClasses === -1) { - $this->numTestedClasses = 0; - - foreach ($this->children as $child) { - $this->numTestedClasses += $child->numberOfTestedClasses(); - } - } - - return $this->numTestedClasses; - } - - public function numberOfTraits(): int - { - if ($this->numTraits === -1) { - $this->numTraits = 0; - - foreach ($this->children as $child) { - $this->numTraits += $child->numberOfTraits(); - } - } - - return $this->numTraits; - } - - public function numberOfTestedTraits(): int - { - if ($this->numTestedTraits === -1) { - $this->numTestedTraits = 0; - - foreach ($this->children as $child) { - $this->numTestedTraits += $child->numberOfTestedTraits(); - } - } - - return $this->numTestedTraits; - } - - public function numberOfMethods(): int - { - if ($this->numMethods === -1) { - $this->numMethods = 0; - - foreach ($this->children as $child) { - $this->numMethods += $child->numberOfMethods(); - } - } - - return $this->numMethods; - } - - public function numberOfTestedMethods(): int - { - if ($this->numTestedMethods === -1) { - $this->numTestedMethods = 0; - - foreach ($this->children as $child) { - $this->numTestedMethods += $child->numberOfTestedMethods(); - } - } - - return $this->numTestedMethods; - } - - public function numberOfFunctions(): int - { - if ($this->numFunctions === -1) { - $this->numFunctions = 0; - - foreach ($this->children as $child) { - $this->numFunctions += $child->numberOfFunctions(); - } - } - - return $this->numFunctions; - } - - public function numberOfTestedFunctions(): int - { - if ($this->numTestedFunctions === -1) { - $this->numTestedFunctions = 0; - - foreach ($this->children as $child) { - $this->numTestedFunctions += $child->numberOfTestedFunctions(); - } - } - - return $this->numTestedFunctions; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Node/File.php b/vendor/phpunit/php-code-coverage/src/Node/File.php deleted file mode 100644 index af3764e4..00000000 --- a/vendor/phpunit/php-code-coverage/src/Node/File.php +++ /dev/null @@ -1,651 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Node; - -use function array_filter; -use function count; -use function range; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -final class File extends AbstractNode -{ - /** - * @var array - */ - private $lineCoverageData; - - /** - * @var array - */ - private $functionCoverageData; - - /** - * @var array - */ - private $testData; - - /** - * @var int - */ - private $numExecutableLines = 0; - - /** - * @var int - */ - private $numExecutedLines = 0; - - /** - * @var int - */ - private $numExecutableBranches = 0; - - /** - * @var int - */ - private $numExecutedBranches = 0; - - /** - * @var int - */ - private $numExecutablePaths = 0; - - /** - * @var int - */ - private $numExecutedPaths = 0; - - /** - * @var array - */ - private $classes = []; - - /** - * @var array - */ - private $traits = []; - - /** - * @var array - */ - private $functions = []; - - /** - * @psalm-var array{linesOfCode: int, commentLinesOfCode: int, nonCommentLinesOfCode: int} - */ - private $linesOfCode; - - /** - * @var int - */ - private $numClasses; - - /** - * @var int - */ - private $numTestedClasses = 0; - - /** - * @var int - */ - private $numTraits; - - /** - * @var int - */ - private $numTestedTraits = 0; - - /** - * @var int - */ - private $numMethods; - - /** - * @var int - */ - private $numTestedMethods; - - /** - * @var int - */ - private $numTestedFunctions; - - /** - * @var array - */ - private $codeUnitsByLine = []; - - /** - * @psalm-param array{linesOfCode: int, commentLinesOfCode: int, nonCommentLinesOfCode: int} $linesOfCode - */ - public function __construct(string $name, AbstractNode $parent, array $lineCoverageData, array $functionCoverageData, array $testData, array $classes, array $traits, array $functions, array $linesOfCode) - { - parent::__construct($name, $parent); - - $this->lineCoverageData = $lineCoverageData; - $this->functionCoverageData = $functionCoverageData; - $this->testData = $testData; - $this->linesOfCode = $linesOfCode; - - $this->calculateStatistics($classes, $traits, $functions); - } - - public function count(): int - { - return 1; - } - - public function lineCoverageData(): array - { - return $this->lineCoverageData; - } - - public function functionCoverageData(): array - { - return $this->functionCoverageData; - } - - public function testData(): array - { - return $this->testData; - } - - public function classes(): array - { - return $this->classes; - } - - public function traits(): array - { - return $this->traits; - } - - public function functions(): array - { - return $this->functions; - } - - /** - * @psalm-return array{linesOfCode: int, commentLinesOfCode: int, nonCommentLinesOfCode: int} - */ - public function linesOfCode(): array - { - return $this->linesOfCode; - } - - public function numberOfExecutableLines(): int - { - return $this->numExecutableLines; - } - - public function numberOfExecutedLines(): int - { - return $this->numExecutedLines; - } - - public function numberOfExecutableBranches(): int - { - return $this->numExecutableBranches; - } - - public function numberOfExecutedBranches(): int - { - return $this->numExecutedBranches; - } - - public function numberOfExecutablePaths(): int - { - return $this->numExecutablePaths; - } - - public function numberOfExecutedPaths(): int - { - return $this->numExecutedPaths; - } - - public function numberOfClasses(): int - { - if ($this->numClasses === null) { - $this->numClasses = 0; - - foreach ($this->classes as $class) { - foreach ($class['methods'] as $method) { - if ($method['executableLines'] > 0) { - $this->numClasses++; - - continue 2; - } - } - } - } - - return $this->numClasses; - } - - public function numberOfTestedClasses(): int - { - return $this->numTestedClasses; - } - - public function numberOfTraits(): int - { - if ($this->numTraits === null) { - $this->numTraits = 0; - - foreach ($this->traits as $trait) { - foreach ($trait['methods'] as $method) { - if ($method['executableLines'] > 0) { - $this->numTraits++; - - continue 2; - } - } - } - } - - return $this->numTraits; - } - - public function numberOfTestedTraits(): int - { - return $this->numTestedTraits; - } - - public function numberOfMethods(): int - { - if ($this->numMethods === null) { - $this->numMethods = 0; - - foreach ($this->classes as $class) { - foreach ($class['methods'] as $method) { - if ($method['executableLines'] > 0) { - $this->numMethods++; - } - } - } - - foreach ($this->traits as $trait) { - foreach ($trait['methods'] as $method) { - if ($method['executableLines'] > 0) { - $this->numMethods++; - } - } - } - } - - return $this->numMethods; - } - - public function numberOfTestedMethods(): int - { - if ($this->numTestedMethods === null) { - $this->numTestedMethods = 0; - - foreach ($this->classes as $class) { - foreach ($class['methods'] as $method) { - if ($method['executableLines'] > 0 && - $method['coverage'] === 100) { - $this->numTestedMethods++; - } - } - } - - foreach ($this->traits as $trait) { - foreach ($trait['methods'] as $method) { - if ($method['executableLines'] > 0 && - $method['coverage'] === 100) { - $this->numTestedMethods++; - } - } - } - } - - return $this->numTestedMethods; - } - - public function numberOfFunctions(): int - { - return count($this->functions); - } - - public function numberOfTestedFunctions(): int - { - if ($this->numTestedFunctions === null) { - $this->numTestedFunctions = 0; - - foreach ($this->functions as $function) { - if ($function['executableLines'] > 0 && - $function['coverage'] === 100) { - $this->numTestedFunctions++; - } - } - } - - return $this->numTestedFunctions; - } - - private function calculateStatistics(array $classes, array $traits, array $functions): void - { - foreach (range(1, $this->linesOfCode['linesOfCode']) as $lineNumber) { - $this->codeUnitsByLine[$lineNumber] = []; - } - - $this->processClasses($classes); - $this->processTraits($traits); - $this->processFunctions($functions); - - foreach (range(1, $this->linesOfCode['linesOfCode']) as $lineNumber) { - if (isset($this->lineCoverageData[$lineNumber])) { - foreach ($this->codeUnitsByLine[$lineNumber] as &$codeUnit) { - $codeUnit['executableLines']++; - } - - unset($codeUnit); - - $this->numExecutableLines++; - - if (count($this->lineCoverageData[$lineNumber]) > 0) { - foreach ($this->codeUnitsByLine[$lineNumber] as &$codeUnit) { - $codeUnit['executedLines']++; - } - - unset($codeUnit); - - $this->numExecutedLines++; - } - } - } - - foreach ($this->traits as &$trait) { - foreach ($trait['methods'] as &$method) { - $methodLineCoverage = $method['executableLines'] ? ($method['executedLines'] / $method['executableLines']) * 100 : 100; - $methodBranchCoverage = $method['executableBranches'] ? ($method['executedBranches'] / $method['executableBranches']) * 100 : 0; - $methodPathCoverage = $method['executablePaths'] ? ($method['executedPaths'] / $method['executablePaths']) * 100 : 0; - - $method['coverage'] = $methodBranchCoverage ?: $methodLineCoverage; - $method['crap'] = (new CrapIndex($method['ccn'], $methodPathCoverage ?: $methodLineCoverage))->asString(); - - $trait['ccn'] += $method['ccn']; - } - - unset($method); - - $traitLineCoverage = $trait['executableLines'] ? ($trait['executedLines'] / $trait['executableLines']) * 100 : 100; - $traitBranchCoverage = $trait['executableBranches'] ? ($trait['executedBranches'] / $trait['executableBranches']) * 100 : 0; - $traitPathCoverage = $trait['executablePaths'] ? ($trait['executedPaths'] / $trait['executablePaths']) * 100 : 0; - - $trait['coverage'] = $traitBranchCoverage ?: $traitLineCoverage; - $trait['crap'] = (new CrapIndex($trait['ccn'], $traitPathCoverage ?: $traitLineCoverage))->asString(); - - if ($trait['executableLines'] > 0 && $trait['coverage'] === 100) { - $this->numTestedClasses++; - } - } - - unset($trait); - - foreach ($this->classes as &$class) { - foreach ($class['methods'] as &$method) { - $methodLineCoverage = $method['executableLines'] ? ($method['executedLines'] / $method['executableLines']) * 100 : 100; - $methodBranchCoverage = $method['executableBranches'] ? ($method['executedBranches'] / $method['executableBranches']) * 100 : 0; - $methodPathCoverage = $method['executablePaths'] ? ($method['executedPaths'] / $method['executablePaths']) * 100 : 0; - - $method['coverage'] = $methodBranchCoverage ?: $methodLineCoverage; - $method['crap'] = (new CrapIndex($method['ccn'], $methodPathCoverage ?: $methodLineCoverage))->asString(); - - $class['ccn'] += $method['ccn']; - } - - unset($method); - - $classLineCoverage = $class['executableLines'] ? ($class['executedLines'] / $class['executableLines']) * 100 : 100; - $classBranchCoverage = $class['executableBranches'] ? ($class['executedBranches'] / $class['executableBranches']) * 100 : 0; - $classPathCoverage = $class['executablePaths'] ? ($class['executedPaths'] / $class['executablePaths']) * 100 : 0; - - $class['coverage'] = $classBranchCoverage ?: $classLineCoverage; - $class['crap'] = (new CrapIndex($class['ccn'], $classPathCoverage ?: $classLineCoverage))->asString(); - - if ($class['executableLines'] > 0 && $class['coverage'] === 100) { - $this->numTestedClasses++; - } - } - - unset($class); - - foreach ($this->functions as &$function) { - $functionLineCoverage = $function['executableLines'] ? ($function['executedLines'] / $function['executableLines']) * 100 : 100; - $functionBranchCoverage = $function['executableBranches'] ? ($function['executedBranches'] / $function['executableBranches']) * 100 : 0; - $functionPathCoverage = $function['executablePaths'] ? ($function['executedPaths'] / $function['executablePaths']) * 100 : 0; - - $function['coverage'] = $functionBranchCoverage ?: $functionLineCoverage; - $function['crap'] = (new CrapIndex($function['ccn'], $functionPathCoverage ?: $functionLineCoverage))->asString(); - - if ($function['coverage'] === 100) { - $this->numTestedFunctions++; - } - } - } - - private function processClasses(array $classes): void - { - $link = $this->id() . '.html#'; - - foreach ($classes as $className => $class) { - $this->classes[$className] = [ - 'className' => $className, - 'namespace' => $class['namespace'], - 'methods' => [], - 'startLine' => $class['startLine'], - 'executableLines' => 0, - 'executedLines' => 0, - 'executableBranches' => 0, - 'executedBranches' => 0, - 'executablePaths' => 0, - 'executedPaths' => 0, - 'ccn' => 0, - 'coverage' => 0, - 'crap' => 0, - 'link' => $link . $class['startLine'], - ]; - - foreach ($class['methods'] as $methodName => $method) { - $methodData = $this->newMethod($className, $methodName, $method, $link); - $this->classes[$className]['methods'][$methodName] = $methodData; - - $this->classes[$className]['executableBranches'] += $methodData['executableBranches']; - $this->classes[$className]['executedBranches'] += $methodData['executedBranches']; - $this->classes[$className]['executablePaths'] += $methodData['executablePaths']; - $this->classes[$className]['executedPaths'] += $methodData['executedPaths']; - - $this->numExecutableBranches += $methodData['executableBranches']; - $this->numExecutedBranches += $methodData['executedBranches']; - $this->numExecutablePaths += $methodData['executablePaths']; - $this->numExecutedPaths += $methodData['executedPaths']; - - foreach (range($method['startLine'], $method['endLine']) as $lineNumber) { - $this->codeUnitsByLine[$lineNumber] = [ - &$this->classes[$className], - &$this->classes[$className]['methods'][$methodName], - ]; - } - } - } - } - - private function processTraits(array $traits): void - { - $link = $this->id() . '.html#'; - - foreach ($traits as $traitName => $trait) { - $this->traits[$traitName] = [ - 'traitName' => $traitName, - 'namespace' => $trait['namespace'], - 'methods' => [], - 'startLine' => $trait['startLine'], - 'executableLines' => 0, - 'executedLines' => 0, - 'executableBranches' => 0, - 'executedBranches' => 0, - 'executablePaths' => 0, - 'executedPaths' => 0, - 'ccn' => 0, - 'coverage' => 0, - 'crap' => 0, - 'link' => $link . $trait['startLine'], - ]; - - foreach ($trait['methods'] as $methodName => $method) { - $methodData = $this->newMethod($traitName, $methodName, $method, $link); - $this->traits[$traitName]['methods'][$methodName] = $methodData; - - $this->traits[$traitName]['executableBranches'] += $methodData['executableBranches']; - $this->traits[$traitName]['executedBranches'] += $methodData['executedBranches']; - $this->traits[$traitName]['executablePaths'] += $methodData['executablePaths']; - $this->traits[$traitName]['executedPaths'] += $methodData['executedPaths']; - - $this->numExecutableBranches += $methodData['executableBranches']; - $this->numExecutedBranches += $methodData['executedBranches']; - $this->numExecutablePaths += $methodData['executablePaths']; - $this->numExecutedPaths += $methodData['executedPaths']; - - foreach (range($method['startLine'], $method['endLine']) as $lineNumber) { - $this->codeUnitsByLine[$lineNumber] = [ - &$this->traits[$traitName], - &$this->traits[$traitName]['methods'][$methodName], - ]; - } - } - } - } - - private function processFunctions(array $functions): void - { - $link = $this->id() . '.html#'; - - foreach ($functions as $functionName => $function) { - $this->functions[$functionName] = [ - 'functionName' => $functionName, - 'namespace' => $function['namespace'], - 'signature' => $function['signature'], - 'startLine' => $function['startLine'], - 'endLine' => $function['endLine'], - 'executableLines' => 0, - 'executedLines' => 0, - 'executableBranches' => 0, - 'executedBranches' => 0, - 'executablePaths' => 0, - 'executedPaths' => 0, - 'ccn' => $function['ccn'], - 'coverage' => 0, - 'crap' => 0, - 'link' => $link . $function['startLine'], - ]; - - foreach (range($function['startLine'], $function['endLine']) as $lineNumber) { - $this->codeUnitsByLine[$lineNumber] = [&$this->functions[$functionName]]; - } - - if (isset($this->functionCoverageData[$functionName]['branches'])) { - $this->functions[$functionName]['executableBranches'] = count( - $this->functionCoverageData[$functionName]['branches'] - ); - - $this->functions[$functionName]['executedBranches'] = count( - array_filter( - $this->functionCoverageData[$functionName]['branches'], - static function (array $branch) - { - return (bool) $branch['hit']; - } - ) - ); - } - - if (isset($this->functionCoverageData[$functionName]['paths'])) { - $this->functions[$functionName]['executablePaths'] = count( - $this->functionCoverageData[$functionName]['paths'] - ); - - $this->functions[$functionName]['executedPaths'] = count( - array_filter( - $this->functionCoverageData[$functionName]['paths'], - static function (array $path) - { - return (bool) $path['hit']; - } - ) - ); - } - - $this->numExecutableBranches += $this->functions[$functionName]['executableBranches']; - $this->numExecutedBranches += $this->functions[$functionName]['executedBranches']; - $this->numExecutablePaths += $this->functions[$functionName]['executablePaths']; - $this->numExecutedPaths += $this->functions[$functionName]['executedPaths']; - } - } - - private function newMethod(string $className, string $methodName, array $method, string $link): array - { - $methodData = [ - 'methodName' => $methodName, - 'visibility' => $method['visibility'], - 'signature' => $method['signature'], - 'startLine' => $method['startLine'], - 'endLine' => $method['endLine'], - 'executableLines' => 0, - 'executedLines' => 0, - 'executableBranches' => 0, - 'executedBranches' => 0, - 'executablePaths' => 0, - 'executedPaths' => 0, - 'ccn' => $method['ccn'], - 'coverage' => 0, - 'crap' => 0, - 'link' => $link . $method['startLine'], - ]; - - $key = $className . '->' . $methodName; - - if (isset($this->functionCoverageData[$key]['branches'])) { - $methodData['executableBranches'] = count( - $this->functionCoverageData[$key]['branches'] - ); - - $methodData['executedBranches'] = count( - array_filter( - $this->functionCoverageData[$key]['branches'], - static function (array $branch) - { - return (bool) $branch['hit']; - } - ) - ); - } - - if (isset($this->functionCoverageData[$key]['paths'])) { - $methodData['executablePaths'] = count( - $this->functionCoverageData[$key]['paths'] - ); - - $methodData['executedPaths'] = count( - array_filter( - $this->functionCoverageData[$key]['paths'], - static function (array $path) - { - return (bool) $path['hit']; - } - ) - ); - } - - return $methodData; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Node/Iterator.php b/vendor/phpunit/php-code-coverage/src/Node/Iterator.php deleted file mode 100644 index 0d1c7354..00000000 --- a/vendor/phpunit/php-code-coverage/src/Node/Iterator.php +++ /dev/null @@ -1,90 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Node; - -use function count; -use RecursiveIterator; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -final class Iterator implements RecursiveIterator -{ - /** - * @var int - */ - private $position; - - /** - * @var AbstractNode[] - */ - private $nodes; - - public function __construct(Directory $node) - { - $this->nodes = $node->children(); - } - - /** - * Rewinds the Iterator to the first element. - */ - public function rewind(): void - { - $this->position = 0; - } - - /** - * Checks if there is a current element after calls to rewind() or next(). - */ - public function valid(): bool - { - return $this->position < count($this->nodes); - } - - /** - * Returns the key of the current element. - */ - public function key(): int - { - return $this->position; - } - - /** - * Returns the current element. - */ - public function current(): ?AbstractNode - { - return $this->valid() ? $this->nodes[$this->position] : null; - } - - /** - * Moves forward to next element. - */ - public function next(): void - { - $this->position++; - } - - /** - * Returns the sub iterator for the current element. - */ - public function getChildren(): self - { - return new self($this->nodes[$this->position]); - } - - /** - * Checks whether the current element has children. - */ - public function hasChildren(): bool - { - return $this->nodes[$this->position] instanceof Directory; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/ProcessedCodeCoverageData.php b/vendor/phpunit/php-code-coverage/src/ProcessedCodeCoverageData.php deleted file mode 100644 index 1ed29ad5..00000000 --- a/vendor/phpunit/php-code-coverage/src/ProcessedCodeCoverageData.php +++ /dev/null @@ -1,255 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage; - -use function array_key_exists; -use function array_keys; -use function array_merge; -use function array_unique; -use function count; -use function is_array; -use function ksort; -use SebastianBergmann\CodeCoverage\Driver\Driver; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -final class ProcessedCodeCoverageData -{ - /** - * Line coverage data. - * An array of filenames, each having an array of linenumbers, each executable line having an array of testcase ids. - * - * @var array - */ - private $lineCoverage = []; - - /** - * Function coverage data. - * Maintains base format of raw data (@see https://xdebug.org/docs/code_coverage), but each 'hit' entry is an array - * of testcase ids. - * - * @var array - */ - private $functionCoverage = []; - - public function initializeUnseenData(RawCodeCoverageData $rawData): void - { - foreach ($rawData->lineCoverage() as $file => $lines) { - if (!isset($this->lineCoverage[$file])) { - $this->lineCoverage[$file] = []; - - foreach ($lines as $k => $v) { - $this->lineCoverage[$file][$k] = $v === Driver::LINE_NOT_EXECUTABLE ? null : []; - } - } - } - - foreach ($rawData->functionCoverage() as $file => $functions) { - foreach ($functions as $functionName => $functionData) { - if (isset($this->functionCoverage[$file][$functionName])) { - $this->initPreviouslySeenFunction($file, $functionName, $functionData); - } else { - $this->initPreviouslyUnseenFunction($file, $functionName, $functionData); - } - } - } - } - - public function markCodeAsExecutedByTestCase(string $testCaseId, RawCodeCoverageData $executedCode): void - { - foreach ($executedCode->lineCoverage() as $file => $lines) { - foreach ($lines as $k => $v) { - if ($v === Driver::LINE_EXECUTED) { - $this->lineCoverage[$file][$k][] = $testCaseId; - } - } - } - - foreach ($executedCode->functionCoverage() as $file => $functions) { - foreach ($functions as $functionName => $functionData) { - foreach ($functionData['branches'] as $branchId => $branchData) { - if ($branchData['hit'] === Driver::BRANCH_HIT) { - $this->functionCoverage[$file][$functionName]['branches'][$branchId]['hit'][] = $testCaseId; - } - } - - foreach ($functionData['paths'] as $pathId => $pathData) { - if ($pathData['hit'] === Driver::BRANCH_HIT) { - $this->functionCoverage[$file][$functionName]['paths'][$pathId]['hit'][] = $testCaseId; - } - } - } - } - } - - public function setLineCoverage(array $lineCoverage): void - { - $this->lineCoverage = $lineCoverage; - } - - public function lineCoverage(): array - { - ksort($this->lineCoverage); - - return $this->lineCoverage; - } - - public function setFunctionCoverage(array $functionCoverage): void - { - $this->functionCoverage = $functionCoverage; - } - - public function functionCoverage(): array - { - ksort($this->functionCoverage); - - return $this->functionCoverage; - } - - public function coveredFiles(): array - { - ksort($this->lineCoverage); - - return array_keys($this->lineCoverage); - } - - public function renameFile(string $oldFile, string $newFile): void - { - $this->lineCoverage[$newFile] = $this->lineCoverage[$oldFile]; - - if (isset($this->functionCoverage[$oldFile])) { - $this->functionCoverage[$newFile] = $this->functionCoverage[$oldFile]; - } - - unset($this->lineCoverage[$oldFile], $this->functionCoverage[$oldFile]); - } - - public function merge(self $newData): void - { - foreach ($newData->lineCoverage as $file => $lines) { - if (!isset($this->lineCoverage[$file])) { - $this->lineCoverage[$file] = $lines; - - continue; - } - - // we should compare the lines if any of two contains data - $compareLineNumbers = array_unique( - array_merge( - array_keys($this->lineCoverage[$file]), - array_keys($newData->lineCoverage[$file]) - ) - ); - - foreach ($compareLineNumbers as $line) { - $thatPriority = $this->priorityForLine($newData->lineCoverage[$file], $line); - $thisPriority = $this->priorityForLine($this->lineCoverage[$file], $line); - - if ($thatPriority > $thisPriority) { - $this->lineCoverage[$file][$line] = $newData->lineCoverage[$file][$line]; - } elseif ($thatPriority === $thisPriority && is_array($this->lineCoverage[$file][$line])) { - $this->lineCoverage[$file][$line] = array_unique( - array_merge($this->lineCoverage[$file][$line], $newData->lineCoverage[$file][$line]) - ); - } - } - } - - foreach ($newData->functionCoverage as $file => $functions) { - if (!isset($this->functionCoverage[$file])) { - $this->functionCoverage[$file] = $functions; - - continue; - } - - foreach ($functions as $functionName => $functionData) { - if (isset($this->functionCoverage[$file][$functionName])) { - $this->initPreviouslySeenFunction($file, $functionName, $functionData); - } else { - $this->initPreviouslyUnseenFunction($file, $functionName, $functionData); - } - - foreach ($functionData['branches'] as $branchId => $branchData) { - $this->functionCoverage[$file][$functionName]['branches'][$branchId]['hit'] = array_unique(array_merge($this->functionCoverage[$file][$functionName]['branches'][$branchId]['hit'], $branchData['hit'])); - } - - foreach ($functionData['paths'] as $pathId => $pathData) { - $this->functionCoverage[$file][$functionName]['paths'][$pathId]['hit'] = array_unique(array_merge($this->functionCoverage[$file][$functionName]['paths'][$pathId]['hit'], $pathData['hit'])); - } - } - } - } - - /** - * Determine the priority for a line. - * - * 1 = the line is not set - * 2 = the line has not been tested - * 3 = the line is dead code - * 4 = the line has been tested - * - * During a merge, a higher number is better. - */ - private function priorityForLine(array $data, int $line): int - { - if (!array_key_exists($line, $data)) { - return 1; - } - - if (is_array($data[$line]) && count($data[$line]) === 0) { - return 2; - } - - if ($data[$line] === null) { - return 3; - } - - return 4; - } - - /** - * For a function we have never seen before, copy all data over and simply init the 'hit' array. - */ - private function initPreviouslyUnseenFunction(string $file, string $functionName, array $functionData): void - { - $this->functionCoverage[$file][$functionName] = $functionData; - - foreach (array_keys($functionData['branches']) as $branchId) { - $this->functionCoverage[$file][$functionName]['branches'][$branchId]['hit'] = []; - } - - foreach (array_keys($functionData['paths']) as $pathId) { - $this->functionCoverage[$file][$functionName]['paths'][$pathId]['hit'] = []; - } - } - - /** - * For a function we have seen before, only copy over and init the 'hit' array for any unseen branches and paths. - * Techniques such as mocking and where the contents of a file are different vary during tests (e.g. compiling - * containers) mean that the functions inside a file cannot be relied upon to be static. - */ - private function initPreviouslySeenFunction(string $file, string $functionName, array $functionData): void - { - foreach ($functionData['branches'] as $branchId => $branchData) { - if (!isset($this->functionCoverage[$file][$functionName]['branches'][$branchId])) { - $this->functionCoverage[$file][$functionName]['branches'][$branchId] = $branchData; - $this->functionCoverage[$file][$functionName]['branches'][$branchId]['hit'] = []; - } - } - - foreach ($functionData['paths'] as $pathId => $pathData) { - if (!isset($this->functionCoverage[$file][$functionName]['paths'][$pathId])) { - $this->functionCoverage[$file][$functionName]['paths'][$pathId] = $pathData; - $this->functionCoverage[$file][$functionName]['paths'][$pathId]['hit'] = []; - } - } - } -} diff --git a/vendor/phpunit/php-code-coverage/src/RawCodeCoverageData.php b/vendor/phpunit/php-code-coverage/src/RawCodeCoverageData.php deleted file mode 100644 index 9cb20e73..00000000 --- a/vendor/phpunit/php-code-coverage/src/RawCodeCoverageData.php +++ /dev/null @@ -1,274 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage; - -use function array_diff; -use function array_diff_key; -use function array_flip; -use function array_intersect; -use function array_intersect_key; -use function count; -use function explode; -use function file_get_contents; -use function in_array; -use function is_file; -use function range; -use function trim; -use SebastianBergmann\CodeCoverage\Driver\Driver; -use SebastianBergmann\CodeCoverage\StaticAnalysis\FileAnalyser; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -final class RawCodeCoverageData -{ - /** - * @var array> - */ - private static $emptyLineCache = []; - - /** - * @var array - * - * @see https://xdebug.org/docs/code_coverage for format - */ - private $lineCoverage; - - /** - * @var array - * - * @see https://xdebug.org/docs/code_coverage for format - */ - private $functionCoverage; - - public static function fromXdebugWithoutPathCoverage(array $rawCoverage): self - { - return new self($rawCoverage, []); - } - - public static function fromXdebugWithPathCoverage(array $rawCoverage): self - { - $lineCoverage = []; - $functionCoverage = []; - - foreach ($rawCoverage as $file => $fileCoverageData) { - $lineCoverage[$file] = $fileCoverageData['lines']; - $functionCoverage[$file] = $fileCoverageData['functions']; - } - - return new self($lineCoverage, $functionCoverage); - } - - public static function fromXdebugWithMixedCoverage(array $rawCoverage): self - { - $lineCoverage = []; - $functionCoverage = []; - - foreach ($rawCoverage as $file => $fileCoverageData) { - if (!isset($fileCoverageData['functions'])) { - // Current file does not have functions, so line coverage - // is stored in $fileCoverageData, not in $fileCoverageData['lines'] - $lineCoverage[$file] = $fileCoverageData; - - continue; - } - - $lineCoverage[$file] = $fileCoverageData['lines']; - $functionCoverage[$file] = $fileCoverageData['functions']; - } - - return new self($lineCoverage, $functionCoverage); - } - - public static function fromUncoveredFile(string $filename, FileAnalyser $analyser): self - { - $lineCoverage = []; - - foreach ($analyser->executableLinesIn($filename) as $line => $branch) { - $lineCoverage[$line] = Driver::LINE_NOT_EXECUTED; - } - - return new self([$filename => $lineCoverage], []); - } - - private function __construct(array $lineCoverage, array $functionCoverage) - { - $this->lineCoverage = $lineCoverage; - $this->functionCoverage = $functionCoverage; - - $this->skipEmptyLines(); - } - - public function clear(): void - { - $this->lineCoverage = $this->functionCoverage = []; - } - - public function lineCoverage(): array - { - return $this->lineCoverage; - } - - public function functionCoverage(): array - { - return $this->functionCoverage; - } - - public function removeCoverageDataForFile(string $filename): void - { - unset($this->lineCoverage[$filename], $this->functionCoverage[$filename]); - } - - /** - * @param int[] $lines - */ - public function keepLineCoverageDataOnlyForLines(string $filename, array $lines): void - { - if (!isset($this->lineCoverage[$filename])) { - return; - } - - $this->lineCoverage[$filename] = array_intersect_key( - $this->lineCoverage[$filename], - array_flip($lines) - ); - } - - /** - * @param int[] $linesToBranchMap - */ - public function markExecutableLineByBranch(string $filename, array $linesToBranchMap): void - { - if (!isset($this->lineCoverage[$filename])) { - return; - } - - $linesByBranch = []; - - foreach ($linesToBranchMap as $line => $branch) { - $linesByBranch[$branch][] = $line; - } - - foreach ($this->lineCoverage[$filename] as $line => $lineStatus) { - if (!isset($linesToBranchMap[$line])) { - continue; - } - - $branch = $linesToBranchMap[$line]; - - if (!isset($linesByBranch[$branch])) { - continue; - } - - foreach ($linesByBranch[$branch] as $lineInBranch) { - $this->lineCoverage[$filename][$lineInBranch] = $lineStatus; - } - - if (Driver::LINE_EXECUTED === $lineStatus) { - unset($linesByBranch[$branch]); - } - } - } - - /** - * @param int[] $lines - */ - public function keepFunctionCoverageDataOnlyForLines(string $filename, array $lines): void - { - if (!isset($this->functionCoverage[$filename])) { - return; - } - - foreach ($this->functionCoverage[$filename] as $functionName => $functionData) { - foreach ($functionData['branches'] as $branchId => $branch) { - if (count(array_diff(range($branch['line_start'], $branch['line_end']), $lines)) > 0) { - unset($this->functionCoverage[$filename][$functionName]['branches'][$branchId]); - - foreach ($functionData['paths'] as $pathId => $path) { - if (in_array($branchId, $path['path'], true)) { - unset($this->functionCoverage[$filename][$functionName]['paths'][$pathId]); - } - } - } - } - } - } - - /** - * @param int[] $lines - */ - public function removeCoverageDataForLines(string $filename, array $lines): void - { - if (empty($lines)) { - return; - } - - if (!isset($this->lineCoverage[$filename])) { - return; - } - - $this->lineCoverage[$filename] = array_diff_key( - $this->lineCoverage[$filename], - array_flip($lines) - ); - - if (isset($this->functionCoverage[$filename])) { - foreach ($this->functionCoverage[$filename] as $functionName => $functionData) { - foreach ($functionData['branches'] as $branchId => $branch) { - if (count(array_intersect($lines, range($branch['line_start'], $branch['line_end']))) > 0) { - unset($this->functionCoverage[$filename][$functionName]['branches'][$branchId]); - - foreach ($functionData['paths'] as $pathId => $path) { - if (in_array($branchId, $path['path'], true)) { - unset($this->functionCoverage[$filename][$functionName]['paths'][$pathId]); - } - } - } - } - } - } - } - - /** - * At the end of a file, the PHP interpreter always sees an implicit return. Where this occurs in a file that has - * e.g. a class definition, that line cannot be invoked from a test and results in confusing coverage. This engine - * implementation detail therefore needs to be masked which is done here by simply ensuring that all empty lines - * are skipped over for coverage purposes. - * - * @see https://github.com/sebastianbergmann/php-code-coverage/issues/799 - */ - private function skipEmptyLines(): void - { - foreach ($this->lineCoverage as $filename => $coverage) { - foreach ($this->getEmptyLinesForFile($filename) as $emptyLine) { - unset($this->lineCoverage[$filename][$emptyLine]); - } - } - } - - private function getEmptyLinesForFile(string $filename): array - { - if (!isset(self::$emptyLineCache[$filename])) { - self::$emptyLineCache[$filename] = []; - - if (is_file($filename)) { - $sourceLines = explode("\n", file_get_contents($filename)); - - foreach ($sourceLines as $line => $source) { - if (trim($source) === '') { - self::$emptyLineCache[$filename][] = ($line + 1); - } - } - } - } - - return self::$emptyLineCache[$filename]; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Clover.php b/vendor/phpunit/php-code-coverage/src/Report/Clover.php deleted file mode 100644 index 75c731bb..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Clover.php +++ /dev/null @@ -1,255 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report; - -use function count; -use function dirname; -use function file_put_contents; -use function is_string; -use function ksort; -use function max; -use function range; -use function time; -use DOMDocument; -use SebastianBergmann\CodeCoverage\CodeCoverage; -use SebastianBergmann\CodeCoverage\Driver\WriteOperationFailedException; -use SebastianBergmann\CodeCoverage\Node\File; -use SebastianBergmann\CodeCoverage\Util\Filesystem; - -final class Clover -{ - /** - * @throws WriteOperationFailedException - */ - public function process(CodeCoverage $coverage, ?string $target = null, ?string $name = null): string - { - $time = (string) time(); - - $xmlDocument = new DOMDocument('1.0', 'UTF-8'); - $xmlDocument->formatOutput = true; - - $xmlCoverage = $xmlDocument->createElement('coverage'); - $xmlCoverage->setAttribute('generated', $time); - $xmlDocument->appendChild($xmlCoverage); - - $xmlProject = $xmlDocument->createElement('project'); - $xmlProject->setAttribute('timestamp', $time); - - if (is_string($name)) { - $xmlProject->setAttribute('name', $name); - } - - $xmlCoverage->appendChild($xmlProject); - - $packages = []; - $report = $coverage->getReport(); - - foreach ($report as $item) { - if (!$item instanceof File) { - continue; - } - - /* @var File $item */ - - $xmlFile = $xmlDocument->createElement('file'); - $xmlFile->setAttribute('name', $item->pathAsString()); - - $classes = $item->classesAndTraits(); - $coverageData = $item->lineCoverageData(); - $lines = []; - $namespace = 'global'; - - foreach ($classes as $className => $class) { - $classStatements = 0; - $coveredClassStatements = 0; - $coveredMethods = 0; - $classMethods = 0; - - foreach ($class['methods'] as $methodName => $method) { - if ($method['executableLines'] == 0) { - continue; - } - - $classMethods++; - $classStatements += $method['executableLines']; - $coveredClassStatements += $method['executedLines']; - - if ($method['coverage'] == 100) { - $coveredMethods++; - } - - $methodCount = 0; - - foreach (range($method['startLine'], $method['endLine']) as $line) { - if (isset($coverageData[$line]) && ($coverageData[$line] !== null)) { - $methodCount = max($methodCount, count($coverageData[$line])); - } - } - - $lines[$method['startLine']] = [ - 'ccn' => $method['ccn'], - 'count' => $methodCount, - 'crap' => $method['crap'], - 'type' => 'method', - 'visibility' => $method['visibility'], - 'name' => $methodName, - ]; - } - - if (!empty($class['package']['namespace'])) { - $namespace = $class['package']['namespace']; - } - - $xmlClass = $xmlDocument->createElement('class'); - $xmlClass->setAttribute('name', $className); - $xmlClass->setAttribute('namespace', $namespace); - - if (!empty($class['package']['fullPackage'])) { - $xmlClass->setAttribute( - 'fullPackage', - $class['package']['fullPackage'] - ); - } - - if (!empty($class['package']['category'])) { - $xmlClass->setAttribute( - 'category', - $class['package']['category'] - ); - } - - if (!empty($class['package']['package'])) { - $xmlClass->setAttribute( - 'package', - $class['package']['package'] - ); - } - - if (!empty($class['package']['subpackage'])) { - $xmlClass->setAttribute( - 'subpackage', - $class['package']['subpackage'] - ); - } - - $xmlFile->appendChild($xmlClass); - - $xmlMetrics = $xmlDocument->createElement('metrics'); - $xmlMetrics->setAttribute('complexity', (string) $class['ccn']); - $xmlMetrics->setAttribute('methods', (string) $classMethods); - $xmlMetrics->setAttribute('coveredmethods', (string) $coveredMethods); - $xmlMetrics->setAttribute('conditionals', (string) $class['executableBranches']); - $xmlMetrics->setAttribute('coveredconditionals', (string) $class['executedBranches']); - $xmlMetrics->setAttribute('statements', (string) $classStatements); - $xmlMetrics->setAttribute('coveredstatements', (string) $coveredClassStatements); - $xmlMetrics->setAttribute('elements', (string) ($classMethods + $classStatements + $class['executableBranches'])); - $xmlMetrics->setAttribute('coveredelements', (string) ($coveredMethods + $coveredClassStatements + $class['executedBranches'])); - $xmlClass->appendChild($xmlMetrics); - } - - foreach ($coverageData as $line => $data) { - if ($data === null || isset($lines[$line])) { - continue; - } - - $lines[$line] = [ - 'count' => count($data), 'type' => 'stmt', - ]; - } - - ksort($lines); - - foreach ($lines as $line => $data) { - $xmlLine = $xmlDocument->createElement('line'); - $xmlLine->setAttribute('num', (string) $line); - $xmlLine->setAttribute('type', $data['type']); - - if (isset($data['name'])) { - $xmlLine->setAttribute('name', $data['name']); - } - - if (isset($data['visibility'])) { - $xmlLine->setAttribute('visibility', $data['visibility']); - } - - if (isset($data['ccn'])) { - $xmlLine->setAttribute('complexity', (string) $data['ccn']); - } - - if (isset($data['crap'])) { - $xmlLine->setAttribute('crap', (string) $data['crap']); - } - - $xmlLine->setAttribute('count', (string) $data['count']); - $xmlFile->appendChild($xmlLine); - } - - $linesOfCode = $item->linesOfCode(); - - $xmlMetrics = $xmlDocument->createElement('metrics'); - $xmlMetrics->setAttribute('loc', (string) $linesOfCode['linesOfCode']); - $xmlMetrics->setAttribute('ncloc', (string) $linesOfCode['nonCommentLinesOfCode']); - $xmlMetrics->setAttribute('classes', (string) $item->numberOfClassesAndTraits()); - $xmlMetrics->setAttribute('methods', (string) $item->numberOfMethods()); - $xmlMetrics->setAttribute('coveredmethods', (string) $item->numberOfTestedMethods()); - $xmlMetrics->setAttribute('conditionals', (string) $item->numberOfExecutableBranches()); - $xmlMetrics->setAttribute('coveredconditionals', (string) $item->numberOfExecutedBranches()); - $xmlMetrics->setAttribute('statements', (string) $item->numberOfExecutableLines()); - $xmlMetrics->setAttribute('coveredstatements', (string) $item->numberOfExecutedLines()); - $xmlMetrics->setAttribute('elements', (string) ($item->numberOfMethods() + $item->numberOfExecutableLines() + $item->numberOfExecutableBranches())); - $xmlMetrics->setAttribute('coveredelements', (string) ($item->numberOfTestedMethods() + $item->numberOfExecutedLines() + $item->numberOfExecutedBranches())); - $xmlFile->appendChild($xmlMetrics); - - if ($namespace === 'global') { - $xmlProject->appendChild($xmlFile); - } else { - if (!isset($packages[$namespace])) { - $packages[$namespace] = $xmlDocument->createElement( - 'package' - ); - - $packages[$namespace]->setAttribute('name', $namespace); - $xmlProject->appendChild($packages[$namespace]); - } - - $packages[$namespace]->appendChild($xmlFile); - } - } - - $linesOfCode = $report->linesOfCode(); - - $xmlMetrics = $xmlDocument->createElement('metrics'); - $xmlMetrics->setAttribute('files', (string) count($report)); - $xmlMetrics->setAttribute('loc', (string) $linesOfCode['linesOfCode']); - $xmlMetrics->setAttribute('ncloc', (string) $linesOfCode['nonCommentLinesOfCode']); - $xmlMetrics->setAttribute('classes', (string) $report->numberOfClassesAndTraits()); - $xmlMetrics->setAttribute('methods', (string) $report->numberOfMethods()); - $xmlMetrics->setAttribute('coveredmethods', (string) $report->numberOfTestedMethods()); - $xmlMetrics->setAttribute('conditionals', (string) $report->numberOfExecutableBranches()); - $xmlMetrics->setAttribute('coveredconditionals', (string) $report->numberOfExecutedBranches()); - $xmlMetrics->setAttribute('statements', (string) $report->numberOfExecutableLines()); - $xmlMetrics->setAttribute('coveredstatements', (string) $report->numberOfExecutedLines()); - $xmlMetrics->setAttribute('elements', (string) ($report->numberOfMethods() + $report->numberOfExecutableLines() + $report->numberOfExecutableBranches())); - $xmlMetrics->setAttribute('coveredelements', (string) ($report->numberOfTestedMethods() + $report->numberOfExecutedLines() + $report->numberOfExecutedBranches())); - $xmlProject->appendChild($xmlMetrics); - - $buffer = $xmlDocument->saveXML(); - - if ($target !== null) { - Filesystem::createDirectory(dirname($target)); - - if (@file_put_contents($target, $buffer) === false) { - throw new WriteOperationFailedException($target); - } - } - - return $buffer; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Cobertura.php b/vendor/phpunit/php-code-coverage/src/Report/Cobertura.php deleted file mode 100644 index 0d1dde76..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Cobertura.php +++ /dev/null @@ -1,306 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report; - -use function basename; -use function count; -use function dirname; -use function file_put_contents; -use function preg_match; -use function range; -use function str_replace; -use function time; -use DOMImplementation; -use SebastianBergmann\CodeCoverage\CodeCoverage; -use SebastianBergmann\CodeCoverage\Driver\WriteOperationFailedException; -use SebastianBergmann\CodeCoverage\Node\File; -use SebastianBergmann\CodeCoverage\Util\Filesystem; - -final class Cobertura -{ - /** - * @throws WriteOperationFailedException - */ - public function process(CodeCoverage $coverage, ?string $target = null): string - { - $time = (string) time(); - - $report = $coverage->getReport(); - - $implementation = new DOMImplementation; - - $documentType = $implementation->createDocumentType( - 'coverage', - '', - 'http://cobertura.sourceforge.net/xml/coverage-04.dtd' - ); - - $document = $implementation->createDocument('', '', $documentType); - $document->xmlVersion = '1.0'; - $document->encoding = 'UTF-8'; - $document->formatOutput = true; - - $coverageElement = $document->createElement('coverage'); - - $linesValid = $report->numberOfExecutableLines(); - $linesCovered = $report->numberOfExecutedLines(); - $lineRate = $linesValid === 0 ? 0 : ($linesCovered / $linesValid); - $coverageElement->setAttribute('line-rate', (string) $lineRate); - - $branchesValid = $report->numberOfExecutableBranches(); - $branchesCovered = $report->numberOfExecutedBranches(); - $branchRate = $branchesValid === 0 ? 0 : ($branchesCovered / $branchesValid); - $coverageElement->setAttribute('branch-rate', (string) $branchRate); - - $coverageElement->setAttribute('lines-covered', (string) $report->numberOfExecutedLines()); - $coverageElement->setAttribute('lines-valid', (string) $report->numberOfExecutableLines()); - $coverageElement->setAttribute('branches-covered', (string) $report->numberOfExecutedBranches()); - $coverageElement->setAttribute('branches-valid', (string) $report->numberOfExecutableBranches()); - $coverageElement->setAttribute('complexity', ''); - $coverageElement->setAttribute('version', '0.4'); - $coverageElement->setAttribute('timestamp', $time); - - $document->appendChild($coverageElement); - - $sourcesElement = $document->createElement('sources'); - $coverageElement->appendChild($sourcesElement); - - $sourceElement = $document->createElement('source', $report->pathAsString()); - $sourcesElement->appendChild($sourceElement); - - $packagesElement = $document->createElement('packages'); - $coverageElement->appendChild($packagesElement); - - $complexity = 0; - - foreach ($report as $item) { - if (!$item instanceof File) { - continue; - } - - $packageElement = $document->createElement('package'); - $packageComplexity = 0; - - $packageElement->setAttribute('name', str_replace($report->pathAsString() . DIRECTORY_SEPARATOR, '', $item->pathAsString())); - - $linesValid = $item->numberOfExecutableLines(); - $linesCovered = $item->numberOfExecutedLines(); - $lineRate = $linesValid === 0 ? 0 : ($linesCovered / $linesValid); - - $packageElement->setAttribute('line-rate', (string) $lineRate); - - $branchesValid = $item->numberOfExecutableBranches(); - $branchesCovered = $item->numberOfExecutedBranches(); - $branchRate = $branchesValid === 0 ? 0 : ($branchesCovered / $branchesValid); - - $packageElement->setAttribute('branch-rate', (string) $branchRate); - - $packageElement->setAttribute('complexity', ''); - $packagesElement->appendChild($packageElement); - - $classesElement = $document->createElement('classes'); - - $packageElement->appendChild($classesElement); - - $classes = $item->classesAndTraits(); - $coverageData = $item->lineCoverageData(); - - foreach ($classes as $className => $class) { - $complexity += $class['ccn']; - $packageComplexity += $class['ccn']; - - if (!empty($class['package']['namespace'])) { - $className = $class['package']['namespace'] . '\\' . $className; - } - - $linesValid = $class['executableLines']; - $linesCovered = $class['executedLines']; - $lineRate = $linesValid === 0 ? 0 : ($linesCovered / $linesValid); - - $branchesValid = $class['executableBranches']; - $branchesCovered = $class['executedBranches']; - $branchRate = $branchesValid === 0 ? 0 : ($branchesCovered / $branchesValid); - - $classElement = $document->createElement('class'); - - $classElement->setAttribute('name', $className); - $classElement->setAttribute('filename', str_replace($report->pathAsString() . DIRECTORY_SEPARATOR, '', $item->pathAsString())); - $classElement->setAttribute('line-rate', (string) $lineRate); - $classElement->setAttribute('branch-rate', (string) $branchRate); - $classElement->setAttribute('complexity', (string) $class['ccn']); - - $classesElement->appendChild($classElement); - - $methodsElement = $document->createElement('methods'); - - $classElement->appendChild($methodsElement); - - $classLinesElement = $document->createElement('lines'); - - $classElement->appendChild($classLinesElement); - - foreach ($class['methods'] as $methodName => $method) { - if ($method['executableLines'] === 0) { - continue; - } - - preg_match("/\((.*?)\)/", $method['signature'], $signature); - - $linesValid = $method['executableLines']; - $linesCovered = $method['executedLines']; - $lineRate = $linesValid === 0 ? 0 : ($linesCovered / $linesValid); - - $branchesValid = $method['executableBranches']; - $branchesCovered = $method['executedBranches']; - $branchRate = $branchesValid === 0 ? 0 : ($branchesCovered / $branchesValid); - - $methodElement = $document->createElement('method'); - - $methodElement->setAttribute('name', $methodName); - $methodElement->setAttribute('signature', $signature[1]); - $methodElement->setAttribute('line-rate', (string) $lineRate); - $methodElement->setAttribute('branch-rate', (string) $branchRate); - $methodElement->setAttribute('complexity', (string) $method['ccn']); - - $methodLinesElement = $document->createElement('lines'); - - $methodElement->appendChild($methodLinesElement); - - foreach (range($method['startLine'], $method['endLine']) as $line) { - if (!isset($coverageData[$line]) || $coverageData[$line] === null) { - continue; - } - $methodLineElement = $document->createElement('line'); - - $methodLineElement->setAttribute('number', (string) $line); - $methodLineElement->setAttribute('hits', (string) count($coverageData[$line])); - - $methodLinesElement->appendChild($methodLineElement); - - $classLineElement = $methodLineElement->cloneNode(); - - $classLinesElement->appendChild($classLineElement); - } - - $methodsElement->appendChild($methodElement); - } - } - - if ($report->numberOfFunctions() === 0) { - $packageElement->setAttribute('complexity', (string) $packageComplexity); - - continue; - } - - $functionsComplexity = 0; - $functionsLinesValid = 0; - $functionsLinesCovered = 0; - $functionsBranchesValid = 0; - $functionsBranchesCovered = 0; - - $classElement = $document->createElement('class'); - $classElement->setAttribute('name', basename($item->pathAsString())); - $classElement->setAttribute('filename', str_replace($report->pathAsString() . DIRECTORY_SEPARATOR, '', $item->pathAsString())); - - $methodsElement = $document->createElement('methods'); - - $classElement->appendChild($methodsElement); - - $classLinesElement = $document->createElement('lines'); - - $classElement->appendChild($classLinesElement); - - $functions = $report->functions(); - - foreach ($functions as $functionName => $function) { - if ($function['executableLines'] === 0) { - continue; - } - - $complexity += $function['ccn']; - $packageComplexity += $function['ccn']; - $functionsComplexity += $function['ccn']; - - $linesValid = $function['executableLines']; - $linesCovered = $function['executedLines']; - $lineRate = $linesValid === 0 ? 0 : ($linesCovered / $linesValid); - - $functionsLinesValid += $linesValid; - $functionsLinesCovered += $linesCovered; - - $branchesValid = $function['executableBranches']; - $branchesCovered = $function['executedBranches']; - $branchRate = $branchesValid === 0 ? 0 : ($branchesCovered / $branchesValid); - - $functionsBranchesValid += $branchesValid; - $functionsBranchesCovered += $branchesValid; - - $methodElement = $document->createElement('method'); - - $methodElement->setAttribute('name', $functionName); - $methodElement->setAttribute('signature', $function['signature']); - $methodElement->setAttribute('line-rate', (string) $lineRate); - $methodElement->setAttribute('branch-rate', (string) $branchRate); - $methodElement->setAttribute('complexity', (string) $function['ccn']); - - $methodLinesElement = $document->createElement('lines'); - - $methodElement->appendChild($methodLinesElement); - - foreach (range($function['startLine'], $function['endLine']) as $line) { - if (!isset($coverageData[$line]) || $coverageData[$line] === null) { - continue; - } - $methodLineElement = $document->createElement('line'); - - $methodLineElement->setAttribute('number', (string) $line); - $methodLineElement->setAttribute('hits', (string) count($coverageData[$line])); - - $methodLinesElement->appendChild($methodLineElement); - - $classLineElement = $methodLineElement->cloneNode(); - - $classLinesElement->appendChild($classLineElement); - } - - $methodsElement->appendChild($methodElement); - } - - $packageElement->setAttribute('complexity', (string) $packageComplexity); - - if ($functionsLinesValid === 0) { - continue; - } - - $lineRate = $functionsLinesCovered / $functionsLinesValid; - $branchRate = $functionsBranchesValid === 0 ? 0 : ($functionsBranchesCovered / $functionsBranchesValid); - - $classElement->setAttribute('line-rate', (string) $lineRate); - $classElement->setAttribute('branch-rate', (string) $branchRate); - $classElement->setAttribute('complexity', (string) $functionsComplexity); - - $classesElement->appendChild($classElement); - } - - $coverageElement->setAttribute('complexity', (string) $complexity); - - $buffer = $document->saveXML(); - - if ($target !== null) { - Filesystem::createDirectory(dirname($target)); - - if (@file_put_contents($target, $buffer) === false) { - throw new WriteOperationFailedException($target); - } - } - - return $buffer; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Crap4j.php b/vendor/phpunit/php-code-coverage/src/Report/Crap4j.php deleted file mode 100644 index 91f8ed59..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Crap4j.php +++ /dev/null @@ -1,153 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report; - -use function date; -use function dirname; -use function file_put_contents; -use function htmlspecialchars; -use function is_string; -use function round; -use DOMDocument; -use SebastianBergmann\CodeCoverage\CodeCoverage; -use SebastianBergmann\CodeCoverage\Driver\WriteOperationFailedException; -use SebastianBergmann\CodeCoverage\Node\File; -use SebastianBergmann\CodeCoverage\Util\Filesystem; - -final class Crap4j -{ - /** - * @var int - */ - private $threshold; - - public function __construct(int $threshold = 30) - { - $this->threshold = $threshold; - } - - /** - * @throws WriteOperationFailedException - */ - public function process(CodeCoverage $coverage, ?string $target = null, ?string $name = null): string - { - $document = new DOMDocument('1.0', 'UTF-8'); - $document->formatOutput = true; - - $root = $document->createElement('crap_result'); - $document->appendChild($root); - - $project = $document->createElement('project', is_string($name) ? $name : ''); - $root->appendChild($project); - $root->appendChild($document->createElement('timestamp', date('Y-m-d H:i:s'))); - - $stats = $document->createElement('stats'); - $methodsNode = $document->createElement('methods'); - - $report = $coverage->getReport(); - unset($coverage); - - $fullMethodCount = 0; - $fullCrapMethodCount = 0; - $fullCrapLoad = 0; - $fullCrap = 0; - - foreach ($report as $item) { - $namespace = 'global'; - - if (!$item instanceof File) { - continue; - } - - $file = $document->createElement('file'); - $file->setAttribute('name', $item->pathAsString()); - - $classes = $item->classesAndTraits(); - - foreach ($classes as $className => $class) { - foreach ($class['methods'] as $methodName => $method) { - $crapLoad = $this->crapLoad((float) $method['crap'], $method['ccn'], $method['coverage']); - - $fullCrap += $method['crap']; - $fullCrapLoad += $crapLoad; - $fullMethodCount++; - - if ($method['crap'] >= $this->threshold) { - $fullCrapMethodCount++; - } - - $methodNode = $document->createElement('method'); - - if (!empty($class['namespace'])) { - $namespace = $class['namespace']; - } - - $methodNode->appendChild($document->createElement('package', $namespace)); - $methodNode->appendChild($document->createElement('className', $className)); - $methodNode->appendChild($document->createElement('methodName', $methodName)); - $methodNode->appendChild($document->createElement('methodSignature', htmlspecialchars($method['signature']))); - $methodNode->appendChild($document->createElement('fullMethod', htmlspecialchars($method['signature']))); - $methodNode->appendChild($document->createElement('crap', (string) $this->roundValue((float) $method['crap']))); - $methodNode->appendChild($document->createElement('complexity', (string) $method['ccn'])); - $methodNode->appendChild($document->createElement('coverage', (string) $this->roundValue($method['coverage']))); - $methodNode->appendChild($document->createElement('crapLoad', (string) round($crapLoad))); - - $methodsNode->appendChild($methodNode); - } - } - } - - $stats->appendChild($document->createElement('name', 'Method Crap Stats')); - $stats->appendChild($document->createElement('methodCount', (string) $fullMethodCount)); - $stats->appendChild($document->createElement('crapMethodCount', (string) $fullCrapMethodCount)); - $stats->appendChild($document->createElement('crapLoad', (string) round($fullCrapLoad))); - $stats->appendChild($document->createElement('totalCrap', (string) $fullCrap)); - - $crapMethodPercent = 0; - - if ($fullMethodCount > 0) { - $crapMethodPercent = $this->roundValue((100 * $fullCrapMethodCount) / $fullMethodCount); - } - - $stats->appendChild($document->createElement('crapMethodPercent', (string) $crapMethodPercent)); - - $root->appendChild($stats); - $root->appendChild($methodsNode); - - $buffer = $document->saveXML(); - - if ($target !== null) { - Filesystem::createDirectory(dirname($target)); - - if (@file_put_contents($target, $buffer) === false) { - throw new WriteOperationFailedException($target); - } - } - - return $buffer; - } - - private function crapLoad(float $crapValue, int $cyclomaticComplexity, float $coveragePercent): float - { - $crapLoad = 0; - - if ($crapValue >= $this->threshold) { - $crapLoad += $cyclomaticComplexity * (1.0 - $coveragePercent / 100); - $crapLoad += $cyclomaticComplexity / $this->threshold; - } - - return $crapLoad; - } - - private function roundValue(float $value): float - { - return round($value, 2); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Facade.php b/vendor/phpunit/php-code-coverage/src/Report/Html/Facade.php deleted file mode 100644 index 69935d73..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Facade.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. - */ -namespace SebastianBergmann\CodeCoverage\Report\Html; - -use const DIRECTORY_SEPARATOR; -use function copy; -use function date; -use function dirname; -use function substr; -use SebastianBergmann\CodeCoverage\CodeCoverage; -use SebastianBergmann\CodeCoverage\InvalidArgumentException; -use SebastianBergmann\CodeCoverage\Node\Directory as DirectoryNode; -use SebastianBergmann\CodeCoverage\Util\Filesystem; - -final class Facade -{ - /** - * @var string - */ - private $templatePath; - - /** - * @var string - */ - private $generator; - - /** - * @var int - */ - private $lowUpperBound; - - /** - * @var int - */ - private $highLowerBound; - - public function __construct(int $lowUpperBound = 50, int $highLowerBound = 90, string $generator = '') - { - if ($lowUpperBound > $highLowerBound) { - throw new InvalidArgumentException( - '$lowUpperBound must not be larger than $highLowerBound' - ); - } - - $this->generator = $generator; - $this->highLowerBound = $highLowerBound; - $this->lowUpperBound = $lowUpperBound; - $this->templatePath = __DIR__ . '/Renderer/Template/'; - } - - public function process(CodeCoverage $coverage, string $target): void - { - $target = $this->directory($target); - $report = $coverage->getReport(); - $date = date('D M j G:i:s T Y'); - - $dashboard = new Dashboard( - $this->templatePath, - $this->generator, - $date, - $this->lowUpperBound, - $this->highLowerBound, - $coverage->collectsBranchAndPathCoverage() - ); - - $directory = new Directory( - $this->templatePath, - $this->generator, - $date, - $this->lowUpperBound, - $this->highLowerBound, - $coverage->collectsBranchAndPathCoverage() - ); - - $file = new File( - $this->templatePath, - $this->generator, - $date, - $this->lowUpperBound, - $this->highLowerBound, - $coverage->collectsBranchAndPathCoverage() - ); - - $directory->render($report, $target . 'index.html'); - $dashboard->render($report, $target . 'dashboard.html'); - - foreach ($report as $node) { - $id = $node->id(); - - if ($node instanceof DirectoryNode) { - Filesystem::createDirectory($target . $id); - - $directory->render($node, $target . $id . '/index.html'); - $dashboard->render($node, $target . $id . '/dashboard.html'); - } else { - $dir = dirname($target . $id); - - Filesystem::createDirectory($dir); - - $file->render($node, $target . $id); - } - } - - $this->copyFiles($target); - } - - private function copyFiles(string $target): void - { - $dir = $this->directory($target . '_css'); - - copy($this->templatePath . 'css/bootstrap.min.css', $dir . 'bootstrap.min.css'); - copy($this->templatePath . 'css/nv.d3.min.css', $dir . 'nv.d3.min.css'); - copy($this->templatePath . 'css/style.css', $dir . 'style.css'); - copy($this->templatePath . 'css/custom.css', $dir . 'custom.css'); - copy($this->templatePath . 'css/octicons.css', $dir . 'octicons.css'); - - $dir = $this->directory($target . '_icons'); - copy($this->templatePath . 'icons/file-code.svg', $dir . 'file-code.svg'); - copy($this->templatePath . 'icons/file-directory.svg', $dir . 'file-directory.svg'); - - $dir = $this->directory($target . '_js'); - copy($this->templatePath . 'js/bootstrap.min.js', $dir . 'bootstrap.min.js'); - copy($this->templatePath . 'js/popper.min.js', $dir . 'popper.min.js'); - copy($this->templatePath . 'js/d3.min.js', $dir . 'd3.min.js'); - copy($this->templatePath . 'js/jquery.min.js', $dir . 'jquery.min.js'); - copy($this->templatePath . 'js/nv.d3.min.js', $dir . 'nv.d3.min.js'); - copy($this->templatePath . 'js/file.js', $dir . 'file.js'); - } - - private function directory(string $directory): string - { - if (substr($directory, -1, 1) != DIRECTORY_SEPARATOR) { - $directory .= DIRECTORY_SEPARATOR; - } - - Filesystem::createDirectory($directory); - - return $directory; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer.php b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer.php deleted file mode 100644 index fe285b18..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer.php +++ /dev/null @@ -1,314 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report\Html; - -use function array_pop; -use function count; -use function sprintf; -use function str_repeat; -use function substr_count; -use SebastianBergmann\CodeCoverage\Node\AbstractNode; -use SebastianBergmann\CodeCoverage\Node\Directory as DirectoryNode; -use SebastianBergmann\CodeCoverage\Node\File as FileNode; -use SebastianBergmann\CodeCoverage\Version; -use SebastianBergmann\Environment\Runtime; -use SebastianBergmann\Template\Template; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -abstract class Renderer -{ - /** - * @var string - */ - protected $templatePath; - - /** - * @var string - */ - protected $generator; - - /** - * @var string - */ - protected $date; - - /** - * @var int - */ - protected $lowUpperBound; - - /** - * @var int - */ - protected $highLowerBound; - - /** - * @var bool - */ - protected $hasBranchCoverage; - - /** - * @var string - */ - protected $version; - - public function __construct(string $templatePath, string $generator, string $date, int $lowUpperBound, int $highLowerBound, bool $hasBranchCoverage) - { - $this->templatePath = $templatePath; - $this->generator = $generator; - $this->date = $date; - $this->lowUpperBound = $lowUpperBound; - $this->highLowerBound = $highLowerBound; - $this->version = Version::id(); - $this->hasBranchCoverage = $hasBranchCoverage; - } - - protected function renderItemTemplate(Template $template, array $data): string - { - $numSeparator = ' / '; - - if (isset($data['numClasses']) && $data['numClasses'] > 0) { - $classesLevel = $this->colorLevel($data['testedClassesPercent']); - - $classesNumber = $data['numTestedClasses'] . $numSeparator . - $data['numClasses']; - - $classesBar = $this->coverageBar( - $data['testedClassesPercent'] - ); - } else { - $classesLevel = ''; - $classesNumber = '0' . $numSeparator . '0'; - $classesBar = ''; - $data['testedClassesPercentAsString'] = 'n/a'; - } - - if ($data['numMethods'] > 0) { - $methodsLevel = $this->colorLevel($data['testedMethodsPercent']); - - $methodsNumber = $data['numTestedMethods'] . $numSeparator . - $data['numMethods']; - - $methodsBar = $this->coverageBar( - $data['testedMethodsPercent'] - ); - } else { - $methodsLevel = ''; - $methodsNumber = '0' . $numSeparator . '0'; - $methodsBar = ''; - $data['testedMethodsPercentAsString'] = 'n/a'; - } - - if ($data['numExecutableLines'] > 0) { - $linesLevel = $this->colorLevel($data['linesExecutedPercent']); - - $linesNumber = $data['numExecutedLines'] . $numSeparator . - $data['numExecutableLines']; - - $linesBar = $this->coverageBar( - $data['linesExecutedPercent'] - ); - } else { - $linesLevel = ''; - $linesNumber = '0' . $numSeparator . '0'; - $linesBar = ''; - $data['linesExecutedPercentAsString'] = 'n/a'; - } - - if ($data['numExecutablePaths'] > 0) { - $pathsLevel = $this->colorLevel($data['pathsExecutedPercent']); - - $pathsNumber = $data['numExecutedPaths'] . $numSeparator . - $data['numExecutablePaths']; - - $pathsBar = $this->coverageBar( - $data['pathsExecutedPercent'] - ); - } else { - $pathsLevel = ''; - $pathsNumber = '0' . $numSeparator . '0'; - $pathsBar = ''; - $data['pathsExecutedPercentAsString'] = 'n/a'; - } - - if ($data['numExecutableBranches'] > 0) { - $branchesLevel = $this->colorLevel($data['branchesExecutedPercent']); - - $branchesNumber = $data['numExecutedBranches'] . $numSeparator . - $data['numExecutableBranches']; - - $branchesBar = $this->coverageBar( - $data['branchesExecutedPercent'] - ); - } else { - $branchesLevel = ''; - $branchesNumber = '0' . $numSeparator . '0'; - $branchesBar = ''; - $data['branchesExecutedPercentAsString'] = 'n/a'; - } - - $template->setVar( - [ - 'icon' => $data['icon'] ?? '', - 'crap' => $data['crap'] ?? '', - 'name' => $data['name'], - 'lines_bar' => $linesBar, - 'lines_executed_percent' => $data['linesExecutedPercentAsString'], - 'lines_level' => $linesLevel, - 'lines_number' => $linesNumber, - 'paths_bar' => $pathsBar, - 'paths_executed_percent' => $data['pathsExecutedPercentAsString'], - 'paths_level' => $pathsLevel, - 'paths_number' => $pathsNumber, - 'branches_bar' => $branchesBar, - 'branches_executed_percent' => $data['branchesExecutedPercentAsString'], - 'branches_level' => $branchesLevel, - 'branches_number' => $branchesNumber, - 'methods_bar' => $methodsBar, - 'methods_tested_percent' => $data['testedMethodsPercentAsString'], - 'methods_level' => $methodsLevel, - 'methods_number' => $methodsNumber, - 'classes_bar' => $classesBar, - 'classes_tested_percent' => $data['testedClassesPercentAsString'] ?? '', - 'classes_level' => $classesLevel, - 'classes_number' => $classesNumber, - ] - ); - - return $template->render(); - } - - protected function setCommonTemplateVariables(Template $template, AbstractNode $node): void - { - $template->setVar( - [ - 'id' => $node->id(), - 'full_path' => $node->pathAsString(), - 'path_to_root' => $this->pathToRoot($node), - 'breadcrumbs' => $this->breadcrumbs($node), - 'date' => $this->date, - 'version' => $this->version, - 'runtime' => $this->runtimeString(), - 'generator' => $this->generator, - 'low_upper_bound' => $this->lowUpperBound, - 'high_lower_bound' => $this->highLowerBound, - ] - ); - } - - protected function breadcrumbs(AbstractNode $node): string - { - $breadcrumbs = ''; - $path = $node->pathAsArray(); - $pathToRoot = []; - $max = count($path); - - if ($node instanceof FileNode) { - $max--; - } - - for ($i = 0; $i < $max; $i++) { - $pathToRoot[] = str_repeat('../', $i); - } - - foreach ($path as $step) { - if ($step !== $node) { - $breadcrumbs .= $this->inactiveBreadcrumb( - $step, - array_pop($pathToRoot) - ); - } else { - $breadcrumbs .= $this->activeBreadcrumb($step); - } - } - - return $breadcrumbs; - } - - protected function activeBreadcrumb(AbstractNode $node): string - { - $buffer = sprintf( - ' ' . "\n", - $node->name() - ); - - if ($node instanceof DirectoryNode) { - $buffer .= ' ' . "\n"; - } - - return $buffer; - } - - protected function inactiveBreadcrumb(AbstractNode $node, string $pathToRoot): string - { - return sprintf( - ' ' . "\n", - $pathToRoot, - $node->name() - ); - } - - protected function pathToRoot(AbstractNode $node): string - { - $id = $node->id(); - $depth = substr_count($id, '/'); - - if ($id !== 'index' && - $node instanceof DirectoryNode) { - $depth++; - } - - return str_repeat('../', $depth); - } - - protected function coverageBar(float $percent): string - { - $level = $this->colorLevel($percent); - - $templateName = $this->templatePath . ($this->hasBranchCoverage ? 'coverage_bar_branch.html' : 'coverage_bar.html'); - $template = new Template( - $templateName, - '{{', - '}}' - ); - - $template->setVar(['level' => $level, 'percent' => sprintf('%.2F', $percent)]); - - return $template->render(); - } - - protected function colorLevel(float $percent): string - { - if ($percent <= $this->lowUpperBound) { - return 'danger'; - } - - if ($percent > $this->lowUpperBound && - $percent < $this->highLowerBound) { - return 'warning'; - } - - return 'success'; - } - - private function runtimeString(): string - { - $runtime = new Runtime; - - return sprintf( - '%s %s', - $runtime->getVendorUrl(), - $runtime->getName(), - $runtime->getVersion() - ); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Dashboard.php b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Dashboard.php deleted file mode 100644 index b44870b5..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Dashboard.php +++ /dev/null @@ -1,288 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report\Html; - -use function array_values; -use function arsort; -use function asort; -use function count; -use function explode; -use function floor; -use function json_encode; -use function sprintf; -use function str_replace; -use SebastianBergmann\CodeCoverage\Node\AbstractNode; -use SebastianBergmann\CodeCoverage\Node\Directory as DirectoryNode; -use SebastianBergmann\Template\Template; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -final class Dashboard extends Renderer -{ - public function render(DirectoryNode $node, string $file): void - { - $classes = $node->classesAndTraits(); - $templateName = $this->templatePath . ($this->hasBranchCoverage ? 'dashboard_branch.html' : 'dashboard.html'); - $template = new Template( - $templateName, - '{{', - '}}' - ); - - $this->setCommonTemplateVariables($template, $node); - - $baseLink = $node->id() . '/'; - $complexity = $this->complexity($classes, $baseLink); - $coverageDistribution = $this->coverageDistribution($classes); - $insufficientCoverage = $this->insufficientCoverage($classes, $baseLink); - $projectRisks = $this->projectRisks($classes, $baseLink); - - $template->setVar( - [ - 'insufficient_coverage_classes' => $insufficientCoverage['class'], - 'insufficient_coverage_methods' => $insufficientCoverage['method'], - 'project_risks_classes' => $projectRisks['class'], - 'project_risks_methods' => $projectRisks['method'], - 'complexity_class' => $complexity['class'], - 'complexity_method' => $complexity['method'], - 'class_coverage_distribution' => $coverageDistribution['class'], - 'method_coverage_distribution' => $coverageDistribution['method'], - ] - ); - - $template->renderTo($file); - } - - protected function activeBreadcrumb(AbstractNode $node): string - { - return sprintf( - ' ' . "\n" . - ' ' . "\n", - $node->name() - ); - } - - /** - * Returns the data for the Class/Method Complexity charts. - */ - private function complexity(array $classes, string $baseLink): array - { - $result = ['class' => [], 'method' => []]; - - foreach ($classes as $className => $class) { - foreach ($class['methods'] as $methodName => $method) { - if ($className !== '*') { - $methodName = $className . '::' . $methodName; - } - - $result['method'][] = [ - $method['coverage'], - $method['ccn'], - sprintf( - '%s', - str_replace($baseLink, '', $method['link']), - $methodName - ), - ]; - } - - $result['class'][] = [ - $class['coverage'], - $class['ccn'], - sprintf( - '%s', - str_replace($baseLink, '', $class['link']), - $className - ), - ]; - } - - return [ - 'class' => json_encode($result['class']), - 'method' => json_encode($result['method']), - ]; - } - - /** - * Returns the data for the Class / Method Coverage Distribution chart. - */ - private function coverageDistribution(array $classes): array - { - $result = [ - 'class' => [ - '0%' => 0, - '0-10%' => 0, - '10-20%' => 0, - '20-30%' => 0, - '30-40%' => 0, - '40-50%' => 0, - '50-60%' => 0, - '60-70%' => 0, - '70-80%' => 0, - '80-90%' => 0, - '90-100%' => 0, - '100%' => 0, - ], - 'method' => [ - '0%' => 0, - '0-10%' => 0, - '10-20%' => 0, - '20-30%' => 0, - '30-40%' => 0, - '40-50%' => 0, - '50-60%' => 0, - '60-70%' => 0, - '70-80%' => 0, - '80-90%' => 0, - '90-100%' => 0, - '100%' => 0, - ], - ]; - - foreach ($classes as $class) { - foreach ($class['methods'] as $methodName => $method) { - if ($method['coverage'] === 0) { - $result['method']['0%']++; - } elseif ($method['coverage'] === 100) { - $result['method']['100%']++; - } else { - $key = floor($method['coverage'] / 10) * 10; - $key = $key . '-' . ($key + 10) . '%'; - $result['method'][$key]++; - } - } - - if ($class['coverage'] === 0) { - $result['class']['0%']++; - } elseif ($class['coverage'] === 100) { - $result['class']['100%']++; - } else { - $key = floor($class['coverage'] / 10) * 10; - $key = $key . '-' . ($key + 10) . '%'; - $result['class'][$key]++; - } - } - - return [ - 'class' => json_encode(array_values($result['class'])), - 'method' => json_encode(array_values($result['method'])), - ]; - } - - /** - * Returns the classes / methods with insufficient coverage. - */ - private function insufficientCoverage(array $classes, string $baseLink): array - { - $leastTestedClasses = []; - $leastTestedMethods = []; - $result = ['class' => '', 'method' => '']; - - foreach ($classes as $className => $class) { - foreach ($class['methods'] as $methodName => $method) { - if ($method['coverage'] < $this->highLowerBound) { - $key = $methodName; - - if ($className !== '*') { - $key = $className . '::' . $methodName; - } - - $leastTestedMethods[$key] = $method['coverage']; - } - } - - if ($class['coverage'] < $this->highLowerBound) { - $leastTestedClasses[$className] = $class['coverage']; - } - } - - asort($leastTestedClasses); - asort($leastTestedMethods); - - foreach ($leastTestedClasses as $className => $coverage) { - $result['class'] .= sprintf( - ' %s%d%%' . "\n", - str_replace($baseLink, '', $classes[$className]['link']), - $className, - $coverage - ); - } - - foreach ($leastTestedMethods as $methodName => $coverage) { - [$class, $method] = explode('::', $methodName); - - $result['method'] .= sprintf( - ' %s%d%%' . "\n", - str_replace($baseLink, '', $classes[$class]['methods'][$method]['link']), - $methodName, - $method, - $coverage - ); - } - - return $result; - } - - /** - * Returns the project risks according to the CRAP index. - */ - private function projectRisks(array $classes, string $baseLink): array - { - $classRisks = []; - $methodRisks = []; - $result = ['class' => '', 'method' => '']; - - foreach ($classes as $className => $class) { - foreach ($class['methods'] as $methodName => $method) { - if ($method['coverage'] < $this->highLowerBound && $method['ccn'] > 1) { - $key = $methodName; - - if ($className !== '*') { - $key = $className . '::' . $methodName; - } - - $methodRisks[$key] = $method['crap']; - } - } - - if ($class['coverage'] < $this->highLowerBound && - $class['ccn'] > count($class['methods'])) { - $classRisks[$className] = $class['crap']; - } - } - - arsort($classRisks); - arsort($methodRisks); - - foreach ($classRisks as $className => $crap) { - $result['class'] .= sprintf( - ' %s%d' . "\n", - str_replace($baseLink, '', $classes[$className]['link']), - $className, - $crap - ); - } - - foreach ($methodRisks as $methodName => $crap) { - [$class, $method] = explode('::', $methodName); - - $result['method'] .= sprintf( - ' %s%d' . "\n", - str_replace($baseLink, '', $classes[$class]['methods'][$method]['link']), - $methodName, - $method, - $crap - ); - } - - return $result; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Directory.php b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Directory.php deleted file mode 100644 index faacbc31..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Directory.php +++ /dev/null @@ -1,113 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report\Html; - -use function count; -use function sprintf; -use function str_repeat; -use SebastianBergmann\CodeCoverage\Node\AbstractNode as Node; -use SebastianBergmann\CodeCoverage\Node\Directory as DirectoryNode; -use SebastianBergmann\Template\Template; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -final class Directory extends Renderer -{ - public function render(DirectoryNode $node, string $file): void - { - $templateName = $this->templatePath . ($this->hasBranchCoverage ? 'directory_branch.html' : 'directory.html'); - $template = new Template($templateName, '{{', '}}'); - - $this->setCommonTemplateVariables($template, $node); - - $items = $this->renderItem($node, true); - - foreach ($node->directories() as $item) { - $items .= $this->renderItem($item); - } - - foreach ($node->files() as $item) { - $items .= $this->renderItem($item); - } - - $template->setVar( - [ - 'id' => $node->id(), - 'items' => $items, - ] - ); - - $template->renderTo($file); - } - - private function renderItem(Node $node, bool $total = false): string - { - $data = [ - 'numClasses' => $node->numberOfClassesAndTraits(), - 'numTestedClasses' => $node->numberOfTestedClassesAndTraits(), - 'numMethods' => $node->numberOfFunctionsAndMethods(), - 'numTestedMethods' => $node->numberOfTestedFunctionsAndMethods(), - 'linesExecutedPercent' => $node->percentageOfExecutedLines()->asFloat(), - 'linesExecutedPercentAsString' => $node->percentageOfExecutedLines()->asString(), - 'numExecutedLines' => $node->numberOfExecutedLines(), - 'numExecutableLines' => $node->numberOfExecutableLines(), - 'branchesExecutedPercent' => $node->percentageOfExecutedBranches()->asFloat(), - 'branchesExecutedPercentAsString' => $node->percentageOfExecutedBranches()->asString(), - 'numExecutedBranches' => $node->numberOfExecutedBranches(), - 'numExecutableBranches' => $node->numberOfExecutableBranches(), - 'pathsExecutedPercent' => $node->percentageOfExecutedPaths()->asFloat(), - 'pathsExecutedPercentAsString' => $node->percentageOfExecutedPaths()->asString(), - 'numExecutedPaths' => $node->numberOfExecutedPaths(), - 'numExecutablePaths' => $node->numberOfExecutablePaths(), - 'testedMethodsPercent' => $node->percentageOfTestedFunctionsAndMethods()->asFloat(), - 'testedMethodsPercentAsString' => $node->percentageOfTestedFunctionsAndMethods()->asString(), - 'testedClassesPercent' => $node->percentageOfTestedClassesAndTraits()->asFloat(), - 'testedClassesPercentAsString' => $node->percentageOfTestedClassesAndTraits()->asString(), - ]; - - if ($total) { - $data['name'] = 'Total'; - } else { - $up = str_repeat('../', count($node->pathAsArray()) - 2); - $data['icon'] = sprintf('', $up); - - if ($node instanceof DirectoryNode) { - $data['name'] = sprintf( - '%s', - $node->name(), - $node->name() - ); - $data['icon'] = sprintf('', $up); - } elseif ($this->hasBranchCoverage) { - $data['name'] = sprintf( - '%s [line] [branch] [path]', - $node->name(), - $node->name(), - $node->name(), - $node->name() - ); - } else { - $data['name'] = sprintf( - '%s', - $node->name(), - $node->name() - ); - } - } - - $templateName = $this->templatePath . ($this->hasBranchCoverage ? 'directory_item_branch.html' : 'directory_item.html'); - - return $this->renderItemTemplate( - new Template($templateName, '{{', '}}'), - $data - ); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/File.php b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/File.php deleted file mode 100644 index 101a9ada..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/File.php +++ /dev/null @@ -1,1162 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report\Html; - -use const ENT_COMPAT; -use const ENT_HTML401; -use const ENT_SUBSTITUTE; -use const T_ABSTRACT; -use const T_ARRAY; -use const T_AS; -use const T_BREAK; -use const T_CALLABLE; -use const T_CASE; -use const T_CATCH; -use const T_CLASS; -use const T_CLONE; -use const T_COMMENT; -use const T_CONST; -use const T_CONTINUE; -use const T_DECLARE; -use const T_DEFAULT; -use const T_DO; -use const T_DOC_COMMENT; -use const T_ECHO; -use const T_ELSE; -use const T_ELSEIF; -use const T_EMPTY; -use const T_ENDDECLARE; -use const T_ENDFOR; -use const T_ENDFOREACH; -use const T_ENDIF; -use const T_ENDSWITCH; -use const T_ENDWHILE; -use const T_EVAL; -use const T_EXIT; -use const T_EXTENDS; -use const T_FINAL; -use const T_FINALLY; -use const T_FOR; -use const T_FOREACH; -use const T_FUNCTION; -use const T_GLOBAL; -use const T_GOTO; -use const T_HALT_COMPILER; -use const T_IF; -use const T_IMPLEMENTS; -use const T_INCLUDE; -use const T_INCLUDE_ONCE; -use const T_INLINE_HTML; -use const T_INSTANCEOF; -use const T_INSTEADOF; -use const T_INTERFACE; -use const T_ISSET; -use const T_LIST; -use const T_NAMESPACE; -use const T_NEW; -use const T_PRINT; -use const T_PRIVATE; -use const T_PROTECTED; -use const T_PUBLIC; -use const T_REQUIRE; -use const T_REQUIRE_ONCE; -use const T_RETURN; -use const T_STATIC; -use const T_SWITCH; -use const T_THROW; -use const T_TRAIT; -use const T_TRY; -use const T_UNSET; -use const T_USE; -use const T_VAR; -use const T_WHILE; -use const T_YIELD; -use const T_YIELD_FROM; -use function array_key_exists; -use function array_keys; -use function array_merge; -use function array_pop; -use function array_unique; -use function constant; -use function count; -use function defined; -use function explode; -use function file_get_contents; -use function htmlspecialchars; -use function is_string; -use function ksort; -use function range; -use function sort; -use function sprintf; -use function str_replace; -use function substr; -use function token_get_all; -use function trim; -use PHPUnit\Runner\BaseTestRunner; -use SebastianBergmann\CodeCoverage\Node\File as FileNode; -use SebastianBergmann\CodeCoverage\Util\Percentage; -use SebastianBergmann\Template\Template; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -final class File extends Renderer -{ - /** - * @psalm-var array - */ - private static $keywordTokens = []; - - /** - * @var array - */ - private static $formattedSourceCache = []; - - /** - * @var int - */ - private $htmlSpecialCharsFlags = ENT_COMPAT | ENT_HTML401 | ENT_SUBSTITUTE; - - public function render(FileNode $node, string $file): void - { - $templateName = $this->templatePath . ($this->hasBranchCoverage ? 'file_branch.html' : 'file.html'); - $template = new Template($templateName, '{{', '}}'); - $this->setCommonTemplateVariables($template, $node); - - $template->setVar( - [ - 'items' => $this->renderItems($node), - 'lines' => $this->renderSourceWithLineCoverage($node), - 'legend' => '

ExecutedNot ExecutedDead Code

', - 'structure' => '', - ] - ); - - $template->renderTo($file . '.html'); - - if ($this->hasBranchCoverage) { - $template->setVar( - [ - 'items' => $this->renderItems($node), - 'lines' => $this->renderSourceWithBranchCoverage($node), - 'legend' => '

Fully coveredPartially coveredNot covered

', - 'structure' => $this->renderBranchStructure($node), - ] - ); - - $template->renderTo($file . '_branch.html'); - - $template->setVar( - [ - 'items' => $this->renderItems($node), - 'lines' => $this->renderSourceWithPathCoverage($node), - 'legend' => '

Fully coveredPartially coveredNot covered

', - 'structure' => $this->renderPathStructure($node), - ] - ); - - $template->renderTo($file . '_path.html'); - } - } - - private function renderItems(FileNode $node): string - { - $templateName = $this->templatePath . ($this->hasBranchCoverage ? 'file_item_branch.html' : 'file_item.html'); - $template = new Template($templateName, '{{', '}}'); - - $methodTemplateName = $this->templatePath . ($this->hasBranchCoverage ? 'method_item_branch.html' : 'method_item.html'); - $methodItemTemplate = new Template( - $methodTemplateName, - '{{', - '}}' - ); - - $items = $this->renderItemTemplate( - $template, - [ - 'name' => 'Total', - 'numClasses' => $node->numberOfClassesAndTraits(), - 'numTestedClasses' => $node->numberOfTestedClassesAndTraits(), - 'numMethods' => $node->numberOfFunctionsAndMethods(), - 'numTestedMethods' => $node->numberOfTestedFunctionsAndMethods(), - 'linesExecutedPercent' => $node->percentageOfExecutedLines()->asFloat(), - 'linesExecutedPercentAsString' => $node->percentageOfExecutedLines()->asString(), - 'numExecutedLines' => $node->numberOfExecutedLines(), - 'numExecutableLines' => $node->numberOfExecutableLines(), - 'branchesExecutedPercent' => $node->percentageOfExecutedBranches()->asFloat(), - 'branchesExecutedPercentAsString' => $node->percentageOfExecutedBranches()->asString(), - 'numExecutedBranches' => $node->numberOfExecutedBranches(), - 'numExecutableBranches' => $node->numberOfExecutableBranches(), - 'pathsExecutedPercent' => $node->percentageOfExecutedPaths()->asFloat(), - 'pathsExecutedPercentAsString' => $node->percentageOfExecutedPaths()->asString(), - 'numExecutedPaths' => $node->numberOfExecutedPaths(), - 'numExecutablePaths' => $node->numberOfExecutablePaths(), - 'testedMethodsPercent' => $node->percentageOfTestedFunctionsAndMethods()->asFloat(), - 'testedMethodsPercentAsString' => $node->percentageOfTestedFunctionsAndMethods()->asString(), - 'testedClassesPercent' => $node->percentageOfTestedClassesAndTraits()->asFloat(), - 'testedClassesPercentAsString' => $node->percentageOfTestedClassesAndTraits()->asString(), - 'crap' => 'CRAP', - ] - ); - - $items .= $this->renderFunctionItems( - $node->functions(), - $methodItemTemplate - ); - - $items .= $this->renderTraitOrClassItems( - $node->traits(), - $template, - $methodItemTemplate - ); - - $items .= $this->renderTraitOrClassItems( - $node->classes(), - $template, - $methodItemTemplate - ); - - return $items; - } - - private function renderTraitOrClassItems(array $items, Template $template, Template $methodItemTemplate): string - { - $buffer = ''; - - if (empty($items)) { - return $buffer; - } - - foreach ($items as $name => $item) { - $numMethods = 0; - $numTestedMethods = 0; - - foreach ($item['methods'] as $method) { - if ($method['executableLines'] > 0) { - $numMethods++; - - if ($method['executedLines'] === $method['executableLines']) { - $numTestedMethods++; - } - } - } - - if ($item['executableLines'] > 0) { - $numClasses = 1; - $numTestedClasses = $numTestedMethods === $numMethods ? 1 : 0; - $linesExecutedPercentAsString = Percentage::fromFractionAndTotal( - $item['executedLines'], - $item['executableLines'] - )->asString(); - $branchesExecutedPercentAsString = Percentage::fromFractionAndTotal( - $item['executedBranches'], - $item['executableBranches'] - )->asString(); - $pathsExecutedPercentAsString = Percentage::fromFractionAndTotal( - $item['executedPaths'], - $item['executablePaths'] - )->asString(); - } else { - $numClasses = 0; - $numTestedClasses = 0; - $linesExecutedPercentAsString = 'n/a'; - $branchesExecutedPercentAsString = 'n/a'; - $pathsExecutedPercentAsString = 'n/a'; - } - - $testedMethodsPercentage = Percentage::fromFractionAndTotal( - $numTestedMethods, - $numMethods - ); - - $testedClassesPercentage = Percentage::fromFractionAndTotal( - $numTestedMethods === $numMethods ? 1 : 0, - 1 - ); - - $buffer .= $this->renderItemTemplate( - $template, - [ - 'name' => $this->abbreviateClassName($name), - 'numClasses' => $numClasses, - 'numTestedClasses' => $numTestedClasses, - 'numMethods' => $numMethods, - 'numTestedMethods' => $numTestedMethods, - 'linesExecutedPercent' => Percentage::fromFractionAndTotal( - $item['executedLines'], - $item['executableLines'], - )->asFloat(), - 'linesExecutedPercentAsString' => $linesExecutedPercentAsString, - 'numExecutedLines' => $item['executedLines'], - 'numExecutableLines' => $item['executableLines'], - 'branchesExecutedPercent' => Percentage::fromFractionAndTotal( - $item['executedBranches'], - $item['executableBranches'], - )->asFloat(), - 'branchesExecutedPercentAsString' => $branchesExecutedPercentAsString, - 'numExecutedBranches' => $item['executedBranches'], - 'numExecutableBranches' => $item['executableBranches'], - 'pathsExecutedPercent' => Percentage::fromFractionAndTotal( - $item['executedPaths'], - $item['executablePaths'] - )->asFloat(), - 'pathsExecutedPercentAsString' => $pathsExecutedPercentAsString, - 'numExecutedPaths' => $item['executedPaths'], - 'numExecutablePaths' => $item['executablePaths'], - 'testedMethodsPercent' => $testedMethodsPercentage->asFloat(), - 'testedMethodsPercentAsString' => $testedMethodsPercentage->asString(), - 'testedClassesPercent' => $testedClassesPercentage->asFloat(), - 'testedClassesPercentAsString' => $testedClassesPercentage->asString(), - 'crap' => $item['crap'], - ] - ); - - foreach ($item['methods'] as $method) { - $buffer .= $this->renderFunctionOrMethodItem( - $methodItemTemplate, - $method, - ' ' - ); - } - } - - return $buffer; - } - - private function renderFunctionItems(array $functions, Template $template): string - { - if (empty($functions)) { - return ''; - } - - $buffer = ''; - - foreach ($functions as $function) { - $buffer .= $this->renderFunctionOrMethodItem( - $template, - $function - ); - } - - return $buffer; - } - - private function renderFunctionOrMethodItem(Template $template, array $item, string $indent = ''): string - { - $numMethods = 0; - $numTestedMethods = 0; - - if ($item['executableLines'] > 0) { - $numMethods = 1; - - if ($item['executedLines'] === $item['executableLines']) { - $numTestedMethods = 1; - } - } - - $executedLinesPercentage = Percentage::fromFractionAndTotal( - $item['executedLines'], - $item['executableLines'] - ); - - $executedBranchesPercentage = Percentage::fromFractionAndTotal( - $item['executedBranches'], - $item['executableBranches'] - ); - - $executedPathsPercentage = Percentage::fromFractionAndTotal( - $item['executedPaths'], - $item['executablePaths'] - ); - - $testedMethodsPercentage = Percentage::fromFractionAndTotal( - $numTestedMethods, - 1 - ); - - return $this->renderItemTemplate( - $template, - [ - 'name' => sprintf( - '%s%s', - $indent, - $item['startLine'], - htmlspecialchars($item['signature'], $this->htmlSpecialCharsFlags), - $item['functionName'] ?? $item['methodName'] - ), - 'numMethods' => $numMethods, - 'numTestedMethods' => $numTestedMethods, - 'linesExecutedPercent' => $executedLinesPercentage->asFloat(), - 'linesExecutedPercentAsString' => $executedLinesPercentage->asString(), - 'numExecutedLines' => $item['executedLines'], - 'numExecutableLines' => $item['executableLines'], - 'branchesExecutedPercent' => $executedBranchesPercentage->asFloat(), - 'branchesExecutedPercentAsString' => $executedBranchesPercentage->asString(), - 'numExecutedBranches' => $item['executedBranches'], - 'numExecutableBranches' => $item['executableBranches'], - 'pathsExecutedPercent' => $executedPathsPercentage->asFloat(), - 'pathsExecutedPercentAsString' => $executedPathsPercentage->asString(), - 'numExecutedPaths' => $item['executedPaths'], - 'numExecutablePaths' => $item['executablePaths'], - 'testedMethodsPercent' => $testedMethodsPercentage->asFloat(), - 'testedMethodsPercentAsString' => $testedMethodsPercentage->asString(), - 'crap' => $item['crap'], - ] - ); - } - - private function renderSourceWithLineCoverage(FileNode $node): string - { - $linesTemplate = new Template($this->templatePath . 'lines.html.dist', '{{', '}}'); - $singleLineTemplate = new Template($this->templatePath . 'line.html.dist', '{{', '}}'); - - $coverageData = $node->lineCoverageData(); - $testData = $node->testData(); - $codeLines = $this->loadFile($node->pathAsString()); - $lines = ''; - $i = 1; - - foreach ($codeLines as $line) { - $trClass = ''; - $popoverContent = ''; - $popoverTitle = ''; - - if (array_key_exists($i, $coverageData)) { - $numTests = ($coverageData[$i] ? count($coverageData[$i]) : 0); - - if ($coverageData[$i] === null) { - $trClass = 'warning'; - } elseif ($numTests === 0) { - $trClass = 'danger'; - } else { - if ($numTests > 1) { - $popoverTitle = $numTests . ' tests cover line ' . $i; - } else { - $popoverTitle = '1 test covers line ' . $i; - } - - $lineCss = 'covered-by-large-tests'; - $popoverContent = '
    '; - - foreach ($coverageData[$i] as $test) { - if ($lineCss === 'covered-by-large-tests' && $testData[$test]['size'] === 'medium') { - $lineCss = 'covered-by-medium-tests'; - } elseif ($testData[$test]['size'] === 'small') { - $lineCss = 'covered-by-small-tests'; - } - - $popoverContent .= $this->createPopoverContentForTest($test, $testData[$test]); - } - - $popoverContent .= '
'; - $trClass = $lineCss . ' popin'; - } - } - - $popover = ''; - - if (!empty($popoverTitle)) { - $popover = sprintf( - ' data-title="%s" data-content="%s" data-placement="top" data-html="true"', - $popoverTitle, - htmlspecialchars($popoverContent, $this->htmlSpecialCharsFlags) - ); - } - - $lines .= $this->renderLine($singleLineTemplate, $i, $line, $trClass, $popover); - - $i++; - } - - $linesTemplate->setVar(['lines' => $lines]); - - return $linesTemplate->render(); - } - - private function renderSourceWithBranchCoverage(FileNode $node): string - { - $linesTemplate = new Template($this->templatePath . 'lines.html.dist', '{{', '}}'); - $singleLineTemplate = new Template($this->templatePath . 'line.html.dist', '{{', '}}'); - - $functionCoverageData = $node->functionCoverageData(); - $testData = $node->testData(); - $codeLines = $this->loadFile($node->pathAsString()); - - $lineData = []; - - /** @var int $line */ - foreach (array_keys($codeLines) as $line) { - $lineData[$line + 1] = [ - 'includedInBranches' => 0, - 'includedInHitBranches' => 0, - 'tests' => [], - ]; - } - - foreach ($functionCoverageData as $method) { - foreach ($method['branches'] as $branch) { - foreach (range($branch['line_start'], $branch['line_end']) as $line) { - if (!isset($lineData[$line])) { // blank line at end of file is sometimes included here - continue; - } - - $lineData[$line]['includedInBranches']++; - - if ($branch['hit']) { - $lineData[$line]['includedInHitBranches']++; - $lineData[$line]['tests'] = array_unique(array_merge($lineData[$line]['tests'], $branch['hit'])); - } - } - } - } - - $lines = ''; - $i = 1; - - /** @var string $line */ - foreach ($codeLines as $line) { - $trClass = ''; - $popover = ''; - - if ($lineData[$i]['includedInBranches'] > 0) { - $lineCss = 'success'; - - if ($lineData[$i]['includedInHitBranches'] === 0) { - $lineCss = 'danger'; - } elseif ($lineData[$i]['includedInHitBranches'] !== $lineData[$i]['includedInBranches']) { - $lineCss = 'warning'; - } - - $popoverContent = '
    '; - - if (count($lineData[$i]['tests']) === 1) { - $popoverTitle = '1 test covers line ' . $i; - } else { - $popoverTitle = count($lineData[$i]['tests']) . ' tests cover line ' . $i; - } - $popoverTitle .= '. These are covering ' . $lineData[$i]['includedInHitBranches'] . ' out of the ' . $lineData[$i]['includedInBranches'] . ' code branches.'; - - foreach ($lineData[$i]['tests'] as $test) { - $popoverContent .= $this->createPopoverContentForTest($test, $testData[$test]); - } - - $popoverContent .= '
'; - $trClass = $lineCss . ' popin'; - - $popover = sprintf( - ' data-title="%s" data-content="%s" data-placement="top" data-html="true"', - $popoverTitle, - htmlspecialchars($popoverContent, $this->htmlSpecialCharsFlags) - ); - } - - $lines .= $this->renderLine($singleLineTemplate, $i, $line, $trClass, $popover); - - $i++; - } - - $linesTemplate->setVar(['lines' => $lines]); - - return $linesTemplate->render(); - } - - private function renderSourceWithPathCoverage(FileNode $node): string - { - $linesTemplate = new Template($this->templatePath . 'lines.html.dist', '{{', '}}'); - $singleLineTemplate = new Template($this->templatePath . 'line.html.dist', '{{', '}}'); - - $functionCoverageData = $node->functionCoverageData(); - $testData = $node->testData(); - $codeLines = $this->loadFile($node->pathAsString()); - - $lineData = []; - - /** @var int $line */ - foreach (array_keys($codeLines) as $line) { - $lineData[$line + 1] = [ - 'includedInPaths' => [], - 'includedInHitPaths' => [], - 'tests' => [], - ]; - } - - foreach ($functionCoverageData as $method) { - foreach ($method['paths'] as $pathId => $path) { - foreach ($path['path'] as $branchTaken) { - foreach (range($method['branches'][$branchTaken]['line_start'], $method['branches'][$branchTaken]['line_end']) as $line) { - if (!isset($lineData[$line])) { - continue; - } - $lineData[$line]['includedInPaths'][] = $pathId; - - if ($path['hit']) { - $lineData[$line]['includedInHitPaths'][] = $pathId; - $lineData[$line]['tests'] = array_unique(array_merge($lineData[$line]['tests'], $path['hit'])); - } - } - } - } - } - - $lines = ''; - $i = 1; - - /** @var string $line */ - foreach ($codeLines as $line) { - $trClass = ''; - $popover = ''; - $includedInPathsCount = count(array_unique($lineData[$i]['includedInPaths'])); - $includedInHitPathsCount = count(array_unique($lineData[$i]['includedInHitPaths'])); - - if ($includedInPathsCount > 0) { - $lineCss = 'success'; - - if ($includedInHitPathsCount === 0) { - $lineCss = 'danger'; - } elseif ($includedInHitPathsCount !== $includedInPathsCount) { - $lineCss = 'warning'; - } - - $popoverContent = '
    '; - - if (count($lineData[$i]['tests']) === 1) { - $popoverTitle = '1 test covers line ' . $i; - } else { - $popoverTitle = count($lineData[$i]['tests']) . ' tests cover line ' . $i; - } - $popoverTitle .= '. These are covering ' . $includedInHitPathsCount . ' out of the ' . $includedInPathsCount . ' code paths.'; - - foreach ($lineData[$i]['tests'] as $test) { - $popoverContent .= $this->createPopoverContentForTest($test, $testData[$test]); - } - - $popoverContent .= '
'; - $trClass = $lineCss . ' popin'; - - $popover = sprintf( - ' data-title="%s" data-content="%s" data-placement="top" data-html="true"', - $popoverTitle, - htmlspecialchars($popoverContent, $this->htmlSpecialCharsFlags) - ); - } - - $lines .= $this->renderLine($singleLineTemplate, $i, $line, $trClass, $popover); - - $i++; - } - - $linesTemplate->setVar(['lines' => $lines]); - - return $linesTemplate->render(); - } - - private function renderBranchStructure(FileNode $node): string - { - $branchesTemplate = new Template($this->templatePath . 'branches.html.dist', '{{', '}}'); - - $coverageData = $node->functionCoverageData(); - $testData = $node->testData(); - $codeLines = $this->loadFile($node->pathAsString()); - $branches = ''; - - ksort($coverageData); - - foreach ($coverageData as $methodName => $methodData) { - if (!$methodData['branches']) { - continue; - } - - $branchStructure = ''; - - foreach ($methodData['branches'] as $branch) { - $branchStructure .= $this->renderBranchLines($branch, $codeLines, $testData); - } - - if ($branchStructure !== '') { // don't show empty branches - $branches .= '
' . $this->abbreviateMethodName($methodName) . '
' . "\n"; - $branches .= $branchStructure; - } - } - - $branchesTemplate->setVar(['branches' => $branches]); - - return $branchesTemplate->render(); - } - - private function renderBranchLines(array $branch, array $codeLines, array $testData): string - { - $linesTemplate = new Template($this->templatePath . 'lines.html.dist', '{{', '}}'); - $singleLineTemplate = new Template($this->templatePath . 'line.html.dist', '{{', '}}'); - - $lines = ''; - - $branchLines = range($branch['line_start'], $branch['line_end']); - sort($branchLines); // sometimes end_line < start_line - - /** @var int $line */ - foreach ($branchLines as $line) { - if (!isset($codeLines[$line])) { // blank line at end of file is sometimes included here - continue; - } - - $popoverContent = ''; - $popoverTitle = ''; - - $numTests = count($branch['hit']); - - if ($numTests === 0) { - $trClass = 'danger'; - } else { - $lineCss = 'covered-by-large-tests'; - $popoverContent = '
    '; - - if ($numTests > 1) { - $popoverTitle = $numTests . ' tests cover this branch'; - } else { - $popoverTitle = '1 test covers this branch'; - } - - foreach ($branch['hit'] as $test) { - if ($lineCss === 'covered-by-large-tests' && $testData[$test]['size'] === 'medium') { - $lineCss = 'covered-by-medium-tests'; - } elseif ($testData[$test]['size'] === 'small') { - $lineCss = 'covered-by-small-tests'; - } - - $popoverContent .= $this->createPopoverContentForTest($test, $testData[$test]); - } - $trClass = $lineCss . ' popin'; - } - - $popover = ''; - - if (!empty($popoverTitle)) { - $popover = sprintf( - ' data-title="%s" data-content="%s" data-placement="top" data-html="true"', - $popoverTitle, - htmlspecialchars($popoverContent, $this->htmlSpecialCharsFlags) - ); - } - - $lines .= $this->renderLine($singleLineTemplate, $line, $codeLines[$line - 1], $trClass, $popover); - } - - if ($lines === '') { - return ''; - } - - $linesTemplate->setVar(['lines' => $lines]); - - return $linesTemplate->render(); - } - - private function renderPathStructure(FileNode $node): string - { - $pathsTemplate = new Template($this->templatePath . 'paths.html.dist', '{{', '}}'); - - $coverageData = $node->functionCoverageData(); - $testData = $node->testData(); - $codeLines = $this->loadFile($node->pathAsString()); - $paths = ''; - - ksort($coverageData); - - foreach ($coverageData as $methodName => $methodData) { - if (!$methodData['paths']) { - continue; - } - - $pathStructure = ''; - - if (count($methodData['paths']) > 100) { - $pathStructure .= '

    ' . count($methodData['paths']) . ' is too many paths to sensibly render, consider refactoring your code to bring this number down.

    '; - - continue; - } - - foreach ($methodData['paths'] as $path) { - $pathStructure .= $this->renderPathLines($path, $methodData['branches'], $codeLines, $testData); - } - - if ($pathStructure !== '') { - $paths .= '
    ' . $this->abbreviateMethodName($methodName) . '
    ' . "\n"; - $paths .= $pathStructure; - } - } - - $pathsTemplate->setVar(['paths' => $paths]); - - return $pathsTemplate->render(); - } - - private function renderPathLines(array $path, array $branches, array $codeLines, array $testData): string - { - $linesTemplate = new Template($this->templatePath . 'lines.html.dist', '{{', '}}'); - $singleLineTemplate = new Template($this->templatePath . 'line.html.dist', '{{', '}}'); - - $lines = ''; - $first = true; - - foreach ($path['path'] as $branchId) { - if ($first) { - $first = false; - } else { - $lines .= '  ' . "\n"; - } - - $branchLines = range($branches[$branchId]['line_start'], $branches[$branchId]['line_end']); - sort($branchLines); // sometimes end_line < start_line - - /** @var int $line */ - foreach ($branchLines as $line) { - if (!isset($codeLines[$line])) { // blank line at end of file is sometimes included here - continue; - } - - $popoverContent = ''; - $popoverTitle = ''; - - $numTests = count($path['hit']); - - if ($numTests === 0) { - $trClass = 'danger'; - } else { - $lineCss = 'covered-by-large-tests'; - $popoverContent = '
      '; - - if ($numTests > 1) { - $popoverTitle = $numTests . ' tests cover this path'; - } else { - $popoverTitle = '1 test covers this path'; - } - - foreach ($path['hit'] as $test) { - if ($lineCss === 'covered-by-large-tests' && $testData[$test]['size'] === 'medium') { - $lineCss = 'covered-by-medium-tests'; - } elseif ($testData[$test]['size'] === 'small') { - $lineCss = 'covered-by-small-tests'; - } - - $popoverContent .= $this->createPopoverContentForTest($test, $testData[$test]); - } - - $trClass = $lineCss . ' popin'; - } - - $popover = ''; - - if (!empty($popoverTitle)) { - $popover = sprintf( - ' data-title="%s" data-content="%s" data-placement="top" data-html="true"', - $popoverTitle, - htmlspecialchars($popoverContent, $this->htmlSpecialCharsFlags) - ); - } - - $lines .= $this->renderLine($singleLineTemplate, $line, $codeLines[$line - 1], $trClass, $popover); - } - } - - if ($lines === '') { - return ''; - } - - $linesTemplate->setVar(['lines' => $lines]); - - return $linesTemplate->render(); - } - - private function renderLine(Template $template, int $lineNumber, string $lineContent, string $class, string $popover): string - { - $template->setVar( - [ - 'lineNumber' => $lineNumber, - 'lineContent' => $lineContent, - 'class' => $class, - 'popover' => $popover, - ] - ); - - return $template->render(); - } - - private function loadFile(string $file): array - { - if (isset(self::$formattedSourceCache[$file])) { - return self::$formattedSourceCache[$file]; - } - - $buffer = file_get_contents($file); - $tokens = token_get_all($buffer); - $result = ['']; - $i = 0; - $stringFlag = false; - $fileEndsWithNewLine = substr($buffer, -1) === "\n"; - - unset($buffer); - - foreach ($tokens as $j => $token) { - if (is_string($token)) { - if ($token === '"' && $tokens[$j - 1] !== '\\') { - $result[$i] .= sprintf( - '%s', - htmlspecialchars($token, $this->htmlSpecialCharsFlags) - ); - - $stringFlag = !$stringFlag; - } else { - $result[$i] .= sprintf( - '%s', - htmlspecialchars($token, $this->htmlSpecialCharsFlags) - ); - } - - continue; - } - - [$token, $value] = $token; - - $value = str_replace( - ["\t", ' '], - ['    ', ' '], - htmlspecialchars($value, $this->htmlSpecialCharsFlags) - ); - - if ($value === "\n") { - $result[++$i] = ''; - } else { - $lines = explode("\n", $value); - - foreach ($lines as $jj => $line) { - $line = trim($line); - - if ($line !== '') { - if ($stringFlag) { - $colour = 'string'; - } else { - $colour = 'default'; - - if ($this->isInlineHtml($token)) { - $colour = 'html'; - } elseif ($this->isComment($token)) { - $colour = 'comment'; - } elseif ($this->isKeyword($token)) { - $colour = 'keyword'; - } - } - - $result[$i] .= sprintf( - '%s', - $colour, - $line - ); - } - - if (isset($lines[$jj + 1])) { - $result[++$i] = ''; - } - } - } - } - - if ($fileEndsWithNewLine) { - unset($result[count($result) - 1]); - } - - self::$formattedSourceCache[$file] = $result; - - return $result; - } - - private function abbreviateClassName(string $className): string - { - $tmp = explode('\\', $className); - - if (count($tmp) > 1) { - $className = sprintf( - '%s', - $className, - array_pop($tmp) - ); - } - - return $className; - } - - private function abbreviateMethodName(string $methodName): string - { - $parts = explode('->', $methodName); - - if (count($parts) === 2) { - return $this->abbreviateClassName($parts[0]) . '->' . $parts[1]; - } - - return $methodName; - } - - private function createPopoverContentForTest(string $test, array $testData): string - { - $testCSS = ''; - - if ($testData['fromTestcase']) { - switch ($testData['status']) { - case BaseTestRunner::STATUS_PASSED: - switch ($testData['size']) { - case 'small': - $testCSS = ' class="covered-by-small-tests"'; - - break; - - case 'medium': - $testCSS = ' class="covered-by-medium-tests"'; - - break; - - default: - $testCSS = ' class="covered-by-large-tests"'; - - break; - } - - break; - - case BaseTestRunner::STATUS_SKIPPED: - case BaseTestRunner::STATUS_INCOMPLETE: - case BaseTestRunner::STATUS_RISKY: - case BaseTestRunner::STATUS_WARNING: - $testCSS = ' class="warning"'; - - break; - - case BaseTestRunner::STATUS_FAILURE: - case BaseTestRunner::STATUS_ERROR: - $testCSS = ' class="danger"'; - - break; - } - } - - return sprintf( - '%s', - $testCSS, - htmlspecialchars($test, $this->htmlSpecialCharsFlags) - ); - } - - private function isComment(int $token): bool - { - return $token === T_COMMENT || $token === T_DOC_COMMENT; - } - - private function isInlineHtml(int $token): bool - { - return $token === T_INLINE_HTML; - } - - private function isKeyword(int $token): bool - { - return isset(self::keywordTokens()[$token]); - } - - /** - * @psalm-return array - */ - private static function keywordTokens(): array - { - if (self::$keywordTokens !== []) { - return self::$keywordTokens; - } - - self::$keywordTokens = [ - T_ABSTRACT => true, - T_ARRAY => true, - T_AS => true, - T_BREAK => true, - T_CALLABLE => true, - T_CASE => true, - T_CATCH => true, - T_CLASS => true, - T_CLONE => true, - T_CONST => true, - T_CONTINUE => true, - T_DECLARE => true, - T_DEFAULT => true, - T_DO => true, - T_ECHO => true, - T_ELSE => true, - T_ELSEIF => true, - T_EMPTY => true, - T_ENDDECLARE => true, - T_ENDFOR => true, - T_ENDFOREACH => true, - T_ENDIF => true, - T_ENDSWITCH => true, - T_ENDWHILE => true, - T_EVAL => true, - T_EXIT => true, - T_EXTENDS => true, - T_FINAL => true, - T_FINALLY => true, - T_FOR => true, - T_FOREACH => true, - T_FUNCTION => true, - T_GLOBAL => true, - T_GOTO => true, - T_HALT_COMPILER => true, - T_IF => true, - T_IMPLEMENTS => true, - T_INCLUDE => true, - T_INCLUDE_ONCE => true, - T_INSTANCEOF => true, - T_INSTEADOF => true, - T_INTERFACE => true, - T_ISSET => true, - T_LIST => true, - T_NAMESPACE => true, - T_NEW => true, - T_PRINT => true, - T_PRIVATE => true, - T_PROTECTED => true, - T_PUBLIC => true, - T_REQUIRE => true, - T_REQUIRE_ONCE => true, - T_RETURN => true, - T_STATIC => true, - T_SWITCH => true, - T_THROW => true, - T_TRAIT => true, - T_TRY => true, - T_UNSET => true, - T_USE => true, - T_VAR => true, - T_WHILE => true, - T_YIELD => true, - T_YIELD_FROM => true, - ]; - - if (defined('T_FN')) { - self::$keywordTokens[constant('T_FN')] = true; - } - - if (defined('T_MATCH')) { - self::$keywordTokens[constant('T_MATCH')] = true; - } - - if (defined('T_ENUM')) { - self::$keywordTokens[constant('T_ENUM')] = true; - } - - if (defined('T_READONLY')) { - self::$keywordTokens[constant('T_READONLY')] = true; - } - - return self::$keywordTokens; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/branches.html.dist b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/branches.html.dist deleted file mode 100644 index 54770262..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/branches.html.dist +++ /dev/null @@ -1,9 +0,0 @@ -
      -

      Branches

      -

      - Below are the source code lines that represent each code branch as identified by Xdebug. Please note a branch is not - necessarily coterminous with a line, a line may contain multiple branches and therefore show up more than once. - Please also be aware that some branches may be implicit rather than explicit, e.g. an if statement - always has an else as part of its logical flow even if you didn't write one. -

      -{{branches}} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/coverage_bar.html.dist b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/coverage_bar.html.dist deleted file mode 100644 index 7fcf6f49..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/coverage_bar.html.dist +++ /dev/null @@ -1,5 +0,0 @@ -
      -
      - {{percent}}% covered ({{level}}) -
      -
      diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/coverage_bar_branch.html.dist b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/coverage_bar_branch.html.dist deleted file mode 100644 index 7fcf6f49..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/coverage_bar_branch.html.dist +++ /dev/null @@ -1,5 +0,0 @@ -
      -
      - {{percent}}% covered ({{level}}) -
      -
      diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/bootstrap.min.css b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/bootstrap.min.css deleted file mode 100644 index 83a71b1f..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/bootstrap.min.css +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * Bootstrap v4.6.2 (https://getbootstrap.com/) - * Copyright 2011-2022 The Bootstrap Authors - * Copyright 2011-2022 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - */:root{--blue:#007bff;--indigo:#6610f2;--purple:#6f42c1;--pink:#e83e8c;--red:#dc3545;--orange:#fd7e14;--yellow:#ffc107;--green:#28a745;--teal:#20c997;--cyan:#17a2b8;--white:#fff;--gray:#6c757d;--gray-dark:#343a40;--primary:#007bff;--secondary:#6c757d;--success:#28a745;--info:#17a2b8;--warning:#ffc107;--danger:#dc3545;--light:#f8f9fa;--dark:#343a40;--breakpoint-xs:0;--breakpoint-sm:576px;--breakpoint-md:768px;--breakpoint-lg:992px;--breakpoint-xl:1200px;--font-family-sans-serif:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-family-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus:not(:focus-visible){outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([class]){color:inherit;text-decoration:none}a:not([href]):not([class]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit;text-align:-webkit-match-parent}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus:not(:focus-visible){outline:0}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{margin-bottom:.5rem;font-weight:500;line-height:1.2}.h1,h1{font-size:2.5rem}.h2,h2{font-size:2rem}.h3,h3{font-size:1.75rem}.h4,h4{font-size:1.5rem}.h5,h5{font-size:1.25rem}.h6,h6{font-size:1rem}.lead{font-size:1.25rem;font-weight:300}.display-1{font-size:6rem;font-weight:300;line-height:1.2}.display-2{font-size:5.5rem;font-weight:300;line-height:1.2}.display-3{font-size:4.5rem;font-weight:300;line-height:1.2}.display-4{font-size:3.5rem;font-weight:300;line-height:1.2}hr{margin-top:1rem;margin-bottom:1rem;border:0;border-top:1px solid rgba(0,0,0,.1)}.small,small{font-size:.875em;font-weight:400}.mark,mark{padding:.2em;background-color:#fcf8e3}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none}.list-inline-item{display:inline-block}.list-inline-item:not(:last-child){margin-right:.5rem}.initialism{font-size:90%;text-transform:uppercase}.blockquote{margin-bottom:1rem;font-size:1.25rem}.blockquote-footer{display:block;font-size:.875em;color:#6c757d}.blockquote-footer::before{content:"\2014\00A0"}.img-fluid{max-width:100%;height:auto}.img-thumbnail{padding:.25rem;background-color:#fff;border:1px solid #dee2e6;border-radius:.25rem;max-width:100%;height:auto}.figure{display:inline-block}.figure-img{margin-bottom:.5rem;line-height:1}.figure-caption{font-size:90%;color:#6c757d}code{font-size:87.5%;color:#e83e8c;word-wrap:break-word}a>code{color:inherit}kbd{padding:.2rem .4rem;font-size:87.5%;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:100%;font-weight:700}pre{display:block;font-size:87.5%;color:#212529}pre code{font-size:inherit;color:inherit;word-break:normal}.pre-scrollable{max-height:340px;overflow-y:scroll}.container,.container-fluid,.container-lg,.container-md,.container-sm,.container-xl{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:576px){.container,.container-sm{max-width:540px}}@media (min-width:768px){.container,.container-md,.container-sm{max-width:720px}}@media (min-width:992px){.container,.container-lg,.container-md,.container-sm{max-width:960px}}@media (min-width:1200px){.container,.container-lg,.container-md,.container-sm,.container-xl{max-width:1140px}}.row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-15px;margin-left:-15px}.no-gutters{margin-right:0;margin-left:0}.no-gutters>.col,.no-gutters>[class*=col-]{padding-right:0;padding-left:0}.col,.col-1,.col-10,.col-11,.col-12,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-auto,.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-auto,.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-auto,.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-auto,.col-xl,.col-xl-1,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xl-auto{position:relative;width:100%;padding-right:15px;padding-left:15px}.col{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.row-cols-1>*{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.row-cols-2>*{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.row-cols-3>*{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.row-cols-4>*{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.row-cols-5>*{-ms-flex:0 0 20%;flex:0 0 20%;max-width:20%}.row-cols-6>*{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-first{-ms-flex-order:-1;order:-1}.order-last{-ms-flex-order:13;order:13}.order-0{-ms-flex-order:0;order:0}.order-1{-ms-flex-order:1;order:1}.order-2{-ms-flex-order:2;order:2}.order-3{-ms-flex-order:3;order:3}.order-4{-ms-flex-order:4;order:4}.order-5{-ms-flex-order:5;order:5}.order-6{-ms-flex-order:6;order:6}.order-7{-ms-flex-order:7;order:7}.order-8{-ms-flex-order:8;order:8}.order-9{-ms-flex-order:9;order:9}.order-10{-ms-flex-order:10;order:10}.order-11{-ms-flex-order:11;order:11}.order-12{-ms-flex-order:12;order:12}.offset-1{margin-left:8.333333%}.offset-2{margin-left:16.666667%}.offset-3{margin-left:25%}.offset-4{margin-left:33.333333%}.offset-5{margin-left:41.666667%}.offset-6{margin-left:50%}.offset-7{margin-left:58.333333%}.offset-8{margin-left:66.666667%}.offset-9{margin-left:75%}.offset-10{margin-left:83.333333%}.offset-11{margin-left:91.666667%}@media (min-width:576px){.col-sm{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.row-cols-sm-1>*{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.row-cols-sm-2>*{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.row-cols-sm-3>*{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.row-cols-sm-4>*{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.row-cols-sm-5>*{-ms-flex:0 0 20%;flex:0 0 20%;max-width:20%}.row-cols-sm-6>*{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-sm-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-sm-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-sm-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-sm-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-sm-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-sm-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-sm-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-sm-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-sm-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-sm-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-sm-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-sm-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-sm-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-sm-first{-ms-flex-order:-1;order:-1}.order-sm-last{-ms-flex-order:13;order:13}.order-sm-0{-ms-flex-order:0;order:0}.order-sm-1{-ms-flex-order:1;order:1}.order-sm-2{-ms-flex-order:2;order:2}.order-sm-3{-ms-flex-order:3;order:3}.order-sm-4{-ms-flex-order:4;order:4}.order-sm-5{-ms-flex-order:5;order:5}.order-sm-6{-ms-flex-order:6;order:6}.order-sm-7{-ms-flex-order:7;order:7}.order-sm-8{-ms-flex-order:8;order:8}.order-sm-9{-ms-flex-order:9;order:9}.order-sm-10{-ms-flex-order:10;order:10}.order-sm-11{-ms-flex-order:11;order:11}.order-sm-12{-ms-flex-order:12;order:12}.offset-sm-0{margin-left:0}.offset-sm-1{margin-left:8.333333%}.offset-sm-2{margin-left:16.666667%}.offset-sm-3{margin-left:25%}.offset-sm-4{margin-left:33.333333%}.offset-sm-5{margin-left:41.666667%}.offset-sm-6{margin-left:50%}.offset-sm-7{margin-left:58.333333%}.offset-sm-8{margin-left:66.666667%}.offset-sm-9{margin-left:75%}.offset-sm-10{margin-left:83.333333%}.offset-sm-11{margin-left:91.666667%}}@media (min-width:768px){.col-md{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.row-cols-md-1>*{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.row-cols-md-2>*{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.row-cols-md-3>*{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.row-cols-md-4>*{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.row-cols-md-5>*{-ms-flex:0 0 20%;flex:0 0 20%;max-width:20%}.row-cols-md-6>*{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-md-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-md-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-md-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-md-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-md-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-md-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-md-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-md-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-md-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-md-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-md-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-md-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-md-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-md-first{-ms-flex-order:-1;order:-1}.order-md-last{-ms-flex-order:13;order:13}.order-md-0{-ms-flex-order:0;order:0}.order-md-1{-ms-flex-order:1;order:1}.order-md-2{-ms-flex-order:2;order:2}.order-md-3{-ms-flex-order:3;order:3}.order-md-4{-ms-flex-order:4;order:4}.order-md-5{-ms-flex-order:5;order:5}.order-md-6{-ms-flex-order:6;order:6}.order-md-7{-ms-flex-order:7;order:7}.order-md-8{-ms-flex-order:8;order:8}.order-md-9{-ms-flex-order:9;order:9}.order-md-10{-ms-flex-order:10;order:10}.order-md-11{-ms-flex-order:11;order:11}.order-md-12{-ms-flex-order:12;order:12}.offset-md-0{margin-left:0}.offset-md-1{margin-left:8.333333%}.offset-md-2{margin-left:16.666667%}.offset-md-3{margin-left:25%}.offset-md-4{margin-left:33.333333%}.offset-md-5{margin-left:41.666667%}.offset-md-6{margin-left:50%}.offset-md-7{margin-left:58.333333%}.offset-md-8{margin-left:66.666667%}.offset-md-9{margin-left:75%}.offset-md-10{margin-left:83.333333%}.offset-md-11{margin-left:91.666667%}}@media (min-width:992px){.col-lg{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.row-cols-lg-1>*{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.row-cols-lg-2>*{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.row-cols-lg-3>*{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.row-cols-lg-4>*{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.row-cols-lg-5>*{-ms-flex:0 0 20%;flex:0 0 20%;max-width:20%}.row-cols-lg-6>*{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-lg-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-lg-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-lg-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-lg-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-lg-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-lg-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-lg-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-lg-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-lg-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-lg-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-lg-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-lg-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-lg-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-lg-first{-ms-flex-order:-1;order:-1}.order-lg-last{-ms-flex-order:13;order:13}.order-lg-0{-ms-flex-order:0;order:0}.order-lg-1{-ms-flex-order:1;order:1}.order-lg-2{-ms-flex-order:2;order:2}.order-lg-3{-ms-flex-order:3;order:3}.order-lg-4{-ms-flex-order:4;order:4}.order-lg-5{-ms-flex-order:5;order:5}.order-lg-6{-ms-flex-order:6;order:6}.order-lg-7{-ms-flex-order:7;order:7}.order-lg-8{-ms-flex-order:8;order:8}.order-lg-9{-ms-flex-order:9;order:9}.order-lg-10{-ms-flex-order:10;order:10}.order-lg-11{-ms-flex-order:11;order:11}.order-lg-12{-ms-flex-order:12;order:12}.offset-lg-0{margin-left:0}.offset-lg-1{margin-left:8.333333%}.offset-lg-2{margin-left:16.666667%}.offset-lg-3{margin-left:25%}.offset-lg-4{margin-left:33.333333%}.offset-lg-5{margin-left:41.666667%}.offset-lg-6{margin-left:50%}.offset-lg-7{margin-left:58.333333%}.offset-lg-8{margin-left:66.666667%}.offset-lg-9{margin-left:75%}.offset-lg-10{margin-left:83.333333%}.offset-lg-11{margin-left:91.666667%}}@media (min-width:1200px){.col-xl{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.row-cols-xl-1>*{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.row-cols-xl-2>*{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.row-cols-xl-3>*{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.row-cols-xl-4>*{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.row-cols-xl-5>*{-ms-flex:0 0 20%;flex:0 0 20%;max-width:20%}.row-cols-xl-6>*{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-xl-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-xl-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-xl-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-xl-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-xl-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-xl-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-xl-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-xl-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-xl-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-xl-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-xl-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-xl-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-xl-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-xl-first{-ms-flex-order:-1;order:-1}.order-xl-last{-ms-flex-order:13;order:13}.order-xl-0{-ms-flex-order:0;order:0}.order-xl-1{-ms-flex-order:1;order:1}.order-xl-2{-ms-flex-order:2;order:2}.order-xl-3{-ms-flex-order:3;order:3}.order-xl-4{-ms-flex-order:4;order:4}.order-xl-5{-ms-flex-order:5;order:5}.order-xl-6{-ms-flex-order:6;order:6}.order-xl-7{-ms-flex-order:7;order:7}.order-xl-8{-ms-flex-order:8;order:8}.order-xl-9{-ms-flex-order:9;order:9}.order-xl-10{-ms-flex-order:10;order:10}.order-xl-11{-ms-flex-order:11;order:11}.order-xl-12{-ms-flex-order:12;order:12}.offset-xl-0{margin-left:0}.offset-xl-1{margin-left:8.333333%}.offset-xl-2{margin-left:16.666667%}.offset-xl-3{margin-left:25%}.offset-xl-4{margin-left:33.333333%}.offset-xl-5{margin-left:41.666667%}.offset-xl-6{margin-left:50%}.offset-xl-7{margin-left:58.333333%}.offset-xl-8{margin-left:66.666667%}.offset-xl-9{margin-left:75%}.offset-xl-10{margin-left:83.333333%}.offset-xl-11{margin-left:91.666667%}}.table{width:100%;margin-bottom:1rem;color:#212529}.table td,.table th{padding:.75rem;vertical-align:top;border-top:1px solid #dee2e6}.table thead th{vertical-align:bottom;border-bottom:2px solid #dee2e6}.table tbody+tbody{border-top:2px solid #dee2e6}.table-sm td,.table-sm th{padding:.3rem}.table-bordered{border:1px solid #dee2e6}.table-bordered td,.table-bordered th{border:1px solid #dee2e6}.table-bordered thead td,.table-bordered thead th{border-bottom-width:2px}.table-borderless tbody+tbody,.table-borderless td,.table-borderless th,.table-borderless thead th{border:0}.table-striped tbody tr:nth-of-type(odd){background-color:rgba(0,0,0,.05)}.table-hover tbody tr:hover{color:#212529;background-color:rgba(0,0,0,.075)}.table-primary,.table-primary>td,.table-primary>th{background-color:#b8daff}.table-primary tbody+tbody,.table-primary td,.table-primary th,.table-primary thead th{border-color:#7abaff}.table-hover .table-primary:hover{background-color:#9fcdff}.table-hover .table-primary:hover>td,.table-hover .table-primary:hover>th{background-color:#9fcdff}.table-secondary,.table-secondary>td,.table-secondary>th{background-color:#d6d8db}.table-secondary tbody+tbody,.table-secondary td,.table-secondary th,.table-secondary thead th{border-color:#b3b7bb}.table-hover .table-secondary:hover{background-color:#c8cbcf}.table-hover .table-secondary:hover>td,.table-hover .table-secondary:hover>th{background-color:#c8cbcf}.table-success,.table-success>td,.table-success>th{background-color:#c3e6cb}.table-success tbody+tbody,.table-success td,.table-success th,.table-success thead th{border-color:#8fd19e}.table-hover .table-success:hover{background-color:#b1dfbb}.table-hover .table-success:hover>td,.table-hover .table-success:hover>th{background-color:#b1dfbb}.table-info,.table-info>td,.table-info>th{background-color:#bee5eb}.table-info tbody+tbody,.table-info td,.table-info th,.table-info thead th{border-color:#86cfda}.table-hover .table-info:hover{background-color:#abdde5}.table-hover .table-info:hover>td,.table-hover .table-info:hover>th{background-color:#abdde5}.table-warning,.table-warning>td,.table-warning>th{background-color:#ffeeba}.table-warning tbody+tbody,.table-warning td,.table-warning th,.table-warning thead th{border-color:#ffdf7e}.table-hover .table-warning:hover{background-color:#ffe8a1}.table-hover .table-warning:hover>td,.table-hover .table-warning:hover>th{background-color:#ffe8a1}.table-danger,.table-danger>td,.table-danger>th{background-color:#f5c6cb}.table-danger tbody+tbody,.table-danger td,.table-danger th,.table-danger thead th{border-color:#ed969e}.table-hover .table-danger:hover{background-color:#f1b0b7}.table-hover .table-danger:hover>td,.table-hover .table-danger:hover>th{background-color:#f1b0b7}.table-light,.table-light>td,.table-light>th{background-color:#fdfdfe}.table-light tbody+tbody,.table-light td,.table-light th,.table-light thead th{border-color:#fbfcfc}.table-hover .table-light:hover{background-color:#ececf6}.table-hover .table-light:hover>td,.table-hover .table-light:hover>th{background-color:#ececf6}.table-dark,.table-dark>td,.table-dark>th{background-color:#c6c8ca}.table-dark tbody+tbody,.table-dark td,.table-dark th,.table-dark thead th{border-color:#95999c}.table-hover .table-dark:hover{background-color:#b9bbbe}.table-hover .table-dark:hover>td,.table-hover .table-dark:hover>th{background-color:#b9bbbe}.table-active,.table-active>td,.table-active>th{background-color:rgba(0,0,0,.075)}.table-hover .table-active:hover{background-color:rgba(0,0,0,.075)}.table-hover .table-active:hover>td,.table-hover .table-active:hover>th{background-color:rgba(0,0,0,.075)}.table .thead-dark th{color:#fff;background-color:#343a40;border-color:#454d55}.table .thead-light th{color:#495057;background-color:#e9ecef;border-color:#dee2e6}.table-dark{color:#fff;background-color:#343a40}.table-dark td,.table-dark th,.table-dark thead th{border-color:#454d55}.table-dark.table-bordered{border:0}.table-dark.table-striped tbody tr:nth-of-type(odd){background-color:rgba(255,255,255,.05)}.table-dark.table-hover tbody tr:hover{color:#fff;background-color:rgba(255,255,255,.075)}@media (max-width:575.98px){.table-responsive-sm{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-sm>.table-bordered{border:0}}@media (max-width:767.98px){.table-responsive-md{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-md>.table-bordered{border:0}}@media (max-width:991.98px){.table-responsive-lg{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-lg>.table-bordered{border:0}}@media (max-width:1199.98px){.table-responsive-xl{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-xl>.table-bordered{border:0}}.table-responsive{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive>.table-bordered{border:0}.form-control{display:block;width:100%;height:calc(1.5em + .75rem + 2px);padding:.375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.form-control{transition:none}}.form-control::-ms-expand{background-color:transparent;border:0}.form-control:focus{color:#495057;background-color:#fff;border-color:#80bdff;outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.form-control::-webkit-input-placeholder{color:#6c757d;opacity:1}.form-control::-moz-placeholder{color:#6c757d;opacity:1}.form-control:-ms-input-placeholder{color:#6c757d;opacity:1}.form-control::-ms-input-placeholder{color:#6c757d;opacity:1}.form-control::placeholder{color:#6c757d;opacity:1}.form-control:disabled,.form-control[readonly]{background-color:#e9ecef;opacity:1}input[type=date].form-control,input[type=datetime-local].form-control,input[type=month].form-control,input[type=time].form-control{-webkit-appearance:none;-moz-appearance:none;appearance:none}select.form-control:-moz-focusring{color:transparent;text-shadow:0 0 0 #495057}select.form-control:focus::-ms-value{color:#495057;background-color:#fff}.form-control-file,.form-control-range{display:block;width:100%}.col-form-label{padding-top:calc(.375rem + 1px);padding-bottom:calc(.375rem + 1px);margin-bottom:0;font-size:inherit;line-height:1.5}.col-form-label-lg{padding-top:calc(.5rem + 1px);padding-bottom:calc(.5rem + 1px);font-size:1.25rem;line-height:1.5}.col-form-label-sm{padding-top:calc(.25rem + 1px);padding-bottom:calc(.25rem + 1px);font-size:.875rem;line-height:1.5}.form-control-plaintext{display:block;width:100%;padding:.375rem 0;margin-bottom:0;font-size:1rem;line-height:1.5;color:#212529;background-color:transparent;border:solid transparent;border-width:1px 0}.form-control-plaintext.form-control-lg,.form-control-plaintext.form-control-sm{padding-right:0;padding-left:0}.form-control-sm{height:calc(1.5em + .5rem + 2px);padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.form-control-lg{height:calc(1.5em + 1rem + 2px);padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}select.form-control[multiple],select.form-control[size]{height:auto}textarea.form-control{height:auto}.form-group{margin-bottom:1rem}.form-text{display:block;margin-top:.25rem}.form-row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-5px;margin-left:-5px}.form-row>.col,.form-row>[class*=col-]{padding-right:5px;padding-left:5px}.form-check{position:relative;display:block;padding-left:1.25rem}.form-check-input{position:absolute;margin-top:.3rem;margin-left:-1.25rem}.form-check-input:disabled~.form-check-label,.form-check-input[disabled]~.form-check-label{color:#6c757d}.form-check-label{margin-bottom:0}.form-check-inline{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;padding-left:0;margin-right:.75rem}.form-check-inline .form-check-input{position:static;margin-top:0;margin-right:.3125rem;margin-left:0}.valid-feedback{display:none;width:100%;margin-top:.25rem;font-size:.875em;color:#28a745}.valid-tooltip{position:absolute;top:100%;left:0;z-index:5;display:none;max-width:100%;padding:.25rem .5rem;margin-top:.1rem;font-size:.875rem;line-height:1.5;color:#fff;background-color:rgba(40,167,69,.9);border-radius:.25rem}.form-row>.col>.valid-tooltip,.form-row>[class*=col-]>.valid-tooltip{left:5px}.is-valid~.valid-feedback,.is-valid~.valid-tooltip,.was-validated :valid~.valid-feedback,.was-validated :valid~.valid-tooltip{display:block}.form-control.is-valid,.was-validated .form-control:valid{border-color:#28a745;padding-right:calc(1.5em + .75rem)!important;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right calc(.375em + .1875rem) center;background-size:calc(.75em + .375rem) calc(.75em + .375rem)}.form-control.is-valid:focus,.was-validated .form-control:valid:focus{border-color:#28a745;box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.was-validated select.form-control:valid,select.form-control.is-valid{padding-right:3rem!important;background-position:right 1.5rem center}.was-validated textarea.form-control:valid,textarea.form-control.is-valid{padding-right:calc(1.5em + .75rem);background-position:top calc(.375em + .1875rem) right calc(.375em + .1875rem)}.custom-select.is-valid,.was-validated .custom-select:valid{border-color:#28a745;padding-right:calc(.75em + 2.3125rem)!important;background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") right .75rem center/8px 10px no-repeat,#fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e") center right 1.75rem/calc(.75em + .375rem) calc(.75em + .375rem) no-repeat}.custom-select.is-valid:focus,.was-validated .custom-select:valid:focus{border-color:#28a745;box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.form-check-input.is-valid~.form-check-label,.was-validated .form-check-input:valid~.form-check-label{color:#28a745}.form-check-input.is-valid~.valid-feedback,.form-check-input.is-valid~.valid-tooltip,.was-validated .form-check-input:valid~.valid-feedback,.was-validated .form-check-input:valid~.valid-tooltip{display:block}.custom-control-input.is-valid~.custom-control-label,.was-validated .custom-control-input:valid~.custom-control-label{color:#28a745}.custom-control-input.is-valid~.custom-control-label::before,.was-validated .custom-control-input:valid~.custom-control-label::before{border-color:#28a745}.custom-control-input.is-valid:checked~.custom-control-label::before,.was-validated .custom-control-input:valid:checked~.custom-control-label::before{border-color:#34ce57;background-color:#34ce57}.custom-control-input.is-valid:focus~.custom-control-label::before,.was-validated .custom-control-input:valid:focus~.custom-control-label::before{box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.custom-control-input.is-valid:focus:not(:checked)~.custom-control-label::before,.was-validated .custom-control-input:valid:focus:not(:checked)~.custom-control-label::before{border-color:#28a745}.custom-file-input.is-valid~.custom-file-label,.was-validated .custom-file-input:valid~.custom-file-label{border-color:#28a745}.custom-file-input.is-valid:focus~.custom-file-label,.was-validated .custom-file-input:valid:focus~.custom-file-label{border-color:#28a745;box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.invalid-feedback{display:none;width:100%;margin-top:.25rem;font-size:.875em;color:#dc3545}.invalid-tooltip{position:absolute;top:100%;left:0;z-index:5;display:none;max-width:100%;padding:.25rem .5rem;margin-top:.1rem;font-size:.875rem;line-height:1.5;color:#fff;background-color:rgba(220,53,69,.9);border-radius:.25rem}.form-row>.col>.invalid-tooltip,.form-row>[class*=col-]>.invalid-tooltip{left:5px}.is-invalid~.invalid-feedback,.is-invalid~.invalid-tooltip,.was-validated :invalid~.invalid-feedback,.was-validated :invalid~.invalid-tooltip{display:block}.form-control.is-invalid,.was-validated .form-control:invalid{border-color:#dc3545;padding-right:calc(1.5em + .75rem)!important;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right calc(.375em + .1875rem) center;background-size:calc(.75em + .375rem) calc(.75em + .375rem)}.form-control.is-invalid:focus,.was-validated .form-control:invalid:focus{border-color:#dc3545;box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.was-validated select.form-control:invalid,select.form-control.is-invalid{padding-right:3rem!important;background-position:right 1.5rem center}.was-validated textarea.form-control:invalid,textarea.form-control.is-invalid{padding-right:calc(1.5em + .75rem);background-position:top calc(.375em + .1875rem) right calc(.375em + .1875rem)}.custom-select.is-invalid,.was-validated .custom-select:invalid{border-color:#dc3545;padding-right:calc(.75em + 2.3125rem)!important;background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") right .75rem center/8px 10px no-repeat,#fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e") center right 1.75rem/calc(.75em + .375rem) calc(.75em + .375rem) no-repeat}.custom-select.is-invalid:focus,.was-validated .custom-select:invalid:focus{border-color:#dc3545;box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.form-check-input.is-invalid~.form-check-label,.was-validated .form-check-input:invalid~.form-check-label{color:#dc3545}.form-check-input.is-invalid~.invalid-feedback,.form-check-input.is-invalid~.invalid-tooltip,.was-validated .form-check-input:invalid~.invalid-feedback,.was-validated .form-check-input:invalid~.invalid-tooltip{display:block}.custom-control-input.is-invalid~.custom-control-label,.was-validated .custom-control-input:invalid~.custom-control-label{color:#dc3545}.custom-control-input.is-invalid~.custom-control-label::before,.was-validated .custom-control-input:invalid~.custom-control-label::before{border-color:#dc3545}.custom-control-input.is-invalid:checked~.custom-control-label::before,.was-validated .custom-control-input:invalid:checked~.custom-control-label::before{border-color:#e4606d;background-color:#e4606d}.custom-control-input.is-invalid:focus~.custom-control-label::before,.was-validated .custom-control-input:invalid:focus~.custom-control-label::before{box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.custom-control-input.is-invalid:focus:not(:checked)~.custom-control-label::before,.was-validated .custom-control-input:invalid:focus:not(:checked)~.custom-control-label::before{border-color:#dc3545}.custom-file-input.is-invalid~.custom-file-label,.was-validated .custom-file-input:invalid~.custom-file-label{border-color:#dc3545}.custom-file-input.is-invalid:focus~.custom-file-label,.was-validated .custom-file-input:invalid:focus~.custom-file-label{border-color:#dc3545;box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.form-inline{display:-ms-flexbox;display:flex;-ms-flex-flow:row wrap;flex-flow:row wrap;-ms-flex-align:center;align-items:center}.form-inline .form-check{width:100%}@media (min-width:576px){.form-inline label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;margin-bottom:0}.form-inline .form-group{display:-ms-flexbox;display:flex;-ms-flex:0 0 auto;flex:0 0 auto;-ms-flex-flow:row wrap;flex-flow:row wrap;-ms-flex-align:center;align-items:center;margin-bottom:0}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-plaintext{display:inline-block}.form-inline .custom-select,.form-inline .input-group{width:auto}.form-inline .form-check{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:auto;padding-left:0}.form-inline .form-check-input{position:relative;-ms-flex-negative:0;flex-shrink:0;margin-top:0;margin-right:.25rem;margin-left:0}.form-inline .custom-control{-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.form-inline .custom-control-label{margin-bottom:0}}.btn{display:inline-block;font-weight:400;color:#212529;text-align:center;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:transparent;border:1px solid transparent;padding:.375rem .75rem;font-size:1rem;line-height:1.5;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.btn{transition:none}}.btn:hover{color:#212529;text-decoration:none}.btn.focus,.btn:focus{outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.btn.disabled,.btn:disabled{opacity:.65}.btn:not(:disabled):not(.disabled){cursor:pointer}a.btn.disabled,fieldset:disabled a.btn{pointer-events:none}.btn-primary{color:#fff;background-color:#007bff;border-color:#007bff}.btn-primary:hover{color:#fff;background-color:#0069d9;border-color:#0062cc}.btn-primary.focus,.btn-primary:focus{color:#fff;background-color:#0069d9;border-color:#0062cc;box-shadow:0 0 0 .2rem rgba(38,143,255,.5)}.btn-primary.disabled,.btn-primary:disabled{color:#fff;background-color:#007bff;border-color:#007bff}.btn-primary:not(:disabled):not(.disabled).active,.btn-primary:not(:disabled):not(.disabled):active,.show>.btn-primary.dropdown-toggle{color:#fff;background-color:#0062cc;border-color:#005cbf}.btn-primary:not(:disabled):not(.disabled).active:focus,.btn-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-primary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(38,143,255,.5)}.btn-secondary{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-secondary:hover{color:#fff;background-color:#5a6268;border-color:#545b62}.btn-secondary.focus,.btn-secondary:focus{color:#fff;background-color:#5a6268;border-color:#545b62;box-shadow:0 0 0 .2rem rgba(130,138,145,.5)}.btn-secondary.disabled,.btn-secondary:disabled{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-secondary:not(:disabled):not(.disabled).active,.btn-secondary:not(:disabled):not(.disabled):active,.show>.btn-secondary.dropdown-toggle{color:#fff;background-color:#545b62;border-color:#4e555b}.btn-secondary:not(:disabled):not(.disabled).active:focus,.btn-secondary:not(:disabled):not(.disabled):active:focus,.show>.btn-secondary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(130,138,145,.5)}.btn-success{color:#fff;background-color:#28a745;border-color:#28a745}.btn-success:hover{color:#fff;background-color:#218838;border-color:#1e7e34}.btn-success.focus,.btn-success:focus{color:#fff;background-color:#218838;border-color:#1e7e34;box-shadow:0 0 0 .2rem rgba(72,180,97,.5)}.btn-success.disabled,.btn-success:disabled{color:#fff;background-color:#28a745;border-color:#28a745}.btn-success:not(:disabled):not(.disabled).active,.btn-success:not(:disabled):not(.disabled):active,.show>.btn-success.dropdown-toggle{color:#fff;background-color:#1e7e34;border-color:#1c7430}.btn-success:not(:disabled):not(.disabled).active:focus,.btn-success:not(:disabled):not(.disabled):active:focus,.show>.btn-success.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(72,180,97,.5)}.btn-info{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-info:hover{color:#fff;background-color:#138496;border-color:#117a8b}.btn-info.focus,.btn-info:focus{color:#fff;background-color:#138496;border-color:#117a8b;box-shadow:0 0 0 .2rem rgba(58,176,195,.5)}.btn-info.disabled,.btn-info:disabled{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-info:not(:disabled):not(.disabled).active,.btn-info:not(:disabled):not(.disabled):active,.show>.btn-info.dropdown-toggle{color:#fff;background-color:#117a8b;border-color:#10707f}.btn-info:not(:disabled):not(.disabled).active:focus,.btn-info:not(:disabled):not(.disabled):active:focus,.show>.btn-info.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(58,176,195,.5)}.btn-warning{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-warning:hover{color:#212529;background-color:#e0a800;border-color:#d39e00}.btn-warning.focus,.btn-warning:focus{color:#212529;background-color:#e0a800;border-color:#d39e00;box-shadow:0 0 0 .2rem rgba(222,170,12,.5)}.btn-warning.disabled,.btn-warning:disabled{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-warning:not(:disabled):not(.disabled).active,.btn-warning:not(:disabled):not(.disabled):active,.show>.btn-warning.dropdown-toggle{color:#212529;background-color:#d39e00;border-color:#c69500}.btn-warning:not(:disabled):not(.disabled).active:focus,.btn-warning:not(:disabled):not(.disabled):active:focus,.show>.btn-warning.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(222,170,12,.5)}.btn-danger{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-danger:hover{color:#fff;background-color:#c82333;border-color:#bd2130}.btn-danger.focus,.btn-danger:focus{color:#fff;background-color:#c82333;border-color:#bd2130;box-shadow:0 0 0 .2rem rgba(225,83,97,.5)}.btn-danger.disabled,.btn-danger:disabled{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-danger:not(:disabled):not(.disabled).active,.btn-danger:not(:disabled):not(.disabled):active,.show>.btn-danger.dropdown-toggle{color:#fff;background-color:#bd2130;border-color:#b21f2d}.btn-danger:not(:disabled):not(.disabled).active:focus,.btn-danger:not(:disabled):not(.disabled):active:focus,.show>.btn-danger.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(225,83,97,.5)}.btn-light{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-light:hover{color:#212529;background-color:#e2e6ea;border-color:#dae0e5}.btn-light.focus,.btn-light:focus{color:#212529;background-color:#e2e6ea;border-color:#dae0e5;box-shadow:0 0 0 .2rem rgba(216,217,219,.5)}.btn-light.disabled,.btn-light:disabled{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-light:not(:disabled):not(.disabled).active,.btn-light:not(:disabled):not(.disabled):active,.show>.btn-light.dropdown-toggle{color:#212529;background-color:#dae0e5;border-color:#d3d9df}.btn-light:not(:disabled):not(.disabled).active:focus,.btn-light:not(:disabled):not(.disabled):active:focus,.show>.btn-light.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(216,217,219,.5)}.btn-dark{color:#fff;background-color:#343a40;border-color:#343a40}.btn-dark:hover{color:#fff;background-color:#23272b;border-color:#1d2124}.btn-dark.focus,.btn-dark:focus{color:#fff;background-color:#23272b;border-color:#1d2124;box-shadow:0 0 0 .2rem rgba(82,88,93,.5)}.btn-dark.disabled,.btn-dark:disabled{color:#fff;background-color:#343a40;border-color:#343a40}.btn-dark:not(:disabled):not(.disabled).active,.btn-dark:not(:disabled):not(.disabled):active,.show>.btn-dark.dropdown-toggle{color:#fff;background-color:#1d2124;border-color:#171a1d}.btn-dark:not(:disabled):not(.disabled).active:focus,.btn-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-dark.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(82,88,93,.5)}.btn-outline-primary{color:#007bff;border-color:#007bff}.btn-outline-primary:hover{color:#fff;background-color:#007bff;border-color:#007bff}.btn-outline-primary.focus,.btn-outline-primary:focus{box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-outline-primary.disabled,.btn-outline-primary:disabled{color:#007bff;background-color:transparent}.btn-outline-primary:not(:disabled):not(.disabled).active,.btn-outline-primary:not(:disabled):not(.disabled):active,.show>.btn-outline-primary.dropdown-toggle{color:#fff;background-color:#007bff;border-color:#007bff}.btn-outline-primary:not(:disabled):not(.disabled).active:focus,.btn-outline-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-primary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-outline-secondary{color:#6c757d;border-color:#6c757d}.btn-outline-secondary:hover{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-outline-secondary.focus,.btn-outline-secondary:focus{box-shadow:0 0 0 .2rem rgba(108,117,125,.5)}.btn-outline-secondary.disabled,.btn-outline-secondary:disabled{color:#6c757d;background-color:transparent}.btn-outline-secondary:not(:disabled):not(.disabled).active,.btn-outline-secondary:not(:disabled):not(.disabled):active,.show>.btn-outline-secondary.dropdown-toggle{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-outline-secondary:not(:disabled):not(.disabled).active:focus,.btn-outline-secondary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-secondary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(108,117,125,.5)}.btn-outline-success{color:#28a745;border-color:#28a745}.btn-outline-success:hover{color:#fff;background-color:#28a745;border-color:#28a745}.btn-outline-success.focus,.btn-outline-success:focus{box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-outline-success.disabled,.btn-outline-success:disabled{color:#28a745;background-color:transparent}.btn-outline-success:not(:disabled):not(.disabled).active,.btn-outline-success:not(:disabled):not(.disabled):active,.show>.btn-outline-success.dropdown-toggle{color:#fff;background-color:#28a745;border-color:#28a745}.btn-outline-success:not(:disabled):not(.disabled).active:focus,.btn-outline-success:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-success.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-outline-info{color:#17a2b8;border-color:#17a2b8}.btn-outline-info:hover{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-outline-info.focus,.btn-outline-info:focus{box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-outline-info.disabled,.btn-outline-info:disabled{color:#17a2b8;background-color:transparent}.btn-outline-info:not(:disabled):not(.disabled).active,.btn-outline-info:not(:disabled):not(.disabled):active,.show>.btn-outline-info.dropdown-toggle{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-outline-info:not(:disabled):not(.disabled).active:focus,.btn-outline-info:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-info.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-outline-warning{color:#ffc107;border-color:#ffc107}.btn-outline-warning:hover{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-outline-warning.focus,.btn-outline-warning:focus{box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-outline-warning.disabled,.btn-outline-warning:disabled{color:#ffc107;background-color:transparent}.btn-outline-warning:not(:disabled):not(.disabled).active,.btn-outline-warning:not(:disabled):not(.disabled):active,.show>.btn-outline-warning.dropdown-toggle{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-outline-warning:not(:disabled):not(.disabled).active:focus,.btn-outline-warning:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-warning.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-outline-danger{color:#dc3545;border-color:#dc3545}.btn-outline-danger:hover{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-outline-danger.focus,.btn-outline-danger:focus{box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-outline-danger.disabled,.btn-outline-danger:disabled{color:#dc3545;background-color:transparent}.btn-outline-danger:not(:disabled):not(.disabled).active,.btn-outline-danger:not(:disabled):not(.disabled):active,.show>.btn-outline-danger.dropdown-toggle{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-outline-danger:not(:disabled):not(.disabled).active:focus,.btn-outline-danger:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-danger.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-outline-light{color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light:hover{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light.focus,.btn-outline-light:focus{box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-outline-light.disabled,.btn-outline-light:disabled{color:#f8f9fa;background-color:transparent}.btn-outline-light:not(:disabled):not(.disabled).active,.btn-outline-light:not(:disabled):not(.disabled):active,.show>.btn-outline-light.dropdown-toggle{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light:not(:disabled):not(.disabled).active:focus,.btn-outline-light:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-light.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-outline-dark{color:#343a40;border-color:#343a40}.btn-outline-dark:hover{color:#fff;background-color:#343a40;border-color:#343a40}.btn-outline-dark.focus,.btn-outline-dark:focus{box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-outline-dark.disabled,.btn-outline-dark:disabled{color:#343a40;background-color:transparent}.btn-outline-dark:not(:disabled):not(.disabled).active,.btn-outline-dark:not(:disabled):not(.disabled):active,.show>.btn-outline-dark.dropdown-toggle{color:#fff;background-color:#343a40;border-color:#343a40}.btn-outline-dark:not(:disabled):not(.disabled).active:focus,.btn-outline-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-dark.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-link{font-weight:400;color:#007bff;text-decoration:none}.btn-link:hover{color:#0056b3;text-decoration:underline}.btn-link.focus,.btn-link:focus{text-decoration:underline}.btn-link.disabled,.btn-link:disabled{color:#6c757d;pointer-events:none}.btn-group-lg>.btn,.btn-lg{padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}.btn-group-sm>.btn,.btn-sm{padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:.5rem}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{transition:opacity .15s linear}@media (prefers-reduced-motion:reduce){.fade{transition:none}}.fade:not(.show){opacity:0}.collapse:not(.show){display:none}.collapsing{position:relative;height:0;overflow:hidden;transition:height .35s ease}@media (prefers-reduced-motion:reduce){.collapsing{transition:none}}.collapsing.width{width:0;height:auto;transition:width .35s ease}@media (prefers-reduced-motion:reduce){.collapsing.width{transition:none}}.dropdown,.dropleft,.dropright,.dropup{position:relative}.dropdown-toggle{white-space:nowrap}.dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid;border-right:.3em solid transparent;border-bottom:0;border-left:.3em solid transparent}.dropdown-toggle:empty::after{margin-left:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:10rem;padding:.5rem 0;margin:.125rem 0 0;font-size:1rem;color:#212529;text-align:left;list-style:none;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.15);border-radius:.25rem}.dropdown-menu-left{right:auto;left:0}.dropdown-menu-right{right:0;left:auto}@media (min-width:576px){.dropdown-menu-sm-left{right:auto;left:0}.dropdown-menu-sm-right{right:0;left:auto}}@media (min-width:768px){.dropdown-menu-md-left{right:auto;left:0}.dropdown-menu-md-right{right:0;left:auto}}@media (min-width:992px){.dropdown-menu-lg-left{right:auto;left:0}.dropdown-menu-lg-right{right:0;left:auto}}@media (min-width:1200px){.dropdown-menu-xl-left{right:auto;left:0}.dropdown-menu-xl-right{right:0;left:auto}}.dropup .dropdown-menu{top:auto;bottom:100%;margin-top:0;margin-bottom:.125rem}.dropup .dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:0;border-right:.3em solid transparent;border-bottom:.3em solid;border-left:.3em solid transparent}.dropup .dropdown-toggle:empty::after{margin-left:0}.dropright .dropdown-menu{top:0;right:auto;left:100%;margin-top:0;margin-left:.125rem}.dropright .dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid transparent;border-right:0;border-bottom:.3em solid transparent;border-left:.3em solid}.dropright .dropdown-toggle:empty::after{margin-left:0}.dropright .dropdown-toggle::after{vertical-align:0}.dropleft .dropdown-menu{top:0;right:100%;left:auto;margin-top:0;margin-right:.125rem}.dropleft .dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:""}.dropleft .dropdown-toggle::after{display:none}.dropleft .dropdown-toggle::before{display:inline-block;margin-right:.255em;vertical-align:.255em;content:"";border-top:.3em solid transparent;border-right:.3em solid;border-bottom:.3em solid transparent}.dropleft .dropdown-toggle:empty::after{margin-left:0}.dropleft .dropdown-toggle::before{vertical-align:0}.dropdown-menu[x-placement^=bottom],.dropdown-menu[x-placement^=left],.dropdown-menu[x-placement^=right],.dropdown-menu[x-placement^=top]{right:auto;bottom:auto}.dropdown-divider{height:0;margin:.5rem 0;overflow:hidden;border-top:1px solid #e9ecef}.dropdown-item{display:block;width:100%;padding:.25rem 1.5rem;clear:both;font-weight:400;color:#212529;text-align:inherit;white-space:nowrap;background-color:transparent;border:0}.dropdown-item:focus,.dropdown-item:hover{color:#16181b;text-decoration:none;background-color:#e9ecef}.dropdown-item.active,.dropdown-item:active{color:#fff;text-decoration:none;background-color:#007bff}.dropdown-item.disabled,.dropdown-item:disabled{color:#adb5bd;pointer-events:none;background-color:transparent}.dropdown-menu.show{display:block}.dropdown-header{display:block;padding:.5rem 1.5rem;margin-bottom:0;font-size:.875rem;color:#6c757d;white-space:nowrap}.dropdown-item-text{display:block;padding:.25rem 1.5rem;color:#212529}.btn-group,.btn-group-vertical{position:relative;display:-ms-inline-flexbox;display:inline-flex;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;-ms-flex:1 1 auto;flex:1 1 auto}.btn-group-vertical>.btn:hover,.btn-group>.btn:hover{z-index:1}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus{z-index:1}.btn-toolbar{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:start;justify-content:flex-start}.btn-toolbar .input-group{width:auto}.btn-group>.btn-group:not(:first-child),.btn-group>.btn:not(:first-child){margin-left:-1px}.btn-group>.btn-group:not(:last-child)>.btn,.btn-group>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:not(:first-child)>.btn,.btn-group>.btn:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.dropdown-toggle-split{padding-right:.5625rem;padding-left:.5625rem}.dropdown-toggle-split::after,.dropright .dropdown-toggle-split::after,.dropup .dropdown-toggle-split::after{margin-left:0}.dropleft .dropdown-toggle-split::before{margin-right:0}.btn-group-sm>.btn+.dropdown-toggle-split,.btn-sm+.dropdown-toggle-split{padding-right:.375rem;padding-left:.375rem}.btn-group-lg>.btn+.dropdown-toggle-split,.btn-lg+.dropdown-toggle-split{padding-right:.75rem;padding-left:.75rem}.btn-group-vertical{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:center;justify-content:center}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group{width:100%}.btn-group-vertical>.btn-group:not(:first-child),.btn-group-vertical>.btn:not(:first-child){margin-top:-1px}.btn-group-vertical>.btn-group:not(:last-child)>.btn,.btn-group-vertical>.btn:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child)>.btn,.btn-group-vertical>.btn:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}.btn-group-toggle>.btn,.btn-group-toggle>.btn-group>.btn{margin-bottom:0}.btn-group-toggle>.btn input[type=checkbox],.btn-group-toggle>.btn input[type=radio],.btn-group-toggle>.btn-group>.btn input[type=checkbox],.btn-group-toggle>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:stretch;align-items:stretch;width:100%}.input-group>.custom-file,.input-group>.custom-select,.input-group>.form-control,.input-group>.form-control-plaintext{position:relative;-ms-flex:1 1 auto;flex:1 1 auto;width:1%;min-width:0;margin-bottom:0}.input-group>.custom-file+.custom-file,.input-group>.custom-file+.custom-select,.input-group>.custom-file+.form-control,.input-group>.custom-select+.custom-file,.input-group>.custom-select+.custom-select,.input-group>.custom-select+.form-control,.input-group>.form-control+.custom-file,.input-group>.form-control+.custom-select,.input-group>.form-control+.form-control,.input-group>.form-control-plaintext+.custom-file,.input-group>.form-control-plaintext+.custom-select,.input-group>.form-control-plaintext+.form-control{margin-left:-1px}.input-group>.custom-file .custom-file-input:focus~.custom-file-label,.input-group>.custom-select:focus,.input-group>.form-control:focus{z-index:3}.input-group>.custom-file .custom-file-input:focus{z-index:4}.input-group>.custom-select:not(:first-child),.input-group>.form-control:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.input-group>.custom-file{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.input-group>.custom-file:not(:last-child) .custom-file-label,.input-group>.custom-file:not(:last-child) .custom-file-label::after{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.custom-file:not(:first-child) .custom-file-label{border-top-left-radius:0;border-bottom-left-radius:0}.input-group:not(.has-validation)>.custom-file:not(:last-child) .custom-file-label,.input-group:not(.has-validation)>.custom-file:not(:last-child) .custom-file-label::after,.input-group:not(.has-validation)>.custom-select:not(:last-child),.input-group:not(.has-validation)>.form-control:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.input-group.has-validation>.custom-file:nth-last-child(n+3) .custom-file-label,.input-group.has-validation>.custom-file:nth-last-child(n+3) .custom-file-label::after,.input-group.has-validation>.custom-select:nth-last-child(n+3),.input-group.has-validation>.form-control:nth-last-child(n+3){border-top-right-radius:0;border-bottom-right-radius:0}.input-group-append,.input-group-prepend{display:-ms-flexbox;display:flex}.input-group-append .btn,.input-group-prepend .btn{position:relative;z-index:2}.input-group-append .btn:focus,.input-group-prepend .btn:focus{z-index:3}.input-group-append .btn+.btn,.input-group-append .btn+.input-group-text,.input-group-append .input-group-text+.btn,.input-group-append .input-group-text+.input-group-text,.input-group-prepend .btn+.btn,.input-group-prepend .btn+.input-group-text,.input-group-prepend .input-group-text+.btn,.input-group-prepend .input-group-text+.input-group-text{margin-left:-1px}.input-group-prepend{margin-right:-1px}.input-group-append{margin-left:-1px}.input-group-text{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:.375rem .75rem;margin-bottom:0;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;text-align:center;white-space:nowrap;background-color:#e9ecef;border:1px solid #ced4da;border-radius:.25rem}.input-group-text input[type=checkbox],.input-group-text input[type=radio]{margin-top:0}.input-group-lg>.custom-select,.input-group-lg>.form-control:not(textarea){height:calc(1.5em + 1rem + 2px)}.input-group-lg>.custom-select,.input-group-lg>.form-control,.input-group-lg>.input-group-append>.btn,.input-group-lg>.input-group-append>.input-group-text,.input-group-lg>.input-group-prepend>.btn,.input-group-lg>.input-group-prepend>.input-group-text{padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}.input-group-sm>.custom-select,.input-group-sm>.form-control:not(textarea){height:calc(1.5em + .5rem + 2px)}.input-group-sm>.custom-select,.input-group-sm>.form-control,.input-group-sm>.input-group-append>.btn,.input-group-sm>.input-group-append>.input-group-text,.input-group-sm>.input-group-prepend>.btn,.input-group-sm>.input-group-prepend>.input-group-text{padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.input-group-lg>.custom-select,.input-group-sm>.custom-select{padding-right:1.75rem}.input-group.has-validation>.input-group-append:nth-last-child(n+3)>.btn,.input-group.has-validation>.input-group-append:nth-last-child(n+3)>.input-group-text,.input-group:not(.has-validation)>.input-group-append:not(:last-child)>.btn,.input-group:not(.has-validation)>.input-group-append:not(:last-child)>.input-group-text,.input-group>.input-group-append:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group>.input-group-append:last-child>.input-group-text:not(:last-child),.input-group>.input-group-prepend>.btn,.input-group>.input-group-prepend>.input-group-text{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.input-group-append>.btn,.input-group>.input-group-append>.input-group-text,.input-group>.input-group-prepend:first-child>.btn:not(:first-child),.input-group>.input-group-prepend:first-child>.input-group-text:not(:first-child),.input-group>.input-group-prepend:not(:first-child)>.btn,.input-group>.input-group-prepend:not(:first-child)>.input-group-text{border-top-left-radius:0;border-bottom-left-radius:0}.custom-control{position:relative;z-index:1;display:block;min-height:1.5rem;padding-left:1.5rem;-webkit-print-color-adjust:exact;color-adjust:exact;print-color-adjust:exact}.custom-control-inline{display:-ms-inline-flexbox;display:inline-flex;margin-right:1rem}.custom-control-input{position:absolute;left:0;z-index:-1;width:1rem;height:1.25rem;opacity:0}.custom-control-input:checked~.custom-control-label::before{color:#fff;border-color:#007bff;background-color:#007bff}.custom-control-input:focus~.custom-control-label::before{box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.custom-control-input:focus:not(:checked)~.custom-control-label::before{border-color:#80bdff}.custom-control-input:not(:disabled):active~.custom-control-label::before{color:#fff;background-color:#b3d7ff;border-color:#b3d7ff}.custom-control-input:disabled~.custom-control-label,.custom-control-input[disabled]~.custom-control-label{color:#6c757d}.custom-control-input:disabled~.custom-control-label::before,.custom-control-input[disabled]~.custom-control-label::before{background-color:#e9ecef}.custom-control-label{position:relative;margin-bottom:0;vertical-align:top}.custom-control-label::before{position:absolute;top:.25rem;left:-1.5rem;display:block;width:1rem;height:1rem;pointer-events:none;content:"";background-color:#fff;border:1px solid #adb5bd}.custom-control-label::after{position:absolute;top:.25rem;left:-1.5rem;display:block;width:1rem;height:1rem;content:"";background:50%/50% 50% no-repeat}.custom-checkbox .custom-control-label::before{border-radius:.25rem}.custom-checkbox .custom-control-input:checked~.custom-control-label::after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z'/%3e%3c/svg%3e")}.custom-checkbox .custom-control-input:indeterminate~.custom-control-label::before{border-color:#007bff;background-color:#007bff}.custom-checkbox .custom-control-input:indeterminate~.custom-control-label::after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3e%3cpath stroke='%23fff' d='M0 2h4'/%3e%3c/svg%3e")}.custom-checkbox .custom-control-input:disabled:checked~.custom-control-label::before{background-color:rgba(0,123,255,.5)}.custom-checkbox .custom-control-input:disabled:indeterminate~.custom-control-label::before{background-color:rgba(0,123,255,.5)}.custom-radio .custom-control-label::before{border-radius:50%}.custom-radio .custom-control-input:checked~.custom-control-label::after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e")}.custom-radio .custom-control-input:disabled:checked~.custom-control-label::before{background-color:rgba(0,123,255,.5)}.custom-switch{padding-left:2.25rem}.custom-switch .custom-control-label::before{left:-2.25rem;width:1.75rem;pointer-events:all;border-radius:.5rem}.custom-switch .custom-control-label::after{top:calc(.25rem + 2px);left:calc(-2.25rem + 2px);width:calc(1rem - 4px);height:calc(1rem - 4px);background-color:#adb5bd;border-radius:.5rem;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out,-webkit-transform .15s ease-in-out;transition:transform .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:transform .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out,-webkit-transform .15s ease-in-out}@media (prefers-reduced-motion:reduce){.custom-switch .custom-control-label::after{transition:none}}.custom-switch .custom-control-input:checked~.custom-control-label::after{background-color:#fff;-webkit-transform:translateX(.75rem);transform:translateX(.75rem)}.custom-switch .custom-control-input:disabled:checked~.custom-control-label::before{background-color:rgba(0,123,255,.5)}.custom-select{display:inline-block;width:100%;height:calc(1.5em + .75rem + 2px);padding:.375rem 1.75rem .375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;vertical-align:middle;background:#fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") right .75rem center/8px 10px no-repeat;border:1px solid #ced4da;border-radius:.25rem;-webkit-appearance:none;-moz-appearance:none;appearance:none}.custom-select:focus{border-color:#80bdff;outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.custom-select:focus::-ms-value{color:#495057;background-color:#fff}.custom-select[multiple],.custom-select[size]:not([size="1"]){height:auto;padding-right:.75rem;background-image:none}.custom-select:disabled{color:#6c757d;background-color:#e9ecef}.custom-select::-ms-expand{display:none}.custom-select:-moz-focusring{color:transparent;text-shadow:0 0 0 #495057}.custom-select-sm{height:calc(1.5em + .5rem + 2px);padding-top:.25rem;padding-bottom:.25rem;padding-left:.5rem;font-size:.875rem}.custom-select-lg{height:calc(1.5em + 1rem + 2px);padding-top:.5rem;padding-bottom:.5rem;padding-left:1rem;font-size:1.25rem}.custom-file{position:relative;display:inline-block;width:100%;height:calc(1.5em + .75rem + 2px);margin-bottom:0}.custom-file-input{position:relative;z-index:2;width:100%;height:calc(1.5em + .75rem + 2px);margin:0;overflow:hidden;opacity:0}.custom-file-input:focus~.custom-file-label{border-color:#80bdff;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.custom-file-input:disabled~.custom-file-label,.custom-file-input[disabled]~.custom-file-label{background-color:#e9ecef}.custom-file-input:lang(en)~.custom-file-label::after{content:"Browse"}.custom-file-input~.custom-file-label[data-browse]::after{content:attr(data-browse)}.custom-file-label{position:absolute;top:0;right:0;left:0;z-index:1;height:calc(1.5em + .75rem + 2px);padding:.375rem .75rem;overflow:hidden;font-weight:400;line-height:1.5;color:#495057;background-color:#fff;border:1px solid #ced4da;border-radius:.25rem}.custom-file-label::after{position:absolute;top:0;right:0;bottom:0;z-index:3;display:block;height:calc(1.5em + .75rem);padding:.375rem .75rem;line-height:1.5;color:#495057;content:"Browse";background-color:#e9ecef;border-left:inherit;border-radius:0 .25rem .25rem 0}.custom-range{width:100%;height:1.4rem;padding:0;background-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none}.custom-range:focus{outline:0}.custom-range:focus::-webkit-slider-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(0,123,255,.25)}.custom-range:focus::-moz-range-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(0,123,255,.25)}.custom-range:focus::-ms-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(0,123,255,.25)}.custom-range::-moz-focus-outer{border:0}.custom-range::-webkit-slider-thumb{width:1rem;height:1rem;margin-top:-.25rem;background-color:#007bff;border:0;border-radius:1rem;-webkit-transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;-webkit-appearance:none;appearance:none}@media (prefers-reduced-motion:reduce){.custom-range::-webkit-slider-thumb{-webkit-transition:none;transition:none}}.custom-range::-webkit-slider-thumb:active{background-color:#b3d7ff}.custom-range::-webkit-slider-runnable-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:#dee2e6;border-color:transparent;border-radius:1rem}.custom-range::-moz-range-thumb{width:1rem;height:1rem;background-color:#007bff;border:0;border-radius:1rem;-moz-transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;-moz-appearance:none;appearance:none}@media (prefers-reduced-motion:reduce){.custom-range::-moz-range-thumb{-moz-transition:none;transition:none}}.custom-range::-moz-range-thumb:active{background-color:#b3d7ff}.custom-range::-moz-range-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:#dee2e6;border-color:transparent;border-radius:1rem}.custom-range::-ms-thumb{width:1rem;height:1rem;margin-top:0;margin-right:.2rem;margin-left:.2rem;background-color:#007bff;border:0;border-radius:1rem;-ms-transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;appearance:none}@media (prefers-reduced-motion:reduce){.custom-range::-ms-thumb{-ms-transition:none;transition:none}}.custom-range::-ms-thumb:active{background-color:#b3d7ff}.custom-range::-ms-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:transparent;border-color:transparent;border-width:.5rem}.custom-range::-ms-fill-lower{background-color:#dee2e6;border-radius:1rem}.custom-range::-ms-fill-upper{margin-right:15px;background-color:#dee2e6;border-radius:1rem}.custom-range:disabled::-webkit-slider-thumb{background-color:#adb5bd}.custom-range:disabled::-webkit-slider-runnable-track{cursor:default}.custom-range:disabled::-moz-range-thumb{background-color:#adb5bd}.custom-range:disabled::-moz-range-track{cursor:default}.custom-range:disabled::-ms-thumb{background-color:#adb5bd}.custom-control-label::before,.custom-file-label,.custom-select{transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.custom-control-label::before,.custom-file-label,.custom-select{transition:none}}.nav{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding-left:0;margin-bottom:0;list-style:none}.nav-link{display:block;padding:.5rem 1rem}.nav-link:focus,.nav-link:hover{text-decoration:none}.nav-link.disabled{color:#6c757d;pointer-events:none;cursor:default}.nav-tabs{border-bottom:1px solid #dee2e6}.nav-tabs .nav-link{margin-bottom:-1px;background-color:transparent;border:1px solid transparent;border-top-left-radius:.25rem;border-top-right-radius:.25rem}.nav-tabs .nav-link:focus,.nav-tabs .nav-link:hover{isolation:isolate;border-color:#e9ecef #e9ecef #dee2e6}.nav-tabs .nav-link.disabled{color:#6c757d;background-color:transparent;border-color:transparent}.nav-tabs .nav-item.show .nav-link,.nav-tabs .nav-link.active{color:#495057;background-color:#fff;border-color:#dee2e6 #dee2e6 #fff}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.nav-pills .nav-link{background:0 0;border:0;border-radius:.25rem}.nav-pills .nav-link.active,.nav-pills .show>.nav-link{color:#fff;background-color:#007bff}.nav-fill .nav-item,.nav-fill>.nav-link{-ms-flex:1 1 auto;flex:1 1 auto;text-align:center}.nav-justified .nav-item,.nav-justified>.nav-link{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;text-align:center}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.navbar{position:relative;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:.5rem 1rem}.navbar .container,.navbar .container-fluid,.navbar .container-lg,.navbar .container-md,.navbar .container-sm,.navbar .container-xl{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}.navbar-brand{display:inline-block;padding-top:.3125rem;padding-bottom:.3125rem;margin-right:1rem;font-size:1.25rem;line-height:inherit;white-space:nowrap}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-nav{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding-left:0;margin-bottom:0;list-style:none}.navbar-nav .nav-link{padding-right:0;padding-left:0}.navbar-nav .dropdown-menu{position:static;float:none}.navbar-text{display:inline-block;padding-top:.5rem;padding-bottom:.5rem}.navbar-collapse{-ms-flex-preferred-size:100%;flex-basis:100%;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center}.navbar-toggler{padding:.25rem .75rem;font-size:1.25rem;line-height:1;background-color:transparent;border:1px solid transparent;border-radius:.25rem}.navbar-toggler:focus,.navbar-toggler:hover{text-decoration:none}.navbar-toggler-icon{display:inline-block;width:1.5em;height:1.5em;vertical-align:middle;content:"";background:50%/100% 100% no-repeat}.navbar-nav-scroll{max-height:75vh;overflow-y:auto}@media (max-width:575.98px){.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid,.navbar-expand-sm>.container-lg,.navbar-expand-sm>.container-md,.navbar-expand-sm>.container-sm,.navbar-expand-sm>.container-xl{padding-right:0;padding-left:0}}@media (min-width:576px){.navbar-expand-sm{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-sm .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-sm .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid,.navbar-expand-sm>.container-lg,.navbar-expand-sm>.container-md,.navbar-expand-sm>.container-sm,.navbar-expand-sm>.container-xl{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-sm .navbar-nav-scroll{overflow:visible}.navbar-expand-sm .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-sm .navbar-toggler{display:none}}@media (max-width:767.98px){.navbar-expand-md>.container,.navbar-expand-md>.container-fluid,.navbar-expand-md>.container-lg,.navbar-expand-md>.container-md,.navbar-expand-md>.container-sm,.navbar-expand-md>.container-xl{padding-right:0;padding-left:0}}@media (min-width:768px){.navbar-expand-md{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-md .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-md .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-md>.container,.navbar-expand-md>.container-fluid,.navbar-expand-md>.container-lg,.navbar-expand-md>.container-md,.navbar-expand-md>.container-sm,.navbar-expand-md>.container-xl{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-md .navbar-nav-scroll{overflow:visible}.navbar-expand-md .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-md .navbar-toggler{display:none}}@media (max-width:991.98px){.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid,.navbar-expand-lg>.container-lg,.navbar-expand-lg>.container-md,.navbar-expand-lg>.container-sm,.navbar-expand-lg>.container-xl{padding-right:0;padding-left:0}}@media (min-width:992px){.navbar-expand-lg{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-lg .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-lg .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid,.navbar-expand-lg>.container-lg,.navbar-expand-lg>.container-md,.navbar-expand-lg>.container-sm,.navbar-expand-lg>.container-xl{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-lg .navbar-nav-scroll{overflow:visible}.navbar-expand-lg .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-lg .navbar-toggler{display:none}}@media (max-width:1199.98px){.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid,.navbar-expand-xl>.container-lg,.navbar-expand-xl>.container-md,.navbar-expand-xl>.container-sm,.navbar-expand-xl>.container-xl{padding-right:0;padding-left:0}}@media (min-width:1200px){.navbar-expand-xl{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-xl .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-xl .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid,.navbar-expand-xl>.container-lg,.navbar-expand-xl>.container-md,.navbar-expand-xl>.container-sm,.navbar-expand-xl>.container-xl{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-xl .navbar-nav-scroll{overflow:visible}.navbar-expand-xl .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-xl .navbar-toggler{display:none}}.navbar-expand{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand>.container,.navbar-expand>.container-fluid,.navbar-expand>.container-lg,.navbar-expand>.container-md,.navbar-expand>.container-sm,.navbar-expand>.container-xl{padding-right:0;padding-left:0}.navbar-expand .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.navbar-expand .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand>.container,.navbar-expand>.container-fluid,.navbar-expand>.container-lg,.navbar-expand>.container-md,.navbar-expand>.container-sm,.navbar-expand>.container-xl{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand .navbar-nav-scroll{overflow:visible}.navbar-expand .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand .navbar-toggler{display:none}.navbar-light .navbar-brand{color:rgba(0,0,0,.9)}.navbar-light .navbar-brand:focus,.navbar-light .navbar-brand:hover{color:rgba(0,0,0,.9)}.navbar-light .navbar-nav .nav-link{color:rgba(0,0,0,.5)}.navbar-light .navbar-nav .nav-link:focus,.navbar-light .navbar-nav .nav-link:hover{color:rgba(0,0,0,.7)}.navbar-light .navbar-nav .nav-link.disabled{color:rgba(0,0,0,.3)}.navbar-light .navbar-nav .active>.nav-link,.navbar-light .navbar-nav .nav-link.active,.navbar-light .navbar-nav .nav-link.show,.navbar-light .navbar-nav .show>.nav-link{color:rgba(0,0,0,.9)}.navbar-light .navbar-toggler{color:rgba(0,0,0,.5);border-color:rgba(0,0,0,.1)}.navbar-light .navbar-toggler-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280, 0, 0, 0.5%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e")}.navbar-light .navbar-text{color:rgba(0,0,0,.5)}.navbar-light .navbar-text a{color:rgba(0,0,0,.9)}.navbar-light .navbar-text a:focus,.navbar-light .navbar-text a:hover{color:rgba(0,0,0,.9)}.navbar-dark .navbar-brand{color:#fff}.navbar-dark .navbar-brand:focus,.navbar-dark .navbar-brand:hover{color:#fff}.navbar-dark .navbar-nav .nav-link{color:rgba(255,255,255,.5)}.navbar-dark .navbar-nav .nav-link:focus,.navbar-dark .navbar-nav .nav-link:hover{color:rgba(255,255,255,.75)}.navbar-dark .navbar-nav .nav-link.disabled{color:rgba(255,255,255,.25)}.navbar-dark .navbar-nav .active>.nav-link,.navbar-dark .navbar-nav .nav-link.active,.navbar-dark .navbar-nav .nav-link.show,.navbar-dark .navbar-nav .show>.nav-link{color:#fff}.navbar-dark .navbar-toggler{color:rgba(255,255,255,.5);border-color:rgba(255,255,255,.1)}.navbar-dark .navbar-toggler-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.5%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e")}.navbar-dark .navbar-text{color:rgba(255,255,255,.5)}.navbar-dark .navbar-text a{color:#fff}.navbar-dark .navbar-text a:focus,.navbar-dark .navbar-text a:hover{color:#fff}.card{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-width:0;word-wrap:break-word;background-color:#fff;background-clip:border-box;border:1px solid rgba(0,0,0,.125);border-radius:.25rem}.card>hr{margin-right:0;margin-left:0}.card>.list-group{border-top:inherit;border-bottom:inherit}.card>.list-group:first-child{border-top-width:0;border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.card>.list-group:last-child{border-bottom-width:0;border-bottom-right-radius:calc(.25rem - 1px);border-bottom-left-radius:calc(.25rem - 1px)}.card>.card-header+.list-group,.card>.list-group+.card-footer{border-top:0}.card-body{-ms-flex:1 1 auto;flex:1 1 auto;min-height:1px;padding:1.25rem}.card-title{margin-bottom:.75rem}.card-subtitle{margin-top:-.375rem;margin-bottom:0}.card-text:last-child{margin-bottom:0}.card-link:hover{text-decoration:none}.card-link+.card-link{margin-left:1.25rem}.card-header{padding:.75rem 1.25rem;margin-bottom:0;background-color:rgba(0,0,0,.03);border-bottom:1px solid rgba(0,0,0,.125)}.card-header:first-child{border-radius:calc(.25rem - 1px) calc(.25rem - 1px) 0 0}.card-footer{padding:.75rem 1.25rem;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.125)}.card-footer:last-child{border-radius:0 0 calc(.25rem - 1px) calc(.25rem - 1px)}.card-header-tabs{margin-right:-.625rem;margin-bottom:-.75rem;margin-left:-.625rem;border-bottom:0}.card-header-pills{margin-right:-.625rem;margin-left:-.625rem}.card-img-overlay{position:absolute;top:0;right:0;bottom:0;left:0;padding:1.25rem;border-radius:calc(.25rem - 1px)}.card-img,.card-img-bottom,.card-img-top{-ms-flex-negative:0;flex-shrink:0;width:100%}.card-img,.card-img-top{border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.card-img,.card-img-bottom{border-bottom-right-radius:calc(.25rem - 1px);border-bottom-left-radius:calc(.25rem - 1px)}.card-deck .card{margin-bottom:15px}@media (min-width:576px){.card-deck{display:-ms-flexbox;display:flex;-ms-flex-flow:row wrap;flex-flow:row wrap;margin-right:-15px;margin-left:-15px}.card-deck .card{-ms-flex:1 0 0%;flex:1 0 0%;margin-right:15px;margin-bottom:0;margin-left:15px}}.card-group>.card{margin-bottom:15px}@media (min-width:576px){.card-group{display:-ms-flexbox;display:flex;-ms-flex-flow:row wrap;flex-flow:row wrap}.card-group>.card{-ms-flex:1 0 0%;flex:1 0 0%;margin-bottom:0}.card-group>.card+.card{margin-left:0;border-left:0}.card-group>.card:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.card-group>.card:not(:last-child) .card-header,.card-group>.card:not(:last-child) .card-img-top{border-top-right-radius:0}.card-group>.card:not(:last-child) .card-footer,.card-group>.card:not(:last-child) .card-img-bottom{border-bottom-right-radius:0}.card-group>.card:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.card-group>.card:not(:first-child) .card-header,.card-group>.card:not(:first-child) .card-img-top{border-top-left-radius:0}.card-group>.card:not(:first-child) .card-footer,.card-group>.card:not(:first-child) .card-img-bottom{border-bottom-left-radius:0}}.card-columns .card{margin-bottom:.75rem}@media (min-width:576px){.card-columns{-webkit-column-count:3;-moz-column-count:3;column-count:3;-webkit-column-gap:1.25rem;-moz-column-gap:1.25rem;column-gap:1.25rem;orphans:1;widows:1}.card-columns .card{display:inline-block;width:100%}}.accordion{overflow-anchor:none}.accordion>.card{overflow:hidden}.accordion>.card:not(:last-of-type){border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.accordion>.card:not(:first-of-type){border-top-left-radius:0;border-top-right-radius:0}.accordion>.card>.card-header{border-radius:0;margin-bottom:-1px}.breadcrumb{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding:.75rem 1rem;margin-bottom:1rem;list-style:none;background-color:#e9ecef;border-radius:.25rem}.breadcrumb-item+.breadcrumb-item{padding-left:.5rem}.breadcrumb-item+.breadcrumb-item::before{float:left;padding-right:.5rem;color:#6c757d;content:"/"}.breadcrumb-item+.breadcrumb-item:hover::before{text-decoration:underline}.breadcrumb-item+.breadcrumb-item:hover::before{text-decoration:none}.breadcrumb-item.active{color:#6c757d}.pagination{display:-ms-flexbox;display:flex;padding-left:0;list-style:none;border-radius:.25rem}.page-link{position:relative;display:block;padding:.5rem .75rem;margin-left:-1px;line-height:1.25;color:#007bff;background-color:#fff;border:1px solid #dee2e6}.page-link:hover{z-index:2;color:#0056b3;text-decoration:none;background-color:#e9ecef;border-color:#dee2e6}.page-link:focus{z-index:3;outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.page-item:first-child .page-link{margin-left:0;border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.page-item:last-child .page-link{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.page-item.active .page-link{z-index:3;color:#fff;background-color:#007bff;border-color:#007bff}.page-item.disabled .page-link{color:#6c757d;pointer-events:none;cursor:auto;background-color:#fff;border-color:#dee2e6}.pagination-lg .page-link{padding:.75rem 1.5rem;font-size:1.25rem;line-height:1.5}.pagination-lg .page-item:first-child .page-link{border-top-left-radius:.3rem;border-bottom-left-radius:.3rem}.pagination-lg .page-item:last-child .page-link{border-top-right-radius:.3rem;border-bottom-right-radius:.3rem}.pagination-sm .page-link{padding:.25rem .5rem;font-size:.875rem;line-height:1.5}.pagination-sm .page-item:first-child .page-link{border-top-left-radius:.2rem;border-bottom-left-radius:.2rem}.pagination-sm .page-item:last-child .page-link{border-top-right-radius:.2rem;border-bottom-right-radius:.2rem}.badge{display:inline-block;padding:.25em .4em;font-size:75%;font-weight:700;line-height:1;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.badge{transition:none}}a.badge:focus,a.badge:hover{text-decoration:none}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.badge-pill{padding-right:.6em;padding-left:.6em;border-radius:10rem}.badge-primary{color:#fff;background-color:#007bff}a.badge-primary:focus,a.badge-primary:hover{color:#fff;background-color:#0062cc}a.badge-primary.focus,a.badge-primary:focus{outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.badge-secondary{color:#fff;background-color:#6c757d}a.badge-secondary:focus,a.badge-secondary:hover{color:#fff;background-color:#545b62}a.badge-secondary.focus,a.badge-secondary:focus{outline:0;box-shadow:0 0 0 .2rem rgba(108,117,125,.5)}.badge-success{color:#fff;background-color:#28a745}a.badge-success:focus,a.badge-success:hover{color:#fff;background-color:#1e7e34}a.badge-success.focus,a.badge-success:focus{outline:0;box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.badge-info{color:#fff;background-color:#17a2b8}a.badge-info:focus,a.badge-info:hover{color:#fff;background-color:#117a8b}a.badge-info.focus,a.badge-info:focus{outline:0;box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.badge-warning{color:#212529;background-color:#ffc107}a.badge-warning:focus,a.badge-warning:hover{color:#212529;background-color:#d39e00}a.badge-warning.focus,a.badge-warning:focus{outline:0;box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.badge-danger{color:#fff;background-color:#dc3545}a.badge-danger:focus,a.badge-danger:hover{color:#fff;background-color:#bd2130}a.badge-danger.focus,a.badge-danger:focus{outline:0;box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.badge-light{color:#212529;background-color:#f8f9fa}a.badge-light:focus,a.badge-light:hover{color:#212529;background-color:#dae0e5}a.badge-light.focus,a.badge-light:focus{outline:0;box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.badge-dark{color:#fff;background-color:#343a40}a.badge-dark:focus,a.badge-dark:hover{color:#fff;background-color:#1d2124}a.badge-dark.focus,a.badge-dark:focus{outline:0;box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.jumbotron{padding:2rem 1rem;margin-bottom:2rem;background-color:#e9ecef;border-radius:.3rem}@media (min-width:576px){.jumbotron{padding:4rem 2rem}}.jumbotron-fluid{padding-right:0;padding-left:0;border-radius:0}.alert{position:relative;padding:.75rem 1.25rem;margin-bottom:1rem;border:1px solid transparent;border-radius:.25rem}.alert-heading{color:inherit}.alert-link{font-weight:700}.alert-dismissible{padding-right:4rem}.alert-dismissible .close{position:absolute;top:0;right:0;z-index:2;padding:.75rem 1.25rem;color:inherit}.alert-primary{color:#004085;background-color:#cce5ff;border-color:#b8daff}.alert-primary hr{border-top-color:#9fcdff}.alert-primary .alert-link{color:#002752}.alert-secondary{color:#383d41;background-color:#e2e3e5;border-color:#d6d8db}.alert-secondary hr{border-top-color:#c8cbcf}.alert-secondary .alert-link{color:#202326}.alert-success{color:#155724;background-color:#d4edda;border-color:#c3e6cb}.alert-success hr{border-top-color:#b1dfbb}.alert-success .alert-link{color:#0b2e13}.alert-info{color:#0c5460;background-color:#d1ecf1;border-color:#bee5eb}.alert-info hr{border-top-color:#abdde5}.alert-info .alert-link{color:#062c33}.alert-warning{color:#856404;background-color:#fff3cd;border-color:#ffeeba}.alert-warning hr{border-top-color:#ffe8a1}.alert-warning .alert-link{color:#533f03}.alert-danger{color:#721c24;background-color:#f8d7da;border-color:#f5c6cb}.alert-danger hr{border-top-color:#f1b0b7}.alert-danger .alert-link{color:#491217}.alert-light{color:#818182;background-color:#fefefe;border-color:#fdfdfe}.alert-light hr{border-top-color:#ececf6}.alert-light .alert-link{color:#686868}.alert-dark{color:#1b1e21;background-color:#d6d8d9;border-color:#c6c8ca}.alert-dark hr{border-top-color:#b9bbbe}.alert-dark .alert-link{color:#040505}@-webkit-keyframes progress-bar-stripes{from{background-position:1rem 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:1rem 0}to{background-position:0 0}}.progress{display:-ms-flexbox;display:flex;height:1rem;overflow:hidden;line-height:0;font-size:.75rem;background-color:#e9ecef;border-radius:.25rem}.progress-bar{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;overflow:hidden;color:#fff;text-align:center;white-space:nowrap;background-color:#007bff;transition:width .6s ease}@media (prefers-reduced-motion:reduce){.progress-bar{transition:none}}.progress-bar-striped{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:1rem 1rem}.progress-bar-animated{-webkit-animation:1s linear infinite progress-bar-stripes;animation:1s linear infinite progress-bar-stripes}@media (prefers-reduced-motion:reduce){.progress-bar-animated{-webkit-animation:none;animation:none}}.media{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start}.media-body{-ms-flex:1;flex:1}.list-group{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding-left:0;margin-bottom:0;border-radius:.25rem}.list-group-item-action{width:100%;color:#495057;text-align:inherit}.list-group-item-action:focus,.list-group-item-action:hover{z-index:1;color:#495057;text-decoration:none;background-color:#f8f9fa}.list-group-item-action:active{color:#212529;background-color:#e9ecef}.list-group-item{position:relative;display:block;padding:.75rem 1.25rem;background-color:#fff;border:1px solid rgba(0,0,0,.125)}.list-group-item:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.list-group-item:last-child{border-bottom-right-radius:inherit;border-bottom-left-radius:inherit}.list-group-item.disabled,.list-group-item:disabled{color:#6c757d;pointer-events:none;background-color:#fff}.list-group-item.active{z-index:2;color:#fff;background-color:#007bff;border-color:#007bff}.list-group-item+.list-group-item{border-top-width:0}.list-group-item+.list-group-item.active{margin-top:-1px;border-top-width:1px}.list-group-horizontal{-ms-flex-direction:row;flex-direction:row}.list-group-horizontal>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal>.list-group-item.active{margin-top:0}.list-group-horizontal>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}@media (min-width:576px){.list-group-horizontal-sm{-ms-flex-direction:row;flex-direction:row}.list-group-horizontal-sm>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-sm>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-sm>.list-group-item.active{margin-top:0}.list-group-horizontal-sm>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-sm>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}@media (min-width:768px){.list-group-horizontal-md{-ms-flex-direction:row;flex-direction:row}.list-group-horizontal-md>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-md>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-md>.list-group-item.active{margin-top:0}.list-group-horizontal-md>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-md>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}@media (min-width:992px){.list-group-horizontal-lg{-ms-flex-direction:row;flex-direction:row}.list-group-horizontal-lg>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-lg>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-lg>.list-group-item.active{margin-top:0}.list-group-horizontal-lg>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-lg>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}@media (min-width:1200px){.list-group-horizontal-xl{-ms-flex-direction:row;flex-direction:row}.list-group-horizontal-xl>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-xl>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-xl>.list-group-item.active{margin-top:0}.list-group-horizontal-xl>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-xl>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}.list-group-flush{border-radius:0}.list-group-flush>.list-group-item{border-width:0 0 1px}.list-group-flush>.list-group-item:last-child{border-bottom-width:0}.list-group-item-primary{color:#004085;background-color:#b8daff}.list-group-item-primary.list-group-item-action:focus,.list-group-item-primary.list-group-item-action:hover{color:#004085;background-color:#9fcdff}.list-group-item-primary.list-group-item-action.active{color:#fff;background-color:#004085;border-color:#004085}.list-group-item-secondary{color:#383d41;background-color:#d6d8db}.list-group-item-secondary.list-group-item-action:focus,.list-group-item-secondary.list-group-item-action:hover{color:#383d41;background-color:#c8cbcf}.list-group-item-secondary.list-group-item-action.active{color:#fff;background-color:#383d41;border-color:#383d41}.list-group-item-success{color:#155724;background-color:#c3e6cb}.list-group-item-success.list-group-item-action:focus,.list-group-item-success.list-group-item-action:hover{color:#155724;background-color:#b1dfbb}.list-group-item-success.list-group-item-action.active{color:#fff;background-color:#155724;border-color:#155724}.list-group-item-info{color:#0c5460;background-color:#bee5eb}.list-group-item-info.list-group-item-action:focus,.list-group-item-info.list-group-item-action:hover{color:#0c5460;background-color:#abdde5}.list-group-item-info.list-group-item-action.active{color:#fff;background-color:#0c5460;border-color:#0c5460}.list-group-item-warning{color:#856404;background-color:#ffeeba}.list-group-item-warning.list-group-item-action:focus,.list-group-item-warning.list-group-item-action:hover{color:#856404;background-color:#ffe8a1}.list-group-item-warning.list-group-item-action.active{color:#fff;background-color:#856404;border-color:#856404}.list-group-item-danger{color:#721c24;background-color:#f5c6cb}.list-group-item-danger.list-group-item-action:focus,.list-group-item-danger.list-group-item-action:hover{color:#721c24;background-color:#f1b0b7}.list-group-item-danger.list-group-item-action.active{color:#fff;background-color:#721c24;border-color:#721c24}.list-group-item-light{color:#818182;background-color:#fdfdfe}.list-group-item-light.list-group-item-action:focus,.list-group-item-light.list-group-item-action:hover{color:#818182;background-color:#ececf6}.list-group-item-light.list-group-item-action.active{color:#fff;background-color:#818182;border-color:#818182}.list-group-item-dark{color:#1b1e21;background-color:#c6c8ca}.list-group-item-dark.list-group-item-action:focus,.list-group-item-dark.list-group-item-action:hover{color:#1b1e21;background-color:#b9bbbe}.list-group-item-dark.list-group-item-action.active{color:#fff;background-color:#1b1e21;border-color:#1b1e21}.close{float:right;font-size:1.5rem;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.5}.close:hover{color:#000;text-decoration:none}.close:not(:disabled):not(.disabled):focus,.close:not(:disabled):not(.disabled):hover{opacity:.75}button.close{padding:0;background-color:transparent;border:0}a.close.disabled{pointer-events:none}.toast{-ms-flex-preferred-size:350px;flex-basis:350px;max-width:350px;font-size:.875rem;background-color:rgba(255,255,255,.85);background-clip:padding-box;border:1px solid rgba(0,0,0,.1);box-shadow:0 .25rem .75rem rgba(0,0,0,.1);opacity:0;border-radius:.25rem}.toast:not(:last-child){margin-bottom:.75rem}.toast.showing{opacity:1}.toast.show{display:block;opacity:1}.toast.hide{display:none}.toast-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:.25rem .75rem;color:#6c757d;background-color:rgba(255,255,255,.85);background-clip:padding-box;border-bottom:1px solid rgba(0,0,0,.05);border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.toast-body{padding:.75rem}.modal-open{overflow:hidden}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal{position:fixed;top:0;left:0;z-index:1050;display:none;width:100%;height:100%;overflow:hidden;outline:0}.modal-dialog{position:relative;width:auto;margin:.5rem;pointer-events:none}.modal.fade .modal-dialog{transition:-webkit-transform .3s ease-out;transition:transform .3s ease-out;transition:transform .3s ease-out,-webkit-transform .3s ease-out;-webkit-transform:translate(0,-50px);transform:translate(0,-50px)}@media (prefers-reduced-motion:reduce){.modal.fade .modal-dialog{transition:none}}.modal.show .modal-dialog{-webkit-transform:none;transform:none}.modal.modal-static .modal-dialog{-webkit-transform:scale(1.02);transform:scale(1.02)}.modal-dialog-scrollable{display:-ms-flexbox;display:flex;max-height:calc(100% - 1rem)}.modal-dialog-scrollable .modal-content{max-height:calc(100vh - 1rem);overflow:hidden}.modal-dialog-scrollable .modal-footer,.modal-dialog-scrollable .modal-header{-ms-flex-negative:0;flex-shrink:0}.modal-dialog-scrollable .modal-body{overflow-y:auto}.modal-dialog-centered{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:calc(100% - 1rem)}.modal-dialog-centered::before{display:block;height:calc(100vh - 1rem);height:-webkit-min-content;height:-moz-min-content;height:min-content;content:""}.modal-dialog-centered.modal-dialog-scrollable{-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;height:100%}.modal-dialog-centered.modal-dialog-scrollable .modal-content{max-height:none}.modal-dialog-centered.modal-dialog-scrollable::before{content:none}.modal-content{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;width:100%;pointer-events:auto;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:.3rem;outline:0}.modal-backdrop{position:fixed;top:0;left:0;z-index:1040;width:100vw;height:100vh;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop.show{opacity:.5}.modal-header{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:justify;justify-content:space-between;padding:1rem 1rem;border-bottom:1px solid #dee2e6;border-top-left-radius:calc(.3rem - 1px);border-top-right-radius:calc(.3rem - 1px)}.modal-header .close{padding:1rem 1rem;margin:-1rem -1rem -1rem auto}.modal-title{margin-bottom:0;line-height:1.5}.modal-body{position:relative;-ms-flex:1 1 auto;flex:1 1 auto;padding:1rem}.modal-footer{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end;padding:.75rem;border-top:1px solid #dee2e6;border-bottom-right-radius:calc(.3rem - 1px);border-bottom-left-radius:calc(.3rem - 1px)}.modal-footer>*{margin:.25rem}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:576px){.modal-dialog{max-width:500px;margin:1.75rem auto}.modal-dialog-scrollable{max-height:calc(100% - 3.5rem)}.modal-dialog-scrollable .modal-content{max-height:calc(100vh - 3.5rem)}.modal-dialog-centered{min-height:calc(100% - 3.5rem)}.modal-dialog-centered::before{height:calc(100vh - 3.5rem);height:-webkit-min-content;height:-moz-min-content;height:min-content}.modal-sm{max-width:300px}}@media (min-width:992px){.modal-lg,.modal-xl{max-width:800px}}@media (min-width:1200px){.modal-xl{max-width:1140px}}.tooltip{position:absolute;z-index:1070;display:block;margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;white-space:normal;word-spacing:normal;line-break:auto;font-size:.875rem;word-wrap:break-word;opacity:0}.tooltip.show{opacity:.9}.tooltip .arrow{position:absolute;display:block;width:.8rem;height:.4rem}.tooltip .arrow::before{position:absolute;content:"";border-color:transparent;border-style:solid}.bs-tooltip-auto[x-placement^=top],.bs-tooltip-top{padding:.4rem 0}.bs-tooltip-auto[x-placement^=top] .arrow,.bs-tooltip-top .arrow{bottom:0}.bs-tooltip-auto[x-placement^=top] .arrow::before,.bs-tooltip-top .arrow::before{top:0;border-width:.4rem .4rem 0;border-top-color:#000}.bs-tooltip-auto[x-placement^=right],.bs-tooltip-right{padding:0 .4rem}.bs-tooltip-auto[x-placement^=right] .arrow,.bs-tooltip-right .arrow{left:0;width:.4rem;height:.8rem}.bs-tooltip-auto[x-placement^=right] .arrow::before,.bs-tooltip-right .arrow::before{right:0;border-width:.4rem .4rem .4rem 0;border-right-color:#000}.bs-tooltip-auto[x-placement^=bottom],.bs-tooltip-bottom{padding:.4rem 0}.bs-tooltip-auto[x-placement^=bottom] .arrow,.bs-tooltip-bottom .arrow{top:0}.bs-tooltip-auto[x-placement^=bottom] .arrow::before,.bs-tooltip-bottom .arrow::before{bottom:0;border-width:0 .4rem .4rem;border-bottom-color:#000}.bs-tooltip-auto[x-placement^=left],.bs-tooltip-left{padding:0 .4rem}.bs-tooltip-auto[x-placement^=left] .arrow,.bs-tooltip-left .arrow{right:0;width:.4rem;height:.8rem}.bs-tooltip-auto[x-placement^=left] .arrow::before,.bs-tooltip-left .arrow::before{left:0;border-width:.4rem 0 .4rem .4rem;border-left-color:#000}.tooltip-inner{max-width:200px;padding:.25rem .5rem;color:#fff;text-align:center;background-color:#000;border-radius:.25rem}.popover{position:absolute;top:0;left:0;z-index:1060;display:block;max-width:276px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;white-space:normal;word-spacing:normal;line-break:auto;font-size:.875rem;word-wrap:break-word;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:.3rem}.popover .arrow{position:absolute;display:block;width:1rem;height:.5rem;margin:0 .3rem}.popover .arrow::after,.popover .arrow::before{position:absolute;display:block;content:"";border-color:transparent;border-style:solid}.bs-popover-auto[x-placement^=top],.bs-popover-top{margin-bottom:.5rem}.bs-popover-auto[x-placement^=top]>.arrow,.bs-popover-top>.arrow{bottom:calc(-.5rem - 1px)}.bs-popover-auto[x-placement^=top]>.arrow::before,.bs-popover-top>.arrow::before{bottom:0;border-width:.5rem .5rem 0;border-top-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=top]>.arrow::after,.bs-popover-top>.arrow::after{bottom:1px;border-width:.5rem .5rem 0;border-top-color:#fff}.bs-popover-auto[x-placement^=right],.bs-popover-right{margin-left:.5rem}.bs-popover-auto[x-placement^=right]>.arrow,.bs-popover-right>.arrow{left:calc(-.5rem - 1px);width:.5rem;height:1rem;margin:.3rem 0}.bs-popover-auto[x-placement^=right]>.arrow::before,.bs-popover-right>.arrow::before{left:0;border-width:.5rem .5rem .5rem 0;border-right-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=right]>.arrow::after,.bs-popover-right>.arrow::after{left:1px;border-width:.5rem .5rem .5rem 0;border-right-color:#fff}.bs-popover-auto[x-placement^=bottom],.bs-popover-bottom{margin-top:.5rem}.bs-popover-auto[x-placement^=bottom]>.arrow,.bs-popover-bottom>.arrow{top:calc(-.5rem - 1px)}.bs-popover-auto[x-placement^=bottom]>.arrow::before,.bs-popover-bottom>.arrow::before{top:0;border-width:0 .5rem .5rem .5rem;border-bottom-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=bottom]>.arrow::after,.bs-popover-bottom>.arrow::after{top:1px;border-width:0 .5rem .5rem .5rem;border-bottom-color:#fff}.bs-popover-auto[x-placement^=bottom] .popover-header::before,.bs-popover-bottom .popover-header::before{position:absolute;top:0;left:50%;display:block;width:1rem;margin-left:-.5rem;content:"";border-bottom:1px solid #f7f7f7}.bs-popover-auto[x-placement^=left],.bs-popover-left{margin-right:.5rem}.bs-popover-auto[x-placement^=left]>.arrow,.bs-popover-left>.arrow{right:calc(-.5rem - 1px);width:.5rem;height:1rem;margin:.3rem 0}.bs-popover-auto[x-placement^=left]>.arrow::before,.bs-popover-left>.arrow::before{right:0;border-width:.5rem 0 .5rem .5rem;border-left-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=left]>.arrow::after,.bs-popover-left>.arrow::after{right:1px;border-width:.5rem 0 .5rem .5rem;border-left-color:#fff}.popover-header{padding:.5rem .75rem;margin-bottom:0;font-size:1rem;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-top-left-radius:calc(.3rem - 1px);border-top-right-radius:calc(.3rem - 1px)}.popover-header:empty{display:none}.popover-body{padding:.5rem .75rem;color:#212529}.carousel{position:relative}.carousel.pointer-event{-ms-touch-action:pan-y;touch-action:pan-y}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner::after{display:block;clear:both;content:""}.carousel-item{position:relative;display:none;float:left;width:100%;margin-right:-100%;-webkit-backface-visibility:hidden;backface-visibility:hidden;transition:-webkit-transform .6s ease-in-out;transition:transform .6s ease-in-out;transition:transform .6s ease-in-out,-webkit-transform .6s ease-in-out}@media (prefers-reduced-motion:reduce){.carousel-item{transition:none}}.carousel-item-next,.carousel-item-prev,.carousel-item.active{display:block}.active.carousel-item-right,.carousel-item-next:not(.carousel-item-left){-webkit-transform:translateX(100%);transform:translateX(100%)}.active.carousel-item-left,.carousel-item-prev:not(.carousel-item-right){-webkit-transform:translateX(-100%);transform:translateX(-100%)}.carousel-fade .carousel-item{opacity:0;transition-property:opacity;-webkit-transform:none;transform:none}.carousel-fade .carousel-item-next.carousel-item-left,.carousel-fade .carousel-item-prev.carousel-item-right,.carousel-fade .carousel-item.active{z-index:1;opacity:1}.carousel-fade .active.carousel-item-left,.carousel-fade .active.carousel-item-right{z-index:0;opacity:0;transition:opacity 0s .6s}@media (prefers-reduced-motion:reduce){.carousel-fade .active.carousel-item-left,.carousel-fade .active.carousel-item-right{transition:none}}.carousel-control-next,.carousel-control-prev{position:absolute;top:0;bottom:0;z-index:1;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:15%;padding:0;color:#fff;text-align:center;background:0 0;border:0;opacity:.5;transition:opacity .15s ease}@media (prefers-reduced-motion:reduce){.carousel-control-next,.carousel-control-prev{transition:none}}.carousel-control-next:focus,.carousel-control-next:hover,.carousel-control-prev:focus,.carousel-control-prev:hover{color:#fff;text-decoration:none;outline:0;opacity:.9}.carousel-control-prev{left:0}.carousel-control-next{right:0}.carousel-control-next-icon,.carousel-control-prev-icon{display:inline-block;width:20px;height:20px;background:50%/100% 100% no-repeat}.carousel-control-prev-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath d='M5.25 0l-4 4 4 4 1.5-1.5L4.25 4l2.5-2.5L5.25 0z'/%3e%3c/svg%3e")}.carousel-control-next-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath d='M2.75 0l-1.5 1.5L3.75 4l-2.5 2.5L2.75 8l4-4-4-4z'/%3e%3c/svg%3e")}.carousel-indicators{position:absolute;right:0;bottom:0;left:0;z-index:15;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;padding-left:0;margin-right:15%;margin-left:15%;list-style:none}.carousel-indicators li{box-sizing:content-box;-ms-flex:0 1 auto;flex:0 1 auto;width:30px;height:3px;margin-right:3px;margin-left:3px;text-indent:-999px;cursor:pointer;background-color:#fff;background-clip:padding-box;border-top:10px solid transparent;border-bottom:10px solid transparent;opacity:.5;transition:opacity .6s ease}@media (prefers-reduced-motion:reduce){.carousel-indicators li{transition:none}}.carousel-indicators .active{opacity:1}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center}@-webkit-keyframes spinner-border{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spinner-border{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.spinner-border{display:inline-block;width:2rem;height:2rem;vertical-align:-.125em;border:.25em solid currentcolor;border-right-color:transparent;border-radius:50%;-webkit-animation:.75s linear infinite spinner-border;animation:.75s linear infinite spinner-border}.spinner-border-sm{width:1rem;height:1rem;border-width:.2em}@-webkit-keyframes spinner-grow{0%{-webkit-transform:scale(0);transform:scale(0)}50%{opacity:1;-webkit-transform:none;transform:none}}@keyframes spinner-grow{0%{-webkit-transform:scale(0);transform:scale(0)}50%{opacity:1;-webkit-transform:none;transform:none}}.spinner-grow{display:inline-block;width:2rem;height:2rem;vertical-align:-.125em;background-color:currentcolor;border-radius:50%;opacity:0;-webkit-animation:.75s linear infinite spinner-grow;animation:.75s linear infinite spinner-grow}.spinner-grow-sm{width:1rem;height:1rem}@media (prefers-reduced-motion:reduce){.spinner-border,.spinner-grow{-webkit-animation-duration:1.5s;animation-duration:1.5s}}.align-baseline{vertical-align:baseline!important}.align-top{vertical-align:top!important}.align-middle{vertical-align:middle!important}.align-bottom{vertical-align:bottom!important}.align-text-bottom{vertical-align:text-bottom!important}.align-text-top{vertical-align:text-top!important}.bg-primary{background-color:#007bff!important}a.bg-primary:focus,a.bg-primary:hover,button.bg-primary:focus,button.bg-primary:hover{background-color:#0062cc!important}.bg-secondary{background-color:#6c757d!important}a.bg-secondary:focus,a.bg-secondary:hover,button.bg-secondary:focus,button.bg-secondary:hover{background-color:#545b62!important}.bg-success{background-color:#28a745!important}a.bg-success:focus,a.bg-success:hover,button.bg-success:focus,button.bg-success:hover{background-color:#1e7e34!important}.bg-info{background-color:#17a2b8!important}a.bg-info:focus,a.bg-info:hover,button.bg-info:focus,button.bg-info:hover{background-color:#117a8b!important}.bg-warning{background-color:#ffc107!important}a.bg-warning:focus,a.bg-warning:hover,button.bg-warning:focus,button.bg-warning:hover{background-color:#d39e00!important}.bg-danger{background-color:#dc3545!important}a.bg-danger:focus,a.bg-danger:hover,button.bg-danger:focus,button.bg-danger:hover{background-color:#bd2130!important}.bg-light{background-color:#f8f9fa!important}a.bg-light:focus,a.bg-light:hover,button.bg-light:focus,button.bg-light:hover{background-color:#dae0e5!important}.bg-dark{background-color:#343a40!important}a.bg-dark:focus,a.bg-dark:hover,button.bg-dark:focus,button.bg-dark:hover{background-color:#1d2124!important}.bg-white{background-color:#fff!important}.bg-transparent{background-color:transparent!important}.border{border:1px solid #dee2e6!important}.border-top{border-top:1px solid #dee2e6!important}.border-right{border-right:1px solid #dee2e6!important}.border-bottom{border-bottom:1px solid #dee2e6!important}.border-left{border-left:1px solid #dee2e6!important}.border-0{border:0!important}.border-top-0{border-top:0!important}.border-right-0{border-right:0!important}.border-bottom-0{border-bottom:0!important}.border-left-0{border-left:0!important}.border-primary{border-color:#007bff!important}.border-secondary{border-color:#6c757d!important}.border-success{border-color:#28a745!important}.border-info{border-color:#17a2b8!important}.border-warning{border-color:#ffc107!important}.border-danger{border-color:#dc3545!important}.border-light{border-color:#f8f9fa!important}.border-dark{border-color:#343a40!important}.border-white{border-color:#fff!important}.rounded-sm{border-radius:.2rem!important}.rounded{border-radius:.25rem!important}.rounded-top{border-top-left-radius:.25rem!important;border-top-right-radius:.25rem!important}.rounded-right{border-top-right-radius:.25rem!important;border-bottom-right-radius:.25rem!important}.rounded-bottom{border-bottom-right-radius:.25rem!important;border-bottom-left-radius:.25rem!important}.rounded-left{border-top-left-radius:.25rem!important;border-bottom-left-radius:.25rem!important}.rounded-lg{border-radius:.3rem!important}.rounded-circle{border-radius:50%!important}.rounded-pill{border-radius:50rem!important}.rounded-0{border-radius:0!important}.clearfix::after{display:block;clear:both;content:""}.d-none{display:none!important}.d-inline{display:inline!important}.d-inline-block{display:inline-block!important}.d-block{display:block!important}.d-table{display:table!important}.d-table-row{display:table-row!important}.d-table-cell{display:table-cell!important}.d-flex{display:-ms-flexbox!important;display:flex!important}.d-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}@media (min-width:576px){.d-sm-none{display:none!important}.d-sm-inline{display:inline!important}.d-sm-inline-block{display:inline-block!important}.d-sm-block{display:block!important}.d-sm-table{display:table!important}.d-sm-table-row{display:table-row!important}.d-sm-table-cell{display:table-cell!important}.d-sm-flex{display:-ms-flexbox!important;display:flex!important}.d-sm-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:768px){.d-md-none{display:none!important}.d-md-inline{display:inline!important}.d-md-inline-block{display:inline-block!important}.d-md-block{display:block!important}.d-md-table{display:table!important}.d-md-table-row{display:table-row!important}.d-md-table-cell{display:table-cell!important}.d-md-flex{display:-ms-flexbox!important;display:flex!important}.d-md-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:992px){.d-lg-none{display:none!important}.d-lg-inline{display:inline!important}.d-lg-inline-block{display:inline-block!important}.d-lg-block{display:block!important}.d-lg-table{display:table!important}.d-lg-table-row{display:table-row!important}.d-lg-table-cell{display:table-cell!important}.d-lg-flex{display:-ms-flexbox!important;display:flex!important}.d-lg-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:1200px){.d-xl-none{display:none!important}.d-xl-inline{display:inline!important}.d-xl-inline-block{display:inline-block!important}.d-xl-block{display:block!important}.d-xl-table{display:table!important}.d-xl-table-row{display:table-row!important}.d-xl-table-cell{display:table-cell!important}.d-xl-flex{display:-ms-flexbox!important;display:flex!important}.d-xl-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media print{.d-print-none{display:none!important}.d-print-inline{display:inline!important}.d-print-inline-block{display:inline-block!important}.d-print-block{display:block!important}.d-print-table{display:table!important}.d-print-table-row{display:table-row!important}.d-print-table-cell{display:table-cell!important}.d-print-flex{display:-ms-flexbox!important;display:flex!important}.d-print-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}.embed-responsive{position:relative;display:block;width:100%;padding:0;overflow:hidden}.embed-responsive::before{display:block;content:""}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-21by9::before{padding-top:42.857143%}.embed-responsive-16by9::before{padding-top:56.25%}.embed-responsive-4by3::before{padding-top:75%}.embed-responsive-1by1::before{padding-top:100%}.flex-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-center{-ms-flex-align:center!important;align-items:center!important}.align-items-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}@media (min-width:576px){.flex-sm-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-sm-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-sm-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-sm-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-sm-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-sm-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-sm-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-sm-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-sm-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-sm-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-sm-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-sm-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-sm-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-sm-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-sm-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-sm-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-sm-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-sm-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-sm-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-sm-center{-ms-flex-align:center!important;align-items:center!important}.align-items-sm-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-sm-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-sm-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-sm-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-sm-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-sm-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-sm-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-sm-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-sm-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-sm-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-sm-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-sm-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-sm-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-sm-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:768px){.flex-md-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-md-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-md-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-md-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-md-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-md-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-md-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-md-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-md-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-md-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-md-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-md-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-md-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-md-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-md-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-md-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-md-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-md-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-md-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-md-center{-ms-flex-align:center!important;align-items:center!important}.align-items-md-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-md-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-md-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-md-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-md-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-md-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-md-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-md-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-md-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-md-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-md-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-md-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-md-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-md-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:992px){.flex-lg-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-lg-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-lg-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-lg-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-lg-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-lg-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-lg-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-lg-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-lg-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-lg-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-lg-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-lg-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-lg-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-lg-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-lg-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-lg-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-lg-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-lg-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-lg-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-lg-center{-ms-flex-align:center!important;align-items:center!important}.align-items-lg-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-lg-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-lg-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-lg-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-lg-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-lg-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-lg-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-lg-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-lg-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-lg-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-lg-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-lg-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-lg-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-lg-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:1200px){.flex-xl-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-xl-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-xl-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-xl-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-xl-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-xl-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-xl-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-xl-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-xl-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-xl-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-xl-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-xl-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-xl-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-xl-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-xl-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-xl-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-xl-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-xl-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-xl-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-xl-center{-ms-flex-align:center!important;align-items:center!important}.align-items-xl-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-xl-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-xl-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-xl-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-xl-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-xl-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-xl-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-xl-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-xl-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-xl-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-xl-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-xl-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-xl-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-xl-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}.float-left{float:left!important}.float-right{float:right!important}.float-none{float:none!important}@media (min-width:576px){.float-sm-left{float:left!important}.float-sm-right{float:right!important}.float-sm-none{float:none!important}}@media (min-width:768px){.float-md-left{float:left!important}.float-md-right{float:right!important}.float-md-none{float:none!important}}@media (min-width:992px){.float-lg-left{float:left!important}.float-lg-right{float:right!important}.float-lg-none{float:none!important}}@media (min-width:1200px){.float-xl-left{float:left!important}.float-xl-right{float:right!important}.float-xl-none{float:none!important}}.user-select-all{-webkit-user-select:all!important;-moz-user-select:all!important;user-select:all!important}.user-select-auto{-webkit-user-select:auto!important;-moz-user-select:auto!important;-ms-user-select:auto!important;user-select:auto!important}.user-select-none{-webkit-user-select:none!important;-moz-user-select:none!important;-ms-user-select:none!important;user-select:none!important}.overflow-auto{overflow:auto!important}.overflow-hidden{overflow:hidden!important}.position-static{position:static!important}.position-relative{position:relative!important}.position-absolute{position:absolute!important}.position-fixed{position:fixed!important}.position-sticky{position:-webkit-sticky!important;position:sticky!important}.fixed-top{position:fixed;top:0;right:0;left:0;z-index:1030}.fixed-bottom{position:fixed;right:0;bottom:0;left:0;z-index:1030}@supports ((position:-webkit-sticky) or (position:sticky)){.sticky-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;overflow:visible;clip:auto;white-space:normal}.shadow-sm{box-shadow:0 .125rem .25rem rgba(0,0,0,.075)!important}.shadow{box-shadow:0 .5rem 1rem rgba(0,0,0,.15)!important}.shadow-lg{box-shadow:0 1rem 3rem rgba(0,0,0,.175)!important}.shadow-none{box-shadow:none!important}.w-25{width:25%!important}.w-50{width:50%!important}.w-75{width:75%!important}.w-100{width:100%!important}.w-auto{width:auto!important}.h-25{height:25%!important}.h-50{height:50%!important}.h-75{height:75%!important}.h-100{height:100%!important}.h-auto{height:auto!important}.mw-100{max-width:100%!important}.mh-100{max-height:100%!important}.min-vw-100{min-width:100vw!important}.min-vh-100{min-height:100vh!important}.vw-100{width:100vw!important}.vh-100{height:100vh!important}.m-0{margin:0!important}.mt-0,.my-0{margin-top:0!important}.mr-0,.mx-0{margin-right:0!important}.mb-0,.my-0{margin-bottom:0!important}.ml-0,.mx-0{margin-left:0!important}.m-1{margin:.25rem!important}.mt-1,.my-1{margin-top:.25rem!important}.mr-1,.mx-1{margin-right:.25rem!important}.mb-1,.my-1{margin-bottom:.25rem!important}.ml-1,.mx-1{margin-left:.25rem!important}.m-2{margin:.5rem!important}.mt-2,.my-2{margin-top:.5rem!important}.mr-2,.mx-2{margin-right:.5rem!important}.mb-2,.my-2{margin-bottom:.5rem!important}.ml-2,.mx-2{margin-left:.5rem!important}.m-3{margin:1rem!important}.mt-3,.my-3{margin-top:1rem!important}.mr-3,.mx-3{margin-right:1rem!important}.mb-3,.my-3{margin-bottom:1rem!important}.ml-3,.mx-3{margin-left:1rem!important}.m-4{margin:1.5rem!important}.mt-4,.my-4{margin-top:1.5rem!important}.mr-4,.mx-4{margin-right:1.5rem!important}.mb-4,.my-4{margin-bottom:1.5rem!important}.ml-4,.mx-4{margin-left:1.5rem!important}.m-5{margin:3rem!important}.mt-5,.my-5{margin-top:3rem!important}.mr-5,.mx-5{margin-right:3rem!important}.mb-5,.my-5{margin-bottom:3rem!important}.ml-5,.mx-5{margin-left:3rem!important}.p-0{padding:0!important}.pt-0,.py-0{padding-top:0!important}.pr-0,.px-0{padding-right:0!important}.pb-0,.py-0{padding-bottom:0!important}.pl-0,.px-0{padding-left:0!important}.p-1{padding:.25rem!important}.pt-1,.py-1{padding-top:.25rem!important}.pr-1,.px-1{padding-right:.25rem!important}.pb-1,.py-1{padding-bottom:.25rem!important}.pl-1,.px-1{padding-left:.25rem!important}.p-2{padding:.5rem!important}.pt-2,.py-2{padding-top:.5rem!important}.pr-2,.px-2{padding-right:.5rem!important}.pb-2,.py-2{padding-bottom:.5rem!important}.pl-2,.px-2{padding-left:.5rem!important}.p-3{padding:1rem!important}.pt-3,.py-3{padding-top:1rem!important}.pr-3,.px-3{padding-right:1rem!important}.pb-3,.py-3{padding-bottom:1rem!important}.pl-3,.px-3{padding-left:1rem!important}.p-4{padding:1.5rem!important}.pt-4,.py-4{padding-top:1.5rem!important}.pr-4,.px-4{padding-right:1.5rem!important}.pb-4,.py-4{padding-bottom:1.5rem!important}.pl-4,.px-4{padding-left:1.5rem!important}.p-5{padding:3rem!important}.pt-5,.py-5{padding-top:3rem!important}.pr-5,.px-5{padding-right:3rem!important}.pb-5,.py-5{padding-bottom:3rem!important}.pl-5,.px-5{padding-left:3rem!important}.m-n1{margin:-.25rem!important}.mt-n1,.my-n1{margin-top:-.25rem!important}.mr-n1,.mx-n1{margin-right:-.25rem!important}.mb-n1,.my-n1{margin-bottom:-.25rem!important}.ml-n1,.mx-n1{margin-left:-.25rem!important}.m-n2{margin:-.5rem!important}.mt-n2,.my-n2{margin-top:-.5rem!important}.mr-n2,.mx-n2{margin-right:-.5rem!important}.mb-n2,.my-n2{margin-bottom:-.5rem!important}.ml-n2,.mx-n2{margin-left:-.5rem!important}.m-n3{margin:-1rem!important}.mt-n3,.my-n3{margin-top:-1rem!important}.mr-n3,.mx-n3{margin-right:-1rem!important}.mb-n3,.my-n3{margin-bottom:-1rem!important}.ml-n3,.mx-n3{margin-left:-1rem!important}.m-n4{margin:-1.5rem!important}.mt-n4,.my-n4{margin-top:-1.5rem!important}.mr-n4,.mx-n4{margin-right:-1.5rem!important}.mb-n4,.my-n4{margin-bottom:-1.5rem!important}.ml-n4,.mx-n4{margin-left:-1.5rem!important}.m-n5{margin:-3rem!important}.mt-n5,.my-n5{margin-top:-3rem!important}.mr-n5,.mx-n5{margin-right:-3rem!important}.mb-n5,.my-n5{margin-bottom:-3rem!important}.ml-n5,.mx-n5{margin-left:-3rem!important}.m-auto{margin:auto!important}.mt-auto,.my-auto{margin-top:auto!important}.mr-auto,.mx-auto{margin-right:auto!important}.mb-auto,.my-auto{margin-bottom:auto!important}.ml-auto,.mx-auto{margin-left:auto!important}@media (min-width:576px){.m-sm-0{margin:0!important}.mt-sm-0,.my-sm-0{margin-top:0!important}.mr-sm-0,.mx-sm-0{margin-right:0!important}.mb-sm-0,.my-sm-0{margin-bottom:0!important}.ml-sm-0,.mx-sm-0{margin-left:0!important}.m-sm-1{margin:.25rem!important}.mt-sm-1,.my-sm-1{margin-top:.25rem!important}.mr-sm-1,.mx-sm-1{margin-right:.25rem!important}.mb-sm-1,.my-sm-1{margin-bottom:.25rem!important}.ml-sm-1,.mx-sm-1{margin-left:.25rem!important}.m-sm-2{margin:.5rem!important}.mt-sm-2,.my-sm-2{margin-top:.5rem!important}.mr-sm-2,.mx-sm-2{margin-right:.5rem!important}.mb-sm-2,.my-sm-2{margin-bottom:.5rem!important}.ml-sm-2,.mx-sm-2{margin-left:.5rem!important}.m-sm-3{margin:1rem!important}.mt-sm-3,.my-sm-3{margin-top:1rem!important}.mr-sm-3,.mx-sm-3{margin-right:1rem!important}.mb-sm-3,.my-sm-3{margin-bottom:1rem!important}.ml-sm-3,.mx-sm-3{margin-left:1rem!important}.m-sm-4{margin:1.5rem!important}.mt-sm-4,.my-sm-4{margin-top:1.5rem!important}.mr-sm-4,.mx-sm-4{margin-right:1.5rem!important}.mb-sm-4,.my-sm-4{margin-bottom:1.5rem!important}.ml-sm-4,.mx-sm-4{margin-left:1.5rem!important}.m-sm-5{margin:3rem!important}.mt-sm-5,.my-sm-5{margin-top:3rem!important}.mr-sm-5,.mx-sm-5{margin-right:3rem!important}.mb-sm-5,.my-sm-5{margin-bottom:3rem!important}.ml-sm-5,.mx-sm-5{margin-left:3rem!important}.p-sm-0{padding:0!important}.pt-sm-0,.py-sm-0{padding-top:0!important}.pr-sm-0,.px-sm-0{padding-right:0!important}.pb-sm-0,.py-sm-0{padding-bottom:0!important}.pl-sm-0,.px-sm-0{padding-left:0!important}.p-sm-1{padding:.25rem!important}.pt-sm-1,.py-sm-1{padding-top:.25rem!important}.pr-sm-1,.px-sm-1{padding-right:.25rem!important}.pb-sm-1,.py-sm-1{padding-bottom:.25rem!important}.pl-sm-1,.px-sm-1{padding-left:.25rem!important}.p-sm-2{padding:.5rem!important}.pt-sm-2,.py-sm-2{padding-top:.5rem!important}.pr-sm-2,.px-sm-2{padding-right:.5rem!important}.pb-sm-2,.py-sm-2{padding-bottom:.5rem!important}.pl-sm-2,.px-sm-2{padding-left:.5rem!important}.p-sm-3{padding:1rem!important}.pt-sm-3,.py-sm-3{padding-top:1rem!important}.pr-sm-3,.px-sm-3{padding-right:1rem!important}.pb-sm-3,.py-sm-3{padding-bottom:1rem!important}.pl-sm-3,.px-sm-3{padding-left:1rem!important}.p-sm-4{padding:1.5rem!important}.pt-sm-4,.py-sm-4{padding-top:1.5rem!important}.pr-sm-4,.px-sm-4{padding-right:1.5rem!important}.pb-sm-4,.py-sm-4{padding-bottom:1.5rem!important}.pl-sm-4,.px-sm-4{padding-left:1.5rem!important}.p-sm-5{padding:3rem!important}.pt-sm-5,.py-sm-5{padding-top:3rem!important}.pr-sm-5,.px-sm-5{padding-right:3rem!important}.pb-sm-5,.py-sm-5{padding-bottom:3rem!important}.pl-sm-5,.px-sm-5{padding-left:3rem!important}.m-sm-n1{margin:-.25rem!important}.mt-sm-n1,.my-sm-n1{margin-top:-.25rem!important}.mr-sm-n1,.mx-sm-n1{margin-right:-.25rem!important}.mb-sm-n1,.my-sm-n1{margin-bottom:-.25rem!important}.ml-sm-n1,.mx-sm-n1{margin-left:-.25rem!important}.m-sm-n2{margin:-.5rem!important}.mt-sm-n2,.my-sm-n2{margin-top:-.5rem!important}.mr-sm-n2,.mx-sm-n2{margin-right:-.5rem!important}.mb-sm-n2,.my-sm-n2{margin-bottom:-.5rem!important}.ml-sm-n2,.mx-sm-n2{margin-left:-.5rem!important}.m-sm-n3{margin:-1rem!important}.mt-sm-n3,.my-sm-n3{margin-top:-1rem!important}.mr-sm-n3,.mx-sm-n3{margin-right:-1rem!important}.mb-sm-n3,.my-sm-n3{margin-bottom:-1rem!important}.ml-sm-n3,.mx-sm-n3{margin-left:-1rem!important}.m-sm-n4{margin:-1.5rem!important}.mt-sm-n4,.my-sm-n4{margin-top:-1.5rem!important}.mr-sm-n4,.mx-sm-n4{margin-right:-1.5rem!important}.mb-sm-n4,.my-sm-n4{margin-bottom:-1.5rem!important}.ml-sm-n4,.mx-sm-n4{margin-left:-1.5rem!important}.m-sm-n5{margin:-3rem!important}.mt-sm-n5,.my-sm-n5{margin-top:-3rem!important}.mr-sm-n5,.mx-sm-n5{margin-right:-3rem!important}.mb-sm-n5,.my-sm-n5{margin-bottom:-3rem!important}.ml-sm-n5,.mx-sm-n5{margin-left:-3rem!important}.m-sm-auto{margin:auto!important}.mt-sm-auto,.my-sm-auto{margin-top:auto!important}.mr-sm-auto,.mx-sm-auto{margin-right:auto!important}.mb-sm-auto,.my-sm-auto{margin-bottom:auto!important}.ml-sm-auto,.mx-sm-auto{margin-left:auto!important}}@media (min-width:768px){.m-md-0{margin:0!important}.mt-md-0,.my-md-0{margin-top:0!important}.mr-md-0,.mx-md-0{margin-right:0!important}.mb-md-0,.my-md-0{margin-bottom:0!important}.ml-md-0,.mx-md-0{margin-left:0!important}.m-md-1{margin:.25rem!important}.mt-md-1,.my-md-1{margin-top:.25rem!important}.mr-md-1,.mx-md-1{margin-right:.25rem!important}.mb-md-1,.my-md-1{margin-bottom:.25rem!important}.ml-md-1,.mx-md-1{margin-left:.25rem!important}.m-md-2{margin:.5rem!important}.mt-md-2,.my-md-2{margin-top:.5rem!important}.mr-md-2,.mx-md-2{margin-right:.5rem!important}.mb-md-2,.my-md-2{margin-bottom:.5rem!important}.ml-md-2,.mx-md-2{margin-left:.5rem!important}.m-md-3{margin:1rem!important}.mt-md-3,.my-md-3{margin-top:1rem!important}.mr-md-3,.mx-md-3{margin-right:1rem!important}.mb-md-3,.my-md-3{margin-bottom:1rem!important}.ml-md-3,.mx-md-3{margin-left:1rem!important}.m-md-4{margin:1.5rem!important}.mt-md-4,.my-md-4{margin-top:1.5rem!important}.mr-md-4,.mx-md-4{margin-right:1.5rem!important}.mb-md-4,.my-md-4{margin-bottom:1.5rem!important}.ml-md-4,.mx-md-4{margin-left:1.5rem!important}.m-md-5{margin:3rem!important}.mt-md-5,.my-md-5{margin-top:3rem!important}.mr-md-5,.mx-md-5{margin-right:3rem!important}.mb-md-5,.my-md-5{margin-bottom:3rem!important}.ml-md-5,.mx-md-5{margin-left:3rem!important}.p-md-0{padding:0!important}.pt-md-0,.py-md-0{padding-top:0!important}.pr-md-0,.px-md-0{padding-right:0!important}.pb-md-0,.py-md-0{padding-bottom:0!important}.pl-md-0,.px-md-0{padding-left:0!important}.p-md-1{padding:.25rem!important}.pt-md-1,.py-md-1{padding-top:.25rem!important}.pr-md-1,.px-md-1{padding-right:.25rem!important}.pb-md-1,.py-md-1{padding-bottom:.25rem!important}.pl-md-1,.px-md-1{padding-left:.25rem!important}.p-md-2{padding:.5rem!important}.pt-md-2,.py-md-2{padding-top:.5rem!important}.pr-md-2,.px-md-2{padding-right:.5rem!important}.pb-md-2,.py-md-2{padding-bottom:.5rem!important}.pl-md-2,.px-md-2{padding-left:.5rem!important}.p-md-3{padding:1rem!important}.pt-md-3,.py-md-3{padding-top:1rem!important}.pr-md-3,.px-md-3{padding-right:1rem!important}.pb-md-3,.py-md-3{padding-bottom:1rem!important}.pl-md-3,.px-md-3{padding-left:1rem!important}.p-md-4{padding:1.5rem!important}.pt-md-4,.py-md-4{padding-top:1.5rem!important}.pr-md-4,.px-md-4{padding-right:1.5rem!important}.pb-md-4,.py-md-4{padding-bottom:1.5rem!important}.pl-md-4,.px-md-4{padding-left:1.5rem!important}.p-md-5{padding:3rem!important}.pt-md-5,.py-md-5{padding-top:3rem!important}.pr-md-5,.px-md-5{padding-right:3rem!important}.pb-md-5,.py-md-5{padding-bottom:3rem!important}.pl-md-5,.px-md-5{padding-left:3rem!important}.m-md-n1{margin:-.25rem!important}.mt-md-n1,.my-md-n1{margin-top:-.25rem!important}.mr-md-n1,.mx-md-n1{margin-right:-.25rem!important}.mb-md-n1,.my-md-n1{margin-bottom:-.25rem!important}.ml-md-n1,.mx-md-n1{margin-left:-.25rem!important}.m-md-n2{margin:-.5rem!important}.mt-md-n2,.my-md-n2{margin-top:-.5rem!important}.mr-md-n2,.mx-md-n2{margin-right:-.5rem!important}.mb-md-n2,.my-md-n2{margin-bottom:-.5rem!important}.ml-md-n2,.mx-md-n2{margin-left:-.5rem!important}.m-md-n3{margin:-1rem!important}.mt-md-n3,.my-md-n3{margin-top:-1rem!important}.mr-md-n3,.mx-md-n3{margin-right:-1rem!important}.mb-md-n3,.my-md-n3{margin-bottom:-1rem!important}.ml-md-n3,.mx-md-n3{margin-left:-1rem!important}.m-md-n4{margin:-1.5rem!important}.mt-md-n4,.my-md-n4{margin-top:-1.5rem!important}.mr-md-n4,.mx-md-n4{margin-right:-1.5rem!important}.mb-md-n4,.my-md-n4{margin-bottom:-1.5rem!important}.ml-md-n4,.mx-md-n4{margin-left:-1.5rem!important}.m-md-n5{margin:-3rem!important}.mt-md-n5,.my-md-n5{margin-top:-3rem!important}.mr-md-n5,.mx-md-n5{margin-right:-3rem!important}.mb-md-n5,.my-md-n5{margin-bottom:-3rem!important}.ml-md-n5,.mx-md-n5{margin-left:-3rem!important}.m-md-auto{margin:auto!important}.mt-md-auto,.my-md-auto{margin-top:auto!important}.mr-md-auto,.mx-md-auto{margin-right:auto!important}.mb-md-auto,.my-md-auto{margin-bottom:auto!important}.ml-md-auto,.mx-md-auto{margin-left:auto!important}}@media (min-width:992px){.m-lg-0{margin:0!important}.mt-lg-0,.my-lg-0{margin-top:0!important}.mr-lg-0,.mx-lg-0{margin-right:0!important}.mb-lg-0,.my-lg-0{margin-bottom:0!important}.ml-lg-0,.mx-lg-0{margin-left:0!important}.m-lg-1{margin:.25rem!important}.mt-lg-1,.my-lg-1{margin-top:.25rem!important}.mr-lg-1,.mx-lg-1{margin-right:.25rem!important}.mb-lg-1,.my-lg-1{margin-bottom:.25rem!important}.ml-lg-1,.mx-lg-1{margin-left:.25rem!important}.m-lg-2{margin:.5rem!important}.mt-lg-2,.my-lg-2{margin-top:.5rem!important}.mr-lg-2,.mx-lg-2{margin-right:.5rem!important}.mb-lg-2,.my-lg-2{margin-bottom:.5rem!important}.ml-lg-2,.mx-lg-2{margin-left:.5rem!important}.m-lg-3{margin:1rem!important}.mt-lg-3,.my-lg-3{margin-top:1rem!important}.mr-lg-3,.mx-lg-3{margin-right:1rem!important}.mb-lg-3,.my-lg-3{margin-bottom:1rem!important}.ml-lg-3,.mx-lg-3{margin-left:1rem!important}.m-lg-4{margin:1.5rem!important}.mt-lg-4,.my-lg-4{margin-top:1.5rem!important}.mr-lg-4,.mx-lg-4{margin-right:1.5rem!important}.mb-lg-4,.my-lg-4{margin-bottom:1.5rem!important}.ml-lg-4,.mx-lg-4{margin-left:1.5rem!important}.m-lg-5{margin:3rem!important}.mt-lg-5,.my-lg-5{margin-top:3rem!important}.mr-lg-5,.mx-lg-5{margin-right:3rem!important}.mb-lg-5,.my-lg-5{margin-bottom:3rem!important}.ml-lg-5,.mx-lg-5{margin-left:3rem!important}.p-lg-0{padding:0!important}.pt-lg-0,.py-lg-0{padding-top:0!important}.pr-lg-0,.px-lg-0{padding-right:0!important}.pb-lg-0,.py-lg-0{padding-bottom:0!important}.pl-lg-0,.px-lg-0{padding-left:0!important}.p-lg-1{padding:.25rem!important}.pt-lg-1,.py-lg-1{padding-top:.25rem!important}.pr-lg-1,.px-lg-1{padding-right:.25rem!important}.pb-lg-1,.py-lg-1{padding-bottom:.25rem!important}.pl-lg-1,.px-lg-1{padding-left:.25rem!important}.p-lg-2{padding:.5rem!important}.pt-lg-2,.py-lg-2{padding-top:.5rem!important}.pr-lg-2,.px-lg-2{padding-right:.5rem!important}.pb-lg-2,.py-lg-2{padding-bottom:.5rem!important}.pl-lg-2,.px-lg-2{padding-left:.5rem!important}.p-lg-3{padding:1rem!important}.pt-lg-3,.py-lg-3{padding-top:1rem!important}.pr-lg-3,.px-lg-3{padding-right:1rem!important}.pb-lg-3,.py-lg-3{padding-bottom:1rem!important}.pl-lg-3,.px-lg-3{padding-left:1rem!important}.p-lg-4{padding:1.5rem!important}.pt-lg-4,.py-lg-4{padding-top:1.5rem!important}.pr-lg-4,.px-lg-4{padding-right:1.5rem!important}.pb-lg-4,.py-lg-4{padding-bottom:1.5rem!important}.pl-lg-4,.px-lg-4{padding-left:1.5rem!important}.p-lg-5{padding:3rem!important}.pt-lg-5,.py-lg-5{padding-top:3rem!important}.pr-lg-5,.px-lg-5{padding-right:3rem!important}.pb-lg-5,.py-lg-5{padding-bottom:3rem!important}.pl-lg-5,.px-lg-5{padding-left:3rem!important}.m-lg-n1{margin:-.25rem!important}.mt-lg-n1,.my-lg-n1{margin-top:-.25rem!important}.mr-lg-n1,.mx-lg-n1{margin-right:-.25rem!important}.mb-lg-n1,.my-lg-n1{margin-bottom:-.25rem!important}.ml-lg-n1,.mx-lg-n1{margin-left:-.25rem!important}.m-lg-n2{margin:-.5rem!important}.mt-lg-n2,.my-lg-n2{margin-top:-.5rem!important}.mr-lg-n2,.mx-lg-n2{margin-right:-.5rem!important}.mb-lg-n2,.my-lg-n2{margin-bottom:-.5rem!important}.ml-lg-n2,.mx-lg-n2{margin-left:-.5rem!important}.m-lg-n3{margin:-1rem!important}.mt-lg-n3,.my-lg-n3{margin-top:-1rem!important}.mr-lg-n3,.mx-lg-n3{margin-right:-1rem!important}.mb-lg-n3,.my-lg-n3{margin-bottom:-1rem!important}.ml-lg-n3,.mx-lg-n3{margin-left:-1rem!important}.m-lg-n4{margin:-1.5rem!important}.mt-lg-n4,.my-lg-n4{margin-top:-1.5rem!important}.mr-lg-n4,.mx-lg-n4{margin-right:-1.5rem!important}.mb-lg-n4,.my-lg-n4{margin-bottom:-1.5rem!important}.ml-lg-n4,.mx-lg-n4{margin-left:-1.5rem!important}.m-lg-n5{margin:-3rem!important}.mt-lg-n5,.my-lg-n5{margin-top:-3rem!important}.mr-lg-n5,.mx-lg-n5{margin-right:-3rem!important}.mb-lg-n5,.my-lg-n5{margin-bottom:-3rem!important}.ml-lg-n5,.mx-lg-n5{margin-left:-3rem!important}.m-lg-auto{margin:auto!important}.mt-lg-auto,.my-lg-auto{margin-top:auto!important}.mr-lg-auto,.mx-lg-auto{margin-right:auto!important}.mb-lg-auto,.my-lg-auto{margin-bottom:auto!important}.ml-lg-auto,.mx-lg-auto{margin-left:auto!important}}@media (min-width:1200px){.m-xl-0{margin:0!important}.mt-xl-0,.my-xl-0{margin-top:0!important}.mr-xl-0,.mx-xl-0{margin-right:0!important}.mb-xl-0,.my-xl-0{margin-bottom:0!important}.ml-xl-0,.mx-xl-0{margin-left:0!important}.m-xl-1{margin:.25rem!important}.mt-xl-1,.my-xl-1{margin-top:.25rem!important}.mr-xl-1,.mx-xl-1{margin-right:.25rem!important}.mb-xl-1,.my-xl-1{margin-bottom:.25rem!important}.ml-xl-1,.mx-xl-1{margin-left:.25rem!important}.m-xl-2{margin:.5rem!important}.mt-xl-2,.my-xl-2{margin-top:.5rem!important}.mr-xl-2,.mx-xl-2{margin-right:.5rem!important}.mb-xl-2,.my-xl-2{margin-bottom:.5rem!important}.ml-xl-2,.mx-xl-2{margin-left:.5rem!important}.m-xl-3{margin:1rem!important}.mt-xl-3,.my-xl-3{margin-top:1rem!important}.mr-xl-3,.mx-xl-3{margin-right:1rem!important}.mb-xl-3,.my-xl-3{margin-bottom:1rem!important}.ml-xl-3,.mx-xl-3{margin-left:1rem!important}.m-xl-4{margin:1.5rem!important}.mt-xl-4,.my-xl-4{margin-top:1.5rem!important}.mr-xl-4,.mx-xl-4{margin-right:1.5rem!important}.mb-xl-4,.my-xl-4{margin-bottom:1.5rem!important}.ml-xl-4,.mx-xl-4{margin-left:1.5rem!important}.m-xl-5{margin:3rem!important}.mt-xl-5,.my-xl-5{margin-top:3rem!important}.mr-xl-5,.mx-xl-5{margin-right:3rem!important}.mb-xl-5,.my-xl-5{margin-bottom:3rem!important}.ml-xl-5,.mx-xl-5{margin-left:3rem!important}.p-xl-0{padding:0!important}.pt-xl-0,.py-xl-0{padding-top:0!important}.pr-xl-0,.px-xl-0{padding-right:0!important}.pb-xl-0,.py-xl-0{padding-bottom:0!important}.pl-xl-0,.px-xl-0{padding-left:0!important}.p-xl-1{padding:.25rem!important}.pt-xl-1,.py-xl-1{padding-top:.25rem!important}.pr-xl-1,.px-xl-1{padding-right:.25rem!important}.pb-xl-1,.py-xl-1{padding-bottom:.25rem!important}.pl-xl-1,.px-xl-1{padding-left:.25rem!important}.p-xl-2{padding:.5rem!important}.pt-xl-2,.py-xl-2{padding-top:.5rem!important}.pr-xl-2,.px-xl-2{padding-right:.5rem!important}.pb-xl-2,.py-xl-2{padding-bottom:.5rem!important}.pl-xl-2,.px-xl-2{padding-left:.5rem!important}.p-xl-3{padding:1rem!important}.pt-xl-3,.py-xl-3{padding-top:1rem!important}.pr-xl-3,.px-xl-3{padding-right:1rem!important}.pb-xl-3,.py-xl-3{padding-bottom:1rem!important}.pl-xl-3,.px-xl-3{padding-left:1rem!important}.p-xl-4{padding:1.5rem!important}.pt-xl-4,.py-xl-4{padding-top:1.5rem!important}.pr-xl-4,.px-xl-4{padding-right:1.5rem!important}.pb-xl-4,.py-xl-4{padding-bottom:1.5rem!important}.pl-xl-4,.px-xl-4{padding-left:1.5rem!important}.p-xl-5{padding:3rem!important}.pt-xl-5,.py-xl-5{padding-top:3rem!important}.pr-xl-5,.px-xl-5{padding-right:3rem!important}.pb-xl-5,.py-xl-5{padding-bottom:3rem!important}.pl-xl-5,.px-xl-5{padding-left:3rem!important}.m-xl-n1{margin:-.25rem!important}.mt-xl-n1,.my-xl-n1{margin-top:-.25rem!important}.mr-xl-n1,.mx-xl-n1{margin-right:-.25rem!important}.mb-xl-n1,.my-xl-n1{margin-bottom:-.25rem!important}.ml-xl-n1,.mx-xl-n1{margin-left:-.25rem!important}.m-xl-n2{margin:-.5rem!important}.mt-xl-n2,.my-xl-n2{margin-top:-.5rem!important}.mr-xl-n2,.mx-xl-n2{margin-right:-.5rem!important}.mb-xl-n2,.my-xl-n2{margin-bottom:-.5rem!important}.ml-xl-n2,.mx-xl-n2{margin-left:-.5rem!important}.m-xl-n3{margin:-1rem!important}.mt-xl-n3,.my-xl-n3{margin-top:-1rem!important}.mr-xl-n3,.mx-xl-n3{margin-right:-1rem!important}.mb-xl-n3,.my-xl-n3{margin-bottom:-1rem!important}.ml-xl-n3,.mx-xl-n3{margin-left:-1rem!important}.m-xl-n4{margin:-1.5rem!important}.mt-xl-n4,.my-xl-n4{margin-top:-1.5rem!important}.mr-xl-n4,.mx-xl-n4{margin-right:-1.5rem!important}.mb-xl-n4,.my-xl-n4{margin-bottom:-1.5rem!important}.ml-xl-n4,.mx-xl-n4{margin-left:-1.5rem!important}.m-xl-n5{margin:-3rem!important}.mt-xl-n5,.my-xl-n5{margin-top:-3rem!important}.mr-xl-n5,.mx-xl-n5{margin-right:-3rem!important}.mb-xl-n5,.my-xl-n5{margin-bottom:-3rem!important}.ml-xl-n5,.mx-xl-n5{margin-left:-3rem!important}.m-xl-auto{margin:auto!important}.mt-xl-auto,.my-xl-auto{margin-top:auto!important}.mr-xl-auto,.mx-xl-auto{margin-right:auto!important}.mb-xl-auto,.my-xl-auto{margin-bottom:auto!important}.ml-xl-auto,.mx-xl-auto{margin-left:auto!important}}.stretched-link::after{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;pointer-events:auto;content:"";background-color:rgba(0,0,0,0)}.text-monospace{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace!important}.text-justify{text-align:justify!important}.text-wrap{white-space:normal!important}.text-nowrap{white-space:nowrap!important}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-left{text-align:left!important}.text-right{text-align:right!important}.text-center{text-align:center!important}@media (min-width:576px){.text-sm-left{text-align:left!important}.text-sm-right{text-align:right!important}.text-sm-center{text-align:center!important}}@media (min-width:768px){.text-md-left{text-align:left!important}.text-md-right{text-align:right!important}.text-md-center{text-align:center!important}}@media (min-width:992px){.text-lg-left{text-align:left!important}.text-lg-right{text-align:right!important}.text-lg-center{text-align:center!important}}@media (min-width:1200px){.text-xl-left{text-align:left!important}.text-xl-right{text-align:right!important}.text-xl-center{text-align:center!important}}.text-lowercase{text-transform:lowercase!important}.text-uppercase{text-transform:uppercase!important}.text-capitalize{text-transform:capitalize!important}.font-weight-light{font-weight:300!important}.font-weight-lighter{font-weight:lighter!important}.font-weight-normal{font-weight:400!important}.font-weight-bold{font-weight:700!important}.font-weight-bolder{font-weight:bolder!important}.font-italic{font-style:italic!important}.text-white{color:#fff!important}.text-primary{color:#007bff!important}a.text-primary:focus,a.text-primary:hover{color:#0056b3!important}.text-secondary{color:#6c757d!important}a.text-secondary:focus,a.text-secondary:hover{color:#494f54!important}.text-success{color:#28a745!important}a.text-success:focus,a.text-success:hover{color:#19692c!important}.text-info{color:#17a2b8!important}a.text-info:focus,a.text-info:hover{color:#0f6674!important}.text-warning{color:#ffc107!important}a.text-warning:focus,a.text-warning:hover{color:#ba8b00!important}.text-danger{color:#dc3545!important}a.text-danger:focus,a.text-danger:hover{color:#a71d2a!important}.text-light{color:#f8f9fa!important}a.text-light:focus,a.text-light:hover{color:#cbd3da!important}.text-dark{color:#343a40!important}a.text-dark:focus,a.text-dark:hover{color:#121416!important}.text-body{color:#212529!important}.text-muted{color:#6c757d!important}.text-black-50{color:rgba(0,0,0,.5)!important}.text-white-50{color:rgba(255,255,255,.5)!important}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.text-decoration-none{text-decoration:none!important}.text-break{word-break:break-word!important;word-wrap:break-word!important}.text-reset{color:inherit!important}.visible{visibility:visible!important}.invisible{visibility:hidden!important}@media print{*,::after,::before{text-shadow:none!important;box-shadow:none!important}a:not(.btn){text-decoration:underline}abbr[title]::after{content:" (" attr(title) ")"}pre{white-space:pre-wrap!important}blockquote,pre{border:1px solid #adb5bd;page-break-inside:avoid}img,tr{page-break-inside:avoid}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}@page{size:a3}body{min-width:992px!important}.container{min-width:992px!important}.navbar{display:none}.badge{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #dee2e6!important}.table-dark{color:inherit}.table-dark tbody+tbody,.table-dark td,.table-dark th,.table-dark thead th{border-color:#dee2e6}.table .thead-dark th{color:inherit;border-color:#dee2e6}} -/*# sourceMappingURL=bootstrap.min.css.map */ \ No newline at end of file diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/custom.css b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/custom.css deleted file mode 100644 index e69de29b..00000000 diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/nv.d3.min.css b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/nv.d3.min.css deleted file mode 100644 index 7a6f7fe9..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/nv.d3.min.css +++ /dev/null @@ -1 +0,0 @@ -.nvd3 .nv-axis{pointer-events:none;opacity:1}.nvd3 .nv-axis path{fill:none;stroke:#000;stroke-opacity:.75;shape-rendering:crispEdges}.nvd3 .nv-axis path.domain{stroke-opacity:.75}.nvd3 .nv-axis.nv-x path.domain{stroke-opacity:0}.nvd3 .nv-axis line{fill:none;stroke:#e5e5e5;shape-rendering:crispEdges}.nvd3 .nv-axis .zero line,.nvd3 .nv-axis line.zero{stroke-opacity:.75}.nvd3 .nv-axis .nv-axisMaxMin text{font-weight:700}.nvd3 .x .nv-axis .nv-axisMaxMin text,.nvd3 .x2 .nv-axis .nv-axisMaxMin text,.nvd3 .x3 .nv-axis .nv-axisMaxMin text{text-anchor:middle}.nvd3 .nv-axis.nv-disabled{opacity:0}.nvd3 .nv-bars rect{fill-opacity:.75;transition:fill-opacity 250ms linear;-moz-transition:fill-opacity 250ms linear;-webkit-transition:fill-opacity 250ms linear}.nvd3 .nv-bars rect.hover{fill-opacity:1}.nvd3 .nv-bars .hover rect{fill:#add8e6}.nvd3 .nv-bars text{fill:rgba(0,0,0,0)}.nvd3 .nv-bars .hover text{fill:rgba(0,0,0,1)}.nvd3 .nv-multibar .nv-groups rect,.nvd3 .nv-multibarHorizontal .nv-groups rect,.nvd3 .nv-discretebar .nv-groups rect{stroke-opacity:0;transition:fill-opacity 250ms linear;-moz-transition:fill-opacity 250ms linear;-webkit-transition:fill-opacity 250ms linear}.nvd3 .nv-multibar .nv-groups rect:hover,.nvd3 .nv-multibarHorizontal .nv-groups rect:hover,.nvd3 .nv-candlestickBar .nv-ticks rect:hover,.nvd3 .nv-discretebar .nv-groups rect:hover{fill-opacity:1}.nvd3 .nv-discretebar .nv-groups text,.nvd3 .nv-multibarHorizontal .nv-groups text{font-weight:700;fill:rgba(0,0,0,1);stroke:rgba(0,0,0,0)}.nvd3 .nv-boxplot circle{fill-opacity:.5}.nvd3 .nv-boxplot circle:hover{fill-opacity:1}.nvd3 .nv-boxplot rect:hover{fill-opacity:1}.nvd3 line.nv-boxplot-median{stroke:#000}.nv-boxplot-tick:hover{stroke-width:2.5px}.nvd3.nv-bullet{font:10px sans-serif}.nvd3.nv-bullet .nv-measure{fill-opacity:.8}.nvd3.nv-bullet .nv-measure:hover{fill-opacity:1}.nvd3.nv-bullet .nv-marker{stroke:#000;stroke-width:2px}.nvd3.nv-bullet .nv-markerTriangle{stroke:#000;fill:#fff;stroke-width:1.5px}.nvd3.nv-bullet .nv-tick line{stroke:#666;stroke-width:.5px}.nvd3.nv-bullet .nv-range.nv-s0{fill:#eee}.nvd3.nv-bullet .nv-range.nv-s1{fill:#ddd}.nvd3.nv-bullet .nv-range.nv-s2{fill:#ccc}.nvd3.nv-bullet .nv-title{font-size:14px;font-weight:700}.nvd3.nv-bullet .nv-subtitle{fill:#999}.nvd3.nv-bullet .nv-range{fill:#bababa;fill-opacity:.4}.nvd3.nv-bullet .nv-range:hover{fill-opacity:.7}.nvd3.nv-candlestickBar .nv-ticks .nv-tick{stroke-width:1px}.nvd3.nv-candlestickBar .nv-ticks .nv-tick.hover{stroke-width:2px}.nvd3.nv-candlestickBar .nv-ticks .nv-tick.positive rect{stroke:#2ca02c;fill:#2ca02c}.nvd3.nv-candlestickBar .nv-ticks .nv-tick.negative rect{stroke:#d62728;fill:#d62728}.with-transitions .nv-candlestickBar .nv-ticks .nv-tick{transition:stroke-width 250ms linear,stroke-opacity 250ms linear;-moz-transition:stroke-width 250ms linear,stroke-opacity 250ms linear;-webkit-transition:stroke-width 250ms linear,stroke-opacity 250ms linear}.nvd3.nv-candlestickBar .nv-ticks line{stroke:#333}.nvd3 .nv-legend .nv-disabled rect{}.nvd3 .nv-check-box .nv-box{fill-opacity:0;stroke-width:2}.nvd3 .nv-check-box .nv-check{fill-opacity:0;stroke-width:4}.nvd3 .nv-series.nv-disabled .nv-check-box .nv-check{fill-opacity:0;stroke-opacity:0}.nvd3 .nv-controlsWrap .nv-legend .nv-check-box .nv-check{opacity:0}.nvd3.nv-linePlusBar .nv-bar rect{fill-opacity:.75}.nvd3.nv-linePlusBar .nv-bar rect:hover{fill-opacity:1}.nvd3 .nv-groups path.nv-line{fill:none}.nvd3 .nv-groups path.nv-area{stroke:none}.nvd3.nv-line .nvd3.nv-scatter .nv-groups .nv-point{fill-opacity:0;stroke-opacity:0}.nvd3.nv-scatter.nv-single-point .nv-groups .nv-point{fill-opacity:.5!important;stroke-opacity:.5!important}.with-transitions .nvd3 .nv-groups .nv-point{transition:stroke-width 250ms linear,stroke-opacity 250ms linear;-moz-transition:stroke-width 250ms linear,stroke-opacity 250ms linear;-webkit-transition:stroke-width 250ms linear,stroke-opacity 250ms linear}.nvd3.nv-scatter .nv-groups .nv-point.hover,.nvd3 .nv-groups .nv-point.hover{stroke-width:7px;fill-opacity:.95!important;stroke-opacity:.95!important}.nvd3 .nv-point-paths path{stroke:#aaa;stroke-opacity:0;fill:#eee;fill-opacity:0}.nvd3 .nv-indexLine{cursor:ew-resize}svg.nvd3-svg{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-ms-user-select:none;-moz-user-select:none;user-select:none;display:block;width:100%;height:100%}.nvtooltip.with-3d-shadow,.with-3d-shadow .nvtooltip{-moz-box-shadow:0 5px 10px rgba(0,0,0,.2);-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.nvd3 text{font:400 12px Arial}.nvd3 .title{font:700 14px Arial}.nvd3 .nv-background{fill:#fff;fill-opacity:0}.nvd3.nv-noData{font-size:18px;font-weight:700}.nv-brush .extent{fill-opacity:.125;shape-rendering:crispEdges}.nv-brush .resize path{fill:#eee;stroke:#666}.nvd3 .nv-legend .nv-series{cursor:pointer}.nvd3 .nv-legend .nv-disabled circle{fill-opacity:0}.nvd3 .nv-brush .extent{fill-opacity:0!important}.nvd3 .nv-brushBackground rect{stroke:#000;stroke-width:.4;fill:#fff;fill-opacity:.7}.nvd3.nv-ohlcBar .nv-ticks .nv-tick{stroke-width:1px}.nvd3.nv-ohlcBar .nv-ticks .nv-tick.hover{stroke-width:2px}.nvd3.nv-ohlcBar .nv-ticks .nv-tick.positive{stroke:#2ca02c}.nvd3.nv-ohlcBar .nv-ticks .nv-tick.negative{stroke:#d62728}.nvd3 .background path{fill:none;stroke:#EEE;stroke-opacity:.4;shape-rendering:crispEdges}.nvd3 .foreground path{fill:none;stroke-opacity:.7}.nvd3 .nv-parallelCoordinates-brush .extent{fill:#fff;fill-opacity:.6;stroke:gray;shape-rendering:crispEdges}.nvd3 .nv-parallelCoordinates .hover{fill-opacity:1;stroke-width:3px}.nvd3 .missingValuesline line{fill:none;stroke:#000;stroke-width:1;stroke-opacity:1;stroke-dasharray:5,5}.nvd3.nv-pie path{stroke-opacity:0;transition:fill-opacity 250ms linear,stroke-width 250ms linear,stroke-opacity 250ms linear;-moz-transition:fill-opacity 250ms linear,stroke-width 250ms linear,stroke-opacity 250ms linear;-webkit-transition:fill-opacity 250ms linear,stroke-width 250ms linear,stroke-opacity 250ms linear}.nvd3.nv-pie .nv-pie-title{font-size:24px;fill:rgba(19,196,249,.59)}.nvd3.nv-pie .nv-slice text{stroke:#000;stroke-width:0}.nvd3.nv-pie path{stroke:#fff;stroke-width:1px;stroke-opacity:1}.nvd3.nv-pie .hover path{fill-opacity:.7}.nvd3.nv-pie .nv-label{pointer-events:none}.nvd3.nv-pie .nv-label rect{fill-opacity:0;stroke-opacity:0}.nvd3 .nv-groups .nv-point.hover{stroke-width:20px;stroke-opacity:.5}.nvd3 .nv-scatter .nv-point.hover{fill-opacity:1}.nv-noninteractive{pointer-events:none}.nv-distx,.nv-disty{pointer-events:none}.nvd3.nv-sparkline path{fill:none}.nvd3.nv-sparklineplus g.nv-hoverValue{pointer-events:none}.nvd3.nv-sparklineplus .nv-hoverValue line{stroke:#333;stroke-width:1.5px}.nvd3.nv-sparklineplus,.nvd3.nv-sparklineplus g{pointer-events:all}.nvd3 .nv-hoverArea{fill-opacity:0;stroke-opacity:0}.nvd3.nv-sparklineplus .nv-xValue,.nvd3.nv-sparklineplus .nv-yValue{stroke-width:0;font-size:.9em;font-weight:400}.nvd3.nv-sparklineplus .nv-yValue{stroke:#f66}.nvd3.nv-sparklineplus .nv-maxValue{stroke:#2ca02c;fill:#2ca02c}.nvd3.nv-sparklineplus .nv-minValue{stroke:#d62728;fill:#d62728}.nvd3.nv-sparklineplus .nv-currentValue{font-weight:700;font-size:1.1em}.nvd3.nv-stackedarea path.nv-area{fill-opacity:.7;stroke-opacity:0;transition:fill-opacity 250ms linear,stroke-opacity 250ms linear;-moz-transition:fill-opacity 250ms linear,stroke-opacity 250ms linear;-webkit-transition:fill-opacity 250ms linear,stroke-opacity 250ms linear}.nvd3.nv-stackedarea path.nv-area.hover{fill-opacity:.9}.nvd3.nv-stackedarea .nv-groups .nv-point{stroke-opacity:0;fill-opacity:0}.nvtooltip{position:absolute;background-color:rgba(255,255,255,1);color:rgba(0,0,0,1);padding:1px;border:1px solid rgba(0,0,0,.2);z-index:10000;display:block;font-family:Arial;font-size:13px;text-align:left;pointer-events:none;white-space:nowrap;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.nvtooltip{background:rgba(255,255,255,.8);border:1px solid rgba(0,0,0,.5);border-radius:4px}.nvtooltip.with-transitions,.with-transitions .nvtooltip{transition:opacity 50ms linear;-moz-transition:opacity 50ms linear;-webkit-transition:opacity 50ms linear;transition-delay:200ms;-moz-transition-delay:200ms;-webkit-transition-delay:200ms}.nvtooltip.x-nvtooltip,.nvtooltip.y-nvtooltip{padding:8px}.nvtooltip h3{margin:0;padding:4px 14px;line-height:18px;font-weight:400;background-color:rgba(247,247,247,.75);color:rgba(0,0,0,1);text-align:center;border-bottom:1px solid #ebebeb;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.nvtooltip p{margin:0;padding:5px 14px;text-align:center}.nvtooltip span{display:inline-block;margin:2px 0}.nvtooltip table{margin:6px;border-spacing:0}.nvtooltip table td{padding:2px 9px 2px 0;vertical-align:middle}.nvtooltip table td.key{font-weight:400}.nvtooltip table td.value{text-align:right;font-weight:700}.nvtooltip table tr.highlight td{padding:1px 9px 1px 0;border-bottom-style:solid;border-bottom-width:1px;border-top-style:solid;border-top-width:1px}.nvtooltip table td.legend-color-guide div{width:8px;height:8px;vertical-align:middle}.nvtooltip table td.legend-color-guide div{width:12px;height:12px;border:1px solid #999}.nvtooltip .footer{padding:3px;text-align:center}.nvtooltip-pending-removal{pointer-events:none;display:none}.nvd3 .nv-interactiveGuideLine{pointer-events:none}.nvd3 line.nv-guideline{stroke:#ccc} \ No newline at end of file diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/octicons.css b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/octicons.css deleted file mode 100644 index 31d97867..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/octicons.css +++ /dev/null @@ -1,5 +0,0 @@ -.octicon { - display: inline-block; - vertical-align: text-top; - fill: currentColor; -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/style.css b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/style.css deleted file mode 100644 index 5dc62ccf..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/style.css +++ /dev/null @@ -1,130 +0,0 @@ -body { - font-family: sans-serif; - font-size: 1em; - font-kerning: normal; - font-variant-ligatures: common-ligatures; - text-rendering: optimizeLegibility; - padding-top: 10px; -} - -.popover { - max-width: none; -} - -.octicon { - margin-right:.25em; - vertical-align: baseline; - width: 0.75em; -} - -.table-bordered>thead>tr>td { - border-bottom-width: 1px; -} - -.table tbody>tr>td, .table thead>tr>td { - padding-top: 3px; - padding-bottom: 3px; -} - -.table-condensed tbody>tr>td { - padding-top: 0; - padding-bottom: 0; -} - -.table .progress { - margin-bottom: inherit; -} - -.table-borderless th, .table-borderless td { - border: 0 !important; -} - -.table tbody tr.covered-by-large-tests, li.covered-by-large-tests, tr.success, td.success, li.success, span.success { - background-color: #dff0d8; -} - -.table tbody tr.covered-by-medium-tests, li.covered-by-medium-tests { - background-color: #c3e3b5; -} - -.table tbody tr.covered-by-small-tests, li.covered-by-small-tests { - background-color: #99cb84; -} - -.table tbody tr.danger, .table tbody td.danger, li.danger, span.danger { - background-color: #f2dede; -} - -.table tbody tr.warning, .table tbody td.warning, li.warning, span.warning { - background-color: #fcf8e3; -} - -.table tbody td.info { - background-color: #d9edf7; -} - -td.big { - vertical-align: middle; - width: 117px; -} - -td.small { -} - -td.codeLine { - font-family: "Source Code Pro", "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; - white-space: pre-wrap; -} - -td span.comment { - color: #888a85; -} - -td span.default { - color: #2e3436; -} - -td span.html { - color: #888a85; -} - -td span.keyword { - color: #2e3436; - font-weight: bold; -} - -pre span.string { - color: #2e3436; -} - -span.success, span.warning, span.danger { - margin-right: 2px; - padding-left: 10px; - padding-right: 10px; - text-align: center; -} - -#toplink { - position: fixed; - left: 5px; - bottom: 5px; - outline: 0; -} - -svg text { - font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif; - font-size: 11px; - color: #666; - fill: #666; -} - -.scrollbox { - height:245px; - overflow-x:hidden; - overflow-y:scroll; -} - -table + .structure-heading { - border-top: 1px solid lightgrey; - padding-top: 0.5em; -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/dashboard.html.dist b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/dashboard.html.dist deleted file mode 100644 index aa51bcb8..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/dashboard.html.dist +++ /dev/null @@ -1,281 +0,0 @@ - - - - - Dashboard for {{full_path}} - - - - - - - -
      -
      -
      -
      - -
      -
      -
      -
      -
      -
      -
      -

      Classes

      -
      -
      -
      -
      -

      Coverage Distribution

      -
      - -
      -
      -
      -

      Complexity

      -
      - -
      -
      -
      -
      -
      -

      Insufficient Coverage

      -
      - - - - - - - - -{{insufficient_coverage_classes}} - -
      ClassCoverage
      -
      -
      -
      -

      Project Risks

      -
      - - - - - - - - -{{project_risks_classes}} - -
      ClassCRAP
      -
      -
      -
      -
      -
      -

      Methods

      -
      -
      -
      -
      -

      Coverage Distribution

      -
      - -
      -
      -
      -

      Complexity

      -
      - -
      -
      -
      -
      -
      -

      Insufficient Coverage

      -
      - - - - - - - - -{{insufficient_coverage_methods}} - -
      MethodCoverage
      -
      -
      -
      -

      Project Risks

      -
      - - - - - - - - -{{project_risks_methods}} - -
      MethodCRAP
      -
      -
      -
      - -
      - - - - - - diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/dashboard_branch.html.dist b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/dashboard_branch.html.dist deleted file mode 100644 index aa51bcb8..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/dashboard_branch.html.dist +++ /dev/null @@ -1,281 +0,0 @@ - - - - - Dashboard for {{full_path}} - - - - - - - -
      -
      -
      -
      - -
      -
      -
      -
      -
      -
      -
      -

      Classes

      -
      -
      -
      -
      -

      Coverage Distribution

      -
      - -
      -
      -
      -

      Complexity

      -
      - -
      -
      -
      -
      -
      -

      Insufficient Coverage

      -
      - - - - - - - - -{{insufficient_coverage_classes}} - -
      ClassCoverage
      -
      -
      -
      -

      Project Risks

      -
      - - - - - - - - -{{project_risks_classes}} - -
      ClassCRAP
      -
      -
      -
      -
      -
      -

      Methods

      -
      -
      -
      -
      -

      Coverage Distribution

      -
      - -
      -
      -
      -

      Complexity

      -
      - -
      -
      -
      -
      -
      -

      Insufficient Coverage

      -
      - - - - - - - - -{{insufficient_coverage_methods}} - -
      MethodCoverage
      -
      -
      -
      -

      Project Risks

      -
      - - - - - - - - -{{project_risks_methods}} - -
      MethodCRAP
      -
      -
      -
      - -
      - - - - - - diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/directory.html.dist b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/directory.html.dist deleted file mode 100644 index a263463a..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/directory.html.dist +++ /dev/null @@ -1,60 +0,0 @@ - - - - - Code Coverage for {{full_path}} - - - - - - - -
      -
      -
      -
      - -
      -
      -
      -
      -
      -
      - - - - - - - - - - - - - - -{{items}} - -
       
      Code Coverage
       
      Lines
      Functions and Methods
      Classes and Traits
      -
      -
      -
      -

      Legend

      -

      - Low: 0% to {{low_upper_bound}}% - Medium: {{low_upper_bound}}% to {{high_lower_bound}}% - High: {{high_lower_bound}}% to 100% -

      -

      - Generated by php-code-coverage {{version}} using {{runtime}}{{generator}} at {{date}}. -

      -
      -
      - - diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/directory_branch.html.dist b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/directory_branch.html.dist deleted file mode 100644 index 8c94861f..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/directory_branch.html.dist +++ /dev/null @@ -1,62 +0,0 @@ - - - - - Code Coverage for {{full_path}} - - - - - - - -
      -
      -
      -
      - -
      -
      -
      -
      -
      -
      - - - - - - - - - - - - - - - - -{{items}} - -
       
      Code Coverage
       
      Lines
      Branches
      Paths
      Functions and Methods
      Classes and Traits
      -
      -
      -
      -

      Legend

      -

      - Low: 0% to {{low_upper_bound}}% - Medium: {{low_upper_bound}}% to {{high_lower_bound}}% - High: {{high_lower_bound}}% to 100% -

      -

      - Generated by php-code-coverage {{version}} using {{runtime}}{{generator}} at {{date}}. -

      -
      -
      - - diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/directory_item.html.dist b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/directory_item.html.dist deleted file mode 100644 index f6941a43..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/directory_item.html.dist +++ /dev/null @@ -1,13 +0,0 @@ - - {{icon}}{{name}} - {{lines_bar}} -
      {{lines_executed_percent}}
      -
      {{lines_number}}
      - {{methods_bar}} -
      {{methods_tested_percent}}
      -
      {{methods_number}}
      - {{classes_bar}} -
      {{classes_tested_percent}}
      -
      {{classes_number}}
      - - diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/directory_item_branch.html.dist b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/directory_item_branch.html.dist deleted file mode 100644 index 532a436c..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/directory_item_branch.html.dist +++ /dev/null @@ -1,19 +0,0 @@ - - {{icon}}{{name}} - {{lines_bar}} -
      {{lines_executed_percent}}
      -
      {{lines_number}}
      - {{branches_bar}} -
      {{branches_executed_percent}}
      -
      {{branches_number}}
      - {{paths_bar}} -
      {{paths_executed_percent}}
      -
      {{paths_number}}
      - {{methods_bar}} -
      {{methods_tested_percent}}
      -
      {{methods_number}}
      - {{classes_bar}} -
      {{classes_tested_percent}}
      -
      {{classes_number}}
      - - diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/file.html.dist b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/file.html.dist deleted file mode 100644 index af8631d1..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/file.html.dist +++ /dev/null @@ -1,65 +0,0 @@ - - - - - Code Coverage for {{full_path}} - - - - - - - -
      -
      -
      -
      - -
      -
      -
      -
      -
      -
      - - - - - - - - - - - - - - -{{items}} - -
       
      Code Coverage
       
      Lines
      Functions and Methods
      Classes and Traits
      -
      -{{lines}} -{{structure}} - -
      - - - - - - diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/file_branch.html.dist b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/file_branch.html.dist deleted file mode 100644 index 8717d7f9..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/file_branch.html.dist +++ /dev/null @@ -1,67 +0,0 @@ - - - - - Code Coverage for {{full_path}} - - - - - - - -
      -
      -
      -
      - -
      -
      -
      -
      -
      -
      - - - - - - - - - - - - - - - - -{{items}} - -
       
      Code Coverage
       
      Lines
      Branches
      Paths
      Functions and Methods
      Classes and Traits
      -
      -{{lines}} -{{structure}} - -
      - - - - - - diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/file_item.html.dist b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/file_item.html.dist deleted file mode 100644 index b1c0fca4..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/file_item.html.dist +++ /dev/null @@ -1,14 +0,0 @@ - - {{name}} - {{lines_bar}} -
      {{lines_executed_percent}}
      -
      {{lines_number}}
      - {{methods_bar}} -
      {{methods_tested_percent}}
      -
      {{methods_number}}
      - {{crap}} - {{classes_bar}} -
      {{classes_tested_percent}}
      -
      {{classes_number}}
      - - diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/file_item_branch.html.dist b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/file_item_branch.html.dist deleted file mode 100644 index 50502517..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/file_item_branch.html.dist +++ /dev/null @@ -1,20 +0,0 @@ - - {{name}} - {{lines_bar}} -
      {{lines_executed_percent}}
      -
      {{lines_number}}
      - {{branches_bar}} -
      {{branches_executed_percent}}
      -
      {{branches_number}}
      - {{paths_bar}} -
      {{paths_executed_percent}}
      -
      {{paths_number}}
      - {{methods_bar}} -
      {{methods_tested_percent}}
      -
      {{methods_number}}
      - {{crap}} - {{classes_bar}} -
      {{classes_tested_percent}}
      -
      {{classes_number}}
      - - diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/icons/file-code.svg b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/icons/file-code.svg deleted file mode 100644 index 5b4b1995..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/icons/file-code.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/icons/file-directory.svg b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/icons/file-directory.svg deleted file mode 100644 index 4bf1f1ca..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/icons/file-directory.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/js/bootstrap.min.js b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/js/bootstrap.min.js deleted file mode 100644 index 97206dcd..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/js/bootstrap.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * Bootstrap v4.6.2 (https://getbootstrap.com/) - * Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jquery"),require("popper.js")):"function"==typeof define&&define.amd?define(["exports","jquery","popper.js"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).bootstrap={},t.jQuery,t.Popper)}(this,(function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var o=i(e),a=i(n);function s(t,e){for(var n=0;n=4)throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}};d.jQueryDetection(),o.default.fn.emulateTransitionEnd=function(t){var e=this,n=!1;return o.default(this).one(d.TRANSITION_END,(function(){n=!0})),setTimeout((function(){n||d.triggerTransitionEnd(e)}),t),this},o.default.event.special[d.TRANSITION_END]={bindType:f,delegateType:f,handle:function(t){if(o.default(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}};var c="bs.alert",h=o.default.fn.alert,g=function(){function t(t){this._element=t}var e=t.prototype;return e.close=function(t){var e=this._element;t&&(e=this._getRootElement(t)),this._triggerCloseEvent(e).isDefaultPrevented()||this._removeElement(e)},e.dispose=function(){o.default.removeData(this._element,c),this._element=null},e._getRootElement=function(t){var e=d.getSelectorFromElement(t),n=!1;return e&&(n=document.querySelector(e)),n||(n=o.default(t).closest(".alert")[0]),n},e._triggerCloseEvent=function(t){var e=o.default.Event("close.bs.alert");return o.default(t).trigger(e),e},e._removeElement=function(t){var e=this;if(o.default(t).removeClass("show"),o.default(t).hasClass("fade")){var n=d.getTransitionDurationFromElement(t);o.default(t).one(d.TRANSITION_END,(function(n){return e._destroyElement(t,n)})).emulateTransitionEnd(n)}else this._destroyElement(t)},e._destroyElement=function(t){o.default(t).detach().trigger("closed.bs.alert").remove()},t._jQueryInterface=function(e){return this.each((function(){var n=o.default(this),i=n.data(c);i||(i=new t(this),n.data(c,i)),"close"===e&&i[e](this)}))},t._handleDismiss=function(t){return function(e){e&&e.preventDefault(),t.close(this)}},l(t,null,[{key:"VERSION",get:function(){return"4.6.2"}}]),t}();o.default(document).on("click.bs.alert.data-api",'[data-dismiss="alert"]',g._handleDismiss(new g)),o.default.fn.alert=g._jQueryInterface,o.default.fn.alert.Constructor=g,o.default.fn.alert.noConflict=function(){return o.default.fn.alert=h,g._jQueryInterface};var m="bs.button",p=o.default.fn.button,_="active",v='[data-toggle^="button"]',y='input:not([type="hidden"])',b=".btn",E=function(){function t(t){this._element=t,this.shouldAvoidTriggerChange=!1}var e=t.prototype;return e.toggle=function(){var t=!0,e=!0,n=o.default(this._element).closest('[data-toggle="buttons"]')[0];if(n){var i=this._element.querySelector(y);if(i){if("radio"===i.type)if(i.checked&&this._element.classList.contains(_))t=!1;else{var a=n.querySelector(".active");a&&o.default(a).removeClass(_)}t&&("checkbox"!==i.type&&"radio"!==i.type||(i.checked=!this._element.classList.contains(_)),this.shouldAvoidTriggerChange||o.default(i).trigger("change")),i.focus(),e=!1}}this._element.hasAttribute("disabled")||this._element.classList.contains("disabled")||(e&&this._element.setAttribute("aria-pressed",!this._element.classList.contains(_)),t&&o.default(this._element).toggleClass(_))},e.dispose=function(){o.default.removeData(this._element,m),this._element=null},t._jQueryInterface=function(e,n){return this.each((function(){var i=o.default(this),a=i.data(m);a||(a=new t(this),i.data(m,a)),a.shouldAvoidTriggerChange=n,"toggle"===e&&a[e]()}))},l(t,null,[{key:"VERSION",get:function(){return"4.6.2"}}]),t}();o.default(document).on("click.bs.button.data-api",v,(function(t){var e=t.target,n=e;if(o.default(e).hasClass("btn")||(e=o.default(e).closest(b)[0]),!e||e.hasAttribute("disabled")||e.classList.contains("disabled"))t.preventDefault();else{var i=e.querySelector(y);if(i&&(i.hasAttribute("disabled")||i.classList.contains("disabled")))return void t.preventDefault();"INPUT"!==n.tagName&&"LABEL"===e.tagName||E._jQueryInterface.call(o.default(e),"toggle","INPUT"===n.tagName)}})).on("focus.bs.button.data-api blur.bs.button.data-api",v,(function(t){var e=o.default(t.target).closest(b)[0];o.default(e).toggleClass("focus",/^focus(in)?$/.test(t.type))})),o.default(window).on("load.bs.button.data-api",(function(){for(var t=[].slice.call(document.querySelectorAll('[data-toggle="buttons"] .btn')),e=0,n=t.length;e0,this._pointerEvent=Boolean(window.PointerEvent||window.MSPointerEvent),this._addEventListeners()}var e=t.prototype;return e.next=function(){this._isSliding||this._slide(N)},e.nextWhenVisible=function(){var t=o.default(this._element);!document.hidden&&t.is(":visible")&&"hidden"!==t.css("visibility")&&this.next()},e.prev=function(){this._isSliding||this._slide(D)},e.pause=function(t){t||(this._isPaused=!0),this._element.querySelector(".carousel-item-next, .carousel-item-prev")&&(d.triggerTransitionEnd(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null},e.cycle=function(t){t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config.interval&&!this._isPaused&&(this._updateInterval(),this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))},e.to=function(t){var e=this;this._activeElement=this._element.querySelector(I);var n=this._getItemIndex(this._activeElement);if(!(t>this._items.length-1||t<0))if(this._isSliding)o.default(this._element).one(A,(function(){return e.to(t)}));else{if(n===t)return this.pause(),void this.cycle();var i=t>n?N:D;this._slide(i,this._items[t])}},e.dispose=function(){o.default(this._element).off(".bs.carousel"),o.default.removeData(this._element,w),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},e._getConfig=function(t){return t=r({},k,t),d.typeCheckConfig(T,t,O),t},e._handleSwipe=function(){var t=Math.abs(this.touchDeltaX);if(!(t<=40)){var e=t/this.touchDeltaX;this.touchDeltaX=0,e>0&&this.prev(),e<0&&this.next()}},e._addEventListeners=function(){var t=this;this._config.keyboard&&o.default(this._element).on("keydown.bs.carousel",(function(e){return t._keydown(e)})),"hover"===this._config.pause&&o.default(this._element).on("mouseenter.bs.carousel",(function(e){return t.pause(e)})).on("mouseleave.bs.carousel",(function(e){return t.cycle(e)})),this._config.touch&&this._addTouchEventListeners()},e._addTouchEventListeners=function(){var t=this;if(this._touchSupported){var e=function(e){t._pointerEvent&&j[e.originalEvent.pointerType.toUpperCase()]?t.touchStartX=e.originalEvent.clientX:t._pointerEvent||(t.touchStartX=e.originalEvent.touches[0].clientX)},n=function(e){t._pointerEvent&&j[e.originalEvent.pointerType.toUpperCase()]&&(t.touchDeltaX=e.originalEvent.clientX-t.touchStartX),t._handleSwipe(),"hover"===t._config.pause&&(t.pause(),t.touchTimeout&&clearTimeout(t.touchTimeout),t.touchTimeout=setTimeout((function(e){return t.cycle(e)}),500+t._config.interval))};o.default(this._element.querySelectorAll(".carousel-item img")).on("dragstart.bs.carousel",(function(t){return t.preventDefault()})),this._pointerEvent?(o.default(this._element).on("pointerdown.bs.carousel",(function(t){return e(t)})),o.default(this._element).on("pointerup.bs.carousel",(function(t){return n(t)})),this._element.classList.add("pointer-event")):(o.default(this._element).on("touchstart.bs.carousel",(function(t){return e(t)})),o.default(this._element).on("touchmove.bs.carousel",(function(e){return function(e){t.touchDeltaX=e.originalEvent.touches&&e.originalEvent.touches.length>1?0:e.originalEvent.touches[0].clientX-t.touchStartX}(e)})),o.default(this._element).on("touchend.bs.carousel",(function(t){return n(t)})))}},e._keydown=function(t){if(!/input|textarea/i.test(t.target.tagName))switch(t.which){case 37:t.preventDefault(),this.prev();break;case 39:t.preventDefault(),this.next()}},e._getItemIndex=function(t){return this._items=t&&t.parentNode?[].slice.call(t.parentNode.querySelectorAll(".carousel-item")):[],this._items.indexOf(t)},e._getItemByDirection=function(t,e){var n=t===N,i=t===D,o=this._getItemIndex(e),a=this._items.length-1;if((i&&0===o||n&&o===a)&&!this._config.wrap)return e;var s=(o+(t===D?-1:1))%this._items.length;return-1===s?this._items[this._items.length-1]:this._items[s]},e._triggerSlideEvent=function(t,e){var n=this._getItemIndex(t),i=this._getItemIndex(this._element.querySelector(I)),a=o.default.Event("slide.bs.carousel",{relatedTarget:t,direction:e,from:i,to:n});return o.default(this._element).trigger(a),a},e._setActiveIndicatorElement=function(t){if(this._indicatorsElement){var e=[].slice.call(this._indicatorsElement.querySelectorAll(".active"));o.default(e).removeClass(S);var n=this._indicatorsElement.children[this._getItemIndex(t)];n&&o.default(n).addClass(S)}},e._updateInterval=function(){var t=this._activeElement||this._element.querySelector(I);if(t){var e=parseInt(t.getAttribute("data-interval"),10);e?(this._config.defaultInterval=this._config.defaultInterval||this._config.interval,this._config.interval=e):this._config.interval=this._config.defaultInterval||this._config.interval}},e._slide=function(t,e){var n,i,a,s=this,l=this._element.querySelector(I),r=this._getItemIndex(l),u=e||l&&this._getItemByDirection(t,l),f=this._getItemIndex(u),c=Boolean(this._interval);if(t===N?(n="carousel-item-left",i="carousel-item-next",a="left"):(n="carousel-item-right",i="carousel-item-prev",a="right"),u&&o.default(u).hasClass(S))this._isSliding=!1;else if(!this._triggerSlideEvent(u,a).isDefaultPrevented()&&l&&u){this._isSliding=!0,c&&this.pause(),this._setActiveIndicatorElement(u),this._activeElement=u;var h=o.default.Event(A,{relatedTarget:u,direction:a,from:r,to:f});if(o.default(this._element).hasClass("slide")){o.default(u).addClass(i),d.reflow(u),o.default(l).addClass(n),o.default(u).addClass(n);var g=d.getTransitionDurationFromElement(l);o.default(l).one(d.TRANSITION_END,(function(){o.default(u).removeClass(n+" "+i).addClass(S),o.default(l).removeClass("active "+i+" "+n),s._isSliding=!1,setTimeout((function(){return o.default(s._element).trigger(h)}),0)})).emulateTransitionEnd(g)}else o.default(l).removeClass(S),o.default(u).addClass(S),this._isSliding=!1,o.default(this._element).trigger(h);c&&this.cycle()}},t._jQueryInterface=function(e){return this.each((function(){var n=o.default(this).data(w),i=r({},k,o.default(this).data());"object"==typeof e&&(i=r({},i,e));var a="string"==typeof e?e:i.slide;if(n||(n=new t(this,i),o.default(this).data(w,n)),"number"==typeof e)n.to(e);else if("string"==typeof a){if("undefined"==typeof n[a])throw new TypeError('No method named "'+a+'"');n[a]()}else i.interval&&i.ride&&(n.pause(),n.cycle())}))},t._dataApiClickHandler=function(e){var n=d.getSelectorFromElement(this);if(n){var i=o.default(n)[0];if(i&&o.default(i).hasClass("carousel")){var a=r({},o.default(i).data(),o.default(this).data()),s=this.getAttribute("data-slide-to");s&&(a.interval=!1),t._jQueryInterface.call(o.default(i),a),s&&o.default(i).data(w).to(s),e.preventDefault()}}},l(t,null,[{key:"VERSION",get:function(){return"4.6.2"}},{key:"Default",get:function(){return k}}]),t}();o.default(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",P._dataApiClickHandler),o.default(window).on("load.bs.carousel.data-api",(function(){for(var t=[].slice.call(document.querySelectorAll('[data-ride="carousel"]')),e=0,n=t.length;e0&&(this._selector=s,this._triggerArray.push(a))}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}var e=t.prototype;return e.toggle=function(){o.default(this._element).hasClass(q)?this.hide():this.show()},e.show=function(){var e,n,i=this;if(!(this._isTransitioning||o.default(this._element).hasClass(q)||(this._parent&&0===(e=[].slice.call(this._parent.querySelectorAll(".show, .collapsing")).filter((function(t){return"string"==typeof i._config.parent?t.getAttribute("data-parent")===i._config.parent:t.classList.contains(F)}))).length&&(e=null),e&&(n=o.default(e).not(this._selector).data(R))&&n._isTransitioning))){var a=o.default.Event("show.bs.collapse");if(o.default(this._element).trigger(a),!a.isDefaultPrevented()){e&&(t._jQueryInterface.call(o.default(e).not(this._selector),"hide"),n||o.default(e).data(R,null));var s=this._getDimension();o.default(this._element).removeClass(F).addClass(Q),this._element.style[s]=0,this._triggerArray.length&&o.default(this._triggerArray).removeClass(B).attr("aria-expanded",!0),this.setTransitioning(!0);var l="scroll"+(s[0].toUpperCase()+s.slice(1)),r=d.getTransitionDurationFromElement(this._element);o.default(this._element).one(d.TRANSITION_END,(function(){o.default(i._element).removeClass(Q).addClass("collapse show"),i._element.style[s]="",i.setTransitioning(!1),o.default(i._element).trigger("shown.bs.collapse")})).emulateTransitionEnd(r),this._element.style[s]=this._element[l]+"px"}}},e.hide=function(){var t=this;if(!this._isTransitioning&&o.default(this._element).hasClass(q)){var e=o.default.Event("hide.bs.collapse");if(o.default(this._element).trigger(e),!e.isDefaultPrevented()){var n=this._getDimension();this._element.style[n]=this._element.getBoundingClientRect()[n]+"px",d.reflow(this._element),o.default(this._element).addClass(Q).removeClass("collapse show");var i=this._triggerArray.length;if(i>0)for(var a=0;a0},e._getOffset=function(){var t=this,e={};return"function"==typeof this._config.offset?e.fn=function(e){return e.offsets=r({},e.offsets,t._config.offset(e.offsets,t._element)),e}:e.offset=this._config.offset,e},e._getPopperConfig=function(){var t={placement:this._getPlacement(),modifiers:{offset:this._getOffset(),flip:{enabled:this._config.flip},preventOverflow:{boundariesElement:this._config.boundary}}};return"static"===this._config.display&&(t.modifiers.applyStyle={enabled:!1}),r({},t,this._config.popperConfig)},t._jQueryInterface=function(e){return this.each((function(){var n=o.default(this).data(K);if(n||(n=new t(this,"object"==typeof e?e:null),o.default(this).data(K,n)),"string"==typeof e){if("undefined"==typeof n[e])throw new TypeError('No method named "'+e+'"');n[e]()}}))},t._clearMenus=function(e){if(!e||3!==e.which&&("keyup"!==e.type||9===e.which))for(var n=[].slice.call(document.querySelectorAll(it)),i=0,a=n.length;i0&&s--,40===e.which&&sdocument.documentElement.clientHeight;n||(this._element.style.overflowY="hidden"),this._element.classList.add(ht);var i=d.getTransitionDurationFromElement(this._dialog);o.default(this._element).off(d.TRANSITION_END),o.default(this._element).one(d.TRANSITION_END,(function(){t._element.classList.remove(ht),n||o.default(t._element).one(d.TRANSITION_END,(function(){t._element.style.overflowY=""})).emulateTransitionEnd(t._element,i)})).emulateTransitionEnd(i),this._element.focus()}},e._showElement=function(t){var e=this,n=o.default(this._element).hasClass(dt),i=this._dialog?this._dialog.querySelector(".modal-body"):null;this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE||document.body.appendChild(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),o.default(this._dialog).hasClass("modal-dialog-scrollable")&&i?i.scrollTop=0:this._element.scrollTop=0,n&&d.reflow(this._element),o.default(this._element).addClass(ct),this._config.focus&&this._enforceFocus();var a=o.default.Event("shown.bs.modal",{relatedTarget:t}),s=function(){e._config.focus&&e._element.focus(),e._isTransitioning=!1,o.default(e._element).trigger(a)};if(n){var l=d.getTransitionDurationFromElement(this._dialog);o.default(this._dialog).one(d.TRANSITION_END,s).emulateTransitionEnd(l)}else s()},e._enforceFocus=function(){var t=this;o.default(document).off(pt).on(pt,(function(e){document!==e.target&&t._element!==e.target&&0===o.default(t._element).has(e.target).length&&t._element.focus()}))},e._setEscapeEvent=function(){var t=this;this._isShown?o.default(this._element).on(yt,(function(e){t._config.keyboard&&27===e.which?(e.preventDefault(),t.hide()):t._config.keyboard||27!==e.which||t._triggerBackdropTransition()})):this._isShown||o.default(this._element).off(yt)},e._setResizeEvent=function(){var t=this;this._isShown?o.default(window).on(_t,(function(e){return t.handleUpdate(e)})):o.default(window).off(_t)},e._hideModal=function(){var t=this;this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._showBackdrop((function(){o.default(document.body).removeClass(ft),t._resetAdjustments(),t._resetScrollbar(),o.default(t._element).trigger(gt)}))},e._removeBackdrop=function(){this._backdrop&&(o.default(this._backdrop).remove(),this._backdrop=null)},e._showBackdrop=function(t){var e=this,n=o.default(this._element).hasClass(dt)?dt:"";if(this._isShown&&this._config.backdrop){if(this._backdrop=document.createElement("div"),this._backdrop.className="modal-backdrop",n&&this._backdrop.classList.add(n),o.default(this._backdrop).appendTo(document.body),o.default(this._element).on(vt,(function(t){e._ignoreBackdropClick?e._ignoreBackdropClick=!1:t.target===t.currentTarget&&("static"===e._config.backdrop?e._triggerBackdropTransition():e.hide())})),n&&d.reflow(this._backdrop),o.default(this._backdrop).addClass(ct),!t)return;if(!n)return void t();var i=d.getTransitionDurationFromElement(this._backdrop);o.default(this._backdrop).one(d.TRANSITION_END,t).emulateTransitionEnd(i)}else if(!this._isShown&&this._backdrop){o.default(this._backdrop).removeClass(ct);var a=function(){e._removeBackdrop(),t&&t()};if(o.default(this._element).hasClass(dt)){var s=d.getTransitionDurationFromElement(this._backdrop);o.default(this._backdrop).one(d.TRANSITION_END,a).emulateTransitionEnd(s)}else a()}else t&&t()},e._adjustDialog=function(){var t=this._element.scrollHeight>document.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},e._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},e._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=Math.round(t.left+t.right)
      ',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent",customClass:"",sanitize:!0,sanitizeFn:null,whiteList:{"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},popperConfig:null},Ut={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"(number|string|function)",container:"(string|element|boolean)",fallbackPlacement:"(string|array)",boundary:"(string|element)",customClass:"(string|function)",sanitize:"boolean",sanitizeFn:"(null|function)",whiteList:"object",popperConfig:"(null|object)"},Mt={HIDE:"hide.bs.tooltip",HIDDEN:"hidden.bs.tooltip",SHOW:"show.bs.tooltip",SHOWN:"shown.bs.tooltip",INSERTED:"inserted.bs.tooltip",CLICK:"click.bs.tooltip",FOCUSIN:"focusin.bs.tooltip",FOCUSOUT:"focusout.bs.tooltip",MOUSEENTER:"mouseenter.bs.tooltip",MOUSELEAVE:"mouseleave.bs.tooltip"},Wt=function(){function t(t,e){if("undefined"==typeof a.default)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var e=t.prototype;return e.enable=function(){this._isEnabled=!0},e.disable=function(){this._isEnabled=!1},e.toggleEnabled=function(){this._isEnabled=!this._isEnabled},e.toggle=function(t){if(this._isEnabled)if(t){var e=this.constructor.DATA_KEY,n=o.default(t.currentTarget).data(e);n||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),o.default(t.currentTarget).data(e,n)),n._activeTrigger.click=!n._activeTrigger.click,n._isWithActiveTrigger()?n._enter(null,n):n._leave(null,n)}else{if(o.default(this.getTipElement()).hasClass(Rt))return void this._leave(null,this);this._enter(null,this)}},e.dispose=function(){clearTimeout(this._timeout),o.default.removeData(this.element,this.constructor.DATA_KEY),o.default(this.element).off(this.constructor.EVENT_KEY),o.default(this.element).closest(".modal").off("hide.bs.modal",this._hideModalHandler),this.tip&&o.default(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},e.show=function(){var t=this;if("none"===o.default(this.element).css("display"))throw new Error("Please use show on visible elements");var e=o.default.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){o.default(this.element).trigger(e);var n=d.findShadowRoot(this.element),i=o.default.contains(null!==n?n:this.element.ownerDocument.documentElement,this.element);if(e.isDefaultPrevented()||!i)return;var s=this.getTipElement(),l=d.getUID(this.constructor.NAME);s.setAttribute("id",l),this.element.setAttribute("aria-describedby",l),this.setContent(),this.config.animation&&o.default(s).addClass(Lt);var r="function"==typeof this.config.placement?this.config.placement.call(this,s,this.element):this.config.placement,u=this._getAttachment(r);this.addAttachmentClass(u);var f=this._getContainer();o.default(s).data(this.constructor.DATA_KEY,this),o.default.contains(this.element.ownerDocument.documentElement,this.tip)||o.default(s).appendTo(f),o.default(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new a.default(this.element,s,this._getPopperConfig(u)),o.default(s).addClass(Rt),o.default(s).addClass(this.config.customClass),"ontouchstart"in document.documentElement&&o.default(document.body).children().on("mouseover",null,o.default.noop);var c=function(){t.config.animation&&t._fixTransition();var e=t._hoverState;t._hoverState=null,o.default(t.element).trigger(t.constructor.Event.SHOWN),e===qt&&t._leave(null,t)};if(o.default(this.tip).hasClass(Lt)){var h=d.getTransitionDurationFromElement(this.tip);o.default(this.tip).one(d.TRANSITION_END,c).emulateTransitionEnd(h)}else c()}},e.hide=function(t){var e=this,n=this.getTipElement(),i=o.default.Event(this.constructor.Event.HIDE),a=function(){e._hoverState!==xt&&n.parentNode&&n.parentNode.removeChild(n),e._cleanTipClass(),e.element.removeAttribute("aria-describedby"),o.default(e.element).trigger(e.constructor.Event.HIDDEN),null!==e._popper&&e._popper.destroy(),t&&t()};if(o.default(this.element).trigger(i),!i.isDefaultPrevented()){if(o.default(n).removeClass(Rt),"ontouchstart"in document.documentElement&&o.default(document.body).children().off("mouseover",null,o.default.noop),this._activeTrigger.click=!1,this._activeTrigger.focus=!1,this._activeTrigger.hover=!1,o.default(this.tip).hasClass(Lt)){var s=d.getTransitionDurationFromElement(n);o.default(n).one(d.TRANSITION_END,a).emulateTransitionEnd(s)}else a();this._hoverState=""}},e.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},e.isWithContent=function(){return Boolean(this.getTitle())},e.addAttachmentClass=function(t){o.default(this.getTipElement()).addClass("bs-tooltip-"+t)},e.getTipElement=function(){return this.tip=this.tip||o.default(this.config.template)[0],this.tip},e.setContent=function(){var t=this.getTipElement();this.setElementContent(o.default(t.querySelectorAll(".tooltip-inner")),this.getTitle()),o.default(t).removeClass("fade show")},e.setElementContent=function(t,e){"object"!=typeof e||!e.nodeType&&!e.jquery?this.config.html?(this.config.sanitize&&(e=At(e,this.config.whiteList,this.config.sanitizeFn)),t.html(e)):t.text(e):this.config.html?o.default(e).parent().is(t)||t.empty().append(e):t.text(o.default(e).text())},e.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},e._getPopperConfig=function(t){var e=this;return r({},{placement:t,modifiers:{offset:this._getOffset(),flip:{behavior:this.config.fallbackPlacement},arrow:{element:".arrow"},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){return e._handlePopperPlacementChange(t)}},this.config.popperConfig)},e._getOffset=function(){var t=this,e={};return"function"==typeof this.config.offset?e.fn=function(e){return e.offsets=r({},e.offsets,t.config.offset(e.offsets,t.element)),e}:e.offset=this.config.offset,e},e._getContainer=function(){return!1===this.config.container?document.body:d.isElement(this.config.container)?o.default(this.config.container):o.default(document).find(this.config.container)},e._getAttachment=function(t){return Bt[t.toUpperCase()]},e._setListeners=function(){var t=this;this.config.trigger.split(" ").forEach((function(e){if("click"===e)o.default(t.element).on(t.constructor.Event.CLICK,t.config.selector,(function(e){return t.toggle(e)}));else if("manual"!==e){var n=e===Ft?t.constructor.Event.MOUSEENTER:t.constructor.Event.FOCUSIN,i=e===Ft?t.constructor.Event.MOUSELEAVE:t.constructor.Event.FOCUSOUT;o.default(t.element).on(n,t.config.selector,(function(e){return t._enter(e)})).on(i,t.config.selector,(function(e){return t._leave(e)}))}})),this._hideModalHandler=function(){t.element&&t.hide()},o.default(this.element).closest(".modal").on("hide.bs.modal",this._hideModalHandler),this.config.selector?this.config=r({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},e._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},e._enter=function(t,e){var n=this.constructor.DATA_KEY;(e=e||o.default(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),o.default(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusin"===t.type?Qt:Ft]=!0),o.default(e.getTipElement()).hasClass(Rt)||e._hoverState===xt?e._hoverState=xt:(clearTimeout(e._timeout),e._hoverState=xt,e.config.delay&&e.config.delay.show?e._timeout=setTimeout((function(){e._hoverState===xt&&e.show()}),e.config.delay.show):e.show())},e._leave=function(t,e){var n=this.constructor.DATA_KEY;(e=e||o.default(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),o.default(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusout"===t.type?Qt:Ft]=!1),e._isWithActiveTrigger()||(clearTimeout(e._timeout),e._hoverState=qt,e.config.delay&&e.config.delay.hide?e._timeout=setTimeout((function(){e._hoverState===qt&&e.hide()}),e.config.delay.hide):e.hide())},e._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},e._getConfig=function(t){var e=o.default(this.element).data();return Object.keys(e).forEach((function(t){-1!==Pt.indexOf(t)&&delete e[t]})),"number"==typeof(t=r({},this.constructor.Default,e,"object"==typeof t&&t?t:{})).delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),d.typeCheckConfig(It,t,this.constructor.DefaultType),t.sanitize&&(t.template=At(t.template,t.whiteList,t.sanitizeFn)),t},e._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},e._cleanTipClass=function(){var t=o.default(this.getTipElement()),e=t.attr("class").match(jt);null!==e&&e.length&&t.removeClass(e.join(""))},e._handlePopperPlacementChange=function(t){this.tip=t.instance.popper,this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},e._fixTransition=function(){var t=this.getTipElement(),e=this.config.animation;null===t.getAttribute("x-placement")&&(o.default(t).removeClass(Lt),this.config.animation=!1,this.hide(),this.show(),this.config.animation=e)},t._jQueryInterface=function(e){return this.each((function(){var n=o.default(this),i=n.data(kt),a="object"==typeof e&&e;if((i||!/dispose|hide/.test(e))&&(i||(i=new t(this,a),n.data(kt,i)),"string"==typeof e)){if("undefined"==typeof i[e])throw new TypeError('No method named "'+e+'"');i[e]()}}))},l(t,null,[{key:"VERSION",get:function(){return"4.6.2"}},{key:"Default",get:function(){return Ht}},{key:"NAME",get:function(){return It}},{key:"DATA_KEY",get:function(){return kt}},{key:"Event",get:function(){return Mt}},{key:"EVENT_KEY",get:function(){return".bs.tooltip"}},{key:"DefaultType",get:function(){return Ut}}]),t}();o.default.fn.tooltip=Wt._jQueryInterface,o.default.fn.tooltip.Constructor=Wt,o.default.fn.tooltip.noConflict=function(){return o.default.fn.tooltip=Ot,Wt._jQueryInterface};var Vt="bs.popover",zt=o.default.fn.popover,Kt=new RegExp("(^|\\s)bs-popover\\S+","g"),Xt=r({},Wt.Default,{placement:"right",trigger:"click",content:"",template:''}),Yt=r({},Wt.DefaultType,{content:"(string|element|function)"}),$t={HIDE:"hide.bs.popover",HIDDEN:"hidden.bs.popover",SHOW:"show.bs.popover",SHOWN:"shown.bs.popover",INSERTED:"inserted.bs.popover",CLICK:"click.bs.popover",FOCUSIN:"focusin.bs.popover",FOCUSOUT:"focusout.bs.popover",MOUSEENTER:"mouseenter.bs.popover",MOUSELEAVE:"mouseleave.bs.popover"},Jt=function(t){var e,n;function i(){return t.apply(this,arguments)||this}n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,u(e,n);var a=i.prototype;return a.isWithContent=function(){return this.getTitle()||this._getContent()},a.addAttachmentClass=function(t){o.default(this.getTipElement()).addClass("bs-popover-"+t)},a.getTipElement=function(){return this.tip=this.tip||o.default(this.config.template)[0],this.tip},a.setContent=function(){var t=o.default(this.getTipElement());this.setElementContent(t.find(".popover-header"),this.getTitle());var e=this._getContent();"function"==typeof e&&(e=e.call(this.element)),this.setElementContent(t.find(".popover-body"),e),t.removeClass("fade show")},a._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},a._cleanTipClass=function(){var t=o.default(this.getTipElement()),e=t.attr("class").match(Kt);null!==e&&e.length>0&&t.removeClass(e.join(""))},i._jQueryInterface=function(t){return this.each((function(){var e=o.default(this).data(Vt),n="object"==typeof t?t:null;if((e||!/dispose|hide/.test(t))&&(e||(e=new i(this,n),o.default(this).data(Vt,e)),"string"==typeof t)){if("undefined"==typeof e[t])throw new TypeError('No method named "'+t+'"');e[t]()}}))},l(i,null,[{key:"VERSION",get:function(){return"4.6.2"}},{key:"Default",get:function(){return Xt}},{key:"NAME",get:function(){return"popover"}},{key:"DATA_KEY",get:function(){return Vt}},{key:"Event",get:function(){return $t}},{key:"EVENT_KEY",get:function(){return".bs.popover"}},{key:"DefaultType",get:function(){return Yt}}]),i}(Wt);o.default.fn.popover=Jt._jQueryInterface,o.default.fn.popover.Constructor=Jt,o.default.fn.popover.noConflict=function(){return o.default.fn.popover=zt,Jt._jQueryInterface};var Gt="scrollspy",Zt="bs.scrollspy",te=o.default.fn[Gt],ee="active",ne="position",ie=".nav, .list-group",oe={offset:10,method:"auto",target:""},ae={offset:"number",method:"string",target:"(string|element)"},se=function(){function t(t,e){var n=this;this._element=t,this._scrollElement="BODY"===t.tagName?window:t,this._config=this._getConfig(e),this._selector=this._config.target+" .nav-link,"+this._config.target+" .list-group-item,"+this._config.target+" .dropdown-item",this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,o.default(this._scrollElement).on("scroll.bs.scrollspy",(function(t){return n._process(t)})),this.refresh(),this._process()}var e=t.prototype;return e.refresh=function(){var t=this,e=this._scrollElement===this._scrollElement.window?"offset":ne,n="auto"===this._config.method?e:this._config.method,i=n===ne?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),[].slice.call(document.querySelectorAll(this._selector)).map((function(t){var e,a=d.getSelectorFromElement(t);if(a&&(e=document.querySelector(a)),e){var s=e.getBoundingClientRect();if(s.width||s.height)return[o.default(e)[n]().top+i,a]}return null})).filter(Boolean).sort((function(t,e){return t[0]-e[0]})).forEach((function(e){t._offsets.push(e[0]),t._targets.push(e[1])}))},e.dispose=function(){o.default.removeData(this._element,Zt),o.default(this._scrollElement).off(".bs.scrollspy"),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null},e._getConfig=function(t){if("string"!=typeof(t=r({},oe,"object"==typeof t&&t?t:{})).target&&d.isElement(t.target)){var e=o.default(t.target).attr("id");e||(e=d.getUID(Gt),o.default(t.target).attr("id",e)),t.target="#"+e}return d.typeCheckConfig(Gt,t,ae),t},e._getScrollTop=function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop},e._getScrollHeight=function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},e._getOffsetHeight=function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height},e._process=function(){var t=this._getScrollTop()+this._config.offset,e=this._getScrollHeight(),n=this._config.offset+e-this._getOffsetHeight();if(this._scrollHeight!==e&&this.refresh(),t>=n){var i=this._targets[this._targets.length-1];this._activeTarget!==i&&this._activate(i)}else{if(this._activeTarget&&t0)return this._activeTarget=null,void this._clear();for(var o=this._offsets.length;o--;)this._activeTarget!==this._targets[o]&&t>=this._offsets[o]&&("undefined"==typeof this._offsets[o+1]||t li > .active",ge=function(){function t(t){this._element=t}var e=t.prototype;return e.show=function(){var t=this;if(!(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&o.default(this._element).hasClass(ue)||o.default(this._element).hasClass("disabled")||this._element.hasAttribute("disabled"))){var e,n,i=o.default(this._element).closest(".nav, .list-group")[0],a=d.getSelectorFromElement(this._element);if(i){var s="UL"===i.nodeName||"OL"===i.nodeName?he:ce;n=(n=o.default.makeArray(o.default(i).find(s)))[n.length-1]}var l=o.default.Event("hide.bs.tab",{relatedTarget:this._element}),r=o.default.Event("show.bs.tab",{relatedTarget:n});if(n&&o.default(n).trigger(l),o.default(this._element).trigger(r),!r.isDefaultPrevented()&&!l.isDefaultPrevented()){a&&(e=document.querySelector(a)),this._activate(this._element,i);var u=function(){var e=o.default.Event("hidden.bs.tab",{relatedTarget:t._element}),i=o.default.Event("shown.bs.tab",{relatedTarget:n});o.default(n).trigger(e),o.default(t._element).trigger(i)};e?this._activate(e,e.parentNode,u):u()}}},e.dispose=function(){o.default.removeData(this._element,le),this._element=null},e._activate=function(t,e,n){var i=this,a=(!e||"UL"!==e.nodeName&&"OL"!==e.nodeName?o.default(e).children(ce):o.default(e).find(he))[0],s=n&&a&&o.default(a).hasClass(fe),l=function(){return i._transitionComplete(t,a,n)};if(a&&s){var r=d.getTransitionDurationFromElement(a);o.default(a).removeClass(de).one(d.TRANSITION_END,l).emulateTransitionEnd(r)}else l()},e._transitionComplete=function(t,e,n){if(e){o.default(e).removeClass(ue);var i=o.default(e.parentNode).find("> .dropdown-menu .active")[0];i&&o.default(i).removeClass(ue),"tab"===e.getAttribute("role")&&e.setAttribute("aria-selected",!1)}o.default(t).addClass(ue),"tab"===t.getAttribute("role")&&t.setAttribute("aria-selected",!0),d.reflow(t),t.classList.contains(fe)&&t.classList.add(de);var a=t.parentNode;if(a&&"LI"===a.nodeName&&(a=a.parentNode),a&&o.default(a).hasClass("dropdown-menu")){var s=o.default(t).closest(".dropdown")[0];if(s){var l=[].slice.call(s.querySelectorAll(".dropdown-toggle"));o.default(l).addClass(ue)}t.setAttribute("aria-expanded",!0)}n&&n()},t._jQueryInterface=function(e){return this.each((function(){var n=o.default(this),i=n.data(le);if(i||(i=new t(this),n.data(le,i)),"string"==typeof e){if("undefined"==typeof i[e])throw new TypeError('No method named "'+e+'"');i[e]()}}))},l(t,null,[{key:"VERSION",get:function(){return"4.6.2"}}]),t}();o.default(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',(function(t){t.preventDefault(),ge._jQueryInterface.call(o.default(this),"show")})),o.default.fn.tab=ge._jQueryInterface,o.default.fn.tab.Constructor=ge,o.default.fn.tab.noConflict=function(){return o.default.fn.tab=re,ge._jQueryInterface};var me="bs.toast",pe=o.default.fn.toast,_e="hide",ve="show",ye="showing",be="click.dismiss.bs.toast",Ee={animation:!0,autohide:!0,delay:500},Te={animation:"boolean",autohide:"boolean",delay:"number"},we=function(){function t(t,e){this._element=t,this._config=this._getConfig(e),this._timeout=null,this._setListeners()}var e=t.prototype;return e.show=function(){var t=this,e=o.default.Event("show.bs.toast");if(o.default(this._element).trigger(e),!e.isDefaultPrevented()){this._clearTimeout(),this._config.animation&&this._element.classList.add("fade");var n=function(){t._element.classList.remove(ye),t._element.classList.add(ve),o.default(t._element).trigger("shown.bs.toast"),t._config.autohide&&(t._timeout=setTimeout((function(){t.hide()}),t._config.delay))};if(this._element.classList.remove(_e),d.reflow(this._element),this._element.classList.add(ye),this._config.animation){var i=d.getTransitionDurationFromElement(this._element);o.default(this._element).one(d.TRANSITION_END,n).emulateTransitionEnd(i)}else n()}},e.hide=function(){if(this._element.classList.contains(ve)){var t=o.default.Event("hide.bs.toast");o.default(this._element).trigger(t),t.isDefaultPrevented()||this._close()}},e.dispose=function(){this._clearTimeout(),this._element.classList.contains(ve)&&this._element.classList.remove(ve),o.default(this._element).off(be),o.default.removeData(this._element,me),this._element=null,this._config=null},e._getConfig=function(t){return t=r({},Ee,o.default(this._element).data(),"object"==typeof t&&t?t:{}),d.typeCheckConfig("toast",t,this.constructor.DefaultType),t},e._setListeners=function(){var t=this;o.default(this._element).on(be,'[data-dismiss="toast"]',(function(){return t.hide()}))},e._close=function(){var t=this,e=function(){t._element.classList.add(_e),o.default(t._element).trigger("hidden.bs.toast")};if(this._element.classList.remove(ve),this._config.animation){var n=d.getTransitionDurationFromElement(this._element);o.default(this._element).one(d.TRANSITION_END,e).emulateTransitionEnd(n)}else e()},e._clearTimeout=function(){clearTimeout(this._timeout),this._timeout=null},t._jQueryInterface=function(e){return this.each((function(){var n=o.default(this),i=n.data(me);if(i||(i=new t(this,"object"==typeof e&&e),n.data(me,i)),"string"==typeof e){if("undefined"==typeof i[e])throw new TypeError('No method named "'+e+'"');i[e](this)}}))},l(t,null,[{key:"VERSION",get:function(){return"4.6.2"}},{key:"DefaultType",get:function(){return Te}},{key:"Default",get:function(){return Ee}}]),t}();o.default.fn.toast=we._jQueryInterface,o.default.fn.toast.Constructor=we,o.default.fn.toast.noConflict=function(){return o.default.fn.toast=pe,we._jQueryInterface},t.Alert=g,t.Button=E,t.Carousel=P,t.Collapse=V,t.Dropdown=lt,t.Modal=Ct,t.Popover=Jt,t.Scrollspy=se,t.Tab=ge,t.Toast=we,t.Tooltip=Wt,t.Util=d,Object.defineProperty(t,"__esModule",{value:!0})})); -//# sourceMappingURL=bootstrap.min.js.map \ No newline at end of file diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/js/d3.min.js b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/js/d3.min.js deleted file mode 100644 index 16648730..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/js/d3.min.js +++ /dev/null @@ -1,5 +0,0 @@ -!function(){function n(n){return n&&(n.ownerDocument||n.document||n).documentElement}function t(n){return n&&(n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView)}function e(n,t){return t>n?-1:n>t?1:n>=t?0:NaN}function r(n){return null===n?NaN:+n}function i(n){return!isNaN(n)}function u(n){return{left:function(t,e,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);i>r;){var u=r+i>>>1;n(t[u],e)<0?r=u+1:i=u}return r},right:function(t,e,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);i>r;){var u=r+i>>>1;n(t[u],e)>0?i=u:r=u+1}return r}}}function o(n){return n.length}function a(n){for(var t=1;n*t%1;)t*=10;return t}function l(n,t){for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}function c(){this._=Object.create(null)}function f(n){return(n+="")===bo||n[0]===_o?_o+n:n}function s(n){return(n+="")[0]===_o?n.slice(1):n}function h(n){return f(n)in this._}function p(n){return(n=f(n))in this._&&delete this._[n]}function g(){var n=[];for(var t in this._)n.push(s(t));return n}function v(){var n=0;for(var t in this._)++n;return n}function d(){for(var n in this._)return!1;return!0}function y(){this._=Object.create(null)}function m(n){return n}function M(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function x(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var e=0,r=wo.length;r>e;++e){var i=wo[e]+t;if(i in n)return i}}function b(){}function _(){}function w(n){function t(){for(var t,r=e,i=-1,u=r.length;++ie;e++)for(var i,u=n[e],o=0,a=u.length;a>o;o++)(i=u[o])&&t(i,o,e);return n}function Z(n){return ko(n,qo),n}function V(n){var t,e;return function(r,i,u){var o,a=n[u].update,l=a.length;for(u!=e&&(e=u,t=0),i>=t&&(t=i+1);!(o=a[t])&&++t0&&(n=n.slice(0,a));var c=To.get(n);return c&&(n=c,l=B),a?t?i:r:t?b:u}function $(n,t){return function(e){var r=ao.event;ao.event=e,t[0]=this.__data__;try{n.apply(this,t)}finally{ao.event=r}}}function B(n,t){var e=$(n,t);return function(n){var t=this,r=n.relatedTarget;r&&(r===t||8&r.compareDocumentPosition(t))||e.call(t,n)}}function W(e){var r=".dragsuppress-"+ ++Do,i="click"+r,u=ao.select(t(e)).on("touchmove"+r,S).on("dragstart"+r,S).on("selectstart"+r,S);if(null==Ro&&(Ro="onselectstart"in e?!1:x(e.style,"userSelect")),Ro){var o=n(e).style,a=o[Ro];o[Ro]="none"}return function(n){if(u.on(r,null),Ro&&(o[Ro]=a),n){var t=function(){u.on(i,null)};u.on(i,function(){S(),t()},!0),setTimeout(t,0)}}}function J(n,e){e.changedTouches&&(e=e.changedTouches[0]);var r=n.ownerSVGElement||n;if(r.createSVGPoint){var i=r.createSVGPoint();if(0>Po){var u=t(n);if(u.scrollX||u.scrollY){r=ao.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var o=r[0][0].getScreenCTM();Po=!(o.f||o.e),r.remove()}}return Po?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY),i=i.matrixTransform(n.getScreenCTM().inverse()),[i.x,i.y]}var a=n.getBoundingClientRect();return[e.clientX-a.left-n.clientLeft,e.clientY-a.top-n.clientTop]}function G(){return ao.event.changedTouches[0].identifier}function K(n){return n>0?1:0>n?-1:0}function Q(n,t,e){return(t[0]-n[0])*(e[1]-n[1])-(t[1]-n[1])*(e[0]-n[0])}function nn(n){return n>1?0:-1>n?Fo:Math.acos(n)}function tn(n){return n>1?Io:-1>n?-Io:Math.asin(n)}function en(n){return((n=Math.exp(n))-1/n)/2}function rn(n){return((n=Math.exp(n))+1/n)/2}function un(n){return((n=Math.exp(2*n))-1)/(n+1)}function on(n){return(n=Math.sin(n/2))*n}function an(){}function ln(n,t,e){return this instanceof ln?(this.h=+n,this.s=+t,void(this.l=+e)):arguments.length<2?n instanceof ln?new ln(n.h,n.s,n.l):_n(""+n,wn,ln):new ln(n,t,e)}function cn(n,t,e){function r(n){return n>360?n-=360:0>n&&(n+=360),60>n?u+(o-u)*n/60:180>n?o:240>n?u+(o-u)*(240-n)/60:u}function i(n){return Math.round(255*r(n))}var u,o;return n=isNaN(n)?0:(n%=360)<0?n+360:n,t=isNaN(t)?0:0>t?0:t>1?1:t,e=0>e?0:e>1?1:e,o=.5>=e?e*(1+t):e+t-e*t,u=2*e-o,new mn(i(n+120),i(n),i(n-120))}function fn(n,t,e){return this instanceof fn?(this.h=+n,this.c=+t,void(this.l=+e)):arguments.length<2?n instanceof fn?new fn(n.h,n.c,n.l):n instanceof hn?gn(n.l,n.a,n.b):gn((n=Sn((n=ao.rgb(n)).r,n.g,n.b)).l,n.a,n.b):new fn(n,t,e)}function sn(n,t,e){return isNaN(n)&&(n=0),isNaN(t)&&(t=0),new hn(e,Math.cos(n*=Yo)*t,Math.sin(n)*t)}function hn(n,t,e){return this instanceof hn?(this.l=+n,this.a=+t,void(this.b=+e)):arguments.length<2?n instanceof hn?new hn(n.l,n.a,n.b):n instanceof fn?sn(n.h,n.c,n.l):Sn((n=mn(n)).r,n.g,n.b):new hn(n,t,e)}function pn(n,t,e){var r=(n+16)/116,i=r+t/500,u=r-e/200;return i=vn(i)*na,r=vn(r)*ta,u=vn(u)*ea,new mn(yn(3.2404542*i-1.5371385*r-.4985314*u),yn(-.969266*i+1.8760108*r+.041556*u),yn(.0556434*i-.2040259*r+1.0572252*u))}function gn(n,t,e){return n>0?new fn(Math.atan2(e,t)*Zo,Math.sqrt(t*t+e*e),n):new fn(NaN,NaN,n)}function vn(n){return n>.206893034?n*n*n:(n-4/29)/7.787037}function dn(n){return n>.008856?Math.pow(n,1/3):7.787037*n+4/29}function yn(n){return Math.round(255*(.00304>=n?12.92*n:1.055*Math.pow(n,1/2.4)-.055))}function mn(n,t,e){return this instanceof mn?(this.r=~~n,this.g=~~t,void(this.b=~~e)):arguments.length<2?n instanceof mn?new mn(n.r,n.g,n.b):_n(""+n,mn,cn):new mn(n,t,e)}function Mn(n){return new mn(n>>16,n>>8&255,255&n)}function xn(n){return Mn(n)+""}function bn(n){return 16>n?"0"+Math.max(0,n).toString(16):Math.min(255,n).toString(16)}function _n(n,t,e){var r,i,u,o=0,a=0,l=0;if(r=/([a-z]+)\((.*)\)/.exec(n=n.toLowerCase()))switch(i=r[2].split(","),r[1]){case"hsl":return e(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return t(Nn(i[0]),Nn(i[1]),Nn(i[2]))}return(u=ua.get(n))?t(u.r,u.g,u.b):(null==n||"#"!==n.charAt(0)||isNaN(u=parseInt(n.slice(1),16))||(4===n.length?(o=(3840&u)>>4,o=o>>4|o,a=240&u,a=a>>4|a,l=15&u,l=l<<4|l):7===n.length&&(o=(16711680&u)>>16,a=(65280&u)>>8,l=255&u)),t(o,a,l))}function wn(n,t,e){var r,i,u=Math.min(n/=255,t/=255,e/=255),o=Math.max(n,t,e),a=o-u,l=(o+u)/2;return a?(i=.5>l?a/(o+u):a/(2-o-u),r=n==o?(t-e)/a+(e>t?6:0):t==o?(e-n)/a+2:(n-t)/a+4,r*=60):(r=NaN,i=l>0&&1>l?0:r),new ln(r,i,l)}function Sn(n,t,e){n=kn(n),t=kn(t),e=kn(e);var r=dn((.4124564*n+.3575761*t+.1804375*e)/na),i=dn((.2126729*n+.7151522*t+.072175*e)/ta),u=dn((.0193339*n+.119192*t+.9503041*e)/ea);return hn(116*i-16,500*(r-i),200*(i-u))}function kn(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function Nn(n){var t=parseFloat(n);return"%"===n.charAt(n.length-1)?Math.round(2.55*t):t}function En(n){return"function"==typeof n?n:function(){return n}}function An(n){return function(t,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=null),Cn(t,e,n,r)}}function Cn(n,t,e,r){function i(){var n,t=l.status;if(!t&&Ln(l)||t>=200&&300>t||304===t){try{n=e.call(u,l)}catch(r){return void o.error.call(u,r)}o.load.call(u,n)}else o.error.call(u,l)}var u={},o=ao.dispatch("beforesend","progress","load","error"),a={},l=new XMLHttpRequest,c=null;return!this.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(n)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=i:l.onreadystatechange=function(){l.readyState>3&&i()},l.onprogress=function(n){var t=ao.event;ao.event=n;try{o.progress.call(u,l)}finally{ao.event=t}},u.header=function(n,t){return n=(n+"").toLowerCase(),arguments.length<2?a[n]:(null==t?delete a[n]:a[n]=t+"",u)},u.mimeType=function(n){return arguments.length?(t=null==n?null:n+"",u):t},u.responseType=function(n){return arguments.length?(c=n,u):c},u.response=function(n){return e=n,u},["get","post"].forEach(function(n){u[n]=function(){return u.send.apply(u,[n].concat(co(arguments)))}}),u.send=function(e,r,i){if(2===arguments.length&&"function"==typeof r&&(i=r,r=null),l.open(e,n,!0),null==t||"accept"in a||(a.accept=t+",*/*"),l.setRequestHeader)for(var f in a)l.setRequestHeader(f,a[f]);return null!=t&&l.overrideMimeType&&l.overrideMimeType(t),null!=c&&(l.responseType=c),null!=i&&u.on("error",i).on("load",function(n){i(null,n)}),o.beforesend.call(u,l),l.send(null==r?null:r),u},u.abort=function(){return l.abort(),u},ao.rebind(u,o,"on"),null==r?u:u.get(zn(r))}function zn(n){return 1===n.length?function(t,e){n(null==t?e:null)}:n}function Ln(n){var t=n.responseType;return t&&"text"!==t?n.response:n.responseText}function qn(n,t,e){var r=arguments.length;2>r&&(t=0),3>r&&(e=Date.now());var i=e+t,u={c:n,t:i,n:null};return aa?aa.n=u:oa=u,aa=u,la||(ca=clearTimeout(ca),la=1,fa(Tn)),u}function Tn(){var n=Rn(),t=Dn()-n;t>24?(isFinite(t)&&(clearTimeout(ca),ca=setTimeout(Tn,t)),la=0):(la=1,fa(Tn))}function Rn(){for(var n=Date.now(),t=oa;t;)n>=t.t&&t.c(n-t.t)&&(t.c=null),t=t.n;return n}function Dn(){for(var n,t=oa,e=1/0;t;)t.c?(t.t8?function(n){return n/e}:function(n){return n*e},symbol:n}}function jn(n){var t=n.decimal,e=n.thousands,r=n.grouping,i=n.currency,u=r&&e?function(n,t){for(var i=n.length,u=[],o=0,a=r[0],l=0;i>0&&a>0&&(l+a+1>t&&(a=Math.max(1,t-l)),u.push(n.substring(i-=a,i+a)),!((l+=a+1)>t));)a=r[o=(o+1)%r.length];return u.reverse().join(e)}:m;return function(n){var e=ha.exec(n),r=e[1]||" ",o=e[2]||">",a=e[3]||"-",l=e[4]||"",c=e[5],f=+e[6],s=e[7],h=e[8],p=e[9],g=1,v="",d="",y=!1,m=!0;switch(h&&(h=+h.substring(1)),(c||"0"===r&&"="===o)&&(c=r="0",o="="),p){case"n":s=!0,p="g";break;case"%":g=100,d="%",p="f";break;case"p":g=100,d="%",p="r";break;case"b":case"o":case"x":case"X":"#"===l&&(v="0"+p.toLowerCase());case"c":m=!1;case"d":y=!0,h=0;break;case"s":g=-1,p="r"}"$"===l&&(v=i[0],d=i[1]),"r"!=p||h||(p="g"),null!=h&&("g"==p?h=Math.max(1,Math.min(21,h)):"e"!=p&&"f"!=p||(h=Math.max(0,Math.min(20,h)))),p=pa.get(p)||Fn;var M=c&&s;return function(n){var e=d;if(y&&n%1)return"";var i=0>n||0===n&&0>1/n?(n=-n,"-"):"-"===a?"":a;if(0>g){var l=ao.formatPrefix(n,h);n=l.scale(n),e=l.symbol+d}else n*=g;n=p(n,h);var x,b,_=n.lastIndexOf(".");if(0>_){var w=m?n.lastIndexOf("e"):-1;0>w?(x=n,b=""):(x=n.substring(0,w),b=n.substring(w))}else x=n.substring(0,_),b=t+n.substring(_+1);!c&&s&&(x=u(x,1/0));var S=v.length+x.length+b.length+(M?0:i.length),k=f>S?new Array(S=f-S+1).join(r):"";return M&&(x=u(k+x,k.length?f-b.length:1/0)),i+=v,n=x+b,("<"===o?i+n+k:">"===o?k+i+n:"^"===o?k.substring(0,S>>=1)+i+n+k.substring(S):i+(M?n:k+n))+e}}}function Fn(n){return n+""}function Hn(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function On(n,t,e){function r(t){var e=n(t),r=u(e,1);return r-t>t-e?e:r}function i(e){return t(e=n(new va(e-1)),1),e}function u(n,e){return t(n=new va(+n),e),n}function o(n,r,u){var o=i(n),a=[];if(u>1)for(;r>o;)e(o)%u||a.push(new Date(+o)),t(o,1);else for(;r>o;)a.push(new Date(+o)),t(o,1);return a}function a(n,t,e){try{va=Hn;var r=new Hn;return r._=n,o(r,t,e)}finally{va=Date}}n.floor=n,n.round=r,n.ceil=i,n.offset=u,n.range=o;var l=n.utc=In(n);return l.floor=l,l.round=In(r),l.ceil=In(i),l.offset=In(u),l.range=a,n}function In(n){return function(t,e){try{va=Hn;var r=new Hn;return r._=t,n(r,e)._}finally{va=Date}}}function Yn(n){function t(n){function t(t){for(var e,i,u,o=[],a=-1,l=0;++aa;){if(r>=c)return-1;if(i=t.charCodeAt(a++),37===i){if(o=t.charAt(a++),u=C[o in ya?t.charAt(a++):o],!u||(r=u(n,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}function r(n,t,e){_.lastIndex=0;var r=_.exec(t.slice(e));return r?(n.w=w.get(r[0].toLowerCase()),e+r[0].length):-1}function i(n,t,e){x.lastIndex=0;var r=x.exec(t.slice(e));return r?(n.w=b.get(r[0].toLowerCase()),e+r[0].length):-1}function u(n,t,e){N.lastIndex=0;var r=N.exec(t.slice(e));return r?(n.m=E.get(r[0].toLowerCase()),e+r[0].length):-1}function o(n,t,e){S.lastIndex=0;var r=S.exec(t.slice(e));return r?(n.m=k.get(r[0].toLowerCase()),e+r[0].length):-1}function a(n,t,r){return e(n,A.c.toString(),t,r)}function l(n,t,r){return e(n,A.x.toString(),t,r)}function c(n,t,r){return e(n,A.X.toString(),t,r)}function f(n,t,e){var r=M.get(t.slice(e,e+=2).toLowerCase());return null==r?-1:(n.p=r,e)}var s=n.dateTime,h=n.date,p=n.time,g=n.periods,v=n.days,d=n.shortDays,y=n.months,m=n.shortMonths;t.utc=function(n){function e(n){try{va=Hn;var t=new va;return t._=n,r(t)}finally{va=Date}}var r=t(n);return e.parse=function(n){try{va=Hn;var t=r.parse(n);return t&&t._}finally{va=Date}},e.toString=r.toString,e},t.multi=t.utc.multi=ct;var M=ao.map(),x=Vn(v),b=Xn(v),_=Vn(d),w=Xn(d),S=Vn(y),k=Xn(y),N=Vn(m),E=Xn(m);g.forEach(function(n,t){M.set(n.toLowerCase(),t)});var A={a:function(n){return d[n.getDay()]},A:function(n){return v[n.getDay()]},b:function(n){return m[n.getMonth()]},B:function(n){return y[n.getMonth()]},c:t(s),d:function(n,t){return Zn(n.getDate(),t,2)},e:function(n,t){return Zn(n.getDate(),t,2)},H:function(n,t){return Zn(n.getHours(),t,2)},I:function(n,t){return Zn(n.getHours()%12||12,t,2)},j:function(n,t){return Zn(1+ga.dayOfYear(n),t,3)},L:function(n,t){return Zn(n.getMilliseconds(),t,3)},m:function(n,t){return Zn(n.getMonth()+1,t,2)},M:function(n,t){return Zn(n.getMinutes(),t,2)},p:function(n){return g[+(n.getHours()>=12)]},S:function(n,t){return Zn(n.getSeconds(),t,2)},U:function(n,t){return Zn(ga.sundayOfYear(n),t,2)},w:function(n){return n.getDay()},W:function(n,t){return Zn(ga.mondayOfYear(n),t,2)},x:t(h),X:t(p),y:function(n,t){return Zn(n.getFullYear()%100,t,2)},Y:function(n,t){return Zn(n.getFullYear()%1e4,t,4)},Z:at,"%":function(){return"%"}},C={a:r,A:i,b:u,B:o,c:a,d:tt,e:tt,H:rt,I:rt,j:et,L:ot,m:nt,M:it,p:f,S:ut,U:Bn,w:$n,W:Wn,x:l,X:c,y:Gn,Y:Jn,Z:Kn,"%":lt};return t}function Zn(n,t,e){var r=0>n?"-":"",i=(r?-n:n)+"",u=i.length;return r+(e>u?new Array(e-u+1).join(t)+i:i)}function Vn(n){return new RegExp("^(?:"+n.map(ao.requote).join("|")+")","i")}function Xn(n){for(var t=new c,e=-1,r=n.length;++e68?1900:2e3)}function nt(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.m=r[0]-1,e+r[0].length):-1}function tt(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.d=+r[0],e+r[0].length):-1}function et(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+3));return r?(n.j=+r[0],e+r[0].length):-1}function rt(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.H=+r[0],e+r[0].length):-1}function it(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.M=+r[0],e+r[0].length):-1}function ut(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.S=+r[0],e+r[0].length):-1}function ot(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+3));return r?(n.L=+r[0],e+r[0].length):-1}function at(n){var t=n.getTimezoneOffset(),e=t>0?"-":"+",r=xo(t)/60|0,i=xo(t)%60;return e+Zn(r,"0",2)+Zn(i,"0",2)}function lt(n,t,e){Ma.lastIndex=0;var r=Ma.exec(t.slice(e,e+1));return r?e+r[0].length:-1}function ct(n){for(var t=n.length,e=-1;++e=0?1:-1,a=o*e,l=Math.cos(t),c=Math.sin(t),f=u*c,s=i*l+f*Math.cos(a),h=f*o*Math.sin(a);ka.add(Math.atan2(h,s)),r=n,i=l,u=c}var t,e,r,i,u;Na.point=function(o,a){Na.point=n,r=(t=o)*Yo,i=Math.cos(a=(e=a)*Yo/2+Fo/4),u=Math.sin(a)},Na.lineEnd=function(){n(t,e)}}function dt(n){var t=n[0],e=n[1],r=Math.cos(e);return[r*Math.cos(t),r*Math.sin(t),Math.sin(e)]}function yt(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function mt(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function Mt(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function xt(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function bt(n){var t=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function _t(n){return[Math.atan2(n[1],n[0]),tn(n[2])]}function wt(n,t){return xo(n[0]-t[0])a;++a)i.point((e=n[a])[0],e[1]);return void i.lineEnd()}var l=new Tt(e,n,null,!0),c=new Tt(e,null,l,!1);l.o=c,u.push(l),o.push(c),l=new Tt(r,n,null,!1),c=new Tt(r,null,l,!0),l.o=c,u.push(l),o.push(c)}}),o.sort(t),qt(u),qt(o),u.length){for(var a=0,l=e,c=o.length;c>a;++a)o[a].e=l=!l;for(var f,s,h=u[0];;){for(var p=h,g=!0;p.v;)if((p=p.n)===h)return;f=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(g)for(var a=0,c=f.length;c>a;++a)i.point((s=f[a])[0],s[1]);else r(p.x,p.n.x,1,i);p=p.n}else{if(g){f=p.p.z;for(var a=f.length-1;a>=0;--a)i.point((s=f[a])[0],s[1])}else r(p.x,p.p.x,-1,i);p=p.p}p=p.o,f=p.z,g=!g}while(!p.v);i.lineEnd()}}}function qt(n){if(t=n.length){for(var t,e,r=0,i=n[0];++r0){for(b||(u.polygonStart(),b=!0),u.lineStart();++o1&&2&t&&e.push(e.pop().concat(e.shift())),p.push(e.filter(Dt))}var p,g,v,d=t(u),y=i.invert(r[0],r[1]),m={point:o,lineStart:l,lineEnd:c,polygonStart:function(){m.point=f,m.lineStart=s,m.lineEnd=h,p=[],g=[]},polygonEnd:function(){m.point=o,m.lineStart=l,m.lineEnd=c,p=ao.merge(p);var n=Ot(y,g);p.length?(b||(u.polygonStart(),b=!0),Lt(p,Ut,n,e,u)):n&&(b||(u.polygonStart(),b=!0),u.lineStart(),e(null,null,1,u),u.lineEnd()),b&&(u.polygonEnd(),b=!1),p=g=null},sphere:function(){u.polygonStart(),u.lineStart(),e(null,null,1,u),u.lineEnd(),u.polygonEnd()}},M=Pt(),x=t(M),b=!1;return m}}function Dt(n){return n.length>1}function Pt(){var n,t=[];return{lineStart:function(){t.push(n=[])},point:function(t,e){n.push([t,e])},lineEnd:b,buffer:function(){var e=t;return t=[],n=null,e},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function Ut(n,t){return((n=n.x)[0]<0?n[1]-Io-Uo:Io-n[1])-((t=t.x)[0]<0?t[1]-Io-Uo:Io-t[1])}function jt(n){var t,e=NaN,r=NaN,i=NaN;return{lineStart:function(){n.lineStart(),t=1},point:function(u,o){var a=u>0?Fo:-Fo,l=xo(u-e);xo(l-Fo)0?Io:-Io),n.point(i,r),n.lineEnd(),n.lineStart(),n.point(a,r),n.point(u,r),t=0):i!==a&&l>=Fo&&(xo(e-i)Uo?Math.atan((Math.sin(t)*(u=Math.cos(r))*Math.sin(e)-Math.sin(r)*(i=Math.cos(t))*Math.sin(n))/(i*u*o)):(t+r)/2}function Ht(n,t,e,r){var i;if(null==n)i=e*Io,r.point(-Fo,i),r.point(0,i),r.point(Fo,i),r.point(Fo,0),r.point(Fo,-i),r.point(0,-i),r.point(-Fo,-i),r.point(-Fo,0),r.point(-Fo,i);else if(xo(n[0]-t[0])>Uo){var u=n[0]a;++a){var c=t[a],f=c.length;if(f)for(var s=c[0],h=s[0],p=s[1]/2+Fo/4,g=Math.sin(p),v=Math.cos(p),d=1;;){d===f&&(d=0),n=c[d];var y=n[0],m=n[1]/2+Fo/4,M=Math.sin(m),x=Math.cos(m),b=y-h,_=b>=0?1:-1,w=_*b,S=w>Fo,k=g*M;if(ka.add(Math.atan2(k*_*Math.sin(w),v*x+k*Math.cos(w))),u+=S?b+_*Ho:b,S^h>=e^y>=e){var N=mt(dt(s),dt(n));bt(N);var E=mt(i,N);bt(E);var A=(S^b>=0?-1:1)*tn(E[2]);(r>A||r===A&&(N[0]||N[1]))&&(o+=S^b>=0?1:-1)}if(!d++)break;h=y,g=M,v=x,s=n}}return(-Uo>u||Uo>u&&-Uo>ka)^1&o}function It(n){function t(n,t){return Math.cos(n)*Math.cos(t)>u}function e(n){var e,u,l,c,f;return{lineStart:function(){c=l=!1,f=1},point:function(s,h){var p,g=[s,h],v=t(s,h),d=o?v?0:i(s,h):v?i(s+(0>s?Fo:-Fo),h):0;if(!e&&(c=l=v)&&n.lineStart(),v!==l&&(p=r(e,g),(wt(e,p)||wt(g,p))&&(g[0]+=Uo,g[1]+=Uo,v=t(g[0],g[1]))),v!==l)f=0,v?(n.lineStart(),p=r(g,e),n.point(p[0],p[1])):(p=r(e,g),n.point(p[0],p[1]),n.lineEnd()),e=p;else if(a&&e&&o^v){var y;d&u||!(y=r(g,e,!0))||(f=0,o?(n.lineStart(),n.point(y[0][0],y[0][1]),n.point(y[1][0],y[1][1]),n.lineEnd()):(n.point(y[1][0],y[1][1]),n.lineEnd(),n.lineStart(),n.point(y[0][0],y[0][1])))}!v||e&&wt(e,g)||n.point(g[0],g[1]),e=g,l=v,u=d},lineEnd:function(){l&&n.lineEnd(),e=null},clean:function(){return f|(c&&l)<<1}}}function r(n,t,e){var r=dt(n),i=dt(t),o=[1,0,0],a=mt(r,i),l=yt(a,a),c=a[0],f=l-c*c;if(!f)return!e&&n;var s=u*l/f,h=-u*c/f,p=mt(o,a),g=xt(o,s),v=xt(a,h);Mt(g,v);var d=p,y=yt(g,d),m=yt(d,d),M=y*y-m*(yt(g,g)-1);if(!(0>M)){var x=Math.sqrt(M),b=xt(d,(-y-x)/m);if(Mt(b,g),b=_t(b),!e)return b;var _,w=n[0],S=t[0],k=n[1],N=t[1];w>S&&(_=w,w=S,S=_);var E=S-w,A=xo(E-Fo)E;if(!A&&k>N&&(_=k,k=N,N=_),C?A?k+N>0^b[1]<(xo(b[0]-w)Fo^(w<=b[0]&&b[0]<=S)){var z=xt(d,(-y+x)/m);return Mt(z,g),[b,_t(z)]}}}function i(t,e){var r=o?n:Fo-n,i=0;return-r>t?i|=1:t>r&&(i|=2),-r>e?i|=4:e>r&&(i|=8),i}var u=Math.cos(n),o=u>0,a=xo(u)>Uo,l=ve(n,6*Yo);return Rt(t,e,l,o?[0,-n]:[-Fo,n-Fo])}function Yt(n,t,e,r){return function(i){var u,o=i.a,a=i.b,l=o.x,c=o.y,f=a.x,s=a.y,h=0,p=1,g=f-l,v=s-c;if(u=n-l,g||!(u>0)){if(u/=g,0>g){if(h>u)return;p>u&&(p=u)}else if(g>0){if(u>p)return;u>h&&(h=u)}if(u=e-l,g||!(0>u)){if(u/=g,0>g){if(u>p)return;u>h&&(h=u)}else if(g>0){if(h>u)return;p>u&&(p=u)}if(u=t-c,v||!(u>0)){if(u/=v,0>v){if(h>u)return;p>u&&(p=u)}else if(v>0){if(u>p)return;u>h&&(h=u)}if(u=r-c,v||!(0>u)){if(u/=v,0>v){if(u>p)return;u>h&&(h=u)}else if(v>0){if(h>u)return;p>u&&(p=u)}return h>0&&(i.a={x:l+h*g,y:c+h*v}),1>p&&(i.b={x:l+p*g,y:c+p*v}),i}}}}}}function Zt(n,t,e,r){function i(r,i){return xo(r[0]-n)0?0:3:xo(r[0]-e)0?2:1:xo(r[1]-t)0?1:0:i>0?3:2}function u(n,t){return o(n.x,t.x)}function o(n,t){var e=i(n,1),r=i(t,1);return e!==r?e-r:0===e?t[1]-n[1]:1===e?n[0]-t[0]:2===e?n[1]-t[1]:t[0]-n[0]}return function(a){function l(n){for(var t=0,e=d.length,r=n[1],i=0;e>i;++i)for(var u,o=1,a=d[i],l=a.length,c=a[0];l>o;++o)u=a[o],c[1]<=r?u[1]>r&&Q(c,u,n)>0&&++t:u[1]<=r&&Q(c,u,n)<0&&--t,c=u;return 0!==t}function c(u,a,l,c){var f=0,s=0;if(null==u||(f=i(u,l))!==(s=i(a,l))||o(u,a)<0^l>0){do c.point(0===f||3===f?n:e,f>1?r:t);while((f=(f+l+4)%4)!==s)}else c.point(a[0],a[1])}function f(i,u){return i>=n&&e>=i&&u>=t&&r>=u}function s(n,t){f(n,t)&&a.point(n,t)}function h(){C.point=g,d&&d.push(y=[]),S=!0,w=!1,b=_=NaN}function p(){v&&(g(m,M),x&&w&&E.rejoin(),v.push(E.buffer())),C.point=s,w&&a.lineEnd()}function g(n,t){n=Math.max(-Ha,Math.min(Ha,n)),t=Math.max(-Ha,Math.min(Ha,t));var e=f(n,t);if(d&&y.push([n,t]),S)m=n,M=t,x=e,S=!1,e&&(a.lineStart(),a.point(n,t));else if(e&&w)a.point(n,t);else{var r={a:{x:b,y:_},b:{x:n,y:t}};A(r)?(w||(a.lineStart(),a.point(r.a.x,r.a.y)),a.point(r.b.x,r.b.y),e||a.lineEnd(),k=!1):e&&(a.lineStart(),a.point(n,t),k=!1)}b=n,_=t,w=e}var v,d,y,m,M,x,b,_,w,S,k,N=a,E=Pt(),A=Yt(n,t,e,r),C={point:s,lineStart:h,lineEnd:p,polygonStart:function(){a=E,v=[],d=[],k=!0},polygonEnd:function(){a=N,v=ao.merge(v);var t=l([n,r]),e=k&&t,i=v.length;(e||i)&&(a.polygonStart(),e&&(a.lineStart(),c(null,null,1,a),a.lineEnd()),i&&Lt(v,u,t,c,a),a.polygonEnd()),v=d=y=null}};return C}}function Vt(n){var t=0,e=Fo/3,r=ae(n),i=r(t,e);return i.parallels=function(n){return arguments.length?r(t=n[0]*Fo/180,e=n[1]*Fo/180):[t/Fo*180,e/Fo*180]},i}function Xt(n,t){function e(n,t){var e=Math.sqrt(u-2*i*Math.sin(t))/i;return[e*Math.sin(n*=i),o-e*Math.cos(n)]}var r=Math.sin(n),i=(r+Math.sin(t))/2,u=1+r*(2*i-r),o=Math.sqrt(u)/i;return e.invert=function(n,t){var e=o-t;return[Math.atan2(n,e)/i,tn((u-(n*n+e*e)*i*i)/(2*i))]},e}function $t(){function n(n,t){Ia+=i*n-r*t,r=n,i=t}var t,e,r,i;$a.point=function(u,o){$a.point=n,t=r=u,e=i=o},$a.lineEnd=function(){n(t,e)}}function Bt(n,t){Ya>n&&(Ya=n),n>Va&&(Va=n),Za>t&&(Za=t),t>Xa&&(Xa=t)}function Wt(){function n(n,t){o.push("M",n,",",t,u)}function t(n,t){o.push("M",n,",",t),a.point=e}function e(n,t){o.push("L",n,",",t)}function r(){a.point=n}function i(){o.push("Z")}var u=Jt(4.5),o=[],a={point:n,lineStart:function(){a.point=t},lineEnd:r,polygonStart:function(){a.lineEnd=i},polygonEnd:function(){a.lineEnd=r,a.point=n},pointRadius:function(n){return u=Jt(n),a},result:function(){if(o.length){var n=o.join("");return o=[],n}}};return a}function Jt(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function Gt(n,t){Ca+=n,za+=t,++La}function Kt(){function n(n,r){var i=n-t,u=r-e,o=Math.sqrt(i*i+u*u);qa+=o*(t+n)/2,Ta+=o*(e+r)/2,Ra+=o,Gt(t=n,e=r)}var t,e;Wa.point=function(r,i){Wa.point=n,Gt(t=r,e=i)}}function Qt(){Wa.point=Gt}function ne(){function n(n,t){var e=n-r,u=t-i,o=Math.sqrt(e*e+u*u);qa+=o*(r+n)/2,Ta+=o*(i+t)/2,Ra+=o,o=i*n-r*t,Da+=o*(r+n),Pa+=o*(i+t),Ua+=3*o,Gt(r=n,i=t)}var t,e,r,i;Wa.point=function(u,o){Wa.point=n,Gt(t=r=u,e=i=o)},Wa.lineEnd=function(){n(t,e)}}function te(n){function t(t,e){n.moveTo(t+o,e),n.arc(t,e,o,0,Ho)}function e(t,e){n.moveTo(t,e),a.point=r}function r(t,e){n.lineTo(t,e)}function i(){a.point=t}function u(){n.closePath()}var o=4.5,a={point:t,lineStart:function(){a.point=e},lineEnd:i,polygonStart:function(){a.lineEnd=u},polygonEnd:function(){a.lineEnd=i,a.point=t},pointRadius:function(n){return o=n,a},result:b};return a}function ee(n){function t(n){return(a?r:e)(n)}function e(t){return ue(t,function(e,r){e=n(e,r),t.point(e[0],e[1])})}function r(t){function e(e,r){e=n(e,r),t.point(e[0],e[1])}function r(){M=NaN,S.point=u,t.lineStart()}function u(e,r){var u=dt([e,r]),o=n(e,r);i(M,x,m,b,_,w,M=o[0],x=o[1],m=e,b=u[0],_=u[1],w=u[2],a,t),t.point(M,x)}function o(){S.point=e,t.lineEnd()}function l(){ -r(),S.point=c,S.lineEnd=f}function c(n,t){u(s=n,h=t),p=M,g=x,v=b,d=_,y=w,S.point=u}function f(){i(M,x,m,b,_,w,p,g,s,v,d,y,a,t),S.lineEnd=o,o()}var s,h,p,g,v,d,y,m,M,x,b,_,w,S={point:e,lineStart:r,lineEnd:o,polygonStart:function(){t.polygonStart(),S.lineStart=l},polygonEnd:function(){t.polygonEnd(),S.lineStart=r}};return S}function i(t,e,r,a,l,c,f,s,h,p,g,v,d,y){var m=f-t,M=s-e,x=m*m+M*M;if(x>4*u&&d--){var b=a+p,_=l+g,w=c+v,S=Math.sqrt(b*b+_*_+w*w),k=Math.asin(w/=S),N=xo(xo(w)-1)u||xo((m*z+M*L)/x-.5)>.3||o>a*p+l*g+c*v)&&(i(t,e,r,a,l,c,A,C,N,b/=S,_/=S,w,d,y),y.point(A,C),i(A,C,N,b,_,w,f,s,h,p,g,v,d,y))}}var u=.5,o=Math.cos(30*Yo),a=16;return t.precision=function(n){return arguments.length?(a=(u=n*n)>0&&16,t):Math.sqrt(u)},t}function re(n){var t=ee(function(t,e){return n([t*Zo,e*Zo])});return function(n){return le(t(n))}}function ie(n){this.stream=n}function ue(n,t){return{point:t,sphere:function(){n.sphere()},lineStart:function(){n.lineStart()},lineEnd:function(){n.lineEnd()},polygonStart:function(){n.polygonStart()},polygonEnd:function(){n.polygonEnd()}}}function oe(n){return ae(function(){return n})()}function ae(n){function t(n){return n=a(n[0]*Yo,n[1]*Yo),[n[0]*h+l,c-n[1]*h]}function e(n){return n=a.invert((n[0]-l)/h,(c-n[1])/h),n&&[n[0]*Zo,n[1]*Zo]}function r(){a=Ct(o=se(y,M,x),u);var n=u(v,d);return l=p-n[0]*h,c=g+n[1]*h,i()}function i(){return f&&(f.valid=!1,f=null),t}var u,o,a,l,c,f,s=ee(function(n,t){return n=u(n,t),[n[0]*h+l,c-n[1]*h]}),h=150,p=480,g=250,v=0,d=0,y=0,M=0,x=0,b=Fa,_=m,w=null,S=null;return t.stream=function(n){return f&&(f.valid=!1),f=le(b(o,s(_(n)))),f.valid=!0,f},t.clipAngle=function(n){return arguments.length?(b=null==n?(w=n,Fa):It((w=+n)*Yo),i()):w},t.clipExtent=function(n){return arguments.length?(S=n,_=n?Zt(n[0][0],n[0][1],n[1][0],n[1][1]):m,i()):S},t.scale=function(n){return arguments.length?(h=+n,r()):h},t.translate=function(n){return arguments.length?(p=+n[0],g=+n[1],r()):[p,g]},t.center=function(n){return arguments.length?(v=n[0]%360*Yo,d=n[1]%360*Yo,r()):[v*Zo,d*Zo]},t.rotate=function(n){return arguments.length?(y=n[0]%360*Yo,M=n[1]%360*Yo,x=n.length>2?n[2]%360*Yo:0,r()):[y*Zo,M*Zo,x*Zo]},ao.rebind(t,s,"precision"),function(){return u=n.apply(this,arguments),t.invert=u.invert&&e,r()}}function le(n){return ue(n,function(t,e){n.point(t*Yo,e*Yo)})}function ce(n,t){return[n,t]}function fe(n,t){return[n>Fo?n-Ho:-Fo>n?n+Ho:n,t]}function se(n,t,e){return n?t||e?Ct(pe(n),ge(t,e)):pe(n):t||e?ge(t,e):fe}function he(n){return function(t,e){return t+=n,[t>Fo?t-Ho:-Fo>t?t+Ho:t,e]}}function pe(n){var t=he(n);return t.invert=he(-n),t}function ge(n,t){function e(n,t){var e=Math.cos(t),a=Math.cos(n)*e,l=Math.sin(n)*e,c=Math.sin(t),f=c*r+a*i;return[Math.atan2(l*u-f*o,a*r-c*i),tn(f*u+l*o)]}var r=Math.cos(n),i=Math.sin(n),u=Math.cos(t),o=Math.sin(t);return e.invert=function(n,t){var e=Math.cos(t),a=Math.cos(n)*e,l=Math.sin(n)*e,c=Math.sin(t),f=c*u-l*o;return[Math.atan2(l*u+c*o,a*r+f*i),tn(f*r-a*i)]},e}function ve(n,t){var e=Math.cos(n),r=Math.sin(n);return function(i,u,o,a){var l=o*t;null!=i?(i=de(e,i),u=de(e,u),(o>0?u>i:i>u)&&(i+=o*Ho)):(i=n+o*Ho,u=n-.5*l);for(var c,f=i;o>0?f>u:u>f;f-=l)a.point((c=_t([e,-r*Math.cos(f),-r*Math.sin(f)]))[0],c[1])}}function de(n,t){var e=dt(t);e[0]-=n,bt(e);var r=nn(-e[1]);return((-e[2]<0?-r:r)+2*Math.PI-Uo)%(2*Math.PI)}function ye(n,t,e){var r=ao.range(n,t-Uo,e).concat(t);return function(n){return r.map(function(t){return[n,t]})}}function me(n,t,e){var r=ao.range(n,t-Uo,e).concat(t);return function(n){return r.map(function(t){return[t,n]})}}function Me(n){return n.source}function xe(n){return n.target}function be(n,t,e,r){var i=Math.cos(t),u=Math.sin(t),o=Math.cos(r),a=Math.sin(r),l=i*Math.cos(n),c=i*Math.sin(n),f=o*Math.cos(e),s=o*Math.sin(e),h=2*Math.asin(Math.sqrt(on(r-t)+i*o*on(e-n))),p=1/Math.sin(h),g=h?function(n){var t=Math.sin(n*=h)*p,e=Math.sin(h-n)*p,r=e*l+t*f,i=e*c+t*s,o=e*u+t*a;return[Math.atan2(i,r)*Zo,Math.atan2(o,Math.sqrt(r*r+i*i))*Zo]}:function(){return[n*Zo,t*Zo]};return g.distance=h,g}function _e(){function n(n,i){var u=Math.sin(i*=Yo),o=Math.cos(i),a=xo((n*=Yo)-t),l=Math.cos(a);Ja+=Math.atan2(Math.sqrt((a=o*Math.sin(a))*a+(a=r*u-e*o*l)*a),e*u+r*o*l),t=n,e=u,r=o}var t,e,r;Ga.point=function(i,u){t=i*Yo,e=Math.sin(u*=Yo),r=Math.cos(u),Ga.point=n},Ga.lineEnd=function(){Ga.point=Ga.lineEnd=b}}function we(n,t){function e(t,e){var r=Math.cos(t),i=Math.cos(e),u=n(r*i);return[u*i*Math.sin(t),u*Math.sin(e)]}return e.invert=function(n,e){var r=Math.sqrt(n*n+e*e),i=t(r),u=Math.sin(i),o=Math.cos(i);return[Math.atan2(n*u,r*o),Math.asin(r&&e*u/r)]},e}function Se(n,t){function e(n,t){o>0?-Io+Uo>t&&(t=-Io+Uo):t>Io-Uo&&(t=Io-Uo);var e=o/Math.pow(i(t),u);return[e*Math.sin(u*n),o-e*Math.cos(u*n)]}var r=Math.cos(n),i=function(n){return Math.tan(Fo/4+n/2)},u=n===t?Math.sin(n):Math.log(r/Math.cos(t))/Math.log(i(t)/i(n)),o=r*Math.pow(i(n),u)/u;return u?(e.invert=function(n,t){var e=o-t,r=K(u)*Math.sqrt(n*n+e*e);return[Math.atan2(n,e)/u,2*Math.atan(Math.pow(o/r,1/u))-Io]},e):Ne}function ke(n,t){function e(n,t){var e=u-t;return[e*Math.sin(i*n),u-e*Math.cos(i*n)]}var r=Math.cos(n),i=n===t?Math.sin(n):(r-Math.cos(t))/(t-n),u=r/i+n;return xo(i)i;i++){for(;r>1&&Q(n[e[r-2]],n[e[r-1]],n[i])<=0;)--r;e[r++]=i}return e.slice(0,r)}function qe(n,t){return n[0]-t[0]||n[1]-t[1]}function Te(n,t,e){return(e[0]-t[0])*(n[1]-t[1])<(e[1]-t[1])*(n[0]-t[0])}function Re(n,t,e,r){var i=n[0],u=e[0],o=t[0]-i,a=r[0]-u,l=n[1],c=e[1],f=t[1]-l,s=r[1]-c,h=(a*(l-c)-s*(i-u))/(s*o-a*f);return[i+h*o,l+h*f]}function De(n){var t=n[0],e=n[n.length-1];return!(t[0]-e[0]||t[1]-e[1])}function Pe(){rr(this),this.edge=this.site=this.circle=null}function Ue(n){var t=cl.pop()||new Pe;return t.site=n,t}function je(n){Be(n),ol.remove(n),cl.push(n),rr(n)}function Fe(n){var t=n.circle,e=t.x,r=t.cy,i={x:e,y:r},u=n.P,o=n.N,a=[n];je(n);for(var l=u;l.circle&&xo(e-l.circle.x)f;++f)c=a[f],l=a[f-1],nr(c.edge,l.site,c.site,i);l=a[0],c=a[s-1],c.edge=Ke(l.site,c.site,null,i),$e(l),$e(c)}function He(n){for(var t,e,r,i,u=n.x,o=n.y,a=ol._;a;)if(r=Oe(a,o)-u,r>Uo)a=a.L;else{if(i=u-Ie(a,o),!(i>Uo)){r>-Uo?(t=a.P,e=a):i>-Uo?(t=a,e=a.N):t=e=a;break}if(!a.R){t=a;break}a=a.R}var l=Ue(n);if(ol.insert(t,l),t||e){if(t===e)return Be(t),e=Ue(t.site),ol.insert(l,e),l.edge=e.edge=Ke(t.site,l.site),$e(t),void $e(e);if(!e)return void(l.edge=Ke(t.site,l.site));Be(t),Be(e);var c=t.site,f=c.x,s=c.y,h=n.x-f,p=n.y-s,g=e.site,v=g.x-f,d=g.y-s,y=2*(h*d-p*v),m=h*h+p*p,M=v*v+d*d,x={x:(d*m-p*M)/y+f,y:(h*M-v*m)/y+s};nr(e.edge,c,g,x),l.edge=Ke(c,n,null,x),e.edge=Ke(n,g,null,x),$e(t),$e(e)}}function Oe(n,t){var e=n.site,r=e.x,i=e.y,u=i-t;if(!u)return r;var o=n.P;if(!o)return-(1/0);e=o.site;var a=e.x,l=e.y,c=l-t;if(!c)return a;var f=a-r,s=1/u-1/c,h=f/c;return s?(-h+Math.sqrt(h*h-2*s*(f*f/(-2*c)-l+c/2+i-u/2)))/s+r:(r+a)/2}function Ie(n,t){var e=n.N;if(e)return Oe(e,t);var r=n.site;return r.y===t?r.x:1/0}function Ye(n){this.site=n,this.edges=[]}function Ze(n){for(var t,e,r,i,u,o,a,l,c,f,s=n[0][0],h=n[1][0],p=n[0][1],g=n[1][1],v=ul,d=v.length;d--;)if(u=v[d],u&&u.prepare())for(a=u.edges,l=a.length,o=0;l>o;)f=a[o].end(),r=f.x,i=f.y,c=a[++o%l].start(),t=c.x,e=c.y,(xo(r-t)>Uo||xo(i-e)>Uo)&&(a.splice(o,0,new tr(Qe(u.site,f,xo(r-s)Uo?{x:s,y:xo(t-s)Uo?{x:xo(e-g)Uo?{x:h,y:xo(t-h)Uo?{x:xo(e-p)=-jo)){var p=l*l+c*c,g=f*f+s*s,v=(s*p-c*g)/h,d=(l*g-f*p)/h,s=d+a,y=fl.pop()||new Xe;y.arc=n,y.site=i,y.x=v+o,y.y=s+Math.sqrt(v*v+d*d),y.cy=s,n.circle=y;for(var m=null,M=ll._;M;)if(y.yd||d>=a)return;if(h>g){if(u){if(u.y>=c)return}else u={x:d,y:l};e={x:d,y:c}}else{if(u){if(u.yr||r>1)if(h>g){if(u){if(u.y>=c)return}else u={x:(l-i)/r,y:l};e={x:(c-i)/r,y:c}}else{if(u){if(u.yp){if(u){if(u.x>=a)return}else u={x:o,y:r*o+i};e={x:a,y:r*a+i}}else{if(u){if(u.xu||s>o||r>h||i>p)){if(g=n.point){var g,v=t-n.x,d=e-n.y,y=v*v+d*d;if(l>y){var m=Math.sqrt(l=y);r=t-m,i=e-m,u=t+m,o=e+m,a=g}}for(var M=n.nodes,x=.5*(f+h),b=.5*(s+p),_=t>=x,w=e>=b,S=w<<1|_,k=S+4;k>S;++S)if(n=M[3&S])switch(3&S){case 0:c(n,f,s,x,b);break;case 1:c(n,x,s,h,b);break;case 2:c(n,f,b,x,p);break;case 3:c(n,x,b,h,p)}}}(n,r,i,u,o),a}function vr(n,t){n=ao.rgb(n),t=ao.rgb(t);var e=n.r,r=n.g,i=n.b,u=t.r-e,o=t.g-r,a=t.b-i;return function(n){return"#"+bn(Math.round(e+u*n))+bn(Math.round(r+o*n))+bn(Math.round(i+a*n))}}function dr(n,t){var e,r={},i={};for(e in n)e in t?r[e]=Mr(n[e],t[e]):i[e]=n[e];for(e in t)e in n||(i[e]=t[e]);return function(n){for(e in r)i[e]=r[e](n);return i}}function yr(n,t){return n=+n,t=+t,function(e){return n*(1-e)+t*e}}function mr(n,t){var e,r,i,u=hl.lastIndex=pl.lastIndex=0,o=-1,a=[],l=[];for(n+="",t+="";(e=hl.exec(n))&&(r=pl.exec(t));)(i=r.index)>u&&(i=t.slice(u,i),a[o]?a[o]+=i:a[++o]=i),(e=e[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,l.push({i:o,x:yr(e,r)})),u=pl.lastIndex;return ur;++r)a[(e=l[r]).i]=e.x(n);return a.join("")})}function Mr(n,t){for(var e,r=ao.interpolators.length;--r>=0&&!(e=ao.interpolators[r](n,t)););return e}function xr(n,t){var e,r=[],i=[],u=n.length,o=t.length,a=Math.min(n.length,t.length);for(e=0;a>e;++e)r.push(Mr(n[e],t[e]));for(;u>e;++e)i[e]=n[e];for(;o>e;++e)i[e]=t[e];return function(n){for(e=0;a>e;++e)i[e]=r[e](n);return i}}function br(n){return function(t){return 0>=t?0:t>=1?1:n(t)}}function _r(n){return function(t){return 1-n(1-t)}}function wr(n){return function(t){return.5*(.5>t?n(2*t):2-n(2-2*t))}}function Sr(n){return n*n}function kr(n){return n*n*n}function Nr(n){if(0>=n)return 0;if(n>=1)return 1;var t=n*n,e=t*n;return 4*(.5>n?e:3*(n-t)+e-.75)}function Er(n){return function(t){return Math.pow(t,n)}}function Ar(n){return 1-Math.cos(n*Io)}function Cr(n){return Math.pow(2,10*(n-1))}function zr(n){return 1-Math.sqrt(1-n*n)}function Lr(n,t){var e;return arguments.length<2&&(t=.45),arguments.length?e=t/Ho*Math.asin(1/n):(n=1,e=t/4),function(r){return 1+n*Math.pow(2,-10*r)*Math.sin((r-e)*Ho/t)}}function qr(n){return n||(n=1.70158),function(t){return t*t*((n+1)*t-n)}}function Tr(n){return 1/2.75>n?7.5625*n*n:2/2.75>n?7.5625*(n-=1.5/2.75)*n+.75:2.5/2.75>n?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}function Rr(n,t){n=ao.hcl(n),t=ao.hcl(t);var e=n.h,r=n.c,i=n.l,u=t.h-e,o=t.c-r,a=t.l-i;return isNaN(o)&&(o=0,r=isNaN(r)?t.c:r),isNaN(u)?(u=0,e=isNaN(e)?t.h:e):u>180?u-=360:-180>u&&(u+=360),function(n){return sn(e+u*n,r+o*n,i+a*n)+""}}function Dr(n,t){n=ao.hsl(n),t=ao.hsl(t);var e=n.h,r=n.s,i=n.l,u=t.h-e,o=t.s-r,a=t.l-i;return isNaN(o)&&(o=0,r=isNaN(r)?t.s:r),isNaN(u)?(u=0,e=isNaN(e)?t.h:e):u>180?u-=360:-180>u&&(u+=360),function(n){return cn(e+u*n,r+o*n,i+a*n)+""}}function Pr(n,t){n=ao.lab(n),t=ao.lab(t);var e=n.l,r=n.a,i=n.b,u=t.l-e,o=t.a-r,a=t.b-i;return function(n){return pn(e+u*n,r+o*n,i+a*n)+""}}function Ur(n,t){return t-=n,function(e){return Math.round(n+t*e)}}function jr(n){var t=[n.a,n.b],e=[n.c,n.d],r=Hr(t),i=Fr(t,e),u=Hr(Or(e,t,-i))||0;t[0]*e[1]180?t+=360:t-n>180&&(n+=360),r.push({i:e.push(Ir(e)+"rotate(",null,")")-2,x:yr(n,t)})):t&&e.push(Ir(e)+"rotate("+t+")")}function Vr(n,t,e,r){n!==t?r.push({i:e.push(Ir(e)+"skewX(",null,")")-2,x:yr(n,t)}):t&&e.push(Ir(e)+"skewX("+t+")")}function Xr(n,t,e,r){if(n[0]!==t[0]||n[1]!==t[1]){var i=e.push(Ir(e)+"scale(",null,",",null,")");r.push({i:i-4,x:yr(n[0],t[0])},{i:i-2,x:yr(n[1],t[1])})}else 1===t[0]&&1===t[1]||e.push(Ir(e)+"scale("+t+")")}function $r(n,t){var e=[],r=[];return n=ao.transform(n),t=ao.transform(t),Yr(n.translate,t.translate,e,r),Zr(n.rotate,t.rotate,e,r),Vr(n.skew,t.skew,e,r),Xr(n.scale,t.scale,e,r),n=t=null,function(n){for(var t,i=-1,u=r.length;++i=0;)e.push(i[r])}function oi(n,t){for(var e=[n],r=[];null!=(n=e.pop());)if(r.push(n),(u=n.children)&&(i=u.length))for(var i,u,o=-1;++oe;++e)(t=n[e][1])>i&&(r=e,i=t);return r}function yi(n){return n.reduce(mi,0)}function mi(n,t){return n+t[1]}function Mi(n,t){return xi(n,Math.ceil(Math.log(t.length)/Math.LN2+1))}function xi(n,t){for(var e=-1,r=+n[0],i=(n[1]-r)/t,u=[];++e<=t;)u[e]=i*e+r;return u}function bi(n){return[ao.min(n),ao.max(n)]}function _i(n,t){return n.value-t.value}function wi(n,t){var e=n._pack_next;n._pack_next=t,t._pack_prev=n,t._pack_next=e,e._pack_prev=t}function Si(n,t){n._pack_next=t,t._pack_prev=n}function ki(n,t){var e=t.x-n.x,r=t.y-n.y,i=n.r+t.r;return.999*i*i>e*e+r*r}function Ni(n){function t(n){f=Math.min(n.x-n.r,f),s=Math.max(n.x+n.r,s),h=Math.min(n.y-n.r,h),p=Math.max(n.y+n.r,p)}if((e=n.children)&&(c=e.length)){var e,r,i,u,o,a,l,c,f=1/0,s=-(1/0),h=1/0,p=-(1/0);if(e.forEach(Ei),r=e[0],r.x=-r.r,r.y=0,t(r),c>1&&(i=e[1],i.x=i.r,i.y=0,t(i),c>2))for(u=e[2],zi(r,i,u),t(u),wi(r,u),r._pack_prev=u,wi(u,i),i=r._pack_next,o=3;c>o;o++){zi(r,i,u=e[o]);var g=0,v=1,d=1;for(a=i._pack_next;a!==i;a=a._pack_next,v++)if(ki(a,u)){g=1;break}if(1==g)for(l=r._pack_prev;l!==a._pack_prev&&!ki(l,u);l=l._pack_prev,d++);g?(d>v||v==d&&i.ro;o++)u=e[o],u.x-=y,u.y-=m,M=Math.max(M,u.r+Math.sqrt(u.x*u.x+u.y*u.y));n.r=M,e.forEach(Ai)}}function Ei(n){n._pack_next=n._pack_prev=n}function Ai(n){delete n._pack_next,delete n._pack_prev}function Ci(n,t,e,r){var i=n.children;if(n.x=t+=r*n.x,n.y=e+=r*n.y,n.r*=r,i)for(var u=-1,o=i.length;++u=0;)t=i[u],t.z+=e,t.m+=e,e+=t.s+(r+=t.c)}function Pi(n,t,e){return n.a.parent===t.parent?n.a:e}function Ui(n){return 1+ao.max(n,function(n){return n.y})}function ji(n){return n.reduce(function(n,t){return n+t.x},0)/n.length}function Fi(n){var t=n.children;return t&&t.length?Fi(t[0]):n}function Hi(n){var t,e=n.children;return e&&(t=e.length)?Hi(e[t-1]):n}function Oi(n){return{x:n.x,y:n.y,dx:n.dx,dy:n.dy}}function Ii(n,t){var e=n.x+t[3],r=n.y+t[0],i=n.dx-t[1]-t[3],u=n.dy-t[0]-t[2];return 0>i&&(e+=i/2,i=0),0>u&&(r+=u/2,u=0),{x:e,y:r,dx:i,dy:u}}function Yi(n){var t=n[0],e=n[n.length-1];return e>t?[t,e]:[e,t]}function Zi(n){return n.rangeExtent?n.rangeExtent():Yi(n.range())}function Vi(n,t,e,r){var i=e(n[0],n[1]),u=r(t[0],t[1]);return function(n){return u(i(n))}}function Xi(n,t){var e,r=0,i=n.length-1,u=n[r],o=n[i];return u>o&&(e=r,r=i,i=e,e=u,u=o,o=e),n[r]=t.floor(u),n[i]=t.ceil(o),n}function $i(n){return n?{floor:function(t){return Math.floor(t/n)*n},ceil:function(t){return Math.ceil(t/n)*n}}:Sl}function Bi(n,t,e,r){var i=[],u=[],o=0,a=Math.min(n.length,t.length)-1;for(n[a]2?Bi:Vi,l=r?Wr:Br;return o=i(n,t,l,e),a=i(t,n,l,Mr),u}function u(n){return o(n)}var o,a;return u.invert=function(n){return a(n)},u.domain=function(t){return arguments.length?(n=t.map(Number),i()):n},u.range=function(n){return arguments.length?(t=n,i()):t},u.rangeRound=function(n){return u.range(n).interpolate(Ur)},u.clamp=function(n){return arguments.length?(r=n,i()):r},u.interpolate=function(n){return arguments.length?(e=n,i()):e},u.ticks=function(t){return Qi(n,t)},u.tickFormat=function(t,e){return nu(n,t,e)},u.nice=function(t){return Gi(n,t),i()},u.copy=function(){return Wi(n,t,e,r)},i()}function Ji(n,t){return ao.rebind(n,t,"range","rangeRound","interpolate","clamp")}function Gi(n,t){return Xi(n,$i(Ki(n,t)[2])),Xi(n,$i(Ki(n,t)[2])),n}function Ki(n,t){null==t&&(t=10);var e=Yi(n),r=e[1]-e[0],i=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),u=t/r*i;return.15>=u?i*=10:.35>=u?i*=5:.75>=u&&(i*=2),e[0]=Math.ceil(e[0]/i)*i,e[1]=Math.floor(e[1]/i)*i+.5*i,e[2]=i,e}function Qi(n,t){return ao.range.apply(ao,Ki(n,t))}function nu(n,t,e){var r=Ki(n,t);if(e){var i=ha.exec(e);if(i.shift(),"s"===i[8]){var u=ao.formatPrefix(Math.max(xo(r[0]),xo(r[1])));return i[7]||(i[7]="."+tu(u.scale(r[2]))),i[8]="f",e=ao.format(i.join("")),function(n){return e(u.scale(n))+u.symbol}}i[7]||(i[7]="."+eu(i[8],r)),e=i.join("")}else e=",."+tu(r[2])+"f";return ao.format(e)}function tu(n){return-Math.floor(Math.log(n)/Math.LN10+.01)}function eu(n,t){var e=tu(t[2]);return n in kl?Math.abs(e-tu(Math.max(xo(t[0]),xo(t[1]))))+ +("e"!==n):e-2*("%"===n)}function ru(n,t,e,r){function i(n){return(e?Math.log(0>n?0:n):-Math.log(n>0?0:-n))/Math.log(t)}function u(n){return e?Math.pow(t,n):-Math.pow(t,-n)}function o(t){return n(i(t))}return o.invert=function(t){return u(n.invert(t))},o.domain=function(t){return arguments.length?(e=t[0]>=0,n.domain((r=t.map(Number)).map(i)),o):r},o.base=function(e){return arguments.length?(t=+e,n.domain(r.map(i)),o):t},o.nice=function(){var t=Xi(r.map(i),e?Math:El);return n.domain(t),r=t.map(u),o},o.ticks=function(){var n=Yi(r),o=[],a=n[0],l=n[1],c=Math.floor(i(a)),f=Math.ceil(i(l)),s=t%1?2:t;if(isFinite(f-c)){if(e){for(;f>c;c++)for(var h=1;s>h;h++)o.push(u(c)*h);o.push(u(c))}else for(o.push(u(c));c++0;h--)o.push(u(c)*h);for(c=0;o[c]l;f--);o=o.slice(c,f)}return o},o.tickFormat=function(n,e){if(!arguments.length)return Nl;arguments.length<2?e=Nl:"function"!=typeof e&&(e=ao.format(e));var r=Math.max(1,t*n/o.ticks().length);return function(n){var o=n/u(Math.round(i(n)));return t-.5>o*t&&(o*=t),r>=o?e(n):""}},o.copy=function(){return ru(n.copy(),t,e,r)},Ji(o,n)}function iu(n,t,e){function r(t){return n(i(t))}var i=uu(t),u=uu(1/t);return r.invert=function(t){return u(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain((e=t.map(Number)).map(i)),r):e},r.ticks=function(n){return Qi(e,n)},r.tickFormat=function(n,t){return nu(e,n,t)},r.nice=function(n){return r.domain(Gi(e,n))},r.exponent=function(o){return arguments.length?(i=uu(t=o),u=uu(1/t),n.domain(e.map(i)),r):t},r.copy=function(){return iu(n.copy(),t,e)},Ji(r,n)}function uu(n){return function(t){return 0>t?-Math.pow(-t,n):Math.pow(t,n)}}function ou(n,t){function e(e){return u[((i.get(e)||("range"===t.t?i.set(e,n.push(e)):NaN))-1)%u.length]}function r(t,e){return ao.range(n.length).map(function(n){return t+e*n})}var i,u,o;return e.domain=function(r){if(!arguments.length)return n;n=[],i=new c;for(var u,o=-1,a=r.length;++oe?[NaN,NaN]:[e>0?a[e-1]:n[0],et?NaN:t/u+n,[t,t+1/u]},r.copy=function(){return lu(n,t,e)},i()}function cu(n,t){function e(e){return e>=e?t[ao.bisect(n,e)]:void 0}return e.domain=function(t){return arguments.length?(n=t,e):n},e.range=function(n){return arguments.length?(t=n,e):t},e.invertExtent=function(e){return e=t.indexOf(e),[n[e-1],n[e]]},e.copy=function(){return cu(n,t)},e}function fu(n){function t(n){return+n}return t.invert=t,t.domain=t.range=function(e){return arguments.length?(n=e.map(t),t):n},t.ticks=function(t){return Qi(n,t)},t.tickFormat=function(t,e){return nu(n,t,e)},t.copy=function(){return fu(n)},t}function su(){return 0}function hu(n){return n.innerRadius}function pu(n){return n.outerRadius}function gu(n){return n.startAngle}function vu(n){return n.endAngle}function du(n){return n&&n.padAngle}function yu(n,t,e,r){return(n-e)*t-(t-r)*n>0?0:1}function mu(n,t,e,r,i){var u=n[0]-t[0],o=n[1]-t[1],a=(i?r:-r)/Math.sqrt(u*u+o*o),l=a*o,c=-a*u,f=n[0]+l,s=n[1]+c,h=t[0]+l,p=t[1]+c,g=(f+h)/2,v=(s+p)/2,d=h-f,y=p-s,m=d*d+y*y,M=e-r,x=f*p-h*s,b=(0>y?-1:1)*Math.sqrt(Math.max(0,M*M*m-x*x)),_=(x*y-d*b)/m,w=(-x*d-y*b)/m,S=(x*y+d*b)/m,k=(-x*d+y*b)/m,N=_-g,E=w-v,A=S-g,C=k-v;return N*N+E*E>A*A+C*C&&(_=S,w=k),[[_-l,w-c],[_*e/M,w*e/M]]}function Mu(n){function t(t){function o(){c.push("M",u(n(f),a))}for(var l,c=[],f=[],s=-1,h=t.length,p=En(e),g=En(r);++s1?n.join("L"):n+"Z"}function bu(n){return n.join("L")+"Z"}function _u(n){for(var t=0,e=n.length,r=n[0],i=[r[0],",",r[1]];++t1&&i.push("H",r[0]),i.join("")}function wu(n){for(var t=0,e=n.length,r=n[0],i=[r[0],",",r[1]];++t1){a=t[1],u=n[l],l++,r+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(u[0]-a[0])+","+(u[1]-a[1])+","+u[0]+","+u[1];for(var c=2;c9&&(i=3*t/Math.sqrt(i),o[a]=i*e,o[a+1]=i*r));for(a=-1;++a<=l;)i=(n[Math.min(l,a+1)][0]-n[Math.max(0,a-1)][0])/(6*(1+o[a]*o[a])),u.push([i||0,o[a]*i||0]);return u}function Fu(n){return n.length<3?xu(n):n[0]+Au(n,ju(n))}function Hu(n){for(var t,e,r,i=-1,u=n.length;++i=t?o(n-t):void(f.c=o)}function o(e){var i=g.active,u=g[i];u&&(u.timer.c=null,u.timer.t=NaN,--g.count,delete g[i],u.event&&u.event.interrupt.call(n,n.__data__,u.index));for(var o in g)if(r>+o){var c=g[o];c.timer.c=null,c.timer.t=NaN,--g.count,delete g[o]}f.c=a,qn(function(){return f.c&&a(e||1)&&(f.c=null,f.t=NaN),1},0,l),g.active=r,v.event&&v.event.start.call(n,n.__data__,t),p=[],v.tween.forEach(function(e,r){(r=r.call(n,n.__data__,t))&&p.push(r)}),h=v.ease,s=v.duration}function a(i){for(var u=i/s,o=h(u),a=p.length;a>0;)p[--a].call(n,o);return u>=1?(v.event&&v.event.end.call(n,n.__data__,t),--g.count?delete g[r]:delete n[e],1):void 0}var l,f,s,h,p,g=n[e]||(n[e]={active:0,count:0}),v=g[r];v||(l=i.time,f=qn(u,0,l),v=g[r]={tween:new c,time:l,timer:f,delay:i.delay,duration:i.duration,ease:i.ease,index:t},i=null,++g.count)}function no(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate("+(isFinite(r)?r:e(n))+",0)"})}function to(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate(0,"+(isFinite(r)?r:e(n))+")"})}function eo(n){return n.toISOString()}function ro(n,t,e){function r(t){return n(t)}function i(n,e){var r=n[1]-n[0],i=r/e,u=ao.bisect(Kl,i);return u==Kl.length?[t.year,Ki(n.map(function(n){return n/31536e6}),e)[2]]:u?t[i/Kl[u-1]1?{floor:function(t){for(;e(t=n.floor(t));)t=io(t-1);return t},ceil:function(t){for(;e(t=n.ceil(t));)t=io(+t+1);return t}}:n))},r.ticks=function(n,t){var e=Yi(r.domain()),u=null==n?i(e,10):"number"==typeof n?i(e,n):!n.range&&[{range:n},t];return u&&(n=u[0],t=u[1]),n.range(e[0],io(+e[1]+1),1>t?1:t)},r.tickFormat=function(){return e},r.copy=function(){return ro(n.copy(),t,e)},Ji(r,n)}function io(n){return new Date(n)}function uo(n){return JSON.parse(n.responseText)}function oo(n){var t=fo.createRange();return t.selectNode(fo.body),t.createContextualFragment(n.responseText)}var ao={version:"3.5.17"},lo=[].slice,co=function(n){return lo.call(n)},fo=this.document;if(fo)try{co(fo.documentElement.childNodes)[0].nodeType}catch(so){co=function(n){for(var t=n.length,e=new Array(t);t--;)e[t]=n[t];return e}}if(Date.now||(Date.now=function(){return+new Date}),fo)try{fo.createElement("DIV").style.setProperty("opacity",0,"")}catch(ho){var po=this.Element.prototype,go=po.setAttribute,vo=po.setAttributeNS,yo=this.CSSStyleDeclaration.prototype,mo=yo.setProperty;po.setAttribute=function(n,t){go.call(this,n,t+"")},po.setAttributeNS=function(n,t,e){vo.call(this,n,t,e+"")},yo.setProperty=function(n,t,e){mo.call(this,n,t+"",e)}}ao.ascending=e,ao.descending=function(n,t){return n>t?-1:t>n?1:t>=n?0:NaN},ao.min=function(n,t){var e,r,i=-1,u=n.length;if(1===arguments.length){for(;++i=r){e=r;break}for(;++ir&&(e=r)}else{for(;++i=r){e=r;break}for(;++ir&&(e=r)}return e},ao.max=function(n,t){var e,r,i=-1,u=n.length;if(1===arguments.length){for(;++i=r){e=r;break}for(;++ie&&(e=r)}else{for(;++i=r){e=r;break}for(;++ie&&(e=r)}return e},ao.extent=function(n,t){var e,r,i,u=-1,o=n.length;if(1===arguments.length){for(;++u=r){e=i=r;break}for(;++ur&&(e=r),r>i&&(i=r))}else{for(;++u=r){e=i=r;break}for(;++ur&&(e=r),r>i&&(i=r))}return[e,i]},ao.sum=function(n,t){var e,r=0,u=n.length,o=-1;if(1===arguments.length)for(;++o1?l/(f-1):void 0},ao.deviation=function(){var n=ao.variance.apply(this,arguments);return n?Math.sqrt(n):n};var Mo=u(e);ao.bisectLeft=Mo.left,ao.bisect=ao.bisectRight=Mo.right,ao.bisector=function(n){return u(1===n.length?function(t,r){return e(n(t),r)}:n)},ao.shuffle=function(n,t,e){(u=arguments.length)<3&&(e=n.length,2>u&&(t=0));for(var r,i,u=e-t;u;)i=Math.random()*u--|0,r=n[u+t],n[u+t]=n[i+t],n[i+t]=r;return n},ao.permute=function(n,t){for(var e=t.length,r=new Array(e);e--;)r[e]=n[t[e]];return r},ao.pairs=function(n){for(var t,e=0,r=n.length-1,i=n[0],u=new Array(0>r?0:r);r>e;)u[e]=[t=i,i=n[++e]];return u},ao.transpose=function(n){if(!(i=n.length))return[];for(var t=-1,e=ao.min(n,o),r=new Array(e);++t=0;)for(r=n[i],t=r.length;--t>=0;)e[--o]=r[t];return e};var xo=Math.abs;ao.range=function(n,t,e){if(arguments.length<3&&(e=1,arguments.length<2&&(t=n,n=0)),(t-n)/e===1/0)throw new Error("infinite range");var r,i=[],u=a(xo(e)),o=-1;if(n*=u,t*=u,e*=u,0>e)for(;(r=n+e*++o)>t;)i.push(r/u);else for(;(r=n+e*++o)=u.length)return r?r.call(i,o):e?o.sort(e):o;for(var l,f,s,h,p=-1,g=o.length,v=u[a++],d=new c;++p=u.length)return n;var r=[],i=o[e++];return n.forEach(function(n,i){r.push({key:n,values:t(i,e)})}),i?r.sort(function(n,t){return i(n.key,t.key)}):r}var e,r,i={},u=[],o=[];return i.map=function(t,e){return n(e,t,0)},i.entries=function(e){return t(n(ao.map,e,0),0)},i.key=function(n){return u.push(n),i},i.sortKeys=function(n){return o[u.length-1]=n,i},i.sortValues=function(n){return e=n,i},i.rollup=function(n){return r=n,i},i},ao.set=function(n){var t=new y;if(n)for(var e=0,r=n.length;r>e;++e)t.add(n[e]);return t},l(y,{has:h,add:function(n){return this._[f(n+="")]=!0,n},remove:p,values:g,size:v,empty:d,forEach:function(n){for(var t in this._)n.call(this,s(t))}}),ao.behavior={},ao.rebind=function(n,t){for(var e,r=1,i=arguments.length;++r=0&&(r=n.slice(e+1),n=n.slice(0,e)),n)return arguments.length<2?this[n].on(r):this[n].on(r,t);if(2===arguments.length){if(null==t)for(n in this)this.hasOwnProperty(n)&&this[n].on(r,null);return this}},ao.event=null,ao.requote=function(n){return n.replace(So,"\\$&")};var So=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,ko={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var e in t)n[e]=t[e]},No=function(n,t){return t.querySelector(n)},Eo=function(n,t){return t.querySelectorAll(n)},Ao=function(n,t){var e=n.matches||n[x(n,"matchesSelector")];return(Ao=function(n,t){return e.call(n,t)})(n,t)};"function"==typeof Sizzle&&(No=function(n,t){return Sizzle(n,t)[0]||null},Eo=Sizzle,Ao=Sizzle.matchesSelector),ao.selection=function(){return ao.select(fo.documentElement)};var Co=ao.selection.prototype=[];Co.select=function(n){var t,e,r,i,u=[];n=A(n);for(var o=-1,a=this.length;++o=0&&"xmlns"!==(e=n.slice(0,t))&&(n=n.slice(t+1)),Lo.hasOwnProperty(e)?{space:Lo[e],local:n}:n}},Co.attr=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node();return n=ao.ns.qualify(n),n.local?e.getAttributeNS(n.space,n.local):e.getAttribute(n)}for(t in n)this.each(z(t,n[t]));return this}return this.each(z(n,t))},Co.classed=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node(),r=(n=T(n)).length,i=-1;if(t=e.classList){for(;++ii){if("string"!=typeof n){2>i&&(e="");for(r in n)this.each(P(r,n[r],e));return this}if(2>i){var u=this.node();return t(u).getComputedStyle(u,null).getPropertyValue(n)}r=""}return this.each(P(n,e,r))},Co.property=function(n,t){if(arguments.length<2){if("string"==typeof n)return this.node()[n];for(t in n)this.each(U(t,n[t]));return this}return this.each(U(n,t))},Co.text=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}:null==n?function(){this.textContent=""}:function(){this.textContent=n}):this.node().textContent},Co.html=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}:null==n?function(){this.innerHTML=""}:function(){this.innerHTML=n}):this.node().innerHTML},Co.append=function(n){return n=j(n),this.select(function(){return this.appendChild(n.apply(this,arguments))})},Co.insert=function(n,t){return n=j(n),t=A(t),this.select(function(){return this.insertBefore(n.apply(this,arguments),t.apply(this,arguments)||null)})},Co.remove=function(){return this.each(F)},Co.data=function(n,t){function e(n,e){var r,i,u,o=n.length,s=e.length,h=Math.min(o,s),p=new Array(s),g=new Array(s),v=new Array(o);if(t){var d,y=new c,m=new Array(o);for(r=-1;++rr;++r)g[r]=H(e[r]);for(;o>r;++r)v[r]=n[r]}g.update=p,g.parentNode=p.parentNode=v.parentNode=n.parentNode,a.push(g),l.push(p),f.push(v)}var r,i,u=-1,o=this.length;if(!arguments.length){for(n=new Array(o=(r=this[0]).length);++uu;u++){i.push(t=[]),t.parentNode=(e=this[u]).parentNode;for(var a=0,l=e.length;l>a;a++)(r=e[a])&&n.call(r,r.__data__,a,u)&&t.push(r)}return E(i)},Co.order=function(){for(var n=-1,t=this.length;++n=0;)(e=r[i])&&(u&&u!==e.nextSibling&&u.parentNode.insertBefore(e,u),u=e);return this},Co.sort=function(n){n=I.apply(this,arguments);for(var t=-1,e=this.length;++tn;n++)for(var e=this[n],r=0,i=e.length;i>r;r++){var u=e[r];if(u)return u}return null},Co.size=function(){var n=0;return Y(this,function(){++n}),n};var qo=[];ao.selection.enter=Z,ao.selection.enter.prototype=qo,qo.append=Co.append,qo.empty=Co.empty,qo.node=Co.node,qo.call=Co.call,qo.size=Co.size,qo.select=function(n){for(var t,e,r,i,u,o=[],a=-1,l=this.length;++ar){if("string"!=typeof n){2>r&&(t=!1);for(e in n)this.each(X(e,n[e],t));return this}if(2>r)return(r=this.node()["__on"+n])&&r._;e=!1}return this.each(X(n,t,e))};var To=ao.map({mouseenter:"mouseover",mouseleave:"mouseout"});fo&&To.forEach(function(n){"on"+n in fo&&To.remove(n)});var Ro,Do=0;ao.mouse=function(n){return J(n,k())};var Po=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;ao.touch=function(n,t,e){if(arguments.length<3&&(e=t,t=k().changedTouches),t)for(var r,i=0,u=t.length;u>i;++i)if((r=t[i]).identifier===e)return J(n,r)},ao.behavior.drag=function(){function n(){this.on("mousedown.drag",u).on("touchstart.drag",o)}function e(n,t,e,u,o){return function(){function a(){var n,e,r=t(h,v);r&&(n=r[0]-M[0],e=r[1]-M[1],g|=n|e,M=r,p({type:"drag",x:r[0]+c[0],y:r[1]+c[1],dx:n,dy:e}))}function l(){t(h,v)&&(y.on(u+d,null).on(o+d,null),m(g),p({type:"dragend"}))}var c,f=this,s=ao.event.target.correspondingElement||ao.event.target,h=f.parentNode,p=r.of(f,arguments),g=0,v=n(),d=".drag"+(null==v?"":"-"+v),y=ao.select(e(s)).on(u+d,a).on(o+d,l),m=W(s),M=t(h,v);i?(c=i.apply(f,arguments),c=[c.x-M[0],c.y-M[1]]):c=[0,0],p({type:"dragstart"})}}var r=N(n,"drag","dragstart","dragend"),i=null,u=e(b,ao.mouse,t,"mousemove","mouseup"),o=e(G,ao.touch,m,"touchmove","touchend");return n.origin=function(t){return arguments.length?(i=t,n):i},ao.rebind(n,r,"on")},ao.touches=function(n,t){return arguments.length<2&&(t=k().touches),t?co(t).map(function(t){var e=J(n,t);return e.identifier=t.identifier,e}):[]};var Uo=1e-6,jo=Uo*Uo,Fo=Math.PI,Ho=2*Fo,Oo=Ho-Uo,Io=Fo/2,Yo=Fo/180,Zo=180/Fo,Vo=Math.SQRT2,Xo=2,$o=4;ao.interpolateZoom=function(n,t){var e,r,i=n[0],u=n[1],o=n[2],a=t[0],l=t[1],c=t[2],f=a-i,s=l-u,h=f*f+s*s;if(jo>h)r=Math.log(c/o)/Vo,e=function(n){return[i+n*f,u+n*s,o*Math.exp(Vo*n*r)]};else{var p=Math.sqrt(h),g=(c*c-o*o+$o*h)/(2*o*Xo*p),v=(c*c-o*o-$o*h)/(2*c*Xo*p),d=Math.log(Math.sqrt(g*g+1)-g),y=Math.log(Math.sqrt(v*v+1)-v);r=(y-d)/Vo,e=function(n){var t=n*r,e=rn(d),a=o/(Xo*p)*(e*un(Vo*t+d)-en(d));return[i+a*f,u+a*s,o*e/rn(Vo*t+d)]}}return e.duration=1e3*r,e},ao.behavior.zoom=function(){function n(n){n.on(L,s).on(Wo+".zoom",p).on("dblclick.zoom",g).on(R,h)}function e(n){return[(n[0]-k.x)/k.k,(n[1]-k.y)/k.k]}function r(n){return[n[0]*k.k+k.x,n[1]*k.k+k.y]}function i(n){k.k=Math.max(A[0],Math.min(A[1],n))}function u(n,t){t=r(t),k.x+=n[0]-t[0],k.y+=n[1]-t[1]}function o(t,e,r,o){t.__chart__={x:k.x,y:k.y,k:k.k},i(Math.pow(2,o)),u(d=e,r),t=ao.select(t),C>0&&(t=t.transition().duration(C)),t.call(n.event)}function a(){b&&b.domain(x.range().map(function(n){return(n-k.x)/k.k}).map(x.invert)),w&&w.domain(_.range().map(function(n){return(n-k.y)/k.k}).map(_.invert))}function l(n){z++||n({type:"zoomstart"})}function c(n){a(),n({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function f(n){--z||(n({type:"zoomend"}),d=null)}function s(){function n(){a=1,u(ao.mouse(i),h),c(o)}function r(){s.on(q,null).on(T,null),p(a),f(o)}var i=this,o=D.of(i,arguments),a=0,s=ao.select(t(i)).on(q,n).on(T,r),h=e(ao.mouse(i)),p=W(i);Il.call(i),l(o)}function h(){function n(){var n=ao.touches(g);return p=k.k,n.forEach(function(n){n.identifier in d&&(d[n.identifier]=e(n))}),n}function t(){var t=ao.event.target;ao.select(t).on(x,r).on(b,a),_.push(t);for(var e=ao.event.changedTouches,i=0,u=e.length;u>i;++i)d[e[i].identifier]=null;var l=n(),c=Date.now();if(1===l.length){if(500>c-M){var f=l[0];o(g,f,d[f.identifier],Math.floor(Math.log(k.k)/Math.LN2)+1),S()}M=c}else if(l.length>1){var f=l[0],s=l[1],h=f[0]-s[0],p=f[1]-s[1];y=h*h+p*p}}function r(){var n,t,e,r,o=ao.touches(g);Il.call(g);for(var a=0,l=o.length;l>a;++a,r=null)if(e=o[a],r=d[e.identifier]){if(t)break;n=e,t=r}if(r){var f=(f=e[0]-n[0])*f+(f=e[1]-n[1])*f,s=y&&Math.sqrt(f/y);n=[(n[0]+e[0])/2,(n[1]+e[1])/2],t=[(t[0]+r[0])/2,(t[1]+r[1])/2],i(s*p)}M=null,u(n,t),c(v)}function a(){if(ao.event.touches.length){for(var t=ao.event.changedTouches,e=0,r=t.length;r>e;++e)delete d[t[e].identifier];for(var i in d)return void n()}ao.selectAll(_).on(m,null),w.on(L,s).on(R,h),N(),f(v)}var p,g=this,v=D.of(g,arguments),d={},y=0,m=".zoom-"+ao.event.changedTouches[0].identifier,x="touchmove"+m,b="touchend"+m,_=[],w=ao.select(g),N=W(g);t(),l(v),w.on(L,null).on(R,t)}function p(){var n=D.of(this,arguments);m?clearTimeout(m):(Il.call(this),v=e(d=y||ao.mouse(this)),l(n)),m=setTimeout(function(){m=null,f(n)},50),S(),i(Math.pow(2,.002*Bo())*k.k),u(d,v),c(n)}function g(){var n=ao.mouse(this),t=Math.log(k.k)/Math.LN2;o(this,n,e(n),ao.event.shiftKey?Math.ceil(t)-1:Math.floor(t)+1)}var v,d,y,m,M,x,b,_,w,k={x:0,y:0,k:1},E=[960,500],A=Jo,C=250,z=0,L="mousedown.zoom",q="mousemove.zoom",T="mouseup.zoom",R="touchstart.zoom",D=N(n,"zoomstart","zoom","zoomend");return Wo||(Wo="onwheel"in fo?(Bo=function(){return-ao.event.deltaY*(ao.event.deltaMode?120:1)},"wheel"):"onmousewheel"in fo?(Bo=function(){return ao.event.wheelDelta},"mousewheel"):(Bo=function(){return-ao.event.detail},"MozMousePixelScroll")),n.event=function(n){n.each(function(){var n=D.of(this,arguments),t=k;Hl?ao.select(this).transition().each("start.zoom",function(){k=this.__chart__||{x:0,y:0,k:1},l(n)}).tween("zoom:zoom",function(){var e=E[0],r=E[1],i=d?d[0]:e/2,u=d?d[1]:r/2,o=ao.interpolateZoom([(i-k.x)/k.k,(u-k.y)/k.k,e/k.k],[(i-t.x)/t.k,(u-t.y)/t.k,e/t.k]);return function(t){var r=o(t),a=e/r[2];this.__chart__=k={x:i-r[0]*a,y:u-r[1]*a,k:a},c(n)}}).each("interrupt.zoom",function(){f(n)}).each("end.zoom",function(){f(n)}):(this.__chart__=k,l(n),c(n),f(n))})},n.translate=function(t){return arguments.length?(k={x:+t[0],y:+t[1],k:k.k},a(),n):[k.x,k.y]},n.scale=function(t){return arguments.length?(k={x:k.x,y:k.y,k:null},i(+t),a(),n):k.k},n.scaleExtent=function(t){return arguments.length?(A=null==t?Jo:[+t[0],+t[1]],n):A},n.center=function(t){return arguments.length?(y=t&&[+t[0],+t[1]],n):y},n.size=function(t){return arguments.length?(E=t&&[+t[0],+t[1]],n):E},n.duration=function(t){return arguments.length?(C=+t,n):C},n.x=function(t){return arguments.length?(b=t,x=t.copy(),k={x:0,y:0,k:1},n):b},n.y=function(t){return arguments.length?(w=t,_=t.copy(),k={x:0,y:0,k:1},n):w},ao.rebind(n,D,"on")};var Bo,Wo,Jo=[0,1/0];ao.color=an,an.prototype.toString=function(){return this.rgb()+""},ao.hsl=ln;var Go=ln.prototype=new an;Go.brighter=function(n){return n=Math.pow(.7,arguments.length?n:1),new ln(this.h,this.s,this.l/n)},Go.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new ln(this.h,this.s,n*this.l)},Go.rgb=function(){return cn(this.h,this.s,this.l)},ao.hcl=fn;var Ko=fn.prototype=new an;Ko.brighter=function(n){return new fn(this.h,this.c,Math.min(100,this.l+Qo*(arguments.length?n:1)))},Ko.darker=function(n){return new fn(this.h,this.c,Math.max(0,this.l-Qo*(arguments.length?n:1)))},Ko.rgb=function(){return sn(this.h,this.c,this.l).rgb()},ao.lab=hn;var Qo=18,na=.95047,ta=1,ea=1.08883,ra=hn.prototype=new an;ra.brighter=function(n){return new hn(Math.min(100,this.l+Qo*(arguments.length?n:1)),this.a,this.b)},ra.darker=function(n){return new hn(Math.max(0,this.l-Qo*(arguments.length?n:1)),this.a,this.b)},ra.rgb=function(){return pn(this.l,this.a,this.b)},ao.rgb=mn;var ia=mn.prototype=new an;ia.brighter=function(n){n=Math.pow(.7,arguments.length?n:1);var t=this.r,e=this.g,r=this.b,i=30;return t||e||r?(t&&i>t&&(t=i),e&&i>e&&(e=i),r&&i>r&&(r=i),new mn(Math.min(255,t/n),Math.min(255,e/n),Math.min(255,r/n))):new mn(i,i,i)},ia.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new mn(n*this.r,n*this.g,n*this.b)},ia.hsl=function(){return wn(this.r,this.g,this.b)},ia.toString=function(){return"#"+bn(this.r)+bn(this.g)+bn(this.b)};var ua=ao.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});ua.forEach(function(n,t){ua.set(n,Mn(t))}),ao.functor=En,ao.xhr=An(m),ao.dsv=function(n,t){function e(n,e,u){arguments.length<3&&(u=e,e=null);var o=Cn(n,t,null==e?r:i(e),u);return o.row=function(n){return arguments.length?o.response(null==(e=n)?r:i(n)):e},o}function r(n){return e.parse(n.responseText)}function i(n){return function(t){return e.parse(t.responseText,n)}}function u(t){return t.map(o).join(n)}function o(n){return a.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}var a=new RegExp('["'+n+"\n]"),l=n.charCodeAt(0);return e.parse=function(n,t){var r;return e.parseRows(n,function(n,e){if(r)return r(n,e-1);var i=new Function("d","return {"+n.map(function(n,t){return JSON.stringify(n)+": d["+t+"]"}).join(",")+"}");r=t?function(n,e){return t(i(n),e)}:i})},e.parseRows=function(n,t){function e(){if(f>=c)return o;if(i)return i=!1,u;var t=f;if(34===n.charCodeAt(t)){for(var e=t;e++f;){var r=n.charCodeAt(f++),a=1;if(10===r)i=!0;else if(13===r)i=!0,10===n.charCodeAt(f)&&(++f,++a);else if(r!==l)continue;return n.slice(t,f-a)}return n.slice(t)}for(var r,i,u={},o={},a=[],c=n.length,f=0,s=0;(r=e())!==o;){for(var h=[];r!==u&&r!==o;)h.push(r),r=e();t&&null==(h=t(h,s++))||a.push(h)}return a},e.format=function(t){if(Array.isArray(t[0]))return e.formatRows(t);var r=new y,i=[];return t.forEach(function(n){for(var t in n)r.has(t)||i.push(r.add(t))}),[i.map(o).join(n)].concat(t.map(function(t){return i.map(function(n){return o(t[n])}).join(n)})).join("\n")},e.formatRows=function(n){return n.map(u).join("\n")},e},ao.csv=ao.dsv(",","text/csv"),ao.tsv=ao.dsv(" ","text/tab-separated-values");var oa,aa,la,ca,fa=this[x(this,"requestAnimationFrame")]||function(n){setTimeout(n,17)};ao.timer=function(){qn.apply(this,arguments)},ao.timer.flush=function(){Rn(),Dn()},ao.round=function(n,t){return t?Math.round(n*(t=Math.pow(10,t)))/t:Math.round(n)};var sa=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map(Un);ao.formatPrefix=function(n,t){var e=0;return(n=+n)&&(0>n&&(n*=-1),t&&(n=ao.round(n,Pn(n,t))),e=1+Math.floor(1e-12+Math.log(n)/Math.LN10),e=Math.max(-24,Math.min(24,3*Math.floor((e-1)/3)))),sa[8+e/3]};var ha=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,pa=ao.map({b:function(n){return n.toString(2)},c:function(n){return String.fromCharCode(n)},o:function(n){return n.toString(8)},x:function(n){return n.toString(16)},X:function(n){return n.toString(16).toUpperCase()},g:function(n,t){return n.toPrecision(t)},e:function(n,t){return n.toExponential(t)},f:function(n,t){return n.toFixed(t)},r:function(n,t){return(n=ao.round(n,Pn(n,t))).toFixed(Math.max(0,Math.min(20,Pn(n*(1+1e-15),t))))}}),ga=ao.time={},va=Date;Hn.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){da.setUTCDate.apply(this._,arguments)},setDay:function(){da.setUTCDay.apply(this._,arguments)},setFullYear:function(){da.setUTCFullYear.apply(this._,arguments)},setHours:function(){da.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){da.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){da.setUTCMinutes.apply(this._,arguments)},setMonth:function(){da.setUTCMonth.apply(this._,arguments)},setSeconds:function(){da.setUTCSeconds.apply(this._,arguments)},setTime:function(){da.setTime.apply(this._,arguments)}};var da=Date.prototype;ga.year=On(function(n){return n=ga.day(n),n.setMonth(0,1),n},function(n,t){n.setFullYear(n.getFullYear()+t)},function(n){return n.getFullYear()}),ga.years=ga.year.range,ga.years.utc=ga.year.utc.range,ga.day=On(function(n){var t=new va(2e3,0);return t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),t},function(n,t){n.setDate(n.getDate()+t)},function(n){return n.getDate()-1}),ga.days=ga.day.range,ga.days.utc=ga.day.utc.range,ga.dayOfYear=function(n){var t=ga.year(n);return Math.floor((n-t-6e4*(n.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(n,t){t=7-t;var e=ga[n]=On(function(n){return(n=ga.day(n)).setDate(n.getDate()-(n.getDay()+t)%7),n},function(n,t){n.setDate(n.getDate()+7*Math.floor(t))},function(n){var e=ga.year(n).getDay();return Math.floor((ga.dayOfYear(n)+(e+t)%7)/7)-(e!==t)});ga[n+"s"]=e.range,ga[n+"s"].utc=e.utc.range,ga[n+"OfYear"]=function(n){var e=ga.year(n).getDay();return Math.floor((ga.dayOfYear(n)+(e+t)%7)/7)}}),ga.week=ga.sunday,ga.weeks=ga.sunday.range,ga.weeks.utc=ga.sunday.utc.range,ga.weekOfYear=ga.sundayOfYear;var ya={"-":"",_:" ",0:"0"},ma=/^\s*\d+/,Ma=/^%/;ao.locale=function(n){return{numberFormat:jn(n),timeFormat:Yn(n)}};var xa=ao.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"], -shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});ao.format=xa.numberFormat,ao.geo={},ft.prototype={s:0,t:0,add:function(n){st(n,this.t,ba),st(ba.s,this.s,this),this.s?this.t+=ba.t:this.s=ba.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var ba=new ft;ao.geo.stream=function(n,t){n&&_a.hasOwnProperty(n.type)?_a[n.type](n,t):ht(n,t)};var _a={Feature:function(n,t){ht(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,i=e.length;++rn?4*Fo+n:n,Na.lineStart=Na.lineEnd=Na.point=b}};ao.geo.bounds=function(){function n(n,t){M.push(x=[f=n,h=n]),s>t&&(s=t),t>p&&(p=t)}function t(t,e){var r=dt([t*Yo,e*Yo]);if(y){var i=mt(y,r),u=[i[1],-i[0],0],o=mt(u,i);bt(o),o=_t(o);var l=t-g,c=l>0?1:-1,v=o[0]*Zo*c,d=xo(l)>180;if(d^(v>c*g&&c*t>v)){var m=o[1]*Zo;m>p&&(p=m)}else if(v=(v+360)%360-180,d^(v>c*g&&c*t>v)){var m=-o[1]*Zo;s>m&&(s=m)}else s>e&&(s=e),e>p&&(p=e);d?g>t?a(f,t)>a(f,h)&&(h=t):a(t,h)>a(f,h)&&(f=t):h>=f?(f>t&&(f=t),t>h&&(h=t)):t>g?a(f,t)>a(f,h)&&(h=t):a(t,h)>a(f,h)&&(f=t)}else n(t,e);y=r,g=t}function e(){b.point=t}function r(){x[0]=f,x[1]=h,b.point=n,y=null}function i(n,e){if(y){var r=n-g;m+=xo(r)>180?r+(r>0?360:-360):r}else v=n,d=e;Na.point(n,e),t(n,e)}function u(){Na.lineStart()}function o(){i(v,d),Na.lineEnd(),xo(m)>Uo&&(f=-(h=180)),x[0]=f,x[1]=h,y=null}function a(n,t){return(t-=n)<0?t+360:t}function l(n,t){return n[0]-t[0]}function c(n,t){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:nka?(f=-(h=180),s=-(p=90)):m>Uo?p=90:-Uo>m&&(s=-90),x[0]=f,x[1]=h}};return function(n){p=h=-(f=s=1/0),M=[],ao.geo.stream(n,b);var t=M.length;if(t){M.sort(l);for(var e,r=1,i=M[0],u=[i];t>r;++r)e=M[r],c(e[0],i)||c(e[1],i)?(a(i[0],e[1])>a(i[0],i[1])&&(i[1]=e[1]),a(e[0],i[1])>a(i[0],i[1])&&(i[0]=e[0])):u.push(i=e);for(var o,e,g=-(1/0),t=u.length-1,r=0,i=u[t];t>=r;i=e,++r)e=u[r],(o=a(i[1],e[0]))>g&&(g=o,f=e[0],h=i[1])}return M=x=null,f===1/0||s===1/0?[[NaN,NaN],[NaN,NaN]]:[[f,s],[h,p]]}}(),ao.geo.centroid=function(n){Ea=Aa=Ca=za=La=qa=Ta=Ra=Da=Pa=Ua=0,ao.geo.stream(n,ja);var t=Da,e=Pa,r=Ua,i=t*t+e*e+r*r;return jo>i&&(t=qa,e=Ta,r=Ra,Uo>Aa&&(t=Ca,e=za,r=La),i=t*t+e*e+r*r,jo>i)?[NaN,NaN]:[Math.atan2(e,t)*Zo,tn(r/Math.sqrt(i))*Zo]};var Ea,Aa,Ca,za,La,qa,Ta,Ra,Da,Pa,Ua,ja={sphere:b,point:St,lineStart:Nt,lineEnd:Et,polygonStart:function(){ja.lineStart=At},polygonEnd:function(){ja.lineStart=Nt}},Fa=Rt(zt,jt,Ht,[-Fo,-Fo/2]),Ha=1e9;ao.geo.clipExtent=function(){var n,t,e,r,i,u,o={stream:function(n){return i&&(i.valid=!1),i=u(n),i.valid=!0,i},extent:function(a){return arguments.length?(u=Zt(n=+a[0][0],t=+a[0][1],e=+a[1][0],r=+a[1][1]),i&&(i.valid=!1,i=null),o):[[n,t],[e,r]]}};return o.extent([[0,0],[960,500]])},(ao.geo.conicEqualArea=function(){return Vt(Xt)}).raw=Xt,ao.geo.albers=function(){return ao.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},ao.geo.albersUsa=function(){function n(n){var u=n[0],o=n[1];return t=null,e(u,o),t||(r(u,o),t)||i(u,o),t}var t,e,r,i,u=ao.geo.albers(),o=ao.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),a=ao.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(n,e){t=[n,e]}};return n.invert=function(n){var t=u.scale(),e=u.translate(),r=(n[0]-e[0])/t,i=(n[1]-e[1])/t;return(i>=.12&&.234>i&&r>=-.425&&-.214>r?o:i>=.166&&.234>i&&r>=-.214&&-.115>r?a:u).invert(n)},n.stream=function(n){var t=u.stream(n),e=o.stream(n),r=a.stream(n);return{point:function(n,i){t.point(n,i),e.point(n,i),r.point(n,i)},sphere:function(){t.sphere(),e.sphere(),r.sphere()},lineStart:function(){t.lineStart(),e.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),e.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),e.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),e.polygonEnd(),r.polygonEnd()}}},n.precision=function(t){return arguments.length?(u.precision(t),o.precision(t),a.precision(t),n):u.precision()},n.scale=function(t){return arguments.length?(u.scale(t),o.scale(.35*t),a.scale(t),n.translate(u.translate())):u.scale()},n.translate=function(t){if(!arguments.length)return u.translate();var c=u.scale(),f=+t[0],s=+t[1];return e=u.translate(t).clipExtent([[f-.455*c,s-.238*c],[f+.455*c,s+.238*c]]).stream(l).point,r=o.translate([f-.307*c,s+.201*c]).clipExtent([[f-.425*c+Uo,s+.12*c+Uo],[f-.214*c-Uo,s+.234*c-Uo]]).stream(l).point,i=a.translate([f-.205*c,s+.212*c]).clipExtent([[f-.214*c+Uo,s+.166*c+Uo],[f-.115*c-Uo,s+.234*c-Uo]]).stream(l).point,n},n.scale(1070)};var Oa,Ia,Ya,Za,Va,Xa,$a={point:b,lineStart:b,lineEnd:b,polygonStart:function(){Ia=0,$a.lineStart=$t},polygonEnd:function(){$a.lineStart=$a.lineEnd=$a.point=b,Oa+=xo(Ia/2)}},Ba={point:Bt,lineStart:b,lineEnd:b,polygonStart:b,polygonEnd:b},Wa={point:Gt,lineStart:Kt,lineEnd:Qt,polygonStart:function(){Wa.lineStart=ne},polygonEnd:function(){Wa.point=Gt,Wa.lineStart=Kt,Wa.lineEnd=Qt}};ao.geo.path=function(){function n(n){return n&&("function"==typeof a&&u.pointRadius(+a.apply(this,arguments)),o&&o.valid||(o=i(u)),ao.geo.stream(n,o)),u.result()}function t(){return o=null,n}var e,r,i,u,o,a=4.5;return n.area=function(n){return Oa=0,ao.geo.stream(n,i($a)),Oa},n.centroid=function(n){return Ca=za=La=qa=Ta=Ra=Da=Pa=Ua=0,ao.geo.stream(n,i(Wa)),Ua?[Da/Ua,Pa/Ua]:Ra?[qa/Ra,Ta/Ra]:La?[Ca/La,za/La]:[NaN,NaN]},n.bounds=function(n){return Va=Xa=-(Ya=Za=1/0),ao.geo.stream(n,i(Ba)),[[Ya,Za],[Va,Xa]]},n.projection=function(n){return arguments.length?(i=(e=n)?n.stream||re(n):m,t()):e},n.context=function(n){return arguments.length?(u=null==(r=n)?new Wt:new te(n),"function"!=typeof a&&u.pointRadius(a),t()):r},n.pointRadius=function(t){return arguments.length?(a="function"==typeof t?t:(u.pointRadius(+t),+t),n):a},n.projection(ao.geo.albersUsa()).context(null)},ao.geo.transform=function(n){return{stream:function(t){var e=new ie(t);for(var r in n)e[r]=n[r];return e}}},ie.prototype={point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},ao.geo.projection=oe,ao.geo.projectionMutator=ae,(ao.geo.equirectangular=function(){return oe(ce)}).raw=ce.invert=ce,ao.geo.rotation=function(n){function t(t){return t=n(t[0]*Yo,t[1]*Yo),t[0]*=Zo,t[1]*=Zo,t}return n=se(n[0]%360*Yo,n[1]*Yo,n.length>2?n[2]*Yo:0),t.invert=function(t){return t=n.invert(t[0]*Yo,t[1]*Yo),t[0]*=Zo,t[1]*=Zo,t},t},fe.invert=ce,ao.geo.circle=function(){function n(){var n="function"==typeof r?r.apply(this,arguments):r,t=se(-n[0]*Yo,-n[1]*Yo,0).invert,i=[];return e(null,null,1,{point:function(n,e){i.push(n=t(n,e)),n[0]*=Zo,n[1]*=Zo}}),{type:"Polygon",coordinates:[i]}}var t,e,r=[0,0],i=6;return n.origin=function(t){return arguments.length?(r=t,n):r},n.angle=function(r){return arguments.length?(e=ve((t=+r)*Yo,i*Yo),n):t},n.precision=function(r){return arguments.length?(e=ve(t*Yo,(i=+r)*Yo),n):i},n.angle(90)},ao.geo.distance=function(n,t){var e,r=(t[0]-n[0])*Yo,i=n[1]*Yo,u=t[1]*Yo,o=Math.sin(r),a=Math.cos(r),l=Math.sin(i),c=Math.cos(i),f=Math.sin(u),s=Math.cos(u);return Math.atan2(Math.sqrt((e=s*o)*e+(e=c*f-l*s*a)*e),l*f+c*s*a)},ao.geo.graticule=function(){function n(){return{type:"MultiLineString",coordinates:t()}}function t(){return ao.range(Math.ceil(u/d)*d,i,d).map(h).concat(ao.range(Math.ceil(c/y)*y,l,y).map(p)).concat(ao.range(Math.ceil(r/g)*g,e,g).filter(function(n){return xo(n%d)>Uo}).map(f)).concat(ao.range(Math.ceil(a/v)*v,o,v).filter(function(n){return xo(n%y)>Uo}).map(s))}var e,r,i,u,o,a,l,c,f,s,h,p,g=10,v=g,d=90,y=360,m=2.5;return n.lines=function(){return t().map(function(n){return{type:"LineString",coordinates:n}})},n.outline=function(){return{type:"Polygon",coordinates:[h(u).concat(p(l).slice(1),h(i).reverse().slice(1),p(c).reverse().slice(1))]}},n.extent=function(t){return arguments.length?n.majorExtent(t).minorExtent(t):n.minorExtent()},n.majorExtent=function(t){return arguments.length?(u=+t[0][0],i=+t[1][0],c=+t[0][1],l=+t[1][1],u>i&&(t=u,u=i,i=t),c>l&&(t=c,c=l,l=t),n.precision(m)):[[u,c],[i,l]]},n.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],a=+t[0][1],o=+t[1][1],r>e&&(t=r,r=e,e=t),a>o&&(t=a,a=o,o=t),n.precision(m)):[[r,a],[e,o]]},n.step=function(t){return arguments.length?n.majorStep(t).minorStep(t):n.minorStep()},n.majorStep=function(t){return arguments.length?(d=+t[0],y=+t[1],n):[d,y]},n.minorStep=function(t){return arguments.length?(g=+t[0],v=+t[1],n):[g,v]},n.precision=function(t){return arguments.length?(m=+t,f=ye(a,o,90),s=me(r,e,m),h=ye(c,l,90),p=me(u,i,m),n):m},n.majorExtent([[-180,-90+Uo],[180,90-Uo]]).minorExtent([[-180,-80-Uo],[180,80+Uo]])},ao.geo.greatArc=function(){function n(){return{type:"LineString",coordinates:[t||r.apply(this,arguments),e||i.apply(this,arguments)]}}var t,e,r=Me,i=xe;return n.distance=function(){return ao.geo.distance(t||r.apply(this,arguments),e||i.apply(this,arguments))},n.source=function(e){return arguments.length?(r=e,t="function"==typeof e?null:e,n):r},n.target=function(t){return arguments.length?(i=t,e="function"==typeof t?null:t,n):i},n.precision=function(){return arguments.length?n:0},n},ao.geo.interpolate=function(n,t){return be(n[0]*Yo,n[1]*Yo,t[0]*Yo,t[1]*Yo)},ao.geo.length=function(n){return Ja=0,ao.geo.stream(n,Ga),Ja};var Ja,Ga={sphere:b,point:b,lineStart:_e,lineEnd:b,polygonStart:b,polygonEnd:b},Ka=we(function(n){return Math.sqrt(2/(1+n))},function(n){return 2*Math.asin(n/2)});(ao.geo.azimuthalEqualArea=function(){return oe(Ka)}).raw=Ka;var Qa=we(function(n){var t=Math.acos(n);return t&&t/Math.sin(t)},m);(ao.geo.azimuthalEquidistant=function(){return oe(Qa)}).raw=Qa,(ao.geo.conicConformal=function(){return Vt(Se)}).raw=Se,(ao.geo.conicEquidistant=function(){return Vt(ke)}).raw=ke;var nl=we(function(n){return 1/n},Math.atan);(ao.geo.gnomonic=function(){return oe(nl)}).raw=nl,Ne.invert=function(n,t){return[n,2*Math.atan(Math.exp(t))-Io]},(ao.geo.mercator=function(){return Ee(Ne)}).raw=Ne;var tl=we(function(){return 1},Math.asin);(ao.geo.orthographic=function(){return oe(tl)}).raw=tl;var el=we(function(n){return 1/(1+n)},function(n){return 2*Math.atan(n)});(ao.geo.stereographic=function(){return oe(el)}).raw=el,Ae.invert=function(n,t){return[-t,2*Math.atan(Math.exp(n))-Io]},(ao.geo.transverseMercator=function(){var n=Ee(Ae),t=n.center,e=n.rotate;return n.center=function(n){return n?t([-n[1],n[0]]):(n=t(),[n[1],-n[0]])},n.rotate=function(n){return n?e([n[0],n[1],n.length>2?n[2]+90:90]):(n=e(),[n[0],n[1],n[2]-90])},e([0,0,90])}).raw=Ae,ao.geom={},ao.geom.hull=function(n){function t(n){if(n.length<3)return[];var t,i=En(e),u=En(r),o=n.length,a=[],l=[];for(t=0;o>t;t++)a.push([+i.call(this,n[t],t),+u.call(this,n[t],t),t]);for(a.sort(qe),t=0;o>t;t++)l.push([a[t][0],-a[t][1]]);var c=Le(a),f=Le(l),s=f[0]===c[0],h=f[f.length-1]===c[c.length-1],p=[];for(t=c.length-1;t>=0;--t)p.push(n[a[c[t]][2]]);for(t=+s;t=r&&c.x<=u&&c.y>=i&&c.y<=o?[[r,o],[u,o],[u,i],[r,i]]:[];f.point=n[a]}),t}function e(n){return n.map(function(n,t){return{x:Math.round(u(n,t)/Uo)*Uo,y:Math.round(o(n,t)/Uo)*Uo,i:t}})}var r=Ce,i=ze,u=r,o=i,a=sl;return n?t(n):(t.links=function(n){return ar(e(n)).edges.filter(function(n){return n.l&&n.r}).map(function(t){return{source:n[t.l.i],target:n[t.r.i]}})},t.triangles=function(n){var t=[];return ar(e(n)).cells.forEach(function(e,r){for(var i,u,o=e.site,a=e.edges.sort(Ve),l=-1,c=a.length,f=a[c-1].edge,s=f.l===o?f.r:f.l;++l=c,h=r>=f,p=h<<1|s;n.leaf=!1,n=n.nodes[p]||(n.nodes[p]=hr()),s?i=c:a=c,h?o=f:l=f,u(n,t,e,r,i,o,a,l)}var f,s,h,p,g,v,d,y,m,M=En(a),x=En(l);if(null!=t)v=t,d=e,y=r,m=i;else if(y=m=-(v=d=1/0),s=[],h=[],g=n.length,o)for(p=0;g>p;++p)f=n[p],f.xy&&(y=f.x),f.y>m&&(m=f.y),s.push(f.x),h.push(f.y);else for(p=0;g>p;++p){var b=+M(f=n[p],p),_=+x(f,p);v>b&&(v=b),d>_&&(d=_),b>y&&(y=b),_>m&&(m=_),s.push(b),h.push(_)}var w=y-v,S=m-d;w>S?m=d+w:y=v+S;var k=hr();if(k.add=function(n){u(k,n,+M(n,++p),+x(n,p),v,d,y,m)},k.visit=function(n){pr(n,k,v,d,y,m)},k.find=function(n){return gr(k,n[0],n[1],v,d,y,m)},p=-1,null==t){for(;++p=0?n.slice(0,t):n,r=t>=0?n.slice(t+1):"in";return e=vl.get(e)||gl,r=dl.get(r)||m,br(r(e.apply(null,lo.call(arguments,1))))},ao.interpolateHcl=Rr,ao.interpolateHsl=Dr,ao.interpolateLab=Pr,ao.interpolateRound=Ur,ao.transform=function(n){var t=fo.createElementNS(ao.ns.prefix.svg,"g");return(ao.transform=function(n){if(null!=n){t.setAttribute("transform",n);var e=t.transform.baseVal.consolidate()}return new jr(e?e.matrix:yl)})(n)},jr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var yl={a:1,b:0,c:0,d:1,e:0,f:0};ao.interpolateTransform=$r,ao.layout={},ao.layout.bundle=function(){return function(n){for(var t=[],e=-1,r=n.length;++ea*a/y){if(v>l){var c=t.charge/l;n.px-=u*c,n.py-=o*c}return!0}if(t.point&&l&&v>l){var c=t.pointCharge/l;n.px-=u*c,n.py-=o*c}}return!t.charge}}function t(n){n.px=ao.event.x,n.py=ao.event.y,l.resume()}var e,r,i,u,o,a,l={},c=ao.dispatch("start","tick","end"),f=[1,1],s=.9,h=ml,p=Ml,g=-30,v=xl,d=.1,y=.64,M=[],x=[];return l.tick=function(){if((i*=.99)<.005)return e=null,c.end({type:"end",alpha:i=0}),!0;var t,r,l,h,p,v,y,m,b,_=M.length,w=x.length;for(r=0;w>r;++r)l=x[r],h=l.source,p=l.target,m=p.x-h.x,b=p.y-h.y,(v=m*m+b*b)&&(v=i*o[r]*((v=Math.sqrt(v))-u[r])/v,m*=v,b*=v,p.x-=m*(y=h.weight+p.weight?h.weight/(h.weight+p.weight):.5),p.y-=b*y,h.x+=m*(y=1-y),h.y+=b*y);if((y=i*d)&&(m=f[0]/2,b=f[1]/2,r=-1,y))for(;++r<_;)l=M[r],l.x+=(m-l.x)*y,l.y+=(b-l.y)*y;if(g)for(ri(t=ao.geom.quadtree(M),i,a),r=-1;++r<_;)(l=M[r]).fixed||t.visit(n(l));for(r=-1;++r<_;)l=M[r],l.fixed?(l.x=l.px,l.y=l.py):(l.x-=(l.px-(l.px=l.x))*s,l.y-=(l.py-(l.py=l.y))*s);c.tick({type:"tick",alpha:i})},l.nodes=function(n){return arguments.length?(M=n,l):M},l.links=function(n){return arguments.length?(x=n,l):x},l.size=function(n){return arguments.length?(f=n,l):f},l.linkDistance=function(n){return arguments.length?(h="function"==typeof n?n:+n,l):h},l.distance=l.linkDistance,l.linkStrength=function(n){return arguments.length?(p="function"==typeof n?n:+n,l):p},l.friction=function(n){return arguments.length?(s=+n,l):s},l.charge=function(n){return arguments.length?(g="function"==typeof n?n:+n,l):g},l.chargeDistance=function(n){return arguments.length?(v=n*n,l):Math.sqrt(v)},l.gravity=function(n){return arguments.length?(d=+n,l):d},l.theta=function(n){return arguments.length?(y=n*n,l):Math.sqrt(y)},l.alpha=function(n){return arguments.length?(n=+n,i?n>0?i=n:(e.c=null,e.t=NaN,e=null,c.end({type:"end",alpha:i=0})):n>0&&(c.start({type:"start",alpha:i=n}),e=qn(l.tick)),l):i},l.start=function(){function n(n,r){if(!e){for(e=new Array(i),l=0;i>l;++l)e[l]=[];for(l=0;c>l;++l){var u=x[l];e[u.source.index].push(u.target),e[u.target.index].push(u.source)}}for(var o,a=e[t],l=-1,f=a.length;++lt;++t)(r=M[t]).index=t,r.weight=0;for(t=0;c>t;++t)r=x[t],"number"==typeof r.source&&(r.source=M[r.source]),"number"==typeof r.target&&(r.target=M[r.target]),++r.source.weight,++r.target.weight;for(t=0;i>t;++t)r=M[t],isNaN(r.x)&&(r.x=n("x",s)),isNaN(r.y)&&(r.y=n("y",v)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(u=[],"function"==typeof h)for(t=0;c>t;++t)u[t]=+h.call(this,x[t],t);else for(t=0;c>t;++t)u[t]=h;if(o=[],"function"==typeof p)for(t=0;c>t;++t)o[t]=+p.call(this,x[t],t);else for(t=0;c>t;++t)o[t]=p;if(a=[],"function"==typeof g)for(t=0;i>t;++t)a[t]=+g.call(this,M[t],t);else for(t=0;i>t;++t)a[t]=g;return l.resume()},l.resume=function(){return l.alpha(.1)},l.stop=function(){return l.alpha(0)},l.drag=function(){return r||(r=ao.behavior.drag().origin(m).on("dragstart.force",Qr).on("drag.force",t).on("dragend.force",ni)),arguments.length?void this.on("mouseover.force",ti).on("mouseout.force",ei).call(r):r},ao.rebind(l,c,"on")};var ml=20,Ml=1,xl=1/0;ao.layout.hierarchy=function(){function n(i){var u,o=[i],a=[];for(i.depth=0;null!=(u=o.pop());)if(a.push(u),(c=e.call(n,u,u.depth))&&(l=c.length)){for(var l,c,f;--l>=0;)o.push(f=c[l]),f.parent=u,f.depth=u.depth+1;r&&(u.value=0),u.children=c}else r&&(u.value=+r.call(n,u,u.depth)||0),delete u.children;return oi(i,function(n){var e,i;t&&(e=n.children)&&e.sort(t),r&&(i=n.parent)&&(i.value+=n.value)}),a}var t=ci,e=ai,r=li;return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(ui(t,function(n){n.children&&(n.value=0)}),oi(t,function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},n},ao.layout.partition=function(){function n(t,e,r,i){var u=t.children;if(t.x=e,t.y=t.depth*i,t.dx=r,t.dy=i,u&&(o=u.length)){var o,a,l,c=-1;for(r=t.value?r/t.value:0;++cs?-1:1),g=ao.sum(c),v=g?(s-l*p)/g:0,d=ao.range(l),y=[];return null!=e&&d.sort(e===bl?function(n,t){return c[t]-c[n]}:function(n,t){return e(o[n],o[t])}),d.forEach(function(n){y[n]={data:o[n],value:a=c[n],startAngle:f,endAngle:f+=a*v+p,padAngle:h}}),y}var t=Number,e=bl,r=0,i=Ho,u=0;return n.value=function(e){return arguments.length?(t=e,n):t},n.sort=function(t){return arguments.length?(e=t,n):e},n.startAngle=function(t){return arguments.length?(r=t,n):r},n.endAngle=function(t){return arguments.length?(i=t,n):i},n.padAngle=function(t){return arguments.length?(u=t,n):u},n};var bl={};ao.layout.stack=function(){function n(a,l){if(!(h=a.length))return a;var c=a.map(function(e,r){return t.call(n,e,r)}),f=c.map(function(t){return t.map(function(t,e){return[u.call(n,t,e),o.call(n,t,e)]})}),s=e.call(n,f,l);c=ao.permute(c,s),f=ao.permute(f,s);var h,p,g,v,d=r.call(n,f,l),y=c[0].length;for(g=0;y>g;++g)for(i.call(n,c[0][g],v=d[g],f[0][g][1]),p=1;h>p;++p)i.call(n,c[p][g],v+=f[p-1][g][1],f[p][g][1]);return a}var t=m,e=gi,r=vi,i=pi,u=si,o=hi;return n.values=function(e){return arguments.length?(t=e,n):t},n.order=function(t){return arguments.length?(e="function"==typeof t?t:_l.get(t)||gi,n):e},n.offset=function(t){return arguments.length?(r="function"==typeof t?t:wl.get(t)||vi,n):r},n.x=function(t){return arguments.length?(u=t,n):u},n.y=function(t){return arguments.length?(o=t,n):o},n.out=function(t){return arguments.length?(i=t,n):i},n};var _l=ao.map({"inside-out":function(n){var t,e,r=n.length,i=n.map(di),u=n.map(yi),o=ao.range(r).sort(function(n,t){return i[n]-i[t]}),a=0,l=0,c=[],f=[];for(t=0;r>t;++t)e=o[t],l>a?(a+=u[e],c.push(e)):(l+=u[e],f.push(e));return f.reverse().concat(c)},reverse:function(n){return ao.range(n.length).reverse()},"default":gi}),wl=ao.map({silhouette:function(n){var t,e,r,i=n.length,u=n[0].length,o=[],a=0,l=[];for(e=0;u>e;++e){for(t=0,r=0;i>t;t++)r+=n[t][e][1];r>a&&(a=r),o.push(r)}for(e=0;u>e;++e)l[e]=(a-o[e])/2;return l},wiggle:function(n){var t,e,r,i,u,o,a,l,c,f=n.length,s=n[0],h=s.length,p=[];for(p[0]=l=c=0,e=1;h>e;++e){for(t=0,i=0;f>t;++t)i+=n[t][e][1];for(t=0,u=0,a=s[e][0]-s[e-1][0];f>t;++t){for(r=0,o=(n[t][e][1]-n[t][e-1][1])/(2*a);t>r;++r)o+=(n[r][e][1]-n[r][e-1][1])/a;u+=o*n[t][e][1]}p[e]=l-=i?u/i*a:0,c>l&&(c=l)}for(e=0;h>e;++e)p[e]-=c;return p},expand:function(n){var t,e,r,i=n.length,u=n[0].length,o=1/i,a=[];for(e=0;u>e;++e){for(t=0,r=0;i>t;t++)r+=n[t][e][1];if(r)for(t=0;i>t;t++)n[t][e][1]/=r;else for(t=0;i>t;t++)n[t][e][1]=o}for(e=0;u>e;++e)a[e]=0;return a},zero:vi});ao.layout.histogram=function(){function n(n,u){for(var o,a,l=[],c=n.map(e,this),f=r.call(this,c,u),s=i.call(this,f,c,u),u=-1,h=c.length,p=s.length-1,g=t?1:1/h;++u0)for(u=-1;++u=f[0]&&a<=f[1]&&(o=l[ao.bisect(s,a,1,p)-1],o.y+=g,o.push(n[u]));return l}var t=!0,e=Number,r=bi,i=Mi;return n.value=function(t){return arguments.length?(e=t,n):e},n.range=function(t){return arguments.length?(r=En(t),n):r},n.bins=function(t){return arguments.length?(i="number"==typeof t?function(n){return xi(n,t)}:En(t),n):i},n.frequency=function(e){return arguments.length?(t=!!e,n):t},n},ao.layout.pack=function(){function n(n,u){var o=e.call(this,n,u),a=o[0],l=i[0],c=i[1],f=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(a.x=a.y=0,oi(a,function(n){n.r=+f(n.value)}),oi(a,Ni),r){var s=r*(t?1:Math.max(2*a.r/l,2*a.r/c))/2;oi(a,function(n){n.r+=s}),oi(a,Ni),oi(a,function(n){n.r-=s})}return Ci(a,l/2,c/2,t?1:1/Math.max(2*a.r/l,2*a.r/c)),o}var t,e=ao.layout.hierarchy().sort(_i),r=0,i=[1,1];return n.size=function(t){return arguments.length?(i=t,n):i},n.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,n):t},n.padding=function(t){return arguments.length?(r=+t,n):r},ii(n,e)},ao.layout.tree=function(){function n(n,i){var f=o.call(this,n,i),s=f[0],h=t(s);if(oi(h,e),h.parent.m=-h.z,ui(h,r),c)ui(s,u);else{var p=s,g=s,v=s;ui(s,function(n){n.xg.x&&(g=n),n.depth>v.depth&&(v=n)});var d=a(p,g)/2-p.x,y=l[0]/(g.x+a(g,p)/2+d),m=l[1]/(v.depth||1);ui(s,function(n){n.x=(n.x+d)*y,n.y=n.depth*m})}return f}function t(n){for(var t,e={A:null,children:[n]},r=[e];null!=(t=r.pop());)for(var i,u=t.children,o=0,a=u.length;a>o;++o)r.push((u[o]=i={_:u[o],parent:t,children:(i=u[o].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=i);return e.children[0]}function e(n){var t=n.children,e=n.parent.children,r=n.i?e[n.i-1]:null;if(t.length){Di(n);var u=(t[0].z+t[t.length-1].z)/2;r?(n.z=r.z+a(n._,r._),n.m=n.z-u):n.z=u}else r&&(n.z=r.z+a(n._,r._));n.parent.A=i(n,r,n.parent.A||e[0])}function r(n){n._.x=n.z+n.parent.m,n.m+=n.parent.m}function i(n,t,e){if(t){for(var r,i=n,u=n,o=t,l=i.parent.children[0],c=i.m,f=u.m,s=o.m,h=l.m;o=Ti(o),i=qi(i),o&&i;)l=qi(l),u=Ti(u),u.a=n,r=o.z+s-i.z-c+a(o._,i._),r>0&&(Ri(Pi(o,n,e),n,r),c+=r,f+=r),s+=o.m,c+=i.m,h+=l.m,f+=u.m;o&&!Ti(u)&&(u.t=o,u.m+=s-f),i&&!qi(l)&&(l.t=i,l.m+=c-h,e=n)}return e}function u(n){n.x*=l[0],n.y=n.depth*l[1]}var o=ao.layout.hierarchy().sort(null).value(null),a=Li,l=[1,1],c=null;return n.separation=function(t){return arguments.length?(a=t,n):a},n.size=function(t){return arguments.length?(c=null==(l=t)?u:null,n):c?null:l},n.nodeSize=function(t){return arguments.length?(c=null==(l=t)?null:u,n):c?l:null},ii(n,o)},ao.layout.cluster=function(){function n(n,u){var o,a=t.call(this,n,u),l=a[0],c=0;oi(l,function(n){var t=n.children;t&&t.length?(n.x=ji(t),n.y=Ui(t)):(n.x=o?c+=e(n,o):0,n.y=0,o=n)});var f=Fi(l),s=Hi(l),h=f.x-e(f,s)/2,p=s.x+e(s,f)/2;return oi(l,i?function(n){n.x=(n.x-l.x)*r[0],n.y=(l.y-n.y)*r[1]}:function(n){n.x=(n.x-h)/(p-h)*r[0],n.y=(1-(l.y?n.y/l.y:1))*r[1]}),a}var t=ao.layout.hierarchy().sort(null).value(null),e=Li,r=[1,1],i=!1;return n.separation=function(t){return arguments.length?(e=t,n):e},n.size=function(t){return arguments.length?(i=null==(r=t),n):i?null:r},n.nodeSize=function(t){return arguments.length?(i=null!=(r=t),n):i?r:null},ii(n,t)},ao.layout.treemap=function(){function n(n,t){for(var e,r,i=-1,u=n.length;++it?0:t),e.area=isNaN(r)||0>=r?0:r}function t(e){var u=e.children;if(u&&u.length){var o,a,l,c=s(e),f=[],h=u.slice(),g=1/0,v="slice"===p?c.dx:"dice"===p?c.dy:"slice-dice"===p?1&e.depth?c.dy:c.dx:Math.min(c.dx,c.dy);for(n(h,c.dx*c.dy/e.value),f.area=0;(l=h.length)>0;)f.push(o=h[l-1]),f.area+=o.area,"squarify"!==p||(a=r(f,v))<=g?(h.pop(),g=a):(f.area-=f.pop().area,i(f,v,c,!1),v=Math.min(c.dx,c.dy),f.length=f.area=0,g=1/0);f.length&&(i(f,v,c,!0),f.length=f.area=0),u.forEach(t)}}function e(t){var r=t.children;if(r&&r.length){var u,o=s(t),a=r.slice(),l=[];for(n(a,o.dx*o.dy/t.value),l.area=0;u=a.pop();)l.push(u),l.area+=u.area,null!=u.z&&(i(l,u.z?o.dx:o.dy,o,!a.length),l.length=l.area=0);r.forEach(e)}}function r(n,t){for(var e,r=n.area,i=0,u=1/0,o=-1,a=n.length;++oe&&(u=e),e>i&&(i=e));return r*=r,t*=t,r?Math.max(t*i*g/r,r/(t*u*g)):1/0}function i(n,t,e,r){var i,u=-1,o=n.length,a=e.x,c=e.y,f=t?l(n.area/t):0; -if(t==e.dx){for((r||f>e.dy)&&(f=e.dy);++ue.dx)&&(f=e.dx);++ue&&(t=1),1>e&&(n=0),function(){var e,r,i;do e=2*Math.random()-1,r=2*Math.random()-1,i=e*e+r*r;while(!i||i>1);return n+t*e*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var n=ao.random.normal.apply(ao,arguments);return function(){return Math.exp(n())}},bates:function(n){var t=ao.random.irwinHall(n);return function(){return t()/n}},irwinHall:function(n){return function(){for(var t=0,e=0;n>e;e++)t+=Math.random();return t}}},ao.scale={};var Sl={floor:m,ceil:m};ao.scale.linear=function(){return Wi([0,1],[0,1],Mr,!1)};var kl={s:1,g:1,p:1,r:1,e:1};ao.scale.log=function(){return ru(ao.scale.linear().domain([0,1]),10,!0,[1,10])};var Nl=ao.format(".0e"),El={floor:function(n){return-Math.ceil(-n)},ceil:function(n){return-Math.floor(-n)}};ao.scale.pow=function(){return iu(ao.scale.linear(),1,[0,1])},ao.scale.sqrt=function(){return ao.scale.pow().exponent(.5)},ao.scale.ordinal=function(){return ou([],{t:"range",a:[[]]})},ao.scale.category10=function(){return ao.scale.ordinal().range(Al)},ao.scale.category20=function(){return ao.scale.ordinal().range(Cl)},ao.scale.category20b=function(){return ao.scale.ordinal().range(zl)},ao.scale.category20c=function(){return ao.scale.ordinal().range(Ll)};var Al=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(xn),Cl=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(xn),zl=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(xn),Ll=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(xn);ao.scale.quantile=function(){return au([],[])},ao.scale.quantize=function(){return lu(0,1,[0,1])},ao.scale.threshold=function(){return cu([.5],[0,1])},ao.scale.identity=function(){return fu([0,1])},ao.svg={},ao.svg.arc=function(){function n(){var n=Math.max(0,+e.apply(this,arguments)),c=Math.max(0,+r.apply(this,arguments)),f=o.apply(this,arguments)-Io,s=a.apply(this,arguments)-Io,h=Math.abs(s-f),p=f>s?0:1;if(n>c&&(g=c,c=n,n=g),h>=Oo)return t(c,p)+(n?t(n,1-p):"")+"Z";var g,v,d,y,m,M,x,b,_,w,S,k,N=0,E=0,A=[];if((y=(+l.apply(this,arguments)||0)/2)&&(d=u===ql?Math.sqrt(n*n+c*c):+u.apply(this,arguments),p||(E*=-1),c&&(E=tn(d/c*Math.sin(y))),n&&(N=tn(d/n*Math.sin(y)))),c){m=c*Math.cos(f+E),M=c*Math.sin(f+E),x=c*Math.cos(s-E),b=c*Math.sin(s-E);var C=Math.abs(s-f-2*E)<=Fo?0:1;if(E&&yu(m,M,x,b)===p^C){var z=(f+s)/2;m=c*Math.cos(z),M=c*Math.sin(z),x=b=null}}else m=M=0;if(n){_=n*Math.cos(s-N),w=n*Math.sin(s-N),S=n*Math.cos(f+N),k=n*Math.sin(f+N);var L=Math.abs(f-s+2*N)<=Fo?0:1;if(N&&yu(_,w,S,k)===1-p^L){var q=(f+s)/2;_=n*Math.cos(q),w=n*Math.sin(q),S=k=null}}else _=w=0;if(h>Uo&&(g=Math.min(Math.abs(c-n)/2,+i.apply(this,arguments)))>.001){v=c>n^p?0:1;var T=g,R=g;if(Fo>h){var D=null==S?[_,w]:null==x?[m,M]:Re([m,M],[S,k],[x,b],[_,w]),P=m-D[0],U=M-D[1],j=x-D[0],F=b-D[1],H=1/Math.sin(Math.acos((P*j+U*F)/(Math.sqrt(P*P+U*U)*Math.sqrt(j*j+F*F)))/2),O=Math.sqrt(D[0]*D[0]+D[1]*D[1]);R=Math.min(g,(n-O)/(H-1)),T=Math.min(g,(c-O)/(H+1))}if(null!=x){var I=mu(null==S?[_,w]:[S,k],[m,M],c,T,p),Y=mu([x,b],[_,w],c,T,p);g===T?A.push("M",I[0],"A",T,",",T," 0 0,",v," ",I[1],"A",c,",",c," 0 ",1-p^yu(I[1][0],I[1][1],Y[1][0],Y[1][1]),",",p," ",Y[1],"A",T,",",T," 0 0,",v," ",Y[0]):A.push("M",I[0],"A",T,",",T," 0 1,",v," ",Y[0])}else A.push("M",m,",",M);if(null!=S){var Z=mu([m,M],[S,k],n,-R,p),V=mu([_,w],null==x?[m,M]:[x,b],n,-R,p);g===R?A.push("L",V[0],"A",R,",",R," 0 0,",v," ",V[1],"A",n,",",n," 0 ",p^yu(V[1][0],V[1][1],Z[1][0],Z[1][1]),",",1-p," ",Z[1],"A",R,",",R," 0 0,",v," ",Z[0]):A.push("L",V[0],"A",R,",",R," 0 0,",v," ",Z[0])}else A.push("L",_,",",w)}else A.push("M",m,",",M),null!=x&&A.push("A",c,",",c," 0 ",C,",",p," ",x,",",b),A.push("L",_,",",w),null!=S&&A.push("A",n,",",n," 0 ",L,",",1-p," ",S,",",k);return A.push("Z"),A.join("")}function t(n,t){return"M0,"+n+"A"+n+","+n+" 0 1,"+t+" 0,"+-n+"A"+n+","+n+" 0 1,"+t+" 0,"+n}var e=hu,r=pu,i=su,u=ql,o=gu,a=vu,l=du;return n.innerRadius=function(t){return arguments.length?(e=En(t),n):e},n.outerRadius=function(t){return arguments.length?(r=En(t),n):r},n.cornerRadius=function(t){return arguments.length?(i=En(t),n):i},n.padRadius=function(t){return arguments.length?(u=t==ql?ql:En(t),n):u},n.startAngle=function(t){return arguments.length?(o=En(t),n):o},n.endAngle=function(t){return arguments.length?(a=En(t),n):a},n.padAngle=function(t){return arguments.length?(l=En(t),n):l},n.centroid=function(){var n=(+e.apply(this,arguments)+ +r.apply(this,arguments))/2,t=(+o.apply(this,arguments)+ +a.apply(this,arguments))/2-Io;return[Math.cos(t)*n,Math.sin(t)*n]},n};var ql="auto";ao.svg.line=function(){return Mu(m)};var Tl=ao.map({linear:xu,"linear-closed":bu,step:_u,"step-before":wu,"step-after":Su,basis:zu,"basis-open":Lu,"basis-closed":qu,bundle:Tu,cardinal:Eu,"cardinal-open":ku,"cardinal-closed":Nu,monotone:Fu});Tl.forEach(function(n,t){t.key=n,t.closed=/-closed$/.test(n)});var Rl=[0,2/3,1/3,0],Dl=[0,1/3,2/3,0],Pl=[0,1/6,2/3,1/6];ao.svg.line.radial=function(){var n=Mu(Hu);return n.radius=n.x,delete n.x,n.angle=n.y,delete n.y,n},wu.reverse=Su,Su.reverse=wu,ao.svg.area=function(){return Ou(m)},ao.svg.area.radial=function(){var n=Ou(Hu);return n.radius=n.x,delete n.x,n.innerRadius=n.x0,delete n.x0,n.outerRadius=n.x1,delete n.x1,n.angle=n.y,delete n.y,n.startAngle=n.y0,delete n.y0,n.endAngle=n.y1,delete n.y1,n},ao.svg.chord=function(){function n(n,a){var l=t(this,u,n,a),c=t(this,o,n,a);return"M"+l.p0+r(l.r,l.p1,l.a1-l.a0)+(e(l,c)?i(l.r,l.p1,l.r,l.p0):i(l.r,l.p1,c.r,c.p0)+r(c.r,c.p1,c.a1-c.a0)+i(c.r,c.p1,l.r,l.p0))+"Z"}function t(n,t,e,r){var i=t.call(n,e,r),u=a.call(n,i,r),o=l.call(n,i,r)-Io,f=c.call(n,i,r)-Io;return{r:u,a0:o,a1:f,p0:[u*Math.cos(o),u*Math.sin(o)],p1:[u*Math.cos(f),u*Math.sin(f)]}}function e(n,t){return n.a0==t.a0&&n.a1==t.a1}function r(n,t,e){return"A"+n+","+n+" 0 "+ +(e>Fo)+",1 "+t}function i(n,t,e,r){return"Q 0,0 "+r}var u=Me,o=xe,a=Iu,l=gu,c=vu;return n.radius=function(t){return arguments.length?(a=En(t),n):a},n.source=function(t){return arguments.length?(u=En(t),n):u},n.target=function(t){return arguments.length?(o=En(t),n):o},n.startAngle=function(t){return arguments.length?(l=En(t),n):l},n.endAngle=function(t){return arguments.length?(c=En(t),n):c},n},ao.svg.diagonal=function(){function n(n,i){var u=t.call(this,n,i),o=e.call(this,n,i),a=(u.y+o.y)/2,l=[u,{x:u.x,y:a},{x:o.x,y:a},o];return l=l.map(r),"M"+l[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var t=Me,e=xe,r=Yu;return n.source=function(e){return arguments.length?(t=En(e),n):t},n.target=function(t){return arguments.length?(e=En(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},ao.svg.diagonal.radial=function(){var n=ao.svg.diagonal(),t=Yu,e=n.projection;return n.projection=function(n){return arguments.length?e(Zu(t=n)):t},n},ao.svg.symbol=function(){function n(n,r){return(Ul.get(t.call(this,n,r))||$u)(e.call(this,n,r))}var t=Xu,e=Vu;return n.type=function(e){return arguments.length?(t=En(e),n):t},n.size=function(t){return arguments.length?(e=En(t),n):e},n};var Ul=ao.map({circle:$u,cross:function(n){var t=Math.sqrt(n/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(n){var t=Math.sqrt(n/(2*Fl)),e=t*Fl;return"M0,"+-t+"L"+e+",0 0,"+t+" "+-e+",0Z"},square:function(n){var t=Math.sqrt(n)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(n){var t=Math.sqrt(n/jl),e=t*jl/2;return"M0,"+e+"L"+t+","+-e+" "+-t+","+-e+"Z"},"triangle-up":function(n){var t=Math.sqrt(n/jl),e=t*jl/2;return"M0,"+-e+"L"+t+","+e+" "+-t+","+e+"Z"}});ao.svg.symbolTypes=Ul.keys();var jl=Math.sqrt(3),Fl=Math.tan(30*Yo);Co.transition=function(n){for(var t,e,r=Hl||++Zl,i=Ku(n),u=[],o=Ol||{time:Date.now(),ease:Nr,delay:0,duration:250},a=-1,l=this.length;++au;u++){i.push(t=[]);for(var e=this[u],a=0,l=e.length;l>a;a++)(r=e[a])&&n.call(r,r.__data__,a,u)&&t.push(r)}return Wu(i,this.namespace,this.id)},Yl.tween=function(n,t){var e=this.id,r=this.namespace;return arguments.length<2?this.node()[r][e].tween.get(n):Y(this,null==t?function(t){t[r][e].tween.remove(n)}:function(i){i[r][e].tween.set(n,t)})},Yl.attr=function(n,t){function e(){this.removeAttribute(a)}function r(){this.removeAttributeNS(a.space,a.local)}function i(n){return null==n?e:(n+="",function(){var t,e=this.getAttribute(a);return e!==n&&(t=o(e,n),function(n){this.setAttribute(a,t(n))})})}function u(n){return null==n?r:(n+="",function(){var t,e=this.getAttributeNS(a.space,a.local);return e!==n&&(t=o(e,n),function(n){this.setAttributeNS(a.space,a.local,t(n))})})}if(arguments.length<2){for(t in n)this.attr(t,n[t]);return this}var o="transform"==n?$r:Mr,a=ao.ns.qualify(n);return Ju(this,"attr."+n,t,a.local?u:i)},Yl.attrTween=function(n,t){function e(n,e){var r=t.call(this,n,e,this.getAttribute(i));return r&&function(n){this.setAttribute(i,r(n))}}function r(n,e){var r=t.call(this,n,e,this.getAttributeNS(i.space,i.local));return r&&function(n){this.setAttributeNS(i.space,i.local,r(n))}}var i=ao.ns.qualify(n);return this.tween("attr."+n,i.local?r:e)},Yl.style=function(n,e,r){function i(){this.style.removeProperty(n)}function u(e){return null==e?i:(e+="",function(){var i,u=t(this).getComputedStyle(this,null).getPropertyValue(n);return u!==e&&(i=Mr(u,e),function(t){this.style.setProperty(n,i(t),r)})})}var o=arguments.length;if(3>o){if("string"!=typeof n){2>o&&(e="");for(r in n)this.style(r,n[r],e);return this}r=""}return Ju(this,"style."+n,e,u)},Yl.styleTween=function(n,e,r){function i(i,u){var o=e.call(this,i,u,t(this).getComputedStyle(this,null).getPropertyValue(n));return o&&function(t){this.style.setProperty(n,o(t),r)}}return arguments.length<3&&(r=""),this.tween("style."+n,i)},Yl.text=function(n){return Ju(this,"text",n,Gu)},Yl.remove=function(){var n=this.namespace;return this.each("end.transition",function(){var t;this[n].count<2&&(t=this.parentNode)&&t.removeChild(this)})},Yl.ease=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].ease:("function"!=typeof n&&(n=ao.ease.apply(ao,arguments)),Y(this,function(r){r[e][t].ease=n}))},Yl.delay=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].delay:Y(this,"function"==typeof n?function(r,i,u){r[e][t].delay=+n.call(r,r.__data__,i,u)}:(n=+n,function(r){r[e][t].delay=n}))},Yl.duration=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].duration:Y(this,"function"==typeof n?function(r,i,u){r[e][t].duration=Math.max(1,n.call(r,r.__data__,i,u))}:(n=Math.max(1,n),function(r){r[e][t].duration=n}))},Yl.each=function(n,t){var e=this.id,r=this.namespace;if(arguments.length<2){var i=Ol,u=Hl;try{Hl=e,Y(this,function(t,i,u){Ol=t[r][e],n.call(t,t.__data__,i,u)})}finally{Ol=i,Hl=u}}else Y(this,function(i){var u=i[r][e];(u.event||(u.event=ao.dispatch("start","end","interrupt"))).on(n,t)});return this},Yl.transition=function(){for(var n,t,e,r,i=this.id,u=++Zl,o=this.namespace,a=[],l=0,c=this.length;c>l;l++){a.push(n=[]);for(var t=this[l],f=0,s=t.length;s>f;f++)(e=t[f])&&(r=e[o][i],Qu(e,f,o,u,{time:r.time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration})),n.push(e)}return Wu(a,o,u)},ao.svg.axis=function(){function n(n){n.each(function(){var n,c=ao.select(this),f=this.__chart__||e,s=this.__chart__=e.copy(),h=null==l?s.ticks?s.ticks.apply(s,a):s.domain():l,p=null==t?s.tickFormat?s.tickFormat.apply(s,a):m:t,g=c.selectAll(".tick").data(h,s),v=g.enter().insert("g",".domain").attr("class","tick").style("opacity",Uo),d=ao.transition(g.exit()).style("opacity",Uo).remove(),y=ao.transition(g.order()).style("opacity",1),M=Math.max(i,0)+o,x=Zi(s),b=c.selectAll(".domain").data([0]),_=(b.enter().append("path").attr("class","domain"),ao.transition(b));v.append("line"),v.append("text");var w,S,k,N,E=v.select("line"),A=y.select("line"),C=g.select("text").text(p),z=v.select("text"),L=y.select("text"),q="top"===r||"left"===r?-1:1;if("bottom"===r||"top"===r?(n=no,w="x",k="y",S="x2",N="y2",C.attr("dy",0>q?"0em":".71em").style("text-anchor","middle"),_.attr("d","M"+x[0]+","+q*u+"V0H"+x[1]+"V"+q*u)):(n=to,w="y",k="x",S="y2",N="x2",C.attr("dy",".32em").style("text-anchor",0>q?"end":"start"),_.attr("d","M"+q*u+","+x[0]+"H0V"+x[1]+"H"+q*u)),E.attr(N,q*i),z.attr(k,q*M),A.attr(S,0).attr(N,q*i),L.attr(w,0).attr(k,q*M),s.rangeBand){var T=s,R=T.rangeBand()/2;f=s=function(n){return T(n)+R}}else f.rangeBand?f=s:d.call(n,s,f);v.call(n,f,s),y.call(n,s,s)})}var t,e=ao.scale.linear(),r=Vl,i=6,u=6,o=3,a=[10],l=null;return n.scale=function(t){return arguments.length?(e=t,n):e},n.orient=function(t){return arguments.length?(r=t in Xl?t+"":Vl,n):r},n.ticks=function(){return arguments.length?(a=co(arguments),n):a},n.tickValues=function(t){return arguments.length?(l=t,n):l},n.tickFormat=function(e){return arguments.length?(t=e,n):t},n.tickSize=function(t){var e=arguments.length;return e?(i=+t,u=+arguments[e-1],n):i},n.innerTickSize=function(t){return arguments.length?(i=+t,n):i},n.outerTickSize=function(t){return arguments.length?(u=+t,n):u},n.tickPadding=function(t){return arguments.length?(o=+t,n):o},n.tickSubdivide=function(){return arguments.length&&n},n};var Vl="bottom",Xl={top:1,right:1,bottom:1,left:1};ao.svg.brush=function(){function n(t){t.each(function(){var t=ao.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",u).on("touchstart.brush",u),o=t.selectAll(".background").data([0]);o.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),t.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var a=t.selectAll(".resize").data(v,m);a.exit().remove(),a.enter().append("g").attr("class",function(n){return"resize "+n}).style("cursor",function(n){return $l[n]}).append("rect").attr("x",function(n){return/[ew]$/.test(n)?-3:null}).attr("y",function(n){return/^[ns]/.test(n)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),a.style("display",n.empty()?"none":null);var l,s=ao.transition(t),h=ao.transition(o);c&&(l=Zi(c),h.attr("x",l[0]).attr("width",l[1]-l[0]),r(s)),f&&(l=Zi(f),h.attr("y",l[0]).attr("height",l[1]-l[0]),i(s)),e(s)})}function e(n){n.selectAll(".resize").attr("transform",function(n){return"translate("+s[+/e$/.test(n)]+","+h[+/^s/.test(n)]+")"})}function r(n){n.select(".extent").attr("x",s[0]),n.selectAll(".extent,.n>rect,.s>rect").attr("width",s[1]-s[0])}function i(n){n.select(".extent").attr("y",h[0]),n.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function u(){function u(){32==ao.event.keyCode&&(C||(M=null,L[0]-=s[1],L[1]-=h[1],C=2),S())}function v(){32==ao.event.keyCode&&2==C&&(L[0]+=s[1],L[1]+=h[1],C=0,S())}function d(){var n=ao.mouse(b),t=!1;x&&(n[0]+=x[0],n[1]+=x[1]),C||(ao.event.altKey?(M||(M=[(s[0]+s[1])/2,(h[0]+h[1])/2]),L[0]=s[+(n[0]f?(i=r,r=f):i=f),v[0]!=r||v[1]!=i?(e?a=null:o=null,v[0]=r,v[1]=i,!0):void 0}function m(){d(),k.style("pointer-events","all").selectAll(".resize").style("display",n.empty()?"none":null),ao.select("body").style("cursor",null),q.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),z(),w({type:"brushend"})}var M,x,b=this,_=ao.select(ao.event.target),w=l.of(b,arguments),k=ao.select(b),N=_.datum(),E=!/^(n|s)$/.test(N)&&c,A=!/^(e|w)$/.test(N)&&f,C=_.classed("extent"),z=W(b),L=ao.mouse(b),q=ao.select(t(b)).on("keydown.brush",u).on("keyup.brush",v);if(ao.event.changedTouches?q.on("touchmove.brush",d).on("touchend.brush",m):q.on("mousemove.brush",d).on("mouseup.brush",m),k.interrupt().selectAll("*").interrupt(),C)L[0]=s[0]-L[0],L[1]=h[0]-L[1];else if(N){var T=+/w$/.test(N),R=+/^n/.test(N);x=[s[1-T]-L[0],h[1-R]-L[1]],L[0]=s[T],L[1]=h[R]}else ao.event.altKey&&(M=L.slice());k.style("pointer-events","none").selectAll(".resize").style("display",null),ao.select("body").style("cursor",_.style("cursor")),w({type:"brushstart"}),d()}var o,a,l=N(n,"brushstart","brush","brushend"),c=null,f=null,s=[0,0],h=[0,0],p=!0,g=!0,v=Bl[0];return n.event=function(n){n.each(function(){var n=l.of(this,arguments),t={x:s,y:h,i:o,j:a},e=this.__chart__||t;this.__chart__=t,Hl?ao.select(this).transition().each("start.brush",function(){o=e.i,a=e.j,s=e.x,h=e.y,n({type:"brushstart"})}).tween("brush:brush",function(){var e=xr(s,t.x),r=xr(h,t.y);return o=a=null,function(i){s=t.x=e(i),h=t.y=r(i),n({type:"brush",mode:"resize"})}}).each("end.brush",function(){o=t.i,a=t.j,n({type:"brush",mode:"resize"}),n({type:"brushend"})}):(n({type:"brushstart"}),n({type:"brush",mode:"resize"}),n({type:"brushend"}))})},n.x=function(t){return arguments.length?(c=t,v=Bl[!c<<1|!f],n):c},n.y=function(t){return arguments.length?(f=t,v=Bl[!c<<1|!f],n):f},n.clamp=function(t){return arguments.length?(c&&f?(p=!!t[0],g=!!t[1]):c?p=!!t:f&&(g=!!t),n):c&&f?[p,g]:c?p:f?g:null},n.extent=function(t){var e,r,i,u,l;return arguments.length?(c&&(e=t[0],r=t[1],f&&(e=e[0],r=r[0]),o=[e,r],c.invert&&(e=c(e),r=c(r)),e>r&&(l=e,e=r,r=l),e==s[0]&&r==s[1]||(s=[e,r])),f&&(i=t[0],u=t[1],c&&(i=i[1],u=u[1]),a=[i,u],f.invert&&(i=f(i),u=f(u)),i>u&&(l=i,i=u,u=l),i==h[0]&&u==h[1]||(h=[i,u])),n):(c&&(o?(e=o[0],r=o[1]):(e=s[0],r=s[1],c.invert&&(e=c.invert(e),r=c.invert(r)),e>r&&(l=e,e=r,r=l))),f&&(a?(i=a[0],u=a[1]):(i=h[0],u=h[1],f.invert&&(i=f.invert(i),u=f.invert(u)),i>u&&(l=i,i=u,u=l))),c&&f?[[e,i],[r,u]]:c?[e,r]:f&&[i,u])},n.clear=function(){return n.empty()||(s=[0,0],h=[0,0],o=a=null),n},n.empty=function(){return!!c&&s[0]==s[1]||!!f&&h[0]==h[1]},ao.rebind(n,l,"on")};var $l={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Bl=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Wl=ga.format=xa.timeFormat,Jl=Wl.utc,Gl=Jl("%Y-%m-%dT%H:%M:%S.%LZ");Wl.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?eo:Gl,eo.parse=function(n){var t=new Date(n);return isNaN(t)?null:t},eo.toString=Gl.toString,ga.second=On(function(n){return new va(1e3*Math.floor(n/1e3))},function(n,t){n.setTime(n.getTime()+1e3*Math.floor(t))},function(n){return n.getSeconds()}),ga.seconds=ga.second.range,ga.seconds.utc=ga.second.utc.range,ga.minute=On(function(n){return new va(6e4*Math.floor(n/6e4))},function(n,t){n.setTime(n.getTime()+6e4*Math.floor(t))},function(n){return n.getMinutes()}),ga.minutes=ga.minute.range,ga.minutes.utc=ga.minute.utc.range,ga.hour=On(function(n){var t=n.getTimezoneOffset()/60;return new va(36e5*(Math.floor(n/36e5-t)+t))},function(n,t){n.setTime(n.getTime()+36e5*Math.floor(t))},function(n){return n.getHours()}),ga.hours=ga.hour.range,ga.hours.utc=ga.hour.utc.range,ga.month=On(function(n){return n=ga.day(n),n.setDate(1),n},function(n,t){n.setMonth(n.getMonth()+t)},function(n){return n.getMonth()}),ga.months=ga.month.range,ga.months.utc=ga.month.utc.range;var Kl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Ql=[[ga.second,1],[ga.second,5],[ga.second,15],[ga.second,30],[ga.minute,1],[ga.minute,5],[ga.minute,15],[ga.minute,30],[ga.hour,1],[ga.hour,3],[ga.hour,6],[ga.hour,12],[ga.day,1],[ga.day,2],[ga.week,1],[ga.month,1],[ga.month,3],[ga.year,1]],nc=Wl.multi([[".%L",function(n){return n.getMilliseconds()}],[":%S",function(n){return n.getSeconds()}],["%I:%M",function(n){return n.getMinutes()}],["%I %p",function(n){return n.getHours()}],["%a %d",function(n){return n.getDay()&&1!=n.getDate()}],["%b %d",function(n){return 1!=n.getDate()}],["%B",function(n){return n.getMonth()}],["%Y",zt]]),tc={range:function(n,t,e){return ao.range(Math.ceil(n/e)*e,+t,e).map(io)},floor:m,ceil:m};Ql.year=ga.year,ga.scale=function(){return ro(ao.scale.linear(),Ql,nc)};var ec=Ql.map(function(n){return[n[0].utc,n[1]]}),rc=Jl.multi([[".%L",function(n){return n.getUTCMilliseconds()}],[":%S",function(n){return n.getUTCSeconds()}],["%I:%M",function(n){return n.getUTCMinutes()}],["%I %p",function(n){return n.getUTCHours()}],["%a %d",function(n){return n.getUTCDay()&&1!=n.getUTCDate()}],["%b %d",function(n){return 1!=n.getUTCDate()}],["%B",function(n){return n.getUTCMonth()}],["%Y",zt]]);ec.year=ga.year.utc,ga.scale.utc=function(){return ro(ao.scale.linear(),ec,rc)},ao.text=An(function(n){return n.responseText}),ao.json=function(n,t){return Cn(n,"application/json",uo,t)},ao.html=function(n,t){return Cn(n,"text/html",oo,t)},ao.xml=An(function(n){return n.responseXML}),"function"==typeof define&&define.amd?(this.d3=ao,define(ao)):"object"==typeof module&&module.exports?module.exports=ao:this.d3=ao}(); \ No newline at end of file diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/js/file.js b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/js/file.js deleted file mode 100644 index 29cacd4d..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/js/file.js +++ /dev/null @@ -1,62 +0,0 @@ - $(function() { - var $window = $(window) - , $top_link = $('#toplink') - , $body = $('body, html') - , offset = $('#code').offset().top - , hidePopover = function ($target) { - $target.data('popover-hover', false); - - setTimeout(function () { - if (!$target.data('popover-hover')) { - $target.popover('hide'); - } - }, 300); - }; - - $top_link.hide().click(function(event) { - event.preventDefault(); - $body.animate({scrollTop:0}, 800); - }); - - $window.scroll(function() { - if($window.scrollTop() > offset) { - $top_link.fadeIn(); - } else { - $top_link.fadeOut(); - } - }).scroll(); - - $('.popin') - .popover({trigger: 'manual'}) - .on({ - 'mouseenter.popover': function () { - var $target = $(this); - var $container = $target.children().first(); - - $target.data('popover-hover', true); - - // popover already displayed - if ($target.next('.popover').length) { - return; - } - - // show the popover - $container.popover('show'); - - // register mouse events on the popover - $target.next('.popover:not(.popover-initialized)') - .on({ - 'mouseenter': function () { - $target.data('popover-hover', true); - }, - 'mouseleave': function () { - hidePopover($container); - } - }) - .addClass('popover-initialized'); - }, - 'mouseleave.popover': function () { - hidePopover($(this).children().first()); - } - }); - }); diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/js/jquery.min.js b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/js/jquery.min.js deleted file mode 100644 index 2c69bc90..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/js/jquery.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! jQuery v3.6.1 | (c) OpenJS Foundation and other contributors | jquery.org/license */ -!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,y=n.hasOwnProperty,a=y.toString,l=a.call(Object),v={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&v(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!y||!y.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ve(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ye(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ve(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],y=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||y.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||y.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||y.push(".#.+[+~]"),e.querySelectorAll("\\\f"),y.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),y=y.length&&new RegExp(y.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),v=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&v(p,e)?-1:t==C||t.ownerDocument==p&&v(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!y||!y.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),v.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",v.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",v.option=!!ce.lastChild;var ge={thead:[1,"","
      "],col:[2,"","
      "],tr:[2,"","
      "],td:[3,"","
      "],_default:[0,"",""]};function ye(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),v.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="
      ",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(v.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return B(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=_e(v.pixelPosition,function(e,t){if(t)return t=Be(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return B(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0f&&(e=a.render.queue[f]);f++)d=e.generate(),typeof e.callback==typeof Function&&e.callback(d);a.render.queue.splice(0,f),a.render.queue.length?setTimeout(c):(a.dispatch.render_end(),a.render.active=!1)};setTimeout(c)},a.render.active=!1,a.render.queue=[],a.addGraph=function(b){typeof arguments[0]==typeof Function&&(b={generate:arguments[0],callback:arguments[1]}),a.render.queue.push(b),a.render.active||a.render()},"undefined"!=typeof module&&"undefined"!=typeof exports&&(module.exports=a),"undefined"!=typeof window&&(window.nv=a),a.dom.write=function(a){return void 0!==window.fastdom?fastdom.write(a):a()},a.dom.read=function(a){return void 0!==window.fastdom?fastdom.read(a):a()},a.interactiveGuideline=function(){"use strict";function b(l){l.each(function(l){function m(){var a=d3.mouse(this),d=a[0],e=a[1],i=!0,j=!1;if(k&&(d=d3.event.offsetX,e=d3.event.offsetY,"svg"!==d3.event.target.tagName&&(i=!1),d3.event.target.className.baseVal.match("nv-legend")&&(j=!0)),i&&(d-=f.left,e-=f.top),0>d||0>e||d>o||e>p||d3.event.relatedTarget&&void 0===d3.event.relatedTarget.ownerSVGElement||j){if(k&&d3.event.relatedTarget&&void 0===d3.event.relatedTarget.ownerSVGElement&&(void 0===d3.event.relatedTarget.className||d3.event.relatedTarget.className.match(c.nvPointerEventsClass)))return;return h.elementMouseout({mouseX:d,mouseY:e}),b.renderGuideLine(null),void c.hidden(!0)}c.hidden(!1);var l=g.invert(d);h.elementMousemove({mouseX:d,mouseY:e,pointXValue:l}),"dblclick"===d3.event.type&&h.elementDblclick({mouseX:d,mouseY:e,pointXValue:l}),"click"===d3.event.type&&h.elementClick({mouseX:d,mouseY:e,pointXValue:l})}var n=d3.select(this),o=d||960,p=e||400,q=n.selectAll("g.nv-wrap.nv-interactiveLineLayer").data([l]),r=q.enter().append("g").attr("class"," nv-wrap nv-interactiveLineLayer");r.append("g").attr("class","nv-interactiveGuideLine"),j&&(j.on("touchmove",m).on("mousemove",m,!0).on("mouseout",m,!0).on("dblclick",m).on("click",m),b.guideLine=null,b.renderGuideLine=function(c){i&&(b.guideLine&&b.guideLine.attr("x1")===c||a.dom.write(function(){var b=q.select(".nv-interactiveGuideLine").selectAll("line").data(null!=c?[a.utils.NaNtoZero(c)]:[],String);b.enter().append("line").attr("class","nv-guideline").attr("x1",function(a){return a}).attr("x2",function(a){return a}).attr("y1",p).attr("y2",0),b.exit().remove()}))})})}var c=a.models.tooltip();c.duration(0).hideDelay(0)._isInteractiveLayer(!0).hidden(!1);var d=null,e=null,f={left:0,top:0},g=d3.scale.linear(),h=d3.dispatch("elementMousemove","elementMouseout","elementClick","elementDblclick"),i=!0,j=null,k="ActiveXObject"in window;return b.dispatch=h,b.tooltip=c,b.margin=function(a){return arguments.length?(f.top="undefined"!=typeof a.top?a.top:f.top,f.left="undefined"!=typeof a.left?a.left:f.left,b):f},b.width=function(a){return arguments.length?(d=a,b):d},b.height=function(a){return arguments.length?(e=a,b):e},b.xScale=function(a){return arguments.length?(g=a,b):g},b.showGuideLine=function(a){return arguments.length?(i=a,b):i},b.svgContainer=function(a){return arguments.length?(j=a,b):j},b},a.interactiveBisect=function(a,b,c){"use strict";if(!(a instanceof Array))return null;var d;d="function"!=typeof c?function(a){return a.x}:c;var e=function(a,b){return d(a)-b},f=d3.bisector(e).left,g=d3.max([0,f(a,b)-1]),h=d(a[g]);if("undefined"==typeof h&&(h=g),h===b)return g;var i=d3.min([g+1,a.length-1]),j=d(a[i]);return"undefined"==typeof j&&(j=i),Math.abs(j-b)>=Math.abs(h-b)?g:i},a.nearestValueIndex=function(a,b,c){"use strict";var d=1/0,e=null;return a.forEach(function(a,f){var g=Math.abs(b-a);null!=a&&d>=g&&c>g&&(d=g,e=f)}),e},function(){"use strict";a.models.tooltip=function(){function b(){if(k){var a=d3.select(k);"svg"!==a.node().tagName&&(a=a.select("svg"));var b=a.node()?a.attr("viewBox"):null;if(b){b=b.split(" ");var c=parseInt(a.style("width"),10)/b[2];p.left=p.left*c,p.top=p.top*c}}}function c(){if(!n){var a;a=k?k:document.body,n=d3.select(a).append("div").attr("class","nvtooltip "+(j?j:"xy-tooltip")).attr("id",v),n.style("top",0).style("left",0),n.style("opacity",0),n.selectAll("div, table, td, tr").classed(w,!0),n.classed(w,!0),o=n.node()}}function d(){if(r&&B(e)){b();var f=p.left,g=null!==i?i:p.top;return a.dom.write(function(){c();var b=A(e);b&&(o.innerHTML=b),k&&u?a.dom.read(function(){var a=k.getElementsByTagName("svg")[0],b={left:0,top:0};if(a){var c=a.getBoundingClientRect(),d=k.getBoundingClientRect(),e=c.top;if(0>e){var i=k.getBoundingClientRect();e=Math.abs(e)>i.height?0:e}b.top=Math.abs(e-d.top),b.left=Math.abs(c.left-d.left)}f+=k.offsetLeft+b.left-2*k.scrollLeft,g+=k.offsetTop+b.top-2*k.scrollTop,h&&h>0&&(g=Math.floor(g/h)*h),C([f,g])}):C([f,g])}),d}}var e=null,f="w",g=25,h=0,i=null,j=null,k=null,l=!0,m=400,n=null,o=null,p={left:null,top:null},q={left:0,top:0},r=!0,s=100,t=!0,u=!1,v="nvtooltip-"+Math.floor(1e5*Math.random()),w="nv-pointer-events-none",x=function(a){return a},y=function(a){return a},z=function(a){return a},A=function(a){if(null===a)return"";var b=d3.select(document.createElement("table"));if(t){var c=b.selectAll("thead").data([a]).enter().append("thead");c.append("tr").append("td").attr("colspan",3).append("strong").classed("x-value",!0).html(y(a.value))}var d=b.selectAll("tbody").data([a]).enter().append("tbody"),e=d.selectAll("tr").data(function(a){return a.series}).enter().append("tr").classed("highlight",function(a){return a.highlight});e.append("td").classed("legend-color-guide",!0).append("div").style("background-color",function(a){return a.color}),e.append("td").classed("key",!0).html(function(a,b){return z(a.key,b)}),e.append("td").classed("value",!0).html(function(a,b){return x(a.value,b)}),e.selectAll("td").each(function(a){if(a.highlight){var b=d3.scale.linear().domain([0,1]).range(["#fff",a.color]),c=.6;d3.select(this).style("border-bottom-color",b(c)).style("border-top-color",b(c))}});var f=b.node().outerHTML;return void 0!==a.footer&&(f+=""),f},B=function(a){if(a&&a.series){if(a.series instanceof Array)return!!a.series.length;if(a.series instanceof Object)return a.series=[a.series],!0}return!1},C=function(b){o&&a.dom.read(function(){var c,d,e=parseInt(o.offsetHeight,10),h=parseInt(o.offsetWidth,10),i=a.utils.windowSize().width,j=a.utils.windowSize().height,k=window.pageYOffset,p=window.pageXOffset;j=window.innerWidth>=document.body.scrollWidth?j:j-16,i=window.innerHeight>=document.body.scrollHeight?i:i-16;var r,t,u=function(a){var b=d;do isNaN(a.offsetTop)||(b+=a.offsetTop),a=a.offsetParent;while(a);return b},v=function(a){var b=c;do isNaN(a.offsetLeft)||(b+=a.offsetLeft),a=a.offsetParent;while(a);return b};switch(f){case"e":c=b[0]-h-g,d=b[1]-e/2,r=v(o),t=u(o),p>r&&(c=b[0]+g>p?b[0]+g:p-r+c),k>t&&(d=k-t+d),t+e>k+j&&(d=k+j-t+d-e);break;case"w":c=b[0]+g,d=b[1]-e/2,r=v(o),t=u(o),r+h>i&&(c=b[0]-h-g),k>t&&(d=k+5),t+e>k+j&&(d=k+j-t+d-e);break;case"n":c=b[0]-h/2-5,d=b[1]+g,r=v(o),t=u(o),p>r&&(c=p+5),r+h>i&&(c=c-h/2+5),t+e>k+j&&(d=k+j-t+d-e);break;case"s":c=b[0]-h/2,d=b[1]-e-g,r=v(o),t=u(o),p>r&&(c=p+5),r+h>i&&(c=c-h/2+5),k>t&&(d=k);break;case"none":c=b[0],d=b[1]-g,r=v(o),t=u(o)}c-=q.left,d-=q.top;var w=o.getBoundingClientRect(),k=window.pageYOffset||document.documentElement.scrollTop,p=window.pageXOffset||document.documentElement.scrollLeft,x="translate("+(w.left+p)+"px, "+(w.top+k)+"px)",y="translate("+c+"px, "+d+"px)",z=d3.interpolateString(x,y),A=n.style("opacity")<.1;l?n.transition().delay(m).duration(0).style("opacity",0):n.interrupt().transition().duration(A?0:s).styleTween("transform",function(){return z},"important").style("-webkit-transform",y).style("opacity",1)})};return d.nvPointerEventsClass=w,d.options=a.utils.optionsFunc.bind(d),d._options=Object.create({},{duration:{get:function(){return s},set:function(a){s=a}},gravity:{get:function(){return f},set:function(a){f=a}},distance:{get:function(){return g},set:function(a){g=a}},snapDistance:{get:function(){return h},set:function(a){h=a}},classes:{get:function(){return j},set:function(a){j=a}},chartContainer:{get:function(){return k},set:function(a){k=a}},fixedTop:{get:function(){return i},set:function(a){i=a}},enabled:{get:function(){return r},set:function(a){r=a}},hideDelay:{get:function(){return m},set:function(a){m=a}},contentGenerator:{get:function(){return A},set:function(a){A=a}},valueFormatter:{get:function(){return x},set:function(a){x=a}},headerFormatter:{get:function(){return y},set:function(a){y=a}},keyFormatter:{get:function(){return z},set:function(a){z=a}},headerEnabled:{get:function(){return t},set:function(a){t=a}},_isInteractiveLayer:{get:function(){return u},set:function(a){u=!!a}},position:{get:function(){return p},set:function(a){p.left=void 0!==a.left?a.left:p.left,p.top=void 0!==a.top?a.top:p.top}},offset:{get:function(){return q},set:function(a){q.left=void 0!==a.left?a.left:q.left,q.top=void 0!==a.top?a.top:q.top}},hidden:{get:function(){return l},set:function(a){l!=a&&(l=!!a,d())}},data:{get:function(){return e},set:function(a){a.point&&(a.value=a.point.x,a.series=a.series||{},a.series.value=a.point.y,a.series.color=a.point.color||a.series.color),e=a}},tooltipElem:{get:function(){return o},set:function(){}},id:{get:function(){return v},set:function(){}}}),a.utils.initOptions(d),d}}(),a.utils.windowSize=function(){var a={width:640,height:480};return window.innerWidth&&window.innerHeight?(a.width=window.innerWidth,a.height=window.innerHeight,a):"CSS1Compat"==document.compatMode&&document.documentElement&&document.documentElement.offsetWidth?(a.width=document.documentElement.offsetWidth,a.height=document.documentElement.offsetHeight,a):document.body&&document.body.offsetWidth?(a.width=document.body.offsetWidth,a.height=document.body.offsetHeight,a):a},a.utils.windowResize=function(b){return window.addEventListener?window.addEventListener("resize",b):a.log("ERROR: Failed to bind to window.resize with: ",b),{callback:b,clear:function(){window.removeEventListener("resize",b)}}},a.utils.getColor=function(b){if(void 0===b)return a.utils.defaultColor();if(Array.isArray(b)){var c=d3.scale.ordinal().range(b);return function(a,b){var d=void 0===b?a:b;return a.color||c(d)}}return b},a.utils.defaultColor=function(){return a.utils.getColor(d3.scale.category20().range())},a.utils.customTheme=function(a,b,c){b=b||function(a){return a.key},c=c||d3.scale.category20().range();var d=c.length;return function(e){var f=b(e);return"function"==typeof a[f]?a[f]():void 0!==a[f]?a[f]:(d||(d=c.length),d-=1,c[d])}},a.utils.pjax=function(b,c){var d=function(d){d3.html(d,function(d){var e=d3.select(c).node();e.parentNode.replaceChild(d3.select(d).select(c).node(),e),a.utils.pjax(b,c)})};d3.selectAll(b).on("click",function(){history.pushState(this.href,this.textContent,this.href),d(this.href),d3.event.preventDefault()}),d3.select(window).on("popstate",function(){d3.event.state&&d(d3.event.state)})},a.utils.calcApproxTextWidth=function(a){if("function"==typeof a.style&&"function"==typeof a.text){var b=parseInt(a.style("font-size").replace("px",""),10),c=a.text().length;return c*b*.5}return 0},a.utils.NaNtoZero=function(a){return"number"!=typeof a||isNaN(a)||null===a||1/0===a||a===-1/0?0:a},d3.selection.prototype.watchTransition=function(a){var b=[this].concat([].slice.call(arguments,1));return a.transition.apply(a,b)},a.utils.renderWatch=function(b,c){if(!(this instanceof a.utils.renderWatch))return new a.utils.renderWatch(b,c);var d=void 0!==c?c:250,e=[],f=this;this.models=function(a){return a=[].slice.call(arguments,0),a.forEach(function(a){a.__rendered=!1,function(a){a.dispatch.on("renderEnd",function(){a.__rendered=!0,f.renderEnd("model")})}(a),e.indexOf(a)<0&&e.push(a)}),this},this.reset=function(a){void 0!==a&&(d=a),e=[]},this.transition=function(a,b,c){if(b=arguments.length>1?[].slice.call(arguments,1):[],c=b.length>1?b.pop():void 0!==d?d:250,a.__rendered=!1,e.indexOf(a)<0&&e.push(a),0===c)return a.__rendered=!0,a.delay=function(){return this},a.duration=function(){return this},a;a.__rendered=0===a.length?!0:a.every(function(a){return!a.length})?!0:!1;var g=0;return a.transition().duration(c).each(function(){++g}).each("end",function(){0===--g&&(a.__rendered=!0,f.renderEnd.apply(this,b))})},this.renderEnd=function(){e.every(function(a){return a.__rendered})&&(e.forEach(function(a){a.__rendered=!1}),b.renderEnd.apply(this,arguments))}},a.utils.deepExtend=function(b){var c=arguments.length>1?[].slice.call(arguments,1):[];c.forEach(function(c){for(var d in c){var e=b[d]instanceof Array,f="object"==typeof b[d],g="object"==typeof c[d];f&&!e&&g?a.utils.deepExtend(b[d],c[d]):b[d]=c[d]}})},a.utils.state=function(){if(!(this instanceof a.utils.state))return new a.utils.state;var b={},c=function(){},d=function(){return{}},e=null,f=null;this.dispatch=d3.dispatch("change","set"),this.dispatch.on("set",function(a){c(a,!0)}),this.getter=function(a){return d=a,this},this.setter=function(a,b){return b||(b=function(){}),c=function(c,d){a(c),d&&b()},this},this.init=function(b){e=e||{},a.utils.deepExtend(e,b)};var g=function(){var a=d();if(JSON.stringify(a)===JSON.stringify(b))return!1;for(var c in a)void 0===b[c]&&(b[c]={}),b[c]=a[c],f=!0;return!0};this.update=function(){e&&(c(e,!1),e=null),g.call(this)&&this.dispatch.change(b)}},a.utils.optionsFunc=function(a){return a&&d3.map(a).forEach(function(a,b){"function"==typeof this[a]&&this[a](b)}.bind(this)),this},a.utils.calcTicksX=function(b,c){var d=1,e=0;for(e;ed?f:d}return a.log("Requested number of ticks: ",b),a.log("Calculated max values to be: ",d),b=b>d?b=d-1:b,b=1>b?1:b,b=Math.floor(b),a.log("Calculating tick count as: ",b),b},a.utils.calcTicksY=function(b,c){return a.utils.calcTicksX(b,c)},a.utils.initOption=function(a,b){a._calls&&a._calls[b]?a[b]=a._calls[b]:(a[b]=function(c){return arguments.length?(a._overrides[b]=!0,a._options[b]=c,a):a._options[b]},a["_"+b]=function(c){return arguments.length?(a._overrides[b]||(a._options[b]=c),a):a._options[b]})},a.utils.initOptions=function(b){b._overrides=b._overrides||{};var c=Object.getOwnPropertyNames(b._options||{}),d=Object.getOwnPropertyNames(b._calls||{});c=c.concat(d);for(var e in c)a.utils.initOption(b,c[e])},a.utils.inheritOptionsD3=function(a,b,c){a._d3options=c.concat(a._d3options||[]),c.unshift(b),c.unshift(a),d3.rebind.apply(this,c)},a.utils.arrayUnique=function(a){return a.sort().filter(function(b,c){return!c||b!=a[c-1]})},a.utils.symbolMap=d3.map(),a.utils.symbol=function(){function b(b,e){var f=c.call(this,b,e),g=d.call(this,b,e);return-1!==d3.svg.symbolTypes.indexOf(f)?d3.svg.symbol().type(f).size(g)():a.utils.symbolMap.get(f)(g)}var c,d=64;return b.type=function(a){return arguments.length?(c=d3.functor(a),b):c},b.size=function(a){return arguments.length?(d=d3.functor(a),b):d},b},a.utils.inheritOptions=function(b,c){var d=Object.getOwnPropertyNames(c._options||{}),e=Object.getOwnPropertyNames(c._calls||{}),f=c._inherited||[],g=c._d3options||[],h=d.concat(e).concat(f).concat(g);h.unshift(c),h.unshift(b),d3.rebind.apply(this,h),b._inherited=a.utils.arrayUnique(d.concat(e).concat(f).concat(d).concat(b._inherited||[])),b._d3options=a.utils.arrayUnique(g.concat(b._d3options||[]))},a.utils.initSVG=function(a){a.classed({"nvd3-svg":!0})},a.utils.sanitizeHeight=function(a,b){return a||parseInt(b.style("height"),10)||400},a.utils.sanitizeWidth=function(a,b){return a||parseInt(b.style("width"),10)||960},a.utils.availableHeight=function(b,c,d){return a.utils.sanitizeHeight(b,c)-d.top-d.bottom},a.utils.availableWidth=function(b,c,d){return a.utils.sanitizeWidth(b,c)-d.left-d.right},a.utils.noData=function(b,c){var d=b.options(),e=d.margin(),f=d.noData(),g=null==f?["No Data Available."]:[f],h=a.utils.availableHeight(d.height(),c,e),i=a.utils.availableWidth(d.width(),c,e),j=e.left+i/2,k=e.top+h/2;c.selectAll("g").remove();var l=c.selectAll(".nv-noData").data(g);l.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),l.attr("x",j).attr("y",k).text(function(a){return a})},a.models.axis=function(){"use strict";function b(g){return s.reset(),g.each(function(b){var g=d3.select(this);a.utils.initSVG(g);var p=g.selectAll("g.nv-wrap.nv-axis").data([b]),q=p.enter().append("g").attr("class","nvd3 nv-wrap nv-axis"),t=(q.append("g"),p.select("g"));null!==n?c.ticks(n):("top"==c.orient()||"bottom"==c.orient())&&c.ticks(Math.abs(d.range()[1]-d.range()[0])/100),t.watchTransition(s,"axis").call(c),r=r||c.scale();var u=c.tickFormat();null==u&&(u=r.tickFormat());var v=t.selectAll("text.nv-axislabel").data([h||null]);v.exit().remove();var w,x,y;switch(c.orient()){case"top":v.enter().append("text").attr("class","nv-axislabel"),y=d.range().length<2?0:2===d.range().length?d.range()[1]:d.range()[d.range().length-1]+(d.range()[1]-d.range()[0]),v.attr("text-anchor","middle").attr("y",0).attr("x",y/2),i&&(x=p.selectAll("g.nv-axisMaxMin").data(d.domain()),x.enter().append("g").attr("class",function(a,b){return["nv-axisMaxMin","nv-axisMaxMin-x",0==b?"nv-axisMin-x":"nv-axisMax-x"].join(" ")}).append("text"),x.exit().remove(),x.attr("transform",function(b){return"translate("+a.utils.NaNtoZero(d(b))+",0)"}).select("text").attr("dy","-0.5em").attr("y",-c.tickPadding()).attr("text-anchor","middle").text(function(a){var b=u(a);return(""+b).match("NaN")?"":b}),x.watchTransition(s,"min-max top").attr("transform",function(b,c){return"translate("+a.utils.NaNtoZero(d.range()[c])+",0)"}));break;case"bottom":w=o+36;var z=30,A=0,B=t.selectAll("g").select("text"),C="";if(j%360){B.each(function(){var a=this.getBoundingClientRect(),b=a.width;A=a.height,b>z&&(z=b)}),C="rotate("+j+" 0,"+(A/2+c.tickPadding())+")";var D=Math.abs(Math.sin(j*Math.PI/180));w=(D?D*z:z)+30,B.attr("transform",C).style("text-anchor",j%360>0?"start":"end")}v.enter().append("text").attr("class","nv-axislabel"),y=d.range().length<2?0:2===d.range().length?d.range()[1]:d.range()[d.range().length-1]+(d.range()[1]-d.range()[0]),v.attr("text-anchor","middle").attr("y",w).attr("x",y/2),i&&(x=p.selectAll("g.nv-axisMaxMin").data([d.domain()[0],d.domain()[d.domain().length-1]]),x.enter().append("g").attr("class",function(a,b){return["nv-axisMaxMin","nv-axisMaxMin-x",0==b?"nv-axisMin-x":"nv-axisMax-x"].join(" ")}).append("text"),x.exit().remove(),x.attr("transform",function(b){return"translate("+a.utils.NaNtoZero(d(b)+(m?d.rangeBand()/2:0))+",0)"}).select("text").attr("dy",".71em").attr("y",c.tickPadding()).attr("transform",C).style("text-anchor",j?j%360>0?"start":"end":"middle").text(function(a){var b=u(a);return(""+b).match("NaN")?"":b}),x.watchTransition(s,"min-max bottom").attr("transform",function(b){return"translate("+a.utils.NaNtoZero(d(b)+(m?d.rangeBand()/2:0))+",0)"})),l&&B.attr("transform",function(a,b){return"translate(0,"+(b%2==0?"0":"12")+")"});break;case"right":v.enter().append("text").attr("class","nv-axislabel"),v.style("text-anchor",k?"middle":"begin").attr("transform",k?"rotate(90)":"").attr("y",k?-Math.max(e.right,f)+12:-10).attr("x",k?d3.max(d.range())/2:c.tickPadding()),i&&(x=p.selectAll("g.nv-axisMaxMin").data(d.domain()),x.enter().append("g").attr("class",function(a,b){return["nv-axisMaxMin","nv-axisMaxMin-y",0==b?"nv-axisMin-y":"nv-axisMax-y"].join(" ")}).append("text").style("opacity",0),x.exit().remove(),x.attr("transform",function(b){return"translate(0,"+a.utils.NaNtoZero(d(b))+")"}).select("text").attr("dy",".32em").attr("y",0).attr("x",c.tickPadding()).style("text-anchor","start").text(function(a){var b=u(a);return(""+b).match("NaN")?"":b}),x.watchTransition(s,"min-max right").attr("transform",function(b,c){return"translate(0,"+a.utils.NaNtoZero(d.range()[c])+")"}).select("text").style("opacity",1));break;case"left":v.enter().append("text").attr("class","nv-axislabel"),v.style("text-anchor",k?"middle":"end").attr("transform",k?"rotate(-90)":"").attr("y",k?-Math.max(e.left,f)+25-(o||0):-10).attr("x",k?-d3.max(d.range())/2:-c.tickPadding()),i&&(x=p.selectAll("g.nv-axisMaxMin").data(d.domain()),x.enter().append("g").attr("class",function(a,b){return["nv-axisMaxMin","nv-axisMaxMin-y",0==b?"nv-axisMin-y":"nv-axisMax-y"].join(" ")}).append("text").style("opacity",0),x.exit().remove(),x.attr("transform",function(b){return"translate(0,"+a.utils.NaNtoZero(r(b))+")"}).select("text").attr("dy",".32em").attr("y",0).attr("x",-c.tickPadding()).attr("text-anchor","end").text(function(a){var b=u(a);return(""+b).match("NaN")?"":b}),x.watchTransition(s,"min-max right").attr("transform",function(b,c){return"translate(0,"+a.utils.NaNtoZero(d.range()[c])+")"}).select("text").style("opacity",1))}if(v.text(function(a){return a}),!i||"left"!==c.orient()&&"right"!==c.orient()||(t.selectAll("g").each(function(a){d3.select(this).select("text").attr("opacity",1),(d(a)d.range()[0]-10)&&((a>1e-10||-1e-10>a)&&d3.select(this).attr("opacity",0),d3.select(this).select("text").attr("opacity",0))}),d.domain()[0]==d.domain()[1]&&0==d.domain()[0]&&p.selectAll("g.nv-axisMaxMin").style("opacity",function(a,b){return b?0:1})),i&&("top"===c.orient()||"bottom"===c.orient())){var E=[];p.selectAll("g.nv-axisMaxMin").each(function(a,b){try{E.push(b?d(a)-this.getBoundingClientRect().width-4:d(a)+this.getBoundingClientRect().width+4)}catch(c){E.push(b?d(a)-4:d(a)+4)}}),t.selectAll("g").each(function(a){(d(a)E[1])&&(a>1e-10||-1e-10>a?d3.select(this).remove():d3.select(this).select("text").remove())})}t.selectAll(".tick").filter(function(a){return!parseFloat(Math.round(1e5*a)/1e6)&&void 0!==a}).classed("zero",!0),r=d.copy()}),s.renderEnd("axis immediate"),b}var c=d3.svg.axis(),d=d3.scale.linear(),e={top:0,right:0,bottom:0,left:0},f=75,g=60,h=null,i=!0,j=0,k=!0,l=!1,m=!1,n=null,o=0,p=250,q=d3.dispatch("renderEnd");c.scale(d).orient("bottom").tickFormat(function(a){return a});var r,s=a.utils.renderWatch(q,p);return b.axis=c,b.dispatch=q,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{axisLabelDistance:{get:function(){return o},set:function(a){o=a}},staggerLabels:{get:function(){return l},set:function(a){l=a}},rotateLabels:{get:function(){return j},set:function(a){j=a}},rotateYLabel:{get:function(){return k},set:function(a){k=a}},showMaxMin:{get:function(){return i},set:function(a){i=a}},axisLabel:{get:function(){return h},set:function(a){h=a}},height:{get:function(){return g},set:function(a){g=a}},ticks:{get:function(){return n},set:function(a){n=a}},width:{get:function(){return f},set:function(a){f=a}},margin:{get:function(){return e},set:function(a){e.top=void 0!==a.top?a.top:e.top,e.right=void 0!==a.right?a.right:e.right,e.bottom=void 0!==a.bottom?a.bottom:e.bottom,e.left=void 0!==a.left?a.left:e.left}},duration:{get:function(){return p},set:function(a){p=a,s.reset(p)}},scale:{get:function(){return d},set:function(e){d=e,c.scale(d),m="function"==typeof d.rangeBands,a.utils.inheritOptionsD3(b,d,["domain","range","rangeBand","rangeBands"])}}}),a.utils.initOptions(b),a.utils.inheritOptionsD3(b,c,["orient","tickValues","tickSubdivide","tickSize","tickPadding","tickFormat"]),a.utils.inheritOptionsD3(b,d,["domain","range","rangeBand","rangeBands"]),b},a.models.boxPlot=function(){"use strict";function b(l){return v.reset(),l.each(function(b){var l=j-i.left-i.right,p=k-i.top-i.bottom;r=d3.select(this),a.utils.initSVG(r),m.domain(c||b.map(function(a,b){return o(a,b)})).rangeBands(e||[0,l],.1);var w=[];if(!d){var x=d3.min(b.map(function(a){var b=[];return b.push(a.values.Q1),a.values.hasOwnProperty("whisker_low")&&null!==a.values.whisker_low&&b.push(a.values.whisker_low),a.values.hasOwnProperty("outliers")&&null!==a.values.outliers&&(b=b.concat(a.values.outliers)),d3.min(b)})),y=d3.max(b.map(function(a){var b=[];return b.push(a.values.Q3),a.values.hasOwnProperty("whisker_high")&&null!==a.values.whisker_high&&b.push(a.values.whisker_high),a.values.hasOwnProperty("outliers")&&null!==a.values.outliers&&(b=b.concat(a.values.outliers)),d3.max(b)}));w=[x,y]}n.domain(d||w),n.range(f||[p,0]),g=g||m,h=h||n.copy().range([n(0),n(0)]);{var z=r.selectAll("g.nv-wrap").data([b]);z.enter().append("g").attr("class","nvd3 nv-wrap")}z.attr("transform","translate("+i.left+","+i.top+")");var A=z.selectAll(".nv-boxplot").data(function(a){return a}),B=A.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6);A.attr("class","nv-boxplot").attr("transform",function(a,b){return"translate("+(m(o(a,b))+.05*m.rangeBand())+", 0)"}).classed("hover",function(a){return a.hover}),A.watchTransition(v,"nv-boxplot: boxplots").style("stroke-opacity",1).style("fill-opacity",.75).delay(function(a,c){return c*t/b.length}).attr("transform",function(a,b){return"translate("+(m(o(a,b))+.05*m.rangeBand())+", 0)"}),A.exit().remove(),B.each(function(a,b){var c=d3.select(this);["low","high"].forEach(function(d){a.values.hasOwnProperty("whisker_"+d)&&null!==a.values["whisker_"+d]&&(c.append("line").style("stroke",a.color?a.color:q(a,b)).attr("class","nv-boxplot-whisker nv-boxplot-"+d),c.append("line").style("stroke",a.color?a.color:q(a,b)).attr("class","nv-boxplot-tick nv-boxplot-"+d))})});var C=A.selectAll(".nv-boxplot-outlier").data(function(a){return a.values.hasOwnProperty("outliers")&&null!==a.values.outliers?a.values.outliers:[]});C.enter().append("circle").style("fill",function(a,b,c){return q(a,c)}).style("stroke",function(a,b,c){return q(a,c)}).on("mouseover",function(a,b,c){d3.select(this).classed("hover",!0),s.elementMouseover({series:{key:a,color:q(a,c)},e:d3.event})}).on("mouseout",function(a,b,c){d3.select(this).classed("hover",!1),s.elementMouseout({series:{key:a,color:q(a,c)},e:d3.event})}).on("mousemove",function(){s.elementMousemove({e:d3.event})}),C.attr("class","nv-boxplot-outlier"),C.watchTransition(v,"nv-boxplot: nv-boxplot-outlier").attr("cx",.45*m.rangeBand()).attr("cy",function(a){return n(a)}).attr("r","3"),C.exit().remove();var D=function(){return null===u?.9*m.rangeBand():Math.min(75,.9*m.rangeBand())},E=function(){return.45*m.rangeBand()-D()/2},F=function(){return.45*m.rangeBand()+D()/2};["low","high"].forEach(function(a){var b="low"===a?"Q1":"Q3";A.select("line.nv-boxplot-whisker.nv-boxplot-"+a).watchTransition(v,"nv-boxplot: boxplots").attr("x1",.45*m.rangeBand()).attr("y1",function(b){return n(b.values["whisker_"+a])}).attr("x2",.45*m.rangeBand()).attr("y2",function(a){return n(a.values[b])}),A.select("line.nv-boxplot-tick.nv-boxplot-"+a).watchTransition(v,"nv-boxplot: boxplots").attr("x1",E).attr("y1",function(b){return n(b.values["whisker_"+a])}).attr("x2",F).attr("y2",function(b){return n(b.values["whisker_"+a])})}),["low","high"].forEach(function(a){B.selectAll(".nv-boxplot-"+a).on("mouseover",function(b,c,d){d3.select(this).classed("hover",!0),s.elementMouseover({series:{key:b.values["whisker_"+a],color:q(b,d)},e:d3.event})}).on("mouseout",function(b,c,d){d3.select(this).classed("hover",!1),s.elementMouseout({series:{key:b.values["whisker_"+a],color:q(b,d)},e:d3.event})}).on("mousemove",function(){s.elementMousemove({e:d3.event})})}),B.append("rect").attr("class","nv-boxplot-box").on("mouseover",function(a,b){d3.select(this).classed("hover",!0),s.elementMouseover({key:a.label,value:a.label,series:[{key:"Q3",value:a.values.Q3,color:a.color||q(a,b)},{key:"Q2",value:a.values.Q2,color:a.color||q(a,b)},{key:"Q1",value:a.values.Q1,color:a.color||q(a,b)}],data:a,index:b,e:d3.event})}).on("mouseout",function(a,b){d3.select(this).classed("hover",!1),s.elementMouseout({key:a.label,value:a.label,series:[{key:"Q3",value:a.values.Q3,color:a.color||q(a,b)},{key:"Q2",value:a.values.Q2,color:a.color||q(a,b)},{key:"Q1",value:a.values.Q1,color:a.color||q(a,b)}],data:a,index:b,e:d3.event})}).on("mousemove",function(){s.elementMousemove({e:d3.event})}),A.select("rect.nv-boxplot-box").watchTransition(v,"nv-boxplot: boxes").attr("y",function(a){return n(a.values.Q3)}).attr("width",D).attr("x",E).attr("height",function(a){return Math.abs(n(a.values.Q3)-n(a.values.Q1))||1}).style("fill",function(a,b){return a.color||q(a,b)}).style("stroke",function(a,b){return a.color||q(a,b)}),B.append("line").attr("class","nv-boxplot-median"),A.select("line.nv-boxplot-median").watchTransition(v,"nv-boxplot: boxplots line").attr("x1",E).attr("y1",function(a){return n(a.values.Q2)}).attr("x2",F).attr("y2",function(a){return n(a.values.Q2)}),g=m.copy(),h=n.copy()}),v.renderEnd("nv-boxplot immediate"),b}var c,d,e,f,g,h,i={top:0,right:0,bottom:0,left:0},j=960,k=500,l=Math.floor(1e4*Math.random()),m=d3.scale.ordinal(),n=d3.scale.linear(),o=function(a){return a.x},p=function(a){return a.y},q=a.utils.defaultColor(),r=null,s=d3.dispatch("elementMouseover","elementMouseout","elementMousemove","renderEnd"),t=250,u=null,v=a.utils.renderWatch(s,t);return b.dispatch=s,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return j},set:function(a){j=a}},height:{get:function(){return k},set:function(a){k=a}},maxBoxWidth:{get:function(){return u},set:function(a){u=a}},x:{get:function(){return o},set:function(a){o=a}},y:{get:function(){return p},set:function(a){p=a}},xScale:{get:function(){return m},set:function(a){m=a}},yScale:{get:function(){return n},set:function(a){n=a}},xDomain:{get:function(){return c},set:function(a){c=a}},yDomain:{get:function(){return d},set:function(a){d=a}},xRange:{get:function(){return e},set:function(a){e=a}},yRange:{get:function(){return f},set:function(a){f=a}},id:{get:function(){return l},set:function(a){l=a}},margin:{get:function(){return i},set:function(a){i.top=void 0!==a.top?a.top:i.top,i.right=void 0!==a.right?a.right:i.right,i.bottom=void 0!==a.bottom?a.bottom:i.bottom,i.left=void 0!==a.left?a.left:i.left}},color:{get:function(){return q},set:function(b){q=a.utils.getColor(b)}},duration:{get:function(){return t},set:function(a){t=a,v.reset(t)}}}),a.utils.initOptions(b),b},a.models.boxPlotChart=function(){"use strict";function b(k){return t.reset(),t.models(e),l&&t.models(f),m&&t.models(g),k.each(function(k){var p=d3.select(this);a.utils.initSVG(p);var t=(i||parseInt(p.style("width"))||960)-h.left-h.right,u=(j||parseInt(p.style("height"))||400)-h.top-h.bottom;if(b.update=function(){r.beforeUpdate(),p.transition().duration(s).call(b)},b.container=this,!(k&&k.length&&k.filter(function(a){return a.values.hasOwnProperty("Q1")&&a.values.hasOwnProperty("Q2")&&a.values.hasOwnProperty("Q3")}).length)){var v=p.selectAll(".nv-noData").data([q]);return v.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),v.attr("x",h.left+t/2).attr("y",h.top+u/2).text(function(a){return a}),b}p.selectAll(".nv-noData").remove(),c=e.xScale(),d=e.yScale().clamp(!0);var w=p.selectAll("g.nv-wrap.nv-boxPlotWithAxes").data([k]),x=w.enter().append("g").attr("class","nvd3 nv-wrap nv-boxPlotWithAxes").append("g"),y=x.append("defs"),z=w.select("g"); -x.append("g").attr("class","nv-x nv-axis"),x.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),x.append("g").attr("class","nv-barsWrap"),z.attr("transform","translate("+h.left+","+h.top+")"),n&&z.select(".nv-y.nv-axis").attr("transform","translate("+t+",0)"),e.width(t).height(u);var A=z.select(".nv-barsWrap").datum(k.filter(function(a){return!a.disabled}));if(A.transition().call(e),y.append("clipPath").attr("id","nv-x-label-clip-"+e.id()).append("rect"),z.select("#nv-x-label-clip-"+e.id()+" rect").attr("width",c.rangeBand()*(o?2:1)).attr("height",16).attr("x",-c.rangeBand()/(o?1:2)),l){f.scale(c).ticks(a.utils.calcTicksX(t/100,k)).tickSize(-u,0),z.select(".nv-x.nv-axis").attr("transform","translate(0,"+d.range()[0]+")"),z.select(".nv-x.nv-axis").call(f);var B=z.select(".nv-x.nv-axis").selectAll("g");o&&B.selectAll("text").attr("transform",function(a,b,c){return"translate(0,"+(c%2==0?"5":"17")+")"})}m&&(g.scale(d).ticks(Math.floor(u/36)).tickSize(-t,0),z.select(".nv-y.nv-axis").call(g)),z.select(".nv-zeroLine line").attr("x1",0).attr("x2",t).attr("y1",d(0)).attr("y2",d(0))}),t.renderEnd("nv-boxplot chart immediate"),b}var c,d,e=a.models.boxPlot(),f=a.models.axis(),g=a.models.axis(),h={top:15,right:10,bottom:50,left:60},i=null,j=null,k=a.utils.getColor(),l=!0,m=!0,n=!1,o=!1,p=a.models.tooltip(),q="No Data Available.",r=d3.dispatch("tooltipShow","tooltipHide","beforeUpdate","renderEnd"),s=250;f.orient("bottom").showMaxMin(!1).tickFormat(function(a){return a}),g.orient(n?"right":"left").tickFormat(d3.format(",.1f")),p.duration(0);var t=a.utils.renderWatch(r,s);return e.dispatch.on("elementMouseover.tooltip",function(a){p.data(a).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(a){p.data(a).hidden(!0)}),e.dispatch.on("elementMousemove.tooltip",function(){p.position({top:d3.event.pageY,left:d3.event.pageX})()}),b.dispatch=r,b.boxplot=e,b.xAxis=f,b.yAxis=g,b.tooltip=p,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return i},set:function(a){i=a}},height:{get:function(){return j},set:function(a){j=a}},staggerLabels:{get:function(){return o},set:function(a){o=a}},showXAxis:{get:function(){return l},set:function(a){l=a}},showYAxis:{get:function(){return m},set:function(a){m=a}},tooltips:{get:function(){return tooltips},set:function(a){tooltips=a}},tooltipContent:{get:function(){return p},set:function(a){p=a}},noData:{get:function(){return q},set:function(a){q=a}},margin:{get:function(){return h},set:function(a){h.top=void 0!==a.top?a.top:h.top,h.right=void 0!==a.right?a.right:h.right,h.bottom=void 0!==a.bottom?a.bottom:h.bottom,h.left=void 0!==a.left?a.left:h.left}},duration:{get:function(){return s},set:function(a){s=a,t.reset(s),e.duration(s),f.duration(s),g.duration(s)}},color:{get:function(){return k},set:function(b){k=a.utils.getColor(b),e.color(k)}},rightAlignYAxis:{get:function(){return n},set:function(a){n=a,g.orient(a?"right":"left")}}}),a.utils.inheritOptions(b,e),a.utils.initOptions(b),b},a.models.bullet=function(){"use strict";function b(d){return d.each(function(b,d){var p=m-c.left-c.right,s=n-c.top-c.bottom;o=d3.select(this),a.utils.initSVG(o);{var t=f.call(this,b,d).slice().sort(d3.descending),u=g.call(this,b,d).slice().sort(d3.descending),v=h.call(this,b,d).slice().sort(d3.descending),w=i.call(this,b,d).slice(),x=j.call(this,b,d).slice(),y=k.call(this,b,d).slice(),z=d3.scale.linear().domain(d3.extent(d3.merge([l,t]))).range(e?[p,0]:[0,p]);this.__chart__||d3.scale.linear().domain([0,1/0]).range(z.range())}this.__chart__=z;var A=d3.min(t),B=d3.max(t),C=t[1],D=o.selectAll("g.nv-wrap.nv-bullet").data([b]),E=D.enter().append("g").attr("class","nvd3 nv-wrap nv-bullet"),F=E.append("g"),G=D.select("g");F.append("rect").attr("class","nv-range nv-rangeMax"),F.append("rect").attr("class","nv-range nv-rangeAvg"),F.append("rect").attr("class","nv-range nv-rangeMin"),F.append("rect").attr("class","nv-measure"),D.attr("transform","translate("+c.left+","+c.top+")");var H=function(a){return Math.abs(z(a)-z(0))},I=function(a){return z(0>a?a:0)};G.select("rect.nv-rangeMax").attr("height",s).attr("width",H(B>0?B:A)).attr("x",I(B>0?B:A)).datum(B>0?B:A),G.select("rect.nv-rangeAvg").attr("height",s).attr("width",H(C)).attr("x",I(C)).datum(C),G.select("rect.nv-rangeMin").attr("height",s).attr("width",H(B)).attr("x",I(B)).attr("width",H(B>0?A:B)).attr("x",I(B>0?A:B)).datum(B>0?A:B),G.select("rect.nv-measure").style("fill",q).attr("height",s/3).attr("y",s/3).attr("width",0>v?z(0)-z(v[0]):z(v[0])-z(0)).attr("x",I(v)).on("mouseover",function(){r.elementMouseover({value:v[0],label:y[0]||"Current",color:d3.select(this).style("fill")})}).on("mousemove",function(){r.elementMousemove({value:v[0],label:y[0]||"Current",color:d3.select(this).style("fill")})}).on("mouseout",function(){r.elementMouseout({value:v[0],label:y[0]||"Current",color:d3.select(this).style("fill")})});var J=s/6,K=u.map(function(a,b){return{value:a,label:x[b]}});F.selectAll("path.nv-markerTriangle").data(K).enter().append("path").attr("class","nv-markerTriangle").attr("transform",function(a){return"translate("+z(a.value)+","+s/2+")"}).attr("d","M0,"+J+"L"+J+","+-J+" "+-J+","+-J+"Z").on("mouseover",function(a){r.elementMouseover({value:a.value,label:a.label||"Previous",color:d3.select(this).style("fill"),pos:[z(a.value),s/2]})}).on("mousemove",function(a){r.elementMousemove({value:a.value,label:a.label||"Previous",color:d3.select(this).style("fill")})}).on("mouseout",function(a){r.elementMouseout({value:a.value,label:a.label||"Previous",color:d3.select(this).style("fill")})}),D.selectAll(".nv-range").on("mouseover",function(a,b){var c=w[b]||(b?1==b?"Mean":"Minimum":"Maximum");r.elementMouseover({value:a,label:c,color:d3.select(this).style("fill")})}).on("mousemove",function(){r.elementMousemove({value:v[0],label:y[0]||"Previous",color:d3.select(this).style("fill")})}).on("mouseout",function(a,b){var c=w[b]||(b?1==b?"Mean":"Minimum":"Maximum");r.elementMouseout({value:a,label:c,color:d3.select(this).style("fill")})})}),b}var c={top:0,right:0,bottom:0,left:0},d="left",e=!1,f=function(a){return a.ranges},g=function(a){return a.markers?a.markers:[0]},h=function(a){return a.measures},i=function(a){return a.rangeLabels?a.rangeLabels:[]},j=function(a){return a.markerLabels?a.markerLabels:[]},k=function(a){return a.measureLabels?a.measureLabels:[]},l=[0],m=380,n=30,o=null,p=null,q=a.utils.getColor(["#1f77b4"]),r=d3.dispatch("elementMouseover","elementMouseout","elementMousemove");return b.dispatch=r,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{ranges:{get:function(){return f},set:function(a){f=a}},markers:{get:function(){return g},set:function(a){g=a}},measures:{get:function(){return h},set:function(a){h=a}},forceX:{get:function(){return l},set:function(a){l=a}},width:{get:function(){return m},set:function(a){m=a}},height:{get:function(){return n},set:function(a){n=a}},tickFormat:{get:function(){return p},set:function(a){p=a}},margin:{get:function(){return c},set:function(a){c.top=void 0!==a.top?a.top:c.top,c.right=void 0!==a.right?a.right:c.right,c.bottom=void 0!==a.bottom?a.bottom:c.bottom,c.left=void 0!==a.left?a.left:c.left}},orient:{get:function(){return d},set:function(a){d=a,e="right"==d||"bottom"==d}},color:{get:function(){return q},set:function(b){q=a.utils.getColor(b)}}}),a.utils.initOptions(b),b},a.models.bulletChart=function(){"use strict";function b(d){return d.each(function(e,o){var p=d3.select(this);a.utils.initSVG(p);var q=a.utils.availableWidth(k,p,g),r=l-g.top-g.bottom;if(b.update=function(){b(d)},b.container=this,!e||!h.call(this,e,o))return a.utils.noData(b,p),b;p.selectAll(".nv-noData").remove();var s=h.call(this,e,o).slice().sort(d3.descending),t=i.call(this,e,o).slice().sort(d3.descending),u=j.call(this,e,o).slice().sort(d3.descending),v=p.selectAll("g.nv-wrap.nv-bulletChart").data([e]),w=v.enter().append("g").attr("class","nvd3 nv-wrap nv-bulletChart"),x=w.append("g"),y=v.select("g");x.append("g").attr("class","nv-bulletWrap"),x.append("g").attr("class","nv-titles"),v.attr("transform","translate("+g.left+","+g.top+")");var z=d3.scale.linear().domain([0,Math.max(s[0],t[0],u[0])]).range(f?[q,0]:[0,q]),A=this.__chart__||d3.scale.linear().domain([0,1/0]).range(z.range());this.__chart__=z;var B=x.select(".nv-titles").append("g").attr("text-anchor","end").attr("transform","translate(-6,"+(l-g.top-g.bottom)/2+")");B.append("text").attr("class","nv-title").text(function(a){return a.title}),B.append("text").attr("class","nv-subtitle").attr("dy","1em").text(function(a){return a.subtitle}),c.width(q).height(r);var C=y.select(".nv-bulletWrap");d3.transition(C).call(c);var D=m||z.tickFormat(q/100),E=y.selectAll("g.nv-tick").data(z.ticks(n?n:q/50),function(a){return this.textContent||D(a)}),F=E.enter().append("g").attr("class","nv-tick").attr("transform",function(a){return"translate("+A(a)+",0)"}).style("opacity",1e-6);F.append("line").attr("y1",r).attr("y2",7*r/6),F.append("text").attr("text-anchor","middle").attr("dy","1em").attr("y",7*r/6).text(D);var G=d3.transition(E).attr("transform",function(a){return"translate("+z(a)+",0)"}).style("opacity",1);G.select("line").attr("y1",r).attr("y2",7*r/6),G.select("text").attr("y",7*r/6),d3.transition(E.exit()).attr("transform",function(a){return"translate("+z(a)+",0)"}).style("opacity",1e-6).remove()}),d3.timer.flush(),b}var c=a.models.bullet(),d=a.models.tooltip(),e="left",f=!1,g={top:5,right:40,bottom:20,left:120},h=function(a){return a.ranges},i=function(a){return a.markers?a.markers:[0]},j=function(a){return a.measures},k=null,l=55,m=null,n=null,o=null,p=d3.dispatch("tooltipShow","tooltipHide");return d.duration(0).headerEnabled(!1),c.dispatch.on("elementMouseover.tooltip",function(a){a.series={key:a.label,value:a.value,color:a.color},d.data(a).hidden(!1)}),c.dispatch.on("elementMouseout.tooltip",function(){d.hidden(!0)}),c.dispatch.on("elementMousemove.tooltip",function(){d.position({top:d3.event.pageY,left:d3.event.pageX})()}),b.bullet=c,b.dispatch=p,b.tooltip=d,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{ranges:{get:function(){return h},set:function(a){h=a}},markers:{get:function(){return i},set:function(a){i=a}},measures:{get:function(){return j},set:function(a){j=a}},width:{get:function(){return k},set:function(a){k=a}},height:{get:function(){return l},set:function(a){l=a}},tickFormat:{get:function(){return m},set:function(a){m=a}},ticks:{get:function(){return n},set:function(a){n=a}},noData:{get:function(){return o},set:function(a){o=a}},tooltips:{get:function(){return d.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),d.enabled(!!b)}},tooltipContent:{get:function(){return d.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),d.contentGenerator(b)}},margin:{get:function(){return g},set:function(a){g.top=void 0!==a.top?a.top:g.top,g.right=void 0!==a.right?a.right:g.right,g.bottom=void 0!==a.bottom?a.bottom:g.bottom,g.left=void 0!==a.left?a.left:g.left}},orient:{get:function(){return e},set:function(a){e=a,f="right"==e||"bottom"==e}}}),a.utils.inheritOptions(b,c),a.utils.initOptions(b),b},a.models.candlestickBar=function(){"use strict";function b(x){return x.each(function(b){c=d3.select(this);var x=a.utils.availableWidth(i,c,h),y=a.utils.availableHeight(j,c,h);a.utils.initSVG(c);var A=x/b[0].values.length*.45;l.domain(d||d3.extent(b[0].values.map(n).concat(t))),l.range(v?f||[.5*x/b[0].values.length,x*(b[0].values.length-.5)/b[0].values.length]:f||[5+A/2,x-A/2-5]),m.domain(e||[d3.min(b[0].values.map(s).concat(u)),d3.max(b[0].values.map(r).concat(u))]).range(g||[y,0]),l.domain()[0]===l.domain()[1]&&l.domain(l.domain()[0]?[l.domain()[0]-.01*l.domain()[0],l.domain()[1]+.01*l.domain()[1]]:[-1,1]),m.domain()[0]===m.domain()[1]&&m.domain(m.domain()[0]?[m.domain()[0]+.01*m.domain()[0],m.domain()[1]-.01*m.domain()[1]]:[-1,1]);var B=d3.select(this).selectAll("g.nv-wrap.nv-candlestickBar").data([b[0].values]),C=B.enter().append("g").attr("class","nvd3 nv-wrap nv-candlestickBar"),D=C.append("defs"),E=C.append("g"),F=B.select("g");E.append("g").attr("class","nv-ticks"),B.attr("transform","translate("+h.left+","+h.top+")"),c.on("click",function(a,b){z.chartClick({data:a,index:b,pos:d3.event,id:k})}),D.append("clipPath").attr("id","nv-chart-clip-path-"+k).append("rect"),B.select("#nv-chart-clip-path-"+k+" rect").attr("width",x).attr("height",y),F.attr("clip-path",w?"url(#nv-chart-clip-path-"+k+")":"");var G=B.select(".nv-ticks").selectAll(".nv-tick").data(function(a){return a});G.exit().remove();{var H=G.enter().append("g").attr("class",function(a,b,c){return(p(a,b)>q(a,b)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+c+"-"+b});H.append("line").attr("class","nv-candlestick-lines").attr("transform",function(a,b){return"translate("+l(n(a,b))+",0)"}).attr("x1",0).attr("y1",function(a,b){return m(r(a,b))}).attr("x2",0).attr("y2",function(a,b){return m(s(a,b))}),H.append("rect").attr("class","nv-candlestick-rects nv-bars").attr("transform",function(a,b){return"translate("+(l(n(a,b))-A/2)+","+(m(o(a,b))-(p(a,b)>q(a,b)?m(q(a,b))-m(p(a,b)):0))+")"}).attr("x",0).attr("y",0).attr("width",A).attr("height",function(a,b){var c=p(a,b),d=q(a,b);return c>d?m(d)-m(c):m(c)-m(d)})}c.selectAll(".nv-candlestick-lines").transition().attr("transform",function(a,b){return"translate("+l(n(a,b))+",0)"}).attr("x1",0).attr("y1",function(a,b){return m(r(a,b))}).attr("x2",0).attr("y2",function(a,b){return m(s(a,b))}),c.selectAll(".nv-candlestick-rects").transition().attr("transform",function(a,b){return"translate("+(l(n(a,b))-A/2)+","+(m(o(a,b))-(p(a,b)>q(a,b)?m(q(a,b))-m(p(a,b)):0))+")"}).attr("x",0).attr("y",0).attr("width",A).attr("height",function(a,b){var c=p(a,b),d=q(a,b);return c>d?m(d)-m(c):m(c)-m(d)})}),b}var c,d,e,f,g,h={top:0,right:0,bottom:0,left:0},i=null,j=null,k=Math.floor(1e4*Math.random()),l=d3.scale.linear(),m=d3.scale.linear(),n=function(a){return a.x},o=function(a){return a.y},p=function(a){return a.open},q=function(a){return a.close},r=function(a){return a.high},s=function(a){return a.low},t=[],u=[],v=!1,w=!0,x=a.utils.defaultColor(),y=!1,z=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState","renderEnd","chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove");return b.highlightPoint=function(a,d){b.clearHighlights(),c.select(".nv-candlestickBar .nv-tick-0-"+a).classed("hover",d)},b.clearHighlights=function(){c.select(".nv-candlestickBar .nv-tick.hover").classed("hover",!1)},b.dispatch=z,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return i},set:function(a){i=a}},height:{get:function(){return j},set:function(a){j=a}},xScale:{get:function(){return l},set:function(a){l=a}},yScale:{get:function(){return m},set:function(a){m=a}},xDomain:{get:function(){return d},set:function(a){d=a}},yDomain:{get:function(){return e},set:function(a){e=a}},xRange:{get:function(){return f},set:function(a){f=a}},yRange:{get:function(){return g},set:function(a){g=a}},forceX:{get:function(){return t},set:function(a){t=a}},forceY:{get:function(){return u},set:function(a){u=a}},padData:{get:function(){return v},set:function(a){v=a}},clipEdge:{get:function(){return w},set:function(a){w=a}},id:{get:function(){return k},set:function(a){k=a}},interactive:{get:function(){return y},set:function(a){y=a}},x:{get:function(){return n},set:function(a){n=a}},y:{get:function(){return o},set:function(a){o=a}},open:{get:function(){return p()},set:function(a){p=a}},close:{get:function(){return q()},set:function(a){q=a}},high:{get:function(){return r},set:function(a){r=a}},low:{get:function(){return s},set:function(a){s=a}},margin:{get:function(){return h},set:function(a){h.top=void 0!=a.top?a.top:h.top,h.right=void 0!=a.right?a.right:h.right,h.bottom=void 0!=a.bottom?a.bottom:h.bottom,h.left=void 0!=a.left?a.left:h.left}},color:{get:function(){return x},set:function(b){x=a.utils.getColor(b)}}}),a.utils.initOptions(b),b},a.models.cumulativeLineChart=function(){"use strict";function b(l){return H.reset(),H.models(f),r&&H.models(g),s&&H.models(h),l.each(function(l){function A(){d3.select(b.container).style("cursor","ew-resize")}function E(){G.x=d3.event.x,G.i=Math.round(F.invert(G.x)),K()}function H(){d3.select(b.container).style("cursor","auto"),y.index=G.i,C.stateChange(y)}function K(){bb.data([G]);var a=b.duration();b.duration(0),b.update(),b.duration(a)}var L=d3.select(this);a.utils.initSVG(L),L.classed("nv-chart-"+x,!0);var M=this,N=a.utils.availableWidth(o,L,m),O=a.utils.availableHeight(p,L,m);if(b.update=function(){0===D?L.call(b):L.transition().duration(D).call(b)},b.container=this,y.setter(J(l),b.update).getter(I(l)).update(),y.disabled=l.map(function(a){return!!a.disabled}),!z){var P;z={};for(P in y)z[P]=y[P]instanceof Array?y[P].slice(0):y[P]}var Q=d3.behavior.drag().on("dragstart",A).on("drag",E).on("dragend",H);if(!(l&&l.length&&l.filter(function(a){return a.values.length}).length))return a.utils.noData(b,L),b;if(L.selectAll(".nv-noData").remove(),d=f.xScale(),e=f.yScale(),w)f.yDomain(null);else{var R=l.filter(function(a){return!a.disabled}).map(function(a){var b=d3.extent(a.values,f.y());return b[0]<-.95&&(b[0]=-.95),[(b[0]-b[1])/(1+b[1]),(b[1]-b[0])/(1+b[0])]}),S=[d3.min(R,function(a){return a[0]}),d3.max(R,function(a){return a[1]})];f.yDomain(S)}F.domain([0,l[0].values.length-1]).range([0,N]).clamp(!0);var l=c(G.i,l),T=v?"none":"all",U=L.selectAll("g.nv-wrap.nv-cumulativeLine").data([l]),V=U.enter().append("g").attr("class","nvd3 nv-wrap nv-cumulativeLine").append("g"),W=U.select("g");if(V.append("g").attr("class","nv-interactive"),V.append("g").attr("class","nv-x nv-axis").style("pointer-events","none"),V.append("g").attr("class","nv-y nv-axis"),V.append("g").attr("class","nv-background"),V.append("g").attr("class","nv-linesWrap").style("pointer-events",T),V.append("g").attr("class","nv-avgLinesWrap").style("pointer-events","none"),V.append("g").attr("class","nv-legendWrap"),V.append("g").attr("class","nv-controlsWrap"),q&&(i.width(N),W.select(".nv-legendWrap").datum(l).call(i),m.top!=i.height()&&(m.top=i.height(),O=a.utils.availableHeight(p,L,m)),W.select(".nv-legendWrap").attr("transform","translate(0,"+-m.top+")")),u){var X=[{key:"Re-scale y-axis",disabled:!w}];j.width(140).color(["#444","#444","#444"]).rightAlign(!1).margin({top:5,right:0,bottom:5,left:20}),W.select(".nv-controlsWrap").datum(X).attr("transform","translate(0,"+-m.top+")").call(j)}U.attr("transform","translate("+m.left+","+m.top+")"),t&&W.select(".nv-y.nv-axis").attr("transform","translate("+N+",0)");var Y=l.filter(function(a){return a.tempDisabled});U.select(".tempDisabled").remove(),Y.length&&U.append("text").attr("class","tempDisabled").attr("x",N/2).attr("y","-.71em").style("text-anchor","end").text(Y.map(function(a){return a.key}).join(", ")+" values cannot be calculated for this time period."),v&&(k.width(N).height(O).margin({left:m.left,top:m.top}).svgContainer(L).xScale(d),U.select(".nv-interactive").call(k)),V.select(".nv-background").append("rect"),W.select(".nv-background rect").attr("width",N).attr("height",O),f.y(function(a){return a.display.y}).width(N).height(O).color(l.map(function(a,b){return a.color||n(a,b)}).filter(function(a,b){return!l[b].disabled&&!l[b].tempDisabled}));var Z=W.select(".nv-linesWrap").datum(l.filter(function(a){return!a.disabled&&!a.tempDisabled}));Z.call(f),l.forEach(function(a,b){a.seriesIndex=b});var $=l.filter(function(a){return!a.disabled&&!!B(a)}),_=W.select(".nv-avgLinesWrap").selectAll("line").data($,function(a){return a.key}),ab=function(a){var b=e(B(a));return 0>b?0:b>O?O:b};_.enter().append("line").style("stroke-width",2).style("stroke-dasharray","10,10").style("stroke",function(a){return f.color()(a,a.seriesIndex)}).attr("x1",0).attr("x2",N).attr("y1",ab).attr("y2",ab),_.style("stroke-opacity",function(a){var b=e(B(a));return 0>b||b>O?0:1}).attr("x1",0).attr("x2",N).attr("y1",ab).attr("y2",ab),_.exit().remove();var bb=Z.selectAll(".nv-indexLine").data([G]);bb.enter().append("rect").attr("class","nv-indexLine").attr("width",3).attr("x",-2).attr("fill","red").attr("fill-opacity",.5).style("pointer-events","all").call(Q),bb.attr("transform",function(a){return"translate("+F(a.i)+",0)"}).attr("height",O),r&&(g.scale(d)._ticks(a.utils.calcTicksX(N/70,l)).tickSize(-O,0),W.select(".nv-x.nv-axis").attr("transform","translate(0,"+e.range()[0]+")"),W.select(".nv-x.nv-axis").call(g)),s&&(h.scale(e)._ticks(a.utils.calcTicksY(O/36,l)).tickSize(-N,0),W.select(".nv-y.nv-axis").call(h)),W.select(".nv-background rect").on("click",function(){G.x=d3.mouse(this)[0],G.i=Math.round(F.invert(G.x)),y.index=G.i,C.stateChange(y),K()}),f.dispatch.on("elementClick",function(a){G.i=a.pointIndex,G.x=F(G.i),y.index=G.i,C.stateChange(y),K()}),j.dispatch.on("legendClick",function(a){a.disabled=!a.disabled,w=!a.disabled,y.rescaleY=w,C.stateChange(y),b.update()}),i.dispatch.on("stateChange",function(a){for(var c in a)y[c]=a[c];C.stateChange(y),b.update()}),k.dispatch.on("elementMousemove",function(c){f.clearHighlights();var d,e,i,j=[];if(l.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(g,h){e=a.interactiveBisect(g.values,c.pointXValue,b.x()),f.highlightPoint(h,e,!0);var k=g.values[e];"undefined"!=typeof k&&("undefined"==typeof d&&(d=k),"undefined"==typeof i&&(i=b.xScale()(b.x()(k,e))),j.push({key:g.key,value:b.y()(k,e),color:n(g,g.seriesIndex)}))}),j.length>2){var o=b.yScale().invert(c.mouseY),p=Math.abs(b.yScale().domain()[0]-b.yScale().domain()[1]),q=.03*p,r=a.nearestValueIndex(j.map(function(a){return a.value}),o,q);null!==r&&(j[r].highlight=!0)}var s=g.tickFormat()(b.x()(d,e),e);k.tooltip.position({left:i+m.left,top:c.mouseY+m.top}).chartContainer(M.parentNode).valueFormatter(function(a){return h.tickFormat()(a)}).data({value:s,series:j})(),k.renderGuideLine(i)}),k.dispatch.on("elementMouseout",function(){f.clearHighlights()}),C.on("changeState",function(a){"undefined"!=typeof a.disabled&&(l.forEach(function(b,c){b.disabled=a.disabled[c]}),y.disabled=a.disabled),"undefined"!=typeof a.index&&(G.i=a.index,G.x=F(G.i),y.index=a.index,bb.data([G])),"undefined"!=typeof a.rescaleY&&(w=a.rescaleY),b.update()})}),H.renderEnd("cumulativeLineChart immediate"),b}function c(a,b){return K||(K=f.y()),b.map(function(b){if(!b.values)return b;var c=b.values[a];if(null==c)return b;var d=K(c,a);return-.95>d&&!E?(b.tempDisabled=!0,b):(b.tempDisabled=!1,b.values=b.values.map(function(a,b){return a.display={y:(K(a,b)-d)/(1+d)},a}),b)})}var d,e,f=a.models.line(),g=a.models.axis(),h=a.models.axis(),i=a.models.legend(),j=a.models.legend(),k=a.interactiveGuideline(),l=a.models.tooltip(),m={top:30,right:30,bottom:50,left:60},n=a.utils.defaultColor(),o=null,p=null,q=!0,r=!0,s=!0,t=!1,u=!0,v=!1,w=!0,x=f.id(),y=a.utils.state(),z=null,A=null,B=function(a){return a.average},C=d3.dispatch("stateChange","changeState","renderEnd"),D=250,E=!1;y.index=0,y.rescaleY=w,g.orient("bottom").tickPadding(7),h.orient(t?"right":"left"),l.valueFormatter(function(a,b){return h.tickFormat()(a,b)}).headerFormatter(function(a,b){return g.tickFormat()(a,b)}),j.updateState(!1);var F=d3.scale.linear(),G={i:0,x:0},H=a.utils.renderWatch(C,D),I=function(a){return function(){return{active:a.map(function(a){return!a.disabled}),index:G.i,rescaleY:w}}},J=function(a){return function(b){void 0!==b.index&&(G.i=b.index),void 0!==b.rescaleY&&(w=b.rescaleY),void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};f.dispatch.on("elementMouseover.tooltip",function(a){var c={x:b.x()(a.point),y:b.y()(a.point),color:a.point.color};a.point=c,l.data(a).position(a.pos).hidden(!1)}),f.dispatch.on("elementMouseout.tooltip",function(){l.hidden(!0)});var K=null;return b.dispatch=C,b.lines=f,b.legend=i,b.controls=j,b.xAxis=g,b.yAxis=h,b.interactiveLayer=k,b.state=y,b.tooltip=l,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return o},set:function(a){o=a}},height:{get:function(){return p},set:function(a){p=a}},rescaleY:{get:function(){return w},set:function(a){w=a}},showControls:{get:function(){return u},set:function(a){u=a}},showLegend:{get:function(){return q},set:function(a){q=a}},average:{get:function(){return B},set:function(a){B=a}},defaultState:{get:function(){return z},set:function(a){z=a}},noData:{get:function(){return A},set:function(a){A=a}},showXAxis:{get:function(){return r},set:function(a){r=a}},showYAxis:{get:function(){return s},set:function(a){s=a}},noErrorCheck:{get:function(){return E},set:function(a){E=a}},tooltips:{get:function(){return l.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),l.enabled(!!b)}},tooltipContent:{get:function(){return l.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),l.contentGenerator(b)}},margin:{get:function(){return m},set:function(a){m.top=void 0!==a.top?a.top:m.top,m.right=void 0!==a.right?a.right:m.right,m.bottom=void 0!==a.bottom?a.bottom:m.bottom,m.left=void 0!==a.left?a.left:m.left}},color:{get:function(){return n},set:function(b){n=a.utils.getColor(b),i.color(n)}},useInteractiveGuideline:{get:function(){return v},set:function(a){v=a,a===!0&&(b.interactive(!1),b.useVoronoi(!1))}},rightAlignYAxis:{get:function(){return t},set:function(a){t=a,h.orient(a?"right":"left")}},duration:{get:function(){return D},set:function(a){D=a,f.duration(D),g.duration(D),h.duration(D),H.reset(D)}}}),a.utils.inheritOptions(b,f),a.utils.initOptions(b),b},a.models.discreteBar=function(){"use strict";function b(m){return y.reset(),m.each(function(b){var m=k-j.left-j.right,x=l-j.top-j.bottom;c=d3.select(this),a.utils.initSVG(c),b.forEach(function(a,b){a.values.forEach(function(a){a.series=b})});var z=d&&e?[]:b.map(function(a){return a.values.map(function(a,b){return{x:p(a,b),y:q(a,b),y0:a.y0}})});n.domain(d||d3.merge(z).map(function(a){return a.x})).rangeBands(f||[0,m],.1),o.domain(e||d3.extent(d3.merge(z).map(function(a){return a.y}).concat(r))),o.range(t?g||[x-(o.domain()[0]<0?12:0),o.domain()[1]>0?12:0]:g||[x,0]),h=h||n,i=i||o.copy().range([o(0),o(0)]);{var A=c.selectAll("g.nv-wrap.nv-discretebar").data([b]),B=A.enter().append("g").attr("class","nvd3 nv-wrap nv-discretebar"),C=B.append("g");A.select("g")}C.append("g").attr("class","nv-groups"),A.attr("transform","translate("+j.left+","+j.top+")");var D=A.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a){return a.key});D.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),D.exit().watchTransition(y,"discreteBar: exit groups").style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),D.attr("class",function(a,b){return"nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}),D.watchTransition(y,"discreteBar: groups").style("stroke-opacity",1).style("fill-opacity",.75);var E=D.selectAll("g.nv-bar").data(function(a){return a.values});E.exit().remove();var F=E.enter().append("g").attr("transform",function(a,b){return"translate("+(n(p(a,b))+.05*n.rangeBand())+", "+o(0)+")"}).on("mouseover",function(a,b){d3.select(this).classed("hover",!0),v.elementMouseover({data:a,index:b,color:d3.select(this).style("fill")})}).on("mouseout",function(a,b){d3.select(this).classed("hover",!1),v.elementMouseout({data:a,index:b,color:d3.select(this).style("fill")})}).on("mousemove",function(a,b){v.elementMousemove({data:a,index:b,color:d3.select(this).style("fill")})}).on("click",function(a,b){v.elementClick({data:a,index:b,color:d3.select(this).style("fill")}),d3.event.stopPropagation()}).on("dblclick",function(a,b){v.elementDblClick({data:a,index:b,color:d3.select(this).style("fill")}),d3.event.stopPropagation()});F.append("rect").attr("height",0).attr("width",.9*n.rangeBand()/b.length),t?(F.append("text").attr("text-anchor","middle"),E.select("text").text(function(a,b){return u(q(a,b))}).watchTransition(y,"discreteBar: bars text").attr("x",.9*n.rangeBand()/2).attr("y",function(a,b){return q(a,b)<0?o(q(a,b))-o(0)+12:-4})):E.selectAll("text").remove(),E.attr("class",function(a,b){return q(a,b)<0?"nv-bar negative":"nv-bar positive"}).style("fill",function(a,b){return a.color||s(a,b)}).style("stroke",function(a,b){return a.color||s(a,b)}).select("rect").attr("class",w).watchTransition(y,"discreteBar: bars rect").attr("width",.9*n.rangeBand()/b.length),E.watchTransition(y,"discreteBar: bars").attr("transform",function(a,b){var c=n(p(a,b))+.05*n.rangeBand(),d=q(a,b)<0?o(0):o(0)-o(q(a,b))<1?o(0)-1:o(q(a,b));return"translate("+c+", "+d+")"}).select("rect").attr("height",function(a,b){return Math.max(Math.abs(o(q(a,b))-o(e&&e[0]||0))||1)}),h=n.copy(),i=o.copy()}),y.renderEnd("discreteBar immediate"),b}var c,d,e,f,g,h,i,j={top:0,right:0,bottom:0,left:0},k=960,l=500,m=Math.floor(1e4*Math.random()),n=d3.scale.ordinal(),o=d3.scale.linear(),p=function(a){return a.x},q=function(a){return a.y},r=[0],s=a.utils.defaultColor(),t=!1,u=d3.format(",.2f"),v=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),w="discreteBar",x=250,y=a.utils.renderWatch(v,x);return b.dispatch=v,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return k},set:function(a){k=a}},height:{get:function(){return l},set:function(a){l=a}},forceY:{get:function(){return r},set:function(a){r=a}},showValues:{get:function(){return t},set:function(a){t=a}},x:{get:function(){return p},set:function(a){p=a}},y:{get:function(){return q},set:function(a){q=a}},xScale:{get:function(){return n},set:function(a){n=a}},yScale:{get:function(){return o},set:function(a){o=a}},xDomain:{get:function(){return d},set:function(a){d=a}},yDomain:{get:function(){return e},set:function(a){e=a}},xRange:{get:function(){return f},set:function(a){f=a}},yRange:{get:function(){return g},set:function(a){g=a}},valueFormat:{get:function(){return u},set:function(a){u=a}},id:{get:function(){return m},set:function(a){m=a}},rectClass:{get:function(){return w},set:function(a){w=a}},margin:{get:function(){return j},set:function(a){j.top=void 0!==a.top?a.top:j.top,j.right=void 0!==a.right?a.right:j.right,j.bottom=void 0!==a.bottom?a.bottom:j.bottom,j.left=void 0!==a.left?a.left:j.left}},color:{get:function(){return s},set:function(b){s=a.utils.getColor(b)}},duration:{get:function(){return x},set:function(a){x=a,y.reset(x)}}}),a.utils.initOptions(b),b},a.models.discreteBarChart=function(){"use strict";function b(h){return t.reset(),t.models(e),m&&t.models(f),n&&t.models(g),h.each(function(h){var l=d3.select(this);a.utils.initSVG(l);var q=a.utils.availableWidth(j,l,i),t=a.utils.availableHeight(k,l,i);if(b.update=function(){r.beforeUpdate(),l.transition().duration(s).call(b)},b.container=this,!(h&&h.length&&h.filter(function(a){return a.values.length}).length))return a.utils.noData(b,l),b;l.selectAll(".nv-noData").remove(),c=e.xScale(),d=e.yScale().clamp(!0);var u=l.selectAll("g.nv-wrap.nv-discreteBarWithAxes").data([h]),v=u.enter().append("g").attr("class","nvd3 nv-wrap nv-discreteBarWithAxes").append("g"),w=v.append("defs"),x=u.select("g");v.append("g").attr("class","nv-x nv-axis"),v.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),v.append("g").attr("class","nv-barsWrap"),x.attr("transform","translate("+i.left+","+i.top+")"),o&&x.select(".nv-y.nv-axis").attr("transform","translate("+q+",0)"),e.width(q).height(t);var y=x.select(".nv-barsWrap").datum(h.filter(function(a){return!a.disabled}));if(y.transition().call(e),w.append("clipPath").attr("id","nv-x-label-clip-"+e.id()).append("rect"),x.select("#nv-x-label-clip-"+e.id()+" rect").attr("width",c.rangeBand()*(p?2:1)).attr("height",16).attr("x",-c.rangeBand()/(p?1:2)),m){f.scale(c)._ticks(a.utils.calcTicksX(q/100,h)).tickSize(-t,0),x.select(".nv-x.nv-axis").attr("transform","translate(0,"+(d.range()[0]+(e.showValues()&&d.domain()[0]<0?16:0))+")"),x.select(".nv-x.nv-axis").call(f); -var z=x.select(".nv-x.nv-axis").selectAll("g");p&&z.selectAll("text").attr("transform",function(a,b,c){return"translate(0,"+(c%2==0?"5":"17")+")"})}n&&(g.scale(d)._ticks(a.utils.calcTicksY(t/36,h)).tickSize(-q,0),x.select(".nv-y.nv-axis").call(g)),x.select(".nv-zeroLine line").attr("x1",0).attr("x2",q).attr("y1",d(0)).attr("y2",d(0))}),t.renderEnd("discreteBar chart immediate"),b}var c,d,e=a.models.discreteBar(),f=a.models.axis(),g=a.models.axis(),h=a.models.tooltip(),i={top:15,right:10,bottom:50,left:60},j=null,k=null,l=a.utils.getColor(),m=!0,n=!0,o=!1,p=!1,q=null,r=d3.dispatch("beforeUpdate","renderEnd"),s=250;f.orient("bottom").showMaxMin(!1).tickFormat(function(a){return a}),g.orient(o?"right":"left").tickFormat(d3.format(",.1f")),h.duration(0).headerEnabled(!1).valueFormatter(function(a,b){return g.tickFormat()(a,b)}).keyFormatter(function(a,b){return f.tickFormat()(a,b)});var t=a.utils.renderWatch(r,s);return e.dispatch.on("elementMouseover.tooltip",function(a){a.series={key:b.x()(a.data),value:b.y()(a.data),color:a.color},h.data(a).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(){h.hidden(!0)}),e.dispatch.on("elementMousemove.tooltip",function(){h.position({top:d3.event.pageY,left:d3.event.pageX})()}),b.dispatch=r,b.discretebar=e,b.xAxis=f,b.yAxis=g,b.tooltip=h,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return j},set:function(a){j=a}},height:{get:function(){return k},set:function(a){k=a}},staggerLabels:{get:function(){return p},set:function(a){p=a}},showXAxis:{get:function(){return m},set:function(a){m=a}},showYAxis:{get:function(){return n},set:function(a){n=a}},noData:{get:function(){return q},set:function(a){q=a}},tooltips:{get:function(){return h.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),h.enabled(!!b)}},tooltipContent:{get:function(){return h.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),h.contentGenerator(b)}},margin:{get:function(){return i},set:function(a){i.top=void 0!==a.top?a.top:i.top,i.right=void 0!==a.right?a.right:i.right,i.bottom=void 0!==a.bottom?a.bottom:i.bottom,i.left=void 0!==a.left?a.left:i.left}},duration:{get:function(){return s},set:function(a){s=a,t.reset(s),e.duration(s),f.duration(s),g.duration(s)}},color:{get:function(){return l},set:function(b){l=a.utils.getColor(b),e.color(l)}},rightAlignYAxis:{get:function(){return o},set:function(a){o=a,g.orient(a?"right":"left")}}}),a.utils.inheritOptions(b,e),a.utils.initOptions(b),b},a.models.distribution=function(){"use strict";function b(k){return m.reset(),k.each(function(b){var k=(e-("x"===g?d.left+d.right:d.top+d.bottom),"x"==g?"y":"x"),l=d3.select(this);a.utils.initSVG(l),c=c||j;var n=l.selectAll("g.nv-distribution").data([b]),o=n.enter().append("g").attr("class","nvd3 nv-distribution"),p=(o.append("g"),n.select("g"));n.attr("transform","translate("+d.left+","+d.top+")");var q=p.selectAll("g.nv-dist").data(function(a){return a},function(a){return a.key});q.enter().append("g"),q.attr("class",function(a,b){return"nv-dist nv-series-"+b}).style("stroke",function(a,b){return i(a,b)});var r=q.selectAll("line.nv-dist"+g).data(function(a){return a.values});r.enter().append("line").attr(g+"1",function(a,b){return c(h(a,b))}).attr(g+"2",function(a,b){return c(h(a,b))}),m.transition(q.exit().selectAll("line.nv-dist"+g),"dist exit").attr(g+"1",function(a,b){return j(h(a,b))}).attr(g+"2",function(a,b){return j(h(a,b))}).style("stroke-opacity",0).remove(),r.attr("class",function(a,b){return"nv-dist"+g+" nv-dist"+g+"-"+b}).attr(k+"1",0).attr(k+"2",f),m.transition(r,"dist").attr(g+"1",function(a,b){return j(h(a,b))}).attr(g+"2",function(a,b){return j(h(a,b))}),c=j.copy()}),m.renderEnd("distribution immediate"),b}var c,d={top:0,right:0,bottom:0,left:0},e=400,f=8,g="x",h=function(a){return a[g]},i=a.utils.defaultColor(),j=d3.scale.linear(),k=250,l=d3.dispatch("renderEnd"),m=a.utils.renderWatch(l,k);return b.options=a.utils.optionsFunc.bind(b),b.dispatch=l,b.margin=function(a){return arguments.length?(d.top="undefined"!=typeof a.top?a.top:d.top,d.right="undefined"!=typeof a.right?a.right:d.right,d.bottom="undefined"!=typeof a.bottom?a.bottom:d.bottom,d.left="undefined"!=typeof a.left?a.left:d.left,b):d},b.width=function(a){return arguments.length?(e=a,b):e},b.axis=function(a){return arguments.length?(g=a,b):g},b.size=function(a){return arguments.length?(f=a,b):f},b.getData=function(a){return arguments.length?(h=d3.functor(a),b):h},b.scale=function(a){return arguments.length?(j=a,b):j},b.color=function(c){return arguments.length?(i=a.utils.getColor(c),b):i},b.duration=function(a){return arguments.length?(k=a,m.reset(k),b):k},b},a.models.furiousLegend=function(){"use strict";function b(p){function q(a,b){return"furious"!=o?"#000":m?a.disengaged?g(a,b):"#fff":m?void 0:a.disabled?g(a,b):"#fff"}function r(a,b){return m&&"furious"==o?a.disengaged?"#fff":g(a,b):a.disabled?"#fff":g(a,b)}return p.each(function(b){var p=d-c.left-c.right,s=d3.select(this);a.utils.initSVG(s);var t=s.selectAll("g.nv-legend").data([b]),u=(t.enter().append("g").attr("class","nvd3 nv-legend").append("g"),t.select("g"));t.attr("transform","translate("+c.left+","+c.top+")");var v,w=u.selectAll(".nv-series").data(function(a){return"furious"!=o?a:a.filter(function(a){return m?!0:!a.disengaged})}),x=w.enter().append("g").attr("class","nv-series");if("classic"==o)x.append("circle").style("stroke-width",2).attr("class","nv-legend-symbol").attr("r",5),v=w.select("circle");else if("furious"==o){x.append("rect").style("stroke-width",2).attr("class","nv-legend-symbol").attr("rx",3).attr("ry",3),v=w.select("rect"),x.append("g").attr("class","nv-check-box").property("innerHTML",'').attr("transform","translate(-10,-8)scale(0.5)");var y=w.select(".nv-check-box");y.each(function(a,b){d3.select(this).selectAll("path").attr("stroke",q(a,b))})}x.append("text").attr("text-anchor","start").attr("class","nv-legend-text").attr("dy",".32em").attr("dx","8");var z=w.select("text.nv-legend-text");w.on("mouseover",function(a,b){n.legendMouseover(a,b)}).on("mouseout",function(a,b){n.legendMouseout(a,b)}).on("click",function(a,b){n.legendClick(a,b);var c=w.data();if(k){if("classic"==o)l?(c.forEach(function(a){a.disabled=!0}),a.disabled=!1):(a.disabled=!a.disabled,c.every(function(a){return a.disabled})&&c.forEach(function(a){a.disabled=!1}));else if("furious"==o)if(m)a.disengaged=!a.disengaged,a.userDisabled=void 0==a.userDisabled?!!a.disabled:a.userDisabled,a.disabled=a.disengaged||a.userDisabled;else if(!m){a.disabled=!a.disabled,a.userDisabled=a.disabled;var d=c.filter(function(a){return!a.disengaged});d.every(function(a){return a.userDisabled})&&c.forEach(function(a){a.disabled=a.userDisabled=!1})}n.stateChange({disabled:c.map(function(a){return!!a.disabled}),disengaged:c.map(function(a){return!!a.disengaged})})}}).on("dblclick",function(a,b){if(("furious"!=o||!m)&&(n.legendDblclick(a,b),k)){var c=w.data();c.forEach(function(a){a.disabled=!0,"furious"==o&&(a.userDisabled=a.disabled)}),a.disabled=!1,"furious"==o&&(a.userDisabled=a.disabled),n.stateChange({disabled:c.map(function(a){return!!a.disabled})})}}),w.classed("nv-disabled",function(a){return a.userDisabled}),w.exit().remove(),z.attr("fill",q).text(f);var A;switch(o){case"furious":A=23;break;case"classic":A=20}if(h){var B=[];w.each(function(){var b,c=d3.select(this).select("text");try{if(b=c.node().getComputedTextLength(),0>=b)throw Error()}catch(d){b=a.utils.calcApproxTextWidth(c)}B.push(b+i)});for(var C=0,D=0,E=[];p>D&&Cp&&C>1;){E=[],C--;for(var F=0;F(E[F%C]||0)&&(E[F%C]=B[F]);D=E.reduce(function(a,b){return a+b})}for(var G=[],H=0,I=0;C>H;H++)G[H]=I,I+=E[H];w.attr("transform",function(a,b){return"translate("+G[b%C]+","+(5+Math.floor(b/C)*A)+")"}),j?u.attr("transform","translate("+(d-c.right-D)+","+c.top+")"):u.attr("transform","translate(0,"+c.top+")"),e=c.top+c.bottom+Math.ceil(B.length/C)*A}else{var J,K=5,L=5,M=0;w.attr("transform",function(){var a=d3.select(this).select("text").node().getComputedTextLength()+i;return J=L,dM&&(M=L),"translate("+J+","+K+")"}),u.attr("transform","translate("+(d-c.right-M)+","+c.top+")"),e=c.top+c.bottom+K+15}"furious"==o&&v.attr("width",function(a,b){return z[0][b].getComputedTextLength()+27}).attr("height",18).attr("y",-9).attr("x",-15),v.style("fill",r).style("stroke",function(a,b){return a.color||g(a,b)})}),b}var c={top:5,right:0,bottom:5,left:0},d=400,e=20,f=function(a){return a.key},g=a.utils.getColor(),h=!0,i=28,j=!0,k=!0,l=!1,m=!1,n=d3.dispatch("legendClick","legendDblclick","legendMouseover","legendMouseout","stateChange"),o="classic";return b.dispatch=n,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return d},set:function(a){d=a}},height:{get:function(){return e},set:function(a){e=a}},key:{get:function(){return f},set:function(a){f=a}},align:{get:function(){return h},set:function(a){h=a}},rightAlign:{get:function(){return j},set:function(a){j=a}},padding:{get:function(){return i},set:function(a){i=a}},updateState:{get:function(){return k},set:function(a){k=a}},radioButtonMode:{get:function(){return l},set:function(a){l=a}},expanded:{get:function(){return m},set:function(a){m=a}},vers:{get:function(){return o},set:function(a){o=a}},margin:{get:function(){return c},set:function(a){c.top=void 0!==a.top?a.top:c.top,c.right=void 0!==a.right?a.right:c.right,c.bottom=void 0!==a.bottom?a.bottom:c.bottom,c.left=void 0!==a.left?a.left:c.left}},color:{get:function(){return g},set:function(b){g=a.utils.getColor(b)}}}),a.utils.initOptions(b),b},a.models.historicalBar=function(){"use strict";function b(x){return x.each(function(b){w.reset(),k=d3.select(this);var x=a.utils.availableWidth(h,k,g),y=a.utils.availableHeight(i,k,g);a.utils.initSVG(k),l.domain(c||d3.extent(b[0].values.map(n).concat(p))),l.range(r?e||[.5*x/b[0].values.length,x*(b[0].values.length-.5)/b[0].values.length]:e||[0,x]),m.domain(d||d3.extent(b[0].values.map(o).concat(q))).range(f||[y,0]),l.domain()[0]===l.domain()[1]&&l.domain(l.domain()[0]?[l.domain()[0]-.01*l.domain()[0],l.domain()[1]+.01*l.domain()[1]]:[-1,1]),m.domain()[0]===m.domain()[1]&&m.domain(m.domain()[0]?[m.domain()[0]+.01*m.domain()[0],m.domain()[1]-.01*m.domain()[1]]:[-1,1]);var z=k.selectAll("g.nv-wrap.nv-historicalBar-"+j).data([b[0].values]),A=z.enter().append("g").attr("class","nvd3 nv-wrap nv-historicalBar-"+j),B=A.append("defs"),C=A.append("g"),D=z.select("g");C.append("g").attr("class","nv-bars"),z.attr("transform","translate("+g.left+","+g.top+")"),k.on("click",function(a,b){u.chartClick({data:a,index:b,pos:d3.event,id:j})}),B.append("clipPath").attr("id","nv-chart-clip-path-"+j).append("rect"),z.select("#nv-chart-clip-path-"+j+" rect").attr("width",x).attr("height",y),D.attr("clip-path",s?"url(#nv-chart-clip-path-"+j+")":"");var E=z.select(".nv-bars").selectAll(".nv-bar").data(function(a){return a},function(a,b){return n(a,b)});E.exit().remove(),E.enter().append("rect").attr("x",0).attr("y",function(b,c){return a.utils.NaNtoZero(m(Math.max(0,o(b,c))))}).attr("height",function(b,c){return a.utils.NaNtoZero(Math.abs(m(o(b,c))-m(0)))}).attr("transform",function(a,c){return"translate("+(l(n(a,c))-x/b[0].values.length*.45)+",0)"}).on("mouseover",function(a,b){v&&(d3.select(this).classed("hover",!0),u.elementMouseover({data:a,index:b,color:d3.select(this).style("fill")}))}).on("mouseout",function(a,b){v&&(d3.select(this).classed("hover",!1),u.elementMouseout({data:a,index:b,color:d3.select(this).style("fill")}))}).on("mousemove",function(a,b){v&&u.elementMousemove({data:a,index:b,color:d3.select(this).style("fill")})}).on("click",function(a,b){v&&(u.elementClick({data:a,index:b,color:d3.select(this).style("fill")}),d3.event.stopPropagation())}).on("dblclick",function(a,b){v&&(u.elementDblClick({data:a,index:b,color:d3.select(this).style("fill")}),d3.event.stopPropagation())}),E.attr("fill",function(a,b){return t(a,b)}).attr("class",function(a,b,c){return(o(a,b)<0?"nv-bar negative":"nv-bar positive")+" nv-bar-"+c+"-"+b}).watchTransition(w,"bars").attr("transform",function(a,c){return"translate("+(l(n(a,c))-x/b[0].values.length*.45)+",0)"}).attr("width",x/b[0].values.length*.9),E.watchTransition(w,"bars").attr("y",function(b,c){var d=o(b,c)<0?m(0):m(0)-m(o(b,c))<1?m(0)-1:m(o(b,c));return a.utils.NaNtoZero(d)}).attr("height",function(b,c){return a.utils.NaNtoZero(Math.max(Math.abs(m(o(b,c))-m(0)),1))})}),w.renderEnd("historicalBar immediate"),b}var c,d,e,f,g={top:0,right:0,bottom:0,left:0},h=null,i=null,j=Math.floor(1e4*Math.random()),k=null,l=d3.scale.linear(),m=d3.scale.linear(),n=function(a){return a.x},o=function(a){return a.y},p=[],q=[0],r=!1,s=!0,t=a.utils.defaultColor(),u=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),v=!0,w=a.utils.renderWatch(u,0);return b.highlightPoint=function(a,b){k.select(".nv-bars .nv-bar-0-"+a).classed("hover",b)},b.clearHighlights=function(){k.select(".nv-bars .nv-bar.hover").classed("hover",!1)},b.dispatch=u,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return h},set:function(a){h=a}},height:{get:function(){return i},set:function(a){i=a}},forceX:{get:function(){return p},set:function(a){p=a}},forceY:{get:function(){return q},set:function(a){q=a}},padData:{get:function(){return r},set:function(a){r=a}},x:{get:function(){return n},set:function(a){n=a}},y:{get:function(){return o},set:function(a){o=a}},xScale:{get:function(){return l},set:function(a){l=a}},yScale:{get:function(){return m},set:function(a){m=a}},xDomain:{get:function(){return c},set:function(a){c=a}},yDomain:{get:function(){return d},set:function(a){d=a}},xRange:{get:function(){return e},set:function(a){e=a}},yRange:{get:function(){return f},set:function(a){f=a}},clipEdge:{get:function(){return s},set:function(a){s=a}},id:{get:function(){return j},set:function(a){j=a}},interactive:{get:function(){return v},set:function(a){v=a}},margin:{get:function(){return g},set:function(a){g.top=void 0!==a.top?a.top:g.top,g.right=void 0!==a.right?a.right:g.right,g.bottom=void 0!==a.bottom?a.bottom:g.bottom,g.left=void 0!==a.left?a.left:g.left}},color:{get:function(){return t},set:function(b){t=a.utils.getColor(b)}}}),a.utils.initOptions(b),b},a.models.historicalBarChart=function(b){"use strict";function c(b){return b.each(function(k){z.reset(),z.models(f),q&&z.models(g),r&&z.models(h);var w=d3.select(this),A=this;a.utils.initSVG(w);var B=a.utils.availableWidth(n,w,l),C=a.utils.availableHeight(o,w,l);if(c.update=function(){w.transition().duration(y).call(c)},c.container=this,u.disabled=k.map(function(a){return!!a.disabled}),!v){var D;v={};for(D in u)v[D]=u[D]instanceof Array?u[D].slice(0):u[D]}if(!(k&&k.length&&k.filter(function(a){return a.values.length}).length))return a.utils.noData(c,w),c;w.selectAll(".nv-noData").remove(),d=f.xScale(),e=f.yScale();var E=w.selectAll("g.nv-wrap.nv-historicalBarChart").data([k]),F=E.enter().append("g").attr("class","nvd3 nv-wrap nv-historicalBarChart").append("g"),G=E.select("g");F.append("g").attr("class","nv-x nv-axis"),F.append("g").attr("class","nv-y nv-axis"),F.append("g").attr("class","nv-barsWrap"),F.append("g").attr("class","nv-legendWrap"),F.append("g").attr("class","nv-interactive"),p&&(i.width(B),G.select(".nv-legendWrap").datum(k).call(i),l.top!=i.height()&&(l.top=i.height(),C=a.utils.availableHeight(o,w,l)),E.select(".nv-legendWrap").attr("transform","translate(0,"+-l.top+")")),E.attr("transform","translate("+l.left+","+l.top+")"),s&&G.select(".nv-y.nv-axis").attr("transform","translate("+B+",0)"),t&&(j.width(B).height(C).margin({left:l.left,top:l.top}).svgContainer(w).xScale(d),E.select(".nv-interactive").call(j)),f.width(B).height(C).color(k.map(function(a,b){return a.color||m(a,b)}).filter(function(a,b){return!k[b].disabled}));var H=G.select(".nv-barsWrap").datum(k.filter(function(a){return!a.disabled}));H.transition().call(f),q&&(g.scale(d)._ticks(a.utils.calcTicksX(B/100,k)).tickSize(-C,0),G.select(".nv-x.nv-axis").attr("transform","translate(0,"+e.range()[0]+")"),G.select(".nv-x.nv-axis").transition().call(g)),r&&(h.scale(e)._ticks(a.utils.calcTicksY(C/36,k)).tickSize(-B,0),G.select(".nv-y.nv-axis").transition().call(h)),j.dispatch.on("elementMousemove",function(b){f.clearHighlights();var d,e,i,n=[];k.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(g){e=a.interactiveBisect(g.values,b.pointXValue,c.x()),f.highlightPoint(e,!0);var h=g.values[e];void 0!==h&&(void 0===d&&(d=h),void 0===i&&(i=c.xScale()(c.x()(h,e))),n.push({key:g.key,value:c.y()(h,e),color:m(g,g.seriesIndex),data:g.values[e]}))});var o=g.tickFormat()(c.x()(d,e));j.tooltip.position({left:i+l.left,top:b.mouseY+l.top}).chartContainer(A.parentNode).valueFormatter(function(a){return h.tickFormat()(a)}).data({value:o,index:e,series:n})(),j.renderGuideLine(i)}),j.dispatch.on("elementMouseout",function(){x.tooltipHide(),f.clearHighlights()}),i.dispatch.on("legendClick",function(a){a.disabled=!a.disabled,k.filter(function(a){return!a.disabled}).length||k.map(function(a){return a.disabled=!1,E.selectAll(".nv-series").classed("disabled",!1),a}),u.disabled=k.map(function(a){return!!a.disabled}),x.stateChange(u),b.transition().call(c)}),i.dispatch.on("legendDblclick",function(a){k.forEach(function(a){a.disabled=!0}),a.disabled=!1,u.disabled=k.map(function(a){return!!a.disabled}),x.stateChange(u),c.update()}),x.on("changeState",function(a){"undefined"!=typeof a.disabled&&(k.forEach(function(b,c){b.disabled=a.disabled[c]}),u.disabled=a.disabled),c.update()})}),z.renderEnd("historicalBarChart immediate"),c}var d,e,f=b||a.models.historicalBar(),g=a.models.axis(),h=a.models.axis(),i=a.models.legend(),j=a.interactiveGuideline(),k=a.models.tooltip(),l={top:30,right:90,bottom:50,left:90},m=a.utils.defaultColor(),n=null,o=null,p=!1,q=!0,r=!0,s=!1,t=!1,u={},v=null,w=null,x=d3.dispatch("tooltipHide","stateChange","changeState","renderEnd"),y=250;g.orient("bottom").tickPadding(7),h.orient(s?"right":"left"),k.duration(0).headerEnabled(!1).valueFormatter(function(a,b){return h.tickFormat()(a,b)}).headerFormatter(function(a,b){return g.tickFormat()(a,b)});var z=a.utils.renderWatch(x,0);return f.dispatch.on("elementMouseover.tooltip",function(a){a.series={key:c.x()(a.data),value:c.y()(a.data),color:a.color},k.data(a).hidden(!1)}),f.dispatch.on("elementMouseout.tooltip",function(){k.hidden(!0)}),f.dispatch.on("elementMousemove.tooltip",function(){k.position({top:d3.event.pageY,left:d3.event.pageX})()}),c.dispatch=x,c.bars=f,c.legend=i,c.xAxis=g,c.yAxis=h,c.interactiveLayer=j,c.tooltip=k,c.options=a.utils.optionsFunc.bind(c),c._options=Object.create({},{width:{get:function(){return n},set:function(a){n=a}},height:{get:function(){return o},set:function(a){o=a}},showLegend:{get:function(){return p},set:function(a){p=a}},showXAxis:{get:function(){return q},set:function(a){q=a}},showYAxis:{get:function(){return r},set:function(a){r=a}},defaultState:{get:function(){return v},set:function(a){v=a}},noData:{get:function(){return w},set:function(a){w=a}},tooltips:{get:function(){return k.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),k.enabled(!!b)}},tooltipContent:{get:function(){return k.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),k.contentGenerator(b)}},margin:{get:function(){return l},set:function(a){l.top=void 0!==a.top?a.top:l.top,l.right=void 0!==a.right?a.right:l.right,l.bottom=void 0!==a.bottom?a.bottom:l.bottom,l.left=void 0!==a.left?a.left:l.left}},color:{get:function(){return m},set:function(b){m=a.utils.getColor(b),i.color(m),f.color(m)}},duration:{get:function(){return y},set:function(a){y=a,z.reset(y),h.duration(y),g.duration(y)}},rightAlignYAxis:{get:function(){return s},set:function(a){s=a,h.orient(a?"right":"left")}},useInteractiveGuideline:{get:function(){return t},set:function(a){t=a,a===!0&&c.interactive(!1)}}}),a.utils.inheritOptions(c,f),a.utils.initOptions(c),c},a.models.ohlcBarChart=function(){var b=a.models.historicalBarChart(a.models.ohlcBar());return b.useInteractiveGuideline(!0),b.interactiveLayer.tooltip.contentGenerator(function(a){var c=a.series[0].data,d=c.open'+a.value+"
      open:"+b.yAxis.tickFormat()(c.open)+"
      close:"+b.yAxis.tickFormat()(c.close)+"
      high"+b.yAxis.tickFormat()(c.high)+"
      low:"+b.yAxis.tickFormat()(c.low)+"
      "}),b},a.models.candlestickBarChart=function(){var b=a.models.historicalBarChart(a.models.candlestickBar());return b.useInteractiveGuideline(!0),b.interactiveLayer.tooltip.contentGenerator(function(a){var c=a.series[0].data,d=c.open'+a.value+"
      open:"+b.yAxis.tickFormat()(c.open)+"
      close:"+b.yAxis.tickFormat()(c.close)+"
      high"+b.yAxis.tickFormat()(c.high)+"
      low:"+b.yAxis.tickFormat()(c.low)+"
      "}),b},a.models.legend=function(){"use strict";function b(p){function q(a,b){return"furious"!=o?"#000":m?a.disengaged?"#000":"#fff":m?void 0:(a.color||(a.color=g(a,b)),a.disabled?a.color:"#fff")}function r(a,b){return m&&"furious"==o&&a.disengaged?"#eee":a.color||g(a,b)}function s(a){return m&&"furious"==o?1:a.disabled?0:1}return p.each(function(b){var g=d-c.left-c.right,p=d3.select(this);a.utils.initSVG(p);var t=p.selectAll("g.nv-legend").data([b]),u=t.enter().append("g").attr("class","nvd3 nv-legend").append("g"),v=t.select("g");t.attr("transform","translate("+c.left+","+c.top+")");var w,x,y=v.selectAll(".nv-series").data(function(a){return"furious"!=o?a:a.filter(function(a){return m?!0:!a.disengaged})}),z=y.enter().append("g").attr("class","nv-series");switch(o){case"furious":x=23;break;case"classic":x=20}if("classic"==o)z.append("circle").style("stroke-width",2).attr("class","nv-legend-symbol").attr("r",5),w=y.select("circle");else if("furious"==o){z.append("rect").style("stroke-width",2).attr("class","nv-legend-symbol").attr("rx",3).attr("ry",3),w=y.select(".nv-legend-symbol"),z.append("g").attr("class","nv-check-box").property("innerHTML",'').attr("transform","translate(-10,-8)scale(0.5)");var A=y.select(".nv-check-box");A.each(function(a,b){d3.select(this).selectAll("path").attr("stroke",q(a,b))})}z.append("text").attr("text-anchor","start").attr("class","nv-legend-text").attr("dy",".32em").attr("dx","8");var B=y.select("text.nv-legend-text");y.on("mouseover",function(a,b){n.legendMouseover(a,b)}).on("mouseout",function(a,b){n.legendMouseout(a,b)}).on("click",function(a,b){n.legendClick(a,b);var c=y.data();if(k){if("classic"==o)l?(c.forEach(function(a){a.disabled=!0}),a.disabled=!1):(a.disabled=!a.disabled,c.every(function(a){return a.disabled})&&c.forEach(function(a){a.disabled=!1}));else if("furious"==o)if(m)a.disengaged=!a.disengaged,a.userDisabled=void 0==a.userDisabled?!!a.disabled:a.userDisabled,a.disabled=a.disengaged||a.userDisabled;else if(!m){a.disabled=!a.disabled,a.userDisabled=a.disabled;var d=c.filter(function(a){return!a.disengaged});d.every(function(a){return a.userDisabled})&&c.forEach(function(a){a.disabled=a.userDisabled=!1})}n.stateChange({disabled:c.map(function(a){return!!a.disabled}),disengaged:c.map(function(a){return!!a.disengaged})})}}).on("dblclick",function(a,b){if(("furious"!=o||!m)&&(n.legendDblclick(a,b),k)){var c=y.data();c.forEach(function(a){a.disabled=!0,"furious"==o&&(a.userDisabled=a.disabled)}),a.disabled=!1,"furious"==o&&(a.userDisabled=a.disabled),n.stateChange({disabled:c.map(function(a){return!!a.disabled})})}}),y.classed("nv-disabled",function(a){return a.userDisabled}),y.exit().remove(),B.attr("fill",q).text(f);var C=0;if(h){var D=[];y.each(function(){var b,c=d3.select(this).select("text");try{if(b=c.node().getComputedTextLength(),0>=b)throw Error()}catch(d){b=a.utils.calcApproxTextWidth(c)}D.push(b+i)});var E=0,F=[];for(C=0;g>C&&Eg&&E>1;){F=[],E--;for(var G=0;G(F[G%E]||0)&&(F[G%E]=D[G]);C=F.reduce(function(a,b){return a+b})}for(var H=[],I=0,J=0;E>I;I++)H[I]=J,J+=F[I];y.attr("transform",function(a,b){return"translate("+H[b%E]+","+(5+Math.floor(b/E)*x)+")"}),j?v.attr("transform","translate("+(d-c.right-C)+","+c.top+")"):v.attr("transform","translate(0,"+c.top+")"),e=c.top+c.bottom+Math.ceil(D.length/E)*x}else{var K,L=5,M=5,N=0;y.attr("transform",function(){var a=d3.select(this).select("text").node().getComputedTextLength()+i;return K=M,dN&&(N=M),K+N>C&&(C=K+N),"translate("+K+","+L+")"}),v.attr("transform","translate("+(d-c.right-N)+","+c.top+")"),e=c.top+c.bottom+L+15}if("furious"==o){w.attr("width",function(a,b){return B[0][b].getComputedTextLength()+27}).attr("height",18).attr("y",-9).attr("x",-15),u.insert("rect",":first-child").attr("class","nv-legend-bg").attr("fill","#eee").attr("opacity",0);var O=v.select(".nv-legend-bg");O.transition().duration(300).attr("x",-x).attr("width",C+x-12).attr("height",e+10).attr("y",-c.top-10).attr("opacity",m?1:0)}w.style("fill",r).style("fill-opacity",s).style("stroke",r)}),b}var c={top:5,right:0,bottom:5,left:0},d=400,e=20,f=function(a){return a.key},g=a.utils.getColor(),h=!0,i=32,j=!0,k=!0,l=!1,m=!1,n=d3.dispatch("legendClick","legendDblclick","legendMouseover","legendMouseout","stateChange"),o="classic";return b.dispatch=n,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return d},set:function(a){d=a}},height:{get:function(){return e},set:function(a){e=a}},key:{get:function(){return f},set:function(a){f=a}},align:{get:function(){return h},set:function(a){h=a}},rightAlign:{get:function(){return j},set:function(a){j=a}},padding:{get:function(){return i},set:function(a){i=a}},updateState:{get:function(){return k},set:function(a){k=a}},radioButtonMode:{get:function(){return l},set:function(a){l=a}},expanded:{get:function(){return m},set:function(a){m=a}},vers:{get:function(){return o},set:function(a){o=a}},margin:{get:function(){return c},set:function(a){c.top=void 0!==a.top?a.top:c.top,c.right=void 0!==a.right?a.right:c.right,c.bottom=void 0!==a.bottom?a.bottom:c.bottom,c.left=void 0!==a.left?a.left:c.left}},color:{get:function(){return g},set:function(b){g=a.utils.getColor(b)}}}),a.utils.initOptions(b),b},a.models.line=function(){"use strict";function b(r){return v.reset(),v.models(e),r.each(function(b){i=d3.select(this);var r=a.utils.availableWidth(g,i,f),s=a.utils.availableHeight(h,i,f);a.utils.initSVG(i),c=e.xScale(),d=e.yScale(),t=t||c,u=u||d;var w=i.selectAll("g.nv-wrap.nv-line").data([b]),x=w.enter().append("g").attr("class","nvd3 nv-wrap nv-line"),y=x.append("defs"),z=x.append("g"),A=w.select("g");z.append("g").attr("class","nv-groups"),z.append("g").attr("class","nv-scatterWrap"),w.attr("transform","translate("+f.left+","+f.top+")"),e.width(r).height(s);var B=w.select(".nv-scatterWrap");B.call(e),y.append("clipPath").attr("id","nv-edge-clip-"+e.id()).append("rect"),w.select("#nv-edge-clip-"+e.id()+" rect").attr("width",r).attr("height",s>0?s:0),A.attr("clip-path",p?"url(#nv-edge-clip-"+e.id()+")":""),B.attr("clip-path",p?"url(#nv-edge-clip-"+e.id()+")":"");var C=w.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a){return a.key});C.enter().append("g").style("stroke-opacity",1e-6).style("stroke-width",function(a){return a.strokeWidth||j}).style("fill-opacity",1e-6),C.exit().remove(),C.attr("class",function(a,b){return(a.classed||"")+" nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}).style("fill",function(a,b){return k(a,b)}).style("stroke",function(a,b){return k(a,b)}),C.watchTransition(v,"line: groups").style("stroke-opacity",1).style("fill-opacity",function(a){return a.fillOpacity||.5});var D=C.selectAll("path.nv-area").data(function(a){return o(a)?[a]:[]});D.enter().append("path").attr("class","nv-area").attr("d",function(b){return d3.svg.area().interpolate(q).defined(n).x(function(b,c){return a.utils.NaNtoZero(t(l(b,c)))}).y0(function(b,c){return a.utils.NaNtoZero(u(m(b,c)))}).y1(function(){return u(d.domain()[0]<=0?d.domain()[1]>=0?0:d.domain()[1]:d.domain()[0])}).apply(this,[b.values])}),C.exit().selectAll("path.nv-area").remove(),D.watchTransition(v,"line: areaPaths").attr("d",function(b){return d3.svg.area().interpolate(q).defined(n).x(function(b,d){return a.utils.NaNtoZero(c(l(b,d)))}).y0(function(b,c){return a.utils.NaNtoZero(d(m(b,c)))}).y1(function(){return d(d.domain()[0]<=0?d.domain()[1]>=0?0:d.domain()[1]:d.domain()[0])}).apply(this,[b.values])});var E=C.selectAll("path.nv-line").data(function(a){return[a.values]});E.enter().append("path").attr("class","nv-line").attr("d",d3.svg.line().interpolate(q).defined(n).x(function(b,c){return a.utils.NaNtoZero(t(l(b,c)))}).y(function(b,c){return a.utils.NaNtoZero(u(m(b,c)))})),E.watchTransition(v,"line: linePaths").attr("d",d3.svg.line().interpolate(q).defined(n).x(function(b,d){return a.utils.NaNtoZero(c(l(b,d)))}).y(function(b,c){return a.utils.NaNtoZero(d(m(b,c)))})),t=c.copy(),u=d.copy()}),v.renderEnd("line immediate"),b}var c,d,e=a.models.scatter(),f={top:0,right:0,bottom:0,left:0},g=960,h=500,i=null,j=1.5,k=a.utils.defaultColor(),l=function(a){return a.x},m=function(a){return a.y},n=function(a,b){return!isNaN(m(a,b))&&null!==m(a,b)},o=function(a){return a.area},p=!1,q="linear",r=250,s=d3.dispatch("elementClick","elementMouseover","elementMouseout","renderEnd");e.pointSize(16).pointDomain([16,256]);var t,u,v=a.utils.renderWatch(s,r);return b.dispatch=s,b.scatter=e,e.dispatch.on("elementClick",function(){s.elementClick.apply(this,arguments)}),e.dispatch.on("elementMouseover",function(){s.elementMouseover.apply(this,arguments)}),e.dispatch.on("elementMouseout",function(){s.elementMouseout.apply(this,arguments)}),b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return g},set:function(a){g=a}},height:{get:function(){return h},set:function(a){h=a}},defined:{get:function(){return n},set:function(a){n=a}},interpolate:{get:function(){return q},set:function(a){q=a}},clipEdge:{get:function(){return p},set:function(a){p=a}},margin:{get:function(){return f},set:function(a){f.top=void 0!==a.top?a.top:f.top,f.right=void 0!==a.right?a.right:f.right,f.bottom=void 0!==a.bottom?a.bottom:f.bottom,f.left=void 0!==a.left?a.left:f.left}},duration:{get:function(){return r},set:function(a){r=a,v.reset(r),e.duration(r)}},isArea:{get:function(){return o},set:function(a){o=d3.functor(a)}},x:{get:function(){return l},set:function(a){l=a,e.x(a)}},y:{get:function(){return m},set:function(a){m=a,e.y(a)}},color:{get:function(){return k},set:function(b){k=a.utils.getColor(b),e.color(k)}}}),a.utils.inheritOptions(b,e),a.utils.initOptions(b),b},a.models.lineChart=function(){"use strict";function b(j){return y.reset(),y.models(e),p&&y.models(f),q&&y.models(g),j.each(function(j){var v=d3.select(this),y=this;a.utils.initSVG(v);var B=a.utils.availableWidth(m,v,k),C=a.utils.availableHeight(n,v,k);if(b.update=function(){0===x?v.call(b):v.transition().duration(x).call(b)},b.container=this,t.setter(A(j),b.update).getter(z(j)).update(),t.disabled=j.map(function(a){return!!a.disabled}),!u){var D;u={};for(D in t)u[D]=t[D]instanceof Array?t[D].slice(0):t[D] -}if(!(j&&j.length&&j.filter(function(a){return a.values.length}).length))return a.utils.noData(b,v),b;v.selectAll(".nv-noData").remove(),c=e.xScale(),d=e.yScale();var E=v.selectAll("g.nv-wrap.nv-lineChart").data([j]),F=E.enter().append("g").attr("class","nvd3 nv-wrap nv-lineChart").append("g"),G=E.select("g");F.append("rect").style("opacity",0),F.append("g").attr("class","nv-x nv-axis"),F.append("g").attr("class","nv-y nv-axis"),F.append("g").attr("class","nv-linesWrap"),F.append("g").attr("class","nv-legendWrap"),F.append("g").attr("class","nv-interactive"),G.select("rect").attr("width",B).attr("height",C>0?C:0),o&&(h.width(B),G.select(".nv-legendWrap").datum(j).call(h),k.top!=h.height()&&(k.top=h.height(),C=a.utils.availableHeight(n,v,k)),E.select(".nv-legendWrap").attr("transform","translate(0,"+-k.top+")")),E.attr("transform","translate("+k.left+","+k.top+")"),r&&G.select(".nv-y.nv-axis").attr("transform","translate("+B+",0)"),s&&(i.width(B).height(C).margin({left:k.left,top:k.top}).svgContainer(v).xScale(c),E.select(".nv-interactive").call(i)),e.width(B).height(C).color(j.map(function(a,b){return a.color||l(a,b)}).filter(function(a,b){return!j[b].disabled}));var H=G.select(".nv-linesWrap").datum(j.filter(function(a){return!a.disabled}));H.call(e),p&&(f.scale(c)._ticks(a.utils.calcTicksX(B/100,j)).tickSize(-C,0),G.select(".nv-x.nv-axis").attr("transform","translate(0,"+d.range()[0]+")"),G.select(".nv-x.nv-axis").call(f)),q&&(g.scale(d)._ticks(a.utils.calcTicksY(C/36,j)).tickSize(-B,0),G.select(".nv-y.nv-axis").call(g)),h.dispatch.on("stateChange",function(a){for(var c in a)t[c]=a[c];w.stateChange(t),b.update()}),i.dispatch.on("elementMousemove",function(c){e.clearHighlights();var d,h,m,n=[];if(j.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(f,g){h=a.interactiveBisect(f.values,c.pointXValue,b.x());var i=f.values[h],j=b.y()(i,h);null!=j&&e.highlightPoint(g,h,!0),void 0!==i&&(void 0===d&&(d=i),void 0===m&&(m=b.xScale()(b.x()(i,h))),n.push({key:f.key,value:j,color:l(f,f.seriesIndex)}))}),n.length>2){var o=b.yScale().invert(c.mouseY),p=Math.abs(b.yScale().domain()[0]-b.yScale().domain()[1]),q=.03*p,r=a.nearestValueIndex(n.map(function(a){return a.value}),o,q);null!==r&&(n[r].highlight=!0)}var s=f.tickFormat()(b.x()(d,h));i.tooltip.position({left:c.mouseX+k.left,top:c.mouseY+k.top}).chartContainer(y.parentNode).valueFormatter(function(a){return null==a?"N/A":g.tickFormat()(a)}).data({value:s,index:h,series:n})(),i.renderGuideLine(m)}),i.dispatch.on("elementClick",function(c){var d,f=[];j.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(e){var g=a.interactiveBisect(e.values,c.pointXValue,b.x()),h=e.values[g];if("undefined"!=typeof h){"undefined"==typeof d&&(d=b.xScale()(b.x()(h,g)));var i=b.yScale()(b.y()(h,g));f.push({point:h,pointIndex:g,pos:[d,i],seriesIndex:e.seriesIndex,series:e})}}),e.dispatch.elementClick(f)}),i.dispatch.on("elementMouseout",function(){e.clearHighlights()}),w.on("changeState",function(a){"undefined"!=typeof a.disabled&&j.length===a.disabled.length&&(j.forEach(function(b,c){b.disabled=a.disabled[c]}),t.disabled=a.disabled),b.update()})}),y.renderEnd("lineChart immediate"),b}var c,d,e=a.models.line(),f=a.models.axis(),g=a.models.axis(),h=a.models.legend(),i=a.interactiveGuideline(),j=a.models.tooltip(),k={top:30,right:20,bottom:50,left:60},l=a.utils.defaultColor(),m=null,n=null,o=!0,p=!0,q=!0,r=!1,s=!1,t=a.utils.state(),u=null,v=null,w=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState","renderEnd"),x=250;f.orient("bottom").tickPadding(7),g.orient(r?"right":"left"),j.valueFormatter(function(a,b){return g.tickFormat()(a,b)}).headerFormatter(function(a,b){return f.tickFormat()(a,b)});var y=a.utils.renderWatch(w,x),z=function(a){return function(){return{active:a.map(function(a){return!a.disabled})}}},A=function(a){return function(b){void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};return e.dispatch.on("elementMouseover.tooltip",function(a){j.data(a).position(a.pos).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(){j.hidden(!0)}),b.dispatch=w,b.lines=e,b.legend=h,b.xAxis=f,b.yAxis=g,b.interactiveLayer=i,b.tooltip=j,b.dispatch=w,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return m},set:function(a){m=a}},height:{get:function(){return n},set:function(a){n=a}},showLegend:{get:function(){return o},set:function(a){o=a}},showXAxis:{get:function(){return p},set:function(a){p=a}},showYAxis:{get:function(){return q},set:function(a){q=a}},defaultState:{get:function(){return u},set:function(a){u=a}},noData:{get:function(){return v},set:function(a){v=a}},tooltips:{get:function(){return j.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),j.enabled(!!b)}},tooltipContent:{get:function(){return j.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),j.contentGenerator(b)}},margin:{get:function(){return k},set:function(a){k.top=void 0!==a.top?a.top:k.top,k.right=void 0!==a.right?a.right:k.right,k.bottom=void 0!==a.bottom?a.bottom:k.bottom,k.left=void 0!==a.left?a.left:k.left}},duration:{get:function(){return x},set:function(a){x=a,y.reset(x),e.duration(x),f.duration(x),g.duration(x)}},color:{get:function(){return l},set:function(b){l=a.utils.getColor(b),h.color(l),e.color(l)}},rightAlignYAxis:{get:function(){return r},set:function(a){r=a,g.orient(r?"right":"left")}},useInteractiveGuideline:{get:function(){return s},set:function(a){s=a,s&&(e.interactive(!1),e.useVoronoi(!1))}}}),a.utils.inheritOptions(b,e),a.utils.initOptions(b),b},a.models.linePlusBarChart=function(){"use strict";function b(v){return v.each(function(v){function J(a){var b=+("e"==a),c=b?1:-1,d=X/3;return"M"+.5*c+","+d+"A6,6 0 0 "+b+" "+6.5*c+","+(d+6)+"V"+(2*d-6)+"A6,6 0 0 "+b+" "+.5*c+","+2*d+"ZM"+2.5*c+","+(d+8)+"V"+(2*d-8)+"M"+4.5*c+","+(d+8)+"V"+(2*d-8)}function S(){u.empty()||u.extent(I),kb.data([u.empty()?e.domain():I]).each(function(a){var b=e(a[0])-e.range()[0],c=e.range()[1]-e(a[1]);d3.select(this).select(".left").attr("width",0>b?0:b),d3.select(this).select(".right").attr("x",e(a[1])).attr("width",0>c?0:c)})}function T(){I=u.empty()?null:u.extent(),c=u.empty()?e.domain():u.extent(),K.brush({extent:c,brush:u}),S(),l.width(V).height(W).color(v.map(function(a,b){return a.color||C(a,b)}).filter(function(a,b){return!v[b].disabled&&v[b].bar})),j.width(V).height(W).color(v.map(function(a,b){return a.color||C(a,b)}).filter(function(a,b){return!v[b].disabled&&!v[b].bar}));var b=db.select(".nv-focus .nv-barsWrap").datum(Z.length?Z.map(function(a){return{key:a.key,values:a.values.filter(function(a,b){return l.x()(a,b)>=c[0]&&l.x()(a,b)<=c[1]})}}):[{values:[]}]),h=db.select(".nv-focus .nv-linesWrap").datum($[0].disabled?[{values:[]}]:$.map(function(a){return{area:a.area,fillOpacity:a.fillOpacity,key:a.key,values:a.values.filter(function(a,b){return j.x()(a,b)>=c[0]&&j.x()(a,b)<=c[1]})}}));d=Z.length?l.xScale():j.xScale(),n.scale(d)._ticks(a.utils.calcTicksX(V/100,v)).tickSize(-W,0),n.domain([Math.ceil(c[0]),Math.floor(c[1])]),db.select(".nv-x.nv-axis").transition().duration(L).call(n),b.transition().duration(L).call(l),h.transition().duration(L).call(j),db.select(".nv-focus .nv-x.nv-axis").attr("transform","translate(0,"+f.range()[0]+")"),p.scale(f)._ticks(a.utils.calcTicksY(W/36,v)).tickSize(-V,0),q.scale(g)._ticks(a.utils.calcTicksY(W/36,v)).tickSize(Z.length?0:-V,0),db.select(".nv-focus .nv-y1.nv-axis").style("opacity",Z.length?1:0),db.select(".nv-focus .nv-y2.nv-axis").style("opacity",$.length&&!$[0].disabled?1:0).attr("transform","translate("+d.range()[1]+",0)"),db.select(".nv-focus .nv-y1.nv-axis").transition().duration(L).call(p),db.select(".nv-focus .nv-y2.nv-axis").transition().duration(L).call(q)}var U=d3.select(this);a.utils.initSVG(U);var V=a.utils.availableWidth(y,U,w),W=a.utils.availableHeight(z,U,w)-(E?H:0),X=H-x.top-x.bottom;if(b.update=function(){U.transition().duration(L).call(b)},b.container=this,M.setter(R(v),b.update).getter(Q(v)).update(),M.disabled=v.map(function(a){return!!a.disabled}),!N){var Y;N={};for(Y in M)N[Y]=M[Y]instanceof Array?M[Y].slice(0):M[Y]}if(!(v&&v.length&&v.filter(function(a){return a.values.length}).length))return a.utils.noData(b,U),b;U.selectAll(".nv-noData").remove();var Z=v.filter(function(a){return!a.disabled&&a.bar}),$=v.filter(function(a){return!a.bar});d=l.xScale(),e=o.scale(),f=l.yScale(),g=j.yScale(),h=m.yScale(),i=k.yScale();var _=v.filter(function(a){return!a.disabled&&a.bar}).map(function(a){return a.values.map(function(a,b){return{x:A(a,b),y:B(a,b)}})}),ab=v.filter(function(a){return!a.disabled&&!a.bar}).map(function(a){return a.values.map(function(a,b){return{x:A(a,b),y:B(a,b)}})});d.range([0,V]),e.domain(d3.extent(d3.merge(_.concat(ab)),function(a){return a.x})).range([0,V]);var bb=U.selectAll("g.nv-wrap.nv-linePlusBar").data([v]),cb=bb.enter().append("g").attr("class","nvd3 nv-wrap nv-linePlusBar").append("g"),db=bb.select("g");cb.append("g").attr("class","nv-legendWrap");var eb=cb.append("g").attr("class","nv-focus");eb.append("g").attr("class","nv-x nv-axis"),eb.append("g").attr("class","nv-y1 nv-axis"),eb.append("g").attr("class","nv-y2 nv-axis"),eb.append("g").attr("class","nv-barsWrap"),eb.append("g").attr("class","nv-linesWrap");var fb=cb.append("g").attr("class","nv-context");if(fb.append("g").attr("class","nv-x nv-axis"),fb.append("g").attr("class","nv-y1 nv-axis"),fb.append("g").attr("class","nv-y2 nv-axis"),fb.append("g").attr("class","nv-barsWrap"),fb.append("g").attr("class","nv-linesWrap"),fb.append("g").attr("class","nv-brushBackground"),fb.append("g").attr("class","nv-x nv-brush"),D){var gb=t.align()?V/2:V,hb=t.align()?gb:0;t.width(gb),db.select(".nv-legendWrap").datum(v.map(function(a){return a.originalKey=void 0===a.originalKey?a.key:a.originalKey,a.key=a.originalKey+(a.bar?O:P),a})).call(t),w.top!=t.height()&&(w.top=t.height(),W=a.utils.availableHeight(z,U,w)-H),db.select(".nv-legendWrap").attr("transform","translate("+hb+","+-w.top+")")}bb.attr("transform","translate("+w.left+","+w.top+")"),db.select(".nv-context").style("display",E?"initial":"none"),m.width(V).height(X).color(v.map(function(a,b){return a.color||C(a,b)}).filter(function(a,b){return!v[b].disabled&&v[b].bar})),k.width(V).height(X).color(v.map(function(a,b){return a.color||C(a,b)}).filter(function(a,b){return!v[b].disabled&&!v[b].bar}));var ib=db.select(".nv-context .nv-barsWrap").datum(Z.length?Z:[{values:[]}]),jb=db.select(".nv-context .nv-linesWrap").datum($[0].disabled?[{values:[]}]:$);db.select(".nv-context").attr("transform","translate(0,"+(W+w.bottom+x.top)+")"),ib.transition().call(m),jb.transition().call(k),G&&(o._ticks(a.utils.calcTicksX(V/100,v)).tickSize(-X,0),db.select(".nv-context .nv-x.nv-axis").attr("transform","translate(0,"+h.range()[0]+")"),db.select(".nv-context .nv-x.nv-axis").transition().call(o)),F&&(r.scale(h)._ticks(X/36).tickSize(-V,0),s.scale(i)._ticks(X/36).tickSize(Z.length?0:-V,0),db.select(".nv-context .nv-y3.nv-axis").style("opacity",Z.length?1:0).attr("transform","translate(0,"+e.range()[0]+")"),db.select(".nv-context .nv-y2.nv-axis").style("opacity",$.length?1:0).attr("transform","translate("+e.range()[1]+",0)"),db.select(".nv-context .nv-y1.nv-axis").transition().call(r),db.select(".nv-context .nv-y2.nv-axis").transition().call(s)),u.x(e).on("brush",T),I&&u.extent(I);var kb=db.select(".nv-brushBackground").selectAll("g").data([I||u.extent()]),lb=kb.enter().append("g");lb.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",X),lb.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",X);var mb=db.select(".nv-x.nv-brush").call(u);mb.selectAll("rect").attr("height",X),mb.selectAll(".resize").append("path").attr("d",J),t.dispatch.on("stateChange",function(a){for(var c in a)M[c]=a[c];K.stateChange(M),b.update()}),K.on("changeState",function(a){"undefined"!=typeof a.disabled&&(v.forEach(function(b,c){b.disabled=a.disabled[c]}),M.disabled=a.disabled),b.update()}),T()}),b}var c,d,e,f,g,h,i,j=a.models.line(),k=a.models.line(),l=a.models.historicalBar(),m=a.models.historicalBar(),n=a.models.axis(),o=a.models.axis(),p=a.models.axis(),q=a.models.axis(),r=a.models.axis(),s=a.models.axis(),t=a.models.legend(),u=d3.svg.brush(),v=a.models.tooltip(),w={top:30,right:30,bottom:30,left:60},x={top:0,right:30,bottom:20,left:60},y=null,z=null,A=function(a){return a.x},B=function(a){return a.y},C=a.utils.defaultColor(),D=!0,E=!0,F=!1,G=!0,H=50,I=null,J=null,K=d3.dispatch("brush","stateChange","changeState"),L=0,M=a.utils.state(),N=null,O=" (left axis)",P=" (right axis)";j.clipEdge(!0),k.interactive(!1),n.orient("bottom").tickPadding(5),p.orient("left"),q.orient("right"),o.orient("bottom").tickPadding(5),r.orient("left"),s.orient("right"),v.headerEnabled(!0).headerFormatter(function(a,b){return n.tickFormat()(a,b)});var Q=function(a){return function(){return{active:a.map(function(a){return!a.disabled})}}},R=function(a){return function(b){void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};return j.dispatch.on("elementMouseover.tooltip",function(a){v.duration(100).valueFormatter(function(a,b){return q.tickFormat()(a,b)}).data(a).position(a.pos).hidden(!1)}),j.dispatch.on("elementMouseout.tooltip",function(){v.hidden(!0)}),l.dispatch.on("elementMouseover.tooltip",function(a){a.value=b.x()(a.data),a.series={value:b.y()(a.data),color:a.color},v.duration(0).valueFormatter(function(a,b){return p.tickFormat()(a,b)}).data(a).hidden(!1)}),l.dispatch.on("elementMouseout.tooltip",function(){v.hidden(!0)}),l.dispatch.on("elementMousemove.tooltip",function(){v.position({top:d3.event.pageY,left:d3.event.pageX})()}),b.dispatch=K,b.legend=t,b.lines=j,b.lines2=k,b.bars=l,b.bars2=m,b.xAxis=n,b.x2Axis=o,b.y1Axis=p,b.y2Axis=q,b.y3Axis=r,b.y4Axis=s,b.tooltip=v,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return y},set:function(a){y=a}},height:{get:function(){return z},set:function(a){z=a}},showLegend:{get:function(){return D},set:function(a){D=a}},brushExtent:{get:function(){return I},set:function(a){I=a}},noData:{get:function(){return J},set:function(a){J=a}},focusEnable:{get:function(){return E},set:function(a){E=a}},focusHeight:{get:function(){return H},set:function(a){H=a}},focusShowAxisX:{get:function(){return G},set:function(a){G=a}},focusShowAxisY:{get:function(){return F},set:function(a){F=a}},legendLeftAxisHint:{get:function(){return O},set:function(a){O=a}},legendRightAxisHint:{get:function(){return P},set:function(a){P=a}},tooltips:{get:function(){return v.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),v.enabled(!!b)}},tooltipContent:{get:function(){return v.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),v.contentGenerator(b)}},margin:{get:function(){return w},set:function(a){w.top=void 0!==a.top?a.top:w.top,w.right=void 0!==a.right?a.right:w.right,w.bottom=void 0!==a.bottom?a.bottom:w.bottom,w.left=void 0!==a.left?a.left:w.left}},duration:{get:function(){return L},set:function(a){L=a}},color:{get:function(){return C},set:function(b){C=a.utils.getColor(b),t.color(C)}},x:{get:function(){return A},set:function(a){A=a,j.x(a),k.x(a),l.x(a),m.x(a)}},y:{get:function(){return B},set:function(a){B=a,j.y(a),k.y(a),l.y(a),m.y(a)}}}),a.utils.inheritOptions(b,j),a.utils.initOptions(b),b},a.models.lineWithFocusChart=function(){"use strict";function b(o){return o.each(function(o){function z(a){var b=+("e"==a),c=b?1:-1,d=M/3;return"M"+.5*c+","+d+"A6,6 0 0 "+b+" "+6.5*c+","+(d+6)+"V"+(2*d-6)+"A6,6 0 0 "+b+" "+.5*c+","+2*d+"ZM"+2.5*c+","+(d+8)+"V"+(2*d-8)+"M"+4.5*c+","+(d+8)+"V"+(2*d-8)}function G(){n.empty()||n.extent(y),U.data([n.empty()?e.domain():y]).each(function(a){var b=e(a[0])-c.range()[0],d=K-e(a[1]);d3.select(this).select(".left").attr("width",0>b?0:b),d3.select(this).select(".right").attr("x",e(a[1])).attr("width",0>d?0:d)})}function H(){y=n.empty()?null:n.extent();var a=n.empty()?e.domain():n.extent();if(!(Math.abs(a[0]-a[1])<=1)){A.brush({extent:a,brush:n}),G();var b=Q.select(".nv-focus .nv-linesWrap").datum(o.filter(function(a){return!a.disabled}).map(function(b){return{key:b.key,area:b.area,values:b.values.filter(function(b,c){return g.x()(b,c)>=a[0]&&g.x()(b,c)<=a[1]})}}));b.transition().duration(B).call(g),Q.select(".nv-focus .nv-x.nv-axis").transition().duration(B).call(i),Q.select(".nv-focus .nv-y.nv-axis").transition().duration(B).call(j)}}var I=d3.select(this),J=this;a.utils.initSVG(I);var K=a.utils.availableWidth(t,I,q),L=a.utils.availableHeight(u,I,q)-v,M=v-r.top-r.bottom;if(b.update=function(){I.transition().duration(B).call(b)},b.container=this,C.setter(F(o),b.update).getter(E(o)).update(),C.disabled=o.map(function(a){return!!a.disabled}),!D){var N;D={};for(N in C)D[N]=C[N]instanceof Array?C[N].slice(0):C[N]}if(!(o&&o.length&&o.filter(function(a){return a.values.length}).length))return a.utils.noData(b,I),b;I.selectAll(".nv-noData").remove(),c=g.xScale(),d=g.yScale(),e=h.xScale(),f=h.yScale();var O=I.selectAll("g.nv-wrap.nv-lineWithFocusChart").data([o]),P=O.enter().append("g").attr("class","nvd3 nv-wrap nv-lineWithFocusChart").append("g"),Q=O.select("g");P.append("g").attr("class","nv-legendWrap");var R=P.append("g").attr("class","nv-focus");R.append("g").attr("class","nv-x nv-axis"),R.append("g").attr("class","nv-y nv-axis"),R.append("g").attr("class","nv-linesWrap"),R.append("g").attr("class","nv-interactive");var S=P.append("g").attr("class","nv-context");S.append("g").attr("class","nv-x nv-axis"),S.append("g").attr("class","nv-y nv-axis"),S.append("g").attr("class","nv-linesWrap"),S.append("g").attr("class","nv-brushBackground"),S.append("g").attr("class","nv-x nv-brush"),x&&(m.width(K),Q.select(".nv-legendWrap").datum(o).call(m),q.top!=m.height()&&(q.top=m.height(),L=a.utils.availableHeight(u,I,q)-v),Q.select(".nv-legendWrap").attr("transform","translate(0,"+-q.top+")")),O.attr("transform","translate("+q.left+","+q.top+")"),w&&(p.width(K).height(L).margin({left:q.left,top:q.top}).svgContainer(I).xScale(c),O.select(".nv-interactive").call(p)),g.width(K).height(L).color(o.map(function(a,b){return a.color||s(a,b)}).filter(function(a,b){return!o[b].disabled})),h.defined(g.defined()).width(K).height(M).color(o.map(function(a,b){return a.color||s(a,b)}).filter(function(a,b){return!o[b].disabled})),Q.select(".nv-context").attr("transform","translate(0,"+(L+q.bottom+r.top)+")");var T=Q.select(".nv-context .nv-linesWrap").datum(o.filter(function(a){return!a.disabled}));d3.transition(T).call(h),i.scale(c)._ticks(a.utils.calcTicksX(K/100,o)).tickSize(-L,0),j.scale(d)._ticks(a.utils.calcTicksY(L/36,o)).tickSize(-K,0),Q.select(".nv-focus .nv-x.nv-axis").attr("transform","translate(0,"+L+")"),n.x(e).on("brush",function(){H()}),y&&n.extent(y);var U=Q.select(".nv-brushBackground").selectAll("g").data([y||n.extent()]),V=U.enter().append("g");V.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",M),V.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",M);var W=Q.select(".nv-x.nv-brush").call(n);W.selectAll("rect").attr("height",M),W.selectAll(".resize").append("path").attr("d",z),H(),k.scale(e)._ticks(a.utils.calcTicksX(K/100,o)).tickSize(-M,0),Q.select(".nv-context .nv-x.nv-axis").attr("transform","translate(0,"+f.range()[0]+")"),d3.transition(Q.select(".nv-context .nv-x.nv-axis")).call(k),l.scale(f)._ticks(a.utils.calcTicksY(M/36,o)).tickSize(-K,0),d3.transition(Q.select(".nv-context .nv-y.nv-axis")).call(l),Q.select(".nv-context .nv-x.nv-axis").attr("transform","translate(0,"+f.range()[0]+")"),m.dispatch.on("stateChange",function(a){for(var c in a)C[c]=a[c];A.stateChange(C),b.update()}),p.dispatch.on("elementMousemove",function(c){g.clearHighlights();var d,f,h,k=[];if(o.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(i,j){var l=n.empty()?e.domain():n.extent(),m=i.values.filter(function(a,b){return g.x()(a,b)>=l[0]&&g.x()(a,b)<=l[1]});f=a.interactiveBisect(m,c.pointXValue,g.x());var o=m[f],p=b.y()(o,f);null!=p&&g.highlightPoint(j,f,!0),void 0!==o&&(void 0===d&&(d=o),void 0===h&&(h=b.xScale()(b.x()(o,f))),k.push({key:i.key,value:b.y()(o,f),color:s(i,i.seriesIndex)}))}),k.length>2){var l=b.yScale().invert(c.mouseY),m=Math.abs(b.yScale().domain()[0]-b.yScale().domain()[1]),r=.03*m,t=a.nearestValueIndex(k.map(function(a){return a.value}),l,r);null!==t&&(k[t].highlight=!0)}var u=i.tickFormat()(b.x()(d,f));p.tooltip.position({left:c.mouseX+q.left,top:c.mouseY+q.top}).chartContainer(J.parentNode).valueFormatter(function(a){return null==a?"N/A":j.tickFormat()(a)}).data({value:u,index:f,series:k})(),p.renderGuideLine(h)}),p.dispatch.on("elementMouseout",function(){g.clearHighlights()}),A.on("changeState",function(a){"undefined"!=typeof a.disabled&&o.forEach(function(b,c){b.disabled=a.disabled[c]}),b.update()})}),b}var c,d,e,f,g=a.models.line(),h=a.models.line(),i=a.models.axis(),j=a.models.axis(),k=a.models.axis(),l=a.models.axis(),m=a.models.legend(),n=d3.svg.brush(),o=a.models.tooltip(),p=a.interactiveGuideline(),q={top:30,right:30,bottom:30,left:60},r={top:0,right:30,bottom:20,left:60},s=a.utils.defaultColor(),t=null,u=null,v=50,w=!1,x=!0,y=null,z=null,A=d3.dispatch("brush","stateChange","changeState"),B=250,C=a.utils.state(),D=null;g.clipEdge(!0).duration(0),h.interactive(!1),i.orient("bottom").tickPadding(5),j.orient("left"),k.orient("bottom").tickPadding(5),l.orient("left"),o.valueFormatter(function(a,b){return j.tickFormat()(a,b)}).headerFormatter(function(a,b){return i.tickFormat()(a,b)});var E=function(a){return function(){return{active:a.map(function(a){return!a.disabled})}}},F=function(a){return function(b){void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};return g.dispatch.on("elementMouseover.tooltip",function(a){o.data(a).position(a.pos).hidden(!1)}),g.dispatch.on("elementMouseout.tooltip",function(){o.hidden(!0)}),b.dispatch=A,b.legend=m,b.lines=g,b.lines2=h,b.xAxis=i,b.yAxis=j,b.x2Axis=k,b.y2Axis=l,b.interactiveLayer=p,b.tooltip=o,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return t},set:function(a){t=a}},height:{get:function(){return u},set:function(a){u=a}},focusHeight:{get:function(){return v},set:function(a){v=a}},showLegend:{get:function(){return x},set:function(a){x=a}},brushExtent:{get:function(){return y},set:function(a){y=a}},defaultState:{get:function(){return D},set:function(a){D=a}},noData:{get:function(){return z},set:function(a){z=a}},tooltips:{get:function(){return o.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),o.enabled(!!b)}},tooltipContent:{get:function(){return o.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),o.contentGenerator(b)}},margin:{get:function(){return q},set:function(a){q.top=void 0!==a.top?a.top:q.top,q.right=void 0!==a.right?a.right:q.right,q.bottom=void 0!==a.bottom?a.bottom:q.bottom,q.left=void 0!==a.left?a.left:q.left}},color:{get:function(){return s},set:function(b){s=a.utils.getColor(b),m.color(s)}},interpolate:{get:function(){return g.interpolate()},set:function(a){g.interpolate(a),h.interpolate(a)}},xTickFormat:{get:function(){return i.tickFormat()},set:function(a){i.tickFormat(a),k.tickFormat(a)}},yTickFormat:{get:function(){return j.tickFormat()},set:function(a){j.tickFormat(a),l.tickFormat(a)}},duration:{get:function(){return B},set:function(a){B=a,j.duration(B),l.duration(B),i.duration(B),k.duration(B)}},x:{get:function(){return g.x()},set:function(a){g.x(a),h.x(a)}},y:{get:function(){return g.y()},set:function(a){g.y(a),h.y(a)}},useInteractiveGuideline:{get:function(){return w},set:function(a){w=a,w&&(g.interactive(!1),g.useVoronoi(!1))}}}),a.utils.inheritOptions(b,g),a.utils.initOptions(b),b},a.models.multiBar=function(){"use strict";function b(E){return C.reset(),E.each(function(b){var E=k-j.left-j.right,F=l-j.top-j.bottom;p=d3.select(this),a.utils.initSVG(p);var G=0;if(x&&b.length&&(x=[{values:b[0].values.map(function(a){return{x:a.x,y:0,series:a.series,size:.01}})}]),u){var H=d3.layout.stack().offset(v).values(function(a){return a.values}).y(r)(!b.length&&x?x:b);H.forEach(function(a,c){a.nonStackable?(b[c].nonStackableSeries=G++,H[c]=b[c]):c>0&&H[c-1].nonStackable&&H[c].values.map(function(a,b){a.y0-=H[c-1].values[b].y,a.y1=a.y0+a.y})}),b=H}b.forEach(function(a,b){a.values.forEach(function(c){c.series=b,c.key=a.key})}),u&&b[0].values.map(function(a,c){var d=0,e=0;b.map(function(a,f){if(!b[f].nonStackable){var g=a.values[c];g.size=Math.abs(g.y),g.y<0?(g.y1=e,e-=g.size):(g.y1=g.size+d,d+=g.size)}})});var I=d&&e?[]:b.map(function(a,b){return a.values.map(function(a,c){return{x:q(a,c),y:r(a,c),y0:a.y0,y1:a.y1,idx:b}})});m.domain(d||d3.merge(I).map(function(a){return a.x})).rangeBands(f||[0,E],A),n.domain(e||d3.extent(d3.merge(I).map(function(a){var c=a.y;return u&&!b[a.idx].nonStackable&&(c=a.y>0?a.y1:a.y1+a.y),c}).concat(s))).range(g||[F,0]),m.domain()[0]===m.domain()[1]&&m.domain(m.domain()[0]?[m.domain()[0]-.01*m.domain()[0],m.domain()[1]+.01*m.domain()[1]]:[-1,1]),n.domain()[0]===n.domain()[1]&&n.domain(n.domain()[0]?[n.domain()[0]+.01*n.domain()[0],n.domain()[1]-.01*n.domain()[1]]:[-1,1]),h=h||m,i=i||n;var J=p.selectAll("g.nv-wrap.nv-multibar").data([b]),K=J.enter().append("g").attr("class","nvd3 nv-wrap nv-multibar"),L=K.append("defs"),M=K.append("g"),N=J.select("g");M.append("g").attr("class","nv-groups"),J.attr("transform","translate("+j.left+","+j.top+")"),L.append("clipPath").attr("id","nv-edge-clip-"+o).append("rect"),J.select("#nv-edge-clip-"+o+" rect").attr("width",E).attr("height",F),N.attr("clip-path",t?"url(#nv-edge-clip-"+o+")":"");var O=J.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a,b){return b});O.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6);var P=C.transition(O.exit().selectAll("rect.nv-bar"),"multibarExit",Math.min(100,z)).attr("y",function(a){var c=i(0)||0;return u&&b[a.series]&&!b[a.series].nonStackable&&(c=i(a.y0)),c}).attr("height",0).remove();P.delay&&P.delay(function(a,b){var c=b*(z/(D+1))-b;return c}),O.attr("class",function(a,b){return"nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}).style("fill",function(a,b){return w(a,b)}).style("stroke",function(a,b){return w(a,b)}),O.style("stroke-opacity",1).style("fill-opacity",.75);var Q=O.selectAll("rect.nv-bar").data(function(a){return x&&!b.length?x.values:a.values});Q.exit().remove();Q.enter().append("rect").attr("class",function(a,b){return r(a,b)<0?"nv-bar negative":"nv-bar positive"}).attr("x",function(a,c,d){return u&&!b[d].nonStackable?0:d*m.rangeBand()/b.length}).attr("y",function(a,c,d){return i(u&&!b[d].nonStackable?a.y0:0)||0}).attr("height",0).attr("width",function(a,c,d){return m.rangeBand()/(u&&!b[d].nonStackable?1:b.length)}).attr("transform",function(a,b){return"translate("+m(q(a,b))+",0)"});Q.style("fill",function(a,b,c){return w(a,c,b)}).style("stroke",function(a,b,c){return w(a,c,b)}).on("mouseover",function(a,b){d3.select(this).classed("hover",!0),B.elementMouseover({data:a,index:b,color:d3.select(this).style("fill")})}).on("mouseout",function(a,b){d3.select(this).classed("hover",!1),B.elementMouseout({data:a,index:b,color:d3.select(this).style("fill")})}).on("mousemove",function(a,b){B.elementMousemove({data:a,index:b,color:d3.select(this).style("fill")})}).on("click",function(a,b){B.elementClick({data:a,index:b,color:d3.select(this).style("fill")}),d3.event.stopPropagation()}).on("dblclick",function(a,b){B.elementDblClick({data:a,index:b,color:d3.select(this).style("fill")}),d3.event.stopPropagation()}),Q.attr("class",function(a,b){return r(a,b)<0?"nv-bar negative":"nv-bar positive"}).attr("transform",function(a,b){return"translate("+m(q(a,b))+",0)"}),y&&(c||(c=b.map(function(){return!0})),Q.style("fill",function(a,b,d){return d3.rgb(y(a,b)).darker(c.map(function(a,b){return b}).filter(function(a,b){return!c[b]})[d]).toString()}).style("stroke",function(a,b,d){return d3.rgb(y(a,b)).darker(c.map(function(a,b){return b}).filter(function(a,b){return!c[b]})[d]).toString()}));var R=Q.watchTransition(C,"multibar",Math.min(250,z)).delay(function(a,c){return c*z/b[0].values.length});u?R.attr("y",function(a,c,d){var e=0;return e=b[d].nonStackable?r(a,c)<0?n(0):n(0)-n(r(a,c))<-1?n(0)-1:n(r(a,c))||0:n(a.y1)}).attr("height",function(a,c,d){return b[d].nonStackable?Math.max(Math.abs(n(r(a,c))-n(0)),1)||0:Math.max(Math.abs(n(a.y+a.y0)-n(a.y0)),1)}).attr("x",function(a,c,d){var e=0;return b[d].nonStackable&&(e=a.series*m.rangeBand()/b.length,b.length!==G&&(e=b[d].nonStackableSeries*m.rangeBand()/(2*G))),e}).attr("width",function(a,c,d){if(b[d].nonStackable){var e=m.rangeBand()/G;return b.length!==G&&(e=m.rangeBand()/(2*G)),e}return m.rangeBand()}):R.attr("x",function(a){return a.series*m.rangeBand()/b.length}).attr("width",m.rangeBand()/b.length).attr("y",function(a,b){return r(a,b)<0?n(0):n(0)-n(r(a,b))<1?n(0)-1:n(r(a,b))||0}).attr("height",function(a,b){return Math.max(Math.abs(n(r(a,b))-n(0)),1)||0}),h=m.copy(),i=n.copy(),b[0]&&b[0].values&&(D=b[0].values.length)}),C.renderEnd("multibar immediate"),b}var c,d,e,f,g,h,i,j={top:0,right:0,bottom:0,left:0},k=960,l=500,m=d3.scale.ordinal(),n=d3.scale.linear(),o=Math.floor(1e4*Math.random()),p=null,q=function(a){return a.x},r=function(a){return a.y},s=[0],t=!0,u=!1,v="zero",w=a.utils.defaultColor(),x=!1,y=null,z=500,A=.1,B=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),C=a.utils.renderWatch(B,z),D=0;return b.dispatch=B,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return k},set:function(a){k=a}},height:{get:function(){return l},set:function(a){l=a}},x:{get:function(){return q},set:function(a){q=a}},y:{get:function(){return r},set:function(a){r=a}},xScale:{get:function(){return m},set:function(a){m=a}},yScale:{get:function(){return n},set:function(a){n=a}},xDomain:{get:function(){return d},set:function(a){d=a}},yDomain:{get:function(){return e},set:function(a){e=a}},xRange:{get:function(){return f},set:function(a){f=a}},yRange:{get:function(){return g},set:function(a){g=a}},forceY:{get:function(){return s},set:function(a){s=a}},stacked:{get:function(){return u},set:function(a){u=a}},stackOffset:{get:function(){return v},set:function(a){v=a}},clipEdge:{get:function(){return t},set:function(a){t=a}},disabled:{get:function(){return c},set:function(a){c=a}},id:{get:function(){return o},set:function(a){o=a}},hideable:{get:function(){return x},set:function(a){x=a}},groupSpacing:{get:function(){return A},set:function(a){A=a}},margin:{get:function(){return j},set:function(a){j.top=void 0!==a.top?a.top:j.top,j.right=void 0!==a.right?a.right:j.right,j.bottom=void 0!==a.bottom?a.bottom:j.bottom,j.left=void 0!==a.left?a.left:j.left}},duration:{get:function(){return z},set:function(a){z=a,C.reset(z)}},color:{get:function(){return w},set:function(b){w=a.utils.getColor(b)}},barColor:{get:function(){return y},set:function(b){y=b?a.utils.getColor(b):null}}}),a.utils.initOptions(b),b},a.models.multiBarChart=function(){"use strict";function b(j){return D.reset(),D.models(e),r&&D.models(f),s&&D.models(g),j.each(function(j){var z=d3.select(this);a.utils.initSVG(z);var D=a.utils.availableWidth(l,z,k),H=a.utils.availableHeight(m,z,k);if(b.update=function(){0===C?z.call(b):z.transition().duration(C).call(b)},b.container=this,x.setter(G(j),b.update).getter(F(j)).update(),x.disabled=j.map(function(a){return!!a.disabled}),!y){var I;y={};for(I in x)y[I]=x[I]instanceof Array?x[I].slice(0):x[I]}if(!(j&&j.length&&j.filter(function(a){return a.values.length}).length))return a.utils.noData(b,z),b;z.selectAll(".nv-noData").remove(),c=e.xScale(),d=e.yScale(); -var J=z.selectAll("g.nv-wrap.nv-multiBarWithLegend").data([j]),K=J.enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarWithLegend").append("g"),L=J.select("g");if(K.append("g").attr("class","nv-x nv-axis"),K.append("g").attr("class","nv-y nv-axis"),K.append("g").attr("class","nv-barsWrap"),K.append("g").attr("class","nv-legendWrap"),K.append("g").attr("class","nv-controlsWrap"),q&&(h.width(D-B()),L.select(".nv-legendWrap").datum(j).call(h),k.top!=h.height()&&(k.top=h.height(),H=a.utils.availableHeight(m,z,k)),L.select(".nv-legendWrap").attr("transform","translate("+B()+","+-k.top+")")),o){var M=[{key:p.grouped||"Grouped",disabled:e.stacked()},{key:p.stacked||"Stacked",disabled:!e.stacked()}];i.width(B()).color(["#444","#444","#444"]),L.select(".nv-controlsWrap").datum(M).attr("transform","translate(0,"+-k.top+")").call(i)}J.attr("transform","translate("+k.left+","+k.top+")"),t&&L.select(".nv-y.nv-axis").attr("transform","translate("+D+",0)"),e.disabled(j.map(function(a){return a.disabled})).width(D).height(H).color(j.map(function(a,b){return a.color||n(a,b)}).filter(function(a,b){return!j[b].disabled}));var N=L.select(".nv-barsWrap").datum(j.filter(function(a){return!a.disabled}));if(N.call(e),r){f.scale(c)._ticks(a.utils.calcTicksX(D/100,j)).tickSize(-H,0),L.select(".nv-x.nv-axis").attr("transform","translate(0,"+d.range()[0]+")"),L.select(".nv-x.nv-axis").call(f);var O=L.select(".nv-x.nv-axis > g").selectAll("g");if(O.selectAll("line, text").style("opacity",1),v){var P=function(a,b){return"translate("+a+","+b+")"},Q=5,R=17;O.selectAll("text").attr("transform",function(a,b,c){return P(0,c%2==0?Q:R)});var S=d3.selectAll(".nv-x.nv-axis .nv-wrap g g text")[0].length;L.selectAll(".nv-x.nv-axis .nv-axisMaxMin text").attr("transform",function(a,b){return P(0,0===b||S%2!==0?R:Q)})}u&&O.filter(function(a,b){return b%Math.ceil(j[0].values.length/(D/100))!==0}).selectAll("text, line").style("opacity",0),w&&O.selectAll(".tick text").attr("transform","rotate("+w+" 0,0)").style("text-anchor",w>0?"start":"end"),L.select(".nv-x.nv-axis").selectAll("g.nv-axisMaxMin text").style("opacity",1)}s&&(g.scale(d)._ticks(a.utils.calcTicksY(H/36,j)).tickSize(-D,0),L.select(".nv-y.nv-axis").call(g)),h.dispatch.on("stateChange",function(a){for(var c in a)x[c]=a[c];A.stateChange(x),b.update()}),i.dispatch.on("legendClick",function(a){if(a.disabled){switch(M=M.map(function(a){return a.disabled=!0,a}),a.disabled=!1,a.key){case"Grouped":case p.grouped:e.stacked(!1);break;case"Stacked":case p.stacked:e.stacked(!0)}x.stacked=e.stacked(),A.stateChange(x),b.update()}}),A.on("changeState",function(a){"undefined"!=typeof a.disabled&&(j.forEach(function(b,c){b.disabled=a.disabled[c]}),x.disabled=a.disabled),"undefined"!=typeof a.stacked&&(e.stacked(a.stacked),x.stacked=a.stacked,E=a.stacked),b.update()})}),D.renderEnd("multibarchart immediate"),b}var c,d,e=a.models.multiBar(),f=a.models.axis(),g=a.models.axis(),h=a.models.legend(),i=a.models.legend(),j=a.models.tooltip(),k={top:30,right:20,bottom:50,left:60},l=null,m=null,n=a.utils.defaultColor(),o=!0,p={},q=!0,r=!0,s=!0,t=!1,u=!0,v=!1,w=0,x=a.utils.state(),y=null,z=null,A=d3.dispatch("stateChange","changeState","renderEnd"),B=function(){return o?180:0},C=250;x.stacked=!1,e.stacked(!1),f.orient("bottom").tickPadding(7).showMaxMin(!1).tickFormat(function(a){return a}),g.orient(t?"right":"left").tickFormat(d3.format(",.1f")),j.duration(0).valueFormatter(function(a,b){return g.tickFormat()(a,b)}).headerFormatter(function(a,b){return f.tickFormat()(a,b)}),i.updateState(!1);var D=a.utils.renderWatch(A),E=!1,F=function(a){return function(){return{active:a.map(function(a){return!a.disabled}),stacked:E}}},G=function(a){return function(b){void 0!==b.stacked&&(E=b.stacked),void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};return e.dispatch.on("elementMouseover.tooltip",function(a){a.value=b.x()(a.data),a.series={key:a.data.key,value:b.y()(a.data),color:a.color},j.data(a).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(){j.hidden(!0)}),e.dispatch.on("elementMousemove.tooltip",function(){j.position({top:d3.event.pageY,left:d3.event.pageX})()}),b.dispatch=A,b.multibar=e,b.legend=h,b.controls=i,b.xAxis=f,b.yAxis=g,b.state=x,b.tooltip=j,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return l},set:function(a){l=a}},height:{get:function(){return m},set:function(a){m=a}},showLegend:{get:function(){return q},set:function(a){q=a}},showControls:{get:function(){return o},set:function(a){o=a}},controlLabels:{get:function(){return p},set:function(a){p=a}},showXAxis:{get:function(){return r},set:function(a){r=a}},showYAxis:{get:function(){return s},set:function(a){s=a}},defaultState:{get:function(){return y},set:function(a){y=a}},noData:{get:function(){return z},set:function(a){z=a}},reduceXTicks:{get:function(){return u},set:function(a){u=a}},rotateLabels:{get:function(){return w},set:function(a){w=a}},staggerLabels:{get:function(){return v},set:function(a){v=a}},tooltips:{get:function(){return j.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),j.enabled(!!b)}},tooltipContent:{get:function(){return j.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),j.contentGenerator(b)}},margin:{get:function(){return k},set:function(a){k.top=void 0!==a.top?a.top:k.top,k.right=void 0!==a.right?a.right:k.right,k.bottom=void 0!==a.bottom?a.bottom:k.bottom,k.left=void 0!==a.left?a.left:k.left}},duration:{get:function(){return C},set:function(a){C=a,e.duration(C),f.duration(C),g.duration(C),D.reset(C)}},color:{get:function(){return n},set:function(b){n=a.utils.getColor(b),h.color(n)}},rightAlignYAxis:{get:function(){return t},set:function(a){t=a,g.orient(t?"right":"left")}},barColor:{get:function(){return e.barColor},set:function(a){e.barColor(a),h.color(function(a,b){return d3.rgb("#ccc").darker(1.5*b).toString()})}}}),a.utils.inheritOptions(b,e),a.utils.initOptions(b),b},a.models.multiBarHorizontal=function(){"use strict";function b(m){return E.reset(),m.each(function(b){var m=k-j.left-j.right,C=l-j.top-j.bottom;n=d3.select(this),a.utils.initSVG(n),w&&(b=d3.layout.stack().offset("zero").values(function(a){return a.values}).y(r)(b)),b.forEach(function(a,b){a.values.forEach(function(c){c.series=b,c.key=a.key})}),w&&b[0].values.map(function(a,c){var d=0,e=0;b.map(function(a){var b=a.values[c];b.size=Math.abs(b.y),b.y<0?(b.y1=e-b.size,e-=b.size):(b.y1=d,d+=b.size)})});var F=d&&e?[]:b.map(function(a){return a.values.map(function(a,b){return{x:q(a,b),y:r(a,b),y0:a.y0,y1:a.y1}})});o.domain(d||d3.merge(F).map(function(a){return a.x})).rangeBands(f||[0,C],A),p.domain(e||d3.extent(d3.merge(F).map(function(a){return w?a.y>0?a.y1+a.y:a.y1:a.y}).concat(t))),p.range(x&&!w?g||[p.domain()[0]<0?z:0,m-(p.domain()[1]>0?z:0)]:g||[0,m]),h=h||o,i=i||d3.scale.linear().domain(p.domain()).range([p(0),p(0)]);{var G=d3.select(this).selectAll("g.nv-wrap.nv-multibarHorizontal").data([b]),H=G.enter().append("g").attr("class","nvd3 nv-wrap nv-multibarHorizontal"),I=(H.append("defs"),H.append("g"));G.select("g")}I.append("g").attr("class","nv-groups"),G.attr("transform","translate("+j.left+","+j.top+")");var J=G.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a,b){return b});J.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),J.exit().watchTransition(E,"multibarhorizontal: exit groups").style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),J.attr("class",function(a,b){return"nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}).style("fill",function(a,b){return u(a,b)}).style("stroke",function(a,b){return u(a,b)}),J.watchTransition(E,"multibarhorizontal: groups").style("stroke-opacity",1).style("fill-opacity",.75);var K=J.selectAll("g.nv-bar").data(function(a){return a.values});K.exit().remove();var L=K.enter().append("g").attr("transform",function(a,c,d){return"translate("+i(w?a.y0:0)+","+(w?0:d*o.rangeBand()/b.length+o(q(a,c)))+")"});L.append("rect").attr("width",0).attr("height",o.rangeBand()/(w?1:b.length)),K.on("mouseover",function(a,b){d3.select(this).classed("hover",!0),D.elementMouseover({data:a,index:b,color:d3.select(this).style("fill")})}).on("mouseout",function(a,b){d3.select(this).classed("hover",!1),D.elementMouseout({data:a,index:b,color:d3.select(this).style("fill")})}).on("mouseout",function(a,b){D.elementMouseout({data:a,index:b,color:d3.select(this).style("fill")})}).on("mousemove",function(a,b){D.elementMousemove({data:a,index:b,color:d3.select(this).style("fill")})}).on("click",function(a,b){D.elementClick({data:a,index:b,color:d3.select(this).style("fill")}),d3.event.stopPropagation()}).on("dblclick",function(a,b){D.elementDblClick({data:a,index:b,color:d3.select(this).style("fill")}),d3.event.stopPropagation()}),s(b[0],0)&&(L.append("polyline"),K.select("polyline").attr("fill","none").attr("points",function(a,c){var d=s(a,c),e=.8*o.rangeBand()/(2*(w?1:b.length));d=d.length?d:[-Math.abs(d),Math.abs(d)],d=d.map(function(a){return p(a)-p(0)});var f=[[d[0],-e],[d[0],e],[d[0],0],[d[1],0],[d[1],-e],[d[1],e]];return f.map(function(a){return a.join(",")}).join(" ")}).attr("transform",function(a,c){var d=o.rangeBand()/(2*(w?1:b.length));return"translate("+(r(a,c)<0?0:p(r(a,c))-p(0))+", "+d+")"})),L.append("text"),x&&!w?(K.select("text").attr("text-anchor",function(a,b){return r(a,b)<0?"end":"start"}).attr("y",o.rangeBand()/(2*b.length)).attr("dy",".32em").text(function(a,b){var c=B(r(a,b)),d=s(a,b);return void 0===d?c:d.length?c+"+"+B(Math.abs(d[1]))+"-"+B(Math.abs(d[0])):c+"±"+B(Math.abs(d))}),K.watchTransition(E,"multibarhorizontal: bars").select("text").attr("x",function(a,b){return r(a,b)<0?-4:p(r(a,b))-p(0)+4})):K.selectAll("text").text(""),y&&!w?(L.append("text").classed("nv-bar-label",!0),K.select("text.nv-bar-label").attr("text-anchor",function(a,b){return r(a,b)<0?"start":"end"}).attr("y",o.rangeBand()/(2*b.length)).attr("dy",".32em").text(function(a,b){return q(a,b)}),K.watchTransition(E,"multibarhorizontal: bars").select("text.nv-bar-label").attr("x",function(a,b){return r(a,b)<0?p(0)-p(r(a,b))+4:-4})):K.selectAll("text.nv-bar-label").text(""),K.attr("class",function(a,b){return r(a,b)<0?"nv-bar negative":"nv-bar positive"}),v&&(c||(c=b.map(function(){return!0})),K.style("fill",function(a,b,d){return d3.rgb(v(a,b)).darker(c.map(function(a,b){return b}).filter(function(a,b){return!c[b]})[d]).toString()}).style("stroke",function(a,b,d){return d3.rgb(v(a,b)).darker(c.map(function(a,b){return b}).filter(function(a,b){return!c[b]})[d]).toString()})),w?K.watchTransition(E,"multibarhorizontal: bars").attr("transform",function(a,b){return"translate("+p(a.y1)+","+o(q(a,b))+")"}).select("rect").attr("width",function(a,b){return Math.abs(p(r(a,b)+a.y0)-p(a.y0))}).attr("height",o.rangeBand()):K.watchTransition(E,"multibarhorizontal: bars").attr("transform",function(a,c){return"translate("+p(r(a,c)<0?r(a,c):0)+","+(a.series*o.rangeBand()/b.length+o(q(a,c)))+")"}).select("rect").attr("height",o.rangeBand()/b.length).attr("width",function(a,b){return Math.max(Math.abs(p(r(a,b))-p(0)),1)}),h=o.copy(),i=p.copy()}),E.renderEnd("multibarHorizontal immediate"),b}var c,d,e,f,g,h,i,j={top:0,right:0,bottom:0,left:0},k=960,l=500,m=Math.floor(1e4*Math.random()),n=null,o=d3.scale.ordinal(),p=d3.scale.linear(),q=function(a){return a.x},r=function(a){return a.y},s=function(a){return a.yErr},t=[0],u=a.utils.defaultColor(),v=null,w=!1,x=!1,y=!1,z=60,A=.1,B=d3.format(",.2f"),C=250,D=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),E=a.utils.renderWatch(D,C);return b.dispatch=D,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return k},set:function(a){k=a}},height:{get:function(){return l},set:function(a){l=a}},x:{get:function(){return q},set:function(a){q=a}},y:{get:function(){return r},set:function(a){r=a}},yErr:{get:function(){return s},set:function(a){s=a}},xScale:{get:function(){return o},set:function(a){o=a}},yScale:{get:function(){return p},set:function(a){p=a}},xDomain:{get:function(){return d},set:function(a){d=a}},yDomain:{get:function(){return e},set:function(a){e=a}},xRange:{get:function(){return f},set:function(a){f=a}},yRange:{get:function(){return g},set:function(a){g=a}},forceY:{get:function(){return t},set:function(a){t=a}},stacked:{get:function(){return w},set:function(a){w=a}},showValues:{get:function(){return x},set:function(a){x=a}},disabled:{get:function(){return c},set:function(a){c=a}},id:{get:function(){return m},set:function(a){m=a}},valueFormat:{get:function(){return B},set:function(a){B=a}},valuePadding:{get:function(){return z},set:function(a){z=a}},groupSpacing:{get:function(){return A},set:function(a){A=a}},margin:{get:function(){return j},set:function(a){j.top=void 0!==a.top?a.top:j.top,j.right=void 0!==a.right?a.right:j.right,j.bottom=void 0!==a.bottom?a.bottom:j.bottom,j.left=void 0!==a.left?a.left:j.left}},duration:{get:function(){return C},set:function(a){C=a,E.reset(C)}},color:{get:function(){return u},set:function(b){u=a.utils.getColor(b)}},barColor:{get:function(){return v},set:function(b){v=b?a.utils.getColor(b):null}}}),a.utils.initOptions(b),b},a.models.multiBarHorizontalChart=function(){"use strict";function b(j){return C.reset(),C.models(e),r&&C.models(f),s&&C.models(g),j.each(function(j){var w=d3.select(this);a.utils.initSVG(w);var C=a.utils.availableWidth(l,w,k),D=a.utils.availableHeight(m,w,k);if(b.update=function(){w.transition().duration(z).call(b)},b.container=this,t=e.stacked(),u.setter(B(j),b.update).getter(A(j)).update(),u.disabled=j.map(function(a){return!!a.disabled}),!v){var E;v={};for(E in u)v[E]=u[E]instanceof Array?u[E].slice(0):u[E]}if(!(j&&j.length&&j.filter(function(a){return a.values.length}).length))return a.utils.noData(b,w),b;w.selectAll(".nv-noData").remove(),c=e.xScale(),d=e.yScale();var F=w.selectAll("g.nv-wrap.nv-multiBarHorizontalChart").data([j]),G=F.enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarHorizontalChart").append("g"),H=F.select("g");if(G.append("g").attr("class","nv-x nv-axis"),G.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),G.append("g").attr("class","nv-barsWrap"),G.append("g").attr("class","nv-legendWrap"),G.append("g").attr("class","nv-controlsWrap"),q&&(h.width(C-y()),H.select(".nv-legendWrap").datum(j).call(h),k.top!=h.height()&&(k.top=h.height(),D=a.utils.availableHeight(m,w,k)),H.select(".nv-legendWrap").attr("transform","translate("+y()+","+-k.top+")")),o){var I=[{key:p.grouped||"Grouped",disabled:e.stacked()},{key:p.stacked||"Stacked",disabled:!e.stacked()}];i.width(y()).color(["#444","#444","#444"]),H.select(".nv-controlsWrap").datum(I).attr("transform","translate(0,"+-k.top+")").call(i)}F.attr("transform","translate("+k.left+","+k.top+")"),e.disabled(j.map(function(a){return a.disabled})).width(C).height(D).color(j.map(function(a,b){return a.color||n(a,b)}).filter(function(a,b){return!j[b].disabled}));var J=H.select(".nv-barsWrap").datum(j.filter(function(a){return!a.disabled}));if(J.transition().call(e),r){f.scale(c)._ticks(a.utils.calcTicksY(D/24,j)).tickSize(-C,0),H.select(".nv-x.nv-axis").call(f);var K=H.select(".nv-x.nv-axis").selectAll("g");K.selectAll("line, text")}s&&(g.scale(d)._ticks(a.utils.calcTicksX(C/100,j)).tickSize(-D,0),H.select(".nv-y.nv-axis").attr("transform","translate(0,"+D+")"),H.select(".nv-y.nv-axis").call(g)),H.select(".nv-zeroLine line").attr("x1",d(0)).attr("x2",d(0)).attr("y1",0).attr("y2",-D),h.dispatch.on("stateChange",function(a){for(var c in a)u[c]=a[c];x.stateChange(u),b.update()}),i.dispatch.on("legendClick",function(a){if(a.disabled){switch(I=I.map(function(a){return a.disabled=!0,a}),a.disabled=!1,a.key){case"Grouped":e.stacked(!1);break;case"Stacked":e.stacked(!0)}u.stacked=e.stacked(),x.stateChange(u),t=e.stacked(),b.update()}}),x.on("changeState",function(a){"undefined"!=typeof a.disabled&&(j.forEach(function(b,c){b.disabled=a.disabled[c]}),u.disabled=a.disabled),"undefined"!=typeof a.stacked&&(e.stacked(a.stacked),u.stacked=a.stacked,t=a.stacked),b.update()})}),C.renderEnd("multibar horizontal chart immediate"),b}var c,d,e=a.models.multiBarHorizontal(),f=a.models.axis(),g=a.models.axis(),h=a.models.legend().height(30),i=a.models.legend().height(30),j=a.models.tooltip(),k={top:30,right:20,bottom:50,left:60},l=null,m=null,n=a.utils.defaultColor(),o=!0,p={},q=!0,r=!0,s=!0,t=!1,u=a.utils.state(),v=null,w=null,x=d3.dispatch("stateChange","changeState","renderEnd"),y=function(){return o?180:0},z=250;u.stacked=!1,e.stacked(t),f.orient("left").tickPadding(5).showMaxMin(!1).tickFormat(function(a){return a}),g.orient("bottom").tickFormat(d3.format(",.1f")),j.duration(0).valueFormatter(function(a,b){return g.tickFormat()(a,b)}).headerFormatter(function(a,b){return f.tickFormat()(a,b)}),i.updateState(!1);var A=function(a){return function(){return{active:a.map(function(a){return!a.disabled}),stacked:t}}},B=function(a){return function(b){void 0!==b.stacked&&(t=b.stacked),void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}},C=a.utils.renderWatch(x,z);return e.dispatch.on("elementMouseover.tooltip",function(a){a.value=b.x()(a.data),a.series={key:a.data.key,value:b.y()(a.data),color:a.color},j.data(a).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(){j.hidden(!0)}),e.dispatch.on("elementMousemove.tooltip",function(){j.position({top:d3.event.pageY,left:d3.event.pageX})()}),b.dispatch=x,b.multibar=e,b.legend=h,b.controls=i,b.xAxis=f,b.yAxis=g,b.state=u,b.tooltip=j,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return l},set:function(a){l=a}},height:{get:function(){return m},set:function(a){m=a}},showLegend:{get:function(){return q},set:function(a){q=a}},showControls:{get:function(){return o},set:function(a){o=a}},controlLabels:{get:function(){return p},set:function(a){p=a}},showXAxis:{get:function(){return r},set:function(a){r=a}},showYAxis:{get:function(){return s},set:function(a){s=a}},defaultState:{get:function(){return v},set:function(a){v=a}},noData:{get:function(){return w},set:function(a){w=a}},tooltips:{get:function(){return j.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),j.enabled(!!b)}},tooltipContent:{get:function(){return j.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),j.contentGenerator(b)}},margin:{get:function(){return k},set:function(a){k.top=void 0!==a.top?a.top:k.top,k.right=void 0!==a.right?a.right:k.right,k.bottom=void 0!==a.bottom?a.bottom:k.bottom,k.left=void 0!==a.left?a.left:k.left}},duration:{get:function(){return z},set:function(a){z=a,C.reset(z),e.duration(z),f.duration(z),g.duration(z)}},color:{get:function(){return n},set:function(b){n=a.utils.getColor(b),h.color(n)}},barColor:{get:function(){return e.barColor},set:function(a){e.barColor(a),h.color(function(a,b){return d3.rgb("#ccc").darker(1.5*b).toString()})}}}),a.utils.inheritOptions(b,e),a.utils.initOptions(b),b},a.models.multiChart=function(){"use strict";function b(j){return j.each(function(j){function k(a){var b=2===j[a.seriesIndex].yAxis?z:y;a.value=a.point.x,a.series={value:a.point.y,color:a.point.color},B.duration(100).valueFormatter(function(a,c){return b.tickFormat()(a,c)}).data(a).position(a.pos).hidden(!1)}function l(a){var b=2===j[a.seriesIndex].yAxis?z:y;a.point.x=v.x()(a.point),a.point.y=v.y()(a.point),B.duration(100).valueFormatter(function(a,c){return b.tickFormat()(a,c)}).data(a).position(a.pos).hidden(!1)}function n(a){var b=2===j[a.data.series].yAxis?z:y;a.value=t.x()(a.data),a.series={value:t.y()(a.data),color:a.color},B.duration(0).valueFormatter(function(a,c){return b.tickFormat()(a,c)}).data(a).hidden(!1)}var C=d3.select(this);a.utils.initSVG(C),b.update=function(){C.transition().call(b)},b.container=this;var D=a.utils.availableWidth(g,C,e),E=a.utils.availableHeight(h,C,e),F=j.filter(function(a){return"line"==a.type&&1==a.yAxis}),G=j.filter(function(a){return"line"==a.type&&2==a.yAxis}),H=j.filter(function(a){return"bar"==a.type&&1==a.yAxis}),I=j.filter(function(a){return"bar"==a.type&&2==a.yAxis}),J=j.filter(function(a){return"area"==a.type&&1==a.yAxis}),K=j.filter(function(a){return"area"==a.type&&2==a.yAxis});if(!(j&&j.length&&j.filter(function(a){return a.values.length}).length))return a.utils.noData(b,C),b;C.selectAll(".nv-noData").remove();var L=j.filter(function(a){return!a.disabled&&1==a.yAxis}).map(function(a){return a.values.map(function(a){return{x:a.x,y:a.y}})}),M=j.filter(function(a){return!a.disabled&&2==a.yAxis}).map(function(a){return a.values.map(function(a){return{x:a.x,y:a.y}})});o.domain(d3.extent(d3.merge(L.concat(M)),function(a){return a.x})).range([0,D]);var N=C.selectAll("g.wrap.multiChart").data([j]),O=N.enter().append("g").attr("class","wrap nvd3 multiChart").append("g");O.append("g").attr("class","nv-x nv-axis"),O.append("g").attr("class","nv-y1 nv-axis"),O.append("g").attr("class","nv-y2 nv-axis"),O.append("g").attr("class","lines1Wrap"),O.append("g").attr("class","lines2Wrap"),O.append("g").attr("class","bars1Wrap"),O.append("g").attr("class","bars2Wrap"),O.append("g").attr("class","stack1Wrap"),O.append("g").attr("class","stack2Wrap"),O.append("g").attr("class","legendWrap");var P=N.select("g"),Q=j.map(function(a,b){return j[b].color||f(a,b)});if(i){var R=A.align()?D/2:D,S=A.align()?R:0;A.width(R),A.color(Q),P.select(".legendWrap").datum(j.map(function(a){return a.originalKey=void 0===a.originalKey?a.key:a.originalKey,a.key=a.originalKey+(1==a.yAxis?"":" (right axis)"),a})).call(A),e.top!=A.height()&&(e.top=A.height(),E=a.utils.availableHeight(h,C,e)),P.select(".legendWrap").attr("transform","translate("+S+","+-e.top+")")}r.width(D).height(E).interpolate(m).color(Q.filter(function(a,b){return!j[b].disabled&&1==j[b].yAxis&&"line"==j[b].type})),s.width(D).height(E).interpolate(m).color(Q.filter(function(a,b){return!j[b].disabled&&2==j[b].yAxis&&"line"==j[b].type})),t.width(D).height(E).color(Q.filter(function(a,b){return!j[b].disabled&&1==j[b].yAxis&&"bar"==j[b].type})),u.width(D).height(E).color(Q.filter(function(a,b){return!j[b].disabled&&2==j[b].yAxis&&"bar"==j[b].type})),v.width(D).height(E).color(Q.filter(function(a,b){return!j[b].disabled&&1==j[b].yAxis&&"area"==j[b].type})),w.width(D).height(E).color(Q.filter(function(a,b){return!j[b].disabled&&2==j[b].yAxis&&"area"==j[b].type})),P.attr("transform","translate("+e.left+","+e.top+")");var T=P.select(".lines1Wrap").datum(F.filter(function(a){return!a.disabled})),U=P.select(".bars1Wrap").datum(H.filter(function(a){return!a.disabled})),V=P.select(".stack1Wrap").datum(J.filter(function(a){return!a.disabled})),W=P.select(".lines2Wrap").datum(G.filter(function(a){return!a.disabled})),X=P.select(".bars2Wrap").datum(I.filter(function(a){return!a.disabled})),Y=P.select(".stack2Wrap").datum(K.filter(function(a){return!a.disabled})),Z=J.length?J.map(function(a){return a.values}).reduce(function(a,b){return a.map(function(a,c){return{x:a.x,y:a.y+b[c].y}})}).concat([{x:0,y:0}]):[],$=K.length?K.map(function(a){return a.values}).reduce(function(a,b){return a.map(function(a,c){return{x:a.x,y:a.y+b[c].y}})}).concat([{x:0,y:0}]):[];p.domain(c||d3.extent(d3.merge(L).concat(Z),function(a){return a.y})).range([0,E]),q.domain(d||d3.extent(d3.merge(M).concat($),function(a){return a.y})).range([0,E]),r.yDomain(p.domain()),t.yDomain(p.domain()),v.yDomain(p.domain()),s.yDomain(q.domain()),u.yDomain(q.domain()),w.yDomain(q.domain()),J.length&&d3.transition(V).call(v),K.length&&d3.transition(Y).call(w),H.length&&d3.transition(U).call(t),I.length&&d3.transition(X).call(u),F.length&&d3.transition(T).call(r),G.length&&d3.transition(W).call(s),x._ticks(a.utils.calcTicksX(D/100,j)).tickSize(-E,0),P.select(".nv-x.nv-axis").attr("transform","translate(0,"+E+")"),d3.transition(P.select(".nv-x.nv-axis")).call(x),y._ticks(a.utils.calcTicksY(E/36,j)).tickSize(-D,0),d3.transition(P.select(".nv-y1.nv-axis")).call(y),z._ticks(a.utils.calcTicksY(E/36,j)).tickSize(-D,0),d3.transition(P.select(".nv-y2.nv-axis")).call(z),P.select(".nv-y1.nv-axis").classed("nv-disabled",L.length?!1:!0).attr("transform","translate("+o.range()[0]+",0)"),P.select(".nv-y2.nv-axis").classed("nv-disabled",M.length?!1:!0).attr("transform","translate("+o.range()[1]+",0)"),A.dispatch.on("stateChange",function(){b.update()}),r.dispatch.on("elementMouseover.tooltip",k),s.dispatch.on("elementMouseover.tooltip",k),r.dispatch.on("elementMouseout.tooltip",function(){B.hidden(!0)}),s.dispatch.on("elementMouseout.tooltip",function(){B.hidden(!0)}),v.dispatch.on("elementMouseover.tooltip",l),w.dispatch.on("elementMouseover.tooltip",l),v.dispatch.on("elementMouseout.tooltip",function(){B.hidden(!0)}),w.dispatch.on("elementMouseout.tooltip",function(){B.hidden(!0)}),t.dispatch.on("elementMouseover.tooltip",n),u.dispatch.on("elementMouseover.tooltip",n),t.dispatch.on("elementMouseout.tooltip",function(){B.hidden(!0)}),u.dispatch.on("elementMouseout.tooltip",function(){B.hidden(!0)}),t.dispatch.on("elementMousemove.tooltip",function(){B.position({top:d3.event.pageY,left:d3.event.pageX})()}),u.dispatch.on("elementMousemove.tooltip",function(){B.position({top:d3.event.pageY,left:d3.event.pageX})()})}),b}var c,d,e={top:30,right:20,bottom:50,left:60},f=a.utils.defaultColor(),g=null,h=null,i=!0,j=null,k=function(a){return a.x},l=function(a){return a.y},m="monotone",n=!0,o=d3.scale.linear(),p=d3.scale.linear(),q=d3.scale.linear(),r=a.models.line().yScale(p),s=a.models.line().yScale(q),t=a.models.multiBar().stacked(!1).yScale(p),u=a.models.multiBar().stacked(!1).yScale(q),v=a.models.stackedArea().yScale(p),w=a.models.stackedArea().yScale(q),x=a.models.axis().scale(o).orient("bottom").tickPadding(5),y=a.models.axis().scale(p).orient("left"),z=a.models.axis().scale(q).orient("right"),A=a.models.legend().height(30),B=a.models.tooltip(),C=d3.dispatch();return b.dispatch=C,b.lines1=r,b.lines2=s,b.bars1=t,b.bars2=u,b.stack1=v,b.stack2=w,b.xAxis=x,b.yAxis1=y,b.yAxis2=z,b.tooltip=B,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return g},set:function(a){g=a}},height:{get:function(){return h},set:function(a){h=a}},showLegend:{get:function(){return i},set:function(a){i=a}},yDomain1:{get:function(){return c},set:function(a){c=a}},yDomain2:{get:function(){return d},set:function(a){d=a}},noData:{get:function(){return j},set:function(a){j=a}},interpolate:{get:function(){return m},set:function(a){m=a}},tooltips:{get:function(){return B.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),B.enabled(!!b)}},tooltipContent:{get:function(){return B.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),B.contentGenerator(b)}},margin:{get:function(){return e},set:function(a){e.top=void 0!==a.top?a.top:e.top,e.right=void 0!==a.right?a.right:e.right,e.bottom=void 0!==a.bottom?a.bottom:e.bottom,e.left=void 0!==a.left?a.left:e.left}},color:{get:function(){return f},set:function(b){f=a.utils.getColor(b)}},x:{get:function(){return k},set:function(a){k=a,r.x(a),s.x(a),t.x(a),u.x(a),v.x(a),w.x(a)}},y:{get:function(){return l},set:function(a){l=a,r.y(a),s.y(a),v.y(a),w.y(a),t.y(a),u.y(a)}},useVoronoi:{get:function(){return n},set:function(a){n=a,r.useVoronoi(a),s.useVoronoi(a),v.useVoronoi(a),w.useVoronoi(a)}}}),a.utils.initOptions(b),b},a.models.ohlcBar=function(){"use strict";function b(y){return y.each(function(b){k=d3.select(this);var y=a.utils.availableWidth(h,k,g),A=a.utils.availableHeight(i,k,g);a.utils.initSVG(k);var B=y/b[0].values.length*.9;l.domain(c||d3.extent(b[0].values.map(n).concat(t))),l.range(v?e||[.5*y/b[0].values.length,y*(b[0].values.length-.5)/b[0].values.length]:e||[5+B/2,y-B/2-5]),m.domain(d||[d3.min(b[0].values.map(s).concat(u)),d3.max(b[0].values.map(r).concat(u))]).range(f||[A,0]),l.domain()[0]===l.domain()[1]&&l.domain(l.domain()[0]?[l.domain()[0]-.01*l.domain()[0],l.domain()[1]+.01*l.domain()[1]]:[-1,1]),m.domain()[0]===m.domain()[1]&&m.domain(m.domain()[0]?[m.domain()[0]+.01*m.domain()[0],m.domain()[1]-.01*m.domain()[1]]:[-1,1]);var C=d3.select(this).selectAll("g.nv-wrap.nv-ohlcBar").data([b[0].values]),D=C.enter().append("g").attr("class","nvd3 nv-wrap nv-ohlcBar"),E=D.append("defs"),F=D.append("g"),G=C.select("g");F.append("g").attr("class","nv-ticks"),C.attr("transform","translate("+g.left+","+g.top+")"),k.on("click",function(a,b){z.chartClick({data:a,index:b,pos:d3.event,id:j})}),E.append("clipPath").attr("id","nv-chart-clip-path-"+j).append("rect"),C.select("#nv-chart-clip-path-"+j+" rect").attr("width",y).attr("height",A),G.attr("clip-path",w?"url(#nv-chart-clip-path-"+j+")":"");var H=C.select(".nv-ticks").selectAll(".nv-tick").data(function(a){return a});H.exit().remove(),H.enter().append("path").attr("class",function(a,b,c){return(p(a,b)>q(a,b)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+c+"-"+b}).attr("d",function(a,b){return"m0,0l0,"+(m(p(a,b))-m(r(a,b)))+"l"+-B/2+",0l"+B/2+",0l0,"+(m(s(a,b))-m(p(a,b)))+"l0,"+(m(q(a,b))-m(s(a,b)))+"l"+B/2+",0l"+-B/2+",0z"}).attr("transform",function(a,b){return"translate("+l(n(a,b))+","+m(r(a,b))+")"}).attr("fill",function(){return x[0]}).attr("stroke",function(){return x[0]}).attr("x",0).attr("y",function(a,b){return m(Math.max(0,o(a,b)))}).attr("height",function(a,b){return Math.abs(m(o(a,b))-m(0))}),H.attr("class",function(a,b,c){return(p(a,b)>q(a,b)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+c+"-"+b}),d3.transition(H).attr("transform",function(a,b){return"translate("+l(n(a,b))+","+m(r(a,b))+")"}).attr("d",function(a,c){var d=y/b[0].values.length*.9;return"m0,0l0,"+(m(p(a,c))-m(r(a,c)))+"l"+-d/2+",0l"+d/2+",0l0,"+(m(s(a,c))-m(p(a,c)))+"l0,"+(m(q(a,c))-m(s(a,c)))+"l"+d/2+",0l"+-d/2+",0z"})}),b}var c,d,e,f,g={top:0,right:0,bottom:0,left:0},h=null,i=null,j=Math.floor(1e4*Math.random()),k=null,l=d3.scale.linear(),m=d3.scale.linear(),n=function(a){return a.x},o=function(a){return a.y},p=function(a){return a.open},q=function(a){return a.close},r=function(a){return a.high},s=function(a){return a.low},t=[],u=[],v=!1,w=!0,x=a.utils.defaultColor(),y=!1,z=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState","renderEnd","chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove");return b.highlightPoint=function(a,c){b.clearHighlights(),k.select(".nv-ohlcBar .nv-tick-0-"+a).classed("hover",c)},b.clearHighlights=function(){k.select(".nv-ohlcBar .nv-tick.hover").classed("hover",!1)},b.dispatch=z,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return h},set:function(a){h=a}},height:{get:function(){return i},set:function(a){i=a}},xScale:{get:function(){return l},set:function(a){l=a}},yScale:{get:function(){return m},set:function(a){m=a}},xDomain:{get:function(){return c},set:function(a){c=a}},yDomain:{get:function(){return d},set:function(a){d=a}},xRange:{get:function(){return e},set:function(a){e=a}},yRange:{get:function(){return f},set:function(a){f=a}},forceX:{get:function(){return t},set:function(a){t=a}},forceY:{get:function(){return u},set:function(a){u=a}},padData:{get:function(){return v},set:function(a){v=a}},clipEdge:{get:function(){return w},set:function(a){w=a}},id:{get:function(){return j},set:function(a){j=a}},interactive:{get:function(){return y},set:function(a){y=a}},x:{get:function(){return n},set:function(a){n=a}},y:{get:function(){return o},set:function(a){o=a}},open:{get:function(){return p()},set:function(a){p=a}},close:{get:function(){return q()},set:function(a){q=a}},high:{get:function(){return r},set:function(a){r=a}},low:{get:function(){return s},set:function(a){s=a}},margin:{get:function(){return g},set:function(a){g.top=void 0!=a.top?a.top:g.top,g.right=void 0!=a.right?a.right:g.right,g.bottom=void 0!=a.bottom?a.bottom:g.bottom,g.left=void 0!=a.left?a.left:g.left -}},color:{get:function(){return x},set:function(b){x=a.utils.getColor(b)}}}),a.utils.initOptions(b),b},a.models.parallelCoordinates=function(){"use strict";function b(p){return p.each(function(b){function p(a){return F(h.map(function(b){if(isNaN(a[b])||isNaN(parseFloat(a[b]))){var c=g[b].domain(),d=g[b].range(),e=c[0]-(c[1]-c[0])/9;if(J.indexOf(b)<0){var h=d3.scale.linear().domain([e,c[1]]).range([x-12,d[1]]);g[b].brush.y(h),J.push(b)}return[f(b),g[b](e)]}return J.length>0?(D.style("display","inline"),E.style("display","inline")):(D.style("display","none"),E.style("display","none")),[f(b),g[b](a[b])]}))}function q(){var a=h.filter(function(a){return!g[a].brush.empty()}),b=a.map(function(a){return g[a].brush.extent()});k=[],a.forEach(function(a,c){k[c]={dimension:a,extent:b[c]}}),l=[],M.style("display",function(c){var d=a.every(function(a,d){return isNaN(c[a])&&b[d][0]==g[a].brush.y().domain()[0]?!0:b[d][0]<=c[a]&&c[a]<=b[d][1]});return d&&l.push(c),d?null:"none"}),o.brush({filters:k,active:l})}function r(a){m[a]=this.parentNode.__origin__=f(a),L.attr("visibility","hidden")}function s(a){m[a]=Math.min(w,Math.max(0,this.parentNode.__origin__+=d3.event.x)),M.attr("d",p),h.sort(function(a,b){return u(a)-u(b)}),f.domain(h),N.attr("transform",function(a){return"translate("+u(a)+")"})}function t(a){delete this.parentNode.__origin__,delete m[a],d3.select(this.parentNode).attr("transform","translate("+f(a)+")"),M.attr("d",p),L.attr("d",p).attr("visibility",null)}function u(a){var b=m[a];return null==b?f(a):b}var v=d3.select(this),w=a.utils.availableWidth(d,v,c),x=a.utils.availableHeight(e,v,c);a.utils.initSVG(v),l=b,f.rangePoints([0,w],1).domain(h);var y={};h.forEach(function(a){var c=d3.extent(b,function(b){return+b[a]});return y[a]=!1,void 0===c[0]&&(y[a]=!0,c[0]=0,c[1]=0),c[0]===c[1]&&(c[0]=c[0]-1,c[1]=c[1]+1),g[a]=d3.scale.linear().domain(c).range([.9*(x-12),0]),g[a].brush=d3.svg.brush().y(g[a]).on("brush",q),"name"!=a});var z=v.selectAll("g.nv-wrap.nv-parallelCoordinates").data([b]),A=z.enter().append("g").attr("class","nvd3 nv-wrap nv-parallelCoordinates"),B=A.append("g"),C=z.select("g");B.append("g").attr("class","nv-parallelCoordinates background"),B.append("g").attr("class","nv-parallelCoordinates foreground"),B.append("g").attr("class","nv-parallelCoordinates missingValuesline"),z.attr("transform","translate("+c.left+","+c.top+")");var D,E,F=d3.svg.line().interpolate("cardinal").tension(n),G=d3.svg.axis().orient("left"),H=d3.behavior.drag().on("dragstart",r).on("drag",s).on("dragend",t),I=f.range()[1]-f.range()[0],J=[],K=[0+I/2,x-12,w-I/2,x-12];D=z.select(".missingValuesline").selectAll("line").data([K]),D.enter().append("line"),D.exit().remove(),D.attr("x1",function(a){return a[0]}).attr("y1",function(a){return a[1]}).attr("x2",function(a){return a[2]}).attr("y2",function(a){return a[3]}),E=z.select(".missingValuesline").selectAll("text").data(["undefined values"]),E.append("text").data(["undefined values"]),E.enter().append("text"),E.exit().remove(),E.attr("y",x).attr("x",w-92-I/2).text(function(a){return a});var L=z.select(".background").selectAll("path").data(b);L.enter().append("path"),L.exit().remove(),L.attr("d",p);var M=z.select(".foreground").selectAll("path").data(b);M.enter().append("path"),M.exit().remove(),M.attr("d",p).attr("stroke",j),M.on("mouseover",function(a,b){d3.select(this).classed("hover",!0),o.elementMouseover({label:a.name,data:a.data,index:b,pos:[d3.mouse(this.parentNode)[0],d3.mouse(this.parentNode)[1]]})}),M.on("mouseout",function(a,b){d3.select(this).classed("hover",!1),o.elementMouseout({label:a.name,data:a.data,index:b})});var N=C.selectAll(".dimension").data(h),O=N.enter().append("g").attr("class","nv-parallelCoordinates dimension");O.append("g").attr("class","nv-parallelCoordinates nv-axis"),O.append("g").attr("class","nv-parallelCoordinates-brush"),O.append("text").attr("class","nv-parallelCoordinates nv-label"),N.attr("transform",function(a){return"translate("+f(a)+",0)"}),N.exit().remove(),N.select(".nv-label").style("cursor","move").attr("dy","-1em").attr("text-anchor","middle").text(String).on("mouseover",function(a){o.elementMouseover({dim:a,pos:[d3.mouse(this.parentNode.parentNode)[0],d3.mouse(this.parentNode.parentNode)[1]]})}).on("mouseout",function(a){o.elementMouseout({dim:a})}).call(H),N.select(".nv-axis").each(function(a,b){d3.select(this).call(G.scale(g[a]).tickFormat(d3.format(i[b])))}),N.select(".nv-parallelCoordinates-brush").each(function(a){d3.select(this).call(g[a].brush)}).selectAll("rect").attr("x",-8).attr("width",16)}),b}var c={top:30,right:0,bottom:10,left:0},d=null,e=null,f=d3.scale.ordinal(),g={},h=[],i=[],j=a.utils.defaultColor(),k=[],l=[],m=[],n=1,o=d3.dispatch("brush","elementMouseover","elementMouseout");return b.dispatch=o,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return d},set:function(a){d=a}},height:{get:function(){return e},set:function(a){e=a}},dimensionNames:{get:function(){return h},set:function(a){h=a}},dimensionFormats:{get:function(){return i},set:function(a){i=a}},lineTension:{get:function(){return n},set:function(a){n=a}},dimensions:{get:function(){return h},set:function(b){a.deprecated("dimensions","use dimensionNames instead"),h=b}},margin:{get:function(){return c},set:function(a){c.top=void 0!==a.top?a.top:c.top,c.right=void 0!==a.right?a.right:c.right,c.bottom=void 0!==a.bottom?a.bottom:c.bottom,c.left=void 0!==a.left?a.left:c.left}},color:{get:function(){return j},set:function(b){j=a.utils.getColor(b)}}}),a.utils.initOptions(b),b},a.models.pie=function(){"use strict";function b(E){return D.reset(),E.each(function(b){function E(a,b){a.endAngle=isNaN(a.endAngle)?0:a.endAngle,a.startAngle=isNaN(a.startAngle)?0:a.startAngle,p||(a.innerRadius=0);var c=d3.interpolate(this._current,a);return this._current=c(0),function(a){return B[b](c(a))}}var F=d-c.left-c.right,G=e-c.top-c.bottom,H=Math.min(F,G)/2,I=[],J=[];if(i=d3.select(this),0===z.length)for(var K=H-H/5,L=y*H,M=0;Mc)return"";if("function"==typeof n)d=n(a,b,{key:f(a.data),value:g(a.data),percent:k(c)});else switch(n){case"key":d=f(a.data);break;case"value":d=k(g(a.data));break;case"percent":d=d3.format("%")(c)}return d})}}),D.renderEnd("pie immediate"),b}var c={top:0,right:0,bottom:0,left:0},d=500,e=500,f=function(a){return a.x},g=function(a){return a.y},h=Math.floor(1e4*Math.random()),i=null,j=a.utils.defaultColor(),k=d3.format(",.2f"),l=!0,m=!1,n="key",o=.02,p=!1,q=!1,r=!0,s=0,t=!1,u=!1,v=!1,w=!1,x=0,y=.5,z=[],A=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),B=[],C=[],D=a.utils.renderWatch(A);return b.dispatch=A,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{arcsRadius:{get:function(){return z},set:function(a){z=a}},width:{get:function(){return d},set:function(a){d=a}},height:{get:function(){return e},set:function(a){e=a}},showLabels:{get:function(){return l},set:function(a){l=a}},title:{get:function(){return q},set:function(a){q=a}},titleOffset:{get:function(){return s},set:function(a){s=a}},labelThreshold:{get:function(){return o},set:function(a){o=a}},valueFormat:{get:function(){return k},set:function(a){k=a}},x:{get:function(){return f},set:function(a){f=a}},id:{get:function(){return h},set:function(a){h=a}},endAngle:{get:function(){return w},set:function(a){w=a}},startAngle:{get:function(){return u},set:function(a){u=a}},padAngle:{get:function(){return v},set:function(a){v=a}},cornerRadius:{get:function(){return x},set:function(a){x=a}},donutRatio:{get:function(){return y},set:function(a){y=a}},labelsOutside:{get:function(){return m},set:function(a){m=a}},labelSunbeamLayout:{get:function(){return t},set:function(a){t=a}},donut:{get:function(){return p},set:function(a){p=a}},growOnHover:{get:function(){return r},set:function(a){r=a}},pieLabelsOutside:{get:function(){return m},set:function(b){m=b,a.deprecated("pieLabelsOutside","use labelsOutside instead")}},donutLabelsOutside:{get:function(){return m},set:function(b){m=b,a.deprecated("donutLabelsOutside","use labelsOutside instead")}},labelFormat:{get:function(){return k},set:function(b){k=b,a.deprecated("labelFormat","use valueFormat instead")}},margin:{get:function(){return c},set:function(a){c.top="undefined"!=typeof a.top?a.top:c.top,c.right="undefined"!=typeof a.right?a.right:c.right,c.bottom="undefined"!=typeof a.bottom?a.bottom:c.bottom,c.left="undefined"!=typeof a.left?a.left:c.left}},y:{get:function(){return g},set:function(a){g=d3.functor(a)}},color:{get:function(){return j},set:function(b){j=a.utils.getColor(b)}},labelType:{get:function(){return n},set:function(a){n=a||"key"}}}),a.utils.initOptions(b),b},a.models.pieChart=function(){"use strict";function b(e){return q.reset(),q.models(c),e.each(function(e){var k=d3.select(this);a.utils.initSVG(k);var n=a.utils.availableWidth(g,k,f),o=a.utils.availableHeight(h,k,f);if(b.update=function(){k.transition().call(b)},b.container=this,l.setter(s(e),b.update).getter(r(e)).update(),l.disabled=e.map(function(a){return!!a.disabled}),!m){var q;m={};for(q in l)m[q]=l[q]instanceof Array?l[q].slice(0):l[q]}if(!e||!e.length)return a.utils.noData(b,k),b;k.selectAll(".nv-noData").remove();var t=k.selectAll("g.nv-wrap.nv-pieChart").data([e]),u=t.enter().append("g").attr("class","nvd3 nv-wrap nv-pieChart").append("g"),v=t.select("g");if(u.append("g").attr("class","nv-pieWrap"),u.append("g").attr("class","nv-legendWrap"),i)if("top"===j)d.width(n).key(c.x()),t.select(".nv-legendWrap").datum(e).call(d),f.top!=d.height()&&(f.top=d.height(),o=a.utils.availableHeight(h,k,f)),t.select(".nv-legendWrap").attr("transform","translate(0,"+-f.top+")");else if("right"===j){var w=a.models.legend().width();w>n/2&&(w=n/2),d.height(o).key(c.x()),d.width(w),n-=d.width(),t.select(".nv-legendWrap").datum(e).call(d).attr("transform","translate("+n+",0)")}t.attr("transform","translate("+f.left+","+f.top+")"),c.width(n).height(o);var x=v.select(".nv-pieWrap").datum([e]);d3.transition(x).call(c),d.dispatch.on("stateChange",function(a){for(var c in a)l[c]=a[c];p.stateChange(l),b.update()}),p.on("changeState",function(a){"undefined"!=typeof a.disabled&&(e.forEach(function(b,c){b.disabled=a.disabled[c]}),l.disabled=a.disabled),b.update()})}),q.renderEnd("pieChart immediate"),b}var c=a.models.pie(),d=a.models.legend(),e=a.models.tooltip(),f={top:30,right:20,bottom:20,left:20},g=null,h=null,i=!0,j="top",k=a.utils.defaultColor(),l=a.utils.state(),m=null,n=null,o=250,p=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState","renderEnd");e.headerEnabled(!1).duration(0).valueFormatter(function(a,b){return c.valueFormat()(a,b)});var q=a.utils.renderWatch(p),r=function(a){return function(){return{active:a.map(function(a){return!a.disabled})}}},s=function(a){return function(b){void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};return c.dispatch.on("elementMouseover.tooltip",function(a){a.series={key:b.x()(a.data),value:b.y()(a.data),color:a.color},e.data(a).hidden(!1)}),c.dispatch.on("elementMouseout.tooltip",function(){e.hidden(!0)}),c.dispatch.on("elementMousemove.tooltip",function(){e.position({top:d3.event.pageY,left:d3.event.pageX})()}),b.legend=d,b.dispatch=p,b.pie=c,b.tooltip=e,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{noData:{get:function(){return n},set:function(a){n=a}},showLegend:{get:function(){return i},set:function(a){i=a}},legendPosition:{get:function(){return j},set:function(a){j=a}},defaultState:{get:function(){return m},set:function(a){m=a}},tooltips:{get:function(){return e.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),e.enabled(!!b)}},tooltipContent:{get:function(){return e.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),e.contentGenerator(b)}},color:{get:function(){return k},set:function(a){k=a,d.color(k),c.color(k)}},duration:{get:function(){return o},set:function(a){o=a,q.reset(o)}},margin:{get:function(){return f},set:function(a){f.top=void 0!==a.top?a.top:f.top,f.right=void 0!==a.right?a.right:f.right,f.bottom=void 0!==a.bottom?a.bottom:f.bottom,f.left=void 0!==a.left?a.left:f.left}}}),a.utils.inheritOptions(b,c),a.utils.initOptions(b),b},a.models.scatter=function(){"use strict";function b(N){return P.reset(),N.each(function(b){function N(){if(O=!1,!w)return!1;if(M===!0){var a=d3.merge(b.map(function(a,b){return a.values.map(function(a,c){var d=p(a,c),e=q(a,c);return[m(d)+1e-4*Math.random(),n(e)+1e-4*Math.random(),b,c,a]}).filter(function(a,b){return x(a[4],b)})}));if(0==a.length)return!1;a.length<3&&(a.push([m.range()[0]-20,n.range()[0]-20,null,null]),a.push([m.range()[1]+20,n.range()[1]+20,null,null]),a.push([m.range()[0]-20,n.range()[0]+20,null,null]),a.push([m.range()[1]+20,n.range()[1]-20,null,null]));var c=d3.geom.polygon([[-10,-10],[-10,i+10],[h+10,i+10],[h+10,-10]]),d=d3.geom.voronoi(a).map(function(b,d){return{data:c.clip(b),series:a[d][2],point:a[d][3]}});U.select(".nv-point-paths").selectAll("path").remove();var e=U.select(".nv-point-paths").selectAll("path").data(d),f=e.enter().append("svg:path").attr("d",function(a){return a&&a.data&&0!==a.data.length?"M"+a.data.join(",")+"Z":"M 0 0"}).attr("id",function(a,b){return"nv-path-"+b}).attr("clip-path",function(a,b){return"url(#nv-clip-"+b+")"});C&&f.style("fill",d3.rgb(230,230,230)).style("fill-opacity",.4).style("stroke-opacity",1).style("stroke",d3.rgb(200,200,200)),B&&(U.select(".nv-point-clips").selectAll("clipPath").remove(),U.select(".nv-point-clips").selectAll("clipPath").data(a).enter().append("svg:clipPath").attr("id",function(a,b){return"nv-clip-"+b}).append("svg:circle").attr("cx",function(a){return a[0]}).attr("cy",function(a){return a[1]}).attr("r",D));var k=function(a,c){if(O)return 0;var d=b[a.series];if(void 0!==d){var e=d.values[a.point];e.color=j(d,a.series),e.x=p(e),e.y=q(e);var f=l.node().getBoundingClientRect(),h=window.pageYOffset||document.documentElement.scrollTop,i=window.pageXOffset||document.documentElement.scrollLeft,k={left:m(p(e,a.point))+f.left+i+g.left+10,top:n(q(e,a.point))+f.top+h+g.top+10};c({point:e,series:d,pos:k,seriesIndex:a.series,pointIndex:a.point})}};e.on("click",function(a){k(a,L.elementClick)}).on("dblclick",function(a){k(a,L.elementDblClick)}).on("mouseover",function(a){k(a,L.elementMouseover)}).on("mouseout",function(a){k(a,L.elementMouseout)})}else U.select(".nv-groups").selectAll(".nv-group").selectAll(".nv-point").on("click",function(a,c){if(O||!b[a.series])return 0;var d=b[a.series],e=d.values[c];L.elementClick({point:e,series:d,pos:[m(p(e,c))+g.left,n(q(e,c))+g.top],seriesIndex:a.series,pointIndex:c})}).on("dblclick",function(a,c){if(O||!b[a.series])return 0;var d=b[a.series],e=d.values[c];L.elementDblClick({point:e,series:d,pos:[m(p(e,c))+g.left,n(q(e,c))+g.top],seriesIndex:a.series,pointIndex:c})}).on("mouseover",function(a,c){if(O||!b[a.series])return 0;var d=b[a.series],e=d.values[c];L.elementMouseover({point:e,series:d,pos:[m(p(e,c))+g.left,n(q(e,c))+g.top],seriesIndex:a.series,pointIndex:c,color:j(a,c)})}).on("mouseout",function(a,c){if(O||!b[a.series])return 0;var d=b[a.series],e=d.values[c];L.elementMouseout({point:e,series:d,seriesIndex:a.series,pointIndex:c,color:j(a,c)})})}l=d3.select(this);var R=a.utils.availableWidth(h,l,g),S=a.utils.availableHeight(i,l,g);a.utils.initSVG(l),b.forEach(function(a,b){a.values.forEach(function(a){a.series=b})});var T=E&&F&&I?[]:d3.merge(b.map(function(a){return a.values.map(function(a,b){return{x:p(a,b),y:q(a,b),size:r(a,b)}})}));m.domain(E||d3.extent(T.map(function(a){return a.x}).concat(t))),m.range(y&&b[0]?G||[(R*z+R)/(2*b[0].values.length),R-R*(1+z)/(2*b[0].values.length)]:G||[0,R]),n.domain(F||d3.extent(T.map(function(a){return a.y}).concat(u))).range(H||[S,0]),o.domain(I||d3.extent(T.map(function(a){return a.size}).concat(v))).range(J||Q),K=m.domain()[0]===m.domain()[1]||n.domain()[0]===n.domain()[1],m.domain()[0]===m.domain()[1]&&m.domain(m.domain()[0]?[m.domain()[0]-.01*m.domain()[0],m.domain()[1]+.01*m.domain()[1]]:[-1,1]),n.domain()[0]===n.domain()[1]&&n.domain(n.domain()[0]?[n.domain()[0]-.01*n.domain()[0],n.domain()[1]+.01*n.domain()[1]]:[-1,1]),isNaN(m.domain()[0])&&m.domain([-1,1]),isNaN(n.domain()[0])&&n.domain([-1,1]),c=c||m,d=d||n,e=e||o;var U=l.selectAll("g.nv-wrap.nv-scatter").data([b]),V=U.enter().append("g").attr("class","nvd3 nv-wrap nv-scatter nv-chart-"+k),W=V.append("defs"),X=V.append("g"),Y=U.select("g");U.classed("nv-single-point",K),X.append("g").attr("class","nv-groups"),X.append("g").attr("class","nv-point-paths"),V.append("g").attr("class","nv-point-clips"),U.attr("transform","translate("+g.left+","+g.top+")"),W.append("clipPath").attr("id","nv-edge-clip-"+k).append("rect"),U.select("#nv-edge-clip-"+k+" rect").attr("width",R).attr("height",S>0?S:0),Y.attr("clip-path",A?"url(#nv-edge-clip-"+k+")":""),O=!0;var Z=U.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a){return a.key});Z.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),Z.exit().remove(),Z.attr("class",function(a,b){return"nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}),Z.watchTransition(P,"scatter: groups").style("fill",function(a,b){return j(a,b)}).style("stroke",function(a,b){return j(a,b)}).style("stroke-opacity",1).style("fill-opacity",.5);var $=Z.selectAll("path.nv-point").data(function(a){return a.values.map(function(a,b){return[a,b]}).filter(function(a,b){return x(a[0],b)})});$.enter().append("path").style("fill",function(a){return a.color}).style("stroke",function(a){return a.color}).attr("transform",function(a){return"translate("+c(p(a[0],a[1]))+","+d(q(a[0],a[1]))+")"}).attr("d",a.utils.symbol().type(function(a){return s(a[0])}).size(function(a){return o(r(a[0],a[1]))})),$.exit().remove(),Z.exit().selectAll("path.nv-point").watchTransition(P,"scatter exit").attr("transform",function(a){return"translate("+m(p(a[0],a[1]))+","+n(q(a[0],a[1]))+")"}).remove(),$.each(function(a){d3.select(this).classed("nv-point",!0).classed("nv-point-"+a[1],!0).classed("nv-noninteractive",!w).classed("hover",!1)}),$.watchTransition(P,"scatter points").attr("transform",function(a){return"translate("+m(p(a[0],a[1]))+","+n(q(a[0],a[1]))+")"}).attr("d",a.utils.symbol().type(function(a){return s(a[0])}).size(function(a){return o(r(a[0],a[1]))})),clearTimeout(f),f=setTimeout(N,300),c=m.copy(),d=n.copy(),e=o.copy()}),P.renderEnd("scatter immediate"),b}var c,d,e,f,g={top:0,right:0,bottom:0,left:0},h=null,i=null,j=a.utils.defaultColor(),k=Math.floor(1e5*Math.random()),l=null,m=d3.scale.linear(),n=d3.scale.linear(),o=d3.scale.linear(),p=function(a){return a.x},q=function(a){return a.y},r=function(a){return a.size||1},s=function(a){return a.shape||"circle"},t=[],u=[],v=[],w=!0,x=function(a){return!a.notActive},y=!1,z=.1,A=!1,B=!0,C=!1,D=function(){return 25},E=null,F=null,G=null,H=null,I=null,J=null,K=!1,L=d3.dispatch("elementClick","elementDblClick","elementMouseover","elementMouseout","renderEnd"),M=!0,N=250,O=!1,P=a.utils.renderWatch(L,N),Q=[16,256];return b.dispatch=L,b.options=a.utils.optionsFunc.bind(b),b._calls=new function(){this.clearHighlights=function(){return a.dom.write(function(){l.selectAll(".nv-point.hover").classed("hover",!1)}),null},this.highlightPoint=function(b,c,d){a.dom.write(function(){l.select(" .nv-series-"+b+" .nv-point-"+c).classed("hover",d)})}},L.on("elementMouseover.point",function(a){w&&b._calls.highlightPoint(a.seriesIndex,a.pointIndex,!0)}),L.on("elementMouseout.point",function(a){w&&b._calls.highlightPoint(a.seriesIndex,a.pointIndex,!1)}),b._options=Object.create({},{width:{get:function(){return h},set:function(a){h=a}},height:{get:function(){return i},set:function(a){i=a}},xScale:{get:function(){return m},set:function(a){m=a}},yScale:{get:function(){return n},set:function(a){n=a}},pointScale:{get:function(){return o},set:function(a){o=a}},xDomain:{get:function(){return E},set:function(a){E=a}},yDomain:{get:function(){return F},set:function(a){F=a}},pointDomain:{get:function(){return I},set:function(a){I=a}},xRange:{get:function(){return G},set:function(a){G=a}},yRange:{get:function(){return H},set:function(a){H=a}},pointRange:{get:function(){return J},set:function(a){J=a}},forceX:{get:function(){return t},set:function(a){t=a}},forceY:{get:function(){return u},set:function(a){u=a}},forcePoint:{get:function(){return v},set:function(a){v=a}},interactive:{get:function(){return w},set:function(a){w=a}},pointActive:{get:function(){return x},set:function(a){x=a}},padDataOuter:{get:function(){return z},set:function(a){z=a}},padData:{get:function(){return y},set:function(a){y=a}},clipEdge:{get:function(){return A},set:function(a){A=a}},clipVoronoi:{get:function(){return B},set:function(a){B=a}},clipRadius:{get:function(){return D},set:function(a){D=a}},showVoronoi:{get:function(){return C},set:function(a){C=a}},id:{get:function(){return k},set:function(a){k=a}},x:{get:function(){return p},set:function(a){p=d3.functor(a)}},y:{get:function(){return q},set:function(a){q=d3.functor(a)}},pointSize:{get:function(){return r},set:function(a){r=d3.functor(a)}},pointShape:{get:function(){return s},set:function(a){s=d3.functor(a)}},margin:{get:function(){return g},set:function(a){g.top=void 0!==a.top?a.top:g.top,g.right=void 0!==a.right?a.right:g.right,g.bottom=void 0!==a.bottom?a.bottom:g.bottom,g.left=void 0!==a.left?a.left:g.left}},duration:{get:function(){return N},set:function(a){N=a,P.reset(N)}},color:{get:function(){return j},set:function(b){j=a.utils.getColor(b)}},useVoronoi:{get:function(){return M},set:function(a){M=a,M===!1&&(B=!1)}}}),a.utils.initOptions(b),b},a.models.scatterChart=function(){"use strict";function b(z){return D.reset(),D.models(c),t&&D.models(d),u&&D.models(e),q&&D.models(g),r&&D.models(h),z.each(function(z){m=d3.select(this),a.utils.initSVG(m);var G=a.utils.availableWidth(k,m,j),H=a.utils.availableHeight(l,m,j);if(b.update=function(){0===A?m.call(b):m.transition().duration(A).call(b)},b.container=this,w.setter(F(z),b.update).getter(E(z)).update(),w.disabled=z.map(function(a){return!!a.disabled}),!x){var I;x={};for(I in w)x[I]=w[I]instanceof Array?w[I].slice(0):w[I]}if(!(z&&z.length&&z.filter(function(a){return a.values.length}).length))return a.utils.noData(b,m),D.renderEnd("scatter immediate"),b;m.selectAll(".nv-noData").remove(),o=c.xScale(),p=c.yScale();var J=m.selectAll("g.nv-wrap.nv-scatterChart").data([z]),K=J.enter().append("g").attr("class","nvd3 nv-wrap nv-scatterChart nv-chart-"+c.id()),L=K.append("g"),M=J.select("g");if(L.append("rect").attr("class","nvd3 nv-background").style("pointer-events","none"),L.append("g").attr("class","nv-x nv-axis"),L.append("g").attr("class","nv-y nv-axis"),L.append("g").attr("class","nv-scatterWrap"),L.append("g").attr("class","nv-regressionLinesWrap"),L.append("g").attr("class","nv-distWrap"),L.append("g").attr("class","nv-legendWrap"),v&&M.select(".nv-y.nv-axis").attr("transform","translate("+G+",0)"),s){var N=G;f.width(N),J.select(".nv-legendWrap").datum(z).call(f),j.top!=f.height()&&(j.top=f.height(),H=a.utils.availableHeight(l,m,j)),J.select(".nv-legendWrap").attr("transform","translate(0,"+-j.top+")")}J.attr("transform","translate("+j.left+","+j.top+")"),c.width(G).height(H).color(z.map(function(a,b){return a.color=a.color||n(a,b),a.color}).filter(function(a,b){return!z[b].disabled})),J.select(".nv-scatterWrap").datum(z.filter(function(a){return!a.disabled})).call(c),J.select(".nv-regressionLinesWrap").attr("clip-path","url(#nv-edge-clip-"+c.id()+")");var O=J.select(".nv-regressionLinesWrap").selectAll(".nv-regLines").data(function(a){return a});O.enter().append("g").attr("class","nv-regLines");var P=O.selectAll(".nv-regLine").data(function(a){return[a]});P.enter().append("line").attr("class","nv-regLine").style("stroke-opacity",0),P.filter(function(a){return a.intercept&&a.slope}).watchTransition(D,"scatterPlusLineChart: regline").attr("x1",o.range()[0]).attr("x2",o.range()[1]).attr("y1",function(a){return p(o.domain()[0]*a.slope+a.intercept)}).attr("y2",function(a){return p(o.domain()[1]*a.slope+a.intercept)}).style("stroke",function(a,b,c){return n(a,c)}).style("stroke-opacity",function(a){return a.disabled||"undefined"==typeof a.slope||"undefined"==typeof a.intercept?0:1}),t&&(d.scale(o)._ticks(a.utils.calcTicksX(G/100,z)).tickSize(-H,0),M.select(".nv-x.nv-axis").attr("transform","translate(0,"+p.range()[0]+")").call(d)),u&&(e.scale(p)._ticks(a.utils.calcTicksY(H/36,z)).tickSize(-G,0),M.select(".nv-y.nv-axis").call(e)),q&&(g.getData(c.x()).scale(o).width(G).color(z.map(function(a,b){return a.color||n(a,b)}).filter(function(a,b){return!z[b].disabled})),L.select(".nv-distWrap").append("g").attr("class","nv-distributionX"),M.select(".nv-distributionX").attr("transform","translate(0,"+p.range()[0]+")").datum(z.filter(function(a){return!a.disabled})).call(g)),r&&(h.getData(c.y()).scale(p).width(H).color(z.map(function(a,b){return a.color||n(a,b)}).filter(function(a,b){return!z[b].disabled})),L.select(".nv-distWrap").append("g").attr("class","nv-distributionY"),M.select(".nv-distributionY").attr("transform","translate("+(v?G:-h.size())+",0)").datum(z.filter(function(a){return!a.disabled})).call(h)),f.dispatch.on("stateChange",function(a){for(var c in a)w[c]=a[c];y.stateChange(w),b.update()}),y.on("changeState",function(a){"undefined"!=typeof a.disabled&&(z.forEach(function(b,c){b.disabled=a.disabled[c]}),w.disabled=a.disabled),b.update()}),c.dispatch.on("elementMouseout.tooltip",function(a){i.hidden(!0),m.select(".nv-chart-"+c.id()+" .nv-series-"+a.seriesIndex+" .nv-distx-"+a.pointIndex).attr("y1",0),m.select(".nv-chart-"+c.id()+" .nv-series-"+a.seriesIndex+" .nv-disty-"+a.pointIndex).attr("x2",h.size())}),c.dispatch.on("elementMouseover.tooltip",function(a){m.select(".nv-series-"+a.seriesIndex+" .nv-distx-"+a.pointIndex).attr("y1",a.pos.top-H-j.top),m.select(".nv-series-"+a.seriesIndex+" .nv-disty-"+a.pointIndex).attr("x2",a.pos.left+g.size()-j.left),i.position(a.pos).data(a).hidden(!1)}),B=o.copy(),C=p.copy()}),D.renderEnd("scatter with line immediate"),b}var c=a.models.scatter(),d=a.models.axis(),e=a.models.axis(),f=a.models.legend(),g=a.models.distribution(),h=a.models.distribution(),i=a.models.tooltip(),j={top:30,right:20,bottom:50,left:75},k=null,l=null,m=null,n=a.utils.defaultColor(),o=c.xScale(),p=c.yScale(),q=!1,r=!1,s=!0,t=!0,u=!0,v=!1,w=a.utils.state(),x=null,y=d3.dispatch("stateChange","changeState","renderEnd"),z=null,A=250;c.xScale(o).yScale(p),d.orient("bottom").tickPadding(10),e.orient(v?"right":"left").tickPadding(10),g.axis("x"),h.axis("y"),i.headerFormatter(function(a,b){return d.tickFormat()(a,b)}).valueFormatter(function(a,b){return e.tickFormat()(a,b)});var B,C,D=a.utils.renderWatch(y,A),E=function(a){return function(){return{active:a.map(function(a){return!a.disabled})}}},F=function(a){return function(b){void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};return b.dispatch=y,b.scatter=c,b.legend=f,b.xAxis=d,b.yAxis=e,b.distX=g,b.distY=h,b.tooltip=i,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return k},set:function(a){k=a}},height:{get:function(){return l},set:function(a){l=a}},container:{get:function(){return m},set:function(a){m=a}},showDistX:{get:function(){return q},set:function(a){q=a}},showDistY:{get:function(){return r},set:function(a){r=a}},showLegend:{get:function(){return s},set:function(a){s=a}},showXAxis:{get:function(){return t},set:function(a){t=a}},showYAxis:{get:function(){return u},set:function(a){u=a}},defaultState:{get:function(){return x},set:function(a){x=a}},noData:{get:function(){return z},set:function(a){z=a}},duration:{get:function(){return A},set:function(a){A=a}},tooltips:{get:function(){return i.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),i.enabled(!!b) -}},tooltipContent:{get:function(){return i.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),i.contentGenerator(b)}},tooltipXContent:{get:function(){return i.contentGenerator()},set:function(){a.deprecated("tooltipContent","This option is removed, put values into main tooltip.")}},tooltipYContent:{get:function(){return i.contentGenerator()},set:function(){a.deprecated("tooltipContent","This option is removed, put values into main tooltip.")}},margin:{get:function(){return j},set:function(a){j.top=void 0!==a.top?a.top:j.top,j.right=void 0!==a.right?a.right:j.right,j.bottom=void 0!==a.bottom?a.bottom:j.bottom,j.left=void 0!==a.left?a.left:j.left}},rightAlignYAxis:{get:function(){return v},set:function(a){v=a,e.orient(a?"right":"left")}},color:{get:function(){return n},set:function(b){n=a.utils.getColor(b),f.color(n),g.color(n),h.color(n)}}}),a.utils.inheritOptions(b,c),a.utils.initOptions(b),b},a.models.sparkline=function(){"use strict";function b(k){return k.each(function(b){var k=h-g.left-g.right,q=i-g.top-g.bottom;j=d3.select(this),a.utils.initSVG(j),l.domain(c||d3.extent(b,n)).range(e||[0,k]),m.domain(d||d3.extent(b,o)).range(f||[q,0]);{var r=j.selectAll("g.nv-wrap.nv-sparkline").data([b]),s=r.enter().append("g").attr("class","nvd3 nv-wrap nv-sparkline");s.append("g"),r.select("g")}r.attr("transform","translate("+g.left+","+g.top+")");var t=r.selectAll("path").data(function(a){return[a]});t.enter().append("path"),t.exit().remove(),t.style("stroke",function(a,b){return a.color||p(a,b)}).attr("d",d3.svg.line().x(function(a,b){return l(n(a,b))}).y(function(a,b){return m(o(a,b))}));var u=r.selectAll("circle.nv-point").data(function(a){function b(b){if(-1!=b){var c=a[b];return c.pointIndex=b,c}return null}var c=a.map(function(a,b){return o(a,b)}),d=b(c.lastIndexOf(m.domain()[1])),e=b(c.indexOf(m.domain()[0])),f=b(c.length-1);return[e,d,f].filter(function(a){return null!=a})});u.enter().append("circle"),u.exit().remove(),u.attr("cx",function(a){return l(n(a,a.pointIndex))}).attr("cy",function(a){return m(o(a,a.pointIndex))}).attr("r",2).attr("class",function(a){return n(a,a.pointIndex)==l.domain()[1]?"nv-point nv-currentValue":o(a,a.pointIndex)==m.domain()[0]?"nv-point nv-minValue":"nv-point nv-maxValue"})}),b}var c,d,e,f,g={top:2,right:0,bottom:2,left:0},h=400,i=32,j=null,k=!0,l=d3.scale.linear(),m=d3.scale.linear(),n=function(a){return a.x},o=function(a){return a.y},p=a.utils.getColor(["#000"]);return b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return h},set:function(a){h=a}},height:{get:function(){return i},set:function(a){i=a}},xDomain:{get:function(){return c},set:function(a){c=a}},yDomain:{get:function(){return d},set:function(a){d=a}},xRange:{get:function(){return e},set:function(a){e=a}},yRange:{get:function(){return f},set:function(a){f=a}},xScale:{get:function(){return l},set:function(a){l=a}},yScale:{get:function(){return m},set:function(a){m=a}},animate:{get:function(){return k},set:function(a){k=a}},x:{get:function(){return n},set:function(a){n=d3.functor(a)}},y:{get:function(){return o},set:function(a){o=d3.functor(a)}},margin:{get:function(){return g},set:function(a){g.top=void 0!==a.top?a.top:g.top,g.right=void 0!==a.right?a.right:g.right,g.bottom=void 0!==a.bottom?a.bottom:g.bottom,g.left=void 0!==a.left?a.left:g.left}},color:{get:function(){return p},set:function(b){p=a.utils.getColor(b)}}}),a.utils.initOptions(b),b},a.models.sparklinePlus=function(){"use strict";function b(p){return p.each(function(p){function q(){if(!j){var a=z.selectAll(".nv-hoverValue").data(i),b=a.enter().append("g").attr("class","nv-hoverValue").style("stroke-opacity",0).style("fill-opacity",0);a.exit().transition().duration(250).style("stroke-opacity",0).style("fill-opacity",0).remove(),a.attr("transform",function(a){return"translate("+c(e.x()(p[a],a))+",0)"}).transition().duration(250).style("stroke-opacity",1).style("fill-opacity",1),i.length&&(b.append("line").attr("x1",0).attr("y1",-f.top).attr("x2",0).attr("y2",u),b.append("text").attr("class","nv-xValue").attr("x",-6).attr("y",-f.top).attr("text-anchor","end").attr("dy",".9em"),z.select(".nv-hoverValue .nv-xValue").text(k(e.x()(p[i[0]],i[0]))),b.append("text").attr("class","nv-yValue").attr("x",6).attr("y",-f.top).attr("text-anchor","start").attr("dy",".9em"),z.select(".nv-hoverValue .nv-yValue").text(l(e.y()(p[i[0]],i[0]))))}}function r(){function a(a,b){for(var c=Math.abs(e.x()(a[0],0)-b),d=0,f=0;fc;++c){for(b=0,d=0;bb;b++)a[b][c][1]/=d;else for(b=0;e>b;b++)a[b][c][1]=0}for(c=0;f>c;++c)g[c]=0;return g}}),u.renderEnd("stackedArea immediate"),b}var c,d,e={top:0,right:0,bottom:0,left:0},f=960,g=500,h=a.utils.defaultColor(),i=Math.floor(1e5*Math.random()),j=null,k=function(a){return a.x},l=function(a){return a.y},m="stack",n="zero",o="default",p="linear",q=!1,r=a.models.scatter(),s=250,t=d3.dispatch("areaClick","areaMouseover","areaMouseout","renderEnd","elementClick","elementMouseover","elementMouseout");r.pointSize(2.2).pointDomain([2.2,2.2]);var u=a.utils.renderWatch(t,s);return b.dispatch=t,b.scatter=r,r.dispatch.on("elementClick",function(){t.elementClick.apply(this,arguments)}),r.dispatch.on("elementMouseover",function(){t.elementMouseover.apply(this,arguments)}),r.dispatch.on("elementMouseout",function(){t.elementMouseout.apply(this,arguments)}),b.interpolate=function(a){return arguments.length?(p=a,b):p},b.duration=function(a){return arguments.length?(s=a,u.reset(s),r.duration(s),b):s},b.dispatch=t,b.scatter=r,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return f},set:function(a){f=a}},height:{get:function(){return g},set:function(a){g=a}},clipEdge:{get:function(){return q},set:function(a){q=a}},offset:{get:function(){return n},set:function(a){n=a}},order:{get:function(){return o},set:function(a){o=a}},interpolate:{get:function(){return p},set:function(a){p=a}},x:{get:function(){return k},set:function(a){k=d3.functor(a)}},y:{get:function(){return l},set:function(a){l=d3.functor(a)}},margin:{get:function(){return e},set:function(a){e.top=void 0!==a.top?a.top:e.top,e.right=void 0!==a.right?a.right:e.right,e.bottom=void 0!==a.bottom?a.bottom:e.bottom,e.left=void 0!==a.left?a.left:e.left}},color:{get:function(){return h},set:function(b){h=a.utils.getColor(b)}},style:{get:function(){return m},set:function(a){switch(m=a){case"stack":b.offset("zero"),b.order("default");break;case"stream":b.offset("wiggle"),b.order("inside-out");break;case"stream-center":b.offset("silhouette"),b.order("inside-out");break;case"expand":b.offset("expand"),b.order("default");break;case"stack_percent":b.offset(b.d3_stackedOffset_stackPercent),b.order("default")}}},duration:{get:function(){return s},set:function(a){s=a,u.reset(s),r.duration(s)}}}),a.utils.inheritOptions(b,r),a.utils.initOptions(b),b},a.models.stackedAreaChart=function(){"use strict";function b(k){return F.reset(),F.models(e),r&&F.models(f),s&&F.models(g),k.each(function(k){var x=d3.select(this),F=this;a.utils.initSVG(x);var K=a.utils.availableWidth(m,x,l),L=a.utils.availableHeight(n,x,l);if(b.update=function(){x.transition().duration(C).call(b)},b.container=this,v.setter(I(k),b.update).getter(H(k)).update(),v.disabled=k.map(function(a){return!!a.disabled}),!w){var M;w={};for(M in v)w[M]=v[M]instanceof Array?v[M].slice(0):v[M]}if(!(k&&k.length&&k.filter(function(a){return a.values.length}).length))return a.utils.noData(b,x),b;x.selectAll(".nv-noData").remove(),c=e.xScale(),d=e.yScale();var N=x.selectAll("g.nv-wrap.nv-stackedAreaChart").data([k]),O=N.enter().append("g").attr("class","nvd3 nv-wrap nv-stackedAreaChart").append("g"),P=N.select("g");if(O.append("rect").style("opacity",0),O.append("g").attr("class","nv-x nv-axis"),O.append("g").attr("class","nv-y nv-axis"),O.append("g").attr("class","nv-stackedWrap"),O.append("g").attr("class","nv-legendWrap"),O.append("g").attr("class","nv-controlsWrap"),O.append("g").attr("class","nv-interactive"),P.select("rect").attr("width",K).attr("height",L),q){var Q=p?K-z:K;h.width(Q),P.select(".nv-legendWrap").datum(k).call(h),l.top!=h.height()&&(l.top=h.height(),L=a.utils.availableHeight(n,x,l)),P.select(".nv-legendWrap").attr("transform","translate("+(K-Q)+","+-l.top+")")}if(p){var R=[{key:B.stacked||"Stacked",metaKey:"Stacked",disabled:"stack"!=e.style(),style:"stack"},{key:B.stream||"Stream",metaKey:"Stream",disabled:"stream"!=e.style(),style:"stream"},{key:B.expanded||"Expanded",metaKey:"Expanded",disabled:"expand"!=e.style(),style:"expand"},{key:B.stack_percent||"Stack %",metaKey:"Stack_Percent",disabled:"stack_percent"!=e.style(),style:"stack_percent"}];z=A.length/3*260,R=R.filter(function(a){return-1!==A.indexOf(a.metaKey)}),i.width(z).color(["#444","#444","#444"]),P.select(".nv-controlsWrap").datum(R).call(i),l.top!=Math.max(i.height(),h.height())&&(l.top=Math.max(i.height(),h.height()),L=a.utils.availableHeight(n,x,l)),P.select(".nv-controlsWrap").attr("transform","translate(0,"+-l.top+")")}N.attr("transform","translate("+l.left+","+l.top+")"),t&&P.select(".nv-y.nv-axis").attr("transform","translate("+K+",0)"),u&&(j.width(K).height(L).margin({left:l.left,top:l.top}).svgContainer(x).xScale(c),N.select(".nv-interactive").call(j)),e.width(K).height(L);var S=P.select(".nv-stackedWrap").datum(k);if(S.transition().call(e),r&&(f.scale(c)._ticks(a.utils.calcTicksX(K/100,k)).tickSize(-L,0),P.select(".nv-x.nv-axis").attr("transform","translate(0,"+L+")"),P.select(".nv-x.nv-axis").transition().duration(0).call(f)),s){var T;if(T="wiggle"===e.offset()?0:a.utils.calcTicksY(L/36,k),g.scale(d)._ticks(T).tickSize(-K,0),"expand"===e.style()||"stack_percent"===e.style()){var U=g.tickFormat();D&&U===J||(D=U),g.tickFormat(J)}else D&&(g.tickFormat(D),D=null);P.select(".nv-y.nv-axis").transition().duration(0).call(g)}e.dispatch.on("areaClick.toggle",function(a){k.forEach(1===k.filter(function(a){return!a.disabled}).length?function(a){a.disabled=!1}:function(b,c){b.disabled=c!=a.seriesIndex}),v.disabled=k.map(function(a){return!!a.disabled}),y.stateChange(v),b.update()}),h.dispatch.on("stateChange",function(a){for(var c in a)v[c]=a[c];y.stateChange(v),b.update()}),i.dispatch.on("legendClick",function(a){a.disabled&&(R=R.map(function(a){return a.disabled=!0,a}),a.disabled=!1,e.style(a.style),v.style=e.style(),y.stateChange(v),b.update())}),j.dispatch.on("elementMousemove",function(c){e.clearHighlights();var d,g,h,i=[];if(k.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(f,j){g=a.interactiveBisect(f.values,c.pointXValue,b.x());var k=f.values[g],l=b.y()(k,g);if(null!=l&&e.highlightPoint(j,g,!0),"undefined"!=typeof k){"undefined"==typeof d&&(d=k),"undefined"==typeof h&&(h=b.xScale()(b.x()(k,g)));var m="expand"==e.style()?k.display.y:b.y()(k,g);i.push({key:f.key,value:m,color:o(f,f.seriesIndex),stackedValue:k.display})}}),i.reverse(),i.length>2){var m=b.yScale().invert(c.mouseY),n=null;i.forEach(function(a,b){m=Math.abs(m);var c=Math.abs(a.stackedValue.y0),d=Math.abs(a.stackedValue.y);return m>=c&&d+c>=m?void(n=b):void 0}),null!=n&&(i[n].highlight=!0)}var p=f.tickFormat()(b.x()(d,g)),q=j.tooltip.valueFormatter();"expand"===e.style()||"stack_percent"===e.style()?(E||(E=q),q=d3.format(".1%")):E&&(q=E,E=null),j.tooltip.position({left:h+l.left,top:c.mouseY+l.top}).chartContainer(F.parentNode).valueFormatter(q).data({value:p,series:i})(),j.renderGuideLine(h)}),j.dispatch.on("elementMouseout",function(){e.clearHighlights()}),y.on("changeState",function(a){"undefined"!=typeof a.disabled&&k.length===a.disabled.length&&(k.forEach(function(b,c){b.disabled=a.disabled[c]}),v.disabled=a.disabled),"undefined"!=typeof a.style&&(e.style(a.style),G=a.style),b.update()})}),F.renderEnd("stacked Area chart immediate"),b}var c,d,e=a.models.stackedArea(),f=a.models.axis(),g=a.models.axis(),h=a.models.legend(),i=a.models.legend(),j=a.interactiveGuideline(),k=a.models.tooltip(),l={top:30,right:25,bottom:50,left:60},m=null,n=null,o=a.utils.defaultColor(),p=!0,q=!0,r=!0,s=!0,t=!1,u=!1,v=a.utils.state(),w=null,x=null,y=d3.dispatch("stateChange","changeState","renderEnd"),z=250,A=["Stacked","Stream","Expanded"],B={},C=250;v.style=e.style(),f.orient("bottom").tickPadding(7),g.orient(t?"right":"left"),k.headerFormatter(function(a,b){return f.tickFormat()(a,b)}).valueFormatter(function(a,b){return g.tickFormat()(a,b)}),j.tooltip.headerFormatter(function(a,b){return f.tickFormat()(a,b)}).valueFormatter(function(a,b){return g.tickFormat()(a,b)});var D=null,E=null;i.updateState(!1);var F=a.utils.renderWatch(y),G=e.style(),H=function(a){return function(){return{active:a.map(function(a){return!a.disabled}),style:e.style()}}},I=function(a){return function(b){void 0!==b.style&&(G=b.style),void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}},J=d3.format("%");return e.dispatch.on("elementMouseover.tooltip",function(a){a.point.x=e.x()(a.point),a.point.y=e.y()(a.point),k.data(a).position(a.pos).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(){k.hidden(!0)}),b.dispatch=y,b.stacked=e,b.legend=h,b.controls=i,b.xAxis=f,b.yAxis=g,b.interactiveLayer=j,b.tooltip=k,b.dispatch=y,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return m},set:function(a){m=a}},height:{get:function(){return n},set:function(a){n=a}},showLegend:{get:function(){return q},set:function(a){q=a}},showXAxis:{get:function(){return r},set:function(a){r=a}},showYAxis:{get:function(){return s},set:function(a){s=a}},defaultState:{get:function(){return w},set:function(a){w=a}},noData:{get:function(){return x},set:function(a){x=a}},showControls:{get:function(){return p},set:function(a){p=a}},controlLabels:{get:function(){return B},set:function(a){B=a}},controlOptions:{get:function(){return A},set:function(a){A=a}},tooltips:{get:function(){return k.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),k.enabled(!!b)}},tooltipContent:{get:function(){return k.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),k.contentGenerator(b)}},margin:{get:function(){return l},set:function(a){l.top=void 0!==a.top?a.top:l.top,l.right=void 0!==a.right?a.right:l.right,l.bottom=void 0!==a.bottom?a.bottom:l.bottom,l.left=void 0!==a.left?a.left:l.left}},duration:{get:function(){return C},set:function(a){C=a,F.reset(C),e.duration(C),f.duration(C),g.duration(C)}},color:{get:function(){return o},set:function(b){o=a.utils.getColor(b),h.color(o),e.color(o)}},rightAlignYAxis:{get:function(){return t},set:function(a){t=a,g.orient(t?"right":"left")}},useInteractiveGuideline:{get:function(){return u},set:function(a){u=!!a,b.interactive(!a),b.useVoronoi(!a),e.scatter.interactive(!a)}}}),a.utils.inheritOptions(b,e),a.utils.initOptions(b),b},a.models.sunburst=function(){"use strict";function b(u){return t.reset(),u.each(function(b){function t(a){a.x0=a.x,a.dx0=a.dx}function u(a){var b=d3.interpolate(p.domain(),[a.x,a.x+a.dx]),c=d3.interpolate(q.domain(),[a.y,1]),d=d3.interpolate(q.range(),[a.y?20:0,y]);return function(a,e){return e?function(){return s(a)}:function(e){return p.domain(b(e)),q.domain(c(e)).range(d(e)),s(a)}}}l=d3.select(this);var v,w=a.utils.availableWidth(g,l,f),x=a.utils.availableHeight(h,l,f),y=Math.min(w,x)/2;a.utils.initSVG(l);var z=l.selectAll(".nv-wrap.nv-sunburst").data(b),A=z.enter().append("g").attr("class","nvd3 nv-wrap nv-sunburst nv-chart-"+k),B=A.selectAll("nv-sunburst");z.attr("transform","translate("+w/2+","+x/2+")"),l.on("click",function(a,b){o.chartClick({data:a,index:b,pos:d3.event,id:k})}),q.range([0,y]),c=c||b,e=b[0],r.value(j[i]||j.count),v=B.data(r.nodes).enter().append("path").attr("d",s).style("fill",function(a){return m((a.children?a:a.parent).name)}).style("stroke","#FFF").on("click",function(a){d!==c&&c!==a&&(d=c),c=a,v.transition().duration(n).attrTween("d",u(a))}).each(t).on("dblclick",function(a){d.parent==a&&v.transition().duration(n).attrTween("d",u(e))}).each(t).on("mouseover",function(a){d3.select(this).classed("hover",!0).style("opacity",.8),o.elementMouseover({data:a,color:d3.select(this).style("fill")})}).on("mouseout",function(a){d3.select(this).classed("hover",!1).style("opacity",1),o.elementMouseout({data:a})}).on("mousemove",function(a){o.elementMousemove({data:a})})}),t.renderEnd("sunburst immediate"),b}var c,d,e,f={top:0,right:0,bottom:0,left:0},g=null,h=null,i="count",j={count:function(){return 1},size:function(a){return a.size}},k=Math.floor(1e4*Math.random()),l=null,m=a.utils.defaultColor(),n=500,o=d3.dispatch("chartClick","elementClick","elementDblClick","elementMousemove","elementMouseover","elementMouseout","renderEnd"),p=d3.scale.linear().range([0,2*Math.PI]),q=d3.scale.sqrt(),r=d3.layout.partition().sort(null).value(function(){return 1}),s=d3.svg.arc().startAngle(function(a){return Math.max(0,Math.min(2*Math.PI,p(a.x)))}).endAngle(function(a){return Math.max(0,Math.min(2*Math.PI,p(a.x+a.dx)))}).innerRadius(function(a){return Math.max(0,q(a.y))}).outerRadius(function(a){return Math.max(0,q(a.y+a.dy))}),t=a.utils.renderWatch(o);return b.dispatch=o,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return g},set:function(a){g=a}},height:{get:function(){return h},set:function(a){h=a}},mode:{get:function(){return i},set:function(a){i=a}},id:{get:function(){return k},set:function(a){k=a}},duration:{get:function(){return n},set:function(a){n=a}},margin:{get:function(){return f},set:function(a){f.top=void 0!=a.top?a.top:f.top,f.right=void 0!=a.right?a.right:f.right,f.bottom=void 0!=a.bottom?a.bottom:f.bottom,f.left=void 0!=a.left?a.left:f.left}},color:{get:function(){return m},set:function(b){m=a.utils.getColor(b)}}}),a.utils.initOptions(b),b},a.models.sunburstChart=function(){"use strict";function b(d){return m.reset(),m.models(c),d.each(function(d){var h=d3.select(this);a.utils.initSVG(h);var i=a.utils.availableWidth(f,h,e),j=a.utils.availableHeight(g,h,e);if(b.update=function(){0===k?h.call(b):h.transition().duration(k).call(b)},b.container=this,!d||!d.length)return a.utils.noData(b,h),b;h.selectAll(".nv-noData").remove();var l=h.selectAll("g.nv-wrap.nv-sunburstChart").data(d),m=l.enter().append("g").attr("class","nvd3 nv-wrap nv-sunburstChart").append("g"),n=l.select("g");m.append("g").attr("class","nv-sunburstWrap"),l.attr("transform","translate("+e.left+","+e.top+")"),c.width(i).height(j);var o=n.select(".nv-sunburstWrap").datum(d);d3.transition(o).call(c)}),m.renderEnd("sunburstChart immediate"),b}var c=a.models.sunburst(),d=a.models.tooltip(),e={top:30,right:20,bottom:20,left:20},f=null,g=null,h=a.utils.defaultColor(),i=(Math.round(1e5*Math.random()),null),j=null,k=250,l=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState","renderEnd"),m=a.utils.renderWatch(l);return d.headerEnabled(!1).duration(0).valueFormatter(function(a){return a}),c.dispatch.on("elementMouseover.tooltip",function(a){a.series={key:a.data.name,value:a.data.size,color:a.color},d.data(a).hidden(!1)}),c.dispatch.on("elementMouseout.tooltip",function(){d.hidden(!0)}),c.dispatch.on("elementMousemove.tooltip",function(){d.position({top:d3.event.pageY,left:d3.event.pageX})()}),b.dispatch=l,b.sunburst=c,b.tooltip=d,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{noData:{get:function(){return j},set:function(a){j=a}},defaultState:{get:function(){return i},set:function(a){i=a}},color:{get:function(){return h},set:function(a){h=a,c.color(h)}},duration:{get:function(){return k},set:function(a){k=a,m.reset(k),c.duration(k)}},margin:{get:function(){return e},set:function(a){e.top=void 0!==a.top?a.top:e.top,e.right=void 0!==a.right?a.right:e.right,e.bottom=void 0!==a.bottom?a.bottom:e.bottom,e.left=void 0!==a.left?a.left:e.left}}}),a.utils.inheritOptions(b,c),a.utils.initOptions(b),b},a.version="1.8.1"}(); \ No newline at end of file diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/js/popper.min.js b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/js/popper.min.js deleted file mode 100644 index bb1aaae3..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/js/popper.min.js +++ /dev/null @@ -1,5 +0,0 @@ -/* - Copyright (C) Federico Zivolo 2020 - Distributed under the MIT License (license terms are at http://opensource.org/licenses/MIT). - */(function(e,t){'object'==typeof exports&&'undefined'!=typeof module?module.exports=t():'function'==typeof define&&define.amd?define(t):e.Popper=t()})(this,function(){'use strict';function e(e){return e&&'[object Function]'==={}.toString.call(e)}function t(e,t){if(1!==e.nodeType)return[];var o=e.ownerDocument.defaultView,n=o.getComputedStyle(e,null);return t?n[t]:n}function o(e){return'HTML'===e.nodeName?e:e.parentNode||e.host}function n(e){if(!e)return document.body;switch(e.nodeName){case'HTML':case'BODY':return e.ownerDocument.body;case'#document':return e.body;}var i=t(e),r=i.overflow,p=i.overflowX,s=i.overflowY;return /(auto|scroll|overlay)/.test(r+s+p)?e:n(o(e))}function i(e){return e&&e.referenceNode?e.referenceNode:e}function r(e){return 11===e?re:10===e?pe:re||pe}function p(e){if(!e)return document.documentElement;for(var o=r(10)?document.body:null,n=e.offsetParent||null;n===o&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var i=n&&n.nodeName;return i&&'BODY'!==i&&'HTML'!==i?-1!==['TH','TD','TABLE'].indexOf(n.nodeName)&&'static'===t(n,'position')?p(n):n:e?e.ownerDocument.documentElement:document.documentElement}function s(e){var t=e.nodeName;return'BODY'!==t&&('HTML'===t||p(e.firstElementChild)===e)}function d(e){return null===e.parentNode?e:d(e.parentNode)}function a(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var o=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,n=o?e:t,i=o?t:e,r=document.createRange();r.setStart(n,0),r.setEnd(i,0);var l=r.commonAncestorContainer;if(e!==l&&t!==l||n.contains(i))return s(l)?l:p(l);var f=d(e);return f.host?a(f.host,t):a(e,d(t).host)}function l(e){var t=1=o.clientWidth&&n>=o.clientHeight}),l=0a[e]&&!t.escapeWithReference&&(n=Q(f[o],a[e]-('right'===e?f.width:f.height))),ae({},o,n)}};return l.forEach(function(e){var t=-1===['left','top'].indexOf(e)?'secondary':'primary';f=le({},f,m[t](e))}),e.offsets.popper=f,e},priority:['left','right','top','bottom'],padding:5,boundariesElement:'scrollParent'},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,o=t.popper,n=t.reference,i=e.placement.split('-')[0],r=Z,p=-1!==['top','bottom'].indexOf(i),s=p?'right':'bottom',d=p?'left':'top',a=p?'width':'height';return o[s]r(n[s])&&(e.offsets.popper[d]=r(n[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,o){var n;if(!K(e.instance.modifiers,'arrow','keepTogether'))return e;var i=o.element;if('string'==typeof i){if(i=e.instance.popper.querySelector(i),!i)return e;}else if(!e.instance.popper.contains(i))return console.warn('WARNING: `arrow.element` must be child of its popper element!'),e;var r=e.placement.split('-')[0],p=e.offsets,s=p.popper,d=p.reference,a=-1!==['left','right'].indexOf(r),l=a?'height':'width',f=a?'Top':'Left',m=f.toLowerCase(),h=a?'left':'top',c=a?'bottom':'right',u=S(i)[l];d[c]-us[c]&&(e.offsets.popper[m]+=d[m]+u-s[c]),e.offsets.popper=g(e.offsets.popper);var b=d[m]+d[l]/2-u/2,w=t(e.instance.popper),y=parseFloat(w['margin'+f]),E=parseFloat(w['border'+f+'Width']),v=b-e.offsets.popper[m]-y-E;return v=ee(Q(s[l]-u,v),0),e.arrowElement=i,e.offsets.arrow=(n={},ae(n,m,$(v)),ae(n,h,''),n),e},element:'[x-arrow]'},flip:{order:600,enabled:!0,fn:function(e,t){if(W(e.instance.modifiers,'inner'))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var o=v(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),n=e.placement.split('-')[0],i=T(n),r=e.placement.split('-')[1]||'',p=[];switch(t.behavior){case ce.FLIP:p=[n,i];break;case ce.CLOCKWISE:p=G(n);break;case ce.COUNTERCLOCKWISE:p=G(n,!0);break;default:p=t.behavior;}return p.forEach(function(s,d){if(n!==s||p.length===d+1)return e;n=e.placement.split('-')[0],i=T(n);var a=e.offsets.popper,l=e.offsets.reference,f=Z,m='left'===n&&f(a.right)>f(l.left)||'right'===n&&f(a.left)f(l.top)||'bottom'===n&&f(a.top)f(o.right),g=f(a.top)f(o.bottom),b='left'===n&&h||'right'===n&&c||'top'===n&&g||'bottom'===n&&u,w=-1!==['top','bottom'].indexOf(n),y=!!t.flipVariations&&(w&&'start'===r&&h||w&&'end'===r&&c||!w&&'start'===r&&g||!w&&'end'===r&&u),E=!!t.flipVariationsByContent&&(w&&'start'===r&&c||w&&'end'===r&&h||!w&&'start'===r&&u||!w&&'end'===r&&g),v=y||E;(m||b||v)&&(e.flipped=!0,(m||b)&&(n=p[d+1]),v&&(r=z(r)),e.placement=n+(r?'-'+r:''),e.offsets.popper=le({},e.offsets.popper,C(e.instance.popper,e.offsets.reference,e.placement)),e=P(e.instance.modifiers,e,'flip'))}),e},behavior:'flip',padding:5,boundariesElement:'viewport',flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,o=t.split('-')[0],n=e.offsets,i=n.popper,r=n.reference,p=-1!==['left','right'].indexOf(o),s=-1===['top','left'].indexOf(o);return i[p?'left':'top']=r[o]-(s?i[p?'width':'height']:0),e.placement=T(t),e.offsets.popper=g(i),e}},hide:{order:800,enabled:!0,fn:function(e){if(!K(e.instance.modifiers,'hide','preventOverflow'))return e;var t=e.offsets.reference,o=D(e.instance.modifiers,function(e){return'preventOverflow'===e.name}).boundaries;if(t.bottomo.right||t.top>o.bottom||t.rightwindow.devicePixelRatio||!fe),c='bottom'===o?'top':'bottom',g='right'===n?'left':'right',b=B('transform');if(d='bottom'==c?'HTML'===l.nodeName?-l.clientHeight+h.bottom:-f.height+h.bottom:h.top,s='right'==g?'HTML'===l.nodeName?-l.clientWidth+h.right:-f.width+h.right:h.left,a&&b)m[b]='translate3d('+s+'px, '+d+'px, 0)',m[c]=0,m[g]=0,m.willChange='transform';else{var w='bottom'==c?-1:1,y='right'==g?-1:1;m[c]=d*w,m[g]=s*y,m.willChange=c+', '+g}var E={"x-placement":e.placement};return e.attributes=le({},E,e.attributes),e.styles=le({},m,e.styles),e.arrowStyles=le({},e.offsets.arrow,e.arrowStyles),e},gpuAcceleration:!0,x:'bottom',y:'right'},applyStyle:{order:900,enabled:!0,fn:function(e){return V(e.instance.popper,e.styles),j(e.instance.popper,e.attributes),e.arrowElement&&Object.keys(e.arrowStyles).length&&V(e.arrowElement,e.arrowStyles),e},onLoad:function(e,t,o,n,i){var r=L(i,t,e,o.positionFixed),p=O(o.placement,r,t,e,o.modifiers.flip.boundariesElement,o.modifiers.flip.padding);return t.setAttribute('x-placement',p),V(t,{position:o.positionFixed?'fixed':'absolute'}),o},gpuAcceleration:void 0}}},ge}); -//# sourceMappingURL=popper.min.js.map diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/line.html.dist b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/line.html.dist deleted file mode 100644 index 89810d15..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/line.html.dist +++ /dev/null @@ -1 +0,0 @@ - {{lineNumber}}{{lineContent}} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/lines.html.dist b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/lines.html.dist deleted file mode 100644 index add40e4e..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/lines.html.dist +++ /dev/null @@ -1,5 +0,0 @@ - - -{{lines}} - -
      diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/method_item.html.dist b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/method_item.html.dist deleted file mode 100644 index 2311d456..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/method_item.html.dist +++ /dev/null @@ -1,12 +0,0 @@ - - {{name}} - {{lines_bar}} -
      {{lines_executed_percent}}
      -
      {{lines_number}}
      - {{methods_bar}} -
      {{methods_tested_percent}}
      -
      {{methods_number}}
      - {{crap}} - - - diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/method_item_branch.html.dist b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/method_item_branch.html.dist deleted file mode 100644 index 36d6cb74..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/method_item_branch.html.dist +++ /dev/null @@ -1,18 +0,0 @@ - - {{name}} - {{lines_bar}} -
      {{lines_executed_percent}}
      -
      {{lines_number}}
      - {{branches_bar}} -
      {{branches_executed_percent}}
      -
      {{branches_number}}
      - {{paths_bar}} -
      {{paths_executed_percent}}
      -
      {{paths_number}}
      - {{methods_bar}} -
      {{methods_tested_percent}}
      -
      {{methods_number}}
      - {{crap}} - - - diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/paths.html.dist b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/paths.html.dist deleted file mode 100644 index d14b8ad9..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/paths.html.dist +++ /dev/null @@ -1,9 +0,0 @@ -
      -

      Paths

      -

      - Below are the source code lines that represent each code path as identified by Xdebug. Please note a path is not - necessarily coterminous with a line, a line may contain multiple paths and therefore show up more than once. - Please also be aware that some paths may include implicit rather than explicit branches, e.g. an if statement - always has an else as part of its logical flow even if you didn't write one. -

      -{{paths}} diff --git a/vendor/phpunit/php-code-coverage/src/Report/PHP.php b/vendor/phpunit/php-code-coverage/src/Report/PHP.php deleted file mode 100644 index d16b1b84..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/PHP.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 SebastianBergmann\CodeCoverage\Report; - -use function dirname; -use function file_put_contents; -use function serialize; -use function sprintf; -use SebastianBergmann\CodeCoverage\CodeCoverage; -use SebastianBergmann\CodeCoverage\Driver\WriteOperationFailedException; -use SebastianBergmann\CodeCoverage\Util\Filesystem; - -final class PHP -{ - public function process(CodeCoverage $coverage, ?string $target = null): string - { - $buffer = sprintf( - " - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report; - -use const PHP_EOL; -use function array_map; -use function date; -use function ksort; -use function max; -use function sprintf; -use function str_pad; -use function strlen; -use SebastianBergmann\CodeCoverage\CodeCoverage; -use SebastianBergmann\CodeCoverage\Node\File; -use SebastianBergmann\CodeCoverage\Util\Percentage; - -final class Text -{ - /** - * @var string - */ - private const COLOR_GREEN = "\x1b[30;42m"; - - /** - * @var string - */ - private const COLOR_YELLOW = "\x1b[30;43m"; - - /** - * @var string - */ - private const COLOR_RED = "\x1b[37;41m"; - - /** - * @var string - */ - private const COLOR_HEADER = "\x1b[1;37;40m"; - - /** - * @var string - */ - private const COLOR_RESET = "\x1b[0m"; - - /** - * @var string - */ - private const COLOR_EOL = "\x1b[2K"; - - /** - * @var int - */ - private $lowUpperBound; - - /** - * @var int - */ - private $highLowerBound; - - /** - * @var bool - */ - private $showUncoveredFiles; - - /** - * @var bool - */ - private $showOnlySummary; - - public function __construct(int $lowUpperBound = 50, int $highLowerBound = 90, bool $showUncoveredFiles = false, bool $showOnlySummary = false) - { - $this->lowUpperBound = $lowUpperBound; - $this->highLowerBound = $highLowerBound; - $this->showUncoveredFiles = $showUncoveredFiles; - $this->showOnlySummary = $showOnlySummary; - } - - public function process(CodeCoverage $coverage, bool $showColors = false): string - { - $hasBranchCoverage = !empty($coverage->getData(true)->functionCoverage()); - - $output = PHP_EOL . PHP_EOL; - $report = $coverage->getReport(); - - $colors = [ - 'header' => '', - 'classes' => '', - 'methods' => '', - 'lines' => '', - 'branches' => '', - 'paths' => '', - 'reset' => '', - 'eol' => '', - ]; - - if ($showColors) { - $colors['classes'] = $this->coverageColor( - $report->numberOfTestedClassesAndTraits(), - $report->numberOfClassesAndTraits() - ); - - $colors['methods'] = $this->coverageColor( - $report->numberOfTestedMethods(), - $report->numberOfMethods() - ); - - $colors['lines'] = $this->coverageColor( - $report->numberOfExecutedLines(), - $report->numberOfExecutableLines() - ); - - $colors['branches'] = $this->coverageColor( - $report->numberOfExecutedBranches(), - $report->numberOfExecutableBranches() - ); - - $colors['paths'] = $this->coverageColor( - $report->numberOfExecutedPaths(), - $report->numberOfExecutablePaths() - ); - - $colors['reset'] = self::COLOR_RESET; - $colors['header'] = self::COLOR_HEADER; - $colors['eol'] = self::COLOR_EOL; - } - - $classes = sprintf( - ' Classes: %6s (%d/%d)', - Percentage::fromFractionAndTotal( - $report->numberOfTestedClassesAndTraits(), - $report->numberOfClassesAndTraits() - )->asString(), - $report->numberOfTestedClassesAndTraits(), - $report->numberOfClassesAndTraits() - ); - - $methods = sprintf( - ' Methods: %6s (%d/%d)', - Percentage::fromFractionAndTotal( - $report->numberOfTestedMethods(), - $report->numberOfMethods(), - )->asString(), - $report->numberOfTestedMethods(), - $report->numberOfMethods() - ); - - $paths = ''; - $branches = ''; - - if ($hasBranchCoverage) { - $paths = sprintf( - ' Paths: %6s (%d/%d)', - Percentage::fromFractionAndTotal( - $report->numberOfExecutedPaths(), - $report->numberOfExecutablePaths(), - )->asString(), - $report->numberOfExecutedPaths(), - $report->numberOfExecutablePaths() - ); - - $branches = sprintf( - ' Branches: %6s (%d/%d)', - Percentage::fromFractionAndTotal( - $report->numberOfExecutedBranches(), - $report->numberOfExecutableBranches(), - )->asString(), - $report->numberOfExecutedBranches(), - $report->numberOfExecutableBranches() - ); - } - - $lines = sprintf( - ' Lines: %6s (%d/%d)', - Percentage::fromFractionAndTotal( - $report->numberOfExecutedLines(), - $report->numberOfExecutableLines(), - )->asString(), - $report->numberOfExecutedLines(), - $report->numberOfExecutableLines() - ); - - $padding = max(array_map('strlen', [$classes, $methods, $lines])); - - if ($this->showOnlySummary) { - $title = 'Code Coverage Report Summary:'; - $padding = max($padding, strlen($title)); - - $output .= $this->format($colors['header'], $padding, $title); - } else { - $date = date(' Y-m-d H:i:s'); - $title = 'Code Coverage Report:'; - - $output .= $this->format($colors['header'], $padding, $title); - $output .= $this->format($colors['header'], $padding, $date); - $output .= $this->format($colors['header'], $padding, ''); - $output .= $this->format($colors['header'], $padding, ' Summary:'); - } - - $output .= $this->format($colors['classes'], $padding, $classes); - $output .= $this->format($colors['methods'], $padding, $methods); - - if ($hasBranchCoverage) { - $output .= $this->format($colors['paths'], $padding, $paths); - $output .= $this->format($colors['branches'], $padding, $branches); - } - $output .= $this->format($colors['lines'], $padding, $lines); - - if ($this->showOnlySummary) { - return $output . PHP_EOL; - } - - $classCoverage = []; - - foreach ($report as $item) { - if (!$item instanceof File) { - continue; - } - - $classes = $item->classesAndTraits(); - - foreach ($classes as $className => $class) { - $classExecutableLines = 0; - $classExecutedLines = 0; - $classExecutableBranches = 0; - $classExecutedBranches = 0; - $classExecutablePaths = 0; - $classExecutedPaths = 0; - $coveredMethods = 0; - $classMethods = 0; - - foreach ($class['methods'] as $method) { - if ($method['executableLines'] == 0) { - continue; - } - - $classMethods++; - $classExecutableLines += $method['executableLines']; - $classExecutedLines += $method['executedLines']; - $classExecutableBranches += $method['executableBranches']; - $classExecutedBranches += $method['executedBranches']; - $classExecutablePaths += $method['executablePaths']; - $classExecutedPaths += $method['executedPaths']; - - if ($method['coverage'] == 100) { - $coveredMethods++; - } - } - - $classCoverage[$className] = [ - 'namespace' => $class['namespace'], - 'className' => $className, - 'methodsCovered' => $coveredMethods, - 'methodCount' => $classMethods, - 'statementsCovered' => $classExecutedLines, - 'statementCount' => $classExecutableLines, - 'branchesCovered' => $classExecutedBranches, - 'branchesCount' => $classExecutableBranches, - 'pathsCovered' => $classExecutedPaths, - 'pathsCount' => $classExecutablePaths, - ]; - } - } - - ksort($classCoverage); - - $methodColor = ''; - $pathsColor = ''; - $branchesColor = ''; - $linesColor = ''; - $resetColor = ''; - - foreach ($classCoverage as $fullQualifiedPath => $classInfo) { - if ($this->showUncoveredFiles || $classInfo['statementsCovered'] != 0) { - if ($showColors) { - $methodColor = $this->coverageColor($classInfo['methodsCovered'], $classInfo['methodCount']); - $pathsColor = $this->coverageColor($classInfo['pathsCovered'], $classInfo['pathsCount']); - $branchesColor = $this->coverageColor($classInfo['branchesCovered'], $classInfo['branchesCount']); - $linesColor = $this->coverageColor($classInfo['statementsCovered'], $classInfo['statementCount']); - $resetColor = $colors['reset']; - } - - $output .= PHP_EOL . $fullQualifiedPath . PHP_EOL - . ' ' . $methodColor . 'Methods: ' . $this->printCoverageCounts($classInfo['methodsCovered'], $classInfo['methodCount'], 2) . $resetColor . ' '; - - if ($hasBranchCoverage) { - $output .= ' ' . $pathsColor . 'Paths: ' . $this->printCoverageCounts($classInfo['pathsCovered'], $classInfo['pathsCount'], 3) . $resetColor . ' ' - . ' ' . $branchesColor . 'Branches: ' . $this->printCoverageCounts($classInfo['branchesCovered'], $classInfo['branchesCount'], 3) . $resetColor . ' '; - } - $output .= ' ' . $linesColor . 'Lines: ' . $this->printCoverageCounts($classInfo['statementsCovered'], $classInfo['statementCount'], 3) . $resetColor; - } - } - - return $output . PHP_EOL; - } - - private function coverageColor(int $numberOfCoveredElements, int $totalNumberOfElements): string - { - $coverage = Percentage::fromFractionAndTotal( - $numberOfCoveredElements, - $totalNumberOfElements - ); - - if ($coverage->asFloat() >= $this->highLowerBound) { - return self::COLOR_GREEN; - } - - if ($coverage->asFloat() > $this->lowUpperBound) { - return self::COLOR_YELLOW; - } - - return self::COLOR_RED; - } - - private function printCoverageCounts(int $numberOfCoveredElements, int $totalNumberOfElements, int $precision): string - { - $format = '%' . $precision . 's'; - - return Percentage::fromFractionAndTotal( - $numberOfCoveredElements, - $totalNumberOfElements - )->asFixedWidthString() . - ' (' . sprintf($format, $numberOfCoveredElements) . '/' . - sprintf($format, $totalNumberOfElements) . ')'; - } - - /** - * @param false|string $string - */ - private function format(string $color, int $padding, $string): string - { - $reset = $color ? self::COLOR_RESET : ''; - - return $color . str_pad((string) $string, $padding) . $reset . PHP_EOL; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/BuildInformation.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/BuildInformation.php deleted file mode 100644 index ebdbae61..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/BuildInformation.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 SebastianBergmann\CodeCoverage\Report\Xml; - -use function constant; -use function phpversion; -use DateTimeImmutable; -use DOMElement; -use SebastianBergmann\Environment\Runtime; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -final class BuildInformation -{ - /** - * @var DOMElement - */ - private $contextNode; - - public function __construct(DOMElement $contextNode) - { - $this->contextNode = $contextNode; - } - - public function setRuntimeInformation(Runtime $runtime): void - { - $runtimeNode = $this->nodeByName('runtime'); - - $runtimeNode->setAttribute('name', $runtime->getName()); - $runtimeNode->setAttribute('version', $runtime->getVersion()); - $runtimeNode->setAttribute('url', $runtime->getVendorUrl()); - - $driverNode = $this->nodeByName('driver'); - - if ($runtime->hasPHPDBGCodeCoverage()) { - $driverNode->setAttribute('name', 'phpdbg'); - $driverNode->setAttribute('version', constant('PHPDBG_VERSION')); - } - - if ($runtime->hasXdebug()) { - $driverNode->setAttribute('name', 'xdebug'); - $driverNode->setAttribute('version', phpversion('xdebug')); - } - - if ($runtime->hasPCOV()) { - $driverNode->setAttribute('name', 'pcov'); - $driverNode->setAttribute('version', phpversion('pcov')); - } - } - - public function setBuildTime(DateTimeImmutable $date): void - { - $this->contextNode->setAttribute('time', $date->format('D M j G:i:s T Y')); - } - - public function setGeneratorVersions(string $phpUnitVersion, string $coverageVersion): void - { - $this->contextNode->setAttribute('phpunit', $phpUnitVersion); - $this->contextNode->setAttribute('coverage', $coverageVersion); - } - - private function nodeByName(string $name): DOMElement - { - $node = $this->contextNode->getElementsByTagNameNS( - 'https://schema.phpunit.de/coverage/1.0', - $name - )->item(0); - - if (!$node) { - $node = $this->contextNode->appendChild( - $this->contextNode->ownerDocument->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - $name - ) - ); - } - - return $node; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/Coverage.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/Coverage.php deleted file mode 100644 index b556d820..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/Coverage.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report\Xml; - -use DOMElement; -use SebastianBergmann\CodeCoverage\ReportAlreadyFinalizedException; -use XMLWriter; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -final class Coverage -{ - /** - * @var XMLWriter - */ - private $writer; - - /** - * @var DOMElement - */ - private $contextNode; - - /** - * @var bool - */ - private $finalized = false; - - public function __construct(DOMElement $context, string $line) - { - $this->contextNode = $context; - - $this->writer = new XMLWriter; - $this->writer->openMemory(); - $this->writer->startElementNS(null, $context->nodeName, 'https://schema.phpunit.de/coverage/1.0'); - $this->writer->writeAttribute('nr', $line); - } - - /** - * @throws ReportAlreadyFinalizedException - */ - public function addTest(string $test): void - { - if ($this->finalized) { - throw new ReportAlreadyFinalizedException; - } - - $this->writer->startElement('covered'); - $this->writer->writeAttribute('by', $test); - $this->writer->endElement(); - } - - public function finalize(): void - { - $this->writer->endElement(); - - $fragment = $this->contextNode->ownerDocument->createDocumentFragment(); - $fragment->appendXML($this->writer->outputMemory()); - - $this->contextNode->parentNode->replaceChild( - $fragment, - $this->contextNode - ); - - $this->finalized = true; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/Directory.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/Directory.php deleted file mode 100644 index b712953a..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/Directory.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report\Xml; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -final class Directory extends Node -{ -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/Facade.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/Facade.php deleted file mode 100644 index 3ecc7506..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/Facade.php +++ /dev/null @@ -1,315 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report\Xml; - -use const DIRECTORY_SEPARATOR; -use const PHP_EOL; -use function count; -use function dirname; -use function file_get_contents; -use function file_put_contents; -use function is_array; -use function is_dir; -use function is_file; -use function is_writable; -use function libxml_clear_errors; -use function libxml_get_errors; -use function libxml_use_internal_errors; -use function sprintf; -use function strlen; -use function substr; -use DateTimeImmutable; -use DOMDocument; -use SebastianBergmann\CodeCoverage\CodeCoverage; -use SebastianBergmann\CodeCoverage\Driver\PathExistsButIsNotDirectoryException; -use SebastianBergmann\CodeCoverage\Driver\WriteOperationFailedException; -use SebastianBergmann\CodeCoverage\Node\AbstractNode; -use SebastianBergmann\CodeCoverage\Node\Directory as DirectoryNode; -use SebastianBergmann\CodeCoverage\Node\File as FileNode; -use SebastianBergmann\CodeCoverage\Util\Filesystem as DirectoryUtil; -use SebastianBergmann\CodeCoverage\Version; -use SebastianBergmann\CodeCoverage\XmlException; -use SebastianBergmann\Environment\Runtime; - -final class Facade -{ - /** - * @var string - */ - private $target; - - /** - * @var Project - */ - private $project; - - /** - * @var string - */ - private $phpUnitVersion; - - public function __construct(string $version) - { - $this->phpUnitVersion = $version; - } - - /** - * @throws XmlException - */ - public function process(CodeCoverage $coverage, string $target): void - { - if (substr($target, -1, 1) !== DIRECTORY_SEPARATOR) { - $target .= DIRECTORY_SEPARATOR; - } - - $this->target = $target; - $this->initTargetDirectory($target); - - $report = $coverage->getReport(); - - $this->project = new Project( - $coverage->getReport()->name() - ); - - $this->setBuildInformation(); - $this->processTests($coverage->getTests()); - $this->processDirectory($report, $this->project); - - $this->saveDocument($this->project->asDom(), 'index'); - } - - private function setBuildInformation(): void - { - $buildNode = $this->project->buildInformation(); - $buildNode->setRuntimeInformation(new Runtime); - $buildNode->setBuildTime(new DateTimeImmutable); - $buildNode->setGeneratorVersions($this->phpUnitVersion, Version::id()); - } - - /** - * @throws PathExistsButIsNotDirectoryException - * @throws WriteOperationFailedException - */ - private function initTargetDirectory(string $directory): void - { - if (is_file($directory)) { - if (!is_dir($directory)) { - throw new PathExistsButIsNotDirectoryException($directory); - } - - if (!is_writable($directory)) { - throw new WriteOperationFailedException($directory); - } - } - - DirectoryUtil::createDirectory($directory); - } - - /** - * @throws XmlException - */ - private function processDirectory(DirectoryNode $directory, Node $context): void - { - $directoryName = $directory->name(); - - if ($this->project->projectSourceDirectory() === $directoryName) { - $directoryName = '/'; - } - - $directoryObject = $context->addDirectory($directoryName); - - $this->setTotals($directory, $directoryObject->totals()); - - foreach ($directory->directories() as $node) { - $this->processDirectory($node, $directoryObject); - } - - foreach ($directory->files() as $node) { - $this->processFile($node, $directoryObject); - } - } - - /** - * @throws XmlException - */ - private function processFile(FileNode $file, Directory $context): void - { - $fileObject = $context->addFile( - $file->name(), - $file->id() . '.xml' - ); - - $this->setTotals($file, $fileObject->totals()); - - $path = substr( - $file->pathAsString(), - strlen($this->project->projectSourceDirectory()) - ); - - $fileReport = new Report($path); - - $this->setTotals($file, $fileReport->totals()); - - foreach ($file->classesAndTraits() as $unit) { - $this->processUnit($unit, $fileReport); - } - - foreach ($file->functions() as $function) { - $this->processFunction($function, $fileReport); - } - - foreach ($file->lineCoverageData() as $line => $tests) { - if (!is_array($tests) || count($tests) === 0) { - continue; - } - - $coverage = $fileReport->lineCoverage((string) $line); - - foreach ($tests as $test) { - $coverage->addTest($test); - } - - $coverage->finalize(); - } - - $fileReport->source()->setSourceCode( - file_get_contents($file->pathAsString()) - ); - - $this->saveDocument($fileReport->asDom(), $file->id()); - } - - private function processUnit(array $unit, Report $report): void - { - if (isset($unit['className'])) { - $unitObject = $report->classObject($unit['className']); - } else { - $unitObject = $report->traitObject($unit['traitName']); - } - - $unitObject->setLines( - $unit['startLine'], - $unit['executableLines'], - $unit['executedLines'] - ); - - $unitObject->setCrap((float) $unit['crap']); - $unitObject->setNamespace($unit['namespace']); - - foreach ($unit['methods'] as $method) { - $methodObject = $unitObject->addMethod($method['methodName']); - $methodObject->setSignature($method['signature']); - $methodObject->setLines((string) $method['startLine'], (string) $method['endLine']); - $methodObject->setCrap($method['crap']); - $methodObject->setTotals( - (string) $method['executableLines'], - (string) $method['executedLines'], - (string) $method['coverage'] - ); - } - } - - private function processFunction(array $function, Report $report): void - { - $functionObject = $report->functionObject($function['functionName']); - - $functionObject->setSignature($function['signature']); - $functionObject->setLines((string) $function['startLine']); - $functionObject->setCrap($function['crap']); - $functionObject->setTotals((string) $function['executableLines'], (string) $function['executedLines'], (string) $function['coverage']); - } - - private function processTests(array $tests): void - { - $testsObject = $this->project->tests(); - - foreach ($tests as $test => $result) { - $testsObject->addTest($test, $result); - } - } - - private function setTotals(AbstractNode $node, Totals $totals): void - { - $loc = $node->linesOfCode(); - - $totals->setNumLines( - $loc['linesOfCode'], - $loc['commentLinesOfCode'], - $loc['nonCommentLinesOfCode'], - $node->numberOfExecutableLines(), - $node->numberOfExecutedLines() - ); - - $totals->setNumClasses( - $node->numberOfClasses(), - $node->numberOfTestedClasses() - ); - - $totals->setNumTraits( - $node->numberOfTraits(), - $node->numberOfTestedTraits() - ); - - $totals->setNumMethods( - $node->numberOfMethods(), - $node->numberOfTestedMethods() - ); - - $totals->setNumFunctions( - $node->numberOfFunctions(), - $node->numberOfTestedFunctions() - ); - } - - private function targetDirectory(): string - { - return $this->target; - } - - /** - * @throws XmlException - */ - private function saveDocument(DOMDocument $document, string $name): void - { - $filename = sprintf('%s/%s.xml', $this->targetDirectory(), $name); - - $document->formatOutput = true; - $document->preserveWhiteSpace = false; - $this->initTargetDirectory(dirname($filename)); - - file_put_contents($filename, $this->documentAsString($document)); - } - - /** - * @throws XmlException - * - * @see https://bugs.php.net/bug.php?id=79191 - */ - private function documentAsString(DOMDocument $document): string - { - $xmlErrorHandling = libxml_use_internal_errors(true); - $xml = $document->saveXML(); - - if ($xml === false) { - $message = 'Unable to generate the XML'; - - foreach (libxml_get_errors() as $error) { - $message .= PHP_EOL . $error->message; - } - - throw new XmlException($message); - } - - libxml_clear_errors(); - libxml_use_internal_errors($xmlErrorHandling); - - return $xml; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/File.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/File.php deleted file mode 100644 index 245c5cee..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/File.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 SebastianBergmann\CodeCoverage\Report\Xml; - -use DOMDocument; -use DOMElement; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -class File -{ - /** - * @var DOMDocument - */ - private $dom; - - /** - * @var DOMElement - */ - private $contextNode; - - public function __construct(DOMElement $context) - { - $this->dom = $context->ownerDocument; - $this->contextNode = $context; - } - - public function totals(): Totals - { - $totalsContainer = $this->contextNode->firstChild; - - if (!$totalsContainer) { - $totalsContainer = $this->contextNode->appendChild( - $this->dom->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'totals' - ) - ); - } - - return new Totals($totalsContainer); - } - - public function lineCoverage(string $line): Coverage - { - $coverage = $this->contextNode->getElementsByTagNameNS( - 'https://schema.phpunit.de/coverage/1.0', - 'coverage' - )->item(0); - - if (!$coverage) { - $coverage = $this->contextNode->appendChild( - $this->dom->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'coverage' - ) - ); - } - - $lineNode = $coverage->appendChild( - $this->dom->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'line' - ) - ); - - return new Coverage($lineNode, $line); - } - - protected function contextNode(): DOMElement - { - return $this->contextNode; - } - - protected function dom(): DOMDocument - { - return $this->dom; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/Method.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/Method.php deleted file mode 100644 index 7e300999..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/Method.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report\Xml; - -use DOMElement; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -final class Method -{ - /** - * @var DOMElement - */ - private $contextNode; - - public function __construct(DOMElement $context, string $name) - { - $this->contextNode = $context; - - $this->setName($name); - } - - public function setSignature(string $signature): void - { - $this->contextNode->setAttribute('signature', $signature); - } - - public function setLines(string $start, ?string $end = null): void - { - $this->contextNode->setAttribute('start', $start); - - if ($end !== null) { - $this->contextNode->setAttribute('end', $end); - } - } - - public function setTotals(string $executable, string $executed, string $coverage): void - { - $this->contextNode->setAttribute('executable', $executable); - $this->contextNode->setAttribute('executed', $executed); - $this->contextNode->setAttribute('coverage', $coverage); - } - - public function setCrap(string $crap): void - { - $this->contextNode->setAttribute('crap', $crap); - } - - private function setName(string $name): void - { - $this->contextNode->setAttribute('name', $name); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/Node.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/Node.php deleted file mode 100644 index 15992309..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/Node.php +++ /dev/null @@ -1,93 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report\Xml; - -use DOMDocument; -use DOMElement; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -abstract class Node -{ - /** - * @var DOMDocument - */ - private $dom; - - /** - * @var DOMElement - */ - private $contextNode; - - public function __construct(DOMElement $context) - { - $this->setContextNode($context); - } - - public function dom(): DOMDocument - { - return $this->dom; - } - - public function totals(): Totals - { - $totalsContainer = $this->contextNode()->firstChild; - - if (!$totalsContainer) { - $totalsContainer = $this->contextNode()->appendChild( - $this->dom->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'totals' - ) - ); - } - - return new Totals($totalsContainer); - } - - public function addDirectory(string $name): Directory - { - $dirNode = $this->dom()->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'directory' - ); - - $dirNode->setAttribute('name', $name); - $this->contextNode()->appendChild($dirNode); - - return new Directory($dirNode); - } - - public function addFile(string $name, string $href): File - { - $fileNode = $this->dom()->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'file' - ); - - $fileNode->setAttribute('name', $name); - $fileNode->setAttribute('href', $href); - $this->contextNode()->appendChild($fileNode); - - return new File($fileNode); - } - - protected function setContextNode(DOMElement $context): void - { - $this->dom = $context->ownerDocument; - $this->contextNode = $context; - } - - protected function contextNode(): DOMElement - { - return $this->contextNode; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/Project.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/Project.php deleted file mode 100644 index b566bce0..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/Project.php +++ /dev/null @@ -1,90 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report\Xml; - -use DOMDocument; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -final class Project extends Node -{ - public function __construct(string $directory) - { - $this->init(); - $this->setProjectSourceDirectory($directory); - } - - public function projectSourceDirectory(): string - { - return $this->contextNode()->getAttribute('source'); - } - - public function buildInformation(): BuildInformation - { - $buildNode = $this->dom()->getElementsByTagNameNS( - 'https://schema.phpunit.de/coverage/1.0', - 'build' - )->item(0); - - if (!$buildNode) { - $buildNode = $this->dom()->documentElement->appendChild( - $this->dom()->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'build' - ) - ); - } - - return new BuildInformation($buildNode); - } - - public function tests(): Tests - { - $testsNode = $this->contextNode()->getElementsByTagNameNS( - 'https://schema.phpunit.de/coverage/1.0', - 'tests' - )->item(0); - - if (!$testsNode) { - $testsNode = $this->contextNode()->appendChild( - $this->dom()->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'tests' - ) - ); - } - - return new Tests($testsNode); - } - - public function asDom(): DOMDocument - { - return $this->dom(); - } - - private function init(): void - { - $dom = new DOMDocument; - $dom->loadXML(''); - - $this->setContextNode( - $dom->getElementsByTagNameNS( - 'https://schema.phpunit.de/coverage/1.0', - 'project' - )->item(0) - ); - } - - private function setProjectSourceDirectory(string $name): void - { - $this->contextNode()->setAttribute('source', $name); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/Report.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/Report.php deleted file mode 100644 index 7f2badae..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/Report.php +++ /dev/null @@ -1,99 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report\Xml; - -use function basename; -use function dirname; -use DOMDocument; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -final class Report extends File -{ - public function __construct(string $name) - { - $dom = new DOMDocument; - $dom->loadXML(''); - - $contextNode = $dom->getElementsByTagNameNS( - 'https://schema.phpunit.de/coverage/1.0', - 'file' - )->item(0); - - parent::__construct($contextNode); - - $this->setName($name); - } - - public function asDom(): DOMDocument - { - return $this->dom(); - } - - public function functionObject($name): Method - { - $node = $this->contextNode()->appendChild( - $this->dom()->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'function' - ) - ); - - return new Method($node, $name); - } - - public function classObject($name): Unit - { - return $this->unitObject('class', $name); - } - - public function traitObject($name): Unit - { - return $this->unitObject('trait', $name); - } - - public function source(): Source - { - $source = $this->contextNode()->getElementsByTagNameNS( - 'https://schema.phpunit.de/coverage/1.0', - 'source' - )->item(0); - - if (!$source) { - $source = $this->contextNode()->appendChild( - $this->dom()->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'source' - ) - ); - } - - return new Source($source); - } - - private function setName(string $name): void - { - $this->contextNode()->setAttribute('name', basename($name)); - $this->contextNode()->setAttribute('path', dirname($name)); - } - - private function unitObject(string $tagName, $name): Unit - { - $node = $this->contextNode()->appendChild( - $this->dom()->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - $tagName - ) - ); - - return new Unit($node, $name); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/Source.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/Source.php deleted file mode 100644 index 2b67ce1d..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/Source.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. - */ -namespace SebastianBergmann\CodeCoverage\Report\Xml; - -use DOMElement; -use TheSeer\Tokenizer\NamespaceUri; -use TheSeer\Tokenizer\Tokenizer; -use TheSeer\Tokenizer\XMLSerializer; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -final class Source -{ - /** @var DOMElement */ - private $context; - - public function __construct(DOMElement $context) - { - $this->context = $context; - } - - public function setSourceCode(string $source): void - { - $context = $this->context; - - $tokens = (new Tokenizer)->parse($source); - $srcDom = (new XMLSerializer(new NamespaceUri($context->namespaceURI)))->toDom($tokens); - - $context->parentNode->replaceChild( - $context->ownerDocument->importNode($srcDom->documentElement, true), - $context - ); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/Tests.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/Tests.php deleted file mode 100644 index c2e56268..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/Tests.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 SebastianBergmann\CodeCoverage\Report\Xml; - -use DOMElement; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -final class Tests -{ - private $contextNode; - - private $codeMap = [ - -1 => 'UNKNOWN', // PHPUnit_Runner_BaseTestRunner::STATUS_UNKNOWN - 0 => 'PASSED', // PHPUnit_Runner_BaseTestRunner::STATUS_PASSED - 1 => 'SKIPPED', // PHPUnit_Runner_BaseTestRunner::STATUS_SKIPPED - 2 => 'INCOMPLETE', // PHPUnit_Runner_BaseTestRunner::STATUS_INCOMPLETE - 3 => 'FAILURE', // PHPUnit_Runner_BaseTestRunner::STATUS_FAILURE - 4 => 'ERROR', // PHPUnit_Runner_BaseTestRunner::STATUS_ERROR - 5 => 'RISKY', // PHPUnit_Runner_BaseTestRunner::STATUS_RISKY - 6 => 'WARNING', // PHPUnit_Runner_BaseTestRunner::STATUS_WARNING - ]; - - public function __construct(DOMElement $context) - { - $this->contextNode = $context; - } - - public function addTest(string $test, array $result): void - { - $node = $this->contextNode->appendChild( - $this->contextNode->ownerDocument->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'test' - ) - ); - - $node->setAttribute('name', $test); - $node->setAttribute('size', $result['size']); - $node->setAttribute('result', (string) $result['status']); - $node->setAttribute('status', $this->codeMap[(int) $result['status']]); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/Totals.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/Totals.php deleted file mode 100644 index 37081318..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/Totals.php +++ /dev/null @@ -1,146 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report\Xml; - -use function sprintf; -use DOMElement; -use DOMNode; -use SebastianBergmann\CodeCoverage\Util\Percentage; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -final class Totals -{ - /** - * @var DOMNode - */ - private $container; - - /** - * @var DOMElement - */ - private $linesNode; - - /** - * @var DOMElement - */ - private $methodsNode; - - /** - * @var DOMElement - */ - private $functionsNode; - - /** - * @var DOMElement - */ - private $classesNode; - - /** - * @var DOMElement - */ - private $traitsNode; - - public function __construct(DOMElement $container) - { - $this->container = $container; - $dom = $container->ownerDocument; - - $this->linesNode = $dom->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'lines' - ); - - $this->methodsNode = $dom->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'methods' - ); - - $this->functionsNode = $dom->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'functions' - ); - - $this->classesNode = $dom->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'classes' - ); - - $this->traitsNode = $dom->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'traits' - ); - - $container->appendChild($this->linesNode); - $container->appendChild($this->methodsNode); - $container->appendChild($this->functionsNode); - $container->appendChild($this->classesNode); - $container->appendChild($this->traitsNode); - } - - public function container(): DOMNode - { - return $this->container; - } - - public function setNumLines(int $loc, int $cloc, int $ncloc, int $executable, int $executed): void - { - $this->linesNode->setAttribute('total', (string) $loc); - $this->linesNode->setAttribute('comments', (string) $cloc); - $this->linesNode->setAttribute('code', (string) $ncloc); - $this->linesNode->setAttribute('executable', (string) $executable); - $this->linesNode->setAttribute('executed', (string) $executed); - $this->linesNode->setAttribute( - 'percent', - $executable === 0 ? '0' : sprintf('%01.2F', Percentage::fromFractionAndTotal($executed, $executable)->asFloat()) - ); - } - - public function setNumClasses(int $count, int $tested): void - { - $this->classesNode->setAttribute('count', (string) $count); - $this->classesNode->setAttribute('tested', (string) $tested); - $this->classesNode->setAttribute( - 'percent', - $count === 0 ? '0' : sprintf('%01.2F', Percentage::fromFractionAndTotal($tested, $count)->asFloat()) - ); - } - - public function setNumTraits(int $count, int $tested): void - { - $this->traitsNode->setAttribute('count', (string) $count); - $this->traitsNode->setAttribute('tested', (string) $tested); - $this->traitsNode->setAttribute( - 'percent', - $count === 0 ? '0' : sprintf('%01.2F', Percentage::fromFractionAndTotal($tested, $count)->asFloat()) - ); - } - - public function setNumMethods(int $count, int $tested): void - { - $this->methodsNode->setAttribute('count', (string) $count); - $this->methodsNode->setAttribute('tested', (string) $tested); - $this->methodsNode->setAttribute( - 'percent', - $count === 0 ? '0' : sprintf('%01.2F', Percentage::fromFractionAndTotal($tested, $count)->asFloat()) - ); - } - - public function setNumFunctions(int $count, int $tested): void - { - $this->functionsNode->setAttribute('count', (string) $count); - $this->functionsNode->setAttribute('tested', (string) $tested); - $this->functionsNode->setAttribute( - 'percent', - $count === 0 ? '0' : sprintf('%01.2F', Percentage::fromFractionAndTotal($tested, $count)->asFloat()) - ); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/Unit.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/Unit.php deleted file mode 100644 index d84dc481..00000000 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/Unit.php +++ /dev/null @@ -1,78 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\Report\Xml; - -use DOMElement; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -final class Unit -{ - /** - * @var DOMElement - */ - private $contextNode; - - public function __construct(DOMElement $context, string $name) - { - $this->contextNode = $context; - - $this->setName($name); - } - - public function setLines(int $start, int $executable, int $executed): void - { - $this->contextNode->setAttribute('start', (string) $start); - $this->contextNode->setAttribute('executable', (string) $executable); - $this->contextNode->setAttribute('executed', (string) $executed); - } - - public function setCrap(float $crap): void - { - $this->contextNode->setAttribute('crap', (string) $crap); - } - - public function setNamespace(string $namespace): void - { - $node = $this->contextNode->getElementsByTagNameNS( - 'https://schema.phpunit.de/coverage/1.0', - 'namespace' - )->item(0); - - if (!$node) { - $node = $this->contextNode->appendChild( - $this->contextNode->ownerDocument->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'namespace' - ) - ); - } - - $node->setAttribute('name', $namespace); - } - - public function addMethod(string $name): Method - { - $node = $this->contextNode->appendChild( - $this->contextNode->ownerDocument->createElementNS( - 'https://schema.phpunit.de/coverage/1.0', - 'method' - ) - ); - - return new Method($node, $name); - } - - private function setName(string $name): void - { - $this->contextNode->setAttribute('name', $name); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CacheWarmer.php b/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CacheWarmer.php deleted file mode 100644 index 00a6d8df..00000000 --- a/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CacheWarmer.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 SebastianBergmann\CodeCoverage\StaticAnalysis; - -use SebastianBergmann\CodeCoverage\Filter; - -final class CacheWarmer -{ - public function warmCache(string $cacheDirectory, bool $useAnnotationsForIgnoringCode, bool $ignoreDeprecatedCode, Filter $filter): void - { - $analyser = new CachingFileAnalyser( - $cacheDirectory, - new ParsingFileAnalyser( - $useAnnotationsForIgnoringCode, - $ignoreDeprecatedCode - ) - ); - - foreach ($filter->files() as $file) { - $analyser->process($file); - } - } -} diff --git a/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CachingFileAnalyser.php b/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CachingFileAnalyser.php deleted file mode 100644 index f53da078..00000000 --- a/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CachingFileAnalyser.php +++ /dev/null @@ -1,184 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\StaticAnalysis; - -use function file_get_contents; -use function file_put_contents; -use function implode; -use function is_file; -use function md5; -use function serialize; -use function unserialize; -use SebastianBergmann\CodeCoverage\Util\Filesystem; -use SebastianBergmann\FileIterator\Facade as FileIteratorFacade; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -final class CachingFileAnalyser implements FileAnalyser -{ - /** - * @var ?string - */ - private static $cacheVersion; - - /** - * @var FileAnalyser - */ - private $analyser; - - /** - * @var array - */ - private $cache = []; - - /** - * @var string - */ - private $directory; - - public function __construct(string $directory, FileAnalyser $analyser) - { - Filesystem::createDirectory($directory); - - $this->analyser = $analyser; - $this->directory = $directory; - } - - public function classesIn(string $filename): array - { - if (!isset($this->cache[$filename])) { - $this->process($filename); - } - - return $this->cache[$filename]['classesIn']; - } - - public function traitsIn(string $filename): array - { - if (!isset($this->cache[$filename])) { - $this->process($filename); - } - - return $this->cache[$filename]['traitsIn']; - } - - public function functionsIn(string $filename): array - { - if (!isset($this->cache[$filename])) { - $this->process($filename); - } - - return $this->cache[$filename]['functionsIn']; - } - - /** - * @psalm-return array{linesOfCode: int, commentLinesOfCode: int, nonCommentLinesOfCode: int} - */ - public function linesOfCodeFor(string $filename): array - { - if (!isset($this->cache[$filename])) { - $this->process($filename); - } - - return $this->cache[$filename]['linesOfCodeFor']; - } - - public function executableLinesIn(string $filename): array - { - if (!isset($this->cache[$filename])) { - $this->process($filename); - } - - return $this->cache[$filename]['executableLinesIn']; - } - - public function ignoredLinesFor(string $filename): array - { - if (!isset($this->cache[$filename])) { - $this->process($filename); - } - - return $this->cache[$filename]['ignoredLinesFor']; - } - - public function process(string $filename): void - { - $cache = $this->read($filename); - - if ($cache !== false) { - $this->cache[$filename] = $cache; - - return; - } - - $this->cache[$filename] = [ - 'classesIn' => $this->analyser->classesIn($filename), - 'traitsIn' => $this->analyser->traitsIn($filename), - 'functionsIn' => $this->analyser->functionsIn($filename), - 'linesOfCodeFor' => $this->analyser->linesOfCodeFor($filename), - 'ignoredLinesFor' => $this->analyser->ignoredLinesFor($filename), - 'executableLinesIn' => $this->analyser->executableLinesIn($filename), - ]; - - $this->write($filename, $this->cache[$filename]); - } - - /** - * @return mixed - */ - private function read(string $filename) - { - $cacheFile = $this->cacheFile($filename); - - if (!is_file($cacheFile)) { - return false; - } - - return unserialize( - file_get_contents($cacheFile), - ['allowed_classes' => false] - ); - } - - /** - * @param mixed $data - */ - private function write(string $filename, $data): void - { - file_put_contents( - $this->cacheFile($filename), - serialize($data) - ); - } - - private function cacheFile(string $filename): string - { - return $this->directory . DIRECTORY_SEPARATOR . md5($filename . "\0" . file_get_contents($filename) . "\0" . self::cacheVersion()); - } - - private static function cacheVersion(): string - { - if (self::$cacheVersion !== null) { - return self::$cacheVersion; - } - - $buffer = []; - - foreach ((new FileIteratorFacade)->getFilesAsArray(__DIR__, '.php') as $file) { - $buffer[] = $file; - $buffer[] = file_get_contents($file); - } - - self::$cacheVersion = md5(implode("\0", $buffer)); - - return self::$cacheVersion; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CodeUnitFindingVisitor.php b/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CodeUnitFindingVisitor.php deleted file mode 100644 index 8a2003fa..00000000 --- a/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CodeUnitFindingVisitor.php +++ /dev/null @@ -1,326 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\StaticAnalysis; - -use function assert; -use function implode; -use function rtrim; -use function trim; -use PhpParser\Node; -use PhpParser\Node\ComplexType; -use PhpParser\Node\Identifier; -use PhpParser\Node\IntersectionType; -use PhpParser\Node\Name; -use PhpParser\Node\NullableType; -use PhpParser\Node\Stmt\Class_; -use PhpParser\Node\Stmt\ClassMethod; -use PhpParser\Node\Stmt\Enum_; -use PhpParser\Node\Stmt\Function_; -use PhpParser\Node\Stmt\Interface_; -use PhpParser\Node\Stmt\Trait_; -use PhpParser\Node\UnionType; -use PhpParser\NodeTraverser; -use PhpParser\NodeVisitorAbstract; -use SebastianBergmann\Complexity\CyclomaticComplexityCalculatingVisitor; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -final class CodeUnitFindingVisitor extends NodeVisitorAbstract -{ - /** - * @psalm-var array}> - */ - private $classes = []; - - /** - * @psalm-var array}> - */ - private $traits = []; - - /** - * @psalm-var array - */ - private $functions = []; - - public function enterNode(Node $node): void - { - if ($node instanceof Class_) { - if ($node->isAnonymous()) { - return; - } - - $this->processClass($node); - } - - if ($node instanceof Trait_) { - $this->processTrait($node); - } - - if (!$node instanceof ClassMethod && !$node instanceof Function_) { - return; - } - - if ($node instanceof ClassMethod) { - $parentNode = $node->getAttribute('parent'); - - if ($parentNode instanceof Class_ && $parentNode->isAnonymous()) { - return; - } - - $this->processMethod($node); - - return; - } - - $this->processFunction($node); - } - - /** - * @psalm-return array}> - */ - public function classes(): array - { - return $this->classes; - } - - /** - * @psalm-return array}> - */ - public function traits(): array - { - return $this->traits; - } - - /** - * @psalm-return array - */ - public function functions(): array - { - return $this->functions; - } - - /** - * @psalm-param ClassMethod|Function_ $node - */ - private function cyclomaticComplexity(Node $node): int - { - assert($node instanceof ClassMethod || $node instanceof Function_); - - $nodes = $node->getStmts(); - - if ($nodes === null) { - return 0; - } - - $traverser = new NodeTraverser; - - $cyclomaticComplexityCalculatingVisitor = new CyclomaticComplexityCalculatingVisitor; - - $traverser->addVisitor($cyclomaticComplexityCalculatingVisitor); - - /* @noinspection UnusedFunctionResultInspection */ - $traverser->traverse($nodes); - - return $cyclomaticComplexityCalculatingVisitor->cyclomaticComplexity(); - } - - /** - * @psalm-param ClassMethod|Function_ $node - */ - private function signature(Node $node): string - { - assert($node instanceof ClassMethod || $node instanceof Function_); - - $signature = ($node->returnsByRef() ? '&' : '') . $node->name->toString() . '('; - $parameters = []; - - foreach ($node->getParams() as $parameter) { - assert(isset($parameter->var->name)); - - $parameterAsString = ''; - - if ($parameter->type !== null) { - $parameterAsString = $this->type($parameter->type) . ' '; - } - - $parameterAsString .= '$' . $parameter->var->name; - - /* @todo Handle default values */ - - $parameters[] = $parameterAsString; - } - - $signature .= implode(', ', $parameters) . ')'; - - $returnType = $node->getReturnType(); - - if ($returnType !== null) { - $signature .= ': ' . $this->type($returnType); - } - - return $signature; - } - - /** - * @psalm-param Identifier|Name|ComplexType $type - */ - private function type(Node $type): string - { - assert($type instanceof Identifier || $type instanceof Name || $type instanceof ComplexType); - - if ($type instanceof NullableType) { - return '?' . $type->type; - } - - if ($type instanceof UnionType || $type instanceof IntersectionType) { - return $this->unionOrIntersectionAsString($type); - } - - return $type->toString(); - } - - private function visibility(ClassMethod $node): string - { - if ($node->isPrivate()) { - return 'private'; - } - - if ($node->isProtected()) { - return 'protected'; - } - - return 'public'; - } - - private function processClass(Class_ $node): void - { - $name = $node->name->toString(); - $namespacedName = $node->namespacedName->toString(); - - $this->classes[$namespacedName] = [ - 'name' => $name, - 'namespacedName' => $namespacedName, - 'namespace' => $this->namespace($namespacedName, $name), - 'startLine' => $node->getStartLine(), - 'endLine' => $node->getEndLine(), - 'methods' => [], - ]; - } - - private function processTrait(Trait_ $node): void - { - $name = $node->name->toString(); - $namespacedName = $node->namespacedName->toString(); - - $this->traits[$namespacedName] = [ - 'name' => $name, - 'namespacedName' => $namespacedName, - 'namespace' => $this->namespace($namespacedName, $name), - 'startLine' => $node->getStartLine(), - 'endLine' => $node->getEndLine(), - 'methods' => [], - ]; - } - - private function processMethod(ClassMethod $node): void - { - $parentNode = $node->getAttribute('parent'); - - if ($parentNode instanceof Interface_) { - return; - } - - assert($parentNode instanceof Class_ || $parentNode instanceof Trait_ || $parentNode instanceof Enum_); - assert(isset($parentNode->name)); - assert(isset($parentNode->namespacedName)); - assert($parentNode->namespacedName instanceof Name); - - $parentName = $parentNode->name->toString(); - $parentNamespacedName = $parentNode->namespacedName->toString(); - - if ($parentNode instanceof Class_) { - $storage = &$this->classes; - } else { - $storage = &$this->traits; - } - - if (!isset($storage[$parentNamespacedName])) { - $storage[$parentNamespacedName] = [ - 'name' => $parentName, - 'namespacedName' => $parentNamespacedName, - 'namespace' => $this->namespace($parentNamespacedName, $parentName), - 'startLine' => $parentNode->getStartLine(), - 'endLine' => $parentNode->getEndLine(), - 'methods' => [], - ]; - } - - $storage[$parentNamespacedName]['methods'][$node->name->toString()] = [ - 'methodName' => $node->name->toString(), - 'signature' => $this->signature($node), - 'visibility' => $this->visibility($node), - 'startLine' => $node->getStartLine(), - 'endLine' => $node->getEndLine(), - 'ccn' => $this->cyclomaticComplexity($node), - ]; - } - - private function processFunction(Function_ $node): void - { - assert(isset($node->name)); - assert(isset($node->namespacedName)); - assert($node->namespacedName instanceof Name); - - $name = $node->name->toString(); - $namespacedName = $node->namespacedName->toString(); - - $this->functions[$namespacedName] = [ - 'name' => $name, - 'namespacedName' => $namespacedName, - 'namespace' => $this->namespace($namespacedName, $name), - 'signature' => $this->signature($node), - 'startLine' => $node->getStartLine(), - 'endLine' => $node->getEndLine(), - 'ccn' => $this->cyclomaticComplexity($node), - ]; - } - - private function namespace(string $namespacedName, string $name): string - { - return trim(rtrim($namespacedName, $name), '\\'); - } - - /** - * @psalm-param UnionType|IntersectionType $type - */ - private function unionOrIntersectionAsString(ComplexType $type): string - { - if ($type instanceof UnionType) { - $separator = '|'; - } else { - $separator = '&'; - } - - $types = []; - - foreach ($type->types as $_type) { - if ($_type instanceof Name) { - $types[] = $_type->toCodeString(); - } else { - assert($_type instanceof Identifier); - - $types[] = $_type->toString(); - } - } - - return implode($separator, $types); - } -} diff --git a/vendor/phpunit/php-code-coverage/src/StaticAnalysis/ExecutableLinesFindingVisitor.php b/vendor/phpunit/php-code-coverage/src/StaticAnalysis/ExecutableLinesFindingVisitor.php deleted file mode 100644 index 04e2f03d..00000000 --- a/vendor/phpunit/php-code-coverage/src/StaticAnalysis/ExecutableLinesFindingVisitor.php +++ /dev/null @@ -1,362 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\StaticAnalysis; - -use function array_diff_key; -use function assert; -use function count; -use function current; -use function end; -use function explode; -use function max; -use function preg_match; -use function preg_quote; -use function range; -use function reset; -use function sprintf; -use PhpParser\Node; -use PhpParser\NodeVisitorAbstract; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -final class ExecutableLinesFindingVisitor extends NodeVisitorAbstract -{ - /** - * @var int - */ - private $nextBranch = 0; - - /** - * @var string - */ - private $source; - - /** - * @var array - */ - private $executableLinesGroupedByBranch = []; - - /** - * @var array - */ - private $unsets = []; - - /** - * @var array - */ - private $commentsToCheckForUnset = []; - - public function __construct(string $source) - { - $this->source = $source; - } - - public function enterNode(Node $node): void - { - foreach ($node->getComments() as $comment) { - $commentLine = $comment->getStartLine(); - - if (!isset($this->executableLinesGroupedByBranch[$commentLine])) { - continue; - } - - foreach (explode("\n", $comment->getText()) as $text) { - $this->commentsToCheckForUnset[$commentLine] = $text; - $commentLine++; - } - } - - if ($node instanceof Node\Scalar\String_ || - $node instanceof Node\Scalar\EncapsedStringPart) { - $startLine = $node->getStartLine() + 1; - $endLine = $node->getEndLine() - 1; - - if ($startLine <= $endLine) { - foreach (range($startLine, $endLine) as $line) { - unset($this->executableLinesGroupedByBranch[$line]); - } - } - - return; - } - - if ($node instanceof Node\Stmt\Declare_ || - $node instanceof Node\Stmt\DeclareDeclare || - $node instanceof Node\Stmt\Else_ || - $node instanceof Node\Stmt\Finally_ || - $node instanceof Node\Stmt\Interface_ || - $node instanceof Node\Stmt\Label || - $node instanceof Node\Stmt\Namespace_ || - $node instanceof Node\Stmt\Nop || - $node instanceof Node\Stmt\Switch_ || - $node instanceof Node\Stmt\TryCatch || - $node instanceof Node\Stmt\Use_ || - $node instanceof Node\Stmt\UseUse || - $node instanceof Node\Expr\Match_ || - $node instanceof Node\Expr\Variable || - $node instanceof Node\Const_ || - $node instanceof Node\Identifier || - $node instanceof Node\Name || - $node instanceof Node\Param || - $node instanceof Node\Scalar) { - return; - } - - if ($node instanceof Node\Stmt\Throw_) { - $this->setLineBranch($node->expr->getEndLine(), $node->expr->getEndLine(), ++$this->nextBranch); - - return; - } - - if ($node instanceof Node\Stmt\Function_ || - $node instanceof Node\Stmt\Class_ || - $node instanceof Node\Stmt\ClassMethod || - $node instanceof Node\Expr\Closure || - $node instanceof Node\Stmt\Trait_) { - $isConcreteClassLike = $node instanceof Node\Stmt\Class_ || $node instanceof Node\Stmt\Trait_; - - if (null !== $node->stmts) { - foreach ($node->stmts as $stmt) { - if ($stmt instanceof Node\Stmt\Nop) { - continue; - } - - foreach (range($stmt->getStartLine(), $stmt->getEndLine()) as $line) { - unset($this->executableLinesGroupedByBranch[$line]); - - if ( - $isConcreteClassLike && - !$stmt instanceof Node\Stmt\ClassMethod - ) { - $this->unsets[$line] = true; - } - } - } - } - - if ($isConcreteClassLike) { - return; - } - - $hasEmptyBody = [] === $node->stmts || - null === $node->stmts || - ( - 1 === count($node->stmts) && - $node->stmts[0] instanceof Node\Stmt\Nop - ); - - if ($hasEmptyBody) { - if ($node->getEndLine() === $node->getStartLine()) { - return; - } - - $this->setLineBranch($node->getEndLine(), $node->getEndLine(), ++$this->nextBranch); - - return; - } - - return; - } - - if ($node instanceof Node\Expr\ArrowFunction) { - $startLine = max( - $node->getStartLine() + 1, - $node->expr->getStartLine() - ); - - $endLine = $node->expr->getEndLine(); - - if ($endLine < $startLine) { - return; - } - - $this->setLineBranch($startLine, $endLine, ++$this->nextBranch); - - return; - } - - if ($node instanceof Node\Expr\Ternary) { - if (null !== $node->if && - $node->getStartLine() !== $node->if->getEndLine()) { - $this->setLineBranch($node->if->getStartLine(), $node->if->getEndLine(), ++$this->nextBranch); - } - - if ($node->getStartLine() !== $node->else->getEndLine()) { - $this->setLineBranch($node->else->getStartLine(), $node->else->getEndLine(), ++$this->nextBranch); - } - - return; - } - - if ($node instanceof Node\Expr\BinaryOp\Coalesce) { - if ($node->getStartLine() !== $node->getEndLine()) { - $this->setLineBranch($node->getEndLine(), $node->getEndLine(), ++$this->nextBranch); - } - - return; - } - - if ($node instanceof Node\Stmt\If_ || - $node instanceof Node\Stmt\ElseIf_ || - $node instanceof Node\Stmt\Case_) { - if (null === $node->cond) { - return; - } - - $this->setLineBranch( - $node->cond->getStartLine(), - $node->cond->getStartLine(), - ++$this->nextBranch - ); - - return; - } - - if ($node instanceof Node\Stmt\For_) { - $startLine = null; - $endLine = null; - - if ([] !== $node->init) { - $startLine = $node->init[0]->getStartLine(); - - end($node->init); - - $endLine = current($node->init)->getEndLine(); - - reset($node->init); - } - - if ([] !== $node->cond) { - if (null === $startLine) { - $startLine = $node->cond[0]->getStartLine(); - } - - end($node->cond); - - $endLine = current($node->cond)->getEndLine(); - - reset($node->cond); - } - - if ([] !== $node->loop) { - if (null === $startLine) { - $startLine = $node->loop[0]->getStartLine(); - } - - end($node->loop); - - $endLine = current($node->loop)->getEndLine(); - - reset($node->loop); - } - - if (null === $startLine || null === $endLine) { - return; - } - - $this->setLineBranch( - $startLine, - $endLine, - ++$this->nextBranch - ); - - return; - } - - if ($node instanceof Node\Stmt\Foreach_) { - $this->setLineBranch( - $node->expr->getStartLine(), - $node->valueVar->getEndLine(), - ++$this->nextBranch - ); - - return; - } - - if ($node instanceof Node\Stmt\While_ || - $node instanceof Node\Stmt\Do_) { - $this->setLineBranch( - $node->cond->getStartLine(), - $node->cond->getEndLine(), - ++$this->nextBranch - ); - - return; - } - - if ($node instanceof Node\Stmt\Catch_) { - assert([] !== $node->types); - $startLine = $node->types[0]->getStartLine(); - end($node->types); - $endLine = current($node->types)->getEndLine(); - - $this->setLineBranch( - $startLine, - $endLine, - ++$this->nextBranch - ); - - return; - } - - if ($node instanceof Node\Expr\CallLike) { - if (isset($this->executableLinesGroupedByBranch[$node->getStartLine()])) { - $branch = $this->executableLinesGroupedByBranch[$node->getStartLine()]; - } else { - $branch = ++$this->nextBranch; - } - - $this->setLineBranch($node->getStartLine(), $node->getEndLine(), $branch); - - return; - } - - if (isset($this->executableLinesGroupedByBranch[$node->getStartLine()])) { - return; - } - - $this->setLineBranch($node->getStartLine(), $node->getEndLine(), ++$this->nextBranch); - } - - public function afterTraverse(array $nodes): void - { - $lines = explode("\n", $this->source); - - foreach ($lines as $lineNumber => $line) { - $lineNumber++; - - if (1 === preg_match('/^\s*$/', $line) || - ( - isset($this->commentsToCheckForUnset[$lineNumber]) && - 1 === preg_match(sprintf('/^\s*%s\s*$/', preg_quote($this->commentsToCheckForUnset[$lineNumber], '/')), $line) - )) { - unset($this->executableLinesGroupedByBranch[$lineNumber]); - } - } - - $this->executableLinesGroupedByBranch = array_diff_key( - $this->executableLinesGroupedByBranch, - $this->unsets - ); - } - - public function executableLinesGroupedByBranch(): array - { - return $this->executableLinesGroupedByBranch; - } - - private function setLineBranch(int $start, int $end, int $branch): void - { - foreach (range($start, $end) as $line) { - $this->executableLinesGroupedByBranch[$line] = $branch; - } - } -} diff --git a/vendor/phpunit/php-code-coverage/src/StaticAnalysis/FileAnalyser.php b/vendor/phpunit/php-code-coverage/src/StaticAnalysis/FileAnalyser.php deleted file mode 100644 index 3dbcf68f..00000000 --- a/vendor/phpunit/php-code-coverage/src/StaticAnalysis/FileAnalyser.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. - */ -namespace SebastianBergmann\CodeCoverage\StaticAnalysis; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -interface FileAnalyser -{ - public function classesIn(string $filename): array; - - public function traitsIn(string $filename): array; - - public function functionsIn(string $filename): array; - - /** - * @psalm-return array{linesOfCode: int, commentLinesOfCode: int, nonCommentLinesOfCode: int} - */ - public function linesOfCodeFor(string $filename): array; - - public function executableLinesIn(string $filename): array; - - public function ignoredLinesFor(string $filename): array; -} diff --git a/vendor/phpunit/php-code-coverage/src/StaticAnalysis/IgnoredLinesFindingVisitor.php b/vendor/phpunit/php-code-coverage/src/StaticAnalysis/IgnoredLinesFindingVisitor.php deleted file mode 100644 index 3c0b2373..00000000 --- a/vendor/phpunit/php-code-coverage/src/StaticAnalysis/IgnoredLinesFindingVisitor.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 SebastianBergmann\CodeCoverage\StaticAnalysis; - -use function array_merge; -use function assert; -use function range; -use function strpos; -use PhpParser\Node; -use PhpParser\Node\Attribute; -use PhpParser\Node\Stmt\Class_; -use PhpParser\Node\Stmt\ClassMethod; -use PhpParser\Node\Stmt\Function_; -use PhpParser\Node\Stmt\Interface_; -use PhpParser\Node\Stmt\Trait_; -use PhpParser\NodeVisitorAbstract; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -final class IgnoredLinesFindingVisitor extends NodeVisitorAbstract -{ - /** - * @psalm-var list - */ - private $ignoredLines = []; - - /** - * @var bool - */ - private $useAnnotationsForIgnoringCode; - - /** - * @var bool - */ - private $ignoreDeprecated; - - public function __construct(bool $useAnnotationsForIgnoringCode, bool $ignoreDeprecated) - { - $this->useAnnotationsForIgnoringCode = $useAnnotationsForIgnoringCode; - $this->ignoreDeprecated = $ignoreDeprecated; - } - - public function enterNode(Node $node): void - { - if (!$node instanceof Class_ && - !$node instanceof Trait_ && - !$node instanceof Interface_ && - !$node instanceof ClassMethod && - !$node instanceof Function_ && - !$node instanceof Attribute) { - return; - } - - if ($node instanceof Class_ && $node->isAnonymous()) { - return; - } - - if ($node instanceof Class_ || - $node instanceof Trait_ || - $node instanceof Interface_ || - $node instanceof Attribute) { - $this->ignoredLines[] = $node->getStartLine(); - - assert($node->name !== null); - - // Workaround for https://github.com/nikic/PHP-Parser/issues/886 - $this->ignoredLines[] = $node->name->getStartLine(); - } - - if (!$this->useAnnotationsForIgnoringCode) { - return; - } - - if ($node instanceof Interface_) { - return; - } - - $this->processDocComment($node); - } - - /** - * @psalm-return list - */ - public function ignoredLines(): array - { - return $this->ignoredLines; - } - - private function processDocComment(Node $node): void - { - $docComment = $node->getDocComment(); - - if ($docComment === null) { - return; - } - - if (strpos($docComment->getText(), '@codeCoverageIgnore') !== false) { - $this->ignoredLines = array_merge( - $this->ignoredLines, - range($node->getStartLine(), $node->getEndLine()) - ); - } - - if ($this->ignoreDeprecated && strpos($docComment->getText(), '@deprecated') !== false) { - $this->ignoredLines = array_merge( - $this->ignoredLines, - range($node->getStartLine(), $node->getEndLine()) - ); - } - } -} diff --git a/vendor/phpunit/php-code-coverage/src/StaticAnalysis/ParsingFileAnalyser.php b/vendor/phpunit/php-code-coverage/src/StaticAnalysis/ParsingFileAnalyser.php deleted file mode 100644 index e6863821..00000000 --- a/vendor/phpunit/php-code-coverage/src/StaticAnalysis/ParsingFileAnalyser.php +++ /dev/null @@ -1,253 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeCoverage\StaticAnalysis; - -use function array_merge; -use function array_unique; -use function assert; -use function file_get_contents; -use function is_array; -use function max; -use function range; -use function sort; -use function sprintf; -use function substr_count; -use function token_get_all; -use function trim; -use PhpParser\Error; -use PhpParser\Lexer; -use PhpParser\NodeTraverser; -use PhpParser\NodeVisitor\NameResolver; -use PhpParser\NodeVisitor\ParentConnectingVisitor; -use PhpParser\ParserFactory; -use SebastianBergmann\CodeCoverage\ParserException; -use SebastianBergmann\LinesOfCode\LineCountingVisitor; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -final class ParsingFileAnalyser implements FileAnalyser -{ - /** - * @var array - */ - private $classes = []; - - /** - * @var array - */ - private $traits = []; - - /** - * @var array - */ - private $functions = []; - - /** - * @var array - */ - private $linesOfCode = []; - - /** - * @var array - */ - private $ignoredLines = []; - - /** - * @var array - */ - private $executableLines = []; - - /** - * @var bool - */ - private $useAnnotationsForIgnoringCode; - - /** - * @var bool - */ - private $ignoreDeprecatedCode; - - public function __construct(bool $useAnnotationsForIgnoringCode, bool $ignoreDeprecatedCode) - { - $this->useAnnotationsForIgnoringCode = $useAnnotationsForIgnoringCode; - $this->ignoreDeprecatedCode = $ignoreDeprecatedCode; - } - - public function classesIn(string $filename): array - { - $this->analyse($filename); - - return $this->classes[$filename]; - } - - public function traitsIn(string $filename): array - { - $this->analyse($filename); - - return $this->traits[$filename]; - } - - public function functionsIn(string $filename): array - { - $this->analyse($filename); - - return $this->functions[$filename]; - } - - /** - * @psalm-return array{linesOfCode: int, commentLinesOfCode: int, nonCommentLinesOfCode: int} - */ - public function linesOfCodeFor(string $filename): array - { - $this->analyse($filename); - - return $this->linesOfCode[$filename]; - } - - public function executableLinesIn(string $filename): array - { - $this->analyse($filename); - - return $this->executableLines[$filename]; - } - - public function ignoredLinesFor(string $filename): array - { - $this->analyse($filename); - - return $this->ignoredLines[$filename]; - } - - /** - * @throws ParserException - */ - private function analyse(string $filename): void - { - if (isset($this->classes[$filename])) { - return; - } - - $source = file_get_contents($filename); - $linesOfCode = max(substr_count($source, "\n") + 1, substr_count($source, "\r") + 1); - - if ($linesOfCode === 0 && !empty($source)) { - $linesOfCode = 1; - } - - $parser = (new ParserFactory)->create( - ParserFactory::PREFER_PHP7, - new Lexer - ); - - try { - $nodes = $parser->parse($source); - - assert($nodes !== null); - - $traverser = new NodeTraverser; - $codeUnitFindingVisitor = new CodeUnitFindingVisitor; - $lineCountingVisitor = new LineCountingVisitor($linesOfCode); - $ignoredLinesFindingVisitor = new IgnoredLinesFindingVisitor($this->useAnnotationsForIgnoringCode, $this->ignoreDeprecatedCode); - $executableLinesFindingVisitor = new ExecutableLinesFindingVisitor($source); - - $traverser->addVisitor(new NameResolver); - $traverser->addVisitor(new ParentConnectingVisitor); - $traverser->addVisitor($codeUnitFindingVisitor); - $traverser->addVisitor($lineCountingVisitor); - $traverser->addVisitor($ignoredLinesFindingVisitor); - $traverser->addVisitor($executableLinesFindingVisitor); - - /* @noinspection UnusedFunctionResultInspection */ - $traverser->traverse($nodes); - // @codeCoverageIgnoreStart - } catch (Error $error) { - throw new ParserException( - sprintf( - 'Cannot parse %s: %s', - $filename, - $error->getMessage() - ), - $error->getCode(), - $error - ); - } - // @codeCoverageIgnoreEnd - - $this->classes[$filename] = $codeUnitFindingVisitor->classes(); - $this->traits[$filename] = $codeUnitFindingVisitor->traits(); - $this->functions[$filename] = $codeUnitFindingVisitor->functions(); - $this->executableLines[$filename] = $executableLinesFindingVisitor->executableLinesGroupedByBranch(); - $this->ignoredLines[$filename] = []; - - $this->findLinesIgnoredByLineBasedAnnotations($filename, $source, $this->useAnnotationsForIgnoringCode); - - $this->ignoredLines[$filename] = array_unique( - array_merge( - $this->ignoredLines[$filename], - $ignoredLinesFindingVisitor->ignoredLines() - ) - ); - - sort($this->ignoredLines[$filename]); - - $result = $lineCountingVisitor->result(); - - $this->linesOfCode[$filename] = [ - 'linesOfCode' => $result->linesOfCode(), - 'commentLinesOfCode' => $result->commentLinesOfCode(), - 'nonCommentLinesOfCode' => $result->nonCommentLinesOfCode(), - ]; - } - - private function findLinesIgnoredByLineBasedAnnotations(string $filename, string $source, bool $useAnnotationsForIgnoringCode): void - { - if (!$useAnnotationsForIgnoringCode) { - return; - } - - $start = false; - - foreach (token_get_all($source) as $token) { - if (!is_array($token) || - !(T_COMMENT === $token[0] || T_DOC_COMMENT === $token[0])) { - continue; - } - - $comment = trim($token[1]); - - if ($comment === '// @codeCoverageIgnore' || - $comment === '//@codeCoverageIgnore') { - $this->ignoredLines[$filename][] = $token[2]; - - continue; - } - - if ($comment === '// @codeCoverageIgnoreStart' || - $comment === '//@codeCoverageIgnoreStart') { - $start = $token[2]; - - continue; - } - - if ($comment === '// @codeCoverageIgnoreEnd' || - $comment === '//@codeCoverageIgnoreEnd') { - if (false === $start) { - $start = $token[2]; - } - - $this->ignoredLines[$filename] = array_merge( - $this->ignoredLines[$filename], - range($start, $token[2]) - ); - } - } - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Util/Filesystem.php b/vendor/phpunit/php-code-coverage/src/Util/Filesystem.php deleted file mode 100644 index ff0e16ae..00000000 --- a/vendor/phpunit/php-code-coverage/src/Util/Filesystem.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 SebastianBergmann\CodeCoverage\Util; - -use function is_dir; -use function mkdir; -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -final class Filesystem -{ - /** - * @throws DirectoryCouldNotBeCreatedException - */ - public static function createDirectory(string $directory): void - { - $success = !(!is_dir($directory) && !@mkdir($directory, 0777, true) && !is_dir($directory)); - - if (!$success) { - throw new DirectoryCouldNotBeCreatedException( - sprintf( - 'Directory "%s" could not be created', - $directory - ) - ); - } - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Util/Percentage.php b/vendor/phpunit/php-code-coverage/src/Util/Percentage.php deleted file mode 100644 index 0f7a3fec..00000000 --- a/vendor/phpunit/php-code-coverage/src/Util/Percentage.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 SebastianBergmann\CodeCoverage\Util; - -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage - */ -final class Percentage -{ - /** - * @var float - */ - private $fraction; - - /** - * @var float - */ - private $total; - - public static function fromFractionAndTotal(float $fraction, float $total): self - { - return new self($fraction, $total); - } - - private function __construct(float $fraction, float $total) - { - $this->fraction = $fraction; - $this->total = $total; - } - - public function asFloat(): float - { - if ($this->total > 0) { - return ($this->fraction / $this->total) * 100; - } - - return 100.0; - } - - public function asString(): string - { - if ($this->total > 0) { - return sprintf('%01.2F%%', $this->asFloat()); - } - - return ''; - } - - public function asFixedWidthString(): string - { - if ($this->total > 0) { - return sprintf('%6.2F%%', $this->asFloat()); - } - - return ''; - } -} diff --git a/vendor/phpunit/php-code-coverage/src/Version.php b/vendor/phpunit/php-code-coverage/src/Version.php deleted file mode 100644 index 9bec556f..00000000 --- a/vendor/phpunit/php-code-coverage/src/Version.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 SebastianBergmann\CodeCoverage; - -use function dirname; -use SebastianBergmann\Version as VersionId; - -final class Version -{ - /** - * @var string - */ - private static $version; - - public static function id(): string - { - if (self::$version === null) { - self::$version = (new VersionId('9.2.22', dirname(__DIR__)))->getVersion(); - } - - return self::$version; - } -} diff --git a/vendor/phpunit/php-file-iterator/.psalm/baseline.xml b/vendor/phpunit/php-file-iterator/.psalm/baseline.xml deleted file mode 100644 index 8b6cdc24..00000000 --- a/vendor/phpunit/php-file-iterator/.psalm/baseline.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - current - - - diff --git a/vendor/phpunit/php-file-iterator/.psalm/config.xml b/vendor/phpunit/php-file-iterator/.psalm/config.xml deleted file mode 100644 index 2a4b16f2..00000000 --- a/vendor/phpunit/php-file-iterator/.psalm/config.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - diff --git a/vendor/phpunit/php-file-iterator/ChangeLog.md b/vendor/phpunit/php-file-iterator/ChangeLog.md deleted file mode 100644 index 44833762..00000000 --- a/vendor/phpunit/php-file-iterator/ChangeLog.md +++ /dev/null @@ -1,144 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). - -## [3.0.6] - 2021-12-02 - -### Changed - -* [#73](https://github.com/sebastianbergmann/php-file-iterator/pull/73): Micro performance improvements on parsing paths - -## [3.0.5] - 2020-09-28 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.3 || ^8.0` to `>=7.3` - -## [3.0.4] - 2020-07-11 - -### Fixed - -* [#67](https://github.com/sebastianbergmann/php-file-iterator/issues/67): `TypeError` in `SebastianBergmann\FileIterator\Iterator::accept()` - -## [3.0.3] - 2020-06-26 - -### Added - -* This component is now supported on PHP 8 - -## [3.0.2] - 2020-06-15 - -### Changed - -* Tests etc. are now ignored for archive exports - -## [3.0.1] - 2020-04-18 - -### Fixed - -* [#64](https://github.com/sebastianbergmann/php-file-iterator/issues/64): Release tarball contains Composer PHAR - -## [3.0.0] - 2020-02-07 - -### Removed - -* This component is no longer supported on PHP 7.1 and PHP 7.2 - -## [2.0.5] - 2021-12-02 - -### Changed - -* [#73](https://github.com/sebastianbergmann/php-file-iterator/pull/73): Micro performance improvements on parsing paths - -### Fixed - -* [#74](https://github.com/sebastianbergmann/php-file-iterator/pull/74): Document return type of `SebastianBergmann\FileIterator\Iterator::accept()` so that Symfony's `DebugClassLoader` does not trigger a deprecation warning - -## [2.0.4] - 2021-07-19 - -### Changed - -* Added `ReturnTypeWillChange` attribute to `SebastianBergmann\FileIterator\Iterator::accept()` because the return type of `\FilterIterator::accept()` will change in PHP 8.1 - -## [2.0.3] - 2020-11-30 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.1` to `>=7.1` - -## [2.0.2] - 2018-09-13 - -### Fixed - -* [#48](https://github.com/sebastianbergmann/php-file-iterator/issues/48): Excluding an array that contains false ends up excluding the current working directory - -## [2.0.1] - 2018-06-11 - -### Fixed - -* [#46](https://github.com/sebastianbergmann/php-file-iterator/issues/46): Regression with hidden parent directory - -## [2.0.0] - 2018-05-28 - -### Fixed - -* [#30](https://github.com/sebastianbergmann/php-file-iterator/issues/30): Exclude is not considered if it is a parent of the base path - -### Changed - -* This component now uses namespaces - -### Removed - -* This component is no longer supported on PHP 5.3, PHP 5.4, PHP 5.5, PHP 5.6, and PHP 7.0 - -## [1.4.5] - 2017-11-27 - -### Fixed - -* [#37](https://github.com/sebastianbergmann/php-file-iterator/issues/37): Regression caused by fix for [#30](https://github.com/sebastianbergmann/php-file-iterator/issues/30) - -## [1.4.4] - 2017-11-27 - -### Fixed - -* [#30](https://github.com/sebastianbergmann/php-file-iterator/issues/30): Exclude is not considered if it is a parent of the base path - -## [1.4.3] - 2017-11-25 - -### Fixed - -* [#34](https://github.com/sebastianbergmann/php-file-iterator/issues/34): Factory should use canonical directory names - -## [1.4.2] - 2016-11-26 - -No changes - -## [1.4.1] - 2015-07-26 - -No changes - -## 1.4.0 - 2015-04-02 - -### Added - -* [#23](https://github.com/sebastianbergmann/php-file-iterator/pull/23): Added support for wildcards (glob) in exclude - -[3.0.6]: https://github.com/sebastianbergmann/php-file-iterator/compare/3.0.5...3.0.6 -[3.0.5]: https://github.com/sebastianbergmann/php-file-iterator/compare/3.0.4...3.0.5 -[3.0.4]: https://github.com/sebastianbergmann/php-file-iterator/compare/3.0.3...3.0.4 -[3.0.3]: https://github.com/sebastianbergmann/php-file-iterator/compare/3.0.2...3.0.3 -[3.0.2]: https://github.com/sebastianbergmann/php-file-iterator/compare/3.0.1...3.0.2 -[3.0.1]: https://github.com/sebastianbergmann/php-file-iterator/compare/3.0.0...3.0.1 -[3.0.0]: https://github.com/sebastianbergmann/php-file-iterator/compare/2.0.5...3.0.0 -[2.0.5]: https://github.com/sebastianbergmann/php-file-iterator/compare/2.0.4...2.0.5 -[2.0.4]: https://github.com/sebastianbergmann/php-file-iterator/compare/2.0.3...2.0.4 -[2.0.3]: https://github.com/sebastianbergmann/php-file-iterator/compare/2.0.2...2.0.3 -[2.0.2]: https://github.com/sebastianbergmann/php-file-iterator/compare/2.0.1...2.0.2 -[2.0.1]: https://github.com/sebastianbergmann/php-file-iterator/compare/2.0.0...2.0.1 -[2.0.0]: https://github.com/sebastianbergmann/php-file-iterator/compare/1.4.5...2.0.0 -[1.4.5]: https://github.com/sebastianbergmann/php-file-iterator/compare/1.4.4...1.4.5 -[1.4.4]: https://github.com/sebastianbergmann/php-file-iterator/compare/1.4.3...1.4.4 -[1.4.3]: https://github.com/sebastianbergmann/php-file-iterator/compare/1.4.2...1.4.3 -[1.4.2]: https://github.com/sebastianbergmann/php-file-iterator/compare/1.4.1...1.4.2 -[1.4.1]: https://github.com/sebastianbergmann/php-file-iterator/compare/1.4.0...1.4.1 diff --git a/vendor/phpunit/php-file-iterator/LICENSE b/vendor/phpunit/php-file-iterator/LICENSE deleted file mode 100644 index 51db9163..00000000 --- a/vendor/phpunit/php-file-iterator/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -php-file-iterator - -Copyright (c) 2009-2021, Sebastian Bergmann . -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 Sebastian Bergmann nor the names of his - 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/phpunit/php-file-iterator/README.md b/vendor/phpunit/php-file-iterator/README.md deleted file mode 100644 index 3cbfdaae..00000000 --- a/vendor/phpunit/php-file-iterator/README.md +++ /dev/null @@ -1,14 +0,0 @@ -[![Build Status](https://travis-ci.org/sebastianbergmann/php-file-iterator.svg?branch=master)](https://travis-ci.org/sebastianbergmann/php-file-iterator) - -# php-file-iterator - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - - composer require phpunit/php-file-iterator - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - - composer require --dev phpunit/php-file-iterator - diff --git a/vendor/phpunit/php-file-iterator/composer.json b/vendor/phpunit/php-file-iterator/composer.json deleted file mode 100644 index f1b95b3f..00000000 --- a/vendor/phpunit/php-file-iterator/composer.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "phpunit/php-file-iterator", - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "type": "library", - "keywords": [ - "iterator", - "filesystem" - ], - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues" - }, - "config": { - "platform": { - "php": "7.3.0" - }, - "optimize-autoloader": true, - "sort-packages": true - }, - "prefer-stable": true, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - } -} diff --git a/vendor/phpunit/php-file-iterator/src/Facade.php b/vendor/phpunit/php-file-iterator/src/Facade.php deleted file mode 100644 index 87b6588d..00000000 --- a/vendor/phpunit/php-file-iterator/src/Facade.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 SebastianBergmann\FileIterator; - -use const DIRECTORY_SEPARATOR; -use function array_unique; -use function count; -use function dirname; -use function explode; -use function is_file; -use function is_string; -use function realpath; -use function sort; - -class Facade -{ - /** - * @param array|string $paths - * @param array|string $suffixes - * @param array|string $prefixes - */ - public function getFilesAsArray($paths, $suffixes = '', $prefixes = '', array $exclude = [], bool $commonPath = false): array - { - if (is_string($paths)) { - $paths = [$paths]; - } - - $iterator = (new Factory)->getFileIterator($paths, $suffixes, $prefixes, $exclude); - - $files = []; - - foreach ($iterator as $file) { - $file = $file->getRealPath(); - - if ($file) { - $files[] = $file; - } - } - - foreach ($paths as $path) { - if (is_file($path)) { - $files[] = realpath($path); - } - } - - $files = array_unique($files); - sort($files); - - if ($commonPath) { - return [ - 'commonPath' => $this->getCommonPath($files), - 'files' => $files, - ]; - } - - return $files; - } - - protected function getCommonPath(array $files): string - { - $count = count($files); - - if ($count === 0) { - return ''; - } - - if ($count === 1) { - return dirname($files[0]) . DIRECTORY_SEPARATOR; - } - - $_files = []; - - foreach ($files as $file) { - $_files[] = $_fileParts = explode(DIRECTORY_SEPARATOR, $file); - - if (empty($_fileParts[0])) { - $_fileParts[0] = DIRECTORY_SEPARATOR; - } - } - - $common = ''; - $done = false; - $j = 0; - $count--; - - while (!$done) { - for ($i = 0; $i < $count; $i++) { - if ($_files[$i][$j] != $_files[$i + 1][$j]) { - $done = true; - - break; - } - } - - if (!$done) { - $common .= $_files[0][$j]; - - if ($j > 0) { - $common .= DIRECTORY_SEPARATOR; - } - } - - $j++; - } - - return DIRECTORY_SEPARATOR . $common; - } -} diff --git a/vendor/phpunit/php-file-iterator/src/Factory.php b/vendor/phpunit/php-file-iterator/src/Factory.php deleted file mode 100644 index 08f8de99..00000000 --- a/vendor/phpunit/php-file-iterator/src/Factory.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 SebastianBergmann\FileIterator; - -use const GLOB_ONLYDIR; -use function array_filter; -use function array_map; -use function array_merge; -use function glob; -use function is_dir; -use function is_string; -use function realpath; -use AppendIterator; -use RecursiveDirectoryIterator; -use RecursiveIteratorIterator; - -class Factory -{ - /** - * @param array|string $paths - * @param array|string $suffixes - * @param array|string $prefixes - */ - public function getFileIterator($paths, $suffixes = '', $prefixes = '', array $exclude = []): AppendIterator - { - if (is_string($paths)) { - $paths = [$paths]; - } - - $paths = $this->getPathsAfterResolvingWildcards($paths); - $exclude = $this->getPathsAfterResolvingWildcards($exclude); - - if (is_string($prefixes)) { - if ($prefixes !== '') { - $prefixes = [$prefixes]; - } else { - $prefixes = []; - } - } - - if (is_string($suffixes)) { - if ($suffixes !== '') { - $suffixes = [$suffixes]; - } else { - $suffixes = []; - } - } - - $iterator = new AppendIterator; - - foreach ($paths as $path) { - if (is_dir($path)) { - $iterator->append( - new Iterator( - $path, - new RecursiveIteratorIterator( - new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::FOLLOW_SYMLINKS | RecursiveDirectoryIterator::SKIP_DOTS) - ), - $suffixes, - $prefixes, - $exclude - ) - ); - } - } - - return $iterator; - } - - protected function getPathsAfterResolvingWildcards(array $paths): array - { - $_paths = [[]]; - - foreach ($paths as $path) { - if ($locals = glob($path, GLOB_ONLYDIR)) { - $_paths[] = array_map('\realpath', $locals); - } else { - $_paths[] = [realpath($path)]; - } - } - - return array_filter(array_merge(...$_paths)); - } -} diff --git a/vendor/phpunit/php-file-iterator/src/Iterator.php b/vendor/phpunit/php-file-iterator/src/Iterator.php deleted file mode 100644 index 7eb82ad6..00000000 --- a/vendor/phpunit/php-file-iterator/src/Iterator.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 SebastianBergmann\FileIterator; - -use function array_filter; -use function array_map; -use function preg_match; -use function realpath; -use function str_replace; -use function strlen; -use function strpos; -use function substr; -use FilterIterator; - -class Iterator extends FilterIterator -{ - public const PREFIX = 0; - - public const SUFFIX = 1; - - /** - * @var string - */ - private $basePath; - - /** - * @var array - */ - private $suffixes = []; - - /** - * @var array - */ - private $prefixes = []; - - /** - * @var array - */ - private $exclude = []; - - public function __construct(string $basePath, \Iterator $iterator, array $suffixes = [], array $prefixes = [], array $exclude = []) - { - $this->basePath = realpath($basePath); - $this->prefixes = $prefixes; - $this->suffixes = $suffixes; - $this->exclude = array_filter(array_map('realpath', $exclude)); - - parent::__construct($iterator); - } - - public function accept(): bool - { - $current = $this->getInnerIterator()->current(); - $filename = $current->getFilename(); - $realPath = $current->getRealPath(); - - if ($realPath === false) { - return false; - } - - return $this->acceptPath($realPath) && - $this->acceptPrefix($filename) && - $this->acceptSuffix($filename); - } - - private function acceptPath(string $path): bool - { - // Filter files in hidden directories by checking path that is relative to the base path. - if (preg_match('=/\.[^/]*/=', str_replace($this->basePath, '', $path))) { - return false; - } - - foreach ($this->exclude as $exclude) { - if (strpos($path, $exclude) === 0) { - return false; - } - } - - return true; - } - - private function acceptPrefix(string $filename): bool - { - return $this->acceptSubString($filename, $this->prefixes, self::PREFIX); - } - - private function acceptSuffix(string $filename): bool - { - return $this->acceptSubString($filename, $this->suffixes, self::SUFFIX); - } - - private function acceptSubString(string $filename, array $subStrings, int $type): bool - { - if (empty($subStrings)) { - return true; - } - - $matched = false; - - foreach ($subStrings as $string) { - if (($type === self::PREFIX && strpos($filename, $string) === 0) || - ($type === self::SUFFIX && - substr($filename, -1 * strlen($string)) === $string)) { - $matched = true; - - break; - } - } - - return $matched; - } -} diff --git a/vendor/phpunit/php-invoker/ChangeLog.md b/vendor/phpunit/php-invoker/ChangeLog.md deleted file mode 100644 index 15cff1f1..00000000 --- a/vendor/phpunit/php-invoker/ChangeLog.md +++ /dev/null @@ -1,48 +0,0 @@ -# ChangeLog - -All notable changes are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. - -## [3.1.1] - 2020-09-28 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.3 || ^8.0` to `>=7.3` - -## [3.1.0] - 2020-08-06 - -### Changed - -* [#14](https://github.com/sebastianbergmann/php-invoker/pull/14): Clear alarm in `finally` block - -## [3.0.2] - 2020-06-26 - -### Added - -* This component is now supported on PHP 8 - -## [3.0.1] - 2020-06-15 - -### Changed - -* Tests etc. are now ignored for archive exports - -## [3.0.0] - 2020-02-07 - -### Added - -* Added `canInvokeWithTimeout()` method to check requirements for the functionality provided by this component to work - -### Changed - -* Moved `"ext-pcntl": "*"` requirement from `require` to `suggest` so that this component can be installed even if `ext/pcntl` is not available -* `invoke()` now raises an exception when the requirements for the functionality provided by this component to work are not met - -### Removed - -* This component is no longer supported on PHP 7.1 and PHP 7.2 - -[3.1.1]: https://github.com/sebastianbergmann/php-invoker/compare/3.1.0...3.1.1 -[3.1.0]: https://github.com/sebastianbergmann/php-invoker/compare/3.0.2...3.1.0 -[3.0.2]: https://github.com/sebastianbergmann/php-invoker/compare/3.0.1...3.0.2 -[3.0.1]: https://github.com/sebastianbergmann/php-invoker/compare/3.0.0...3.0.1 -[3.0.0]: https://github.com/sebastianbergmann/php-invoker/compare/2.0.0...3.0.0 diff --git a/vendor/phpunit/php-invoker/LICENSE b/vendor/phpunit/php-invoker/LICENSE deleted file mode 100644 index 4620776e..00000000 --- a/vendor/phpunit/php-invoker/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -php-invoker - -Copyright (c) 2011-2020, Sebastian Bergmann . -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 Sebastian Bergmann nor the names of his - 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/phpunit/php-invoker/README.md b/vendor/phpunit/php-invoker/README.md deleted file mode 100644 index ace07e5f..00000000 --- a/vendor/phpunit/php-invoker/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# phpunit/php-invoker - -[![CI Status](https://github.com/sebastianbergmann/php-invoker/workflows/CI/badge.svg)](https://github.com/sebastianbergmann/php-invoker/actions) -[![Type Coverage](https://shepherd.dev/github/sebastianbergmann/php-invoker/coverage.svg)](https://shepherd.dev/github/sebastianbergmann/php-invoker) - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - -``` -composer require phpunit/php-invoker -``` - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - -``` -composer require --dev phpunit/php-invoker -``` diff --git a/vendor/phpunit/php-invoker/composer.json b/vendor/phpunit/php-invoker/composer.json deleted file mode 100644 index 6c007cd8..00000000 --- a/vendor/phpunit/php-invoker/composer.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "phpunit/php-invoker", - "description": "Invoke callables with a timeout", - "type": "library", - "keywords": [ - "process" - ], - "homepage": "https://github.com/sebastianbergmann/php-invoker/", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-invoker/issues" - }, - "prefer-stable": true, - "config": { - "platform": { - "php": "7.3.0" - }, - "optimize-autoloader": true, - "sort-packages": true - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "ext-pcntl": "*", - "phpunit/phpunit": "^9.3" - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "autoload-dev": { - "classmap": [ - "tests/_fixture/" - ] - }, - "suggest": { - "ext-pcntl": "*" - }, - "extra": { - "branch-alias": { - "dev-master": "3.1-dev" - } - } -} - diff --git a/vendor/phpunit/php-invoker/src/Invoker.php b/vendor/phpunit/php-invoker/src/Invoker.php deleted file mode 100644 index 656f4180..00000000 --- a/vendor/phpunit/php-invoker/src/Invoker.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 SebastianBergmann\Invoker; - -use const SIGALRM; -use function call_user_func_array; -use function function_exists; -use function pcntl_alarm; -use function pcntl_async_signals; -use function pcntl_signal; -use function sprintf; -use Throwable; - -final class Invoker -{ - /** - * @var int - */ - private $timeout; - - /** - * @throws Throwable - */ - public function invoke(callable $callable, array $arguments, int $timeout) - { - if (!$this->canInvokeWithTimeout()) { - throw new ProcessControlExtensionNotLoadedException( - 'The pcntl (process control) extension for PHP is required' - ); - } - - pcntl_signal( - SIGALRM, - function (): void { - throw new TimeoutException( - sprintf( - 'Execution aborted after %d second%s', - $this->timeout, - $this->timeout === 1 ? '' : 's' - ) - ); - }, - true - ); - - $this->timeout = $timeout; - - pcntl_async_signals(true); - pcntl_alarm($timeout); - - try { - return call_user_func_array($callable, $arguments); - } finally { - pcntl_alarm(0); - } - } - - public function canInvokeWithTimeout(): bool - { - return function_exists('pcntl_signal') && function_exists('pcntl_async_signals') && function_exists('pcntl_alarm'); - } -} diff --git a/vendor/phpunit/php-invoker/src/exceptions/Exception.php b/vendor/phpunit/php-invoker/src/exceptions/Exception.php deleted file mode 100644 index 6ecbf5dd..00000000 --- a/vendor/phpunit/php-invoker/src/exceptions/Exception.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. - */ -namespace SebastianBergmann\Invoker; - -use Throwable; - -interface Exception extends Throwable -{ -} diff --git a/vendor/phpunit/php-invoker/src/exceptions/ProcessControlExtensionNotLoadedException.php b/vendor/phpunit/php-invoker/src/exceptions/ProcessControlExtensionNotLoadedException.php deleted file mode 100644 index ef42fd19..00000000 --- a/vendor/phpunit/php-invoker/src/exceptions/ProcessControlExtensionNotLoadedException.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. - */ -namespace SebastianBergmann\Invoker; - -use RuntimeException; - -final class ProcessControlExtensionNotLoadedException extends RuntimeException implements Exception -{ -} diff --git a/vendor/phpunit/php-invoker/src/exceptions/TimeoutException.php b/vendor/phpunit/php-invoker/src/exceptions/TimeoutException.php deleted file mode 100644 index 2f7631c0..00000000 --- a/vendor/phpunit/php-invoker/src/exceptions/TimeoutException.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. - */ -namespace SebastianBergmann\Invoker; - -use RuntimeException; - -final class TimeoutException extends RuntimeException implements Exception -{ -} diff --git a/vendor/phpunit/php-text-template/.psalm/baseline.xml b/vendor/phpunit/php-text-template/.psalm/baseline.xml deleted file mode 100644 index 77e688e0..00000000 --- a/vendor/phpunit/php-text-template/.psalm/baseline.xml +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/vendor/phpunit/php-text-template/.psalm/config.xml b/vendor/phpunit/php-text-template/.psalm/config.xml deleted file mode 100644 index 2a4b16f2..00000000 --- a/vendor/phpunit/php-text-template/.psalm/config.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - diff --git a/vendor/phpunit/php-text-template/ChangeLog.md b/vendor/phpunit/php-text-template/ChangeLog.md deleted file mode 100644 index 32a48a7a..00000000 --- a/vendor/phpunit/php-text-template/ChangeLog.md +++ /dev/null @@ -1,43 +0,0 @@ -# ChangeLog - -All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. - -## [2.0.4] - 2020-10-26 - -### Fixed - -* `SebastianBergmann\Template\Exception` now correctly extends `\Throwable` - -## [2.0.3] - 2020-09-28 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.3 || ^8.0` to `>=7.3` - -## [2.0.2] - 2020-06-26 - -### Added - -* This component is now supported on PHP 8 - -## [2.0.1] - 2020-06-15 - -### Changed - -* Tests etc. are now ignored for archive exports - -## [2.0.0] - 2020-02-07 - -### Changed - -* The `Text_Template` class was renamed to `SebastianBergmann\Template\Template` - -### Removed - -* Removed support for PHP 5.3, PHP 5.4, PHP 5.5, PHP 5.6, PHP 7.0, PHP 7.1, and PHP 7.2 - -[2.0.4]: https://github.com/sebastianbergmann/php-text-template/compare/2.0.3...2.0.4 -[2.0.3]: https://github.com/sebastianbergmann/php-text-template/compare/2.0.2...2.0.3 -[2.0.2]: https://github.com/sebastianbergmann/php-text-template/compare/2.0.1...2.0.2 -[2.0.1]: https://github.com/sebastianbergmann/php-text-template/compare/2.0.0...2.0.1 -[2.0.0]: https://github.com/sebastianbergmann/php-text-template/compare/1.2.1...2.0.0 diff --git a/vendor/phpunit/php-text-template/LICENSE b/vendor/phpunit/php-text-template/LICENSE deleted file mode 100644 index 6db5566c..00000000 --- a/vendor/phpunit/php-text-template/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -phpunit/php-text-template - -Copyright (c) 2009-2020, Sebastian Bergmann . -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 Sebastian Bergmann nor the names of his - 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/phpunit/php-text-template/README.md b/vendor/phpunit/php-text-template/README.md deleted file mode 100644 index b2865935..00000000 --- a/vendor/phpunit/php-text-template/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# Text_Template - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - - composer require phpunit/php-text-template - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - - composer require --dev phpunit/php-text-template - diff --git a/vendor/phpunit/php-text-template/composer.json b/vendor/phpunit/php-text-template/composer.json deleted file mode 100644 index a51b34b9..00000000 --- a/vendor/phpunit/php-text-template/composer.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "phpunit/php-text-template", - "description": "Simple template engine.", - "type": "library", - "keywords": [ - "template" - ], - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues" - }, - "config": { - "platform": { - "php": "7.3.0" - }, - "optimize-autoloader": true, - "sort-packages": true - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - } -} diff --git a/vendor/phpunit/php-text-template/src/Template.php b/vendor/phpunit/php-text-template/src/Template.php deleted file mode 100644 index 25e29ea9..00000000 --- a/vendor/phpunit/php-text-template/src/Template.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 SebastianBergmann\Template; - -use function array_merge; -use function file_exists; -use function file_get_contents; -use function file_put_contents; -use function sprintf; -use function str_replace; - -final class Template -{ - /** - * @var string - */ - private $template = ''; - - /** - * @var string - */ - private $openDelimiter; - - /** - * @var string - */ - private $closeDelimiter; - - /** - * @var array - */ - private $values = []; - - /** - * @throws InvalidArgumentException - */ - public function __construct(string $file = '', string $openDelimiter = '{', string $closeDelimiter = '}') - { - $this->setFile($file); - - $this->openDelimiter = $openDelimiter; - $this->closeDelimiter = $closeDelimiter; - } - - /** - * @throws InvalidArgumentException - */ - public function setFile(string $file): void - { - $distFile = $file . '.dist'; - - if (file_exists($file)) { - $this->template = file_get_contents($file); - } elseif (file_exists($distFile)) { - $this->template = file_get_contents($distFile); - } else { - throw new InvalidArgumentException( - sprintf( - 'Failed to load template "%s"', - $file - ) - ); - } - } - - public function setVar(array $values, bool $merge = true): void - { - if (!$merge || empty($this->values)) { - $this->values = $values; - } else { - $this->values = array_merge($this->values, $values); - } - } - - public function render(): string - { - $keys = []; - - foreach ($this->values as $key => $value) { - $keys[] = $this->openDelimiter . $key . $this->closeDelimiter; - } - - return str_replace($keys, $this->values, $this->template); - } - - /** - * @codeCoverageIgnore - */ - public function renderTo(string $target): void - { - if (!file_put_contents($target, $this->render())) { - throw new RuntimeException( - sprintf( - 'Writing rendered result to "%s" failed', - $target - ) - ); - } - } -} diff --git a/vendor/phpunit/php-text-template/src/exceptions/Exception.php b/vendor/phpunit/php-text-template/src/exceptions/Exception.php deleted file mode 100644 index d7dc5cbe..00000000 --- a/vendor/phpunit/php-text-template/src/exceptions/Exception.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. - */ -namespace SebastianBergmann\Template; - -use Throwable; - -interface Exception extends Throwable -{ -} diff --git a/vendor/phpunit/php-text-template/src/exceptions/InvalidArgumentException.php b/vendor/phpunit/php-text-template/src/exceptions/InvalidArgumentException.php deleted file mode 100644 index 10e1cd11..00000000 --- a/vendor/phpunit/php-text-template/src/exceptions/InvalidArgumentException.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Template; - -final class InvalidArgumentException extends \InvalidArgumentException implements Exception -{ -} diff --git a/vendor/phpunit/php-text-template/src/exceptions/RuntimeException.php b/vendor/phpunit/php-text-template/src/exceptions/RuntimeException.php deleted file mode 100644 index 131498e6..00000000 --- a/vendor/phpunit/php-text-template/src/exceptions/RuntimeException.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. - */ -namespace SebastianBergmann\Template; - -use InvalidArgumentException; - -final class RuntimeException extends InvalidArgumentException implements Exception -{ -} diff --git a/vendor/phpunit/php-timer/.psalm/baseline.xml b/vendor/phpunit/php-timer/.psalm/baseline.xml deleted file mode 100644 index 77e688e0..00000000 --- a/vendor/phpunit/php-timer/.psalm/baseline.xml +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/vendor/phpunit/php-timer/.psalm/config.xml b/vendor/phpunit/php-timer/.psalm/config.xml deleted file mode 100644 index 15abef05..00000000 --- a/vendor/phpunit/php-timer/.psalm/config.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - diff --git a/vendor/phpunit/php-timer/ChangeLog.md b/vendor/phpunit/php-timer/ChangeLog.md deleted file mode 100644 index 34ef7d1d..00000000 --- a/vendor/phpunit/php-timer/ChangeLog.md +++ /dev/null @@ -1,138 +0,0 @@ -# ChangeLog - -All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. - -## [5.0.3] - 2020-10-26 - -### Fixed - -* `SebastianBergmann\Timer\Exception` now correctly extends `\Throwable` - -## [5.0.2] - 2020-09-28 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.3 || ^8.0` to `>=7.3` - -## [5.0.1] - 2020-06-26 - -### Added - -* This component is now supported on PHP 8 - -## [5.0.0] - 2020-06-07 - -### Changed - -* Parameter type for `SebastianBergmann\Timer\Duration::fromMicroseconds()` was changed from `int` to `float` -* Parameter type for `SebastianBergmann\Timer\Duration::fromNanoseconds()` was changed from `int` to `float` -* Return type for `SebastianBergmann\Timer\Duration::asNanoseconds()` was changed from `int` to `float` - -### Fixed - -* [#31](https://github.com/sebastianbergmann/php-timer/issues/31): Type Error on 32-bit systems (where `hrtime()` returns `float` instead of `int`) - -## [4.0.0] - 2020-06-01 - -### Added - -* Introduced `Duration` value object for encapsulating a duration with nanosecond granularity -* Introduced `ResourceUsageFormatter` object for formatting resource usage with option to explicitly pass a duration (instead of looking at the unreliable `$_SERVER['REQUEST_TIME_FLOAT']` variable) - -### Changed - -* The methods of `Timer` are no longer static -* `Timer::stop()` now returns a `Duration` value object - -### Removed - -* Functionality that is now implemented in `Duration` and `ResourceUsageFormatter` has been removed from `Timer` - -## [3.1.4] - 2020-04-20 - -### Changed - -* `Timer::timeSinceStartOfRequest()` no longer tries `$_SERVER['REQUEST_TIME']` when `$_SERVER['REQUEST_TIME_FLOAT']` is not available (`$_SERVER['REQUEST_TIME_FLOAT']` was added in PHP 5.4 and this library requires PHP 7.3) -* Improved exception messages when `$_SERVER['REQUEST_TIME_FLOAT']` is not set or is not of type `float` - -### Changed - -## [3.1.3] - 2020-04-20 - -### Changed - -* `Timer::timeSinceStartOfRequest()` now raises an exception if `$_SERVER['REQUEST_TIME_FLOAT']` does not contain a `float` (or `$_SERVER['REQUEST_TIME']` does not contain an `int`) - -## [3.1.2] - 2020-04-17 - -### Changed - -* Improved the fix for [#30](https://github.com/sebastianbergmann/php-timer/issues/30) and restored usage of `hrtime()` - -## [3.1.1] - 2020-04-17 - -### Fixed - -* [#30](https://github.com/sebastianbergmann/php-timer/issues/30): Resolution of time returned by `Timer::stop()` is different than before (this reverts using `hrtime()` instead of `microtime()`) - -## [3.1.0] - 2020-04-17 - -### Added - -* `Timer::secondsToShortTimeString()` as alternative to `Timer::secondsToTimeString()` - -### Changed - -* `Timer::start()` and `Timer::stop()` now use `hrtime()` (high resolution monotonic timer) instead of `microtime()` -* `Timer::timeSinceStartOfRequest()` now uses `Timer::secondsToShortTimeString()` for time formatting -* Improved formatting of `Timer::secondsToTimeString()` result - -## [3.0.0] - 2020-02-07 - -### Removed - -* This component is no longer supported on PHP 7.1 and PHP 7.2 - -## [2.1.2] - 2019-06-07 - -### Fixed - -* [#21](https://github.com/sebastianbergmann/php-timer/pull/21): Formatting of memory consumption does not work on 32bit systems - -## [2.1.1] - 2019-02-20 - -### Changed - -* Improved formatting of memory consumption for `resourceUsage()` - -## [2.1.0] - 2019-02-20 - -### Changed - -* Improved formatting of memory consumption for `resourceUsage()` - -## [2.0.0] - 2018-02-01 - -### Changed - -* This component now uses namespaces - -### Removed - -* This component is no longer supported on PHP 5.3, PHP 5.4, PHP 5.5, PHP 5.6, and PHP 7.0 - -[5.0.3]: https://github.com/sebastianbergmann/php-timer/compare/5.0.2...5.0.3 -[5.0.2]: https://github.com/sebastianbergmann/php-timer/compare/5.0.1...5.0.2 -[5.0.1]: https://github.com/sebastianbergmann/php-timer/compare/5.0.0...5.0.1 -[5.0.0]: https://github.com/sebastianbergmann/php-timer/compare/4.0.0...5.0.0 -[4.0.0]: https://github.com/sebastianbergmann/php-timer/compare/3.1.4...4.0.0 -[3.1.4]: https://github.com/sebastianbergmann/php-timer/compare/3.1.3...3.1.4 -[3.1.3]: https://github.com/sebastianbergmann/php-timer/compare/3.1.2...3.1.3 -[3.1.2]: https://github.com/sebastianbergmann/php-timer/compare/3.1.1...3.1.2 -[3.1.1]: https://github.com/sebastianbergmann/php-timer/compare/3.1.0...3.1.1 -[3.1.0]: https://github.com/sebastianbergmann/php-timer/compare/3.0.0...3.1.0 -[3.0.0]: https://github.com/sebastianbergmann/php-timer/compare/2.1.2...3.0.0 -[2.1.2]: https://github.com/sebastianbergmann/php-timer/compare/2.1.1...2.1.2 -[2.1.1]: https://github.com/sebastianbergmann/php-timer/compare/2.1.0...2.1.1 -[2.1.0]: https://github.com/sebastianbergmann/php-timer/compare/2.0.0...2.1.0 -[2.0.0]: https://github.com/sebastianbergmann/php-timer/compare/1.0.9...2.0.0 diff --git a/vendor/phpunit/php-timer/LICENSE b/vendor/phpunit/php-timer/LICENSE deleted file mode 100644 index 4193d8ae..00000000 --- a/vendor/phpunit/php-timer/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -phpunit/php-timer - -Copyright (c) 2010-2020, Sebastian Bergmann . -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 Sebastian Bergmann nor the names of his - 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/phpunit/php-timer/README.md b/vendor/phpunit/php-timer/README.md deleted file mode 100644 index a7d1e70d..00000000 --- a/vendor/phpunit/php-timer/README.md +++ /dev/null @@ -1,104 +0,0 @@ -# phpunit/php-timer - -[![CI Status](https://github.com/sebastianbergmann/php-timer/workflows/CI/badge.svg)](https://github.com/sebastianbergmann/php-timer/actions) -[![Type Coverage](https://shepherd.dev/github/sebastianbergmann/php-timer/coverage.svg)](https://shepherd.dev/github/sebastianbergmann/php-timer) - -Utility class for timing things, factored out of PHPUnit into a stand-alone component. - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - -``` -composer require phpunit/php-timer -``` - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - -``` -composer require --dev phpunit/php-timer -``` - -## Usage - -### Basic Timing - -```php -require __DIR__ . '/vendor/autoload.php'; - -use SebastianBergmann\Timer\Timer; - -$timer = new Timer; - -$timer->start(); - -foreach (\range(0, 100000) as $i) { - // ... -} - -$duration = $timer->stop(); - -var_dump(get_class($duration)); -var_dump($duration->asString()); -var_dump($duration->asSeconds()); -var_dump($duration->asMilliseconds()); -var_dump($duration->asMicroseconds()); -var_dump($duration->asNanoseconds()); -``` - -The code above yields the output below: - -``` -string(32) "SebastianBergmann\Timer\Duration" -string(9) "00:00.002" -float(0.002851062) -float(2.851062) -float(2851.062) -int(2851062) -``` - -### Resource Consumption - -#### Explicit duration - -```php -require __DIR__ . '/vendor/autoload.php'; - -use SebastianBergmann\Timer\ResourceUsageFormatter; -use SebastianBergmann\Timer\Timer; - -$timer = new Timer; -$timer->start(); - -foreach (\range(0, 100000) as $i) { - // ... -} - -print (new ResourceUsageFormatter)->resourceUsage($timer->stop()); -``` - -The code above yields the output below: - -``` -Time: 00:00.002, Memory: 6.00 MB -``` - -#### Duration since PHP Startup (using unreliable `$_SERVER['REQUEST_TIME_FLOAT']`) - -```php -require __DIR__ . '/vendor/autoload.php'; - -use SebastianBergmann\Timer\ResourceUsageFormatter; - -foreach (\range(0, 100000) as $i) { - // ... -} - -print (new ResourceUsageFormatter)->resourceUsageSinceStartOfRequest(); -``` - -The code above yields the output below: - -``` -Time: 00:00.002, Memory: 6.00 MB -``` diff --git a/vendor/phpunit/php-timer/composer.json b/vendor/phpunit/php-timer/composer.json deleted file mode 100644 index 001701c2..00000000 --- a/vendor/phpunit/php-timer/composer.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "phpunit/php-timer", - "description": "Utility class for timing", - "type": "library", - "keywords": [ - "timer" - ], - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-timer/issues" - }, - "prefer-stable": true, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "config": { - "platform": { - "php": "7.3.0" - }, - "optimize-autoloader": true, - "sort-packages": true - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - } -} - diff --git a/vendor/phpunit/php-timer/src/Duration.php b/vendor/phpunit/php-timer/src/Duration.php deleted file mode 100644 index e52bf018..00000000 --- a/vendor/phpunit/php-timer/src/Duration.php +++ /dev/null @@ -1,109 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Timer; - -use function floor; -use function sprintf; - -/** - * @psalm-immutable - */ -final class Duration -{ - /** - * @var float - */ - private $nanoseconds; - - /** - * @var int - */ - private $hours; - - /** - * @var int - */ - private $minutes; - - /** - * @var int - */ - private $seconds; - - /** - * @var int - */ - private $milliseconds; - - public static function fromMicroseconds(float $microseconds): self - { - return new self($microseconds * 1000); - } - - public static function fromNanoseconds(float $nanoseconds): self - { - return new self($nanoseconds); - } - - private function __construct(float $nanoseconds) - { - $this->nanoseconds = $nanoseconds; - $timeInMilliseconds = $nanoseconds / 1000000; - $hours = floor($timeInMilliseconds / 60 / 60 / 1000); - $hoursInMilliseconds = $hours * 60 * 60 * 1000; - $minutes = floor($timeInMilliseconds / 60 / 1000) % 60; - $minutesInMilliseconds = $minutes * 60 * 1000; - $seconds = floor(($timeInMilliseconds - $hoursInMilliseconds - $minutesInMilliseconds) / 1000); - $secondsInMilliseconds = $seconds * 1000; - $milliseconds = $timeInMilliseconds - $hoursInMilliseconds - $minutesInMilliseconds - $secondsInMilliseconds; - $this->hours = (int) $hours; - $this->minutes = $minutes; - $this->seconds = (int) $seconds; - $this->milliseconds = (int) $milliseconds; - } - - public function asNanoseconds(): float - { - return $this->nanoseconds; - } - - public function asMicroseconds(): float - { - return $this->nanoseconds / 1000; - } - - public function asMilliseconds(): float - { - return $this->nanoseconds / 1000000; - } - - public function asSeconds(): float - { - return $this->nanoseconds / 1000000000; - } - - public function asString(): string - { - $result = ''; - - if ($this->hours > 0) { - $result = sprintf('%02d', $this->hours) . ':'; - } - - $result .= sprintf('%02d', $this->minutes) . ':'; - $result .= sprintf('%02d', $this->seconds); - - if ($this->milliseconds > 0) { - $result .= '.' . sprintf('%03d', $this->milliseconds); - } - - return $result; - } -} diff --git a/vendor/phpunit/php-timer/src/ResourceUsageFormatter.php b/vendor/phpunit/php-timer/src/ResourceUsageFormatter.php deleted file mode 100644 index ad792627..00000000 --- a/vendor/phpunit/php-timer/src/ResourceUsageFormatter.php +++ /dev/null @@ -1,73 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Timer; - -use function is_float; -use function memory_get_peak_usage; -use function microtime; -use function sprintf; - -final class ResourceUsageFormatter -{ - /** - * @psalm-var array - */ - private const SIZES = [ - 'GB' => 1073741824, - 'MB' => 1048576, - 'KB' => 1024, - ]; - - public function resourceUsage(Duration $duration): string - { - return sprintf( - 'Time: %s, Memory: %s', - $duration->asString(), - $this->bytesToString(memory_get_peak_usage(true)) - ); - } - - /** - * @throws TimeSinceStartOfRequestNotAvailableException - */ - public function resourceUsageSinceStartOfRequest(): string - { - if (!isset($_SERVER['REQUEST_TIME_FLOAT'])) { - throw new TimeSinceStartOfRequestNotAvailableException( - 'Cannot determine time at which the request started because $_SERVER[\'REQUEST_TIME_FLOAT\'] is not available' - ); - } - - if (!is_float($_SERVER['REQUEST_TIME_FLOAT'])) { - throw new TimeSinceStartOfRequestNotAvailableException( - 'Cannot determine time at which the request started because $_SERVER[\'REQUEST_TIME_FLOAT\'] is not of type float' - ); - } - - return $this->resourceUsage( - Duration::fromMicroseconds( - (1000000 * (microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'])) - ) - ); - } - - private function bytesToString(int $bytes): string - { - foreach (self::SIZES as $unit => $value) { - if ($bytes >= $value) { - return sprintf('%.2f %s', $bytes >= 1024 ? $bytes / $value : $bytes, $unit); - } - } - - // @codeCoverageIgnoreStart - return $bytes . ' byte' . ($bytes !== 1 ? 's' : ''); - // @codeCoverageIgnoreEnd - } -} diff --git a/vendor/phpunit/php-timer/src/Timer.php b/vendor/phpunit/php-timer/src/Timer.php deleted file mode 100644 index 0917109b..00000000 --- a/vendor/phpunit/php-timer/src/Timer.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Timer; - -use function array_pop; -use function hrtime; - -final class Timer -{ - /** - * @psalm-var list - */ - private $startTimes = []; - - public function start(): void - { - $this->startTimes[] = (float) hrtime(true); - } - - /** - * @throws NoActiveTimerException - */ - public function stop(): Duration - { - if (empty($this->startTimes)) { - throw new NoActiveTimerException( - 'Timer::start() has to be called before Timer::stop()' - ); - } - - return Duration::fromNanoseconds((float) hrtime(true) - array_pop($this->startTimes)); - } -} diff --git a/vendor/phpunit/php-timer/src/exceptions/Exception.php b/vendor/phpunit/php-timer/src/exceptions/Exception.php deleted file mode 100644 index 996da086..00000000 --- a/vendor/phpunit/php-timer/src/exceptions/Exception.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. - */ -namespace SebastianBergmann\Timer; - -use Throwable; - -interface Exception extends Throwable -{ -} diff --git a/vendor/phpunit/php-timer/src/exceptions/NoActiveTimerException.php b/vendor/phpunit/php-timer/src/exceptions/NoActiveTimerException.php deleted file mode 100644 index 40fe45e8..00000000 --- a/vendor/phpunit/php-timer/src/exceptions/NoActiveTimerException.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. - */ -namespace SebastianBergmann\Timer; - -use LogicException; - -final class NoActiveTimerException extends LogicException implements Exception -{ -} diff --git a/vendor/phpunit/php-timer/src/exceptions/TimeSinceStartOfRequestNotAvailableException.php b/vendor/phpunit/php-timer/src/exceptions/TimeSinceStartOfRequestNotAvailableException.php deleted file mode 100644 index a2d94ce8..00000000 --- a/vendor/phpunit/php-timer/src/exceptions/TimeSinceStartOfRequestNotAvailableException.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. - */ -namespace SebastianBergmann\Timer; - -use RuntimeException; - -final class TimeSinceStartOfRequestNotAvailableException extends RuntimeException implements Exception -{ -} diff --git a/vendor/phpunit/phpunit/.phpstorm.meta.php b/vendor/phpunit/phpunit/.phpstorm.meta.php deleted file mode 100644 index b69ff789..00000000 --- a/vendor/phpunit/phpunit/.phpstorm.meta.php +++ /dev/null @@ -1,33 +0,0 @@ -"$0"]) - ); - - override( - \PHPUnit\Framework\TestCase::createStub(0), - map([""=>"$0"]) - ); - - override( - \PHPUnit\Framework\TestCase::createConfiguredMock(0), - map([""=>"$0"]) - ); - - override( - \PHPUnit\Framework\TestCase::createPartialMock(0), - map([""=>"$0"]) - ); - - override( - \PHPUnit\Framework\TestCase::createTestProxy(0), - map([""=>"$0"]) - ); - - override( - \PHPUnit\Framework\TestCase::getMockForAbstractClass(0), - map([""=>"$0"]) - ); -} diff --git a/vendor/phpunit/phpunit/ChangeLog-8.5.md b/vendor/phpunit/phpunit/ChangeLog-8.5.md deleted file mode 100644 index 9d0f4a1f..00000000 --- a/vendor/phpunit/phpunit/ChangeLog-8.5.md +++ /dev/null @@ -1,290 +0,0 @@ -# Changes in PHPUnit 8.5 - -All notable changes of the PHPUnit 8.5 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. - -## [8.5.31] - 2022-10-28 - -### Fixed - -* [#5076](https://github.com/sebastianbergmann/phpunit/issues/5076): Test Runner does not warn about conflicting options - -## [8.5.30] - 2022-09-25 - -### Changed - -* The configuration generator now asks for a cache directory - -### Fixed - -* [#4913](https://github.com/sebastianbergmann/phpunit/issues/4913): Failed `assert()` should show a backtrace -* [#4966](https://github.com/sebastianbergmann/phpunit/issues/4966): `TestCase::assertSame()` (and related exact comparisons) must compare `float` exactly - -## [8.5.29] - 2022-08-22 - -### Changed - -* [#5033](https://github.com/sebastianbergmann/phpunit/issues/5033): Do not depend on phpspec/prophecy - -## [8.5.28] - 2022-07-29 - -### Fixed - -* [#5015](https://github.com/sebastianbergmann/phpunit/pull/5015): Ukraine banner unreadable on black background -* [#5016](https://github.com/sebastianbergmann/phpunit/issues/5016): PHPUnit 8.5.27 does not work on PHP 7.2.0-7.2.18 and PHP 7.3.0-7.3.5 - -## [8.5.27] - 2022-06-19 - -### Fixed - -* [#4950](https://github.com/sebastianbergmann/phpunit/issues/4950): False error on `atMost()` invocation rule without call -* [#4962](https://github.com/sebastianbergmann/phpunit/issues/4962): Ukraine banner unreadable on white background - -## [8.5.26] - 2022-04-01 - -### Fixed - -* [#4938](https://github.com/sebastianbergmann/phpunit/issues/4938): Test Double code generator does not handle `void` return type declaration on `__clone()` methods - -## [8.5.25] - 2022-03-16 - -### Fixed - -* [#4934](https://github.com/sebastianbergmann/phpunit/issues/4934): Code Coverage does not work with PHPUnit 8.5.24 PHAR on PHP 7 - -## [8.5.24] - 2022-03-05 - #StandWithUkraine - -### Changed - -* [#4874](https://github.com/sebastianbergmann/phpunit/pull/4874): `PHP_FLOAT_EPSILON` is now used instead of hardcoded `0.0000000001` in `PHPUnit\Framework\Constraint\IsIdentical` - -### Fixed - -* When the HTML code coverage report's configured low upper bound is larger than the high lower bound then the default values are used instead - -## [8.5.23] - 2022-01-21 - -### Fixed - -* [#4799](https://github.com/sebastianbergmann/phpunit/pull/4799): Memory leaks in `PHPUnit\Framework\TestSuite` class -* [#4857](https://github.com/sebastianbergmann/phpunit/pull/4857): Result of `debug_backtrace()` is not used correctly - -## [8.5.22] - 2021-12-25 - -### Changed - -* [#4812](https://github.com/sebastianbergmann/phpunit/issues/4812): Do not enforce time limits when a debugging session through DBGp is active -* [#4835](https://github.com/sebastianbergmann/phpunit/issues/4835): Support for `$GLOBALS['_composer_autoload_path']` introduced in Composer 2.2 - -### Fixed - -* [#4840](https://github.com/sebastianbergmann/phpunit/pull/4840): TestDox prettifying for class names does not correctly handle diacritics -* [#4846](https://github.com/sebastianbergmann/phpunit/pull/4846): Composer proxy script is not ignored - -## [8.5.21] - 2021-09-25 - -### Changed - -* PHPUnit no longer converts PHP deprecations to exceptions by default (configure `convertDeprecationsToExceptions="true"` to enable this) -* The PHPUnit XML configuration file generator now configures `convertDeprecationsToExceptions="true"` - -### Fixed - -* [#4772](https://github.com/sebastianbergmann/phpunit/pull/4772): TestDox HTML report not displayed correctly when browser has custom colour settings - -## [8.5.20] - 2021-08-31 - -### Fixed - -* [#4751](https://github.com/sebastianbergmann/phpunit/issues/4751): Configuration validation fails when using brackets in glob pattern - -## [8.5.19] - 2021-07-31 - -### Fixed - -* [#4740](https://github.com/sebastianbergmann/phpunit/issues/4740): `phpunit.phar` does not work with PHP 8.1 - -## [8.5.18] - 2021-07-19 - -### Fixed - -* [#4720](https://github.com/sebastianbergmann/phpunit/issues/4720): PHPUnit does not verify its own PHP extension requirements - -## [8.5.17] - 2021-06-23 - -### Changed - -* PHPUnit now errors out on startup when `PHP_VERSION` contains a value that is not compatible with `version_compare()`, for instance `X.Y.Z-(to be removed in future macOS)` - -## [8.5.16] - 2021-06-05 - -### Changed - -* The test result cache (the storage for which is implemented in `PHPUnit\Runner\DefaultTestResultCache`) no longer uses PHP's `serialize()` and `unserialize()` functions for persistence. It now uses a versioned JSON format instead that is independent of PHP implementation details (see [#3581](https://github.com/sebastianbergmann/phpunit/issues/3581) and [#4662](https://github.com/sebastianbergmann/phpunit/pull/4662) for examples why this is a problem). When PHPUnit tries to load the test result cache from a file that does not exist, or from a file that does not contain data in JSON format, or from a file that contains data in a JSON format version other than the one used by the currently running PHPUnit version, then this is considered to be a "cache miss". An empty `DefaultTestResultCache` object is created in this case. This should also prevent PHPUnit from crashing when trying to load a test result cache file created by a different version of PHPUnit (see [#4580](https://github.com/sebastianbergmann/phpunit/issues/4580) for example). - -### Fixed - -* [#4663](https://github.com/sebastianbergmann/phpunit/issues/4663): `TestCase::expectError()` works on PHP 7.3, but not on PHP >= 7.4 -* [#4678](https://github.com/sebastianbergmann/phpunit/pull/4678): Stubbed methods with `iterable` return types should return empty array by default -* [#4692](https://github.com/sebastianbergmann/phpunit/issues/4692): Annotations in single-line doc-comments are not handled correctly -* [#4694](https://github.com/sebastianbergmann/phpunit/issues/4694): `TestCase::getMockFromWsdl()` does not work with PHP 8.1-dev - -## [8.5.15] - 2021-03-17 - -### Fixed - -* [#4591](https://github.com/sebastianbergmann/phpunit/issues/4591): TeamCity logger logs warnings as test failures - -## [8.5.14] - 2021-01-17 - -### Fixed - -* [#4535](https://github.com/sebastianbergmann/phpunit/issues/4535): `getMockFromWsdl()` does not handle methods that do not have parameters correctly -* [#4572](https://github.com/sebastianbergmann/phpunit/issues/4572): Schema validation does not work with `%xx` sequences in path to `phpunit.xsd` -* [#4575](https://github.com/sebastianbergmann/phpunit/issues/4575): PHPUnit 8.5 incompatibility with PHP 8.1 - -## [8.5.13] - 2020-12-01 - -### Fixed - -* Running tests in isolated processes did not work with PHP 8 on Windows - -## [8.5.12] - 2020-11-30 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.2` to `>=7.2` to allow the installation of PHPUnit 8.5 on PHP 8. Please note that the code coverage functionality is not available for PHPUnit 8.5 on PHP 8. - -### Fixed - -* [#4529](https://github.com/sebastianbergmann/phpunit/issues/4529): Debug mode of Xdebug 2 is not disabled for PHPT tests - -## [8.5.11] - 2020-11-27 - -### Changed - -* Bumped required version of `phpunit/php-code-coverage` - -## [8.5.10] - 2020-11-27 - -### Added - -* Support for Xdebug 3 - -### Fixed - -* [#4516](https://github.com/sebastianbergmann/phpunit/issues/4516): `phpunit/phpunit-selenium` does not work with PHPUnit 8.5.9 - -## [8.5.9] - 2020-11-10 - -### Fixed - -* [#3965](https://github.com/sebastianbergmann/phpunit/issues/3965): Process Isolation throws exceptions when PHPDBG is used -* [#4470](https://github.com/sebastianbergmann/phpunit/pull/4470): Infinite recursion when `--static-backup --strict-global-state` is used - -## [8.5.8] - 2020-06-22 - -### Fixed - -* [#4312](https://github.com/sebastianbergmann/phpunit/issues/4312): Fix for [#4299](https://github.com/sebastianbergmann/phpunit/issues/4299) breaks backward compatibility - -## [8.5.7] - 2020-06-21 - -### Fixed - -* [#4299](https://github.com/sebastianbergmann/phpunit/issues/4299): "No tests executed" does not always result in exit code `1` -* [#4306](https://github.com/sebastianbergmann/phpunit/issues/4306): Exceptions during code coverage driver initialization are not handled correctly - -## [8.5.6] - 2020-06-15 - -### Fixed - -* [#4211](https://github.com/sebastianbergmann/phpunit/issues/4211): `phpdbg_*()` functions are scoped to `PHPUnit\phpdbg_*()` - -## [8.5.5] - 2020-05-22 - -### Fixed - -* [#4033](https://github.com/sebastianbergmann/phpunit/issues/4033): Unexpected behaviour when `$GLOBALS` is deleted - -## [8.5.4] - 2020-04-23 - -### Changed - -* Changed how `PHPUnit\TextUI\Command` passes warnings to `PHPUnit\TextUI\TestRunner` - -## [8.5.3] - 2020-03-31 - -### Fixed - -* [#4017](https://github.com/sebastianbergmann/phpunit/issues/4017): Do not suggest refactoring to something that is also deprecated -* [#4133](https://github.com/sebastianbergmann/phpunit/issues/4133): `expectExceptionMessageRegExp()` has been removed in PHPUnit 9 without a deprecation warning being given in PHPUnit 8 -* [#4139](https://github.com/sebastianbergmann/phpunit/issues/4139): Cannot double interfaces that declare a constructor with PHP 8 -* [#4144](https://github.com/sebastianbergmann/phpunit/issues/4144): Empty objects are converted to empty arrays in JSON comparison failure diff - -## [8.5.2] - 2020-01-08 - -### Removed - -* `eval-stdin.php` has been removed, it was not used anymore since PHPUnit 7.2.7 - -## [8.5.1] - 2019-12-25 - -### Changed - -* `eval-stdin.php` can now only be executed with `cli` and `phpdbg` - -### Fixed - -* [#3983](https://github.com/sebastianbergmann/phpunit/issues/3983): Deprecation warning given too eagerly - -## [8.5.0] - 2019-12-06 - -### Added - -* [#3911](https://github.com/sebastianbergmann/phpunit/issues/3911): Support combined use of `addMethods()` and `onlyMethods()` -* [#3949](https://github.com/sebastianbergmann/phpunit/issues/3949): Introduce specialized assertions `assertFileEqualsCanonicalizing()`, `assertFileEqualsIgnoringCase()`, `assertStringEqualsFileCanonicalizing()`, `assertStringEqualsFileIgnoringCase()`, `assertFileNotEqualsCanonicalizing()`, `assertFileNotEqualsIgnoringCase()`, `assertStringNotEqualsFileCanonicalizing()`, and `assertStringNotEqualsFileIgnoringCase()` as alternative to using `assertFileEquals()` etc. with optional parameters - -### Changed - -* [#3860](https://github.com/sebastianbergmann/phpunit/pull/3860): Deprecate invoking PHPUnit commandline test runner with just a class name -* [#3950](https://github.com/sebastianbergmann/phpunit/issues/3950): Deprecate optional parameters of `assertFileEquals()` etc. -* [#3955](https://github.com/sebastianbergmann/phpunit/issues/3955): Deprecate support for doubling multiple interfaces - -### Fixed - -* [#3953](https://github.com/sebastianbergmann/phpunit/issues/3953): Code Coverage for test executed in isolation does not work when the PHAR is used -* [#3967](https://github.com/sebastianbergmann/phpunit/issues/3967): Cannot double interface that extends interface that extends `\Throwable` -* [#3968](https://github.com/sebastianbergmann/phpunit/pull/3968): Test class run in a separate PHP process are passing when `exit` called inside - -[8.5.31]: https://github.com/sebastianbergmann/phpunit/compare/8.5.30...8.5.31 -[8.5.30]: https://github.com/sebastianbergmann/phpunit/compare/8.5.29...8.5.30 -[8.5.29]: https://github.com/sebastianbergmann/phpunit/compare/8.5.28...8.5.29 -[8.5.28]: https://github.com/sebastianbergmann/phpunit/compare/8.5.27...8.5.28 -[8.5.27]: https://github.com/sebastianbergmann/phpunit/compare/8.5.26...8.5.27 -[8.5.26]: https://github.com/sebastianbergmann/phpunit/compare/8.5.25...8.5.26 -[8.5.25]: https://github.com/sebastianbergmann/phpunit/compare/8.5.24...8.5.25 -[8.5.24]: https://github.com/sebastianbergmann/phpunit/compare/8.5.23...8.5.24 -[8.5.23]: https://github.com/sebastianbergmann/phpunit/compare/8.5.22...8.5.23 -[8.5.22]: https://github.com/sebastianbergmann/phpunit/compare/8.5.21...8.5.22 -[8.5.21]: https://github.com/sebastianbergmann/phpunit/compare/8.5.20...8.5.21 -[8.5.20]: https://github.com/sebastianbergmann/phpunit/compare/8.5.19...8.5.20 -[8.5.19]: https://github.com/sebastianbergmann/phpunit/compare/8.5.18...8.5.19 -[8.5.18]: https://github.com/sebastianbergmann/phpunit/compare/8.5.17...8.5.18 -[8.5.17]: https://github.com/sebastianbergmann/phpunit/compare/8.5.16...8.5.17 -[8.5.16]: https://github.com/sebastianbergmann/phpunit/compare/8.5.15...8.5.16 -[8.5.15]: https://github.com/sebastianbergmann/phpunit/compare/8.5.14...8.5.15 -[8.5.14]: https://github.com/sebastianbergmann/phpunit/compare/8.5.13...8.5.14 -[8.5.13]: https://github.com/sebastianbergmann/phpunit/compare/8.5.12...8.5.13 -[8.5.12]: https://github.com/sebastianbergmann/phpunit/compare/8.5.11...8.5.12 -[8.5.11]: https://github.com/sebastianbergmann/phpunit/compare/8.5.10...8.5.11 -[8.5.10]: https://github.com/sebastianbergmann/phpunit/compare/8.5.9...8.5.10 -[8.5.9]: https://github.com/sebastianbergmann/phpunit/compare/8.5.8...8.5.9 -[8.5.8]: https://github.com/sebastianbergmann/phpunit/compare/8.5.7...8.5.8 -[8.5.7]: https://github.com/sebastianbergmann/phpunit/compare/8.5.6...8.5.7 -[8.5.6]: https://github.com/sebastianbergmann/phpunit/compare/8.5.5...8.5.6 -[8.5.5]: https://github.com/sebastianbergmann/phpunit/compare/8.5.4...8.5.5 -[8.5.4]: https://github.com/sebastianbergmann/phpunit/compare/8.5.3...8.5.4 -[8.5.3]: https://github.com/sebastianbergmann/phpunit/compare/8.5.2...8.5.3 -[8.5.2]: https://github.com/sebastianbergmann/phpunit/compare/8.5.1...8.5.2 -[8.5.1]: https://github.com/sebastianbergmann/phpunit/compare/8.5.0...8.5.1 -[8.5.0]: https://github.com/sebastianbergmann/phpunit/compare/8.4.3...8.5.0 diff --git a/vendor/phpunit/phpunit/ChangeLog-9.5.md b/vendor/phpunit/phpunit/ChangeLog-9.5.md deleted file mode 100644 index cd915e5f..00000000 --- a/vendor/phpunit/phpunit/ChangeLog-9.5.md +++ /dev/null @@ -1,242 +0,0 @@ -# Changes in PHPUnit 9.5 - -All notable changes of the PHPUnit 9.5 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. - -## [9.5.27] - 2022-12-09 - -### Fixed - -* [#5113](https://github.com/sebastianbergmann/phpunit/pull/5113): PHP error instead of PHPUnit error when trying to create test double for `readonly` class - -## [9.5.26] - 2022-10-28 - -### Fixed - -* [#5076](https://github.com/sebastianbergmann/phpunit/issues/5076): Test Runner does not warn about conflicting options - -## [9.5.25] - 2022-09-25 - -### Added - -* [#5042](https://github.com/sebastianbergmann/phpunit/issues/5042): Support Disjunctive Normal Form types - -### Fixed - -* [#4966](https://github.com/sebastianbergmann/phpunit/issues/4966): `TestCase::assertSame()` (and related exact comparisons) must compare `float` exactly - -## [9.5.24] - 2022-08-30 - -### Added - -* [#4931](https://github.com/sebastianbergmann/phpunit/issues/4931): Support `null` and `false` as stand-alone types -* [#4955](https://github.com/sebastianbergmann/phpunit/issues/4955): Support `true` as stand-alone type - -### Fixed - -* [#4913](https://github.com/sebastianbergmann/phpunit/issues/4913): Failed `assert()` should show a backtrace -* [#5012](https://github.com/sebastianbergmann/phpunit/pull/5012): Memory leak in `ExceptionWrapper` - -## [9.5.23] - 2022-08-22 - -### Changed - -* [#5033](https://github.com/sebastianbergmann/phpunit/issues/5033): Do not depend on phpspec/prophecy - -## [9.5.22] - 2022-08-20 - -### Fixed - -* [#5015](https://github.com/sebastianbergmann/phpunit/pull/5015): Ukraine banner unreadable on black background -* [#5020](https://github.com/sebastianbergmann/phpunit/issues/5020): PHPUnit 9 breaks loading of PSR-0/PEAR style classes -* [#5022](https://github.com/sebastianbergmann/phpunit/issues/5022): `ExcludeList::addDirectory()` does not work correctly - -## [9.5.21] - 2022-06-19 - -### Fixed - -* [#4950](https://github.com/sebastianbergmann/phpunit/issues/4950): False error on `atMost()` invocation rule without call -* [#4962](https://github.com/sebastianbergmann/phpunit/issues/4962): Ukraine banner unreadable on white background - -## [9.5.20] - 2022-04-01 - -### Fixed - -* [#4938](https://github.com/sebastianbergmann/phpunit/issues/4938): Test Double code generator does not handle `void` return type declaration on `__clone()` methods -* [#4947](https://github.com/sebastianbergmann/phpunit/issues/4947): Test annotated with `@coversNothing` may lead to files missing from code coverage report - -## [9.5.19] - 2022-03-15 - -### Fixed - -* [#4929](https://github.com/sebastianbergmann/phpunit/issues/4929): Test Double code generator does not handle new expressions inside parameter default values -* [#4932](https://github.com/sebastianbergmann/phpunit/issues/4932): Backport support for intersection types from PHPUnit 10 to PHPUnit 9.5 -* [#4933](https://github.com/sebastianbergmann/phpunit/issues/4933): Backport support for `never` type from PHPUnit 10 to PHPUnit 9.5 - -## [9.5.18] - 2022-03-08 - -### Fixed - -* [#4877](https://github.com/sebastianbergmann/phpunit/issues/4877): No stack trace shown when an error occurs during bootstrap - -## [9.5.17] - 2022-03-05 - #StandWithUkraine - -## [9.5.16] - 2022-02-23 - -### Changed - -* Reverted sync with API change in (now yanked) phpunit/php-code-coverage 9.2.12 - -## [9.5.15] - 2022-02-23 [YANKED] - -### Fixed - -* When the HTML code coverage report's configured low upper bound is larger than the high lower bound then the default values are used instead - -## [9.5.14] - 2022-02-18 - -### Changed - -* [#4874](https://github.com/sebastianbergmann/phpunit/pull/4874): `PHP_FLOAT_EPSILON` is now used instead of hardcoded `0.0000000001` in `PHPUnit\Framework\Constraint\IsIdentical` - -## [9.5.13] - 2022-01-24 - -### Fixed - -* [#4871](https://github.com/sebastianbergmann/phpunit/issues/4871): Class `SebastianBergmann\CodeCoverage\Filter` is not found during PHPT tests when PHPUnit is used from PHAR - -## [9.5.12] - 2022-01-21 - -### Fixed - -* [#4799](https://github.com/sebastianbergmann/phpunit/pull/4799): Memory leaks in `PHPUnit\Framework\TestSuite` class -* [#4857](https://github.com/sebastianbergmann/phpunit/pull/4857): Result of `debug_backtrace()` is not used correctly - -## [9.5.11] - 2021-12-25 - -### Changed - -* [#4812](https://github.com/sebastianbergmann/phpunit/issues/4812): Do not enforce time limits when a debugging session through DBGp is active -* [#4835](https://github.com/sebastianbergmann/phpunit/issues/4835): Support for `$GLOBALS['_composer_autoload_path']` introduced in Composer 2.2 - -### Fixed - -* [#4840](https://github.com/sebastianbergmann/phpunit/pull/4840): TestDox prettifying for class names does not correctly handle diacritics -* [#4846](https://github.com/sebastianbergmann/phpunit/pull/4846): Composer proxy script is not ignored - -## [9.5.10] - 2021-09-25 - -### Changed - -* PHPUnit no longer converts PHP deprecations to exceptions by default (configure `convertDeprecationsToExceptions="true"` to enable this) -* The PHPUnit XML configuration file generator now configures `convertDeprecationsToExceptions="true"` - -### Fixed - -* [#4772](https://github.com/sebastianbergmann/phpunit/pull/4772): TestDox HTML report not displayed correctly when browser has custom colour settings - -## [9.5.9] - 2021-08-31 - -### Fixed - -* [#4750](https://github.com/sebastianbergmann/phpunit/issues/4750): Automatic return value generation leads to invalid (and superfluous) test double code generation when a stubbed method returns `*|false` -* [#4751](https://github.com/sebastianbergmann/phpunit/issues/4751): Configuration validation fails when using brackets in glob pattern - -## [9.5.8] - 2021-07-31 - -### Fixed - -* [#4740](https://github.com/sebastianbergmann/phpunit/issues/4740): `phpunit.phar` does not work with PHP 8.1 - -## [9.5.7] - 2021-07-19 - -### Fixed - -* [#4720](https://github.com/sebastianbergmann/phpunit/issues/4720): PHPUnit does not verify its own PHP extension requirements -* [#4735](https://github.com/sebastianbergmann/phpunit/issues/4735): Automated return value generation does not work for stubbed methods that return `*|false` - -## [9.5.6] - 2021-06-23 - -### Changed - -* PHPUnit now errors out on startup when `PHP_VERSION` contains a value that is not compatible with `version_compare()`, for instance `X.Y.Z-(to be removed in future macOS)` - -## [9.5.5] - 2021-06-05 - -### Changed - -* The test result cache (the storage for which is implemented in `PHPUnit\Runner\DefaultTestResultCache`) no longer uses PHP's `serialize()` and `unserialize()` functions for persistence. It now uses a versioned JSON format instead that is independent of PHP implementation details (see [#3581](https://github.com/sebastianbergmann/phpunit/issues/3581) and [#4662](https://github.com/sebastianbergmann/phpunit/pull/4662) for examples why this is a problem). When PHPUnit tries to load the test result cache from a file that does not exist, or from a file that does not contain data in JSON format, or from a file that contains data in a JSON format version other than the one used by the currently running PHPUnit version, then this is considered to be a "cache miss". An empty `DefaultTestResultCache` object is created in this case. This should also prevent PHPUnit from crashing when trying to load a test result cache file created by a different version of PHPUnit (see [#4580](https://github.com/sebastianbergmann/phpunit/issues/4580) for example). - -### Fixed - -* [#4632](https://github.com/sebastianbergmann/phpunit/issues/4632): TestDox result printer does not handle repeated test execution correctly -* [#4678](https://github.com/sebastianbergmann/phpunit/pull/4678): Stubbed methods with `iterable` return types should return empty array by default -* [#4692](https://github.com/sebastianbergmann/phpunit/issues/4692): Annotations in single-line doc-comments are not handled correctly -* [#4694](https://github.com/sebastianbergmann/phpunit/issues/4694): `TestCase::getMockFromWsdl()` does not work with PHP 8.1-dev - -## [9.5.4] - 2021-03-23 - -### Fixed - -* [#4630](https://github.com/sebastianbergmann/phpunit/issues/4630): Empty test case class causes error in TestDox XML logger - -## [9.5.3] - 2021-03-17 - -### Fixed - -* [#4591](https://github.com/sebastianbergmann/phpunit/issues/4591): TeamCity logger logs warnings as test failures -* [#4620](https://github.com/sebastianbergmann/phpunit/issues/4620): No useful output when an error occurs in the bootstrap script - -## [9.5.2] - 2021-02-02 - -### Fixed - -* [#4573](https://github.com/sebastianbergmann/phpunit/issues/4573): No stack trace printed when PHPUnit is used from PHAR -* [#4590](https://github.com/sebastianbergmann/phpunit/issues/4590): `--coverage-text` CLI option is documented wrong - -## [9.5.1] - 2021-01-17 - -### Fixed - -* [#4572](https://github.com/sebastianbergmann/phpunit/issues/4572): Schema validation does not work with `%xx` sequences in path to `phpunit.xsd` - -## [9.5.0] - 2020-12-04 - -### Changed - -* [#4490](https://github.com/sebastianbergmann/phpunit/issues/4490): Emit Error instead of Warning when test case class cannot be instantiated -* [#4491](https://github.com/sebastianbergmann/phpunit/issues/4491): Emit Error instead of Warning when data provider does not work correctly -* [#4492](https://github.com/sebastianbergmann/phpunit/issues/4492): Emit Error instead of Warning when test double configuration is invalid -* [#4493](https://github.com/sebastianbergmann/phpunit/issues/4493): Emit error when (configured) test directory does not exist - -### Fixed - -* [#4535](https://github.com/sebastianbergmann/phpunit/issues/4535): `getMockFromWsdl()` does not handle methods that do not have parameters correctly - -[9.5.27]: https://github.com/sebastianbergmann/phpunit/compare/9.5.26...9.5.27 -[9.5.26]: https://github.com/sebastianbergmann/phpunit/compare/9.5.25...9.5.26 -[9.5.25]: https://github.com/sebastianbergmann/phpunit/compare/9.5.24...9.5.25 -[9.5.24]: https://github.com/sebastianbergmann/phpunit/compare/9.5.23...9.5.24 -[9.5.23]: https://github.com/sebastianbergmann/phpunit/compare/9.5.22...9.5.23 -[9.5.22]: https://github.com/sebastianbergmann/phpunit/compare/9.5.21...9.5.22 -[9.5.21]: https://github.com/sebastianbergmann/phpunit/compare/9.5.20...9.5.21 -[9.5.20]: https://github.com/sebastianbergmann/phpunit/compare/9.5.19...9.5.20 -[9.5.19]: https://github.com/sebastianbergmann/phpunit/compare/9.5.18...9.5.19 -[9.5.18]: https://github.com/sebastianbergmann/phpunit/compare/9.5.17...9.5.18 -[9.5.17]: https://github.com/sebastianbergmann/phpunit/compare/9.5.16...9.5.17 -[9.5.16]: https://github.com/sebastianbergmann/phpunit/compare/dc738383c519243b0a967f63943a848d3fd861aa...9.5.16 -[9.5.15]: https://github.com/sebastianbergmann/phpunit/compare/9.5.14...dc738383c519243b0a967f63943a848d3fd861aa -[9.5.14]: https://github.com/sebastianbergmann/phpunit/compare/9.5.13...9.5.14 -[9.5.13]: https://github.com/sebastianbergmann/phpunit/compare/9.5.12...9.5.13 -[9.5.12]: https://github.com/sebastianbergmann/phpunit/compare/9.5.11...9.5.12 -[9.5.11]: https://github.com/sebastianbergmann/phpunit/compare/9.5.10...9.5.11 -[9.5.10]: https://github.com/sebastianbergmann/phpunit/compare/9.5.9...9.5.10 -[9.5.9]: https://github.com/sebastianbergmann/phpunit/compare/9.5.8...9.5.9 -[9.5.8]: https://github.com/sebastianbergmann/phpunit/compare/9.5.7...9.5.8 -[9.5.7]: https://github.com/sebastianbergmann/phpunit/compare/9.5.6...9.5.7 -[9.5.6]: https://github.com/sebastianbergmann/phpunit/compare/9.5.5...9.5.6 -[9.5.5]: https://github.com/sebastianbergmann/phpunit/compare/9.5.4...9.5.5 -[9.5.4]: https://github.com/sebastianbergmann/phpunit/compare/9.5.3...9.5.4 -[9.5.3]: https://github.com/sebastianbergmann/phpunit/compare/9.5.2...9.5.3 -[9.5.2]: https://github.com/sebastianbergmann/phpunit/compare/9.5.1...9.5.2 -[9.5.1]: https://github.com/sebastianbergmann/phpunit/compare/9.5.0...9.5.1 -[9.5.0]: https://github.com/sebastianbergmann/phpunit/compare/9.4.4...9.5.0 diff --git a/vendor/phpunit/phpunit/LICENSE b/vendor/phpunit/phpunit/LICENSE deleted file mode 100644 index 567141f2..00000000 --- a/vendor/phpunit/phpunit/LICENSE +++ /dev/null @@ -1,29 +0,0 @@ -BSD 3-Clause License - -Copyright (c) 2001-2022, Sebastian Bergmann -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. - -3. Neither the name of the copyright holder nor the names of its - 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 HOLDER 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/phpunit/phpunit/README.md b/vendor/phpunit/phpunit/README.md deleted file mode 100644 index d3010666..00000000 --- a/vendor/phpunit/phpunit/README.md +++ /dev/null @@ -1,45 +0,0 @@ -

      🇺🇦 UKRAINE NEEDS YOUR HELP NOW!

      - -# PHPUnit - -PHPUnit is a programmer-oriented testing framework for PHP. It is an instance of the xUnit architecture for unit testing frameworks. - -[![Latest Stable Version](https://img.shields.io/packagist/v/phpunit/phpunit.svg?style=flat-square)](https://packagist.org/packages/phpunit/phpunit) -[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.3-8892BF.svg?style=flat-square)](https://php.net/) -[![CI Status](https://github.com/sebastianbergmann/phpunit/workflows/CI/badge.svg?branch=9.5&event=push)](https://phpunit.de/build-status.html) -[![Type Coverage](https://shepherd.dev/github/sebastianbergmann/phpunit/coverage.svg)](https://shepherd.dev/github/sebastianbergmann/phpunit) - -## Installation - -We distribute a [PHP Archive (PHAR)](https://php.net/phar) that has all required (as well as some optional) dependencies of PHPUnit bundled in a single file: - -```bash -$ wget https://phar.phpunit.de/phpunit-X.Y.phar - -$ php phpunit-X.Y.phar --version -``` - -Please replace `X.Y` with the version of PHPUnit you are interested in. - -Alternatively, you may use [Composer](https://getcomposer.org/) to download and install PHPUnit as well as its dependencies. Please refer to the "[Getting Started](https://phpunit.de/getting-started-with-phpunit.html)" guide for details on how to install PHPUnit. - -## Contribute - -Please refer to [CONTRIBUTING.md](https://github.com/sebastianbergmann/phpunit/blob/master/.github/CONTRIBUTING.md) for information on how to contribute to PHPUnit and its related projects. - -## List of Contributors - -Thanks to everyone who has contributed to PHPUnit! You can find a detailed list of contributors on every PHPUnit related package on GitHub. This list shows only the major components: - -* [PHPUnit](https://github.com/sebastianbergmann/phpunit/graphs/contributors) -* [php-code-coverage](https://github.com/sebastianbergmann/php-code-coverage/graphs/contributors) - -A very special thanks to everyone who has contributed to the documentation and helps maintain the translations: - -* [English](https://github.com/sebastianbergmann/phpunit-documentation-english/graphs/contributors) -* [Spanish](https://github.com/sebastianbergmann/phpunit-documentation-spanish/graphs/contributors) -* [French](https://github.com/sebastianbergmann/phpunit-documentation-french/graphs/contributors) -* [Japanese](https://github.com/sebastianbergmann/phpunit-documentation-japanese/graphs/contributors) -* [Brazilian Portuguese](https://github.com/sebastianbergmann/phpunit-documentation-brazilian-portuguese/graphs/contributors) -* [Simplified Chinese](https://github.com/sebastianbergmann/phpunit-documentation-chinese/graphs/contributors) - diff --git a/vendor/phpunit/phpunit/SECURITY.md b/vendor/phpunit/phpunit/SECURITY.md deleted file mode 100644 index dcc15385..00000000 --- a/vendor/phpunit/phpunit/SECURITY.md +++ /dev/null @@ -1,11 +0,0 @@ -# Security Policy - -PHPUnit is a framework for writing as well as a commandline tool for running tests. Writing and running tests is a development-time activity. There is no reason why PHPUnit should be installed on a webserver. - -**If you upload PHPUnit to a webserver then your deployment process is broken. On a more general note, if your `vendor` directory is publicly accessible on your webserver then your deployment process is also broken.** - -Please note that if you upload PHPUnit to a webserver "bad things" may happen. [You have been warned.](https://thephp.cc/articles/phpunit-a-security-risk) - -## Security Contact Information - -After the above, if you still would like to report a security vulnerability, please email `sebastian@phpunit.de`. diff --git a/vendor/phpunit/phpunit/composer.json b/vendor/phpunit/phpunit/composer.json deleted file mode 100644 index be0af53f..00000000 --- a/vendor/phpunit/phpunit/composer.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "name": "phpunit/phpunit", - "description": "The PHP Unit Testing framework.", - "type": "library", - "keywords": [ - "phpunit", - "xunit", - "testing" - ], - "homepage": "https://phpunit.de/", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues" - }, - "prefer-stable": true, - "require": { - "php": ">=7.3", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "ext-xmlwriter": "*", - "doctrine/instantiator": "^1.3.1", - "myclabs/deep-copy": "^1.10.1", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", - "phpunit/php-code-coverage": "^9.2.13", - "phpunit/php-file-iterator": "^3.0.5", - "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.3", - "phpunit/php-timer": "^5.0.2", - "sebastian/cli-parser": "^1.0.1", - "sebastian/code-unit": "^1.0.6", - "sebastian/comparator": "^4.0.8", - "sebastian/diff": "^4.0.3", - "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.5", - "sebastian/global-state": "^5.0.1", - "sebastian/object-enumerator": "^4.0.3", - "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.2", - "sebastian/version": "^3.0.2" - }, - "config": { - "platform": { - "php": "7.3.0" - }, - "optimize-autoloader": true, - "sort-packages": true - }, - "suggest": { - "ext-soap": "*", - "ext-xdebug": "*" - }, - "bin": [ - "phpunit" - ], - "autoload": { - "classmap": [ - "src/" - ], - "files": [ - "src/Framework/Assert/Functions.php" - ] - }, - "autoload-dev": { - "classmap": [ - "tests/" - ], - "files": [ - "tests/_files/CoverageNamespacedFunctionTest.php", - "tests/_files/CoveredFunction.php", - "tests/_files/NamespaceCoveredFunction.php" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "9.5-dev" - } - } -} diff --git a/vendor/phpunit/phpunit/phpunit b/vendor/phpunit/phpunit/phpunit deleted file mode 100755 index c8029566..00000000 --- a/vendor/phpunit/phpunit/phpunit +++ /dev/null @@ -1,98 +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 (!version_compare(PHP_VERSION, PHP_VERSION, '=')) { - fwrite( - STDERR, - sprintf( - '%s declares an invalid value for PHP_VERSION.' . PHP_EOL . - 'This breaks fundamental functionality such as version_compare().' . PHP_EOL . - 'Please use a different PHP interpreter.' . PHP_EOL, - - PHP_BINARY - ) - ); - - die(1); -} - -if (version_compare('7.3.0', PHP_VERSION, '>')) { - fwrite( - STDERR, - sprintf( - 'This version of PHPUnit requires PHP >= 7.3.' . PHP_EOL . - 'You are using PHP %s (%s).' . PHP_EOL, - PHP_VERSION, - PHP_BINARY - ) - ); - - die(1); -} - -foreach (['dom', 'json', 'libxml', 'mbstring', 'tokenizer', 'xml', 'xmlwriter'] as $extension) { - if (extension_loaded($extension)) { - continue; - } - - fwrite( - STDERR, - sprintf( - 'PHPUnit requires the "%s" extension.' . PHP_EOL, - $extension - ) - ); - - die(1); -} - -if (!ini_get('date.timezone')) { - ini_set('date.timezone', 'UTC'); -} - -if (isset($GLOBALS['_composer_autoload_path'])) { - define('PHPUNIT_COMPOSER_INSTALL', $GLOBALS['_composer_autoload_path']); - - unset($GLOBALS['_composer_autoload_path']); -} else { - foreach (array(__DIR__ . '/../../autoload.php', __DIR__ . '/../vendor/autoload.php', __DIR__ . '/vendor/autoload.php') as $file) { - if (file_exists($file)) { - define('PHPUNIT_COMPOSER_INSTALL', $file); - - break; - } - } - - unset($file); -} - -if (!defined('PHPUNIT_COMPOSER_INSTALL')) { - fwrite( - STDERR, - 'You need to set up the project dependencies using Composer:' . PHP_EOL . PHP_EOL . - ' composer install' . PHP_EOL . PHP_EOL . - 'You can learn all about Composer on https://getcomposer.org/.' . PHP_EOL - ); - - die(1); -} - -$options = getopt('', array('prepend:')); - -if (isset($options['prepend'])) { - require $options['prepend']; -} - -unset($options); - -require PHPUNIT_COMPOSER_INSTALL; - -PHPUnit\TextUI\Command::main(); diff --git a/vendor/phpunit/phpunit/phpunit.xsd b/vendor/phpunit/phpunit/phpunit.xsd deleted file mode 100644 index eabefac3..00000000 --- a/vendor/phpunit/phpunit/phpunit.xsd +++ /dev/null @@ -1,330 +0,0 @@ - - - - - This Schema file defines the rules by which the XML configuration file of PHPUnit 9.5 may be structured. - - - - - - Root Element - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The main type specifying the document structure - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/phpunit/phpunit/schema/8.5.xsd b/vendor/phpunit/phpunit/schema/8.5.xsd deleted file mode 100644 index 5881bafe..00000000 --- a/vendor/phpunit/phpunit/schema/8.5.xsd +++ /dev/null @@ -1,317 +0,0 @@ - - - - - This Schema file defines the rules by which the XML configuration file of PHPUnit 8.5 may be structured. - - - - - - Root Element - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The main type specifying the document structure - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/phpunit/phpunit/schema/9.2.xsd b/vendor/phpunit/phpunit/schema/9.2.xsd deleted file mode 100644 index 883f21bc..00000000 --- a/vendor/phpunit/phpunit/schema/9.2.xsd +++ /dev/null @@ -1,317 +0,0 @@ - - - - - This Schema file defines the rules by which the XML configuration file of PHPUnit 9.2 may be structured. - - - - - - Root Element - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The main type specifying the document structure - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/phpunit/phpunit/src/Exception.php b/vendor/phpunit/phpunit/src/Exception.php deleted file mode 100644 index 4e7c3335..00000000 --- a/vendor/phpunit/phpunit/src/Exception.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit; - -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -interface Exception extends Throwable -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/Assert.php b/vendor/phpunit/phpunit/src/Framework/Assert.php deleted file mode 100644 index 97321e35..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Assert.php +++ /dev/null @@ -1,2860 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -use const DEBUG_BACKTRACE_IGNORE_ARGS; -use const PHP_EOL; -use function array_shift; -use function array_unshift; -use function assert; -use function class_exists; -use function count; -use function debug_backtrace; -use function explode; -use function file_get_contents; -use function func_get_args; -use function implode; -use function interface_exists; -use function is_array; -use function is_bool; -use function is_int; -use function is_iterable; -use function is_object; -use function is_string; -use function preg_match; -use function preg_split; -use function sprintf; -use function strpos; -use ArrayAccess; -use Countable; -use DOMAttr; -use DOMDocument; -use DOMElement; -use PHPUnit\Framework\Constraint\ArrayHasKey; -use PHPUnit\Framework\Constraint\Callback; -use PHPUnit\Framework\Constraint\ClassHasAttribute; -use PHPUnit\Framework\Constraint\ClassHasStaticAttribute; -use PHPUnit\Framework\Constraint\Constraint; -use PHPUnit\Framework\Constraint\Count; -use PHPUnit\Framework\Constraint\DirectoryExists; -use PHPUnit\Framework\Constraint\FileExists; -use PHPUnit\Framework\Constraint\GreaterThan; -use PHPUnit\Framework\Constraint\IsAnything; -use PHPUnit\Framework\Constraint\IsEmpty; -use PHPUnit\Framework\Constraint\IsEqual; -use PHPUnit\Framework\Constraint\IsEqualCanonicalizing; -use PHPUnit\Framework\Constraint\IsEqualIgnoringCase; -use PHPUnit\Framework\Constraint\IsEqualWithDelta; -use PHPUnit\Framework\Constraint\IsFalse; -use PHPUnit\Framework\Constraint\IsFinite; -use PHPUnit\Framework\Constraint\IsIdentical; -use PHPUnit\Framework\Constraint\IsInfinite; -use PHPUnit\Framework\Constraint\IsInstanceOf; -use PHPUnit\Framework\Constraint\IsJson; -use PHPUnit\Framework\Constraint\IsNan; -use PHPUnit\Framework\Constraint\IsNull; -use PHPUnit\Framework\Constraint\IsReadable; -use PHPUnit\Framework\Constraint\IsTrue; -use PHPUnit\Framework\Constraint\IsType; -use PHPUnit\Framework\Constraint\IsWritable; -use PHPUnit\Framework\Constraint\JsonMatches; -use PHPUnit\Framework\Constraint\LessThan; -use PHPUnit\Framework\Constraint\LogicalAnd; -use PHPUnit\Framework\Constraint\LogicalNot; -use PHPUnit\Framework\Constraint\LogicalOr; -use PHPUnit\Framework\Constraint\LogicalXor; -use PHPUnit\Framework\Constraint\ObjectEquals; -use PHPUnit\Framework\Constraint\ObjectHasAttribute; -use PHPUnit\Framework\Constraint\RegularExpression; -use PHPUnit\Framework\Constraint\SameSize; -use PHPUnit\Framework\Constraint\StringContains; -use PHPUnit\Framework\Constraint\StringEndsWith; -use PHPUnit\Framework\Constraint\StringMatchesFormatDescription; -use PHPUnit\Framework\Constraint\StringStartsWith; -use PHPUnit\Framework\Constraint\TraversableContainsEqual; -use PHPUnit\Framework\Constraint\TraversableContainsIdentical; -use PHPUnit\Framework\Constraint\TraversableContainsOnly; -use PHPUnit\Util\Type; -use PHPUnit\Util\Xml; -use PHPUnit\Util\Xml\Loader as XmlLoader; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -abstract class Assert -{ - /** - * @var int - */ - private static $count = 0; - - /** - * Asserts that an array has a specified key. - * - * @param int|string $key - * @param array|ArrayAccess $array - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - public static function assertArrayHasKey($key, $array, string $message = ''): void - { - if (!(is_int($key) || is_string($key))) { - throw InvalidArgumentException::create( - 1, - 'integer or string' - ); - } - - if (!(is_array($array) || $array instanceof ArrayAccess)) { - throw InvalidArgumentException::create( - 2, - 'array or ArrayAccess' - ); - } - - $constraint = new ArrayHasKey($key); - - static::assertThat($array, $constraint, $message); - } - - /** - * Asserts that an array does not have a specified key. - * - * @param int|string $key - * @param array|ArrayAccess $array - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - public static function assertArrayNotHasKey($key, $array, string $message = ''): void - { - if (!(is_int($key) || is_string($key))) { - throw InvalidArgumentException::create( - 1, - 'integer or string' - ); - } - - if (!(is_array($array) || $array instanceof ArrayAccess)) { - throw InvalidArgumentException::create( - 2, - 'array or ArrayAccess' - ); - } - - $constraint = new LogicalNot( - new ArrayHasKey($key) - ); - - static::assertThat($array, $constraint, $message); - } - - /** - * Asserts that a haystack contains a needle. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - public static function assertContains($needle, iterable $haystack, string $message = ''): void - { - $constraint = new TraversableContainsIdentical($needle); - - static::assertThat($haystack, $constraint, $message); - } - - public static function assertContainsEquals($needle, iterable $haystack, string $message = ''): void - { - $constraint = new TraversableContainsEqual($needle); - - static::assertThat($haystack, $constraint, $message); - } - - /** - * Asserts that a haystack does not contain a needle. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - public static function assertNotContains($needle, iterable $haystack, string $message = ''): void - { - $constraint = new LogicalNot( - new TraversableContainsIdentical($needle) - ); - - static::assertThat($haystack, $constraint, $message); - } - - public static function assertNotContainsEquals($needle, iterable $haystack, string $message = ''): void - { - $constraint = new LogicalNot(new TraversableContainsEqual($needle)); - - static::assertThat($haystack, $constraint, $message); - } - - /** - * Asserts that a haystack contains only values of a given type. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertContainsOnly(string $type, iterable $haystack, ?bool $isNativeType = null, string $message = ''): void - { - if ($isNativeType === null) { - $isNativeType = Type::isType($type); - } - - static::assertThat( - $haystack, - new TraversableContainsOnly( - $type, - $isNativeType - ), - $message - ); - } - - /** - * Asserts that a haystack contains only instances of a given class name. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertContainsOnlyInstancesOf(string $className, iterable $haystack, string $message = ''): void - { - static::assertThat( - $haystack, - new TraversableContainsOnly( - $className, - false - ), - $message - ); - } - - /** - * Asserts that a haystack does not contain only values of a given type. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertNotContainsOnly(string $type, iterable $haystack, ?bool $isNativeType = null, string $message = ''): void - { - if ($isNativeType === null) { - $isNativeType = Type::isType($type); - } - - static::assertThat( - $haystack, - new LogicalNot( - new TraversableContainsOnly( - $type, - $isNativeType - ) - ), - $message - ); - } - - /** - * Asserts the number of elements of an array, Countable or Traversable. - * - * @param Countable|iterable $haystack - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - public static function assertCount(int $expectedCount, $haystack, string $message = ''): void - { - if (!$haystack instanceof Countable && !is_iterable($haystack)) { - throw InvalidArgumentException::create(2, 'countable or iterable'); - } - - static::assertThat( - $haystack, - new Count($expectedCount), - $message - ); - } - - /** - * Asserts the number of elements of an array, Countable or Traversable. - * - * @param Countable|iterable $haystack - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - public static function assertNotCount(int $expectedCount, $haystack, string $message = ''): void - { - if (!$haystack instanceof Countable && !is_iterable($haystack)) { - throw InvalidArgumentException::create(2, 'countable or iterable'); - } - - $constraint = new LogicalNot( - new Count($expectedCount) - ); - - static::assertThat($haystack, $constraint, $message); - } - - /** - * Asserts that two variables are equal. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertEquals($expected, $actual, string $message = ''): void - { - $constraint = new IsEqual($expected); - - static::assertThat($actual, $constraint, $message); - } - - /** - * Asserts that two variables are equal (canonicalizing). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertEqualsCanonicalizing($expected, $actual, string $message = ''): void - { - $constraint = new IsEqualCanonicalizing($expected); - - static::assertThat($actual, $constraint, $message); - } - - /** - * Asserts that two variables are equal (ignoring case). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertEqualsIgnoringCase($expected, $actual, string $message = ''): void - { - $constraint = new IsEqualIgnoringCase($expected); - - static::assertThat($actual, $constraint, $message); - } - - /** - * Asserts that two variables are equal (with delta). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertEqualsWithDelta($expected, $actual, float $delta, string $message = ''): void - { - $constraint = new IsEqualWithDelta( - $expected, - $delta - ); - - static::assertThat($actual, $constraint, $message); - } - - /** - * Asserts that two variables are not equal. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertNotEquals($expected, $actual, string $message = ''): void - { - $constraint = new LogicalNot( - new IsEqual($expected) - ); - - static::assertThat($actual, $constraint, $message); - } - - /** - * Asserts that two variables are not equal (canonicalizing). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertNotEqualsCanonicalizing($expected, $actual, string $message = ''): void - { - $constraint = new LogicalNot( - new IsEqualCanonicalizing($expected) - ); - - static::assertThat($actual, $constraint, $message); - } - - /** - * Asserts that two variables are not equal (ignoring case). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertNotEqualsIgnoringCase($expected, $actual, string $message = ''): void - { - $constraint = new LogicalNot( - new IsEqualIgnoringCase($expected) - ); - - static::assertThat($actual, $constraint, $message); - } - - /** - * Asserts that two variables are not equal (with delta). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertNotEqualsWithDelta($expected, $actual, float $delta, string $message = ''): void - { - $constraint = new LogicalNot( - new IsEqualWithDelta( - $expected, - $delta - ) - ); - - static::assertThat($actual, $constraint, $message); - } - - /** - * @throws ExpectationFailedException - */ - public static function assertObjectEquals(object $expected, object $actual, string $method = 'equals', string $message = ''): void - { - static::assertThat( - $actual, - static::objectEquals($expected, $method), - $message - ); - } - - /** - * Asserts that a variable is empty. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert empty $actual - */ - public static function assertEmpty($actual, string $message = ''): void - { - static::assertThat($actual, static::isEmpty(), $message); - } - - /** - * Asserts that a variable is not empty. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !empty $actual - */ - public static function assertNotEmpty($actual, string $message = ''): void - { - static::assertThat($actual, static::logicalNot(static::isEmpty()), $message); - } - - /** - * Asserts that a value is greater than another value. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertGreaterThan($expected, $actual, string $message = ''): void - { - static::assertThat($actual, static::greaterThan($expected), $message); - } - - /** - * Asserts that a value is greater than or equal to another value. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertGreaterThanOrEqual($expected, $actual, string $message = ''): void - { - static::assertThat( - $actual, - static::greaterThanOrEqual($expected), - $message - ); - } - - /** - * Asserts that a value is smaller than another value. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertLessThan($expected, $actual, string $message = ''): void - { - static::assertThat($actual, static::lessThan($expected), $message); - } - - /** - * Asserts that a value is smaller than or equal to another value. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertLessThanOrEqual($expected, $actual, string $message = ''): void - { - static::assertThat($actual, static::lessThanOrEqual($expected), $message); - } - - /** - * Asserts that the contents of one file is equal to the contents of another - * file. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertFileEquals(string $expected, string $actual, string $message = ''): void - { - static::assertFileExists($expected, $message); - static::assertFileExists($actual, $message); - - $constraint = new IsEqual(file_get_contents($expected)); - - static::assertThat(file_get_contents($actual), $constraint, $message); - } - - /** - * Asserts that the contents of one file is equal to the contents of another - * file (canonicalizing). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertFileEqualsCanonicalizing(string $expected, string $actual, string $message = ''): void - { - static::assertFileExists($expected, $message); - static::assertFileExists($actual, $message); - - $constraint = new IsEqualCanonicalizing( - file_get_contents($expected) - ); - - static::assertThat(file_get_contents($actual), $constraint, $message); - } - - /** - * Asserts that the contents of one file is equal to the contents of another - * file (ignoring case). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertFileEqualsIgnoringCase(string $expected, string $actual, string $message = ''): void - { - static::assertFileExists($expected, $message); - static::assertFileExists($actual, $message); - - $constraint = new IsEqualIgnoringCase(file_get_contents($expected)); - - static::assertThat(file_get_contents($actual), $constraint, $message); - } - - /** - * Asserts that the contents of one file is not equal to the contents of - * another file. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertFileNotEquals(string $expected, string $actual, string $message = ''): void - { - static::assertFileExists($expected, $message); - static::assertFileExists($actual, $message); - - $constraint = new LogicalNot( - new IsEqual(file_get_contents($expected)) - ); - - static::assertThat(file_get_contents($actual), $constraint, $message); - } - - /** - * Asserts that the contents of one file is not equal to the contents of another - * file (canonicalizing). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertFileNotEqualsCanonicalizing(string $expected, string $actual, string $message = ''): void - { - static::assertFileExists($expected, $message); - static::assertFileExists($actual, $message); - - $constraint = new LogicalNot( - new IsEqualCanonicalizing(file_get_contents($expected)) - ); - - static::assertThat(file_get_contents($actual), $constraint, $message); - } - - /** - * Asserts that the contents of one file is not equal to the contents of another - * file (ignoring case). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertFileNotEqualsIgnoringCase(string $expected, string $actual, string $message = ''): void - { - static::assertFileExists($expected, $message); - static::assertFileExists($actual, $message); - - $constraint = new LogicalNot( - new IsEqualIgnoringCase(file_get_contents($expected)) - ); - - static::assertThat(file_get_contents($actual), $constraint, $message); - } - - /** - * Asserts that the contents of a string is equal - * to the contents of a file. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertStringEqualsFile(string $expectedFile, string $actualString, string $message = ''): void - { - static::assertFileExists($expectedFile, $message); - - $constraint = new IsEqual(file_get_contents($expectedFile)); - - static::assertThat($actualString, $constraint, $message); - } - - /** - * Asserts that the contents of a string is equal - * to the contents of a file (canonicalizing). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertStringEqualsFileCanonicalizing(string $expectedFile, string $actualString, string $message = ''): void - { - static::assertFileExists($expectedFile, $message); - - $constraint = new IsEqualCanonicalizing(file_get_contents($expectedFile)); - - static::assertThat($actualString, $constraint, $message); - } - - /** - * Asserts that the contents of a string is equal - * to the contents of a file (ignoring case). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertStringEqualsFileIgnoringCase(string $expectedFile, string $actualString, string $message = ''): void - { - static::assertFileExists($expectedFile, $message); - - $constraint = new IsEqualIgnoringCase(file_get_contents($expectedFile)); - - static::assertThat($actualString, $constraint, $message); - } - - /** - * Asserts that the contents of a string is not equal - * to the contents of a file. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertStringNotEqualsFile(string $expectedFile, string $actualString, string $message = ''): void - { - static::assertFileExists($expectedFile, $message); - - $constraint = new LogicalNot( - new IsEqual(file_get_contents($expectedFile)) - ); - - static::assertThat($actualString, $constraint, $message); - } - - /** - * Asserts that the contents of a string is not equal - * to the contents of a file (canonicalizing). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertStringNotEqualsFileCanonicalizing(string $expectedFile, string $actualString, string $message = ''): void - { - static::assertFileExists($expectedFile, $message); - - $constraint = new LogicalNot( - new IsEqualCanonicalizing(file_get_contents($expectedFile)) - ); - - static::assertThat($actualString, $constraint, $message); - } - - /** - * Asserts that the contents of a string is not equal - * to the contents of a file (ignoring case). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertStringNotEqualsFileIgnoringCase(string $expectedFile, string $actualString, string $message = ''): void - { - static::assertFileExists($expectedFile, $message); - - $constraint = new LogicalNot( - new IsEqualIgnoringCase(file_get_contents($expectedFile)) - ); - - static::assertThat($actualString, $constraint, $message); - } - - /** - * Asserts that a file/dir is readable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertIsReadable(string $filename, string $message = ''): void - { - static::assertThat($filename, new IsReadable, $message); - } - - /** - * Asserts that a file/dir exists and is not readable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertIsNotReadable(string $filename, string $message = ''): void - { - static::assertThat($filename, new LogicalNot(new IsReadable), $message); - } - - /** - * Asserts that a file/dir exists and is not readable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @codeCoverageIgnore - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4062 - */ - public static function assertNotIsReadable(string $filename, string $message = ''): void - { - self::createWarning('assertNotIsReadable() is deprecated and will be removed in PHPUnit 10. Refactor your code to use assertIsNotReadable() instead.'); - - static::assertThat($filename, new LogicalNot(new IsReadable), $message); - } - - /** - * Asserts that a file/dir exists and is writable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertIsWritable(string $filename, string $message = ''): void - { - static::assertThat($filename, new IsWritable, $message); - } - - /** - * Asserts that a file/dir exists and is not writable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertIsNotWritable(string $filename, string $message = ''): void - { - static::assertThat($filename, new LogicalNot(new IsWritable), $message); - } - - /** - * Asserts that a file/dir exists and is not writable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @codeCoverageIgnore - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4065 - */ - public static function assertNotIsWritable(string $filename, string $message = ''): void - { - self::createWarning('assertNotIsWritable() is deprecated and will be removed in PHPUnit 10. Refactor your code to use assertIsNotWritable() instead.'); - - static::assertThat($filename, new LogicalNot(new IsWritable), $message); - } - - /** - * Asserts that a directory exists. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertDirectoryExists(string $directory, string $message = ''): void - { - static::assertThat($directory, new DirectoryExists, $message); - } - - /** - * Asserts that a directory does not exist. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertDirectoryDoesNotExist(string $directory, string $message = ''): void - { - static::assertThat($directory, new LogicalNot(new DirectoryExists), $message); - } - - /** - * Asserts that a directory does not exist. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @codeCoverageIgnore - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4068 - */ - public static function assertDirectoryNotExists(string $directory, string $message = ''): void - { - self::createWarning('assertDirectoryNotExists() is deprecated and will be removed in PHPUnit 10. Refactor your code to use assertDirectoryDoesNotExist() instead.'); - - static::assertThat($directory, new LogicalNot(new DirectoryExists), $message); - } - - /** - * Asserts that a directory exists and is readable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertDirectoryIsReadable(string $directory, string $message = ''): void - { - self::assertDirectoryExists($directory, $message); - self::assertIsReadable($directory, $message); - } - - /** - * Asserts that a directory exists and is not readable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertDirectoryIsNotReadable(string $directory, string $message = ''): void - { - self::assertDirectoryExists($directory, $message); - self::assertIsNotReadable($directory, $message); - } - - /** - * Asserts that a directory exists and is not readable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @codeCoverageIgnore - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4071 - */ - public static function assertDirectoryNotIsReadable(string $directory, string $message = ''): void - { - self::createWarning('assertDirectoryNotIsReadable() is deprecated and will be removed in PHPUnit 10. Refactor your code to use assertDirectoryIsNotReadable() instead.'); - - self::assertDirectoryExists($directory, $message); - self::assertIsNotReadable($directory, $message); - } - - /** - * Asserts that a directory exists and is writable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertDirectoryIsWritable(string $directory, string $message = ''): void - { - self::assertDirectoryExists($directory, $message); - self::assertIsWritable($directory, $message); - } - - /** - * Asserts that a directory exists and is not writable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertDirectoryIsNotWritable(string $directory, string $message = ''): void - { - self::assertDirectoryExists($directory, $message); - self::assertIsNotWritable($directory, $message); - } - - /** - * Asserts that a directory exists and is not writable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @codeCoverageIgnore - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4074 - */ - public static function assertDirectoryNotIsWritable(string $directory, string $message = ''): void - { - self::createWarning('assertDirectoryNotIsWritable() is deprecated and will be removed in PHPUnit 10. Refactor your code to use assertDirectoryIsNotWritable() instead.'); - - self::assertDirectoryExists($directory, $message); - self::assertIsNotWritable($directory, $message); - } - - /** - * Asserts that a file exists. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertFileExists(string $filename, string $message = ''): void - { - static::assertThat($filename, new FileExists, $message); - } - - /** - * Asserts that a file does not exist. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertFileDoesNotExist(string $filename, string $message = ''): void - { - static::assertThat($filename, new LogicalNot(new FileExists), $message); - } - - /** - * Asserts that a file does not exist. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @codeCoverageIgnore - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4077 - */ - public static function assertFileNotExists(string $filename, string $message = ''): void - { - self::createWarning('assertFileNotExists() is deprecated and will be removed in PHPUnit 10. Refactor your code to use assertFileDoesNotExist() instead.'); - - static::assertThat($filename, new LogicalNot(new FileExists), $message); - } - - /** - * Asserts that a file exists and is readable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertFileIsReadable(string $file, string $message = ''): void - { - self::assertFileExists($file, $message); - self::assertIsReadable($file, $message); - } - - /** - * Asserts that a file exists and is not readable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertFileIsNotReadable(string $file, string $message = ''): void - { - self::assertFileExists($file, $message); - self::assertIsNotReadable($file, $message); - } - - /** - * Asserts that a file exists and is not readable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @codeCoverageIgnore - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4080 - */ - public static function assertFileNotIsReadable(string $file, string $message = ''): void - { - self::createWarning('assertFileNotIsReadable() is deprecated and will be removed in PHPUnit 10. Refactor your code to use assertFileIsNotReadable() instead.'); - - self::assertFileExists($file, $message); - self::assertIsNotReadable($file, $message); - } - - /** - * Asserts that a file exists and is writable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertFileIsWritable(string $file, string $message = ''): void - { - self::assertFileExists($file, $message); - self::assertIsWritable($file, $message); - } - - /** - * Asserts that a file exists and is not writable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertFileIsNotWritable(string $file, string $message = ''): void - { - self::assertFileExists($file, $message); - self::assertIsNotWritable($file, $message); - } - - /** - * Asserts that a file exists and is not writable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @codeCoverageIgnore - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4083 - */ - public static function assertFileNotIsWritable(string $file, string $message = ''): void - { - self::createWarning('assertFileNotIsWritable() is deprecated and will be removed in PHPUnit 10. Refactor your code to use assertFileIsNotWritable() instead.'); - - self::assertFileExists($file, $message); - self::assertIsNotWritable($file, $message); - } - - /** - * Asserts that a condition is true. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert true $condition - */ - public static function assertTrue($condition, string $message = ''): void - { - static::assertThat($condition, static::isTrue(), $message); - } - - /** - * Asserts that a condition is not true. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !true $condition - */ - public static function assertNotTrue($condition, string $message = ''): void - { - static::assertThat($condition, static::logicalNot(static::isTrue()), $message); - } - - /** - * Asserts that a condition is false. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert false $condition - */ - public static function assertFalse($condition, string $message = ''): void - { - static::assertThat($condition, static::isFalse(), $message); - } - - /** - * Asserts that a condition is not false. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !false $condition - */ - public static function assertNotFalse($condition, string $message = ''): void - { - static::assertThat($condition, static::logicalNot(static::isFalse()), $message); - } - - /** - * Asserts that a variable is null. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert null $actual - */ - public static function assertNull($actual, string $message = ''): void - { - static::assertThat($actual, static::isNull(), $message); - } - - /** - * Asserts that a variable is not null. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !null $actual - */ - public static function assertNotNull($actual, string $message = ''): void - { - static::assertThat($actual, static::logicalNot(static::isNull()), $message); - } - - /** - * Asserts that a variable is finite. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertFinite($actual, string $message = ''): void - { - static::assertThat($actual, static::isFinite(), $message); - } - - /** - * Asserts that a variable is infinite. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertInfinite($actual, string $message = ''): void - { - static::assertThat($actual, static::isInfinite(), $message); - } - - /** - * Asserts that a variable is nan. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertNan($actual, string $message = ''): void - { - static::assertThat($actual, static::isNan(), $message); - } - - /** - * Asserts that a class has a specified attribute. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - public static function assertClassHasAttribute(string $attributeName, string $className, string $message = ''): void - { - if (!self::isValidClassAttributeName($attributeName)) { - throw InvalidArgumentException::create(1, 'valid attribute name'); - } - - if (!class_exists($className)) { - throw InvalidArgumentException::create(2, 'class name'); - } - - static::assertThat($className, new ClassHasAttribute($attributeName), $message); - } - - /** - * Asserts that a class does not have a specified attribute. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - public static function assertClassNotHasAttribute(string $attributeName, string $className, string $message = ''): void - { - if (!self::isValidClassAttributeName($attributeName)) { - throw InvalidArgumentException::create(1, 'valid attribute name'); - } - - if (!class_exists($className)) { - throw InvalidArgumentException::create(2, 'class name'); - } - - static::assertThat( - $className, - new LogicalNot( - new ClassHasAttribute($attributeName) - ), - $message - ); - } - - /** - * Asserts that a class has a specified static attribute. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - public static function assertClassHasStaticAttribute(string $attributeName, string $className, string $message = ''): void - { - if (!self::isValidClassAttributeName($attributeName)) { - throw InvalidArgumentException::create(1, 'valid attribute name'); - } - - if (!class_exists($className)) { - throw InvalidArgumentException::create(2, 'class name'); - } - - static::assertThat( - $className, - new ClassHasStaticAttribute($attributeName), - $message - ); - } - - /** - * Asserts that a class does not have a specified static attribute. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - public static function assertClassNotHasStaticAttribute(string $attributeName, string $className, string $message = ''): void - { - if (!self::isValidClassAttributeName($attributeName)) { - throw InvalidArgumentException::create(1, 'valid attribute name'); - } - - if (!class_exists($className)) { - throw InvalidArgumentException::create(2, 'class name'); - } - - static::assertThat( - $className, - new LogicalNot( - new ClassHasStaticAttribute($attributeName) - ), - $message - ); - } - - /** - * Asserts that an object has a specified attribute. - * - * @param object $object - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - public static function assertObjectHasAttribute(string $attributeName, $object, string $message = ''): void - { - if (!self::isValidObjectAttributeName($attributeName)) { - throw InvalidArgumentException::create(1, 'valid attribute name'); - } - - if (!is_object($object)) { - throw InvalidArgumentException::create(2, 'object'); - } - - static::assertThat( - $object, - new ObjectHasAttribute($attributeName), - $message - ); - } - - /** - * Asserts that an object does not have a specified attribute. - * - * @param object $object - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - public static function assertObjectNotHasAttribute(string $attributeName, $object, string $message = ''): void - { - if (!self::isValidObjectAttributeName($attributeName)) { - throw InvalidArgumentException::create(1, 'valid attribute name'); - } - - if (!is_object($object)) { - throw InvalidArgumentException::create(2, 'object'); - } - - static::assertThat( - $object, - new LogicalNot( - new ObjectHasAttribute($attributeName) - ), - $message - ); - } - - /** - * Asserts that two variables have the same type and value. - * Used on objects, it asserts that two variables reference - * the same object. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-template ExpectedType - * - * @psalm-param ExpectedType $expected - * - * @psalm-assert =ExpectedType $actual - */ - public static function assertSame($expected, $actual, string $message = ''): void - { - static::assertThat( - $actual, - new IsIdentical($expected), - $message - ); - } - - /** - * Asserts that two variables do not have the same type and value. - * Used on objects, it asserts that two variables do not reference - * the same object. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertNotSame($expected, $actual, string $message = ''): void - { - if (is_bool($expected) && is_bool($actual)) { - static::assertNotEquals($expected, $actual, $message); - } - - static::assertThat( - $actual, - new LogicalNot( - new IsIdentical($expected) - ), - $message - ); - } - - /** - * Asserts that a variable is of a given type. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @psalm-template ExpectedType of object - * - * @psalm-param class-string $expected - * - * @psalm-assert =ExpectedType $actual - */ - public static function assertInstanceOf(string $expected, $actual, string $message = ''): void - { - if (!class_exists($expected) && !interface_exists($expected)) { - throw InvalidArgumentException::create(1, 'class or interface name'); - } - - static::assertThat( - $actual, - new IsInstanceOf($expected), - $message - ); - } - - /** - * Asserts that a variable is not of a given type. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - * - * @psalm-template ExpectedType of object - * - * @psalm-param class-string $expected - * - * @psalm-assert !ExpectedType $actual - */ - public static function assertNotInstanceOf(string $expected, $actual, string $message = ''): void - { - if (!class_exists($expected) && !interface_exists($expected)) { - throw InvalidArgumentException::create(1, 'class or interface name'); - } - - static::assertThat( - $actual, - new LogicalNot( - new IsInstanceOf($expected) - ), - $message - ); - } - - /** - * Asserts that a variable is of type array. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert array $actual - */ - public static function assertIsArray($actual, string $message = ''): void - { - static::assertThat( - $actual, - new IsType(IsType::TYPE_ARRAY), - $message - ); - } - - /** - * Asserts that a variable is of type bool. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert bool $actual - */ - public static function assertIsBool($actual, string $message = ''): void - { - static::assertThat( - $actual, - new IsType(IsType::TYPE_BOOL), - $message - ); - } - - /** - * Asserts that a variable is of type float. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert float $actual - */ - public static function assertIsFloat($actual, string $message = ''): void - { - static::assertThat( - $actual, - new IsType(IsType::TYPE_FLOAT), - $message - ); - } - - /** - * Asserts that a variable is of type int. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert int $actual - */ - public static function assertIsInt($actual, string $message = ''): void - { - static::assertThat( - $actual, - new IsType(IsType::TYPE_INT), - $message - ); - } - - /** - * Asserts that a variable is of type numeric. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert numeric $actual - */ - public static function assertIsNumeric($actual, string $message = ''): void - { - static::assertThat( - $actual, - new IsType(IsType::TYPE_NUMERIC), - $message - ); - } - - /** - * Asserts that a variable is of type object. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert object $actual - */ - public static function assertIsObject($actual, string $message = ''): void - { - static::assertThat( - $actual, - new IsType(IsType::TYPE_OBJECT), - $message - ); - } - - /** - * Asserts that a variable is of type resource. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert resource $actual - */ - public static function assertIsResource($actual, string $message = ''): void - { - static::assertThat( - $actual, - new IsType(IsType::TYPE_RESOURCE), - $message - ); - } - - /** - * Asserts that a variable is of type resource and is closed. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert resource $actual - */ - public static function assertIsClosedResource($actual, string $message = ''): void - { - static::assertThat( - $actual, - new IsType(IsType::TYPE_CLOSED_RESOURCE), - $message - ); - } - - /** - * Asserts that a variable is of type string. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert string $actual - */ - public static function assertIsString($actual, string $message = ''): void - { - static::assertThat( - $actual, - new IsType(IsType::TYPE_STRING), - $message - ); - } - - /** - * Asserts that a variable is of type scalar. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert scalar $actual - */ - public static function assertIsScalar($actual, string $message = ''): void - { - static::assertThat( - $actual, - new IsType(IsType::TYPE_SCALAR), - $message - ); - } - - /** - * Asserts that a variable is of type callable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert callable $actual - */ - public static function assertIsCallable($actual, string $message = ''): void - { - static::assertThat( - $actual, - new IsType(IsType::TYPE_CALLABLE), - $message - ); - } - - /** - * Asserts that a variable is of type iterable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert iterable $actual - */ - public static function assertIsIterable($actual, string $message = ''): void - { - static::assertThat( - $actual, - new IsType(IsType::TYPE_ITERABLE), - $message - ); - } - - /** - * Asserts that a variable is not of type array. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !array $actual - */ - public static function assertIsNotArray($actual, string $message = ''): void - { - static::assertThat( - $actual, - new LogicalNot(new IsType(IsType::TYPE_ARRAY)), - $message - ); - } - - /** - * Asserts that a variable is not of type bool. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !bool $actual - */ - public static function assertIsNotBool($actual, string $message = ''): void - { - static::assertThat( - $actual, - new LogicalNot(new IsType(IsType::TYPE_BOOL)), - $message - ); - } - - /** - * Asserts that a variable is not of type float. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !float $actual - */ - public static function assertIsNotFloat($actual, string $message = ''): void - { - static::assertThat( - $actual, - new LogicalNot(new IsType(IsType::TYPE_FLOAT)), - $message - ); - } - - /** - * Asserts that a variable is not of type int. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !int $actual - */ - public static function assertIsNotInt($actual, string $message = ''): void - { - static::assertThat( - $actual, - new LogicalNot(new IsType(IsType::TYPE_INT)), - $message - ); - } - - /** - * Asserts that a variable is not of type numeric. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !numeric $actual - */ - public static function assertIsNotNumeric($actual, string $message = ''): void - { - static::assertThat( - $actual, - new LogicalNot(new IsType(IsType::TYPE_NUMERIC)), - $message - ); - } - - /** - * Asserts that a variable is not of type object. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !object $actual - */ - public static function assertIsNotObject($actual, string $message = ''): void - { - static::assertThat( - $actual, - new LogicalNot(new IsType(IsType::TYPE_OBJECT)), - $message - ); - } - - /** - * Asserts that a variable is not of type resource. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !resource $actual - */ - public static function assertIsNotResource($actual, string $message = ''): void - { - static::assertThat( - $actual, - new LogicalNot(new IsType(IsType::TYPE_RESOURCE)), - $message - ); - } - - /** - * Asserts that a variable is not of type resource. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !resource $actual - */ - public static function assertIsNotClosedResource($actual, string $message = ''): void - { - static::assertThat( - $actual, - new LogicalNot(new IsType(IsType::TYPE_CLOSED_RESOURCE)), - $message - ); - } - - /** - * Asserts that a variable is not of type string. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !string $actual - */ - public static function assertIsNotString($actual, string $message = ''): void - { - static::assertThat( - $actual, - new LogicalNot(new IsType(IsType::TYPE_STRING)), - $message - ); - } - - /** - * Asserts that a variable is not of type scalar. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !scalar $actual - */ - public static function assertIsNotScalar($actual, string $message = ''): void - { - static::assertThat( - $actual, - new LogicalNot(new IsType(IsType::TYPE_SCALAR)), - $message - ); - } - - /** - * Asserts that a variable is not of type callable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !callable $actual - */ - public static function assertIsNotCallable($actual, string $message = ''): void - { - static::assertThat( - $actual, - new LogicalNot(new IsType(IsType::TYPE_CALLABLE)), - $message - ); - } - - /** - * Asserts that a variable is not of type iterable. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-assert !iterable $actual - */ - public static function assertIsNotIterable($actual, string $message = ''): void - { - static::assertThat( - $actual, - new LogicalNot(new IsType(IsType::TYPE_ITERABLE)), - $message - ); - } - - /** - * Asserts that a string matches a given regular expression. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertMatchesRegularExpression(string $pattern, string $string, string $message = ''): void - { - static::assertThat($string, new RegularExpression($pattern), $message); - } - - /** - * Asserts that a string matches a given regular expression. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @codeCoverageIgnore - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4086 - */ - public static function assertRegExp(string $pattern, string $string, string $message = ''): void - { - self::createWarning('assertRegExp() is deprecated and will be removed in PHPUnit 10. Refactor your code to use assertMatchesRegularExpression() instead.'); - - static::assertThat($string, new RegularExpression($pattern), $message); - } - - /** - * Asserts that a string does not match a given regular expression. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertDoesNotMatchRegularExpression(string $pattern, string $string, string $message = ''): void - { - static::assertThat( - $string, - new LogicalNot( - new RegularExpression($pattern) - ), - $message - ); - } - - /** - * Asserts that a string does not match a given regular expression. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @codeCoverageIgnore - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4089 - */ - public static function assertNotRegExp(string $pattern, string $string, string $message = ''): void - { - self::createWarning('assertNotRegExp() is deprecated and will be removed in PHPUnit 10. Refactor your code to use assertDoesNotMatchRegularExpression() instead.'); - - static::assertThat( - $string, - new LogicalNot( - new RegularExpression($pattern) - ), - $message - ); - } - - /** - * Assert that the size of two arrays (or `Countable` or `Traversable` objects) - * is the same. - * - * @param Countable|iterable $expected - * @param Countable|iterable $actual - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - public static function assertSameSize($expected, $actual, string $message = ''): void - { - if (!$expected instanceof Countable && !is_iterable($expected)) { - throw InvalidArgumentException::create(1, 'countable or iterable'); - } - - if (!$actual instanceof Countable && !is_iterable($actual)) { - throw InvalidArgumentException::create(2, 'countable or iterable'); - } - - static::assertThat( - $actual, - new SameSize($expected), - $message - ); - } - - /** - * Assert that the size of two arrays (or `Countable` or `Traversable` objects) - * is not the same. - * - * @param Countable|iterable $expected - * @param Countable|iterable $actual - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - public static function assertNotSameSize($expected, $actual, string $message = ''): void - { - if (!$expected instanceof Countable && !is_iterable($expected)) { - throw InvalidArgumentException::create(1, 'countable or iterable'); - } - - if (!$actual instanceof Countable && !is_iterable($actual)) { - throw InvalidArgumentException::create(2, 'countable or iterable'); - } - - static::assertThat( - $actual, - new LogicalNot( - new SameSize($expected) - ), - $message - ); - } - - /** - * Asserts that a string matches a given format string. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertStringMatchesFormat(string $format, string $string, string $message = ''): void - { - static::assertThat($string, new StringMatchesFormatDescription($format), $message); - } - - /** - * Asserts that a string does not match a given format string. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertStringNotMatchesFormat(string $format, string $string, string $message = ''): void - { - static::assertThat( - $string, - new LogicalNot( - new StringMatchesFormatDescription($format) - ), - $message - ); - } - - /** - * Asserts that a string matches a given format file. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertStringMatchesFormatFile(string $formatFile, string $string, string $message = ''): void - { - static::assertFileExists($formatFile, $message); - - static::assertThat( - $string, - new StringMatchesFormatDescription( - file_get_contents($formatFile) - ), - $message - ); - } - - /** - * Asserts that a string does not match a given format string. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertStringNotMatchesFormatFile(string $formatFile, string $string, string $message = ''): void - { - static::assertFileExists($formatFile, $message); - - static::assertThat( - $string, - new LogicalNot( - new StringMatchesFormatDescription( - file_get_contents($formatFile) - ) - ), - $message - ); - } - - /** - * Asserts that a string starts with a given prefix. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertStringStartsWith(string $prefix, string $string, string $message = ''): void - { - static::assertThat($string, new StringStartsWith($prefix), $message); - } - - /** - * Asserts that a string starts not with a given prefix. - * - * @param string $prefix - * @param string $string - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertStringStartsNotWith($prefix, $string, string $message = ''): void - { - static::assertThat( - $string, - new LogicalNot( - new StringStartsWith($prefix) - ), - $message - ); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertStringContainsString(string $needle, string $haystack, string $message = ''): void - { - $constraint = new StringContains($needle, false); - - static::assertThat($haystack, $constraint, $message); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertStringContainsStringIgnoringCase(string $needle, string $haystack, string $message = ''): void - { - $constraint = new StringContains($needle, true); - - static::assertThat($haystack, $constraint, $message); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertStringNotContainsString(string $needle, string $haystack, string $message = ''): void - { - $constraint = new LogicalNot(new StringContains($needle)); - - static::assertThat($haystack, $constraint, $message); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertStringNotContainsStringIgnoringCase(string $needle, string $haystack, string $message = ''): void - { - $constraint = new LogicalNot(new StringContains($needle, true)); - - static::assertThat($haystack, $constraint, $message); - } - - /** - * Asserts that a string ends with a given suffix. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertStringEndsWith(string $suffix, string $string, string $message = ''): void - { - static::assertThat($string, new StringEndsWith($suffix), $message); - } - - /** - * Asserts that a string ends not with a given suffix. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertStringEndsNotWith(string $suffix, string $string, string $message = ''): void - { - static::assertThat( - $string, - new LogicalNot( - new StringEndsWith($suffix) - ), - $message - ); - } - - /** - * Asserts that two XML files are equal. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - public static function assertXmlFileEqualsXmlFile(string $expectedFile, string $actualFile, string $message = ''): void - { - $expected = (new XmlLoader)->loadFile($expectedFile); - $actual = (new XmlLoader)->loadFile($actualFile); - - static::assertEquals($expected, $actual, $message); - } - - /** - * Asserts that two XML files are not equal. - * - * @throws \PHPUnit\Util\Exception - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertXmlFileNotEqualsXmlFile(string $expectedFile, string $actualFile, string $message = ''): void - { - $expected = (new XmlLoader)->loadFile($expectedFile); - $actual = (new XmlLoader)->loadFile($actualFile); - - static::assertNotEquals($expected, $actual, $message); - } - - /** - * Asserts that two XML documents are equal. - * - * @param DOMDocument|string $actualXml - * - * @throws \PHPUnit\Util\Xml\Exception - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertXmlStringEqualsXmlFile(string $expectedFile, $actualXml, string $message = ''): void - { - if (!is_string($actualXml)) { - self::createWarning('Passing an argument of type DOMDocument for the $actualXml parameter is deprecated. Support for this will be removed in PHPUnit 10.'); - - $actual = $actualXml; - } else { - $actual = (new XmlLoader)->load($actualXml); - } - - $expected = (new XmlLoader)->loadFile($expectedFile); - - static::assertEquals($expected, $actual, $message); - } - - /** - * Asserts that two XML documents are not equal. - * - * @param DOMDocument|string $actualXml - * - * @throws \PHPUnit\Util\Xml\Exception - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertXmlStringNotEqualsXmlFile(string $expectedFile, $actualXml, string $message = ''): void - { - if (!is_string($actualXml)) { - self::createWarning('Passing an argument of type DOMDocument for the $actualXml parameter is deprecated. Support for this will be removed in PHPUnit 10.'); - - $actual = $actualXml; - } else { - $actual = (new XmlLoader)->load($actualXml); - } - - $expected = (new XmlLoader)->loadFile($expectedFile); - - static::assertNotEquals($expected, $actual, $message); - } - - /** - * Asserts that two XML documents are equal. - * - * @param DOMDocument|string $expectedXml - * @param DOMDocument|string $actualXml - * - * @throws \PHPUnit\Util\Xml\Exception - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertXmlStringEqualsXmlString($expectedXml, $actualXml, string $message = ''): void - { - if (!is_string($expectedXml)) { - self::createWarning('Passing an argument of type DOMDocument for the $expectedXml parameter is deprecated. Support for this will be removed in PHPUnit 10.'); - - $expected = $expectedXml; - } else { - $expected = (new XmlLoader)->load($expectedXml); - } - - if (!is_string($actualXml)) { - self::createWarning('Passing an argument of type DOMDocument for the $actualXml parameter is deprecated. Support for this will be removed in PHPUnit 10.'); - - $actual = $actualXml; - } else { - $actual = (new XmlLoader)->load($actualXml); - } - - static::assertEquals($expected, $actual, $message); - } - - /** - * Asserts that two XML documents are not equal. - * - * @param DOMDocument|string $expectedXml - * @param DOMDocument|string $actualXml - * - * @throws \PHPUnit\Util\Xml\Exception - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertXmlStringNotEqualsXmlString($expectedXml, $actualXml, string $message = ''): void - { - if (!is_string($expectedXml)) { - self::createWarning('Passing an argument of type DOMDocument for the $expectedXml parameter is deprecated. Support for this will be removed in PHPUnit 10.'); - - $expected = $expectedXml; - } else { - $expected = (new XmlLoader)->load($expectedXml); - } - - if (!is_string($actualXml)) { - self::createWarning('Passing an argument of type DOMDocument for the $actualXml parameter is deprecated. Support for this will be removed in PHPUnit 10.'); - - $actual = $actualXml; - } else { - $actual = (new XmlLoader)->load($actualXml); - } - - static::assertNotEquals($expected, $actual, $message); - } - - /** - * Asserts that a hierarchy of DOMElements matches. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws AssertionFailedError - * @throws ExpectationFailedException - * - * @codeCoverageIgnore - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4091 - */ - public static function assertEqualXMLStructure(DOMElement $expectedElement, DOMElement $actualElement, bool $checkAttributes = false, string $message = ''): void - { - self::createWarning('assertEqualXMLStructure() is deprecated and will be removed in PHPUnit 10.'); - - $expectedElement = Xml::import($expectedElement); - $actualElement = Xml::import($actualElement); - - static::assertSame( - $expectedElement->tagName, - $actualElement->tagName, - $message - ); - - if ($checkAttributes) { - static::assertSame( - $expectedElement->attributes->length, - $actualElement->attributes->length, - sprintf( - '%s%sNumber of attributes on node "%s" does not match', - $message, - !empty($message) ? "\n" : '', - $expectedElement->tagName - ) - ); - - for ($i = 0; $i < $expectedElement->attributes->length; $i++) { - $expectedAttribute = $expectedElement->attributes->item($i); - $actualAttribute = $actualElement->attributes->getNamedItem($expectedAttribute->name); - - assert($expectedAttribute instanceof DOMAttr); - - if (!$actualAttribute) { - static::fail( - sprintf( - '%s%sCould not find attribute "%s" on node "%s"', - $message, - !empty($message) ? "\n" : '', - $expectedAttribute->name, - $expectedElement->tagName - ) - ); - } - } - } - - Xml::removeCharacterDataNodes($expectedElement); - Xml::removeCharacterDataNodes($actualElement); - - static::assertSame( - $expectedElement->childNodes->length, - $actualElement->childNodes->length, - sprintf( - '%s%sNumber of child nodes of "%s" differs', - $message, - !empty($message) ? "\n" : '', - $expectedElement->tagName - ) - ); - - for ($i = 0; $i < $expectedElement->childNodes->length; $i++) { - static::assertEqualXMLStructure( - $expectedElement->childNodes->item($i), - $actualElement->childNodes->item($i), - $checkAttributes, - $message - ); - } - } - - /** - * Evaluates a PHPUnit\Framework\Constraint matcher object. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertThat($value, Constraint $constraint, string $message = ''): void - { - self::$count += count($constraint); - - $constraint->evaluate($value, $message); - } - - /** - * Asserts that a string is a valid JSON string. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertJson(string $actualJson, string $message = ''): void - { - static::assertThat($actualJson, static::isJson(), $message); - } - - /** - * Asserts that two given JSON encoded objects or arrays are equal. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertJsonStringEqualsJsonString(string $expectedJson, string $actualJson, string $message = ''): void - { - static::assertJson($expectedJson, $message); - static::assertJson($actualJson, $message); - - static::assertThat($actualJson, new JsonMatches($expectedJson), $message); - } - - /** - * Asserts that two given JSON encoded objects or arrays are not equal. - * - * @param string $expectedJson - * @param string $actualJson - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertJsonStringNotEqualsJsonString($expectedJson, $actualJson, string $message = ''): void - { - static::assertJson($expectedJson, $message); - static::assertJson($actualJson, $message); - - static::assertThat( - $actualJson, - new LogicalNot( - new JsonMatches($expectedJson) - ), - $message - ); - } - - /** - * Asserts that the generated JSON encoded object and the content of the given file are equal. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertJsonStringEqualsJsonFile(string $expectedFile, string $actualJson, string $message = ''): void - { - static::assertFileExists($expectedFile, $message); - $expectedJson = file_get_contents($expectedFile); - - static::assertJson($expectedJson, $message); - static::assertJson($actualJson, $message); - - static::assertThat($actualJson, new JsonMatches($expectedJson), $message); - } - - /** - * Asserts that the generated JSON encoded object and the content of the given file are not equal. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertJsonStringNotEqualsJsonFile(string $expectedFile, string $actualJson, string $message = ''): void - { - static::assertFileExists($expectedFile, $message); - $expectedJson = file_get_contents($expectedFile); - - static::assertJson($expectedJson, $message); - static::assertJson($actualJson, $message); - - static::assertThat( - $actualJson, - new LogicalNot( - new JsonMatches($expectedJson) - ), - $message - ); - } - - /** - * Asserts that two JSON files are equal. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertJsonFileEqualsJsonFile(string $expectedFile, string $actualFile, string $message = ''): void - { - static::assertFileExists($expectedFile, $message); - static::assertFileExists($actualFile, $message); - - $actualJson = file_get_contents($actualFile); - $expectedJson = file_get_contents($expectedFile); - - static::assertJson($expectedJson, $message); - static::assertJson($actualJson, $message); - - $constraintExpected = new JsonMatches( - $expectedJson - ); - - $constraintActual = new JsonMatches($actualJson); - - static::assertThat($expectedJson, $constraintActual, $message); - static::assertThat($actualJson, $constraintExpected, $message); - } - - /** - * Asserts that two JSON files are not equal. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public static function assertJsonFileNotEqualsJsonFile(string $expectedFile, string $actualFile, string $message = ''): void - { - static::assertFileExists($expectedFile, $message); - static::assertFileExists($actualFile, $message); - - $actualJson = file_get_contents($actualFile); - $expectedJson = file_get_contents($expectedFile); - - static::assertJson($expectedJson, $message); - static::assertJson($actualJson, $message); - - $constraintExpected = new JsonMatches( - $expectedJson - ); - - $constraintActual = new JsonMatches($actualJson); - - static::assertThat($expectedJson, new LogicalNot($constraintActual), $message); - static::assertThat($actualJson, new LogicalNot($constraintExpected), $message); - } - - /** - * @throws Exception - */ - public static function logicalAnd(): LogicalAnd - { - $constraints = func_get_args(); - - $constraint = new LogicalAnd; - $constraint->setConstraints($constraints); - - return $constraint; - } - - public static function logicalOr(): LogicalOr - { - $constraints = func_get_args(); - - $constraint = new LogicalOr; - $constraint->setConstraints($constraints); - - return $constraint; - } - - public static function logicalNot(Constraint $constraint): LogicalNot - { - return new LogicalNot($constraint); - } - - public static function logicalXor(): LogicalXor - { - $constraints = func_get_args(); - - $constraint = new LogicalXor; - $constraint->setConstraints($constraints); - - return $constraint; - } - - public static function anything(): IsAnything - { - return new IsAnything; - } - - public static function isTrue(): IsTrue - { - return new IsTrue; - } - - /** - * @psalm-template CallbackInput of mixed - * - * @psalm-param callable(CallbackInput $callback): bool $callback - * - * @psalm-return Callback - */ - public static function callback(callable $callback): Callback - { - return new Callback($callback); - } - - public static function isFalse(): IsFalse - { - return new IsFalse; - } - - public static function isJson(): IsJson - { - return new IsJson; - } - - public static function isNull(): IsNull - { - return new IsNull; - } - - public static function isFinite(): IsFinite - { - return new IsFinite; - } - - public static function isInfinite(): IsInfinite - { - return new IsInfinite; - } - - public static function isNan(): IsNan - { - return new IsNan; - } - - public static function containsEqual($value): TraversableContainsEqual - { - return new TraversableContainsEqual($value); - } - - public static function containsIdentical($value): TraversableContainsIdentical - { - return new TraversableContainsIdentical($value); - } - - public static function containsOnly(string $type): TraversableContainsOnly - { - return new TraversableContainsOnly($type); - } - - public static function containsOnlyInstancesOf(string $className): TraversableContainsOnly - { - return new TraversableContainsOnly($className, false); - } - - /** - * @param int|string $key - */ - public static function arrayHasKey($key): ArrayHasKey - { - return new ArrayHasKey($key); - } - - public static function equalTo($value): IsEqual - { - return new IsEqual($value, 0.0, false, false); - } - - public static function equalToCanonicalizing($value): IsEqualCanonicalizing - { - return new IsEqualCanonicalizing($value); - } - - public static function equalToIgnoringCase($value): IsEqualIgnoringCase - { - return new IsEqualIgnoringCase($value); - } - - public static function equalToWithDelta($value, float $delta): IsEqualWithDelta - { - return new IsEqualWithDelta($value, $delta); - } - - public static function isEmpty(): IsEmpty - { - return new IsEmpty; - } - - public static function isWritable(): IsWritable - { - return new IsWritable; - } - - public static function isReadable(): IsReadable - { - return new IsReadable; - } - - public static function directoryExists(): DirectoryExists - { - return new DirectoryExists; - } - - public static function fileExists(): FileExists - { - return new FileExists; - } - - public static function greaterThan($value): GreaterThan - { - return new GreaterThan($value); - } - - public static function greaterThanOrEqual($value): LogicalOr - { - return static::logicalOr( - new IsEqual($value), - new GreaterThan($value) - ); - } - - public static function classHasAttribute(string $attributeName): ClassHasAttribute - { - return new ClassHasAttribute($attributeName); - } - - public static function classHasStaticAttribute(string $attributeName): ClassHasStaticAttribute - { - return new ClassHasStaticAttribute($attributeName); - } - - public static function objectHasAttribute($attributeName): ObjectHasAttribute - { - return new ObjectHasAttribute($attributeName); - } - - public static function identicalTo($value): IsIdentical - { - return new IsIdentical($value); - } - - public static function isInstanceOf(string $className): IsInstanceOf - { - return new IsInstanceOf($className); - } - - public static function isType(string $type): IsType - { - return new IsType($type); - } - - public static function lessThan($value): LessThan - { - return new LessThan($value); - } - - public static function lessThanOrEqual($value): LogicalOr - { - return static::logicalOr( - new IsEqual($value), - new LessThan($value) - ); - } - - public static function matchesRegularExpression(string $pattern): RegularExpression - { - return new RegularExpression($pattern); - } - - public static function matches(string $string): StringMatchesFormatDescription - { - return new StringMatchesFormatDescription($string); - } - - public static function stringStartsWith($prefix): StringStartsWith - { - return new StringStartsWith($prefix); - } - - public static function stringContains(string $string, bool $case = true): StringContains - { - return new StringContains($string, $case); - } - - public static function stringEndsWith(string $suffix): StringEndsWith - { - return new StringEndsWith($suffix); - } - - public static function countOf(int $count): Count - { - return new Count($count); - } - - public static function objectEquals(object $object, string $method = 'equals'): ObjectEquals - { - return new ObjectEquals($object, $method); - } - - /** - * Fails a test with the given message. - * - * @throws AssertionFailedError - * - * @psalm-return never-return - */ - public static function fail(string $message = ''): void - { - self::$count++; - - throw new AssertionFailedError($message); - } - - /** - * Mark the test as incomplete. - * - * @throws IncompleteTestError - * - * @psalm-return never-return - */ - public static function markTestIncomplete(string $message = ''): void - { - throw new IncompleteTestError($message); - } - - /** - * Mark the test as skipped. - * - * @throws SkippedTestError - * @throws SyntheticSkippedError - * - * @psalm-return never-return - */ - public static function markTestSkipped(string $message = ''): void - { - if ($hint = self::detectLocationHint($message)) { - $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); - array_unshift($trace, $hint); - - throw new SyntheticSkippedError($hint['message'], 0, $hint['file'], (int) $hint['line'], $trace); - } - - throw new SkippedTestError($message); - } - - /** - * Return the current assertion count. - */ - public static function getCount(): int - { - return self::$count; - } - - /** - * Reset the assertion counter. - */ - public static function resetCount(): void - { - self::$count = 0; - } - - private static function detectLocationHint(string $message): ?array - { - $hint = null; - $lines = preg_split('/\r\n|\r|\n/', $message); - - while (strpos($lines[0], '__OFFSET') !== false) { - $offset = explode('=', array_shift($lines)); - - if ($offset[0] === '__OFFSET_FILE') { - $hint['file'] = $offset[1]; - } - - if ($offset[0] === '__OFFSET_LINE') { - $hint['line'] = $offset[1]; - } - } - - if ($hint) { - $hint['message'] = implode(PHP_EOL, $lines); - } - - return $hint; - } - - private static function isValidObjectAttributeName(string $attributeName): bool - { - return (bool) preg_match('/[^\x00-\x1f\x7f-\x9f]+/', $attributeName); - } - - private static function isValidClassAttributeName(string $attributeName): bool - { - return (bool) preg_match('/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/', $attributeName); - } - - /** - * @codeCoverageIgnore - */ - private static function createWarning(string $warning): void - { - foreach (debug_backtrace() as $step) { - if (isset($step['object']) && $step['object'] instanceof TestCase) { - assert($step['object'] instanceof TestCase); - - $step['object']->addWarning($warning); - - break; - } - } - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Assert/Functions.php b/vendor/phpunit/phpunit/src/Framework/Assert/Functions.php deleted file mode 100644 index 5b8c50ed..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Assert/Functions.php +++ /dev/null @@ -1,3042 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -use function func_get_args; -use function function_exists; -use ArrayAccess; -use Countable; -use DOMDocument; -use DOMElement; -use PHPUnit\Framework\Constraint\ArrayHasKey; -use PHPUnit\Framework\Constraint\Callback; -use PHPUnit\Framework\Constraint\ClassHasAttribute; -use PHPUnit\Framework\Constraint\ClassHasStaticAttribute; -use PHPUnit\Framework\Constraint\Constraint; -use PHPUnit\Framework\Constraint\Count; -use PHPUnit\Framework\Constraint\DirectoryExists; -use PHPUnit\Framework\Constraint\FileExists; -use PHPUnit\Framework\Constraint\GreaterThan; -use PHPUnit\Framework\Constraint\IsAnything; -use PHPUnit\Framework\Constraint\IsEmpty; -use PHPUnit\Framework\Constraint\IsEqual; -use PHPUnit\Framework\Constraint\IsEqualCanonicalizing; -use PHPUnit\Framework\Constraint\IsEqualIgnoringCase; -use PHPUnit\Framework\Constraint\IsEqualWithDelta; -use PHPUnit\Framework\Constraint\IsFalse; -use PHPUnit\Framework\Constraint\IsFinite; -use PHPUnit\Framework\Constraint\IsIdentical; -use PHPUnit\Framework\Constraint\IsInfinite; -use PHPUnit\Framework\Constraint\IsInstanceOf; -use PHPUnit\Framework\Constraint\IsJson; -use PHPUnit\Framework\Constraint\IsNan; -use PHPUnit\Framework\Constraint\IsNull; -use PHPUnit\Framework\Constraint\IsReadable; -use PHPUnit\Framework\Constraint\IsTrue; -use PHPUnit\Framework\Constraint\IsType; -use PHPUnit\Framework\Constraint\IsWritable; -use PHPUnit\Framework\Constraint\LessThan; -use PHPUnit\Framework\Constraint\LogicalAnd; -use PHPUnit\Framework\Constraint\LogicalNot; -use PHPUnit\Framework\Constraint\LogicalOr; -use PHPUnit\Framework\Constraint\LogicalXor; -use PHPUnit\Framework\Constraint\ObjectEquals; -use PHPUnit\Framework\Constraint\ObjectHasAttribute; -use PHPUnit\Framework\Constraint\RegularExpression; -use PHPUnit\Framework\Constraint\StringContains; -use PHPUnit\Framework\Constraint\StringEndsWith; -use PHPUnit\Framework\Constraint\StringMatchesFormatDescription; -use PHPUnit\Framework\Constraint\StringStartsWith; -use PHPUnit\Framework\Constraint\TraversableContainsEqual; -use PHPUnit\Framework\Constraint\TraversableContainsIdentical; -use PHPUnit\Framework\Constraint\TraversableContainsOnly; -use PHPUnit\Framework\MockObject\Rule\AnyInvokedCount as AnyInvokedCountMatcher; -use PHPUnit\Framework\MockObject\Rule\InvokedAtIndex as InvokedAtIndexMatcher; -use PHPUnit\Framework\MockObject\Rule\InvokedAtLeastCount as InvokedAtLeastCountMatcher; -use PHPUnit\Framework\MockObject\Rule\InvokedAtLeastOnce as InvokedAtLeastOnceMatcher; -use PHPUnit\Framework\MockObject\Rule\InvokedAtMostCount as InvokedAtMostCountMatcher; -use PHPUnit\Framework\MockObject\Rule\InvokedCount as InvokedCountMatcher; -use PHPUnit\Framework\MockObject\Stub\ConsecutiveCalls as ConsecutiveCallsStub; -use PHPUnit\Framework\MockObject\Stub\Exception as ExceptionStub; -use PHPUnit\Framework\MockObject\Stub\ReturnArgument as ReturnArgumentStub; -use PHPUnit\Framework\MockObject\Stub\ReturnCallback as ReturnCallbackStub; -use PHPUnit\Framework\MockObject\Stub\ReturnSelf as ReturnSelfStub; -use PHPUnit\Framework\MockObject\Stub\ReturnStub; -use PHPUnit\Framework\MockObject\Stub\ReturnValueMap as ReturnValueMapStub; -use Throwable; - -if (!function_exists('PHPUnit\Framework\assertArrayHasKey')) { - /** - * Asserts that an array has a specified key. - * - * @param int|string $key - * @param array|ArrayAccess $array - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertArrayHasKey - */ - function assertArrayHasKey($key, $array, string $message = ''): void - { - Assert::assertArrayHasKey(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertArrayNotHasKey')) { - /** - * Asserts that an array does not have a specified key. - * - * @param int|string $key - * @param array|ArrayAccess $array - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertArrayNotHasKey - */ - function assertArrayNotHasKey($key, $array, string $message = ''): void - { - Assert::assertArrayNotHasKey(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertContains')) { - /** - * Asserts that a haystack contains a needle. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertContains - */ - function assertContains($needle, iterable $haystack, string $message = ''): void - { - Assert::assertContains(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertContainsEquals')) { - function assertContainsEquals($needle, iterable $haystack, string $message = ''): void - { - Assert::assertContainsEquals(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotContains')) { - /** - * Asserts that a haystack does not contain a needle. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertNotContains - */ - function assertNotContains($needle, iterable $haystack, string $message = ''): void - { - Assert::assertNotContains(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotContainsEquals')) { - function assertNotContainsEquals($needle, iterable $haystack, string $message = ''): void - { - Assert::assertNotContainsEquals(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertContainsOnly')) { - /** - * Asserts that a haystack contains only values of a given type. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertContainsOnly - */ - function assertContainsOnly(string $type, iterable $haystack, ?bool $isNativeType = null, string $message = ''): void - { - Assert::assertContainsOnly(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertContainsOnlyInstancesOf')) { - /** - * Asserts that a haystack contains only instances of a given class name. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertContainsOnlyInstancesOf - */ - function assertContainsOnlyInstancesOf(string $className, iterable $haystack, string $message = ''): void - { - Assert::assertContainsOnlyInstancesOf(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotContainsOnly')) { - /** - * Asserts that a haystack does not contain only values of a given type. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertNotContainsOnly - */ - function assertNotContainsOnly(string $type, iterable $haystack, ?bool $isNativeType = null, string $message = ''): void - { - Assert::assertNotContainsOnly(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertCount')) { - /** - * Asserts the number of elements of an array, Countable or Traversable. - * - * @param Countable|iterable $haystack - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertCount - */ - function assertCount(int $expectedCount, $haystack, string $message = ''): void - { - Assert::assertCount(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotCount')) { - /** - * Asserts the number of elements of an array, Countable or Traversable. - * - * @param Countable|iterable $haystack - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertNotCount - */ - function assertNotCount(int $expectedCount, $haystack, string $message = ''): void - { - Assert::assertNotCount(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertEquals')) { - /** - * Asserts that two variables are equal. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertEquals - */ - function assertEquals($expected, $actual, string $message = ''): void - { - Assert::assertEquals(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertEqualsCanonicalizing')) { - /** - * Asserts that two variables are equal (canonicalizing). - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertEqualsCanonicalizing - */ - function assertEqualsCanonicalizing($expected, $actual, string $message = ''): void - { - Assert::assertEqualsCanonicalizing(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertEqualsIgnoringCase')) { - /** - * Asserts that two variables are equal (ignoring case). - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertEqualsIgnoringCase - */ - function assertEqualsIgnoringCase($expected, $actual, string $message = ''): void - { - Assert::assertEqualsIgnoringCase(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertEqualsWithDelta')) { - /** - * Asserts that two variables are equal (with delta). - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertEqualsWithDelta - */ - function assertEqualsWithDelta($expected, $actual, float $delta, string $message = ''): void - { - Assert::assertEqualsWithDelta(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotEquals')) { - /** - * Asserts that two variables are not equal. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertNotEquals - */ - function assertNotEquals($expected, $actual, string $message = ''): void - { - Assert::assertNotEquals(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotEqualsCanonicalizing')) { - /** - * Asserts that two variables are not equal (canonicalizing). - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertNotEqualsCanonicalizing - */ - function assertNotEqualsCanonicalizing($expected, $actual, string $message = ''): void - { - Assert::assertNotEqualsCanonicalizing(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotEqualsIgnoringCase')) { - /** - * Asserts that two variables are not equal (ignoring case). - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertNotEqualsIgnoringCase - */ - function assertNotEqualsIgnoringCase($expected, $actual, string $message = ''): void - { - Assert::assertNotEqualsIgnoringCase(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotEqualsWithDelta')) { - /** - * Asserts that two variables are not equal (with delta). - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertNotEqualsWithDelta - */ - function assertNotEqualsWithDelta($expected, $actual, float $delta, string $message = ''): void - { - Assert::assertNotEqualsWithDelta(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertObjectEquals')) { - /** - * @throws ExpectationFailedException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertObjectEquals - */ - function assertObjectEquals(object $expected, object $actual, string $method = 'equals', string $message = ''): void - { - Assert::assertObjectEquals(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertEmpty')) { - /** - * Asserts that a variable is empty. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @psalm-assert empty $actual - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertEmpty - */ - function assertEmpty($actual, string $message = ''): void - { - Assert::assertEmpty(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotEmpty')) { - /** - * Asserts that a variable is not empty. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @psalm-assert !empty $actual - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertNotEmpty - */ - function assertNotEmpty($actual, string $message = ''): void - { - Assert::assertNotEmpty(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertGreaterThan')) { - /** - * Asserts that a value is greater than another value. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertGreaterThan - */ - function assertGreaterThan($expected, $actual, string $message = ''): void - { - Assert::assertGreaterThan(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertGreaterThanOrEqual')) { - /** - * Asserts that a value is greater than or equal to another value. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertGreaterThanOrEqual - */ - function assertGreaterThanOrEqual($expected, $actual, string $message = ''): void - { - Assert::assertGreaterThanOrEqual(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertLessThan')) { - /** - * Asserts that a value is smaller than another value. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertLessThan - */ - function assertLessThan($expected, $actual, string $message = ''): void - { - Assert::assertLessThan(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertLessThanOrEqual')) { - /** - * Asserts that a value is smaller than or equal to another value. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertLessThanOrEqual - */ - function assertLessThanOrEqual($expected, $actual, string $message = ''): void - { - Assert::assertLessThanOrEqual(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertFileEquals')) { - /** - * Asserts that the contents of one file is equal to the contents of another - * file. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertFileEquals - */ - function assertFileEquals(string $expected, string $actual, string $message = ''): void - { - Assert::assertFileEquals(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertFileEqualsCanonicalizing')) { - /** - * Asserts that the contents of one file is equal to the contents of another - * file (canonicalizing). - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertFileEqualsCanonicalizing - */ - function assertFileEqualsCanonicalizing(string $expected, string $actual, string $message = ''): void - { - Assert::assertFileEqualsCanonicalizing(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertFileEqualsIgnoringCase')) { - /** - * Asserts that the contents of one file is equal to the contents of another - * file (ignoring case). - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertFileEqualsIgnoringCase - */ - function assertFileEqualsIgnoringCase(string $expected, string $actual, string $message = ''): void - { - Assert::assertFileEqualsIgnoringCase(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertFileNotEquals')) { - /** - * Asserts that the contents of one file is not equal to the contents of - * another file. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertFileNotEquals - */ - function assertFileNotEquals(string $expected, string $actual, string $message = ''): void - { - Assert::assertFileNotEquals(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertFileNotEqualsCanonicalizing')) { - /** - * Asserts that the contents of one file is not equal to the contents of another - * file (canonicalizing). - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertFileNotEqualsCanonicalizing - */ - function assertFileNotEqualsCanonicalizing(string $expected, string $actual, string $message = ''): void - { - Assert::assertFileNotEqualsCanonicalizing(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertFileNotEqualsIgnoringCase')) { - /** - * Asserts that the contents of one file is not equal to the contents of another - * file (ignoring case). - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertFileNotEqualsIgnoringCase - */ - function assertFileNotEqualsIgnoringCase(string $expected, string $actual, string $message = ''): void - { - Assert::assertFileNotEqualsIgnoringCase(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertStringEqualsFile')) { - /** - * Asserts that the contents of a string is equal - * to the contents of a file. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertStringEqualsFile - */ - function assertStringEqualsFile(string $expectedFile, string $actualString, string $message = ''): void - { - Assert::assertStringEqualsFile(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertStringEqualsFileCanonicalizing')) { - /** - * Asserts that the contents of a string is equal - * to the contents of a file (canonicalizing). - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertStringEqualsFileCanonicalizing - */ - function assertStringEqualsFileCanonicalizing(string $expectedFile, string $actualString, string $message = ''): void - { - Assert::assertStringEqualsFileCanonicalizing(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertStringEqualsFileIgnoringCase')) { - /** - * Asserts that the contents of a string is equal - * to the contents of a file (ignoring case). - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertStringEqualsFileIgnoringCase - */ - function assertStringEqualsFileIgnoringCase(string $expectedFile, string $actualString, string $message = ''): void - { - Assert::assertStringEqualsFileIgnoringCase(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertStringNotEqualsFile')) { - /** - * Asserts that the contents of a string is not equal - * to the contents of a file. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertStringNotEqualsFile - */ - function assertStringNotEqualsFile(string $expectedFile, string $actualString, string $message = ''): void - { - Assert::assertStringNotEqualsFile(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertStringNotEqualsFileCanonicalizing')) { - /** - * Asserts that the contents of a string is not equal - * to the contents of a file (canonicalizing). - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertStringNotEqualsFileCanonicalizing - */ - function assertStringNotEqualsFileCanonicalizing(string $expectedFile, string $actualString, string $message = ''): void - { - Assert::assertStringNotEqualsFileCanonicalizing(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertStringNotEqualsFileIgnoringCase')) { - /** - * Asserts that the contents of a string is not equal - * to the contents of a file (ignoring case). - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertStringNotEqualsFileIgnoringCase - */ - function assertStringNotEqualsFileIgnoringCase(string $expectedFile, string $actualString, string $message = ''): void - { - Assert::assertStringNotEqualsFileIgnoringCase(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsReadable')) { - /** - * Asserts that a file/dir is readable. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertIsReadable - */ - function assertIsReadable(string $filename, string $message = ''): void - { - Assert::assertIsReadable(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsNotReadable')) { - /** - * Asserts that a file/dir exists and is not readable. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertIsNotReadable - */ - function assertIsNotReadable(string $filename, string $message = ''): void - { - Assert::assertIsNotReadable(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotIsReadable')) { - /** - * Asserts that a file/dir exists and is not readable. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @codeCoverageIgnore - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4062 - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertNotIsReadable - */ - function assertNotIsReadable(string $filename, string $message = ''): void - { - Assert::assertNotIsReadable(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsWritable')) { - /** - * Asserts that a file/dir exists and is writable. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertIsWritable - */ - function assertIsWritable(string $filename, string $message = ''): void - { - Assert::assertIsWritable(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsNotWritable')) { - /** - * Asserts that a file/dir exists and is not writable. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertIsNotWritable - */ - function assertIsNotWritable(string $filename, string $message = ''): void - { - Assert::assertIsNotWritable(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotIsWritable')) { - /** - * Asserts that a file/dir exists and is not writable. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @codeCoverageIgnore - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4065 - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertNotIsWritable - */ - function assertNotIsWritable(string $filename, string $message = ''): void - { - Assert::assertNotIsWritable(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertDirectoryExists')) { - /** - * Asserts that a directory exists. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertDirectoryExists - */ - function assertDirectoryExists(string $directory, string $message = ''): void - { - Assert::assertDirectoryExists(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertDirectoryDoesNotExist')) { - /** - * Asserts that a directory does not exist. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertDirectoryDoesNotExist - */ - function assertDirectoryDoesNotExist(string $directory, string $message = ''): void - { - Assert::assertDirectoryDoesNotExist(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertDirectoryNotExists')) { - /** - * Asserts that a directory does not exist. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @codeCoverageIgnore - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4068 - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertDirectoryNotExists - */ - function assertDirectoryNotExists(string $directory, string $message = ''): void - { - Assert::assertDirectoryNotExists(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertDirectoryIsReadable')) { - /** - * Asserts that a directory exists and is readable. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertDirectoryIsReadable - */ - function assertDirectoryIsReadable(string $directory, string $message = ''): void - { - Assert::assertDirectoryIsReadable(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertDirectoryIsNotReadable')) { - /** - * Asserts that a directory exists and is not readable. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertDirectoryIsNotReadable - */ - function assertDirectoryIsNotReadable(string $directory, string $message = ''): void - { - Assert::assertDirectoryIsNotReadable(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertDirectoryNotIsReadable')) { - /** - * Asserts that a directory exists and is not readable. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @codeCoverageIgnore - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4071 - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertDirectoryNotIsReadable - */ - function assertDirectoryNotIsReadable(string $directory, string $message = ''): void - { - Assert::assertDirectoryNotIsReadable(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertDirectoryIsWritable')) { - /** - * Asserts that a directory exists and is writable. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertDirectoryIsWritable - */ - function assertDirectoryIsWritable(string $directory, string $message = ''): void - { - Assert::assertDirectoryIsWritable(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertDirectoryIsNotWritable')) { - /** - * Asserts that a directory exists and is not writable. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertDirectoryIsNotWritable - */ - function assertDirectoryIsNotWritable(string $directory, string $message = ''): void - { - Assert::assertDirectoryIsNotWritable(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertDirectoryNotIsWritable')) { - /** - * Asserts that a directory exists and is not writable. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @codeCoverageIgnore - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4074 - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertDirectoryNotIsWritable - */ - function assertDirectoryNotIsWritable(string $directory, string $message = ''): void - { - Assert::assertDirectoryNotIsWritable(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertFileExists')) { - /** - * Asserts that a file exists. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertFileExists - */ - function assertFileExists(string $filename, string $message = ''): void - { - Assert::assertFileExists(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertFileDoesNotExist')) { - /** - * Asserts that a file does not exist. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertFileDoesNotExist - */ - function assertFileDoesNotExist(string $filename, string $message = ''): void - { - Assert::assertFileDoesNotExist(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertFileNotExists')) { - /** - * Asserts that a file does not exist. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @codeCoverageIgnore - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4077 - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertFileNotExists - */ - function assertFileNotExists(string $filename, string $message = ''): void - { - Assert::assertFileNotExists(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertFileIsReadable')) { - /** - * Asserts that a file exists and is readable. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertFileIsReadable - */ - function assertFileIsReadable(string $file, string $message = ''): void - { - Assert::assertFileIsReadable(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertFileIsNotReadable')) { - /** - * Asserts that a file exists and is not readable. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertFileIsNotReadable - */ - function assertFileIsNotReadable(string $file, string $message = ''): void - { - Assert::assertFileIsNotReadable(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertFileNotIsReadable')) { - /** - * Asserts that a file exists and is not readable. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @codeCoverageIgnore - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4080 - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertFileNotIsReadable - */ - function assertFileNotIsReadable(string $file, string $message = ''): void - { - Assert::assertFileNotIsReadable(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertFileIsWritable')) { - /** - * Asserts that a file exists and is writable. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertFileIsWritable - */ - function assertFileIsWritable(string $file, string $message = ''): void - { - Assert::assertFileIsWritable(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertFileIsNotWritable')) { - /** - * Asserts that a file exists and is not writable. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertFileIsNotWritable - */ - function assertFileIsNotWritable(string $file, string $message = ''): void - { - Assert::assertFileIsNotWritable(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertFileNotIsWritable')) { - /** - * Asserts that a file exists and is not writable. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @codeCoverageIgnore - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4083 - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertFileNotIsWritable - */ - function assertFileNotIsWritable(string $file, string $message = ''): void - { - Assert::assertFileNotIsWritable(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertTrue')) { - /** - * Asserts that a condition is true. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @psalm-assert true $condition - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertTrue - */ - function assertTrue($condition, string $message = ''): void - { - Assert::assertTrue(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotTrue')) { - /** - * Asserts that a condition is not true. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @psalm-assert !true $condition - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertNotTrue - */ - function assertNotTrue($condition, string $message = ''): void - { - Assert::assertNotTrue(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertFalse')) { - /** - * Asserts that a condition is false. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @psalm-assert false $condition - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertFalse - */ - function assertFalse($condition, string $message = ''): void - { - Assert::assertFalse(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotFalse')) { - /** - * Asserts that a condition is not false. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @psalm-assert !false $condition - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertNotFalse - */ - function assertNotFalse($condition, string $message = ''): void - { - Assert::assertNotFalse(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNull')) { - /** - * Asserts that a variable is null. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @psalm-assert null $actual - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertNull - */ - function assertNull($actual, string $message = ''): void - { - Assert::assertNull(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotNull')) { - /** - * Asserts that a variable is not null. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @psalm-assert !null $actual - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertNotNull - */ - function assertNotNull($actual, string $message = ''): void - { - Assert::assertNotNull(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertFinite')) { - /** - * Asserts that a variable is finite. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertFinite - */ - function assertFinite($actual, string $message = ''): void - { - Assert::assertFinite(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertInfinite')) { - /** - * Asserts that a variable is infinite. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertInfinite - */ - function assertInfinite($actual, string $message = ''): void - { - Assert::assertInfinite(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNan')) { - /** - * Asserts that a variable is nan. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertNan - */ - function assertNan($actual, string $message = ''): void - { - Assert::assertNan(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertClassHasAttribute')) { - /** - * Asserts that a class has a specified attribute. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertClassHasAttribute - */ - function assertClassHasAttribute(string $attributeName, string $className, string $message = ''): void - { - Assert::assertClassHasAttribute(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertClassNotHasAttribute')) { - /** - * Asserts that a class does not have a specified attribute. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertClassNotHasAttribute - */ - function assertClassNotHasAttribute(string $attributeName, string $className, string $message = ''): void - { - Assert::assertClassNotHasAttribute(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertClassHasStaticAttribute')) { - /** - * Asserts that a class has a specified static attribute. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertClassHasStaticAttribute - */ - function assertClassHasStaticAttribute(string $attributeName, string $className, string $message = ''): void - { - Assert::assertClassHasStaticAttribute(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertClassNotHasStaticAttribute')) { - /** - * Asserts that a class does not have a specified static attribute. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertClassNotHasStaticAttribute - */ - function assertClassNotHasStaticAttribute(string $attributeName, string $className, string $message = ''): void - { - Assert::assertClassNotHasStaticAttribute(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertObjectHasAttribute')) { - /** - * Asserts that an object has a specified attribute. - * - * @param object $object - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertObjectHasAttribute - */ - function assertObjectHasAttribute(string $attributeName, $object, string $message = ''): void - { - Assert::assertObjectHasAttribute(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertObjectNotHasAttribute')) { - /** - * Asserts that an object does not have a specified attribute. - * - * @param object $object - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertObjectNotHasAttribute - */ - function assertObjectNotHasAttribute(string $attributeName, $object, string $message = ''): void - { - Assert::assertObjectNotHasAttribute(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertSame')) { - /** - * Asserts that two variables have the same type and value. - * Used on objects, it asserts that two variables reference - * the same object. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @psalm-template ExpectedType - * - * @psalm-param ExpectedType $expected - * - * @psalm-assert =ExpectedType $actual - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertSame - */ - function assertSame($expected, $actual, string $message = ''): void - { - Assert::assertSame(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotSame')) { - /** - * Asserts that two variables do not have the same type and value. - * Used on objects, it asserts that two variables do not reference - * the same object. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertNotSame - */ - function assertNotSame($expected, $actual, string $message = ''): void - { - Assert::assertNotSame(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertInstanceOf')) { - /** - * Asserts that a variable is of a given type. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * - * @psalm-template ExpectedType of object - * - * @psalm-param class-string $expected - * - * @psalm-assert =ExpectedType $actual - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertInstanceOf - */ - function assertInstanceOf(string $expected, $actual, string $message = ''): void - { - Assert::assertInstanceOf(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotInstanceOf')) { - /** - * Asserts that a variable is not of a given type. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * - * @psalm-template ExpectedType of object - * - * @psalm-param class-string $expected - * - * @psalm-assert !ExpectedType $actual - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertNotInstanceOf - */ - function assertNotInstanceOf(string $expected, $actual, string $message = ''): void - { - Assert::assertNotInstanceOf(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsArray')) { - /** - * Asserts that a variable is of type array. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @psalm-assert array $actual - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertIsArray - */ - function assertIsArray($actual, string $message = ''): void - { - Assert::assertIsArray(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsBool')) { - /** - * Asserts that a variable is of type bool. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @psalm-assert bool $actual - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertIsBool - */ - function assertIsBool($actual, string $message = ''): void - { - Assert::assertIsBool(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsFloat')) { - /** - * Asserts that a variable is of type float. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @psalm-assert float $actual - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertIsFloat - */ - function assertIsFloat($actual, string $message = ''): void - { - Assert::assertIsFloat(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsInt')) { - /** - * Asserts that a variable is of type int. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @psalm-assert int $actual - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertIsInt - */ - function assertIsInt($actual, string $message = ''): void - { - Assert::assertIsInt(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsNumeric')) { - /** - * Asserts that a variable is of type numeric. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @psalm-assert numeric $actual - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertIsNumeric - */ - function assertIsNumeric($actual, string $message = ''): void - { - Assert::assertIsNumeric(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsObject')) { - /** - * Asserts that a variable is of type object. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @psalm-assert object $actual - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertIsObject - */ - function assertIsObject($actual, string $message = ''): void - { - Assert::assertIsObject(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsResource')) { - /** - * Asserts that a variable is of type resource. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @psalm-assert resource $actual - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertIsResource - */ - function assertIsResource($actual, string $message = ''): void - { - Assert::assertIsResource(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsClosedResource')) { - /** - * Asserts that a variable is of type resource and is closed. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @psalm-assert resource $actual - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertIsClosedResource - */ - function assertIsClosedResource($actual, string $message = ''): void - { - Assert::assertIsClosedResource(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsString')) { - /** - * Asserts that a variable is of type string. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @psalm-assert string $actual - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertIsString - */ - function assertIsString($actual, string $message = ''): void - { - Assert::assertIsString(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsScalar')) { - /** - * Asserts that a variable is of type scalar. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @psalm-assert scalar $actual - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertIsScalar - */ - function assertIsScalar($actual, string $message = ''): void - { - Assert::assertIsScalar(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsCallable')) { - /** - * Asserts that a variable is of type callable. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @psalm-assert callable $actual - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertIsCallable - */ - function assertIsCallable($actual, string $message = ''): void - { - Assert::assertIsCallable(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsIterable')) { - /** - * Asserts that a variable is of type iterable. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @psalm-assert iterable $actual - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertIsIterable - */ - function assertIsIterable($actual, string $message = ''): void - { - Assert::assertIsIterable(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsNotArray')) { - /** - * Asserts that a variable is not of type array. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @psalm-assert !array $actual - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertIsNotArray - */ - function assertIsNotArray($actual, string $message = ''): void - { - Assert::assertIsNotArray(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsNotBool')) { - /** - * Asserts that a variable is not of type bool. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @psalm-assert !bool $actual - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertIsNotBool - */ - function assertIsNotBool($actual, string $message = ''): void - { - Assert::assertIsNotBool(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsNotFloat')) { - /** - * Asserts that a variable is not of type float. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @psalm-assert !float $actual - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertIsNotFloat - */ - function assertIsNotFloat($actual, string $message = ''): void - { - Assert::assertIsNotFloat(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsNotInt')) { - /** - * Asserts that a variable is not of type int. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @psalm-assert !int $actual - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertIsNotInt - */ - function assertIsNotInt($actual, string $message = ''): void - { - Assert::assertIsNotInt(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsNotNumeric')) { - /** - * Asserts that a variable is not of type numeric. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @psalm-assert !numeric $actual - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertIsNotNumeric - */ - function assertIsNotNumeric($actual, string $message = ''): void - { - Assert::assertIsNotNumeric(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsNotObject')) { - /** - * Asserts that a variable is not of type object. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @psalm-assert !object $actual - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertIsNotObject - */ - function assertIsNotObject($actual, string $message = ''): void - { - Assert::assertIsNotObject(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsNotResource')) { - /** - * Asserts that a variable is not of type resource. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @psalm-assert !resource $actual - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertIsNotResource - */ - function assertIsNotResource($actual, string $message = ''): void - { - Assert::assertIsNotResource(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsNotClosedResource')) { - /** - * Asserts that a variable is not of type resource. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @psalm-assert !resource $actual - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertIsNotClosedResource - */ - function assertIsNotClosedResource($actual, string $message = ''): void - { - Assert::assertIsNotClosedResource(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsNotString')) { - /** - * Asserts that a variable is not of type string. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @psalm-assert !string $actual - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertIsNotString - */ - function assertIsNotString($actual, string $message = ''): void - { - Assert::assertIsNotString(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsNotScalar')) { - /** - * Asserts that a variable is not of type scalar. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @psalm-assert !scalar $actual - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertIsNotScalar - */ - function assertIsNotScalar($actual, string $message = ''): void - { - Assert::assertIsNotScalar(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsNotCallable')) { - /** - * Asserts that a variable is not of type callable. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @psalm-assert !callable $actual - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertIsNotCallable - */ - function assertIsNotCallable($actual, string $message = ''): void - { - Assert::assertIsNotCallable(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertIsNotIterable')) { - /** - * Asserts that a variable is not of type iterable. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @psalm-assert !iterable $actual - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertIsNotIterable - */ - function assertIsNotIterable($actual, string $message = ''): void - { - Assert::assertIsNotIterable(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertMatchesRegularExpression')) { - /** - * Asserts that a string matches a given regular expression. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertMatchesRegularExpression - */ - function assertMatchesRegularExpression(string $pattern, string $string, string $message = ''): void - { - Assert::assertMatchesRegularExpression(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertRegExp')) { - /** - * Asserts that a string matches a given regular expression. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @codeCoverageIgnore - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4086 - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertRegExp - */ - function assertRegExp(string $pattern, string $string, string $message = ''): void - { - Assert::assertRegExp(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertDoesNotMatchRegularExpression')) { - /** - * Asserts that a string does not match a given regular expression. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertDoesNotMatchRegularExpression - */ - function assertDoesNotMatchRegularExpression(string $pattern, string $string, string $message = ''): void - { - Assert::assertDoesNotMatchRegularExpression(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotRegExp')) { - /** - * Asserts that a string does not match a given regular expression. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @codeCoverageIgnore - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4089 - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertNotRegExp - */ - function assertNotRegExp(string $pattern, string $string, string $message = ''): void - { - Assert::assertNotRegExp(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertSameSize')) { - /** - * Assert that the size of two arrays (or `Countable` or `Traversable` objects) - * is the same. - * - * @param Countable|iterable $expected - * @param Countable|iterable $actual - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertSameSize - */ - function assertSameSize($expected, $actual, string $message = ''): void - { - Assert::assertSameSize(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertNotSameSize')) { - /** - * Assert that the size of two arrays (or `Countable` or `Traversable` objects) - * is not the same. - * - * @param Countable|iterable $expected - * @param Countable|iterable $actual - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertNotSameSize - */ - function assertNotSameSize($expected, $actual, string $message = ''): void - { - Assert::assertNotSameSize(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertStringMatchesFormat')) { - /** - * Asserts that a string matches a given format string. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertStringMatchesFormat - */ - function assertStringMatchesFormat(string $format, string $string, string $message = ''): void - { - Assert::assertStringMatchesFormat(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertStringNotMatchesFormat')) { - /** - * Asserts that a string does not match a given format string. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertStringNotMatchesFormat - */ - function assertStringNotMatchesFormat(string $format, string $string, string $message = ''): void - { - Assert::assertStringNotMatchesFormat(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertStringMatchesFormatFile')) { - /** - * Asserts that a string matches a given format file. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertStringMatchesFormatFile - */ - function assertStringMatchesFormatFile(string $formatFile, string $string, string $message = ''): void - { - Assert::assertStringMatchesFormatFile(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertStringNotMatchesFormatFile')) { - /** - * Asserts that a string does not match a given format string. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertStringNotMatchesFormatFile - */ - function assertStringNotMatchesFormatFile(string $formatFile, string $string, string $message = ''): void - { - Assert::assertStringNotMatchesFormatFile(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertStringStartsWith')) { - /** - * Asserts that a string starts with a given prefix. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertStringStartsWith - */ - function assertStringStartsWith(string $prefix, string $string, string $message = ''): void - { - Assert::assertStringStartsWith(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertStringStartsNotWith')) { - /** - * Asserts that a string starts not with a given prefix. - * - * @param string $prefix - * @param string $string - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertStringStartsNotWith - */ - function assertStringStartsNotWith($prefix, $string, string $message = ''): void - { - Assert::assertStringStartsNotWith(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertStringContainsString')) { - /** - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertStringContainsString - */ - function assertStringContainsString(string $needle, string $haystack, string $message = ''): void - { - Assert::assertStringContainsString(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertStringContainsStringIgnoringCase')) { - /** - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertStringContainsStringIgnoringCase - */ - function assertStringContainsStringIgnoringCase(string $needle, string $haystack, string $message = ''): void - { - Assert::assertStringContainsStringIgnoringCase(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertStringNotContainsString')) { - /** - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertStringNotContainsString - */ - function assertStringNotContainsString(string $needle, string $haystack, string $message = ''): void - { - Assert::assertStringNotContainsString(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertStringNotContainsStringIgnoringCase')) { - /** - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertStringNotContainsStringIgnoringCase - */ - function assertStringNotContainsStringIgnoringCase(string $needle, string $haystack, string $message = ''): void - { - Assert::assertStringNotContainsStringIgnoringCase(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertStringEndsWith')) { - /** - * Asserts that a string ends with a given suffix. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertStringEndsWith - */ - function assertStringEndsWith(string $suffix, string $string, string $message = ''): void - { - Assert::assertStringEndsWith(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertStringEndsNotWith')) { - /** - * Asserts that a string ends not with a given suffix. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertStringEndsNotWith - */ - function assertStringEndsNotWith(string $suffix, string $string, string $message = ''): void - { - Assert::assertStringEndsNotWith(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertXmlFileEqualsXmlFile')) { - /** - * Asserts that two XML files are equal. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertXmlFileEqualsXmlFile - */ - function assertXmlFileEqualsXmlFile(string $expectedFile, string $actualFile, string $message = ''): void - { - Assert::assertXmlFileEqualsXmlFile(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertXmlFileNotEqualsXmlFile')) { - /** - * Asserts that two XML files are not equal. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws \PHPUnit\Util\Exception - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertXmlFileNotEqualsXmlFile - */ - function assertXmlFileNotEqualsXmlFile(string $expectedFile, string $actualFile, string $message = ''): void - { - Assert::assertXmlFileNotEqualsXmlFile(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertXmlStringEqualsXmlFile')) { - /** - * Asserts that two XML documents are equal. - * - * @param DOMDocument|string $actualXml - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws \PHPUnit\Util\Xml\Exception - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertXmlStringEqualsXmlFile - */ - function assertXmlStringEqualsXmlFile(string $expectedFile, $actualXml, string $message = ''): void - { - Assert::assertXmlStringEqualsXmlFile(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertXmlStringNotEqualsXmlFile')) { - /** - * Asserts that two XML documents are not equal. - * - * @param DOMDocument|string $actualXml - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws \PHPUnit\Util\Xml\Exception - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertXmlStringNotEqualsXmlFile - */ - function assertXmlStringNotEqualsXmlFile(string $expectedFile, $actualXml, string $message = ''): void - { - Assert::assertXmlStringNotEqualsXmlFile(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertXmlStringEqualsXmlString')) { - /** - * Asserts that two XML documents are equal. - * - * @param DOMDocument|string $expectedXml - * @param DOMDocument|string $actualXml - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws \PHPUnit\Util\Xml\Exception - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertXmlStringEqualsXmlString - */ - function assertXmlStringEqualsXmlString($expectedXml, $actualXml, string $message = ''): void - { - Assert::assertXmlStringEqualsXmlString(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertXmlStringNotEqualsXmlString')) { - /** - * Asserts that two XML documents are not equal. - * - * @param DOMDocument|string $expectedXml - * @param DOMDocument|string $actualXml - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws \PHPUnit\Util\Xml\Exception - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertXmlStringNotEqualsXmlString - */ - function assertXmlStringNotEqualsXmlString($expectedXml, $actualXml, string $message = ''): void - { - Assert::assertXmlStringNotEqualsXmlString(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertEqualXMLStructure')) { - /** - * Asserts that a hierarchy of DOMElements matches. - * - * @throws AssertionFailedError - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @codeCoverageIgnore - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4091 - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertEqualXMLStructure - */ - function assertEqualXMLStructure(DOMElement $expectedElement, DOMElement $actualElement, bool $checkAttributes = false, string $message = ''): void - { - Assert::assertEqualXMLStructure(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertThat')) { - /** - * Evaluates a PHPUnit\Framework\Constraint matcher object. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertThat - */ - function assertThat($value, Constraint $constraint, string $message = ''): void - { - Assert::assertThat(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertJson')) { - /** - * Asserts that a string is a valid JSON string. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertJson - */ - function assertJson(string $actualJson, string $message = ''): void - { - Assert::assertJson(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertJsonStringEqualsJsonString')) { - /** - * Asserts that two given JSON encoded objects or arrays are equal. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertJsonStringEqualsJsonString - */ - function assertJsonStringEqualsJsonString(string $expectedJson, string $actualJson, string $message = ''): void - { - Assert::assertJsonStringEqualsJsonString(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertJsonStringNotEqualsJsonString')) { - /** - * Asserts that two given JSON encoded objects or arrays are not equal. - * - * @param string $expectedJson - * @param string $actualJson - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertJsonStringNotEqualsJsonString - */ - function assertJsonStringNotEqualsJsonString($expectedJson, $actualJson, string $message = ''): void - { - Assert::assertJsonStringNotEqualsJsonString(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertJsonStringEqualsJsonFile')) { - /** - * Asserts that the generated JSON encoded object and the content of the given file are equal. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertJsonStringEqualsJsonFile - */ - function assertJsonStringEqualsJsonFile(string $expectedFile, string $actualJson, string $message = ''): void - { - Assert::assertJsonStringEqualsJsonFile(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertJsonStringNotEqualsJsonFile')) { - /** - * Asserts that the generated JSON encoded object and the content of the given file are not equal. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertJsonStringNotEqualsJsonFile - */ - function assertJsonStringNotEqualsJsonFile(string $expectedFile, string $actualJson, string $message = ''): void - { - Assert::assertJsonStringNotEqualsJsonFile(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertJsonFileEqualsJsonFile')) { - /** - * Asserts that two JSON files are equal. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertJsonFileEqualsJsonFile - */ - function assertJsonFileEqualsJsonFile(string $expectedFile, string $actualFile, string $message = ''): void - { - Assert::assertJsonFileEqualsJsonFile(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\assertJsonFileNotEqualsJsonFile')) { - /** - * Asserts that two JSON files are not equal. - * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see Assert::assertJsonFileNotEqualsJsonFile - */ - function assertJsonFileNotEqualsJsonFile(string $expectedFile, string $actualFile, string $message = ''): void - { - Assert::assertJsonFileNotEqualsJsonFile(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\logicalAnd')) { - function logicalAnd(): LogicalAnd - { - return Assert::logicalAnd(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\logicalOr')) { - function logicalOr(): LogicalOr - { - return Assert::logicalOr(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\logicalNot')) { - function logicalNot(Constraint $constraint): LogicalNot - { - return Assert::logicalNot(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\logicalXor')) { - function logicalXor(): LogicalXor - { - return Assert::logicalXor(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\anything')) { - function anything(): IsAnything - { - return Assert::anything(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\isTrue')) { - function isTrue(): IsTrue - { - return Assert::isTrue(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\callback')) { - function callback(callable $callback): Callback - { - return Assert::callback(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\isFalse')) { - function isFalse(): IsFalse - { - return Assert::isFalse(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\isJson')) { - function isJson(): IsJson - { - return Assert::isJson(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\isNull')) { - function isNull(): IsNull - { - return Assert::isNull(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\isFinite')) { - function isFinite(): IsFinite - { - return Assert::isFinite(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\isInfinite')) { - function isInfinite(): IsInfinite - { - return Assert::isInfinite(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\isNan')) { - function isNan(): IsNan - { - return Assert::isNan(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\containsEqual')) { - function containsEqual($value): TraversableContainsEqual - { - return Assert::containsEqual(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\containsIdentical')) { - function containsIdentical($value): TraversableContainsIdentical - { - return Assert::containsIdentical(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\containsOnly')) { - function containsOnly(string $type): TraversableContainsOnly - { - return Assert::containsOnly(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\containsOnlyInstancesOf')) { - function containsOnlyInstancesOf(string $className): TraversableContainsOnly - { - return Assert::containsOnlyInstancesOf(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\arrayHasKey')) { - function arrayHasKey($key): ArrayHasKey - { - return Assert::arrayHasKey(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\equalTo')) { - function equalTo($value): IsEqual - { - return Assert::equalTo(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\equalToCanonicalizing')) { - function equalToCanonicalizing($value): IsEqualCanonicalizing - { - return Assert::equalToCanonicalizing(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\equalToIgnoringCase')) { - function equalToIgnoringCase($value): IsEqualIgnoringCase - { - return Assert::equalToIgnoringCase(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\equalToWithDelta')) { - function equalToWithDelta($value, float $delta): IsEqualWithDelta - { - return Assert::equalToWithDelta(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\isEmpty')) { - function isEmpty(): IsEmpty - { - return Assert::isEmpty(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\isWritable')) { - function isWritable(): IsWritable - { - return Assert::isWritable(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\isReadable')) { - function isReadable(): IsReadable - { - return Assert::isReadable(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\directoryExists')) { - function directoryExists(): DirectoryExists - { - return Assert::directoryExists(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\fileExists')) { - function fileExists(): FileExists - { - return Assert::fileExists(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\greaterThan')) { - function greaterThan($value): GreaterThan - { - return Assert::greaterThan(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\greaterThanOrEqual')) { - function greaterThanOrEqual($value): LogicalOr - { - return Assert::greaterThanOrEqual(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\classHasAttribute')) { - function classHasAttribute(string $attributeName): ClassHasAttribute - { - return Assert::classHasAttribute(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\classHasStaticAttribute')) { - function classHasStaticAttribute(string $attributeName): ClassHasStaticAttribute - { - return Assert::classHasStaticAttribute(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\objectHasAttribute')) { - function objectHasAttribute($attributeName): ObjectHasAttribute - { - return Assert::objectHasAttribute(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\identicalTo')) { - function identicalTo($value): IsIdentical - { - return Assert::identicalTo(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\isInstanceOf')) { - function isInstanceOf(string $className): IsInstanceOf - { - return Assert::isInstanceOf(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\isType')) { - function isType(string $type): IsType - { - return Assert::isType(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\lessThan')) { - function lessThan($value): LessThan - { - return Assert::lessThan(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\lessThanOrEqual')) { - function lessThanOrEqual($value): LogicalOr - { - return Assert::lessThanOrEqual(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\matchesRegularExpression')) { - function matchesRegularExpression(string $pattern): RegularExpression - { - return Assert::matchesRegularExpression(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\matches')) { - function matches(string $string): StringMatchesFormatDescription - { - return Assert::matches(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\stringStartsWith')) { - function stringStartsWith($prefix): StringStartsWith - { - return Assert::stringStartsWith(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\stringContains')) { - function stringContains(string $string, bool $case = true): StringContains - { - return Assert::stringContains(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\stringEndsWith')) { - function stringEndsWith(string $suffix): StringEndsWith - { - return Assert::stringEndsWith(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\countOf')) { - function countOf(int $count): Count - { - return Assert::countOf(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\objectEquals')) { - function objectEquals(object $object, string $method = 'equals'): ObjectEquals - { - return Assert::objectEquals(...func_get_args()); - } -} - -if (!function_exists('PHPUnit\Framework\any')) { - /** - * Returns a matcher that matches when the method is executed - * zero or more times. - */ - function any(): AnyInvokedCountMatcher - { - return new AnyInvokedCountMatcher; - } -} - -if (!function_exists('PHPUnit\Framework\never')) { - /** - * Returns a matcher that matches when the method is never executed. - */ - function never(): InvokedCountMatcher - { - return new InvokedCountMatcher(0); - } -} - -if (!function_exists('PHPUnit\Framework\atLeast')) { - /** - * Returns a matcher that matches when the method is executed - * at least N times. - */ - function atLeast(int $requiredInvocations): InvokedAtLeastCountMatcher - { - return new InvokedAtLeastCountMatcher( - $requiredInvocations - ); - } -} - -if (!function_exists('PHPUnit\Framework\atLeastOnce')) { - /** - * Returns a matcher that matches when the method is executed at least once. - */ - function atLeastOnce(): InvokedAtLeastOnceMatcher - { - return new InvokedAtLeastOnceMatcher; - } -} - -if (!function_exists('PHPUnit\Framework\once')) { - /** - * Returns a matcher that matches when the method is executed exactly once. - */ - function once(): InvokedCountMatcher - { - return new InvokedCountMatcher(1); - } -} - -if (!function_exists('PHPUnit\Framework\exactly')) { - /** - * Returns a matcher that matches when the method is executed - * exactly $count times. - */ - function exactly(int $count): InvokedCountMatcher - { - return new InvokedCountMatcher($count); - } -} - -if (!function_exists('PHPUnit\Framework\atMost')) { - /** - * Returns a matcher that matches when the method is executed - * at most N times. - */ - function atMost(int $allowedInvocations): InvokedAtMostCountMatcher - { - return new InvokedAtMostCountMatcher($allowedInvocations); - } -} - -if (!function_exists('PHPUnit\Framework\at')) { - /** - * Returns a matcher that matches when the method is executed - * at the given index. - */ - function at(int $index): InvokedAtIndexMatcher - { - return new InvokedAtIndexMatcher($index); - } -} - -if (!function_exists('PHPUnit\Framework\returnValue')) { - function returnValue($value): ReturnStub - { - return new ReturnStub($value); - } -} - -if (!function_exists('PHPUnit\Framework\returnValueMap')) { - function returnValueMap(array $valueMap): ReturnValueMapStub - { - return new ReturnValueMapStub($valueMap); - } -} - -if (!function_exists('PHPUnit\Framework\returnArgument')) { - function returnArgument(int $argumentIndex): ReturnArgumentStub - { - return new ReturnArgumentStub($argumentIndex); - } -} - -if (!function_exists('PHPUnit\Framework\returnCallback')) { - function returnCallback($callback): ReturnCallbackStub - { - return new ReturnCallbackStub($callback); - } -} - -if (!function_exists('PHPUnit\Framework\returnSelf')) { - /** - * Returns the current object. - * - * This method is useful when mocking a fluent interface. - */ - function returnSelf(): ReturnSelfStub - { - return new ReturnSelfStub; - } -} - -if (!function_exists('PHPUnit\Framework\throwException')) { - function throwException(Throwable $exception): ExceptionStub - { - return new ExceptionStub($exception); - } -} - -if (!function_exists('PHPUnit\Framework\onConsecutiveCalls')) { - function onConsecutiveCalls(): ConsecutiveCallsStub - { - $args = func_get_args(); - - return new ConsecutiveCallsStub($args); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Boolean/IsFalse.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Boolean/IsFalse.php deleted file mode 100644 index 212e2bcb..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Boolean/IsFalse.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class IsFalse extends Constraint -{ - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return 'is false'; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return $other === false; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Boolean/IsTrue.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Boolean/IsTrue.php deleted file mode 100644 index e1d6b269..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Boolean/IsTrue.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class IsTrue extends Constraint -{ - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return 'is true'; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return $other === true; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Callback.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Callback.php deleted file mode 100644 index b7cf95a1..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Callback.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -/** - * @psalm-template CallbackInput of mixed - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class Callback extends Constraint -{ - /** - * @var callable - * - * @psalm-var callable(CallbackInput $input): bool - */ - private $callback; - - /** @psalm-param callable(CallbackInput $input): bool $callback */ - public function __construct(callable $callback) - { - $this->callback = $callback; - } - - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return 'is accepted by specified callback'; - } - - /** - * Evaluates the constraint for parameter $value. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - * - * @psalm-param CallbackInput $other - */ - protected function matches($other): bool - { - return ($this->callback)($other); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/Count.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/Count.php deleted file mode 100644 index 8e27fbfd..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/Count.php +++ /dev/null @@ -1,142 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function count; -use function is_array; -use function iterator_count; -use function sprintf; -use Countable; -use EmptyIterator; -use Generator; -use Iterator; -use IteratorAggregate; -use PHPUnit\Framework\Exception; -use Traversable; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -class Count extends Constraint -{ - /** - * @var int - */ - private $expectedCount; - - public function __construct(int $expected) - { - $this->expectedCount = $expected; - } - - public function toString(): string - { - return sprintf( - 'count matches %d', - $this->expectedCount - ); - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @throws Exception - */ - protected function matches($other): bool - { - return $this->expectedCount === $this->getCountOf($other); - } - - /** - * @throws Exception - */ - protected function getCountOf($other): ?int - { - if ($other instanceof Countable || is_array($other)) { - return count($other); - } - - if ($other instanceof EmptyIterator) { - return 0; - } - - if ($other instanceof Traversable) { - while ($other instanceof IteratorAggregate) { - try { - $other = $other->getIterator(); - } catch (\Exception $e) { - throw new Exception( - $e->getMessage(), - $e->getCode(), - $e - ); - } - } - - $iterator = $other; - - if ($iterator instanceof Generator) { - return $this->getCountOfGenerator($iterator); - } - - if (!$iterator instanceof Iterator) { - return iterator_count($iterator); - } - - $key = $iterator->key(); - $count = iterator_count($iterator); - - // Manually rewind $iterator to previous key, since iterator_count - // moves pointer. - if ($key !== null) { - $iterator->rewind(); - - while ($iterator->valid() && $key !== $iterator->key()) { - $iterator->next(); - } - } - - return $count; - } - - return null; - } - - /** - * Returns the total number of iterations from a generator. - * This will fully exhaust the generator. - */ - protected function getCountOfGenerator(Generator $generator): int - { - for ($count = 0; $generator->valid(); $generator->next()) { - $count++; - } - - return $count; - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - */ - protected function failureDescription($other): string - { - return sprintf( - 'actual size %d matches expected size %d', - (int) $this->getCountOf($other), - $this->expectedCount - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/GreaterThan.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/GreaterThan.php deleted file mode 100644 index 31df5020..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/GreaterThan.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class GreaterThan extends Constraint -{ - /** - * @var float|int - */ - private $value; - - /** - * @param float|int $value - */ - public function __construct($value) - { - $this->value = $value; - } - - /** - * Returns a string representation of the constraint. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function toString(): string - { - return 'is greater than ' . $this->exporter()->export($this->value); - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return $this->value < $other; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/IsEmpty.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/IsEmpty.php deleted file mode 100644 index e6371d53..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/IsEmpty.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 PHPUnit\Framework\Constraint; - -use function count; -use function gettype; -use function sprintf; -use function strpos; -use Countable; -use EmptyIterator; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class IsEmpty extends Constraint -{ - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return 'is empty'; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - if ($other instanceof EmptyIterator) { - return true; - } - - if ($other instanceof Countable) { - return count($other) === 0; - } - - return empty($other); - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - */ - protected function failureDescription($other): string - { - $type = gettype($other); - - return sprintf( - '%s %s %s', - strpos($type, 'a') === 0 || strpos($type, 'o') === 0 ? 'an' : 'a', - $type, - $this->toString() - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/LessThan.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/LessThan.php deleted file mode 100644 index c7884ba1..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/LessThan.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class LessThan extends Constraint -{ - /** - * @var float|int - */ - private $value; - - /** - * @param float|int $value - */ - public function __construct($value) - { - $this->value = $value; - } - - /** - * Returns a string representation of the constraint. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function toString(): string - { - return 'is less than ' . $this->exporter()->export($this->value); - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return $this->value > $other; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/SameSize.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/SameSize.php deleted file mode 100644 index a5467942..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/SameSize.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class SameSize extends Count -{ - public function __construct(iterable $expected) - { - parent::__construct((int) $this->getCountOf($expected)); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php deleted file mode 100644 index 5f772b4d..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php +++ /dev/null @@ -1,270 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function sprintf; -use Countable; -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\SelfDescribing; -use SebastianBergmann\Comparator\ComparisonFailure; -use SebastianBergmann\Exporter\Exporter; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -abstract class Constraint implements Countable, SelfDescribing -{ - /** - * @var ?Exporter - */ - private $exporter; - - /** - * Evaluates the constraint for parameter $other. - * - * If $returnResult is set to false (the default), an exception is thrown - * in case of a failure. null is returned otherwise. - * - * If $returnResult is true, the result of the evaluation is returned as - * a boolean value instead: true in case of success, false in case of a - * failure. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public function evaluate($other, string $description = '', bool $returnResult = false): ?bool - { - $success = false; - - if ($this->matches($other)) { - $success = true; - } - - if ($returnResult) { - return $success; - } - - if (!$success) { - $this->fail($other, $description); - } - - return null; - } - - /** - * Counts the number of constraint elements. - */ - public function count(): int - { - return 1; - } - - protected function exporter(): Exporter - { - if ($this->exporter === null) { - $this->exporter = new Exporter; - } - - return $this->exporter; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * This method can be overridden to implement the evaluation algorithm. - * - * @param mixed $other value or object to evaluate - * - * @codeCoverageIgnore - */ - protected function matches($other): bool - { - return false; - } - - /** - * Throws an exception for the given compared value and test description. - * - * @param mixed $other evaluated value or object - * @param string $description Additional information about the test - * @param ComparisonFailure $comparisonFailure - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-return never-return - */ - protected function fail($other, $description, ComparisonFailure $comparisonFailure = null): void - { - $failureDescription = sprintf( - 'Failed asserting that %s.', - $this->failureDescription($other) - ); - - $additionalFailureDescription = $this->additionalFailureDescription($other); - - if ($additionalFailureDescription) { - $failureDescription .= "\n" . $additionalFailureDescription; - } - - if (!empty($description)) { - $failureDescription = $description . "\n" . $failureDescription; - } - - throw new ExpectationFailedException( - $failureDescription, - $comparisonFailure - ); - } - - /** - * Return additional failure description where needed. - * - * The function can be overridden to provide additional failure - * information like a diff - * - * @param mixed $other evaluated value or object - */ - protected function additionalFailureDescription($other): string - { - return ''; - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * To provide additional failure information additionalFailureDescription - * can be used. - * - * @param mixed $other evaluated value or object - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - protected function failureDescription($other): string - { - return $this->exporter()->export($other) . ' ' . $this->toString(); - } - - /** - * Returns a custom string representation of the constraint object when it - * appears in context of an $operator expression. - * - * The purpose of this method is to provide meaningful descriptive string - * in context of operators such as LogicalNot. Native PHPUnit constraints - * are supported out of the box by LogicalNot, but externally developed - * ones had no way to provide correct strings in this context. - * - * The method shall return empty string, when it does not handle - * customization by itself. - * - * @param Operator $operator the $operator of the expression - * @param mixed $role role of $this constraint in the $operator expression - */ - protected function toStringInContext(Operator $operator, $role): string - { - return ''; - } - - /** - * Returns the description of the failure when this constraint appears in - * context of an $operator expression. - * - * The purpose of this method is to provide meaningful failure description - * in context of operators such as LogicalNot. Native PHPUnit constraints - * are supported out of the box by LogicalNot, but externally developed - * ones had no way to provide correct messages in this context. - * - * The method shall return empty string, when it does not handle - * customization by itself. - * - * @param Operator $operator the $operator of the expression - * @param mixed $role role of $this constraint in the $operator expression - * @param mixed $other evaluated value or object - */ - protected function failureDescriptionInContext(Operator $operator, $role, $other): string - { - $string = $this->toStringInContext($operator, $role); - - if ($string === '') { - return ''; - } - - return $this->exporter()->export($other) . ' ' . $string; - } - - /** - * Reduces the sub-expression starting at $this by skipping degenerate - * sub-expression and returns first descendant constraint that starts - * a non-reducible sub-expression. - * - * Returns $this for terminal constraints and for operators that start - * non-reducible sub-expression, or the nearest descendant of $this that - * starts a non-reducible sub-expression. - * - * A constraint expression may be modelled as a tree with non-terminal - * nodes (operators) and terminal nodes. For example: - * - * LogicalOr (operator, non-terminal) - * + LogicalAnd (operator, non-terminal) - * | + IsType('int') (terminal) - * | + GreaterThan(10) (terminal) - * + LogicalNot (operator, non-terminal) - * + IsType('array') (terminal) - * - * A degenerate sub-expression is a part of the tree, that effectively does - * not contribute to the evaluation of the expression it appears in. An example - * of degenerate sub-expression is a BinaryOperator constructed with single - * operand or nested BinaryOperators, each with single operand. An - * expression involving a degenerate sub-expression is equivalent to a - * reduced expression with the degenerate sub-expression removed, for example - * - * LogicalAnd (operator) - * + LogicalOr (degenerate operator) - * | + LogicalAnd (degenerate operator) - * | + IsType('int') (terminal) - * + GreaterThan(10) (terminal) - * - * is equivalent to - * - * LogicalAnd (operator) - * + IsType('int') (terminal) - * + GreaterThan(10) (terminal) - * - * because the subexpression - * - * + LogicalOr - * + LogicalAnd - * + - - * - * is degenerate. Calling reduce() on the LogicalOr object above, as well - * as on LogicalAnd, shall return the IsType('int') instance. - * - * Other specific reductions can be implemented, for example cascade of - * LogicalNot operators - * - * + LogicalNot - * + LogicalNot - * +LogicalNot - * + IsTrue - * - * can be reduced to - * - * LogicalNot - * + IsTrue - */ - protected function reduce(): self - { - return $this; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqual.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqual.php deleted file mode 100644 index 6a61ebfb..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqual.php +++ /dev/null @@ -1,138 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function is_string; -use function sprintf; -use function strpos; -use function trim; -use PHPUnit\Framework\ExpectationFailedException; -use SebastianBergmann\Comparator\ComparisonFailure; -use SebastianBergmann\Comparator\Factory as ComparatorFactory; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class IsEqual extends Constraint -{ - /** - * @var mixed - */ - private $value; - - /** - * @var float - */ - private $delta; - - /** - * @var bool - */ - private $canonicalize; - - /** - * @var bool - */ - private $ignoreCase; - - public function __construct($value, float $delta = 0.0, bool $canonicalize = false, bool $ignoreCase = false) - { - $this->value = $value; - $this->delta = $delta; - $this->canonicalize = $canonicalize; - $this->ignoreCase = $ignoreCase; - } - - /** - * Evaluates the constraint for parameter $other. - * - * If $returnResult is set to false (the default), an exception is thrown - * in case of a failure. null is returned otherwise. - * - * If $returnResult is true, the result of the evaluation is returned as - * a boolean value instead: true in case of success, false in case of a - * failure. - * - * @throws ExpectationFailedException - * - * @return bool - */ - public function evaluate($other, string $description = '', bool $returnResult = false): ?bool - { - // If $this->value and $other are identical, they are also equal. - // This is the most common path and will allow us to skip - // initialization of all the comparators. - if ($this->value === $other) { - return true; - } - - $comparatorFactory = ComparatorFactory::getInstance(); - - try { - $comparator = $comparatorFactory->getComparatorFor( - $this->value, - $other - ); - - $comparator->assertEquals( - $this->value, - $other, - $this->delta, - $this->canonicalize, - $this->ignoreCase - ); - } catch (ComparisonFailure $f) { - if ($returnResult) { - return false; - } - - throw new ExpectationFailedException( - trim($description . "\n" . $f->getMessage()), - $f - ); - } - - return true; - } - - /** - * Returns a string representation of the constraint. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function toString(): string - { - $delta = ''; - - if (is_string($this->value)) { - if (strpos($this->value, "\n") !== false) { - return 'is equal to '; - } - - return sprintf( - "is equal to '%s'", - $this->value - ); - } - - if ($this->delta != 0) { - $delta = sprintf( - ' with delta <%F>', - $this->delta - ); - } - - return sprintf( - 'is equal to %s%s', - $this->exporter()->export($this->value), - $delta - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualCanonicalizing.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualCanonicalizing.php deleted file mode 100644 index 57bb91ca..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualCanonicalizing.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 PHPUnit\Framework\Constraint; - -use function is_string; -use function sprintf; -use function strpos; -use function trim; -use PHPUnit\Framework\ExpectationFailedException; -use SebastianBergmann\Comparator\ComparisonFailure; -use SebastianBergmann\Comparator\Factory as ComparatorFactory; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class IsEqualCanonicalizing extends Constraint -{ - /** - * @var mixed - */ - private $value; - - public function __construct($value) - { - $this->value = $value; - } - - /** - * Evaluates the constraint for parameter $other. - * - * If $returnResult is set to false (the default), an exception is thrown - * in case of a failure. null is returned otherwise. - * - * If $returnResult is true, the result of the evaluation is returned as - * a boolean value instead: true in case of success, false in case of a - * failure. - * - * @throws ExpectationFailedException - */ - public function evaluate($other, string $description = '', bool $returnResult = false): ?bool - { - // If $this->value and $other are identical, they are also equal. - // This is the most common path and will allow us to skip - // initialization of all the comparators. - if ($this->value === $other) { - return true; - } - - $comparatorFactory = ComparatorFactory::getInstance(); - - try { - $comparator = $comparatorFactory->getComparatorFor( - $this->value, - $other - ); - - $comparator->assertEquals( - $this->value, - $other, - 0.0, - true, - false - ); - } catch (ComparisonFailure $f) { - if ($returnResult) { - return false; - } - - throw new ExpectationFailedException( - trim($description . "\n" . $f->getMessage()), - $f - ); - } - - return true; - } - - /** - * Returns a string representation of the constraint. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function toString(): string - { - if (is_string($this->value)) { - if (strpos($this->value, "\n") !== false) { - return 'is equal to '; - } - - return sprintf( - "is equal to '%s'", - $this->value - ); - } - - return sprintf( - 'is equal to %s', - $this->exporter()->export($this->value) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualIgnoringCase.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualIgnoringCase.php deleted file mode 100644 index d657e96a..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualIgnoringCase.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 PHPUnit\Framework\Constraint; - -use function is_string; -use function sprintf; -use function strpos; -use function trim; -use PHPUnit\Framework\ExpectationFailedException; -use SebastianBergmann\Comparator\ComparisonFailure; -use SebastianBergmann\Comparator\Factory as ComparatorFactory; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class IsEqualIgnoringCase extends Constraint -{ - /** - * @var mixed - */ - private $value; - - public function __construct($value) - { - $this->value = $value; - } - - /** - * Evaluates the constraint for parameter $other. - * - * If $returnResult is set to false (the default), an exception is thrown - * in case of a failure. null is returned otherwise. - * - * If $returnResult is true, the result of the evaluation is returned as - * a boolean value instead: true in case of success, false in case of a - * failure. - * - * @throws ExpectationFailedException - */ - public function evaluate($other, string $description = '', bool $returnResult = false): ?bool - { - // If $this->value and $other are identical, they are also equal. - // This is the most common path and will allow us to skip - // initialization of all the comparators. - if ($this->value === $other) { - return true; - } - - $comparatorFactory = ComparatorFactory::getInstance(); - - try { - $comparator = $comparatorFactory->getComparatorFor( - $this->value, - $other - ); - - $comparator->assertEquals( - $this->value, - $other, - 0.0, - false, - true - ); - } catch (ComparisonFailure $f) { - if ($returnResult) { - return false; - } - - throw new ExpectationFailedException( - trim($description . "\n" . $f->getMessage()), - $f - ); - } - - return true; - } - - /** - * Returns a string representation of the constraint. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function toString(): string - { - if (is_string($this->value)) { - if (strpos($this->value, "\n") !== false) { - return 'is equal to '; - } - - return sprintf( - "is equal to '%s'", - $this->value - ); - } - - return sprintf( - 'is equal to %s', - $this->exporter()->export($this->value) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualWithDelta.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualWithDelta.php deleted file mode 100644 index 0370b511..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualWithDelta.php +++ /dev/null @@ -1,100 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function sprintf; -use function trim; -use PHPUnit\Framework\ExpectationFailedException; -use SebastianBergmann\Comparator\ComparisonFailure; -use SebastianBergmann\Comparator\Factory as ComparatorFactory; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class IsEqualWithDelta extends Constraint -{ - /** - * @var mixed - */ - private $value; - - /** - * @var float - */ - private $delta; - - public function __construct($value, float $delta) - { - $this->value = $value; - $this->delta = $delta; - } - - /** - * Evaluates the constraint for parameter $other. - * - * If $returnResult is set to false (the default), an exception is thrown - * in case of a failure. null is returned otherwise. - * - * If $returnResult is true, the result of the evaluation is returned as - * a boolean value instead: true in case of success, false in case of a - * failure. - * - * @throws ExpectationFailedException - */ - public function evaluate($other, string $description = '', bool $returnResult = false): ?bool - { - // If $this->value and $other are identical, they are also equal. - // This is the most common path and will allow us to skip - // initialization of all the comparators. - if ($this->value === $other) { - return true; - } - - $comparatorFactory = ComparatorFactory::getInstance(); - - try { - $comparator = $comparatorFactory->getComparatorFor( - $this->value, - $other - ); - - $comparator->assertEquals( - $this->value, - $other, - $this->delta - ); - } catch (ComparisonFailure $f) { - if ($returnResult) { - return false; - } - - throw new ExpectationFailedException( - trim($description . "\n" . $f->getMessage()), - $f - ); - } - - return true; - } - - /** - * Returns a string representation of the constraint. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function toString(): string - { - return sprintf( - 'is equal to %s with delta <%F>>', - $this->exporter()->export($this->value), - $this->delta - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/Exception.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/Exception.php deleted file mode 100644 index 860c0030..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/Exception.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function get_class; -use function sprintf; -use PHPUnit\Util\Filter; -use Throwable; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class Exception extends Constraint -{ - /** - * @var string - */ - private $className; - - public function __construct(string $className) - { - $this->className = $className; - } - - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return sprintf( - 'exception of type "%s"', - $this->className - ); - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return $other instanceof $this->className; - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - */ - protected function failureDescription($other): string - { - if ($other !== null) { - $message = ''; - - if ($other instanceof Throwable) { - $message = '. Message was: "' . $other->getMessage() . '" at' - . "\n" . Filter::getFilteredStacktrace($other); - } - - return sprintf( - 'exception of type "%s" matches expected exception "%s"%s', - get_class($other), - $this->className, - $message - ); - } - - return sprintf( - 'exception of type "%s" is thrown', - $this->className - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionCode.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionCode.php deleted file mode 100644 index b8054a94..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionCode.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 PHPUnit\Framework\Constraint; - -use function sprintf; -use Throwable; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class ExceptionCode extends Constraint -{ - /** - * @var int|string - */ - private $expectedCode; - - /** - * @param int|string $expected - */ - public function __construct($expected) - { - $this->expectedCode = $expected; - } - - public function toString(): string - { - return 'exception code is '; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param Throwable $other - */ - protected function matches($other): bool - { - return (string) $other->getCode() === (string) $this->expectedCode; - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - protected function failureDescription($other): string - { - return sprintf( - '%s is equal to expected exception code %s', - $this->exporter()->export($other->getCode()), - $this->exporter()->export($this->expectedCode) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessage.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessage.php deleted file mode 100644 index 030beff9..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessage.php +++ /dev/null @@ -1,78 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function sprintf; -use function strpos; -use Throwable; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class ExceptionMessage extends Constraint -{ - /** - * @var string - */ - private $expectedMessage; - - public function __construct(string $expected) - { - $this->expectedMessage = $expected; - } - - public function toString(): string - { - if ($this->expectedMessage === '') { - return 'exception message is empty'; - } - - return 'exception message contains '; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param Throwable $other - */ - protected function matches($other): bool - { - if ($this->expectedMessage === '') { - return $other->getMessage() === ''; - } - - return strpos((string) $other->getMessage(), $this->expectedMessage) !== false; - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - */ - protected function failureDescription($other): string - { - if ($this->expectedMessage === '') { - return sprintf( - "exception message is empty but is '%s'", - $other->getMessage() - ); - } - - return sprintf( - "exception message '%s' contains '%s'", - $other->getMessage(), - $this->expectedMessage - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessageRegularExpression.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessageRegularExpression.php deleted file mode 100644 index fd0db1c8..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessageRegularExpression.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function sprintf; -use Exception; -use PHPUnit\Util\RegularExpression as RegularExpressionUtil; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class ExceptionMessageRegularExpression extends Constraint -{ - /** - * @var string - */ - private $expectedMessageRegExp; - - public function __construct(string $expected) - { - $this->expectedMessageRegExp = $expected; - } - - public function toString(): string - { - return 'exception message matches '; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param \PHPUnit\Framework\Exception $other - * - * @throws \PHPUnit\Framework\Exception - * @throws Exception - */ - protected function matches($other): bool - { - $match = RegularExpressionUtil::safeMatch($this->expectedMessageRegExp, $other->getMessage()); - - if ($match === false) { - throw new \PHPUnit\Framework\Exception( - "Invalid expected exception message regex given: '{$this->expectedMessageRegExp}'" - ); - } - - return $match === 1; - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - */ - protected function failureDescription($other): string - { - return sprintf( - "exception message '%s' matches '%s'", - $other->getMessage(), - $this->expectedMessageRegExp - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/DirectoryExists.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/DirectoryExists.php deleted file mode 100644 index ef4b2baf..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/DirectoryExists.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function is_dir; -use function sprintf; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class DirectoryExists extends Constraint -{ - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return 'directory exists'; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return is_dir($other); - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - */ - protected function failureDescription($other): string - { - return sprintf( - 'directory "%s" exists', - $other - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/FileExists.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/FileExists.php deleted file mode 100644 index 41b3136e..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/FileExists.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function file_exists; -use function sprintf; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class FileExists extends Constraint -{ - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return 'file exists'; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return file_exists($other); - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - */ - protected function failureDescription($other): string - { - return sprintf( - 'file "%s" exists', - $other - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/IsReadable.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/IsReadable.php deleted file mode 100644 index e33d7e04..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/IsReadable.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function is_readable; -use function sprintf; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class IsReadable extends Constraint -{ - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return 'is readable'; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return is_readable($other); - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - */ - protected function failureDescription($other): string - { - return sprintf( - '"%s" is readable', - $other - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/IsWritable.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/IsWritable.php deleted file mode 100644 index 93981224..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/IsWritable.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function is_writable; -use function sprintf; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class IsWritable extends Constraint -{ - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return 'is writable'; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return is_writable($other); - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - */ - protected function failureDescription($other): string - { - return sprintf( - '"%s" is writable', - $other - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/IsAnything.php b/vendor/phpunit/phpunit/src/Framework/Constraint/IsAnything.php deleted file mode 100644 index db84a743..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/IsAnything.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 PHPUnit\Framework\Constraint; - -use PHPUnit\Framework\ExpectationFailedException; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class IsAnything extends Constraint -{ - /** - * Evaluates the constraint for parameter $other. - * - * If $returnResult is set to false (the default), an exception is thrown - * in case of a failure. null is returned otherwise. - * - * If $returnResult is true, the result of the evaluation is returned as - * a boolean value instead: true in case of success, false in case of a - * failure. - * - * @throws ExpectationFailedException - */ - public function evaluate($other, string $description = '', bool $returnResult = false): ?bool - { - return $returnResult ? true : null; - } - - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return 'is anything'; - } - - /** - * Counts the number of constraint elements. - */ - public function count(): int - { - return 0; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/IsIdentical.php b/vendor/phpunit/phpunit/src/Framework/Constraint/IsIdentical.php deleted file mode 100644 index fde43d9e..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/IsIdentical.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 PHPUnit\Framework\Constraint; - -use function get_class; -use function is_array; -use function is_object; -use function is_string; -use function sprintf; -use PHPUnit\Framework\ExpectationFailedException; -use SebastianBergmann\Comparator\ComparisonFailure; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class IsIdentical extends Constraint -{ - /** - * @var mixed - */ - private $value; - - public function __construct($value) - { - $this->value = $value; - } - - /** - * Evaluates the constraint for parameter $other. - * - * If $returnResult is set to false (the default), an exception is thrown - * in case of a failure. null is returned otherwise. - * - * If $returnResult is true, the result of the evaluation is returned as - * a boolean value instead: true in case of success, false in case of a - * failure. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public function evaluate($other, string $description = '', bool $returnResult = false): ?bool - { - $success = $this->value === $other; - - if ($returnResult) { - return $success; - } - - if (!$success) { - $f = null; - - // if both values are strings, make sure a diff is generated - if (is_string($this->value) && is_string($other)) { - $f = new ComparisonFailure( - $this->value, - $other, - sprintf("'%s'", $this->value), - sprintf("'%s'", $other) - ); - } - - // if both values are array, make sure a diff is generated - if (is_array($this->value) && is_array($other)) { - $f = new ComparisonFailure( - $this->value, - $other, - $this->exporter()->export($this->value), - $this->exporter()->export($other) - ); - } - - $this->fail($other, $description, $f); - } - - return null; - } - - /** - * Returns a string representation of the constraint. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function toString(): string - { - if (is_object($this->value)) { - return 'is identical to an object of class "' . - get_class($this->value) . '"'; - } - - return 'is identical to ' . $this->exporter()->export($this->value); - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - protected function failureDescription($other): string - { - if (is_object($this->value) && is_object($other)) { - return 'two variables reference the same object'; - } - - if (is_string($this->value) && is_string($other)) { - return 'two strings are identical'; - } - - if (is_array($this->value) && is_array($other)) { - return 'two arrays are identical'; - } - - return parent::failureDescription($other); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/JsonMatches.php b/vendor/phpunit/phpunit/src/Framework/Constraint/JsonMatches.php deleted file mode 100644 index 23a4de7e..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/JsonMatches.php +++ /dev/null @@ -1,109 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function json_decode; -use function sprintf; -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Util\Json; -use SebastianBergmann\Comparator\ComparisonFailure; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class JsonMatches extends Constraint -{ - /** - * @var string - */ - private $value; - - public function __construct(string $value) - { - $this->value = $value; - } - - /** - * Returns a string representation of the object. - */ - public function toString(): string - { - return sprintf( - 'matches JSON string "%s"', - $this->value - ); - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * This method can be overridden to implement the evaluation algorithm. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - [$error, $recodedOther] = Json::canonicalize($other); - - if ($error) { - return false; - } - - [$error, $recodedValue] = Json::canonicalize($this->value); - - if ($error) { - return false; - } - - return $recodedOther == $recodedValue; - } - - /** - * Throws an exception for the given compared value and test description. - * - * @param mixed $other evaluated value or object - * @param string $description Additional information about the test - * @param ComparisonFailure $comparisonFailure - * - * @throws \PHPUnit\Framework\Exception - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * - * @psalm-return never-return - */ - protected function fail($other, $description, ComparisonFailure $comparisonFailure = null): void - { - if ($comparisonFailure === null) { - [$error, $recodedOther] = Json::canonicalize($other); - - if ($error) { - parent::fail($other, $description); - } - - [$error, $recodedValue] = Json::canonicalize($this->value); - - if ($error) { - parent::fail($other, $description); - } - - $comparisonFailure = new ComparisonFailure( - json_decode($this->value), - json_decode($other), - Json::prettify($recodedValue), - Json::prettify($recodedOther), - false, - 'Failed asserting that two json values are equal.' - ); - } - - parent::fail($other, $description, $comparisonFailure); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/JsonMatchesErrorMessageProvider.php b/vendor/phpunit/phpunit/src/Framework/Constraint/JsonMatchesErrorMessageProvider.php deleted file mode 100644 index 8ded556c..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/JsonMatchesErrorMessageProvider.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use const JSON_ERROR_CTRL_CHAR; -use const JSON_ERROR_DEPTH; -use const JSON_ERROR_NONE; -use const JSON_ERROR_STATE_MISMATCH; -use const JSON_ERROR_SYNTAX; -use const JSON_ERROR_UTF8; -use function strtolower; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class JsonMatchesErrorMessageProvider -{ - /** - * Translates JSON error to a human readable string. - */ - public static function determineJsonError(string $error, string $prefix = ''): ?string - { - switch ($error) { - case JSON_ERROR_NONE: - return null; - case JSON_ERROR_DEPTH: - return $prefix . 'Maximum stack depth exceeded'; - case JSON_ERROR_STATE_MISMATCH: - return $prefix . 'Underflow or the modes mismatch'; - case JSON_ERROR_CTRL_CHAR: - return $prefix . 'Unexpected control character found'; - case JSON_ERROR_SYNTAX: - return $prefix . 'Syntax error, malformed JSON'; - case JSON_ERROR_UTF8: - return $prefix . 'Malformed UTF-8 characters, possibly incorrectly encoded'; - - default: - return $prefix . 'Unknown error'; - } - } - - /** - * Translates a given type to a human readable message prefix. - */ - public static function translateTypeToPrefix(string $type): string - { - switch (strtolower($type)) { - case 'expected': - $prefix = 'Expected value JSON decode error - '; - - break; - case 'actual': - $prefix = 'Actual value JSON decode error - '; - - break; - - default: - $prefix = ''; - - break; - } - - return $prefix; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Math/IsFinite.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Math/IsFinite.php deleted file mode 100644 index 9a2f3286..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Math/IsFinite.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 PHPUnit\Framework\Constraint; - -use function is_finite; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class IsFinite extends Constraint -{ - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return 'is finite'; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return is_finite($other); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Math/IsInfinite.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Math/IsInfinite.php deleted file mode 100644 index c718514c..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Math/IsInfinite.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 PHPUnit\Framework\Constraint; - -use function is_infinite; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class IsInfinite extends Constraint -{ - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return 'is infinite'; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return is_infinite($other); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Math/IsNan.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Math/IsNan.php deleted file mode 100644 index 0062c5b5..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Math/IsNan.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 PHPUnit\Framework\Constraint; - -use function is_nan; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class IsNan extends Constraint -{ - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return 'is nan'; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return is_nan($other); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ClassHasAttribute.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ClassHasAttribute.php deleted file mode 100644 index 8df92712..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ClassHasAttribute.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 PHPUnit\Framework\Constraint; - -use function get_class; -use function is_object; -use function sprintf; -use PHPUnit\Framework\Exception; -use ReflectionClass; -use ReflectionException; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -class ClassHasAttribute extends Constraint -{ - /** - * @var string - */ - private $attributeName; - - public function __construct(string $attributeName) - { - $this->attributeName = $attributeName; - } - - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return sprintf( - 'has attribute "%s"', - $this->attributeName - ); - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - try { - return (new ReflectionClass($other))->hasProperty($this->attributeName); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - */ - protected function failureDescription($other): string - { - return sprintf( - '%sclass "%s" %s', - is_object($other) ? 'object of ' : '', - is_object($other) ? get_class($other) : $other, - $this->toString() - ); - } - - protected function attributeName(): string - { - return $this->attributeName; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ClassHasStaticAttribute.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ClassHasStaticAttribute.php deleted file mode 100644 index c2c94109..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ClassHasStaticAttribute.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function sprintf; -use PHPUnit\Framework\Exception; -use ReflectionClass; -use ReflectionException; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class ClassHasStaticAttribute extends ClassHasAttribute -{ - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return sprintf( - 'has static attribute "%s"', - $this->attributeName() - ); - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - try { - $class = new ReflectionClass($other); - - if ($class->hasProperty($this->attributeName())) { - return $class->getProperty($this->attributeName())->isStatic(); - } - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - return false; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ObjectEquals.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ObjectEquals.php deleted file mode 100644 index 30f3a330..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ObjectEquals.php +++ /dev/null @@ -1,151 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function get_class; -use function is_object; -use PHPUnit\Framework\ActualValueIsNotAnObjectException; -use PHPUnit\Framework\ComparisonMethodDoesNotAcceptParameterTypeException; -use PHPUnit\Framework\ComparisonMethodDoesNotDeclareBoolReturnTypeException; -use PHPUnit\Framework\ComparisonMethodDoesNotDeclareExactlyOneParameterException; -use PHPUnit\Framework\ComparisonMethodDoesNotDeclareParameterTypeException; -use PHPUnit\Framework\ComparisonMethodDoesNotExistException; -use ReflectionNamedType; -use ReflectionObject; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class ObjectEquals extends Constraint -{ - /** - * @var object - */ - private $expected; - - /** - * @var string - */ - private $method; - - public function __construct(object $object, string $method = 'equals') - { - $this->expected = $object; - $this->method = $method; - } - - public function toString(): string - { - return 'two objects are equal'; - } - - /** - * @throws ActualValueIsNotAnObjectException - * @throws ComparisonMethodDoesNotAcceptParameterTypeException - * @throws ComparisonMethodDoesNotDeclareBoolReturnTypeException - * @throws ComparisonMethodDoesNotDeclareExactlyOneParameterException - * @throws ComparisonMethodDoesNotDeclareParameterTypeException - * @throws ComparisonMethodDoesNotExistException - */ - protected function matches($other): bool - { - if (!is_object($other)) { - throw new ActualValueIsNotAnObjectException; - } - - $object = new ReflectionObject($other); - - if (!$object->hasMethod($this->method)) { - throw new ComparisonMethodDoesNotExistException( - get_class($other), - $this->method - ); - } - - /** @noinspection PhpUnhandledExceptionInspection */ - $method = $object->getMethod($this->method); - - if (!$method->hasReturnType()) { - throw new ComparisonMethodDoesNotDeclareBoolReturnTypeException( - get_class($other), - $this->method - ); - } - - $returnType = $method->getReturnType(); - - if (!$returnType instanceof ReflectionNamedType) { - throw new ComparisonMethodDoesNotDeclareBoolReturnTypeException( - get_class($other), - $this->method - ); - } - - if ($returnType->allowsNull()) { - throw new ComparisonMethodDoesNotDeclareBoolReturnTypeException( - get_class($other), - $this->method - ); - } - - if ($returnType->getName() !== 'bool') { - throw new ComparisonMethodDoesNotDeclareBoolReturnTypeException( - get_class($other), - $this->method - ); - } - - if ($method->getNumberOfParameters() !== 1 || $method->getNumberOfRequiredParameters() !== 1) { - throw new ComparisonMethodDoesNotDeclareExactlyOneParameterException( - get_class($other), - $this->method - ); - } - - $parameter = $method->getParameters()[0]; - - if (!$parameter->hasType()) { - throw new ComparisonMethodDoesNotDeclareParameterTypeException( - get_class($other), - $this->method - ); - } - - $type = $parameter->getType(); - - if (!$type instanceof ReflectionNamedType) { - throw new ComparisonMethodDoesNotDeclareParameterTypeException( - get_class($other), - $this->method - ); - } - - $typeName = $type->getName(); - - if ($typeName === 'self') { - $typeName = get_class($other); - } - - if (!$this->expected instanceof $typeName) { - throw new ComparisonMethodDoesNotAcceptParameterTypeException( - get_class($other), - $this->method, - get_class($this->expected) - ); - } - - return $other->{$this->method}($this->expected); - } - - protected function failureDescription($other): string - { - return $this->toString(); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ObjectHasAttribute.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ObjectHasAttribute.php deleted file mode 100644 index 5fbc0888..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ObjectHasAttribute.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use ReflectionObject; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class ObjectHasAttribute extends ClassHasAttribute -{ - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return (new ReflectionObject($other))->hasProperty($this->attributeName()); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/BinaryOperator.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/BinaryOperator.php deleted file mode 100644 index 11c86b52..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/BinaryOperator.php +++ /dev/null @@ -1,148 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function array_map; -use function array_values; -use function count; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -abstract class BinaryOperator extends Operator -{ - /** - * @var Constraint[] - */ - private $constraints = []; - - public static function fromConstraints(Constraint ...$constraints): self - { - $constraint = new static; - - $constraint->constraints = $constraints; - - return $constraint; - } - - /** - * @param mixed[] $constraints - */ - public function setConstraints(array $constraints): void - { - $this->constraints = array_map(function ($constraint): Constraint - { - return $this->checkConstraint($constraint); - }, array_values($constraints)); - } - - /** - * Returns the number of operands (constraints). - */ - final public function arity(): int - { - return count($this->constraints); - } - - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - $reduced = $this->reduce(); - - if ($reduced !== $this) { - return $reduced->toString(); - } - - $text = ''; - - foreach ($this->constraints as $key => $constraint) { - $constraint = $constraint->reduce(); - - $text .= $this->constraintToString($constraint, $key); - } - - return $text; - } - - /** - * Counts the number of constraint elements. - */ - public function count(): int - { - $count = 0; - - foreach ($this->constraints as $constraint) { - $count += count($constraint); - } - - return $count; - } - - /** - * Returns the nested constraints. - */ - final protected function constraints(): array - { - return $this->constraints; - } - - /** - * Returns true if the $constraint needs to be wrapped with braces. - */ - final protected function constraintNeedsParentheses(Constraint $constraint): bool - { - return $this->arity() > 1 && parent::constraintNeedsParentheses($constraint); - } - - /** - * Reduces the sub-expression starting at $this by skipping degenerate - * sub-expression and returns first descendant constraint that starts - * a non-reducible sub-expression. - * - * See Constraint::reduce() for more. - */ - protected function reduce(): Constraint - { - if ($this->arity() === 1 && $this->constraints[0] instanceof Operator) { - return $this->constraints[0]->reduce(); - } - - return parent::reduce(); - } - - /** - * Returns string representation of given operand in context of this operator. - * - * @param Constraint $constraint operand constraint - * @param int $position position of $constraint in this expression - */ - private function constraintToString(Constraint $constraint, int $position): string - { - $prefix = ''; - - if ($position > 0) { - $prefix = (' ' . $this->operator() . ' '); - } - - if ($this->constraintNeedsParentheses($constraint)) { - return $prefix . '( ' . $constraint->toString() . ' )'; - } - - $string = $constraint->toStringInContext($this, $position); - - if ($string === '') { - $string = $constraint->toString(); - } - - return $prefix . $string; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalAnd.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalAnd.php deleted file mode 100644 index a1af4dd3..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalAnd.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 PHPUnit\Framework\Constraint; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class LogicalAnd extends BinaryOperator -{ - /** - * Returns the name of this operator. - */ - public function operator(): string - { - return 'and'; - } - - /** - * Returns this operator's precedence. - * - * @see https://www.php.net/manual/en/language.operators.precedence.php - */ - public function precedence(): int - { - return 22; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - foreach ($this->constraints() as $constraint) { - if (!$constraint->evaluate($other, '', true)) { - return false; - } - } - - return [] !== $this->constraints(); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalNot.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalNot.php deleted file mode 100644 index 7560ce2a..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalNot.php +++ /dev/null @@ -1,136 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function array_map; -use function count; -use function preg_match; -use function preg_quote; -use function preg_replace; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class LogicalNot extends UnaryOperator -{ - public static function negate(string $string): string - { - $positives = [ - 'contains ', - 'exists', - 'has ', - 'is ', - 'are ', - 'matches ', - 'starts with ', - 'ends with ', - 'reference ', - 'not not ', - ]; - - $negatives = [ - 'does not contain ', - 'does not exist', - 'does not have ', - 'is not ', - 'are not ', - 'does not match ', - 'starts not with ', - 'ends not with ', - 'don\'t reference ', - 'not ', - ]; - - preg_match('/(\'[\w\W]*\')([\w\W]*)("[\w\W]*")/i', $string, $matches); - - $positives = array_map(static function (string $s) - { - return '/\\b' . preg_quote($s, '/') . '/'; - }, $positives); - - if (count($matches) > 0) { - $nonInput = $matches[2]; - - $negatedString = preg_replace( - '/' . preg_quote($nonInput, '/') . '/', - preg_replace( - $positives, - $negatives, - $nonInput - ), - $string - ); - } else { - $negatedString = preg_replace( - $positives, - $negatives, - $string - ); - } - - return $negatedString; - } - - /** - * Returns the name of this operator. - */ - public function operator(): string - { - return 'not'; - } - - /** - * Returns this operator's precedence. - * - * @see https://www.php.net/manual/en/language.operators.precedence.php - */ - public function precedence(): int - { - return 5; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return !$this->constraint()->evaluate($other, '', true); - } - - /** - * Applies additional transformation to strings returned by toString() or - * failureDescription(). - */ - protected function transformString(string $string): string - { - return self::negate($string); - } - - /** - * Reduces the sub-expression starting at $this by skipping degenerate - * sub-expression and returns first descendant constraint that starts - * a non-reducible sub-expression. - * - * See Constraint::reduce() for more. - */ - protected function reduce(): Constraint - { - $constraint = $this->constraint(); - - if ($constraint instanceof self) { - return $constraint->constraint()->reduce(); - } - - return parent::reduce(); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalOr.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalOr.php deleted file mode 100644 index 2932de67..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalOr.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 PHPUnit\Framework\Constraint; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class LogicalOr extends BinaryOperator -{ - /** - * Returns the name of this operator. - */ - public function operator(): string - { - return 'or'; - } - - /** - * Returns this operator's precedence. - * - * @see https://www.php.net/manual/en/language.operators.precedence.php - */ - public function precedence(): int - { - return 24; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - public function matches($other): bool - { - foreach ($this->constraints() as $constraint) { - if ($constraint->evaluate($other, '', true)) { - return true; - } - } - - return false; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalXor.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalXor.php deleted file mode 100644 index fbdb479b..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalXor.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 PHPUnit\Framework\Constraint; - -use function array_reduce; -use function array_shift; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class LogicalXor extends BinaryOperator -{ - /** - * Returns the name of this operator. - */ - public function operator(): string - { - return 'xor'; - } - - /** - * Returns this operator's precedence. - * - * @see https://www.php.net/manual/en/language.operators.precedence.php. - */ - public function precedence(): int - { - return 23; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - public function matches($other): bool - { - $constraints = $this->constraints(); - - $initial = array_shift($constraints); - - if ($initial === null) { - return false; - } - - return array_reduce( - $constraints, - static function (bool $matches, Constraint $constraint) use ($other): bool - { - return $matches xor $constraint->evaluate($other, '', true); - }, - $initial->evaluate($other, '', true) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/Operator.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/Operator.php deleted file mode 100644 index 3f51a0f4..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/Operator.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -abstract class Operator extends Constraint -{ - /** - * Returns the name of this operator. - */ - abstract public function operator(): string; - - /** - * Returns this operator's precedence. - * - * @see https://www.php.net/manual/en/language.operators.precedence.php - */ - abstract public function precedence(): int; - - /** - * Returns the number of operands. - */ - abstract public function arity(): int; - - /** - * Validates $constraint argument. - */ - protected function checkConstraint($constraint): Constraint - { - if (!$constraint instanceof Constraint) { - return new IsEqual($constraint); - } - - return $constraint; - } - - /** - * Returns true if the $constraint needs to be wrapped with braces. - */ - protected function constraintNeedsParentheses(Constraint $constraint): bool - { - return $constraint instanceof self && - $constraint->arity() > 1 && - $this->precedence() <= $constraint->precedence(); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/UnaryOperator.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/UnaryOperator.php deleted file mode 100644 index 0a7a5fa2..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/UnaryOperator.php +++ /dev/null @@ -1,140 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function count; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -abstract class UnaryOperator extends Operator -{ - /** - * @var Constraint - */ - private $constraint; - - /** - * @param Constraint|mixed $constraint - */ - public function __construct($constraint) - { - $this->constraint = $this->checkConstraint($constraint); - } - - /** - * Returns the number of operands (constraints). - */ - public function arity(): int - { - return 1; - } - - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - $reduced = $this->reduce(); - - if ($reduced !== $this) { - return $reduced->toString(); - } - - $constraint = $this->constraint->reduce(); - - if ($this->constraintNeedsParentheses($constraint)) { - return $this->operator() . '( ' . $constraint->toString() . ' )'; - } - - $string = $constraint->toStringInContext($this, 0); - - if ($string === '') { - return $this->transformString($constraint->toString()); - } - - return $string; - } - - /** - * Counts the number of constraint elements. - */ - public function count(): int - { - return count($this->constraint); - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - protected function failureDescription($other): string - { - $reduced = $this->reduce(); - - if ($reduced !== $this) { - return $reduced->failureDescription($other); - } - - $constraint = $this->constraint->reduce(); - - if ($this->constraintNeedsParentheses($constraint)) { - return $this->operator() . '( ' . $constraint->failureDescription($other) . ' )'; - } - - $string = $constraint->failureDescriptionInContext($this, 0, $other); - - if ($string === '') { - return $this->transformString($constraint->failureDescription($other)); - } - - return $string; - } - - /** - * Transforms string returned by the memeber constraint's toString() or - * failureDescription() such that it reflects constraint's participation in - * this expression. - * - * The method may be overwritten in a subclass to apply default - * transformation in case the operand constraint does not provide its own - * custom strings via toStringInContext() or failureDescriptionInContext(). - * - * @param string $string the string to be transformed - */ - protected function transformString(string $string): string - { - return $string; - } - - /** - * Provides access to $this->constraint for subclasses. - */ - final protected function constraint(): Constraint - { - return $this->constraint; - } - - /** - * Returns true if the $constraint needs to be wrapped with parentheses. - */ - protected function constraintNeedsParentheses(Constraint $constraint): bool - { - $constraint = $constraint->reduce(); - - return $constraint instanceof self || parent::constraintNeedsParentheses($constraint); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/String/IsJson.php b/vendor/phpunit/phpunit/src/Framework/Constraint/String/IsJson.php deleted file mode 100644 index 97b29461..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/String/IsJson.php +++ /dev/null @@ -1,77 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function json_decode; -use function json_last_error; -use function sprintf; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class IsJson extends Constraint -{ - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return 'is valid JSON'; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - if ($other === '') { - return false; - } - - json_decode($other); - - if (json_last_error()) { - return false; - } - - return true; - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - protected function failureDescription($other): string - { - if ($other === '') { - return 'an empty string is valid JSON'; - } - - json_decode($other); - $error = (string) JsonMatchesErrorMessageProvider::determineJsonError( - (string) json_last_error() - ); - - return sprintf( - '%s is valid JSON (%s)', - $this->exporter()->shortenedExport($other), - $error - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/String/RegularExpression.php b/vendor/phpunit/phpunit/src/Framework/Constraint/String/RegularExpression.php deleted file mode 100644 index 8e609e79..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/String/RegularExpression.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 PHPUnit\Framework\Constraint; - -use function preg_match; -use function sprintf; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -class RegularExpression extends Constraint -{ - /** - * @var string - */ - private $pattern; - - public function __construct(string $pattern) - { - $this->pattern = $pattern; - } - - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return sprintf( - 'matches PCRE pattern "%s"', - $this->pattern - ); - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return preg_match($this->pattern, $other) > 0; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringContains.php b/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringContains.php deleted file mode 100644 index 6279f37b..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringContains.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function mb_stripos; -use function mb_strtolower; -use function sprintf; -use function strpos; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class StringContains extends Constraint -{ - /** - * @var string - */ - private $string; - - /** - * @var bool - */ - private $ignoreCase; - - public function __construct(string $string, bool $ignoreCase = false) - { - $this->string = $string; - $this->ignoreCase = $ignoreCase; - } - - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - if ($this->ignoreCase) { - $string = mb_strtolower($this->string, 'UTF-8'); - } else { - $string = $this->string; - } - - return sprintf( - 'contains "%s"', - $string - ); - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - if ('' === $this->string) { - return true; - } - - if ($this->ignoreCase) { - /* - * We must use the multi byte safe version so we can accurately compare non latin upper characters with - * their lowercase equivalents. - */ - return mb_stripos($other, $this->string, 0, 'UTF-8') !== false; - } - - /* - * Use the non multi byte safe functions to see if the string is contained in $other. - * - * This function is very fast and we don't care about the character position in the string. - * - * Additionally, we want this method to be binary safe so we can check if some binary data is in other binary - * data. - */ - return strpos($other, $this->string) !== false; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringEndsWith.php b/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringEndsWith.php deleted file mode 100644 index bb4ce23b..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringEndsWith.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function strlen; -use function substr; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class StringEndsWith extends Constraint -{ - /** - * @var string - */ - private $suffix; - - public function __construct(string $suffix) - { - $this->suffix = $suffix; - } - - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return 'ends with "' . $this->suffix . '"'; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return substr($other, 0 - strlen($this->suffix)) === $this->suffix; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringMatchesFormatDescription.php b/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringMatchesFormatDescription.php deleted file mode 100644 index c4f7324e..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringMatchesFormatDescription.php +++ /dev/null @@ -1,109 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use const DIRECTORY_SEPARATOR; -use function explode; -use function implode; -use function preg_match; -use function preg_quote; -use function preg_replace; -use function strtr; -use SebastianBergmann\Diff\Differ; -use SebastianBergmann\Diff\Output\UnifiedDiffOutputBuilder; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class StringMatchesFormatDescription extends RegularExpression -{ - /** - * @var string - */ - private $string; - - public function __construct(string $string) - { - parent::__construct( - $this->createPatternFromFormat( - $this->convertNewlines($string) - ) - ); - - $this->string = $string; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return parent::matches( - $this->convertNewlines($other) - ); - } - - protected function failureDescription($other): string - { - return 'string matches format description'; - } - - protected function additionalFailureDescription($other): string - { - $from = explode("\n", $this->string); - $to = explode("\n", $this->convertNewlines($other)); - - foreach ($from as $index => $line) { - if (isset($to[$index]) && $line !== $to[$index]) { - $line = $this->createPatternFromFormat($line); - - if (preg_match($line, $to[$index]) > 0) { - $from[$index] = $to[$index]; - } - } - } - - $this->string = implode("\n", $from); - $other = implode("\n", $to); - - return (new Differ(new UnifiedDiffOutputBuilder("--- Expected\n+++ Actual\n")))->diff($this->string, $other); - } - - private function createPatternFromFormat(string $string): string - { - $string = strtr( - preg_quote($string, '/'), - [ - '%%' => '%', - '%e' => '\\' . DIRECTORY_SEPARATOR, - '%s' => '[^\r\n]+', - '%S' => '[^\r\n]*', - '%a' => '.+', - '%A' => '.*', - '%w' => '\s*', - '%i' => '[+-]?\d+', - '%d' => '\d+', - '%x' => '[0-9a-fA-F]+', - '%f' => '[+-]?\.?\d+\.?\d*(?:[Ee][+-]?\d+)?', - '%c' => '.', - ] - ); - - return '/^' . $string . '$/s'; - } - - private function convertNewlines(string $text): string - { - return preg_replace('/\r\n/', "\n", $text); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringStartsWith.php b/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringStartsWith.php deleted file mode 100644 index 089545c1..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringStartsWith.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 PHPUnit\Framework\Constraint; - -use function strlen; -use function strpos; -use PHPUnit\Framework\InvalidArgumentException; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class StringStartsWith extends Constraint -{ - /** - * @var string - */ - private $prefix; - - public function __construct(string $prefix) - { - if (strlen($prefix) === 0) { - throw InvalidArgumentException::create(1, 'non-empty string'); - } - - $this->prefix = $prefix; - } - - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return 'starts with "' . $this->prefix . '"'; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return strpos((string) $other, $this->prefix) === 0; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/ArrayHasKey.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/ArrayHasKey.php deleted file mode 100644 index 44cada3a..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/ArrayHasKey.php +++ /dev/null @@ -1,77 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function array_key_exists; -use function is_array; -use ArrayAccess; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class ArrayHasKey extends Constraint -{ - /** - * @var int|string - */ - private $key; - - /** - * @param int|string $key - */ - public function __construct($key) - { - $this->key = $key; - } - - /** - * Returns a string representation of the constraint. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function toString(): string - { - return 'has the key ' . $this->exporter()->export($this->key); - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - if (is_array($other)) { - return array_key_exists($this->key, $other); - } - - if ($other instanceof ArrayAccess) { - return $other->offsetExists($this->key); - } - - return false; - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - protected function failureDescription($other): string - { - return 'an array ' . $this->toString(); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContains.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContains.php deleted file mode 100644 index 39660a98..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContains.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 PHPUnit\Framework\Constraint; - -use function is_array; -use function sprintf; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -abstract class TraversableContains extends Constraint -{ - /** - * @var mixed - */ - private $value; - - public function __construct($value) - { - $this->value = $value; - } - - /** - * Returns a string representation of the constraint. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function toString(): string - { - return 'contains ' . $this->exporter()->export($this->value); - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - protected function failureDescription($other): string - { - return sprintf( - '%s %s', - is_array($other) ? 'an array' : 'a traversable', - $this->toString() - ); - } - - protected function value() - { - return $this->value; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsEqual.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsEqual.php deleted file mode 100644 index c315e709..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsEqual.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use SplObjectStorage; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class TraversableContainsEqual extends TraversableContains -{ - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - if ($other instanceof SplObjectStorage) { - return $other->contains($this->value()); - } - - foreach ($other as $element) { - /* @noinspection TypeUnsafeComparisonInspection */ - if ($this->value() == $element) { - return true; - } - } - - return false; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsIdentical.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsIdentical.php deleted file mode 100644 index a3437dbc..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsIdentical.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use SplObjectStorage; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class TraversableContainsIdentical extends TraversableContains -{ - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - if ($other instanceof SplObjectStorage) { - return $other->contains($this->value()); - } - - foreach ($other as $element) { - if ($this->value() === $element) { - return true; - } - } - - return false; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsOnly.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsOnly.php deleted file mode 100644 index cf4a46b4..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsOnly.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 PHPUnit\Framework\Constraint; - -use PHPUnit\Framework\ExpectationFailedException; -use Traversable; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class TraversableContainsOnly extends Constraint -{ - /** - * @var Constraint - */ - private $constraint; - - /** - * @var string - */ - private $type; - - /** - * @throws \PHPUnit\Framework\Exception - */ - public function __construct(string $type, bool $isNativeType = true) - { - if ($isNativeType) { - $this->constraint = new IsType($type); - } else { - $this->constraint = new IsInstanceOf( - $type - ); - } - - $this->type = $type; - } - - /** - * Evaluates the constraint for parameter $other. - * - * If $returnResult is set to false (the default), an exception is thrown - * in case of a failure. null is returned otherwise. - * - * If $returnResult is true, the result of the evaluation is returned as - * a boolean value instead: true in case of success, false in case of a - * failure. - * - * @param mixed|Traversable $other - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public function evaluate($other, string $description = '', bool $returnResult = false): ?bool - { - $success = true; - - foreach ($other as $item) { - if (!$this->constraint->evaluate($item, '', true)) { - $success = false; - - break; - } - } - - if ($returnResult) { - return $success; - } - - if (!$success) { - $this->fail($other, $description); - } - - return null; - } - - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return 'contains only values of type "' . $this->type . '"'; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsInstanceOf.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsInstanceOf.php deleted file mode 100644 index f0fa02b9..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsInstanceOf.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 PHPUnit\Framework\Constraint; - -use function sprintf; -use ReflectionClass; -use ReflectionException; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class IsInstanceOf extends Constraint -{ - /** - * @var string - */ - private $className; - - public function __construct(string $className) - { - $this->className = $className; - } - - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return sprintf( - 'is instance of %s "%s"', - $this->getType(), - $this->className - ); - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return $other instanceof $this->className; - } - - /** - * Returns the description of the failure. - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other evaluated value or object - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - protected function failureDescription($other): string - { - return sprintf( - '%s is an instance of %s "%s"', - $this->exporter()->shortenedExport($other), - $this->getType(), - $this->className - ); - } - - private function getType(): string - { - try { - $reflection = new ReflectionClass($this->className); - - if ($reflection->isInterface()) { - return 'interface'; - } - } catch (ReflectionException $e) { - } - - return 'class'; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsNull.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsNull.php deleted file mode 100644 index b9fcdd7a..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsNull.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class IsNull extends Constraint -{ - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return 'is null'; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - return $other === null; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsType.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsType.php deleted file mode 100644 index 5bc691d7..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsType.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 PHPUnit\Framework\Constraint; - -use function gettype; -use function is_array; -use function is_bool; -use function is_callable; -use function is_float; -use function is_int; -use function is_iterable; -use function is_numeric; -use function is_object; -use function is_scalar; -use function is_string; -use function sprintf; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class IsType extends Constraint -{ - /** - * @var string - */ - public const TYPE_ARRAY = 'array'; - - /** - * @var string - */ - public const TYPE_BOOL = 'bool'; - - /** - * @var string - */ - public const TYPE_FLOAT = 'float'; - - /** - * @var string - */ - public const TYPE_INT = 'int'; - - /** - * @var string - */ - public const TYPE_NULL = 'null'; - - /** - * @var string - */ - public const TYPE_NUMERIC = 'numeric'; - - /** - * @var string - */ - public const TYPE_OBJECT = 'object'; - - /** - * @var string - */ - public const TYPE_RESOURCE = 'resource'; - - /** - * @var string - */ - public const TYPE_CLOSED_RESOURCE = 'resource (closed)'; - - /** - * @var string - */ - public const TYPE_STRING = 'string'; - - /** - * @var string - */ - public const TYPE_SCALAR = 'scalar'; - - /** - * @var string - */ - public const TYPE_CALLABLE = 'callable'; - - /** - * @var string - */ - public const TYPE_ITERABLE = 'iterable'; - - /** - * @var array - */ - private const KNOWN_TYPES = [ - 'array' => true, - 'boolean' => true, - 'bool' => true, - 'double' => true, - 'float' => true, - 'integer' => true, - 'int' => true, - 'null' => true, - 'numeric' => true, - 'object' => true, - 'real' => true, - 'resource' => true, - 'resource (closed)' => true, - 'string' => true, - 'scalar' => true, - 'callable' => true, - 'iterable' => true, - ]; - - /** - * @var string - */ - private $type; - - /** - * @throws \PHPUnit\Framework\Exception - */ - public function __construct(string $type) - { - if (!isset(self::KNOWN_TYPES[$type])) { - throw new \PHPUnit\Framework\Exception( - sprintf( - 'Type specified for PHPUnit\Framework\Constraint\IsType <%s> ' . - 'is not a valid type.', - $type - ) - ); - } - - $this->type = $type; - } - - /** - * Returns a string representation of the constraint. - */ - public function toString(): string - { - return sprintf( - 'is of type "%s"', - $this->type - ); - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other value or object to evaluate - */ - protected function matches($other): bool - { - switch ($this->type) { - case 'numeric': - return is_numeric($other); - - case 'integer': - case 'int': - return is_int($other); - - case 'double': - case 'float': - case 'real': - return is_float($other); - - case 'string': - return is_string($other); - - case 'boolean': - case 'bool': - return is_bool($other); - - case 'null': - return null === $other; - - case 'array': - return is_array($other); - - case 'object': - return is_object($other); - - case 'resource': - $type = gettype($other); - - return $type === 'resource' || $type === 'resource (closed)'; - - case 'resource (closed)': - return gettype($other) === 'resource (closed)'; - - case 'scalar': - return is_scalar($other); - - case 'callable': - return is_callable($other); - - case 'iterable': - return is_iterable($other); - - default: - return false; - } - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/DataProviderTestSuite.php b/vendor/phpunit/phpunit/src/Framework/DataProviderTestSuite.php deleted file mode 100644 index 18b54999..00000000 --- a/vendor/phpunit/phpunit/src/Framework/DataProviderTestSuite.php +++ /dev/null @@ -1,75 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -use function explode; -use PHPUnit\Util\Test as TestUtil; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class DataProviderTestSuite extends TestSuite -{ - /** - * @var list - */ - private $dependencies = []; - - /** - * @param list $dependencies - */ - public function setDependencies(array $dependencies): void - { - $this->dependencies = $dependencies; - - foreach ($this->tests as $test) { - if (!$test instanceof TestCase) { - // @codeCoverageIgnoreStart - continue; - // @codeCoverageIgnoreStart - } - $test->setDependencies($dependencies); - } - } - - /** - * @return list - */ - public function provides(): array - { - if ($this->providedTests === null) { - $this->providedTests = [new ExecutionOrderDependency($this->getName())]; - } - - return $this->providedTests; - } - - /** - * @return list - */ - public function requires(): array - { - // A DataProviderTestSuite does not have to traverse its child tests - // as these are inherited and cannot reference dataProvider rows directly - return $this->dependencies; - } - - /** - * Returns the size of the each test created using the data provider(s). - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function getSize(): int - { - [$className, $methodName] = explode('::', $this->getName()); - - return TestUtil::getSize($className, $methodName); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Error/Deprecated.php b/vendor/phpunit/phpunit/src/Framework/Error/Deprecated.php deleted file mode 100644 index db62195f..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Error/Deprecated.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Error; - -/** - * @internal - */ -final class Deprecated extends Error -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/Error/Error.php b/vendor/phpunit/phpunit/src/Framework/Error/Error.php deleted file mode 100644 index 2990b360..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Error/Error.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 PHPUnit\Framework\Error; - -use PHPUnit\Framework\Exception; - -/** - * @internal - */ -class Error extends Exception -{ - public function __construct(string $message, int $code, string $file, int $line, \Exception $previous = null) - { - parent::__construct($message, $code, $previous); - - $this->file = $file; - $this->line = $line; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Error/Notice.php b/vendor/phpunit/phpunit/src/Framework/Error/Notice.php deleted file mode 100644 index 54e5e31e..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Error/Notice.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Error; - -/** - * @internal - */ -final class Notice extends Error -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/Error/Warning.php b/vendor/phpunit/phpunit/src/Framework/Error/Warning.php deleted file mode 100644 index 0c0c0064..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Error/Warning.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Error; - -/** - * @internal - */ -final class Warning extends Error -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/ErrorTestCase.php b/vendor/phpunit/phpunit/src/Framework/ErrorTestCase.php deleted file mode 100644 index 841247d7..00000000 --- a/vendor/phpunit/phpunit/src/Framework/ErrorTestCase.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 PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ErrorTestCase extends TestCase -{ - /** - * @var bool - */ - protected $backupGlobals = false; - - /** - * @var bool - */ - protected $backupStaticAttributes = false; - - /** - * @var bool - */ - protected $runTestInSeparateProcess = false; - - /** - * @var string - */ - private $message; - - public function __construct(string $message = '') - { - $this->message = $message; - - parent::__construct('Error'); - } - - public function getMessage(): string - { - return $this->message; - } - - /** - * Returns a string representation of the test case. - */ - public function toString(): string - { - return 'Error'; - } - - /** - * @throws Exception - * - * @psalm-return never-return - */ - protected function runTest(): void - { - throw new Error($this->message); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/ActualValueIsNotAnObjectException.php b/vendor/phpunit/phpunit/src/Framework/Exception/ActualValueIsNotAnObjectException.php deleted file mode 100644 index adae2829..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/ActualValueIsNotAnObjectException.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 PHPUnit\Framework; - -use const PHP_EOL; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ActualValueIsNotAnObjectException extends Exception -{ - public function __construct() - { - parent::__construct( - 'Actual value is not an object', - 0, - null - ); - } - - public function __toString(): string - { - return $this->getMessage() . PHP_EOL; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/AssertionFailedError.php b/vendor/phpunit/phpunit/src/Framework/Exception/AssertionFailedError.php deleted file mode 100644 index 0ba25286..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/AssertionFailedError.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 PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -class AssertionFailedError extends Exception implements SelfDescribing -{ - /** - * Wrapper for getMessage() which is declared as final. - */ - public function toString(): string - { - return $this->getMessage(); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/CodeCoverageException.php b/vendor/phpunit/phpunit/src/Framework/Exception/CodeCoverageException.php deleted file mode 100644 index 36b07231..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/CodeCoverageException.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -class CodeCoverageException extends Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotAcceptParameterTypeException.php b/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotAcceptParameterTypeException.php deleted file mode 100644 index ebd68f34..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotAcceptParameterTypeException.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -use const PHP_EOL; -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ComparisonMethodDoesNotAcceptParameterTypeException extends Exception -{ - public function __construct(string $className, string $methodName, string $type) - { - parent::__construct( - sprintf( - '%s is not an accepted argument type for comparison method %s::%s().', - $type, - $className, - $methodName - ), - 0, - null - ); - } - - public function __toString(): string - { - return $this->getMessage() . PHP_EOL; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareBoolReturnTypeException.php b/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareBoolReturnTypeException.php deleted file mode 100644 index 20189cde..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareBoolReturnTypeException.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 PHPUnit\Framework; - -use const PHP_EOL; -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ComparisonMethodDoesNotDeclareBoolReturnTypeException extends Exception -{ - public function __construct(string $className, string $methodName) - { - parent::__construct( - sprintf( - 'Comparison method %s::%s() does not declare bool return type.', - $className, - $methodName - ), - 0, - null - ); - } - - public function __toString(): string - { - return $this->getMessage() . PHP_EOL; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareExactlyOneParameterException.php b/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareExactlyOneParameterException.php deleted file mode 100644 index bd09d87c..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareExactlyOneParameterException.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 PHPUnit\Framework; - -use const PHP_EOL; -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ComparisonMethodDoesNotDeclareExactlyOneParameterException extends Exception -{ - public function __construct(string $className, string $methodName) - { - parent::__construct( - sprintf( - 'Comparison method %s::%s() does not declare exactly one parameter.', - $className, - $methodName - ), - 0, - null - ); - } - - public function __toString(): string - { - return $this->getMessage() . PHP_EOL; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareParameterTypeException.php b/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareParameterTypeException.php deleted file mode 100644 index 9bbb112e..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareParameterTypeException.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 PHPUnit\Framework; - -use const PHP_EOL; -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ComparisonMethodDoesNotDeclareParameterTypeException extends Exception -{ - public function __construct(string $className, string $methodName) - { - parent::__construct( - sprintf( - 'Parameter of comparison method %s::%s() does not have a declared type.', - $className, - $methodName - ), - 0, - null - ); - } - - public function __toString(): string - { - return $this->getMessage() . PHP_EOL; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotExistException.php b/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotExistException.php deleted file mode 100644 index ad0e2d08..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotExistException.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 PHPUnit\Framework; - -use const PHP_EOL; -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ComparisonMethodDoesNotExistException extends Exception -{ - public function __construct(string $className, string $methodName) - { - parent::__construct( - sprintf( - 'Comparison method %s::%s() does not exist.', - $className, - $methodName - ), - 0, - null - ); - } - - public function __toString(): string - { - return $this->getMessage() . PHP_EOL; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/CoveredCodeNotExecutedException.php b/vendor/phpunit/phpunit/src/Framework/Exception/CoveredCodeNotExecutedException.php deleted file mode 100644 index 78f89bc3..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/CoveredCodeNotExecutedException.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class CoveredCodeNotExecutedException extends RiskyTestError -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/Error.php b/vendor/phpunit/phpunit/src/Framework/Exception/Error.php deleted file mode 100644 index d43e4218..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/Error.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 PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Error extends Exception implements SelfDescribing -{ - /** - * Wrapper for getMessage() which is declared as final. - */ - public function toString(): string - { - return $this->getMessage(); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/Exception.php b/vendor/phpunit/phpunit/src/Framework/Exception/Exception.php deleted file mode 100644 index 0b21e6de..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/Exception.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 PHPUnit\Framework; - -use function array_keys; -use function get_object_vars; -use PHPUnit\Util\Filter; -use RuntimeException; -use Throwable; - -/** - * Base class for all PHPUnit Framework exceptions. - * - * Ensures that exceptions thrown during a test run do not leave stray - * references behind. - * - * Every Exception contains a stack trace. Each stack frame contains the 'args' - * of the called function. The function arguments can contain references to - * instantiated objects. The references prevent the objects from being - * destructed (until test results are eventually printed), so memory cannot be - * freed up. - * - * With enabled process isolation, test results are serialized in the child - * process and unserialized in the parent process. The stack trace of Exceptions - * may contain objects that cannot be serialized or unserialized (e.g., PDO - * connections). Unserializing user-space objects from the child process into - * the parent would break the intended encapsulation of process isolation. - * - * @see http://fabien.potencier.org/article/9/php-serialization-stack-traces-and-exceptions - * - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -class Exception extends RuntimeException implements \PHPUnit\Exception -{ - /** - * @var array - */ - protected $serializableTrace; - - public function __construct($message = '', $code = 0, Throwable $previous = null) - { - parent::__construct($message, $code, $previous); - - $this->serializableTrace = $this->getTrace(); - - foreach (array_keys($this->serializableTrace) as $key) { - unset($this->serializableTrace[$key]['args']); - } - } - - public function __toString(): string - { - $string = TestFailure::exceptionToString($this); - - if ($trace = Filter::getFilteredStacktrace($this)) { - $string .= "\n" . $trace; - } - - return $string; - } - - public function __sleep(): array - { - return array_keys(get_object_vars($this)); - } - - /** - * Returns the serializable trace (without 'args'). - */ - public function getSerializableTrace(): array - { - return $this->serializableTrace; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/ExpectationFailedException.php b/vendor/phpunit/phpunit/src/Framework/Exception/ExpectationFailedException.php deleted file mode 100644 index b9a595a8..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/ExpectationFailedException.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. - */ -namespace PHPUnit\Framework; - -use Exception; -use SebastianBergmann\Comparator\ComparisonFailure; - -/** - * Exception for expectations which failed their check. - * - * The exception contains the error message and optionally a - * SebastianBergmann\Comparator\ComparisonFailure which is used to - * generate diff output of the failed expectations. - * - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ExpectationFailedException extends AssertionFailedError -{ - /** - * @var ComparisonFailure - */ - protected $comparisonFailure; - - public function __construct(string $message, ComparisonFailure $comparisonFailure = null, Exception $previous = null) - { - $this->comparisonFailure = $comparisonFailure; - - parent::__construct($message, 0, $previous); - } - - public function getComparisonFailure(): ?ComparisonFailure - { - return $this->comparisonFailure; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/IncompleteTestError.php b/vendor/phpunit/phpunit/src/Framework/Exception/IncompleteTestError.php deleted file mode 100644 index 65f9c8bc..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/IncompleteTestError.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class IncompleteTestError extends AssertionFailedError implements IncompleteTest -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/InvalidArgumentException.php b/vendor/phpunit/phpunit/src/Framework/Exception/InvalidArgumentException.php deleted file mode 100644 index 77f58079..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -use function debug_backtrace; -use function in_array; -use function lcfirst; -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class InvalidArgumentException extends Exception -{ - public static function create(int $argument, string $type): self - { - $stack = debug_backtrace(); - $function = $stack[1]['function']; - - if (isset($stack[1]['class'])) { - $function = sprintf('%s::%s', $stack[1]['class'], $stack[1]['function']); - } - - return new self( - sprintf( - 'Argument #%d of %s() must be %s %s', - $argument, - $function, - in_array(lcfirst($type)[0], ['a', 'e', 'i', 'o', 'u'], true) ? 'an' : 'a', - $type - ) - ); - } - - private function __construct(string $message = '', int $code = 0, \Exception $previous = null) - { - parent::__construct($message, $code, $previous); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/InvalidCoversTargetException.php b/vendor/phpunit/phpunit/src/Framework/Exception/InvalidCoversTargetException.php deleted file mode 100644 index ebf2994a..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/InvalidCoversTargetException.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class InvalidCoversTargetException extends CodeCoverageException -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/InvalidDataProviderException.php b/vendor/phpunit/phpunit/src/Framework/Exception/InvalidDataProviderException.php deleted file mode 100644 index 7e2ef24c..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/InvalidDataProviderException.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class InvalidDataProviderException extends Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/MissingCoversAnnotationException.php b/vendor/phpunit/phpunit/src/Framework/Exception/MissingCoversAnnotationException.php deleted file mode 100644 index 567a6c4c..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/MissingCoversAnnotationException.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class MissingCoversAnnotationException extends RiskyTestError -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/NoChildTestSuiteException.php b/vendor/phpunit/phpunit/src/Framework/Exception/NoChildTestSuiteException.php deleted file mode 100644 index 7ef4153b..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/NoChildTestSuiteException.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class NoChildTestSuiteException extends Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/OutputError.php b/vendor/phpunit/phpunit/src/Framework/Exception/OutputError.php deleted file mode 100644 index 1c8b37e5..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/OutputError.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class OutputError extends AssertionFailedError -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/PHPTAssertionFailedError.php b/vendor/phpunit/phpunit/src/Framework/Exception/PHPTAssertionFailedError.php deleted file mode 100644 index 17126139..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/PHPTAssertionFailedError.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 PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class PHPTAssertionFailedError extends SyntheticError -{ - /** - * @var string - */ - private $diff; - - public function __construct(string $message, int $code, string $file, int $line, array $trace, string $diff) - { - parent::__construct($message, $code, $file, $line, $trace); - $this->diff = $diff; - } - - public function getDiff(): string - { - return $this->diff; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/RiskyTestError.php b/vendor/phpunit/phpunit/src/Framework/Exception/RiskyTestError.php deleted file mode 100644 index a66552c0..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/RiskyTestError.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -class RiskyTestError extends AssertionFailedError -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/SkippedTestError.php b/vendor/phpunit/phpunit/src/Framework/Exception/SkippedTestError.php deleted file mode 100644 index 7d553dcf..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/SkippedTestError.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class SkippedTestError extends AssertionFailedError implements SkippedTest -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/SkippedTestSuiteError.php b/vendor/phpunit/phpunit/src/Framework/Exception/SkippedTestSuiteError.php deleted file mode 100644 index 5448508a..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/SkippedTestSuiteError.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class SkippedTestSuiteError extends AssertionFailedError implements SkippedTest -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/SyntheticError.php b/vendor/phpunit/phpunit/src/Framework/Exception/SyntheticError.php deleted file mode 100644 index c3124ba0..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/SyntheticError.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -class SyntheticError extends AssertionFailedError -{ - /** - * The synthetic file. - * - * @var string - */ - protected $syntheticFile = ''; - - /** - * The synthetic line number. - * - * @var int - */ - protected $syntheticLine = 0; - - /** - * The synthetic trace. - * - * @var array - */ - protected $syntheticTrace = []; - - public function __construct(string $message, int $code, string $file, int $line, array $trace) - { - parent::__construct($message, $code); - - $this->syntheticFile = $file; - $this->syntheticLine = $line; - $this->syntheticTrace = $trace; - } - - public function getSyntheticFile(): string - { - return $this->syntheticFile; - } - - public function getSyntheticLine(): int - { - return $this->syntheticLine; - } - - public function getSyntheticTrace(): array - { - return $this->syntheticTrace; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/SyntheticSkippedError.php b/vendor/phpunit/phpunit/src/Framework/Exception/SyntheticSkippedError.php deleted file mode 100644 index f6e155d7..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/SyntheticSkippedError.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class SyntheticSkippedError extends SyntheticError implements SkippedTest -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/UnintentionallyCoveredCodeError.php b/vendor/phpunit/phpunit/src/Framework/Exception/UnintentionallyCoveredCodeError.php deleted file mode 100644 index fcd1d824..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/UnintentionallyCoveredCodeError.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class UnintentionallyCoveredCodeError extends RiskyTestError -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/Warning.php b/vendor/phpunit/phpunit/src/Framework/Exception/Warning.php deleted file mode 100644 index 35e94493..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/Warning.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 PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Warning extends Exception implements SelfDescribing -{ - /** - * Wrapper for getMessage() which is declared as final. - */ - public function toString(): string - { - return $this->getMessage(); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/ExceptionWrapper.php b/vendor/phpunit/phpunit/src/Framework/ExceptionWrapper.php deleted file mode 100644 index 00d40353..00000000 --- a/vendor/phpunit/phpunit/src/Framework/ExceptionWrapper.php +++ /dev/null @@ -1,138 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -use const PHP_VERSION_ID; -use function array_keys; -use function get_class; -use function spl_object_hash; -use PHPUnit\Util\Filter; -use Throwable; -use WeakReference; - -/** - * Wraps Exceptions thrown by code under test. - * - * Re-instantiates Exceptions thrown by user-space code to retain their original - * class names, properties, and stack traces (but without arguments). - * - * Unlike PHPUnit\Framework\Exception, the complete stack of previous Exceptions - * is processed. - * - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ExceptionWrapper extends Exception -{ - /** - * @var string - */ - protected $className; - - /** - * @var null|ExceptionWrapper - */ - protected $previous; - - /** - * @var null|WeakReference - */ - private $originalException; - - public function __construct(Throwable $t) - { - // PDOException::getCode() is a string. - // @see https://php.net/manual/en/class.pdoexception.php#95812 - parent::__construct($t->getMessage(), (int) $t->getCode()); - - $this->setOriginalException($t); - } - - public function __toString(): string - { - $string = TestFailure::exceptionToString($this); - - if ($trace = Filter::getFilteredStacktrace($this)) { - $string .= "\n" . $trace; - } - - if ($this->previous) { - $string .= "\nCaused by\n" . $this->previous; - } - - return $string; - } - - public function getClassName(): string - { - return $this->className; - } - - public function getPreviousWrapped(): ?self - { - return $this->previous; - } - - public function setClassName(string $className): void - { - $this->className = $className; - } - - public function setOriginalException(Throwable $t): void - { - $this->originalException($t); - - $this->className = get_class($t); - $this->file = $t->getFile(); - $this->line = $t->getLine(); - - $this->serializableTrace = $t->getTrace(); - - foreach (array_keys($this->serializableTrace) as $key) { - unset($this->serializableTrace[$key]['args']); - } - - if ($t->getPrevious()) { - $this->previous = new self($t->getPrevious()); - } - } - - public function getOriginalException(): ?Throwable - { - return $this->originalException(); - } - - /** - * Method to contain static originalException to exclude it from stacktrace to prevent the stacktrace contents, - * which can be quite big, from being garbage-collected, thus blocking memory until shutdown. - * - * Approach works both for var_dump() and var_export() and print_r(). - */ - private function originalException(Throwable $exceptionToStore = null): ?Throwable - { - // drop once PHP 7.3 support is removed - if (PHP_VERSION_ID < 70400) { - static $originalExceptions; - - $instanceId = spl_object_hash($this); - - if ($exceptionToStore) { - $originalExceptions[$instanceId] = $exceptionToStore; - } - - return $originalExceptions[$instanceId] ?? null; - } - - if ($exceptionToStore) { - $this->originalException = WeakReference::create($exceptionToStore); - } - - return $this->originalException !== null ? $this->originalException->get() : null; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/ExecutionOrderDependency.php b/vendor/phpunit/phpunit/src/Framework/ExecutionOrderDependency.php deleted file mode 100644 index 09c343c1..00000000 --- a/vendor/phpunit/phpunit/src/Framework/ExecutionOrderDependency.php +++ /dev/null @@ -1,206 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -use function array_filter; -use function array_map; -use function array_values; -use function count; -use function explode; -use function in_array; -use function strpos; -use function trim; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ExecutionOrderDependency -{ - /** - * @var string - */ - private $className = ''; - - /** - * @var string - */ - private $methodName = ''; - - /** - * @var bool - */ - private $useShallowClone = false; - - /** - * @var bool - */ - private $useDeepClone = false; - - public static function createFromDependsAnnotation(string $className, string $annotation): self - { - // Split clone option and target - $parts = explode(' ', trim($annotation), 2); - - if (count($parts) === 1) { - $cloneOption = ''; - $target = $parts[0]; - } else { - $cloneOption = $parts[0]; - $target = $parts[1]; - } - - // Prefix provided class for targets assumed to be in scope - if ($target !== '' && strpos($target, '::') === false) { - $target = $className . '::' . $target; - } - - return new self($target, null, $cloneOption); - } - - /** - * @psalm-param list $dependencies - * - * @psalm-return list - */ - public static function filterInvalid(array $dependencies): array - { - return array_values( - array_filter( - $dependencies, - static function (self $d) - { - return $d->isValid(); - } - ) - ); - } - - /** - * @psalm-param list $existing - * @psalm-param list $additional - * - * @psalm-return list - */ - public static function mergeUnique(array $existing, array $additional): array - { - $existingTargets = array_map( - static function ($dependency) - { - return $dependency->getTarget(); - }, - $existing - ); - - foreach ($additional as $dependency) { - if (in_array($dependency->getTarget(), $existingTargets, true)) { - continue; - } - - $existingTargets[] = $dependency->getTarget(); - $existing[] = $dependency; - } - - return $existing; - } - - /** - * @psalm-param list $left - * @psalm-param list $right - * - * @psalm-return list - */ - public static function diff(array $left, array $right): array - { - if ($right === []) { - return $left; - } - - if ($left === []) { - return []; - } - - $diff = []; - $rightTargets = array_map( - static function ($dependency) - { - return $dependency->getTarget(); - }, - $right - ); - - foreach ($left as $dependency) { - if (in_array($dependency->getTarget(), $rightTargets, true)) { - continue; - } - - $diff[] = $dependency; - } - - return $diff; - } - - public function __construct(string $classOrCallableName, ?string $methodName = null, ?string $option = null) - { - if ($classOrCallableName === '') { - return; - } - - if (strpos($classOrCallableName, '::') !== false) { - [$this->className, $this->methodName] = explode('::', $classOrCallableName); - } else { - $this->className = $classOrCallableName; - $this->methodName = !empty($methodName) ? $methodName : 'class'; - } - - if ($option === 'clone') { - $this->useDeepClone = true; - } elseif ($option === 'shallowClone') { - $this->useShallowClone = true; - } - } - - public function __toString(): string - { - return $this->getTarget(); - } - - public function isValid(): bool - { - // Invalid dependencies can be declared and are skipped by the runner - return $this->className !== '' && $this->methodName !== ''; - } - - public function useShallowClone(): bool - { - return $this->useShallowClone; - } - - public function useDeepClone(): bool - { - return $this->useDeepClone; - } - - public function targetIsClass(): bool - { - return $this->methodName === 'class'; - } - - public function getTarget(): string - { - return $this->isValid() - ? $this->className . '::' . $this->methodName - : ''; - } - - public function getTargetClassName(): string - { - return $this->className; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/IncompleteTest.php b/vendor/phpunit/phpunit/src/Framework/IncompleteTest.php deleted file mode 100644 index b77b1aff..00000000 --- a/vendor/phpunit/phpunit/src/Framework/IncompleteTest.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -interface IncompleteTest extends Throwable -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/IncompleteTestCase.php b/vendor/phpunit/phpunit/src/Framework/IncompleteTestCase.php deleted file mode 100644 index ee1e3e9f..00000000 --- a/vendor/phpunit/phpunit/src/Framework/IncompleteTestCase.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 PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class IncompleteTestCase extends TestCase -{ - /** - * @var bool - */ - protected $backupGlobals = false; - - /** - * @var bool - */ - protected $backupStaticAttributes = false; - - /** - * @var bool - */ - protected $runTestInSeparateProcess = false; - - /** - * @var string - */ - private $message; - - public function __construct(string $className, string $methodName, string $message = '') - { - parent::__construct($className . '::' . $methodName); - - $this->message = $message; - } - - public function getMessage(): string - { - return $this->message; - } - - /** - * Returns a string representation of the test case. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function toString(): string - { - return $this->getName(); - } - - /** - * @throws Exception - */ - protected function runTest(): void - { - $this->markTestIncomplete($this->message); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/InvalidParameterGroupException.php b/vendor/phpunit/phpunit/src/Framework/InvalidParameterGroupException.php deleted file mode 100644 index feb9cc98..00000000 --- a/vendor/phpunit/phpunit/src/Framework/InvalidParameterGroupException.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class InvalidParameterGroupException extends Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Api/Api.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Api/Api.php deleted file mode 100644 index e2f0a280..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Api/Api.php +++ /dev/null @@ -1,97 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use PHPUnit\Framework\MockObject\Builder\InvocationMocker as InvocationMockerBuilder; -use PHPUnit\Framework\MockObject\Rule\InvocationOrder; - -/** - * @internal This trait is not covered by the backward compatibility promise for PHPUnit - */ -trait Api -{ - /** - * @var ConfigurableMethod[] - */ - private static $__phpunit_configurableMethods; - - /** - * @var object - */ - private $__phpunit_originalObject; - - /** - * @var bool - */ - private $__phpunit_returnValueGeneration = true; - - /** - * @var InvocationHandler - */ - private $__phpunit_invocationMocker; - - /** @noinspection MagicMethodsValidityInspection */ - public static function __phpunit_initConfigurableMethods(ConfigurableMethod ...$configurableMethods): void - { - if (isset(static::$__phpunit_configurableMethods)) { - throw new ConfigurableMethodsAlreadyInitializedException( - 'Configurable methods is already initialized and can not be reinitialized' - ); - } - - static::$__phpunit_configurableMethods = $configurableMethods; - } - - /** @noinspection MagicMethodsValidityInspection */ - public function __phpunit_setOriginalObject($originalObject): void - { - $this->__phpunit_originalObject = $originalObject; - } - - /** @noinspection MagicMethodsValidityInspection */ - public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration): void - { - $this->__phpunit_returnValueGeneration = $returnValueGeneration; - } - - /** @noinspection MagicMethodsValidityInspection */ - public function __phpunit_getInvocationHandler(): InvocationHandler - { - if ($this->__phpunit_invocationMocker === null) { - $this->__phpunit_invocationMocker = new InvocationHandler( - static::$__phpunit_configurableMethods, - $this->__phpunit_returnValueGeneration - ); - } - - return $this->__phpunit_invocationMocker; - } - - /** @noinspection MagicMethodsValidityInspection */ - public function __phpunit_hasMatchers(): bool - { - return $this->__phpunit_getInvocationHandler()->hasMatchers(); - } - - /** @noinspection MagicMethodsValidityInspection */ - public function __phpunit_verify(bool $unsetInvocationMocker = true): void - { - $this->__phpunit_getInvocationHandler()->verify(); - - if ($unsetInvocationMocker) { - $this->__phpunit_invocationMocker = null; - } - } - - public function expects(InvocationOrder $matcher): InvocationMockerBuilder - { - return $this->__phpunit_getInvocationHandler()->expects($matcher); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Api/Method.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Api/Method.php deleted file mode 100644 index f6df7533..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Api/Method.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 PHPUnit\Framework\MockObject; - -use function call_user_func_array; -use function func_get_args; -use PHPUnit\Framework\MockObject\Rule\AnyInvokedCount; - -/** - * @internal This trait is not covered by the backward compatibility promise for PHPUnit - */ -trait Method -{ - public function method() - { - $expects = $this->expects(new AnyInvokedCount); - - return call_user_func_array( - [$expects, 'method'], - func_get_args() - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/Identity.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/Identity.php deleted file mode 100644 index a68bfadf..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/Identity.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 PHPUnit\Framework\MockObject\Builder; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -interface Identity -{ - /** - * Sets the identification of the expectation to $id. - * - * @note The identifier is unique per mock object. - * - * @param string $id unique identification of expectation - */ - public function id($id); -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationMocker.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationMocker.php deleted file mode 100644 index 89b1e31a..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationMocker.php +++ /dev/null @@ -1,306 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Builder; - -use function array_map; -use function array_merge; -use function count; -use function in_array; -use function is_string; -use function strtolower; -use PHPUnit\Framework\Constraint\Constraint; -use PHPUnit\Framework\MockObject\ConfigurableMethod; -use PHPUnit\Framework\MockObject\IncompatibleReturnValueException; -use PHPUnit\Framework\MockObject\InvocationHandler; -use PHPUnit\Framework\MockObject\Matcher; -use PHPUnit\Framework\MockObject\MatcherAlreadyRegisteredException; -use PHPUnit\Framework\MockObject\MethodCannotBeConfiguredException; -use PHPUnit\Framework\MockObject\MethodNameAlreadyConfiguredException; -use PHPUnit\Framework\MockObject\MethodNameNotConfiguredException; -use PHPUnit\Framework\MockObject\MethodParametersAlreadyConfiguredException; -use PHPUnit\Framework\MockObject\Rule; -use PHPUnit\Framework\MockObject\Stub\ConsecutiveCalls; -use PHPUnit\Framework\MockObject\Stub\Exception; -use PHPUnit\Framework\MockObject\Stub\ReturnArgument; -use PHPUnit\Framework\MockObject\Stub\ReturnCallback; -use PHPUnit\Framework\MockObject\Stub\ReturnReference; -use PHPUnit\Framework\MockObject\Stub\ReturnSelf; -use PHPUnit\Framework\MockObject\Stub\ReturnStub; -use PHPUnit\Framework\MockObject\Stub\ReturnValueMap; -use PHPUnit\Framework\MockObject\Stub\Stub; -use Throwable; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class InvocationMocker implements InvocationStubber, MethodNameMatch -{ - /** - * @var InvocationHandler - */ - private $invocationHandler; - - /** - * @var Matcher - */ - private $matcher; - - /** - * @var ConfigurableMethod[] - */ - private $configurableMethods; - - public function __construct(InvocationHandler $handler, Matcher $matcher, ConfigurableMethod ...$configurableMethods) - { - $this->invocationHandler = $handler; - $this->matcher = $matcher; - $this->configurableMethods = $configurableMethods; - } - - /** - * @throws MatcherAlreadyRegisteredException - * - * @return $this - */ - public function id($id): self - { - $this->invocationHandler->registerMatcher($id, $this->matcher); - - return $this; - } - - /** - * @return $this - */ - public function will(Stub $stub): Identity - { - $this->matcher->setStub($stub); - - return $this; - } - - /** - * @param mixed $value - * @param mixed[] $nextValues - * - * @throws IncompatibleReturnValueException - */ - public function willReturn($value, ...$nextValues): self - { - if (count($nextValues) === 0) { - $this->ensureTypeOfReturnValues([$value]); - - $stub = $value instanceof Stub ? $value : new ReturnStub($value); - } else { - $values = array_merge([$value], $nextValues); - - $this->ensureTypeOfReturnValues($values); - - $stub = new ConsecutiveCalls($values); - } - - return $this->will($stub); - } - - public function willReturnReference(&$reference): self - { - $stub = new ReturnReference($reference); - - return $this->will($stub); - } - - public function willReturnMap(array $valueMap): self - { - $stub = new ReturnValueMap($valueMap); - - return $this->will($stub); - } - - public function willReturnArgument($argumentIndex): self - { - $stub = new ReturnArgument($argumentIndex); - - return $this->will($stub); - } - - public function willReturnCallback($callback): self - { - $stub = new ReturnCallback($callback); - - return $this->will($stub); - } - - public function willReturnSelf(): self - { - $stub = new ReturnSelf; - - return $this->will($stub); - } - - public function willReturnOnConsecutiveCalls(...$values): self - { - $stub = new ConsecutiveCalls($values); - - return $this->will($stub); - } - - public function willThrowException(Throwable $exception): self - { - $stub = new Exception($exception); - - return $this->will($stub); - } - - /** - * @return $this - */ - public function after($id): self - { - $this->matcher->setAfterMatchBuilderId($id); - - return $this; - } - - /** - * @param mixed[] $arguments - * - * @throws \PHPUnit\Framework\Exception - * @throws MethodNameNotConfiguredException - * @throws MethodParametersAlreadyConfiguredException - * - * @return $this - */ - public function with(...$arguments): self - { - $this->ensureParametersCanBeConfigured(); - - $this->matcher->setParametersRule(new Rule\Parameters($arguments)); - - return $this; - } - - /** - * @param array ...$arguments - * - * @throws \PHPUnit\Framework\Exception - * @throws MethodNameNotConfiguredException - * @throws MethodParametersAlreadyConfiguredException - * - * @return $this - */ - public function withConsecutive(...$arguments): self - { - $this->ensureParametersCanBeConfigured(); - - $this->matcher->setParametersRule(new Rule\ConsecutiveParameters($arguments)); - - return $this; - } - - /** - * @throws MethodNameNotConfiguredException - * @throws MethodParametersAlreadyConfiguredException - * - * @return $this - */ - public function withAnyParameters(): self - { - $this->ensureParametersCanBeConfigured(); - - $this->matcher->setParametersRule(new Rule\AnyParameters); - - return $this; - } - - /** - * @param Constraint|string $constraint - * - * @throws \PHPUnit\Framework\InvalidArgumentException - * @throws MethodCannotBeConfiguredException - * @throws MethodNameAlreadyConfiguredException - * - * @return $this - */ - public function method($constraint): self - { - if ($this->matcher->hasMethodNameRule()) { - throw new MethodNameAlreadyConfiguredException; - } - - $configurableMethodNames = array_map( - static function (ConfigurableMethod $configurable) - { - return strtolower($configurable->getName()); - }, - $this->configurableMethods - ); - - if (is_string($constraint) && !in_array(strtolower($constraint), $configurableMethodNames, true)) { - throw new MethodCannotBeConfiguredException($constraint); - } - - $this->matcher->setMethodNameRule(new Rule\MethodName($constraint)); - - return $this; - } - - /** - * @throws MethodNameNotConfiguredException - * @throws MethodParametersAlreadyConfiguredException - */ - private function ensureParametersCanBeConfigured(): void - { - if (!$this->matcher->hasMethodNameRule()) { - throw new MethodNameNotConfiguredException; - } - - if ($this->matcher->hasParametersRule()) { - throw new MethodParametersAlreadyConfiguredException; - } - } - - private function getConfiguredMethod(): ?ConfigurableMethod - { - $configuredMethod = null; - - foreach ($this->configurableMethods as $configurableMethod) { - if ($this->matcher->getMethodNameRule()->matchesName($configurableMethod->getName())) { - if ($configuredMethod !== null) { - return null; - } - - $configuredMethod = $configurableMethod; - } - } - - return $configuredMethod; - } - - /** - * @throws IncompatibleReturnValueException - */ - private function ensureTypeOfReturnValues(array $values): void - { - $configuredMethod = $this->getConfiguredMethod(); - - if ($configuredMethod === null) { - return; - } - - foreach ($values as $value) { - if (!$configuredMethod->mayReturn($value)) { - throw new IncompatibleReturnValueException( - $configuredMethod, - $value - ); - } - } - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationStubber.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationStubber.php deleted file mode 100644 index f32ff0e7..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationStubber.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Builder; - -use PHPUnit\Framework\MockObject\Stub\Stub; -use Throwable; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -interface InvocationStubber -{ - public function will(Stub $stub): Identity; - - /** @return self */ - public function willReturn($value, ...$nextValues)/*: self */; - - /** - * @param mixed $reference - * - * @return self - */ - public function willReturnReference(&$reference)/*: self */; - - /** - * @param array> $valueMap - * - * @return self - */ - public function willReturnMap(array $valueMap)/*: self */; - - /** - * @param int $argumentIndex - * - * @return self - */ - public function willReturnArgument($argumentIndex)/*: self */; - - /** - * @param callable $callback - * - * @return self - */ - public function willReturnCallback($callback)/*: self */; - - /** @return self */ - public function willReturnSelf()/*: self */; - - /** - * @param mixed $values - * - * @return self - */ - public function willReturnOnConsecutiveCalls(...$values)/*: self */; - - /** @return self */ - public function willThrowException(Throwable $exception)/*: self */; -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/MethodNameMatch.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/MethodNameMatch.php deleted file mode 100644 index 543d596c..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/MethodNameMatch.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 PHPUnit\Framework\MockObject\Builder; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -interface MethodNameMatch extends ParametersMatch -{ - /** - * Adds a new method name match and returns the parameter match object for - * further matching possibilities. - * - * @param \PHPUnit\Framework\Constraint\Constraint $constraint Constraint for matching method, if a string is passed it will use the PHPUnit_Framework_Constraint_IsEqual - * - * @return ParametersMatch - */ - public function method($constraint); -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/ParametersMatch.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/ParametersMatch.php deleted file mode 100644 index 707d8255..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/ParametersMatch.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Builder; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -interface ParametersMatch extends Stub -{ - /** - * Defines the expectation which must occur before the current is valid. - * - * @param string $id the identification of the expectation that should - * occur before this one - * - * @return Stub - */ - public function after($id); - - /** - * Sets the parameters to match for, each parameter to this function will - * be part of match. To perform specific matches or constraints create a - * new PHPUnit\Framework\Constraint\Constraint and use it for the parameter. - * If the parameter value is not a constraint it will use the - * PHPUnit\Framework\Constraint\IsEqual for the value. - * - * Some examples: - * - * // match first parameter with value 2 - * $b->with(2); - * // match first parameter with value 'smock' and second identical to 42 - * $b->with('smock', new PHPUnit\Framework\Constraint\IsEqual(42)); - * - * - * @return ParametersMatch - */ - public function with(...$arguments); - - /** - * Sets a rule which allows any kind of parameters. - * - * Some examples: - * - * // match any number of parameters - * $b->withAnyParameters(); - * - * - * @return ParametersMatch - */ - public function withAnyParameters(); -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/Stub.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/Stub.php deleted file mode 100644 index d7cb78fc..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/Stub.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 PHPUnit\Framework\MockObject\Builder; - -use PHPUnit\Framework\MockObject\Stub\Stub as BaseStub; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -interface Stub extends Identity -{ - /** - * Stubs the matching method with the stub object $stub. Any invocations of - * the matched method will now be handled by the stub instead. - */ - public function will(BaseStub $stub): Identity; -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/ConfigurableMethod.php b/vendor/phpunit/phpunit/src/Framework/MockObject/ConfigurableMethod.php deleted file mode 100644 index 4757dc63..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/ConfigurableMethod.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 PHPUnit\Framework\MockObject; - -use SebastianBergmann\Type\Type; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ConfigurableMethod -{ - /** - * @var string - */ - private $name; - - /** - * @var Type - */ - private $returnType; - - public function __construct(string $name, Type $returnType) - { - $this->name = $name; - $this->returnType = $returnType; - } - - public function getName(): string - { - return $this->name; - } - - public function mayReturn($value): bool - { - if ($value === null && $this->returnType->allowsNull()) { - return true; - } - - return $this->returnType->isAssignable(Type::fromValue($value, false)); - } - - public function getReturnTypeDeclaration(): string - { - return $this->returnType->asString(); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/BadMethodCallException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/BadMethodCallException.php deleted file mode 100644 index 7e655e23..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/BadMethodCallException.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class BadMethodCallException extends \BadMethodCallException implements Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseAddMethodsException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseAddMethodsException.php deleted file mode 100644 index 0698870b..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseAddMethodsException.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class CannotUseAddMethodsException extends \PHPUnit\Framework\Exception implements Exception -{ - public function __construct(string $type, string $methodName) - { - parent::__construct( - sprintf( - 'Trying to configure method "%s" with addMethods(), but it exists in class "%s". Use onlyMethods() for methods that exist in the class', - $methodName, - $type - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseOnlyMethodsException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseOnlyMethodsException.php deleted file mode 100644 index 35a29b73..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseOnlyMethodsException.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class CannotUseOnlyMethodsException extends \PHPUnit\Framework\Exception implements Exception -{ - public function __construct(string $type, string $methodName) - { - parent::__construct( - sprintf( - 'Trying to configure method "%s" with onlyMethods(), but it does not exist in class "%s". Use addMethods() for methods that do not exist in the class', - $methodName, - $type - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassAlreadyExistsException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassAlreadyExistsException.php deleted file mode 100644 index 0ba9a187..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassAlreadyExistsException.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 PHPUnit\Framework\MockObject; - -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ClassAlreadyExistsException extends \PHPUnit\Framework\Exception implements Exception -{ - public function __construct(string $className) - { - parent::__construct( - sprintf( - 'Class "%s" already exists', - $className - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsFinalException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsFinalException.php deleted file mode 100644 index e648f026..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsFinalException.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 PHPUnit\Framework\MockObject; - -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ClassIsFinalException extends \PHPUnit\Framework\Exception implements Exception -{ - public function __construct(string $className) - { - parent::__construct( - sprintf( - 'Class "%s" is declared "final" and cannot be doubled', - $className - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsReadonlyException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsReadonlyException.php deleted file mode 100644 index aa1a7451..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsReadonlyException.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 PHPUnit\Framework\MockObject; - -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ClassIsReadonlyException extends \PHPUnit\Framework\Exception implements Exception -{ - public function __construct(string $className) - { - parent::__construct( - sprintf( - 'Class "%s" is declared "readonly" and cannot be doubled', - $className - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ConfigurableMethodsAlreadyInitializedException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ConfigurableMethodsAlreadyInitializedException.php deleted file mode 100644 index d12ac997..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ConfigurableMethodsAlreadyInitializedException.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ConfigurableMethodsAlreadyInitializedException extends \PHPUnit\Framework\Exception implements Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/DuplicateMethodException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/DuplicateMethodException.php deleted file mode 100644 index 1216b45d..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/DuplicateMethodException.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function array_diff_assoc; -use function array_unique; -use function implode; -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class DuplicateMethodException extends \PHPUnit\Framework\Exception implements Exception -{ - /** - * @psalm-param list $methods - */ - public function __construct(array $methods) - { - parent::__construct( - sprintf( - 'Cannot double using a method list that contains duplicates: "%s" (duplicate: "%s")', - implode(', ', $methods), - implode(', ', array_unique(array_diff_assoc($methods, array_unique($methods)))) - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/Exception.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/Exception.php deleted file mode 100644 index 5880bc03..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/Exception.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -interface Exception extends Throwable -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/IncompatibleReturnValueException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/IncompatibleReturnValueException.php deleted file mode 100644 index eec79213..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/IncompatibleReturnValueException.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 PHPUnit\Framework\MockObject; - -use function get_class; -use function gettype; -use function is_object; -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class IncompatibleReturnValueException extends \PHPUnit\Framework\Exception implements Exception -{ - /** - * @param mixed $value - */ - public function __construct(ConfigurableMethod $method, $value) - { - parent::__construct( - sprintf( - 'Method %s may not return value of type %s, its declared return type is "%s"', - $method->getName(), - is_object($value) ? get_class($value) : gettype($value), - $method->getReturnTypeDeclaration() - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/InvalidMethodNameException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/InvalidMethodNameException.php deleted file mode 100644 index d2444cf1..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/InvalidMethodNameException.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 PHPUnit\Framework\MockObject; - -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class InvalidMethodNameException extends \PHPUnit\Framework\Exception implements Exception -{ - public function __construct(string $method) - { - parent::__construct( - sprintf( - 'Cannot double method with invalid name "%s"', - $method - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MatchBuilderNotFoundException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MatchBuilderNotFoundException.php deleted file mode 100644 index c05b2bce..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MatchBuilderNotFoundException.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 PHPUnit\Framework\MockObject; - -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class MatchBuilderNotFoundException extends \PHPUnit\Framework\Exception implements Exception -{ - public function __construct(string $id) - { - parent::__construct( - sprintf( - 'No builder found for match builder identification <%s>', - $id - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MatcherAlreadyRegisteredException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MatcherAlreadyRegisteredException.php deleted file mode 100644 index efcc13ed..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MatcherAlreadyRegisteredException.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 PHPUnit\Framework\MockObject; - -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class MatcherAlreadyRegisteredException extends \PHPUnit\Framework\Exception implements Exception -{ - public function __construct(string $id) - { - parent::__construct( - sprintf( - 'Matcher with id <%s> is already registered', - $id - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodCannotBeConfiguredException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodCannotBeConfiguredException.php deleted file mode 100644 index 70729043..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodCannotBeConfiguredException.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 PHPUnit\Framework\MockObject; - -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class MethodCannotBeConfiguredException extends \PHPUnit\Framework\Exception implements Exception -{ - public function __construct(string $method) - { - parent::__construct( - sprintf( - 'Trying to configure method "%s" which cannot be configured because it does not exist, has not been specified, is final, or is static', - $method - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodNameAlreadyConfiguredException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodNameAlreadyConfiguredException.php deleted file mode 100644 index 1e9f2c04..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodNameAlreadyConfiguredException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class MethodNameAlreadyConfiguredException extends \PHPUnit\Framework\Exception implements Exception -{ - public function __construct() - { - parent::__construct('Method name is already configured'); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodNameNotConfiguredException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodNameNotConfiguredException.php deleted file mode 100644 index 89565b77..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodNameNotConfiguredException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class MethodNameNotConfiguredException extends \PHPUnit\Framework\Exception implements Exception -{ - public function __construct() - { - parent::__construct('Method name is not configured'); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodParametersAlreadyConfiguredException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodParametersAlreadyConfiguredException.php deleted file mode 100644 index 1609c6ff..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodParametersAlreadyConfiguredException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class MethodParametersAlreadyConfiguredException extends \PHPUnit\Framework\Exception implements Exception -{ - public function __construct() - { - parent::__construct('Method parameters already configured'); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/OriginalConstructorInvocationRequiredException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/OriginalConstructorInvocationRequiredException.php deleted file mode 100644 index ecb9b63c..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/OriginalConstructorInvocationRequiredException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class OriginalConstructorInvocationRequiredException extends \PHPUnit\Framework\Exception implements Exception -{ - public function __construct() - { - parent::__construct('Proxying to original methods requires invoking the original constructor'); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ReflectionException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ReflectionException.php deleted file mode 100644 index d6319c69..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ReflectionException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use RuntimeException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ReflectionException extends RuntimeException implements Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ReturnValueNotConfiguredException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ReturnValueNotConfiguredException.php deleted file mode 100644 index 2c16c1dc..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ReturnValueNotConfiguredException.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ReturnValueNotConfiguredException extends \PHPUnit\Framework\Exception implements Exception -{ - public function __construct(Invocation $invocation) - { - parent::__construct( - sprintf( - 'Return value inference disabled and no expectation set up for %s::%s()', - $invocation->getClassName(), - $invocation->getMethodName() - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/RuntimeException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/RuntimeException.php deleted file mode 100644 index 33b6a5be..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/RuntimeException.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class RuntimeException extends \RuntimeException implements Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/SoapExtensionNotAvailableException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/SoapExtensionNotAvailableException.php deleted file mode 100644 index 98837c95..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/SoapExtensionNotAvailableException.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 PHPUnit\Framework\MockObject; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class SoapExtensionNotAvailableException extends \PHPUnit\Framework\Exception implements Exception -{ - public function __construct() - { - parent::__construct( - 'The SOAP extension is required to generate a test double from WSDL' - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownClassException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownClassException.php deleted file mode 100644 index e124f9b1..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownClassException.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 PHPUnit\Framework\MockObject; - -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class UnknownClassException extends \PHPUnit\Framework\Exception implements Exception -{ - public function __construct(string $className) - { - parent::__construct( - sprintf( - 'Class "%s" does not exist', - $className - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTraitException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTraitException.php deleted file mode 100644 index 90fc8d84..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTraitException.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 PHPUnit\Framework\MockObject; - -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class UnknownTraitException extends \PHPUnit\Framework\Exception implements Exception -{ - public function __construct(string $traitName) - { - parent::__construct( - sprintf( - 'Trait "%s" does not exist', - $traitName - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTypeException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTypeException.php deleted file mode 100644 index b1a70edd..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTypeException.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 PHPUnit\Framework\MockObject; - -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class UnknownTypeException extends \PHPUnit\Framework\Exception implements Exception -{ - public function __construct(string $type) - { - parent::__construct( - sprintf( - 'Class or interface "%s" does not exist', - $type - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Generator.php deleted file mode 100644 index 17e3312c..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator.php +++ /dev/null @@ -1,1163 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use const DIRECTORY_SEPARATOR; -use const PHP_EOL; -use const PHP_MAJOR_VERSION; -use const PREG_OFFSET_CAPTURE; -use const WSDL_CACHE_NONE; -use function array_merge; -use function array_pop; -use function array_unique; -use function class_exists; -use function count; -use function explode; -use function extension_loaded; -use function implode; -use function in_array; -use function interface_exists; -use function is_array; -use function is_object; -use function md5; -use function method_exists; -use function mt_rand; -use function preg_match; -use function preg_match_all; -use function range; -use function serialize; -use function sort; -use function sprintf; -use function str_replace; -use function strlen; -use function strpos; -use function strtolower; -use function substr; -use function trait_exists; -use Doctrine\Instantiator\Exception\ExceptionInterface as InstantiatorException; -use Doctrine\Instantiator\Instantiator; -use Exception; -use Iterator; -use IteratorAggregate; -use PHPUnit\Framework\InvalidArgumentException; -use ReflectionClass; -use ReflectionMethod; -use SebastianBergmann\Template\Exception as TemplateException; -use SebastianBergmann\Template\Template; -use SoapClient; -use SoapFault; -use Throwable; -use Traversable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Generator -{ - private const MOCKED_CLONE_METHOD_WITH_VOID_RETURN_TYPE_TRAIT = <<<'EOT' -namespace PHPUnit\Framework\MockObject; - -trait MockedCloneMethodWithVoidReturnType -{ - public function __clone(): void - { - $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationHandler(); - } -} -EOT; - - private const MOCKED_CLONE_METHOD_WITHOUT_RETURN_TYPE_TRAIT = <<<'EOT' -namespace PHPUnit\Framework\MockObject; - -trait MockedCloneMethodWithoutReturnType -{ - public function __clone() - { - $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationHandler(); - } -} -EOT; - - private const UNMOCKED_CLONE_METHOD_WITH_VOID_RETURN_TYPE_TRAIT = <<<'EOT' -namespace PHPUnit\Framework\MockObject; - -trait UnmockedCloneMethodWithVoidReturnType -{ - public function __clone(): void - { - $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationHandler(); - - parent::__clone(); - } -} -EOT; - - private const UNMOCKED_CLONE_METHOD_WITHOUT_RETURN_TYPE_TRAIT = <<<'EOT' -namespace PHPUnit\Framework\MockObject; - -trait UnmockedCloneMethodWithoutReturnType -{ - public function __clone() - { - $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationHandler(); - - parent::__clone(); - } -} -EOT; - - /** - * @var array - */ - private const EXCLUDED_METHOD_NAMES = [ - '__CLASS__' => true, - '__DIR__' => true, - '__FILE__' => true, - '__FUNCTION__' => true, - '__LINE__' => true, - '__METHOD__' => true, - '__NAMESPACE__' => true, - '__TRAIT__' => true, - '__clone' => true, - '__halt_compiler' => true, - ]; - - /** - * @var array - */ - private static $cache = []; - - /** - * @var Template[] - */ - private static $templates = []; - - /** - * Returns a mock object for the specified class. - * - * @param null|array $methods - * - * @throws \PHPUnit\Framework\InvalidArgumentException - * @throws ClassAlreadyExistsException - * @throws ClassIsFinalException - * @throws ClassIsReadonlyException - * @throws DuplicateMethodException - * @throws InvalidMethodNameException - * @throws OriginalConstructorInvocationRequiredException - * @throws ReflectionException - * @throws RuntimeException - * @throws UnknownTypeException - */ - public function getMock(string $type, $methods = [], array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, bool $cloneArguments = true, bool $callOriginalMethods = false, object $proxyTarget = null, bool $allowMockingUnknownTypes = true, bool $returnValueGeneration = true): MockObject - { - if (!is_array($methods) && null !== $methods) { - throw InvalidArgumentException::create(2, 'array'); - } - - if ($type === 'Traversable' || $type === '\\Traversable') { - $type = 'Iterator'; - } - - if (!$allowMockingUnknownTypes && !class_exists($type, $callAutoload) && !interface_exists($type, $callAutoload)) { - throw new UnknownTypeException($type); - } - - if (null !== $methods) { - foreach ($methods as $method) { - if (!preg_match('~[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*~', (string) $method)) { - throw new InvalidMethodNameException((string) $method); - } - } - - if ($methods !== array_unique($methods)) { - throw new DuplicateMethodException($methods); - } - } - - if ($mockClassName !== '' && class_exists($mockClassName, false)) { - try { - $reflector = new ReflectionClass($mockClassName); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if (!$reflector->implementsInterface(MockObject::class)) { - throw new ClassAlreadyExistsException($mockClassName); - } - } - - if (!$callOriginalConstructor && $callOriginalMethods) { - throw new OriginalConstructorInvocationRequiredException; - } - - $mock = $this->generate( - $type, - $methods, - $mockClassName, - $callOriginalClone, - $callAutoload, - $cloneArguments, - $callOriginalMethods - ); - - return $this->getObject( - $mock, - $type, - $callOriginalConstructor, - $callAutoload, - $arguments, - $callOriginalMethods, - $proxyTarget, - $returnValueGeneration - ); - } - - /** - * @psalm-param list $interfaces - * - * @throws RuntimeException - * @throws UnknownTypeException - */ - public function getMockForInterfaces(array $interfaces, bool $callAutoload = true): MockObject - { - if (count($interfaces) < 2) { - throw new RuntimeException('At least two interfaces must be specified'); - } - - foreach ($interfaces as $interface) { - if (!interface_exists($interface, $callAutoload)) { - throw new UnknownTypeException($interface); - } - } - - sort($interfaces); - - $methods = []; - - foreach ($interfaces as $interface) { - $methods = array_merge($methods, $this->getClassMethods($interface)); - } - - if (count(array_unique($methods)) < count($methods)) { - throw new RuntimeException('Interfaces must not declare the same method'); - } - - $unqualifiedNames = []; - - foreach ($interfaces as $interface) { - $parts = explode('\\', $interface); - $unqualifiedNames[] = array_pop($parts); - } - - sort($unqualifiedNames); - - do { - $intersectionName = sprintf( - 'Intersection_%s_%s', - implode('_', $unqualifiedNames), - substr(md5((string) mt_rand()), 0, 8) - ); - } while (interface_exists($intersectionName, false)); - - $template = $this->getTemplate('intersection.tpl'); - - $template->setVar( - [ - 'intersection' => $intersectionName, - 'interfaces' => implode(', ', $interfaces), - ] - ); - - eval($template->render()); - - return $this->getMock($intersectionName); - } - - /** - * Returns a mock object for the specified abstract class with all abstract - * methods of the class mocked. - * - * Concrete methods to mock can be specified with the $mockedMethods parameter. - * - * @psalm-template RealInstanceType of object - * - * @psalm-param class-string $originalClassName - * - * @psalm-return MockObject&RealInstanceType - * - * @throws \PHPUnit\Framework\InvalidArgumentException - * @throws ClassAlreadyExistsException - * @throws ClassIsFinalException - * @throws ClassIsReadonlyException - * @throws DuplicateMethodException - * @throws InvalidMethodNameException - * @throws OriginalConstructorInvocationRequiredException - * @throws ReflectionException - * @throws RuntimeException - * @throws UnknownClassException - * @throws UnknownTypeException - */ - public function getMockForAbstractClass(string $originalClassName, array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, array $mockedMethods = null, bool $cloneArguments = true): MockObject - { - if (class_exists($originalClassName, $callAutoload) || - interface_exists($originalClassName, $callAutoload)) { - try { - $reflector = new ReflectionClass($originalClassName); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - $methods = $mockedMethods; - - foreach ($reflector->getMethods() as $method) { - if ($method->isAbstract() && !in_array($method->getName(), $methods ?? [], true)) { - $methods[] = $method->getName(); - } - } - - if (empty($methods)) { - $methods = null; - } - - return $this->getMock( - $originalClassName, - $methods, - $arguments, - $mockClassName, - $callOriginalConstructor, - $callOriginalClone, - $callAutoload, - $cloneArguments - ); - } - - throw new UnknownClassException($originalClassName); - } - - /** - * Returns a mock object for the specified trait with all abstract methods - * of the trait mocked. Concrete methods to mock can be specified with the - * `$mockedMethods` parameter. - * - * @psalm-param trait-string $traitName - * - * @throws \PHPUnit\Framework\InvalidArgumentException - * @throws ClassAlreadyExistsException - * @throws ClassIsFinalException - * @throws ClassIsReadonlyException - * @throws DuplicateMethodException - * @throws InvalidMethodNameException - * @throws OriginalConstructorInvocationRequiredException - * @throws ReflectionException - * @throws RuntimeException - * @throws UnknownClassException - * @throws UnknownTraitException - * @throws UnknownTypeException - */ - public function getMockForTrait(string $traitName, array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, array $mockedMethods = null, bool $cloneArguments = true): MockObject - { - if (!trait_exists($traitName, $callAutoload)) { - throw new UnknownTraitException($traitName); - } - - $className = $this->generateClassName( - $traitName, - '', - 'Trait_' - ); - - $classTemplate = $this->getTemplate('trait_class.tpl'); - - $classTemplate->setVar( - [ - 'prologue' => 'abstract ', - 'class_name' => $className['className'], - 'trait_name' => $traitName, - ] - ); - - $mockTrait = new MockTrait($classTemplate->render(), $className['className']); - $mockTrait->generate(); - - return $this->getMockForAbstractClass($className['className'], $arguments, $mockClassName, $callOriginalConstructor, $callOriginalClone, $callAutoload, $mockedMethods, $cloneArguments); - } - - /** - * Returns an object for the specified trait. - * - * @psalm-param trait-string $traitName - * - * @throws ReflectionException - * @throws RuntimeException - * @throws UnknownTraitException - */ - public function getObjectForTrait(string $traitName, string $traitClassName = '', bool $callAutoload = true, bool $callOriginalConstructor = false, array $arguments = []): object - { - if (!trait_exists($traitName, $callAutoload)) { - throw new UnknownTraitException($traitName); - } - - $className = $this->generateClassName( - $traitName, - $traitClassName, - 'Trait_' - ); - - $classTemplate = $this->getTemplate('trait_class.tpl'); - - $classTemplate->setVar( - [ - 'prologue' => '', - 'class_name' => $className['className'], - 'trait_name' => $traitName, - ] - ); - - return $this->getObject( - new MockTrait( - $classTemplate->render(), - $className['className'] - ), - '', - $callOriginalConstructor, - $callAutoload, - $arguments - ); - } - - /** - * @throws ClassIsFinalException - * @throws ClassIsReadonlyException - * @throws ReflectionException - * @throws RuntimeException - */ - public function generate(string $type, array $methods = null, string $mockClassName = '', bool $callOriginalClone = true, bool $callAutoload = true, bool $cloneArguments = true, bool $callOriginalMethods = false): MockClass - { - if ($mockClassName !== '') { - return $this->generateMock( - $type, - $methods, - $mockClassName, - $callOriginalClone, - $callAutoload, - $cloneArguments, - $callOriginalMethods - ); - } - - $key = md5( - $type . - serialize($methods) . - serialize($callOriginalClone) . - serialize($cloneArguments) . - serialize($callOriginalMethods) - ); - - if (!isset(self::$cache[$key])) { - self::$cache[$key] = $this->generateMock( - $type, - $methods, - $mockClassName, - $callOriginalClone, - $callAutoload, - $cloneArguments, - $callOriginalMethods - ); - } - - return self::$cache[$key]; - } - - /** - * @throws RuntimeException - * @throws SoapExtensionNotAvailableException - */ - public function generateClassFromWsdl(string $wsdlFile, string $className, array $methods = [], array $options = []): string - { - if (!extension_loaded('soap')) { - throw new SoapExtensionNotAvailableException; - } - - $options = array_merge($options, ['cache_wsdl' => WSDL_CACHE_NONE]); - - try { - $client = new SoapClient($wsdlFile, $options); - $_methods = array_unique($client->__getFunctions()); - unset($client); - } catch (SoapFault $e) { - throw new RuntimeException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - - sort($_methods); - - $methodTemplate = $this->getTemplate('wsdl_method.tpl'); - $methodsBuffer = ''; - - foreach ($_methods as $method) { - preg_match_all('/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*\(/', $method, $matches, PREG_OFFSET_CAPTURE); - $lastFunction = array_pop($matches[0]); - $nameStart = $lastFunction[1]; - $nameEnd = $nameStart + strlen($lastFunction[0]) - 1; - $name = str_replace('(', '', $lastFunction[0]); - - if (empty($methods) || in_array($name, $methods, true)) { - $args = explode( - ',', - str_replace(')', '', substr($method, $nameEnd + 1)) - ); - - foreach (range(0, count($args) - 1) as $i) { - $parameterStart = strpos($args[$i], '$'); - - if (!$parameterStart) { - continue; - } - - $args[$i] = substr($args[$i], $parameterStart); - } - - $methodTemplate->setVar( - [ - 'method_name' => $name, - 'arguments' => implode(', ', $args), - ] - ); - - $methodsBuffer .= $methodTemplate->render(); - } - } - - $optionsBuffer = '['; - - foreach ($options as $key => $value) { - $optionsBuffer .= $key . ' => ' . $value; - } - - $optionsBuffer .= ']'; - - $classTemplate = $this->getTemplate('wsdl_class.tpl'); - $namespace = ''; - - if (strpos($className, '\\') !== false) { - $parts = explode('\\', $className); - $className = array_pop($parts); - $namespace = 'namespace ' . implode('\\', $parts) . ';' . "\n\n"; - } - - $classTemplate->setVar( - [ - 'namespace' => $namespace, - 'class_name' => $className, - 'wsdl' => $wsdlFile, - 'options' => $optionsBuffer, - 'methods' => $methodsBuffer, - ] - ); - - return $classTemplate->render(); - } - - /** - * @throws ReflectionException - * - * @return string[] - */ - public function getClassMethods(string $className): array - { - try { - $class = new ReflectionClass($className); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - $methods = []; - - foreach ($class->getMethods() as $method) { - if ($method->isPublic() || $method->isAbstract()) { - $methods[] = $method->getName(); - } - } - - return $methods; - } - - /** - * @throws ReflectionException - * - * @return MockMethod[] - */ - public function mockClassMethods(string $className, bool $callOriginalMethods, bool $cloneArguments): array - { - try { - $class = new ReflectionClass($className); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - $methods = []; - - foreach ($class->getMethods() as $method) { - if (($method->isPublic() || $method->isAbstract()) && $this->canMockMethod($method)) { - $methods[] = MockMethod::fromReflection($method, $callOriginalMethods, $cloneArguments); - } - } - - return $methods; - } - - /** - * @throws ReflectionException - * - * @return MockMethod[] - */ - public function mockInterfaceMethods(string $interfaceName, bool $cloneArguments): array - { - try { - $class = new ReflectionClass($interfaceName); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - $methods = []; - - foreach ($class->getMethods() as $method) { - $methods[] = MockMethod::fromReflection($method, false, $cloneArguments); - } - - return $methods; - } - - /** - * @psalm-param class-string $interfaceName - * - * @throws ReflectionException - * - * @return ReflectionMethod[] - */ - private function userDefinedInterfaceMethods(string $interfaceName): array - { - try { - // @codeCoverageIgnoreStart - $interface = new ReflectionClass($interfaceName); - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - $methods = []; - - foreach ($interface->getMethods() as $method) { - if (!$method->isUserDefined()) { - continue; - } - - $methods[] = $method; - } - - return $methods; - } - - /** - * @throws ReflectionException - * @throws RuntimeException - */ - private function getObject(MockType $mockClass, $type = '', bool $callOriginalConstructor = false, bool $callAutoload = false, array $arguments = [], bool $callOriginalMethods = false, object $proxyTarget = null, bool $returnValueGeneration = true) - { - $className = $mockClass->generate(); - - if ($callOriginalConstructor) { - if (count($arguments) === 0) { - $object = new $className; - } else { - try { - $class = new ReflectionClass($className); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - $object = $class->newInstanceArgs($arguments); - } - } else { - try { - $object = (new Instantiator)->instantiate($className); - } catch (InstantiatorException $e) { - throw new RuntimeException($e->getMessage()); - } - } - - if ($callOriginalMethods) { - if (!is_object($proxyTarget)) { - if (count($arguments) === 0) { - $proxyTarget = new $type; - } else { - try { - $class = new ReflectionClass($type); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - $proxyTarget = $class->newInstanceArgs($arguments); - } - } - - $object->__phpunit_setOriginalObject($proxyTarget); - } - - if ($object instanceof MockObject) { - $object->__phpunit_setReturnValueGeneration($returnValueGeneration); - } - - return $object; - } - - /** - * @throws ClassIsFinalException - * @throws ClassIsReadonlyException - * @throws ReflectionException - * @throws RuntimeException - */ - private function generateMock(string $type, ?array $explicitMethods, string $mockClassName, bool $callOriginalClone, bool $callAutoload, bool $cloneArguments, bool $callOriginalMethods): MockClass - { - $classTemplate = $this->getTemplate('mocked_class.tpl'); - $additionalInterfaces = []; - $mockedCloneMethod = false; - $unmockedCloneMethod = false; - $isClass = false; - $isInterface = false; - $class = null; - $mockMethods = new MockMethodSet; - - $_mockClassName = $this->generateClassName( - $type, - $mockClassName, - 'Mock_' - ); - - if (class_exists($_mockClassName['fullClassName'], $callAutoload)) { - $isClass = true; - } elseif (interface_exists($_mockClassName['fullClassName'], $callAutoload)) { - $isInterface = true; - } - - if (!$isClass && !$isInterface) { - $prologue = 'class ' . $_mockClassName['originalClassName'] . "\n{\n}\n\n"; - - if (!empty($_mockClassName['namespaceName'])) { - $prologue = 'namespace ' . $_mockClassName['namespaceName'] . - " {\n\n" . $prologue . "}\n\n" . - "namespace {\n\n"; - - $epilogue = "\n\n}"; - } - - $mockedCloneMethod = true; - } else { - try { - $class = new ReflectionClass($_mockClassName['fullClassName']); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if ($class->isFinal()) { - throw new ClassIsFinalException($_mockClassName['fullClassName']); - } - - if (method_exists($class, 'isReadOnly') && $class->isReadOnly()) { - throw new ClassIsReadonlyException($_mockClassName['fullClassName']); - } - - // @see https://github.com/sebastianbergmann/phpunit/issues/2995 - if ($isInterface && $class->implementsInterface(Throwable::class)) { - $actualClassName = Exception::class; - $additionalInterfaces[] = $class->getName(); - $isInterface = false; - - try { - $class = new ReflectionClass($actualClassName); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - foreach ($this->userDefinedInterfaceMethods($_mockClassName['fullClassName']) as $method) { - $methodName = $method->getName(); - - if ($class->hasMethod($methodName)) { - try { - $classMethod = $class->getMethod($methodName); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if (!$this->canMockMethod($classMethod)) { - continue; - } - } - - $mockMethods->addMethods( - MockMethod::fromReflection($method, $callOriginalMethods, $cloneArguments) - ); - } - - $_mockClassName = $this->generateClassName( - $actualClassName, - $_mockClassName['className'], - 'Mock_' - ); - } - - // @see https://github.com/sebastianbergmann/phpunit-mock-objects/issues/103 - if ($isInterface && $class->implementsInterface(Traversable::class) && - !$class->implementsInterface(Iterator::class) && - !$class->implementsInterface(IteratorAggregate::class)) { - $additionalInterfaces[] = Iterator::class; - - $mockMethods->addMethods( - ...$this->mockClassMethods(Iterator::class, $callOriginalMethods, $cloneArguments) - ); - } - - if ($class->hasMethod('__clone')) { - try { - $cloneMethod = $class->getMethod('__clone'); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if (!$cloneMethod->isFinal()) { - if ($callOriginalClone && !$isInterface) { - $unmockedCloneMethod = true; - } else { - $mockedCloneMethod = true; - } - } - } else { - $mockedCloneMethod = true; - } - } - - if ($isClass && $explicitMethods === []) { - $mockMethods->addMethods( - ...$this->mockClassMethods($_mockClassName['fullClassName'], $callOriginalMethods, $cloneArguments) - ); - } - - if ($isInterface && ($explicitMethods === [] || $explicitMethods === null)) { - $mockMethods->addMethods( - ...$this->mockInterfaceMethods($_mockClassName['fullClassName'], $cloneArguments) - ); - } - - if (is_array($explicitMethods)) { - foreach ($explicitMethods as $methodName) { - if ($class !== null && $class->hasMethod($methodName)) { - try { - $method = $class->getMethod($methodName); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if ($this->canMockMethod($method)) { - $mockMethods->addMethods( - MockMethod::fromReflection($method, $callOriginalMethods, $cloneArguments) - ); - } - } else { - $mockMethods->addMethods( - MockMethod::fromName( - $_mockClassName['fullClassName'], - $methodName, - $cloneArguments - ) - ); - } - } - } - - $mockedMethods = ''; - $configurable = []; - - foreach ($mockMethods->asArray() as $mockMethod) { - $mockedMethods .= $mockMethod->generateCode(); - $configurable[] = new ConfigurableMethod($mockMethod->getName(), $mockMethod->getReturnType()); - } - - $method = ''; - - if (!$mockMethods->hasMethod('method') && (!isset($class) || !$class->hasMethod('method'))) { - $method = PHP_EOL . ' use \PHPUnit\Framework\MockObject\Method;'; - } - - $cloneTrait = ''; - - if ($mockedCloneMethod) { - $cloneTrait = $this->mockedCloneMethod(); - } - - if ($unmockedCloneMethod) { - $cloneTrait = $this->unmockedCloneMethod(); - } - - $classTemplate->setVar( - [ - 'prologue' => $prologue ?? '', - 'epilogue' => $epilogue ?? '', - 'class_declaration' => $this->generateMockClassDeclaration( - $_mockClassName, - $isInterface, - $additionalInterfaces - ), - 'clone' => $cloneTrait, - 'mock_class_name' => $_mockClassName['className'], - 'mocked_methods' => $mockedMethods, - 'method' => $method, - ] - ); - - return new MockClass( - $classTemplate->render(), - $_mockClassName['className'], - $configurable - ); - } - - private function generateClassName(string $type, string $className, string $prefix): array - { - if ($type[0] === '\\') { - $type = substr($type, 1); - } - - $classNameParts = explode('\\', $type); - - if (count($classNameParts) > 1) { - $type = array_pop($classNameParts); - $namespaceName = implode('\\', $classNameParts); - $fullClassName = $namespaceName . '\\' . $type; - } else { - $namespaceName = ''; - $fullClassName = $type; - } - - if ($className === '') { - do { - $className = $prefix . $type . '_' . - substr(md5((string) mt_rand()), 0, 8); - } while (class_exists($className, false)); - } - - return [ - 'className' => $className, - 'originalClassName' => $type, - 'fullClassName' => $fullClassName, - 'namespaceName' => $namespaceName, - ]; - } - - private function generateMockClassDeclaration(array $mockClassName, bool $isInterface, array $additionalInterfaces = []): string - { - $buffer = 'class '; - - $additionalInterfaces[] = MockObject::class; - $interfaces = implode(', ', $additionalInterfaces); - - if ($isInterface) { - $buffer .= sprintf( - '%s implements %s', - $mockClassName['className'], - $interfaces - ); - - if (!in_array($mockClassName['originalClassName'], $additionalInterfaces, true)) { - $buffer .= ', '; - - if (!empty($mockClassName['namespaceName'])) { - $buffer .= $mockClassName['namespaceName'] . '\\'; - } - - $buffer .= $mockClassName['originalClassName']; - } - } else { - $buffer .= sprintf( - '%s extends %s%s implements %s', - $mockClassName['className'], - !empty($mockClassName['namespaceName']) ? $mockClassName['namespaceName'] . '\\' : '', - $mockClassName['originalClassName'], - $interfaces - ); - } - - return $buffer; - } - - private function canMockMethod(ReflectionMethod $method): bool - { - return !($this->isConstructor($method) || $method->isFinal() || $method->isPrivate() || $this->isMethodNameExcluded($method->getName())); - } - - private function isMethodNameExcluded(string $name): bool - { - return isset(self::EXCLUDED_METHOD_NAMES[$name]); - } - - /** - * @throws RuntimeException - */ - private function getTemplate(string $template): Template - { - $filename = __DIR__ . DIRECTORY_SEPARATOR . 'Generator' . DIRECTORY_SEPARATOR . $template; - - if (!isset(self::$templates[$filename])) { - try { - self::$templates[$filename] = new Template($filename); - } catch (TemplateException $e) { - throw new RuntimeException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - } - - return self::$templates[$filename]; - } - - /** - * @see https://github.com/sebastianbergmann/phpunit/issues/4139#issuecomment-605409765 - */ - private function isConstructor(ReflectionMethod $method): bool - { - $methodName = strtolower($method->getName()); - - if ($methodName === '__construct') { - return true; - } - - if (PHP_MAJOR_VERSION >= 8) { - return false; - } - - $className = strtolower($method->getDeclaringClass()->getName()); - - return $methodName === $className; - } - - private function mockedCloneMethod(): string - { - if (PHP_MAJOR_VERSION >= 8) { - if (!trait_exists('\PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType')) { - eval(self::MOCKED_CLONE_METHOD_WITH_VOID_RETURN_TYPE_TRAIT); - } - - return PHP_EOL . ' use \PHPUnit\Framework\MockObject\MockedCloneMethodWithVoidReturnType;'; - } - - if (!trait_exists('\PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType')) { - eval(self::MOCKED_CLONE_METHOD_WITHOUT_RETURN_TYPE_TRAIT); - } - - return PHP_EOL . ' use \PHPUnit\Framework\MockObject\MockedCloneMethodWithoutReturnType;'; - } - - private function unmockedCloneMethod(): string - { - if (PHP_MAJOR_VERSION >= 8) { - if (!trait_exists('\PHPUnit\Framework\MockObject\UnmockedCloneMethodWithVoidReturnType')) { - eval(self::UNMOCKED_CLONE_METHOD_WITH_VOID_RETURN_TYPE_TRAIT); - } - - return PHP_EOL . ' use \PHPUnit\Framework\MockObject\UnmockedCloneMethodWithVoidReturnType;'; - } - - if (!trait_exists('\PHPUnit\Framework\MockObject\UnmockedCloneMethodWithoutReturnType')) { - eval(self::UNMOCKED_CLONE_METHOD_WITHOUT_RETURN_TYPE_TRAIT); - } - - return PHP_EOL . ' use \PHPUnit\Framework\MockObject\UnmockedCloneMethodWithoutReturnType;'; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/deprecation.tpl b/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/deprecation.tpl deleted file mode 100644 index 5bf06f52..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/deprecation.tpl +++ /dev/null @@ -1,2 +0,0 @@ - - @trigger_error({deprecation}, E_USER_DEPRECATED); diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/intersection.tpl b/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/intersection.tpl deleted file mode 100644 index 75cd27a6..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/intersection.tpl +++ /dev/null @@ -1,5 +0,0 @@ -declare(strict_types=1); - -interface {intersection} extends {interfaces} -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_class.tpl b/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_class.tpl deleted file mode 100644 index 593119fb..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_class.tpl +++ /dev/null @@ -1,6 +0,0 @@ -declare(strict_types=1); - -{prologue}{class_declaration} -{ - use \PHPUnit\Framework\MockObject\Api;{method}{clone} -{mocked_methods}}{epilogue} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_method.tpl b/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_method.tpl deleted file mode 100644 index 114ff8d0..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_method.tpl +++ /dev/null @@ -1,22 +0,0 @@ - - {modifier} function {reference}{method_name}({arguments_decl}){return_declaration} - {{deprecation} - $__phpunit_arguments = [{arguments_call}]; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > {arguments_count}) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = {arguments_count}; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - '{class_name}', '{method_name}', $__phpunit_arguments, '{return_type}', $this, {clone_arguments} - ) - ); - - return $__phpunit_result; - } diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_method_never_or_void.tpl b/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_method_never_or_void.tpl deleted file mode 100644 index 39020220..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_method_never_or_void.tpl +++ /dev/null @@ -1,20 +0,0 @@ - - {modifier} function {reference}{method_name}({arguments_decl}){return_declaration} - {{deprecation} - $__phpunit_arguments = [{arguments_call}]; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > {arguments_count}) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = {arguments_count}; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - '{class_name}', '{method_name}', $__phpunit_arguments, '{return_type}', $this, {clone_arguments} - ) - ); - } diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_static_method.tpl b/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_static_method.tpl deleted file mode 100644 index 5e5cf23c..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_static_method.tpl +++ /dev/null @@ -1,5 +0,0 @@ - - {modifier} function {reference}{method_name}({arguments_decl}){return_declaration} - { - throw new \PHPUnit\Framework\MockObject\BadMethodCallException('Static method "{method_name}" cannot be invoked on mock object'); - } diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/proxied_method.tpl b/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/proxied_method.tpl deleted file mode 100644 index 91bef463..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/proxied_method.tpl +++ /dev/null @@ -1,22 +0,0 @@ - - {modifier} function {reference}{method_name}({arguments_decl}){return_declaration} - { - $__phpunit_arguments = [{arguments_call}]; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > {arguments_count}) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = {arguments_count}; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - '{class_name}', '{method_name}', $__phpunit_arguments, '{return_type}', $this, {clone_arguments}, true - ) - ); - - return call_user_func_array(array($this->__phpunit_originalObject, "{method_name}"), $__phpunit_arguments); - } diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/proxied_method_never_or_void.tpl b/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/proxied_method_never_or_void.tpl deleted file mode 100644 index cce19882..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/proxied_method_never_or_void.tpl +++ /dev/null @@ -1,22 +0,0 @@ - - {modifier} function {reference}{method_name}({arguments_decl}){return_declaration} - { - $__phpunit_arguments = [{arguments_call}]; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > {arguments_count}) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = {arguments_count}; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - '{class_name}', '{method_name}', $__phpunit_arguments, '{return_type}', $this, {clone_arguments}, true - ) - ); - - call_user_func_array(array($this->__phpunit_originalObject, "{method_name}"), $__phpunit_arguments); - } diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/trait_class.tpl b/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/trait_class.tpl deleted file mode 100644 index a8fe470f..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/trait_class.tpl +++ /dev/null @@ -1,6 +0,0 @@ -declare(strict_types=1); - -{prologue}class {class_name} -{ - use {trait_name}; -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/wsdl_class.tpl b/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/wsdl_class.tpl deleted file mode 100644 index b3100b41..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/wsdl_class.tpl +++ /dev/null @@ -1,9 +0,0 @@ -declare(strict_types=1); - -{namespace}class {class_name} extends \SoapClient -{ - public function __construct($wsdl, array $options) - { - parent::__construct('{wsdl}', $options); - } -{methods}} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/wsdl_method.tpl b/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/wsdl_method.tpl deleted file mode 100644 index bb16e763..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/wsdl_method.tpl +++ /dev/null @@ -1,4 +0,0 @@ - - public function {method_name}({arguments}) - { - } diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Invocation.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Invocation.php deleted file mode 100644 index 418d6a07..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Invocation.php +++ /dev/null @@ -1,301 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function array_map; -use function explode; -use function get_class; -use function implode; -use function in_array; -use function interface_exists; -use function is_object; -use function sprintf; -use function strpos; -use function strtolower; -use function substr; -use Doctrine\Instantiator\Instantiator; -use PHPUnit\Framework\SelfDescribing; -use PHPUnit\Util\Cloner; -use SebastianBergmann\Exporter\Exporter; -use stdClass; -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Invocation implements SelfDescribing -{ - /** - * @var string - */ - private $className; - - /** - * @var string - */ - private $methodName; - - /** - * @var array - */ - private $parameters; - - /** - * @var string - */ - private $returnType; - - /** - * @var bool - */ - private $isReturnTypeNullable = false; - - /** - * @var bool - */ - private $proxiedCall; - - /** - * @var object - */ - private $object; - - public function __construct(string $className, string $methodName, array $parameters, string $returnType, object $object, bool $cloneObjects = false, bool $proxiedCall = false) - { - $this->className = $className; - $this->methodName = $methodName; - $this->parameters = $parameters; - $this->object = $object; - $this->proxiedCall = $proxiedCall; - - if (strtolower($methodName) === '__tostring') { - $returnType = 'string'; - } - - if (strpos($returnType, '?') === 0) { - $returnType = substr($returnType, 1); - $this->isReturnTypeNullable = true; - } - - $this->returnType = $returnType; - - if (!$cloneObjects) { - return; - } - - foreach ($this->parameters as $key => $value) { - if (is_object($value)) { - $this->parameters[$key] = Cloner::clone($value); - } - } - } - - public function getClassName(): string - { - return $this->className; - } - - public function getMethodName(): string - { - return $this->methodName; - } - - public function getParameters(): array - { - return $this->parameters; - } - - /** - * @throws RuntimeException - * - * @return mixed Mocked return value - */ - public function generateReturnValue() - { - if ($this->isReturnTypeNullable || $this->proxiedCall) { - return null; - } - - $intersection = false; - $union = false; - $unionContainsIntersections = false; - - if (strpos($this->returnType, '|') !== false) { - $types = explode('|', $this->returnType); - $union = true; - - if (strpos($this->returnType, '(') !== false) { - $unionContainsIntersections = true; - } - } elseif (strpos($this->returnType, '&') !== false) { - $types = explode('&', $this->returnType); - $intersection = true; - } else { - $types = [$this->returnType]; - } - - $types = array_map('strtolower', $types); - - if (!$intersection && !$unionContainsIntersections) { - if (in_array('', $types, true) || - in_array('null', $types, true) || - in_array('mixed', $types, true) || - in_array('void', $types, true)) { - return null; - } - - if (in_array('true', $types, true)) { - return true; - } - - if (in_array('false', $types, true) || - in_array('bool', $types, true)) { - return false; - } - - if (in_array('float', $types, true)) { - return 0.0; - } - - if (in_array('int', $types, true)) { - return 0; - } - - if (in_array('string', $types, true)) { - return ''; - } - - if (in_array('array', $types, true)) { - return []; - } - - if (in_array('static', $types, true)) { - try { - return (new Instantiator)->instantiate(get_class($this->object)); - } catch (Throwable $t) { - throw new RuntimeException( - $t->getMessage(), - (int) $t->getCode(), - $t - ); - } - } - - if (in_array('object', $types, true)) { - return new stdClass; - } - - if (in_array('callable', $types, true) || - in_array('closure', $types, true)) { - return static function (): void - { - }; - } - - if (in_array('traversable', $types, true) || - in_array('generator', $types, true) || - in_array('iterable', $types, true)) { - $generator = static function (): \Generator - { - yield from []; - }; - - return $generator(); - } - - if (!$union) { - try { - return (new Generator)->getMock($this->returnType, [], [], '', false); - } catch (Throwable $t) { - if ($t instanceof Exception) { - throw $t; - } - - throw new RuntimeException( - $t->getMessage(), - (int) $t->getCode(), - $t - ); - } - } - } - - if ($intersection && $this->onlyInterfaces($types)) { - try { - return (new Generator)->getMockForInterfaces($types); - } catch (Throwable $t) { - throw new RuntimeException( - sprintf( - 'Return value for %s::%s() cannot be generated: %s', - $this->className, - $this->methodName, - $t->getMessage(), - ), - (int) $t->getCode(), - ); - } - } - - $reason = ''; - - if ($union) { - $reason = ' because the declared return type is a union'; - } elseif ($intersection) { - $reason = ' because the declared return type is an intersection'; - } - - throw new RuntimeException( - sprintf( - 'Return value for %s::%s() cannot be generated%s, please configure a return value for this method', - $this->className, - $this->methodName, - $reason - ) - ); - } - - public function toString(): string - { - $exporter = new Exporter; - - return sprintf( - '%s::%s(%s)%s', - $this->className, - $this->methodName, - implode( - ', ', - array_map( - [$exporter, 'shortenedExport'], - $this->parameters - ) - ), - $this->returnType ? sprintf(': %s', $this->returnType) : '' - ); - } - - public function getObject(): object - { - return $this->object; - } - - /** - * @psalm-param non-empty-list $types - */ - private function onlyInterfaces(array $types): bool - { - foreach ($types as $type) { - if (!interface_exists($type)) { - return false; - } - } - - return true; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/InvocationHandler.php b/vendor/phpunit/phpunit/src/Framework/MockObject/InvocationHandler.php deleted file mode 100644 index b9d62610..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/InvocationHandler.php +++ /dev/null @@ -1,186 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function strtolower; -use Exception; -use PHPUnit\Framework\MockObject\Builder\InvocationMocker; -use PHPUnit\Framework\MockObject\Rule\InvocationOrder; -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class InvocationHandler -{ - /** - * @var Matcher[] - */ - private $matchers = []; - - /** - * @var Matcher[] - */ - private $matcherMap = []; - - /** - * @var ConfigurableMethod[] - */ - private $configurableMethods; - - /** - * @var bool - */ - private $returnValueGeneration; - - /** - * @var Throwable - */ - private $deferredError; - - public function __construct(array $configurableMethods, bool $returnValueGeneration) - { - $this->configurableMethods = $configurableMethods; - $this->returnValueGeneration = $returnValueGeneration; - } - - public function hasMatchers(): bool - { - foreach ($this->matchers as $matcher) { - if ($matcher->hasMatchers()) { - return true; - } - } - - return false; - } - - /** - * Looks up the match builder with identification $id and returns it. - * - * @param string $id The identification of the match builder - */ - public function lookupMatcher(string $id): ?Matcher - { - if (isset($this->matcherMap[$id])) { - return $this->matcherMap[$id]; - } - - return null; - } - - /** - * Registers a matcher with the identification $id. The matcher can later be - * looked up using lookupMatcher() to figure out if it has been invoked. - * - * @param string $id The identification of the matcher - * @param Matcher $matcher The builder which is being registered - * - * @throws MatcherAlreadyRegisteredException - */ - public function registerMatcher(string $id, Matcher $matcher): void - { - if (isset($this->matcherMap[$id])) { - throw new MatcherAlreadyRegisteredException($id); - } - - $this->matcherMap[$id] = $matcher; - } - - public function expects(InvocationOrder $rule): InvocationMocker - { - $matcher = new Matcher($rule); - $this->addMatcher($matcher); - - return new InvocationMocker( - $this, - $matcher, - ...$this->configurableMethods - ); - } - - /** - * @throws Exception - * @throws RuntimeException - */ - public function invoke(Invocation $invocation) - { - $exception = null; - $hasReturnValue = false; - $returnValue = null; - - foreach ($this->matchers as $match) { - try { - if ($match->matches($invocation)) { - $value = $match->invoked($invocation); - - if (!$hasReturnValue) { - $returnValue = $value; - $hasReturnValue = true; - } - } - } catch (Exception $e) { - $exception = $e; - } - } - - if ($exception !== null) { - throw $exception; - } - - if ($hasReturnValue) { - return $returnValue; - } - - if (!$this->returnValueGeneration) { - $exception = new ReturnValueNotConfiguredException($invocation); - - if (strtolower($invocation->getMethodName()) === '__tostring') { - $this->deferredError = $exception; - - return ''; - } - - throw $exception; - } - - return $invocation->generateReturnValue(); - } - - public function matches(Invocation $invocation): bool - { - foreach ($this->matchers as $matcher) { - if (!$matcher->matches($invocation)) { - return false; - } - } - - return true; - } - - /** - * @throws Throwable - */ - public function verify(): void - { - foreach ($this->matchers as $matcher) { - $matcher->verify(); - } - - if ($this->deferredError) { - throw $this->deferredError; - } - } - - private function addMatcher(Matcher $matcher): void - { - $this->matchers[] = $matcher; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Matcher.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Matcher.php deleted file mode 100644 index 7c81a0ea..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Matcher.php +++ /dev/null @@ -1,274 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function assert; -use function implode; -use function sprintf; -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\MockObject\Rule\AnyInvokedCount; -use PHPUnit\Framework\MockObject\Rule\AnyParameters; -use PHPUnit\Framework\MockObject\Rule\InvocationOrder; -use PHPUnit\Framework\MockObject\Rule\InvokedAtMostCount; -use PHPUnit\Framework\MockObject\Rule\InvokedCount; -use PHPUnit\Framework\MockObject\Rule\MethodName; -use PHPUnit\Framework\MockObject\Rule\ParametersRule; -use PHPUnit\Framework\MockObject\Stub\Stub; -use PHPUnit\Framework\TestFailure; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Matcher -{ - /** - * @var InvocationOrder - */ - private $invocationRule; - - /** - * @var mixed - */ - private $afterMatchBuilderId; - - /** - * @var bool - */ - private $afterMatchBuilderIsInvoked = false; - - /** - * @var MethodName - */ - private $methodNameRule; - - /** - * @var ParametersRule - */ - private $parametersRule; - - /** - * @var Stub - */ - private $stub; - - public function __construct(InvocationOrder $rule) - { - $this->invocationRule = $rule; - } - - public function hasMatchers(): bool - { - return !$this->invocationRule instanceof AnyInvokedCount; - } - - public function hasMethodNameRule(): bool - { - return $this->methodNameRule !== null; - } - - public function getMethodNameRule(): MethodName - { - return $this->methodNameRule; - } - - public function setMethodNameRule(MethodName $rule): void - { - $this->methodNameRule = $rule; - } - - public function hasParametersRule(): bool - { - return $this->parametersRule !== null; - } - - public function setParametersRule(ParametersRule $rule): void - { - $this->parametersRule = $rule; - } - - public function setStub(Stub $stub): void - { - $this->stub = $stub; - } - - public function setAfterMatchBuilderId(string $id): void - { - $this->afterMatchBuilderId = $id; - } - - /** - * @throws ExpectationFailedException - * @throws MatchBuilderNotFoundException - * @throws MethodNameNotConfiguredException - * @throws RuntimeException - */ - public function invoked(Invocation $invocation) - { - if ($this->methodNameRule === null) { - throw new MethodNameNotConfiguredException; - } - - if ($this->afterMatchBuilderId !== null) { - $matcher = $invocation->getObject() - ->__phpunit_getInvocationHandler() - ->lookupMatcher($this->afterMatchBuilderId); - - if (!$matcher) { - throw new MatchBuilderNotFoundException($this->afterMatchBuilderId); - } - - assert($matcher instanceof self); - - if ($matcher->invocationRule->hasBeenInvoked()) { - $this->afterMatchBuilderIsInvoked = true; - } - } - - $this->invocationRule->invoked($invocation); - - try { - if ($this->parametersRule !== null) { - $this->parametersRule->apply($invocation); - } - } catch (ExpectationFailedException $e) { - throw new ExpectationFailedException( - sprintf( - "Expectation failed for %s when %s\n%s", - $this->methodNameRule->toString(), - $this->invocationRule->toString(), - $e->getMessage() - ), - $e->getComparisonFailure() - ); - } - - if ($this->stub) { - return $this->stub->invoke($invocation); - } - - return $invocation->generateReturnValue(); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * @throws MatchBuilderNotFoundException - * @throws MethodNameNotConfiguredException - * @throws RuntimeException - */ - public function matches(Invocation $invocation): bool - { - if ($this->afterMatchBuilderId !== null) { - $matcher = $invocation->getObject() - ->__phpunit_getInvocationHandler() - ->lookupMatcher($this->afterMatchBuilderId); - - if (!$matcher) { - throw new MatchBuilderNotFoundException($this->afterMatchBuilderId); - } - - assert($matcher instanceof self); - - if (!$matcher->invocationRule->hasBeenInvoked()) { - return false; - } - } - - if ($this->methodNameRule === null) { - throw new MethodNameNotConfiguredException; - } - - if (!$this->invocationRule->matches($invocation)) { - return false; - } - - try { - if (!$this->methodNameRule->matches($invocation)) { - return false; - } - } catch (ExpectationFailedException $e) { - throw new ExpectationFailedException( - sprintf( - "Expectation failed for %s when %s\n%s", - $this->methodNameRule->toString(), - $this->invocationRule->toString(), - $e->getMessage() - ), - $e->getComparisonFailure() - ); - } - - return true; - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - * @throws MethodNameNotConfiguredException - */ - public function verify(): void - { - if ($this->methodNameRule === null) { - throw new MethodNameNotConfiguredException; - } - - try { - $this->invocationRule->verify(); - - if ($this->parametersRule === null) { - $this->parametersRule = new AnyParameters; - } - - $invocationIsAny = $this->invocationRule instanceof AnyInvokedCount; - $invocationIsNever = $this->invocationRule instanceof InvokedCount && $this->invocationRule->isNever(); - $invocationIsAtMost = $this->invocationRule instanceof InvokedAtMostCount; - - if (!$invocationIsAny && !$invocationIsNever && !$invocationIsAtMost) { - $this->parametersRule->verify(); - } - } catch (ExpectationFailedException $e) { - throw new ExpectationFailedException( - sprintf( - "Expectation failed for %s when %s.\n%s", - $this->methodNameRule->toString(), - $this->invocationRule->toString(), - TestFailure::exceptionToString($e) - ) - ); - } - } - - public function toString(): string - { - $list = []; - - if ($this->invocationRule !== null) { - $list[] = $this->invocationRule->toString(); - } - - if ($this->methodNameRule !== null) { - $list[] = 'where ' . $this->methodNameRule->toString(); - } - - if ($this->parametersRule !== null) { - $list[] = 'and ' . $this->parametersRule->toString(); - } - - if ($this->afterMatchBuilderId !== null) { - $list[] = 'after ' . $this->afterMatchBuilderId; - } - - if ($this->stub !== null) { - $list[] = 'will ' . $this->stub->toString(); - } - - return implode(' ', $list); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/MethodNameConstraint.php b/vendor/phpunit/phpunit/src/Framework/MockObject/MethodNameConstraint.php deleted file mode 100644 index 3082ab38..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/MethodNameConstraint.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function is_string; -use function sprintf; -use function strtolower; -use PHPUnit\Framework\Constraint\Constraint; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class MethodNameConstraint extends Constraint -{ - /** - * @var string - */ - private $methodName; - - public function __construct(string $methodName) - { - $this->methodName = $methodName; - } - - public function toString(): string - { - return sprintf( - 'is "%s"', - $this->methodName - ); - } - - protected function matches($other): bool - { - if (!is_string($other)) { - return false; - } - - return strtolower($this->methodName) === strtolower($other); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/MockBuilder.php b/vendor/phpunit/phpunit/src/Framework/MockObject/MockBuilder.php deleted file mode 100644 index 4007a9f1..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/MockBuilder.php +++ /dev/null @@ -1,517 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function array_diff; -use function array_merge; -use PHPUnit\Framework\TestCase; -use ReflectionClass; - -/** - * @psalm-template MockedType - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class MockBuilder -{ - /** - * @var TestCase - */ - private $testCase; - - /** - * @var string - */ - private $type; - - /** - * @var null|string[] - */ - private $methods = []; - - /** - * @var bool - */ - private $emptyMethodsArray = false; - - /** - * @var string - */ - private $mockClassName = ''; - - /** - * @var array - */ - private $constructorArgs = []; - - /** - * @var bool - */ - private $originalConstructor = true; - - /** - * @var bool - */ - private $originalClone = true; - - /** - * @var bool - */ - private $autoload = true; - - /** - * @var bool - */ - private $cloneArguments = false; - - /** - * @var bool - */ - private $callOriginalMethods = false; - - /** - * @var ?object - */ - private $proxyTarget; - - /** - * @var bool - */ - private $allowMockingUnknownTypes = true; - - /** - * @var bool - */ - private $returnValueGeneration = true; - - /** - * @var Generator - */ - private $generator; - - /** - * @param string|string[] $type - * - * @psalm-param class-string|string|string[] $type - */ - public function __construct(TestCase $testCase, $type) - { - $this->testCase = $testCase; - $this->type = $type; - $this->generator = new Generator; - } - - /** - * Creates a mock object using a fluent interface. - * - * @throws \PHPUnit\Framework\InvalidArgumentException - * @throws ClassAlreadyExistsException - * @throws ClassIsFinalException - * @throws ClassIsReadonlyException - * @throws DuplicateMethodException - * @throws InvalidMethodNameException - * @throws OriginalConstructorInvocationRequiredException - * @throws ReflectionException - * @throws RuntimeException - * @throws UnknownTypeException - * - * @psalm-return MockObject&MockedType - */ - public function getMock(): MockObject - { - $object = $this->generator->getMock( - $this->type, - !$this->emptyMethodsArray ? $this->methods : null, - $this->constructorArgs, - $this->mockClassName, - $this->originalConstructor, - $this->originalClone, - $this->autoload, - $this->cloneArguments, - $this->callOriginalMethods, - $this->proxyTarget, - $this->allowMockingUnknownTypes, - $this->returnValueGeneration - ); - - $this->testCase->registerMockObject($object); - - return $object; - } - - /** - * Creates a mock object for an abstract class using a fluent interface. - * - * @psalm-return MockObject&MockedType - * - * @throws \PHPUnit\Framework\Exception - * @throws ReflectionException - * @throws RuntimeException - */ - public function getMockForAbstractClass(): MockObject - { - $object = $this->generator->getMockForAbstractClass( - $this->type, - $this->constructorArgs, - $this->mockClassName, - $this->originalConstructor, - $this->originalClone, - $this->autoload, - $this->methods, - $this->cloneArguments - ); - - $this->testCase->registerMockObject($object); - - return $object; - } - - /** - * Creates a mock object for a trait using a fluent interface. - * - * @psalm-return MockObject&MockedType - * - * @throws \PHPUnit\Framework\Exception - * @throws ReflectionException - * @throws RuntimeException - */ - public function getMockForTrait(): MockObject - { - $object = $this->generator->getMockForTrait( - $this->type, - $this->constructorArgs, - $this->mockClassName, - $this->originalConstructor, - $this->originalClone, - $this->autoload, - $this->methods, - $this->cloneArguments - ); - - $this->testCase->registerMockObject($object); - - return $object; - } - - /** - * Specifies the subset of methods to mock. Default is to mock none of them. - * - * @deprecated https://github.com/sebastianbergmann/phpunit/pull/3687 - * - * @return $this - */ - public function setMethods(?array $methods = null): self - { - if ($methods === null) { - $this->methods = $methods; - } else { - $this->methods = array_merge($this->methods ?? [], $methods); - } - - return $this; - } - - /** - * Specifies the subset of methods to mock, requiring each to exist in the class. - * - * @param string[] $methods - * - * @throws CannotUseOnlyMethodsException - * @throws ReflectionException - * - * @return $this - */ - public function onlyMethods(array $methods): self - { - if (empty($methods)) { - $this->emptyMethodsArray = true; - - return $this; - } - - try { - $reflector = new ReflectionClass($this->type); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - foreach ($methods as $method) { - if (!$reflector->hasMethod($method)) { - throw new CannotUseOnlyMethodsException($this->type, $method); - } - } - - $this->methods = array_merge($this->methods ?? [], $methods); - - return $this; - } - - /** - * Specifies methods that don't exist in the class which you want to mock. - * - * @param string[] $methods - * - * @throws CannotUseAddMethodsException - * @throws ReflectionException - * @throws RuntimeException - * - * @return $this - */ - public function addMethods(array $methods): self - { - if (empty($methods)) { - $this->emptyMethodsArray = true; - - return $this; - } - - try { - $reflector = new ReflectionClass($this->type); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - foreach ($methods as $method) { - if ($reflector->hasMethod($method)) { - throw new CannotUseAddMethodsException($this->type, $method); - } - } - - $this->methods = array_merge($this->methods ?? [], $methods); - - return $this; - } - - /** - * Specifies the subset of methods to not mock. Default is to mock all of them. - * - * @deprecated https://github.com/sebastianbergmann/phpunit/pull/3687 - * - * @throws ReflectionException - */ - public function setMethodsExcept(array $methods = []): self - { - return $this->setMethods( - array_diff( - $this->generator->getClassMethods($this->type), - $methods - ) - ); - } - - /** - * Specifies the arguments for the constructor. - * - * @return $this - */ - public function setConstructorArgs(array $args): self - { - $this->constructorArgs = $args; - - return $this; - } - - /** - * Specifies the name for the mock class. - * - * @return $this - */ - public function setMockClassName(string $name): self - { - $this->mockClassName = $name; - - return $this; - } - - /** - * Disables the invocation of the original constructor. - * - * @return $this - */ - public function disableOriginalConstructor(): self - { - $this->originalConstructor = false; - - return $this; - } - - /** - * Enables the invocation of the original constructor. - * - * @return $this - */ - public function enableOriginalConstructor(): self - { - $this->originalConstructor = true; - - return $this; - } - - /** - * Disables the invocation of the original clone constructor. - * - * @return $this - */ - public function disableOriginalClone(): self - { - $this->originalClone = false; - - return $this; - } - - /** - * Enables the invocation of the original clone constructor. - * - * @return $this - */ - public function enableOriginalClone(): self - { - $this->originalClone = true; - - return $this; - } - - /** - * Disables the use of class autoloading while creating the mock object. - * - * @return $this - */ - public function disableAutoload(): self - { - $this->autoload = false; - - return $this; - } - - /** - * Enables the use of class autoloading while creating the mock object. - * - * @return $this - */ - public function enableAutoload(): self - { - $this->autoload = true; - - return $this; - } - - /** - * Disables the cloning of arguments passed to mocked methods. - * - * @return $this - */ - public function disableArgumentCloning(): self - { - $this->cloneArguments = false; - - return $this; - } - - /** - * Enables the cloning of arguments passed to mocked methods. - * - * @return $this - */ - public function enableArgumentCloning(): self - { - $this->cloneArguments = true; - - return $this; - } - - /** - * Enables the invocation of the original methods. - * - * @return $this - */ - public function enableProxyingToOriginalMethods(): self - { - $this->callOriginalMethods = true; - - return $this; - } - - /** - * Disables the invocation of the original methods. - * - * @return $this - */ - public function disableProxyingToOriginalMethods(): self - { - $this->callOriginalMethods = false; - $this->proxyTarget = null; - - return $this; - } - - /** - * Sets the proxy target. - * - * @return $this - */ - public function setProxyTarget(object $object): self - { - $this->proxyTarget = $object; - - return $this; - } - - /** - * @return $this - */ - public function allowMockingUnknownTypes(): self - { - $this->allowMockingUnknownTypes = true; - - return $this; - } - - /** - * @return $this - */ - public function disallowMockingUnknownTypes(): self - { - $this->allowMockingUnknownTypes = false; - - return $this; - } - - /** - * @return $this - */ - public function enableAutoReturnValueGeneration(): self - { - $this->returnValueGeneration = true; - - return $this; - } - - /** - * @return $this - */ - public function disableAutoReturnValueGeneration(): self - { - $this->returnValueGeneration = false; - - return $this; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/MockClass.php b/vendor/phpunit/phpunit/src/Framework/MockObject/MockClass.php deleted file mode 100644 index 253d7846..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/MockClass.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 PHPUnit\Framework\MockObject; - -use function call_user_func; -use function class_exists; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class MockClass implements MockType -{ - /** - * @var string - */ - private $classCode; - - /** - * @var class-string - */ - private $mockName; - - /** - * @var ConfigurableMethod[] - */ - private $configurableMethods; - - /** - * @psalm-param class-string $mockName - */ - public function __construct(string $classCode, string $mockName, array $configurableMethods) - { - $this->classCode = $classCode; - $this->mockName = $mockName; - $this->configurableMethods = $configurableMethods; - } - - /** - * @psalm-return class-string - */ - public function generate(): string - { - if (!class_exists($this->mockName, false)) { - eval($this->classCode); - - call_user_func( - [ - $this->mockName, - '__phpunit_initConfigurableMethods', - ], - ...$this->configurableMethods - ); - } - - return $this->mockName; - } - - public function getClassCode(): string - { - return $this->classCode; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/MockMethod.php b/vendor/phpunit/phpunit/src/Framework/MockObject/MockMethod.php deleted file mode 100644 index 2cf149ad..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/MockMethod.php +++ /dev/null @@ -1,380 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use const DIRECTORY_SEPARATOR; -use function explode; -use function implode; -use function is_object; -use function is_string; -use function preg_match; -use function preg_replace; -use function sprintf; -use function strlen; -use function strpos; -use function substr; -use function substr_count; -use function trim; -use function var_export; -use ReflectionMethod; -use ReflectionParameter; -use SebastianBergmann\Template\Exception as TemplateException; -use SebastianBergmann\Template\Template; -use SebastianBergmann\Type\ReflectionMapper; -use SebastianBergmann\Type\Type; -use SebastianBergmann\Type\UnknownType; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class MockMethod -{ - /** - * @var Template[] - */ - private static $templates = []; - - /** - * @var string - */ - private $className; - - /** - * @var string - */ - private $methodName; - - /** - * @var bool - */ - private $cloneArguments; - - /** - * @var string string - */ - private $modifier; - - /** - * @var string - */ - private $argumentsForDeclaration; - - /** - * @var string - */ - private $argumentsForCall; - - /** - * @var Type - */ - private $returnType; - - /** - * @var string - */ - private $reference; - - /** - * @var bool - */ - private $callOriginalMethod; - - /** - * @var bool - */ - private $static; - - /** - * @var ?string - */ - private $deprecation; - - /** - * @throws ReflectionException - * @throws RuntimeException - */ - public static function fromReflection(ReflectionMethod $method, bool $callOriginalMethod, bool $cloneArguments): self - { - if ($method->isPrivate()) { - $modifier = 'private'; - } elseif ($method->isProtected()) { - $modifier = 'protected'; - } else { - $modifier = 'public'; - } - - if ($method->isStatic()) { - $modifier .= ' static'; - } - - if ($method->returnsReference()) { - $reference = '&'; - } else { - $reference = ''; - } - - $docComment = $method->getDocComment(); - - if (is_string($docComment) && - preg_match('#\*[ \t]*+@deprecated[ \t]*+(.*?)\r?+\n[ \t]*+\*(?:[ \t]*+@|/$)#s', $docComment, $deprecation)) { - $deprecation = trim(preg_replace('#[ \t]*\r?\n[ \t]*+\*[ \t]*+#', ' ', $deprecation[1])); - } else { - $deprecation = null; - } - - return new self( - $method->getDeclaringClass()->getName(), - $method->getName(), - $cloneArguments, - $modifier, - self::getMethodParametersForDeclaration($method), - self::getMethodParametersForCall($method), - (new ReflectionMapper)->fromReturnType($method), - $reference, - $callOriginalMethod, - $method->isStatic(), - $deprecation - ); - } - - public static function fromName(string $fullClassName, string $methodName, bool $cloneArguments): self - { - return new self( - $fullClassName, - $methodName, - $cloneArguments, - 'public', - '', - '', - new UnknownType, - '', - false, - false, - null - ); - } - - public function __construct(string $className, string $methodName, bool $cloneArguments, string $modifier, string $argumentsForDeclaration, string $argumentsForCall, Type $returnType, string $reference, bool $callOriginalMethod, bool $static, ?string $deprecation) - { - $this->className = $className; - $this->methodName = $methodName; - $this->cloneArguments = $cloneArguments; - $this->modifier = $modifier; - $this->argumentsForDeclaration = $argumentsForDeclaration; - $this->argumentsForCall = $argumentsForCall; - $this->returnType = $returnType; - $this->reference = $reference; - $this->callOriginalMethod = $callOriginalMethod; - $this->static = $static; - $this->deprecation = $deprecation; - } - - public function getName(): string - { - return $this->methodName; - } - - /** - * @throws RuntimeException - */ - public function generateCode(): string - { - if ($this->static) { - $templateFile = 'mocked_static_method.tpl'; - } elseif ($this->returnType->isNever() || $this->returnType->isVoid()) { - $templateFile = sprintf( - '%s_method_never_or_void.tpl', - $this->callOriginalMethod ? 'proxied' : 'mocked' - ); - } else { - $templateFile = sprintf( - '%s_method.tpl', - $this->callOriginalMethod ? 'proxied' : 'mocked' - ); - } - - $deprecation = $this->deprecation; - - if (null !== $this->deprecation) { - $deprecation = "The {$this->className}::{$this->methodName} method is deprecated ({$this->deprecation})."; - $deprecationTemplate = $this->getTemplate('deprecation.tpl'); - - $deprecationTemplate->setVar( - [ - 'deprecation' => var_export($deprecation, true), - ] - ); - - $deprecation = $deprecationTemplate->render(); - } - - $template = $this->getTemplate($templateFile); - - $template->setVar( - [ - 'arguments_decl' => $this->argumentsForDeclaration, - 'arguments_call' => $this->argumentsForCall, - 'return_declaration' => !empty($this->returnType->asString()) ? (': ' . $this->returnType->asString()) : '', - 'return_type' => $this->returnType->asString(), - 'arguments_count' => !empty($this->argumentsForCall) ? substr_count($this->argumentsForCall, ',') + 1 : 0, - 'class_name' => $this->className, - 'method_name' => $this->methodName, - 'modifier' => $this->modifier, - 'reference' => $this->reference, - 'clone_arguments' => $this->cloneArguments ? 'true' : 'false', - 'deprecation' => $deprecation, - ] - ); - - return $template->render(); - } - - public function getReturnType(): Type - { - return $this->returnType; - } - - /** - * @throws RuntimeException - */ - private function getTemplate(string $template): Template - { - $filename = __DIR__ . DIRECTORY_SEPARATOR . 'Generator' . DIRECTORY_SEPARATOR . $template; - - if (!isset(self::$templates[$filename])) { - try { - self::$templates[$filename] = new Template($filename); - } catch (TemplateException $e) { - throw new RuntimeException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - } - - return self::$templates[$filename]; - } - - /** - * Returns the parameters of a function or method. - * - * @throws RuntimeException - */ - private static function getMethodParametersForDeclaration(ReflectionMethod $method): string - { - $parameters = []; - $types = (new ReflectionMapper)->fromParameterTypes($method); - - foreach ($method->getParameters() as $i => $parameter) { - $name = '$' . $parameter->getName(); - - /* Note: PHP extensions may use empty names for reference arguments - * or "..." for methods taking a variable number of arguments. - */ - if ($name === '$' || $name === '$...') { - $name = '$arg' . $i; - } - - $default = ''; - $reference = ''; - $typeDeclaration = ''; - - if (!$types[$i]->type()->isUnknown()) { - $typeDeclaration = $types[$i]->type()->asString() . ' '; - } - - if ($parameter->isPassedByReference()) { - $reference = '&'; - } - - if ($parameter->isVariadic()) { - $name = '...' . $name; - } elseif ($parameter->isDefaultValueAvailable()) { - $default = ' = ' . self::exportDefaultValue($parameter); - } elseif ($parameter->isOptional()) { - $default = ' = null'; - } - - $parameters[] = $typeDeclaration . $reference . $name . $default; - } - - return implode(', ', $parameters); - } - - /** - * Returns the parameters of a function or method. - * - * @throws ReflectionException - */ - private static function getMethodParametersForCall(ReflectionMethod $method): string - { - $parameters = []; - - foreach ($method->getParameters() as $i => $parameter) { - $name = '$' . $parameter->getName(); - - /* Note: PHP extensions may use empty names for reference arguments - * or "..." for methods taking a variable number of arguments. - */ - if ($name === '$' || $name === '$...') { - $name = '$arg' . $i; - } - - if ($parameter->isVariadic()) { - continue; - } - - if ($parameter->isPassedByReference()) { - $parameters[] = '&' . $name; - } else { - $parameters[] = $name; - } - } - - return implode(', ', $parameters); - } - - /** - * @throws ReflectionException - */ - private static function exportDefaultValue(ReflectionParameter $parameter): string - { - try { - $defaultValue = $parameter->getDefaultValue(); - - if (!is_object($defaultValue)) { - return (string) var_export($defaultValue, true); - } - - $parameterAsString = $parameter->__toString(); - - return (string) explode( - ' = ', - substr( - substr( - $parameterAsString, - strpos($parameterAsString, ' ') + strlen(' ') - ), - 0, - -2 - ) - )[1]; - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/MockMethodSet.php b/vendor/phpunit/phpunit/src/Framework/MockObject/MockMethodSet.php deleted file mode 100644 index 1c78963c..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/MockMethodSet.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function array_key_exists; -use function array_values; -use function strtolower; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class MockMethodSet -{ - /** - * @var MockMethod[] - */ - private $methods = []; - - public function addMethods(MockMethod ...$methods): void - { - foreach ($methods as $method) { - $this->methods[strtolower($method->getName())] = $method; - } - } - - /** - * @return MockMethod[] - */ - public function asArray(): array - { - return array_values($this->methods); - } - - public function hasMethod(string $methodName): bool - { - return array_key_exists(strtolower($methodName), $this->methods); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/MockObject.php b/vendor/phpunit/phpunit/src/Framework/MockObject/MockObject.php deleted file mode 100644 index 094decf4..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/MockObject.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 PHPUnit\Framework\MockObject; - -use PHPUnit\Framework\MockObject\Builder\InvocationMocker as BuilderInvocationMocker; -use PHPUnit\Framework\MockObject\Rule\InvocationOrder; - -/** - * @method BuilderInvocationMocker method($constraint) - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -interface MockObject extends Stub -{ - public function __phpunit_setOriginalObject($originalObject): void; - - public function __phpunit_verify(bool $unsetInvocationMocker = true): void; - - public function expects(InvocationOrder $invocationRule): BuilderInvocationMocker; -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/MockTrait.php b/vendor/phpunit/phpunit/src/Framework/MockObject/MockTrait.php deleted file mode 100644 index 7c326988..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/MockTrait.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function class_exists; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class MockTrait implements MockType -{ - /** - * @var string - */ - private $classCode; - - /** - * @var class-string - */ - private $mockName; - - /** - * @psalm-param class-string $mockName - */ - public function __construct(string $classCode, string $mockName) - { - $this->classCode = $classCode; - $this->mockName = $mockName; - } - - /** - * @psalm-return class-string - */ - public function generate(): string - { - if (!class_exists($this->mockName, false)) { - eval($this->classCode); - } - - return $this->mockName; - } - - public function getClassCode(): string - { - return $this->classCode; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/MockType.php b/vendor/phpunit/phpunit/src/Framework/MockObject/MockType.php deleted file mode 100644 index 6a03fb51..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/MockType.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -interface MockType -{ - /** - * @psalm-return class-string - */ - public function generate(): string; -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/AnyInvokedCount.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/AnyInvokedCount.php deleted file mode 100644 index f93e5686..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/AnyInvokedCount.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 PHPUnit\Framework\MockObject\Rule; - -use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class AnyInvokedCount extends InvocationOrder -{ - public function toString(): string - { - return 'invoked zero or more times'; - } - - public function verify(): void - { - } - - public function matches(BaseInvocation $invocation): bool - { - return true; - } - - protected function invokedDo(BaseInvocation $invocation): void - { - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/AnyParameters.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/AnyParameters.php deleted file mode 100644 index 61de7887..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/AnyParameters.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. - */ -namespace PHPUnit\Framework\MockObject\Rule; - -use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class AnyParameters implements ParametersRule -{ - public function toString(): string - { - return 'with any parameters'; - } - - public function apply(BaseInvocation $invocation): void - { - } - - public function verify(): void - { - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/ConsecutiveParameters.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/ConsecutiveParameters.php deleted file mode 100644 index 6025c0a1..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/ConsecutiveParameters.php +++ /dev/null @@ -1,130 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Rule; - -use function count; -use function gettype; -use function is_iterable; -use function sprintf; -use PHPUnit\Framework\Constraint\Constraint; -use PHPUnit\Framework\Constraint\IsEqual; -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\InvalidParameterGroupException; -use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ConsecutiveParameters implements ParametersRule -{ - /** - * @var array - */ - private $parameterGroups = []; - - /** - * @var array - */ - private $invocations = []; - - /** - * @throws \PHPUnit\Framework\Exception - */ - public function __construct(array $parameterGroups) - { - foreach ($parameterGroups as $index => $parameters) { - if (!is_iterable($parameters)) { - throw new InvalidParameterGroupException( - sprintf( - 'Parameter group #%d must be an array or Traversable, got %s', - $index, - gettype($parameters) - ) - ); - } - - foreach ($parameters as $parameter) { - if (!$parameter instanceof Constraint) { - $parameter = new IsEqual($parameter); - } - - $this->parameterGroups[$index][] = $parameter; - } - } - } - - public function toString(): string - { - return 'with consecutive parameters'; - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public function apply(BaseInvocation $invocation): void - { - $this->invocations[] = $invocation; - $callIndex = count($this->invocations) - 1; - - $this->verifyInvocation($invocation, $callIndex); - } - - /** - * @throws \PHPUnit\Framework\ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function verify(): void - { - foreach ($this->invocations as $callIndex => $invocation) { - $this->verifyInvocation($invocation, $callIndex); - } - } - - /** - * Verify a single invocation. - * - * @param int $callIndex - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - private function verifyInvocation(BaseInvocation $invocation, $callIndex): void - { - if (!isset($this->parameterGroups[$callIndex])) { - // no parameter assertion for this call index - return; - } - - $parameters = $this->parameterGroups[$callIndex]; - - if (count($invocation->getParameters()) < count($parameters)) { - throw new ExpectationFailedException( - sprintf( - 'Parameter count for invocation %s is too low.', - $invocation->toString() - ) - ); - } - - foreach ($parameters as $i => $parameter) { - $parameter->evaluate( - $invocation->getParameters()[$i], - sprintf( - 'Parameter %s for invocation #%d %s does not match expected ' . - 'value.', - $i, - $callIndex, - $invocation->toString() - ) - ); - } - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvocationOrder.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvocationOrder.php deleted file mode 100644 index 90aa4935..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvocationOrder.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Rule; - -use function count; -use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; -use PHPUnit\Framework\MockObject\Verifiable; -use PHPUnit\Framework\SelfDescribing; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -abstract class InvocationOrder implements SelfDescribing, Verifiable -{ - /** - * @var BaseInvocation[] - */ - private $invocations = []; - - public function getInvocationCount(): int - { - return count($this->invocations); - } - - public function hasBeenInvoked(): bool - { - return count($this->invocations) > 0; - } - - final public function invoked(BaseInvocation $invocation) - { - $this->invocations[] = $invocation; - - return $this->invokedDo($invocation); - } - - abstract public function matches(BaseInvocation $invocation): bool; - - abstract protected function invokedDo(BaseInvocation $invocation); -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtIndex.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtIndex.php deleted file mode 100644 index 9b51f4ef..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtIndex.php +++ /dev/null @@ -1,76 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Rule; - -use function sprintf; -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4297 - * - * @codeCoverageIgnore - */ -final class InvokedAtIndex extends InvocationOrder -{ - /** - * @var int - */ - private $sequenceIndex; - - /** - * @var int - */ - private $currentIndex = -1; - - /** - * @param int $sequenceIndex - */ - public function __construct($sequenceIndex) - { - $this->sequenceIndex = $sequenceIndex; - } - - public function toString(): string - { - return 'invoked at sequence index ' . $this->sequenceIndex; - } - - public function matches(BaseInvocation $invocation): bool - { - $this->currentIndex++; - - return $this->currentIndex == $this->sequenceIndex; - } - - /** - * Verifies that the current expectation is valid. If everything is OK the - * code should just return, if not it must throw an exception. - * - * @throws ExpectationFailedException - */ - public function verify(): void - { - if ($this->currentIndex < $this->sequenceIndex) { - throw new ExpectationFailedException( - sprintf( - 'The expected invocation at index %s was never reached.', - $this->sequenceIndex - ) - ); - } - } - - protected function invokedDo(BaseInvocation $invocation): void - { - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastCount.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastCount.php deleted file mode 100644 index a84aa655..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastCount.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 PHPUnit\Framework\MockObject\Rule; - -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class InvokedAtLeastCount extends InvocationOrder -{ - /** - * @var int - */ - private $requiredInvocations; - - /** - * @param int $requiredInvocations - */ - public function __construct($requiredInvocations) - { - $this->requiredInvocations = $requiredInvocations; - } - - public function toString(): string - { - return 'invoked at least ' . $this->requiredInvocations . ' times'; - } - - /** - * Verifies that the current expectation is valid. If everything is OK the - * code should just return, if not it must throw an exception. - * - * @throws ExpectationFailedException - */ - public function verify(): void - { - $count = $this->getInvocationCount(); - - if ($count < $this->requiredInvocations) { - throw new ExpectationFailedException( - 'Expected invocation at least ' . $this->requiredInvocations . - ' times but it occurred ' . $count . ' time(s).' - ); - } - } - - public function matches(BaseInvocation $invocation): bool - { - return true; - } - - protected function invokedDo(BaseInvocation $invocation): void - { - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastOnce.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastOnce.php deleted file mode 100644 index d0ad1f80..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastOnce.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Rule; - -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class InvokedAtLeastOnce extends InvocationOrder -{ - public function toString(): string - { - return 'invoked at least once'; - } - - /** - * Verifies that the current expectation is valid. If everything is OK the - * code should just return, if not it must throw an exception. - * - * @throws ExpectationFailedException - */ - public function verify(): void - { - $count = $this->getInvocationCount(); - - if ($count < 1) { - throw new ExpectationFailedException( - 'Expected invocation at least once but it never occurred.' - ); - } - } - - public function matches(BaseInvocation $invocation): bool - { - return true; - } - - protected function invokedDo(BaseInvocation $invocation): void - { - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtMostCount.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtMostCount.php deleted file mode 100644 index c3b815aa..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtMostCount.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 PHPUnit\Framework\MockObject\Rule; - -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class InvokedAtMostCount extends InvocationOrder -{ - /** - * @var int - */ - private $allowedInvocations; - - /** - * @param int $allowedInvocations - */ - public function __construct($allowedInvocations) - { - $this->allowedInvocations = $allowedInvocations; - } - - public function toString(): string - { - return 'invoked at most ' . $this->allowedInvocations . ' times'; - } - - /** - * Verifies that the current expectation is valid. If everything is OK the - * code should just return, if not it must throw an exception. - * - * @throws ExpectationFailedException - */ - public function verify(): void - { - $count = $this->getInvocationCount(); - - if ($count > $this->allowedInvocations) { - throw new ExpectationFailedException( - 'Expected invocation at most ' . $this->allowedInvocations . - ' times but it occurred ' . $count . ' time(s).' - ); - } - } - - public function matches(BaseInvocation $invocation): bool - { - return true; - } - - protected function invokedDo(BaseInvocation $invocation): void - { - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedCount.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedCount.php deleted file mode 100644 index 188326c9..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedCount.php +++ /dev/null @@ -1,102 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Rule; - -use function sprintf; -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class InvokedCount extends InvocationOrder -{ - /** - * @var int - */ - private $expectedCount; - - /** - * @param int $expectedCount - */ - public function __construct($expectedCount) - { - $this->expectedCount = $expectedCount; - } - - public function isNever(): bool - { - return $this->expectedCount === 0; - } - - public function toString(): string - { - return 'invoked ' . $this->expectedCount . ' time(s)'; - } - - public function matches(BaseInvocation $invocation): bool - { - return true; - } - - /** - * Verifies that the current expectation is valid. If everything is OK the - * code should just return, if not it must throw an exception. - * - * @throws ExpectationFailedException - */ - public function verify(): void - { - $count = $this->getInvocationCount(); - - if ($count !== $this->expectedCount) { - throw new ExpectationFailedException( - sprintf( - 'Method was expected to be called %d times, ' . - 'actually called %d times.', - $this->expectedCount, - $count - ) - ); - } - } - - /** - * @throws ExpectationFailedException - */ - protected function invokedDo(BaseInvocation $invocation): void - { - $count = $this->getInvocationCount(); - - if ($count > $this->expectedCount) { - $message = $invocation->toString() . ' '; - - switch ($this->expectedCount) { - case 0: - $message .= 'was not expected to be called.'; - - break; - - case 1: - $message .= 'was not expected to be called more than once.'; - - break; - - default: - $message .= sprintf( - 'was not expected to be called more than %d times.', - $this->expectedCount - ); - } - - throw new ExpectationFailedException($message); - } - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/MethodName.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/MethodName.php deleted file mode 100644 index 83ba3b8d..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/MethodName.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Rule; - -use function is_string; -use PHPUnit\Framework\Constraint\Constraint; -use PHPUnit\Framework\InvalidArgumentException; -use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; -use PHPUnit\Framework\MockObject\MethodNameConstraint; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class MethodName -{ - /** - * @var Constraint - */ - private $constraint; - - /** - * @param Constraint|string $constraint - * - * @throws InvalidArgumentException - */ - public function __construct($constraint) - { - if (is_string($constraint)) { - $constraint = new MethodNameConstraint($constraint); - } - - if (!$constraint instanceof Constraint) { - throw InvalidArgumentException::create(1, 'PHPUnit\Framework\Constraint\Constraint object or string'); - } - - $this->constraint = $constraint; - } - - public function toString(): string - { - return 'method name ' . $this->constraint->toString(); - } - - /** - * @throws \PHPUnit\Framework\ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function matches(BaseInvocation $invocation): bool - { - return $this->matchesName($invocation->getMethodName()); - } - - /** - * @throws \PHPUnit\Framework\ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function matchesName(string $methodName): bool - { - return (bool) $this->constraint->evaluate($methodName, '', true); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/Parameters.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/Parameters.php deleted file mode 100644 index 3f1cc53a..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/Parameters.php +++ /dev/null @@ -1,160 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Rule; - -use function count; -use function get_class; -use function sprintf; -use Exception; -use PHPUnit\Framework\Constraint\Constraint; -use PHPUnit\Framework\Constraint\IsAnything; -use PHPUnit\Framework\Constraint\IsEqual; -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Parameters implements ParametersRule -{ - /** - * @var Constraint[] - */ - private $parameters = []; - - /** - * @var BaseInvocation - */ - private $invocation; - - /** - * @var bool|ExpectationFailedException - */ - private $parameterVerificationResult; - - /** - * @throws \PHPUnit\Framework\Exception - */ - public function __construct(array $parameters) - { - foreach ($parameters as $parameter) { - if (!($parameter instanceof Constraint)) { - $parameter = new IsEqual( - $parameter - ); - } - - $this->parameters[] = $parameter; - } - } - - public function toString(): string - { - $text = 'with parameter'; - - foreach ($this->parameters as $index => $parameter) { - if ($index > 0) { - $text .= ' and'; - } - - $text .= ' ' . $index . ' ' . $parameter->toString(); - } - - return $text; - } - - /** - * @throws Exception - */ - public function apply(BaseInvocation $invocation): void - { - $this->invocation = $invocation; - $this->parameterVerificationResult = null; - - try { - $this->parameterVerificationResult = $this->doVerify(); - } catch (ExpectationFailedException $e) { - $this->parameterVerificationResult = $e; - - throw $this->parameterVerificationResult; - } - } - - /** - * Checks if the invocation $invocation matches the current rules. If it - * does the rule will get the invoked() method called which should check - * if an expectation is met. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - public function verify(): void - { - $this->doVerify(); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws ExpectationFailedException - */ - private function doVerify(): bool - { - if (isset($this->parameterVerificationResult)) { - return $this->guardAgainstDuplicateEvaluationOfParameterConstraints(); - } - - if ($this->invocation === null) { - throw new ExpectationFailedException('Mocked method does not exist.'); - } - - if (count($this->invocation->getParameters()) < count($this->parameters)) { - $message = 'Parameter count for invocation %s is too low.'; - - // The user called `->with($this->anything())`, but may have meant - // `->withAnyParameters()`. - // - // @see https://github.com/sebastianbergmann/phpunit-mock-objects/issues/199 - if (count($this->parameters) === 1 && - get_class($this->parameters[0]) === IsAnything::class) { - $message .= "\nTo allow 0 or more parameters with any value, omit ->with() or use ->withAnyParameters() instead."; - } - - throw new ExpectationFailedException( - sprintf($message, $this->invocation->toString()) - ); - } - - foreach ($this->parameters as $i => $parameter) { - $parameter->evaluate( - $this->invocation->getParameters()[$i], - sprintf( - 'Parameter %s for invocation %s does not match expected ' . - 'value.', - $i, - $this->invocation->toString() - ) - ); - } - - return true; - } - - /** - * @throws ExpectationFailedException - */ - private function guardAgainstDuplicateEvaluationOfParameterConstraints(): bool - { - if ($this->parameterVerificationResult instanceof ExpectationFailedException) { - throw $this->parameterVerificationResult; - } - - return (bool) $this->parameterVerificationResult; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/ParametersRule.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/ParametersRule.php deleted file mode 100644 index 70c47fe3..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/ParametersRule.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 PHPUnit\Framework\MockObject\Rule; - -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; -use PHPUnit\Framework\MockObject\Verifiable; -use PHPUnit\Framework\SelfDescribing; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -interface ParametersRule extends SelfDescribing, Verifiable -{ - /** - * @throws ExpectationFailedException if the invocation violates the rule - */ - public function apply(BaseInvocation $invocation): void; - - public function verify(): void; -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Stub.php deleted file mode 100644 index 2b032e2d..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub.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 PHPUnit\Framework\MockObject; - -use PHPUnit\Framework\MockObject\Builder\InvocationStubber; - -/** - * @method InvocationStubber method($constraint) - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -interface Stub -{ - public function __phpunit_getInvocationHandler(): InvocationHandler; - - public function __phpunit_hasMatchers(): bool; - - public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration): void; -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ConsecutiveCalls.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ConsecutiveCalls.php deleted file mode 100644 index 0dcf386b..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ConsecutiveCalls.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. - */ -namespace PHPUnit\Framework\MockObject\Stub; - -use function array_shift; -use function sprintf; -use PHPUnit\Framework\MockObject\Invocation; -use SebastianBergmann\Exporter\Exporter; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ConsecutiveCalls implements Stub -{ - /** - * @var array - */ - private $stack; - - /** - * @var mixed - */ - private $value; - - public function __construct(array $stack) - { - $this->stack = $stack; - } - - public function invoke(Invocation $invocation) - { - $this->value = array_shift($this->stack); - - if ($this->value instanceof Stub) { - $this->value = $this->value->invoke($invocation); - } - - return $this->value; - } - - public function toString(): string - { - $exporter = new Exporter; - - return sprintf( - 'return user-specified value %s', - $exporter->export($this->value) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/Exception.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/Exception.php deleted file mode 100644 index 5d64c96a..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/Exception.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Stub; - -use function sprintf; -use PHPUnit\Framework\MockObject\Invocation; -use SebastianBergmann\Exporter\Exporter; -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Exception implements Stub -{ - private $exception; - - public function __construct(Throwable $exception) - { - $this->exception = $exception; - } - - /** - * @throws Throwable - */ - public function invoke(Invocation $invocation): void - { - throw $this->exception; - } - - public function toString(): string - { - $exporter = new Exporter; - - return sprintf( - 'raise user-specified exception %s', - $exporter->export($this->exception) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnArgument.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnArgument.php deleted file mode 100644 index c7b3f8f4..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnArgument.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Stub; - -use function sprintf; -use PHPUnit\Framework\MockObject\Invocation; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ReturnArgument implements Stub -{ - /** - * @var int - */ - private $argumentIndex; - - public function __construct($argumentIndex) - { - $this->argumentIndex = $argumentIndex; - } - - public function invoke(Invocation $invocation) - { - if (isset($invocation->getParameters()[$this->argumentIndex])) { - return $invocation->getParameters()[$this->argumentIndex]; - } - } - - public function toString(): string - { - return sprintf('return argument #%d', $this->argumentIndex); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnCallback.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnCallback.php deleted file mode 100644 index e02181e9..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnCallback.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Stub; - -use function call_user_func_array; -use function get_class; -use function is_array; -use function is_object; -use function sprintf; -use PHPUnit\Framework\MockObject\Invocation; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ReturnCallback implements Stub -{ - private $callback; - - public function __construct($callback) - { - $this->callback = $callback; - } - - public function invoke(Invocation $invocation) - { - return call_user_func_array($this->callback, $invocation->getParameters()); - } - - public function toString(): string - { - if (is_array($this->callback)) { - if (is_object($this->callback[0])) { - $class = get_class($this->callback[0]); - $type = '->'; - } else { - $class = $this->callback[0]; - $type = '::'; - } - - return sprintf( - 'return result of user defined callback %s%s%s() with the ' . - 'passed arguments', - $class, - $type, - $this->callback[1] - ); - } - - return 'return result of user defined callback ' . $this->callback . - ' with the passed arguments'; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnReference.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnReference.php deleted file mode 100644 index 0d288ceb..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnReference.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Stub; - -use function sprintf; -use PHPUnit\Framework\MockObject\Invocation; -use SebastianBergmann\Exporter\Exporter; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ReturnReference implements Stub -{ - /** - * @var mixed - */ - private $reference; - - public function __construct(&$reference) - { - $this->reference = &$reference; - } - - public function invoke(Invocation $invocation) - { - return $this->reference; - } - - public function toString(): string - { - $exporter = new Exporter; - - return sprintf( - 'return user-specified reference %s', - $exporter->export($this->reference) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnSelf.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnSelf.php deleted file mode 100644 index 6d2137bf..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnSelf.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 PHPUnit\Framework\MockObject\Stub; - -use PHPUnit\Framework\MockObject\Invocation; -use PHPUnit\Framework\MockObject\RuntimeException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ReturnSelf implements Stub -{ - /** - * @throws RuntimeException - */ - public function invoke(Invocation $invocation) - { - return $invocation->getObject(); - } - - public function toString(): string - { - return 'return the current object'; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnStub.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnStub.php deleted file mode 100644 index fbcd0a07..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnStub.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Stub; - -use function sprintf; -use PHPUnit\Framework\MockObject\Invocation; -use SebastianBergmann\Exporter\Exporter; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ReturnStub implements Stub -{ - /** - * @var mixed - */ - private $value; - - public function __construct($value) - { - $this->value = $value; - } - - public function invoke(Invocation $invocation) - { - return $this->value; - } - - public function toString(): string - { - $exporter = new Exporter; - - return sprintf( - 'return user-specified value %s', - $exporter->export($this->value) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnValueMap.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnValueMap.php deleted file mode 100644 index 5fcd3a09..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnValueMap.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 PHPUnit\Framework\MockObject\Stub; - -use function array_pop; -use function count; -use function is_array; -use PHPUnit\Framework\MockObject\Invocation; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ReturnValueMap implements Stub -{ - /** - * @var array - */ - private $valueMap; - - public function __construct(array $valueMap) - { - $this->valueMap = $valueMap; - } - - public function invoke(Invocation $invocation) - { - $parameterCount = count($invocation->getParameters()); - - foreach ($this->valueMap as $map) { - if (!is_array($map) || $parameterCount !== (count($map) - 1)) { - continue; - } - - $return = array_pop($map); - - if ($invocation->getParameters() === $map) { - return $return; - } - } - } - - public function toString(): string - { - return 'return value from a map'; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/Stub.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/Stub.php deleted file mode 100644 index 15cfce5c..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/Stub.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 PHPUnit\Framework\MockObject\Stub; - -use PHPUnit\Framework\MockObject\Invocation; -use PHPUnit\Framework\SelfDescribing; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -interface Stub extends SelfDescribing -{ - /** - * Fakes the processing of the invocation $invocation by returning a - * specific value. - * - * @param Invocation $invocation The invocation which was mocked and matched by the current method and argument matchers - */ - public function invoke(Invocation $invocation); -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Verifiable.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Verifiable.php deleted file mode 100644 index 8c9a82c5..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Verifiable.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 PHPUnit\Framework\MockObject; - -use PHPUnit\Framework\ExpectationFailedException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -interface Verifiable -{ - /** - * Verifies that the current expectation is valid. If everything is OK the - * code should just return, if not it must throw an exception. - * - * @throws ExpectationFailedException - */ - public function verify(): void; -} diff --git a/vendor/phpunit/phpunit/src/Framework/Reorderable.php b/vendor/phpunit/phpunit/src/Framework/Reorderable.php deleted file mode 100644 index 34951f8d..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Reorderable.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 PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -interface Reorderable -{ - public function sortId(): string; - - /** - * @return list - */ - public function provides(): array; - - /** - * @return list - */ - public function requires(): array; -} diff --git a/vendor/phpunit/phpunit/src/Framework/SelfDescribing.php b/vendor/phpunit/phpunit/src/Framework/SelfDescribing.php deleted file mode 100644 index 73034f65..00000000 --- a/vendor/phpunit/phpunit/src/Framework/SelfDescribing.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -interface SelfDescribing -{ - /** - * Returns a string representation of the object. - */ - public function toString(): string; -} diff --git a/vendor/phpunit/phpunit/src/Framework/SkippedTest.php b/vendor/phpunit/phpunit/src/Framework/SkippedTest.php deleted file mode 100644 index a12aa402..00000000 --- a/vendor/phpunit/phpunit/src/Framework/SkippedTest.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -interface SkippedTest extends Throwable -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/SkippedTestCase.php b/vendor/phpunit/phpunit/src/Framework/SkippedTestCase.php deleted file mode 100644 index 51c00619..00000000 --- a/vendor/phpunit/phpunit/src/Framework/SkippedTestCase.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 PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class SkippedTestCase extends TestCase -{ - /** - * @var bool - */ - protected $backupGlobals = false; - - /** - * @var bool - */ - protected $backupStaticAttributes = false; - - /** - * @var bool - */ - protected $runTestInSeparateProcess = false; - - /** - * @var string - */ - private $message; - - public function __construct(string $className, string $methodName, string $message = '') - { - parent::__construct($className . '::' . $methodName); - - $this->message = $message; - } - - public function getMessage(): string - { - return $this->message; - } - - /** - * Returns a string representation of the test case. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function toString(): string - { - return $this->getName(); - } - - /** - * @throws Exception - */ - protected function runTest(): void - { - $this->markTestSkipped($this->message); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Test.php b/vendor/phpunit/phpunit/src/Framework/Test.php deleted file mode 100644 index be0dcd0e..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Test.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 PHPUnit\Framework; - -use Countable; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -interface Test extends Countable -{ - /** - * Runs a test and collects its result in a TestResult instance. - */ - public function run(TestResult $result = null): TestResult; -} diff --git a/vendor/phpunit/phpunit/src/Framework/TestBuilder.php b/vendor/phpunit/phpunit/src/Framework/TestBuilder.php deleted file mode 100644 index 5dd91e21..00000000 --- a/vendor/phpunit/phpunit/src/Framework/TestBuilder.php +++ /dev/null @@ -1,239 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -use function assert; -use function count; -use function get_class; -use function sprintf; -use function trim; -use PHPUnit\Util\Filter; -use PHPUnit\Util\InvalidDataSetException; -use PHPUnit\Util\Test as TestUtil; -use ReflectionClass; -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TestBuilder -{ - public function build(ReflectionClass $theClass, string $methodName): Test - { - $className = $theClass->getName(); - - if (!$theClass->isInstantiable()) { - return new ErrorTestCase( - sprintf('Cannot instantiate class "%s".', $className) - ); - } - - $backupSettings = TestUtil::getBackupSettings( - $className, - $methodName - ); - - $preserveGlobalState = TestUtil::getPreserveGlobalStateSettings( - $className, - $methodName - ); - - $runTestInSeparateProcess = TestUtil::getProcessIsolationSettings( - $className, - $methodName - ); - - $runClassInSeparateProcess = TestUtil::getClassProcessIsolationSettings( - $className, - $methodName - ); - - $constructor = $theClass->getConstructor(); - - if ($constructor === null) { - throw new Exception('No valid test provided.'); - } - - $parameters = $constructor->getParameters(); - - // TestCase() or TestCase($name) - if (count($parameters) < 2) { - $test = $this->buildTestWithoutData($className); - } // TestCase($name, $data) - else { - try { - $data = TestUtil::getProvidedData( - $className, - $methodName - ); - } catch (IncompleteTestError $e) { - $message = sprintf( - "Test for %s::%s marked incomplete by data provider\n%s", - $className, - $methodName, - $this->throwableToString($e) - ); - - $data = new IncompleteTestCase($className, $methodName, $message); - } catch (SkippedTestError $e) { - $message = sprintf( - "Test for %s::%s skipped by data provider\n%s", - $className, - $methodName, - $this->throwableToString($e) - ); - - $data = new SkippedTestCase($className, $methodName, $message); - } catch (Throwable $t) { - $message = sprintf( - "The data provider specified for %s::%s is invalid.\n%s", - $className, - $methodName, - $this->throwableToString($t) - ); - - $data = new ErrorTestCase($message); - } - - // Test method with @dataProvider. - if (isset($data)) { - $test = $this->buildDataProviderTestSuite( - $methodName, - $className, - $data, - $runTestInSeparateProcess, - $preserveGlobalState, - $runClassInSeparateProcess, - $backupSettings - ); - } else { - $test = $this->buildTestWithoutData($className); - } - } - - if ($test instanceof TestCase) { - $test->setName($methodName); - $this->configureTestCase( - $test, - $runTestInSeparateProcess, - $preserveGlobalState, - $runClassInSeparateProcess, - $backupSettings - ); - } - - return $test; - } - - /** @psalm-param class-string $className */ - private function buildTestWithoutData(string $className) - { - return new $className; - } - - /** @psalm-param class-string $className */ - private function buildDataProviderTestSuite( - string $methodName, - string $className, - $data, - bool $runTestInSeparateProcess, - ?bool $preserveGlobalState, - bool $runClassInSeparateProcess, - array $backupSettings - ): DataProviderTestSuite { - $dataProviderTestSuite = new DataProviderTestSuite( - $className . '::' . $methodName - ); - - $groups = TestUtil::getGroups($className, $methodName); - - if ($data instanceof ErrorTestCase || - $data instanceof SkippedTestCase || - $data instanceof IncompleteTestCase) { - $dataProviderTestSuite->addTest($data, $groups); - } else { - foreach ($data as $_dataName => $_data) { - $_test = new $className($methodName, $_data, $_dataName); - - assert($_test instanceof TestCase); - - $this->configureTestCase( - $_test, - $runTestInSeparateProcess, - $preserveGlobalState, - $runClassInSeparateProcess, - $backupSettings - ); - - $dataProviderTestSuite->addTest($_test, $groups); - } - } - - return $dataProviderTestSuite; - } - - private function configureTestCase( - TestCase $test, - bool $runTestInSeparateProcess, - ?bool $preserveGlobalState, - bool $runClassInSeparateProcess, - array $backupSettings - ): void { - if ($runTestInSeparateProcess) { - $test->setRunTestInSeparateProcess(true); - - if ($preserveGlobalState !== null) { - $test->setPreserveGlobalState($preserveGlobalState); - } - } - - if ($runClassInSeparateProcess) { - $test->setRunClassInSeparateProcess(true); - - if ($preserveGlobalState !== null) { - $test->setPreserveGlobalState($preserveGlobalState); - } - } - - if ($backupSettings['backupGlobals'] !== null) { - $test->setBackupGlobals($backupSettings['backupGlobals']); - } - - if ($backupSettings['backupStaticAttributes'] !== null) { - $test->setBackupStaticAttributes( - $backupSettings['backupStaticAttributes'] - ); - } - } - - private function throwableToString(Throwable $t): string - { - $message = $t->getMessage(); - - if (empty(trim($message))) { - $message = ''; - } - - if ($t instanceof InvalidDataSetException) { - return sprintf( - "%s\n%s", - $message, - Filter::getFilteredStacktrace($t) - ); - } - - return sprintf( - "%s: %s\n%s", - get_class($t), - $message, - Filter::getFilteredStacktrace($t) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/TestCase.php b/vendor/phpunit/phpunit/src/Framework/TestCase.php deleted file mode 100644 index 530ab6c2..00000000 --- a/vendor/phpunit/phpunit/src/Framework/TestCase.php +++ /dev/null @@ -1,2605 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -use const LC_ALL; -use const LC_COLLATE; -use const LC_CTYPE; -use const LC_MONETARY; -use const LC_NUMERIC; -use const LC_TIME; -use const PATHINFO_FILENAME; -use const PHP_EOL; -use const PHP_URL_PATH; -use function array_filter; -use function array_flip; -use function array_keys; -use function array_merge; -use function array_pop; -use function array_search; -use function array_unique; -use function array_values; -use function basename; -use function call_user_func; -use function chdir; -use function class_exists; -use function clearstatcache; -use function count; -use function debug_backtrace; -use function defined; -use function explode; -use function get_class; -use function get_include_path; -use function getcwd; -use function implode; -use function in_array; -use function ini_set; -use function is_array; -use function is_callable; -use function is_int; -use function is_object; -use function is_string; -use function libxml_clear_errors; -use function method_exists; -use function ob_end_clean; -use function ob_get_contents; -use function ob_get_level; -use function ob_start; -use function parse_url; -use function pathinfo; -use function preg_replace; -use function serialize; -use function setlocale; -use function sprintf; -use function strpos; -use function substr; -use function trim; -use function var_export; -use DeepCopy\DeepCopy; -use PHPUnit\Framework\Constraint\Exception as ExceptionConstraint; -use PHPUnit\Framework\Constraint\ExceptionCode; -use PHPUnit\Framework\Constraint\ExceptionMessage; -use PHPUnit\Framework\Constraint\ExceptionMessageRegularExpression; -use PHPUnit\Framework\Constraint\LogicalOr; -use PHPUnit\Framework\Error\Deprecated; -use PHPUnit\Framework\Error\Error; -use PHPUnit\Framework\Error\Notice; -use PHPUnit\Framework\Error\Warning as WarningError; -use PHPUnit\Framework\MockObject\Generator as MockGenerator; -use PHPUnit\Framework\MockObject\MockBuilder; -use PHPUnit\Framework\MockObject\MockObject; -use PHPUnit\Framework\MockObject\Rule\AnyInvokedCount as AnyInvokedCountMatcher; -use PHPUnit\Framework\MockObject\Rule\InvokedAtIndex as InvokedAtIndexMatcher; -use PHPUnit\Framework\MockObject\Rule\InvokedAtLeastCount as InvokedAtLeastCountMatcher; -use PHPUnit\Framework\MockObject\Rule\InvokedAtLeastOnce as InvokedAtLeastOnceMatcher; -use PHPUnit\Framework\MockObject\Rule\InvokedAtMostCount as InvokedAtMostCountMatcher; -use PHPUnit\Framework\MockObject\Rule\InvokedCount as InvokedCountMatcher; -use PHPUnit\Framework\MockObject\Stub; -use PHPUnit\Framework\MockObject\Stub\ConsecutiveCalls as ConsecutiveCallsStub; -use PHPUnit\Framework\MockObject\Stub\Exception as ExceptionStub; -use PHPUnit\Framework\MockObject\Stub\ReturnArgument as ReturnArgumentStub; -use PHPUnit\Framework\MockObject\Stub\ReturnCallback as ReturnCallbackStub; -use PHPUnit\Framework\MockObject\Stub\ReturnSelf as ReturnSelfStub; -use PHPUnit\Framework\MockObject\Stub\ReturnStub; -use PHPUnit\Framework\MockObject\Stub\ReturnValueMap as ReturnValueMapStub; -use PHPUnit\Runner\BaseTestRunner; -use PHPUnit\Runner\PhptTestCase; -use PHPUnit\Util\Cloner; -use PHPUnit\Util\Exception as UtilException; -use PHPUnit\Util\GlobalState; -use PHPUnit\Util\PHP\AbstractPhpProcess; -use PHPUnit\Util\Test as TestUtil; -use Prophecy\Exception\Prediction\PredictionException; -use Prophecy\Prophecy\MethodProphecy; -use Prophecy\Prophecy\ObjectProphecy; -use Prophecy\Prophet; -use ReflectionClass; -use ReflectionException; -use SebastianBergmann\Comparator\Comparator; -use SebastianBergmann\Comparator\Factory as ComparatorFactory; -use SebastianBergmann\Diff\Differ; -use SebastianBergmann\Exporter\Exporter; -use SebastianBergmann\GlobalState\ExcludeList; -use SebastianBergmann\GlobalState\Restorer; -use SebastianBergmann\GlobalState\Snapshot; -use SebastianBergmann\ObjectEnumerator\Enumerator; -use SebastianBergmann\Template\Template; -use SoapClient; -use Throwable; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -abstract class TestCase extends Assert implements Reorderable, SelfDescribing, Test -{ - private const LOCALE_CATEGORIES = [LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, LC_TIME]; - - /** - * @var ?bool - */ - protected $backupGlobals; - - /** - * @var string[] - */ - protected $backupGlobalsExcludeList = []; - - /** - * @var string[] - * - * @deprecated Use $backupGlobalsExcludeList instead - */ - protected $backupGlobalsBlacklist = []; - - /** - * @var bool - */ - protected $backupStaticAttributes; - - /** - * @var array> - */ - protected $backupStaticAttributesExcludeList = []; - - /** - * @var array> - * - * @deprecated Use $backupStaticAttributesExcludeList instead - */ - protected $backupStaticAttributesBlacklist = []; - - /** - * @var bool - */ - protected $runTestInSeparateProcess; - - /** - * @var bool - */ - protected $preserveGlobalState = true; - - /** - * @var list - */ - protected $providedTests = []; - - /** - * @var bool - */ - private $runClassInSeparateProcess; - - /** - * @var bool - */ - private $inIsolation = false; - - /** - * @var array - */ - private $data; - - /** - * @var int|string - */ - private $dataName; - - /** - * @var null|string - */ - private $expectedException; - - /** - * @var null|string - */ - private $expectedExceptionMessage; - - /** - * @var null|string - */ - private $expectedExceptionMessageRegExp; - - /** - * @var null|int|string - */ - private $expectedExceptionCode; - - /** - * @var string - */ - private $name = ''; - - /** - * @var list - */ - private $dependencies = []; - - /** - * @var array - */ - private $dependencyInput = []; - - /** - * @var array - */ - private $iniSettings = []; - - /** - * @var array - */ - private $locale = []; - - /** - * @var MockObject[] - */ - private $mockObjects = []; - - /** - * @var MockGenerator - */ - private $mockObjectGenerator; - - /** - * @var int - */ - private $status = BaseTestRunner::STATUS_UNKNOWN; - - /** - * @var string - */ - private $statusMessage = ''; - - /** - * @var int - */ - private $numAssertions = 0; - - /** - * @var TestResult - */ - private $result; - - /** - * @var mixed - */ - private $testResult; - - /** - * @var string - */ - private $output = ''; - - /** - * @var ?string - */ - private $outputExpectedRegex; - - /** - * @var ?string - */ - private $outputExpectedString; - - /** - * @var mixed - */ - private $outputCallback = false; - - /** - * @var bool - */ - private $outputBufferingActive = false; - - /** - * @var int - */ - private $outputBufferingLevel; - - /** - * @var bool - */ - private $outputRetrievedForAssertion = false; - - /** - * @var ?Snapshot - */ - private $snapshot; - - /** - * @var \Prophecy\Prophet - */ - private $prophet; - - /** - * @var bool - */ - private $beStrictAboutChangesToGlobalState = false; - - /** - * @var bool - */ - private $registerMockObjectsFromTestArgumentsRecursively = false; - - /** - * @var string[] - */ - private $warnings = []; - - /** - * @var string[] - */ - private $groups = []; - - /** - * @var bool - */ - private $doesNotPerformAssertions = false; - - /** - * @var Comparator[] - */ - private $customComparators = []; - - /** - * @var string[] - */ - private $doubledTypes = []; - - /** - * Returns a matcher that matches when the method is executed - * zero or more times. - */ - public static function any(): AnyInvokedCountMatcher - { - return new AnyInvokedCountMatcher; - } - - /** - * Returns a matcher that matches when the method is never executed. - */ - public static function never(): InvokedCountMatcher - { - return new InvokedCountMatcher(0); - } - - /** - * Returns a matcher that matches when the method is executed - * at least N times. - */ - public static function atLeast(int $requiredInvocations): InvokedAtLeastCountMatcher - { - return new InvokedAtLeastCountMatcher( - $requiredInvocations - ); - } - - /** - * Returns a matcher that matches when the method is executed at least once. - */ - public static function atLeastOnce(): InvokedAtLeastOnceMatcher - { - return new InvokedAtLeastOnceMatcher; - } - - /** - * Returns a matcher that matches when the method is executed exactly once. - */ - public static function once(): InvokedCountMatcher - { - return new InvokedCountMatcher(1); - } - - /** - * Returns a matcher that matches when the method is executed - * exactly $count times. - */ - public static function exactly(int $count): InvokedCountMatcher - { - return new InvokedCountMatcher($count); - } - - /** - * Returns a matcher that matches when the method is executed - * at most N times. - */ - public static function atMost(int $allowedInvocations): InvokedAtMostCountMatcher - { - return new InvokedAtMostCountMatcher($allowedInvocations); - } - - /** - * Returns a matcher that matches when the method is executed - * at the given index. - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4297 - * - * @codeCoverageIgnore - */ - public static function at(int $index): InvokedAtIndexMatcher - { - $stack = debug_backtrace(); - - while (!empty($stack)) { - $frame = array_pop($stack); - - if (isset($frame['object']) && $frame['object'] instanceof self) { - $frame['object']->addWarning( - 'The at() matcher has been deprecated. It will be removed in PHPUnit 10. Please refactor your test to not rely on the order in which methods are invoked.' - ); - - break; - } - } - - return new InvokedAtIndexMatcher($index); - } - - public static function returnValue($value): ReturnStub - { - return new ReturnStub($value); - } - - public static function returnValueMap(array $valueMap): ReturnValueMapStub - { - return new ReturnValueMapStub($valueMap); - } - - public static function returnArgument(int $argumentIndex): ReturnArgumentStub - { - return new ReturnArgumentStub($argumentIndex); - } - - public static function returnCallback($callback): ReturnCallbackStub - { - return new ReturnCallbackStub($callback); - } - - /** - * Returns the current object. - * - * This method is useful when mocking a fluent interface. - */ - public static function returnSelf(): ReturnSelfStub - { - return new ReturnSelfStub; - } - - public static function throwException(Throwable $exception): ExceptionStub - { - return new ExceptionStub($exception); - } - - public static function onConsecutiveCalls(...$args): ConsecutiveCallsStub - { - return new ConsecutiveCallsStub($args); - } - - /** - * @param int|string $dataName - * - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function __construct(?string $name = null, array $data = [], $dataName = '') - { - if ($name !== null) { - $this->setName($name); - } - - $this->data = $data; - $this->dataName = $dataName; - } - - /** - * This method is called before the first test of this test class is run. - */ - public static function setUpBeforeClass(): void - { - } - - /** - * This method is called after the last test of this test class is run. - */ - public static function tearDownAfterClass(): void - { - } - - /** - * This method is called before each test. - */ - protected function setUp(): void - { - } - - /** - * Performs assertions shared by all tests of a test case. - * - * This method is called between setUp() and test. - */ - protected function assertPreConditions(): void - { - } - - /** - * Performs assertions shared by all tests of a test case. - * - * This method is called between test and tearDown(). - */ - protected function assertPostConditions(): void - { - } - - /** - * This method is called after each test. - */ - protected function tearDown(): void - { - } - - /** - * Returns a string representation of the test case. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - */ - public function toString(): string - { - try { - $class = new ReflectionClass($this); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - $buffer = sprintf( - '%s::%s', - $class->name, - $this->getName(false) - ); - - return $buffer . $this->getDataSetAsString(); - } - - public function count(): int - { - return 1; - } - - public function getActualOutputForAssertion(): string - { - $this->outputRetrievedForAssertion = true; - - return $this->getActualOutput(); - } - - public function expectOutputRegex(string $expectedRegex): void - { - $this->outputExpectedRegex = $expectedRegex; - } - - public function expectOutputString(string $expectedString): void - { - $this->outputExpectedString = $expectedString; - } - - /** - * @psalm-param class-string<\Throwable> $exception - */ - public function expectException(string $exception): void - { - // @codeCoverageIgnoreStart - switch ($exception) { - case Deprecated::class: - $this->addWarning('Support for using expectException() with PHPUnit\Framework\Error\Deprecated is deprecated and will be removed in PHPUnit 10. Use expectDeprecation() instead.'); - - break; - - case Error::class: - $this->addWarning('Support for using expectException() with PHPUnit\Framework\Error\Error is deprecated and will be removed in PHPUnit 10. Use expectError() instead.'); - - break; - - case Notice::class: - $this->addWarning('Support for using expectException() with PHPUnit\Framework\Error\Notice is deprecated and will be removed in PHPUnit 10. Use expectNotice() instead.'); - - break; - - case WarningError::class: - $this->addWarning('Support for using expectException() with PHPUnit\Framework\Error\Warning is deprecated and will be removed in PHPUnit 10. Use expectWarning() instead.'); - - break; - } - // @codeCoverageIgnoreEnd - - $this->expectedException = $exception; - } - - /** - * @param int|string $code - */ - public function expectExceptionCode($code): void - { - $this->expectedExceptionCode = $code; - } - - public function expectExceptionMessage(string $message): void - { - $this->expectedExceptionMessage = $message; - } - - public function expectExceptionMessageMatches(string $regularExpression): void - { - $this->expectedExceptionMessageRegExp = $regularExpression; - } - - /** - * Sets up an expectation for an exception to be raised by the code under test. - * Information for expected exception class, expected exception message, and - * expected exception code are retrieved from a given Exception object. - */ - public function expectExceptionObject(\Exception $exception): void - { - $this->expectException(get_class($exception)); - $this->expectExceptionMessage($exception->getMessage()); - $this->expectExceptionCode($exception->getCode()); - } - - public function expectNotToPerformAssertions(): void - { - $this->doesNotPerformAssertions = true; - } - - public function expectDeprecation(): void - { - $this->expectedException = Deprecated::class; - } - - public function expectDeprecationMessage(string $message): void - { - $this->expectExceptionMessage($message); - } - - public function expectDeprecationMessageMatches(string $regularExpression): void - { - $this->expectExceptionMessageMatches($regularExpression); - } - - public function expectNotice(): void - { - $this->expectedException = Notice::class; - } - - public function expectNoticeMessage(string $message): void - { - $this->expectExceptionMessage($message); - } - - public function expectNoticeMessageMatches(string $regularExpression): void - { - $this->expectExceptionMessageMatches($regularExpression); - } - - public function expectWarning(): void - { - $this->expectedException = WarningError::class; - } - - public function expectWarningMessage(string $message): void - { - $this->expectExceptionMessage($message); - } - - public function expectWarningMessageMatches(string $regularExpression): void - { - $this->expectExceptionMessageMatches($regularExpression); - } - - public function expectError(): void - { - $this->expectedException = Error::class; - } - - public function expectErrorMessage(string $message): void - { - $this->expectExceptionMessage($message); - } - - public function expectErrorMessageMatches(string $regularExpression): void - { - $this->expectExceptionMessageMatches($regularExpression); - } - - public function getStatus(): int - { - return $this->status; - } - - public function markAsRisky(): void - { - $this->status = BaseTestRunner::STATUS_RISKY; - } - - public function getStatusMessage(): string - { - return $this->statusMessage; - } - - public function hasFailed(): bool - { - $status = $this->getStatus(); - - return $status === BaseTestRunner::STATUS_FAILURE || $status === BaseTestRunner::STATUS_ERROR; - } - - /** - * Runs the test case and collects the results in a TestResult object. - * If no TestResult object is passed a new one will be created. - * - * @throws \SebastianBergmann\CodeCoverage\InvalidArgumentException - * @throws \SebastianBergmann\CodeCoverage\UnintentionallyCoveredCodeException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws CodeCoverageException - * @throws UtilException - */ - public function run(TestResult $result = null): TestResult - { - if ($result === null) { - $result = $this->createResult(); - } - - if (!$this instanceof ErrorTestCase && !$this instanceof WarningTestCase) { - $this->setTestResultObject($result); - } - - if (!$this instanceof ErrorTestCase && - !$this instanceof WarningTestCase && - !$this instanceof SkippedTestCase && - !$this->handleDependencies()) { - return $result; - } - - if ($this->runInSeparateProcess()) { - $runEntireClass = $this->runClassInSeparateProcess && !$this->runTestInSeparateProcess; - - try { - $class = new ReflectionClass($this); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if ($runEntireClass) { - $template = new Template( - __DIR__ . '/../Util/PHP/Template/TestCaseClass.tpl' - ); - } else { - $template = new Template( - __DIR__ . '/../Util/PHP/Template/TestCaseMethod.tpl' - ); - } - - if ($this->preserveGlobalState) { - $constants = GlobalState::getConstantsAsString(); - $globals = GlobalState::getGlobalsAsString(); - $includedFiles = GlobalState::getIncludedFilesAsString(); - $iniSettings = GlobalState::getIniSettingsAsString(); - } else { - $constants = ''; - - if (!empty($GLOBALS['__PHPUNIT_BOOTSTRAP'])) { - $globals = '$GLOBALS[\'__PHPUNIT_BOOTSTRAP\'] = ' . var_export($GLOBALS['__PHPUNIT_BOOTSTRAP'], true) . ";\n"; - } else { - $globals = ''; - } - - $includedFiles = ''; - $iniSettings = ''; - } - - $coverage = $result->getCollectCodeCoverageInformation() ? 'true' : 'false'; - $isStrictAboutTestsThatDoNotTestAnything = $result->isStrictAboutTestsThatDoNotTestAnything() ? 'true' : 'false'; - $isStrictAboutOutputDuringTests = $result->isStrictAboutOutputDuringTests() ? 'true' : 'false'; - $enforcesTimeLimit = $result->enforcesTimeLimit() ? 'true' : 'false'; - $isStrictAboutTodoAnnotatedTests = $result->isStrictAboutTodoAnnotatedTests() ? 'true' : 'false'; - $isStrictAboutResourceUsageDuringSmallTests = $result->isStrictAboutResourceUsageDuringSmallTests() ? 'true' : 'false'; - - if (defined('PHPUNIT_COMPOSER_INSTALL')) { - $composerAutoload = var_export(PHPUNIT_COMPOSER_INSTALL, true); - } else { - $composerAutoload = '\'\''; - } - - if (defined('__PHPUNIT_PHAR__')) { - $phar = var_export(__PHPUNIT_PHAR__, true); - } else { - $phar = '\'\''; - } - - $codeCoverage = $result->getCodeCoverage(); - $codeCoverageFilter = null; - $cachesStaticAnalysis = 'false'; - $codeCoverageCacheDirectory = null; - $driverMethod = 'forLineCoverage'; - - if ($codeCoverage) { - $codeCoverageFilter = $codeCoverage->filter(); - - if ($codeCoverage->collectsBranchAndPathCoverage()) { - $driverMethod = 'forLineAndPathCoverage'; - } - - if ($codeCoverage->cachesStaticAnalysis()) { - $cachesStaticAnalysis = 'true'; - $codeCoverageCacheDirectory = $codeCoverage->cacheDirectory(); - } - } - - $data = var_export(serialize($this->data), true); - $dataName = var_export($this->dataName, true); - $dependencyInput = var_export(serialize($this->dependencyInput), true); - $includePath = var_export(get_include_path(), true); - $codeCoverageFilter = var_export(serialize($codeCoverageFilter), true); - $codeCoverageCacheDirectory = var_export(serialize($codeCoverageCacheDirectory), true); - // must do these fixes because TestCaseMethod.tpl has unserialize('{data}') in it, and we can't break BC - // the lines above used to use addcslashes() rather than var_export(), which breaks null byte escape sequences - $data = "'." . $data . ".'"; - $dataName = "'.(" . $dataName . ").'"; - $dependencyInput = "'." . $dependencyInput . ".'"; - $includePath = "'." . $includePath . ".'"; - $codeCoverageFilter = "'." . $codeCoverageFilter . ".'"; - $codeCoverageCacheDirectory = "'." . $codeCoverageCacheDirectory . ".'"; - - $configurationFilePath = $GLOBALS['__PHPUNIT_CONFIGURATION_FILE'] ?? ''; - - $var = [ - 'composerAutoload' => $composerAutoload, - 'phar' => $phar, - 'filename' => $class->getFileName(), - 'className' => $class->getName(), - 'collectCodeCoverageInformation' => $coverage, - 'cachesStaticAnalysis' => $cachesStaticAnalysis, - 'codeCoverageCacheDirectory' => $codeCoverageCacheDirectory, - 'driverMethod' => $driverMethod, - 'data' => $data, - 'dataName' => $dataName, - 'dependencyInput' => $dependencyInput, - 'constants' => $constants, - 'globals' => $globals, - 'include_path' => $includePath, - 'included_files' => $includedFiles, - 'iniSettings' => $iniSettings, - 'isStrictAboutTestsThatDoNotTestAnything' => $isStrictAboutTestsThatDoNotTestAnything, - 'isStrictAboutOutputDuringTests' => $isStrictAboutOutputDuringTests, - 'enforcesTimeLimit' => $enforcesTimeLimit, - 'isStrictAboutTodoAnnotatedTests' => $isStrictAboutTodoAnnotatedTests, - 'isStrictAboutResourceUsageDuringSmallTests' => $isStrictAboutResourceUsageDuringSmallTests, - 'codeCoverageFilter' => $codeCoverageFilter, - 'configurationFilePath' => $configurationFilePath, - 'name' => $this->getName(false), - ]; - - if (!$runEntireClass) { - $var['methodName'] = $this->name; - } - - $template->setVar($var); - - $php = AbstractPhpProcess::factory(); - $php->runTestJob($template->render(), $this, $result); - } else { - $result->run($this); - } - - $this->result = null; - - return $result; - } - - /** - * Returns a builder object to create mock objects using a fluent interface. - * - * @psalm-template RealInstanceType of object - * - * @psalm-param class-string $className - * - * @psalm-return MockBuilder - */ - public function getMockBuilder(string $className): MockBuilder - { - $this->recordDoubledType($className); - - return new MockBuilder($this, $className); - } - - public function registerComparator(Comparator $comparator): void - { - ComparatorFactory::getInstance()->register($comparator); - - $this->customComparators[] = $comparator; - } - - /** - * @return string[] - * - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function doubledTypes(): array - { - return array_unique($this->doubledTypes); - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function getGroups(): array - { - return $this->groups; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function setGroups(array $groups): void - { - $this->groups = $groups; - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function getName(bool $withDataSet = true): string - { - if ($withDataSet) { - return $this->name . $this->getDataSetAsString(false); - } - - return $this->name; - } - - /** - * Returns the size of the test. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function getSize(): int - { - return TestUtil::getSize( - static::class, - $this->getName(false) - ); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function hasSize(): bool - { - return $this->getSize() !== TestUtil::UNKNOWN; - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function isSmall(): bool - { - return $this->getSize() === TestUtil::SMALL; - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function isMedium(): bool - { - return $this->getSize() === TestUtil::MEDIUM; - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function isLarge(): bool - { - return $this->getSize() === TestUtil::LARGE; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function getActualOutput(): string - { - if (!$this->outputBufferingActive) { - return $this->output; - } - - return (string) ob_get_contents(); - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function hasOutput(): bool - { - if ($this->output === '') { - return false; - } - - if ($this->hasExpectationOnOutput()) { - return false; - } - - return true; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function doesNotPerformAssertions(): bool - { - return $this->doesNotPerformAssertions; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function hasExpectationOnOutput(): bool - { - return is_string($this->outputExpectedString) || is_string($this->outputExpectedRegex) || $this->outputRetrievedForAssertion; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function getExpectedException(): ?string - { - return $this->expectedException; - } - - /** - * @return null|int|string - * - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function getExpectedExceptionCode() - { - return $this->expectedExceptionCode; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function getExpectedExceptionMessage(): ?string - { - return $this->expectedExceptionMessage; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function getExpectedExceptionMessageRegExp(): ?string - { - return $this->expectedExceptionMessageRegExp; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function setRegisterMockObjectsFromTestArgumentsRecursively(bool $flag): void - { - $this->registerMockObjectsFromTestArgumentsRecursively = $flag; - } - - /** - * @throws Throwable - * - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function runBare(): void - { - $this->numAssertions = 0; - - $this->snapshotGlobalState(); - $this->startOutputBuffering(); - clearstatcache(); - $currentWorkingDirectory = getcwd(); - - $hookMethods = TestUtil::getHookMethods(static::class); - - $hasMetRequirements = false; - - try { - $this->checkRequirements(); - $hasMetRequirements = true; - - if ($this->inIsolation) { - foreach ($hookMethods['beforeClass'] as $method) { - $this->{$method}(); - } - } - - $this->setDoesNotPerformAssertionsFromAnnotation(); - - foreach ($hookMethods['before'] as $method) { - $this->{$method}(); - } - - foreach ($hookMethods['preCondition'] as $method) { - $this->{$method}(); - } - - $this->testResult = $this->runTest(); - $this->verifyMockObjects(); - - foreach ($hookMethods['postCondition'] as $method) { - $this->{$method}(); - } - - if (!empty($this->warnings)) { - throw new Warning( - implode( - "\n", - array_unique($this->warnings) - ) - ); - } - - $this->status = BaseTestRunner::STATUS_PASSED; - } catch (IncompleteTest $e) { - $this->status = BaseTestRunner::STATUS_INCOMPLETE; - $this->statusMessage = $e->getMessage(); - } catch (SkippedTest $e) { - $this->status = BaseTestRunner::STATUS_SKIPPED; - $this->statusMessage = $e->getMessage(); - } catch (Warning $e) { - $this->status = BaseTestRunner::STATUS_WARNING; - $this->statusMessage = $e->getMessage(); - } catch (AssertionFailedError $e) { - $this->status = BaseTestRunner::STATUS_FAILURE; - $this->statusMessage = $e->getMessage(); - } catch (PredictionException $e) { - $this->status = BaseTestRunner::STATUS_FAILURE; - $this->statusMessage = $e->getMessage(); - } catch (Throwable $_e) { - $e = $_e; - $this->status = BaseTestRunner::STATUS_ERROR; - $this->statusMessage = $_e->getMessage(); - } - - $this->mockObjects = []; - $this->prophet = null; - - // Tear down the fixture. An exception raised in tearDown() will be - // caught and passed on when no exception was raised before. - try { - if ($hasMetRequirements) { - foreach ($hookMethods['after'] as $method) { - $this->{$method}(); - } - - if ($this->inIsolation) { - foreach ($hookMethods['afterClass'] as $method) { - $this->{$method}(); - } - } - } - } catch (Throwable $_e) { - $e = $e ?? $_e; - } - - try { - $this->stopOutputBuffering(); - } catch (RiskyTestError $_e) { - $e = $e ?? $_e; - } - - if (isset($_e)) { - $this->status = BaseTestRunner::STATUS_ERROR; - $this->statusMessage = $_e->getMessage(); - } - - clearstatcache(); - - if ($currentWorkingDirectory !== getcwd()) { - chdir($currentWorkingDirectory); - } - - $this->restoreGlobalState(); - $this->unregisterCustomComparators(); - $this->cleanupIniSettings(); - $this->cleanupLocaleSettings(); - libxml_clear_errors(); - - // Perform assertion on output. - if (!isset($e)) { - try { - if ($this->outputExpectedRegex !== null) { - $this->assertMatchesRegularExpression($this->outputExpectedRegex, $this->output); - } elseif ($this->outputExpectedString !== null) { - $this->assertEquals($this->outputExpectedString, $this->output); - } - } catch (Throwable $_e) { - $e = $_e; - } - } - - // Workaround for missing "finally". - if (isset($e)) { - if ($e instanceof PredictionException) { - $e = new AssertionFailedError($e->getMessage()); - } - - $this->onNotSuccessfulTest($e); - } - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function setName(string $name): void - { - $this->name = $name; - - if (is_callable($this->sortId(), true)) { - $this->providedTests = [new ExecutionOrderDependency($this->sortId())]; - } - } - - /** - * @param list $dependencies - * - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function setDependencies(array $dependencies): void - { - $this->dependencies = $dependencies; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function setDependencyInput(array $dependencyInput): void - { - $this->dependencyInput = $dependencyInput; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function setBeStrictAboutChangesToGlobalState(?bool $beStrictAboutChangesToGlobalState): void - { - $this->beStrictAboutChangesToGlobalState = $beStrictAboutChangesToGlobalState; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function setBackupGlobals(?bool $backupGlobals): void - { - if ($this->backupGlobals === null && $backupGlobals !== null) { - $this->backupGlobals = $backupGlobals; - } - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function setBackupStaticAttributes(?bool $backupStaticAttributes): void - { - if ($this->backupStaticAttributes === null && $backupStaticAttributes !== null) { - $this->backupStaticAttributes = $backupStaticAttributes; - } - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function setRunTestInSeparateProcess(bool $runTestInSeparateProcess): void - { - if ($this->runTestInSeparateProcess === null) { - $this->runTestInSeparateProcess = $runTestInSeparateProcess; - } - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function setRunClassInSeparateProcess(bool $runClassInSeparateProcess): void - { - if ($this->runClassInSeparateProcess === null) { - $this->runClassInSeparateProcess = $runClassInSeparateProcess; - } - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function setPreserveGlobalState(bool $preserveGlobalState): void - { - $this->preserveGlobalState = $preserveGlobalState; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function setInIsolation(bool $inIsolation): void - { - $this->inIsolation = $inIsolation; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function isInIsolation(): bool - { - return $this->inIsolation; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function getResult() - { - return $this->testResult; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function setResult($result): void - { - $this->testResult = $result; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function setOutputCallback(callable $callback): void - { - $this->outputCallback = $callback; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function getTestResultObject(): ?TestResult - { - return $this->result; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function setTestResultObject(TestResult $result): void - { - $this->result = $result; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function registerMockObject(MockObject $mockObject): void - { - $this->mockObjects[] = $mockObject; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function addToAssertionCount(int $count): void - { - $this->numAssertions += $count; - } - - /** - * Returns the number of assertions performed by this test. - * - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function getNumAssertions(): int - { - return $this->numAssertions; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function usesDataProvider(): bool - { - return !empty($this->data); - } - - /** - * @return int|string - * - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function dataName() - { - return $this->dataName; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function getDataSetAsString(bool $includeData = true): string - { - $buffer = ''; - - if (!empty($this->data)) { - if (is_int($this->dataName)) { - $buffer .= sprintf(' with data set #%d', $this->dataName); - } else { - $buffer .= sprintf(' with data set "%s"', $this->dataName); - } - - if ($includeData) { - $exporter = new Exporter; - - $buffer .= sprintf(' (%s)', $exporter->shortenedRecursiveExport($this->data)); - } - } - - return $buffer; - } - - /** - * Gets the data set of a TestCase. - * - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function getProvidedData(): array - { - return $this->data; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - public function addWarning(string $warning): void - { - $this->warnings[] = $warning; - } - - public function sortId(): string - { - $id = $this->name; - - if (strpos($id, '::') === false) { - $id = static::class . '::' . $id; - } - - if ($this->usesDataProvider()) { - $id .= $this->getDataSetAsString(false); - } - - return $id; - } - - /** - * Returns the normalized test name as class::method. - * - * @return list - */ - public function provides(): array - { - return $this->providedTests; - } - - /** - * Returns a list of normalized dependency names, class::method. - * - * This list can differ from the raw dependencies as the resolver has - * no need for the [!][shallow]clone prefix that is filtered out - * during normalization. - * - * @return list - */ - public function requires(): array - { - return $this->dependencies; - } - - /** - * Override to run the test and assert its state. - * - * @throws \SebastianBergmann\ObjectEnumerator\InvalidArgumentException - * @throws AssertionFailedError - * @throws Exception - * @throws ExpectationFailedException - * @throws Throwable - */ - protected function runTest() - { - if (trim($this->name) === '') { - throw new Exception( - 'PHPUnit\Framework\TestCase::$name must be a non-blank string.' - ); - } - - $testArguments = array_merge($this->data, $this->dependencyInput); - - $this->registerMockObjectsFromTestArguments($testArguments); - - try { - $testResult = $this->{$this->name}(...array_values($testArguments)); - } catch (Throwable $exception) { - if (!$this->checkExceptionExpectations($exception)) { - throw $exception; - } - - if ($this->expectedException !== null) { - if ($this->expectedException === Error::class) { - $this->assertThat( - $exception, - LogicalOr::fromConstraints( - new ExceptionConstraint(Error::class), - new ExceptionConstraint(\Error::class) - ) - ); - } else { - $this->assertThat( - $exception, - new ExceptionConstraint( - $this->expectedException - ) - ); - } - } - - if ($this->expectedExceptionMessage !== null) { - $this->assertThat( - $exception, - new ExceptionMessage( - $this->expectedExceptionMessage - ) - ); - } - - if ($this->expectedExceptionMessageRegExp !== null) { - $this->assertThat( - $exception, - new ExceptionMessageRegularExpression( - $this->expectedExceptionMessageRegExp - ) - ); - } - - if ($this->expectedExceptionCode !== null) { - $this->assertThat( - $exception, - new ExceptionCode( - $this->expectedExceptionCode - ) - ); - } - - return; - } - - if ($this->expectedException !== null) { - $this->assertThat( - null, - new ExceptionConstraint( - $this->expectedException - ) - ); - } elseif ($this->expectedExceptionMessage !== null) { - $this->numAssertions++; - - throw new AssertionFailedError( - sprintf( - 'Failed asserting that exception with message "%s" is thrown', - $this->expectedExceptionMessage - ) - ); - } elseif ($this->expectedExceptionMessageRegExp !== null) { - $this->numAssertions++; - - throw new AssertionFailedError( - sprintf( - 'Failed asserting that exception with message matching "%s" is thrown', - $this->expectedExceptionMessageRegExp - ) - ); - } elseif ($this->expectedExceptionCode !== null) { - $this->numAssertions++; - - throw new AssertionFailedError( - sprintf( - 'Failed asserting that exception with code "%s" is thrown', - $this->expectedExceptionCode - ) - ); - } - - return $testResult; - } - - /** - * This method is a wrapper for the ini_set() function that automatically - * resets the modified php.ini setting to its original value after the - * test is run. - * - * @throws Exception - */ - protected function iniSet(string $varName, string $newValue): void - { - $currentValue = ini_set($varName, $newValue); - - if ($currentValue !== false) { - $this->iniSettings[$varName] = $currentValue; - } else { - throw new Exception( - sprintf( - 'INI setting "%s" could not be set to "%s".', - $varName, - $newValue - ) - ); - } - } - - /** - * This method is a wrapper for the setlocale() function that automatically - * resets the locale to its original value after the test is run. - * - * @throws Exception - */ - protected function setLocale(...$args): void - { - if (count($args) < 2) { - throw new Exception; - } - - [$category, $locale] = $args; - - if (!in_array($category, self::LOCALE_CATEGORIES, true)) { - throw new Exception; - } - - if (!is_array($locale) && !is_string($locale)) { - throw new Exception; - } - - $this->locale[$category] = setlocale($category, 0); - - $result = setlocale(...$args); - - if ($result === false) { - throw new Exception( - 'The locale functionality is not implemented on your platform, ' . - 'the specified locale does not exist or the category name is ' . - 'invalid.' - ); - } - } - - /** - * Makes configurable stub for the specified class. - * - * @psalm-template RealInstanceType of object - * - * @psalm-param class-string $originalClassName - * - * @psalm-return Stub&RealInstanceType - */ - protected function createStub(string $originalClassName): Stub - { - return $this->createMockObject($originalClassName); - } - - /** - * Returns a mock object for the specified class. - * - * @psalm-template RealInstanceType of object - * - * @psalm-param class-string $originalClassName - * - * @psalm-return MockObject&RealInstanceType - */ - protected function createMock(string $originalClassName): MockObject - { - return $this->createMockObject($originalClassName); - } - - /** - * Returns a configured mock object for the specified class. - * - * @psalm-template RealInstanceType of object - * - * @psalm-param class-string $originalClassName - * - * @psalm-return MockObject&RealInstanceType - */ - protected function createConfiguredMock(string $originalClassName, array $configuration): MockObject - { - $o = $this->createMockObject($originalClassName); - - foreach ($configuration as $method => $return) { - $o->method($method)->willReturn($return); - } - - return $o; - } - - /** - * Returns a partial mock object for the specified class. - * - * @param string[] $methods - * - * @psalm-template RealInstanceType of object - * - * @psalm-param class-string $originalClassName - * - * @psalm-return MockObject&RealInstanceType - */ - protected function createPartialMock(string $originalClassName, array $methods): MockObject - { - try { - $reflector = new ReflectionClass($originalClassName); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - $mockedMethodsThatDontExist = array_filter( - $methods, - static function (string $method) use ($reflector) - { - return !$reflector->hasMethod($method); - } - ); - - if ($mockedMethodsThatDontExist) { - $this->addWarning( - sprintf( - 'createPartialMock() called with method(s) %s that do not exist in %s. This will not be allowed in future versions of PHPUnit.', - implode(', ', $mockedMethodsThatDontExist), - $originalClassName - ) - ); - } - - return $this->getMockBuilder($originalClassName) - ->disableOriginalConstructor() - ->disableOriginalClone() - ->disableArgumentCloning() - ->disallowMockingUnknownTypes() - ->setMethods(empty($methods) ? null : $methods) - ->getMock(); - } - - /** - * Returns a test proxy for the specified class. - * - * @psalm-template RealInstanceType of object - * - * @psalm-param class-string $originalClassName - * - * @psalm-return MockObject&RealInstanceType - */ - protected function createTestProxy(string $originalClassName, array $constructorArguments = []): MockObject - { - return $this->getMockBuilder($originalClassName) - ->setConstructorArgs($constructorArguments) - ->enableProxyingToOriginalMethods() - ->getMock(); - } - - /** - * Mocks the specified class and returns the name of the mocked class. - * - * @param null|array $methods $methods - * - * @psalm-template RealInstanceType of object - * - * @psalm-param class-string|string $originalClassName - * - * @psalm-return class-string - */ - protected function getMockClass(string $originalClassName, $methods = [], array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = false, bool $callOriginalClone = true, bool $callAutoload = true, bool $cloneArguments = false): string - { - $this->recordDoubledType($originalClassName); - - $mock = $this->getMockObjectGenerator()->getMock( - $originalClassName, - $methods, - $arguments, - $mockClassName, - $callOriginalConstructor, - $callOriginalClone, - $callAutoload, - $cloneArguments - ); - - return get_class($mock); - } - - /** - * Returns a mock object for the specified abstract class with all abstract - * methods of the class mocked. Concrete methods are not mocked by default. - * To mock concrete methods, use the 7th parameter ($mockedMethods). - * - * @psalm-template RealInstanceType of object - * - * @psalm-param class-string $originalClassName - * - * @psalm-return MockObject&RealInstanceType - */ - protected function getMockForAbstractClass(string $originalClassName, array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, array $mockedMethods = [], bool $cloneArguments = false): MockObject - { - $this->recordDoubledType($originalClassName); - - $mockObject = $this->getMockObjectGenerator()->getMockForAbstractClass( - $originalClassName, - $arguments, - $mockClassName, - $callOriginalConstructor, - $callOriginalClone, - $callAutoload, - $mockedMethods, - $cloneArguments - ); - - $this->registerMockObject($mockObject); - - return $mockObject; - } - - /** - * Returns a mock object based on the given WSDL file. - * - * @psalm-template RealInstanceType of object - * - * @psalm-param class-string|string $originalClassName - * - * @psalm-return MockObject&RealInstanceType - */ - protected function getMockFromWsdl(string $wsdlFile, string $originalClassName = '', string $mockClassName = '', array $methods = [], bool $callOriginalConstructor = true, array $options = []): MockObject - { - $this->recordDoubledType(SoapClient::class); - - if ($originalClassName === '') { - $fileName = pathinfo(basename(parse_url($wsdlFile, PHP_URL_PATH)), PATHINFO_FILENAME); - $originalClassName = preg_replace('/\W/', '', $fileName); - } - - if (!class_exists($originalClassName)) { - eval( - $this->getMockObjectGenerator()->generateClassFromWsdl( - $wsdlFile, - $originalClassName, - $methods, - $options - ) - ); - } - - $mockObject = $this->getMockObjectGenerator()->getMock( - $originalClassName, - $methods, - ['', $options], - $mockClassName, - $callOriginalConstructor, - false, - false - ); - - $this->registerMockObject($mockObject); - - return $mockObject; - } - - /** - * Returns a mock object for the specified trait with all abstract methods - * of the trait mocked. Concrete methods to mock can be specified with the - * `$mockedMethods` parameter. - * - * @psalm-param trait-string $traitName - */ - protected function getMockForTrait(string $traitName, array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, array $mockedMethods = [], bool $cloneArguments = false): MockObject - { - $this->recordDoubledType($traitName); - - $mockObject = $this->getMockObjectGenerator()->getMockForTrait( - $traitName, - $arguments, - $mockClassName, - $callOriginalConstructor, - $callOriginalClone, - $callAutoload, - $mockedMethods, - $cloneArguments - ); - - $this->registerMockObject($mockObject); - - return $mockObject; - } - - /** - * Returns an object for the specified trait. - * - * @psalm-param trait-string $traitName - */ - protected function getObjectForTrait(string $traitName, array $arguments = [], string $traitClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true): object - { - $this->recordDoubledType($traitName); - - return $this->getMockObjectGenerator()->getObjectForTrait( - $traitName, - $traitClassName, - $callAutoload, - $callOriginalConstructor, - $arguments - ); - } - - /** - * @throws \Prophecy\Exception\Doubler\ClassNotFoundException - * @throws \Prophecy\Exception\Doubler\DoubleException - * @throws \Prophecy\Exception\Doubler\InterfaceNotFoundException - * - * @psalm-param class-string|null $classOrInterface - * - * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4141 - */ - protected function prophesize(?string $classOrInterface = null): ObjectProphecy - { - if (!class_exists(Prophet::class)) { - throw new Exception('This test uses TestCase::prophesize(), but phpspec/prophecy is not installed. Please run "composer require --dev phpspec/prophecy".'); - } - - $this->addWarning('PHPUnit\Framework\TestCase::prophesize() is deprecated and will be removed in PHPUnit 10. Please use the trait provided by phpspec/prophecy-phpunit.'); - - if (is_string($classOrInterface)) { - $this->recordDoubledType($classOrInterface); - } - - return $this->getProphet()->prophesize($classOrInterface); - } - - /** - * Creates a default TestResult object. - * - * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - protected function createResult(): TestResult - { - return new TestResult; - } - - /** - * This method is called when a test method did not execute successfully. - * - * @throws Throwable - */ - protected function onNotSuccessfulTest(Throwable $t): void - { - throw $t; - } - - protected function recordDoubledType(string $originalClassName): void - { - $this->doubledTypes[] = $originalClassName; - } - - /** - * @throws Throwable - */ - private function verifyMockObjects(): void - { - foreach ($this->mockObjects as $mockObject) { - if ($mockObject->__phpunit_hasMatchers()) { - $this->numAssertions++; - } - - $mockObject->__phpunit_verify( - $this->shouldInvocationMockerBeReset($mockObject) - ); - } - - if ($this->prophet !== null) { - try { - $this->prophet->checkPredictions(); - } finally { - foreach ($this->prophet->getProphecies() as $objectProphecy) { - foreach ($objectProphecy->getMethodProphecies() as $methodProphecies) { - foreach ($methodProphecies as $methodProphecy) { - /* @var MethodProphecy $methodProphecy */ - $this->numAssertions += count($methodProphecy->getCheckedPredictions()); - } - } - } - } - } - } - - /** - * @throws SkippedTestError - * @throws SyntheticSkippedError - * @throws Warning - */ - private function checkRequirements(): void - { - if (!$this->name || !method_exists($this, $this->name)) { - return; - } - - $missingRequirements = TestUtil::getMissingRequirements( - static::class, - $this->name - ); - - if (!empty($missingRequirements)) { - $this->markTestSkipped(implode(PHP_EOL, $missingRequirements)); - } - } - - private function handleDependencies(): bool - { - if ([] === $this->dependencies || $this->inIsolation) { - return true; - } - - $passed = $this->result->passed(); - $passedKeys = array_keys($passed); - $numKeys = count($passedKeys); - - for ($i = 0; $i < $numKeys; $i++) { - $pos = strpos($passedKeys[$i], ' with data set'); - - if ($pos !== false) { - $passedKeys[$i] = substr($passedKeys[$i], 0, $pos); - } - } - - $passedKeys = array_flip(array_unique($passedKeys)); - - foreach ($this->dependencies as $dependency) { - if (!$dependency->isValid()) { - $this->markSkippedForNotSpecifyingDependency(); - - return false; - } - - if ($dependency->targetIsClass()) { - $dependencyClassName = $dependency->getTargetClassName(); - - if (array_search($dependencyClassName, $this->result->passedClasses(), true) === false) { - $this->markSkippedForMissingDependency($dependency); - - return false; - } - - continue; - } - - $dependencyTarget = $dependency->getTarget(); - - if (!isset($passedKeys[$dependencyTarget])) { - if (!$this->isCallableTestMethod($dependencyTarget)) { - $this->markWarningForUncallableDependency($dependency); - } else { - $this->markSkippedForMissingDependency($dependency); - } - - return false; - } - - if (isset($passed[$dependencyTarget])) { - if ($passed[$dependencyTarget]['size'] != \PHPUnit\Util\Test::UNKNOWN && - $this->getSize() != \PHPUnit\Util\Test::UNKNOWN && - $passed[$dependencyTarget]['size'] > $this->getSize()) { - $this->result->addError( - $this, - new SkippedTestError( - 'This test depends on a test that is larger than itself.' - ), - 0 - ); - - return false; - } - - if ($dependency->useDeepClone()) { - $deepCopy = new DeepCopy; - $deepCopy->skipUncloneable(false); - - $this->dependencyInput[$dependencyTarget] = $deepCopy->copy($passed[$dependencyTarget]['result']); - } elseif ($dependency->useShallowClone()) { - $this->dependencyInput[$dependencyTarget] = clone $passed[$dependencyTarget]['result']; - } else { - $this->dependencyInput[$dependencyTarget] = $passed[$dependencyTarget]['result']; - } - } else { - $this->dependencyInput[$dependencyTarget] = null; - } - } - - return true; - } - - private function markSkippedForNotSpecifyingDependency(): void - { - $this->status = BaseTestRunner::STATUS_SKIPPED; - - $this->result->startTest($this); - - $this->result->addError( - $this, - new SkippedTestError( - 'This method has an invalid @depends annotation.' - ), - 0 - ); - - $this->result->endTest($this, 0); - } - - private function markSkippedForMissingDependency(ExecutionOrderDependency $dependency): void - { - $this->status = BaseTestRunner::STATUS_SKIPPED; - - $this->result->startTest($this); - - $this->result->addError( - $this, - new SkippedTestError( - sprintf( - 'This test depends on "%s" to pass.', - $dependency->getTarget() - ) - ), - 0 - ); - - $this->result->endTest($this, 0); - } - - private function markWarningForUncallableDependency(ExecutionOrderDependency $dependency): void - { - $this->status = BaseTestRunner::STATUS_WARNING; - - $this->result->startTest($this); - - $this->result->addWarning( - $this, - new Warning( - sprintf( - 'This test depends on "%s" which does not exist.', - $dependency->getTarget() - ) - ), - 0 - ); - - $this->result->endTest($this, 0); - } - - /** - * Get the mock object generator, creating it if it doesn't exist. - */ - private function getMockObjectGenerator(): MockGenerator - { - if ($this->mockObjectGenerator === null) { - $this->mockObjectGenerator = new MockGenerator; - } - - return $this->mockObjectGenerator; - } - - private function startOutputBuffering(): void - { - ob_start(); - - $this->outputBufferingActive = true; - $this->outputBufferingLevel = ob_get_level(); - } - - /** - * @throws RiskyTestError - */ - private function stopOutputBuffering(): void - { - if (ob_get_level() !== $this->outputBufferingLevel) { - while (ob_get_level() >= $this->outputBufferingLevel) { - ob_end_clean(); - } - - throw new RiskyTestError( - 'Test code or tested code did not (only) close its own output buffers' - ); - } - - $this->output = ob_get_contents(); - - if ($this->outputCallback !== false) { - $this->output = (string) call_user_func($this->outputCallback, $this->output); - } - - ob_end_clean(); - - $this->outputBufferingActive = false; - $this->outputBufferingLevel = ob_get_level(); - } - - private function snapshotGlobalState(): void - { - if ($this->runTestInSeparateProcess || $this->inIsolation || - (!$this->backupGlobals && !$this->backupStaticAttributes)) { - return; - } - - $this->snapshot = $this->createGlobalStateSnapshot($this->backupGlobals === true); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws RiskyTestError - */ - private function restoreGlobalState(): void - { - if (!$this->snapshot instanceof Snapshot) { - return; - } - - if ($this->beStrictAboutChangesToGlobalState) { - try { - $this->compareGlobalStateSnapshots( - $this->snapshot, - $this->createGlobalStateSnapshot($this->backupGlobals === true) - ); - } catch (RiskyTestError $rte) { - // Intentionally left empty - } - } - - $restorer = new Restorer; - - if ($this->backupGlobals) { - $restorer->restoreGlobalVariables($this->snapshot); - } - - if ($this->backupStaticAttributes) { - $restorer->restoreStaticAttributes($this->snapshot); - } - - $this->snapshot = null; - - if (isset($rte)) { - throw $rte; - } - } - - private function createGlobalStateSnapshot(bool $backupGlobals): Snapshot - { - $excludeList = new ExcludeList; - - foreach ($this->backupGlobalsExcludeList as $globalVariable) { - $excludeList->addGlobalVariable($globalVariable); - } - - if (!empty($this->backupGlobalsBlacklist)) { - $this->addWarning('PHPUnit\Framework\TestCase::$backupGlobalsBlacklist is deprecated and will be removed in PHPUnit 10. Please use PHPUnit\Framework\TestCase::$backupGlobalsExcludeList instead.'); - - foreach ($this->backupGlobalsBlacklist as $globalVariable) { - $excludeList->addGlobalVariable($globalVariable); - } - } - - if (!defined('PHPUNIT_TESTSUITE')) { - $excludeList->addClassNamePrefix('PHPUnit'); - $excludeList->addClassNamePrefix('SebastianBergmann\CodeCoverage'); - $excludeList->addClassNamePrefix('SebastianBergmann\FileIterator'); - $excludeList->addClassNamePrefix('SebastianBergmann\Invoker'); - $excludeList->addClassNamePrefix('SebastianBergmann\Template'); - $excludeList->addClassNamePrefix('SebastianBergmann\Timer'); - $excludeList->addClassNamePrefix('Doctrine\Instantiator'); - $excludeList->addClassNamePrefix('Prophecy'); - $excludeList->addStaticAttribute(ComparatorFactory::class, 'instance'); - - foreach ($this->backupStaticAttributesExcludeList as $class => $attributes) { - foreach ($attributes as $attribute) { - $excludeList->addStaticAttribute($class, $attribute); - } - } - - if (!empty($this->backupStaticAttributesBlacklist)) { - $this->addWarning('PHPUnit\Framework\TestCase::$backupStaticAttributesBlacklist is deprecated and will be removed in PHPUnit 10. Please use PHPUnit\Framework\TestCase::$backupStaticAttributesExcludeList instead.'); - - foreach ($this->backupStaticAttributesBlacklist as $class => $attributes) { - foreach ($attributes as $attribute) { - $excludeList->addStaticAttribute($class, $attribute); - } - } - } - } - - return new Snapshot( - $excludeList, - $backupGlobals, - (bool) $this->backupStaticAttributes, - false, - false, - false, - false, - false, - false, - false - ); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws RiskyTestError - */ - private function compareGlobalStateSnapshots(Snapshot $before, Snapshot $after): void - { - $backupGlobals = $this->backupGlobals === null || $this->backupGlobals; - - if ($backupGlobals) { - $this->compareGlobalStateSnapshotPart( - $before->globalVariables(), - $after->globalVariables(), - "--- Global variables before the test\n+++ Global variables after the test\n" - ); - - $this->compareGlobalStateSnapshotPart( - $before->superGlobalVariables(), - $after->superGlobalVariables(), - "--- Super-global variables before the test\n+++ Super-global variables after the test\n" - ); - } - - if ($this->backupStaticAttributes) { - $this->compareGlobalStateSnapshotPart( - $before->staticAttributes(), - $after->staticAttributes(), - "--- Static attributes before the test\n+++ Static attributes after the test\n" - ); - } - } - - /** - * @throws RiskyTestError - */ - private function compareGlobalStateSnapshotPart(array $before, array $after, string $header): void - { - if ($before != $after) { - $differ = new Differ($header); - $exporter = new Exporter; - - $diff = $differ->diff( - $exporter->export($before), - $exporter->export($after) - ); - - throw new RiskyTestError( - $diff - ); - } - } - - private function getProphet(): Prophet - { - if ($this->prophet === null) { - $this->prophet = new Prophet; - } - - return $this->prophet; - } - - /** - * @throws \SebastianBergmann\ObjectEnumerator\InvalidArgumentException - */ - private function shouldInvocationMockerBeReset(MockObject $mock): bool - { - $enumerator = new Enumerator; - - foreach ($enumerator->enumerate($this->dependencyInput) as $object) { - if ($mock === $object) { - return false; - } - } - - if (!is_array($this->testResult) && !is_object($this->testResult)) { - return true; - } - - return !in_array($mock, $enumerator->enumerate($this->testResult), true); - } - - /** - * @throws \SebastianBergmann\ObjectEnumerator\InvalidArgumentException - * @throws \SebastianBergmann\ObjectReflector\InvalidArgumentException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - private function registerMockObjectsFromTestArguments(array $testArguments, array &$visited = []): void - { - if ($this->registerMockObjectsFromTestArgumentsRecursively) { - foreach ((new Enumerator)->enumerate($testArguments) as $object) { - if ($object instanceof MockObject) { - $this->registerMockObject($object); - } - } - } else { - foreach ($testArguments as $testArgument) { - if ($testArgument instanceof MockObject) { - $testArgument = Cloner::clone($testArgument); - - $this->registerMockObject($testArgument); - } elseif (is_array($testArgument) && !in_array($testArgument, $visited, true)) { - $visited[] = $testArgument; - - $this->registerMockObjectsFromTestArguments( - $testArgument, - $visited - ); - } - } - } - } - - private function setDoesNotPerformAssertionsFromAnnotation(): void - { - $annotations = TestUtil::parseTestMethodAnnotations( - static::class, - $this->name - ); - - if (isset($annotations['method']['doesNotPerformAssertions'])) { - $this->doesNotPerformAssertions = true; - } - } - - private function unregisterCustomComparators(): void - { - $factory = ComparatorFactory::getInstance(); - - foreach ($this->customComparators as $comparator) { - $factory->unregister($comparator); - } - - $this->customComparators = []; - } - - private function cleanupIniSettings(): void - { - foreach ($this->iniSettings as $varName => $oldValue) { - ini_set($varName, $oldValue); - } - - $this->iniSettings = []; - } - - private function cleanupLocaleSettings(): void - { - foreach ($this->locale as $category => $locale) { - setlocale($category, $locale); - } - - $this->locale = []; - } - - /** - * @throws Exception - */ - private function checkExceptionExpectations(Throwable $throwable): bool - { - $result = false; - - if ($this->expectedException !== null || $this->expectedExceptionCode !== null || $this->expectedExceptionMessage !== null || $this->expectedExceptionMessageRegExp !== null) { - $result = true; - } - - if ($throwable instanceof Exception) { - $result = false; - } - - if (is_string($this->expectedException)) { - try { - $reflector = new ReflectionClass($this->expectedException); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if ($this->expectedException === 'PHPUnit\Framework\Exception' || - $this->expectedException === '\PHPUnit\Framework\Exception' || - $reflector->isSubclassOf(Exception::class)) { - $result = true; - } - } - - return $result; - } - - private function runInSeparateProcess(): bool - { - return ($this->runTestInSeparateProcess || $this->runClassInSeparateProcess) && - !$this->inIsolation && !$this instanceof PhptTestCase; - } - - private function isCallableTestMethod(string $dependency): bool - { - [$className, $methodName] = explode('::', $dependency); - - if (!class_exists($className)) { - return false; - } - - try { - $class = new ReflectionClass($className); - } catch (ReflectionException $e) { - return false; - } - - if (!$class->isSubclassOf(__CLASS__)) { - return false; - } - - if (!$class->hasMethod($methodName)) { - return false; - } - - try { - $method = $class->getMethod($methodName); - } catch (ReflectionException $e) { - return false; - } - - return TestUtil::isTestMethod($method); - } - - /** - * @psalm-template RealInstanceType of object - * - * @psalm-param class-string $originalClassName - * - * @psalm-return MockObject&RealInstanceType - */ - private function createMockObject(string $originalClassName): MockObject - { - return $this->getMockBuilder($originalClassName) - ->disableOriginalConstructor() - ->disableOriginalClone() - ->disableArgumentCloning() - ->disallowMockingUnknownTypes() - ->getMock(); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/TestFailure.php b/vendor/phpunit/phpunit/src/Framework/TestFailure.php deleted file mode 100644 index 0764bc78..00000000 --- a/vendor/phpunit/phpunit/src/Framework/TestFailure.php +++ /dev/null @@ -1,155 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -use function get_class; -use function sprintf; -use function trim; -use PHPUnit\Framework\Error\Error; -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TestFailure -{ - /** - * @var null|Test - */ - private $failedTest; - - /** - * @var Throwable - */ - private $thrownException; - - /** - * @var string - */ - private $testName; - - /** - * Returns a description for an exception. - */ - public static function exceptionToString(Throwable $e): string - { - if ($e instanceof SelfDescribing) { - $buffer = $e->toString(); - - if ($e instanceof ExpectationFailedException && $e->getComparisonFailure()) { - $buffer .= $e->getComparisonFailure()->getDiff(); - } - - if ($e instanceof PHPTAssertionFailedError) { - $buffer .= $e->getDiff(); - } - - if (!empty($buffer)) { - $buffer = trim($buffer) . "\n"; - } - - return $buffer; - } - - if ($e instanceof Error) { - return $e->getMessage() . "\n"; - } - - if ($e instanceof ExceptionWrapper) { - return $e->getClassName() . ': ' . $e->getMessage() . "\n"; - } - - return get_class($e) . ': ' . $e->getMessage() . "\n"; - } - - /** - * Constructs a TestFailure with the given test and exception. - */ - public function __construct(Test $failedTest, Throwable $t) - { - if ($failedTest instanceof SelfDescribing) { - $this->testName = $failedTest->toString(); - } else { - $this->testName = get_class($failedTest); - } - - if (!$failedTest instanceof TestCase || !$failedTest->isInIsolation()) { - $this->failedTest = $failedTest; - } - - $this->thrownException = $t; - } - - /** - * Returns a short description of the failure. - */ - public function toString(): string - { - return sprintf( - '%s: %s', - $this->testName, - $this->thrownException->getMessage() - ); - } - - /** - * Returns a description for the thrown exception. - */ - public function getExceptionAsString(): string - { - return self::exceptionToString($this->thrownException); - } - - /** - * Returns the name of the failing test (including data set, if any). - */ - public function getTestName(): string - { - return $this->testName; - } - - /** - * Returns the failing test. - * - * Note: The test object is not set when the test is executed in process - * isolation. - * - * @see Exception - */ - public function failedTest(): ?Test - { - return $this->failedTest; - } - - /** - * Gets the thrown exception. - */ - public function thrownException(): Throwable - { - return $this->thrownException; - } - - /** - * Returns the exception's message. - */ - public function exceptionMessage(): string - { - return $this->thrownException()->getMessage(); - } - - /** - * Returns true if the thrown exception - * is of type AssertionFailedError. - */ - public function isFailure(): bool - { - return $this->thrownException() instanceof AssertionFailedError; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/TestListener.php b/vendor/phpunit/phpunit/src/Framework/TestListener.php deleted file mode 100644 index eade600f..00000000 --- a/vendor/phpunit/phpunit/src/Framework/TestListener.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -use Throwable; - -/** - * This interface, as well as the associated mechanism for extending PHPUnit, - * will be removed in PHPUnit 10. There is no alternative available in this - * version of PHPUnit. - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @deprecated - * @see https://github.com/sebastianbergmann/phpunit/issues/4676 - */ -interface TestListener -{ - public function addError(Test $test, Throwable $t, float $time): void; - - public function addWarning(Test $test, Warning $e, float $time): void; - - public function addFailure(Test $test, AssertionFailedError $e, float $time): void; - - public function addIncompleteTest(Test $test, Throwable $t, float $time): void; - - public function addRiskyTest(Test $test, Throwable $t, float $time): void; - - public function addSkippedTest(Test $test, Throwable $t, float $time): void; - - public function startTestSuite(TestSuite $suite): void; - - public function endTestSuite(TestSuite $suite): void; - - public function startTest(Test $test): void; - - public function endTest(Test $test, float $time): void; -} diff --git a/vendor/phpunit/phpunit/src/Framework/TestListenerDefaultImplementation.php b/vendor/phpunit/phpunit/src/Framework/TestListenerDefaultImplementation.php deleted file mode 100644 index 5731d98d..00000000 --- a/vendor/phpunit/phpunit/src/Framework/TestListenerDefaultImplementation.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -use Throwable; - -/** - * @deprecated The `TestListener` interface is deprecated - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -trait TestListenerDefaultImplementation -{ - public function addError(Test $test, Throwable $t, float $time): void - { - } - - public function addWarning(Test $test, Warning $e, float $time): void - { - } - - public function addFailure(Test $test, AssertionFailedError $e, float $time): void - { - } - - public function addIncompleteTest(Test $test, Throwable $t, float $time): void - { - } - - public function addRiskyTest(Test $test, Throwable $t, float $time): void - { - } - - public function addSkippedTest(Test $test, Throwable $t, float $time): void - { - } - - public function startTestSuite(TestSuite $suite): void - { - } - - public function endTestSuite(TestSuite $suite): void - { - } - - public function startTest(Test $test): void - { - } - - public function endTest(Test $test, float $time): void - { - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/TestResult.php b/vendor/phpunit/phpunit/src/Framework/TestResult.php deleted file mode 100644 index 4fde29fa..00000000 --- a/vendor/phpunit/phpunit/src/Framework/TestResult.php +++ /dev/null @@ -1,1322 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -use const PHP_EOL; -use function class_exists; -use function count; -use function extension_loaded; -use function function_exists; -use function get_class; -use function sprintf; -use function xdebug_get_monitored_functions; -use function xdebug_is_debugger_active; -use function xdebug_start_function_monitor; -use function xdebug_stop_function_monitor; -use AssertionError; -use Countable; -use Error; -use PHPUnit\Util\ErrorHandler; -use PHPUnit\Util\ExcludeList; -use PHPUnit\Util\Printer; -use PHPUnit\Util\Test as TestUtil; -use ReflectionClass; -use ReflectionException; -use SebastianBergmann\CodeCoverage\CodeCoverage; -use SebastianBergmann\CodeCoverage\Exception as OriginalCodeCoverageException; -use SebastianBergmann\CodeCoverage\UnintentionallyCoveredCodeException; -use SebastianBergmann\Invoker\Invoker; -use SebastianBergmann\Invoker\TimeoutException; -use SebastianBergmann\ResourceOperations\ResourceOperations; -use SebastianBergmann\Timer\Timer; -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TestResult implements Countable -{ - /** - * @var array - */ - private $passed = []; - - /** - * @var array - */ - private $passedTestClasses = []; - - /** - * @var bool - */ - private $currentTestSuiteFailed = false; - - /** - * @var TestFailure[] - */ - private $errors = []; - - /** - * @var TestFailure[] - */ - private $failures = []; - - /** - * @var TestFailure[] - */ - private $warnings = []; - - /** - * @var TestFailure[] - */ - private $notImplemented = []; - - /** - * @var TestFailure[] - */ - private $risky = []; - - /** - * @var TestFailure[] - */ - private $skipped = []; - - /** - * @deprecated Use the `TestHook` interfaces instead - * - * @var TestListener[] - */ - private $listeners = []; - - /** - * @var int - */ - private $runTests = 0; - - /** - * @var float - */ - private $time = 0; - - /** - * Code Coverage information. - * - * @var CodeCoverage - */ - private $codeCoverage; - - /** - * @var bool - */ - private $convertDeprecationsToExceptions = false; - - /** - * @var bool - */ - private $convertErrorsToExceptions = true; - - /** - * @var bool - */ - private $convertNoticesToExceptions = true; - - /** - * @var bool - */ - private $convertWarningsToExceptions = true; - - /** - * @var bool - */ - private $stop = false; - - /** - * @var bool - */ - private $stopOnError = false; - - /** - * @var bool - */ - private $stopOnFailure = false; - - /** - * @var bool - */ - private $stopOnWarning = false; - - /** - * @var bool - */ - private $beStrictAboutTestsThatDoNotTestAnything = true; - - /** - * @var bool - */ - private $beStrictAboutOutputDuringTests = false; - - /** - * @var bool - */ - private $beStrictAboutTodoAnnotatedTests = false; - - /** - * @var bool - */ - private $beStrictAboutResourceUsageDuringSmallTests = false; - - /** - * @var bool - */ - private $enforceTimeLimit = false; - - /** - * @var bool - */ - private $forceCoversAnnotation = false; - - /** - * @var int - */ - private $timeoutForSmallTests = 1; - - /** - * @var int - */ - private $timeoutForMediumTests = 10; - - /** - * @var int - */ - private $timeoutForLargeTests = 60; - - /** - * @var bool - */ - private $stopOnRisky = false; - - /** - * @var bool - */ - private $stopOnIncomplete = false; - - /** - * @var bool - */ - private $stopOnSkipped = false; - - /** - * @var bool - */ - private $lastTestFailed = false; - - /** - * @var int - */ - private $defaultTimeLimit = 0; - - /** - * @var bool - */ - private $stopOnDefect = false; - - /** - * @var bool - */ - private $registerMockObjectsFromTestArgumentsRecursively = false; - - /** - * @deprecated Use the `TestHook` interfaces instead - * - * @codeCoverageIgnore - * - * Registers a TestListener. - */ - public function addListener(TestListener $listener): void - { - $this->listeners[] = $listener; - } - - /** - * @deprecated Use the `TestHook` interfaces instead - * - * @codeCoverageIgnore - * - * Unregisters a TestListener. - */ - public function removeListener(TestListener $listener): void - { - foreach ($this->listeners as $key => $_listener) { - if ($listener === $_listener) { - unset($this->listeners[$key]); - } - } - } - - /** - * @deprecated Use the `TestHook` interfaces instead - * - * @codeCoverageIgnore - * - * Flushes all flushable TestListeners. - */ - public function flushListeners(): void - { - foreach ($this->listeners as $listener) { - if ($listener instanceof Printer) { - $listener->flush(); - } - } - } - - /** - * Adds an error to the list of errors. - */ - public function addError(Test $test, Throwable $t, float $time): void - { - if ($t instanceof RiskyTestError) { - $this->recordRisky($test, $t); - - $notifyMethod = 'addRiskyTest'; - - if ($test instanceof TestCase) { - $test->markAsRisky(); - } - - if ($this->stopOnRisky || $this->stopOnDefect) { - $this->stop(); - } - } elseif ($t instanceof IncompleteTest) { - $this->recordNotImplemented($test, $t); - - $notifyMethod = 'addIncompleteTest'; - - if ($this->stopOnIncomplete) { - $this->stop(); - } - } elseif ($t instanceof SkippedTest) { - $this->recordSkipped($test, $t); - - $notifyMethod = 'addSkippedTest'; - - if ($this->stopOnSkipped) { - $this->stop(); - } - } else { - $this->recordError($test, $t); - - $notifyMethod = 'addError'; - - if ($this->stopOnError || $this->stopOnFailure) { - $this->stop(); - } - } - - // @see https://github.com/sebastianbergmann/phpunit/issues/1953 - if ($t instanceof Error) { - $t = new ExceptionWrapper($t); - } - - foreach ($this->listeners as $listener) { - $listener->{$notifyMethod}($test, $t, $time); - } - - $this->lastTestFailed = true; - $this->time += $time; - } - - /** - * Adds a warning to the list of warnings. - * The passed in exception caused the warning. - */ - public function addWarning(Test $test, Warning $e, float $time): void - { - if ($this->stopOnWarning || $this->stopOnDefect) { - $this->stop(); - } - - $this->recordWarning($test, $e); - - foreach ($this->listeners as $listener) { - $listener->addWarning($test, $e, $time); - } - - $this->time += $time; - } - - /** - * Adds a failure to the list of failures. - * The passed in exception caused the failure. - */ - public function addFailure(Test $test, AssertionFailedError $e, float $time): void - { - if ($e instanceof RiskyTestError || $e instanceof OutputError) { - $this->recordRisky($test, $e); - - $notifyMethod = 'addRiskyTest'; - - if ($test instanceof TestCase) { - $test->markAsRisky(); - } - - if ($this->stopOnRisky || $this->stopOnDefect) { - $this->stop(); - } - } elseif ($e instanceof IncompleteTest) { - $this->recordNotImplemented($test, $e); - - $notifyMethod = 'addIncompleteTest'; - - if ($this->stopOnIncomplete) { - $this->stop(); - } - } elseif ($e instanceof SkippedTest) { - $this->recordSkipped($test, $e); - - $notifyMethod = 'addSkippedTest'; - - if ($this->stopOnSkipped) { - $this->stop(); - } - } else { - $this->failures[] = new TestFailure($test, $e); - $notifyMethod = 'addFailure'; - - if ($this->stopOnFailure || $this->stopOnDefect) { - $this->stop(); - } - } - - foreach ($this->listeners as $listener) { - $listener->{$notifyMethod}($test, $e, $time); - } - - $this->lastTestFailed = true; - $this->time += $time; - } - - /** - * Informs the result that a test suite will be started. - */ - public function startTestSuite(TestSuite $suite): void - { - $this->currentTestSuiteFailed = false; - - foreach ($this->listeners as $listener) { - $listener->startTestSuite($suite); - } - } - - /** - * Informs the result that a test suite was completed. - */ - public function endTestSuite(TestSuite $suite): void - { - if (!$this->currentTestSuiteFailed) { - $this->passedTestClasses[] = $suite->getName(); - } - - foreach ($this->listeners as $listener) { - $listener->endTestSuite($suite); - } - } - - /** - * Informs the result that a test will be started. - */ - public function startTest(Test $test): void - { - $this->lastTestFailed = false; - $this->runTests += count($test); - - foreach ($this->listeners as $listener) { - $listener->startTest($test); - } - } - - /** - * Informs the result that a test was completed. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function endTest(Test $test, float $time): void - { - foreach ($this->listeners as $listener) { - $listener->endTest($test, $time); - } - - if (!$this->lastTestFailed && $test instanceof TestCase) { - $class = get_class($test); - $key = $class . '::' . $test->getName(); - - $this->passed[$key] = [ - 'result' => $test->getResult(), - 'size' => TestUtil::getSize( - $class, - $test->getName(false) - ), - ]; - - $this->time += $time; - } - - if ($this->lastTestFailed && $test instanceof TestCase) { - $this->currentTestSuiteFailed = true; - } - } - - /** - * Returns true if no risky test occurred. - */ - public function allHarmless(): bool - { - return $this->riskyCount() === 0; - } - - /** - * Gets the number of risky tests. - */ - public function riskyCount(): int - { - return count($this->risky); - } - - /** - * Returns true if no incomplete test occurred. - */ - public function allCompletelyImplemented(): bool - { - return $this->notImplementedCount() === 0; - } - - /** - * Gets the number of incomplete tests. - */ - public function notImplementedCount(): int - { - return count($this->notImplemented); - } - - /** - * Returns an array of TestFailure objects for the risky tests. - * - * @return TestFailure[] - */ - public function risky(): array - { - return $this->risky; - } - - /** - * Returns an array of TestFailure objects for the incomplete tests. - * - * @return TestFailure[] - */ - public function notImplemented(): array - { - return $this->notImplemented; - } - - /** - * Returns true if no test has been skipped. - */ - public function noneSkipped(): bool - { - return $this->skippedCount() === 0; - } - - /** - * Gets the number of skipped tests. - */ - public function skippedCount(): int - { - return count($this->skipped); - } - - /** - * Returns an array of TestFailure objects for the skipped tests. - * - * @return TestFailure[] - */ - public function skipped(): array - { - return $this->skipped; - } - - /** - * Gets the number of detected errors. - */ - public function errorCount(): int - { - return count($this->errors); - } - - /** - * Returns an array of TestFailure objects for the errors. - * - * @return TestFailure[] - */ - public function errors(): array - { - return $this->errors; - } - - /** - * Gets the number of detected failures. - */ - public function failureCount(): int - { - return count($this->failures); - } - - /** - * Returns an array of TestFailure objects for the failures. - * - * @return TestFailure[] - */ - public function failures(): array - { - return $this->failures; - } - - /** - * Gets the number of detected warnings. - */ - public function warningCount(): int - { - return count($this->warnings); - } - - /** - * Returns an array of TestFailure objects for the warnings. - * - * @return TestFailure[] - */ - public function warnings(): array - { - return $this->warnings; - } - - /** - * Returns the names of the tests that have passed. - */ - public function passed(): array - { - return $this->passed; - } - - /** - * Returns the names of the TestSuites that have passed. - * - * This enables @depends-annotations for TestClassName::class - */ - public function passedClasses(): array - { - return $this->passedTestClasses; - } - - /** - * Returns whether code coverage information should be collected. - */ - public function getCollectCodeCoverageInformation(): bool - { - return $this->codeCoverage !== null; - } - - /** - * Runs a TestCase. - * - * @throws \SebastianBergmann\CodeCoverage\InvalidArgumentException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws CodeCoverageException - * @throws UnintentionallyCoveredCodeException - */ - public function run(Test $test): void - { - Assert::resetCount(); - - $size = TestUtil::UNKNOWN; - - if ($test instanceof TestCase) { - $test->setRegisterMockObjectsFromTestArgumentsRecursively( - $this->registerMockObjectsFromTestArgumentsRecursively - ); - - $isAnyCoverageRequired = TestUtil::requiresCodeCoverageDataCollection($test); - $size = $test->getSize(); - } - - $error = false; - $failure = false; - $warning = false; - $incomplete = false; - $risky = false; - $skipped = false; - - $this->startTest($test); - - if ($this->convertDeprecationsToExceptions || $this->convertErrorsToExceptions || $this->convertNoticesToExceptions || $this->convertWarningsToExceptions) { - $errorHandler = new ErrorHandler( - $this->convertDeprecationsToExceptions, - $this->convertErrorsToExceptions, - $this->convertNoticesToExceptions, - $this->convertWarningsToExceptions - ); - - $errorHandler->register(); - } - - $collectCodeCoverage = $this->codeCoverage !== null && - !$test instanceof ErrorTestCase && - !$test instanceof WarningTestCase && - $isAnyCoverageRequired; - - if ($collectCodeCoverage) { - $this->codeCoverage->start($test); - } - - $monitorFunctions = $this->beStrictAboutResourceUsageDuringSmallTests && - !$test instanceof ErrorTestCase && - !$test instanceof WarningTestCase && - $size === TestUtil::SMALL && - function_exists('xdebug_start_function_monitor'); - - if ($monitorFunctions) { - /* @noinspection ForgottenDebugOutputInspection */ - xdebug_start_function_monitor(ResourceOperations::getFunctions()); - } - - $timer = new Timer; - $timer->start(); - - try { - $invoker = new Invoker; - - if (!$test instanceof ErrorTestCase && - !$test instanceof WarningTestCase && - $this->shouldTimeLimitBeEnforced($size) && - $invoker->canInvokeWithTimeout()) { - switch ($size) { - case TestUtil::SMALL: - $_timeout = $this->timeoutForSmallTests; - - break; - - case TestUtil::MEDIUM: - $_timeout = $this->timeoutForMediumTests; - - break; - - case TestUtil::LARGE: - $_timeout = $this->timeoutForLargeTests; - - break; - - default: - $_timeout = $this->defaultTimeLimit; - } - - $invoker->invoke([$test, 'runBare'], [], $_timeout); - } else { - $test->runBare(); - } - } catch (TimeoutException $e) { - $this->addFailure( - $test, - new RiskyTestError( - $e->getMessage() - ), - $_timeout - ); - - $risky = true; - } catch (AssertionFailedError $e) { - $failure = true; - - if ($e instanceof RiskyTestError) { - $risky = true; - } elseif ($e instanceof IncompleteTestError) { - $incomplete = true; - } elseif ($e instanceof SkippedTestError) { - $skipped = true; - } - } catch (AssertionError $e) { - $test->addToAssertionCount(1); - - $failure = true; - $frame = $e->getTrace()[0]; - - $e = new AssertionFailedError( - sprintf( - '%s in %s:%s', - $e->getMessage(), - $frame['file'] ?? $e->getFile(), - $frame['line'] ?? $e->getLine() - ), - 0, - $e - ); - } catch (Warning $e) { - $warning = true; - } catch (Exception $e) { - $error = true; - } catch (Throwable $e) { - $e = new ExceptionWrapper($e); - $error = true; - } - - $time = $timer->stop()->asSeconds(); - - $test->addToAssertionCount(Assert::getCount()); - - if ($monitorFunctions) { - $excludeList = new ExcludeList; - - /** @noinspection ForgottenDebugOutputInspection */ - $functions = xdebug_get_monitored_functions(); - - /* @noinspection ForgottenDebugOutputInspection */ - xdebug_stop_function_monitor(); - - foreach ($functions as $function) { - if (!$excludeList->isExcluded($function['filename'])) { - $this->addFailure( - $test, - new RiskyTestError( - sprintf( - '%s() used in %s:%s', - $function['function'], - $function['filename'], - $function['lineno'] - ) - ), - $time - ); - } - } - } - - if ($this->beStrictAboutTestsThatDoNotTestAnything && - $test->getNumAssertions() === 0) { - $risky = true; - } - - if ($this->forceCoversAnnotation && !$error && !$failure && !$warning && !$incomplete && !$skipped && !$risky) { - $annotations = TestUtil::parseTestMethodAnnotations( - get_class($test), - $test->getName(false) - ); - - if (!isset($annotations['class']['covers']) && - !isset($annotations['method']['covers']) && - !isset($annotations['class']['coversNothing']) && - !isset($annotations['method']['coversNothing'])) { - $this->addFailure( - $test, - new MissingCoversAnnotationException( - 'This test does not have a @covers annotation but is expected to have one' - ), - $time - ); - - $risky = true; - } - } - - if ($collectCodeCoverage) { - $append = !$risky && !$incomplete && !$skipped; - $linesToBeCovered = []; - $linesToBeUsed = []; - - if ($append && $test instanceof TestCase) { - try { - $linesToBeCovered = TestUtil::getLinesToBeCovered( - get_class($test), - $test->getName(false) - ); - - $linesToBeUsed = TestUtil::getLinesToBeUsed( - get_class($test), - $test->getName(false) - ); - } catch (InvalidCoversTargetException $cce) { - $this->addWarning( - $test, - new Warning( - $cce->getMessage() - ), - $time - ); - } - } - - try { - $this->codeCoverage->stop( - $append, - $linesToBeCovered, - $linesToBeUsed - ); - } catch (UnintentionallyCoveredCodeException $cce) { - $unintentionallyCoveredCodeError = new UnintentionallyCoveredCodeError( - 'This test executed code that is not listed as code to be covered or used:' . - PHP_EOL . $cce->getMessage() - ); - } catch (OriginalCodeCoverageException $cce) { - $error = true; - - $e = $e ?? $cce; - } - } - - if (isset($errorHandler)) { - $errorHandler->unregister(); - - unset($errorHandler); - } - - if ($error) { - $this->addError($test, $e, $time); - } elseif ($failure) { - $this->addFailure($test, $e, $time); - } elseif ($warning) { - $this->addWarning($test, $e, $time); - } elseif (isset($unintentionallyCoveredCodeError)) { - $this->addFailure( - $test, - $unintentionallyCoveredCodeError, - $time - ); - } elseif ($this->beStrictAboutTestsThatDoNotTestAnything && - !$test->doesNotPerformAssertions() && - $test->getNumAssertions() === 0) { - try { - $reflected = new ReflectionClass($test); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - $name = $test->getName(false); - - if ($name && $reflected->hasMethod($name)) { - try { - $reflected = $reflected->getMethod($name); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } - - $this->addFailure( - $test, - new RiskyTestError( - sprintf( - "This test did not perform any assertions\n\n%s:%d", - $reflected->getFileName(), - $reflected->getStartLine() - ) - ), - $time - ); - } elseif ($this->beStrictAboutTestsThatDoNotTestAnything && - $test->doesNotPerformAssertions() && - $test->getNumAssertions() > 0) { - $this->addFailure( - $test, - new RiskyTestError( - sprintf( - 'This test is annotated with "@doesNotPerformAssertions" but performed %d assertions', - $test->getNumAssertions() - ) - ), - $time - ); - } elseif ($this->beStrictAboutOutputDuringTests && $test->hasOutput()) { - $this->addFailure( - $test, - new OutputError( - sprintf( - 'This test printed output: %s', - $test->getActualOutput() - ) - ), - $time - ); - } elseif ($this->beStrictAboutTodoAnnotatedTests && $test instanceof TestCase) { - $annotations = TestUtil::parseTestMethodAnnotations( - get_class($test), - $test->getName(false) - ); - - if (isset($annotations['method']['todo'])) { - $this->addFailure( - $test, - new RiskyTestError( - 'Test method is annotated with @todo' - ), - $time - ); - } - } - - $this->endTest($test, $time); - } - - /** - * Gets the number of run tests. - */ - public function count(): int - { - return $this->runTests; - } - - /** - * Checks whether the test run should stop. - */ - public function shouldStop(): bool - { - return $this->stop; - } - - /** - * Marks that the test run should stop. - */ - public function stop(): void - { - $this->stop = true; - } - - /** - * Returns the code coverage object. - */ - public function getCodeCoverage(): ?CodeCoverage - { - return $this->codeCoverage; - } - - /** - * Sets the code coverage object. - */ - public function setCodeCoverage(CodeCoverage $codeCoverage): void - { - $this->codeCoverage = $codeCoverage; - } - - /** - * Enables or disables the deprecation-to-exception conversion. - */ - public function convertDeprecationsToExceptions(bool $flag): void - { - $this->convertDeprecationsToExceptions = $flag; - } - - /** - * Returns the deprecation-to-exception conversion setting. - */ - public function getConvertDeprecationsToExceptions(): bool - { - return $this->convertDeprecationsToExceptions; - } - - /** - * Enables or disables the error-to-exception conversion. - */ - public function convertErrorsToExceptions(bool $flag): void - { - $this->convertErrorsToExceptions = $flag; - } - - /** - * Returns the error-to-exception conversion setting. - */ - public function getConvertErrorsToExceptions(): bool - { - return $this->convertErrorsToExceptions; - } - - /** - * Enables or disables the notice-to-exception conversion. - */ - public function convertNoticesToExceptions(bool $flag): void - { - $this->convertNoticesToExceptions = $flag; - } - - /** - * Returns the notice-to-exception conversion setting. - */ - public function getConvertNoticesToExceptions(): bool - { - return $this->convertNoticesToExceptions; - } - - /** - * Enables or disables the warning-to-exception conversion. - */ - public function convertWarningsToExceptions(bool $flag): void - { - $this->convertWarningsToExceptions = $flag; - } - - /** - * Returns the warning-to-exception conversion setting. - */ - public function getConvertWarningsToExceptions(): bool - { - return $this->convertWarningsToExceptions; - } - - /** - * Enables or disables the stopping when an error occurs. - */ - public function stopOnError(bool $flag): void - { - $this->stopOnError = $flag; - } - - /** - * Enables or disables the stopping when a failure occurs. - */ - public function stopOnFailure(bool $flag): void - { - $this->stopOnFailure = $flag; - } - - /** - * Enables or disables the stopping when a warning occurs. - */ - public function stopOnWarning(bool $flag): void - { - $this->stopOnWarning = $flag; - } - - public function beStrictAboutTestsThatDoNotTestAnything(bool $flag): void - { - $this->beStrictAboutTestsThatDoNotTestAnything = $flag; - } - - public function isStrictAboutTestsThatDoNotTestAnything(): bool - { - return $this->beStrictAboutTestsThatDoNotTestAnything; - } - - public function beStrictAboutOutputDuringTests(bool $flag): void - { - $this->beStrictAboutOutputDuringTests = $flag; - } - - public function isStrictAboutOutputDuringTests(): bool - { - return $this->beStrictAboutOutputDuringTests; - } - - public function beStrictAboutResourceUsageDuringSmallTests(bool $flag): void - { - $this->beStrictAboutResourceUsageDuringSmallTests = $flag; - } - - public function isStrictAboutResourceUsageDuringSmallTests(): bool - { - return $this->beStrictAboutResourceUsageDuringSmallTests; - } - - public function enforceTimeLimit(bool $flag): void - { - $this->enforceTimeLimit = $flag; - } - - public function enforcesTimeLimit(): bool - { - return $this->enforceTimeLimit; - } - - public function beStrictAboutTodoAnnotatedTests(bool $flag): void - { - $this->beStrictAboutTodoAnnotatedTests = $flag; - } - - public function isStrictAboutTodoAnnotatedTests(): bool - { - return $this->beStrictAboutTodoAnnotatedTests; - } - - public function forceCoversAnnotation(): void - { - $this->forceCoversAnnotation = true; - } - - public function forcesCoversAnnotation(): bool - { - return $this->forceCoversAnnotation; - } - - /** - * Enables or disables the stopping for risky tests. - */ - public function stopOnRisky(bool $flag): void - { - $this->stopOnRisky = $flag; - } - - /** - * Enables or disables the stopping for incomplete tests. - */ - public function stopOnIncomplete(bool $flag): void - { - $this->stopOnIncomplete = $flag; - } - - /** - * Enables or disables the stopping for skipped tests. - */ - public function stopOnSkipped(bool $flag): void - { - $this->stopOnSkipped = $flag; - } - - /** - * Enables or disables the stopping for defects: error, failure, warning. - */ - public function stopOnDefect(bool $flag): void - { - $this->stopOnDefect = $flag; - } - - /** - * Returns the time spent running the tests. - */ - public function time(): float - { - return $this->time; - } - - /** - * Returns whether the entire test was successful or not. - */ - public function wasSuccessful(): bool - { - return $this->wasSuccessfulIgnoringWarnings() && empty($this->warnings); - } - - public function wasSuccessfulIgnoringWarnings(): bool - { - return empty($this->errors) && empty($this->failures); - } - - public function wasSuccessfulAndNoTestIsRiskyOrSkippedOrIncomplete(): bool - { - return $this->wasSuccessful() && $this->allHarmless() && $this->allCompletelyImplemented() && $this->noneSkipped(); - } - - /** - * Sets the default timeout for tests. - */ - public function setDefaultTimeLimit(int $timeout): void - { - $this->defaultTimeLimit = $timeout; - } - - /** - * Sets the timeout for small tests. - */ - public function setTimeoutForSmallTests(int $timeout): void - { - $this->timeoutForSmallTests = $timeout; - } - - /** - * Sets the timeout for medium tests. - */ - public function setTimeoutForMediumTests(int $timeout): void - { - $this->timeoutForMediumTests = $timeout; - } - - /** - * Sets the timeout for large tests. - */ - public function setTimeoutForLargeTests(int $timeout): void - { - $this->timeoutForLargeTests = $timeout; - } - - /** - * Returns the set timeout for large tests. - */ - public function getTimeoutForLargeTests(): int - { - return $this->timeoutForLargeTests; - } - - public function setRegisterMockObjectsFromTestArgumentsRecursively(bool $flag): void - { - $this->registerMockObjectsFromTestArgumentsRecursively = $flag; - } - - private function recordError(Test $test, Throwable $t): void - { - $this->errors[] = new TestFailure($test, $t); - } - - private function recordNotImplemented(Test $test, Throwable $t): void - { - $this->notImplemented[] = new TestFailure($test, $t); - } - - private function recordRisky(Test $test, Throwable $t): void - { - $this->risky[] = new TestFailure($test, $t); - } - - private function recordSkipped(Test $test, Throwable $t): void - { - $this->skipped[] = new TestFailure($test, $t); - } - - private function recordWarning(Test $test, Throwable $t): void - { - $this->warnings[] = new TestFailure($test, $t); - } - - private function shouldTimeLimitBeEnforced(int $size): bool - { - if (!$this->enforceTimeLimit) { - return false; - } - - if (!(($this->defaultTimeLimit || $size !== TestUtil::UNKNOWN))) { - return false; - } - - if (!extension_loaded('pcntl')) { - return false; - } - - if (!class_exists(Invoker::class)) { - return false; - } - - if (extension_loaded('xdebug') && xdebug_is_debugger_active()) { - return false; - } - - return true; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/TestSuite.php b/vendor/phpunit/phpunit/src/Framework/TestSuite.php deleted file mode 100644 index ce738533..00000000 --- a/vendor/phpunit/phpunit/src/Framework/TestSuite.php +++ /dev/null @@ -1,912 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -use const PHP_EOL; -use function array_keys; -use function array_map; -use function array_merge; -use function array_slice; -use function array_unique; -use function basename; -use function call_user_func; -use function class_exists; -use function count; -use function dirname; -use function get_declared_classes; -use function implode; -use function is_bool; -use function is_callable; -use function is_file; -use function is_object; -use function is_string; -use function method_exists; -use function preg_match; -use function preg_quote; -use function sprintf; -use function strpos; -use function substr; -use Iterator; -use IteratorAggregate; -use PHPUnit\Runner\BaseTestRunner; -use PHPUnit\Runner\Filter\Factory; -use PHPUnit\Runner\PhptTestCase; -use PHPUnit\Util\FileLoader; -use PHPUnit\Util\Reflection; -use PHPUnit\Util\Test as TestUtil; -use ReflectionClass; -use ReflectionException; -use ReflectionMethod; -use Throwable; - -/** - * @template-implements IteratorAggregate - * - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -class TestSuite implements IteratorAggregate, Reorderable, SelfDescribing, Test -{ - /** - * Enable or disable the backup and restoration of the $GLOBALS array. - * - * @var bool - */ - protected $backupGlobals; - - /** - * Enable or disable the backup and restoration of static attributes. - * - * @var bool - */ - protected $backupStaticAttributes; - - /** - * @var bool - */ - protected $runTestInSeparateProcess = false; - - /** - * The name of the test suite. - * - * @var string - */ - protected $name = ''; - - /** - * The test groups of the test suite. - * - * @psalm-var array> - */ - protected $groups = []; - - /** - * The tests in the test suite. - * - * @var Test[] - */ - protected $tests = []; - - /** - * The number of tests in the test suite. - * - * @var int - */ - protected $numTests = -1; - - /** - * @var bool - */ - protected $testCase = false; - - /** - * @var string[] - */ - protected $foundClasses = []; - - /** - * @var null|list - */ - protected $providedTests; - - /** - * @var null|list - */ - protected $requiredTests; - - /** - * @var bool - */ - private $beStrictAboutChangesToGlobalState; - - /** - * @var Factory - */ - private $iteratorFilter; - - /** - * @var int - */ - private $declaredClassesPointer; - - /** - * @psalm-var array - */ - private $warnings = []; - - /** - * Constructs a new TestSuite. - * - * - PHPUnit\Framework\TestSuite() constructs an empty TestSuite. - * - * - PHPUnit\Framework\TestSuite(ReflectionClass) constructs a - * TestSuite from the given class. - * - * - PHPUnit\Framework\TestSuite(ReflectionClass, String) - * constructs a TestSuite from the given class with the given - * name. - * - * - PHPUnit\Framework\TestSuite(String) either constructs a - * TestSuite from the given class (if the passed string is the - * name of an existing class) or constructs an empty TestSuite - * with the given name. - * - * @param ReflectionClass|string $theClass - * - * @throws Exception - */ - public function __construct($theClass = '', string $name = '') - { - if (!is_string($theClass) && !$theClass instanceof ReflectionClass) { - throw InvalidArgumentException::create( - 1, - 'ReflectionClass object or string' - ); - } - - $this->declaredClassesPointer = count(get_declared_classes()); - - if (!$theClass instanceof ReflectionClass) { - if (class_exists($theClass, true)) { - if ($name === '') { - $name = $theClass; - } - - try { - $theClass = new ReflectionClass($theClass); - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } else { - $this->setName($theClass); - - return; - } - } - - if (!$theClass->isSubclassOf(TestCase::class)) { - $this->setName((string) $theClass); - - return; - } - - if ($name !== '') { - $this->setName($name); - } else { - $this->setName($theClass->getName()); - } - - $constructor = $theClass->getConstructor(); - - if ($constructor !== null && - !$constructor->isPublic()) { - $this->addTest( - new WarningTestCase( - sprintf( - 'Class "%s" has no public constructor.', - $theClass->getName() - ) - ) - ); - - return; - } - - foreach ((new Reflection)->publicMethodsInTestClass($theClass) as $method) { - if (!TestUtil::isTestMethod($method)) { - continue; - } - - $this->addTestMethod($theClass, $method); - } - - if (empty($this->tests)) { - $this->addTest( - new WarningTestCase( - sprintf( - 'No tests found in class "%s".', - $theClass->getName() - ) - ) - ); - } - - $this->testCase = true; - } - - /** - * Returns a string representation of the test suite. - */ - public function toString(): string - { - return $this->getName(); - } - - /** - * Adds a test to the suite. - * - * @param array $groups - */ - public function addTest(Test $test, $groups = []): void - { - try { - $class = new ReflectionClass($test); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if (!$class->isAbstract()) { - $this->tests[] = $test; - $this->clearCaches(); - - if ($test instanceof self && empty($groups)) { - $groups = $test->getGroups(); - } - - if ($this->containsOnlyVirtualGroups($groups)) { - $groups[] = 'default'; - } - - foreach ($groups as $group) { - if (!isset($this->groups[$group])) { - $this->groups[$group] = [$test]; - } else { - $this->groups[$group][] = $test; - } - } - - if ($test instanceof TestCase) { - $test->setGroups($groups); - } - } - } - - /** - * Adds the tests from the given class to the suite. - * - * @psalm-param object|class-string $testClass - * - * @throws Exception - */ - public function addTestSuite($testClass): void - { - if (!(is_object($testClass) || (is_string($testClass) && class_exists($testClass)))) { - throw InvalidArgumentException::create( - 1, - 'class name or object' - ); - } - - if (!is_object($testClass)) { - try { - $testClass = new ReflectionClass($testClass); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } - - if ($testClass instanceof self) { - $this->addTest($testClass); - } elseif ($testClass instanceof ReflectionClass) { - $suiteMethod = false; - - if (!$testClass->isAbstract() && $testClass->hasMethod(BaseTestRunner::SUITE_METHODNAME)) { - try { - $method = $testClass->getMethod( - BaseTestRunner::SUITE_METHODNAME - ); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if ($method->isStatic()) { - $this->addTest( - $method->invoke(null, $testClass->getName()) - ); - - $suiteMethod = true; - } - } - - if (!$suiteMethod && !$testClass->isAbstract() && $testClass->isSubclassOf(TestCase::class)) { - $this->addTest(new self($testClass)); - } - } else { - throw new Exception; - } - } - - public function addWarning(string $warning): void - { - $this->warnings[] = $warning; - } - - /** - * Wraps both addTest() and addTestSuite - * as well as the separate import statements for the user's convenience. - * - * If the named file cannot be read or there are no new tests that can be - * added, a PHPUnit\Framework\WarningTestCase will be created instead, - * leaving the current test run untouched. - * - * @throws Exception - */ - public function addTestFile(string $filename): void - { - if (is_file($filename) && substr($filename, -5) === '.phpt') { - $this->addTest(new PhptTestCase($filename)); - - $this->declaredClassesPointer = count(get_declared_classes()); - - return; - } - - $numTests = count($this->tests); - - // The given file may contain further stub classes in addition to the - // test class itself. Figure out the actual test class. - $filename = FileLoader::checkAndLoad($filename); - $newClasses = array_slice(get_declared_classes(), $this->declaredClassesPointer); - - // The diff is empty in case a parent class (with test methods) is added - // AFTER a child class that inherited from it. To account for that case, - // accumulate all discovered classes, so the parent class may be found in - // a later invocation. - if (!empty($newClasses)) { - // On the assumption that test classes are defined first in files, - // process discovered classes in approximate LIFO order, so as to - // avoid unnecessary reflection. - $this->foundClasses = array_merge($newClasses, $this->foundClasses); - $this->declaredClassesPointer = count(get_declared_classes()); - } - - // The test class's name must match the filename, either in full, or as - // a PEAR/PSR-0 prefixed short name ('NameSpace_ShortName'), or as a - // PSR-1 local short name ('NameSpace\ShortName'). The comparison must be - // anchored to prevent false-positive matches (e.g., 'OtherShortName'). - $shortName = basename($filename, '.php'); - $shortNameRegEx = '/(?:^|_|\\\\)' . preg_quote($shortName, '/') . '$/'; - - foreach ($this->foundClasses as $i => $className) { - if (preg_match($shortNameRegEx, $className)) { - try { - $class = new ReflectionClass($className); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if ($class->getFileName() == $filename) { - $newClasses = [$className]; - unset($this->foundClasses[$i]); - - break; - } - } - } - - foreach ($newClasses as $className) { - try { - $class = new ReflectionClass($className); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if (dirname($class->getFileName()) === __DIR__) { - continue; - } - - if (!$class->isAbstract()) { - if ($class->hasMethod(BaseTestRunner::SUITE_METHODNAME)) { - try { - $method = $class->getMethod( - BaseTestRunner::SUITE_METHODNAME - ); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if ($method->isStatic()) { - $this->addTest($method->invoke(null, $className)); - } - } elseif ($class->implementsInterface(Test::class)) { - // Do we have modern namespacing ('Foo\Bar\WhizBangTest') or old-school namespacing ('Foo_Bar_WhizBangTest')? - $isPsr0 = (!$class->inNamespace()) && (strpos($class->getName(), '_') !== false); - $expectedClassName = $isPsr0 ? $className : $shortName; - - if (($pos = strpos($expectedClassName, '.')) !== false) { - $expectedClassName = substr( - $expectedClassName, - 0, - $pos - ); - } - - if ($class->getShortName() !== $expectedClassName) { - $this->addWarning( - sprintf( - "Test case class not matching filename is deprecated\n in %s\n Class name was '%s', expected '%s'", - $filename, - $class->getShortName(), - $expectedClassName - ) - ); - } - - $this->addTestSuite($class); - } - } - } - - if (count($this->tests) > ++$numTests) { - $this->addWarning( - sprintf( - "Multiple test case classes per file is deprecated\n in %s", - $filename - ) - ); - } - - $this->numTests = -1; - } - - /** - * Wrapper for addTestFile() that adds multiple test files. - * - * @throws Exception - */ - public function addTestFiles(iterable $fileNames): void - { - foreach ($fileNames as $filename) { - $this->addTestFile((string) $filename); - } - } - - /** - * Counts the number of test cases that will be run by this test. - * - * @todo refactor usage of numTests in DefaultResultPrinter - */ - public function count(): int - { - $this->numTests = 0; - - foreach ($this as $test) { - $this->numTests += count($test); - } - - return $this->numTests; - } - - /** - * Returns the name of the suite. - */ - public function getName(): string - { - return $this->name; - } - - /** - * Returns the test groups of the suite. - * - * @psalm-return list - */ - public function getGroups(): array - { - return array_map( - static function ($key): string - { - return (string) $key; - }, - array_keys($this->groups) - ); - } - - public function getGroupDetails(): array - { - return $this->groups; - } - - /** - * Set tests groups of the test case. - */ - public function setGroupDetails(array $groups): void - { - $this->groups = $groups; - } - - /** - * Runs the tests and collects their result in a TestResult. - * - * @throws \PHPUnit\Framework\CodeCoverageException - * @throws \SebastianBergmann\CodeCoverage\InvalidArgumentException - * @throws \SebastianBergmann\CodeCoverage\UnintentionallyCoveredCodeException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Warning - */ - public function run(TestResult $result = null): TestResult - { - if ($result === null) { - $result = $this->createResult(); - } - - if (count($this) === 0) { - return $result; - } - - /** @psalm-var class-string $className */ - $className = $this->name; - $hookMethods = TestUtil::getHookMethods($className); - - $result->startTestSuite($this); - - $test = null; - - if ($this->testCase && class_exists($this->name, false)) { - try { - foreach ($hookMethods['beforeClass'] as $beforeClassMethod) { - if (method_exists($this->name, $beforeClassMethod)) { - if ($missingRequirements = TestUtil::getMissingRequirements($this->name, $beforeClassMethod)) { - $this->markTestSuiteSkipped(implode(PHP_EOL, $missingRequirements)); - } - - call_user_func([$this->name, $beforeClassMethod]); - } - } - } catch (SkippedTestSuiteError $error) { - foreach ($this->tests() as $test) { - $result->startTest($test); - $result->addFailure($test, $error, 0); - $result->endTest($test, 0); - } - - $result->endTestSuite($this); - - return $result; - } catch (Throwable $t) { - $errorAdded = false; - - foreach ($this->tests() as $test) { - if ($result->shouldStop()) { - break; - } - - $result->startTest($test); - - if (!$errorAdded) { - $result->addError($test, $t, 0); - - $errorAdded = true; - } else { - $result->addFailure( - $test, - new SkippedTestError('Test skipped because of an error in hook method'), - 0 - ); - } - - $result->endTest($test, 0); - } - - $result->endTestSuite($this); - - return $result; - } - } - - foreach ($this as $test) { - if ($result->shouldStop()) { - break; - } - - if ($test instanceof TestCase || $test instanceof self) { - $test->setBeStrictAboutChangesToGlobalState($this->beStrictAboutChangesToGlobalState); - $test->setBackupGlobals($this->backupGlobals); - $test->setBackupStaticAttributes($this->backupStaticAttributes); - $test->setRunTestInSeparateProcess($this->runTestInSeparateProcess); - } - - $test->run($result); - } - - if ($this->testCase && class_exists($this->name, false)) { - foreach ($hookMethods['afterClass'] as $afterClassMethod) { - if (method_exists($this->name, $afterClassMethod)) { - try { - call_user_func([$this->name, $afterClassMethod]); - } catch (Throwable $t) { - $message = "Exception in {$this->name}::{$afterClassMethod}" . PHP_EOL . $t->getMessage(); - $error = new SyntheticError($message, 0, $t->getFile(), $t->getLine(), $t->getTrace()); - - $placeholderTest = clone $test; - $placeholderTest->setName($afterClassMethod); - - $result->startTest($placeholderTest); - $result->addFailure($placeholderTest, $error, 0); - $result->endTest($placeholderTest, 0); - } - } - } - } - - $result->endTestSuite($this); - - return $result; - } - - public function setRunTestInSeparateProcess(bool $runTestInSeparateProcess): void - { - $this->runTestInSeparateProcess = $runTestInSeparateProcess; - } - - public function setName(string $name): void - { - $this->name = $name; - } - - /** - * Returns the tests as an enumeration. - * - * @return Test[] - */ - public function tests(): array - { - return $this->tests; - } - - /** - * Set tests of the test suite. - * - * @param Test[] $tests - */ - public function setTests(array $tests): void - { - $this->tests = $tests; - } - - /** - * Mark the test suite as skipped. - * - * @param string $message - * - * @throws SkippedTestSuiteError - * - * @psalm-return never-return - */ - public function markTestSuiteSkipped($message = ''): void - { - throw new SkippedTestSuiteError($message); - } - - /** - * @param bool $beStrictAboutChangesToGlobalState - */ - public function setBeStrictAboutChangesToGlobalState($beStrictAboutChangesToGlobalState): void - { - if (null === $this->beStrictAboutChangesToGlobalState && is_bool($beStrictAboutChangesToGlobalState)) { - $this->beStrictAboutChangesToGlobalState = $beStrictAboutChangesToGlobalState; - } - } - - /** - * @param bool $backupGlobals - */ - public function setBackupGlobals($backupGlobals): void - { - if (null === $this->backupGlobals && is_bool($backupGlobals)) { - $this->backupGlobals = $backupGlobals; - } - } - - /** - * @param bool $backupStaticAttributes - */ - public function setBackupStaticAttributes($backupStaticAttributes): void - { - if (null === $this->backupStaticAttributes && is_bool($backupStaticAttributes)) { - $this->backupStaticAttributes = $backupStaticAttributes; - } - } - - /** - * Returns an iterator for this test suite. - */ - public function getIterator(): Iterator - { - $iterator = new TestSuiteIterator($this); - - if ($this->iteratorFilter !== null) { - $iterator = $this->iteratorFilter->factory($iterator, $this); - } - - return $iterator; - } - - public function injectFilter(Factory $filter): void - { - $this->iteratorFilter = $filter; - - foreach ($this as $test) { - if ($test instanceof self) { - $test->injectFilter($filter); - } - } - } - - /** - * @psalm-return array - */ - public function warnings(): array - { - return array_unique($this->warnings); - } - - /** - * @return list - */ - public function provides(): array - { - if ($this->providedTests === null) { - $this->providedTests = []; - - if (is_callable($this->sortId(), true)) { - $this->providedTests[] = new ExecutionOrderDependency($this->sortId()); - } - - foreach ($this->tests as $test) { - if (!($test instanceof Reorderable)) { - // @codeCoverageIgnoreStart - continue; - // @codeCoverageIgnoreEnd - } - $this->providedTests = ExecutionOrderDependency::mergeUnique($this->providedTests, $test->provides()); - } - } - - return $this->providedTests; - } - - /** - * @return list - */ - public function requires(): array - { - if ($this->requiredTests === null) { - $this->requiredTests = []; - - foreach ($this->tests as $test) { - if (!($test instanceof Reorderable)) { - // @codeCoverageIgnoreStart - continue; - // @codeCoverageIgnoreEnd - } - $this->requiredTests = ExecutionOrderDependency::mergeUnique( - ExecutionOrderDependency::filterInvalid($this->requiredTests), - $test->requires() - ); - } - - $this->requiredTests = ExecutionOrderDependency::diff($this->requiredTests, $this->provides()); - } - - return $this->requiredTests; - } - - public function sortId(): string - { - return $this->getName() . '::class'; - } - - /** - * Creates a default TestResult object. - */ - protected function createResult(): TestResult - { - return new TestResult; - } - - /** - * @throws Exception - */ - protected function addTestMethod(ReflectionClass $class, ReflectionMethod $method): void - { - $methodName = $method->getName(); - - $test = (new TestBuilder)->build($class, $methodName); - - if ($test instanceof TestCase || $test instanceof DataProviderTestSuite) { - $test->setDependencies( - TestUtil::getDependencies($class->getName(), $methodName) - ); - } - - $this->addTest( - $test, - TestUtil::getGroups($class->getName(), $methodName) - ); - } - - private function clearCaches(): void - { - $this->numTests = -1; - $this->providedTests = null; - $this->requiredTests = null; - } - - private function containsOnlyVirtualGroups(array $groups): bool - { - foreach ($groups as $group) { - if (strpos($group, '__phpunit_') !== 0) { - return false; - } - } - - return true; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/TestSuiteIterator.php b/vendor/phpunit/phpunit/src/Framework/TestSuiteIterator.php deleted file mode 100644 index 76b12fcf..00000000 --- a/vendor/phpunit/phpunit/src/Framework/TestSuiteIterator.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -use function assert; -use function count; -use RecursiveIterator; - -/** - * @template-implements RecursiveIterator - * - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TestSuiteIterator implements RecursiveIterator -{ - /** - * @var int - */ - private $position = 0; - - /** - * @var Test[] - */ - private $tests; - - public function __construct(TestSuite $testSuite) - { - $this->tests = $testSuite->tests(); - } - - public function rewind(): void - { - $this->position = 0; - } - - public function valid(): bool - { - return $this->position < count($this->tests); - } - - public function key(): int - { - return $this->position; - } - - public function current(): Test - { - return $this->tests[$this->position]; - } - - public function next(): void - { - $this->position++; - } - - /** - * @throws NoChildTestSuiteException - */ - public function getChildren(): self - { - if (!$this->hasChildren()) { - throw new NoChildTestSuiteException( - 'The current item is not a TestSuite instance and therefore does not have any children.' - ); - } - - $current = $this->current(); - - assert($current instanceof TestSuite); - - return new self($current); - } - - public function hasChildren(): bool - { - return $this->valid() && $this->current() instanceof TestSuite; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/WarningTestCase.php b/vendor/phpunit/phpunit/src/Framework/WarningTestCase.php deleted file mode 100644 index e1e41bc4..00000000 --- a/vendor/phpunit/phpunit/src/Framework/WarningTestCase.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 PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class WarningTestCase extends TestCase -{ - /** - * @var bool - */ - protected $backupGlobals = false; - - /** - * @var bool - */ - protected $backupStaticAttributes = false; - - /** - * @var bool - */ - protected $runTestInSeparateProcess = false; - - /** - * @var string - */ - private $message; - - public function __construct(string $message = '') - { - $this->message = $message; - - parent::__construct('Warning'); - } - - public function getMessage(): string - { - return $this->message; - } - - /** - * Returns a string representation of the test case. - */ - public function toString(): string - { - return 'Warning'; - } - - /** - * @throws Exception - * - * @psalm-return never-return - */ - protected function runTest(): void - { - throw new Warning($this->message); - } -} diff --git a/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php b/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php deleted file mode 100644 index 75a70ca5..00000000 --- a/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php +++ /dev/null @@ -1,161 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -use function is_dir; -use function is_file; -use function substr; -use PHPUnit\Framework\Exception; -use PHPUnit\Framework\TestSuite; -use ReflectionClass; -use ReflectionException; -use SebastianBergmann\FileIterator\Facade as FileIteratorFacade; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -abstract class BaseTestRunner -{ - /** - * @var int - */ - public const STATUS_UNKNOWN = -1; - - /** - * @var int - */ - public const STATUS_PASSED = 0; - - /** - * @var int - */ - public const STATUS_SKIPPED = 1; - - /** - * @var int - */ - public const STATUS_INCOMPLETE = 2; - - /** - * @var int - */ - public const STATUS_FAILURE = 3; - - /** - * @var int - */ - public const STATUS_ERROR = 4; - - /** - * @var int - */ - public const STATUS_RISKY = 5; - - /** - * @var int - */ - public const STATUS_WARNING = 6; - - /** - * @var string - */ - public const SUITE_METHODNAME = 'suite'; - - /** - * Returns the loader to be used. - */ - public function getLoader(): TestSuiteLoader - { - return new StandardTestSuiteLoader; - } - - /** - * Returns the Test corresponding to the given suite. - * This is a template method, subclasses override - * the runFailed() and clearStatus() methods. - * - * @param string|string[] $suffixes - * - * @throws Exception - */ - public function getTest(string $suiteClassFile, $suffixes = ''): ?TestSuite - { - if (is_dir($suiteClassFile)) { - /** @var string[] $files */ - $files = (new FileIteratorFacade)->getFilesAsArray( - $suiteClassFile, - $suffixes - ); - - $suite = new TestSuite($suiteClassFile); - $suite->addTestFiles($files); - - return $suite; - } - - if (is_file($suiteClassFile) && substr($suiteClassFile, -5, 5) === '.phpt') { - $suite = new TestSuite; - $suite->addTestFile($suiteClassFile); - - return $suite; - } - - try { - $testClass = $this->loadSuiteClass( - $suiteClassFile - ); - } catch (\PHPUnit\Exception $e) { - $this->runFailed($e->getMessage()); - - return null; - } - - try { - $suiteMethod = $testClass->getMethod(self::SUITE_METHODNAME); - - if (!$suiteMethod->isStatic()) { - $this->runFailed( - 'suite() method must be static.' - ); - - return null; - } - - $test = $suiteMethod->invoke(null, $testClass->getName()); - } catch (ReflectionException $e) { - $test = new TestSuite($testClass); - } - - $this->clearStatus(); - - return $test; - } - - /** - * Returns the loaded ReflectionClass for a suite name. - */ - protected function loadSuiteClass(string $suiteClassFile): ReflectionClass - { - return $this->getLoader()->load($suiteClassFile); - } - - /** - * Clears the status message. - */ - protected function clearStatus(): void - { - } - - /** - * Override to define how to handle a failed loading of - * a test suite. - */ - abstract protected function runFailed(string $message): void; -} diff --git a/vendor/phpunit/phpunit/src/Runner/DefaultTestResultCache.php b/vendor/phpunit/phpunit/src/Runner/DefaultTestResultCache.php deleted file mode 100644 index cc22b250..00000000 --- a/vendor/phpunit/phpunit/src/Runner/DefaultTestResultCache.php +++ /dev/null @@ -1,158 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -use const DIRECTORY_SEPARATOR; -use const LOCK_EX; -use function assert; -use function dirname; -use function file_get_contents; -use function file_put_contents; -use function in_array; -use function is_array; -use function is_dir; -use function is_file; -use function json_decode; -use function json_encode; -use function sprintf; -use PHPUnit\Util\Filesystem; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class DefaultTestResultCache implements TestResultCache -{ - /** - * @var int - */ - private const VERSION = 1; - - /** - * @psalm-var list - */ - private const ALLOWED_TEST_STATUSES = [ - BaseTestRunner::STATUS_SKIPPED, - BaseTestRunner::STATUS_INCOMPLETE, - BaseTestRunner::STATUS_FAILURE, - BaseTestRunner::STATUS_ERROR, - BaseTestRunner::STATUS_RISKY, - BaseTestRunner::STATUS_WARNING, - ]; - - /** - * @var string - */ - private const DEFAULT_RESULT_CACHE_FILENAME = '.phpunit.result.cache'; - - /** - * @var string - */ - private $cacheFilename; - - /** - * @psalm-var array - */ - private $defects = []; - - /** - * @psalm-var array - */ - private $times = []; - - public function __construct(?string $filepath = null) - { - if ($filepath !== null && is_dir($filepath)) { - $filepath .= DIRECTORY_SEPARATOR . self::DEFAULT_RESULT_CACHE_FILENAME; - } - - $this->cacheFilename = $filepath ?? $_ENV['PHPUNIT_RESULT_CACHE'] ?? self::DEFAULT_RESULT_CACHE_FILENAME; - } - - public function setState(string $testName, int $state): void - { - if (!in_array($state, self::ALLOWED_TEST_STATUSES, true)) { - return; - } - - $this->defects[$testName] = $state; - } - - public function getState(string $testName): int - { - return $this->defects[$testName] ?? BaseTestRunner::STATUS_UNKNOWN; - } - - public function setTime(string $testName, float $time): void - { - $this->times[$testName] = $time; - } - - public function getTime(string $testName): float - { - return $this->times[$testName] ?? 0.0; - } - - public function load(): void - { - if (!is_file($this->cacheFilename)) { - return; - } - - $data = json_decode( - file_get_contents($this->cacheFilename), - true - ); - - if ($data === null) { - return; - } - - if (!isset($data['version'])) { - return; - } - - if ($data['version'] !== self::VERSION) { - return; - } - - assert(isset($data['defects']) && is_array($data['defects'])); - assert(isset($data['times']) && is_array($data['times'])); - - $this->defects = $data['defects']; - $this->times = $data['times']; - } - - /** - * @throws Exception - */ - public function persist(): void - { - if (!Filesystem::createDirectory(dirname($this->cacheFilename))) { - throw new Exception( - sprintf( - 'Cannot create directory "%s" for result cache file', - $this->cacheFilename - ) - ); - } - - file_put_contents( - $this->cacheFilename, - json_encode( - [ - 'version' => self::VERSION, - 'defects' => $this->defects, - 'times' => $this->times, - ] - ), - LOCK_EX - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Runner/Exception.php b/vendor/phpunit/phpunit/src/Runner/Exception.php deleted file mode 100644 index adcd1155..00000000 --- a/vendor/phpunit/phpunit/src/Runner/Exception.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -use RuntimeException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Exception extends RuntimeException implements \PHPUnit\Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/Runner/Extension/ExtensionHandler.php b/vendor/phpunit/phpunit/src/Runner/Extension/ExtensionHandler.php deleted file mode 100644 index 88f7ccad..00000000 --- a/vendor/phpunit/phpunit/src/Runner/Extension/ExtensionHandler.php +++ /dev/null @@ -1,118 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner\Extension; - -use function class_exists; -use function sprintf; -use PHPUnit\Framework\TestListener; -use PHPUnit\Runner\Exception; -use PHPUnit\Runner\Hook; -use PHPUnit\TextUI\TestRunner; -use PHPUnit\TextUI\XmlConfiguration\Extension; -use ReflectionClass; -use ReflectionException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ExtensionHandler -{ - /** - * @throws Exception - */ - public function registerExtension(Extension $extensionConfiguration, TestRunner $runner): void - { - $extension = $this->createInstance($extensionConfiguration); - - if (!$extension instanceof Hook) { - throw new Exception( - sprintf( - 'Class "%s" does not implement a PHPUnit\Runner\Hook interface', - $extensionConfiguration->className() - ) - ); - } - - $runner->addExtension($extension); - } - - /** - * @throws Exception - * - * @deprecated - */ - public function createTestListenerInstance(Extension $listenerConfiguration): TestListener - { - $listener = $this->createInstance($listenerConfiguration); - - if (!$listener instanceof TestListener) { - throw new Exception( - sprintf( - 'Class "%s" does not implement the PHPUnit\Framework\TestListener interface', - $listenerConfiguration->className() - ) - ); - } - - return $listener; - } - - /** - * @throws Exception - */ - private function createInstance(Extension $extensionConfiguration): object - { - $this->ensureClassExists($extensionConfiguration); - - try { - $reflector = new ReflectionClass($extensionConfiguration->className()); - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - $e->getCode(), - $e - ); - } - - if (!$extensionConfiguration->hasArguments()) { - return $reflector->newInstance(); - } - - return $reflector->newInstanceArgs($extensionConfiguration->arguments()); - } - - /** - * @throws Exception - */ - private function ensureClassExists(Extension $extensionConfiguration): void - { - if (class_exists($extensionConfiguration->className(), false)) { - return; - } - - if ($extensionConfiguration->hasSourceFile()) { - /** - * @noinspection PhpIncludeInspection - * - * @psalm-suppress UnresolvableInclude - */ - require_once $extensionConfiguration->sourceFile(); - } - - if (!class_exists($extensionConfiguration->className())) { - throw new Exception( - sprintf( - 'Class "%s" does not exist', - $extensionConfiguration->className() - ) - ); - } - } -} diff --git a/vendor/phpunit/phpunit/src/Runner/Extension/PharLoader.php b/vendor/phpunit/phpunit/src/Runner/Extension/PharLoader.php deleted file mode 100644 index e76e12ce..00000000 --- a/vendor/phpunit/phpunit/src/Runner/Extension/PharLoader.php +++ /dev/null @@ -1,77 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner\Extension; - -use function is_file; -use PharIo\Manifest\ApplicationName; -use PharIo\Manifest\Exception as ManifestException; -use PharIo\Manifest\ManifestLoader; -use PharIo\Version\Version as PharIoVersion; -use PHPUnit\Runner\Version; -use SebastianBergmann\FileIterator\Facade as FileIteratorFacade; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class PharLoader -{ - /** - * @psalm-return array{loadedExtensions: list, notLoadedExtensions: list} - */ - public function loadPharExtensionsInDirectory(string $directory): array - { - $loadedExtensions = []; - $notLoadedExtensions = []; - - foreach ((new FileIteratorFacade)->getFilesAsArray($directory, '.phar') as $file) { - if (!is_file('phar://' . $file . '/manifest.xml')) { - $notLoadedExtensions[] = $file . ' is not an extension for PHPUnit'; - - continue; - } - - try { - $applicationName = new ApplicationName('phpunit/phpunit'); - $version = new PharIoVersion(Version::series()); - $manifest = ManifestLoader::fromFile('phar://' . $file . '/manifest.xml'); - - if (!$manifest->isExtensionFor($applicationName)) { - $notLoadedExtensions[] = $file . ' is not an extension for PHPUnit'; - - continue; - } - - if (!$manifest->isExtensionFor($applicationName, $version)) { - $notLoadedExtensions[] = $file . ' is not compatible with this version of PHPUnit'; - - continue; - } - } catch (ManifestException $e) { - $notLoadedExtensions[] = $file . ': ' . $e->getMessage(); - - continue; - } - - /** - * @noinspection PhpIncludeInspection - * - * @psalm-suppress UnresolvableInclude - */ - require $file; - - $loadedExtensions[] = $manifest->getName()->asString() . ' ' . $manifest->getVersion()->getVersionString(); - } - - return [ - 'loadedExtensions' => $loadedExtensions, - 'notLoadedExtensions' => $notLoadedExtensions, - ]; - } -} diff --git a/vendor/phpunit/phpunit/src/Runner/Filter/ExcludeGroupFilterIterator.php b/vendor/phpunit/phpunit/src/Runner/Filter/ExcludeGroupFilterIterator.php deleted file mode 100644 index 4b26e571..00000000 --- a/vendor/phpunit/phpunit/src/Runner/Filter/ExcludeGroupFilterIterator.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 PHPUnit\Runner\Filter; - -use function in_array; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ExcludeGroupFilterIterator extends GroupFilterIterator -{ - protected function doAccept(string $hash): bool - { - return !in_array($hash, $this->groupTests, true); - } -} diff --git a/vendor/phpunit/phpunit/src/Runner/Filter/Factory.php b/vendor/phpunit/phpunit/src/Runner/Filter/Factory.php deleted file mode 100644 index 3f79da54..00000000 --- a/vendor/phpunit/phpunit/src/Runner/Filter/Factory.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner\Filter; - -use function assert; -use function sprintf; -use FilterIterator; -use Iterator; -use PHPUnit\Framework\TestSuite; -use PHPUnit\Runner\Exception; -use RecursiveFilterIterator; -use ReflectionClass; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Factory -{ - /** - * @psalm-var array - */ - private $filters = []; - - /** - * @param array|string $args - * - * @throws Exception - */ - public function addFilter(ReflectionClass $filter, $args): void - { - if (!$filter->isSubclassOf(RecursiveFilterIterator::class)) { - throw new Exception( - sprintf( - 'Class "%s" does not extend RecursiveFilterIterator', - $filter->name - ) - ); - } - - $this->filters[] = [$filter, $args]; - } - - public function factory(Iterator $iterator, TestSuite $suite): FilterIterator - { - foreach ($this->filters as $filter) { - [$class, $args] = $filter; - $iterator = $class->newInstance($iterator, $args, $suite); - } - - assert($iterator instanceof FilterIterator); - - return $iterator; - } -} diff --git a/vendor/phpunit/phpunit/src/Runner/Filter/GroupFilterIterator.php b/vendor/phpunit/phpunit/src/Runner/Filter/GroupFilterIterator.php deleted file mode 100644 index 42ca77a3..00000000 --- a/vendor/phpunit/phpunit/src/Runner/Filter/GroupFilterIterator.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner\Filter; - -use function array_map; -use function array_merge; -use function in_array; -use function spl_object_hash; -use PHPUnit\Framework\TestSuite; -use RecursiveFilterIterator; -use RecursiveIterator; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -abstract class GroupFilterIterator extends RecursiveFilterIterator -{ - /** - * @var string[] - */ - protected $groupTests = []; - - public function __construct(RecursiveIterator $iterator, array $groups, TestSuite $suite) - { - parent::__construct($iterator); - - foreach ($suite->getGroupDetails() as $group => $tests) { - if (in_array((string) $group, $groups, true)) { - $testHashes = array_map( - 'spl_object_hash', - $tests - ); - - $this->groupTests = array_merge($this->groupTests, $testHashes); - } - } - } - - public function accept(): bool - { - $test = $this->getInnerIterator()->current(); - - if ($test instanceof TestSuite) { - return true; - } - - return $this->doAccept(spl_object_hash($test)); - } - - abstract protected function doAccept(string $hash); -} diff --git a/vendor/phpunit/phpunit/src/Runner/Filter/IncludeGroupFilterIterator.php b/vendor/phpunit/phpunit/src/Runner/Filter/IncludeGroupFilterIterator.php deleted file mode 100644 index 0346c601..00000000 --- a/vendor/phpunit/phpunit/src/Runner/Filter/IncludeGroupFilterIterator.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 PHPUnit\Runner\Filter; - -use function in_array; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class IncludeGroupFilterIterator extends GroupFilterIterator -{ - protected function doAccept(string $hash): bool - { - return in_array($hash, $this->groupTests, true); - } -} diff --git a/vendor/phpunit/phpunit/src/Runner/Filter/NameFilterIterator.php b/vendor/phpunit/phpunit/src/Runner/Filter/NameFilterIterator.php deleted file mode 100644 index 7057e1c4..00000000 --- a/vendor/phpunit/phpunit/src/Runner/Filter/NameFilterIterator.php +++ /dev/null @@ -1,136 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner\Filter; - -use function end; -use function implode; -use function preg_match; -use function sprintf; -use function str_replace; -use Exception; -use PHPUnit\Framework\ErrorTestCase; -use PHPUnit\Framework\TestSuite; -use PHPUnit\Framework\WarningTestCase; -use PHPUnit\Util\RegularExpression; -use RecursiveFilterIterator; -use RecursiveIterator; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class NameFilterIterator extends RecursiveFilterIterator -{ - /** - * @var string - */ - private $filter; - - /** - * @var int - */ - private $filterMin; - - /** - * @var int - */ - private $filterMax; - - /** - * @throws Exception - */ - public function __construct(RecursiveIterator $iterator, string $filter) - { - parent::__construct($iterator); - - $this->setFilter($filter); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function accept(): bool - { - $test = $this->getInnerIterator()->current(); - - if ($test instanceof TestSuite) { - return true; - } - - $tmp = \PHPUnit\Util\Test::describe($test); - - if ($test instanceof ErrorTestCase || $test instanceof WarningTestCase) { - $name = $test->getMessage(); - } elseif ($tmp[0] !== '') { - $name = implode('::', $tmp); - } else { - $name = $tmp[1]; - } - - $accepted = @preg_match($this->filter, $name, $matches); - - if ($accepted && isset($this->filterMax)) { - $set = end($matches); - $accepted = $set >= $this->filterMin && $set <= $this->filterMax; - } - - return (bool) $accepted; - } - - /** - * @throws Exception - */ - private function setFilter(string $filter): void - { - if (RegularExpression::safeMatch($filter, '') === false) { - // Handles: - // * testAssertEqualsSucceeds#4 - // * testAssertEqualsSucceeds#4-8 - if (preg_match('/^(.*?)#(\d+)(?:-(\d+))?$/', $filter, $matches)) { - if (isset($matches[3]) && $matches[2] < $matches[3]) { - $filter = sprintf( - '%s.*with data set #(\d+)$', - $matches[1] - ); - - $this->filterMin = (int) $matches[2]; - $this->filterMax = (int) $matches[3]; - } else { - $filter = sprintf( - '%s.*with data set #%s$', - $matches[1], - $matches[2] - ); - } - } // Handles: - // * testDetermineJsonError@JSON_ERROR_NONE - // * testDetermineJsonError@JSON.* - elseif (preg_match('/^(.*?)@(.+)$/', $filter, $matches)) { - $filter = sprintf( - '%s.*with data set "%s"$', - $matches[1], - $matches[2] - ); - } - - // Escape delimiters in regular expression. Do NOT use preg_quote, - // to keep magic characters. - $filter = sprintf( - '/%s/i', - str_replace( - '/', - '\\/', - $filter - ) - ); - } - - $this->filter = $filter; - } -} diff --git a/vendor/phpunit/phpunit/src/Runner/Hook/AfterIncompleteTestHook.php b/vendor/phpunit/phpunit/src/Runner/Hook/AfterIncompleteTestHook.php deleted file mode 100644 index 432be9a9..00000000 --- a/vendor/phpunit/phpunit/src/Runner/Hook/AfterIncompleteTestHook.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 PHPUnit\Runner; - -/** - * This interface, as well as the associated mechanism for extending PHPUnit, - * will be removed in PHPUnit 10. There is no alternative available in this - * version of PHPUnit. - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see https://github.com/sebastianbergmann/phpunit/issues/4676 - */ -interface AfterIncompleteTestHook extends TestHook -{ - public function executeAfterIncompleteTest(string $test, string $message, float $time): void; -} diff --git a/vendor/phpunit/phpunit/src/Runner/Hook/AfterLastTestHook.php b/vendor/phpunit/phpunit/src/Runner/Hook/AfterLastTestHook.php deleted file mode 100644 index eb789f26..00000000 --- a/vendor/phpunit/phpunit/src/Runner/Hook/AfterLastTestHook.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 PHPUnit\Runner; - -/** - * This interface, as well as the associated mechanism for extending PHPUnit, - * will be removed in PHPUnit 10. There is no alternative available in this - * version of PHPUnit. - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see https://github.com/sebastianbergmann/phpunit/issues/4676 - */ -interface AfterLastTestHook extends Hook -{ - public function executeAfterLastTest(): void; -} diff --git a/vendor/phpunit/phpunit/src/Runner/Hook/AfterRiskyTestHook.php b/vendor/phpunit/phpunit/src/Runner/Hook/AfterRiskyTestHook.php deleted file mode 100644 index 31cc91ab..00000000 --- a/vendor/phpunit/phpunit/src/Runner/Hook/AfterRiskyTestHook.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 PHPUnit\Runner; - -/** - * This interface, as well as the associated mechanism for extending PHPUnit, - * will be removed in PHPUnit 10. There is no alternative available in this - * version of PHPUnit. - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see https://github.com/sebastianbergmann/phpunit/issues/4676 - */ -interface AfterRiskyTestHook extends TestHook -{ - public function executeAfterRiskyTest(string $test, string $message, float $time): void; -} diff --git a/vendor/phpunit/phpunit/src/Runner/Hook/AfterSkippedTestHook.php b/vendor/phpunit/phpunit/src/Runner/Hook/AfterSkippedTestHook.php deleted file mode 100644 index 76980b3f..00000000 --- a/vendor/phpunit/phpunit/src/Runner/Hook/AfterSkippedTestHook.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 PHPUnit\Runner; - -/** - * This interface, as well as the associated mechanism for extending PHPUnit, - * will be removed in PHPUnit 10. There is no alternative available in this - * version of PHPUnit. - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see https://github.com/sebastianbergmann/phpunit/issues/4676 - */ -interface AfterSkippedTestHook extends TestHook -{ - public function executeAfterSkippedTest(string $test, string $message, float $time): void; -} diff --git a/vendor/phpunit/phpunit/src/Runner/Hook/AfterSuccessfulTestHook.php b/vendor/phpunit/phpunit/src/Runner/Hook/AfterSuccessfulTestHook.php deleted file mode 100644 index d0a10dd1..00000000 --- a/vendor/phpunit/phpunit/src/Runner/Hook/AfterSuccessfulTestHook.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 PHPUnit\Runner; - -/** - * This interface, as well as the associated mechanism for extending PHPUnit, - * will be removed in PHPUnit 10. There is no alternative available in this - * version of PHPUnit. - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see https://github.com/sebastianbergmann/phpunit/issues/4676 - */ -interface AfterSuccessfulTestHook extends TestHook -{ - public function executeAfterSuccessfulTest(string $test, float $time): void; -} diff --git a/vendor/phpunit/phpunit/src/Runner/Hook/AfterTestErrorHook.php b/vendor/phpunit/phpunit/src/Runner/Hook/AfterTestErrorHook.php deleted file mode 100644 index 12ecebd3..00000000 --- a/vendor/phpunit/phpunit/src/Runner/Hook/AfterTestErrorHook.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 PHPUnit\Runner; - -/** - * This interface, as well as the associated mechanism for extending PHPUnit, - * will be removed in PHPUnit 10. There is no alternative available in this - * version of PHPUnit. - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see https://github.com/sebastianbergmann/phpunit/issues/4676 - */ -interface AfterTestErrorHook extends TestHook -{ - public function executeAfterTestError(string $test, string $message, float $time): void; -} diff --git a/vendor/phpunit/phpunit/src/Runner/Hook/AfterTestFailureHook.php b/vendor/phpunit/phpunit/src/Runner/Hook/AfterTestFailureHook.php deleted file mode 100644 index 94b2f300..00000000 --- a/vendor/phpunit/phpunit/src/Runner/Hook/AfterTestFailureHook.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 PHPUnit\Runner; - -/** - * This interface, as well as the associated mechanism for extending PHPUnit, - * will be removed in PHPUnit 10. There is no alternative available in this - * version of PHPUnit. - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see https://github.com/sebastianbergmann/phpunit/issues/4676 - */ -interface AfterTestFailureHook extends TestHook -{ - public function executeAfterTestFailure(string $test, string $message, float $time): void; -} diff --git a/vendor/phpunit/phpunit/src/Runner/Hook/AfterTestHook.php b/vendor/phpunit/phpunit/src/Runner/Hook/AfterTestHook.php deleted file mode 100644 index 3d5bcaa9..00000000 --- a/vendor/phpunit/phpunit/src/Runner/Hook/AfterTestHook.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 PHPUnit\Runner; - -/** - * This interface, as well as the associated mechanism for extending PHPUnit, - * will be removed in PHPUnit 10. There is no alternative available in this - * version of PHPUnit. - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see https://github.com/sebastianbergmann/phpunit/issues/4676 - */ -interface AfterTestHook extends TestHook -{ - /** - * This hook will fire after any test, regardless of the result. - * - * For more fine grained control, have a look at the other hooks - * that extend PHPUnit\Runner\Hook. - */ - public function executeAfterTest(string $test, float $time): void; -} diff --git a/vendor/phpunit/phpunit/src/Runner/Hook/AfterTestWarningHook.php b/vendor/phpunit/phpunit/src/Runner/Hook/AfterTestWarningHook.php deleted file mode 100644 index 860fccee..00000000 --- a/vendor/phpunit/phpunit/src/Runner/Hook/AfterTestWarningHook.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 PHPUnit\Runner; - -/** - * This interface, as well as the associated mechanism for extending PHPUnit, - * will be removed in PHPUnit 10. There is no alternative available in this - * version of PHPUnit. - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see https://github.com/sebastianbergmann/phpunit/issues/4676 - */ -interface AfterTestWarningHook extends TestHook -{ - public function executeAfterTestWarning(string $test, string $message, float $time): void; -} diff --git a/vendor/phpunit/phpunit/src/Runner/Hook/BeforeFirstTestHook.php b/vendor/phpunit/phpunit/src/Runner/Hook/BeforeFirstTestHook.php deleted file mode 100644 index feeb90fb..00000000 --- a/vendor/phpunit/phpunit/src/Runner/Hook/BeforeFirstTestHook.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 PHPUnit\Runner; - -/** - * This interface, as well as the associated mechanism for extending PHPUnit, - * will be removed in PHPUnit 10. There is no alternative available in this - * version of PHPUnit. - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see https://github.com/sebastianbergmann/phpunit/issues/4676 - */ -interface BeforeFirstTestHook extends Hook -{ - public function executeBeforeFirstTest(): void; -} diff --git a/vendor/phpunit/phpunit/src/Runner/Hook/BeforeTestHook.php b/vendor/phpunit/phpunit/src/Runner/Hook/BeforeTestHook.php deleted file mode 100644 index b7e0827d..00000000 --- a/vendor/phpunit/phpunit/src/Runner/Hook/BeforeTestHook.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 PHPUnit\Runner; - -/** - * This interface, as well as the associated mechanism for extending PHPUnit, - * will be removed in PHPUnit 10. There is no alternative available in this - * version of PHPUnit. - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see https://github.com/sebastianbergmann/phpunit/issues/4676 - */ -interface BeforeTestHook extends TestHook -{ - public function executeBeforeTest(string $test): void; -} diff --git a/vendor/phpunit/phpunit/src/Runner/Hook/Hook.php b/vendor/phpunit/phpunit/src/Runner/Hook/Hook.php deleted file mode 100644 index a08dc72b..00000000 --- a/vendor/phpunit/phpunit/src/Runner/Hook/Hook.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 PHPUnit\Runner; - -/** - * This interface, as well as the associated mechanism for extending PHPUnit, - * will be removed in PHPUnit 10. There is no alternative available in this - * version of PHPUnit. - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see https://github.com/sebastianbergmann/phpunit/issues/4676 - */ -interface Hook -{ -} diff --git a/vendor/phpunit/phpunit/src/Runner/Hook/TestHook.php b/vendor/phpunit/phpunit/src/Runner/Hook/TestHook.php deleted file mode 100644 index 31e880e2..00000000 --- a/vendor/phpunit/phpunit/src/Runner/Hook/TestHook.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 PHPUnit\Runner; - -/** - * This interface, as well as the associated mechanism for extending PHPUnit, - * will be removed in PHPUnit 10. There is no alternative available in this - * version of PHPUnit. - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - * - * @see https://github.com/sebastianbergmann/phpunit/issues/4676 - */ -interface TestHook extends Hook -{ -} diff --git a/vendor/phpunit/phpunit/src/Runner/Hook/TestListenerAdapter.php b/vendor/phpunit/phpunit/src/Runner/Hook/TestListenerAdapter.php deleted file mode 100644 index 60fbfba3..00000000 --- a/vendor/phpunit/phpunit/src/Runner/Hook/TestListenerAdapter.php +++ /dev/null @@ -1,141 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -use PHPUnit\Framework\AssertionFailedError; -use PHPUnit\Framework\Test; -use PHPUnit\Framework\TestListener; -use PHPUnit\Framework\TestSuite; -use PHPUnit\Framework\Warning; -use PHPUnit\Util\Test as TestUtil; -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TestListenerAdapter implements TestListener -{ - /** - * @var TestHook[] - */ - private $hooks = []; - - /** - * @var bool - */ - private $lastTestWasNotSuccessful; - - public function add(TestHook $hook): void - { - $this->hooks[] = $hook; - } - - public function startTest(Test $test): void - { - foreach ($this->hooks as $hook) { - if ($hook instanceof BeforeTestHook) { - $hook->executeBeforeTest(TestUtil::describeAsString($test)); - } - } - - $this->lastTestWasNotSuccessful = false; - } - - public function addError(Test $test, Throwable $t, float $time): void - { - foreach ($this->hooks as $hook) { - if ($hook instanceof AfterTestErrorHook) { - $hook->executeAfterTestError(TestUtil::describeAsString($test), $t->getMessage(), $time); - } - } - - $this->lastTestWasNotSuccessful = true; - } - - public function addWarning(Test $test, Warning $e, float $time): void - { - foreach ($this->hooks as $hook) { - if ($hook instanceof AfterTestWarningHook) { - $hook->executeAfterTestWarning(TestUtil::describeAsString($test), $e->getMessage(), $time); - } - } - - $this->lastTestWasNotSuccessful = true; - } - - public function addFailure(Test $test, AssertionFailedError $e, float $time): void - { - foreach ($this->hooks as $hook) { - if ($hook instanceof AfterTestFailureHook) { - $hook->executeAfterTestFailure(TestUtil::describeAsString($test), $e->getMessage(), $time); - } - } - - $this->lastTestWasNotSuccessful = true; - } - - public function addIncompleteTest(Test $test, Throwable $t, float $time): void - { - foreach ($this->hooks as $hook) { - if ($hook instanceof AfterIncompleteTestHook) { - $hook->executeAfterIncompleteTest(TestUtil::describeAsString($test), $t->getMessage(), $time); - } - } - - $this->lastTestWasNotSuccessful = true; - } - - public function addRiskyTest(Test $test, Throwable $t, float $time): void - { - foreach ($this->hooks as $hook) { - if ($hook instanceof AfterRiskyTestHook) { - $hook->executeAfterRiskyTest(TestUtil::describeAsString($test), $t->getMessage(), $time); - } - } - - $this->lastTestWasNotSuccessful = true; - } - - public function addSkippedTest(Test $test, Throwable $t, float $time): void - { - foreach ($this->hooks as $hook) { - if ($hook instanceof AfterSkippedTestHook) { - $hook->executeAfterSkippedTest(TestUtil::describeAsString($test), $t->getMessage(), $time); - } - } - - $this->lastTestWasNotSuccessful = true; - } - - public function endTest(Test $test, float $time): void - { - if (!$this->lastTestWasNotSuccessful) { - foreach ($this->hooks as $hook) { - if ($hook instanceof AfterSuccessfulTestHook) { - $hook->executeAfterSuccessfulTest(TestUtil::describeAsString($test), $time); - } - } - } - - foreach ($this->hooks as $hook) { - if ($hook instanceof AfterTestHook) { - $hook->executeAfterTest(TestUtil::describeAsString($test), $time); - } - } - } - - public function startTestSuite(TestSuite $suite): void - { - } - - public function endTestSuite(TestSuite $suite): void - { - } -} diff --git a/vendor/phpunit/phpunit/src/Runner/NullTestResultCache.php b/vendor/phpunit/phpunit/src/Runner/NullTestResultCache.php deleted file mode 100644 index 2aa86534..00000000 --- a/vendor/phpunit/phpunit/src/Runner/NullTestResultCache.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. - */ -namespace PHPUnit\Runner; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class NullTestResultCache implements TestResultCache -{ - public function setState(string $testName, int $state): void - { - } - - public function getState(string $testName): int - { - return BaseTestRunner::STATUS_UNKNOWN; - } - - public function setTime(string $testName, float $time): void - { - } - - public function getTime(string $testName): float - { - return 0; - } - - public function load(): void - { - } - - public function persist(): void - { - } -} diff --git a/vendor/phpunit/phpunit/src/Runner/PhptTestCase.php b/vendor/phpunit/phpunit/src/Runner/PhptTestCase.php deleted file mode 100644 index 6590102d..00000000 --- a/vendor/phpunit/phpunit/src/Runner/PhptTestCase.php +++ /dev/null @@ -1,864 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -use const DEBUG_BACKTRACE_IGNORE_ARGS; -use const DIRECTORY_SEPARATOR; -use function array_merge; -use function basename; -use function debug_backtrace; -use function defined; -use function dirname; -use function explode; -use function extension_loaded; -use function file; -use function file_get_contents; -use function file_put_contents; -use function is_array; -use function is_file; -use function is_readable; -use function is_string; -use function ltrim; -use function phpversion; -use function preg_match; -use function preg_replace; -use function preg_split; -use function realpath; -use function rtrim; -use function sprintf; -use function str_replace; -use function strncasecmp; -use function strpos; -use function substr; -use function trim; -use function unlink; -use function unserialize; -use function var_export; -use function version_compare; -use PHPUnit\Framework\Assert; -use PHPUnit\Framework\AssertionFailedError; -use PHPUnit\Framework\ExecutionOrderDependency; -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\IncompleteTestError; -use PHPUnit\Framework\PHPTAssertionFailedError; -use PHPUnit\Framework\Reorderable; -use PHPUnit\Framework\SelfDescribing; -use PHPUnit\Framework\SkippedTestError; -use PHPUnit\Framework\SyntheticSkippedError; -use PHPUnit\Framework\Test; -use PHPUnit\Framework\TestResult; -use PHPUnit\Util\PHP\AbstractPhpProcess; -use SebastianBergmann\CodeCoverage\RawCodeCoverageData; -use SebastianBergmann\Template\Template; -use SebastianBergmann\Timer\Timer; -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class PhptTestCase implements Reorderable, SelfDescribing, Test -{ - /** - * @var string - */ - private $filename; - - /** - * @var AbstractPhpProcess - */ - private $phpUtil; - - /** - * @var string - */ - private $output = ''; - - /** - * Constructs a test case with the given filename. - * - * @throws Exception - */ - public function __construct(string $filename, AbstractPhpProcess $phpUtil = null) - { - if (!is_file($filename)) { - throw new Exception( - sprintf( - 'File "%s" does not exist.', - $filename - ) - ); - } - - $this->filename = $filename; - $this->phpUtil = $phpUtil ?: AbstractPhpProcess::factory(); - } - - /** - * Counts the number of test cases executed by run(TestResult result). - */ - public function count(): int - { - return 1; - } - - /** - * Runs a test and collects its result in a TestResult instance. - * - * @throws \SebastianBergmann\CodeCoverage\InvalidArgumentException - * @throws \SebastianBergmann\CodeCoverage\UnintentionallyCoveredCodeException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - */ - public function run(TestResult $result = null): TestResult - { - if ($result === null) { - $result = new TestResult; - } - - try { - $sections = $this->parse(); - } catch (Exception $e) { - $result->startTest($this); - $result->addFailure($this, new SkippedTestError($e->getMessage()), 0); - $result->endTest($this, 0); - - return $result; - } - - $code = $this->render($sections['FILE']); - $xfail = false; - $settings = $this->parseIniSection($this->settings($result->getCollectCodeCoverageInformation())); - - $result->startTest($this); - - if (isset($sections['INI'])) { - $settings = $this->parseIniSection($sections['INI'], $settings); - } - - if (isset($sections['ENV'])) { - $env = $this->parseEnvSection($sections['ENV']); - $this->phpUtil->setEnv($env); - } - - $this->phpUtil->setUseStderrRedirection(true); - - if ($result->enforcesTimeLimit()) { - $this->phpUtil->setTimeout($result->getTimeoutForLargeTests()); - } - - $skip = $this->runSkip($sections, $result, $settings); - - if ($skip) { - return $result; - } - - if (isset($sections['XFAIL'])) { - $xfail = trim($sections['XFAIL']); - } - - if (isset($sections['STDIN'])) { - $this->phpUtil->setStdin($sections['STDIN']); - } - - if (isset($sections['ARGS'])) { - $this->phpUtil->setArgs($sections['ARGS']); - } - - if ($result->getCollectCodeCoverageInformation()) { - $codeCoverageCacheDirectory = null; - $pathCoverage = false; - - $codeCoverage = $result->getCodeCoverage(); - - if ($codeCoverage) { - if ($codeCoverage->cachesStaticAnalysis()) { - $codeCoverageCacheDirectory = $codeCoverage->cacheDirectory(); - } - - $pathCoverage = $codeCoverage->collectsBranchAndPathCoverage(); - } - - $this->renderForCoverage($code, $pathCoverage, $codeCoverageCacheDirectory); - } - - $timer = new Timer; - $timer->start(); - - $jobResult = $this->phpUtil->runJob($code, $this->stringifyIni($settings)); - $time = $timer->stop()->asSeconds(); - $this->output = $jobResult['stdout'] ?? ''; - - if (isset($codeCoverage) && ($coverage = $this->cleanupForCoverage())) { - $codeCoverage->append($coverage, $this, true, [], []); - } - - try { - $this->assertPhptExpectation($sections, $this->output); - } catch (AssertionFailedError $e) { - $failure = $e; - - if ($xfail !== false) { - $failure = new IncompleteTestError($xfail, 0, $e); - } elseif ($e instanceof ExpectationFailedException) { - $comparisonFailure = $e->getComparisonFailure(); - - if ($comparisonFailure) { - $diff = $comparisonFailure->getDiff(); - } else { - $diff = $e->getMessage(); - } - - $hint = $this->getLocationHintFromDiff($diff, $sections); - $trace = array_merge($hint, debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS)); - $failure = new PHPTAssertionFailedError( - $e->getMessage(), - 0, - $trace[0]['file'], - $trace[0]['line'], - $trace, - $comparisonFailure ? $diff : '' - ); - } - - $result->addFailure($this, $failure, $time); - } catch (Throwable $t) { - $result->addError($this, $t, $time); - } - - if ($xfail !== false && $result->allCompletelyImplemented()) { - $result->addFailure($this, new IncompleteTestError('XFAIL section but test passes'), $time); - } - - $this->runClean($sections, $result->getCollectCodeCoverageInformation()); - - $result->endTest($this, $time); - - return $result; - } - - /** - * Returns the name of the test case. - */ - public function getName(): string - { - return $this->toString(); - } - - /** - * Returns a string representation of the test case. - */ - public function toString(): string - { - return $this->filename; - } - - public function usesDataProvider(): bool - { - return false; - } - - public function getNumAssertions(): int - { - return 1; - } - - public function getActualOutput(): string - { - return $this->output; - } - - public function hasOutput(): bool - { - return !empty($this->output); - } - - public function sortId(): string - { - return $this->filename; - } - - /** - * @return list - */ - public function provides(): array - { - return []; - } - - /** - * @return list - */ - public function requires(): array - { - return []; - } - - /** - * Parse --INI-- section key value pairs and return as array. - * - * @param array|string $content - */ - private function parseIniSection($content, array $ini = []): array - { - if (is_string($content)) { - $content = explode("\n", trim($content)); - } - - foreach ($content as $setting) { - if (strpos($setting, '=') === false) { - continue; - } - - $setting = explode('=', $setting, 2); - $name = trim($setting[0]); - $value = trim($setting[1]); - - if ($name === 'extension' || $name === 'zend_extension') { - if (!isset($ini[$name])) { - $ini[$name] = []; - } - - $ini[$name][] = $value; - - continue; - } - - $ini[$name] = $value; - } - - return $ini; - } - - private function parseEnvSection(string $content): array - { - $env = []; - - foreach (explode("\n", trim($content)) as $e) { - $e = explode('=', trim($e), 2); - - if (!empty($e[0]) && isset($e[1])) { - $env[$e[0]] = $e[1]; - } - } - - return $env; - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - * @throws ExpectationFailedException - */ - private function assertPhptExpectation(array $sections, string $output): void - { - $assertions = [ - 'EXPECT' => 'assertEquals', - 'EXPECTF' => 'assertStringMatchesFormat', - 'EXPECTREGEX' => 'assertMatchesRegularExpression', - ]; - - $actual = preg_replace('/\r\n/', "\n", trim($output)); - - foreach ($assertions as $sectionName => $sectionAssertion) { - if (isset($sections[$sectionName])) { - $sectionContent = preg_replace('/\r\n/', "\n", trim($sections[$sectionName])); - $expected = $sectionName === 'EXPECTREGEX' ? "/{$sectionContent}/" : $sectionContent; - - if ($expected === '') { - throw new Exception('No PHPT expectation found'); - } - - Assert::$sectionAssertion($expected, $actual); - - return; - } - } - - throw new Exception('No PHPT assertion found'); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - private function runSkip(array &$sections, TestResult $result, array $settings): bool - { - if (!isset($sections['SKIPIF'])) { - return false; - } - - $skipif = $this->render($sections['SKIPIF']); - $jobResult = $this->phpUtil->runJob($skipif, $this->stringifyIni($settings)); - - if (!strncasecmp('skip', ltrim($jobResult['stdout']), 4)) { - $message = ''; - - if (preg_match('/^\s*skip\s*(.+)\s*/i', $jobResult['stdout'], $skipMatch)) { - $message = substr($skipMatch[1], 2); - } - - $hint = $this->getLocationHint($message, $sections, 'SKIPIF'); - $trace = array_merge($hint, debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS)); - $result->addFailure( - $this, - new SyntheticSkippedError($message, 0, $trace[0]['file'], $trace[0]['line'], $trace), - 0 - ); - $result->endTest($this, 0); - - return true; - } - - return false; - } - - private function runClean(array &$sections, bool $collectCoverage): void - { - $this->phpUtil->setStdin(''); - $this->phpUtil->setArgs(''); - - if (isset($sections['CLEAN'])) { - $cleanCode = $this->render($sections['CLEAN']); - - $this->phpUtil->runJob($cleanCode, $this->settings($collectCoverage)); - } - } - - /** - * @throws Exception - */ - private function parse(): array - { - $sections = []; - $section = ''; - - $unsupportedSections = [ - 'CGI', - 'COOKIE', - 'DEFLATE_POST', - 'EXPECTHEADERS', - 'EXTENSIONS', - 'GET', - 'GZIP_POST', - 'HEADERS', - 'PHPDBG', - 'POST', - 'POST_RAW', - 'PUT', - 'REDIRECTTEST', - 'REQUEST', - ]; - - $lineNr = 0; - - foreach (file($this->filename) as $line) { - $lineNr++; - - if (preg_match('/^--([_A-Z]+)--/', $line, $result)) { - $section = $result[1]; - $sections[$section] = ''; - $sections[$section . '_offset'] = $lineNr; - - continue; - } - - if (empty($section)) { - throw new Exception('Invalid PHPT file: empty section header'); - } - - $sections[$section] .= $line; - } - - if (isset($sections['FILEEOF'])) { - $sections['FILE'] = rtrim($sections['FILEEOF'], "\r\n"); - unset($sections['FILEEOF']); - } - - $this->parseExternal($sections); - - if (!$this->validate($sections)) { - throw new Exception('Invalid PHPT file'); - } - - foreach ($unsupportedSections as $section) { - if (isset($sections[$section])) { - throw new Exception( - "PHPUnit does not support PHPT {$section} sections" - ); - } - } - - return $sections; - } - - /** - * @throws Exception - */ - private function parseExternal(array &$sections): void - { - $allowSections = [ - 'FILE', - 'EXPECT', - 'EXPECTF', - 'EXPECTREGEX', - ]; - $testDirectory = dirname($this->filename) . DIRECTORY_SEPARATOR; - - foreach ($allowSections as $section) { - if (isset($sections[$section . '_EXTERNAL'])) { - $externalFilename = trim($sections[$section . '_EXTERNAL']); - - if (!is_file($testDirectory . $externalFilename) || - !is_readable($testDirectory . $externalFilename)) { - throw new Exception( - sprintf( - 'Could not load --%s-- %s for PHPT file', - $section . '_EXTERNAL', - $testDirectory . $externalFilename - ) - ); - } - - $sections[$section] = file_get_contents($testDirectory . $externalFilename); - } - } - } - - private function validate(array &$sections): bool - { - $requiredSections = [ - 'FILE', - [ - 'EXPECT', - 'EXPECTF', - 'EXPECTREGEX', - ], - ]; - - foreach ($requiredSections as $section) { - if (is_array($section)) { - $foundSection = false; - - foreach ($section as $anySection) { - if (isset($sections[$anySection])) { - $foundSection = true; - - break; - } - } - - if (!$foundSection) { - return false; - } - - continue; - } - - if (!isset($sections[$section])) { - return false; - } - } - - return true; - } - - private function render(string $code): string - { - return str_replace( - [ - '__DIR__', - '__FILE__', - ], - [ - "'" . dirname($this->filename) . "'", - "'" . $this->filename . "'", - ], - $code - ); - } - - private function getCoverageFiles(): array - { - $baseDir = dirname(realpath($this->filename)) . DIRECTORY_SEPARATOR; - $basename = basename($this->filename, 'phpt'); - - return [ - 'coverage' => $baseDir . $basename . 'coverage', - 'job' => $baseDir . $basename . 'php', - ]; - } - - private function renderForCoverage(string &$job, bool $pathCoverage, ?string $codeCoverageCacheDirectory): void - { - $files = $this->getCoverageFiles(); - - $template = new Template( - __DIR__ . '/../Util/PHP/Template/PhptTestCase.tpl' - ); - - $composerAutoload = '\'\''; - - if (defined('PHPUNIT_COMPOSER_INSTALL')) { - $composerAutoload = var_export(PHPUNIT_COMPOSER_INSTALL, true); - } - - $phar = '\'\''; - - if (defined('__PHPUNIT_PHAR__')) { - $phar = var_export(__PHPUNIT_PHAR__, true); - } - - $globals = ''; - - if (!empty($GLOBALS['__PHPUNIT_BOOTSTRAP'])) { - $globals = '$GLOBALS[\'__PHPUNIT_BOOTSTRAP\'] = ' . var_export( - $GLOBALS['__PHPUNIT_BOOTSTRAP'], - true - ) . ";\n"; - } - - if ($codeCoverageCacheDirectory === null) { - $codeCoverageCacheDirectory = 'null'; - } else { - $codeCoverageCacheDirectory = "'" . $codeCoverageCacheDirectory . "'"; - } - - $template->setVar( - [ - 'composerAutoload' => $composerAutoload, - 'phar' => $phar, - 'globals' => $globals, - 'job' => $files['job'], - 'coverageFile' => $files['coverage'], - 'driverMethod' => $pathCoverage ? 'forLineAndPathCoverage' : 'forLineCoverage', - 'codeCoverageCacheDirectory' => $codeCoverageCacheDirectory, - ] - ); - - file_put_contents($files['job'], $job); - - $job = $template->render(); - } - - private function cleanupForCoverage(): RawCodeCoverageData - { - $coverage = RawCodeCoverageData::fromXdebugWithoutPathCoverage([]); - $files = $this->getCoverageFiles(); - - if (is_file($files['coverage'])) { - $buffer = @file_get_contents($files['coverage']); - - if ($buffer !== false) { - $coverage = @unserialize($buffer); - - if ($coverage === false) { - $coverage = RawCodeCoverageData::fromXdebugWithoutPathCoverage([]); - } - } - } - - foreach ($files as $file) { - @unlink($file); - } - - return $coverage; - } - - private function stringifyIni(array $ini): array - { - $settings = []; - - foreach ($ini as $key => $value) { - if (is_array($value)) { - foreach ($value as $val) { - $settings[] = $key . '=' . $val; - } - - continue; - } - - $settings[] = $key . '=' . $value; - } - - return $settings; - } - - private function getLocationHintFromDiff(string $message, array $sections): array - { - $needle = ''; - $previousLine = ''; - $block = 'message'; - - foreach (preg_split('/\r\n|\r|\n/', $message) as $line) { - $line = trim($line); - - if ($block === 'message' && $line === '--- Expected') { - $block = 'expected'; - } - - if ($block === 'expected' && $line === '@@ @@') { - $block = 'diff'; - } - - if ($block === 'diff') { - if (strpos($line, '+') === 0) { - $needle = $this->getCleanDiffLine($previousLine); - - break; - } - - if (strpos($line, '-') === 0) { - $needle = $this->getCleanDiffLine($line); - - break; - } - } - - if (!empty($line)) { - $previousLine = $line; - } - } - - return $this->getLocationHint($needle, $sections); - } - - private function getCleanDiffLine(string $line): string - { - if (preg_match('/^[\-+]([\'\"]?)(.*)\1$/', $line, $matches)) { - $line = $matches[2]; - } - - return $line; - } - - private function getLocationHint(string $needle, array $sections, ?string $sectionName = null): array - { - $needle = trim($needle); - - if (empty($needle)) { - return [[ - 'file' => realpath($this->filename), - 'line' => 1, - ]]; - } - - if ($sectionName) { - $search = [$sectionName]; - } else { - $search = [ - // 'FILE', - 'EXPECT', - 'EXPECTF', - 'EXPECTREGEX', - ]; - } - - $sectionOffset = null; - - foreach ($search as $section) { - if (!isset($sections[$section])) { - continue; - } - - if (isset($sections[$section . '_EXTERNAL'])) { - $externalFile = trim($sections[$section . '_EXTERNAL']); - - return [ - [ - 'file' => realpath(dirname($this->filename) . DIRECTORY_SEPARATOR . $externalFile), - 'line' => 1, - ], - [ - 'file' => realpath($this->filename), - 'line' => ($sections[$section . '_EXTERNAL_offset'] ?? 0) + 1, - ], - ]; - } - - $sectionOffset = $sections[$section . '_offset'] ?? 0; - $offset = $sectionOffset + 1; - - foreach (preg_split('/\r\n|\r|\n/', $sections[$section]) as $line) { - if (strpos($line, $needle) !== false) { - return [[ - 'file' => realpath($this->filename), - 'line' => $offset, - ]]; - } - $offset++; - } - } - - if ($sectionName) { - // String not found in specified section, show user the start of the named section - return [[ - 'file' => realpath($this->filename), - 'line' => $sectionOffset, - ]]; - } - - // No section specified, show user start of code - return [[ - 'file' => realpath($this->filename), - 'line' => 1, - ]]; - } - - /** - * @psalm-return list - */ - private function settings(bool $collectCoverage): array - { - $settings = [ - 'allow_url_fopen=1', - 'auto_append_file=', - 'auto_prepend_file=', - 'disable_functions=', - 'display_errors=1', - 'docref_ext=.html', - 'docref_root=', - 'error_append_string=', - 'error_prepend_string=', - 'error_reporting=-1', - 'html_errors=0', - 'log_errors=0', - 'open_basedir=', - 'output_buffering=Off', - 'output_handler=', - 'report_memleaks=0', - 'report_zend_debug=0', - ]; - - if (extension_loaded('pcov')) { - if ($collectCoverage) { - $settings[] = 'pcov.enabled=1'; - } else { - $settings[] = 'pcov.enabled=0'; - } - } - - if (extension_loaded('xdebug')) { - if (version_compare(phpversion('xdebug'), '3', '>=')) { - if ($collectCoverage) { - $settings[] = 'xdebug.mode=coverage'; - } else { - $settings[] = 'xdebug.mode=off'; - } - } else { - $settings[] = 'xdebug.default_enable=0'; - - if ($collectCoverage) { - $settings[] = 'xdebug.coverage_enable=1'; - } - } - } - - return $settings; - } -} diff --git a/vendor/phpunit/phpunit/src/Runner/ResultCacheExtension.php b/vendor/phpunit/phpunit/src/Runner/ResultCacheExtension.php deleted file mode 100644 index 31d7610e..00000000 --- a/vendor/phpunit/phpunit/src/Runner/ResultCacheExtension.php +++ /dev/null @@ -1,110 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -use function preg_match; -use function round; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ResultCacheExtension implements AfterIncompleteTestHook, AfterLastTestHook, AfterRiskyTestHook, AfterSkippedTestHook, AfterSuccessfulTestHook, AfterTestErrorHook, AfterTestFailureHook, AfterTestWarningHook -{ - /** - * @var TestResultCache - */ - private $cache; - - public function __construct(TestResultCache $cache) - { - $this->cache = $cache; - } - - public function flush(): void - { - $this->cache->persist(); - } - - public function executeAfterSuccessfulTest(string $test, float $time): void - { - $testName = $this->getTestName($test); - - $this->cache->setTime($testName, round($time, 3)); - } - - public function executeAfterIncompleteTest(string $test, string $message, float $time): void - { - $testName = $this->getTestName($test); - - $this->cache->setTime($testName, round($time, 3)); - $this->cache->setState($testName, BaseTestRunner::STATUS_INCOMPLETE); - } - - public function executeAfterRiskyTest(string $test, string $message, float $time): void - { - $testName = $this->getTestName($test); - - $this->cache->setTime($testName, round($time, 3)); - $this->cache->setState($testName, BaseTestRunner::STATUS_RISKY); - } - - public function executeAfterSkippedTest(string $test, string $message, float $time): void - { - $testName = $this->getTestName($test); - - $this->cache->setTime($testName, round($time, 3)); - $this->cache->setState($testName, BaseTestRunner::STATUS_SKIPPED); - } - - public function executeAfterTestError(string $test, string $message, float $time): void - { - $testName = $this->getTestName($test); - - $this->cache->setTime($testName, round($time, 3)); - $this->cache->setState($testName, BaseTestRunner::STATUS_ERROR); - } - - public function executeAfterTestFailure(string $test, string $message, float $time): void - { - $testName = $this->getTestName($test); - - $this->cache->setTime($testName, round($time, 3)); - $this->cache->setState($testName, BaseTestRunner::STATUS_FAILURE); - } - - public function executeAfterTestWarning(string $test, string $message, float $time): void - { - $testName = $this->getTestName($test); - - $this->cache->setTime($testName, round($time, 3)); - $this->cache->setState($testName, BaseTestRunner::STATUS_WARNING); - } - - public function executeAfterLastTest(): void - { - $this->flush(); - } - - /** - * @param string $test A long description format of the current test - * - * @return string The test name without TestSuiteClassName:: and @dataprovider details - */ - private function getTestName(string $test): string - { - $matches = []; - - if (preg_match('/^(?\S+::\S+)(?:(? with data set (?:#\d+|"[^"]+"))\s\()?/', $test, $matches)) { - $test = $matches['name'] . ($matches['dataname'] ?? ''); - } - - return $test; - } -} diff --git a/vendor/phpunit/phpunit/src/Runner/StandardTestSuiteLoader.php b/vendor/phpunit/phpunit/src/Runner/StandardTestSuiteLoader.php deleted file mode 100644 index 0f7395b2..00000000 --- a/vendor/phpunit/phpunit/src/Runner/StandardTestSuiteLoader.php +++ /dev/null @@ -1,124 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -use function array_diff; -use function array_values; -use function basename; -use function class_exists; -use function get_declared_classes; -use function sprintf; -use function stripos; -use function strlen; -use function substr; -use PHPUnit\Framework\TestCase; -use PHPUnit\Util\FileLoader; -use ReflectionClass; -use ReflectionException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @deprecated see https://github.com/sebastianbergmann/phpunit/issues/4039 - */ -final class StandardTestSuiteLoader implements TestSuiteLoader -{ - /** - * @throws Exception - */ - public function load(string $suiteClassFile): ReflectionClass - { - $suiteClassName = basename($suiteClassFile, '.php'); - $loadedClasses = get_declared_classes(); - - if (!class_exists($suiteClassName, false)) { - /* @noinspection UnusedFunctionResultInspection */ - FileLoader::checkAndLoad($suiteClassFile); - - $loadedClasses = array_values( - array_diff(get_declared_classes(), $loadedClasses) - ); - - if (empty($loadedClasses)) { - throw $this->exceptionFor($suiteClassName, $suiteClassFile); - } - } - - if (!class_exists($suiteClassName, false)) { - $offset = 0 - strlen($suiteClassName); - - foreach ($loadedClasses as $loadedClass) { - // @see https://github.com/sebastianbergmann/phpunit/issues/5020 - if (stripos(substr($loadedClass, $offset - 1), '\\' . $suiteClassName) === 0 || - stripos(substr($loadedClass, $offset - 1), '_' . $suiteClassName) === 0) { - $suiteClassName = $loadedClass; - - break; - } - } - } - - if (!class_exists($suiteClassName, false)) { - throw $this->exceptionFor($suiteClassName, $suiteClassFile); - } - - try { - $class = new ReflectionClass($suiteClassName); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if ($class->isSubclassOf(TestCase::class) && !$class->isAbstract()) { - return $class; - } - - if ($class->hasMethod('suite')) { - try { - $method = $class->getMethod('suite'); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if (!$method->isAbstract() && $method->isPublic() && $method->isStatic()) { - return $class; - } - } - - throw $this->exceptionFor($suiteClassName, $suiteClassFile); - } - - public function reload(ReflectionClass $aClass): ReflectionClass - { - return $aClass; - } - - private function exceptionFor(string $className, string $filename): Exception - { - return new Exception( - sprintf( - "Class '%s' could not be found in '%s'.", - $className, - $filename - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Runner/TestResultCache.php b/vendor/phpunit/phpunit/src/Runner/TestResultCache.php deleted file mode 100644 index 69e62828..00000000 --- a/vendor/phpunit/phpunit/src/Runner/TestResultCache.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 PHPUnit\Runner; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -interface TestResultCache -{ - public function setState(string $testName, int $state): void; - - public function getState(string $testName): int; - - public function setTime(string $testName, float $time): void; - - public function getTime(string $testName): float; - - public function load(): void; - - public function persist(): void; -} diff --git a/vendor/phpunit/phpunit/src/Runner/TestSuiteLoader.php b/vendor/phpunit/phpunit/src/Runner/TestSuiteLoader.php deleted file mode 100644 index c9d8e01b..00000000 --- a/vendor/phpunit/phpunit/src/Runner/TestSuiteLoader.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 PHPUnit\Runner; - -use ReflectionClass; - -/** - * @deprecated see https://github.com/sebastianbergmann/phpunit/issues/4039 - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -interface TestSuiteLoader -{ - public function load(string $suiteClassFile): ReflectionClass; - - public function reload(ReflectionClass $aClass): ReflectionClass; -} diff --git a/vendor/phpunit/phpunit/src/Runner/TestSuiteSorter.php b/vendor/phpunit/phpunit/src/Runner/TestSuiteSorter.php deleted file mode 100644 index 64ad845c..00000000 --- a/vendor/phpunit/phpunit/src/Runner/TestSuiteSorter.php +++ /dev/null @@ -1,394 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -use function array_diff; -use function array_merge; -use function array_reverse; -use function array_splice; -use function count; -use function in_array; -use function max; -use function shuffle; -use function usort; -use PHPUnit\Framework\DataProviderTestSuite; -use PHPUnit\Framework\Reorderable; -use PHPUnit\Framework\Test; -use PHPUnit\Framework\TestCase; -use PHPUnit\Framework\TestSuite; -use PHPUnit\Util\Test as TestUtil; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TestSuiteSorter -{ - /** - * @var int - */ - public const ORDER_DEFAULT = 0; - - /** - * @var int - */ - public const ORDER_RANDOMIZED = 1; - - /** - * @var int - */ - public const ORDER_REVERSED = 2; - - /** - * @var int - */ - public const ORDER_DEFECTS_FIRST = 3; - - /** - * @var int - */ - public const ORDER_DURATION = 4; - - /** - * Order tests by @size annotation 'small', 'medium', 'large'. - * - * @var int - */ - public const ORDER_SIZE = 5; - - /** - * List of sorting weights for all test result codes. A higher number gives higher priority. - */ - private const DEFECT_SORT_WEIGHT = [ - BaseTestRunner::STATUS_ERROR => 6, - BaseTestRunner::STATUS_FAILURE => 5, - BaseTestRunner::STATUS_WARNING => 4, - BaseTestRunner::STATUS_INCOMPLETE => 3, - BaseTestRunner::STATUS_RISKY => 2, - BaseTestRunner::STATUS_SKIPPED => 1, - BaseTestRunner::STATUS_UNKNOWN => 0, - ]; - - private const SIZE_SORT_WEIGHT = [ - TestUtil::SMALL => 1, - TestUtil::MEDIUM => 2, - TestUtil::LARGE => 3, - TestUtil::UNKNOWN => 4, - ]; - - /** - * @var array Associative array of (string => DEFECT_SORT_WEIGHT) elements - */ - private $defectSortOrder = []; - - /** - * @var TestResultCache - */ - private $cache; - - /** - * @var array A list of normalized names of tests before reordering - */ - private $originalExecutionOrder = []; - - /** - * @var array A list of normalized names of tests affected by reordering - */ - private $executionOrder = []; - - public function __construct(?TestResultCache $cache = null) - { - $this->cache = $cache ?? new NullTestResultCache; - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * @throws Exception - */ - public function reorderTestsInSuite(Test $suite, int $order, bool $resolveDependencies, int $orderDefects, bool $isRootTestSuite = true): void - { - $allowedOrders = [ - self::ORDER_DEFAULT, - self::ORDER_REVERSED, - self::ORDER_RANDOMIZED, - self::ORDER_DURATION, - self::ORDER_SIZE, - ]; - - if (!in_array($order, $allowedOrders, true)) { - throw new Exception( - '$order must be one of TestSuiteSorter::ORDER_[DEFAULT|REVERSED|RANDOMIZED|DURATION|SIZE]' - ); - } - - $allowedOrderDefects = [ - self::ORDER_DEFAULT, - self::ORDER_DEFECTS_FIRST, - ]; - - if (!in_array($orderDefects, $allowedOrderDefects, true)) { - throw new Exception( - '$orderDefects must be one of TestSuiteSorter::ORDER_DEFAULT, TestSuiteSorter::ORDER_DEFECTS_FIRST' - ); - } - - if ($isRootTestSuite) { - $this->originalExecutionOrder = $this->calculateTestExecutionOrder($suite); - } - - if ($suite instanceof TestSuite) { - foreach ($suite as $_suite) { - $this->reorderTestsInSuite($_suite, $order, $resolveDependencies, $orderDefects, false); - } - - if ($orderDefects === self::ORDER_DEFECTS_FIRST) { - $this->addSuiteToDefectSortOrder($suite); - } - - $this->sort($suite, $order, $resolveDependencies, $orderDefects); - } - - if ($isRootTestSuite) { - $this->executionOrder = $this->calculateTestExecutionOrder($suite); - } - } - - public function getOriginalExecutionOrder(): array - { - return $this->originalExecutionOrder; - } - - public function getExecutionOrder(): array - { - return $this->executionOrder; - } - - private function sort(TestSuite $suite, int $order, bool $resolveDependencies, int $orderDefects): void - { - if (empty($suite->tests())) { - return; - } - - if ($order === self::ORDER_REVERSED) { - $suite->setTests($this->reverse($suite->tests())); - } elseif ($order === self::ORDER_RANDOMIZED) { - $suite->setTests($this->randomize($suite->tests())); - } elseif ($order === self::ORDER_DURATION && $this->cache !== null) { - $suite->setTests($this->sortByDuration($suite->tests())); - } elseif ($order === self::ORDER_SIZE) { - $suite->setTests($this->sortBySize($suite->tests())); - } - - if ($orderDefects === self::ORDER_DEFECTS_FIRST && $this->cache !== null) { - $suite->setTests($this->sortDefectsFirst($suite->tests())); - } - - if ($resolveDependencies && !($suite instanceof DataProviderTestSuite)) { - /** @var TestCase[] $tests */ - $tests = $suite->tests(); - - $suite->setTests($this->resolveDependencies($tests)); - } - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - private function addSuiteToDefectSortOrder(TestSuite $suite): void - { - $max = 0; - - foreach ($suite->tests() as $test) { - if (!$test instanceof Reorderable) { - continue; - } - - if (!isset($this->defectSortOrder[$test->sortId()])) { - $this->defectSortOrder[$test->sortId()] = self::DEFECT_SORT_WEIGHT[$this->cache->getState($test->sortId())]; - $max = max($max, $this->defectSortOrder[$test->sortId()]); - } - } - - $this->defectSortOrder[$suite->sortId()] = $max; - } - - private function reverse(array $tests): array - { - return array_reverse($tests); - } - - private function randomize(array $tests): array - { - shuffle($tests); - - return $tests; - } - - private function sortDefectsFirst(array $tests): array - { - usort( - $tests, - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - function ($left, $right) - { - return $this->cmpDefectPriorityAndTime($left, $right); - } - ); - - return $tests; - } - - private function sortByDuration(array $tests): array - { - usort( - $tests, - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - function ($left, $right) - { - return $this->cmpDuration($left, $right); - } - ); - - return $tests; - } - - private function sortBySize(array $tests): array - { - usort( - $tests, - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - function ($left, $right) - { - return $this->cmpSize($left, $right); - } - ); - - return $tests; - } - - /** - * Comparator callback function to sort tests for "reach failure as fast as possible". - * - * 1. sort tests by defect weight defined in self::DEFECT_SORT_WEIGHT - * 2. when tests are equally defective, sort the fastest to the front - * 3. do not reorder successful tests - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - private function cmpDefectPriorityAndTime(Test $a, Test $b): int - { - if (!($a instanceof Reorderable && $b instanceof Reorderable)) { - return 0; - } - - $priorityA = $this->defectSortOrder[$a->sortId()] ?? 0; - $priorityB = $this->defectSortOrder[$b->sortId()] ?? 0; - - if ($priorityB <=> $priorityA) { - // Sort defect weight descending - return $priorityB <=> $priorityA; - } - - if ($priorityA || $priorityB) { - return $this->cmpDuration($a, $b); - } - - // do not change execution order - return 0; - } - - /** - * Compares test duration for sorting tests by duration ascending. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - private function cmpDuration(Test $a, Test $b): int - { - if (!($a instanceof Reorderable && $b instanceof Reorderable)) { - return 0; - } - - return $this->cache->getTime($a->sortId()) <=> $this->cache->getTime($b->sortId()); - } - - /** - * Compares test size for sorting tests small->medium->large->unknown. - */ - private function cmpSize(Test $a, Test $b): int - { - $sizeA = ($a instanceof TestCase || $a instanceof DataProviderTestSuite) - ? $a->getSize() - : TestUtil::UNKNOWN; - $sizeB = ($b instanceof TestCase || $b instanceof DataProviderTestSuite) - ? $b->getSize() - : TestUtil::UNKNOWN; - - return self::SIZE_SORT_WEIGHT[$sizeA] <=> self::SIZE_SORT_WEIGHT[$sizeB]; - } - - /** - * Reorder Tests within a TestCase in such a way as to resolve as many dependencies as possible. - * The algorithm will leave the tests in original running order when it can. - * For more details see the documentation for test dependencies. - * - * Short description of algorithm: - * 1. Pick the next Test from remaining tests to be checked for dependencies. - * 2. If the test has no dependencies: mark done, start again from the top - * 3. If the test has dependencies but none left to do: mark done, start again from the top - * 4. When we reach the end add any leftover tests to the end. These will be marked 'skipped' during execution. - * - * @param array $tests - * - * @return array - */ - private function resolveDependencies(array $tests): array - { - $newTestOrder = []; - $i = 0; - $provided = []; - - do { - if ([] === array_diff($tests[$i]->requires(), $provided)) { - $provided = array_merge($provided, $tests[$i]->provides()); - $newTestOrder = array_merge($newTestOrder, array_splice($tests, $i, 1)); - $i = 0; - } else { - $i++; - } - } while (!empty($tests) && ($i < count($tests))); - - return array_merge($newTestOrder, $tests); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - private function calculateTestExecutionOrder(Test $suite): array - { - $tests = []; - - if ($suite instanceof TestSuite) { - foreach ($suite->tests() as $test) { - if (!$test instanceof TestSuite && $test instanceof Reorderable) { - $tests[] = $test->sortId(); - } else { - $tests = array_merge($tests, $this->calculateTestExecutionOrder($test)); - } - } - } - - return $tests; - } -} diff --git a/vendor/phpunit/phpunit/src/Runner/Version.php b/vendor/phpunit/phpunit/src/Runner/Version.php deleted file mode 100644 index abedc67c..00000000 --- a/vendor/phpunit/phpunit/src/Runner/Version.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -use function array_slice; -use function dirname; -use function explode; -use function implode; -use function strpos; -use SebastianBergmann\Version as VersionId; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class Version -{ - /** - * @var string - */ - private static $pharVersion = ''; - - /** - * @var string - */ - private static $version = ''; - - /** - * Returns the current version of PHPUnit. - */ - public static function id(): string - { - if (self::$pharVersion !== '') { - return self::$pharVersion; - } - - if (self::$version === '') { - self::$version = (new VersionId('9.5.27', dirname(__DIR__, 2)))->getVersion(); - } - - return self::$version; - } - - public static function series(): string - { - if (strpos(self::id(), '-')) { - $version = explode('-', self::id())[0]; - } else { - $version = self::id(); - } - - return implode('.', array_slice(explode('.', $version), 0, 2)); - } - - public static function getVersionString(): string - { - return 'PHPUnit ' . self::id() . ' by Sebastian Bergmann and contributors.'; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/CliArguments/Builder.php b/vendor/phpunit/phpunit/src/TextUI/CliArguments/Builder.php deleted file mode 100644 index 9030b1db..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/CliArguments/Builder.php +++ /dev/null @@ -1,887 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\CliArguments; - -use function array_map; -use function array_merge; -use function class_exists; -use function explode; -use function is_numeric; -use function str_replace; -use PHPUnit\Runner\TestSuiteSorter; -use PHPUnit\TextUI\DefaultResultPrinter; -use PHPUnit\TextUI\XmlConfiguration\Extension; -use PHPUnit\Util\Log\TeamCity; -use PHPUnit\Util\TestDox\CliTestDoxPrinter; -use SebastianBergmann\CliParser\Exception as CliParserException; -use SebastianBergmann\CliParser\Parser as CliParser; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Builder -{ - private const LONG_OPTIONS = [ - 'atleast-version=', - 'prepend=', - 'bootstrap=', - 'cache-result', - 'do-not-cache-result', - 'cache-result-file=', - 'check-version', - 'colors==', - 'columns=', - 'configuration=', - 'coverage-cache=', - 'warm-coverage-cache', - 'coverage-filter=', - 'coverage-clover=', - 'coverage-cobertura=', - 'coverage-crap4j=', - 'coverage-html=', - 'coverage-php=', - 'coverage-text==', - 'coverage-xml=', - 'path-coverage', - 'debug', - 'disallow-test-output', - 'disallow-resource-usage', - 'disallow-todo-tests', - 'default-time-limit=', - 'enforce-time-limit', - 'exclude-group=', - 'extensions=', - 'filter=', - 'generate-configuration', - 'globals-backup', - 'group=', - 'covers=', - 'uses=', - 'help', - 'resolve-dependencies', - 'ignore-dependencies', - 'include-path=', - 'list-groups', - 'list-suites', - 'list-tests', - 'list-tests-xml=', - 'loader=', - 'log-junit=', - 'log-teamcity=', - 'migrate-configuration', - 'no-configuration', - 'no-coverage', - 'no-logging', - 'no-interaction', - 'no-extensions', - 'order-by=', - 'printer=', - 'process-isolation', - 'repeat=', - 'dont-report-useless-tests', - 'random-order', - 'random-order-seed=', - 'reverse-order', - 'reverse-list', - 'static-backup', - 'stderr', - 'stop-on-defect', - 'stop-on-error', - 'stop-on-failure', - 'stop-on-warning', - 'stop-on-incomplete', - 'stop-on-risky', - 'stop-on-skipped', - 'fail-on-empty-test-suite', - 'fail-on-incomplete', - 'fail-on-risky', - 'fail-on-skipped', - 'fail-on-warning', - 'strict-coverage', - 'disable-coverage-ignore', - 'strict-global-state', - 'teamcity', - 'testdox', - 'testdox-group=', - 'testdox-exclude-group=', - 'testdox-html=', - 'testdox-text=', - 'testdox-xml=', - 'test-suffix=', - 'testsuite=', - 'verbose', - 'version', - 'whitelist=', - 'dump-xdebug-filter=', - ]; - - private const SHORT_OPTIONS = 'd:c:hv'; - - public function fromParameters(array $parameters, array $additionalLongOptions): Configuration - { - try { - $options = (new CliParser)->parse( - $parameters, - self::SHORT_OPTIONS, - array_merge(self::LONG_OPTIONS, $additionalLongOptions) - ); - } catch (CliParserException $e) { - throw new Exception( - $e->getMessage(), - $e->getCode(), - $e - ); - } - - $argument = null; - $atLeastVersion = null; - $backupGlobals = null; - $backupStaticAttributes = null; - $beStrictAboutChangesToGlobalState = null; - $beStrictAboutResourceUsageDuringSmallTests = null; - $bootstrap = null; - $cacheResult = null; - $cacheResultFile = null; - $checkVersion = null; - $colors = null; - $columns = null; - $configuration = null; - $coverageCacheDirectory = null; - $warmCoverageCache = null; - $coverageFilter = null; - $coverageClover = null; - $coverageCobertura = null; - $coverageCrap4J = null; - $coverageHtml = null; - $coveragePhp = null; - $coverageText = null; - $coverageTextShowUncoveredFiles = null; - $coverageTextShowOnlySummary = null; - $coverageXml = null; - $pathCoverage = null; - $debug = null; - $defaultTimeLimit = null; - $disableCodeCoverageIgnore = null; - $disallowTestOutput = null; - $disallowTodoAnnotatedTests = null; - $enforceTimeLimit = null; - $excludeGroups = null; - $executionOrder = null; - $executionOrderDefects = null; - $extensions = []; - $unavailableExtensions = []; - $failOnEmptyTestSuite = null; - $failOnIncomplete = null; - $failOnRisky = null; - $failOnSkipped = null; - $failOnWarning = null; - $filter = null; - $generateConfiguration = null; - $migrateConfiguration = null; - $groups = null; - $testsCovering = null; - $testsUsing = null; - $help = null; - $includePath = null; - $iniSettings = []; - $junitLogfile = null; - $listGroups = null; - $listSuites = null; - $listTests = null; - $listTestsXml = null; - $loader = null; - $noCoverage = null; - $noExtensions = null; - $noInteraction = null; - $noLogging = null; - $printer = null; - $processIsolation = null; - $randomOrderSeed = null; - $repeat = null; - $reportUselessTests = null; - $resolveDependencies = null; - $reverseList = null; - $stderr = null; - $strictCoverage = null; - $stopOnDefect = null; - $stopOnError = null; - $stopOnFailure = null; - $stopOnIncomplete = null; - $stopOnRisky = null; - $stopOnSkipped = null; - $stopOnWarning = null; - $teamcityLogfile = null; - $testdoxExcludeGroups = null; - $testdoxGroups = null; - $testdoxHtmlFile = null; - $testdoxTextFile = null; - $testdoxXmlFile = null; - $testSuffixes = null; - $testSuite = null; - $unrecognizedOptions = []; - $unrecognizedOrderBy = null; - $useDefaultConfiguration = null; - $verbose = null; - $version = null; - $xdebugFilterFile = null; - - if (isset($options[1][0])) { - $argument = $options[1][0]; - } - - foreach ($options[0] as $option) { - switch ($option[0]) { - case '--colors': - $colors = $option[1] ?: DefaultResultPrinter::COLOR_AUTO; - - break; - - case '--bootstrap': - $bootstrap = $option[1]; - - break; - - case '--cache-result': - $cacheResult = true; - - break; - - case '--do-not-cache-result': - $cacheResult = false; - - break; - - case '--cache-result-file': - $cacheResultFile = $option[1]; - - break; - - case '--columns': - if (is_numeric($option[1])) { - $columns = (int) $option[1]; - } elseif ($option[1] === 'max') { - $columns = 'max'; - } - - break; - - case 'c': - case '--configuration': - $configuration = $option[1]; - - break; - - case '--coverage-cache': - $coverageCacheDirectory = $option[1]; - - break; - - case '--warm-coverage-cache': - $warmCoverageCache = true; - - break; - - case '--coverage-clover': - $coverageClover = $option[1]; - - break; - - case '--coverage-cobertura': - $coverageCobertura = $option[1]; - - break; - - case '--coverage-crap4j': - $coverageCrap4J = $option[1]; - - break; - - case '--coverage-html': - $coverageHtml = $option[1]; - - break; - - case '--coverage-php': - $coveragePhp = $option[1]; - - break; - - case '--coverage-text': - if ($option[1] === null) { - $option[1] = 'php://stdout'; - } - - $coverageText = $option[1]; - $coverageTextShowUncoveredFiles = false; - $coverageTextShowOnlySummary = false; - - break; - - case '--coverage-xml': - $coverageXml = $option[1]; - - break; - - case '--path-coverage': - $pathCoverage = true; - - break; - - case 'd': - $tmp = explode('=', $option[1]); - - if (isset($tmp[0])) { - if (isset($tmp[1])) { - $iniSettings[$tmp[0]] = $tmp[1]; - } else { - $iniSettings[$tmp[0]] = '1'; - } - } - - break; - - case '--debug': - $debug = true; - - break; - - case 'h': - case '--help': - $help = true; - - break; - - case '--filter': - $filter = $option[1]; - - break; - - case '--testsuite': - $testSuite = $option[1]; - - break; - - case '--generate-configuration': - $generateConfiguration = true; - - break; - - case '--migrate-configuration': - $migrateConfiguration = true; - - break; - - case '--group': - $groups = explode(',', $option[1]); - - break; - - case '--exclude-group': - $excludeGroups = explode(',', $option[1]); - - break; - - case '--covers': - $testsCovering = array_map('strtolower', explode(',', $option[1])); - - break; - - case '--uses': - $testsUsing = array_map('strtolower', explode(',', $option[1])); - - break; - - case '--test-suffix': - $testSuffixes = explode(',', $option[1]); - - break; - - case '--include-path': - $includePath = $option[1]; - - break; - - case '--list-groups': - $listGroups = true; - - break; - - case '--list-suites': - $listSuites = true; - - break; - - case '--list-tests': - $listTests = true; - - break; - - case '--list-tests-xml': - $listTestsXml = $option[1]; - - break; - - case '--printer': - $printer = $option[1]; - - break; - - case '--loader': - $loader = $option[1]; - - break; - - case '--log-junit': - $junitLogfile = $option[1]; - - break; - - case '--log-teamcity': - $teamcityLogfile = $option[1]; - - break; - - case '--order-by': - foreach (explode(',', $option[1]) as $order) { - switch ($order) { - case 'default': - $executionOrder = TestSuiteSorter::ORDER_DEFAULT; - $executionOrderDefects = TestSuiteSorter::ORDER_DEFAULT; - $resolveDependencies = true; - - break; - - case 'defects': - $executionOrderDefects = TestSuiteSorter::ORDER_DEFECTS_FIRST; - - break; - - case 'depends': - $resolveDependencies = true; - - break; - - case 'duration': - $executionOrder = TestSuiteSorter::ORDER_DURATION; - - break; - - case 'no-depends': - $resolveDependencies = false; - - break; - - case 'random': - $executionOrder = TestSuiteSorter::ORDER_RANDOMIZED; - - break; - - case 'reverse': - $executionOrder = TestSuiteSorter::ORDER_REVERSED; - - break; - - case 'size': - $executionOrder = TestSuiteSorter::ORDER_SIZE; - - break; - - default: - $unrecognizedOrderBy = $order; - } - } - - break; - - case '--process-isolation': - $processIsolation = true; - - break; - - case '--repeat': - $repeat = (int) $option[1]; - - break; - - case '--stderr': - $stderr = true; - - break; - - case '--stop-on-defect': - $stopOnDefect = true; - - break; - - case '--stop-on-error': - $stopOnError = true; - - break; - - case '--stop-on-failure': - $stopOnFailure = true; - - break; - - case '--stop-on-warning': - $stopOnWarning = true; - - break; - - case '--stop-on-incomplete': - $stopOnIncomplete = true; - - break; - - case '--stop-on-risky': - $stopOnRisky = true; - - break; - - case '--stop-on-skipped': - $stopOnSkipped = true; - - break; - - case '--fail-on-empty-test-suite': - $failOnEmptyTestSuite = true; - - break; - - case '--fail-on-incomplete': - $failOnIncomplete = true; - - break; - - case '--fail-on-risky': - $failOnRisky = true; - - break; - - case '--fail-on-skipped': - $failOnSkipped = true; - - break; - - case '--fail-on-warning': - $failOnWarning = true; - - break; - - case '--teamcity': - $printer = TeamCity::class; - - break; - - case '--testdox': - $printer = CliTestDoxPrinter::class; - - break; - - case '--testdox-group': - $testdoxGroups = explode(',', $option[1]); - - break; - - case '--testdox-exclude-group': - $testdoxExcludeGroups = explode(',', $option[1]); - - break; - - case '--testdox-html': - $testdoxHtmlFile = $option[1]; - - break; - - case '--testdox-text': - $testdoxTextFile = $option[1]; - - break; - - case '--testdox-xml': - $testdoxXmlFile = $option[1]; - - break; - - case '--no-configuration': - $useDefaultConfiguration = false; - - break; - - case '--extensions': - foreach (explode(',', $option[1]) as $extensionClass) { - if (!class_exists($extensionClass)) { - $unavailableExtensions[] = $extensionClass; - - continue; - } - - $extensions[] = new Extension($extensionClass, '', []); - } - - break; - - case '--no-extensions': - $noExtensions = true; - - break; - - case '--no-coverage': - $noCoverage = true; - - break; - - case '--no-logging': - $noLogging = true; - - break; - - case '--no-interaction': - $noInteraction = true; - - break; - - case '--globals-backup': - $backupGlobals = true; - - break; - - case '--static-backup': - $backupStaticAttributes = true; - - break; - - case 'v': - case '--verbose': - $verbose = true; - - break; - - case '--atleast-version': - $atLeastVersion = $option[1]; - - break; - - case '--version': - $version = true; - - break; - - case '--dont-report-useless-tests': - $reportUselessTests = false; - - break; - - case '--strict-coverage': - $strictCoverage = true; - - break; - - case '--disable-coverage-ignore': - $disableCodeCoverageIgnore = true; - - break; - - case '--strict-global-state': - $beStrictAboutChangesToGlobalState = true; - - break; - - case '--disallow-test-output': - $disallowTestOutput = true; - - break; - - case '--disallow-resource-usage': - $beStrictAboutResourceUsageDuringSmallTests = true; - - break; - - case '--default-time-limit': - $defaultTimeLimit = (int) $option[1]; - - break; - - case '--enforce-time-limit': - $enforceTimeLimit = true; - - break; - - case '--disallow-todo-tests': - $disallowTodoAnnotatedTests = true; - - break; - - case '--reverse-list': - $reverseList = true; - - break; - - case '--check-version': - $checkVersion = true; - - break; - - case '--coverage-filter': - case '--whitelist': - if ($coverageFilter === null) { - $coverageFilter = []; - } - - $coverageFilter[] = $option[1]; - - break; - - case '--random-order': - $executionOrder = TestSuiteSorter::ORDER_RANDOMIZED; - - break; - - case '--random-order-seed': - $randomOrderSeed = (int) $option[1]; - - break; - - case '--resolve-dependencies': - $resolveDependencies = true; - - break; - - case '--ignore-dependencies': - $resolveDependencies = false; - - break; - - case '--reverse-order': - $executionOrder = TestSuiteSorter::ORDER_REVERSED; - - break; - - case '--dump-xdebug-filter': - $xdebugFilterFile = $option[1]; - - break; - - default: - $unrecognizedOptions[str_replace('--', '', $option[0])] = $option[1]; - } - } - - if (empty($extensions)) { - $extensions = null; - } - - if (empty($unavailableExtensions)) { - $unavailableExtensions = null; - } - - if (empty($iniSettings)) { - $iniSettings = null; - } - - if (empty($coverageFilter)) { - $coverageFilter = null; - } - - return new Configuration( - $argument, - $atLeastVersion, - $backupGlobals, - $backupStaticAttributes, - $beStrictAboutChangesToGlobalState, - $beStrictAboutResourceUsageDuringSmallTests, - $bootstrap, - $cacheResult, - $cacheResultFile, - $checkVersion, - $colors, - $columns, - $configuration, - $coverageClover, - $coverageCobertura, - $coverageCrap4J, - $coverageHtml, - $coveragePhp, - $coverageText, - $coverageTextShowUncoveredFiles, - $coverageTextShowOnlySummary, - $coverageXml, - $pathCoverage, - $coverageCacheDirectory, - $warmCoverageCache, - $debug, - $defaultTimeLimit, - $disableCodeCoverageIgnore, - $disallowTestOutput, - $disallowTodoAnnotatedTests, - $enforceTimeLimit, - $excludeGroups, - $executionOrder, - $executionOrderDefects, - $extensions, - $unavailableExtensions, - $failOnEmptyTestSuite, - $failOnIncomplete, - $failOnRisky, - $failOnSkipped, - $failOnWarning, - $filter, - $generateConfiguration, - $migrateConfiguration, - $groups, - $testsCovering, - $testsUsing, - $help, - $includePath, - $iniSettings, - $junitLogfile, - $listGroups, - $listSuites, - $listTests, - $listTestsXml, - $loader, - $noCoverage, - $noExtensions, - $noInteraction, - $noLogging, - $printer, - $processIsolation, - $randomOrderSeed, - $repeat, - $reportUselessTests, - $resolveDependencies, - $reverseList, - $stderr, - $strictCoverage, - $stopOnDefect, - $stopOnError, - $stopOnFailure, - $stopOnIncomplete, - $stopOnRisky, - $stopOnSkipped, - $stopOnWarning, - $teamcityLogfile, - $testdoxExcludeGroups, - $testdoxGroups, - $testdoxHtmlFile, - $testdoxTextFile, - $testdoxXmlFile, - $testSuffixes, - $testSuite, - $unrecognizedOptions, - $unrecognizedOrderBy, - $useDefaultConfiguration, - $verbose, - $version, - $coverageFilter, - $xdebugFilterFile - ); - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/CliArguments/Configuration.php b/vendor/phpunit/phpunit/src/TextUI/CliArguments/Configuration.php deleted file mode 100644 index 51bf5cb8..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/CliArguments/Configuration.php +++ /dev/null @@ -1,2108 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\CliArguments; - -use PHPUnit\TextUI\XmlConfiguration\Extension; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class Configuration -{ - /** - * @var ?string - */ - private $argument; - - /** - * @var ?string - */ - private $atLeastVersion; - - /** - * @var ?bool - */ - private $backupGlobals; - - /** - * @var ?bool - */ - private $backupStaticAttributes; - - /** - * @var ?bool - */ - private $beStrictAboutChangesToGlobalState; - - /** - * @var ?bool - */ - private $beStrictAboutResourceUsageDuringSmallTests; - - /** - * @var ?string - */ - private $bootstrap; - - /** - * @var ?bool - */ - private $cacheResult; - - /** - * @var ?string - */ - private $cacheResultFile; - - /** - * @var ?bool - */ - private $checkVersion; - - /** - * @var ?string - */ - private $colors; - - /** - * @var null|int|string - */ - private $columns; - - /** - * @var ?string - */ - private $configuration; - - /** - * @var null|string[] - */ - private $coverageFilter; - - /** - * @var ?string - */ - private $coverageClover; - - /** - * @var ?string - */ - private $coverageCobertura; - - /** - * @var ?string - */ - private $coverageCrap4J; - - /** - * @var ?string - */ - private $coverageHtml; - - /** - * @var ?string - */ - private $coveragePhp; - - /** - * @var ?string - */ - private $coverageText; - - /** - * @var ?bool - */ - private $coverageTextShowUncoveredFiles; - - /** - * @var ?bool - */ - private $coverageTextShowOnlySummary; - - /** - * @var ?string - */ - private $coverageXml; - - /** - * @var ?bool - */ - private $pathCoverage; - - /** - * @var ?string - */ - private $coverageCacheDirectory; - - /** - * @var ?bool - */ - private $warmCoverageCache; - - /** - * @var ?bool - */ - private $debug; - - /** - * @var ?int - */ - private $defaultTimeLimit; - - /** - * @var ?bool - */ - private $disableCodeCoverageIgnore; - - /** - * @var ?bool - */ - private $disallowTestOutput; - - /** - * @var ?bool - */ - private $disallowTodoAnnotatedTests; - - /** - * @var ?bool - */ - private $enforceTimeLimit; - - /** - * @var null|string[] - */ - private $excludeGroups; - - /** - * @var ?int - */ - private $executionOrder; - - /** - * @var ?int - */ - private $executionOrderDefects; - - /** - * @var null|Extension[] - */ - private $extensions; - - /** - * @var null|string[] - */ - private $unavailableExtensions; - - /** - * @var ?bool - */ - private $failOnEmptyTestSuite; - - /** - * @var ?bool - */ - private $failOnIncomplete; - - /** - * @var ?bool - */ - private $failOnRisky; - - /** - * @var ?bool - */ - private $failOnSkipped; - - /** - * @var ?bool - */ - private $failOnWarning; - - /** - * @var ?string - */ - private $filter; - - /** - * @var ?bool - */ - private $generateConfiguration; - - /** - * @var ?bool - */ - private $migrateConfiguration; - - /** - * @var null|string[] - */ - private $groups; - - /** - * @var null|string[] - */ - private $testsCovering; - - /** - * @var null|string[] - */ - private $testsUsing; - - /** - * @var ?bool - */ - private $help; - - /** - * @var ?string - */ - private $includePath; - - /** - * @var null|string[] - */ - private $iniSettings; - - /** - * @var ?string - */ - private $junitLogfile; - - /** - * @var ?bool - */ - private $listGroups; - - /** - * @var ?bool - */ - private $listSuites; - - /** - * @var ?bool - */ - private $listTests; - - /** - * @var ?string - */ - private $listTestsXml; - - /** - * @var ?string - */ - private $loader; - - /** - * @var ?bool - */ - private $noCoverage; - - /** - * @var ?bool - */ - private $noExtensions; - - /** - * @var ?bool - */ - private $noInteraction; - - /** - * @var ?bool - */ - private $noLogging; - - /** - * @var ?string - */ - private $printer; - - /** - * @var ?bool - */ - private $processIsolation; - - /** - * @var ?int - */ - private $randomOrderSeed; - - /** - * @var ?int - */ - private $repeat; - - /** - * @var ?bool - */ - private $reportUselessTests; - - /** - * @var ?bool - */ - private $resolveDependencies; - - /** - * @var ?bool - */ - private $reverseList; - - /** - * @var ?bool - */ - private $stderr; - - /** - * @var ?bool - */ - private $strictCoverage; - - /** - * @var ?bool - */ - private $stopOnDefect; - - /** - * @var ?bool - */ - private $stopOnError; - - /** - * @var ?bool - */ - private $stopOnFailure; - - /** - * @var ?bool - */ - private $stopOnIncomplete; - - /** - * @var ?bool - */ - private $stopOnRisky; - - /** - * @var ?bool - */ - private $stopOnSkipped; - - /** - * @var ?bool - */ - private $stopOnWarning; - - /** - * @var ?string - */ - private $teamcityLogfile; - - /** - * @var null|string[] - */ - private $testdoxExcludeGroups; - - /** - * @var null|string[] - */ - private $testdoxGroups; - - /** - * @var ?string - */ - private $testdoxHtmlFile; - - /** - * @var ?string - */ - private $testdoxTextFile; - - /** - * @var ?string - */ - private $testdoxXmlFile; - - /** - * @var null|string[] - */ - private $testSuffixes; - - /** - * @var ?string - */ - private $testSuite; - - /** - * @var string[] - */ - private $unrecognizedOptions; - - /** - * @var ?string - */ - private $unrecognizedOrderBy; - - /** - * @var ?bool - */ - private $useDefaultConfiguration; - - /** - * @var ?bool - */ - private $verbose; - - /** - * @var ?bool - */ - private $version; - - /** - * @var ?string - */ - private $xdebugFilterFile; - - /** - * @param null|int|string $columns - */ - public function __construct(?string $argument, ?string $atLeastVersion, ?bool $backupGlobals, ?bool $backupStaticAttributes, ?bool $beStrictAboutChangesToGlobalState, ?bool $beStrictAboutResourceUsageDuringSmallTests, ?string $bootstrap, ?bool $cacheResult, ?string $cacheResultFile, ?bool $checkVersion, ?string $colors, $columns, ?string $configuration, ?string $coverageClover, ?string $coverageCobertura, ?string $coverageCrap4J, ?string $coverageHtml, ?string $coveragePhp, ?string $coverageText, ?bool $coverageTextShowUncoveredFiles, ?bool $coverageTextShowOnlySummary, ?string $coverageXml, ?bool $pathCoverage, ?string $coverageCacheDirectory, ?bool $warmCoverageCache, ?bool $debug, ?int $defaultTimeLimit, ?bool $disableCodeCoverageIgnore, ?bool $disallowTestOutput, ?bool $disallowTodoAnnotatedTests, ?bool $enforceTimeLimit, ?array $excludeGroups, ?int $executionOrder, ?int $executionOrderDefects, ?array $extensions, ?array $unavailableExtensions, ?bool $failOnEmptyTestSuite, ?bool $failOnIncomplete, ?bool $failOnRisky, ?bool $failOnSkipped, ?bool $failOnWarning, ?string $filter, ?bool $generateConfiguration, ?bool $migrateConfiguration, ?array $groups, ?array $testsCovering, ?array $testsUsing, ?bool $help, ?string $includePath, ?array $iniSettings, ?string $junitLogfile, ?bool $listGroups, ?bool $listSuites, ?bool $listTests, ?string $listTestsXml, ?string $loader, ?bool $noCoverage, ?bool $noExtensions, ?bool $noInteraction, ?bool $noLogging, ?string $printer, ?bool $processIsolation, ?int $randomOrderSeed, ?int $repeat, ?bool $reportUselessTests, ?bool $resolveDependencies, ?bool $reverseList, ?bool $stderr, ?bool $strictCoverage, ?bool $stopOnDefect, ?bool $stopOnError, ?bool $stopOnFailure, ?bool $stopOnIncomplete, ?bool $stopOnRisky, ?bool $stopOnSkipped, ?bool $stopOnWarning, ?string $teamcityLogfile, ?array $testdoxExcludeGroups, ?array $testdoxGroups, ?string $testdoxHtmlFile, ?string $testdoxTextFile, ?string $testdoxXmlFile, ?array $testSuffixes, ?string $testSuite, array $unrecognizedOptions, ?string $unrecognizedOrderBy, ?bool $useDefaultConfiguration, ?bool $verbose, ?bool $version, ?array $coverageFilter, ?string $xdebugFilterFile) - { - $this->argument = $argument; - $this->atLeastVersion = $atLeastVersion; - $this->backupGlobals = $backupGlobals; - $this->backupStaticAttributes = $backupStaticAttributes; - $this->beStrictAboutChangesToGlobalState = $beStrictAboutChangesToGlobalState; - $this->beStrictAboutResourceUsageDuringSmallTests = $beStrictAboutResourceUsageDuringSmallTests; - $this->bootstrap = $bootstrap; - $this->cacheResult = $cacheResult; - $this->cacheResultFile = $cacheResultFile; - $this->checkVersion = $checkVersion; - $this->colors = $colors; - $this->columns = $columns; - $this->configuration = $configuration; - $this->coverageFilter = $coverageFilter; - $this->coverageClover = $coverageClover; - $this->coverageCobertura = $coverageCobertura; - $this->coverageCrap4J = $coverageCrap4J; - $this->coverageHtml = $coverageHtml; - $this->coveragePhp = $coveragePhp; - $this->coverageText = $coverageText; - $this->coverageTextShowUncoveredFiles = $coverageTextShowUncoveredFiles; - $this->coverageTextShowOnlySummary = $coverageTextShowOnlySummary; - $this->coverageXml = $coverageXml; - $this->pathCoverage = $pathCoverage; - $this->coverageCacheDirectory = $coverageCacheDirectory; - $this->warmCoverageCache = $warmCoverageCache; - $this->debug = $debug; - $this->defaultTimeLimit = $defaultTimeLimit; - $this->disableCodeCoverageIgnore = $disableCodeCoverageIgnore; - $this->disallowTestOutput = $disallowTestOutput; - $this->disallowTodoAnnotatedTests = $disallowTodoAnnotatedTests; - $this->enforceTimeLimit = $enforceTimeLimit; - $this->excludeGroups = $excludeGroups; - $this->executionOrder = $executionOrder; - $this->executionOrderDefects = $executionOrderDefects; - $this->extensions = $extensions; - $this->unavailableExtensions = $unavailableExtensions; - $this->failOnEmptyTestSuite = $failOnEmptyTestSuite; - $this->failOnIncomplete = $failOnIncomplete; - $this->failOnRisky = $failOnRisky; - $this->failOnSkipped = $failOnSkipped; - $this->failOnWarning = $failOnWarning; - $this->filter = $filter; - $this->generateConfiguration = $generateConfiguration; - $this->migrateConfiguration = $migrateConfiguration; - $this->groups = $groups; - $this->testsCovering = $testsCovering; - $this->testsUsing = $testsUsing; - $this->help = $help; - $this->includePath = $includePath; - $this->iniSettings = $iniSettings; - $this->junitLogfile = $junitLogfile; - $this->listGroups = $listGroups; - $this->listSuites = $listSuites; - $this->listTests = $listTests; - $this->listTestsXml = $listTestsXml; - $this->loader = $loader; - $this->noCoverage = $noCoverage; - $this->noExtensions = $noExtensions; - $this->noInteraction = $noInteraction; - $this->noLogging = $noLogging; - $this->printer = $printer; - $this->processIsolation = $processIsolation; - $this->randomOrderSeed = $randomOrderSeed; - $this->repeat = $repeat; - $this->reportUselessTests = $reportUselessTests; - $this->resolveDependencies = $resolveDependencies; - $this->reverseList = $reverseList; - $this->stderr = $stderr; - $this->strictCoverage = $strictCoverage; - $this->stopOnDefect = $stopOnDefect; - $this->stopOnError = $stopOnError; - $this->stopOnFailure = $stopOnFailure; - $this->stopOnIncomplete = $stopOnIncomplete; - $this->stopOnRisky = $stopOnRisky; - $this->stopOnSkipped = $stopOnSkipped; - $this->stopOnWarning = $stopOnWarning; - $this->teamcityLogfile = $teamcityLogfile; - $this->testdoxExcludeGroups = $testdoxExcludeGroups; - $this->testdoxGroups = $testdoxGroups; - $this->testdoxHtmlFile = $testdoxHtmlFile; - $this->testdoxTextFile = $testdoxTextFile; - $this->testdoxXmlFile = $testdoxXmlFile; - $this->testSuffixes = $testSuffixes; - $this->testSuite = $testSuite; - $this->unrecognizedOptions = $unrecognizedOptions; - $this->unrecognizedOrderBy = $unrecognizedOrderBy; - $this->useDefaultConfiguration = $useDefaultConfiguration; - $this->verbose = $verbose; - $this->version = $version; - $this->xdebugFilterFile = $xdebugFilterFile; - } - - public function hasArgument(): bool - { - return $this->argument !== null; - } - - /** - * @throws Exception - */ - public function argument(): string - { - if ($this->argument === null) { - throw new Exception; - } - - return $this->argument; - } - - public function hasAtLeastVersion(): bool - { - return $this->atLeastVersion !== null; - } - - /** - * @throws Exception - */ - public function atLeastVersion(): string - { - if ($this->atLeastVersion === null) { - throw new Exception; - } - - return $this->atLeastVersion; - } - - public function hasBackupGlobals(): bool - { - return $this->backupGlobals !== null; - } - - /** - * @throws Exception - */ - public function backupGlobals(): bool - { - if ($this->backupGlobals === null) { - throw new Exception; - } - - return $this->backupGlobals; - } - - public function hasBackupStaticAttributes(): bool - { - return $this->backupStaticAttributes !== null; - } - - /** - * @throws Exception - */ - public function backupStaticAttributes(): bool - { - if ($this->backupStaticAttributes === null) { - throw new Exception; - } - - return $this->backupStaticAttributes; - } - - public function hasBeStrictAboutChangesToGlobalState(): bool - { - return $this->beStrictAboutChangesToGlobalState !== null; - } - - /** - * @throws Exception - */ - public function beStrictAboutChangesToGlobalState(): bool - { - if ($this->beStrictAboutChangesToGlobalState === null) { - throw new Exception; - } - - return $this->beStrictAboutChangesToGlobalState; - } - - public function hasBeStrictAboutResourceUsageDuringSmallTests(): bool - { - return $this->beStrictAboutResourceUsageDuringSmallTests !== null; - } - - /** - * @throws Exception - */ - public function beStrictAboutResourceUsageDuringSmallTests(): bool - { - if ($this->beStrictAboutResourceUsageDuringSmallTests === null) { - throw new Exception; - } - - return $this->beStrictAboutResourceUsageDuringSmallTests; - } - - public function hasBootstrap(): bool - { - return $this->bootstrap !== null; - } - - /** - * @throws Exception - */ - public function bootstrap(): string - { - if ($this->bootstrap === null) { - throw new Exception; - } - - return $this->bootstrap; - } - - public function hasCacheResult(): bool - { - return $this->cacheResult !== null; - } - - /** - * @throws Exception - */ - public function cacheResult(): bool - { - if ($this->cacheResult === null) { - throw new Exception; - } - - return $this->cacheResult; - } - - public function hasCacheResultFile(): bool - { - return $this->cacheResultFile !== null; - } - - /** - * @throws Exception - */ - public function cacheResultFile(): string - { - if ($this->cacheResultFile === null) { - throw new Exception; - } - - return $this->cacheResultFile; - } - - public function hasCheckVersion(): bool - { - return $this->checkVersion !== null; - } - - /** - * @throws Exception - */ - public function checkVersion(): bool - { - if ($this->checkVersion === null) { - throw new Exception; - } - - return $this->checkVersion; - } - - public function hasColors(): bool - { - return $this->colors !== null; - } - - /** - * @throws Exception - */ - public function colors(): string - { - if ($this->colors === null) { - throw new Exception; - } - - return $this->colors; - } - - public function hasColumns(): bool - { - return $this->columns !== null; - } - - /** - * @throws Exception - */ - public function columns() - { - if ($this->columns === null) { - throw new Exception; - } - - return $this->columns; - } - - public function hasConfiguration(): bool - { - return $this->configuration !== null; - } - - /** - * @throws Exception - */ - public function configuration(): string - { - if ($this->configuration === null) { - throw new Exception; - } - - return $this->configuration; - } - - public function hasCoverageFilter(): bool - { - return $this->coverageFilter !== null; - } - - /** - * @throws Exception - */ - public function coverageFilter(): array - { - if ($this->coverageFilter === null) { - throw new Exception; - } - - return $this->coverageFilter; - } - - public function hasCoverageClover(): bool - { - return $this->coverageClover !== null; - } - - /** - * @throws Exception - */ - public function coverageClover(): string - { - if ($this->coverageClover === null) { - throw new Exception; - } - - return $this->coverageClover; - } - - public function hasCoverageCobertura(): bool - { - return $this->coverageCobertura !== null; - } - - /** - * @throws Exception - */ - public function coverageCobertura(): string - { - if ($this->coverageCobertura === null) { - throw new Exception; - } - - return $this->coverageCobertura; - } - - public function hasCoverageCrap4J(): bool - { - return $this->coverageCrap4J !== null; - } - - /** - * @throws Exception - */ - public function coverageCrap4J(): string - { - if ($this->coverageCrap4J === null) { - throw new Exception; - } - - return $this->coverageCrap4J; - } - - public function hasCoverageHtml(): bool - { - return $this->coverageHtml !== null; - } - - /** - * @throws Exception - */ - public function coverageHtml(): string - { - if ($this->coverageHtml === null) { - throw new Exception; - } - - return $this->coverageHtml; - } - - public function hasCoveragePhp(): bool - { - return $this->coveragePhp !== null; - } - - /** - * @throws Exception - */ - public function coveragePhp(): string - { - if ($this->coveragePhp === null) { - throw new Exception; - } - - return $this->coveragePhp; - } - - public function hasCoverageText(): bool - { - return $this->coverageText !== null; - } - - /** - * @throws Exception - */ - public function coverageText(): string - { - if ($this->coverageText === null) { - throw new Exception; - } - - return $this->coverageText; - } - - public function hasCoverageTextShowUncoveredFiles(): bool - { - return $this->coverageTextShowUncoveredFiles !== null; - } - - /** - * @throws Exception - */ - public function coverageTextShowUncoveredFiles(): bool - { - if ($this->coverageTextShowUncoveredFiles === null) { - throw new Exception; - } - - return $this->coverageTextShowUncoveredFiles; - } - - public function hasCoverageTextShowOnlySummary(): bool - { - return $this->coverageTextShowOnlySummary !== null; - } - - /** - * @throws Exception - */ - public function coverageTextShowOnlySummary(): bool - { - if ($this->coverageTextShowOnlySummary === null) { - throw new Exception; - } - - return $this->coverageTextShowOnlySummary; - } - - public function hasCoverageXml(): bool - { - return $this->coverageXml !== null; - } - - /** - * @throws Exception - */ - public function coverageXml(): string - { - if ($this->coverageXml === null) { - throw new Exception; - } - - return $this->coverageXml; - } - - public function hasPathCoverage(): bool - { - return $this->pathCoverage !== null; - } - - /** - * @throws Exception - */ - public function pathCoverage(): bool - { - if ($this->pathCoverage === null) { - throw new Exception; - } - - return $this->pathCoverage; - } - - public function hasCoverageCacheDirectory(): bool - { - return $this->coverageCacheDirectory !== null; - } - - /** - * @throws Exception - */ - public function coverageCacheDirectory(): string - { - if ($this->coverageCacheDirectory === null) { - throw new Exception; - } - - return $this->coverageCacheDirectory; - } - - public function hasWarmCoverageCache(): bool - { - return $this->warmCoverageCache !== null; - } - - /** - * @throws Exception - */ - public function warmCoverageCache(): bool - { - if ($this->warmCoverageCache === null) { - throw new Exception; - } - - return $this->warmCoverageCache; - } - - public function hasDebug(): bool - { - return $this->debug !== null; - } - - /** - * @throws Exception - */ - public function debug(): bool - { - if ($this->debug === null) { - throw new Exception; - } - - return $this->debug; - } - - public function hasDefaultTimeLimit(): bool - { - return $this->defaultTimeLimit !== null; - } - - /** - * @throws Exception - */ - public function defaultTimeLimit(): int - { - if ($this->defaultTimeLimit === null) { - throw new Exception; - } - - return $this->defaultTimeLimit; - } - - public function hasDisableCodeCoverageIgnore(): bool - { - return $this->disableCodeCoverageIgnore !== null; - } - - /** - * @throws Exception - */ - public function disableCodeCoverageIgnore(): bool - { - if ($this->disableCodeCoverageIgnore === null) { - throw new Exception; - } - - return $this->disableCodeCoverageIgnore; - } - - public function hasDisallowTestOutput(): bool - { - return $this->disallowTestOutput !== null; - } - - /** - * @throws Exception - */ - public function disallowTestOutput(): bool - { - if ($this->disallowTestOutput === null) { - throw new Exception; - } - - return $this->disallowTestOutput; - } - - public function hasDisallowTodoAnnotatedTests(): bool - { - return $this->disallowTodoAnnotatedTests !== null; - } - - /** - * @throws Exception - */ - public function disallowTodoAnnotatedTests(): bool - { - if ($this->disallowTodoAnnotatedTests === null) { - throw new Exception; - } - - return $this->disallowTodoAnnotatedTests; - } - - public function hasEnforceTimeLimit(): bool - { - return $this->enforceTimeLimit !== null; - } - - /** - * @throws Exception - */ - public function enforceTimeLimit(): bool - { - if ($this->enforceTimeLimit === null) { - throw new Exception; - } - - return $this->enforceTimeLimit; - } - - public function hasExcludeGroups(): bool - { - return $this->excludeGroups !== null; - } - - /** - * @throws Exception - */ - public function excludeGroups(): array - { - if ($this->excludeGroups === null) { - throw new Exception; - } - - return $this->excludeGroups; - } - - public function hasExecutionOrder(): bool - { - return $this->executionOrder !== null; - } - - /** - * @throws Exception - */ - public function executionOrder(): int - { - if ($this->executionOrder === null) { - throw new Exception; - } - - return $this->executionOrder; - } - - public function hasExecutionOrderDefects(): bool - { - return $this->executionOrderDefects !== null; - } - - /** - * @throws Exception - */ - public function executionOrderDefects(): int - { - if ($this->executionOrderDefects === null) { - throw new Exception; - } - - return $this->executionOrderDefects; - } - - public function hasFailOnEmptyTestSuite(): bool - { - return $this->failOnEmptyTestSuite !== null; - } - - /** - * @throws Exception - */ - public function failOnEmptyTestSuite(): bool - { - if ($this->failOnEmptyTestSuite === null) { - throw new Exception; - } - - return $this->failOnEmptyTestSuite; - } - - public function hasFailOnIncomplete(): bool - { - return $this->failOnIncomplete !== null; - } - - /** - * @throws Exception - */ - public function failOnIncomplete(): bool - { - if ($this->failOnIncomplete === null) { - throw new Exception; - } - - return $this->failOnIncomplete; - } - - public function hasFailOnRisky(): bool - { - return $this->failOnRisky !== null; - } - - /** - * @throws Exception - */ - public function failOnRisky(): bool - { - if ($this->failOnRisky === null) { - throw new Exception; - } - - return $this->failOnRisky; - } - - public function hasFailOnSkipped(): bool - { - return $this->failOnSkipped !== null; - } - - /** - * @throws Exception - */ - public function failOnSkipped(): bool - { - if ($this->failOnSkipped === null) { - throw new Exception; - } - - return $this->failOnSkipped; - } - - public function hasFailOnWarning(): bool - { - return $this->failOnWarning !== null; - } - - /** - * @throws Exception - */ - public function failOnWarning(): bool - { - if ($this->failOnWarning === null) { - throw new Exception; - } - - return $this->failOnWarning; - } - - public function hasFilter(): bool - { - return $this->filter !== null; - } - - /** - * @throws Exception - */ - public function filter(): string - { - if ($this->filter === null) { - throw new Exception; - } - - return $this->filter; - } - - public function hasGenerateConfiguration(): bool - { - return $this->generateConfiguration !== null; - } - - /** - * @throws Exception - */ - public function generateConfiguration(): bool - { - if ($this->generateConfiguration === null) { - throw new Exception; - } - - return $this->generateConfiguration; - } - - public function hasMigrateConfiguration(): bool - { - return $this->migrateConfiguration !== null; - } - - /** - * @throws Exception - */ - public function migrateConfiguration(): bool - { - if ($this->migrateConfiguration === null) { - throw new Exception; - } - - return $this->migrateConfiguration; - } - - public function hasGroups(): bool - { - return $this->groups !== null; - } - - /** - * @throws Exception - */ - public function groups(): array - { - if ($this->groups === null) { - throw new Exception; - } - - return $this->groups; - } - - public function hasTestsCovering(): bool - { - return $this->testsCovering !== null; - } - - /** - * @throws Exception - */ - public function testsCovering(): array - { - if ($this->testsCovering === null) { - throw new Exception; - } - - return $this->testsCovering; - } - - public function hasTestsUsing(): bool - { - return $this->testsUsing !== null; - } - - /** - * @throws Exception - */ - public function testsUsing(): array - { - if ($this->testsUsing === null) { - throw new Exception; - } - - return $this->testsUsing; - } - - public function hasHelp(): bool - { - return $this->help !== null; - } - - /** - * @throws Exception - */ - public function help(): bool - { - if ($this->help === null) { - throw new Exception; - } - - return $this->help; - } - - public function hasIncludePath(): bool - { - return $this->includePath !== null; - } - - /** - * @throws Exception - */ - public function includePath(): string - { - if ($this->includePath === null) { - throw new Exception; - } - - return $this->includePath; - } - - public function hasIniSettings(): bool - { - return $this->iniSettings !== null; - } - - /** - * @throws Exception - */ - public function iniSettings(): array - { - if ($this->iniSettings === null) { - throw new Exception; - } - - return $this->iniSettings; - } - - public function hasJunitLogfile(): bool - { - return $this->junitLogfile !== null; - } - - /** - * @throws Exception - */ - public function junitLogfile(): string - { - if ($this->junitLogfile === null) { - throw new Exception; - } - - return $this->junitLogfile; - } - - public function hasListGroups(): bool - { - return $this->listGroups !== null; - } - - /** - * @throws Exception - */ - public function listGroups(): bool - { - if ($this->listGroups === null) { - throw new Exception; - } - - return $this->listGroups; - } - - public function hasListSuites(): bool - { - return $this->listSuites !== null; - } - - /** - * @throws Exception - */ - public function listSuites(): bool - { - if ($this->listSuites === null) { - throw new Exception; - } - - return $this->listSuites; - } - - public function hasListTests(): bool - { - return $this->listTests !== null; - } - - /** - * @throws Exception - */ - public function listTests(): bool - { - if ($this->listTests === null) { - throw new Exception; - } - - return $this->listTests; - } - - public function hasListTestsXml(): bool - { - return $this->listTestsXml !== null; - } - - /** - * @throws Exception - */ - public function listTestsXml(): string - { - if ($this->listTestsXml === null) { - throw new Exception; - } - - return $this->listTestsXml; - } - - public function hasLoader(): bool - { - return $this->loader !== null; - } - - /** - * @throws Exception - */ - public function loader(): string - { - if ($this->loader === null) { - throw new Exception; - } - - return $this->loader; - } - - public function hasNoCoverage(): bool - { - return $this->noCoverage !== null; - } - - /** - * @throws Exception - */ - public function noCoverage(): bool - { - if ($this->noCoverage === null) { - throw new Exception; - } - - return $this->noCoverage; - } - - public function hasNoExtensions(): bool - { - return $this->noExtensions !== null; - } - - /** - * @throws Exception - */ - public function noExtensions(): bool - { - if ($this->noExtensions === null) { - throw new Exception; - } - - return $this->noExtensions; - } - - public function hasExtensions(): bool - { - return $this->extensions !== null; - } - - /** - * @throws Exception - */ - public function extensions(): array - { - if ($this->extensions === null) { - throw new Exception; - } - - return $this->extensions; - } - - public function hasUnavailableExtensions(): bool - { - return $this->unavailableExtensions !== null; - } - - /** - * @throws Exception - */ - public function unavailableExtensions(): array - { - if ($this->unavailableExtensions === null) { - throw new Exception; - } - - return $this->unavailableExtensions; - } - - public function hasNoInteraction(): bool - { - return $this->noInteraction !== null; - } - - /** - * @throws Exception - */ - public function noInteraction(): bool - { - if ($this->noInteraction === null) { - throw new Exception; - } - - return $this->noInteraction; - } - - public function hasNoLogging(): bool - { - return $this->noLogging !== null; - } - - /** - * @throws Exception - */ - public function noLogging(): bool - { - if ($this->noLogging === null) { - throw new Exception; - } - - return $this->noLogging; - } - - public function hasPrinter(): bool - { - return $this->printer !== null; - } - - /** - * @throws Exception - */ - public function printer(): string - { - if ($this->printer === null) { - throw new Exception; - } - - return $this->printer; - } - - public function hasProcessIsolation(): bool - { - return $this->processIsolation !== null; - } - - /** - * @throws Exception - */ - public function processIsolation(): bool - { - if ($this->processIsolation === null) { - throw new Exception; - } - - return $this->processIsolation; - } - - public function hasRandomOrderSeed(): bool - { - return $this->randomOrderSeed !== null; - } - - /** - * @throws Exception - */ - public function randomOrderSeed(): int - { - if ($this->randomOrderSeed === null) { - throw new Exception; - } - - return $this->randomOrderSeed; - } - - public function hasRepeat(): bool - { - return $this->repeat !== null; - } - - /** - * @throws Exception - */ - public function repeat(): int - { - if ($this->repeat === null) { - throw new Exception; - } - - return $this->repeat; - } - - public function hasReportUselessTests(): bool - { - return $this->reportUselessTests !== null; - } - - /** - * @throws Exception - */ - public function reportUselessTests(): bool - { - if ($this->reportUselessTests === null) { - throw new Exception; - } - - return $this->reportUselessTests; - } - - public function hasResolveDependencies(): bool - { - return $this->resolveDependencies !== null; - } - - /** - * @throws Exception - */ - public function resolveDependencies(): bool - { - if ($this->resolveDependencies === null) { - throw new Exception; - } - - return $this->resolveDependencies; - } - - public function hasReverseList(): bool - { - return $this->reverseList !== null; - } - - /** - * @throws Exception - */ - public function reverseList(): bool - { - if ($this->reverseList === null) { - throw new Exception; - } - - return $this->reverseList; - } - - public function hasStderr(): bool - { - return $this->stderr !== null; - } - - /** - * @throws Exception - */ - public function stderr(): bool - { - if ($this->stderr === null) { - throw new Exception; - } - - return $this->stderr; - } - - public function hasStrictCoverage(): bool - { - return $this->strictCoverage !== null; - } - - /** - * @throws Exception - */ - public function strictCoverage(): bool - { - if ($this->strictCoverage === null) { - throw new Exception; - } - - return $this->strictCoverage; - } - - public function hasStopOnDefect(): bool - { - return $this->stopOnDefect !== null; - } - - /** - * @throws Exception - */ - public function stopOnDefect(): bool - { - if ($this->stopOnDefect === null) { - throw new Exception; - } - - return $this->stopOnDefect; - } - - public function hasStopOnError(): bool - { - return $this->stopOnError !== null; - } - - /** - * @throws Exception - */ - public function stopOnError(): bool - { - if ($this->stopOnError === null) { - throw new Exception; - } - - return $this->stopOnError; - } - - public function hasStopOnFailure(): bool - { - return $this->stopOnFailure !== null; - } - - /** - * @throws Exception - */ - public function stopOnFailure(): bool - { - if ($this->stopOnFailure === null) { - throw new Exception; - } - - return $this->stopOnFailure; - } - - public function hasStopOnIncomplete(): bool - { - return $this->stopOnIncomplete !== null; - } - - /** - * @throws Exception - */ - public function stopOnIncomplete(): bool - { - if ($this->stopOnIncomplete === null) { - throw new Exception; - } - - return $this->stopOnIncomplete; - } - - public function hasStopOnRisky(): bool - { - return $this->stopOnRisky !== null; - } - - /** - * @throws Exception - */ - public function stopOnRisky(): bool - { - if ($this->stopOnRisky === null) { - throw new Exception; - } - - return $this->stopOnRisky; - } - - public function hasStopOnSkipped(): bool - { - return $this->stopOnSkipped !== null; - } - - /** - * @throws Exception - */ - public function stopOnSkipped(): bool - { - if ($this->stopOnSkipped === null) { - throw new Exception; - } - - return $this->stopOnSkipped; - } - - public function hasStopOnWarning(): bool - { - return $this->stopOnWarning !== null; - } - - /** - * @throws Exception - */ - public function stopOnWarning(): bool - { - if ($this->stopOnWarning === null) { - throw new Exception; - } - - return $this->stopOnWarning; - } - - public function hasTeamcityLogfile(): bool - { - return $this->teamcityLogfile !== null; - } - - /** - * @throws Exception - */ - public function teamcityLogfile(): string - { - if ($this->teamcityLogfile === null) { - throw new Exception; - } - - return $this->teamcityLogfile; - } - - public function hasTestdoxExcludeGroups(): bool - { - return $this->testdoxExcludeGroups !== null; - } - - /** - * @throws Exception - */ - public function testdoxExcludeGroups(): array - { - if ($this->testdoxExcludeGroups === null) { - throw new Exception; - } - - return $this->testdoxExcludeGroups; - } - - public function hasTestdoxGroups(): bool - { - return $this->testdoxGroups !== null; - } - - /** - * @throws Exception - */ - public function testdoxGroups(): array - { - if ($this->testdoxGroups === null) { - throw new Exception; - } - - return $this->testdoxGroups; - } - - public function hasTestdoxHtmlFile(): bool - { - return $this->testdoxHtmlFile !== null; - } - - /** - * @throws Exception - */ - public function testdoxHtmlFile(): string - { - if ($this->testdoxHtmlFile === null) { - throw new Exception; - } - - return $this->testdoxHtmlFile; - } - - public function hasTestdoxTextFile(): bool - { - return $this->testdoxTextFile !== null; - } - - /** - * @throws Exception - */ - public function testdoxTextFile(): string - { - if ($this->testdoxTextFile === null) { - throw new Exception; - } - - return $this->testdoxTextFile; - } - - public function hasTestdoxXmlFile(): bool - { - return $this->testdoxXmlFile !== null; - } - - /** - * @throws Exception - */ - public function testdoxXmlFile(): string - { - if ($this->testdoxXmlFile === null) { - throw new Exception; - } - - return $this->testdoxXmlFile; - } - - public function hasTestSuffixes(): bool - { - return $this->testSuffixes !== null; - } - - /** - * @throws Exception - */ - public function testSuffixes(): array - { - if ($this->testSuffixes === null) { - throw new Exception; - } - - return $this->testSuffixes; - } - - public function hasTestSuite(): bool - { - return $this->testSuite !== null; - } - - /** - * @throws Exception - */ - public function testSuite(): string - { - if ($this->testSuite === null) { - throw new Exception; - } - - return $this->testSuite; - } - - public function unrecognizedOptions(): array - { - return $this->unrecognizedOptions; - } - - public function hasUnrecognizedOrderBy(): bool - { - return $this->unrecognizedOrderBy !== null; - } - - /** - * @throws Exception - */ - public function unrecognizedOrderBy(): string - { - if ($this->unrecognizedOrderBy === null) { - throw new Exception; - } - - return $this->unrecognizedOrderBy; - } - - public function hasUseDefaultConfiguration(): bool - { - return $this->useDefaultConfiguration !== null; - } - - /** - * @throws Exception - */ - public function useDefaultConfiguration(): bool - { - if ($this->useDefaultConfiguration === null) { - throw new Exception; - } - - return $this->useDefaultConfiguration; - } - - public function hasVerbose(): bool - { - return $this->verbose !== null; - } - - /** - * @throws Exception - */ - public function verbose(): bool - { - if ($this->verbose === null) { - throw new Exception; - } - - return $this->verbose; - } - - public function hasVersion(): bool - { - return $this->version !== null; - } - - /** - * @throws Exception - */ - public function version(): bool - { - if ($this->version === null) { - throw new Exception; - } - - return $this->version; - } - - public function hasXdebugFilterFile(): bool - { - return $this->xdebugFilterFile !== null; - } - - /** - * @throws Exception - */ - public function xdebugFilterFile(): string - { - if ($this->xdebugFilterFile === null) { - throw new Exception; - } - - return $this->xdebugFilterFile; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/CliArguments/Exception.php b/vendor/phpunit/phpunit/src/TextUI/CliArguments/Exception.php deleted file mode 100644 index dd5536ea..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/CliArguments/Exception.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\CliArguments; - -use RuntimeException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Exception extends RuntimeException implements \PHPUnit\Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/TextUI/CliArguments/Mapper.php b/vendor/phpunit/phpunit/src/TextUI/CliArguments/Mapper.php deleted file mode 100644 index 9ceb8ab4..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/CliArguments/Mapper.php +++ /dev/null @@ -1,365 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\CliArguments; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Mapper -{ - /** - * @throws Exception - */ - public function mapToLegacyArray(Configuration $arguments): array - { - $result = [ - 'extensions' => [], - 'listGroups' => false, - 'listSuites' => false, - 'listTests' => false, - 'listTestsXml' => false, - 'loader' => null, - 'useDefaultConfiguration' => true, - 'loadedExtensions' => [], - 'unavailableExtensions' => [], - 'notLoadedExtensions' => [], - ]; - - if ($arguments->hasColors()) { - $result['colors'] = $arguments->colors(); - } - - if ($arguments->hasBootstrap()) { - $result['bootstrap'] = $arguments->bootstrap(); - } - - if ($arguments->hasCacheResult()) { - $result['cacheResult'] = $arguments->cacheResult(); - } - - if ($arguments->hasCacheResultFile()) { - $result['cacheResultFile'] = $arguments->cacheResultFile(); - } - - if ($arguments->hasColumns()) { - $result['columns'] = $arguments->columns(); - } - - if ($arguments->hasConfiguration()) { - $result['configuration'] = $arguments->configuration(); - } - - if ($arguments->hasCoverageCacheDirectory()) { - $result['coverageCacheDirectory'] = $arguments->coverageCacheDirectory(); - } - - if ($arguments->hasWarmCoverageCache()) { - $result['warmCoverageCache'] = $arguments->warmCoverageCache(); - } - - if ($arguments->hasCoverageClover()) { - $result['coverageClover'] = $arguments->coverageClover(); - } - - if ($arguments->hasCoverageCobertura()) { - $result['coverageCobertura'] = $arguments->coverageCobertura(); - } - - if ($arguments->hasCoverageCrap4J()) { - $result['coverageCrap4J'] = $arguments->coverageCrap4J(); - } - - if ($arguments->hasCoverageHtml()) { - $result['coverageHtml'] = $arguments->coverageHtml(); - } - - if ($arguments->hasCoveragePhp()) { - $result['coveragePHP'] = $arguments->coveragePhp(); - } - - if ($arguments->hasCoverageText()) { - $result['coverageText'] = $arguments->coverageText(); - } - - if ($arguments->hasCoverageTextShowUncoveredFiles()) { - $result['coverageTextShowUncoveredFiles'] = $arguments->hasCoverageTextShowUncoveredFiles(); - } - - if ($arguments->hasCoverageTextShowOnlySummary()) { - $result['coverageTextShowOnlySummary'] = $arguments->coverageTextShowOnlySummary(); - } - - if ($arguments->hasCoverageXml()) { - $result['coverageXml'] = $arguments->coverageXml(); - } - - if ($arguments->hasPathCoverage()) { - $result['pathCoverage'] = $arguments->pathCoverage(); - } - - if ($arguments->hasDebug()) { - $result['debug'] = $arguments->debug(); - } - - if ($arguments->hasHelp()) { - $result['help'] = $arguments->help(); - } - - if ($arguments->hasFilter()) { - $result['filter'] = $arguments->filter(); - } - - if ($arguments->hasTestSuite()) { - $result['testsuite'] = $arguments->testSuite(); - } - - if ($arguments->hasGroups()) { - $result['groups'] = $arguments->groups(); - } - - if ($arguments->hasExcludeGroups()) { - $result['excludeGroups'] = $arguments->excludeGroups(); - } - - if ($arguments->hasTestsCovering()) { - $result['testsCovering'] = $arguments->testsCovering(); - } - - if ($arguments->hasTestsUsing()) { - $result['testsUsing'] = $arguments->testsUsing(); - } - - if ($arguments->hasTestSuffixes()) { - $result['testSuffixes'] = $arguments->testSuffixes(); - } - - if ($arguments->hasIncludePath()) { - $result['includePath'] = $arguments->includePath(); - } - - if ($arguments->hasListGroups()) { - $result['listGroups'] = $arguments->listGroups(); - } - - if ($arguments->hasListSuites()) { - $result['listSuites'] = $arguments->listSuites(); - } - - if ($arguments->hasListTests()) { - $result['listTests'] = $arguments->listTests(); - } - - if ($arguments->hasListTestsXml()) { - $result['listTestsXml'] = $arguments->listTestsXml(); - } - - if ($arguments->hasPrinter()) { - $result['printer'] = $arguments->printer(); - } - - if ($arguments->hasLoader()) { - $result['loader'] = $arguments->loader(); - } - - if ($arguments->hasJunitLogfile()) { - $result['junitLogfile'] = $arguments->junitLogfile(); - } - - if ($arguments->hasTeamcityLogfile()) { - $result['teamcityLogfile'] = $arguments->teamcityLogfile(); - } - - if ($arguments->hasExecutionOrder()) { - $result['executionOrder'] = $arguments->executionOrder(); - } - - if ($arguments->hasExecutionOrderDefects()) { - $result['executionOrderDefects'] = $arguments->executionOrderDefects(); - } - - if ($arguments->hasExtensions()) { - $result['extensions'] = $arguments->extensions(); - } - - if ($arguments->hasUnavailableExtensions()) { - $result['unavailableExtensions'] = $arguments->unavailableExtensions(); - } - - if ($arguments->hasResolveDependencies()) { - $result['resolveDependencies'] = $arguments->resolveDependencies(); - } - - if ($arguments->hasProcessIsolation()) { - $result['processIsolation'] = $arguments->processIsolation(); - } - - if ($arguments->hasRepeat()) { - $result['repeat'] = $arguments->repeat(); - } - - if ($arguments->hasStderr()) { - $result['stderr'] = $arguments->stderr(); - } - - if ($arguments->hasStopOnDefect()) { - $result['stopOnDefect'] = $arguments->stopOnDefect(); - } - - if ($arguments->hasStopOnError()) { - $result['stopOnError'] = $arguments->stopOnError(); - } - - if ($arguments->hasStopOnFailure()) { - $result['stopOnFailure'] = $arguments->stopOnFailure(); - } - - if ($arguments->hasStopOnWarning()) { - $result['stopOnWarning'] = $arguments->stopOnWarning(); - } - - if ($arguments->hasStopOnIncomplete()) { - $result['stopOnIncomplete'] = $arguments->stopOnIncomplete(); - } - - if ($arguments->hasStopOnRisky()) { - $result['stopOnRisky'] = $arguments->stopOnRisky(); - } - - if ($arguments->hasStopOnSkipped()) { - $result['stopOnSkipped'] = $arguments->stopOnSkipped(); - } - - if ($arguments->hasFailOnEmptyTestSuite()) { - $result['failOnEmptyTestSuite'] = $arguments->failOnEmptyTestSuite(); - } - - if ($arguments->hasFailOnIncomplete()) { - $result['failOnIncomplete'] = $arguments->failOnIncomplete(); - } - - if ($arguments->hasFailOnRisky()) { - $result['failOnRisky'] = $arguments->failOnRisky(); - } - - if ($arguments->hasFailOnSkipped()) { - $result['failOnSkipped'] = $arguments->failOnSkipped(); - } - - if ($arguments->hasFailOnWarning()) { - $result['failOnWarning'] = $arguments->failOnWarning(); - } - - if ($arguments->hasTestdoxGroups()) { - $result['testdoxGroups'] = $arguments->testdoxGroups(); - } - - if ($arguments->hasTestdoxExcludeGroups()) { - $result['testdoxExcludeGroups'] = $arguments->testdoxExcludeGroups(); - } - - if ($arguments->hasTestdoxHtmlFile()) { - $result['testdoxHTMLFile'] = $arguments->testdoxHtmlFile(); - } - - if ($arguments->hasTestdoxTextFile()) { - $result['testdoxTextFile'] = $arguments->testdoxTextFile(); - } - - if ($arguments->hasTestdoxXmlFile()) { - $result['testdoxXMLFile'] = $arguments->testdoxXmlFile(); - } - - if ($arguments->hasUseDefaultConfiguration()) { - $result['useDefaultConfiguration'] = $arguments->useDefaultConfiguration(); - } - - if ($arguments->hasNoExtensions()) { - $result['noExtensions'] = $arguments->noExtensions(); - } - - if ($arguments->hasNoCoverage()) { - $result['noCoverage'] = $arguments->noCoverage(); - } - - if ($arguments->hasNoLogging()) { - $result['noLogging'] = $arguments->noLogging(); - } - - if ($arguments->hasNoInteraction()) { - $result['noInteraction'] = $arguments->noInteraction(); - } - - if ($arguments->hasBackupGlobals()) { - $result['backupGlobals'] = $arguments->backupGlobals(); - } - - if ($arguments->hasBackupStaticAttributes()) { - $result['backupStaticAttributes'] = $arguments->backupStaticAttributes(); - } - - if ($arguments->hasVerbose()) { - $result['verbose'] = $arguments->verbose(); - } - - if ($arguments->hasReportUselessTests()) { - $result['reportUselessTests'] = $arguments->reportUselessTests(); - } - - if ($arguments->hasStrictCoverage()) { - $result['strictCoverage'] = $arguments->strictCoverage(); - } - - if ($arguments->hasDisableCodeCoverageIgnore()) { - $result['disableCodeCoverageIgnore'] = $arguments->disableCodeCoverageIgnore(); - } - - if ($arguments->hasBeStrictAboutChangesToGlobalState()) { - $result['beStrictAboutChangesToGlobalState'] = $arguments->beStrictAboutChangesToGlobalState(); - } - - if ($arguments->hasDisallowTestOutput()) { - $result['disallowTestOutput'] = $arguments->disallowTestOutput(); - } - - if ($arguments->hasBeStrictAboutResourceUsageDuringSmallTests()) { - $result['beStrictAboutResourceUsageDuringSmallTests'] = $arguments->beStrictAboutResourceUsageDuringSmallTests(); - } - - if ($arguments->hasDefaultTimeLimit()) { - $result['defaultTimeLimit'] = $arguments->defaultTimeLimit(); - } - - if ($arguments->hasEnforceTimeLimit()) { - $result['enforceTimeLimit'] = $arguments->enforceTimeLimit(); - } - - if ($arguments->hasDisallowTodoAnnotatedTests()) { - $result['disallowTodoAnnotatedTests'] = $arguments->disallowTodoAnnotatedTests(); - } - - if ($arguments->hasReverseList()) { - $result['reverseList'] = $arguments->reverseList(); - } - - if ($arguments->hasCoverageFilter()) { - $result['coverageFilter'] = $arguments->coverageFilter(); - } - - if ($arguments->hasRandomOrderSeed()) { - $result['randomOrderSeed'] = $arguments->randomOrderSeed(); - } - - if ($arguments->hasXdebugFilterFile()) { - $result['xdebugFilterFile'] = $arguments->xdebugFilterFile(); - } - - return $result; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/Command.php b/vendor/phpunit/phpunit/src/TextUI/Command.php deleted file mode 100644 index 7d766eb4..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/Command.php +++ /dev/null @@ -1,1006 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI; - -use const PATH_SEPARATOR; -use const PHP_EOL; -use const STDIN; -use function array_keys; -use function assert; -use function class_exists; -use function copy; -use function extension_loaded; -use function fgets; -use function file_get_contents; -use function file_put_contents; -use function get_class; -use function getcwd; -use function ini_get; -use function ini_set; -use function is_array; -use function is_callable; -use function is_dir; -use function is_file; -use function is_string; -use function printf; -use function realpath; -use function sort; -use function sprintf; -use function stream_resolve_include_path; -use function strpos; -use function trim; -use function version_compare; -use PHPUnit\Framework\TestSuite; -use PHPUnit\Runner\Extension\PharLoader; -use PHPUnit\Runner\StandardTestSuiteLoader; -use PHPUnit\Runner\TestSuiteLoader; -use PHPUnit\Runner\Version; -use PHPUnit\TextUI\CliArguments\Builder; -use PHPUnit\TextUI\CliArguments\Configuration; -use PHPUnit\TextUI\CliArguments\Exception as ArgumentsException; -use PHPUnit\TextUI\CliArguments\Mapper; -use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\FilterMapper; -use PHPUnit\TextUI\XmlConfiguration\Generator; -use PHPUnit\TextUI\XmlConfiguration\Loader; -use PHPUnit\TextUI\XmlConfiguration\Migrator; -use PHPUnit\TextUI\XmlConfiguration\PhpHandler; -use PHPUnit\Util\FileLoader; -use PHPUnit\Util\Filesystem; -use PHPUnit\Util\Printer; -use PHPUnit\Util\TextTestListRenderer; -use PHPUnit\Util\Xml\SchemaDetector; -use PHPUnit\Util\XmlTestListRenderer; -use ReflectionClass; -use SebastianBergmann\CodeCoverage\Filter; -use SebastianBergmann\CodeCoverage\StaticAnalysis\CacheWarmer; -use SebastianBergmann\Timer\Timer; -use Throwable; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -class Command -{ - /** - * @var array - */ - protected $arguments = []; - - /** - * @var array - */ - protected $longOptions = []; - - /** - * @var bool - */ - private $versionStringPrinted = false; - - /** - * @psalm-var list - */ - private $warnings = []; - - /** - * @throws Exception - */ - public static function main(bool $exit = true): int - { - try { - return (new static)->run($_SERVER['argv'], $exit); - } catch (Throwable $t) { - throw new RuntimeException( - $t->getMessage(), - (int) $t->getCode(), - $t - ); - } - } - - /** - * @throws Exception - */ - public function run(array $argv, bool $exit = true): int - { - $this->handleArguments($argv); - - $runner = $this->createRunner(); - - if ($this->arguments['test'] instanceof TestSuite) { - $suite = $this->arguments['test']; - } else { - $suite = $runner->getTest( - $this->arguments['test'], - $this->arguments['testSuffixes'] - ); - } - - if ($this->arguments['listGroups']) { - return $this->handleListGroups($suite, $exit); - } - - if ($this->arguments['listSuites']) { - return $this->handleListSuites($exit); - } - - if ($this->arguments['listTests']) { - return $this->handleListTests($suite, $exit); - } - - if ($this->arguments['listTestsXml']) { - return $this->handleListTestsXml($suite, $this->arguments['listTestsXml'], $exit); - } - - unset($this->arguments['test'], $this->arguments['testFile']); - - try { - $result = $runner->run($suite, $this->arguments, $this->warnings, $exit); - } catch (Throwable $t) { - print $t->getMessage() . PHP_EOL; - } - - $return = TestRunner::FAILURE_EXIT; - - if (isset($result) && $result->wasSuccessful()) { - $return = TestRunner::SUCCESS_EXIT; - } elseif (!isset($result) || $result->errorCount() > 0) { - $return = TestRunner::EXCEPTION_EXIT; - } - - if ($exit) { - exit($return); - } - - return $return; - } - - /** - * Create a TestRunner, override in subclasses. - */ - protected function createRunner(): TestRunner - { - return new TestRunner($this->arguments['loader']); - } - - /** - * Handles the command-line arguments. - * - * A child class of PHPUnit\TextUI\Command can hook into the argument - * parsing by adding the switch(es) to the $longOptions array and point to a - * callback method that handles the switch(es) in the child class like this - * - * - * longOptions['my-switch'] = 'myHandler'; - * // my-secondswitch will accept a value - note the equals sign - * $this->longOptions['my-secondswitch='] = 'myOtherHandler'; - * } - * - * // --my-switch -> myHandler() - * protected function myHandler() - * { - * } - * - * // --my-secondswitch foo -> myOtherHandler('foo') - * protected function myOtherHandler ($value) - * { - * } - * - * // You will also need this - the static keyword in the - * // PHPUnit\TextUI\Command will mean that it'll be - * // PHPUnit\TextUI\Command that gets instantiated, - * // not MyCommand - * public static function main($exit = true) - * { - * $command = new static; - * - * return $command->run($_SERVER['argv'], $exit); - * } - * - * } - * - * - * @throws Exception - */ - protected function handleArguments(array $argv): void - { - try { - $arguments = (new Builder)->fromParameters($argv, array_keys($this->longOptions)); - } catch (ArgumentsException $e) { - $this->exitWithErrorMessage($e->getMessage()); - } - - assert(isset($arguments) && $arguments instanceof Configuration); - - if ($arguments->hasGenerateConfiguration() && $arguments->generateConfiguration()) { - $this->generateConfiguration(); - } - - if ($arguments->hasAtLeastVersion()) { - if (version_compare(Version::id(), $arguments->atLeastVersion(), '>=')) { - exit(TestRunner::SUCCESS_EXIT); - } - - exit(TestRunner::FAILURE_EXIT); - } - - if ($arguments->hasVersion() && $arguments->version()) { - $this->printVersionString(); - - exit(TestRunner::SUCCESS_EXIT); - } - - if ($arguments->hasCheckVersion() && $arguments->checkVersion()) { - $this->handleVersionCheck(); - } - - if ($arguments->hasHelp()) { - $this->showHelp(); - - exit(TestRunner::SUCCESS_EXIT); - } - - if ($arguments->hasUnrecognizedOrderBy()) { - $this->exitWithErrorMessage( - sprintf( - 'unrecognized --order-by option: %s', - $arguments->unrecognizedOrderBy() - ) - ); - } - - if ($arguments->hasIniSettings()) { - foreach ($arguments->iniSettings() as $name => $value) { - ini_set($name, $value); - } - } - - if ($arguments->hasIncludePath()) { - ini_set( - 'include_path', - $arguments->includePath() . PATH_SEPARATOR . ini_get('include_path') - ); - } - - $this->arguments = (new Mapper)->mapToLegacyArray($arguments); - - $this->handleCustomOptions($arguments->unrecognizedOptions()); - $this->handleCustomTestSuite(); - - if (!isset($this->arguments['testSuffixes'])) { - $this->arguments['testSuffixes'] = ['Test.php', '.phpt']; - } - - if (!isset($this->arguments['test']) && $arguments->hasArgument()) { - $this->arguments['test'] = realpath($arguments->argument()); - - if ($this->arguments['test'] === false) { - $this->exitWithErrorMessage( - sprintf( - 'Cannot open file "%s".', - $arguments->argument() - ) - ); - } - } - - if ($this->arguments['loader'] !== null) { - $this->arguments['loader'] = $this->handleLoader($this->arguments['loader']); - } - - if (isset($this->arguments['configuration'])) { - if (is_dir($this->arguments['configuration'])) { - $candidate = $this->configurationFileInDirectory($this->arguments['configuration']); - - if ($candidate !== null) { - $this->arguments['configuration'] = $candidate; - } - } - } elseif ($this->arguments['useDefaultConfiguration']) { - $candidate = $this->configurationFileInDirectory(getcwd()); - - if ($candidate !== null) { - $this->arguments['configuration'] = $candidate; - } - } - - if ($arguments->hasMigrateConfiguration() && $arguments->migrateConfiguration()) { - if (!isset($this->arguments['configuration'])) { - print 'No configuration file found to migrate.' . PHP_EOL; - - exit(TestRunner::EXCEPTION_EXIT); - } - - $this->migrateConfiguration(realpath($this->arguments['configuration'])); - } - - if (isset($this->arguments['configuration'])) { - try { - $this->arguments['configurationObject'] = (new Loader)->load($this->arguments['configuration']); - } catch (Throwable $e) { - print $e->getMessage() . PHP_EOL; - - exit(TestRunner::FAILURE_EXIT); - } - - $phpunitConfiguration = $this->arguments['configurationObject']->phpunit(); - - (new PhpHandler)->handle($this->arguments['configurationObject']->php()); - - if (isset($this->arguments['bootstrap'])) { - $this->handleBootstrap($this->arguments['bootstrap']); - } elseif ($phpunitConfiguration->hasBootstrap()) { - $this->handleBootstrap($phpunitConfiguration->bootstrap()); - } - - if (!isset($this->arguments['stderr'])) { - $this->arguments['stderr'] = $phpunitConfiguration->stderr(); - } - - if (!isset($this->arguments['noExtensions']) && $phpunitConfiguration->hasExtensionsDirectory() && extension_loaded('phar')) { - $result = (new PharLoader)->loadPharExtensionsInDirectory($phpunitConfiguration->extensionsDirectory()); - - $this->arguments['loadedExtensions'] = $result['loadedExtensions']; - $this->arguments['notLoadedExtensions'] = $result['notLoadedExtensions']; - - unset($result); - } - - if (!isset($this->arguments['columns'])) { - $this->arguments['columns'] = $phpunitConfiguration->columns(); - } - - if (!isset($this->arguments['printer']) && $phpunitConfiguration->hasPrinterClass()) { - $file = $phpunitConfiguration->hasPrinterFile() ? $phpunitConfiguration->printerFile() : ''; - - $this->arguments['printer'] = $this->handlePrinter( - $phpunitConfiguration->printerClass(), - $file - ); - } - - if ($phpunitConfiguration->hasTestSuiteLoaderClass()) { - $file = $phpunitConfiguration->hasTestSuiteLoaderFile() ? $phpunitConfiguration->testSuiteLoaderFile() : ''; - - $this->arguments['loader'] = $this->handleLoader( - $phpunitConfiguration->testSuiteLoaderClass(), - $file - ); - } - - if (!isset($this->arguments['testsuite']) && $phpunitConfiguration->hasDefaultTestSuite()) { - $this->arguments['testsuite'] = $phpunitConfiguration->defaultTestSuite(); - } - - if (!isset($this->arguments['test'])) { - try { - $this->arguments['test'] = (new TestSuiteMapper)->map( - $this->arguments['configurationObject']->testSuite(), - $this->arguments['testsuite'] ?? '' - ); - } catch (Exception $e) { - $this->printVersionString(); - - print $e->getMessage() . PHP_EOL; - - exit(TestRunner::EXCEPTION_EXIT); - } - } - } elseif (isset($this->arguments['bootstrap'])) { - $this->handleBootstrap($this->arguments['bootstrap']); - } - - if (isset($this->arguments['printer']) && is_string($this->arguments['printer'])) { - $this->arguments['printer'] = $this->handlePrinter($this->arguments['printer']); - } - - if (isset($this->arguments['configurationObject'], $this->arguments['warmCoverageCache'])) { - $this->handleWarmCoverageCache($this->arguments['configurationObject']); - } - - if (!isset($this->arguments['test'])) { - $this->showHelp(); - - exit(TestRunner::EXCEPTION_EXIT); - } - } - - /** - * Handles the loading of the PHPUnit\Runner\TestSuiteLoader implementation. - * - * @deprecated see https://github.com/sebastianbergmann/phpunit/issues/4039 - */ - protected function handleLoader(string $loaderClass, string $loaderFile = ''): ?TestSuiteLoader - { - $this->warnings[] = 'Using a custom test suite loader is deprecated'; - - if (!class_exists($loaderClass, false)) { - if ($loaderFile == '') { - $loaderFile = Filesystem::classNameToFilename( - $loaderClass - ); - } - - $loaderFile = stream_resolve_include_path($loaderFile); - - if ($loaderFile) { - /** - * @noinspection PhpIncludeInspection - * - * @psalm-suppress UnresolvableInclude - */ - require $loaderFile; - } - } - - if (class_exists($loaderClass, false)) { - try { - $class = new ReflectionClass($loaderClass); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if ($class->implementsInterface(TestSuiteLoader::class) && $class->isInstantiable()) { - $object = $class->newInstance(); - - assert($object instanceof TestSuiteLoader); - - return $object; - } - } - - if ($loaderClass == StandardTestSuiteLoader::class) { - return null; - } - - $this->exitWithErrorMessage( - sprintf( - 'Could not use "%s" as loader.', - $loaderClass - ) - ); - - return null; - } - - /** - * Handles the loading of the PHPUnit\Util\Printer implementation. - * - * @return null|Printer|string - */ - protected function handlePrinter(string $printerClass, string $printerFile = '') - { - if (!class_exists($printerClass, false)) { - if ($printerFile === '') { - $printerFile = Filesystem::classNameToFilename( - $printerClass - ); - } - - $printerFile = stream_resolve_include_path($printerFile); - - if ($printerFile) { - /** - * @noinspection PhpIncludeInspection - * - * @psalm-suppress UnresolvableInclude - */ - require $printerFile; - } - } - - if (!class_exists($printerClass)) { - $this->exitWithErrorMessage( - sprintf( - 'Could not use "%s" as printer: class does not exist', - $printerClass - ) - ); - } - - try { - $class = new ReflectionClass($printerClass); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - $e->getCode(), - $e - ); - // @codeCoverageIgnoreEnd - } - - if (!$class->implementsInterface(ResultPrinter::class)) { - $this->exitWithErrorMessage( - sprintf( - 'Could not use "%s" as printer: class does not implement %s', - $printerClass, - ResultPrinter::class - ) - ); - } - - if (!$class->isInstantiable()) { - $this->exitWithErrorMessage( - sprintf( - 'Could not use "%s" as printer: class cannot be instantiated', - $printerClass - ) - ); - } - - if ($class->isSubclassOf(ResultPrinter::class)) { - return $printerClass; - } - - $outputStream = isset($this->arguments['stderr']) ? 'php://stderr' : null; - - return $class->newInstance($outputStream); - } - - /** - * Loads a bootstrap file. - */ - protected function handleBootstrap(string $filename): void - { - try { - FileLoader::checkAndLoad($filename); - } catch (Throwable $t) { - if ($t instanceof \PHPUnit\Exception) { - $this->exitWithErrorMessage($t->getMessage()); - } - - $this->exitWithErrorMessage( - sprintf( - 'Error in bootstrap script: %s:%s%s%s%s', - get_class($t), - PHP_EOL, - $t->getMessage(), - PHP_EOL, - $t->getTraceAsString() - ) - ); - } - } - - protected function handleVersionCheck(): void - { - $this->printVersionString(); - - $latestVersion = file_get_contents('https://phar.phpunit.de/latest-version-of/phpunit'); - $isOutdated = version_compare($latestVersion, Version::id(), '>'); - - if ($isOutdated) { - printf( - 'You are not using the latest version of PHPUnit.' . PHP_EOL . - 'The latest version is PHPUnit %s.' . PHP_EOL, - $latestVersion - ); - } else { - print 'You are using the latest version of PHPUnit.' . PHP_EOL; - } - - exit(TestRunner::SUCCESS_EXIT); - } - - /** - * Show the help message. - */ - protected function showHelp(): void - { - $this->printVersionString(); - (new Help)->writeToConsole(); - } - - /** - * Custom callback for test suite discovery. - */ - protected function handleCustomTestSuite(): void - { - } - - private function printVersionString(): void - { - if ($this->versionStringPrinted) { - return; - } - - print Version::getVersionString() . PHP_EOL . PHP_EOL; - - $this->versionStringPrinted = true; - } - - private function exitWithErrorMessage(string $message): void - { - $this->printVersionString(); - - print $message . PHP_EOL; - - exit(TestRunner::FAILURE_EXIT); - } - - private function handleListGroups(TestSuite $suite, bool $exit): int - { - $this->printVersionString(); - - $this->warnAboutConflictingOptions( - 'listGroups', - [ - 'filter', - 'groups', - 'excludeGroups', - 'testsuite', - ] - ); - - print 'Available test group(s):' . PHP_EOL; - - $groups = $suite->getGroups(); - sort($groups); - - foreach ($groups as $group) { - if (strpos($group, '__phpunit_') === 0) { - continue; - } - - printf( - ' - %s' . PHP_EOL, - $group - ); - } - - if ($exit) { - exit(TestRunner::SUCCESS_EXIT); - } - - return TestRunner::SUCCESS_EXIT; - } - - /** - * @throws \PHPUnit\Framework\Exception - * @throws \PHPUnit\TextUI\XmlConfiguration\Exception - */ - private function handleListSuites(bool $exit): int - { - $this->printVersionString(); - - $this->warnAboutConflictingOptions( - 'listSuites', - [ - 'filter', - 'groups', - 'excludeGroups', - 'testsuite', - ] - ); - - print 'Available test suite(s):' . PHP_EOL; - - foreach ($this->arguments['configurationObject']->testSuite() as $testSuite) { - printf( - ' - %s' . PHP_EOL, - $testSuite->name() - ); - } - - if ($exit) { - exit(TestRunner::SUCCESS_EXIT); - } - - return TestRunner::SUCCESS_EXIT; - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - private function handleListTests(TestSuite $suite, bool $exit): int - { - $this->printVersionString(); - - $this->warnAboutConflictingOptions( - 'listTests', - [ - 'filter', - 'groups', - 'excludeGroups', - 'testsuite', - ] - ); - - $renderer = new TextTestListRenderer; - - print $renderer->render($suite); - - if ($exit) { - exit(TestRunner::SUCCESS_EXIT); - } - - return TestRunner::SUCCESS_EXIT; - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - private function handleListTestsXml(TestSuite $suite, string $target, bool $exit): int - { - $this->printVersionString(); - - $this->warnAboutConflictingOptions( - 'listTestsXml', - [ - 'filter', - 'groups', - 'excludeGroups', - 'testsuite', - ] - ); - - $renderer = new XmlTestListRenderer; - - file_put_contents($target, $renderer->render($suite)); - - printf( - 'Wrote list of tests that would have been run to %s' . PHP_EOL, - $target - ); - - if ($exit) { - exit(TestRunner::SUCCESS_EXIT); - } - - return TestRunner::SUCCESS_EXIT; - } - - private function generateConfiguration(): void - { - $this->printVersionString(); - - print 'Generating phpunit.xml in ' . getcwd() . PHP_EOL . PHP_EOL; - print 'Bootstrap script (relative to path shown above; default: vendor/autoload.php): '; - - $bootstrapScript = trim(fgets(STDIN)); - - print 'Tests directory (relative to path shown above; default: tests): '; - - $testsDirectory = trim(fgets(STDIN)); - - print 'Source directory (relative to path shown above; default: src): '; - - $src = trim(fgets(STDIN)); - - print 'Cache directory (relative to path shown above; default: .phpunit.cache): '; - - $cacheDirectory = trim(fgets(STDIN)); - - if ($bootstrapScript === '') { - $bootstrapScript = 'vendor/autoload.php'; - } - - if ($testsDirectory === '') { - $testsDirectory = 'tests'; - } - - if ($src === '') { - $src = 'src'; - } - - if ($cacheDirectory === '') { - $cacheDirectory = '.phpunit.cache'; - } - - $generator = new Generator; - - file_put_contents( - 'phpunit.xml', - $generator->generateDefaultConfiguration( - Version::series(), - $bootstrapScript, - $testsDirectory, - $src, - $cacheDirectory - ) - ); - - print PHP_EOL . 'Generated phpunit.xml in ' . getcwd() . '.' . PHP_EOL; - print 'Make sure to exclude the ' . $cacheDirectory . ' directory from version control.' . PHP_EOL; - - exit(TestRunner::SUCCESS_EXIT); - } - - private function migrateConfiguration(string $filename): void - { - $this->printVersionString(); - - if (!(new SchemaDetector)->detect($filename)->detected()) { - print $filename . ' does not need to be migrated.' . PHP_EOL; - - exit(TestRunner::EXCEPTION_EXIT); - } - - copy($filename, $filename . '.bak'); - - print 'Created backup: ' . $filename . '.bak' . PHP_EOL; - - try { - file_put_contents( - $filename, - (new Migrator)->migrate($filename) - ); - - print 'Migrated configuration: ' . $filename . PHP_EOL; - } catch (Throwable $t) { - print 'Migration failed: ' . $t->getMessage() . PHP_EOL; - - exit(TestRunner::EXCEPTION_EXIT); - } - - exit(TestRunner::SUCCESS_EXIT); - } - - private function handleCustomOptions(array $unrecognizedOptions): void - { - foreach ($unrecognizedOptions as $name => $value) { - if (isset($this->longOptions[$name])) { - $handler = $this->longOptions[$name]; - } - - $name .= '='; - - if (isset($this->longOptions[$name])) { - $handler = $this->longOptions[$name]; - } - - if (isset($handler) && is_callable([$this, $handler])) { - $this->{$handler}($value); - - unset($handler); - } - } - } - - private function handleWarmCoverageCache(XmlConfiguration\Configuration $configuration): void - { - $this->printVersionString(); - - if (isset($this->arguments['coverageCacheDirectory'])) { - $cacheDirectory = $this->arguments['coverageCacheDirectory']; - } elseif ($configuration->codeCoverage()->hasCacheDirectory()) { - $cacheDirectory = $configuration->codeCoverage()->cacheDirectory()->path(); - } else { - print 'Cache for static analysis has not been configured' . PHP_EOL; - - exit(TestRunner::EXCEPTION_EXIT); - } - - $filter = new Filter; - - if ($configuration->codeCoverage()->hasNonEmptyListOfFilesToBeIncludedInCodeCoverageReport()) { - (new FilterMapper)->map( - $filter, - $configuration->codeCoverage() - ); - } elseif (isset($this->arguments['coverageFilter'])) { - if (!is_array($this->arguments['coverageFilter'])) { - $coverageFilterDirectories = [$this->arguments['coverageFilter']]; - } else { - $coverageFilterDirectories = $this->arguments['coverageFilter']; - } - - foreach ($coverageFilterDirectories as $coverageFilterDirectory) { - $filter->includeDirectory($coverageFilterDirectory); - } - } else { - print 'Filter for code coverage has not been configured' . PHP_EOL; - - exit(TestRunner::EXCEPTION_EXIT); - } - - $timer = new Timer; - $timer->start(); - - print 'Warming cache for static analysis ... '; - - (new CacheWarmer)->warmCache( - $cacheDirectory, - !$configuration->codeCoverage()->disableCodeCoverageIgnore(), - $configuration->codeCoverage()->ignoreDeprecatedCodeUnits(), - $filter - ); - - print 'done [' . $timer->stop()->asString() . ']' . PHP_EOL; - - exit(TestRunner::SUCCESS_EXIT); - } - - private function configurationFileInDirectory(string $directory): ?string - { - $candidates = [ - $directory . '/phpunit.xml', - $directory . '/phpunit.xml.dist', - ]; - - foreach ($candidates as $candidate) { - if (is_file($candidate)) { - return realpath($candidate); - } - } - - return null; - } - - /** - * @psalm-param "listGroups"|"listSuites"|"listTests"|"listTestsXml"|"filter"|"groups"|"excludeGroups"|"testsuite" $key - * @psalm-param list<"listGroups"|"listSuites"|"listTests"|"listTestsXml"|"filter"|"groups"|"excludeGroups"|"testsuite"> $keys - */ - private function warnAboutConflictingOptions(string $key, array $keys): void - { - $warningPrinted = false; - - foreach ($keys as $_key) { - if (!empty($this->arguments[$_key])) { - printf( - 'The %s and %s options cannot be combined, %s is ignored' . PHP_EOL, - $this->mapKeyToOptionForWarning($_key), - $this->mapKeyToOptionForWarning($key), - $this->mapKeyToOptionForWarning($_key) - ); - - $warningPrinted = true; - } - } - - if ($warningPrinted) { - print PHP_EOL; - } - } - - /** - * @psalm-param "listGroups"|"listSuites"|"listTests"|"listTestsXml"|"filter"|"groups"|"excludeGroups"|"testsuite" $key - */ - private function mapKeyToOptionForWarning(string $key): string - { - switch ($key) { - case 'listGroups': - return '--list-groups'; - - case 'listSuites': - return '--list-suites'; - - case 'listTests': - return '--list-tests'; - - case 'listTestsXml': - return '--list-tests-xml'; - - case 'filter': - return '--filter'; - - case 'groups': - return '--group'; - - case 'excludeGroups': - return '--exclude-group'; - - case 'testsuite': - return '--testsuite'; - } - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/DefaultResultPrinter.php b/vendor/phpunit/phpunit/src/TextUI/DefaultResultPrinter.php deleted file mode 100644 index 99f0fa9d..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/DefaultResultPrinter.php +++ /dev/null @@ -1,593 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI; - -use const PHP_EOL; -use function array_map; -use function array_reverse; -use function count; -use function floor; -use function implode; -use function in_array; -use function is_int; -use function max; -use function preg_split; -use function sprintf; -use function str_pad; -use function str_repeat; -use function strlen; -use function trim; -use function vsprintf; -use PHPUnit\Framework\AssertionFailedError; -use PHPUnit\Framework\Exception; -use PHPUnit\Framework\InvalidArgumentException; -use PHPUnit\Framework\Test; -use PHPUnit\Framework\TestCase; -use PHPUnit\Framework\TestFailure; -use PHPUnit\Framework\TestResult; -use PHPUnit\Framework\TestSuite; -use PHPUnit\Framework\Warning; -use PHPUnit\Runner\PhptTestCase; -use PHPUnit\Util\Color; -use PHPUnit\Util\Printer; -use SebastianBergmann\Environment\Console; -use SebastianBergmann\Timer\ResourceUsageFormatter; -use SebastianBergmann\Timer\Timer; -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -class DefaultResultPrinter extends Printer implements ResultPrinter -{ - public const EVENT_TEST_START = 0; - - public const EVENT_TEST_END = 1; - - public const EVENT_TESTSUITE_START = 2; - - public const EVENT_TESTSUITE_END = 3; - - public const COLOR_NEVER = 'never'; - - public const COLOR_AUTO = 'auto'; - - public const COLOR_ALWAYS = 'always'; - - public const COLOR_DEFAULT = self::COLOR_NEVER; - - private const AVAILABLE_COLORS = [self::COLOR_NEVER, self::COLOR_AUTO, self::COLOR_ALWAYS]; - - /** - * @var int - */ - protected $column = 0; - - /** - * @var int - */ - protected $maxColumn; - - /** - * @var bool - */ - protected $lastTestFailed = false; - - /** - * @var int - */ - protected $numAssertions = 0; - - /** - * @var int - */ - protected $numTests = -1; - - /** - * @var int - */ - protected $numTestsRun = 0; - - /** - * @var int - */ - protected $numTestsWidth; - - /** - * @var bool - */ - protected $colors = false; - - /** - * @var bool - */ - protected $debug = false; - - /** - * @var bool - */ - protected $verbose = false; - - /** - * @var int - */ - private $numberOfColumns; - - /** - * @var bool - */ - private $reverse; - - /** - * @var bool - */ - private $defectListPrinted = false; - - /** - * @var Timer - */ - private $timer; - - /** - * Constructor. - * - * @param null|resource|string $out - * @param int|string $numberOfColumns - * - * @throws Exception - */ - public function __construct($out = null, bool $verbose = false, string $colors = self::COLOR_DEFAULT, bool $debug = false, $numberOfColumns = 80, bool $reverse = false) - { - parent::__construct($out); - - if (!in_array($colors, self::AVAILABLE_COLORS, true)) { - throw InvalidArgumentException::create( - 3, - vsprintf('value from "%s", "%s" or "%s"', self::AVAILABLE_COLORS) - ); - } - - if (!is_int($numberOfColumns) && $numberOfColumns !== 'max') { - throw InvalidArgumentException::create(5, 'integer or "max"'); - } - - $console = new Console; - $maxNumberOfColumns = $console->getNumberOfColumns(); - - if ($numberOfColumns === 'max' || ($numberOfColumns !== 80 && $numberOfColumns > $maxNumberOfColumns)) { - $numberOfColumns = $maxNumberOfColumns; - } - - $this->numberOfColumns = $numberOfColumns; - $this->verbose = $verbose; - $this->debug = $debug; - $this->reverse = $reverse; - - if ($colors === self::COLOR_AUTO && $console->hasColorSupport()) { - $this->colors = true; - } else { - $this->colors = (self::COLOR_ALWAYS === $colors); - } - - $this->timer = new Timer; - - $this->timer->start(); - } - - public function printResult(TestResult $result): void - { - $this->printHeader($result); - $this->printErrors($result); - $this->printWarnings($result); - $this->printFailures($result); - $this->printRisky($result); - - if ($this->verbose) { - $this->printIncompletes($result); - $this->printSkipped($result); - } - - $this->printFooter($result); - } - - /** - * An error occurred. - */ - public function addError(Test $test, Throwable $t, float $time): void - { - $this->writeProgressWithColor('fg-red, bold', 'E'); - $this->lastTestFailed = true; - } - - /** - * A failure occurred. - */ - public function addFailure(Test $test, AssertionFailedError $e, float $time): void - { - $this->writeProgressWithColor('bg-red, fg-white', 'F'); - $this->lastTestFailed = true; - } - - /** - * A warning occurred. - */ - public function addWarning(Test $test, Warning $e, float $time): void - { - $this->writeProgressWithColor('fg-yellow, bold', 'W'); - $this->lastTestFailed = true; - } - - /** - * Incomplete test. - */ - public function addIncompleteTest(Test $test, Throwable $t, float $time): void - { - $this->writeProgressWithColor('fg-yellow, bold', 'I'); - $this->lastTestFailed = true; - } - - /** - * Risky test. - */ - public function addRiskyTest(Test $test, Throwable $t, float $time): void - { - $this->writeProgressWithColor('fg-yellow, bold', 'R'); - $this->lastTestFailed = true; - } - - /** - * Skipped test. - */ - public function addSkippedTest(Test $test, Throwable $t, float $time): void - { - $this->writeProgressWithColor('fg-cyan, bold', 'S'); - $this->lastTestFailed = true; - } - - /** - * A testsuite started. - */ - public function startTestSuite(TestSuite $suite): void - { - if ($this->numTests == -1) { - $this->numTests = count($suite); - $this->numTestsWidth = strlen((string) $this->numTests); - $this->maxColumn = $this->numberOfColumns - strlen(' / (XXX%)') - (2 * $this->numTestsWidth); - } - } - - /** - * A testsuite ended. - */ - public function endTestSuite(TestSuite $suite): void - { - } - - /** - * A test started. - */ - public function startTest(Test $test): void - { - if ($this->debug) { - $this->write( - sprintf( - "Test '%s' started\n", - \PHPUnit\Util\Test::describeAsString($test) - ) - ); - } - } - - /** - * A test ended. - */ - public function endTest(Test $test, float $time): void - { - if ($this->debug) { - $this->write( - sprintf( - "Test '%s' ended\n", - \PHPUnit\Util\Test::describeAsString($test) - ) - ); - } - - if (!$this->lastTestFailed) { - $this->writeProgress('.'); - } - - if ($test instanceof TestCase) { - $this->numAssertions += $test->getNumAssertions(); - } elseif ($test instanceof PhptTestCase) { - $this->numAssertions++; - } - - $this->lastTestFailed = false; - - if ($test instanceof TestCase && !$test->hasExpectationOnOutput()) { - $this->write($test->getActualOutput()); - } - } - - protected function printDefects(array $defects, string $type): void - { - $count = count($defects); - - if ($count == 0) { - return; - } - - if ($this->defectListPrinted) { - $this->write("\n--\n\n"); - } - - $this->write( - sprintf( - "There %s %d %s%s:\n", - ($count == 1) ? 'was' : 'were', - $count, - $type, - ($count == 1) ? '' : 's' - ) - ); - - $i = 1; - - if ($this->reverse) { - $defects = array_reverse($defects); - } - - foreach ($defects as $defect) { - $this->printDefect($defect, $i++); - } - - $this->defectListPrinted = true; - } - - protected function printDefect(TestFailure $defect, int $count): void - { - $this->printDefectHeader($defect, $count); - $this->printDefectTrace($defect); - } - - protected function printDefectHeader(TestFailure $defect, int $count): void - { - $this->write( - sprintf( - "\n%d) %s\n", - $count, - $defect->getTestName() - ) - ); - } - - protected function printDefectTrace(TestFailure $defect): void - { - $e = $defect->thrownException(); - - $this->write((string) $e); - - while ($e = $e->getPrevious()) { - $this->write("\nCaused by\n" . trim((string) $e) . "\n"); - } - } - - protected function printErrors(TestResult $result): void - { - $this->printDefects($result->errors(), 'error'); - } - - protected function printFailures(TestResult $result): void - { - $this->printDefects($result->failures(), 'failure'); - } - - protected function printWarnings(TestResult $result): void - { - $this->printDefects($result->warnings(), 'warning'); - } - - protected function printIncompletes(TestResult $result): void - { - $this->printDefects($result->notImplemented(), 'incomplete test'); - } - - protected function printRisky(TestResult $result): void - { - $this->printDefects($result->risky(), 'risky test'); - } - - protected function printSkipped(TestResult $result): void - { - $this->printDefects($result->skipped(), 'skipped test'); - } - - protected function printHeader(TestResult $result): void - { - if (count($result) > 0) { - $this->write(PHP_EOL . PHP_EOL . (new ResourceUsageFormatter)->resourceUsage($this->timer->stop()) . PHP_EOL . PHP_EOL); - } - } - - protected function printFooter(TestResult $result): void - { - if (count($result) === 0) { - $this->writeWithColor( - 'fg-black, bg-yellow', - 'No tests executed!' - ); - - return; - } - - if ($result->wasSuccessfulAndNoTestIsRiskyOrSkippedOrIncomplete()) { - $this->writeWithColor( - 'fg-black, bg-green', - sprintf( - 'OK (%d test%s, %d assertion%s)', - count($result), - (count($result) === 1) ? '' : 's', - $this->numAssertions, - ($this->numAssertions === 1) ? '' : 's' - ) - ); - - return; - } - - $color = 'fg-black, bg-yellow'; - - if ($result->wasSuccessful()) { - if ($this->verbose || !$result->allHarmless()) { - $this->write("\n"); - } - - $this->writeWithColor( - $color, - 'OK, but incomplete, skipped, or risky tests!' - ); - } else { - $this->write("\n"); - - if ($result->errorCount()) { - $color = 'fg-white, bg-red'; - - $this->writeWithColor( - $color, - 'ERRORS!' - ); - } elseif ($result->failureCount()) { - $color = 'fg-white, bg-red'; - - $this->writeWithColor( - $color, - 'FAILURES!' - ); - } elseif ($result->warningCount()) { - $color = 'fg-black, bg-yellow'; - - $this->writeWithColor( - $color, - 'WARNINGS!' - ); - } - } - - $this->writeCountString(count($result), 'Tests', $color, true); - $this->writeCountString($this->numAssertions, 'Assertions', $color, true); - $this->writeCountString($result->errorCount(), 'Errors', $color); - $this->writeCountString($result->failureCount(), 'Failures', $color); - $this->writeCountString($result->warningCount(), 'Warnings', $color); - $this->writeCountString($result->skippedCount(), 'Skipped', $color); - $this->writeCountString($result->notImplementedCount(), 'Incomplete', $color); - $this->writeCountString($result->riskyCount(), 'Risky', $color); - $this->writeWithColor($color, '.'); - } - - protected function writeProgress(string $progress): void - { - if ($this->debug) { - return; - } - - $this->write($progress); - $this->column++; - $this->numTestsRun++; - - if ($this->column == $this->maxColumn || $this->numTestsRun == $this->numTests) { - if ($this->numTestsRun == $this->numTests) { - $this->write(str_repeat(' ', $this->maxColumn - $this->column)); - } - - $this->write( - sprintf( - ' %' . $this->numTestsWidth . 'd / %' . - $this->numTestsWidth . 'd (%3s%%)', - $this->numTestsRun, - $this->numTests, - floor(($this->numTestsRun / $this->numTests) * 100) - ) - ); - - if ($this->column == $this->maxColumn) { - $this->writeNewLine(); - } - } - } - - protected function writeNewLine(): void - { - $this->column = 0; - $this->write("\n"); - } - - /** - * Formats a buffer with a specified ANSI color sequence if colors are - * enabled. - */ - protected function colorizeTextBox(string $color, string $buffer): string - { - if (!$this->colors) { - return $buffer; - } - - $lines = preg_split('/\r\n|\r|\n/', $buffer); - $padding = max(array_map('\strlen', $lines)); - - $styledLines = []; - - foreach ($lines as $line) { - $styledLines[] = Color::colorize($color, str_pad($line, $padding)); - } - - return implode(PHP_EOL, $styledLines); - } - - /** - * Writes a buffer out with a color sequence if colors are enabled. - */ - protected function writeWithColor(string $color, string $buffer, bool $lf = true): void - { - $this->write($this->colorizeTextBox($color, $buffer)); - - if ($lf) { - $this->write(PHP_EOL); - } - } - - /** - * Writes progress with a color sequence if colors are enabled. - */ - protected function writeProgressWithColor(string $color, string $buffer): void - { - $buffer = $this->colorizeTextBox($color, $buffer); - $this->writeProgress($buffer); - } - - private function writeCountString(int $count, string $name, string $color, bool $always = false): void - { - static $first = true; - - if ($always || $count > 0) { - $this->writeWithColor( - $color, - sprintf( - '%s%s: %d', - !$first ? ', ' : '', - $name, - $count - ), - false - ); - - $first = false; - } - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/Exception/Exception.php b/vendor/phpunit/phpunit/src/TextUI/Exception/Exception.php deleted file mode 100644 index ee2ae4ff..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/Exception/Exception.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI; - -use Throwable; - -/** - * @internal This interface is not covered by the backward compatibility promise for PHPUnit - */ -interface Exception extends Throwable -{ -} diff --git a/vendor/phpunit/phpunit/src/TextUI/Exception/ReflectionException.php b/vendor/phpunit/phpunit/src/TextUI/Exception/ReflectionException.php deleted file mode 100644 index 74e9d25d..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/Exception/ReflectionException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI; - -use RuntimeException; - -/** - * @internal This interface is not covered by the backward compatibility promise for PHPUnit - */ -final class ReflectionException extends RuntimeException implements Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/TextUI/Exception/RuntimeException.php b/vendor/phpunit/phpunit/src/TextUI/Exception/RuntimeException.php deleted file mode 100644 index 790a8463..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/Exception/RuntimeException.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI; - -/** - * @internal This interface is not covered by the backward compatibility promise for PHPUnit - */ -final class RuntimeException extends \RuntimeException implements Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/TextUI/Exception/TestDirectoryNotFoundException.php b/vendor/phpunit/phpunit/src/TextUI/Exception/TestDirectoryNotFoundException.php deleted file mode 100644 index 770ad874..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/Exception/TestDirectoryNotFoundException.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI; - -use function sprintf; -use RuntimeException; - -/** - * @internal This interface is not covered by the backward compatibility promise for PHPUnit - */ -final class TestDirectoryNotFoundException extends RuntimeException implements Exception -{ - public function __construct(string $path) - { - parent::__construct( - sprintf( - 'Test directory "%s" not found', - $path - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/Exception/TestFileNotFoundException.php b/vendor/phpunit/phpunit/src/TextUI/Exception/TestFileNotFoundException.php deleted file mode 100644 index 7ffd2c78..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/Exception/TestFileNotFoundException.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI; - -use function sprintf; -use RuntimeException; - -/** - * @internal This interface is not covered by the backward compatibility promise for PHPUnit - */ -final class TestFileNotFoundException extends RuntimeException implements Exception -{ - public function __construct(string $path) - { - parent::__construct( - sprintf( - 'Test file "%s" not found', - $path - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/Help.php b/vendor/phpunit/phpunit/src/TextUI/Help.php deleted file mode 100644 index 084f2a21..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/Help.php +++ /dev/null @@ -1,265 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI; - -use const PHP_EOL; -use function count; -use function explode; -use function max; -use function preg_replace_callback; -use function str_pad; -use function str_repeat; -use function strlen; -use function wordwrap; -use PHPUnit\Util\Color; -use SebastianBergmann\Environment\Console; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Help -{ - private const LEFT_MARGIN = ' '; - - private const HELP_TEXT = [ - 'Usage' => [ - ['text' => 'phpunit [options] UnitTest.php'], - ['text' => 'phpunit [options] '], - ], - - 'Code Coverage Options' => [ - ['arg' => '--coverage-clover ', 'desc' => 'Generate code coverage report in Clover XML format'], - ['arg' => '--coverage-cobertura ', 'desc' => 'Generate code coverage report in Cobertura XML format'], - ['arg' => '--coverage-crap4j ', 'desc' => 'Generate code coverage report in Crap4J XML format'], - ['arg' => '--coverage-html ', 'desc' => 'Generate code coverage report in HTML format'], - ['arg' => '--coverage-php ', 'desc' => 'Export PHP_CodeCoverage object to file'], - ['arg' => '--coverage-text=', 'desc' => 'Generate code coverage report in text format [default: standard output]'], - ['arg' => '--coverage-xml ', 'desc' => 'Generate code coverage report in PHPUnit XML format'], - ['arg' => '--coverage-cache ', 'desc' => 'Cache static analysis results'], - ['arg' => '--warm-coverage-cache', 'desc' => 'Warm static analysis cache'], - ['arg' => '--coverage-filter ', 'desc' => 'Include in code coverage analysis'], - ['arg' => '--path-coverage', 'desc' => 'Perform path coverage analysis'], - ['arg' => '--disable-coverage-ignore', 'desc' => 'Disable annotations for ignoring code coverage'], - ['arg' => '--no-coverage', 'desc' => 'Ignore code coverage configuration'], - ], - - 'Logging Options' => [ - ['arg' => '--log-junit ', 'desc' => 'Log test execution in JUnit XML format to file'], - ['arg' => '--log-teamcity ', 'desc' => 'Log test execution in TeamCity format to file'], - ['arg' => '--testdox-html ', 'desc' => 'Write agile documentation in HTML format to file'], - ['arg' => '--testdox-text ', 'desc' => 'Write agile documentation in Text format to file'], - ['arg' => '--testdox-xml ', 'desc' => 'Write agile documentation in XML format to file'], - ['arg' => '--reverse-list', 'desc' => 'Print defects in reverse order'], - ['arg' => '--no-logging', 'desc' => 'Ignore logging configuration'], - ], - - 'Test Selection Options' => [ - ['arg' => '--list-suites', 'desc' => 'List available test suites'], - ['arg' => '--testsuite ', 'desc' => 'Filter which testsuite to run'], - ['arg' => '--list-groups', 'desc' => 'List available test groups'], - ['arg' => '--group ', 'desc' => 'Only runs tests from the specified group(s)'], - ['arg' => '--exclude-group ', 'desc' => 'Exclude tests from the specified group(s)'], - ['arg' => '--covers ', 'desc' => 'Only runs tests annotated with "@covers "'], - ['arg' => '--uses ', 'desc' => 'Only runs tests annotated with "@uses "'], - ['arg' => '--list-tests', 'desc' => 'List available tests'], - ['arg' => '--list-tests-xml ', 'desc' => 'List available tests in XML format'], - ['arg' => '--filter ', 'desc' => 'Filter which tests to run'], - ['arg' => '--test-suffix ', 'desc' => 'Only search for test in files with specified suffix(es). Default: Test.php,.phpt'], - ], - - 'Test Execution Options' => [ - ['arg' => '--dont-report-useless-tests', 'desc' => 'Do not report tests that do not test anything'], - ['arg' => '--strict-coverage', 'desc' => 'Be strict about @covers annotation usage'], - ['arg' => '--strict-global-state', 'desc' => 'Be strict about changes to global state'], - ['arg' => '--disallow-test-output', 'desc' => 'Be strict about output during tests'], - ['arg' => '--disallow-resource-usage', 'desc' => 'Be strict about resource usage during small tests'], - ['arg' => '--enforce-time-limit', 'desc' => 'Enforce time limit based on test size'], - ['arg' => '--default-time-limit ', 'desc' => 'Timeout in seconds for tests without @small, @medium or @large'], - ['arg' => '--disallow-todo-tests', 'desc' => 'Disallow @todo-annotated tests'], - ['spacer' => ''], - - ['arg' => '--process-isolation', 'desc' => 'Run each test in a separate PHP process'], - ['arg' => '--globals-backup', 'desc' => 'Backup and restore $GLOBALS for each test'], - ['arg' => '--static-backup', 'desc' => 'Backup and restore static attributes for each test'], - ['spacer' => ''], - - ['arg' => '--colors ', 'desc' => 'Use colors in output ("never", "auto" or "always")'], - ['arg' => '--columns ', 'desc' => 'Number of columns to use for progress output'], - ['arg' => '--columns max', 'desc' => 'Use maximum number of columns for progress output'], - ['arg' => '--stderr', 'desc' => 'Write to STDERR instead of STDOUT'], - ['arg' => '--stop-on-defect', 'desc' => 'Stop execution upon first not-passed test'], - ['arg' => '--stop-on-error', 'desc' => 'Stop execution upon first error'], - ['arg' => '--stop-on-failure', 'desc' => 'Stop execution upon first error or failure'], - ['arg' => '--stop-on-warning', 'desc' => 'Stop execution upon first warning'], - ['arg' => '--stop-on-risky', 'desc' => 'Stop execution upon first risky test'], - ['arg' => '--stop-on-skipped', 'desc' => 'Stop execution upon first skipped test'], - ['arg' => '--stop-on-incomplete', 'desc' => 'Stop execution upon first incomplete test'], - ['arg' => '--fail-on-incomplete', 'desc' => 'Treat incomplete tests as failures'], - ['arg' => '--fail-on-risky', 'desc' => 'Treat risky tests as failures'], - ['arg' => '--fail-on-skipped', 'desc' => 'Treat skipped tests as failures'], - ['arg' => '--fail-on-warning', 'desc' => 'Treat tests with warnings as failures'], - ['arg' => '-v|--verbose', 'desc' => 'Output more verbose information'], - ['arg' => '--debug', 'desc' => 'Display debugging information'], - ['spacer' => ''], - - ['arg' => '--repeat ', 'desc' => 'Runs the test(s) repeatedly'], - ['arg' => '--teamcity', 'desc' => 'Report test execution progress in TeamCity format'], - ['arg' => '--testdox', 'desc' => 'Report test execution progress in TestDox format'], - ['arg' => '--testdox-group', 'desc' => 'Only include tests from the specified group(s)'], - ['arg' => '--testdox-exclude-group', 'desc' => 'Exclude tests from the specified group(s)'], - ['arg' => '--no-interaction', 'desc' => 'Disable TestDox progress animation'], - ['arg' => '--printer ', 'desc' => 'TestListener implementation to use'], - ['spacer' => ''], - - ['arg' => '--order-by ', 'desc' => 'Run tests in order: default|defects|duration|no-depends|random|reverse|size'], - ['arg' => '--random-order-seed ', 'desc' => 'Use a specific random seed for random order'], - ['arg' => '--cache-result', 'desc' => 'Write test results to cache file'], - ['arg' => '--do-not-cache-result', 'desc' => 'Do not write test results to cache file'], - ], - - 'Configuration Options' => [ - ['arg' => '--prepend ', 'desc' => 'A PHP script that is included as early as possible'], - ['arg' => '--bootstrap ', 'desc' => 'A PHP script that is included before the tests run'], - ['arg' => '-c|--configuration ', 'desc' => 'Read configuration from XML file'], - ['arg' => '--no-configuration', 'desc' => 'Ignore default configuration file (phpunit.xml)'], - ['arg' => '--extensions ', 'desc' => 'A comma separated list of PHPUnit extensions to load'], - ['arg' => '--no-extensions', 'desc' => 'Do not load PHPUnit extensions'], - ['arg' => '--include-path ', 'desc' => 'Prepend PHP\'s include_path with given path(s)'], - ['arg' => '-d ', 'desc' => 'Sets a php.ini value'], - ['arg' => '--cache-result-file ', 'desc' => 'Specify result cache path and filename'], - ['arg' => '--generate-configuration', 'desc' => 'Generate configuration file with suggested settings'], - ['arg' => '--migrate-configuration', 'desc' => 'Migrate configuration file to current format'], - ], - - 'Miscellaneous Options' => [ - ['arg' => '-h|--help', 'desc' => 'Prints this usage information'], - ['arg' => '--version', 'desc' => 'Prints the version and exits'], - ['arg' => '--atleast-version ', 'desc' => 'Checks that version is greater than min and exits'], - ['arg' => '--check-version', 'desc' => 'Check whether PHPUnit is the latest version'], - ], - - ]; - - /** - * @var int Number of columns required to write the longest option name to the console - */ - private $maxArgLength = 0; - - /** - * @var int Number of columns left for the description field after padding and option - */ - private $maxDescLength; - - /** - * @var bool Use color highlights for sections, options and parameters - */ - private $hasColor = false; - - public function __construct(?int $width = null, ?bool $withColor = null) - { - if ($width === null) { - $width = (new Console)->getNumberOfColumns(); - } - - if ($withColor === null) { - $this->hasColor = (new Console)->hasColorSupport(); - } else { - $this->hasColor = $withColor; - } - - foreach (self::HELP_TEXT as $options) { - foreach ($options as $option) { - if (isset($option['arg'])) { - $this->maxArgLength = max($this->maxArgLength, isset($option['arg']) ? strlen($option['arg']) : 0); - } - } - } - - $this->maxDescLength = $width - $this->maxArgLength - 4; - } - - /** - * Write the help file to the CLI, adapting width and colors to the console. - */ - public function writeToConsole(): void - { - if ($this->hasColor) { - $this->writeWithColor(); - } else { - $this->writePlaintext(); - } - } - - private function writePlaintext(): void - { - foreach (self::HELP_TEXT as $section => $options) { - print "{$section}:" . PHP_EOL; - - if ($section !== 'Usage') { - print PHP_EOL; - } - - foreach ($options as $option) { - if (isset($option['spacer'])) { - print PHP_EOL; - } - - if (isset($option['text'])) { - print self::LEFT_MARGIN . $option['text'] . PHP_EOL; - } - - if (isset($option['arg'])) { - $arg = str_pad($option['arg'], $this->maxArgLength); - print self::LEFT_MARGIN . $arg . ' ' . $option['desc'] . PHP_EOL; - } - } - - print PHP_EOL; - } - } - - private function writeWithColor(): void - { - foreach (self::HELP_TEXT as $section => $options) { - print Color::colorize('fg-yellow', "{$section}:") . PHP_EOL; - - foreach ($options as $option) { - if (isset($option['spacer'])) { - print PHP_EOL; - } - - if (isset($option['text'])) { - print self::LEFT_MARGIN . $option['text'] . PHP_EOL; - } - - if (isset($option['arg'])) { - $arg = Color::colorize('fg-green', str_pad($option['arg'], $this->maxArgLength)); - $arg = preg_replace_callback( - '/(<[^>]+>)/', - static function ($matches) - { - return Color::colorize('fg-cyan', $matches[0]); - }, - $arg - ); - $desc = explode(PHP_EOL, wordwrap($option['desc'], $this->maxDescLength, PHP_EOL)); - - print self::LEFT_MARGIN . $arg . ' ' . $desc[0] . PHP_EOL; - - for ($i = 1; $i < count($desc); $i++) { - print str_repeat(' ', $this->maxArgLength + 3) . $desc[$i] . PHP_EOL; - } - } - } - - print PHP_EOL; - } - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/ResultPrinter.php b/vendor/phpunit/phpunit/src/TextUI/ResultPrinter.php deleted file mode 100644 index ec89f600..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/ResultPrinter.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 PHPUnit\TextUI; - -use PHPUnit\Framework\TestListener; -use PHPUnit\Framework\TestResult; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -interface ResultPrinter extends TestListener -{ - public function printResult(TestResult $result): void; - - public function write(string $buffer): void; -} diff --git a/vendor/phpunit/phpunit/src/TextUI/TestRunner.php b/vendor/phpunit/phpunit/src/TextUI/TestRunner.php deleted file mode 100644 index b0dd9bcc..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/TestRunner.php +++ /dev/null @@ -1,1270 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI; - -use const PHP_EOL; -use const PHP_SAPI; -use const PHP_VERSION; -use function array_diff; -use function array_map; -use function array_merge; -use function assert; -use function class_exists; -use function count; -use function dirname; -use function file_put_contents; -use function htmlspecialchars; -use function is_array; -use function is_int; -use function is_string; -use function mt_srand; -use function range; -use function realpath; -use function sprintf; -use function time; -use PHPUnit\Framework\Exception; -use PHPUnit\Framework\TestResult; -use PHPUnit\Framework\TestSuite; -use PHPUnit\Runner\AfterLastTestHook; -use PHPUnit\Runner\BaseTestRunner; -use PHPUnit\Runner\BeforeFirstTestHook; -use PHPUnit\Runner\DefaultTestResultCache; -use PHPUnit\Runner\Extension\ExtensionHandler; -use PHPUnit\Runner\Filter\ExcludeGroupFilterIterator; -use PHPUnit\Runner\Filter\Factory; -use PHPUnit\Runner\Filter\IncludeGroupFilterIterator; -use PHPUnit\Runner\Filter\NameFilterIterator; -use PHPUnit\Runner\Hook; -use PHPUnit\Runner\NullTestResultCache; -use PHPUnit\Runner\ResultCacheExtension; -use PHPUnit\Runner\StandardTestSuiteLoader; -use PHPUnit\Runner\TestHook; -use PHPUnit\Runner\TestListenerAdapter; -use PHPUnit\Runner\TestSuiteLoader; -use PHPUnit\Runner\TestSuiteSorter; -use PHPUnit\Runner\Version; -use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\FilterMapper; -use PHPUnit\TextUI\XmlConfiguration\Configuration; -use PHPUnit\TextUI\XmlConfiguration\Loader; -use PHPUnit\TextUI\XmlConfiguration\PhpHandler; -use PHPUnit\Util\Filesystem; -use PHPUnit\Util\Log\JUnit; -use PHPUnit\Util\Log\TeamCity; -use PHPUnit\Util\Printer; -use PHPUnit\Util\TestDox\CliTestDoxPrinter; -use PHPUnit\Util\TestDox\HtmlResultPrinter; -use PHPUnit\Util\TestDox\TextResultPrinter; -use PHPUnit\Util\TestDox\XmlResultPrinter; -use PHPUnit\Util\XdebugFilterScriptGenerator; -use PHPUnit\Util\Xml\SchemaDetector; -use ReflectionClass; -use ReflectionException; -use SebastianBergmann\CodeCoverage\CodeCoverage; -use SebastianBergmann\CodeCoverage\Driver\Selector; -use SebastianBergmann\CodeCoverage\Exception as CodeCoverageException; -use SebastianBergmann\CodeCoverage\Filter as CodeCoverageFilter; -use SebastianBergmann\CodeCoverage\Report\Clover as CloverReport; -use SebastianBergmann\CodeCoverage\Report\Cobertura as CoberturaReport; -use SebastianBergmann\CodeCoverage\Report\Crap4j as Crap4jReport; -use SebastianBergmann\CodeCoverage\Report\Html\Facade as HtmlReport; -use SebastianBergmann\CodeCoverage\Report\PHP as PhpReport; -use SebastianBergmann\CodeCoverage\Report\Text as TextReport; -use SebastianBergmann\CodeCoverage\Report\Xml\Facade as XmlReport; -use SebastianBergmann\Comparator\Comparator; -use SebastianBergmann\Environment\Runtime; -use SebastianBergmann\Invoker\Invoker; -use SebastianBergmann\Timer\Timer; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TestRunner extends BaseTestRunner -{ - public const SUCCESS_EXIT = 0; - - public const FAILURE_EXIT = 1; - - public const EXCEPTION_EXIT = 2; - - /** - * @var CodeCoverageFilter - */ - private $codeCoverageFilter; - - /** - * @var TestSuiteLoader - */ - private $loader; - - /** - * @var ResultPrinter - */ - private $printer; - - /** - * @var bool - */ - private $messagePrinted = false; - - /** - * @var Hook[] - */ - private $extensions = []; - - /** - * @var Timer - */ - private $timer; - - public function __construct(TestSuiteLoader $loader = null, CodeCoverageFilter $filter = null) - { - if ($filter === null) { - $filter = new CodeCoverageFilter; - } - - $this->codeCoverageFilter = $filter; - $this->loader = $loader; - $this->timer = new Timer; - } - - /** - * @throws \PHPUnit\Runner\Exception - * @throws \PHPUnit\TextUI\XmlConfiguration\Exception - * @throws Exception - */ - public function run(TestSuite $suite, array $arguments = [], array $warnings = [], bool $exit = true): TestResult - { - if (isset($arguments['configuration'])) { - $GLOBALS['__PHPUNIT_CONFIGURATION_FILE'] = $arguments['configuration']; - } - - $this->handleConfiguration($arguments); - - $warnings = array_merge($warnings, $arguments['warnings']); - - if (is_int($arguments['columns']) && $arguments['columns'] < 16) { - $arguments['columns'] = 16; - $tooFewColumnsRequested = true; - } - - if (isset($arguments['bootstrap'])) { - $GLOBALS['__PHPUNIT_BOOTSTRAP'] = $arguments['bootstrap']; - } - - if ($arguments['backupGlobals'] === true) { - $suite->setBackupGlobals(true); - } - - if ($arguments['backupStaticAttributes'] === true) { - $suite->setBackupStaticAttributes(true); - } - - if ($arguments['beStrictAboutChangesToGlobalState'] === true) { - $suite->setBeStrictAboutChangesToGlobalState(true); - } - - if ($arguments['executionOrder'] === TestSuiteSorter::ORDER_RANDOMIZED) { - mt_srand($arguments['randomOrderSeed']); - } - - if ($arguments['cacheResult']) { - if (!isset($arguments['cacheResultFile'])) { - if (isset($arguments['configurationObject'])) { - assert($arguments['configurationObject'] instanceof Configuration); - - $cacheLocation = $arguments['configurationObject']->filename(); - } else { - $cacheLocation = $_SERVER['PHP_SELF']; - } - - $arguments['cacheResultFile'] = null; - - $cacheResultFile = realpath($cacheLocation); - - if ($cacheResultFile !== false) { - $arguments['cacheResultFile'] = dirname($cacheResultFile); - } - } - - $cache = new DefaultTestResultCache($arguments['cacheResultFile']); - - $this->addExtension(new ResultCacheExtension($cache)); - } - - if ($arguments['executionOrder'] !== TestSuiteSorter::ORDER_DEFAULT || $arguments['executionOrderDefects'] !== TestSuiteSorter::ORDER_DEFAULT || $arguments['resolveDependencies']) { - $cache = $cache ?? new NullTestResultCache; - - $cache->load(); - - $sorter = new TestSuiteSorter($cache); - - $sorter->reorderTestsInSuite($suite, $arguments['executionOrder'], $arguments['resolveDependencies'], $arguments['executionOrderDefects']); - $originalExecutionOrder = $sorter->getOriginalExecutionOrder(); - - unset($sorter); - } - - if (is_int($arguments['repeat']) && $arguments['repeat'] > 0) { - $_suite = new TestSuite; - - /* @noinspection PhpUnusedLocalVariableInspection */ - foreach (range(1, $arguments['repeat']) as $step) { - $_suite->addTest($suite); - } - - $suite = $_suite; - - unset($_suite); - } - - $result = $this->createTestResult(); - - $listener = new TestListenerAdapter; - $listenerNeeded = false; - - foreach ($this->extensions as $extension) { - if ($extension instanceof TestHook) { - $listener->add($extension); - - $listenerNeeded = true; - } - } - - if ($listenerNeeded) { - $result->addListener($listener); - } - - unset($listener, $listenerNeeded); - - if ($arguments['convertDeprecationsToExceptions']) { - $result->convertDeprecationsToExceptions(true); - } - - if (!$arguments['convertErrorsToExceptions']) { - $result->convertErrorsToExceptions(false); - } - - if (!$arguments['convertNoticesToExceptions']) { - $result->convertNoticesToExceptions(false); - } - - if (!$arguments['convertWarningsToExceptions']) { - $result->convertWarningsToExceptions(false); - } - - if ($arguments['stopOnError']) { - $result->stopOnError(true); - } - - if ($arguments['stopOnFailure']) { - $result->stopOnFailure(true); - } - - if ($arguments['stopOnWarning']) { - $result->stopOnWarning(true); - } - - if ($arguments['stopOnIncomplete']) { - $result->stopOnIncomplete(true); - } - - if ($arguments['stopOnRisky']) { - $result->stopOnRisky(true); - } - - if ($arguments['stopOnSkipped']) { - $result->stopOnSkipped(true); - } - - if ($arguments['stopOnDefect']) { - $result->stopOnDefect(true); - } - - if ($arguments['registerMockObjectsFromTestArgumentsRecursively']) { - $result->setRegisterMockObjectsFromTestArgumentsRecursively(true); - } - - if ($this->printer === null) { - if (isset($arguments['printer'])) { - if ($arguments['printer'] instanceof ResultPrinter) { - $this->printer = $arguments['printer']; - } elseif (is_string($arguments['printer']) && class_exists($arguments['printer'], false)) { - try { - $reflector = new ReflectionClass($arguments['printer']); - - if ($reflector->implementsInterface(ResultPrinter::class)) { - $this->printer = $this->createPrinter($arguments['printer'], $arguments); - } - - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } - } else { - $this->printer = $this->createPrinter(DefaultResultPrinter::class, $arguments); - } - } - - if (isset($originalExecutionOrder) && $this->printer instanceof CliTestDoxPrinter) { - assert($this->printer instanceof CliTestDoxPrinter); - - $this->printer->setOriginalExecutionOrder($originalExecutionOrder); - $this->printer->setShowProgressAnimation(!$arguments['noInteraction']); - } - - $this->write(Version::getVersionString() . "\n"); - - foreach ($arguments['listeners'] as $listener) { - $result->addListener($listener); - } - - $result->addListener($this->printer); - - $coverageFilterFromConfigurationFile = false; - $coverageFilterFromOption = false; - $codeCoverageReports = 0; - - if (isset($arguments['testdoxHTMLFile'])) { - $result->addListener( - new HtmlResultPrinter( - $arguments['testdoxHTMLFile'], - $arguments['testdoxGroups'], - $arguments['testdoxExcludeGroups'] - ) - ); - } - - if (isset($arguments['testdoxTextFile'])) { - $result->addListener( - new TextResultPrinter( - $arguments['testdoxTextFile'], - $arguments['testdoxGroups'], - $arguments['testdoxExcludeGroups'] - ) - ); - } - - if (isset($arguments['testdoxXMLFile'])) { - $result->addListener( - new XmlResultPrinter( - $arguments['testdoxXMLFile'] - ) - ); - } - - if (isset($arguments['teamcityLogfile'])) { - $result->addListener( - new TeamCity($arguments['teamcityLogfile']) - ); - } - - if (isset($arguments['junitLogfile'])) { - $result->addListener( - new JUnit( - $arguments['junitLogfile'], - $arguments['reportUselessTests'] - ) - ); - } - - if (isset($arguments['coverageClover'])) { - $codeCoverageReports++; - } - - if (isset($arguments['coverageCobertura'])) { - $codeCoverageReports++; - } - - if (isset($arguments['coverageCrap4J'])) { - $codeCoverageReports++; - } - - if (isset($arguments['coverageHtml'])) { - $codeCoverageReports++; - } - - if (isset($arguments['coveragePHP'])) { - $codeCoverageReports++; - } - - if (isset($arguments['coverageText'])) { - $codeCoverageReports++; - } - - if (isset($arguments['coverageXml'])) { - $codeCoverageReports++; - } - - if ($codeCoverageReports > 0 || isset($arguments['xdebugFilterFile'])) { - if (isset($arguments['coverageFilter'])) { - if (!is_array($arguments['coverageFilter'])) { - $coverageFilterDirectories = [$arguments['coverageFilter']]; - } else { - $coverageFilterDirectories = $arguments['coverageFilter']; - } - - foreach ($coverageFilterDirectories as $coverageFilterDirectory) { - $this->codeCoverageFilter->includeDirectory($coverageFilterDirectory); - } - - $coverageFilterFromOption = true; - } - - if (isset($arguments['configurationObject'])) { - assert($arguments['configurationObject'] instanceof Configuration); - - $codeCoverageConfiguration = $arguments['configurationObject']->codeCoverage(); - - if ($codeCoverageConfiguration->hasNonEmptyListOfFilesToBeIncludedInCodeCoverageReport()) { - $coverageFilterFromConfigurationFile = true; - - (new FilterMapper)->map( - $this->codeCoverageFilter, - $codeCoverageConfiguration - ); - } - } - } - - if ($codeCoverageReports > 0) { - try { - if (isset($codeCoverageConfiguration) && - ($codeCoverageConfiguration->pathCoverage() || (isset($arguments['pathCoverage']) && $arguments['pathCoverage'] === true))) { - $codeCoverageDriver = (new Selector)->forLineAndPathCoverage($this->codeCoverageFilter); - } else { - $codeCoverageDriver = (new Selector)->forLineCoverage($this->codeCoverageFilter); - } - - $codeCoverage = new CodeCoverage( - $codeCoverageDriver, - $this->codeCoverageFilter - ); - - if (isset($codeCoverageConfiguration) && $codeCoverageConfiguration->hasCacheDirectory()) { - $codeCoverage->cacheStaticAnalysis($codeCoverageConfiguration->cacheDirectory()->path()); - } - - if (isset($arguments['coverageCacheDirectory'])) { - $codeCoverage->cacheStaticAnalysis($arguments['coverageCacheDirectory']); - } - - $codeCoverage->excludeSubclassesOfThisClassFromUnintentionallyCoveredCodeCheck(Comparator::class); - - if ($arguments['strictCoverage']) { - $codeCoverage->enableCheckForUnintentionallyCoveredCode(); - } - - if (isset($arguments['ignoreDeprecatedCodeUnitsFromCodeCoverage'])) { - if ($arguments['ignoreDeprecatedCodeUnitsFromCodeCoverage']) { - $codeCoverage->ignoreDeprecatedCode(); - } else { - $codeCoverage->doNotIgnoreDeprecatedCode(); - } - } - - if (isset($arguments['disableCodeCoverageIgnore'])) { - if ($arguments['disableCodeCoverageIgnore']) { - $codeCoverage->disableAnnotationsForIgnoringCode(); - } else { - $codeCoverage->enableAnnotationsForIgnoringCode(); - } - } - - if (isset($arguments['configurationObject'])) { - $codeCoverageConfiguration = $arguments['configurationObject']->codeCoverage(); - - if ($codeCoverageConfiguration->hasNonEmptyListOfFilesToBeIncludedInCodeCoverageReport()) { - if ($codeCoverageConfiguration->includeUncoveredFiles()) { - $codeCoverage->includeUncoveredFiles(); - } else { - $codeCoverage->excludeUncoveredFiles(); - } - - if ($codeCoverageConfiguration->processUncoveredFiles()) { - $codeCoverage->processUncoveredFiles(); - } else { - $codeCoverage->doNotProcessUncoveredFiles(); - } - } - } - - if ($this->codeCoverageFilter->isEmpty()) { - if (!$coverageFilterFromConfigurationFile && !$coverageFilterFromOption) { - $warnings[] = 'No filter is configured, code coverage will not be processed'; - } else { - $warnings[] = 'Incorrect filter configuration, code coverage will not be processed'; - } - - unset($codeCoverage); - } - } catch (CodeCoverageException $e) { - $warnings[] = $e->getMessage(); - } - } - - if ($arguments['verbose']) { - if (PHP_SAPI === 'phpdbg') { - $this->writeMessage('Runtime', 'PHPDBG ' . PHP_VERSION); - } else { - $runtime = 'PHP ' . PHP_VERSION; - - if (isset($codeCoverageDriver)) { - $runtime .= ' with ' . $codeCoverageDriver->nameAndVersion(); - } - - $this->writeMessage('Runtime', $runtime); - } - - if (isset($arguments['configurationObject'])) { - assert($arguments['configurationObject'] instanceof Configuration); - - $this->writeMessage( - 'Configuration', - $arguments['configurationObject']->filename() - ); - } - - foreach ($arguments['loadedExtensions'] as $extension) { - $this->writeMessage( - 'Extension', - $extension - ); - } - - foreach ($arguments['notLoadedExtensions'] as $extension) { - $this->writeMessage( - 'Extension', - $extension - ); - } - } - - if ($arguments['executionOrder'] === TestSuiteSorter::ORDER_RANDOMIZED) { - $this->writeMessage( - 'Random Seed', - (string) $arguments['randomOrderSeed'] - ); - } - - if (isset($tooFewColumnsRequested)) { - $warnings[] = 'Less than 16 columns requested, number of columns set to 16'; - } - - if ((new Runtime)->discardsComments()) { - $warnings[] = 'opcache.save_comments=0 set; annotations will not work'; - } - - if (isset($arguments['conflictBetweenPrinterClassAndTestdox'])) { - $warnings[] = 'Directives printerClass and testdox are mutually exclusive'; - } - - foreach ($warnings as $warning) { - $this->writeMessage('Warning', $warning); - } - - if (isset($arguments['configurationObject'])) { - assert($arguments['configurationObject'] instanceof Configuration); - - if ($arguments['configurationObject']->hasValidationErrors()) { - if ((new SchemaDetector)->detect($arguments['configurationObject']->filename())->detected()) { - $this->writeMessage('Warning', 'Your XML configuration validates against a deprecated schema.'); - $this->writeMessage('Suggestion', 'Migrate your XML configuration using "--migrate-configuration"!'); - } else { - $this->write( - "\n Warning - The configuration file did not pass validation!\n The following problems have been detected:\n" - ); - - $this->write($arguments['configurationObject']->validationErrors()); - - $this->write("\n Test results may not be as expected.\n\n"); - } - } - } - - if (isset($arguments['xdebugFilterFile'], $codeCoverageConfiguration)) { - $this->write(PHP_EOL . 'Please note that --dump-xdebug-filter and --prepend are deprecated and will be removed in PHPUnit 10.' . PHP_EOL); - - $script = (new XdebugFilterScriptGenerator)->generate($codeCoverageConfiguration); - - if ($arguments['xdebugFilterFile'] !== 'php://stdout' && $arguments['xdebugFilterFile'] !== 'php://stderr' && !Filesystem::createDirectory(dirname($arguments['xdebugFilterFile']))) { - $this->write(sprintf('Cannot write Xdebug filter script to %s ' . PHP_EOL, $arguments['xdebugFilterFile'])); - - exit(self::EXCEPTION_EXIT); - } - - file_put_contents($arguments['xdebugFilterFile'], $script); - - $this->write(sprintf('Wrote Xdebug filter script to %s ' . PHP_EOL . PHP_EOL, $arguments['xdebugFilterFile'])); - - exit(self::SUCCESS_EXIT); - } - - $this->write("\n"); - - if (isset($codeCoverage)) { - $result->setCodeCoverage($codeCoverage); - } - - $result->beStrictAboutTestsThatDoNotTestAnything($arguments['reportUselessTests']); - $result->beStrictAboutOutputDuringTests($arguments['disallowTestOutput']); - $result->beStrictAboutTodoAnnotatedTests($arguments['disallowTodoAnnotatedTests']); - $result->beStrictAboutResourceUsageDuringSmallTests($arguments['beStrictAboutResourceUsageDuringSmallTests']); - - if ($arguments['enforceTimeLimit'] === true && !(new Invoker)->canInvokeWithTimeout()) { - $this->writeMessage('Error', 'PHP extension pcntl is required for enforcing time limits'); - } - - $result->enforceTimeLimit($arguments['enforceTimeLimit']); - $result->setDefaultTimeLimit($arguments['defaultTimeLimit']); - $result->setTimeoutForSmallTests($arguments['timeoutForSmallTests']); - $result->setTimeoutForMediumTests($arguments['timeoutForMediumTests']); - $result->setTimeoutForLargeTests($arguments['timeoutForLargeTests']); - - if (isset($arguments['forceCoversAnnotation']) && $arguments['forceCoversAnnotation'] === true) { - $result->forceCoversAnnotation(); - } - - $this->processSuiteFilters($suite, $arguments); - $suite->setRunTestInSeparateProcess($arguments['processIsolation']); - - foreach ($this->extensions as $extension) { - if ($extension instanceof BeforeFirstTestHook) { - $extension->executeBeforeFirstTest(); - } - } - - $testSuiteWarningsPrinted = false; - - foreach ($suite->warnings() as $warning) { - $this->writeMessage('Warning', $warning); - - $testSuiteWarningsPrinted = true; - } - - if ($testSuiteWarningsPrinted) { - $this->write(PHP_EOL); - } - - $suite->run($result); - - foreach ($this->extensions as $extension) { - if ($extension instanceof AfterLastTestHook) { - $extension->executeAfterLastTest(); - } - } - - $result->flushListeners(); - $this->printer->printResult($result); - - if (isset($codeCoverage)) { - if (isset($arguments['coverageClover'])) { - $this->codeCoverageGenerationStart('Clover XML'); - - try { - $writer = new CloverReport; - $writer->process($codeCoverage, $arguments['coverageClover']); - - $this->codeCoverageGenerationSucceeded(); - - unset($writer); - } catch (CodeCoverageException $e) { - $this->codeCoverageGenerationFailed($e); - } - } - - if (isset($arguments['coverageCobertura'])) { - $this->codeCoverageGenerationStart('Cobertura XML'); - - try { - $writer = new CoberturaReport; - $writer->process($codeCoverage, $arguments['coverageCobertura']); - - $this->codeCoverageGenerationSucceeded(); - - unset($writer); - } catch (CodeCoverageException $e) { - $this->codeCoverageGenerationFailed($e); - } - } - - if (isset($arguments['coverageCrap4J'])) { - $this->codeCoverageGenerationStart('Crap4J XML'); - - try { - $writer = new Crap4jReport($arguments['crap4jThreshold']); - $writer->process($codeCoverage, $arguments['coverageCrap4J']); - - $this->codeCoverageGenerationSucceeded(); - - unset($writer); - } catch (CodeCoverageException $e) { - $this->codeCoverageGenerationFailed($e); - } - } - - if (isset($arguments['coverageHtml'])) { - $this->codeCoverageGenerationStart('HTML'); - - try { - $writer = new HtmlReport( - $arguments['reportLowUpperBound'], - $arguments['reportHighLowerBound'], - sprintf( - ' and PHPUnit %s', - Version::id() - ) - ); - - $writer->process($codeCoverage, $arguments['coverageHtml']); - - $this->codeCoverageGenerationSucceeded(); - - unset($writer); - } catch (CodeCoverageException $e) { - $this->codeCoverageGenerationFailed($e); - } - } - - if (isset($arguments['coveragePHP'])) { - $this->codeCoverageGenerationStart('PHP'); - - try { - $writer = new PhpReport; - $writer->process($codeCoverage, $arguments['coveragePHP']); - - $this->codeCoverageGenerationSucceeded(); - - unset($writer); - } catch (CodeCoverageException $e) { - $this->codeCoverageGenerationFailed($e); - } - } - - if (isset($arguments['coverageText'])) { - if ($arguments['coverageText'] === 'php://stdout') { - $outputStream = $this->printer; - $colors = $arguments['colors'] && $arguments['colors'] !== DefaultResultPrinter::COLOR_NEVER; - } else { - $outputStream = new Printer($arguments['coverageText']); - $colors = false; - } - - $processor = new TextReport( - $arguments['reportLowUpperBound'], - $arguments['reportHighLowerBound'], - $arguments['coverageTextShowUncoveredFiles'], - $arguments['coverageTextShowOnlySummary'] - ); - - $outputStream->write( - $processor->process($codeCoverage, $colors) - ); - } - - if (isset($arguments['coverageXml'])) { - $this->codeCoverageGenerationStart('PHPUnit XML'); - - try { - $writer = new XmlReport(Version::id()); - $writer->process($codeCoverage, $arguments['coverageXml']); - - $this->codeCoverageGenerationSucceeded(); - - unset($writer); - } catch (CodeCoverageException $e) { - $this->codeCoverageGenerationFailed($e); - } - } - } - - if ($exit) { - if (isset($arguments['failOnEmptyTestSuite']) && $arguments['failOnEmptyTestSuite'] === true && count($result) === 0) { - exit(self::FAILURE_EXIT); - } - - if ($result->wasSuccessfulIgnoringWarnings()) { - if ($arguments['failOnRisky'] && !$result->allHarmless()) { - exit(self::FAILURE_EXIT); - } - - if ($arguments['failOnWarning'] && $result->warningCount() > 0) { - exit(self::FAILURE_EXIT); - } - - if ($arguments['failOnIncomplete'] && $result->notImplementedCount() > 0) { - exit(self::FAILURE_EXIT); - } - - if ($arguments['failOnSkipped'] && $result->skippedCount() > 0) { - exit(self::FAILURE_EXIT); - } - - exit(self::SUCCESS_EXIT); - } - - if ($result->errorCount() > 0) { - exit(self::EXCEPTION_EXIT); - } - - if ($result->failureCount() > 0) { - exit(self::FAILURE_EXIT); - } - } - - return $result; - } - - /** - * Returns the loader to be used. - */ - public function getLoader(): TestSuiteLoader - { - if ($this->loader === null) { - $this->loader = new StandardTestSuiteLoader; - } - - return $this->loader; - } - - public function addExtension(Hook $extension): void - { - $this->extensions[] = $extension; - } - - /** - * Override to define how to handle a failed loading of - * a test suite. - */ - protected function runFailed(string $message): void - { - $this->write($message . PHP_EOL); - - exit(self::FAILURE_EXIT); - } - - private function createTestResult(): TestResult - { - return new TestResult; - } - - private function write(string $buffer): void - { - if (PHP_SAPI !== 'cli' && PHP_SAPI !== 'phpdbg') { - $buffer = htmlspecialchars($buffer); - } - - if ($this->printer !== null) { - $this->printer->write($buffer); - } else { - print $buffer; - } - } - - /** - * @throws \PHPUnit\TextUI\XmlConfiguration\Exception - * @throws Exception - */ - private function handleConfiguration(array &$arguments): void - { - if (!isset($arguments['configurationObject']) && isset($arguments['configuration'])) { - $arguments['configurationObject'] = (new Loader)->load($arguments['configuration']); - } - - if (!isset($arguments['warnings'])) { - $arguments['warnings'] = []; - } - - $arguments['debug'] = $arguments['debug'] ?? false; - $arguments['filter'] = $arguments['filter'] ?? false; - $arguments['listeners'] = $arguments['listeners'] ?? []; - - if (isset($arguments['configurationObject'])) { - (new PhpHandler)->handle($arguments['configurationObject']->php()); - - $codeCoverageConfiguration = $arguments['configurationObject']->codeCoverage(); - - if (!isset($arguments['noCoverage'])) { - if (!isset($arguments['coverageClover']) && $codeCoverageConfiguration->hasClover()) { - $arguments['coverageClover'] = $codeCoverageConfiguration->clover()->target()->path(); - } - - if (!isset($arguments['coverageCobertura']) && $codeCoverageConfiguration->hasCobertura()) { - $arguments['coverageCobertura'] = $codeCoverageConfiguration->cobertura()->target()->path(); - } - - if (!isset($arguments['coverageCrap4J']) && $codeCoverageConfiguration->hasCrap4j()) { - $arguments['coverageCrap4J'] = $codeCoverageConfiguration->crap4j()->target()->path(); - - if (!isset($arguments['crap4jThreshold'])) { - $arguments['crap4jThreshold'] = $codeCoverageConfiguration->crap4j()->threshold(); - } - } - - if (!isset($arguments['coverageHtml']) && $codeCoverageConfiguration->hasHtml()) { - $arguments['coverageHtml'] = $codeCoverageConfiguration->html()->target()->path(); - - if (!isset($arguments['reportLowUpperBound'])) { - $arguments['reportLowUpperBound'] = $codeCoverageConfiguration->html()->lowUpperBound(); - } - - if (!isset($arguments['reportHighLowerBound'])) { - $arguments['reportHighLowerBound'] = $codeCoverageConfiguration->html()->highLowerBound(); - } - } - - if (!isset($arguments['coveragePHP']) && $codeCoverageConfiguration->hasPhp()) { - $arguments['coveragePHP'] = $codeCoverageConfiguration->php()->target()->path(); - } - - if (!isset($arguments['coverageText']) && $codeCoverageConfiguration->hasText()) { - $arguments['coverageText'] = $codeCoverageConfiguration->text()->target()->path(); - $arguments['coverageTextShowUncoveredFiles'] = $codeCoverageConfiguration->text()->showUncoveredFiles(); - $arguments['coverageTextShowOnlySummary'] = $codeCoverageConfiguration->text()->showOnlySummary(); - } - - if (!isset($arguments['coverageXml']) && $codeCoverageConfiguration->hasXml()) { - $arguments['coverageXml'] = $codeCoverageConfiguration->xml()->target()->path(); - } - } - - $phpunitConfiguration = $arguments['configurationObject']->phpunit(); - - $arguments['backupGlobals'] = $arguments['backupGlobals'] ?? $phpunitConfiguration->backupGlobals(); - $arguments['backupStaticAttributes'] = $arguments['backupStaticAttributes'] ?? $phpunitConfiguration->backupStaticAttributes(); - $arguments['beStrictAboutChangesToGlobalState'] = $arguments['beStrictAboutChangesToGlobalState'] ?? $phpunitConfiguration->beStrictAboutChangesToGlobalState(); - $arguments['cacheResult'] = $arguments['cacheResult'] ?? $phpunitConfiguration->cacheResult(); - $arguments['colors'] = $arguments['colors'] ?? $phpunitConfiguration->colors(); - $arguments['convertDeprecationsToExceptions'] = $arguments['convertDeprecationsToExceptions'] ?? $phpunitConfiguration->convertDeprecationsToExceptions(); - $arguments['convertErrorsToExceptions'] = $arguments['convertErrorsToExceptions'] ?? $phpunitConfiguration->convertErrorsToExceptions(); - $arguments['convertNoticesToExceptions'] = $arguments['convertNoticesToExceptions'] ?? $phpunitConfiguration->convertNoticesToExceptions(); - $arguments['convertWarningsToExceptions'] = $arguments['convertWarningsToExceptions'] ?? $phpunitConfiguration->convertWarningsToExceptions(); - $arguments['processIsolation'] = $arguments['processIsolation'] ?? $phpunitConfiguration->processIsolation(); - $arguments['stopOnDefect'] = $arguments['stopOnDefect'] ?? $phpunitConfiguration->stopOnDefect(); - $arguments['stopOnError'] = $arguments['stopOnError'] ?? $phpunitConfiguration->stopOnError(); - $arguments['stopOnFailure'] = $arguments['stopOnFailure'] ?? $phpunitConfiguration->stopOnFailure(); - $arguments['stopOnWarning'] = $arguments['stopOnWarning'] ?? $phpunitConfiguration->stopOnWarning(); - $arguments['stopOnIncomplete'] = $arguments['stopOnIncomplete'] ?? $phpunitConfiguration->stopOnIncomplete(); - $arguments['stopOnRisky'] = $arguments['stopOnRisky'] ?? $phpunitConfiguration->stopOnRisky(); - $arguments['stopOnSkipped'] = $arguments['stopOnSkipped'] ?? $phpunitConfiguration->stopOnSkipped(); - $arguments['failOnEmptyTestSuite'] = $arguments['failOnEmptyTestSuite'] ?? $phpunitConfiguration->failOnEmptyTestSuite(); - $arguments['failOnIncomplete'] = $arguments['failOnIncomplete'] ?? $phpunitConfiguration->failOnIncomplete(); - $arguments['failOnRisky'] = $arguments['failOnRisky'] ?? $phpunitConfiguration->failOnRisky(); - $arguments['failOnSkipped'] = $arguments['failOnSkipped'] ?? $phpunitConfiguration->failOnSkipped(); - $arguments['failOnWarning'] = $arguments['failOnWarning'] ?? $phpunitConfiguration->failOnWarning(); - $arguments['enforceTimeLimit'] = $arguments['enforceTimeLimit'] ?? $phpunitConfiguration->enforceTimeLimit(); - $arguments['defaultTimeLimit'] = $arguments['defaultTimeLimit'] ?? $phpunitConfiguration->defaultTimeLimit(); - $arguments['timeoutForSmallTests'] = $arguments['timeoutForSmallTests'] ?? $phpunitConfiguration->timeoutForSmallTests(); - $arguments['timeoutForMediumTests'] = $arguments['timeoutForMediumTests'] ?? $phpunitConfiguration->timeoutForMediumTests(); - $arguments['timeoutForLargeTests'] = $arguments['timeoutForLargeTests'] ?? $phpunitConfiguration->timeoutForLargeTests(); - $arguments['reportUselessTests'] = $arguments['reportUselessTests'] ?? $phpunitConfiguration->beStrictAboutTestsThatDoNotTestAnything(); - $arguments['strictCoverage'] = $arguments['strictCoverage'] ?? $phpunitConfiguration->beStrictAboutCoversAnnotation(); - $arguments['ignoreDeprecatedCodeUnitsFromCodeCoverage'] = $arguments['ignoreDeprecatedCodeUnitsFromCodeCoverage'] ?? $codeCoverageConfiguration->ignoreDeprecatedCodeUnits(); - $arguments['disallowTestOutput'] = $arguments['disallowTestOutput'] ?? $phpunitConfiguration->beStrictAboutOutputDuringTests(); - $arguments['disallowTodoAnnotatedTests'] = $arguments['disallowTodoAnnotatedTests'] ?? $phpunitConfiguration->beStrictAboutTodoAnnotatedTests(); - $arguments['beStrictAboutResourceUsageDuringSmallTests'] = $arguments['beStrictAboutResourceUsageDuringSmallTests'] ?? $phpunitConfiguration->beStrictAboutResourceUsageDuringSmallTests(); - $arguments['verbose'] = $arguments['verbose'] ?? $phpunitConfiguration->verbose(); - $arguments['reverseDefectList'] = $arguments['reverseDefectList'] ?? $phpunitConfiguration->reverseDefectList(); - $arguments['forceCoversAnnotation'] = $arguments['forceCoversAnnotation'] ?? $phpunitConfiguration->forceCoversAnnotation(); - $arguments['disableCodeCoverageIgnore'] = $arguments['disableCodeCoverageIgnore'] ?? $codeCoverageConfiguration->disableCodeCoverageIgnore(); - $arguments['registerMockObjectsFromTestArgumentsRecursively'] = $arguments['registerMockObjectsFromTestArgumentsRecursively'] ?? $phpunitConfiguration->registerMockObjectsFromTestArgumentsRecursively(); - $arguments['noInteraction'] = $arguments['noInteraction'] ?? $phpunitConfiguration->noInteraction(); - $arguments['executionOrder'] = $arguments['executionOrder'] ?? $phpunitConfiguration->executionOrder(); - $arguments['resolveDependencies'] = $arguments['resolveDependencies'] ?? $phpunitConfiguration->resolveDependencies(); - - if (!isset($arguments['bootstrap']) && $phpunitConfiguration->hasBootstrap()) { - $arguments['bootstrap'] = $phpunitConfiguration->bootstrap(); - } - - if (!isset($arguments['cacheResultFile']) && $phpunitConfiguration->hasCacheResultFile()) { - $arguments['cacheResultFile'] = $phpunitConfiguration->cacheResultFile(); - } - - if (!isset($arguments['executionOrderDefects'])) { - $arguments['executionOrderDefects'] = $phpunitConfiguration->defectsFirst() ? TestSuiteSorter::ORDER_DEFECTS_FIRST : TestSuiteSorter::ORDER_DEFAULT; - } - - if ($phpunitConfiguration->conflictBetweenPrinterClassAndTestdox()) { - $arguments['conflictBetweenPrinterClassAndTestdox'] = true; - } - - $groupCliArgs = []; - - if (!empty($arguments['groups'])) { - $groupCliArgs = $arguments['groups']; - } - - $groupConfiguration = $arguments['configurationObject']->groups(); - - if (!isset($arguments['groups']) && $groupConfiguration->hasInclude()) { - $arguments['groups'] = $groupConfiguration->include()->asArrayOfStrings(); - } - - if (!isset($arguments['excludeGroups']) && $groupConfiguration->hasExclude()) { - $arguments['excludeGroups'] = array_diff($groupConfiguration->exclude()->asArrayOfStrings(), $groupCliArgs); - } - - $extensionHandler = new ExtensionHandler; - - foreach ($arguments['configurationObject']->extensions() as $extension) { - $extensionHandler->registerExtension($extension, $this); - } - - foreach ($arguments['configurationObject']->listeners() as $listener) { - $arguments['listeners'][] = $extensionHandler->createTestListenerInstance($listener); - } - - unset($extensionHandler); - - foreach ($arguments['unavailableExtensions'] as $extension) { - $arguments['warnings'][] = sprintf( - 'Extension "%s" is not available', - $extension - ); - } - - $loggingConfiguration = $arguments['configurationObject']->logging(); - - if (!isset($arguments['noLogging'])) { - if ($loggingConfiguration->hasText()) { - $arguments['listeners'][] = new DefaultResultPrinter( - $loggingConfiguration->text()->target()->path(), - true - ); - } - - if (!isset($arguments['teamcityLogfile']) && $loggingConfiguration->hasTeamCity()) { - $arguments['teamcityLogfile'] = $loggingConfiguration->teamCity()->target()->path(); - } - - if (!isset($arguments['junitLogfile']) && $loggingConfiguration->hasJunit()) { - $arguments['junitLogfile'] = $loggingConfiguration->junit()->target()->path(); - } - - if (!isset($arguments['testdoxHTMLFile']) && $loggingConfiguration->hasTestDoxHtml()) { - $arguments['testdoxHTMLFile'] = $loggingConfiguration->testDoxHtml()->target()->path(); - } - - if (!isset($arguments['testdoxTextFile']) && $loggingConfiguration->hasTestDoxText()) { - $arguments['testdoxTextFile'] = $loggingConfiguration->testDoxText()->target()->path(); - } - - if (!isset($arguments['testdoxXMLFile']) && $loggingConfiguration->hasTestDoxXml()) { - $arguments['testdoxXMLFile'] = $loggingConfiguration->testDoxXml()->target()->path(); - } - } - - $testdoxGroupConfiguration = $arguments['configurationObject']->testdoxGroups(); - - if (!isset($arguments['testdoxGroups']) && $testdoxGroupConfiguration->hasInclude()) { - $arguments['testdoxGroups'] = $testdoxGroupConfiguration->include()->asArrayOfStrings(); - } - - if (!isset($arguments['testdoxExcludeGroups']) && $testdoxGroupConfiguration->hasExclude()) { - $arguments['testdoxExcludeGroups'] = $testdoxGroupConfiguration->exclude()->asArrayOfStrings(); - } - } - - $extensionHandler = new ExtensionHandler; - - foreach ($arguments['extensions'] as $extension) { - $extensionHandler->registerExtension($extension, $this); - } - - unset($extensionHandler); - - $arguments['backupGlobals'] = $arguments['backupGlobals'] ?? null; - $arguments['backupStaticAttributes'] = $arguments['backupStaticAttributes'] ?? null; - $arguments['beStrictAboutChangesToGlobalState'] = $arguments['beStrictAboutChangesToGlobalState'] ?? null; - $arguments['beStrictAboutResourceUsageDuringSmallTests'] = $arguments['beStrictAboutResourceUsageDuringSmallTests'] ?? false; - $arguments['cacheResult'] = $arguments['cacheResult'] ?? true; - $arguments['colors'] = $arguments['colors'] ?? DefaultResultPrinter::COLOR_DEFAULT; - $arguments['columns'] = $arguments['columns'] ?? 80; - $arguments['convertDeprecationsToExceptions'] = $arguments['convertDeprecationsToExceptions'] ?? false; - $arguments['convertErrorsToExceptions'] = $arguments['convertErrorsToExceptions'] ?? true; - $arguments['convertNoticesToExceptions'] = $arguments['convertNoticesToExceptions'] ?? true; - $arguments['convertWarningsToExceptions'] = $arguments['convertWarningsToExceptions'] ?? true; - $arguments['crap4jThreshold'] = $arguments['crap4jThreshold'] ?? 30; - $arguments['disallowTestOutput'] = $arguments['disallowTestOutput'] ?? false; - $arguments['disallowTodoAnnotatedTests'] = $arguments['disallowTodoAnnotatedTests'] ?? false; - $arguments['defaultTimeLimit'] = $arguments['defaultTimeLimit'] ?? 0; - $arguments['enforceTimeLimit'] = $arguments['enforceTimeLimit'] ?? false; - $arguments['excludeGroups'] = $arguments['excludeGroups'] ?? []; - $arguments['executionOrder'] = $arguments['executionOrder'] ?? TestSuiteSorter::ORDER_DEFAULT; - $arguments['executionOrderDefects'] = $arguments['executionOrderDefects'] ?? TestSuiteSorter::ORDER_DEFAULT; - $arguments['failOnIncomplete'] = $arguments['failOnIncomplete'] ?? false; - $arguments['failOnRisky'] = $arguments['failOnRisky'] ?? false; - $arguments['failOnSkipped'] = $arguments['failOnSkipped'] ?? false; - $arguments['failOnWarning'] = $arguments['failOnWarning'] ?? false; - $arguments['groups'] = $arguments['groups'] ?? []; - $arguments['noInteraction'] = $arguments['noInteraction'] ?? false; - $arguments['processIsolation'] = $arguments['processIsolation'] ?? false; - $arguments['randomOrderSeed'] = $arguments['randomOrderSeed'] ?? time(); - $arguments['registerMockObjectsFromTestArgumentsRecursively'] = $arguments['registerMockObjectsFromTestArgumentsRecursively'] ?? false; - $arguments['repeat'] = $arguments['repeat'] ?? false; - $arguments['reportHighLowerBound'] = $arguments['reportHighLowerBound'] ?? 90; - $arguments['reportLowUpperBound'] = $arguments['reportLowUpperBound'] ?? 50; - $arguments['reportUselessTests'] = $arguments['reportUselessTests'] ?? true; - $arguments['reverseList'] = $arguments['reverseList'] ?? false; - $arguments['resolveDependencies'] = $arguments['resolveDependencies'] ?? true; - $arguments['stopOnError'] = $arguments['stopOnError'] ?? false; - $arguments['stopOnFailure'] = $arguments['stopOnFailure'] ?? false; - $arguments['stopOnIncomplete'] = $arguments['stopOnIncomplete'] ?? false; - $arguments['stopOnRisky'] = $arguments['stopOnRisky'] ?? false; - $arguments['stopOnSkipped'] = $arguments['stopOnSkipped'] ?? false; - $arguments['stopOnWarning'] = $arguments['stopOnWarning'] ?? false; - $arguments['stopOnDefect'] = $arguments['stopOnDefect'] ?? false; - $arguments['strictCoverage'] = $arguments['strictCoverage'] ?? false; - $arguments['testdoxExcludeGroups'] = $arguments['testdoxExcludeGroups'] ?? []; - $arguments['testdoxGroups'] = $arguments['testdoxGroups'] ?? []; - $arguments['timeoutForLargeTests'] = $arguments['timeoutForLargeTests'] ?? 60; - $arguments['timeoutForMediumTests'] = $arguments['timeoutForMediumTests'] ?? 10; - $arguments['timeoutForSmallTests'] = $arguments['timeoutForSmallTests'] ?? 1; - $arguments['verbose'] = $arguments['verbose'] ?? false; - - if ($arguments['reportLowUpperBound'] > $arguments['reportHighLowerBound']) { - $arguments['reportLowUpperBound'] = 50; - $arguments['reportHighLowerBound'] = 90; - } - } - - private function processSuiteFilters(TestSuite $suite, array $arguments): void - { - if (!$arguments['filter'] && - empty($arguments['groups']) && - empty($arguments['excludeGroups']) && - empty($arguments['testsCovering']) && - empty($arguments['testsUsing'])) { - return; - } - - $filterFactory = new Factory; - - if (!empty($arguments['excludeGroups'])) { - $filterFactory->addFilter( - new ReflectionClass(ExcludeGroupFilterIterator::class), - $arguments['excludeGroups'] - ); - } - - if (!empty($arguments['groups'])) { - $filterFactory->addFilter( - new ReflectionClass(IncludeGroupFilterIterator::class), - $arguments['groups'] - ); - } - - if (!empty($arguments['testsCovering'])) { - $filterFactory->addFilter( - new ReflectionClass(IncludeGroupFilterIterator::class), - array_map( - static function (string $name): string - { - return '__phpunit_covers_' . $name; - }, - $arguments['testsCovering'] - ) - ); - } - - if (!empty($arguments['testsUsing'])) { - $filterFactory->addFilter( - new ReflectionClass(IncludeGroupFilterIterator::class), - array_map( - static function (string $name): string - { - return '__phpunit_uses_' . $name; - }, - $arguments['testsUsing'] - ) - ); - } - - if ($arguments['filter']) { - $filterFactory->addFilter( - new ReflectionClass(NameFilterIterator::class), - $arguments['filter'] - ); - } - - $suite->injectFilter($filterFactory); - } - - private function writeMessage(string $type, string $message): void - { - if (!$this->messagePrinted) { - $this->write("\n"); - } - - $this->write( - sprintf( - "%-15s%s\n", - $type . ':', - $message - ) - ); - - $this->messagePrinted = true; - } - - private function createPrinter(string $class, array $arguments): ResultPrinter - { - $object = new $class( - (isset($arguments['stderr']) && $arguments['stderr'] === true) ? 'php://stderr' : null, - $arguments['verbose'], - $arguments['colors'], - $arguments['debug'], - $arguments['columns'], - $arguments['reverseList'] - ); - - assert($object instanceof ResultPrinter); - - return $object; - } - - private function codeCoverageGenerationStart(string $format): void - { - $this->write( - sprintf( - "\nGenerating code coverage report in %s format ... ", - $format - ) - ); - - $this->timer->start(); - } - - private function codeCoverageGenerationSucceeded(): void - { - $this->write( - sprintf( - "done [%s]\n", - $this->timer->stop()->asString() - ) - ); - } - - private function codeCoverageGenerationFailed(\Exception $e): void - { - $this->write( - sprintf( - "failed [%s]\n%s\n", - $this->timer->stop()->asString(), - $e->getMessage() - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/TestSuiteMapper.php b/vendor/phpunit/phpunit/src/TextUI/TestSuiteMapper.php deleted file mode 100644 index 170e6602..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/TestSuiteMapper.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 PHPUnit\TextUI; - -use const PHP_VERSION; -use function explode; -use function in_array; -use function is_dir; -use function is_file; -use function strpos; -use function version_compare; -use PHPUnit\Framework\Exception as FrameworkException; -use PHPUnit\Framework\TestSuite as TestSuiteObject; -use PHPUnit\TextUI\XmlConfiguration\TestSuiteCollection; -use SebastianBergmann\FileIterator\Facade; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TestSuiteMapper -{ - /** - * @throws RuntimeException - * @throws TestDirectoryNotFoundException - * @throws TestFileNotFoundException - */ - public function map(TestSuiteCollection $configuration, string $filter): TestSuiteObject - { - try { - $filterAsArray = $filter ? explode(',', $filter) : []; - $result = new TestSuiteObject; - - foreach ($configuration as $testSuiteConfiguration) { - if (!empty($filterAsArray) && !in_array($testSuiteConfiguration->name(), $filterAsArray, true)) { - continue; - } - - $testSuite = new TestSuiteObject($testSuiteConfiguration->name()); - $testSuiteEmpty = true; - - $exclude = []; - - foreach ($testSuiteConfiguration->exclude()->asArray() as $file) { - $exclude[] = $file->path(); - } - - foreach ($testSuiteConfiguration->directories() as $directory) { - if (!version_compare(PHP_VERSION, $directory->phpVersion(), $directory->phpVersionOperator()->asString())) { - continue; - } - - $files = (new Facade)->getFilesAsArray( - $directory->path(), - $directory->suffix(), - $directory->prefix(), - $exclude - ); - - if (!empty($files)) { - $testSuite->addTestFiles($files); - - $testSuiteEmpty = false; - } elseif (strpos($directory->path(), '*') === false && !is_dir($directory->path())) { - throw new TestDirectoryNotFoundException($directory->path()); - } - } - - foreach ($testSuiteConfiguration->files() as $file) { - if (!is_file($file->path())) { - throw new TestFileNotFoundException($file->path()); - } - - if (!version_compare(PHP_VERSION, $file->phpVersion(), $file->phpVersionOperator()->asString())) { - continue; - } - - $testSuite->addTestFile($file->path()); - - $testSuiteEmpty = false; - } - - if (!$testSuiteEmpty) { - $result->addTest($testSuite); - } - } - - return $result; - } catch (FrameworkException $e) { - throw new RuntimeException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/CodeCoverage.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/CodeCoverage.php deleted file mode 100644 index 80abfac7..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/CodeCoverage.php +++ /dev/null @@ -1,363 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage; - -use function count; -use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Filter\DirectoryCollection; -use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Clover; -use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Cobertura; -use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Crap4j; -use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Html; -use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Php; -use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Text; -use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Xml; -use PHPUnit\TextUI\XmlConfiguration\Directory; -use PHPUnit\TextUI\XmlConfiguration\Exception; -use PHPUnit\TextUI\XmlConfiguration\FileCollection; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class CodeCoverage -{ - /** - * @var ?Directory - */ - private $cacheDirectory; - - /** - * @var DirectoryCollection - */ - private $directories; - - /** - * @var FileCollection - */ - private $files; - - /** - * @var DirectoryCollection - */ - private $excludeDirectories; - - /** - * @var FileCollection - */ - private $excludeFiles; - - /** - * @var bool - */ - private $pathCoverage; - - /** - * @var bool - */ - private $includeUncoveredFiles; - - /** - * @var bool - */ - private $processUncoveredFiles; - - /** - * @var bool - */ - private $ignoreDeprecatedCodeUnits; - - /** - * @var bool - */ - private $disableCodeCoverageIgnore; - - /** - * @var ?Clover - */ - private $clover; - - /** - * @var ?Cobertura - */ - private $cobertura; - - /** - * @var ?Crap4j - */ - private $crap4j; - - /** - * @var ?Html - */ - private $html; - - /** - * @var ?Php - */ - private $php; - - /** - * @var ?Text - */ - private $text; - - /** - * @var ?Xml - */ - private $xml; - - public function __construct(?Directory $cacheDirectory, DirectoryCollection $directories, FileCollection $files, DirectoryCollection $excludeDirectories, FileCollection $excludeFiles, bool $pathCoverage, bool $includeUncoveredFiles, bool $processUncoveredFiles, bool $ignoreDeprecatedCodeUnits, bool $disableCodeCoverageIgnore, ?Clover $clover, ?Cobertura $cobertura, ?Crap4j $crap4j, ?Html $html, ?Php $php, ?Text $text, ?Xml $xml) - { - $this->cacheDirectory = $cacheDirectory; - $this->directories = $directories; - $this->files = $files; - $this->excludeDirectories = $excludeDirectories; - $this->excludeFiles = $excludeFiles; - $this->pathCoverage = $pathCoverage; - $this->includeUncoveredFiles = $includeUncoveredFiles; - $this->processUncoveredFiles = $processUncoveredFiles; - $this->ignoreDeprecatedCodeUnits = $ignoreDeprecatedCodeUnits; - $this->disableCodeCoverageIgnore = $disableCodeCoverageIgnore; - $this->clover = $clover; - $this->cobertura = $cobertura; - $this->crap4j = $crap4j; - $this->html = $html; - $this->php = $php; - $this->text = $text; - $this->xml = $xml; - } - - /** - * @psalm-assert-if-true !null $this->cacheDirectory - */ - public function hasCacheDirectory(): bool - { - return $this->cacheDirectory !== null; - } - - /** - * @throws Exception - */ - public function cacheDirectory(): Directory - { - if (!$this->hasCacheDirectory()) { - throw new Exception( - 'No cache directory has been configured' - ); - } - - return $this->cacheDirectory; - } - - public function hasNonEmptyListOfFilesToBeIncludedInCodeCoverageReport(): bool - { - return count($this->directories) > 0 || count($this->files) > 0; - } - - public function directories(): DirectoryCollection - { - return $this->directories; - } - - public function files(): FileCollection - { - return $this->files; - } - - public function excludeDirectories(): DirectoryCollection - { - return $this->excludeDirectories; - } - - public function excludeFiles(): FileCollection - { - return $this->excludeFiles; - } - - public function pathCoverage(): bool - { - return $this->pathCoverage; - } - - public function includeUncoveredFiles(): bool - { - return $this->includeUncoveredFiles; - } - - public function ignoreDeprecatedCodeUnits(): bool - { - return $this->ignoreDeprecatedCodeUnits; - } - - public function disableCodeCoverageIgnore(): bool - { - return $this->disableCodeCoverageIgnore; - } - - public function processUncoveredFiles(): bool - { - return $this->processUncoveredFiles; - } - - /** - * @psalm-assert-if-true !null $this->clover - */ - public function hasClover(): bool - { - return $this->clover !== null; - } - - /** - * @throws Exception - */ - public function clover(): Clover - { - if (!$this->hasClover()) { - throw new Exception( - 'Code Coverage report "Clover XML" has not been configured' - ); - } - - return $this->clover; - } - - /** - * @psalm-assert-if-true !null $this->cobertura - */ - public function hasCobertura(): bool - { - return $this->cobertura !== null; - } - - /** - * @throws Exception - */ - public function cobertura(): Cobertura - { - if (!$this->hasCobertura()) { - throw new Exception( - 'Code Coverage report "Cobertura XML" has not been configured' - ); - } - - return $this->cobertura; - } - - /** - * @psalm-assert-if-true !null $this->crap4j - */ - public function hasCrap4j(): bool - { - return $this->crap4j !== null; - } - - /** - * @throws Exception - */ - public function crap4j(): Crap4j - { - if (!$this->hasCrap4j()) { - throw new Exception( - 'Code Coverage report "Crap4J" has not been configured' - ); - } - - return $this->crap4j; - } - - /** - * @psalm-assert-if-true !null $this->html - */ - public function hasHtml(): bool - { - return $this->html !== null; - } - - /** - * @throws Exception - */ - public function html(): Html - { - if (!$this->hasHtml()) { - throw new Exception( - 'Code Coverage report "HTML" has not been configured' - ); - } - - return $this->html; - } - - /** - * @psalm-assert-if-true !null $this->php - */ - public function hasPhp(): bool - { - return $this->php !== null; - } - - /** - * @throws Exception - */ - public function php(): Php - { - if (!$this->hasPhp()) { - throw new Exception( - 'Code Coverage report "PHP" has not been configured' - ); - } - - return $this->php; - } - - /** - * @psalm-assert-if-true !null $this->text - */ - public function hasText(): bool - { - return $this->text !== null; - } - - /** - * @throws Exception - */ - public function text(): Text - { - if (!$this->hasText()) { - throw new Exception( - 'Code Coverage report "Text" has not been configured' - ); - } - - return $this->text; - } - - /** - * @psalm-assert-if-true !null $this->xml - */ - public function hasXml(): bool - { - return $this->xml !== null; - } - - /** - * @throws Exception - */ - public function xml(): Xml - { - if (!$this->hasXml()) { - throw new Exception( - 'Code Coverage report "XML" has not been configured' - ); - } - - return $this->xml; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Filter/Directory.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Filter/Directory.php deleted file mode 100644 index 91659f4d..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Filter/Directory.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 PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Filter; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class Directory -{ - /** - * @var string - */ - private $path; - - /** - * @var string - */ - private $prefix; - - /** - * @var string - */ - private $suffix; - - /** - * @var string - */ - private $group; - - public function __construct(string $path, string $prefix, string $suffix, string $group) - { - $this->path = $path; - $this->prefix = $prefix; - $this->suffix = $suffix; - $this->group = $group; - } - - public function path(): string - { - return $this->path; - } - - public function prefix(): string - { - return $this->prefix; - } - - public function suffix(): string - { - return $this->suffix; - } - - public function group(): string - { - return $this->group; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Filter/DirectoryCollection.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Filter/DirectoryCollection.php deleted file mode 100644 index 88ec1e38..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Filter/DirectoryCollection.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Filter; - -use function count; -use Countable; -use IteratorAggregate; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - * - * @template-implements IteratorAggregate - */ -final class DirectoryCollection implements Countable, IteratorAggregate -{ - /** - * @var Directory[] - */ - private $directories; - - /** - * @param Directory[] $directories - */ - public static function fromArray(array $directories): self - { - return new self(...$directories); - } - - private function __construct(Directory ...$directories) - { - $this->directories = $directories; - } - - /** - * @return Directory[] - */ - public function asArray(): array - { - return $this->directories; - } - - public function count(): int - { - return count($this->directories); - } - - public function getIterator(): DirectoryCollectionIterator - { - return new DirectoryCollectionIterator($this); - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Filter/DirectoryCollectionIterator.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Filter/DirectoryCollectionIterator.php deleted file mode 100644 index f2fee25d..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Filter/DirectoryCollectionIterator.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Filter; - -use function count; -use function iterator_count; -use Countable; -use Iterator; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @template-implements Iterator - */ -final class DirectoryCollectionIterator implements Countable, Iterator -{ - /** - * @var Directory[] - */ - private $directories; - - /** - * @var int - */ - private $position; - - public function __construct(DirectoryCollection $directories) - { - $this->directories = $directories->asArray(); - } - - public function count(): int - { - return iterator_count($this); - } - - public function rewind(): void - { - $this->position = 0; - } - - public function valid(): bool - { - return $this->position < count($this->directories); - } - - public function key(): int - { - return $this->position; - } - - public function current(): Directory - { - return $this->directories[$this->position]; - } - - public function next(): void - { - $this->position++; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/FilterMapper.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/FilterMapper.php deleted file mode 100644 index 102c96eb..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/FilterMapper.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage; - -use SebastianBergmann\CodeCoverage\Filter; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class FilterMapper -{ - public function map(Filter $filter, CodeCoverage $configuration): void - { - foreach ($configuration->directories() as $directory) { - $filter->includeDirectory( - $directory->path(), - $directory->suffix(), - $directory->prefix() - ); - } - - foreach ($configuration->files() as $file) { - $filter->includeFile($file->path()); - } - - foreach ($configuration->excludeDirectories() as $directory) { - $filter->excludeDirectory( - $directory->path(), - $directory->suffix(), - $directory->prefix() - ); - } - - foreach ($configuration->excludeFiles() as $file) { - $filter->excludeFile($file->path()); - } - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Clover.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Clover.php deleted file mode 100644 index b1094ec3..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Clover.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report; - -use PHPUnit\TextUI\XmlConfiguration\File; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class Clover -{ - /** - * @var File - */ - private $target; - - public function __construct(File $target) - { - $this->target = $target; - } - - public function target(): File - { - return $this->target; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Cobertura.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Cobertura.php deleted file mode 100644 index f831ac09..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Cobertura.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report; - -use PHPUnit\TextUI\XmlConfiguration\File; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class Cobertura -{ - /** - * @var File - */ - private $target; - - public function __construct(File $target) - { - $this->target = $target; - } - - public function target(): File - { - return $this->target; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Crap4j.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Crap4j.php deleted file mode 100644 index 4904775d..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Crap4j.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report; - -use PHPUnit\TextUI\XmlConfiguration\File; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class Crap4j -{ - /** - * @var File - */ - private $target; - - /** - * @var int - */ - private $threshold; - - public function __construct(File $target, int $threshold) - { - $this->target = $target; - $this->threshold = $threshold; - } - - public function target(): File - { - return $this->target; - } - - public function threshold(): int - { - return $this->threshold; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Html.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Html.php deleted file mode 100644 index ce3d0284..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Html.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. - */ -namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report; - -use PHPUnit\TextUI\XmlConfiguration\Directory; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class Html -{ - /** - * @var Directory - */ - private $target; - - /** - * @var int - */ - private $lowUpperBound; - - /** - * @var int - */ - private $highLowerBound; - - public function __construct(Directory $target, int $lowUpperBound, int $highLowerBound) - { - $this->target = $target; - $this->lowUpperBound = $lowUpperBound; - $this->highLowerBound = $highLowerBound; - } - - public function target(): Directory - { - return $this->target; - } - - public function lowUpperBound(): int - { - return $this->lowUpperBound; - } - - public function highLowerBound(): int - { - return $this->highLowerBound; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Php.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Php.php deleted file mode 100644 index dc5d32ea..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Php.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report; - -use PHPUnit\TextUI\XmlConfiguration\File; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class Php -{ - /** - * @var File - */ - private $target; - - public function __construct(File $target) - { - $this->target = $target; - } - - public function target(): File - { - return $this->target; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Text.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Text.php deleted file mode 100644 index cb7470d3..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Text.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. - */ -namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report; - -use PHPUnit\TextUI\XmlConfiguration\File; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class Text -{ - /** - * @var File - */ - private $target; - - /** - * @var bool - */ - private $showUncoveredFiles; - - /** - * @var bool - */ - private $showOnlySummary; - - public function __construct(File $target, bool $showUncoveredFiles, bool $showOnlySummary) - { - $this->target = $target; - $this->showUncoveredFiles = $showUncoveredFiles; - $this->showOnlySummary = $showOnlySummary; - } - - public function target(): File - { - return $this->target; - } - - public function showUncoveredFiles(): bool - { - return $this->showUncoveredFiles; - } - - public function showOnlySummary(): bool - { - return $this->showOnlySummary; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Xml.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Xml.php deleted file mode 100644 index 34073bd5..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/Report/Xml.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report; - -use PHPUnit\TextUI\XmlConfiguration\Directory; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class Xml -{ - /** - * @var Directory - */ - private $target; - - public function __construct(Directory $target) - { - $this->target = $target; - } - - public function target(): Directory - { - return $this->target; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Configuration.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Configuration.php deleted file mode 100644 index 4067e2f8..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Configuration.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 PHPUnit\TextUI\XmlConfiguration; - -use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\CodeCoverage; -use PHPUnit\TextUI\XmlConfiguration\Logging\Logging; -use PHPUnit\Util\Xml\ValidationResult; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class Configuration -{ - /** - * @var string - */ - private $filename; - - /** - * @var ValidationResult - */ - private $validationResult; - - /** - * @var ExtensionCollection - */ - private $extensions; - - /** - * @var CodeCoverage - */ - private $codeCoverage; - - /** - * @var Groups - */ - private $groups; - - /** - * @var Groups - */ - private $testdoxGroups; - - /** - * @var ExtensionCollection - */ - private $listeners; - - /** - * @var Logging - */ - private $logging; - - /** - * @var Php - */ - private $php; - - /** - * @var PHPUnit - */ - private $phpunit; - - /** - * @var TestSuiteCollection - */ - private $testSuite; - - public function __construct(string $filename, ValidationResult $validationResult, ExtensionCollection $extensions, CodeCoverage $codeCoverage, Groups $groups, Groups $testdoxGroups, ExtensionCollection $listeners, Logging $logging, Php $php, PHPUnit $phpunit, TestSuiteCollection $testSuite) - { - $this->filename = $filename; - $this->validationResult = $validationResult; - $this->extensions = $extensions; - $this->codeCoverage = $codeCoverage; - $this->groups = $groups; - $this->testdoxGroups = $testdoxGroups; - $this->listeners = $listeners; - $this->logging = $logging; - $this->php = $php; - $this->phpunit = $phpunit; - $this->testSuite = $testSuite; - } - - public function filename(): string - { - return $this->filename; - } - - public function hasValidationErrors(): bool - { - return $this->validationResult->hasValidationErrors(); - } - - public function validationErrors(): string - { - return $this->validationResult->asString(); - } - - public function extensions(): ExtensionCollection - { - return $this->extensions; - } - - public function codeCoverage(): CodeCoverage - { - return $this->codeCoverage; - } - - public function groups(): Groups - { - return $this->groups; - } - - public function testdoxGroups(): Groups - { - return $this->testdoxGroups; - } - - public function listeners(): ExtensionCollection - { - return $this->listeners; - } - - public function logging(): Logging - { - return $this->logging; - } - - public function php(): Php - { - return $this->php; - } - - public function phpunit(): PHPUnit - { - return $this->phpunit; - } - - public function testSuite(): TestSuiteCollection - { - return $this->testSuite; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Exception.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Exception.php deleted file mode 100644 index 162b37e8..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Exception.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use RuntimeException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Exception extends RuntimeException implements \PHPUnit\Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Filesystem/Directory.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Filesystem/Directory.php deleted file mode 100644 index b0fdf64f..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Filesystem/Directory.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 PHPUnit\TextUI\XmlConfiguration; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class Directory -{ - /** - * @var string - */ - private $path; - - public function __construct(string $path) - { - $this->path = $path; - } - - public function path(): string - { - return $this->path; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Filesystem/DirectoryCollection.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Filesystem/DirectoryCollection.php deleted file mode 100644 index cb840892..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Filesystem/DirectoryCollection.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use function count; -use Countable; -use IteratorAggregate; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - * - * @template-implements IteratorAggregate - */ -final class DirectoryCollection implements Countable, IteratorAggregate -{ - /** - * @var Directory[] - */ - private $directories; - - /** - * @param Directory[] $directories - */ - public static function fromArray(array $directories): self - { - return new self(...$directories); - } - - private function __construct(Directory ...$directories) - { - $this->directories = $directories; - } - - /** - * @return Directory[] - */ - public function asArray(): array - { - return $this->directories; - } - - public function count(): int - { - return count($this->directories); - } - - public function getIterator(): DirectoryCollectionIterator - { - return new DirectoryCollectionIterator($this); - } - - public function isEmpty(): bool - { - return $this->count() === 0; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Filesystem/DirectoryCollectionIterator.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Filesystem/DirectoryCollectionIterator.php deleted file mode 100644 index 4b092744..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Filesystem/DirectoryCollectionIterator.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use function count; -use function iterator_count; -use Countable; -use Iterator; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @template-implements Iterator - */ -final class DirectoryCollectionIterator implements Countable, Iterator -{ - /** - * @var Directory[] - */ - private $directories; - - /** - * @var int - */ - private $position; - - public function __construct(DirectoryCollection $directories) - { - $this->directories = $directories->asArray(); - } - - public function count(): int - { - return iterator_count($this); - } - - public function rewind(): void - { - $this->position = 0; - } - - public function valid(): bool - { - return $this->position < count($this->directories); - } - - public function key(): int - { - return $this->position; - } - - public function current(): Directory - { - return $this->directories[$this->position]; - } - - public function next(): void - { - $this->position++; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Filesystem/File.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Filesystem/File.php deleted file mode 100644 index 6bdd1c24..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Filesystem/File.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 PHPUnit\TextUI\XmlConfiguration; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class File -{ - /** - * @var string - */ - private $path; - - public function __construct(string $path) - { - $this->path = $path; - } - - public function path(): string - { - return $this->path; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Filesystem/FileCollection.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Filesystem/FileCollection.php deleted file mode 100644 index 60e7e401..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Filesystem/FileCollection.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use function count; -use Countable; -use IteratorAggregate; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - * - * @template-implements IteratorAggregate - */ -final class FileCollection implements Countable, IteratorAggregate -{ - /** - * @var File[] - */ - private $files; - - /** - * @param File[] $files - */ - public static function fromArray(array $files): self - { - return new self(...$files); - } - - private function __construct(File ...$files) - { - $this->files = $files; - } - - /** - * @return File[] - */ - public function asArray(): array - { - return $this->files; - } - - public function count(): int - { - return count($this->files); - } - - public function getIterator(): FileCollectionIterator - { - return new FileCollectionIterator($this); - } - - public function isEmpty(): bool - { - return $this->count() === 0; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Filesystem/FileCollectionIterator.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Filesystem/FileCollectionIterator.php deleted file mode 100644 index 0ce4273d..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Filesystem/FileCollectionIterator.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use function count; -use function iterator_count; -use Countable; -use Iterator; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @template-implements Iterator - */ -final class FileCollectionIterator implements Countable, Iterator -{ - /** - * @var File[] - */ - private $files; - - /** - * @var int - */ - private $position; - - public function __construct(FileCollection $files) - { - $this->files = $files->asArray(); - } - - public function count(): int - { - return iterator_count($this); - } - - public function rewind(): void - { - $this->position = 0; - } - - public function valid(): bool - { - return $this->position < count($this->files); - } - - public function key(): int - { - return $this->position; - } - - public function current(): File - { - return $this->files[$this->position]; - } - - public function next(): void - { - $this->position++; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Generator.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Generator.php deleted file mode 100644 index cc77b1a3..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Generator.php +++ /dev/null @@ -1,73 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use function str_replace; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Generator -{ - /** - * @var string - */ - private const TEMPLATE = <<<'EOT' - - - - - {tests_directory} - - - - - - {src_directory} - - - - -EOT; - - public function generateDefaultConfiguration(string $phpunitVersion, string $bootstrapScript, string $testsDirectory, string $srcDirectory, string $cacheDirectory): string - { - return str_replace( - [ - '{phpunit_version}', - '{bootstrap_script}', - '{tests_directory}', - '{src_directory}', - '{cache_directory}', - ], - [ - $phpunitVersion, - $bootstrapScript, - $testsDirectory, - $srcDirectory, - $cacheDirectory, - ], - self::TEMPLATE - ); - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Group/Group.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Group/Group.php deleted file mode 100644 index bb0d9252..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Group/Group.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 PHPUnit\TextUI\XmlConfiguration; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class Group -{ - /** - * @var string - */ - private $name; - - public function __construct(string $name) - { - $this->name = $name; - } - - public function name(): string - { - return $this->name; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Group/GroupCollection.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Group/GroupCollection.php deleted file mode 100644 index 735d8af1..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Group/GroupCollection.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use IteratorAggregate; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - * - * @template-implements IteratorAggregate - */ -final class GroupCollection implements IteratorAggregate -{ - /** - * @var Group[] - */ - private $groups; - - /** - * @param Group[] $groups - */ - public static function fromArray(array $groups): self - { - return new self(...$groups); - } - - private function __construct(Group ...$groups) - { - $this->groups = $groups; - } - - /** - * @return Group[] - */ - public function asArray(): array - { - return $this->groups; - } - - /** - * @return string[] - */ - public function asArrayOfStrings(): array - { - $result = []; - - foreach ($this->groups as $group) { - $result[] = $group->name(); - } - - return $result; - } - - public function isEmpty(): bool - { - return empty($this->groups); - } - - public function getIterator(): GroupCollectionIterator - { - return new GroupCollectionIterator($this); - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Group/GroupCollectionIterator.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Group/GroupCollectionIterator.php deleted file mode 100644 index 843a708e..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Group/GroupCollectionIterator.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use function count; -use function iterator_count; -use Countable; -use Iterator; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @template-implements Iterator - */ -final class GroupCollectionIterator implements Countable, Iterator -{ - /** - * @var Group[] - */ - private $groups; - - /** - * @var int - */ - private $position; - - public function __construct(GroupCollection $groups) - { - $this->groups = $groups->asArray(); - } - - public function count(): int - { - return iterator_count($this); - } - - public function rewind(): void - { - $this->position = 0; - } - - public function valid(): bool - { - return $this->position < count($this->groups); - } - - public function key(): int - { - return $this->position; - } - - public function current(): Group - { - return $this->groups[$this->position]; - } - - public function next(): void - { - $this->position++; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Group/Groups.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Group/Groups.php deleted file mode 100644 index 0604ce32..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Group/Groups.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class Groups -{ - /** - * @var GroupCollection - */ - private $include; - - /** - * @var GroupCollection - */ - private $exclude; - - public function __construct(GroupCollection $include, GroupCollection $exclude) - { - $this->include = $include; - $this->exclude = $exclude; - } - - public function hasInclude(): bool - { - return !$this->include->isEmpty(); - } - - public function include(): GroupCollection - { - return $this->include; - } - - public function hasExclude(): bool - { - return !$this->exclude->isEmpty(); - } - - public function exclude(): GroupCollection - { - return $this->exclude; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Loader.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Loader.php deleted file mode 100644 index c1877317..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Loader.php +++ /dev/null @@ -1,1264 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use const DIRECTORY_SEPARATOR; -use const PHP_VERSION; -use function assert; -use function defined; -use function dirname; -use function explode; -use function is_file; -use function is_numeric; -use function preg_match; -use function stream_resolve_include_path; -use function strlen; -use function strpos; -use function strtolower; -use function substr; -use function trim; -use DOMDocument; -use DOMElement; -use DOMNodeList; -use DOMXPath; -use PHPUnit\Runner\TestSuiteSorter; -use PHPUnit\Runner\Version; -use PHPUnit\TextUI\DefaultResultPrinter; -use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\CodeCoverage; -use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Filter\Directory as FilterDirectory; -use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Filter\DirectoryCollection as FilterDirectoryCollection; -use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Clover; -use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Cobertura; -use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Crap4j; -use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Html as CodeCoverageHtml; -use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Php as CodeCoveragePhp; -use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Text as CodeCoverageText; -use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Xml as CodeCoverageXml; -use PHPUnit\TextUI\XmlConfiguration\Logging\Junit; -use PHPUnit\TextUI\XmlConfiguration\Logging\Logging; -use PHPUnit\TextUI\XmlConfiguration\Logging\TeamCity; -use PHPUnit\TextUI\XmlConfiguration\Logging\TestDox\Html as TestDoxHtml; -use PHPUnit\TextUI\XmlConfiguration\Logging\TestDox\Text as TestDoxText; -use PHPUnit\TextUI\XmlConfiguration\Logging\TestDox\Xml as TestDoxXml; -use PHPUnit\TextUI\XmlConfiguration\Logging\Text; -use PHPUnit\TextUI\XmlConfiguration\TestSuite as TestSuiteConfiguration; -use PHPUnit\Util\TestDox\CliTestDoxPrinter; -use PHPUnit\Util\VersionComparisonOperator; -use PHPUnit\Util\Xml; -use PHPUnit\Util\Xml\Exception as XmlException; -use PHPUnit\Util\Xml\Loader as XmlLoader; -use PHPUnit\Util\Xml\SchemaFinder; -use PHPUnit\Util\Xml\Validator; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Loader -{ - /** - * @throws Exception - */ - public function load(string $filename): Configuration - { - try { - $document = (new XmlLoader)->loadFile($filename, false, true, true); - } catch (XmlException $e) { - throw new Exception( - $e->getMessage(), - $e->getCode(), - $e - ); - } - - $xpath = new DOMXPath($document); - - try { - $xsdFilename = (new SchemaFinder)->find(Version::series()); - } catch (XmlException $e) { - throw new Exception( - $e->getMessage(), - $e->getCode(), - $e - ); - } - - return new Configuration( - $filename, - (new Validator)->validate($document, $xsdFilename), - $this->extensions($filename, $xpath), - $this->codeCoverage($filename, $xpath, $document), - $this->groups($xpath), - $this->testdoxGroups($xpath), - $this->listeners($filename, $xpath), - $this->logging($filename, $xpath), - $this->php($filename, $xpath), - $this->phpunit($filename, $document), - $this->testSuite($filename, $xpath) - ); - } - - public function logging(string $filename, DOMXPath $xpath): Logging - { - if ($xpath->query('logging/log')->length !== 0) { - return $this->legacyLogging($filename, $xpath); - } - - $junit = null; - $element = $this->element($xpath, 'logging/junit'); - - if ($element) { - $junit = new Junit( - new File( - $this->toAbsolutePath( - $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) - ) - ); - } - - $text = null; - $element = $this->element($xpath, 'logging/text'); - - if ($element) { - $text = new Text( - new File( - $this->toAbsolutePath( - $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) - ) - ); - } - - $teamCity = null; - $element = $this->element($xpath, 'logging/teamcity'); - - if ($element) { - $teamCity = new TeamCity( - new File( - $this->toAbsolutePath( - $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) - ) - ); - } - - $testDoxHtml = null; - $element = $this->element($xpath, 'logging/testdoxHtml'); - - if ($element) { - $testDoxHtml = new TestDoxHtml( - new File( - $this->toAbsolutePath( - $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) - ) - ); - } - - $testDoxText = null; - $element = $this->element($xpath, 'logging/testdoxText'); - - if ($element) { - $testDoxText = new TestDoxText( - new File( - $this->toAbsolutePath( - $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) - ) - ); - } - - $testDoxXml = null; - $element = $this->element($xpath, 'logging/testdoxXml'); - - if ($element) { - $testDoxXml = new TestDoxXml( - new File( - $this->toAbsolutePath( - $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) - ) - ); - } - - return new Logging( - $junit, - $text, - $teamCity, - $testDoxHtml, - $testDoxText, - $testDoxXml - ); - } - - public function legacyLogging(string $filename, DOMXPath $xpath): Logging - { - $junit = null; - $teamCity = null; - $testDoxHtml = null; - $testDoxText = null; - $testDoxXml = null; - $text = null; - - foreach ($xpath->query('logging/log') as $log) { - assert($log instanceof DOMElement); - - $type = (string) $log->getAttribute('type'); - $target = (string) $log->getAttribute('target'); - - if (!$target) { - continue; - } - - $target = $this->toAbsolutePath($filename, $target); - - switch ($type) { - case 'plain': - $text = new Text( - new File($target) - ); - - break; - - case 'junit': - $junit = new Junit( - new File($target) - ); - - break; - - case 'teamcity': - $teamCity = new TeamCity( - new File($target) - ); - - break; - - case 'testdox-html': - $testDoxHtml = new TestDoxHtml( - new File($target) - ); - - break; - - case 'testdox-text': - $testDoxText = new TestDoxText( - new File($target) - ); - - break; - - case 'testdox-xml': - $testDoxXml = new TestDoxXml( - new File($target) - ); - - break; - } - } - - return new Logging( - $junit, - $text, - $teamCity, - $testDoxHtml, - $testDoxText, - $testDoxXml - ); - } - - private function extensions(string $filename, DOMXPath $xpath): ExtensionCollection - { - $extensions = []; - - foreach ($xpath->query('extensions/extension') as $extension) { - assert($extension instanceof DOMElement); - - $extensions[] = $this->getElementConfigurationParameters($filename, $extension); - } - - return ExtensionCollection::fromArray($extensions); - } - - private function getElementConfigurationParameters(string $filename, DOMElement $element): Extension - { - /** @psalm-var class-string $class */ - $class = (string) $element->getAttribute('class'); - $file = ''; - $arguments = $this->getConfigurationArguments($filename, $element->childNodes); - - if ($element->getAttribute('file')) { - $file = $this->toAbsolutePath( - $filename, - (string) $element->getAttribute('file'), - true - ); - } - - return new Extension($class, $file, $arguments); - } - - private function toAbsolutePath(string $filename, string $path, bool $useIncludePath = false): string - { - $path = trim($path); - - if (strpos($path, '/') === 0) { - return $path; - } - - // Matches the following on Windows: - // - \\NetworkComputer\Path - // - \\.\D: - // - \\.\c: - // - C:\Windows - // - C:\windows - // - C:/windows - // - c:/windows - if (defined('PHP_WINDOWS_VERSION_BUILD') && - ($path[0] === '\\' || (strlen($path) >= 3 && preg_match('#^[A-Z]\:[/\\\]#i', substr($path, 0, 3))))) { - return $path; - } - - if (strpos($path, '://') !== false) { - return $path; - } - - $file = dirname($filename) . DIRECTORY_SEPARATOR . $path; - - if ($useIncludePath && !is_file($file)) { - $includePathFile = stream_resolve_include_path($path); - - if ($includePathFile) { - $file = $includePathFile; - } - } - - return $file; - } - - private function getConfigurationArguments(string $filename, DOMNodeList $nodes): array - { - $arguments = []; - - if ($nodes->length === 0) { - return $arguments; - } - - foreach ($nodes as $node) { - if (!$node instanceof DOMElement) { - continue; - } - - if ($node->tagName !== 'arguments') { - continue; - } - - foreach ($node->childNodes as $argument) { - if (!$argument instanceof DOMElement) { - continue; - } - - if ($argument->tagName === 'file' || $argument->tagName === 'directory') { - $arguments[] = $this->toAbsolutePath($filename, (string) $argument->textContent); - } else { - $arguments[] = Xml::xmlToVariable($argument); - } - } - } - - return $arguments; - } - - private function codeCoverage(string $filename, DOMXPath $xpath, DOMDocument $document): CodeCoverage - { - if ($xpath->query('filter/whitelist')->length !== 0) { - return $this->legacyCodeCoverage($filename, $xpath, $document); - } - - $cacheDirectory = null; - $pathCoverage = false; - $includeUncoveredFiles = true; - $processUncoveredFiles = false; - $ignoreDeprecatedCodeUnits = false; - $disableCodeCoverageIgnore = false; - - $element = $this->element($xpath, 'coverage'); - - if ($element) { - $cacheDirectory = $this->getStringAttribute($element, 'cacheDirectory'); - - if ($cacheDirectory !== null) { - $cacheDirectory = new Directory( - $this->toAbsolutePath($filename, $cacheDirectory) - ); - } - - $pathCoverage = $this->getBooleanAttribute( - $element, - 'pathCoverage', - false - ); - - $includeUncoveredFiles = $this->getBooleanAttribute( - $element, - 'includeUncoveredFiles', - true - ); - - $processUncoveredFiles = $this->getBooleanAttribute( - $element, - 'processUncoveredFiles', - false - ); - - $ignoreDeprecatedCodeUnits = $this->getBooleanAttribute( - $element, - 'ignoreDeprecatedCodeUnits', - false - ); - - $disableCodeCoverageIgnore = $this->getBooleanAttribute( - $element, - 'disableCodeCoverageIgnore', - false - ); - } - - $clover = null; - $element = $this->element($xpath, 'coverage/report/clover'); - - if ($element) { - $clover = new Clover( - new File( - $this->toAbsolutePath( - $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) - ) - ); - } - - $cobertura = null; - $element = $this->element($xpath, 'coverage/report/cobertura'); - - if ($element) { - $cobertura = new Cobertura( - new File( - $this->toAbsolutePath( - $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) - ) - ); - } - - $crap4j = null; - $element = $this->element($xpath, 'coverage/report/crap4j'); - - if ($element) { - $crap4j = new Crap4j( - new File( - $this->toAbsolutePath( - $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) - ), - $this->getIntegerAttribute($element, 'threshold', 30) - ); - } - - $html = null; - $element = $this->element($xpath, 'coverage/report/html'); - - if ($element) { - $html = new CodeCoverageHtml( - new Directory( - $this->toAbsolutePath( - $filename, - (string) $this->getStringAttribute($element, 'outputDirectory') - ) - ), - $this->getIntegerAttribute($element, 'lowUpperBound', 50), - $this->getIntegerAttribute($element, 'highLowerBound', 90) - ); - } - - $php = null; - $element = $this->element($xpath, 'coverage/report/php'); - - if ($element) { - $php = new CodeCoveragePhp( - new File( - $this->toAbsolutePath( - $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) - ) - ); - } - - $text = null; - $element = $this->element($xpath, 'coverage/report/text'); - - if ($element) { - $text = new CodeCoverageText( - new File( - $this->toAbsolutePath( - $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) - ), - $this->getBooleanAttribute($element, 'showUncoveredFiles', false), - $this->getBooleanAttribute($element, 'showOnlySummary', false) - ); - } - - $xml = null; - $element = $this->element($xpath, 'coverage/report/xml'); - - if ($element) { - $xml = new CodeCoverageXml( - new Directory( - $this->toAbsolutePath( - $filename, - (string) $this->getStringAttribute($element, 'outputDirectory') - ) - ) - ); - } - - return new CodeCoverage( - $cacheDirectory, - $this->readFilterDirectories($filename, $xpath, 'coverage/include/directory'), - $this->readFilterFiles($filename, $xpath, 'coverage/include/file'), - $this->readFilterDirectories($filename, $xpath, 'coverage/exclude/directory'), - $this->readFilterFiles($filename, $xpath, 'coverage/exclude/file'), - $pathCoverage, - $includeUncoveredFiles, - $processUncoveredFiles, - $ignoreDeprecatedCodeUnits, - $disableCodeCoverageIgnore, - $clover, - $cobertura, - $crap4j, - $html, - $php, - $text, - $xml - ); - } - - /** - * @deprecated - */ - private function legacyCodeCoverage(string $filename, DOMXPath $xpath, DOMDocument $document): CodeCoverage - { - $ignoreDeprecatedCodeUnits = $this->getBooleanAttribute( - $document->documentElement, - 'ignoreDeprecatedCodeUnitsFromCodeCoverage', - false - ); - - $disableCodeCoverageIgnore = $this->getBooleanAttribute( - $document->documentElement, - 'disableCodeCoverageIgnore', - false - ); - - $includeUncoveredFiles = true; - $processUncoveredFiles = false; - - $element = $this->element($xpath, 'filter/whitelist'); - - if ($element) { - if ($element->hasAttribute('addUncoveredFilesFromWhitelist')) { - $includeUncoveredFiles = (bool) $this->getBoolean( - (string) $element->getAttribute('addUncoveredFilesFromWhitelist'), - true - ); - } - - if ($element->hasAttribute('processUncoveredFilesFromWhitelist')) { - $processUncoveredFiles = (bool) $this->getBoolean( - (string) $element->getAttribute('processUncoveredFilesFromWhitelist'), - false - ); - } - } - - $clover = null; - $cobertura = null; - $crap4j = null; - $html = null; - $php = null; - $text = null; - $xml = null; - - foreach ($xpath->query('logging/log') as $log) { - assert($log instanceof DOMElement); - - $type = (string) $log->getAttribute('type'); - $target = (string) $log->getAttribute('target'); - - if (!$target) { - continue; - } - - $target = $this->toAbsolutePath($filename, $target); - - switch ($type) { - case 'coverage-clover': - $clover = new Clover( - new File($target) - ); - - break; - - case 'coverage-cobertura': - $cobertura = new Cobertura( - new File($target) - ); - - break; - - case 'coverage-crap4j': - $crap4j = new Crap4j( - new File($target), - $this->getIntegerAttribute($log, 'threshold', 30) - ); - - break; - - case 'coverage-html': - $html = new CodeCoverageHtml( - new Directory($target), - $this->getIntegerAttribute($log, 'lowUpperBound', 50), - $this->getIntegerAttribute($log, 'highLowerBound', 90) - ); - - break; - - case 'coverage-php': - $php = new CodeCoveragePhp( - new File($target) - ); - - break; - - case 'coverage-text': - $text = new CodeCoverageText( - new File($target), - $this->getBooleanAttribute($log, 'showUncoveredFiles', false), - $this->getBooleanAttribute($log, 'showOnlySummary', false) - ); - - break; - - case 'coverage-xml': - $xml = new CodeCoverageXml( - new Directory($target) - ); - - break; - } - } - - return new CodeCoverage( - null, - $this->readFilterDirectories($filename, $xpath, 'filter/whitelist/directory'), - $this->readFilterFiles($filename, $xpath, 'filter/whitelist/file'), - $this->readFilterDirectories($filename, $xpath, 'filter/whitelist/exclude/directory'), - $this->readFilterFiles($filename, $xpath, 'filter/whitelist/exclude/file'), - false, - $includeUncoveredFiles, - $processUncoveredFiles, - $ignoreDeprecatedCodeUnits, - $disableCodeCoverageIgnore, - $clover, - $cobertura, - $crap4j, - $html, - $php, - $text, - $xml - ); - } - - /** - * If $value is 'false' or 'true', this returns the value that $value represents. - * Otherwise, returns $default, which may be a string in rare cases. - * - * @see \PHPUnit\TextUI\XmlConfigurationTest::testPHPConfigurationIsReadCorrectly - * - * @param bool|string $default - * - * @return bool|string - */ - private function getBoolean(string $value, $default) - { - if (strtolower($value) === 'false') { - return false; - } - - if (strtolower($value) === 'true') { - return true; - } - - return $default; - } - - private function readFilterDirectories(string $filename, DOMXPath $xpath, string $query): FilterDirectoryCollection - { - $directories = []; - - foreach ($xpath->query($query) as $directoryNode) { - assert($directoryNode instanceof DOMElement); - - $directoryPath = (string) $directoryNode->textContent; - - if (!$directoryPath) { - continue; - } - - $directories[] = new FilterDirectory( - $this->toAbsolutePath($filename, $directoryPath), - $directoryNode->hasAttribute('prefix') ? (string) $directoryNode->getAttribute('prefix') : '', - $directoryNode->hasAttribute('suffix') ? (string) $directoryNode->getAttribute('suffix') : '.php', - $directoryNode->hasAttribute('group') ? (string) $directoryNode->getAttribute('group') : 'DEFAULT' - ); - } - - return FilterDirectoryCollection::fromArray($directories); - } - - private function readFilterFiles(string $filename, DOMXPath $xpath, string $query): FileCollection - { - $files = []; - - foreach ($xpath->query($query) as $file) { - $filePath = (string) $file->textContent; - - if ($filePath) { - $files[] = new File($this->toAbsolutePath($filename, $filePath)); - } - } - - return FileCollection::fromArray($files); - } - - private function groups(DOMXPath $xpath): Groups - { - return $this->parseGroupConfiguration($xpath, 'groups'); - } - - private function testdoxGroups(DOMXPath $xpath): Groups - { - return $this->parseGroupConfiguration($xpath, 'testdoxGroups'); - } - - private function parseGroupConfiguration(DOMXPath $xpath, string $root): Groups - { - $include = []; - $exclude = []; - - foreach ($xpath->query($root . '/include/group') as $group) { - $include[] = new Group((string) $group->textContent); - } - - foreach ($xpath->query($root . '/exclude/group') as $group) { - $exclude[] = new Group((string) $group->textContent); - } - - return new Groups( - GroupCollection::fromArray($include), - GroupCollection::fromArray($exclude) - ); - } - - private function listeners(string $filename, DOMXPath $xpath): ExtensionCollection - { - $listeners = []; - - foreach ($xpath->query('listeners/listener') as $listener) { - assert($listener instanceof DOMElement); - - $listeners[] = $this->getElementConfigurationParameters($filename, $listener); - } - - return ExtensionCollection::fromArray($listeners); - } - - private function getBooleanAttribute(DOMElement $element, string $attribute, bool $default): bool - { - if (!$element->hasAttribute($attribute)) { - return $default; - } - - return (bool) $this->getBoolean( - (string) $element->getAttribute($attribute), - false - ); - } - - private function getIntegerAttribute(DOMElement $element, string $attribute, int $default): int - { - if (!$element->hasAttribute($attribute)) { - return $default; - } - - return $this->getInteger( - (string) $element->getAttribute($attribute), - $default - ); - } - - private function getStringAttribute(DOMElement $element, string $attribute): ?string - { - if (!$element->hasAttribute($attribute)) { - return null; - } - - return (string) $element->getAttribute($attribute); - } - - private function getInteger(string $value, int $default): int - { - if (is_numeric($value)) { - return (int) $value; - } - - return $default; - } - - private function php(string $filename, DOMXPath $xpath): Php - { - $includePaths = []; - - foreach ($xpath->query('php/includePath') as $includePath) { - $path = (string) $includePath->textContent; - - if ($path) { - $includePaths[] = new Directory($this->toAbsolutePath($filename, $path)); - } - } - - $iniSettings = []; - - foreach ($xpath->query('php/ini') as $ini) { - assert($ini instanceof DOMElement); - - $iniSettings[] = new IniSetting( - (string) $ini->getAttribute('name'), - (string) $ini->getAttribute('value') - ); - } - - $constants = []; - - foreach ($xpath->query('php/const') as $const) { - assert($const instanceof DOMElement); - - $value = (string) $const->getAttribute('value'); - - $constants[] = new Constant( - (string) $const->getAttribute('name'), - $this->getBoolean($value, $value) - ); - } - - $variables = [ - 'var' => [], - 'env' => [], - 'post' => [], - 'get' => [], - 'cookie' => [], - 'server' => [], - 'files' => [], - 'request' => [], - ]; - - foreach (['var', 'env', 'post', 'get', 'cookie', 'server', 'files', 'request'] as $array) { - foreach ($xpath->query('php/' . $array) as $var) { - assert($var instanceof DOMElement); - - $name = (string) $var->getAttribute('name'); - $value = (string) $var->getAttribute('value'); - $force = false; - $verbatim = false; - - if ($var->hasAttribute('force')) { - $force = (bool) $this->getBoolean($var->getAttribute('force'), false); - } - - if ($var->hasAttribute('verbatim')) { - $verbatim = $this->getBoolean($var->getAttribute('verbatim'), false); - } - - if (!$verbatim) { - $value = $this->getBoolean($value, $value); - } - - $variables[$array][] = new Variable($name, $value, $force); - } - } - - return new Php( - DirectoryCollection::fromArray($includePaths), - IniSettingCollection::fromArray($iniSettings), - ConstantCollection::fromArray($constants), - VariableCollection::fromArray($variables['var']), - VariableCollection::fromArray($variables['env']), - VariableCollection::fromArray($variables['post']), - VariableCollection::fromArray($variables['get']), - VariableCollection::fromArray($variables['cookie']), - VariableCollection::fromArray($variables['server']), - VariableCollection::fromArray($variables['files']), - VariableCollection::fromArray($variables['request']), - ); - } - - private function phpunit(string $filename, DOMDocument $document): PHPUnit - { - $executionOrder = TestSuiteSorter::ORDER_DEFAULT; - $defectsFirst = false; - $resolveDependencies = $this->getBooleanAttribute($document->documentElement, 'resolveDependencies', true); - - if ($document->documentElement->hasAttribute('executionOrder')) { - foreach (explode(',', $document->documentElement->getAttribute('executionOrder')) as $order) { - switch ($order) { - case 'default': - $executionOrder = TestSuiteSorter::ORDER_DEFAULT; - $defectsFirst = false; - $resolveDependencies = true; - - break; - - case 'depends': - $resolveDependencies = true; - - break; - - case 'no-depends': - $resolveDependencies = false; - - break; - - case 'defects': - $defectsFirst = true; - - break; - - case 'duration': - $executionOrder = TestSuiteSorter::ORDER_DURATION; - - break; - - case 'random': - $executionOrder = TestSuiteSorter::ORDER_RANDOMIZED; - - break; - - case 'reverse': - $executionOrder = TestSuiteSorter::ORDER_REVERSED; - - break; - - case 'size': - $executionOrder = TestSuiteSorter::ORDER_SIZE; - - break; - } - } - } - - $printerClass = $this->getStringAttribute($document->documentElement, 'printerClass'); - $testdox = $this->getBooleanAttribute($document->documentElement, 'testdox', false); - $conflictBetweenPrinterClassAndTestdox = false; - - if ($testdox) { - if ($printerClass !== null) { - $conflictBetweenPrinterClassAndTestdox = true; - } - - $printerClass = CliTestDoxPrinter::class; - } - - $cacheResultFile = $this->getStringAttribute($document->documentElement, 'cacheResultFile'); - - if ($cacheResultFile !== null) { - $cacheResultFile = $this->toAbsolutePath($filename, $cacheResultFile); - } - - $bootstrap = $this->getStringAttribute($document->documentElement, 'bootstrap'); - - if ($bootstrap !== null) { - $bootstrap = $this->toAbsolutePath($filename, $bootstrap); - } - - $extensionsDirectory = $this->getStringAttribute($document->documentElement, 'extensionsDirectory'); - - if ($extensionsDirectory !== null) { - $extensionsDirectory = $this->toAbsolutePath($filename, $extensionsDirectory); - } - - $testSuiteLoaderFile = $this->getStringAttribute($document->documentElement, 'testSuiteLoaderFile'); - - if ($testSuiteLoaderFile !== null) { - $testSuiteLoaderFile = $this->toAbsolutePath($filename, $testSuiteLoaderFile); - } - - $printerFile = $this->getStringAttribute($document->documentElement, 'printerFile'); - - if ($printerFile !== null) { - $printerFile = $this->toAbsolutePath($filename, $printerFile); - } - - return new PHPUnit( - $this->getBooleanAttribute($document->documentElement, 'cacheResult', true), - $cacheResultFile, - $this->getColumns($document), - $this->getColors($document), - $this->getBooleanAttribute($document->documentElement, 'stderr', false), - $this->getBooleanAttribute($document->documentElement, 'noInteraction', false), - $this->getBooleanAttribute($document->documentElement, 'verbose', false), - $this->getBooleanAttribute($document->documentElement, 'reverseDefectList', false), - $this->getBooleanAttribute($document->documentElement, 'convertDeprecationsToExceptions', false), - $this->getBooleanAttribute($document->documentElement, 'convertErrorsToExceptions', true), - $this->getBooleanAttribute($document->documentElement, 'convertNoticesToExceptions', true), - $this->getBooleanAttribute($document->documentElement, 'convertWarningsToExceptions', true), - $this->getBooleanAttribute($document->documentElement, 'forceCoversAnnotation', false), - $bootstrap, - $this->getBooleanAttribute($document->documentElement, 'processIsolation', false), - $this->getBooleanAttribute($document->documentElement, 'failOnEmptyTestSuite', false), - $this->getBooleanAttribute($document->documentElement, 'failOnIncomplete', false), - $this->getBooleanAttribute($document->documentElement, 'failOnRisky', false), - $this->getBooleanAttribute($document->documentElement, 'failOnSkipped', false), - $this->getBooleanAttribute($document->documentElement, 'failOnWarning', false), - $this->getBooleanAttribute($document->documentElement, 'stopOnDefect', false), - $this->getBooleanAttribute($document->documentElement, 'stopOnError', false), - $this->getBooleanAttribute($document->documentElement, 'stopOnFailure', false), - $this->getBooleanAttribute($document->documentElement, 'stopOnWarning', false), - $this->getBooleanAttribute($document->documentElement, 'stopOnIncomplete', false), - $this->getBooleanAttribute($document->documentElement, 'stopOnRisky', false), - $this->getBooleanAttribute($document->documentElement, 'stopOnSkipped', false), - $extensionsDirectory, - $this->getStringAttribute($document->documentElement, 'testSuiteLoaderClass'), - $testSuiteLoaderFile, - $printerClass, - $printerFile, - $this->getBooleanAttribute($document->documentElement, 'beStrictAboutChangesToGlobalState', false), - $this->getBooleanAttribute($document->documentElement, 'beStrictAboutOutputDuringTests', false), - $this->getBooleanAttribute($document->documentElement, 'beStrictAboutResourceUsageDuringSmallTests', false), - $this->getBooleanAttribute($document->documentElement, 'beStrictAboutTestsThatDoNotTestAnything', true), - $this->getBooleanAttribute($document->documentElement, 'beStrictAboutTodoAnnotatedTests', false), - $this->getBooleanAttribute($document->documentElement, 'beStrictAboutCoversAnnotation', false), - $this->getBooleanAttribute($document->documentElement, 'enforceTimeLimit', false), - $this->getIntegerAttribute($document->documentElement, 'defaultTimeLimit', 1), - $this->getIntegerAttribute($document->documentElement, 'timeoutForSmallTests', 1), - $this->getIntegerAttribute($document->documentElement, 'timeoutForMediumTests', 10), - $this->getIntegerAttribute($document->documentElement, 'timeoutForLargeTests', 60), - $this->getStringAttribute($document->documentElement, 'defaultTestSuite'), - $executionOrder, - $resolveDependencies, - $defectsFirst, - $this->getBooleanAttribute($document->documentElement, 'backupGlobals', false), - $this->getBooleanAttribute($document->documentElement, 'backupStaticAttributes', false), - $this->getBooleanAttribute($document->documentElement, 'registerMockObjectsFromTestArgumentsRecursively', false), - $conflictBetweenPrinterClassAndTestdox - ); - } - - private function getColors(DOMDocument $document): string - { - $colors = DefaultResultPrinter::COLOR_DEFAULT; - - if ($document->documentElement->hasAttribute('colors')) { - /* only allow boolean for compatibility with previous versions - 'always' only allowed from command line */ - if ($this->getBoolean($document->documentElement->getAttribute('colors'), false)) { - $colors = DefaultResultPrinter::COLOR_AUTO; - } else { - $colors = DefaultResultPrinter::COLOR_NEVER; - } - } - - return $colors; - } - - /** - * @return int|string - */ - private function getColumns(DOMDocument $document) - { - $columns = 80; - - if ($document->documentElement->hasAttribute('columns')) { - $columns = (string) $document->documentElement->getAttribute('columns'); - - if ($columns !== 'max') { - $columns = $this->getInteger($columns, 80); - } - } - - return $columns; - } - - private function testSuite(string $filename, DOMXPath $xpath): TestSuiteCollection - { - $testSuites = []; - - foreach ($this->getTestSuiteElements($xpath) as $element) { - $exclude = []; - - foreach ($element->getElementsByTagName('exclude') as $excludeNode) { - $excludeFile = (string) $excludeNode->textContent; - - if ($excludeFile) { - $exclude[] = new File($this->toAbsolutePath($filename, $excludeFile)); - } - } - - $directories = []; - - foreach ($element->getElementsByTagName('directory') as $directoryNode) { - assert($directoryNode instanceof DOMElement); - - $directory = (string) $directoryNode->textContent; - - if (empty($directory)) { - continue; - } - - $prefix = ''; - - if ($directoryNode->hasAttribute('prefix')) { - $prefix = (string) $directoryNode->getAttribute('prefix'); - } - - $suffix = 'Test.php'; - - if ($directoryNode->hasAttribute('suffix')) { - $suffix = (string) $directoryNode->getAttribute('suffix'); - } - - $phpVersion = PHP_VERSION; - - if ($directoryNode->hasAttribute('phpVersion')) { - $phpVersion = (string) $directoryNode->getAttribute('phpVersion'); - } - - $phpVersionOperator = new VersionComparisonOperator('>='); - - if ($directoryNode->hasAttribute('phpVersionOperator')) { - $phpVersionOperator = new VersionComparisonOperator((string) $directoryNode->getAttribute('phpVersionOperator')); - } - - $directories[] = new TestDirectory( - $this->toAbsolutePath($filename, $directory), - $prefix, - $suffix, - $phpVersion, - $phpVersionOperator - ); - } - - $files = []; - - foreach ($element->getElementsByTagName('file') as $fileNode) { - assert($fileNode instanceof DOMElement); - - $file = (string) $fileNode->textContent; - - if (empty($file)) { - continue; - } - - $phpVersion = PHP_VERSION; - - if ($fileNode->hasAttribute('phpVersion')) { - $phpVersion = (string) $fileNode->getAttribute('phpVersion'); - } - - $phpVersionOperator = new VersionComparisonOperator('>='); - - if ($fileNode->hasAttribute('phpVersionOperator')) { - $phpVersionOperator = new VersionComparisonOperator((string) $fileNode->getAttribute('phpVersionOperator')); - } - - $files[] = new TestFile( - $this->toAbsolutePath($filename, $file), - $phpVersion, - $phpVersionOperator - ); - } - - $testSuites[] = new TestSuiteConfiguration( - (string) $element->getAttribute('name'), - TestDirectoryCollection::fromArray($directories), - TestFileCollection::fromArray($files), - FileCollection::fromArray($exclude) - ); - } - - return TestSuiteCollection::fromArray($testSuites); - } - - /** - * @return DOMElement[] - */ - private function getTestSuiteElements(DOMXPath $xpath): array - { - /** @var DOMElement[] $elements */ - $elements = []; - - $testSuiteNodes = $xpath->query('testsuites/testsuite'); - - if ($testSuiteNodes->length === 0) { - $testSuiteNodes = $xpath->query('testsuite'); - } - - if ($testSuiteNodes->length === 1) { - $element = $testSuiteNodes->item(0); - - assert($element instanceof DOMElement); - - $elements[] = $element; - } else { - foreach ($testSuiteNodes as $testSuiteNode) { - assert($testSuiteNode instanceof DOMElement); - - $elements[] = $testSuiteNode; - } - } - - return $elements; - } - - private function element(DOMXPath $xpath, string $element): ?DOMElement - { - $nodes = $xpath->query($element); - - if ($nodes->length === 1) { - $node = $nodes->item(0); - - assert($node instanceof DOMElement); - - return $node; - } - - return null; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/Junit.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/Junit.php deleted file mode 100644 index 9fca1852..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/Junit.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration\Logging; - -use PHPUnit\TextUI\XmlConfiguration\File; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class Junit -{ - /** - * @var File - */ - private $target; - - public function __construct(File $target) - { - $this->target = $target; - } - - public function target(): File - { - return $this->target; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/Logging.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/Logging.php deleted file mode 100644 index bce03019..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/Logging.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. - */ -namespace PHPUnit\TextUI\XmlConfiguration\Logging; - -use PHPUnit\TextUI\XmlConfiguration\Exception; -use PHPUnit\TextUI\XmlConfiguration\Logging\TestDox\Html as TestDoxHtml; -use PHPUnit\TextUI\XmlConfiguration\Logging\TestDox\Text as TestDoxText; -use PHPUnit\TextUI\XmlConfiguration\Logging\TestDox\Xml as TestDoxXml; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class Logging -{ - /** - * @var ?Junit - */ - private $junit; - - /** - * @var ?Text - */ - private $text; - - /** - * @var ?TeamCity - */ - private $teamCity; - - /** - * @var ?TestDoxHtml - */ - private $testDoxHtml; - - /** - * @var ?TestDoxText - */ - private $testDoxText; - - /** - * @var ?TestDoxXml - */ - private $testDoxXml; - - public function __construct(?Junit $junit, ?Text $text, ?TeamCity $teamCity, ?TestDoxHtml $testDoxHtml, ?TestDoxText $testDoxText, ?TestDoxXml $testDoxXml) - { - $this->junit = $junit; - $this->text = $text; - $this->teamCity = $teamCity; - $this->testDoxHtml = $testDoxHtml; - $this->testDoxText = $testDoxText; - $this->testDoxXml = $testDoxXml; - } - - public function hasJunit(): bool - { - return $this->junit !== null; - } - - public function junit(): Junit - { - if ($this->junit === null) { - throw new Exception('Logger "JUnit XML" is not configured'); - } - - return $this->junit; - } - - public function hasText(): bool - { - return $this->text !== null; - } - - public function text(): Text - { - if ($this->text === null) { - throw new Exception('Logger "Text" is not configured'); - } - - return $this->text; - } - - public function hasTeamCity(): bool - { - return $this->teamCity !== null; - } - - public function teamCity(): TeamCity - { - if ($this->teamCity === null) { - throw new Exception('Logger "Team City" is not configured'); - } - - return $this->teamCity; - } - - public function hasTestDoxHtml(): bool - { - return $this->testDoxHtml !== null; - } - - public function testDoxHtml(): TestDoxHtml - { - if ($this->testDoxHtml === null) { - throw new Exception('Logger "TestDox HTML" is not configured'); - } - - return $this->testDoxHtml; - } - - public function hasTestDoxText(): bool - { - return $this->testDoxText !== null; - } - - public function testDoxText(): TestDoxText - { - if ($this->testDoxText === null) { - throw new Exception('Logger "TestDox Text" is not configured'); - } - - return $this->testDoxText; - } - - public function hasTestDoxXml(): bool - { - return $this->testDoxXml !== null; - } - - public function testDoxXml(): TestDoxXml - { - if ($this->testDoxXml === null) { - throw new Exception('Logger "TestDox XML" is not configured'); - } - - return $this->testDoxXml; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/TeamCity.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/TeamCity.php deleted file mode 100644 index 804a7ea6..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/TeamCity.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration\Logging; - -use PHPUnit\TextUI\XmlConfiguration\File; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class TeamCity -{ - /** - * @var File - */ - private $target; - - public function __construct(File $target) - { - $this->target = $target; - } - - public function target(): File - { - return $this->target; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/TestDox/Html.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/TestDox/Html.php deleted file mode 100644 index 5b198352..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/TestDox/Html.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration\Logging\TestDox; - -use PHPUnit\TextUI\XmlConfiguration\File; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class Html -{ - /** - * @var File - */ - private $target; - - public function __construct(File $target) - { - $this->target = $target; - } - - public function target(): File - { - return $this->target; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/TestDox/Text.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/TestDox/Text.php deleted file mode 100644 index 5c742d3a..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/TestDox/Text.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration\Logging\TestDox; - -use PHPUnit\TextUI\XmlConfiguration\File; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class Text -{ - /** - * @var File - */ - private $target; - - public function __construct(File $target) - { - $this->target = $target; - } - - public function target(): File - { - return $this->target; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/TestDox/Xml.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/TestDox/Xml.php deleted file mode 100644 index 92dd3b7b..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/TestDox/Xml.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration\Logging\TestDox; - -use PHPUnit\TextUI\XmlConfiguration\File; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class Xml -{ - /** - * @var File - */ - private $target; - - public function __construct(File $target) - { - $this->target = $target; - } - - public function target(): File - { - return $this->target; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/Text.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/Text.php deleted file mode 100644 index fd37942f..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Logging/Text.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration\Logging; - -use PHPUnit\TextUI\XmlConfiguration\File; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class Text -{ - /** - * @var File - */ - private $target; - - public function __construct(File $target) - { - $this->target = $target; - } - - public function target(): File - { - return $this->target; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/MigrationBuilder.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/MigrationBuilder.php deleted file mode 100644 index abef49f1..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/MigrationBuilder.php +++ /dev/null @@ -1,73 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use function array_key_exists; -use function sprintf; -use function version_compare; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class MigrationBuilder -{ - private const AVAILABLE_MIGRATIONS = [ - '8.5' => [ - RemoveLogTypes::class, - ], - - '9.2' => [ - RemoveCacheTokensAttribute::class, - IntroduceCoverageElement::class, - MoveAttributesFromRootToCoverage::class, - MoveAttributesFromFilterWhitelistToCoverage::class, - MoveWhitelistDirectoriesToCoverage::class, - MoveWhitelistExcludesToCoverage::class, - RemoveEmptyFilter::class, - CoverageCloverToReport::class, - CoverageCrap4jToReport::class, - CoverageHtmlToReport::class, - CoveragePhpToReport::class, - CoverageTextToReport::class, - CoverageXmlToReport::class, - ConvertLogTypes::class, - UpdateSchemaLocationTo93::class, - ], - ]; - - /** - * @throws MigrationBuilderException - */ - public function build(string $fromVersion): array - { - if (!array_key_exists($fromVersion, self::AVAILABLE_MIGRATIONS)) { - throw new MigrationBuilderException( - sprintf( - 'Migration from schema version %s is not supported', - $fromVersion - ) - ); - } - - $stack = []; - - foreach (self::AVAILABLE_MIGRATIONS as $version => $migrations) { - if (version_compare($version, $fromVersion, '<')) { - continue; - } - - foreach ($migrations as $migration) { - $stack[] = new $migration; - } - } - - return $stack; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/MigrationBuilderException.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/MigrationBuilderException.php deleted file mode 100644 index 3d3c767a..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/MigrationBuilderException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use RuntimeException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class MigrationBuilderException extends RuntimeException implements \PHPUnit\Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/MigrationException.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/MigrationException.php deleted file mode 100644 index f92b2db3..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/MigrationException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use RuntimeException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class MigrationException extends RuntimeException implements \PHPUnit\Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/ConvertLogTypes.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/ConvertLogTypes.php deleted file mode 100644 index 697bbe08..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/ConvertLogTypes.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 PHPUnit\TextUI\XmlConfiguration; - -use DOMDocument; -use DOMElement; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ConvertLogTypes implements Migration -{ - public function migrate(DOMDocument $document): void - { - $logging = $document->getElementsByTagName('logging')->item(0); - - if (!$logging instanceof DOMElement) { - return; - } - $types = [ - 'junit' => 'junit', - 'teamcity' => 'teamcity', - 'testdox-html' => 'testdoxHtml', - 'testdox-text' => 'testdoxText', - 'testdox-xml' => 'testdoxXml', - 'plain' => 'text', - ]; - - $logNodes = []; - - foreach ($logging->getElementsByTagName('log') as $logNode) { - if (!isset($types[$logNode->getAttribute('type')])) { - continue; - } - - $logNodes[] = $logNode; - } - - foreach ($logNodes as $oldNode) { - $newLogNode = $document->createElement($types[$oldNode->getAttribute('type')]); - $newLogNode->setAttribute('outputFile', $oldNode->getAttribute('target')); - - $logging->replaceChild($newLogNode, $oldNode); - } - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/CoverageCloverToReport.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/CoverageCloverToReport.php deleted file mode 100644 index 5f1522b9..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/CoverageCloverToReport.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. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use DOMElement; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class CoverageCloverToReport extends LogToReportMigration -{ - protected function forType(): string - { - return 'coverage-clover'; - } - - protected function toReportFormat(DOMElement $logNode): DOMElement - { - $clover = $logNode->ownerDocument->createElement('clover'); - $clover->setAttribute('outputFile', $logNode->getAttribute('target')); - - return $clover; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/CoverageCrap4jToReport.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/CoverageCrap4jToReport.php deleted file mode 100644 index afbaaec1..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/CoverageCrap4jToReport.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 PHPUnit\TextUI\XmlConfiguration; - -use DOMElement; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class CoverageCrap4jToReport extends LogToReportMigration -{ - protected function forType(): string - { - return 'coverage-crap4j'; - } - - protected function toReportFormat(DOMElement $logNode): DOMElement - { - $crap4j = $logNode->ownerDocument->createElement('crap4j'); - $crap4j->setAttribute('outputFile', $logNode->getAttribute('target')); - - $this->migrateAttributes($logNode, $crap4j, ['threshold']); - - return $crap4j; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/CoverageHtmlToReport.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/CoverageHtmlToReport.php deleted file mode 100644 index 7e12095b..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/CoverageHtmlToReport.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 PHPUnit\TextUI\XmlConfiguration; - -use DOMElement; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class CoverageHtmlToReport extends LogToReportMigration -{ - protected function forType(): string - { - return 'coverage-html'; - } - - protected function toReportFormat(DOMElement $logNode): DOMElement - { - $html = $logNode->ownerDocument->createElement('html'); - $html->setAttribute('outputDirectory', $logNode->getAttribute('target')); - - $this->migrateAttributes($logNode, $html, ['lowUpperBound', 'highLowerBound']); - - return $html; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/CoveragePhpToReport.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/CoveragePhpToReport.php deleted file mode 100644 index bfa10030..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/CoveragePhpToReport.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. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use DOMElement; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class CoveragePhpToReport extends LogToReportMigration -{ - protected function forType(): string - { - return 'coverage-php'; - } - - protected function toReportFormat(DOMElement $logNode): DOMElement - { - $php = $logNode->ownerDocument->createElement('php'); - $php->setAttribute('outputFile', $logNode->getAttribute('target')); - - return $php; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/CoverageTextToReport.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/CoverageTextToReport.php deleted file mode 100644 index 063d8df0..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/CoverageTextToReport.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 PHPUnit\TextUI\XmlConfiguration; - -use DOMElement; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class CoverageTextToReport extends LogToReportMigration -{ - protected function forType(): string - { - return 'coverage-text'; - } - - protected function toReportFormat(DOMElement $logNode): DOMElement - { - $text = $logNode->ownerDocument->createElement('text'); - $text->setAttribute('outputFile', $logNode->getAttribute('target')); - - $this->migrateAttributes($logNode, $text, ['showUncoveredFiles', 'showOnlySummary']); - - return $text; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/CoverageXmlToReport.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/CoverageXmlToReport.php deleted file mode 100644 index 480d7777..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/CoverageXmlToReport.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. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use DOMElement; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class CoverageXmlToReport extends LogToReportMigration -{ - protected function forType(): string - { - return 'coverage-xml'; - } - - protected function toReportFormat(DOMElement $logNode): DOMElement - { - $xml = $logNode->ownerDocument->createElement('xml'); - $xml->setAttribute('outputDirectory', $logNode->getAttribute('target')); - - return $xml; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/IntroduceCoverageElement.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/IntroduceCoverageElement.php deleted file mode 100644 index 867a8441..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/IntroduceCoverageElement.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 PHPUnit\TextUI\XmlConfiguration; - -use DOMDocument; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class IntroduceCoverageElement implements Migration -{ - public function migrate(DOMDocument $document): void - { - $coverage = $document->createElement('coverage'); - - $document->documentElement->insertBefore( - $coverage, - $document->documentElement->firstChild - ); - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/LogToReportMigration.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/LogToReportMigration.php deleted file mode 100644 index e987308b..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/LogToReportMigration.php +++ /dev/null @@ -1,79 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use function sprintf; -use DOMDocument; -use DOMElement; -use DOMXPath; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -abstract class LogToReportMigration implements Migration -{ - /** - * @throws MigrationException - */ - public function migrate(DOMDocument $document): void - { - $coverage = $document->getElementsByTagName('coverage')->item(0); - - if (!$coverage instanceof DOMElement) { - throw new MigrationException('Unexpected state - No coverage element'); - } - - $logNode = $this->findLogNode($document); - - if ($logNode === null) { - return; - } - - $reportChild = $this->toReportFormat($logNode); - - $report = $coverage->getElementsByTagName('report')->item(0); - - if ($report === null) { - $report = $coverage->appendChild($document->createElement('report')); - } - - $report->appendChild($reportChild); - $logNode->parentNode->removeChild($logNode); - } - - protected function migrateAttributes(DOMElement $src, DOMElement $dest, array $attributes): void - { - foreach ($attributes as $attr) { - if (!$src->hasAttribute($attr)) { - continue; - } - - $dest->setAttribute($attr, $src->getAttribute($attr)); - $src->removeAttribute($attr); - } - } - - abstract protected function forType(): string; - - abstract protected function toReportFormat(DOMElement $logNode): DOMElement; - - private function findLogNode(DOMDocument $document): ?DOMElement - { - $logNode = (new DOMXPath($document))->query( - sprintf('//logging/log[@type="%s"]', $this->forType()) - )->item(0); - - if (!$logNode instanceof DOMElement) { - return null; - } - - return $logNode; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/Migration.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/Migration.php deleted file mode 100644 index fa4092a9..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/Migration.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. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use DOMDocument; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -interface Migration -{ - public function migrate(DOMDocument $document): void; -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveAttributesFromFilterWhitelistToCoverage.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveAttributesFromFilterWhitelistToCoverage.php deleted file mode 100644 index a7aab5e5..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveAttributesFromFilterWhitelistToCoverage.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 PHPUnit\TextUI\XmlConfiguration; - -use DOMDocument; -use DOMElement; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class MoveAttributesFromFilterWhitelistToCoverage implements Migration -{ - /** - * @throws MigrationException - */ - public function migrate(DOMDocument $document): void - { - $whitelist = $document->getElementsByTagName('whitelist')->item(0); - - if (!$whitelist) { - return; - } - - $coverage = $document->getElementsByTagName('coverage')->item(0); - - if (!$coverage instanceof DOMElement) { - throw new MigrationException('Unexpected state - No coverage element'); - } - - $map = [ - 'addUncoveredFilesFromWhitelist' => 'includeUncoveredFiles', - 'processUncoveredFilesFromWhitelist' => 'processUncoveredFiles', - ]; - - foreach ($map as $old => $new) { - if (!$whitelist->hasAttribute($old)) { - continue; - } - - $coverage->setAttribute($new, $whitelist->getAttribute($old)); - $whitelist->removeAttribute($old); - } - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveAttributesFromRootToCoverage.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveAttributesFromRootToCoverage.php deleted file mode 100644 index b86b259c..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveAttributesFromRootToCoverage.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use DOMDocument; -use DOMElement; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class MoveAttributesFromRootToCoverage implements Migration -{ - /** - * @throws MigrationException - */ - public function migrate(DOMDocument $document): void - { - $map = [ - 'disableCodeCoverageIgnore' => 'disableCodeCoverageIgnore', - 'ignoreDeprecatedCodeUnitsFromCodeCoverage' => 'ignoreDeprecatedCodeUnits', - ]; - - $root = $document->documentElement; - - $coverage = $document->getElementsByTagName('coverage')->item(0); - - if (!$coverage instanceof DOMElement) { - throw new MigrationException('Unexpected state - No coverage element'); - } - - foreach ($map as $old => $new) { - if (!$root->hasAttribute($old)) { - continue; - } - - $coverage->setAttribute($new, $root->getAttribute($old)); - $root->removeAttribute($old); - } - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistDirectoriesToCoverage.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistDirectoriesToCoverage.php deleted file mode 100644 index 14e6cec8..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistDirectoriesToCoverage.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use DOMDocument; -use DOMElement; -use PHPUnit\Util\Xml\SnapshotNodeList; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class MoveWhitelistDirectoriesToCoverage implements Migration -{ - /** - * @throws MigrationException - */ - public function migrate(DOMDocument $document): void - { - $whitelist = $document->getElementsByTagName('whitelist')->item(0); - - if ($whitelist === null) { - return; - } - - $coverage = $document->getElementsByTagName('coverage')->item(0); - - if (!$coverage instanceof DOMElement) { - throw new MigrationException('Unexpected state - No coverage element'); - } - - $include = $document->createElement('include'); - $coverage->appendChild($include); - - foreach (SnapshotNodeList::fromNodeList($whitelist->childNodes) as $child) { - if (!$child instanceof DOMElement || $child->nodeName !== 'directory') { - continue; - } - - $include->appendChild($child); - } - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistExcludesToCoverage.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistExcludesToCoverage.php deleted file mode 100644 index c55315fa..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistExcludesToCoverage.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use function assert; -use function in_array; -use DOMDocument; -use DOMElement; -use PHPUnit\Util\Xml\SnapshotNodeList; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class MoveWhitelistExcludesToCoverage implements Migration -{ - /** - * @throws MigrationException - */ - public function migrate(DOMDocument $document): void - { - $whitelist = $document->getElementsByTagName('whitelist')->item(0); - - if ($whitelist === null) { - return; - } - - $excludeNodes = SnapshotNodeList::fromNodeList($whitelist->getElementsByTagName('exclude')); - - if ($excludeNodes->count() === 0) { - return; - } - - $coverage = $document->getElementsByTagName('coverage')->item(0); - - if (!$coverage instanceof DOMElement) { - throw new MigrationException('Unexpected state - No coverage element'); - } - - $targetExclude = $coverage->getElementsByTagName('exclude')->item(0); - - if ($targetExclude === null) { - $targetExclude = $coverage->appendChild( - $document->createElement('exclude') - ); - } - - foreach ($excludeNodes as $excludeNode) { - assert($excludeNode instanceof DOMElement); - - foreach (SnapshotNodeList::fromNodeList($excludeNode->childNodes) as $child) { - if (!$child instanceof DOMElement || !in_array($child->nodeName, ['directory', 'file'], true)) { - continue; - } - - $targetExclude->appendChild($child); - } - - if ($excludeNode->getElementsByTagName('*')->count() !== 0) { - throw new MigrationException('Dangling child elements in exclude found.'); - } - - $whitelist->removeChild($excludeNode); - } - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/RemoveCacheTokensAttribute.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/RemoveCacheTokensAttribute.php deleted file mode 100644 index 0eec12ac..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/RemoveCacheTokensAttribute.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 PHPUnit\TextUI\XmlConfiguration; - -use DOMDocument; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class RemoveCacheTokensAttribute implements Migration -{ - public function migrate(DOMDocument $document): void - { - $root = $document->documentElement; - - if ($root->hasAttribute('cacheTokens')) { - $root->removeAttribute('cacheTokens'); - } - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/RemoveEmptyFilter.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/RemoveEmptyFilter.php deleted file mode 100644 index 8f1a6d54..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/RemoveEmptyFilter.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use function sprintf; -use DOMDocument; -use DOMElement; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class RemoveEmptyFilter implements Migration -{ - /** - * @throws MigrationException - */ - public function migrate(DOMDocument $document): void - { - $whitelist = $document->getElementsByTagName('whitelist')->item(0); - - if ($whitelist instanceof DOMElement) { - $this->ensureEmpty($whitelist); - $whitelist->parentNode->removeChild($whitelist); - } - - $filter = $document->getElementsByTagName('filter')->item(0); - - if ($filter instanceof DOMElement) { - $this->ensureEmpty($filter); - $filter->parentNode->removeChild($filter); - } - } - - /** - * @throws MigrationException - */ - private function ensureEmpty(DOMElement $element): void - { - if ($element->attributes->length > 0) { - throw new MigrationException(sprintf('%s element has unexpected attributes', $element->nodeName)); - } - - if ($element->getElementsByTagName('*')->length > 0) { - throw new MigrationException(sprintf('%s element has unexpected children', $element->nodeName)); - } - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/RemoveLogTypes.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/RemoveLogTypes.php deleted file mode 100644 index 962ff13c..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/RemoveLogTypes.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use function assert; -use DOMDocument; -use DOMElement; -use PHPUnit\Util\Xml\SnapshotNodeList; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class RemoveLogTypes implements Migration -{ - public function migrate(DOMDocument $document): void - { - $logging = $document->getElementsByTagName('logging')->item(0); - - if (!$logging instanceof DOMElement) { - return; - } - - foreach (SnapshotNodeList::fromNodeList($logging->getElementsByTagName('log')) as $logNode) { - assert($logNode instanceof DOMElement); - - switch ($logNode->getAttribute('type')) { - case 'json': - case 'tap': - $logging->removeChild($logNode); - } - } - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/UpdateSchemaLocationTo93.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/UpdateSchemaLocationTo93.php deleted file mode 100644 index 2e86ab6e..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/UpdateSchemaLocationTo93.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 PHPUnit\TextUI\XmlConfiguration; - -use DOMDocument; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class UpdateSchemaLocationTo93 implements Migration -{ - public function migrate(DOMDocument $document): void - { - $document->documentElement->setAttributeNS( - 'http://www.w3.org/2001/XMLSchema-instance', - 'xsi:noNamespaceSchemaLocation', - 'https://schema.phpunit.de/9.3/phpunit.xsd' - ); - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrator.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrator.php deleted file mode 100644 index d173e7af..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrator.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. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use function sprintf; -use PHPUnit\Util\Xml\Exception as XmlException; -use PHPUnit\Util\Xml\Loader as XmlLoader; -use PHPUnit\Util\Xml\SchemaDetector; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Migrator -{ - /** - * @throws Exception - * @throws MigrationBuilderException - * @throws MigrationException - * @throws XmlException - */ - public function migrate(string $filename): string - { - $origin = (new SchemaDetector)->detect($filename); - - if (!$origin->detected()) { - throw new Exception( - sprintf( - '"%s" is not a valid PHPUnit XML configuration file that can be migrated', - $filename, - ) - ); - } - - $configurationDocument = (new XmlLoader)->loadFile( - $filename, - false, - true, - true - ); - - foreach ((new MigrationBuilder)->build($origin->version()) as $migration) { - $migration->migrate($configurationDocument); - } - - $configurationDocument->formatOutput = true; - $configurationDocument->preserveWhiteSpace = false; - - return $configurationDocument->saveXML(); - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/Constant.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/Constant.php deleted file mode 100644 index 6d4bc94c..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/Constant.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class Constant -{ - /** - * @var string - */ - private $name; - - /** - * @var mixed - */ - private $value; - - public function __construct(string $name, $value) - { - $this->name = $name; - $this->value = $value; - } - - public function name(): string - { - return $this->name; - } - - public function value() - { - return $this->value; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/ConstantCollection.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/ConstantCollection.php deleted file mode 100644 index 440b0b0b..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/ConstantCollection.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use function count; -use Countable; -use IteratorAggregate; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - * - * @template-implements IteratorAggregate - */ -final class ConstantCollection implements Countable, IteratorAggregate -{ - /** - * @var Constant[] - */ - private $constants; - - /** - * @param Constant[] $constants - */ - public static function fromArray(array $constants): self - { - return new self(...$constants); - } - - private function __construct(Constant ...$constants) - { - $this->constants = $constants; - } - - /** - * @return Constant[] - */ - public function asArray(): array - { - return $this->constants; - } - - public function count(): int - { - return count($this->constants); - } - - public function getIterator(): ConstantCollectionIterator - { - return new ConstantCollectionIterator($this); - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/ConstantCollectionIterator.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/ConstantCollectionIterator.php deleted file mode 100644 index 623de961..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/ConstantCollectionIterator.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use function count; -use function iterator_count; -use Countable; -use Iterator; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @template-implements Iterator - */ -final class ConstantCollectionIterator implements Countable, Iterator -{ - /** - * @var Constant[] - */ - private $constants; - - /** - * @var int - */ - private $position; - - public function __construct(ConstantCollection $constants) - { - $this->constants = $constants->asArray(); - } - - public function count(): int - { - return iterator_count($this); - } - - public function rewind(): void - { - $this->position = 0; - } - - public function valid(): bool - { - return $this->position < count($this->constants); - } - - public function key(): int - { - return $this->position; - } - - public function current(): Constant - { - return $this->constants[$this->position]; - } - - public function next(): void - { - $this->position++; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/IniSetting.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/IniSetting.php deleted file mode 100644 index 4786618d..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/IniSetting.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class IniSetting -{ - /** - * @var string - */ - private $name; - - /** - * @var string - */ - private $value; - - public function __construct(string $name, string $value) - { - $this->name = $name; - $this->value = $value; - } - - public function name(): string - { - return $this->name; - } - - public function value(): string - { - return $this->value; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/IniSettingCollection.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/IniSettingCollection.php deleted file mode 100644 index 28e40d93..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/IniSettingCollection.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use function count; -use Countable; -use IteratorAggregate; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - * - * @template-implements IteratorAggregate - */ -final class IniSettingCollection implements Countable, IteratorAggregate -{ - /** - * @var IniSetting[] - */ - private $iniSettings; - - /** - * @param IniSetting[] $iniSettings - */ - public static function fromArray(array $iniSettings): self - { - return new self(...$iniSettings); - } - - private function __construct(IniSetting ...$iniSettings) - { - $this->iniSettings = $iniSettings; - } - - /** - * @return IniSetting[] - */ - public function asArray(): array - { - return $this->iniSettings; - } - - public function count(): int - { - return count($this->iniSettings); - } - - public function getIterator(): IniSettingCollectionIterator - { - return new IniSettingCollectionIterator($this); - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/IniSettingCollectionIterator.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/IniSettingCollectionIterator.php deleted file mode 100644 index 6c348b48..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/IniSettingCollectionIterator.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use function count; -use function iterator_count; -use Countable; -use Iterator; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @template-implements Iterator - */ -final class IniSettingCollectionIterator implements Countable, Iterator -{ - /** - * @var IniSetting[] - */ - private $iniSettings; - - /** - * @var int - */ - private $position; - - public function __construct(IniSettingCollection $iniSettings) - { - $this->iniSettings = $iniSettings->asArray(); - } - - public function count(): int - { - return iterator_count($this); - } - - public function rewind(): void - { - $this->position = 0; - } - - public function valid(): bool - { - return $this->position < count($this->iniSettings); - } - - public function key(): int - { - return $this->position; - } - - public function current(): IniSetting - { - return $this->iniSettings[$this->position]; - } - - public function next(): void - { - $this->position++; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/Php.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/Php.php deleted file mode 100644 index c1e9c6fd..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/Php.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. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class Php -{ - /** - * @var DirectoryCollection - */ - private $includePaths; - - /** - * @var IniSettingCollection - */ - private $iniSettings; - - /** - * @var ConstantCollection - */ - private $constants; - - /** - * @var VariableCollection - */ - private $globalVariables; - - /** - * @var VariableCollection - */ - private $envVariables; - - /** - * @var VariableCollection - */ - private $postVariables; - - /** - * @var VariableCollection - */ - private $getVariables; - - /** - * @var VariableCollection - */ - private $cookieVariables; - - /** - * @var VariableCollection - */ - private $serverVariables; - - /** - * @var VariableCollection - */ - private $filesVariables; - - /** - * @var VariableCollection - */ - private $requestVariables; - - public function __construct(DirectoryCollection $includePaths, IniSettingCollection $iniSettings, ConstantCollection $constants, VariableCollection $globalVariables, VariableCollection $envVariables, VariableCollection $postVariables, VariableCollection $getVariables, VariableCollection $cookieVariables, VariableCollection $serverVariables, VariableCollection $filesVariables, VariableCollection $requestVariables) - { - $this->includePaths = $includePaths; - $this->iniSettings = $iniSettings; - $this->constants = $constants; - $this->globalVariables = $globalVariables; - $this->envVariables = $envVariables; - $this->postVariables = $postVariables; - $this->getVariables = $getVariables; - $this->cookieVariables = $cookieVariables; - $this->serverVariables = $serverVariables; - $this->filesVariables = $filesVariables; - $this->requestVariables = $requestVariables; - } - - public function includePaths(): DirectoryCollection - { - return $this->includePaths; - } - - public function iniSettings(): IniSettingCollection - { - return $this->iniSettings; - } - - public function constants(): ConstantCollection - { - return $this->constants; - } - - public function globalVariables(): VariableCollection - { - return $this->globalVariables; - } - - public function envVariables(): VariableCollection - { - return $this->envVariables; - } - - public function postVariables(): VariableCollection - { - return $this->postVariables; - } - - public function getVariables(): VariableCollection - { - return $this->getVariables; - } - - public function cookieVariables(): VariableCollection - { - return $this->cookieVariables; - } - - public function serverVariables(): VariableCollection - { - return $this->serverVariables; - } - - public function filesVariables(): VariableCollection - { - return $this->filesVariables; - } - - public function requestVariables(): VariableCollection - { - return $this->requestVariables; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/PhpHandler.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/PhpHandler.php deleted file mode 100644 index 5fb0c72b..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/PhpHandler.php +++ /dev/null @@ -1,121 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use const PATH_SEPARATOR; -use function constant; -use function define; -use function defined; -use function getenv; -use function implode; -use function ini_get; -use function ini_set; -use function putenv; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class PhpHandler -{ - public function handle(Php $configuration): void - { - $this->handleIncludePaths($configuration->includePaths()); - $this->handleIniSettings($configuration->iniSettings()); - $this->handleConstants($configuration->constants()); - $this->handleGlobalVariables($configuration->globalVariables()); - $this->handleServerVariables($configuration->serverVariables()); - $this->handleEnvVariables($configuration->envVariables()); - $this->handleVariables('_POST', $configuration->postVariables()); - $this->handleVariables('_GET', $configuration->getVariables()); - $this->handleVariables('_COOKIE', $configuration->cookieVariables()); - $this->handleVariables('_FILES', $configuration->filesVariables()); - $this->handleVariables('_REQUEST', $configuration->requestVariables()); - } - - private function handleIncludePaths(DirectoryCollection $includePaths): void - { - if (!$includePaths->isEmpty()) { - $includePathsAsStrings = []; - - foreach ($includePaths as $includePath) { - $includePathsAsStrings[] = $includePath->path(); - } - - ini_set( - 'include_path', - implode(PATH_SEPARATOR, $includePathsAsStrings) . - PATH_SEPARATOR . - ini_get('include_path') - ); - } - } - - private function handleIniSettings(IniSettingCollection $iniSettings): void - { - foreach ($iniSettings as $iniSetting) { - $value = $iniSetting->value(); - - if (defined($value)) { - $value = (string) constant($value); - } - - ini_set($iniSetting->name(), $value); - } - } - - private function handleConstants(ConstantCollection $constants): void - { - foreach ($constants as $constant) { - if (!defined($constant->name())) { - define($constant->name(), $constant->value()); - } - } - } - - private function handleGlobalVariables(VariableCollection $variables): void - { - foreach ($variables as $variable) { - $GLOBALS[$variable->name()] = $variable->value(); - } - } - - private function handleServerVariables(VariableCollection $variables): void - { - foreach ($variables as $variable) { - $_SERVER[$variable->name()] = $variable->value(); - } - } - - private function handleVariables(string $target, VariableCollection $variables): void - { - foreach ($variables as $variable) { - $GLOBALS[$target][$variable->name()] = $variable->value(); - } - } - - private function handleEnvVariables(VariableCollection $variables): void - { - foreach ($variables as $variable) { - $name = $variable->name(); - $value = $variable->value(); - $force = $variable->force(); - - if ($force || getenv($name) === false) { - putenv("{$name}={$value}"); - } - - $value = getenv($name); - - if ($force || !isset($_ENV[$name])) { - $_ENV[$name] = $value; - } - } - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/Variable.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/Variable.php deleted file mode 100644 index 37c572ae..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/Variable.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class Variable -{ - /** - * @var string - */ - private $name; - - /** - * @var mixed - */ - private $value; - - /** - * @var bool - */ - private $force; - - public function __construct(string $name, $value, bool $force) - { - $this->name = $name; - $this->value = $value; - $this->force = $force; - } - - public function name(): string - { - return $this->name; - } - - public function value() - { - return $this->value; - } - - public function force(): bool - { - return $this->force; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/VariableCollection.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/VariableCollection.php deleted file mode 100644 index 6662db64..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/VariableCollection.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use function count; -use Countable; -use IteratorAggregate; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - * - * @template-implements IteratorAggregate - */ -final class VariableCollection implements Countable, IteratorAggregate -{ - /** - * @var Variable[] - */ - private $variables; - - /** - * @param Variable[] $variables - */ - public static function fromArray(array $variables): self - { - return new self(...$variables); - } - - private function __construct(Variable ...$variables) - { - $this->variables = $variables; - } - - /** - * @return Variable[] - */ - public function asArray(): array - { - return $this->variables; - } - - public function count(): int - { - return count($this->variables); - } - - public function getIterator(): VariableCollectionIterator - { - return new VariableCollectionIterator($this); - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/VariableCollectionIterator.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/VariableCollectionIterator.php deleted file mode 100644 index 032d0be1..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/VariableCollectionIterator.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use function count; -use function iterator_count; -use Countable; -use Iterator; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @template-implements Iterator - */ -final class VariableCollectionIterator implements Countable, Iterator -{ - /** - * @var Variable[] - */ - private $variables; - - /** - * @var int - */ - private $position; - - public function __construct(VariableCollection $variables) - { - $this->variables = $variables->asArray(); - } - - public function count(): int - { - return iterator_count($this); - } - - public function rewind(): void - { - $this->position = 0; - } - - public function valid(): bool - { - return $this->position < count($this->variables); - } - - public function key(): int - { - return $this->position; - } - - public function current(): Variable - { - return $this->variables[$this->position]; - } - - public function next(): void - { - $this->position++; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHPUnit/Extension.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHPUnit/Extension.php deleted file mode 100644 index 09fe8cc9..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHPUnit/Extension.php +++ /dev/null @@ -1,73 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class Extension -{ - /** - * @var string - * - * @psalm-var class-string - */ - private $className; - - /** - * @var string - */ - private $sourceFile; - - /** - * @var array - */ - private $arguments; - - /** - * @psalm-param class-string $className - */ - public function __construct(string $className, string $sourceFile, array $arguments) - { - $this->className = $className; - $this->sourceFile = $sourceFile; - $this->arguments = $arguments; - } - - /** - * @psalm-return class-string - */ - public function className(): string - { - return $this->className; - } - - public function hasSourceFile(): bool - { - return $this->sourceFile !== ''; - } - - public function sourceFile(): string - { - return $this->sourceFile; - } - - public function hasArguments(): bool - { - return !empty($this->arguments); - } - - public function arguments(): array - { - return $this->arguments; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHPUnit/ExtensionCollection.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHPUnit/ExtensionCollection.php deleted file mode 100644 index 76d07ebc..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHPUnit/ExtensionCollection.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 PHPUnit\TextUI\XmlConfiguration; - -use IteratorAggregate; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - * - * @template-implements IteratorAggregate - */ -final class ExtensionCollection implements IteratorAggregate -{ - /** - * @var Extension[] - */ - private $extensions; - - /** - * @param Extension[] $extensions - */ - public static function fromArray(array $extensions): self - { - return new self(...$extensions); - } - - private function __construct(Extension ...$extensions) - { - $this->extensions = $extensions; - } - - /** - * @return Extension[] - */ - public function asArray(): array - { - return $this->extensions; - } - - public function getIterator(): ExtensionCollectionIterator - { - return new ExtensionCollectionIterator($this); - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHPUnit/ExtensionCollectionIterator.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHPUnit/ExtensionCollectionIterator.php deleted file mode 100644 index a9fc1af8..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHPUnit/ExtensionCollectionIterator.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use function count; -use function iterator_count; -use Countable; -use Iterator; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @template-implements Iterator - */ -final class ExtensionCollectionIterator implements Countable, Iterator -{ - /** - * @var Extension[] - */ - private $extensions; - - /** - * @var int - */ - private $position; - - public function __construct(ExtensionCollection $extensions) - { - $this->extensions = $extensions->asArray(); - } - - public function count(): int - { - return iterator_count($this); - } - - public function rewind(): void - { - $this->position = 0; - } - - public function valid(): bool - { - return $this->position < count($this->extensions); - } - - public function key(): int - { - return $this->position; - } - - public function current(): Extension - { - return $this->extensions[$this->position]; - } - - public function next(): void - { - $this->position++; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHPUnit/PHPUnit.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHPUnit/PHPUnit.php deleted file mode 100644 index 5b3ce9b8..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHPUnit/PHPUnit.php +++ /dev/null @@ -1,715 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class PHPUnit -{ - /** - * @var bool - */ - private $cacheResult; - - /** - * @var ?string - */ - private $cacheResultFile; - - /** - * @var int|string - */ - private $columns; - - /** - * @var string - */ - private $colors; - - /** - * @var bool - */ - private $stderr; - - /** - * @var bool - */ - private $noInteraction; - - /** - * @var bool - */ - private $verbose; - - /** - * @var bool - */ - private $reverseDefectList; - - /** - * @var bool - */ - private $convertDeprecationsToExceptions; - - /** - * @var bool - */ - private $convertErrorsToExceptions; - - /** - * @var bool - */ - private $convertNoticesToExceptions; - - /** - * @var bool - */ - private $convertWarningsToExceptions; - - /** - * @var bool - */ - private $forceCoversAnnotation; - - /** - * @var ?string - */ - private $bootstrap; - - /** - * @var bool - */ - private $processIsolation; - - /** - * @var bool - */ - private $failOnEmptyTestSuite; - - /** - * @var bool - */ - private $failOnIncomplete; - - /** - * @var bool - */ - private $failOnRisky; - - /** - * @var bool - */ - private $failOnSkipped; - - /** - * @var bool - */ - private $failOnWarning; - - /** - * @var bool - */ - private $stopOnDefect; - - /** - * @var bool - */ - private $stopOnError; - - /** - * @var bool - */ - private $stopOnFailure; - - /** - * @var bool - */ - private $stopOnWarning; - - /** - * @var bool - */ - private $stopOnIncomplete; - - /** - * @var bool - */ - private $stopOnRisky; - - /** - * @var bool - */ - private $stopOnSkipped; - - /** - * @var ?string - */ - private $extensionsDirectory; - - /** - * @var ?string - * - * @deprecated see https://github.com/sebastianbergmann/phpunit/issues/4039 - */ - private $testSuiteLoaderClass; - - /** - * @var ?string - * - * @deprecated see https://github.com/sebastianbergmann/phpunit/issues/4039 - */ - private $testSuiteLoaderFile; - - /** - * @var ?string - */ - private $printerClass; - - /** - * @var ?string - */ - private $printerFile; - - /** - * @var bool - */ - private $beStrictAboutChangesToGlobalState; - - /** - * @var bool - */ - private $beStrictAboutOutputDuringTests; - - /** - * @var bool - */ - private $beStrictAboutResourceUsageDuringSmallTests; - - /** - * @var bool - */ - private $beStrictAboutTestsThatDoNotTestAnything; - - /** - * @var bool - */ - private $beStrictAboutTodoAnnotatedTests; - - /** - * @var bool - */ - private $beStrictAboutCoversAnnotation; - - /** - * @var bool - */ - private $enforceTimeLimit; - - /** - * @var int - */ - private $defaultTimeLimit; - - /** - * @var int - */ - private $timeoutForSmallTests; - - /** - * @var int - */ - private $timeoutForMediumTests; - - /** - * @var int - */ - private $timeoutForLargeTests; - - /** - * @var ?string - */ - private $defaultTestSuite; - - /** - * @var int - */ - private $executionOrder; - - /** - * @var bool - */ - private $resolveDependencies; - - /** - * @var bool - */ - private $defectsFirst; - - /** - * @var bool - */ - private $backupGlobals; - - /** - * @var bool - */ - private $backupStaticAttributes; - - /** - * @var bool - */ - private $registerMockObjectsFromTestArgumentsRecursively; - - /** - * @var bool - */ - private $conflictBetweenPrinterClassAndTestdox; - - public function __construct(bool $cacheResult, ?string $cacheResultFile, $columns, string $colors, bool $stderr, bool $noInteraction, bool $verbose, bool $reverseDefectList, bool $convertDeprecationsToExceptions, bool $convertErrorsToExceptions, bool $convertNoticesToExceptions, bool $convertWarningsToExceptions, bool $forceCoversAnnotation, ?string $bootstrap, bool $processIsolation, bool $failOnEmptyTestSuite, bool $failOnIncomplete, bool $failOnRisky, bool $failOnSkipped, bool $failOnWarning, bool $stopOnDefect, bool $stopOnError, bool $stopOnFailure, bool $stopOnWarning, bool $stopOnIncomplete, bool $stopOnRisky, bool $stopOnSkipped, ?string $extensionsDirectory, ?string $testSuiteLoaderClass, ?string $testSuiteLoaderFile, ?string $printerClass, ?string $printerFile, bool $beStrictAboutChangesToGlobalState, bool $beStrictAboutOutputDuringTests, bool $beStrictAboutResourceUsageDuringSmallTests, bool $beStrictAboutTestsThatDoNotTestAnything, bool $beStrictAboutTodoAnnotatedTests, bool $beStrictAboutCoversAnnotation, bool $enforceTimeLimit, int $defaultTimeLimit, int $timeoutForSmallTests, int $timeoutForMediumTests, int $timeoutForLargeTests, ?string $defaultTestSuite, int $executionOrder, bool $resolveDependencies, bool $defectsFirst, bool $backupGlobals, bool $backupStaticAttributes, bool $registerMockObjectsFromTestArgumentsRecursively, bool $conflictBetweenPrinterClassAndTestdox) - { - $this->cacheResult = $cacheResult; - $this->cacheResultFile = $cacheResultFile; - $this->columns = $columns; - $this->colors = $colors; - $this->stderr = $stderr; - $this->noInteraction = $noInteraction; - $this->verbose = $verbose; - $this->reverseDefectList = $reverseDefectList; - $this->convertDeprecationsToExceptions = $convertDeprecationsToExceptions; - $this->convertErrorsToExceptions = $convertErrorsToExceptions; - $this->convertNoticesToExceptions = $convertNoticesToExceptions; - $this->convertWarningsToExceptions = $convertWarningsToExceptions; - $this->forceCoversAnnotation = $forceCoversAnnotation; - $this->bootstrap = $bootstrap; - $this->processIsolation = $processIsolation; - $this->failOnEmptyTestSuite = $failOnEmptyTestSuite; - $this->failOnIncomplete = $failOnIncomplete; - $this->failOnRisky = $failOnRisky; - $this->failOnSkipped = $failOnSkipped; - $this->failOnWarning = $failOnWarning; - $this->stopOnDefect = $stopOnDefect; - $this->stopOnError = $stopOnError; - $this->stopOnFailure = $stopOnFailure; - $this->stopOnWarning = $stopOnWarning; - $this->stopOnIncomplete = $stopOnIncomplete; - $this->stopOnRisky = $stopOnRisky; - $this->stopOnSkipped = $stopOnSkipped; - $this->extensionsDirectory = $extensionsDirectory; - $this->testSuiteLoaderClass = $testSuiteLoaderClass; - $this->testSuiteLoaderFile = $testSuiteLoaderFile; - $this->printerClass = $printerClass; - $this->printerFile = $printerFile; - $this->beStrictAboutChangesToGlobalState = $beStrictAboutChangesToGlobalState; - $this->beStrictAboutOutputDuringTests = $beStrictAboutOutputDuringTests; - $this->beStrictAboutResourceUsageDuringSmallTests = $beStrictAboutResourceUsageDuringSmallTests; - $this->beStrictAboutTestsThatDoNotTestAnything = $beStrictAboutTestsThatDoNotTestAnything; - $this->beStrictAboutTodoAnnotatedTests = $beStrictAboutTodoAnnotatedTests; - $this->beStrictAboutCoversAnnotation = $beStrictAboutCoversAnnotation; - $this->enforceTimeLimit = $enforceTimeLimit; - $this->defaultTimeLimit = $defaultTimeLimit; - $this->timeoutForSmallTests = $timeoutForSmallTests; - $this->timeoutForMediumTests = $timeoutForMediumTests; - $this->timeoutForLargeTests = $timeoutForLargeTests; - $this->defaultTestSuite = $defaultTestSuite; - $this->executionOrder = $executionOrder; - $this->resolveDependencies = $resolveDependencies; - $this->defectsFirst = $defectsFirst; - $this->backupGlobals = $backupGlobals; - $this->backupStaticAttributes = $backupStaticAttributes; - $this->registerMockObjectsFromTestArgumentsRecursively = $registerMockObjectsFromTestArgumentsRecursively; - $this->conflictBetweenPrinterClassAndTestdox = $conflictBetweenPrinterClassAndTestdox; - } - - public function cacheResult(): bool - { - return $this->cacheResult; - } - - /** - * @psalm-assert-if-true !null $this->cacheResultFile - */ - public function hasCacheResultFile(): bool - { - return $this->cacheResultFile !== null; - } - - /** - * @throws Exception - */ - public function cacheResultFile(): string - { - if (!$this->hasCacheResultFile()) { - throw new Exception('Cache result file is not configured'); - } - - return (string) $this->cacheResultFile; - } - - public function columns() - { - return $this->columns; - } - - public function colors(): string - { - return $this->colors; - } - - public function stderr(): bool - { - return $this->stderr; - } - - public function noInteraction(): bool - { - return $this->noInteraction; - } - - public function verbose(): bool - { - return $this->verbose; - } - - public function reverseDefectList(): bool - { - return $this->reverseDefectList; - } - - public function convertDeprecationsToExceptions(): bool - { - return $this->convertDeprecationsToExceptions; - } - - public function convertErrorsToExceptions(): bool - { - return $this->convertErrorsToExceptions; - } - - public function convertNoticesToExceptions(): bool - { - return $this->convertNoticesToExceptions; - } - - public function convertWarningsToExceptions(): bool - { - return $this->convertWarningsToExceptions; - } - - public function forceCoversAnnotation(): bool - { - return $this->forceCoversAnnotation; - } - - /** - * @psalm-assert-if-true !null $this->bootstrap - */ - public function hasBootstrap(): bool - { - return $this->bootstrap !== null; - } - - /** - * @throws Exception - */ - public function bootstrap(): string - { - if (!$this->hasBootstrap()) { - throw new Exception('Bootstrap script is not configured'); - } - - return (string) $this->bootstrap; - } - - public function processIsolation(): bool - { - return $this->processIsolation; - } - - public function failOnEmptyTestSuite(): bool - { - return $this->failOnEmptyTestSuite; - } - - public function failOnIncomplete(): bool - { - return $this->failOnIncomplete; - } - - public function failOnRisky(): bool - { - return $this->failOnRisky; - } - - public function failOnSkipped(): bool - { - return $this->failOnSkipped; - } - - public function failOnWarning(): bool - { - return $this->failOnWarning; - } - - public function stopOnDefect(): bool - { - return $this->stopOnDefect; - } - - public function stopOnError(): bool - { - return $this->stopOnError; - } - - public function stopOnFailure(): bool - { - return $this->stopOnFailure; - } - - public function stopOnWarning(): bool - { - return $this->stopOnWarning; - } - - public function stopOnIncomplete(): bool - { - return $this->stopOnIncomplete; - } - - public function stopOnRisky(): bool - { - return $this->stopOnRisky; - } - - public function stopOnSkipped(): bool - { - return $this->stopOnSkipped; - } - - /** - * @psalm-assert-if-true !null $this->extensionsDirectory - */ - public function hasExtensionsDirectory(): bool - { - return $this->extensionsDirectory !== null; - } - - /** - * @throws Exception - */ - public function extensionsDirectory(): string - { - if (!$this->hasExtensionsDirectory()) { - throw new Exception('Extensions directory is not configured'); - } - - return (string) $this->extensionsDirectory; - } - - /** - * @psalm-assert-if-true !null $this->testSuiteLoaderClass - * - * @deprecated see https://github.com/sebastianbergmann/phpunit/issues/4039 - */ - public function hasTestSuiteLoaderClass(): bool - { - return $this->testSuiteLoaderClass !== null; - } - - /** - * @throws Exception - * - * @deprecated see https://github.com/sebastianbergmann/phpunit/issues/4039 - */ - public function testSuiteLoaderClass(): string - { - if (!$this->hasTestSuiteLoaderClass()) { - throw new Exception('TestSuiteLoader class is not configured'); - } - - return (string) $this->testSuiteLoaderClass; - } - - /** - * @psalm-assert-if-true !null $this->testSuiteLoaderFile - * - * @deprecated see https://github.com/sebastianbergmann/phpunit/issues/4039 - */ - public function hasTestSuiteLoaderFile(): bool - { - return $this->testSuiteLoaderFile !== null; - } - - /** - * @throws Exception - * - * @deprecated see https://github.com/sebastianbergmann/phpunit/issues/4039 - */ - public function testSuiteLoaderFile(): string - { - if (!$this->hasTestSuiteLoaderFile()) { - throw new Exception('TestSuiteLoader sourcecode file is not configured'); - } - - return (string) $this->testSuiteLoaderFile; - } - - /** - * @psalm-assert-if-true !null $this->printerClass - */ - public function hasPrinterClass(): bool - { - return $this->printerClass !== null; - } - - /** - * @throws Exception - */ - public function printerClass(): string - { - if (!$this->hasPrinterClass()) { - throw new Exception('ResultPrinter class is not configured'); - } - - return (string) $this->printerClass; - } - - /** - * @psalm-assert-if-true !null $this->printerFile - */ - public function hasPrinterFile(): bool - { - return $this->printerFile !== null; - } - - /** - * @throws Exception - */ - public function printerFile(): string - { - if (!$this->hasPrinterFile()) { - throw new Exception('ResultPrinter sourcecode file is not configured'); - } - - return (string) $this->printerFile; - } - - public function beStrictAboutChangesToGlobalState(): bool - { - return $this->beStrictAboutChangesToGlobalState; - } - - public function beStrictAboutOutputDuringTests(): bool - { - return $this->beStrictAboutOutputDuringTests; - } - - public function beStrictAboutResourceUsageDuringSmallTests(): bool - { - return $this->beStrictAboutResourceUsageDuringSmallTests; - } - - public function beStrictAboutTestsThatDoNotTestAnything(): bool - { - return $this->beStrictAboutTestsThatDoNotTestAnything; - } - - public function beStrictAboutTodoAnnotatedTests(): bool - { - return $this->beStrictAboutTodoAnnotatedTests; - } - - public function beStrictAboutCoversAnnotation(): bool - { - return $this->beStrictAboutCoversAnnotation; - } - - public function enforceTimeLimit(): bool - { - return $this->enforceTimeLimit; - } - - public function defaultTimeLimit(): int - { - return $this->defaultTimeLimit; - } - - public function timeoutForSmallTests(): int - { - return $this->timeoutForSmallTests; - } - - public function timeoutForMediumTests(): int - { - return $this->timeoutForMediumTests; - } - - public function timeoutForLargeTests(): int - { - return $this->timeoutForLargeTests; - } - - /** - * @psalm-assert-if-true !null $this->defaultTestSuite - */ - public function hasDefaultTestSuite(): bool - { - return $this->defaultTestSuite !== null; - } - - /** - * @throws Exception - */ - public function defaultTestSuite(): string - { - if (!$this->hasDefaultTestSuite()) { - throw new Exception('Default test suite is not configured'); - } - - return (string) $this->defaultTestSuite; - } - - public function executionOrder(): int - { - return $this->executionOrder; - } - - public function resolveDependencies(): bool - { - return $this->resolveDependencies; - } - - public function defectsFirst(): bool - { - return $this->defectsFirst; - } - - public function backupGlobals(): bool - { - return $this->backupGlobals; - } - - public function backupStaticAttributes(): bool - { - return $this->backupStaticAttributes; - } - - public function registerMockObjectsFromTestArgumentsRecursively(): bool - { - return $this->registerMockObjectsFromTestArgumentsRecursively; - } - - public function conflictBetweenPrinterClassAndTestdox(): bool - { - return $this->conflictBetweenPrinterClassAndTestdox; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestDirectory.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestDirectory.php deleted file mode 100644 index ecefbb7c..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestDirectory.php +++ /dev/null @@ -1,79 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use PHPUnit\Util\VersionComparisonOperator; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class TestDirectory -{ - /** - * @var string - */ - private $path; - - /** - * @var string - */ - private $prefix; - - /** - * @var string - */ - private $suffix; - - /** - * @var string - */ - private $phpVersion; - - /** - * @var VersionComparisonOperator - */ - private $phpVersionOperator; - - public function __construct(string $path, string $prefix, string $suffix, string $phpVersion, VersionComparisonOperator $phpVersionOperator) - { - $this->path = $path; - $this->prefix = $prefix; - $this->suffix = $suffix; - $this->phpVersion = $phpVersion; - $this->phpVersionOperator = $phpVersionOperator; - } - - public function path(): string - { - return $this->path; - } - - public function prefix(): string - { - return $this->prefix; - } - - public function suffix(): string - { - return $this->suffix; - } - - public function phpVersion(): string - { - return $this->phpVersion; - } - - public function phpVersionOperator(): VersionComparisonOperator - { - return $this->phpVersionOperator; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestDirectoryCollection.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestDirectoryCollection.php deleted file mode 100644 index 5f581c21..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestDirectoryCollection.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use function count; -use Countable; -use IteratorAggregate; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - * - * @template-implements IteratorAggregate - */ -final class TestDirectoryCollection implements Countable, IteratorAggregate -{ - /** - * @var TestDirectory[] - */ - private $directories; - - /** - * @param TestDirectory[] $directories - */ - public static function fromArray(array $directories): self - { - return new self(...$directories); - } - - private function __construct(TestDirectory ...$directories) - { - $this->directories = $directories; - } - - /** - * @return TestDirectory[] - */ - public function asArray(): array - { - return $this->directories; - } - - public function count(): int - { - return count($this->directories); - } - - public function getIterator(): TestDirectoryCollectionIterator - { - return new TestDirectoryCollectionIterator($this); - } - - public function isEmpty(): bool - { - return $this->count() === 0; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestDirectoryCollectionIterator.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestDirectoryCollectionIterator.php deleted file mode 100644 index b2312a38..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestDirectoryCollectionIterator.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use function count; -use function iterator_count; -use Countable; -use Iterator; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @template-implements Iterator - */ -final class TestDirectoryCollectionIterator implements Countable, Iterator -{ - /** - * @var TestDirectory[] - */ - private $directories; - - /** - * @var int - */ - private $position; - - public function __construct(TestDirectoryCollection $directories) - { - $this->directories = $directories->asArray(); - } - - public function count(): int - { - return iterator_count($this); - } - - public function rewind(): void - { - $this->position = 0; - } - - public function valid(): bool - { - return $this->position < count($this->directories); - } - - public function key(): int - { - return $this->position; - } - - public function current(): TestDirectory - { - return $this->directories[$this->position]; - } - - public function next(): void - { - $this->position++; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestFile.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestFile.php deleted file mode 100644 index 21d1cf7b..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestFile.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. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use PHPUnit\Util\VersionComparisonOperator; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class TestFile -{ - /** - * @var string - */ - private $path; - - /** - * @var string - */ - private $phpVersion; - - /** - * @var VersionComparisonOperator - */ - private $phpVersionOperator; - - public function __construct(string $path, string $phpVersion, VersionComparisonOperator $phpVersionOperator) - { - $this->path = $path; - $this->phpVersion = $phpVersion; - $this->phpVersionOperator = $phpVersionOperator; - } - - public function path(): string - { - return $this->path; - } - - public function phpVersion(): string - { - return $this->phpVersion; - } - - public function phpVersionOperator(): VersionComparisonOperator - { - return $this->phpVersionOperator; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestFileCollection.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestFileCollection.php deleted file mode 100644 index 27ba9bd2..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestFileCollection.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use function count; -use Countable; -use IteratorAggregate; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - * - * @template-implements IteratorAggregate - */ -final class TestFileCollection implements Countable, IteratorAggregate -{ - /** - * @var TestFile[] - */ - private $files; - - /** - * @param TestFile[] $files - */ - public static function fromArray(array $files): self - { - return new self(...$files); - } - - private function __construct(TestFile ...$files) - { - $this->files = $files; - } - - /** - * @return TestFile[] - */ - public function asArray(): array - { - return $this->files; - } - - public function count(): int - { - return count($this->files); - } - - public function getIterator(): TestFileCollectionIterator - { - return new TestFileCollectionIterator($this); - } - - public function isEmpty(): bool - { - return $this->count() === 0; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestFileCollectionIterator.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestFileCollectionIterator.php deleted file mode 100644 index 45a5f160..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestFileCollectionIterator.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use function count; -use function iterator_count; -use Countable; -use Iterator; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @template-implements Iterator - */ -final class TestFileCollectionIterator implements Countable, Iterator -{ - /** - * @var TestFile[] - */ - private $files; - - /** - * @var int - */ - private $position; - - public function __construct(TestFileCollection $files) - { - $this->files = $files->asArray(); - } - - public function count(): int - { - return iterator_count($this); - } - - public function rewind(): void - { - $this->position = 0; - } - - public function valid(): bool - { - return $this->position < count($this->files); - } - - public function key(): int - { - return $this->position; - } - - public function current(): TestFile - { - return $this->files[$this->position]; - } - - public function next(): void - { - $this->position++; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestSuite.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestSuite.php deleted file mode 100644 index 035376cb..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestSuite.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 PHPUnit\TextUI\XmlConfiguration; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class TestSuite -{ - /** - * @var string - */ - private $name; - - /** - * @var TestDirectoryCollection - */ - private $directories; - - /** - * @var TestFileCollection - */ - private $files; - - /** - * @var FileCollection - */ - private $exclude; - - public function __construct(string $name, TestDirectoryCollection $directories, TestFileCollection $files, FileCollection $exclude) - { - $this->name = $name; - $this->directories = $directories; - $this->files = $files; - $this->exclude = $exclude; - } - - public function name(): string - { - return $this->name; - } - - public function directories(): TestDirectoryCollection - { - return $this->directories; - } - - public function files(): TestFileCollection - { - return $this->files; - } - - public function exclude(): FileCollection - { - return $this->exclude; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestSuiteCollection.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestSuiteCollection.php deleted file mode 100644 index f632e519..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestSuiteCollection.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use function count; -use Countable; -use IteratorAggregate; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - * - * @template-implements IteratorAggregate - */ -final class TestSuiteCollection implements Countable, IteratorAggregate -{ - /** - * @var TestSuite[] - */ - private $testSuites; - - /** - * @param TestSuite[] $testSuites - */ - public static function fromArray(array $testSuites): self - { - return new self(...$testSuites); - } - - private function __construct(TestSuite ...$testSuites) - { - $this->testSuites = $testSuites; - } - - /** - * @return TestSuite[] - */ - public function asArray(): array - { - return $this->testSuites; - } - - public function count(): int - { - return count($this->testSuites); - } - - public function getIterator(): TestSuiteCollectionIterator - { - return new TestSuiteCollectionIterator($this); - } - - public function isEmpty(): bool - { - return $this->count() === 0; - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestSuiteCollectionIterator.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestSuiteCollectionIterator.php deleted file mode 100644 index 42d03db0..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestSuiteCollectionIterator.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use function count; -use function iterator_count; -use Countable; -use Iterator; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @template-implements Iterator - */ -final class TestSuiteCollectionIterator implements Countable, Iterator -{ - /** - * @var TestSuite[] - */ - private $testSuites; - - /** - * @var int - */ - private $position; - - public function __construct(TestSuiteCollection $testSuites) - { - $this->testSuites = $testSuites->asArray(); - } - - public function count(): int - { - return iterator_count($this); - } - - public function rewind(): void - { - $this->position = 0; - } - - public function valid(): bool - { - return $this->position < count($this->testSuites); - } - - public function key(): int - { - return $this->position; - } - - public function current(): TestSuite - { - return $this->testSuites[$this->position]; - } - - public function next(): void - { - $this->position++; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Annotation/DocBlock.php b/vendor/phpunit/phpunit/src/Util/Annotation/DocBlock.php deleted file mode 100644 index 648f9edc..00000000 --- a/vendor/phpunit/phpunit/src/Util/Annotation/DocBlock.php +++ /dev/null @@ -1,551 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\Annotation; - -use const JSON_ERROR_NONE; -use const PREG_OFFSET_CAPTURE; -use function array_filter; -use function array_key_exists; -use function array_map; -use function array_merge; -use function array_pop; -use function array_slice; -use function array_values; -use function count; -use function explode; -use function file; -use function implode; -use function is_array; -use function is_int; -use function json_decode; -use function json_last_error; -use function json_last_error_msg; -use function preg_match; -use function preg_match_all; -use function preg_replace; -use function preg_split; -use function realpath; -use function rtrim; -use function sprintf; -use function str_replace; -use function strlen; -use function strpos; -use function strtolower; -use function substr; -use function trim; -use PharIo\Version\VersionConstraintParser; -use PHPUnit\Framework\InvalidDataProviderException; -use PHPUnit\Framework\SkippedTestError; -use PHPUnit\Framework\Warning; -use PHPUnit\Util\Exception; -use PHPUnit\Util\InvalidDataSetException; -use ReflectionClass; -use ReflectionException; -use ReflectionFunctionAbstract; -use ReflectionMethod; -use Reflector; -use Traversable; - -/** - * This is an abstraction around a PHPUnit-specific docBlock, - * allowing us to ask meaningful questions about a specific - * reflection symbol. - * - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class DocBlock -{ - /** - * @todo This constant should be private (it's public because of TestTest::testGetProvidedDataRegEx) - */ - public const REGEX_DATA_PROVIDER = '/@dataProvider\s+([a-zA-Z0-9._:-\\\\x7f-\xff]+)/'; - - private const REGEX_REQUIRES_VERSION = '/@requires\s+(?PPHP(?:Unit)?)\s+(?P[<>=!]{0,2})\s*(?P[\d\.-]+(dev|(RC|alpha|beta)[\d\.])?)[ \t]*\r?$/m'; - - private const REGEX_REQUIRES_VERSION_CONSTRAINT = '/@requires\s+(?PPHP(?:Unit)?)\s+(?P[\d\t \-.|~^]+)[ \t]*\r?$/m'; - - private const REGEX_REQUIRES_OS = '/@requires\s+(?POS(?:FAMILY)?)\s+(?P.+?)[ \t]*\r?$/m'; - - private const REGEX_REQUIRES_SETTING = '/@requires\s+(?Psetting)\s+(?P([^ ]+?))\s*(?P[\w\.-]+[\w\.]?)?[ \t]*\r?$/m'; - - private const REGEX_REQUIRES = '/@requires\s+(?Pfunction|extension)\s+(?P([^\s<>=!]+))\s*(?P[<>=!]{0,2})\s*(?P[\d\.-]+[\d\.]?)?[ \t]*\r?$/m'; - - private const REGEX_TEST_WITH = '/@testWith\s+/'; - - /** @var string */ - private $docComment; - - /** @var bool */ - private $isMethod; - - /** @var array> pre-parsed annotations indexed by name and occurrence index */ - private $symbolAnnotations; - - /** - * @var null|array - * - * @psalm-var null|(array{ - * __OFFSET: array&array{__FILE: string}, - * setting?: array, - * extension_versions?: array - * }&array< - * string, - * string|array{version: string, operator: string}|array{constraint: string}|array - * >) - */ - private $parsedRequirements; - - /** @var int */ - private $startLine; - - /** @var int */ - private $endLine; - - /** @var string */ - private $fileName; - - /** @var string */ - private $name; - - /** - * @var string - * - * @psalm-var class-string - */ - private $className; - - public static function ofClass(ReflectionClass $class): self - { - $className = $class->getName(); - - return new self( - (string) $class->getDocComment(), - false, - self::extractAnnotationsFromReflector($class), - $class->getStartLine(), - $class->getEndLine(), - $class->getFileName(), - $className, - $className - ); - } - - /** - * @psalm-param class-string $classNameInHierarchy - */ - public static function ofMethod(ReflectionMethod $method, string $classNameInHierarchy): self - { - return new self( - (string) $method->getDocComment(), - true, - self::extractAnnotationsFromReflector($method), - $method->getStartLine(), - $method->getEndLine(), - $method->getFileName(), - $method->getName(), - $classNameInHierarchy - ); - } - - /** - * Note: we do not preserve an instance of the reflection object, since it cannot be safely (de-)serialized. - * - * @param array> $symbolAnnotations - * - * @psalm-param class-string $className - */ - private function __construct(string $docComment, bool $isMethod, array $symbolAnnotations, int $startLine, int $endLine, string $fileName, string $name, string $className) - { - $this->docComment = $docComment; - $this->isMethod = $isMethod; - $this->symbolAnnotations = $symbolAnnotations; - $this->startLine = $startLine; - $this->endLine = $endLine; - $this->fileName = $fileName; - $this->name = $name; - $this->className = $className; - } - - /** - * @psalm-return array{ - * __OFFSET: array&array{__FILE: string}, - * setting?: array, - * extension_versions?: array - * }&array< - * string, - * string|array{version: string, operator: string}|array{constraint: string}|array - * > - * - * @throws Warning if the requirements version constraint is not well-formed - */ - public function requirements(): array - { - if ($this->parsedRequirements !== null) { - return $this->parsedRequirements; - } - - $offset = $this->startLine; - $requires = []; - $recordedSettings = []; - $extensionVersions = []; - $recordedOffsets = [ - '__FILE' => realpath($this->fileName), - ]; - - // Trim docblock markers, split it into lines and rewind offset to start of docblock - $lines = preg_replace(['#^/\*{2}#', '#\*/$#'], '', preg_split('/\r\n|\r|\n/', $this->docComment)); - $offset -= count($lines); - - foreach ($lines as $line) { - if (preg_match(self::REGEX_REQUIRES_OS, $line, $matches)) { - $requires[$matches['name']] = $matches['value']; - $recordedOffsets[$matches['name']] = $offset; - } - - if (preg_match(self::REGEX_REQUIRES_VERSION, $line, $matches)) { - $requires[$matches['name']] = [ - 'version' => $matches['version'], - 'operator' => $matches['operator'], - ]; - $recordedOffsets[$matches['name']] = $offset; - } - - if (preg_match(self::REGEX_REQUIRES_VERSION_CONSTRAINT, $line, $matches)) { - if (!empty($requires[$matches['name']])) { - $offset++; - - continue; - } - - try { - $versionConstraintParser = new VersionConstraintParser; - - $requires[$matches['name'] . '_constraint'] = [ - 'constraint' => $versionConstraintParser->parse(trim($matches['constraint'])), - ]; - $recordedOffsets[$matches['name'] . '_constraint'] = $offset; - } catch (\PharIo\Version\Exception $e) { - throw new Warning($e->getMessage(), $e->getCode(), $e); - } - } - - if (preg_match(self::REGEX_REQUIRES_SETTING, $line, $matches)) { - $recordedSettings[$matches['setting']] = $matches['value']; - $recordedOffsets['__SETTING_' . $matches['setting']] = $offset; - } - - if (preg_match(self::REGEX_REQUIRES, $line, $matches)) { - $name = $matches['name'] . 's'; - - if (!isset($requires[$name])) { - $requires[$name] = []; - } - - $requires[$name][] = $matches['value']; - $recordedOffsets[$matches['name'] . '_' . $matches['value']] = $offset; - - if ($name === 'extensions' && !empty($matches['version'])) { - $extensionVersions[$matches['value']] = [ - 'version' => $matches['version'], - 'operator' => $matches['operator'], - ]; - } - } - - $offset++; - } - - return $this->parsedRequirements = array_merge( - $requires, - ['__OFFSET' => $recordedOffsets], - array_filter([ - 'setting' => $recordedSettings, - 'extension_versions' => $extensionVersions, - ]) - ); - } - - /** - * Returns the provided data for a method. - * - * @throws Exception - */ - public function getProvidedData(): ?array - { - /** @noinspection SuspiciousBinaryOperationInspection */ - $data = $this->getDataFromDataProviderAnnotation($this->docComment) ?? $this->getDataFromTestWithAnnotation($this->docComment); - - if ($data === null) { - return null; - } - - if ($data === []) { - throw new SkippedTestError; - } - - foreach ($data as $key => $value) { - if (!is_array($value)) { - throw new InvalidDataSetException( - sprintf( - 'Data set %s is invalid.', - is_int($key) ? '#' . $key : '"' . $key . '"' - ) - ); - } - } - - return $data; - } - - /** - * @psalm-return array - */ - public function getInlineAnnotations(): array - { - $code = file($this->fileName); - $lineNumber = $this->startLine; - $startLine = $this->startLine - 1; - $endLine = $this->endLine - 1; - $codeLines = array_slice($code, $startLine, $endLine - $startLine + 1); - $annotations = []; - - foreach ($codeLines as $line) { - if (preg_match('#/\*\*?\s*@(?P[A-Za-z_-]+)(?:[ \t]+(?P.*?))?[ \t]*\r?\*/$#m', $line, $matches)) { - $annotations[strtolower($matches['name'])] = [ - 'line' => $lineNumber, - 'value' => $matches['value'], - ]; - } - - $lineNumber++; - } - - return $annotations; - } - - public function symbolAnnotations(): array - { - return $this->symbolAnnotations; - } - - public function isHookToBeExecutedBeforeClass(): bool - { - return $this->isMethod && - false !== strpos($this->docComment, '@beforeClass'); - } - - public function isHookToBeExecutedAfterClass(): bool - { - return $this->isMethod && - false !== strpos($this->docComment, '@afterClass'); - } - - public function isToBeExecutedBeforeTest(): bool - { - return 1 === preg_match('/@before\b/', $this->docComment); - } - - public function isToBeExecutedAfterTest(): bool - { - return 1 === preg_match('/@after\b/', $this->docComment); - } - - public function isToBeExecutedAsPreCondition(): bool - { - return 1 === preg_match('/@preCondition\b/', $this->docComment); - } - - public function isToBeExecutedAsPostCondition(): bool - { - return 1 === preg_match('/@postCondition\b/', $this->docComment); - } - - private function getDataFromDataProviderAnnotation(string $docComment): ?array - { - $methodName = null; - $className = $this->className; - - if ($this->isMethod) { - $methodName = $this->name; - } - - if (!preg_match_all(self::REGEX_DATA_PROVIDER, $docComment, $matches)) { - return null; - } - - $result = []; - - foreach ($matches[1] as $match) { - $dataProviderMethodNameNamespace = explode('\\', $match); - $leaf = explode('::', array_pop($dataProviderMethodNameNamespace)); - $dataProviderMethodName = array_pop($leaf); - - if (empty($dataProviderMethodNameNamespace)) { - $dataProviderMethodNameNamespace = ''; - } else { - $dataProviderMethodNameNamespace = implode('\\', $dataProviderMethodNameNamespace) . '\\'; - } - - if (empty($leaf)) { - $dataProviderClassName = $className; - } else { - /** @psalm-var class-string $dataProviderClassName */ - $dataProviderClassName = $dataProviderMethodNameNamespace . array_pop($leaf); - } - - try { - $dataProviderClass = new ReflectionClass($dataProviderClassName); - - $dataProviderMethod = $dataProviderClass->getMethod( - $dataProviderMethodName - ); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - $e->getCode(), - $e - ); - // @codeCoverageIgnoreEnd - } - - if ($dataProviderMethod->isStatic()) { - $object = null; - } else { - $object = $dataProviderClass->newInstance(); - } - - if ($dataProviderMethod->getNumberOfParameters() === 0) { - $data = $dataProviderMethod->invoke($object); - } else { - $data = $dataProviderMethod->invoke($object, $methodName); - } - - if ($data instanceof Traversable) { - $origData = $data; - $data = []; - - foreach ($origData as $key => $value) { - if (is_int($key)) { - $data[] = $value; - } elseif (array_key_exists($key, $data)) { - throw new InvalidDataProviderException( - sprintf( - 'The key "%s" has already been defined in the data provider "%s".', - $key, - $match - ) - ); - } else { - $data[$key] = $value; - } - } - } - - if (is_array($data)) { - $result = array_merge($result, $data); - } - } - - return $result; - } - - /** - * @throws Exception - */ - private function getDataFromTestWithAnnotation(string $docComment): ?array - { - $docComment = $this->cleanUpMultiLineAnnotation($docComment); - - if (!preg_match(self::REGEX_TEST_WITH, $docComment, $matches, PREG_OFFSET_CAPTURE)) { - return null; - } - - $offset = strlen($matches[0][0]) + $matches[0][1]; - $annotationContent = substr($docComment, $offset); - $data = []; - - foreach (explode("\n", $annotationContent) as $candidateRow) { - $candidateRow = trim($candidateRow); - - if ($candidateRow[0] !== '[') { - break; - } - - $dataSet = json_decode($candidateRow, true); - - if (json_last_error() !== JSON_ERROR_NONE) { - throw new Exception( - 'The data set for the @testWith annotation cannot be parsed: ' . json_last_error_msg() - ); - } - - $data[] = $dataSet; - } - - if (!$data) { - throw new Exception('The data set for the @testWith annotation cannot be parsed.'); - } - - return $data; - } - - private function cleanUpMultiLineAnnotation(string $docComment): string - { - //removing initial ' * ' for docComment - $docComment = str_replace("\r\n", "\n", $docComment); - $docComment = preg_replace('/' . '\n' . '\s*' . '\*' . '\s?' . '/', "\n", $docComment); - $docComment = (string) substr($docComment, 0, -1); - - return rtrim($docComment, "\n"); - } - - /** @return array> */ - private static function parseDocBlock(string $docBlock): array - { - // Strip away the docblock header and footer to ease parsing of one line annotations - $docBlock = (string) substr($docBlock, 3, -2); - $annotations = []; - - if (preg_match_all('/@(?P[A-Za-z_-]+)(?:[ \t]+(?P.*?))?[ \t]*\r?$/m', $docBlock, $matches)) { - $numMatches = count($matches[0]); - - for ($i = 0; $i < $numMatches; $i++) { - $annotations[$matches['name'][$i]][] = (string) $matches['value'][$i]; - } - } - - return $annotations; - } - - /** @param ReflectionClass|ReflectionFunctionAbstract $reflector */ - private static function extractAnnotationsFromReflector(Reflector $reflector): array - { - $annotations = []; - - if ($reflector instanceof ReflectionClass) { - $annotations = array_merge( - $annotations, - ...array_map( - static function (ReflectionClass $trait): array - { - return self::parseDocBlock((string) $trait->getDocComment()); - }, - array_values($reflector->getTraits()) - ) - ); - } - - return array_merge( - $annotations, - self::parseDocBlock((string) $reflector->getDocComment()) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Annotation/Registry.php b/vendor/phpunit/phpunit/src/Util/Annotation/Registry.php deleted file mode 100644 index 8ee6c839..00000000 --- a/vendor/phpunit/phpunit/src/Util/Annotation/Registry.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 PHPUnit\Util\Annotation; - -use function array_key_exists; -use PHPUnit\Util\Exception; -use ReflectionClass; -use ReflectionException; -use ReflectionMethod; - -/** - * Reflection information, and therefore DocBlock information, is static within - * a single PHP process. It is therefore okay to use a Singleton registry here. - * - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Registry -{ - /** @var null|self */ - private static $instance; - - /** @var array indexed by class name */ - private $classDocBlocks = []; - - /** @var array> indexed by class name and method name */ - private $methodDocBlocks = []; - - public static function getInstance(): self - { - return self::$instance ?? self::$instance = new self; - } - - private function __construct() - { - } - - /** - * @throws Exception - * - * @psalm-param class-string $class - */ - public function forClassName(string $class): DocBlock - { - if (array_key_exists($class, $this->classDocBlocks)) { - return $this->classDocBlocks[$class]; - } - - try { - $reflection = new ReflectionClass($class); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - return $this->classDocBlocks[$class] = DocBlock::ofClass($reflection); - } - - /** - * @throws Exception - * - * @psalm-param class-string $classInHierarchy - */ - public function forMethod(string $classInHierarchy, string $method): DocBlock - { - if (isset($this->methodDocBlocks[$classInHierarchy][$method])) { - return $this->methodDocBlocks[$classInHierarchy][$method]; - } - - try { - $reflection = new ReflectionMethod($classInHierarchy, $method); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - return $this->methodDocBlocks[$classInHierarchy][$method] = DocBlock::ofMethod($reflection, $classInHierarchy); - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Blacklist.php b/vendor/phpunit/phpunit/src/Util/Blacklist.php deleted file mode 100644 index 3b416e14..00000000 --- a/vendor/phpunit/phpunit/src/Util/Blacklist.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -/** - * @deprecated Use ExcludeList instead - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class Blacklist -{ - public static function addDirectory(string $directory): void - { - ExcludeList::addDirectory($directory); - } - - /** - * @throws Exception - * - * @return string[] - */ - public function getBlacklistedDirectories(): array - { - return (new ExcludeList)->getExcludedDirectories(); - } - - /** - * @throws Exception - */ - public function isBlacklisted(string $file): bool - { - return (new ExcludeList)->isExcluded($file); - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Cloner.php b/vendor/phpunit/phpunit/src/Util/Cloner.php deleted file mode 100644 index 38bd59ff..00000000 --- a/vendor/phpunit/phpunit/src/Util/Cloner.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Cloner -{ - /** - * @psalm-template OriginalType - * - * @psalm-param OriginalType $original - * - * @psalm-return OriginalType - */ - public static function clone(object $original): object - { - try { - return clone $original; - } catch (Throwable $t) { - return $original; - } - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Color.php b/vendor/phpunit/phpunit/src/Util/Color.php deleted file mode 100644 index b96eb474..00000000 --- a/vendor/phpunit/phpunit/src/Util/Color.php +++ /dev/null @@ -1,159 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use const DIRECTORY_SEPARATOR; -use function array_keys; -use function array_map; -use function array_values; -use function count; -use function explode; -use function implode; -use function min; -use function preg_replace; -use function preg_replace_callback; -use function sprintf; -use function strtr; -use function trim; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Color -{ - /** - * @var array - */ - private const WHITESPACE_MAP = [ - ' ' => '·', - "\t" => '⇥', - ]; - - /** - * @var array - */ - private const WHITESPACE_EOL_MAP = [ - ' ' => '·', - "\t" => '⇥', - "\n" => '↵', - "\r" => '⟵', - ]; - - /** - * @var array - */ - private static $ansiCodes = [ - 'reset' => '0', - 'bold' => '1', - 'dim' => '2', - 'dim-reset' => '22', - 'underlined' => '4', - 'fg-default' => '39', - 'fg-black' => '30', - 'fg-red' => '31', - 'fg-green' => '32', - 'fg-yellow' => '33', - 'fg-blue' => '34', - 'fg-magenta' => '35', - 'fg-cyan' => '36', - 'fg-white' => '37', - 'bg-default' => '49', - 'bg-black' => '40', - 'bg-red' => '41', - 'bg-green' => '42', - 'bg-yellow' => '43', - 'bg-blue' => '44', - 'bg-magenta' => '45', - 'bg-cyan' => '46', - 'bg-white' => '47', - ]; - - public static function colorize(string $color, string $buffer): string - { - if (trim($buffer) === '') { - return $buffer; - } - - $codes = array_map('\trim', explode(',', $color)); - $styles = []; - - foreach ($codes as $code) { - if (isset(self::$ansiCodes[$code])) { - $styles[] = self::$ansiCodes[$code] ?? ''; - } - } - - if (empty($styles)) { - return $buffer; - } - - return self::optimizeColor(sprintf("\x1b[%sm", implode(';', $styles)) . $buffer . "\x1b[0m"); - } - - public static function colorizePath(string $path, ?string $prevPath = null, bool $colorizeFilename = false): string - { - if ($prevPath === null) { - $prevPath = ''; - } - - $path = explode(DIRECTORY_SEPARATOR, $path); - $prevPath = explode(DIRECTORY_SEPARATOR, $prevPath); - - for ($i = 0; $i < min(count($path), count($prevPath)); $i++) { - if ($path[$i] == $prevPath[$i]) { - $path[$i] = self::dim($path[$i]); - } - } - - if ($colorizeFilename) { - $last = count($path) - 1; - $path[$last] = preg_replace_callback( - '/([\-_\.]+|phpt$)/', - static function ($matches) - { - return self::dim($matches[0]); - }, - $path[$last] - ); - } - - return self::optimizeColor(implode(self::dim(DIRECTORY_SEPARATOR), $path)); - } - - public static function dim(string $buffer): string - { - if (trim($buffer) === '') { - return $buffer; - } - - return "\e[2m{$buffer}\e[22m"; - } - - public static function visualizeWhitespace(string $buffer, bool $visualizeEOL = false): string - { - $replaceMap = $visualizeEOL ? self::WHITESPACE_EOL_MAP : self::WHITESPACE_MAP; - - return preg_replace_callback('/\s+/', static function ($matches) use ($replaceMap) - { - return self::dim(strtr($matches[0], $replaceMap)); - }, $buffer); - } - - private static function optimizeColor(string $buffer): string - { - $patterns = [ - "/\e\\[22m\e\\[2m/" => '', - "/\e\\[([^m]*)m\e\\[([1-9][0-9;]*)m/" => "\e[$1;$2m", - "/(\e\\[[^m]*m)+(\e\\[0m)/" => '$2', - ]; - - return preg_replace(array_keys($patterns), array_values($patterns), $buffer); - } -} diff --git a/vendor/phpunit/phpunit/src/Util/ErrorHandler.php b/vendor/phpunit/phpunit/src/Util/ErrorHandler.php deleted file mode 100644 index f8566347..00000000 --- a/vendor/phpunit/phpunit/src/Util/ErrorHandler.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 PHPUnit\Util; - -use const E_DEPRECATED; -use const E_NOTICE; -use const E_STRICT; -use const E_USER_DEPRECATED; -use const E_USER_NOTICE; -use const E_USER_WARNING; -use const E_WARNING; -use function error_reporting; -use function restore_error_handler; -use function set_error_handler; -use PHPUnit\Framework\Error\Deprecated; -use PHPUnit\Framework\Error\Error; -use PHPUnit\Framework\Error\Notice; -use PHPUnit\Framework\Error\Warning; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ErrorHandler -{ - /** - * @var bool - */ - private $convertDeprecationsToExceptions; - - /** - * @var bool - */ - private $convertErrorsToExceptions; - - /** - * @var bool - */ - private $convertNoticesToExceptions; - - /** - * @var bool - */ - private $convertWarningsToExceptions; - - /** - * @var bool - */ - private $registered = false; - - public static function invokeIgnoringWarnings(callable $callable) - { - set_error_handler( - static function ($errorNumber, $errorString) - { - if ($errorNumber === E_WARNING) { - return; - } - - return false; - } - ); - - $result = $callable(); - - restore_error_handler(); - - return $result; - } - - public function __construct(bool $convertDeprecationsToExceptions, bool $convertErrorsToExceptions, bool $convertNoticesToExceptions, bool $convertWarningsToExceptions) - { - $this->convertDeprecationsToExceptions = $convertDeprecationsToExceptions; - $this->convertErrorsToExceptions = $convertErrorsToExceptions; - $this->convertNoticesToExceptions = $convertNoticesToExceptions; - $this->convertWarningsToExceptions = $convertWarningsToExceptions; - } - - public function __invoke(int $errorNumber, string $errorString, string $errorFile, int $errorLine): bool - { - /* - * Do not raise an exception when the error suppression operator (@) was used. - * - * @see https://github.com/sebastianbergmann/phpunit/issues/3739 - */ - if (!($errorNumber & error_reporting())) { - return false; - } - - switch ($errorNumber) { - case E_NOTICE: - case E_USER_NOTICE: - case E_STRICT: - if (!$this->convertNoticesToExceptions) { - return false; - } - - throw new Notice($errorString, $errorNumber, $errorFile, $errorLine); - - case E_WARNING: - case E_USER_WARNING: - if (!$this->convertWarningsToExceptions) { - return false; - } - - throw new Warning($errorString, $errorNumber, $errorFile, $errorLine); - - case E_DEPRECATED: - case E_USER_DEPRECATED: - if (!$this->convertDeprecationsToExceptions) { - return false; - } - - throw new Deprecated($errorString, $errorNumber, $errorFile, $errorLine); - - default: - if (!$this->convertErrorsToExceptions) { - return false; - } - - throw new Error($errorString, $errorNumber, $errorFile, $errorLine); - } - } - - public function register(): void - { - if ($this->registered) { - return; - } - - $oldErrorHandler = set_error_handler($this); - - if ($oldErrorHandler !== null) { - restore_error_handler(); - - return; - } - - $this->registered = true; - } - - public function unregister(): void - { - if (!$this->registered) { - return; - } - - restore_error_handler(); - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Exception.php b/vendor/phpunit/phpunit/src/Util/Exception.php deleted file mode 100644 index 6bcb3d14..00000000 --- a/vendor/phpunit/phpunit/src/Util/Exception.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use RuntimeException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Exception extends RuntimeException implements \PHPUnit\Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/Util/ExcludeList.php b/vendor/phpunit/phpunit/src/Util/ExcludeList.php deleted file mode 100644 index 91a5a66b..00000000 --- a/vendor/phpunit/phpunit/src/Util/ExcludeList.php +++ /dev/null @@ -1,253 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use const DIRECTORY_SEPARATOR; -use function class_exists; -use function defined; -use function dirname; -use function is_dir; -use function realpath; -use function sprintf; -use function strpos; -use function sys_get_temp_dir; -use Composer\Autoload\ClassLoader; -use DeepCopy\DeepCopy; -use Doctrine\Instantiator\Instantiator; -use PharIo\Manifest\Manifest; -use PharIo\Version\Version as PharIoVersion; -use phpDocumentor\Reflection\DocBlock; -use phpDocumentor\Reflection\Project; -use phpDocumentor\Reflection\Type; -use PhpParser\Parser; -use PHPUnit\Framework\TestCase; -use Prophecy\Prophet; -use ReflectionClass; -use SebastianBergmann\CliParser\Parser as CliParser; -use SebastianBergmann\CodeCoverage\CodeCoverage; -use SebastianBergmann\CodeUnit\CodeUnit; -use SebastianBergmann\CodeUnitReverseLookup\Wizard; -use SebastianBergmann\Comparator\Comparator; -use SebastianBergmann\Complexity\Calculator; -use SebastianBergmann\Diff\Diff; -use SebastianBergmann\Environment\Runtime; -use SebastianBergmann\Exporter\Exporter; -use SebastianBergmann\FileIterator\Facade as FileIteratorFacade; -use SebastianBergmann\GlobalState\Snapshot; -use SebastianBergmann\Invoker\Invoker; -use SebastianBergmann\LinesOfCode\Counter; -use SebastianBergmann\ObjectEnumerator\Enumerator; -use SebastianBergmann\RecursionContext\Context; -use SebastianBergmann\ResourceOperations\ResourceOperations; -use SebastianBergmann\Template\Template; -use SebastianBergmann\Timer\Timer; -use SebastianBergmann\Type\TypeName; -use SebastianBergmann\Version; -use TheSeer\Tokenizer\Tokenizer; -use Webmozart\Assert\Assert; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class ExcludeList -{ - /** - * @var array - */ - private const EXCLUDED_CLASS_NAMES = [ - // composer - ClassLoader::class => 1, - - // doctrine/instantiator - Instantiator::class => 1, - - // myclabs/deepcopy - DeepCopy::class => 1, - - // nikic/php-parser - Parser::class => 1, - - // phar-io/manifest - Manifest::class => 1, - - // phar-io/version - PharIoVersion::class => 1, - - // phpdocumentor/reflection-common - Project::class => 1, - - // phpdocumentor/reflection-docblock - DocBlock::class => 1, - - // phpdocumentor/type-resolver - Type::class => 1, - - // phpspec/prophecy - Prophet::class => 1, - - // phpunit/phpunit - TestCase::class => 2, - - // phpunit/php-code-coverage - CodeCoverage::class => 1, - - // phpunit/php-file-iterator - FileIteratorFacade::class => 1, - - // phpunit/php-invoker - Invoker::class => 1, - - // phpunit/php-text-template - Template::class => 1, - - // phpunit/php-timer - Timer::class => 1, - - // sebastian/cli-parser - CliParser::class => 1, - - // sebastian/code-unit - CodeUnit::class => 1, - - // sebastian/code-unit-reverse-lookup - Wizard::class => 1, - - // sebastian/comparator - Comparator::class => 1, - - // sebastian/complexity - Calculator::class => 1, - - // sebastian/diff - Diff::class => 1, - - // sebastian/environment - Runtime::class => 1, - - // sebastian/exporter - Exporter::class => 1, - - // sebastian/global-state - Snapshot::class => 1, - - // sebastian/lines-of-code - Counter::class => 1, - - // sebastian/object-enumerator - Enumerator::class => 1, - - // sebastian/recursion-context - Context::class => 1, - - // sebastian/resource-operations - ResourceOperations::class => 1, - - // sebastian/type - TypeName::class => 1, - - // sebastian/version - Version::class => 1, - - // theseer/tokenizer - Tokenizer::class => 1, - - // webmozart/assert - Assert::class => 1, - ]; - - /** - * @var string[] - */ - private static $directories = []; - - /** - * @var bool - */ - private static $initialized = false; - - public static function addDirectory(string $directory): void - { - if (!is_dir($directory)) { - throw new Exception( - sprintf( - '"%s" is not a directory', - $directory - ) - ); - } - - self::$directories[] = realpath($directory); - } - - /** - * @throws Exception - * - * @return string[] - */ - public function getExcludedDirectories(): array - { - $this->initialize(); - - return self::$directories; - } - - /** - * @throws Exception - */ - public function isExcluded(string $file): bool - { - if (defined('PHPUNIT_TESTSUITE')) { - return false; - } - - $this->initialize(); - - foreach (self::$directories as $directory) { - if (strpos($file, $directory) === 0) { - return true; - } - } - - return false; - } - - /** - * @throws Exception - */ - private function initialize(): void - { - if (self::$initialized) { - return; - } - - foreach (self::EXCLUDED_CLASS_NAMES as $className => $parent) { - if (!class_exists($className)) { - continue; - } - - $directory = (new ReflectionClass($className))->getFileName(); - - for ($i = 0; $i < $parent; $i++) { - $directory = dirname($directory); - } - - self::$directories[] = $directory; - } - - // Hide process isolation workaround on Windows. - if (DIRECTORY_SEPARATOR === '\\') { - // tempnam() prefix is limited to first 3 chars. - // @see https://php.net/manual/en/function.tempnam.php - self::$directories[] = sys_get_temp_dir() . '\\PHP'; - } - - self::$initialized = true; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/FileLoader.php b/vendor/phpunit/phpunit/src/Util/FileLoader.php deleted file mode 100644 index 8abdc91c..00000000 --- a/vendor/phpunit/phpunit/src/Util/FileLoader.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 PHPUnit\Util; - -use const DIRECTORY_SEPARATOR; -use function array_diff; -use function array_keys; -use function fopen; -use function get_defined_vars; -use function sprintf; -use function stream_resolve_include_path; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class FileLoader -{ - /** - * Checks if a PHP sourcecode file is readable. The sourcecode file is loaded through the load() method. - * - * As a fallback, PHP looks in the directory of the file executing the stream_resolve_include_path function. - * We do not want to load the Test.php file here, so skip it if it found that. - * PHP prioritizes the include_path setting, so if the current directory is in there, it will first look in the - * current working directory. - * - * @throws Exception - */ - public static function checkAndLoad(string $filename): string - { - $includePathFilename = stream_resolve_include_path($filename); - - $localFile = __DIR__ . DIRECTORY_SEPARATOR . $filename; - - if (!$includePathFilename || - $includePathFilename === $localFile || - !self::isReadable($includePathFilename)) { - throw new Exception( - sprintf('Cannot open file "%s".' . "\n", $filename) - ); - } - - self::load($includePathFilename); - - return $includePathFilename; - } - - /** - * Loads a PHP sourcefile. - */ - public static function load(string $filename): void - { - $oldVariableNames = array_keys(get_defined_vars()); - - /** - * @noinspection PhpIncludeInspection - * - * @psalm-suppress UnresolvableInclude - */ - include_once $filename; - - $newVariables = get_defined_vars(); - - foreach (array_diff(array_keys($newVariables), $oldVariableNames) as $variableName) { - if ($variableName !== 'oldVariableNames') { - $GLOBALS[$variableName] = $newVariables[$variableName]; - } - } - } - - /** - * @see https://github.com/sebastianbergmann/phpunit/pull/2751 - */ - private static function isReadable(string $filename): bool - { - return @fopen($filename, 'r') !== false; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Filesystem.php b/vendor/phpunit/phpunit/src/Util/Filesystem.php deleted file mode 100644 index 35b2690b..00000000 --- a/vendor/phpunit/phpunit/src/Util/Filesystem.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use const DIRECTORY_SEPARATOR; -use function is_dir; -use function mkdir; -use function str_replace; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Filesystem -{ - /** - * Maps class names to source file names. - * - * - PEAR CS: Foo_Bar_Baz -> Foo/Bar/Baz.php - * - Namespace: Foo\Bar\Baz -> Foo/Bar/Baz.php - */ - public static function classNameToFilename(string $className): string - { - return str_replace( - ['_', '\\'], - DIRECTORY_SEPARATOR, - $className - ) . '.php'; - } - - public static function createDirectory(string $directory): bool - { - return !(!is_dir($directory) && !@mkdir($directory, 0777, true) && !is_dir($directory)); - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Filter.php b/vendor/phpunit/phpunit/src/Util/Filter.php deleted file mode 100644 index 42563937..00000000 --- a/vendor/phpunit/phpunit/src/Util/Filter.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 PHPUnit\Util; - -use function array_unshift; -use function defined; -use function in_array; -use function is_file; -use function realpath; -use function sprintf; -use function strpos; -use PHPUnit\Framework\Exception; -use PHPUnit\Framework\SyntheticError; -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Filter -{ - /** - * @throws Exception - */ - public static function getFilteredStacktrace(Throwable $t): string - { - $filteredStacktrace = ''; - - if ($t instanceof SyntheticError) { - $eTrace = $t->getSyntheticTrace(); - $eFile = $t->getSyntheticFile(); - $eLine = $t->getSyntheticLine(); - } elseif ($t instanceof Exception) { - $eTrace = $t->getSerializableTrace(); - $eFile = $t->getFile(); - $eLine = $t->getLine(); - } else { - if ($t->getPrevious()) { - $t = $t->getPrevious(); - } - - $eTrace = $t->getTrace(); - $eFile = $t->getFile(); - $eLine = $t->getLine(); - } - - if (!self::frameExists($eTrace, $eFile, $eLine)) { - array_unshift( - $eTrace, - ['file' => $eFile, 'line' => $eLine] - ); - } - - $prefix = defined('__PHPUNIT_PHAR_ROOT__') ? __PHPUNIT_PHAR_ROOT__ : false; - $excludeList = new ExcludeList; - - foreach ($eTrace as $frame) { - if (self::shouldPrintFrame($frame, $prefix, $excludeList)) { - $filteredStacktrace .= sprintf( - "%s:%s\n", - $frame['file'], - $frame['line'] ?? '?' - ); - } - } - - return $filteredStacktrace; - } - - private static function shouldPrintFrame(array $frame, $prefix, ExcludeList $excludeList): bool - { - if (!isset($frame['file'])) { - return false; - } - - $file = $frame['file']; - $fileIsNotPrefixed = $prefix === false || strpos($file, $prefix) !== 0; - - // @see https://github.com/sebastianbergmann/phpunit/issues/4033 - if (isset($GLOBALS['_SERVER']['SCRIPT_NAME'])) { - $script = realpath($GLOBALS['_SERVER']['SCRIPT_NAME']); - } else { - $script = ''; - } - - return is_file($file) && - self::fileIsExcluded($file, $excludeList) && - $fileIsNotPrefixed && - $file !== $script; - } - - private static function fileIsExcluded(string $file, ExcludeList $excludeList): bool - { - return (empty($GLOBALS['__PHPUNIT_ISOLATION_EXCLUDE_LIST']) || - !in_array($file, $GLOBALS['__PHPUNIT_ISOLATION_EXCLUDE_LIST'], true)) && - !$excludeList->isExcluded($file); - } - - private static function frameExists(array $trace, string $file, int $line): bool - { - foreach ($trace as $frame) { - if (isset($frame['file'], $frame['line']) && $frame['file'] === $file && $frame['line'] === $line) { - return true; - } - } - - return false; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/GlobalState.php b/vendor/phpunit/phpunit/src/Util/GlobalState.php deleted file mode 100644 index cc5c2228..00000000 --- a/vendor/phpunit/phpunit/src/Util/GlobalState.php +++ /dev/null @@ -1,203 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use function array_keys; -use function array_reverse; -use function array_shift; -use function defined; -use function get_defined_constants; -use function get_included_files; -use function in_array; -use function ini_get_all; -use function is_array; -use function is_file; -use function is_scalar; -use function preg_match; -use function serialize; -use function sprintf; -use function strpos; -use function strtr; -use function substr; -use function var_export; -use Closure; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class GlobalState -{ - /** - * @var string[] - */ - private const SUPER_GLOBAL_ARRAYS = [ - '_ENV', - '_POST', - '_GET', - '_COOKIE', - '_SERVER', - '_FILES', - '_REQUEST', - ]; - - /** - * @throws Exception - */ - public static function getIncludedFilesAsString(): string - { - return self::processIncludedFilesAsString(get_included_files()); - } - - /** - * @param string[] $files - * - * @throws Exception - */ - public static function processIncludedFilesAsString(array $files): string - { - $excludeList = new ExcludeList; - $prefix = false; - $result = ''; - - if (defined('__PHPUNIT_PHAR__')) { - $prefix = 'phar://' . __PHPUNIT_PHAR__ . '/'; - } - - // Do not process bootstrap script - array_shift($files); - - // If bootstrap script was a Composer bin proxy, skip the second entry as well - if (substr(strtr($files[0], '\\', '/'), -24) === '/phpunit/phpunit/phpunit') { - array_shift($files); - } - - foreach (array_reverse($files) as $file) { - if (!empty($GLOBALS['__PHPUNIT_ISOLATION_EXCLUDE_LIST']) && - in_array($file, $GLOBALS['__PHPUNIT_ISOLATION_EXCLUDE_LIST'], true)) { - continue; - } - - if ($prefix !== false && strpos($file, $prefix) === 0) { - continue; - } - - // Skip virtual file system protocols - if (preg_match('/^(vfs|phpvfs[a-z0-9]+):/', $file)) { - continue; - } - - if (!$excludeList->isExcluded($file) && is_file($file)) { - $result = 'require_once \'' . $file . "';\n" . $result; - } - } - - return $result; - } - - public static function getIniSettingsAsString(): string - { - $result = ''; - - foreach (ini_get_all(null, false) as $key => $value) { - $result .= sprintf( - '@ini_set(%s, %s);' . "\n", - self::exportVariable($key), - self::exportVariable((string) $value) - ); - } - - return $result; - } - - public static function getConstantsAsString(): string - { - $constants = get_defined_constants(true); - $result = ''; - - if (isset($constants['user'])) { - foreach ($constants['user'] as $name => $value) { - $result .= sprintf( - 'if (!defined(\'%s\')) define(\'%s\', %s);' . "\n", - $name, - $name, - self::exportVariable($value) - ); - } - } - - return $result; - } - - public static function getGlobalsAsString(): string - { - $result = ''; - - foreach (self::SUPER_GLOBAL_ARRAYS as $superGlobalArray) { - if (isset($GLOBALS[$superGlobalArray]) && is_array($GLOBALS[$superGlobalArray])) { - foreach (array_keys($GLOBALS[$superGlobalArray]) as $key) { - if ($GLOBALS[$superGlobalArray][$key] instanceof Closure) { - continue; - } - - $result .= sprintf( - '$GLOBALS[\'%s\'][\'%s\'] = %s;' . "\n", - $superGlobalArray, - $key, - self::exportVariable($GLOBALS[$superGlobalArray][$key]) - ); - } - } - } - - $excludeList = self::SUPER_GLOBAL_ARRAYS; - $excludeList[] = 'GLOBALS'; - - foreach (array_keys($GLOBALS) as $key) { - if (!$GLOBALS[$key] instanceof Closure && !in_array($key, $excludeList, true)) { - $result .= sprintf( - '$GLOBALS[\'%s\'] = %s;' . "\n", - $key, - self::exportVariable($GLOBALS[$key]) - ); - } - } - - return $result; - } - - private static function exportVariable($variable): string - { - if (is_scalar($variable) || $variable === null || - (is_array($variable) && self::arrayOnlyContainsScalars($variable))) { - return var_export($variable, true); - } - - return 'unserialize(' . var_export(serialize($variable), true) . ')'; - } - - private static function arrayOnlyContainsScalars(array $array): bool - { - $result = true; - - foreach ($array as $element) { - if (is_array($element)) { - $result = self::arrayOnlyContainsScalars($element); - } elseif (!is_scalar($element) && $element !== null) { - $result = false; - } - - if (!$result) { - break; - } - } - - return $result; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/InvalidDataSetException.php b/vendor/phpunit/phpunit/src/Util/InvalidDataSetException.php deleted file mode 100644 index 3493d113..00000000 --- a/vendor/phpunit/phpunit/src/Util/InvalidDataSetException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use RuntimeException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class InvalidDataSetException extends RuntimeException implements \PHPUnit\Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/Util/Json.php b/vendor/phpunit/phpunit/src/Util/Json.php deleted file mode 100644 index 752c1fd6..00000000 --- a/vendor/phpunit/phpunit/src/Util/Json.php +++ /dev/null @@ -1,98 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use const JSON_PRETTY_PRINT; -use const JSON_UNESCAPED_SLASHES; -use const JSON_UNESCAPED_UNICODE; -use function count; -use function is_array; -use function is_object; -use function json_decode; -use function json_encode; -use function json_last_error; -use function ksort; -use PHPUnit\Framework\Exception; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Json -{ - /** - * Prettify json string. - * - * @throws \PHPUnit\Framework\Exception - */ - public static function prettify(string $json): string - { - $decodedJson = json_decode($json, false); - - if (json_last_error()) { - throw new Exception( - 'Cannot prettify invalid json' - ); - } - - return json_encode($decodedJson, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); - } - - /** - * To allow comparison of JSON strings, first process them into a consistent - * format so that they can be compared as strings. - * - * @return array ($error, $canonicalized_json) The $error parameter is used - * to indicate an error decoding the json. This is used to avoid ambiguity - * with JSON strings consisting entirely of 'null' or 'false'. - */ - public static function canonicalize(string $json): array - { - $decodedJson = json_decode($json); - - if (json_last_error()) { - return [true, null]; - } - - self::recursiveSort($decodedJson); - - $reencodedJson = json_encode($decodedJson); - - return [false, $reencodedJson]; - } - - /** - * JSON object keys are unordered while PHP array keys are ordered. - * - * Sort all array keys to ensure both the expected and actual values have - * their keys in the same order. - */ - private static function recursiveSort(&$json): void - { - if (!is_array($json)) { - // If the object is not empty, change it to an associative array - // so we can sort the keys (and we will still re-encode it - // correctly, since PHP encodes associative arrays as JSON objects.) - // But EMPTY objects MUST remain empty objects. (Otherwise we will - // re-encode it as a JSON array rather than a JSON object.) - // See #2919. - if (is_object($json) && count((array) $json) > 0) { - $json = (array) $json; - } else { - return; - } - } - - ksort($json); - - foreach ($json as $key => &$value) { - self::recursiveSort($value); - } - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Log/JUnit.php b/vendor/phpunit/phpunit/src/Util/Log/JUnit.php deleted file mode 100644 index 3ceb5e84..00000000 --- a/vendor/phpunit/phpunit/src/Util/Log/JUnit.php +++ /dev/null @@ -1,424 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\Log; - -use function class_exists; -use function get_class; -use function method_exists; -use function sprintf; -use function str_replace; -use function trim; -use DOMDocument; -use DOMElement; -use PHPUnit\Framework\AssertionFailedError; -use PHPUnit\Framework\ExceptionWrapper; -use PHPUnit\Framework\SelfDescribing; -use PHPUnit\Framework\Test; -use PHPUnit\Framework\TestFailure; -use PHPUnit\Framework\TestListener; -use PHPUnit\Framework\TestSuite; -use PHPUnit\Framework\Warning; -use PHPUnit\Util\Exception; -use PHPUnit\Util\Filter; -use PHPUnit\Util\Printer; -use PHPUnit\Util\Xml; -use ReflectionClass; -use ReflectionException; -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class JUnit extends Printer implements TestListener -{ - /** - * @var DOMDocument - */ - private $document; - - /** - * @var DOMElement - */ - private $root; - - /** - * @var bool - */ - private $reportRiskyTests = false; - - /** - * @var DOMElement[] - */ - private $testSuites = []; - - /** - * @var int[] - */ - private $testSuiteTests = [0]; - - /** - * @var int[] - */ - private $testSuiteAssertions = [0]; - - /** - * @var int[] - */ - private $testSuiteErrors = [0]; - - /** - * @var int[] - */ - private $testSuiteWarnings = [0]; - - /** - * @var int[] - */ - private $testSuiteFailures = [0]; - - /** - * @var int[] - */ - private $testSuiteSkipped = [0]; - - /** - * @var int[] - */ - private $testSuiteTimes = [0]; - - /** - * @var int - */ - private $testSuiteLevel = 0; - - /** - * @var DOMElement - */ - private $currentTestCase; - - /** - * @param null|mixed $out - */ - public function __construct($out = null, bool $reportRiskyTests = false) - { - $this->document = new DOMDocument('1.0', 'UTF-8'); - $this->document->formatOutput = true; - - $this->root = $this->document->createElement('testsuites'); - $this->document->appendChild($this->root); - - parent::__construct($out); - - $this->reportRiskyTests = $reportRiskyTests; - } - - /** - * Flush buffer and close output. - */ - public function flush(): void - { - $this->write($this->getXML()); - - parent::flush(); - } - - /** - * An error occurred. - */ - public function addError(Test $test, Throwable $t, float $time): void - { - $this->doAddFault($test, $t, 'error'); - $this->testSuiteErrors[$this->testSuiteLevel]++; - } - - /** - * A warning occurred. - */ - public function addWarning(Test $test, Warning $e, float $time): void - { - $this->doAddFault($test, $e, 'warning'); - $this->testSuiteWarnings[$this->testSuiteLevel]++; - } - - /** - * A failure occurred. - */ - public function addFailure(Test $test, AssertionFailedError $e, float $time): void - { - $this->doAddFault($test, $e, 'failure'); - $this->testSuiteFailures[$this->testSuiteLevel]++; - } - - /** - * Incomplete test. - */ - public function addIncompleteTest(Test $test, Throwable $t, float $time): void - { - $this->doAddSkipped(); - } - - /** - * Risky test. - */ - public function addRiskyTest(Test $test, Throwable $t, float $time): void - { - if (!$this->reportRiskyTests) { - return; - } - - $this->doAddFault($test, $t, 'error'); - $this->testSuiteErrors[$this->testSuiteLevel]++; - } - - /** - * Skipped test. - */ - public function addSkippedTest(Test $test, Throwable $t, float $time): void - { - $this->doAddSkipped(); - } - - /** - * A testsuite started. - */ - public function startTestSuite(TestSuite $suite): void - { - $testSuite = $this->document->createElement('testsuite'); - $testSuite->setAttribute('name', $suite->getName()); - - if (class_exists($suite->getName(), false)) { - try { - $class = new ReflectionClass($suite->getName()); - - $testSuite->setAttribute('file', $class->getFileName()); - } catch (ReflectionException $e) { - } - } - - if ($this->testSuiteLevel > 0) { - $this->testSuites[$this->testSuiteLevel]->appendChild($testSuite); - } else { - $this->root->appendChild($testSuite); - } - - $this->testSuiteLevel++; - $this->testSuites[$this->testSuiteLevel] = $testSuite; - $this->testSuiteTests[$this->testSuiteLevel] = 0; - $this->testSuiteAssertions[$this->testSuiteLevel] = 0; - $this->testSuiteErrors[$this->testSuiteLevel] = 0; - $this->testSuiteWarnings[$this->testSuiteLevel] = 0; - $this->testSuiteFailures[$this->testSuiteLevel] = 0; - $this->testSuiteSkipped[$this->testSuiteLevel] = 0; - $this->testSuiteTimes[$this->testSuiteLevel] = 0; - } - - /** - * A testsuite ended. - */ - public function endTestSuite(TestSuite $suite): void - { - $this->testSuites[$this->testSuiteLevel]->setAttribute( - 'tests', - (string) $this->testSuiteTests[$this->testSuiteLevel] - ); - - $this->testSuites[$this->testSuiteLevel]->setAttribute( - 'assertions', - (string) $this->testSuiteAssertions[$this->testSuiteLevel] - ); - - $this->testSuites[$this->testSuiteLevel]->setAttribute( - 'errors', - (string) $this->testSuiteErrors[$this->testSuiteLevel] - ); - - $this->testSuites[$this->testSuiteLevel]->setAttribute( - 'warnings', - (string) $this->testSuiteWarnings[$this->testSuiteLevel] - ); - - $this->testSuites[$this->testSuiteLevel]->setAttribute( - 'failures', - (string) $this->testSuiteFailures[$this->testSuiteLevel] - ); - - $this->testSuites[$this->testSuiteLevel]->setAttribute( - 'skipped', - (string) $this->testSuiteSkipped[$this->testSuiteLevel] - ); - - $this->testSuites[$this->testSuiteLevel]->setAttribute( - 'time', - sprintf('%F', $this->testSuiteTimes[$this->testSuiteLevel]) - ); - - if ($this->testSuiteLevel > 1) { - $this->testSuiteTests[$this->testSuiteLevel - 1] += $this->testSuiteTests[$this->testSuiteLevel]; - $this->testSuiteAssertions[$this->testSuiteLevel - 1] += $this->testSuiteAssertions[$this->testSuiteLevel]; - $this->testSuiteErrors[$this->testSuiteLevel - 1] += $this->testSuiteErrors[$this->testSuiteLevel]; - $this->testSuiteWarnings[$this->testSuiteLevel - 1] += $this->testSuiteWarnings[$this->testSuiteLevel]; - $this->testSuiteFailures[$this->testSuiteLevel - 1] += $this->testSuiteFailures[$this->testSuiteLevel]; - $this->testSuiteSkipped[$this->testSuiteLevel - 1] += $this->testSuiteSkipped[$this->testSuiteLevel]; - $this->testSuiteTimes[$this->testSuiteLevel - 1] += $this->testSuiteTimes[$this->testSuiteLevel]; - } - - $this->testSuiteLevel--; - } - - /** - * A test started. - */ - public function startTest(Test $test): void - { - $usesDataprovider = false; - - if (method_exists($test, 'usesDataProvider')) { - $usesDataprovider = $test->usesDataProvider(); - } - - $testCase = $this->document->createElement('testcase'); - $testCase->setAttribute('name', $test->getName()); - - try { - $class = new ReflectionClass($test); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - $methodName = $test->getName(!$usesDataprovider); - - if ($class->hasMethod($methodName)) { - try { - $method = $class->getMethod($methodName); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - $testCase->setAttribute('class', $class->getName()); - $testCase->setAttribute('classname', str_replace('\\', '.', $class->getName())); - $testCase->setAttribute('file', $class->getFileName()); - $testCase->setAttribute('line', (string) $method->getStartLine()); - } - - $this->currentTestCase = $testCase; - } - - /** - * A test ended. - */ - public function endTest(Test $test, float $time): void - { - $numAssertions = 0; - - if (method_exists($test, 'getNumAssertions')) { - $numAssertions = $test->getNumAssertions(); - } - - $this->testSuiteAssertions[$this->testSuiteLevel] += $numAssertions; - - $this->currentTestCase->setAttribute( - 'assertions', - (string) $numAssertions - ); - - $this->currentTestCase->setAttribute( - 'time', - sprintf('%F', $time) - ); - - $this->testSuites[$this->testSuiteLevel]->appendChild( - $this->currentTestCase - ); - - $this->testSuiteTests[$this->testSuiteLevel]++; - $this->testSuiteTimes[$this->testSuiteLevel] += $time; - - $testOutput = ''; - - if (method_exists($test, 'hasOutput') && method_exists($test, 'getActualOutput')) { - $testOutput = $test->hasOutput() ? $test->getActualOutput() : ''; - } - - if (!empty($testOutput)) { - $systemOut = $this->document->createElement( - 'system-out', - Xml::prepareString($testOutput) - ); - - $this->currentTestCase->appendChild($systemOut); - } - - $this->currentTestCase = null; - } - - /** - * Returns the XML as a string. - */ - public function getXML(): string - { - return $this->document->saveXML(); - } - - private function doAddFault(Test $test, Throwable $t, string $type): void - { - if ($this->currentTestCase === null) { - return; - } - - if ($test instanceof SelfDescribing) { - $buffer = $test->toString() . "\n"; - } else { - $buffer = ''; - } - - $buffer .= trim( - TestFailure::exceptionToString($t) . "\n" . - Filter::getFilteredStacktrace($t) - ); - - $fault = $this->document->createElement( - $type, - Xml::prepareString($buffer) - ); - - if ($t instanceof ExceptionWrapper) { - $fault->setAttribute('type', $t->getClassName()); - } else { - $fault->setAttribute('type', get_class($t)); - } - - $this->currentTestCase->appendChild($fault); - } - - private function doAddSkipped(): void - { - if ($this->currentTestCase === null) { - return; - } - - $skipped = $this->document->createElement('skipped'); - - $this->currentTestCase->appendChild($skipped); - - $this->testSuiteSkipped[$this->testSuiteLevel]++; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Log/TeamCity.php b/vendor/phpunit/phpunit/src/Util/Log/TeamCity.php deleted file mode 100644 index 0efe3438..00000000 --- a/vendor/phpunit/phpunit/src/Util/Log/TeamCity.php +++ /dev/null @@ -1,383 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\Log; - -use function class_exists; -use function count; -use function explode; -use function get_class; -use function getmypid; -use function ini_get; -use function is_bool; -use function is_scalar; -use function method_exists; -use function print_r; -use function round; -use function str_replace; -use function stripos; -use PHPUnit\Framework\AssertionFailedError; -use PHPUnit\Framework\ExceptionWrapper; -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\Test; -use PHPUnit\Framework\TestCase; -use PHPUnit\Framework\TestFailure; -use PHPUnit\Framework\TestResult; -use PHPUnit\Framework\TestSuite; -use PHPUnit\Framework\Warning; -use PHPUnit\TextUI\DefaultResultPrinter; -use PHPUnit\Util\Exception; -use PHPUnit\Util\Filter; -use ReflectionClass; -use ReflectionException; -use SebastianBergmann\Comparator\ComparisonFailure; -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TeamCity extends DefaultResultPrinter -{ - /** - * @var bool - */ - private $isSummaryTestCountPrinted = false; - - /** - * @var string - */ - private $startedTestName; - - /** - * @var false|int - */ - private $flowId; - - public function printResult(TestResult $result): void - { - $this->printHeader($result); - $this->printFooter($result); - } - - /** - * An error occurred. - */ - public function addError(Test $test, Throwable $t, float $time): void - { - $this->printEvent( - 'testFailed', - [ - 'name' => $test->getName(), - 'message' => self::getMessage($t), - 'details' => self::getDetails($t), - 'duration' => self::toMilliseconds($time), - ] - ); - } - - /** - * A warning occurred. - */ - public function addWarning(Test $test, Warning $e, float $time): void - { - $this->write(self::getMessage($e) . PHP_EOL); - } - - /** - * A failure occurred. - */ - public function addFailure(Test $test, AssertionFailedError $e, float $time): void - { - $parameters = [ - 'name' => $test->getName(), - 'message' => self::getMessage($e), - 'details' => self::getDetails($e), - 'duration' => self::toMilliseconds($time), - ]; - - if ($e instanceof ExpectationFailedException) { - $comparisonFailure = $e->getComparisonFailure(); - - if ($comparisonFailure instanceof ComparisonFailure) { - $expectedString = $comparisonFailure->getExpectedAsString(); - - if ($expectedString === null || empty($expectedString)) { - $expectedString = self::getPrimitiveValueAsString($comparisonFailure->getExpected()); - } - - $actualString = $comparisonFailure->getActualAsString(); - - if ($actualString === null || empty($actualString)) { - $actualString = self::getPrimitiveValueAsString($comparisonFailure->getActual()); - } - - if ($actualString !== null && $expectedString !== null) { - $parameters['type'] = 'comparisonFailure'; - $parameters['actual'] = $actualString; - $parameters['expected'] = $expectedString; - } - } - } - - $this->printEvent('testFailed', $parameters); - } - - /** - * Incomplete test. - */ - public function addIncompleteTest(Test $test, Throwable $t, float $time): void - { - $this->printIgnoredTest($test->getName(), $t, $time); - } - - /** - * Risky test. - */ - public function addRiskyTest(Test $test, Throwable $t, float $time): void - { - $this->addError($test, $t, $time); - } - - /** - * Skipped test. - */ - public function addSkippedTest(Test $test, Throwable $t, float $time): void - { - $testName = $test->getName(); - - if ($this->startedTestName !== $testName) { - $this->startTest($test); - $this->printIgnoredTest($testName, $t, $time); - $this->endTest($test, $time); - } else { - $this->printIgnoredTest($testName, $t, $time); - } - } - - public function printIgnoredTest(string $testName, Throwable $t, float $time): void - { - $this->printEvent( - 'testIgnored', - [ - 'name' => $testName, - 'message' => self::getMessage($t), - 'details' => self::getDetails($t), - 'duration' => self::toMilliseconds($time), - ] - ); - } - - /** - * A testsuite started. - */ - public function startTestSuite(TestSuite $suite): void - { - if (stripos(ini_get('disable_functions'), 'getmypid') === false) { - $this->flowId = getmypid(); - } else { - $this->flowId = false; - } - - if (!$this->isSummaryTestCountPrinted) { - $this->isSummaryTestCountPrinted = true; - - $this->printEvent( - 'testCount', - ['count' => count($suite)] - ); - } - - $suiteName = $suite->getName(); - - if (empty($suiteName)) { - return; - } - - $parameters = ['name' => $suiteName]; - - if (class_exists($suiteName, false)) { - $fileName = self::getFileName($suiteName); - $parameters['locationHint'] = "php_qn://{$fileName}::\\{$suiteName}"; - } else { - $split = explode('::', $suiteName); - - if (count($split) === 2 && class_exists($split[0]) && method_exists($split[0], $split[1])) { - $fileName = self::getFileName($split[0]); - $parameters['locationHint'] = "php_qn://{$fileName}::\\{$suiteName}"; - $parameters['name'] = $split[1]; - } - } - - $this->printEvent('testSuiteStarted', $parameters); - } - - /** - * A testsuite ended. - */ - public function endTestSuite(TestSuite $suite): void - { - $suiteName = $suite->getName(); - - if (empty($suiteName)) { - return; - } - - $parameters = ['name' => $suiteName]; - - if (!class_exists($suiteName, false)) { - $split = explode('::', $suiteName); - - if (count($split) === 2 && class_exists($split[0]) && method_exists($split[0], $split[1])) { - $parameters['name'] = $split[1]; - } - } - - $this->printEvent('testSuiteFinished', $parameters); - } - - /** - * A test started. - */ - public function startTest(Test $test): void - { - $testName = $test->getName(); - $this->startedTestName = $testName; - $params = ['name' => $testName]; - - if ($test instanceof TestCase) { - $className = get_class($test); - $fileName = self::getFileName($className); - $params['locationHint'] = "php_qn://{$fileName}::\\{$className}::{$testName}"; - } - - $this->printEvent('testStarted', $params); - } - - /** - * A test ended. - */ - public function endTest(Test $test, float $time): void - { - parent::endTest($test, $time); - - $this->printEvent( - 'testFinished', - [ - 'name' => $test->getName(), - 'duration' => self::toMilliseconds($time), - ] - ); - } - - protected function writeProgress(string $progress): void - { - } - - private function printEvent(string $eventName, array $params = []): void - { - $this->write("\n##teamcity[{$eventName}"); - - if ($this->flowId) { - $params['flowId'] = $this->flowId; - } - - foreach ($params as $key => $value) { - $escapedValue = self::escapeValue((string) $value); - $this->write(" {$key}='{$escapedValue}'"); - } - - $this->write("]\n"); - } - - private static function getMessage(Throwable $t): string - { - $message = ''; - - if ($t instanceof ExceptionWrapper) { - if ($t->getClassName() !== '') { - $message .= $t->getClassName(); - } - - if ($message !== '' && $t->getMessage() !== '') { - $message .= ' : '; - } - } - - return $message . $t->getMessage(); - } - - private static function getDetails(Throwable $t): string - { - $stackTrace = Filter::getFilteredStacktrace($t); - $previous = $t instanceof ExceptionWrapper ? $t->getPreviousWrapped() : $t->getPrevious(); - - while ($previous) { - $stackTrace .= "\nCaused by\n" . - TestFailure::exceptionToString($previous) . "\n" . - Filter::getFilteredStacktrace($previous); - - $previous = $previous instanceof ExceptionWrapper ? - $previous->getPreviousWrapped() : $previous->getPrevious(); - } - - return ' ' . str_replace("\n", "\n ", $stackTrace); - } - - private static function getPrimitiveValueAsString($value): ?string - { - if ($value === null) { - return 'null'; - } - - if (is_bool($value)) { - return $value ? 'true' : 'false'; - } - - if (is_scalar($value)) { - return print_r($value, true); - } - - return null; - } - - private static function escapeValue(string $text): string - { - return str_replace( - ['|', "'", "\n", "\r", ']', '['], - ['||', "|'", '|n', '|r', '|]', '|['], - $text - ); - } - - /** - * @param string $className - */ - private static function getFileName($className): string - { - try { - return (new ReflectionClass($className))->getFileName(); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } - - /** - * @param float $time microseconds - */ - private static function toMilliseconds(float $time): int - { - return (int) round($time * 1000); - } -} diff --git a/vendor/phpunit/phpunit/src/Util/PHP/AbstractPhpProcess.php b/vendor/phpunit/phpunit/src/Util/PHP/AbstractPhpProcess.php deleted file mode 100644 index 8706ae1a..00000000 --- a/vendor/phpunit/phpunit/src/Util/PHP/AbstractPhpProcess.php +++ /dev/null @@ -1,416 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\PHP; - -use const DIRECTORY_SEPARATOR; -use const PHP_SAPI; -use function array_keys; -use function array_merge; -use function assert; -use function escapeshellarg; -use function ini_get_all; -use function restore_error_handler; -use function set_error_handler; -use function sprintf; -use function str_replace; -use function strpos; -use function strrpos; -use function substr; -use function trim; -use function unserialize; -use __PHP_Incomplete_Class; -use ErrorException; -use PHPUnit\Framework\AssertionFailedError; -use PHPUnit\Framework\Exception; -use PHPUnit\Framework\SyntheticError; -use PHPUnit\Framework\Test; -use PHPUnit\Framework\TestCase; -use PHPUnit\Framework\TestFailure; -use PHPUnit\Framework\TestResult; -use SebastianBergmann\Environment\Runtime; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -abstract class AbstractPhpProcess -{ - /** - * @var Runtime - */ - protected $runtime; - - /** - * @var bool - */ - protected $stderrRedirection = false; - - /** - * @var string - */ - protected $stdin = ''; - - /** - * @var string - */ - protected $args = ''; - - /** - * @var array - */ - protected $env = []; - - /** - * @var int - */ - protected $timeout = 0; - - public static function factory(): self - { - if (DIRECTORY_SEPARATOR === '\\') { - return new WindowsPhpProcess; - } - - return new DefaultPhpProcess; - } - - public function __construct() - { - $this->runtime = new Runtime; - } - - /** - * Defines if should use STDERR redirection or not. - * - * Then $stderrRedirection is TRUE, STDERR is redirected to STDOUT. - */ - public function setUseStderrRedirection(bool $stderrRedirection): void - { - $this->stderrRedirection = $stderrRedirection; - } - - /** - * Returns TRUE if uses STDERR redirection or FALSE if not. - */ - public function useStderrRedirection(): bool - { - return $this->stderrRedirection; - } - - /** - * Sets the input string to be sent via STDIN. - */ - public function setStdin(string $stdin): void - { - $this->stdin = $stdin; - } - - /** - * Returns the input string to be sent via STDIN. - */ - public function getStdin(): string - { - return $this->stdin; - } - - /** - * Sets the string of arguments to pass to the php job. - */ - public function setArgs(string $args): void - { - $this->args = $args; - } - - /** - * Returns the string of arguments to pass to the php job. - */ - public function getArgs(): string - { - return $this->args; - } - - /** - * Sets the array of environment variables to start the child process with. - * - * @param array $env - */ - public function setEnv(array $env): void - { - $this->env = $env; - } - - /** - * Returns the array of environment variables to start the child process with. - */ - public function getEnv(): array - { - return $this->env; - } - - /** - * Sets the amount of seconds to wait before timing out. - */ - public function setTimeout(int $timeout): void - { - $this->timeout = $timeout; - } - - /** - * Returns the amount of seconds to wait before timing out. - */ - public function getTimeout(): int - { - return $this->timeout; - } - - /** - * Runs a single test in a separate PHP process. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function runTestJob(string $job, Test $test, TestResult $result): void - { - $result->startTest($test); - - $_result = $this->runJob($job); - - $this->processChildResult( - $test, - $result, - $_result['stdout'], - $_result['stderr'] - ); - } - - /** - * Returns the command based into the configurations. - */ - public function getCommand(array $settings, string $file = null): string - { - $command = $this->runtime->getBinary(); - - if ($this->runtime->hasPCOV()) { - $settings = array_merge( - $settings, - $this->runtime->getCurrentSettings( - array_keys(ini_get_all('pcov')) - ) - ); - } elseif ($this->runtime->hasXdebug()) { - $settings = array_merge( - $settings, - $this->runtime->getCurrentSettings( - array_keys(ini_get_all('xdebug')) - ) - ); - } - - $command .= $this->settingsToParameters($settings); - - if (PHP_SAPI === 'phpdbg') { - $command .= ' -qrr'; - - if (!$file) { - $command .= 's='; - } - } - - if ($file) { - $command .= ' ' . escapeshellarg($file); - } - - if ($this->args) { - if (!$file) { - $command .= ' --'; - } - $command .= ' ' . $this->args; - } - - if ($this->stderrRedirection) { - $command .= ' 2>&1'; - } - - return $command; - } - - /** - * Runs a single job (PHP code) using a separate PHP process. - */ - abstract public function runJob(string $job, array $settings = []): array; - - protected function settingsToParameters(array $settings): string - { - $buffer = ''; - - foreach ($settings as $setting) { - $buffer .= ' -d ' . escapeshellarg($setting); - } - - return $buffer; - } - - /** - * Processes the TestResult object from an isolated process. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - private function processChildResult(Test $test, TestResult $result, string $stdout, string $stderr): void - { - $time = 0; - - if (!empty($stderr)) { - $result->addError( - $test, - new Exception(trim($stderr)), - $time - ); - } else { - set_error_handler( - /** - * @throws ErrorException - */ - static function ($errno, $errstr, $errfile, $errline): void - { - throw new ErrorException($errstr, $errno, $errno, $errfile, $errline); - } - ); - - try { - if (strpos($stdout, "#!/usr/bin/env php\n") === 0) { - $stdout = substr($stdout, 19); - } - - $childResult = unserialize(str_replace("#!/usr/bin/env php\n", '', $stdout)); - restore_error_handler(); - - if ($childResult === false) { - $result->addFailure( - $test, - new AssertionFailedError('Test was run in child process and ended unexpectedly'), - $time - ); - } - } catch (ErrorException $e) { - restore_error_handler(); - $childResult = false; - - $result->addError( - $test, - new Exception(trim($stdout), 0, $e), - $time - ); - } - - if ($childResult !== false) { - if (!empty($childResult['output'])) { - $output = $childResult['output']; - } - - /* @var TestCase $test */ - - $test->setResult($childResult['testResult']); - $test->addToAssertionCount($childResult['numAssertions']); - - $childResult = $childResult['result']; - assert($childResult instanceof TestResult); - - if ($result->getCollectCodeCoverageInformation()) { - $result->getCodeCoverage()->merge( - $childResult->getCodeCoverage() - ); - } - - $time = $childResult->time(); - $notImplemented = $childResult->notImplemented(); - $risky = $childResult->risky(); - $skipped = $childResult->skipped(); - $errors = $childResult->errors(); - $warnings = $childResult->warnings(); - $failures = $childResult->failures(); - - if (!empty($notImplemented)) { - $result->addError( - $test, - $this->getException($notImplemented[0]), - $time - ); - } elseif (!empty($risky)) { - $result->addError( - $test, - $this->getException($risky[0]), - $time - ); - } elseif (!empty($skipped)) { - $result->addError( - $test, - $this->getException($skipped[0]), - $time - ); - } elseif (!empty($errors)) { - $result->addError( - $test, - $this->getException($errors[0]), - $time - ); - } elseif (!empty($warnings)) { - $result->addWarning( - $test, - $this->getException($warnings[0]), - $time - ); - } elseif (!empty($failures)) { - $result->addFailure( - $test, - $this->getException($failures[0]), - $time - ); - } - } - } - - $result->endTest($test, $time); - - if (!empty($output)) { - print $output; - } - } - - /** - * Gets the thrown exception from a PHPUnit\Framework\TestFailure. - * - * @see https://github.com/sebastianbergmann/phpunit/issues/74 - */ - private function getException(TestFailure $error): Exception - { - $exception = $error->thrownException(); - - if ($exception instanceof __PHP_Incomplete_Class) { - $exceptionArray = []; - - foreach ((array) $exception as $key => $value) { - $key = substr($key, strrpos($key, "\0") + 1); - $exceptionArray[$key] = $value; - } - - $exception = new SyntheticError( - sprintf( - '%s: %s', - $exceptionArray['_PHP_Incomplete_Class_Name'], - $exceptionArray['message'] - ), - $exceptionArray['code'], - $exceptionArray['file'], - $exceptionArray['line'], - $exceptionArray['trace'] - ); - } - - return $exception; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/PHP/DefaultPhpProcess.php b/vendor/phpunit/phpunit/src/Util/PHP/DefaultPhpProcess.php deleted file mode 100644 index c4dc1114..00000000 --- a/vendor/phpunit/phpunit/src/Util/PHP/DefaultPhpProcess.php +++ /dev/null @@ -1,236 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\PHP; - -use function array_merge; -use function fclose; -use function file_put_contents; -use function fread; -use function fwrite; -use function is_array; -use function is_resource; -use function proc_close; -use function proc_open; -use function proc_terminate; -use function rewind; -use function sprintf; -use function stream_get_contents; -use function stream_select; -use function sys_get_temp_dir; -use function tempnam; -use function unlink; -use PHPUnit\Framework\Exception; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -class DefaultPhpProcess extends AbstractPhpProcess -{ - /** - * @var string - */ - protected $tempFile; - - /** - * Runs a single job (PHP code) using a separate PHP process. - * - * @throws Exception - */ - public function runJob(string $job, array $settings = []): array - { - if ($this->stdin || $this->useTemporaryFile()) { - if (!($this->tempFile = tempnam(sys_get_temp_dir(), 'PHPUnit')) || - file_put_contents($this->tempFile, $job) === false) { - throw new Exception( - 'Unable to write temporary file' - ); - } - - $job = $this->stdin; - } - - return $this->runProcess($job, $settings); - } - - /** - * Returns an array of file handles to be used in place of pipes. - */ - protected function getHandles(): array - { - return []; - } - - /** - * Handles creating the child process and returning the STDOUT and STDERR. - * - * @throws Exception - */ - protected function runProcess(string $job, array $settings): array - { - $handles = $this->getHandles(); - - $env = null; - - if ($this->env) { - $env = $_SERVER ?? []; - unset($env['argv'], $env['argc']); - $env = array_merge($env, $this->env); - - foreach ($env as $envKey => $envVar) { - if (is_array($envVar)) { - unset($env[$envKey]); - } - } - } - - $pipeSpec = [ - 0 => $handles[0] ?? ['pipe', 'r'], - 1 => $handles[1] ?? ['pipe', 'w'], - 2 => $handles[2] ?? ['pipe', 'w'], - ]; - - $process = proc_open( - $this->getCommand($settings, $this->tempFile), - $pipeSpec, - $pipes, - null, - $env - ); - - if (!is_resource($process)) { - throw new Exception( - 'Unable to spawn worker process' - ); - } - - if ($job) { - $this->process($pipes[0], $job); - } - - fclose($pipes[0]); - - $stderr = $stdout = ''; - - if ($this->timeout) { - unset($pipes[0]); - - while (true) { - $r = $pipes; - $w = null; - $e = null; - - $n = @stream_select($r, $w, $e, $this->timeout); - - if ($n === false) { - break; - } - - if ($n === 0) { - proc_terminate($process, 9); - - throw new Exception( - sprintf( - 'Job execution aborted after %d seconds', - $this->timeout - ) - ); - } - - if ($n > 0) { - foreach ($r as $pipe) { - $pipeOffset = 0; - - foreach ($pipes as $i => $origPipe) { - if ($pipe === $origPipe) { - $pipeOffset = $i; - - break; - } - } - - if (!$pipeOffset) { - break; - } - - $line = fread($pipe, 8192); - - if ($line === '' || $line === false) { - fclose($pipes[$pipeOffset]); - - unset($pipes[$pipeOffset]); - } elseif ($pipeOffset === 1) { - $stdout .= $line; - } else { - $stderr .= $line; - } - } - - if (empty($pipes)) { - break; - } - } - } - } else { - if (isset($pipes[1])) { - $stdout = stream_get_contents($pipes[1]); - - fclose($pipes[1]); - } - - if (isset($pipes[2])) { - $stderr = stream_get_contents($pipes[2]); - - fclose($pipes[2]); - } - } - - if (isset($handles[1])) { - rewind($handles[1]); - - $stdout = stream_get_contents($handles[1]); - - fclose($handles[1]); - } - - if (isset($handles[2])) { - rewind($handles[2]); - - $stderr = stream_get_contents($handles[2]); - - fclose($handles[2]); - } - - proc_close($process); - - $this->cleanup(); - - return ['stdout' => $stdout, 'stderr' => $stderr]; - } - - /** - * @param resource $pipe - */ - protected function process($pipe, string $job): void - { - fwrite($pipe, $job); - } - - protected function cleanup(): void - { - if ($this->tempFile) { - unlink($this->tempFile); - } - } - - protected function useTemporaryFile(): bool - { - return false; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/PHP/Template/PhptTestCase.tpl b/vendor/phpunit/phpunit/src/Util/PHP/Template/PhptTestCase.tpl deleted file mode 100644 index f23a0d1a..00000000 --- a/vendor/phpunit/phpunit/src/Util/PHP/Template/PhptTestCase.tpl +++ /dev/null @@ -1,57 +0,0 @@ -{driverMethod}($filter), - $filter - ); - - if ({codeCoverageCacheDirectory}) { - $coverage->cacheStaticAnalysis({codeCoverageCacheDirectory}); - } - - $coverage->start(__FILE__); -} - -register_shutdown_function( - function() use ($coverage) { - $output = null; - - if ($coverage) { - $output = $coverage->stop(); - } - - file_put_contents('{coverageFile}', serialize($output)); - } -); - -ob_end_clean(); - -require '{job}'; diff --git a/vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseClass.tpl b/vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseClass.tpl deleted file mode 100644 index 95035e50..00000000 --- a/vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseClass.tpl +++ /dev/null @@ -1,119 +0,0 @@ -{driverMethod}($filter), - $filter - ); - - if ({cachesStaticAnalysis}) { - $codeCoverage->cacheStaticAnalysis(unserialize('{codeCoverageCacheDirectory}')); - } - - $result->setCodeCoverage($codeCoverage); - } - - $result->beStrictAboutTestsThatDoNotTestAnything({isStrictAboutTestsThatDoNotTestAnything}); - $result->beStrictAboutOutputDuringTests({isStrictAboutOutputDuringTests}); - $result->enforceTimeLimit({enforcesTimeLimit}); - $result->beStrictAboutTodoAnnotatedTests({isStrictAboutTodoAnnotatedTests}); - $result->beStrictAboutResourceUsageDuringSmallTests({isStrictAboutResourceUsageDuringSmallTests}); - - $test = new {className}('{name}', unserialize('{data}'), '{dataName}'); - $test->setDependencyInput(unserialize('{dependencyInput}')); - $test->setInIsolation(TRUE); - - ob_end_clean(); - $test->run($result); - $output = ''; - if (!$test->hasExpectationOnOutput()) { - $output = $test->getActualOutput(); - } - - ini_set('xdebug.scream', '0'); - @rewind(STDOUT); /* @ as not every STDOUT target stream is rewindable */ - if ($stdout = @stream_get_contents(STDOUT)) { - $output = $stdout . $output; - $streamMetaData = stream_get_meta_data(STDOUT); - if (!empty($streamMetaData['stream_type']) && 'STDIO' === $streamMetaData['stream_type']) { - @ftruncate(STDOUT, 0); - @rewind(STDOUT); - } - } - - print serialize( - [ - 'testResult' => $test->getResult(), - 'numAssertions' => $test->getNumAssertions(), - 'result' => $result, - 'output' => $output - ] - ); -} - -$configurationFilePath = '{configurationFilePath}'; - -if ('' !== $configurationFilePath) { - $configuration = (new Loader)->load($configurationFilePath); - - (new PhpHandler)->handle($configuration->php()); - - unset($configuration); -} - -function __phpunit_error_handler($errno, $errstr, $errfile, $errline) -{ - return true; -} - -set_error_handler('__phpunit_error_handler'); - -{constants} -{included_files} -{globals} - -restore_error_handler(); - -if (isset($GLOBALS['__PHPUNIT_BOOTSTRAP'])) { - require_once $GLOBALS['__PHPUNIT_BOOTSTRAP']; - unset($GLOBALS['__PHPUNIT_BOOTSTRAP']); -} - -__phpunit_run_isolated_test(); diff --git a/vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseMethod.tpl b/vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseMethod.tpl deleted file mode 100644 index da824e72..00000000 --- a/vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseMethod.tpl +++ /dev/null @@ -1,122 +0,0 @@ -{driverMethod}($filter), - $filter - ); - - if ({cachesStaticAnalysis}) { - $codeCoverage->cacheStaticAnalysis(unserialize('{codeCoverageCacheDirectory}')); - } - - $result->setCodeCoverage($codeCoverage); - } - - $result->beStrictAboutTestsThatDoNotTestAnything({isStrictAboutTestsThatDoNotTestAnything}); - $result->beStrictAboutOutputDuringTests({isStrictAboutOutputDuringTests}); - $result->enforceTimeLimit({enforcesTimeLimit}); - $result->beStrictAboutTodoAnnotatedTests({isStrictAboutTodoAnnotatedTests}); - $result->beStrictAboutResourceUsageDuringSmallTests({isStrictAboutResourceUsageDuringSmallTests}); - - $test = new {className}('{methodName}', unserialize('{data}'), '{dataName}'); - \assert($test instanceof TestCase); - - $test->setDependencyInput(unserialize('{dependencyInput}')); - $test->setInIsolation(true); - - ob_end_clean(); - $test->run($result); - $output = ''; - if (!$test->hasExpectationOnOutput()) { - $output = $test->getActualOutput(); - } - - ini_set('xdebug.scream', '0'); - @rewind(STDOUT); /* @ as not every STDOUT target stream is rewindable */ - if ($stdout = @stream_get_contents(STDOUT)) { - $output = $stdout . $output; - $streamMetaData = stream_get_meta_data(STDOUT); - if (!empty($streamMetaData['stream_type']) && 'STDIO' === $streamMetaData['stream_type']) { - @ftruncate(STDOUT, 0); - @rewind(STDOUT); - } - } - - print serialize( - [ - 'testResult' => $test->getResult(), - 'numAssertions' => $test->getNumAssertions(), - 'result' => $result, - 'output' => $output - ] - ); -} - -$configurationFilePath = '{configurationFilePath}'; - -if ('' !== $configurationFilePath) { - $configuration = (new Loader)->load($configurationFilePath); - - (new PhpHandler)->handle($configuration->php()); - - unset($configuration); -} - -function __phpunit_error_handler($errno, $errstr, $errfile, $errline) -{ - return true; -} - -set_error_handler('__phpunit_error_handler'); - -{constants} -{included_files} -{globals} - -restore_error_handler(); - -if (isset($GLOBALS['__PHPUNIT_BOOTSTRAP'])) { - require_once $GLOBALS['__PHPUNIT_BOOTSTRAP']; - unset($GLOBALS['__PHPUNIT_BOOTSTRAP']); -} - -__phpunit_run_isolated_test(); diff --git a/vendor/phpunit/phpunit/src/Util/PHP/WindowsPhpProcess.php b/vendor/phpunit/phpunit/src/Util/PHP/WindowsPhpProcess.php deleted file mode 100644 index 9ef92555..00000000 --- a/vendor/phpunit/phpunit/src/Util/PHP/WindowsPhpProcess.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\PHP; - -use const PHP_MAJOR_VERSION; -use function tmpfile; -use PHPUnit\Framework\Exception; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @see https://bugs.php.net/bug.php?id=51800 - */ -final class WindowsPhpProcess extends DefaultPhpProcess -{ - public function getCommand(array $settings, string $file = null): string - { - if (PHP_MAJOR_VERSION < 8) { - return '"' . parent::getCommand($settings, $file) . '"'; - } - - return parent::getCommand($settings, $file); - } - - /** - * @throws Exception - */ - protected function getHandles(): array - { - if (false === $stdout_handle = tmpfile()) { - throw new Exception( - 'A temporary file could not be created; verify that your TEMP environment variable is writable' - ); - } - - return [ - 1 => $stdout_handle, - ]; - } - - protected function useTemporaryFile(): bool - { - return true; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Printer.php b/vendor/phpunit/phpunit/src/Util/Printer.php deleted file mode 100644 index 77b5745a..00000000 --- a/vendor/phpunit/phpunit/src/Util/Printer.php +++ /dev/null @@ -1,116 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use const ENT_COMPAT; -use const ENT_SUBSTITUTE; -use const PHP_SAPI; -use function assert; -use function count; -use function dirname; -use function explode; -use function fclose; -use function fopen; -use function fsockopen; -use function fwrite; -use function htmlspecialchars; -use function is_resource; -use function is_string; -use function sprintf; -use function str_replace; -use function strncmp; -use function strpos; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -class Printer -{ - /** - * @psalm-var closed-resource|resource - */ - private $stream; - - /** - * @var bool - */ - private $isPhpStream; - - /** - * @param null|resource|string $out - * - * @throws Exception - */ - public function __construct($out = null) - { - if (is_resource($out)) { - $this->stream = $out; - - return; - } - - if (!is_string($out)) { - return; - } - - if (strpos($out, 'socket://') === 0) { - $tmp = explode(':', str_replace('socket://', '', $out)); - - if (count($tmp) !== 2) { - throw new Exception( - sprintf( - '"%s" does not match "socket://hostname:port" format', - $out - ) - ); - } - - $this->stream = fsockopen($tmp[0], (int) $tmp[1]); - - return; - } - - if (strpos($out, 'php://') === false && !Filesystem::createDirectory(dirname($out))) { - throw new Exception( - sprintf( - 'Directory "%s" was not created', - dirname($out) - ) - ); - } - - $this->stream = fopen($out, 'wb'); - $this->isPhpStream = strncmp($out, 'php://', 6) !== 0; - } - - public function write(string $buffer): void - { - if ($this->stream) { - assert(is_resource($this->stream)); - - fwrite($this->stream, $buffer); - } else { - if (PHP_SAPI !== 'cli' && PHP_SAPI !== 'phpdbg') { - $buffer = htmlspecialchars($buffer, ENT_COMPAT | ENT_SUBSTITUTE); - } - - print $buffer; - } - } - - public function flush(): void - { - if ($this->stream && $this->isPhpStream) { - assert(is_resource($this->stream)); - - fclose($this->stream); - } - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Reflection.php b/vendor/phpunit/phpunit/src/Util/Reflection.php deleted file mode 100644 index 3ffc2d5e..00000000 --- a/vendor/phpunit/phpunit/src/Util/Reflection.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 PHPUnit\Util; - -use PHPUnit\Framework\Assert; -use PHPUnit\Framework\TestCase; -use ReflectionClass; -use ReflectionMethod; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Reflection -{ - /** - * @psalm-return list - */ - public function publicMethodsInTestClass(ReflectionClass $class): array - { - return $this->filterMethods($class, ReflectionMethod::IS_PUBLIC); - } - - /** - * @psalm-return list - */ - public function methodsInTestClass(ReflectionClass $class): array - { - return $this->filterMethods($class, null); - } - - /** - * @psalm-return list - */ - private function filterMethods(ReflectionClass $class, ?int $filter): array - { - $methods = []; - - // PHP <7.3.5 throw error when null is passed - // to ReflectionClass::getMethods() when strict_types is enabled. - $classMethods = $filter === null ? $class->getMethods() : $class->getMethods($filter); - - foreach ($classMethods as $method) { - if ($method->getDeclaringClass()->getName() === TestCase::class) { - continue; - } - - if ($method->getDeclaringClass()->getName() === Assert::class) { - continue; - } - - $methods[] = $method; - } - - return $methods; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/RegularExpression.php b/vendor/phpunit/phpunit/src/Util/RegularExpression.php deleted file mode 100644 index db1dae92..00000000 --- a/vendor/phpunit/phpunit/src/Util/RegularExpression.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. - */ -namespace PHPUnit\Util; - -use function preg_match; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class RegularExpression -{ - /** - * @return false|int - */ - public static function safeMatch(string $pattern, string $subject) - { - return ErrorHandler::invokeIgnoringWarnings( - static function () use ($pattern, $subject) - { - return preg_match($pattern, $subject); - } - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Test.php b/vendor/phpunit/phpunit/src/Util/Test.php deleted file mode 100644 index f089f6d4..00000000 --- a/vendor/phpunit/phpunit/src/Util/Test.php +++ /dev/null @@ -1,783 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use const PHP_OS; -use const PHP_VERSION; -use function addcslashes; -use function array_flip; -use function array_key_exists; -use function array_merge; -use function array_unique; -use function array_unshift; -use function class_exists; -use function count; -use function explode; -use function extension_loaded; -use function function_exists; -use function get_class; -use function ini_get; -use function interface_exists; -use function is_array; -use function is_int; -use function method_exists; -use function phpversion; -use function preg_match; -use function preg_replace; -use function sprintf; -use function strncmp; -use function strpos; -use function strtolower; -use function trim; -use function version_compare; -use PHPUnit\Framework\CodeCoverageException; -use PHPUnit\Framework\ExecutionOrderDependency; -use PHPUnit\Framework\InvalidCoversTargetException; -use PHPUnit\Framework\SelfDescribing; -use PHPUnit\Framework\TestCase; -use PHPUnit\Framework\Warning; -use PHPUnit\Runner\Version; -use PHPUnit\Util\Annotation\Registry; -use ReflectionClass; -use ReflectionException; -use ReflectionMethod; -use SebastianBergmann\CodeUnit\CodeUnitCollection; -use SebastianBergmann\CodeUnit\InvalidCodeUnitException; -use SebastianBergmann\CodeUnit\Mapper; -use SebastianBergmann\Environment\OperatingSystem; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Test -{ - /** - * @var int - */ - public const UNKNOWN = -1; - - /** - * @var int - */ - public const SMALL = 0; - - /** - * @var int - */ - public const MEDIUM = 1; - - /** - * @var int - */ - public const LARGE = 2; - - /** - * @var array - */ - private static $hookMethods = []; - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public static function describe(\PHPUnit\Framework\Test $test): array - { - if ($test instanceof TestCase) { - return [get_class($test), $test->getName()]; - } - - if ($test instanceof SelfDescribing) { - return ['', $test->toString()]; - } - - return ['', get_class($test)]; - } - - public static function describeAsString(\PHPUnit\Framework\Test $test): string - { - if ($test instanceof SelfDescribing) { - return $test->toString(); - } - - return get_class($test); - } - - /** - * @throws CodeCoverageException - * - * @return array|bool - * - * @psalm-param class-string $className - */ - public static function getLinesToBeCovered(string $className, string $methodName) - { - $annotations = self::parseTestMethodAnnotations( - $className, - $methodName - ); - - if (!self::shouldCoversAnnotationBeUsed($annotations)) { - return false; - } - - return self::getLinesToBeCoveredOrUsed($className, $methodName, 'covers'); - } - - /** - * Returns lines of code specified with the @uses annotation. - * - * @throws CodeCoverageException - * - * @psalm-param class-string $className - */ - public static function getLinesToBeUsed(string $className, string $methodName): array - { - return self::getLinesToBeCoveredOrUsed($className, $methodName, 'uses'); - } - - public static function requiresCodeCoverageDataCollection(TestCase $test): bool - { - $annotations = self::parseTestMethodAnnotations( - get_class($test), - $test->getName(false) - ); - - // If there is no @covers annotation but a @coversNothing annotation on - // the test method then code coverage data does not need to be collected - if (isset($annotations['method']['coversNothing'])) { - // @see https://github.com/sebastianbergmann/phpunit/issues/4947#issuecomment-1084480950 - // return false; - } - - // If there is at least one @covers annotation then - // code coverage data needs to be collected - if (isset($annotations['method']['covers'])) { - return true; - } - - // If there is no @covers annotation but a @coversNothing annotation - // then code coverage data does not need to be collected - if (isset($annotations['class']['coversNothing'])) { - // @see https://github.com/sebastianbergmann/phpunit/issues/4947#issuecomment-1084480950 - // return false; - } - - // If there is no @coversNothing annotation then - // code coverage data may be collected - return true; - } - - /** - * @throws Exception - * - * @psalm-param class-string $className - */ - public static function getRequirements(string $className, string $methodName): array - { - return self::mergeArraysRecursively( - Registry::getInstance()->forClassName($className)->requirements(), - Registry::getInstance()->forMethod($className, $methodName)->requirements() - ); - } - - /** - * Returns the missing requirements for a test. - * - * @throws Exception - * @throws Warning - * - * @psalm-param class-string $className - */ - public static function getMissingRequirements(string $className, string $methodName): array - { - $required = self::getRequirements($className, $methodName); - $missing = []; - $hint = null; - - if (!empty($required['PHP'])) { - $operator = new VersionComparisonOperator(empty($required['PHP']['operator']) ? '>=' : $required['PHP']['operator']); - - if (!version_compare(PHP_VERSION, $required['PHP']['version'], $operator->asString())) { - $missing[] = sprintf('PHP %s %s is required.', $operator->asString(), $required['PHP']['version']); - $hint = 'PHP'; - } - } elseif (!empty($required['PHP_constraint'])) { - $version = new \PharIo\Version\Version(self::sanitizeVersionNumber(PHP_VERSION)); - - if (!$required['PHP_constraint']['constraint']->complies($version)) { - $missing[] = sprintf( - 'PHP version does not match the required constraint %s.', - $required['PHP_constraint']['constraint']->asString() - ); - - $hint = 'PHP_constraint'; - } - } - - if (!empty($required['PHPUnit'])) { - $phpunitVersion = Version::id(); - - $operator = new VersionComparisonOperator(empty($required['PHPUnit']['operator']) ? '>=' : $required['PHPUnit']['operator']); - - if (!version_compare($phpunitVersion, $required['PHPUnit']['version'], $operator->asString())) { - $missing[] = sprintf('PHPUnit %s %s is required.', $operator->asString(), $required['PHPUnit']['version']); - $hint = $hint ?? 'PHPUnit'; - } - } elseif (!empty($required['PHPUnit_constraint'])) { - $phpunitVersion = new \PharIo\Version\Version(self::sanitizeVersionNumber(Version::id())); - - if (!$required['PHPUnit_constraint']['constraint']->complies($phpunitVersion)) { - $missing[] = sprintf( - 'PHPUnit version does not match the required constraint %s.', - $required['PHPUnit_constraint']['constraint']->asString() - ); - - $hint = $hint ?? 'PHPUnit_constraint'; - } - } - - if (!empty($required['OSFAMILY']) && $required['OSFAMILY'] !== (new OperatingSystem)->getFamily()) { - $missing[] = sprintf('Operating system %s is required.', $required['OSFAMILY']); - $hint = $hint ?? 'OSFAMILY'; - } - - if (!empty($required['OS'])) { - $requiredOsPattern = sprintf('/%s/i', addcslashes($required['OS'], '/')); - - if (!preg_match($requiredOsPattern, PHP_OS)) { - $missing[] = sprintf('Operating system matching %s is required.', $requiredOsPattern); - $hint = $hint ?? 'OS'; - } - } - - if (!empty($required['functions'])) { - foreach ($required['functions'] as $function) { - $pieces = explode('::', $function); - - if (count($pieces) === 2 && class_exists($pieces[0]) && method_exists($pieces[0], $pieces[1])) { - continue; - } - - if (function_exists($function)) { - continue; - } - - $missing[] = sprintf('Function %s is required.', $function); - $hint = $hint ?? 'function_' . $function; - } - } - - if (!empty($required['setting'])) { - foreach ($required['setting'] as $setting => $value) { - if (ini_get($setting) !== $value) { - $missing[] = sprintf('Setting "%s" must be "%s".', $setting, $value); - $hint = $hint ?? '__SETTING_' . $setting; - } - } - } - - if (!empty($required['extensions'])) { - foreach ($required['extensions'] as $extension) { - if (isset($required['extension_versions'][$extension])) { - continue; - } - - if (!extension_loaded($extension)) { - $missing[] = sprintf('Extension %s is required.', $extension); - $hint = $hint ?? 'extension_' . $extension; - } - } - } - - if (!empty($required['extension_versions'])) { - foreach ($required['extension_versions'] as $extension => $req) { - $actualVersion = phpversion($extension); - - $operator = new VersionComparisonOperator(empty($req['operator']) ? '>=' : $req['operator']); - - if ($actualVersion === false || !version_compare($actualVersion, $req['version'], $operator->asString())) { - $missing[] = sprintf('Extension %s %s %s is required.', $extension, $operator->asString(), $req['version']); - $hint = $hint ?? 'extension_' . $extension; - } - } - } - - if ($hint && isset($required['__OFFSET'])) { - array_unshift($missing, '__OFFSET_FILE=' . $required['__OFFSET']['__FILE']); - array_unshift($missing, '__OFFSET_LINE=' . ($required['__OFFSET'][$hint] ?? 1)); - } - - return $missing; - } - - /** - * Returns the provided data for a method. - * - * @throws Exception - * - * @psalm-param class-string $className - */ - public static function getProvidedData(string $className, string $methodName): ?array - { - return Registry::getInstance()->forMethod($className, $methodName)->getProvidedData(); - } - - /** - * @psalm-param class-string $className - */ - public static function parseTestMethodAnnotations(string $className, ?string $methodName = ''): array - { - $registry = Registry::getInstance(); - - if ($methodName !== null) { - try { - return [ - 'method' => $registry->forMethod($className, $methodName)->symbolAnnotations(), - 'class' => $registry->forClassName($className)->symbolAnnotations(), - ]; - } catch (Exception $methodNotFound) { - // ignored - } - } - - return [ - 'method' => null, - 'class' => $registry->forClassName($className)->symbolAnnotations(), - ]; - } - - /** - * @psalm-param class-string $className - */ - public static function getInlineAnnotations(string $className, string $methodName): array - { - return Registry::getInstance()->forMethod($className, $methodName)->getInlineAnnotations(); - } - - /** @psalm-param class-string $className */ - public static function getBackupSettings(string $className, string $methodName): array - { - return [ - 'backupGlobals' => self::getBooleanAnnotationSetting( - $className, - $methodName, - 'backupGlobals' - ), - 'backupStaticAttributes' => self::getBooleanAnnotationSetting( - $className, - $methodName, - 'backupStaticAttributes' - ), - ]; - } - - /** - * @psalm-param class-string $className - * - * @return ExecutionOrderDependency[] - */ - public static function getDependencies(string $className, string $methodName): array - { - $annotations = self::parseTestMethodAnnotations( - $className, - $methodName - ); - - $dependsAnnotations = $annotations['class']['depends'] ?? []; - - if (isset($annotations['method']['depends'])) { - $dependsAnnotations = array_merge( - $dependsAnnotations, - $annotations['method']['depends'] - ); - } - - // Normalize dependency name to className::methodName - $dependencies = []; - - foreach ($dependsAnnotations as $value) { - $dependencies[] = ExecutionOrderDependency::createFromDependsAnnotation($className, $value); - } - - return array_unique($dependencies); - } - - /** @psalm-param class-string $className */ - public static function getGroups(string $className, ?string $methodName = ''): array - { - $annotations = self::parseTestMethodAnnotations( - $className, - $methodName - ); - - $groups = []; - - if (isset($annotations['method']['author'])) { - $groups[] = $annotations['method']['author']; - } elseif (isset($annotations['class']['author'])) { - $groups[] = $annotations['class']['author']; - } - - if (isset($annotations['class']['group'])) { - $groups[] = $annotations['class']['group']; - } - - if (isset($annotations['method']['group'])) { - $groups[] = $annotations['method']['group']; - } - - if (isset($annotations['class']['ticket'])) { - $groups[] = $annotations['class']['ticket']; - } - - if (isset($annotations['method']['ticket'])) { - $groups[] = $annotations['method']['ticket']; - } - - foreach (['method', 'class'] as $element) { - foreach (['small', 'medium', 'large'] as $size) { - if (isset($annotations[$element][$size])) { - $groups[] = [$size]; - - break 2; - } - } - } - - foreach (['method', 'class'] as $element) { - if (isset($annotations[$element]['covers'])) { - foreach ($annotations[$element]['covers'] as $coversTarget) { - $groups[] = ['__phpunit_covers_' . self::canonicalizeName($coversTarget)]; - } - } - - if (isset($annotations[$element]['uses'])) { - foreach ($annotations[$element]['uses'] as $usesTarget) { - $groups[] = ['__phpunit_uses_' . self::canonicalizeName($usesTarget)]; - } - } - } - - return array_unique(array_merge([], ...$groups)); - } - - /** @psalm-param class-string $className */ - public static function getSize(string $className, ?string $methodName): int - { - $groups = array_flip(self::getGroups($className, $methodName)); - - if (isset($groups['large'])) { - return self::LARGE; - } - - if (isset($groups['medium'])) { - return self::MEDIUM; - } - - if (isset($groups['small'])) { - return self::SMALL; - } - - return self::UNKNOWN; - } - - /** @psalm-param class-string $className */ - public static function getProcessIsolationSettings(string $className, string $methodName): bool - { - $annotations = self::parseTestMethodAnnotations( - $className, - $methodName - ); - - return isset($annotations['class']['runTestsInSeparateProcesses']) || isset($annotations['method']['runInSeparateProcess']); - } - - /** @psalm-param class-string $className */ - public static function getClassProcessIsolationSettings(string $className, string $methodName): bool - { - $annotations = self::parseTestMethodAnnotations( - $className, - $methodName - ); - - return isset($annotations['class']['runClassInSeparateProcess']); - } - - /** @psalm-param class-string $className */ - public static function getPreserveGlobalStateSettings(string $className, string $methodName): ?bool - { - return self::getBooleanAnnotationSetting( - $className, - $methodName, - 'preserveGlobalState' - ); - } - - /** @psalm-param class-string $className */ - public static function getHookMethods(string $className): array - { - if (!class_exists($className, false)) { - return self::emptyHookMethodsArray(); - } - - if (!isset(self::$hookMethods[$className])) { - self::$hookMethods[$className] = self::emptyHookMethodsArray(); - - try { - foreach ((new Reflection)->methodsInTestClass(new ReflectionClass($className)) as $method) { - $docBlock = Registry::getInstance()->forMethod($className, $method->getName()); - - if ($method->isStatic()) { - if ($docBlock->isHookToBeExecutedBeforeClass()) { - array_unshift( - self::$hookMethods[$className]['beforeClass'], - $method->getName() - ); - } - - if ($docBlock->isHookToBeExecutedAfterClass()) { - self::$hookMethods[$className]['afterClass'][] = $method->getName(); - } - } - - if ($docBlock->isToBeExecutedBeforeTest()) { - array_unshift( - self::$hookMethods[$className]['before'], - $method->getName() - ); - } - - if ($docBlock->isToBeExecutedAsPreCondition()) { - array_unshift( - self::$hookMethods[$className]['preCondition'], - $method->getName() - ); - } - - if ($docBlock->isToBeExecutedAsPostCondition()) { - self::$hookMethods[$className]['postCondition'][] = $method->getName(); - } - - if ($docBlock->isToBeExecutedAfterTest()) { - self::$hookMethods[$className]['after'][] = $method->getName(); - } - } - } catch (ReflectionException $e) { - } - } - - return self::$hookMethods[$className]; - } - - public static function isTestMethod(ReflectionMethod $method): bool - { - if (!$method->isPublic()) { - return false; - } - - if (strpos($method->getName(), 'test') === 0) { - return true; - } - - return array_key_exists( - 'test', - Registry::getInstance()->forMethod( - $method->getDeclaringClass()->getName(), - $method->getName() - ) - ->symbolAnnotations() - ); - } - - /** - * @throws CodeCoverageException - * - * @psalm-param class-string $className - */ - private static function getLinesToBeCoveredOrUsed(string $className, string $methodName, string $mode): array - { - $annotations = self::parseTestMethodAnnotations( - $className, - $methodName - ); - - $classShortcut = null; - - if (!empty($annotations['class'][$mode . 'DefaultClass'])) { - if (count($annotations['class'][$mode . 'DefaultClass']) > 1) { - throw new CodeCoverageException( - sprintf( - 'More than one @%sClass annotation in class or interface "%s".', - $mode, - $className - ) - ); - } - - $classShortcut = $annotations['class'][$mode . 'DefaultClass'][0]; - } - - $list = $annotations['class'][$mode] ?? []; - - if (isset($annotations['method'][$mode])) { - $list = array_merge($list, $annotations['method'][$mode]); - } - - $codeUnits = CodeUnitCollection::fromArray([]); - $mapper = new Mapper; - - foreach (array_unique($list) as $element) { - if ($classShortcut && strncmp($element, '::', 2) === 0) { - $element = $classShortcut . $element; - } - - $element = preg_replace('/[\s()]+$/', '', $element); - $element = explode(' ', $element); - $element = $element[0]; - - if ($mode === 'covers' && interface_exists($element)) { - throw new InvalidCoversTargetException( - sprintf( - 'Trying to @cover interface "%s".', - $element - ) - ); - } - - try { - $codeUnits = $codeUnits->mergeWith($mapper->stringToCodeUnits($element)); - } catch (InvalidCodeUnitException $e) { - throw new InvalidCoversTargetException( - sprintf( - '"@%s %s" is invalid', - $mode, - $element - ), - $e->getCode(), - $e - ); - } - } - - return $mapper->codeUnitsToSourceLines($codeUnits); - } - - private static function emptyHookMethodsArray(): array - { - return [ - 'beforeClass' => ['setUpBeforeClass'], - 'before' => ['setUp'], - 'preCondition' => ['assertPreConditions'], - 'postCondition' => ['assertPostConditions'], - 'after' => ['tearDown'], - 'afterClass' => ['tearDownAfterClass'], - ]; - } - - /** @psalm-param class-string $className */ - private static function getBooleanAnnotationSetting(string $className, ?string $methodName, string $settingName): ?bool - { - $annotations = self::parseTestMethodAnnotations( - $className, - $methodName - ); - - if (isset($annotations['method'][$settingName])) { - if ($annotations['method'][$settingName][0] === 'enabled') { - return true; - } - - if ($annotations['method'][$settingName][0] === 'disabled') { - return false; - } - } - - if (isset($annotations['class'][$settingName])) { - if ($annotations['class'][$settingName][0] === 'enabled') { - return true; - } - - if ($annotations['class'][$settingName][0] === 'disabled') { - return false; - } - } - - return null; - } - - /** - * Trims any extensions from version string that follows after - * the .[.] format. - */ - private static function sanitizeVersionNumber(string $version) - { - return preg_replace( - '/^(\d+\.\d+(?:.\d+)?).*$/', - '$1', - $version - ); - } - - private static function shouldCoversAnnotationBeUsed(array $annotations): bool - { - if (isset($annotations['method']['coversNothing'])) { - return false; - } - - if (isset($annotations['method']['covers'])) { - return true; - } - - if (isset($annotations['class']['coversNothing'])) { - return false; - } - - return true; - } - - /** - * Merge two arrays together. - * - * If an integer key exists in both arrays and preserveNumericKeys is false, the value - * from the second array will be appended to the first array. If both values are arrays, they - * are merged together, else the value of the second array overwrites the one of the first array. - * - * This implementation is copied from https://github.com/zendframework/zend-stdlib/blob/76b653c5e99b40eccf5966e3122c90615134ae46/src/ArrayUtils.php - * - * Zend Framework (http://framework.zend.com/) - * - * @see http://github.com/zendframework/zf2 for the canonical source repository - * - * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License - */ - private static function mergeArraysRecursively(array $a, array $b): array - { - foreach ($b as $key => $value) { - if (array_key_exists($key, $a)) { - if (is_int($key)) { - $a[] = $value; - } elseif (is_array($value) && is_array($a[$key])) { - $a[$key] = self::mergeArraysRecursively($a[$key], $value); - } else { - $a[$key] = $value; - } - } else { - $a[$key] = $value; - } - } - - return $a; - } - - private static function canonicalizeName(string $name): string - { - return strtolower(trim($name, '\\')); - } -} diff --git a/vendor/phpunit/phpunit/src/Util/TestDox/CliTestDoxPrinter.php b/vendor/phpunit/phpunit/src/Util/TestDox/CliTestDoxPrinter.php deleted file mode 100644 index def16c39..00000000 --- a/vendor/phpunit/phpunit/src/Util/TestDox/CliTestDoxPrinter.php +++ /dev/null @@ -1,381 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\TestDox; - -use const PHP_EOL; -use function array_map; -use function ceil; -use function count; -use function explode; -use function get_class; -use function implode; -use function preg_match; -use function sprintf; -use function strlen; -use function strpos; -use function trim; -use PHPUnit\Framework\Test; -use PHPUnit\Framework\TestCase; -use PHPUnit\Framework\TestResult; -use PHPUnit\Runner\BaseTestRunner; -use PHPUnit\Runner\PhptTestCase; -use PHPUnit\Util\Color; -use SebastianBergmann\Timer\ResourceUsageFormatter; -use SebastianBergmann\Timer\Timer; -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -class CliTestDoxPrinter extends TestDoxPrinter -{ - /** - * The default Testdox left margin for messages is a vertical line. - */ - private const PREFIX_SIMPLE = [ - 'default' => '│', - 'start' => '│', - 'message' => '│', - 'diff' => '│', - 'trace' => '│', - 'last' => '│', - ]; - - /** - * Colored Testdox use box-drawing for a more textured map of the message. - */ - private const PREFIX_DECORATED = [ - 'default' => '│', - 'start' => '┐', - 'message' => '├', - 'diff' => '┊', - 'trace' => '╵', - 'last' => '┴', - ]; - - private const SPINNER_ICONS = [ - " \e[36m◐\e[0m running tests", - " \e[36m◓\e[0m running tests", - " \e[36m◑\e[0m running tests", - " \e[36m◒\e[0m running tests", - ]; - - private const STATUS_STYLES = [ - BaseTestRunner::STATUS_PASSED => [ - 'symbol' => '✔', - 'color' => 'fg-green', - ], - BaseTestRunner::STATUS_ERROR => [ - 'symbol' => '✘', - 'color' => 'fg-yellow', - 'message' => 'bg-yellow,fg-black', - ], - BaseTestRunner::STATUS_FAILURE => [ - 'symbol' => '✘', - 'color' => 'fg-red', - 'message' => 'bg-red,fg-white', - ], - BaseTestRunner::STATUS_SKIPPED => [ - 'symbol' => '↩', - 'color' => 'fg-cyan', - 'message' => 'fg-cyan', - ], - BaseTestRunner::STATUS_RISKY => [ - 'symbol' => '☢', - 'color' => 'fg-yellow', - 'message' => 'fg-yellow', - ], - BaseTestRunner::STATUS_INCOMPLETE => [ - 'symbol' => '∅', - 'color' => 'fg-yellow', - 'message' => 'fg-yellow', - ], - BaseTestRunner::STATUS_WARNING => [ - 'symbol' => '⚠', - 'color' => 'fg-yellow', - 'message' => 'fg-yellow', - ], - BaseTestRunner::STATUS_UNKNOWN => [ - 'symbol' => '?', - 'color' => 'fg-blue', - 'message' => 'fg-white,bg-blue', - ], - ]; - - /** - * @var int[] - */ - private $nonSuccessfulTestResults = []; - - /** - * @var Timer - */ - private $timer; - - /** - * @param null|resource|string $out - * @param int|string $numberOfColumns - * - * @throws \PHPUnit\Framework\Exception - */ - public function __construct($out = null, bool $verbose = false, string $colors = self::COLOR_DEFAULT, bool $debug = false, $numberOfColumns = 80, bool $reverse = false) - { - parent::__construct($out, $verbose, $colors, $debug, $numberOfColumns, $reverse); - - $this->timer = new Timer; - - $this->timer->start(); - } - - public function printResult(TestResult $result): void - { - $this->printHeader($result); - - $this->printNonSuccessfulTestsSummary($result->count()); - - $this->printFooter($result); - } - - protected function printHeader(TestResult $result): void - { - $this->write("\n" . (new ResourceUsageFormatter)->resourceUsage($this->timer->stop()) . "\n\n"); - } - - protected function formatClassName(Test $test): string - { - if ($test instanceof TestCase) { - return $this->prettifier->prettifyTestClass(get_class($test)); - } - - return get_class($test); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - protected function registerTestResult(Test $test, ?Throwable $t, int $status, float $time, bool $verbose): void - { - if ($status !== BaseTestRunner::STATUS_PASSED) { - $this->nonSuccessfulTestResults[] = $this->testIndex; - } - - parent::registerTestResult($test, $t, $status, $time, $verbose); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - protected function formatTestName(Test $test): string - { - if ($test instanceof TestCase) { - return $this->prettifier->prettifyTestCase($test); - } - - return parent::formatTestName($test); - } - - protected function writeTestResult(array $prevResult, array $result): void - { - // spacer line for new suite headers and after verbose messages - if ($prevResult['testName'] !== '' && - (!empty($prevResult['message']) || $prevResult['className'] !== $result['className'])) { - $this->write(PHP_EOL); - } - - // suite header - if ($prevResult['className'] !== $result['className']) { - $this->write($this->colorizeTextBox('underlined', $result['className']) . PHP_EOL); - } - - // test result line - if ($this->colors && $result['className'] === PhptTestCase::class) { - $testName = Color::colorizePath($result['testName'], $prevResult['testName'], true); - } else { - $testName = $result['testMethod']; - } - - $style = self::STATUS_STYLES[$result['status']]; - $line = sprintf( - ' %s %s%s' . PHP_EOL, - $this->colorizeTextBox($style['color'], $style['symbol']), - $testName, - $this->verbose ? ' ' . $this->formatRuntime($result['time'], $style['color']) : '' - ); - - $this->write($line); - - // additional information when verbose - $this->write($result['message']); - } - - protected function formatThrowable(Throwable $t, ?int $status = null): string - { - return trim(\PHPUnit\Framework\TestFailure::exceptionToString($t)); - } - - protected function colorizeMessageAndDiff(string $style, string $buffer): array - { - $lines = $buffer ? array_map('\rtrim', explode(PHP_EOL, $buffer)) : []; - $message = []; - $diff = []; - $insideDiff = false; - - foreach ($lines as $line) { - if ($line === '--- Expected') { - $insideDiff = true; - } - - if (!$insideDiff) { - $message[] = $line; - } else { - if (strpos($line, '-') === 0) { - $line = Color::colorize('fg-red', Color::visualizeWhitespace($line, true)); - } elseif (strpos($line, '+') === 0) { - $line = Color::colorize('fg-green', Color::visualizeWhitespace($line, true)); - } elseif ($line === '@@ @@') { - $line = Color::colorize('fg-cyan', $line); - } - $diff[] = $line; - } - } - $diff = implode(PHP_EOL, $diff); - - if (!empty($message)) { - $message = $this->colorizeTextBox($style, implode(PHP_EOL, $message)); - } - - return [$message, $diff]; - } - - protected function formatStacktrace(Throwable $t): string - { - $trace = \PHPUnit\Util\Filter::getFilteredStacktrace($t); - - if (!$this->colors) { - return $trace; - } - - $lines = []; - $prevPath = ''; - - foreach (explode(PHP_EOL, $trace) as $line) { - if (preg_match('/^(.*):(\d+)$/', $line, $matches)) { - $lines[] = Color::colorizePath($matches[1], $prevPath) . - Color::dim(':') . - Color::colorize('fg-blue', $matches[2]) . - "\n"; - $prevPath = $matches[1]; - } else { - $lines[] = $line; - $prevPath = ''; - } - } - - return implode('', $lines); - } - - protected function formatTestResultMessage(Throwable $t, array $result, ?string $prefix = null): string - { - $message = $this->formatThrowable($t, $result['status']); - $diff = ''; - - if (!($this->verbose || $result['verbose'])) { - return ''; - } - - if ($message && $this->colors) { - $style = self::STATUS_STYLES[$result['status']]['message'] ?? ''; - [$message, $diff] = $this->colorizeMessageAndDiff($style, $message); - } - - if ($prefix === null || !$this->colors) { - $prefix = self::PREFIX_SIMPLE; - } - - if ($this->colors) { - $color = self::STATUS_STYLES[$result['status']]['color'] ?? ''; - $prefix = array_map(static function ($p) use ($color) - { - return Color::colorize($color, $p); - }, self::PREFIX_DECORATED); - } - - $trace = $this->formatStacktrace($t); - $out = $this->prefixLines($prefix['start'], PHP_EOL) . PHP_EOL; - - if ($message) { - $out .= $this->prefixLines($prefix['message'], $message . PHP_EOL) . PHP_EOL; - } - - if ($diff) { - $out .= $this->prefixLines($prefix['diff'], $diff . PHP_EOL) . PHP_EOL; - } - - if ($trace) { - if ($message || $diff) { - $out .= $this->prefixLines($prefix['default'], PHP_EOL) . PHP_EOL; - } - $out .= $this->prefixLines($prefix['trace'], $trace . PHP_EOL) . PHP_EOL; - } - $out .= $this->prefixLines($prefix['last'], PHP_EOL) . PHP_EOL; - - return $out; - } - - protected function drawSpinner(): void - { - if ($this->colors) { - $id = $this->spinState % count(self::SPINNER_ICONS); - $this->write(self::SPINNER_ICONS[$id]); - } - } - - protected function undrawSpinner(): void - { - if ($this->colors) { - $id = $this->spinState % count(self::SPINNER_ICONS); - $this->write("\e[1K\e[" . strlen(self::SPINNER_ICONS[$id]) . 'D'); - } - } - - private function formatRuntime(float $time, string $color = ''): string - { - if (!$this->colors) { - return sprintf('[%.2f ms]', $time * 1000); - } - - if ($time > 1) { - $color = 'fg-magenta'; - } - - return Color::colorize($color, ' ' . (int) ceil($time * 1000) . ' ' . Color::dim('ms')); - } - - private function printNonSuccessfulTestsSummary(int $numberOfExecutedTests): void - { - if (empty($this->nonSuccessfulTestResults)) { - return; - } - - if ((count($this->nonSuccessfulTestResults) / $numberOfExecutedTests) >= 0.7) { - return; - } - - $this->write("Summary of non-successful tests:\n\n"); - - $prevResult = $this->getEmptyTestResult(); - - foreach ($this->nonSuccessfulTestResults as $testIndex) { - $result = $this->testResults[$testIndex]; - $this->writeTestResult($prevResult, $result); - $prevResult = $result; - } - } -} diff --git a/vendor/phpunit/phpunit/src/Util/TestDox/HtmlResultPrinter.php b/vendor/phpunit/phpunit/src/Util/TestDox/HtmlResultPrinter.php deleted file mode 100644 index 013d1de8..00000000 --- a/vendor/phpunit/phpunit/src/Util/TestDox/HtmlResultPrinter.php +++ /dev/null @@ -1,140 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\TestDox; - -use function sprintf; -use PHPUnit\Framework\TestResult; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class HtmlResultPrinter extends ResultPrinter -{ - /** - * @var string - */ - private const PAGE_HEADER = <<<'EOT' - - - - - Test Documentation - - - -EOT; - - /** - * @var string - */ - private const CLASS_HEADER = <<<'EOT' - -

      %s

      -
        - -EOT; - - /** - * @var string - */ - private const CLASS_FOOTER = <<<'EOT' -
      -EOT; - - /** - * @var string - */ - private const PAGE_FOOTER = <<<'EOT' - - - -EOT; - - public function printResult(TestResult $result): void - { - } - - /** - * Handler for 'start run' event. - */ - protected function startRun(): void - { - $this->write(self::PAGE_HEADER); - } - - /** - * Handler for 'start class' event. - */ - protected function startClass(string $name): void - { - $this->write( - sprintf( - self::CLASS_HEADER, - $name, - $this->currentTestClassPrettified - ) - ); - } - - /** - * Handler for 'on test' event. - */ - protected function onTest(string $name, bool $success = true): void - { - $this->write( - sprintf( - "
    • %s %s
    • \n", - $success ? '#555753' : '#ef2929', - $success ? '✓' : '❌', - $name - ) - ); - } - - /** - * Handler for 'end class' event. - */ - protected function endClass(string $name): void - { - $this->write(self::CLASS_FOOTER); - } - - /** - * Handler for 'end run' event. - */ - protected function endRun(): void - { - $this->write(self::PAGE_FOOTER); - } -} diff --git a/vendor/phpunit/phpunit/src/Util/TestDox/NamePrettifier.php b/vendor/phpunit/phpunit/src/Util/TestDox/NamePrettifier.php deleted file mode 100644 index 74207149..00000000 --- a/vendor/phpunit/phpunit/src/Util/TestDox/NamePrettifier.php +++ /dev/null @@ -1,312 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\TestDox; - -use function array_key_exists; -use function array_keys; -use function array_map; -use function array_pop; -use function array_values; -use function explode; -use function get_class; -use function gettype; -use function implode; -use function in_array; -use function is_bool; -use function is_float; -use function is_int; -use function is_numeric; -use function is_object; -use function is_scalar; -use function is_string; -use function ord; -use function preg_quote; -use function preg_replace; -use function range; -use function sprintf; -use function str_replace; -use function strlen; -use function strpos; -use function strtolower; -use function strtoupper; -use function substr; -use function trim; -use PHPUnit\Framework\TestCase; -use PHPUnit\Util\Color; -use PHPUnit\Util\Exception as UtilException; -use PHPUnit\Util\Test; -use ReflectionException; -use ReflectionMethod; -use ReflectionObject; -use SebastianBergmann\Exporter\Exporter; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class NamePrettifier -{ - /** - * @var string[] - */ - private $strings = []; - - /** - * @var bool - */ - private $useColor; - - public function __construct(bool $useColor = false) - { - $this->useColor = $useColor; - } - - /** - * Prettifies the name of a test class. - * - * @psalm-param class-string $className - */ - public function prettifyTestClass(string $className): string - { - try { - $annotations = Test::parseTestMethodAnnotations($className); - - if (isset($annotations['class']['testdox'][0])) { - return $annotations['class']['testdox'][0]; - } - } catch (UtilException $e) { - // ignore, determine className by parsing the provided name - } - - $parts = explode('\\', $className); - $className = array_pop($parts); - - if (substr($className, -1 * strlen('Test')) === 'Test') { - $className = substr($className, 0, strlen($className) - strlen('Test')); - } - - if (strpos($className, 'Tests') === 0) { - $className = substr($className, strlen('Tests')); - } elseif (strpos($className, 'Test') === 0) { - $className = substr($className, strlen('Test')); - } - - if (empty($className)) { - $className = 'UnnamedTests'; - } - - if (!empty($parts)) { - $parts[] = $className; - $fullyQualifiedName = implode('\\', $parts); - } else { - $fullyQualifiedName = $className; - } - - $result = preg_replace('/(?<=[[:lower:]])(?=[[:upper:]])/u', ' ', $className); - - if ($fullyQualifiedName !== $className) { - return $result . ' (' . $fullyQualifiedName . ')'; - } - - return $result; - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function prettifyTestCase(TestCase $test): string - { - $annotations = Test::parseTestMethodAnnotations( - get_class($test), - $test->getName(false) - ); - - $annotationWithPlaceholders = false; - - $callback = static function (string $variable): string - { - return sprintf('/%s(?=\b)/', preg_quote($variable, '/')); - }; - - if (isset($annotations['method']['testdox'][0])) { - $result = $annotations['method']['testdox'][0]; - - if (strpos($result, '$') !== false) { - $annotation = $annotations['method']['testdox'][0]; - $providedData = $this->mapTestMethodParameterNamesToProvidedDataValues($test); - $variables = array_map($callback, array_keys($providedData)); - - $result = trim(preg_replace($variables, $providedData, $annotation)); - - $annotationWithPlaceholders = true; - } - } else { - $result = $this->prettifyTestMethod($test->getName(false)); - } - - if (!$annotationWithPlaceholders && $test->usesDataProvider()) { - $result .= $this->prettifyDataSet($test); - } - - return $result; - } - - public function prettifyDataSet(TestCase $test): string - { - if (!$this->useColor) { - return $test->getDataSetAsString(false); - } - - if (is_int($test->dataName())) { - $data = Color::dim(' with data set ') . Color::colorize('fg-cyan', (string) $test->dataName()); - } else { - $data = Color::dim(' with ') . Color::colorize('fg-cyan', Color::visualizeWhitespace((string) $test->dataName())); - } - - return $data; - } - - /** - * Prettifies the name of a test method. - */ - public function prettifyTestMethod(string $name): string - { - $buffer = ''; - - if ($name === '') { - return $buffer; - } - - $string = (string) preg_replace('#\d+$#', '', $name, -1, $count); - - if (in_array($string, $this->strings, true)) { - $name = $string; - } elseif ($count === 0) { - $this->strings[] = $string; - } - - if (strpos($name, 'test_') === 0) { - $name = substr($name, 5); - } elseif (strpos($name, 'test') === 0) { - $name = substr($name, 4); - } - - if ($name === '') { - return $buffer; - } - - $name[0] = strtoupper($name[0]); - - if (strpos($name, '_') !== false) { - return trim(str_replace('_', ' ', $name)); - } - - $wasNumeric = false; - - foreach (range(0, strlen($name) - 1) as $i) { - if ($i > 0 && ord($name[$i]) >= 65 && ord($name[$i]) <= 90) { - $buffer .= ' ' . strtolower($name[$i]); - } else { - $isNumeric = is_numeric($name[$i]); - - if (!$wasNumeric && $isNumeric) { - $buffer .= ' '; - $wasNumeric = true; - } - - if ($wasNumeric && !$isNumeric) { - $wasNumeric = false; - } - - $buffer .= $name[$i]; - } - } - - return $buffer; - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - private function mapTestMethodParameterNamesToProvidedDataValues(TestCase $test): array - { - try { - $reflector = new ReflectionMethod(get_class($test), $test->getName(false)); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new UtilException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - $providedData = []; - $providedDataValues = array_values($test->getProvidedData()); - $i = 0; - - $providedData['$_dataName'] = $test->dataName(); - - foreach ($reflector->getParameters() as $parameter) { - if (!array_key_exists($i, $providedDataValues) && $parameter->isDefaultValueAvailable()) { - try { - $providedDataValues[$i] = $parameter->getDefaultValue(); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new UtilException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } - - $value = $providedDataValues[$i++] ?? null; - - if (is_object($value)) { - $reflector = new ReflectionObject($value); - - if ($reflector->hasMethod('__toString')) { - $value = (string) $value; - } else { - $value = get_class($value); - } - } - - if (!is_scalar($value)) { - $value = gettype($value); - } - - if (is_bool($value) || is_int($value) || is_float($value)) { - $value = (new Exporter)->export($value); - } - - if (is_string($value) && $value === '') { - if ($this->useColor) { - $value = Color::colorize('dim,underlined', 'empty'); - } else { - $value = "''"; - } - } - - $providedData['$' . $parameter->getName()] = $value; - } - - if ($this->useColor) { - $providedData = array_map(static function ($value) - { - return Color::colorize('fg-cyan', Color::visualizeWhitespace((string) $value, true)); - }, $providedData); - } - - return $providedData; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/TestDox/ResultPrinter.php b/vendor/phpunit/phpunit/src/Util/TestDox/ResultPrinter.php deleted file mode 100644 index c4b63644..00000000 --- a/vendor/phpunit/phpunit/src/Util/TestDox/ResultPrinter.php +++ /dev/null @@ -1,343 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\TestDox; - -use function get_class; -use function in_array; -use PHPUnit\Framework\AssertionFailedError; -use PHPUnit\Framework\ErrorTestCase; -use PHPUnit\Framework\Test; -use PHPUnit\Framework\TestCase; -use PHPUnit\Framework\TestSuite; -use PHPUnit\Framework\Warning; -use PHPUnit\Framework\WarningTestCase; -use PHPUnit\Runner\BaseTestRunner; -use PHPUnit\TextUI\ResultPrinter as ResultPrinterInterface; -use PHPUnit\Util\Printer; -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -abstract class ResultPrinter extends Printer implements ResultPrinterInterface -{ - /** - * @var NamePrettifier - */ - protected $prettifier; - - /** - * @var string - */ - protected $testClass = ''; - - /** - * @var int - */ - protected $testStatus; - - /** - * @var array - */ - protected $tests = []; - - /** - * @var int - */ - protected $successful = 0; - - /** - * @var int - */ - protected $warned = 0; - - /** - * @var int - */ - protected $failed = 0; - - /** - * @var int - */ - protected $risky = 0; - - /** - * @var int - */ - protected $skipped = 0; - - /** - * @var int - */ - protected $incomplete = 0; - - /** - * @var null|string - */ - protected $currentTestClassPrettified; - - /** - * @var null|string - */ - protected $currentTestMethodPrettified; - - /** - * @var array - */ - private $groups; - - /** - * @var array - */ - private $excludeGroups; - - /** - * @param resource $out - * - * @throws \PHPUnit\Framework\Exception - */ - public function __construct($out = null, array $groups = [], array $excludeGroups = []) - { - parent::__construct($out); - - $this->groups = $groups; - $this->excludeGroups = $excludeGroups; - - $this->prettifier = new NamePrettifier; - $this->startRun(); - } - - /** - * Flush buffer and close output. - */ - public function flush(): void - { - $this->doEndClass(); - $this->endRun(); - - parent::flush(); - } - - /** - * An error occurred. - */ - public function addError(Test $test, Throwable $t, float $time): void - { - if (!$this->isOfInterest($test)) { - return; - } - - $this->testStatus = BaseTestRunner::STATUS_ERROR; - $this->failed++; - } - - /** - * A warning occurred. - */ - public function addWarning(Test $test, Warning $e, float $time): void - { - if (!$this->isOfInterest($test)) { - return; - } - - $this->testStatus = BaseTestRunner::STATUS_WARNING; - $this->warned++; - } - - /** - * A failure occurred. - */ - public function addFailure(Test $test, AssertionFailedError $e, float $time): void - { - if (!$this->isOfInterest($test)) { - return; - } - - $this->testStatus = BaseTestRunner::STATUS_FAILURE; - $this->failed++; - } - - /** - * Incomplete test. - */ - public function addIncompleteTest(Test $test, Throwable $t, float $time): void - { - if (!$this->isOfInterest($test)) { - return; - } - - $this->testStatus = BaseTestRunner::STATUS_INCOMPLETE; - $this->incomplete++; - } - - /** - * Risky test. - */ - public function addRiskyTest(Test $test, Throwable $t, float $time): void - { - if (!$this->isOfInterest($test)) { - return; - } - - $this->testStatus = BaseTestRunner::STATUS_RISKY; - $this->risky++; - } - - /** - * Skipped test. - */ - public function addSkippedTest(Test $test, Throwable $t, float $time): void - { - if (!$this->isOfInterest($test)) { - return; - } - - $this->testStatus = BaseTestRunner::STATUS_SKIPPED; - $this->skipped++; - } - - /** - * A testsuite started. - */ - public function startTestSuite(TestSuite $suite): void - { - } - - /** - * A testsuite ended. - */ - public function endTestSuite(TestSuite $suite): void - { - } - - /** - * A test started. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function startTest(Test $test): void - { - if (!$this->isOfInterest($test)) { - return; - } - - $class = get_class($test); - - if ($this->testClass !== $class) { - if ($this->testClass !== '') { - $this->doEndClass(); - } - - $this->currentTestClassPrettified = $this->prettifier->prettifyTestClass($class); - $this->testClass = $class; - $this->tests = []; - - $this->startClass($class); - } - - if ($test instanceof TestCase) { - $this->currentTestMethodPrettified = $this->prettifier->prettifyTestCase($test); - } - - $this->testStatus = BaseTestRunner::STATUS_PASSED; - } - - /** - * A test ended. - */ - public function endTest(Test $test, float $time): void - { - if (!$this->isOfInterest($test)) { - return; - } - - $this->tests[] = [$this->currentTestMethodPrettified, $this->testStatus]; - - $this->currentTestClassPrettified = null; - $this->currentTestMethodPrettified = null; - } - - protected function doEndClass(): void - { - foreach ($this->tests as $test) { - $this->onTest($test[0], $test[1] === BaseTestRunner::STATUS_PASSED); - } - - $this->endClass($this->testClass); - } - - /** - * Handler for 'start run' event. - */ - protected function startRun(): void - { - } - - /** - * Handler for 'start class' event. - */ - protected function startClass(string $name): void - { - } - - /** - * Handler for 'on test' event. - */ - protected function onTest(string $name, bool $success = true): void - { - } - - /** - * Handler for 'end class' event. - */ - protected function endClass(string $name): void - { - } - - /** - * Handler for 'end run' event. - */ - protected function endRun(): void - { - } - - private function isOfInterest(Test $test): bool - { - if (!$test instanceof TestCase) { - return false; - } - - if ($test instanceof ErrorTestCase || $test instanceof WarningTestCase) { - return false; - } - - if (!empty($this->groups)) { - foreach ($test->getGroups() as $group) { - if (in_array($group, $this->groups, true)) { - return true; - } - } - - return false; - } - - if (!empty($this->excludeGroups)) { - foreach ($test->getGroups() as $group) { - if (in_array($group, $this->excludeGroups, true)) { - return false; - } - } - - return true; - } - - return true; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/TestDox/TestDoxPrinter.php b/vendor/phpunit/phpunit/src/Util/TestDox/TestDoxPrinter.php deleted file mode 100644 index bd64785c..00000000 --- a/vendor/phpunit/phpunit/src/Util/TestDox/TestDoxPrinter.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 PHPUnit\Util\TestDox; - -use const PHP_EOL; -use function array_map; -use function get_class; -use function implode; -use function method_exists; -use function preg_split; -use function trim; -use PHPUnit\Framework\AssertionFailedError; -use PHPUnit\Framework\Reorderable; -use PHPUnit\Framework\Test; -use PHPUnit\Framework\TestCase; -use PHPUnit\Framework\TestResult; -use PHPUnit\Framework\TestSuite; -use PHPUnit\Framework\Warning; -use PHPUnit\Runner\BaseTestRunner; -use PHPUnit\Runner\PhptTestCase; -use PHPUnit\TextUI\DefaultResultPrinter; -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -class TestDoxPrinter extends DefaultResultPrinter -{ - /** - * @var NamePrettifier - */ - protected $prettifier; - - /** - * @var int The number of test results received from the TestRunner - */ - protected $testIndex = 0; - - /** - * @var int The number of test results already sent to the output - */ - protected $testFlushIndex = 0; - - /** - * @var array Buffer for test results - */ - protected $testResults = []; - - /** - * @var array Lookup table for testname to testResults[index] - */ - protected $testNameResultIndex = []; - - /** - * @var bool - */ - protected $enableOutputBuffer = false; - - /** - * @var array array - */ - protected $originalExecutionOrder = []; - - /** - * @var int - */ - protected $spinState = 0; - - /** - * @var bool - */ - protected $showProgress = true; - - /** - * @param null|resource|string $out - * @param int|string $numberOfColumns - * - * @throws \PHPUnit\Framework\Exception - */ - public function __construct($out = null, bool $verbose = false, string $colors = self::COLOR_DEFAULT, bool $debug = false, $numberOfColumns = 80, bool $reverse = false) - { - parent::__construct($out, $verbose, $colors, $debug, $numberOfColumns, $reverse); - - $this->prettifier = new NamePrettifier($this->colors); - } - - public function setOriginalExecutionOrder(array $order): void - { - $this->originalExecutionOrder = $order; - $this->enableOutputBuffer = !empty($order); - } - - public function setShowProgressAnimation(bool $showProgress): void - { - $this->showProgress = $showProgress; - } - - public function printResult(TestResult $result): void - { - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function endTest(Test $test, float $time): void - { - if (!$test instanceof TestCase && !$test instanceof PhptTestCase && !$test instanceof TestSuite) { - return; - } - - if ($this->testHasPassed()) { - $this->registerTestResult($test, null, BaseTestRunner::STATUS_PASSED, $time, false); - } - - if ($test instanceof TestCase || $test instanceof PhptTestCase) { - $this->testIndex++; - } - - parent::endTest($test, $time); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function addError(Test $test, Throwable $t, float $time): void - { - $this->registerTestResult($test, $t, BaseTestRunner::STATUS_ERROR, $time, true); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function addWarning(Test $test, Warning $e, float $time): void - { - $this->registerTestResult($test, $e, BaseTestRunner::STATUS_WARNING, $time, true); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function addFailure(Test $test, AssertionFailedError $e, float $time): void - { - $this->registerTestResult($test, $e, BaseTestRunner::STATUS_FAILURE, $time, true); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function addIncompleteTest(Test $test, Throwable $t, float $time): void - { - $this->registerTestResult($test, $t, BaseTestRunner::STATUS_INCOMPLETE, $time, false); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function addRiskyTest(Test $test, Throwable $t, float $time): void - { - $this->registerTestResult($test, $t, BaseTestRunner::STATUS_RISKY, $time, false); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function addSkippedTest(Test $test, Throwable $t, float $time): void - { - $this->registerTestResult($test, $t, BaseTestRunner::STATUS_SKIPPED, $time, false); - } - - public function writeProgress(string $progress): void - { - $this->flushOutputBuffer(); - } - - public function flush(): void - { - $this->flushOutputBuffer(true); - } - - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - protected function registerTestResult(Test $test, ?Throwable $t, int $status, float $time, bool $verbose): void - { - $testName = $test instanceof Reorderable ? $test->sortId() : $test->getName(); - - $result = [ - 'className' => $this->formatClassName($test), - 'testName' => $testName, - 'testMethod' => $this->formatTestName($test), - 'message' => '', - 'status' => $status, - 'time' => $time, - 'verbose' => $verbose, - ]; - - if ($t !== null) { - $result['message'] = $this->formatTestResultMessage($t, $result); - } - - $this->testResults[$this->testIndex] = $result; - $this->testNameResultIndex[$testName] = $this->testIndex; - } - - protected function formatTestName(Test $test): string - { - return method_exists($test, 'getName') ? $test->getName() : ''; - } - - protected function formatClassName(Test $test): string - { - return get_class($test); - } - - protected function testHasPassed(): bool - { - if (!isset($this->testResults[$this->testIndex]['status'])) { - return true; - } - - if ($this->testResults[$this->testIndex]['status'] === BaseTestRunner::STATUS_PASSED) { - return true; - } - - return false; - } - - protected function flushOutputBuffer(bool $forceFlush = false): void - { - if ($this->testFlushIndex === $this->testIndex) { - return; - } - - if ($this->testFlushIndex > 0) { - if ($this->enableOutputBuffer && - isset($this->originalExecutionOrder[$this->testFlushIndex - 1])) { - $prevResult = $this->getTestResultByName($this->originalExecutionOrder[$this->testFlushIndex - 1]); - } else { - $prevResult = $this->testResults[$this->testFlushIndex - 1]; - } - } else { - $prevResult = $this->getEmptyTestResult(); - } - - if (!$this->enableOutputBuffer) { - $this->writeTestResult($prevResult, $this->testResults[$this->testFlushIndex++]); - } else { - do { - $flushed = false; - - if (!$forceFlush && isset($this->originalExecutionOrder[$this->testFlushIndex])) { - $result = $this->getTestResultByName($this->originalExecutionOrder[$this->testFlushIndex]); - } else { - // This test(name) cannot found in original execution order, - // flush result to output stream right away - $result = $this->testResults[$this->testFlushIndex]; - } - - if (!empty($result)) { - $this->hideSpinner(); - $this->writeTestResult($prevResult, $result); - $this->testFlushIndex++; - $prevResult = $result; - $flushed = true; - } else { - $this->showSpinner(); - } - } while ($flushed && $this->testFlushIndex < $this->testIndex); - } - } - - protected function showSpinner(): void - { - if (!$this->showProgress) { - return; - } - - if ($this->spinState) { - $this->undrawSpinner(); - } - - $this->spinState++; - $this->drawSpinner(); - } - - protected function hideSpinner(): void - { - if (!$this->showProgress) { - return; - } - - if ($this->spinState) { - $this->undrawSpinner(); - } - - $this->spinState = 0; - } - - protected function drawSpinner(): void - { - // optional for CLI printers: show the user a 'buffering output' spinner - } - - protected function undrawSpinner(): void - { - // remove the spinner from the current line - } - - protected function writeTestResult(array $prevResult, array $result): void - { - } - - protected function getEmptyTestResult(): array - { - return [ - 'className' => '', - 'testName' => '', - 'message' => '', - 'failed' => '', - 'verbose' => '', - ]; - } - - protected function getTestResultByName(?string $testName): array - { - if (isset($this->testNameResultIndex[$testName])) { - return $this->testResults[$this->testNameResultIndex[$testName]]; - } - - return []; - } - - protected function formatThrowable(Throwable $t, ?int $status = null): string - { - $message = trim(\PHPUnit\Framework\TestFailure::exceptionToString($t)); - - if ($message) { - $message .= PHP_EOL . PHP_EOL . $this->formatStacktrace($t); - } else { - $message = $this->formatStacktrace($t); - } - - return $message; - } - - protected function formatStacktrace(Throwable $t): string - { - return \PHPUnit\Util\Filter::getFilteredStacktrace($t); - } - - protected function formatTestResultMessage(Throwable $t, array $result, string $prefix = '│'): string - { - $message = $this->formatThrowable($t, $result['status']); - - if ($message === '') { - return ''; - } - - if (!($this->verbose || $result['verbose'])) { - return ''; - } - - return $this->prefixLines($prefix, $message); - } - - protected function prefixLines(string $prefix, string $message): string - { - $message = trim($message); - - return implode( - PHP_EOL, - array_map( - static function (string $text) use ($prefix) - { - return ' ' . $prefix . ($text ? ' ' . $text : ''); - }, - preg_split('/\r\n|\r|\n/', $message) - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Util/TestDox/TextResultPrinter.php b/vendor/phpunit/phpunit/src/Util/TestDox/TextResultPrinter.php deleted file mode 100644 index 8a1893e5..00000000 --- a/vendor/phpunit/phpunit/src/Util/TestDox/TextResultPrinter.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\TestDox; - -use PHPUnit\Framework\TestResult; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TextResultPrinter extends ResultPrinter -{ - public function printResult(TestResult $result): void - { - } - - /** - * Handler for 'start class' event. - */ - protected function startClass(string $name): void - { - $this->write($this->currentTestClassPrettified . "\n"); - } - - /** - * Handler for 'on test' event. - */ - protected function onTest(string $name, bool $success = true): void - { - if ($success) { - $this->write(' [x] '); - } else { - $this->write(' [ ] '); - } - - $this->write($name . "\n"); - } - - /** - * Handler for 'end class' event. - */ - protected function endClass(string $name): void - { - $this->write("\n"); - } -} diff --git a/vendor/phpunit/phpunit/src/Util/TestDox/XmlResultPrinter.php b/vendor/phpunit/phpunit/src/Util/TestDox/XmlResultPrinter.php deleted file mode 100644 index 265fe41f..00000000 --- a/vendor/phpunit/phpunit/src/Util/TestDox/XmlResultPrinter.php +++ /dev/null @@ -1,261 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\TestDox; - -use function array_filter; -use function get_class; -use function implode; -use function strpos; -use DOMDocument; -use DOMElement; -use PHPUnit\Framework\AssertionFailedError; -use PHPUnit\Framework\Exception; -use PHPUnit\Framework\Test; -use PHPUnit\Framework\TestCase; -use PHPUnit\Framework\TestListener; -use PHPUnit\Framework\TestSuite; -use PHPUnit\Framework\Warning; -use PHPUnit\Framework\WarningTestCase; -use PHPUnit\Util\Printer; -use PHPUnit\Util\Test as TestUtil; -use ReflectionClass; -use ReflectionException; -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class XmlResultPrinter extends Printer implements TestListener -{ - /** - * @var DOMDocument - */ - private $document; - - /** - * @var DOMElement - */ - private $root; - - /** - * @var NamePrettifier - */ - private $prettifier; - - /** - * @var null|Throwable - */ - private $exception; - - /** - * @param resource|string $out - * - * @throws Exception - */ - public function __construct($out = null) - { - $this->document = new DOMDocument('1.0', 'UTF-8'); - $this->document->formatOutput = true; - - $this->root = $this->document->createElement('tests'); - $this->document->appendChild($this->root); - - $this->prettifier = new NamePrettifier; - - parent::__construct($out); - } - - /** - * Flush buffer and close output. - */ - public function flush(): void - { - $this->write($this->document->saveXML()); - - parent::flush(); - } - - /** - * An error occurred. - */ - public function addError(Test $test, Throwable $t, float $time): void - { - $this->exception = $t; - } - - /** - * A warning occurred. - */ - public function addWarning(Test $test, Warning $e, float $time): void - { - } - - /** - * A failure occurred. - */ - public function addFailure(Test $test, AssertionFailedError $e, float $time): void - { - $this->exception = $e; - } - - /** - * Incomplete test. - */ - public function addIncompleteTest(Test $test, Throwable $t, float $time): void - { - } - - /** - * Risky test. - */ - public function addRiskyTest(Test $test, Throwable $t, float $time): void - { - } - - /** - * Skipped test. - */ - public function addSkippedTest(Test $test, Throwable $t, float $time): void - { - } - - /** - * A test suite started. - */ - public function startTestSuite(TestSuite $suite): void - { - } - - /** - * A test suite ended. - */ - public function endTestSuite(TestSuite $suite): void - { - } - - /** - * A test started. - */ - public function startTest(Test $test): void - { - $this->exception = null; - } - - /** - * A test ended. - * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function endTest(Test $test, float $time): void - { - if (!$test instanceof TestCase || $test instanceof WarningTestCase) { - return; - } - - $groups = array_filter( - $test->getGroups(), - static function ($group) - { - return !($group === 'small' || $group === 'medium' || $group === 'large' || strpos($group, '__phpunit_') === 0); - } - ); - - $testNode = $this->document->createElement('test'); - - $testNode->setAttribute('className', get_class($test)); - $testNode->setAttribute('methodName', $test->getName()); - $testNode->setAttribute('prettifiedClassName', $this->prettifier->prettifyTestClass(get_class($test))); - $testNode->setAttribute('prettifiedMethodName', $this->prettifier->prettifyTestCase($test)); - $testNode->setAttribute('status', (string) $test->getStatus()); - $testNode->setAttribute('time', (string) $time); - $testNode->setAttribute('size', (string) $test->getSize()); - $testNode->setAttribute('groups', implode(',', $groups)); - - foreach ($groups as $group) { - $groupNode = $this->document->createElement('group'); - - $groupNode->setAttribute('name', $group); - - $testNode->appendChild($groupNode); - } - - $annotations = TestUtil::parseTestMethodAnnotations( - get_class($test), - $test->getName(false) - ); - - foreach (['class', 'method'] as $type) { - foreach ($annotations[$type] as $annotation => $values) { - if ($annotation !== 'covers' && $annotation !== 'uses') { - continue; - } - - foreach ($values as $value) { - $coversNode = $this->document->createElement($annotation); - - $coversNode->setAttribute('target', $value); - - $testNode->appendChild($coversNode); - } - } - } - - foreach ($test->doubledTypes() as $doubledType) { - $testDoubleNode = $this->document->createElement('testDouble'); - - $testDoubleNode->setAttribute('type', $doubledType); - - $testNode->appendChild($testDoubleNode); - } - - $inlineAnnotations = \PHPUnit\Util\Test::getInlineAnnotations(get_class($test), $test->getName(false)); - - if (isset($inlineAnnotations['given'], $inlineAnnotations['when'], $inlineAnnotations['then'])) { - $testNode->setAttribute('given', $inlineAnnotations['given']['value']); - $testNode->setAttribute('givenStartLine', (string) $inlineAnnotations['given']['line']); - $testNode->setAttribute('when', $inlineAnnotations['when']['value']); - $testNode->setAttribute('whenStartLine', (string) $inlineAnnotations['when']['line']); - $testNode->setAttribute('then', $inlineAnnotations['then']['value']); - $testNode->setAttribute('thenStartLine', (string) $inlineAnnotations['then']['line']); - } - - if ($this->exception !== null) { - if ($this->exception instanceof Exception) { - $steps = $this->exception->getSerializableTrace(); - } else { - $steps = $this->exception->getTrace(); - } - - try { - $file = (new ReflectionClass($test))->getFileName(); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - foreach ($steps as $step) { - if (isset($step['file']) && $step['file'] === $file) { - $testNode->setAttribute('exceptionLine', (string) $step['line']); - - break; - } - } - - $testNode->setAttribute('exceptionMessage', $this->exception->getMessage()); - } - - $this->root->appendChild($testNode); - } -} diff --git a/vendor/phpunit/phpunit/src/Util/TextTestListRenderer.php b/vendor/phpunit/phpunit/src/Util/TextTestListRenderer.php deleted file mode 100644 index 67168a67..00000000 --- a/vendor/phpunit/phpunit/src/Util/TextTestListRenderer.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use const PHP_EOL; -use function get_class; -use function sprintf; -use function str_replace; -use PHPUnit\Framework\TestCase; -use PHPUnit\Framework\TestSuite; -use PHPUnit\Runner\PhptTestCase; -use RecursiveIteratorIterator; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TextTestListRenderer -{ - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function render(TestSuite $suite): string - { - $buffer = 'Available test(s):' . PHP_EOL; - - foreach (new RecursiveIteratorIterator($suite->getIterator()) as $test) { - if ($test instanceof TestCase) { - $name = sprintf( - '%s::%s', - get_class($test), - str_replace(' with data set ', '', $test->getName()) - ); - } elseif ($test instanceof PhptTestCase) { - $name = $test->getName(); - } else { - continue; - } - - $buffer .= sprintf( - ' - %s' . PHP_EOL, - $name - ); - } - - return $buffer; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Type.php b/vendor/phpunit/phpunit/src/Util/Type.php deleted file mode 100644 index ec6a1d78..00000000 --- a/vendor/phpunit/phpunit/src/Util/Type.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Type -{ - public static function isType(string $type): bool - { - switch ($type) { - case 'numeric': - case 'integer': - case 'int': - case 'iterable': - case 'float': - case 'string': - case 'boolean': - case 'bool': - case 'null': - case 'array': - case 'object': - case 'resource': - case 'scalar': - return true; - - default: - return false; - } - } -} diff --git a/vendor/phpunit/phpunit/src/Util/VersionComparisonOperator.php b/vendor/phpunit/phpunit/src/Util/VersionComparisonOperator.php deleted file mode 100644 index 77e67470..00000000 --- a/vendor/phpunit/phpunit/src/Util/VersionComparisonOperator.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use function in_array; -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class VersionComparisonOperator -{ - /** - * @psalm-var '<'|'lt'|'<='|'le'|'>'|'gt'|'>='|'ge'|'=='|'='|'eq'|'!='|'<>'|'ne' - */ - private $operator; - - public function __construct(string $operator) - { - $this->ensureOperatorIsValid($operator); - - $this->operator = $operator; - } - - /** - * @return '!='|'<'|'<='|'<>'|'='|'=='|'>'|'>='|'eq'|'ge'|'gt'|'le'|'lt'|'ne' - */ - public function asString(): string - { - return $this->operator; - } - - /** - * @throws Exception - * - * @psalm-assert '<'|'lt'|'<='|'le'|'>'|'gt'|'>='|'ge'|'=='|'='|'eq'|'!='|'<>'|'ne' $operator - */ - private function ensureOperatorIsValid(string $operator): void - { - if (!in_array($operator, ['<', 'lt', '<=', 'le', '>', 'gt', '>=', 'ge', '==', '=', 'eq', '!=', '<>', 'ne'], true)) { - throw new Exception( - sprintf( - '"%s" is not a valid version_compare() operator', - $operator - ) - ); - } - } -} diff --git a/vendor/phpunit/phpunit/src/Util/XdebugFilterScriptGenerator.php b/vendor/phpunit/phpunit/src/Util/XdebugFilterScriptGenerator.php deleted file mode 100644 index 8b10d415..00000000 --- a/vendor/phpunit/phpunit/src/Util/XdebugFilterScriptGenerator.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 PHPUnit\Util; - -use const DIRECTORY_SEPARATOR; -use function addslashes; -use function array_map; -use function implode; -use function is_string; -use function realpath; -use function sprintf; -use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\CodeCoverage as FilterConfiguration; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @deprecated - */ -final class XdebugFilterScriptGenerator -{ - public function generate(FilterConfiguration $filter): string - { - $files = array_map( - static function ($item) - { - return sprintf( - " '%s'", - $item - ); - }, - $this->getItems($filter) - ); - - $files = implode(",\n", $files); - - return <<directories() as $directory) { - $path = realpath($directory->path()); - - if (is_string($path)) { - $files[] = sprintf( - addslashes('%s' . DIRECTORY_SEPARATOR), - $path - ); - } - } - - foreach ($filter->files() as $file) { - $files[] = $file->path(); - } - - return $files; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Xml.php b/vendor/phpunit/phpunit/src/Util/Xml.php deleted file mode 100644 index 54d72156..00000000 --- a/vendor/phpunit/phpunit/src/Util/Xml.php +++ /dev/null @@ -1,193 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use const ENT_QUOTES; -use function assert; -use function class_exists; -use function htmlspecialchars; -use function mb_convert_encoding; -use function ord; -use function preg_replace; -use function settype; -use function strlen; -use DOMCharacterData; -use DOMDocument; -use DOMElement; -use DOMNode; -use DOMText; -use ReflectionClass; -use ReflectionException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Xml -{ - /** - * @deprecated Only used by assertEqualXMLStructure() - */ - public static function import(DOMElement $element): DOMElement - { - return (new DOMDocument)->importNode($element, true); - } - - /** - * @deprecated Only used by assertEqualXMLStructure() - */ - public static function removeCharacterDataNodes(DOMNode $node): void - { - if ($node->hasChildNodes()) { - for ($i = $node->childNodes->length - 1; $i >= 0; $i--) { - if (($child = $node->childNodes->item($i)) instanceof DOMCharacterData) { - $node->removeChild($child); - } - } - } - } - - /** - * Escapes a string for the use in XML documents. - * - * Any Unicode character is allowed, excluding the surrogate blocks, FFFE, - * and FFFF (not even as character reference). - * - * @see https://www.w3.org/TR/xml/#charsets - */ - public static function prepareString(string $string): string - { - return preg_replace( - '/[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]/', - '', - htmlspecialchars( - self::convertToUtf8($string), - ENT_QUOTES - ) - ); - } - - /** - * "Convert" a DOMElement object into a PHP variable. - */ - public static function xmlToVariable(DOMElement $element) - { - $variable = null; - - switch ($element->tagName) { - case 'array': - $variable = []; - - foreach ($element->childNodes as $entry) { - if (!$entry instanceof DOMElement || $entry->tagName !== 'element') { - continue; - } - $item = $entry->childNodes->item(0); - - if ($item instanceof DOMText) { - $item = $entry->childNodes->item(1); - } - - $value = self::xmlToVariable($item); - - if ($entry->hasAttribute('key')) { - $variable[(string) $entry->getAttribute('key')] = $value; - } else { - $variable[] = $value; - } - } - - break; - - case 'object': - $className = $element->getAttribute('class'); - - if ($element->hasChildNodes()) { - $arguments = $element->childNodes->item(0)->childNodes; - $constructorArgs = []; - - foreach ($arguments as $argument) { - if ($argument instanceof DOMElement) { - $constructorArgs[] = self::xmlToVariable($argument); - } - } - - try { - assert(class_exists($className)); - - $variable = (new ReflectionClass($className))->newInstanceArgs($constructorArgs); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new Exception( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } else { - $variable = new $className; - } - - break; - - case 'boolean': - $variable = $element->textContent === 'true'; - - break; - - case 'integer': - case 'double': - case 'string': - $variable = $element->textContent; - - settype($variable, $element->tagName); - - break; - } - - return $variable; - } - - private static function convertToUtf8(string $string): string - { - if (!self::isUtf8($string)) { - $string = mb_convert_encoding($string, 'UTF-8'); - } - - return $string; - } - - private static function isUtf8(string $string): bool - { - $length = strlen($string); - - for ($i = 0; $i < $length; $i++) { - if (ord($string[$i]) < 0x80) { - $n = 0; - } elseif ((ord($string[$i]) & 0xE0) === 0xC0) { - $n = 1; - } elseif ((ord($string[$i]) & 0xF0) === 0xE0) { - $n = 2; - } elseif ((ord($string[$i]) & 0xF0) === 0xF0) { - $n = 3; - } else { - return false; - } - - for ($j = 0; $j < $n; $j++) { - if ((++$i === $length) || ((ord($string[$i]) & 0xC0) !== 0x80)) { - return false; - } - } - } - - return true; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Xml/Exception.php b/vendor/phpunit/phpunit/src/Util/Xml/Exception.php deleted file mode 100644 index 09b73d8f..00000000 --- a/vendor/phpunit/phpunit/src/Util/Xml/Exception.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\Xml; - -use RuntimeException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Exception extends RuntimeException implements \PHPUnit\Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/Util/Xml/FailedSchemaDetectionResult.php b/vendor/phpunit/phpunit/src/Util/Xml/FailedSchemaDetectionResult.php deleted file mode 100644 index 0949f568..00000000 --- a/vendor/phpunit/phpunit/src/Util/Xml/FailedSchemaDetectionResult.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\Xml; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class FailedSchemaDetectionResult extends SchemaDetectionResult -{ -} diff --git a/vendor/phpunit/phpunit/src/Util/Xml/Loader.php b/vendor/phpunit/phpunit/src/Util/Xml/Loader.php deleted file mode 100644 index 8d43d327..00000000 --- a/vendor/phpunit/phpunit/src/Util/Xml/Loader.php +++ /dev/null @@ -1,117 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\Xml; - -use function chdir; -use function dirname; -use function error_reporting; -use function file_get_contents; -use function getcwd; -use function libxml_get_errors; -use function libxml_use_internal_errors; -use function sprintf; -use DOMDocument; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Loader -{ - /** - * @throws Exception - */ - public function loadFile(string $filename, bool $isHtml = false, bool $xinclude = false, bool $strict = false): DOMDocument - { - $reporting = error_reporting(0); - $contents = file_get_contents($filename); - - error_reporting($reporting); - - if ($contents === false) { - throw new Exception( - sprintf( - 'Could not read "%s".', - $filename - ) - ); - } - - return $this->load($contents, $isHtml, $filename, $xinclude, $strict); - } - - /** - * @throws Exception - */ - public function load(string $actual, bool $isHtml = false, string $filename = '', bool $xinclude = false, bool $strict = false): DOMDocument - { - if ($actual === '') { - throw new Exception('Could not load XML from empty string'); - } - - // Required for XInclude on Windows. - if ($xinclude) { - $cwd = getcwd(); - @chdir(dirname($filename)); - } - - $document = new DOMDocument; - $document->preserveWhiteSpace = false; - - $internal = libxml_use_internal_errors(true); - $message = ''; - $reporting = error_reporting(0); - - if ($filename !== '') { - // Required for XInclude - $document->documentURI = $filename; - } - - if ($isHtml) { - $loaded = $document->loadHTML($actual); - } else { - $loaded = $document->loadXML($actual); - } - - if (!$isHtml && $xinclude) { - $document->xinclude(); - } - - foreach (libxml_get_errors() as $error) { - $message .= "\n" . $error->message; - } - - libxml_use_internal_errors($internal); - error_reporting($reporting); - - if (isset($cwd)) { - @chdir($cwd); - } - - if ($loaded === false || ($strict && $message !== '')) { - if ($filename !== '') { - throw new Exception( - sprintf( - 'Could not load "%s".%s', - $filename, - $message !== '' ? "\n" . $message : '' - ) - ); - } - - if ($message === '') { - $message = 'Could not load XML for unknown reason'; - } - - throw new Exception($message); - } - - return $document; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Xml/SchemaDetectionResult.php b/vendor/phpunit/phpunit/src/Util/Xml/SchemaDetectionResult.php deleted file mode 100644 index 442aae49..00000000 --- a/vendor/phpunit/phpunit/src/Util/Xml/SchemaDetectionResult.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. - */ -namespace PHPUnit\Util\Xml; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -abstract class SchemaDetectionResult -{ - public function detected(): bool - { - return false; - } - - /** - * @throws Exception - */ - public function version(): string - { - throw new Exception('No supported schema was detected'); - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Xml/SchemaDetector.php b/vendor/phpunit/phpunit/src/Util/Xml/SchemaDetector.php deleted file mode 100644 index 5864695b..00000000 --- a/vendor/phpunit/phpunit/src/Util/Xml/SchemaDetector.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\Xml; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class SchemaDetector -{ - /** - * @throws Exception - */ - public function detect(string $filename): SchemaDetectionResult - { - $document = (new Loader)->loadFile( - $filename, - false, - true, - true - ); - - foreach (['9.2', '8.5'] as $candidate) { - $schema = (new SchemaFinder)->find($candidate); - - if (!(new Validator)->validate($document, $schema)->hasValidationErrors()) { - return new SuccessfulSchemaDetectionResult($candidate); - } - } - - return new FailedSchemaDetectionResult; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Xml/SchemaFinder.php b/vendor/phpunit/phpunit/src/Util/Xml/SchemaFinder.php deleted file mode 100644 index 1e7b73c5..00000000 --- a/vendor/phpunit/phpunit/src/Util/Xml/SchemaFinder.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 PHPUnit\Util\Xml; - -use function defined; -use function is_file; -use function sprintf; -use PHPUnit\Runner\Version; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class SchemaFinder -{ - /** - * @throws Exception - */ - public function find(string $version): string - { - if ($version === Version::series()) { - $filename = $this->path() . 'phpunit.xsd'; - } else { - $filename = $this->path() . 'schema/' . $version . '.xsd'; - } - - if (!is_file($filename)) { - throw new Exception( - sprintf( - 'Schema for PHPUnit %s is not available', - $version - ) - ); - } - - return $filename; - } - - private function path(): string - { - if (defined('__PHPUNIT_PHAR_ROOT__')) { - return __PHPUNIT_PHAR_ROOT__ . '/'; - } - - return __DIR__ . '/../../../'; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Xml/SnapshotNodeList.php b/vendor/phpunit/phpunit/src/Util/Xml/SnapshotNodeList.php deleted file mode 100644 index e383678d..00000000 --- a/vendor/phpunit/phpunit/src/Util/Xml/SnapshotNodeList.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 PHPUnit\Util\Xml; - -use function count; -use ArrayIterator; -use Countable; -use DOMNode; -use DOMNodeList; -use IteratorAggregate; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @template-implements IteratorAggregate - */ -final class SnapshotNodeList implements Countable, IteratorAggregate -{ - /** - * @var DOMNode[] - */ - private $nodes = []; - - public static function fromNodeList(DOMNodeList $list): self - { - $snapshot = new self; - - foreach ($list as $node) { - $snapshot->nodes[] = $node; - } - - return $snapshot; - } - - public function count(): int - { - return count($this->nodes); - } - - public function getIterator(): ArrayIterator - { - return new ArrayIterator($this->nodes); - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Xml/SuccessfulSchemaDetectionResult.php b/vendor/phpunit/phpunit/src/Util/Xml/SuccessfulSchemaDetectionResult.php deleted file mode 100644 index 8b517e29..00000000 --- a/vendor/phpunit/phpunit/src/Util/Xml/SuccessfulSchemaDetectionResult.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\Xml; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class SuccessfulSchemaDetectionResult extends SchemaDetectionResult -{ - /** - * @var string - */ - private $version; - - public function __construct(string $version) - { - $this->version = $version; - } - - public function detected(): bool - { - return true; - } - - public function version(): string - { - return $this->version; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Xml/ValidationResult.php b/vendor/phpunit/phpunit/src/Util/Xml/ValidationResult.php deleted file mode 100644 index 3292267b..00000000 --- a/vendor/phpunit/phpunit/src/Util/Xml/ValidationResult.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 PHPUnit\Util\Xml; - -use function sprintf; -use function trim; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class ValidationResult -{ - /** - * @psalm-var array> - */ - private $validationErrors = []; - - /** - * @psalm-param array $errors - */ - public static function fromArray(array $errors): self - { - $validationErrors = []; - - foreach ($errors as $error) { - if (!isset($validationErrors[$error->line])) { - $validationErrors[$error->line] = []; - } - - $validationErrors[$error->line][] = trim($error->message); - } - - return new self($validationErrors); - } - - private function __construct(array $validationErrors) - { - $this->validationErrors = $validationErrors; - } - - public function hasValidationErrors(): bool - { - return !empty($this->validationErrors); - } - - public function asString(): string - { - $buffer = ''; - - foreach ($this->validationErrors as $line => $validationErrorsOnLine) { - $buffer .= sprintf(PHP_EOL . ' Line %d:' . PHP_EOL, $line); - - foreach ($validationErrorsOnLine as $validationError) { - $buffer .= sprintf(' - %s' . PHP_EOL, $validationError); - } - } - - return $buffer; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Xml/Validator.php b/vendor/phpunit/phpunit/src/Util/Xml/Validator.php deleted file mode 100644 index b3c4e05b..00000000 --- a/vendor/phpunit/phpunit/src/Util/Xml/Validator.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\Xml; - -use function file_get_contents; -use function libxml_clear_errors; -use function libxml_get_errors; -use function libxml_use_internal_errors; -use DOMDocument; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Validator -{ - public function validate(DOMDocument $document, string $xsdFilename): ValidationResult - { - $originalErrorHandling = libxml_use_internal_errors(true); - - $document->schemaValidateSource(file_get_contents($xsdFilename)); - - $errors = libxml_get_errors(); - libxml_clear_errors(); - libxml_use_internal_errors($originalErrorHandling); - - return ValidationResult::fromArray($errors); - } -} diff --git a/vendor/phpunit/phpunit/src/Util/XmlTestListRenderer.php b/vendor/phpunit/phpunit/src/Util/XmlTestListRenderer.php deleted file mode 100644 index b16ef0b7..00000000 --- a/vendor/phpunit/phpunit/src/Util/XmlTestListRenderer.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 PHPUnit\Util; - -use function get_class; -use function implode; -use function str_replace; -use PHPUnit\Framework\TestCase; -use PHPUnit\Framework\TestSuite; -use PHPUnit\Runner\PhptTestCase; -use RecursiveIteratorIterator; -use XMLWriter; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class XmlTestListRenderer -{ - /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - */ - public function render(TestSuite $suite): string - { - $writer = new XMLWriter; - - $writer->openMemory(); - $writer->setIndent(true); - $writer->startDocument('1.0', 'UTF-8'); - $writer->startElement('tests'); - - $currentTestCase = null; - - foreach (new RecursiveIteratorIterator($suite->getIterator()) as $test) { - if ($test instanceof TestCase) { - if (get_class($test) !== $currentTestCase) { - if ($currentTestCase !== null) { - $writer->endElement(); - } - - $writer->startElement('testCaseClass'); - $writer->writeAttribute('name', get_class($test)); - - $currentTestCase = get_class($test); - } - - $writer->startElement('testCaseMethod'); - $writer->writeAttribute('name', $test->getName(false)); - $writer->writeAttribute('groups', implode(',', $test->getGroups())); - - if (!empty($test->getDataSetAsString(false))) { - $writer->writeAttribute( - 'dataSet', - str_replace( - ' with data set ', - '', - $test->getDataSetAsString(false) - ) - ); - } - - $writer->endElement(); - } elseif ($test instanceof PhptTestCase) { - if ($currentTestCase !== null) { - $writer->endElement(); - - $currentTestCase = null; - } - - $writer->startElement('phptFile'); - $writer->writeAttribute('path', $test->getName()); - $writer->endElement(); - } - } - - if ($currentTestCase !== null) { - $writer->endElement(); - } - - $writer->endElement(); - $writer->endDocument(); - - return $writer->outputMemory(); - } -} diff --git a/vendor/pimple/pimple/.github/workflows/tests.yml b/vendor/pimple/pimple/.github/workflows/tests.yml deleted file mode 100644 index 09b67600..00000000 --- a/vendor/pimple/pimple/.github/workflows/tests.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: "Tests" - -on: - - pull_request - - push - -jobs: - test: - name: PHP ${{ matrix.php }} - ${{ matrix.dependencies }} - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - php: - - "7.2" - - "7.3" - - "7.4" - - "8.0" - - "8.1" - dependencies: - - "psr/container:^1.1" - - "psr/container:^2.0" - - steps: - - name: Checkout Code - uses: actions/checkout@v2 - - - name: Setup PHP ${{ matrix.php }} - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - ini-values: display_errors=off, log_errors=on - extensions: :xdebug - env: - # https://github.com/shivammathur/setup-php/issues/407#issuecomment-773675741 - fail-fast: true - - - name: Validate composer.json - run: composer validate --strict --no-check-lock - - - name: Install dependencies +${{ matrix.dependencies }} - run: | - composer require --no-update ${{ matrix.dependencies }} - composer update --prefer-dist --no-progress - - - name: Run PHPUnit tests - run: vendor/bin/simple-phpunit --verbose diff --git a/vendor/pimple/pimple/.gitignore b/vendor/pimple/pimple/.gitignore deleted file mode 100644 index a5c7ed69..00000000 --- a/vendor/pimple/pimple/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -phpunit.xml -.phpunit.result.cache -composer.lock -/vendor/ diff --git a/vendor/pimple/pimple/.php_cs.dist b/vendor/pimple/pimple/.php_cs.dist deleted file mode 100644 index 2787bb40..00000000 --- a/vendor/pimple/pimple/.php_cs.dist +++ /dev/null @@ -1,20 +0,0 @@ -setRules([ - '@Symfony' => true, - '@Symfony:risky' => true, - '@PHPUnit75Migration:risky' => true, - 'php_unit_dedicate_assert' => true, - 'array_syntax' => ['syntax' => 'short'], - 'php_unit_fqcn_annotation' => true, - 'no_unreachable_default_argument_value' => false, - 'braces' => ['allow_single_line_closure' => true], - 'heredoc_to_nowdoc' => false, - 'ordered_imports' => true, - 'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'], - 'native_function_invocation' => ['include' => ['@compiler_optimized'], 'scope' => 'all'], - ]) - ->setRiskyAllowed(true) - ->setFinder(PhpCsFixer\Finder::create()->in(__DIR__.'/src')) -; diff --git a/vendor/pimple/pimple/CHANGELOG b/vendor/pimple/pimple/CHANGELOG deleted file mode 100644 index 08059e5e..00000000 --- a/vendor/pimple/pimple/CHANGELOG +++ /dev/null @@ -1,72 +0,0 @@ -* 3.4.0 (2021-03-06) - - * Implement version 1.1 of PSR-11 - -* 3.3.1 (2020-11-24) - - * Add support for PHP 8 - -* 3.3.0 (2020-03-03) - - * Drop PHP extension - * Bump min PHP version to 7.2.5 - -* 3.2.3 (2018-01-21) - - * prefixed all function calls with \ for extra speed - -* 3.2.2 (2017-07-23) - - * reverted extending a protected closure throws an exception (deprecated it instead) - -* 3.2.1 (2017-07-17) - - * fixed PHP error - -* 3.2.0 (2017-07-17) - - * added a PSR-11 service locator - * added a PSR-11 wrapper - * added ServiceIterator - * fixed extending a protected closure (now throws InvalidServiceIdentifierException) - -* 3.1.0 (2017-07-03) - - * deprecated the C extension - * added support for PSR-11 exceptions - -* 3.0.2 (2015-09-11) - - * refactored the C extension - * minor non-significant changes - -* 3.0.1 (2015-07-30) - - * simplified some code - * fixed a segfault in the C extension - -* 3.0.0 (2014-07-24) - - * removed the Pimple class alias (use Pimple\Container instead) - -* 2.1.1 (2014-07-24) - - * fixed compiler warnings for the C extension - * fixed code when dealing with circular references - -* 2.1.0 (2014-06-24) - - * moved the Pimple to Pimple\Container (with a BC layer -- Pimple is now a - deprecated alias which will be removed in Pimple 3.0) - * added Pimple\ServiceProviderInterface (and Pimple::register()) - -* 2.0.0 (2014-02-10) - - * changed extend to automatically re-assign the extended service and keep it as shared or factory - (to keep BC, extend still returns the extended service) - * changed services to be shared by default (use factory() for factory - services) - -* 1.0.0 - - * initial version diff --git a/vendor/pimple/pimple/LICENSE b/vendor/pimple/pimple/LICENSE deleted file mode 100644 index 3e2a9e1e..00000000 --- a/vendor/pimple/pimple/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2009-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/pimple/pimple/README.rst b/vendor/pimple/pimple/README.rst deleted file mode 100644 index 70818395..00000000 --- a/vendor/pimple/pimple/README.rst +++ /dev/null @@ -1,332 +0,0 @@ -Pimple -====== - -.. caution:: - - Pimple is now closed for changes. No new features will be added and no - cosmetic changes will be accepted either. The only accepted changes are - compatibility with newer PHP versions and security issue fixes. - -.. caution:: - - This is the documentation for Pimple 3.x. If you are using Pimple 1.x, read - the `Pimple 1.x documentation`_. Reading the Pimple 1.x code is also a good - way to learn more about how to create a simple Dependency Injection - Container (recent versions of Pimple are more focused on performance). - -Pimple is a small Dependency Injection Container for PHP. - -Installation ------------- - -Before using Pimple in your project, add it to your ``composer.json`` file: - -.. code-block:: bash - - $ ./composer.phar require pimple/pimple "^3.0" - -Usage ------ - -Creating a container is a matter of creating a ``Container`` instance: - -.. code-block:: php - - use Pimple\Container; - - $container = new Container(); - -As many other dependency injection containers, Pimple manages two different -kind of data: **services** and **parameters**. - -Defining Services -~~~~~~~~~~~~~~~~~ - -A service is an object that does something as part of a larger system. Examples -of services: a database connection, a templating engine, or a mailer. Almost -any **global** object can be a service. - -Services are defined by **anonymous functions** that return an instance of an -object: - -.. code-block:: php - - // define some services - $container['session_storage'] = function ($c) { - return new SessionStorage('SESSION_ID'); - }; - - $container['session'] = function ($c) { - return new Session($c['session_storage']); - }; - -Notice that the anonymous function has access to the current container -instance, allowing references to other services or parameters. - -As objects are only created when you get them, the order of the definitions -does not matter. - -Using the defined services is also very easy: - -.. code-block:: php - - // get the session object - $session = $container['session']; - - // the above call is roughly equivalent to the following code: - // $storage = new SessionStorage('SESSION_ID'); - // $session = new Session($storage); - -Defining Factory Services -~~~~~~~~~~~~~~~~~~~~~~~~~ - -By default, each time you get a service, Pimple returns the **same instance** -of it. If you want a different instance to be returned for all calls, wrap your -anonymous function with the ``factory()`` method - -.. code-block:: php - - $container['session'] = $container->factory(function ($c) { - return new Session($c['session_storage']); - }); - -Now, each call to ``$container['session']`` returns a new instance of the -session. - -Defining Parameters -~~~~~~~~~~~~~~~~~~~ - -Defining a parameter allows to ease the configuration of your container from -the outside and to store global values: - -.. code-block:: php - - // define some parameters - $container['cookie_name'] = 'SESSION_ID'; - $container['session_storage_class'] = 'SessionStorage'; - -If you change the ``session_storage`` service definition like below: - -.. code-block:: php - - $container['session_storage'] = function ($c) { - return new $c['session_storage_class']($c['cookie_name']); - }; - -You can now easily change the cookie name by overriding the -``cookie_name`` parameter instead of redefining the service -definition. - -Protecting Parameters -~~~~~~~~~~~~~~~~~~~~~ - -Because Pimple sees anonymous functions as service definitions, you need to -wrap anonymous functions with the ``protect()`` method to store them as -parameters: - -.. code-block:: php - - $container['random_func'] = $container->protect(function () { - return rand(); - }); - -Modifying Services after Definition -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -In some cases you may want to modify a service definition after it has been -defined. You can use the ``extend()`` method to define additional code to be -run on your service just after it is created: - -.. code-block:: php - - $container['session_storage'] = function ($c) { - return new $c['session_storage_class']($c['cookie_name']); - }; - - $container->extend('session_storage', function ($storage, $c) { - $storage->...(); - - return $storage; - }); - -The first argument is the name of the service to extend, the second a function -that gets access to the object instance and the container. - -Extending a Container -~~~~~~~~~~~~~~~~~~~~~ - -If you use the same libraries over and over, you might want to reuse some -services from one project to the next one; package your services into a -**provider** by implementing ``Pimple\ServiceProviderInterface``: - -.. code-block:: php - - use Pimple\Container; - - class FooProvider implements Pimple\ServiceProviderInterface - { - public function register(Container $pimple) - { - // register some services and parameters - // on $pimple - } - } - -Then, register the provider on a Container: - -.. code-block:: php - - $pimple->register(new FooProvider()); - -Fetching the Service Creation Function -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -When you access an object, Pimple automatically calls the anonymous function -that you defined, which creates the service object for you. If you want to get -raw access to this function, you can use the ``raw()`` method: - -.. code-block:: php - - $container['session'] = function ($c) { - return new Session($c['session_storage']); - }; - - $sessionFunction = $container->raw('session'); - -PSR-11 compatibility --------------------- - -For historical reasons, the ``Container`` class does not implement the PSR-11 -``ContainerInterface``. However, Pimple provides a helper class that will let -you decouple your code from the Pimple container class. - -The PSR-11 container class -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The ``Pimple\Psr11\Container`` class lets you access the content of an -underlying Pimple container using ``Psr\Container\ContainerInterface`` -methods: - -.. code-block:: php - - use Pimple\Container; - use Pimple\Psr11\Container as PsrContainer; - - $container = new Container(); - $container['service'] = function ($c) { - return new Service(); - }; - $psr11 = new PsrContainer($container); - - $controller = function (PsrContainer $container) { - $service = $container->get('service'); - }; - $controller($psr11); - -Using the PSR-11 ServiceLocator -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Sometimes, a service needs access to several other services without being sure -that all of them will actually be used. In those cases, you may want the -instantiation of the services to be lazy. - -The traditional solution is to inject the entire service container to get only -the services really needed. However, this is not recommended because it gives -services a too broad access to the rest of the application and it hides their -actual dependencies. - -The ``ServiceLocator`` is intended to solve this problem by giving access to a -set of predefined services while instantiating them only when actually needed. - -It also allows you to make your services available under a different name than -the one used to register them. For instance, you may want to use an object -that expects an instance of ``EventDispatcherInterface`` to be available under -the name ``event_dispatcher`` while your event dispatcher has been -registered under the name ``dispatcher``: - -.. code-block:: php - - use Monolog\Logger; - use Pimple\Psr11\ServiceLocator; - use Psr\Container\ContainerInterface; - use Symfony\Component\EventDispatcher\EventDispatcher; - - class MyService - { - /** - * "logger" must be an instance of Psr\Log\LoggerInterface - * "event_dispatcher" must be an instance of Symfony\Component\EventDispatcher\EventDispatcherInterface - */ - private $services; - - public function __construct(ContainerInterface $services) - { - $this->services = $services; - } - } - - $container['logger'] = function ($c) { - return new Monolog\Logger(); - }; - $container['dispatcher'] = function () { - return new EventDispatcher(); - }; - - $container['service'] = function ($c) { - $locator = new ServiceLocator($c, array('logger', 'event_dispatcher' => 'dispatcher')); - - return new MyService($locator); - }; - -Referencing a Collection of Services Lazily -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Passing a collection of services instances in an array may prove inefficient -if the class that consumes the collection only needs to iterate over it at a -later stage, when one of its method is called. It can also lead to problems -if there is a circular dependency between one of the services stored in the -collection and the class that consumes it. - -The ``ServiceIterator`` class helps you solve these issues. It receives a -list of service names during instantiation and will retrieve the services -when iterated over: - -.. code-block:: php - - use Pimple\Container; - use Pimple\ServiceIterator; - - class AuthorizationService - { - private $voters; - - public function __construct($voters) - { - $this->voters = $voters; - } - - public function canAccess($resource) - { - foreach ($this->voters as $voter) { - if (true === $voter->canAccess($resource)) { - return true; - } - } - - return false; - } - } - - $container = new Container(); - - $container['voter1'] = function ($c) { - return new SomeVoter(); - } - $container['voter2'] = function ($c) { - return new SomeOtherVoter($c['auth']); - } - $container['auth'] = function ($c) { - return new AuthorizationService(new ServiceIterator($c, array('voter1', 'voter2')); - } - -.. _Pimple 1.x documentation: https://github.com/silexphp/Pimple/tree/1.1 diff --git a/vendor/pimple/pimple/composer.json b/vendor/pimple/pimple/composer.json deleted file mode 100644 index ca6a5819..00000000 --- a/vendor/pimple/pimple/composer.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "pimple/pimple", - "type": "library", - "description": "Pimple, a simple Dependency Injection Container", - "keywords": ["dependency injection", "container"], - "homepage": "https://pimple.symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "require": { - "php": ">=7.2.5", - "psr/container": "^1.1 || ^2.0" - }, - "require-dev": { - "symfony/phpunit-bridge": "^5.4@dev" - }, - "autoload": { - "psr-0": { "Pimple": "src/" } - }, - "extra": { - "branch-alias": { - "dev-master": "3.4.x-dev" - } - } -} diff --git a/vendor/pimple/pimple/phpunit.xml.dist b/vendor/pimple/pimple/phpunit.xml.dist deleted file mode 100644 index 89902022..00000000 --- a/vendor/pimple/pimple/phpunit.xml.dist +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - ./src/Pimple/Tests - - - - - - - diff --git a/vendor/pimple/pimple/src/Pimple/Container.php b/vendor/pimple/pimple/src/Pimple/Container.php deleted file mode 100644 index 586a0b77..00000000 --- a/vendor/pimple/pimple/src/Pimple/Container.php +++ /dev/null @@ -1,305 +0,0 @@ -factories = new \SplObjectStorage(); - $this->protected = new \SplObjectStorage(); - - foreach ($values as $key => $value) { - $this->offsetSet($key, $value); - } - } - - /** - * Sets a parameter or an object. - * - * Objects must be defined as Closures. - * - * Allowing any PHP callable leads to difficult to debug problems - * as function names (strings) are callable (creating a function with - * the same name as an existing parameter would break your container). - * - * @param string $id The unique identifier for the parameter or object - * @param mixed $value The value of the parameter or a closure to define an object - * - * @return void - * - * @throws FrozenServiceException Prevent override of a frozen service - */ - #[\ReturnTypeWillChange] - public function offsetSet($id, $value) - { - if (isset($this->frozen[$id])) { - throw new FrozenServiceException($id); - } - - $this->values[$id] = $value; - $this->keys[$id] = true; - } - - /** - * Gets a parameter or an object. - * - * @param string $id The unique identifier for the parameter or object - * - * @return mixed The value of the parameter or an object - * - * @throws UnknownIdentifierException If the identifier is not defined - */ - #[\ReturnTypeWillChange] - public function offsetGet($id) - { - if (!isset($this->keys[$id])) { - throw new UnknownIdentifierException($id); - } - - if ( - isset($this->raw[$id]) - || !\is_object($this->values[$id]) - || isset($this->protected[$this->values[$id]]) - || !\method_exists($this->values[$id], '__invoke') - ) { - return $this->values[$id]; - } - - if (isset($this->factories[$this->values[$id]])) { - return $this->values[$id]($this); - } - - $raw = $this->values[$id]; - $val = $this->values[$id] = $raw($this); - $this->raw[$id] = $raw; - - $this->frozen[$id] = true; - - return $val; - } - - /** - * Checks if a parameter or an object is set. - * - * @param string $id The unique identifier for the parameter or object - * - * @return bool - */ - #[\ReturnTypeWillChange] - public function offsetExists($id) - { - return isset($this->keys[$id]); - } - - /** - * Unsets a parameter or an object. - * - * @param string $id The unique identifier for the parameter or object - * - * @return void - */ - #[\ReturnTypeWillChange] - public function offsetUnset($id) - { - if (isset($this->keys[$id])) { - if (\is_object($this->values[$id])) { - unset($this->factories[$this->values[$id]], $this->protected[$this->values[$id]]); - } - - unset($this->values[$id], $this->frozen[$id], $this->raw[$id], $this->keys[$id]); - } - } - - /** - * Marks a callable as being a factory service. - * - * @param callable $callable A service definition to be used as a factory - * - * @return callable The passed callable - * - * @throws ExpectedInvokableException Service definition has to be a closure or an invokable object - */ - public function factory($callable) - { - if (!\is_object($callable) || !\method_exists($callable, '__invoke')) { - throw new ExpectedInvokableException('Service definition is not a Closure or invokable object.'); - } - - $this->factories->attach($callable); - - return $callable; - } - - /** - * Protects a callable from being interpreted as a service. - * - * This is useful when you want to store a callable as a parameter. - * - * @param callable $callable A callable to protect from being evaluated - * - * @return callable The passed callable - * - * @throws ExpectedInvokableException Service definition has to be a closure or an invokable object - */ - public function protect($callable) - { - if (!\is_object($callable) || !\method_exists($callable, '__invoke')) { - throw new ExpectedInvokableException('Callable is not a Closure or invokable object.'); - } - - $this->protected->attach($callable); - - return $callable; - } - - /** - * Gets a parameter or the closure defining an object. - * - * @param string $id The unique identifier for the parameter or object - * - * @return mixed The value of the parameter or the closure defining an object - * - * @throws UnknownIdentifierException If the identifier is not defined - */ - public function raw($id) - { - if (!isset($this->keys[$id])) { - throw new UnknownIdentifierException($id); - } - - if (isset($this->raw[$id])) { - return $this->raw[$id]; - } - - return $this->values[$id]; - } - - /** - * Extends an object definition. - * - * Useful when you want to extend an existing object definition, - * without necessarily loading that object. - * - * @param string $id The unique identifier for the object - * @param callable $callable A service definition to extend the original - * - * @return callable The wrapped callable - * - * @throws UnknownIdentifierException If the identifier is not defined - * @throws FrozenServiceException If the service is frozen - * @throws InvalidServiceIdentifierException If the identifier belongs to a parameter - * @throws ExpectedInvokableException If the extension callable is not a closure or an invokable object - */ - public function extend($id, $callable) - { - if (!isset($this->keys[$id])) { - throw new UnknownIdentifierException($id); - } - - if (isset($this->frozen[$id])) { - throw new FrozenServiceException($id); - } - - if (!\is_object($this->values[$id]) || !\method_exists($this->values[$id], '__invoke')) { - throw new InvalidServiceIdentifierException($id); - } - - if (isset($this->protected[$this->values[$id]])) { - @\trigger_error(\sprintf('How Pimple behaves when extending protected closures will be fixed in Pimple 4. Are you sure "%s" should be protected?', $id), E_USER_DEPRECATED); - } - - if (!\is_object($callable) || !\method_exists($callable, '__invoke')) { - throw new ExpectedInvokableException('Extension service definition is not a Closure or invokable object.'); - } - - $factory = $this->values[$id]; - - $extended = function ($c) use ($callable, $factory) { - return $callable($factory($c), $c); - }; - - if (isset($this->factories[$factory])) { - $this->factories->detach($factory); - $this->factories->attach($extended); - } - - return $this[$id] = $extended; - } - - /** - * Returns all defined value names. - * - * @return array An array of value names - */ - public function keys() - { - return \array_keys($this->values); - } - - /** - * Registers a service provider. - * - * @param array $values An array of values that customizes the provider - * - * @return static - */ - public function register(ServiceProviderInterface $provider, array $values = []) - { - $provider->register($this); - - foreach ($values as $key => $value) { - $this[$key] = $value; - } - - return $this; - } -} diff --git a/vendor/pimple/pimple/src/Pimple/Exception/ExpectedInvokableException.php b/vendor/pimple/pimple/src/Pimple/Exception/ExpectedInvokableException.php deleted file mode 100644 index 7228421b..00000000 --- a/vendor/pimple/pimple/src/Pimple/Exception/ExpectedInvokableException.php +++ /dev/null @@ -1,38 +0,0 @@ - - */ -class ExpectedInvokableException extends \InvalidArgumentException implements ContainerExceptionInterface -{ -} diff --git a/vendor/pimple/pimple/src/Pimple/Exception/FrozenServiceException.php b/vendor/pimple/pimple/src/Pimple/Exception/FrozenServiceException.php deleted file mode 100644 index e4d2f6d3..00000000 --- a/vendor/pimple/pimple/src/Pimple/Exception/FrozenServiceException.php +++ /dev/null @@ -1,45 +0,0 @@ - - */ -class FrozenServiceException extends \RuntimeException implements ContainerExceptionInterface -{ - /** - * @param string $id Identifier of the frozen service - */ - public function __construct($id) - { - parent::__construct(\sprintf('Cannot override frozen service "%s".', $id)); - } -} diff --git a/vendor/pimple/pimple/src/Pimple/Exception/InvalidServiceIdentifierException.php b/vendor/pimple/pimple/src/Pimple/Exception/InvalidServiceIdentifierException.php deleted file mode 100644 index 91e82f98..00000000 --- a/vendor/pimple/pimple/src/Pimple/Exception/InvalidServiceIdentifierException.php +++ /dev/null @@ -1,45 +0,0 @@ - - */ -class InvalidServiceIdentifierException extends \InvalidArgumentException implements NotFoundExceptionInterface -{ - /** - * @param string $id The invalid identifier - */ - public function __construct($id) - { - parent::__construct(\sprintf('Identifier "%s" does not contain an object definition.', $id)); - } -} diff --git a/vendor/pimple/pimple/src/Pimple/Exception/UnknownIdentifierException.php b/vendor/pimple/pimple/src/Pimple/Exception/UnknownIdentifierException.php deleted file mode 100644 index fb6b626e..00000000 --- a/vendor/pimple/pimple/src/Pimple/Exception/UnknownIdentifierException.php +++ /dev/null @@ -1,45 +0,0 @@ - - */ -class UnknownIdentifierException extends \InvalidArgumentException implements NotFoundExceptionInterface -{ - /** - * @param string $id The unknown identifier - */ - public function __construct($id) - { - parent::__construct(\sprintf('Identifier "%s" is not defined.', $id)); - } -} diff --git a/vendor/pimple/pimple/src/Pimple/Psr11/Container.php b/vendor/pimple/pimple/src/Pimple/Psr11/Container.php deleted file mode 100644 index e18592eb..00000000 --- a/vendor/pimple/pimple/src/Pimple/Psr11/Container.php +++ /dev/null @@ -1,55 +0,0 @@ - - */ -final class Container implements ContainerInterface -{ - private $pimple; - - public function __construct(PimpleContainer $pimple) - { - $this->pimple = $pimple; - } - - public function get(string $id) - { - return $this->pimple[$id]; - } - - public function has(string $id): bool - { - return isset($this->pimple[$id]); - } -} diff --git a/vendor/pimple/pimple/src/Pimple/Psr11/ServiceLocator.php b/vendor/pimple/pimple/src/Pimple/Psr11/ServiceLocator.php deleted file mode 100644 index 714b8826..00000000 --- a/vendor/pimple/pimple/src/Pimple/Psr11/ServiceLocator.php +++ /dev/null @@ -1,75 +0,0 @@ - - */ -class ServiceLocator implements ContainerInterface -{ - private $container; - private $aliases = []; - - /** - * @param PimpleContainer $container The Container instance used to locate services - * @param array $ids Array of service ids that can be located. String keys can be used to define aliases - */ - public function __construct(PimpleContainer $container, array $ids) - { - $this->container = $container; - - foreach ($ids as $key => $id) { - $this->aliases[\is_int($key) ? $id : $key] = $id; - } - } - - /** - * {@inheritdoc} - */ - public function get(string $id) - { - if (!isset($this->aliases[$id])) { - throw new UnknownIdentifierException($id); - } - - return $this->container[$this->aliases[$id]]; - } - - /** - * {@inheritdoc} - */ - public function has(string $id): bool - { - return isset($this->aliases[$id]) && isset($this->container[$this->aliases[$id]]); - } -} diff --git a/vendor/pimple/pimple/src/Pimple/ServiceIterator.php b/vendor/pimple/pimple/src/Pimple/ServiceIterator.php deleted file mode 100644 index ebafac16..00000000 --- a/vendor/pimple/pimple/src/Pimple/ServiceIterator.php +++ /dev/null @@ -1,89 +0,0 @@ - - */ -final class ServiceIterator implements \Iterator -{ - private $container; - private $ids; - - public function __construct(Container $container, array $ids) - { - $this->container = $container; - $this->ids = $ids; - } - - /** - * @return void - */ - #[\ReturnTypeWillChange] - public function rewind() - { - \reset($this->ids); - } - - /** - * @return mixed - */ - #[\ReturnTypeWillChange] - public function current() - { - return $this->container[\current($this->ids)]; - } - - /** - * @return mixed - */ - #[\ReturnTypeWillChange] - public function key() - { - return \current($this->ids); - } - - /** - * @return void - */ - #[\ReturnTypeWillChange] - public function next() - { - \next($this->ids); - } - - /** - * @return bool - */ - #[\ReturnTypeWillChange] - public function valid() - { - return null !== \key($this->ids); - } -} diff --git a/vendor/pimple/pimple/src/Pimple/ServiceProviderInterface.php b/vendor/pimple/pimple/src/Pimple/ServiceProviderInterface.php deleted file mode 100644 index abf90d82..00000000 --- a/vendor/pimple/pimple/src/Pimple/ServiceProviderInterface.php +++ /dev/null @@ -1,44 +0,0 @@ -value = $value; - - return $service; - } -} diff --git a/vendor/pimple/pimple/src/Pimple/Tests/Fixtures/NonInvokable.php b/vendor/pimple/pimple/src/Pimple/Tests/Fixtures/NonInvokable.php deleted file mode 100644 index 33cd4e54..00000000 --- a/vendor/pimple/pimple/src/Pimple/Tests/Fixtures/NonInvokable.php +++ /dev/null @@ -1,34 +0,0 @@ -factory(function () { - return new Service(); - }); - } -} diff --git a/vendor/pimple/pimple/src/Pimple/Tests/Fixtures/Service.php b/vendor/pimple/pimple/src/Pimple/Tests/Fixtures/Service.php deleted file mode 100644 index d71b184d..00000000 --- a/vendor/pimple/pimple/src/Pimple/Tests/Fixtures/Service.php +++ /dev/null @@ -1,35 +0,0 @@ - - */ -class Service -{ - public $value; -} diff --git a/vendor/pimple/pimple/src/Pimple/Tests/PimpleServiceProviderInterfaceTest.php b/vendor/pimple/pimple/src/Pimple/Tests/PimpleServiceProviderInterfaceTest.php deleted file mode 100644 index 097a7fd9..00000000 --- a/vendor/pimple/pimple/src/Pimple/Tests/PimpleServiceProviderInterfaceTest.php +++ /dev/null @@ -1,77 +0,0 @@ - - */ -class PimpleServiceProviderInterfaceTest extends TestCase -{ - public function testProvider() - { - $pimple = new Container(); - - $pimpleServiceProvider = new Fixtures\PimpleServiceProvider(); - $pimpleServiceProvider->register($pimple); - - $this->assertEquals('value', $pimple['param']); - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $pimple['service']); - - $serviceOne = $pimple['factory']; - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceOne); - - $serviceTwo = $pimple['factory']; - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceTwo); - - $this->assertNotSame($serviceOne, $serviceTwo); - } - - public function testProviderWithRegisterMethod() - { - $pimple = new Container(); - - $pimple->register(new Fixtures\PimpleServiceProvider(), [ - 'anotherParameter' => 'anotherValue', - ]); - - $this->assertEquals('value', $pimple['param']); - $this->assertEquals('anotherValue', $pimple['anotherParameter']); - - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $pimple['service']); - - $serviceOne = $pimple['factory']; - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceOne); - - $serviceTwo = $pimple['factory']; - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceTwo); - - $this->assertNotSame($serviceOne, $serviceTwo); - } -} diff --git a/vendor/pimple/pimple/src/Pimple/Tests/PimpleTest.php b/vendor/pimple/pimple/src/Pimple/Tests/PimpleTest.php deleted file mode 100644 index ffa50a6a..00000000 --- a/vendor/pimple/pimple/src/Pimple/Tests/PimpleTest.php +++ /dev/null @@ -1,610 +0,0 @@ - - */ -class PimpleTest extends TestCase -{ - public function testWithString() - { - $pimple = new Container(); - $pimple['param'] = 'value'; - - $this->assertEquals('value', $pimple['param']); - } - - public function testWithClosure() - { - $pimple = new Container(); - $pimple['service'] = function () { - return new Fixtures\Service(); - }; - - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $pimple['service']); - } - - public function testServicesShouldBeDifferent() - { - $pimple = new Container(); - $pimple['service'] = $pimple->factory(function () { - return new Fixtures\Service(); - }); - - $serviceOne = $pimple['service']; - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceOne); - - $serviceTwo = $pimple['service']; - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceTwo); - - $this->assertNotSame($serviceOne, $serviceTwo); - } - - public function testShouldPassContainerAsParameter() - { - $pimple = new Container(); - $pimple['service'] = function () { - return new Fixtures\Service(); - }; - $pimple['container'] = function ($container) { - return $container; - }; - - $this->assertNotSame($pimple, $pimple['service']); - $this->assertSame($pimple, $pimple['container']); - } - - public function testIsset() - { - $pimple = new Container(); - $pimple['param'] = 'value'; - $pimple['service'] = function () { - return new Fixtures\Service(); - }; - - $pimple['null'] = null; - - $this->assertTrue(isset($pimple['param'])); - $this->assertTrue(isset($pimple['service'])); - $this->assertTrue(isset($pimple['null'])); - $this->assertFalse(isset($pimple['non_existent'])); - } - - public function testConstructorInjection() - { - $params = ['param' => 'value']; - $pimple = new Container($params); - - $this->assertSame($params['param'], $pimple['param']); - } - - public function testOffsetGetValidatesKeyIsPresent() - { - $this->expectException(\Pimple\Exception\UnknownIdentifierException::class); - $this->expectExceptionMessage('Identifier "foo" is not defined.'); - - $pimple = new Container(); - echo $pimple['foo']; - } - - /** - * @group legacy - */ - public function testLegacyOffsetGetValidatesKeyIsPresent() - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Identifier "foo" is not defined.'); - - $pimple = new Container(); - echo $pimple['foo']; - } - - public function testOffsetGetHonorsNullValues() - { - $pimple = new Container(); - $pimple['foo'] = null; - $this->assertNull($pimple['foo']); - } - - public function testUnset() - { - $pimple = new Container(); - $pimple['param'] = 'value'; - $pimple['service'] = function () { - return new Fixtures\Service(); - }; - - unset($pimple['param'], $pimple['service']); - $this->assertFalse(isset($pimple['param'])); - $this->assertFalse(isset($pimple['service'])); - } - - /** - * @dataProvider serviceDefinitionProvider - */ - public function testShare($service) - { - $pimple = new Container(); - $pimple['shared_service'] = $service; - - $serviceOne = $pimple['shared_service']; - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceOne); - - $serviceTwo = $pimple['shared_service']; - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceTwo); - - $this->assertSame($serviceOne, $serviceTwo); - } - - /** - * @dataProvider serviceDefinitionProvider - */ - public function testProtect($service) - { - $pimple = new Container(); - $pimple['protected'] = $pimple->protect($service); - - $this->assertSame($service, $pimple['protected']); - } - - public function testGlobalFunctionNameAsParameterValue() - { - $pimple = new Container(); - $pimple['global_function'] = 'strlen'; - $this->assertSame('strlen', $pimple['global_function']); - } - - public function testRaw() - { - $pimple = new Container(); - $pimple['service'] = $definition = $pimple->factory(function () { - return 'foo'; - }); - $this->assertSame($definition, $pimple->raw('service')); - } - - public function testRawHonorsNullValues() - { - $pimple = new Container(); - $pimple['foo'] = null; - $this->assertNull($pimple->raw('foo')); - } - - public function testFluentRegister() - { - $pimple = new Container(); - $this->assertSame($pimple, $pimple->register($this->getMockBuilder('Pimple\ServiceProviderInterface')->getMock())); - } - - public function testRawValidatesKeyIsPresent() - { - $this->expectException(\Pimple\Exception\UnknownIdentifierException::class); - $this->expectExceptionMessage('Identifier "foo" is not defined.'); - - $pimple = new Container(); - $pimple->raw('foo'); - } - - /** - * @group legacy - */ - public function testLegacyRawValidatesKeyIsPresent() - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Identifier "foo" is not defined.'); - - $pimple = new Container(); - $pimple->raw('foo'); - } - - /** - * @dataProvider serviceDefinitionProvider - */ - public function testExtend($service) - { - $pimple = new Container(); - $pimple['shared_service'] = function () { - return new Fixtures\Service(); - }; - $pimple['factory_service'] = $pimple->factory(function () { - return new Fixtures\Service(); - }); - - $pimple->extend('shared_service', $service); - $serviceOne = $pimple['shared_service']; - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceOne); - $serviceTwo = $pimple['shared_service']; - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceTwo); - $this->assertSame($serviceOne, $serviceTwo); - $this->assertSame($serviceOne->value, $serviceTwo->value); - - $pimple->extend('factory_service', $service); - $serviceOne = $pimple['factory_service']; - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceOne); - $serviceTwo = $pimple['factory_service']; - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceTwo); - $this->assertNotSame($serviceOne, $serviceTwo); - $this->assertNotSame($serviceOne->value, $serviceTwo->value); - } - - public function testExtendDoesNotLeakWithFactories() - { - if (\extension_loaded('pimple')) { - $this->markTestSkipped('Pimple extension does not support this test'); - } - $pimple = new Container(); - - $pimple['foo'] = $pimple->factory(function () { - return; - }); - $pimple['foo'] = $pimple->extend('foo', function ($foo, $pimple) { - return; - }); - unset($pimple['foo']); - - $p = new \ReflectionProperty($pimple, 'values'); - $p->setAccessible(true); - $this->assertEmpty($p->getValue($pimple)); - - $p = new \ReflectionProperty($pimple, 'factories'); - $p->setAccessible(true); - $this->assertCount(0, $p->getValue($pimple)); - } - - public function testExtendValidatesKeyIsPresent() - { - $this->expectException(\Pimple\Exception\UnknownIdentifierException::class); - $this->expectExceptionMessage('Identifier "foo" is not defined.'); - - $pimple = new Container(); - $pimple->extend('foo', function () { - }); - } - - /** - * @group legacy - */ - public function testLegacyExtendValidatesKeyIsPresent() - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Identifier "foo" is not defined.'); - - $pimple = new Container(); - $pimple->extend('foo', function () { - }); - } - - public function testKeys() - { - $pimple = new Container(); - $pimple['foo'] = 123; - $pimple['bar'] = 123; - - $this->assertEquals(['foo', 'bar'], $pimple->keys()); - } - - /** @test */ - public function settingAnInvokableObjectShouldTreatItAsFactory() - { - $pimple = new Container(); - $pimple['invokable'] = new Fixtures\Invokable(); - - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $pimple['invokable']); - } - - /** @test */ - public function settingNonInvokableObjectShouldTreatItAsParameter() - { - $pimple = new Container(); - $pimple['non_invokable'] = new Fixtures\NonInvokable(); - - $this->assertInstanceOf('Pimple\Tests\Fixtures\NonInvokable', $pimple['non_invokable']); - } - - /** - * @dataProvider badServiceDefinitionProvider - */ - public function testFactoryFailsForInvalidServiceDefinitions($service) - { - $this->expectException(\Pimple\Exception\ExpectedInvokableException::class); - $this->expectExceptionMessage('Service definition is not a Closure or invokable object.'); - - $pimple = new Container(); - $pimple->factory($service); - } - - /** - * @group legacy - * @dataProvider badServiceDefinitionProvider - */ - public function testLegacyFactoryFailsForInvalidServiceDefinitions($service) - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Service definition is not a Closure or invokable object.'); - - $pimple = new Container(); - $pimple->factory($service); - } - - /** - * @dataProvider badServiceDefinitionProvider - */ - public function testProtectFailsForInvalidServiceDefinitions($service) - { - $this->expectException(\Pimple\Exception\ExpectedInvokableException::class); - $this->expectExceptionMessage('Callable is not a Closure or invokable object.'); - - $pimple = new Container(); - $pimple->protect($service); - } - - /** - * @group legacy - * @dataProvider badServiceDefinitionProvider - */ - public function testLegacyProtectFailsForInvalidServiceDefinitions($service) - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Callable is not a Closure or invokable object.'); - - $pimple = new Container(); - $pimple->protect($service); - } - - /** - * @dataProvider badServiceDefinitionProvider - */ - public function testExtendFailsForKeysNotContainingServiceDefinitions($service) - { - $this->expectException(\Pimple\Exception\InvalidServiceIdentifierException::class); - $this->expectExceptionMessage('Identifier "foo" does not contain an object definition.'); - - $pimple = new Container(); - $pimple['foo'] = $service; - $pimple->extend('foo', function () { - }); - } - - /** - * @group legacy - * @dataProvider badServiceDefinitionProvider - */ - public function testLegacyExtendFailsForKeysNotContainingServiceDefinitions($service) - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Identifier "foo" does not contain an object definition.'); - - $pimple = new Container(); - $pimple['foo'] = $service; - $pimple->extend('foo', function () { - }); - } - - /** - * @group legacy - * @expectedDeprecation How Pimple behaves when extending protected closures will be fixed in Pimple 4. Are you sure "foo" should be protected? - */ - public function testExtendingProtectedClosureDeprecation() - { - $pimple = new Container(); - $pimple['foo'] = $pimple->protect(function () { - return 'bar'; - }); - - $pimple->extend('foo', function ($value) { - return $value.'-baz'; - }); - - $this->assertSame('bar-baz', $pimple['foo']); - } - - /** - * @dataProvider badServiceDefinitionProvider - */ - public function testExtendFailsForInvalidServiceDefinitions($service) - { - $this->expectException(\Pimple\Exception\ExpectedInvokableException::class); - $this->expectExceptionMessage('Extension service definition is not a Closure or invokable object.'); - - $pimple = new Container(); - $pimple['foo'] = function () { - }; - $pimple->extend('foo', $service); - } - - /** - * @group legacy - * @dataProvider badServiceDefinitionProvider - */ - public function testLegacyExtendFailsForInvalidServiceDefinitions($service) - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Extension service definition is not a Closure or invokable object.'); - - $pimple = new Container(); - $pimple['foo'] = function () { - }; - $pimple->extend('foo', $service); - } - - public function testExtendFailsIfFrozenServiceIsNonInvokable() - { - $this->expectException(\Pimple\Exception\FrozenServiceException::class); - $this->expectExceptionMessage('Cannot override frozen service "foo".'); - - $pimple = new Container(); - $pimple['foo'] = function () { - return new Fixtures\NonInvokable(); - }; - $foo = $pimple['foo']; - - $pimple->extend('foo', function () { - }); - } - - public function testExtendFailsIfFrozenServiceIsInvokable() - { - $this->expectException(\Pimple\Exception\FrozenServiceException::class); - $this->expectExceptionMessage('Cannot override frozen service "foo".'); - - $pimple = new Container(); - $pimple['foo'] = function () { - return new Fixtures\Invokable(); - }; - $foo = $pimple['foo']; - - $pimple->extend('foo', function () { - }); - } - - /** - * Provider for invalid service definitions. - */ - public function badServiceDefinitionProvider() - { - return [ - [123], - [new Fixtures\NonInvokable()], - ]; - } - - /** - * Provider for service definitions. - */ - public function serviceDefinitionProvider() - { - return [ - [function ($value) { - $service = new Fixtures\Service(); - $service->value = $value; - - return $service; - }], - [new Fixtures\Invokable()], - ]; - } - - public function testDefiningNewServiceAfterFreeze() - { - $pimple = new Container(); - $pimple['foo'] = function () { - return 'foo'; - }; - $foo = $pimple['foo']; - - $pimple['bar'] = function () { - return 'bar'; - }; - $this->assertSame('bar', $pimple['bar']); - } - - public function testOverridingServiceAfterFreeze() - { - $this->expectException(\Pimple\Exception\FrozenServiceException::class); - $this->expectExceptionMessage('Cannot override frozen service "foo".'); - - $pimple = new Container(); - $pimple['foo'] = function () { - return 'foo'; - }; - $foo = $pimple['foo']; - - $pimple['foo'] = function () { - return 'bar'; - }; - } - - /** - * @group legacy - */ - public function testLegacyOverridingServiceAfterFreeze() - { - $this->expectException(\RuntimeException::class); - $this->expectExceptionMessage('Cannot override frozen service "foo".'); - - $pimple = new Container(); - $pimple['foo'] = function () { - return 'foo'; - }; - $foo = $pimple['foo']; - - $pimple['foo'] = function () { - return 'bar'; - }; - } - - public function testRemovingServiceAfterFreeze() - { - $pimple = new Container(); - $pimple['foo'] = function () { - return 'foo'; - }; - $foo = $pimple['foo']; - - unset($pimple['foo']); - $pimple['foo'] = function () { - return 'bar'; - }; - $this->assertSame('bar', $pimple['foo']); - } - - public function testExtendingService() - { - $pimple = new Container(); - $pimple['foo'] = function () { - return 'foo'; - }; - $pimple['foo'] = $pimple->extend('foo', function ($foo, $app) { - return "$foo.bar"; - }); - $pimple['foo'] = $pimple->extend('foo', function ($foo, $app) { - return "$foo.baz"; - }); - $this->assertSame('foo.bar.baz', $pimple['foo']); - } - - public function testExtendingServiceAfterOtherServiceFreeze() - { - $pimple = new Container(); - $pimple['foo'] = function () { - return 'foo'; - }; - $pimple['bar'] = function () { - return 'bar'; - }; - $foo = $pimple['foo']; - - $pimple['bar'] = $pimple->extend('bar', function ($bar, $app) { - return "$bar.baz"; - }); - $this->assertSame('bar.baz', $pimple['bar']); - } -} diff --git a/vendor/pimple/pimple/src/Pimple/Tests/Psr11/ContainerTest.php b/vendor/pimple/pimple/src/Pimple/Tests/Psr11/ContainerTest.php deleted file mode 100644 index d47b9c3f..00000000 --- a/vendor/pimple/pimple/src/Pimple/Tests/Psr11/ContainerTest.php +++ /dev/null @@ -1,76 +0,0 @@ -assertSame($pimple['service'], $psr->get('service')); - } - - public function testGetThrowsExceptionIfServiceIsNotFound() - { - $this->expectException(\Psr\Container\NotFoundExceptionInterface::class); - $this->expectExceptionMessage('Identifier "service" is not defined.'); - - $pimple = new Container(); - $psr = new PsrContainer($pimple); - - $psr->get('service'); - } - - public function testHasReturnsTrueIfServiceExists() - { - $pimple = new Container(); - $pimple['service'] = function () { - return new Service(); - }; - $psr = new PsrContainer($pimple); - - $this->assertTrue($psr->has('service')); - } - - public function testHasReturnsFalseIfServiceDoesNotExist() - { - $pimple = new Container(); - $psr = new PsrContainer($pimple); - - $this->assertFalse($psr->has('service')); - } -} diff --git a/vendor/pimple/pimple/src/Pimple/Tests/Psr11/ServiceLocatorTest.php b/vendor/pimple/pimple/src/Pimple/Tests/Psr11/ServiceLocatorTest.php deleted file mode 100644 index bd2d335b..00000000 --- a/vendor/pimple/pimple/src/Pimple/Tests/Psr11/ServiceLocatorTest.php +++ /dev/null @@ -1,131 +0,0 @@ - - */ -class ServiceLocatorTest extends TestCase -{ - public function testCanAccessServices() - { - $pimple = new Container(); - $pimple['service'] = function () { - return new Fixtures\Service(); - }; - $locator = new ServiceLocator($pimple, ['service']); - - $this->assertSame($pimple['service'], $locator->get('service')); - } - - public function testCanAccessAliasedServices() - { - $pimple = new Container(); - $pimple['service'] = function () { - return new Fixtures\Service(); - }; - $locator = new ServiceLocator($pimple, ['alias' => 'service']); - - $this->assertSame($pimple['service'], $locator->get('alias')); - } - - public function testCannotAccessAliasedServiceUsingRealIdentifier() - { - $this->expectException(\Pimple\Exception\UnknownIdentifierException::class); - $this->expectExceptionMessage('Identifier "service" is not defined.'); - - $pimple = new Container(); - $pimple['service'] = function () { - return new Fixtures\Service(); - }; - $locator = new ServiceLocator($pimple, ['alias' => 'service']); - - $service = $locator->get('service'); - } - - public function testGetValidatesServiceCanBeLocated() - { - $this->expectException(\Pimple\Exception\UnknownIdentifierException::class); - $this->expectExceptionMessage('Identifier "foo" is not defined.'); - - $pimple = new Container(); - $pimple['service'] = function () { - return new Fixtures\Service(); - }; - $locator = new ServiceLocator($pimple, ['alias' => 'service']); - - $service = $locator->get('foo'); - } - - public function testGetValidatesTargetServiceExists() - { - $this->expectException(\Pimple\Exception\UnknownIdentifierException::class); - $this->expectExceptionMessage('Identifier "invalid" is not defined.'); - - $pimple = new Container(); - $pimple['service'] = function () { - return new Fixtures\Service(); - }; - $locator = new ServiceLocator($pimple, ['alias' => 'invalid']); - - $service = $locator->get('alias'); - } - - public function testHasValidatesServiceCanBeLocated() - { - $pimple = new Container(); - $pimple['service1'] = function () { - return new Fixtures\Service(); - }; - $pimple['service2'] = function () { - return new Fixtures\Service(); - }; - $locator = new ServiceLocator($pimple, ['service1']); - - $this->assertTrue($locator->has('service1')); - $this->assertFalse($locator->has('service2')); - } - - public function testHasChecksIfTargetServiceExists() - { - $pimple = new Container(); - $pimple['service'] = function () { - return new Fixtures\Service(); - }; - $locator = new ServiceLocator($pimple, ['foo' => 'service', 'bar' => 'invalid']); - - $this->assertTrue($locator->has('foo')); - $this->assertFalse($locator->has('bar')); - } -} diff --git a/vendor/pimple/pimple/src/Pimple/Tests/ServiceIteratorTest.php b/vendor/pimple/pimple/src/Pimple/Tests/ServiceIteratorTest.php deleted file mode 100644 index 2bb935f3..00000000 --- a/vendor/pimple/pimple/src/Pimple/Tests/ServiceIteratorTest.php +++ /dev/null @@ -1,52 +0,0 @@ -assertSame(['service1' => $pimple['service1'], 'service2' => $pimple['service2']], iterator_to_array($iterator)); - } -} diff --git a/vendor/psr/container/.gitignore b/vendor/psr/container/.gitignore deleted file mode 100644 index b2395aa0..00000000 --- a/vendor/psr/container/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -composer.lock -composer.phar -/vendor/ diff --git a/vendor/psr/container/LICENSE b/vendor/psr/container/LICENSE deleted file mode 100644 index 2877a489..00000000 --- a/vendor/psr/container/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013-2016 container-interop -Copyright (c) 2016 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/container/README.md b/vendor/psr/container/README.md deleted file mode 100644 index 1b9d9e57..00000000 --- a/vendor/psr/container/README.md +++ /dev/null @@ -1,13 +0,0 @@ -Container interface -============== - -This repository holds all interfaces related to [PSR-11 (Container Interface)][psr-url]. - -Note that this is not a Container implementation of its own. It is merely abstractions that describe the components of a Dependency Injection Container. - -The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist. - -[psr-url]: https://www.php-fig.org/psr/psr-11/ -[package-url]: https://packagist.org/packages/psr/container -[implementation-url]: https://packagist.org/providers/psr/container-implementation - diff --git a/vendor/psr/container/composer.json b/vendor/psr/container/composer.json deleted file mode 100644 index baf6cd1a..00000000 --- a/vendor/psr/container/composer.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "psr/container", - "type": "library", - "description": "Common Container Interface (PHP FIG PSR-11)", - "keywords": ["psr", "psr-11", "container", "container-interop", "container-interface"], - "homepage": "https://github.com/php-fig/container", - "license": "MIT", - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "require": { - "php": ">=7.4.0" - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - } -} diff --git a/vendor/psr/container/src/ContainerExceptionInterface.php b/vendor/psr/container/src/ContainerExceptionInterface.php deleted file mode 100644 index 0f213f2f..00000000 --- a/vendor/psr/container/src/ContainerExceptionInterface.php +++ /dev/null @@ -1,12 +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 4306fa91..00000000 --- a/vendor/psr/event-dispatcher/src/EventDispatcherInterface.php +++ /dev/null @@ -1,21 +0,0 @@ -=7.0.0", - "psr/http-message": "^1.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 deleted file mode 100644 index cb39a08b..00000000 --- a/vendor/psr/http-factory/src/RequestFactoryInterface.php +++ /dev/null @@ -1,18 +0,0 @@ -=5.3.0" - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - } -} diff --git a/vendor/psr/http-message/src/MessageInterface.php b/vendor/psr/http-message/src/MessageInterface.php deleted file mode 100644 index dd46e5ec..00000000 --- a/vendor/psr/http-message/src/MessageInterface.php +++ /dev/null @@ -1,187 +0,0 @@ -getHeaders() as $name => $values) { - * echo $name . ": " . implode(", ", $values); - * } - * - * // Emit headers iteratively: - * foreach ($message->getHeaders() as $name => $values) { - * foreach ($values as $value) { - * header(sprintf('%s: %s', $name, $value), false); - * } - * } - * - * While header names are not case-sensitive, getHeaders() will preserve the - * exact case in which headers were originally specified. - * - * @return string[][] Returns an associative array of the message's headers. Each - * key MUST be a header name, and each value MUST be an array of strings - * for that header. - */ - public function getHeaders(); - - /** - * Checks if a header exists by the given case-insensitive name. - * - * @param string $name Case-insensitive header field name. - * @return bool Returns true if any header names match the given header - * name using a case-insensitive string comparison. Returns false if - * no matching header name is found in the message. - */ - public function hasHeader($name); - - /** - * Retrieves a message header value by the given case-insensitive name. - * - * This method returns an array of all the header values of the given - * case-insensitive header name. - * - * If the header does not appear in the message, this method MUST return an - * empty array. - * - * @param string $name Case-insensitive header field name. - * @return string[] An array of string values as provided for the given - * header. If the header does not appear in the message, this method MUST - * return an empty array. - */ - public function getHeader($name); - - /** - * Retrieves a comma-separated string of the values for a single header. - * - * This method returns all of the header values of the given - * case-insensitive header name as a string concatenated together using - * a comma. - * - * NOTE: Not all header values may be appropriately represented using - * comma concatenation. For such headers, use getHeader() instead - * and supply your own delimiter when concatenating. - * - * If the header does not appear in the message, this method MUST return - * an empty string. - * - * @param string $name Case-insensitive header field name. - * @return string A string of values as provided for the given header - * concatenated together using a comma. If the header does not appear in - * the message, this method MUST return an empty string. - */ - public function getHeaderLine($name); - - /** - * Return an instance with the provided value replacing the specified header. - * - * While header names are case-insensitive, the casing of the header will - * be preserved by this function, and returned from getHeaders(). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * new and/or updated header and value. - * - * @param string $name Case-insensitive header field name. - * @param string|string[] $value Header value(s). - * @return static - * @throws \InvalidArgumentException for invalid header names or values. - */ - public function withHeader($name, $value); - - /** - * Return an instance with the specified header appended with the given value. - * - * Existing values for the specified header will be maintained. The new - * value(s) will be appended to the existing list. If the header did not - * exist previously, it will be added. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * new header and/or value. - * - * @param string $name Case-insensitive header field name to add. - * @param string|string[] $value Header value(s). - * @return static - * @throws \InvalidArgumentException for invalid header names or values. - */ - public function withAddedHeader($name, $value); - - /** - * Return an instance without the specified header. - * - * Header resolution MUST be done without case-sensitivity. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that removes - * the named header. - * - * @param string $name Case-insensitive header field name to remove. - * @return static - */ - public function withoutHeader($name); - - /** - * Gets the body of the message. - * - * @return StreamInterface Returns the body as a stream. - */ - public function getBody(); - - /** - * Return an instance with the specified message body. - * - * The body MUST be a StreamInterface object. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return a new instance that has the - * new body stream. - * - * @param StreamInterface $body Body. - * @return static - * @throws \InvalidArgumentException When the body is not valid. - */ - public function withBody(StreamInterface $body); -} diff --git a/vendor/psr/http-message/src/RequestInterface.php b/vendor/psr/http-message/src/RequestInterface.php deleted file mode 100644 index a96d4fd6..00000000 --- a/vendor/psr/http-message/src/RequestInterface.php +++ /dev/null @@ -1,129 +0,0 @@ -getQuery()` - * or from the `QUERY_STRING` server param. - * - * @return array - */ - public function getQueryParams(); - - /** - * Return an instance with the specified query string arguments. - * - * These values SHOULD remain immutable over the course of the incoming - * request. They MAY be injected during instantiation, such as from PHP's - * $_GET superglobal, or MAY be derived from some other value such as the - * URI. In cases where the arguments are parsed from the URI, the data - * MUST be compatible with what PHP's parse_str() would return for - * purposes of how duplicate query parameters are handled, and how nested - * sets are handled. - * - * Setting query string arguments MUST NOT change the URI stored by the - * request, nor the values in the server params. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated query string arguments. - * - * @param array $query Array of query string arguments, typically from - * $_GET. - * @return static - */ - public function withQueryParams(array $query); - - /** - * Retrieve normalized file upload data. - * - * This method returns upload metadata in a normalized tree, with each leaf - * an instance of Psr\Http\Message\UploadedFileInterface. - * - * These values MAY be prepared from $_FILES or the message body during - * instantiation, or MAY be injected via withUploadedFiles(). - * - * @return array An array tree of UploadedFileInterface instances; an empty - * array MUST be returned if no data is present. - */ - public function getUploadedFiles(); - - /** - * Create a new instance with the specified uploaded files. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated body parameters. - * - * @param array $uploadedFiles An array tree of UploadedFileInterface instances. - * @return static - * @throws \InvalidArgumentException if an invalid structure is provided. - */ - public function withUploadedFiles(array $uploadedFiles); - - /** - * Retrieve any parameters provided in the request body. - * - * If the request Content-Type is either application/x-www-form-urlencoded - * or multipart/form-data, and the request method is POST, this method MUST - * return the contents of $_POST. - * - * Otherwise, this method may return any results of deserializing - * the request body content; as parsing returns structured content, the - * potential types MUST be arrays or objects only. A null value indicates - * the absence of body content. - * - * @return null|array|object The deserialized body parameters, if any. - * These will typically be an array or object. - */ - public function getParsedBody(); - - /** - * Return an instance with the specified body parameters. - * - * These MAY be injected during instantiation. - * - * If the request Content-Type is either application/x-www-form-urlencoded - * or multipart/form-data, and the request method is POST, use this method - * ONLY to inject the contents of $_POST. - * - * The data IS NOT REQUIRED to come from $_POST, but MUST be the results of - * deserializing the request body content. Deserialization/parsing returns - * structured data, and, as such, this method ONLY accepts arrays or objects, - * or a null value if nothing was available to parse. - * - * As an example, if content negotiation determines that the request data - * is a JSON payload, this method could be used to create a request - * instance with the deserialized parameters. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated body parameters. - * - * @param null|array|object $data The deserialized body data. This will - * typically be in an array or object. - * @return static - * @throws \InvalidArgumentException if an unsupported argument type is - * provided. - */ - public function withParsedBody($data); - - /** - * Retrieve attributes derived from the request. - * - * The request "attributes" may be used to allow injection of any - * parameters derived from the request: e.g., the results of path - * match operations; the results of decrypting cookies; the results of - * deserializing non-form-encoded message bodies; etc. Attributes - * will be application and request specific, and CAN be mutable. - * - * @return array Attributes derived from the request. - */ - public function getAttributes(); - - /** - * Retrieve a single derived request attribute. - * - * Retrieves a single derived request attribute as described in - * getAttributes(). If the attribute has not been previously set, returns - * the default value as provided. - * - * This method obviates the need for a hasAttribute() method, as it allows - * specifying a default value to return if the attribute is not found. - * - * @see getAttributes() - * @param string $name The attribute name. - * @param mixed $default Default value to return if the attribute does not exist. - * @return mixed - */ - public function getAttribute($name, $default = null); - - /** - * Return an instance with the specified derived request attribute. - * - * This method allows setting a single derived request attribute as - * described in getAttributes(). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated attribute. - * - * @see getAttributes() - * @param string $name The attribute name. - * @param mixed $value The value of the attribute. - * @return static - */ - public function withAttribute($name, $value); - - /** - * Return an instance that removes the specified derived request attribute. - * - * This method allows removing a single derived request attribute as - * described in getAttributes(). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that removes - * the attribute. - * - * @see getAttributes() - * @param string $name The attribute name. - * @return static - */ - public function withoutAttribute($name); -} diff --git a/vendor/psr/http-message/src/StreamInterface.php b/vendor/psr/http-message/src/StreamInterface.php deleted file mode 100644 index f68f3912..00000000 --- a/vendor/psr/http-message/src/StreamInterface.php +++ /dev/null @@ -1,158 +0,0 @@ - - * [user-info@]host[:port] - * - * - * If the port component is not set or is the standard port for the current - * scheme, it SHOULD NOT be included. - * - * @see https://tools.ietf.org/html/rfc3986#section-3.2 - * @return string The URI authority, in "[user-info@]host[:port]" format. - */ - public function getAuthority(); - - /** - * Retrieve the user information component of the URI. - * - * If no user information is present, this method MUST return an empty - * string. - * - * If a user is present in the URI, this will return that value; - * additionally, if the password is also present, it will be appended to the - * user value, with a colon (":") separating the values. - * - * The trailing "@" character is not part of the user information and MUST - * NOT be added. - * - * @return string The URI user information, in "username[:password]" format. - */ - public function getUserInfo(); - - /** - * Retrieve the host component of the URI. - * - * If no host is present, this method MUST return an empty string. - * - * The value returned MUST be normalized to lowercase, per RFC 3986 - * Section 3.2.2. - * - * @see http://tools.ietf.org/html/rfc3986#section-3.2.2 - * @return string The URI host. - */ - public function getHost(); - - /** - * Retrieve the port component of the URI. - * - * If a port is present, and it is non-standard for the current scheme, - * this method MUST return it as an integer. If the port is the standard port - * used with the current scheme, this method SHOULD return null. - * - * If no port is present, and no scheme is present, this method MUST return - * a null value. - * - * If no port is present, but a scheme is present, this method MAY return - * the standard port for that scheme, but SHOULD return null. - * - * @return null|int The URI port. - */ - public function getPort(); - - /** - * Retrieve the path component of the URI. - * - * The path can either be empty or absolute (starting with a slash) or - * rootless (not starting with a slash). Implementations MUST support all - * three syntaxes. - * - * Normally, the empty path "" and absolute path "/" are considered equal as - * defined in RFC 7230 Section 2.7.3. But this method MUST NOT automatically - * do this normalization because in contexts with a trimmed base path, e.g. - * the front controller, this difference becomes significant. It's the task - * of the user to handle both "" and "/". - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode - * any characters. To determine what characters to encode, please refer to - * RFC 3986, Sections 2 and 3.3. - * - * As an example, if the value should include a slash ("/") not intended as - * delimiter between path segments, that value MUST be passed in encoded - * form (e.g., "%2F") to the instance. - * - * @see https://tools.ietf.org/html/rfc3986#section-2 - * @see https://tools.ietf.org/html/rfc3986#section-3.3 - * @return string The URI path. - */ - public function getPath(); - - /** - * Retrieve the query string of the URI. - * - * If no query string is present, this method MUST return an empty string. - * - * The leading "?" character is not part of the query and MUST NOT be - * added. - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode - * any characters. To determine what characters to encode, please refer to - * RFC 3986, Sections 2 and 3.4. - * - * As an example, if a value in a key/value pair of the query string should - * include an ampersand ("&") not intended as a delimiter between values, - * that value MUST be passed in encoded form (e.g., "%26") to the instance. - * - * @see https://tools.ietf.org/html/rfc3986#section-2 - * @see https://tools.ietf.org/html/rfc3986#section-3.4 - * @return string The URI query string. - */ - public function getQuery(); - - /** - * Retrieve the fragment component of the URI. - * - * If no fragment is present, this method MUST return an empty string. - * - * The leading "#" character is not part of the fragment and MUST NOT be - * added. - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode - * any characters. To determine what characters to encode, please refer to - * RFC 3986, Sections 2 and 3.5. - * - * @see https://tools.ietf.org/html/rfc3986#section-2 - * @see https://tools.ietf.org/html/rfc3986#section-3.5 - * @return string The URI fragment. - */ - public function getFragment(); - - /** - * Return an instance with the specified scheme. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified scheme. - * - * Implementations MUST support the schemes "http" and "https" case - * insensitively, and MAY accommodate other schemes if required. - * - * An empty scheme is equivalent to removing the scheme. - * - * @param string $scheme The scheme to use with the new instance. - * @return static A new instance with the specified scheme. - * @throws \InvalidArgumentException for invalid or unsupported schemes. - */ - public function withScheme($scheme); - - /** - * Return an instance with the specified user information. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified user information. - * - * Password is optional, but the user information MUST include the - * user; an empty string for the user is equivalent to removing user - * information. - * - * @param string $user The user name to use for authority. - * @param null|string $password The password associated with $user. - * @return static A new instance with the specified user information. - */ - public function withUserInfo($user, $password = null); - - /** - * Return an instance with the specified host. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified host. - * - * An empty host value is equivalent to removing the host. - * - * @param string $host The hostname to use with the new instance. - * @return static A new instance with the specified host. - * @throws \InvalidArgumentException for invalid hostnames. - */ - public function withHost($host); - - /** - * Return an instance with the specified port. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified port. - * - * Implementations MUST raise an exception for ports outside the - * established TCP and UDP port ranges. - * - * A null value provided for the port is equivalent to removing the port - * information. - * - * @param null|int $port The port to use with the new instance; a null value - * removes the port information. - * @return static A new instance with the specified port. - * @throws \InvalidArgumentException for invalid ports. - */ - public function withPort($port); - - /** - * Return an instance with the specified path. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified path. - * - * The path can either be empty or absolute (starting with a slash) or - * rootless (not starting with a slash). Implementations MUST support all - * three syntaxes. - * - * If the path is intended to be domain-relative rather than path relative then - * it must begin with a slash ("/"). Paths not starting with a slash ("/") - * are assumed to be relative to some base path known to the application or - * consumer. - * - * Users can provide both encoded and decoded path characters. - * Implementations ensure the correct encoding as outlined in getPath(). - * - * @param string $path The path to use with the new instance. - * @return static A new instance with the specified path. - * @throws \InvalidArgumentException for invalid paths. - */ - public function withPath($path); - - /** - * Return an instance with the specified query string. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified query string. - * - * Users can provide both encoded and decoded query characters. - * Implementations ensure the correct encoding as outlined in getQuery(). - * - * An empty query string value is equivalent to removing the query string. - * - * @param string $query The query string to use with the new instance. - * @return static A new instance with the specified query string. - * @throws \InvalidArgumentException for invalid query strings. - */ - public function withQuery($query); - - /** - * Return an instance with the specified URI fragment. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified URI fragment. - * - * Users can provide both encoded and decoded fragment characters. - * Implementations ensure the correct encoding as outlined in getFragment(). - * - * An empty fragment value is equivalent to removing the fragment. - * - * @param string $fragment The fragment to use with the new instance. - * @return static A new instance with the specified fragment. - */ - public function withFragment($fragment); - - /** - * Return the string representation as a URI reference. - * - * Depending on which components of the URI are present, the resulting - * string is either a full URI or relative reference according to RFC 3986, - * Section 4.1. The method concatenates the various components of the URI, - * using the appropriate delimiters: - * - * - If a scheme is present, it MUST be suffixed by ":". - * - If an authority is present, it MUST be prefixed by "//". - * - The path can be concatenated without delimiters. But there are two - * cases where the path has to be adjusted to make the URI reference - * valid as PHP does not allow to throw an exception in __toString(): - * - If the path is rootless and an authority is present, the path MUST - * be prefixed by "/". - * - If the path is starting with more than one "/" and no authority is - * present, the starting slashes MUST be reduced to one. - * - If a query is present, it MUST be prefixed by "?". - * - If a fragment is present, it MUST be prefixed by "#". - * - * @see http://tools.ietf.org/html/rfc3986#section-4.1 - * @return string - */ - public function __toString(); -} diff --git a/vendor/psr/log/LICENSE b/vendor/psr/log/LICENSE deleted file mode 100644 index 474c952b..00000000 --- a/vendor/psr/log/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2012 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/log/README.md b/vendor/psr/log/README.md deleted file mode 100644 index a9f20c43..00000000 --- a/vendor/psr/log/README.md +++ /dev/null @@ -1,58 +0,0 @@ -PSR Log -======= - -This repository holds all interfaces/classes/traits related to -[PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md). - -Note that this is not a logger of its own. It is merely an interface that -describes a logger. See the specification for more details. - -Installation ------------- - -```bash -composer require psr/log -``` - -Usage ------ - -If you need a logger, you can use the interface like this: - -```php -logger = $logger; - } - - public function doSomething() - { - if ($this->logger) { - $this->logger->info('Doing work'); - } - - try { - $this->doSomethingElse(); - } catch (Exception $exception) { - $this->logger->error('Oh no!', array('exception' => $exception)); - } - - // do something useful - } -} -``` - -You can then pick one of the implementations of the interface to get a logger. - -If you want to implement the interface, you can require this package and -implement `Psr\Log\LoggerInterface` in your code. Please read the -[specification text](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md) -for details. diff --git a/vendor/psr/log/composer.json b/vendor/psr/log/composer.json deleted file mode 100644 index 879fc6f5..00000000 --- a/vendor/psr/log/composer.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "psr/log", - "description": "Common interface for logging libraries", - "keywords": ["psr", "psr-3", "log"], - "homepage": "https://github.com/php-fig/log", - "license": "MIT", - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "require": { - "php": ">=8.0.0" - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "src" - } - }, - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - } -} diff --git a/vendor/psr/log/src/AbstractLogger.php b/vendor/psr/log/src/AbstractLogger.php deleted file mode 100644 index d60a091a..00000000 --- a/vendor/psr/log/src/AbstractLogger.php +++ /dev/null @@ -1,15 +0,0 @@ -logger = $logger; - } -} diff --git a/vendor/psr/log/src/LoggerInterface.php b/vendor/psr/log/src/LoggerInterface.php deleted file mode 100644 index b3a24b5f..00000000 --- a/vendor/psr/log/src/LoggerInterface.php +++ /dev/null @@ -1,125 +0,0 @@ -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|\Stringable $message - * @param array $context - * - * @return void - */ - public function alert(string|\Stringable $message, array $context = []): void - { - $this->log(LogLevel::ALERT, $message, $context); - } - - /** - * Critical conditions. - * - * Example: Application component unavailable, unexpected exception. - * - * @param string|\Stringable $message - * @param array $context - * - * @return void - */ - public function critical(string|\Stringable $message, array $context = []): void - { - $this->log(LogLevel::CRITICAL, $message, $context); - } - - /** - * Runtime errors that do not require immediate action but should typically - * be logged and monitored. - * - * @param string|\Stringable $message - * @param array $context - * - * @return void - */ - public function error(string|\Stringable $message, array $context = []): void - { - $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|\Stringable $message - * @param array $context - * - * @return void - */ - public function warning(string|\Stringable $message, array $context = []): void - { - $this->log(LogLevel::WARNING, $message, $context); - } - - /** - * Normal but significant events. - * - * @param string|\Stringable $message - * @param array $context - * - * @return void - */ - public function notice(string|\Stringable $message, array $context = []): void - { - $this->log(LogLevel::NOTICE, $message, $context); - } - - /** - * Interesting events. - * - * Example: User logs in, SQL logs. - * - * @param string|\Stringable $message - * @param array $context - * - * @return void - */ - public function info(string|\Stringable $message, array $context = []): void - { - $this->log(LogLevel::INFO, $message, $context); - } - - /** - * Detailed debug information. - * - * @param string|\Stringable $message - * @param array $context - * - * @return void - */ - public function debug(string|\Stringable $message, array $context = []): void - { - $this->log(LogLevel::DEBUG, $message, $context); - } - - /** - * Logs with an arbitrary level. - * - * @param mixed $level - * @param string|\Stringable $message - * @param array $context - * - * @return void - * - * @throws \Psr\Log\InvalidArgumentException - */ - abstract public function log($level, string|\Stringable $message, array $context = []): void; -} diff --git a/vendor/psr/log/src/NullLogger.php b/vendor/psr/log/src/NullLogger.php deleted file mode 100644 index c1cc3c06..00000000 --- a/vendor/psr/log/src/NullLogger.php +++ /dev/null @@ -1,30 +0,0 @@ -logger) { }` - * blocks. - */ -class NullLogger extends AbstractLogger -{ - /** - * Logs with an arbitrary level. - * - * @param mixed $level - * @param string|\Stringable $message - * @param array $context - * - * @return void - * - * @throws \Psr\Log\InvalidArgumentException - */ - public function log($level, string|\Stringable $message, array $context = []): void - { - // noop - } -} diff --git a/vendor/psr/simple-cache/.editorconfig b/vendor/psr/simple-cache/.editorconfig deleted file mode 100644 index 48542cbb..00000000 --- a/vendor/psr/simple-cache/.editorconfig +++ /dev/null @@ -1,12 +0,0 @@ -; This file is for unifying the coding style for different editors and IDEs. -; More information at http://editorconfig.org - -root = true - -[*] -charset = utf-8 -indent_size = 4 -indent_style = space -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true diff --git a/vendor/psr/simple-cache/LICENSE.md b/vendor/psr/simple-cache/LICENSE.md deleted file mode 100644 index e49a7c85..00000000 --- a/vendor/psr/simple-cache/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -# The MIT License (MIT) - -Copyright (c) 2016 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/simple-cache/README.md b/vendor/psr/simple-cache/README.md deleted file mode 100644 index 43641d17..00000000 --- a/vendor/psr/simple-cache/README.md +++ /dev/null @@ -1,8 +0,0 @@ -PHP FIG Simple Cache PSR -======================== - -This repository holds all interfaces related to PSR-16. - -Note that this is not a cache implementation of its own. It is merely an interface that describes a cache implementation. See [the specification](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-16-simple-cache.md) for more details. - -You can find implementations of the specification by looking for packages providing the [psr/simple-cache-implementation](https://packagist.org/providers/psr/simple-cache-implementation) virtual package. diff --git a/vendor/psr/simple-cache/composer.json b/vendor/psr/simple-cache/composer.json deleted file mode 100644 index f307a845..00000000 --- a/vendor/psr/simple-cache/composer.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "psr/simple-cache", - "description": "Common interfaces for simple caching", - "keywords": ["psr", "psr-16", "cache", "simple-cache", "caching"], - "license": "MIT", - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "require": { - "php": ">=8.0.0" - }, - "autoload": { - "psr-4": { - "Psr\\SimpleCache\\": "src/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - } -} diff --git a/vendor/psr/simple-cache/src/CacheException.php b/vendor/psr/simple-cache/src/CacheException.php deleted file mode 100644 index f61b24c2..00000000 --- a/vendor/psr/simple-cache/src/CacheException.php +++ /dev/null @@ -1,10 +0,0 @@ - $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. - * - * @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(iterable $keys, mixed $default = null): iterable; - - /** - * Persists a set of key => value pairs in the cache, with an optional TTL. - * - * @param iterable $values A list of key => value pairs for a multiple-set operation. - * @param null|int|\DateInterval $ttl Optional. The TTL value of this item. If no value is sent and - * the driver supports TTL then the library may set a default value - * for it or let the driver take care of that. - * - * @return bool True on success and false on failure. - * - * @throws \Psr\SimpleCache\InvalidArgumentException - * 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(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. - * - * @return bool True if the items were successfully removed. False if there was an error. - * - * @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 deleteMultiple(iterable $keys): bool; - - /** - * Determines whether an item is present in the cache. - * - * NOTE: It is recommended that has() is only to be used for cache warming type purposes - * and not to be used within your live applications operations for get/set, as this method - * is subject to a race condition where your has() will return true and immediately after, - * another script can remove it making the state of your app out of date. - * - * @param string $key The cache item key. - * - * @return bool - * - * @throws \Psr\SimpleCache\InvalidArgumentException - * MUST be thrown if the $key string is not a legal value. - */ - public function has(string $key): bool; -} diff --git a/vendor/psr/simple-cache/src/InvalidArgumentException.php b/vendor/psr/simple-cache/src/InvalidArgumentException.php deleted file mode 100644 index 6a9524a2..00000000 --- a/vendor/psr/simple-cache/src/InvalidArgumentException.php +++ /dev/null @@ -1,13 +0,0 @@ -= 5.3. - -[![Build Status](https://travis-ci.org/ralouphie/getallheaders.svg?branch=master)](https://travis-ci.org/ralouphie/getallheaders) -[![Coverage Status](https://coveralls.io/repos/ralouphie/getallheaders/badge.png?branch=master)](https://coveralls.io/r/ralouphie/getallheaders?branch=master) -[![Latest Stable Version](https://poser.pugx.org/ralouphie/getallheaders/v/stable.png)](https://packagist.org/packages/ralouphie/getallheaders) -[![Latest Unstable Version](https://poser.pugx.org/ralouphie/getallheaders/v/unstable.png)](https://packagist.org/packages/ralouphie/getallheaders) -[![License](https://poser.pugx.org/ralouphie/getallheaders/license.png)](https://packagist.org/packages/ralouphie/getallheaders) - - -This is a simple polyfill for [`getallheaders()`](http://www.php.net/manual/en/function.getallheaders.php). - -## Install - -For PHP version **`>= 5.6`**: - -``` -composer require ralouphie/getallheaders -``` - -For PHP version **`< 5.6`**: - -``` -composer require ralouphie/getallheaders "^2" -``` diff --git a/vendor/ralouphie/getallheaders/composer.json b/vendor/ralouphie/getallheaders/composer.json deleted file mode 100644 index de8ce62e..00000000 --- a/vendor/ralouphie/getallheaders/composer.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "ralouphie/getallheaders", - "description": "A polyfill for getallheaders.", - "license": "MIT", - "authors": [ - { - "name": "Ralph Khattar", - "email": "ralph.khattar@gmail.com" - } - ], - "require": { - "php": ">=5.6" - }, - "require-dev": { - "phpunit/phpunit": "^5 || ^6.5", - "php-coveralls/php-coveralls": "^2.1" - }, - "autoload": { - "files": ["src/getallheaders.php"] - }, - "autoload-dev": { - "psr-4": { - "getallheaders\\Tests\\": "tests/" - } - } -} diff --git a/vendor/ralouphie/getallheaders/src/getallheaders.php b/vendor/ralouphie/getallheaders/src/getallheaders.php deleted file mode 100644 index c7285a5b..00000000 --- a/vendor/ralouphie/getallheaders/src/getallheaders.php +++ /dev/null @@ -1,46 +0,0 @@ - 'Content-Type', - 'CONTENT_LENGTH' => 'Content-Length', - 'CONTENT_MD5' => 'Content-Md5', - ); - - foreach ($_SERVER as $key => $value) { - if (substr($key, 0, 5) === 'HTTP_') { - $key = substr($key, 5); - if (!isset($copy_server[$key]) || !isset($_SERVER[$key])) { - $key = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', $key)))); - $headers[$key] = $value; - } - } elseif (isset($copy_server[$key])) { - $headers[$copy_server[$key]] = $value; - } - } - - if (!isset($headers['Authorization'])) { - if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])) { - $headers['Authorization'] = $_SERVER['REDIRECT_HTTP_AUTHORIZATION']; - } elseif (isset($_SERVER['PHP_AUTH_USER'])) { - $basic_pass = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : ''; - $headers['Authorization'] = 'Basic ' . base64_encode($_SERVER['PHP_AUTH_USER'] . ':' . $basic_pass); - } elseif (isset($_SERVER['PHP_AUTH_DIGEST'])) { - $headers['Authorization'] = $_SERVER['PHP_AUTH_DIGEST']; - } - } - - return $headers; - } - -} diff --git a/vendor/ramsey/collection/LICENSE b/vendor/ramsey/collection/LICENSE deleted file mode 100644 index ae15f590..00000000 --- a/vendor/ramsey/collection/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015-2021 Ben Ramsey - -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/ramsey/collection/README.md b/vendor/ramsey/collection/README.md deleted file mode 100644 index 9124dd77..00000000 --- a/vendor/ramsey/collection/README.md +++ /dev/null @@ -1,82 +0,0 @@ -

      ramsey/collection

      - -

      - A PHP library for representing and manipulating collections. -

      - -

      - Source Code - Download Package - PHP Programming Language - Read License - Build Status - Codecov Code Coverage - Psalm Type Coverage -

      - -## About - -ramsey/collection is a PHP library for representing and manipulating collections. - -Much inspiration for this library came from the [Java Collections Framework][java]. - -This project adheres to a [code of conduct](CODE_OF_CONDUCT.md). -By participating in this project and its community, you are expected to -uphold this code. - -## Installation - -Install this package as a dependency using [Composer](https://getcomposer.org). - -``` bash -composer require ramsey/collection -``` - -## Usage - -Examples of how to use this framework can be found in the -[Wiki pages](https://github.com/ramsey/collection/wiki/Examples). - -## Contributing - -Contributions are welcome! Before contributing to this project, familiarize -yourself with [CONTRIBUTING.md](CONTRIBUTING.md). - -To develop this project, you will need [PHP](https://www.php.net) 7.3 or greater -and [Composer](https://getcomposer.org). - -After cloning this repository locally, execute the following commands: - -``` bash -cd /path/to/repository -composer install -``` - -Now, you are ready to develop! - -## Coordinated Disclosure - -Keeping user information safe and secure is a top priority, and we welcome the -contribution of external security researchers. If you believe you've found a -security issue in software that is maintained in this repository, please read -[SECURITY.md][] for instructions on submitting a vulnerability report. - -## ramsey/collection for Enterprise - -Available as part of the Tidelift Subscription. - -The maintainers of ramsey/collection and thousands of other packages are working -with Tidelift to deliver commercial support and maintenance for the open source -packages you use to build your applications. Save time, reduce risk, and improve -code health, while paying the maintainers of the exact packages you use. -[Learn more.](https://tidelift.com/subscription/pkg/packagist-ramsey-collection?utm_source=undefined&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - -## Copyright and License - -The ramsey/collection library is copyright © [Ben Ramsey](https://benramsey.com) -and licensed for use under the terms of the -MIT License (MIT). Please see [LICENSE](LICENSE) for more information. - - -[java]: http://docs.oracle.com/javase/8/docs/technotes/guides/collections/index.html -[security.md]: https://github.com/ramsey/collection/blob/master/SECURITY.md diff --git a/vendor/ramsey/collection/SECURITY.md b/vendor/ramsey/collection/SECURITY.md deleted file mode 100644 index b052f3b6..00000000 --- a/vendor/ramsey/collection/SECURITY.md +++ /dev/null @@ -1,113 +0,0 @@ - - -# Vulnerability Disclosure Policy - -Keeping user information safe and secure is a top priority, and we welcome the -contribution of external security researchers. - -## Scope - -If you believe you've found a security issue in software that is maintained in -this repository, we encourage you to notify us. - -| Version | In scope | Source code | -| :-----: | :------: | :---------- | -| latest | ✅ | https://github.com/ramsey/collection | - -## How to Submit a Report - -To submit a vulnerability report, please contact us at . -Your submission will be reviewed and validated by a member of our team. - -## Safe Harbor - -We support safe harbor for security researchers who: - -* Make a good faith effort to avoid privacy violations, destruction of data, and - interruption or degradation of our services. -* Only interact with accounts you own or with explicit permission of the account - holder. If you do encounter Personally Identifiable Information (PII) contact - us immediately, do not proceed with access, and immediately purge any local - information. -* Provide us with a reasonable amount of time to resolve vulnerabilities prior - to any disclosure to the public or a third-party. - -We will consider activities conducted consistent with this policy to constitute -"authorized" conduct and will not pursue civil action or initiate a complaint to -law enforcement. We will help to the extent we can if legal action is initiated -by a third party against you. - -Please submit a report to us before engaging in conduct that may be inconsistent -with or unaddressed by this policy. - -## Preferences - -* Please provide detailed reports with reproducible steps and a clearly defined - impact. -* Include the version number of the vulnerable package in your report -* Social engineering (e.g. phishing, vishing, smishing) is prohibited. - -## Encryption Key for security@ramsey.dev - -For increased privacy when reporting sensitive issues, you may encrypt your -messages using the following key: - -``` ------BEGIN PGP PUBLIC KEY BLOCK----- - -mQINBF+Z9gEBEACbT/pIx8RR0K18t8Z2rDnmEV44YdT7HNsMdq+D6SAlx8UUb6AU -jGIbV9dgBgGNtOLU1pxloaJwL9bWIRbj+X/Qb2WNIP//Vz1Y40ox1dSpfCUrizXx -kb4p58Xml0PsB8dg3b4RDUgKwGC37ne5xmDnigyJPbiB2XJ6Xc46oPCjh86XROTK -wEBB2lY67ClBlSlvC2V9KmbTboRQkLdQDhOaUosMb99zRb0EWqDLaFkZVjY5HI7i -0pTveE6dI12NfHhTwKjZ5pUiAZQGlKA6J1dMjY2unxHZkQj5MlMfrLSyJHZxccdJ -xD94T6OTcTHt/XmMpI2AObpewZDdChDQmcYDZXGfAhFoJmbvXsmLMGXKgzKoZ/ls -RmLsQhh7+/r8E+Pn5r+A6Hh4uAc14ApyEP0ckKeIXw1C6pepHM4E8TEXVr/IA6K/ -z6jlHORixIFX7iNOnfHh+qwOgZw40D6JnBfEzjFi+T2Cy+JzN2uy7I8UnecTMGo3 -5t6astPy6xcH6kZYzFTV7XERR6LIIVyLAiMFd8kF5MbJ8N5ElRFsFHPW+82N2HDX -c60iSaTB85k6R6xd8JIKDiaKE4sSuw2wHFCKq33d/GamYezp1wO+bVUQg88efljC -2JNFyD+vl30josqhw1HcmbE1TP3DlYeIL5jQOlxCMsgai6JtTfHFM/5MYwARAQAB -tBNzZWN1cml0eUByYW1zZXkuZGV2iQJUBBMBCAA+FiEE4drPD+/ofZ570fAYq0bv -vXQCywIFAl+Z9gECGwMFCQeGH4AFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQ -q0bvvXQCywIkEA//Qcwv8MtTCy01LHZd9c7VslwhNdXQDYymcTyjcYw8x7O22m4B -3hXE6vqAplFhVxxkqXB2ef0tQuzxhPHNJgkCE4Wq4i+V6qGpaSVHQT2W6DN/NIhL -vS8OdScc6zddmIbIkSrzVVAtjwehFNEIrX3DnbbbK+Iku7vsKT5EclOluIsjlYoX -goW8IeReyDBqOe2H3hoCGw6EA0D/NYV2bJnfy53rXVIyarsXXeOLp7eNEH6Td7aW -PVSrMZJe1t+knrEGnEdrXWzlg4lCJJCtemGv+pKBUomnyISXSdqyoRCCzvQjqyig -2kRebUX8BXPW33p4OXPj9sIboUOjZwormWwqqbFMO+J4TiVCUoEoheI7emPFRcNN -QtPJrjbY1++OznBc0GRpfeUkGoU1cbRl1bnepnFIZMTDLkrVW6I1Y4q8ZVwX3BkE -N81ctFrRpHBlU36EdHvjPQmGtuiL77Qq3fWmMv7yTvK1wHJAXfEb0ZJWHZCbck3w -l0CVq0Z+UUAOM8Rp1N0N8m92xtapav0qCFU9qzf2J5qX6GRmWv+d29wPgFHzDWBm -nnrYYIA4wJLx00U6SMcVBSnNe91B+RfGY5XQhbWPjQQecOGCSDsxaFAq2MeOVJyZ -bIjLYfG9GxoLKr5R7oLRJvZI4nKKBc1Kci/crZbdiSdQhSQGlDz88F1OHeCIdQQQ -EQgAHRYhBOhdAxHd+lus86YQ57Atl5icjAcbBQJfmfdIAAoJELAtl5icjAcbFVcA -/1LqB3ZjsnXDAvvAXZVjSPqofSlpMLeRQP6IM/A9Odq0AQCZrtZc1knOMGEcjppK -Rk+sy/R0Mshy8TDuaZIRgh2Ux7kCDQRfmfYBARAAmchKzzVz7IaEq7PnZDb3szQs -T/+E9F3m39yOpV4fEB1YzObonFakXNT7Gw2tZEx0eitUMqQ/13jjfu3UdzlKl2bR -qA8LrSQRhB+PTC9A1XvwxCUYhhjGiLzJ9CZL6hBQB43qHOmE9XJPme90geLsF+gK -u39Waj1SNWzwGg+Gy1Gl5f2AJoDTxznreCuFGj+Vfaczt/hlfgqpOdb9jsmdoE7t -3DSWppA9dRHWwQSgE6J28rR4QySBcqyXS6IMykqaJn7Z26yNIaITLnHCZOSY8zhP -ha7GFsN549EOCgECbrnPt9dmI2+hQE0RO0e7SOBNsIf5sz/i7urhwuj0CbOqhjc2 -X1AEVNFCVcb6HPi/AWefdFCRu0gaWQxn5g+9nkq5slEgvzCCiKYzaBIcr8qR6Hb4 -FaOPVPxO8vndRouq57Ws8XpAwbPttioFuCqF4u9K+tK/8e2/R8QgRYJsE3Cz/Fu8 -+pZFpMnqbDEbK3DL3ss+1ed1sky+mDV8qXXeI33XW5hMFnk1JWshUjHNlQmE6ftC -U0xSTMVUtwJhzH2zDp8lEdu7qi3EsNULOl68ozDr6soWAvCbHPeTdTOnFySGCleG -/3TonsoZJs/sSPPJnxFQ1DtgQL6EbhIwa0ZwU4eKYVHZ9tjxuMX3teFzRvOrJjgs -+ywGlsIURtEckT5Y6nMAEQEAAYkCPAQYAQgAJhYhBOHazw/v6H2ee9HwGKtG7710 -AssCBQJfmfYBAhsMBQkHhh+AAAoJEKtG7710AssC8NcP/iDAcy1aZFvkA0EbZ85p -i7/+ywtE/1wF4U4/9OuLcoskqGGnl1pJNPooMOSBCfreoTB8HimT0Fln0CoaOm4Q -pScNq39JXmf4VxauqUJVARByP6zUfgYarqoaZNeuFF0S4AZJ2HhGzaQPjDz1uKVM -PE6tQSgQkFzdZ9AtRA4vElTH6yRAgmepUsOihk0b0gUtVnwtRYZ8e0Qt3ie97a73 -DxLgAgedFRUbLRYiT0vNaYbainBsLWKpN/T8odwIg/smP0Khjp/ckV60cZTdBiPR -szBTPJESMUTu0VPntc4gWwGsmhZJg/Tt/qP08XYo3VxNYBegyuWwNR66zDWvwvGH -muMv5UchuDxp6Rt3JkIO4voMT1JSjWy9p8krkPEE4V6PxAagLjdZSkt92wVLiK5x -y5gNrtPhU45YdRAKHr36OvJBJQ42CDaZ6nzrzghcIp9CZ7ANHrI+QLRM/csz+AGA -szSp6S4mc1lnxxfbOhPPpebZPn0nIAXoZnnoVKdrxBVedPQHT59ZFvKTQ9Fs7gd3 -sYNuc7tJGFGC2CxBH4ANDpOQkc5q9JJ1HSGrXU3juxIiRgfA26Q22S9c71dXjElw -Ri584QH+bL6kkYmm8xpKF6TVwhwu5xx/jBPrbWqFrtbvLNrnfPoapTihBfdIhkT6 -nmgawbBHA02D5xEqB5SU3WJu -=eJNx ------END PGP PUBLIC KEY BLOCK----- -``` diff --git a/vendor/ramsey/collection/composer.json b/vendor/ramsey/collection/composer.json deleted file mode 100644 index 98862ee4..00000000 --- a/vendor/ramsey/collection/composer.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "name": "ramsey/collection", - "type": "library", - "description": "A PHP library for representing and manipulating collections.", - "keywords": [ - "array", - "collection", - "hash", - "map", - "queue", - "set" - ], - "license": "MIT", - "authors": [ - { - "name": "Ben Ramsey", - "email": "ben@benramsey.com", - "homepage": "https://benramsey.com" - } - ], - "require": { - "php": "^7.3 || ^8", - "symfony/polyfill-php81": "^1.23" - }, - "require-dev": { - "captainhook/captainhook": "^5.3", - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "ergebnis/composer-normalize": "^2.6", - "fakerphp/faker": "^1.5", - "hamcrest/hamcrest-php": "^2", - "jangregor/phpstan-prophecy": "^0.8", - "mockery/mockery": "^1.3", - "phpspec/prophecy-phpunit": "^2.0", - "phpstan/extension-installer": "^1", - "phpstan/phpstan": "^0.12.32", - "phpstan/phpstan-mockery": "^0.12.5", - "phpstan/phpstan-phpunit": "^0.12.11", - "phpunit/phpunit": "^8.5 || ^9", - "psy/psysh": "^0.10.4", - "slevomat/coding-standard": "^6.3", - "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "^4.4" - }, - "config": { - "sort-packages": true - }, - "autoload": { - "psr-4": { - "Ramsey\\Collection\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Ramsey\\Console\\": "resources/console/", - "Ramsey\\Collection\\Test\\": "tests/", - "Ramsey\\Test\\Generics\\": "tests/generics/" - }, - "files": [ - "vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php" - ] - }, - "scripts": { - "post-autoload-dump": "captainhook install --ansi -f -s", - "dev:analyze": [ - "@dev:analyze:phpstan", - "@dev:analyze:psalm" - ], - "dev:analyze:phpstan": "phpstan --memory-limit=1G analyse", - "dev:analyze:psalm": "psalm --diff --config=psalm.xml", - "dev:build:clean": "git clean -fX build/.", - "dev:build:clear-cache": "git clean -fX build/cache/.", - "dev:lint": "phpcs --cache=build/cache/phpcs.cache", - "dev:lint:fix": "./bin/lint-fix.sh", - "dev:repl": [ - "echo ; echo 'Type ./bin/repl to start the REPL.'" - ], - "dev:test": "phpunit", - "dev:test:all": [ - "@dev:lint", - "@dev:analyze", - "@dev:test" - ], - "dev:test:coverage:ci": "phpunit --coverage-clover build/logs/clover.xml", - "dev:test:coverage:html": "phpunit --coverage-html build/coverage", - "test": "@dev:test:all" - }, - "scripts-descriptions": { - "dev:analyze": "Performs static analysis on the code base.", - "dev:analyze:phpstan": "Runs the PHPStan static analyzer.", - "dev:analyze:psalm": "Runs the Psalm static analyzer.", - "dev:build:clean": "Removes everything not under version control from the build directory.", - "dev:build:clear-cache": "Removes everything not under version control from build/cache/.", - "dev:lint": "Checks all source code for coding standards issues.", - "dev:lint:fix": "Checks source code for coding standards issues and fixes them, if possible.", - "dev:repl": "Note: Use ./bin/repl to run the REPL.", - "dev:test": "Runs the full unit test suite.", - "dev:test:all": "Runs linting, static analysis, and unit tests.", - "dev:test:coverage:ci": "Runs the unit test suite and generates a Clover coverage report.", - "dev:test:coverage:html": "Runs the unit tests suite and generates an HTML coverage report.", - "test": "Shortcut to run the full test suite." - } -} diff --git a/vendor/ramsey/collection/src/AbstractArray.php b/vendor/ramsey/collection/src/AbstractArray.php deleted file mode 100644 index d72dbe69..00000000 --- a/vendor/ramsey/collection/src/AbstractArray.php +++ /dev/null @@ -1,209 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection; - -use ArrayIterator; -use Traversable; - -use function serialize; -use function unserialize; - -/** - * This class provides a basic implementation of `ArrayInterface`, to minimize - * the effort required to implement this interface. - * - * @template T - * @implements ArrayInterface - */ -abstract class AbstractArray implements ArrayInterface -{ - /** - * The items of this array. - * - * @var array - */ - protected $data = []; - - /** - * Constructs a new array object. - * - * @param array $data The initial items to add to this array. - */ - public function __construct(array $data = []) - { - // Invoke offsetSet() for each value added; in this way, sub-classes - // may provide additional logic about values added to the array object. - foreach ($data as $key => $value) { - $this[$key] = $value; - } - } - - /** - * Returns an iterator for this array. - * - * @link http://php.net/manual/en/iteratoraggregate.getiterator.php IteratorAggregate::getIterator() - * - * @return Traversable - */ - public function getIterator(): Traversable - { - return new ArrayIterator($this->data); - } - - /** - * Returns `true` if the given offset exists in this array. - * - * @link http://php.net/manual/en/arrayaccess.offsetexists.php ArrayAccess::offsetExists() - * - * @param array-key $offset The offset to check. - */ - public function offsetExists($offset): bool - { - return isset($this->data[$offset]); - } - - /** - * Returns the value at the specified offset. - * - * @link http://php.net/manual/en/arrayaccess.offsetget.php ArrayAccess::offsetGet() - * - * @param array-key $offset The offset for which a value should be returned. - * - * @return T|null the value stored at the offset, or null if the offset - * does not exist. - * - * @psalm-suppress InvalidAttribute - */ - #[\ReturnTypeWillChange] // phpcs:ignore - public function offsetGet($offset) - { - return $this->data[$offset] ?? null; - } - - /** - * Sets the given value to the given offset in the array. - * - * @link http://php.net/manual/en/arrayaccess.offsetset.php ArrayAccess::offsetSet() - * - * @param array-key|null $offset The offset to set. If `null`, the value may be - * set at a numerically-indexed offset. - * @param T $value The value to set at the given offset. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function offsetSet($offset, $value): void - { - if ($offset === null) { - $this->data[] = $value; - } else { - $this->data[$offset] = $value; - } - } - - /** - * Removes the given offset and its value from the array. - * - * @link http://php.net/manual/en/arrayaccess.offsetunset.php ArrayAccess::offsetUnset() - * - * @param array-key $offset The offset to remove from the array. - */ - public function offsetUnset($offset): void - { - unset($this->data[$offset]); - } - - /** - * Returns a serialized string representation of this array object. - * - * @deprecated The Serializable interface will go away in PHP 9. - * - * @link http://php.net/manual/en/serializable.serialize.php Serializable::serialize() - * - * @return string a PHP serialized string. - */ - public function serialize(): string - { - return serialize($this->data); - } - - /** - * Returns data suitable for PHP serialization. - * - * @link https://www.php.net/manual/en/language.oop5.magic.php#language.oop5.magic.serialize - * @link https://www.php.net/serialize - * - * @return array - */ - public function __serialize(): array - { - return $this->data; - } - - /** - * Converts a serialized string representation into an instance object. - * - * @deprecated The Serializable interface will go away in PHP 9. - * - * @link http://php.net/manual/en/serializable.unserialize.php Serializable::unserialize() - * - * @param string $serialized A PHP serialized string to unserialize. - * - * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - */ - public function unserialize($serialized): void - { - /** @var array $data */ - $data = unserialize($serialized, ['allowed_classes' => false]); - - $this->data = $data; - } - - /** - * Adds unserialized data to the object. - * - * @param array $data - */ - public function __unserialize(array $data): void - { - $this->data = $data; - } - - /** - * Returns the number of items in this array. - * - * @link http://php.net/manual/en/countable.count.php Countable::count() - */ - public function count(): int - { - return count($this->data); - } - - public function clear(): void - { - $this->data = []; - } - - /** - * @inheritDoc - */ - public function toArray(): array - { - return $this->data; - } - - public function isEmpty(): bool - { - return count($this->data) === 0; - } -} diff --git a/vendor/ramsey/collection/src/AbstractCollection.php b/vendor/ramsey/collection/src/AbstractCollection.php deleted file mode 100644 index d2cd1151..00000000 --- a/vendor/ramsey/collection/src/AbstractCollection.php +++ /dev/null @@ -1,318 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection; - -use Closure; -use Ramsey\Collection\Exception\CollectionMismatchException; -use Ramsey\Collection\Exception\InvalidArgumentException; -use Ramsey\Collection\Exception\InvalidSortOrderException; -use Ramsey\Collection\Exception\OutOfBoundsException; -use Ramsey\Collection\Tool\TypeTrait; -use Ramsey\Collection\Tool\ValueExtractorTrait; -use Ramsey\Collection\Tool\ValueToStringTrait; - -use function array_filter; -use function array_map; -use function array_merge; -use function array_search; -use function array_udiff; -use function array_uintersect; -use function current; -use function end; -use function in_array; -use function is_int; -use function reset; -use function sprintf; -use function unserialize; -use function usort; - -/** - * This class provides a basic implementation of `CollectionInterface`, to - * minimize the effort required to implement this interface - * - * @template T - * @extends AbstractArray - * @implements CollectionInterface - */ -abstract class AbstractCollection extends AbstractArray implements CollectionInterface -{ - use TypeTrait; - use ValueToStringTrait; - use ValueExtractorTrait; - - /** - * @inheritDoc - */ - public function add($element): bool - { - $this[] = $element; - - return true; - } - - /** - * @inheritDoc - */ - public function contains($element, bool $strict = true): bool - { - return in_array($element, $this->data, $strict); - } - - /** - * @inheritDoc - */ - public function offsetSet($offset, $value): void - { - if ($this->checkType($this->getType(), $value) === false) { - throw new InvalidArgumentException( - 'Value must be of type ' . $this->getType() . '; value is ' - . $this->toolValueToString($value) - ); - } - - if ($offset === null) { - $this->data[] = $value; - } else { - $this->data[$offset] = $value; - } - } - - /** - * @inheritDoc - */ - public function remove($element): bool - { - if (($position = array_search($element, $this->data, true)) !== false) { - unset($this->data[$position]); - - return true; - } - - return false; - } - - /** - * @inheritDoc - */ - public function column(string $propertyOrMethod): array - { - $temp = []; - - foreach ($this->data as $item) { - /** @var mixed $value */ - $value = $this->extractValue($item, $propertyOrMethod); - - /** @psalm-suppress MixedAssignment */ - $temp[] = $value; - } - - return $temp; - } - - /** - * @inheritDoc - */ - public function first() - { - if ($this->isEmpty()) { - throw new OutOfBoundsException('Can\'t determine first item. Collection is empty'); - } - - reset($this->data); - - /** @var T $first */ - $first = current($this->data); - - return $first; - } - - /** - * @inheritDoc - */ - public function last() - { - if ($this->isEmpty()) { - throw new OutOfBoundsException('Can\'t determine last item. Collection is empty'); - } - - /** @var T $item */ - $item = end($this->data); - reset($this->data); - - return $item; - } - - public function sort(string $propertyOrMethod, string $order = self::SORT_ASC): CollectionInterface - { - if (!in_array($order, [self::SORT_ASC, self::SORT_DESC], true)) { - throw new InvalidSortOrderException('Invalid sort order given: ' . $order); - } - - $collection = clone $this; - - usort( - $collection->data, - /** - * @param T $a - * @param T $b - */ - function ($a, $b) use ($propertyOrMethod, $order): int { - /** @var mixed $aValue */ - $aValue = $this->extractValue($a, $propertyOrMethod); - - /** @var mixed $bValue */ - $bValue = $this->extractValue($b, $propertyOrMethod); - - return ($aValue <=> $bValue) * ($order === self::SORT_DESC ? -1 : 1); - } - ); - - return $collection; - } - - public function filter(callable $callback): CollectionInterface - { - $collection = clone $this; - $collection->data = array_merge([], array_filter($collection->data, $callback)); - - return $collection; - } - - /** - * {@inheritdoc} - */ - public function where(string $propertyOrMethod, $value): CollectionInterface - { - return $this->filter(function ($item) use ($propertyOrMethod, $value) { - /** @var mixed $accessorValue */ - $accessorValue = $this->extractValue($item, $propertyOrMethod); - - return $accessorValue === $value; - }); - } - - public function map(callable $callback): CollectionInterface - { - return new Collection('mixed', array_map($callback, $this->data)); - } - - public function diff(CollectionInterface $other): CollectionInterface - { - $this->compareCollectionTypes($other); - - $diffAtoB = array_udiff($this->data, $other->toArray(), $this->getComparator()); - $diffBtoA = array_udiff($other->toArray(), $this->data, $this->getComparator()); - - /** @var array $diff */ - $diff = array_merge($diffAtoB, $diffBtoA); - - $collection = clone $this; - $collection->data = $diff; - - return $collection; - } - - public function intersect(CollectionInterface $other): CollectionInterface - { - $this->compareCollectionTypes($other); - - /** @var array $intersect */ - $intersect = array_uintersect($this->data, $other->toArray(), $this->getComparator()); - - $collection = clone $this; - $collection->data = $intersect; - - return $collection; - } - - public function merge(CollectionInterface ...$collections): CollectionInterface - { - $mergedCollection = clone $this; - - foreach ($collections as $index => $collection) { - if (!$collection instanceof static) { - throw new CollectionMismatchException( - sprintf('Collection with index %d must be of type %s', $index, static::class) - ); - } - - // When using generics (Collection.php, Set.php, etc), - // we also need to make sure that the internal types match each other - if ($collection->getType() !== $this->getType()) { - throw new CollectionMismatchException( - sprintf('Collection items in collection with index %d must be of type %s', $index, $this->getType()) - ); - } - - foreach ($collection as $key => $value) { - if (is_int($key)) { - $mergedCollection[] = $value; - } else { - $mergedCollection[$key] = $value; - } - } - } - - return $mergedCollection; - } - - /** - * @inheritDoc - */ - public function unserialize($serialized): void - { - /** @var array $data */ - $data = unserialize($serialized, ['allowed_classes' => [$this->getType()]]); - - $this->data = $data; - } - - /** - * @param CollectionInterface $other - */ - private function compareCollectionTypes(CollectionInterface $other): void - { - if (!$other instanceof static) { - throw new CollectionMismatchException('Collection must be of type ' . static::class); - } - - // When using generics (Collection.php, Set.php, etc), - // we also need to make sure that the internal types match each other - if ($other->getType() !== $this->getType()) { - throw new CollectionMismatchException('Collection items must be of type ' . $this->getType()); - } - } - - private function getComparator(): Closure - { - return /** - * @param T $a - * @param T $b - */ - function ($a, $b): int { - // If the two values are object, we convert them to unique scalars. - // If the collection contains mixed values (unlikely) where some are objects - // and some are not, we leave them as they are. - // The comparator should still work and the result of $a < $b should - // be consistent but unpredictable since not documented. - if (is_object($a) && is_object($b)) { - $a = spl_object_id($a); - $b = spl_object_id($b); - } - - return $a === $b ? 0 : ($a < $b ? 1 : -1); - }; - } -} diff --git a/vendor/ramsey/collection/src/AbstractSet.php b/vendor/ramsey/collection/src/AbstractSet.php deleted file mode 100644 index 1126ccb0..00000000 --- a/vendor/ramsey/collection/src/AbstractSet.php +++ /dev/null @@ -1,50 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection; - -/** - * This class contains the basic implementation of a collection that does not - * allow duplicated values (a set), to minimize the effort required to implement - * this specific type of collection. - * - * @template T - * @extends AbstractCollection - */ -abstract class AbstractSet extends AbstractCollection -{ - /** - * @inheritDoc - */ - public function add($element): bool - { - if ($this->contains($element)) { - return false; - } - - return parent::add($element); - } - - /** - * @inheritDoc - */ - public function offsetSet($offset, $value): void - { - if ($this->contains($value)) { - return; - } - - parent::offsetSet($offset, $value); - } -} diff --git a/vendor/ramsey/collection/src/ArrayInterface.php b/vendor/ramsey/collection/src/ArrayInterface.php deleted file mode 100644 index 27af6102..00000000 --- a/vendor/ramsey/collection/src/ArrayInterface.php +++ /dev/null @@ -1,51 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection; - -use ArrayAccess; -use Countable; -use IteratorAggregate; -use Serializable; - -/** - * `ArrayInterface` provides traversable array functionality to data types. - * - * @template T - * @extends ArrayAccess - * @extends IteratorAggregate - */ -interface ArrayInterface extends - ArrayAccess, - Countable, - IteratorAggregate, - Serializable -{ - /** - * Removes all items from this array. - */ - public function clear(): void; - - /** - * Returns a native PHP array representation of this array object. - * - * @return array - */ - public function toArray(): array; - - /** - * Returns `true` if this array is empty. - */ - public function isEmpty(): bool; -} diff --git a/vendor/ramsey/collection/src/Collection.php b/vendor/ramsey/collection/src/Collection.php deleted file mode 100644 index 1299c12c..00000000 --- a/vendor/ramsey/collection/src/Collection.php +++ /dev/null @@ -1,106 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection; - -/** - * A collection represents a group of objects. - * - * Each object in the collection is of a specific, defined type. - * - * This is a direct implementation of `CollectionInterface`, provided for - * the sake of convenience. - * - * Example usage: - * - * ``` php - * $collection = new \Ramsey\Collection\Collection('My\\Foo'); - * $collection->add(new \My\Foo()); - * $collection->add(new \My\Foo()); - * - * foreach ($collection as $foo) { - * // Do something with $foo - * } - * ``` - * - * It is preferable to subclass `AbstractCollection` to create your own typed - * collections. For example: - * - * ``` php - * namespace My\Foo; - * - * class FooCollection extends \Ramsey\Collection\AbstractCollection - * { - * public function getType() - * { - * return 'My\\Foo'; - * } - * } - * ``` - * - * And then use it similarly to the earlier example: - * - * ``` php - * $fooCollection = new \My\Foo\FooCollection(); - * $fooCollection->add(new \My\Foo()); - * $fooCollection->add(new \My\Foo()); - * - * foreach ($fooCollection as $foo) { - * // Do something with $foo - * } - * ``` - * - * The benefit with this approach is that you may do type-checking on the - * collection object: - * - * ``` php - * if ($collection instanceof \My\Foo\FooCollection) { - * // the collection is a collection of My\Foo objects - * } - * ``` - * - * @template T - * @extends AbstractCollection - */ -class Collection extends AbstractCollection -{ - /** - * The type of elements stored in this collection. - * - * A collection's type is immutable once it is set. For this reason, this - * property is set private. - * - * @var string - */ - private $collectionType; - - /** - * Constructs a collection object of the specified type, optionally with the - * specified data. - * - * @param string $collectionType The type (FQCN) associated with this - * collection. - * @param array $data The initial items to store in the collection. - */ - public function __construct(string $collectionType, array $data = []) - { - $this->collectionType = $collectionType; - parent::__construct($data); - } - - public function getType(): string - { - return $this->collectionType; - } -} diff --git a/vendor/ramsey/collection/src/CollectionInterface.php b/vendor/ramsey/collection/src/CollectionInterface.php deleted file mode 100644 index aa86feb0..00000000 --- a/vendor/ramsey/collection/src/CollectionInterface.php +++ /dev/null @@ -1,205 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection; - -/** - * A collection represents a group of objects, known as its elements. - * - * Some collections allow duplicate elements and others do not. Some are ordered - * and others unordered. - * - * @template T - * @extends ArrayInterface - */ -interface CollectionInterface extends ArrayInterface -{ - /** - * Ascending sort type. - */ - public const SORT_ASC = 'asc'; - - /** - * Descending sort type. - */ - public const SORT_DESC = 'desc'; - - /** - * Ensures that this collection contains the specified element (optional - * operation). - * - * Returns `true` if this collection changed as a result of the call. - * (Returns `false` if this collection does not permit duplicates and - * already contains the specified element.) - * - * Collections that support this operation may place limitations on what - * elements may be added to this collection. In particular, some - * collections will refuse to add `null` elements, and others will impose - * restrictions on the type of elements that may be added. Collection - * classes should clearly specify in their documentation any restrictions - * on what elements may be added. - * - * If a collection refuses to add a particular element for any reason other - * than that it already contains the element, it must throw an exception - * (rather than returning `false`). This preserves the invariant that a - * collection always contains the specified element after this call returns. - * - * @param T $element The element to add to the collection. - * - * @return bool `true` if this collection changed as a result of the call. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function add($element): bool; - - /** - * Returns `true` if this collection contains the specified element. - * - * @param T $element The element to check whether the collection contains. - * @param bool $strict Whether to perform a strict type check on the value. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function contains($element, bool $strict = true): bool; - - /** - * Returns the type associated with this collection. - */ - public function getType(): string; - - /** - * Removes a single instance of the specified element from this collection, - * if it is present. - * - * @param T $element The element to remove from the collection. - * - * @return bool `true` if an element was removed as a result of this call. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function remove($element): bool; - - /** - * Returns the values from the given property or method. - * - * @param string $propertyOrMethod The property or method name to filter by. - * - * @return list - */ - public function column(string $propertyOrMethod): array; - - /** - * Returns the first item of the collection. - * - * @return T - */ - public function first(); - - /** - * Returns the last item of the collection. - * - * @return T - */ - public function last(); - - /** - * Sort the collection by a property or method with the given sort order. - * - * This will always leave the original collection untouched and will return - * a new one. - * - * @param string $propertyOrMethod The property or method to sort by. - * @param string $order The sort order for the resulting collection (one of - * this interface's `SORT_*` constants). - * - * @return CollectionInterface - */ - public function sort(string $propertyOrMethod, string $order = self::SORT_ASC): self; - - /** - * Filter out items of the collection which don't match the criteria of - * given callback. - * - * This will always leave the original collection untouched and will return - * a new one. - * - * See the {@link http://php.net/manual/en/function.array-filter.php PHP array_filter() documentation} - * for examples of how the `$callback` parameter works. - * - * @param callable(T):bool $callback A callable to use for filtering elements. - * - * @return CollectionInterface - */ - public function filter(callable $callback): self; - - /** - * Create a new collection where items match the criteria of given callback. - * - * This will always leave the original collection untouched and will return - * a new one. - * - * @param string $propertyOrMethod The property or method to evaluate. - * @param mixed $value The value to match. - * - * @return CollectionInterface - */ - public function where(string $propertyOrMethod, $value): self; - - /** - * Apply a given callback method on each item of the collection. - * - * This will always leave the original collection untouched. The new - * collection is created by mapping the callback to each item of the - * original collection. - * - * See the {@link http://php.net/manual/en/function.array-map.php PHP array_map() documentation} - * for examples of how the `$callback` parameter works. - * - * @param callable(T):TCallbackReturn $callback A callable to apply to each - * item of the collection. - * - * @return CollectionInterface - * - * @template TCallbackReturn - */ - public function map(callable $callback): self; - - /** - * Create a new collection with divergent items between current and given - * collection. - * - * @param CollectionInterface $other The collection to check for divergent - * items. - * - * @return CollectionInterface - */ - public function diff(CollectionInterface $other): self; - - /** - * Create a new collection with intersecting item between current and given - * collection. - * - * @param CollectionInterface $other The collection to check for - * intersecting items. - * - * @return CollectionInterface - */ - public function intersect(CollectionInterface $other): self; - - /** - * Merge current items and items of given collections into a new one. - * - * @param CollectionInterface ...$collections The collections to merge. - * - * @return CollectionInterface - */ - public function merge(CollectionInterface ...$collections): self; -} diff --git a/vendor/ramsey/collection/src/DoubleEndedQueue.php b/vendor/ramsey/collection/src/DoubleEndedQueue.php deleted file mode 100644 index c9c59502..00000000 --- a/vendor/ramsey/collection/src/DoubleEndedQueue.php +++ /dev/null @@ -1,187 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection; - -use Ramsey\Collection\Exception\InvalidArgumentException; -use Ramsey\Collection\Exception\NoSuchElementException; - -/** - * This class provides a basic implementation of `DoubleEndedQueueInterface`, to - * minimize the effort required to implement this interface. - * - * @template T - * @extends Queue - * @implements DoubleEndedQueueInterface - */ -class DoubleEndedQueue extends Queue implements DoubleEndedQueueInterface -{ - /** - * Index of the last element in the queue. - * - * @var int - */ - private $tail = -1; - - /** - * @inheritDoc - */ - public function offsetSet($offset, $value): void - { - if ($this->checkType($this->getType(), $value) === false) { - throw new InvalidArgumentException( - 'Value must be of type ' . $this->getType() . '; value is ' - . $this->toolValueToString($value) - ); - } - - $this->tail++; - - $this->data[$this->tail] = $value; - } - - /** - * @inheritDoc - */ - public function addFirst($element): bool - { - if ($this->checkType($this->getType(), $element) === false) { - throw new InvalidArgumentException( - 'Value must be of type ' . $this->getType() . '; value is ' - . $this->toolValueToString($element) - ); - } - - $this->index--; - - $this->data[$this->index] = $element; - - return true; - } - - /** - * @inheritDoc - */ - public function addLast($element): bool - { - return $this->add($element); - } - - /** - * @inheritDoc - */ - public function offerFirst($element): bool - { - try { - return $this->addFirst($element); - } catch (InvalidArgumentException $e) { - return false; - } - } - - /** - * @inheritDoc - */ - public function offerLast($element): bool - { - return $this->offer($element); - } - - /** - * @inheritDoc - */ - public function removeFirst() - { - return $this->remove(); - } - - /** - * @inheritDoc - */ - public function removeLast() - { - $tail = $this->pollLast(); - - if ($tail === null) { - throw new NoSuchElementException('Can\'t return element from Queue. Queue is empty.'); - } - - return $tail; - } - - /** - * @inheritDoc - */ - public function pollFirst() - { - return $this->poll(); - } - - /** - * @inheritDoc - */ - public function pollLast() - { - if ($this->count() === 0) { - return null; - } - - $tail = $this[$this->tail]; - - unset($this[$this->tail]); - $this->tail--; - - return $tail; - } - - /** - * @inheritDoc - */ - public function firstElement() - { - return $this->element(); - } - - /** - * @inheritDoc - */ - public function lastElement() - { - if ($this->count() === 0) { - throw new NoSuchElementException('Can\'t return element from Queue. Queue is empty.'); - } - - return $this->data[$this->tail]; - } - - /** - * @inheritDoc - */ - public function peekFirst() - { - return $this->peek(); - } - - /** - * @inheritDoc - */ - public function peekLast() - { - if ($this->count() === 0) { - return null; - } - - return $this->data[$this->tail]; - } -} diff --git a/vendor/ramsey/collection/src/DoubleEndedQueueInterface.php b/vendor/ramsey/collection/src/DoubleEndedQueueInterface.php deleted file mode 100644 index d7df5346..00000000 --- a/vendor/ramsey/collection/src/DoubleEndedQueueInterface.php +++ /dev/null @@ -1,316 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection; - -use Ramsey\Collection\Exception\NoSuchElementException; - -/** - * A linear collection that supports element insertion and removal at both ends. - * - * Most `DoubleEndedQueueInterface` implementations place no fixed limits on the - * number of elements they may contain, but this interface supports - * capacity-restricted double-ended queues as well as those with no fixed size - * limit. - * - * This interface defines methods to access the elements at both ends of the - * double-ended queue. Methods are provided to insert, remove, and examine the - * element. Each of these methods exists in two forms: one throws an exception - * if the operation fails, the other returns a special value (either `null` or - * `false`, depending on the operation). The latter form of the insert operation - * is designed specifically for use with capacity-restricted implementations; in - * most implementations, insert operations cannot fail. - * - * The twelve methods described above are summarized in the following table: - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
      Summary of DoubleEndedQueueInterface methods
      First Element (Head)Last Element (Tail)
      Throws exceptionSpecial valueThrows exceptionSpecial value
      InsertaddFirst()offerFirst()addLast()offerLast()
      RemoveremoveFirst()pollFirst()removeLast()pollLast()
      ExaminefirstElement()peekFirst()lastElement()peekLast()
      - * - * This interface extends the `QueueInterface`. When a double-ended queue is - * used as a queue, FIFO (first-in-first-out) behavior results. Elements are - * added at the end of the double-ended queue and removed from the beginning. - * The methods inherited from the `QueueInterface` are precisely equivalent to - * `DoubleEndedQueueInterface` methods as indicated in the following table: - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
      Comparison of QueueInterface and DoubleEndedQueueInterface methods
      QueueInterface MethodDoubleEndedQueueInterface Method
      add()addLast()
      offer()offerLast()
      remove()removeFirst()
      poll()pollFirst()
      element()firstElement()
      peek()peekFirst()
      - * - * Double-ended queues can also be used as LIFO (last-in-first-out) stacks. When - * a double-ended queue is used as a stack, elements are pushed and popped from - * the beginning of the double-ended queue. Stack concepts are precisely - * equivalent to `DoubleEndedQueueInterface` methods as indicated in the table - * below: - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
      Comparison of stack concepts and DoubleEndedQueueInterface methods
      Stack conceptDoubleEndedQueueInterface Method
      pushaddFirst()
      popremoveFirst()
      peekpeekFirst()
      - * - * Note that the `peek()` method works equally well when a double-ended queue is - * used as a queue or a stack; in either case, elements are drawn from the - * beginning of the double-ended queue. - * - * While `DoubleEndedQueueInterface` implementations are not strictly required - * to prohibit the insertion of `null` elements, they are strongly encouraged to - * do so. Users of any `DoubleEndedQueueInterface` implementations that do allow - * `null` elements are strongly encouraged *not* to take advantage of the - * ability to insert nulls. This is so because `null` is used as a special - * return value by various methods to indicated that the double-ended queue is - * empty. - * - * @template T - * @extends QueueInterface - */ -interface DoubleEndedQueueInterface extends QueueInterface -{ - /** - * Inserts the specified element at the front of this queue if it is - * possible to do so immediately without violating capacity restrictions. - * - * When using a capacity-restricted double-ended queue, it is generally - * preferable to use the `offerFirst()` method. - * - * @param T $element The element to add to the front of this queue. - * - * @return bool `true` if this queue changed as a result of the call. - * - * @throws \RuntimeException if a queue refuses to add a particular element - * for any reason other than that it already contains the element. - * Implementations should use a more-specific exception that extends - * `\RuntimeException`. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function addFirst($element): bool; - - /** - * Inserts the specified element at the end of this queue if it is possible - * to do so immediately without violating capacity restrictions. - * - * When using a capacity-restricted double-ended queue, it is generally - * preferable to use the `offerLast()` method. - * - * This method is equivalent to `add()`. - * - * @param T $element The element to add to the end of this queue. - * - * @return bool `true` if this queue changed as a result of the call. - * - * @throws \RuntimeException if a queue refuses to add a particular element - * for any reason other than that it already contains the element. - * Implementations should use a more-specific exception that extends - * `\RuntimeException`. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function addLast($element): bool; - - /** - * Inserts the specified element at the front of this queue if it is - * possible to do so immediately without violating capacity restrictions. - * - * When using a capacity-restricted queue, this method is generally - * preferable to `addFirst()`, which can fail to insert an element only by - * throwing an exception. - * - * @param T $element The element to add to the front of this queue. - * - * @return bool `true` if the element was added to this queue, else `false`. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function offerFirst($element): bool; - - /** - * Inserts the specified element at the end of this queue if it is possible - * to do so immediately without violating capacity restrictions. - * - * When using a capacity-restricted queue, this method is generally - * preferable to `addLast()` which can fail to insert an element only by - * throwing an exception. - * - * @param T $element The element to add to the end of this queue. - * - * @return bool `true` if the element was added to this queue, else `false`. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function offerLast($element): bool; - - /** - * Retrieves and removes the head of this queue. - * - * This method differs from `pollFirst()` only in that it throws an - * exception if this queue is empty. - * - * @return T the first element in this queue. - * - * @throws NoSuchElementException if this queue is empty. - */ - public function removeFirst(); - - /** - * Retrieves and removes the tail of this queue. - * - * This method differs from `pollLast()` only in that it throws an exception - * if this queue is empty. - * - * @return T the last element in this queue. - * - * @throws NoSuchElementException if this queue is empty. - */ - public function removeLast(); - - /** - * Retrieves and removes the head of this queue, or returns `null` if this - * queue is empty. - * - * @return T|null the head of this queue, or `null` if this queue is empty. - */ - public function pollFirst(); - - /** - * Retrieves and removes the tail of this queue, or returns `null` if this - * queue is empty. - * - * @return T|null the tail of this queue, or `null` if this queue is empty. - */ - public function pollLast(); - - /** - * Retrieves, but does not remove, the head of this queue. - * - * This method differs from `peekFirst()` only in that it throws an - * exception if this queue is empty. - * - * @return T the head of this queue. - * - * @throws NoSuchElementException if this queue is empty. - */ - public function firstElement(); - - /** - * Retrieves, but does not remove, the tail of this queue. - * - * This method differs from `peekLast()` only in that it throws an exception - * if this queue is empty. - * - * @return T the tail of this queue. - * - * @throws NoSuchElementException if this queue is empty. - */ - public function lastElement(); - - /** - * Retrieves, but does not remove, the head of this queue, or returns `null` - * if this queue is empty. - * - * @return T|null the head of this queue, or `null` if this queue is empty. - */ - public function peekFirst(); - - /** - * Retrieves, but does not remove, the tail of this queue, or returns `null` - * if this queue is empty. - * - * @return T|null the tail of this queue, or `null` if this queue is empty. - */ - public function peekLast(); -} diff --git a/vendor/ramsey/collection/src/Exception/CollectionMismatchException.php b/vendor/ramsey/collection/src/Exception/CollectionMismatchException.php deleted file mode 100644 index d4b335f4..00000000 --- a/vendor/ramsey/collection/src/Exception/CollectionMismatchException.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection\Exception; - -/** - * Thrown when attempting to operate on collections of differing types. - */ -class CollectionMismatchException extends \RuntimeException -{ -} diff --git a/vendor/ramsey/collection/src/Exception/InvalidArgumentException.php b/vendor/ramsey/collection/src/Exception/InvalidArgumentException.php deleted file mode 100644 index dcc3eac6..00000000 --- a/vendor/ramsey/collection/src/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection\Exception; - -/** - * Thrown to indicate an argument is not of the expected type. - */ -class InvalidArgumentException extends \InvalidArgumentException -{ -} diff --git a/vendor/ramsey/collection/src/Exception/InvalidSortOrderException.php b/vendor/ramsey/collection/src/Exception/InvalidSortOrderException.php deleted file mode 100644 index 9337ccc6..00000000 --- a/vendor/ramsey/collection/src/Exception/InvalidSortOrderException.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection\Exception; - -/** - * Thrown when attempting to use a sort order that is not recognized. - */ -class InvalidSortOrderException extends \RuntimeException -{ -} diff --git a/vendor/ramsey/collection/src/Exception/NoSuchElementException.php b/vendor/ramsey/collection/src/Exception/NoSuchElementException.php deleted file mode 100644 index 9debe8f6..00000000 --- a/vendor/ramsey/collection/src/Exception/NoSuchElementException.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection\Exception; - -/** - * Thrown when attempting to access an element that does not exist. - */ -class NoSuchElementException extends \RuntimeException -{ -} diff --git a/vendor/ramsey/collection/src/Exception/OutOfBoundsException.php b/vendor/ramsey/collection/src/Exception/OutOfBoundsException.php deleted file mode 100644 index 4e9d16fa..00000000 --- a/vendor/ramsey/collection/src/Exception/OutOfBoundsException.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection\Exception; - -/** - * Thrown when attempting to access an element out of the range of the collection. - */ -class OutOfBoundsException extends \OutOfBoundsException -{ -} diff --git a/vendor/ramsey/collection/src/Exception/UnsupportedOperationException.php b/vendor/ramsey/collection/src/Exception/UnsupportedOperationException.php deleted file mode 100644 index 8f45e583..00000000 --- a/vendor/ramsey/collection/src/Exception/UnsupportedOperationException.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection\Exception; - -/** - * Thrown to indicate that the requested operation is not supported. - */ -class UnsupportedOperationException extends \RuntimeException -{ -} diff --git a/vendor/ramsey/collection/src/Exception/ValueExtractionException.php b/vendor/ramsey/collection/src/Exception/ValueExtractionException.php deleted file mode 100644 index f6c6cb4e..00000000 --- a/vendor/ramsey/collection/src/Exception/ValueExtractionException.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection\Exception; - -/** - * Thrown when attempting to extract a value for a method or property that does not exist. - */ -class ValueExtractionException extends \RuntimeException -{ -} diff --git a/vendor/ramsey/collection/src/GenericArray.php b/vendor/ramsey/collection/src/GenericArray.php deleted file mode 100644 index 2b079aa5..00000000 --- a/vendor/ramsey/collection/src/GenericArray.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection; - -/** - * `GenericArray` represents a standard array object. - * - * @extends AbstractArray - */ -class GenericArray extends AbstractArray -{ -} diff --git a/vendor/ramsey/collection/src/Map/AbstractMap.php b/vendor/ramsey/collection/src/Map/AbstractMap.php deleted file mode 100644 index ae9f2fe6..00000000 --- a/vendor/ramsey/collection/src/Map/AbstractMap.php +++ /dev/null @@ -1,162 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection\Map; - -use Ramsey\Collection\AbstractArray; -use Ramsey\Collection\Exception\InvalidArgumentException; - -use function array_key_exists; -use function array_keys; -use function in_array; - -/** - * This class provides a basic implementation of `MapInterface`, to minimize the - * effort required to implement this interface. - * - * @template T - * @extends AbstractArray - * @implements MapInterface - */ -abstract class AbstractMap extends AbstractArray implements MapInterface -{ - /** - * @inheritDoc - */ - public function offsetSet($offset, $value): void - { - if ($offset === null) { - throw new InvalidArgumentException( - 'Map elements are key/value pairs; a key must be provided for ' - . 'value ' . var_export($value, true) - ); - } - - $this->data[$offset] = $value; - } - - /** - * @inheritDoc - */ - public function containsKey($key): bool - { - return array_key_exists($key, $this->data); - } - - /** - * @inheritDoc - */ - public function containsValue($value): bool - { - return in_array($value, $this->data, true); - } - - /** - * @inheritDoc - */ - public function keys(): array - { - return array_keys($this->data); - } - - /** - * @inheritDoc - */ - public function get($key, $defaultValue = null) - { - if (!$this->containsKey($key)) { - return $defaultValue; - } - - return $this[$key]; - } - - /** - * @inheritDoc - */ - public function put($key, $value) - { - $previousValue = $this->get($key); - $this[$key] = $value; - - return $previousValue; - } - - /** - * @inheritDoc - */ - public function putIfAbsent($key, $value) - { - $currentValue = $this->get($key); - - if ($currentValue === null) { - $this[$key] = $value; - } - - return $currentValue; - } - - /** - * @inheritDoc - */ - public function remove($key) - { - $previousValue = $this->get($key); - unset($this[$key]); - - return $previousValue; - } - - /** - * @inheritDoc - */ - public function removeIf($key, $value): bool - { - if ($this->get($key) === $value) { - unset($this[$key]); - - return true; - } - - return false; - } - - /** - * @inheritDoc - */ - public function replace($key, $value) - { - $currentValue = $this->get($key); - - if ($this->containsKey($key)) { - $this[$key] = $value; - } - - return $currentValue; - } - - /** - * @inheritDoc - */ - public function replaceIf($key, $oldValue, $newValue): bool - { - if ($this->get($key) === $oldValue) { - $this[$key] = $newValue; - - return true; - } - - return false; - } -} diff --git a/vendor/ramsey/collection/src/Map/AbstractTypedMap.php b/vendor/ramsey/collection/src/Map/AbstractTypedMap.php deleted file mode 100644 index 551d2e6c..00000000 --- a/vendor/ramsey/collection/src/Map/AbstractTypedMap.php +++ /dev/null @@ -1,69 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection\Map; - -use Ramsey\Collection\Exception\InvalidArgumentException; -use Ramsey\Collection\Tool\TypeTrait; -use Ramsey\Collection\Tool\ValueToStringTrait; - -/** - * This class provides a basic implementation of `TypedMapInterface`, to - * minimize the effort required to implement this interface. - * - * @template K - * @template T - * @extends AbstractMap - * @implements TypedMapInterface - */ -abstract class AbstractTypedMap extends AbstractMap implements TypedMapInterface -{ - use TypeTrait; - use ValueToStringTrait; - - /** - * @param K|null $offset - * @param T $value - * - * @inheritDoc - * - * @psalm-suppress MoreSpecificImplementedParamType - */ - public function offsetSet($offset, $value): void - { - if ($offset === null) { - throw new InvalidArgumentException( - 'Map elements are key/value pairs; a key must be provided for ' - . 'value ' . var_export($value, true) - ); - } - - if ($this->checkType($this->getKeyType(), $offset) === false) { - throw new InvalidArgumentException( - 'Key must be of type ' . $this->getKeyType() . '; key is ' - . $this->toolValueToString($offset) - ); - } - - if ($this->checkType($this->getValueType(), $value) === false) { - throw new InvalidArgumentException( - 'Value must be of type ' . $this->getValueType() . '; value is ' - . $this->toolValueToString($value) - ); - } - - /** @psalm-suppress MixedArgumentTypeCoercion */ - parent::offsetSet($offset, $value); - } -} diff --git a/vendor/ramsey/collection/src/Map/AssociativeArrayMap.php b/vendor/ramsey/collection/src/Map/AssociativeArrayMap.php deleted file mode 100644 index 79a314d9..00000000 --- a/vendor/ramsey/collection/src/Map/AssociativeArrayMap.php +++ /dev/null @@ -1,25 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection\Map; - -/** - * `AssociativeArrayMap` represents a standard associative array object. - * - * @template T - * @extends AbstractMap - */ -class AssociativeArrayMap extends AbstractMap -{ -} diff --git a/vendor/ramsey/collection/src/Map/MapInterface.php b/vendor/ramsey/collection/src/Map/MapInterface.php deleted file mode 100644 index 6ed0b296..00000000 --- a/vendor/ramsey/collection/src/Map/MapInterface.php +++ /dev/null @@ -1,149 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection\Map; - -use Ramsey\Collection\ArrayInterface; - -/** - * An object that maps keys to values. - * - * A map cannot contain duplicate keys; each key can map to at most one value. - * - * @template T - * @extends ArrayInterface - */ -interface MapInterface extends ArrayInterface -{ - /** - * Returns `true` if this map contains a mapping for the specified key. - * - * @param array-key $key The key to check in the map. - */ - public function containsKey($key): bool; - - /** - * Returns `true` if this map maps one or more keys to the specified value. - * - * This performs a strict type check on the value. - * - * @param T $value The value to check in the map. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function containsValue($value): bool; - - /** - * Return an array of the keys contained in this map. - * - * @return list - */ - public function keys(): array; - - /** - * Returns the value to which the specified key is mapped, `null` if this - * map contains no mapping for the key, or (optionally) `$defaultValue` if - * this map contains no mapping for the key. - * - * @param array-key $key The key to return from the map. - * @param T|null $defaultValue The default value to use if `$key` is not found. - * - * @return T|null the value or `null` if the key could not be found. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function get($key, $defaultValue = null); - - /** - * Associates the specified value with the specified key in this map. - * - * If the map previously contained a mapping for the key, the old value is - * replaced by the specified value. - * - * @param array-key $key The key to put or replace in the map. - * @param T $value The value to store at `$key`. - * - * @return T|null the previous value associated with key, or `null` if - * there was no mapping for `$key`. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function put($key, $value); - - /** - * Associates the specified value with the specified key in this map only if - * it is not already set. - * - * If there is already a value associated with `$key`, this returns that - * value without replacing it. - * - * @param array-key $key The key to put in the map. - * @param T $value The value to store at `$key`. - * - * @return T|null the previous value associated with key, or `null` if - * there was no mapping for `$key`. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function putIfAbsent($key, $value); - - /** - * Removes the mapping for a key from this map if it is present. - * - * @param array-key $key The key to remove from the map. - * - * @return T|null the previous value associated with key, or `null` if - * there was no mapping for `$key`. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function remove($key); - - /** - * Removes the entry for the specified key only if it is currently mapped to - * the specified value. - * - * This performs a strict type check on the value. - * - * @param array-key $key The key to remove from the map. - * @param T $value The value to match. - * - * @return bool true if the value was removed. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function removeIf($key, $value): bool; - - /** - * Replaces the entry for the specified key only if it is currently mapped - * to some value. - * - * @param array-key $key The key to replace. - * @param T $value The value to set at `$key`. - * - * @return T|null the previous value associated with key, or `null` if - * there was no mapping for `$key`. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function replace($key, $value); - - /** - * Replaces the entry for the specified key only if currently mapped to the - * specified value. - * - * This performs a strict type check on the value. - * - * @param array-key $key The key to remove from the map. - * @param T $oldValue The value to match. - * @param T $newValue The value to use as a replacement. - * - * @return bool true if the value was replaced. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function replaceIf($key, $oldValue, $newValue): bool; -} diff --git a/vendor/ramsey/collection/src/Map/NamedParameterMap.php b/vendor/ramsey/collection/src/Map/NamedParameterMap.php deleted file mode 100644 index 9926ddd8..00000000 --- a/vendor/ramsey/collection/src/Map/NamedParameterMap.php +++ /dev/null @@ -1,120 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection\Map; - -use Ramsey\Collection\Exception\InvalidArgumentException; -use Ramsey\Collection\Tool\TypeTrait; -use Ramsey\Collection\Tool\ValueToStringTrait; - -use function array_combine; -use function array_key_exists; -use function is_int; - -/** - * `NamedParameterMap` represents a mapping of values to a set of named keys - * that may optionally be typed - * - * @extends AbstractMap - */ -class NamedParameterMap extends AbstractMap -{ - use TypeTrait; - use ValueToStringTrait; - - /** - * Named parameters defined for this map. - * - * @var array - */ - protected $namedParameters; - - /** - * Constructs a new `NamedParameterMap`. - * - * @param array $namedParameters The named parameters defined for this map. - * @param array $data An initial set of data to set on this map. - */ - public function __construct(array $namedParameters, array $data = []) - { - $this->namedParameters = $this->filterNamedParameters($namedParameters); - parent::__construct($data); - } - - /** - * Returns named parameters set for this `NamedParameterMap`. - * - * @return array - */ - public function getNamedParameters(): array - { - return $this->namedParameters; - } - - /** - * @inheritDoc - */ - public function offsetSet($offset, $value): void - { - if ($offset === null) { - throw new InvalidArgumentException( - 'Map elements are key/value pairs; a key must be provided for ' - . 'value ' . var_export($value, true) - ); - } - - if (!array_key_exists($offset, $this->namedParameters)) { - throw new InvalidArgumentException( - 'Attempting to set value for unconfigured parameter \'' - . $offset . '\'' - ); - } - - if ($this->checkType($this->namedParameters[$offset], $value) === false) { - throw new InvalidArgumentException( - 'Value for \'' . $offset . '\' must be of type ' - . $this->namedParameters[$offset] . '; value is ' - . $this->toolValueToString($value) - ); - } - - $this->data[$offset] = $value; - } - - /** - * Given an array of named parameters, constructs a proper mapping of - * named parameters to types. - * - * @param array $namedParameters The named parameters to filter. - * - * @return array - */ - protected function filterNamedParameters(array $namedParameters): array - { - $names = []; - $types = []; - - foreach ($namedParameters as $key => $value) { - if (is_int($key)) { - $names[] = $value; - $types[] = 'mixed'; - } else { - $names[] = $key; - $types[] = $value; - } - } - - return array_combine($names, $types) ?: []; - } -} diff --git a/vendor/ramsey/collection/src/Map/TypedMap.php b/vendor/ramsey/collection/src/Map/TypedMap.php deleted file mode 100644 index 2e796377..00000000 --- a/vendor/ramsey/collection/src/Map/TypedMap.php +++ /dev/null @@ -1,137 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection\Map; - -use Ramsey\Collection\Tool\TypeTrait; - -/** - * A `TypedMap` represents a map of elements where key and value are typed. - * - * Each element is identified by a key with defined type and a value of defined - * type. The keys of the map must be unique. The values on the map can be= - * repeated but each with its own different key. - * - * The most common case is to use a string type key, but it's not limited to - * this type of keys. - * - * This is a direct implementation of `TypedMapInterface`, provided for the sake - * of convenience. - * - * Example usage: - * - * ```php - * $map = new TypedMap('string', Foo::class); - * $map['x'] = new Foo(); - * foreach ($map as $key => $value) { - * // do something with $key, it will be a Foo::class - * } - * - * // this will throw an exception since key must be string - * $map[10] = new Foo(); - * - * // this will throw an exception since value must be a Foo - * $map['bar'] = 'bar'; - * - * // initialize map with contents - * $map = new TypedMap('string', Foo::class, [ - * new Foo(), new Foo(), new Foo() - * ]); - * ``` - * - * It is preferable to subclass `AbstractTypedMap` to create your own typed map - * implementation: - * - * ```php - * class FooTypedMap extends AbstractTypedMap - * { - * public function getKeyType() - * { - * return 'int'; - * } - * - * public function getValueType() - * { - * return Foo::class; - * } - * } - * ``` - * - * … but you also may use the `TypedMap` class: - * - * ```php - * class FooTypedMap extends TypedMap - * { - * public function __constructor(array $data = []) - * { - * parent::__construct('int', Foo::class, $data); - * } - * } - * ``` - * - * @template K - * @template T - * @extends AbstractTypedMap - */ -class TypedMap extends AbstractTypedMap -{ - use TypeTrait; - - /** - * The data type of keys stored in this collection. - * - * A map key's type is immutable once it is set. For this reason, this - * property is set private. - * - * @var string data type of the map key. - */ - private $keyType; - - /** - * The data type of values stored in this collection. - * - * A map value's type is immutable once it is set. For this reason, this - * property is set private. - * - * @var string data type of the map value. - */ - private $valueType; - - /** - * Constructs a map object of the specified key and value types, - * optionally with the specified data. - * - * @param string $keyType The data type of the map's keys. - * @param string $valueType The data type of the map's values. - * @param array $data The initial data to set for this map. - */ - public function __construct(string $keyType, string $valueType, array $data = []) - { - $this->keyType = $keyType; - $this->valueType = $valueType; - - /** @psalm-suppress MixedArgumentTypeCoercion */ - parent::__construct($data); - } - - public function getKeyType(): string - { - return $this->keyType; - } - - public function getValueType(): string - { - return $this->valueType; - } -} diff --git a/vendor/ramsey/collection/src/Map/TypedMapInterface.php b/vendor/ramsey/collection/src/Map/TypedMapInterface.php deleted file mode 100644 index 0308109c..00000000 --- a/vendor/ramsey/collection/src/Map/TypedMapInterface.php +++ /dev/null @@ -1,35 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection\Map; - -/** - * A `TypedMapInterface` represents a map of elements where key and value are - * typed. - * - * @template T - * @extends MapInterface - */ -interface TypedMapInterface extends MapInterface -{ - /** - * Return the type used on the key. - */ - public function getKeyType(): string; - - /** - * Return the type forced on the values. - */ - public function getValueType(): string; -} diff --git a/vendor/ramsey/collection/src/Queue.php b/vendor/ramsey/collection/src/Queue.php deleted file mode 100644 index 93e032b4..00000000 --- a/vendor/ramsey/collection/src/Queue.php +++ /dev/null @@ -1,169 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection; - -use Ramsey\Collection\Exception\InvalidArgumentException; -use Ramsey\Collection\Exception\NoSuchElementException; -use Ramsey\Collection\Tool\TypeTrait; -use Ramsey\Collection\Tool\ValueToStringTrait; - -/** - * This class provides a basic implementation of `QueueInterface`, to minimize - * the effort required to implement this interface. - * - * @template T - * @extends AbstractArray - * @implements QueueInterface - */ -class Queue extends AbstractArray implements QueueInterface -{ - use TypeTrait; - use ValueToStringTrait; - - /** - * The type of elements stored in this queue. - * - * A queue's type is immutable once it is set. For this reason, this - * property is set private. - * - * @var string - */ - private $queueType; - - /** - * The index of the head of the queue. - * - * @var int - */ - protected $index = 0; - - /** - * Constructs a queue object of the specified type, optionally with the - * specified data. - * - * @param string $queueType The type (FQCN) associated with this queue. - * @param array $data The initial items to store in the collection. - */ - public function __construct(string $queueType, array $data = []) - { - $this->queueType = $queueType; - parent::__construct($data); - } - - /** - * {@inheritDoc} - * - * Since arbitrary offsets may not be manipulated in a queue, this method - * serves only to fulfill the `ArrayAccess` interface requirements. It is - * invoked by other operations when adding values to the queue. - */ - public function offsetSet($offset, $value): void - { - if ($this->checkType($this->getType(), $value) === false) { - throw new InvalidArgumentException( - 'Value must be of type ' . $this->getType() . '; value is ' - . $this->toolValueToString($value) - ); - } - - $this->data[] = $value; - } - - /** - * @inheritDoc - */ - public function add($element): bool - { - $this[] = $element; - - return true; - } - - /** - * @inheritDoc - */ - public function element() - { - $element = $this->peek(); - - if ($element === null) { - throw new NoSuchElementException( - 'Can\'t return element from Queue. Queue is empty.' - ); - } - - return $element; - } - - /** - * @inheritDoc - */ - public function offer($element): bool - { - try { - return $this->add($element); - } catch (InvalidArgumentException $e) { - return false; - } - } - - /** - * @inheritDoc - */ - public function peek() - { - if ($this->count() === 0) { - return null; - } - - return $this[$this->index]; - } - - /** - * @inheritDoc - */ - public function poll() - { - if ($this->count() === 0) { - return null; - } - - $head = $this[$this->index]; - - unset($this[$this->index]); - $this->index++; - - return $head; - } - - /** - * @inheritDoc - */ - public function remove() - { - $head = $this->poll(); - - if ($head === null) { - throw new NoSuchElementException('Can\'t return element from Queue. Queue is empty.'); - } - - return $head; - } - - public function getType(): string - { - return $this->queueType; - } -} diff --git a/vendor/ramsey/collection/src/QueueInterface.php b/vendor/ramsey/collection/src/QueueInterface.php deleted file mode 100644 index 8c7383df..00000000 --- a/vendor/ramsey/collection/src/QueueInterface.php +++ /dev/null @@ -1,203 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection; - -use Ramsey\Collection\Exception\NoSuchElementException; - -/** - * A queue is a collection in which the entities in the collection are kept in - * order. - * - * The principal operations on the queue are the addition of entities to the end - * (tail), also known as *enqueue*, and removal of entities from the front - * (head), also known as *dequeue*. This makes the queue a first-in-first-out - * (FIFO) data structure. - * - * Besides basic array operations, queues provide additional insertion, - * extraction, and inspection operations. Each of these methods exists in two - * forms: one throws an exception if the operation fails, the other returns a - * special value (either `null` or `false`, depending on the operation). The - * latter form of the insert operation is designed specifically for use with - * capacity-restricted `QueueInterface` implementations; in most - * implementations, insert operations cannot fail. - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
      Summary of QueueInterface methods
      Throws exceptionReturns special value
      Insertadd()offer()
      Removeremove()poll()
      Examineelement()peek()
      - * - * Queues typically, but do not necessarily, order elements in a FIFO - * (first-in-first-out) manner. Among the exceptions are priority queues, which - * order elements according to a supplied comparator, or the elements' natural - * ordering, and LIFO queues (or stacks) which order the elements LIFO - * (last-in-first-out). Whatever the ordering used, the head of the queue is - * that element which would be removed by a call to remove() or poll(). In a - * FIFO queue, all new elements are inserted at the tail of the queue. Other - * kinds of queues may use different placement rules. Every `QueueInterface` - * implementation must specify its ordering properties. - * - * The `offer()` method inserts an element if possible, otherwise returning - * `false`. This differs from the `add()` method, which can fail to add an - * element only by throwing an unchecked exception. The `offer()` method is - * designed for use when failure is a normal, rather than exceptional - * occurrence, for example, in fixed-capacity (or "bounded") queues. - * - * The `remove()` and `poll()` methods remove and return the head of the queue. - * Exactly which element is removed from the queue is a function of the queue's - * ordering policy, which differs from implementation to implementation. The - * `remove()` and `poll()` methods differ only in their behavior when the queue - * is empty: the `remove()` method throws an exception, while the `poll()` - * method returns `null`. - * - * The `element()` and `peek()` methods return, but do not remove, the head of - * the queue. - * - * `QueueInterface` implementations generally do not allow insertion of `null` - * elements, although some implementations do not prohibit insertion of `null`. - * Even in the implementations that permit it, `null` should not be inserted - * into a queue, as `null` is also used as a special return value by the - * `poll()` method to indicate that the queue contains no elements. - * - * @template T - * @extends ArrayInterface - */ -interface QueueInterface extends ArrayInterface -{ - /** - * Ensures that this queue contains the specified element (optional - * operation). - * - * Returns `true` if this queue changed as a result of the call. (Returns - * `false` if this queue does not permit duplicates and already contains the - * specified element.) - * - * Queues that support this operation may place limitations on what elements - * may be added to this queue. In particular, some queues will refuse to add - * `null` elements, and others will impose restrictions on the type of - * elements that may be added. Queue classes should clearly specify in their - * documentation any restrictions on what elements may be added. - * - * If a queue refuses to add a particular element for any reason other than - * that it already contains the element, it must throw an exception (rather - * than returning `false`). This preserves the invariant that a queue always - * contains the specified element after this call returns. - * - * @see self::offer() - * - * @param T $element The element to add to this queue. - * - * @return bool `true` if this queue changed as a result of the call. - * - * @throws \RuntimeException if a queue refuses to add a particular element - * for any reason other than that it already contains the element. - * Implementations should use a more-specific exception that extends - * `\RuntimeException`. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function add($element): bool; - - /** - * Retrieves, but does not remove, the head of this queue. - * - * This method differs from `peek()` only in that it throws an exception if - * this queue is empty. - * - * @see self::peek() - * - * @return T the head of this queue. - * - * @throws NoSuchElementException if this queue is empty. - */ - public function element(); - - /** - * Inserts the specified element into this queue if it is possible to do so - * immediately without violating capacity restrictions. - * - * When using a capacity-restricted queue, this method is generally - * preferable to `add()`, which can fail to insert an element only by - * throwing an exception. - * - * @see self::add() - * - * @param T $element The element to add to this queue. - * - * @return bool `true` if the element was added to this queue, else `false`. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function offer($element): bool; - - /** - * Retrieves, but does not remove, the head of this queue, or returns `null` - * if this queue is empty. - * - * @see self::element() - * - * @return T|null the head of this queue, or `null` if this queue is empty. - */ - public function peek(); - - /** - * Retrieves and removes the head of this queue, or returns `null` - * if this queue is empty. - * - * @see self::remove() - * - * @return T|null the head of this queue, or `null` if this queue is empty. - */ - public function poll(); - - /** - * Retrieves and removes the head of this queue. - * - * This method differs from `poll()` only in that it throws an exception if - * this queue is empty. - * - * @see self::poll() - * - * @return T the head of this queue. - * - * @throws NoSuchElementException if this queue is empty. - */ - public function remove(); - - /** - * Returns the type associated with this queue. - */ - public function getType(): string; -} diff --git a/vendor/ramsey/collection/src/Set.php b/vendor/ramsey/collection/src/Set.php deleted file mode 100644 index 6932f247..00000000 --- a/vendor/ramsey/collection/src/Set.php +++ /dev/null @@ -1,69 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection; - -/** - * A set is a collection that contains no duplicate elements. - * - * Great care must be exercised if mutable objects are used as set elements. - * The behavior of a set is not specified if the value of an object is changed - * in a manner that affects equals comparisons while the object is an element in - * the set. - * - * Example usage: - * - * ``` php - * $foo = new \My\Foo(); - * $set = new Set(\My\Foo::class); - * - * $set->add($foo); // returns TRUE, the element don't exists - * $set->add($foo); // returns FALSE, the element already exists - * - * $bar = new \My\Foo(); - * $set->add($bar); // returns TRUE, $bar !== $foo - * ``` - * - * @template T - * @extends AbstractSet - */ -class Set extends AbstractSet -{ - /** - * The type of elements stored in this set - * - * A set's type is immutable. For this reason, this property is private. - * - * @var string - */ - private $setType; - - /** - * Constructs a set object of the specified type, optionally with the - * specified data. - * - * @param string $setType The type (FQCN) associated with this set. - * @param array $data The initial items to store in the set. - */ - public function __construct(string $setType, array $data = []) - { - $this->setType = $setType; - parent::__construct($data); - } - - public function getType(): string - { - return $this->setType; - } -} diff --git a/vendor/ramsey/collection/src/Tool/TypeTrait.php b/vendor/ramsey/collection/src/Tool/TypeTrait.php deleted file mode 100644 index 8214e965..00000000 --- a/vendor/ramsey/collection/src/Tool/TypeTrait.php +++ /dev/null @@ -1,73 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection\Tool; - -use function is_array; -use function is_bool; -use function is_callable; -use function is_float; -use function is_int; -use function is_numeric; -use function is_object; -use function is_resource; -use function is_scalar; -use function is_string; - -/** - * Provides functionality to check values for specific types. - */ -trait TypeTrait -{ - /** - * Returns `true` if value is of the specified type. - * - * @param string $type The type to check the value against. - * @param mixed $value The value to check. - */ - protected function checkType(string $type, $value): bool - { - switch ($type) { - case 'array': - return is_array($value); - case 'bool': - case 'boolean': - return is_bool($value); - case 'callable': - return is_callable($value); - case 'float': - case 'double': - return is_float($value); - case 'int': - case 'integer': - return is_int($value); - case 'null': - return $value === null; - case 'numeric': - return is_numeric($value); - case 'object': - return is_object($value); - case 'resource': - return is_resource($value); - case 'scalar': - return is_scalar($value); - case 'string': - return is_string($value); - case 'mixed': - return true; - default: - return $value instanceof $type; - } - } -} diff --git a/vendor/ramsey/collection/src/Tool/ValueExtractorTrait.php b/vendor/ramsey/collection/src/Tool/ValueExtractorTrait.php deleted file mode 100644 index f9be1be2..00000000 --- a/vendor/ramsey/collection/src/Tool/ValueExtractorTrait.php +++ /dev/null @@ -1,58 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection\Tool; - -use Ramsey\Collection\Exception\ValueExtractionException; - -use function get_class; -use function method_exists; -use function property_exists; -use function sprintf; - -/** - * Provides functionality to extract the value of a property or method from an object. - */ -trait ValueExtractorTrait -{ - /** - * Extracts the value of the given property or method from the object. - * - * @param mixed $object The object to extract the value from. - * @param string $propertyOrMethod The property or method for which the - * value should be extracted. - * - * @return mixed the value extracted from the specified property or method. - * - * @throws ValueExtractionException if the method or property is not defined. - */ - protected function extractValue($object, string $propertyOrMethod) - { - if (!is_object($object)) { - throw new ValueExtractionException('Unable to extract a value from a non-object'); - } - - if (property_exists($object, $propertyOrMethod)) { - return $object->$propertyOrMethod; - } - - if (method_exists($object, $propertyOrMethod)) { - return $object->{$propertyOrMethod}(); - } - - throw new ValueExtractionException( - sprintf('Method or property "%s" not defined in %s', $propertyOrMethod, get_class($object)) - ); - } -} diff --git a/vendor/ramsey/collection/src/Tool/ValueToStringTrait.php b/vendor/ramsey/collection/src/Tool/ValueToStringTrait.php deleted file mode 100644 index 721ade00..00000000 --- a/vendor/ramsey/collection/src/Tool/ValueToStringTrait.php +++ /dev/null @@ -1,94 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection\Tool; - -use DateTimeInterface; - -use function get_class; -use function get_resource_type; -use function is_array; -use function is_bool; -use function is_callable; -use function is_resource; -use function is_scalar; - -/** - * Provides functionality to express a value as string - */ -trait ValueToStringTrait -{ - /** - * Returns a string representation of the value. - * - * - null value: `'NULL'` - * - boolean: `'TRUE'`, `'FALSE'` - * - array: `'Array'` - * - scalar: converted-value - * - resource: `'(type resource #number)'` - * - object with `__toString()`: result of `__toString()` - * - object DateTime: ISO 8601 date - * - object: `'(className Object)'` - * - anonymous function: same as object - * - * @param mixed $value the value to return as a string. - */ - protected function toolValueToString($value): string - { - // null - if ($value === null) { - return 'NULL'; - } - - // boolean constants - if (is_bool($value)) { - return $value ? 'TRUE' : 'FALSE'; - } - - // array - if (is_array($value)) { - return 'Array'; - } - - // scalar types (integer, float, string) - if (is_scalar($value)) { - return (string) $value; - } - - // resource - if (is_resource($value)) { - return '(' . get_resource_type($value) . ' resource #' . (int) $value . ')'; - } - - // If we don't know what it is, use var_export(). - if (!is_object($value)) { - return '(' . var_export($value, true) . ')'; - } - - // From here, $value should be an object. - - // __toString() is implemented - if (is_callable([$value, '__toString'])) { - return (string) $value->__toString(); - } - - // object of type \DateTime - if ($value instanceof DateTimeInterface) { - return $value->format('c'); - } - - // unknown type - return '(' . get_class($value) . ' Object)'; - } -} diff --git a/vendor/ramsey/uuid/LICENSE b/vendor/ramsey/uuid/LICENSE deleted file mode 100644 index 2e8ef166..00000000 --- a/vendor/ramsey/uuid/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2012-2022 Ben Ramsey - -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/ramsey/uuid/README.md b/vendor/ramsey/uuid/README.md deleted file mode 100644 index 0db81495..00000000 --- a/vendor/ramsey/uuid/README.md +++ /dev/null @@ -1,83 +0,0 @@ -

      ramsey/uuid

      - -

      - A PHP library for generating and working with UUIDs. -

      - -

      - Source Code - Download Package - PHP Programming Language - Read License - Build Status - Codecov Code Coverage - Psalm Type Coverage -

      - -ramsey/uuid is a PHP library for generating and working with universally unique -identifiers (UUIDs). - -This project adheres to a [code of conduct](CODE_OF_CONDUCT.md). -By participating in this project and its community, you are expected to -uphold this code. - -Much inspiration for this library came from the [Java][javauuid] and -[Python][pyuuid] UUID libraries. - -## Installation - -The preferred method of installation is via [Composer][]. Run the following -command to install the package and add it as a requirement to your project's -`composer.json`: - -```bash -composer require ramsey/uuid -``` - -## Upgrading to Version 4 - -See the documentation for a thorough upgrade guide: - -* [Upgrading ramsey/uuid Version 3 to 4](https://uuid.ramsey.dev/en/stable/upgrading/3-to-4.html) - -## Documentation - -Please see for documentation, tips, examples, and -frequently asked questions. - -## Contributing - -Contributions are welcome! To contribute, please familiarize yourself with -[CONTRIBUTING.md](CONTRIBUTING.md). - -## Coordinated Disclosure - -Keeping user information safe and secure is a top priority, and we welcome the -contribution of external security researchers. If you believe you've found a -security issue in software that is maintained in this repository, please read -[SECURITY.md][] for instructions on submitting a vulnerability report. - -## ramsey/uuid for Enterprise - -Available as part of the Tidelift Subscription. - -The maintainers of ramsey/uuid and thousands of other packages are working with -Tidelift to deliver commercial support and maintenance for the open source -packages you use to build your applications. Save time, reduce risk, and improve -code health, while paying the maintainers of the exact packages you use. -[Learn more.](https://tidelift.com/subscription/pkg/packagist-ramsey-uuid?utm_source=undefined&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - -## Copyright and License - -The ramsey/uuid library is copyright © [Ben Ramsey](https://benramsey.com/) and -licensed for use under the MIT License (MIT). Please see [LICENSE][] for more -information. - -[rfc4122]: http://tools.ietf.org/html/rfc4122 -[conduct]: https://github.com/ramsey/uuid/blob/4.x/CODE_OF_CONDUCT.md -[javauuid]: http://docs.oracle.com/javase/6/docs/api/java/util/UUID.html -[pyuuid]: http://docs.python.org/3/library/uuid.html -[composer]: http://getcomposer.org/ -[contributing.md]: https://github.com/ramsey/uuid/blob/4.x/CONTRIBUTING.md -[security.md]: https://github.com/ramsey/uuid/blob/4.x/SECURITY.md -[license]: https://github.com/ramsey/uuid/blob/4.x/LICENSE diff --git a/vendor/ramsey/uuid/composer.json b/vendor/ramsey/uuid/composer.json deleted file mode 100644 index 82b05552..00000000 --- a/vendor/ramsey/uuid/composer.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "name": "ramsey/uuid", - "description": "A PHP library for generating and working with universally unique identifiers (UUIDs).", - "license": "MIT", - "type": "library", - "keywords": [ - "uuid", - "identifier", - "guid" - ], - "require": { - "php": "^8.0", - "ext-json": "*", - "brick/math": "^0.8.8 || ^0.9 || ^0.10", - "ramsey/collection": "^1.2" - }, - "require-dev": { - "captainhook/captainhook": "^5.10", - "captainhook/plugin-composer": "^5.3", - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "doctrine/annotations": "^1.8", - "ergebnis/composer-normalize": "^2.15", - "mockery/mockery": "^1.3", - "paragonie/random-lib": "^2", - "php-mock/php-mock": "^2.2", - "php-mock/php-mock-mockery": "^1.3", - "php-parallel-lint/php-parallel-lint": "^1.1", - "phpbench/phpbench": "^1.0", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-mockery": "^1.1", - "phpstan/phpstan-phpunit": "^1.1", - "phpunit/phpunit": "^8.5 || ^9", - "ramsey/composer-repl": "^1.4", - "slevomat/coding-standard": "^8.4", - "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "^4.9" - }, - "replace": { - "rhumsaa/uuid": "self.version" - }, - "suggest": { - "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", - "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", - "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", - "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", - "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." - }, - "minimum-stability": "dev", - "prefer-stable": true, - "autoload": { - "psr-4": { - "Ramsey\\Uuid\\": "src/" - }, - "files": [ - "src/functions.php" - ] - }, - "autoload-dev": { - "psr-4": { - "Ramsey\\Uuid\\Benchmark\\": "tests/benchmark/", - "Ramsey\\Uuid\\StaticAnalysis\\": "tests/static-analysis/", - "Ramsey\\Uuid\\Test\\": "tests/" - } - }, - "config": { - "allow-plugins": { - "captainhook/plugin-composer": true, - "ergebnis/composer-normalize": true, - "phpstan/extension-installer": true, - "dealerdirect/phpcodesniffer-composer-installer": true, - "ramsey/composer-repl": true - }, - "sort-packages": true - }, - "extra": { - "captainhook": { - "force-install": true - } - }, - "scripts": { - "analyze": [ - "@phpstan", - "@psalm" - ], - "build:clean": "git clean -fX build/", - "lint": "parallel-lint src tests", - "lint:paths": "parallel-lint", - "phpbench": "phpbench run", - "phpcbf": "phpcbf -vpw --cache=build/cache/phpcs.cache", - "phpcs": "phpcs --cache=build/cache/phpcs.cache", - "phpstan": [ - "phpstan analyse --no-progress --memory-limit=1G", - "phpstan analyse -c phpstan-tests.neon --no-progress --memory-limit=1G" - ], - "phpunit": "phpunit --verbose --colors=always", - "phpunit-coverage": "phpunit --verbose --colors=always --coverage-html build/coverage", - "psalm": "psalm --show-info=false --config=psalm.xml", - "test": [ - "@lint", - "@phpbench", - "@phpcs", - "@phpstan", - "@psalm", - "@phpunit" - ] - } -} diff --git a/vendor/ramsey/uuid/src/BinaryUtils.php b/vendor/ramsey/uuid/src/BinaryUtils.php deleted file mode 100644 index fb8ba9ad..00000000 --- a/vendor/ramsey/uuid/src/BinaryUtils.php +++ /dev/null @@ -1,63 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid; - -/** - * Provides binary math utilities - */ -class BinaryUtils -{ - /** - * Applies the RFC 4122 variant field to the 16-bit clock sequence - * - * @link http://tools.ietf.org/html/rfc4122#section-4.1.1 RFC 4122, § 4.1.1: Variant - * - * @param int $clockSeq The 16-bit clock sequence value before the RFC 4122 - * variant is applied - * - * @return int The 16-bit clock sequence multiplexed with the UUID variant - * - * @psalm-pure - */ - public static function applyVariant(int $clockSeq): int - { - $clockSeq = $clockSeq & 0x3fff; - $clockSeq |= 0x8000; - - return $clockSeq; - } - - /** - * Applies the RFC 4122 version number to the 16-bit `time_hi_and_version` field - * - * @link http://tools.ietf.org/html/rfc4122#section-4.1.3 RFC 4122, § 4.1.3: Version - * - * @param int $timeHi The value of the 16-bit `time_hi_and_version` field - * before the RFC 4122 version is applied - * @param int $version The RFC 4122 version to apply to the `time_hi` field - * - * @return int The 16-bit time_hi field of the timestamp multiplexed with - * the UUID version number - * - * @psalm-pure - */ - public static function applyVersion(int $timeHi, int $version): int - { - $timeHi = $timeHi & 0x0fff; - $timeHi |= $version << 12; - - return $timeHi; - } -} diff --git a/vendor/ramsey/uuid/src/Builder/BuilderCollection.php b/vendor/ramsey/uuid/src/Builder/BuilderCollection.php deleted file mode 100644 index 9df3110f..00000000 --- a/vendor/ramsey/uuid/src/Builder/BuilderCollection.php +++ /dev/null @@ -1,85 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Builder; - -use Ramsey\Collection\AbstractCollection; -use Ramsey\Uuid\Converter\Number\GenericNumberConverter; -use Ramsey\Uuid\Converter\Time\GenericTimeConverter; -use Ramsey\Uuid\Converter\Time\PhpTimeConverter; -use Ramsey\Uuid\Guid\GuidBuilder; -use Ramsey\Uuid\Math\BrickMathCalculator; -use Ramsey\Uuid\Nonstandard\UuidBuilder as NonstandardUuidBuilder; -use Ramsey\Uuid\Rfc4122\UuidBuilder as Rfc4122UuidBuilder; -use Traversable; - -/** - * A collection of UuidBuilderInterface objects - * - * @deprecated this class has been deprecated, and will be removed in 5.0.0. The use-case for this class comes from - * a pre-`phpstan/phpstan` and pre-`vimeo/psalm` ecosystem, in which type safety had to be mostly enforced - * at runtime: that is no longer necessary, now that you can safely verify your code to be correct, and use - * more generic types like `iterable` instead. - * - * @extends AbstractCollection - */ -class BuilderCollection extends AbstractCollection -{ - public function getType(): string - { - return UuidBuilderInterface::class; - } - - /** - * @psalm-mutation-free - * @psalm-suppress ImpureMethodCall - * @psalm-suppress InvalidTemplateParam - */ - public function getIterator(): Traversable - { - return parent::getIterator(); - } - - /** - * Re-constructs the object from its serialized form - * - * @param string $serialized The serialized PHP string to unserialize into - * a UuidInterface instance - * - * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - * @psalm-suppress RedundantConditionGivenDocblockType - */ - public function unserialize($serialized): void - { - /** @var array $data */ - $data = unserialize($serialized, [ - 'allowed_classes' => [ - BrickMathCalculator::class, - GenericNumberConverter::class, - GenericTimeConverter::class, - GuidBuilder::class, - NonstandardUuidBuilder::class, - PhpTimeConverter::class, - Rfc4122UuidBuilder::class, - ], - ]); - - $this->data = array_filter( - $data, - function ($unserialized): bool { - return $unserialized instanceof UuidBuilderInterface; - } - ); - } -} diff --git a/vendor/ramsey/uuid/src/Builder/DefaultUuidBuilder.php b/vendor/ramsey/uuid/src/Builder/DefaultUuidBuilder.php deleted file mode 100644 index 7c4a6f83..00000000 --- a/vendor/ramsey/uuid/src/Builder/DefaultUuidBuilder.php +++ /dev/null @@ -1,26 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Builder; - -use Ramsey\Uuid\Rfc4122\UuidBuilder as Rfc4122UuidBuilder; - -/** - * @deprecated Transition to {@see Rfc4122UuidBuilder}. - * - * @psalm-immutable - */ -class DefaultUuidBuilder extends Rfc4122UuidBuilder -{ -} diff --git a/vendor/ramsey/uuid/src/Builder/DegradedUuidBuilder.php b/vendor/ramsey/uuid/src/Builder/DegradedUuidBuilder.php deleted file mode 100644 index 20b38421..00000000 --- a/vendor/ramsey/uuid/src/Builder/DegradedUuidBuilder.php +++ /dev/null @@ -1,67 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Builder; - -use Ramsey\Uuid\Codec\CodecInterface; -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Converter\Time\DegradedTimeConverter; -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\DegradedUuid; -use Ramsey\Uuid\Rfc4122\Fields as Rfc4122Fields; -use Ramsey\Uuid\UuidInterface; - -/** - * @deprecated DegradedUuid instances are no longer necessary to support 32-bit - * systems. Transition to {@see DefaultUuidBuilder}. - * - * @psalm-immutable - */ -class DegradedUuidBuilder implements UuidBuilderInterface -{ - private TimeConverterInterface $timeConverter; - - /** - * @param NumberConverterInterface $numberConverter The number converter to - * use when constructing the DegradedUuid - * @param TimeConverterInterface|null $timeConverter The time converter to use - * for converting timestamps extracted from a UUID to Unix timestamps - */ - public function __construct( - private NumberConverterInterface $numberConverter, - ?TimeConverterInterface $timeConverter = null - ) { - $this->timeConverter = $timeConverter ?: new DegradedTimeConverter(); - } - - /** - * Builds and returns a DegradedUuid - * - * @param CodecInterface $codec The codec to use for building this DegradedUuid instance - * @param string $bytes The byte string from which to construct a UUID - * - * @return DegradedUuid The DegradedUuidBuild returns an instance of Ramsey\Uuid\DegradedUuid - * - * @psalm-pure - */ - public function build(CodecInterface $codec, string $bytes): UuidInterface - { - return new DegradedUuid( - new Rfc4122Fields($bytes), - $this->numberConverter, - $codec, - $this->timeConverter - ); - } -} diff --git a/vendor/ramsey/uuid/src/Builder/FallbackBuilder.php b/vendor/ramsey/uuid/src/Builder/FallbackBuilder.php deleted file mode 100644 index ba5f31fb..00000000 --- a/vendor/ramsey/uuid/src/Builder/FallbackBuilder.php +++ /dev/null @@ -1,68 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Builder; - -use Ramsey\Uuid\Codec\CodecInterface; -use Ramsey\Uuid\Exception\BuilderNotFoundException; -use Ramsey\Uuid\Exception\UnableToBuildUuidException; -use Ramsey\Uuid\UuidInterface; - -/** - * FallbackBuilder builds a UUID by stepping through a list of UUID builders - * until a UUID can be constructed without exceptions - * - * @psalm-immutable - */ -class FallbackBuilder implements UuidBuilderInterface -{ - /** - * @param iterable $builders An array of UUID builders - */ - public function __construct(private iterable $builders) - { - } - - /** - * Builds and returns a UuidInterface instance using the first builder that - * succeeds - * - * @param CodecInterface $codec The codec to use for building this instance - * @param string $bytes The byte string from which to construct a UUID - * - * @return UuidInterface an instance of a UUID object - * - * @psalm-pure - */ - public function build(CodecInterface $codec, string $bytes): UuidInterface - { - $lastBuilderException = null; - - foreach ($this->builders as $builder) { - try { - return $builder->build($codec, $bytes); - } catch (UnableToBuildUuidException $exception) { - $lastBuilderException = $exception; - - continue; - } - } - - throw new BuilderNotFoundException( - 'Could not find a suitable builder for the provided codec and fields', - 0, - $lastBuilderException - ); - } -} diff --git a/vendor/ramsey/uuid/src/Builder/UuidBuilderInterface.php b/vendor/ramsey/uuid/src/Builder/UuidBuilderInterface.php deleted file mode 100644 index 8e58b2b4..00000000 --- a/vendor/ramsey/uuid/src/Builder/UuidBuilderInterface.php +++ /dev/null @@ -1,39 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Builder; - -use Ramsey\Uuid\Codec\CodecInterface; -use Ramsey\Uuid\UuidInterface; - -/** - * A UUID builder builds instances of UuidInterface - * - * @psalm-immutable - */ -interface UuidBuilderInterface -{ - /** - * Builds and returns a UuidInterface - * - * @param CodecInterface $codec The codec to use for building this UuidInterface instance - * @param string $bytes The byte string from which to construct a UUID - * - * @return UuidInterface Implementations may choose to return more specific - * instances of UUIDs that implement UuidInterface - * - * @psalm-pure - */ - public function build(CodecInterface $codec, string $bytes): UuidInterface; -} diff --git a/vendor/ramsey/uuid/src/Codec/CodecInterface.php b/vendor/ramsey/uuid/src/Codec/CodecInterface.php deleted file mode 100644 index 85f8a7e9..00000000 --- a/vendor/ramsey/uuid/src/Codec/CodecInterface.php +++ /dev/null @@ -1,71 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Codec; - -use Ramsey\Uuid\UuidInterface; - -/** - * A codec encodes and decodes a UUID according to defined rules - * - * @psalm-immutable - */ -interface CodecInterface -{ - /** - * Returns a hexadecimal string representation of a UuidInterface - * - * @param UuidInterface $uuid The UUID for which to create a hexadecimal - * string representation - * - * @return string Hexadecimal string representation of a UUID - * - * @psalm-return non-empty-string - */ - public function encode(UuidInterface $uuid): string; - - /** - * Returns a binary string representation of a UuidInterface - * - * @param UuidInterface $uuid The UUID for which to create a binary string - * representation - * - * @return string Binary string representation of a UUID - * - * @psalm-return non-empty-string - */ - public function encodeBinary(UuidInterface $uuid): string; - - /** - * Returns a UuidInterface derived from a hexadecimal string representation - * - * @param string $encodedUuid The hexadecimal string representation to - * convert into a UuidInterface instance - * - * @return UuidInterface An instance of a UUID decoded from a hexadecimal - * string representation - */ - public function decode(string $encodedUuid): UuidInterface; - - /** - * Returns a UuidInterface derived from a binary string representation - * - * @param string $bytes The binary string representation to convert into a - * UuidInterface instance - * - * @return UuidInterface An instance of a UUID decoded from a binary string - * representation - */ - public function decodeBytes(string $bytes): UuidInterface; -} diff --git a/vendor/ramsey/uuid/src/Codec/GuidStringCodec.php b/vendor/ramsey/uuid/src/Codec/GuidStringCodec.php deleted file mode 100644 index 04872e0b..00000000 --- a/vendor/ramsey/uuid/src/Codec/GuidStringCodec.php +++ /dev/null @@ -1,76 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Codec; - -use Ramsey\Uuid\Guid\Guid; -use Ramsey\Uuid\UuidInterface; - -use function bin2hex; -use function sprintf; -use function substr; - -/** - * GuidStringCodec encodes and decodes globally unique identifiers (GUID) - * - * @see Guid - * - * @psalm-immutable - */ -class GuidStringCodec extends StringCodec -{ - public function encode(UuidInterface $uuid): string - { - $hex = bin2hex($uuid->getFields()->getBytes()); - - /** @var non-empty-string */ - return sprintf( - '%02s%02s%02s%02s-%02s%02s-%02s%02s-%04s-%012s', - substr($hex, 6, 2), - substr($hex, 4, 2), - substr($hex, 2, 2), - substr($hex, 0, 2), - substr($hex, 10, 2), - substr($hex, 8, 2), - substr($hex, 14, 2), - substr($hex, 12, 2), - substr($hex, 16, 4), - substr($hex, 20), - ); - } - - public function decode(string $encodedUuid): UuidInterface - { - $bytes = $this->getBytes($encodedUuid); - - return $this->getBuilder()->build($this, $this->swapBytes($bytes)); - } - - public function decodeBytes(string $bytes): UuidInterface - { - // Specifically call parent::decode to preserve correct byte order - return parent::decode(bin2hex($bytes)); - } - - /** - * Swaps bytes according to the GUID rules - */ - private function swapBytes(string $bytes): string - { - return $bytes[3] . $bytes[2] . $bytes[1] . $bytes[0] - . $bytes[5] . $bytes[4] - . $bytes[7] . $bytes[6] - . substr($bytes, 8); - } -} diff --git a/vendor/ramsey/uuid/src/Codec/OrderedTimeCodec.php b/vendor/ramsey/uuid/src/Codec/OrderedTimeCodec.php deleted file mode 100644 index 0798ebc4..00000000 --- a/vendor/ramsey/uuid/src/Codec/OrderedTimeCodec.php +++ /dev/null @@ -1,113 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Codec; - -use Ramsey\Uuid\Exception\InvalidArgumentException; -use Ramsey\Uuid\Exception\UnsupportedOperationException; -use Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface; -use Ramsey\Uuid\Uuid; -use Ramsey\Uuid\UuidInterface; - -use function strlen; -use function substr; - -/** - * OrderedTimeCodec encodes and decodes a UUID, optimizing the byte order for - * more efficient storage - * - * For binary representations of version 1 UUID, this codec may be used to - * reorganize the time fields, making the UUID closer to sequential when storing - * the bytes. According to Percona, this optimization can improve database - * INSERTs and SELECTs using the UUID column as a key. - * - * The string representation of the UUID will remain unchanged. Only the binary - * representation is reordered. - * - * **PLEASE NOTE:** Binary representations of UUIDs encoded with this codec must - * be decoded with this codec. Decoding using another codec can result in - * malformed UUIDs. - * - * @link https://www.percona.com/blog/2014/12/19/store-uuid-optimized-way/ Storing UUID Values in MySQL - * - * @psalm-immutable - */ -class OrderedTimeCodec extends StringCodec -{ - /** - * Returns a binary string representation of a UUID, with the timestamp - * fields rearranged for optimized storage - * - * @inheritDoc - * @psalm-return non-empty-string - * @psalm-suppress MoreSpecificReturnType we know that the retrieved `string` is never empty - * @psalm-suppress LessSpecificReturnStatement we know that the retrieved `string` is never empty - */ - public function encodeBinary(UuidInterface $uuid): string - { - if ( - !($uuid->getFields() instanceof Rfc4122FieldsInterface) - || $uuid->getFields()->getVersion() !== Uuid::UUID_TYPE_TIME - ) { - throw new InvalidArgumentException( - 'Expected RFC 4122 version 1 (time-based) UUID' - ); - } - - $bytes = $uuid->getFields()->getBytes(); - - /** @phpstan-ignore-next-line PHPStan complains that this is not a non-empty-string. */ - return $bytes[6] . $bytes[7] - . $bytes[4] . $bytes[5] - . $bytes[0] . $bytes[1] . $bytes[2] . $bytes[3] - . substr($bytes, 8); - } - - /** - * Returns a UuidInterface derived from an ordered-time binary string - * representation - * - * @throws InvalidArgumentException if $bytes is an invalid length - * - * @inheritDoc - */ - public function decodeBytes(string $bytes): UuidInterface - { - if (strlen($bytes) !== 16) { - throw new InvalidArgumentException( - '$bytes string should contain 16 characters.' - ); - } - - // Rearrange the bytes to their original order. - $rearrangedBytes = $bytes[4] . $bytes[5] . $bytes[6] . $bytes[7] - . $bytes[2] . $bytes[3] - . $bytes[0] . $bytes[1] - . substr($bytes, 8); - - $uuid = parent::decodeBytes($rearrangedBytes); - - if ( - !($uuid->getFields() instanceof Rfc4122FieldsInterface) - || $uuid->getFields()->getVersion() !== Uuid::UUID_TYPE_TIME - ) { - throw new UnsupportedOperationException( - 'Attempting to decode a non-time-based UUID using ' - . 'OrderedTimeCodec' - ); - } - - return $uuid; - } -} diff --git a/vendor/ramsey/uuid/src/Codec/StringCodec.php b/vendor/ramsey/uuid/src/Codec/StringCodec.php deleted file mode 100644 index 95f38d2e..00000000 --- a/vendor/ramsey/uuid/src/Codec/StringCodec.php +++ /dev/null @@ -1,131 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Codec; - -use Ramsey\Uuid\Builder\UuidBuilderInterface; -use Ramsey\Uuid\Exception\InvalidArgumentException; -use Ramsey\Uuid\Exception\InvalidUuidStringException; -use Ramsey\Uuid\Uuid; -use Ramsey\Uuid\UuidInterface; - -use function bin2hex; -use function hex2bin; -use function implode; -use function sprintf; -use function str_replace; -use function strlen; -use function substr; - -/** - * StringCodec encodes and decodes RFC 4122 UUIDs - * - * @link http://tools.ietf.org/html/rfc4122 - * - * @psalm-immutable - */ -class StringCodec implements CodecInterface -{ - /** - * Constructs a StringCodec - * - * @param UuidBuilderInterface $builder The builder to use when encoding UUIDs - */ - public function __construct(private UuidBuilderInterface $builder) - { - } - - public function encode(UuidInterface $uuid): string - { - $hex = bin2hex($uuid->getFields()->getBytes()); - - /** @var non-empty-string */ - return sprintf( - '%08s-%04s-%04s-%04s-%012s', - substr($hex, 0, 8), - substr($hex, 8, 4), - substr($hex, 12, 4), - substr($hex, 16, 4), - substr($hex, 20), - ); - } - - /** - * @psalm-return non-empty-string - * @psalm-suppress MoreSpecificReturnType we know that the retrieved `string` is never empty - * @psalm-suppress LessSpecificReturnStatement we know that the retrieved `string` is never empty - */ - public function encodeBinary(UuidInterface $uuid): string - { - /** @phpstan-ignore-next-line PHPStan complains that this is not a non-empty-string. */ - return $uuid->getFields()->getBytes(); - } - - /** - * @throws InvalidUuidStringException - * - * @inheritDoc - */ - public function decode(string $encodedUuid): UuidInterface - { - return $this->builder->build($this, $this->getBytes($encodedUuid)); - } - - public function decodeBytes(string $bytes): UuidInterface - { - if (strlen($bytes) !== 16) { - throw new InvalidArgumentException( - '$bytes string should contain 16 characters.' - ); - } - - return $this->builder->build($this, $bytes); - } - - /** - * Returns the UUID builder - */ - protected function getBuilder(): UuidBuilderInterface - { - return $this->builder; - } - - /** - * Returns a byte string of the UUID - */ - protected function getBytes(string $encodedUuid): string - { - $parsedUuid = str_replace( - ['urn:', 'uuid:', 'URN:', 'UUID:', '{', '}', '-'], - '', - $encodedUuid - ); - - $components = [ - substr($parsedUuid, 0, 8), - substr($parsedUuid, 8, 4), - substr($parsedUuid, 12, 4), - substr($parsedUuid, 16, 4), - substr($parsedUuid, 20), - ]; - - if (!Uuid::isValid(implode('-', $components))) { - throw new InvalidUuidStringException( - 'Invalid UUID string: ' . $encodedUuid - ); - } - - return (string) hex2bin($parsedUuid); - } -} diff --git a/vendor/ramsey/uuid/src/Codec/TimestampFirstCombCodec.php b/vendor/ramsey/uuid/src/Codec/TimestampFirstCombCodec.php deleted file mode 100644 index 0e0042d0..00000000 --- a/vendor/ramsey/uuid/src/Codec/TimestampFirstCombCodec.php +++ /dev/null @@ -1,113 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Codec; - -use Ramsey\Uuid\Exception\InvalidUuidStringException; -use Ramsey\Uuid\UuidInterface; - -use function bin2hex; -use function sprintf; -use function substr; -use function substr_replace; - -/** - * TimestampFirstCombCodec encodes and decodes COMBs, with the timestamp as the - * first 48 bits - * - * In contrast with the TimestampLastCombCodec, the TimestampFirstCombCodec - * adds the timestamp to the first 48 bits of the COMB. To generate a - * timestamp-first COMB, set the TimestampFirstCombCodec as the codec, along - * with the CombGenerator as the random generator. - * - * ``` php - * $factory = new UuidFactory(); - * - * $factory->setCodec(new TimestampFirstCombCodec($factory->getUuidBuilder())); - * - * $factory->setRandomGenerator(new CombGenerator( - * $factory->getRandomGenerator(), - * $factory->getNumberConverter() - * )); - * - * $timestampFirstComb = $factory->uuid4(); - * ``` - * - * @link https://www.informit.com/articles/printerfriendly/25862 The Cost of GUIDs as Primary Keys - * - * @psalm-immutable - */ -class TimestampFirstCombCodec extends StringCodec -{ - /** - * @psalm-return non-empty-string - * @psalm-suppress MoreSpecificReturnType we know that the retrieved `string` is never empty - * @psalm-suppress LessSpecificReturnStatement we know that the retrieved `string` is never empty - */ - public function encode(UuidInterface $uuid): string - { - $bytes = $this->swapBytes($uuid->getFields()->getBytes()); - - return sprintf( - '%08s-%04s-%04s-%04s-%012s', - bin2hex(substr($bytes, 0, 4)), - bin2hex(substr($bytes, 4, 2)), - bin2hex(substr($bytes, 6, 2)), - bin2hex(substr($bytes, 8, 2)), - bin2hex(substr($bytes, 10)) - ); - } - - /** - * @psalm-return non-empty-string - * @psalm-suppress MoreSpecificReturnType we know that the retrieved `string` is never empty - * @psalm-suppress LessSpecificReturnStatement we know that the retrieved `string` is never empty - */ - public function encodeBinary(UuidInterface $uuid): string - { - /** @phpstan-ignore-next-line PHPStan complains that this is not a non-empty-string. */ - return $this->swapBytes($uuid->getFields()->getBytes()); - } - - /** - * @throws InvalidUuidStringException - * - * @inheritDoc - */ - public function decode(string $encodedUuid): UuidInterface - { - $bytes = $this->getBytes($encodedUuid); - - return $this->getBuilder()->build($this, $this->swapBytes($bytes)); - } - - public function decodeBytes(string $bytes): UuidInterface - { - return $this->getBuilder()->build($this, $this->swapBytes($bytes)); - } - - /** - * Swaps bytes according to the timestamp-first COMB rules - */ - private function swapBytes(string $bytes): string - { - $first48Bits = substr($bytes, 0, 6); - $last48Bits = substr($bytes, -6); - - $bytes = substr_replace($bytes, $last48Bits, 0, 6); - $bytes = substr_replace($bytes, $first48Bits, -6); - - return $bytes; - } -} diff --git a/vendor/ramsey/uuid/src/Codec/TimestampLastCombCodec.php b/vendor/ramsey/uuid/src/Codec/TimestampLastCombCodec.php deleted file mode 100644 index 4856deae..00000000 --- a/vendor/ramsey/uuid/src/Codec/TimestampLastCombCodec.php +++ /dev/null @@ -1,51 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Codec; - -/** - * TimestampLastCombCodec encodes and decodes COMBs, with the timestamp as the - * last 48 bits - * - * The CombGenerator when used with the StringCodec (and, by proxy, the - * TimestampLastCombCodec) adds the timestamp to the last 48 bits of the COMB. - * The TimestampLastCombCodec is provided for the sake of consistency. In - * practice, it is identical to the standard StringCodec but, it may be used - * with the CombGenerator for additional context when reading code. - * - * Consider the following code. By default, the codec used by UuidFactory is the - * StringCodec, but here, we explicitly set the TimestampLastCombCodec. It is - * redundant, but it is clear that we intend this COMB to be generated with the - * timestamp appearing at the end. - * - * ``` php - * $factory = new UuidFactory(); - * - * $factory->setCodec(new TimestampLastCombCodec($factory->getUuidBuilder())); - * - * $factory->setRandomGenerator(new CombGenerator( - * $factory->getRandomGenerator(), - * $factory->getNumberConverter() - * )); - * - * $timestampLastComb = $factory->uuid4(); - * ``` - * - * @link https://www.informit.com/articles/printerfriendly/25862 The Cost of GUIDs as Primary Keys - * - * @psalm-immutable - */ -class TimestampLastCombCodec extends StringCodec -{ -} diff --git a/vendor/ramsey/uuid/src/Converter/Number/BigNumberConverter.php b/vendor/ramsey/uuid/src/Converter/Number/BigNumberConverter.php deleted file mode 100644 index 99b88b3b..00000000 --- a/vendor/ramsey/uuid/src/Converter/Number/BigNumberConverter.php +++ /dev/null @@ -1,54 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Converter\Number; - -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Math\BrickMathCalculator; - -/** - * Previously used to integrate moontoast/math as a bignum arithmetic library, - * BigNumberConverter is deprecated in favor of GenericNumberConverter - * - * @deprecated Transition to {@see GenericNumberConverter}. - * - * @psalm-immutable - */ -class BigNumberConverter implements NumberConverterInterface -{ - private NumberConverterInterface $converter; - - public function __construct() - { - $this->converter = new GenericNumberConverter(new BrickMathCalculator()); - } - - /** - * @inheritDoc - * @psalm-pure - */ - public function fromHex(string $hex): string - { - return $this->converter->fromHex($hex); - } - - /** - * @inheritDoc - * @psalm-pure - */ - public function toHex(string $number): string - { - return $this->converter->toHex($number); - } -} diff --git a/vendor/ramsey/uuid/src/Converter/Number/DegradedNumberConverter.php b/vendor/ramsey/uuid/src/Converter/Number/DegradedNumberConverter.php deleted file mode 100644 index c9cfa686..00000000 --- a/vendor/ramsey/uuid/src/Converter/Number/DegradedNumberConverter.php +++ /dev/null @@ -1,25 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Converter\Number; - -/** - * @deprecated DegradedNumberConverter is no longer necessary for converting - * numbers on 32-bit systems. Transition to {@see GenericNumberConverter}. - * - * @psalm-immutable - */ -class DegradedNumberConverter extends BigNumberConverter -{ -} diff --git a/vendor/ramsey/uuid/src/Converter/Number/GenericNumberConverter.php b/vendor/ramsey/uuid/src/Converter/Number/GenericNumberConverter.php deleted file mode 100644 index 043c3c43..00000000 --- a/vendor/ramsey/uuid/src/Converter/Number/GenericNumberConverter.php +++ /dev/null @@ -1,57 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Converter\Number; - -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Math\CalculatorInterface; -use Ramsey\Uuid\Type\Integer as IntegerObject; - -/** - * GenericNumberConverter uses the provided calculator to convert decimal - * numbers to and from hexadecimal values - * - * @psalm-immutable - */ -class GenericNumberConverter implements NumberConverterInterface -{ - public function __construct(private CalculatorInterface $calculator) - { - } - - /** - * @inheritDoc - * @psalm-pure - * @psalm-return numeric-string - * @psalm-suppress MoreSpecificReturnType we know that the retrieved `string` is never empty - * @psalm-suppress LessSpecificReturnStatement we know that the retrieved `string` is never empty - */ - public function fromHex(string $hex): string - { - return $this->calculator->fromBase($hex, 16)->toString(); - } - - /** - * @inheritDoc - * @psalm-pure - * @psalm-return non-empty-string - * @psalm-suppress MoreSpecificReturnType we know that the retrieved `string` is never empty - * @psalm-suppress LessSpecificReturnStatement we know that the retrieved `string` is never empty - */ - public function toHex(string $number): string - { - /** @phpstan-ignore-next-line PHPStan complains that this is not a non-empty-string. */ - return $this->calculator->toBase(new IntegerObject($number), 16); - } -} diff --git a/vendor/ramsey/uuid/src/Converter/NumberConverterInterface.php b/vendor/ramsey/uuid/src/Converter/NumberConverterInterface.php deleted file mode 100644 index b33ec31f..00000000 --- a/vendor/ramsey/uuid/src/Converter/NumberConverterInterface.php +++ /dev/null @@ -1,57 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Converter; - -/** - * A number converter converts UUIDs from hexadecimal characters into - * representations of integers and vice versa - * - * @psalm-immutable - */ -interface NumberConverterInterface -{ - /** - * Converts a hexadecimal number into an string integer representation of - * the number - * - * The integer representation returned is a string representation of the - * integer, to accommodate unsigned integers greater than PHP_INT_MAX. - * - * @param string $hex The hexadecimal string representation to convert - * - * @return string String representation of an integer - * - * @psalm-return numeric-string - * - * @psalm-pure - */ - public function fromHex(string $hex): string; - - /** - * Converts a string integer representation into a hexadecimal string - * representation of the number - * - * @param string $number A string integer representation to convert; this - * must be a numeric string to accommodate unsigned integers greater - * than PHP_INT_MAX. - * - * @return string Hexadecimal string - * - * @psalm-return non-empty-string - * - * @psalm-pure - */ - public function toHex(string $number): string; -} diff --git a/vendor/ramsey/uuid/src/Converter/Time/BigNumberTimeConverter.php b/vendor/ramsey/uuid/src/Converter/Time/BigNumberTimeConverter.php deleted file mode 100644 index b6bca9ee..00000000 --- a/vendor/ramsey/uuid/src/Converter/Time/BigNumberTimeConverter.php +++ /dev/null @@ -1,48 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Converter\Time; - -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Math\BrickMathCalculator; -use Ramsey\Uuid\Type\Hexadecimal; -use Ramsey\Uuid\Type\Time; - -/** - * Previously used to integrate moontoast/math as a bignum arithmetic library, - * BigNumberTimeConverter is deprecated in favor of GenericTimeConverter - * - * @deprecated Transition to {@see GenericTimeConverter}. - * - * @psalm-immutable - */ -class BigNumberTimeConverter implements TimeConverterInterface -{ - private TimeConverterInterface $converter; - - public function __construct() - { - $this->converter = new GenericTimeConverter(new BrickMathCalculator()); - } - - public function calculateTime(string $seconds, string $microseconds): Hexadecimal - { - return $this->converter->calculateTime($seconds, $microseconds); - } - - public function convertTime(Hexadecimal $uuidTimestamp): Time - { - return $this->converter->convertTime($uuidTimestamp); - } -} diff --git a/vendor/ramsey/uuid/src/Converter/Time/DegradedTimeConverter.php b/vendor/ramsey/uuid/src/Converter/Time/DegradedTimeConverter.php deleted file mode 100644 index cdc28752..00000000 --- a/vendor/ramsey/uuid/src/Converter/Time/DegradedTimeConverter.php +++ /dev/null @@ -1,25 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Converter\Time; - -/** - * @deprecated DegradedTimeConverter is no longer necessary for converting - * time on 32-bit systems. Transition to {@see GenericTimeConverter}. - * - * @psalm-immutable - */ -class DegradedTimeConverter extends BigNumberTimeConverter -{ -} diff --git a/vendor/ramsey/uuid/src/Converter/Time/GenericTimeConverter.php b/vendor/ramsey/uuid/src/Converter/Time/GenericTimeConverter.php deleted file mode 100644 index f6b60abb..00000000 --- a/vendor/ramsey/uuid/src/Converter/Time/GenericTimeConverter.php +++ /dev/null @@ -1,118 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Converter\Time; - -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Math\CalculatorInterface; -use Ramsey\Uuid\Math\RoundingMode; -use Ramsey\Uuid\Type\Hexadecimal; -use Ramsey\Uuid\Type\Integer as IntegerObject; -use Ramsey\Uuid\Type\Time; - -use function explode; -use function str_pad; - -use const STR_PAD_LEFT; - -/** - * GenericTimeConverter uses the provided calculator to calculate and convert - * time values - * - * @psalm-immutable - */ -class GenericTimeConverter implements TimeConverterInterface -{ - /** - * The number of 100-nanosecond intervals from the Gregorian calendar epoch - * to the Unix epoch. - */ - private const GREGORIAN_TO_UNIX_INTERVALS = '122192928000000000'; - - /** - * The number of 100-nanosecond intervals in one second. - */ - private const SECOND_INTERVALS = '10000000'; - - /** - * The number of 100-nanosecond intervals in one microsecond. - */ - private const MICROSECOND_INTERVALS = '10'; - - public function __construct(private CalculatorInterface $calculator) - { - } - - public function calculateTime(string $seconds, string $microseconds): Hexadecimal - { - $timestamp = new Time($seconds, $microseconds); - - // Convert the seconds into a count of 100-nanosecond intervals. - $sec = $this->calculator->multiply( - $timestamp->getSeconds(), - new IntegerObject(self::SECOND_INTERVALS) - ); - - // Convert the microseconds into a count of 100-nanosecond intervals. - $usec = $this->calculator->multiply( - $timestamp->getMicroseconds(), - new IntegerObject(self::MICROSECOND_INTERVALS) - ); - - // Combine the seconds and microseconds intervals and add the count of - // 100-nanosecond intervals from the Gregorian calendar epoch to the - // Unix epoch. This gives us the correct count of 100-nanosecond - // intervals since the Gregorian calendar epoch for the given seconds - // and microseconds. - /** @var IntegerObject $uuidTime */ - $uuidTime = $this->calculator->add( - $sec, - $usec, - new IntegerObject(self::GREGORIAN_TO_UNIX_INTERVALS) - ); - - $uuidTimeHex = str_pad( - $this->calculator->toHexadecimal($uuidTime)->toString(), - 16, - '0', - STR_PAD_LEFT - ); - - return new Hexadecimal($uuidTimeHex); - } - - public function convertTime(Hexadecimal $uuidTimestamp): Time - { - // From the total, subtract the number of 100-nanosecond intervals from - // the Gregorian calendar epoch to the Unix epoch. This gives us the - // number of 100-nanosecond intervals from the Unix epoch, which also - // includes the microtime. - $epochNanoseconds = $this->calculator->subtract( - $this->calculator->toInteger($uuidTimestamp), - new IntegerObject(self::GREGORIAN_TO_UNIX_INTERVALS) - ); - - // Convert the 100-nanosecond intervals into seconds and microseconds. - $unixTimestamp = $this->calculator->divide( - RoundingMode::HALF_UP, - 6, - $epochNanoseconds, - new IntegerObject(self::SECOND_INTERVALS) - ); - - $split = explode('.', (string) $unixTimestamp, 2); - - return new Time($split[0], $split[1] ?? 0); - } -} diff --git a/vendor/ramsey/uuid/src/Converter/Time/PhpTimeConverter.php b/vendor/ramsey/uuid/src/Converter/Time/PhpTimeConverter.php deleted file mode 100644 index 66009f14..00000000 --- a/vendor/ramsey/uuid/src/Converter/Time/PhpTimeConverter.php +++ /dev/null @@ -1,172 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Converter\Time; - -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Math\BrickMathCalculator; -use Ramsey\Uuid\Math\CalculatorInterface; -use Ramsey\Uuid\Type\Hexadecimal; -use Ramsey\Uuid\Type\Integer as IntegerObject; -use Ramsey\Uuid\Type\Time; - -use function count; -use function dechex; -use function explode; -use function is_float; -use function is_int; -use function str_pad; -use function strlen; -use function substr; - -use const STR_PAD_LEFT; -use const STR_PAD_RIGHT; - -/** - * PhpTimeConverter uses built-in PHP functions and standard math operations - * available to the PHP programming language to provide facilities for - * converting parts of time into representations that may be used in UUIDs - * - * @psalm-immutable - */ -class PhpTimeConverter implements TimeConverterInterface -{ - /** - * The number of 100-nanosecond intervals from the Gregorian calendar epoch - * to the Unix epoch. - */ - private const GREGORIAN_TO_UNIX_INTERVALS = 0x01b21dd213814000; - - /** - * The number of 100-nanosecond intervals in one second. - */ - private const SECOND_INTERVALS = 10000000; - - /** - * The number of 100-nanosecond intervals in one microsecond. - */ - private const MICROSECOND_INTERVALS = 10; - - private int $phpPrecision; - private CalculatorInterface $calculator; - private TimeConverterInterface $fallbackConverter; - - public function __construct( - ?CalculatorInterface $calculator = null, - ?TimeConverterInterface $fallbackConverter = null - ) { - if ($calculator === null) { - $calculator = new BrickMathCalculator(); - } - - if ($fallbackConverter === null) { - $fallbackConverter = new GenericTimeConverter($calculator); - } - - $this->calculator = $calculator; - $this->fallbackConverter = $fallbackConverter; - $this->phpPrecision = (int) ini_get('precision'); - } - - public function calculateTime(string $seconds, string $microseconds): Hexadecimal - { - $seconds = new IntegerObject($seconds); - $microseconds = new IntegerObject($microseconds); - - // Calculate the count of 100-nanosecond intervals since the Gregorian - // calendar epoch for the given seconds and microseconds. - $uuidTime = ((int) $seconds->toString() * self::SECOND_INTERVALS) - + ((int) $microseconds->toString() * self::MICROSECOND_INTERVALS) - + self::GREGORIAN_TO_UNIX_INTERVALS; - - // Check to see whether we've overflowed the max/min integer size. - // If so, we will default to a different time converter. - /** @psalm-suppress RedundantCondition */ - if (!is_int($uuidTime)) { - return $this->fallbackConverter->calculateTime( - $seconds->toString(), - $microseconds->toString() - ); - } - - return new Hexadecimal(str_pad(dechex($uuidTime), 16, '0', STR_PAD_LEFT)); - } - - public function convertTime(Hexadecimal $uuidTimestamp): Time - { - $timestamp = $this->calculator->toInteger($uuidTimestamp); - - // Convert the 100-nanosecond intervals into seconds and microseconds. - $splitTime = $this->splitTime( - ((int) $timestamp->toString() - self::GREGORIAN_TO_UNIX_INTERVALS) - / self::SECOND_INTERVALS - ); - - if (count($splitTime) === 0) { - return $this->fallbackConverter->convertTime($uuidTimestamp); - } - - return new Time($splitTime['sec'], $splitTime['usec']); - } - - /** - * @param float|int $time The time to split into seconds and microseconds - * - * @return string[] - */ - private function splitTime(float | int $time): array - { - $split = explode('.', (string) $time, 2); - - // If the $time value is a float but $split only has 1 element, then the - // float math was rounded up to the next second, so we want to return - // an empty array to allow use of the fallback converter. - if (is_float($time) && count($split) === 1) { - return []; - } - - if (count($split) === 1) { - return [ - 'sec' => $split[0], - 'usec' => '0', - ]; - } - - // If the microseconds are less than six characters AND the length of - // the number is greater than or equal to the PHP precision, then it's - // possible that we lost some precision for the microseconds. Return an - // empty array, so that we can choose to use the fallback converter. - if (strlen($split[1]) < 6 && strlen((string) $time) >= $this->phpPrecision) { - return []; - } - - $microseconds = $split[1]; - - // Ensure the microseconds are no longer than 6 digits. If they are, - // truncate the number to the first 6 digits and round up, if needed. - if (strlen($microseconds) > 6) { - $roundingDigit = (int) substr($microseconds, 6, 1); - $microseconds = (int) substr($microseconds, 0, 6); - - if ($roundingDigit >= 5) { - $microseconds++; - } - } - - return [ - 'sec' => $split[0], - 'usec' => str_pad((string) $microseconds, 6, '0', STR_PAD_RIGHT), - ]; - } -} diff --git a/vendor/ramsey/uuid/src/Converter/Time/UnixTimeConverter.php b/vendor/ramsey/uuid/src/Converter/Time/UnixTimeConverter.php deleted file mode 100644 index 4d6d0a8a..00000000 --- a/vendor/ramsey/uuid/src/Converter/Time/UnixTimeConverter.php +++ /dev/null @@ -1,90 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Converter\Time; - -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Math\CalculatorInterface; -use Ramsey\Uuid\Math\RoundingMode; -use Ramsey\Uuid\Type\Hexadecimal; -use Ramsey\Uuid\Type\Integer as IntegerObject; -use Ramsey\Uuid\Type\Time; - -use function explode; -use function str_pad; - -use const STR_PAD_LEFT; - -/** - * UnixTimeConverter converts Unix Epoch timestamps to/from hexadecimal values - * consisting of milliseconds elapsed since the Unix Epoch - * - * @psalm-immutable - */ -class UnixTimeConverter implements TimeConverterInterface -{ - private const MILLISECONDS = 1000; - - public function __construct(private CalculatorInterface $calculator) - { - } - - public function calculateTime(string $seconds, string $microseconds): Hexadecimal - { - $timestamp = new Time($seconds, $microseconds); - - // Convert the seconds into milliseconds. - $sec = $this->calculator->multiply( - $timestamp->getSeconds(), - new IntegerObject(self::MILLISECONDS), - ); - - // Convert the microseconds into milliseconds; the scale is zero because - // we need to discard the fractional part. - $usec = $this->calculator->divide( - RoundingMode::DOWN, // Always round down to stay in the previous millisecond. - 0, - $timestamp->getMicroseconds(), - new IntegerObject(self::MILLISECONDS), - ); - - /** @var IntegerObject $unixTime */ - $unixTime = $this->calculator->add($sec, $usec); - - $unixTimeHex = str_pad( - $this->calculator->toHexadecimal($unixTime)->toString(), - 12, - '0', - STR_PAD_LEFT - ); - - return new Hexadecimal($unixTimeHex); - } - - public function convertTime(Hexadecimal $uuidTimestamp): Time - { - $milliseconds = $this->calculator->toInteger($uuidTimestamp); - - $unixTimestamp = $this->calculator->divide( - RoundingMode::HALF_UP, - 6, - $milliseconds, - new IntegerObject(self::MILLISECONDS) - ); - - $split = explode('.', (string) $unixTimestamp, 2); - - return new Time($split[0], $split[1] ?? '0'); - } -} diff --git a/vendor/ramsey/uuid/src/Converter/TimeConverterInterface.php b/vendor/ramsey/uuid/src/Converter/TimeConverterInterface.php deleted file mode 100644 index 1e848070..00000000 --- a/vendor/ramsey/uuid/src/Converter/TimeConverterInterface.php +++ /dev/null @@ -1,58 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Converter; - -use Ramsey\Uuid\Type\Hexadecimal; -use Ramsey\Uuid\Type\Time; - -/** - * A time converter converts timestamps into representations that may be used - * in UUIDs - * - * @psalm-immutable - */ -interface TimeConverterInterface -{ - /** - * Uses the provided seconds and micro-seconds to calculate the count of - * 100-nanosecond intervals since UTC 00:00:00.00, 15 October 1582, for - * RFC 4122 variant UUIDs - * - * @link http://tools.ietf.org/html/rfc4122#section-4.2.2 RFC 4122, § 4.2.2: Generation Details - * - * @param string $seconds A string representation of the number of seconds - * since the Unix epoch for the time to calculate - * @param string $microseconds A string representation of the micro-seconds - * associated with the time to calculate - * - * @return Hexadecimal The full UUID timestamp as a Hexadecimal value - * - * @psalm-pure - */ - public function calculateTime(string $seconds, string $microseconds): Hexadecimal; - - /** - * Converts a timestamp extracted from a UUID to a Unix timestamp - * - * @param Hexadecimal $uuidTimestamp A hexadecimal representation of a UUID - * timestamp; a UUID timestamp is a count of 100-nanosecond intervals - * since UTC 00:00:00.00, 15 October 1582. - * - * @return Time An instance of {@see Time} - * - * @psalm-pure - */ - public function convertTime(Hexadecimal $uuidTimestamp): Time; -} diff --git a/vendor/ramsey/uuid/src/DegradedUuid.php b/vendor/ramsey/uuid/src/DegradedUuid.php deleted file mode 100644 index 9166042c..00000000 --- a/vendor/ramsey/uuid/src/DegradedUuid.php +++ /dev/null @@ -1,25 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid; - -/** - * @deprecated DegradedUuid is no longer necessary to represent UUIDs on 32-bit - * systems. Transition typehints to {@see UuidInterface}. - * - * @psalm-immutable - */ -class DegradedUuid extends Uuid -{ -} diff --git a/vendor/ramsey/uuid/src/DeprecatedUuidInterface.php b/vendor/ramsey/uuid/src/DeprecatedUuidInterface.php deleted file mode 100644 index ac01a79c..00000000 --- a/vendor/ramsey/uuid/src/DeprecatedUuidInterface.php +++ /dev/null @@ -1,140 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid; - -use DateTimeInterface; -use Ramsey\Uuid\Converter\NumberConverterInterface; - -/** - * This interface encapsulates deprecated methods for ramsey/uuid - * - * @psalm-immutable - */ -interface DeprecatedUuidInterface -{ - /** - * @deprecated This method will be removed in 5.0.0. There is no alternative - * recommendation, so plan accordingly. - */ - public function getNumberConverter(): NumberConverterInterface; - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. - * - * @return string[] - */ - public function getFieldsHex(): array; - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeqHiAndReserved()}. - */ - public function getClockSeqHiAndReservedHex(): string; - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeqLow()}. - */ - public function getClockSeqLowHex(): string; - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeq()}. - */ - public function getClockSequenceHex(): string; - - /** - * @deprecated In ramsey/uuid version 5.0.0, this will be removed from the - * interface. It is available at {@see UuidV1::getDateTime()}. - */ - public function getDateTime(): DateTimeInterface; - - /** - * @deprecated This method will be removed in 5.0.0. There is no direct - * alternative, but the same information may be obtained by splitting - * in half the value returned by {@see UuidInterface::getHex()}. - */ - public function getLeastSignificantBitsHex(): string; - - /** - * @deprecated This method will be removed in 5.0.0. There is no direct - * alternative, but the same information may be obtained by splitting - * in half the value returned by {@see UuidInterface::getHex()}. - */ - public function getMostSignificantBitsHex(): string; - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getNode()}. - */ - public function getNodeHex(): string; - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeHiAndVersion()}. - */ - public function getTimeHiAndVersionHex(): string; - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeLow()}. - */ - public function getTimeLowHex(): string; - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeMid()}. - */ - public function getTimeMidHex(): string; - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimestamp()}. - */ - public function getTimestampHex(): string; - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getVariant()}. - */ - public function getVariant(): ?int; - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getVersion()}. - */ - public function getVersion(): ?int; -} diff --git a/vendor/ramsey/uuid/src/DeprecatedUuidMethodsTrait.php b/vendor/ramsey/uuid/src/DeprecatedUuidMethodsTrait.php deleted file mode 100644 index d3fbb0cc..00000000 --- a/vendor/ramsey/uuid/src/DeprecatedUuidMethodsTrait.php +++ /dev/null @@ -1,360 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid; - -use DateTimeImmutable; -use DateTimeInterface; -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Exception\DateTimeException; -use Ramsey\Uuid\Exception\UnsupportedOperationException; -use Throwable; - -use function str_pad; -use function substr; - -use const STR_PAD_LEFT; - -/** - * This trait encapsulates deprecated methods for ramsey/uuid; this trait and - * its methods will be removed in ramsey/uuid 5.0.0. - * - * @deprecated This trait and its methods will be removed in ramsey/uuid 5.0.0. - * - * @psalm-immutable - */ -trait DeprecatedUuidMethodsTrait -{ - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeqHiAndReserved()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. - */ - public function getClockSeqHiAndReserved(): string - { - return $this->numberConverter->fromHex($this->fields->getClockSeqHiAndReserved()->toString()); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeqHiAndReserved()}. - */ - public function getClockSeqHiAndReservedHex(): string - { - return $this->fields->getClockSeqHiAndReserved()->toString(); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeqLow()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. - */ - public function getClockSeqLow(): string - { - return $this->numberConverter->fromHex($this->fields->getClockSeqLow()->toString()); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeqLow()}. - */ - public function getClockSeqLowHex(): string - { - return $this->fields->getClockSeqLow()->toString(); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeq()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. - */ - public function getClockSequence(): string - { - return $this->numberConverter->fromHex($this->fields->getClockSeq()->toString()); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeq()}. - */ - public function getClockSequenceHex(): string - { - return $this->fields->getClockSeq()->toString(); - } - - /** - * @deprecated This method will be removed in 5.0.0. There is no alternative - * recommendation, so plan accordingly. - */ - public function getNumberConverter(): NumberConverterInterface - { - return $this->numberConverter; - } - - /** - * @deprecated In ramsey/uuid version 5.0.0, this will be removed. - * It is available at {@see UuidV1::getDateTime()}. - * - * @return DateTimeImmutable An immutable instance of DateTimeInterface - * - * @throws UnsupportedOperationException if UUID is not time-based - * @throws DateTimeException if DateTime throws an exception/error - */ - public function getDateTime(): DateTimeInterface - { - if ($this->fields->getVersion() !== 1) { - throw new UnsupportedOperationException('Not a time-based UUID'); - } - - $time = $this->timeConverter->convertTime($this->fields->getTimestamp()); - - try { - return new DateTimeImmutable( - '@' - . $time->getSeconds()->toString() - . '.' - . str_pad($time->getMicroseconds()->toString(), 6, '0', STR_PAD_LEFT) - ); - } catch (Throwable $e) { - throw new DateTimeException($e->getMessage(), (int) $e->getCode(), $e); - } - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. - * - * @return string[] - */ - public function getFieldsHex(): array - { - return [ - 'time_low' => $this->fields->getTimeLow()->toString(), - 'time_mid' => $this->fields->getTimeMid()->toString(), - 'time_hi_and_version' => $this->fields->getTimeHiAndVersion()->toString(), - 'clock_seq_hi_and_reserved' => $this->fields->getClockSeqHiAndReserved()->toString(), - 'clock_seq_low' => $this->fields->getClockSeqLow()->toString(), - 'node' => $this->fields->getNode()->toString(), - ]; - } - - /** - * @deprecated This method will be removed in 5.0.0. There is no direct - * alternative, but the same information may be obtained by splitting - * in half the value returned by {@see UuidInterface::getHex()}. - */ - public function getLeastSignificantBits(): string - { - $leastSignificantHex = substr($this->getHex()->toString(), 16); - - return $this->numberConverter->fromHex($leastSignificantHex); - } - - /** - * @deprecated This method will be removed in 5.0.0. There is no direct - * alternative, but the same information may be obtained by splitting - * in half the value returned by {@see UuidInterface::getHex()}. - */ - public function getLeastSignificantBitsHex(): string - { - return substr($this->getHex()->toString(), 16); - } - - /** - * @deprecated This method will be removed in 5.0.0. There is no direct - * alternative, but the same information may be obtained by splitting - * in half the value returned by {@see UuidInterface::getHex()}. - */ - public function getMostSignificantBits(): string - { - $mostSignificantHex = substr($this->getHex()->toString(), 0, 16); - - return $this->numberConverter->fromHex($mostSignificantHex); - } - - /** - * @deprecated This method will be removed in 5.0.0. There is no direct - * alternative, but the same information may be obtained by splitting - * in half the value returned by {@see UuidInterface::getHex()}. - */ - public function getMostSignificantBitsHex(): string - { - return substr($this->getHex()->toString(), 0, 16); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getNode()} and use the - * arbitrary-precision math library of your choice to convert it to a - * string integer. - */ - public function getNode(): string - { - return $this->numberConverter->fromHex($this->fields->getNode()->toString()); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getNode()}. - */ - public function getNodeHex(): string - { - return $this->fields->getNode()->toString(); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeHiAndVersion()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. - */ - public function getTimeHiAndVersion(): string - { - return $this->numberConverter->fromHex($this->fields->getTimeHiAndVersion()->toString()); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeHiAndVersion()}. - */ - public function getTimeHiAndVersionHex(): string - { - return $this->fields->getTimeHiAndVersion()->toString(); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeLow()} and use the - * arbitrary-precision math library of your choice to convert it to a - * string integer. - */ - public function getTimeLow(): string - { - return $this->numberConverter->fromHex($this->fields->getTimeLow()->toString()); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeLow()}. - */ - public function getTimeLowHex(): string - { - return $this->fields->getTimeLow()->toString(); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeMid()} and use the - * arbitrary-precision math library of your choice to convert it to a - * string integer. - */ - public function getTimeMid(): string - { - return $this->numberConverter->fromHex($this->fields->getTimeMid()->toString()); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeMid()}. - */ - public function getTimeMidHex(): string - { - return $this->fields->getTimeMid()->toString(); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimestamp()} and use - * the arbitrary-precision math library of your choice to convert it to - * a string integer. - */ - public function getTimestamp(): string - { - if ($this->fields->getVersion() !== 1) { - throw new UnsupportedOperationException('Not a time-based UUID'); - } - - return $this->numberConverter->fromHex($this->fields->getTimestamp()->toString()); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimestamp()}. - */ - public function getTimestampHex(): string - { - if ($this->fields->getVersion() !== 1) { - throw new UnsupportedOperationException('Not a time-based UUID'); - } - - return $this->fields->getTimestamp()->toString(); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getVariant()}. - */ - public function getVariant(): ?int - { - return $this->fields->getVariant(); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getVersion()}. - */ - public function getVersion(): ?int - { - return $this->fields->getVersion(); - } -} diff --git a/vendor/ramsey/uuid/src/Exception/BuilderNotFoundException.php b/vendor/ramsey/uuid/src/Exception/BuilderNotFoundException.php deleted file mode 100644 index 220ffedb..00000000 --- a/vendor/ramsey/uuid/src/Exception/BuilderNotFoundException.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Exception; - -use RuntimeException as PhpRuntimeException; - -/** - * Thrown to indicate that no suitable builder could be found - */ -class BuilderNotFoundException extends PhpRuntimeException implements UuidExceptionInterface -{ -} diff --git a/vendor/ramsey/uuid/src/Exception/DateTimeException.php b/vendor/ramsey/uuid/src/Exception/DateTimeException.php deleted file mode 100644 index 5f0e658b..00000000 --- a/vendor/ramsey/uuid/src/Exception/DateTimeException.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Exception; - -use RuntimeException as PhpRuntimeException; - -/** - * Thrown to indicate that the PHP DateTime extension encountered an exception/error - */ -class DateTimeException extends PhpRuntimeException implements UuidExceptionInterface -{ -} diff --git a/vendor/ramsey/uuid/src/Exception/DceSecurityException.php b/vendor/ramsey/uuid/src/Exception/DceSecurityException.php deleted file mode 100644 index e6d80013..00000000 --- a/vendor/ramsey/uuid/src/Exception/DceSecurityException.php +++ /dev/null @@ -1,25 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Exception; - -use RuntimeException as PhpRuntimeException; - -/** - * Thrown to indicate an exception occurred while dealing with DCE Security - * (version 2) UUIDs - */ -class DceSecurityException extends PhpRuntimeException implements UuidExceptionInterface -{ -} diff --git a/vendor/ramsey/uuid/src/Exception/InvalidArgumentException.php b/vendor/ramsey/uuid/src/Exception/InvalidArgumentException.php deleted file mode 100644 index 2a1fa3ac..00000000 --- a/vendor/ramsey/uuid/src/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Exception; - -use InvalidArgumentException as PhpInvalidArgumentException; - -/** - * Thrown to indicate that the argument received is not valid - */ -class InvalidArgumentException extends PhpInvalidArgumentException implements UuidExceptionInterface -{ -} diff --git a/vendor/ramsey/uuid/src/Exception/InvalidBytesException.php b/vendor/ramsey/uuid/src/Exception/InvalidBytesException.php deleted file mode 100644 index 1c94f659..00000000 --- a/vendor/ramsey/uuid/src/Exception/InvalidBytesException.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Exception; - -use RuntimeException as PhpRuntimeException; - -/** - * Thrown to indicate that the bytes being operated on are invalid in some way - */ -class InvalidBytesException extends PhpRuntimeException implements UuidExceptionInterface -{ -} diff --git a/vendor/ramsey/uuid/src/Exception/InvalidUuidStringException.php b/vendor/ramsey/uuid/src/Exception/InvalidUuidStringException.php deleted file mode 100644 index 6d975816..00000000 --- a/vendor/ramsey/uuid/src/Exception/InvalidUuidStringException.php +++ /dev/null @@ -1,25 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Exception; - -/** - * Thrown to indicate that the string received is not a valid UUID - * - * The InvalidArgumentException that this extends is the ramsey/uuid version - * of this exception. It exists in the same namespace as this class. - */ -class InvalidUuidStringException extends InvalidArgumentException implements UuidExceptionInterface -{ -} diff --git a/vendor/ramsey/uuid/src/Exception/NameException.php b/vendor/ramsey/uuid/src/Exception/NameException.php deleted file mode 100644 index fd96a1fa..00000000 --- a/vendor/ramsey/uuid/src/Exception/NameException.php +++ /dev/null @@ -1,25 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Exception; - -use RuntimeException as PhpRuntimeException; - -/** - * Thrown to indicate that an error occurred while attempting to hash a - * namespace and name - */ -class NameException extends PhpRuntimeException implements UuidExceptionInterface -{ -} diff --git a/vendor/ramsey/uuid/src/Exception/NodeException.php b/vendor/ramsey/uuid/src/Exception/NodeException.php deleted file mode 100644 index 0dbdd50b..00000000 --- a/vendor/ramsey/uuid/src/Exception/NodeException.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Exception; - -use RuntimeException as PhpRuntimeException; - -/** - * Thrown to indicate that attempting to fetch or create a node ID encountered an error - */ -class NodeException extends PhpRuntimeException implements UuidExceptionInterface -{ -} diff --git a/vendor/ramsey/uuid/src/Exception/RandomSourceException.php b/vendor/ramsey/uuid/src/Exception/RandomSourceException.php deleted file mode 100644 index a44dd34a..00000000 --- a/vendor/ramsey/uuid/src/Exception/RandomSourceException.php +++ /dev/null @@ -1,27 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Exception; - -use RuntimeException as PhpRuntimeException; - -/** - * Thrown to indicate that the source of random data encountered an error - * - * This exception is used mostly to indicate that random_bytes() or random_int() - * threw an exception. However, it may be used for other sources of random data. - */ -class RandomSourceException extends PhpRuntimeException implements UuidExceptionInterface -{ -} diff --git a/vendor/ramsey/uuid/src/Exception/TimeSourceException.php b/vendor/ramsey/uuid/src/Exception/TimeSourceException.php deleted file mode 100644 index fc9cf36b..00000000 --- a/vendor/ramsey/uuid/src/Exception/TimeSourceException.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Exception; - -use RuntimeException as PhpRuntimeException; - -/** - * Thrown to indicate that the source of time encountered an error - */ -class TimeSourceException extends PhpRuntimeException implements UuidExceptionInterface -{ -} diff --git a/vendor/ramsey/uuid/src/Exception/UnableToBuildUuidException.php b/vendor/ramsey/uuid/src/Exception/UnableToBuildUuidException.php deleted file mode 100644 index 5ba26d8d..00000000 --- a/vendor/ramsey/uuid/src/Exception/UnableToBuildUuidException.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Exception; - -use RuntimeException as PhpRuntimeException; - -/** - * Thrown to indicate a builder is unable to build a UUID - */ -class UnableToBuildUuidException extends PhpRuntimeException implements UuidExceptionInterface -{ -} diff --git a/vendor/ramsey/uuid/src/Exception/UnsupportedOperationException.php b/vendor/ramsey/uuid/src/Exception/UnsupportedOperationException.php deleted file mode 100644 index e1b3eda1..00000000 --- a/vendor/ramsey/uuid/src/Exception/UnsupportedOperationException.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Exception; - -use LogicException as PhpLogicException; - -/** - * Thrown to indicate that the requested operation is not supported - */ -class UnsupportedOperationException extends PhpLogicException implements UuidExceptionInterface -{ -} diff --git a/vendor/ramsey/uuid/src/Exception/UuidExceptionInterface.php b/vendor/ramsey/uuid/src/Exception/UuidExceptionInterface.php deleted file mode 100644 index a2f1c103..00000000 --- a/vendor/ramsey/uuid/src/Exception/UuidExceptionInterface.php +++ /dev/null @@ -1,21 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Exception; - -use Throwable; - -interface UuidExceptionInterface extends Throwable -{ -} diff --git a/vendor/ramsey/uuid/src/FeatureSet.php b/vendor/ramsey/uuid/src/FeatureSet.php deleted file mode 100644 index b9af869f..00000000 --- a/vendor/ramsey/uuid/src/FeatureSet.php +++ /dev/null @@ -1,397 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid; - -use Ramsey\Uuid\Builder\FallbackBuilder; -use Ramsey\Uuid\Builder\UuidBuilderInterface; -use Ramsey\Uuid\Codec\CodecInterface; -use Ramsey\Uuid\Codec\GuidStringCodec; -use Ramsey\Uuid\Codec\StringCodec; -use Ramsey\Uuid\Converter\Number\GenericNumberConverter; -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Converter\Time\GenericTimeConverter; -use Ramsey\Uuid\Converter\Time\PhpTimeConverter; -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Generator\DceSecurityGenerator; -use Ramsey\Uuid\Generator\DceSecurityGeneratorInterface; -use Ramsey\Uuid\Generator\NameGeneratorFactory; -use Ramsey\Uuid\Generator\NameGeneratorInterface; -use Ramsey\Uuid\Generator\PeclUuidNameGenerator; -use Ramsey\Uuid\Generator\PeclUuidRandomGenerator; -use Ramsey\Uuid\Generator\PeclUuidTimeGenerator; -use Ramsey\Uuid\Generator\RandomGeneratorFactory; -use Ramsey\Uuid\Generator\RandomGeneratorInterface; -use Ramsey\Uuid\Generator\TimeGeneratorFactory; -use Ramsey\Uuid\Generator\TimeGeneratorInterface; -use Ramsey\Uuid\Generator\UnixTimeGenerator; -use Ramsey\Uuid\Guid\GuidBuilder; -use Ramsey\Uuid\Math\BrickMathCalculator; -use Ramsey\Uuid\Math\CalculatorInterface; -use Ramsey\Uuid\Nonstandard\UuidBuilder as NonstandardUuidBuilder; -use Ramsey\Uuid\Provider\Dce\SystemDceSecurityProvider; -use Ramsey\Uuid\Provider\DceSecurityProviderInterface; -use Ramsey\Uuid\Provider\Node\FallbackNodeProvider; -use Ramsey\Uuid\Provider\Node\RandomNodeProvider; -use Ramsey\Uuid\Provider\Node\SystemNodeProvider; -use Ramsey\Uuid\Provider\NodeProviderInterface; -use Ramsey\Uuid\Provider\Time\SystemTimeProvider; -use Ramsey\Uuid\Provider\TimeProviderInterface; -use Ramsey\Uuid\Rfc4122\UuidBuilder as Rfc4122UuidBuilder; -use Ramsey\Uuid\Validator\GenericValidator; -use Ramsey\Uuid\Validator\ValidatorInterface; - -use const PHP_INT_SIZE; - -/** - * FeatureSet detects and exposes available features in the current environment - * - * A feature set is used by UuidFactory to determine the available features and - * capabilities of the environment. - */ -class FeatureSet -{ - private ?TimeProviderInterface $timeProvider = null; - private CalculatorInterface $calculator; - private CodecInterface $codec; - private DceSecurityGeneratorInterface $dceSecurityGenerator; - private NameGeneratorInterface $nameGenerator; - private NodeProviderInterface $nodeProvider; - private NumberConverterInterface $numberConverter; - private RandomGeneratorInterface $randomGenerator; - private TimeConverterInterface $timeConverter; - private TimeGeneratorInterface $timeGenerator; - private TimeGeneratorInterface $unixTimeGenerator; - private UuidBuilderInterface $builder; - private ValidatorInterface $validator; - - /** - * @param bool $useGuids True build UUIDs using the GuidStringCodec - * @param bool $force32Bit True to force the use of 32-bit functionality - * (primarily for testing purposes) - * @param bool $forceNoBigNumber (obsolete) - * @param bool $ignoreSystemNode True to disable attempts to check for the - * system node ID (primarily for testing purposes) - * @param bool $enablePecl True to enable the use of the PeclUuidTimeGenerator - * to generate version 1 UUIDs - */ - public function __construct( - bool $useGuids = false, - private bool $force32Bit = false, - bool $forceNoBigNumber = false, - private bool $ignoreSystemNode = false, - private bool $enablePecl = false - ) { - $this->randomGenerator = $this->buildRandomGenerator(); - $this->setCalculator(new BrickMathCalculator()); - $this->builder = $this->buildUuidBuilder($useGuids); - $this->codec = $this->buildCodec($useGuids); - $this->nodeProvider = $this->buildNodeProvider(); - $this->nameGenerator = $this->buildNameGenerator(); - $this->setTimeProvider(new SystemTimeProvider()); - $this->setDceSecurityProvider(new SystemDceSecurityProvider()); - $this->validator = new GenericValidator(); - - assert($this->timeProvider !== null); - $this->unixTimeGenerator = $this->buildUnixTimeGenerator(); - } - - /** - * Returns the builder configured for this environment - */ - public function getBuilder(): UuidBuilderInterface - { - return $this->builder; - } - - /** - * Returns the calculator configured for this environment - */ - public function getCalculator(): CalculatorInterface - { - return $this->calculator; - } - - /** - * Returns the codec configured for this environment - */ - public function getCodec(): CodecInterface - { - return $this->codec; - } - - /** - * Returns the DCE Security generator configured for this environment - */ - public function getDceSecurityGenerator(): DceSecurityGeneratorInterface - { - return $this->dceSecurityGenerator; - } - - /** - * Returns the name generator configured for this environment - */ - public function getNameGenerator(): NameGeneratorInterface - { - return $this->nameGenerator; - } - - /** - * Returns the node provider configured for this environment - */ - public function getNodeProvider(): NodeProviderInterface - { - return $this->nodeProvider; - } - - /** - * Returns the number converter configured for this environment - */ - public function getNumberConverter(): NumberConverterInterface - { - return $this->numberConverter; - } - - /** - * Returns the random generator configured for this environment - */ - public function getRandomGenerator(): RandomGeneratorInterface - { - return $this->randomGenerator; - } - - /** - * Returns the time converter configured for this environment - */ - public function getTimeConverter(): TimeConverterInterface - { - return $this->timeConverter; - } - - /** - * Returns the time generator configured for this environment - */ - public function getTimeGenerator(): TimeGeneratorInterface - { - return $this->timeGenerator; - } - - /** - * Returns the Unix Epoch time generator configured for this environment - */ - public function getUnixTimeGenerator(): TimeGeneratorInterface - { - return $this->unixTimeGenerator; - } - - /** - * Returns the validator configured for this environment - */ - public function getValidator(): ValidatorInterface - { - return $this->validator; - } - - /** - * Sets the calculator to use in this environment - */ - public function setCalculator(CalculatorInterface $calculator): void - { - $this->calculator = $calculator; - $this->numberConverter = $this->buildNumberConverter($calculator); - $this->timeConverter = $this->buildTimeConverter($calculator); - - /** @psalm-suppress RedundantPropertyInitializationCheck */ - if (isset($this->timeProvider)) { - $this->timeGenerator = $this->buildTimeGenerator($this->timeProvider); - } - } - - /** - * Sets the DCE Security provider to use in this environment - */ - public function setDceSecurityProvider(DceSecurityProviderInterface $dceSecurityProvider): void - { - $this->dceSecurityGenerator = $this->buildDceSecurityGenerator($dceSecurityProvider); - } - - /** - * Sets the node provider to use in this environment - */ - public function setNodeProvider(NodeProviderInterface $nodeProvider): void - { - $this->nodeProvider = $nodeProvider; - - if (isset($this->timeProvider)) { - $this->timeGenerator = $this->buildTimeGenerator($this->timeProvider); - } - } - - /** - * Sets the time provider to use in this environment - */ - public function setTimeProvider(TimeProviderInterface $timeProvider): void - { - $this->timeProvider = $timeProvider; - $this->timeGenerator = $this->buildTimeGenerator($timeProvider); - } - - /** - * Set the validator to use in this environment - */ - public function setValidator(ValidatorInterface $validator): void - { - $this->validator = $validator; - } - - /** - * Returns a codec configured for this environment - * - * @param bool $useGuids Whether to build UUIDs using the GuidStringCodec - */ - private function buildCodec(bool $useGuids = false): CodecInterface - { - if ($useGuids) { - return new GuidStringCodec($this->builder); - } - - return new StringCodec($this->builder); - } - - /** - * Returns a DCE Security generator configured for this environment - */ - private function buildDceSecurityGenerator( - DceSecurityProviderInterface $dceSecurityProvider - ): DceSecurityGeneratorInterface { - return new DceSecurityGenerator( - $this->numberConverter, - $this->timeGenerator, - $dceSecurityProvider - ); - } - - /** - * Returns a node provider configured for this environment - */ - private function buildNodeProvider(): NodeProviderInterface - { - if ($this->ignoreSystemNode) { - return new RandomNodeProvider(); - } - - return new FallbackNodeProvider([ - new SystemNodeProvider(), - new RandomNodeProvider(), - ]); - } - - /** - * Returns a number converter configured for this environment - */ - private function buildNumberConverter(CalculatorInterface $calculator): NumberConverterInterface - { - return new GenericNumberConverter($calculator); - } - - /** - * Returns a random generator configured for this environment - */ - private function buildRandomGenerator(): RandomGeneratorInterface - { - if ($this->enablePecl) { - return new PeclUuidRandomGenerator(); - } - - return (new RandomGeneratorFactory())->getGenerator(); - } - - /** - * Returns a time generator configured for this environment - * - * @param TimeProviderInterface $timeProvider The time provider to use with - * the time generator - */ - private function buildTimeGenerator(TimeProviderInterface $timeProvider): TimeGeneratorInterface - { - if ($this->enablePecl) { - return new PeclUuidTimeGenerator(); - } - - return (new TimeGeneratorFactory( - $this->nodeProvider, - $this->timeConverter, - $timeProvider - ))->getGenerator(); - } - - /** - * Returns a Unix Epoch time generator configured for this environment - */ - private function buildUnixTimeGenerator(): TimeGeneratorInterface - { - return new UnixTimeGenerator($this->randomGenerator); - } - - /** - * Returns a name generator configured for this environment - */ - private function buildNameGenerator(): NameGeneratorInterface - { - if ($this->enablePecl) { - return new PeclUuidNameGenerator(); - } - - return (new NameGeneratorFactory())->getGenerator(); - } - - /** - * Returns a time converter configured for this environment - */ - private function buildTimeConverter(CalculatorInterface $calculator): TimeConverterInterface - { - $genericConverter = new GenericTimeConverter($calculator); - - if ($this->is64BitSystem()) { - return new PhpTimeConverter($calculator, $genericConverter); - } - - return $genericConverter; - } - - /** - * Returns a UUID builder configured for this environment - * - * @param bool $useGuids Whether to build UUIDs using the GuidStringCodec - */ - private function buildUuidBuilder(bool $useGuids = false): UuidBuilderInterface - { - if ($useGuids) { - return new GuidBuilder($this->numberConverter, $this->timeConverter); - } - - return new FallbackBuilder([ - new Rfc4122UuidBuilder($this->numberConverter, $this->timeConverter), - new NonstandardUuidBuilder($this->numberConverter, $this->timeConverter), - ]); - } - - /** - * Returns true if the PHP build is 64-bit - */ - private function is64BitSystem(): bool - { - return PHP_INT_SIZE === 8 && !$this->force32Bit; - } -} diff --git a/vendor/ramsey/uuid/src/Fields/FieldsInterface.php b/vendor/ramsey/uuid/src/Fields/FieldsInterface.php deleted file mode 100644 index f1b7a290..00000000 --- a/vendor/ramsey/uuid/src/Fields/FieldsInterface.php +++ /dev/null @@ -1,32 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Fields; - -use Serializable; - -/** - * UUIDs are comprised of unsigned integers, the bytes of which are separated - * into fields and arranged in a particular layout defined by the specification - * for the variant - * - * @psalm-immutable - */ -interface FieldsInterface extends Serializable -{ - /** - * Returns the bytes that comprise the fields - */ - public function getBytes(): string; -} diff --git a/vendor/ramsey/uuid/src/Fields/SerializableFieldsTrait.php b/vendor/ramsey/uuid/src/Fields/SerializableFieldsTrait.php deleted file mode 100644 index 3d36b6f1..00000000 --- a/vendor/ramsey/uuid/src/Fields/SerializableFieldsTrait.php +++ /dev/null @@ -1,87 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Fields; - -use ValueError; - -use function base64_decode; -use function sprintf; -use function strlen; - -/** - * Provides common serialization functionality to fields - * - * @psalm-immutable - */ -trait SerializableFieldsTrait -{ - /** - * @param string $bytes The bytes that comprise the fields - */ - abstract public function __construct(string $bytes); - - /** - * Returns the bytes that comprise the fields - */ - abstract public function getBytes(): string; - - /** - * Returns a string representation of object - */ - public function serialize(): string - { - return $this->getBytes(); - } - - /** - * @return array{bytes: string} - */ - public function __serialize(): array - { - return ['bytes' => $this->getBytes()]; - } - - /** - * Constructs the object from a serialized string representation - * - * @param string $data The serialized string representation of the object - * - * @psalm-suppress UnusedMethodCall - */ - public function unserialize(string $data): void - { - if (strlen($data) === 16) { - $this->__construct($data); - } else { - $this->__construct(base64_decode($data)); - } - } - - /** - * @param array{bytes?: string} $data - * - * @psalm-suppress UnusedMethodCall - */ - public function __unserialize(array $data): void - { - // @codeCoverageIgnoreStart - if (!isset($data['bytes'])) { - throw new ValueError(sprintf('%s(): Argument #1 ($data) is invalid', __METHOD__)); - } - // @codeCoverageIgnoreEnd - - $this->unserialize($data['bytes']); - } -} diff --git a/vendor/ramsey/uuid/src/Generator/CombGenerator.php b/vendor/ramsey/uuid/src/Generator/CombGenerator.php deleted file mode 100644 index 0e887060..00000000 --- a/vendor/ramsey/uuid/src/Generator/CombGenerator.php +++ /dev/null @@ -1,115 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Generator; - -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Exception\InvalidArgumentException; - -use function bin2hex; -use function explode; -use function hex2bin; -use function microtime; -use function str_pad; -use function substr; - -use const STR_PAD_LEFT; - -/** - * CombGenerator generates COMBs (combined UUID/timestamp) - * - * The CombGenerator, when used with the StringCodec (and, by proxy, the - * TimestampLastCombCodec) or the TimestampFirstCombCodec, combines the current - * timestamp with a UUID (hence the name "COMB"). The timestamp either appears - * as the first or last 48 bits of the COMB, depending on the codec used. - * - * By default, COMBs will have the timestamp set as the last 48 bits of the - * identifier. - * - * ``` php - * $factory = new UuidFactory(); - * - * $factory->setRandomGenerator(new CombGenerator( - * $factory->getRandomGenerator(), - * $factory->getNumberConverter() - * )); - * - * $comb = $factory->uuid4(); - * ``` - * - * To generate a COMB with the timestamp as the first 48 bits, set the - * TimestampFirstCombCodec as the codec. - * - * ``` php - * $factory->setCodec(new TimestampFirstCombCodec($factory->getUuidBuilder())); - * ``` - * - * @link https://www.informit.com/articles/printerfriendly/25862 The Cost of GUIDs as Primary Keys - */ -class CombGenerator implements RandomGeneratorInterface -{ - public const TIMESTAMP_BYTES = 6; - - public function __construct( - private RandomGeneratorInterface $generator, - private NumberConverterInterface $numberConverter - ) { - } - - /** - * @throws InvalidArgumentException if $length is not a positive integer - * greater than or equal to CombGenerator::TIMESTAMP_BYTES - * - * @inheritDoc - */ - public function generate(int $length): string - { - if ($length < self::TIMESTAMP_BYTES) { - throw new InvalidArgumentException( - 'Length must be a positive integer greater than or equal to ' . self::TIMESTAMP_BYTES - ); - } - - $hash = ''; - if (self::TIMESTAMP_BYTES > 0 && $length > self::TIMESTAMP_BYTES) { - $hash = $this->generator->generate($length - self::TIMESTAMP_BYTES); - } - - $lsbTime = str_pad( - $this->numberConverter->toHex($this->timestamp()), - self::TIMESTAMP_BYTES * 2, - '0', - STR_PAD_LEFT - ); - - return (string) hex2bin( - str_pad( - bin2hex($hash), - $length - self::TIMESTAMP_BYTES, - '0' - ) - . $lsbTime - ); - } - - /** - * Returns current timestamp a string integer, precise to 0.00001 seconds - */ - private function timestamp(): string - { - $time = explode(' ', microtime(false)); - - return $time[1] . substr($time[0], 2, 5); - } -} diff --git a/vendor/ramsey/uuid/src/Generator/DceSecurityGenerator.php b/vendor/ramsey/uuid/src/Generator/DceSecurityGenerator.php deleted file mode 100644 index 37ba7813..00000000 --- a/vendor/ramsey/uuid/src/Generator/DceSecurityGenerator.php +++ /dev/null @@ -1,141 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Generator; - -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Exception\DceSecurityException; -use Ramsey\Uuid\Provider\DceSecurityProviderInterface; -use Ramsey\Uuid\Type\Hexadecimal; -use Ramsey\Uuid\Type\Integer as IntegerObject; -use Ramsey\Uuid\Uuid; - -use function hex2bin; -use function in_array; -use function pack; -use function str_pad; -use function strlen; -use function substr_replace; - -use const STR_PAD_LEFT; - -/** - * DceSecurityGenerator generates strings of binary data based on a local - * domain, local identifier, node ID, clock sequence, and the current time - */ -class DceSecurityGenerator implements DceSecurityGeneratorInterface -{ - private const DOMAINS = [ - Uuid::DCE_DOMAIN_PERSON, - Uuid::DCE_DOMAIN_GROUP, - Uuid::DCE_DOMAIN_ORG, - ]; - - /** - * Upper bounds for the clock sequence in DCE Security UUIDs. - */ - private const CLOCK_SEQ_HIGH = 63; - - /** - * Lower bounds for the clock sequence in DCE Security UUIDs. - */ - private const CLOCK_SEQ_LOW = 0; - - public function __construct( - private NumberConverterInterface $numberConverter, - private TimeGeneratorInterface $timeGenerator, - private DceSecurityProviderInterface $dceSecurityProvider - ) { - } - - public function generate( - int $localDomain, - ?IntegerObject $localIdentifier = null, - ?Hexadecimal $node = null, - ?int $clockSeq = null - ): string { - if (!in_array($localDomain, self::DOMAINS)) { - throw new DceSecurityException( - 'Local domain must be a valid DCE Security domain' - ); - } - - if ($localIdentifier && $localIdentifier->isNegative()) { - throw new DceSecurityException( - 'Local identifier out of bounds; it must be a value between 0 and 4294967295' - ); - } - - if ($clockSeq > self::CLOCK_SEQ_HIGH || $clockSeq < self::CLOCK_SEQ_LOW) { - throw new DceSecurityException( - 'Clock sequence out of bounds; it must be a value between 0 and 63' - ); - } - - switch ($localDomain) { - case Uuid::DCE_DOMAIN_ORG: - if ($localIdentifier === null) { - throw new DceSecurityException( - 'A local identifier must be provided for the org domain' - ); - } - - break; - case Uuid::DCE_DOMAIN_PERSON: - if ($localIdentifier === null) { - $localIdentifier = $this->dceSecurityProvider->getUid(); - } - - break; - case Uuid::DCE_DOMAIN_GROUP: - default: - if ($localIdentifier === null) { - $localIdentifier = $this->dceSecurityProvider->getGid(); - } - - break; - } - - $identifierHex = $this->numberConverter->toHex($localIdentifier->toString()); - - // The maximum value for the local identifier is 0xffffffff, or - // 4294967295. This is 8 hexadecimal digits, so if the length of - // hexadecimal digits is greater than 8, we know the value is greater - // than 0xffffffff. - if (strlen($identifierHex) > 8) { - throw new DceSecurityException( - 'Local identifier out of bounds; it must be a value between 0 and 4294967295' - ); - } - - $domainByte = pack('n', $localDomain)[1]; - $identifierBytes = (string) hex2bin(str_pad($identifierHex, 8, '0', STR_PAD_LEFT)); - - if ($node instanceof Hexadecimal) { - $node = $node->toString(); - } - - // Shift the clock sequence 8 bits to the left, so it matches 0x3f00. - if ($clockSeq !== null) { - $clockSeq = $clockSeq << 8; - } - - $bytes = $this->timeGenerator->generate($node, $clockSeq); - - // Replace bytes in the time-based UUID with DCE Security values. - $bytes = substr_replace($bytes, $identifierBytes, 0, 4); - - return substr_replace($bytes, $domainByte, 9, 1); - } -} diff --git a/vendor/ramsey/uuid/src/Generator/DceSecurityGeneratorInterface.php b/vendor/ramsey/uuid/src/Generator/DceSecurityGeneratorInterface.php deleted file mode 100644 index faa29a53..00000000 --- a/vendor/ramsey/uuid/src/Generator/DceSecurityGeneratorInterface.php +++ /dev/null @@ -1,53 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Generator; - -use Ramsey\Uuid\Rfc4122\UuidV2; -use Ramsey\Uuid\Type\Hexadecimal; -use Ramsey\Uuid\Type\Integer as IntegerObject; - -/** - * A DCE Security generator generates strings of binary data based on a local - * domain, local identifier, node ID, clock sequence, and the current time - * - * @see UuidV2 - */ -interface DceSecurityGeneratorInterface -{ - /** - * Generate a binary string from a local domain, local identifier, node ID, - * clock sequence, and current time - * - * @param int $localDomain The local domain to use when generating bytes, - * according to DCE Security - * @param IntegerObject|null $localIdentifier The local identifier for the - * given domain; this may be a UID or GID on POSIX systems, if the local - * domain is person or group, or it may be a site-defined identifier - * if the local domain is org - * @param Hexadecimal|null $node A 48-bit number representing the hardware - * address - * @param int|null $clockSeq A 14-bit number used to help avoid duplicates - * that could arise when the clock is set backwards in time or if the - * node ID changes - * - * @return string A binary string - */ - public function generate( - int $localDomain, - ?IntegerObject $localIdentifier = null, - ?Hexadecimal $node = null, - ?int $clockSeq = null - ): string; -} diff --git a/vendor/ramsey/uuid/src/Generator/DefaultNameGenerator.php b/vendor/ramsey/uuid/src/Generator/DefaultNameGenerator.php deleted file mode 100644 index 7303e9fa..00000000 --- a/vendor/ramsey/uuid/src/Generator/DefaultNameGenerator.php +++ /dev/null @@ -1,48 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Generator; - -use Ramsey\Uuid\Exception\NameException; -use Ramsey\Uuid\UuidInterface; -use ValueError; - -use function hash; - -/** - * DefaultNameGenerator generates strings of binary data based on a namespace, - * name, and hashing algorithm - */ -class DefaultNameGenerator implements NameGeneratorInterface -{ - /** @psalm-pure */ - public function generate(UuidInterface $ns, string $name, string $hashAlgorithm): string - { - try { - /** @var string|bool $bytes */ - $bytes = @hash($hashAlgorithm, $ns->getBytes() . $name, true); - } catch (ValueError $e) { - $bytes = false; // keep same behavior than PHP 7 - } - - if ($bytes === false) { - throw new NameException(sprintf( - 'Unable to hash namespace and name with algorithm \'%s\'', - $hashAlgorithm - )); - } - - return (string) $bytes; - } -} diff --git a/vendor/ramsey/uuid/src/Generator/DefaultTimeGenerator.php b/vendor/ramsey/uuid/src/Generator/DefaultTimeGenerator.php deleted file mode 100644 index ea1e2a6f..00000000 --- a/vendor/ramsey/uuid/src/Generator/DefaultTimeGenerator.php +++ /dev/null @@ -1,129 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Generator; - -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Exception\InvalidArgumentException; -use Ramsey\Uuid\Exception\RandomSourceException; -use Ramsey\Uuid\Exception\TimeSourceException; -use Ramsey\Uuid\Provider\NodeProviderInterface; -use Ramsey\Uuid\Provider\TimeProviderInterface; -use Ramsey\Uuid\Type\Hexadecimal; -use Throwable; - -use function dechex; -use function hex2bin; -use function is_int; -use function pack; -use function preg_match; -use function sprintf; -use function str_pad; -use function strlen; - -use const STR_PAD_LEFT; - -/** - * DefaultTimeGenerator generates strings of binary data based on a node ID, - * clock sequence, and the current time - */ -class DefaultTimeGenerator implements TimeGeneratorInterface -{ - public function __construct( - private NodeProviderInterface $nodeProvider, - private TimeConverterInterface $timeConverter, - private TimeProviderInterface $timeProvider - ) { - } - - /** - * @throws InvalidArgumentException if the parameters contain invalid values - * @throws RandomSourceException if random_int() throws an exception/error - * - * @inheritDoc - */ - public function generate($node = null, ?int $clockSeq = null): string - { - if ($node instanceof Hexadecimal) { - $node = $node->toString(); - } - - $node = $this->getValidNode($node); - - if ($clockSeq === null) { - try { - // This does not use "stable storage"; see RFC 4122, Section 4.2.1.1. - $clockSeq = random_int(0, 0x3fff); - } catch (Throwable $exception) { - throw new RandomSourceException( - $exception->getMessage(), - (int) $exception->getCode(), - $exception - ); - } - } - - $time = $this->timeProvider->getTime(); - - $uuidTime = $this->timeConverter->calculateTime( - $time->getSeconds()->toString(), - $time->getMicroseconds()->toString() - ); - - $timeHex = str_pad($uuidTime->toString(), 16, '0', STR_PAD_LEFT); - - if (strlen($timeHex) !== 16) { - throw new TimeSourceException(sprintf( - 'The generated time of \'%s\' is larger than expected', - $timeHex - )); - } - - $timeBytes = (string) hex2bin($timeHex); - - return $timeBytes[4] . $timeBytes[5] . $timeBytes[6] . $timeBytes[7] - . $timeBytes[2] . $timeBytes[3] - . $timeBytes[0] . $timeBytes[1] - . pack('n*', $clockSeq) - . $node; - } - - /** - * Uses the node provider given when constructing this instance to get - * the node ID (usually a MAC address) - * - * @param int|string|null $node A node value that may be used to override the node provider - * - * @return string 6-byte binary string representation of the node - * - * @throws InvalidArgumentException - */ - private function getValidNode(int | string | null $node): string - { - if ($node === null) { - $node = $this->nodeProvider->getNode(); - } - - // Convert the node to hex, if it is still an integer. - if (is_int($node)) { - $node = dechex($node); - } - - if (!preg_match('/^[A-Fa-f0-9]+$/', (string) $node) || strlen((string) $node) > 12) { - throw new InvalidArgumentException('Invalid node value'); - } - - return (string) hex2bin(str_pad((string) $node, 12, '0', STR_PAD_LEFT)); - } -} diff --git a/vendor/ramsey/uuid/src/Generator/NameGeneratorFactory.php b/vendor/ramsey/uuid/src/Generator/NameGeneratorFactory.php deleted file mode 100644 index 6f08e291..00000000 --- a/vendor/ramsey/uuid/src/Generator/NameGeneratorFactory.php +++ /dev/null @@ -1,30 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Generator; - -/** - * NameGeneratorFactory retrieves a default name generator, based on the - * environment - */ -class NameGeneratorFactory -{ - /** - * Returns a default name generator, based on the current environment - */ - public function getGenerator(): NameGeneratorInterface - { - return new DefaultNameGenerator(); - } -} diff --git a/vendor/ramsey/uuid/src/Generator/NameGeneratorInterface.php b/vendor/ramsey/uuid/src/Generator/NameGeneratorInterface.php deleted file mode 100644 index cc43dd02..00000000 --- a/vendor/ramsey/uuid/src/Generator/NameGeneratorInterface.php +++ /dev/null @@ -1,38 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Generator; - -use Ramsey\Uuid\UuidInterface; - -/** - * A name generator generates strings of binary data created by hashing together - * a namespace with a name, according to a hashing algorithm - */ -interface NameGeneratorInterface -{ - /** - * Generate a binary string from a namespace and name hashed together with - * the specified hashing algorithm - * - * @param UuidInterface $ns The namespace - * @param string $name The name to use for creating a UUID - * @param string $hashAlgorithm The hashing algorithm to use - * - * @return string A binary string - * - * @psalm-pure - */ - public function generate(UuidInterface $ns, string $name, string $hashAlgorithm): string; -} diff --git a/vendor/ramsey/uuid/src/Generator/PeclUuidNameGenerator.php b/vendor/ramsey/uuid/src/Generator/PeclUuidNameGenerator.php deleted file mode 100644 index 6a6d1aec..00000000 --- a/vendor/ramsey/uuid/src/Generator/PeclUuidNameGenerator.php +++ /dev/null @@ -1,49 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Generator; - -use Ramsey\Uuid\Exception\NameException; -use Ramsey\Uuid\UuidInterface; - -use function sprintf; -use function uuid_generate_md5; -use function uuid_generate_sha1; -use function uuid_parse; - -/** - * PeclUuidNameGenerator generates strings of binary data from a namespace and a - * name, using ext-uuid - * - * @link https://pecl.php.net/package/uuid ext-uuid - */ -class PeclUuidNameGenerator implements NameGeneratorInterface -{ - /** @psalm-pure */ - public function generate(UuidInterface $ns, string $name, string $hashAlgorithm): string - { - $uuid = match ($hashAlgorithm) { - 'md5' => uuid_generate_md5($ns->toString(), $name), - 'sha1' => uuid_generate_sha1($ns->toString(), $name), - default => throw new NameException( - sprintf( - 'Unable to hash namespace and name with algorithm \'%s\'', - $hashAlgorithm - ) - ), - }; - - return uuid_parse($uuid); - } -} diff --git a/vendor/ramsey/uuid/src/Generator/PeclUuidRandomGenerator.php b/vendor/ramsey/uuid/src/Generator/PeclUuidRandomGenerator.php deleted file mode 100644 index 07c47d26..00000000 --- a/vendor/ramsey/uuid/src/Generator/PeclUuidRandomGenerator.php +++ /dev/null @@ -1,35 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Generator; - -use function uuid_create; -use function uuid_parse; - -use const UUID_TYPE_RANDOM; - -/** - * PeclUuidRandomGenerator generates strings of random binary data using ext-uuid - * - * @link https://pecl.php.net/package/uuid ext-uuid - */ -class PeclUuidRandomGenerator implements RandomGeneratorInterface -{ - public function generate(int $length): string - { - $uuid = uuid_create(UUID_TYPE_RANDOM); - - return uuid_parse($uuid); - } -} diff --git a/vendor/ramsey/uuid/src/Generator/PeclUuidTimeGenerator.php b/vendor/ramsey/uuid/src/Generator/PeclUuidTimeGenerator.php deleted file mode 100644 index e01f44e5..00000000 --- a/vendor/ramsey/uuid/src/Generator/PeclUuidTimeGenerator.php +++ /dev/null @@ -1,39 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Generator; - -use function uuid_create; -use function uuid_parse; - -use const UUID_TYPE_TIME; - -/** - * PeclUuidTimeGenerator generates strings of binary data for time-base UUIDs, - * using ext-uuid - * - * @link https://pecl.php.net/package/uuid ext-uuid - */ -class PeclUuidTimeGenerator implements TimeGeneratorInterface -{ - /** - * @inheritDoc - */ - public function generate($node = null, ?int $clockSeq = null): string - { - $uuid = uuid_create(UUID_TYPE_TIME); - - return uuid_parse($uuid); - } -} diff --git a/vendor/ramsey/uuid/src/Generator/RandomBytesGenerator.php b/vendor/ramsey/uuid/src/Generator/RandomBytesGenerator.php deleted file mode 100644 index 12edb96a..00000000 --- a/vendor/ramsey/uuid/src/Generator/RandomBytesGenerator.php +++ /dev/null @@ -1,45 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Generator; - -use Ramsey\Uuid\Exception\RandomSourceException; -use Throwable; - -/** - * RandomBytesGenerator generates strings of random binary data using the - * built-in `random_bytes()` PHP function - * - * @link http://php.net/random_bytes random_bytes() - */ -class RandomBytesGenerator implements RandomGeneratorInterface -{ - /** - * @throws RandomSourceException if random_bytes() throws an exception/error - * - * @inheritDoc - */ - public function generate(int $length): string - { - try { - return random_bytes($length); - } catch (Throwable $exception) { - throw new RandomSourceException( - $exception->getMessage(), - (int) $exception->getCode(), - $exception - ); - } - } -} diff --git a/vendor/ramsey/uuid/src/Generator/RandomGeneratorFactory.php b/vendor/ramsey/uuid/src/Generator/RandomGeneratorFactory.php deleted file mode 100644 index b723ac29..00000000 --- a/vendor/ramsey/uuid/src/Generator/RandomGeneratorFactory.php +++ /dev/null @@ -1,30 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Generator; - -/** - * RandomGeneratorFactory retrieves a default random generator, based on the - * environment - */ -class RandomGeneratorFactory -{ - /** - * Returns a default random generator, based on the current environment - */ - public function getGenerator(): RandomGeneratorInterface - { - return new RandomBytesGenerator(); - } -} diff --git a/vendor/ramsey/uuid/src/Generator/RandomGeneratorInterface.php b/vendor/ramsey/uuid/src/Generator/RandomGeneratorInterface.php deleted file mode 100644 index 1180b976..00000000 --- a/vendor/ramsey/uuid/src/Generator/RandomGeneratorInterface.php +++ /dev/null @@ -1,30 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Generator; - -/** - * A random generator generates strings of random binary data - */ -interface RandomGeneratorInterface -{ - /** - * Generates a string of randomized binary data - * - * @param int<1, max> $length The number of bytes of random binary data to generate - * - * @return string A binary string - */ - public function generate(int $length): string; -} diff --git a/vendor/ramsey/uuid/src/Generator/RandomLibAdapter.php b/vendor/ramsey/uuid/src/Generator/RandomLibAdapter.php deleted file mode 100644 index fd0ccc8a..00000000 --- a/vendor/ramsey/uuid/src/Generator/RandomLibAdapter.php +++ /dev/null @@ -1,56 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Generator; - -use RandomLib\Factory; -use RandomLib\Generator; - -/** - * RandomLibAdapter generates strings of random binary data using the - * paragonie/random-lib library - * - * @deprecated This class will be removed in 5.0.0. Use the default - * RandomBytesGenerator or implement your own generator that implements - * RandomGeneratorInterface. - * - * @link https://packagist.org/packages/paragonie/random-lib paragonie/random-lib - */ -class RandomLibAdapter implements RandomGeneratorInterface -{ - private Generator $generator; - - /** - * Constructs a RandomLibAdapter - * - * By default, if no Generator is passed in, this creates a high-strength - * generator to use when generating random binary data. - * - * @param Generator|null $generator The generator to use when generating binary data - */ - public function __construct(?Generator $generator = null) - { - if ($generator === null) { - $factory = new Factory(); - $generator = $factory->getHighStrengthGenerator(); - } - - $this->generator = $generator; - } - - public function generate(int $length): string - { - return $this->generator->generate($length); - } -} diff --git a/vendor/ramsey/uuid/src/Generator/TimeGeneratorFactory.php b/vendor/ramsey/uuid/src/Generator/TimeGeneratorFactory.php deleted file mode 100644 index 8d06fc3a..00000000 --- a/vendor/ramsey/uuid/src/Generator/TimeGeneratorFactory.php +++ /dev/null @@ -1,45 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Generator; - -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Provider\NodeProviderInterface; -use Ramsey\Uuid\Provider\TimeProviderInterface; - -/** - * TimeGeneratorFactory retrieves a default time generator, based on the - * environment - */ -class TimeGeneratorFactory -{ - public function __construct( - private NodeProviderInterface $nodeProvider, - private TimeConverterInterface $timeConverter, - private TimeProviderInterface $timeProvider - ) { - } - - /** - * Returns a default time generator, based on the current environment - */ - public function getGenerator(): TimeGeneratorInterface - { - return new DefaultTimeGenerator( - $this->nodeProvider, - $this->timeConverter, - $this->timeProvider - ); - } -} diff --git a/vendor/ramsey/uuid/src/Generator/TimeGeneratorInterface.php b/vendor/ramsey/uuid/src/Generator/TimeGeneratorInterface.php deleted file mode 100644 index 18f21c4b..00000000 --- a/vendor/ramsey/uuid/src/Generator/TimeGeneratorInterface.php +++ /dev/null @@ -1,38 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Generator; - -use Ramsey\Uuid\Type\Hexadecimal; - -/** - * A time generator generates strings of binary data based on a node ID, - * clock sequence, and the current time - */ -interface TimeGeneratorInterface -{ - /** - * Generate a binary string from a node ID, clock sequence, and current time - * - * @param Hexadecimal|int|string|null $node A 48-bit number representing the - * hardware address; this number may be represented as an integer or a - * hexadecimal string - * @param int|null $clockSeq A 14-bit number used to help avoid duplicates - * that could arise when the clock is set backwards in time or if the - * node ID changes - * - * @return string A binary string - */ - public function generate($node = null, ?int $clockSeq = null): string; -} diff --git a/vendor/ramsey/uuid/src/Generator/UnixTimeGenerator.php b/vendor/ramsey/uuid/src/Generator/UnixTimeGenerator.php deleted file mode 100644 index af94decf..00000000 --- a/vendor/ramsey/uuid/src/Generator/UnixTimeGenerator.php +++ /dev/null @@ -1,169 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Generator; - -use Brick\Math\BigInteger; -use DateTimeImmutable; -use DateTimeInterface; -use Ramsey\Uuid\Type\Hexadecimal; - -use function hash; -use function pack; -use function str_pad; -use function strlen; -use function substr; -use function substr_replace; -use function unpack; - -use const PHP_INT_SIZE; -use const STR_PAD_LEFT; - -/** - * UnixTimeGenerator generates bytes that combine a 48-bit timestamp in - * milliseconds since the Unix Epoch with 80 random bits - * - * Code and concepts within this class are borrowed from the symfony/uid package - * and are used under the terms of the MIT license distributed with symfony/uid. - * - * symfony/uid is copyright (c) Fabien Potencier. - * - * @link https://symfony.com/components/Uid Symfony Uid component - * @link https://github.com/symfony/uid/blob/4f9f537e57261519808a7ce1d941490736522bbc/UuidV7.php Symfony UuidV7 class - * @link https://github.com/symfony/uid/blob/6.2/LICENSE MIT License - */ -class UnixTimeGenerator implements TimeGeneratorInterface -{ - private static string $time = ''; - private static ?string $seed = null; - private static int $seedIndex = 0; - - /** @var int[] */ - private static array $rand = []; - - /** @var int[] */ - private static array $seedParts; - - public function __construct( - private RandomGeneratorInterface $randomGenerator, - private int $intSize = PHP_INT_SIZE - ) { - } - - /** - * @param Hexadecimal|int|string|null $node Unused in this generator - * @param int|null $clockSeq Unused in this generator - * @param DateTimeInterface $dateTime A date-time instance to use when - * generating bytes - * - * @inheritDoc - */ - public function generate($node = null, ?int $clockSeq = null, ?DateTimeInterface $dateTime = null): string - { - $time = ($dateTime ?? new DateTimeImmutable('now'))->format('Uv'); - - if ($time > self::$time || ($dateTime !== null && $time !== self::$time)) { - $this->randomize($time); - } else { - $time = $this->increment(); - } - - if ($this->intSize >= 8) { - $time = substr(pack('J', (int) $time), -6); - } else { - $time = str_pad(BigInteger::of($time)->toBytes(false), 6, "\x00", STR_PAD_LEFT); - } - - /** @var non-empty-string */ - return $time . pack('n*', self::$rand[1], self::$rand[2], self::$rand[3], self::$rand[4], self::$rand[5]); - } - - private function randomize(string $time): void - { - if (self::$seed === null) { - $seed = $this->randomGenerator->generate(16); - self::$seed = $seed; - } else { - $seed = $this->randomGenerator->generate(10); - } - - /** @var int[] $rand */ - $rand = unpack('n*', $seed); - $rand[1] &= 0x03ff; - - self::$rand = $rand; - self::$time = $time; - } - - /** - * Special thanks to Nicolas Grekas for sharing the following information: - * - * Within the same ms, we increment the rand part by a random 24-bit number. - * - * Instead of getting this number from random_bytes(), which is slow, we get - * it by sha512-hashing self::$seed. This produces 64 bytes of entropy, - * which we need to split in a list of 24-bit numbers. unpack() first splits - * them into 16 x 32-bit numbers; we take the first byte of each of these - * numbers to get 5 extra 24-bit numbers. Then, we consume those numbers - * one-by-one and run this logic every 21 iterations. - * - * self::$rand holds the random part of the UUID, split into 5 x 16-bit - * numbers for x86 portability. We increment this random part by the next - * 24-bit number in the self::$seedParts list and decrement - * self::$seedIndex. - * - * @link https://twitter.com/nicolasgrekas/status/1583356938825261061 Tweet from Nicolas Grekas - */ - private function increment(): string - { - if (self::$seedIndex === 0 && self::$seed !== null) { - self::$seed = hash('sha512', self::$seed, true); - - /** @var int[] $s */ - $s = unpack('l*', self::$seed); - $s[] = ($s[1] >> 8 & 0xff0000) | ($s[2] >> 16 & 0xff00) | ($s[3] >> 24 & 0xff); - $s[] = ($s[4] >> 8 & 0xff0000) | ($s[5] >> 16 & 0xff00) | ($s[6] >> 24 & 0xff); - $s[] = ($s[7] >> 8 & 0xff0000) | ($s[8] >> 16 & 0xff00) | ($s[9] >> 24 & 0xff); - $s[] = ($s[10] >> 8 & 0xff0000) | ($s[11] >> 16 & 0xff00) | ($s[12] >> 24 & 0xff); - $s[] = ($s[13] >> 8 & 0xff0000) | ($s[14] >> 16 & 0xff00) | ($s[15] >> 24 & 0xff); - - self::$seedParts = $s; - self::$seedIndex = 21; - } - - self::$rand[5] = 0xffff & $carry = self::$rand[5] + (self::$seedParts[self::$seedIndex--] & 0xffffff); - self::$rand[4] = 0xffff & $carry = self::$rand[4] + ($carry >> 16); - self::$rand[3] = 0xffff & $carry = self::$rand[3] + ($carry >> 16); - self::$rand[2] = 0xffff & $carry = self::$rand[2] + ($carry >> 16); - self::$rand[1] += $carry >> 16; - - if (0xfc00 & self::$rand[1]) { - $time = self::$time; - $mtime = (int) substr($time, -9); - - if ($this->intSize >= 8 || strlen($time) < 10) { - $time = (string) ((int) $time + 1); - } elseif ($mtime === 999999999) { - $time = (1 + (int) substr($time, 0, -9)) . '000000000'; - } else { - $mtime++; - $time = substr_replace($time, str_pad((string) $mtime, 9, '0', STR_PAD_LEFT), -9); - } - - $this->randomize($time); - } - - return self::$time; - } -} diff --git a/vendor/ramsey/uuid/src/Guid/Fields.php b/vendor/ramsey/uuid/src/Guid/Fields.php deleted file mode 100644 index 0fc5d1c9..00000000 --- a/vendor/ramsey/uuid/src/Guid/Fields.php +++ /dev/null @@ -1,195 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Guid; - -use Ramsey\Uuid\Exception\InvalidArgumentException; -use Ramsey\Uuid\Fields\SerializableFieldsTrait; -use Ramsey\Uuid\Rfc4122\FieldsInterface; -use Ramsey\Uuid\Rfc4122\MaxTrait; -use Ramsey\Uuid\Rfc4122\NilTrait; -use Ramsey\Uuid\Rfc4122\VariantTrait; -use Ramsey\Uuid\Rfc4122\VersionTrait; -use Ramsey\Uuid\Type\Hexadecimal; -use Ramsey\Uuid\Uuid; - -use function bin2hex; -use function dechex; -use function hexdec; -use function pack; -use function sprintf; -use function str_pad; -use function strlen; -use function substr; -use function unpack; - -use const STR_PAD_LEFT; - -/** - * GUIDs are comprised of a set of named fields, according to RFC 4122 - * - * @see Guid - * - * @psalm-immutable - */ -final class Fields implements FieldsInterface -{ - use MaxTrait; - use NilTrait; - use SerializableFieldsTrait; - use VariantTrait; - use VersionTrait; - - /** - * @param string $bytes A 16-byte binary string representation of a UUID - * - * @throws InvalidArgumentException if the byte string is not exactly 16 bytes - * @throws InvalidArgumentException if the byte string does not represent a GUID - * @throws InvalidArgumentException if the byte string does not contain a valid version - */ - public function __construct(private string $bytes) - { - if (strlen($this->bytes) !== 16) { - throw new InvalidArgumentException( - 'The byte string must be 16 bytes long; ' - . 'received ' . strlen($this->bytes) . ' bytes' - ); - } - - if (!$this->isCorrectVariant()) { - throw new InvalidArgumentException( - 'The byte string received does not conform to the RFC ' - . '4122 or Microsoft Corporation variants' - ); - } - - if (!$this->isCorrectVersion()) { - throw new InvalidArgumentException( - 'The byte string received does not contain a valid version' - ); - } - } - - public function getBytes(): string - { - return $this->bytes; - } - - public function getTimeLow(): Hexadecimal - { - // Swap the bytes from little endian to network byte order. - /** @var array $hex */ - $hex = unpack( - 'H*', - pack( - 'v*', - hexdec(bin2hex(substr($this->bytes, 2, 2))), - hexdec(bin2hex(substr($this->bytes, 0, 2))) - ) - ); - - return new Hexadecimal((string) ($hex[1] ?? '')); - } - - public function getTimeMid(): Hexadecimal - { - // Swap the bytes from little endian to network byte order. - /** @var array $hex */ - $hex = unpack( - 'H*', - pack( - 'v', - hexdec(bin2hex(substr($this->bytes, 4, 2))) - ) - ); - - return new Hexadecimal((string) ($hex[1] ?? '')); - } - - public function getTimeHiAndVersion(): Hexadecimal - { - // Swap the bytes from little endian to network byte order. - /** @var array $hex */ - $hex = unpack( - 'H*', - pack( - 'v', - hexdec(bin2hex(substr($this->bytes, 6, 2))) - ) - ); - - return new Hexadecimal((string) ($hex[1] ?? '')); - } - - public function getTimestamp(): Hexadecimal - { - return new Hexadecimal(sprintf( - '%03x%04s%08s', - hexdec($this->getTimeHiAndVersion()->toString()) & 0x0fff, - $this->getTimeMid()->toString(), - $this->getTimeLow()->toString() - )); - } - - public function getClockSeq(): Hexadecimal - { - if ($this->isMax()) { - $clockSeq = 0xffff; - } elseif ($this->isNil()) { - $clockSeq = 0x0000; - } else { - $clockSeq = hexdec(bin2hex(substr($this->bytes, 8, 2))) & 0x3fff; - } - - return new Hexadecimal(str_pad(dechex($clockSeq), 4, '0', STR_PAD_LEFT)); - } - - public function getClockSeqHiAndReserved(): Hexadecimal - { - return new Hexadecimal(bin2hex(substr($this->bytes, 8, 1))); - } - - public function getClockSeqLow(): Hexadecimal - { - return new Hexadecimal(bin2hex(substr($this->bytes, 9, 1))); - } - - public function getNode(): Hexadecimal - { - return new Hexadecimal(bin2hex(substr($this->bytes, 10))); - } - - public function getVersion(): ?int - { - if ($this->isNil() || $this->isMax()) { - return null; - } - - /** @var array $parts */ - $parts = unpack('n*', $this->bytes); - - return ((int) $parts[4] >> 4) & 0x00f; - } - - private function isCorrectVariant(): bool - { - if ($this->isNil() || $this->isMax()) { - return true; - } - - $variant = $this->getVariant(); - - return $variant === Uuid::RFC_4122 || $variant === Uuid::RESERVED_MICROSOFT; - } -} diff --git a/vendor/ramsey/uuid/src/Guid/Guid.php b/vendor/ramsey/uuid/src/Guid/Guid.php deleted file mode 100644 index b3ed096a..00000000 --- a/vendor/ramsey/uuid/src/Guid/Guid.php +++ /dev/null @@ -1,61 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Guid; - -use Ramsey\Uuid\Codec\CodecInterface; -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Uuid; - -/** - * Guid represents a UUID with "native" (little-endian) byte order - * - * From Wikipedia: - * - * > The first three fields are unsigned 32- and 16-bit integers and are subject - * > to swapping, while the last two fields consist of uninterpreted bytes, not - * > subject to swapping. This byte swapping applies even for versions 3, 4, and - * > 5, where the canonical fields do not correspond to the content of the UUID. - * - * The first three fields of a GUID are encoded in little-endian byte order, - * while the last three fields are in network (big-endian) byte order. This is - * according to the history of the Microsoft definition of a GUID. - * - * According to the .NET Guid.ToByteArray method documentation: - * - * > Note that the order of bytes in the returned byte array is different from - * > the string representation of a Guid value. The order of the beginning - * > four-byte group and the next two two-byte groups is reversed, whereas the - * > order of the last two-byte group and the closing six-byte group is the - * > same. - * - * @link https://en.wikipedia.org/wiki/Universally_unique_identifier#Variants UUID Variants on Wikipedia - * @link https://docs.microsoft.com/en-us/windows/win32/api/guiddef/ns-guiddef-guid Windows GUID structure - * @link https://docs.microsoft.com/en-us/dotnet/api/system.guid .NET Guid Struct - * @link https://docs.microsoft.com/en-us/dotnet/api/system.guid.tobytearray .NET Guid.ToByteArray Method - * - * @psalm-immutable - */ -final class Guid extends Uuid -{ - public function __construct( - Fields $fields, - NumberConverterInterface $numberConverter, - CodecInterface $codec, - TimeConverterInterface $timeConverter - ) { - parent::__construct($fields, $numberConverter, $codec, $timeConverter); - } -} diff --git a/vendor/ramsey/uuid/src/Guid/GuidBuilder.php b/vendor/ramsey/uuid/src/Guid/GuidBuilder.php deleted file mode 100644 index c036bb20..00000000 --- a/vendor/ramsey/uuid/src/Guid/GuidBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Guid; - -use Ramsey\Uuid\Builder\UuidBuilderInterface; -use Ramsey\Uuid\Codec\CodecInterface; -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Exception\UnableToBuildUuidException; -use Ramsey\Uuid\UuidInterface; -use Throwable; - -/** - * GuidBuilder builds instances of Guid - * - * @see Guid - * - * @psalm-immutable - */ -class GuidBuilder implements UuidBuilderInterface -{ - /** - * @param NumberConverterInterface $numberConverter The number converter to - * use when constructing the Guid - * @param TimeConverterInterface $timeConverter The time converter to use - * for converting timestamps extracted from a UUID to Unix timestamps - */ - public function __construct( - private NumberConverterInterface $numberConverter, - private TimeConverterInterface $timeConverter - ) { - } - - /** - * Builds and returns a Guid - * - * @param CodecInterface $codec The codec to use for building this Guid instance - * @param string $bytes The byte string from which to construct a UUID - * - * @return Guid The GuidBuilder returns an instance of Ramsey\Uuid\Guid\Guid - * - * @psalm-pure - */ - public function build(CodecInterface $codec, string $bytes): UuidInterface - { - try { - return new Guid( - $this->buildFields($bytes), - $this->numberConverter, - $codec, - $this->timeConverter - ); - } catch (Throwable $e) { - throw new UnableToBuildUuidException($e->getMessage(), (int) $e->getCode(), $e); - } - } - - /** - * Proxy method to allow injecting a mock, for testing - */ - protected function buildFields(string $bytes): Fields - { - return new Fields($bytes); - } -} diff --git a/vendor/ramsey/uuid/src/Lazy/LazyUuidFromString.php b/vendor/ramsey/uuid/src/Lazy/LazyUuidFromString.php deleted file mode 100644 index c0b47bbf..00000000 --- a/vendor/ramsey/uuid/src/Lazy/LazyUuidFromString.php +++ /dev/null @@ -1,572 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Lazy; - -use DateTimeInterface; -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Exception\UnsupportedOperationException; -use Ramsey\Uuid\Fields\FieldsInterface; -use Ramsey\Uuid\Rfc4122\UuidV1; -use Ramsey\Uuid\Rfc4122\UuidV6; -use Ramsey\Uuid\Type\Hexadecimal; -use Ramsey\Uuid\Type\Integer as IntegerObject; -use Ramsey\Uuid\UuidFactory; -use Ramsey\Uuid\UuidInterface; -use ValueError; - -use function assert; -use function bin2hex; -use function hex2bin; -use function sprintf; -use function str_replace; -use function substr; - -/** - * Lazy version of a UUID: its format has not been determined yet, so it is mostly only usable for string/bytes - * conversion. This object optimizes instantiation, serialization and string conversion time, at the cost of - * increased overhead for more advanced UUID operations. - * - * @internal this type is used internally for performance reasons, and is not supposed to be directly referenced - * in consumer libraries. - * - * @psalm-immutable - * - * Note: the {@see FieldsInterface} does not declare methods that deprecated API - * relies upon: the API has been ported from the {@see \Ramsey\Uuid\Uuid} definition, - * and is deprecated anyway. - * Note: the deprecated API from {@see \Ramsey\Uuid\Uuid} is in use here (on purpose): it will be removed - * once the deprecated API is gone from this class too. - * - * @psalm-suppress UndefinedInterfaceMethod - * @psalm-suppress DeprecatedMethod - */ -final class LazyUuidFromString implements UuidInterface -{ - public const VALID_REGEX = '/\A[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\z/ms'; - - private ?UuidInterface $unwrapped = null; - - /** - * @psalm-param non-empty-string $uuid - */ - public function __construct(private string $uuid) - { - } - - /** @psalm-pure */ - public static function fromBytes(string $bytes): self - { - $base16Uuid = bin2hex($bytes); - - return new self( - substr($base16Uuid, 0, 8) - . '-' - . substr($base16Uuid, 8, 4) - . '-' - . substr($base16Uuid, 12, 4) - . '-' - . substr($base16Uuid, 16, 4) - . '-' - . substr($base16Uuid, 20, 12) - ); - } - - public function serialize(): string - { - return $this->uuid; - } - - /** - * @return array{string: string} - * - * @psalm-return array{string: non-empty-string} - */ - public function __serialize(): array - { - return ['string' => $this->uuid]; - } - - /** - * {@inheritDoc} - * - * @param string $data - * - * @psalm-param non-empty-string $data - */ - public function unserialize(string $data): void - { - $this->uuid = $data; - } - - /** - * @param array{string?: string} $data - * - * @psalm-param array{string?: non-empty-string} $data - * @psalm-suppress UnusedMethodCall - */ - public function __unserialize(array $data): void - { - // @codeCoverageIgnoreStart - if (!isset($data['string'])) { - throw new ValueError(sprintf('%s(): Argument #1 ($data) is invalid', __METHOD__)); - } - // @codeCoverageIgnoreEnd - - $this->unserialize($data['string']); - } - - /** @psalm-suppress DeprecatedMethod */ - public function getNumberConverter(): NumberConverterInterface - { - return ($this->unwrapped ?? $this->unwrap()) - ->getNumberConverter(); - } - - /** - * {@inheritDoc} - * - * @psalm-suppress DeprecatedMethod - */ - public function getFieldsHex(): array - { - return ($this->unwrapped ?? $this->unwrap()) - ->getFieldsHex(); - } - - /** @psalm-suppress DeprecatedMethod */ - public function getClockSeqHiAndReservedHex(): string - { - return ($this->unwrapped ?? $this->unwrap()) - ->getClockSeqHiAndReservedHex(); - } - - /** @psalm-suppress DeprecatedMethod */ - public function getClockSeqLowHex(): string - { - return ($this->unwrapped ?? $this->unwrap()) - ->getClockSeqLowHex(); - } - - /** @psalm-suppress DeprecatedMethod */ - public function getClockSequenceHex(): string - { - return ($this->unwrapped ?? $this->unwrap()) - ->getClockSequenceHex(); - } - - /** @psalm-suppress DeprecatedMethod */ - public function getDateTime(): DateTimeInterface - { - return ($this->unwrapped ?? $this->unwrap()) - ->getDateTime(); - } - - /** @psalm-suppress DeprecatedMethod */ - public function getLeastSignificantBitsHex(): string - { - return ($this->unwrapped ?? $this->unwrap()) - ->getLeastSignificantBitsHex(); - } - - /** @psalm-suppress DeprecatedMethod */ - public function getMostSignificantBitsHex(): string - { - return ($this->unwrapped ?? $this->unwrap()) - ->getMostSignificantBitsHex(); - } - - /** @psalm-suppress DeprecatedMethod */ - public function getNodeHex(): string - { - return ($this->unwrapped ?? $this->unwrap()) - ->getNodeHex(); - } - - /** @psalm-suppress DeprecatedMethod */ - public function getTimeHiAndVersionHex(): string - { - return ($this->unwrapped ?? $this->unwrap()) - ->getTimeHiAndVersionHex(); - } - - /** @psalm-suppress DeprecatedMethod */ - public function getTimeLowHex(): string - { - return ($this->unwrapped ?? $this->unwrap()) - ->getTimeLowHex(); - } - - /** @psalm-suppress DeprecatedMethod */ - public function getTimeMidHex(): string - { - return ($this->unwrapped ?? $this->unwrap()) - ->getTimeMidHex(); - } - - /** @psalm-suppress DeprecatedMethod */ - public function getTimestampHex(): string - { - return ($this->unwrapped ?? $this->unwrap()) - ->getTimestampHex(); - } - - /** @psalm-suppress DeprecatedMethod */ - public function getUrn(): string - { - return ($this->unwrapped ?? $this->unwrap()) - ->getUrn(); - } - - /** @psalm-suppress DeprecatedMethod */ - public function getVariant(): ?int - { - return ($this->unwrapped ?? $this->unwrap()) - ->getVariant(); - } - - /** @psalm-suppress DeprecatedMethod */ - public function getVersion(): ?int - { - return ($this->unwrapped ?? $this->unwrap()) - ->getVersion(); - } - - public function compareTo(UuidInterface $other): int - { - return ($this->unwrapped ?? $this->unwrap()) - ->compareTo($other); - } - - public function equals(?object $other): bool - { - if (! $other instanceof UuidInterface) { - return false; - } - - return $this->uuid === $other->toString(); - } - - /** - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificReturnType - * @psalm-suppress LessSpecificReturnStatement we know that {@see self::$uuid} is a non-empty string, so - * we know that {@see hex2bin} will retrieve a non-empty string too. - */ - public function getBytes(): string - { - /** @phpstan-ignore-next-line PHPStan complains that this is not a non-empty-string. */ - return (string) hex2bin(str_replace('-', '', $this->uuid)); - } - - public function getFields(): FieldsInterface - { - return ($this->unwrapped ?? $this->unwrap()) - ->getFields(); - } - - public function getHex(): Hexadecimal - { - return ($this->unwrapped ?? $this->unwrap()) - ->getHex(); - } - - public function getInteger(): IntegerObject - { - return ($this->unwrapped ?? $this->unwrap()) - ->getInteger(); - } - - public function toString(): string - { - return $this->uuid; - } - - public function __toString(): string - { - return $this->uuid; - } - - public function jsonSerialize(): string - { - return $this->uuid; - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getClockSeqHiAndReserved()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. - * - * @psalm-suppress UndefinedInterfaceMethod - * @psalm-suppress DeprecatedMethod - * @psalm-suppress MixedArgument - * @psalm-suppress MixedMethodCall - */ - public function getClockSeqHiAndReserved(): string - { - $instance = ($this->unwrapped ?? $this->unwrap()); - - return $instance->getNumberConverter() - ->fromHex( - $instance->getFields() - ->getClockSeqHiAndReserved() - ->toString() - ); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getClockSeqLow()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. - * - * @psalm-suppress UndefinedInterfaceMethod - * @psalm-suppress DeprecatedMethod - * @psalm-suppress MixedArgument - * @psalm-suppress MixedMethodCall - */ - public function getClockSeqLow(): string - { - $instance = ($this->unwrapped ?? $this->unwrap()); - - return $instance->getNumberConverter() - ->fromHex( - $instance->getFields() - ->getClockSeqLow() - ->toString() - ); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getClockSeq()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. - * - * @psalm-suppress UndefinedInterfaceMethod - * @psalm-suppress DeprecatedMethod - * @psalm-suppress MixedArgument - * @psalm-suppress MixedMethodCall - */ - public function getClockSequence(): string - { - $instance = ($this->unwrapped ?? $this->unwrap()); - - return $instance->getNumberConverter() - ->fromHex( - $instance->getFields() - ->getClockSeq() - ->toString() - ); - } - - /** - * @deprecated This method will be removed in 5.0.0. There is no direct - * alternative, but the same information may be obtained by splitting - * in half the value returned by {@see UuidInterface::getHex()}. - * - * @psalm-suppress UndefinedInterfaceMethod - * @psalm-suppress DeprecatedMethod - * @psalm-suppress MixedArgument - * @psalm-suppress MixedMethodCall - */ - public function getLeastSignificantBits(): string - { - $instance = ($this->unwrapped ?? $this->unwrap()); - - return $instance->getNumberConverter() - ->fromHex(substr($instance->getHex()->toString(), 16)); - } - - /** - * @deprecated This method will be removed in 5.0.0. There is no direct - * alternative, but the same information may be obtained by splitting - * in half the value returned by {@see UuidInterface::getHex()}. - * - * @psalm-suppress UndefinedInterfaceMethod - * @psalm-suppress DeprecatedMethod - * @psalm-suppress MixedArgument - * @psalm-suppress MixedMethodCall - */ - public function getMostSignificantBits(): string - { - $instance = ($this->unwrapped ?? $this->unwrap()); - - return $instance->getNumberConverter() - ->fromHex(substr($instance->getHex()->toString(), 0, 16)); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getNode()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. - * - * @psalm-suppress UndefinedInterfaceMethod - * @psalm-suppress DeprecatedMethod - * @psalm-suppress MixedArgument - * @psalm-suppress MixedMethodCall - */ - public function getNode(): string - { - $instance = ($this->unwrapped ?? $this->unwrap()); - - return $instance->getNumberConverter() - ->fromHex( - $instance->getFields() - ->getNode() - ->toString() - ); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getTimeHiAndVersion()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. - * - * @psalm-suppress UndefinedInterfaceMethod - * @psalm-suppress DeprecatedMethod - * @psalm-suppress MixedArgument - * @psalm-suppress MixedMethodCall - */ - public function getTimeHiAndVersion(): string - { - $instance = ($this->unwrapped ?? $this->unwrap()); - - return $instance->getNumberConverter() - ->fromHex( - $instance->getFields() - ->getTimeHiAndVersion() - ->toString() - ); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getTimeLow()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. - * - * @psalm-suppress UndefinedInterfaceMethod - * @psalm-suppress DeprecatedMethod - * @psalm-suppress MixedArgument - * @psalm-suppress MixedMethodCall - */ - public function getTimeLow(): string - { - $instance = ($this->unwrapped ?? $this->unwrap()); - - return $instance->getNumberConverter() - ->fromHex( - $instance->getFields() - ->getTimeLow() - ->toString() - ); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getTimeMid()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. - * - * @psalm-suppress UndefinedInterfaceMethod - * @psalm-suppress DeprecatedMethod - * @psalm-suppress MixedArgument - * @psalm-suppress MixedMethodCall - */ - public function getTimeMid(): string - { - $instance = ($this->unwrapped ?? $this->unwrap()); - - return $instance->getNumberConverter() - ->fromHex( - $instance->getFields() - ->getTimeMid() - ->toString() - ); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getTimestamp()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. - * - * @psalm-suppress UndefinedInterfaceMethod - * @psalm-suppress DeprecatedMethod - * @psalm-suppress MixedArgument - * @psalm-suppress MixedMethodCall - */ - public function getTimestamp(): string - { - $instance = ($this->unwrapped ?? $this->unwrap()); - $fields = $instance->getFields(); - - if ($fields->getVersion() !== 1) { - throw new UnsupportedOperationException('Not a time-based UUID'); - } - - return $instance->getNumberConverter() - ->fromHex($fields->getTimestamp()->toString()); - } - - public function toUuidV1(): UuidV1 - { - $instance = ($this->unwrapped ?? $this->unwrap()); - - if ($instance instanceof UuidV1) { - return $instance; - } - - assert($instance instanceof UuidV6); - - return $instance->toUuidV1(); - } - - public function toUuidV6(): UuidV6 - { - $instance = ($this->unwrapped ?? $this->unwrap()); - - assert($instance instanceof UuidV6); - - return $instance; - } - - /** - * @psalm-suppress ImpureMethodCall the retrieval of the factory is a clear violation of purity here: this is a - * known pitfall of the design of this library, where a value object contains - * a mutable reference to a factory. We use a fixed factory here, so the violation - * will not have real-world effects, as this object is only instantiated with the - * default factory settings/features. - * @psalm-suppress InaccessibleProperty property {@see $unwrapped} is used as a cache: we don't expose it to the - * outside world, so we should be fine here. - */ - private function unwrap(): UuidInterface - { - return $this->unwrapped = (new UuidFactory()) - ->fromString($this->uuid); - } -} diff --git a/vendor/ramsey/uuid/src/Math/BrickMathCalculator.php b/vendor/ramsey/uuid/src/Math/BrickMathCalculator.php deleted file mode 100644 index f2d86788..00000000 --- a/vendor/ramsey/uuid/src/Math/BrickMathCalculator.php +++ /dev/null @@ -1,144 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Math; - -use Brick\Math\BigDecimal; -use Brick\Math\BigInteger; -use Brick\Math\Exception\MathException; -use Brick\Math\RoundingMode as BrickMathRounding; -use Ramsey\Uuid\Exception\InvalidArgumentException; -use Ramsey\Uuid\Type\Decimal; -use Ramsey\Uuid\Type\Hexadecimal; -use Ramsey\Uuid\Type\Integer as IntegerObject; -use Ramsey\Uuid\Type\NumberInterface; - -/** - * A calculator using the brick/math library for arbitrary-precision arithmetic - * - * @psalm-immutable - */ -final class BrickMathCalculator implements CalculatorInterface -{ - private const ROUNDING_MODE_MAP = [ - RoundingMode::UNNECESSARY => BrickMathRounding::UNNECESSARY, - RoundingMode::UP => BrickMathRounding::UP, - RoundingMode::DOWN => BrickMathRounding::DOWN, - RoundingMode::CEILING => BrickMathRounding::CEILING, - RoundingMode::FLOOR => BrickMathRounding::FLOOR, - RoundingMode::HALF_UP => BrickMathRounding::HALF_UP, - RoundingMode::HALF_DOWN => BrickMathRounding::HALF_DOWN, - RoundingMode::HALF_CEILING => BrickMathRounding::HALF_CEILING, - RoundingMode::HALF_FLOOR => BrickMathRounding::HALF_FLOOR, - RoundingMode::HALF_EVEN => BrickMathRounding::HALF_EVEN, - ]; - - public function add(NumberInterface $augend, NumberInterface ...$addends): NumberInterface - { - $sum = BigInteger::of($augend->toString()); - - foreach ($addends as $addend) { - $sum = $sum->plus($addend->toString()); - } - - return new IntegerObject((string) $sum); - } - - public function subtract(NumberInterface $minuend, NumberInterface ...$subtrahends): NumberInterface - { - $difference = BigInteger::of($minuend->toString()); - - foreach ($subtrahends as $subtrahend) { - $difference = $difference->minus($subtrahend->toString()); - } - - return new IntegerObject((string) $difference); - } - - public function multiply(NumberInterface $multiplicand, NumberInterface ...$multipliers): NumberInterface - { - $product = BigInteger::of($multiplicand->toString()); - - foreach ($multipliers as $multiplier) { - $product = $product->multipliedBy($multiplier->toString()); - } - - return new IntegerObject((string) $product); - } - - public function divide( - int $roundingMode, - int $scale, - NumberInterface $dividend, - NumberInterface ...$divisors - ): NumberInterface { - $brickRounding = $this->getBrickRoundingMode($roundingMode); - - $quotient = BigDecimal::of($dividend->toString()); - - foreach ($divisors as $divisor) { - $quotient = $quotient->dividedBy($divisor->toString(), $scale, $brickRounding); - } - - if ($scale === 0) { - return new IntegerObject((string) $quotient->toBigInteger()); - } - - return new Decimal((string) $quotient); - } - - public function fromBase(string $value, int $base): IntegerObject - { - try { - return new IntegerObject((string) BigInteger::fromBase($value, $base)); - } catch (MathException | \InvalidArgumentException $exception) { - throw new InvalidArgumentException( - $exception->getMessage(), - (int) $exception->getCode(), - $exception - ); - } - } - - public function toBase(IntegerObject $value, int $base): string - { - try { - return BigInteger::of($value->toString())->toBase($base); - } catch (MathException | \InvalidArgumentException $exception) { - throw new InvalidArgumentException( - $exception->getMessage(), - (int) $exception->getCode(), - $exception - ); - } - } - - public function toHexadecimal(IntegerObject $value): Hexadecimal - { - return new Hexadecimal($this->toBase($value, 16)); - } - - public function toInteger(Hexadecimal $value): IntegerObject - { - return $this->fromBase($value->toString(), 16); - } - - /** - * Maps ramsey/uuid rounding modes to those used by brick/math - */ - private function getBrickRoundingMode(int $roundingMode): int - { - return self::ROUNDING_MODE_MAP[$roundingMode] ?? 0; - } -} diff --git a/vendor/ramsey/uuid/src/Math/CalculatorInterface.php b/vendor/ramsey/uuid/src/Math/CalculatorInterface.php deleted file mode 100644 index f03645d0..00000000 --- a/vendor/ramsey/uuid/src/Math/CalculatorInterface.php +++ /dev/null @@ -1,106 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Math; - -use Ramsey\Uuid\Type\Hexadecimal; -use Ramsey\Uuid\Type\Integer as IntegerObject; -use Ramsey\Uuid\Type\NumberInterface; - -/** - * A calculator performs arithmetic operations on numbers - * - * @psalm-immutable - */ -interface CalculatorInterface -{ - /** - * Returns the sum of all the provided parameters - * - * @param NumberInterface $augend The first addend (the integer being added to) - * @param NumberInterface ...$addends The additional integers to a add to the augend - * - * @return NumberInterface The sum of all the parameters - */ - public function add(NumberInterface $augend, NumberInterface ...$addends): NumberInterface; - - /** - * Returns the difference of all the provided parameters - * - * @param NumberInterface $minuend The integer being subtracted from - * @param NumberInterface ...$subtrahends The integers to subtract from the minuend - * - * @return NumberInterface The difference after subtracting all parameters - */ - public function subtract(NumberInterface $minuend, NumberInterface ...$subtrahends): NumberInterface; - - /** - * Returns the product of all the provided parameters - * - * @param NumberInterface $multiplicand The integer to be multiplied - * @param NumberInterface ...$multipliers The factors by which to multiply the multiplicand - * - * @return NumberInterface The product of multiplying all the provided parameters - */ - public function multiply(NumberInterface $multiplicand, NumberInterface ...$multipliers): NumberInterface; - - /** - * Returns the quotient of the provided parameters divided left-to-right - * - * @param int $roundingMode The RoundingMode constant to use for this operation - * @param int $scale The scale to use for this operation - * @param NumberInterface $dividend The integer to be divided - * @param NumberInterface ...$divisors The integers to divide $dividend by, in - * the order in which the division operations should take place - * (left-to-right) - * - * @return NumberInterface The quotient of dividing the provided parameters left-to-right - */ - public function divide( - int $roundingMode, - int $scale, - NumberInterface $dividend, - NumberInterface ...$divisors - ): NumberInterface; - - /** - * Converts a value from an arbitrary base to a base-10 integer value - * - * @param string $value The value to convert - * @param int $base The base to convert from (i.e., 2, 16, 32, etc.) - * - * @return IntegerObject The base-10 integer value of the converted value - */ - public function fromBase(string $value, int $base): IntegerObject; - - /** - * Converts a base-10 integer value to an arbitrary base - * - * @param IntegerObject $value The integer value to convert - * @param int $base The base to convert to (i.e., 2, 16, 32, etc.) - * - * @return string The value represented in the specified base - */ - public function toBase(IntegerObject $value, int $base): string; - - /** - * Converts an Integer instance to a Hexadecimal instance - */ - public function toHexadecimal(IntegerObject $value): Hexadecimal; - - /** - * Converts a Hexadecimal instance to an Integer instance - */ - public function toInteger(Hexadecimal $value): IntegerObject; -} diff --git a/vendor/ramsey/uuid/src/Math/RoundingMode.php b/vendor/ramsey/uuid/src/Math/RoundingMode.php deleted file mode 100644 index e710270d..00000000 --- a/vendor/ramsey/uuid/src/Math/RoundingMode.php +++ /dev/null @@ -1,146 +0,0 @@ -= 0.5; otherwise, behaves - * as for DOWN. Note that this is the rounding mode commonly taught at - * school. - */ - public const HALF_UP = 5; - - /** - * Rounds towards "nearest neighbor" unless both neighbors are equidistant, - * in which case round down. - * - * Behaves as for UP if the discarded fraction is > 0.5; otherwise, behaves - * as for DOWN. - */ - public const HALF_DOWN = 6; - - /** - * Rounds towards "nearest neighbor" unless both neighbors are equidistant, - * in which case round towards positive infinity. - * - * If the result is positive, behaves as for HALF_UP; if negative, behaves - * as for HALF_DOWN. - */ - public const HALF_CEILING = 7; - - /** - * Rounds towards "nearest neighbor" unless both neighbors are equidistant, - * in which case round towards negative infinity. - * - * If the result is positive, behaves as for HALF_DOWN; if negative, behaves - * as for HALF_UP. - */ - public const HALF_FLOOR = 8; - - /** - * Rounds towards the "nearest neighbor" unless both neighbors are - * equidistant, in which case rounds towards the even neighbor. - * - * Behaves as for HALF_UP if the digit to the left of the discarded fraction - * is odd; behaves as for HALF_DOWN if it's even. - * - * Note that this is the rounding mode that statistically minimizes - * cumulative error when applied repeatedly over a sequence of calculations. - * It is sometimes known as "Banker's rounding", and is chiefly used in the - * USA. - */ - public const HALF_EVEN = 9; -} diff --git a/vendor/ramsey/uuid/src/Nonstandard/Fields.php b/vendor/ramsey/uuid/src/Nonstandard/Fields.php deleted file mode 100644 index 5dfe6107..00000000 --- a/vendor/ramsey/uuid/src/Nonstandard/Fields.php +++ /dev/null @@ -1,131 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Nonstandard; - -use Ramsey\Uuid\Exception\InvalidArgumentException; -use Ramsey\Uuid\Fields\SerializableFieldsTrait; -use Ramsey\Uuid\Rfc4122\FieldsInterface; -use Ramsey\Uuid\Rfc4122\VariantTrait; -use Ramsey\Uuid\Type\Hexadecimal; - -use function bin2hex; -use function dechex; -use function hexdec; -use function sprintf; -use function str_pad; -use function strlen; -use function substr; - -use const STR_PAD_LEFT; - -/** - * Nonstandard UUID fields do not conform to the RFC 4122 standard - * - * Since some systems may create nonstandard UUIDs, this implements the - * Rfc4122\FieldsInterface, so that functionality of a nonstandard UUID is not - * degraded, in the event these UUIDs are expected to contain RFC 4122 fields. - * - * Internally, this class represents the fields together as a 16-byte binary - * string. - * - * @psalm-immutable - */ -final class Fields implements FieldsInterface -{ - use SerializableFieldsTrait; - use VariantTrait; - - /** - * @param string $bytes A 16-byte binary string representation of a UUID - * - * @throws InvalidArgumentException if the byte string is not exactly 16 bytes - */ - public function __construct(private string $bytes) - { - if (strlen($this->bytes) !== 16) { - throw new InvalidArgumentException( - 'The byte string must be 16 bytes long; ' - . 'received ' . strlen($this->bytes) . ' bytes' - ); - } - } - - public function getBytes(): string - { - return $this->bytes; - } - - public function getClockSeq(): Hexadecimal - { - $clockSeq = hexdec(bin2hex(substr($this->bytes, 8, 2))) & 0x3fff; - - return new Hexadecimal(str_pad(dechex($clockSeq), 4, '0', STR_PAD_LEFT)); - } - - public function getClockSeqHiAndReserved(): Hexadecimal - { - return new Hexadecimal(bin2hex(substr($this->bytes, 8, 1))); - } - - public function getClockSeqLow(): Hexadecimal - { - return new Hexadecimal(bin2hex(substr($this->bytes, 9, 1))); - } - - public function getNode(): Hexadecimal - { - return new Hexadecimal(bin2hex(substr($this->bytes, 10))); - } - - public function getTimeHiAndVersion(): Hexadecimal - { - return new Hexadecimal(bin2hex(substr($this->bytes, 6, 2))); - } - - public function getTimeLow(): Hexadecimal - { - return new Hexadecimal(bin2hex(substr($this->bytes, 0, 4))); - } - - public function getTimeMid(): Hexadecimal - { - return new Hexadecimal(bin2hex(substr($this->bytes, 4, 2))); - } - - public function getTimestamp(): Hexadecimal - { - return new Hexadecimal(sprintf( - '%03x%04s%08s', - hexdec($this->getTimeHiAndVersion()->toString()) & 0x0fff, - $this->getTimeMid()->toString(), - $this->getTimeLow()->toString() - )); - } - - public function getVersion(): ?int - { - return null; - } - - public function isNil(): bool - { - return false; - } - - public function isMax(): bool - { - return false; - } -} diff --git a/vendor/ramsey/uuid/src/Nonstandard/Uuid.php b/vendor/ramsey/uuid/src/Nonstandard/Uuid.php deleted file mode 100644 index 715f8255..00000000 --- a/vendor/ramsey/uuid/src/Nonstandard/Uuid.php +++ /dev/null @@ -1,37 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Nonstandard; - -use Ramsey\Uuid\Codec\CodecInterface; -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Uuid as BaseUuid; - -/** - * Nonstandard\Uuid is a UUID that doesn't conform to RFC 4122 - * - * @psalm-immutable - */ -final class Uuid extends BaseUuid -{ - public function __construct( - Fields $fields, - NumberConverterInterface $numberConverter, - CodecInterface $codec, - TimeConverterInterface $timeConverter - ) { - parent::__construct($fields, $numberConverter, $codec, $timeConverter); - } -} diff --git a/vendor/ramsey/uuid/src/Nonstandard/UuidBuilder.php b/vendor/ramsey/uuid/src/Nonstandard/UuidBuilder.php deleted file mode 100644 index 82efd402..00000000 --- a/vendor/ramsey/uuid/src/Nonstandard/UuidBuilder.php +++ /dev/null @@ -1,76 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Nonstandard; - -use Ramsey\Uuid\Builder\UuidBuilderInterface; -use Ramsey\Uuid\Codec\CodecInterface; -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Exception\UnableToBuildUuidException; -use Ramsey\Uuid\UuidInterface; -use Throwable; - -/** - * Nonstandard\UuidBuilder builds instances of Nonstandard\Uuid - * - * @psalm-immutable - */ -class UuidBuilder implements UuidBuilderInterface -{ - /** - * @param NumberConverterInterface $numberConverter The number converter to - * use when constructing the Nonstandard\Uuid - * @param TimeConverterInterface $timeConverter The time converter to use - * for converting timestamps extracted from a UUID to Unix timestamps - */ - public function __construct( - private NumberConverterInterface $numberConverter, - private TimeConverterInterface $timeConverter - ) { - } - - /** - * Builds and returns a Nonstandard\Uuid - * - * @param CodecInterface $codec The codec to use for building this instance - * @param string $bytes The byte string from which to construct a UUID - * - * @return Uuid The Nonstandard\UuidBuilder returns an instance of - * Nonstandard\Uuid - * - * @psalm-pure - */ - public function build(CodecInterface $codec, string $bytes): UuidInterface - { - try { - return new Uuid( - $this->buildFields($bytes), - $this->numberConverter, - $codec, - $this->timeConverter - ); - } catch (Throwable $e) { - throw new UnableToBuildUuidException($e->getMessage(), (int) $e->getCode(), $e); - } - } - - /** - * Proxy method to allow injecting a mock, for testing - */ - protected function buildFields(string $bytes): Fields - { - return new Fields($bytes); - } -} diff --git a/vendor/ramsey/uuid/src/Nonstandard/UuidV6.php b/vendor/ramsey/uuid/src/Nonstandard/UuidV6.php deleted file mode 100644 index 1a7bbaf7..00000000 --- a/vendor/ramsey/uuid/src/Nonstandard/UuidV6.php +++ /dev/null @@ -1,105 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Nonstandard; - -use Ramsey\Uuid\Codec\CodecInterface; -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Exception\InvalidArgumentException; -use Ramsey\Uuid\Lazy\LazyUuidFromString; -use Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface; -use Ramsey\Uuid\Rfc4122\TimeTrait; -use Ramsey\Uuid\Rfc4122\UuidInterface; -use Ramsey\Uuid\Rfc4122\UuidV1; -use Ramsey\Uuid\Uuid; - -/** - * Reordered time, or version 6, UUIDs include timestamp, clock sequence, and - * node values that are combined into a 128-bit unsigned integer - * - * @deprecated Use {@see \Ramsey\Uuid\Rfc4122\UuidV6} instead. - * - * @link https://github.com/uuid6/uuid6-ietf-draft UUID version 6 IETF draft - * @link http://gh.peabody.io/uuidv6/ "Version 6" UUIDs - * - * @psalm-immutable - */ -class UuidV6 extends Uuid implements UuidInterface -{ - use TimeTrait; - - /** - * Creates a version 6 (reordered time) UUID - * - * @param Rfc4122FieldsInterface $fields The fields from which to construct a UUID - * @param NumberConverterInterface $numberConverter The number converter to use - * for converting hex values to/from integers - * @param CodecInterface $codec The codec to use when encoding or decoding - * UUID strings - * @param TimeConverterInterface $timeConverter The time converter to use - * for converting timestamps extracted from a UUID to unix timestamps - */ - public function __construct( - Rfc4122FieldsInterface $fields, - NumberConverterInterface $numberConverter, - CodecInterface $codec, - TimeConverterInterface $timeConverter - ) { - if ($fields->getVersion() !== Uuid::UUID_TYPE_REORDERED_TIME) { - throw new InvalidArgumentException( - 'Fields used to create a UuidV6 must represent a ' - . 'version 6 (reordered time) UUID' - ); - } - - parent::__construct($fields, $numberConverter, $codec, $timeConverter); - } - - /** - * Converts this UUID into an instance of a version 1 UUID - */ - public function toUuidV1(): UuidV1 - { - $hex = $this->getHex()->toString(); - $hex = substr($hex, 7, 5) - . substr($hex, 13, 3) - . substr($hex, 3, 4) - . '1' . substr($hex, 0, 3) - . substr($hex, 16); - - /** @var LazyUuidFromString $uuid */ - $uuid = Uuid::fromBytes((string) hex2bin($hex)); - - return $uuid->toUuidV1(); - } - - /** - * Converts a version 1 UUID into an instance of a version 6 UUID - */ - public static function fromUuidV1(UuidV1 $uuidV1): \Ramsey\Uuid\Rfc4122\UuidV6 - { - $hex = $uuidV1->getHex()->toString(); - $hex = substr($hex, 13, 3) - . substr($hex, 8, 4) - . substr($hex, 0, 5) - . '6' . substr($hex, 5, 3) - . substr($hex, 16); - - /** @var LazyUuidFromString $uuid */ - $uuid = Uuid::fromBytes((string) hex2bin($hex)); - - return $uuid->toUuidV6(); - } -} diff --git a/vendor/ramsey/uuid/src/Provider/Dce/SystemDceSecurityProvider.php b/vendor/ramsey/uuid/src/Provider/Dce/SystemDceSecurityProvider.php deleted file mode 100644 index d5b6cf0c..00000000 --- a/vendor/ramsey/uuid/src/Provider/Dce/SystemDceSecurityProvider.php +++ /dev/null @@ -1,231 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Provider\Dce; - -use Ramsey\Uuid\Exception\DceSecurityException; -use Ramsey\Uuid\Provider\DceSecurityProviderInterface; -use Ramsey\Uuid\Type\Integer as IntegerObject; - -use function escapeshellarg; -use function preg_split; -use function str_getcsv; -use function strrpos; -use function strtolower; -use function strtoupper; -use function substr; -use function trim; - -use const PREG_SPLIT_NO_EMPTY; - -/** - * SystemDceSecurityProvider retrieves the user or group identifiers from the system - */ -class SystemDceSecurityProvider implements DceSecurityProviderInterface -{ - /** - * @throws DceSecurityException if unable to get a user identifier - * - * @inheritDoc - */ - public function getUid(): IntegerObject - { - /** @var int|float|string|IntegerObject|null $uid */ - static $uid = null; - - if ($uid instanceof IntegerObject) { - return $uid; - } - - if ($uid === null) { - $uid = $this->getSystemUid(); - } - - if ($uid === '') { - throw new DceSecurityException( - 'Unable to get a user identifier using the system DCE ' - . 'Security provider; please provide a custom identifier or ' - . 'use a different provider' - ); - } - - $uid = new IntegerObject($uid); - - return $uid; - } - - /** - * @throws DceSecurityException if unable to get a group identifier - * - * @inheritDoc - */ - public function getGid(): IntegerObject - { - /** @var int|float|string|IntegerObject|null $gid */ - static $gid = null; - - if ($gid instanceof IntegerObject) { - return $gid; - } - - if ($gid === null) { - $gid = $this->getSystemGid(); - } - - if ($gid === '') { - throw new DceSecurityException( - 'Unable to get a group identifier using the system DCE ' - . 'Security provider; please provide a custom identifier or ' - . 'use a different provider' - ); - } - - $gid = new IntegerObject($gid); - - return $gid; - } - - /** - * Returns the UID from the system - */ - private function getSystemUid(): string - { - if (!$this->hasShellExec()) { - return ''; - } - - return match ($this->getOs()) { - 'WIN' => $this->getWindowsUid(), - default => trim((string) shell_exec('id -u')), - }; - } - - /** - * Returns the GID from the system - */ - private function getSystemGid(): string - { - if (!$this->hasShellExec()) { - return ''; - } - - return match ($this->getOs()) { - 'WIN' => $this->getWindowsGid(), - default => trim((string) shell_exec('id -g')), - }; - } - - /** - * Returns true if shell_exec() is available for use - */ - private function hasShellExec(): bool - { - $disabledFunctions = strtolower((string) ini_get('disable_functions')); - - return !str_contains($disabledFunctions, 'shell_exec'); - } - - /** - * Returns the PHP_OS string - */ - private function getOs(): string - { - /** - * @psalm-suppress UnnecessaryVarAnnotation - * @var string $phpOs - */ - $phpOs = constant('PHP_OS'); - - return strtoupper(substr($phpOs, 0, 3)); - } - - /** - * Returns the user identifier for a user on a Windows system - * - * Windows does not have the same concept as an effective POSIX UID for the - * running script. Instead, each user is uniquely identified by an SID - * (security identifier). The SID includes three 32-bit unsigned integers - * that make up a unique domain identifier, followed by an RID (relative - * identifier) that we will use as the UID. The primary caveat is that this - * UID may not be unique to the system, since it is, instead, unique to the - * domain. - * - * @link https://www.lifewire.com/what-is-an-sid-number-2626005 What Is an SID Number? - * @link https://bit.ly/30vE7NM Well-known SID Structures - * @link https://bit.ly/2FWcYKJ Well-known security identifiers in Windows operating systems - * @link https://www.windows-commandline.com/get-sid-of-user/ Get SID of user - */ - private function getWindowsUid(): string - { - $response = shell_exec('whoami /user /fo csv /nh'); - - if ($response === null) { - return ''; - } - - $sid = str_getcsv(trim((string) $response))[1] ?? ''; - - if (($lastHyphen = strrpos($sid, '-')) === false) { - return ''; - } - - return trim(substr($sid, $lastHyphen + 1)); - } - - /** - * Returns a group identifier for a user on a Windows system - * - * Since Windows does not have the same concept as an effective POSIX GID - * for the running script, we will get the local group memberships for the - * user running the script. Then, we will get the SID (security identifier) - * for the first group that appears in that list. Finally, we will return - * the RID (relative identifier) for the group and use that as the GID. - * - * @link https://www.windows-commandline.com/list-of-user-groups-command-line/ List of user groups command line - */ - private function getWindowsGid(): string - { - $response = shell_exec('net user %username% | findstr /b /i "Local Group Memberships"'); - - if ($response === null) { - return ''; - } - - /** @var string[] $userGroups */ - $userGroups = preg_split('/\s{2,}/', (string) $response, -1, PREG_SPLIT_NO_EMPTY); - - $firstGroup = trim($userGroups[1] ?? '', "* \t\n\r\0\x0B"); - - if ($firstGroup === '') { - return ''; - } - - $response = shell_exec('wmic group get name,sid | findstr /b /i ' . escapeshellarg($firstGroup)); - - if ($response === null) { - return ''; - } - - /** @var string[] $userGroup */ - $userGroup = preg_split('/\s{2,}/', (string) $response, -1, PREG_SPLIT_NO_EMPTY); - - $sid = $userGroup[1] ?? ''; - - if (($lastHyphen = strrpos($sid, '-')) === false) { - return ''; - } - - return trim(substr($sid, $lastHyphen + 1)); - } -} diff --git a/vendor/ramsey/uuid/src/Provider/DceSecurityProviderInterface.php b/vendor/ramsey/uuid/src/Provider/DceSecurityProviderInterface.php deleted file mode 100644 index 8325da69..00000000 --- a/vendor/ramsey/uuid/src/Provider/DceSecurityProviderInterface.php +++ /dev/null @@ -1,41 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Provider; - -use Ramsey\Uuid\Rfc4122\UuidV2; -use Ramsey\Uuid\Type\Integer as IntegerObject; - -/** - * A DCE provider provides access to local domain identifiers for version 2, - * DCE Security, UUIDs - * - * @see UuidV2 - */ -interface DceSecurityProviderInterface -{ - /** - * Returns a user identifier for the system - * - * @link https://en.wikipedia.org/wiki/User_identifier User identifier - */ - public function getUid(): IntegerObject; - - /** - * Returns a group identifier for the system - * - * @link https://en.wikipedia.org/wiki/Group_identifier Group identifier - */ - public function getGid(): IntegerObject; -} diff --git a/vendor/ramsey/uuid/src/Provider/Node/FallbackNodeProvider.php b/vendor/ramsey/uuid/src/Provider/Node/FallbackNodeProvider.php deleted file mode 100644 index d2eb20b7..00000000 --- a/vendor/ramsey/uuid/src/Provider/Node/FallbackNodeProvider.php +++ /dev/null @@ -1,54 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Provider\Node; - -use Ramsey\Uuid\Exception\NodeException; -use Ramsey\Uuid\Provider\NodeProviderInterface; -use Ramsey\Uuid\Type\Hexadecimal; - -/** - * FallbackNodeProvider retrieves the system node ID by stepping through a list - * of providers until a node ID can be obtained - */ -class FallbackNodeProvider implements NodeProviderInterface -{ - /** - * @param iterable $providers Array of node providers - */ - public function __construct(private iterable $providers) - { - } - - public function getNode(): Hexadecimal - { - $lastProviderException = null; - - foreach ($this->providers as $provider) { - try { - return $provider->getNode(); - } catch (NodeException $exception) { - $lastProviderException = $exception; - - continue; - } - } - - throw new NodeException( - 'Unable to find a suitable node provider', - 0, - $lastProviderException - ); - } -} diff --git a/vendor/ramsey/uuid/src/Provider/Node/NodeProviderCollection.php b/vendor/ramsey/uuid/src/Provider/Node/NodeProviderCollection.php deleted file mode 100644 index 1b979fae..00000000 --- a/vendor/ramsey/uuid/src/Provider/Node/NodeProviderCollection.php +++ /dev/null @@ -1,66 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Provider\Node; - -use Ramsey\Collection\AbstractCollection; -use Ramsey\Uuid\Provider\NodeProviderInterface; -use Ramsey\Uuid\Type\Hexadecimal; - -/** - * A collection of NodeProviderInterface objects - * - * @deprecated this class has been deprecated, and will be removed in 5.0.0. The use-case for this class comes from - * a pre-`phpstan/phpstan` and pre-`vimeo/psalm` ecosystem, in which type safety had to be mostly enforced - * at runtime: that is no longer necessary, now that you can safely verify your code to be correct, and use - * more generic types like `iterable` instead. - * - * @extends AbstractCollection - */ -class NodeProviderCollection extends AbstractCollection -{ - public function getType(): string - { - return NodeProviderInterface::class; - } - - /** - * Re-constructs the object from its serialized form - * - * @param string $serialized The serialized PHP string to unserialize into - * a UuidInterface instance - * - * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - * @psalm-suppress RedundantConditionGivenDocblockType - */ - public function unserialize($serialized): void - { - /** @var array $data */ - $data = unserialize($serialized, [ - 'allowed_classes' => [ - Hexadecimal::class, - RandomNodeProvider::class, - StaticNodeProvider::class, - SystemNodeProvider::class, - ], - ]); - - $this->data = array_filter( - $data, - function ($unserialized): bool { - return $unserialized instanceof NodeProviderInterface; - } - ); - } -} diff --git a/vendor/ramsey/uuid/src/Provider/Node/RandomNodeProvider.php b/vendor/ramsey/uuid/src/Provider/Node/RandomNodeProvider.php deleted file mode 100644 index 76141361..00000000 --- a/vendor/ramsey/uuid/src/Provider/Node/RandomNodeProvider.php +++ /dev/null @@ -1,69 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Provider\Node; - -use Ramsey\Uuid\Exception\RandomSourceException; -use Ramsey\Uuid\Provider\NodeProviderInterface; -use Ramsey\Uuid\Type\Hexadecimal; -use Throwable; - -use function bin2hex; -use function dechex; -use function hex2bin; -use function hexdec; -use function str_pad; -use function substr; - -use const STR_PAD_LEFT; - -/** - * RandomNodeProvider generates a random node ID - * - * @link http://tools.ietf.org/html/rfc4122#section-4.5 RFC 4122, § 4.5: Node IDs that Do Not Identify the Host - */ -class RandomNodeProvider implements NodeProviderInterface -{ - public function getNode(): Hexadecimal - { - try { - $nodeBytes = random_bytes(6); - } catch (Throwable $exception) { - throw new RandomSourceException( - $exception->getMessage(), - (int) $exception->getCode(), - $exception - ); - } - - // Split the node bytes for math on 32-bit systems. - $nodeMsb = substr($nodeBytes, 0, 3); - $nodeLsb = substr($nodeBytes, 3); - - // Set the multicast bit; see RFC 4122, section 4.5. - $nodeMsb = hex2bin( - str_pad( - dechex(hexdec(bin2hex($nodeMsb)) | 0x010000), - 6, - '0', - STR_PAD_LEFT - ) - ); - - // Recombine the node bytes. - $node = $nodeMsb . $nodeLsb; - - return new Hexadecimal(str_pad(bin2hex($node), 12, '0', STR_PAD_LEFT)); - } -} diff --git a/vendor/ramsey/uuid/src/Provider/Node/StaticNodeProvider.php b/vendor/ramsey/uuid/src/Provider/Node/StaticNodeProvider.php deleted file mode 100644 index 0f7536a8..00000000 --- a/vendor/ramsey/uuid/src/Provider/Node/StaticNodeProvider.php +++ /dev/null @@ -1,73 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Provider\Node; - -use Ramsey\Uuid\Exception\InvalidArgumentException; -use Ramsey\Uuid\Provider\NodeProviderInterface; -use Ramsey\Uuid\Type\Hexadecimal; - -use function dechex; -use function hexdec; -use function str_pad; -use function substr; - -use const STR_PAD_LEFT; - -/** - * StaticNodeProvider provides a static node value with the multicast bit set - * - * @link http://tools.ietf.org/html/rfc4122#section-4.5 RFC 4122, § 4.5: Node IDs that Do Not Identify the Host - */ -class StaticNodeProvider implements NodeProviderInterface -{ - private Hexadecimal $node; - - /** - * @param Hexadecimal $node The static node value to use - */ - public function __construct(Hexadecimal $node) - { - if (strlen($node->toString()) > 12) { - throw new InvalidArgumentException( - 'Static node value cannot be greater than 12 hexadecimal characters' - ); - } - - $this->node = $this->setMulticastBit($node); - } - - public function getNode(): Hexadecimal - { - return $this->node; - } - - /** - * Set the multicast bit for the static node value - */ - private function setMulticastBit(Hexadecimal $node): Hexadecimal - { - $nodeHex = str_pad($node->toString(), 12, '0', STR_PAD_LEFT); - $firstOctet = substr($nodeHex, 0, 2); - - $firstOctet = str_pad( - dechex(hexdec($firstOctet) | 0x01), - 2, - '0', - STR_PAD_LEFT - ); - - return new Hexadecimal($firstOctet . substr($nodeHex, 2)); - } -} diff --git a/vendor/ramsey/uuid/src/Provider/Node/SystemNodeProvider.php b/vendor/ramsey/uuid/src/Provider/Node/SystemNodeProvider.php deleted file mode 100644 index a03c93b4..00000000 --- a/vendor/ramsey/uuid/src/Provider/Node/SystemNodeProvider.php +++ /dev/null @@ -1,193 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Provider\Node; - -use Ramsey\Uuid\Exception\NodeException; -use Ramsey\Uuid\Provider\NodeProviderInterface; -use Ramsey\Uuid\Type\Hexadecimal; - -use function array_filter; -use function array_map; -use function array_walk; -use function count; -use function ob_get_clean; -use function ob_start; -use function preg_match; -use function preg_match_all; -use function reset; -use function str_contains; -use function str_replace; -use function strtolower; -use function strtoupper; -use function substr; - -use const GLOB_NOSORT; -use const PREG_PATTERN_ORDER; - -/** - * SystemNodeProvider retrieves the system node ID, if possible - * - * The system node ID, or host ID, is often the same as the MAC address for a - * network interface on the host. - */ -class SystemNodeProvider implements NodeProviderInterface -{ - /** - * Pattern to match nodes in ifconfig and ipconfig output. - */ - private const IFCONFIG_PATTERN = '/[^:]([0-9a-f]{2}([:-])[0-9a-f]{2}(\2[0-9a-f]{2}){4})[^:]/i'; - - /** - * Pattern to match nodes in sysfs stream output. - */ - private const SYSFS_PATTERN = '/^([0-9a-f]{2}:){5}[0-9a-f]{2}$/i'; - - public function getNode(): Hexadecimal - { - $node = $this->getNodeFromSystem(); - - if ($node === '') { - throw new NodeException( - 'Unable to fetch a node for this system' - ); - } - - return new Hexadecimal($node); - } - - /** - * Returns the system node, if it can find it - */ - protected function getNodeFromSystem(): string - { - static $node = null; - - if ($node !== null) { - return (string) $node; - } - - // First, try a Linux-specific approach. - $node = $this->getSysfs(); - - if ($node === '') { - // Search ifconfig output for MAC addresses & return the first one. - $node = $this->getIfconfig(); - } - - $node = str_replace([':', '-'], '', $node); - - return $node; - } - - /** - * Returns the network interface configuration for the system - * - * @codeCoverageIgnore - */ - protected function getIfconfig(): string - { - $disabledFunctions = strtolower((string) ini_get('disable_functions')); - - if (str_contains($disabledFunctions, 'passthru')) { - return ''; - } - - /** - * @psalm-suppress UnnecessaryVarAnnotation - * @var string $phpOs - */ - $phpOs = constant('PHP_OS'); - - ob_start(); - switch (strtoupper(substr($phpOs, 0, 3))) { - case 'WIN': - passthru('ipconfig /all 2>&1'); - - break; - case 'DAR': - passthru('ifconfig 2>&1'); - - break; - case 'FRE': - passthru('netstat -i -f link 2>&1'); - - break; - case 'LIN': - default: - passthru('netstat -ie 2>&1'); - - break; - } - - $ifconfig = (string) ob_get_clean(); - - if (preg_match_all(self::IFCONFIG_PATTERN, $ifconfig, $matches, PREG_PATTERN_ORDER)) { - foreach ($matches[1] as $iface) { - if ($iface !== '00:00:00:00:00:00' && $iface !== '00-00-00-00-00-00') { - return $iface; - } - } - } - - return ''; - } - - /** - * Returns MAC address from the first system interface via the sysfs interface - */ - protected function getSysfs(): string - { - $mac = ''; - - /** - * @psalm-suppress UnnecessaryVarAnnotation - * @var string $phpOs - */ - $phpOs = constant('PHP_OS'); - - if (strtoupper($phpOs) === 'LINUX') { - $addressPaths = glob('/sys/class/net/*/address', GLOB_NOSORT); - - if ($addressPaths === false || count($addressPaths) === 0) { - return ''; - } - - /** @var array $macs */ - $macs = []; - - array_walk($addressPaths, function (string $addressPath) use (&$macs): void { - if (is_readable($addressPath)) { - $macs[] = file_get_contents($addressPath); - } - }); - - /** @var callable $trim */ - $trim = 'trim'; - - $macs = array_map($trim, $macs); - - // Remove invalid entries. - $macs = array_filter($macs, function (string $address) { - return $address !== '00:00:00:00:00:00' - && preg_match(self::SYSFS_PATTERN, $address); - }); - - /** @var string|bool $mac */ - $mac = reset($macs); - } - - return (string) $mac; - } -} diff --git a/vendor/ramsey/uuid/src/Provider/NodeProviderInterface.php b/vendor/ramsey/uuid/src/Provider/NodeProviderInterface.php deleted file mode 100644 index d536b455..00000000 --- a/vendor/ramsey/uuid/src/Provider/NodeProviderInterface.php +++ /dev/null @@ -1,30 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Provider; - -use Ramsey\Uuid\Type\Hexadecimal; - -/** - * A node provider retrieves or generates a node ID - */ -interface NodeProviderInterface -{ - /** - * Returns a node ID - * - * @return Hexadecimal The node ID as a hexadecimal string - */ - public function getNode(): Hexadecimal; -} diff --git a/vendor/ramsey/uuid/src/Provider/Time/FixedTimeProvider.php b/vendor/ramsey/uuid/src/Provider/Time/FixedTimeProvider.php deleted file mode 100644 index 526c8ff4..00000000 --- a/vendor/ramsey/uuid/src/Provider/Time/FixedTimeProvider.php +++ /dev/null @@ -1,57 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Provider\Time; - -use Ramsey\Uuid\Provider\TimeProviderInterface; -use Ramsey\Uuid\Type\Integer as IntegerObject; -use Ramsey\Uuid\Type\Time; - -/** - * FixedTimeProvider uses a known time to provide the time - * - * This provider allows the use of a previously-generated, or known, time - * when generating time-based UUIDs. - */ -class FixedTimeProvider implements TimeProviderInterface -{ - public function __construct(private Time $time) - { - } - - /** - * Sets the `usec` component of the time - * - * @param int|string|IntegerObject $value The `usec` value to set - */ - public function setUsec($value): void - { - $this->time = new Time($this->time->getSeconds(), $value); - } - - /** - * Sets the `sec` component of the time - * - * @param int|string|IntegerObject $value The `sec` value to set - */ - public function setSec($value): void - { - $this->time = new Time($value, $this->time->getMicroseconds()); - } - - public function getTime(): Time - { - return $this->time; - } -} diff --git a/vendor/ramsey/uuid/src/Provider/Time/SystemTimeProvider.php b/vendor/ramsey/uuid/src/Provider/Time/SystemTimeProvider.php deleted file mode 100644 index 3a1e09cb..00000000 --- a/vendor/ramsey/uuid/src/Provider/Time/SystemTimeProvider.php +++ /dev/null @@ -1,33 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Provider\Time; - -use Ramsey\Uuid\Provider\TimeProviderInterface; -use Ramsey\Uuid\Type\Time; - -use function gettimeofday; - -/** - * SystemTimeProvider retrieves the current time using built-in PHP functions - */ -class SystemTimeProvider implements TimeProviderInterface -{ - public function getTime(): Time - { - $time = gettimeofday(); - - return new Time($time['sec'], $time['usec']); - } -} diff --git a/vendor/ramsey/uuid/src/Provider/TimeProviderInterface.php b/vendor/ramsey/uuid/src/Provider/TimeProviderInterface.php deleted file mode 100644 index 43588e0b..00000000 --- a/vendor/ramsey/uuid/src/Provider/TimeProviderInterface.php +++ /dev/null @@ -1,28 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Provider; - -use Ramsey\Uuid\Type\Time; - -/** - * A time provider retrieves the current time - */ -interface TimeProviderInterface -{ - /** - * Returns a time object - */ - public function getTime(): Time; -} diff --git a/vendor/ramsey/uuid/src/Rfc4122/Fields.php b/vendor/ramsey/uuid/src/Rfc4122/Fields.php deleted file mode 100644 index 9acf810c..00000000 --- a/vendor/ramsey/uuid/src/Rfc4122/Fields.php +++ /dev/null @@ -1,195 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Rfc4122; - -use Ramsey\Uuid\Exception\InvalidArgumentException; -use Ramsey\Uuid\Fields\SerializableFieldsTrait; -use Ramsey\Uuid\Type\Hexadecimal; -use Ramsey\Uuid\Uuid; - -use function bin2hex; -use function dechex; -use function hexdec; -use function sprintf; -use function str_pad; -use function strlen; -use function substr; -use function unpack; - -use const STR_PAD_LEFT; - -/** - * RFC 4122 variant UUIDs are comprised of a set of named fields - * - * Internally, this class represents the fields together as a 16-byte binary - * string. - * - * @psalm-immutable - */ -final class Fields implements FieldsInterface -{ - use MaxTrait; - use NilTrait; - use SerializableFieldsTrait; - use VariantTrait; - use VersionTrait; - - /** - * @param string $bytes A 16-byte binary string representation of a UUID - * - * @throws InvalidArgumentException if the byte string is not exactly 16 bytes - * @throws InvalidArgumentException if the byte string does not represent an RFC 4122 UUID - * @throws InvalidArgumentException if the byte string does not contain a valid version - */ - public function __construct(private string $bytes) - { - if (strlen($this->bytes) !== 16) { - throw new InvalidArgumentException( - 'The byte string must be 16 bytes long; ' - . 'received ' . strlen($this->bytes) . ' bytes' - ); - } - - if (!$this->isCorrectVariant()) { - throw new InvalidArgumentException( - 'The byte string received does not conform to the RFC 4122 variant' - ); - } - - if (!$this->isCorrectVersion()) { - throw new InvalidArgumentException( - 'The byte string received does not contain a valid RFC 4122 version' - ); - } - } - - public function getBytes(): string - { - return $this->bytes; - } - - public function getClockSeq(): Hexadecimal - { - if ($this->isMax()) { - $clockSeq = 0xffff; - } elseif ($this->isNil()) { - $clockSeq = 0x0000; - } else { - $clockSeq = hexdec(bin2hex(substr($this->bytes, 8, 2))) & 0x3fff; - } - - return new Hexadecimal(str_pad(dechex($clockSeq), 4, '0', STR_PAD_LEFT)); - } - - public function getClockSeqHiAndReserved(): Hexadecimal - { - return new Hexadecimal(bin2hex(substr($this->bytes, 8, 1))); - } - - public function getClockSeqLow(): Hexadecimal - { - return new Hexadecimal(bin2hex(substr($this->bytes, 9, 1))); - } - - public function getNode(): Hexadecimal - { - return new Hexadecimal(bin2hex(substr($this->bytes, 10))); - } - - public function getTimeHiAndVersion(): Hexadecimal - { - return new Hexadecimal(bin2hex(substr($this->bytes, 6, 2))); - } - - public function getTimeLow(): Hexadecimal - { - return new Hexadecimal(bin2hex(substr($this->bytes, 0, 4))); - } - - public function getTimeMid(): Hexadecimal - { - return new Hexadecimal(bin2hex(substr($this->bytes, 4, 2))); - } - - /** - * Returns the full 60-bit timestamp, without the version - * - * For version 2 UUIDs, the time_low field is the local identifier and - * should not be returned as part of the time. For this reason, we set the - * bottom 32 bits of the timestamp to 0's. As a result, there is some loss - * of fidelity of the timestamp, for version 2 UUIDs. The timestamp can be - * off by a range of 0 to 429.4967295 seconds (or 7 minutes, 9 seconds, and - * 496730 microseconds). - * - * For version 6 UUIDs, the timestamp order is reversed from the typical RFC - * 4122 order (the time bits are in the correct bit order, so that it is - * monotonically increasing). In returning the timestamp value, we put the - * bits in the order: time_low + time_mid + time_hi. - */ - public function getTimestamp(): Hexadecimal - { - $timestamp = match ($this->getVersion()) { - Uuid::UUID_TYPE_DCE_SECURITY => sprintf( - '%03x%04s%08s', - hexdec($this->getTimeHiAndVersion()->toString()) & 0x0fff, - $this->getTimeMid()->toString(), - '' - ), - Uuid::UUID_TYPE_REORDERED_TIME => sprintf( - '%08s%04s%03x', - $this->getTimeLow()->toString(), - $this->getTimeMid()->toString(), - hexdec($this->getTimeHiAndVersion()->toString()) & 0x0fff - ), - // The Unix timestamp in version 7 UUIDs is a 48-bit number, - // but for consistency, we will return a 60-bit number, padded - // to the left with zeros. - Uuid::UUID_TYPE_UNIX_TIME => sprintf( - '%011s%04s', - $this->getTimeLow()->toString(), - $this->getTimeMid()->toString(), - ), - default => sprintf( - '%03x%04s%08s', - hexdec($this->getTimeHiAndVersion()->toString()) & 0x0fff, - $this->getTimeMid()->toString(), - $this->getTimeLow()->toString() - ), - }; - - return new Hexadecimal($timestamp); - } - - public function getVersion(): ?int - { - if ($this->isNil() || $this->isMax()) { - return null; - } - - /** @var int[] $parts */ - $parts = unpack('n*', $this->bytes); - - return $parts[4] >> 12; - } - - private function isCorrectVariant(): bool - { - if ($this->isNil() || $this->isMax()) { - return true; - } - - return $this->getVariant() === Uuid::RFC_4122; - } -} diff --git a/vendor/ramsey/uuid/src/Rfc4122/FieldsInterface.php b/vendor/ramsey/uuid/src/Rfc4122/FieldsInterface.php deleted file mode 100644 index 2241cf57..00000000 --- a/vendor/ramsey/uuid/src/Rfc4122/FieldsInterface.php +++ /dev/null @@ -1,128 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Rfc4122; - -use Ramsey\Uuid\Fields\FieldsInterface as BaseFieldsInterface; -use Ramsey\Uuid\Type\Hexadecimal; - -/** - * RFC 4122 defines fields for a specific variant of UUID - * - * The fields of an RFC 4122 variant UUID are: - * - * * **time_low**: The low field of the timestamp, an unsigned 32-bit integer - * * **time_mid**: The middle field of the timestamp, an unsigned 16-bit integer - * * **time_hi_and_version**: The high field of the timestamp multiplexed with - * the version number, an unsigned 16-bit integer - * * **clock_seq_hi_and_reserved**: The high field of the clock sequence - * multiplexed with the variant, an unsigned 8-bit integer - * * **clock_seq_low**: The low field of the clock sequence, an unsigned - * 8-bit integer - * * **node**: The spatially unique node identifier, an unsigned 48-bit - * integer - * - * @link http://tools.ietf.org/html/rfc4122#section-4.1 RFC 4122, § 4.1: Format - * - * @psalm-immutable - */ -interface FieldsInterface extends BaseFieldsInterface -{ - /** - * Returns the full 16-bit clock sequence, with the variant bits (two most - * significant bits) masked out - */ - public function getClockSeq(): Hexadecimal; - - /** - * Returns the high field of the clock sequence multiplexed with the variant - */ - public function getClockSeqHiAndReserved(): Hexadecimal; - - /** - * Returns the low field of the clock sequence - */ - public function getClockSeqLow(): Hexadecimal; - - /** - * Returns the node field - */ - public function getNode(): Hexadecimal; - - /** - * Returns the high field of the timestamp multiplexed with the version - */ - public function getTimeHiAndVersion(): Hexadecimal; - - /** - * Returns the low field of the timestamp - */ - public function getTimeLow(): Hexadecimal; - - /** - * Returns the middle field of the timestamp - */ - public function getTimeMid(): Hexadecimal; - - /** - * Returns the full 60-bit timestamp, without the version - */ - public function getTimestamp(): Hexadecimal; - - /** - * Returns the variant - * - * The variant number describes the layout of the UUID. The variant - * number has the following meaning: - * - * - 0 - Reserved for NCS backward compatibility - * - 2 - The RFC 4122 variant - * - 6 - Reserved, Microsoft Corporation backward compatibility - * - 7 - Reserved for future definition - * - * For RFC 4122 variant UUIDs, this value should always be the integer `2`. - * - * @link http://tools.ietf.org/html/rfc4122#section-4.1.1 RFC 4122, § 4.1.1: Variant - */ - public function getVariant(): int; - - /** - * Returns the version - * - * The version number describes how the UUID was generated and has the - * following meaning: - * - * 1. Gregorian time UUID - * 2. DCE security UUID - * 3. Name-based UUID hashed with MD5 - * 4. Randomly generated UUID - * 5. Name-based UUID hashed with SHA-1 - * 6. Reordered time UUID - * 7. Unix Epoch time UUID - * - * This returns `null` if the UUID is not an RFC 4122 variant, since version - * is only meaningful for this variant. - * - * @link http://tools.ietf.org/html/rfc4122#section-4.1.3 RFC 4122, § 4.1.3: Version - */ - public function getVersion(): ?int; - - /** - * Returns true if these fields represent a nil UUID - * - * The nil UUID is special form of UUID that is specified to have all 128 - * bits set to zero. - */ - public function isNil(): bool; -} diff --git a/vendor/ramsey/uuid/src/Rfc4122/MaxTrait.php b/vendor/ramsey/uuid/src/Rfc4122/MaxTrait.php deleted file mode 100644 index dedb7279..00000000 --- a/vendor/ramsey/uuid/src/Rfc4122/MaxTrait.php +++ /dev/null @@ -1,41 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Rfc4122; - -/** - * Provides common functionality for max UUIDs - * - * The max UUID is special form of UUID that is specified to have all 128 bits - * set to one. It is the inverse of the nil UUID. - * - * @link https://datatracker.ietf.org/doc/html/draft-ietf-uuidrev-rfc4122bis-00#section-5.10 Max UUID - * - * @psalm-immutable - */ -trait MaxTrait -{ - /** - * Returns the bytes that comprise the fields - */ - abstract public function getBytes(): string; - - /** - * Returns true if the byte string represents a max UUID - */ - public function isMax(): bool - { - return $this->getBytes() === "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"; - } -} diff --git a/vendor/ramsey/uuid/src/Rfc4122/MaxUuid.php b/vendor/ramsey/uuid/src/Rfc4122/MaxUuid.php deleted file mode 100644 index e5ffa72c..00000000 --- a/vendor/ramsey/uuid/src/Rfc4122/MaxUuid.php +++ /dev/null @@ -1,27 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Rfc4122; - -use Ramsey\Uuid\Uuid; - -/** - * The max UUID is special form of UUID that is specified to have all 128 bits - * set to one - * - * @psalm-immutable - */ -final class MaxUuid extends Uuid implements UuidInterface -{ -} diff --git a/vendor/ramsey/uuid/src/Rfc4122/NilTrait.php b/vendor/ramsey/uuid/src/Rfc4122/NilTrait.php deleted file mode 100644 index 9a9774d8..00000000 --- a/vendor/ramsey/uuid/src/Rfc4122/NilTrait.php +++ /dev/null @@ -1,41 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Rfc4122; - -/** - * Provides common functionality for nil UUIDs - * - * The nil UUID is special form of UUID that is specified to have all 128 bits - * set to zero. - * - * @link https://tools.ietf.org/html/rfc4122#section-4.1.7 RFC 4122, § 4.1.7: Nil UUID - * - * @psalm-immutable - */ -trait NilTrait -{ - /** - * Returns the bytes that comprise the fields - */ - abstract public function getBytes(): string; - - /** - * Returns true if the byte string represents a nil UUID - */ - public function isNil(): bool - { - return $this->getBytes() === "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; - } -} diff --git a/vendor/ramsey/uuid/src/Rfc4122/NilUuid.php b/vendor/ramsey/uuid/src/Rfc4122/NilUuid.php deleted file mode 100644 index c49b9945..00000000 --- a/vendor/ramsey/uuid/src/Rfc4122/NilUuid.php +++ /dev/null @@ -1,27 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Rfc4122; - -use Ramsey\Uuid\Uuid; - -/** - * The nil UUID is special form of UUID that is specified to have all 128 bits - * set to zero - * - * @psalm-immutable - */ -final class NilUuid extends Uuid implements UuidInterface -{ -} diff --git a/vendor/ramsey/uuid/src/Rfc4122/TimeTrait.php b/vendor/ramsey/uuid/src/Rfc4122/TimeTrait.php deleted file mode 100644 index 5d939fac..00000000 --- a/vendor/ramsey/uuid/src/Rfc4122/TimeTrait.php +++ /dev/null @@ -1,55 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Rfc4122; - -use DateTimeImmutable; -use DateTimeInterface; -use Ramsey\Uuid\Exception\DateTimeException; -use Throwable; - -use function str_pad; - -use const STR_PAD_LEFT; - -/** - * Provides common functionality for getting the time from a time-based UUID - * - * @psalm-immutable - */ -trait TimeTrait -{ - /** - * Returns a DateTimeInterface object representing the timestamp associated - * with the UUID - * - * @return DateTimeImmutable A PHP DateTimeImmutable instance representing - * the timestamp of a time-based UUID - */ - public function getDateTime(): DateTimeInterface - { - $time = $this->timeConverter->convertTime($this->fields->getTimestamp()); - - try { - return new DateTimeImmutable( - '@' - . $time->getSeconds()->toString() - . '.' - . str_pad($time->getMicroseconds()->toString(), 6, '0', STR_PAD_LEFT) - ); - } catch (Throwable $e) { - throw new DateTimeException($e->getMessage(), (int) $e->getCode(), $e); - } - } -} diff --git a/vendor/ramsey/uuid/src/Rfc4122/UuidBuilder.php b/vendor/ramsey/uuid/src/Rfc4122/UuidBuilder.php deleted file mode 100644 index 2c2677db..00000000 --- a/vendor/ramsey/uuid/src/Rfc4122/UuidBuilder.php +++ /dev/null @@ -1,118 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Rfc4122; - -use Ramsey\Uuid\Builder\UuidBuilderInterface; -use Ramsey\Uuid\Codec\CodecInterface; -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Converter\Time\UnixTimeConverter; -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Exception\UnableToBuildUuidException; -use Ramsey\Uuid\Exception\UnsupportedOperationException; -use Ramsey\Uuid\Math\BrickMathCalculator; -use Ramsey\Uuid\Rfc4122\UuidInterface as Rfc4122UuidInterface; -use Ramsey\Uuid\Uuid; -use Ramsey\Uuid\UuidInterface; -use Throwable; - -/** - * UuidBuilder builds instances of RFC 4122 UUIDs - * - * @psalm-immutable - */ -class UuidBuilder implements UuidBuilderInterface -{ - private TimeConverterInterface $unixTimeConverter; - - /** - * Constructs the DefaultUuidBuilder - * - * @param NumberConverterInterface $numberConverter The number converter to - * use when constructing the Uuid - * @param TimeConverterInterface $timeConverter The time converter to use - * for converting Gregorian time extracted from version 1, 2, and 6 - * UUIDs to Unix timestamps - * @param TimeConverterInterface|null $unixTimeConverter The time converter - * to use for converter Unix Epoch time extracted from version 7 UUIDs - * to Unix timestamps - */ - public function __construct( - private NumberConverterInterface $numberConverter, - private TimeConverterInterface $timeConverter, - ?TimeConverterInterface $unixTimeConverter = null - ) { - $this->unixTimeConverter = $unixTimeConverter ?? new UnixTimeConverter(new BrickMathCalculator()); - } - - /** - * Builds and returns a Uuid - * - * @param CodecInterface $codec The codec to use for building this Uuid instance - * @param string $bytes The byte string from which to construct a UUID - * - * @return Rfc4122UuidInterface UuidBuilder returns instances of Rfc4122UuidInterface - * - * @psalm-pure - */ - public function build(CodecInterface $codec, string $bytes): UuidInterface - { - try { - /** @var Fields $fields */ - $fields = $this->buildFields($bytes); - - if ($fields->isNil()) { - return new NilUuid($fields, $this->numberConverter, $codec, $this->timeConverter); - } - - if ($fields->isMax()) { - return new MaxUuid($fields, $this->numberConverter, $codec, $this->timeConverter); - } - - switch ($fields->getVersion()) { - case Uuid::UUID_TYPE_TIME: - return new UuidV1($fields, $this->numberConverter, $codec, $this->timeConverter); - case Uuid::UUID_TYPE_DCE_SECURITY: - return new UuidV2($fields, $this->numberConverter, $codec, $this->timeConverter); - case Uuid::UUID_TYPE_HASH_MD5: - return new UuidV3($fields, $this->numberConverter, $codec, $this->timeConverter); - case Uuid::UUID_TYPE_RANDOM: - return new UuidV4($fields, $this->numberConverter, $codec, $this->timeConverter); - case Uuid::UUID_TYPE_HASH_SHA1: - return new UuidV5($fields, $this->numberConverter, $codec, $this->timeConverter); - case Uuid::UUID_TYPE_REORDERED_TIME: - return new UuidV6($fields, $this->numberConverter, $codec, $this->timeConverter); - case Uuid::UUID_TYPE_UNIX_TIME: - return new UuidV7($fields, $this->numberConverter, $codec, $this->unixTimeConverter); - case Uuid::UUID_TYPE_CUSTOM: - return new UuidV8($fields, $this->numberConverter, $codec, $this->timeConverter); - } - - throw new UnsupportedOperationException( - 'The UUID version in the given fields is not supported ' - . 'by this UUID builder' - ); - } catch (Throwable $e) { - throw new UnableToBuildUuidException($e->getMessage(), (int) $e->getCode(), $e); - } - } - - /** - * Proxy method to allow injecting a mock, for testing - */ - protected function buildFields(string $bytes): FieldsInterface - { - return new Fields($bytes); - } -} diff --git a/vendor/ramsey/uuid/src/Rfc4122/UuidInterface.php b/vendor/ramsey/uuid/src/Rfc4122/UuidInterface.php deleted file mode 100644 index e80f33be..00000000 --- a/vendor/ramsey/uuid/src/Rfc4122/UuidInterface.php +++ /dev/null @@ -1,29 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Rfc4122; - -use Ramsey\Uuid\UuidInterface as BaseUuidInterface; - -/** - * Also known as a Leach-Salz variant UUID, an RFC 4122 variant UUID is a - * universally unique identifier defined by RFC 4122 - * - * @link https://tools.ietf.org/html/rfc4122 RFC 4122 - * - * @psalm-immutable - */ -interface UuidInterface extends BaseUuidInterface -{ -} diff --git a/vendor/ramsey/uuid/src/Rfc4122/UuidV1.php b/vendor/ramsey/uuid/src/Rfc4122/UuidV1.php deleted file mode 100644 index 515c038d..00000000 --- a/vendor/ramsey/uuid/src/Rfc4122/UuidV1.php +++ /dev/null @@ -1,60 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Rfc4122; - -use Ramsey\Uuid\Codec\CodecInterface; -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Exception\InvalidArgumentException; -use Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface; -use Ramsey\Uuid\Uuid; - -/** - * Gregorian time, or version 1, UUIDs include timestamp, clock sequence, and node - * values that are combined into a 128-bit unsigned integer - * - * @psalm-immutable - */ -final class UuidV1 extends Uuid implements UuidInterface -{ - use TimeTrait; - - /** - * Creates a version 1 (Gregorian time) UUID - * - * @param Rfc4122FieldsInterface $fields The fields from which to construct a UUID - * @param NumberConverterInterface $numberConverter The number converter to use - * for converting hex values to/from integers - * @param CodecInterface $codec The codec to use when encoding or decoding - * UUID strings - * @param TimeConverterInterface $timeConverter The time converter to use - * for converting timestamps extracted from a UUID to unix timestamps - */ - public function __construct( - Rfc4122FieldsInterface $fields, - NumberConverterInterface $numberConverter, - CodecInterface $codec, - TimeConverterInterface $timeConverter - ) { - if ($fields->getVersion() !== Uuid::UUID_TYPE_TIME) { - throw new InvalidArgumentException( - 'Fields used to create a UuidV1 must represent a ' - . 'version 1 (time-based) UUID' - ); - } - - parent::__construct($fields, $numberConverter, $codec, $timeConverter); - } -} diff --git a/vendor/ramsey/uuid/src/Rfc4122/UuidV2.php b/vendor/ramsey/uuid/src/Rfc4122/UuidV2.php deleted file mode 100644 index c8ccbe42..00000000 --- a/vendor/ramsey/uuid/src/Rfc4122/UuidV2.php +++ /dev/null @@ -1,115 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Rfc4122; - -use Ramsey\Uuid\Codec\CodecInterface; -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Exception\InvalidArgumentException; -use Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface; -use Ramsey\Uuid\Type\Integer as IntegerObject; -use Ramsey\Uuid\Uuid; - -use function hexdec; - -/** - * DCE Security version, or version 2, UUIDs include local domain identifier, - * local ID for the specified domain, and node values that are combined into a - * 128-bit unsigned integer - * - * It is important to note that a version 2 UUID suffers from some loss of - * fidelity of the timestamp, due to replacing the time_low field with the - * local identifier. When constructing the timestamp value for date - * purposes, we replace the local identifier bits with zeros. As a result, - * the timestamp can be off by a range of 0 to 429.4967295 seconds (or 7 - * minutes, 9 seconds, and 496730 microseconds). - * - * Astute observers might note this value directly corresponds to 2^32 - 1, - * or 0xffffffff. The local identifier is 32-bits, and we have set each of - * these bits to 0, so the maximum range of timestamp drift is 0x00000000 - * to 0xffffffff (counted in 100-nanosecond intervals). - * - * @link https://publications.opengroup.org/c311 DCE 1.1: Authentication and Security Services - * @link https://publications.opengroup.org/c706 DCE 1.1: Remote Procedure Call - * @link https://pubs.opengroup.org/onlinepubs/9696989899/chap5.htm#tagcjh_08_02_01_01 DCE 1.1: Auth & Sec, §5.2.1.1 - * @link https://pubs.opengroup.org/onlinepubs/9696989899/chap11.htm#tagcjh_14_05_01_01 DCE 1.1: Auth & Sec, §11.5.1.1 - * @link https://pubs.opengroup.org/onlinepubs/9629399/apdxa.htm DCE 1.1: RPC, Appendix A - * @link https://github.com/google/uuid Go package for UUIDs (includes DCE implementation) - * - * @psalm-immutable - */ -final class UuidV2 extends Uuid implements UuidInterface -{ - use TimeTrait; - - /** - * Creates a version 2 (DCE Security) UUID - * - * @param Rfc4122FieldsInterface $fields The fields from which to construct a UUID - * @param NumberConverterInterface $numberConverter The number converter to use - * for converting hex values to/from integers - * @param CodecInterface $codec The codec to use when encoding or decoding - * UUID strings - * @param TimeConverterInterface $timeConverter The time converter to use - * for converting timestamps extracted from a UUID to unix timestamps - */ - public function __construct( - Rfc4122FieldsInterface $fields, - NumberConverterInterface $numberConverter, - CodecInterface $codec, - TimeConverterInterface $timeConverter - ) { - if ($fields->getVersion() !== Uuid::UUID_TYPE_DCE_SECURITY) { - throw new InvalidArgumentException( - 'Fields used to create a UuidV2 must represent a ' - . 'version 2 (DCE Security) UUID' - ); - } - - parent::__construct($fields, $numberConverter, $codec, $timeConverter); - } - - /** - * Returns the local domain used to create this version 2 UUID - */ - public function getLocalDomain(): int - { - /** @var Rfc4122FieldsInterface $fields */ - $fields = $this->getFields(); - - return (int) hexdec($fields->getClockSeqLow()->toString()); - } - - /** - * Returns the string name of the local domain - */ - public function getLocalDomainName(): string - { - return Uuid::DCE_DOMAIN_NAMES[$this->getLocalDomain()]; - } - - /** - * Returns the local identifier for the domain used to create this version 2 UUID - */ - public function getLocalIdentifier(): IntegerObject - { - /** @var Rfc4122FieldsInterface $fields */ - $fields = $this->getFields(); - - return new IntegerObject( - $this->numberConverter->fromHex($fields->getTimeLow()->toString()) - ); - } -} diff --git a/vendor/ramsey/uuid/src/Rfc4122/UuidV3.php b/vendor/ramsey/uuid/src/Rfc4122/UuidV3.php deleted file mode 100644 index deaa54eb..00000000 --- a/vendor/ramsey/uuid/src/Rfc4122/UuidV3.php +++ /dev/null @@ -1,58 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Rfc4122; - -use Ramsey\Uuid\Codec\CodecInterface; -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Exception\InvalidArgumentException; -use Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface; -use Ramsey\Uuid\Uuid; - -/** - * Version 3 UUIDs are named-based, using combination of a namespace and name - * that are hashed into a 128-bit unsigned integer using MD5 - * - * @psalm-immutable - */ -final class UuidV3 extends Uuid implements UuidInterface -{ - /** - * Creates a version 3 (name-based, MD5-hashed) UUID - * - * @param Rfc4122FieldsInterface $fields The fields from which to construct a UUID - * @param NumberConverterInterface $numberConverter The number converter to use - * for converting hex values to/from integers - * @param CodecInterface $codec The codec to use when encoding or decoding - * UUID strings - * @param TimeConverterInterface $timeConverter The time converter to use - * for converting timestamps extracted from a UUID to unix timestamps - */ - public function __construct( - Rfc4122FieldsInterface $fields, - NumberConverterInterface $numberConverter, - CodecInterface $codec, - TimeConverterInterface $timeConverter - ) { - if ($fields->getVersion() !== Uuid::UUID_TYPE_HASH_MD5) { - throw new InvalidArgumentException( - 'Fields used to create a UuidV3 must represent a ' - . 'version 3 (name-based, MD5-hashed) UUID' - ); - } - - parent::__construct($fields, $numberConverter, $codec, $timeConverter); - } -} diff --git a/vendor/ramsey/uuid/src/Rfc4122/UuidV4.php b/vendor/ramsey/uuid/src/Rfc4122/UuidV4.php deleted file mode 100644 index 2e572462..00000000 --- a/vendor/ramsey/uuid/src/Rfc4122/UuidV4.php +++ /dev/null @@ -1,58 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Rfc4122; - -use Ramsey\Uuid\Codec\CodecInterface; -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Exception\InvalidArgumentException; -use Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface; -use Ramsey\Uuid\Uuid; - -/** - * Random, or version 4, UUIDs are randomly or pseudo-randomly generated 128-bit - * integers - * - * @psalm-immutable - */ -final class UuidV4 extends Uuid implements UuidInterface -{ - /** - * Creates a version 4 (random) UUID - * - * @param Rfc4122FieldsInterface $fields The fields from which to construct a UUID - * @param NumberConverterInterface $numberConverter The number converter to use - * for converting hex values to/from integers - * @param CodecInterface $codec The codec to use when encoding or decoding - * UUID strings - * @param TimeConverterInterface $timeConverter The time converter to use - * for converting timestamps extracted from a UUID to unix timestamps - */ - public function __construct( - Rfc4122FieldsInterface $fields, - NumberConverterInterface $numberConverter, - CodecInterface $codec, - TimeConverterInterface $timeConverter - ) { - if ($fields->getVersion() !== Uuid::UUID_TYPE_RANDOM) { - throw new InvalidArgumentException( - 'Fields used to create a UuidV4 must represent a ' - . 'version 4 (random) UUID' - ); - } - - parent::__construct($fields, $numberConverter, $codec, $timeConverter); - } -} diff --git a/vendor/ramsey/uuid/src/Rfc4122/UuidV5.php b/vendor/ramsey/uuid/src/Rfc4122/UuidV5.php deleted file mode 100644 index 2ef6ab3f..00000000 --- a/vendor/ramsey/uuid/src/Rfc4122/UuidV5.php +++ /dev/null @@ -1,58 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Rfc4122; - -use Ramsey\Uuid\Codec\CodecInterface; -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Exception\InvalidArgumentException; -use Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface; -use Ramsey\Uuid\Uuid; - -/** - * Version 5 UUIDs are named-based, using combination of a namespace and name - * that are hashed into a 128-bit unsigned integer using SHA1 - * - * @psalm-immutable - */ -final class UuidV5 extends Uuid implements UuidInterface -{ - /** - * Creates a version 5 (name-based, SHA1-hashed) UUID - * - * @param Rfc4122FieldsInterface $fields The fields from which to construct a UUID - * @param NumberConverterInterface $numberConverter The number converter to use - * for converting hex values to/from integers - * @param CodecInterface $codec The codec to use when encoding or decoding - * UUID strings - * @param TimeConverterInterface $timeConverter The time converter to use - * for converting timestamps extracted from a UUID to unix timestamps - */ - public function __construct( - Rfc4122FieldsInterface $fields, - NumberConverterInterface $numberConverter, - CodecInterface $codec, - TimeConverterInterface $timeConverter - ) { - if ($fields->getVersion() !== Uuid::UUID_TYPE_HASH_SHA1) { - throw new InvalidArgumentException( - 'Fields used to create a UuidV5 must represent a ' - . 'version 5 (named-based, SHA1-hashed) UUID' - ); - } - - parent::__construct($fields, $numberConverter, $codec, $timeConverter); - } -} diff --git a/vendor/ramsey/uuid/src/Rfc4122/UuidV6.php b/vendor/ramsey/uuid/src/Rfc4122/UuidV6.php deleted file mode 100644 index 7e374339..00000000 --- a/vendor/ramsey/uuid/src/Rfc4122/UuidV6.php +++ /dev/null @@ -1,29 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Rfc4122; - -use Ramsey\Uuid\Nonstandard\UuidV6 as NonstandardUuidV6; - -/** - * Reordered time, or version 6, UUIDs include timestamp, clock sequence, and - * node values that are combined into a 128-bit unsigned integer - * - * @link https://datatracker.ietf.org/doc/html/draft-ietf-uuidrev-rfc4122bis-00#section-5.6 UUID Version 6 - * - * @psalm-immutable - */ -final class UuidV6 extends NonstandardUuidV6 implements UuidInterface -{ -} diff --git a/vendor/ramsey/uuid/src/Rfc4122/UuidV7.php b/vendor/ramsey/uuid/src/Rfc4122/UuidV7.php deleted file mode 100644 index 5b524c48..00000000 --- a/vendor/ramsey/uuid/src/Rfc4122/UuidV7.php +++ /dev/null @@ -1,62 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Rfc4122; - -use Ramsey\Uuid\Codec\CodecInterface; -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Exception\InvalidArgumentException; -use Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface; -use Ramsey\Uuid\Uuid; - -/** - * Unix Epoch time, or version 7, UUIDs include a timestamp in milliseconds - * since the Unix Epoch, along with random bytes - * - * @link https://datatracker.ietf.org/doc/html/draft-ietf-uuidrev-rfc4122bis-00#section-5.7 UUID Version 7 - * - * @psalm-immutable - */ -final class UuidV7 extends Uuid implements UuidInterface -{ - use TimeTrait; - - /** - * Creates a version 7 (Unix Epoch time) UUID - * - * @param Rfc4122FieldsInterface $fields The fields from which to construct a UUID - * @param NumberConverterInterface $numberConverter The number converter to use - * for converting hex values to/from integers - * @param CodecInterface $codec The codec to use when encoding or decoding - * UUID strings - * @param TimeConverterInterface $timeConverter The time converter to use - * for converting timestamps extracted from a UUID to unix timestamps - */ - public function __construct( - Rfc4122FieldsInterface $fields, - NumberConverterInterface $numberConverter, - CodecInterface $codec, - TimeConverterInterface $timeConverter - ) { - if ($fields->getVersion() !== Uuid::UUID_TYPE_UNIX_TIME) { - throw new InvalidArgumentException( - 'Fields used to create a UuidV7 must represent a ' - . 'version 7 (Unix Epoch time) UUID' - ); - } - - parent::__construct($fields, $numberConverter, $codec, $timeConverter); - } -} diff --git a/vendor/ramsey/uuid/src/Rfc4122/UuidV8.php b/vendor/ramsey/uuid/src/Rfc4122/UuidV8.php deleted file mode 100644 index 78b0290c..00000000 --- a/vendor/ramsey/uuid/src/Rfc4122/UuidV8.php +++ /dev/null @@ -1,65 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Rfc4122; - -use Ramsey\Uuid\Codec\CodecInterface; -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Exception\InvalidArgumentException; -use Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface; -use Ramsey\Uuid\Uuid; - -/** - * Version 8, Custom UUIDs provide an RFC 4122 compatible format for - * experimental or vendor-specific uses - * - * The only requirement for version 8 UUIDs is that the version and variant bits - * must be set. Otherwise, implementations are free to set the other bits - * according to their needs. As a result, the uniqueness of version 8 UUIDs is - * implementation-specific and should not be assumed. - * - * @link https://datatracker.ietf.org/doc/html/draft-ietf-uuidrev-rfc4122bis-00#section-5.8 UUID Version 8 - * - * @psalm-immutable - */ -final class UuidV8 extends Uuid implements UuidInterface -{ - /** - * Creates a version 8 (custom) UUID - * - * @param Rfc4122FieldsInterface $fields The fields from which to construct a UUID - * @param NumberConverterInterface $numberConverter The number converter to use - * for converting hex values to/from integers - * @param CodecInterface $codec The codec to use when encoding or decoding - * UUID strings - * @param TimeConverterInterface $timeConverter The time converter to use - * for converting timestamps extracted from a UUID to unix timestamps - */ - public function __construct( - Rfc4122FieldsInterface $fields, - NumberConverterInterface $numberConverter, - CodecInterface $codec, - TimeConverterInterface $timeConverter - ) { - if ($fields->getVersion() !== Uuid::UUID_TYPE_CUSTOM) { - throw new InvalidArgumentException( - 'Fields used to create a UuidV8 must represent a ' - . 'version 8 (custom) UUID' - ); - } - - parent::__construct($fields, $numberConverter, $codec, $timeConverter); - } -} diff --git a/vendor/ramsey/uuid/src/Rfc4122/Validator.php b/vendor/ramsey/uuid/src/Rfc4122/Validator.php deleted file mode 100644 index e82a11e6..00000000 --- a/vendor/ramsey/uuid/src/Rfc4122/Validator.php +++ /dev/null @@ -1,50 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Rfc4122; - -use Ramsey\Uuid\Uuid; -use Ramsey\Uuid\Validator\ValidatorInterface; - -use function preg_match; -use function str_replace; - -/** - * Rfc4122\Validator validates strings as UUIDs of the RFC 4122 variant - * - * @psalm-immutable - */ -final class Validator implements ValidatorInterface -{ - private const VALID_PATTERN = '\A[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-' - . '[1-8][0-9A-Fa-f]{3}-[ABab89][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}\z'; - - /** - * @psalm-return non-empty-string - * @psalm-suppress MoreSpecificReturnType we know that the retrieved `string` is never empty - * @psalm-suppress LessSpecificReturnStatement we know that the retrieved `string` is never empty - */ - public function getPattern(): string - { - return self::VALID_PATTERN; - } - - public function validate(string $uuid): bool - { - $uuid = str_replace(['urn:', 'uuid:', 'URN:', 'UUID:', '{', '}'], '', $uuid); - $uuid = strtolower($uuid); - - return $uuid === Uuid::NIL || $uuid === Uuid::MAX || preg_match('/' . self::VALID_PATTERN . '/Dms', $uuid); - } -} diff --git a/vendor/ramsey/uuid/src/Rfc4122/VariantTrait.php b/vendor/ramsey/uuid/src/Rfc4122/VariantTrait.php deleted file mode 100644 index 1041de51..00000000 --- a/vendor/ramsey/uuid/src/Rfc4122/VariantTrait.php +++ /dev/null @@ -1,94 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Rfc4122; - -use Ramsey\Uuid\Exception\InvalidBytesException; -use Ramsey\Uuid\Uuid; - -use function decbin; -use function str_pad; -use function str_starts_with; -use function strlen; -use function substr; -use function unpack; - -use const STR_PAD_LEFT; - -/** - * Provides common functionality for handling the variant, as defined by RFC 4122 - * - * @psalm-immutable - */ -trait VariantTrait -{ - /** - * Returns the bytes that comprise the fields - */ - abstract public function getBytes(): string; - - /** - * Returns the variant identifier, according to RFC 4122, for the given bytes - * - * The following values may be returned: - * - * - `0` -- Reserved, NCS backward compatibility. - * - `2` -- The variant specified in RFC 4122. - * - `6` -- Reserved, Microsoft Corporation backward compatibility. - * - `7` -- Reserved for future definition. - * - * @link https://tools.ietf.org/html/rfc4122#section-4.1.1 RFC 4122, § 4.1.1: Variant - * - * @return int The variant identifier, according to RFC 4122 - */ - public function getVariant(): int - { - if (strlen($this->getBytes()) !== 16) { - throw new InvalidBytesException('Invalid number of bytes'); - } - - if ($this->isMax() || $this->isNil()) { - // RFC 4122 defines these special types of UUID, so we will consider - // them as belonging to the RFC 4122 variant. - return Uuid::RFC_4122; - } - - /** @var int[] $parts */ - $parts = unpack('n*', $this->getBytes()); - - // $parts[5] is a 16-bit, unsigned integer containing the variant bits - // of the UUID. We convert this integer into a string containing a - // binary representation, padded to 16 characters. We analyze the first - // three characters (three most-significant bits) to determine the - // variant. - $binary = str_pad( - decbin($parts[5]), - 16, - '0', - STR_PAD_LEFT - ); - - $msb = substr($binary, 0, 3); - - if ($msb === '111') { - return Uuid::RESERVED_FUTURE; - } elseif ($msb === '110') { - return Uuid::RESERVED_MICROSOFT; - } elseif (str_starts_with($msb, '10')) { - return Uuid::RFC_4122; - } - - return Uuid::RESERVED_NCS; - } -} diff --git a/vendor/ramsey/uuid/src/Rfc4122/VersionTrait.php b/vendor/ramsey/uuid/src/Rfc4122/VersionTrait.php deleted file mode 100644 index 0195e46c..00000000 --- a/vendor/ramsey/uuid/src/Rfc4122/VersionTrait.php +++ /dev/null @@ -1,60 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Rfc4122; - -use Ramsey\Uuid\Uuid; - -/** - * Provides common functionality for handling the version, as defined by RFC 4122 - * - * @psalm-immutable - */ -trait VersionTrait -{ - /** - * Returns the version - */ - abstract public function getVersion(): ?int; - - /** - * Returns true if these fields represent a max UUID - */ - abstract public function isMax(): bool; - - /** - * Returns true if these fields represent a nil UUID - */ - abstract public function isNil(): bool; - - /** - * Returns true if the version matches one of those defined by RFC 4122 - * - * @return bool True if the UUID version is valid, false otherwise - */ - private function isCorrectVersion(): bool - { - if ($this->isNil() || $this->isMax()) { - return true; - } - - return match ($this->getVersion()) { - Uuid::UUID_TYPE_TIME, Uuid::UUID_TYPE_DCE_SECURITY, - Uuid::UUID_TYPE_HASH_MD5, Uuid::UUID_TYPE_RANDOM, - Uuid::UUID_TYPE_HASH_SHA1, Uuid::UUID_TYPE_REORDERED_TIME, - Uuid::UUID_TYPE_UNIX_TIME, Uuid::UUID_TYPE_CUSTOM => true, - default => false, - }; - } -} diff --git a/vendor/ramsey/uuid/src/Type/Decimal.php b/vendor/ramsey/uuid/src/Type/Decimal.php deleted file mode 100644 index acc5e754..00000000 --- a/vendor/ramsey/uuid/src/Type/Decimal.php +++ /dev/null @@ -1,129 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Type; - -use Ramsey\Uuid\Exception\InvalidArgumentException; -use ValueError; - -use function is_numeric; -use function sprintf; -use function str_starts_with; - -/** - * A value object representing a decimal - * - * This class exists for type-safety purposes, to ensure that decimals - * returned from ramsey/uuid methods as strings are truly decimals and not some - * other kind of string. - * - * To support values as true decimals and not as floats or doubles, we store the - * decimals as strings. - * - * @psalm-immutable - */ -final class Decimal implements NumberInterface -{ - private string $value; - private bool $isNegative = false; - - public function __construct(float | int | string | self $value) - { - $value = (string) $value; - - if (!is_numeric($value)) { - throw new InvalidArgumentException( - 'Value must be a signed decimal or a string containing only ' - . 'digits 0-9 and, optionally, a decimal point or sign (+ or -)' - ); - } - - // Remove the leading +-symbol. - if (str_starts_with($value, '+')) { - $value = substr($value, 1); - } - - // For cases like `-0` or `-0.0000`, convert the value to `0`. - if (abs((float) $value) === 0.0) { - $value = '0'; - } - - if (str_starts_with($value, '-')) { - $this->isNegative = true; - } - - $this->value = $value; - } - - public function isNegative(): bool - { - return $this->isNegative; - } - - public function toString(): string - { - return $this->value; - } - - public function __toString(): string - { - return $this->toString(); - } - - public function jsonSerialize(): string - { - return $this->toString(); - } - - public function serialize(): string - { - return $this->toString(); - } - - /** - * @return array{string: string} - */ - public function __serialize(): array - { - return ['string' => $this->toString()]; - } - - /** - * Constructs the object from a serialized string representation - * - * @param string $data The serialized string representation of the object - * - * @psalm-suppress UnusedMethodCall - */ - public function unserialize(string $data): void - { - $this->__construct($data); - } - - /** - * @param array{string?: string} $data - * - * @psalm-suppress UnusedMethodCall - */ - public function __unserialize(array $data): void - { - // @codeCoverageIgnoreStart - if (!isset($data['string'])) { - throw new ValueError(sprintf('%s(): Argument #1 ($data) is invalid', __METHOD__)); - } - // @codeCoverageIgnoreEnd - - $this->unserialize($data['string']); - } -} diff --git a/vendor/ramsey/uuid/src/Type/Hexadecimal.php b/vendor/ramsey/uuid/src/Type/Hexadecimal.php deleted file mode 100644 index bf71ec4b..00000000 --- a/vendor/ramsey/uuid/src/Type/Hexadecimal.php +++ /dev/null @@ -1,115 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Type; - -use Ramsey\Uuid\Exception\InvalidArgumentException; -use ValueError; - -use function preg_match; -use function sprintf; -use function substr; - -/** - * A value object representing a hexadecimal number - * - * This class exists for type-safety purposes, to ensure that hexadecimal numbers - * returned from ramsey/uuid methods as strings are truly hexadecimal and not some - * other kind of string. - * - * @psalm-immutable - */ -final class Hexadecimal implements TypeInterface -{ - private string $value; - - /** - * @param self|string $value The hexadecimal value to store - */ - public function __construct(self | string $value) - { - $this->value = $value instanceof self ? (string) $value : $this->prepareValue($value); - } - - public function toString(): string - { - return $this->value; - } - - public function __toString(): string - { - return $this->toString(); - } - - public function jsonSerialize(): string - { - return $this->toString(); - } - - public function serialize(): string - { - return $this->toString(); - } - - /** - * @return array{string: string} - */ - public function __serialize(): array - { - return ['string' => $this->toString()]; - } - - /** - * Constructs the object from a serialized string representation - * - * @param string $data The serialized string representation of the object - * - * @psalm-suppress UnusedMethodCall - */ - public function unserialize(string $data): void - { - $this->__construct($data); - } - - /** - * @param array{string?: string} $data - */ - public function __unserialize(array $data): void - { - // @codeCoverageIgnoreStart - if (!isset($data['string'])) { - throw new ValueError(sprintf('%s(): Argument #1 ($data) is invalid', __METHOD__)); - } - // @codeCoverageIgnoreEnd - - $this->unserialize($data['string']); - } - - private function prepareValue(string $value): string - { - $value = strtolower($value); - - if (str_starts_with($value, '0x')) { - $value = substr($value, 2); - } - - if (!preg_match('/^[A-Fa-f0-9]+$/', $value)) { - throw new InvalidArgumentException( - 'Value must be a hexadecimal number' - ); - } - - return $value; - } -} diff --git a/vendor/ramsey/uuid/src/Type/Integer.php b/vendor/ramsey/uuid/src/Type/Integer.php deleted file mode 100644 index 50dac993..00000000 --- a/vendor/ramsey/uuid/src/Type/Integer.php +++ /dev/null @@ -1,158 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Type; - -use Ramsey\Uuid\Exception\InvalidArgumentException; -use ValueError; - -use function assert; -use function is_numeric; -use function preg_match; -use function sprintf; -use function substr; - -/** - * A value object representing an integer - * - * This class exists for type-safety purposes, to ensure that integers - * returned from ramsey/uuid methods as strings are truly integers and not some - * other kind of string. - * - * To support large integers beyond PHP_INT_MAX and PHP_INT_MIN on both 64-bit - * and 32-bit systems, we store the integers as strings. - * - * @psalm-immutable - */ -final class Integer implements NumberInterface -{ - /** - * @psalm-var numeric-string - */ - private string $value; - - private bool $isNegative = false; - - public function __construct(float | int | string | self $value) - { - $this->value = $value instanceof self ? (string) $value : $this->prepareValue($value); - } - - public function isNegative(): bool - { - return $this->isNegative; - } - - /** - * @psalm-return numeric-string - */ - public function toString(): string - { - return $this->value; - } - - /** - * @psalm-return numeric-string - */ - public function __toString(): string - { - return $this->toString(); - } - - public function jsonSerialize(): string - { - return $this->toString(); - } - - public function serialize(): string - { - return $this->toString(); - } - - /** - * @return array{string: string} - */ - public function __serialize(): array - { - return ['string' => $this->toString()]; - } - - /** - * Constructs the object from a serialized string representation - * - * @param string $data The serialized string representation of the object - * - * @psalm-suppress UnusedMethodCall - */ - public function unserialize(string $data): void - { - $this->__construct($data); - } - - /** - * @param array{string?: string} $data - */ - public function __unserialize(array $data): void - { - // @codeCoverageIgnoreStart - if (!isset($data['string'])) { - throw new ValueError(sprintf('%s(): Argument #1 ($data) is invalid', __METHOD__)); - } - // @codeCoverageIgnoreEnd - - $this->unserialize($data['string']); - } - - /** - * @return numeric-string - */ - private function prepareValue(float | int | string $value): string - { - $value = (string) $value; - $sign = '+'; - - // If the value contains a sign, remove it for digit pattern check. - if (str_starts_with($value, '-') || str_starts_with($value, '+')) { - $sign = substr($value, 0, 1); - $value = substr($value, 1); - } - - if (!preg_match('/^\d+$/', $value)) { - throw new InvalidArgumentException( - 'Value must be a signed integer or a string containing only ' - . 'digits 0-9 and, optionally, a sign (+ or -)' - ); - } - - // Trim any leading zeros. - $value = ltrim($value, '0'); - - // Set to zero if the string is empty after trimming zeros. - if ($value === '') { - $value = '0'; - } - - // Add the negative sign back to the value. - if ($sign === '-' && $value !== '0') { - $value = $sign . $value; - - /** @psalm-suppress InaccessibleProperty */ - $this->isNegative = true; - } - - assert(is_numeric($value)); - - return $value; - } -} diff --git a/vendor/ramsey/uuid/src/Type/NumberInterface.php b/vendor/ramsey/uuid/src/Type/NumberInterface.php deleted file mode 100644 index bf4ae9db..00000000 --- a/vendor/ramsey/uuid/src/Type/NumberInterface.php +++ /dev/null @@ -1,28 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Type; - -/** - * NumberInterface ensures consistency in numeric values returned by ramsey/uuid - * - * @psalm-immutable - */ -interface NumberInterface extends TypeInterface -{ - /** - * Returns true if this number is less than zero - */ - public function isNegative(): bool; -} diff --git a/vendor/ramsey/uuid/src/Type/Time.php b/vendor/ramsey/uuid/src/Type/Time.php deleted file mode 100644 index 0cedb447..00000000 --- a/vendor/ramsey/uuid/src/Type/Time.php +++ /dev/null @@ -1,128 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Type; - -use Ramsey\Uuid\Exception\UnsupportedOperationException; -use Ramsey\Uuid\Type\Integer as IntegerObject; -use ValueError; - -use function json_decode; -use function json_encode; -use function sprintf; - -/** - * A value object representing a timestamp - * - * This class exists for type-safety purposes, to ensure that timestamps used - * by ramsey/uuid are truly timestamp integers and not some other kind of string - * or integer. - * - * @psalm-immutable - */ -final class Time implements TypeInterface -{ - private IntegerObject $seconds; - private IntegerObject $microseconds; - - public function __construct( - float | int | string | IntegerObject $seconds, - float | int | string | IntegerObject $microseconds = 0, - ) { - $this->seconds = new IntegerObject($seconds); - $this->microseconds = new IntegerObject($microseconds); - } - - public function getSeconds(): IntegerObject - { - return $this->seconds; - } - - public function getMicroseconds(): IntegerObject - { - return $this->microseconds; - } - - public function toString(): string - { - return $this->seconds->toString() . '.' . sprintf('%06s', $this->microseconds->toString()); - } - - public function __toString(): string - { - return $this->toString(); - } - - /** - * @return string[] - */ - public function jsonSerialize(): array - { - return [ - 'seconds' => $this->getSeconds()->toString(), - 'microseconds' => $this->getMicroseconds()->toString(), - ]; - } - - public function serialize(): string - { - return (string) json_encode($this); - } - - /** - * @return array{seconds: string, microseconds: string} - */ - public function __serialize(): array - { - return [ - 'seconds' => $this->getSeconds()->toString(), - 'microseconds' => $this->getMicroseconds()->toString(), - ]; - } - - /** - * Constructs the object from a serialized string representation - * - * @param string $data The serialized string representation of the object - * - * @psalm-suppress UnusedMethodCall - */ - public function unserialize(string $data): void - { - /** @var array{seconds?: int|float|string, microseconds?: int|float|string} $time */ - $time = json_decode($data, true); - - if (!isset($time['seconds']) || !isset($time['microseconds'])) { - throw new UnsupportedOperationException( - 'Attempted to unserialize an invalid value' - ); - } - - $this->__construct($time['seconds'], $time['microseconds']); - } - - /** - * @param array{seconds?: string, microseconds?: string} $data - */ - public function __unserialize(array $data): void - { - // @codeCoverageIgnoreStart - if (!isset($data['seconds']) || !isset($data['microseconds'])) { - throw new ValueError(sprintf('%s(): Argument #1 ($data) is invalid', __METHOD__)); - } - // @codeCoverageIgnoreEnd - - $this->__construct($data['seconds'], $data['microseconds']); - } -} diff --git a/vendor/ramsey/uuid/src/Type/TypeInterface.php b/vendor/ramsey/uuid/src/Type/TypeInterface.php deleted file mode 100644 index da2d8b20..00000000 --- a/vendor/ramsey/uuid/src/Type/TypeInterface.php +++ /dev/null @@ -1,30 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Type; - -use JsonSerializable; -use Serializable; - -/** - * TypeInterface ensures consistency in typed values returned by ramsey/uuid - * - * @psalm-immutable - */ -interface TypeInterface extends JsonSerializable, Serializable -{ - public function toString(): string; - - public function __toString(): string; -} diff --git a/vendor/ramsey/uuid/src/Uuid.php b/vendor/ramsey/uuid/src/Uuid.php deleted file mode 100644 index 7cbfb17d..00000000 --- a/vendor/ramsey/uuid/src/Uuid.php +++ /dev/null @@ -1,758 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid; - -use BadMethodCallException; -use DateTimeInterface; -use Ramsey\Uuid\Codec\CodecInterface; -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Exception\UnsupportedOperationException; -use Ramsey\Uuid\Fields\FieldsInterface; -use Ramsey\Uuid\Lazy\LazyUuidFromString; -use Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface; -use Ramsey\Uuid\Type\Hexadecimal; -use Ramsey\Uuid\Type\Integer as IntegerObject; -use ValueError; - -use function assert; -use function bin2hex; -use function method_exists; -use function preg_match; -use function sprintf; -use function str_replace; -use function strcmp; -use function strlen; -use function strtolower; -use function substr; - -/** - * Uuid provides constants and static methods for working with and generating UUIDs - * - * @psalm-immutable - */ -class Uuid implements UuidInterface -{ - use DeprecatedUuidMethodsTrait; - - /** - * When this namespace is specified, the name string is a fully-qualified - * domain name - * - * @link http://tools.ietf.org/html/rfc4122#appendix-C RFC 4122, Appendix C: Some Name Space IDs - */ - public const NAMESPACE_DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; - - /** - * When this namespace is specified, the name string is a URL - * - * @link http://tools.ietf.org/html/rfc4122#appendix-C RFC 4122, Appendix C: Some Name Space IDs - */ - public const NAMESPACE_URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; - - /** - * When this namespace is specified, the name string is an ISO OID - * - * @link http://tools.ietf.org/html/rfc4122#appendix-C RFC 4122, Appendix C: Some Name Space IDs - */ - public const NAMESPACE_OID = '6ba7b812-9dad-11d1-80b4-00c04fd430c8'; - - /** - * When this namespace is specified, the name string is an X.500 DN in DER - * or a text output format - * - * @link http://tools.ietf.org/html/rfc4122#appendix-C RFC 4122, Appendix C: Some Name Space IDs - */ - public const NAMESPACE_X500 = '6ba7b814-9dad-11d1-80b4-00c04fd430c8'; - - /** - * The nil UUID is a special form of UUID that is specified to have all 128 - * bits set to zero - * - * @link http://tools.ietf.org/html/rfc4122#section-4.1.7 RFC 4122, § 4.1.7: Nil UUID - */ - public const NIL = '00000000-0000-0000-0000-000000000000'; - - /** - * The max UUID is a special form of UUID that is specified to have all 128 - * bits set to one - * - * @link https://datatracker.ietf.org/doc/html/draft-ietf-uuidrev-rfc4122bis-00#section-5.10 Max UUID - */ - public const MAX = 'ffffffff-ffff-ffff-ffff-ffffffffffff'; - - /** - * Variant: reserved, NCS backward compatibility - * - * @link http://tools.ietf.org/html/rfc4122#section-4.1.1 RFC 4122, § 4.1.1: Variant - */ - public const RESERVED_NCS = 0; - - /** - * Variant: the UUID layout specified in RFC 4122 - * - * @link http://tools.ietf.org/html/rfc4122#section-4.1.1 RFC 4122, § 4.1.1: Variant - */ - public const RFC_4122 = 2; - - /** - * Variant: reserved, Microsoft Corporation backward compatibility - * - * @link http://tools.ietf.org/html/rfc4122#section-4.1.1 RFC 4122, § 4.1.1: Variant - */ - public const RESERVED_MICROSOFT = 6; - - /** - * Variant: reserved for future definition - * - * @link http://tools.ietf.org/html/rfc4122#section-4.1.1 RFC 4122, § 4.1.1: Variant - */ - public const RESERVED_FUTURE = 7; - - /** - * @deprecated Use {@see ValidatorInterface::getPattern()} instead. - */ - public const VALID_PATTERN = '^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$'; - - /** - * Version 1 (Gregorian time) UUID - * - * @link https://tools.ietf.org/html/rfc4122#section-4.1.3 RFC 4122, § 4.1.3: Version - */ - public const UUID_TYPE_TIME = 1; - - /** - * Version 2 (DCE Security) UUID - * - * @link https://tools.ietf.org/html/rfc4122#section-4.1.3 RFC 4122, § 4.1.3: Version - */ - public const UUID_TYPE_DCE_SECURITY = 2; - - /** - * @deprecated Use {@see Uuid::UUID_TYPE_DCE_SECURITY} instead. - */ - public const UUID_TYPE_IDENTIFIER = 2; - - /** - * Version 3 (name-based and hashed with MD5) UUID - * - * @link https://tools.ietf.org/html/rfc4122#section-4.1.3 RFC 4122, § 4.1.3: Version - */ - public const UUID_TYPE_HASH_MD5 = 3; - - /** - * Version 4 (random) UUID - * - * @link https://tools.ietf.org/html/rfc4122#section-4.1.3 RFC 4122, § 4.1.3: Version - */ - public const UUID_TYPE_RANDOM = 4; - - /** - * Version 5 (name-based and hashed with SHA1) UUID - * - * @link https://tools.ietf.org/html/rfc4122#section-4.1.3 RFC 4122, § 4.1.3: Version - */ - public const UUID_TYPE_HASH_SHA1 = 5; - - /** - * @deprecated Use {@see Uuid::UUID_TYPE_REORDERED_TIME} instead. - */ - public const UUID_TYPE_PEABODY = 6; - - /** - * Version 6 (reordered time) UUID - * - * @link https://datatracker.ietf.org/doc/html/draft-ietf-uuidrev-rfc4122bis-00#section-5.6 UUID Version 6 - */ - public const UUID_TYPE_REORDERED_TIME = 6; - - /** - * Version 7 (Unix Epoch time) UUID - * - * @link https://datatracker.ietf.org/doc/html/draft-ietf-uuidrev-rfc4122bis-00#section-5.7 UUID Version 7 - */ - public const UUID_TYPE_UNIX_TIME = 7; - - /** - * @link https://datatracker.ietf.org/doc/html/draft-ietf-uuidrev-rfc4122bis-00#section-5.8 UUID Version 8 - */ - public const UUID_TYPE_CUSTOM = 8; - - /** - * DCE Security principal domain - * - * @link https://pubs.opengroup.org/onlinepubs/9696989899/chap11.htm#tagcjh_14_05_01_01 DCE 1.1, §11.5.1.1 - */ - public const DCE_DOMAIN_PERSON = 0; - - /** - * DCE Security group domain - * - * @link https://pubs.opengroup.org/onlinepubs/9696989899/chap11.htm#tagcjh_14_05_01_01 DCE 1.1, §11.5.1.1 - */ - public const DCE_DOMAIN_GROUP = 1; - - /** - * DCE Security organization domain - * - * @link https://pubs.opengroup.org/onlinepubs/9696989899/chap11.htm#tagcjh_14_05_01_01 DCE 1.1, §11.5.1.1 - */ - public const DCE_DOMAIN_ORG = 2; - - /** - * DCE Security domain string names - * - * @link https://pubs.opengroup.org/onlinepubs/9696989899/chap11.htm#tagcjh_14_05_01_01 DCE 1.1, §11.5.1.1 - */ - public const DCE_DOMAIN_NAMES = [ - self::DCE_DOMAIN_PERSON => 'person', - self::DCE_DOMAIN_GROUP => 'group', - self::DCE_DOMAIN_ORG => 'org', - ]; - - private static ?UuidFactoryInterface $factory = null; - - /** - * @var bool flag to detect if the UUID factory was replaced internally, - * which disables all optimizations for the default/happy path internal - * scenarios - */ - private static bool $factoryReplaced = false; - - protected CodecInterface $codec; - protected NumberConverterInterface $numberConverter; - protected Rfc4122FieldsInterface $fields; - protected TimeConverterInterface $timeConverter; - - /** - * Creates a universally unique identifier (UUID) from an array of fields - * - * Unless you're making advanced use of this library to generate identifiers - * that deviate from RFC 4122, you probably do not want to instantiate a - * UUID directly. Use the static methods, instead: - * - * ``` - * use Ramsey\Uuid\Uuid; - * - * $timeBasedUuid = Uuid::uuid1(); - * $namespaceMd5Uuid = Uuid::uuid3(Uuid::NAMESPACE_URL, 'http://php.net/'); - * $randomUuid = Uuid::uuid4(); - * $namespaceSha1Uuid = Uuid::uuid5(Uuid::NAMESPACE_URL, 'http://php.net/'); - * ``` - * - * @param Rfc4122FieldsInterface $fields The fields from which to construct a UUID - * @param NumberConverterInterface $numberConverter The number converter to use - * for converting hex values to/from integers - * @param CodecInterface $codec The codec to use when encoding or decoding - * UUID strings - * @param TimeConverterInterface $timeConverter The time converter to use - * for converting timestamps extracted from a UUID to unix timestamps - */ - public function __construct( - Rfc4122FieldsInterface $fields, - NumberConverterInterface $numberConverter, - CodecInterface $codec, - TimeConverterInterface $timeConverter - ) { - $this->fields = $fields; - $this->codec = $codec; - $this->numberConverter = $numberConverter; - $this->timeConverter = $timeConverter; - } - - /** - * @psalm-return non-empty-string - */ - public function __toString(): string - { - return $this->toString(); - } - - /** - * Converts the UUID to a string for JSON serialization - */ - public function jsonSerialize(): string - { - return $this->toString(); - } - - /** - * Converts the UUID to a string for PHP serialization - */ - public function serialize(): string - { - return $this->getFields()->getBytes(); - } - - /** - * @return array{bytes: string} - */ - public function __serialize(): array - { - return ['bytes' => $this->serialize()]; - } - - /** - * Re-constructs the object from its serialized form - * - * @param string $data The serialized PHP string to unserialize into - * a UuidInterface instance - */ - public function unserialize(string $data): void - { - if (strlen($data) === 16) { - /** @var Uuid $uuid */ - $uuid = self::getFactory()->fromBytes($data); - } else { - /** @var Uuid $uuid */ - $uuid = self::getFactory()->fromString($data); - } - - $this->codec = $uuid->codec; - $this->numberConverter = $uuid->numberConverter; - $this->fields = $uuid->fields; - $this->timeConverter = $uuid->timeConverter; - } - - /** - * @param array{bytes?: string} $data - */ - public function __unserialize(array $data): void - { - // @codeCoverageIgnoreStart - if (!isset($data['bytes'])) { - throw new ValueError(sprintf('%s(): Argument #1 ($data) is invalid', __METHOD__)); - } - // @codeCoverageIgnoreEnd - - $this->unserialize($data['bytes']); - } - - public function compareTo(UuidInterface $other): int - { - $compare = strcmp($this->toString(), $other->toString()); - - if ($compare < 0) { - return -1; - } - - if ($compare > 0) { - return 1; - } - - return 0; - } - - public function equals(?object $other): bool - { - if (!$other instanceof UuidInterface) { - return false; - } - - return $this->compareTo($other) === 0; - } - - /** - * @psalm-return non-empty-string - */ - public function getBytes(): string - { - return $this->codec->encodeBinary($this); - } - - public function getFields(): FieldsInterface - { - return $this->fields; - } - - public function getHex(): Hexadecimal - { - return new Hexadecimal(str_replace('-', '', $this->toString())); - } - - public function getInteger(): IntegerObject - { - return new IntegerObject($this->numberConverter->fromHex($this->getHex()->toString())); - } - - public function getUrn(): string - { - return 'urn:uuid:' . $this->toString(); - } - - /** - * @psalm-return non-empty-string - */ - public function toString(): string - { - return $this->codec->encode($this); - } - - /** - * Returns the factory used to create UUIDs - */ - public static function getFactory(): UuidFactoryInterface - { - if (self::$factory === null) { - self::$factory = new UuidFactory(); - } - - return self::$factory; - } - - /** - * Sets the factory used to create UUIDs - * - * @param UuidFactoryInterface $factory A factory that will be used by this - * class to create UUIDs - */ - public static function setFactory(UuidFactoryInterface $factory): void - { - // Note: non-strict equality is intentional here. If the factory is configured differently, every assumption - // around purity is broken, and we have to internally decide everything differently. - // phpcs:ignore SlevomatCodingStandard.Operators.DisallowEqualOperators.DisallowedNotEqualOperator - self::$factoryReplaced = ($factory != new UuidFactory()); - - self::$factory = $factory; - } - - /** - * Creates a UUID from a byte string - * - * @param string $bytes A binary string - * - * @return UuidInterface A UuidInterface instance created from a binary - * string representation - * - * @psalm-pure note: changing the internal factory is an edge case not covered by purity invariants, - * but under constant factory setups, this method operates in functionally pure manners - * - * @psalm-suppress ImpureStaticProperty we know that the factory being replaced can lead to massive - * havoc across all consumers: that should never happen, and - * is generally to be discouraged. Until the factory is kept - * un-replaced, this method is effectively pure. - */ - public static function fromBytes(string $bytes): UuidInterface - { - if (! self::$factoryReplaced && strlen($bytes) === 16) { - $base16Uuid = bin2hex($bytes); - - // Note: we are calling `fromString` internally because we don't know if the given `$bytes` is a valid UUID - return self::fromString( - substr($base16Uuid, 0, 8) - . '-' - . substr($base16Uuid, 8, 4) - . '-' - . substr($base16Uuid, 12, 4) - . '-' - . substr($base16Uuid, 16, 4) - . '-' - . substr($base16Uuid, 20, 12) - ); - } - - return self::getFactory()->fromBytes($bytes); - } - - /** - * Creates a UUID from the string standard representation - * - * @param string $uuid A hexadecimal string - * - * @return UuidInterface A UuidInterface instance created from a hexadecimal - * string representation - * - * @psalm-pure note: changing the internal factory is an edge case not covered by purity invariants, - * but under constant factory setups, this method operates in functionally pure manners - * - * @psalm-suppress ImpureStaticProperty we know that the factory being replaced can lead to massive - * havoc across all consumers: that should never happen, and - * is generally to be discouraged. Until the factory is kept - * un-replaced, this method is effectively pure. - */ - public static function fromString(string $uuid): UuidInterface - { - $uuid = strtolower($uuid); - if (! self::$factoryReplaced && preg_match(LazyUuidFromString::VALID_REGEX, $uuid) === 1) { - assert($uuid !== ''); - - return new LazyUuidFromString($uuid); - } - - return self::getFactory()->fromString($uuid); - } - - /** - * Creates a UUID from a DateTimeInterface instance - * - * @param DateTimeInterface $dateTime The date and time - * @param Hexadecimal|null $node A 48-bit number representing the hardware - * address - * @param int|null $clockSeq A 14-bit number used to help avoid duplicates - * that could arise when the clock is set backwards in time or if the - * node ID changes - * - * @return UuidInterface A UuidInterface instance that represents a - * version 1 UUID created from a DateTimeInterface instance - */ - public static function fromDateTime( - DateTimeInterface $dateTime, - ?Hexadecimal $node = null, - ?int $clockSeq = null - ): UuidInterface { - return self::getFactory()->fromDateTime($dateTime, $node, $clockSeq); - } - - /** - * Creates a UUID from the Hexadecimal object - * - * @param Hexadecimal $hex Hexadecimal object representing a hexadecimal number - * - * @return UuidInterface A UuidInterface instance created from the Hexadecimal - * object representing a hexadecimal number - * - * @psalm-pure note: changing the internal factory is an edge case not covered by purity invariants, - * but under constant factory setups, this method operates in functionally pure manners - * @psalm-suppress MixedInferredReturnType,MixedReturnStatement - */ - public static function fromHexadecimal(Hexadecimal $hex): UuidInterface - { - $factory = self::getFactory(); - - if (method_exists($factory, 'fromHexadecimal')) { - /** - * @phpstan-ignore-next-line - * @psalm-suppress UndefinedInterfaceMethod - */ - return self::getFactory()->fromHexadecimal($hex); - } - - throw new BadMethodCallException('The method fromHexadecimal() does not exist on the provided factory'); - } - - /** - * Creates a UUID from a 128-bit integer string - * - * @param string $integer String representation of 128-bit integer - * - * @return UuidInterface A UuidInterface instance created from the string - * representation of a 128-bit integer - * - * @psalm-pure note: changing the internal factory is an edge case not covered by purity invariants, - * but under constant factory setups, this method operates in functionally pure manners - */ - public static function fromInteger(string $integer): UuidInterface - { - /** @psalm-suppress ImpureMethodCall */ - return self::getFactory()->fromInteger($integer); - } - - /** - * Returns true if the provided string is a valid UUID - * - * @param string $uuid A string to validate as a UUID - * - * @return bool True if the string is a valid UUID, false otherwise - * - * @psalm-pure note: changing the internal factory is an edge case not covered by purity invariants, - * but under constant factory setups, this method operates in functionally pure manners - * - * @psalm-assert-if-true non-empty-string $uuid - */ - public static function isValid(string $uuid): bool - { - /** @psalm-suppress ImpureMethodCall */ - return self::getFactory()->getValidator()->validate($uuid); - } - - /** - * Returns a version 1 (Gregorian time) UUID from a host ID, sequence number, - * and the current time - * - * @param Hexadecimal|int|string|null $node A 48-bit number representing the - * hardware address; this number may be represented as an integer or a - * hexadecimal string - * @param int|null $clockSeq A 14-bit number used to help avoid duplicates that - * could arise when the clock is set backwards in time or if the node ID - * changes - * - * @return UuidInterface A UuidInterface instance that represents a - * version 1 UUID - */ - public static function uuid1($node = null, ?int $clockSeq = null): UuidInterface - { - return self::getFactory()->uuid1($node, $clockSeq); - } - - /** - * Returns a version 2 (DCE Security) UUID from a local domain, local - * identifier, host ID, clock sequence, and the current time - * - * @param int $localDomain The local domain to use when generating bytes, - * according to DCE Security - * @param IntegerObject|null $localIdentifier The local identifier for the - * given domain; this may be a UID or GID on POSIX systems, if the local - * domain is person or group, or it may be a site-defined identifier - * if the local domain is org - * @param Hexadecimal|null $node A 48-bit number representing the hardware - * address - * @param int|null $clockSeq A 14-bit number used to help avoid duplicates - * that could arise when the clock is set backwards in time or if the - * node ID changes (in a version 2 UUID, the lower 8 bits of this number - * are replaced with the domain). - * - * @return UuidInterface A UuidInterface instance that represents a - * version 2 UUID - */ - public static function uuid2( - int $localDomain, - ?IntegerObject $localIdentifier = null, - ?Hexadecimal $node = null, - ?int $clockSeq = null - ): UuidInterface { - return self::getFactory()->uuid2($localDomain, $localIdentifier, $node, $clockSeq); - } - - /** - * Returns a version 3 (name-based) UUID based on the MD5 hash of a - * namespace ID and a name - * - * @param string|UuidInterface $ns The namespace (must be a valid UUID) - * @param string $name The name to use for creating a UUID - * - * @return UuidInterface A UuidInterface instance that represents a - * version 3 UUID - * - * @psalm-suppress ImpureMethodCall we know that the factory being replaced can lead to massive - * havoc across all consumers: that should never happen, and - * is generally to be discouraged. Until the factory is kept - * un-replaced, this method is effectively pure. - * - * @psalm-pure note: changing the internal factory is an edge case not covered by purity invariants, - * but under constant factory setups, this method operates in functionally pure manners - */ - public static function uuid3($ns, string $name): UuidInterface - { - return self::getFactory()->uuid3($ns, $name); - } - - /** - * Returns a version 4 (random) UUID - * - * @return UuidInterface A UuidInterface instance that represents a - * version 4 UUID - */ - public static function uuid4(): UuidInterface - { - return self::getFactory()->uuid4(); - } - - /** - * Returns a version 5 (name-based) UUID based on the SHA-1 hash of a - * namespace ID and a name - * - * @param string|UuidInterface $ns The namespace (must be a valid UUID) - * @param string $name The name to use for creating a UUID - * - * @return UuidInterface A UuidInterface instance that represents a - * version 5 UUID - * - * @psalm-pure note: changing the internal factory is an edge case not covered by purity invariants, - * but under constant factory setups, this method operates in functionally pure manners - * - * @psalm-suppress ImpureMethodCall we know that the factory being replaced can lead to massive - * havoc across all consumers: that should never happen, and - * is generally to be discouraged. Until the factory is kept - * un-replaced, this method is effectively pure. - */ - public static function uuid5($ns, string $name): UuidInterface - { - return self::getFactory()->uuid5($ns, $name); - } - - /** - * Returns a version 6 (reordered time) UUID from a host ID, sequence number, - * and the current time - * - * @param Hexadecimal|null $node A 48-bit number representing the hardware - * address - * @param int|null $clockSeq A 14-bit number used to help avoid duplicates that - * could arise when the clock is set backwards in time or if the node ID - * changes - * - * @return UuidInterface A UuidInterface instance that represents a - * version 6 UUID - */ - public static function uuid6( - ?Hexadecimal $node = null, - ?int $clockSeq = null - ): UuidInterface { - return self::getFactory()->uuid6($node, $clockSeq); - } - - /** - * Returns a version 7 (Unix Epoch time) UUID - * - * @param DateTimeInterface|null $dateTime An optional date/time from which - * to create the version 7 UUID. If not provided, the UUID is generated - * using the current date/time. - * - * @return UuidInterface A UuidInterface instance that represents a - * version 7 UUID - */ - public static function uuid7(?DateTimeInterface $dateTime = null): UuidInterface - { - $factory = self::getFactory(); - - if (method_exists($factory, 'uuid7')) { - /** @var UuidInterface */ - return $factory->uuid7($dateTime); - } - - throw new UnsupportedOperationException( - 'The provided factory does not support the uuid7() method', - ); - } - - /** - * Returns a version 8 (custom) UUID - * - * The bytes provided may contain any value according to your application's - * needs. Be aware, however, that other applications may not understand the - * semantics of the value. - * - * @param string $bytes A 16-byte octet string. This is an open blob - * of data that you may fill with 128 bits of information. Be aware, - * however, bits 48 through 51 will be replaced with the UUID version - * field, and bits 64 and 65 will be replaced with the UUID variant. You - * MUST NOT rely on these bits for your application needs. - * - * @return UuidInterface A UuidInterface instance that represents a - * version 8 UUID - */ - public static function uuid8(string $bytes): UuidInterface - { - $factory = self::getFactory(); - - if (method_exists($factory, 'uuid8')) { - /** @var UuidInterface */ - return $factory->uuid8($bytes); - } - - throw new UnsupportedOperationException( - 'The provided factory does not support the uuid8() method', - ); - } -} diff --git a/vendor/ramsey/uuid/src/UuidFactory.php b/vendor/ramsey/uuid/src/UuidFactory.php deleted file mode 100644 index 1b06ea6e..00000000 --- a/vendor/ramsey/uuid/src/UuidFactory.php +++ /dev/null @@ -1,513 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid; - -use DateTimeInterface; -use Ramsey\Uuid\Builder\UuidBuilderInterface; -use Ramsey\Uuid\Codec\CodecInterface; -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Generator\DceSecurityGeneratorInterface; -use Ramsey\Uuid\Generator\DefaultTimeGenerator; -use Ramsey\Uuid\Generator\NameGeneratorInterface; -use Ramsey\Uuid\Generator\RandomGeneratorInterface; -use Ramsey\Uuid\Generator\TimeGeneratorInterface; -use Ramsey\Uuid\Generator\UnixTimeGenerator; -use Ramsey\Uuid\Lazy\LazyUuidFromString; -use Ramsey\Uuid\Provider\NodeProviderInterface; -use Ramsey\Uuid\Provider\Time\FixedTimeProvider; -use Ramsey\Uuid\Type\Hexadecimal; -use Ramsey\Uuid\Type\Integer as IntegerObject; -use Ramsey\Uuid\Type\Time; -use Ramsey\Uuid\Validator\ValidatorInterface; - -use function bin2hex; -use function hex2bin; -use function pack; -use function str_pad; -use function strtolower; -use function substr; -use function substr_replace; -use function unpack; - -use const STR_PAD_LEFT; - -class UuidFactory implements UuidFactoryInterface -{ - private CodecInterface $codec; - private DceSecurityGeneratorInterface $dceSecurityGenerator; - private NameGeneratorInterface $nameGenerator; - private NodeProviderInterface $nodeProvider; - private NumberConverterInterface $numberConverter; - private RandomGeneratorInterface $randomGenerator; - private TimeConverterInterface $timeConverter; - private TimeGeneratorInterface $timeGenerator; - private TimeGeneratorInterface $unixTimeGenerator; - private UuidBuilderInterface $uuidBuilder; - private ValidatorInterface $validator; - - /** - * @var bool whether the feature set was provided from outside, or we can - * operate under "default" assumptions - */ - private bool $isDefaultFeatureSet; - - /** - * @param FeatureSet|null $features A set of available features in the current environment - */ - public function __construct(?FeatureSet $features = null) - { - $this->isDefaultFeatureSet = $features === null; - - $features = $features ?: new FeatureSet(); - - $this->codec = $features->getCodec(); - $this->dceSecurityGenerator = $features->getDceSecurityGenerator(); - $this->nameGenerator = $features->getNameGenerator(); - $this->nodeProvider = $features->getNodeProvider(); - $this->numberConverter = $features->getNumberConverter(); - $this->randomGenerator = $features->getRandomGenerator(); - $this->timeConverter = $features->getTimeConverter(); - $this->timeGenerator = $features->getTimeGenerator(); - $this->uuidBuilder = $features->getBuilder(); - $this->validator = $features->getValidator(); - $this->unixTimeGenerator = $features->getUnixTimeGenerator(); - } - - /** - * Returns the codec used by this factory - */ - public function getCodec(): CodecInterface - { - return $this->codec; - } - - /** - * Sets the codec to use for this factory - * - * @param CodecInterface $codec A UUID encoder-decoder - */ - public function setCodec(CodecInterface $codec): void - { - $this->isDefaultFeatureSet = false; - - $this->codec = $codec; - } - - /** - * Returns the name generator used by this factory - */ - public function getNameGenerator(): NameGeneratorInterface - { - return $this->nameGenerator; - } - - /** - * Sets the name generator to use for this factory - * - * @param NameGeneratorInterface $nameGenerator A generator to generate - * binary data, based on a namespace and name - */ - public function setNameGenerator(NameGeneratorInterface $nameGenerator): void - { - $this->isDefaultFeatureSet = false; - - $this->nameGenerator = $nameGenerator; - } - - /** - * Returns the node provider used by this factory - */ - public function getNodeProvider(): NodeProviderInterface - { - return $this->nodeProvider; - } - - /** - * Returns the random generator used by this factory - */ - public function getRandomGenerator(): RandomGeneratorInterface - { - return $this->randomGenerator; - } - - /** - * Returns the time generator used by this factory - */ - public function getTimeGenerator(): TimeGeneratorInterface - { - return $this->timeGenerator; - } - - /** - * Sets the time generator to use for this factory - * - * @param TimeGeneratorInterface $generator A generator to generate binary - * data, based on the time - */ - public function setTimeGenerator(TimeGeneratorInterface $generator): void - { - $this->isDefaultFeatureSet = false; - - $this->timeGenerator = $generator; - } - - /** - * Returns the DCE Security generator used by this factory - */ - public function getDceSecurityGenerator(): DceSecurityGeneratorInterface - { - return $this->dceSecurityGenerator; - } - - /** - * Sets the DCE Security generator to use for this factory - * - * @param DceSecurityGeneratorInterface $generator A generator to generate - * binary data, based on a local domain and local identifier - */ - public function setDceSecurityGenerator(DceSecurityGeneratorInterface $generator): void - { - $this->isDefaultFeatureSet = false; - - $this->dceSecurityGenerator = $generator; - } - - /** - * Returns the number converter used by this factory - */ - public function getNumberConverter(): NumberConverterInterface - { - return $this->numberConverter; - } - - /** - * Sets the random generator to use for this factory - * - * @param RandomGeneratorInterface $generator A generator to generate binary - * data, based on some random input - */ - public function setRandomGenerator(RandomGeneratorInterface $generator): void - { - $this->isDefaultFeatureSet = false; - - $this->randomGenerator = $generator; - } - - /** - * Sets the number converter to use for this factory - * - * @param NumberConverterInterface $converter A converter to use for working - * with large integers (i.e. integers greater than PHP_INT_MAX) - */ - public function setNumberConverter(NumberConverterInterface $converter): void - { - $this->isDefaultFeatureSet = false; - - $this->numberConverter = $converter; - } - - /** - * Returns the UUID builder used by this factory - */ - public function getUuidBuilder(): UuidBuilderInterface - { - return $this->uuidBuilder; - } - - /** - * Sets the UUID builder to use for this factory - * - * @param UuidBuilderInterface $builder A builder for constructing instances - * of UuidInterface - */ - public function setUuidBuilder(UuidBuilderInterface $builder): void - { - $this->isDefaultFeatureSet = false; - - $this->uuidBuilder = $builder; - } - - /** - * @psalm-mutation-free - */ - public function getValidator(): ValidatorInterface - { - return $this->validator; - } - - /** - * Sets the validator to use for this factory - * - * @param ValidatorInterface $validator A validator to use for validating - * whether a string is a valid UUID - */ - public function setValidator(ValidatorInterface $validator): void - { - $this->isDefaultFeatureSet = false; - - $this->validator = $validator; - } - - /** - * @psalm-pure - */ - public function fromBytes(string $bytes): UuidInterface - { - return $this->codec->decodeBytes($bytes); - } - - /** - * @psalm-pure - */ - public function fromString(string $uuid): UuidInterface - { - $uuid = strtolower($uuid); - - return $this->codec->decode($uuid); - } - - /** - * @psalm-pure - */ - public function fromInteger(string $integer): UuidInterface - { - $hex = $this->numberConverter->toHex($integer); - $hex = str_pad($hex, 32, '0', STR_PAD_LEFT); - - return $this->fromString($hex); - } - - public function fromDateTime( - DateTimeInterface $dateTime, - ?Hexadecimal $node = null, - ?int $clockSeq = null - ): UuidInterface { - $timeProvider = new FixedTimeProvider( - new Time($dateTime->format('U'), $dateTime->format('u')) - ); - - $timeGenerator = new DefaultTimeGenerator( - $this->nodeProvider, - $this->timeConverter, - $timeProvider - ); - - $nodeHex = $node ? $node->toString() : null; - - $bytes = $timeGenerator->generate($nodeHex, $clockSeq); - - return $this->uuidFromBytesAndVersion($bytes, Uuid::UUID_TYPE_TIME); - } - - /** - * @psalm-pure - */ - public function fromHexadecimal(Hexadecimal $hex): UuidInterface - { - return $this->codec->decode($hex->__toString()); - } - - /** - * @inheritDoc - */ - public function uuid1($node = null, ?int $clockSeq = null): UuidInterface - { - $bytes = $this->timeGenerator->generate($node, $clockSeq); - - return $this->uuidFromBytesAndVersion($bytes, Uuid::UUID_TYPE_TIME); - } - - public function uuid2( - int $localDomain, - ?IntegerObject $localIdentifier = null, - ?Hexadecimal $node = null, - ?int $clockSeq = null - ): UuidInterface { - $bytes = $this->dceSecurityGenerator->generate( - $localDomain, - $localIdentifier, - $node, - $clockSeq - ); - - return $this->uuidFromBytesAndVersion($bytes, Uuid::UUID_TYPE_DCE_SECURITY); - } - - /** - * @inheritDoc - * @psalm-pure - */ - public function uuid3($ns, string $name): UuidInterface - { - return $this->uuidFromNsAndName($ns, $name, Uuid::UUID_TYPE_HASH_MD5, 'md5'); - } - - public function uuid4(): UuidInterface - { - $bytes = $this->randomGenerator->generate(16); - - return $this->uuidFromBytesAndVersion($bytes, Uuid::UUID_TYPE_RANDOM); - } - - /** - * @inheritDoc - * @psalm-pure - */ - public function uuid5($ns, string $name): UuidInterface - { - return $this->uuidFromNsAndName($ns, $name, Uuid::UUID_TYPE_HASH_SHA1, 'sha1'); - } - - public function uuid6(?Hexadecimal $node = null, ?int $clockSeq = null): UuidInterface - { - $nodeHex = $node ? $node->toString() : null; - $bytes = $this->timeGenerator->generate($nodeHex, $clockSeq); - - // Rearrange the bytes, according to the UUID version 6 specification. - $v6 = $bytes[6] . $bytes[7] . $bytes[4] . $bytes[5] - . $bytes[0] . $bytes[1] . $bytes[2] . $bytes[3]; - $v6 = bin2hex($v6); - - // Drop the first four bits, while adding an empty four bits for the - // version field. This allows us to reconstruct the correct time from - // the bytes of this UUID. - $v6Bytes = hex2bin(substr($v6, 1, 12) . '0' . substr($v6, -3)); - $v6Bytes .= substr($bytes, 8); - - return $this->uuidFromBytesAndVersion($v6Bytes, Uuid::UUID_TYPE_REORDERED_TIME); - } - - /** - * Returns a version 7 (Unix Epoch time) UUID - * - * @param DateTimeInterface|null $dateTime An optional date/time from which - * to create the version 7 UUID. If not provided, the UUID is generated - * using the current date/time. - * - * @return UuidInterface A UuidInterface instance that represents a - * version 7 UUID - */ - public function uuid7(?DateTimeInterface $dateTime = null): UuidInterface - { - assert($this->unixTimeGenerator instanceof UnixTimeGenerator); - $bytes = $this->unixTimeGenerator->generate(null, null, $dateTime); - - return $this->uuidFromBytesAndVersion($bytes, Uuid::UUID_TYPE_UNIX_TIME); - } - - /** - * Returns a version 8 (Custom) UUID - * - * The bytes provided may contain any value according to your application's - * needs. Be aware, however, that other applications may not understand the - * semantics of the value. - * - * @param string $bytes A 16-byte octet string. This is an open blob - * of data that you may fill with 128 bits of information. Be aware, - * however, bits 48 through 51 will be replaced with the UUID version - * field, and bits 64 and 65 will be replaced with the UUID variant. You - * MUST NOT rely on these bits for your application needs. - * - * @return UuidInterface A UuidInterface instance that represents a - * version 8 UUID - */ - public function uuid8(string $bytes): UuidInterface - { - return $this->uuidFromBytesAndVersion($bytes, Uuid::UUID_TYPE_CUSTOM); - } - - /** - * Returns a Uuid created from the provided byte string - * - * Uses the configured builder and codec and the provided byte string to - * construct a Uuid object. - * - * @param string $bytes The byte string from which to construct a UUID - * - * @return UuidInterface An instance of UuidInterface, created from the - * provided bytes - * - * @psalm-pure - */ - public function uuid(string $bytes): UuidInterface - { - /** @psalm-suppress ImpurePropertyFetch */ - return $this->uuidBuilder->build($this->codec, $bytes); - } - - /** - * Returns a version 3 or 5 namespaced Uuid - * - * @param string|UuidInterface $ns The namespace (must be a valid UUID) - * @param string $name The name to hash together with the namespace - * @param int $version The version of UUID to create (3 or 5) - * @param string $hashAlgorithm The hashing algorithm to use when hashing - * together the namespace and name - * - * @return UuidInterface An instance of UuidInterface, created by hashing - * together the provided namespace and name - * - * @psalm-pure - */ - private function uuidFromNsAndName( - UuidInterface | string $ns, - string $name, - int $version, - string $hashAlgorithm - ): UuidInterface { - if (!($ns instanceof UuidInterface)) { - $ns = $this->fromString($ns); - } - - $bytes = $this->nameGenerator->generate($ns, $name, $hashAlgorithm); - - return $this->uuidFromBytesAndVersion(substr($bytes, 0, 16), $version); - } - - /** - * Returns an RFC 4122 variant Uuid, created from the provided bytes and version - * - * @param string $bytes The byte string to convert to a UUID - * @param int $version The RFC 4122 version to apply to the UUID - * - * @return UuidInterface An instance of UuidInterface, created from the - * byte string and version - * - * @psalm-pure - */ - private function uuidFromBytesAndVersion(string $bytes, int $version): UuidInterface - { - /** @var array $unpackedTime */ - $unpackedTime = unpack('n*', substr($bytes, 6, 2)); - $timeHi = (int) $unpackedTime[1]; - $timeHiAndVersion = pack('n*', BinaryUtils::applyVersion($timeHi, $version)); - - /** @var array $unpackedClockSeq */ - $unpackedClockSeq = unpack('n*', substr($bytes, 8, 2)); - $clockSeqHi = (int) $unpackedClockSeq[1]; - $clockSeqHiAndReserved = pack('n*', BinaryUtils::applyVariant($clockSeqHi)); - - $bytes = substr_replace($bytes, $timeHiAndVersion, 6, 2); - $bytes = substr_replace($bytes, $clockSeqHiAndReserved, 8, 2); - - if ($this->isDefaultFeatureSet) { - return LazyUuidFromString::fromBytes($bytes); - } - - /** @psalm-suppress ImpureVariable */ - return $this->uuid($bytes); - } -} diff --git a/vendor/ramsey/uuid/src/UuidFactoryInterface.php b/vendor/ramsey/uuid/src/UuidFactoryInterface.php deleted file mode 100644 index d99fc9d5..00000000 --- a/vendor/ramsey/uuid/src/UuidFactoryInterface.php +++ /dev/null @@ -1,182 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid; - -use DateTimeInterface; -use Ramsey\Uuid\Type\Hexadecimal; -use Ramsey\Uuid\Type\Integer as IntegerObject; -use Ramsey\Uuid\Validator\ValidatorInterface; - -/** - * UuidFactoryInterface defines common functionality all `UuidFactory` instances - * must implement - */ -interface UuidFactoryInterface -{ - /** - * Creates a UUID from a byte string - * - * @param string $bytes A binary string - * - * @return UuidInterface A UuidInterface instance created from a binary - * string representation - * - * @psalm-pure - */ - public function fromBytes(string $bytes): UuidInterface; - - /** - * Creates a UUID from a DateTimeInterface instance - * - * @param DateTimeInterface $dateTime The date and time - * @param Hexadecimal|null $node A 48-bit number representing the hardware - * address - * @param int|null $clockSeq A 14-bit number used to help avoid duplicates - * that could arise when the clock is set backwards in time or if the - * node ID changes - * - * @return UuidInterface A UuidInterface instance that represents a - * version 1 UUID created from a DateTimeInterface instance - */ - public function fromDateTime( - DateTimeInterface $dateTime, - ?Hexadecimal $node = null, - ?int $clockSeq = null - ): UuidInterface; - - /** - * Creates a UUID from a 128-bit integer string - * - * @param string $integer String representation of 128-bit integer - * - * @return UuidInterface A UuidInterface instance created from the string - * representation of a 128-bit integer - * - * @psalm-pure - */ - public function fromInteger(string $integer): UuidInterface; - - /** - * Creates a UUID from the string standard representation - * - * @param string $uuid A hexadecimal string - * - * @return UuidInterface A UuidInterface instance created from a hexadecimal - * string representation - * - * @psalm-pure - */ - public function fromString(string $uuid): UuidInterface; - - /** - * Returns the validator to use for the factory - * - * @psalm-mutation-free - */ - public function getValidator(): ValidatorInterface; - - /** - * Returns a version 1 (Gregorian time) UUID from a host ID, sequence number, - * and the current time - * - * @param Hexadecimal|int|string|null $node A 48-bit number representing the - * hardware address; this number may be represented as an integer or a - * hexadecimal string - * @param int|null $clockSeq A 14-bit number used to help avoid duplicates - * that could arise when the clock is set backwards in time or if the - * node ID changes - * - * @return UuidInterface A UuidInterface instance that represents a - * version 1 UUID - */ - public function uuid1($node = null, ?int $clockSeq = null): UuidInterface; - - /** - * Returns a version 2 (DCE Security) UUID from a local domain, local - * identifier, host ID, clock sequence, and the current time - * - * @param int $localDomain The local domain to use when generating bytes, - * according to DCE Security - * @param IntegerObject|null $localIdentifier The local identifier for the - * given domain; this may be a UID or GID on POSIX systems, if the local - * domain is person or group, or it may be a site-defined identifier - * if the local domain is org - * @param Hexadecimal|null $node A 48-bit number representing the hardware - * address - * @param int|null $clockSeq A 14-bit number used to help avoid duplicates - * that could arise when the clock is set backwards in time or if the - * node ID changes - * - * @return UuidInterface A UuidInterface instance that represents a - * version 2 UUID - */ - public function uuid2( - int $localDomain, - ?IntegerObject $localIdentifier = null, - ?Hexadecimal $node = null, - ?int $clockSeq = null - ): UuidInterface; - - /** - * Returns a version 3 (name-based) UUID based on the MD5 hash of a - * namespace ID and a name - * - * @param string|UuidInterface $ns The namespace (must be a valid UUID) - * @param string $name The name to use for creating a UUID - * - * @return UuidInterface A UuidInterface instance that represents a - * version 3 UUID - * - * @psalm-pure - */ - public function uuid3($ns, string $name): UuidInterface; - - /** - * Returns a version 4 (random) UUID - * - * @return UuidInterface A UuidInterface instance that represents a - * version 4 UUID - */ - public function uuid4(): UuidInterface; - - /** - * Returns a version 5 (name-based) UUID based on the SHA-1 hash of a - * namespace ID and a name - * - * @param string|UuidInterface $ns The namespace (must be a valid UUID) - * @param string $name The name to use for creating a UUID - * - * @return UuidInterface A UuidInterface instance that represents a - * version 5 UUID - * - * @psalm-pure - */ - public function uuid5($ns, string $name): UuidInterface; - - /** - * Returns a version 6 (reordered time) UUID from a host ID, sequence number, - * and the current time - * - * @param Hexadecimal|null $node A 48-bit number representing the hardware - * address - * @param int|null $clockSeq A 14-bit number used to help avoid duplicates - * that could arise when the clock is set backwards in time or if the - * node ID changes - * - * @return UuidInterface A UuidInterface instance that represents a - * version 6 UUID - */ - public function uuid6(?Hexadecimal $node = null, ?int $clockSeq = null): UuidInterface; -} diff --git a/vendor/ramsey/uuid/src/UuidInterface.php b/vendor/ramsey/uuid/src/UuidInterface.php deleted file mode 100644 index 5f41675b..00000000 --- a/vendor/ramsey/uuid/src/UuidInterface.php +++ /dev/null @@ -1,107 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid; - -use JsonSerializable; -use Ramsey\Uuid\Fields\FieldsInterface; -use Ramsey\Uuid\Type\Hexadecimal; -use Ramsey\Uuid\Type\Integer as IntegerObject; -use Serializable; - -/** - * A UUID is a universally unique identifier adhering to an agreed-upon - * representation format and standard for generation - * - * @psalm-immutable - */ -interface UuidInterface extends - DeprecatedUuidInterface, - JsonSerializable, - Serializable -{ - /** - * Returns -1, 0, or 1 if the UUID is less than, equal to, or greater than - * the other UUID - * - * The first of two UUIDs is greater than the second if the most - * significant field in which the UUIDs differ is greater for the first - * UUID. - * - * * Q. What's the value of being able to sort UUIDs? - * * A. Use them as keys in a B-Tree or similar mapping. - * - * @param UuidInterface $other The UUID to compare - * - * @return int -1, 0, or 1 if the UUID is less than, equal to, or greater than $other - */ - public function compareTo(UuidInterface $other): int; - - /** - * Returns true if the UUID is equal to the provided object - * - * The result is true if and only if the argument is not null, is a UUID - * object, has the same variant, and contains the same value, bit for bit, - * as the UUID. - * - * @param object|null $other An object to test for equality with this UUID - * - * @return bool True if the other object is equal to this UUID - */ - public function equals(?object $other): bool; - - /** - * Returns the binary string representation of the UUID - * - * @psalm-return non-empty-string - */ - public function getBytes(): string; - - /** - * Returns the fields that comprise this UUID - */ - public function getFields(): FieldsInterface; - - /** - * Returns the hexadecimal representation of the UUID - */ - public function getHex(): Hexadecimal; - - /** - * Returns the integer representation of the UUID - */ - public function getInteger(): IntegerObject; - - /** - * Returns the string standard representation of the UUID as a URN - * - * @link http://en.wikipedia.org/wiki/Uniform_Resource_Name Uniform Resource Name - * @link https://tools.ietf.org/html/rfc4122#section-3 RFC 4122, § 3: Namespace Registration Template - */ - public function getUrn(): string; - - /** - * Returns the string standard representation of the UUID - * - * @psalm-return non-empty-string - */ - public function toString(): string; - - /** - * Casts the UUID to the string standard representation - * - * @psalm-return non-empty-string - */ - public function __toString(): string; -} diff --git a/vendor/ramsey/uuid/src/Validator/GenericValidator.php b/vendor/ramsey/uuid/src/Validator/GenericValidator.php deleted file mode 100644 index fd609551..00000000 --- a/vendor/ramsey/uuid/src/Validator/GenericValidator.php +++ /dev/null @@ -1,50 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Validator; - -use Ramsey\Uuid\Uuid; - -use function preg_match; -use function str_replace; - -/** - * GenericValidator validates strings as UUIDs of any variant - * - * @psalm-immutable - */ -final class GenericValidator implements ValidatorInterface -{ - /** - * Regular expression pattern for matching a UUID of any variant. - */ - private const VALID_PATTERN = '\A[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}\z'; - - /** - * @psalm-return non-empty-string - * @psalm-suppress MoreSpecificReturnType we know that the retrieved `string` is never empty - * @psalm-suppress LessSpecificReturnStatement we know that the retrieved `string` is never empty - */ - public function getPattern(): string - { - return self::VALID_PATTERN; - } - - public function validate(string $uuid): bool - { - $uuid = str_replace(['urn:', 'uuid:', 'URN:', 'UUID:', '{', '}'], '', $uuid); - - return $uuid === Uuid::NIL || preg_match('/' . self::VALID_PATTERN . '/Dms', $uuid); - } -} diff --git a/vendor/ramsey/uuid/src/Validator/ValidatorInterface.php b/vendor/ramsey/uuid/src/Validator/ValidatorInterface.php deleted file mode 100644 index 3d4bd6f2..00000000 --- a/vendor/ramsey/uuid/src/Validator/ValidatorInterface.php +++ /dev/null @@ -1,41 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Validator; - -/** - * A validator validates a string as a proper UUID - * - * @psalm-immutable - */ -interface ValidatorInterface -{ - /** - * Returns the regular expression pattern used by this validator - * - * @return string The regular expression pattern this validator uses - * - * @psalm-return non-empty-string - */ - public function getPattern(): string; - - /** - * Returns true if the provided string represents a UUID - * - * @param string $uuid The string to validate as a UUID - * - * @return bool True if the string is a valid UUID, false otherwise - */ - public function validate(string $uuid): bool; -} diff --git a/vendor/ramsey/uuid/src/functions.php b/vendor/ramsey/uuid/src/functions.php deleted file mode 100644 index 2adf214c..00000000 --- a/vendor/ramsey/uuid/src/functions.php +++ /dev/null @@ -1,158 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - * phpcs:disable Squiz.Functions.GlobalFunction - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid; - -use DateTimeInterface; -use Ramsey\Uuid\Type\Hexadecimal; -use Ramsey\Uuid\Type\Integer as IntegerObject; - -/** - * Returns a version 1 (Gregorian time) UUID from a host ID, sequence number, - * and the current time - * - * @param Hexadecimal|int|string|null $node A 48-bit number representing the - * hardware address; this number may be represented as an integer or a - * hexadecimal string - * @param int|null $clockSeq A 14-bit number used to help avoid duplicates that - * could arise when the clock is set backwards in time or if the node ID - * changes - * - * @return non-empty-string Version 1 UUID as a string - */ -function v1($node = null, ?int $clockSeq = null): string -{ - return Uuid::uuid1($node, $clockSeq)->toString(); -} - -/** - * Returns a version 2 (DCE Security) UUID from a local domain, local - * identifier, host ID, clock sequence, and the current time - * - * @param int $localDomain The local domain to use when generating bytes, - * according to DCE Security - * @param IntegerObject|null $localIdentifier The local identifier for the - * given domain; this may be a UID or GID on POSIX systems, if the local - * domain is person or group, or it may be a site-defined identifier - * if the local domain is org - * @param Hexadecimal|null $node A 48-bit number representing the hardware - * address - * @param int|null $clockSeq A 14-bit number used to help avoid duplicates - * that could arise when the clock is set backwards in time or if the - * node ID changes - * - * @return non-empty-string Version 2 UUID as a string - */ -function v2( - int $localDomain, - ?IntegerObject $localIdentifier = null, - ?Hexadecimal $node = null, - ?int $clockSeq = null -): string { - return Uuid::uuid2($localDomain, $localIdentifier, $node, $clockSeq)->toString(); -} - -/** - * Returns a version 3 (name-based) UUID based on the MD5 hash of a - * namespace ID and a name - * - * @param string|UuidInterface $ns The namespace (must be a valid UUID) - * - * @return non-empty-string Version 3 UUID as a string - * - * @psalm-pure note: changing the internal factory is an edge case not covered by purity invariants, - * but under constant factory setups, this method operates in functionally pure manners - */ -function v3($ns, string $name): string -{ - return Uuid::uuid3($ns, $name)->toString(); -} - -/** - * Returns a version 4 (random) UUID - * - * @return non-empty-string Version 4 UUID as a string - */ -function v4(): string -{ - return Uuid::uuid4()->toString(); -} - -/** - * Returns a version 5 (name-based) UUID based on the SHA-1 hash of a - * namespace ID and a name - * - * @param string|UuidInterface $ns The namespace (must be a valid UUID) - * - * @return non-empty-string Version 5 UUID as a string - * - * @psalm-pure note: changing the internal factory is an edge case not covered by purity invariants, - * but under constant factory setups, this method operates in functionally pure manners - */ -function v5($ns, string $name): string -{ - return Uuid::uuid5($ns, $name)->toString(); -} - -/** - * Returns a version 6 (reordered time) UUID from a host ID, sequence number, - * and the current time - * - * @param Hexadecimal|null $node A 48-bit number representing the hardware - * address - * @param int|null $clockSeq A 14-bit number used to help avoid duplicates that - * could arise when the clock is set backwards in time or if the node ID - * changes - * - * @return non-empty-string Version 6 UUID as a string - */ -function v6(?Hexadecimal $node = null, ?int $clockSeq = null): string -{ - return Uuid::uuid6($node, $clockSeq)->toString(); -} - -/** - * Returns a version 7 (Unix Epoch time) UUID - * - * @param DateTimeInterface|null $dateTime An optional date/time from which - * to create the version 7 UUID. If not provided, the UUID is generated - * using the current date/time. - * - * @return non-empty-string Version 7 UUID as a string - */ -function v7(?DateTimeInterface $dateTime = null): string -{ - return Uuid::uuid7($dateTime)->toString(); -} - -/** - * Returns a version 8 (custom) UUID - * - * The bytes provided may contain any value according to your application's - * needs. Be aware, however, that other applications may not understand the - * semantics of the value. - * - * @param string $bytes A 16-byte octet string. This is an open blob - * of data that you may fill with 128 bits of information. Be aware, - * however, bits 48 through 51 will be replaced with the UUID version - * field, and bits 64 and 65 will be replaced with the UUID variant. You - * MUST NOT rely on these bits for your application needs. - * - * @return non-empty-string Version 7 UUID as a string - */ -function v8(string $bytes): string -{ - return Uuid::uuid8($bytes)->toString(); -} diff --git a/vendor/sebastian/cli-parser/ChangeLog.md b/vendor/sebastian/cli-parser/ChangeLog.md deleted file mode 100644 index 9431ec59..00000000 --- a/vendor/sebastian/cli-parser/ChangeLog.md +++ /dev/null @@ -1,15 +0,0 @@ -# ChangeLog - -All notable changes are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. - -## [1.0.1] - 2020-09-28 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.3 || ^8.0` to `>=7.3` - -## [1.0.0] - 2020-08-12 - -* Initial release - -[1.0.0]: https://github.com/sebastianbergmann/cli-parser/compare/bb7bb3297957927962b0a3335befe7b66f7462e9...1.0.0 diff --git a/vendor/sebastian/cli-parser/LICENSE b/vendor/sebastian/cli-parser/LICENSE deleted file mode 100644 index 0e33c059..00000000 --- a/vendor/sebastian/cli-parser/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -sebastian/cli-parser - -Copyright (c) 2020, Sebastian Bergmann . -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 Sebastian Bergmann nor the names of his - 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/sebastian/cli-parser/README.md b/vendor/sebastian/cli-parser/README.md deleted file mode 100644 index 39c17a72..00000000 --- a/vendor/sebastian/cli-parser/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# sebastian/cli-parser - -Library for parsing `$_SERVER['argv']`, extracted from `phpunit/phpunit`. - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - -``` -composer require sebastian/cli-parser -``` - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - -``` -composer require --dev sebastian/cli-parser -``` diff --git a/vendor/sebastian/cli-parser/composer.json b/vendor/sebastian/cli-parser/composer.json deleted file mode 100644 index 34c376f9..00000000 --- a/vendor/sebastian/cli-parser/composer.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "sebastian/cli-parser", - "description": "Library for parsing CLI options", - "type": "library", - "homepage": "https://github.com/sebastianbergmann/cli-parser", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "support": { - "issues": "https://github.com/sebastianbergmann/cli-parser/issues" - }, - "prefer-stable": true, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "config": { - "platform": { - "php": "7.3.0" - }, - "optimize-autoloader": true, - "sort-packages": true - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - } -} diff --git a/vendor/sebastian/cli-parser/infection.json b/vendor/sebastian/cli-parser/infection.json deleted file mode 100644 index 09546514..00000000 --- a/vendor/sebastian/cli-parser/infection.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "source": { - "directories": [ - "src" - ] - }, - "mutators": { - "@default": true - }, - "minMsi": 100, - "minCoveredMsi": 100 -} diff --git a/vendor/sebastian/cli-parser/src/Parser.php b/vendor/sebastian/cli-parser/src/Parser.php deleted file mode 100644 index a4f728bc..00000000 --- a/vendor/sebastian/cli-parser/src/Parser.php +++ /dev/null @@ -1,204 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CliParser; - -use function array_map; -use function array_merge; -use function array_shift; -use function array_slice; -use function assert; -use function count; -use function current; -use function explode; -use function is_array; -use function is_int; -use function is_string; -use function key; -use function next; -use function preg_replace; -use function reset; -use function sort; -use function strlen; -use function strpos; -use function strstr; -use function substr; - -final class Parser -{ - /** - * @psalm-param list $argv - * @psalm-param list $longOptions - * - * @throws AmbiguousOptionException - * @throws RequiredOptionArgumentMissingException - * @throws OptionDoesNotAllowArgumentException - * @throws UnknownOptionException - */ - public function parse(array $argv, string $shortOptions, array $longOptions = null): array - { - if (empty($argv)) { - return [[], []]; - } - - $options = []; - $nonOptions = []; - - if ($longOptions) { - sort($longOptions); - } - - if (isset($argv[0][0]) && $argv[0][0] !== '-') { - array_shift($argv); - } - - reset($argv); - - $argv = array_map('trim', $argv); - - while (false !== $arg = current($argv)) { - $i = key($argv); - - assert(is_int($i)); - - next($argv); - - if ($arg === '') { - continue; - } - - if ($arg === '--') { - $nonOptions = array_merge($nonOptions, array_slice($argv, $i + 1)); - - break; - } - - if ($arg[0] !== '-' || (strlen($arg) > 1 && $arg[1] === '-' && !$longOptions)) { - $nonOptions[] = $arg; - - continue; - } - - if (strlen($arg) > 1 && $arg[1] === '-' && is_array($longOptions)) { - $this->parseLongOption( - substr($arg, 2), - $longOptions, - $options, - $argv - ); - } else { - $this->parseShortOption( - substr($arg, 1), - $shortOptions, - $options, - $argv - ); - } - } - - return [$options, $nonOptions]; - } - - /** - * @throws RequiredOptionArgumentMissingException - */ - private function parseShortOption(string $arg, string $shortOptions, array &$opts, array &$args): void - { - $argLength = strlen($arg); - - for ($i = 0; $i < $argLength; $i++) { - $option = $arg[$i]; - $optionArgument = null; - - if ($arg[$i] === ':' || ($spec = strstr($shortOptions, $option)) === false) { - throw new UnknownOptionException('-' . $option); - } - - assert(is_string($spec)); - - if (strlen($spec) > 1 && $spec[1] === ':') { - if ($i + 1 < $argLength) { - $opts[] = [$option, substr($arg, $i + 1)]; - - break; - } - - if (!(strlen($spec) > 2 && $spec[2] === ':')) { - $optionArgument = current($args); - - if (!$optionArgument) { - throw new RequiredOptionArgumentMissingException('-' . $option); - } - - assert(is_string($optionArgument)); - - next($args); - } - } - - $opts[] = [$option, $optionArgument]; - } - } - - /** - * @psalm-param list $longOptions - * - * @throws AmbiguousOptionException - * @throws RequiredOptionArgumentMissingException - * @throws OptionDoesNotAllowArgumentException - * @throws UnknownOptionException - */ - private function parseLongOption(string $arg, array $longOptions, array &$opts, array &$args): void - { - $count = count($longOptions); - $list = explode('=', $arg); - $option = $list[0]; - $optionArgument = null; - - if (count($list) > 1) { - $optionArgument = $list[1]; - } - - $optionLength = strlen($option); - - foreach ($longOptions as $i => $longOption) { - $opt_start = substr($longOption, 0, $optionLength); - - if ($opt_start !== $option) { - continue; - } - - $opt_rest = substr($longOption, $optionLength); - - if ($opt_rest !== '' && $i + 1 < $count && $option[0] !== '=' && strpos($longOptions[$i + 1], $option) === 0) { - throw new AmbiguousOptionException('--' . $option); - } - - if (substr($longOption, -1) === '=') { - /* @noinspection StrlenInEmptyStringCheckContextInspection */ - if (substr($longOption, -2) !== '==' && !strlen((string) $optionArgument)) { - if (false === $optionArgument = current($args)) { - throw new RequiredOptionArgumentMissingException('--' . $option); - } - - next($args); - } - } elseif ($optionArgument) { - throw new OptionDoesNotAllowArgumentException('--' . $option); - } - - $fullOption = '--' . preg_replace('/={1,2}$/', '', $longOption); - $opts[] = [$fullOption, $optionArgument]; - - return; - } - - throw new UnknownOptionException('--' . $option); - } -} diff --git a/vendor/sebastian/cli-parser/src/exceptions/AmbiguousOptionException.php b/vendor/sebastian/cli-parser/src/exceptions/AmbiguousOptionException.php deleted file mode 100644 index a99f6369..00000000 --- a/vendor/sebastian/cli-parser/src/exceptions/AmbiguousOptionException.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 SebastianBergmann\CliParser; - -use function sprintf; -use RuntimeException; - -final class AmbiguousOptionException extends RuntimeException implements Exception -{ - public function __construct(string $option) - { - parent::__construct( - sprintf( - 'Option "%s" is ambiguous', - $option - ) - ); - } -} diff --git a/vendor/sebastian/cli-parser/src/exceptions/Exception.php b/vendor/sebastian/cli-parser/src/exceptions/Exception.php deleted file mode 100644 index f35ad245..00000000 --- a/vendor/sebastian/cli-parser/src/exceptions/Exception.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. - */ -namespace SebastianBergmann\CliParser; - -use Throwable; - -interface Exception extends Throwable -{ -} diff --git a/vendor/sebastian/cli-parser/src/exceptions/OptionDoesNotAllowArgumentException.php b/vendor/sebastian/cli-parser/src/exceptions/OptionDoesNotAllowArgumentException.php deleted file mode 100644 index 0aad29ac..00000000 --- a/vendor/sebastian/cli-parser/src/exceptions/OptionDoesNotAllowArgumentException.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 SebastianBergmann\CliParser; - -use function sprintf; -use RuntimeException; - -final class OptionDoesNotAllowArgumentException extends RuntimeException implements Exception -{ - public function __construct(string $option) - { - parent::__construct( - sprintf( - 'Option "%s" does not allow an argument', - $option - ) - ); - } -} diff --git a/vendor/sebastian/cli-parser/src/exceptions/RequiredOptionArgumentMissingException.php b/vendor/sebastian/cli-parser/src/exceptions/RequiredOptionArgumentMissingException.php deleted file mode 100644 index d2a930b6..00000000 --- a/vendor/sebastian/cli-parser/src/exceptions/RequiredOptionArgumentMissingException.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 SebastianBergmann\CliParser; - -use function sprintf; -use RuntimeException; - -final class RequiredOptionArgumentMissingException extends RuntimeException implements Exception -{ - public function __construct(string $option) - { - parent::__construct( - sprintf( - 'Required argument for option "%s" is missing', - $option - ) - ); - } -} diff --git a/vendor/sebastian/cli-parser/src/exceptions/UnknownOptionException.php b/vendor/sebastian/cli-parser/src/exceptions/UnknownOptionException.php deleted file mode 100644 index e98d9fd0..00000000 --- a/vendor/sebastian/cli-parser/src/exceptions/UnknownOptionException.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 SebastianBergmann\CliParser; - -use function sprintf; -use RuntimeException; - -final class UnknownOptionException extends RuntimeException implements Exception -{ - public function __construct(string $option) - { - parent::__construct( - sprintf( - 'Unknown option "%s"', - $option - ) - ); - } -} diff --git a/vendor/sebastian/code-unit-reverse-lookup/ChangeLog.md b/vendor/sebastian/code-unit-reverse-lookup/ChangeLog.md deleted file mode 100644 index 43a5db90..00000000 --- a/vendor/sebastian/code-unit-reverse-lookup/ChangeLog.md +++ /dev/null @@ -1,38 +0,0 @@ -# Change Log - -All notable changes to `sebastianbergmann/code-unit-reverse-lookup` are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. - -## [2.0.3] - 2020-09-28 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.3 || ^8.0` to `>=7.3` - -## [2.0.2] - 2020-06-26 - -### Added - -* This component is now supported on PHP 8 - -## [2.0.1] - 2020-06-15 - -### Changed - -* Tests etc. are now ignored for archive exports - -## 2.0.0 - 2020-02-07 - -### Removed - -* This component is no longer supported on PHP 5.6, PHP 7.0, PHP 7.1, and PHP 7.2 - -## 1.0.0 - 2016-02-13 - -### Added - -* Initial release - -[2.0.3]: https://github.com/sebastianbergmann/code-unit-reverse-lookup/compare/2.0.2...2.0.3 -[2.0.2]: https://github.com/sebastianbergmann/code-unit-reverse-lookup/compare/2.0.1...2.0.2 -[2.0.1]: https://github.com/sebastianbergmann/code-unit-reverse-lookup/compare/2.0.0...2.0.1 -[2.0.0]: https://github.com/sebastianbergmann/code-unit-reverse-lookup/compare/1.0.0...2.0.0 diff --git a/vendor/sebastian/code-unit-reverse-lookup/LICENSE b/vendor/sebastian/code-unit-reverse-lookup/LICENSE deleted file mode 100644 index dc4bf701..00000000 --- a/vendor/sebastian/code-unit-reverse-lookup/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -code-unit-reverse-lookup - -Copyright (c) 2016-2020, Sebastian Bergmann . -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 Sebastian Bergmann nor the names of his - 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/sebastian/code-unit-reverse-lookup/README.md b/vendor/sebastian/code-unit-reverse-lookup/README.md deleted file mode 100644 index 1c0ca235..00000000 --- a/vendor/sebastian/code-unit-reverse-lookup/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# sebastian/code-unit-reverse-lookup - -[![CI Status](https://github.com/sebastianbergmann/code-unit-reverse-lookup/workflows/CI/badge.svg)](https://github.com/sebastianbergmann/code-unit-reverse-lookup/actions) -[![Type Coverage](https://shepherd.dev/github/sebastianbergmann/code-unit-reverse-lookup/coverage.svg)](https://shepherd.dev/github/sebastianbergmann/code-unit-reverse-lookup) - -Looks up which function or method a line of code belongs to. - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - -``` -composer require sebastian/code-unit-reverse-lookup -``` - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - -``` -composer require --dev sebastian/code-unit-reverse-lookup -``` diff --git a/vendor/sebastian/code-unit-reverse-lookup/composer.json b/vendor/sebastian/code-unit-reverse-lookup/composer.json deleted file mode 100644 index cff96167..00000000 --- a/vendor/sebastian/code-unit-reverse-lookup/composer.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "sebastian/code-unit-reverse-lookup", - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "prefer-stable": true, - "config": { - "platform": { - "php": "7.3.0" - }, - "optimize-autoloader": true, - "sort-packages": true - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - } -} diff --git a/vendor/sebastian/code-unit-reverse-lookup/src/Wizard.php b/vendor/sebastian/code-unit-reverse-lookup/src/Wizard.php deleted file mode 100644 index 35de5398..00000000 --- a/vendor/sebastian/code-unit-reverse-lookup/src/Wizard.php +++ /dev/null @@ -1,125 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeUnitReverseLookup; - -use function array_merge; -use function assert; -use function get_declared_classes; -use function get_declared_traits; -use function get_defined_functions; -use function is_array; -use function range; -use ReflectionClass; -use ReflectionFunction; -use ReflectionFunctionAbstract; -use ReflectionMethod; - -/** - * @since Class available since Release 1.0.0 - */ -class Wizard -{ - /** - * @var array - */ - private $lookupTable = []; - - /** - * @var array - */ - private $processedClasses = []; - - /** - * @var array - */ - private $processedFunctions = []; - - /** - * @param string $filename - * @param int $lineNumber - * - * @return string - */ - public function lookup($filename, $lineNumber) - { - if (!isset($this->lookupTable[$filename][$lineNumber])) { - $this->updateLookupTable(); - } - - if (isset($this->lookupTable[$filename][$lineNumber])) { - return $this->lookupTable[$filename][$lineNumber]; - } - - return $filename . ':' . $lineNumber; - } - - private function updateLookupTable(): void - { - $this->processClassesAndTraits(); - $this->processFunctions(); - } - - private function processClassesAndTraits(): void - { - $classes = get_declared_classes(); - $traits = get_declared_traits(); - - assert(is_array($classes)); - assert(is_array($traits)); - - foreach (array_merge($classes, $traits) as $classOrTrait) { - if (isset($this->processedClasses[$classOrTrait])) { - continue; - } - - $reflector = new ReflectionClass($classOrTrait); - - foreach ($reflector->getMethods() as $method) { - $this->processFunctionOrMethod($method); - } - - $this->processedClasses[$classOrTrait] = true; - } - } - - private function processFunctions(): void - { - foreach (get_defined_functions()['user'] as $function) { - if (isset($this->processedFunctions[$function])) { - continue; - } - - $this->processFunctionOrMethod(new ReflectionFunction($function)); - - $this->processedFunctions[$function] = true; - } - } - - private function processFunctionOrMethod(ReflectionFunctionAbstract $functionOrMethod): void - { - if ($functionOrMethod->isInternal()) { - return; - } - - $name = $functionOrMethod->getName(); - - if ($functionOrMethod instanceof ReflectionMethod) { - $name = $functionOrMethod->getDeclaringClass()->getName() . '::' . $name; - } - - if (!isset($this->lookupTable[$functionOrMethod->getFileName()])) { - $this->lookupTable[$functionOrMethod->getFileName()] = []; - } - - foreach (range($functionOrMethod->getStartLine(), $functionOrMethod->getEndLine()) as $line) { - $this->lookupTable[$functionOrMethod->getFileName()][$line] = $name; - } - } -} diff --git a/vendor/sebastian/code-unit/.psalm/baseline.xml b/vendor/sebastian/code-unit/.psalm/baseline.xml deleted file mode 100644 index e4488919..00000000 --- a/vendor/sebastian/code-unit/.psalm/baseline.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - $firstPart - $firstPart - $firstPart - $firstPart - $firstPart - $firstPart - $firstPart - $firstPart - $firstPart - $secondPart - $unit - $unit - $unit - $unit - $unit - $unit - - - diff --git a/vendor/sebastian/code-unit/.psalm/config.xml b/vendor/sebastian/code-unit/.psalm/config.xml deleted file mode 100644 index a39e9a4c..00000000 --- a/vendor/sebastian/code-unit/.psalm/config.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - diff --git a/vendor/sebastian/code-unit/ChangeLog.md b/vendor/sebastian/code-unit/ChangeLog.md deleted file mode 100644 index 0978e651..00000000 --- a/vendor/sebastian/code-unit/ChangeLog.md +++ /dev/null @@ -1,65 +0,0 @@ -# ChangeLog - -All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. - -## [1.0.8] - 2020-10-26 - -### Fixed - -* `SebastianBergmann\CodeUnit\Exception` now correctly extends `\Throwable` - -## [1.0.7] - 2020-10-02 - -### Fixed - -* `SebastianBergmann\CodeUnit\Mapper::stringToCodeUnits()` no longer attempts to create `CodeUnit` objects for code units that are not declared in userland - -## [1.0.6] - 2020-09-28 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.3 || ^8.0` to `>=7.3` - -## [1.0.5] - 2020-06-26 - -### Fixed - -* [#3](https://github.com/sebastianbergmann/code-unit/issues/3): Regression in 1.0.4 - -## [1.0.4] - 2020-06-26 - -### Added - -* This component is now supported on PHP 8 - -## [1.0.3] - 2020-06-15 - -### Changed - -* Tests etc. are now ignored for archive exports - -## [1.0.2] - 2020-04-30 - -### Fixed - -* `Mapper::stringToCodeUnits()` raised the wrong exception for `Class::method` when a class named `Class` exists but does not have a method named `method` - -## [1.0.1] - 2020-04-27 - -### Fixed - -* [#2](https://github.com/sebastianbergmann/code-unit/issues/2): `Mapper::stringToCodeUnits()` breaks when `ClassName` is used for class that extends built-in class - -## [1.0.0] - 2020-03-30 - -* Initial release - -[1.0.8]: https://github.com/sebastianbergmann/code-unit/compare/1.0.7...1.0.8 -[1.0.7]: https://github.com/sebastianbergmann/code-unit/compare/1.0.6...1.0.7 -[1.0.6]: https://github.com/sebastianbergmann/code-unit/compare/1.0.5...1.0.6 -[1.0.5]: https://github.com/sebastianbergmann/code-unit/compare/1.0.4...1.0.5 -[1.0.4]: https://github.com/sebastianbergmann/code-unit/compare/1.0.3...1.0.4 -[1.0.3]: https://github.com/sebastianbergmann/code-unit/compare/1.0.2...1.0.3 -[1.0.2]: https://github.com/sebastianbergmann/code-unit/compare/1.0.1...1.0.2 -[1.0.1]: https://github.com/sebastianbergmann/code-unit/compare/1.0.0...1.0.1 -[1.0.0]: https://github.com/sebastianbergmann/code-unit/compare/530c3900e5db9bcb8516da545bef0d62536cedaa...1.0.0 diff --git a/vendor/sebastian/code-unit/LICENSE b/vendor/sebastian/code-unit/LICENSE deleted file mode 100644 index b99bc8ac..00000000 --- a/vendor/sebastian/code-unit/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -sebastian/code-unit - -Copyright (c) 2020, Sebastian Bergmann . -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 Sebastian Bergmann nor the names of his - 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/sebastian/code-unit/README.md b/vendor/sebastian/code-unit/README.md deleted file mode 100644 index d20227a9..00000000 --- a/vendor/sebastian/code-unit/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# sebastian/code-unit - -Collection of value objects that represent the PHP code units. - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - -``` -composer require sebastian/code-unit -``` - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - -``` -composer require --dev sebastian/code-unit -``` diff --git a/vendor/sebastian/code-unit/composer.json b/vendor/sebastian/code-unit/composer.json deleted file mode 100644 index 5b86ec58..00000000 --- a/vendor/sebastian/code-unit/composer.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "sebastian/code-unit", - "description": "Collection of value objects that represent the PHP code units", - "type": "library", - "homepage": "https://github.com/sebastianbergmann/code-unit", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit/issues" - }, - "prefer-stable": true, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "config": { - "platform": { - "php": "7.3.0" - }, - "optimize-autoloader": true, - "sort-packages": true - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "autoload-dev": { - "classmap": [ - "tests/_fixture" - ], - "files": [ - "tests/_fixture/file_with_multiple_code_units.php", - "tests/_fixture/function.php" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - } -} diff --git a/vendor/sebastian/code-unit/src/ClassMethodUnit.php b/vendor/sebastian/code-unit/src/ClassMethodUnit.php deleted file mode 100644 index f9ddac29..00000000 --- a/vendor/sebastian/code-unit/src/ClassMethodUnit.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 SebastianBergmann\CodeUnit; - -/** - * @psalm-immutable - */ -final class ClassMethodUnit extends CodeUnit -{ - /** - * @psalm-assert-if-true ClassMethodUnit $this - */ - public function isClassMethod(): bool - { - return true; - } -} diff --git a/vendor/sebastian/code-unit/src/ClassUnit.php b/vendor/sebastian/code-unit/src/ClassUnit.php deleted file mode 100644 index 3ba0ee66..00000000 --- a/vendor/sebastian/code-unit/src/ClassUnit.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 SebastianBergmann\CodeUnit; - -/** - * @psalm-immutable - */ -final class ClassUnit extends CodeUnit -{ - /** - * @psalm-assert-if-true ClassUnit $this - */ - public function isClass(): bool - { - return true; - } -} diff --git a/vendor/sebastian/code-unit/src/CodeUnit.php b/vendor/sebastian/code-unit/src/CodeUnit.php deleted file mode 100644 index 9e5cceb3..00000000 --- a/vendor/sebastian/code-unit/src/CodeUnit.php +++ /dev/null @@ -1,445 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeUnit; - -use function range; -use function sprintf; -use ReflectionClass; -use ReflectionFunction; -use ReflectionMethod; - -/** - * @psalm-immutable - */ -abstract class CodeUnit -{ - /** - * @var string - */ - private $name; - - /** - * @var string - */ - private $sourceFileName; - - /** - * @var array - * @psalm-var list - */ - private $sourceLines; - - /** - * @psalm-param class-string $className - * - * @throws InvalidCodeUnitException - * @throws ReflectionException - */ - public static function forClass(string $className): ClassUnit - { - self::ensureUserDefinedClass($className); - - $reflector = self::reflectorForClass($className); - - return new ClassUnit( - $className, - $reflector->getFileName(), - range( - $reflector->getStartLine(), - $reflector->getEndLine() - ) - ); - } - - /** - * @psalm-param class-string $className - * - * @throws InvalidCodeUnitException - * @throws ReflectionException - */ - public static function forClassMethod(string $className, string $methodName): ClassMethodUnit - { - self::ensureUserDefinedClass($className); - - $reflector = self::reflectorForClassMethod($className, $methodName); - - return new ClassMethodUnit( - $className . '::' . $methodName, - $reflector->getFileName(), - range( - $reflector->getStartLine(), - $reflector->getEndLine() - ) - ); - } - - /** - * @psalm-param class-string $interfaceName - * - * @throws InvalidCodeUnitException - * @throws ReflectionException - */ - public static function forInterface(string $interfaceName): InterfaceUnit - { - self::ensureUserDefinedInterface($interfaceName); - - $reflector = self::reflectorForClass($interfaceName); - - return new InterfaceUnit( - $interfaceName, - $reflector->getFileName(), - range( - $reflector->getStartLine(), - $reflector->getEndLine() - ) - ); - } - - /** - * @psalm-param class-string $interfaceName - * - * @throws InvalidCodeUnitException - * @throws ReflectionException - */ - public static function forInterfaceMethod(string $interfaceName, string $methodName): InterfaceMethodUnit - { - self::ensureUserDefinedInterface($interfaceName); - - $reflector = self::reflectorForClassMethod($interfaceName, $methodName); - - return new InterfaceMethodUnit( - $interfaceName . '::' . $methodName, - $reflector->getFileName(), - range( - $reflector->getStartLine(), - $reflector->getEndLine() - ) - ); - } - - /** - * @psalm-param class-string $traitName - * - * @throws InvalidCodeUnitException - * @throws ReflectionException - */ - public static function forTrait(string $traitName): TraitUnit - { - self::ensureUserDefinedTrait($traitName); - - $reflector = self::reflectorForClass($traitName); - - return new TraitUnit( - $traitName, - $reflector->getFileName(), - range( - $reflector->getStartLine(), - $reflector->getEndLine() - ) - ); - } - - /** - * @psalm-param class-string $traitName - * - * @throws InvalidCodeUnitException - * @throws ReflectionException - */ - public static function forTraitMethod(string $traitName, string $methodName): TraitMethodUnit - { - self::ensureUserDefinedTrait($traitName); - - $reflector = self::reflectorForClassMethod($traitName, $methodName); - - return new TraitMethodUnit( - $traitName . '::' . $methodName, - $reflector->getFileName(), - range( - $reflector->getStartLine(), - $reflector->getEndLine() - ) - ); - } - - /** - * @psalm-param callable-string $functionName - * - * @throws InvalidCodeUnitException - * @throws ReflectionException - */ - public static function forFunction(string $functionName): FunctionUnit - { - $reflector = self::reflectorForFunction($functionName); - - if (!$reflector->isUserDefined()) { - throw new InvalidCodeUnitException( - sprintf( - '"%s" is not a user-defined function', - $functionName - ) - ); - } - - return new FunctionUnit( - $functionName, - $reflector->getFileName(), - range( - $reflector->getStartLine(), - $reflector->getEndLine() - ) - ); - } - - /** - * @psalm-param list $sourceLines - */ - private function __construct(string $name, string $sourceFileName, array $sourceLines) - { - $this->name = $name; - $this->sourceFileName = $sourceFileName; - $this->sourceLines = $sourceLines; - } - - public function name(): string - { - return $this->name; - } - - public function sourceFileName(): string - { - return $this->sourceFileName; - } - - /** - * @psalm-return list - */ - public function sourceLines(): array - { - return $this->sourceLines; - } - - public function isClass(): bool - { - return false; - } - - public function isClassMethod(): bool - { - return false; - } - - public function isInterface(): bool - { - return false; - } - - public function isInterfaceMethod(): bool - { - return false; - } - - public function isTrait(): bool - { - return false; - } - - public function isTraitMethod(): bool - { - return false; - } - - public function isFunction(): bool - { - return false; - } - - /** - * @psalm-param class-string $className - * - * @throws InvalidCodeUnitException - */ - private static function ensureUserDefinedClass(string $className): void - { - try { - $reflector = new ReflectionClass($className); - - if ($reflector->isInterface()) { - throw new InvalidCodeUnitException( - sprintf( - '"%s" is an interface and not a class', - $className - ) - ); - } - - if ($reflector->isTrait()) { - throw new InvalidCodeUnitException( - sprintf( - '"%s" is a trait and not a class', - $className - ) - ); - } - - if (!$reflector->isUserDefined()) { - throw new InvalidCodeUnitException( - sprintf( - '"%s" is not a user-defined class', - $className - ) - ); - } - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } - - /** - * @psalm-param class-string $interfaceName - * - * @throws InvalidCodeUnitException - */ - private static function ensureUserDefinedInterface(string $interfaceName): void - { - try { - $reflector = new ReflectionClass($interfaceName); - - if (!$reflector->isInterface()) { - throw new InvalidCodeUnitException( - sprintf( - '"%s" is not an interface', - $interfaceName - ) - ); - } - - if (!$reflector->isUserDefined()) { - throw new InvalidCodeUnitException( - sprintf( - '"%s" is not a user-defined interface', - $interfaceName - ) - ); - } - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } - - /** - * @psalm-param class-string $traitName - * - * @throws InvalidCodeUnitException - */ - private static function ensureUserDefinedTrait(string $traitName): void - { - try { - $reflector = new ReflectionClass($traitName); - - if (!$reflector->isTrait()) { - throw new InvalidCodeUnitException( - sprintf( - '"%s" is not a trait', - $traitName - ) - ); - } - - // @codeCoverageIgnoreStart - if (!$reflector->isUserDefined()) { - throw new InvalidCodeUnitException( - sprintf( - '"%s" is not a user-defined trait', - $traitName - ) - ); - } - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } - - /** - * @psalm-param class-string $className - * - * @throws ReflectionException - */ - private static function reflectorForClass(string $className): ReflectionClass - { - try { - return new ReflectionClass($className); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } - - /** - * @psalm-param class-string $className - * - * @throws ReflectionException - */ - private static function reflectorForClassMethod(string $className, string $methodName): ReflectionMethod - { - try { - return new ReflectionMethod($className, $methodName); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } - - /** - * @psalm-param callable-string $functionName - * - * @throws ReflectionException - */ - private static function reflectorForFunction(string $functionName): ReflectionFunction - { - try { - return new ReflectionFunction($functionName); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } -} diff --git a/vendor/sebastian/code-unit/src/CodeUnitCollection.php b/vendor/sebastian/code-unit/src/CodeUnitCollection.php deleted file mode 100644 index f53db8a1..00000000 --- a/vendor/sebastian/code-unit/src/CodeUnitCollection.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 SebastianBergmann\CodeUnit; - -use function array_merge; -use function count; -use Countable; -use IteratorAggregate; - -final class CodeUnitCollection implements Countable, IteratorAggregate -{ - /** - * @psalm-var list - */ - private $codeUnits = []; - - /** - * @psalm-param list $items - */ - public static function fromArray(array $items): self - { - $collection = new self; - - foreach ($items as $item) { - $collection->add($item); - } - - return $collection; - } - - public static function fromList(CodeUnit ...$items): self - { - return self::fromArray($items); - } - - private function __construct() - { - } - - /** - * @psalm-return list - */ - public function asArray(): array - { - return $this->codeUnits; - } - - public function getIterator(): CodeUnitCollectionIterator - { - return new CodeUnitCollectionIterator($this); - } - - public function count(): int - { - return count($this->codeUnits); - } - - public function isEmpty(): bool - { - return empty($this->codeUnits); - } - - public function mergeWith(self $other): self - { - return self::fromArray( - array_merge( - $this->asArray(), - $other->asArray() - ) - ); - } - - private function add(CodeUnit $item): void - { - $this->codeUnits[] = $item; - } -} diff --git a/vendor/sebastian/code-unit/src/CodeUnitCollectionIterator.php b/vendor/sebastian/code-unit/src/CodeUnitCollectionIterator.php deleted file mode 100644 index bdc86d88..00000000 --- a/vendor/sebastian/code-unit/src/CodeUnitCollectionIterator.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeUnit; - -use Iterator; - -final class CodeUnitCollectionIterator implements Iterator -{ - /** - * @psalm-var list - */ - private $codeUnits; - - /** - * @var int - */ - private $position = 0; - - public function __construct(CodeUnitCollection $collection) - { - $this->codeUnits = $collection->asArray(); - } - - public function rewind(): void - { - $this->position = 0; - } - - public function valid(): bool - { - return isset($this->codeUnits[$this->position]); - } - - public function key(): int - { - return $this->position; - } - - public function current(): CodeUnit - { - return $this->codeUnits[$this->position]; - } - - public function next(): void - { - $this->position++; - } -} diff --git a/vendor/sebastian/code-unit/src/FunctionUnit.php b/vendor/sebastian/code-unit/src/FunctionUnit.php deleted file mode 100644 index df76cf19..00000000 --- a/vendor/sebastian/code-unit/src/FunctionUnit.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 SebastianBergmann\CodeUnit; - -/** - * @psalm-immutable - */ -final class FunctionUnit extends CodeUnit -{ - /** - * @psalm-assert-if-true FunctionUnit $this - */ - public function isFunction(): bool - { - return true; - } -} diff --git a/vendor/sebastian/code-unit/src/InterfaceMethodUnit.php b/vendor/sebastian/code-unit/src/InterfaceMethodUnit.php deleted file mode 100644 index fcd44f41..00000000 --- a/vendor/sebastian/code-unit/src/InterfaceMethodUnit.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 SebastianBergmann\CodeUnit; - -/** - * @psalm-immutable - */ -final class InterfaceMethodUnit extends CodeUnit -{ - /** - * @psalm-assert-if-true InterfaceMethod $this - */ - public function isInterfaceMethod(): bool - { - return true; - } -} diff --git a/vendor/sebastian/code-unit/src/InterfaceUnit.php b/vendor/sebastian/code-unit/src/InterfaceUnit.php deleted file mode 100644 index 5cf585bf..00000000 --- a/vendor/sebastian/code-unit/src/InterfaceUnit.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 SebastianBergmann\CodeUnit; - -/** - * @psalm-immutable - */ -final class InterfaceUnit extends CodeUnit -{ - /** - * @psalm-assert-if-true InterfaceUnit $this - */ - public function isInterface(): bool - { - return true; - } -} diff --git a/vendor/sebastian/code-unit/src/Mapper.php b/vendor/sebastian/code-unit/src/Mapper.php deleted file mode 100644 index a72b3b0d..00000000 --- a/vendor/sebastian/code-unit/src/Mapper.php +++ /dev/null @@ -1,414 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\CodeUnit; - -use function array_keys; -use function array_merge; -use function array_unique; -use function array_values; -use function class_exists; -use function explode; -use function function_exists; -use function interface_exists; -use function ksort; -use function method_exists; -use function sort; -use function sprintf; -use function str_replace; -use function strpos; -use function trait_exists; -use ReflectionClass; -use ReflectionFunction; -use ReflectionMethod; - -final class Mapper -{ - /** - * @psalm-return array> - */ - public function codeUnitsToSourceLines(CodeUnitCollection $codeUnits): array - { - $result = []; - - foreach ($codeUnits as $codeUnit) { - $sourceFileName = $codeUnit->sourceFileName(); - - if (!isset($result[$sourceFileName])) { - $result[$sourceFileName] = []; - } - - $result[$sourceFileName] = array_merge($result[$sourceFileName], $codeUnit->sourceLines()); - } - - foreach (array_keys($result) as $sourceFileName) { - $result[$sourceFileName] = array_values(array_unique($result[$sourceFileName])); - - sort($result[$sourceFileName]); - } - - ksort($result); - - return $result; - } - - /** - * @throws InvalidCodeUnitException - * @throws ReflectionException - */ - public function stringToCodeUnits(string $unit): CodeUnitCollection - { - if (strpos($unit, '::') !== false) { - [$firstPart, $secondPart] = explode('::', $unit); - - if (empty($firstPart) && $this->isUserDefinedFunction($secondPart)) { - return CodeUnitCollection::fromList(CodeUnit::forFunction($secondPart)); - } - - if ($this->isUserDefinedClass($firstPart)) { - if ($secondPart === '') { - return $this->publicMethodsOfClass($firstPart); - } - - if ($secondPart === '') { - return $this->protectedAndPrivateMethodsOfClass($firstPart); - } - - if ($secondPart === '') { - return $this->protectedMethodsOfClass($firstPart); - } - - if ($secondPart === '') { - return $this->publicAndPrivateMethodsOfClass($firstPart); - } - - if ($secondPart === '') { - return $this->privateMethodsOfClass($firstPart); - } - - if ($secondPart === '') { - return $this->publicAndProtectedMethodsOfClass($firstPart); - } - - if ($this->isUserDefinedMethod($firstPart, $secondPart)) { - return CodeUnitCollection::fromList(CodeUnit::forClassMethod($firstPart, $secondPart)); - } - } - - if ($this->isUserDefinedInterface($firstPart)) { - return CodeUnitCollection::fromList(CodeUnit::forInterfaceMethod($firstPart, $secondPart)); - } - - if ($this->isUserDefinedTrait($firstPart)) { - return CodeUnitCollection::fromList(CodeUnit::forTraitMethod($firstPart, $secondPart)); - } - } else { - if ($this->isUserDefinedClass($unit)) { - $units = [CodeUnit::forClass($unit)]; - - foreach ($this->reflectorForClass($unit)->getTraits() as $trait) { - if (!$trait->isUserDefined()) { - // @codeCoverageIgnoreStart - continue; - // @codeCoverageIgnoreEnd - } - - $units[] = CodeUnit::forTrait($trait->getName()); - } - - return CodeUnitCollection::fromArray($units); - } - - if ($this->isUserDefinedInterface($unit)) { - return CodeUnitCollection::fromList(CodeUnit::forInterface($unit)); - } - - if ($this->isUserDefinedTrait($unit)) { - return CodeUnitCollection::fromList(CodeUnit::forTrait($unit)); - } - - if ($this->isUserDefinedFunction($unit)) { - return CodeUnitCollection::fromList(CodeUnit::forFunction($unit)); - } - - $unit = str_replace('', '', $unit); - - if ($this->isUserDefinedClass($unit)) { - return $this->classAndParentClassesAndTraits($unit); - } - } - - throw new InvalidCodeUnitException( - sprintf( - '"%s" is not a valid code unit', - $unit - ) - ); - } - - /** - * @psalm-param class-string $className - * - * @throws ReflectionException - */ - private function publicMethodsOfClass(string $className): CodeUnitCollection - { - return $this->methodsOfClass($className, ReflectionMethod::IS_PUBLIC); - } - - /** - * @psalm-param class-string $className - * - * @throws ReflectionException - */ - private function publicAndProtectedMethodsOfClass(string $className): CodeUnitCollection - { - return $this->methodsOfClass($className, ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PROTECTED); - } - - /** - * @psalm-param class-string $className - * - * @throws ReflectionException - */ - private function publicAndPrivateMethodsOfClass(string $className): CodeUnitCollection - { - return $this->methodsOfClass($className, ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PRIVATE); - } - - /** - * @psalm-param class-string $className - * - * @throws ReflectionException - */ - private function protectedMethodsOfClass(string $className): CodeUnitCollection - { - return $this->methodsOfClass($className, ReflectionMethod::IS_PROTECTED); - } - - /** - * @psalm-param class-string $className - * - * @throws ReflectionException - */ - private function protectedAndPrivateMethodsOfClass(string $className): CodeUnitCollection - { - return $this->methodsOfClass($className, ReflectionMethod::IS_PROTECTED | ReflectionMethod::IS_PRIVATE); - } - - /** - * @psalm-param class-string $className - * - * @throws ReflectionException - */ - private function privateMethodsOfClass(string $className): CodeUnitCollection - { - return $this->methodsOfClass($className, ReflectionMethod::IS_PRIVATE); - } - - /** - * @psalm-param class-string $className - * - * @throws ReflectionException - */ - private function methodsOfClass(string $className, int $filter): CodeUnitCollection - { - $units = []; - - foreach ($this->reflectorForClass($className)->getMethods($filter) as $method) { - if (!$method->isUserDefined()) { - continue; - } - - $units[] = CodeUnit::forClassMethod($className, $method->getName()); - } - - return CodeUnitCollection::fromArray($units); - } - - /** - * @psalm-param class-string $className - * - * @throws ReflectionException - */ - private function classAndParentClassesAndTraits(string $className): CodeUnitCollection - { - $units = [CodeUnit::forClass($className)]; - - $reflector = $this->reflectorForClass($className); - - foreach ($this->reflectorForClass($className)->getTraits() as $trait) { - if (!$trait->isUserDefined()) { - // @codeCoverageIgnoreStart - continue; - // @codeCoverageIgnoreEnd - } - - $units[] = CodeUnit::forTrait($trait->getName()); - } - - while ($reflector = $reflector->getParentClass()) { - if (!$reflector->isUserDefined()) { - break; - } - - $units[] = CodeUnit::forClass($reflector->getName()); - - foreach ($reflector->getTraits() as $trait) { - if (!$trait->isUserDefined()) { - // @codeCoverageIgnoreStart - continue; - // @codeCoverageIgnoreEnd - } - - $units[] = CodeUnit::forTrait($trait->getName()); - } - } - - return CodeUnitCollection::fromArray($units); - } - - /** - * @psalm-param class-string $className - * - * @throws ReflectionException - */ - private function reflectorForClass(string $className): ReflectionClass - { - try { - return new ReflectionClass($className); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } - - /** - * @throws ReflectionException - */ - private function isUserDefinedFunction(string $functionName): bool - { - if (!function_exists($functionName)) { - return false; - } - - try { - return (new ReflectionFunction($functionName))->isUserDefined(); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } - - /** - * @throws ReflectionException - */ - private function isUserDefinedClass(string $className): bool - { - if (!class_exists($className)) { - return false; - } - - try { - return (new ReflectionClass($className))->isUserDefined(); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } - - /** - * @throws ReflectionException - */ - private function isUserDefinedInterface(string $interfaceName): bool - { - if (!interface_exists($interfaceName)) { - return false; - } - - try { - return (new ReflectionClass($interfaceName))->isUserDefined(); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } - - /** - * @throws ReflectionException - */ - private function isUserDefinedTrait(string $traitName): bool - { - if (!trait_exists($traitName)) { - return false; - } - - try { - return (new ReflectionClass($traitName))->isUserDefined(); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } - - /** - * @throws ReflectionException - */ - private function isUserDefinedMethod(string $className, string $methodName): bool - { - if (!class_exists($className)) { - // @codeCoverageIgnoreStart - return false; - // @codeCoverageIgnoreEnd - } - - if (!method_exists($className, $methodName)) { - // @codeCoverageIgnoreStart - return false; - // @codeCoverageIgnoreEnd - } - - try { - return (new ReflectionMethod($className, $methodName))->isUserDefined(); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } -} diff --git a/vendor/sebastian/code-unit/src/TraitMethodUnit.php b/vendor/sebastian/code-unit/src/TraitMethodUnit.php deleted file mode 100644 index a58f7249..00000000 --- a/vendor/sebastian/code-unit/src/TraitMethodUnit.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 SebastianBergmann\CodeUnit; - -/** - * @psalm-immutable - */ -final class TraitMethodUnit extends CodeUnit -{ - /** - * @psalm-assert-if-true TraitMethodUnit $this - */ - public function isTraitMethod(): bool - { - return true; - } -} diff --git a/vendor/sebastian/code-unit/src/TraitUnit.php b/vendor/sebastian/code-unit/src/TraitUnit.php deleted file mode 100644 index abddfc11..00000000 --- a/vendor/sebastian/code-unit/src/TraitUnit.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 SebastianBergmann\CodeUnit; - -/** - * @psalm-immutable - */ -final class TraitUnit extends CodeUnit -{ - /** - * @psalm-assert-if-true TraitUnit $this - */ - public function isTrait(): bool - { - return true; - } -} diff --git a/vendor/sebastian/code-unit/src/exceptions/Exception.php b/vendor/sebastian/code-unit/src/exceptions/Exception.php deleted file mode 100644 index 74d0eeef..00000000 --- a/vendor/sebastian/code-unit/src/exceptions/Exception.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. - */ -namespace SebastianBergmann\CodeUnit; - -use Throwable; - -interface Exception extends Throwable -{ -} diff --git a/vendor/sebastian/code-unit/src/exceptions/InvalidCodeUnitException.php b/vendor/sebastian/code-unit/src/exceptions/InvalidCodeUnitException.php deleted file mode 100644 index 60a3da82..00000000 --- a/vendor/sebastian/code-unit/src/exceptions/InvalidCodeUnitException.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. - */ -namespace SebastianBergmann\CodeUnit; - -use RuntimeException; - -final class InvalidCodeUnitException extends RuntimeException implements Exception -{ -} diff --git a/vendor/sebastian/code-unit/src/exceptions/NoTraitException.php b/vendor/sebastian/code-unit/src/exceptions/NoTraitException.php deleted file mode 100644 index e9b9b9c7..00000000 --- a/vendor/sebastian/code-unit/src/exceptions/NoTraitException.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. - */ -namespace SebastianBergmann\CodeUnit; - -use RuntimeException; - -final class NoTraitException extends RuntimeException implements Exception -{ -} diff --git a/vendor/sebastian/code-unit/src/exceptions/ReflectionException.php b/vendor/sebastian/code-unit/src/exceptions/ReflectionException.php deleted file mode 100644 index 23201278..00000000 --- a/vendor/sebastian/code-unit/src/exceptions/ReflectionException.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. - */ -namespace SebastianBergmann\CodeUnit; - -use RuntimeException; - -final class ReflectionException extends RuntimeException implements Exception -{ -} diff --git a/vendor/sebastian/comparator/ChangeLog.md b/vendor/sebastian/comparator/ChangeLog.md deleted file mode 100644 index 17557536..00000000 --- a/vendor/sebastian/comparator/ChangeLog.md +++ /dev/null @@ -1,143 +0,0 @@ -# ChangeLog - -All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. - -## [4.0.8] - 2022-09-14 - -### Fixed - -* [#102](https://github.com/sebastianbergmann/comparator/pull/102): Fix `float` comparison precision - -## [4.0.7] - 2022-09-14 - -### Fixed - -* [#99](https://github.com/sebastianbergmann/comparator/pull/99): Fix weak comparison between `'0'` and `false` - -## [4.0.6] - 2020-10-26 - -### Fixed - -* `SebastianBergmann\Comparator\Exception` now correctly extends `\Throwable` - -## [4.0.5] - 2020-09-30 - -### Fixed - -* [#89](https://github.com/sebastianbergmann/comparator/pull/89): Handle PHP 8 `ValueError` - -## [4.0.4] - 2020-09-28 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.3 || ^8.0` to `>=7.3` - -## [4.0.3] - 2020-06-26 - -### Added - -* This component is now supported on PHP 8 - -## [4.0.2] - 2020-06-15 - -### Fixed - -* [#85](https://github.com/sebastianbergmann/comparator/issues/85): Version 4.0.1 breaks backward compatibility - -## [4.0.1] - 2020-06-15 - -### Changed - -* Tests etc. are now ignored for archive exports - -## [4.0.0] - 2020-02-07 - -### Removed - -* Removed support for PHP 7.1 and PHP 7.2 - -## [3.0.5] - 2022-09-14 - -### Fixed - -* [#102](https://github.com/sebastianbergmann/comparator/pull/102): Fix `float` comparison precision - -## [3.0.4] - 2022-09-14 - -### Fixed - -* [#99](https://github.com/sebastianbergmann/comparator/pull/99): Fix weak comparison between `'0'` and `false` - -## [3.0.3] - 2020-11-30 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.1` to `>=7.1` - -## [3.0.2] - 2018-07-12 - -### Changed - -* By default, `MockObjectComparator` is now tried before all other (default) comparators - -## [3.0.1] - 2018-06-14 - -### Fixed - -* [#53](https://github.com/sebastianbergmann/comparator/pull/53): `DOMNodeComparator` ignores `$ignoreCase` parameter -* [#58](https://github.com/sebastianbergmann/comparator/pull/58): `ScalarComparator` does not handle extremely ugly string comparison edge cases - -## [3.0.0] - 2018-04-18 - -### Fixed - -* [#48](https://github.com/sebastianbergmann/comparator/issues/48): `DateTimeComparator` does not support fractional second deltas - -### Removed - -* Removed support for PHP 7.0 - -## [2.1.3] - 2018-02-01 - -### Changed - -* This component is now compatible with version 3 of `sebastian/diff` - -## [2.1.2] - 2018-01-12 - -### Fixed - -* Fix comparison of `DateTimeImmutable` objects - -## [2.1.1] - 2017-12-22 - -### Fixed - -* [phpunit/#2923](https://github.com/sebastianbergmann/phpunit/issues/2923): Unexpected failed date matching - -## [2.1.0] - 2017-11-03 - -### Added - -* Added `SebastianBergmann\Comparator\Factory::reset()` to unregister all non-default comparators -* Added support for `phpunit/phpunit-mock-objects` version `^5.0` - -[4.0.8]: https://github.com/sebastianbergmann/comparator/compare/4.0.7...4.0.8 -[4.0.7]: https://github.com/sebastianbergmann/comparator/compare/4.0.6...4.0.7 -[4.0.6]: https://github.com/sebastianbergmann/comparator/compare/4.0.5...4.0.6 -[4.0.5]: https://github.com/sebastianbergmann/comparator/compare/4.0.4...4.0.5 -[4.0.4]: https://github.com/sebastianbergmann/comparator/compare/4.0.3...4.0.4 -[4.0.3]: https://github.com/sebastianbergmann/comparator/compare/4.0.2...4.0.3 -[4.0.2]: https://github.com/sebastianbergmann/comparator/compare/4.0.1...4.0.2 -[4.0.1]: https://github.com/sebastianbergmann/comparator/compare/4.0.0...4.0.1 -[4.0.0]: https://github.com/sebastianbergmann/comparator/compare/3.0.5...4.0.0 -[3.0.5]: https://github.com/sebastianbergmann/comparator/compare/3.0.4...3.0.5 -[3.0.4]: https://github.com/sebastianbergmann/comparator/compare/3.0.3...3.0.4 -[3.0.3]: https://github.com/sebastianbergmann/comparator/compare/3.0.2...3.0.3 -[3.0.2]: https://github.com/sebastianbergmann/comparator/compare/3.0.1...3.0.2 -[3.0.1]: https://github.com/sebastianbergmann/comparator/compare/3.0.0...3.0.1 -[3.0.0]: https://github.com/sebastianbergmann/comparator/compare/2.1.3...3.0.0 -[2.1.3]: https://github.com/sebastianbergmann/comparator/compare/2.1.2...2.1.3 -[2.1.2]: https://github.com/sebastianbergmann/comparator/compare/2.1.1...2.1.2 -[2.1.1]: https://github.com/sebastianbergmann/comparator/compare/2.1.0...2.1.1 -[2.1.0]: https://github.com/sebastianbergmann/comparator/compare/2.0.2...2.1.0 diff --git a/vendor/sebastian/comparator/LICENSE b/vendor/sebastian/comparator/LICENSE deleted file mode 100644 index 6ad70cba..00000000 --- a/vendor/sebastian/comparator/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -Comparator - -Copyright (c) 2002-2020, Sebastian Bergmann . -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 Sebastian Bergmann nor the names of his - 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/sebastian/comparator/README.md b/vendor/sebastian/comparator/README.md deleted file mode 100644 index f6002db6..00000000 --- a/vendor/sebastian/comparator/README.md +++ /dev/null @@ -1,41 +0,0 @@ -# sebastian/comparator - -[![CI Status](https://github.com/sebastianbergmann/comparator/workflows/CI/badge.svg)](https://github.com/sebastianbergmann/comparator/actions) -[![Type Coverage](https://shepherd.dev/github/sebastianbergmann/comparator/coverage.svg)](https://shepherd.dev/github/sebastianbergmann/comparator) - -This component provides the functionality to compare PHP values for equality. - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - -``` -composer require sebastian/comparator -``` - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - -``` -composer require --dev sebastian/comparator -``` - -## Usage - -```php -getComparatorFor($date1, $date2); - -try { - $comparator->assertEquals($date1, $date2); - print "Dates match"; -} catch (ComparisonFailure $failure) { - print "Dates don't match"; -} -``` diff --git a/vendor/sebastian/comparator/composer.json b/vendor/sebastian/comparator/composer.json deleted file mode 100644 index b758e03c..00000000 --- a/vendor/sebastian/comparator/composer.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "name": "sebastian/comparator", - "description": "Provides the functionality to compare PHP values for equality", - "keywords": ["comparator","compare","equality"], - "homepage": "https://github.com/sebastianbergmann/comparator", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - } - ], - "prefer-stable": true, - "require": { - "php": ">=7.3", - "sebastian/diff": "^4.0", - "sebastian/exporter": "^4.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "config": { - "platform": { - "php": "7.3.0" - }, - "optimize-autoloader": true, - "sort-packages": true - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "autoload-dev": { - "classmap": [ - "tests/_fixture" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - } -} - diff --git a/vendor/sebastian/comparator/src/ArrayComparator.php b/vendor/sebastian/comparator/src/ArrayComparator.php deleted file mode 100644 index 5d9fbce6..00000000 --- a/vendor/sebastian/comparator/src/ArrayComparator.php +++ /dev/null @@ -1,141 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -use function array_key_exists; -use function is_array; -use function sort; -use function sprintf; -use function str_replace; -use function trim; - -/** - * Compares arrays for equality. - * - * Arrays are equal if they contain the same key-value pairs. - * The order of the keys does not matter. - * The types of key-value pairs do not matter. - */ -class ArrayComparator extends Comparator -{ - /** - * Returns whether the comparator can compare two values. - * - * @param mixed $expected The first value to compare - * @param mixed $actual The second value to compare - * - * @return bool - */ - public function accepts($expected, $actual) - { - return is_array($expected) && is_array($actual); - } - - /** - * Asserts that two arrays are equal. - * - * @param mixed $expected First value to compare - * @param mixed $actual Second value to compare - * @param float $delta Allowed numerical distance between two values to consider them equal - * @param bool $canonicalize Arrays are sorted before comparison when set to true - * @param bool $ignoreCase Case is ignored when set to true - * @param array $processed List of already processed elements (used to prevent infinite recursion) - * - * @throws ComparisonFailure - */ - public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false, array &$processed = [])/*: void*/ - { - if ($canonicalize) { - sort($expected); - sort($actual); - } - - $remaining = $actual; - $actualAsString = "Array (\n"; - $expectedAsString = "Array (\n"; - $equal = true; - - foreach ($expected as $key => $value) { - unset($remaining[$key]); - - if (!array_key_exists($key, $actual)) { - $expectedAsString .= sprintf( - " %s => %s\n", - $this->exporter->export($key), - $this->exporter->shortenedExport($value) - ); - - $equal = false; - - continue; - } - - try { - $comparator = $this->factory->getComparatorFor($value, $actual[$key]); - $comparator->assertEquals($value, $actual[$key], $delta, $canonicalize, $ignoreCase, $processed); - - $expectedAsString .= sprintf( - " %s => %s\n", - $this->exporter->export($key), - $this->exporter->shortenedExport($value) - ); - - $actualAsString .= sprintf( - " %s => %s\n", - $this->exporter->export($key), - $this->exporter->shortenedExport($actual[$key]) - ); - } catch (ComparisonFailure $e) { - $expectedAsString .= sprintf( - " %s => %s\n", - $this->exporter->export($key), - $e->getExpectedAsString() ? $this->indent($e->getExpectedAsString()) : $this->exporter->shortenedExport($e->getExpected()) - ); - - $actualAsString .= sprintf( - " %s => %s\n", - $this->exporter->export($key), - $e->getActualAsString() ? $this->indent($e->getActualAsString()) : $this->exporter->shortenedExport($e->getActual()) - ); - - $equal = false; - } - } - - foreach ($remaining as $key => $value) { - $actualAsString .= sprintf( - " %s => %s\n", - $this->exporter->export($key), - $this->exporter->shortenedExport($value) - ); - - $equal = false; - } - - $expectedAsString .= ')'; - $actualAsString .= ')'; - - if (!$equal) { - throw new ComparisonFailure( - $expected, - $actual, - $expectedAsString, - $actualAsString, - false, - 'Failed asserting that two arrays are equal.' - ); - } - } - - protected function indent($lines) - { - return trim(str_replace("\n", "\n ", $lines)); - } -} diff --git a/vendor/sebastian/comparator/src/Comparator.php b/vendor/sebastian/comparator/src/Comparator.php deleted file mode 100644 index e1906c16..00000000 --- a/vendor/sebastian/comparator/src/Comparator.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -use SebastianBergmann\Exporter\Exporter; - -/** - * Abstract base class for comparators which compare values for equality. - */ -abstract class Comparator -{ - /** - * @var Factory - */ - protected $factory; - - /** - * @var Exporter - */ - protected $exporter; - - public function __construct() - { - $this->exporter = new Exporter; - } - - public function setFactory(Factory $factory)/*: void*/ - { - $this->factory = $factory; - } - - /** - * Returns whether the comparator can compare two values. - * - * @param mixed $expected The first value to compare - * @param mixed $actual The second value to compare - * - * @return bool - */ - abstract public function accepts($expected, $actual); - - /** - * Asserts that two values are equal. - * - * @param mixed $expected First value to compare - * @param mixed $actual Second value to compare - * @param float $delta Allowed numerical distance between two values to consider them equal - * @param bool $canonicalize Arrays are sorted before comparison when set to true - * @param bool $ignoreCase Case is ignored when set to true - * - * @throws ComparisonFailure - */ - abstract public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false); -} diff --git a/vendor/sebastian/comparator/src/ComparisonFailure.php b/vendor/sebastian/comparator/src/ComparisonFailure.php deleted file mode 100644 index 857314da..00000000 --- a/vendor/sebastian/comparator/src/ComparisonFailure.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 SebastianBergmann\Comparator; - -use RuntimeException; -use SebastianBergmann\Diff\Differ; -use SebastianBergmann\Diff\Output\UnifiedDiffOutputBuilder; - -/** - * Thrown when an assertion for string equality failed. - */ -class ComparisonFailure extends RuntimeException -{ - /** - * Expected value of the retrieval which does not match $actual. - * - * @var mixed - */ - protected $expected; - - /** - * Actually retrieved value which does not match $expected. - * - * @var mixed - */ - protected $actual; - - /** - * The string representation of the expected value. - * - * @var string - */ - protected $expectedAsString; - - /** - * The string representation of the actual value. - * - * @var string - */ - protected $actualAsString; - - /** - * @var bool - */ - protected $identical; - - /** - * Optional message which is placed in front of the first line - * returned by toString(). - * - * @var string - */ - protected $message; - - /** - * Initialises with the expected value and the actual value. - * - * @param mixed $expected expected value retrieved - * @param mixed $actual actual value retrieved - * @param string $expectedAsString - * @param string $actualAsString - * @param bool $identical - * @param string $message a string which is prefixed on all returned lines - * in the difference output - */ - public function __construct($expected, $actual, $expectedAsString, $actualAsString, $identical = false, $message = '') - { - $this->expected = $expected; - $this->actual = $actual; - $this->expectedAsString = $expectedAsString; - $this->actualAsString = $actualAsString; - $this->message = $message; - } - - public function getActual() - { - return $this->actual; - } - - public function getExpected() - { - return $this->expected; - } - - /** - * @return string - */ - public function getActualAsString() - { - return $this->actualAsString; - } - - /** - * @return string - */ - public function getExpectedAsString() - { - return $this->expectedAsString; - } - - /** - * @return string - */ - public function getDiff() - { - if (!$this->actualAsString && !$this->expectedAsString) { - return ''; - } - - $differ = new Differ(new UnifiedDiffOutputBuilder("\n--- Expected\n+++ Actual\n")); - - return $differ->diff($this->expectedAsString, $this->actualAsString); - } - - /** - * @return string - */ - public function toString() - { - return $this->message . $this->getDiff(); - } -} diff --git a/vendor/sebastian/comparator/src/DOMNodeComparator.php b/vendor/sebastian/comparator/src/DOMNodeComparator.php deleted file mode 100644 index 5bf854ea..00000000 --- a/vendor/sebastian/comparator/src/DOMNodeComparator.php +++ /dev/null @@ -1,93 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -use function sprintf; -use function strtolower; -use DOMDocument; -use DOMNode; -use ValueError; - -/** - * Compares DOMNode instances for equality. - */ -class DOMNodeComparator extends ObjectComparator -{ - /** - * Returns whether the comparator can compare two values. - * - * @param mixed $expected The first value to compare - * @param mixed $actual The second value to compare - * - * @return bool - */ - public function accepts($expected, $actual) - { - return $expected instanceof DOMNode && $actual instanceof DOMNode; - } - - /** - * Asserts that two values are equal. - * - * @param mixed $expected First value to compare - * @param mixed $actual Second value to compare - * @param float $delta Allowed numerical distance between two values to consider them equal - * @param bool $canonicalize Arrays are sorted before comparison when set to true - * @param bool $ignoreCase Case is ignored when set to true - * @param array $processed List of already processed elements (used to prevent infinite recursion) - * - * @throws ComparisonFailure - */ - public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false, array &$processed = [])/*: void*/ - { - $expectedAsString = $this->nodeToText($expected, true, $ignoreCase); - $actualAsString = $this->nodeToText($actual, true, $ignoreCase); - - if ($expectedAsString !== $actualAsString) { - $type = $expected instanceof DOMDocument ? 'documents' : 'nodes'; - - throw new ComparisonFailure( - $expected, - $actual, - $expectedAsString, - $actualAsString, - false, - sprintf("Failed asserting that two DOM %s are equal.\n", $type) - ); - } - } - - /** - * Returns the normalized, whitespace-cleaned, and indented textual - * representation of a DOMNode. - */ - private function nodeToText(DOMNode $node, bool $canonicalize, bool $ignoreCase): string - { - if ($canonicalize) { - $document = new DOMDocument; - - try { - @$document->loadXML($node->C14N()); - } catch (ValueError $e) { - } - - $node = $document; - } - - $document = $node instanceof DOMDocument ? $node : $node->ownerDocument; - - $document->formatOutput = true; - $document->normalizeDocument(); - - $text = $node instanceof DOMDocument ? $node->saveXML() : $document->saveXML($node); - - return $ignoreCase ? strtolower($text) : $text; - } -} diff --git a/vendor/sebastian/comparator/src/DateTimeComparator.php b/vendor/sebastian/comparator/src/DateTimeComparator.php deleted file mode 100644 index 0a303b62..00000000 --- a/vendor/sebastian/comparator/src/DateTimeComparator.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 SebastianBergmann\Comparator; - -use function abs; -use function floor; -use function sprintf; -use DateInterval; -use DateTime; -use DateTimeInterface; -use DateTimeZone; -use Exception; - -/** - * Compares DateTimeInterface instances for equality. - */ -class DateTimeComparator extends ObjectComparator -{ - /** - * Returns whether the comparator can compare two values. - * - * @param mixed $expected The first value to compare - * @param mixed $actual The second value to compare - * - * @return bool - */ - public function accepts($expected, $actual) - { - return ($expected instanceof DateTime || $expected instanceof DateTimeInterface) && - ($actual instanceof DateTime || $actual instanceof DateTimeInterface); - } - - /** - * Asserts that two values are equal. - * - * @param mixed $expected First value to compare - * @param mixed $actual Second value to compare - * @param float $delta Allowed numerical distance between two values to consider them equal - * @param bool $canonicalize Arrays are sorted before comparison when set to true - * @param bool $ignoreCase Case is ignored when set to true - * @param array $processed List of already processed elements (used to prevent infinite recursion) - * - * @throws Exception - * @throws ComparisonFailure - */ - public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false, array &$processed = [])/*: void*/ - { - /** @var DateTimeInterface $expected */ - /** @var DateTimeInterface $actual */ - $absDelta = abs($delta); - $delta = new DateInterval(sprintf('PT%dS', $absDelta)); - $delta->f = $absDelta - floor($absDelta); - - $actualClone = (clone $actual) - ->setTimezone(new DateTimeZone('UTC')); - - $expectedLower = (clone $expected) - ->setTimezone(new DateTimeZone('UTC')) - ->sub($delta); - - $expectedUpper = (clone $expected) - ->setTimezone(new DateTimeZone('UTC')) - ->add($delta); - - if ($actualClone < $expectedLower || $actualClone > $expectedUpper) { - throw new ComparisonFailure( - $expected, - $actual, - $this->dateTimeToString($expected), - $this->dateTimeToString($actual), - false, - 'Failed asserting that two DateTime objects are equal.' - ); - } - } - - /** - * Returns an ISO 8601 formatted string representation of a datetime or - * 'Invalid DateTimeInterface object' if the provided DateTimeInterface was not properly - * initialized. - */ - private function dateTimeToString(DateTimeInterface $datetime): string - { - $string = $datetime->format('Y-m-d\TH:i:s.uO'); - - return $string ?: 'Invalid DateTimeInterface object'; - } -} diff --git a/vendor/sebastian/comparator/src/DoubleComparator.php b/vendor/sebastian/comparator/src/DoubleComparator.php deleted file mode 100644 index 42352219..00000000 --- a/vendor/sebastian/comparator/src/DoubleComparator.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -use function is_float; -use function is_numeric; - -/** - * Compares doubles for equality. - * - * @deprecated since v3.0.5 and v4.0.8 - */ -class DoubleComparator extends NumericComparator -{ - /** - * Smallest value available in PHP. - * - * @var float - */ - public const EPSILON = 0.0000000001; - - /** - * Returns whether the comparator can compare two values. - * - * @param mixed $expected The first value to compare - * @param mixed $actual The second value to compare - * - * @return bool - */ - public function accepts($expected, $actual) - { - return (is_float($expected) || is_float($actual)) && is_numeric($expected) && is_numeric($actual); - } - - /** - * Asserts that two values are equal. - * - * @param mixed $expected First value to compare - * @param mixed $actual Second value to compare - * @param float $delta Allowed numerical distance between two values to consider them equal - * @param bool $canonicalize Arrays are sorted before comparison when set to true - * @param bool $ignoreCase Case is ignored when set to true - * - * @throws ComparisonFailure - */ - public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false)/*: void*/ - { - if ($delta == 0) { - $delta = self::EPSILON; - } - - parent::assertEquals($expected, $actual, $delta, $canonicalize, $ignoreCase); - } -} diff --git a/vendor/sebastian/comparator/src/ExceptionComparator.php b/vendor/sebastian/comparator/src/ExceptionComparator.php deleted file mode 100644 index 1fc0174e..00000000 --- a/vendor/sebastian/comparator/src/ExceptionComparator.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -use Exception; - -/** - * Compares Exception instances for equality. - */ -class ExceptionComparator extends ObjectComparator -{ - /** - * Returns whether the comparator can compare two values. - * - * @param mixed $expected The first value to compare - * @param mixed $actual The second value to compare - * - * @return bool - */ - public function accepts($expected, $actual) - { - return $expected instanceof Exception && $actual instanceof Exception; - } - - /** - * Converts an object to an array containing all of its private, protected - * and public properties. - * - * @param object $object - * - * @return array - */ - protected function toArray($object) - { - $array = parent::toArray($object); - - unset( - $array['file'], - $array['line'], - $array['trace'], - $array['string'], - $array['xdebug_message'] - ); - - return $array; - } -} diff --git a/vendor/sebastian/comparator/src/Factory.php b/vendor/sebastian/comparator/src/Factory.php deleted file mode 100644 index 6a8b5b44..00000000 --- a/vendor/sebastian/comparator/src/Factory.php +++ /dev/null @@ -1,141 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -use function array_unshift; - -/** - * Factory for comparators which compare values for equality. - */ -class Factory -{ - /** - * @var Factory - */ - private static $instance; - - /** - * @var Comparator[] - */ - private $customComparators = []; - - /** - * @var Comparator[] - */ - private $defaultComparators = []; - - /** - * @return Factory - */ - public static function getInstance() - { - if (self::$instance === null) { - self::$instance = new self; // @codeCoverageIgnore - } - - return self::$instance; - } - - /** - * Constructs a new factory. - */ - public function __construct() - { - $this->registerDefaultComparators(); - } - - /** - * Returns the correct comparator for comparing two values. - * - * @param mixed $expected The first value to compare - * @param mixed $actual The second value to compare - * - * @return Comparator - */ - public function getComparatorFor($expected, $actual) - { - foreach ($this->customComparators as $comparator) { - if ($comparator->accepts($expected, $actual)) { - return $comparator; - } - } - - foreach ($this->defaultComparators as $comparator) { - if ($comparator->accepts($expected, $actual)) { - return $comparator; - } - } - - throw new RuntimeException('No suitable Comparator implementation found'); - } - - /** - * Registers a new comparator. - * - * This comparator will be returned by getComparatorFor() if its accept() method - * returns TRUE for the compared values. It has higher priority than the - * existing comparators, meaning that its accept() method will be invoked - * before those of the other comparators. - * - * @param Comparator $comparator The comparator to be registered - */ - public function register(Comparator $comparator)/*: void*/ - { - array_unshift($this->customComparators, $comparator); - - $comparator->setFactory($this); - } - - /** - * Unregisters a comparator. - * - * This comparator will no longer be considered by getComparatorFor(). - * - * @param Comparator $comparator The comparator to be unregistered - */ - public function unregister(Comparator $comparator)/*: void*/ - { - foreach ($this->customComparators as $key => $_comparator) { - if ($comparator === $_comparator) { - unset($this->customComparators[$key]); - } - } - } - - /** - * Unregisters all non-default comparators. - */ - public function reset()/*: void*/ - { - $this->customComparators = []; - } - - private function registerDefaultComparators(): void - { - $this->registerDefaultComparator(new MockObjectComparator); - $this->registerDefaultComparator(new DateTimeComparator); - $this->registerDefaultComparator(new DOMNodeComparator); - $this->registerDefaultComparator(new SplObjectStorageComparator); - $this->registerDefaultComparator(new ExceptionComparator); - $this->registerDefaultComparator(new ObjectComparator); - $this->registerDefaultComparator(new ResourceComparator); - $this->registerDefaultComparator(new ArrayComparator); - $this->registerDefaultComparator(new NumericComparator); - $this->registerDefaultComparator(new ScalarComparator); - $this->registerDefaultComparator(new TypeComparator); - } - - private function registerDefaultComparator(Comparator $comparator): void - { - $this->defaultComparators[] = $comparator; - - $comparator->setFactory($this); - } -} diff --git a/vendor/sebastian/comparator/src/MockObjectComparator.php b/vendor/sebastian/comparator/src/MockObjectComparator.php deleted file mode 100644 index cb670316..00000000 --- a/vendor/sebastian/comparator/src/MockObjectComparator.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -use PHPUnit\Framework\MockObject\MockObject; - -/** - * Compares PHPUnit\Framework\MockObject\MockObject instances for equality. - */ -class MockObjectComparator extends ObjectComparator -{ - /** - * Returns whether the comparator can compare two values. - * - * @param mixed $expected The first value to compare - * @param mixed $actual The second value to compare - * - * @return bool - */ - public function accepts($expected, $actual) - { - return $expected instanceof MockObject && $actual instanceof MockObject; - } - - /** - * Converts an object to an array containing all of its private, protected - * and public properties. - * - * @param object $object - * - * @return array - */ - protected function toArray($object) - { - $array = parent::toArray($object); - - unset($array['__phpunit_invocationMocker']); - - return $array; - } -} diff --git a/vendor/sebastian/comparator/src/NumericComparator.php b/vendor/sebastian/comparator/src/NumericComparator.php deleted file mode 100644 index 841881c9..00000000 --- a/vendor/sebastian/comparator/src/NumericComparator.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 SebastianBergmann\Comparator; - -use function abs; -use function is_float; -use function is_infinite; -use function is_nan; -use function is_numeric; -use function is_string; -use function sprintf; - -/** - * Compares numerical values for equality. - */ -class NumericComparator extends ScalarComparator -{ - /** - * Returns whether the comparator can compare two values. - * - * @param mixed $expected The first value to compare - * @param mixed $actual The second value to compare - * - * @return bool - */ - public function accepts($expected, $actual) - { - // all numerical values, but not if both of them are strings - return is_numeric($expected) && is_numeric($actual) && - !(is_string($expected) && is_string($actual)); - } - - /** - * Asserts that two values are equal. - * - * @param mixed $expected First value to compare - * @param mixed $actual Second value to compare - * @param float $delta Allowed numerical distance between two values to consider them equal - * @param bool $canonicalize Arrays are sorted before comparison when set to true - * @param bool $ignoreCase Case is ignored when set to true - * - * @throws ComparisonFailure - */ - public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false)/*: void*/ - { - if ($this->isInfinite($actual) && $this->isInfinite($expected)) { - return; - } - - if (($this->isInfinite($actual) xor $this->isInfinite($expected)) || - ($this->isNan($actual) || $this->isNan($expected)) || - abs($actual - $expected) > $delta) { - throw new ComparisonFailure( - $expected, - $actual, - '', - '', - false, - sprintf( - 'Failed asserting that %s matches expected %s.', - $this->exporter->export($actual), - $this->exporter->export($expected) - ) - ); - } - } - - private function isInfinite($value): bool - { - return is_float($value) && is_infinite($value); - } - - private function isNan($value): bool - { - return is_float($value) && is_nan($value); - } -} diff --git a/vendor/sebastian/comparator/src/ObjectComparator.php b/vendor/sebastian/comparator/src/ObjectComparator.php deleted file mode 100644 index 9380ba15..00000000 --- a/vendor/sebastian/comparator/src/ObjectComparator.php +++ /dev/null @@ -1,112 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -use function get_class; -use function in_array; -use function is_object; -use function sprintf; -use function substr_replace; - -/** - * Compares objects for equality. - */ -class ObjectComparator extends ArrayComparator -{ - /** - * Returns whether the comparator can compare two values. - * - * @param mixed $expected The first value to compare - * @param mixed $actual The second value to compare - * - * @return bool - */ - public function accepts($expected, $actual) - { - return is_object($expected) && is_object($actual); - } - - /** - * Asserts that two values are equal. - * - * @param mixed $expected First value to compare - * @param mixed $actual Second value to compare - * @param float $delta Allowed numerical distance between two values to consider them equal - * @param bool $canonicalize Arrays are sorted before comparison when set to true - * @param bool $ignoreCase Case is ignored when set to true - * @param array $processed List of already processed elements (used to prevent infinite recursion) - * - * @throws ComparisonFailure - */ - public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false, array &$processed = [])/*: void*/ - { - if (get_class($actual) !== get_class($expected)) { - throw new ComparisonFailure( - $expected, - $actual, - $this->exporter->export($expected), - $this->exporter->export($actual), - false, - sprintf( - '%s is not instance of expected class "%s".', - $this->exporter->export($actual), - get_class($expected) - ) - ); - } - - // don't compare twice to allow for cyclic dependencies - if (in_array([$actual, $expected], $processed, true) || - in_array([$expected, $actual], $processed, true)) { - return; - } - - $processed[] = [$actual, $expected]; - - // don't compare objects if they are identical - // this helps to avoid the error "maximum function nesting level reached" - // CAUTION: this conditional clause is not tested - if ($actual !== $expected) { - try { - parent::assertEquals( - $this->toArray($expected), - $this->toArray($actual), - $delta, - $canonicalize, - $ignoreCase, - $processed - ); - } catch (ComparisonFailure $e) { - throw new ComparisonFailure( - $expected, - $actual, - // replace "Array" with "MyClass object" - substr_replace($e->getExpectedAsString(), get_class($expected) . ' Object', 0, 5), - substr_replace($e->getActualAsString(), get_class($actual) . ' Object', 0, 5), - false, - 'Failed asserting that two objects are equal.' - ); - } - } - } - - /** - * Converts an object to an array containing all of its private, protected - * and public properties. - * - * @param object $object - * - * @return array - */ - protected function toArray($object) - { - return $this->exporter->toArray($object); - } -} diff --git a/vendor/sebastian/comparator/src/ResourceComparator.php b/vendor/sebastian/comparator/src/ResourceComparator.php deleted file mode 100644 index 7822598b..00000000 --- a/vendor/sebastian/comparator/src/ResourceComparator.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -use function is_resource; - -/** - * Compares resources for equality. - */ -class ResourceComparator extends Comparator -{ - /** - * Returns whether the comparator can compare two values. - * - * @param mixed $expected The first value to compare - * @param mixed $actual The second value to compare - * - * @return bool - */ - public function accepts($expected, $actual) - { - return is_resource($expected) && is_resource($actual); - } - - /** - * Asserts that two values are equal. - * - * @param mixed $expected First value to compare - * @param mixed $actual Second value to compare - * @param float $delta Allowed numerical distance between two values to consider them equal - * @param bool $canonicalize Arrays are sorted before comparison when set to true - * @param bool $ignoreCase Case is ignored when set to true - * - * @throws ComparisonFailure - */ - public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false)/*: void*/ - { - if ($actual != $expected) { - throw new ComparisonFailure( - $expected, - $actual, - $this->exporter->export($expected), - $this->exporter->export($actual) - ); - } - } -} diff --git a/vendor/sebastian/comparator/src/ScalarComparator.php b/vendor/sebastian/comparator/src/ScalarComparator.php deleted file mode 100644 index 7f131229..00000000 --- a/vendor/sebastian/comparator/src/ScalarComparator.php +++ /dev/null @@ -1,99 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -use function is_bool; -use function is_object; -use function is_scalar; -use function is_string; -use function method_exists; -use function sprintf; -use function strtolower; - -/** - * Compares scalar or NULL values for equality. - */ -class ScalarComparator extends Comparator -{ - /** - * Returns whether the comparator can compare two values. - * - * @param mixed $expected The first value to compare - * @param mixed $actual The second value to compare - * - * @return bool - * - * @since Method available since Release 3.6.0 - */ - public function accepts($expected, $actual) - { - return ((is_scalar($expected) xor null === $expected) && - (is_scalar($actual) xor null === $actual)) - // allow comparison between strings and objects featuring __toString() - || (is_string($expected) && is_object($actual) && method_exists($actual, '__toString')) - || (is_object($expected) && method_exists($expected, '__toString') && is_string($actual)); - } - - /** - * Asserts that two values are equal. - * - * @param mixed $expected First value to compare - * @param mixed $actual Second value to compare - * @param float $delta Allowed numerical distance between two values to consider them equal - * @param bool $canonicalize Arrays are sorted before comparison when set to true - * @param bool $ignoreCase Case is ignored when set to true - * - * @throws ComparisonFailure - */ - public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false)/*: void*/ - { - $expectedToCompare = $expected; - $actualToCompare = $actual; - - // always compare as strings to avoid strange behaviour - // otherwise 0 == 'Foobar' - if ((is_string($expected) && !is_bool($actual)) || (is_string($actual) && !is_bool($expected))) { - $expectedToCompare = (string) $expectedToCompare; - $actualToCompare = (string) $actualToCompare; - - if ($ignoreCase) { - $expectedToCompare = strtolower($expectedToCompare); - $actualToCompare = strtolower($actualToCompare); - } - } - - if ($expectedToCompare !== $actualToCompare && is_string($expected) && is_string($actual)) { - throw new ComparisonFailure( - $expected, - $actual, - $this->exporter->export($expected), - $this->exporter->export($actual), - false, - 'Failed asserting that two strings are equal.' - ); - } - - if ($expectedToCompare != $actualToCompare) { - throw new ComparisonFailure( - $expected, - $actual, - // no diff is required - '', - '', - false, - sprintf( - 'Failed asserting that %s matches expected %s.', - $this->exporter->export($actual), - $this->exporter->export($expected) - ) - ); - } - } -} diff --git a/vendor/sebastian/comparator/src/SplObjectStorageComparator.php b/vendor/sebastian/comparator/src/SplObjectStorageComparator.php deleted file mode 100644 index d9b6f541..00000000 --- a/vendor/sebastian/comparator/src/SplObjectStorageComparator.php +++ /dev/null @@ -1,71 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -use SplObjectStorage; - -/** - * Compares \SplObjectStorage instances for equality. - */ -class SplObjectStorageComparator extends Comparator -{ - /** - * Returns whether the comparator can compare two values. - * - * @param mixed $expected The first value to compare - * @param mixed $actual The second value to compare - * - * @return bool - */ - public function accepts($expected, $actual) - { - return $expected instanceof SplObjectStorage && $actual instanceof SplObjectStorage; - } - - /** - * Asserts that two values are equal. - * - * @param mixed $expected First value to compare - * @param mixed $actual Second value to compare - * @param float $delta Allowed numerical distance between two values to consider them equal - * @param bool $canonicalize Arrays are sorted before comparison when set to true - * @param bool $ignoreCase Case is ignored when set to true - * - * @throws ComparisonFailure - */ - public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false)/*: void*/ - { - foreach ($actual as $object) { - if (!$expected->contains($object)) { - throw new ComparisonFailure( - $expected, - $actual, - $this->exporter->export($expected), - $this->exporter->export($actual), - false, - 'Failed asserting that two objects are equal.' - ); - } - } - - foreach ($expected as $object) { - if (!$actual->contains($object)) { - throw new ComparisonFailure( - $expected, - $actual, - $this->exporter->export($expected), - $this->exporter->export($actual), - false, - 'Failed asserting that two objects are equal.' - ); - } - } - } -} diff --git a/vendor/sebastian/comparator/src/TypeComparator.php b/vendor/sebastian/comparator/src/TypeComparator.php deleted file mode 100644 index b0d38d72..00000000 --- a/vendor/sebastian/comparator/src/TypeComparator.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 SebastianBergmann\Comparator; - -use function gettype; -use function sprintf; - -/** - * Compares values for type equality. - */ -class TypeComparator extends Comparator -{ - /** - * Returns whether the comparator can compare two values. - * - * @param mixed $expected The first value to compare - * @param mixed $actual The second value to compare - * - * @return bool - */ - public function accepts($expected, $actual) - { - return true; - } - - /** - * Asserts that two values are equal. - * - * @param mixed $expected First value to compare - * @param mixed $actual Second value to compare - * @param float $delta Allowed numerical distance between two values to consider them equal - * @param bool $canonicalize Arrays are sorted before comparison when set to true - * @param bool $ignoreCase Case is ignored when set to true - * - * @throws ComparisonFailure - */ - public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false)/*: void*/ - { - if (gettype($expected) != gettype($actual)) { - throw new ComparisonFailure( - $expected, - $actual, - // we don't need a diff - '', - '', - false, - sprintf( - '%s does not match expected type "%s".', - $this->exporter->shortenedExport($actual), - gettype($expected) - ) - ); - } - } -} diff --git a/vendor/sebastian/comparator/src/exceptions/Exception.php b/vendor/sebastian/comparator/src/exceptions/Exception.php deleted file mode 100644 index 8975aaf1..00000000 --- a/vendor/sebastian/comparator/src/exceptions/Exception.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. - */ -namespace SebastianBergmann\Comparator; - -use Throwable; - -interface Exception extends Throwable -{ -} diff --git a/vendor/sebastian/comparator/src/exceptions/RuntimeException.php b/vendor/sebastian/comparator/src/exceptions/RuntimeException.php deleted file mode 100644 index ca726084..00000000 --- a/vendor/sebastian/comparator/src/exceptions/RuntimeException.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Comparator; - -final class RuntimeException extends \RuntimeException implements Exception -{ -} diff --git a/vendor/sebastian/complexity/.psalm/baseline.xml b/vendor/sebastian/complexity/.psalm/baseline.xml deleted file mode 100644 index 77e688e0..00000000 --- a/vendor/sebastian/complexity/.psalm/baseline.xml +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/vendor/sebastian/complexity/.psalm/config.xml b/vendor/sebastian/complexity/.psalm/config.xml deleted file mode 100644 index 8172fe15..00000000 --- a/vendor/sebastian/complexity/.psalm/config.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - diff --git a/vendor/sebastian/complexity/ChangeLog.md b/vendor/sebastian/complexity/ChangeLog.md deleted file mode 100644 index cb93ff62..00000000 --- a/vendor/sebastian/complexity/ChangeLog.md +++ /dev/null @@ -1,30 +0,0 @@ -# ChangeLog - -All notable changes are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. - -## [2.0.2] - 2020-10-26 - -### Fixed - -* `SebastianBergmann\Complexity\Exception` now correctly extends `\Throwable` - -## [2.0.1] - 2020-09-28 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.3 || ^8.0` to `>=7.3` - -## [2.0.0] - 2020-07-25 - -### Removed - -* The `ParentConnectingVisitor` has been removed (it should have been marked as `@internal`) - -## [1.0.0] - 2020-07-22 - -* Initial release - -[2.0.2]: https://github.com/sebastianbergmann/complexity/compare/2.0.1...2.0.2 -[2.0.1]: https://github.com/sebastianbergmann/complexity/compare/2.0.0...2.0.1 -[2.0.0]: https://github.com/sebastianbergmann/complexity/compare/1.0.0...2.0.0 -[1.0.0]: https://github.com/sebastianbergmann/complexity/compare/70ee0ad32d9e2be3f85beffa3e2eb474193f2487...1.0.0 diff --git a/vendor/sebastian/complexity/LICENSE b/vendor/sebastian/complexity/LICENSE deleted file mode 100644 index 5f818df6..00000000 --- a/vendor/sebastian/complexity/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -sebastian/complexity - -Copyright (c) 2020, Sebastian Bergmann . -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 Sebastian Bergmann nor the names of his - 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/sebastian/complexity/README.md b/vendor/sebastian/complexity/README.md deleted file mode 100644 index 5f53b0b5..00000000 --- a/vendor/sebastian/complexity/README.md +++ /dev/null @@ -1,22 +0,0 @@ -# sebastian/complexity - -Library for calculating the complexity of PHP code units. - -[![Latest Stable Version](https://img.shields.io/packagist/v/sebastian/complexity.svg?style=flat-square)](https://packagist.org/packages/sebastian/complexity) -[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.3-8892BF.svg?style=flat-square)](https://php.net/) -[![CI Status](https://github.com/sebastianbergmann/complexity/workflows/CI/badge.svg?branch=master&event=push)](https://phpunit.de/build-status.html) -[![Type Coverage](https://shepherd.dev/github/sebastianbergmann/complexity/coverage.svg)](https://shepherd.dev/github/sebastianbergmann/complexity) - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - -``` -composer require sebastian/complexity -``` - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - -``` -composer require --dev sebastian/complexity -``` diff --git a/vendor/sebastian/complexity/composer.json b/vendor/sebastian/complexity/composer.json deleted file mode 100644 index 7aa38314..00000000 --- a/vendor/sebastian/complexity/composer.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "sebastian/complexity", - "description": "Library for calculating the complexity of PHP code units", - "type": "library", - "homepage": "https://github.com/sebastianbergmann/complexity", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "support": { - "issues": "https://github.com/sebastianbergmann/complexity/issues" - }, - "require": { - "php": ">=7.3", - "nikic/php-parser": "^4.7" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "config": { - "platform": { - "php": "7.3.0" - }, - "optimize-autoloader": true, - "sort-packages": true - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - } -} diff --git a/vendor/sebastian/complexity/src/Calculator.php b/vendor/sebastian/complexity/src/Calculator.php deleted file mode 100644 index 9abdcd16..00000000 --- a/vendor/sebastian/complexity/src/Calculator.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 SebastianBergmann\Complexity; - -use PhpParser\Error; -use PhpParser\Lexer; -use PhpParser\Node; -use PhpParser\NodeTraverser; -use PhpParser\NodeVisitor\NameResolver; -use PhpParser\NodeVisitor\ParentConnectingVisitor; -use PhpParser\Parser; -use PhpParser\ParserFactory; - -final class Calculator -{ - /** - * @throws RuntimeException - */ - public function calculateForSourceFile(string $sourceFile): ComplexityCollection - { - return $this->calculateForSourceString(file_get_contents($sourceFile)); - } - - /** - * @throws RuntimeException - */ - public function calculateForSourceString(string $source): ComplexityCollection - { - try { - $nodes = $this->parser()->parse($source); - - assert($nodes !== null); - - return $this->calculateForAbstractSyntaxTree($nodes); - - // @codeCoverageIgnoreStart - } catch (Error $error) { - throw new RuntimeException( - $error->getMessage(), - (int) $error->getCode(), - $error - ); - } - // @codeCoverageIgnoreEnd - } - - /** - * @param Node[] $nodes - * - * @throws RuntimeException - */ - public function calculateForAbstractSyntaxTree(array $nodes): ComplexityCollection - { - $traverser = new NodeTraverser; - $complexityCalculatingVisitor = new ComplexityCalculatingVisitor(true); - - $traverser->addVisitor(new NameResolver); - $traverser->addVisitor(new ParentConnectingVisitor); - $traverser->addVisitor($complexityCalculatingVisitor); - - try { - /* @noinspection UnusedFunctionResultInspection */ - $traverser->traverse($nodes); - // @codeCoverageIgnoreStart - } catch (Error $error) { - throw new RuntimeException( - $error->getMessage(), - (int) $error->getCode(), - $error - ); - } - // @codeCoverageIgnoreEnd - - return $complexityCalculatingVisitor->result(); - } - - private function parser(): Parser - { - return (new ParserFactory)->create(ParserFactory::PREFER_PHP7, new Lexer); - } -} diff --git a/vendor/sebastian/complexity/src/Complexity/Complexity.php b/vendor/sebastian/complexity/src/Complexity/Complexity.php deleted file mode 100644 index dc6708dd..00000000 --- a/vendor/sebastian/complexity/src/Complexity/Complexity.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. - */ -namespace SebastianBergmann\Complexity; - -/** - * @psalm-immutable - */ -final class Complexity -{ - /** - * @var string - */ - private $name; - - /** - * @var int - */ - private $cyclomaticComplexity; - - public function __construct(string $name, int $cyclomaticComplexity) - { - $this->name = $name; - $this->cyclomaticComplexity = $cyclomaticComplexity; - } - - public function name(): string - { - return $this->name; - } - - public function cyclomaticComplexity(): int - { - return $this->cyclomaticComplexity; - } -} diff --git a/vendor/sebastian/complexity/src/Complexity/ComplexityCollection.php b/vendor/sebastian/complexity/src/Complexity/ComplexityCollection.php deleted file mode 100644 index ccbddbf7..00000000 --- a/vendor/sebastian/complexity/src/Complexity/ComplexityCollection.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Complexity; - -use function count; -use Countable; -use IteratorAggregate; - -/** - * @psalm-immutable - */ -final class ComplexityCollection implements Countable, IteratorAggregate -{ - /** - * @psalm-var list - */ - private $items = []; - - public static function fromList(Complexity ...$items): self - { - return new self($items); - } - - /** - * @psalm-param list $items - */ - private function __construct(array $items) - { - $this->items = $items; - } - - /** - * @psalm-return list - */ - public function asArray(): array - { - return $this->items; - } - - public function getIterator(): ComplexityCollectionIterator - { - return new ComplexityCollectionIterator($this); - } - - public function count(): int - { - return count($this->items); - } - - public function isEmpty(): bool - { - return empty($this->items); - } - - public function cyclomaticComplexity(): int - { - $cyclomaticComplexity = 0; - - foreach ($this as $item) { - $cyclomaticComplexity += $item->cyclomaticComplexity(); - } - - return $cyclomaticComplexity; - } -} diff --git a/vendor/sebastian/complexity/src/Complexity/ComplexityCollectionIterator.php b/vendor/sebastian/complexity/src/Complexity/ComplexityCollectionIterator.php deleted file mode 100644 index ec39e199..00000000 --- a/vendor/sebastian/complexity/src/Complexity/ComplexityCollectionIterator.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Complexity; - -use Iterator; - -final class ComplexityCollectionIterator implements Iterator -{ - /** - * @psalm-var list - */ - private $items; - - /** - * @var int - */ - private $position = 0; - - public function __construct(ComplexityCollection $items) - { - $this->items = $items->asArray(); - } - - public function rewind(): void - { - $this->position = 0; - } - - public function valid(): bool - { - return isset($this->items[$this->position]); - } - - public function key(): int - { - return $this->position; - } - - public function current(): Complexity - { - return $this->items[$this->position]; - } - - public function next(): void - { - $this->position++; - } -} diff --git a/vendor/sebastian/complexity/src/Exception/Exception.php b/vendor/sebastian/complexity/src/Exception/Exception.php deleted file mode 100644 index 897ecdcf..00000000 --- a/vendor/sebastian/complexity/src/Exception/Exception.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. - */ -namespace SebastianBergmann\Complexity; - -use Throwable; - -interface Exception extends Throwable -{ -} diff --git a/vendor/sebastian/complexity/src/Exception/RuntimeException.php b/vendor/sebastian/complexity/src/Exception/RuntimeException.php deleted file mode 100644 index 6c68a6f0..00000000 --- a/vendor/sebastian/complexity/src/Exception/RuntimeException.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Complexity; - -final class RuntimeException extends \RuntimeException implements Exception -{ -} diff --git a/vendor/sebastian/complexity/src/Visitor/ComplexityCalculatingVisitor.php b/vendor/sebastian/complexity/src/Visitor/ComplexityCalculatingVisitor.php deleted file mode 100644 index b69f2b09..00000000 --- a/vendor/sebastian/complexity/src/Visitor/ComplexityCalculatingVisitor.php +++ /dev/null @@ -1,109 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Complexity; - -use function assert; -use function is_array; -use PhpParser\Node; -use PhpParser\Node\Name; -use PhpParser\Node\Stmt; -use PhpParser\Node\Stmt\Class_; -use PhpParser\Node\Stmt\ClassMethod; -use PhpParser\Node\Stmt\Function_; -use PhpParser\Node\Stmt\Trait_; -use PhpParser\NodeTraverser; -use PhpParser\NodeVisitorAbstract; - -final class ComplexityCalculatingVisitor extends NodeVisitorAbstract -{ - /** - * @psalm-var list - */ - private $result = []; - - /** - * @var bool - */ - private $shortCircuitTraversal; - - public function __construct(bool $shortCircuitTraversal) - { - $this->shortCircuitTraversal = $shortCircuitTraversal; - } - - public function enterNode(Node $node): ?int - { - if (!$node instanceof ClassMethod && !$node instanceof Function_) { - return null; - } - - if ($node instanceof ClassMethod) { - $name = $this->classMethodName($node); - } else { - $name = $this->functionName($node); - } - - $statements = $node->getStmts(); - - assert(is_array($statements)); - - $this->result[] = new Complexity( - $name, - $this->cyclomaticComplexity($statements) - ); - - if ($this->shortCircuitTraversal) { - return NodeTraverser::DONT_TRAVERSE_CHILDREN; - } - - return null; - } - - public function result(): ComplexityCollection - { - return ComplexityCollection::fromList(...$this->result); - } - - /** - * @param Stmt[] $statements - */ - private function cyclomaticComplexity(array $statements): int - { - $traverser = new NodeTraverser; - - $cyclomaticComplexityCalculatingVisitor = new CyclomaticComplexityCalculatingVisitor; - - $traverser->addVisitor($cyclomaticComplexityCalculatingVisitor); - - /* @noinspection UnusedFunctionResultInspection */ - $traverser->traverse($statements); - - return $cyclomaticComplexityCalculatingVisitor->cyclomaticComplexity(); - } - - private function classMethodName(ClassMethod $node): string - { - $parent = $node->getAttribute('parent'); - - assert($parent instanceof Class_ || $parent instanceof Trait_); - assert(isset($parent->namespacedName)); - assert($parent->namespacedName instanceof Name); - - return $parent->namespacedName->toString() . '::' . $node->name->toString(); - } - - private function functionName(Function_ $node): string - { - assert(isset($node->namespacedName)); - assert($node->namespacedName instanceof Name); - - return $node->namespacedName->toString(); - } -} diff --git a/vendor/sebastian/complexity/src/Visitor/CyclomaticComplexityCalculatingVisitor.php b/vendor/sebastian/complexity/src/Visitor/CyclomaticComplexityCalculatingVisitor.php deleted file mode 100644 index d4430876..00000000 --- a/vendor/sebastian/complexity/src/Visitor/CyclomaticComplexityCalculatingVisitor.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Complexity; - -use function get_class; -use PhpParser\Node; -use PhpParser\Node\Expr\BinaryOp\BooleanAnd; -use PhpParser\Node\Expr\BinaryOp\BooleanOr; -use PhpParser\Node\Expr\BinaryOp\LogicalAnd; -use PhpParser\Node\Expr\BinaryOp\LogicalOr; -use PhpParser\Node\Expr\Ternary; -use PhpParser\Node\Stmt\Case_; -use PhpParser\Node\Stmt\Catch_; -use PhpParser\Node\Stmt\ElseIf_; -use PhpParser\Node\Stmt\For_; -use PhpParser\Node\Stmt\Foreach_; -use PhpParser\Node\Stmt\If_; -use PhpParser\Node\Stmt\While_; -use PhpParser\NodeVisitorAbstract; - -final class CyclomaticComplexityCalculatingVisitor extends NodeVisitorAbstract -{ - /** - * @var int - */ - private $cyclomaticComplexity = 1; - - public function enterNode(Node $node): void - { - /* @noinspection GetClassMissUseInspection */ - switch (get_class($node)) { - case BooleanAnd::class: - case BooleanOr::class: - case Case_::class: - case Catch_::class: - case ElseIf_::class: - case For_::class: - case Foreach_::class: - case If_::class: - case LogicalAnd::class: - case LogicalOr::class: - case Ternary::class: - case While_::class: - $this->cyclomaticComplexity++; - } - } - - public function cyclomaticComplexity(): int - { - return $this->cyclomaticComplexity; - } -} diff --git a/vendor/sebastian/diff/ChangeLog.md b/vendor/sebastian/diff/ChangeLog.md deleted file mode 100644 index 9bdcc5b6..00000000 --- a/vendor/sebastian/diff/ChangeLog.md +++ /dev/null @@ -1,88 +0,0 @@ -# ChangeLog - -All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. - -## [4.0.4] - 2020-10-26 - -### Fixed - -* `SebastianBergmann\Diff\Exception` now correctly extends `\Throwable` - -## [4.0.3] - 2020-09-28 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.3 || ^8.0` to `>=7.3` - -## [4.0.2] - 2020-06-30 - -### Added - -* This component is now supported on PHP 8 - -## [4.0.1] - 2020-05-08 - -### Fixed - -* [#99](https://github.com/sebastianbergmann/diff/pull/99): Regression in unified diff output of identical strings - -## [4.0.0] - 2020-02-07 - -### Removed - -* Removed support for PHP 7.1 and PHP 7.2 - -## [3.0.2] - 2019-02-04 - -### Changed - -* `Chunk::setLines()` now ensures that the `$lines` array only contains `Line` objects - -## [3.0.1] - 2018-06-10 - -### Fixed - -* Removed `"minimum-stability": "dev",` from `composer.json` - -## [3.0.0] - 2018-02-01 - -* The `StrictUnifiedDiffOutputBuilder` implementation of the `DiffOutputBuilderInterface` was added - -### Changed - -* The default `DiffOutputBuilderInterface` implementation now generates context lines (unchanged lines) - -### Removed - -* Removed support for PHP 7.0 - -### Fixed - -* [#70](https://github.com/sebastianbergmann/diff/issues/70): Diffing of arrays no longer works - -## [2.0.1] - 2017-08-03 - -### Fixed - -* [#66](https://github.com/sebastianbergmann/diff/pull/66): Restored backwards compatibility for PHPUnit 6.1.4, 6.2.0, 6.2.1, 6.2.2, and 6.2.3 - -## [2.0.0] - 2017-07-11 [YANKED] - -### Added - -* [#64](https://github.com/sebastianbergmann/diff/pull/64): Show line numbers for chunks of a diff - -### Removed - -* This component is no longer supported on PHP 5.6 - -[4.0.4]: https://github.com/sebastianbergmann/diff/compare/4.0.3...4.0.4 -[4.0.3]: https://github.com/sebastianbergmann/diff/compare/4.0.2...4.0.3 -[4.0.2]: https://github.com/sebastianbergmann/diff/compare/4.0.1...4.0.2 -[4.0.1]: https://github.com/sebastianbergmann/diff/compare/4.0.0...4.0.1 -[4.0.0]: https://github.com/sebastianbergmann/diff/compare/3.0.2...4.0.0 -[3.0.2]: https://github.com/sebastianbergmann/diff/compare/3.0.1...3.0.2 -[3.0.1]: https://github.com/sebastianbergmann/diff/compare/3.0.0...3.0.1 -[3.0.0]: https://github.com/sebastianbergmann/diff/compare/2.0...3.0.0 -[2.0.1]: https://github.com/sebastianbergmann/diff/compare/c341c98ce083db77f896a0aa64f5ee7652915970...2.0.1 -[2.0.0]: https://github.com/sebastianbergmann/diff/compare/1.4...c341c98ce083db77f896a0aa64f5ee7652915970 diff --git a/vendor/sebastian/diff/LICENSE b/vendor/sebastian/diff/LICENSE deleted file mode 100644 index f22f31cf..00000000 --- a/vendor/sebastian/diff/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -sebastian/diff - -Copyright (c) 2002-2020, Sebastian Bergmann . -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 Sebastian Bergmann nor the names of his - 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/sebastian/diff/README.md b/vendor/sebastian/diff/README.md deleted file mode 100644 index 734b852d..00000000 --- a/vendor/sebastian/diff/README.md +++ /dev/null @@ -1,202 +0,0 @@ -# sebastian/diff - -[![CI Status](https://github.com/sebastianbergmann/diff/workflows/CI/badge.svg)](https://github.com/sebastianbergmann/diff/actions) -[![Type Coverage](https://shepherd.dev/github/sebastianbergmann/diff/coverage.svg)](https://shepherd.dev/github/sebastianbergmann/diff) - -Diff implementation for PHP, factored out of PHPUnit into a stand-alone component. - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - -``` -composer require sebastian/diff -``` - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - -``` -composer require --dev sebastian/diff -``` - -### Usage - -#### Generating diff - -The `Differ` class can be used to generate a textual representation of the difference between two strings: - -```php -diff('foo', 'bar'); -``` - -The code above yields the output below: -```diff ---- Original -+++ New -@@ @@ --foo -+bar -``` - -There are three output builders available in this package: - -#### UnifiedDiffOutputBuilder - -This is default builder, which generates the output close to udiff and is used by PHPUnit. - -```php -diff('foo', 'bar'); -``` - -#### StrictUnifiedDiffOutputBuilder - -Generates (strict) Unified diff's (unidiffs) with hunks, -similar to `diff -u` and compatible with `patch` and `git apply`. - -```php - true, // ranges of length one are rendered with the trailing `,1` - 'commonLineThreshold' => 6, // number of same lines before ending a new hunk and creating a new one (if needed) - 'contextLines' => 3, // like `diff: -u, -U NUM, --unified[=NUM]`, for patch/git apply compatibility best to keep at least @ 3 - 'fromFile' => null, - 'fromFileDate' => null, - 'toFile' => null, - 'toFileDate' => null, -]); - -$differ = new Differ($builder); -print $differ->diff('foo', 'bar'); -``` - -#### DiffOnlyOutputBuilder - -Output only the lines that differ. - -```php -diff('foo', 'bar'); -``` - -#### DiffOutputBuilderInterface - -You can pass any output builder to the `Differ` class as longs as it implements the `DiffOutputBuilderInterface`. - -#### Parsing diff - -The `Parser` class can be used to parse a unified diff into an object graph: - -```php -use SebastianBergmann\Diff\Parser; -use SebastianBergmann\Git; - -$git = new Git('/usr/local/src/money'); - -$diff = $git->getDiff( - '948a1a07768d8edd10dcefa8315c1cbeffb31833', - 'c07a373d2399f3e686234c4f7f088d635eb9641b' -); - -$parser = new Parser; - -print_r($parser->parse($diff)); -``` - -The code above yields the output below: - - Array - ( - [0] => SebastianBergmann\Diff\Diff Object - ( - [from:SebastianBergmann\Diff\Diff:private] => a/tests/MoneyTest.php - [to:SebastianBergmann\Diff\Diff:private] => b/tests/MoneyTest.php - [chunks:SebastianBergmann\Diff\Diff:private] => Array - ( - [0] => SebastianBergmann\Diff\Chunk Object - ( - [start:SebastianBergmann\Diff\Chunk:private] => 87 - [startRange:SebastianBergmann\Diff\Chunk:private] => 7 - [end:SebastianBergmann\Diff\Chunk:private] => 87 - [endRange:SebastianBergmann\Diff\Chunk:private] => 7 - [lines:SebastianBergmann\Diff\Chunk:private] => Array - ( - [0] => SebastianBergmann\Diff\Line Object - ( - [type:SebastianBergmann\Diff\Line:private] => 3 - [content:SebastianBergmann\Diff\Line:private] => * @covers SebastianBergmann\Money\Money::add - ) - - [1] => SebastianBergmann\Diff\Line Object - ( - [type:SebastianBergmann\Diff\Line:private] => 3 - [content:SebastianBergmann\Diff\Line:private] => * @covers SebastianBergmann\Money\Money::newMoney - ) - - [2] => SebastianBergmann\Diff\Line Object - ( - [type:SebastianBergmann\Diff\Line:private] => 3 - [content:SebastianBergmann\Diff\Line:private] => */ - ) - - [3] => SebastianBergmann\Diff\Line Object - ( - [type:SebastianBergmann\Diff\Line:private] => 2 - [content:SebastianBergmann\Diff\Line:private] => public function testAnotherMoneyWithSameCurrencyObjectCanBeAdded() - ) - - [4] => SebastianBergmann\Diff\Line Object - ( - [type:SebastianBergmann\Diff\Line:private] => 1 - [content:SebastianBergmann\Diff\Line:private] => public function testAnotherMoneyObjectWithSameCurrencyCanBeAdded() - ) - - [5] => SebastianBergmann\Diff\Line Object - ( - [type:SebastianBergmann\Diff\Line:private] => 3 - [content:SebastianBergmann\Diff\Line:private] => { - ) - - [6] => SebastianBergmann\Diff\Line Object - ( - [type:SebastianBergmann\Diff\Line:private] => 3 - [content:SebastianBergmann\Diff\Line:private] => $a = new Money(1, new Currency('EUR')); - ) - - [7] => SebastianBergmann\Diff\Line Object - ( - [type:SebastianBergmann\Diff\Line:private] => 3 - [content:SebastianBergmann\Diff\Line:private] => $b = new Money(2, new Currency('EUR')); - ) - ) - ) - ) - ) - ) diff --git a/vendor/sebastian/diff/composer.json b/vendor/sebastian/diff/composer.json deleted file mode 100644 index cf92202b..00000000 --- a/vendor/sebastian/diff/composer.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "sebastian/diff", - "description": "Diff implementation", - "keywords": ["diff", "udiff", "unidiff", "unified diff"], - "homepage": "https://github.com/sebastianbergmann/diff", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - } - ], - "prefer-stable": true, - "config": { - "platform": { - "php": "7.3.0" - }, - "optimize-autoloader": true, - "sort-packages": true - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3", - "symfony/process": "^4.2 || ^5" - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "autoload-dev": { - "classmap": [ - "tests/" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - } -} diff --git a/vendor/sebastian/diff/src/Chunk.php b/vendor/sebastian/diff/src/Chunk.php deleted file mode 100644 index 16ae34f4..00000000 --- a/vendor/sebastian/diff/src/Chunk.php +++ /dev/null @@ -1,89 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Diff; - -final class Chunk -{ - /** - * @var int - */ - private $start; - - /** - * @var int - */ - private $startRange; - - /** - * @var int - */ - private $end; - - /** - * @var int - */ - private $endRange; - - /** - * @var Line[] - */ - private $lines; - - public function __construct(int $start = 0, int $startRange = 1, int $end = 0, int $endRange = 1, array $lines = []) - { - $this->start = $start; - $this->startRange = $startRange; - $this->end = $end; - $this->endRange = $endRange; - $this->lines = $lines; - } - - public function getStart(): int - { - return $this->start; - } - - public function getStartRange(): int - { - return $this->startRange; - } - - public function getEnd(): int - { - return $this->end; - } - - public function getEndRange(): int - { - return $this->endRange; - } - - /** - * @return Line[] - */ - public function getLines(): array - { - return $this->lines; - } - - /** - * @param Line[] $lines - */ - public function setLines(array $lines): void - { - foreach ($lines as $line) { - if (!$line instanceof Line) { - throw new InvalidArgumentException; - } - } - - $this->lines = $lines; - } -} diff --git a/vendor/sebastian/diff/src/Diff.php b/vendor/sebastian/diff/src/Diff.php deleted file mode 100644 index 17b2084f..00000000 --- a/vendor/sebastian/diff/src/Diff.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 SebastianBergmann\Diff; - -final class Diff -{ - /** - * @var string - */ - private $from; - - /** - * @var string - */ - private $to; - - /** - * @var Chunk[] - */ - private $chunks; - - /** - * @param Chunk[] $chunks - */ - public function __construct(string $from, string $to, array $chunks = []) - { - $this->from = $from; - $this->to = $to; - $this->chunks = $chunks; - } - - public function getFrom(): string - { - return $this->from; - } - - public function getTo(): string - { - return $this->to; - } - - /** - * @return Chunk[] - */ - public function getChunks(): array - { - return $this->chunks; - } - - /** - * @param Chunk[] $chunks - */ - public function setChunks(array $chunks): void - { - $this->chunks = $chunks; - } -} diff --git a/vendor/sebastian/diff/src/Differ.php b/vendor/sebastian/diff/src/Differ.php deleted file mode 100644 index 5a4d9d10..00000000 --- a/vendor/sebastian/diff/src/Differ.php +++ /dev/null @@ -1,327 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Diff; - -use const PHP_INT_SIZE; -use const PREG_SPLIT_DELIM_CAPTURE; -use const PREG_SPLIT_NO_EMPTY; -use function array_shift; -use function array_unshift; -use function array_values; -use function count; -use function current; -use function end; -use function get_class; -use function gettype; -use function is_array; -use function is_object; -use function is_string; -use function key; -use function min; -use function preg_split; -use function prev; -use function reset; -use function sprintf; -use function substr; -use SebastianBergmann\Diff\Output\DiffOutputBuilderInterface; -use SebastianBergmann\Diff\Output\UnifiedDiffOutputBuilder; - -final class Differ -{ - public const OLD = 0; - - public const ADDED = 1; - - public const REMOVED = 2; - - public const DIFF_LINE_END_WARNING = 3; - - public const NO_LINE_END_EOF_WARNING = 4; - - /** - * @var DiffOutputBuilderInterface - */ - private $outputBuilder; - - /** - * @param DiffOutputBuilderInterface $outputBuilder - * - * @throws InvalidArgumentException - */ - public function __construct($outputBuilder = null) - { - if ($outputBuilder instanceof DiffOutputBuilderInterface) { - $this->outputBuilder = $outputBuilder; - } elseif (null === $outputBuilder) { - $this->outputBuilder = new UnifiedDiffOutputBuilder; - } elseif (is_string($outputBuilder)) { - // PHPUnit 6.1.4, 6.2.0, 6.2.1, 6.2.2, and 6.2.3 support - // @see https://github.com/sebastianbergmann/phpunit/issues/2734#issuecomment-314514056 - // @deprecated - $this->outputBuilder = new UnifiedDiffOutputBuilder($outputBuilder); - } else { - throw new InvalidArgumentException( - sprintf( - 'Expected builder to be an instance of DiffOutputBuilderInterface, or a string, got %s.', - is_object($outputBuilder) ? 'instance of "' . get_class($outputBuilder) . '"' : gettype($outputBuilder) . ' "' . $outputBuilder . '"' - ) - ); - } - } - - /** - * Returns the diff between two arrays or strings as string. - * - * @param array|string $from - * @param array|string $to - */ - public function diff($from, $to, LongestCommonSubsequenceCalculator $lcs = null): string - { - $diff = $this->diffToArray( - $this->normalizeDiffInput($from), - $this->normalizeDiffInput($to), - $lcs - ); - - return $this->outputBuilder->getDiff($diff); - } - - /** - * Returns the diff between two arrays or strings as array. - * - * Each array element contains two elements: - * - [0] => mixed $token - * - [1] => 2|1|0 - * - * - 2: REMOVED: $token was removed from $from - * - 1: ADDED: $token was added to $from - * - 0: OLD: $token is not changed in $to - * - * @param array|string $from - * @param array|string $to - * @param LongestCommonSubsequenceCalculator $lcs - */ - public function diffToArray($from, $to, LongestCommonSubsequenceCalculator $lcs = null): array - { - if (is_string($from)) { - $from = $this->splitStringByLines($from); - } elseif (!is_array($from)) { - throw new InvalidArgumentException('"from" must be an array or string.'); - } - - if (is_string($to)) { - $to = $this->splitStringByLines($to); - } elseif (!is_array($to)) { - throw new InvalidArgumentException('"to" must be an array or string.'); - } - - [$from, $to, $start, $end] = self::getArrayDiffParted($from, $to); - - if ($lcs === null) { - $lcs = $this->selectLcsImplementation($from, $to); - } - - $common = $lcs->calculate(array_values($from), array_values($to)); - $diff = []; - - foreach ($start as $token) { - $diff[] = [$token, self::OLD]; - } - - reset($from); - reset($to); - - foreach ($common as $token) { - while (($fromToken = reset($from)) !== $token) { - $diff[] = [array_shift($from), self::REMOVED]; - } - - while (($toToken = reset($to)) !== $token) { - $diff[] = [array_shift($to), self::ADDED]; - } - - $diff[] = [$token, self::OLD]; - - array_shift($from); - array_shift($to); - } - - while (($token = array_shift($from)) !== null) { - $diff[] = [$token, self::REMOVED]; - } - - while (($token = array_shift($to)) !== null) { - $diff[] = [$token, self::ADDED]; - } - - foreach ($end as $token) { - $diff[] = [$token, self::OLD]; - } - - if ($this->detectUnmatchedLineEndings($diff)) { - array_unshift($diff, ["#Warning: Strings contain different line endings!\n", self::DIFF_LINE_END_WARNING]); - } - - return $diff; - } - - /** - * Casts variable to string if it is not a string or array. - * - * @return array|string - */ - private function normalizeDiffInput($input) - { - if (!is_array($input) && !is_string($input)) { - return (string) $input; - } - - return $input; - } - - /** - * Checks if input is string, if so it will split it line-by-line. - */ - private function splitStringByLines(string $input): array - { - return preg_split('/(.*\R)/', $input, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); - } - - private function selectLcsImplementation(array $from, array $to): LongestCommonSubsequenceCalculator - { - // We do not want to use the time-efficient implementation if its memory - // footprint will probably exceed this value. Note that the footprint - // calculation is only an estimation for the matrix and the LCS method - // will typically allocate a bit more memory than this. - $memoryLimit = 100 * 1024 * 1024; - - if ($this->calculateEstimatedFootprint($from, $to) > $memoryLimit) { - return new MemoryEfficientLongestCommonSubsequenceCalculator; - } - - return new TimeEfficientLongestCommonSubsequenceCalculator; - } - - /** - * Calculates the estimated memory footprint for the DP-based method. - * - * @return float|int - */ - private function calculateEstimatedFootprint(array $from, array $to) - { - $itemSize = PHP_INT_SIZE === 4 ? 76 : 144; - - return $itemSize * min(count($from), count($to)) ** 2; - } - - /** - * Returns true if line ends don't match in a diff. - */ - private function detectUnmatchedLineEndings(array $diff): bool - { - $newLineBreaks = ['' => true]; - $oldLineBreaks = ['' => true]; - - foreach ($diff as $entry) { - if (self::OLD === $entry[1]) { - $ln = $this->getLinebreak($entry[0]); - $oldLineBreaks[$ln] = true; - $newLineBreaks[$ln] = true; - } elseif (self::ADDED === $entry[1]) { - $newLineBreaks[$this->getLinebreak($entry[0])] = true; - } elseif (self::REMOVED === $entry[1]) { - $oldLineBreaks[$this->getLinebreak($entry[0])] = true; - } - } - - // if either input or output is a single line without breaks than no warning should be raised - if (['' => true] === $newLineBreaks || ['' => true] === $oldLineBreaks) { - return false; - } - - // two way compare - foreach ($newLineBreaks as $break => $set) { - if (!isset($oldLineBreaks[$break])) { - return true; - } - } - - foreach ($oldLineBreaks as $break => $set) { - if (!isset($newLineBreaks[$break])) { - return true; - } - } - - return false; - } - - private function getLinebreak($line): string - { - if (!is_string($line)) { - return ''; - } - - $lc = substr($line, -1); - - if ("\r" === $lc) { - return "\r"; - } - - if ("\n" !== $lc) { - return ''; - } - - if ("\r\n" === substr($line, -2)) { - return "\r\n"; - } - - return "\n"; - } - - private static function getArrayDiffParted(array &$from, array &$to): array - { - $start = []; - $end = []; - - reset($to); - - foreach ($from as $k => $v) { - $toK = key($to); - - if ($toK === $k && $v === $to[$k]) { - $start[$k] = $v; - - unset($from[$k], $to[$k]); - } else { - break; - } - } - - end($from); - end($to); - - do { - $fromK = key($from); - $toK = key($to); - - if (null === $fromK || null === $toK || current($from) !== current($to)) { - break; - } - - prev($from); - prev($to); - - $end = [$fromK => $from[$fromK]] + $end; - unset($from[$fromK], $to[$toK]); - } while (true); - - return [$from, $to, $start, $end]; - } -} diff --git a/vendor/sebastian/diff/src/Exception/ConfigurationException.php b/vendor/sebastian/diff/src/Exception/ConfigurationException.php deleted file mode 100644 index b767b219..00000000 --- a/vendor/sebastian/diff/src/Exception/ConfigurationException.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Diff; - -use function get_class; -use function gettype; -use function is_object; -use function sprintf; -use Exception; - -final class ConfigurationException extends InvalidArgumentException -{ - public function __construct( - string $option, - string $expected, - $value, - int $code = 0, - Exception $previous = null - ) { - parent::__construct( - sprintf( - 'Option "%s" must be %s, got "%s".', - $option, - $expected, - is_object($value) ? get_class($value) : (null === $value ? '' : gettype($value) . '#' . $value) - ), - $code, - $previous - ); - } -} diff --git a/vendor/sebastian/diff/src/Exception/Exception.php b/vendor/sebastian/diff/src/Exception/Exception.php deleted file mode 100644 index e20d3203..00000000 --- a/vendor/sebastian/diff/src/Exception/Exception.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. - */ -namespace SebastianBergmann\Diff; - -use Throwable; - -interface Exception extends Throwable -{ -} diff --git a/vendor/sebastian/diff/src/Exception/InvalidArgumentException.php b/vendor/sebastian/diff/src/Exception/InvalidArgumentException.php deleted file mode 100644 index 846ac3fb..00000000 --- a/vendor/sebastian/diff/src/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Diff; - -class InvalidArgumentException extends \InvalidArgumentException implements Exception -{ -} diff --git a/vendor/sebastian/diff/src/Line.php b/vendor/sebastian/diff/src/Line.php deleted file mode 100644 index 3596ed26..00000000 --- a/vendor/sebastian/diff/src/Line.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Diff; - -final class Line -{ - public const ADDED = 1; - - public const REMOVED = 2; - - public const UNCHANGED = 3; - - /** - * @var int - */ - private $type; - - /** - * @var string - */ - private $content; - - public function __construct(int $type = self::UNCHANGED, string $content = '') - { - $this->type = $type; - $this->content = $content; - } - - public function getContent(): string - { - return $this->content; - } - - public function getType(): int - { - return $this->type; - } -} diff --git a/vendor/sebastian/diff/src/LongestCommonSubsequenceCalculator.php b/vendor/sebastian/diff/src/LongestCommonSubsequenceCalculator.php deleted file mode 100644 index dea8fe1c..00000000 --- a/vendor/sebastian/diff/src/LongestCommonSubsequenceCalculator.php +++ /dev/null @@ -1,18 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Diff; - -interface LongestCommonSubsequenceCalculator -{ - /** - * Calculates the longest common subsequence of two arrays. - */ - public function calculate(array $from, array $to): array; -} diff --git a/vendor/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php b/vendor/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php deleted file mode 100644 index 0b626eaf..00000000 --- a/vendor/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.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 SebastianBergmann\Diff; - -use function array_fill; -use function array_merge; -use function array_reverse; -use function array_slice; -use function count; -use function in_array; -use function max; - -final class MemoryEfficientLongestCommonSubsequenceCalculator implements LongestCommonSubsequenceCalculator -{ - /** - * {@inheritdoc} - */ - public function calculate(array $from, array $to): array - { - $cFrom = count($from); - $cTo = count($to); - - if ($cFrom === 0) { - return []; - } - - if ($cFrom === 1) { - if (in_array($from[0], $to, true)) { - return [$from[0]]; - } - - return []; - } - - $i = (int) ($cFrom / 2); - $fromStart = array_slice($from, 0, $i); - $fromEnd = array_slice($from, $i); - $llB = $this->length($fromStart, $to); - $llE = $this->length(array_reverse($fromEnd), array_reverse($to)); - $jMax = 0; - $max = 0; - - for ($j = 0; $j <= $cTo; $j++) { - $m = $llB[$j] + $llE[$cTo - $j]; - - if ($m >= $max) { - $max = $m; - $jMax = $j; - } - } - - $toStart = array_slice($to, 0, $jMax); - $toEnd = array_slice($to, $jMax); - - return array_merge( - $this->calculate($fromStart, $toStart), - $this->calculate($fromEnd, $toEnd) - ); - } - - private function length(array $from, array $to): array - { - $current = array_fill(0, count($to) + 1, 0); - $cFrom = count($from); - $cTo = count($to); - - for ($i = 0; $i < $cFrom; $i++) { - $prev = $current; - - for ($j = 0; $j < $cTo; $j++) { - if ($from[$i] === $to[$j]) { - $current[$j + 1] = $prev[$j] + 1; - } else { - $current[$j + 1] = max($current[$j], $prev[$j + 1]); - } - } - } - - return $current; - } -} diff --git a/vendor/sebastian/diff/src/Output/AbstractChunkOutputBuilder.php b/vendor/sebastian/diff/src/Output/AbstractChunkOutputBuilder.php deleted file mode 100644 index e55757c3..00000000 --- a/vendor/sebastian/diff/src/Output/AbstractChunkOutputBuilder.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Diff\Output; - -use function count; - -abstract class AbstractChunkOutputBuilder implements DiffOutputBuilderInterface -{ - /** - * Takes input of the diff array and returns the common parts. - * Iterates through diff line by line. - */ - protected function getCommonChunks(array $diff, int $lineThreshold = 5): array - { - $diffSize = count($diff); - $capturing = false; - $chunkStart = 0; - $chunkSize = 0; - $commonChunks = []; - - for ($i = 0; $i < $diffSize; ++$i) { - if ($diff[$i][1] === 0 /* OLD */) { - if ($capturing === false) { - $capturing = true; - $chunkStart = $i; - $chunkSize = 0; - } else { - ++$chunkSize; - } - } elseif ($capturing !== false) { - if ($chunkSize >= $lineThreshold) { - $commonChunks[$chunkStart] = $chunkStart + $chunkSize; - } - - $capturing = false; - } - } - - if ($capturing !== false && $chunkSize >= $lineThreshold) { - $commonChunks[$chunkStart] = $chunkStart + $chunkSize; - } - - return $commonChunks; - } -} diff --git a/vendor/sebastian/diff/src/Output/DiffOnlyOutputBuilder.php b/vendor/sebastian/diff/src/Output/DiffOnlyOutputBuilder.php deleted file mode 100644 index f79a935c..00000000 --- a/vendor/sebastian/diff/src/Output/DiffOnlyOutputBuilder.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Diff\Output; - -use function fclose; -use function fopen; -use function fwrite; -use function stream_get_contents; -use function substr; -use SebastianBergmann\Diff\Differ; - -/** - * Builds a diff string representation in a loose unified diff format - * listing only changes lines. Does not include line numbers. - */ -final class DiffOnlyOutputBuilder implements DiffOutputBuilderInterface -{ - /** - * @var string - */ - private $header; - - public function __construct(string $header = "--- Original\n+++ New\n") - { - $this->header = $header; - } - - public function getDiff(array $diff): string - { - $buffer = fopen('php://memory', 'r+b'); - - if ('' !== $this->header) { - fwrite($buffer, $this->header); - - if ("\n" !== substr($this->header, -1, 1)) { - fwrite($buffer, "\n"); - } - } - - foreach ($diff as $diffEntry) { - if ($diffEntry[1] === Differ::ADDED) { - fwrite($buffer, '+' . $diffEntry[0]); - } elseif ($diffEntry[1] === Differ::REMOVED) { - fwrite($buffer, '-' . $diffEntry[0]); - } elseif ($diffEntry[1] === Differ::DIFF_LINE_END_WARNING) { - fwrite($buffer, ' ' . $diffEntry[0]); - - continue; // Warnings should not be tested for line break, it will always be there - } else { /* Not changed (old) 0 */ - continue; // we didn't write the non changs line, so do not add a line break either - } - - $lc = substr($diffEntry[0], -1); - - if ($lc !== "\n" && $lc !== "\r") { - fwrite($buffer, "\n"); // \No newline at end of file - } - } - - $diff = stream_get_contents($buffer, -1, 0); - fclose($buffer); - - return $diff; - } -} diff --git a/vendor/sebastian/diff/src/Output/DiffOutputBuilderInterface.php b/vendor/sebastian/diff/src/Output/DiffOutputBuilderInterface.php deleted file mode 100644 index 0e18f9f2..00000000 --- a/vendor/sebastian/diff/src/Output/DiffOutputBuilderInterface.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Diff\Output; - -/** - * Defines how an output builder should take a generated - * diff array and return a string representation of that diff. - */ -interface DiffOutputBuilderInterface -{ - public function getDiff(array $diff): string; -} diff --git a/vendor/sebastian/diff/src/Output/StrictUnifiedDiffOutputBuilder.php b/vendor/sebastian/diff/src/Output/StrictUnifiedDiffOutputBuilder.php deleted file mode 100644 index 9c55ab2a..00000000 --- a/vendor/sebastian/diff/src/Output/StrictUnifiedDiffOutputBuilder.php +++ /dev/null @@ -1,338 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Diff\Output; - -use function array_merge; -use function array_splice; -use function count; -use function fclose; -use function fopen; -use function fwrite; -use function is_bool; -use function is_int; -use function is_string; -use function max; -use function min; -use function sprintf; -use function stream_get_contents; -use function substr; -use SebastianBergmann\Diff\ConfigurationException; -use SebastianBergmann\Diff\Differ; - -/** - * Strict Unified diff output builder. - * - * Generates (strict) Unified diff's (unidiffs) with hunks. - */ -final class StrictUnifiedDiffOutputBuilder implements DiffOutputBuilderInterface -{ - private static $default = [ - 'collapseRanges' => true, // ranges of length one are rendered with the trailing `,1` - 'commonLineThreshold' => 6, // number of same lines before ending a new hunk and creating a new one (if needed) - 'contextLines' => 3, // like `diff: -u, -U NUM, --unified[=NUM]`, for patch/git apply compatibility best to keep at least @ 3 - 'fromFile' => null, - 'fromFileDate' => null, - 'toFile' => null, - 'toFileDate' => null, - ]; - - /** - * @var bool - */ - private $changed; - - /** - * @var bool - */ - private $collapseRanges; - - /** - * @var int >= 0 - */ - private $commonLineThreshold; - - /** - * @var string - */ - private $header; - - /** - * @var int >= 0 - */ - private $contextLines; - - public function __construct(array $options = []) - { - $options = array_merge(self::$default, $options); - - if (!is_bool($options['collapseRanges'])) { - throw new ConfigurationException('collapseRanges', 'a bool', $options['collapseRanges']); - } - - if (!is_int($options['contextLines']) || $options['contextLines'] < 0) { - throw new ConfigurationException('contextLines', 'an int >= 0', $options['contextLines']); - } - - if (!is_int($options['commonLineThreshold']) || $options['commonLineThreshold'] <= 0) { - throw new ConfigurationException('commonLineThreshold', 'an int > 0', $options['commonLineThreshold']); - } - - $this->assertString($options, 'fromFile'); - $this->assertString($options, 'toFile'); - $this->assertStringOrNull($options, 'fromFileDate'); - $this->assertStringOrNull($options, 'toFileDate'); - - $this->header = sprintf( - "--- %s%s\n+++ %s%s\n", - $options['fromFile'], - null === $options['fromFileDate'] ? '' : "\t" . $options['fromFileDate'], - $options['toFile'], - null === $options['toFileDate'] ? '' : "\t" . $options['toFileDate'] - ); - - $this->collapseRanges = $options['collapseRanges']; - $this->commonLineThreshold = $options['commonLineThreshold']; - $this->contextLines = $options['contextLines']; - } - - public function getDiff(array $diff): string - { - if (0 === count($diff)) { - return ''; - } - - $this->changed = false; - - $buffer = fopen('php://memory', 'r+b'); - fwrite($buffer, $this->header); - - $this->writeDiffHunks($buffer, $diff); - - if (!$this->changed) { - fclose($buffer); - - return ''; - } - - $diff = stream_get_contents($buffer, -1, 0); - - fclose($buffer); - - // If the last char is not a linebreak: add it. - // This might happen when both the `from` and `to` do not have a trailing linebreak - $last = substr($diff, -1); - - return "\n" !== $last && "\r" !== $last - ? $diff . "\n" - : $diff; - } - - private function writeDiffHunks($output, array $diff): void - { - // detect "No newline at end of file" and insert into `$diff` if needed - - $upperLimit = count($diff); - - if (0 === $diff[$upperLimit - 1][1]) { - $lc = substr($diff[$upperLimit - 1][0], -1); - - if ("\n" !== $lc) { - array_splice($diff, $upperLimit, 0, [["\n\\ No newline at end of file\n", Differ::NO_LINE_END_EOF_WARNING]]); - } - } else { - // search back for the last `+` and `-` line, - // check if has trailing linebreak, else add under it warning under it - $toFind = [1 => true, 2 => true]; - - for ($i = $upperLimit - 1; $i >= 0; --$i) { - if (isset($toFind[$diff[$i][1]])) { - unset($toFind[$diff[$i][1]]); - $lc = substr($diff[$i][0], -1); - - if ("\n" !== $lc) { - array_splice($diff, $i + 1, 0, [["\n\\ No newline at end of file\n", Differ::NO_LINE_END_EOF_WARNING]]); - } - - if (!count($toFind)) { - break; - } - } - } - } - - // write hunks to output buffer - - $cutOff = max($this->commonLineThreshold, $this->contextLines); - $hunkCapture = false; - $sameCount = $toRange = $fromRange = 0; - $toStart = $fromStart = 1; - $i = 0; - - /** @var int $i */ - foreach ($diff as $i => $entry) { - if (0 === $entry[1]) { // same - if (false === $hunkCapture) { - ++$fromStart; - ++$toStart; - - continue; - } - - ++$sameCount; - ++$toRange; - ++$fromRange; - - if ($sameCount === $cutOff) { - $contextStartOffset = ($hunkCapture - $this->contextLines) < 0 - ? $hunkCapture - : $this->contextLines; - - // note: $contextEndOffset = $this->contextLines; - // - // because we never go beyond the end of the diff. - // with the cutoff/contextlines here the follow is never true; - // - // if ($i - $cutOff + $this->contextLines + 1 > \count($diff)) { - // $contextEndOffset = count($diff) - 1; - // } - // - // ; that would be true for a trailing incomplete hunk case which is dealt with after this loop - - $this->writeHunk( - $diff, - $hunkCapture - $contextStartOffset, - $i - $cutOff + $this->contextLines + 1, - $fromStart - $contextStartOffset, - $fromRange - $cutOff + $contextStartOffset + $this->contextLines, - $toStart - $contextStartOffset, - $toRange - $cutOff + $contextStartOffset + $this->contextLines, - $output - ); - - $fromStart += $fromRange; - $toStart += $toRange; - - $hunkCapture = false; - $sameCount = $toRange = $fromRange = 0; - } - - continue; - } - - $sameCount = 0; - - if ($entry[1] === Differ::NO_LINE_END_EOF_WARNING) { - continue; - } - - $this->changed = true; - - if (false === $hunkCapture) { - $hunkCapture = $i; - } - - if (Differ::ADDED === $entry[1]) { // added - ++$toRange; - } - - if (Differ::REMOVED === $entry[1]) { // removed - ++$fromRange; - } - } - - if (false === $hunkCapture) { - return; - } - - // we end here when cutoff (commonLineThreshold) was not reached, but we where capturing a hunk, - // do not render hunk till end automatically because the number of context lines might be less than the commonLineThreshold - - $contextStartOffset = $hunkCapture - $this->contextLines < 0 - ? $hunkCapture - : $this->contextLines; - - // prevent trying to write out more common lines than there are in the diff _and_ - // do not write more than configured through the context lines - $contextEndOffset = min($sameCount, $this->contextLines); - - $fromRange -= $sameCount; - $toRange -= $sameCount; - - $this->writeHunk( - $diff, - $hunkCapture - $contextStartOffset, - $i - $sameCount + $contextEndOffset + 1, - $fromStart - $contextStartOffset, - $fromRange + $contextStartOffset + $contextEndOffset, - $toStart - $contextStartOffset, - $toRange + $contextStartOffset + $contextEndOffset, - $output - ); - } - - private function writeHunk( - array $diff, - int $diffStartIndex, - int $diffEndIndex, - int $fromStart, - int $fromRange, - int $toStart, - int $toRange, - $output - ): void { - fwrite($output, '@@ -' . $fromStart); - - if (!$this->collapseRanges || 1 !== $fromRange) { - fwrite($output, ',' . $fromRange); - } - - fwrite($output, ' +' . $toStart); - - if (!$this->collapseRanges || 1 !== $toRange) { - fwrite($output, ',' . $toRange); - } - - fwrite($output, " @@\n"); - - for ($i = $diffStartIndex; $i < $diffEndIndex; ++$i) { - if ($diff[$i][1] === Differ::ADDED) { - $this->changed = true; - fwrite($output, '+' . $diff[$i][0]); - } elseif ($diff[$i][1] === Differ::REMOVED) { - $this->changed = true; - fwrite($output, '-' . $diff[$i][0]); - } elseif ($diff[$i][1] === Differ::OLD) { - fwrite($output, ' ' . $diff[$i][0]); - } elseif ($diff[$i][1] === Differ::NO_LINE_END_EOF_WARNING) { - $this->changed = true; - fwrite($output, $diff[$i][0]); - } - //} elseif ($diff[$i][1] === Differ::DIFF_LINE_END_WARNING) { // custom comment inserted by PHPUnit/diff package - // skip - //} else { - // unknown/invalid - //} - } - } - - private function assertString(array $options, string $option): void - { - if (!is_string($options[$option])) { - throw new ConfigurationException($option, 'a string', $options[$option]); - } - } - - private function assertStringOrNull(array $options, string $option): void - { - if (null !== $options[$option] && !is_string($options[$option])) { - throw new ConfigurationException($option, 'a string or ', $options[$option]); - } - } -} diff --git a/vendor/sebastian/diff/src/Output/UnifiedDiffOutputBuilder.php b/vendor/sebastian/diff/src/Output/UnifiedDiffOutputBuilder.php deleted file mode 100644 index 8aae6450..00000000 --- a/vendor/sebastian/diff/src/Output/UnifiedDiffOutputBuilder.php +++ /dev/null @@ -1,272 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Diff\Output; - -use function array_splice; -use function count; -use function fclose; -use function fopen; -use function fwrite; -use function max; -use function min; -use function stream_get_contents; -use function strlen; -use function substr; -use SebastianBergmann\Diff\Differ; - -/** - * Builds a diff string representation in unified diff format in chunks. - */ -final class UnifiedDiffOutputBuilder extends AbstractChunkOutputBuilder -{ - /** - * @var bool - */ - private $collapseRanges = true; - - /** - * @var int >= 0 - */ - private $commonLineThreshold = 6; - - /** - * @var int >= 0 - */ - private $contextLines = 3; - - /** - * @var string - */ - private $header; - - /** - * @var bool - */ - private $addLineNumbers; - - public function __construct(string $header = "--- Original\n+++ New\n", bool $addLineNumbers = false) - { - $this->header = $header; - $this->addLineNumbers = $addLineNumbers; - } - - public function getDiff(array $diff): string - { - $buffer = fopen('php://memory', 'r+b'); - - if ('' !== $this->header) { - fwrite($buffer, $this->header); - - if ("\n" !== substr($this->header, -1, 1)) { - fwrite($buffer, "\n"); - } - } - - if (0 !== count($diff)) { - $this->writeDiffHunks($buffer, $diff); - } - - $diff = stream_get_contents($buffer, -1, 0); - - fclose($buffer); - - // If the diff is non-empty and last char is not a linebreak: add it. - // This might happen when both the `from` and `to` do not have a trailing linebreak - $last = substr($diff, -1); - - return 0 !== strlen($diff) && "\n" !== $last && "\r" !== $last - ? $diff . "\n" - : $diff; - } - - private function writeDiffHunks($output, array $diff): void - { - // detect "No newline at end of file" and insert into `$diff` if needed - - $upperLimit = count($diff); - - if (0 === $diff[$upperLimit - 1][1]) { - $lc = substr($diff[$upperLimit - 1][0], -1); - - if ("\n" !== $lc) { - array_splice($diff, $upperLimit, 0, [["\n\\ No newline at end of file\n", Differ::NO_LINE_END_EOF_WARNING]]); - } - } else { - // search back for the last `+` and `-` line, - // check if has trailing linebreak, else add under it warning under it - $toFind = [1 => true, 2 => true]; - - for ($i = $upperLimit - 1; $i >= 0; --$i) { - if (isset($toFind[$diff[$i][1]])) { - unset($toFind[$diff[$i][1]]); - $lc = substr($diff[$i][0], -1); - - if ("\n" !== $lc) { - array_splice($diff, $i + 1, 0, [["\n\\ No newline at end of file\n", Differ::NO_LINE_END_EOF_WARNING]]); - } - - if (!count($toFind)) { - break; - } - } - } - } - - // write hunks to output buffer - - $cutOff = max($this->commonLineThreshold, $this->contextLines); - $hunkCapture = false; - $sameCount = $toRange = $fromRange = 0; - $toStart = $fromStart = 1; - $i = 0; - - /** @var int $i */ - foreach ($diff as $i => $entry) { - if (0 === $entry[1]) { // same - if (false === $hunkCapture) { - ++$fromStart; - ++$toStart; - - continue; - } - - ++$sameCount; - ++$toRange; - ++$fromRange; - - if ($sameCount === $cutOff) { - $contextStartOffset = ($hunkCapture - $this->contextLines) < 0 - ? $hunkCapture - : $this->contextLines; - - // note: $contextEndOffset = $this->contextLines; - // - // because we never go beyond the end of the diff. - // with the cutoff/contextlines here the follow is never true; - // - // if ($i - $cutOff + $this->contextLines + 1 > \count($diff)) { - // $contextEndOffset = count($diff) - 1; - // } - // - // ; that would be true for a trailing incomplete hunk case which is dealt with after this loop - - $this->writeHunk( - $diff, - $hunkCapture - $contextStartOffset, - $i - $cutOff + $this->contextLines + 1, - $fromStart - $contextStartOffset, - $fromRange - $cutOff + $contextStartOffset + $this->contextLines, - $toStart - $contextStartOffset, - $toRange - $cutOff + $contextStartOffset + $this->contextLines, - $output - ); - - $fromStart += $fromRange; - $toStart += $toRange; - - $hunkCapture = false; - $sameCount = $toRange = $fromRange = 0; - } - - continue; - } - - $sameCount = 0; - - if ($entry[1] === Differ::NO_LINE_END_EOF_WARNING) { - continue; - } - - if (false === $hunkCapture) { - $hunkCapture = $i; - } - - if (Differ::ADDED === $entry[1]) { - ++$toRange; - } - - if (Differ::REMOVED === $entry[1]) { - ++$fromRange; - } - } - - if (false === $hunkCapture) { - return; - } - - // we end here when cutoff (commonLineThreshold) was not reached, but we where capturing a hunk, - // do not render hunk till end automatically because the number of context lines might be less than the commonLineThreshold - - $contextStartOffset = $hunkCapture - $this->contextLines < 0 - ? $hunkCapture - : $this->contextLines; - - // prevent trying to write out more common lines than there are in the diff _and_ - // do not write more than configured through the context lines - $contextEndOffset = min($sameCount, $this->contextLines); - - $fromRange -= $sameCount; - $toRange -= $sameCount; - - $this->writeHunk( - $diff, - $hunkCapture - $contextStartOffset, - $i - $sameCount + $contextEndOffset + 1, - $fromStart - $contextStartOffset, - $fromRange + $contextStartOffset + $contextEndOffset, - $toStart - $contextStartOffset, - $toRange + $contextStartOffset + $contextEndOffset, - $output - ); - } - - private function writeHunk( - array $diff, - int $diffStartIndex, - int $diffEndIndex, - int $fromStart, - int $fromRange, - int $toStart, - int $toRange, - $output - ): void { - if ($this->addLineNumbers) { - fwrite($output, '@@ -' . $fromStart); - - if (!$this->collapseRanges || 1 !== $fromRange) { - fwrite($output, ',' . $fromRange); - } - - fwrite($output, ' +' . $toStart); - - if (!$this->collapseRanges || 1 !== $toRange) { - fwrite($output, ',' . $toRange); - } - - fwrite($output, " @@\n"); - } else { - fwrite($output, "@@ @@\n"); - } - - for ($i = $diffStartIndex; $i < $diffEndIndex; ++$i) { - if ($diff[$i][1] === Differ::ADDED) { - fwrite($output, '+' . $diff[$i][0]); - } elseif ($diff[$i][1] === Differ::REMOVED) { - fwrite($output, '-' . $diff[$i][0]); - } elseif ($diff[$i][1] === Differ::OLD) { - fwrite($output, ' ' . $diff[$i][0]); - } elseif ($diff[$i][1] === Differ::NO_LINE_END_EOF_WARNING) { - fwrite($output, "\n"); // $diff[$i][0] - } else { /* Not changed (old) Differ::OLD or Warning Differ::DIFF_LINE_END_WARNING */ - fwrite($output, ' ' . $diff[$i][0]); - } - } - } -} diff --git a/vendor/sebastian/diff/src/Parser.php b/vendor/sebastian/diff/src/Parser.php deleted file mode 100644 index cc9e3887..00000000 --- a/vendor/sebastian/diff/src/Parser.php +++ /dev/null @@ -1,110 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Diff; - -use function array_pop; -use function count; -use function max; -use function preg_match; -use function preg_split; - -/** - * Unified diff parser. - */ -final class Parser -{ - /** - * @return Diff[] - */ - public function parse(string $string): array - { - $lines = preg_split('(\r\n|\r|\n)', $string); - - if (!empty($lines) && $lines[count($lines) - 1] === '') { - array_pop($lines); - } - - $lineCount = count($lines); - $diffs = []; - $diff = null; - $collected = []; - - for ($i = 0; $i < $lineCount; ++$i) { - if (preg_match('#^---\h+"?(?P[^\\v\\t"]+)#', $lines[$i], $fromMatch) && - preg_match('#^\\+\\+\\+\\h+"?(?P[^\\v\\t"]+)#', $lines[$i + 1], $toMatch)) { - if ($diff !== null) { - $this->parseFileDiff($diff, $collected); - - $diffs[] = $diff; - $collected = []; - } - - $diff = new Diff($fromMatch['file'], $toMatch['file']); - - ++$i; - } else { - if (preg_match('/^(?:diff --git |index [\da-f\.]+|[+-]{3} [ab])/', $lines[$i])) { - continue; - } - - $collected[] = $lines[$i]; - } - } - - if ($diff !== null && count($collected)) { - $this->parseFileDiff($diff, $collected); - - $diffs[] = $diff; - } - - return $diffs; - } - - private function parseFileDiff(Diff $diff, array $lines): void - { - $chunks = []; - $chunk = null; - $diffLines = []; - - foreach ($lines as $line) { - if (preg_match('/^@@\s+-(?P\d+)(?:,\s*(?P\d+))?\s+\+(?P\d+)(?:,\s*(?P\d+))?\s+@@/', $line, $match)) { - $chunk = new Chunk( - (int) $match['start'], - isset($match['startrange']) ? max(1, (int) $match['startrange']) : 1, - (int) $match['end'], - isset($match['endrange']) ? max(1, (int) $match['endrange']) : 1 - ); - - $chunks[] = $chunk; - $diffLines = []; - - continue; - } - - if (preg_match('/^(?P[+ -])?(?P.*)/', $line, $match)) { - $type = Line::UNCHANGED; - - if ($match['type'] === '+') { - $type = Line::ADDED; - } elseif ($match['type'] === '-') { - $type = Line::REMOVED; - } - - $diffLines[] = new Line($type, $match['line']); - - if (null !== $chunk) { - $chunk->setLines($diffLines); - } - } - } - - $diff->setChunks($chunks); - } -} diff --git a/vendor/sebastian/diff/src/TimeEfficientLongestCommonSubsequenceCalculator.php b/vendor/sebastian/diff/src/TimeEfficientLongestCommonSubsequenceCalculator.php deleted file mode 100644 index fd19cac7..00000000 --- a/vendor/sebastian/diff/src/TimeEfficientLongestCommonSubsequenceCalculator.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 SebastianBergmann\Diff; - -use function array_reverse; -use function count; -use function max; -use SplFixedArray; - -final class TimeEfficientLongestCommonSubsequenceCalculator implements LongestCommonSubsequenceCalculator -{ - /** - * {@inheritdoc} - */ - public function calculate(array $from, array $to): array - { - $common = []; - $fromLength = count($from); - $toLength = count($to); - $width = $fromLength + 1; - $matrix = new SplFixedArray($width * ($toLength + 1)); - - for ($i = 0; $i <= $fromLength; ++$i) { - $matrix[$i] = 0; - } - - for ($j = 0; $j <= $toLength; ++$j) { - $matrix[$j * $width] = 0; - } - - for ($i = 1; $i <= $fromLength; ++$i) { - for ($j = 1; $j <= $toLength; ++$j) { - $o = ($j * $width) + $i; - $matrix[$o] = max( - $matrix[$o - 1], - $matrix[$o - $width], - $from[$i - 1] === $to[$j - 1] ? $matrix[$o - $width - 1] + 1 : 0 - ); - } - } - - $i = $fromLength; - $j = $toLength; - - while ($i > 0 && $j > 0) { - if ($from[$i - 1] === $to[$j - 1]) { - $common[] = $from[$i - 1]; - --$i; - --$j; - } else { - $o = ($j * $width) + $i; - - if ($matrix[$o - $width] > $matrix[$o - 1]) { - --$j; - } else { - --$i; - } - } - } - - return array_reverse($common); - } -} diff --git a/vendor/sebastian/environment/ChangeLog.md b/vendor/sebastian/environment/ChangeLog.md deleted file mode 100644 index 8943aee4..00000000 --- a/vendor/sebastian/environment/ChangeLog.md +++ /dev/null @@ -1,176 +0,0 @@ -# Changes in sebastianbergmann/environment - -All notable changes in `sebastianbergmann/environment` are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. - -## [5.1.4] - 2022-04-03 - -### Fixed - -* [#63](https://github.com/sebastianbergmann/environment/pull/63): `Runtime::getCurrentSettings()` does not correctly process INI settings - -## [5.1.3] - 2020-09-28 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.3 || ^8.0` to `>=7.3` - -## [5.1.2] - 2020-06-26 - -### Added - -* This component is now supported on PHP 8 - -## [5.1.1] - 2020-06-15 - -### Changed - -* Tests etc. are now ignored for archive exports - -## [5.1.0] - 2020-04-14 - -### Added - -* `Runtime::performsJustInTimeCompilation()` returns `true` if PHP 8's JIT is active, `false` otherwise - -## [5.0.2] - 2020-03-31 - -### Fixed - -* [#55](https://github.com/sebastianbergmann/environment/issues/55): `stty` command is executed even if no tty is available - -## [5.0.1] - 2020-02-19 - -### Changed - -* `Runtime::getNameWithVersionAndCodeCoverageDriver()` now prioritizes PCOV over Xdebug when both extensions are loaded (just like php-code-coverage does) - -## [5.0.0] - 2020-02-07 - -### Removed - -* This component is no longer supported on PHP 7.1 and PHP 7.2 - -## [4.2.3] - 2019-11-20 - -### Changed - -* [#50](https://github.com/sebastianbergmann/environment/pull/50): Windows improvements to console capabilities - -### Fixed - -* [#49](https://github.com/sebastianbergmann/environment/issues/49): Detection how OpCache handles docblocks does not work correctly when PHPDBG is used - -## [4.2.2] - 2019-05-05 - -### Fixed - -* [#44](https://github.com/sebastianbergmann/environment/pull/44): `TypeError` in `Console::getNumberOfColumnsInteractive()` - -## [4.2.1] - 2019-04-25 - -### Fixed - -* Fixed an issue in `Runtime::getCurrentSettings()` - -## [4.2.0] - 2019-04-25 - -### Added - -* [#36](https://github.com/sebastianbergmann/environment/pull/36): `Runtime::getCurrentSettings()` - -## [4.1.0] - 2019-02-01 - -### Added - -* Implemented `Runtime::getNameWithVersionAndCodeCoverageDriver()` method -* [#34](https://github.com/sebastianbergmann/environment/pull/34): Support for PCOV extension - -## [4.0.2] - 2019-01-28 - -### Fixed - -* [#33](https://github.com/sebastianbergmann/environment/issues/33): `Runtime::discardsComments()` returns true too eagerly - -### Removed - -* Removed support for Zend Optimizer+ in `Runtime::discardsComments()` - -## [4.0.1] - 2018-11-25 - -### Fixed - -* [#31](https://github.com/sebastianbergmann/environment/issues/31): Regressions in `Console` class - -## [4.0.0] - 2018-10-23 [YANKED] - -### Fixed - -* [#25](https://github.com/sebastianbergmann/environment/pull/25): `Console::hasColorSupport()` does not work on Windows - -### Removed - -* This component is no longer supported on PHP 7.0 - -## [3.1.0] - 2017-07-01 - -### Added - -* [#21](https://github.com/sebastianbergmann/environment/issues/21): Equivalent of `PHP_OS_FAMILY` (for PHP < 7.2) - -## [3.0.4] - 2017-06-20 - -### Fixed - -* [#20](https://github.com/sebastianbergmann/environment/pull/20): PHP 7 mode of HHVM not forced - -## [3.0.3] - 2017-05-18 - -### Fixed - -* [#18](https://github.com/sebastianbergmann/environment/issues/18): `Uncaught TypeError: preg_match() expects parameter 2 to be string, null given` - -## [3.0.2] - 2017-04-21 - -### Fixed - -* [#17](https://github.com/sebastianbergmann/environment/issues/17): `Uncaught TypeError: trim() expects parameter 1 to be string, boolean given` - -## [3.0.1] - 2017-04-21 - -### Fixed - -* Fixed inverted logic in `Runtime::discardsComments()` - -## [3.0.0] - 2017-04-21 - -### Added - -* Implemented `Runtime::discardsComments()` for querying whether the PHP runtime discards annotations - -### Removed - -* This component is no longer supported on PHP 5.6 - -[5.1.4]: https://github.com/sebastianbergmann/environment/compare/5.1.3...5.1.4 -[5.1.3]: https://github.com/sebastianbergmann/environment/compare/5.1.2...5.1.3 -[5.1.2]: https://github.com/sebastianbergmann/environment/compare/5.1.1...5.1.2 -[5.1.1]: https://github.com/sebastianbergmann/environment/compare/5.1.0...5.1.1 -[5.1.0]: https://github.com/sebastianbergmann/environment/compare/5.0.2...5.1.0 -[5.0.2]: https://github.com/sebastianbergmann/environment/compare/5.0.1...5.0.2 -[5.0.1]: https://github.com/sebastianbergmann/environment/compare/5.0.0...5.0.1 -[5.0.0]: https://github.com/sebastianbergmann/environment/compare/4.2.3...5.0.0 -[4.2.3]: https://github.com/sebastianbergmann/environment/compare/4.2.2...4.2.3 -[4.2.2]: https://github.com/sebastianbergmann/environment/compare/4.2.1...4.2.2 -[4.2.1]: https://github.com/sebastianbergmann/environment/compare/4.2.0...4.2.1 -[4.2.0]: https://github.com/sebastianbergmann/environment/compare/4.1.0...4.2.0 -[4.1.0]: https://github.com/sebastianbergmann/environment/compare/4.0.2...4.1.0 -[4.0.2]: https://github.com/sebastianbergmann/environment/compare/4.0.1...4.0.2 -[4.0.1]: https://github.com/sebastianbergmann/environment/compare/66691f8e2dc4641909166b275a9a4f45c0e89092...4.0.1 -[4.0.0]: https://github.com/sebastianbergmann/environment/compare/3.1.0...66691f8e2dc4641909166b275a9a4f45c0e89092 -[3.1.0]: https://github.com/sebastianbergmann/environment/compare/3.0...3.1.0 -[3.0.4]: https://github.com/sebastianbergmann/environment/compare/3.0.3...3.0.4 -[3.0.3]: https://github.com/sebastianbergmann/environment/compare/3.0.2...3.0.3 -[3.0.2]: https://github.com/sebastianbergmann/environment/compare/3.0.1...3.0.2 -[3.0.1]: https://github.com/sebastianbergmann/environment/compare/3.0.0...3.0.1 -[3.0.0]: https://github.com/sebastianbergmann/environment/compare/2.0...3.0.0 - diff --git a/vendor/sebastian/environment/LICENSE b/vendor/sebastian/environment/LICENSE deleted file mode 100644 index 42546339..00000000 --- a/vendor/sebastian/environment/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -sebastian/environment - -Copyright (c) 2014-2022, Sebastian Bergmann . -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 Sebastian Bergmann nor the names of his - 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/sebastian/environment/README.md b/vendor/sebastian/environment/README.md deleted file mode 100644 index 1fead13e..00000000 --- a/vendor/sebastian/environment/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# sebastian/environment - -[![Latest Stable Version](https://img.shields.io/packagist/v/sebastian/environment.svg?style=flat-square)](https://packagist.org/packages/sebastian/environment) -[![CI Status](https://github.com/sebastianbergmann/environment/workflows/CI/badge.svg)](https://github.com/sebastianbergmann/environment/actions) -[![Type Coverage](https://shepherd.dev/github/sebastianbergmann/environment/coverage.svg)](https://shepherd.dev/github/sebastianbergmann/environment) - -This component provides functionality that helps writing PHP code that has runtime-specific (PHP / HHVM) execution paths. - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - -``` -composer require sebastian/environment -``` - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - -``` -composer require --dev sebastian/environment -``` diff --git a/vendor/sebastian/environment/composer.json b/vendor/sebastian/environment/composer.json deleted file mode 100644 index d50dcfd7..00000000 --- a/vendor/sebastian/environment/composer.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "sebastian/environment", - "description": "Provides functionality to handle HHVM/PHP environments", - "keywords": ["environment","hhvm","xdebug"], - "homepage": "http://www.github.com/sebastianbergmann/environment", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "config": { - "platform": { - "php": "7.3.0" - }, - "optimize-autoloader": true, - "sort-packages": true - }, - "prefer-stable": true, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-posix": "*" - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - } -} diff --git a/vendor/sebastian/environment/src/Console.php b/vendor/sebastian/environment/src/Console.php deleted file mode 100644 index e7fd1643..00000000 --- a/vendor/sebastian/environment/src/Console.php +++ /dev/null @@ -1,189 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Environment; - -use const DIRECTORY_SEPARATOR; -use const STDIN; -use const STDOUT; -use function defined; -use function fclose; -use function fstat; -use function function_exists; -use function getenv; -use function is_resource; -use function is_string; -use function posix_isatty; -use function preg_match; -use function proc_close; -use function proc_open; -use function sapi_windows_vt100_support; -use function shell_exec; -use function stream_get_contents; -use function stream_isatty; -use function trim; - -final class Console -{ - /** - * @var int - */ - public const STDIN = 0; - - /** - * @var int - */ - public const STDOUT = 1; - - /** - * @var int - */ - public const STDERR = 2; - - /** - * Returns true if STDOUT supports colorization. - * - * This code has been copied and adapted from - * Symfony\Component\Console\Output\StreamOutput. - */ - public function hasColorSupport(): bool - { - if ('Hyper' === getenv('TERM_PROGRAM')) { - return true; - } - - if ($this->isWindows()) { - // @codeCoverageIgnoreStart - return (defined('STDOUT') && function_exists('sapi_windows_vt100_support') && @sapi_windows_vt100_support(STDOUT)) || - false !== getenv('ANSICON') || - 'ON' === getenv('ConEmuANSI') || - 'xterm' === getenv('TERM'); - // @codeCoverageIgnoreEnd - } - - if (!defined('STDOUT')) { - // @codeCoverageIgnoreStart - return false; - // @codeCoverageIgnoreEnd - } - - return $this->isInteractive(STDOUT); - } - - /** - * Returns the number of columns of the terminal. - * - * @codeCoverageIgnore - */ - public function getNumberOfColumns(): int - { - if (!$this->isInteractive(defined('STDIN') ? STDIN : self::STDIN)) { - return 80; - } - - if ($this->isWindows()) { - return $this->getNumberOfColumnsWindows(); - } - - return $this->getNumberOfColumnsInteractive(); - } - - /** - * Returns if the file descriptor is an interactive terminal or not. - * - * Normally, we want to use a resource as a parameter, yet sadly it's not always awailable, - * eg when running code in interactive console (`php -a`), STDIN/STDOUT/STDERR constants are not defined. - * - * @param int|resource $fileDescriptor - */ - public function isInteractive($fileDescriptor = self::STDOUT): bool - { - if (is_resource($fileDescriptor)) { - // These functions require a descriptor that is a real resource, not a numeric ID of it - if (function_exists('stream_isatty') && @stream_isatty($fileDescriptor)) { - return true; - } - - // Check if formatted mode is S_IFCHR - if (function_exists('fstat') && @stream_isatty($fileDescriptor)) { - $stat = @fstat(STDOUT); - - return $stat ? 0020000 === ($stat['mode'] & 0170000) : false; - } - - return false; - } - - return function_exists('posix_isatty') && @posix_isatty($fileDescriptor); - } - - private function isWindows(): bool - { - return DIRECTORY_SEPARATOR === '\\'; - } - - /** - * @codeCoverageIgnore - */ - private function getNumberOfColumnsInteractive(): int - { - if (function_exists('shell_exec') && preg_match('#\d+ (\d+)#', shell_exec('stty size') ?: '', $match) === 1) { - if ((int) $match[1] > 0) { - return (int) $match[1]; - } - } - - if (function_exists('shell_exec') && preg_match('#columns = (\d+);#', shell_exec('stty') ?: '', $match) === 1) { - if ((int) $match[1] > 0) { - return (int) $match[1]; - } - } - - return 80; - } - - /** - * @codeCoverageIgnore - */ - private function getNumberOfColumnsWindows(): int - { - $ansicon = getenv('ANSICON'); - $columns = 80; - - if (is_string($ansicon) && preg_match('/^(\d+)x\d+ \(\d+x(\d+)\)$/', trim($ansicon), $matches)) { - $columns = (int) $matches[1]; - } elseif (function_exists('proc_open')) { - $process = proc_open( - 'mode CON', - [ - 1 => ['pipe', 'w'], - 2 => ['pipe', 'w'], - ], - $pipes, - null, - null, - ['suppress_errors' => true] - ); - - if (is_resource($process)) { - $info = stream_get_contents($pipes[1]); - - fclose($pipes[1]); - fclose($pipes[2]); - proc_close($process); - - if (preg_match('/--------+\r?\n.+?(\d+)\r?\n.+?(\d+)\r?\n/', $info, $matches)) { - $columns = (int) $matches[2]; - } - } - } - - return $columns - 1; - } -} diff --git a/vendor/sebastian/environment/src/OperatingSystem.php b/vendor/sebastian/environment/src/OperatingSystem.php deleted file mode 100644 index 1f3ebca7..00000000 --- a/vendor/sebastian/environment/src/OperatingSystem.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 SebastianBergmann\Environment; - -use const DIRECTORY_SEPARATOR; -use const PHP_OS; -use const PHP_OS_FAMILY; -use function defined; - -final class OperatingSystem -{ - /** - * Returns PHP_OS_FAMILY (if defined (which it is on PHP >= 7.2)). - * Returns a string (compatible with PHP_OS_FAMILY) derived from PHP_OS otherwise. - */ - public function getFamily(): string - { - if (defined('PHP_OS_FAMILY')) { - return PHP_OS_FAMILY; - } - - if (DIRECTORY_SEPARATOR === '\\') { - return 'Windows'; - } - - switch (PHP_OS) { - case 'Darwin': - return 'Darwin'; - - case 'DragonFly': - case 'FreeBSD': - case 'NetBSD': - case 'OpenBSD': - return 'BSD'; - - case 'Linux': - return 'Linux'; - - case 'SunOS': - return 'Solaris'; - - default: - return 'Unknown'; - } - } -} diff --git a/vendor/sebastian/environment/src/Runtime.php b/vendor/sebastian/environment/src/Runtime.php deleted file mode 100644 index d1b92d62..00000000 --- a/vendor/sebastian/environment/src/Runtime.php +++ /dev/null @@ -1,321 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Environment; - -use const PHP_BINARY; -use const PHP_BINDIR; -use const PHP_MAJOR_VERSION; -use const PHP_SAPI; -use const PHP_VERSION; -use function array_map; -use function array_merge; -use function defined; -use function escapeshellarg; -use function explode; -use function extension_loaded; -use function getenv; -use function ini_get; -use function is_readable; -use function parse_ini_file; -use function php_ini_loaded_file; -use function php_ini_scanned_files; -use function phpversion; -use function sprintf; -use function strpos; - -/** - * Utility class for HHVM/PHP environment handling. - */ -final class Runtime -{ - /** - * @var string - */ - private static $binary; - - /** - * Returns true when Xdebug or PCOV is available or - * the runtime used is PHPDBG. - */ - public function canCollectCodeCoverage(): bool - { - return $this->hasXdebug() || $this->hasPCOV() || $this->hasPHPDBGCodeCoverage(); - } - - /** - * Returns true when Zend OPcache is loaded, enabled, - * and is configured to discard comments. - */ - public function discardsComments(): bool - { - if (!$this->isOpcacheActive()) { - return false; - } - - if (ini_get('opcache.save_comments') !== '0') { - return false; - } - - return true; - } - - /** - * Returns true when Zend OPcache is loaded, enabled, - * and is configured to perform just-in-time compilation. - */ - public function performsJustInTimeCompilation(): bool - { - if (PHP_MAJOR_VERSION < 8) { - return false; - } - - if (!$this->isOpcacheActive()) { - return false; - } - - if (strpos(ini_get('opcache.jit'), '0') === 0) { - return false; - } - - return true; - } - - /** - * Returns the path to the binary of the current runtime. - * Appends ' --php' to the path when the runtime is HHVM. - */ - public function getBinary(): string - { - // HHVM - if (self::$binary === null && $this->isHHVM()) { - // @codeCoverageIgnoreStart - if ((self::$binary = getenv('PHP_BINARY')) === false) { - self::$binary = PHP_BINARY; - } - - self::$binary = escapeshellarg(self::$binary) . ' --php' . - ' -d hhvm.php7.all=1'; - // @codeCoverageIgnoreEnd - } - - if (self::$binary === null && PHP_BINARY !== '') { - self::$binary = escapeshellarg(PHP_BINARY); - } - - if (self::$binary === null) { - // @codeCoverageIgnoreStart - $possibleBinaryLocations = [ - PHP_BINDIR . '/php', - PHP_BINDIR . '/php-cli.exe', - PHP_BINDIR . '/php.exe', - ]; - - foreach ($possibleBinaryLocations as $binary) { - if (is_readable($binary)) { - self::$binary = escapeshellarg($binary); - - break; - } - } - // @codeCoverageIgnoreEnd - } - - if (self::$binary === null) { - // @codeCoverageIgnoreStart - self::$binary = 'php'; - // @codeCoverageIgnoreEnd - } - - return self::$binary; - } - - public function getNameWithVersion(): string - { - return $this->getName() . ' ' . $this->getVersion(); - } - - public function getNameWithVersionAndCodeCoverageDriver(): string - { - if (!$this->canCollectCodeCoverage() || $this->hasPHPDBGCodeCoverage()) { - return $this->getNameWithVersion(); - } - - if ($this->hasPCOV()) { - return sprintf( - '%s with PCOV %s', - $this->getNameWithVersion(), - phpversion('pcov') - ); - } - - if ($this->hasXdebug()) { - return sprintf( - '%s with Xdebug %s', - $this->getNameWithVersion(), - phpversion('xdebug') - ); - } - } - - public function getName(): string - { - if ($this->isHHVM()) { - // @codeCoverageIgnoreStart - return 'HHVM'; - // @codeCoverageIgnoreEnd - } - - if ($this->isPHPDBG()) { - // @codeCoverageIgnoreStart - return 'PHPDBG'; - // @codeCoverageIgnoreEnd - } - - return 'PHP'; - } - - public function getVendorUrl(): string - { - if ($this->isHHVM()) { - // @codeCoverageIgnoreStart - return 'http://hhvm.com/'; - // @codeCoverageIgnoreEnd - } - - return 'https://secure.php.net/'; - } - - public function getVersion(): string - { - if ($this->isHHVM()) { - // @codeCoverageIgnoreStart - return HHVM_VERSION; - // @codeCoverageIgnoreEnd - } - - return PHP_VERSION; - } - - /** - * Returns true when the runtime used is PHP and Xdebug is loaded. - */ - public function hasXdebug(): bool - { - return ($this->isPHP() || $this->isHHVM()) && extension_loaded('xdebug'); - } - - /** - * Returns true when the runtime used is HHVM. - */ - public function isHHVM(): bool - { - return defined('HHVM_VERSION'); - } - - /** - * Returns true when the runtime used is PHP without the PHPDBG SAPI. - */ - public function isPHP(): bool - { - return !$this->isHHVM() && !$this->isPHPDBG(); - } - - /** - * Returns true when the runtime used is PHP with the PHPDBG SAPI. - */ - public function isPHPDBG(): bool - { - return PHP_SAPI === 'phpdbg' && !$this->isHHVM(); - } - - /** - * Returns true when the runtime used is PHP with the PHPDBG SAPI - * and the phpdbg_*_oplog() functions are available (PHP >= 7.0). - */ - public function hasPHPDBGCodeCoverage(): bool - { - return $this->isPHPDBG(); - } - - /** - * Returns true when the runtime used is PHP with PCOV loaded and enabled. - */ - public function hasPCOV(): bool - { - return $this->isPHP() && extension_loaded('pcov') && ini_get('pcov.enabled'); - } - - /** - * Parses the loaded php.ini file (if any) as well as all - * additional php.ini files from the additional ini dir for - * a list of all configuration settings loaded from files - * at startup. Then checks for each php.ini setting passed - * via the `$values` parameter whether this setting has - * been changed at runtime. Returns an array of strings - * where each string has the format `key=value` denoting - * the name of a changed php.ini setting with its new value. - * - * @return string[] - */ - public function getCurrentSettings(array $values): array - { - $diff = []; - $files = []; - - if ($file = php_ini_loaded_file()) { - $files[] = $file; - } - - if ($scanned = php_ini_scanned_files()) { - $files = array_merge( - $files, - array_map( - 'trim', - explode(",\n", $scanned) - ) - ); - } - - foreach ($files as $ini) { - $config = parse_ini_file($ini, true); - - foreach ($values as $value) { - $set = ini_get($value); - - if (empty($set)) { - continue; - } - - if ((!isset($config[$value]) || ($set !== $config[$value]))) { - $diff[$value] = sprintf('%s=%s', $value, $set); - } - } - } - - return $diff; - } - - private function isOpcacheActive(): bool - { - if (!extension_loaded('Zend OPcache')) { - return false; - } - - if ((PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') && ini_get('opcache.enable_cli') === '1') { - return true; - } - - if (PHP_SAPI !== 'cli' && PHP_SAPI !== 'phpdbg' && ini_get('opcache.enable') === '1') { - return true; - } - - return false; - } -} diff --git a/vendor/sebastian/exporter/ChangeLog.md b/vendor/sebastian/exporter/ChangeLog.md deleted file mode 100644 index 91a4220d..00000000 --- a/vendor/sebastian/exporter/ChangeLog.md +++ /dev/null @@ -1,78 +0,0 @@ -# ChangeLog - -All notable changes are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. - -## [4.0.5] - 2022-09-14 - -### Fixed - -* [#47](https://github.com/sebastianbergmann/exporter/pull/47): Fix `float` export precision - -## [4.0.4] - 2021-11-11 - -### Changed - -* [#37](https://github.com/sebastianbergmann/exporter/pull/37): Improve export of closed resources - -## [4.0.3] - 2020-09-28 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.3 || ^8.0` to `>=7.3` - -## [4.0.2] - 2020-06-26 - -### Added - -* This component is now supported on PHP 8 - -## [4.0.1] - 2020-06-15 - -### Changed - -* Tests etc. are now ignored for archive exports - -## [4.0.0] - 2020-02-07 - -### Removed - -* This component is no longer supported on PHP 7.0, PHP 7.1, and PHP 7.2 - -## [3.1.5] - 2022-09-14 - -### Fixed - -* [#47](https://github.com/sebastianbergmann/exporter/pull/47): Fix `float` export precision - -## [3.1.4] - 2021-11-11 - -### Changed - -* [#38](https://github.com/sebastianbergmann/exporter/pull/38): Improve export of closed resources - -## [3.1.3] - 2020-11-30 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.0` to `>=7.0` - -## [3.1.2] - 2019-09-14 - -### Fixed - -* [#29](https://github.com/sebastianbergmann/exporter/pull/29): Second parameter for `str_repeat()` must be an integer - -### Removed - -* Remove HHVM-specific code that is no longer needed - -[4.0.5]: https://github.com/sebastianbergmann/exporter/compare/4.0.4...4.0.5 -[4.0.4]: https://github.com/sebastianbergmann/exporter/compare/4.0.3...4.0.4 -[4.0.3]: https://github.com/sebastianbergmann/exporter/compare/4.0.2...4.0.3 -[4.0.2]: https://github.com/sebastianbergmann/exporter/compare/4.0.1...4.0.2 -[4.0.1]: https://github.com/sebastianbergmann/exporter/compare/4.0.0...4.0.1 -[4.0.0]: https://github.com/sebastianbergmann/exporter/compare/3.1.2...4.0.0 -[3.1.5]: https://github.com/sebastianbergmann/exporter/compare/3.1.4...3.1.5 -[3.1.4]: https://github.com/sebastianbergmann/exporter/compare/3.1.3...3.1.4 -[3.1.3]: https://github.com/sebastianbergmann/exporter/compare/3.1.2...3.1.3 -[3.1.2]: https://github.com/sebastianbergmann/exporter/compare/3.1.1...3.1.2 diff --git a/vendor/sebastian/exporter/LICENSE b/vendor/sebastian/exporter/LICENSE deleted file mode 100644 index 26dc7fec..00000000 --- a/vendor/sebastian/exporter/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -Exporter - -Copyright (c) 2002-2021, Sebastian Bergmann . -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 Sebastian Bergmann nor the names of his - 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/sebastian/exporter/README.md b/vendor/sebastian/exporter/README.md deleted file mode 100644 index ed8719f5..00000000 --- a/vendor/sebastian/exporter/README.md +++ /dev/null @@ -1,174 +0,0 @@ -# sebastian/exporter - -[![CI Status](https://github.com/sebastianbergmann/exporter/workflows/CI/badge.svg)](https://github.com/sebastianbergmann/exporter/actions) -[![Type Coverage](https://shepherd.dev/github/sebastianbergmann/exporter/coverage.svg)](https://shepherd.dev/github/sebastianbergmann/exporter) - -This component provides the functionality to export PHP variables for visualization. - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - -``` -composer require sebastian/exporter -``` - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - -``` -composer require --dev sebastian/exporter -``` - -## Usage - -Exporting: - -```php - '' - 'string' => '' - 'code' => 0 - 'file' => '/home/sebastianbergmann/test.php' - 'line' => 34 - 'previous' => null -) -*/ - -print $exporter->export(new Exception); -``` - -## Data Types - -Exporting simple types: - -```php -export(46); - -// 4.0 -print $exporter->export(4.0); - -// 'hello, world!' -print $exporter->export('hello, world!'); - -// false -print $exporter->export(false); - -// NAN -print $exporter->export(acos(8)); - -// -INF -print $exporter->export(log(0)); - -// null -print $exporter->export(null); - -// resource(13) of type (stream) -print $exporter->export(fopen('php://stderr', 'w')); - -// Binary String: 0x000102030405 -print $exporter->export(chr(0) . chr(1) . chr(2) . chr(3) . chr(4) . chr(5)); -``` - -Exporting complex types: - -```php - Array &1 ( - 0 => 1 - 1 => 2 - 2 => 3 - ) - 1 => Array &2 ( - 0 => '' - 1 => 0 - 2 => false - ) -) -*/ - -print $exporter->export(array(array(1,2,3), array("",0,FALSE))); - -/* -Array &0 ( - 'self' => Array &1 ( - 'self' => Array &1 - ) -) -*/ - -$array = array(); -$array['self'] = &$array; -print $exporter->export($array); - -/* -stdClass Object &0000000003a66dcc0000000025e723e2 ( - 'self' => stdClass Object &0000000003a66dcc0000000025e723e2 -) -*/ - -$obj = new stdClass(); -$obj->self = $obj; -print $exporter->export($obj); -``` - -Compact exports: - -```php -shortenedExport(array()); - -// Array (...) -print $exporter->shortenedExport(array(1,2,3,4,5)); - -// stdClass Object () -print $exporter->shortenedExport(new stdClass); - -// Exception Object (...) -print $exporter->shortenedExport(new Exception); - -// this\nis\na\nsuper\nlong\nstring\nt...\nspace -print $exporter->shortenedExport( -<<=7.3", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3", - "ext-mbstring": "*" - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - } -} - diff --git a/vendor/sebastian/exporter/src/Exporter.php b/vendor/sebastian/exporter/src/Exporter.php deleted file mode 100644 index ca006ad6..00000000 --- a/vendor/sebastian/exporter/src/Exporter.php +++ /dev/null @@ -1,346 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Exporter; - -use function bin2hex; -use function count; -use function function_exists; -use function get_class; -use function get_resource_type; -use function gettype; -use function implode; -use function ini_get; -use function ini_set; -use function is_array; -use function is_float; -use function is_object; -use function is_resource; -use function is_string; -use function mb_strlen; -use function mb_substr; -use function preg_match; -use function spl_object_hash; -use function sprintf; -use function str_repeat; -use function str_replace; -use function strlen; -use function substr; -use function var_export; -use SebastianBergmann\RecursionContext\Context; -use SplObjectStorage; - -/** - * A nifty utility for visualizing PHP variables. - * - * - * export(new Exception); - * - */ -class Exporter -{ - /** - * Exports a value as a string. - * - * The output of this method is similar to the output of print_r(), but - * improved in various aspects: - * - * - NULL is rendered as "null" (instead of "") - * - TRUE is rendered as "true" (instead of "1") - * - FALSE is rendered as "false" (instead of "") - * - Strings are always quoted with single quotes - * - Carriage returns and newlines are normalized to \n - * - Recursion and repeated rendering is treated properly - * - * @param int $indentation The indentation level of the 2nd+ line - * - * @return string - */ - public function export($value, $indentation = 0) - { - return $this->recursiveExport($value, $indentation); - } - - /** - * @param array $data - * @param Context $context - * - * @return string - */ - public function shortenedRecursiveExport(&$data, Context $context = null) - { - $result = []; - $exporter = new self(); - - if (!$context) { - $context = new Context; - } - - $array = $data; - $context->add($data); - - foreach ($array as $key => $value) { - if (is_array($value)) { - if ($context->contains($data[$key]) !== false) { - $result[] = '*RECURSION*'; - } else { - $result[] = sprintf( - 'array(%s)', - $this->shortenedRecursiveExport($data[$key], $context) - ); - } - } else { - $result[] = $exporter->shortenedExport($value); - } - } - - return implode(', ', $result); - } - - /** - * Exports a value into a single-line string. - * - * The output of this method is similar to the output of - * SebastianBergmann\Exporter\Exporter::export(). - * - * Newlines are replaced by the visible string '\n'. - * Contents of arrays and objects (if any) are replaced by '...'. - * - * @return string - * - * @see SebastianBergmann\Exporter\Exporter::export - */ - public function shortenedExport($value) - { - if (is_string($value)) { - $string = str_replace("\n", '', $this->export($value)); - - if (function_exists('mb_strlen')) { - if (mb_strlen($string) > 40) { - $string = mb_substr($string, 0, 30) . '...' . mb_substr($string, -7); - } - } else { - if (strlen($string) > 40) { - $string = substr($string, 0, 30) . '...' . substr($string, -7); - } - } - - return $string; - } - - if (is_object($value)) { - return sprintf( - '%s Object (%s)', - get_class($value), - count($this->toArray($value)) > 0 ? '...' : '' - ); - } - - if (is_array($value)) { - return sprintf( - 'Array (%s)', - count($value) > 0 ? '...' : '' - ); - } - - return $this->export($value); - } - - /** - * Converts an object to an array containing all of its private, protected - * and public properties. - * - * @return array - */ - public function toArray($value) - { - if (!is_object($value)) { - return (array) $value; - } - - $array = []; - - foreach ((array) $value as $key => $val) { - // Exception traces commonly reference hundreds to thousands of - // objects currently loaded in memory. Including them in the result - // has a severe negative performance impact. - if ("\0Error\0trace" === $key || "\0Exception\0trace" === $key) { - continue; - } - - // properties are transformed to keys in the following way: - // private $property => "\0Classname\0property" - // protected $property => "\0*\0property" - // public $property => "property" - if (preg_match('/^\0.+\0(.+)$/', (string) $key, $matches)) { - $key = $matches[1]; - } - - // See https://github.com/php/php-src/commit/5721132 - if ($key === "\0gcdata") { - continue; - } - - $array[$key] = $val; - } - - // Some internal classes like SplObjectStorage don't work with the - // above (fast) mechanism nor with reflection in Zend. - // Format the output similarly to print_r() in this case - if ($value instanceof SplObjectStorage) { - foreach ($value as $key => $val) { - $array[spl_object_hash($val)] = [ - 'obj' => $val, - 'inf' => $value->getInfo(), - ]; - } - } - - return $array; - } - - /** - * Recursive implementation of export. - * - * @param mixed $value The value to export - * @param int $indentation The indentation level of the 2nd+ line - * @param \SebastianBergmann\RecursionContext\Context $processed Previously processed objects - * - * @return string - * - * @see SebastianBergmann\Exporter\Exporter::export - */ - protected function recursiveExport(&$value, $indentation, $processed = null) - { - if ($value === null) { - return 'null'; - } - - if ($value === true) { - return 'true'; - } - - if ($value === false) { - return 'false'; - } - - if (is_float($value)) { - $precisionBackup = ini_get('precision'); - - ini_set('precision', '-1'); - - try { - $valueStr = (string) $value; - - if ((string) (int) $value === $valueStr) { - return $valueStr . '.0'; - } - - return $valueStr; - } finally { - ini_set('precision', $precisionBackup); - } - } - - if (gettype($value) === 'resource (closed)') { - return 'resource (closed)'; - } - - if (is_resource($value)) { - return sprintf( - 'resource(%d) of type (%s)', - $value, - get_resource_type($value) - ); - } - - if (is_string($value)) { - // Match for most non printable chars somewhat taking multibyte chars into account - if (preg_match('/[^\x09-\x0d\x1b\x20-\xff]/', $value)) { - return 'Binary String: 0x' . bin2hex($value); - } - - return "'" . - str_replace( - '', - "\n", - str_replace( - ["\r\n", "\n\r", "\r", "\n"], - ['\r\n', '\n\r', '\r', '\n'], - $value - ) - ) . - "'"; - } - - $whitespace = str_repeat(' ', 4 * $indentation); - - if (!$processed) { - $processed = new Context; - } - - if (is_array($value)) { - if (($key = $processed->contains($value)) !== false) { - return 'Array &' . $key; - } - - $array = $value; - $key = $processed->add($value); - $values = ''; - - if (count($array) > 0) { - foreach ($array as $k => $v) { - $values .= sprintf( - '%s %s => %s' . "\n", - $whitespace, - $this->recursiveExport($k, $indentation), - $this->recursiveExport($value[$k], $indentation + 1, $processed) - ); - } - - $values = "\n" . $values . $whitespace; - } - - return sprintf('Array &%s (%s)', $key, $values); - } - - if (is_object($value)) { - $class = get_class($value); - - if ($hash = $processed->contains($value)) { - return sprintf('%s Object &%s', $class, $hash); - } - - $hash = $processed->add($value); - $values = ''; - $array = $this->toArray($value); - - if (count($array) > 0) { - foreach ($array as $k => $v) { - $values .= sprintf( - '%s %s => %s' . "\n", - $whitespace, - $this->recursiveExport($k, $indentation), - $this->recursiveExport($v, $indentation + 1, $processed) - ); - } - - $values = "\n" . $values . $whitespace; - } - - return sprintf('%s Object &%s (%s)', $class, $hash, $values); - } - - return var_export($value, true); - } -} diff --git a/vendor/sebastian/global-state/ChangeLog.md b/vendor/sebastian/global-state/ChangeLog.md deleted file mode 100644 index a27a5cf1..00000000 --- a/vendor/sebastian/global-state/ChangeLog.md +++ /dev/null @@ -1,79 +0,0 @@ -# Changes in sebastian/global-state - -All notable changes in `sebastian/global-state` are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. - -## [5.0.5] - 2022-02-14 - -### Fixed - -* [#34](https://github.com/sebastianbergmann/global-state/pull/34): Uninitialised typed static properties are not handled correctly - -## [5.0.4] - 2022-02-10 - -### Fixed - -* The `$includeTraits` parameter of `SebastianBergmann\GlobalState\Snapshot::__construct()` is not respected - -## [5.0.3] - 2021-06-11 - -### Changed - -* `SebastianBergmann\GlobalState\CodeExporter::globalVariables()` now generates code that is compatible with PHP 8.1 - -## [5.0.2] - 2020-10-26 - -### Fixed - -* `SebastianBergmann\GlobalState\Exception` now correctly extends `\Throwable` - -## [5.0.1] - 2020-09-28 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.3 || ^8.0` to `>=7.3` - -## [5.0.0] - 2020-08-07 - -### Changed - -* The `SebastianBergmann\GlobalState\Blacklist` class has been renamed to `SebastianBergmann\GlobalState\ExcludeList` - -## [4.0.0] - 2020-02-07 - -### Removed - -* This component is no longer supported on PHP 7.2 - -## [3.0.2] - 2022-02-10 - -### Fixed - -* The `$includeTraits` parameter of `SebastianBergmann\GlobalState\Snapshot::__construct()` is not respected - -## [3.0.1] - 2020-11-30 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.2` to `>=7.2` - -## [3.0.0] - 2019-02-01 - -### Changed - -* `Snapshot::canBeSerialized()` now recursively checks arrays and object graphs for variables that cannot be serialized - -### Removed - -* This component is no longer supported on PHP 7.0 and PHP 7.1 - -[5.0.5]: https://github.com/sebastianbergmann/global-state/compare/5.0.4...5.0.5 -[5.0.4]: https://github.com/sebastianbergmann/global-state/compare/5.0.3...5.0.4 -[5.0.3]: https://github.com/sebastianbergmann/global-state/compare/5.0.2...5.0.3 -[5.0.2]: https://github.com/sebastianbergmann/global-state/compare/5.0.1...5.0.2 -[5.0.1]: https://github.com/sebastianbergmann/global-state/compare/5.0.0...5.0.1 -[5.0.0]: https://github.com/sebastianbergmann/global-state/compare/4.0.0...5.0.0 -[4.0.0]: https://github.com/sebastianbergmann/global-state/compare/3.0.2...4.0.0 -[3.0.2]: https://github.com/sebastianbergmann/phpunit/compare/3.0.1...3.0.2 -[3.0.1]: https://github.com/sebastianbergmann/phpunit/compare/3.0.0...3.0.1 -[3.0.0]: https://github.com/sebastianbergmann/phpunit/compare/2.0.0...3.0.0 - diff --git a/vendor/sebastian/global-state/LICENSE b/vendor/sebastian/global-state/LICENSE deleted file mode 100644 index 240190bd..00000000 --- a/vendor/sebastian/global-state/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -sebastian/global-state - -Copyright (c) 2001-2022, Sebastian Bergmann . -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 Sebastian Bergmann nor the names of his - 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/sebastian/global-state/README.md b/vendor/sebastian/global-state/README.md deleted file mode 100644 index af15bedd..00000000 --- a/vendor/sebastian/global-state/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# sebastian/global-state - -[![CI Status](https://github.com/sebastianbergmann/global-state/workflows/CI/badge.svg)](https://github.com/sebastianbergmann/global-state/actions) -[![Type Coverage](https://shepherd.dev/github/sebastianbergmann/global-state/coverage.svg)](https://shepherd.dev/github/sebastianbergmann/global-state) - -Snapshotting of global state, factored out of PHPUnit into a stand-alone component. - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - -``` -composer require sebastian/global-state -``` - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - -``` -composer require --dev sebastian/global-state -``` diff --git a/vendor/sebastian/global-state/composer.json b/vendor/sebastian/global-state/composer.json deleted file mode 100644 index 0fef446a..00000000 --- a/vendor/sebastian/global-state/composer.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "name": "sebastian/global-state", - "description": "Snapshotting of global state", - "keywords": ["global state"], - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "prefer-stable": true, - "config": { - "platform": { - "php": "7.3.0" - }, - "optimize-autoloader": true, - "sort-packages": true - }, - "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "ext-dom": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-uopz": "*" - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "autoload-dev": { - "classmap": [ - "tests/_fixture/" - ], - "files": [ - "tests/_fixture/SnapshotFunctions.php" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - } -} diff --git a/vendor/sebastian/global-state/src/CodeExporter.php b/vendor/sebastian/global-state/src/CodeExporter.php deleted file mode 100644 index 71cdbf50..00000000 --- a/vendor/sebastian/global-state/src/CodeExporter.php +++ /dev/null @@ -1,109 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\GlobalState; - -use const PHP_EOL; -use function is_array; -use function is_scalar; -use function serialize; -use function sprintf; -use function var_export; - -/** - * Exports parts of a Snapshot as PHP code. - */ -final class CodeExporter -{ - public function constants(Snapshot $snapshot): string - { - $result = ''; - - foreach ($snapshot->constants() as $name => $value) { - $result .= sprintf( - 'if (!defined(\'%s\')) define(\'%s\', %s);' . "\n", - $name, - $name, - $this->exportVariable($value) - ); - } - - return $result; - } - - public function globalVariables(Snapshot $snapshot): string - { - $result = <<<'EOT' -call_user_func( - function () - { - foreach (array_keys($GLOBALS) as $key) { - unset($GLOBALS[$key]); - } - } -); - - -EOT; - - foreach ($snapshot->globalVariables() as $name => $value) { - $result .= sprintf( - '$GLOBALS[%s] = %s;' . PHP_EOL, - $this->exportVariable($name), - $this->exportVariable($value) - ); - } - - return $result; - } - - public function iniSettings(Snapshot $snapshot): string - { - $result = ''; - - foreach ($snapshot->iniSettings() as $key => $value) { - $result .= sprintf( - '@ini_set(%s, %s);' . "\n", - $this->exportVariable($key), - $this->exportVariable($value) - ); - } - - return $result; - } - - private function exportVariable($variable): string - { - if (is_scalar($variable) || null === $variable || - (is_array($variable) && $this->arrayOnlyContainsScalars($variable))) { - return var_export($variable, true); - } - - return 'unserialize(' . var_export(serialize($variable), true) . ')'; - } - - private function arrayOnlyContainsScalars(array $array): bool - { - $result = true; - - foreach ($array as $element) { - if (is_array($element)) { - $result = $this->arrayOnlyContainsScalars($element); - } elseif (!is_scalar($element) && null !== $element) { - $result = false; - } - - if ($result === false) { - break; - } - } - - return $result; - } -} diff --git a/vendor/sebastian/global-state/src/ExcludeList.php b/vendor/sebastian/global-state/src/ExcludeList.php deleted file mode 100644 index 5631f118..00000000 --- a/vendor/sebastian/global-state/src/ExcludeList.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 SebastianBergmann\GlobalState; - -use function in_array; -use function strpos; -use ReflectionClass; - -final class ExcludeList -{ - /** - * @var array - */ - private $globalVariables = []; - - /** - * @var string[] - */ - private $classes = []; - - /** - * @var string[] - */ - private $classNamePrefixes = []; - - /** - * @var string[] - */ - private $parentClasses = []; - - /** - * @var string[] - */ - private $interfaces = []; - - /** - * @var array - */ - private $staticAttributes = []; - - public function addGlobalVariable(string $variableName): void - { - $this->globalVariables[$variableName] = true; - } - - public function addClass(string $className): void - { - $this->classes[] = $className; - } - - public function addSubclassesOf(string $className): void - { - $this->parentClasses[] = $className; - } - - public function addImplementorsOf(string $interfaceName): void - { - $this->interfaces[] = $interfaceName; - } - - public function addClassNamePrefix(string $classNamePrefix): void - { - $this->classNamePrefixes[] = $classNamePrefix; - } - - public function addStaticAttribute(string $className, string $attributeName): void - { - if (!isset($this->staticAttributes[$className])) { - $this->staticAttributes[$className] = []; - } - - $this->staticAttributes[$className][$attributeName] = true; - } - - public function isGlobalVariableExcluded(string $variableName): bool - { - return isset($this->globalVariables[$variableName]); - } - - public function isStaticAttributeExcluded(string $className, string $attributeName): bool - { - if (in_array($className, $this->classes, true)) { - return true; - } - - foreach ($this->classNamePrefixes as $prefix) { - if (strpos($className, $prefix) === 0) { - return true; - } - } - - $class = new ReflectionClass($className); - - foreach ($this->parentClasses as $type) { - if ($class->isSubclassOf($type)) { - return true; - } - } - - foreach ($this->interfaces as $type) { - if ($class->implementsInterface($type)) { - return true; - } - } - - if (isset($this->staticAttributes[$className][$attributeName])) { - return true; - } - - return false; - } -} diff --git a/vendor/sebastian/global-state/src/Restorer.php b/vendor/sebastian/global-state/src/Restorer.php deleted file mode 100644 index 1633fcc1..00000000 --- a/vendor/sebastian/global-state/src/Restorer.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. - */ -namespace SebastianBergmann\GlobalState; - -use function array_diff; -use function array_key_exists; -use function array_keys; -use function array_merge; -use function function_exists; -use function get_defined_functions; -use function in_array; -use function is_array; -use ReflectionClass; -use ReflectionProperty; - -/** - * Restorer of snapshots of global state. - */ -class Restorer -{ - /** - * Deletes function definitions that are not defined in a snapshot. - * - * @throws RuntimeException when the uopz_delete() function is not available - * - * @see https://github.com/krakjoe/uopz - */ - public function restoreFunctions(Snapshot $snapshot): void - { - if (!function_exists('uopz_delete')) { - throw new RuntimeException('The uopz_delete() function is required for this operation'); - } - - $functions = get_defined_functions(); - - foreach (array_diff($functions['user'], $snapshot->functions()) as $function) { - uopz_delete($function); - } - } - - /** - * Restores all global and super-global variables from a snapshot. - */ - public function restoreGlobalVariables(Snapshot $snapshot): void - { - $superGlobalArrays = $snapshot->superGlobalArrays(); - - foreach ($superGlobalArrays as $superGlobalArray) { - $this->restoreSuperGlobalArray($snapshot, $superGlobalArray); - } - - $globalVariables = $snapshot->globalVariables(); - - foreach (array_keys($GLOBALS) as $key) { - if ($key !== 'GLOBALS' && - !in_array($key, $superGlobalArrays, true) && - !$snapshot->excludeList()->isGlobalVariableExcluded($key)) { - if (array_key_exists($key, $globalVariables)) { - $GLOBALS[$key] = $globalVariables[$key]; - } else { - unset($GLOBALS[$key]); - } - } - } - } - - /** - * Restores all static attributes in user-defined classes from this snapshot. - */ - public function restoreStaticAttributes(Snapshot $snapshot): void - { - $current = new Snapshot($snapshot->excludeList(), false, false, false, false, true, false, false, false, false); - $newClasses = array_diff($current->classes(), $snapshot->classes()); - - unset($current); - - foreach ($snapshot->staticAttributes() as $className => $staticAttributes) { - foreach ($staticAttributes as $name => $value) { - $reflector = new ReflectionProperty($className, $name); - $reflector->setAccessible(true); - $reflector->setValue($value); - } - } - - foreach ($newClasses as $className) { - $class = new ReflectionClass($className); - $defaults = $class->getDefaultProperties(); - - foreach ($class->getProperties() as $attribute) { - if (!$attribute->isStatic()) { - continue; - } - - $name = $attribute->getName(); - - if ($snapshot->excludeList()->isStaticAttributeExcluded($className, $name)) { - continue; - } - - if (!isset($defaults[$name])) { - continue; - } - - $attribute->setAccessible(true); - $attribute->setValue($defaults[$name]); - } - } - } - - /** - * Restores a super-global variable array from this snapshot. - */ - private function restoreSuperGlobalArray(Snapshot $snapshot, string $superGlobalArray): void - { - $superGlobalVariables = $snapshot->superGlobalVariables(); - - if (isset($GLOBALS[$superGlobalArray]) && - is_array($GLOBALS[$superGlobalArray]) && - isset($superGlobalVariables[$superGlobalArray])) { - $keys = array_keys( - array_merge( - $GLOBALS[$superGlobalArray], - $superGlobalVariables[$superGlobalArray] - ) - ); - - foreach ($keys as $key) { - if (isset($superGlobalVariables[$superGlobalArray][$key])) { - $GLOBALS[$superGlobalArray][$key] = $superGlobalVariables[$superGlobalArray][$key]; - } else { - unset($GLOBALS[$superGlobalArray][$key]); - } - } - } - } -} diff --git a/vendor/sebastian/global-state/src/Snapshot.php b/vendor/sebastian/global-state/src/Snapshot.php deleted file mode 100644 index e33264eb..00000000 --- a/vendor/sebastian/global-state/src/Snapshot.php +++ /dev/null @@ -1,443 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\GlobalState; - -use const PHP_VERSION_ID; -use function array_keys; -use function array_merge; -use function array_reverse; -use function func_get_args; -use function get_declared_classes; -use function get_declared_interfaces; -use function get_declared_traits; -use function get_defined_constants; -use function get_defined_functions; -use function get_included_files; -use function in_array; -use function ini_get_all; -use function is_array; -use function is_object; -use function is_resource; -use function is_scalar; -use function serialize; -use function unserialize; -use ReflectionClass; -use SebastianBergmann\ObjectReflector\ObjectReflector; -use SebastianBergmann\RecursionContext\Context; -use Throwable; - -/** - * A snapshot of global state. - */ -class Snapshot -{ - /** - * @var ExcludeList - */ - private $excludeList; - - /** - * @var array - */ - private $globalVariables = []; - - /** - * @var array - */ - private $superGlobalArrays = []; - - /** - * @var array - */ - private $superGlobalVariables = []; - - /** - * @var array - */ - private $staticAttributes = []; - - /** - * @var array - */ - private $iniSettings = []; - - /** - * @var array - */ - private $includedFiles = []; - - /** - * @var array - */ - private $constants = []; - - /** - * @var array - */ - private $functions = []; - - /** - * @var array - */ - private $interfaces = []; - - /** - * @var array - */ - private $classes = []; - - /** - * @var array - */ - private $traits = []; - - /** - * Creates a snapshot of the current global state. - */ - public function __construct(ExcludeList $excludeList = null, bool $includeGlobalVariables = true, bool $includeStaticAttributes = true, bool $includeConstants = true, bool $includeFunctions = true, bool $includeClasses = true, bool $includeInterfaces = true, bool $includeTraits = true, bool $includeIniSettings = true, bool $includeIncludedFiles = true) - { - $this->excludeList = $excludeList ?: new ExcludeList; - - if ($includeConstants) { - $this->snapshotConstants(); - } - - if ($includeFunctions) { - $this->snapshotFunctions(); - } - - if ($includeClasses || $includeStaticAttributes) { - $this->snapshotClasses(); - } - - if ($includeInterfaces) { - $this->snapshotInterfaces(); - } - - if ($includeGlobalVariables) { - $this->setupSuperGlobalArrays(); - $this->snapshotGlobals(); - } - - if ($includeStaticAttributes) { - $this->snapshotStaticAttributes(); - } - - if ($includeIniSettings) { - $this->iniSettings = ini_get_all(null, false); - } - - if ($includeIncludedFiles) { - $this->includedFiles = get_included_files(); - } - - if ($includeTraits) { - $this->traits = get_declared_traits(); - } - } - - public function excludeList(): ExcludeList - { - return $this->excludeList; - } - - public function globalVariables(): array - { - return $this->globalVariables; - } - - public function superGlobalVariables(): array - { - return $this->superGlobalVariables; - } - - public function superGlobalArrays(): array - { - return $this->superGlobalArrays; - } - - public function staticAttributes(): array - { - return $this->staticAttributes; - } - - public function iniSettings(): array - { - return $this->iniSettings; - } - - public function includedFiles(): array - { - return $this->includedFiles; - } - - public function constants(): array - { - return $this->constants; - } - - public function functions(): array - { - return $this->functions; - } - - public function interfaces(): array - { - return $this->interfaces; - } - - public function classes(): array - { - return $this->classes; - } - - public function traits(): array - { - return $this->traits; - } - - /** - * Creates a snapshot user-defined constants. - */ - private function snapshotConstants(): void - { - $constants = get_defined_constants(true); - - if (isset($constants['user'])) { - $this->constants = $constants['user']; - } - } - - /** - * Creates a snapshot user-defined functions. - */ - private function snapshotFunctions(): void - { - $functions = get_defined_functions(); - - $this->functions = $functions['user']; - } - - /** - * Creates a snapshot user-defined classes. - */ - private function snapshotClasses(): void - { - foreach (array_reverse(get_declared_classes()) as $className) { - $class = new ReflectionClass($className); - - if (!$class->isUserDefined()) { - break; - } - - $this->classes[] = $className; - } - - $this->classes = array_reverse($this->classes); - } - - /** - * Creates a snapshot user-defined interfaces. - */ - private function snapshotInterfaces(): void - { - foreach (array_reverse(get_declared_interfaces()) as $interfaceName) { - $class = new ReflectionClass($interfaceName); - - if (!$class->isUserDefined()) { - break; - } - - $this->interfaces[] = $interfaceName; - } - - $this->interfaces = array_reverse($this->interfaces); - } - - /** - * Creates a snapshot of all global and super-global variables. - */ - private function snapshotGlobals(): void - { - $superGlobalArrays = $this->superGlobalArrays(); - - foreach ($superGlobalArrays as $superGlobalArray) { - $this->snapshotSuperGlobalArray($superGlobalArray); - } - - foreach (array_keys($GLOBALS) as $key) { - if ($key !== 'GLOBALS' && - !in_array($key, $superGlobalArrays, true) && - $this->canBeSerialized($GLOBALS[$key]) && - !$this->excludeList->isGlobalVariableExcluded($key)) { - /* @noinspection UnserializeExploitsInspection */ - $this->globalVariables[$key] = unserialize(serialize($GLOBALS[$key])); - } - } - } - - /** - * Creates a snapshot a super-global variable array. - */ - private function snapshotSuperGlobalArray(string $superGlobalArray): void - { - $this->superGlobalVariables[$superGlobalArray] = []; - - if (isset($GLOBALS[$superGlobalArray]) && is_array($GLOBALS[$superGlobalArray])) { - foreach ($GLOBALS[$superGlobalArray] as $key => $value) { - /* @noinspection UnserializeExploitsInspection */ - $this->superGlobalVariables[$superGlobalArray][$key] = unserialize(serialize($value)); - } - } - } - - /** - * Creates a snapshot of all static attributes in user-defined classes. - */ - private function snapshotStaticAttributes(): void - { - foreach ($this->classes as $className) { - $class = new ReflectionClass($className); - $snapshot = []; - - foreach ($class->getProperties() as $attribute) { - if ($attribute->isStatic()) { - $name = $attribute->getName(); - - if ($this->excludeList->isStaticAttributeExcluded($className, $name)) { - continue; - } - - $attribute->setAccessible(true); - - if (PHP_VERSION_ID >= 70400 && !$attribute->isInitialized()) { - continue; - } - - $value = $attribute->getValue(); - - if ($this->canBeSerialized($value)) { - /* @noinspection UnserializeExploitsInspection */ - $snapshot[$name] = unserialize(serialize($value)); - } - } - } - - if (!empty($snapshot)) { - $this->staticAttributes[$className] = $snapshot; - } - } - } - - /** - * Returns a list of all super-global variable arrays. - */ - private function setupSuperGlobalArrays(): void - { - $this->superGlobalArrays = [ - '_ENV', - '_POST', - '_GET', - '_COOKIE', - '_SERVER', - '_FILES', - '_REQUEST', - ]; - } - - private function canBeSerialized($variable): bool - { - if (is_scalar($variable) || $variable === null) { - return true; - } - - if (is_resource($variable)) { - return false; - } - - foreach ($this->enumerateObjectsAndResources($variable) as $value) { - if (is_resource($value)) { - return false; - } - - if (is_object($value)) { - $class = new ReflectionClass($value); - - if ($class->isAnonymous()) { - return false; - } - - try { - @serialize($value); - } catch (Throwable $t) { - return false; - } - } - } - - return true; - } - - private function enumerateObjectsAndResources($variable): array - { - if (isset(func_get_args()[1])) { - $processed = func_get_args()[1]; - } else { - $processed = new Context; - } - - $result = []; - - if ($processed->contains($variable)) { - return $result; - } - - $array = $variable; - $processed->add($variable); - - if (is_array($variable)) { - foreach ($array as $element) { - if (!is_array($element) && !is_object($element) && !is_resource($element)) { - continue; - } - - if (!is_resource($element)) { - /** @noinspection SlowArrayOperationsInLoopInspection */ - $result = array_merge( - $result, - $this->enumerateObjectsAndResources($element, $processed) - ); - } else { - $result[] = $element; - } - } - } else { - $result[] = $variable; - - foreach ((new ObjectReflector)->getAttributes($variable) as $value) { - if (!is_array($value) && !is_object($value) && !is_resource($value)) { - continue; - } - - if (!is_resource($value)) { - /** @noinspection SlowArrayOperationsInLoopInspection */ - $result = array_merge( - $result, - $this->enumerateObjectsAndResources($value, $processed) - ); - } else { - $result[] = $value; - } - } - } - - return $result; - } -} diff --git a/vendor/sebastian/global-state/src/exceptions/Exception.php b/vendor/sebastian/global-state/src/exceptions/Exception.php deleted file mode 100644 index 94432008..00000000 --- a/vendor/sebastian/global-state/src/exceptions/Exception.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. - */ -namespace SebastianBergmann\GlobalState; - -use Throwable; - -interface Exception extends Throwable -{ -} diff --git a/vendor/sebastian/global-state/src/exceptions/RuntimeException.php b/vendor/sebastian/global-state/src/exceptions/RuntimeException.php deleted file mode 100644 index 79f02a11..00000000 --- a/vendor/sebastian/global-state/src/exceptions/RuntimeException.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\GlobalState; - -final class RuntimeException extends \RuntimeException implements Exception -{ -} diff --git a/vendor/sebastian/lines-of-code/.psalm/baseline.xml b/vendor/sebastian/lines-of-code/.psalm/baseline.xml deleted file mode 100644 index 77e688e0..00000000 --- a/vendor/sebastian/lines-of-code/.psalm/baseline.xml +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/vendor/sebastian/lines-of-code/.psalm/config.xml b/vendor/sebastian/lines-of-code/.psalm/config.xml deleted file mode 100644 index 15abef05..00000000 --- a/vendor/sebastian/lines-of-code/.psalm/config.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - diff --git a/vendor/sebastian/lines-of-code/ChangeLog.md b/vendor/sebastian/lines-of-code/ChangeLog.md deleted file mode 100644 index 39bcaad4..00000000 --- a/vendor/sebastian/lines-of-code/ChangeLog.md +++ /dev/null @@ -1,34 +0,0 @@ -# ChangeLog - -All notable changes are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. - -## [1.0.3] - 2020-11-28 - -### Fixed - -* Files that do not contain a newline were not handled correctly - -### Changed - -* A line of code is no longer considered to be a Logical Line of Code if it does not contain an `Expr` node - -## [1.0.2] - 2020-10-26 - -### Fixed - -* `SebastianBergmann\LinesOfCode\Exception` now correctly extends `\Throwable` - -## [1.0.1] - 2020-09-28 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.3 || ^8.0` to `>=7.3` - -## [1.0.0] - 2020-07-22 - -* Initial release - -[1.0.3]: https://github.com/sebastianbergmann/lines-of-code/compare/1.0.2...1.0.3 -[1.0.2]: https://github.com/sebastianbergmann/lines-of-code/compare/1.0.1...1.0.2 -[1.0.1]: https://github.com/sebastianbergmann/lines-of-code/compare/1.0.0...1.0.1 -[1.0.0]: https://github.com/sebastianbergmann/lines-of-code/compare/f959e71f00e591288acc024afe9cb966c6cf9bd6...1.0.0 diff --git a/vendor/sebastian/lines-of-code/LICENSE b/vendor/sebastian/lines-of-code/LICENSE deleted file mode 100644 index d170181f..00000000 --- a/vendor/sebastian/lines-of-code/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -sebastian/lines-of-code - -Copyright (c) 2020, Sebastian Bergmann . -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 Sebastian Bergmann nor the names of his - 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/sebastian/lines-of-code/README.md b/vendor/sebastian/lines-of-code/README.md deleted file mode 100644 index 9457ef5a..00000000 --- a/vendor/sebastian/lines-of-code/README.md +++ /dev/null @@ -1,22 +0,0 @@ -# sebastian/lines-of-code - -Library for counting the lines of code in PHP source code. - -[![Latest Stable Version](https://img.shields.io/packagist/v/sebastian/lines-of-code.svg?style=flat-square)](https://packagist.org/packages/sebastian/lines-of-code) -[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.3-8892BF.svg?style=flat-square)](https://php.net/) -[![CI Status](https://github.com/sebastianbergmann/lines-of-code/workflows/CI/badge.svg?branch=master&event=push)](https://phpunit.de/build-status.html) -[![Type Coverage](https://shepherd.dev/github/sebastianbergmann/lines-of-code/coverage.svg)](https://shepherd.dev/github/sebastianbergmann/lines-of-code) - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - -``` -composer require sebastian/lines-of-code -``` - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - -``` -composer require --dev sebastian/lines-of-code -``` diff --git a/vendor/sebastian/lines-of-code/composer.json b/vendor/sebastian/lines-of-code/composer.json deleted file mode 100644 index 95bb9e36..00000000 --- a/vendor/sebastian/lines-of-code/composer.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "sebastian/lines-of-code", - "description": "Library for counting the lines of code in PHP source code", - "type": "library", - "homepage": "https://github.com/sebastianbergmann/lines-of-code", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "support": { - "issues": "https://github.com/sebastianbergmann/lines-of-code/issues" - }, - "prefer-stable": true, - "require": { - "php": ">=7.3", - "nikic/php-parser": "^4.6" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "config": { - "platform": { - "php": "7.3.0" - }, - "optimize-autoloader": true, - "sort-packages": true - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - } -} diff --git a/vendor/sebastian/lines-of-code/src/Counter.php b/vendor/sebastian/lines-of-code/src/Counter.php deleted file mode 100644 index cfe5e20a..00000000 --- a/vendor/sebastian/lines-of-code/src/Counter.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 SebastianBergmann\LinesOfCode; - -use function substr_count; -use PhpParser\Error; -use PhpParser\Lexer; -use PhpParser\Node; -use PhpParser\NodeTraverser; -use PhpParser\Parser; -use PhpParser\ParserFactory; - -final class Counter -{ - /** - * @throws RuntimeException - */ - public function countInSourceFile(string $sourceFile): LinesOfCode - { - return $this->countInSourceString(file_get_contents($sourceFile)); - } - - /** - * @throws RuntimeException - */ - public function countInSourceString(string $source): LinesOfCode - { - $linesOfCode = substr_count($source, "\n"); - - if ($linesOfCode === 0 && !empty($source)) { - $linesOfCode = 1; - } - - try { - $nodes = $this->parser()->parse($source); - - assert($nodes !== null); - - return $this->countInAbstractSyntaxTree($linesOfCode, $nodes); - - // @codeCoverageIgnoreStart - } catch (Error $error) { - throw new RuntimeException( - $error->getMessage(), - (int) $error->getCode(), - $error - ); - } - // @codeCoverageIgnoreEnd - } - - /** - * @param Node[] $nodes - * - * @throws RuntimeException - */ - public function countInAbstractSyntaxTree(int $linesOfCode, array $nodes): LinesOfCode - { - $traverser = new NodeTraverser; - $visitor = new LineCountingVisitor($linesOfCode); - - $traverser->addVisitor($visitor); - - try { - /* @noinspection UnusedFunctionResultInspection */ - $traverser->traverse($nodes); - // @codeCoverageIgnoreStart - } catch (Error $error) { - throw new RuntimeException( - $error->getMessage(), - (int) $error->getCode(), - $error - ); - } - // @codeCoverageIgnoreEnd - - return $visitor->result(); - } - - private function parser(): Parser - { - return (new ParserFactory)->create(ParserFactory::PREFER_PHP7, new Lexer); - } -} diff --git a/vendor/sebastian/lines-of-code/src/Exception/Exception.php b/vendor/sebastian/lines-of-code/src/Exception/Exception.php deleted file mode 100644 index 11d543aa..00000000 --- a/vendor/sebastian/lines-of-code/src/Exception/Exception.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. - */ -namespace SebastianBergmann\LinesOfCode; - -use Throwable; - -interface Exception extends Throwable -{ -} diff --git a/vendor/sebastian/lines-of-code/src/Exception/IllogicalValuesException.php b/vendor/sebastian/lines-of-code/src/Exception/IllogicalValuesException.php deleted file mode 100644 index 46a5c1b1..00000000 --- a/vendor/sebastian/lines-of-code/src/Exception/IllogicalValuesException.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. - */ -namespace SebastianBergmann\LinesOfCode; - -use LogicException; - -final class IllogicalValuesException extends LogicException implements Exception -{ -} diff --git a/vendor/sebastian/lines-of-code/src/Exception/NegativeValueException.php b/vendor/sebastian/lines-of-code/src/Exception/NegativeValueException.php deleted file mode 100644 index 40d27e1f..00000000 --- a/vendor/sebastian/lines-of-code/src/Exception/NegativeValueException.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. - */ -namespace SebastianBergmann\LinesOfCode; - -use InvalidArgumentException; - -final class NegativeValueException extends InvalidArgumentException implements Exception -{ -} diff --git a/vendor/sebastian/lines-of-code/src/Exception/RuntimeException.php b/vendor/sebastian/lines-of-code/src/Exception/RuntimeException.php deleted file mode 100644 index 4e6d66d0..00000000 --- a/vendor/sebastian/lines-of-code/src/Exception/RuntimeException.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\LinesOfCode; - -final class RuntimeException extends \RuntimeException implements Exception -{ -} diff --git a/vendor/sebastian/lines-of-code/src/LineCountingVisitor.php b/vendor/sebastian/lines-of-code/src/LineCountingVisitor.php deleted file mode 100644 index ff433b2f..00000000 --- a/vendor/sebastian/lines-of-code/src/LineCountingVisitor.php +++ /dev/null @@ -1,82 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\LinesOfCode; - -use function array_merge; -use function array_unique; -use function count; -use PhpParser\Comment; -use PhpParser\Node; -use PhpParser\Node\Expr; -use PhpParser\NodeVisitorAbstract; - -final class LineCountingVisitor extends NodeVisitorAbstract -{ - /** - * @var int - */ - private $linesOfCode; - - /** - * @var Comment[] - */ - private $comments = []; - - /** - * @var int[] - */ - private $linesWithStatements = []; - - public function __construct(int $linesOfCode) - { - $this->linesOfCode = $linesOfCode; - } - - public function enterNode(Node $node): void - { - $this->comments = array_merge($this->comments, $node->getComments()); - - if (!$node instanceof Expr) { - return; - } - - $this->linesWithStatements[] = $node->getStartLine(); - } - - public function result(): LinesOfCode - { - $commentLinesOfCode = 0; - - foreach ($this->comments() as $comment) { - $commentLinesOfCode += ($comment->getEndLine() - $comment->getStartLine() + 1); - } - - return new LinesOfCode( - $this->linesOfCode, - $commentLinesOfCode, - $this->linesOfCode - $commentLinesOfCode, - count(array_unique($this->linesWithStatements)) - ); - } - - /** - * @return Comment[] - */ - private function comments(): array - { - $comments = []; - - foreach ($this->comments as $comment) { - $comments[$comment->getStartLine() . '_' . $comment->getStartTokenPos() . '_' . $comment->getEndLine() . '_' . $comment->getEndTokenPos()] = $comment; - } - - return $comments; - } -} diff --git a/vendor/sebastian/lines-of-code/src/LinesOfCode.php b/vendor/sebastian/lines-of-code/src/LinesOfCode.php deleted file mode 100644 index 41829981..00000000 --- a/vendor/sebastian/lines-of-code/src/LinesOfCode.php +++ /dev/null @@ -1,98 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\LinesOfCode; - -/** - * @psalm-immutable - */ -final class LinesOfCode -{ - /** - * @var int - */ - private $linesOfCode; - - /** - * @var int - */ - private $commentLinesOfCode; - - /** - * @var int - */ - private $nonCommentLinesOfCode; - - /** - * @var int - */ - private $logicalLinesOfCode; - - /** - * @throws IllogicalValuesException - * @throws NegativeValueException - */ - public function __construct(int $linesOfCode, int $commentLinesOfCode, int $nonCommentLinesOfCode, int $logicalLinesOfCode) - { - if ($linesOfCode < 0) { - throw new NegativeValueException('$linesOfCode must not be negative'); - } - - if ($commentLinesOfCode < 0) { - throw new NegativeValueException('$commentLinesOfCode must not be negative'); - } - - if ($nonCommentLinesOfCode < 0) { - throw new NegativeValueException('$nonCommentLinesOfCode must not be negative'); - } - - if ($logicalLinesOfCode < 0) { - throw new NegativeValueException('$logicalLinesOfCode must not be negative'); - } - - if ($linesOfCode - $commentLinesOfCode !== $nonCommentLinesOfCode) { - throw new IllogicalValuesException('$linesOfCode !== $commentLinesOfCode + $nonCommentLinesOfCode'); - } - - $this->linesOfCode = $linesOfCode; - $this->commentLinesOfCode = $commentLinesOfCode; - $this->nonCommentLinesOfCode = $nonCommentLinesOfCode; - $this->logicalLinesOfCode = $logicalLinesOfCode; - } - - public function linesOfCode(): int - { - return $this->linesOfCode; - } - - public function commentLinesOfCode(): int - { - return $this->commentLinesOfCode; - } - - public function nonCommentLinesOfCode(): int - { - return $this->nonCommentLinesOfCode; - } - - public function logicalLinesOfCode(): int - { - return $this->logicalLinesOfCode; - } - - public function plus(self $other): self - { - return new self( - $this->linesOfCode() + $other->linesOfCode(), - $this->commentLinesOfCode() + $other->commentLinesOfCode(), - $this->nonCommentLinesOfCode() + $other->nonCommentLinesOfCode(), - $this->logicalLinesOfCode() + $other->logicalLinesOfCode(), - ); - } -} diff --git a/vendor/sebastian/object-enumerator/.psalm/baseline.xml b/vendor/sebastian/object-enumerator/.psalm/baseline.xml deleted file mode 100644 index 180b3f80..00000000 --- a/vendor/sebastian/object-enumerator/.psalm/baseline.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - !is_array($variable) && !is_object($variable) - is_object($variable) - - - diff --git a/vendor/sebastian/object-enumerator/.psalm/config.xml b/vendor/sebastian/object-enumerator/.psalm/config.xml deleted file mode 100644 index 2a4b16f2..00000000 --- a/vendor/sebastian/object-enumerator/.psalm/config.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - diff --git a/vendor/sebastian/object-enumerator/ChangeLog.md b/vendor/sebastian/object-enumerator/ChangeLog.md deleted file mode 100644 index 88655418..00000000 --- a/vendor/sebastian/object-enumerator/ChangeLog.md +++ /dev/null @@ -1,88 +0,0 @@ -# Change Log - -All notable changes to `sebastianbergmann/object-enumerator` are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. - -## [4.0.4] - 2020-10-26 - -### Fixed - -* `SebastianBergmann\ObjectEnumerator\Exception` now correctly extends `\Throwable` - -## [4.0.3] - 2020-09-28 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.3 || ^8.0` to `>=7.3` - -## [4.0.2] - 2020-06-26 - -### Added - -* This component is now supported on PHP 8 - -## [4.0.1] - 2020-06-15 - -### Changed - -* Tests etc. are now ignored for archive exports - -## [4.0.0] - 2020-02-07 - -### Removed - -* This component is no longer supported on PHP 7.0, PHP 7.1, and PHP 7.2 - -## [3.0.3] - 2017-08-03 - -### Changed - -* Bumped required version of `sebastian/object-reflector` - -## [3.0.2] - 2017-03-12 - -### Changed - -* `sebastian/object-reflector` is now a dependency - -## [3.0.1] - 2017-03-12 - -### Fixed - -* Objects aggregated in inherited attributes are not enumerated - -## [3.0.0] - 2017-03-03 - -### Removed - -* This component is no longer supported on PHP 5.6 - -## [2.0.1] - 2017-02-18 - -### Fixed - -* Fixed [#2](https://github.com/sebastianbergmann/phpunit/pull/2): Exceptions in `ReflectionProperty::getValue()` are not handled - -## [2.0.0] - 2016-11-19 - -### Changed - -* This component is now compatible with `sebastian/recursion-context: ~1.0.4` - -## 1.0.0 - 2016-02-04 - -### Added - -* Initial release - -[4.0.4]: https://github.com/sebastianbergmann/object-enumerator/compare/4.0.3...4.0.4 -[4.0.3]: https://github.com/sebastianbergmann/object-enumerator/compare/4.0.2...4.0.3 -[4.0.2]: https://github.com/sebastianbergmann/object-enumerator/compare/4.0.1...4.0.2 -[4.0.1]: https://github.com/sebastianbergmann/object-enumerator/compare/4.0.0...4.0.1 -[4.0.0]: https://github.com/sebastianbergmann/object-enumerator/compare/3.0.3...4.0.0 -[3.0.3]: https://github.com/sebastianbergmann/object-enumerator/compare/3.0.2...3.0.3 -[3.0.2]: https://github.com/sebastianbergmann/object-enumerator/compare/3.0.1...3.0.2 -[3.0.1]: https://github.com/sebastianbergmann/object-enumerator/compare/3.0.0...3.0.1 -[3.0.0]: https://github.com/sebastianbergmann/object-enumerator/compare/2.0...3.0.0 -[2.0.1]: https://github.com/sebastianbergmann/object-enumerator/compare/2.0.0...2.0.1 -[2.0.0]: https://github.com/sebastianbergmann/object-enumerator/compare/1.0...2.0.0 - diff --git a/vendor/sebastian/object-enumerator/LICENSE b/vendor/sebastian/object-enumerator/LICENSE deleted file mode 100644 index 1389ad39..00000000 --- a/vendor/sebastian/object-enumerator/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -Object Enumerator - -Copyright (c) 2016-2020, Sebastian Bergmann . -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 Sebastian Bergmann nor the names of his - 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/sebastian/object-enumerator/README.md b/vendor/sebastian/object-enumerator/README.md deleted file mode 100644 index afca0177..00000000 --- a/vendor/sebastian/object-enumerator/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# sebastian/object-enumerator - -[![CI Status](https://github.com/sebastianbergmann/object-enumerator/workflows/CI/badge.svg)](https://github.com/sebastianbergmann/object-enumerator/actions) -[![Type Coverage](https://shepherd.dev/github/sebastianbergmann/object-enumerator/coverage.svg)](https://shepherd.dev/github/sebastianbergmann/object-enumerator) - -Traverses array structures and object graphs to enumerate all referenced objects. - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - -``` -composer require sebastian/object-enumerator -``` - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - -``` -composer require --dev sebastian/object-enumerator -``` diff --git a/vendor/sebastian/object-enumerator/composer.json b/vendor/sebastian/object-enumerator/composer.json deleted file mode 100644 index d68a2133..00000000 --- a/vendor/sebastian/object-enumerator/composer.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "sebastian/object-enumerator", - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "prefer-stable": true, - "config": { - "platform": { - "php": "7.3.0" - }, - "optimize-autoloader": true, - "sort-packages": true - }, - "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "autoload-dev": { - "classmap": [ - "tests/_fixture/" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - } -} diff --git a/vendor/sebastian/object-enumerator/phpunit.xml b/vendor/sebastian/object-enumerator/phpunit.xml deleted file mode 100644 index 7be976b1..00000000 --- a/vendor/sebastian/object-enumerator/phpunit.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - tests - - - - - - src - - - diff --git a/vendor/sebastian/object-enumerator/src/Enumerator.php b/vendor/sebastian/object-enumerator/src/Enumerator.php deleted file mode 100644 index de75d17c..00000000 --- a/vendor/sebastian/object-enumerator/src/Enumerator.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 SebastianBergmann\ObjectEnumerator; - -use function array_merge; -use function func_get_args; -use function is_array; -use function is_object; -use SebastianBergmann\ObjectReflector\ObjectReflector; -use SebastianBergmann\RecursionContext\Context; - -/** - * Traverses array structures and object graphs - * to enumerate all referenced objects. - */ -class Enumerator -{ - /** - * Returns an array of all objects referenced either - * directly or indirectly by a variable. - * - * @param array|object $variable - * - * @return object[] - */ - public function enumerate($variable) - { - if (!is_array($variable) && !is_object($variable)) { - throw new InvalidArgumentException; - } - - if (isset(func_get_args()[1])) { - if (!func_get_args()[1] instanceof Context) { - throw new InvalidArgumentException; - } - - $processed = func_get_args()[1]; - } else { - $processed = new Context; - } - - $objects = []; - - if ($processed->contains($variable)) { - return $objects; - } - - $array = $variable; - $processed->add($variable); - - if (is_array($variable)) { - foreach ($array as $element) { - if (!is_array($element) && !is_object($element)) { - continue; - } - - $objects = array_merge( - $objects, - $this->enumerate($element, $processed) - ); - } - } else { - $objects[] = $variable; - - $reflector = new ObjectReflector; - - foreach ($reflector->getAttributes($variable) as $value) { - if (!is_array($value) && !is_object($value)) { - continue; - } - - $objects = array_merge( - $objects, - $this->enumerate($value, $processed) - ); - } - } - - return $objects; - } -} diff --git a/vendor/sebastian/object-enumerator/src/Exception.php b/vendor/sebastian/object-enumerator/src/Exception.php deleted file mode 100644 index 2f09d70a..00000000 --- a/vendor/sebastian/object-enumerator/src/Exception.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. - */ -namespace SebastianBergmann\ObjectEnumerator; - -use Throwable; - -interface Exception extends Throwable -{ -} diff --git a/vendor/sebastian/object-enumerator/src/InvalidArgumentException.php b/vendor/sebastian/object-enumerator/src/InvalidArgumentException.php deleted file mode 100644 index ce2037cd..00000000 --- a/vendor/sebastian/object-enumerator/src/InvalidArgumentException.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\ObjectEnumerator; - -class InvalidArgumentException extends \InvalidArgumentException implements Exception -{ -} diff --git a/vendor/sebastian/object-reflector/.psalm/baseline.xml b/vendor/sebastian/object-reflector/.psalm/baseline.xml deleted file mode 100644 index 965c1275..00000000 --- a/vendor/sebastian/object-reflector/.psalm/baseline.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - is_object($object) - - - diff --git a/vendor/sebastian/object-reflector/.psalm/config.xml b/vendor/sebastian/object-reflector/.psalm/config.xml deleted file mode 100644 index 2a4b16f2..00000000 --- a/vendor/sebastian/object-reflector/.psalm/config.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - diff --git a/vendor/sebastian/object-reflector/ChangeLog.md b/vendor/sebastian/object-reflector/ChangeLog.md deleted file mode 100644 index 7fa62e90..00000000 --- a/vendor/sebastian/object-reflector/ChangeLog.md +++ /dev/null @@ -1,55 +0,0 @@ -# Change Log - -All notable changes to `sebastianbergmann/object-reflector` are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. - -## [2.0.4] - 2020-10-26 - -### Fixed - -* `SebastianBergmann\ObjectReflector\Exception` now correctly extends `\Throwable` - -## [2.0.3] - 2020-09-28 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.3 || ^8.0` to `>=7.3` - -## [2.0.2] - 2020-06-26 - -### Added - -* This component is now supported on PHP 8 - -## [2.0.1] - 2020-06-15 - -### Changed - -* Tests etc. are now ignored for archive exports - -## [2.0.0] - 2020-02-07 - -### Removed - -* This component is no longer supported on PHP 7.0, PHP 7.1, and PHP 7.2 - -## [1.1.1] - 2017-03-29 - -* Fixed [#1](https://github.com/sebastianbergmann/object-reflector/issues/1): Attributes with non-string names are not handled correctly - -## [1.1.0] - 2017-03-16 - -### Changed - -* Changed implementation of `ObjectReflector::getattributes()` to use `(array)` cast instead of `ReflectionObject` - -## 1.0.0 - 2017-03-12 - -* Initial release - -[2.0.4]: https://github.com/sebastianbergmann/object-reflector/compare/2.0.3...2.0.4 -[2.0.3]: https://github.com/sebastianbergmann/object-reflector/compare/2.0.2...2.0.3 -[2.0.2]: https://github.com/sebastianbergmann/object-reflector/compare/2.0.1...2.0.2 -[2.0.1]: https://github.com/sebastianbergmann/object-reflector/compare/2.0.0...2.0.1 -[2.0.0]: https://github.com/sebastianbergmann/object-reflector/compare/1.1.1...2.0.0 -[1.1.1]: https://github.com/sebastianbergmann/object-reflector/compare/1.1.0...1.1.1 -[1.1.0]: https://github.com/sebastianbergmann/object-reflector/compare/1.0.0...1.1.0 diff --git a/vendor/sebastian/object-reflector/LICENSE b/vendor/sebastian/object-reflector/LICENSE deleted file mode 100644 index a80c1619..00000000 --- a/vendor/sebastian/object-reflector/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -Object Reflector - -Copyright (c) 2017-2020, Sebastian Bergmann . -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 Sebastian Bergmann nor the names of his - 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/sebastian/object-reflector/README.md b/vendor/sebastian/object-reflector/README.md deleted file mode 100644 index b7d5ae95..00000000 --- a/vendor/sebastian/object-reflector/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# sebastian/object-reflector - -[![CI Status](https://github.com/sebastianbergmann/object-reflector/workflows/CI/badge.svg)](https://github.com/sebastianbergmann/object-reflector/actions) -[![Type Coverage](https://shepherd.dev/github/sebastianbergmann/object-reflector/coverage.svg)](https://shepherd.dev/github/sebastianbergmann/object-reflector) - -Allows reflection of object attributes, including inherited and non-public ones. - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - -``` -composer require sebastian/object-reflector -``` - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - -``` -composer require --dev sebastian/object-reflector -``` diff --git a/vendor/sebastian/object-reflector/composer.json b/vendor/sebastian/object-reflector/composer.json deleted file mode 100644 index 36a33788..00000000 --- a/vendor/sebastian/object-reflector/composer.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "sebastian/object-reflector", - "description": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "prefer-stable": true, - "config": { - "platform": { - "php": "7.3.0" - }, - "optimize-autoloader": true, - "sort-packages": true - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "autoload-dev": { - "classmap": [ - "tests/_fixture/" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - } -} diff --git a/vendor/sebastian/object-reflector/src/Exception.php b/vendor/sebastian/object-reflector/src/Exception.php deleted file mode 100644 index 36f8efec..00000000 --- a/vendor/sebastian/object-reflector/src/Exception.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. - */ -namespace SebastianBergmann\ObjectReflector; - -use Throwable; - -interface Exception extends Throwable -{ -} diff --git a/vendor/sebastian/object-reflector/src/InvalidArgumentException.php b/vendor/sebastian/object-reflector/src/InvalidArgumentException.php deleted file mode 100644 index 34b4cca1..00000000 --- a/vendor/sebastian/object-reflector/src/InvalidArgumentException.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\ObjectReflector; - -class InvalidArgumentException extends \InvalidArgumentException implements Exception -{ -} diff --git a/vendor/sebastian/object-reflector/src/ObjectReflector.php b/vendor/sebastian/object-reflector/src/ObjectReflector.php deleted file mode 100644 index 4abb5f55..00000000 --- a/vendor/sebastian/object-reflector/src/ObjectReflector.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 SebastianBergmann\ObjectReflector; - -use function count; -use function explode; -use function get_class; -use function is_object; - -class ObjectReflector -{ - /** - * @param object $object - * - * @throws InvalidArgumentException - */ - public function getAttributes($object): array - { - if (!is_object($object)) { - throw new InvalidArgumentException; - } - - $attributes = []; - $className = get_class($object); - - foreach ((array) $object as $name => $value) { - $name = explode("\0", (string) $name); - - if (count($name) === 1) { - $name = $name[0]; - } else { - if ($name[1] !== $className) { - $name = $name[1] . '::' . $name[2]; - } else { - $name = $name[2]; - } - } - - $attributes[$name] = $value; - } - - return $attributes; - } -} diff --git a/vendor/sebastian/recursion-context/.psalm/baseline.xml b/vendor/sebastian/recursion-context/.psalm/baseline.xml deleted file mode 100644 index b946db1a..00000000 --- a/vendor/sebastian/recursion-context/.psalm/baseline.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - is_array($array) - - - diff --git a/vendor/sebastian/recursion-context/.psalm/config.xml b/vendor/sebastian/recursion-context/.psalm/config.xml deleted file mode 100644 index 2a4b16f2..00000000 --- a/vendor/sebastian/recursion-context/.psalm/config.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - diff --git a/vendor/sebastian/recursion-context/ChangeLog.md b/vendor/sebastian/recursion-context/ChangeLog.md deleted file mode 100644 index 2fbacc2c..00000000 --- a/vendor/sebastian/recursion-context/ChangeLog.md +++ /dev/null @@ -1,33 +0,0 @@ -# ChangeLog - -All notable changes are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. - -## [4.0.4] - 2020-10-26 - -### Fixed - -* `SebastianBergmann\RecursionContext\Exception` now correctly extends `\Throwable` - -## [4.0.3] - 2020-09-28 - -### Changed - -* [#21](https://github.com/sebastianbergmann/recursion-context/pull/21): Add type annotations for in/out parameters -* Changed PHP version constraint in `composer.json` from `^7.3 || ^8.0` to `>=7.3` - -## [4.0.2] - 2020-06-26 - -### Added - -* This component is now supported on PHP 8 - -## [4.0.1] - 2020-06-15 - -### Changed - -* Tests etc. are now ignored for archive exports - -[4.0.4]: https://github.com/sebastianbergmann/recursion-context/compare/4.0.3...4.0.4 -[4.0.3]: https://github.com/sebastianbergmann/recursion-context/compare/4.0.2...4.0.3 -[4.0.2]: https://github.com/sebastianbergmann/recursion-context/compare/4.0.1...4.0.2 -[4.0.1]: https://github.com/sebastianbergmann/recursion-context/compare/4.0.0...4.0.1 diff --git a/vendor/sebastian/recursion-context/LICENSE b/vendor/sebastian/recursion-context/LICENSE deleted file mode 100644 index 0faffbbb..00000000 --- a/vendor/sebastian/recursion-context/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -Recursion Context - -Copyright (c) 2002-2020, Sebastian Bergmann . -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 Sebastian Bergmann nor the names of his - 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/sebastian/recursion-context/README.md b/vendor/sebastian/recursion-context/README.md deleted file mode 100644 index 8e4d2a08..00000000 --- a/vendor/sebastian/recursion-context/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# sebastian/recursion-context - -[![CI Status](https://github.com/sebastianbergmann/recursion-context/workflows/CI/badge.svg)](https://github.com/sebastianbergmann/recursion-context/actions) -[![Type Coverage](https://shepherd.dev/github/sebastianbergmann/recursion-context/coverage.svg)](https://shepherd.dev/github/sebastianbergmann/recursion-context) - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - -``` -composer require sebastian/recursion-context -``` - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - -``` -composer require --dev sebastian/recursion-context -``` diff --git a/vendor/sebastian/recursion-context/composer.json b/vendor/sebastian/recursion-context/composer.json deleted file mode 100644 index 8a540823..00000000 --- a/vendor/sebastian/recursion-context/composer.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "sebastian/recursion-context", - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "prefer-stable": true, - "config": { - "platform": { - "php": "7.3.0" - }, - "optimize-autoloader": true, - "sort-packages": true - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - } -} diff --git a/vendor/sebastian/recursion-context/src/Context.php b/vendor/sebastian/recursion-context/src/Context.php deleted file mode 100644 index 87fe7b04..00000000 --- a/vendor/sebastian/recursion-context/src/Context.php +++ /dev/null @@ -1,186 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\RecursionContext; - -use const PHP_INT_MAX; -use const PHP_INT_MIN; -use function array_pop; -use function array_slice; -use function count; -use function is_array; -use function is_object; -use function random_int; -use function spl_object_hash; -use SplObjectStorage; - -/** - * A context containing previously processed arrays and objects - * when recursively processing a value. - */ -final class Context -{ - /** - * @var array[] - */ - private $arrays; - - /** - * @var SplObjectStorage - */ - private $objects; - - /** - * Initialises the context. - */ - public function __construct() - { - $this->arrays = []; - $this->objects = new SplObjectStorage; - } - - /** - * @codeCoverageIgnore - */ - public function __destruct() - { - foreach ($this->arrays as &$array) { - if (is_array($array)) { - array_pop($array); - array_pop($array); - } - } - } - - /** - * Adds a value to the context. - * - * @param array|object $value the value to add - * - * @throws InvalidArgumentException Thrown if $value is not an array or object - * - * @return bool|int|string the ID of the stored value, either as a string or integer - * - * @psalm-template T - * @psalm-param T $value - * @param-out T $value - */ - public function add(&$value) - { - if (is_array($value)) { - return $this->addArray($value); - } - - if (is_object($value)) { - return $this->addObject($value); - } - - throw new InvalidArgumentException( - 'Only arrays and objects are supported' - ); - } - - /** - * Checks if the given value exists within the context. - * - * @param array|object $value the value to check - * - * @throws InvalidArgumentException Thrown if $value is not an array or object - * - * @return false|int|string the string or integer ID of the stored value if it has already been seen, or false if the value is not stored - * - * @psalm-template T - * @psalm-param T $value - * @param-out T $value - */ - public function contains(&$value) - { - if (is_array($value)) { - return $this->containsArray($value); - } - - if (is_object($value)) { - return $this->containsObject($value); - } - - throw new InvalidArgumentException( - 'Only arrays and objects are supported' - ); - } - - /** - * @return bool|int - */ - private function addArray(array &$array) - { - $key = $this->containsArray($array); - - if ($key !== false) { - return $key; - } - - $key = count($this->arrays); - $this->arrays[] = &$array; - - if (!isset($array[PHP_INT_MAX]) && !isset($array[PHP_INT_MAX - 1])) { - $array[] = $key; - $array[] = $this->objects; - } else { /* cover the improbable case too */ - do { - $key = random_int(PHP_INT_MIN, PHP_INT_MAX); - } while (isset($array[$key])); - - $array[$key] = $key; - - do { - $key = random_int(PHP_INT_MIN, PHP_INT_MAX); - } while (isset($array[$key])); - - $array[$key] = $this->objects; - } - - return $key; - } - - /** - * @param object $object - */ - private function addObject($object): string - { - if (!$this->objects->contains($object)) { - $this->objects->attach($object); - } - - return spl_object_hash($object); - } - - /** - * @return false|int - */ - private function containsArray(array &$array) - { - $end = array_slice($array, -2); - - return isset($end[1]) && $end[1] === $this->objects ? $end[0] : false; - } - - /** - * @param object $value - * - * @return false|string - */ - private function containsObject($value) - { - if ($this->objects->contains($value)) { - return spl_object_hash($value); - } - - return false; - } -} diff --git a/vendor/sebastian/recursion-context/src/Exception.php b/vendor/sebastian/recursion-context/src/Exception.php deleted file mode 100644 index e3a9c017..00000000 --- a/vendor/sebastian/recursion-context/src/Exception.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. - */ -namespace SebastianBergmann\RecursionContext; - -use Throwable; - -interface Exception extends Throwable -{ -} diff --git a/vendor/sebastian/recursion-context/src/InvalidArgumentException.php b/vendor/sebastian/recursion-context/src/InvalidArgumentException.php deleted file mode 100644 index 627c8bdf..00000000 --- a/vendor/sebastian/recursion-context/src/InvalidArgumentException.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\RecursionContext; - -final class InvalidArgumentException extends \InvalidArgumentException implements Exception -{ -} diff --git a/vendor/sebastian/resource-operations/.gitattributes b/vendor/sebastian/resource-operations/.gitattributes deleted file mode 100644 index 85e55ebc..00000000 --- a/vendor/sebastian/resource-operations/.gitattributes +++ /dev/null @@ -1,7 +0,0 @@ -/.github export-ignore -/.php_cs.dist export-ignore -/build.xml export-ignore -/phpunit.xml export-ignore -/tests export-ignore - -*.php diff=php diff --git a/vendor/sebastian/resource-operations/.gitignore b/vendor/sebastian/resource-operations/.gitignore deleted file mode 100644 index a086c781..00000000 --- a/vendor/sebastian/resource-operations/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/.idea -/.php_cs.cache -/build/FunctionSignatureMap.php -/composer.lock -/vendor -/.phpunit.result.cache diff --git a/vendor/sebastian/resource-operations/ChangeLog.md b/vendor/sebastian/resource-operations/ChangeLog.md deleted file mode 100644 index e6dc7392..00000000 --- a/vendor/sebastian/resource-operations/ChangeLog.md +++ /dev/null @@ -1,54 +0,0 @@ -# ChangeLog - -All notable changes are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. - -## [3.0.3] - 2020-09-28 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.3 || ^8.0` to `>=7.3` - -## [3.0.2] - 2020-06-26 - -### Added - -* This component is now supported on PHP 8 - -## [3.0.1] - 2020-06-15 - -### Changed - -* Tests etc. are now ignored for archive exports - -## [3.0.0] - 2020-02-07 - -### Removed - -* This component is no longer supported on PHP 7.1 and PHP 7.2 - -## [2.0.1] - 2018-10-04 - -### Fixed - -* Functions and methods with nullable parameters of type `resource` are now also considered - -## [2.0.0] - 2018-09-27 - -### Changed - -* [FunctionSignatureMap.php](https://raw.githubusercontent.com/phan/phan/master/src/Phan/Language/Internal/FunctionSignatureMap.php) from `phan/phan` is now used instead of [arginfo.php](https://raw.githubusercontent.com/rlerdorf/phan/master/includes/arginfo.php) from `rlerdorf/phan` - -### Removed - -* This component is no longer supported on PHP 5.6 and PHP 7.0 - -## 1.0.0 - 2015-07-28 - -* Initial release - -[3.0.3]: https://github.com/sebastianbergmann/comparator/resource-operations/3.0.2...3.0.3 -[3.0.2]: https://github.com/sebastianbergmann/comparator/resource-operations/3.0.1...3.0.2 -[3.0.1]: https://github.com/sebastianbergmann/comparator/resource-operations/3.0.0...3.0.1 -[3.0.0]: https://github.com/sebastianbergmann/comparator/resource-operations/2.0.1...3.0.0 -[2.0.1]: https://github.com/sebastianbergmann/comparator/resource-operations/2.0.0...2.0.1 -[2.0.0]: https://github.com/sebastianbergmann/comparator/resource-operations/1.0.0...2.0.0 diff --git a/vendor/sebastian/resource-operations/LICENSE b/vendor/sebastian/resource-operations/LICENSE deleted file mode 100644 index dccd6b07..00000000 --- a/vendor/sebastian/resource-operations/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -Resource Operations - -Copyright (c) 2015-2020, Sebastian Bergmann . -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 Sebastian Bergmann nor the names of his - 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/sebastian/resource-operations/README.md b/vendor/sebastian/resource-operations/README.md deleted file mode 100644 index 88b05ccb..00000000 --- a/vendor/sebastian/resource-operations/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# Resource Operations - -Provides a list of PHP built-in functions that operate on resources. - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - - composer require sebastian/resource-operations - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - - composer require --dev sebastian/resource-operations - diff --git a/vendor/sebastian/resource-operations/build/generate.php b/vendor/sebastian/resource-operations/build/generate.php deleted file mode 100755 index 0354dc45..00000000 --- a/vendor/sebastian/resource-operations/build/generate.php +++ /dev/null @@ -1,65 +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. - */ - -$functions = require __DIR__ . '/FunctionSignatureMap.php'; -$resourceFunctions = []; - -foreach ($functions as $function => $arguments) { - foreach ($arguments as $argument) { - if (strpos($argument, '?') === 0) { - $argument = substr($argument, 1); - } - - if ($argument === 'resource') { - $resourceFunctions[] = explode('\'', $function)[0]; - } - } -} - -$resourceFunctions = array_unique($resourceFunctions); -sort($resourceFunctions); - -$buffer = << - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\ResourceOperations; - -final class ResourceOperations -{ - /** - * @return string[] - */ - public static function getFunctions(): array - { - return [ - -EOT; - -foreach ($resourceFunctions as $function) { - $buffer .= sprintf(" '%s',\n", $function); -} - -$buffer .= <<< EOT - ]; - } -} - -EOT; - -file_put_contents(__DIR__ . '/../src/ResourceOperations.php', $buffer); - diff --git a/vendor/sebastian/resource-operations/composer.json b/vendor/sebastian/resource-operations/composer.json deleted file mode 100644 index 870be3c1..00000000 --- a/vendor/sebastian/resource-operations/composer.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "sebastian/resource-operations", - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "prefer-stable": true, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.0" - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "config": { - "platform": { - "php": "7.3.0" - }, - "optimize-autoloader": true, - "sort-packages": true - }, - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - } -} - diff --git a/vendor/sebastian/resource-operations/src/ResourceOperations.php b/vendor/sebastian/resource-operations/src/ResourceOperations.php deleted file mode 100644 index f3911f36..00000000 --- a/vendor/sebastian/resource-operations/src/ResourceOperations.php +++ /dev/null @@ -1,2232 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\ResourceOperations; - -final class ResourceOperations -{ - /** - * @return string[] - */ - public static function getFunctions(): array - { - return [ - 'Directory::close', - 'Directory::read', - 'Directory::rewind', - 'DirectoryIterator::openFile', - 'FilesystemIterator::openFile', - 'Gmagick::readimagefile', - 'HttpResponse::getRequestBodyStream', - 'HttpResponse::getStream', - 'HttpResponse::setStream', - 'Imagick::pingImageFile', - 'Imagick::readImageFile', - 'Imagick::writeImageFile', - 'Imagick::writeImagesFile', - 'MongoGridFSCursor::__construct', - 'MongoGridFSFile::getResource', - 'MysqlndUhConnection::stmtInit', - 'MysqlndUhConnection::storeResult', - 'MysqlndUhConnection::useResult', - 'PDF_activate_item', - 'PDF_add_launchlink', - 'PDF_add_locallink', - 'PDF_add_nameddest', - 'PDF_add_note', - 'PDF_add_pdflink', - 'PDF_add_table_cell', - 'PDF_add_textflow', - 'PDF_add_thumbnail', - 'PDF_add_weblink', - 'PDF_arc', - 'PDF_arcn', - 'PDF_attach_file', - 'PDF_begin_document', - 'PDF_begin_font', - 'PDF_begin_glyph', - 'PDF_begin_item', - 'PDF_begin_layer', - 'PDF_begin_page', - 'PDF_begin_page_ext', - 'PDF_begin_pattern', - 'PDF_begin_template', - 'PDF_begin_template_ext', - 'PDF_circle', - 'PDF_clip', - 'PDF_close', - 'PDF_close_image', - 'PDF_close_pdi', - 'PDF_close_pdi_page', - 'PDF_closepath', - 'PDF_closepath_fill_stroke', - 'PDF_closepath_stroke', - 'PDF_concat', - 'PDF_continue_text', - 'PDF_create_3dview', - 'PDF_create_action', - 'PDF_create_annotation', - 'PDF_create_bookmark', - 'PDF_create_field', - 'PDF_create_fieldgroup', - 'PDF_create_gstate', - 'PDF_create_pvf', - 'PDF_create_textflow', - 'PDF_curveto', - 'PDF_define_layer', - 'PDF_delete', - 'PDF_delete_pvf', - 'PDF_delete_table', - 'PDF_delete_textflow', - 'PDF_encoding_set_char', - 'PDF_end_document', - 'PDF_end_font', - 'PDF_end_glyph', - 'PDF_end_item', - 'PDF_end_layer', - 'PDF_end_page', - 'PDF_end_page_ext', - 'PDF_end_pattern', - 'PDF_end_template', - 'PDF_endpath', - 'PDF_fill', - 'PDF_fill_imageblock', - 'PDF_fill_pdfblock', - 'PDF_fill_stroke', - 'PDF_fill_textblock', - 'PDF_findfont', - 'PDF_fit_image', - 'PDF_fit_pdi_page', - 'PDF_fit_table', - 'PDF_fit_textflow', - 'PDF_fit_textline', - 'PDF_get_apiname', - 'PDF_get_buffer', - 'PDF_get_errmsg', - 'PDF_get_errnum', - 'PDF_get_parameter', - 'PDF_get_pdi_parameter', - 'PDF_get_pdi_value', - 'PDF_get_value', - 'PDF_info_font', - 'PDF_info_matchbox', - 'PDF_info_table', - 'PDF_info_textflow', - 'PDF_info_textline', - 'PDF_initgraphics', - 'PDF_lineto', - 'PDF_load_3ddata', - 'PDF_load_font', - 'PDF_load_iccprofile', - 'PDF_load_image', - 'PDF_makespotcolor', - 'PDF_moveto', - 'PDF_new', - 'PDF_open_ccitt', - 'PDF_open_file', - 'PDF_open_image', - 'PDF_open_image_file', - 'PDF_open_memory_image', - 'PDF_open_pdi', - 'PDF_open_pdi_document', - 'PDF_open_pdi_page', - 'PDF_pcos_get_number', - 'PDF_pcos_get_stream', - 'PDF_pcos_get_string', - 'PDF_place_image', - 'PDF_place_pdi_page', - 'PDF_process_pdi', - 'PDF_rect', - 'PDF_restore', - 'PDF_resume_page', - 'PDF_rotate', - 'PDF_save', - 'PDF_scale', - 'PDF_set_border_color', - 'PDF_set_border_dash', - 'PDF_set_border_style', - 'PDF_set_gstate', - 'PDF_set_info', - 'PDF_set_layer_dependency', - 'PDF_set_parameter', - 'PDF_set_text_pos', - 'PDF_set_value', - 'PDF_setcolor', - 'PDF_setdash', - 'PDF_setdashpattern', - 'PDF_setflat', - 'PDF_setfont', - 'PDF_setgray', - 'PDF_setgray_fill', - 'PDF_setgray_stroke', - 'PDF_setlinecap', - 'PDF_setlinejoin', - 'PDF_setlinewidth', - 'PDF_setmatrix', - 'PDF_setmiterlimit', - 'PDF_setrgbcolor', - 'PDF_setrgbcolor_fill', - 'PDF_setrgbcolor_stroke', - 'PDF_shading', - 'PDF_shading_pattern', - 'PDF_shfill', - 'PDF_show', - 'PDF_show_boxed', - 'PDF_show_xy', - 'PDF_skew', - 'PDF_stringwidth', - 'PDF_stroke', - 'PDF_suspend_page', - 'PDF_translate', - 'PDF_utf16_to_utf8', - 'PDF_utf32_to_utf16', - 'PDF_utf8_to_utf16', - 'PDO::pgsqlLOBOpen', - 'RarEntry::getStream', - 'SQLite3::openBlob', - 'SWFMovie::saveToFile', - 'SplFileInfo::openFile', - 'SplFileObject::openFile', - 'SplTempFileObject::openFile', - 'V8Js::compileString', - 'V8Js::executeScript', - 'Vtiful\Kernel\Excel::setColumn', - 'Vtiful\Kernel\Excel::setRow', - 'Vtiful\Kernel\Format::align', - 'Vtiful\Kernel\Format::bold', - 'Vtiful\Kernel\Format::italic', - 'Vtiful\Kernel\Format::underline', - 'XMLWriter::openMemory', - 'XMLWriter::openURI', - 'ZipArchive::getStream', - 'Zookeeper::setLogStream', - 'apc_bin_dumpfile', - 'apc_bin_loadfile', - 'bbcode_add_element', - 'bbcode_add_smiley', - 'bbcode_create', - 'bbcode_destroy', - 'bbcode_parse', - 'bbcode_set_arg_parser', - 'bbcode_set_flags', - 'bcompiler_read', - 'bcompiler_write_class', - 'bcompiler_write_constant', - 'bcompiler_write_exe_footer', - 'bcompiler_write_file', - 'bcompiler_write_footer', - 'bcompiler_write_function', - 'bcompiler_write_functions_from_file', - 'bcompiler_write_header', - 'bcompiler_write_included_filename', - 'bzclose', - 'bzerrno', - 'bzerror', - 'bzerrstr', - 'bzflush', - 'bzopen', - 'bzread', - 'bzwrite', - 'cairo_surface_write_to_png', - 'closedir', - 'copy', - 'crack_closedict', - 'crack_opendict', - 'cubrid_bind', - 'cubrid_close_prepare', - 'cubrid_close_request', - 'cubrid_col_get', - 'cubrid_col_size', - 'cubrid_column_names', - 'cubrid_column_types', - 'cubrid_commit', - 'cubrid_connect', - 'cubrid_connect_with_url', - 'cubrid_current_oid', - 'cubrid_db_parameter', - 'cubrid_disconnect', - 'cubrid_drop', - 'cubrid_fetch', - 'cubrid_free_result', - 'cubrid_get', - 'cubrid_get_autocommit', - 'cubrid_get_charset', - 'cubrid_get_class_name', - 'cubrid_get_db_parameter', - 'cubrid_get_query_timeout', - 'cubrid_get_server_info', - 'cubrid_insert_id', - 'cubrid_is_instance', - 'cubrid_lob2_bind', - 'cubrid_lob2_close', - 'cubrid_lob2_export', - 'cubrid_lob2_import', - 'cubrid_lob2_new', - 'cubrid_lob2_read', - 'cubrid_lob2_seek', - 'cubrid_lob2_seek64', - 'cubrid_lob2_size', - 'cubrid_lob2_size64', - 'cubrid_lob2_tell', - 'cubrid_lob2_tell64', - 'cubrid_lob2_write', - 'cubrid_lob_export', - 'cubrid_lob_get', - 'cubrid_lob_send', - 'cubrid_lob_size', - 'cubrid_lock_read', - 'cubrid_lock_write', - 'cubrid_move_cursor', - 'cubrid_next_result', - 'cubrid_num_cols', - 'cubrid_num_rows', - 'cubrid_pconnect', - 'cubrid_pconnect_with_url', - 'cubrid_prepare', - 'cubrid_put', - 'cubrid_query', - 'cubrid_rollback', - 'cubrid_schema', - 'cubrid_seq_add', - 'cubrid_seq_drop', - 'cubrid_seq_insert', - 'cubrid_seq_put', - 'cubrid_set_add', - 'cubrid_set_autocommit', - 'cubrid_set_db_parameter', - 'cubrid_set_drop', - 'cubrid_set_query_timeout', - 'cubrid_unbuffered_query', - 'curl_close', - 'curl_copy_handle', - 'curl_errno', - 'curl_error', - 'curl_escape', - 'curl_exec', - 'curl_getinfo', - 'curl_multi_add_handle', - 'curl_multi_close', - 'curl_multi_errno', - 'curl_multi_exec', - 'curl_multi_getcontent', - 'curl_multi_info_read', - 'curl_multi_remove_handle', - 'curl_multi_select', - 'curl_multi_setopt', - 'curl_pause', - 'curl_reset', - 'curl_setopt', - 'curl_setopt_array', - 'curl_share_close', - 'curl_share_errno', - 'curl_share_init', - 'curl_share_setopt', - 'curl_unescape', - 'cyrus_authenticate', - 'cyrus_bind', - 'cyrus_close', - 'cyrus_connect', - 'cyrus_query', - 'cyrus_unbind', - 'db2_autocommit', - 'db2_bind_param', - 'db2_client_info', - 'db2_close', - 'db2_column_privileges', - 'db2_columns', - 'db2_commit', - 'db2_conn_error', - 'db2_conn_errormsg', - 'db2_connect', - 'db2_cursor_type', - 'db2_exec', - 'db2_execute', - 'db2_fetch_array', - 'db2_fetch_assoc', - 'db2_fetch_both', - 'db2_fetch_object', - 'db2_fetch_row', - 'db2_field_display_size', - 'db2_field_name', - 'db2_field_num', - 'db2_field_precision', - 'db2_field_scale', - 'db2_field_type', - 'db2_field_width', - 'db2_foreign_keys', - 'db2_free_result', - 'db2_free_stmt', - 'db2_get_option', - 'db2_last_insert_id', - 'db2_lob_read', - 'db2_next_result', - 'db2_num_fields', - 'db2_num_rows', - 'db2_pclose', - 'db2_pconnect', - 'db2_prepare', - 'db2_primary_keys', - 'db2_procedure_columns', - 'db2_procedures', - 'db2_result', - 'db2_rollback', - 'db2_server_info', - 'db2_set_option', - 'db2_special_columns', - 'db2_statistics', - 'db2_stmt_error', - 'db2_stmt_errormsg', - 'db2_table_privileges', - 'db2_tables', - 'dba_close', - 'dba_delete', - 'dba_exists', - 'dba_fetch', - 'dba_firstkey', - 'dba_insert', - 'dba_nextkey', - 'dba_open', - 'dba_optimize', - 'dba_popen', - 'dba_replace', - 'dba_sync', - 'dbplus_add', - 'dbplus_aql', - 'dbplus_close', - 'dbplus_curr', - 'dbplus_find', - 'dbplus_first', - 'dbplus_flush', - 'dbplus_freelock', - 'dbplus_freerlocks', - 'dbplus_getlock', - 'dbplus_getunique', - 'dbplus_info', - 'dbplus_last', - 'dbplus_lockrel', - 'dbplus_next', - 'dbplus_open', - 'dbplus_prev', - 'dbplus_rchperm', - 'dbplus_rcreate', - 'dbplus_rcrtexact', - 'dbplus_rcrtlike', - 'dbplus_restorepos', - 'dbplus_rkeys', - 'dbplus_ropen', - 'dbplus_rquery', - 'dbplus_rrename', - 'dbplus_rsecindex', - 'dbplus_runlink', - 'dbplus_rzap', - 'dbplus_savepos', - 'dbplus_setindex', - 'dbplus_setindexbynumber', - 'dbplus_sql', - 'dbplus_tremove', - 'dbplus_undo', - 'dbplus_undoprepare', - 'dbplus_unlockrel', - 'dbplus_unselect', - 'dbplus_update', - 'dbplus_xlockrel', - 'dbplus_xunlockrel', - 'deflate_add', - 'dio_close', - 'dio_fcntl', - 'dio_open', - 'dio_read', - 'dio_seek', - 'dio_stat', - 'dio_tcsetattr', - 'dio_truncate', - 'dio_write', - 'dir', - 'eio_busy', - 'eio_cancel', - 'eio_chmod', - 'eio_chown', - 'eio_close', - 'eio_custom', - 'eio_dup2', - 'eio_fallocate', - 'eio_fchmod', - 'eio_fchown', - 'eio_fdatasync', - 'eio_fstat', - 'eio_fstatvfs', - 'eio_fsync', - 'eio_ftruncate', - 'eio_futime', - 'eio_get_last_error', - 'eio_grp', - 'eio_grp_add', - 'eio_grp_cancel', - 'eio_grp_limit', - 'eio_link', - 'eio_lstat', - 'eio_mkdir', - 'eio_mknod', - 'eio_nop', - 'eio_open', - 'eio_read', - 'eio_readahead', - 'eio_readdir', - 'eio_readlink', - 'eio_realpath', - 'eio_rename', - 'eio_rmdir', - 'eio_seek', - 'eio_sendfile', - 'eio_stat', - 'eio_statvfs', - 'eio_symlink', - 'eio_sync', - 'eio_sync_file_range', - 'eio_syncfs', - 'eio_truncate', - 'eio_unlink', - 'eio_utime', - 'eio_write', - 'enchant_broker_describe', - 'enchant_broker_dict_exists', - 'enchant_broker_free', - 'enchant_broker_free_dict', - 'enchant_broker_get_dict_path', - 'enchant_broker_get_error', - 'enchant_broker_init', - 'enchant_broker_list_dicts', - 'enchant_broker_request_dict', - 'enchant_broker_request_pwl_dict', - 'enchant_broker_set_dict_path', - 'enchant_broker_set_ordering', - 'enchant_dict_add_to_personal', - 'enchant_dict_add_to_session', - 'enchant_dict_check', - 'enchant_dict_describe', - 'enchant_dict_get_error', - 'enchant_dict_is_in_session', - 'enchant_dict_quick_check', - 'enchant_dict_store_replacement', - 'enchant_dict_suggest', - 'event_add', - 'event_base_free', - 'event_base_loop', - 'event_base_loopbreak', - 'event_base_loopexit', - 'event_base_new', - 'event_base_priority_init', - 'event_base_reinit', - 'event_base_set', - 'event_buffer_base_set', - 'event_buffer_disable', - 'event_buffer_enable', - 'event_buffer_fd_set', - 'event_buffer_free', - 'event_buffer_new', - 'event_buffer_priority_set', - 'event_buffer_read', - 'event_buffer_set_callback', - 'event_buffer_timeout_set', - 'event_buffer_watermark_set', - 'event_buffer_write', - 'event_del', - 'event_free', - 'event_new', - 'event_priority_set', - 'event_set', - 'event_timer_add', - 'event_timer_del', - 'event_timer_pending', - 'event_timer_set', - 'expect_expectl', - 'expect_popen', - 'fam_cancel_monitor', - 'fam_close', - 'fam_monitor_collection', - 'fam_monitor_directory', - 'fam_monitor_file', - 'fam_next_event', - 'fam_open', - 'fam_pending', - 'fam_resume_monitor', - 'fam_suspend_monitor', - 'fann_cascadetrain_on_data', - 'fann_cascadetrain_on_file', - 'fann_clear_scaling_params', - 'fann_copy', - 'fann_create_from_file', - 'fann_create_shortcut_array', - 'fann_create_standard', - 'fann_create_standard_array', - 'fann_create_train', - 'fann_create_train_from_callback', - 'fann_descale_input', - 'fann_descale_output', - 'fann_descale_train', - 'fann_destroy', - 'fann_destroy_train', - 'fann_duplicate_train_data', - 'fann_get_MSE', - 'fann_get_activation_function', - 'fann_get_activation_steepness', - 'fann_get_bias_array', - 'fann_get_bit_fail', - 'fann_get_bit_fail_limit', - 'fann_get_cascade_activation_functions', - 'fann_get_cascade_activation_functions_count', - 'fann_get_cascade_activation_steepnesses', - 'fann_get_cascade_activation_steepnesses_count', - 'fann_get_cascade_candidate_change_fraction', - 'fann_get_cascade_candidate_limit', - 'fann_get_cascade_candidate_stagnation_epochs', - 'fann_get_cascade_max_cand_epochs', - 'fann_get_cascade_max_out_epochs', - 'fann_get_cascade_min_cand_epochs', - 'fann_get_cascade_min_out_epochs', - 'fann_get_cascade_num_candidate_groups', - 'fann_get_cascade_num_candidates', - 'fann_get_cascade_output_change_fraction', - 'fann_get_cascade_output_stagnation_epochs', - 'fann_get_cascade_weight_multiplier', - 'fann_get_connection_array', - 'fann_get_connection_rate', - 'fann_get_errno', - 'fann_get_errstr', - 'fann_get_layer_array', - 'fann_get_learning_momentum', - 'fann_get_learning_rate', - 'fann_get_network_type', - 'fann_get_num_input', - 'fann_get_num_layers', - 'fann_get_num_output', - 'fann_get_quickprop_decay', - 'fann_get_quickprop_mu', - 'fann_get_rprop_decrease_factor', - 'fann_get_rprop_delta_max', - 'fann_get_rprop_delta_min', - 'fann_get_rprop_delta_zero', - 'fann_get_rprop_increase_factor', - 'fann_get_sarprop_step_error_shift', - 'fann_get_sarprop_step_error_threshold_factor', - 'fann_get_sarprop_temperature', - 'fann_get_sarprop_weight_decay_shift', - 'fann_get_total_connections', - 'fann_get_total_neurons', - 'fann_get_train_error_function', - 'fann_get_train_stop_function', - 'fann_get_training_algorithm', - 'fann_init_weights', - 'fann_length_train_data', - 'fann_merge_train_data', - 'fann_num_input_train_data', - 'fann_num_output_train_data', - 'fann_randomize_weights', - 'fann_read_train_from_file', - 'fann_reset_errno', - 'fann_reset_errstr', - 'fann_run', - 'fann_save', - 'fann_save_train', - 'fann_scale_input', - 'fann_scale_input_train_data', - 'fann_scale_output', - 'fann_scale_output_train_data', - 'fann_scale_train', - 'fann_scale_train_data', - 'fann_set_activation_function', - 'fann_set_activation_function_hidden', - 'fann_set_activation_function_layer', - 'fann_set_activation_function_output', - 'fann_set_activation_steepness', - 'fann_set_activation_steepness_hidden', - 'fann_set_activation_steepness_layer', - 'fann_set_activation_steepness_output', - 'fann_set_bit_fail_limit', - 'fann_set_callback', - 'fann_set_cascade_activation_functions', - 'fann_set_cascade_activation_steepnesses', - 'fann_set_cascade_candidate_change_fraction', - 'fann_set_cascade_candidate_limit', - 'fann_set_cascade_candidate_stagnation_epochs', - 'fann_set_cascade_max_cand_epochs', - 'fann_set_cascade_max_out_epochs', - 'fann_set_cascade_min_cand_epochs', - 'fann_set_cascade_min_out_epochs', - 'fann_set_cascade_num_candidate_groups', - 'fann_set_cascade_output_change_fraction', - 'fann_set_cascade_output_stagnation_epochs', - 'fann_set_cascade_weight_multiplier', - 'fann_set_error_log', - 'fann_set_input_scaling_params', - 'fann_set_learning_momentum', - 'fann_set_learning_rate', - 'fann_set_output_scaling_params', - 'fann_set_quickprop_decay', - 'fann_set_quickprop_mu', - 'fann_set_rprop_decrease_factor', - 'fann_set_rprop_delta_max', - 'fann_set_rprop_delta_min', - 'fann_set_rprop_delta_zero', - 'fann_set_rprop_increase_factor', - 'fann_set_sarprop_step_error_shift', - 'fann_set_sarprop_step_error_threshold_factor', - 'fann_set_sarprop_temperature', - 'fann_set_sarprop_weight_decay_shift', - 'fann_set_scaling_params', - 'fann_set_train_error_function', - 'fann_set_train_stop_function', - 'fann_set_training_algorithm', - 'fann_set_weight', - 'fann_set_weight_array', - 'fann_shuffle_train_data', - 'fann_subset_train_data', - 'fann_test', - 'fann_test_data', - 'fann_train', - 'fann_train_epoch', - 'fann_train_on_data', - 'fann_train_on_file', - 'fbsql_affected_rows', - 'fbsql_autocommit', - 'fbsql_blob_size', - 'fbsql_change_user', - 'fbsql_clob_size', - 'fbsql_close', - 'fbsql_commit', - 'fbsql_connect', - 'fbsql_create_blob', - 'fbsql_create_clob', - 'fbsql_create_db', - 'fbsql_data_seek', - 'fbsql_database', - 'fbsql_database_password', - 'fbsql_db_query', - 'fbsql_db_status', - 'fbsql_drop_db', - 'fbsql_errno', - 'fbsql_error', - 'fbsql_fetch_array', - 'fbsql_fetch_assoc', - 'fbsql_fetch_field', - 'fbsql_fetch_lengths', - 'fbsql_fetch_object', - 'fbsql_fetch_row', - 'fbsql_field_flags', - 'fbsql_field_len', - 'fbsql_field_name', - 'fbsql_field_seek', - 'fbsql_field_table', - 'fbsql_field_type', - 'fbsql_free_result', - 'fbsql_get_autostart_info', - 'fbsql_hostname', - 'fbsql_insert_id', - 'fbsql_list_dbs', - 'fbsql_list_fields', - 'fbsql_list_tables', - 'fbsql_next_result', - 'fbsql_num_fields', - 'fbsql_num_rows', - 'fbsql_password', - 'fbsql_pconnect', - 'fbsql_query', - 'fbsql_read_blob', - 'fbsql_read_clob', - 'fbsql_result', - 'fbsql_rollback', - 'fbsql_rows_fetched', - 'fbsql_select_db', - 'fbsql_set_characterset', - 'fbsql_set_lob_mode', - 'fbsql_set_password', - 'fbsql_set_transaction', - 'fbsql_start_db', - 'fbsql_stop_db', - 'fbsql_table_name', - 'fbsql_username', - 'fclose', - 'fdf_add_doc_javascript', - 'fdf_add_template', - 'fdf_close', - 'fdf_create', - 'fdf_enum_values', - 'fdf_get_ap', - 'fdf_get_attachment', - 'fdf_get_encoding', - 'fdf_get_file', - 'fdf_get_flags', - 'fdf_get_opt', - 'fdf_get_status', - 'fdf_get_value', - 'fdf_get_version', - 'fdf_next_field_name', - 'fdf_open', - 'fdf_open_string', - 'fdf_remove_item', - 'fdf_save', - 'fdf_save_string', - 'fdf_set_ap', - 'fdf_set_encoding', - 'fdf_set_file', - 'fdf_set_flags', - 'fdf_set_javascript_action', - 'fdf_set_on_import_javascript', - 'fdf_set_opt', - 'fdf_set_status', - 'fdf_set_submit_form_action', - 'fdf_set_target_frame', - 'fdf_set_value', - 'fdf_set_version', - 'feof', - 'fflush', - 'ffmpeg_frame::__construct', - 'ffmpeg_frame::toGDImage', - 'fgetc', - 'fgetcsv', - 'fgets', - 'fgetss', - 'file', - 'file_get_contents', - 'file_put_contents', - 'finfo::buffer', - 'finfo::file', - 'finfo_buffer', - 'finfo_close', - 'finfo_file', - 'finfo_open', - 'finfo_set_flags', - 'flock', - 'fopen', - 'fpassthru', - 'fprintf', - 'fputcsv', - 'fputs', - 'fread', - 'fscanf', - 'fseek', - 'fstat', - 'ftell', - 'ftp_alloc', - 'ftp_append', - 'ftp_cdup', - 'ftp_chdir', - 'ftp_chmod', - 'ftp_close', - 'ftp_delete', - 'ftp_exec', - 'ftp_fget', - 'ftp_fput', - 'ftp_get', - 'ftp_get_option', - 'ftp_login', - 'ftp_mdtm', - 'ftp_mkdir', - 'ftp_mlsd', - 'ftp_nb_continue', - 'ftp_nb_fget', - 'ftp_nb_fput', - 'ftp_nb_get', - 'ftp_nb_put', - 'ftp_nlist', - 'ftp_pasv', - 'ftp_put', - 'ftp_pwd', - 'ftp_quit', - 'ftp_raw', - 'ftp_rawlist', - 'ftp_rename', - 'ftp_rmdir', - 'ftp_set_option', - 'ftp_site', - 'ftp_size', - 'ftp_systype', - 'ftruncate', - 'fwrite', - 'get_resource_type', - 'gmp_div', - 'gnupg::init', - 'gnupg_adddecryptkey', - 'gnupg_addencryptkey', - 'gnupg_addsignkey', - 'gnupg_cleardecryptkeys', - 'gnupg_clearencryptkeys', - 'gnupg_clearsignkeys', - 'gnupg_decrypt', - 'gnupg_decryptverify', - 'gnupg_encrypt', - 'gnupg_encryptsign', - 'gnupg_export', - 'gnupg_geterror', - 'gnupg_getprotocol', - 'gnupg_import', - 'gnupg_init', - 'gnupg_keyinfo', - 'gnupg_setarmor', - 'gnupg_seterrormode', - 'gnupg_setsignmode', - 'gnupg_sign', - 'gnupg_verify', - 'gupnp_context_get_host_ip', - 'gupnp_context_get_port', - 'gupnp_context_get_subscription_timeout', - 'gupnp_context_host_path', - 'gupnp_context_new', - 'gupnp_context_set_subscription_timeout', - 'gupnp_context_timeout_add', - 'gupnp_context_unhost_path', - 'gupnp_control_point_browse_start', - 'gupnp_control_point_browse_stop', - 'gupnp_control_point_callback_set', - 'gupnp_control_point_new', - 'gupnp_device_action_callback_set', - 'gupnp_device_info_get', - 'gupnp_device_info_get_service', - 'gupnp_root_device_get_available', - 'gupnp_root_device_get_relative_location', - 'gupnp_root_device_new', - 'gupnp_root_device_set_available', - 'gupnp_root_device_start', - 'gupnp_root_device_stop', - 'gupnp_service_action_get', - 'gupnp_service_action_return', - 'gupnp_service_action_return_error', - 'gupnp_service_action_set', - 'gupnp_service_freeze_notify', - 'gupnp_service_info_get', - 'gupnp_service_info_get_introspection', - 'gupnp_service_introspection_get_state_variable', - 'gupnp_service_notify', - 'gupnp_service_proxy_action_get', - 'gupnp_service_proxy_action_set', - 'gupnp_service_proxy_add_notify', - 'gupnp_service_proxy_callback_set', - 'gupnp_service_proxy_get_subscribed', - 'gupnp_service_proxy_remove_notify', - 'gupnp_service_proxy_send_action', - 'gupnp_service_proxy_set_subscribed', - 'gupnp_service_thaw_notify', - 'gzclose', - 'gzeof', - 'gzgetc', - 'gzgets', - 'gzgetss', - 'gzpassthru', - 'gzputs', - 'gzread', - 'gzrewind', - 'gzseek', - 'gztell', - 'gzwrite', - 'hash_update_stream', - 'http\Env\Response::send', - 'http_get_request_body_stream', - 'ibase_add_user', - 'ibase_affected_rows', - 'ibase_backup', - 'ibase_blob_add', - 'ibase_blob_cancel', - 'ibase_blob_close', - 'ibase_blob_create', - 'ibase_blob_get', - 'ibase_blob_open', - 'ibase_close', - 'ibase_commit', - 'ibase_commit_ret', - 'ibase_connect', - 'ibase_db_info', - 'ibase_delete_user', - 'ibase_drop_db', - 'ibase_execute', - 'ibase_fetch_assoc', - 'ibase_fetch_object', - 'ibase_fetch_row', - 'ibase_field_info', - 'ibase_free_event_handler', - 'ibase_free_query', - 'ibase_free_result', - 'ibase_gen_id', - 'ibase_maintain_db', - 'ibase_modify_user', - 'ibase_name_result', - 'ibase_num_fields', - 'ibase_num_params', - 'ibase_param_info', - 'ibase_pconnect', - 'ibase_prepare', - 'ibase_query', - 'ibase_restore', - 'ibase_rollback', - 'ibase_rollback_ret', - 'ibase_server_info', - 'ibase_service_attach', - 'ibase_service_detach', - 'ibase_set_event_handler', - 'ibase_trans', - 'ifx_affected_rows', - 'ifx_close', - 'ifx_connect', - 'ifx_do', - 'ifx_error', - 'ifx_fetch_row', - 'ifx_fieldproperties', - 'ifx_fieldtypes', - 'ifx_free_result', - 'ifx_getsqlca', - 'ifx_htmltbl_result', - 'ifx_num_fields', - 'ifx_num_rows', - 'ifx_pconnect', - 'ifx_prepare', - 'ifx_query', - 'image2wbmp', - 'imageaffine', - 'imagealphablending', - 'imageantialias', - 'imagearc', - 'imagebmp', - 'imagechar', - 'imagecharup', - 'imagecolorallocate', - 'imagecolorallocatealpha', - 'imagecolorat', - 'imagecolorclosest', - 'imagecolorclosestalpha', - 'imagecolorclosesthwb', - 'imagecolordeallocate', - 'imagecolorexact', - 'imagecolorexactalpha', - 'imagecolormatch', - 'imagecolorresolve', - 'imagecolorresolvealpha', - 'imagecolorset', - 'imagecolorsforindex', - 'imagecolorstotal', - 'imagecolortransparent', - 'imageconvolution', - 'imagecopy', - 'imagecopymerge', - 'imagecopymergegray', - 'imagecopyresampled', - 'imagecopyresized', - 'imagecrop', - 'imagecropauto', - 'imagedashedline', - 'imagedestroy', - 'imageellipse', - 'imagefill', - 'imagefilledarc', - 'imagefilledellipse', - 'imagefilledpolygon', - 'imagefilledrectangle', - 'imagefilltoborder', - 'imagefilter', - 'imageflip', - 'imagefttext', - 'imagegammacorrect', - 'imagegd', - 'imagegd2', - 'imagegetclip', - 'imagegif', - 'imagegrabscreen', - 'imagegrabwindow', - 'imageinterlace', - 'imageistruecolor', - 'imagejpeg', - 'imagelayereffect', - 'imageline', - 'imageopenpolygon', - 'imagepalettecopy', - 'imagepalettetotruecolor', - 'imagepng', - 'imagepolygon', - 'imagepsencodefont', - 'imagepsextendfont', - 'imagepsfreefont', - 'imagepsloadfont', - 'imagepsslantfont', - 'imagepstext', - 'imagerectangle', - 'imageresolution', - 'imagerotate', - 'imagesavealpha', - 'imagescale', - 'imagesetbrush', - 'imagesetclip', - 'imagesetinterpolation', - 'imagesetpixel', - 'imagesetstyle', - 'imagesetthickness', - 'imagesettile', - 'imagestring', - 'imagestringup', - 'imagesx', - 'imagesy', - 'imagetruecolortopalette', - 'imagettftext', - 'imagewbmp', - 'imagewebp', - 'imagexbm', - 'imap_append', - 'imap_body', - 'imap_bodystruct', - 'imap_check', - 'imap_clearflag_full', - 'imap_close', - 'imap_create', - 'imap_createmailbox', - 'imap_delete', - 'imap_deletemailbox', - 'imap_expunge', - 'imap_fetch_overview', - 'imap_fetchbody', - 'imap_fetchheader', - 'imap_fetchmime', - 'imap_fetchstructure', - 'imap_fetchtext', - 'imap_gc', - 'imap_get_quota', - 'imap_get_quotaroot', - 'imap_getacl', - 'imap_getmailboxes', - 'imap_getsubscribed', - 'imap_header', - 'imap_headerinfo', - 'imap_headers', - 'imap_list', - 'imap_listmailbox', - 'imap_listscan', - 'imap_listsubscribed', - 'imap_lsub', - 'imap_mail_copy', - 'imap_mail_move', - 'imap_mailboxmsginfo', - 'imap_msgno', - 'imap_num_msg', - 'imap_num_recent', - 'imap_ping', - 'imap_rename', - 'imap_renamemailbox', - 'imap_reopen', - 'imap_savebody', - 'imap_scan', - 'imap_scanmailbox', - 'imap_search', - 'imap_set_quota', - 'imap_setacl', - 'imap_setflag_full', - 'imap_sort', - 'imap_status', - 'imap_subscribe', - 'imap_thread', - 'imap_uid', - 'imap_undelete', - 'imap_unsubscribe', - 'inflate_add', - 'inflate_get_read_len', - 'inflate_get_status', - 'ingres_autocommit', - 'ingres_autocommit_state', - 'ingres_charset', - 'ingres_close', - 'ingres_commit', - 'ingres_connect', - 'ingres_cursor', - 'ingres_errno', - 'ingres_error', - 'ingres_errsqlstate', - 'ingres_escape_string', - 'ingres_execute', - 'ingres_fetch_array', - 'ingres_fetch_assoc', - 'ingres_fetch_object', - 'ingres_fetch_proc_return', - 'ingres_fetch_row', - 'ingres_field_length', - 'ingres_field_name', - 'ingres_field_nullable', - 'ingres_field_precision', - 'ingres_field_scale', - 'ingres_field_type', - 'ingres_free_result', - 'ingres_next_error', - 'ingres_num_fields', - 'ingres_num_rows', - 'ingres_pconnect', - 'ingres_prepare', - 'ingres_query', - 'ingres_result_seek', - 'ingres_rollback', - 'ingres_set_environment', - 'ingres_unbuffered_query', - 'inotify_add_watch', - 'inotify_init', - 'inotify_queue_len', - 'inotify_read', - 'inotify_rm_watch', - 'kadm5_chpass_principal', - 'kadm5_create_principal', - 'kadm5_delete_principal', - 'kadm5_destroy', - 'kadm5_flush', - 'kadm5_get_policies', - 'kadm5_get_principal', - 'kadm5_get_principals', - 'kadm5_init_with_password', - 'kadm5_modify_principal', - 'ldap_add', - 'ldap_bind', - 'ldap_close', - 'ldap_compare', - 'ldap_control_paged_result', - 'ldap_control_paged_result_response', - 'ldap_count_entries', - 'ldap_delete', - 'ldap_errno', - 'ldap_error', - 'ldap_exop', - 'ldap_exop_passwd', - 'ldap_exop_refresh', - 'ldap_exop_whoami', - 'ldap_first_attribute', - 'ldap_first_entry', - 'ldap_first_reference', - 'ldap_free_result', - 'ldap_get_attributes', - 'ldap_get_dn', - 'ldap_get_entries', - 'ldap_get_option', - 'ldap_get_values', - 'ldap_get_values_len', - 'ldap_mod_add', - 'ldap_mod_del', - 'ldap_mod_replace', - 'ldap_modify', - 'ldap_modify_batch', - 'ldap_next_attribute', - 'ldap_next_entry', - 'ldap_next_reference', - 'ldap_parse_exop', - 'ldap_parse_reference', - 'ldap_parse_result', - 'ldap_rename', - 'ldap_sasl_bind', - 'ldap_set_option', - 'ldap_set_rebind_proc', - 'ldap_sort', - 'ldap_start_tls', - 'ldap_unbind', - 'libxml_set_streams_context', - 'm_checkstatus', - 'm_completeauthorizations', - 'm_connect', - 'm_connectionerror', - 'm_deletetrans', - 'm_destroyconn', - 'm_getcell', - 'm_getcellbynum', - 'm_getcommadelimited', - 'm_getheader', - 'm_initconn', - 'm_iscommadelimited', - 'm_maxconntimeout', - 'm_monitor', - 'm_numcolumns', - 'm_numrows', - 'm_parsecommadelimited', - 'm_responsekeys', - 'm_responseparam', - 'm_returnstatus', - 'm_setblocking', - 'm_setdropfile', - 'm_setip', - 'm_setssl', - 'm_setssl_cafile', - 'm_setssl_files', - 'm_settimeout', - 'm_transactionssent', - 'm_transinqueue', - 'm_transkeyval', - 'm_transnew', - 'm_transsend', - 'm_validateidentifier', - 'm_verifyconnection', - 'm_verifysslcert', - 'mailparse_determine_best_xfer_encoding', - 'mailparse_msg_create', - 'mailparse_msg_extract_part', - 'mailparse_msg_extract_part_file', - 'mailparse_msg_extract_whole_part_file', - 'mailparse_msg_free', - 'mailparse_msg_get_part', - 'mailparse_msg_get_part_data', - 'mailparse_msg_get_structure', - 'mailparse_msg_parse', - 'mailparse_msg_parse_file', - 'mailparse_stream_encode', - 'mailparse_uudecode_all', - 'maxdb::use_result', - 'maxdb_affected_rows', - 'maxdb_connect', - 'maxdb_disable_rpl_parse', - 'maxdb_dump_debug_info', - 'maxdb_embedded_connect', - 'maxdb_enable_reads_from_master', - 'maxdb_enable_rpl_parse', - 'maxdb_errno', - 'maxdb_error', - 'maxdb_fetch_lengths', - 'maxdb_field_tell', - 'maxdb_get_host_info', - 'maxdb_get_proto_info', - 'maxdb_get_server_info', - 'maxdb_get_server_version', - 'maxdb_info', - 'maxdb_init', - 'maxdb_insert_id', - 'maxdb_master_query', - 'maxdb_more_results', - 'maxdb_next_result', - 'maxdb_num_fields', - 'maxdb_num_rows', - 'maxdb_rpl_parse_enabled', - 'maxdb_rpl_probe', - 'maxdb_select_db', - 'maxdb_sqlstate', - 'maxdb_stmt::result_metadata', - 'maxdb_stmt_affected_rows', - 'maxdb_stmt_errno', - 'maxdb_stmt_error', - 'maxdb_stmt_num_rows', - 'maxdb_stmt_param_count', - 'maxdb_stmt_result_metadata', - 'maxdb_stmt_sqlstate', - 'maxdb_thread_id', - 'maxdb_use_result', - 'maxdb_warning_count', - 'mcrypt_enc_get_algorithms_name', - 'mcrypt_enc_get_block_size', - 'mcrypt_enc_get_iv_size', - 'mcrypt_enc_get_key_size', - 'mcrypt_enc_get_modes_name', - 'mcrypt_enc_get_supported_key_sizes', - 'mcrypt_enc_is_block_algorithm', - 'mcrypt_enc_is_block_algorithm_mode', - 'mcrypt_enc_is_block_mode', - 'mcrypt_enc_self_test', - 'mcrypt_generic', - 'mcrypt_generic_deinit', - 'mcrypt_generic_end', - 'mcrypt_generic_init', - 'mcrypt_module_close', - 'mcrypt_module_open', - 'mdecrypt_generic', - 'mkdir', - 'mqseries_back', - 'mqseries_begin', - 'mqseries_close', - 'mqseries_cmit', - 'mqseries_conn', - 'mqseries_connx', - 'mqseries_disc', - 'mqseries_get', - 'mqseries_inq', - 'mqseries_open', - 'mqseries_put', - 'mqseries_put1', - 'mqseries_set', - 'msg_get_queue', - 'msg_receive', - 'msg_remove_queue', - 'msg_send', - 'msg_set_queue', - 'msg_stat_queue', - 'msql_affected_rows', - 'msql_close', - 'msql_connect', - 'msql_create_db', - 'msql_data_seek', - 'msql_db_query', - 'msql_drop_db', - 'msql_fetch_array', - 'msql_fetch_field', - 'msql_fetch_object', - 'msql_fetch_row', - 'msql_field_flags', - 'msql_field_len', - 'msql_field_name', - 'msql_field_seek', - 'msql_field_table', - 'msql_field_type', - 'msql_free_result', - 'msql_list_dbs', - 'msql_list_fields', - 'msql_list_tables', - 'msql_num_fields', - 'msql_num_rows', - 'msql_pconnect', - 'msql_query', - 'msql_result', - 'msql_select_db', - 'mssql_bind', - 'mssql_close', - 'mssql_connect', - 'mssql_data_seek', - 'mssql_execute', - 'mssql_fetch_array', - 'mssql_fetch_assoc', - 'mssql_fetch_batch', - 'mssql_fetch_field', - 'mssql_fetch_object', - 'mssql_fetch_row', - 'mssql_field_length', - 'mssql_field_name', - 'mssql_field_seek', - 'mssql_field_type', - 'mssql_free_result', - 'mssql_free_statement', - 'mssql_init', - 'mssql_next_result', - 'mssql_num_fields', - 'mssql_num_rows', - 'mssql_pconnect', - 'mssql_query', - 'mssql_result', - 'mssql_rows_affected', - 'mssql_select_db', - 'mysql_affected_rows', - 'mysql_client_encoding', - 'mysql_close', - 'mysql_connect', - 'mysql_create_db', - 'mysql_data_seek', - 'mysql_db_name', - 'mysql_db_query', - 'mysql_drop_db', - 'mysql_errno', - 'mysql_error', - 'mysql_fetch_array', - 'mysql_fetch_assoc', - 'mysql_fetch_field', - 'mysql_fetch_lengths', - 'mysql_fetch_object', - 'mysql_fetch_row', - 'mysql_field_flags', - 'mysql_field_len', - 'mysql_field_name', - 'mysql_field_seek', - 'mysql_field_table', - 'mysql_field_type', - 'mysql_free_result', - 'mysql_get_host_info', - 'mysql_get_proto_info', - 'mysql_get_server_info', - 'mysql_info', - 'mysql_insert_id', - 'mysql_list_dbs', - 'mysql_list_fields', - 'mysql_list_processes', - 'mysql_list_tables', - 'mysql_num_fields', - 'mysql_num_rows', - 'mysql_pconnect', - 'mysql_ping', - 'mysql_query', - 'mysql_real_escape_string', - 'mysql_result', - 'mysql_select_db', - 'mysql_set_charset', - 'mysql_stat', - 'mysql_tablename', - 'mysql_thread_id', - 'mysql_unbuffered_query', - 'mysqlnd_uh_convert_to_mysqlnd', - 'ncurses_bottom_panel', - 'ncurses_del_panel', - 'ncurses_delwin', - 'ncurses_getmaxyx', - 'ncurses_getyx', - 'ncurses_hide_panel', - 'ncurses_keypad', - 'ncurses_meta', - 'ncurses_move_panel', - 'ncurses_mvwaddstr', - 'ncurses_new_panel', - 'ncurses_newpad', - 'ncurses_newwin', - 'ncurses_panel_above', - 'ncurses_panel_below', - 'ncurses_panel_window', - 'ncurses_pnoutrefresh', - 'ncurses_prefresh', - 'ncurses_replace_panel', - 'ncurses_show_panel', - 'ncurses_top_panel', - 'ncurses_waddch', - 'ncurses_waddstr', - 'ncurses_wattroff', - 'ncurses_wattron', - 'ncurses_wattrset', - 'ncurses_wborder', - 'ncurses_wclear', - 'ncurses_wcolor_set', - 'ncurses_werase', - 'ncurses_wgetch', - 'ncurses_whline', - 'ncurses_wmouse_trafo', - 'ncurses_wmove', - 'ncurses_wnoutrefresh', - 'ncurses_wrefresh', - 'ncurses_wstandend', - 'ncurses_wstandout', - 'ncurses_wvline', - 'newt_button', - 'newt_button_bar', - 'newt_checkbox', - 'newt_checkbox_get_value', - 'newt_checkbox_set_flags', - 'newt_checkbox_set_value', - 'newt_checkbox_tree', - 'newt_checkbox_tree_add_item', - 'newt_checkbox_tree_find_item', - 'newt_checkbox_tree_get_current', - 'newt_checkbox_tree_get_entry_value', - 'newt_checkbox_tree_get_multi_selection', - 'newt_checkbox_tree_get_selection', - 'newt_checkbox_tree_multi', - 'newt_checkbox_tree_set_current', - 'newt_checkbox_tree_set_entry', - 'newt_checkbox_tree_set_entry_value', - 'newt_checkbox_tree_set_width', - 'newt_compact_button', - 'newt_component_add_callback', - 'newt_component_takes_focus', - 'newt_create_grid', - 'newt_draw_form', - 'newt_entry', - 'newt_entry_get_value', - 'newt_entry_set', - 'newt_entry_set_filter', - 'newt_entry_set_flags', - 'newt_form', - 'newt_form_add_component', - 'newt_form_add_components', - 'newt_form_add_hot_key', - 'newt_form_destroy', - 'newt_form_get_current', - 'newt_form_run', - 'newt_form_set_background', - 'newt_form_set_height', - 'newt_form_set_size', - 'newt_form_set_timer', - 'newt_form_set_width', - 'newt_form_watch_fd', - 'newt_grid_add_components_to_form', - 'newt_grid_basic_window', - 'newt_grid_free', - 'newt_grid_get_size', - 'newt_grid_h_close_stacked', - 'newt_grid_h_stacked', - 'newt_grid_place', - 'newt_grid_set_field', - 'newt_grid_simple_window', - 'newt_grid_v_close_stacked', - 'newt_grid_v_stacked', - 'newt_grid_wrapped_window', - 'newt_grid_wrapped_window_at', - 'newt_label', - 'newt_label_set_text', - 'newt_listbox', - 'newt_listbox_append_entry', - 'newt_listbox_clear', - 'newt_listbox_clear_selection', - 'newt_listbox_delete_entry', - 'newt_listbox_get_current', - 'newt_listbox_get_selection', - 'newt_listbox_insert_entry', - 'newt_listbox_item_count', - 'newt_listbox_select_item', - 'newt_listbox_set_current', - 'newt_listbox_set_current_by_key', - 'newt_listbox_set_data', - 'newt_listbox_set_entry', - 'newt_listbox_set_width', - 'newt_listitem', - 'newt_listitem_get_data', - 'newt_listitem_set', - 'newt_radio_get_current', - 'newt_radiobutton', - 'newt_run_form', - 'newt_scale', - 'newt_scale_set', - 'newt_scrollbar_set', - 'newt_textbox', - 'newt_textbox_get_num_lines', - 'newt_textbox_reflowed', - 'newt_textbox_set_height', - 'newt_textbox_set_text', - 'newt_vertical_scrollbar', - 'oci_bind_array_by_name', - 'oci_bind_by_name', - 'oci_cancel', - 'oci_close', - 'oci_commit', - 'oci_connect', - 'oci_define_by_name', - 'oci_error', - 'oci_execute', - 'oci_fetch', - 'oci_fetch_all', - 'oci_fetch_array', - 'oci_fetch_assoc', - 'oci_fetch_object', - 'oci_fetch_row', - 'oci_field_is_null', - 'oci_field_name', - 'oci_field_precision', - 'oci_field_scale', - 'oci_field_size', - 'oci_field_type', - 'oci_field_type_raw', - 'oci_free_cursor', - 'oci_free_statement', - 'oci_get_implicit_resultset', - 'oci_new_collection', - 'oci_new_connect', - 'oci_new_cursor', - 'oci_new_descriptor', - 'oci_num_fields', - 'oci_num_rows', - 'oci_parse', - 'oci_pconnect', - 'oci_register_taf_callback', - 'oci_result', - 'oci_rollback', - 'oci_server_version', - 'oci_set_action', - 'oci_set_client_identifier', - 'oci_set_client_info', - 'oci_set_module_name', - 'oci_set_prefetch', - 'oci_statement_type', - 'oci_unregister_taf_callback', - 'odbc_autocommit', - 'odbc_close', - 'odbc_columnprivileges', - 'odbc_columns', - 'odbc_commit', - 'odbc_connect', - 'odbc_cursor', - 'odbc_data_source', - 'odbc_do', - 'odbc_error', - 'odbc_errormsg', - 'odbc_exec', - 'odbc_execute', - 'odbc_fetch_array', - 'odbc_fetch_into', - 'odbc_fetch_row', - 'odbc_field_len', - 'odbc_field_name', - 'odbc_field_num', - 'odbc_field_precision', - 'odbc_field_scale', - 'odbc_field_type', - 'odbc_foreignkeys', - 'odbc_free_result', - 'odbc_gettypeinfo', - 'odbc_next_result', - 'odbc_num_fields', - 'odbc_num_rows', - 'odbc_pconnect', - 'odbc_prepare', - 'odbc_primarykeys', - 'odbc_procedurecolumns', - 'odbc_procedures', - 'odbc_result', - 'odbc_result_all', - 'odbc_rollback', - 'odbc_setoption', - 'odbc_specialcolumns', - 'odbc_statistics', - 'odbc_tableprivileges', - 'odbc_tables', - 'openal_buffer_create', - 'openal_buffer_data', - 'openal_buffer_destroy', - 'openal_buffer_get', - 'openal_buffer_loadwav', - 'openal_context_create', - 'openal_context_current', - 'openal_context_destroy', - 'openal_context_process', - 'openal_context_suspend', - 'openal_device_close', - 'openal_device_open', - 'openal_source_create', - 'openal_source_destroy', - 'openal_source_get', - 'openal_source_pause', - 'openal_source_play', - 'openal_source_rewind', - 'openal_source_set', - 'openal_source_stop', - 'openal_stream', - 'opendir', - 'openssl_csr_new', - 'openssl_dh_compute_key', - 'openssl_free_key', - 'openssl_pkey_export', - 'openssl_pkey_free', - 'openssl_pkey_get_details', - 'openssl_spki_new', - 'openssl_x509_free', - 'pclose', - 'pfsockopen', - 'pg_affected_rows', - 'pg_cancel_query', - 'pg_client_encoding', - 'pg_close', - 'pg_connect_poll', - 'pg_connection_busy', - 'pg_connection_reset', - 'pg_connection_status', - 'pg_consume_input', - 'pg_convert', - 'pg_copy_from', - 'pg_copy_to', - 'pg_dbname', - 'pg_delete', - 'pg_end_copy', - 'pg_escape_bytea', - 'pg_escape_identifier', - 'pg_escape_literal', - 'pg_escape_string', - 'pg_execute', - 'pg_fetch_all', - 'pg_fetch_all_columns', - 'pg_fetch_array', - 'pg_fetch_assoc', - 'pg_fetch_row', - 'pg_field_name', - 'pg_field_num', - 'pg_field_size', - 'pg_field_table', - 'pg_field_type', - 'pg_field_type_oid', - 'pg_flush', - 'pg_free_result', - 'pg_get_notify', - 'pg_get_pid', - 'pg_get_result', - 'pg_host', - 'pg_insert', - 'pg_last_error', - 'pg_last_notice', - 'pg_last_oid', - 'pg_lo_close', - 'pg_lo_create', - 'pg_lo_export', - 'pg_lo_import', - 'pg_lo_open', - 'pg_lo_read', - 'pg_lo_read_all', - 'pg_lo_seek', - 'pg_lo_tell', - 'pg_lo_truncate', - 'pg_lo_unlink', - 'pg_lo_write', - 'pg_meta_data', - 'pg_num_fields', - 'pg_num_rows', - 'pg_options', - 'pg_parameter_status', - 'pg_ping', - 'pg_port', - 'pg_prepare', - 'pg_put_line', - 'pg_query', - 'pg_query_params', - 'pg_result_error', - 'pg_result_error_field', - 'pg_result_seek', - 'pg_result_status', - 'pg_select', - 'pg_send_execute', - 'pg_send_prepare', - 'pg_send_query', - 'pg_send_query_params', - 'pg_set_client_encoding', - 'pg_set_error_verbosity', - 'pg_socket', - 'pg_trace', - 'pg_transaction_status', - 'pg_tty', - 'pg_untrace', - 'pg_update', - 'pg_version', - 'php_user_filter::filter', - 'proc_close', - 'proc_get_status', - 'proc_terminate', - 'ps_add_bookmark', - 'ps_add_launchlink', - 'ps_add_locallink', - 'ps_add_note', - 'ps_add_pdflink', - 'ps_add_weblink', - 'ps_arc', - 'ps_arcn', - 'ps_begin_page', - 'ps_begin_pattern', - 'ps_begin_template', - 'ps_circle', - 'ps_clip', - 'ps_close', - 'ps_close_image', - 'ps_closepath', - 'ps_closepath_stroke', - 'ps_continue_text', - 'ps_curveto', - 'ps_delete', - 'ps_end_page', - 'ps_end_pattern', - 'ps_end_template', - 'ps_fill', - 'ps_fill_stroke', - 'ps_findfont', - 'ps_get_buffer', - 'ps_get_parameter', - 'ps_get_value', - 'ps_hyphenate', - 'ps_include_file', - 'ps_lineto', - 'ps_makespotcolor', - 'ps_moveto', - 'ps_new', - 'ps_open_file', - 'ps_open_image', - 'ps_open_image_file', - 'ps_open_memory_image', - 'ps_place_image', - 'ps_rect', - 'ps_restore', - 'ps_rotate', - 'ps_save', - 'ps_scale', - 'ps_set_border_color', - 'ps_set_border_dash', - 'ps_set_border_style', - 'ps_set_info', - 'ps_set_parameter', - 'ps_set_text_pos', - 'ps_set_value', - 'ps_setcolor', - 'ps_setdash', - 'ps_setflat', - 'ps_setfont', - 'ps_setgray', - 'ps_setlinecap', - 'ps_setlinejoin', - 'ps_setlinewidth', - 'ps_setmiterlimit', - 'ps_setoverprintmode', - 'ps_setpolydash', - 'ps_shading', - 'ps_shading_pattern', - 'ps_shfill', - 'ps_show', - 'ps_show2', - 'ps_show_boxed', - 'ps_show_xy', - 'ps_show_xy2', - 'ps_string_geometry', - 'ps_stringwidth', - 'ps_stroke', - 'ps_symbol', - 'ps_symbol_name', - 'ps_symbol_width', - 'ps_translate', - 'px_close', - 'px_create_fp', - 'px_date2string', - 'px_delete', - 'px_delete_record', - 'px_get_field', - 'px_get_info', - 'px_get_parameter', - 'px_get_record', - 'px_get_schema', - 'px_get_value', - 'px_insert_record', - 'px_new', - 'px_numfields', - 'px_numrecords', - 'px_open_fp', - 'px_put_record', - 'px_retrieve_record', - 'px_set_blob_file', - 'px_set_parameter', - 'px_set_tablename', - 'px_set_targetencoding', - 'px_set_value', - 'px_timestamp2string', - 'px_update_record', - 'radius_acct_open', - 'radius_add_server', - 'radius_auth_open', - 'radius_close', - 'radius_config', - 'radius_create_request', - 'radius_demangle', - 'radius_demangle_mppe_key', - 'radius_get_attr', - 'radius_put_addr', - 'radius_put_attr', - 'radius_put_int', - 'radius_put_string', - 'radius_put_vendor_addr', - 'radius_put_vendor_attr', - 'radius_put_vendor_int', - 'radius_put_vendor_string', - 'radius_request_authenticator', - 'radius_salt_encrypt_attr', - 'radius_send_request', - 'radius_server_secret', - 'radius_strerror', - 'readdir', - 'readfile', - 'recode_file', - 'rename', - 'rewind', - 'rewinddir', - 'rmdir', - 'rpm_close', - 'rpm_get_tag', - 'rpm_open', - 'sapi_windows_vt100_support', - 'scandir', - 'sem_acquire', - 'sem_get', - 'sem_release', - 'sem_remove', - 'set_file_buffer', - 'shm_attach', - 'shm_detach', - 'shm_get_var', - 'shm_has_var', - 'shm_put_var', - 'shm_remove', - 'shm_remove_var', - 'shmop_close', - 'shmop_delete', - 'shmop_open', - 'shmop_read', - 'shmop_size', - 'shmop_write', - 'socket_accept', - 'socket_addrinfo_bind', - 'socket_addrinfo_connect', - 'socket_addrinfo_explain', - 'socket_bind', - 'socket_clear_error', - 'socket_close', - 'socket_connect', - 'socket_export_stream', - 'socket_get_option', - 'socket_get_status', - 'socket_getopt', - 'socket_getpeername', - 'socket_getsockname', - 'socket_import_stream', - 'socket_last_error', - 'socket_listen', - 'socket_read', - 'socket_recv', - 'socket_recvfrom', - 'socket_recvmsg', - 'socket_send', - 'socket_sendmsg', - 'socket_sendto', - 'socket_set_block', - 'socket_set_blocking', - 'socket_set_nonblock', - 'socket_set_option', - 'socket_set_timeout', - 'socket_shutdown', - 'socket_write', - 'sqlite_close', - 'sqlite_fetch_string', - 'sqlite_has_more', - 'sqlite_open', - 'sqlite_popen', - 'sqlsrv_begin_transaction', - 'sqlsrv_cancel', - 'sqlsrv_client_info', - 'sqlsrv_close', - 'sqlsrv_commit', - 'sqlsrv_connect', - 'sqlsrv_execute', - 'sqlsrv_fetch', - 'sqlsrv_fetch_array', - 'sqlsrv_fetch_object', - 'sqlsrv_field_metadata', - 'sqlsrv_free_stmt', - 'sqlsrv_get_field', - 'sqlsrv_has_rows', - 'sqlsrv_next_result', - 'sqlsrv_num_fields', - 'sqlsrv_num_rows', - 'sqlsrv_prepare', - 'sqlsrv_query', - 'sqlsrv_rollback', - 'sqlsrv_rows_affected', - 'sqlsrv_send_stream_data', - 'sqlsrv_server_info', - 'ssh2_auth_agent', - 'ssh2_auth_hostbased_file', - 'ssh2_auth_none', - 'ssh2_auth_password', - 'ssh2_auth_pubkey_file', - 'ssh2_disconnect', - 'ssh2_exec', - 'ssh2_fetch_stream', - 'ssh2_fingerprint', - 'ssh2_methods_negotiated', - 'ssh2_publickey_add', - 'ssh2_publickey_init', - 'ssh2_publickey_list', - 'ssh2_publickey_remove', - 'ssh2_scp_recv', - 'ssh2_scp_send', - 'ssh2_sftp', - 'ssh2_sftp_chmod', - 'ssh2_sftp_lstat', - 'ssh2_sftp_mkdir', - 'ssh2_sftp_readlink', - 'ssh2_sftp_realpath', - 'ssh2_sftp_rename', - 'ssh2_sftp_rmdir', - 'ssh2_sftp_stat', - 'ssh2_sftp_symlink', - 'ssh2_sftp_unlink', - 'ssh2_shell', - 'ssh2_tunnel', - 'stomp_connect', - 'streamWrapper::stream_cast', - 'stream_bucket_append', - 'stream_bucket_make_writeable', - 'stream_bucket_new', - 'stream_bucket_prepend', - 'stream_context_create', - 'stream_context_get_default', - 'stream_context_get_options', - 'stream_context_get_params', - 'stream_context_set_default', - 'stream_context_set_params', - 'stream_copy_to_stream', - 'stream_encoding', - 'stream_filter_append', - 'stream_filter_prepend', - 'stream_filter_remove', - 'stream_get_contents', - 'stream_get_line', - 'stream_get_meta_data', - 'stream_isatty', - 'stream_set_blocking', - 'stream_set_chunk_size', - 'stream_set_read_buffer', - 'stream_set_timeout', - 'stream_set_write_buffer', - 'stream_socket_accept', - 'stream_socket_client', - 'stream_socket_enable_crypto', - 'stream_socket_get_name', - 'stream_socket_recvfrom', - 'stream_socket_sendto', - 'stream_socket_server', - 'stream_socket_shutdown', - 'stream_supports_lock', - 'svn_fs_abort_txn', - 'svn_fs_apply_text', - 'svn_fs_begin_txn2', - 'svn_fs_change_node_prop', - 'svn_fs_check_path', - 'svn_fs_contents_changed', - 'svn_fs_copy', - 'svn_fs_delete', - 'svn_fs_dir_entries', - 'svn_fs_file_contents', - 'svn_fs_file_length', - 'svn_fs_is_dir', - 'svn_fs_is_file', - 'svn_fs_make_dir', - 'svn_fs_make_file', - 'svn_fs_node_created_rev', - 'svn_fs_node_prop', - 'svn_fs_props_changed', - 'svn_fs_revision_prop', - 'svn_fs_revision_root', - 'svn_fs_txn_root', - 'svn_fs_youngest_rev', - 'svn_repos_create', - 'svn_repos_fs', - 'svn_repos_fs_begin_txn_for_commit', - 'svn_repos_fs_commit_txn', - 'svn_repos_open', - 'sybase_affected_rows', - 'sybase_close', - 'sybase_connect', - 'sybase_data_seek', - 'sybase_fetch_array', - 'sybase_fetch_assoc', - 'sybase_fetch_field', - 'sybase_fetch_object', - 'sybase_fetch_row', - 'sybase_field_seek', - 'sybase_free_result', - 'sybase_num_fields', - 'sybase_num_rows', - 'sybase_pconnect', - 'sybase_query', - 'sybase_result', - 'sybase_select_db', - 'sybase_set_message_handler', - 'sybase_unbuffered_query', - 'tmpfile', - 'udm_add_search_limit', - 'udm_alloc_agent', - 'udm_alloc_agent_array', - 'udm_cat_list', - 'udm_cat_path', - 'udm_check_charset', - 'udm_clear_search_limits', - 'udm_crc32', - 'udm_errno', - 'udm_error', - 'udm_find', - 'udm_free_agent', - 'udm_free_res', - 'udm_get_doc_count', - 'udm_get_res_field', - 'udm_get_res_param', - 'udm_hash32', - 'udm_load_ispell_data', - 'udm_set_agent_param', - 'unlink', - 'vfprintf', - 'w32api_init_dtype', - 'wddx_add_vars', - 'wddx_packet_end', - 'wddx_packet_start', - 'xml_get_current_byte_index', - 'xml_get_current_column_number', - 'xml_get_current_line_number', - 'xml_get_error_code', - 'xml_parse', - 'xml_parse_into_struct', - 'xml_parser_create', - 'xml_parser_create_ns', - 'xml_parser_free', - 'xml_parser_get_option', - 'xml_parser_set_option', - 'xml_set_character_data_handler', - 'xml_set_default_handler', - 'xml_set_element_handler', - 'xml_set_end_namespace_decl_handler', - 'xml_set_external_entity_ref_handler', - 'xml_set_notation_decl_handler', - 'xml_set_object', - 'xml_set_processing_instruction_handler', - 'xml_set_start_namespace_decl_handler', - 'xml_set_unparsed_entity_decl_handler', - 'xmlrpc_server_add_introspection_data', - 'xmlrpc_server_call_method', - 'xmlrpc_server_create', - 'xmlrpc_server_destroy', - 'xmlrpc_server_register_introspection_callback', - 'xmlrpc_server_register_method', - 'xmlwriter_end_attribute', - 'xmlwriter_end_cdata', - 'xmlwriter_end_comment', - 'xmlwriter_end_document', - 'xmlwriter_end_dtd', - 'xmlwriter_end_dtd_attlist', - 'xmlwriter_end_dtd_element', - 'xmlwriter_end_dtd_entity', - 'xmlwriter_end_element', - 'xmlwriter_end_pi', - 'xmlwriter_flush', - 'xmlwriter_full_end_element', - 'xmlwriter_open_memory', - 'xmlwriter_open_uri', - 'xmlwriter_output_memory', - 'xmlwriter_set_indent', - 'xmlwriter_set_indent_string', - 'xmlwriter_start_attribute', - 'xmlwriter_start_attribute_ns', - 'xmlwriter_start_cdata', - 'xmlwriter_start_comment', - 'xmlwriter_start_document', - 'xmlwriter_start_dtd', - 'xmlwriter_start_dtd_attlist', - 'xmlwriter_start_dtd_element', - 'xmlwriter_start_dtd_entity', - 'xmlwriter_start_element', - 'xmlwriter_start_element_ns', - 'xmlwriter_start_pi', - 'xmlwriter_text', - 'xmlwriter_write_attribute', - 'xmlwriter_write_attribute_ns', - 'xmlwriter_write_cdata', - 'xmlwriter_write_comment', - 'xmlwriter_write_dtd', - 'xmlwriter_write_dtd_attlist', - 'xmlwriter_write_dtd_element', - 'xmlwriter_write_dtd_entity', - 'xmlwriter_write_element', - 'xmlwriter_write_element_ns', - 'xmlwriter_write_pi', - 'xmlwriter_write_raw', - 'xslt_create', - 'yaz_addinfo', - 'yaz_ccl_conf', - 'yaz_ccl_parse', - 'yaz_close', - 'yaz_database', - 'yaz_element', - 'yaz_errno', - 'yaz_error', - 'yaz_es', - 'yaz_es_result', - 'yaz_get_option', - 'yaz_hits', - 'yaz_itemorder', - 'yaz_present', - 'yaz_range', - 'yaz_record', - 'yaz_scan', - 'yaz_scan_result', - 'yaz_schema', - 'yaz_search', - 'yaz_sort', - 'yaz_syntax', - 'zip_close', - 'zip_entry_close', - 'zip_entry_compressedsize', - 'zip_entry_compressionmethod', - 'zip_entry_filesize', - 'zip_entry_name', - 'zip_entry_open', - 'zip_entry_read', - 'zip_open', - 'zip_read', - ]; - } -} diff --git a/vendor/sebastian/type/ChangeLog.md b/vendor/sebastian/type/ChangeLog.md deleted file mode 100644 index 834681f9..00000000 --- a/vendor/sebastian/type/ChangeLog.md +++ /dev/null @@ -1,160 +0,0 @@ -# ChangeLog - -All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. - -## [3.2.0] - 2022-09-12 - -### Added - -* [#25](https://github.com/sebastianbergmann/type/issues/25): Support Disjunctive Normal Form types -* Added `ReflectionMapper::fromParameterTypes()` -* Added `IntersectionType::types()` and `UnionType::types()` -* Added `UnionType::containsIntersectionTypes()` - -## [3.1.0] - 2022-08-29 - -### Added - -* [#21](https://github.com/sebastianbergmann/type/issues/21): Support `true` as stand-alone type - -## [3.0.0] - 2022-03-15 - -### Added - -* Support for intersection types introduced in PHP 8.1 -* Support for the `never` return type introduced in PHP 8.1 -* Added `Type::isCallable()`, `Type::isGenericObject()`, `Type::isIterable()`, `Type::isMixed()`, `Type::isNever()`, `Type::isNull()`, `Type::isObject()`, `Type::isSimple()`, `Type::isStatic()`, `Type::isUnion()`, `Type::isUnknown()`, and `Type::isVoid()` - -### Changed - -* Renamed `ReflectionMapper::fromMethodReturnType(ReflectionMethod $method)` to `ReflectionMapper::fromReturnType(ReflectionFunctionAbstract $functionOrMethod)` - -### Removed - -* Removed `Type::getReturnTypeDeclaration()` (use `Type::asString()` instead and prefix its result with `': '`) -* Removed `TypeName::getNamespaceName()` (use `TypeName::namespaceName()` instead) -* Removed `TypeName::getSimpleName()` (use `TypeName::simpleName()` instead) -* Removed `TypeName::getQualifiedName()` (use `TypeName::qualifiedName()` instead) - -## [2.3.4] - 2021-06-15 - -* Fixed regression introduced in 2.3.3 - -## [2.3.3] - 2021-06-15 [YANKED] - -### Fixed - -* [#15](https://github.com/sebastianbergmann/type/issues/15): "false" pseudo type is not handled properly - -## [2.3.2] - 2021-06-04 - -### Fixed - -* Fixed handling of tentatively declared return types - -## [2.3.1] - 2020-10-26 - -### Fixed - -* `SebastianBergmann\Type\Exception` now correctly extends `\Throwable` - -## [2.3.0] - 2020-10-06 - -### Added - -* [#14](https://github.com/sebastianbergmann/type/issues/14): Support for `static` return type that is introduced in PHP 8 - -## [2.2.2] - 2020-09-28 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.3 || ^8.0` to `>=7.3` - -## [2.2.1] - 2020-07-05 - -### Fixed - -* Fixed handling of `mixed` type in `ReflectionMapper::fromMethodReturnType()` - -## [2.2.0] - 2020-07-05 - -### Added - -* Added `MixedType` object for representing PHP 8's `mixed` type - -## [2.1.1] - 2020-06-26 - -### Added - -* This component is now supported on PHP 8 - -## [2.1.0] - 2020-06-01 - -### Added - -* Added `UnionType` object for representing PHP 8's Union Types -* Added `ReflectionMapper::fromMethodReturnType()` for mapping `\ReflectionMethod::getReturnType()` to a `Type` object -* Added `Type::name()` for retrieving the name of a type -* Added `Type::asString()` for retrieving a textual representation of a type - -### Changed - -* Deprecated `Type::getReturnTypeDeclaration()` (use `Type::asString()` instead and prefix its result with `': '`) -* Deprecated `TypeName::getNamespaceName()` (use `TypeName::namespaceName()` instead) -* Deprecated `TypeName::getSimpleName()` (use `TypeName::simpleName()` instead) -* Deprecated `TypeName::getQualifiedName()` (use `TypeName::qualifiedName()` instead) - -## [2.0.0] - 2020-02-07 - -### Removed - -* This component is no longer supported on PHP 7.2 - -## [1.1.3] - 2019-07-02 - -### Fixed - -* Fixed class name comparison in `ObjectType` to be case-insensitive - -## [1.1.2] - 2019-06-19 - -### Fixed - -* Fixed handling of `object` type - -## [1.1.1] - 2019-06-08 - -### Fixed - -* Fixed autoloading of `callback_function.php` fixture file - -## [1.1.0] - 2019-06-07 - -### Added - -* Added support for `callable` type -* Added support for `iterable` type - -## [1.0.0] - 2019-06-06 - -* Initial release based on [code contributed by Michel Hartmann to PHPUnit](https://github.com/sebastianbergmann/phpunit/pull/3673) - -[3.2.0]: https://github.com/sebastianbergmann/type/compare/3.1.0...3.2.0 -[3.1.0]: https://github.com/sebastianbergmann/type/compare/3.0.0...3.1.0 -[3.0.0]: https://github.com/sebastianbergmann/type/compare/2.3.4...3.0.0 -[2.3.4]: https://github.com/sebastianbergmann/type/compare/ca39369c41313ed12c071ed38ecda8fcdb248859...2.3.4 -[2.3.3]: https://github.com/sebastianbergmann/type/compare/2.3.2...ca39369c41313ed12c071ed38ecda8fcdb248859 -[2.3.2]: https://github.com/sebastianbergmann/type/compare/2.3.1...2.3.2 -[2.3.1]: https://github.com/sebastianbergmann/type/compare/2.3.0...2.3.1 -[2.3.0]: https://github.com/sebastianbergmann/type/compare/2.2.2...2.3.0 -[2.2.2]: https://github.com/sebastianbergmann/type/compare/2.2.1...2.2.2 -[2.2.1]: https://github.com/sebastianbergmann/type/compare/2.2.0...2.2.1 -[2.2.0]: https://github.com/sebastianbergmann/type/compare/2.1.1...2.2.0 -[2.1.1]: https://github.com/sebastianbergmann/type/compare/2.1.0...2.1.1 -[2.1.0]: https://github.com/sebastianbergmann/type/compare/2.0.0...2.1.0 -[2.0.0]: https://github.com/sebastianbergmann/type/compare/1.1.3...2.0.0 -[1.1.3]: https://github.com/sebastianbergmann/type/compare/1.1.2...1.1.3 -[1.1.2]: https://github.com/sebastianbergmann/type/compare/1.1.1...1.1.2 -[1.1.1]: https://github.com/sebastianbergmann/type/compare/1.1.0...1.1.1 -[1.1.0]: https://github.com/sebastianbergmann/type/compare/1.0.0...1.1.0 -[1.0.0]: https://github.com/sebastianbergmann/type/compare/ff74aa41746bd8d10e931843ebf37d42da513ede...1.0.0 diff --git a/vendor/sebastian/type/LICENSE b/vendor/sebastian/type/LICENSE deleted file mode 100644 index f4e4a328..00000000 --- a/vendor/sebastian/type/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -sebastian/type - -Copyright (c) 2019-2022, Sebastian Bergmann . -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 Sebastian Bergmann nor the names of his - 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/sebastian/type/README.md b/vendor/sebastian/type/README.md deleted file mode 100644 index 1036ce7a..00000000 --- a/vendor/sebastian/type/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# sebastian/type - -[![CI Status](https://github.com/sebastianbergmann/type/workflows/CI/badge.svg)](https://github.com/sebastianbergmann/type/actions) -[![Type Coverage](https://shepherd.dev/github/sebastianbergmann/type/coverage.svg)](https://shepherd.dev/github/sebastianbergmann/type) - -Collection of value objects that represent the types of the PHP type system. - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - -``` -composer require sebastian/type -``` - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - -``` -composer require --dev sebastian/type -``` diff --git a/vendor/sebastian/type/composer.json b/vendor/sebastian/type/composer.json deleted file mode 100644 index a0865c93..00000000 --- a/vendor/sebastian/type/composer.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "sebastian/type", - "description": "Collection of value objects that represent the types of the PHP type system", - "type": "library", - "homepage": "https://github.com/sebastianbergmann/type", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "support": { - "issues": "https://github.com/sebastianbergmann/type/issues" - }, - "prefer-stable": true, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.5" - }, - "config": { - "platform": { - "php": "7.3.0" - }, - "optimize-autoloader": true, - "sort-packages": true - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "autoload-dev": { - "classmap": [ - "tests/_fixture" - ], - "files": [ - "tests/_fixture/callback_function.php", - "tests/_fixture/functions_that_declare_return_types.php" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - } -} diff --git a/vendor/sebastian/type/src/Parameter.php b/vendor/sebastian/type/src/Parameter.php deleted file mode 100644 index 1adb061e..00000000 --- a/vendor/sebastian/type/src/Parameter.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. - */ -namespace SebastianBergmann\Type; - -final class Parameter -{ - /** - * @psalm-var non-empty-string - */ - private $name; - - /** - * @var Type - */ - private $type; - - /** - * @psalm-param non-empty-string $name - */ - public function __construct(string $name, Type $type) - { - $this->name = $name; - $this->type = $type; - } - - public function name(): string - { - return $this->name; - } - - public function type(): Type - { - return $this->type; - } -} diff --git a/vendor/sebastian/type/src/ReflectionMapper.php b/vendor/sebastian/type/src/ReflectionMapper.php deleted file mode 100644 index 32099b4b..00000000 --- a/vendor/sebastian/type/src/ReflectionMapper.php +++ /dev/null @@ -1,184 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type; - -use function assert; -use ReflectionFunctionAbstract; -use ReflectionIntersectionType; -use ReflectionMethod; -use ReflectionNamedType; -use ReflectionType; -use ReflectionUnionType; - -final class ReflectionMapper -{ - /** - * @psalm-return list - */ - public function fromParameterTypes(ReflectionFunctionAbstract $functionOrMethod): array - { - $parameters = []; - - foreach ($functionOrMethod->getParameters() as $parameter) { - $name = $parameter->getName(); - - assert($name !== ''); - - if (!$parameter->hasType()) { - $parameters[] = new Parameter($name, new UnknownType); - - continue; - } - - $type = $parameter->getType(); - - if ($type instanceof ReflectionNamedType) { - $parameters[] = new Parameter( - $name, - $this->mapNamedType($type, $functionOrMethod) - ); - - continue; - } - - if ($type instanceof ReflectionUnionType) { - $parameters[] = new Parameter( - $name, - $this->mapUnionType($type, $functionOrMethod) - ); - - continue; - } - - if ($type instanceof ReflectionIntersectionType) { - $parameters[] = new Parameter( - $name, - $this->mapIntersectionType($type, $functionOrMethod) - ); - } - } - - return $parameters; - } - - public function fromReturnType(ReflectionFunctionAbstract $functionOrMethod): Type - { - if (!$this->hasReturnType($functionOrMethod)) { - return new UnknownType; - } - - $returnType = $this->returnType($functionOrMethod); - - assert($returnType instanceof ReflectionNamedType || $returnType instanceof ReflectionUnionType || $returnType instanceof ReflectionIntersectionType); - - if ($returnType instanceof ReflectionNamedType) { - return $this->mapNamedType($returnType, $functionOrMethod); - } - - if ($returnType instanceof ReflectionUnionType) { - return $this->mapUnionType($returnType, $functionOrMethod); - } - - if ($returnType instanceof ReflectionIntersectionType) { - return $this->mapIntersectionType($returnType, $functionOrMethod); - } - } - - private function mapNamedType(ReflectionNamedType $type, ReflectionFunctionAbstract $functionOrMethod): Type - { - if ($functionOrMethod instanceof ReflectionMethod && $type->getName() === 'self') { - return ObjectType::fromName( - $functionOrMethod->getDeclaringClass()->getName(), - $type->allowsNull() - ); - } - - if ($functionOrMethod instanceof ReflectionMethod && $type->getName() === 'static') { - return new StaticType( - TypeName::fromReflection($functionOrMethod->getDeclaringClass()), - $type->allowsNull() - ); - } - - if ($type->getName() === 'mixed') { - return new MixedType; - } - - if ($functionOrMethod instanceof ReflectionMethod && $type->getName() === 'parent') { - return ObjectType::fromName( - $functionOrMethod->getDeclaringClass()->getParentClass()->getName(), - $type->allowsNull() - ); - } - - return Type::fromName( - $type->getName(), - $type->allowsNull() - ); - } - - private function mapUnionType(ReflectionUnionType $type, ReflectionFunctionAbstract $functionOrMethod): Type - { - $types = []; - - foreach ($type->getTypes() as $_type) { - assert($_type instanceof ReflectionNamedType || $_type instanceof ReflectionIntersectionType); - - if ($_type instanceof ReflectionNamedType) { - $types[] = $this->mapNamedType($_type, $functionOrMethod); - - continue; - } - - $types[] = $this->mapIntersectionType($_type, $functionOrMethod); - } - - return new UnionType(...$types); - } - - private function mapIntersectionType(ReflectionIntersectionType $type, ReflectionFunctionAbstract $functionOrMethod): Type - { - $types = []; - - foreach ($type->getTypes() as $_type) { - assert($_type instanceof ReflectionNamedType); - - $types[] = $this->mapNamedType($_type, $functionOrMethod); - } - - return new IntersectionType(...$types); - } - - private function hasReturnType(ReflectionFunctionAbstract $functionOrMethod): bool - { - if ($functionOrMethod->hasReturnType()) { - return true; - } - - if (!method_exists($functionOrMethod, 'hasTentativeReturnType')) { - return false; - } - - return $functionOrMethod->hasTentativeReturnType(); - } - - private function returnType(ReflectionFunctionAbstract $functionOrMethod): ?ReflectionType - { - if ($functionOrMethod->hasReturnType()) { - return $functionOrMethod->getReturnType(); - } - - if (!method_exists($functionOrMethod, 'getTentativeReturnType')) { - return null; - } - - return $functionOrMethod->getTentativeReturnType(); - } -} diff --git a/vendor/sebastian/type/src/TypeName.php b/vendor/sebastian/type/src/TypeName.php deleted file mode 100644 index 17d477cf..00000000 --- a/vendor/sebastian/type/src/TypeName.php +++ /dev/null @@ -1,83 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type; - -use function array_pop; -use function explode; -use function implode; -use function substr; -use ReflectionClass; - -final class TypeName -{ - /** - * @var ?string - */ - private $namespaceName; - - /** - * @var string - */ - private $simpleName; - - public static function fromQualifiedName(string $fullClassName): self - { - if ($fullClassName[0] === '\\') { - $fullClassName = substr($fullClassName, 1); - } - - $classNameParts = explode('\\', $fullClassName); - - $simpleName = array_pop($classNameParts); - $namespaceName = implode('\\', $classNameParts); - - return new self($namespaceName, $simpleName); - } - - public static function fromReflection(ReflectionClass $type): self - { - return new self( - $type->getNamespaceName(), - $type->getShortName() - ); - } - - public function __construct(?string $namespaceName, string $simpleName) - { - if ($namespaceName === '') { - $namespaceName = null; - } - - $this->namespaceName = $namespaceName; - $this->simpleName = $simpleName; - } - - public function namespaceName(): ?string - { - return $this->namespaceName; - } - - public function simpleName(): string - { - return $this->simpleName; - } - - public function qualifiedName(): string - { - return $this->namespaceName === null - ? $this->simpleName - : $this->namespaceName . '\\' . $this->simpleName; - } - - public function isNamespaced(): bool - { - return $this->namespaceName !== null; - } -} diff --git a/vendor/sebastian/type/src/exception/Exception.php b/vendor/sebastian/type/src/exception/Exception.php deleted file mode 100644 index e0e7ee57..00000000 --- a/vendor/sebastian/type/src/exception/Exception.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. - */ -namespace SebastianBergmann\Type; - -use Throwable; - -interface Exception extends Throwable -{ -} diff --git a/vendor/sebastian/type/src/exception/RuntimeException.php b/vendor/sebastian/type/src/exception/RuntimeException.php deleted file mode 100644 index 4dfea6a6..00000000 --- a/vendor/sebastian/type/src/exception/RuntimeException.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type; - -final class RuntimeException extends \RuntimeException implements Exception -{ -} diff --git a/vendor/sebastian/type/src/type/CallableType.php b/vendor/sebastian/type/src/type/CallableType.php deleted file mode 100644 index 553f1559..00000000 --- a/vendor/sebastian/type/src/type/CallableType.php +++ /dev/null @@ -1,204 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type; - -use function assert; -use function class_exists; -use function count; -use function explode; -use function function_exists; -use function is_array; -use function is_object; -use function is_string; -use Closure; -use ReflectionClass; -use ReflectionException; -use ReflectionObject; - -final class CallableType extends Type -{ - /** - * @var bool - */ - private $allowsNull; - - public function __construct(bool $nullable) - { - $this->allowsNull = $nullable; - } - - /** - * @throws RuntimeException - */ - public function isAssignable(Type $other): bool - { - if ($this->allowsNull && $other instanceof NullType) { - return true; - } - - if ($other instanceof self) { - return true; - } - - if ($other instanceof ObjectType) { - if ($this->isClosure($other)) { - return true; - } - - if ($this->hasInvokeMethod($other)) { - return true; - } - } - - if ($other instanceof SimpleType) { - if ($this->isFunction($other)) { - return true; - } - - if ($this->isClassCallback($other)) { - return true; - } - - if ($this->isObjectCallback($other)) { - return true; - } - } - - return false; - } - - public function name(): string - { - return 'callable'; - } - - public function allowsNull(): bool - { - return $this->allowsNull; - } - - /** - * @psalm-assert-if-true CallableType $this - */ - public function isCallable(): bool - { - return true; - } - - private function isClosure(ObjectType $type): bool - { - return !$type->className()->isNamespaced() && $type->className()->simpleName() === Closure::class; - } - - /** - * @throws RuntimeException - */ - private function hasInvokeMethod(ObjectType $type): bool - { - $className = $type->className()->qualifiedName(); - assert(class_exists($className)); - - try { - $class = new ReflectionClass($className); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new RuntimeException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - // @codeCoverageIgnoreEnd - } - - if ($class->hasMethod('__invoke')) { - return true; - } - - return false; - } - - private function isFunction(SimpleType $type): bool - { - if (!is_string($type->value())) { - return false; - } - - return function_exists($type->value()); - } - - private function isObjectCallback(SimpleType $type): bool - { - if (!is_array($type->value())) { - return false; - } - - if (count($type->value()) !== 2) { - return false; - } - - if (!is_object($type->value()[0]) || !is_string($type->value()[1])) { - return false; - } - - [$object, $methodName] = $type->value(); - - return (new ReflectionObject($object))->hasMethod($methodName); - } - - private function isClassCallback(SimpleType $type): bool - { - if (!is_string($type->value()) && !is_array($type->value())) { - return false; - } - - if (is_string($type->value())) { - if (strpos($type->value(), '::') === false) { - return false; - } - - [$className, $methodName] = explode('::', $type->value()); - } - - if (is_array($type->value())) { - if (count($type->value()) !== 2) { - return false; - } - - if (!is_string($type->value()[0]) || !is_string($type->value()[1])) { - return false; - } - - [$className, $methodName] = $type->value(); - } - - assert(isset($className) && is_string($className) && class_exists($className)); - assert(isset($methodName) && is_string($methodName)); - - try { - $class = new ReflectionClass($className); - - if ($class->hasMethod($methodName)) { - $method = $class->getMethod($methodName); - - return $method->isPublic() && $method->isStatic(); - } - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new RuntimeException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - // @codeCoverageIgnoreEnd - } - - return false; - } -} diff --git a/vendor/sebastian/type/src/type/FalseType.php b/vendor/sebastian/type/src/type/FalseType.php deleted file mode 100644 index f417fb69..00000000 --- a/vendor/sebastian/type/src/type/FalseType.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. - */ -namespace SebastianBergmann\Type; - -final class FalseType extends Type -{ - public function isAssignable(Type $other): bool - { - if ($other instanceof self) { - return true; - } - - return $other instanceof SimpleType && - $other->name() === 'bool' && - $other->value() === false; - } - - public function name(): string - { - return 'false'; - } - - public function allowsNull(): bool - { - return false; - } - - /** - * @psalm-assert-if-true FalseType $this - */ - public function isFalse(): bool - { - return true; - } -} diff --git a/vendor/sebastian/type/src/type/GenericObjectType.php b/vendor/sebastian/type/src/type/GenericObjectType.php deleted file mode 100644 index d06963f0..00000000 --- a/vendor/sebastian/type/src/type/GenericObjectType.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type; - -final class GenericObjectType extends Type -{ - /** - * @var bool - */ - private $allowsNull; - - public function __construct(bool $nullable) - { - $this->allowsNull = $nullable; - } - - public function isAssignable(Type $other): bool - { - if ($this->allowsNull && $other instanceof NullType) { - return true; - } - - if (!$other instanceof ObjectType) { - return false; - } - - return true; - } - - public function name(): string - { - return 'object'; - } - - public function allowsNull(): bool - { - return $this->allowsNull; - } - - /** - * @psalm-assert-if-true GenericObjectType $this - */ - public function isGenericObject(): bool - { - return true; - } -} diff --git a/vendor/sebastian/type/src/type/IntersectionType.php b/vendor/sebastian/type/src/type/IntersectionType.php deleted file mode 100644 index 4ac72ac9..00000000 --- a/vendor/sebastian/type/src/type/IntersectionType.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 SebastianBergmann\Type; - -use function array_unique; -use function assert; -use function count; -use function implode; -use function sort; - -final class IntersectionType extends Type -{ - /** - * @psalm-var non-empty-list - */ - private $types; - - /** - * @throws RuntimeException - */ - public function __construct(Type ...$types) - { - $this->ensureMinimumOfTwoTypes(...$types); - $this->ensureOnlyValidTypes(...$types); - $this->ensureNoDuplicateTypes(...$types); - - $this->types = $types; - } - - public function isAssignable(Type $other): bool - { - return $other->isObject(); - } - - public function asString(): string - { - return $this->name(); - } - - public function name(): string - { - $types = []; - - foreach ($this->types as $type) { - $types[] = $type->name(); - } - - sort($types); - - return implode('&', $types); - } - - public function allowsNull(): bool - { - return false; - } - - /** - * @psalm-assert-if-true IntersectionType $this - */ - public function isIntersection(): bool - { - return true; - } - - /** - * @psalm-return non-empty-list - */ - public function types(): array - { - return $this->types; - } - - /** - * @throws RuntimeException - */ - private function ensureMinimumOfTwoTypes(Type ...$types): void - { - if (count($types) < 2) { - throw new RuntimeException( - 'An intersection type must be composed of at least two types' - ); - } - } - - /** - * @throws RuntimeException - */ - private function ensureOnlyValidTypes(Type ...$types): void - { - foreach ($types as $type) { - if (!$type->isObject()) { - throw new RuntimeException( - 'An intersection type can only be composed of interfaces and classes' - ); - } - } - } - - /** - * @throws RuntimeException - */ - private function ensureNoDuplicateTypes(Type ...$types): void - { - $names = []; - - foreach ($types as $type) { - assert($type instanceof ObjectType); - - $names[] = $type->className()->qualifiedName(); - } - - if (count(array_unique($names)) < count($names)) { - throw new RuntimeException( - 'An intersection type must not contain duplicate types' - ); - } - } -} diff --git a/vendor/sebastian/type/src/type/IterableType.php b/vendor/sebastian/type/src/type/IterableType.php deleted file mode 100644 index 7b2a58fa..00000000 --- a/vendor/sebastian/type/src/type/IterableType.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 SebastianBergmann\Type; - -use function assert; -use function class_exists; -use function is_iterable; -use ReflectionClass; -use ReflectionException; - -final class IterableType extends Type -{ - /** - * @var bool - */ - private $allowsNull; - - public function __construct(bool $nullable) - { - $this->allowsNull = $nullable; - } - - /** - * @throws RuntimeException - */ - public function isAssignable(Type $other): bool - { - if ($this->allowsNull && $other instanceof NullType) { - return true; - } - - if ($other instanceof self) { - return true; - } - - if ($other instanceof SimpleType) { - return is_iterable($other->value()); - } - - if ($other instanceof ObjectType) { - $className = $other->className()->qualifiedName(); - assert(class_exists($className)); - - try { - return (new ReflectionClass($className))->isIterable(); - // @codeCoverageIgnoreStart - } catch (ReflectionException $e) { - throw new RuntimeException( - $e->getMessage(), - (int) $e->getCode(), - $e - ); - // @codeCoverageIgnoreEnd - } - } - - return false; - } - - public function name(): string - { - return 'iterable'; - } - - public function allowsNull(): bool - { - return $this->allowsNull; - } - - /** - * @psalm-assert-if-true IterableType $this - */ - public function isIterable(): bool - { - return true; - } -} diff --git a/vendor/sebastian/type/src/type/MixedType.php b/vendor/sebastian/type/src/type/MixedType.php deleted file mode 100644 index a1412e45..00000000 --- a/vendor/sebastian/type/src/type/MixedType.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type; - -final class MixedType extends Type -{ - public function isAssignable(Type $other): bool - { - return !$other instanceof VoidType; - } - - public function asString(): string - { - return 'mixed'; - } - - public function name(): string - { - return 'mixed'; - } - - public function allowsNull(): bool - { - return true; - } - - /** - * @psalm-assert-if-true MixedType $this - */ - public function isMixed(): bool - { - return true; - } -} diff --git a/vendor/sebastian/type/src/type/NeverType.php b/vendor/sebastian/type/src/type/NeverType.php deleted file mode 100644 index 6c144743..00000000 --- a/vendor/sebastian/type/src/type/NeverType.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 SebastianBergmann\Type; - -final class NeverType extends Type -{ - public function isAssignable(Type $other): bool - { - return $other instanceof self; - } - - public function name(): string - { - return 'never'; - } - - public function allowsNull(): bool - { - return false; - } - - /** - * @psalm-assert-if-true NeverType $this - */ - public function isNever(): bool - { - return true; - } -} diff --git a/vendor/sebastian/type/src/type/NullType.php b/vendor/sebastian/type/src/type/NullType.php deleted file mode 100644 index 93834eab..00000000 --- a/vendor/sebastian/type/src/type/NullType.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type; - -final class NullType extends Type -{ - public function isAssignable(Type $other): bool - { - return !($other instanceof VoidType); - } - - public function name(): string - { - return 'null'; - } - - public function asString(): string - { - return 'null'; - } - - public function allowsNull(): bool - { - return true; - } - - /** - * @psalm-assert-if-true NullType $this - */ - public function isNull(): bool - { - return true; - } -} diff --git a/vendor/sebastian/type/src/type/ObjectType.php b/vendor/sebastian/type/src/type/ObjectType.php deleted file mode 100644 index 44febb27..00000000 --- a/vendor/sebastian/type/src/type/ObjectType.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type; - -use function is_subclass_of; -use function strcasecmp; - -final class ObjectType extends Type -{ - /** - * @var TypeName - */ - private $className; - - /** - * @var bool - */ - private $allowsNull; - - public function __construct(TypeName $className, bool $allowsNull) - { - $this->className = $className; - $this->allowsNull = $allowsNull; - } - - public function isAssignable(Type $other): bool - { - if ($this->allowsNull && $other instanceof NullType) { - return true; - } - - if ($other instanceof self) { - if (0 === strcasecmp($this->className->qualifiedName(), $other->className->qualifiedName())) { - return true; - } - - if (is_subclass_of($other->className->qualifiedName(), $this->className->qualifiedName(), true)) { - return true; - } - } - - return false; - } - - public function name(): string - { - return $this->className->qualifiedName(); - } - - public function allowsNull(): bool - { - return $this->allowsNull; - } - - public function className(): TypeName - { - return $this->className; - } - - /** - * @psalm-assert-if-true ObjectType $this - */ - public function isObject(): bool - { - return true; - } -} diff --git a/vendor/sebastian/type/src/type/SimpleType.php b/vendor/sebastian/type/src/type/SimpleType.php deleted file mode 100644 index 4dce75da..00000000 --- a/vendor/sebastian/type/src/type/SimpleType.php +++ /dev/null @@ -1,104 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type; - -use function strtolower; - -final class SimpleType extends Type -{ - /** - * @var string - */ - private $name; - - /** - * @var bool - */ - private $allowsNull; - - /** - * @var mixed - */ - private $value; - - public function __construct(string $name, bool $nullable, $value = null) - { - $this->name = $this->normalize($name); - $this->allowsNull = $nullable; - $this->value = $value; - } - - public function isAssignable(Type $other): bool - { - if ($this->allowsNull && $other instanceof NullType) { - return true; - } - - if ($this->name === 'bool' && $other->name() === 'true') { - return true; - } - - if ($this->name === 'bool' && $other->name() === 'false') { - return true; - } - - if ($other instanceof self) { - return $this->name === $other->name; - } - - return false; - } - - public function name(): string - { - return $this->name; - } - - public function allowsNull(): bool - { - return $this->allowsNull; - } - - public function value() - { - return $this->value; - } - - /** - * @psalm-assert-if-true SimpleType $this - */ - public function isSimple(): bool - { - return true; - } - - private function normalize(string $name): string - { - $name = strtolower($name); - - switch ($name) { - case 'boolean': - return 'bool'; - - case 'real': - case 'double': - return 'float'; - - case 'integer': - return 'int'; - - case '[]': - return 'array'; - - default: - return $name; - } - } -} diff --git a/vendor/sebastian/type/src/type/StaticType.php b/vendor/sebastian/type/src/type/StaticType.php deleted file mode 100644 index cbc13f5f..00000000 --- a/vendor/sebastian/type/src/type/StaticType.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type; - -final class StaticType extends Type -{ - /** - * @var TypeName - */ - private $className; - - /** - * @var bool - */ - private $allowsNull; - - public function __construct(TypeName $className, bool $allowsNull) - { - $this->className = $className; - $this->allowsNull = $allowsNull; - } - - public function isAssignable(Type $other): bool - { - if ($this->allowsNull && $other instanceof NullType) { - return true; - } - - if (!$other instanceof ObjectType) { - return false; - } - - if (0 === strcasecmp($this->className->qualifiedName(), $other->className()->qualifiedName())) { - return true; - } - - if (is_subclass_of($other->className()->qualifiedName(), $this->className->qualifiedName(), true)) { - return true; - } - - return false; - } - - public function name(): string - { - return 'static'; - } - - public function allowsNull(): bool - { - return $this->allowsNull; - } - - /** - * @psalm-assert-if-true StaticType $this - */ - public function isStatic(): bool - { - return true; - } -} diff --git a/vendor/sebastian/type/src/type/TrueType.php b/vendor/sebastian/type/src/type/TrueType.php deleted file mode 100644 index 94e5be99..00000000 --- a/vendor/sebastian/type/src/type/TrueType.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. - */ -namespace SebastianBergmann\Type; - -final class TrueType extends Type -{ - public function isAssignable(Type $other): bool - { - if ($other instanceof self) { - return true; - } - - return $other instanceof SimpleType && - $other->name() === 'bool' && - $other->value() === true; - } - - public function name(): string - { - return 'true'; - } - - public function allowsNull(): bool - { - return false; - } - - /** - * @psalm-assert-if-true TrueType $this - */ - public function isTrue(): bool - { - return true; - } -} diff --git a/vendor/sebastian/type/src/type/Type.php b/vendor/sebastian/type/src/type/Type.php deleted file mode 100644 index e7536683..00000000 --- a/vendor/sebastian/type/src/type/Type.php +++ /dev/null @@ -1,226 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type; - -use const PHP_VERSION; -use function get_class; -use function gettype; -use function strtolower; -use function version_compare; - -abstract class Type -{ - public static function fromValue($value, bool $allowsNull): self - { - if ($allowsNull === false) { - if ($value === true) { - return new TrueType; - } - - if ($value === false) { - return new FalseType; - } - } - - $typeName = gettype($value); - - if ($typeName === 'object') { - return new ObjectType(TypeName::fromQualifiedName(get_class($value)), $allowsNull); - } - - $type = self::fromName($typeName, $allowsNull); - - if ($type instanceof SimpleType) { - $type = new SimpleType($typeName, $allowsNull, $value); - } - - return $type; - } - - public static function fromName(string $typeName, bool $allowsNull): self - { - if (version_compare(PHP_VERSION, '8.1.0-dev', '>=') && strtolower($typeName) === 'never') { - return new NeverType; - } - - switch (strtolower($typeName)) { - case 'callable': - return new CallableType($allowsNull); - - case 'true': - return new TrueType; - - case 'false': - return new FalseType; - - case 'iterable': - return new IterableType($allowsNull); - - case 'null': - return new NullType; - - case 'object': - return new GenericObjectType($allowsNull); - - case 'unknown type': - return new UnknownType; - - case 'void': - return new VoidType; - - case 'array': - case 'bool': - case 'boolean': - case 'double': - case 'float': - case 'int': - case 'integer': - case 'real': - case 'resource': - case 'resource (closed)': - case 'string': - return new SimpleType($typeName, $allowsNull); - - default: - return new ObjectType(TypeName::fromQualifiedName($typeName), $allowsNull); - } - } - - public function asString(): string - { - return ($this->allowsNull() ? '?' : '') . $this->name(); - } - - /** - * @psalm-assert-if-true CallableType $this - */ - public function isCallable(): bool - { - return false; - } - - /** - * @psalm-assert-if-true TrueType $this - */ - public function isTrue(): bool - { - return false; - } - - /** - * @psalm-assert-if-true FalseType $this - */ - public function isFalse(): bool - { - return false; - } - - /** - * @psalm-assert-if-true GenericObjectType $this - */ - public function isGenericObject(): bool - { - return false; - } - - /** - * @psalm-assert-if-true IntersectionType $this - */ - public function isIntersection(): bool - { - return false; - } - - /** - * @psalm-assert-if-true IterableType $this - */ - public function isIterable(): bool - { - return false; - } - - /** - * @psalm-assert-if-true MixedType $this - */ - public function isMixed(): bool - { - return false; - } - - /** - * @psalm-assert-if-true NeverType $this - */ - public function isNever(): bool - { - return false; - } - - /** - * @psalm-assert-if-true NullType $this - */ - public function isNull(): bool - { - return false; - } - - /** - * @psalm-assert-if-true ObjectType $this - */ - public function isObject(): bool - { - return false; - } - - /** - * @psalm-assert-if-true SimpleType $this - */ - public function isSimple(): bool - { - return false; - } - - /** - * @psalm-assert-if-true StaticType $this - */ - public function isStatic(): bool - { - return false; - } - - /** - * @psalm-assert-if-true UnionType $this - */ - public function isUnion(): bool - { - return false; - } - - /** - * @psalm-assert-if-true UnknownType $this - */ - public function isUnknown(): bool - { - return false; - } - - /** - * @psalm-assert-if-true VoidType $this - */ - public function isVoid(): bool - { - return false; - } - - abstract public function isAssignable(self $other): bool; - - abstract public function name(): string; - - abstract public function allowsNull(): bool; -} diff --git a/vendor/sebastian/type/src/type/UnionType.php b/vendor/sebastian/type/src/type/UnionType.php deleted file mode 100644 index 427729c5..00000000 --- a/vendor/sebastian/type/src/type/UnionType.php +++ /dev/null @@ -1,138 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type; - -use function count; -use function implode; -use function sort; - -final class UnionType extends Type -{ - /** - * @psalm-var non-empty-list - */ - private $types; - - /** - * @throws RuntimeException - */ - public function __construct(Type ...$types) - { - $this->ensureMinimumOfTwoTypes(...$types); - $this->ensureOnlyValidTypes(...$types); - - $this->types = $types; - } - - public function isAssignable(Type $other): bool - { - foreach ($this->types as $type) { - if ($type->isAssignable($other)) { - return true; - } - } - - return false; - } - - public function asString(): string - { - return $this->name(); - } - - public function name(): string - { - $types = []; - - foreach ($this->types as $type) { - if ($type->isIntersection()) { - $types[] = '(' . $type->name() . ')'; - - continue; - } - - $types[] = $type->name(); - } - - sort($types); - - return implode('|', $types); - } - - public function allowsNull(): bool - { - foreach ($this->types as $type) { - if ($type instanceof NullType) { - return true; - } - } - - return false; - } - - /** - * @psalm-assert-if-true UnionType $this - */ - public function isUnion(): bool - { - return true; - } - - public function containsIntersectionTypes(): bool - { - foreach ($this->types as $type) { - if ($type->isIntersection()) { - return true; - } - } - - return false; - } - - /** - * @psalm-return non-empty-list - */ - public function types(): array - { - return $this->types; - } - - /** - * @throws RuntimeException - */ - private function ensureMinimumOfTwoTypes(Type ...$types): void - { - if (count($types) < 2) { - throw new RuntimeException( - 'A union type must be composed of at least two types' - ); - } - } - - /** - * @throws RuntimeException - */ - private function ensureOnlyValidTypes(Type ...$types): void - { - foreach ($types as $type) { - if ($type instanceof UnknownType) { - throw new RuntimeException( - 'A union type must not be composed of an unknown type' - ); - } - - if ($type instanceof VoidType) { - throw new RuntimeException( - 'A union type must not be composed of a void type' - ); - } - } - } -} diff --git a/vendor/sebastian/type/src/type/UnknownType.php b/vendor/sebastian/type/src/type/UnknownType.php deleted file mode 100644 index dc274407..00000000 --- a/vendor/sebastian/type/src/type/UnknownType.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace SebastianBergmann\Type; - -final class UnknownType extends Type -{ - public function isAssignable(Type $other): bool - { - return true; - } - - public function name(): string - { - return 'unknown type'; - } - - public function asString(): string - { - return ''; - } - - public function allowsNull(): bool - { - return true; - } - - /** - * @psalm-assert-if-true UnknownType $this - */ - public function isUnknown(): bool - { - return true; - } -} diff --git a/vendor/sebastian/type/src/type/VoidType.php b/vendor/sebastian/type/src/type/VoidType.php deleted file mode 100644 index f740fe29..00000000 --- a/vendor/sebastian/type/src/type/VoidType.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 SebastianBergmann\Type; - -final class VoidType extends Type -{ - public function isAssignable(Type $other): bool - { - return $other instanceof self; - } - - public function name(): string - { - return 'void'; - } - - public function allowsNull(): bool - { - return false; - } - - /** - * @psalm-assert-if-true VoidType $this - */ - public function isVoid(): bool - { - return true; - } -} diff --git a/vendor/sebastian/version/.gitattributes b/vendor/sebastian/version/.gitattributes deleted file mode 100644 index 54b89530..00000000 --- a/vendor/sebastian/version/.gitattributes +++ /dev/null @@ -1,4 +0,0 @@ -/.github export-ignore -/.php_cs.dist export-ignore - -*.php diff=php diff --git a/vendor/sebastian/version/.gitignore b/vendor/sebastian/version/.gitignore deleted file mode 100644 index ff5ec9a0..00000000 --- a/vendor/sebastian/version/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/.php_cs.cache -/.idea diff --git a/vendor/sebastian/version/ChangeLog.md b/vendor/sebastian/version/ChangeLog.md deleted file mode 100644 index 10fd9a1a..00000000 --- a/vendor/sebastian/version/ChangeLog.md +++ /dev/null @@ -1,25 +0,0 @@ -# ChangeLog - -All notable changes are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. - -## [3.0.2] - 2020-09-28 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.3 || ^8.0` to `>=7.3` - -## [3.0.1] - 2020-06-26 - -### Added - -* This component is now supported on PHP 8 - -## [3.0.0] - 2020-01-21 - -### Removed - -* This component is no longer supported on PHP 7.1 and PHP 7.2 - -[3.0.2]: https://github.com/sebastianbergmann/version/compare/3.0.1...3.0.2 -[3.0.1]: https://github.com/sebastianbergmann/version/compare/3.0.0...3.0.1 -[3.0.0]: https://github.com/sebastianbergmann/version/compare/2.0.1...3.0.0 diff --git a/vendor/sebastian/version/LICENSE b/vendor/sebastian/version/LICENSE deleted file mode 100644 index aa6bca29..00000000 --- a/vendor/sebastian/version/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -Version - -Copyright (c) 2013-2020, Sebastian Bergmann . -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 Sebastian Bergmann nor the names of his - 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/sebastian/version/README.md b/vendor/sebastian/version/README.md deleted file mode 100644 index 2864c812..00000000 --- a/vendor/sebastian/version/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# Version - -**Version** is a library that helps with managing the version number of Git-hosted PHP projects. - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - - composer require sebastian/version - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - - composer require --dev sebastian/version - -## Usage - -The constructor of the `SebastianBergmann\Version` class expects two parameters: - -* `$release` is the version number of the latest release (`X.Y.Z`, for instance) or the name of the release series (`X.Y`) when no release has been made from that branch / for that release series yet. -* `$path` is the path to the directory (or a subdirectory thereof) where the sourcecode of the project can be found. Simply passing `__DIR__` here usually suffices. - -Apart from the constructor, the `SebastianBergmann\Version` class has a single public method: `getVersion()`. - -Here is a contrived example that shows the basic usage: - - getVersion()); - ?> - - string(18) "3.7.10-17-g00f3408" - -When a new release is prepared, the string that is passed to the constructor as the first argument needs to be updated. - -### How SebastianBergmann\Version::getVersion() works - -* If `$path` is not (part of) a Git repository and `$release` is in `X.Y.Z` format then `$release` is returned as-is. -* If `$path` is not (part of) a Git repository and `$release` is in `X.Y` format then `$release` is returned suffixed with `-dev`. -* If `$path` is (part of) a Git repository and `$release` is in `X.Y.Z` format then the output of `git describe --tags` is returned as-is. -* If `$path` is (part of) a Git repository and `$release` is in `X.Y` format then a string is returned that begins with `X.Y` and ends with information from `git describe --tags`. diff --git a/vendor/sebastian/version/composer.json b/vendor/sebastian/version/composer.json deleted file mode 100644 index e76dbf41..00000000 --- a/vendor/sebastian/version/composer.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "sebastian/version", - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "support": { - "issues": "https://github.com/sebastianbergmann/version/issues" - }, - "config": { - "platform": { - "php": "7.3.0" - }, - "optimize-autoloader": true, - "sort-packages": true - }, - "prefer-stable": true, - "require": { - "php": ">=7.3" - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - } -} diff --git a/vendor/sebastian/version/src/Version.php b/vendor/sebastian/version/src/Version.php deleted file mode 100644 index 53ae7894..00000000 --- a/vendor/sebastian/version/src/Version.php +++ /dev/null @@ -1,97 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann; - -final class Version -{ - /** - * @var string - */ - private $path; - - /** - * @var string - */ - private $release; - - /** - * @var string - */ - private $version; - - public function __construct(string $release, string $path) - { - $this->release = $release; - $this->path = $path; - } - - public function getVersion(): string - { - if ($this->version === null) { - if (\substr_count($this->release, '.') + 1 === 3) { - $this->version = $this->release; - } else { - $this->version = $this->release . '-dev'; - } - - $git = $this->getGitInformation($this->path); - - if ($git) { - if (\substr_count($this->release, '.') + 1 === 3) { - $this->version = $git; - } else { - $git = \explode('-', $git); - - $this->version = $this->release . '-' . \end($git); - } - } - } - - return $this->version; - } - - /** - * @return bool|string - */ - private function getGitInformation(string $path) - { - if (!\is_dir($path . DIRECTORY_SEPARATOR . '.git')) { - return false; - } - - $process = \proc_open( - 'git describe --tags', - [ - 1 => ['pipe', 'w'], - 2 => ['pipe', 'w'], - ], - $pipes, - $path - ); - - if (!\is_resource($process)) { - return false; - } - - $result = \trim(\stream_get_contents($pipes[1])); - - \fclose($pipes[1]); - \fclose($pipes[2]); - - $returnCode = \proc_close($process); - - if ($returnCode !== 0) { - return false; - } - - return $result; - } -} diff --git a/vendor/spatie/backtrace/.php-cs-fixer.dist.php b/vendor/spatie/backtrace/.php-cs-fixer.dist.php deleted file mode 100644 index 3de28fd4..00000000 --- a/vendor/spatie/backtrace/.php-cs-fixer.dist.php +++ /dev/null @@ -1,40 +0,0 @@ -in([ - __DIR__ . '/src', - __DIR__ . '/tests', - ]) - ->name('*.php') - ->notName('*.blade.php') - ->ignoreDotFiles(true) - ->ignoreVCS(true); - -return (new PhpCsFixer\Config()) - ->setRules([ - '@PSR2' => true, - 'array_syntax' => ['syntax' => 'short'], - 'ordered_imports' => ['sort_algorithm' => 'alpha'], - 'no_unused_imports' => true, - 'not_operator_with_successor_space' => true, - 'trailing_comma_in_multiline' => true, - 'phpdoc_scalar' => true, - 'unary_operator_spaces' => true, - 'binary_operator_spaces' => true, - 'blank_line_before_statement' => [ - 'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'], - ], - 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_var_without_name' => true, - 'class_attributes_separation' => [ - 'elements' => [ - 'method' => 'one', - ], - ], - 'method_argument_space' => [ - 'on_multiline' => 'ensure_fully_multiline', - 'keep_multiple_spaces_after_comma' => true, - ], - 'single_trait_insert_per_statement' => true, - ]) - ->setFinder($finder); diff --git a/vendor/spatie/backtrace/CHANGELOG.md b/vendor/spatie/backtrace/CHANGELOG.md deleted file mode 100644 index 7f5c9dc5..00000000 --- a/vendor/spatie/backtrace/CHANGELOG.md +++ /dev/null @@ -1,23 +0,0 @@ -# Changelog - -All notable changes to `backtrace` will be documented in this file - -## 1.2.1 - 2021-11-09 - -- Add a return typehint (#4) - -## 1.2.0 - 2021-05-19 - -- add `firstApplicationFrameIndex` - -## 1.1.0 - 2021-01-29 - -- add `snippetProperties` - -## 1.0.1 - 2021-01-27 - -- add support for PHP 7.3 - -## 1.0.0 - 2020-11-24 - -- initial release diff --git a/vendor/spatie/backtrace/LICENSE.md b/vendor/spatie/backtrace/LICENSE.md deleted file mode 100644 index 59e5ec59..00000000 --- a/vendor/spatie/backtrace/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Spatie bvba - -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/spatie/backtrace/README.md b/vendor/spatie/backtrace/README.md deleted file mode 100644 index 9df948e0..00000000 --- a/vendor/spatie/backtrace/README.md +++ /dev/null @@ -1,157 +0,0 @@ -# A better PHP backtrace - -[![Latest Version on Packagist](https://img.shields.io/packagist/v/spatie/backtrace.svg?style=flat-square)](https://packagist.org/packages/spatie/backtrace) -![Tests](https://github.com/spatie/backtrace/workflows/Tests/badge.svg) -[![Total Downloads](https://img.shields.io/packagist/dt/spatie/backtrace.svg?style=flat-square)](https://packagist.org/packages/spatie/backtrace) - -To get the backtrace in PHP you can use the `debug_backtrace` function. By default, it can be hard to work with. The -reported function name for a frame is skewed: it belongs to the previous frame. Also, options need to be passed using a bitmask. - -This package provides a better way than `debug_backtrace` to work with a back trace. Here's an example: - -```php -// returns an array with `Spatie\Backtrace\Frame` instances -$frames = Spatie\Backtrace\Backtrace::create()->frames(); - -$firstFrame = $frames[0]; - -$firstFrame->file; // returns the file name -$firstFrame->lineNumber; // returns the line number -$firstFrame->class; // returns the class name -``` - -## Support us - -[](https://spatie.be/github-ad-click/backtrace) - -We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can -support us by [buying one of our paid products](https://spatie.be/open-source/support-us). - -We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. -You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards -on [our virtual postcard wall](https://spatie.be/open-source/postcards). - -## Installation - -You can install the package via composer: - -```bash -composer require spatie/backtrace -``` - -## Usage - -This is how you can create a backtrace instance: - -```php -$backtrace = Spatie\Backtrace\Backtrace::create(); -``` - -### Getting the frames - -To get all the frames you can call `frames`. - -```php -$frames = $backtrace->frames(); // contains an array with `Spatie\Backtrace\Frame` instances -``` - -A `Spatie\Backtrace\Frame` has these properties: - -- `file`: the name of the file -- `lineNumber`: the line number -- `arguments`: the arguments used for this frame. Will be `null` if `withArguments` was not used. -- `class`: the class name for this frame. Will be `null` if the frame concerns a function. -- `method`: the method used in this frame -- `applicationFrame`: contains `true` is this frame belongs to your application, and `false` if it belongs to a file in - the vendor directory - -### Collecting arguments - -For performance reasons, the frames of the back trace will not contain the arguments of the called functions. If you -want to add those use the `withArguments` method. - -```php -$backtrace = Spatie\Backtrace\Backtrace::create()->withArguments(); -``` - -### Setting the application path - -You can use the `applicationPath` to pass the base path of your app. This value will be used to determine whether a -frame is an application frame, or a vendor frame. Here's an example using a Laravel specific function. - -```php -$backtrace = Spatie\Backtrace\Backtrace::create()->applicationPath(base_path()); -``` - -### Getting a certain part of a trace - -If you only want to have the frames starting from a particular frame in the backtrace you can use -the `startingFromFrame` method: - -```php -use Spatie\Backtrace\Backtrace; -use Spatie\Backtrace\Frame; - -$frames = Backtrace::create() - ->startingFromFrame(function (Frame $frame) { - return $frame->class === MyClass::class; - }) - ->frames(); -``` - -With this code, all frames before the frame that concerns `MyClass` will have been filtered out. - -Alternatively, you can use the `offSet` method, which will skip the given number of frames. In this example the first 2 frames will not end up in `$frames`. - -```php -$frames = Spatie\Backtrace\Backtrace::create() - ->offset(2) - ->frames(); -``` - -### Limiting the number of frames - -To only get a specific number of frames use the `limit` function. In this example, we'll only get the first two frames. - -```php -$frames = Spatie\Backtrace\Backtrace::create() - ->limit(2) - ->frames(); -``` - -### Getting a backtrace for a throwable - -Here's how you can get a backtrace for a throwable. - -```php -$frames = Spatie\Backtrace\Backtrace::createForThrowable($throwable) -``` - -Because we will use the backtrace that is already available the throwable, the frames will always contain the arguments used. - -## Testing - -``` bash -composer test -``` - -## Changelog - -Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. - -## Contributing - -Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details. - -## Security Vulnerabilities - -Please review [our security policy](../../security/policy) on how to report security vulnerabilities. - -## Credits - -- [Freek Van de Herten](https://github.com/freekmurze) -- [All Contributors](../../contributors) - -## License - -The MIT License (MIT). Please see [License File](LICENSE.md) for more information. diff --git a/vendor/spatie/backtrace/composer.json b/vendor/spatie/backtrace/composer.json deleted file mode 100644 index 2c538341..00000000 --- a/vendor/spatie/backtrace/composer.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "name": "spatie/backtrace", - "description": "A better backtrace", - "keywords": [ - "spatie", - "backtrace" - ], - "homepage": "https://github.com/spatie/backtrace", - "license": "MIT", - "authors": [ - { - "name": "Freek Van de Herten", - "email": "freek@spatie.be", - "homepage": "https://spatie.be", - "role": "Developer" - } - ], - "require": { - "php": "^7.3|^8.0" - }, - "require-dev": { - "ext-json": "*", - "phpunit/phpunit": "^9.3", - "symfony/var-dumper": "^5.1" - }, - "autoload": { - "psr-4": { - "Spatie\\Backtrace\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "Spatie\\Backtrace\\Tests\\": "tests" - } - }, - "scripts": { - "psalm": "vendor/bin/psalm", - "test": "vendor/bin/phpunit", - "test-coverage": "vendor/bin/phpunit --coverage-html coverage", - "format": "vendor/bin/php-cs-fixer fix --allow-risky=yes" - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev", - "prefer-stable": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/spatie" - }, - { - "type": "other", - "url": "https://spatie.be/open-source/support-us" - } - ] -} diff --git a/vendor/spatie/backtrace/src/Backtrace.php b/vendor/spatie/backtrace/src/Backtrace.php deleted file mode 100644 index c9007316..00000000 --- a/vendor/spatie/backtrace/src/Backtrace.php +++ /dev/null @@ -1,219 +0,0 @@ -forThrowable($throwable); - } - - protected function forThrowable(Throwable $throwable): self - { - $this->throwable = $throwable; - - return $this; - } - - public function withArguments(): self - { - $this->withArguments = true; - - return $this; - } - - public function withObject(): self - { - $this->withObject = true; - - return $this; - } - - public function applicationPath(string $applicationPath): self - { - $this->applicationPath = $applicationPath; - - return $this; - } - - public function offset(int $offset): self - { - $this->offset = $offset; - - return $this; - } - - public function limit(int $limit): self - { - $this->limit = $limit; - - return $this; - } - - public function startingFromFrame(Closure $startingFromFrameClosure) - { - $this->startingFromFrameClosure = $startingFromFrameClosure; - - return $this; - } - - /** - * @return \Spatie\Backtrace\Frame[] - */ - public function frames(): array - { - $rawFrames = $this->getRawFrames(); - - return $this->toFrameObjects($rawFrames); - } - - public function firstApplicationFrameIndex(): ?int - { - foreach ($this->frames() as $index => $frame) { - if ($frame->applicationFrame) { - return $index; - } - } - - return null; - } - - protected function getRawFrames(): array - { - if ($this->throwable) { - return $this->throwable->getTrace(); - } - - $options = null; - - if (! $this->withArguments) { - $options = $options | DEBUG_BACKTRACE_IGNORE_ARGS; - } - - if ($this->withObject()) { - $options = $options | DEBUG_BACKTRACE_PROVIDE_OBJECT; - } - - $limit = $this->limit; - - if ($limit !== 0) { - $limit += 3; - } - - return debug_backtrace($options, $limit); - } - - /** - * @return \Spatie\Backtrace\Frame[] - */ - protected function toFrameObjects(array $rawFrames): array - { - $currentFile = $this->throwable ? $this->throwable->getFile() : ''; - $currentLine = $this->throwable ? $this->throwable->getLine() : 0; - - $frames = []; - - foreach ($rawFrames as $rawFrame) { - $frames[] = new Frame( - $currentFile, - $currentLine, - $rawFrame['args'] ?? null, - $rawFrame['function'] ?? null, - $rawFrame['class'] ?? null, - $this->isApplicationFrame($currentFile) - ); - - $currentFile = $rawFrame['file'] ?? 'unknown'; - $currentLine = $rawFrame['line'] ?? 0; - } - - $frames[] = new Frame( - $currentFile, - $currentLine, - [], - '[top]' - ); - - $frames = $this->removeBacktracePackageFrames($frames); - - if ($closure = $this->startingFromFrameClosure) { - $frames = $this->startAtFrameFromClosure($frames, $closure); - } - $frames = array_slice($frames, $this->offset, $this->limit === 0 ? PHP_INT_MAX : $this->limit); - - return array_values($frames); - } - - protected function isApplicationFrame(string $frameFilename): bool - { - $relativeFile = str_replace('\\', DIRECTORY_SEPARATOR, $frameFilename); - - if (! empty($this->applicationPath)) { - $relativeFile = array_reverse(explode($this->applicationPath ?? '', $frameFilename, 2))[0]; - } - - if (strpos($relativeFile, DIRECTORY_SEPARATOR . 'vendor') === 0) { - return false; - } - - return true; - } - - protected function removeBacktracePackageFrames(array $frames): array - { - return $this->startAtFrameFromClosure($frames, function (Frame $frame) { - return $frame->class !== static::class; - }); - } - - /** - * @param \Spatie\Backtrace\Frame[] $frames - * @param \Closure $closure - * - * @return array - */ - protected function startAtFrameFromClosure(array $frames, Closure $closure): array - { - foreach ($frames as $i => $frame) { - $foundStartingFrame = $closure($frame); - - if ($foundStartingFrame) { - return $frames; - } - - unset($frames[$i]); - } - - return $frames; - } -} diff --git a/vendor/spatie/backtrace/src/CodeSnippet.php b/vendor/spatie/backtrace/src/CodeSnippet.php deleted file mode 100644 index 0fea5ffc..00000000 --- a/vendor/spatie/backtrace/src/CodeSnippet.php +++ /dev/null @@ -1,72 +0,0 @@ -surroundingLine = $surroundingLine; - - return $this; - } - - public function snippetLineCount(int $snippetLineCount): self - { - $this->snippetLineCount = $snippetLineCount; - - return $this; - } - - public function get(string $fileName): array - { - if (! file_exists($fileName)) { - return []; - } - - try { - $file = new File($fileName); - - [$startLineNumber, $endLineNumber] = $this->getBounds($file->numberOfLines()); - - $code = []; - - $line = $file->getLine($startLineNumber); - - $currentLineNumber = $startLineNumber; - - while ($currentLineNumber <= $endLineNumber) { - $code[$currentLineNumber] = rtrim(substr($line, 0, 250)); - - $line = $file->getNextLine(); - $currentLineNumber++; - } - - return $code; - } catch (RuntimeException $exception) { - return []; - } - } - - protected function getBounds(int $totalNumberOfLineInFile): array - { - $startLine = max($this->surroundingLine - floor($this->snippetLineCount / 2), 1); - - $endLine = $startLine + ($this->snippetLineCount - 1); - - if ($endLine > $totalNumberOfLineInFile) { - $endLine = $totalNumberOfLineInFile; - $startLine = max($endLine - ($this->snippetLineCount - 1), 1); - } - - return [$startLine, $endLine]; - } -} diff --git a/vendor/spatie/backtrace/src/File.php b/vendor/spatie/backtrace/src/File.php deleted file mode 100644 index 6f1bbd2b..00000000 --- a/vendor/spatie/backtrace/src/File.php +++ /dev/null @@ -1,41 +0,0 @@ -file = new SplFileObject($path); - } - - public function numberOfLines(): int - { - $this->file->seek(PHP_INT_MAX); - - return $this->file->key() + 1; - } - - public function getLine(int $lineNumber = null): string - { - if (is_null($lineNumber)) { - return $this->getNextLine(); - } - - $this->file->seek($lineNumber - 1); - - return $this->file->current(); - } - - public function getNextLine(): string - { - $this->file->next(); - - return $this->file->current(); - } -} diff --git a/vendor/spatie/backtrace/src/Frame.php b/vendor/spatie/backtrace/src/Frame.php deleted file mode 100644 index 2e75f9ca..00000000 --- a/vendor/spatie/backtrace/src/Frame.php +++ /dev/null @@ -1,65 +0,0 @@ -file = $file; - - $this->lineNumber = $lineNumber; - - $this->arguments = $arguments; - - $this->method = $method; - - $this->class = $class; - - $this->applicationFrame = $isApplicationFrame; - } - - public function getSnippet(int $lineCount): array - { - return (new CodeSnippet()) - ->surroundingLine($this->lineNumber) - ->snippetLineCount($lineCount) - ->get($this->file); - } - - public function getSnippetProperties(int $lineCount): array - { - $snippet = $this->getSnippet($lineCount); - - return array_map(function (int $lineNumber) use ($snippet) { - return [ - 'line_number' => $lineNumber, - 'text' => $snippet[$lineNumber], - ]; - }, array_keys($snippet)); - } -} diff --git a/vendor/spatie/laravel-package-tools/LICENSE.md b/vendor/spatie/laravel-package-tools/LICENSE.md deleted file mode 100644 index cfe14134..00000000 --- a/vendor/spatie/laravel-package-tools/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) spatie - -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/spatie/laravel-package-tools/README.md b/vendor/spatie/laravel-package-tools/README.md deleted file mode 100644 index 23aabc4a..00000000 --- a/vendor/spatie/laravel-package-tools/README.md +++ /dev/null @@ -1,519 +0,0 @@ -# Tools for creating Laravel packages - -[![Latest Version on Packagist](https://img.shields.io/packagist/v/spatie/laravel-package-tools.svg?style=flat-square)](https://packagist.org/packages/spatie/laravel-package-tools) -![Tests](https://github.com/spatie/laravel-package-tools/workflows/Tests/badge.svg) -[![Total Downloads](https://img.shields.io/packagist/dt/spatie/laravel-package-tools.svg?style=flat-square)](https://packagist.org/packages/spatie/laravel-package-tools) - -This package contains a `PackageServiceProvider` that you can use in your packages to easily register config files, -migrations, and more. - -Here's an example of how it can be used. - -```php -use Spatie\LaravelPackageTools\PackageServiceProvider; -use Spatie\LaravelPackageTools\Package; -use MyPackage\ViewComponents\Alert; -use Spatie\LaravelPackageTools\Commands\InstallCommand; - -class YourPackageServiceProvider extends PackageServiceProvider -{ - public function configurePackage(Package $package): void - { - $package - ->name('your-package-name') - ->hasConfigFile() - ->hasViews() - ->hasViewComponent('spatie', Alert::class) - ->hasViewComposer('*', MyViewComposer::class) - ->sharesDataWithAllViews('downloads', 3) - ->hasTranslations() - ->hasAssets() - ->publishesServiceProvider('MyProviderName') - ->hasRoute('web') - ->hasMigration('create_package_tables') - ->hasCommand(YourCoolPackageCommand::class) - ->hasInstallCommand(function(InstallCommand $command) { - $command - ->publishConfigFile() - ->publishMigrations() - ->copyAndRegisterServiceProviderInApp() - ->askToStarRepoOnGitHub(); - }); - } -} -``` - -Under the hood it will do the necessary work to register the necessary things and make all sorts of files publishable. - -## Support us - -[](https://spatie.be/github-ad-click/laravel-package-tools) - -We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can -support us by [buying one of our paid products](https://spatie.be/open-source/support-us). - -We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. -You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards -on [our virtual postcard wall](https://spatie.be/open-source/postcards). - -## Getting started - -This package is opinionated on how you should structure your package. To get started easily, consider -using [our package-skeleton repo](https://github.com/spatie/package-skeleton-laravel) to start your package. The -skeleton is structured perfectly to work perfectly with the `PackageServiceProvider` in this package. - -## Usage - -In your package you should let your service provider extend `Spatie\LaravelPackageTools\PackageServiceProvider`. - -```php -use Spatie\LaravelPackageTools\PackageServiceProvider; -use Spatie\LaravelPackageTools\Package; - -class YourPackageServiceProvider extends PackageServiceProvider -{ - public function configurePackage(Package $package) : void - { - $package->name('your-package-name'); - } -} -``` - -Passing the package name to `name` is mandatory. - -### Working with a config file - -To register a config file, you should create a php file with your package name in the `config` directory of your -package. In this example it should be at `/config/your-package-name.php`. - -If your package name starts with `laravel-`, we expect that your config file does not contain that prefix. So if your -package name is `laravel-cool-package`, the config file should be named `cool-package.php`. - -To register that config file, call `hasConfigFile()` on `$package` in the `configurePackage` method. - -```php -$package - ->name('your-package-name') - ->hasConfigFile(); -``` - -The `hasConfigFile` method will also make the config file publishable. Users of your package will be able to publish the -config file with this command. - -```bash -php artisan vendor:publish --tag=your-package-name-config -``` - -Should your package have multiple config files, you can pass their names as an array to `hasConfigFile` - -```php -$package - ->name('your-package-name') - ->hasConfigFile(['my-config-file', 'another-config-file']); -``` - -### Working with views - -Any views your package provides, should be placed in the `/resources/views` directory. - -You can register these views with the `hasViews` command. - -```php -$package - ->name('your-package-name') - ->hasViews(); -``` - -This will register your views with Laravel. - -If you have a view `/resources/views/myView.blade.php`, you can use it like -this: `view('your-package-name::myView')`. Of course, you can also use subdirectories to organise your views. A view -located at `/resources/views/subdirectory/myOtherView.blade.php` can be used -with `view('your-package-name::subdirectory.myOtherView')`. - -#### Using a custom view namespace - -You can pass a custom view namespace to the `hasViews` method. - -```php -$package - ->name('your-package-name') - ->hasViews('custom-view-namespace'); -``` - -You can now use the views of the package like this: - -```php -view('custom-view-namespace::myView'); -``` - -#### Publishing the views - -Calling `hasViews` will also make views publishable. Users of your package will be able to publish the views with this -command: - -```bash -php artisan vendor:publish --tag=your-package-name-views -``` - -> **Note:** -> -> If you use custom view namespace then you should change your publish command like this: -```bash -php artisan vendor:publish --tag=custom-view-namespace-views -``` - - -### Sharing global data with views - -You can share data with all views using the `sharesDataWithAllViews` method. This will make the shared variable -available to all views. - -```php -$package - ->name('your-package-name') - ->sharesDataWithAllViews('companyName', 'Spatie'); -``` - -### Working with Blade view components - -Any Blade view components that your package provides should be placed in the `/src/Components` directory. - -You can register these views with the `hasViewComponents` command. - -```php -$package - ->name('your-package-name') - ->hasViewComponents('spatie', Alert::class); -``` - -This will register your view components with Laravel. In the case of `Alert::class`, it can be referenced in views -as ``, where `spatie` is the prefix you provided during registration. - -Calling `hasViewComponents` will also make view components publishable, and will be published -to `app/Views/Components/vendor/`. - -Users of your package will be able to publish the view components with this command: - -```bash -php artisan vendor:publish --tag=your-package-name-components -``` - -### Working with view composers - -You can register any view composers that your project uses with the `hasViewComposers` method. You may also register a -callback that receives a `$view` argument instead of a classname. - -To register a view composer with all views, use an asterisk as the view name `'*'`. - -```php -$package - ->name('your-package-name') - ->hasViewComposer('viewName', MyViewComposer::class) - ->hasViewComposer('*', function($view) { - $view->with('sharedVariable', 123); - }); -``` - -### Working with translations - -Any translations your package provides, should be placed in the `/resources/lang/` -directory. - -You can register these translations with the `hasTranslations` command. - -```php -$package - ->name('your-package-name') - ->hasTranslations(); -``` - -This will register the translations with Laravel. - -Assuming you save this translation file at `/resources/lang/en/translations.php`... - -```php -return [ - 'translatable' => 'translation', -]; -``` - -... your package and users will be able to retrieve the translation with: - -```php -trans('your-package-name::translations.translatable'); // returns 'translation' -``` - -If your package name starts with `laravel-` then you should leave that off in the example above. - -Coding with translation strings as keys, you should create JSON files -in `/resources/lang/.json`. - -For example, creating `/resources/lang/it.json` file like so: - -```json -{ - "Hello!": "Ciao!" -} -``` - -...the output of... - -```php -trans('Hello!'); -``` - -...will be `Ciao!` if the application uses the Italian language. - -Calling `hasTranslations` will also make translations publishable. Users of your package will be able to publish the -translations with this command: - -```bash -php artisan vendor:publish --tag=your-package-name-translations -``` - -### Working with assets - -Any assets your package provides, should be placed in the `/resources/dist/` directory. - -You can make these assets publishable the `hasAssets` method. - -```php -$package - ->name('your-package-name') - ->hasAssets(); -``` - -Users of your package will be able to publish the assets with this command: - -```bash -php artisan vendor:publish --tag=your-package-name-assets -``` - -This will copy over the assets to the `public/vendor/` directory in the app where your package is -installed in. - -### Working with migrations - -The `PackageServiceProvider` assumes that any migrations are placed in this -directory: `/database/migrations`. Inside that directory you can put any migrations. - -To register your migration, you should pass its name without the extension to the `hasMigration` table. - -If your migration file is called `create_my_package_tables.php.stub` you can register them like this: - -```php -$package - ->name('your-package-name') - ->hasMigration('create_my_package_tables'); -``` - -Should your package contain multiple migration files, you can just call `hasMigration` multiple times or -use `hasMigrations`. - -```php -$package - ->name('your-package-name') - ->hasMigrations(['my_package_tables', 'some_other_migration']); -``` - -Calling `hasMigration` will also make migrations publishable. Users of your package will be able to publish the -migrations with this command: - -```bash -php artisan vendor:publish --tag=your-package-name-migrations -``` - -Like you might expect, published migration files will be prefixed with the current datetime. - -You can also enable the migrations to be registered without needing the users of your package to publish them: - -```php -$package - ->name('your-package-name') - ->hasMigrations(['my_package_tables', 'some_other_migration']) - ->runsMigrations(); -``` - -### Working with a publishable service provider - -Some packages need an example service provider to be copied into the `app\Providers` directory of the Laravel app. Think -of for instance, the `laravel/horizon` package that copies an `HorizonServiceProvider` into your app with some sensible -defaults. - -```php -$package - ->name('your-package-name') - ->publishesServiceProvider($nameOfYourServiceProvider); -``` - -The file that will be copied to the app should be stored in your package -in `/resources/stubs/{$nameOfYourServiceProvider}.php.stub`. - -When your package is installed into an app, running this command... - -```bash -php artisan vendor:publish --tag=your-package-name-provider -``` - -... will copy `/resources/stubs/{$nameOfYourServiceProvider}.php` in your package -to `app/Providers/{$nameOfYourServiceProvider}.php` in the app of the user. - -### Registering commands - -You can register any command you package provides with the `hasCommand` function. - -```php -$package - ->name('your-package-name') - ->hasCommand(YourCoolPackageCommand::class); -```` - -If your package provides multiple commands, you can either use `hasCommand` multiple times, or pass an array -to `hasCommands` - -```php -$package - ->name('your-package-name') - ->hasCommands([ - YourCoolPackageCommand::class, - YourOtherCoolPackageCommand::class, - ]); -``` - -### Adding an installer command - -Instead of letting your users manually publishing config files, migrations, and other files manually, you could opt to -add an install command that does all this work in one go. Packages like Laravel Horizon and Livewire provide such -commands. - -When using Laravel Package Tools, you don't have to write an `InstallCommand` yourself. Instead, you can simply -call, `hasInstallCommand` and configure it using a closure. Here's an example. - -```php -use Spatie\LaravelPackageTools\PackageServiceProvider; -use Spatie\LaravelPackageTools\Package; -use Spatie\LaravelPackageTools\Commands\InstallCommand; - -class YourPackageServiceProvider extends PackageServiceProvider -{ - public function configurePackage(Package $package): void - { - $package - ->name('your-package-name') - ->hasConfigFile() - ->hasMigration('create_package_tables') - ->publishesServiceProvider('MyServiceProviderName') - ->hasInstallCommand(function(InstallCommand $command) { - $command - ->publishConfigFile() - ->publishMigrations() - ->askToRunMigrations() - ->copyAndRegisterServiceProviderInApp() - ->askToStarRepoOnGitHub('your-vendor/your-repo-name') - }); - } -} -``` - -With this in place, the package user can call this command: - -```bash -php artisan your-package-name:install -``` - -Using the code above, that command will: - -- publish the config file -- publish the migrations -- copy the `/resources/stubs/MyProviderName.php.stub` from your package to `app/Providers/MyServiceProviderName.php`, and also register that - provider in `config/app.php` -- ask if migrations should be run now -- prompt the user to open up `https://github.com/'your-vendor/your-repo-name'` in the browser in order to star it - -You can also call `startWith` and `endWith` on the `InstallCommand`. They will respectively be executed at the start and -end when running `php artisan your-package-name:install`. You can use this to perform extra work or display extra -output. - -```php -use use Spatie\LaravelPackageTools\Commands\InstallCommand; - -public function configurePackage(Package $package): void -{ - $package - // ... configure package - ->hasInstallCommand(function(InstallCommand $command) { - $command - ->startWith(function(InstallCommand $command) { - $command->info('Hello, and welcome to my great new package!') - }) - ->publishConfigFile() - ->publishMigrations() - ->askToRunMigrations() - ->copyAndRegisterServiceProviderInApp() - ->askToStarRepoOnGitHub('your-vendor/your-repo-name') - ->endWith(function(InstallCommand $command) { - $command->info('Have a great day!'); - }) - }); -} -``` - -### Working with routes - -The `PackageServiceProvider` assumes that any route files are placed in this directory: `/routes`. Inside -that directory you can put any route files. - -To register your route, you should pass its name without the extension to the `hasRoute` method. - -If your route file is called `web.php` you can register them like this: - -```php -$package - ->name('your-package-name') - ->hasRoute('web'); -``` - -Should your package contain multiple route files, you can just call `hasRoute` multiple times or use `hasRoutes`. - -```php -$package - ->name('your-package-name') - ->hasRoutes(['web', 'admin']); -``` - -### Using lifecycle hooks - -You can put any custom logic your package needs while starting up in one of these methods: - -- `registeringPackage`: will be called at the start of the `register` method of `PackageServiceProvider` -- `packageRegistered`: will be called at the end of the `register` method of `PackageServiceProvider` -- `bootingPackage`: will be called at the start of the `boot` method of `PackageServiceProvider` -- `packageBooted`: will be called at the end of the `boot` method of `PackageServiceProvider` - -## Testing - -```bash -composer test -``` - -## Changelog - -Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. - -## Contributing - -Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details. - -## Security Vulnerabilities - -Please review [our security policy](../../security/policy) on how to report security vulnerabilities. - -## Credits - -- [Freek Van der Herten](https://github.com/freekmurze) -- [All Contributors](../../contributors) - -## License - -The MIT License (MIT). Please see [License File](LICENSE.md) for more information. diff --git a/vendor/spatie/laravel-package-tools/composer.json b/vendor/spatie/laravel-package-tools/composer.json deleted file mode 100644 index d06da09f..00000000 --- a/vendor/spatie/laravel-package-tools/composer.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "spatie/laravel-package-tools", - "description": "Tools for creating Laravel packages", - "keywords": [ - "spatie", - "laravel-package-tools" - ], - "homepage": "https://github.com/spatie/laravel-package-tools", - "license": "MIT", - "authors": [ - { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "role": "Developer" - } - ], - "require": { - "php": "^8.0", - "illuminate/contracts": "^9.28" - }, - "require-dev": { - "mockery/mockery": "^1.5", - "orchestra/testbench": "^7.7", - "pestphp/pest": "^1.22", - "phpunit/phpunit": "^9.5.24", - "spatie/pest-plugin-test-time": "^1.1" - }, - "autoload": { - "psr-4": { - "Spatie\\LaravelPackageTools\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "Spatie\\LaravelPackageTools\\Tests\\": "tests" - } - }, - "scripts": { - "test": "vendor/bin/pest", - "test-coverage": "vendor/bin/pest --coverage" - }, - "config": { - "sort-packages": true, - "allow-plugins": { - "pestphp/pest-plugin": true - } - }, - "minimum-stability": "dev", - "prefer-stable": true -} diff --git a/vendor/spatie/laravel-package-tools/src/Commands/InstallCommand.php b/vendor/spatie/laravel-package-tools/src/Commands/InstallCommand.php deleted file mode 100644 index 46b22565..00000000 --- a/vendor/spatie/laravel-package-tools/src/Commands/InstallCommand.php +++ /dev/null @@ -1,183 +0,0 @@ -signature = $package->shortName() . ':install'; - - $this->description = 'Install ' . $package->name; - - $this->package = $package; - - parent::__construct(); - } - - public function handle() - { - if ($this->startWith) { - ($this->startWith)($this); - } - - if ($this->shouldPublishConfigFile) { - $this->comment('Publishing config file...'); - - $this->callSilently("vendor:publish", [ - '--tag' => "{$this->package->shortName()}-config", - ]); - } - - if ($this->shouldPublishMigrations) { - $this->comment('Publishing migration...'); - - $this->callSilently("vendor:publish", [ - '--tag' => "{$this->package->shortName()}-migrations", - ]); - } - - if ($this->askToRunMigrations) { - if ($this->confirm('Would you like to run the migrations now?')) { - $this->comment('Running migrations...'); - - $this->call('migrate'); - } - } - - if ($this->copyServiceProviderInApp) { - $this->comment('Publishing service provider...'); - - $this->copyServiceProviderInApp(); - } - - if ($this->starRepo) { - if ($this->confirm('Would you like to star our repo on GitHub?')) { - $repoUrl = "https://github.com/{$this->starRepo}"; - - if (PHP_OS_FAMILY == 'Darwin') { - exec("open {$repoUrl}"); - } - if (PHP_OS_FAMILY == 'Windows') { - exec("start {$repoUrl}"); - } - if (PHP_OS_FAMILY == 'Linux') { - exec("xdg-open {$repoUrl}"); - } - } - } - - $this->info("{$this->package->shortName()} has been installed!"); - - if ($this->endWith) { - ($this->endWith)($this); - } - } - - public function publishConfigFile(): self - { - $this->shouldPublishConfigFile = true; - - return $this; - } - - public function publishMigrations(): self - { - $this->shouldPublishMigrations = true; - - return $this; - } - - public function askToRunMigrations(): self - { - $this->askToRunMigrations = true; - - return $this; - } - - public function copyAndRegisterServiceProviderInApp(): self - { - $this->copyServiceProviderInApp = true; - - return $this; - } - - public function askToStarRepoOnGitHub($vendorSlashRepoName): self - { - $this->starRepo = $vendorSlashRepoName; - - return $this; - } - - public function startWith($callable): self - { - $this->startWith = $callable; - - return $this; - } - - public function endWith($callable): self - { - $this->endWith = $callable; - - return $this; - } - - protected function copyServiceProviderInApp(): self - { - $providerName = $this->package->publishableProviderName; - - if (! $providerName) { - return $this; - } - - $this->callSilent('vendor:publish', ['--tag' => $this->package->shortName() . '-provider']); - - $namespace = Str::replaceLast('\\', '', $this->laravel->getNamespace()); - - $appConfig = file_get_contents(config_path('app.php')); - - $class = '\\Providers\\' . $providerName . '::class'; - - if (Str::contains($appConfig, $namespace . $class)) { - return $this; - } - - file_put_contents(config_path('app.php'), str_replace( - "Illuminate\\View\ViewServiceProvider::class,", - "Illuminate\\View\ViewServiceProvider::class," . PHP_EOL . " {$namespace}\Providers\\" . $providerName . "::class,", - $appConfig - )); - - file_put_contents(app_path('Providers/' . $providerName . '.php'), str_replace( - "namespace App\Providers;", - "namespace {$namespace}\Providers;", - file_get_contents(app_path('Providers/' . $providerName . '.php')) - )); - - return $this; - } -} diff --git a/vendor/spatie/laravel-package-tools/src/Exceptions/InvalidPackage.php b/vendor/spatie/laravel-package-tools/src/Exceptions/InvalidPackage.php deleted file mode 100644 index 6e5d79d4..00000000 --- a/vendor/spatie/laravel-package-tools/src/Exceptions/InvalidPackage.php +++ /dev/null @@ -1,13 +0,0 @@ -name("yourName")`'); - } -} diff --git a/vendor/spatie/laravel-package-tools/src/Package.php b/vendor/spatie/laravel-package-tools/src/Package.php deleted file mode 100644 index 4d66896e..00000000 --- a/vendor/spatie/laravel-package-tools/src/Package.php +++ /dev/null @@ -1,214 +0,0 @@ -name = $name; - - return $this; - } - - public function hasConfigFile($configFileName = null): self - { - $configFileName = $configFileName ?? $this->shortName(); - - if (! is_array($configFileName)) { - $configFileName = [$configFileName]; - } - - $this->configFileNames = $configFileName; - - return $this; - } - - public function publishesServiceProvider(string $providerName): self - { - $this->publishableProviderName = $providerName; - - return $this; - } - - public function hasInstallCommand($callable): self - { - $installCommand = new InstallCommand($this); - - $callable($installCommand); - - $this->commands[] = $installCommand; - - return $this; - } - - public function shortName(): string - { - return Str::after($this->name, 'laravel-'); - } - - public function hasViews(string $namespace = null): self - { - $this->hasViews = true; - - $this->viewNamespace = $namespace; - - return $this; - } - - public function hasViewComponent(string $prefix, string $viewComponentName): self - { - $this->viewComponents[$viewComponentName] = $prefix; - - return $this; - } - - public function hasViewComponents(string $prefix, ...$viewComponentNames): self - { - foreach ($viewComponentNames as $componentName) { - $this->viewComponents[$componentName] = $prefix; - } - - return $this; - } - - public function sharesDataWithAllViews(string $name, $value): self - { - $this->sharedViewData[$name] = $value; - - return $this; - } - - public function hasViewComposer($view, $viewComposer): self - { - if (! is_array($view)) { - $view = [$view]; - } - - foreach ($view as $viewName) { - $this->viewComposers[$viewName] = $viewComposer; - } - - return $this; - } - - public function hasTranslations(): self - { - $this->hasTranslations = true; - - return $this; - } - - public function hasAssets(): self - { - $this->hasAssets = true; - - return $this; - } - - public function runsMigrations(bool $runsMigrations = true): self - { - $this->runsMigrations = $runsMigrations; - - return $this; - } - - public function hasMigration(string $migrationFileName): self - { - $this->migrationFileNames[] = $migrationFileName; - - return $this; - } - - public function hasMigrations(...$migrationFileNames): self - { - $this->migrationFileNames = array_merge( - $this->migrationFileNames, - collect($migrationFileNames)->flatten()->toArray() - ); - - return $this; - } - - public function hasCommand(string $commandClassName): self - { - $this->commands[] = $commandClassName; - - return $this; - } - - public function hasCommands(...$commandClassNames): self - { - $this->commands = array_merge($this->commands, collect($commandClassNames)->flatten()->toArray()); - - return $this; - } - - public function hasRoute(string $routeFileName): self - { - $this->routeFileNames[] = $routeFileName; - - return $this; - } - - public function hasRoutes(...$routeFileNames): self - { - $this->routeFileNames = array_merge($this->routeFileNames, collect($routeFileNames)->flatten()->toArray()); - - return $this; - } - - public function basePath(string $directory = null): string - { - if ($directory === null) { - return $this->basePath; - } - - return $this->basePath . DIRECTORY_SEPARATOR . ltrim($directory, DIRECTORY_SEPARATOR); - } - - public function viewNamespace(): string - { - return $this->viewNamespace ?? $this->shortName(); - } - - public function setBasePath(string $path): self - { - $this->basePath = $path; - - return $this; - } -} diff --git a/vendor/spatie/laravel-package-tools/src/PackageServiceProvider.php b/vendor/spatie/laravel-package-tools/src/PackageServiceProvider.php deleted file mode 100644 index e2aef5da..00000000 --- a/vendor/spatie/laravel-package-tools/src/PackageServiceProvider.php +++ /dev/null @@ -1,203 +0,0 @@ -registeringPackage(); - - $this->package = $this->newPackage(); - - $this->package->setBasePath($this->getPackageBaseDir()); - - $this->configurePackage($this->package); - - if (empty($this->package->name)) { - throw InvalidPackage::nameIsRequired(); - } - - foreach ($this->package->configFileNames as $configFileName) { - $this->mergeConfigFrom($this->package->basePath("/../config/{$configFileName}.php"), $configFileName); - } - - $this->packageRegistered(); - - return $this; - } - - public function newPackage(): Package - { - return new Package(); - } - - public function boot() - { - $this->bootingPackage(); - - if ($this->package->hasTranslations) { - $langPath = 'vendor/' . $this->package->shortName(); - - $langPath = (function_exists('lang_path')) - ? lang_path($langPath) - : resource_path('lang/' . $langPath); - } - - if ($this->app->runningInConsole()) { - foreach ($this->package->configFileNames as $configFileName) { - $this->publishes([ - $this->package->basePath("/../config/{$configFileName}.php") => config_path("{$configFileName}.php"), - ], "{$this->package->shortName()}-config"); - } - - if ($this->package->hasViews) { - $this->publishes([ - $this->package->basePath('/../resources/views') => base_path("resources/views/vendor/{$this->packageView($this->package->viewNamespace)}"), - ], "{$this->packageView($this->package->viewNamespace)}-views"); - } - - $now = Carbon::now(); - foreach ($this->package->migrationFileNames as $migrationFileName) { - $filePath = $this->package->basePath("/../database/migrations/{$migrationFileName}.php"); - if (! file_exists($filePath)) { - // Support for the .stub file extension - $filePath .= '.stub'; - } - - $this->publishes([ - $filePath => $this->generateMigrationName( - $migrationFileName, - $now->addSecond() - ), ], "{$this->package->shortName()}-migrations"); - - if ($this->package->runsMigrations) { - $this->loadMigrationsFrom($filePath); - } - } - - if ($this->package->hasTranslations) { - $this->publishes([ - $this->package->basePath('/../resources/lang') => $langPath, - ], "{$this->package->shortName()}-translations"); - } - - if ($this->package->hasAssets) { - $this->publishes([ - $this->package->basePath('/../resources/dist') => public_path("vendor/{$this->package->shortName()}"), - ], "{$this->package->shortName()}-assets"); - } - } - - if (! empty($this->package->commands)) { - $this->commands($this->package->commands); - } - - if ($this->package->hasTranslations) { - $this->loadTranslationsFrom( - $this->package->basePath('/../resources/lang/'), - $this->package->shortName() - ); - - $this->loadJsonTranslationsFrom($this->package->basePath('/../resources/lang/')); - - $this->loadJsonTranslationsFrom($langPath); - } - - if ($this->package->hasViews) { - $this->loadViewsFrom($this->package->basePath('/../resources/views'), $this->package->viewNamespace()); - } - - foreach ($this->package->viewComponents as $componentClass => $prefix) { - $this->loadViewComponentsAs($prefix, [$componentClass]); - } - - if (count($this->package->viewComponents)) { - $this->publishes([ - $this->package->basePath('/Components') => base_path("app/View/Components/vendor/{$this->package->shortName()}"), - ], "{$this->package->name}-components"); - } - - if ($this->package->publishableProviderName) { - $this->publishes([ - $this->package->basePath("/../resources/stubs/{$this->package->publishableProviderName}.php.stub") => base_path("app/Providers/{$this->package->publishableProviderName}.php"), - ], "{$this->package->shortName()}-provider"); - } - - - foreach ($this->package->routeFileNames as $routeFileName) { - $this->loadRoutesFrom("{$this->package->basePath('/../routes/')}{$routeFileName}.php"); - } - - foreach ($this->package->sharedViewData as $name => $value) { - View::share($name, $value); - } - - foreach ($this->package->viewComposers as $viewName => $viewComposer) { - View::composer($viewName, $viewComposer); - } - - $this->packageBooted(); - - return $this; - } - - public static function generateMigrationName(string $migrationFileName, Carbon $now): string - { - $migrationsPath = 'migrations/'; - - $len = strlen($migrationFileName) + 4; - - if (Str::contains($migrationFileName, '/')) { - $migrationsPath .= Str::of($migrationFileName)->beforeLast('/')->finish('/'); - $migrationFileName = Str::of($migrationFileName)->afterLast('/'); - } - - foreach (glob(database_path("{$migrationsPath}*.php")) as $filename) { - if ((substr($filename, -$len) === $migrationFileName . '.php')) { - return $filename; - } - } - - return database_path($migrationsPath . $now->format('Y_m_d_His') . '_' . Str::of($migrationFileName)->snake()->finish('.php')); - } - - public function registeringPackage() - { - } - - public function packageRegistered() - { - } - - public function bootingPackage() - { - } - - public function packageBooted() - { - } - - protected function getPackageBaseDir(): string - { - $reflector = new ReflectionClass(get_class($this)); - - return dirname($reflector->getFileName()); - } - - public function packageView(?string $namespace) - { - return is_null($namespace) ? $this->package->shortName() : $this->package->viewNamespace; - } -} diff --git a/vendor/spatie/laravel-ray/.php-cs-fixer.dist.php b/vendor/spatie/laravel-ray/.php-cs-fixer.dist.php deleted file mode 100644 index ca68de3c..00000000 --- a/vendor/spatie/laravel-ray/.php-cs-fixer.dist.php +++ /dev/null @@ -1,43 +0,0 @@ -notPath('bootstrap/*') - ->notPath('storage/*') - ->notPath('resources/view/mail/*') - ->in([ - __DIR__ . '/src', - __DIR__ . '/tests', - ]) - ->name('*.php') - ->notName('*.blade.php') - ->ignoreDotFiles(true) - ->ignoreVCS(true); - -return (new PhpCsFixer\Config) - ->setRules([ - '@PSR12' => true, - 'array_syntax' => ['syntax' => 'short'], - 'ordered_imports' => ['sort_algorithm' => 'alpha'], - 'no_unused_imports' => true, - 'not_operator_with_successor_space' => true, - 'trailing_comma_in_multiline' => true, - 'phpdoc_scalar' => true, - 'unary_operator_spaces' => true, - 'binary_operator_spaces' => true, - 'blank_line_before_statement' => [ - 'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'], - ], - 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_var_without_name' => true, - 'class_attributes_separation' => [ - 'elements' => [ - 'method' => 'one' - ], - ], - 'method_argument_space' => [ - 'on_multiline' => 'ensure_fully_multiline', - 'keep_multiple_spaces_after_comma' => true, - ], - 'single_trait_insert_per_statement' => true, - ]) - ->setFinder($finder); diff --git a/vendor/spatie/laravel-ray/CHANGELOG.md b/vendor/spatie/laravel-ray/CHANGELOG.md deleted file mode 100644 index 29bb9799..00000000 --- a/vendor/spatie/laravel-ray/CHANGELOG.md +++ /dev/null @@ -1,422 +0,0 @@ -# Changelog - -All notable changes to `laravel-ray` will be documented in this file - -## 1.30.0 - 2022-07-29 - -### What's Changed - -- Add `send_deprecated_notices_to_ray` to config stub by @squatto in https://github.com/spatie/laravel-ray/pull/267 -- Feat: Slow query configuration by @fullstackfool in https://github.com/spatie/laravel-ray/pull/269 - -### New Contributors - -- @fullstackfool made their first contribution in https://github.com/spatie/laravel-ray/pull/269 - -**Full Changelog**: https://github.com/spatie/laravel-ray/compare/1.29.7...1.30.0 - -## 1.29.7 - 2022-05-27 - -## What's Changed - -- Fixes https://github.com/spatie/laravel-ray/issues/250 by @dfox288 in https://github.com/spatie/laravel-ray/pull/251 - -## New Contributors - -- @dfox288 made their first contribution in https://github.com/spatie/laravel-ray/pull/251 - -**Full Changelog**: https://github.com/spatie/laravel-ray/compare/1.29.6...1.29.7 - -## 1.29.6 - 2022-04-15 - -## What's Changed - -- ignore php 8.1 deprecation notices by @Nielsvanpach in https://github.com/spatie/laravel-ray/pull/247 - -**Full Changelog**: https://github.com/spatie/laravel-ray/compare/1.29.5...1.29.6 - -## 1.29.5 - 2022-04-05 - -## What's Changed - -- Fix undefined payload when using queue driver other than sync by @stein-j in https://github.com/spatie/laravel-ray/pull/245 - -## New Contributors - -- @stein-j made their first contribution in https://github.com/spatie/laravel-ray/pull/245 - -**Full Changelog**: https://github.com/spatie/laravel-ray/compare/1.29.4...1.29.5 - -## 1.29.4 - 2022-02-22 - -## What's Changed - -- check if ApplicationLogPayload can be loaded by @ThomasEnssner in https://github.com/spatie/laravel-ray/pull/242 - -## New Contributors - -- @ThomasEnssner made their first contribution in https://github.com/spatie/laravel-ray/pull/242 - -**Full Changelog**: https://github.com/spatie/laravel-ray/compare/1.29.3...1.29.4 - -## 1.29.3 - 2022-02-15 - -- correctly display mailables that are written to the log in Laravel 9 - -## 1.29.2 - 2022-02-13 - -## What's Changed - -- Fix deprecated by @TiiFuchs in https://github.com/spatie/laravel-ray/pull/240 - -## New Contributors - -- @TiiFuchs made their first contribution in https://github.com/spatie/laravel-ray/pull/240 - -**Full Changelog**: https://github.com/spatie/laravel-ray/compare/1.29.1...1.29.2 - -## 1.29.1 - 2022-02-09 - -- moved dependency - -## 1.29.0 - 2022-01-13 - -- automatically set project name - -## 1.28.0 - 2022-01-11 - -1.28.0 - -- allow Laravel 9 - -## 1.28.0 - 2022-01-11 - -- allow Laravel 9 - -## 1.27.2 - 2021-12-27 - -- Fix: make sure there is always a `VarDumper` handler registered to output to HTML or CLI - -**Full Changelog**: https://github.com/spatie/laravel-ray/compare/1.27.1...1.27.2 - -## 1.27.1 - 2021-12-27 - -## What's Changed - -- Register `DumpRecorder` only once and keep original handler connected by @AlexVanderbist in https://github.com/spatie/laravel-ray/pull/233 - -## New Contributors - -- @AlexVanderbist made their first contribution in https://github.com/spatie/laravel-ray/pull/233 - -**Full Changelog**: https://github.com/spatie/laravel-ray/compare/1.27.0...1.27.1 - -## 1.27.0 - 2021-12-26 - -## What's Changed - -- Slow Query Logging by @patinthehat in https://github.com/spatie/laravel-ray/pull/232 - -**Full Changelog**: https://github.com/spatie/laravel-ray/compare/1.26.5...1.27.0 - -## 1.26.5 - 2021-12-21 - -## What's Changed - -- add support for Symfony 6 by @Nielsvanpach in https://github.com/spatie/laravel-ray/pull/231 - -**Full Changelog**: https://github.com/spatie/laravel-ray/compare/1.26.4...1.26.5 - -## 1.26.4 - 2021-12-10 - -## What's Changed - -- Added DeprecatedNoticeWatcher that piggy backs off of the Application… by @JuanRangel in https://github.com/spatie/laravel-ray/pull/229 - -## New Contributors - -- @JuanRangel made their first contribution in https://github.com/spatie/laravel-ray/pull/229 - -**Full Changelog**: https://github.com/spatie/laravel-ray/compare/1.26.3...1.26.4 - -## 1.26.3 - 2021-11-22 - -## What's Changed - -- Fix typo in ray.php docblock by @iDiegoNL in https://github.com/spatie/laravel-ray/pull/227 - -## New Contributors - -- @iDiegoNL made their first contribution in https://github.com/spatie/laravel-ray/pull/227 - -**Full Changelog**: https://github.com/spatie/laravel-ray/compare/1.26.2...1.26.3 - -## 1.26.2 - 2021-11-15 - -## What's Changed - -- Check if Laravel has been bound with `Facade\FlareClient\Flare` by @crynobone in https://github.com/spatie/laravel-ray/pull/224 - -**Full Changelog**: https://github.com/spatie/laravel-ray/compare/1.26.1...1.26.2 - -## 1.26.1 - 2021-10-01 - -- fix #217 error with duplicate queries log (#220) - -## 1.26.0 - 2021-09-27 - -- feature duplicate queries (#216) - -## 1.25.2 - 2021-09-10 - -- enhance metadata instead of overriding it in when sending a request (#215) - -## 1.25.1 - 2021-09-07 - -- add support for zbateson/mail-mime-parser v2 (#214) - -## 1.25.0 - 2021-08-27 - -- add tags to cache payload (#210) - -## 1.24.2 - 2021-07-23 - -- fix origin of query builder ray calls (now for real) - -## 1.24.1 - 2021-07-23 - -- fix origin of query builder ray calls - -## 1.24.0 - 2021-07-23 - -- add `ray` macro on query builder - -## 1.23.0 - 2021-06-24 - -- allow multiple mailables ([#204](https://github.com/spatie/laravel-ray/pull/204)) - -## 1.22.0 - 2021-06-24 - -- when a query exception occurs, the query itself will also be sent to Ray. - -## 1.21.0 - 2021-06-22 - -- add `countQueries` - -## 1.20.2 - 2021-06-21 - -- fix `mailable` when using `Mail::fake` - -## 1.20.1 - 2021-06-15 - -- fix origin of stringable - -## 1.20.0 - 2021-06-15 - -- add support for stringables - -## 1.19.1 - 2021-06-11 - -- better HTTP Client logging (#201) - -## 1.19.0 - 2021-06-04 - -- add http logging methods - -## 1.18.0 - 2021-03-23 - -- colorize high severity messages (#197) - -## 1.17.4 - 2021-04-30 - -- check if an exception is passed before log dumping - -## 1.17.3 - 2021-04-29 - -- the package won't send dumps to Ray when dump sending is disabled - -## 1.17.2 - 2021-04-06 - -- Laravel Octane Compatibility (#178) - -## 1.17.1 - 2021-03-14 - -- send exceptions by default - -## 1.17.0 - 2021-03-13 - -- enable/disable sending exceptions to Ray (#173) - -## 1.16.0 - 2021-03-12 - -- allow using `env()` when config is not available (#172) - -## 1.15.1 - 2021-03-10 - -- fix handling of null logs (#171) - -## 1.15.0 - 2021-03-09 - -- add `env` method - -## 1.14.0 - 2021-03-04 - -- add support for hostname - -## 1.13.0 - 2021-02-22 - -- add exception watcher - -## 1.12.6 - 2021-02-10 - -- replace spaces with underscores in `env()` calls (#154) - -## 1.12.5 - 2021-02-10 - -- fix "Package spatie/laravel-ray is not installed" exception (#156) - -## 1.12.4 - 2021-02-10 - -- handle edge case where ray proxy would not be set - -## 1.12.3 - 2021-02-08 - -- chain colours on `show*` methods (#149) - -## 1.12.2 - 2021-02-07 - -- ignore errors caused by using `storage_path` - -## 1.12.1 - 2021-02-05 - -- register watchers on boot (#138) - -## 1.12.0 - 2021-02-03 - -- remove enabled methods (#132) - -## 1.11.2 - 2021-02-02 - -- do not blow up when using `Mail::fake()` - -## 1.11.1 - 2021-02-01 - -- update config file - -## 1.11.0 - 2021-01-31 - -- add view requests -- add view cache - -## 1.10.1 - 2021-01-31 - -- display logged exceptions - -## 1.10.0 - 2021-01-29 - -- add view methods - -## 1.9.3 - 2021-01-28 - -- internals cleanup - -## 1.9.2 - 2021-01-28 - -- improve dependencies - -## 1.9.1 - 2021-01-25 - -- improve service provider - -## 1.9.0 - 2021-01-22 - -- add `showJobs` - -## 1.8.0 - 2021-01-19 - -- the package will now select the best payload type when passing something to `ray()` - -## 1.7.1 - 2021-01-17 - -- lower dependencies - -## 1.7.0 - 2021-01-15 - -- make `model` more flexible - -## 1.6.1 - 2021-01-15 - -- better support for logged mailables - -## 1.6.0 - 2021-01-15 - -- add `markdown` method - -## 1.5.2 - 2021-01-13 - -- fix headers on response payload - -## 1.5.1 - 2021-01-13 - -- make the test response macro chainable - -## 1.5.0 - 2021-01-13 - -- add `testResponse` method - -## 1.4.0 - 2021-01-13 - -- let the `model` call accepts multiple models. - -## 1.3.6 - 2021-01-13 - -- update `str_replace()` calls in `ray:publish-config` with `env()` usage (#82) - -## 1.3.5 - 2021-01-12 - -- improve recognizing mails in logs - -## 1.3.4 - 2021-01-09 - -- add `env()` vars for each Laravel config setting (#55) - -## 1.3.3 - 2021-01-09 - -- add `enabled()` and `disabled()` methods (#54) - -## 1.3.2 - 2021-01-09 - -- fix frame for `rd` function - -## 1.3.1 - 2021-01-09 - -- fix broken `queries()`-method (#51) - -## 1.3.0 - 2021-01-08 - -- Add `PublishConfigCommand` - -## 1.2.0 - 2021-01-08 - -- add support for `local_path` and `remote_path` settings - -## 1.1.0 - 2021-01-07 - -- add support for Lumen (#22) - -## 1.0.3 - 20201-01-07 - -- fix incompatibilities on Windows (#20) -- fix host settings (#14) - -## 1.0.2 - 2021-01-07 - -- fix deps - -## 1.0.1 - 2021-01-07 - -- fix deps - -## 1.0.0 - 2021-01-07 - -- initial release diff --git a/vendor/spatie/laravel-ray/LICENSE.md b/vendor/spatie/laravel-ray/LICENSE.md deleted file mode 100644 index 59e5ec59..00000000 --- a/vendor/spatie/laravel-ray/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Spatie bvba - -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/spatie/laravel-ray/README.md b/vendor/spatie/laravel-ray/README.md deleted file mode 100644 index 0ac79112..00000000 --- a/vendor/spatie/laravel-ray/README.md +++ /dev/null @@ -1,52 +0,0 @@ - -[](https://supportukrainenow.org) - -# Debug with Ray to fix problems faster - -[![Latest Version on Packagist](https://img.shields.io/packagist/v/spatie/laravel-ray.svg?style=flat-square)](https://packagist.org/packages/spatie/laravel-ray) -![Tests](https://github.com/spatie/laravel-ray/workflows/Tests/badge.svg) -[![PHPStan](https://github.com/spatie/laravel-ray/actions/workflows/phpstan.yml/badge.svg)](https://github.com/spatie/laravel-ray/actions/workflows/phpstan.yml) -[![Total Downloads](https://img.shields.io/packagist/dt/spatie/laravel-ray.svg?style=flat-square)](https://packagist.org/packages/spatie/laravel-ray) - -This package can be installed in any PHP application to send messages to [the Ray app](https://myray.app). - -[](https://spatie.be/github-ad-click/laravel-ray) - -The desktop app: - -- can be used in WordPress, Laravel, PHP, JavaScript function -- shows you models, mails, queries, ... IN Laravel -- helps you to debug locally or via SSH -- lets you measure performance & set breakpoints - - -## Documentation - -You can find the full documentation on [our documentation site](https://spatie.be/docs/ray). - -## Testing - -``` bash -composer test -``` - -## Changelog - -Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. - -## Contributing - -Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details. - -## Security Vulnerabilities - -Please review [our security policy](../../security/policy) on how to report security vulnerabilities. - -## Credits - -- [Freek Van der Herten](https://github.com/freekmurze) -- [All Contributors](../../contributors) - -## License - -The MIT License (MIT). Please see [License File](LICENSE.md) for more information. diff --git a/vendor/spatie/laravel-ray/composer.json b/vendor/spatie/laravel-ray/composer.json deleted file mode 100644 index 7de16751..00000000 --- a/vendor/spatie/laravel-ray/composer.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "name": "spatie/laravel-ray", - "description": "Easily debug Laravel apps", - "keywords": [ - "spatie", - "laravel-ray" - ], - "homepage": "https://github.com/spatie/laravel-ray", - "license": "MIT", - "authors": [ - { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "homepage": "https://spatie.be", - "role": "Developer" - } - ], - "require": { - "ext-json": "*", - "php": "^7.3|^8.0", - "illuminate/contracts": "^7.20|^8.19|^9.0", - "illuminate/database": "^7.20|^8.19|^9.0", - "illuminate/queue": "^7.20|^8.19|^9.0", - "illuminate/support": "^7.20|^8.19|^9.0", - "spatie/backtrace": "^1.0", - "spatie/ray": "^1.33", - "symfony/stopwatch": "4.2|^5.1|^6.0", - "zbateson/mail-mime-parser": "^1.3.1|^2.0" - }, - "require-dev": { - "guzzlehttp/guzzle": "^7.3", - "laravel/framework": "^7.20|^8.19|^9.0", - "orchestra/testbench-core": "^5.0|^6.0|^7.0", - "phpstan/phpstan": "^0.12.93", - "phpunit/phpunit": "^9.3", - "spatie/phpunit-snapshot-assertions": "^4.2" - }, - "autoload": { - "psr-4": { - "Spatie\\LaravelRay\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "Spatie\\LaravelRay\\Tests\\": "tests" - } - }, - "scripts": { - "analyse": "vendor/bin/phpstan", - "test": "vendor/bin/phpunit --colors=always", - "test-coverage": "vendor/bin/phpunit --coverage-html coverage", - "format": "vendor/bin/php-cs-fixer fix --allow-risky=yes" - }, - "config": { - "sort-packages": true - }, - "extra": { - "branch-alias": { - "dev-main": "1.29.x-dev" - }, - "laravel": { - "providers": [ - "Spatie\\LaravelRay\\RayServiceProvider" - ] - } - }, - "minimum-stability": "dev", - "prefer-stable": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/spatie" - }, - { - "type": "other", - "url": "https://spatie.be/open-source/support-us" - } - ] -} diff --git a/vendor/spatie/laravel-ray/ide.json b/vendor/spatie/laravel-ray/ide.json deleted file mode 100644 index 15f777bf..00000000 --- a/vendor/spatie/laravel-ray/ide.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "$schema": "https://laravel-ide.com/schema/laravel-ide-v2.json", - "blade": { - "directives": [ - { - "name": "ray", - "prefix": "" - } - ] - } -} diff --git a/vendor/spatie/laravel-ray/phpstan-baseline.neon b/vendor/spatie/laravel-ray/phpstan-baseline.neon deleted file mode 100644 index 6b85c3f5..00000000 --- a/vendor/spatie/laravel-ray/phpstan-baseline.neon +++ /dev/null @@ -1,52 +0,0 @@ -parameters: - ignoreErrors: - - - message: "#^Call to an undefined method Spatie\\\\LaravelRay\\\\OriginFactory\\:\\:returnTinkerFrame\\(\\)\\.$#" - count: 1 - path: src/OriginFactory.php - - - - message: "#^Variable \\$foundFrame in PHPDoc tag @var does not exist\\.$#" - count: 2 - path: src/OriginFactory.php - - - - message: "#^Call to method createReport\\(\\) on an unknown class Facade\\\\FlareClient\\\\Flare\\.$#" - count: 1 - path: src/Watchers/ExceptionWatcher.php - - - - message: "#^Call to method trim\\(\\) on an unknown class Facade\\\\FlareClient\\\\Truncation\\\\ReportTrimmer\\.$#" - count: 1 - path: src/Watchers/ExceptionWatcher.php - - - - message: "#^Call to method trim\\(\\) on an unknown class Spatie\\\\FlareClient\\\\Truncation\\\\ReportTrimmer\\.$#" - count: 1 - path: src/Watchers/ExceptionWatcher.php - - - - message: "#^Class Facade\\\\FlareClient\\\\Flare not found\\.$#" - count: 2 - path: src/Watchers/ExceptionWatcher.php - - - - message: "#^Class Spatie\\\\FlareClient\\\\Flare not found\\.$#" - count: 2 - path: src/Watchers/ExceptionWatcher.php - - - - message: "#^Instantiated class Facade\\\\FlareClient\\\\Truncation\\\\ReportTrimmer not found\\.$#" - count: 1 - path: src/Watchers/ExceptionWatcher.php - - - - message: "#^Instantiated class Spatie\\\\FlareClient\\\\Truncation\\\\ReportTrimmer not found\\.$#" - count: 1 - path: src/Watchers/ExceptionWatcher.php - - - - message: "#^PHPDoc tag @var for variable \\$flare contains unknown class Facade\\\\FlareClient\\\\Flare\\.$#" - count: 1 - path: src/Watchers/ExceptionWatcher.php - diff --git a/vendor/spatie/laravel-ray/phpstan.neon.dist b/vendor/spatie/laravel-ray/phpstan.neon.dist deleted file mode 100644 index 2c029aba..00000000 --- a/vendor/spatie/laravel-ray/phpstan.neon.dist +++ /dev/null @@ -1,19 +0,0 @@ -includes: - - phpstan-baseline.neon - -parameters: - level: 2 - paths: - - src - - ignoreErrors: - - '#^Call to method \w+\(\) on an unknown class Spatie\\YiiRay\\Ray\.$#' - - '#^Call to method \w+\(\) on an unknown class Spatie\\WordPressRay\\Ray\.$#' - - '#^Call to method \w+\(\) on an unknown class Spatie\\RayBundle\\Ray\.$#' - - '#^Access to an undefined property Spatie\\Ray\\Settings\\Settings\:\:\$\w+\.$#' - - - message: '#^Access to an undefined property Spatie\\LaravelRay\\RayServiceProvider\:\:\$items\.$#' - path: src/RayServiceProvider.php - - - message: '#^Access to an undefined property Spatie\\LaravelRay\\RayServiceProvider\:\:\$value\.$#' - path: src/RayServiceProvider.php diff --git a/vendor/spatie/laravel-ray/src/Commands/PublishConfigCommand.php b/vendor/spatie/laravel-ray/src/Commands/PublishConfigCommand.php deleted file mode 100644 index 14c31f30..00000000 --- a/vendor/spatie/laravel-ray/src/Commands/PublishConfigCommand.php +++ /dev/null @@ -1,49 +0,0 @@ -exists('ray.php')) { - $this->error('ray.php already exists in the project root'); - - return; - } - - copy(__DIR__ . '/../../stub/ray.php', base_path('ray.php')); - - if ($this->option('docker')) { - file_put_contents( - base_path('ray.php'), - str_replace( - "'host' => env('RAY_HOST', 'localhost')", - "'host' => env('RAY_HOST', 'host.docker.internal')", - file_get_contents(base_path('ray.php')) - ) - ); - } - - if ($this->option('homestead')) { - file_put_contents( - base_path('ray.php'), - str_replace( - "'host' => env('RAY_HOST', 'localhost')", - "'host' => env('RAY_HOST', '10.0.2.2')", - file_get_contents(base_path('ray.php')) - ) - ); - } - - $this->info('`ray.php` created in the project base directory'); - } -} diff --git a/vendor/spatie/laravel-ray/src/DumpRecorder/DumpRecorder.php b/vendor/spatie/laravel-ray/src/DumpRecorder/DumpRecorder.php deleted file mode 100644 index 50f545b8..00000000 --- a/vendor/spatie/laravel-ray/src/DumpRecorder/DumpRecorder.php +++ /dev/null @@ -1,86 +0,0 @@ -app = $app; - } - - public function register(): self - { - $multiDumpHandler = new MultiDumpHandler(); - - $this->app->singleton(MultiDumpHandler::class, function () use ($multiDumpHandler) { - return $multiDumpHandler; - }); - - if (! static::$registeredHandler) { - static::$registeredHandler = true; - - $this->ensureOriginalHandlerExists(); - - $originalHandler = VarDumper::setHandler(function ($dumpedVariable) use ($multiDumpHandler) { - $multiDumpHandler->dump($dumpedVariable); - }); - - if ($originalHandler) { - $multiDumpHandler->addHandler($originalHandler); - } - - $multiDumpHandler->addHandler(function ($dumpedVariable) { - if ($this->shouldDump()) { - app(Ray::class)->send($dumpedVariable); - } - }); - } - - return $this; - } - - protected function shouldDump(): bool - { - /** @var Ray $ray */ - $ray = app(Ray::class); - - return $ray->settings->send_dumps_to_ray; - } - - /** - * Only the `VarDumper` knows how to create the orignal HTML or CLI VarDumper. - * Using reflection and the private VarDumper::register() method we can force it - * to create and register a new VarDumper::$handler before we'll overwrite it. - * Of course, we only need to do this if there isn't a registered VarDumper::$handler. - * - * @throws \ReflectionException - */ - protected function ensureOriginalHandlerExists(): void - { - $reflectionProperty = new ReflectionProperty(VarDumper::class, 'handler'); - $reflectionProperty->setAccessible(true); - $handler = $reflectionProperty->getValue(); - - if (! $handler) { - // No handler registered yet, so we'll force VarDumper to create one. - $reflectionMethod = new ReflectionMethod(VarDumper::class, 'register'); - $reflectionMethod->setAccessible(true); - $reflectionMethod->invoke(null); - } - } -} diff --git a/vendor/spatie/laravel-ray/src/DumpRecorder/MultiDumpHandler.php b/vendor/spatie/laravel-ray/src/DumpRecorder/MultiDumpHandler.php deleted file mode 100644 index f2ea6f21..00000000 --- a/vendor/spatie/laravel-ray/src/DumpRecorder/MultiDumpHandler.php +++ /dev/null @@ -1,23 +0,0 @@ -handlers as $handler) { - $handler($value); - } - } - - public function addHandler(callable $callable = null): self - { - $this->handlers[] = $callable; - - return $this; - } -} diff --git a/vendor/spatie/laravel-ray/src/OriginFactory.php b/vendor/spatie/laravel-ray/src/OriginFactory.php deleted file mode 100644 index 6e834604..00000000 --- a/vendor/spatie/laravel-ray/src/OriginFactory.php +++ /dev/null @@ -1,255 +0,0 @@ -getFrame(); - - return new Origin( - optional($frame)->file, - optional($frame)->lineNumber, - ); - } - - protected function getFrame(): ?Frame - { - $frames = collect(Backtrace::create()->frames())->reverse(); - - $indexOfRay = $frames - ->search(function (Frame $frame) { - if ($frame->class === Ray::class) { - return true; - } - - if (Str::startsWith($frame->file, __DIR__)) { - return true; - } - - return false; - }); - - /** @var Frame|null $rayFrame */ - $rayFrame = $frames[$indexOfRay] ?? null; - - $rayFunctionFrame = $frames[$indexOfRay + 2] ?? null; - - /** @var Frame|null $originFrame */ - $originFrame = $frames[$indexOfRay + 1] ?? null; - - if ($originFrame && Str::endsWith($originFrame->file, Ray::makePathOsSafe('ray/src/helpers.php'))) { - $framesAbove = 2; - - if ($rayFunctionFrame && $rayFunctionFrame->method === 'rd') { - $framesAbove = 3; - } - - $originFrame = $frames[$indexOfRay + $framesAbove] ?? null; - } - - if (! $rayFrame) { - return null; - } - - if ($rayFrame->class === Stringable::class) { - return $this->findFrameForStringableMacro($frames, $indexOfRay); - } - - if ($rayFrame->class === Collection::class && Str::startsWith($rayFrame->method, 'Spatie\LaravelRay')) { - return $this->findFrameForCollectionMacro($frames, $indexOfRay); - } - - if ($rayFrame->class === QueryWatcher::class) { - return $this->findFrameForQuery($frames); - } - - if ($rayFrame->class === ViewWatcher::class) { - return $this->findFrameForView($frames, $indexOfRay); - } - - if ($rayFrame->class === DumpRecorder::class) { - return $this->findFrameForDump($frames); - } - - if ($rayFrame->class === CacheWatcher::class) { - return $this->findFrameForCache($frames); - } - - if ($originFrame->class === Dispatcher::class) { - return $this->findFrameForEvent($frames); - } - - if ($originFrame->class === Builder::class) { - return $this->findFrameForQueryBuilder($frames); - } - - if (Str::endsWith($originFrame->file, Ray::makePathOsSafe('/vendor/psy/psysh/src/ExecutionLoopClosure.php'))) { - $this->returnTinkerFrame(); - } - - try { - if (Str::startsWith($originFrame->file, storage_path('framework/views'))) { - return $this->replaceCompiledViewPathWithOriginalViewPath($originFrame); - } - } catch (BindingResolutionException $exception) { - // ignore errors caused by using `storage_path` - } - - return $originFrame; - } - - protected function findFrameForStringableMacro(Collection $frames, int $indexOfFoundFrame): ?Frame - { - return $frames[$indexOfFoundFrame + 2]; - } - - protected function findFrameForCollectionMacro(Collection $frames, int $indexOfFoundFrame): ?Frame - { - return $frames[$indexOfFoundFrame + 2]; - } - - protected function findFrameForQuery(Collection $frames): ?Frame - { - $indexOfLastDatabaseCall = $frames - ->filter(function (Frame $frame) { - return ! is_null($frame->class); - }) - ->search(function (Frame $frame) { - return Str::startsWith($frame->class, 'Illuminate\Database'); - }); - - return $frames[$indexOfLastDatabaseCall + 1] ?? null; - } - - protected function findFrameForQueryBuilder(Collection $frames): ?Frame - { - $indexOfLastDatabaseCall = $frames - ->filter(function (Frame $frame) { - return ! is_null($frame->class); - }) - ->search(function (Frame $frame) { - return Str::startsWith($frame->class, 'Illuminate\Database'); - }); - - return $frames[$indexOfLastDatabaseCall + 1] ?? null; - } - - protected function findFrameForView(Collection $frames, int $indexOfRayFrame): ?Frame - { - return $frames[$indexOfRayFrame + 6] ?? null; - } - - protected function findFrameForDump(Collection $frames): ?Frame - { - $indexOfDumpCall = $frames - ->search(function (Frame $frame) { - if (! is_null($frame->class)) { - return false; - } - - return in_array($frame->method, ['dump', 'dd']); - }); - - return $frames[$indexOfDumpCall + 1] ?? null; - } - - protected function findFrameForEvent(Collection $frames): ?Frame - { - $indexOfLoggerCall = $frames - ->search(function (Frame $frame) { - return $frame->class === Logger::class; - }); - - if ($indexOfLoggerCall) { - return $this->findFrameForLog($frames, $indexOfLoggerCall); - } - - $indexOfEventDispatcherCall = $frames - ->search(function (Frame $frame) { - return ($frame->class === Dispatcher::class) && $frame->method === 'dispatch'; - }); - - /** @var Frame $foundFrame */ - if ($foundFrame = $frames[$indexOfEventDispatcherCall + 2]) { - if (Str::endsWith($foundFrame->file, Ray::makePathOsSafe('/Illuminate/Foundation/Events/Dispatchable.php'))) { - $foundFrame = $frames[$indexOfEventDispatcherCall + 3]; - } - }; - - return $foundFrame ?? null; - } - - protected function findFrameForLog(Collection $frames, int $indexOfLoggerCall): ?Frame - { - /** @var Frame $foundFrame */ - if ($foundFrame = $frames[$indexOfLoggerCall + 1]) { - if ($foundFrame->class === LogManager::class) { - $foundFrame = $frames[$indexOfLoggerCall + 2]; - - if ($foundFrame->class = Facade::class) { - $foundFrame = $frames[$indexOfLoggerCall + 3]; - } - - if (Str::endsWith($foundFrame->file, Ray::makePathOsSafe('/Illuminate/Foundation/helpers.php'))) { - $foundFrame = $frames[$indexOfLoggerCall + 3]; - } - } - } - - return $foundFrame ?? null; - } - - public function findFrameForCache(Collection $frames): ?Frame - { - $index = $frames->search(function (Frame $frame) { - return $frame->class === CacheManager::class; - }); - - while (Str::startsWith($frames[$index]->class, 'Illuminate')) { - $index++; - } - - return $frames[$index] ?? null; - } - - protected function replaceCompiledViewPathWithOriginalViewPath(Frame $frame): Frame - { - if (! file_exists($frame->file)) { - return $frame; - } - - $fileContents = file_get_contents($frame->file); - - $originalViewPath = trim(Str::between($fileContents, '/**PATH', 'ENDPATH**/')); - - if (! file_exists($originalViewPath)) { - return $frame; - } - - $frame->file = $originalViewPath; - $frame->lineNumber = 1; - - return $frame; - } -} diff --git a/vendor/spatie/laravel-ray/src/Payloads/CachePayload.php b/vendor/spatie/laravel-ray/src/Payloads/CachePayload.php deleted file mode 100644 index bcc92b36..00000000 --- a/vendor/spatie/laravel-ray/src/Payloads/CachePayload.php +++ /dev/null @@ -1,58 +0,0 @@ -type = $type; - - $this->key = $key; - - $this->tags = is_array($tags) ? $tags : [$tags]; - - $this->value = $value; - - $this->expirationInSeconds = $expirationInSeconds; - } - - public function getType(): string - { - return 'table'; - } - - public function getContent(): array - { - $values = array_filter([ - 'Event' => '' . $this->type . '', - 'Key' => $this->key, - 'Value' => ArgumentConverter::convertToPrimitive($this->value), - 'Tags' => count($this->tags) ? ArgumentConverter::convertToPrimitive($this->tags) : null, - 'Expiration in seconds' => $this->expirationInSeconds, - ]); - - return [ - 'values' => $values, - 'label' => 'Cache', - ]; - } -} diff --git a/vendor/spatie/laravel-ray/src/Payloads/EnvironmentPayload.php b/vendor/spatie/laravel-ray/src/Payloads/EnvironmentPayload.php deleted file mode 100644 index 016d9980..00000000 --- a/vendor/spatie/laravel-ray/src/Payloads/EnvironmentPayload.php +++ /dev/null @@ -1,108 +0,0 @@ -environmentFilePath(); - - $this->path = dirname($filename); - - $this->filename = basename($filename); - - $this->values = $this->getDotEnvValues($onlyShowNames); - } - - public function getType(): string - { - return 'table'; - } - - public function getContent(): array - { - $values = array_map(function ($value) { - $value = $this->decorateSpecialValues($value); - - return ArgumentConverter::convertToPrimitive($value); - }, $this->values); - - return [ - 'values' => $values, - 'label' => '.env', - ]; - } - - protected function decorateSpecialValues($value) - { - if ($value === '') { - return '
      (empty)
      '; - } - - if ($value === 'null' || $value === 'NULL') { - return '
      NULL
      '; - } - - if ($value === 'true' || $value === 'false') { - $color = $value === 'true' ? 'green' : 'red'; - - return "
      {$value}
      "; - } - - if (preg_match('~^https?://~', $value) === 1) { - return "{$value}"; - } - - if (strpos($value, 'base64:') === 0) { - return "
      {$value}
      "; - } - - // ip addresses - if (preg_match('~(\d{1,3}\.){3}\d{1,3}~', $value) === 1) { - return "
      {$value}
      "; - } - - return $value; - } - - protected function loadDotEnv(): array - { - return Dotenv::create( - Env::getRepository(), - $this->path, - $this->filename - )->safeLoad(); - } - - protected function getDotEnvValues(?array $filterNames): array - { - $values = $this->loadDotEnv(); - - if (! $filterNames) { - return $values; - } - - return array_filter($values, function ($value) use ($filterNames) { - return in_array($value, $filterNames, true); - }, ARRAY_FILTER_USE_KEY); - } -} diff --git a/vendor/spatie/laravel-ray/src/Payloads/EventPayload.php b/vendor/spatie/laravel-ray/src/Payloads/EventPayload.php deleted file mode 100644 index f94d9268..00000000 --- a/vendor/spatie/laravel-ray/src/Payloads/EventPayload.php +++ /dev/null @@ -1,42 +0,0 @@ -eventName = $eventName; - - class_exists($eventName) - ? $this->event = $payload[0] - : $this->payload = $payload; - } - - public function getType(): string - { - return 'event'; - } - - public function getContent(): array - { - return [ - 'name' => $this->eventName, - 'event' => $this->event ? ArgumentConverter::convertToPrimitive($this->event) : null, - 'payload' => count($this->payload) ? ArgumentConverter::convertToPrimitive($this->payload) : null, - 'class_based_event' => ! is_null($this->event), - ]; - } -} diff --git a/vendor/spatie/laravel-ray/src/Payloads/ExecutedQueryPayload.php b/vendor/spatie/laravel-ray/src/Payloads/ExecutedQueryPayload.php deleted file mode 100644 index 51735389..00000000 --- a/vendor/spatie/laravel-ray/src/Payloads/ExecutedQueryPayload.php +++ /dev/null @@ -1,44 +0,0 @@ -query = $query; - } - - public function getType(): string - { - return 'executed_query'; - } - - public function getContent(): array - { - $properties = [ - 'sql' => $this->query->sql, - 'bindings' => $this->query->bindings, - ]; - - if ($this->hasAllProperties()) { - $properties = array_merge($properties, [ - 'connection_name' => $this->query->connectionName, - 'time' => $this->query->time, - ]); - } - - return $properties; - } - - protected function hasAllProperties(): bool - { - return ! is_null($this->query->time); - } -} diff --git a/vendor/spatie/laravel-ray/src/Payloads/JobEventPayload.php b/vendor/spatie/laravel-ray/src/Payloads/JobEventPayload.php deleted file mode 100644 index 7122b07d..00000000 --- a/vendor/spatie/laravel-ray/src/Payloads/JobEventPayload.php +++ /dev/null @@ -1,48 +0,0 @@ -event = $event; - - // Some queue drivers use an intermediate job with the orignal job stored inside. - // For other drivers, the job is not altered, and it can be used directly. - $this->job = $event->job instanceof Job - ? unserialize($event->job->payload()['data']['command']) - : $this->job = $event->job; - - if (property_exists($event, 'exception')) { - $this->exception = $event->exception ?? null; - } - } - - public function getType(): string - { - return 'job_event'; - } - - public function getContent(): array - { - return [ - 'event_name' => class_basename($this->event), - 'job' => $this->job ? ArgumentConverter::convertToPrimitive($this->job) : null, - 'exception' => $this->exception ? ArgumentConverter::convertToPrimitive($this->exception) : null, - ]; - } -} diff --git a/vendor/spatie/laravel-ray/src/Payloads/LoggedMailPayload.php b/vendor/spatie/laravel-ray/src/Payloads/LoggedMailPayload.php deleted file mode 100644 index 4cb19328..00000000 --- a/vendor/spatie/laravel-ray/src/Payloads/LoggedMailPayload.php +++ /dev/null @@ -1,98 +0,0 @@ -parse($loggedMail, true); - - $content = $message->getContent() ?? $message->getHtmlContent() ?? ''; - - return new self( - $content, - self::convertHeaderToPersons($message->getHeader(HeaderConsts::FROM)), - $message->getHeaderValue(HeaderConsts::SUBJECT), - self::convertHeaderToPersons($message->getHeader(HeaderConsts::TO)), - self::convertHeaderToPersons($message->getHeader(HeaderConsts::CC)), - self::convertHeaderToPersons($message->getHeader(HeaderConsts::BCC)), - ); - } - - public function __construct( - string $html, - array $from = [], - ?string $subject = null, - array $to = [], - array $cc = [], - array $bcc = [] - ) { - $this->html = $html; - $this->from = $from; - $this->subject = $subject; - $this->to = $to; - $this->cc = $cc; - $this->bcc = $bcc; - } - - public function getType(): string - { - return 'mailable'; - } - - public function getContent(): array - { - return [ - 'html' => $this->html, - 'subject' => $this->subject, - 'from' => $this->from, - 'to' => $this->to, - 'cc' => $this->cc, - 'bcc' => $this->bcc, - ]; - } - - protected static function convertHeaderToPersons(?AddressHeader $header): array - { - if ($header === null) { - return []; - } - - return array_map( - function (AddressPart $address) { - return [ - 'name' => $address->getName(), - 'email' => $address->getEmail(), - ]; - }, - $header->getAddresses() - ); - } -} diff --git a/vendor/spatie/laravel-ray/src/Payloads/MailablePayload.php b/vendor/spatie/laravel-ray/src/Payloads/MailablePayload.php deleted file mode 100644 index 69b7623f..00000000 --- a/vendor/spatie/laravel-ray/src/Payloads/MailablePayload.php +++ /dev/null @@ -1,78 +0,0 @@ -html = $html; - - $this->mailable = $mailable; - } - - public function getType(): string - { - return 'mailable'; - } - - public function getContent(): array - { - $content = [ - 'html' => $this->html, - 'from' => [], - 'to' => [], - 'cc' => [], - 'bcc' => [], - ]; - - if ($this->mailable) { - $content = array_merge($content, [ - 'mailable_class' => get_class($this->mailable), - 'from' => $this->convertToPersons($this->mailable->from), - 'subject' => $this->mailable->subject, - 'to' => $this->convertToPersons($this->mailable->to), - 'cc' => $this->convertToPersons($this->mailable->cc), - 'bcc' => $this->convertToPersons($this->mailable->bcc), - ]); - } - - return $content; - } - - protected static function renderMailable(Mailable $mailable): string - { - try { - return $mailable->render(); - } catch (Throwable $exception) { - return "Mailable could not be rendered because {$exception->getMessage()}"; - } - } - - protected function convertToPersons(array $persons): array - { - return collect($persons) - ->map(function (array $person) { - return [ - 'email' => $person['address'], - 'name' => $person['name'] ?? '', - ]; - }) - ->toArray(); - } -} diff --git a/vendor/spatie/laravel-ray/src/Payloads/MarkdownPayload.php b/vendor/spatie/laravel-ray/src/Payloads/MarkdownPayload.php deleted file mode 100644 index 805376fa..00000000 --- a/vendor/spatie/laravel-ray/src/Payloads/MarkdownPayload.php +++ /dev/null @@ -1,75 +0,0 @@ -markdown = $markdown; - } - - public function getType(): string - { - return 'custom'; - } - - public function getContent(): array - { - return [ - 'content' => $this->markdownToHtml($this->markdown), - 'label' => 'Markdown', - ]; - } - - protected function markdownToHtml(string $markdown): string - { - $converter = new GithubFlavoredMarkdownConverter([ - 'renderer' => [ - 'block_separator' => "
      \n", - ], - 'html_input' => 'allow', - 'allow_unsafe_links' => false, - ]); - - $html = $converter->convertToHtml($markdown); - $html = $this->processCodeBlocks($html); - $html = $this->processHeaderTags($html); - $css = $this->getCustomStyles(); - - return trim("{$css}{$html}"); - } - - protected function getCustomStyles(): string - { - // render links as underlined - return ''; - } - - protected function processCodeBlocks($html): string - { - // format code blocks background color, padding, and display width; the background - // color changes based on light or dark app theme. - return str_replace('
      ', '

      ', '

      ', '

      '], [ - '
      ', - '
      ', - '
      ', - '
      ', - ], $html); - - // replace closing header tags with closing div tags - return preg_replace('~~', '
      ', $html); - } -} diff --git a/vendor/spatie/laravel-ray/src/Payloads/ModelPayload.php b/vendor/spatie/laravel-ray/src/Payloads/ModelPayload.php deleted file mode 100644 index 84a35331..00000000 --- a/vendor/spatie/laravel-ray/src/Payloads/ModelPayload.php +++ /dev/null @@ -1,43 +0,0 @@ -model = $model; - } - - public function getType(): string - { - return 'eloquent_model'; - } - - public function getContent(): array - { - if (! $this->model) { - return []; - } - - $content = [ - 'class_name' => get_class($this->model), - 'attributes' => ArgumentConverter::convertToPrimitive($this->model->attributesToArray()), - ]; - - $relations = $this->model->relationsToArray(); - - if (count($relations)) { - $content['relations'] = ArgumentConverter::convertToPrimitive($relations); - } - - return $content; - } -} diff --git a/vendor/spatie/laravel-ray/src/Payloads/QueryPayload.php b/vendor/spatie/laravel-ray/src/Payloads/QueryPayload.php deleted file mode 100644 index 18e7ccb2..00000000 --- a/vendor/spatie/laravel-ray/src/Payloads/QueryPayload.php +++ /dev/null @@ -1,30 +0,0 @@ -query = $query; - } - - public function getType(): string - { - return 'executed_query'; - } - - public function getContent(): array - { - return [ - 'sql' => $this->query->toSql(), - 'bindings' => $this->query->getBindings(), - ]; - } -} diff --git a/vendor/spatie/laravel-ray/src/Payloads/ResponsePayload.php b/vendor/spatie/laravel-ray/src/Payloads/ResponsePayload.php deleted file mode 100644 index 6cae7b8a..00000000 --- a/vendor/spatie/laravel-ray/src/Payloads/ResponsePayload.php +++ /dev/null @@ -1,70 +0,0 @@ -getStatusCode(), - $testResponse->headers->all(), - $testResponse->content(), - $json = rescue(function () use ($testResponse) { - return $testResponse->json(); - }, null, false) - ); - } - - public function __construct(int $statusCode, array $headers, string $content, ?array $json = null) - { - $this->statusCode = $statusCode; - - $this->headers = $this->normalizeHeaders($headers); - - $this->content = $content; - - $this->json = $json; - } - - public function getType(): string - { - return 'response'; - } - - public function getContent(): array - { - return [ - 'status_code' => $this->statusCode, - 'headers' => ArgumentConverter::convertToPrimitive($this->headers), - 'content' => $this->content, - 'json' => ArgumentConverter::convertToPrimitive($this->json), - ]; - } - - protected function normalizeHeaders(array $headers): array - { - return collect($headers) - ->map(function (array $values) { - return $values[0] ?? null; - }) - ->filter() - ->toArray(); - } -} diff --git a/vendor/spatie/laravel-ray/src/Payloads/ViewPayload.php b/vendor/spatie/laravel-ray/src/Payloads/ViewPayload.php deleted file mode 100644 index 4183c74e..00000000 --- a/vendor/spatie/laravel-ray/src/Payloads/ViewPayload.php +++ /dev/null @@ -1,53 +0,0 @@ -view = $view; - } - - public function getType(): string - { - return 'view'; - } - - public function getContent(): array - { - return [ - 'view_path' => $this->view->getPath(), - 'view_path_relative_to_project_root' => Str::after($this->pathRelativeToProjectRoot($this->view), '/'), - 'data' => ArgumentConverter::convertToPrimitive($this->getData($this->view)), - ]; - } - - protected function pathRelativeToProjectRoot(View $view): string - { - $path = $view->getPath(); - - if (Str::startsWith($path, base_path())) { - $path = substr($path, strlen(base_path())); - } - - return $path; - } - - protected function getData(View $view): array - { - return collect($view->getData()) - ->filter(function ($value, $key) { - return ! in_array($key, ['app', '__env', 'obLevel', 'errors']); - }) - ->toArray(); - } -} diff --git a/vendor/spatie/laravel-ray/src/Ray.php b/vendor/spatie/laravel-ray/src/Ray.php deleted file mode 100644 index ae9c334d..00000000 --- a/vendor/spatie/laravel-ray/src/Ray.php +++ /dev/null @@ -1,509 +0,0 @@ -sendRequest($payload); - - return $this; - } - - public function mailable(Mailable ...$mailables): self - { - $shouldRestoreFake = false; - - if (get_class(app(MailManager::class)) === MailFake::class) { - $shouldRestoreFake = true; - - Mail::swap(new MailManager(app())); - } - - if ($shouldRestoreFake) { - Mail::fake(); - } - - $payloads = array_map(function (Mailable $mailable) { - return MailablePayload::forMailable($mailable); - }, $mailables); - - $this->sendRequest($payloads); - - return $this; - } - - /** - * @param Model|iterable ...$model - * - * @return \Spatie\LaravelRay\Ray - */ - public function model(...$model): self - { - $models = []; - foreach ($model as $passedModel) { - if (is_null($passedModel)) { - $models[] = null; - - continue; - } - if ($passedModel instanceof Model) { - $models[] = $passedModel; - - continue; - } - - if (is_iterable($model)) { - foreach ($passedModel as $item) { - $models[] = $item; - - continue; - } - } - } - - $payloads = array_map(function (?Model $model) { - return new ModelPayload($model); - }, $models); - - foreach ($payloads as $payload) { - ray()->sendRequest($payload); - } - - return $this; - } - - /** - * @param Model|iterable $models - * - * @return \Spatie\LaravelRay\Ray - */ - public function models($models): self - { - return $this->model($models); - } - - public function markdown(string $markdown): self - { - $payload = new MarkdownPayload($markdown); - - $this->sendRequest($payload); - - return $this; - } - - /** - * @param string[]|array|null $onlyShowNames - * @param string|null $filename - * - * @return \Spatie\LaravelRay\Ray - */ - public function env(?array $onlyShowNames = null, ?string $filename = null): self - { - $filename = $filename ?? app()->environmentFilePath(); - - $payload = new EnvironmentPayload($onlyShowNames, $filename); - - $this->sendRequest($payload); - - return $this; - } - - /** - * @param null $callable - * - * @return \Spatie\LaravelRay\Ray - */ - public function showEvents($callable = null) - { - $watcher = app(EventWatcher::class); - - return $this->handleWatcherCallable($watcher, $callable); - } - - public function events($callable = null) - { - return $this->showEvents($callable); - } - - public function stopShowingEvents(): self - { - /** @var \Spatie\LaravelRay\Watchers\EventWatcher $eventWatcher */ - $eventWatcher = app(EventWatcher::class); - - $eventWatcher->disable(); - - return $this; - } - - public function showExceptions(): self - { - /** @var \Spatie\LaravelRay\Watchers\ExceptionWatcher $exceptionWatcher */ - $exceptionWatcher = app(ExceptionWatcher::class); - - $exceptionWatcher->enable(); - - return $this; - } - - public function stopShowingExceptions(): self - { - /** @var \Spatie\LaravelRay\Watchers\ExceptionWatcher $exceptionWatcher */ - $exceptionWatcher = app(ExceptionWatcher::class); - - $exceptionWatcher->disable(); - - return $this; - } - - /** - * @param null $callable - * - * @return \Spatie\LaravelRay\Ray - */ - public function showJobs($callable = null) - { - $watcher = app(JobWatcher::class); - - return $this->handleWatcherCallable($watcher, $callable); - } - - /** - * @param null $callable - * - * @return \Spatie\LaravelRay\Ray - */ - public function showCache($callable = null) - { - $watcher = app(CacheWatcher::class); - - return $this->handleWatcherCallable($watcher, $callable); - } - - public function stopShowingCache(): self - { - app(CacheWatcher::class)->disable(); - - return $this; - } - - public function jobs($callable = null) - { - return $this->showJobs($callable); - } - - public function stopShowingJobs(): self - { - app(JobWatcher::class)->disable(); - - return $this; - } - - public function view(View $view): self - { - $payload = new ViewPayload($view); - - return $this->sendRequest($payload); - } - - /** - * @param null $callable - * - * @return \Spatie\LaravelRay\Ray - */ - public function showViews($callable = null) - { - $watcher = app(ViewWatcher::class); - - return $this->handleWatcherCallable($watcher, $callable); - } - - public function views($callable = null) - { - return $this->showViews($callable); - } - - public function stopShowingViews(): self - { - app(ViewWatcher::class)->disable(); - - return $this; - } - - /** - * @param null $callable - * - * @return \Spatie\LaravelRay\Ray - */ - public function showQueries($callable = null) - { - $watcher = app(QueryWatcher::class); - - return $this->handleWatcherCallable($watcher, $callable); - } - - public function countQueries(callable $callable) - { - /** @var QueryWatcher $watcher */ - $watcher = app(QueryWatcher::class); - - $watcher->keepExecutedQueries(); - - if (! $watcher->enabled()) { - $watcher->doNotSendIndividualQueries(); - } - - $this->handleWatcherCallable($watcher, $callable); - - $executedQueryStatistics = collect($watcher->getExecutedQueries()) - - ->pipe(function (Collection $queries) { - return [ - 'Count' => $queries->count(), - 'Total time' => $queries->sum(function (QueryExecuted $query) { - return $query->time; - }), - ]; - }); - - $executedQueryStatistics['Total time'] .= ' ms'; - - $watcher - ->stopKeepingAndClearExecutedQueries() - ->sendIndividualQueries(); - - $this->table($executedQueryStatistics, 'Queries'); - } - - public function queries($callable = null) - { - return $this->showQueries($callable); - } - - public function stopShowingQueries(): self - { - app(QueryWatcher::class)->disable(); - - return $this; - } - - public function slowQueries($milliseconds = 500, $callable = null) - { - return $this->showSlowQueries($milliseconds, $callable); - } - - public function showSlowQueries($milliseconds = 500, $callable = null) - { - $watcher = app(SlowQueryWatcher::class) - ->setMinimumTimeInMilliseconds($milliseconds); - - return $this->handleWatcherCallable($watcher, $callable); - } - - public function stopShowingSlowQueries(): self - { - app(SlowQueryWatcher::class)->disable(); - - return $this; - } - - /** - * @param null $callable - * - * @return \Spatie\LaravelRay\Ray - */ - public function showDuplicateQueries($callable = null) - { - $watcher = app(DuplicateQueryWatcher::class); - - return $this->handleWatcherCallable($watcher, $callable); - } - - public function stopShowingDuplicateQueries(): self - { - app(DuplicateQueryWatcher::class)->disable(); - - return $this; - } - - /** - * @param null $callable - * - * @return \Spatie\LaravelRay\Ray - */ - public function showRequests($callable = null) - { - $watcher = app(RequestWatcher::class); - - return $this->handleWatcherCallable($watcher, $callable); - } - - public function requests($callable = null) - { - return $this->showRequests($callable); - } - - public function stopShowingRequests(): self - { - $this->requestWatcher()->disable(); - - return $this; - } - - /** - * @param null $callable - * - * @return \Spatie\LaravelRay\Ray - */ - public function showHttpClientRequests($callable = null) - { - if (! HttpClientWatcher::supportedByLaravelVersion()) { - $this->send("Http logging is not available in your Laravel version")->red(); - - return $this; - } - - $watcher = app(HttpClientWatcher::class); - - return $this->handleWatcherCallable($watcher, $callable); - } - - public function httpClientRequests($callable = null) - { - return $this->showHttpClientRequests($callable); - } - - public function stopShowingHttpClientRequests(): self - { - app(HttpClientWatcher::class)->disable(); - - return $this; - } - - protected function handleWatcherCallable(Watcher $watcher, Closure $callable = null): RayProxy - { - $rayProxy = new RayProxy(); - - $wasEnabled = $watcher->enabled(); - - $watcher->enable(); - - if ($rayProxy) { - $watcher->setRayProxy($rayProxy); - } - - if ($callable) { - $callable(); - - if (! $wasEnabled) { - $watcher->disable(); - } - } - - return $rayProxy; - } - - public function testResponse(TestResponse $testResponse) - { - $payload = ResponsePayload::fromTestResponse($testResponse); - - $this->sendRequest($payload); - } - - protected function requestWatcher(): RequestWatcher - { - return app(RequestWatcher::class); - } - - public function exception(Throwable $exception, array $meta = []) - { - $payloads[] = new ExceptionPayload($exception, $meta); - - if ($exception instanceof QueryException) { - $executedQuery = new QueryExecuted($exception->getSql(), $exception->getBindings(), null, DB::connection(config('database.default'))); - - $payloads[] = new ExecutedQueryPayload($executedQuery); - } - - $this->sendRequest($payloads)->red(); - - return $this; - } - - /** - * @param \Spatie\Ray\Payloads\Payload|\Spatie\Ray\Payloads\Payload[] $payloads - * @param array $meta - * - * @return \Spatie\Ray\Ray - * @throws \Exception - */ - public function sendRequest($payloads, array $meta = []): BaseRay - { - if (! $this->enabled()) { - return $this; - } - - $meta['laravel_version'] = app()->version(); - - if (class_exists(InstalledVersions::class)) { - try { - $meta['laravel_ray_package_version'] = InstalledVersions::getVersion('spatie/laravel-ray'); - } catch (\Exception $e) { - $meta['laravel_ray_package_version'] = '0.0.0'; - } - } - - return BaseRay::sendRequest($payloads, $meta); - } -} diff --git a/vendor/spatie/laravel-ray/src/RayProxy.php b/vendor/spatie/laravel-ray/src/RayProxy.php deleted file mode 100644 index dab36fef..00000000 --- a/vendor/spatie/laravel-ray/src/RayProxy.php +++ /dev/null @@ -1,23 +0,0 @@ -methodsCalled[] = compact('method', 'arguments'); - } - - public function applyCalledMethods(Ray $ray) - { - foreach ($this->methodsCalled as $methodCalled) { - call_user_func_array([$ray, $methodCalled['method']], $methodCalled['arguments']); - } - } -} diff --git a/vendor/spatie/laravel-ray/src/RayServiceProvider.php b/vendor/spatie/laravel-ray/src/RayServiceProvider.php deleted file mode 100644 index f4fb8790..00000000 --- a/vendor/spatie/laravel-ray/src/RayServiceProvider.php +++ /dev/null @@ -1,256 +0,0 @@ -registerCommands() - ->registerSettings() - ->setProjectName() - ->registerBindings() - ->registerWatchers() - ->registerMacros() - ->registerBindings() - ->registerBladeDirectives() - ->registerPayloadFinder(); - } - - public function boot() - { - $this->bootWatchers(); - } - - protected function registerCommands(): self - { - $this->commands(PublishConfigCommand::class); - - return $this; - } - - protected function registerSettings(): self - { - $this->app->singleton(Settings::class, function ($app) { - $settings = SettingsFactory::createFromConfigFile($app->configPath()); - - return $settings->setDefaultSettings([ - 'enable' => env('RAY_ENABLED', ! app()->environment('production')), - 'send_cache_to_ray' => env('SEND_CACHE_TO_RAY', false), - 'send_dumps_to_ray' => env('SEND_DUMPS_TO_RAY', true), - 'send_jobs_to_ray' => env('SEND_JOBS_TO_RAY', false), - 'send_log_calls_to_ray' => env('SEND_LOG_CALLS_TO_RAY', true), - 'send_queries_to_ray' => env('SEND_QUERIES_TO_RAY', false), - 'send_duplicate_queries_to_ray' => env('SEND_DUPLICATE_QUERIES_TO_RAY', false), - 'send_slow_queries_to_ray' => env('SEND_SLOW_QUERIES_TO_RAY', false), - 'send_requests_to_ray' => env('SEND_REQUESTS_TO_RAY', false), - 'send_http_client_requests_to_ray' => env('SEND_HTTP_CLIENT_REQUESTS_TO_RAY', false), - 'send_views_to_ray' => env('SEND_VIEWS_TO_RAY', false), - 'send_exceptions_to_ray' => env('SEND_EXCEPTIONS_TO_RAY', true), - 'send_deprecated_notices_to_ray' => env('SEND_DEPRECATED_NOTICES_TO_RAY', false), - ]); - }); - - return $this; - } - - public function setProjectName(): self - { - if (Ray::$projectName === '') { - $projectName = config('app.name'); - - if ($projectName !== 'Laravel') { - ray()->project($projectName); - } - } - - return $this; - } - - protected function registerBindings(): self - { - $settings = app(Settings::class); - - $this->app->bind(Client::class, function () use ($settings) { - return new Client($settings->port, $settings->host); - }); - - $this->app->bind(Ray::class, function () { - $client = app(Client::class); - - $settings = app(Settings::class); - - $ray = new Ray($settings, $client); - - if (! $settings->enable) { - $ray->disable(); - } - - return $ray; - }); - - Payload::$originFactoryClass = OriginFactory::class; - - return $this; - } - - protected function registerWatchers(): self - { - $watchers = [ - ExceptionWatcher::class, - LoggedMailWatcher::class, - ApplicationLogWatcher::class, - JobWatcher::class, - EventWatcher::class, - DumpWatcher::class, - QueryWatcher::class, - DuplicateQueryWatcher::class, - SlowQueryWatcher::class, - ViewWatcher::class, - CacheWatcher::class, - RequestWatcher::class, - HttpClientWatcher::class, - DeprecatedNoticeWatcher::class, - ]; - - collect($watchers) - ->each(function (string $watcherClass) { - $this->app->singleton($watcherClass); - }); - - return $this; - } - - protected function bootWatchers(): self - { - $watchers = [ - ExceptionWatcher::class, - LoggedMailWatcher::class, - ApplicationLogWatcher::class, - JobWatcher::class, - EventWatcher::class, - DumpWatcher::class, - QueryWatcher::class, - DuplicateQueryWatcher::class, - SlowQueryWatcher::class, - ViewWatcher::class, - CacheWatcher::class, - RequestWatcher::class, - HttpClientWatcher::class, - DeprecatedNoticeWatcher::class, - ]; - - collect($watchers) - ->each(function (string $watcherClass) { - /** @var \Spatie\LaravelRay\Watchers\Watcher $watcher */ - $watcher = app($watcherClass); - - $watcher->register(); - }); - - return $this; - } - - protected function registerMacros(): self - { - Collection::macro('ray', function (string $description = '') { - $description === '' - ? ray($this->items) - : ray($description, $this->items); - - return $this; - }); - - TestResponse::macro('ray', function () { - ray()->testResponse($this); - - return $this; - }); - - - Stringable::macro('ray', function (string $description = '') { - $description === '' - ? ray($this->value) - : ray($description, $this->value); - - return $this; - }); - - - Builder::macro('ray', function () { - $payload = new QueryPayload($this); - - ray()->sendRequest($payload); - - return $this; - }); - - return $this; - } - - protected function registerBladeDirectives(): self - { - if (! $this->app->has('blade.compiler')) { - return $this; - } - - $this->callAfterResolving('blade.compiler', function (BladeCompiler $bladeCompiler) { - Blade::directive('ray', function ($expression) { - return ""; - }); - }); - - return $this; - } - - protected function registerPayloadFinder(): self - { - PayloadFactory::registerPayloadFinder(function ($argument) { - if ($argument instanceof Model) { - return new ModelPayload($argument); - } - - if ($argument instanceof Mailable) { - return MailablePayload::forMailable($argument); - } - - return null; - }); - - return $this; - } -} diff --git a/vendor/spatie/laravel-ray/src/Watchers/ApplicationLogWatcher.php b/vendor/spatie/laravel-ray/src/Watchers/ApplicationLogWatcher.php deleted file mode 100644 index 48ef0314..00000000 --- a/vendor/spatie/laravel-ray/src/Watchers/ApplicationLogWatcher.php +++ /dev/null @@ -1,82 +0,0 @@ -enabled = $ray->settings->send_log_calls_to_ray; - - Event::listen(MessageLogged::class, function (MessageLogged $message) { - if (! $this->shouldLogMessage($message)) { - return; - } - - if (! class_exists('Spatie\Ray\Payloads\ApplicationLogPayload')) { - return; - } - - $payload = new ApplicationLogPayload($message->message); - - /** @var Ray $ray */ - $ray = app(Ray::class); - - $ray->sendRequest($payload); - - switch ($message->level) { - case 'error': - case 'critical': - case 'alert': - case 'emergency': - $ray->color('red'); - - break; - case 'warning': - $ray->color('orange'); - - break; - } - }); - } - - protected function shouldLogMessage(MessageLogged $message): bool - { - if (! $this->enabled()) { - return false; - } - - if (is_null($message->message)) { - return false; - } - - /** @var Ray $ray */ - $ray = app(Ray::class); - - if (! $ray->settings->send_log_calls_to_ray) { - return false; - } - - if ((new ExceptionWatcher())->concernsException($message)) { - return false; - } - - if ((new LoggedMailWatcher())->concernsLoggedMail($message)) { - return false; - } - - if ((new DeprecatedNoticeWatcher())->concernsDeprecatedNotice($message)) { - return false; - } - - return true; - } -} diff --git a/vendor/spatie/laravel-ray/src/Watchers/CacheWatcher.php b/vendor/spatie/laravel-ray/src/Watchers/CacheWatcher.php deleted file mode 100644 index 87aeaaee..00000000 --- a/vendor/spatie/laravel-ray/src/Watchers/CacheWatcher.php +++ /dev/null @@ -1,83 +0,0 @@ -enabled = $settings->send_cache_to_ray; - - app('events')->listen(CacheHit::class, function (CacheHit $event) { - if (! $this->enabled()) { - return; - } - - $payload = new CachePayload('Hit', $event->key, $event->tags, $event->value); - - $ray = $this->ray()->sendRequest($payload); - - optional($this->rayProxy)->applyCalledMethods($ray); - }); - - app('events')->listen(CacheMissed::class, function (CacheMissed $event) { - if (! $this->enabled()) { - return; - } - - $payload = new CachePayload('Missed', $event->key, $event->tags); - - $this->ray()->sendRequest($payload); - }); - - app('events')->listen(KeyWritten::class, function (KeyWritten $event) { - if (! $this->enabled()) { - return; - } - - $payload = new CachePayload( - 'Key written', - $event->key, - $event->tags, - $event->value, - $this->formatExpiration($event), - ); - - $this->ray()->sendRequest($payload); - }); - - app('events')->listen(KeyForgotten::class, function (KeyForgotten $event) { - if (! $this->enabled()) { - return; - } - - $payload = new CachePayload( - 'Key forgotten', - $event->key, - $event->tags - ); - - $this->ray()->sendRequest($payload); - }); - } - - protected function formatExpiration(KeyWritten $event): ?int - { - return $event->seconds; - } - - public function ray(): Ray - { - return app(Ray::class); - } -} diff --git a/vendor/spatie/laravel-ray/src/Watchers/DeprecatedNoticeWatcher.php b/vendor/spatie/laravel-ray/src/Watchers/DeprecatedNoticeWatcher.php deleted file mode 100644 index 1f935b75..00000000 --- a/vendor/spatie/laravel-ray/src/Watchers/DeprecatedNoticeWatcher.php +++ /dev/null @@ -1,27 +0,0 @@ -enabled = $settings->send_deprecated_notices_to_ray; - - if ($this->enabled()) { - return false; - } - - return Str::contains($messageLogged->message, ['deprecated', 'Deprecated', '[\ReturnTypeWillChange]']); - } -} diff --git a/vendor/spatie/laravel-ray/src/Watchers/DumpWatcher.php b/vendor/spatie/laravel-ray/src/Watchers/DumpWatcher.php deleted file mode 100644 index 0be0a206..00000000 --- a/vendor/spatie/laravel-ray/src/Watchers/DumpWatcher.php +++ /dev/null @@ -1,18 +0,0 @@ -enabled = $settings->send_dumps_to_ray; - - app(DumpRecorder::class)->register(); - } -} diff --git a/vendor/spatie/laravel-ray/src/Watchers/DuplicateQueryWatcher.php b/vendor/spatie/laravel-ray/src/Watchers/DuplicateQueryWatcher.php deleted file mode 100644 index 31170ef5..00000000 --- a/vendor/spatie/laravel-ray/src/Watchers/DuplicateQueryWatcher.php +++ /dev/null @@ -1,79 +0,0 @@ -enabled = $settings->send_duplicate_queries_to_ray; - - DB::listen(function (QueryExecuted $query) { - if (! $this->enabled()) { - return; - } - - $sql = Str::replaceArray('?', $this->cleanupBindings($query->bindings), $query->sql); - - $duplicated = in_array($sql, $this->executedQueries); - - $this->executedQueries[] = $sql; - - if (! $duplicated) { - return; - } - - $payload = new ExecutedQueryPayload($query); - - $ray = app(Ray::class)->sendRequest($payload); - - optional($this->rayProxy)->applyCalledMethods($ray); - }); - } - - private function cleanupBindings(array $bindings): array - { - return array_map(function ($binding) { - if ($binding instanceof \DateTimeInterface) { - return $binding->format('Y-m-d H:i:s'); - } - - return $binding; - }, $bindings); - } - - public function enable(): Watcher - { - DB::enableQueryLog(); - - parent::enable(); - - return $this; - } - - public function getExecutedQueries(): array - { - return $this->executedQueries; - } - - public function disable(): Watcher - { - DB::disableQueryLog(); - - parent::disable(); - - return $this; - } -} diff --git a/vendor/spatie/laravel-ray/src/Watchers/EventWatcher.php b/vendor/spatie/laravel-ray/src/Watchers/EventWatcher.php deleted file mode 100644 index 80564e9d..00000000 --- a/vendor/spatie/laravel-ray/src/Watchers/EventWatcher.php +++ /dev/null @@ -1,25 +0,0 @@ -enabled()) { - return; - } - - $payload = new EventPayload($eventName, $arguments); - - $ray = app(Ray::class)->sendRequest($payload); - - optional($this->rayProxy)->applyCalledMethods($ray); - }); - } -} diff --git a/vendor/spatie/laravel-ray/src/Watchers/ExceptionWatcher.php b/vendor/spatie/laravel-ray/src/Watchers/ExceptionWatcher.php deleted file mode 100644 index b417dfbf..00000000 --- a/vendor/spatie/laravel-ray/src/Watchers/ExceptionWatcher.php +++ /dev/null @@ -1,82 +0,0 @@ -enabled = $settings->send_exceptions_to_ray; - - Event::listen(MessageLogged::class, function (MessageLogged $message) { - if (! $this->enabled()) { - return; - } - - if (! $this->concernsException($message)) { - return; - } - - $exception = $message->context['exception']; - - $meta = []; - - if ($flareReport = $this->getFlareReport($exception)) { - $meta['flare_report'] = $flareReport; - } - - /** @var Ray $ray */ - $ray = app(Ray::class); - - $ray->exception($exception, $meta); - }); - } - - public function concernsException(MessageLogged $messageLogged): bool - { - if (! isset($messageLogged->context['exception'])) { - return false; - } - - if (! $messageLogged->context['exception'] instanceof Exception) { - return false; - } - - return true; - } - - public function getFlareReport(Throwable $exception): ?array - { - if (app()->bound(Flare::class)) { - $flare = app(Flare::class); - - $report = $flare->createReport($exception); - - return (new ReportTrimmer())->trim($report->toArray()); - } - - if (app()->bound(FacadeFlare::class)) { - /** @var \Facade\FlareClient\Flare $flare */ - $flare = app(FacadeFlare::class); - - $report = $flare->createReport($exception); - - return (new FacadeReportTrimmer())->trim($report->toArray()); - } - - return null; - } -} diff --git a/vendor/spatie/laravel-ray/src/Watchers/HttpClientWatcher.php b/vendor/spatie/laravel-ray/src/Watchers/HttpClientWatcher.php deleted file mode 100644 index 2ceaab02..00000000 --- a/vendor/spatie/laravel-ray/src/Watchers/HttpClientWatcher.php +++ /dev/null @@ -1,99 +0,0 @@ -enabled = $settings->send_http_client_requests_to_ray; - - Event::listen(RequestSending::class, function (RequestSending $event) { - if (! $this->enabled()) { - return; - } - - $ray = $this->handleRequest($event->request); - - optional($this->rayProxy)->applyCalledMethods($ray); - }); - - Event::listen(ResponseReceived::class, function (ResponseReceived $event) { - if (! $this->enabled()) { - return; - } - - $ray = $this->handleResponse($event->request, $event->response); - - optional($this->rayProxy)->applyCalledMethods($ray); - }); - } - - protected function handleRequest(Request $request) - { - $payload = new TablePayload([ - 'Method' => $request->method(), - 'URL' => $request->url(), - 'Headers' => $request->headers(), - 'Data' => $request->data(), - 'Body' => $request->body(), - 'Type' => $this->getRequestType($request), - ], 'Http'); - - return app(Ray::class)->sendRequest($payload); - } - - protected function getRequestType(Request $request) - { - if ($request->isJson()) { - return 'Json'; - } - - if ($request->isMultipart()) { - return 'Multipart'; - } - - return 'Form'; - } - - protected function handleResponse(Request $request, Response $response) - { - $payload = new TablePayload([ - 'URL' => $request->url(), - 'Real Request' => ! empty($response->handlerStats()), - 'Success' => $response->successful(), - 'Status' => $response->status(), - 'Headers' => $response->headers(), - 'Body' => rescue(function () use ($response) { - return $response->json(); - }, $response->body(), false), - 'Cookies' => $response->cookies(), - 'Size' => $response->handlerStats()['size_download'] ?? null, - 'Connection time' => $response->handlerStats()['connect_time'] ?? null, - 'Duration' => $response->handlerStats()['total_time'] ?? null, - 'Request Size' => $response->handlerStats()['request_size'] ?? null, - ], 'Http'); - - return app(Ray::class)->sendRequest($payload); - } - - public static function supportedByLaravelVersion() - { - return version_compare(app()->version(), '8.46.0', '>='); - } -} diff --git a/vendor/spatie/laravel-ray/src/Watchers/JobWatcher.php b/vendor/spatie/laravel-ray/src/Watchers/JobWatcher.php deleted file mode 100644 index 394bb95e..00000000 --- a/vendor/spatie/laravel-ray/src/Watchers/JobWatcher.php +++ /dev/null @@ -1,39 +0,0 @@ -enabled = $settings->send_jobs_to_ray; - - Event::listen([ - JobQueued::class, - JobProcessing::class, - JobProcessed::class, - JobFailed::class, - ], function (object $event) { - if (! $this->enabled()) { - return; - } - - $payload = new JobEventPayload($event); - - $ray = app(Ray::class)->sendRequest($payload); - - optional($this->rayProxy)->applyCalledMethods($ray); - }); - } -} diff --git a/vendor/spatie/laravel-ray/src/Watchers/LoggedMailWatcher.php b/vendor/spatie/laravel-ray/src/Watchers/LoggedMailWatcher.php deleted file mode 100644 index 12d1f175..00000000 --- a/vendor/spatie/laravel-ray/src/Watchers/LoggedMailWatcher.php +++ /dev/null @@ -1,44 +0,0 @@ -enable(); - - Event::listen(MessageLogged::class, function (MessageLogged $messageLogged) { - if (! $this->enabled()) { - return; - } - - if (! $this->concernsLoggedMail($messageLogged)) { - return; - } - - /** @var Ray $ray */ - $ray = app(Ray::class); - - $ray->loggedMail($messageLogged->message); - }); - } - - public function concernsLoggedMail(MessageLogged $messageLogged): bool - { - if (! Str::contains($messageLogged->message, 'Message-ID')) { - return false; - } - - if (! Str::contains($messageLogged->message, 'To:')) { - return false; - } - - return true; - } -} diff --git a/vendor/spatie/laravel-ray/src/Watchers/QueryWatcher.php b/vendor/spatie/laravel-ray/src/Watchers/QueryWatcher.php deleted file mode 100644 index fba1940a..00000000 --- a/vendor/spatie/laravel-ray/src/Watchers/QueryWatcher.php +++ /dev/null @@ -1,101 +0,0 @@ -enabled = $settings->send_queries_to_ray; - - DB::listen(function (QueryExecuted $query) { - if (! $this->enabled()) { - return; - } - - if ($this->keepExecutedQueries) { - $this->executedQueries[] = $query; - } - - if (! $this->sendIndividualQueries) { - return; - } - - $payload = new ExecutedQueryPayload($query); - - $ray = app(Ray::class)->sendRequest($payload); - - optional($this->rayProxy)->applyCalledMethods($ray); - }); - } - - public function enable(): Watcher - { - DB::enableQueryLog(); - - parent::enable(); - - return $this; - } - - public function keepExecutedQueries(): self - { - $this->keepExecutedQueries = true; - - return $this; - } - - public function getExecutedQueries(): array - { - return $this->executedQueries; - } - - public function sendIndividualQueries(): self - { - $this->sendIndividualQueries = true; - - return $this; - } - - public function doNotSendIndividualQueries(): self - { - $this->sendIndividualQueries = false; - - return $this; - } - - public function stopKeepingAndClearExecutedQueries(): self - { - $this->keepExecutedQueries = false; - - $this->executedQueries = []; - - return $this; - } - - public function disable(): Watcher - { - DB::disableQueryLog(); - - parent::disable(); - - return $this; - } -} diff --git a/vendor/spatie/laravel-ray/src/Watchers/RequestWatcher.php b/vendor/spatie/laravel-ray/src/Watchers/RequestWatcher.php deleted file mode 100644 index 60cc90e3..00000000 --- a/vendor/spatie/laravel-ray/src/Watchers/RequestWatcher.php +++ /dev/null @@ -1,133 +0,0 @@ -enabled = $settings->send_requests_to_ray; - - Event::listen(RequestHandled::class, function (RequestHandled $event) { - if (! $this->enabled()) { - return; - } - - $ray = $this->handleRequest($event->request, $event->response); - - optional($this->rayProxy)->applyCalledMethods($ray); - }); - } - - protected function handleRequest(Request $request, Response $response): Ray - { - $startTime = defined('LARAVEL_START') - ? LARAVEL_START - : $request->server('REQUEST_TIME_FLOAT'); - - $headers = collect($request->headers->all()) - ->map(function (array $header) { - return $header[0]; - }) - ->toArray(); - - $session = $request->hasSession() - ? $request->session()->all() - : []; - - $payload = new TablePayload([ - 'IP Address' => $request->ip(), - 'URI' => str_replace($request->root(), '', $request->fullUrl()) ?: '/', - 'Method' => $request->method(), - 'Controller action' => optional($request->route())->getActionName(), - 'Middleware' => array_values(optional($request->route())->gatherMiddleware() ?? []), - 'Headers' => $headers, - 'Payload' => $this->payload($request), - 'Session' => $session, - 'Response code' => $response->getStatusCode(), - 'Response' => $this->response($response), - 'Duration' => $startTime ? floor((microtime(true) - $startTime) * 1000) : null, - 'Memory' => round(memory_get_peak_usage(true) / 1024 / 1024, 1), - ], 'Request'); - - return app(Ray::class)->sendRequest($payload); - } - - private function payload(Request $request) - { - $files = $request->files->all(); - - array_walk_recursive($files, function (&$file) { - $file = [ - 'name' => $file->getClientOriginalName(), - 'size' => $file->isFile() ? ($file->getSize() / 1000) . 'KB' : '0', - ]; - }); - - return array_replace_recursive($request->input(), $files); - } - - protected function response(Response $response) - { - $content = $response->getContent(); - - if (is_string($content)) { - if (is_array(json_decode($content, true)) && - json_last_error() === JSON_ERROR_NONE) { - return json_decode($content, true); - } - - if (Str::startsWith(strtolower($response->headers->get('Content-Type')), 'text/plain')) { - return $content; - } - } - - if ($response instanceof RedirectResponse) { - return 'Redirected to ' . $response->getTargetUrl(); - } - - if ($response instanceof IlluminateResponse && $response->getOriginalContent() instanceof View) { - return [ - 'view' => $response->getOriginalContent()->getPath(), - 'data' => $this->extractDataFromView($response->getOriginalContent()), - ]; - } - - return 'HTML Response'; - } - - protected function extractDataFromView($view) - { - return collect($view->getData()) - ->map(function ($value) { - if ($value instanceof Model) { - return $value->toArray(); - } - - if (is_object($value)) { - return [ - 'class' => get_class($value), - 'properties' => json_decode(json_encode($value), true), - ]; - } - - return json_decode(json_encode($value), true); - }) - ->toArray(); - } -} diff --git a/vendor/spatie/laravel-ray/src/Watchers/SlowQueryWatcher.php b/vendor/spatie/laravel-ray/src/Watchers/SlowQueryWatcher.php deleted file mode 100644 index 178d5142..00000000 --- a/vendor/spatie/laravel-ray/src/Watchers/SlowQueryWatcher.php +++ /dev/null @@ -1,45 +0,0 @@ -enabled = $settings->send_slow_queries_to_ray ?? false; - $this->minimumTimeInMs = $settings->slow_query_threshold_in_ms ?? $this->minimumTimeInMs; - - DB::listen(function (QueryExecuted $query) { - if (! $this->enabled()) { - return; - } - - $ray = app(Ray::class); - - if ($query->time >= $this->minimumTimeInMs) { - $payload = new ExecutedQueryPayload($query); - - $ray->sendRequest($payload); - } - - optional($this->rayProxy)->applyCalledMethods($ray); - }); - } - - public function setMinimumTimeInMilliseconds(float $milliseconds): self - { - $this->minimumTimeInMs = $milliseconds; - - return $this; - } -} diff --git a/vendor/spatie/laravel-ray/src/Watchers/ViewWatcher.php b/vendor/spatie/laravel-ray/src/Watchers/ViewWatcher.php deleted file mode 100644 index ef657134..00000000 --- a/vendor/spatie/laravel-ray/src/Watchers/ViewWatcher.php +++ /dev/null @@ -1,30 +0,0 @@ -enabled = $settings->send_views_to_ray; - - Event::listen('composing:*', function ($event, $data) { - if (! $this->enabled()) { - return; - } - - /** @var \Illuminate\View\View $view */ - $view = $data[0]; - - $ray = app(Ray::class)->view($view); - - optional($this->rayProxy)->applyCalledMethods($ray); - }); - } -} diff --git a/vendor/spatie/laravel-ray/src/Watchers/Watcher.php b/vendor/spatie/laravel-ray/src/Watchers/Watcher.php deleted file mode 100644 index 49e38fbc..00000000 --- a/vendor/spatie/laravel-ray/src/Watchers/Watcher.php +++ /dev/null @@ -1,42 +0,0 @@ -enabled; - } - - public function enable(): Watcher - { - $this->enabled = true; - - return $this; - } - - public function disable(): Watcher - { - $this->enabled = false; - - return $this; - } - - public function setRayProxy(RayProxy $rayProxy): Watcher - { - $this->rayProxy = $rayProxy; - - return $this; - } -} diff --git a/vendor/spatie/laravel-ray/stub/ray.php b/vendor/spatie/laravel-ray/stub/ray.php deleted file mode 100644 index ce7a33bb..00000000 --- a/vendor/spatie/laravel-ray/stub/ray.php +++ /dev/null @@ -1,108 +0,0 @@ - env('RAY_ENABLED', true), - - /* - * When enabled, all cache events will automatically be sent to Ray. - */ - 'send_cache_to_ray' => env('SEND_CACHE_TO_RAY', false), - - /* - * When enabled, all things passed to `dump` or `dd` - * will be sent to Ray as well. - */ - 'send_dumps_to_ray' => env('SEND_DUMPS_TO_RAY', true), - - /* - * When enabled all job events will automatically be sent to Ray. - */ - 'send_jobs_to_ray' => env('SEND_JOBS_TO_RAY', false), - - /* - * When enabled, all things logged to the application log - * will be sent to Ray as well. - */ - 'send_log_calls_to_ray' => env('SEND_LOG_CALLS_TO_RAY', true), - - /* - * When enabled, all queries will automatically be sent to Ray. - */ - 'send_queries_to_ray' => env('SEND_QUERIES_TO_RAY', false), - - /** - * When enabled, all duplicate queries will automatically be sent to Ray. - */ - 'send_duplicate_queries_to_ray' => env('SEND_DUPLICATE_QUERIES_TO_RAY', false), - - /* - * When enabled, slow queries will automatically be sent to Ray. - */ - 'send_slow_queries_to_ray' => env('SEND_SLOW_QUERIES_TO_RAY', false), - - /** - * Queries that are longer than this number of milliseconds will be regarded as slow. - */ - 'slow_query_threshold_in_ms' => env('RAY_SLOW_QUERY_THRESHOLD_IN_MS', 500), - - /* - * When enabled, all requests made to this app will automatically be sent to Ray. - */ - 'send_requests_to_ray' => env('SEND_REQUESTS_TO_RAY', false), - - /** - * When enabled, all Http Client requests made by this app will be automatically sent to Ray. - */ - 'send_http_client_requests_to_ray' => env('SEND_HTTP_CLIENT_REQUESTS_TO_RAY', false), - - /* - * When enabled, all views that are rendered automatically be sent to Ray. - */ - 'send_views_to_ray' => env('SEND_VIEWS_TO_RAY', false), - - /* - * When enabled, all exceptions will be automatically sent to Ray. - */ - 'send_exceptions_to_ray' => env('SEND_EXCEPTIONS_TO_RAY', true), - - /* - * When enabled, all deprecation notices will be automatically sent to Ray. - */ - 'send_deprecated_notices_to_ray' => env('SEND_DEPRECATED_NOTICES_TO_RAY', false), - - /* - * The host used to communicate with the Ray app. - * When using Docker on Mac or Windows, you can replace localhost with 'host.docker.internal' - * When using Docker on Linux, you can replace localhost with '172.17.0.1' - * When using Homestead with the VirtualBox provider, you can replace localhost with '10.0.2.2' - * When using Homestead with the Parallels provider, you can replace localhost with '10.211.55.2' - */ - 'host' => env('RAY_HOST', 'localhost'), - - /* - * The port number used to communicate with the Ray app. - */ - 'port' => env('RAY_PORT', 23517), - - /* - * Absolute base path for your sites or projects in Homestead, - * Vagrant, Docker, or another remote development server. - */ - 'remote_path' => env('RAY_REMOTE_PATH', null), - - /* - * Absolute base path for your sites or projects on your local - * computer where your IDE or code editor is running on. - */ - 'local_path' => env('RAY_LOCAL_PATH', null), - - /* - * When this setting is enabled, the package will not try to format values sent to Ray. - */ - 'always_send_raw_values' => false, -]; diff --git a/vendor/spatie/macroable/CHANGELOG.md b/vendor/spatie/macroable/CHANGELOG.md deleted file mode 100644 index a99af266..00000000 --- a/vendor/spatie/macroable/CHANGELOG.md +++ /dev/null @@ -1,18 +0,0 @@ -# Changelog - -All notable changes to `macroable` will be documented in this file - -## 2.0.0 - 2021-03-26 - -- require PHP 8+ -- drop support for PHP 7.x -- convert syntax to PHP 8 - -## 1.0.1 - 2020-11-03 - -- add support for PHP 8.0 -- drop support for PHP 7.1 and below - -## 1.0.0 - 2017-09-16 - -- initial release diff --git a/vendor/spatie/macroable/CONTRIBUTING.md b/vendor/spatie/macroable/CONTRIBUTING.md deleted file mode 100644 index 4da74e3f..00000000 --- a/vendor/spatie/macroable/CONTRIBUTING.md +++ /dev/null @@ -1,55 +0,0 @@ -# Contributing - -Contributions are **welcome** and will be fully **credited**. - -Please read and understand the contribution guide before creating an issue or pull request. - -## Etiquette - -This project is open source, and as such, the maintainers give their free time to build and maintain the source code -held within. They make the code freely available in the hope that it will be of use to other developers. It would be -extremely unfair for them to suffer abuse or anger for their hard work. - -Please be considerate towards maintainers when raising issues or presenting pull requests. Let's show the -world that developers are civilized and selfless people. - -It's the duty of the maintainer to ensure that all submissions to the project are of sufficient -quality to benefit the project. Many developers have different skillsets, strengths, and weaknesses. Respect the maintainer's decision, and do not be upset or abusive if your submission is not used. - -## Viability - -When requesting or submitting new features, first consider whether it might be useful to others. Open -source projects are used by many developers, who may have entirely different needs to your own. Think about -whether or not your feature is likely to be used by other users of the project. - -## Procedure - -Before filing an issue: - -- Attempt to replicate the problem, to ensure that it wasn't a coincidental incident. -- Check to make sure your feature suggestion isn't already present within the project. -- Check the pull requests tab to ensure that the bug doesn't have a fix in progress. -- Check the pull requests tab to ensure that the feature isn't already in progress. - -Before submitting a pull request: - -- Check the codebase to ensure that your feature doesn't already exist. -- Check the pull requests to ensure that another person hasn't already submitted the feature or fix. - -## Requirements - -If the project maintainer has any additional requirements, you will find them listed here. - -- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer). - -- **Add tests!** - Your patch won't be accepted if it doesn't have tests. - -- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date. - -- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option. - -- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests. - -- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting. - -**Happy coding**! diff --git a/vendor/spatie/macroable/LICENSE.md b/vendor/spatie/macroable/LICENSE.md deleted file mode 100644 index 59e5ec59..00000000 --- a/vendor/spatie/macroable/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Spatie bvba - -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/spatie/macroable/README.md b/vendor/spatie/macroable/README.md deleted file mode 100644 index 4e7012dc..00000000 --- a/vendor/spatie/macroable/README.md +++ /dev/null @@ -1,135 +0,0 @@ -# A trait to dynamically add methods to a class - -[![Latest Version on Packagist](https://img.shields.io/packagist/v/spatie/macroable.svg?style=flat-square)](https://packagist.org/packages/spatie/macroable) -![run-tests](https://github.com/spatie/macroable/workflows/run-tests/badge.svg) -[![Total Downloads](https://img.shields.io/packagist/dt/spatie/macroable.svg?style=flat-square)](https://packagist.org/packages/spatie/macroable) - -This package provides a trait that, when applied to a class, makes it possible to add methods to that class at runtime. - -Here's a quick example: - -```php -$myClass = new class() { - use Spatie\Macroable\Macroable; -}; - -$myClass::macro('concatenate', function(... $strings) { - return implode('-', $strings); -}); - -$myClass->concatenate('one', 'two', 'three'); // returns 'one-two-three' -``` - -The idea of a macroable trait and the implementation is taken from [the `macroable` trait](https://github.com/laravel/framework/blob/master/src/Illuminate/Support/Traits/Macroable.php) of the [Laravel framework](https://laravel.com). - -## Support us - -[](https://spatie.be/github-ad-click/macroable) - -We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us). - -We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards). - -## Installation - -You can install the package via composer: - -```bash -composer require spatie/macroable -``` - -## Usage - -You can add a new method to a class using `macro`: - -```php -$macroableClass = new class() { - use Spatie\Macroable\Macroable; -}; - -$macroableClass::macro('concatenate', function(... $strings) { - return implode('-', $strings); -}; - -$macroableClass->concatenate('one', 'two', 'three'); // returns 'one-two-three' -``` - -Callables passed to the `macro` function will be bound to the `class` - -```php -$macroableClass = new class() { - - protected $name = 'myName'; - - use Spatie\Macroable\Macroable; -}; - -$macroableClass::macro('getName', function() { - return $this->name; -}; - -$macroableClass->getName(); // returns 'myName' -``` - -You can also add multiple methods in one go by using a mixin class. A mixin class contains methods that return callables. Each method from the mixin will be registered on the macroable class. - -```php -$mixin = new class() { - public function mixinMethod() - { - return function() { - return 'mixinMethod'; - }; - } - - public function anotherMixinMethod() - { - return function() { - return 'anotherMixinMethod'; - }; - } -}; - -$macroableClass->mixin($mixin); - -$macroableClass->mixinMethod() // returns 'mixinMethod'; - -$macroableClass->anotherMixinMethod() // returns 'anotherMixinMethod'; -``` - -## Changelog - -Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. - -## Testing - -``` bash -composer test -``` - -## Contributing - -Please see [CONTRIBUTING](CONTRIBUTING.md) for details. - -## Security - -If you discover any security related issues, please email freek@spatie.be instead of using the issue tracker. - -## Postcardware - -You're free to use this package (it's [MIT-licensed](LICENSE.md)), but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. - -Our address is: Spatie, Kruikstraat 22, 2018 Antwerp, Belgium. - -We publish all received postcards [on our company website](https://spatie.be/en/opensource/postcards). - -## Credits - -- [Freek Van der Herten](https://github.com/freekmurze) -- [All Contributors](../../contributors) - -Idea and code is taken from [the `macroable` trait](https://github.com/laravel/framework/blob/master/src/Illuminate/Support/Traits/Macroable.php) of the [Laravel framework](https://laravel.com). - -## License - -The MIT License (MIT). Please see [License File](LICENSE.md) for more information. diff --git a/vendor/spatie/macroable/composer.json b/vendor/spatie/macroable/composer.json deleted file mode 100644 index 9571614a..00000000 --- a/vendor/spatie/macroable/composer.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "spatie/macroable", - "description": "A trait to dynamically add methods to a class", - "keywords": [ - "spatie", - "macroable" - ], - "homepage": "https://github.com/spatie/macroable", - "license": "MIT", - "authors": [ - { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "homepage": "https://spatie.be", - "role": "Developer" - } - ], - "require": { - "php": "^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^8.0|^9.3" - }, - "autoload": { - "psr-4": { - "Spatie\\Macroable\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "Spatie\\Macroable\\Test\\": "tests" - } - }, - "scripts": { - "test": "vendor/bin/phpunit" - }, - "config": { - "sort-packages": true - } -} diff --git a/vendor/spatie/macroable/config/.gitkeep b/vendor/spatie/macroable/config/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/vendor/spatie/macroable/src/Macroable.php b/vendor/spatie/macroable/src/Macroable.php deleted file mode 100644 index dfd3ebc0..00000000 --- a/vendor/spatie/macroable/src/Macroable.php +++ /dev/null @@ -1,66 +0,0 @@ -getMethods( - ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PROTECTED - ); - - foreach ($methods as $method) { - $method->setAccessible(true); - - static::macro($method->name, $method->invoke($mixin)); - } - } - - public static function hasMacro(string $name): bool - { - return isset(static::$macros[$name]); - } - - public static function __callStatic($method, $parameters) - { - if (! static::hasMacro($method)) { - throw new BadMethodCallException("Method {$method} does not exist."); - } - - $macro = static::$macros[$method]; - - if ($macro instanceof Closure) { - return call_user_func_array(Closure::bind($macro, null, static::class), $parameters); - } - - return call_user_func_array($macro, $parameters); - } - - public function __call($method, $parameters) - { - if (! static::hasMacro($method)) { - throw new BadMethodCallException("Method {$method} does not exist."); - } - - $macro = static::$macros[$method]; - - if ($macro instanceof Closure) { - return call_user_func_array($macro->bindTo($this, static::class), $parameters); - } - - return call_user_func_array($macro, $parameters); - } -} diff --git a/vendor/spatie/ray/.php_cs.dist.php b/vendor/spatie/ray/.php_cs.dist.php deleted file mode 100644 index 8d8a7901..00000000 --- a/vendor/spatie/ray/.php_cs.dist.php +++ /dev/null @@ -1,40 +0,0 @@ -in([ - __DIR__ . '/src', - __DIR__ . '/tests', - ]) - ->name('*.php') - ->notName('*.blade.php') - ->ignoreDotFiles(true) - ->ignoreVCS(true); - -return (new PhpCsFixer\Config()) - ->setRules([ - '@PSR12' => true, - 'array_syntax' => ['syntax' => 'short'], - 'ordered_imports' => ['sort_algorithm' => 'alpha'], - 'no_unused_imports' => true, - 'not_operator_with_successor_space' => true, - 'trailing_comma_in_multiline' => true, - 'phpdoc_scalar' => true, - 'unary_operator_spaces' => true, - 'binary_operator_spaces' => true, - 'blank_line_before_statement' => [ - 'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'], - ], - 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_var_without_name' => true, - 'class_attributes_separation' => [ - 'elements' => [ - 'method' => 'one', - ], - ], - 'method_argument_space' => [ - 'on_multiline' => 'ensure_fully_multiline', - 'keep_multiple_spaces_after_comma' => true, - ], - 'single_trait_insert_per_statement' => true, - ]) - ->setFinder($finder); diff --git a/vendor/spatie/ray/CHANGELOG.md b/vendor/spatie/ray/CHANGELOG.md deleted file mode 100644 index b8343cdc..00000000 --- a/vendor/spatie/ray/CHANGELOG.md +++ /dev/null @@ -1,483 +0,0 @@ -# Changelog - -All notable changes to `ray` will be documented in this file - -## 1.35.0 - 2022-08-09 - -### What's Changed - -- Sync Laravel sample config `ray.php` with the latest in `laravel-ray` by @squatto in https://github.com/spatie/ray/pull/706 -- Added createFromArray method on SettingsFactory by @doekenorg in https://github.com/spatie/ray/pull/708 -- Update reference.md by @WouterBrouwers in https://github.com/spatie/ray/pull/712 -- Fixed typo showQueries to showDuplicateQueries by @xitox97 in https://github.com/spatie/ray/pull/714 -- Add slow_query_threshold to laravel docs by @fullstackfool in https://github.com/spatie/ray/pull/718 - -### New Contributors - -- @doekenorg made their first contribution in https://github.com/spatie/ray/pull/708 -- @xitox97 made their first contribution in https://github.com/spatie/ray/pull/714 -- @fullstackfool made their first contribution in https://github.com/spatie/ray/pull/718 - -**Full Changelog**: https://github.com/spatie/ray/compare/1.34.5...1.35.0 - -## 1.34.5 - 2022-06-03 - -### What's Changed - -- Bug/702 long integers by @Nielsvanpach in https://github.com/spatie/ray/pull/704 - -**Full Changelog**: https://github.com/spatie/ray/compare/1.34.4...1.34.5 - -## 1.34.4 - 2022-06-03 - -- allow v2 of macroable - -## 1.34.3 - 2022-05-31 - -### What's Changed - -- Fix small JavaScript related documentations by @Yago in https://github.com/spatie/ray/pull/687 -- Fix tiny typo by @jrmajor in https://github.com/spatie/ray/pull/700 -- Revert version of spatie/macroable to ^1.0 by @SebKay in https://github.com/spatie/ray/pull/703 - -### New Contributors - -- @Yago made their first contribution in https://github.com/spatie/ray/pull/687 -- @jrmajor made their first contribution in https://github.com/spatie/ray/pull/700 -- @SebKay made their first contribution in https://github.com/spatie/ray/pull/703 - -**Full Changelog**: https://github.com/spatie/ray/compare/1.34.2...1.34.3 - -## 1.34.2 - 2022-04-08 - -## What's Changed - -- Fix typo by @jeffreyvr in https://github.com/spatie/ray/pull/647 -- Update alpinejs.md by @peterfox in https://github.com/spatie/ray/pull/649 -- Update documentation for Alpine.js integration by @patinthehat in https://github.com/spatie/ray/pull/650 -- Minor Documentation Update by @patinthehat in https://github.com/spatie/ray/pull/651 -- Update Javascript Documentation by @patinthehat in https://github.com/spatie/ray/pull/652 -- Add docs for express.js integration by @patinthehat in https://github.com/spatie/ray/pull/654 -- Fix class import outside of code block by @rostockahoi in https://github.com/spatie/ray/pull/663 -- Added a verification that the Yii class exists by @FR6 in https://github.com/spatie/ray/pull/675 - -## New Contributors - -- @jeffreyvr made their first contribution in https://github.com/spatie/ray/pull/647 -- @peterfox made their first contribution in https://github.com/spatie/ray/pull/649 -- @rostockahoi made their first contribution in https://github.com/spatie/ray/pull/663 - -**Full Changelog**: https://github.com/spatie/ray/compare/1.34.1...1.34.2 - -## 1.34.1 - 2022-03-03 - -- remove stray `print_r` call - -## 1.34.0 - 2022-03-03 - -- add support for global Ray - -## 1.33.2 - 2022-02-02 - -## What's Changed - -- Return false if success variable not defined by @cmgmyr in https://github.com/spatie/ray/pull/635 - -## New Contributors - -- @cmgmyr made their first contribution in https://github.com/spatie/ray/pull/635 - -**Full Changelog**: https://github.com/spatie/ray/compare/1.33.1...1.33.2 - -## 1.33.1 - 2022-01-17 - -## What's Changed - -- Ignore docs folder on package install by @fschirinzi in https://github.com/spatie/ray/pull/625 - -## New Contributors - -- @fschirinzi made their first contribution in https://github.com/spatie/ray/pull/625 - -**Full Changelog**: https://github.com/spatie/ray/compare/1.33.0...1.33.1 - -## 1.33.0 - 2022-01-13 - -1.33.0 - -- add support for screen colors -- add support for project names -- send hostname along with request - -## 1.33.0 - 2022-01-13 - -- add support for screen colors -- add support for project names -- send hostname along with request - -## 1.32.3 - 2022-01-09 - -- allow Laravel 9 - -## 1.32.2 - 2021-12-20 - -- allow symfony 6 - -## 1.32.1 - 2021-11-30 - -- fix deprecation warning in PHP 8.1 - -## 1.32.0 - 2021-11-26 - -## What's Changed - -- Add separator payload by @freekmurze in https://github.com/spatie/ray/pull/599 - -**Full Changelog**: https://github.com/spatie/ray/compare/1.31.0...1.32.0 - -## 1.31.0 - 2021-11-17 - -## What's Changed - -- Docs for duplicate queries logging by @masterix21 in https://github.com/spatie/ray/pull/560 -- Add context to ApplicationLog by @keithbrink in https://github.com/spatie/ray/pull/562 - -## New Contributors - -- @masterix21 made their first contribution in https://github.com/spatie/ray/pull/560 -- @keithbrink made their first contribution in https://github.com/spatie/ray/pull/562 - -**Full Changelog**: https://github.com/spatie/ray/compare/1.30.4...1.31.0 - -## 1.30.4 - 2021-11-11 - -## What's Changed - -- Point to "servers" instead of singular "server" by @jmslbam in https://github.com/spatie/ray/pull/583 -- Fix for sending "value" (by @freekmurze) - -**Full Changelog**: https://github.com/spatie/ray/compare/1.30.3...1.30.4 - -## 1.30.3 - 2021-10-08 - -- Bug/567 global functions (#573) - -## 1.30.2 - 2021-09-10 - -- align carbon call argument type with carbon payload (#556) - -## 1.30.1 - 2021-09-07 - -- support PHP 8.1 - -## 1.30.0 - 2021-08-20 - -- add `catch` method - -## 1.29.2 - 2021-08-15 - -- revert curl check - -## 1.29.1 - 2021-08-14 - -- fix curl check - -## 1.29.0 - 2021-08-02 - -- add `label` method - -## 1.28.0 - 2021-07-04 - -- add support for base64-encoded images (#499) - -## 1.27.1 - 2021-06-24 - -- remove typehint to allow override - -## 1.27.0 - 2021-06-23 - -- add `once()` (#481) - -## 1.26.0 - 2021-06-10 - -- add rate limiter - -## 1.25.0 - 2021-06-07 - -- add `if` method - -## 1.24.0 - 2021-06-04 - -- add limit method (#464) - -## 1.23.0 - 2021-05-29 - -- add `text` method (#460) - -## 1.22.1 - 2021-04-28 - -- allow Throwables to be logged - -## 1.22.0 - 2021-04-28 - -- access named counter values (#437) - -## 1.21.4 - 2021-04-17 - -- color exceptions red by default - -## 1.21.3 - 2021-04-14 - -- allow spatie/macroable v2 [#426](https://github.com/spatie/ray/pull/426) - -## 1.21.2 - 2021-03-04 - -- fix hostname for other ray packages - -## 1.21.1 - 2021-03-03 - -- do not require hostname - -## 1.21.0 - 2021-03-03 - -- add `hostname` in the origin section of a payload - -## 1.20.1 - 2021-02-26 - -- fix config loading priorities in other packages - -## 1.20.0 - 2021-02-22 - -- add `exception` method - -## 1.19.5 - 2021-02-17 - -- allow instances of `CarbonInterface` to be used for `CarbonPayload` (#316) - -## 1.19.4 - 2021-02-11 - -- fix enabled status (#301) - -## 1.19.3 - 2021-02-09 - -- fix Client cache fingerprint initialization (#292) - -## 1.19.2 - 2021-02-09 - -- add curl throttling after failed connection (#286) - -## 1.19.1 - 2021-02-08 - -- allow symfony/stopwatch 4.0 (#284) - -## 1.19.0 - 2021-02-03 - -- send XML payloads (#272) - -## 1.18.0 - 2021-02-03 - -- add `enable` and `disable` methods - -## 1.17.4 - 2021-02-03 - -- fix: remote_path/local_path replacements (#269) - -## 1.17.3 - 2021-02-02 - -- use http v1.1 instead of 1.0 (#267) - -## 1.17.2 - 2021-02-02 - -- cache config file - -## 1.17.1 - 2021-01-27 - -- add support for PHP 7.3 - -## 1.17.0 - 2021-01-25 - -- add `showApp` and `hideApp` - -## 1.16.0 - 2021-01-22 - -- add `phpinfo` method - -## 1.15.0 - 2021-01-22 - -- add `table` method - -## 1.14.1 - 2021-01-22 - -- fix bug when `remote_path` is also in `filePath` (#227) - -## 1.14.0 - 2021-01-20 - -- Add support for CraftRay - -## 1.13.0 - 2021-01-18 - -- the package will now select the best payload type when passing something to `ray()` -- added `html` method -- added `NullPayload` -- added `BoolPayload` - -## 1.12.0 - 2021-01-18 - -- add `carbon` - -## 1.11.1 - 2021-01-17 - -- lower deps - -## 1.11.0 - 2021-01-15 - -- add `image()` - -## 1.10.0 - 2021-01-15 - -- add `clearAll` - -## 1.9.2 - 2021-01-15 - -- fix bugs around settings - -## 1.9.1 - 2021-01-15 - -- improve helper functions - -## 1.9.0 - 2021-01-15 - -- add `count` - -## 1.8.0 - 2021-01-14 - -- add a check for YiiRay's instance - -## 1.7.2 - 2021-01-13 - -- when passing `null`, let argument convertor return `null` - -## 1.7.1 - 2021-01-13 - -- improve return type of ray function - -## 1.7.0 - 2021-01-13 - -- support multiple arguments to `toJson()` and `json()` (#148) - -## 1.6.1 - 2021-01-13 - -- prevent possible memory leak (#143) - -## 1.6.0 - 2021-01-13 - -- add `file` function (#134) - -## 1.5.10 - 2021-01-13 - -- allow better compatibility with WordPress - -## 1.5.9 - 2021-01-13 - -- ignore package version errors - -## 1.5.8 - 2021-01-13 - -- ignore package check errors - -## 1.5.7 - 2021-01-13 - -- remove unneeded symfony/console dependency - -## 1.5.6 - 2021-01-13 - -- allow lower dependencies - -## 1.5.5 - 2021-01-11 - -- split origin factory in overridable functions - -## 1.5.4 - 2021-01-11 - -- support WordPressRay - -## 1.5.3 - 2021-01-10 - -- fix for traces of WordPress - -## 1.5.2 - 2021-01-10 - -- colorize app frames - -## 1.5.1 - 2021-01-10 - -- polish json functions - -## 1.5.0 - 2021-01-09 - -- add `json` function - -## 1.4.0 - 2021-01-09 - -- add `rd` function - -## 1.3.7 - 2021-01-09 - -- add `vendor_frame` attribute to frames - -## 1.3.6 - 2021-01-09 - -- allow older version of uuid package - -## 1.3.5 - 2021-01-09 - -- fix search for `$indexOfRay` to include calls from the parent directory (#80) - -## 1.3.4 - 2021-01-08 - -- prevent warning if `open_basedir` is enabled - -## 1.3.3 - 2021-01-08 - -- do not require Composer 2 - -## 1.3.2 - 2021-01-08 - -- prevent ray from blowing up when there is no config file - -## 1.3.1 - 2021-01-08 - -- do not blow up when the Ray app is not running - -## 1.3.0 - 2021-01-08 - -- add support for `remote_path` and `local_path` config values - -## 1.2.0 - 2021-01-08 - -- add `pass` function - -## 1.1.3 - 2021-01-08 - -- prevent exception when installing in an Orchestra powered testsuite - -## 1.1.2 - 2021-01-08 - -- enforce Composer 2 requirement - -### 1.1.1 - 2021-01-08 - -- fix for repeated calls to `ray()` throwing an exception (#30) - -## 1.1.0 - 2021-01-07 - -- add `makePathOsSafe` -- fix tests - -## 1.0.1 - 2021-01-07 - -- fix default settings - -## 1.0.0 - 2021-01-07 - -- initial release diff --git a/vendor/spatie/ray/LICENSE.md b/vendor/spatie/ray/LICENSE.md deleted file mode 100644 index 59e5ec59..00000000 --- a/vendor/spatie/ray/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Spatie bvba - -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/spatie/ray/README.md b/vendor/spatie/ray/README.md deleted file mode 100644 index 81fd712c..00000000 --- a/vendor/spatie/ray/README.md +++ /dev/null @@ -1,51 +0,0 @@ - -[](https://supportukrainenow.org) - -# Debug with Ray to fix problems faster - -[![Latest Version on Packagist](https://img.shields.io/packagist/v/spatie/ray.svg?style=flat-square)](https://packagist.org/packages/spatie/ray) -![Tests](https://github.com/spatie/ray/workflows/Tests/badge.svg) -[![Total Downloads](https://img.shields.io/packagist/dt/spatie/laravel-ray.svg?style=flat-square)](https://packagist.org/packages/spatie/ray) - -This package can be installed in any PHP application to send messages to [the Ray app](https://myray.app). - -[](https://spatie.be/github-ad-click/ray) - - -The desktop app: - -- can be used in WordPress, Laravel, PHP, JavaScript function -- shows you models, mails, queries, ... IN Laravel -- helps you to debug locally or via SSH -- lets you measure performance & set breakpoints - -## Documentation - -You can find the full documentation on [our documentation site](https://spatie.be/docs/ray). - -## Testing - -```bash -composer test -``` - -## Changelog - -Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. - -## Contributing - -Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details. - -## Security Vulnerabilities - -Please review [our security policy](../../security/policy) on how to report security vulnerabilities. - -## Credits - -- [Freek Van der Herten](https://github.com/freekmurze) -- [All Contributors](../../contributors) - -## License - -The MIT License (MIT). Please see [License File](LICENSE.md) for more information. diff --git a/vendor/spatie/ray/composer.json b/vendor/spatie/ray/composer.json deleted file mode 100644 index b4748ae0..00000000 --- a/vendor/spatie/ray/composer.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "spatie/ray", - "description": "Debug with Ray to fix problems faster", - "keywords": [ - "spatie", - "ray" - ], - "homepage": "https://github.com/spatie/ray", - "license": "MIT", - "authors": [ - { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "homepage": "https://spatie.be", - "role": "Developer" - } - ], - "require": { - "php": "^7.3|^8.0", - "ext-curl": "*", - "ext-json": "*", - "ramsey/uuid": "^3.0|^4.1", - "spatie/backtrace": "^1.1", - "spatie/macroable": "^1.0|^2.0", - "symfony/stopwatch": "^4.0|^5.1|^6.0", - "symfony/var-dumper": "^4.2|^5.1|^6.0" - }, - "require-dev": { - "illuminate/support": "6.x|^8.18|^9.0", - "nesbot/carbon": "^2.43", - "phpstan/phpstan": "^0.12.92", - "phpunit/phpunit": "^9.5", - "spatie/phpunit-snapshot-assertions": "^4.2", - "spatie/test-time": "^1.2" - }, - "autoload": { - "psr-4": { - "Spatie\\Ray\\": "src" - }, - "files": [ - "src/helpers.php" - ] - }, - "autoload-dev": { - "psr-4": { - "Spatie\\Ray\\Tests\\": "tests" - } - }, - "scripts": { - "test": "vendor/bin/phpunit", - "test-coverage": "vendor/bin/phpunit --coverage-html coverage", - "format": "vendor/bin/php-cs-fixer fix --allow-risky=yes", - "phpstan": "vendor/bin/phpstan analyse" - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev", - "prefer-stable": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/spatie" - }, - { - "type": "other", - "url": "https://spatie.be/open-source/support-us" - } - ] -} diff --git a/vendor/spatie/ray/phpstan-baseline.neon b/vendor/spatie/ray/phpstan-baseline.neon deleted file mode 100644 index b52cea93..00000000 --- a/vendor/spatie/ray/phpstan-baseline.neon +++ /dev/null @@ -1,27 +0,0 @@ -parameters: - ignoreErrors: - - - message: "#^Function base_path not found\\.$#" - count: 1 - path: src/Ray.php - - - - message: "#^Function app not found\\.$#" - count: 1 - path: src/helpers.php - - - - message: "#^Instantiated class Spatie\\\\RayBundle\\\\Ray not found\\.$#" - count: 1 - path: src/helpers.php - - - - message: "#^Instantiated class Spatie\\\\WordPressRay\\\\Ray not found\\.$#" - count: 1 - path: src/helpers.php - - - - message: "#^Call to an undefined method Spatie\\\\Ray\\\\Tests\\\\RayTest\\:\\:sendRequest\\(\\)\\.$#" - count: 1 - path: tests/RayTest.php - diff --git a/vendor/spatie/ray/phpstan.neon.dist b/vendor/spatie/ray/phpstan.neon.dist deleted file mode 100644 index 992569c1..00000000 --- a/vendor/spatie/ray/phpstan.neon.dist +++ /dev/null @@ -1,11 +0,0 @@ -includes: - - phpstan-baseline.neon - -parameters: - level: 1 - paths: - - src - - tests - - ignoreErrors: - - '#Unsafe usage of new static\(\)#' diff --git a/vendor/spatie/ray/src/ArgumentConverter.php b/vendor/spatie/ray/src/ArgumentConverter.php deleted file mode 100644 index 1f7adb90..00000000 --- a/vendor/spatie/ray/src/ArgumentConverter.php +++ /dev/null @@ -1,36 +0,0 @@ -cloneVar($argument); - - return $dumper->dump($clonedArgument, true); - } -} diff --git a/vendor/spatie/ray/src/Client.php b/vendor/spatie/ray/src/Client.php deleted file mode 100644 index ebbbbd45..00000000 --- a/vendor/spatie/ray/src/Client.php +++ /dev/null @@ -1,172 +0,0 @@ -fingerprint = $host . ':' . $portNumber; - - $this->portNumber = $portNumber; - - $this->host = $host; - } - - public function serverIsAvailable(): bool - { - // purge expired entries from the cache - static::$cache = array_filter(static::$cache, function ($data) { - return microtime(true) < $data[1]; - }); - - if (! isset(static::$cache[$this->fingerprint])) { - $this->performAvailabilityCheck(); - } - - return static::$cache[$this->fingerprint][0] ?? true; - } - - public function performAvailabilityCheck(): bool - { - try { - $curlHandle = $this->getCurlHandleForUrl('get', '_availability_check'); - - curl_exec($curlHandle); - - $success = curl_errno($curlHandle) === CURLE_HTTP_NOT_FOUND; - // expire the cache entry after 30 sec - $expiresAt = microtime(true) + 30.0; - - static::$cache[$this->fingerprint] = [$success, $expiresAt]; - } finally { - if (isset($curlHandle)) { - curl_close($curlHandle); - } - - return $success ?? false; - } - } - - public function send(Request $request): void - { - if (! $this->serverIsAvailable()) { - return; - } - - try { - $curlHandle = $this->getCurlHandleForUrl('get', ''); - - $curlError = null; - - curl_setopt($curlHandle, CURLOPT_POSTFIELDS, $request->toJson()); - curl_exec($curlHandle); - - if (curl_errno($curlHandle)) { - $curlError = curl_error($curlHandle); - } - - if ($curlError) { - // do nothing for now - } - } finally { - if (isset($curlHandle)) { - curl_close($curlHandle); - } - } - } - - public function lockExists(string $lockName): bool - { - if (! $this->serverIsAvailable()) { - return false; - } - - $queryString = http_build_query([ - 'hostname' => Hostname::get(), - 'project_name' => Ray::$projectName, - ]); - - $curlHandle = $this->getCurlHandleForUrl('get', "locks/{$lockName}?{$queryString}"); - $curlError = null; - - try { - $curlResult = curl_exec($curlHandle); - - if (curl_errno($curlHandle)) { - $curlError = curl_error($curlHandle); - } - - if ($curlError) { - throw new Exception(); - } - - if (! $curlResult) { - return false; - } - - $response = json_decode($curlResult, true); - - if ($response['stop_execution'] ?? false) { - throw StopExecutionRequested::make(); - } - - return $response['active'] ?? false; - } catch (Exception $exception) { - if ($exception instanceof StopExecutionRequested) { - throw $exception; - } - } finally { - curl_close($curlHandle); - } - - return false; - } - - protected function getCurlHandleForUrl(string $method, string $url) - { - return $this->getCurlHandle($method, "http://{$this->host}:{$this->portNumber}/{$url}"); - } - - protected function getCurlHandle(string $method, string $fullUrl) - { - $curlHandle = curl_init(); - - curl_setopt($curlHandle, CURLOPT_URL, $fullUrl); - - curl_setopt($curlHandle, CURLOPT_HTTPHEADER, array_merge([ - 'Accept: application/json', - 'Content-Type: application/json', - ])); - - curl_setopt($curlHandle, CURLOPT_USERAGENT, 'Ray 1.0'); - curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true); - curl_setopt($curlHandle, CURLOPT_TIMEOUT, 2); - curl_setopt($curlHandle, CURLOPT_SSL_VERIFYPEER, true); - curl_setopt($curlHandle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); - curl_setopt($curlHandle, CURLOPT_ENCODING, ''); - curl_setopt($curlHandle, CURLINFO_HEADER_OUT, true); - curl_setopt($curlHandle, CURLOPT_FAILONERROR, true); - - if ($method === 'post') { - curl_setopt($curlHandle, CURLOPT_POST, true); - } - - return $curlHandle; - } -} diff --git a/vendor/spatie/ray/src/Concerns/RayColors.php b/vendor/spatie/ray/src/Concerns/RayColors.php deleted file mode 100644 index 8bc06daa..00000000 --- a/vendor/spatie/ray/src/Concerns/RayColors.php +++ /dev/null @@ -1,37 +0,0 @@ -color('green'); - } - - public function orange(): self - { - return $this->color('orange'); - } - - public function red(): self - { - return $this->color('red'); - } - - public function purple(): self - { - return $this->color('purple'); - } - - public function blue(): self - { - return $this->color('blue'); - } - - public function gray(): self - { - return $this->color('gray'); - } -} diff --git a/vendor/spatie/ray/src/Concerns/RayScreenColors.php b/vendor/spatie/ray/src/Concerns/RayScreenColors.php deleted file mode 100644 index abc472e7..00000000 --- a/vendor/spatie/ray/src/Concerns/RayScreenColors.php +++ /dev/null @@ -1,37 +0,0 @@ -screenColor('green'); - } - - public function screenOrange(): self - { - return $this->screenColor('orange'); - } - - public function screenRed(): self - { - return $this->screenColor('red'); - } - - public function screenPurple(): self - { - return $this->screenColor('purple'); - } - - public function screenBlue(): self - { - return $this->screenColor('blue'); - } - - public function screenGray(): self - { - return $this->screenColor('gray'); - } -} diff --git a/vendor/spatie/ray/src/Concerns/RaySizes.php b/vendor/spatie/ray/src/Concerns/RaySizes.php deleted file mode 100644 index 0c9e6606..00000000 --- a/vendor/spatie/ray/src/Concerns/RaySizes.php +++ /dev/null @@ -1,17 +0,0 @@ -size('sm'); - } - - public function large(): self - { - return $this->size('lg'); - } -} diff --git a/vendor/spatie/ray/src/Concerns/RemovesRayFrames.php b/vendor/spatie/ray/src/Concerns/RemovesRayFrames.php deleted file mode 100644 index 42acb972..00000000 --- a/vendor/spatie/ray/src/Concerns/RemovesRayFrames.php +++ /dev/null @@ -1,37 +0,0 @@ -isRayFrame($frame); - }); - - return array_values($frames); - } - - protected function isRayFrame(Frame $frame): bool - { - foreach ($this->rayNamespaces() as $rayNamespace) { - if (substr((string)$frame->class, 0, strlen($rayNamespace)) === $rayNamespace) { - return true; - } - } - - return false; - } - - protected function rayNamespaces(): array - { - return [ - 'Spatie\Ray', - 'Spatie\LaravelRay', - 'Spatie\WordPressRay', - ]; - } -} diff --git a/vendor/spatie/ray/src/Exceptions/CouldNotConnectToRay.php b/vendor/spatie/ray/src/Exceptions/CouldNotConnectToRay.php deleted file mode 100644 index 28dcec68..00000000 --- a/vendor/spatie/ray/src/Exceptions/CouldNotConnectToRay.php +++ /dev/null @@ -1,13 +0,0 @@ -getFrame(); - - return new Origin( - $frame ? $frame->file : null, - $frame ? $frame->lineNumber : null, - Hostname::get() - ); - } - - /** - * @return \Spatie\Backtrace\Frame|null - */ - protected function getFrame() - { - $frames = $this->getAllFrames(); - - $indexOfRay = $this->getIndexOfRayFrame($frames); - - return $frames[$indexOfRay] ?? null; - } - - protected function getAllFrames(): array - { - $frames = Backtrace::create()->frames(); - - return array_reverse($frames, true); - } - - /** - * @param array $frames - * - * @return int|null - */ - protected function getIndexOfRayFrame(array $frames) - { - if ($this->isUsingGlobalRay($frames)) { - return $this->getIndexOfGlobalRayFrame($frames) + 1; - } - - $index = $this->search(function (Frame $frame) { - if ($frame->class === Ray::class) { - return true; - } - - if ($this->startsWith($frame->file, dirname(__DIR__))) { - return true; - } - - return false; - }, $frames); - - return $index + 1; - } - - public function startsWith(string $hayStack, string $needle): bool - { - return strpos($hayStack, $needle) === 0; - } - - public function isUsingGlobalRay(array $frames) - { - return $this->getIndexOfGlobalRayFrame($frames) !== null; - } - - /** - * @param array $frames - * - * @return int|null - */ - protected function getIndexOfGlobalRayFrame(array $frames) - { - return $this->search(function (Frame $frame) { - if (! $this->startsWith($frame->file, 'phar:')) { - return false; - } - - if (strpos($frame->file, 'global-ray/ray-phars') === false) { - return false; - } - - return true; - }, $frames); - } - - /** - * @param callable $callable - * @param array $items - * - * @return int|null - */ - protected function search(callable $callable, array $items) - { - foreach ($items as $key => $item) { - if ($callable($item, $key)) { - return $key; - } - } - - return null; - } -} diff --git a/vendor/spatie/ray/src/Origin/Hostname.php b/vendor/spatie/ray/src/Origin/Hostname.php deleted file mode 100644 index e9260810..00000000 --- a/vendor/spatie/ray/src/Origin/Hostname.php +++ /dev/null @@ -1,18 +0,0 @@ -file = $file; - - $this->lineNumber = $lineNumber; - - $this->hostname = $hostname ?? Hostname::get(); - } - - public function toArray(): array - { - return [ - 'file' => $this->file, - 'line_number' => $this->lineNumber, - 'hostname' => $this->hostname, - ]; - } - - public function fingerPrint(): string - { - return md5(print_r($this->toArray(), true)); - } -} diff --git a/vendor/spatie/ray/src/Origin/OriginFactory.php b/vendor/spatie/ray/src/Origin/OriginFactory.php deleted file mode 100644 index aa2cfc1d..00000000 --- a/vendor/spatie/ray/src/Origin/OriginFactory.php +++ /dev/null @@ -1,8 +0,0 @@ -getPayloads(); - } - - public static function registerPayloadFinder(callable $callable) - { - self::$payloadFinder = $callable; - } - - public function __construct(array $values) - { - $this->values = $values; - } - - public function getPayloads(): array - { - return array_map(function ($value) { - return $this->getPayload($value); - }, $this->values); - } - - protected function getPayload($value): Payload - { - if (self::$payloadFinder) { - if ($payload = (static::$payloadFinder)($value)) { - return $payload; - } - } - - if (is_bool($value)) { - return new BoolPayload($value); - } - - if (is_null($value)) { - return new NullPayload(); - } - - if ($value instanceof CarbonInterface) { - return new CarbonPayload($value); - } - - $primitiveValue = ArgumentConverter::convertToPrimitive($value); - - return new LogPayload($primitiveValue); - } -} diff --git a/vendor/spatie/ray/src/Payloads/ApplicationLogPayload.php b/vendor/spatie/ray/src/Payloads/ApplicationLogPayload.php deleted file mode 100644 index 315ef51f..00000000 --- a/vendor/spatie/ray/src/Payloads/ApplicationLogPayload.php +++ /dev/null @@ -1,31 +0,0 @@ -value = $value; - $this->context = $context; - } - - public function getType(): string - { - return 'application_log'; - } - - public function getContent(): array - { - return [ - 'value' => $this->value, - 'context' => $this->context, - ]; - } -} diff --git a/vendor/spatie/ray/src/Payloads/BoolPayload.php b/vendor/spatie/ray/src/Payloads/BoolPayload.php deleted file mode 100644 index fa870622..00000000 --- a/vendor/spatie/ray/src/Payloads/BoolPayload.php +++ /dev/null @@ -1,27 +0,0 @@ -bool = $bool; - } - - public function getType(): string - { - return 'custom'; - } - - public function getContent(): array - { - return [ - 'content' => $this->bool, - 'label' => 'Boolean', - ]; - } -} diff --git a/vendor/spatie/ray/src/Payloads/CallerPayload.php b/vendor/spatie/ray/src/Payloads/CallerPayload.php deleted file mode 100644 index da3c9dcd..00000000 --- a/vendor/spatie/ray/src/Payloads/CallerPayload.php +++ /dev/null @@ -1,42 +0,0 @@ -frames = $this->removeRayFrames($frames); - } - - public function getType(): string - { - return 'caller'; - } - - public function getContent(): array - { - $frames = array_slice($this->frames, 1, 1); - - /** @var Frame $frame */ - $frame = array_values($frames)[0]; - - return [ - 'frame' => [ - 'file_name' => $this->replaceRemotePathWithLocalPath($frame->file), - 'line_number' => $frame->lineNumber, - 'class' => $frame->class, - 'method' => $frame->method, - 'vendor_frame' => ! $frame->applicationFrame, - ], - ]; - } -} diff --git a/vendor/spatie/ray/src/Payloads/CarbonPayload.php b/vendor/spatie/ray/src/Payloads/CarbonPayload.php deleted file mode 100644 index 3482de5b..00000000 --- a/vendor/spatie/ray/src/Payloads/CarbonPayload.php +++ /dev/null @@ -1,35 +0,0 @@ -carbon = $carbon; - - $this->format = $format; - } - - public function getType(): string - { - return 'carbon'; - } - - public function getContent(): array - { - return [ - 'formatted' => $this->carbon ? $this->carbon->format($this->format) : null, - 'timestamp' => $this->carbon ? $this->carbon->timestamp : null, - 'timezone' => $this->carbon ? $this->carbon->timezone->getName() : null, - ]; - } -} diff --git a/vendor/spatie/ray/src/Payloads/ClearAllPayload.php b/vendor/spatie/ray/src/Payloads/ClearAllPayload.php deleted file mode 100644 index 8e3bf1c6..00000000 --- a/vendor/spatie/ray/src/Payloads/ClearAllPayload.php +++ /dev/null @@ -1,11 +0,0 @@ -color = $color; - } - - public function getType(): string - { - return 'color'; - } - - public function getContent(): array - { - return [ - 'color' => $this->color, - ]; - } -} diff --git a/vendor/spatie/ray/src/Payloads/ConfettiPayload.php b/vendor/spatie/ray/src/Payloads/ConfettiPayload.php deleted file mode 100644 index eb0ba73b..00000000 --- a/vendor/spatie/ray/src/Payloads/ConfettiPayload.php +++ /dev/null @@ -1,16 +0,0 @@ -name = $name; - } - - public function getType(): string - { - return 'create_lock'; - } - - public function getContent(): array - { - return [ - 'name' => $this->name, - ]; - } -} diff --git a/vendor/spatie/ray/src/Payloads/CustomPayload.php b/vendor/spatie/ray/src/Payloads/CustomPayload.php deleted file mode 100644 index 71cf55b9..00000000 --- a/vendor/spatie/ray/src/Payloads/CustomPayload.php +++ /dev/null @@ -1,32 +0,0 @@ -content = $content; - - $this->label = $label; - } - - public function getType(): string - { - return 'custom'; - } - - public function getContent(): array - { - return [ - 'content' => $this->content, - 'label' => $this->label, - ]; - } -} diff --git a/vendor/spatie/ray/src/Payloads/DecodedJsonPayload.php b/vendor/spatie/ray/src/Payloads/DecodedJsonPayload.php deleted file mode 100644 index d0cef0b7..00000000 --- a/vendor/spatie/ray/src/Payloads/DecodedJsonPayload.php +++ /dev/null @@ -1,31 +0,0 @@ -value = $value; - } - - public function getType(): string - { - return 'custom'; - } - - public function getContent(): array - { - $decodedJson = json_decode($this->value, true); - - return [ - 'content' => ArgumentConverter::convertToPrimitive($decodedJson), - 'label' => '', - ]; - } -} diff --git a/vendor/spatie/ray/src/Payloads/ExceptionPayload.php b/vendor/spatie/ray/src/Payloads/ExceptionPayload.php deleted file mode 100644 index ff1320e9..00000000 --- a/vendor/spatie/ray/src/Payloads/ExceptionPayload.php +++ /dev/null @@ -1,56 +0,0 @@ -exception = $exception; - - $this->meta = $meta; - } - - public function getType(): string - { - return 'exception'; - } - - public function getContent(): array - { - Backtrace::createForThrowable($this->exception); - - return [ - 'class' => get_class($this->exception), - 'message' => $this->exception->getMessage(), - 'frames' => $this->getFrames(), - 'meta' => $this->meta, - ]; - } - - protected function getFrames(): array - { - $frames = Backtrace::createForThrowable($this->exception)->frames(); - - return array_map(function (Frame $frame) { - return [ - 'file_name' => $this->replaceRemotePathWithLocalPath($frame->file), - 'line_number' => $frame->lineNumber, - 'class' => $frame->class, - 'method' => $frame->method, - 'vendor_frame' => ! $frame->applicationFrame, - 'snippet' => $frame->getSnippetProperties(12), - ]; - }, $frames); - } -} diff --git a/vendor/spatie/ray/src/Payloads/FileContentsPayload.php b/vendor/spatie/ray/src/Payloads/FileContentsPayload.php deleted file mode 100644 index d3fed094..00000000 --- a/vendor/spatie/ray/src/Payloads/FileContentsPayload.php +++ /dev/null @@ -1,44 +0,0 @@ -file = $file; - } - - public function getType(): string - { - return 'custom'; - } - - public function getContent(): array - { - if (! file_exists($this->file)) { - return [ - 'content' => "File not found: '{$this->file}'", - 'label' => 'File', - ]; - } - - $contents = file_get_contents($this->file); - - return [ - 'content' => $this->encodeContent($contents), - 'label' => basename($this->file), - ]; - } - - protected function encodeContent(string $content): string - { - $result = htmlentities($content, ENT_QUOTES | ENT_SUBSTITUTE); - - // using nl2br() causes tests to fail on Windows, so use
      only - return str_replace(PHP_EOL, '
      ', $result); - } -} diff --git a/vendor/spatie/ray/src/Payloads/HideAppPayload.php b/vendor/spatie/ray/src/Payloads/HideAppPayload.php deleted file mode 100644 index e754725a..00000000 --- a/vendor/spatie/ray/src/Payloads/HideAppPayload.php +++ /dev/null @@ -1,11 +0,0 @@ -html = $html; - } - - public function getType(): string - { - return 'custom'; - } - - public function getContent(): array - { - return [ - 'content' => $this->html, - 'label' => 'HTML', - ]; - } -} diff --git a/vendor/spatie/ray/src/Payloads/ImagePayload.php b/vendor/spatie/ray/src/Payloads/ImagePayload.php deleted file mode 100644 index 4d8b9650..00000000 --- a/vendor/spatie/ray/src/Payloads/ImagePayload.php +++ /dev/null @@ -1,54 +0,0 @@ -location = $location; - } - - public function getType(): string - { - return 'custom'; - } - - public function getContent(): array - { - if (file_exists($this->location)) { - $this->location = 'file://' . $this->location; - } - - if ($this->hasBase64Data()) { - $this->location = $this->getLocationForBase64Data(); - } - - $location = str_replace('"', '', $this->location); - - return [ - 'content' => "\"\"", - 'label' => 'Image', - ]; - } - - protected function stripDataPrefix(string $data): string - { - return preg_replace('~^data:image/[a-z]+;base64,~', '', $data); - } - - protected function hasBase64Data(): bool - { - $data = $this->stripDataPrefix($this->location); - - return base64_encode(base64_decode($data, true)) === $data; - } - - protected function getLocationForBase64Data(): string - { - return 'data:image/png;base64,' . $this->stripDataPrefix($this->location); - } -} diff --git a/vendor/spatie/ray/src/Payloads/JsonStringPayload.php b/vendor/spatie/ray/src/Payloads/JsonStringPayload.php deleted file mode 100644 index 48086d0f..00000000 --- a/vendor/spatie/ray/src/Payloads/JsonStringPayload.php +++ /dev/null @@ -1,26 +0,0 @@ -value = $value; - } - - public function getType(): string - { - return 'json_string'; - } - - public function getContent(): array - { - return [ - 'value' => json_encode($this->value), - ]; - } -} diff --git a/vendor/spatie/ray/src/Payloads/LabelPayload.php b/vendor/spatie/ray/src/Payloads/LabelPayload.php deleted file mode 100644 index 08c71005..00000000 --- a/vendor/spatie/ray/src/Payloads/LabelPayload.php +++ /dev/null @@ -1,26 +0,0 @@ -label = $label; - } - - public function getType(): string - { - return 'label'; - } - - public function getContent(): array - { - return [ - 'label' => $this->label, - ]; - } -} diff --git a/vendor/spatie/ray/src/Payloads/LogPayload.php b/vendor/spatie/ray/src/Payloads/LogPayload.php deleted file mode 100644 index 5a9c8019..00000000 --- a/vendor/spatie/ray/src/Payloads/LogPayload.php +++ /dev/null @@ -1,45 +0,0 @@ -= 11111111111111111) { - $values = (string) $values; - } - - $values = [$values]; - } - - $this->values = $values; - } - - public function getType(): string - { - return 'log'; - } - - public function getContent(): array - { - return [ - 'values' => $this->values, - ]; - } -} diff --git a/vendor/spatie/ray/src/Payloads/MeasurePayload.php b/vendor/spatie/ray/src/Payloads/MeasurePayload.php deleted file mode 100644 index 08f4fbd3..00000000 --- a/vendor/spatie/ray/src/Payloads/MeasurePayload.php +++ /dev/null @@ -1,71 +0,0 @@ -name = $name; - - $this->totalTime = $stopwatchEvent->getDuration(); - $this->maxMemoryUsageDuringTotalTime = $stopwatchEvent->getMemory(); - - $periods = $stopwatchEvent->getPeriods(); - - if ($lastPeriod = end($periods)) { - $this->timeSinceLastCall = $lastPeriod->getDuration() ; - $this->maxMemoryUsageSinceLastCall = $lastPeriod->getMemory(); - } - } - - public function concernsNewTimer(): self - { - $this->isNewTimer = true; - $this->totalTime = 0; - $this->maxMemoryUsageDuringTotalTime = 0; - $this->timeSinceLastCall = 0; - $this->maxMemoryUsageSinceLastCall = 0; - - return $this; - } - - public function getType(): string - { - return 'measure'; - } - - public function getContent(): array - { - return [ - 'name' => $this->name, - 'is_new_timer' => $this->isNewTimer, - - 'total_time' => $this->totalTime, - 'max_memory_usage_during_total_time' => $this->maxMemoryUsageDuringTotalTime, - - 'time_since_last_call' => $this->timeSinceLastCall, - 'max_memory_usage_since_last_call' => $this->maxMemoryUsageSinceLastCall, - ]; - } -} diff --git a/vendor/spatie/ray/src/Payloads/NewScreenPayload.php b/vendor/spatie/ray/src/Payloads/NewScreenPayload.php deleted file mode 100644 index 6ccbc50a..00000000 --- a/vendor/spatie/ray/src/Payloads/NewScreenPayload.php +++ /dev/null @@ -1,26 +0,0 @@ -name = $name; - } - - public function getType(): string - { - return 'new_screen'; - } - - public function getContent(): array - { - return [ - 'name' => $this->name, - ]; - } -} diff --git a/vendor/spatie/ray/src/Payloads/NotifyPayload.php b/vendor/spatie/ray/src/Payloads/NotifyPayload.php deleted file mode 100644 index aecf244d..00000000 --- a/vendor/spatie/ray/src/Payloads/NotifyPayload.php +++ /dev/null @@ -1,26 +0,0 @@ -text = $text; - } - - public function getType(): string - { - return 'notify'; - } - - public function getContent(): array - { - return [ - 'value' => $this->text, - ]; - } -} diff --git a/vendor/spatie/ray/src/Payloads/NullPayload.php b/vendor/spatie/ray/src/Payloads/NullPayload.php deleted file mode 100644 index e88af22f..00000000 --- a/vendor/spatie/ray/src/Payloads/NullPayload.php +++ /dev/null @@ -1,22 +0,0 @@ - null, - 'label' => 'Null', - ]; - } -} diff --git a/vendor/spatie/ray/src/Payloads/Payload.php b/vendor/spatie/ray/src/Payloads/Payload.php deleted file mode 100644 index 048b8806..00000000 --- a/vendor/spatie/ray/src/Payloads/Payload.php +++ /dev/null @@ -1,62 +0,0 @@ -remotePath) || is_null($this->localPath)) { - return $filePath; - } - - $pattern = '~^' . preg_quote($this->remotePath, '~') . '~'; - - return preg_replace($pattern, $this->localPath, $filePath); - } - - public function getContent(): array - { - return []; - } - - public function toArray(): array - { - return [ - 'type' => $this->getType(), - 'content' => $this->getContent(), - 'origin' => $this->getOrigin()->toArray(), - ]; - } - - public function toJson(): string - { - return json_encode($this->toArray()); - } - - protected function getOrigin(): Origin - { - /** @var \Spatie\Ray\Origin\OriginFactory $originFactory */ - $originFactory = new self::$originFactoryClass(); - - $origin = $originFactory->getOrigin(); - - $origin->file = $this->replaceRemotePathWithLocalPath($origin->file); - - return $origin; - } -} diff --git a/vendor/spatie/ray/src/Payloads/PhpInfoPayload.php b/vendor/spatie/ray/src/Payloads/PhpInfoPayload.php deleted file mode 100644 index 5da54b5f..00000000 --- a/vendor/spatie/ray/src/Payloads/PhpInfoPayload.php +++ /dev/null @@ -1,45 +0,0 @@ -properties = $properties; - } - - public function getType(): string - { - return 'table'; - } - - public function getContent(): array - { - $values = array_flip($this->properties); - - foreach ($values as $property => $value) { - $values[$property] = ini_get($property); - } - - if (empty($values)) { - $values = [ - 'PHP version' => phpversion(), - 'Memory limit' => ini_get('memory_limit'), - 'Max file upload size' => ini_get('max_file_uploads'), - 'Max post size' => ini_get('post_max_size'), - 'PHP ini file' => php_ini_loaded_file(), - "PHP scanned ini file" => php_ini_scanned_files(), - 'Extensions' => implode(', ', get_loaded_extensions()), - ]; - } - - return [ - 'values' => $values, - 'label' => 'PHPInfo', - ]; - } -} diff --git a/vendor/spatie/ray/src/Payloads/RemovePayload.php b/vendor/spatie/ray/src/Payloads/RemovePayload.php deleted file mode 100644 index b31c321a..00000000 --- a/vendor/spatie/ray/src/Payloads/RemovePayload.php +++ /dev/null @@ -1,11 +0,0 @@ -color = $color; - } - - public function getType(): string - { - return 'screen_color'; - } - - public function getContent(): array - { - return [ - 'color' => $this->color, - ]; - } -} diff --git a/vendor/spatie/ray/src/Payloads/SeparatorPayload.php b/vendor/spatie/ray/src/Payloads/SeparatorPayload.php deleted file mode 100644 index 721329e7..00000000 --- a/vendor/spatie/ray/src/Payloads/SeparatorPayload.php +++ /dev/null @@ -1,11 +0,0 @@ -size = $size; - } - - public function getType(): string - { - return 'size'; - } - - public function getContent(): array - { - return [ - 'size' => $this->size, - ]; - } -} diff --git a/vendor/spatie/ray/src/Payloads/TablePayload.php b/vendor/spatie/ray/src/Payloads/TablePayload.php deleted file mode 100644 index a8d065b8..00000000 --- a/vendor/spatie/ray/src/Payloads/TablePayload.php +++ /dev/null @@ -1,38 +0,0 @@ -values = $values; - - $this->label = $label; - } - - public function getType(): string - { - return 'table'; - } - - public function getContent(): array - { - $values = array_map(function ($value) { - return ArgumentConverter::convertToPrimitive($value); - }, $this->values); - - return [ - 'values' => $values, - 'label' => $this->label, - ]; - } -} diff --git a/vendor/spatie/ray/src/Payloads/TextPayload.php b/vendor/spatie/ray/src/Payloads/TextPayload.php deleted file mode 100644 index a444eb99..00000000 --- a/vendor/spatie/ray/src/Payloads/TextPayload.php +++ /dev/null @@ -1,34 +0,0 @@ -text = $text; - } - - public function getType(): string - { - return 'custom'; - } - - public function getContent(): array - { - return [ - 'content' => $this->formatContent(), - 'label' => 'Text', - ]; - } - - protected function formatContent(): string - { - $result = htmlspecialchars($this->text, ENT_QUOTES | ENT_HTML5); - - return str_replace([' ', PHP_EOL], [' ', '
      '], $result); - } -} diff --git a/vendor/spatie/ray/src/Payloads/TracePayload.php b/vendor/spatie/ray/src/Payloads/TracePayload.php deleted file mode 100644 index 3869cbc0..00000000 --- a/vendor/spatie/ray/src/Payloads/TracePayload.php +++ /dev/null @@ -1,63 +0,0 @@ -frames = $this->removeRayFrames($frames); - } - - public function startFromIndex(int $index): self - { - $this->startFromIndex = $index; - - return $this; - } - - public function limit(int $limit): self - { - $this->limit = $limit; - - return $this; - } - - public function getType(): string - { - return 'trace'; - } - - public function getContent(): array - { - $frames = array_map(function (Frame $frame) { - return [ - 'file_name' => $this->replaceRemotePathWithLocalPath($frame->file), - 'line_number' => $frame->lineNumber, - 'class' => $frame->class, - 'method' => $frame->method, - 'vendor_frame' => ! $frame->applicationFrame, - ]; - }, $this->frames); - - if (! is_null($this->limit)) { - $frames = array_slice($frames, $this->startFromIndex ?? 0, $this->limit); - } - - return compact('frames'); - } -} diff --git a/vendor/spatie/ray/src/Payloads/XmlPayload.php b/vendor/spatie/ray/src/Payloads/XmlPayload.php deleted file mode 100644 index 06200522..00000000 --- a/vendor/spatie/ray/src/Payloads/XmlPayload.php +++ /dev/null @@ -1,62 +0,0 @@ -value = $value; - } - - public function getType(): string - { - return 'custom'; - } - - public function getContent(): array - { - $content = $this->formatXmlForDisplay($this->value); - - return [ - 'content' => $content, - 'label' => 'XML', - ]; - } - - protected function formatXmlForDisplay(string $xml): string - { - $content = $this->formatAndIndentXml($xml); - - return $this->encodeXml(trim($content)); - } - - protected function encodeXml(string $xml): string - { - $result = htmlentities($xml); - - return str_replace([PHP_EOL, "\n", ' '], ['
      ', '
      ', ' '], $result); - } - - protected function formatAndIndentXml(string $xml): string - { - if (! class_exists(\DOMDocument::class)) { - return $xml; - } - - $dom = new \DOMDocument(); - - $dom->preserveWhiteSpace = false; - $dom->strictErrorChecking = false; - $dom->formatOutput = true; - - if (! $dom->loadXML($xml, LIBXML_NOERROR | LIBXML_NOWARNING)) { - return $xml; - } - - return $dom->saveXML(); - } -} diff --git a/vendor/spatie/ray/src/Ray.php b/vendor/spatie/ray/src/Ray.php deleted file mode 100644 index 3e19d4d5..00000000 --- a/vendor/spatie/ray/src/Ray.php +++ /dev/null @@ -1,818 +0,0 @@ -settings = $settings; - - self::$client = $client ?? self::$client ?? new Client($settings->port, $settings->host); - - self::$counters = self::$counters ?? new Counters(); - - self::$limiters = self::$limiters ?? new Limiters(); - - $this->uuid = $uuid ?? static::$fakeUuid ?? Uuid::uuid4()->toString(); - - static::$enabled = static::$enabled ?? $this->settings->enable ?? true; - - static::$rateLimiter = static::$rateLimiter ?? RateLimiter::disabled(); - } - - /** - * @param string $projectName - * - * @return $this - */ - public function project($projectName): self - { - static::$projectName = $projectName; - - return $this; - } - - public function enable(): self - { - static::$enabled = true; - - return $this; - } - - public function disable(): self - { - static::$enabled = false; - - return $this; - } - - public function enabled(): bool - { - return static::$enabled || static::$enabled === null; - } - - public function disabled(): bool - { - return static::$enabled === false; - } - - public static function useClient(Client $client): void - { - self::$client = $client; - } - - public function newScreen(string $name = ''): self - { - $payload = new NewScreenPayload($name); - - return $this->sendRequest($payload); - } - - public function clearAll(): self - { - $payload = new ClearAllPayload(); - - return $this->sendRequest($payload); - } - - public function clearScreen(): self - { - return $this->newScreen(); - } - - public function color(string $color): self - { - $payload = new ColorPayload($color); - - return $this->sendRequest($payload); - } - - public function screenColor(string $color): self - { - $payload = new ScreenColorPayload($color); - - return $this->sendRequest($payload); - } - - public function label(string $label): self - { - $payload = new LabelPayload($label); - - return $this->sendRequest($payload); - } - - public function size(string $size): self - { - $payload = new SizePayload($size); - - return $this->sendRequest($payload); - } - - public function remove(): self - { - $payload = new RemovePayload(); - - return $this->sendRequest($payload); - } - - public function hide(): self - { - $payload = new HidePayload(); - - return $this->sendRequest($payload); - } - - /** - * @param string|callable $stopwatchName - * - * @return $this - */ - public function measure($stopwatchName = 'default'): self - { - if ($stopwatchName instanceof Closure) { - return $this->measureClosure($stopwatchName); - } - - if (! isset(static::$stopWatches[$stopwatchName])) { - $stopwatch = new Stopwatch(true); - static::$stopWatches[$stopwatchName] = $stopwatch; - - $event = $stopwatch->start($stopwatchName); - $payload = new MeasurePayload($stopwatchName, $event); - $payload->concernsNewTimer(); - - return $this->sendRequest($payload); - } - - $stopwatch = static::$stopWatches[$stopwatchName]; - $event = $stopwatch->lap($stopwatchName); - $payload = new MeasurePayload($stopwatchName, $event); - - return $this->sendRequest($payload); - } - - public function trace(?Closure $startingFromFrame = null): self - { - $backtrace = Backtrace::create(); - - if (class_exists(LaravelRay::class) && function_exists('base_path')) { - $backtrace->applicationPath(base_path()); - } - - if ($startingFromFrame) { - $backtrace->startingFromFrame($startingFromFrame); - } - - $payload = new TracePayload($backtrace->frames()); - - return $this->sendRequest($payload); - } - - public function backtrace(?Closure $startingFromFrame = null): self - { - return $this->trace($startingFromFrame); - } - - public function caller(): self - { - $backtrace = Backtrace::create(); - - $payload = (new CallerPayload($backtrace->frames())); - - return $this->sendRequest($payload); - } - - protected function measureClosure(Closure $closure): self - { - $stopwatch = new Stopwatch(true); - - $stopwatch->start('closure'); - - $closure(); - - $event = $stopwatch->stop('closure'); - - $payload = new MeasurePayload('closure', $event); - - return $this->sendRequest($payload); - } - - public function stopTime(string $stopwatchName = ''): self - { - if ($stopwatchName === '') { - static::$stopWatches = []; - - return $this; - } - - if (isset(static::$stopWatches[$stopwatchName])) { - unset(static::$stopWatches[$stopwatchName]); - - return $this; - } - - return $this; - } - - public function notify(string $text): self - { - $payload = new NotifyPayload($text); - - return $this->sendRequest($payload); - } - - /** - * Sends the provided value(s) encoded as a JSON string using json_encode(). - */ - public function toJson(...$values): self - { - $payloads = array_map(function ($value) { - return new JsonStringPayload($value); - }, $values); - - return $this->sendRequest($payloads); - } - - /** - * Sends the provided JSON string(s) decoded using json_decode(). - */ - public function json(string ...$jsons): self - { - $payloads = array_map(function ($json) { - return new DecodedJsonPayload($json); - }, $jsons); - - return $this->sendRequest($payloads); - } - - public function file(string $filename): self - { - $payload = new FileContentsPayload($filename); - - return $this->sendRequest($payload); - } - - public function image(string $location): self - { - $payload = new ImagePayload($location); - - return $this->sendRequest($payload); - } - - public function die($status = ''): void - { - die($status); - } - - public function className(object $object): self - { - return $this->send(get_class($object)); - } - - public function phpinfo(string ...$properties): self - { - $payload = new PhpInfoPayload(...$properties); - - return $this->sendRequest($payload); - } - - public function if($boolOrCallable, ?callable $callback = null): self - { - if (is_callable($boolOrCallable)) { - $boolOrCallable = (bool)$boolOrCallable(); - } - - if ($boolOrCallable && $callback !== null) { - $callback($this); - } - - if ($callback === null) { - $this->canSendPayload = $boolOrCallable; - } - - return $this; - } - - /** - * @deprecated Use `if` instead of this method - */ - public function showWhen($boolOrCallable): self - { - if (is_callable($boolOrCallable)) { - $boolOrCallable = (bool)$boolOrCallable(); - } - - if (! $boolOrCallable) { - $this->remove(); - } - - return $this; - } - - /** - * @deprecated Use `if` instead of this method - */ - public function showIf($boolOrCallable): self - { - return $this->showWhen($boolOrCallable); - } - - /** - * @deprecated Use `if` instead of this method - */ - public function removeWhen($boolOrCallable): self - { - if (is_callable($boolOrCallable)) { - $boolOrCallable = (bool)$boolOrCallable(); - } - - if ($boolOrCallable) { - $this->remove(); - } - - return $this; - } - - /** - * @deprecated Use `if` instead of this method - */ - public function removeIf($boolOrCallable): self - { - return $this->removeWhen($boolOrCallable); - } - - public function carbon(?CarbonInterface $carbon): self - { - $payload = new CarbonPayload($carbon); - - $this->sendRequest($payload); - - return $this; - } - - public function ban(): self - { - return $this->send('🕶'); - } - - public function charles(): self - { - return $this->send('🎶 🎹 🎷 🕺'); - } - - public function table(array $values, $label = 'Table'): self - { - $payload = new TablePayload($values, $label); - - return $this->sendRequest($payload); - } - - public function count(?string $name = null): self - { - $fingerPrint = (new DefaultOriginFactory())->getOrigin()->fingerPrint(); - - [$ray, $times] = self::$counters->increment($name ?? $fingerPrint); - - $message = "Called "; - - if ($name) { - $message .= "`{$name}` "; - } - - $message .= "{$times} "; - - $message .= $times === 1 - ? 'time' - : 'times'; - - $message .= '.'; - - $ray->sendCustom($message, 'Count'); - - return $ray; - } - - public function clearCounters(): self - { - self::$counters->clear(); - - return $this; - } - - public function counterValue(string $name): int - { - return self::$counters->get($name); - } - - public function pause(): self - { - $lockName = md5(time()); - - $payload = new CreateLockPayload($lockName); - - $this->sendRequest($payload); - - do { - sleep(1); - } while (self::$client->lockExists($lockName)); - - return $this; - } - - public function separator(): self - { - $payload = new SeparatorPayload(); - - return $this->sendRequest($payload); - } - - public function url(string $url, string $label = ''): self - { - if (! Str::startsWith($url, 'http')) { - $url = "https://{$url}"; - } - - if (empty($label)) { - $label = $url; - } - - $link = "{$label}"; - - return $this->html($link); - } - - public function link(string $url, string $label = '') - { - return $this->url($url, $label); - } - - public function html(string $html = ''): self - { - $payload = new HtmlPayload($html); - - return $this->sendRequest($payload); - } - - public function confetti(): self - { - return $this->sendRequest(new ConfettiPayload()); - } - - public function exception(Throwable $exception, array $meta = []) - { - $payload = new ExceptionPayload($exception, $meta); - - $this->sendRequest($payload); - - $this->red(); - - return $this; - } - - public function xml(string $xml): self - { - $payload = new XmlPayload($xml); - - return $this->sendRequest($payload); - } - - public function text(string $text): self - { - $payload = new TextPayload($text); - - return $this->sendRequest($payload); - } - - public function raw(...$arguments): self - { - if (! count($arguments)) { - return $this; - } - - $payloads = array_map(function ($argument) { - return LogPayload::createForArguments([$argument]); - }, $arguments); - - return $this->sendRequest($payloads); - } - - public function limit(int $count): self - { - $this->limitOrigin = (new DefaultOriginFactory())->getOrigin(); - - self::$limiters->initialize($this->limitOrigin, $count); - - return $this; - } - - public function once(...$arguments): self - { - $this->limitOrigin = (new DefaultOriginFactory())->getOrigin(); - - self::$limiters->initialize($this->limitOrigin, 1); - - if (! empty($arguments)) { - return $this->send(...$arguments); - } - - return $this; - } - - /** - * @param callable|string|null $callback - * @return \Spatie\Ray\Ray - */ - public function catch($callback = null): self - { - $result = (new ExceptionHandler())->catch($this, $callback); - - if ($result instanceof Ray) { - return $result; - } - - return $this; - } - - public function throwExceptions(): self - { - while (! empty(self::$caughtExceptions)) { - throw array_shift(self::$caughtExceptions); - } - - return $this; - } - - public function send(...$arguments): self - { - if (! count($arguments)) { - return $this; - } - - if ($this->settings->always_send_raw_values) { - return $this->raw(...$arguments); - } - - $arguments = array_map(function ($argument) { - if (is_string($argument)) { - return $argument; - } - - if (! is_callable($argument)) { - return $argument; - } - - try { - $result = $argument($this); - - // use a specific class we can filter out instead of null so that null - // payloads can still be sent. - return $result instanceof Ray ? IgnoredValue::make() : $result; - } catch (Exception $exception) { - self::$caughtExceptions[] = $exception; - - return IgnoredValue::make(); - } catch (TypeError $error) { - return $argument; - } - }, $arguments); - - $arguments = array_filter($arguments, function ($argument) { - return ! $argument instanceof IgnoredValue; - }); - - if (empty($arguments)) { - return $this; - } - - $payloads = PayloadFactory::createForValues($arguments); - - return $this->sendRequest($payloads); - } - - public function pass($argument) - { - $this->send($argument); - - return $argument; - } - - public function showApp(): self - { - $payload = new ShowAppPayload(); - - return $this->sendRequest($payload); - } - - public function hideApp(): self - { - $payload = new HideAppPayload(); - - return $this->sendRequest($payload); - } - - public function sendCustom(string $content, string $label = ''): self - { - $customPayload = new CustomPayload($content, $label); - - return $this->sendRequest($customPayload); - } - - /** - * @param \Spatie\Ray\Payloads\Payload|\Spatie\Ray\Payloads\Payload[] $payloads - * @param array $meta - * - * @return $this - * @throws \Exception - */ - public function sendRequest($payloads, array $meta = []): self - { - if (! $this->enabled()) { - return $this; - } - - if (empty($payloads)) { - return $this; - } - - if (! $this->canSendPayload) { - return $this; - } - - if (! empty($this->limitOrigin)) { - if (! self::$limiters->canSendPayload($this->limitOrigin)) { - return $this; - } - - self::$limiters->increment($this->limitOrigin); - } - - if (! is_array($payloads)) { - $payloads = [$payloads]; - } - - try { - if (class_exists(InstalledVersions::class)) { - $meta['ray_package_version'] = InstalledVersions::getVersion('spatie/ray'); - } - } catch (Exception $e) { - // In WordPress this entire package will be rewritten - } - - if (self::rateLimiter()->isMaxReached() || - self::rateLimiter()->isMaxPerSecondReached()) { - $this->notifyWhenRateLimitReached(); - - return $this; - } - - $allMeta = array_merge([ - 'php_version' => phpversion(), - 'php_version_id' => PHP_VERSION_ID, - 'project_name' => static::$projectName, - ], $meta); - - foreach ($payloads as $payload) { - $payload->remotePath = $this->settings->remote_path; - $payload->localPath = $this->settings->local_path; - } - - $request = new Request($this->uuid, $payloads, $allMeta); - - self::$client->send($request); - - self::rateLimiter()->hit(); - - return $this; - } - - public static function makePathOsSafe(string $path): string - { - return str_replace('/', DIRECTORY_SEPARATOR, $path); - } - - public static function rateLimiter(): RateLimiter - { - return self::$rateLimiter; - } - - protected function notifyWhenRateLimitReached(): void - { - if (self::rateLimiter()->isNotified()) { - return; - } - - $customPayload = new CustomPayload('Rate limit has been reached...', 'Rate limit'); - - $request = new Request($this->uuid, [$customPayload], []); - - self::$client->send($request); - - self::rateLimiter()->notify(); - } -} diff --git a/vendor/spatie/ray/src/Request.php b/vendor/spatie/ray/src/Request.php deleted file mode 100644 index eb1e389e..00000000 --- a/vendor/spatie/ray/src/Request.php +++ /dev/null @@ -1,44 +0,0 @@ -uuid = $uuid; - - $this->payloads = $payloads; - - $this->meta = $meta; - } - - public function toArray(): array - { - $payloads = array_map(function (Payload $payload) { - return $payload->toArray(); - }, $this->payloads); - - return [ - 'uuid' => $this->uuid, - 'payloads' => $payloads, - 'meta' => $this->meta, - ]; - } - - public function toJson(): string - { - return json_encode($this->toArray()); - } -} diff --git a/vendor/spatie/ray/src/Settings/Settings.php b/vendor/spatie/ray/src/Settings/Settings.php deleted file mode 100644 index 141cda49..00000000 --- a/vendor/spatie/ray/src/Settings/Settings.php +++ /dev/null @@ -1,68 +0,0 @@ - true, - 'host' => 'localhost', - 'port' => 23517, - 'remote_path' => null, - 'local_path' => null, - 'always_send_raw_values' => false, - ]; - - public function __construct(array $settings) - { - $this->settings = array_merge($this->defaultSettings, $settings); - } - - public function markAsLoadedUsingSettingsFile() - { - $this->loadedUsingSettingsFile = true; - - return $this; - } - - public function setDefaultSettings(array $defaults) - { - foreach ($defaults as $name => $value) { - if ($this->wasLoadedUsingConfigFile($name)) { - $this->settings[$name] = $value; - } - } - - return $this; - } - - protected function wasLoadedUsingConfigFile($name) - { - if (! array_key_exists($name, $this->settings)) { - return true; - } - - if (! $this->loadedUsingSettingsFile) { - return true; - } - - return false; - } - - public function __set(string $name, $value) - { - $this->settings[$name] = $value; - } - - public function __get(string $name) - { - return $this->settings[$name] ?? null; - } -} diff --git a/vendor/spatie/ray/src/Settings/SettingsFactory.php b/vendor/spatie/ray/src/Settings/SettingsFactory.php deleted file mode 100644 index 7c64446a..00000000 --- a/vendor/spatie/ray/src/Settings/SettingsFactory.php +++ /dev/null @@ -1,79 +0,0 @@ -getSettingsFromConfigFile($configDirectory); - - $settings = static::createFromArray($settingValues); - - if (count($settingValues)) { - $settings->markAsLoadedUsingSettingsFile(); - } - - return $settings; - } - - public function getSettingsFromConfigFile(string $configDirectory = null): array - { - $configFilePath = $this->searchConfigFiles($configDirectory); - - if (! file_exists($configFilePath)) { - return []; - } - - $options = include $configFilePath; - - return $options ?? []; - } - - protected function searchConfigFiles(string $configDirectory = null): string - { - if (! isset(self::$cache[$configDirectory])) { - self::$cache[$configDirectory] = $this->searchConfigFilesOnDisk($configDirectory); - } - - return self::$cache[$configDirectory]; - } - - protected function searchConfigFilesOnDisk(string $configDirectory = null): string - { - $configNames = [ - 'ray.php', - ]; - - $configDirectory = $configDirectory ?? getcwd(); - - while (@is_dir($configDirectory)) { - foreach ($configNames as $configName) { - $configFullPath = $configDirectory.DIRECTORY_SEPARATOR.$configName; - if (file_exists($configFullPath)) { - return $configFullPath; - } - } - - $parentDirectory = dirname($configDirectory); - - // We do a direct comparison here since there's a difference between - // the root directories on windows / *nix systems which does not - // let us compare it against the DIRECTORY_SEPARATOR directly - if ($parentDirectory === $configDirectory) { - return ''; - } - - $configDirectory = $parentDirectory; - } - - return ''; - } -} diff --git a/vendor/spatie/ray/src/Support/CacheStore.php b/vendor/spatie/ray/src/Support/CacheStore.php deleted file mode 100644 index 019c5543..00000000 --- a/vendor/spatie/ray/src/Support/CacheStore.php +++ /dev/null @@ -1,61 +0,0 @@ -clock = $clock; - } - - public function hit(): self - { - $this->store[] = $this->clock->now(); - - return $this; - } - - public function clear(): self - { - $this->store = []; - - return $this; - } - - public function count(): int - { - return count($this->store); - } - - public function countLastSecond(): int - { - $amount = 0; - - $lastSecond = $this->clock->now()->modify('-1 second'); - - foreach ($this->store as $key => $item) { - if ($this->isBetween( - $item->getTimestamp(), - $lastSecond->getTimestamp(), - $this->clock->now()->getTimestamp() - ) - ) { - $amount++; - } - } - - return $amount; - } - - protected function isBetween($toCheck, $start, $end): bool - { - return $toCheck >= $start && $toCheck <= $end; - } -} diff --git a/vendor/spatie/ray/src/Support/Clock.php b/vendor/spatie/ray/src/Support/Clock.php deleted file mode 100644 index 3bb9c8e2..00000000 --- a/vendor/spatie/ray/src/Support/Clock.php +++ /dev/null @@ -1,10 +0,0 @@ -counters[$name])) { - $this->counters[$name] = [ray(), 0]; - } - - [$ray, $times] = $this->counters[$name]; - - $newTimes = $times + 1; - - $this->counters[$name] = [$ray, $newTimes]; - - return [$ray, $newTimes]; - } - - public function get(string $name): int - { - if (! isset($this->counters[$name])) { - return 0; - } - - return $this->counters[$name][1]; - } - - public function clear(): void - { - $this->counters = []; - } - - public function setRay(string $name, Ray $ray): void - { - $this->counters[$name][0] = $ray; - } -} diff --git a/vendor/spatie/ray/src/Support/ExceptionHandler.php b/vendor/spatie/ray/src/Support/ExceptionHandler.php deleted file mode 100644 index 545e23bc..00000000 --- a/vendor/spatie/ray/src/Support/ExceptionHandler.php +++ /dev/null @@ -1,148 +0,0 @@ -executeExceptionHandlerCallback($ray, $callback); - - if (! empty(Ray::$caughtExceptions)) { - throw array_shift(Ray::$caughtExceptions); - } - - return $ray; - } - - protected function executeCallableExceptionHandler(Ray $ray, $callback, $rethrow = true): Ray - { - $paramType = $this->getParamType(new ReflectionFunction($callback)); - $expectedClasses = $this->getExpectedClasses($paramType); - - if (count($expectedClasses)) { - $isExpected = false; - - foreach ($expectedClasses as $class) { - $isExpected = $this->isExpectedExceptionClass($class); - - if ($isExpected) { - break; - } - } - - if (! $isExpected && ! $rethrow) { - return $ray; - } - - if (! $isExpected && $rethrow) { - throw array_shift(Ray::$caughtExceptions); - } - } - - $exception = array_shift(Ray::$caughtExceptions); - - $callbackResult = $callback($exception, $ray); - - return $callbackResult instanceof Ray ? $callbackResult : $ray; - } - - protected function isExpectedExceptionClass($expectedClass): bool - { - foreach (Ray::$caughtExceptions as $caughtException) { - if (is_a($caughtException, $expectedClass, true)) { - return true; - } - } - - return false; - } - - protected function sendExceptionPayload(Ray $ray): Ray - { - $exception = array_shift(Ray::$caughtExceptions); - - return $ray->exception($exception); - } - - protected function executeExceptionHandlerCallback(Ray $ray, $callback, $rethrow = true): Ray - { - if (empty(Ray::$caughtExceptions)) { - return $ray; - } - - if (is_callable($callback)) { - return $this->executeCallableExceptionHandler($ray, $callback, $rethrow); - } - - // support arrays of both class names and callables - if (is_array($callback)) { - return $this->executeArrayOfExceptionHandlers($ray, $callback) ?? $ray; - } - - return $this->sendCallbackExceptionPayload($ray, $callback); - ; - } - - protected function executeArrayOfExceptionHandlers(Ray $ray, array $callbacks): ?Ray - { - foreach ($callbacks as $item) { - $result = $this->executeExceptionHandlerCallback($ray, $item, false); - - // the array item handled the exception - if (empty(Ray::$caughtExceptions)) { - return $result instanceof Ray ? $result : $ray; - } - } - - return $ray; - } - - protected function sendCallbackExceptionPayload(Ray $ray, $callback): Ray - { - if (! $callback) { - return $this->sendExceptionPayload($ray); - } - - // handle class names - foreach (Ray::$caughtExceptions as $caughtException) { - if (is_string($callback) && is_a($caughtException, $callback, true)) { - return $this->sendExceptionPayload($ray); - } - } - - return $ray; - } - - protected function getExpectedClasses($paramType): array - { - if (! $paramType) { - return [Exception::class]; - } - - $result = is_a($paramType, '\\ReflectionUnionType') ? $paramType->getTypes() : [$paramType->getName()]; - - return array_map(function ($type) { - if (is_string($type)) { - return $type; - } - - return method_exists($type, 'getName') ? $type->getName() : get_class($type); - }, $result); - } - - protected function getParamType(ReflectionFunction $reflection) - { - $paramType = null; - - if ($reflection->getNumberOfParameters() > 0) { - $paramType = $reflection->getParameters()[0]->getType(); - } - - return $paramType; - } -} diff --git a/vendor/spatie/ray/src/Support/IgnoredValue.php b/vendor/spatie/ray/src/Support/IgnoredValue.php deleted file mode 100644 index 77fb2ddd..00000000 --- a/vendor/spatie/ray/src/Support/IgnoredValue.php +++ /dev/null @@ -1,11 +0,0 @@ -counters[$origin->fingerPrint()])) { - $this->counters[$origin->fingerPrint()] = [0, $limit]; - } - - return $this->counters[$origin->fingerPrint()]; - } - - public function increment(Origin $origin): array - { - $name = $origin->fingerPrint(); - - if (! isset($this->counters[$name])) { - return [false, false]; - } - - [$times, $limit] = $this->counters[$name]; - - $newTimes = $times + 1; - - $this->counters[$name] = [$newTimes, $limit]; - - return [$newTimes, $limit]; - } - - public function canSendPayload(Origin $origin): bool - { - $name = $origin->fingerPrint(); - - if (! isset($this->counters[$name])) { - return true; - } - - [$times, $limit] = $this->counters[$name]; - - return $times < $limit || $limit <= 0; - } -} diff --git a/vendor/spatie/ray/src/Support/RateLimiter.php b/vendor/spatie/ray/src/Support/RateLimiter.php deleted file mode 100644 index cbec9d65..00000000 --- a/vendor/spatie/ray/src/Support/RateLimiter.php +++ /dev/null @@ -1,106 +0,0 @@ -maxCalls = $maxCalls; - $this->maxPerSecond = $maxPerSecond; - $this->cache = new CacheStore(new SystemClock()); - } - - public static function disabled(): self - { - return new self(null, null); - } - - public function hit(): self - { - $this->cache()->hit(); - - return $this; - } - - public function max(?int $maxCalls): self - { - $this->maxCalls = $maxCalls; - - return $this; - } - - public function perSecond(?int $callsPerSecond): self - { - $this->maxPerSecond = $callsPerSecond; - - return $this; - } - - public function isMaxReached(): bool - { - if ($this->maxCalls === null) { - return false; - } - - $reached = $this->cache()->count() >= $this->maxCalls; - - if ($reached === false) { - $this->notified = false; - } - - return $reached; - } - - public function isMaxPerSecondReached(): bool - { - if ($this->maxPerSecond === null) { - return false; - } - - $reached = $this->cache()->countLastSecond() >= $this->maxPerSecond; - - if ($reached === false) { - $this->notified = false; - } - - return $reached; - } - - public function clear(): self - { - $this->maxCalls = null; - $this->maxPerSecond = null; - - $this->cache()->clear(); - - return $this; - } - - public function isNotified(): bool - { - return $this->notified; - } - - public function notify(): void - { - $this->notified = true; - } - - public function cache(): CacheStore - { - return $this->cache; - } -} diff --git a/vendor/spatie/ray/src/Support/SystemClock.php b/vendor/spatie/ray/src/Support/SystemClock.php deleted file mode 100644 index 30bcfd90..00000000 --- a/vendor/spatie/ray/src/Support/SystemClock.php +++ /dev/null @@ -1,13 +0,0 @@ -send(...$args); - } catch (BindingResolutionException $exception) { - // this exception can occur when requiring spatie/ray in an Orchestra powered - // testsuite without spatie/laravel-ray's service provider being registered - // in `getPackageProviders` of the base test suite - } - } - - if (class_exists(CraftRay::class) && class_exists(Yii::class)) { - return Yii::$container->get(CraftRay::class)->send(...$args); - } - - if (class_exists(YiiRay::class) && class_exists(Yii::class)) { - return Yii::$container->get(YiiRay::class)->send(...$args); - } - - $rayClass = Ray::class; - - if (class_exists(WordPressRay::class)) { - $rayClass = WordPressRay::class; - } - - if (class_exists(SymfonyRay::class)) { - $rayClass = SymfonyRay::class; - } - - $settings = SettingsFactory::createFromConfigFile(); - - return (new $rayClass($settings))->send(...$args); - } - - register_shutdown_function(function () { - ray()->throwExceptions(); - }); -} - -if (! function_exists('rd')) { - function rd(...$args) - { - ray(...$args)->die(); - } -} diff --git a/vendor/symfony/console/Application.php b/vendor/symfony/console/Application.php deleted file mode 100644 index d4ec1be0..00000000 --- a/vendor/symfony/console/Application.php +++ /dev/null @@ -1,1275 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Command\CompleteCommand; -use Symfony\Component\Console\Command\DumpCompletionCommand; -use Symfony\Component\Console\Command\HelpCommand; -use Symfony\Component\Console\Command\LazyCommand; -use Symfony\Component\Console\Command\ListCommand; -use Symfony\Component\Console\Command\SignalableCommandInterface; -use Symfony\Component\Console\CommandLoader\CommandLoaderInterface; -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Completion\Suggestion; -use Symfony\Component\Console\Event\ConsoleCommandEvent; -use Symfony\Component\Console\Event\ConsoleErrorEvent; -use Symfony\Component\Console\Event\ConsoleSignalEvent; -use Symfony\Component\Console\Event\ConsoleTerminateEvent; -use Symfony\Component\Console\Exception\CommandNotFoundException; -use Symfony\Component\Console\Exception\ExceptionInterface; -use Symfony\Component\Console\Exception\LogicException; -use Symfony\Component\Console\Exception\NamespaceNotFoundException; -use Symfony\Component\Console\Exception\RuntimeException; -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Helper\DebugFormatterHelper; -use Symfony\Component\Console\Helper\DescriptorHelper; -use Symfony\Component\Console\Helper\FormatterHelper; -use Symfony\Component\Console\Helper\Helper; -use Symfony\Component\Console\Helper\HelperSet; -use Symfony\Component\Console\Helper\ProcessHelper; -use Symfony\Component\Console\Helper\QuestionHelper; -use Symfony\Component\Console\Input\ArgvInput; -use Symfony\Component\Console\Input\ArrayInput; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputAwareInterface; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\ConsoleOutput; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\SignalRegistry\SignalRegistry; -use Symfony\Component\Console\Style\SymfonyStyle; -use Symfony\Component\ErrorHandler\ErrorHandler; -use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; -use Symfony\Contracts\Service\ResetInterface; - -/** - * An Application is the container for a collection of commands. - * - * It is the main entry point of a Console application. - * - * This class is optimized for a standard CLI environment. - * - * Usage: - * - * $app = new Application('myapp', '1.0 (stable)'); - * $app->add(new SimpleCommand()); - * $app->run(); - * - * @author Fabien Potencier - */ -class Application implements ResetInterface -{ - private array $commands = []; - private bool $wantHelps = false; - private ?Command $runningCommand = null; - private string $name; - private string $version; - private ?CommandLoaderInterface $commandLoader = null; - private bool $catchExceptions = true; - private bool $autoExit = true; - private InputDefinition $definition; - private HelperSet $helperSet; - private ?EventDispatcherInterface $dispatcher = null; - private Terminal $terminal; - private string $defaultCommand; - private bool $singleCommand = false; - private bool $initialized = false; - private SignalRegistry $signalRegistry; - private array $signalsToDispatchEvent = []; - - public function __construct(string $name = 'UNKNOWN', string $version = 'UNKNOWN') - { - $this->name = $name; - $this->version = $version; - $this->terminal = new Terminal(); - $this->defaultCommand = 'list'; - if (\defined('SIGINT') && SignalRegistry::isSupported()) { - $this->signalRegistry = new SignalRegistry(); - $this->signalsToDispatchEvent = [\SIGINT, \SIGTERM, \SIGUSR1, \SIGUSR2]; - } - } - - /** - * @final - */ - public function setDispatcher(EventDispatcherInterface $dispatcher) - { - $this->dispatcher = $dispatcher; - } - - public function setCommandLoader(CommandLoaderInterface $commandLoader) - { - $this->commandLoader = $commandLoader; - } - - public function getSignalRegistry(): SignalRegistry - { - if (!$this->signalRegistry) { - throw new RuntimeException('Signals are not supported. Make sure that the `pcntl` extension is installed and that "pcntl_*" functions are not disabled by your php.ini\'s "disable_functions" directive.'); - } - - return $this->signalRegistry; - } - - public function setSignalsToDispatchEvent(int ...$signalsToDispatchEvent) - { - $this->signalsToDispatchEvent = $signalsToDispatchEvent; - } - - /** - * Runs the current application. - * - * @return int 0 if everything went fine, or an error code - * - * @throws \Exception When running fails. Bypass this when {@link setCatchExceptions()}. - */ - public function run(InputInterface $input = null, OutputInterface $output = null): int - { - if (\function_exists('putenv')) { - @putenv('LINES='.$this->terminal->getHeight()); - @putenv('COLUMNS='.$this->terminal->getWidth()); - } - - $input ??= new ArgvInput(); - $output ??= new ConsoleOutput(); - - $renderException = function (\Throwable $e) use ($output) { - if ($output instanceof ConsoleOutputInterface) { - $this->renderThrowable($e, $output->getErrorOutput()); - } else { - $this->renderThrowable($e, $output); - } - }; - if ($phpHandler = set_exception_handler($renderException)) { - restore_exception_handler(); - if (!\is_array($phpHandler) || !$phpHandler[0] instanceof ErrorHandler) { - $errorHandler = true; - } elseif ($errorHandler = $phpHandler[0]->setExceptionHandler($renderException)) { - $phpHandler[0]->setExceptionHandler($errorHandler); - } - } - - $this->configureIO($input, $output); - - try { - $exitCode = $this->doRun($input, $output); - } catch (\Exception $e) { - if (!$this->catchExceptions) { - throw $e; - } - - $renderException($e); - - $exitCode = $e->getCode(); - if (is_numeric($exitCode)) { - $exitCode = (int) $exitCode; - if ($exitCode <= 0) { - $exitCode = 1; - } - } else { - $exitCode = 1; - } - } finally { - // if the exception handler changed, keep it - // otherwise, unregister $renderException - if (!$phpHandler) { - if (set_exception_handler($renderException) === $renderException) { - restore_exception_handler(); - } - restore_exception_handler(); - } elseif (!$errorHandler) { - $finalHandler = $phpHandler[0]->setExceptionHandler(null); - if ($finalHandler !== $renderException) { - $phpHandler[0]->setExceptionHandler($finalHandler); - } - } - } - - if ($this->autoExit) { - if ($exitCode > 255) { - $exitCode = 255; - } - - exit($exitCode); - } - - return $exitCode; - } - - /** - * Runs the current application. - * - * @return int 0 if everything went fine, or an error code - */ - public function doRun(InputInterface $input, OutputInterface $output) - { - if (true === $input->hasParameterOption(['--version', '-V'], true)) { - $output->writeln($this->getLongVersion()); - - return 0; - } - - try { - // Makes ArgvInput::getFirstArgument() able to distinguish an option from an argument. - $input->bind($this->getDefinition()); - } catch (ExceptionInterface) { - // Errors must be ignored, full binding/validation happens later when the command is known. - } - - $name = $this->getCommandName($input); - if (true === $input->hasParameterOption(['--help', '-h'], true)) { - if (!$name) { - $name = 'help'; - $input = new ArrayInput(['command_name' => $this->defaultCommand]); - } else { - $this->wantHelps = true; - } - } - - if (!$name) { - $name = $this->defaultCommand; - $definition = $this->getDefinition(); - $definition->setArguments(array_merge( - $definition->getArguments(), - [ - 'command' => new InputArgument('command', InputArgument::OPTIONAL, $definition->getArgument('command')->getDescription(), $name), - ] - )); - } - - try { - $this->runningCommand = null; - // the command name MUST be the first element of the input - $command = $this->find($name); - } catch (\Throwable $e) { - if (($e instanceof CommandNotFoundException && !$e instanceof NamespaceNotFoundException) && 1 === \count($alternatives = $e->getAlternatives()) && $input->isInteractive()) { - $alternative = $alternatives[0]; - - $style = new SymfonyStyle($input, $output); - $output->writeln(''); - $formattedBlock = (new FormatterHelper())->formatBlock(sprintf('Command "%s" is not defined.', $name), 'error', true); - $output->writeln($formattedBlock); - if (!$style->confirm(sprintf('Do you want to run "%s" instead? ', $alternative), false)) { - if (null !== $this->dispatcher) { - $event = new ConsoleErrorEvent($input, $output, $e); - $this->dispatcher->dispatch($event, ConsoleEvents::ERROR); - - return $event->getExitCode(); - } - - return 1; - } - - $command = $this->find($alternative); - } else { - if (null !== $this->dispatcher) { - $event = new ConsoleErrorEvent($input, $output, $e); - $this->dispatcher->dispatch($event, ConsoleEvents::ERROR); - - if (0 === $event->getExitCode()) { - return 0; - } - - $e = $event->getError(); - } - - try { - if ($e instanceof CommandNotFoundException && $namespace = $this->findNamespace($name)) { - $helper = new DescriptorHelper(); - $helper->describe($output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output, $this, [ - 'format' => 'txt', - 'raw_text' => false, - 'namespace' => $namespace, - 'short' => false, - ]); - - return isset($event) ? $event->getExitCode() : 1; - } - - throw $e; - } catch (NamespaceNotFoundException) { - throw $e; - } - } - } - - if ($command instanceof LazyCommand) { - $command = $command->getCommand(); - } - - $this->runningCommand = $command; - $exitCode = $this->doRunCommand($command, $input, $output); - $this->runningCommand = null; - - return $exitCode; - } - - public function reset() - { - } - - public function setHelperSet(HelperSet $helperSet) - { - $this->helperSet = $helperSet; - } - - /** - * Get the helper set associated with the command. - */ - public function getHelperSet(): HelperSet - { - return $this->helperSet ??= $this->getDefaultHelperSet(); - } - - public function setDefinition(InputDefinition $definition) - { - $this->definition = $definition; - } - - /** - * Gets the InputDefinition related to this Application. - */ - public function getDefinition(): InputDefinition - { - $this->definition ??= $this->getDefaultInputDefinition(); - - if ($this->singleCommand) { - $inputDefinition = $this->definition; - $inputDefinition->setArguments(); - - return $inputDefinition; - } - - return $this->definition; - } - - /** - * Adds suggestions to $suggestions for the current completion input (e.g. option or argument). - */ - public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void - { - if ( - CompletionInput::TYPE_ARGUMENT_VALUE === $input->getCompletionType() - && 'command' === $input->getCompletionName() - ) { - foreach ($this->all() as $name => $command) { - // skip hidden commands and aliased commands as they already get added below - if ($command->isHidden() || $command->getName() !== $name) { - continue; - } - $suggestions->suggestValue(new Suggestion($command->getName(), $command->getDescription())); - foreach ($command->getAliases() as $name) { - $suggestions->suggestValue(new Suggestion($name, $command->getDescription())); - } - } - - return; - } - - if (CompletionInput::TYPE_OPTION_NAME === $input->getCompletionType()) { - $suggestions->suggestOptions($this->getDefinition()->getOptions()); - - return; - } - } - - /** - * Gets the help message. - */ - public function getHelp(): string - { - return $this->getLongVersion(); - } - - /** - * Gets whether to catch exceptions or not during commands execution. - */ - public function areExceptionsCaught(): bool - { - return $this->catchExceptions; - } - - /** - * Sets whether to catch exceptions or not during commands execution. - */ - public function setCatchExceptions(bool $boolean) - { - $this->catchExceptions = $boolean; - } - - /** - * Gets whether to automatically exit after a command execution or not. - */ - public function isAutoExitEnabled(): bool - { - return $this->autoExit; - } - - /** - * Sets whether to automatically exit after a command execution or not. - */ - public function setAutoExit(bool $boolean) - { - $this->autoExit = $boolean; - } - - /** - * Gets the name of the application. - */ - public function getName(): string - { - return $this->name; - } - - /** - * Sets the application name. - **/ - public function setName(string $name) - { - $this->name = $name; - } - - /** - * Gets the application version. - */ - public function getVersion(): string - { - return $this->version; - } - - /** - * Sets the application version. - */ - public function setVersion(string $version) - { - $this->version = $version; - } - - /** - * Returns the long version of the application. - * - * @return string - */ - public function getLongVersion() - { - if ('UNKNOWN' !== $this->getName()) { - if ('UNKNOWN' !== $this->getVersion()) { - return sprintf('%s %s', $this->getName(), $this->getVersion()); - } - - return $this->getName(); - } - - return 'Console Tool'; - } - - /** - * Registers a new command. - */ - public function register(string $name): Command - { - return $this->add(new Command($name)); - } - - /** - * Adds an array of command objects. - * - * If a Command is not enabled it will not be added. - * - * @param Command[] $commands An array of commands - */ - public function addCommands(array $commands) - { - foreach ($commands as $command) { - $this->add($command); - } - } - - /** - * Adds a command object. - * - * If a command with the same name already exists, it will be overridden. - * If the command is not enabled it will not be added. - * - * @return Command|null - */ - public function add(Command $command) - { - $this->init(); - - $command->setApplication($this); - - if (!$command->isEnabled()) { - $command->setApplication(null); - - return null; - } - - if (!$command instanceof LazyCommand) { - // Will throw if the command is not correctly initialized. - $command->getDefinition(); - } - - if (!$command->getName()) { - throw new LogicException(sprintf('The command defined in "%s" cannot have an empty name.', get_debug_type($command))); - } - - $this->commands[$command->getName()] = $command; - - foreach ($command->getAliases() as $alias) { - $this->commands[$alias] = $command; - } - - return $command; - } - - /** - * Returns a registered command by name or alias. - * - * @return Command - * - * @throws CommandNotFoundException When given command name does not exist - */ - public function get(string $name) - { - $this->init(); - - if (!$this->has($name)) { - throw new CommandNotFoundException(sprintf('The command "%s" does not exist.', $name)); - } - - // When the command has a different name than the one used at the command loader level - if (!isset($this->commands[$name])) { - throw new CommandNotFoundException(sprintf('The "%s" command cannot be found because it is registered under multiple names. Make sure you don\'t set a different name via constructor or "setName()".', $name)); - } - - $command = $this->commands[$name]; - - if ($this->wantHelps) { - $this->wantHelps = false; - - $helpCommand = $this->get('help'); - $helpCommand->setCommand($command); - - return $helpCommand; - } - - return $command; - } - - /** - * Returns true if the command exists, false otherwise. - */ - public function has(string $name): bool - { - $this->init(); - - return isset($this->commands[$name]) || ($this->commandLoader?->has($name) && $this->add($this->commandLoader->get($name))); - } - - /** - * Returns an array of all unique namespaces used by currently registered commands. - * - * It does not return the global namespace which always exists. - * - * @return string[] - */ - public function getNamespaces(): array - { - $namespaces = []; - foreach ($this->all() as $command) { - if ($command->isHidden()) { - continue; - } - - $namespaces[] = $this->extractAllNamespaces($command->getName()); - - foreach ($command->getAliases() as $alias) { - $namespaces[] = $this->extractAllNamespaces($alias); - } - } - - return array_values(array_unique(array_filter(array_merge([], ...$namespaces)))); - } - - /** - * Finds a registered namespace by a name or an abbreviation. - * - * @throws NamespaceNotFoundException When namespace is incorrect or ambiguous - */ - public function findNamespace(string $namespace): string - { - $allNamespaces = $this->getNamespaces(); - $expr = implode('[^:]*:', array_map('preg_quote', explode(':', $namespace))).'[^:]*'; - $namespaces = preg_grep('{^'.$expr.'}', $allNamespaces); - - if (empty($namespaces)) { - $message = sprintf('There are no commands defined in the "%s" namespace.', $namespace); - - if ($alternatives = $this->findAlternatives($namespace, $allNamespaces)) { - if (1 == \count($alternatives)) { - $message .= "\n\nDid you mean this?\n "; - } else { - $message .= "\n\nDid you mean one of these?\n "; - } - - $message .= implode("\n ", $alternatives); - } - - throw new NamespaceNotFoundException($message, $alternatives); - } - - $exact = \in_array($namespace, $namespaces, true); - if (\count($namespaces) > 1 && !$exact) { - throw new NamespaceNotFoundException(sprintf("The namespace \"%s\" is ambiguous.\nDid you mean one of these?\n%s.", $namespace, $this->getAbbreviationSuggestions(array_values($namespaces))), array_values($namespaces)); - } - - return $exact ? $namespace : reset($namespaces); - } - - /** - * Finds a command by name or alias. - * - * Contrary to get, this command tries to find the best - * match if you give it an abbreviation of a name or alias. - * - * @return Command - * - * @throws CommandNotFoundException When command name is incorrect or ambiguous - */ - public function find(string $name) - { - $this->init(); - - $aliases = []; - - foreach ($this->commands as $command) { - foreach ($command->getAliases() as $alias) { - if (!$this->has($alias)) { - $this->commands[$alias] = $command; - } - } - } - - if ($this->has($name)) { - return $this->get($name); - } - - $allCommands = $this->commandLoader ? array_merge($this->commandLoader->getNames(), array_keys($this->commands)) : array_keys($this->commands); - $expr = implode('[^:]*:', array_map('preg_quote', explode(':', $name))).'[^:]*'; - $commands = preg_grep('{^'.$expr.'}', $allCommands); - - if (empty($commands)) { - $commands = preg_grep('{^'.$expr.'}i', $allCommands); - } - - // if no commands matched or we just matched namespaces - if (empty($commands) || \count(preg_grep('{^'.$expr.'$}i', $commands)) < 1) { - if (false !== $pos = strrpos($name, ':')) { - // check if a namespace exists and contains commands - $this->findNamespace(substr($name, 0, $pos)); - } - - $message = sprintf('Command "%s" is not defined.', $name); - - if ($alternatives = $this->findAlternatives($name, $allCommands)) { - // remove hidden commands - $alternatives = array_filter($alternatives, function ($name) { - return !$this->get($name)->isHidden(); - }); - - if (1 == \count($alternatives)) { - $message .= "\n\nDid you mean this?\n "; - } else { - $message .= "\n\nDid you mean one of these?\n "; - } - $message .= implode("\n ", $alternatives); - } - - throw new CommandNotFoundException($message, array_values($alternatives)); - } - - // filter out aliases for commands which are already on the list - if (\count($commands) > 1) { - $commandList = $this->commandLoader ? array_merge(array_flip($this->commandLoader->getNames()), $this->commands) : $this->commands; - $commands = array_unique(array_filter($commands, function ($nameOrAlias) use (&$commandList, $commands, &$aliases) { - if (!$commandList[$nameOrAlias] instanceof Command) { - $commandList[$nameOrAlias] = $this->commandLoader->get($nameOrAlias); - } - - $commandName = $commandList[$nameOrAlias]->getName(); - - $aliases[$nameOrAlias] = $commandName; - - return $commandName === $nameOrAlias || !\in_array($commandName, $commands); - })); - } - - if (\count($commands) > 1) { - $usableWidth = $this->terminal->getWidth() - 10; - $abbrevs = array_values($commands); - $maxLen = 0; - foreach ($abbrevs as $abbrev) { - $maxLen = max(Helper::width($abbrev), $maxLen); - } - $abbrevs = array_map(function ($cmd) use ($commandList, $usableWidth, $maxLen, &$commands) { - if ($commandList[$cmd]->isHidden()) { - unset($commands[array_search($cmd, $commands)]); - - return false; - } - - $abbrev = str_pad($cmd, $maxLen, ' ').' '.$commandList[$cmd]->getDescription(); - - return Helper::width($abbrev) > $usableWidth ? Helper::substr($abbrev, 0, $usableWidth - 3).'...' : $abbrev; - }, array_values($commands)); - - if (\count($commands) > 1) { - $suggestions = $this->getAbbreviationSuggestions(array_filter($abbrevs)); - - throw new CommandNotFoundException(sprintf("Command \"%s\" is ambiguous.\nDid you mean one of these?\n%s.", $name, $suggestions), array_values($commands)); - } - } - - $command = $this->get(reset($commands)); - - if ($command->isHidden()) { - throw new CommandNotFoundException(sprintf('The command "%s" does not exist.', $name)); - } - - return $command; - } - - /** - * Gets the commands (registered in the given namespace if provided). - * - * The array keys are the full names and the values the command instances. - * - * @return Command[] - */ - public function all(string $namespace = null) - { - $this->init(); - - if (null === $namespace) { - if (!$this->commandLoader) { - return $this->commands; - } - - $commands = $this->commands; - foreach ($this->commandLoader->getNames() as $name) { - if (!isset($commands[$name]) && $this->has($name)) { - $commands[$name] = $this->get($name); - } - } - - return $commands; - } - - $commands = []; - foreach ($this->commands as $name => $command) { - if ($namespace === $this->extractNamespace($name, substr_count($namespace, ':') + 1)) { - $commands[$name] = $command; - } - } - - if ($this->commandLoader) { - foreach ($this->commandLoader->getNames() as $name) { - if (!isset($commands[$name]) && $namespace === $this->extractNamespace($name, substr_count($namespace, ':') + 1) && $this->has($name)) { - $commands[$name] = $this->get($name); - } - } - } - - return $commands; - } - - /** - * Returns an array of possible abbreviations given a set of names. - * - * @return string[][] - */ - public static function getAbbreviations(array $names): array - { - $abbrevs = []; - foreach ($names as $name) { - for ($len = \strlen($name); $len > 0; --$len) { - $abbrev = substr($name, 0, $len); - $abbrevs[$abbrev][] = $name; - } - } - - return $abbrevs; - } - - public function renderThrowable(\Throwable $e, OutputInterface $output): void - { - $output->writeln('', OutputInterface::VERBOSITY_QUIET); - - $this->doRenderThrowable($e, $output); - - if (null !== $this->runningCommand) { - $output->writeln(sprintf('%s', OutputFormatter::escape(sprintf($this->runningCommand->getSynopsis(), $this->getName()))), OutputInterface::VERBOSITY_QUIET); - $output->writeln('', OutputInterface::VERBOSITY_QUIET); - } - } - - protected function doRenderThrowable(\Throwable $e, OutputInterface $output): void - { - do { - $message = trim($e->getMessage()); - if ('' === $message || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { - $class = get_debug_type($e); - $title = sprintf(' [%s%s] ', $class, 0 !== ($code = $e->getCode()) ? ' ('.$code.')' : ''); - $len = Helper::width($title); - } else { - $len = 0; - } - - if (str_contains($message, "@anonymous\0")) { - $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]; - }, $message); - } - - $width = $this->terminal->getWidth() ? $this->terminal->getWidth() - 1 : \PHP_INT_MAX; - $lines = []; - foreach ('' !== $message ? preg_split('/\r?\n/', $message) : [] as $line) { - foreach ($this->splitStringByWidth($line, $width - 4) as $line) { - // pre-format lines to get the right string length - $lineLength = Helper::width($line) + 4; - $lines[] = [$line, $lineLength]; - - $len = max($lineLength, $len); - } - } - - $messages = []; - if (!$e instanceof ExceptionInterface || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { - $messages[] = sprintf('%s', OutputFormatter::escape(sprintf('In %s line %s:', basename($e->getFile()) ?: 'n/a', $e->getLine() ?: 'n/a'))); - } - $messages[] = $emptyLine = sprintf('%s', str_repeat(' ', $len)); - if ('' === $message || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { - $messages[] = sprintf('%s%s', $title, str_repeat(' ', max(0, $len - Helper::width($title)))); - } - foreach ($lines as $line) { - $messages[] = sprintf(' %s %s', OutputFormatter::escape($line[0]), str_repeat(' ', $len - $line[1])); - } - $messages[] = $emptyLine; - $messages[] = ''; - - $output->writeln($messages, OutputInterface::VERBOSITY_QUIET); - - if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { - $output->writeln('Exception trace:', OutputInterface::VERBOSITY_QUIET); - - // exception related properties - $trace = $e->getTrace(); - - array_unshift($trace, [ - 'function' => '', - 'file' => $e->getFile() ?: 'n/a', - 'line' => $e->getLine() ?: 'n/a', - 'args' => [], - ]); - - for ($i = 0, $count = \count($trace); $i < $count; ++$i) { - $class = $trace[$i]['class'] ?? ''; - $type = $trace[$i]['type'] ?? ''; - $function = $trace[$i]['function'] ?? ''; - $file = $trace[$i]['file'] ?? 'n/a'; - $line = $trace[$i]['line'] ?? 'n/a'; - - $output->writeln(sprintf(' %s%s at %s:%s', $class, $function ? $type.$function.'()' : '', $file, $line), OutputInterface::VERBOSITY_QUIET); - } - - $output->writeln('', OutputInterface::VERBOSITY_QUIET); - } - } while ($e = $e->getPrevious()); - } - - /** - * Configures the input and output instances based on the user arguments and options. - */ - protected function configureIO(InputInterface $input, OutputInterface $output) - { - if (true === $input->hasParameterOption(['--ansi'], true)) { - $output->setDecorated(true); - } elseif (true === $input->hasParameterOption(['--no-ansi'], true)) { - $output->setDecorated(false); - } - - if (true === $input->hasParameterOption(['--no-interaction', '-n'], true)) { - $input->setInteractive(false); - } - - switch ($shellVerbosity = (int) getenv('SHELL_VERBOSITY')) { - case -1: - $output->setVerbosity(OutputInterface::VERBOSITY_QUIET); - break; - case 1: - $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); - break; - case 2: - $output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE); - break; - case 3: - $output->setVerbosity(OutputInterface::VERBOSITY_DEBUG); - break; - default: - $shellVerbosity = 0; - break; - } - - if (true === $input->hasParameterOption(['--quiet', '-q'], true)) { - $output->setVerbosity(OutputInterface::VERBOSITY_QUIET); - $shellVerbosity = -1; - } else { - if ($input->hasParameterOption('-vvv', true) || $input->hasParameterOption('--verbose=3', true) || 3 === $input->getParameterOption('--verbose', false, true)) { - $output->setVerbosity(OutputInterface::VERBOSITY_DEBUG); - $shellVerbosity = 3; - } elseif ($input->hasParameterOption('-vv', true) || $input->hasParameterOption('--verbose=2', true) || 2 === $input->getParameterOption('--verbose', false, true)) { - $output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE); - $shellVerbosity = 2; - } elseif ($input->hasParameterOption('-v', true) || $input->hasParameterOption('--verbose=1', true) || $input->hasParameterOption('--verbose', true) || $input->getParameterOption('--verbose', false, true)) { - $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); - $shellVerbosity = 1; - } - } - - if (-1 === $shellVerbosity) { - $input->setInteractive(false); - } - - if (\function_exists('putenv')) { - @putenv('SHELL_VERBOSITY='.$shellVerbosity); - } - $_ENV['SHELL_VERBOSITY'] = $shellVerbosity; - $_SERVER['SHELL_VERBOSITY'] = $shellVerbosity; - } - - /** - * Runs the current command. - * - * If an event dispatcher has been attached to the application, - * events are also dispatched during the life-cycle of the command. - * - * @return int 0 if everything went fine, or an error code - */ - protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output) - { - foreach ($command->getHelperSet() as $helper) { - if ($helper instanceof InputAwareInterface) { - $helper->setInput($input); - } - } - - if ($this->signalsToDispatchEvent) { - $commandSignals = $command instanceof SignalableCommandInterface ? $command->getSubscribedSignals() : []; - - if ($commandSignals || null !== $this->dispatcher) { - if (!$this->signalRegistry) { - throw new RuntimeException('Unable to subscribe to signal events. Make sure that the `pcntl` extension is installed and that "pcntl_*" functions are not disabled by your php.ini\'s "disable_functions" directive.'); - } - - if (Terminal::hasSttyAvailable()) { - $sttyMode = shell_exec('stty -g'); - - foreach ([\SIGINT, \SIGTERM] as $signal) { - $this->signalRegistry->register($signal, static function () use ($sttyMode) { - shell_exec('stty '.$sttyMode); - }); - } - } - } - - if (null !== $this->dispatcher) { - foreach ($this->signalsToDispatchEvent as $signal) { - $event = new ConsoleSignalEvent($command, $input, $output, $signal); - - $this->signalRegistry->register($signal, function ($signal, $hasNext) use ($event) { - $this->dispatcher->dispatch($event, ConsoleEvents::SIGNAL); - - // No more handlers, we try to simulate PHP default behavior - if (!$hasNext) { - if (!\in_array($signal, [\SIGUSR1, \SIGUSR2], true)) { - exit(0); - } - } - }); - } - } - - foreach ($commandSignals as $signal) { - $this->signalRegistry->register($signal, [$command, 'handleSignal']); - } - } - - if (null === $this->dispatcher) { - return $command->run($input, $output); - } - - // bind before the console.command event, so the listeners have access to input options/arguments - try { - $command->mergeApplicationDefinition(); - $input->bind($command->getDefinition()); - } catch (ExceptionInterface) { - // ignore invalid options/arguments for now, to allow the event listeners to customize the InputDefinition - } - - $event = new ConsoleCommandEvent($command, $input, $output); - $e = null; - - try { - $this->dispatcher->dispatch($event, ConsoleEvents::COMMAND); - - if ($event->commandShouldRun()) { - $exitCode = $command->run($input, $output); - } else { - $exitCode = ConsoleCommandEvent::RETURN_CODE_DISABLED; - } - } catch (\Throwable $e) { - $event = new ConsoleErrorEvent($input, $output, $e, $command); - $this->dispatcher->dispatch($event, ConsoleEvents::ERROR); - $e = $event->getError(); - - if (0 === $exitCode = $event->getExitCode()) { - $e = null; - } - } - - $event = new ConsoleTerminateEvent($command, $input, $output, $exitCode); - $this->dispatcher->dispatch($event, ConsoleEvents::TERMINATE); - - if (null !== $e) { - throw $e; - } - - return $event->getExitCode(); - } - - /** - * Gets the name of the command based on input. - */ - protected function getCommandName(InputInterface $input): ?string - { - return $this->singleCommand ? $this->defaultCommand : $input->getFirstArgument(); - } - - /** - * Gets the default input definition. - */ - protected function getDefaultInputDefinition(): InputDefinition - { - return new InputDefinition([ - new InputArgument('command', InputArgument::REQUIRED, 'The command to execute'), - new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display help for the given command. When no command is given display help for the '.$this->defaultCommand.' command'), - new InputOption('--quiet', '-q', InputOption::VALUE_NONE, 'Do not output any message'), - new InputOption('--verbose', '-v|vv|vvv', InputOption::VALUE_NONE, 'Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug'), - new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display this application version'), - new InputOption('--ansi', '', InputOption::VALUE_NEGATABLE, 'Force (or disable --no-ansi) ANSI output', null), - new InputOption('--no-interaction', '-n', InputOption::VALUE_NONE, 'Do not ask any interactive question'), - ]); - } - - /** - * Gets the default commands that should always be available. - * - * @return Command[] - */ - protected function getDefaultCommands(): array - { - return [new HelpCommand(), new ListCommand(), new CompleteCommand(), new DumpCompletionCommand()]; - } - - /** - * Gets the default helper set with the helpers that should always be available. - */ - protected function getDefaultHelperSet(): HelperSet - { - return new HelperSet([ - new FormatterHelper(), - new DebugFormatterHelper(), - new ProcessHelper(), - new QuestionHelper(), - ]); - } - - /** - * Returns abbreviated suggestions in string format. - */ - private function getAbbreviationSuggestions(array $abbrevs): string - { - return ' '.implode("\n ", $abbrevs); - } - - /** - * Returns the namespace part of the command name. - * - * This method is not part of public API and should not be used directly. - */ - public function extractNamespace(string $name, int $limit = null): string - { - $parts = explode(':', $name, -1); - - return implode(':', null === $limit ? $parts : \array_slice($parts, 0, $limit)); - } - - /** - * Finds alternative of $name among $collection, - * if nothing is found in $collection, try in $abbrevs. - * - * @return string[] - */ - private function findAlternatives(string $name, iterable $collection): array - { - $threshold = 1e3; - $alternatives = []; - - $collectionParts = []; - foreach ($collection as $item) { - $collectionParts[$item] = explode(':', $item); - } - - foreach (explode(':', $name) as $i => $subname) { - foreach ($collectionParts as $collectionName => $parts) { - $exists = isset($alternatives[$collectionName]); - if (!isset($parts[$i]) && $exists) { - $alternatives[$collectionName] += $threshold; - continue; - } elseif (!isset($parts[$i])) { - continue; - } - - $lev = levenshtein($subname, $parts[$i]); - if ($lev <= \strlen($subname) / 3 || '' !== $subname && str_contains($parts[$i], $subname)) { - $alternatives[$collectionName] = $exists ? $alternatives[$collectionName] + $lev : $lev; - } elseif ($exists) { - $alternatives[$collectionName] += $threshold; - } - } - } - - foreach ($collection as $item) { - $lev = levenshtein($name, $item); - if ($lev <= \strlen($name) / 3 || str_contains($item, $name)) { - $alternatives[$item] = isset($alternatives[$item]) ? $alternatives[$item] - $lev : $lev; - } - } - - $alternatives = array_filter($alternatives, function ($lev) use ($threshold) { return $lev < 2 * $threshold; }); - ksort($alternatives, \SORT_NATURAL | \SORT_FLAG_CASE); - - return array_keys($alternatives); - } - - /** - * Sets the default Command name. - * - * @return $this - */ - public function setDefaultCommand(string $commandName, bool $isSingleCommand = false): static - { - $this->defaultCommand = explode('|', ltrim($commandName, '|'))[0]; - - if ($isSingleCommand) { - // Ensure the command exist - $this->find($commandName); - - $this->singleCommand = true; - } - - return $this; - } - - /** - * @internal - */ - public function isSingleCommand(): bool - { - return $this->singleCommand; - } - - private function splitStringByWidth(string $string, int $width): array - { - // str_split is not suitable for multi-byte characters, we should use preg_split to get char array properly. - // additionally, array_slice() is not enough as some character has doubled width. - // we need a function to split string not by character count but by string width - if (false === $encoding = mb_detect_encoding($string, null, true)) { - return str_split($string, $width); - } - - $utf8String = mb_convert_encoding($string, 'utf8', $encoding); - $lines = []; - $line = ''; - - $offset = 0; - while (preg_match('/.{1,10000}/u', $utf8String, $m, 0, $offset)) { - $offset += \strlen($m[0]); - - foreach (preg_split('//u', $m[0]) as $char) { - // test if $char could be appended to current line - if (mb_strwidth($line.$char, 'utf8') <= $width) { - $line .= $char; - continue; - } - // if not, push current line to array and make new line - $lines[] = str_pad($line, $width); - $line = $char; - } - } - - $lines[] = \count($lines) ? str_pad($line, $width) : $line; - - mb_convert_variables($encoding, 'utf8', $lines); - - return $lines; - } - - /** - * Returns all namespaces of the command name. - * - * @return string[] - */ - private function extractAllNamespaces(string $name): array - { - // -1 as third argument is needed to skip the command short name when exploding - $parts = explode(':', $name, -1); - $namespaces = []; - - foreach ($parts as $part) { - if (\count($namespaces)) { - $namespaces[] = end($namespaces).':'.$part; - } else { - $namespaces[] = $part; - } - } - - return $namespaces; - } - - private function init() - { - if ($this->initialized) { - return; - } - $this->initialized = true; - - foreach ($this->getDefaultCommands() as $command) { - $this->add($command); - } - } -} diff --git a/vendor/symfony/console/Attribute/AsCommand.php b/vendor/symfony/console/Attribute/AsCommand.php deleted file mode 100644 index b337f548..00000000 --- a/vendor/symfony/console/Attribute/AsCommand.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Attribute; - -/** - * Service tag to autoconfigure commands. - */ -#[\Attribute(\Attribute::TARGET_CLASS)] -class AsCommand -{ - public function __construct( - public string $name, - public ?string $description = null, - array $aliases = [], - bool $hidden = false, - ) { - if (!$hidden && !$aliases) { - return; - } - - $name = explode('|', $name); - $name = array_merge($name, $aliases); - - if ($hidden && '' !== $name[0]) { - array_unshift($name, ''); - } - - $this->name = implode('|', $name); - } -} diff --git a/vendor/symfony/console/CHANGELOG.md b/vendor/symfony/console/CHANGELOG.md deleted file mode 100644 index 61c36b0e..00000000 --- a/vendor/symfony/console/CHANGELOG.md +++ /dev/null @@ -1,245 +0,0 @@ -CHANGELOG -========= - -6.2 ---- - - * Improve truecolor terminal detection in some cases - * Add support for 256 color terminals (conversion from Ansi24 to Ansi8 if terminal is capable of it) - * Deprecate calling `*Command::setApplication()`, `*FormatterStyle::setForeground/setBackground()`, `Helper::setHelpSet()`, `Input*::setDefault()`, `Question::setAutocompleterCallback/setValidator()`without any arguments - * Change the signature of `OutputFormatterStyleInterface::setForeground/setBackground()` to `setForeground/setBackground(?string)` - * Change the signature of `HelperInterface::setHelperSet()` to `setHelperSet(?HelperSet)` - -6.1 ---- - - * Add support to display table vertically when calling setVertical() - * Add method `__toString()` to `InputInterface` - * Added `OutputWrapper` to prevent truncated URL in `SymfonyStyle::createBlock`. - * Deprecate `Command::$defaultName` and `Command::$defaultDescription`, use the `AsCommand` attribute instead - * Add suggested values for arguments and options in input definition, for input completion - * Add `$resumeAt` parameter to `ProgressBar#start()`, so that one can easily 'resume' progress on longer tasks, and still get accurate `getEstimate()` and `getRemaining()` results. - -6.0 ---- - - * `Command::setHidden()` has a default value (`true`) for `$hidden` parameter and is final - * Remove `Helper::strlen()`, use `Helper::width()` instead - * Remove `Helper::strlenWithoutDecoration()`, use `Helper::removeDecoration()` instead - * `AddConsoleCommandPass` can not be configured anymore - * Remove `HelperSet::setCommand()` and `getCommand()` without replacement - -5.4 ---- - - * Add `TesterTrait::assertCommandIsSuccessful()` to test command - * Deprecate `HelperSet::setCommand()` and `getCommand()` without replacement - -5.3 ---- - - * Add `GithubActionReporter` to render annotations in a Github Action - * Add `InputOption::VALUE_NEGATABLE` flag to handle `--foo`/`--no-foo` options - * Add the `Command::$defaultDescription` static property and the `description` attribute - on the `console.command` tag to allow the `list` command to instantiate commands lazily - * Add option `--short` to the `list` command - * Add support for bright colors - * Add `#[AsCommand]` attribute for declaring commands on PHP 8 - * Add `Helper::width()` and `Helper::length()` - * The `--ansi` and `--no-ansi` options now default to `null`. - -5.2.0 ------ - - * Added `SingleCommandApplication::setAutoExit()` to allow testing via `CommandTester` - * added support for multiline responses to questions through `Question::setMultiline()` - and `Question::isMultiline()` - * Added `SignalRegistry` class to stack signals handlers - * Added support for signals: - * Added `Application::getSignalRegistry()` and `Application::setSignalsToDispatchEvent()` methods - * Added `SignalableCommandInterface` interface - * Added `TableCellStyle` class to customize table cell - * Removed `php ` prefix invocation from help messages. - -5.1.0 ------ - - * `Command::setHidden()` is final since Symfony 5.1 - * Add `SingleCommandApplication` - * Add `Cursor` class - -5.0.0 ------ - - * removed support for finding hidden commands using an abbreviation, use the full name instead - * removed `TableStyle::setCrossingChar()` method in favor of `TableStyle::setDefaultCrossingChar()` - * removed `TableStyle::setHorizontalBorderChar()` method in favor of `TableStyle::setDefaultCrossingChars()` - * removed `TableStyle::getHorizontalBorderChar()` method in favor of `TableStyle::getBorderChars()` - * removed `TableStyle::setVerticalBorderChar()` method in favor of `TableStyle::setVerticalBorderChars()` - * removed `TableStyle::getVerticalBorderChar()` method in favor of `TableStyle::getBorderChars()` - * removed support for returning `null` from `Command::execute()`, return `0` instead - * `ProcessHelper::run()` accepts only `array|Symfony\Component\Process\Process` for its `command` argument - * `Application::setDispatcher` accepts only `Symfony\Contracts\EventDispatcher\EventDispatcherInterface` - for its `dispatcher` argument - * renamed `Application::renderException()` and `Application::doRenderException()` - to `renderThrowable()` and `doRenderThrowable()` respectively. - -4.4.0 ------ - - * deprecated finding hidden commands using an abbreviation, use the full name instead - * added `Question::setTrimmable` default to true to allow the answer to be trimmed - * added method `minSecondsBetweenRedraws()` and `maxSecondsBetweenRedraws()` on `ProgressBar` - * `Application` implements `ResetInterface` - * marked all dispatched event classes as `@final` - * added support for displaying table horizontally - * deprecated returning `null` from `Command::execute()`, return `0` instead - * Deprecated the `Application::renderException()` and `Application::doRenderException()` methods, - use `renderThrowable()` and `doRenderThrowable()` instead. - * added support for the `NO_COLOR` env var (https://no-color.org/) - -4.3.0 ------ - - * added support for hyperlinks - * added `ProgressBar::iterate()` method that simplify updating the progress bar when iterating - * added `Question::setAutocompleterCallback()` to provide a callback function - that dynamically generates suggestions as the user types - -4.2.0 ------ - - * allowed passing commands as `[$process, 'ENV_VAR' => 'value']` to - `ProcessHelper::run()` to pass environment variables - * deprecated passing a command as a string to `ProcessHelper::run()`, - pass it the command as an array of its arguments instead - * made the `ProcessHelper` class final - * added `WrappableOutputFormatterInterface::formatAndWrap()` (implemented in `OutputFormatter`) - * added `capture_stderr_separately` option to `CommandTester::execute()` - -4.1.0 ------ - - * added option to run suggested command if command is not found and only 1 alternative is available - * added option to modify console output and print multiple modifiable sections - * added support for iterable messages in output `write` and `writeln` methods - -4.0.0 ------ - - * `OutputFormatter` throws an exception when unknown options are used - * removed `QuestionHelper::setInputStream()/getInputStream()` - * removed `Application::getTerminalWidth()/getTerminalHeight()` and - `Application::setTerminalDimensions()/getTerminalDimensions()` - * removed `ConsoleExceptionEvent` - * removed `ConsoleEvents::EXCEPTION` - -3.4.0 ------ - - * added `SHELL_VERBOSITY` env var to control verbosity - * added `CommandLoaderInterface`, `FactoryCommandLoader` and PSR-11 - `ContainerCommandLoader` for commands lazy-loading - * added a case-insensitive command name matching fallback - * added static `Command::$defaultName/getDefaultName()`, allowing for - commands to be registered at compile time in the application command loader. - Setting the `$defaultName` property avoids the need for filling the `command` - attribute on the `console.command` tag when using `AddConsoleCommandPass`. - -3.3.0 ------ - - * added `ExceptionListener` - * added `AddConsoleCommandPass` (originally in FrameworkBundle) - * [BC BREAK] `Input::getOption()` no longer returns the default value for options - with value optional explicitly passed empty - * added console.error event to catch exceptions thrown by other listeners - * deprecated console.exception event in favor of console.error - * added ability to handle `CommandNotFoundException` through the - `console.error` event - * deprecated default validation in `SymfonyQuestionHelper::ask` - -3.2.0 ------- - - * added `setInputs()` method to CommandTester for ease testing of commands expecting inputs - * added `setStream()` and `getStream()` methods to Input (implement StreamableInputInterface) - * added StreamableInputInterface - * added LockableTrait - -3.1.0 ------ - - * added truncate method to FormatterHelper - * added setColumnWidth(s) method to Table - -2.8.3 ------ - - * remove readline support from the question helper as it caused issues - -2.8.0 ------ - - * use readline for user input in the question helper when available to allow - the use of arrow keys - -2.6.0 ------ - - * added a Process helper - * added a DebugFormatter helper - -2.5.0 ------ - - * deprecated the dialog helper (use the question helper instead) - * deprecated TableHelper in favor of Table - * deprecated ProgressHelper in favor of ProgressBar - * added ConsoleLogger - * added a question helper - * added a way to set the process name of a command - * added a way to set a default command instead of `ListCommand` - -2.4.0 ------ - - * added a way to force terminal dimensions - * added a convenient method to detect verbosity level - * [BC BREAK] made descriptors use output instead of returning a string - -2.3.0 ------ - - * added multiselect support to the select dialog helper - * added Table Helper for tabular data rendering - * added support for events in `Application` - * added a way to normalize EOLs in `ApplicationTester::getDisplay()` and `CommandTester::getDisplay()` - * added a way to set the progress bar progress via the `setCurrent` method - * added support for multiple InputOption shortcuts, written as `'-a|-b|-c'` - * added two additional verbosity levels, VERBOSITY_VERY_VERBOSE and VERBOSITY_DEBUG - -2.2.0 ------ - - * added support for colorization on Windows via ConEmu - * add a method to Dialog Helper to ask for a question and hide the response - * added support for interactive selections in console (DialogHelper::select()) - * added support for autocompletion as you type in Dialog Helper - -2.1.0 ------ - - * added ConsoleOutputInterface - * added the possibility to disable a command (Command::isEnabled()) - * added suggestions when a command does not exist - * added a --raw option to the list command - * added support for STDERR in the console output class (errors are now sent - to STDERR) - * made the defaults (helper set, commands, input definition) in Application - more easily customizable - * added support for the shell even if readline is not available - * added support for process isolation in Symfony shell via - `--process-isolation` switch - * added support for `--`, which disables options parsing after that point - (tokens will be parsed as arguments) diff --git a/vendor/symfony/console/CI/GithubActionReporter.php b/vendor/symfony/console/CI/GithubActionReporter.php deleted file mode 100644 index 7e556546..00000000 --- a/vendor/symfony/console/CI/GithubActionReporter.php +++ /dev/null @@ -1,99 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\CI; - -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Utility class for Github actions. - * - * @author Maxime Steinhausser - */ -class GithubActionReporter -{ - private OutputInterface $output; - - /** - * @see https://github.com/actions/toolkit/blob/5e5e1b7aacba68a53836a34db4a288c3c1c1585b/packages/core/src/command.ts#L80-L85 - */ - private const ESCAPED_DATA = [ - '%' => '%25', - "\r" => '%0D', - "\n" => '%0A', - ]; - - /** - * @see https://github.com/actions/toolkit/blob/5e5e1b7aacba68a53836a34db4a288c3c1c1585b/packages/core/src/command.ts#L87-L94 - */ - private const ESCAPED_PROPERTIES = [ - '%' => '%25', - "\r" => '%0D', - "\n" => '%0A', - ':' => '%3A', - ',' => '%2C', - ]; - - public function __construct(OutputInterface $output) - { - $this->output = $output; - } - - public static function isGithubActionEnvironment(): bool - { - return false !== getenv('GITHUB_ACTIONS'); - } - - /** - * Output an error using the Github annotations format. - * - * @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-error-message - */ - public function error(string $message, string $file = null, int $line = null, int $col = null): void - { - $this->log('error', $message, $file, $line, $col); - } - - /** - * Output a warning using the Github annotations format. - * - * @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-a-warning-message - */ - public function warning(string $message, string $file = null, int $line = null, int $col = null): void - { - $this->log('warning', $message, $file, $line, $col); - } - - /** - * Output a debug log using the Github annotations format. - * - * @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-a-debug-message - */ - public function debug(string $message, string $file = null, int $line = null, int $col = null): void - { - $this->log('debug', $message, $file, $line, $col); - } - - private function log(string $type, string $message, string $file = null, int $line = null, int $col = null): void - { - // Some values must be encoded. - $message = strtr($message, self::ESCAPED_DATA); - - if (!$file) { - // No file provided, output the message solely: - $this->output->writeln(sprintf('::%s::%s', $type, $message)); - - return; - } - - $this->output->writeln(sprintf('::%s file=%s,line=%s,col=%s::%s', $type, strtr($file, self::ESCAPED_PROPERTIES), strtr($line ?? 1, self::ESCAPED_PROPERTIES), strtr($col ?? 0, self::ESCAPED_PROPERTIES), $message)); - } -} diff --git a/vendor/symfony/console/Color.php b/vendor/symfony/console/Color.php deleted file mode 100644 index 60ed046a..00000000 --- a/vendor/symfony/console/Color.php +++ /dev/null @@ -1,133 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console; - -use Symfony\Component\Console\Exception\InvalidArgumentException; - -/** - * @author Fabien Potencier - */ -final class Color -{ - private const COLORS = [ - 'black' => 0, - 'red' => 1, - 'green' => 2, - 'yellow' => 3, - 'blue' => 4, - 'magenta' => 5, - 'cyan' => 6, - 'white' => 7, - 'default' => 9, - ]; - - private const BRIGHT_COLORS = [ - 'gray' => 0, - 'bright-red' => 1, - 'bright-green' => 2, - 'bright-yellow' => 3, - 'bright-blue' => 4, - 'bright-magenta' => 5, - 'bright-cyan' => 6, - 'bright-white' => 7, - ]; - - private const AVAILABLE_OPTIONS = [ - 'bold' => ['set' => 1, 'unset' => 22], - 'underscore' => ['set' => 4, 'unset' => 24], - 'blink' => ['set' => 5, 'unset' => 25], - 'reverse' => ['set' => 7, 'unset' => 27], - 'conceal' => ['set' => 8, 'unset' => 28], - ]; - - private string $foreground; - private string $background; - private array $options = []; - - public function __construct(string $foreground = '', string $background = '', array $options = []) - { - $this->foreground = $this->parseColor($foreground); - $this->background = $this->parseColor($background, true); - - foreach ($options as $option) { - if (!isset(self::AVAILABLE_OPTIONS[$option])) { - throw new InvalidArgumentException(sprintf('Invalid option specified: "%s". Expected one of (%s).', $option, implode(', ', array_keys(self::AVAILABLE_OPTIONS)))); - } - - $this->options[$option] = self::AVAILABLE_OPTIONS[$option]; - } - } - - public function apply(string $text): string - { - return $this->set().$text.$this->unset(); - } - - public function set(): string - { - $setCodes = []; - if ('' !== $this->foreground) { - $setCodes[] = $this->foreground; - } - if ('' !== $this->background) { - $setCodes[] = $this->background; - } - foreach ($this->options as $option) { - $setCodes[] = $option['set']; - } - if (0 === \count($setCodes)) { - return ''; - } - - return sprintf("\033[%sm", implode(';', $setCodes)); - } - - public function unset(): string - { - $unsetCodes = []; - if ('' !== $this->foreground) { - $unsetCodes[] = 39; - } - if ('' !== $this->background) { - $unsetCodes[] = 49; - } - foreach ($this->options as $option) { - $unsetCodes[] = $option['unset']; - } - if (0 === \count($unsetCodes)) { - return ''; - } - - return sprintf("\033[%sm", implode(';', $unsetCodes)); - } - - private function parseColor(string $color, bool $background = false): string - { - if ('' === $color) { - return ''; - } - - if ('#' === $color[0]) { - return ($background ? '4' : '3').Terminal::getColorMode()->convertFromHexToAnsiColorCode($color); - } - - if (isset(self::COLORS[$color])) { - return ($background ? '4' : '3').self::COLORS[$color]; - } - - if (isset(self::BRIGHT_COLORS[$color])) { - return ($background ? '10' : '9').self::BRIGHT_COLORS[$color]; - } - - throw new InvalidArgumentException(sprintf('Invalid "%s" color; expected one of (%s).', $color, implode(', ', array_merge(array_keys(self::COLORS), array_keys(self::BRIGHT_COLORS))))); - } -} diff --git a/vendor/symfony/console/Command/Command.php b/vendor/symfony/console/Command/Command.php deleted file mode 100644 index 1e3c1a5a..00000000 --- a/vendor/symfony/console/Command/Command.php +++ /dev/null @@ -1,711 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Attribute\AsCommand; -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Completion\Suggestion; -use Symfony\Component\Console\Exception\ExceptionInterface; -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\LogicException; -use Symfony\Component\Console\Helper\HelperInterface; -use Symfony\Component\Console\Helper\HelperSet; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Base class for all commands. - * - * @author Fabien Potencier - */ -class Command -{ - // see https://tldp.org/LDP/abs/html/exitcodes.html - public const SUCCESS = 0; - public const FAILURE = 1; - public const INVALID = 2; - - /** - * @var string|null The default command name - * - * @deprecated since Symfony 6.1, use the AsCommand attribute instead - */ - protected static $defaultName; - - /** - * @var string|null The default command description - * - * @deprecated since Symfony 6.1, use the AsCommand attribute instead - */ - protected static $defaultDescription; - - private ?Application $application = null; - private ?string $name = null; - private ?string $processTitle = null; - private array $aliases = []; - private InputDefinition $definition; - private bool $hidden = false; - private string $help = ''; - private string $description = ''; - private ?InputDefinition $fullDefinition = null; - private bool $ignoreValidationErrors = false; - private ?\Closure $code = null; - private array $synopsis = []; - private array $usages = []; - private ?HelperSet $helperSet = null; - - public static function getDefaultName(): ?string - { - $class = static::class; - - if ($attribute = (new \ReflectionClass($class))->getAttributes(AsCommand::class)) { - return $attribute[0]->newInstance()->name; - } - - $r = new \ReflectionProperty($class, 'defaultName'); - - if ($class !== $r->class || null === static::$defaultName) { - return null; - } - - trigger_deprecation('symfony/console', '6.1', 'Relying on the static property "$defaultName" for setting a command name is deprecated. Add the "%s" attribute to the "%s" class instead.', AsCommand::class, static::class); - - return static::$defaultName; - } - - public static function getDefaultDescription(): ?string - { - $class = static::class; - - if ($attribute = (new \ReflectionClass($class))->getAttributes(AsCommand::class)) { - return $attribute[0]->newInstance()->description; - } - - $r = new \ReflectionProperty($class, 'defaultDescription'); - - if ($class !== $r->class || null === static::$defaultDescription) { - return null; - } - - trigger_deprecation('symfony/console', '6.1', 'Relying on the static property "$defaultDescription" for setting a command description is deprecated. Add the "%s" attribute to the "%s" class instead.', AsCommand::class, static::class); - - return static::$defaultDescription; - } - - /** - * @param string|null $name The name of the command; passing null means it must be set in configure() - * - * @throws LogicException When the command name is empty - */ - public function __construct(string $name = null) - { - $this->definition = new InputDefinition(); - - if (null === $name && null !== $name = static::getDefaultName()) { - $aliases = explode('|', $name); - - if ('' === $name = array_shift($aliases)) { - $this->setHidden(true); - $name = array_shift($aliases); - } - - $this->setAliases($aliases); - } - - if (null !== $name) { - $this->setName($name); - } - - if ('' === $this->description) { - $this->setDescription(static::getDefaultDescription() ?? ''); - } - - $this->configure(); - } - - /** - * Ignores validation errors. - * - * This is mainly useful for the help command. - */ - public function ignoreValidationErrors() - { - $this->ignoreValidationErrors = true; - } - - public function setApplication(Application $application = null) - { - if (1 > \func_num_args()) { - trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); - } - $this->application = $application; - if ($application) { - $this->setHelperSet($application->getHelperSet()); - } else { - $this->helperSet = null; - } - - $this->fullDefinition = null; - } - - public function setHelperSet(HelperSet $helperSet) - { - $this->helperSet = $helperSet; - } - - /** - * Gets the helper set. - */ - public function getHelperSet(): ?HelperSet - { - return $this->helperSet; - } - - /** - * Gets the application instance for this command. - */ - public function getApplication(): ?Application - { - return $this->application; - } - - /** - * Checks whether the command is enabled or not in the current environment. - * - * Override this to check for x or y and return false if the command cannot - * run properly under the current conditions. - * - * @return bool - */ - public function isEnabled() - { - return true; - } - - /** - * Configures the current command. - */ - protected function configure() - { - } - - /** - * Executes the current command. - * - * This method is not abstract because you can use this class - * as a concrete class. In this case, instead of defining the - * execute() method, you set the code to execute by passing - * a Closure to the setCode() method. - * - * @return int 0 if everything went fine, or an exit code - * - * @throws LogicException When this abstract method is not implemented - * - * @see setCode() - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - throw new LogicException('You must override the execute() method in the concrete command class.'); - } - - /** - * Interacts with the user. - * - * This method is executed before the InputDefinition is validated. - * This means that this is the only place where the command can - * interactively ask for values of missing required arguments. - */ - protected function interact(InputInterface $input, OutputInterface $output) - { - } - - /** - * Initializes the command after the input has been bound and before the input - * is validated. - * - * This is mainly useful when a lot of commands extends one main command - * where some things need to be initialized based on the input arguments and options. - * - * @see InputInterface::bind() - * @see InputInterface::validate() - */ - protected function initialize(InputInterface $input, OutputInterface $output) - { - } - - /** - * Runs the command. - * - * The code to execute is either defined directly with the - * setCode() method or by overriding the execute() method - * in a sub-class. - * - * @return int The command exit code - * - * @throws ExceptionInterface When input binding fails. Bypass this by calling {@link ignoreValidationErrors()}. - * - * @see setCode() - * @see execute() - */ - public function run(InputInterface $input, OutputInterface $output): int - { - // add the application arguments and options - $this->mergeApplicationDefinition(); - - // bind the input against the command specific arguments/options - try { - $input->bind($this->getDefinition()); - } catch (ExceptionInterface $e) { - if (!$this->ignoreValidationErrors) { - throw $e; - } - } - - $this->initialize($input, $output); - - if (null !== $this->processTitle) { - if (\function_exists('cli_set_process_title')) { - if (!@cli_set_process_title($this->processTitle)) { - if ('Darwin' === \PHP_OS) { - $output->writeln('Running "cli_set_process_title" as an unprivileged user is not supported on MacOS.', OutputInterface::VERBOSITY_VERY_VERBOSE); - } else { - cli_set_process_title($this->processTitle); - } - } - } elseif (\function_exists('setproctitle')) { - setproctitle($this->processTitle); - } elseif (OutputInterface::VERBOSITY_VERY_VERBOSE === $output->getVerbosity()) { - $output->writeln('Install the proctitle PECL to be able to change the process title.'); - } - } - - if ($input->isInteractive()) { - $this->interact($input, $output); - } - - // The command name argument is often omitted when a command is executed directly with its run() method. - // It would fail the validation if we didn't make sure the command argument is present, - // since it's required by the application. - if ($input->hasArgument('command') && null === $input->getArgument('command')) { - $input->setArgument('command', $this->getName()); - } - - $input->validate(); - - if ($this->code) { - $statusCode = ($this->code)($input, $output); - } else { - $statusCode = $this->execute($input, $output); - - if (!\is_int($statusCode)) { - throw new \TypeError(sprintf('Return value of "%s::execute()" must be of the type int, "%s" returned.', static::class, get_debug_type($statusCode))); - } - } - - return is_numeric($statusCode) ? (int) $statusCode : 0; - } - - /** - * Adds suggestions to $suggestions for the current completion input (e.g. option or argument). - */ - public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void - { - $definition = $this->getDefinition(); - if (CompletionInput::TYPE_OPTION_VALUE === $input->getCompletionType() && $definition->hasOption($input->getCompletionName())) { - $definition->getOption($input->getCompletionName())->complete($input, $suggestions); - } elseif (CompletionInput::TYPE_ARGUMENT_VALUE === $input->getCompletionType() && $definition->hasArgument($input->getCompletionName())) { - $definition->getArgument($input->getCompletionName())->complete($input, $suggestions); - } - } - - /** - * Sets the code to execute when running this command. - * - * If this method is used, it overrides the code defined - * in the execute() method. - * - * @param callable $code A callable(InputInterface $input, OutputInterface $output) - * - * @return $this - * - * @throws InvalidArgumentException - * - * @see execute() - */ - public function setCode(callable $code): static - { - if ($code instanceof \Closure) { - $r = new \ReflectionFunction($code); - if (null === $r->getClosureThis()) { - set_error_handler(static function () {}); - try { - if ($c = \Closure::bind($code, $this)) { - $code = $c; - } - } finally { - restore_error_handler(); - } - } - } else { - $code = $code(...); - } - - $this->code = $code; - - return $this; - } - - /** - * Merges the application definition with the command definition. - * - * This method is not part of public API and should not be used directly. - * - * @param bool $mergeArgs Whether to merge or not the Application definition arguments to Command definition arguments - * - * @internal - */ - public function mergeApplicationDefinition(bool $mergeArgs = true) - { - if (null === $this->application) { - return; - } - - $this->fullDefinition = new InputDefinition(); - $this->fullDefinition->setOptions($this->definition->getOptions()); - $this->fullDefinition->addOptions($this->application->getDefinition()->getOptions()); - - if ($mergeArgs) { - $this->fullDefinition->setArguments($this->application->getDefinition()->getArguments()); - $this->fullDefinition->addArguments($this->definition->getArguments()); - } else { - $this->fullDefinition->setArguments($this->definition->getArguments()); - } - } - - /** - * Sets an array of argument and option instances. - * - * @return $this - */ - public function setDefinition(array|InputDefinition $definition): static - { - if ($definition instanceof InputDefinition) { - $this->definition = $definition; - } else { - $this->definition->setDefinition($definition); - } - - $this->fullDefinition = null; - - return $this; - } - - /** - * Gets the InputDefinition attached to this Command. - */ - public function getDefinition(): InputDefinition - { - return $this->fullDefinition ?? $this->getNativeDefinition(); - } - - /** - * Gets the InputDefinition to be used to create representations of this Command. - * - * Can be overridden to provide the original command representation when it would otherwise - * be changed by merging with the application InputDefinition. - * - * This method is not part of public API and should not be used directly. - */ - public function getNativeDefinition(): InputDefinition - { - return $this->definition ?? throw new LogicException(sprintf('Command class "%s" is not correctly initialized. You probably forgot to call the parent constructor.', static::class)); - } - - /** - * Adds an argument. - * - * @param $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL - * @param $default The default value (for InputArgument::OPTIONAL mode only) - * @param array|\Closure(CompletionInput,CompletionSuggestions):list $suggestedValues The values used for input completion - * - * @return $this - * - * @throws InvalidArgumentException When argument mode is not valid - */ - public function addArgument(string $name, int $mode = null, string $description = '', mixed $default = null /* array|\Closure $suggestedValues = null */): static - { - $suggestedValues = 5 <= \func_num_args() ? func_get_arg(4) : []; - if (!\is_array($suggestedValues) && !$suggestedValues instanceof \Closure) { - throw new \TypeError(sprintf('Argument 5 passed to "%s()" must be array or \Closure, "%s" given.', __METHOD__, get_debug_type($suggestedValues))); - } - $this->definition->addArgument(new InputArgument($name, $mode, $description, $default, $suggestedValues)); - $this->fullDefinition?->addArgument(new InputArgument($name, $mode, $description, $default, $suggestedValues)); - - return $this; - } - - /** - * Adds an option. - * - * @param $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts - * @param $mode The option mode: One of the InputOption::VALUE_* constants - * @param $default The default value (must be null for InputOption::VALUE_NONE) - * @param array|\Closure(CompletionInput,CompletionSuggestions):list $suggestedValues The values used for input completion - * - * @return $this - * - * @throws InvalidArgumentException If option mode is invalid or incompatible - */ - public function addOption(string $name, string|array $shortcut = null, int $mode = null, string $description = '', mixed $default = null /* array|\Closure $suggestedValues = [] */): static - { - $suggestedValues = 6 <= \func_num_args() ? func_get_arg(5) : []; - if (!\is_array($suggestedValues) && !$suggestedValues instanceof \Closure) { - throw new \TypeError(sprintf('Argument 5 passed to "%s()" must be array or \Closure, "%s" given.', __METHOD__, get_debug_type($suggestedValues))); - } - $this->definition->addOption(new InputOption($name, $shortcut, $mode, $description, $default, $suggestedValues)); - $this->fullDefinition?->addOption(new InputOption($name, $shortcut, $mode, $description, $default, $suggestedValues)); - - return $this; - } - - /** - * Sets the name of the command. - * - * This method can set both the namespace and the name if - * you separate them by a colon (:) - * - * $command->setName('foo:bar'); - * - * @return $this - * - * @throws InvalidArgumentException When the name is invalid - */ - public function setName(string $name): static - { - $this->validateName($name); - - $this->name = $name; - - return $this; - } - - /** - * Sets the process title of the command. - * - * This feature should be used only when creating a long process command, - * like a daemon. - * - * @return $this - */ - public function setProcessTitle(string $title): static - { - $this->processTitle = $title; - - return $this; - } - - /** - * Returns the command name. - */ - public function getName(): ?string - { - return $this->name; - } - - /** - * @param bool $hidden Whether or not the command should be hidden from the list of commands - * - * @return $this - */ - public function setHidden(bool $hidden = true): static - { - $this->hidden = $hidden; - - return $this; - } - - /** - * @return bool whether the command should be publicly shown or not - */ - public function isHidden(): bool - { - return $this->hidden; - } - - /** - * Sets the description for the command. - * - * @return $this - */ - public function setDescription(string $description): static - { - $this->description = $description; - - return $this; - } - - /** - * Returns the description for the command. - */ - public function getDescription(): string - { - return $this->description; - } - - /** - * Sets the help for the command. - * - * @return $this - */ - public function setHelp(string $help): static - { - $this->help = $help; - - return $this; - } - - /** - * Returns the help for the command. - */ - public function getHelp(): string - { - return $this->help; - } - - /** - * Returns the processed help for the command replacing the %command.name% and - * %command.full_name% patterns with the real values dynamically. - */ - public function getProcessedHelp(): string - { - $name = $this->name; - $isSingleCommand = $this->application?->isSingleCommand(); - - $placeholders = [ - '%command.name%', - '%command.full_name%', - ]; - $replacements = [ - $name, - $isSingleCommand ? $_SERVER['PHP_SELF'] : $_SERVER['PHP_SELF'].' '.$name, - ]; - - return str_replace($placeholders, $replacements, $this->getHelp() ?: $this->getDescription()); - } - - /** - * Sets the aliases for the command. - * - * @param string[] $aliases An array of aliases for the command - * - * @return $this - * - * @throws InvalidArgumentException When an alias is invalid - */ - public function setAliases(iterable $aliases): static - { - $list = []; - - foreach ($aliases as $alias) { - $this->validateName($alias); - $list[] = $alias; - } - - $this->aliases = \is_array($aliases) ? $aliases : $list; - - return $this; - } - - /** - * Returns the aliases for the command. - */ - public function getAliases(): array - { - return $this->aliases; - } - - /** - * Returns the synopsis for the command. - * - * @param bool $short Whether to show the short version of the synopsis (with options folded) or not - */ - public function getSynopsis(bool $short = false): string - { - $key = $short ? 'short' : 'long'; - - if (!isset($this->synopsis[$key])) { - $this->synopsis[$key] = trim(sprintf('%s %s', $this->name, $this->definition->getSynopsis($short))); - } - - return $this->synopsis[$key]; - } - - /** - * Add a command usage example, it'll be prefixed with the command name. - * - * @return $this - */ - public function addUsage(string $usage): static - { - if (!str_starts_with($usage, $this->name)) { - $usage = sprintf('%s %s', $this->name, $usage); - } - - $this->usages[] = $usage; - - return $this; - } - - /** - * Returns alternative usages of the command. - */ - public function getUsages(): array - { - return $this->usages; - } - - /** - * Gets a helper instance by name. - * - * @return HelperInterface - * - * @throws LogicException if no HelperSet is defined - * @throws InvalidArgumentException if the helper is not defined - */ - public function getHelper(string $name): mixed - { - if (null === $this->helperSet) { - throw new LogicException(sprintf('Cannot retrieve helper "%s" because there is no HelperSet defined. Did you forget to add your command to the application or to set the application on the command using the setApplication() method? You can also set the HelperSet directly using the setHelperSet() method.', $name)); - } - - return $this->helperSet->get($name); - } - - /** - * Validates a command name. - * - * It must be non-empty and parts can optionally be separated by ":". - * - * @throws InvalidArgumentException When the name is invalid - */ - private function validateName(string $name) - { - if (!preg_match('/^[^\:]++(\:[^\:]++)*$/', $name)) { - throw new InvalidArgumentException(sprintf('Command name "%s" is invalid.', $name)); - } - } -} diff --git a/vendor/symfony/console/Command/CompleteCommand.php b/vendor/symfony/console/Command/CompleteCommand.php deleted file mode 100644 index e65b334c..00000000 --- a/vendor/symfony/console/Command/CompleteCommand.php +++ /dev/null @@ -1,223 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Attribute\AsCommand; -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Completion\Output\BashCompletionOutput; -use Symfony\Component\Console\Completion\Output\CompletionOutputInterface; -use Symfony\Component\Console\Completion\Output\FishCompletionOutput; -use Symfony\Component\Console\Completion\Output\ZshCompletionOutput; -use Symfony\Component\Console\Exception\CommandNotFoundException; -use Symfony\Component\Console\Exception\ExceptionInterface; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Responsible for providing the values to the shell completion. - * - * @author Wouter de Jong - */ -#[AsCommand(name: '|_complete', description: 'Internal command to provide shell completion suggestions')] -final class CompleteCommand extends Command -{ - public const COMPLETION_API_VERSION = '1'; - - /** - * @deprecated since Symfony 6.1 - */ - protected static $defaultName = '|_complete'; - - /** - * @deprecated since Symfony 6.1 - */ - protected static $defaultDescription = 'Internal command to provide shell completion suggestions'; - - private $completionOutputs; - - private $isDebug = false; - - /** - * @param array> $completionOutputs A list of additional completion outputs, with shell name as key and FQCN as value - */ - public function __construct(array $completionOutputs = []) - { - // must be set before the parent constructor, as the property value is used in configure() - $this->completionOutputs = $completionOutputs + [ - 'bash' => BashCompletionOutput::class, - 'fish' => FishCompletionOutput::class, - 'zsh' => ZshCompletionOutput::class, - ]; - - parent::__construct(); - } - - protected function configure(): void - { - $this - ->addOption('shell', 's', InputOption::VALUE_REQUIRED, 'The shell type ("'.implode('", "', array_keys($this->completionOutputs)).'")') - ->addOption('input', 'i', InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'An array of input tokens (e.g. COMP_WORDS or argv)') - ->addOption('current', 'c', InputOption::VALUE_REQUIRED, 'The index of the "input" array that the cursor is in (e.g. COMP_CWORD)') - ->addOption('api-version', 'a', InputOption::VALUE_REQUIRED, 'The API version of the completion script') - ->addOption('symfony', 'S', InputOption::VALUE_REQUIRED, 'deprecated') - ; - } - - protected function initialize(InputInterface $input, OutputInterface $output) - { - $this->isDebug = filter_var(getenv('SYMFONY_COMPLETION_DEBUG'), \FILTER_VALIDATE_BOOL); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - try { - // "symfony" must be kept for compat with the shell scripts generated by Symfony Console 5.4 - 6.1 - $version = $input->getOption('symfony') ? '1' : $input->getOption('api-version'); - if ($version && version_compare($version, self::COMPLETION_API_VERSION, '<')) { - $message = sprintf('Completion script version is not supported ("%s" given, ">=%s" required).', $version, self::COMPLETION_API_VERSION); - $this->log($message); - - $output->writeln($message.' Install the Symfony completion script again by using the "completion" command.'); - - return 126; - } - - $shell = $input->getOption('shell'); - if (!$shell) { - throw new \RuntimeException('The "--shell" option must be set.'); - } - - if (!$completionOutput = $this->completionOutputs[$shell] ?? false) { - throw new \RuntimeException(sprintf('Shell completion is not supported for your shell: "%s" (supported: "%s").', $shell, implode('", "', array_keys($this->completionOutputs)))); - } - - $completionInput = $this->createCompletionInput($input); - $suggestions = new CompletionSuggestions(); - - $this->log([ - '', - ''.date('Y-m-d H:i:s').'', - 'Input: ("|" indicates the cursor position)', - ' '.(string) $completionInput, - 'Command:', - ' '.(string) implode(' ', $_SERVER['argv']), - 'Messages:', - ]); - - $command = $this->findCommand($completionInput, $output); - if (null === $command) { - $this->log(' No command found, completing using the Application class.'); - - $this->getApplication()->complete($completionInput, $suggestions); - } elseif ( - $completionInput->mustSuggestArgumentValuesFor('command') - && $command->getName() !== $completionInput->getCompletionValue() - && !\in_array($completionInput->getCompletionValue(), $command->getAliases(), true) - ) { - $this->log(' No command found, completing using the Application class.'); - - // expand shortcut names ("cache:cl") into their full name ("cache:clear") - $suggestions->suggestValues(array_filter(array_merge([$command->getName()], $command->getAliases()))); - } else { - $command->mergeApplicationDefinition(); - $completionInput->bind($command->getDefinition()); - - if (CompletionInput::TYPE_OPTION_NAME === $completionInput->getCompletionType()) { - $this->log(' Completing option names for the '.\get_class($command instanceof LazyCommand ? $command->getCommand() : $command).' command.'); - - $suggestions->suggestOptions($command->getDefinition()->getOptions()); - } else { - $this->log([ - ' Completing using the '.\get_class($command instanceof LazyCommand ? $command->getCommand() : $command).' class.', - ' Completing '.$completionInput->getCompletionType().' for '.$completionInput->getCompletionName().'', - ]); - if (null !== $compval = $completionInput->getCompletionValue()) { - $this->log(' Current value: '.$compval.''); - } - - $command->complete($completionInput, $suggestions); - } - } - - /** @var CompletionOutputInterface $completionOutput */ - $completionOutput = new $completionOutput(); - - $this->log('Suggestions:'); - if ($options = $suggestions->getOptionSuggestions()) { - $this->log(' --'.implode(' --', array_map(function ($o) { return $o->getName(); }, $options))); - } elseif ($values = $suggestions->getValueSuggestions()) { - $this->log(' '.implode(' ', $values)); - } else { - $this->log(' No suggestions were provided'); - } - - $completionOutput->write($suggestions, $output); - } catch (\Throwable $e) { - $this->log([ - 'Error!', - (string) $e, - ]); - - if ($output->isDebug()) { - throw $e; - } - - return self::FAILURE; - } - - return self::SUCCESS; - } - - private function createCompletionInput(InputInterface $input): CompletionInput - { - $currentIndex = $input->getOption('current'); - if (!$currentIndex || !ctype_digit($currentIndex)) { - throw new \RuntimeException('The "--current" option must be set and it must be an integer.'); - } - - $completionInput = CompletionInput::fromTokens($input->getOption('input'), (int) $currentIndex); - - try { - $completionInput->bind($this->getApplication()->getDefinition()); - } catch (ExceptionInterface) { - } - - return $completionInput; - } - - private function findCommand(CompletionInput $completionInput, OutputInterface $output): ?Command - { - try { - $inputName = $completionInput->getFirstArgument(); - if (null === $inputName) { - return null; - } - - return $this->getApplication()->find($inputName); - } catch (CommandNotFoundException) { - } - - return null; - } - - private function log($messages): void - { - if (!$this->isDebug) { - return; - } - - $commandName = basename($_SERVER['argv'][0]); - file_put_contents(sys_get_temp_dir().'/sf_'.$commandName.'.log', implode(\PHP_EOL, (array) $messages).\PHP_EOL, \FILE_APPEND); - } -} diff --git a/vendor/symfony/console/Command/DumpCompletionCommand.php b/vendor/symfony/console/Command/DumpCompletionCommand.php deleted file mode 100644 index 1ad1c0e7..00000000 --- a/vendor/symfony/console/Command/DumpCompletionCommand.php +++ /dev/null @@ -1,148 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Attribute\AsCommand; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Process\Process; - -/** - * Dumps the completion script for the current shell. - * - * @author Wouter de Jong - */ -#[AsCommand(name: 'completion', description: 'Dump the shell completion script')] -final class DumpCompletionCommand extends Command -{ - /** - * @deprecated since Symfony 6.1 - */ - protected static $defaultName = 'completion'; - - /** - * @deprecated since Symfony 6.1 - */ - protected static $defaultDescription = 'Dump the shell completion script'; - - private array $supportedShells; - - protected function configure() - { - $fullCommand = $_SERVER['PHP_SELF']; - $commandName = basename($fullCommand); - $fullCommand = @realpath($fullCommand) ?: $fullCommand; - - $shell = $this->guessShell(); - [$rcFile, $completionFile] = match ($shell) { - 'fish' => ['~/.config/fish/config.fish', "/etc/fish/completions/$commandName.fish"], - 'zsh' => ['~/.zshrc', '$fpath[1]/'.$commandName], - default => ['~/.bashrc', "/etc/bash_completion.d/$commandName"], - }; - - $this - ->setHelp(<<%command.name% command dumps the shell completion script required -to use shell autocompletion (currently, bash and fish completion is supported). - -Static installation -------------------- - -Dump the script to a global completion file and restart your shell: - - %command.full_name% {$shell} | sudo tee {$completionFile} - -Or dump the script to a local file and source it: - - %command.full_name% {$shell} > completion.sh - - # source the file whenever you use the project - source completion.sh - - # or add this line at the end of your "{$rcFile}" file: - source /path/to/completion.sh - -Dynamic installation --------------------- - -Add this to the end of your shell configuration file (e.g. "{$rcFile}"): - - eval "$({$fullCommand} completion {$shell})" -EOH - ) - ->addArgument('shell', InputArgument::OPTIONAL, 'The shell type (e.g. "bash"), the value of the "$SHELL" env var will be used if this is not given', null, $this->getSupportedShells(...)) - ->addOption('debug', null, InputOption::VALUE_NONE, 'Tail the completion debug log') - ; - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $commandName = basename($_SERVER['argv'][0]); - - if ($input->getOption('debug')) { - $this->tailDebugLog($commandName, $output); - - return self::SUCCESS; - } - - $shell = $input->getArgument('shell') ?? self::guessShell(); - $completionFile = __DIR__.'/../Resources/completion.'.$shell; - if (!file_exists($completionFile)) { - $supportedShells = $this->getSupportedShells(); - - if ($output instanceof ConsoleOutputInterface) { - $output = $output->getErrorOutput(); - } - if ($shell) { - $output->writeln(sprintf('Detected shell "%s", which is not supported by Symfony shell completion (supported shells: "%s").', $shell, implode('", "', $supportedShells))); - } else { - $output->writeln(sprintf('Shell not detected, Symfony shell completion only supports "%s").', implode('", "', $supportedShells))); - } - - return self::INVALID; - } - - $output->write(str_replace(['{{ COMMAND_NAME }}', '{{ VERSION }}'], [$commandName, CompleteCommand::COMPLETION_API_VERSION], file_get_contents($completionFile))); - - return self::SUCCESS; - } - - private static function guessShell(): string - { - return basename($_SERVER['SHELL'] ?? ''); - } - - private function tailDebugLog(string $commandName, OutputInterface $output): void - { - $debugFile = sys_get_temp_dir().'/sf_'.$commandName.'.log'; - if (!file_exists($debugFile)) { - touch($debugFile); - } - $process = new Process(['tail', '-f', $debugFile], null, null, null, 0); - $process->run(function (string $type, string $line) use ($output): void { - $output->write($line); - }); - } - - /** - * @return string[] - */ - private function getSupportedShells(): array - { - return $this->supportedShells ??= array_map(function ($f) { - return pathinfo($f, \PATHINFO_EXTENSION); - }, glob(__DIR__.'/../Resources/completion.*')); - } -} diff --git a/vendor/symfony/console/Command/HelpCommand.php b/vendor/symfony/console/Command/HelpCommand.php deleted file mode 100644 index d4134e17..00000000 --- a/vendor/symfony/console/Command/HelpCommand.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\Console\Command; - -use Symfony\Component\Console\Descriptor\ApplicationDescription; -use Symfony\Component\Console\Helper\DescriptorHelper; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * HelpCommand displays the help for a given command. - * - * @author Fabien Potencier - */ -class HelpCommand extends Command -{ - private Command $command; - - protected function configure() - { - $this->ignoreValidationErrors(); - - $this - ->setName('help') - ->setDefinition([ - new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help', function () { - return array_keys((new ApplicationDescription($this->getApplication()))->getCommands()); - }), - new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt', function () { - return (new DescriptorHelper())->getFormats(); - }), - new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command help'), - ]) - ->setDescription('Display help for a command') - ->setHelp(<<<'EOF' -The %command.name% command displays help for a given command: - - %command.full_name% list - -You can also output the help in other formats by using the --format option: - - %command.full_name% --format=xml list - -To display the list of available commands, please use the list command. -EOF - ) - ; - } - - public function setCommand(Command $command) - { - $this->command = $command; - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $this->command ??= $this->getApplication()->find($input->getArgument('command_name')); - - $helper = new DescriptorHelper(); - $helper->describe($output, $this->command, [ - 'format' => $input->getOption('format'), - 'raw_text' => $input->getOption('raw'), - ]); - - unset($this->command); - - return 0; - } -} diff --git a/vendor/symfony/console/Command/LazyCommand.php b/vendor/symfony/console/Command/LazyCommand.php deleted file mode 100644 index d5605822..00000000 --- a/vendor/symfony/console/Command/LazyCommand.php +++ /dev/null @@ -1,207 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Completion\Suggestion; -use Symfony\Component\Console\Helper\HelperInterface; -use Symfony\Component\Console\Helper\HelperSet; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Nicolas Grekas - */ -final class LazyCommand extends Command -{ - private \Closure|Command $command; - private ?bool $isEnabled; - - public function __construct(string $name, array $aliases, string $description, bool $isHidden, \Closure $commandFactory, ?bool $isEnabled = true) - { - $this->setName($name) - ->setAliases($aliases) - ->setHidden($isHidden) - ->setDescription($description); - - $this->command = $commandFactory; - $this->isEnabled = $isEnabled; - } - - public function ignoreValidationErrors(): void - { - $this->getCommand()->ignoreValidationErrors(); - } - - public function setApplication(Application $application = null): void - { - if (1 > \func_num_args()) { - trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); - } - if ($this->command instanceof parent) { - $this->command->setApplication($application); - } - - parent::setApplication($application); - } - - public function setHelperSet(HelperSet $helperSet): void - { - if ($this->command instanceof parent) { - $this->command->setHelperSet($helperSet); - } - - parent::setHelperSet($helperSet); - } - - public function isEnabled(): bool - { - return $this->isEnabled ?? $this->getCommand()->isEnabled(); - } - - public function run(InputInterface $input, OutputInterface $output): int - { - return $this->getCommand()->run($input, $output); - } - - public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void - { - $this->getCommand()->complete($input, $suggestions); - } - - public function setCode(callable $code): static - { - $this->getCommand()->setCode($code); - - return $this; - } - - /** - * @internal - */ - public function mergeApplicationDefinition(bool $mergeArgs = true): void - { - $this->getCommand()->mergeApplicationDefinition($mergeArgs); - } - - public function setDefinition(array|InputDefinition $definition): static - { - $this->getCommand()->setDefinition($definition); - - return $this; - } - - public function getDefinition(): InputDefinition - { - return $this->getCommand()->getDefinition(); - } - - public function getNativeDefinition(): InputDefinition - { - return $this->getCommand()->getNativeDefinition(); - } - - /** - * @param array|\Closure(CompletionInput,CompletionSuggestions):list $suggestedValues The values used for input completion - */ - public function addArgument(string $name, int $mode = null, string $description = '', mixed $default = null /* array|\Closure $suggestedValues = [] */): static - { - $suggestedValues = 5 <= \func_num_args() ? func_get_arg(4) : []; - $this->getCommand()->addArgument($name, $mode, $description, $default, $suggestedValues); - - return $this; - } - - /** - * @param array|\Closure(CompletionInput,CompletionSuggestions):list $suggestedValues The values used for input completion - */ - public function addOption(string $name, string|array $shortcut = null, int $mode = null, string $description = '', mixed $default = null /* array|\Closure $suggestedValues = [] */): static - { - $suggestedValues = 6 <= \func_num_args() ? func_get_arg(5) : []; - $this->getCommand()->addOption($name, $shortcut, $mode, $description, $default, $suggestedValues); - - return $this; - } - - public function setProcessTitle(string $title): static - { - $this->getCommand()->setProcessTitle($title); - - return $this; - } - - public function setHelp(string $help): static - { - $this->getCommand()->setHelp($help); - - return $this; - } - - public function getHelp(): string - { - return $this->getCommand()->getHelp(); - } - - public function getProcessedHelp(): string - { - return $this->getCommand()->getProcessedHelp(); - } - - public function getSynopsis(bool $short = false): string - { - return $this->getCommand()->getSynopsis($short); - } - - public function addUsage(string $usage): static - { - $this->getCommand()->addUsage($usage); - - return $this; - } - - public function getUsages(): array - { - return $this->getCommand()->getUsages(); - } - - public function getHelper(string $name): HelperInterface - { - return $this->getCommand()->getHelper($name); - } - - public function getCommand(): parent - { - if (!$this->command instanceof \Closure) { - return $this->command; - } - - $command = $this->command = ($this->command)(); - $command->setApplication($this->getApplication()); - - if (null !== $this->getHelperSet()) { - $command->setHelperSet($this->getHelperSet()); - } - - $command->setName($this->getName()) - ->setAliases($this->getAliases()) - ->setHidden($this->isHidden()) - ->setDescription($this->getDescription()); - - // Will throw if the command is not correctly initialized. - $command->getDefinition(); - - return $command; - } -} diff --git a/vendor/symfony/console/Command/ListCommand.php b/vendor/symfony/console/Command/ListCommand.php deleted file mode 100644 index cab88b43..00000000 --- a/vendor/symfony/console/Command/ListCommand.php +++ /dev/null @@ -1,76 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Descriptor\ApplicationDescription; -use Symfony\Component\Console\Helper\DescriptorHelper; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * ListCommand displays the list of all available commands for the application. - * - * @author Fabien Potencier - */ -class ListCommand extends Command -{ - protected function configure() - { - $this - ->setName('list') - ->setDefinition([ - new InputArgument('namespace', InputArgument::OPTIONAL, 'The namespace name', null, function () { - return array_keys((new ApplicationDescription($this->getApplication()))->getNamespaces()); - }), - new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command list'), - new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt', function () { - return (new DescriptorHelper())->getFormats(); - }), - new InputOption('short', null, InputOption::VALUE_NONE, 'To skip describing commands\' arguments'), - ]) - ->setDescription('List commands') - ->setHelp(<<<'EOF' -The %command.name% command lists all commands: - - %command.full_name% - -You can also display the commands for a specific namespace: - - %command.full_name% test - -You can also output the information in other formats by using the --format option: - - %command.full_name% --format=xml - -It's also possible to get raw list of commands (useful for embedding command runner): - - %command.full_name% --raw -EOF - ) - ; - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $helper = new DescriptorHelper(); - $helper->describe($output, $this->getApplication(), [ - 'format' => $input->getOption('format'), - 'raw_text' => $input->getOption('raw'), - 'namespace' => $input->getArgument('namespace'), - 'short' => $input->getOption('short'), - ]); - - return 0; - } -} diff --git a/vendor/symfony/console/Command/LockableTrait.php b/vendor/symfony/console/Command/LockableTrait.php deleted file mode 100644 index 67923a9e..00000000 --- a/vendor/symfony/console/Command/LockableTrait.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Exception\LogicException; -use Symfony\Component\Lock\LockFactory; -use Symfony\Component\Lock\LockInterface; -use Symfony\Component\Lock\Store\FlockStore; -use Symfony\Component\Lock\Store\SemaphoreStore; - -/** - * Basic lock feature for commands. - * - * @author Geoffrey Brier - */ -trait LockableTrait -{ - private ?LockInterface $lock = null; - - /** - * Locks a command. - */ - private function lock(string $name = null, bool $blocking = false): bool - { - if (!class_exists(SemaphoreStore::class)) { - throw new LogicException('To enable the locking feature you must install the symfony/lock component.'); - } - - if (null !== $this->lock) { - throw new LogicException('A lock is already in place.'); - } - - if (SemaphoreStore::isSupported()) { - $store = new SemaphoreStore(); - } else { - $store = new FlockStore(); - } - - $this->lock = (new LockFactory($store))->createLock($name ?: $this->getName()); - if (!$this->lock->acquire($blocking)) { - $this->lock = null; - - return false; - } - - return true; - } - - /** - * Releases the command lock if there is one. - */ - private function release() - { - if ($this->lock) { - $this->lock->release(); - $this->lock = null; - } - } -} diff --git a/vendor/symfony/console/Command/SignalableCommandInterface.php b/vendor/symfony/console/Command/SignalableCommandInterface.php deleted file mode 100644 index d439728b..00000000 --- a/vendor/symfony/console/Command/SignalableCommandInterface.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\Console\Command; - -/** - * Interface for command reacting to signal. - * - * @author Grégoire Pineau - */ -interface SignalableCommandInterface -{ - /** - * Returns the list of signals to subscribe. - */ - public function getSubscribedSignals(): array; - - /** - * The method will be called when the application is signaled. - */ - public function handleSignal(int $signal): void; -} diff --git a/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php b/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php deleted file mode 100644 index b6b637ce..00000000 --- a/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\CommandLoader; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Exception\CommandNotFoundException; - -/** - * @author Robin Chalas - */ -interface CommandLoaderInterface -{ - /** - * Loads a command. - * - * @throws CommandNotFoundException - */ - public function get(string $name): Command; - - /** - * Checks if a command exists. - */ - public function has(string $name): bool; - - /** - * @return string[] - */ - public function getNames(): array; -} diff --git a/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php b/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php deleted file mode 100644 index bfa0ac46..00000000 --- a/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\CommandLoader; - -use Psr\Container\ContainerInterface; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Exception\CommandNotFoundException; - -/** - * Loads commands from a PSR-11 container. - * - * @author Robin Chalas - */ -class ContainerCommandLoader implements CommandLoaderInterface -{ - private ContainerInterface $container; - private array $commandMap; - - /** - * @param array $commandMap An array with command names as keys and service ids as values - */ - public function __construct(ContainerInterface $container, array $commandMap) - { - $this->container = $container; - $this->commandMap = $commandMap; - } - - public function get(string $name): Command - { - if (!$this->has($name)) { - throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name)); - } - - return $this->container->get($this->commandMap[$name]); - } - - public function has(string $name): bool - { - return isset($this->commandMap[$name]) && $this->container->has($this->commandMap[$name]); - } - - public function getNames(): array - { - return array_keys($this->commandMap); - } -} diff --git a/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php b/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php deleted file mode 100644 index 9ced75ae..00000000 --- a/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\CommandLoader; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Exception\CommandNotFoundException; - -/** - * A simple command loader using factories to instantiate commands lazily. - * - * @author Maxime Steinhausser - */ -class FactoryCommandLoader implements CommandLoaderInterface -{ - private array $factories; - - /** - * @param callable[] $factories Indexed by command names - */ - public function __construct(array $factories) - { - $this->factories = $factories; - } - - public function has(string $name): bool - { - return isset($this->factories[$name]); - } - - public function get(string $name): Command - { - if (!isset($this->factories[$name])) { - throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name)); - } - - $factory = $this->factories[$name]; - - return $factory(); - } - - public function getNames(): array - { - return array_keys($this->factories); - } -} diff --git a/vendor/symfony/console/Completion/CompletionInput.php b/vendor/symfony/console/Completion/CompletionInput.php deleted file mode 100644 index 3ef8db5d..00000000 --- a/vendor/symfony/console/Completion/CompletionInput.php +++ /dev/null @@ -1,246 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Completion; - -use Symfony\Component\Console\Exception\RuntimeException; -use Symfony\Component\Console\Input\ArgvInput; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; - -/** - * An input specialized for shell completion. - * - * This input allows unfinished option names or values and exposes what kind of - * completion is expected. - * - * @author Wouter de Jong - */ -final class CompletionInput extends ArgvInput -{ - public const TYPE_ARGUMENT_VALUE = 'argument_value'; - public const TYPE_OPTION_VALUE = 'option_value'; - public const TYPE_OPTION_NAME = 'option_name'; - public const TYPE_NONE = 'none'; - - private $tokens; - private $currentIndex; - private $completionType; - private $completionName = null; - private $completionValue = ''; - - /** - * Converts a terminal string into tokens. - * - * This is required for shell completions without COMP_WORDS support. - */ - public static function fromString(string $inputStr, int $currentIndex): self - { - preg_match_all('/(?<=^|\s)([\'"]?)(.+?)(?tokens = $tokens; - $input->currentIndex = $currentIndex; - - return $input; - } - - public function bind(InputDefinition $definition): void - { - parent::bind($definition); - - $relevantToken = $this->getRelevantToken(); - if ('-' === $relevantToken[0]) { - // the current token is an input option: complete either option name or option value - [$optionToken, $optionValue] = explode('=', $relevantToken, 2) + ['', '']; - - $option = $this->getOptionFromToken($optionToken); - if (null === $option && !$this->isCursorFree()) { - $this->completionType = self::TYPE_OPTION_NAME; - $this->completionValue = $relevantToken; - - return; - } - - if ($option?->acceptValue()) { - $this->completionType = self::TYPE_OPTION_VALUE; - $this->completionName = $option->getName(); - $this->completionValue = $optionValue ?: (!str_starts_with($optionToken, '--') ? substr($optionToken, 2) : ''); - - return; - } - } - - $previousToken = $this->tokens[$this->currentIndex - 1]; - if ('-' === $previousToken[0] && '' !== trim($previousToken, '-')) { - // check if previous option accepted a value - $previousOption = $this->getOptionFromToken($previousToken); - if ($previousOption?->acceptValue()) { - $this->completionType = self::TYPE_OPTION_VALUE; - $this->completionName = $previousOption->getName(); - $this->completionValue = $relevantToken; - - return; - } - } - - // complete argument value - $this->completionType = self::TYPE_ARGUMENT_VALUE; - - foreach ($this->definition->getArguments() as $argumentName => $argument) { - if (!isset($this->arguments[$argumentName])) { - break; - } - - $argumentValue = $this->arguments[$argumentName]; - $this->completionName = $argumentName; - if (\is_array($argumentValue)) { - $this->completionValue = $argumentValue ? $argumentValue[array_key_last($argumentValue)] : null; - } else { - $this->completionValue = $argumentValue; - } - } - - if ($this->currentIndex >= \count($this->tokens)) { - if (!isset($this->arguments[$argumentName]) || $this->definition->getArgument($argumentName)->isArray()) { - $this->completionName = $argumentName; - $this->completionValue = ''; - } else { - // we've reached the end - $this->completionType = self::TYPE_NONE; - $this->completionName = null; - $this->completionValue = ''; - } - } - } - - /** - * Returns the type of completion required. - * - * TYPE_ARGUMENT_VALUE when completing the value of an input argument - * TYPE_OPTION_VALUE when completing the value of an input option - * TYPE_OPTION_NAME when completing the name of an input option - * TYPE_NONE when nothing should be completed - * - * @return string One of self::TYPE_* constants. TYPE_OPTION_NAME and TYPE_NONE are already implemented by the Console component - */ - public function getCompletionType(): string - { - return $this->completionType; - } - - /** - * The name of the input option or argument when completing a value. - * - * @return string|null returns null when completing an option name - */ - public function getCompletionName(): ?string - { - return $this->completionName; - } - - /** - * The value already typed by the user (or empty string). - */ - public function getCompletionValue(): string - { - return $this->completionValue; - } - - public function mustSuggestOptionValuesFor(string $optionName): bool - { - return self::TYPE_OPTION_VALUE === $this->getCompletionType() && $optionName === $this->getCompletionName(); - } - - public function mustSuggestArgumentValuesFor(string $argumentName): bool - { - return self::TYPE_ARGUMENT_VALUE === $this->getCompletionType() && $argumentName === $this->getCompletionName(); - } - - protected function parseToken(string $token, bool $parseOptions): bool - { - try { - return parent::parseToken($token, $parseOptions); - } catch (RuntimeException) { - // suppress errors, completed input is almost never valid - } - - return $parseOptions; - } - - private function getOptionFromToken(string $optionToken): ?InputOption - { - $optionName = ltrim($optionToken, '-'); - if (!$optionName) { - return null; - } - - if ('-' === ($optionToken[1] ?? ' ')) { - // long option name - return $this->definition->hasOption($optionName) ? $this->definition->getOption($optionName) : null; - } - - // short option name - return $this->definition->hasShortcut($optionName[0]) ? $this->definition->getOptionForShortcut($optionName[0]) : null; - } - - /** - * The token of the cursor, or the last token if the cursor is at the end of the input. - */ - private function getRelevantToken(): string - { - return $this->tokens[$this->isCursorFree() ? $this->currentIndex - 1 : $this->currentIndex]; - } - - /** - * Whether the cursor is "free" (i.e. at the end of the input preceded by a space). - */ - private function isCursorFree(): bool - { - $nrOfTokens = \count($this->tokens); - if ($this->currentIndex > $nrOfTokens) { - throw new \LogicException('Current index is invalid, it must be the number of input tokens or one more.'); - } - - return $this->currentIndex >= $nrOfTokens; - } - - public function __toString() - { - $str = ''; - foreach ($this->tokens as $i => $token) { - $str .= $token; - - if ($this->currentIndex === $i) { - $str .= '|'; - } - - $str .= ' '; - } - - if ($this->currentIndex > $i) { - $str .= '|'; - } - - return rtrim($str); - } -} diff --git a/vendor/symfony/console/Completion/CompletionSuggestions.php b/vendor/symfony/console/Completion/CompletionSuggestions.php deleted file mode 100644 index 71911817..00000000 --- a/vendor/symfony/console/Completion/CompletionSuggestions.php +++ /dev/null @@ -1,97 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Completion; - -use Symfony\Component\Console\Input\InputOption; - -/** - * Stores all completion suggestions for the current input. - * - * @author Wouter de Jong - */ -final class CompletionSuggestions -{ - private $valueSuggestions = []; - private $optionSuggestions = []; - - /** - * Add a suggested value for an input option or argument. - * - * @return $this - */ - public function suggestValue(string|Suggestion $value): static - { - $this->valueSuggestions[] = !$value instanceof Suggestion ? new Suggestion($value) : $value; - - return $this; - } - - /** - * Add multiple suggested values at once for an input option or argument. - * - * @param list $values - * - * @return $this - */ - public function suggestValues(array $values): static - { - foreach ($values as $value) { - $this->suggestValue($value); - } - - return $this; - } - - /** - * Add a suggestion for an input option name. - * - * @return $this - */ - public function suggestOption(InputOption $option): static - { - $this->optionSuggestions[] = $option; - - return $this; - } - - /** - * Add multiple suggestions for input option names at once. - * - * @param InputOption[] $options - * - * @return $this - */ - public function suggestOptions(array $options): static - { - foreach ($options as $option) { - $this->suggestOption($option); - } - - return $this; - } - - /** - * @return InputOption[] - */ - public function getOptionSuggestions(): array - { - return $this->optionSuggestions; - } - - /** - * @return Suggestion[] - */ - public function getValueSuggestions(): array - { - return $this->valueSuggestions; - } -} diff --git a/vendor/symfony/console/Completion/Output/BashCompletionOutput.php b/vendor/symfony/console/Completion/Output/BashCompletionOutput.php deleted file mode 100644 index c6f76eb8..00000000 --- a/vendor/symfony/console/Completion/Output/BashCompletionOutput.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\Console\Completion\Output; - -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Wouter de Jong - */ -class BashCompletionOutput implements CompletionOutputInterface -{ - public function write(CompletionSuggestions $suggestions, OutputInterface $output): void - { - $values = $suggestions->getValueSuggestions(); - foreach ($suggestions->getOptionSuggestions() as $option) { - $values[] = '--'.$option->getName(); - if ($option->isNegatable()) { - $values[] = '--no-'.$option->getName(); - } - } - $output->writeln(implode("\n", $values)); - } -} diff --git a/vendor/symfony/console/Completion/Output/CompletionOutputInterface.php b/vendor/symfony/console/Completion/Output/CompletionOutputInterface.php deleted file mode 100644 index 659e5965..00000000 --- a/vendor/symfony/console/Completion/Output/CompletionOutputInterface.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\Console\Completion\Output; - -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Transforms the {@see CompletionSuggestions} object into output readable by the shell completion. - * - * @author Wouter de Jong - */ -interface CompletionOutputInterface -{ - public function write(CompletionSuggestions $suggestions, OutputInterface $output): void; -} diff --git a/vendor/symfony/console/Completion/Output/FishCompletionOutput.php b/vendor/symfony/console/Completion/Output/FishCompletionOutput.php deleted file mode 100644 index d2c414e4..00000000 --- a/vendor/symfony/console/Completion/Output/FishCompletionOutput.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\Console\Completion\Output; - -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Guillaume Aveline - */ -class FishCompletionOutput implements CompletionOutputInterface -{ - public function write(CompletionSuggestions $suggestions, OutputInterface $output): void - { - $values = $suggestions->getValueSuggestions(); - foreach ($suggestions->getOptionSuggestions() as $option) { - $values[] = '--'.$option->getName(); - if ($option->isNegatable()) { - $values[] = '--no-'.$option->getName(); - } - } - $output->write(implode("\n", $values)); - } -} diff --git a/vendor/symfony/console/Completion/Output/ZshCompletionOutput.php b/vendor/symfony/console/Completion/Output/ZshCompletionOutput.php deleted file mode 100644 index bb4ce70b..00000000 --- a/vendor/symfony/console/Completion/Output/ZshCompletionOutput.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\Console\Completion\Output; - -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Jitendra A - */ -class ZshCompletionOutput implements CompletionOutputInterface -{ - public function write(CompletionSuggestions $suggestions, OutputInterface $output): void - { - $values = []; - foreach ($suggestions->getValueSuggestions() as $value) { - $values[] = $value->getValue().($value->getDescription() ? "\t".$value->getDescription() : ''); - } - foreach ($suggestions->getOptionSuggestions() as $option) { - $values[] = '--'.$option->getName().($option->getDescription() ? "\t".$option->getDescription() : ''); - if ($option->isNegatable()) { - $values[] = '--no-'.$option->getName().($option->getDescription() ? "\t".$option->getDescription() : ''); - } - } - $output->write(implode("\n", $values)."\n"); - } -} diff --git a/vendor/symfony/console/Completion/Suggestion.php b/vendor/symfony/console/Completion/Suggestion.php deleted file mode 100644 index 7392965a..00000000 --- a/vendor/symfony/console/Completion/Suggestion.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Completion; - -/** - * Represents a single suggested value. - * - * @author Wouter de Jong - */ -class Suggestion implements \Stringable -{ - public function __construct( - private readonly string $value, - private readonly string $description = '' - ) { - } - - public function getValue(): string - { - return $this->value; - } - - public function getDescription(): string - { - return $this->description; - } - - public function __toString(): string - { - return $this->getValue(); - } -} diff --git a/vendor/symfony/console/ConsoleEvents.php b/vendor/symfony/console/ConsoleEvents.php deleted file mode 100644 index 6ae8f32b..00000000 --- a/vendor/symfony/console/ConsoleEvents.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console; - -use Symfony\Component\Console\Event\ConsoleCommandEvent; -use Symfony\Component\Console\Event\ConsoleErrorEvent; -use Symfony\Component\Console\Event\ConsoleSignalEvent; -use Symfony\Component\Console\Event\ConsoleTerminateEvent; - -/** - * Contains all events dispatched by an Application. - * - * @author Francesco Levorato - */ -final class ConsoleEvents -{ - /** - * The COMMAND event allows you to attach listeners before any command is - * executed by the console. It also allows you to modify the command, input and output - * before they are handed to the command. - * - * @Event("Symfony\Component\Console\Event\ConsoleCommandEvent") - */ - public const COMMAND = 'console.command'; - - /** - * The SIGNAL event allows you to perform some actions - * after the command execution was interrupted. - * - * @Event("Symfony\Component\Console\Event\ConsoleSignalEvent") - */ - public const SIGNAL = 'console.signal'; - - /** - * The TERMINATE event allows you to attach listeners after a command is - * executed by the console. - * - * @Event("Symfony\Component\Console\Event\ConsoleTerminateEvent") - */ - public const TERMINATE = 'console.terminate'; - - /** - * The ERROR event occurs when an uncaught exception or error appears. - * - * This event allows you to deal with the exception/error or - * to modify the thrown exception. - * - * @Event("Symfony\Component\Console\Event\ConsoleErrorEvent") - */ - public const ERROR = 'console.error'; - - /** - * Event aliases. - * - * These aliases can be consumed by RegisterListenersPass. - */ - public const ALIASES = [ - ConsoleCommandEvent::class => self::COMMAND, - ConsoleErrorEvent::class => self::ERROR, - ConsoleSignalEvent::class => self::SIGNAL, - ConsoleTerminateEvent::class => self::TERMINATE, - ]; -} diff --git a/vendor/symfony/console/Cursor.php b/vendor/symfony/console/Cursor.php deleted file mode 100644 index b7f5a17e..00000000 --- a/vendor/symfony/console/Cursor.php +++ /dev/null @@ -1,203 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console; - -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Pierre du Plessis - */ -final class Cursor -{ - private OutputInterface $output; - private $input; - - /** - * @param resource|null $input - */ - public function __construct(OutputInterface $output, $input = null) - { - $this->output = $output; - $this->input = $input ?? (\defined('STDIN') ? \STDIN : fopen('php://input', 'r+')); - } - - /** - * @return $this - */ - public function moveUp(int $lines = 1): static - { - $this->output->write(sprintf("\x1b[%dA", $lines)); - - return $this; - } - - /** - * @return $this - */ - public function moveDown(int $lines = 1): static - { - $this->output->write(sprintf("\x1b[%dB", $lines)); - - return $this; - } - - /** - * @return $this - */ - public function moveRight(int $columns = 1): static - { - $this->output->write(sprintf("\x1b[%dC", $columns)); - - return $this; - } - - /** - * @return $this - */ - public function moveLeft(int $columns = 1): static - { - $this->output->write(sprintf("\x1b[%dD", $columns)); - - return $this; - } - - /** - * @return $this - */ - public function moveToColumn(int $column): static - { - $this->output->write(sprintf("\x1b[%dG", $column)); - - return $this; - } - - /** - * @return $this - */ - public function moveToPosition(int $column, int $row): static - { - $this->output->write(sprintf("\x1b[%d;%dH", $row + 1, $column)); - - return $this; - } - - /** - * @return $this - */ - public function savePosition(): static - { - $this->output->write("\x1b7"); - - return $this; - } - - /** - * @return $this - */ - public function restorePosition(): static - { - $this->output->write("\x1b8"); - - return $this; - } - - /** - * @return $this - */ - public function hide(): static - { - $this->output->write("\x1b[?25l"); - - return $this; - } - - /** - * @return $this - */ - public function show(): static - { - $this->output->write("\x1b[?25h\x1b[?0c"); - - return $this; - } - - /** - * Clears all the output from the current line. - * - * @return $this - */ - public function clearLine(): static - { - $this->output->write("\x1b[2K"); - - return $this; - } - - /** - * Clears all the output from the current line after the current position. - */ - public function clearLineAfter(): self - { - $this->output->write("\x1b[K"); - - return $this; - } - - /** - * Clears all the output from the cursors' current position to the end of the screen. - * - * @return $this - */ - public function clearOutput(): static - { - $this->output->write("\x1b[0J"); - - return $this; - } - - /** - * Clears the entire screen. - * - * @return $this - */ - public function clearScreen(): static - { - $this->output->write("\x1b[2J"); - - return $this; - } - - /** - * Returns the current cursor position as x,y coordinates. - */ - public function getCurrentPosition(): array - { - static $isTtySupported; - - if (!$isTtySupported ??= '/' === \DIRECTORY_SEPARATOR && stream_isatty(\STDOUT)) { - return [1, 1]; - } - - $sttyMode = shell_exec('stty -g'); - shell_exec('stty -icanon -echo'); - - @fwrite($this->input, "\033[6n"); - - $code = trim(fread($this->input, 1024)); - - shell_exec(sprintf('stty %s', $sttyMode)); - - sscanf($code, "\033[%d;%dR", $row, $col); - - return [$col, $row]; - } -} diff --git a/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php b/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php deleted file mode 100644 index 62c80c3b..00000000 --- a/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php +++ /dev/null @@ -1,131 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\DependencyInjection; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Command\LazyCommand; -use Symfony\Component\Console\CommandLoader\ContainerCommandLoader; -use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\TypedReference; - -/** - * Registers console commands. - * - * @author Grégoire Pineau - */ -class AddConsoleCommandPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - $commandServices = $container->findTaggedServiceIds('console.command', true); - $lazyCommandMap = []; - $lazyCommandRefs = []; - $serviceIds = []; - - foreach ($commandServices as $id => $tags) { - $definition = $container->getDefinition($id); - $definition->addTag('container.no_preload'); - $class = $container->getParameterBag()->resolveValue($definition->getClass()); - - if (isset($tags[0]['command'])) { - $aliases = $tags[0]['command']; - } else { - if (!$r = $container->getReflectionClass($class)) { - throw new InvalidArgumentException(sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id)); - } - if (!$r->isSubclassOf(Command::class)) { - throw new InvalidArgumentException(sprintf('The service "%s" tagged "%s" must be a subclass of "%s".', $id, 'console.command', Command::class)); - } - $aliases = str_replace('%', '%%', $class::getDefaultName() ?? ''); - } - - $aliases = explode('|', $aliases ?? ''); - $commandName = array_shift($aliases); - - if ($isHidden = '' === $commandName) { - $commandName = array_shift($aliases); - } - - if (null === $commandName) { - if (!$definition->isPublic() || $definition->isPrivate() || $definition->hasTag('container.private')) { - $commandId = 'console.command.public_alias.'.$id; - $container->setAlias($commandId, $id)->setPublic(true); - $id = $commandId; - } - $serviceIds[] = $id; - - continue; - } - - $description = $tags[0]['description'] ?? null; - - unset($tags[0]); - $lazyCommandMap[$commandName] = $id; - $lazyCommandRefs[$id] = new TypedReference($id, $class); - - foreach ($aliases as $alias) { - $lazyCommandMap[$alias] = $id; - } - - foreach ($tags as $tag) { - if (isset($tag['command'])) { - $aliases[] = $tag['command']; - $lazyCommandMap[$tag['command']] = $id; - } - - $description ??= $tag['description'] ?? null; - } - - $definition->addMethodCall('setName', [$commandName]); - - if ($aliases) { - $definition->addMethodCall('setAliases', [$aliases]); - } - - if ($isHidden) { - $definition->addMethodCall('setHidden', [true]); - } - - if (!$description) { - if (!$r = $container->getReflectionClass($class)) { - throw new InvalidArgumentException(sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id)); - } - if (!$r->isSubclassOf(Command::class)) { - throw new InvalidArgumentException(sprintf('The service "%s" tagged "%s" must be a subclass of "%s".', $id, 'console.command', Command::class)); - } - $description = str_replace('%', '%%', $class::getDefaultDescription() ?? ''); - } - - if ($description) { - $definition->addMethodCall('setDescription', [$description]); - - $container->register('.'.$id.'.lazy', LazyCommand::class) - ->setArguments([$commandName, $aliases, $description, $isHidden, new ServiceClosureArgument($lazyCommandRefs[$id])]); - - $lazyCommandRefs[$id] = new Reference('.'.$id.'.lazy'); - } - } - - $container - ->register('console.command_loader', ContainerCommandLoader::class) - ->setPublic(true) - ->addTag('container.no_preload') - ->setArguments([ServiceLocatorTagPass::register($container, $lazyCommandRefs), $lazyCommandMap]); - - $container->setParameter('console.command.ids', $serviceIds); - } -} diff --git a/vendor/symfony/console/Descriptor/ApplicationDescription.php b/vendor/symfony/console/Descriptor/ApplicationDescription.php deleted file mode 100644 index 2158339e..00000000 --- a/vendor/symfony/console/Descriptor/ApplicationDescription.php +++ /dev/null @@ -1,139 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Descriptor; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Exception\CommandNotFoundException; - -/** - * @author Jean-François Simon - * - * @internal - */ -class ApplicationDescription -{ - public const GLOBAL_NAMESPACE = '_global'; - - private Application $application; - private ?string $namespace; - private bool $showHidden; - private array $namespaces; - - /** - * @var array - */ - private array $commands; - - /** - * @var array - */ - private array $aliases = []; - - public function __construct(Application $application, string $namespace = null, bool $showHidden = false) - { - $this->application = $application; - $this->namespace = $namespace; - $this->showHidden = $showHidden; - } - - public function getNamespaces(): array - { - if (!isset($this->namespaces)) { - $this->inspectApplication(); - } - - return $this->namespaces; - } - - /** - * @return Command[] - */ - public function getCommands(): array - { - if (!isset($this->commands)) { - $this->inspectApplication(); - } - - return $this->commands; - } - - /** - * @throws CommandNotFoundException - */ - public function getCommand(string $name): Command - { - if (!isset($this->commands[$name]) && !isset($this->aliases[$name])) { - throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name)); - } - - return $this->commands[$name] ?? $this->aliases[$name]; - } - - private function inspectApplication() - { - $this->commands = []; - $this->namespaces = []; - - $all = $this->application->all($this->namespace ? $this->application->findNamespace($this->namespace) : null); - foreach ($this->sortCommands($all) as $namespace => $commands) { - $names = []; - - /** @var Command $command */ - foreach ($commands as $name => $command) { - if (!$command->getName() || (!$this->showHidden && $command->isHidden())) { - continue; - } - - if ($command->getName() === $name) { - $this->commands[$name] = $command; - } else { - $this->aliases[$name] = $command; - } - - $names[] = $name; - } - - $this->namespaces[$namespace] = ['id' => $namespace, 'commands' => $names]; - } - } - - private function sortCommands(array $commands): array - { - $namespacedCommands = []; - $globalCommands = []; - $sortedCommands = []; - foreach ($commands as $name => $command) { - $key = $this->application->extractNamespace($name, 1); - if (\in_array($key, ['', self::GLOBAL_NAMESPACE], true)) { - $globalCommands[$name] = $command; - } else { - $namespacedCommands[$key][$name] = $command; - } - } - - if ($globalCommands) { - ksort($globalCommands); - $sortedCommands[self::GLOBAL_NAMESPACE] = $globalCommands; - } - - if ($namespacedCommands) { - ksort($namespacedCommands, \SORT_STRING); - foreach ($namespacedCommands as $key => $commandsSet) { - ksort($commandsSet); - $sortedCommands[$key] = $commandsSet; - } - } - - return $sortedCommands; - } -} diff --git a/vendor/symfony/console/Descriptor/Descriptor.php b/vendor/symfony/console/Descriptor/Descriptor.php deleted file mode 100644 index 1476f575..00000000 --- a/vendor/symfony/console/Descriptor/Descriptor.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\Console\Descriptor; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Jean-François Simon - * - * @internal - */ -abstract class Descriptor implements DescriptorInterface -{ - /** - * @var OutputInterface - */ - protected $output; - - public function describe(OutputInterface $output, object $object, array $options = []) - { - $this->output = $output; - - match (true) { - $object instanceof InputArgument => $this->describeInputArgument($object, $options), - $object instanceof InputOption => $this->describeInputOption($object, $options), - $object instanceof InputDefinition => $this->describeInputDefinition($object, $options), - $object instanceof Command => $this->describeCommand($object, $options), - $object instanceof Application => $this->describeApplication($object, $options), - default => throw new InvalidArgumentException(sprintf('Object of type "%s" is not describable.', get_debug_type($object))), - }; - } - - /** - * Writes content to output. - */ - protected function write(string $content, bool $decorated = false) - { - $this->output->write($content, false, $decorated ? OutputInterface::OUTPUT_NORMAL : OutputInterface::OUTPUT_RAW); - } - - /** - * Describes an InputArgument instance. - */ - abstract protected function describeInputArgument(InputArgument $argument, array $options = []); - - /** - * Describes an InputOption instance. - */ - abstract protected function describeInputOption(InputOption $option, array $options = []); - - /** - * Describes an InputDefinition instance. - */ - abstract protected function describeInputDefinition(InputDefinition $definition, array $options = []); - - /** - * Describes a Command instance. - */ - abstract protected function describeCommand(Command $command, array $options = []); - - /** - * Describes an Application instance. - */ - abstract protected function describeApplication(Application $application, array $options = []); -} diff --git a/vendor/symfony/console/Descriptor/DescriptorInterface.php b/vendor/symfony/console/Descriptor/DescriptorInterface.php deleted file mode 100644 index ebea3036..00000000 --- a/vendor/symfony/console/Descriptor/DescriptorInterface.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\Console\Descriptor; - -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Descriptor interface. - * - * @author Jean-François Simon - */ -interface DescriptorInterface -{ - public function describe(OutputInterface $output, object $object, array $options = []); -} diff --git a/vendor/symfony/console/Descriptor/JsonDescriptor.php b/vendor/symfony/console/Descriptor/JsonDescriptor.php deleted file mode 100644 index 6f79a17a..00000000 --- a/vendor/symfony/console/Descriptor/JsonDescriptor.php +++ /dev/null @@ -1,166 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Descriptor; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; - -/** - * JSON descriptor. - * - * @author Jean-François Simon - * - * @internal - */ -class JsonDescriptor extends Descriptor -{ - protected function describeInputArgument(InputArgument $argument, array $options = []) - { - $this->writeData($this->getInputArgumentData($argument), $options); - } - - protected function describeInputOption(InputOption $option, array $options = []) - { - $this->writeData($this->getInputOptionData($option), $options); - if ($option->isNegatable()) { - $this->writeData($this->getInputOptionData($option, true), $options); - } - } - - protected function describeInputDefinition(InputDefinition $definition, array $options = []) - { - $this->writeData($this->getInputDefinitionData($definition), $options); - } - - protected function describeCommand(Command $command, array $options = []) - { - $this->writeData($this->getCommandData($command, $options['short'] ?? false), $options); - } - - protected function describeApplication(Application $application, array $options = []) - { - $describedNamespace = $options['namespace'] ?? null; - $description = new ApplicationDescription($application, $describedNamespace, true); - $commands = []; - - foreach ($description->getCommands() as $command) { - $commands[] = $this->getCommandData($command, $options['short'] ?? false); - } - - $data = []; - if ('UNKNOWN' !== $application->getName()) { - $data['application']['name'] = $application->getName(); - if ('UNKNOWN' !== $application->getVersion()) { - $data['application']['version'] = $application->getVersion(); - } - } - - $data['commands'] = $commands; - - if ($describedNamespace) { - $data['namespace'] = $describedNamespace; - } else { - $data['namespaces'] = array_values($description->getNamespaces()); - } - - $this->writeData($data, $options); - } - - /** - * Writes data as json. - */ - private function writeData(array $data, array $options) - { - $flags = $options['json_encoding'] ?? 0; - - $this->write(json_encode($data, $flags)); - } - - private function getInputArgumentData(InputArgument $argument): array - { - return [ - 'name' => $argument->getName(), - 'is_required' => $argument->isRequired(), - 'is_array' => $argument->isArray(), - 'description' => preg_replace('/\s*[\r\n]\s*/', ' ', $argument->getDescription()), - 'default' => \INF === $argument->getDefault() ? 'INF' : $argument->getDefault(), - ]; - } - - private function getInputOptionData(InputOption $option, bool $negated = false): array - { - return $negated ? [ - 'name' => '--no-'.$option->getName(), - 'shortcut' => '', - 'accept_value' => false, - 'is_value_required' => false, - 'is_multiple' => false, - 'description' => 'Negate the "--'.$option->getName().'" option', - 'default' => false, - ] : [ - 'name' => '--'.$option->getName(), - 'shortcut' => $option->getShortcut() ? '-'.str_replace('|', '|-', $option->getShortcut()) : '', - 'accept_value' => $option->acceptValue(), - 'is_value_required' => $option->isValueRequired(), - 'is_multiple' => $option->isArray(), - 'description' => preg_replace('/\s*[\r\n]\s*/', ' ', $option->getDescription()), - 'default' => \INF === $option->getDefault() ? 'INF' : $option->getDefault(), - ]; - } - - private function getInputDefinitionData(InputDefinition $definition): array - { - $inputArguments = []; - foreach ($definition->getArguments() as $name => $argument) { - $inputArguments[$name] = $this->getInputArgumentData($argument); - } - - $inputOptions = []; - foreach ($definition->getOptions() as $name => $option) { - $inputOptions[$name] = $this->getInputOptionData($option); - if ($option->isNegatable()) { - $inputOptions['no-'.$name] = $this->getInputOptionData($option, true); - } - } - - return ['arguments' => $inputArguments, 'options' => $inputOptions]; - } - - private function getCommandData(Command $command, bool $short = false): array - { - $data = [ - 'name' => $command->getName(), - 'description' => $command->getDescription(), - ]; - - if ($short) { - $data += [ - 'usage' => $command->getAliases(), - ]; - } else { - $command->mergeApplicationDefinition(false); - - $data += [ - 'usage' => array_merge([$command->getSynopsis()], $command->getUsages(), $command->getAliases()), - 'help' => $command->getProcessedHelp(), - 'definition' => $this->getInputDefinitionData($command->getDefinition()), - ]; - } - - $data['hidden'] = $command->isHidden(); - - return $data; - } -} diff --git a/vendor/symfony/console/Descriptor/MarkdownDescriptor.php b/vendor/symfony/console/Descriptor/MarkdownDescriptor.php deleted file mode 100644 index fbd9c534..00000000 --- a/vendor/symfony/console/Descriptor/MarkdownDescriptor.php +++ /dev/null @@ -1,185 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Descriptor; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Helper\Helper; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Markdown descriptor. - * - * @author Jean-François Simon - * - * @internal - */ -class MarkdownDescriptor extends Descriptor -{ - public function describe(OutputInterface $output, object $object, array $options = []) - { - $decorated = $output->isDecorated(); - $output->setDecorated(false); - - parent::describe($output, $object, $options); - - $output->setDecorated($decorated); - } - - protected function write(string $content, bool $decorated = true) - { - parent::write($content, $decorated); - } - - protected function describeInputArgument(InputArgument $argument, array $options = []) - { - $this->write( - '#### `'.($argument->getName() ?: '')."`\n\n" - .($argument->getDescription() ? preg_replace('/\s*[\r\n]\s*/', "\n", $argument->getDescription())."\n\n" : '') - .'* Is required: '.($argument->isRequired() ? 'yes' : 'no')."\n" - .'* Is array: '.($argument->isArray() ? 'yes' : 'no')."\n" - .'* Default: `'.str_replace("\n", '', var_export($argument->getDefault(), true)).'`' - ); - } - - protected function describeInputOption(InputOption $option, array $options = []) - { - $name = '--'.$option->getName(); - if ($option->isNegatable()) { - $name .= '|--no-'.$option->getName(); - } - if ($option->getShortcut()) { - $name .= '|-'.str_replace('|', '|-', $option->getShortcut()).''; - } - - $this->write( - '#### `'.$name.'`'."\n\n" - .($option->getDescription() ? preg_replace('/\s*[\r\n]\s*/', "\n", $option->getDescription())."\n\n" : '') - .'* Accept value: '.($option->acceptValue() ? 'yes' : 'no')."\n" - .'* Is value required: '.($option->isValueRequired() ? 'yes' : 'no')."\n" - .'* Is multiple: '.($option->isArray() ? 'yes' : 'no')."\n" - .'* Is negatable: '.($option->isNegatable() ? 'yes' : 'no')."\n" - .'* Default: `'.str_replace("\n", '', var_export($option->getDefault(), true)).'`' - ); - } - - protected function describeInputDefinition(InputDefinition $definition, array $options = []) - { - if ($showArguments = \count($definition->getArguments()) > 0) { - $this->write('### Arguments'); - foreach ($definition->getArguments() as $argument) { - $this->write("\n\n"); - if (null !== $describeInputArgument = $this->describeInputArgument($argument)) { - $this->write($describeInputArgument); - } - } - } - - if (\count($definition->getOptions()) > 0) { - if ($showArguments) { - $this->write("\n\n"); - } - - $this->write('### Options'); - foreach ($definition->getOptions() as $option) { - $this->write("\n\n"); - if (null !== $describeInputOption = $this->describeInputOption($option)) { - $this->write($describeInputOption); - } - } - } - } - - protected function describeCommand(Command $command, array $options = []) - { - if ($options['short'] ?? false) { - $this->write( - '`'.$command->getName()."`\n" - .str_repeat('-', Helper::width($command->getName()) + 2)."\n\n" - .($command->getDescription() ? $command->getDescription()."\n\n" : '') - .'### Usage'."\n\n" - .array_reduce($command->getAliases(), function ($carry, $usage) { - return $carry.'* `'.$usage.'`'."\n"; - }) - ); - - return; - } - - $command->mergeApplicationDefinition(false); - - $this->write( - '`'.$command->getName()."`\n" - .str_repeat('-', Helper::width($command->getName()) + 2)."\n\n" - .($command->getDescription() ? $command->getDescription()."\n\n" : '') - .'### Usage'."\n\n" - .array_reduce(array_merge([$command->getSynopsis()], $command->getAliases(), $command->getUsages()), function ($carry, $usage) { - return $carry.'* `'.$usage.'`'."\n"; - }) - ); - - if ($help = $command->getProcessedHelp()) { - $this->write("\n"); - $this->write($help); - } - - $definition = $command->getDefinition(); - if ($definition->getOptions() || $definition->getArguments()) { - $this->write("\n\n"); - $this->describeInputDefinition($definition); - } - } - - protected function describeApplication(Application $application, array $options = []) - { - $describedNamespace = $options['namespace'] ?? null; - $description = new ApplicationDescription($application, $describedNamespace); - $title = $this->getApplicationTitle($application); - - $this->write($title."\n".str_repeat('=', Helper::width($title))); - - foreach ($description->getNamespaces() as $namespace) { - if (ApplicationDescription::GLOBAL_NAMESPACE !== $namespace['id']) { - $this->write("\n\n"); - $this->write('**'.$namespace['id'].':**'); - } - - $this->write("\n\n"); - $this->write(implode("\n", array_map(function ($commandName) use ($description) { - return sprintf('* [`%s`](#%s)', $commandName, str_replace(':', '', $description->getCommand($commandName)->getName())); - }, $namespace['commands']))); - } - - foreach ($description->getCommands() as $command) { - $this->write("\n\n"); - if (null !== $describeCommand = $this->describeCommand($command, $options)) { - $this->write($describeCommand); - } - } - } - - private function getApplicationTitle(Application $application): string - { - if ('UNKNOWN' !== $application->getName()) { - if ('UNKNOWN' !== $application->getVersion()) { - return sprintf('%s %s', $application->getName(), $application->getVersion()); - } - - return $application->getName(); - } - - return 'Console Tool'; - } -} diff --git a/vendor/symfony/console/Descriptor/TextDescriptor.php b/vendor/symfony/console/Descriptor/TextDescriptor.php deleted file mode 100644 index 48a0b42a..00000000 --- a/vendor/symfony/console/Descriptor/TextDescriptor.php +++ /dev/null @@ -1,321 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Descriptor; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Helper\Helper; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; - -/** - * Text descriptor. - * - * @author Jean-François Simon - * - * @internal - */ -class TextDescriptor extends Descriptor -{ - protected function describeInputArgument(InputArgument $argument, array $options = []) - { - if (null !== $argument->getDefault() && (!\is_array($argument->getDefault()) || \count($argument->getDefault()))) { - $default = sprintf(' [default: %s]', $this->formatDefaultValue($argument->getDefault())); - } else { - $default = ''; - } - - $totalWidth = $options['total_width'] ?? Helper::width($argument->getName()); - $spacingWidth = $totalWidth - \strlen($argument->getName()); - - $this->writeText(sprintf(' %s %s%s%s', - $argument->getName(), - str_repeat(' ', $spacingWidth), - // + 4 = 2 spaces before , 2 spaces after - preg_replace('/\s*[\r\n]\s*/', "\n".str_repeat(' ', $totalWidth + 4), $argument->getDescription()), - $default - ), $options); - } - - protected function describeInputOption(InputOption $option, array $options = []) - { - if ($option->acceptValue() && null !== $option->getDefault() && (!\is_array($option->getDefault()) || \count($option->getDefault()))) { - $default = sprintf(' [default: %s]', $this->formatDefaultValue($option->getDefault())); - } else { - $default = ''; - } - - $value = ''; - if ($option->acceptValue()) { - $value = '='.strtoupper($option->getName()); - - if ($option->isValueOptional()) { - $value = '['.$value.']'; - } - } - - $totalWidth = $options['total_width'] ?? $this->calculateTotalWidthForOptions([$option]); - $synopsis = sprintf('%s%s', - $option->getShortcut() ? sprintf('-%s, ', $option->getShortcut()) : ' ', - sprintf($option->isNegatable() ? '--%1$s|--no-%1$s' : '--%1$s%2$s', $option->getName(), $value) - ); - - $spacingWidth = $totalWidth - Helper::width($synopsis); - - $this->writeText(sprintf(' %s %s%s%s%s', - $synopsis, - str_repeat(' ', $spacingWidth), - // + 4 = 2 spaces before , 2 spaces after - preg_replace('/\s*[\r\n]\s*/', "\n".str_repeat(' ', $totalWidth + 4), $option->getDescription()), - $default, - $option->isArray() ? ' (multiple values allowed)' : '' - ), $options); - } - - protected function describeInputDefinition(InputDefinition $definition, array $options = []) - { - $totalWidth = $this->calculateTotalWidthForOptions($definition->getOptions()); - foreach ($definition->getArguments() as $argument) { - $totalWidth = max($totalWidth, Helper::width($argument->getName())); - } - - if ($definition->getArguments()) { - $this->writeText('Arguments:', $options); - $this->writeText("\n"); - foreach ($definition->getArguments() as $argument) { - $this->describeInputArgument($argument, array_merge($options, ['total_width' => $totalWidth])); - $this->writeText("\n"); - } - } - - if ($definition->getArguments() && $definition->getOptions()) { - $this->writeText("\n"); - } - - if ($definition->getOptions()) { - $laterOptions = []; - - $this->writeText('Options:', $options); - foreach ($definition->getOptions() as $option) { - if (\strlen($option->getShortcut() ?? '') > 1) { - $laterOptions[] = $option; - continue; - } - $this->writeText("\n"); - $this->describeInputOption($option, array_merge($options, ['total_width' => $totalWidth])); - } - foreach ($laterOptions as $option) { - $this->writeText("\n"); - $this->describeInputOption($option, array_merge($options, ['total_width' => $totalWidth])); - } - } - } - - protected function describeCommand(Command $command, array $options = []) - { - $command->mergeApplicationDefinition(false); - - if ($description = $command->getDescription()) { - $this->writeText('Description:', $options); - $this->writeText("\n"); - $this->writeText(' '.$description); - $this->writeText("\n\n"); - } - - $this->writeText('Usage:', $options); - foreach (array_merge([$command->getSynopsis(true)], $command->getAliases(), $command->getUsages()) as $usage) { - $this->writeText("\n"); - $this->writeText(' '.OutputFormatter::escape($usage), $options); - } - $this->writeText("\n"); - - $definition = $command->getDefinition(); - if ($definition->getOptions() || $definition->getArguments()) { - $this->writeText("\n"); - $this->describeInputDefinition($definition, $options); - $this->writeText("\n"); - } - - $help = $command->getProcessedHelp(); - if ($help && $help !== $description) { - $this->writeText("\n"); - $this->writeText('Help:', $options); - $this->writeText("\n"); - $this->writeText(' '.str_replace("\n", "\n ", $help), $options); - $this->writeText("\n"); - } - } - - protected function describeApplication(Application $application, array $options = []) - { - $describedNamespace = $options['namespace'] ?? null; - $description = new ApplicationDescription($application, $describedNamespace); - - if (isset($options['raw_text']) && $options['raw_text']) { - $width = $this->getColumnWidth($description->getCommands()); - - foreach ($description->getCommands() as $command) { - $this->writeText(sprintf("%-{$width}s %s", $command->getName(), $command->getDescription()), $options); - $this->writeText("\n"); - } - } else { - if ('' != $help = $application->getHelp()) { - $this->writeText("$help\n\n", $options); - } - - $this->writeText("Usage:\n", $options); - $this->writeText(" command [options] [arguments]\n\n", $options); - - $this->describeInputDefinition(new InputDefinition($application->getDefinition()->getOptions()), $options); - - $this->writeText("\n"); - $this->writeText("\n"); - - $commands = $description->getCommands(); - $namespaces = $description->getNamespaces(); - if ($describedNamespace && $namespaces) { - // make sure all alias commands are included when describing a specific namespace - $describedNamespaceInfo = reset($namespaces); - foreach ($describedNamespaceInfo['commands'] as $name) { - $commands[$name] = $description->getCommand($name); - } - } - - // calculate max. width based on available commands per namespace - $width = $this->getColumnWidth(array_merge(...array_values(array_map(function ($namespace) use ($commands) { - return array_intersect($namespace['commands'], array_keys($commands)); - }, array_values($namespaces))))); - - if ($describedNamespace) { - $this->writeText(sprintf('Available commands for the "%s" namespace:', $describedNamespace), $options); - } else { - $this->writeText('Available commands:', $options); - } - - foreach ($namespaces as $namespace) { - $namespace['commands'] = array_filter($namespace['commands'], function ($name) use ($commands) { - return isset($commands[$name]); - }); - - if (!$namespace['commands']) { - continue; - } - - if (!$describedNamespace && ApplicationDescription::GLOBAL_NAMESPACE !== $namespace['id']) { - $this->writeText("\n"); - $this->writeText(' '.$namespace['id'].'', $options); - } - - foreach ($namespace['commands'] as $name) { - $this->writeText("\n"); - $spacingWidth = $width - Helper::width($name); - $command = $commands[$name]; - $commandAliases = $name === $command->getName() ? $this->getCommandAliasesText($command) : ''; - $this->writeText(sprintf(' %s%s%s', $name, str_repeat(' ', $spacingWidth), $commandAliases.$command->getDescription()), $options); - } - } - - $this->writeText("\n"); - } - } - - private function writeText(string $content, array $options = []) - { - $this->write( - isset($options['raw_text']) && $options['raw_text'] ? strip_tags($content) : $content, - isset($options['raw_output']) ? !$options['raw_output'] : true - ); - } - - /** - * Formats command aliases to show them in the command description. - */ - private function getCommandAliasesText(Command $command): string - { - $text = ''; - $aliases = $command->getAliases(); - - if ($aliases) { - $text = '['.implode('|', $aliases).'] '; - } - - return $text; - } - - /** - * Formats input option/argument default value. - */ - private function formatDefaultValue(mixed $default): string - { - if (\INF === $default) { - return 'INF'; - } - - if (\is_string($default)) { - $default = OutputFormatter::escape($default); - } elseif (\is_array($default)) { - foreach ($default as $key => $value) { - if (\is_string($value)) { - $default[$key] = OutputFormatter::escape($value); - } - } - } - - return str_replace('\\\\', '\\', json_encode($default, \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE)); - } - - /** - * @param array $commands - */ - private function getColumnWidth(array $commands): int - { - $widths = []; - - foreach ($commands as $command) { - if ($command instanceof Command) { - $widths[] = Helper::width($command->getName()); - foreach ($command->getAliases() as $alias) { - $widths[] = Helper::width($alias); - } - } else { - $widths[] = Helper::width($command); - } - } - - return $widths ? max($widths) + 2 : 0; - } - - /** - * @param InputOption[] $options - */ - private function calculateTotalWidthForOptions(array $options): int - { - $totalWidth = 0; - foreach ($options as $option) { - // "-" + shortcut + ", --" + name - $nameLength = 1 + max(Helper::width($option->getShortcut()), 1) + 4 + Helper::width($option->getName()); - if ($option->isNegatable()) { - $nameLength += 6 + Helper::width($option->getName()); // |--no- + name - } elseif ($option->acceptValue()) { - $valueLength = 1 + Helper::width($option->getName()); // = + value - $valueLength += $option->isValueOptional() ? 2 : 0; // [ + ] - - $nameLength += $valueLength; - } - $totalWidth = max($totalWidth, $nameLength); - } - - return $totalWidth; - } -} diff --git a/vendor/symfony/console/Descriptor/XmlDescriptor.php b/vendor/symfony/console/Descriptor/XmlDescriptor.php deleted file mode 100644 index f4643a9a..00000000 --- a/vendor/symfony/console/Descriptor/XmlDescriptor.php +++ /dev/null @@ -1,232 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Descriptor; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; - -/** - * XML descriptor. - * - * @author Jean-François Simon - * - * @internal - */ -class XmlDescriptor extends Descriptor -{ - public function getInputDefinitionDocument(InputDefinition $definition): \DOMDocument - { - $dom = new \DOMDocument('1.0', 'UTF-8'); - $dom->appendChild($definitionXML = $dom->createElement('definition')); - - $definitionXML->appendChild($argumentsXML = $dom->createElement('arguments')); - foreach ($definition->getArguments() as $argument) { - $this->appendDocument($argumentsXML, $this->getInputArgumentDocument($argument)); - } - - $definitionXML->appendChild($optionsXML = $dom->createElement('options')); - foreach ($definition->getOptions() as $option) { - $this->appendDocument($optionsXML, $this->getInputOptionDocument($option)); - } - - return $dom; - } - - public function getCommandDocument(Command $command, bool $short = false): \DOMDocument - { - $dom = new \DOMDocument('1.0', 'UTF-8'); - $dom->appendChild($commandXML = $dom->createElement('command')); - - $commandXML->setAttribute('id', $command->getName()); - $commandXML->setAttribute('name', $command->getName()); - $commandXML->setAttribute('hidden', $command->isHidden() ? 1 : 0); - - $commandXML->appendChild($usagesXML = $dom->createElement('usages')); - - $commandXML->appendChild($descriptionXML = $dom->createElement('description')); - $descriptionXML->appendChild($dom->createTextNode(str_replace("\n", "\n ", $command->getDescription()))); - - if ($short) { - foreach ($command->getAliases() as $usage) { - $usagesXML->appendChild($dom->createElement('usage', $usage)); - } - } else { - $command->mergeApplicationDefinition(false); - - foreach (array_merge([$command->getSynopsis()], $command->getAliases(), $command->getUsages()) as $usage) { - $usagesXML->appendChild($dom->createElement('usage', $usage)); - } - - $commandXML->appendChild($helpXML = $dom->createElement('help')); - $helpXML->appendChild($dom->createTextNode(str_replace("\n", "\n ", $command->getProcessedHelp()))); - - $definitionXML = $this->getInputDefinitionDocument($command->getDefinition()); - $this->appendDocument($commandXML, $definitionXML->getElementsByTagName('definition')->item(0)); - } - - return $dom; - } - - public function getApplicationDocument(Application $application, string $namespace = null, bool $short = false): \DOMDocument - { - $dom = new \DOMDocument('1.0', 'UTF-8'); - $dom->appendChild($rootXml = $dom->createElement('symfony')); - - if ('UNKNOWN' !== $application->getName()) { - $rootXml->setAttribute('name', $application->getName()); - if ('UNKNOWN' !== $application->getVersion()) { - $rootXml->setAttribute('version', $application->getVersion()); - } - } - - $rootXml->appendChild($commandsXML = $dom->createElement('commands')); - - $description = new ApplicationDescription($application, $namespace, true); - - if ($namespace) { - $commandsXML->setAttribute('namespace', $namespace); - } - - foreach ($description->getCommands() as $command) { - $this->appendDocument($commandsXML, $this->getCommandDocument($command, $short)); - } - - if (!$namespace) { - $rootXml->appendChild($namespacesXML = $dom->createElement('namespaces')); - - foreach ($description->getNamespaces() as $namespaceDescription) { - $namespacesXML->appendChild($namespaceArrayXML = $dom->createElement('namespace')); - $namespaceArrayXML->setAttribute('id', $namespaceDescription['id']); - - foreach ($namespaceDescription['commands'] as $name) { - $namespaceArrayXML->appendChild($commandXML = $dom->createElement('command')); - $commandXML->appendChild($dom->createTextNode($name)); - } - } - } - - return $dom; - } - - protected function describeInputArgument(InputArgument $argument, array $options = []) - { - $this->writeDocument($this->getInputArgumentDocument($argument)); - } - - protected function describeInputOption(InputOption $option, array $options = []) - { - $this->writeDocument($this->getInputOptionDocument($option)); - } - - protected function describeInputDefinition(InputDefinition $definition, array $options = []) - { - $this->writeDocument($this->getInputDefinitionDocument($definition)); - } - - protected function describeCommand(Command $command, array $options = []) - { - $this->writeDocument($this->getCommandDocument($command, $options['short'] ?? false)); - } - - protected function describeApplication(Application $application, array $options = []) - { - $this->writeDocument($this->getApplicationDocument($application, $options['namespace'] ?? null, $options['short'] ?? false)); - } - - /** - * Appends document children to parent node. - */ - private function appendDocument(\DOMNode $parentNode, \DOMNode $importedParent) - { - foreach ($importedParent->childNodes as $childNode) { - $parentNode->appendChild($parentNode->ownerDocument->importNode($childNode, true)); - } - } - - /** - * Writes DOM document. - */ - private function writeDocument(\DOMDocument $dom) - { - $dom->formatOutput = true; - $this->write($dom->saveXML()); - } - - private function getInputArgumentDocument(InputArgument $argument): \DOMDocument - { - $dom = new \DOMDocument('1.0', 'UTF-8'); - - $dom->appendChild($objectXML = $dom->createElement('argument')); - $objectXML->setAttribute('name', $argument->getName()); - $objectXML->setAttribute('is_required', $argument->isRequired() ? 1 : 0); - $objectXML->setAttribute('is_array', $argument->isArray() ? 1 : 0); - $objectXML->appendChild($descriptionXML = $dom->createElement('description')); - $descriptionXML->appendChild($dom->createTextNode($argument->getDescription())); - - $objectXML->appendChild($defaultsXML = $dom->createElement('defaults')); - $defaults = \is_array($argument->getDefault()) ? $argument->getDefault() : (\is_bool($argument->getDefault()) ? [var_export($argument->getDefault(), true)] : ($argument->getDefault() ? [$argument->getDefault()] : [])); - foreach ($defaults as $default) { - $defaultsXML->appendChild($defaultXML = $dom->createElement('default')); - $defaultXML->appendChild($dom->createTextNode($default)); - } - - return $dom; - } - - private function getInputOptionDocument(InputOption $option): \DOMDocument - { - $dom = new \DOMDocument('1.0', 'UTF-8'); - - $dom->appendChild($objectXML = $dom->createElement('option')); - $objectXML->setAttribute('name', '--'.$option->getName()); - $pos = strpos($option->getShortcut() ?? '', '|'); - if (false !== $pos) { - $objectXML->setAttribute('shortcut', '-'.substr($option->getShortcut(), 0, $pos)); - $objectXML->setAttribute('shortcuts', '-'.str_replace('|', '|-', $option->getShortcut())); - } else { - $objectXML->setAttribute('shortcut', $option->getShortcut() ? '-'.$option->getShortcut() : ''); - } - $objectXML->setAttribute('accept_value', $option->acceptValue() ? 1 : 0); - $objectXML->setAttribute('is_value_required', $option->isValueRequired() ? 1 : 0); - $objectXML->setAttribute('is_multiple', $option->isArray() ? 1 : 0); - $objectXML->appendChild($descriptionXML = $dom->createElement('description')); - $descriptionXML->appendChild($dom->createTextNode($option->getDescription())); - - if ($option->acceptValue()) { - $defaults = \is_array($option->getDefault()) ? $option->getDefault() : (\is_bool($option->getDefault()) ? [var_export($option->getDefault(), true)] : ($option->getDefault() ? [$option->getDefault()] : [])); - $objectXML->appendChild($defaultsXML = $dom->createElement('defaults')); - - if (!empty($defaults)) { - foreach ($defaults as $default) { - $defaultsXML->appendChild($defaultXML = $dom->createElement('default')); - $defaultXML->appendChild($dom->createTextNode($default)); - } - } - } - - if ($option->isNegatable()) { - $dom->appendChild($objectXML = $dom->createElement('option')); - $objectXML->setAttribute('name', '--no-'.$option->getName()); - $objectXML->setAttribute('shortcut', ''); - $objectXML->setAttribute('accept_value', 0); - $objectXML->setAttribute('is_value_required', 0); - $objectXML->setAttribute('is_multiple', 0); - $objectXML->appendChild($descriptionXML = $dom->createElement('description')); - $descriptionXML->appendChild($dom->createTextNode('Negate the "--'.$option->getName().'" option')); - } - - return $dom; - } -} diff --git a/vendor/symfony/console/Event/ConsoleCommandEvent.php b/vendor/symfony/console/Event/ConsoleCommandEvent.php deleted file mode 100644 index 31c9ee99..00000000 --- a/vendor/symfony/console/Event/ConsoleCommandEvent.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\Console\Event; - -/** - * Allows to do things before the command is executed, like skipping the command or changing the input. - * - * @author Fabien Potencier - */ -final class ConsoleCommandEvent extends ConsoleEvent -{ - /** - * The return code for skipped commands, this will also be passed into the terminate event. - */ - public const RETURN_CODE_DISABLED = 113; - - /** - * Indicates if the command should be run or skipped. - */ - private bool $commandShouldRun = true; - - /** - * Disables the command, so it won't be run. - */ - public function disableCommand(): bool - { - return $this->commandShouldRun = false; - } - - public function enableCommand(): bool - { - return $this->commandShouldRun = true; - } - - /** - * Returns true if the command is runnable, false otherwise. - */ - public function commandShouldRun(): bool - { - return $this->commandShouldRun; - } -} diff --git a/vendor/symfony/console/Event/ConsoleErrorEvent.php b/vendor/symfony/console/Event/ConsoleErrorEvent.php deleted file mode 100644 index d4a69121..00000000 --- a/vendor/symfony/console/Event/ConsoleErrorEvent.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. - */ - -namespace Symfony\Component\Console\Event; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Allows to handle throwables thrown while running a command. - * - * @author Wouter de Jong - */ -final class ConsoleErrorEvent extends ConsoleEvent -{ - private \Throwable $error; - private int $exitCode; - - public function __construct(InputInterface $input, OutputInterface $output, \Throwable $error, Command $command = null) - { - parent::__construct($command, $input, $output); - - $this->error = $error; - } - - public function getError(): \Throwable - { - return $this->error; - } - - public function setError(\Throwable $error): void - { - $this->error = $error; - } - - public function setExitCode(int $exitCode): void - { - $this->exitCode = $exitCode; - - $r = new \ReflectionProperty($this->error, 'code'); - $r->setValue($this->error, $this->exitCode); - } - - public function getExitCode(): int - { - return $this->exitCode ?? (\is_int($this->error->getCode()) && 0 !== $this->error->getCode() ? $this->error->getCode() : 1); - } -} diff --git a/vendor/symfony/console/Event/ConsoleEvent.php b/vendor/symfony/console/Event/ConsoleEvent.php deleted file mode 100644 index 6ba1615f..00000000 --- a/vendor/symfony/console/Event/ConsoleEvent.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Event; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Contracts\EventDispatcher\Event; - -/** - * Allows to inspect input and output of a command. - * - * @author Francesco Levorato - */ -class ConsoleEvent extends Event -{ - protected $command; - - private InputInterface $input; - private OutputInterface $output; - - public function __construct(?Command $command, InputInterface $input, OutputInterface $output) - { - $this->command = $command; - $this->input = $input; - $this->output = $output; - } - - /** - * Gets the command that is executed. - */ - public function getCommand(): ?Command - { - return $this->command; - } - - /** - * Gets the input instance. - */ - public function getInput(): InputInterface - { - return $this->input; - } - - /** - * Gets the output instance. - */ - public function getOutput(): OutputInterface - { - return $this->output; - } -} diff --git a/vendor/symfony/console/Event/ConsoleSignalEvent.php b/vendor/symfony/console/Event/ConsoleSignalEvent.php deleted file mode 100644 index 766af691..00000000 --- a/vendor/symfony/console/Event/ConsoleSignalEvent.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Event; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author marie - */ -final class ConsoleSignalEvent extends ConsoleEvent -{ - private int $handlingSignal; - - public function __construct(Command $command, InputInterface $input, OutputInterface $output, int $handlingSignal) - { - parent::__construct($command, $input, $output); - $this->handlingSignal = $handlingSignal; - } - - public function getHandlingSignal(): int - { - return $this->handlingSignal; - } -} diff --git a/vendor/symfony/console/Event/ConsoleTerminateEvent.php b/vendor/symfony/console/Event/ConsoleTerminateEvent.php deleted file mode 100644 index de63c8ff..00000000 --- a/vendor/symfony/console/Event/ConsoleTerminateEvent.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\Console\Event; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Allows to manipulate the exit code of a command after its execution. - * - * @author Francesco Levorato - */ -final class ConsoleTerminateEvent extends ConsoleEvent -{ - private int $exitCode; - - public function __construct(Command $command, InputInterface $input, OutputInterface $output, int $exitCode) - { - parent::__construct($command, $input, $output); - - $this->setExitCode($exitCode); - } - - public function setExitCode(int $exitCode): void - { - $this->exitCode = $exitCode; - } - - public function getExitCode(): int - { - return $this->exitCode; - } -} diff --git a/vendor/symfony/console/EventListener/ErrorListener.php b/vendor/symfony/console/EventListener/ErrorListener.php deleted file mode 100644 index 773a13a1..00000000 --- a/vendor/symfony/console/EventListener/ErrorListener.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\Console\EventListener; - -use Psr\Log\LoggerInterface; -use Symfony\Component\Console\ConsoleEvents; -use Symfony\Component\Console\Event\ConsoleErrorEvent; -use Symfony\Component\Console\Event\ConsoleEvent; -use Symfony\Component\Console\Event\ConsoleTerminateEvent; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; - -/** - * @author James Halsall - * @author Robin Chalas - */ -class ErrorListener implements EventSubscriberInterface -{ - private ?LoggerInterface $logger; - - public function __construct(LoggerInterface $logger = null) - { - $this->logger = $logger; - } - - public function onConsoleError(ConsoleErrorEvent $event) - { - if (null === $this->logger) { - return; - } - - $error = $event->getError(); - - if (!$inputString = $this->getInputString($event)) { - $this->logger->critical('An error occurred while using the console. Message: "{message}"', ['exception' => $error, 'message' => $error->getMessage()]); - - return; - } - - $this->logger->critical('Error thrown while running command "{command}". Message: "{message}"', ['exception' => $error, 'command' => $inputString, 'message' => $error->getMessage()]); - } - - public function onConsoleTerminate(ConsoleTerminateEvent $event) - { - if (null === $this->logger) { - return; - } - - $exitCode = $event->getExitCode(); - - if (0 === $exitCode) { - return; - } - - if (!$inputString = $this->getInputString($event)) { - $this->logger->debug('The console exited with code "{code}"', ['code' => $exitCode]); - - return; - } - - $this->logger->debug('Command "{command}" exited with code "{code}"', ['command' => $inputString, 'code' => $exitCode]); - } - - public static function getSubscribedEvents(): array - { - return [ - ConsoleEvents::ERROR => ['onConsoleError', -128], - ConsoleEvents::TERMINATE => ['onConsoleTerminate', -128], - ]; - } - - private static function getInputString(ConsoleEvent $event): ?string - { - $commandName = $event->getCommand()?->getName(); - $input = $event->getInput(); - - if ($input instanceof \Stringable) { - if ($commandName) { - return str_replace(["'$commandName'", "\"$commandName\""], $commandName, (string) $input); - } - - return (string) $input; - } - - return $commandName; - } -} diff --git a/vendor/symfony/console/Exception/CommandNotFoundException.php b/vendor/symfony/console/Exception/CommandNotFoundException.php deleted file mode 100644 index 1e9f1c79..00000000 --- a/vendor/symfony/console/Exception/CommandNotFoundException.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\Console\Exception; - -/** - * Represents an incorrect command name typed in the console. - * - * @author Jérôme Tamarelle - */ -class CommandNotFoundException extends \InvalidArgumentException implements ExceptionInterface -{ - private array $alternatives; - - /** - * @param string $message Exception message to throw - * @param string[] $alternatives List of similar defined names - * @param int $code Exception code - * @param \Throwable|null $previous Previous exception used for the exception chaining - */ - public function __construct(string $message, array $alternatives = [], int $code = 0, \Throwable $previous = null) - { - parent::__construct($message, $code, $previous); - - $this->alternatives = $alternatives; - } - - /** - * @return string[] - */ - public function getAlternatives(): array - { - return $this->alternatives; - } -} diff --git a/vendor/symfony/console/Exception/ExceptionInterface.php b/vendor/symfony/console/Exception/ExceptionInterface.php deleted file mode 100644 index 1624e13d..00000000 --- a/vendor/symfony/console/Exception/ExceptionInterface.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * ExceptionInterface. - * - * @author Jérôme Tamarelle - */ -interface ExceptionInterface extends \Throwable -{ -} diff --git a/vendor/symfony/console/Exception/InvalidArgumentException.php b/vendor/symfony/console/Exception/InvalidArgumentException.php deleted file mode 100644 index 07cc0b61..00000000 --- a/vendor/symfony/console/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * @author Jérôme Tamarelle - */ -class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/console/Exception/InvalidOptionException.php b/vendor/symfony/console/Exception/InvalidOptionException.php deleted file mode 100644 index 5cf62792..00000000 --- a/vendor/symfony/console/Exception/InvalidOptionException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * Represents an incorrect option name or value typed in the console. - * - * @author Jérôme Tamarelle - */ -class InvalidOptionException extends \InvalidArgumentException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/console/Exception/LogicException.php b/vendor/symfony/console/Exception/LogicException.php deleted file mode 100644 index fc37b8d8..00000000 --- a/vendor/symfony/console/Exception/LogicException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * @author Jérôme Tamarelle - */ -class LogicException extends \LogicException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/console/Exception/MissingInputException.php b/vendor/symfony/console/Exception/MissingInputException.php deleted file mode 100644 index 04f02ade..00000000 --- a/vendor/symfony/console/Exception/MissingInputException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * Represents failure to read input from stdin. - * - * @author Gabriel Ostrolucký - */ -class MissingInputException extends RuntimeException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/console/Exception/NamespaceNotFoundException.php b/vendor/symfony/console/Exception/NamespaceNotFoundException.php deleted file mode 100644 index dd16e450..00000000 --- a/vendor/symfony/console/Exception/NamespaceNotFoundException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * Represents an incorrect namespace typed in the console. - * - * @author Pierre du Plessis - */ -class NamespaceNotFoundException extends CommandNotFoundException -{ -} diff --git a/vendor/symfony/console/Exception/RuntimeException.php b/vendor/symfony/console/Exception/RuntimeException.php deleted file mode 100644 index 51d7d80a..00000000 --- a/vendor/symfony/console/Exception/RuntimeException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * @author Jérôme Tamarelle - */ -class RuntimeException extends \RuntimeException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/console/Formatter/NullOutputFormatter.php b/vendor/symfony/console/Formatter/NullOutputFormatter.php deleted file mode 100644 index 5c11c764..00000000 --- a/vendor/symfony/console/Formatter/NullOutputFormatter.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\Console\Formatter; - -/** - * @author Tien Xuan Vo - */ -final class NullOutputFormatter implements OutputFormatterInterface -{ - private NullOutputFormatterStyle $style; - - public function format(?string $message): ?string - { - return null; - } - - public function getStyle(string $name): OutputFormatterStyleInterface - { - // to comply with the interface we must return a OutputFormatterStyleInterface - return $this->style ??= new NullOutputFormatterStyle(); - } - - public function hasStyle(string $name): bool - { - return false; - } - - public function isDecorated(): bool - { - return false; - } - - public function setDecorated(bool $decorated): void - { - // do nothing - } - - public function setStyle(string $name, OutputFormatterStyleInterface $style): void - { - // do nothing - } -} diff --git a/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php b/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php deleted file mode 100644 index c2ce7d14..00000000 --- a/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -/** - * @author Tien Xuan Vo - */ -final class NullOutputFormatterStyle implements OutputFormatterStyleInterface -{ - public function apply(string $text): string - { - return $text; - } - - public function setBackground(string $color = null): void - { - if (1 > \func_num_args()) { - trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); - } - // do nothing - } - - public function setForeground(string $color = null): void - { - if (1 > \func_num_args()) { - trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); - } - // do nothing - } - - public function setOption(string $option): void - { - // do nothing - } - - public function setOptions(array $options): void - { - // do nothing - } - - public function unsetOption(string $option): void - { - // do nothing - } -} diff --git a/vendor/symfony/console/Formatter/OutputFormatter.php b/vendor/symfony/console/Formatter/OutputFormatter.php deleted file mode 100644 index 38e75c31..00000000 --- a/vendor/symfony/console/Formatter/OutputFormatter.php +++ /dev/null @@ -1,259 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -use Symfony\Component\Console\Exception\InvalidArgumentException; - -/** - * Formatter class for console output. - * - * @author Konstantin Kudryashov - * @author Roland Franssen - */ -class OutputFormatter implements WrappableOutputFormatterInterface -{ - private bool $decorated; - private array $styles = []; - private OutputFormatterStyleStack $styleStack; - - public function __clone() - { - $this->styleStack = clone $this->styleStack; - foreach ($this->styles as $key => $value) { - $this->styles[$key] = clone $value; - } - } - - /** - * Escapes "<" and ">" special chars in given text. - */ - public static function escape(string $text): string - { - $text = preg_replace('/([^\\\\]|^)([<>])/', '$1\\\\$2', $text); - - return self::escapeTrailingBackslash($text); - } - - /** - * Escapes trailing "\" in given text. - * - * @internal - */ - public static function escapeTrailingBackslash(string $text): string - { - if (str_ends_with($text, '\\')) { - $len = \strlen($text); - $text = rtrim($text, '\\'); - $text = str_replace("\0", '', $text); - $text .= str_repeat("\0", $len - \strlen($text)); - } - - return $text; - } - - /** - * Initializes console output formatter. - * - * @param OutputFormatterStyleInterface[] $styles Array of "name => FormatterStyle" instances - */ - public function __construct(bool $decorated = false, array $styles = []) - { - $this->decorated = $decorated; - - $this->setStyle('error', new OutputFormatterStyle('white', 'red')); - $this->setStyle('info', new OutputFormatterStyle('green')); - $this->setStyle('comment', new OutputFormatterStyle('yellow')); - $this->setStyle('question', new OutputFormatterStyle('black', 'cyan')); - - foreach ($styles as $name => $style) { - $this->setStyle($name, $style); - } - - $this->styleStack = new OutputFormatterStyleStack(); - } - - public function setDecorated(bool $decorated) - { - $this->decorated = $decorated; - } - - public function isDecorated(): bool - { - return $this->decorated; - } - - public function setStyle(string $name, OutputFormatterStyleInterface $style) - { - $this->styles[strtolower($name)] = $style; - } - - public function hasStyle(string $name): bool - { - return isset($this->styles[strtolower($name)]); - } - - public function getStyle(string $name): OutputFormatterStyleInterface - { - if (!$this->hasStyle($name)) { - throw new InvalidArgumentException(sprintf('Undefined style: "%s".', $name)); - } - - return $this->styles[strtolower($name)]; - } - - public function format(?string $message): ?string - { - return $this->formatAndWrap($message, 0); - } - - public function formatAndWrap(?string $message, int $width) - { - if (null === $message) { - return ''; - } - - $offset = 0; - $output = ''; - $openTagRegex = '[a-z](?:[^\\\\<>]*+ | \\\\.)*'; - $closeTagRegex = '[a-z][^<>]*+'; - $currentLineLength = 0; - preg_match_all("#<(($openTagRegex) | /($closeTagRegex)?)>#ix", $message, $matches, \PREG_OFFSET_CAPTURE); - foreach ($matches[0] as $i => $match) { - $pos = $match[1]; - $text = $match[0]; - - if (0 != $pos && '\\' == $message[$pos - 1]) { - continue; - } - - // add the text up to the next tag - $output .= $this->applyCurrentStyle(substr($message, $offset, $pos - $offset), $output, $width, $currentLineLength); - $offset = $pos + \strlen($text); - - // opening tag? - if ($open = '/' !== $text[1]) { - $tag = $matches[1][$i][0]; - } else { - $tag = $matches[3][$i][0] ?? ''; - } - - if (!$open && !$tag) { - // - $this->styleStack->pop(); - } elseif (null === $style = $this->createStyleFromString($tag)) { - $output .= $this->applyCurrentStyle($text, $output, $width, $currentLineLength); - } elseif ($open) { - $this->styleStack->push($style); - } else { - $this->styleStack->pop($style); - } - } - - $output .= $this->applyCurrentStyle(substr($message, $offset), $output, $width, $currentLineLength); - - return strtr($output, ["\0" => '\\', '\\<' => '<', '\\>' => '>']); - } - - public function getStyleStack(): OutputFormatterStyleStack - { - return $this->styleStack; - } - - /** - * Tries to create new style instance from string. - */ - private function createStyleFromString(string $string): ?OutputFormatterStyleInterface - { - if (isset($this->styles[$string])) { - return $this->styles[$string]; - } - - if (!preg_match_all('/([^=]+)=([^;]+)(;|$)/', $string, $matches, \PREG_SET_ORDER)) { - return null; - } - - $style = new OutputFormatterStyle(); - foreach ($matches as $match) { - array_shift($match); - $match[0] = strtolower($match[0]); - - if ('fg' == $match[0]) { - $style->setForeground(strtolower($match[1])); - } elseif ('bg' == $match[0]) { - $style->setBackground(strtolower($match[1])); - } elseif ('href' === $match[0]) { - $url = preg_replace('{\\\\([<>])}', '$1', $match[1]); - $style->setHref($url); - } elseif ('options' === $match[0]) { - preg_match_all('([^,;]+)', strtolower($match[1]), $options); - $options = array_shift($options); - foreach ($options as $option) { - $style->setOption($option); - } - } else { - return null; - } - } - - return $style; - } - - /** - * Applies current style from stack to text, if must be applied. - */ - private function applyCurrentStyle(string $text, string $current, int $width, int &$currentLineLength): string - { - if ('' === $text) { - return ''; - } - - if (!$width) { - return $this->isDecorated() ? $this->styleStack->getCurrent()->apply($text) : $text; - } - - if (!$currentLineLength && '' !== $current) { - $text = ltrim($text); - } - - if ($currentLineLength) { - $prefix = substr($text, 0, $i = $width - $currentLineLength)."\n"; - $text = substr($text, $i); - } else { - $prefix = ''; - } - - preg_match('~(\\n)$~', $text, $matches); - $text = $prefix.preg_replace('~([^\\n]{'.$width.'})\\ *~', "\$1\n", $text); - $text = rtrim($text, "\n").($matches[1] ?? ''); - - if (!$currentLineLength && '' !== $current && !str_ends_with($current, "\n")) { - $text = "\n".$text; - } - - $lines = explode("\n", $text); - - foreach ($lines as $line) { - $currentLineLength += \strlen($line); - if ($width <= $currentLineLength) { - $currentLineLength = 0; - } - } - - if ($this->isDecorated()) { - foreach ($lines as $i => $line) { - $lines[$i] = $this->styleStack->getCurrent()->apply($line); - } - } - - return implode("\n", $lines); - } -} diff --git a/vendor/symfony/console/Formatter/OutputFormatterInterface.php b/vendor/symfony/console/Formatter/OutputFormatterInterface.php deleted file mode 100644 index b94e51de..00000000 --- a/vendor/symfony/console/Formatter/OutputFormatterInterface.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -/** - * Formatter interface for console output. - * - * @author Konstantin Kudryashov - */ -interface OutputFormatterInterface -{ - /** - * Sets the decorated flag. - */ - public function setDecorated(bool $decorated); - - /** - * Whether the output will decorate messages. - */ - public function isDecorated(): bool; - - /** - * Sets a new style. - */ - public function setStyle(string $name, OutputFormatterStyleInterface $style); - - /** - * Checks if output formatter has style with specified name. - */ - public function hasStyle(string $name): bool; - - /** - * Gets style options from style with specified name. - * - * @throws \InvalidArgumentException When style isn't defined - */ - public function getStyle(string $name): OutputFormatterStyleInterface; - - /** - * Formats a message according to the given styles. - */ - public function format(?string $message): ?string; -} diff --git a/vendor/symfony/console/Formatter/OutputFormatterStyle.php b/vendor/symfony/console/Formatter/OutputFormatterStyle.php deleted file mode 100644 index 1659986e..00000000 --- a/vendor/symfony/console/Formatter/OutputFormatterStyle.php +++ /dev/null @@ -1,94 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -use Symfony\Component\Console\Color; - -/** - * Formatter style class for defining styles. - * - * @author Konstantin Kudryashov - */ -class OutputFormatterStyle implements OutputFormatterStyleInterface -{ - private Color $color; - private string $foreground; - private string $background; - private array $options; - private ?string $href = null; - private bool $handlesHrefGracefully; - - /** - * Initializes output formatter style. - * - * @param string|null $foreground The style foreground color name - * @param string|null $background The style background color name - */ - public function __construct(string $foreground = null, string $background = null, array $options = []) - { - $this->color = new Color($this->foreground = $foreground ?: '', $this->background = $background ?: '', $this->options = $options); - } - - public function setForeground(string $color = null) - { - if (1 > \func_num_args()) { - trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); - } - $this->color = new Color($this->foreground = $color ?: '', $this->background, $this->options); - } - - public function setBackground(string $color = null) - { - if (1 > \func_num_args()) { - trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); - } - $this->color = new Color($this->foreground, $this->background = $color ?: '', $this->options); - } - - public function setHref(string $url): void - { - $this->href = $url; - } - - public function setOption(string $option) - { - $this->options[] = $option; - $this->color = new Color($this->foreground, $this->background, $this->options); - } - - public function unsetOption(string $option) - { - $pos = array_search($option, $this->options); - if (false !== $pos) { - unset($this->options[$pos]); - } - - $this->color = new Color($this->foreground, $this->background, $this->options); - } - - public function setOptions(array $options) - { - $this->color = new Color($this->foreground, $this->background, $this->options = $options); - } - - public function apply(string $text): string - { - $this->handlesHrefGracefully ??= 'JetBrains-JediTerm' !== getenv('TERMINAL_EMULATOR') - && (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100); - - if (null !== $this->href && $this->handlesHrefGracefully) { - $text = "\033]8;;$this->href\033\\$text\033]8;;\033\\"; - } - - return $this->color->apply($text); - } -} diff --git a/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php b/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php deleted file mode 100644 index 7ed67d9a..00000000 --- a/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -/** - * Formatter style interface for defining styles. - * - * @author Konstantin Kudryashov - */ -interface OutputFormatterStyleInterface -{ - /** - * Sets style foreground color. - */ - public function setForeground(?string $color); - - /** - * Sets style background color. - */ - public function setBackground(?string $color); - - /** - * Sets some specific style option. - */ - public function setOption(string $option); - - /** - * Unsets some specific style option. - */ - public function unsetOption(string $option); - - /** - * Sets multiple style options at once. - */ - public function setOptions(array $options); - - /** - * Applies the style to a given text. - */ - public function apply(string $text): string; -} diff --git a/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php b/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php deleted file mode 100644 index 2c5cdf9b..00000000 --- a/vendor/symfony/console/Formatter/OutputFormatterStyleStack.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\Component\Console\Formatter; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Contracts\Service\ResetInterface; - -/** - * @author Jean-François Simon - */ -class OutputFormatterStyleStack implements ResetInterface -{ - /** - * @var OutputFormatterStyleInterface[] - */ - private array $styles = []; - - private OutputFormatterStyleInterface $emptyStyle; - - public function __construct(OutputFormatterStyleInterface $emptyStyle = null) - { - $this->emptyStyle = $emptyStyle ?? new OutputFormatterStyle(); - $this->reset(); - } - - /** - * Resets stack (ie. empty internal arrays). - */ - public function reset() - { - $this->styles = []; - } - - /** - * Pushes a style in the stack. - */ - public function push(OutputFormatterStyleInterface $style) - { - $this->styles[] = $style; - } - - /** - * Pops a style from the stack. - * - * @throws InvalidArgumentException When style tags incorrectly nested - */ - public function pop(OutputFormatterStyleInterface $style = null): OutputFormatterStyleInterface - { - if (!$this->styles) { - return $this->emptyStyle; - } - - if (null === $style) { - return array_pop($this->styles); - } - - foreach (array_reverse($this->styles, true) as $index => $stackedStyle) { - if ($style->apply('') === $stackedStyle->apply('')) { - $this->styles = \array_slice($this->styles, 0, $index); - - return $stackedStyle; - } - } - - throw new InvalidArgumentException('Incorrectly nested style tag found.'); - } - - /** - * Computes current style with stacks top codes. - */ - public function getCurrent(): OutputFormatterStyleInterface - { - if (!$this->styles) { - return $this->emptyStyle; - } - - return $this->styles[\count($this->styles) - 1]; - } - - /** - * @return $this - */ - public function setEmptyStyle(OutputFormatterStyleInterface $emptyStyle): static - { - $this->emptyStyle = $emptyStyle; - - return $this; - } - - public function getEmptyStyle(): OutputFormatterStyleInterface - { - return $this->emptyStyle; - } -} diff --git a/vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.php b/vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.php deleted file mode 100644 index 746cd27e..00000000 --- a/vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.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\Console\Formatter; - -/** - * Formatter interface for console output that supports word wrapping. - * - * @author Roland Franssen - */ -interface WrappableOutputFormatterInterface extends OutputFormatterInterface -{ - /** - * Formats a message according to the given styles, wrapping at `$width` (0 means no wrapping). - * - * @return string - */ - public function formatAndWrap(?string $message, int $width); -} diff --git a/vendor/symfony/console/Helper/DebugFormatterHelper.php b/vendor/symfony/console/Helper/DebugFormatterHelper.php deleted file mode 100644 index 9ea7fb91..00000000 --- a/vendor/symfony/console/Helper/DebugFormatterHelper.php +++ /dev/null @@ -1,98 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -/** - * Helps outputting debug information when running an external program from a command. - * - * An external program can be a Process, an HTTP request, or anything else. - * - * @author Fabien Potencier - */ -class DebugFormatterHelper extends Helper -{ - private const COLORS = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white', 'default']; - private array $started = []; - private int $count = -1; - - /** - * Starts a debug formatting session. - */ - public function start(string $id, string $message, string $prefix = 'RUN'): string - { - $this->started[$id] = ['border' => ++$this->count % \count(self::COLORS)]; - - return sprintf("%s %s %s\n", $this->getBorder($id), $prefix, $message); - } - - /** - * Adds progress to a formatting session. - */ - public function progress(string $id, string $buffer, bool $error = false, string $prefix = 'OUT', string $errorPrefix = 'ERR'): string - { - $message = ''; - - if ($error) { - if (isset($this->started[$id]['out'])) { - $message .= "\n"; - unset($this->started[$id]['out']); - } - if (!isset($this->started[$id]['err'])) { - $message .= sprintf('%s %s ', $this->getBorder($id), $errorPrefix); - $this->started[$id]['err'] = true; - } - - $message .= str_replace("\n", sprintf("\n%s %s ", $this->getBorder($id), $errorPrefix), $buffer); - } else { - if (isset($this->started[$id]['err'])) { - $message .= "\n"; - unset($this->started[$id]['err']); - } - if (!isset($this->started[$id]['out'])) { - $message .= sprintf('%s %s ', $this->getBorder($id), $prefix); - $this->started[$id]['out'] = true; - } - - $message .= str_replace("\n", sprintf("\n%s %s ", $this->getBorder($id), $prefix), $buffer); - } - - return $message; - } - - /** - * Stops a formatting session. - */ - public function stop(string $id, string $message, bool $successful, string $prefix = 'RES'): string - { - $trailingEOL = isset($this->started[$id]['out']) || isset($this->started[$id]['err']) ? "\n" : ''; - - if ($successful) { - return sprintf("%s%s %s %s\n", $trailingEOL, $this->getBorder($id), $prefix, $message); - } - - $message = sprintf("%s%s %s %s\n", $trailingEOL, $this->getBorder($id), $prefix, $message); - - unset($this->started[$id]['out'], $this->started[$id]['err']); - - return $message; - } - - private function getBorder(string $id): string - { - return sprintf(' ', self::COLORS[$this->started[$id]['border']]); - } - - public function getName(): string - { - return 'debug_formatter'; - } -} diff --git a/vendor/symfony/console/Helper/DescriptorHelper.php b/vendor/symfony/console/Helper/DescriptorHelper.php deleted file mode 100644 index 3015ff08..00000000 --- a/vendor/symfony/console/Helper/DescriptorHelper.php +++ /dev/null @@ -1,89 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Descriptor\DescriptorInterface; -use Symfony\Component\Console\Descriptor\JsonDescriptor; -use Symfony\Component\Console\Descriptor\MarkdownDescriptor; -use Symfony\Component\Console\Descriptor\TextDescriptor; -use Symfony\Component\Console\Descriptor\XmlDescriptor; -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * This class adds helper method to describe objects in various formats. - * - * @author Jean-François Simon - */ -class DescriptorHelper extends Helper -{ - /** - * @var DescriptorInterface[] - */ - private array $descriptors = []; - - public function __construct() - { - $this - ->register('txt', new TextDescriptor()) - ->register('xml', new XmlDescriptor()) - ->register('json', new JsonDescriptor()) - ->register('md', new MarkdownDescriptor()) - ; - } - - /** - * Describes an object if supported. - * - * Available options are: - * * format: string, the output format name - * * raw_text: boolean, sets output type as raw - * - * @throws InvalidArgumentException when the given format is not supported - */ - public function describe(OutputInterface $output, ?object $object, array $options = []) - { - $options = array_merge([ - 'raw_text' => false, - 'format' => 'txt', - ], $options); - - if (!isset($this->descriptors[$options['format']])) { - throw new InvalidArgumentException(sprintf('Unsupported format "%s".', $options['format'])); - } - - $descriptor = $this->descriptors[$options['format']]; - $descriptor->describe($output, $object, $options); - } - - /** - * Registers a descriptor. - * - * @return $this - */ - public function register(string $format, DescriptorInterface $descriptor): static - { - $this->descriptors[$format] = $descriptor; - - return $this; - } - - public function getName(): string - { - return 'descriptor'; - } - - public function getFormats(): array - { - return array_keys($this->descriptors); - } -} diff --git a/vendor/symfony/console/Helper/Dumper.php b/vendor/symfony/console/Helper/Dumper.php deleted file mode 100644 index ac7571ce..00000000 --- a/vendor/symfony/console/Helper/Dumper.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\VarDumper\Cloner\ClonerInterface; -use Symfony\Component\VarDumper\Cloner\VarCloner; -use Symfony\Component\VarDumper\Dumper\CliDumper; - -/** - * @author Roland Franssen - */ -final class Dumper -{ - private OutputInterface $output; - private ?CliDumper $dumper; - private ?ClonerInterface $cloner; - private \Closure $handler; - - public function __construct(OutputInterface $output, CliDumper $dumper = null, ClonerInterface $cloner = null) - { - $this->output = $output; - $this->dumper = $dumper; - $this->cloner = $cloner; - - if (class_exists(CliDumper::class)) { - $this->handler = function ($var): string { - $dumper = $this->dumper ??= new CliDumper(null, null, CliDumper::DUMP_LIGHT_ARRAY | CliDumper::DUMP_COMMA_SEPARATOR); - $dumper->setColors($this->output->isDecorated()); - - return rtrim($dumper->dump(($this->cloner ??= new VarCloner())->cloneVar($var)->withRefHandles(false), true)); - }; - } else { - $this->handler = function ($var): string { - return match (true) { - null === $var => 'null', - true === $var => 'true', - false === $var => 'false', - \is_string($var) => '"'.$var.'"', - default => rtrim(print_r($var, true)), - }; - }; - } - } - - public function __invoke(mixed $var): string - { - return ($this->handler)($var); - } -} diff --git a/vendor/symfony/console/Helper/FormatterHelper.php b/vendor/symfony/console/Helper/FormatterHelper.php deleted file mode 100644 index 279e4c79..00000000 --- a/vendor/symfony/console/Helper/FormatterHelper.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\Console\Helper; - -use Symfony\Component\Console\Formatter\OutputFormatter; - -/** - * The Formatter class provides helpers to format messages. - * - * @author Fabien Potencier - */ -class FormatterHelper extends Helper -{ - /** - * Formats a message within a section. - */ - public function formatSection(string $section, string $message, string $style = 'info'): string - { - return sprintf('<%s>[%s] %s', $style, $section, $style, $message); - } - - /** - * Formats a message as a block of text. - */ - public function formatBlock(string|array $messages, string $style, bool $large = false): string - { - if (!\is_array($messages)) { - $messages = [$messages]; - } - - $len = 0; - $lines = []; - foreach ($messages as $message) { - $message = OutputFormatter::escape($message); - $lines[] = sprintf($large ? ' %s ' : ' %s ', $message); - $len = max(self::width($message) + ($large ? 4 : 2), $len); - } - - $messages = $large ? [str_repeat(' ', $len)] : []; - for ($i = 0; isset($lines[$i]); ++$i) { - $messages[] = $lines[$i].str_repeat(' ', $len - self::width($lines[$i])); - } - if ($large) { - $messages[] = str_repeat(' ', $len); - } - - for ($i = 0; isset($messages[$i]); ++$i) { - $messages[$i] = sprintf('<%s>%s', $style, $messages[$i], $style); - } - - return implode("\n", $messages); - } - - /** - * Truncates a message to the given length. - */ - public function truncate(string $message, int $length, string $suffix = '...'): string - { - $computedLength = $length - self::width($suffix); - - if ($computedLength > self::width($message)) { - return $message; - } - - return self::substr($message, 0, $length).$suffix; - } - - public function getName(): string - { - return 'formatter'; - } -} diff --git a/vendor/symfony/console/Helper/Helper.php b/vendor/symfony/console/Helper/Helper.php deleted file mode 100644 index 920196e0..00000000 --- a/vendor/symfony/console/Helper/Helper.php +++ /dev/null @@ -1,151 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Formatter\OutputFormatterInterface; -use Symfony\Component\String\UnicodeString; - -/** - * Helper is the base class for all helper classes. - * - * @author Fabien Potencier - */ -abstract class Helper implements HelperInterface -{ - protected $helperSet = null; - - public function setHelperSet(HelperSet $helperSet = null) - { - if (1 > \func_num_args()) { - trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); - } - $this->helperSet = $helperSet; - } - - public function getHelperSet(): ?HelperSet - { - return $this->helperSet; - } - - /** - * Returns the width of a string, using mb_strwidth if it is available. - * The width is how many characters positions the string will use. - */ - public static function width(?string $string): int - { - $string ??= ''; - - if (preg_match('//u', $string)) { - return (new UnicodeString($string))->width(false); - } - - if (false === $encoding = mb_detect_encoding($string, null, true)) { - return \strlen($string); - } - - return mb_strwidth($string, $encoding); - } - - /** - * Returns the length of a string, using mb_strlen if it is available. - * The length is related to how many bytes the string will use. - */ - public static function length(?string $string): int - { - $string ??= ''; - - if (preg_match('//u', $string)) { - return (new UnicodeString($string))->length(); - } - - if (false === $encoding = mb_detect_encoding($string, null, true)) { - return \strlen($string); - } - - return mb_strlen($string, $encoding); - } - - /** - * Returns the subset of a string, using mb_substr if it is available. - */ - public static function substr(?string $string, int $from, int $length = null): string - { - $string ??= ''; - - if (false === $encoding = mb_detect_encoding($string, null, true)) { - return substr($string, $from, $length); - } - - return mb_substr($string, $from, $length, $encoding); - } - - public static function formatTime(int|float $secs) - { - static $timeFormats = [ - [0, '< 1 sec'], - [1, '1 sec'], - [2, 'secs', 1], - [60, '1 min'], - [120, 'mins', 60], - [3600, '1 hr'], - [7200, 'hrs', 3600], - [86400, '1 day'], - [172800, 'days', 86400], - ]; - - foreach ($timeFormats as $index => $format) { - if ($secs >= $format[0]) { - if ((isset($timeFormats[$index + 1]) && $secs < $timeFormats[$index + 1][0]) - || $index == \count($timeFormats) - 1 - ) { - if (2 == \count($format)) { - return $format[1]; - } - - return floor($secs / $format[2]).' '.$format[1]; - } - } - } - } - - public static function formatMemory(int $memory) - { - if ($memory >= 1024 * 1024 * 1024) { - return sprintf('%.1f GiB', $memory / 1024 / 1024 / 1024); - } - - if ($memory >= 1024 * 1024) { - return sprintf('%.1f MiB', $memory / 1024 / 1024); - } - - if ($memory >= 1024) { - return sprintf('%d KiB', $memory / 1024); - } - - return sprintf('%d B', $memory); - } - - public static function removeDecoration(OutputFormatterInterface $formatter, ?string $string) - { - $isDecorated = $formatter->isDecorated(); - $formatter->setDecorated(false); - // remove <...> formatting - $string = $formatter->format($string ?? ''); - // remove already formatted characters - $string = preg_replace("/\033\[[^m]*m/", '', $string ?? ''); - // remove terminal hyperlinks - $string = preg_replace('/\\033]8;[^;]*;[^\\033]*\\033\\\\/', '', $string ?? ''); - $formatter->setDecorated($isDecorated); - - return $string; - } -} diff --git a/vendor/symfony/console/Helper/HelperInterface.php b/vendor/symfony/console/Helper/HelperInterface.php deleted file mode 100644 index 2762cdf0..00000000 --- a/vendor/symfony/console/Helper/HelperInterface.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\Console\Helper; - -/** - * HelperInterface is the interface all helpers must implement. - * - * @author Fabien Potencier - */ -interface HelperInterface -{ - /** - * Sets the helper set associated with this helper. - */ - public function setHelperSet(?HelperSet $helperSet); - - /** - * Gets the helper set associated with this helper. - */ - public function getHelperSet(): ?HelperSet; - - /** - * Returns the canonical name of this helper. - * - * @return string - */ - public function getName(); -} diff --git a/vendor/symfony/console/Helper/HelperSet.php b/vendor/symfony/console/Helper/HelperSet.php deleted file mode 100644 index cefe62be..00000000 --- a/vendor/symfony/console/Helper/HelperSet.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Exception\InvalidArgumentException; - -/** - * HelperSet represents a set of helpers to be used with a command. - * - * @author Fabien Potencier - * - * @implements \IteratorAggregate - */ -class HelperSet implements \IteratorAggregate -{ - /** @var array */ - private array $helpers = []; - - /** - * @param HelperInterface[] $helpers - */ - public function __construct(array $helpers = []) - { - foreach ($helpers as $alias => $helper) { - $this->set($helper, \is_int($alias) ? null : $alias); - } - } - - public function set(HelperInterface $helper, string $alias = null) - { - $this->helpers[$helper->getName()] = $helper; - if (null !== $alias) { - $this->helpers[$alias] = $helper; - } - - $helper->setHelperSet($this); - } - - /** - * Returns true if the helper if defined. - */ - public function has(string $name): bool - { - return isset($this->helpers[$name]); - } - - /** - * Gets a helper value. - * - * @throws InvalidArgumentException if the helper is not defined - */ - public function get(string $name): HelperInterface - { - if (!$this->has($name)) { - throw new InvalidArgumentException(sprintf('The helper "%s" is not defined.', $name)); - } - - return $this->helpers[$name]; - } - - public function getIterator(): \Traversable - { - return new \ArrayIterator($this->helpers); - } -} diff --git a/vendor/symfony/console/Helper/InputAwareHelper.php b/vendor/symfony/console/Helper/InputAwareHelper.php deleted file mode 100644 index ba81e377..00000000 --- a/vendor/symfony/console/Helper/InputAwareHelper.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\Console\Helper; - -use Symfony\Component\Console\Input\InputAwareInterface; -use Symfony\Component\Console\Input\InputInterface; - -/** - * An implementation of InputAwareInterface for Helpers. - * - * @author Wouter J - */ -abstract class InputAwareHelper extends Helper implements InputAwareInterface -{ - protected $input; - - public function setInput(InputInterface $input) - { - $this->input = $input; - } -} diff --git a/vendor/symfony/console/Helper/OutputWrapper.php b/vendor/symfony/console/Helper/OutputWrapper.php deleted file mode 100644 index 2ec819c7..00000000 --- a/vendor/symfony/console/Helper/OutputWrapper.php +++ /dev/null @@ -1,76 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -/** - * Simple output wrapper for "tagged outputs" instead of wordwrap(). This solution is based on a StackOverflow - * answer: https://stackoverflow.com/a/20434776/1476819 from user557597 (alias SLN). - * - * (?: - * # -- Words/Characters - * ( # (1 start) - * (?> # Atomic Group - Match words with valid breaks - * .{1,16} # 1-N characters - * # Followed by one of 4 prioritized, non-linebreak whitespace - * (?: # break types: - * (?<= [^\S\r\n] ) # 1. - Behind a non-linebreak whitespace - * [^\S\r\n]? # ( optionally accept an extra non-linebreak whitespace ) - * | (?= \r? \n ) # 2. - Ahead a linebreak - * | $ # 3. - EOS - * | [^\S\r\n] # 4. - Accept an extra non-linebreak whitespace - * ) - * ) # End atomic group - * | - * .{1,16} # No valid word breaks, just break on the N'th character - * ) # (1 end) - * (?: \r? \n )? # Optional linebreak after Words/Characters - * | - * # -- Or, Linebreak - * (?: \r? \n | $ ) # Stand alone linebreak or at EOS - * ) - * - * @author Krisztián Ferenczi - * - * @see https://stackoverflow.com/a/20434776/1476819 - */ -final class OutputWrapper -{ - private const TAG_OPEN_REGEX_SEGMENT = '[a-z](?:[^\\\\<>]*+ | \\\\.)*'; - private const TAG_CLOSE_REGEX_SEGMENT = '[a-z][^<>]*+'; - private const URL_PATTERN = 'https?://\S+'; - - public function __construct( - private bool $allowCutUrls = false - ) { - } - - public function wrap(string $text, int $width, string $break = "\n"): string - { - if (!$width) { - return $text; - } - - $tagPattern = sprintf('<(?:(?:%s)|/(?:%s)?)>', self::TAG_OPEN_REGEX_SEGMENT, self::TAG_CLOSE_REGEX_SEGMENT); - $limitPattern = "{1,$width}"; - $patternBlocks = [$tagPattern]; - if (!$this->allowCutUrls) { - $patternBlocks[] = self::URL_PATTERN; - } - $patternBlocks[] = '.'; - $blocks = implode('|', $patternBlocks); - $rowPattern = "(?:$blocks)$limitPattern"; - $pattern = sprintf('#(?:((?>(%1$s)((?<=[^\S\r\n])[^\S\r\n]?|(?=\r?\n)|$|[^\S\r\n]))|(%1$s))(?:\r?\n)?|(?:\r?\n|$))#imux', $rowPattern); - $output = rtrim(preg_replace($pattern, '\\1'.$break, $text), $break); - - return str_replace(' '.$break, $break, $output); - } -} diff --git a/vendor/symfony/console/Helper/ProcessHelper.php b/vendor/symfony/console/Helper/ProcessHelper.php deleted file mode 100644 index 26d35a1a..00000000 --- a/vendor/symfony/console/Helper/ProcessHelper.php +++ /dev/null @@ -1,137 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Process\Exception\ProcessFailedException; -use Symfony\Component\Process\Process; - -/** - * The ProcessHelper class provides helpers to run external processes. - * - * @author Fabien Potencier - * - * @final - */ -class ProcessHelper extends Helper -{ - /** - * Runs an external process. - * - * @param array|Process $cmd An instance of Process or an array of the command and arguments - * @param callable|null $callback A PHP callback to run whenever there is some - * output available on STDOUT or STDERR - */ - public function run(OutputInterface $output, array|Process $cmd, string $error = null, callable $callback = null, int $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE): Process - { - if (!class_exists(Process::class)) { - throw new \LogicException('The ProcessHelper cannot be run as the Process component is not installed. Try running "compose require symfony/process".'); - } - - if ($output instanceof ConsoleOutputInterface) { - $output = $output->getErrorOutput(); - } - - $formatter = $this->getHelperSet()->get('debug_formatter'); - - if ($cmd instanceof Process) { - $cmd = [$cmd]; - } - - if (\is_string($cmd[0] ?? null)) { - $process = new Process($cmd); - $cmd = []; - } elseif (($cmd[0] ?? null) instanceof Process) { - $process = $cmd[0]; - unset($cmd[0]); - } else { - throw new \InvalidArgumentException(sprintf('Invalid command provided to "%s()": the command should be an array whose first element is either the path to the binary to run or a "Process" object.', __METHOD__)); - } - - if ($verbosity <= $output->getVerbosity()) { - $output->write($formatter->start(spl_object_hash($process), $this->escapeString($process->getCommandLine()))); - } - - if ($output->isDebug()) { - $callback = $this->wrapCallback($output, $process, $callback); - } - - $process->run($callback, $cmd); - - if ($verbosity <= $output->getVerbosity()) { - $message = $process->isSuccessful() ? 'Command ran successfully' : sprintf('%s Command did not run successfully', $process->getExitCode()); - $output->write($formatter->stop(spl_object_hash($process), $message, $process->isSuccessful())); - } - - if (!$process->isSuccessful() && null !== $error) { - $output->writeln(sprintf('%s', $this->escapeString($error))); - } - - return $process; - } - - /** - * Runs the process. - * - * This is identical to run() except that an exception is thrown if the process - * exits with a non-zero exit code. - * - * @param array|Process $cmd An instance of Process or a command to run - * @param callable|null $callback A PHP callback to run whenever there is some - * output available on STDOUT or STDERR - * - * @throws ProcessFailedException - * - * @see run() - */ - public function mustRun(OutputInterface $output, array|Process $cmd, string $error = null, callable $callback = null): Process - { - $process = $this->run($output, $cmd, $error, $callback); - - if (!$process->isSuccessful()) { - throw new ProcessFailedException($process); - } - - return $process; - } - - /** - * Wraps a Process callback to add debugging output. - */ - public function wrapCallback(OutputInterface $output, Process $process, callable $callback = null): callable - { - if ($output instanceof ConsoleOutputInterface) { - $output = $output->getErrorOutput(); - } - - $formatter = $this->getHelperSet()->get('debug_formatter'); - - return function ($type, $buffer) use ($output, $process, $callback, $formatter) { - $output->write($formatter->progress(spl_object_hash($process), $this->escapeString($buffer), Process::ERR === $type)); - - if (null !== $callback) { - $callback($type, $buffer); - } - }; - } - - private function escapeString(string $str): string - { - return str_replace('<', '\\<', $str); - } - - public function getName(): string - { - return 'process'; - } -} diff --git a/vendor/symfony/console/Helper/ProgressBar.php b/vendor/symfony/console/Helper/ProgressBar.php deleted file mode 100644 index b65bba22..00000000 --- a/vendor/symfony/console/Helper/ProgressBar.php +++ /dev/null @@ -1,608 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Cursor; -use Symfony\Component\Console\Exception\LogicException; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\ConsoleSectionOutput; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Terminal; - -/** - * The ProgressBar provides helpers to display progress output. - * - * @author Fabien Potencier - * @author Chris Jones - */ -final class ProgressBar -{ - public const FORMAT_VERBOSE = 'verbose'; - public const FORMAT_VERY_VERBOSE = 'very_verbose'; - public const FORMAT_DEBUG = 'debug'; - public const FORMAT_NORMAL = 'normal'; - - private const FORMAT_VERBOSE_NOMAX = 'verbose_nomax'; - private const FORMAT_VERY_VERBOSE_NOMAX = 'very_verbose_nomax'; - private const FORMAT_DEBUG_NOMAX = 'debug_nomax'; - private const FORMAT_NORMAL_NOMAX = 'normal_nomax'; - - private int $barWidth = 28; - private string $barChar; - private string $emptyBarChar = '-'; - private string $progressChar = '>'; - private ?string $format = null; - private ?string $internalFormat = null; - private ?int $redrawFreq = 1; - private int $writeCount = 0; - private float $lastWriteTime = 0; - private float $minSecondsBetweenRedraws = 0; - private float $maxSecondsBetweenRedraws = 1; - private OutputInterface $output; - private int $step = 0; - private int $startingStep = 0; - private ?int $max = null; - private int $startTime; - private int $stepWidth; - private float $percent = 0.0; - private int $formatLineCount; - private array $messages = []; - private bool $overwrite = true; - private Terminal $terminal; - private ?string $previousMessage = null; - private Cursor $cursor; - - private static array $formatters; - private static array $formats; - - /** - * @param int $max Maximum steps (0 if unknown) - */ - public function __construct(OutputInterface $output, int $max = 0, float $minSecondsBetweenRedraws = 1 / 25) - { - if ($output instanceof ConsoleOutputInterface) { - $output = $output->getErrorOutput(); - } - - $this->output = $output; - $this->setMaxSteps($max); - $this->terminal = new Terminal(); - - if (0 < $minSecondsBetweenRedraws) { - $this->redrawFreq = null; - $this->minSecondsBetweenRedraws = $minSecondsBetweenRedraws; - } - - if (!$this->output->isDecorated()) { - // disable overwrite when output does not support ANSI codes. - $this->overwrite = false; - - // set a reasonable redraw frequency so output isn't flooded - $this->redrawFreq = null; - } - - $this->startTime = time(); - $this->cursor = new Cursor($output); - } - - /** - * Sets a placeholder formatter for a given name. - * - * This method also allow you to override an existing placeholder. - * - * @param string $name The placeholder name (including the delimiter char like %) - * @param callable $callable A PHP callable - */ - public static function setPlaceholderFormatterDefinition(string $name, callable $callable): void - { - self::$formatters ??= self::initPlaceholderFormatters(); - - self::$formatters[$name] = $callable; - } - - /** - * Gets the placeholder formatter for a given name. - * - * @param string $name The placeholder name (including the delimiter char like %) - */ - public static function getPlaceholderFormatterDefinition(string $name): ?callable - { - self::$formatters ??= self::initPlaceholderFormatters(); - - return self::$formatters[$name] ?? null; - } - - /** - * Sets a format for a given name. - * - * This method also allow you to override an existing format. - * - * @param string $name The format name - * @param string $format A format string - */ - public static function setFormatDefinition(string $name, string $format): void - { - self::$formats ??= self::initFormats(); - - self::$formats[$name] = $format; - } - - /** - * Gets the format for a given name. - * - * @param string $name The format name - */ - public static function getFormatDefinition(string $name): ?string - { - self::$formats ??= self::initFormats(); - - return self::$formats[$name] ?? null; - } - - /** - * Associates a text with a named placeholder. - * - * The text is displayed when the progress bar is rendered but only - * when the corresponding placeholder is part of the custom format line - * (by wrapping the name with %). - * - * @param string $message The text to associate with the placeholder - * @param string $name The name of the placeholder - */ - public function setMessage(string $message, string $name = 'message') - { - $this->messages[$name] = $message; - } - - public function getMessage(string $name = 'message') - { - return $this->messages[$name]; - } - - public function getStartTime(): int - { - return $this->startTime; - } - - public function getMaxSteps(): int - { - return $this->max; - } - - public function getProgress(): int - { - return $this->step; - } - - private function getStepWidth(): int - { - return $this->stepWidth; - } - - public function getProgressPercent(): float - { - return $this->percent; - } - - public function getBarOffset(): float - { - return floor($this->max ? $this->percent * $this->barWidth : (null === $this->redrawFreq ? (int) (min(5, $this->barWidth / 15) * $this->writeCount) : $this->step) % $this->barWidth); - } - - public function getEstimated(): float - { - if (0 === $this->step || $this->step === $this->startingStep) { - return 0; - } - - return round((time() - $this->startTime) / ($this->step - $this->startingStep) * $this->max); - } - - public function getRemaining(): float - { - if (!$this->step) { - return 0; - } - - return round((time() - $this->startTime) / ($this->step - $this->startingStep) * ($this->max - $this->step)); - } - - public function setBarWidth(int $size) - { - $this->barWidth = max(1, $size); - } - - public function getBarWidth(): int - { - return $this->barWidth; - } - - public function setBarCharacter(string $char) - { - $this->barChar = $char; - } - - public function getBarCharacter(): string - { - return $this->barChar ?? ($this->max ? '=' : $this->emptyBarChar); - } - - public function setEmptyBarCharacter(string $char) - { - $this->emptyBarChar = $char; - } - - public function getEmptyBarCharacter(): string - { - return $this->emptyBarChar; - } - - public function setProgressCharacter(string $char) - { - $this->progressChar = $char; - } - - public function getProgressCharacter(): string - { - return $this->progressChar; - } - - public function setFormat(string $format) - { - $this->format = null; - $this->internalFormat = $format; - } - - /** - * Sets the redraw frequency. - * - * @param int|null $freq The frequency in steps - */ - public function setRedrawFrequency(?int $freq) - { - $this->redrawFreq = null !== $freq ? max(1, $freq) : null; - } - - public function minSecondsBetweenRedraws(float $seconds): void - { - $this->minSecondsBetweenRedraws = $seconds; - } - - public function maxSecondsBetweenRedraws(float $seconds): void - { - $this->maxSecondsBetweenRedraws = $seconds; - } - - /** - * Returns an iterator that will automatically update the progress bar when iterated. - * - * @param int|null $max Number of steps to complete the bar (0 if indeterminate), if null it will be inferred from $iterable - */ - public function iterate(iterable $iterable, int $max = null): iterable - { - $this->start($max ?? (is_countable($iterable) ? \count($iterable) : 0)); - - foreach ($iterable as $key => $value) { - yield $key => $value; - - $this->advance(); - } - - $this->finish(); - } - - /** - * Starts the progress output. - * - * @param int|null $max Number of steps to complete the bar (0 if indeterminate), null to leave unchanged - * @param int $startAt The starting point of the bar (useful e.g. when resuming a previously started bar) - */ - public function start(int $max = null, int $startAt = 0): void - { - $this->startTime = time(); - $this->step = $startAt; - $this->startingStep = $startAt; - - $startAt > 0 ? $this->setProgress($startAt) : $this->percent = 0.0; - - if (null !== $max) { - $this->setMaxSteps($max); - } - - $this->display(); - } - - /** - * Advances the progress output X steps. - * - * @param int $step Number of steps to advance - */ - public function advance(int $step = 1) - { - $this->setProgress($this->step + $step); - } - - /** - * Sets whether to overwrite the progressbar, false for new line. - */ - public function setOverwrite(bool $overwrite) - { - $this->overwrite = $overwrite; - } - - public function setProgress(int $step) - { - if ($this->max && $step > $this->max) { - $this->max = $step; - } elseif ($step < 0) { - $step = 0; - } - - $redrawFreq = $this->redrawFreq ?? (($this->max ?: 10) / 10); - $prevPeriod = (int) ($this->step / $redrawFreq); - $currPeriod = (int) ($step / $redrawFreq); - $this->step = $step; - $this->percent = $this->max ? (float) $this->step / $this->max : 0; - $timeInterval = microtime(true) - $this->lastWriteTime; - - // Draw regardless of other limits - if ($this->max === $step) { - $this->display(); - - return; - } - - // Throttling - if ($timeInterval < $this->minSecondsBetweenRedraws) { - return; - } - - // Draw each step period, but not too late - if ($prevPeriod !== $currPeriod || $timeInterval >= $this->maxSecondsBetweenRedraws) { - $this->display(); - } - } - - public function setMaxSteps(int $max) - { - $this->format = null; - $this->max = max(0, $max); - $this->stepWidth = $this->max ? Helper::width((string) $this->max) : 4; - } - - /** - * Finishes the progress output. - */ - public function finish(): void - { - if (!$this->max) { - $this->max = $this->step; - } - - if ($this->step === $this->max && !$this->overwrite) { - // prevent double 100% output - return; - } - - $this->setProgress($this->max); - } - - /** - * Outputs the current progress string. - */ - public function display(): void - { - if (OutputInterface::VERBOSITY_QUIET === $this->output->getVerbosity()) { - return; - } - - if (null === $this->format) { - $this->setRealFormat($this->internalFormat ?: $this->determineBestFormat()); - } - - $this->overwrite($this->buildLine()); - } - - /** - * Removes the progress bar from the current line. - * - * This is useful if you wish to write some output - * while a progress bar is running. - * Call display() to show the progress bar again. - */ - public function clear(): void - { - if (!$this->overwrite) { - return; - } - - if (null === $this->format) { - $this->setRealFormat($this->internalFormat ?: $this->determineBestFormat()); - } - - $this->overwrite(''); - } - - private function setRealFormat(string $format) - { - // try to use the _nomax variant if available - if (!$this->max && null !== self::getFormatDefinition($format.'_nomax')) { - $this->format = self::getFormatDefinition($format.'_nomax'); - } elseif (null !== self::getFormatDefinition($format)) { - $this->format = self::getFormatDefinition($format); - } else { - $this->format = $format; - } - - $this->formatLineCount = substr_count($this->format, "\n"); - } - - /** - * Overwrites a previous message to the output. - */ - private function overwrite(string $message): void - { - if ($this->previousMessage === $message) { - return; - } - - $originalMessage = $message; - - if ($this->overwrite) { - if (null !== $this->previousMessage) { - if ($this->output instanceof ConsoleSectionOutput) { - $messageLines = explode("\n", $message); - $lineCount = \count($messageLines); - foreach ($messageLines as $messageLine) { - $messageLineLength = Helper::width(Helper::removeDecoration($this->output->getFormatter(), $messageLine)); - if ($messageLineLength > $this->terminal->getWidth()) { - $lineCount += floor($messageLineLength / $this->terminal->getWidth()); - } - } - $this->output->clear($lineCount); - } else { - if ('' !== $this->previousMessage) { - // only clear upper lines when last call was not a clear - for ($i = 0; $i < $this->formatLineCount; ++$i) { - $this->cursor->moveToColumn(1); - $this->cursor->clearLine(); - $this->cursor->moveUp(); - } - } - - $this->cursor->moveToColumn(1); - $this->cursor->clearLine(); - } - } - } elseif ($this->step > 0) { - $message = \PHP_EOL.$message; - } - - $this->previousMessage = $originalMessage; - $this->lastWriteTime = microtime(true); - - $this->output->write($message); - ++$this->writeCount; - } - - private function determineBestFormat(): string - { - return match ($this->output->getVerbosity()) { - // OutputInterface::VERBOSITY_QUIET: display is disabled anyway - OutputInterface::VERBOSITY_VERBOSE => $this->max ? self::FORMAT_VERBOSE : self::FORMAT_VERBOSE_NOMAX, - OutputInterface::VERBOSITY_VERY_VERBOSE => $this->max ? self::FORMAT_VERY_VERBOSE : self::FORMAT_VERY_VERBOSE_NOMAX, - OutputInterface::VERBOSITY_DEBUG => $this->max ? self::FORMAT_DEBUG : self::FORMAT_DEBUG_NOMAX, - default => $this->max ? self::FORMAT_NORMAL : self::FORMAT_NORMAL_NOMAX, - }; - } - - private static function initPlaceholderFormatters(): array - { - return [ - 'bar' => function (self $bar, OutputInterface $output) { - $completeBars = $bar->getBarOffset(); - $display = str_repeat($bar->getBarCharacter(), $completeBars); - if ($completeBars < $bar->getBarWidth()) { - $emptyBars = $bar->getBarWidth() - $completeBars - Helper::length(Helper::removeDecoration($output->getFormatter(), $bar->getProgressCharacter())); - $display .= $bar->getProgressCharacter().str_repeat($bar->getEmptyBarCharacter(), $emptyBars); - } - - return $display; - }, - 'elapsed' => function (self $bar) { - return Helper::formatTime(time() - $bar->getStartTime()); - }, - 'remaining' => function (self $bar) { - if (!$bar->getMaxSteps()) { - throw new LogicException('Unable to display the remaining time if the maximum number of steps is not set.'); - } - - return Helper::formatTime($bar->getRemaining()); - }, - 'estimated' => function (self $bar) { - if (!$bar->getMaxSteps()) { - throw new LogicException('Unable to display the estimated time if the maximum number of steps is not set.'); - } - - return Helper::formatTime($bar->getEstimated()); - }, - 'memory' => function (self $bar) { - return Helper::formatMemory(memory_get_usage(true)); - }, - 'current' => function (self $bar) { - return str_pad($bar->getProgress(), $bar->getStepWidth(), ' ', \STR_PAD_LEFT); - }, - 'max' => function (self $bar) { - return $bar->getMaxSteps(); - }, - 'percent' => function (self $bar) { - return floor($bar->getProgressPercent() * 100); - }, - ]; - } - - private static function initFormats(): array - { - return [ - self::FORMAT_NORMAL => ' %current%/%max% [%bar%] %percent:3s%%', - self::FORMAT_NORMAL_NOMAX => ' %current% [%bar%]', - - self::FORMAT_VERBOSE => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%', - self::FORMAT_VERBOSE_NOMAX => ' %current% [%bar%] %elapsed:6s%', - - self::FORMAT_VERY_VERBOSE => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s%', - self::FORMAT_VERY_VERBOSE_NOMAX => ' %current% [%bar%] %elapsed:6s%', - - self::FORMAT_DEBUG => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s% %memory:6s%', - self::FORMAT_DEBUG_NOMAX => ' %current% [%bar%] %elapsed:6s% %memory:6s%', - ]; - } - - private function buildLine(): string - { - \assert(null !== $this->format); - - $regex = "{%([a-z\-_]+)(?:\:([^%]+))?%}i"; - $callback = function ($matches) { - if ($formatter = $this::getPlaceholderFormatterDefinition($matches[1])) { - $text = $formatter($this, $this->output); - } elseif (isset($this->messages[$matches[1]])) { - $text = $this->messages[$matches[1]]; - } else { - return $matches[0]; - } - - if (isset($matches[2])) { - $text = sprintf('%'.$matches[2], $text); - } - - return $text; - }; - $line = preg_replace_callback($regex, $callback, $this->format); - - // gets string length for each sub line with multiline format - $linesLength = array_map(function ($subLine) { - return Helper::width(Helper::removeDecoration($this->output->getFormatter(), rtrim($subLine, "\r"))); - }, explode("\n", $line)); - - $linesWidth = max($linesLength); - - $terminalWidth = $this->terminal->getWidth(); - if ($linesWidth <= $terminalWidth) { - return $line; - } - - $this->setBarWidth($this->barWidth - $linesWidth + $terminalWidth); - - return preg_replace_callback($regex, $callback, $this->format); - } -} diff --git a/vendor/symfony/console/Helper/ProgressIndicator.php b/vendor/symfony/console/Helper/ProgressIndicator.php deleted file mode 100644 index 17203646..00000000 --- a/vendor/symfony/console/Helper/ProgressIndicator.php +++ /dev/null @@ -1,235 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\LogicException; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Kevin Bond - */ -class ProgressIndicator -{ - private const FORMATS = [ - 'normal' => ' %indicator% %message%', - 'normal_no_ansi' => ' %message%', - - 'verbose' => ' %indicator% %message% (%elapsed:6s%)', - 'verbose_no_ansi' => ' %message% (%elapsed:6s%)', - - 'very_verbose' => ' %indicator% %message% (%elapsed:6s%, %memory:6s%)', - 'very_verbose_no_ansi' => ' %message% (%elapsed:6s%, %memory:6s%)', - ]; - - private OutputInterface $output; - private int $startTime; - private ?string $format = null; - private ?string $message = null; - private array $indicatorValues; - private int $indicatorCurrent; - private int $indicatorChangeInterval; - private float $indicatorUpdateTime; - private bool $started = false; - - /** - * @var array - */ - private static array $formatters; - - /** - * @param int $indicatorChangeInterval Change interval in milliseconds - * @param array|null $indicatorValues Animated indicator characters - */ - public function __construct(OutputInterface $output, string $format = null, int $indicatorChangeInterval = 100, array $indicatorValues = null) - { - $this->output = $output; - - $format ??= $this->determineBestFormat(); - $indicatorValues ??= ['-', '\\', '|', '/']; - $indicatorValues = array_values($indicatorValues); - - if (2 > \count($indicatorValues)) { - throw new InvalidArgumentException('Must have at least 2 indicator value characters.'); - } - - $this->format = self::getFormatDefinition($format); - $this->indicatorChangeInterval = $indicatorChangeInterval; - $this->indicatorValues = $indicatorValues; - $this->startTime = time(); - } - - /** - * Sets the current indicator message. - */ - public function setMessage(?string $message) - { - $this->message = $message; - - $this->display(); - } - - /** - * Starts the indicator output. - */ - public function start(string $message) - { - if ($this->started) { - throw new LogicException('Progress indicator already started.'); - } - - $this->message = $message; - $this->started = true; - $this->startTime = time(); - $this->indicatorUpdateTime = $this->getCurrentTimeInMilliseconds() + $this->indicatorChangeInterval; - $this->indicatorCurrent = 0; - - $this->display(); - } - - /** - * Advances the indicator. - */ - public function advance() - { - if (!$this->started) { - throw new LogicException('Progress indicator has not yet been started.'); - } - - if (!$this->output->isDecorated()) { - return; - } - - $currentTime = $this->getCurrentTimeInMilliseconds(); - - if ($currentTime < $this->indicatorUpdateTime) { - return; - } - - $this->indicatorUpdateTime = $currentTime + $this->indicatorChangeInterval; - ++$this->indicatorCurrent; - - $this->display(); - } - - /** - * Finish the indicator with message. - * - * @param $message - */ - public function finish(string $message) - { - if (!$this->started) { - throw new LogicException('Progress indicator has not yet been started.'); - } - - $this->message = $message; - $this->display(); - $this->output->writeln(''); - $this->started = false; - } - - /** - * Gets the format for a given name. - */ - public static function getFormatDefinition(string $name): ?string - { - return self::FORMATS[$name] ?? null; - } - - /** - * Sets a placeholder formatter for a given name. - * - * This method also allow you to override an existing placeholder. - */ - public static function setPlaceholderFormatterDefinition(string $name, callable $callable) - { - self::$formatters ??= self::initPlaceholderFormatters(); - - self::$formatters[$name] = $callable; - } - - /** - * Gets the placeholder formatter for a given name (including the delimiter char like %). - */ - public static function getPlaceholderFormatterDefinition(string $name): ?callable - { - self::$formatters ??= self::initPlaceholderFormatters(); - - return self::$formatters[$name] ?? null; - } - - private function display() - { - if (OutputInterface::VERBOSITY_QUIET === $this->output->getVerbosity()) { - return; - } - - $this->overwrite(preg_replace_callback("{%([a-z\-_]+)(?:\:([^%]+))?%}i", function ($matches) { - if ($formatter = self::getPlaceholderFormatterDefinition($matches[1])) { - return $formatter($this); - } - - return $matches[0]; - }, $this->format ?? '')); - } - - private function determineBestFormat(): string - { - return match ($this->output->getVerbosity()) { - // OutputInterface::VERBOSITY_QUIET: display is disabled anyway - OutputInterface::VERBOSITY_VERBOSE => $this->output->isDecorated() ? 'verbose' : 'verbose_no_ansi', - OutputInterface::VERBOSITY_VERY_VERBOSE, - OutputInterface::VERBOSITY_DEBUG => $this->output->isDecorated() ? 'very_verbose' : 'very_verbose_no_ansi', - default => $this->output->isDecorated() ? 'normal' : 'normal_no_ansi', - }; - } - - /** - * Overwrites a previous message to the output. - */ - private function overwrite(string $message) - { - if ($this->output->isDecorated()) { - $this->output->write("\x0D\x1B[2K"); - $this->output->write($message); - } else { - $this->output->writeln($message); - } - } - - private function getCurrentTimeInMilliseconds(): float - { - return round(microtime(true) * 1000); - } - - /** - * @return array - */ - private static function initPlaceholderFormatters(): array - { - return [ - 'indicator' => function (self $indicator) { - return $indicator->indicatorValues[$indicator->indicatorCurrent % \count($indicator->indicatorValues)]; - }, - 'message' => function (self $indicator) { - return $indicator->message; - }, - 'elapsed' => function (self $indicator) { - return Helper::formatTime(time() - $indicator->startTime); - }, - 'memory' => function () { - return Helper::formatMemory(memory_get_usage(true)); - }, - ]; - } -} diff --git a/vendor/symfony/console/Helper/QuestionHelper.php b/vendor/symfony/console/Helper/QuestionHelper.php deleted file mode 100644 index c345b4af..00000000 --- a/vendor/symfony/console/Helper/QuestionHelper.php +++ /dev/null @@ -1,601 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Cursor; -use Symfony\Component\Console\Exception\MissingInputException; -use Symfony\Component\Console\Exception\RuntimeException; -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Formatter\OutputFormatterStyle; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\StreamableInputInterface; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\ConsoleSectionOutput; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Question\ChoiceQuestion; -use Symfony\Component\Console\Question\Question; -use Symfony\Component\Console\Terminal; - -use function Symfony\Component\String\s; - -/** - * The QuestionHelper class provides helpers to interact with the user. - * - * @author Fabien Potencier - */ -class QuestionHelper extends Helper -{ - /** - * @var resource|null - */ - private $inputStream; - - private static bool $stty = true; - private static bool $stdinIsInteractive; - - /** - * Asks a question to the user. - * - * @return mixed The user answer - * - * @throws RuntimeException If there is no data to read in the input stream - */ - public function ask(InputInterface $input, OutputInterface $output, Question $question): mixed - { - if ($output instanceof ConsoleOutputInterface) { - $output = $output->getErrorOutput(); - } - - if (!$input->isInteractive()) { - return $this->getDefaultAnswer($question); - } - - if ($input instanceof StreamableInputInterface && $stream = $input->getStream()) { - $this->inputStream = $stream; - } - - try { - if (!$question->getValidator()) { - return $this->doAsk($output, $question); - } - - $interviewer = function () use ($output, $question) { - return $this->doAsk($output, $question); - }; - - return $this->validateAttempts($interviewer, $output, $question); - } catch (MissingInputException $exception) { - $input->setInteractive(false); - - if (null === $fallbackOutput = $this->getDefaultAnswer($question)) { - throw $exception; - } - - return $fallbackOutput; - } - } - - public function getName(): string - { - return 'question'; - } - - /** - * Prevents usage of stty. - */ - public static function disableStty() - { - self::$stty = false; - } - - /** - * Asks the question to the user. - * - * @throws RuntimeException In case the fallback is deactivated and the response cannot be hidden - */ - private function doAsk(OutputInterface $output, Question $question): mixed - { - $this->writePrompt($output, $question); - - $inputStream = $this->inputStream ?: \STDIN; - $autocomplete = $question->getAutocompleterCallback(); - - if (null === $autocomplete || !self::$stty || !Terminal::hasSttyAvailable()) { - $ret = false; - if ($question->isHidden()) { - try { - $hiddenResponse = $this->getHiddenResponse($output, $inputStream, $question->isTrimmable()); - $ret = $question->isTrimmable() ? trim($hiddenResponse) : $hiddenResponse; - } catch (RuntimeException $e) { - if (!$question->isHiddenFallback()) { - throw $e; - } - } - } - - if (false === $ret) { - $ret = $this->readInput($inputStream, $question); - if (false === $ret) { - throw new MissingInputException('Aborted.'); - } - if ($question->isTrimmable()) { - $ret = trim($ret); - } - } - } else { - $autocomplete = $this->autocomplete($output, $question, $inputStream, $autocomplete); - $ret = $question->isTrimmable() ? trim($autocomplete) : $autocomplete; - } - - if ($output instanceof ConsoleSectionOutput) { - $output->addContent(''); // add EOL to the question - $output->addContent($ret); - } - - $ret = \strlen($ret) > 0 ? $ret : $question->getDefault(); - - if ($normalizer = $question->getNormalizer()) { - return $normalizer($ret); - } - - return $ret; - } - - private function getDefaultAnswer(Question $question): mixed - { - $default = $question->getDefault(); - - if (null === $default) { - return $default; - } - - if ($validator = $question->getValidator()) { - return \call_user_func($question->getValidator(), $default); - } elseif ($question instanceof ChoiceQuestion) { - $choices = $question->getChoices(); - - if (!$question->isMultiselect()) { - return $choices[$default] ?? $default; - } - - $default = explode(',', $default); - foreach ($default as $k => $v) { - $v = $question->isTrimmable() ? trim($v) : $v; - $default[$k] = $choices[$v] ?? $v; - } - } - - return $default; - } - - /** - * Outputs the question prompt. - */ - protected function writePrompt(OutputInterface $output, Question $question) - { - $message = $question->getQuestion(); - - if ($question instanceof ChoiceQuestion) { - $output->writeln(array_merge([ - $question->getQuestion(), - ], $this->formatChoiceQuestionChoices($question, 'info'))); - - $message = $question->getPrompt(); - } - - $output->write($message); - } - - /** - * @return string[] - */ - protected function formatChoiceQuestionChoices(ChoiceQuestion $question, string $tag): array - { - $messages = []; - - $maxWidth = max(array_map([__CLASS__, 'width'], array_keys($choices = $question->getChoices()))); - - foreach ($choices as $key => $value) { - $padding = str_repeat(' ', $maxWidth - self::width($key)); - - $messages[] = sprintf(" [<$tag>%s$padding] %s", $key, $value); - } - - return $messages; - } - - /** - * Outputs an error message. - */ - protected function writeError(OutputInterface $output, \Exception $error) - { - if (null !== $this->getHelperSet() && $this->getHelperSet()->has('formatter')) { - $message = $this->getHelperSet()->get('formatter')->formatBlock($error->getMessage(), 'error'); - } else { - $message = ''.$error->getMessage().''; - } - - $output->writeln($message); - } - - /** - * Autocompletes a question. - * - * @param resource $inputStream - */ - private function autocomplete(OutputInterface $output, Question $question, $inputStream, callable $autocomplete): string - { - $cursor = new Cursor($output, $inputStream); - - $fullChoice = ''; - $ret = ''; - - $i = 0; - $ofs = -1; - $matches = $autocomplete($ret); - $numMatches = \count($matches); - - $sttyMode = shell_exec('stty -g'); - $isStdin = 'php://stdin' === (stream_get_meta_data($inputStream)['uri'] ?? null); - $r = [$inputStream]; - $w = []; - - // Disable icanon (so we can fread each keypress) and echo (we'll do echoing here instead) - shell_exec('stty -icanon -echo'); - - // Add highlighted text style - $output->getFormatter()->setStyle('hl', new OutputFormatterStyle('black', 'white')); - - // Read a keypress - while (!feof($inputStream)) { - while ($isStdin && 0 === @stream_select($r, $w, $w, 0, 100)) { - // Give signal handlers a chance to run - $r = [$inputStream]; - } - $c = fread($inputStream, 1); - - // as opposed to fgets(), fread() returns an empty string when the stream content is empty, not false. - if (false === $c || ('' === $ret && '' === $c && null === $question->getDefault())) { - shell_exec('stty '.$sttyMode); - throw new MissingInputException('Aborted.'); - } elseif ("\177" === $c) { // Backspace Character - if (0 === $numMatches && 0 !== $i) { - --$i; - $cursor->moveLeft(s($fullChoice)->slice(-1)->width(false)); - - $fullChoice = self::substr($fullChoice, 0, $i); - } - - if (0 === $i) { - $ofs = -1; - $matches = $autocomplete($ret); - $numMatches = \count($matches); - } else { - $numMatches = 0; - } - - // Pop the last character off the end of our string - $ret = self::substr($ret, 0, $i); - } elseif ("\033" === $c) { - // Did we read an escape sequence? - $c .= fread($inputStream, 2); - - // A = Up Arrow. B = Down Arrow - if (isset($c[2]) && ('A' === $c[2] || 'B' === $c[2])) { - if ('A' === $c[2] && -1 === $ofs) { - $ofs = 0; - } - - if (0 === $numMatches) { - continue; - } - - $ofs += ('A' === $c[2]) ? -1 : 1; - $ofs = ($numMatches + $ofs) % $numMatches; - } - } elseif (\ord($c) < 32) { - if ("\t" === $c || "\n" === $c) { - if ($numMatches > 0 && -1 !== $ofs) { - $ret = (string) $matches[$ofs]; - // Echo out remaining chars for current match - $remainingCharacters = substr($ret, \strlen(trim($this->mostRecentlyEnteredValue($fullChoice)))); - $output->write($remainingCharacters); - $fullChoice .= $remainingCharacters; - $i = (false === $encoding = mb_detect_encoding($fullChoice, null, true)) ? \strlen($fullChoice) : mb_strlen($fullChoice, $encoding); - - $matches = array_filter( - $autocomplete($ret), - function ($match) use ($ret) { - return '' === $ret || str_starts_with($match, $ret); - } - ); - $numMatches = \count($matches); - $ofs = -1; - } - - if ("\n" === $c) { - $output->write($c); - break; - } - - $numMatches = 0; - } - - continue; - } else { - if ("\x80" <= $c) { - $c .= fread($inputStream, ["\xC0" => 1, "\xD0" => 1, "\xE0" => 2, "\xF0" => 3][$c & "\xF0"]); - } - - $output->write($c); - $ret .= $c; - $fullChoice .= $c; - ++$i; - - $tempRet = $ret; - - if ($question instanceof ChoiceQuestion && $question->isMultiselect()) { - $tempRet = $this->mostRecentlyEnteredValue($fullChoice); - } - - $numMatches = 0; - $ofs = 0; - - foreach ($autocomplete($ret) as $value) { - // If typed characters match the beginning chunk of value (e.g. [AcmeDe]moBundle) - if (str_starts_with($value, $tempRet)) { - $matches[$numMatches++] = $value; - } - } - } - - $cursor->clearLineAfter(); - - if ($numMatches > 0 && -1 !== $ofs) { - $cursor->savePosition(); - // Write highlighted text, complete the partially entered response - $charactersEntered = \strlen(trim($this->mostRecentlyEnteredValue($fullChoice))); - $output->write(''.OutputFormatter::escapeTrailingBackslash(substr($matches[$ofs], $charactersEntered)).''); - $cursor->restorePosition(); - } - } - - // Reset stty so it behaves normally again - shell_exec('stty '.$sttyMode); - - return $fullChoice; - } - - private function mostRecentlyEnteredValue(string $entered): string - { - // Determine the most recent value that the user entered - if (!str_contains($entered, ',')) { - return $entered; - } - - $choices = explode(',', $entered); - if ('' !== $lastChoice = trim($choices[\count($choices) - 1])) { - return $lastChoice; - } - - return $entered; - } - - /** - * Gets a hidden response from user. - * - * @param resource $inputStream The handler resource - * @param bool $trimmable Is the answer trimmable - * - * @throws RuntimeException In case the fallback is deactivated and the response cannot be hidden - */ - private function getHiddenResponse(OutputInterface $output, $inputStream, bool $trimmable = true): string - { - if ('\\' === \DIRECTORY_SEPARATOR) { - $exe = __DIR__.'/../Resources/bin/hiddeninput.exe'; - - // handle code running from a phar - if (str_starts_with(__FILE__, 'phar:')) { - $tmpExe = sys_get_temp_dir().'/hiddeninput.exe'; - copy($exe, $tmpExe); - $exe = $tmpExe; - } - - $sExec = shell_exec('"'.$exe.'"'); - $value = $trimmable ? rtrim($sExec) : $sExec; - $output->writeln(''); - - if (isset($tmpExe)) { - unlink($tmpExe); - } - - return $value; - } - - if (self::$stty && Terminal::hasSttyAvailable()) { - $sttyMode = shell_exec('stty -g'); - shell_exec('stty -echo'); - } elseif ($this->isInteractiveInput($inputStream)) { - throw new RuntimeException('Unable to hide the response.'); - } - - $value = fgets($inputStream, 4096); - - if (4095 === \strlen($value)) { - $errOutput = $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output; - $errOutput->warning('The value was possibly truncated by your shell or terminal emulator'); - } - - if (self::$stty && Terminal::hasSttyAvailable()) { - shell_exec('stty '.$sttyMode); - } - - if (false === $value) { - throw new MissingInputException('Aborted.'); - } - if ($trimmable) { - $value = trim($value); - } - $output->writeln(''); - - return $value; - } - - /** - * Validates an attempt. - * - * @param callable $interviewer A callable that will ask for a question and return the result - * - * @throws \Exception In case the max number of attempts has been reached and no valid response has been given - */ - private function validateAttempts(callable $interviewer, OutputInterface $output, Question $question): mixed - { - $error = null; - $attempts = $question->getMaxAttempts(); - - while (null === $attempts || $attempts--) { - if (null !== $error) { - $this->writeError($output, $error); - } - - try { - return $question->getValidator()($interviewer()); - } catch (RuntimeException $e) { - throw $e; - } catch (\Exception $error) { - } - } - - throw $error; - } - - private function isInteractiveInput($inputStream): bool - { - if ('php://stdin' !== (stream_get_meta_data($inputStream)['uri'] ?? null)) { - return false; - } - - if (isset(self::$stdinIsInteractive)) { - return self::$stdinIsInteractive; - } - - if (\function_exists('stream_isatty')) { - return self::$stdinIsInteractive = @stream_isatty(fopen('php://stdin', 'r')); - } - - if (\function_exists('posix_isatty')) { - return self::$stdinIsInteractive = @posix_isatty(fopen('php://stdin', 'r')); - } - - if (!\function_exists('exec')) { - return self::$stdinIsInteractive = true; - } - - exec('stty 2> /dev/null', $output, $status); - - return self::$stdinIsInteractive = 1 !== $status; - } - - /** - * Reads one or more lines of input and returns what is read. - * - * @param resource $inputStream The handler resource - * @param Question $question The question being asked - */ - private function readInput($inputStream, Question $question): string|false - { - if (!$question->isMultiline()) { - $cp = $this->setIOCodepage(); - $ret = fgets($inputStream, 4096); - - return $this->resetIOCodepage($cp, $ret); - } - - $multiLineStreamReader = $this->cloneInputStream($inputStream); - if (null === $multiLineStreamReader) { - return false; - } - - $ret = ''; - $cp = $this->setIOCodepage(); - while (false !== ($char = fgetc($multiLineStreamReader))) { - if (\PHP_EOL === "{$ret}{$char}") { - break; - } - $ret .= $char; - } - - return $this->resetIOCodepage($cp, $ret); - } - - private function setIOCodepage(): int - { - if (\function_exists('sapi_windows_cp_set')) { - $cp = sapi_windows_cp_get(); - sapi_windows_cp_set(sapi_windows_cp_get('oem')); - - return $cp; - } - - return 0; - } - - /** - * Sets console I/O to the specified code page and converts the user input. - */ - private function resetIOCodepage(int $cp, string|false $input): string|false - { - if (0 !== $cp) { - sapi_windows_cp_set($cp); - - if (false !== $input && '' !== $input) { - $input = sapi_windows_cp_conv(sapi_windows_cp_get('oem'), $cp, $input); - } - } - - return $input; - } - - /** - * Clones an input stream in order to act on one instance of the same - * stream without affecting the other instance. - * - * @param resource $inputStream The handler resource - * - * @return resource|null The cloned resource, null in case it could not be cloned - */ - private function cloneInputStream($inputStream) - { - $streamMetaData = stream_get_meta_data($inputStream); - $seekable = $streamMetaData['seekable'] ?? false; - $mode = $streamMetaData['mode'] ?? 'rb'; - $uri = $streamMetaData['uri'] ?? null; - - if (null === $uri) { - return null; - } - - $cloneStream = fopen($uri, $mode); - - // For seekable and writable streams, add all the same data to the - // cloned stream and then seek to the same offset. - if (true === $seekable && !\in_array($mode, ['r', 'rb', 'rt'])) { - $offset = ftell($inputStream); - rewind($inputStream); - stream_copy_to_stream($inputStream, $cloneStream); - fseek($inputStream, $offset); - fseek($cloneStream, $offset); - } - - return $cloneStream; - } -} diff --git a/vendor/symfony/console/Helper/SymfonyQuestionHelper.php b/vendor/symfony/console/Helper/SymfonyQuestionHelper.php deleted file mode 100644 index 109045d0..00000000 --- a/vendor/symfony/console/Helper/SymfonyQuestionHelper.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\Component\Console\Helper; - -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Question\ChoiceQuestion; -use Symfony\Component\Console\Question\ConfirmationQuestion; -use Symfony\Component\Console\Question\Question; -use Symfony\Component\Console\Style\SymfonyStyle; - -/** - * Symfony Style Guide compliant question helper. - * - * @author Kevin Bond - */ -class SymfonyQuestionHelper extends QuestionHelper -{ - protected function writePrompt(OutputInterface $output, Question $question) - { - $text = OutputFormatter::escapeTrailingBackslash($question->getQuestion()); - $default = $question->getDefault(); - - if ($question->isMultiline()) { - $text .= sprintf(' (press %s to continue)', $this->getEofShortcut()); - } - - switch (true) { - case null === $default: - $text = sprintf(' %s:', $text); - - break; - - case $question instanceof ConfirmationQuestion: - $text = sprintf(' %s (yes/no) [%s]:', $text, $default ? 'yes' : 'no'); - - break; - - case $question instanceof ChoiceQuestion && $question->isMultiselect(): - $choices = $question->getChoices(); - $default = explode(',', $default); - - foreach ($default as $key => $value) { - $default[$key] = $choices[trim($value)]; - } - - $text = sprintf(' %s [%s]:', $text, OutputFormatter::escape(implode(', ', $default))); - - break; - - case $question instanceof ChoiceQuestion: - $choices = $question->getChoices(); - $text = sprintf(' %s [%s]:', $text, OutputFormatter::escape($choices[$default] ?? $default)); - - break; - - default: - $text = sprintf(' %s [%s]:', $text, OutputFormatter::escape($default)); - } - - $output->writeln($text); - - $prompt = ' > '; - - if ($question instanceof ChoiceQuestion) { - $output->writeln($this->formatChoiceQuestionChoices($question, 'comment')); - - $prompt = $question->getPrompt(); - } - - $output->write($prompt); - } - - protected function writeError(OutputInterface $output, \Exception $error) - { - if ($output instanceof SymfonyStyle) { - $output->newLine(); - $output->error($error->getMessage()); - - return; - } - - parent::writeError($output, $error); - } - - private function getEofShortcut(): string - { - if ('Windows' === \PHP_OS_FAMILY) { - return 'Ctrl+Z then Enter'; - } - - return 'Ctrl+D'; - } -} diff --git a/vendor/symfony/console/Helper/Table.php b/vendor/symfony/console/Helper/Table.php deleted file mode 100644 index 893b3192..00000000 --- a/vendor/symfony/console/Helper/Table.php +++ /dev/null @@ -1,910 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\RuntimeException; -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Formatter\WrappableOutputFormatterInterface; -use Symfony\Component\Console\Output\ConsoleSectionOutput; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Provides helpers to display a table. - * - * @author Fabien Potencier - * @author Саша Стаменковић - * @author Abdellatif Ait boudad - * @author Max Grigorian - * @author Dany Maillard - */ -class Table -{ - private const SEPARATOR_TOP = 0; - private const SEPARATOR_TOP_BOTTOM = 1; - private const SEPARATOR_MID = 2; - private const SEPARATOR_BOTTOM = 3; - private const BORDER_OUTSIDE = 0; - private const BORDER_INSIDE = 1; - private const DISPLAY_ORIENTATION_DEFAULT = 'default'; - private const DISPLAY_ORIENTATION_HORIZONTAL = 'horizontal'; - private const DISPLAY_ORIENTATION_VERTICAL = 'vertical'; - - private ?string $headerTitle = null; - private ?string $footerTitle = null; - private array $headers = []; - private array $rows = []; - private array $effectiveColumnWidths = []; - private int $numberOfColumns; - private OutputInterface $output; - private TableStyle $style; - private array $columnStyles = []; - private array $columnWidths = []; - private array $columnMaxWidths = []; - private bool $rendered = false; - private string $displayOrientation = self::DISPLAY_ORIENTATION_DEFAULT; - - private static array $styles; - - public function __construct(OutputInterface $output) - { - $this->output = $output; - - self::$styles ??= self::initStyles(); - - $this->setStyle('default'); - } - - /** - * Sets a style definition. - */ - public static function setStyleDefinition(string $name, TableStyle $style) - { - self::$styles ??= self::initStyles(); - - self::$styles[$name] = $style; - } - - /** - * Gets a style definition by name. - */ - public static function getStyleDefinition(string $name): TableStyle - { - self::$styles ??= self::initStyles(); - - return self::$styles[$name] ?? throw new InvalidArgumentException(sprintf('Style "%s" is not defined.', $name)); - } - - /** - * Sets table style. - * - * @return $this - */ - public function setStyle(TableStyle|string $name): static - { - $this->style = $this->resolveStyle($name); - - return $this; - } - - /** - * Gets the current table style. - */ - public function getStyle(): TableStyle - { - return $this->style; - } - - /** - * Sets table column style. - * - * @param TableStyle|string $name The style name or a TableStyle instance - * - * @return $this - */ - public function setColumnStyle(int $columnIndex, TableStyle|string $name): static - { - $this->columnStyles[$columnIndex] = $this->resolveStyle($name); - - return $this; - } - - /** - * Gets the current style for a column. - * - * If style was not set, it returns the global table style. - */ - public function getColumnStyle(int $columnIndex): TableStyle - { - return $this->columnStyles[$columnIndex] ?? $this->getStyle(); - } - - /** - * Sets the minimum width of a column. - * - * @return $this - */ - public function setColumnWidth(int $columnIndex, int $width): static - { - $this->columnWidths[$columnIndex] = $width; - - return $this; - } - - /** - * Sets the minimum width of all columns. - * - * @return $this - */ - public function setColumnWidths(array $widths): static - { - $this->columnWidths = []; - foreach ($widths as $index => $width) { - $this->setColumnWidth($index, $width); - } - - return $this; - } - - /** - * Sets the maximum width of a column. - * - * Any cell within this column which contents exceeds the specified width will be wrapped into multiple lines, while - * formatted strings are preserved. - * - * @return $this - */ - public function setColumnMaxWidth(int $columnIndex, int $width): static - { - if (!$this->output->getFormatter() instanceof WrappableOutputFormatterInterface) { - throw new \LogicException(sprintf('Setting a maximum column width is only supported when using a "%s" formatter, got "%s".', WrappableOutputFormatterInterface::class, get_debug_type($this->output->getFormatter()))); - } - - $this->columnMaxWidths[$columnIndex] = $width; - - return $this; - } - - /** - * @return $this - */ - public function setHeaders(array $headers): static - { - $headers = array_values($headers); - if ($headers && !\is_array($headers[0])) { - $headers = [$headers]; - } - - $this->headers = $headers; - - return $this; - } - - /** - * @return $this - */ - public function setRows(array $rows) - { - $this->rows = []; - - return $this->addRows($rows); - } - - /** - * @return $this - */ - public function addRows(array $rows): static - { - foreach ($rows as $row) { - $this->addRow($row); - } - - return $this; - } - - /** - * @return $this - */ - public function addRow(TableSeparator|array $row): static - { - if ($row instanceof TableSeparator) { - $this->rows[] = $row; - - return $this; - } - - $this->rows[] = array_values($row); - - return $this; - } - - /** - * Adds a row to the table, and re-renders the table. - * - * @return $this - */ - public function appendRow(TableSeparator|array $row): static - { - if (!$this->output instanceof ConsoleSectionOutput) { - throw new RuntimeException(sprintf('Output should be an instance of "%s" when calling "%s".', ConsoleSectionOutput::class, __METHOD__)); - } - - if ($this->rendered) { - $this->output->clear($this->calculateRowCount()); - } - - $this->addRow($row); - $this->render(); - - return $this; - } - - /** - * @return $this - */ - public function setRow(int|string $column, array $row): static - { - $this->rows[$column] = $row; - - return $this; - } - - /** - * @return $this - */ - public function setHeaderTitle(?string $title): static - { - $this->headerTitle = $title; - - return $this; - } - - /** - * @return $this - */ - public function setFooterTitle(?string $title): static - { - $this->footerTitle = $title; - - return $this; - } - - /** - * @return $this - */ - public function setHorizontal(bool $horizontal = true): static - { - $this->displayOrientation = $horizontal ? self::DISPLAY_ORIENTATION_HORIZONTAL : self::DISPLAY_ORIENTATION_DEFAULT; - - return $this; - } - - /** - * @return $this - */ - public function setVertical(bool $vertical = true): static - { - $this->displayOrientation = $vertical ? self::DISPLAY_ORIENTATION_VERTICAL : self::DISPLAY_ORIENTATION_DEFAULT; - - return $this; - } - - /** - * Renders table to output. - * - * Example: - * - * +---------------+-----------------------+------------------+ - * | ISBN | Title | Author | - * +---------------+-----------------------+------------------+ - * | 99921-58-10-7 | Divine Comedy | Dante Alighieri | - * | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | - * | 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien | - * +---------------+-----------------------+------------------+ - */ - public function render() - { - $divider = new TableSeparator(); - $isCellWithColspan = static fn ($cell) => $cell instanceof TableCell && $cell->getColspan() >= 2; - - $horizontal = self::DISPLAY_ORIENTATION_HORIZONTAL === $this->displayOrientation; - $vertical = self::DISPLAY_ORIENTATION_VERTICAL === $this->displayOrientation; - - $rows = []; - if ($horizontal) { - foreach ($this->headers[0] ?? [] as $i => $header) { - $rows[$i] = [$header]; - foreach ($this->rows as $row) { - if ($row instanceof TableSeparator) { - continue; - } - if (isset($row[$i])) { - $rows[$i][] = $row[$i]; - } elseif ($isCellWithColspan($rows[$i][0])) { - // Noop, there is a "title" - } else { - $rows[$i][] = null; - } - } - } - } elseif ($vertical) { - $formatter = $this->output->getFormatter(); - $maxHeaderLength = array_reduce($this->headers[0] ?? [], static fn ($max, $header) => max($max, Helper::width(Helper::removeDecoration($formatter, $header))), 0); - - foreach ($this->rows as $row) { - if ($row instanceof TableSeparator) { - continue; - } - - if ($rows) { - $rows[] = [$divider]; - } - - $containsColspan = false; - foreach ($row as $cell) { - if ($containsColspan = $isCellWithColspan($cell)) { - break; - } - } - - $headers = $this->headers[0] ?? []; - $maxRows = max(\count($headers), \count($row)); - for ($i = 0; $i < $maxRows; ++$i) { - $cell = (string) ($row[$i] ?? ''); - if ($headers && !$containsColspan) { - $rows[] = [sprintf( - '%s: %s', - str_pad($headers[$i] ?? '', $maxHeaderLength, ' ', \STR_PAD_LEFT), - $cell - )]; - } elseif ('' !== $cell) { - $rows[] = [$cell]; - } - } - } - } else { - $rows = array_merge($this->headers, [$divider], $this->rows); - } - - $this->calculateNumberOfColumns($rows); - - $rowGroups = $this->buildTableRows($rows); - $this->calculateColumnsWidth($rowGroups); - - $isHeader = !$horizontal; - $isFirstRow = $horizontal; - $hasTitle = (bool) $this->headerTitle; - - foreach ($rowGroups as $rowGroup) { - $isHeaderSeparatorRendered = false; - - foreach ($rowGroup as $row) { - if ($divider === $row) { - $isHeader = false; - $isFirstRow = true; - - continue; - } - - if ($row instanceof TableSeparator) { - $this->renderRowSeparator(); - - continue; - } - - if (!$row) { - continue; - } - - if ($isHeader && !$isHeaderSeparatorRendered) { - $this->renderRowSeparator( - $isHeader ? self::SEPARATOR_TOP : self::SEPARATOR_TOP_BOTTOM, - $hasTitle ? $this->headerTitle : null, - $hasTitle ? $this->style->getHeaderTitleFormat() : null - ); - $hasTitle = false; - $isHeaderSeparatorRendered = true; - } - - if ($isFirstRow) { - $this->renderRowSeparator( - $isHeader ? self::SEPARATOR_TOP : self::SEPARATOR_TOP_BOTTOM, - $hasTitle ? $this->headerTitle : null, - $hasTitle ? $this->style->getHeaderTitleFormat() : null - ); - $isFirstRow = false; - $hasTitle = false; - } - - if ($vertical) { - $isHeader = false; - $isFirstRow = false; - } - - if ($horizontal) { - $this->renderRow($row, $this->style->getCellRowFormat(), $this->style->getCellHeaderFormat()); - } else { - $this->renderRow($row, $isHeader ? $this->style->getCellHeaderFormat() : $this->style->getCellRowFormat()); - } - } - } - $this->renderRowSeparator(self::SEPARATOR_BOTTOM, $this->footerTitle, $this->style->getFooterTitleFormat()); - - $this->cleanup(); - $this->rendered = true; - } - - /** - * Renders horizontal header separator. - * - * Example: - * - * +-----+-----------+-------+ - */ - private function renderRowSeparator(int $type = self::SEPARATOR_MID, string $title = null, string $titleFormat = null) - { - if (!$count = $this->numberOfColumns) { - return; - } - - $borders = $this->style->getBorderChars(); - if (!$borders[0] && !$borders[2] && !$this->style->getCrossingChar()) { - return; - } - - $crossings = $this->style->getCrossingChars(); - if (self::SEPARATOR_MID === $type) { - [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[2], $crossings[8], $crossings[0], $crossings[4]]; - } elseif (self::SEPARATOR_TOP === $type) { - [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[0], $crossings[1], $crossings[2], $crossings[3]]; - } elseif (self::SEPARATOR_TOP_BOTTOM === $type) { - [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[0], $crossings[9], $crossings[10], $crossings[11]]; - } else { - [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[0], $crossings[7], $crossings[6], $crossings[5]]; - } - - $markup = $leftChar; - for ($column = 0; $column < $count; ++$column) { - $markup .= str_repeat($horizontal, $this->effectiveColumnWidths[$column]); - $markup .= $column === $count - 1 ? $rightChar : $midChar; - } - - if (null !== $title) { - $titleLength = Helper::width(Helper::removeDecoration($formatter = $this->output->getFormatter(), $formattedTitle = sprintf($titleFormat, $title))); - $markupLength = Helper::width($markup); - if ($titleLength > $limit = $markupLength - 4) { - $titleLength = $limit; - $formatLength = Helper::width(Helper::removeDecoration($formatter, sprintf($titleFormat, ''))); - $formattedTitle = sprintf($titleFormat, Helper::substr($title, 0, $limit - $formatLength - 3).'...'); - } - - $titleStart = intdiv($markupLength - $titleLength, 2); - if (false === mb_detect_encoding($markup, null, true)) { - $markup = substr_replace($markup, $formattedTitle, $titleStart, $titleLength); - } else { - $markup = mb_substr($markup, 0, $titleStart).$formattedTitle.mb_substr($markup, $titleStart + $titleLength); - } - } - - $this->output->writeln(sprintf($this->style->getBorderFormat(), $markup)); - } - - /** - * Renders vertical column separator. - */ - private function renderColumnSeparator(int $type = self::BORDER_OUTSIDE): string - { - $borders = $this->style->getBorderChars(); - - return sprintf($this->style->getBorderFormat(), self::BORDER_OUTSIDE === $type ? $borders[1] : $borders[3]); - } - - /** - * Renders table row. - * - * Example: - * - * | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | - */ - private function renderRow(array $row, string $cellFormat, string $firstCellFormat = null) - { - $rowContent = $this->renderColumnSeparator(self::BORDER_OUTSIDE); - $columns = $this->getRowColumns($row); - $last = \count($columns) - 1; - foreach ($columns as $i => $column) { - if ($firstCellFormat && 0 === $i) { - $rowContent .= $this->renderCell($row, $column, $firstCellFormat); - } else { - $rowContent .= $this->renderCell($row, $column, $cellFormat); - } - $rowContent .= $this->renderColumnSeparator($last === $i ? self::BORDER_OUTSIDE : self::BORDER_INSIDE); - } - $this->output->writeln($rowContent); - } - - /** - * Renders table cell with padding. - */ - private function renderCell(array $row, int $column, string $cellFormat): string - { - $cell = $row[$column] ?? ''; - $width = $this->effectiveColumnWidths[$column]; - if ($cell instanceof TableCell && $cell->getColspan() > 1) { - // add the width of the following columns(numbers of colspan). - foreach (range($column + 1, $column + $cell->getColspan() - 1) as $nextColumn) { - $width += $this->getColumnSeparatorWidth() + $this->effectiveColumnWidths[$nextColumn]; - } - } - - // str_pad won't work properly with multi-byte strings, we need to fix the padding - if (false !== $encoding = mb_detect_encoding($cell, null, true)) { - $width += \strlen($cell) - mb_strwidth($cell, $encoding); - } - - $style = $this->getColumnStyle($column); - - if ($cell instanceof TableSeparator) { - return sprintf($style->getBorderFormat(), str_repeat($style->getBorderChars()[2], $width)); - } - - $width += Helper::length($cell) - Helper::length(Helper::removeDecoration($this->output->getFormatter(), $cell)); - $content = sprintf($style->getCellRowContentFormat(), $cell); - - $padType = $style->getPadType(); - if ($cell instanceof TableCell && $cell->getStyle() instanceof TableCellStyle) { - $isNotStyledByTag = !preg_match('/^<(\w+|(\w+=[\w,]+;?)*)>.+<\/(\w+|(\w+=\w+;?)*)?>$/', $cell); - if ($isNotStyledByTag) { - $cellFormat = $cell->getStyle()->getCellFormat(); - if (!\is_string($cellFormat)) { - $tag = http_build_query($cell->getStyle()->getTagOptions(), '', ';'); - $cellFormat = '<'.$tag.'>%s'; - } - - if (str_contains($content, '')) { - $content = str_replace('', '', $content); - $width -= 3; - } - if (str_contains($content, '')) { - $content = str_replace('', '', $content); - $width -= \strlen(''); - } - } - - $padType = $cell->getStyle()->getPadByAlign(); - } - - return sprintf($cellFormat, str_pad($content, $width, $style->getPaddingChar(), $padType)); - } - - /** - * Calculate number of columns for this table. - */ - private function calculateNumberOfColumns(array $rows) - { - $columns = [0]; - foreach ($rows as $row) { - if ($row instanceof TableSeparator) { - continue; - } - - $columns[] = $this->getNumberOfColumns($row); - } - - $this->numberOfColumns = max($columns); - } - - private function buildTableRows(array $rows): TableRows - { - /** @var WrappableOutputFormatterInterface $formatter */ - $formatter = $this->output->getFormatter(); - $unmergedRows = []; - for ($rowKey = 0; $rowKey < \count($rows); ++$rowKey) { - $rows = $this->fillNextRows($rows, $rowKey); - - // Remove any new line breaks and replace it with a new line - foreach ($rows[$rowKey] as $column => $cell) { - $colspan = $cell instanceof TableCell ? $cell->getColspan() : 1; - - if (isset($this->columnMaxWidths[$column]) && Helper::width(Helper::removeDecoration($formatter, $cell)) > $this->columnMaxWidths[$column]) { - $cell = $formatter->formatAndWrap($cell, $this->columnMaxWidths[$column] * $colspan); - } - if (!str_contains($cell ?? '', "\n")) { - continue; - } - $escaped = implode("\n", array_map(OutputFormatter::escapeTrailingBackslash(...), explode("\n", $cell))); - $cell = $cell instanceof TableCell ? new TableCell($escaped, ['colspan' => $cell->getColspan()]) : $escaped; - $lines = explode("\n", str_replace("\n", "\n", $cell)); - foreach ($lines as $lineKey => $line) { - if ($colspan > 1) { - $line = new TableCell($line, ['colspan' => $colspan]); - } - if (0 === $lineKey) { - $rows[$rowKey][$column] = $line; - } else { - if (!\array_key_exists($rowKey, $unmergedRows) || !\array_key_exists($lineKey, $unmergedRows[$rowKey])) { - $unmergedRows[$rowKey][$lineKey] = $this->copyRow($rows, $rowKey); - } - $unmergedRows[$rowKey][$lineKey][$column] = $line; - } - } - } - } - - return new TableRows(function () use ($rows, $unmergedRows): \Traversable { - foreach ($rows as $rowKey => $row) { - $rowGroup = [$row instanceof TableSeparator ? $row : $this->fillCells($row)]; - - if (isset($unmergedRows[$rowKey])) { - foreach ($unmergedRows[$rowKey] as $row) { - $rowGroup[] = $row instanceof TableSeparator ? $row : $this->fillCells($row); - } - } - yield $rowGroup; - } - }); - } - - private function calculateRowCount(): int - { - $numberOfRows = \count(iterator_to_array($this->buildTableRows(array_merge($this->headers, [new TableSeparator()], $this->rows)))); - - if ($this->headers) { - ++$numberOfRows; // Add row for header separator - } - - if ($this->rows) { - ++$numberOfRows; // Add row for footer separator - } - - return $numberOfRows; - } - - /** - * fill rows that contains rowspan > 1. - * - * @throws InvalidArgumentException - */ - private function fillNextRows(array $rows, int $line): array - { - $unmergedRows = []; - foreach ($rows[$line] as $column => $cell) { - if (null !== $cell && !$cell instanceof TableCell && !\is_scalar($cell) && !$cell instanceof \Stringable) { - throw new InvalidArgumentException(sprintf('A cell must be a TableCell, a scalar or an object implementing "__toString()", "%s" given.', get_debug_type($cell))); - } - if ($cell instanceof TableCell && $cell->getRowspan() > 1) { - $nbLines = $cell->getRowspan() - 1; - $lines = [$cell]; - if (str_contains($cell, "\n")) { - $lines = explode("\n", str_replace("\n", "\n", $cell)); - $nbLines = \count($lines) > $nbLines ? substr_count($cell, "\n") : $nbLines; - - $rows[$line][$column] = new TableCell($lines[0], ['colspan' => $cell->getColspan(), 'style' => $cell->getStyle()]); - unset($lines[0]); - } - - // create a two dimensional array (rowspan x colspan) - $unmergedRows = array_replace_recursive(array_fill($line + 1, $nbLines, []), $unmergedRows); - foreach ($unmergedRows as $unmergedRowKey => $unmergedRow) { - $value = $lines[$unmergedRowKey - $line] ?? ''; - $unmergedRows[$unmergedRowKey][$column] = new TableCell($value, ['colspan' => $cell->getColspan(), 'style' => $cell->getStyle()]); - if ($nbLines === $unmergedRowKey - $line) { - break; - } - } - } - } - - foreach ($unmergedRows as $unmergedRowKey => $unmergedRow) { - // we need to know if $unmergedRow will be merged or inserted into $rows - if (isset($rows[$unmergedRowKey]) && \is_array($rows[$unmergedRowKey]) && ($this->getNumberOfColumns($rows[$unmergedRowKey]) + $this->getNumberOfColumns($unmergedRows[$unmergedRowKey]) <= $this->numberOfColumns)) { - foreach ($unmergedRow as $cellKey => $cell) { - // insert cell into row at cellKey position - array_splice($rows[$unmergedRowKey], $cellKey, 0, [$cell]); - } - } else { - $row = $this->copyRow($rows, $unmergedRowKey - 1); - foreach ($unmergedRow as $column => $cell) { - if (!empty($cell)) { - $row[$column] = $unmergedRow[$column]; - } - } - array_splice($rows, $unmergedRowKey, 0, [$row]); - } - } - - return $rows; - } - - /** - * fill cells for a row that contains colspan > 1. - */ - private function fillCells(iterable $row) - { - $newRow = []; - - foreach ($row as $column => $cell) { - $newRow[] = $cell; - if ($cell instanceof TableCell && $cell->getColspan() > 1) { - foreach (range($column + 1, $column + $cell->getColspan() - 1) as $position) { - // insert empty value at column position - $newRow[] = ''; - } - } - } - - return $newRow ?: $row; - } - - private function copyRow(array $rows, int $line): array - { - $row = $rows[$line]; - foreach ($row as $cellKey => $cellValue) { - $row[$cellKey] = ''; - if ($cellValue instanceof TableCell) { - $row[$cellKey] = new TableCell('', ['colspan' => $cellValue->getColspan()]); - } - } - - return $row; - } - - /** - * Gets number of columns by row. - */ - private function getNumberOfColumns(array $row): int - { - $columns = \count($row); - foreach ($row as $column) { - $columns += $column instanceof TableCell ? ($column->getColspan() - 1) : 0; - } - - return $columns; - } - - /** - * Gets list of columns for the given row. - */ - private function getRowColumns(array $row): array - { - $columns = range(0, $this->numberOfColumns - 1); - foreach ($row as $cellKey => $cell) { - if ($cell instanceof TableCell && $cell->getColspan() > 1) { - // exclude grouped columns. - $columns = array_diff($columns, range($cellKey + 1, $cellKey + $cell->getColspan() - 1)); - } - } - - return $columns; - } - - /** - * Calculates columns widths. - */ - private function calculateColumnsWidth(iterable $groups) - { - for ($column = 0; $column < $this->numberOfColumns; ++$column) { - $lengths = []; - foreach ($groups as $group) { - foreach ($group as $row) { - if ($row instanceof TableSeparator) { - continue; - } - - foreach ($row as $i => $cell) { - if ($cell instanceof TableCell) { - $textContent = Helper::removeDecoration($this->output->getFormatter(), $cell); - $textLength = Helper::width($textContent); - if ($textLength > 0) { - $contentColumns = str_split($textContent, ceil($textLength / $cell->getColspan())); - foreach ($contentColumns as $position => $content) { - $row[$i + $position] = $content; - } - } - } - } - - $lengths[] = $this->getCellWidth($row, $column); - } - } - - $this->effectiveColumnWidths[$column] = max($lengths) + Helper::width($this->style->getCellRowContentFormat()) - 2; - } - } - - private function getColumnSeparatorWidth(): int - { - return Helper::width(sprintf($this->style->getBorderFormat(), $this->style->getBorderChars()[3])); - } - - private function getCellWidth(array $row, int $column): int - { - $cellWidth = 0; - - if (isset($row[$column])) { - $cell = $row[$column]; - $cellWidth = Helper::width(Helper::removeDecoration($this->output->getFormatter(), $cell)); - } - - $columnWidth = $this->columnWidths[$column] ?? 0; - $cellWidth = max($cellWidth, $columnWidth); - - return isset($this->columnMaxWidths[$column]) ? min($this->columnMaxWidths[$column], $cellWidth) : $cellWidth; - } - - /** - * Called after rendering to cleanup cache data. - */ - private function cleanup() - { - $this->effectiveColumnWidths = []; - unset($this->numberOfColumns); - } - - /** - * @return array - */ - private static function initStyles(): array - { - $borderless = new TableStyle(); - $borderless - ->setHorizontalBorderChars('=') - ->setVerticalBorderChars(' ') - ->setDefaultCrossingChar(' ') - ; - - $compact = new TableStyle(); - $compact - ->setHorizontalBorderChars('') - ->setVerticalBorderChars('') - ->setDefaultCrossingChar('') - ->setCellRowContentFormat('%s ') - ; - - $styleGuide = new TableStyle(); - $styleGuide - ->setHorizontalBorderChars('-') - ->setVerticalBorderChars(' ') - ->setDefaultCrossingChar(' ') - ->setCellHeaderFormat('%s') - ; - - $box = (new TableStyle()) - ->setHorizontalBorderChars('─') - ->setVerticalBorderChars('│') - ->setCrossingChars('┼', '┌', '┬', '┐', '┤', '┘', '┴', '└', '├') - ; - - $boxDouble = (new TableStyle()) - ->setHorizontalBorderChars('═', '─') - ->setVerticalBorderChars('║', '│') - ->setCrossingChars('┼', '╔', '╤', '╗', '╢', '╝', '╧', '╚', '╟', '╠', '╪', '╣') - ; - - return [ - 'default' => new TableStyle(), - 'borderless' => $borderless, - 'compact' => $compact, - 'symfony-style-guide' => $styleGuide, - 'box' => $box, - 'box-double' => $boxDouble, - ]; - } - - private function resolveStyle(TableStyle|string $name): TableStyle - { - if ($name instanceof TableStyle) { - return $name; - } - - return self::$styles[$name] ?? throw new InvalidArgumentException(sprintf('Style "%s" is not defined.', $name)); - } -} diff --git a/vendor/symfony/console/Helper/TableCell.php b/vendor/symfony/console/Helper/TableCell.php deleted file mode 100644 index 394b2bc9..00000000 --- a/vendor/symfony/console/Helper/TableCell.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Exception\InvalidArgumentException; - -/** - * @author Abdellatif Ait boudad - */ -class TableCell -{ - private string $value; - private array $options = [ - 'rowspan' => 1, - 'colspan' => 1, - 'style' => null, - ]; - - public function __construct(string $value = '', array $options = []) - { - $this->value = $value; - - // check option names - if ($diff = array_diff(array_keys($options), array_keys($this->options))) { - throw new InvalidArgumentException(sprintf('The TableCell does not support the following options: \'%s\'.', implode('\', \'', $diff))); - } - - if (isset($options['style']) && !$options['style'] instanceof TableCellStyle) { - throw new InvalidArgumentException('The style option must be an instance of "TableCellStyle".'); - } - - $this->options = array_merge($this->options, $options); - } - - /** - * Returns the cell value. - */ - public function __toString(): string - { - return $this->value; - } - - /** - * Gets number of colspan. - */ - public function getColspan(): int - { - return (int) $this->options['colspan']; - } - - /** - * Gets number of rowspan. - */ - public function getRowspan(): int - { - return (int) $this->options['rowspan']; - } - - public function getStyle(): ?TableCellStyle - { - return $this->options['style']; - } -} diff --git a/vendor/symfony/console/Helper/TableCellStyle.php b/vendor/symfony/console/Helper/TableCellStyle.php deleted file mode 100644 index 65ae9e72..00000000 --- a/vendor/symfony/console/Helper/TableCellStyle.php +++ /dev/null @@ -1,86 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Exception\InvalidArgumentException; - -/** - * @author Yewhen Khoptynskyi - */ -class TableCellStyle -{ - public const DEFAULT_ALIGN = 'left'; - - private const TAG_OPTIONS = [ - 'fg', - 'bg', - 'options', - ]; - - private const ALIGN_MAP = [ - 'left' => \STR_PAD_RIGHT, - 'center' => \STR_PAD_BOTH, - 'right' => \STR_PAD_LEFT, - ]; - - private array $options = [ - 'fg' => 'default', - 'bg' => 'default', - 'options' => null, - 'align' => self::DEFAULT_ALIGN, - 'cellFormat' => null, - ]; - - public function __construct(array $options = []) - { - if ($diff = array_diff(array_keys($options), array_keys($this->options))) { - throw new InvalidArgumentException(sprintf('The TableCellStyle does not support the following options: \'%s\'.', implode('\', \'', $diff))); - } - - if (isset($options['align']) && !\array_key_exists($options['align'], self::ALIGN_MAP)) { - throw new InvalidArgumentException(sprintf('Wrong align value. Value must be following: \'%s\'.', implode('\', \'', array_keys(self::ALIGN_MAP)))); - } - - $this->options = array_merge($this->options, $options); - } - - public function getOptions(): array - { - return $this->options; - } - - /** - * Gets options we need for tag for example fg, bg. - * - * @return string[] - */ - public function getTagOptions(): array - { - return array_filter( - $this->getOptions(), - function ($key) { - return \in_array($key, self::TAG_OPTIONS) && isset($this->options[$key]); - }, - \ARRAY_FILTER_USE_KEY - ); - } - - public function getPadByAlign(): int - { - return self::ALIGN_MAP[$this->getOptions()['align']]; - } - - public function getCellFormat(): ?string - { - return $this->getOptions()['cellFormat']; - } -} diff --git a/vendor/symfony/console/Helper/TableRows.php b/vendor/symfony/console/Helper/TableRows.php deleted file mode 100644 index 97d07726..00000000 --- a/vendor/symfony/console/Helper/TableRows.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\Console\Helper; - -/** - * @internal - */ -class TableRows implements \IteratorAggregate -{ - private \Closure $generator; - - public function __construct(\Closure $generator) - { - $this->generator = $generator; - } - - public function getIterator(): \Traversable - { - return ($this->generator)(); - } -} diff --git a/vendor/symfony/console/Helper/TableSeparator.php b/vendor/symfony/console/Helper/TableSeparator.php deleted file mode 100644 index e541c531..00000000 --- a/vendor/symfony/console/Helper/TableSeparator.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\Console\Helper; - -/** - * Marks a row as being a separator. - * - * @author Fabien Potencier - */ -class TableSeparator extends TableCell -{ - public function __construct(array $options = []) - { - parent::__construct('', $options); - } -} diff --git a/vendor/symfony/console/Helper/TableStyle.php b/vendor/symfony/console/Helper/TableStyle.php deleted file mode 100644 index bbad98e7..00000000 --- a/vendor/symfony/console/Helper/TableStyle.php +++ /dev/null @@ -1,362 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\LogicException; - -/** - * Defines the styles for a Table. - * - * @author Fabien Potencier - * @author Саша Стаменковић - * @author Dany Maillard - */ -class TableStyle -{ - private string $paddingChar = ' '; - private string $horizontalOutsideBorderChar = '-'; - private string $horizontalInsideBorderChar = '-'; - private string $verticalOutsideBorderChar = '|'; - private string $verticalInsideBorderChar = '|'; - private string $crossingChar = '+'; - private string $crossingTopRightChar = '+'; - private string $crossingTopMidChar = '+'; - private string $crossingTopLeftChar = '+'; - private string $crossingMidRightChar = '+'; - private string $crossingBottomRightChar = '+'; - private string $crossingBottomMidChar = '+'; - private string $crossingBottomLeftChar = '+'; - private string $crossingMidLeftChar = '+'; - private string $crossingTopLeftBottomChar = '+'; - private string $crossingTopMidBottomChar = '+'; - private string $crossingTopRightBottomChar = '+'; - private string $headerTitleFormat = ' %s '; - private string $footerTitleFormat = ' %s '; - private string $cellHeaderFormat = '%s'; - private string $cellRowFormat = '%s'; - private string $cellRowContentFormat = ' %s '; - private string $borderFormat = '%s'; - private int $padType = \STR_PAD_RIGHT; - - /** - * Sets padding character, used for cell padding. - * - * @return $this - */ - public function setPaddingChar(string $paddingChar): static - { - if (!$paddingChar) { - throw new LogicException('The padding char must not be empty.'); - } - - $this->paddingChar = $paddingChar; - - return $this; - } - - /** - * Gets padding character, used for cell padding. - */ - public function getPaddingChar(): string - { - return $this->paddingChar; - } - - /** - * Sets horizontal border characters. - * - * - * ╔═══════════════╤══════════════════════════╤══════════════════╗ - * 1 ISBN 2 Title │ Author ║ - * ╠═══════════════╪══════════════════════════╪══════════════════╣ - * ║ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri ║ - * ║ 9971-5-0210-0 │ A Tale of Two Cities │ Charles Dickens ║ - * ║ 960-425-059-0 │ The Lord of the Rings │ J. R. R. Tolkien ║ - * ║ 80-902734-1-6 │ And Then There Were None │ Agatha Christie ║ - * ╚═══════════════╧══════════════════════════╧══════════════════╝ - * - * - * @return $this - */ - public function setHorizontalBorderChars(string $outside, string $inside = null): static - { - $this->horizontalOutsideBorderChar = $outside; - $this->horizontalInsideBorderChar = $inside ?? $outside; - - return $this; - } - - /** - * Sets vertical border characters. - * - * - * ╔═══════════════╤══════════════════════════╤══════════════════╗ - * ║ ISBN │ Title │ Author ║ - * ╠═══════1═══════╪══════════════════════════╪══════════════════╣ - * ║ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri ║ - * ║ 9971-5-0210-0 │ A Tale of Two Cities │ Charles Dickens ║ - * ╟───────2───────┼──────────────────────────┼──────────────────╢ - * ║ 960-425-059-0 │ The Lord of the Rings │ J. R. R. Tolkien ║ - * ║ 80-902734-1-6 │ And Then There Were None │ Agatha Christie ║ - * ╚═══════════════╧══════════════════════════╧══════════════════╝ - * - * - * @return $this - */ - public function setVerticalBorderChars(string $outside, string $inside = null): static - { - $this->verticalOutsideBorderChar = $outside; - $this->verticalInsideBorderChar = $inside ?? $outside; - - return $this; - } - - /** - * Gets border characters. - * - * @internal - */ - public function getBorderChars(): array - { - return [ - $this->horizontalOutsideBorderChar, - $this->verticalOutsideBorderChar, - $this->horizontalInsideBorderChar, - $this->verticalInsideBorderChar, - ]; - } - - /** - * Sets crossing characters. - * - * Example: - * - * 1═══════════════2══════════════════════════2══════════════════3 - * ║ ISBN │ Title │ Author ║ - * 8'══════════════0'═════════════════════════0'═════════════════4' - * ║ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri ║ - * ║ 9971-5-0210-0 │ A Tale of Two Cities │ Charles Dickens ║ - * 8───────────────0──────────────────────────0──────────────────4 - * ║ 960-425-059-0 │ The Lord of the Rings │ J. R. R. Tolkien ║ - * ║ 80-902734-1-6 │ And Then There Were None │ Agatha Christie ║ - * 7═══════════════6══════════════════════════6══════════════════5 - * - * - * @param string $cross Crossing char (see #0 of example) - * @param string $topLeft Top left char (see #1 of example) - * @param string $topMid Top mid char (see #2 of example) - * @param string $topRight Top right char (see #3 of example) - * @param string $midRight Mid right char (see #4 of example) - * @param string $bottomRight Bottom right char (see #5 of example) - * @param string $bottomMid Bottom mid char (see #6 of example) - * @param string $bottomLeft Bottom left char (see #7 of example) - * @param string $midLeft Mid left char (see #8 of example) - * @param string|null $topLeftBottom Top left bottom char (see #8' of example), equals to $midLeft if null - * @param string|null $topMidBottom Top mid bottom char (see #0' of example), equals to $cross if null - * @param string|null $topRightBottom Top right bottom char (see #4' of example), equals to $midRight if null - * - * @return $this - */ - public function setCrossingChars(string $cross, string $topLeft, string $topMid, string $topRight, string $midRight, string $bottomRight, string $bottomMid, string $bottomLeft, string $midLeft, string $topLeftBottom = null, string $topMidBottom = null, string $topRightBottom = null): static - { - $this->crossingChar = $cross; - $this->crossingTopLeftChar = $topLeft; - $this->crossingTopMidChar = $topMid; - $this->crossingTopRightChar = $topRight; - $this->crossingMidRightChar = $midRight; - $this->crossingBottomRightChar = $bottomRight; - $this->crossingBottomMidChar = $bottomMid; - $this->crossingBottomLeftChar = $bottomLeft; - $this->crossingMidLeftChar = $midLeft; - $this->crossingTopLeftBottomChar = $topLeftBottom ?? $midLeft; - $this->crossingTopMidBottomChar = $topMidBottom ?? $cross; - $this->crossingTopRightBottomChar = $topRightBottom ?? $midRight; - - return $this; - } - - /** - * Sets default crossing character used for each cross. - * - * @see {@link setCrossingChars()} for setting each crossing individually. - */ - public function setDefaultCrossingChar(string $char): self - { - return $this->setCrossingChars($char, $char, $char, $char, $char, $char, $char, $char, $char); - } - - /** - * Gets crossing character. - */ - public function getCrossingChar(): string - { - return $this->crossingChar; - } - - /** - * Gets crossing characters. - * - * @internal - */ - public function getCrossingChars(): array - { - return [ - $this->crossingChar, - $this->crossingTopLeftChar, - $this->crossingTopMidChar, - $this->crossingTopRightChar, - $this->crossingMidRightChar, - $this->crossingBottomRightChar, - $this->crossingBottomMidChar, - $this->crossingBottomLeftChar, - $this->crossingMidLeftChar, - $this->crossingTopLeftBottomChar, - $this->crossingTopMidBottomChar, - $this->crossingTopRightBottomChar, - ]; - } - - /** - * Sets header cell format. - * - * @return $this - */ - public function setCellHeaderFormat(string $cellHeaderFormat): static - { - $this->cellHeaderFormat = $cellHeaderFormat; - - return $this; - } - - /** - * Gets header cell format. - */ - public function getCellHeaderFormat(): string - { - return $this->cellHeaderFormat; - } - - /** - * Sets row cell format. - * - * @return $this - */ - public function setCellRowFormat(string $cellRowFormat): static - { - $this->cellRowFormat = $cellRowFormat; - - return $this; - } - - /** - * Gets row cell format. - */ - public function getCellRowFormat(): string - { - return $this->cellRowFormat; - } - - /** - * Sets row cell content format. - * - * @return $this - */ - public function setCellRowContentFormat(string $cellRowContentFormat): static - { - $this->cellRowContentFormat = $cellRowContentFormat; - - return $this; - } - - /** - * Gets row cell content format. - */ - public function getCellRowContentFormat(): string - { - return $this->cellRowContentFormat; - } - - /** - * Sets table border format. - * - * @return $this - */ - public function setBorderFormat(string $borderFormat): static - { - $this->borderFormat = $borderFormat; - - return $this; - } - - /** - * Gets table border format. - */ - public function getBorderFormat(): string - { - return $this->borderFormat; - } - - /** - * Sets cell padding type. - * - * @return $this - */ - public function setPadType(int $padType): static - { - if (!\in_array($padType, [\STR_PAD_LEFT, \STR_PAD_RIGHT, \STR_PAD_BOTH], true)) { - throw new InvalidArgumentException('Invalid padding type. Expected one of (STR_PAD_LEFT, STR_PAD_RIGHT, STR_PAD_BOTH).'); - } - - $this->padType = $padType; - - return $this; - } - - /** - * Gets cell padding type. - */ - public function getPadType(): int - { - return $this->padType; - } - - public function getHeaderTitleFormat(): string - { - return $this->headerTitleFormat; - } - - /** - * @return $this - */ - public function setHeaderTitleFormat(string $format): static - { - $this->headerTitleFormat = $format; - - return $this; - } - - public function getFooterTitleFormat(): string - { - return $this->footerTitleFormat; - } - - /** - * @return $this - */ - public function setFooterTitleFormat(string $format): static - { - $this->footerTitleFormat = $format; - - return $this; - } -} diff --git a/vendor/symfony/console/Input/ArgvInput.php b/vendor/symfony/console/Input/ArgvInput.php deleted file mode 100644 index c0c28bb5..00000000 --- a/vendor/symfony/console/Input/ArgvInput.php +++ /dev/null @@ -1,364 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Exception\RuntimeException; - -/** - * ArgvInput represents an input coming from the CLI arguments. - * - * Usage: - * - * $input = new ArgvInput(); - * - * By default, the `$_SERVER['argv']` array is used for the input values. - * - * This can be overridden by explicitly passing the input values in the constructor: - * - * $input = new ArgvInput($_SERVER['argv']); - * - * If you pass it yourself, don't forget that the first element of the array - * is the name of the running application. - * - * When passing an argument to the constructor, be sure that it respects - * the same rules as the argv one. It's almost always better to use the - * `StringInput` when you want to provide your own input. - * - * @author Fabien Potencier - * - * @see http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html - * @see http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html#tag_12_02 - */ -class ArgvInput extends Input -{ - private array $tokens; - private array $parsed; - - public function __construct(array $argv = null, InputDefinition $definition = null) - { - $argv ??= $_SERVER['argv'] ?? []; - - // strip the application name - array_shift($argv); - - $this->tokens = $argv; - - parent::__construct($definition); - } - - protected function setTokens(array $tokens) - { - $this->tokens = $tokens; - } - - protected function parse() - { - $parseOptions = true; - $this->parsed = $this->tokens; - while (null !== $token = array_shift($this->parsed)) { - $parseOptions = $this->parseToken($token, $parseOptions); - } - } - - protected function parseToken(string $token, bool $parseOptions): bool - { - if ($parseOptions && '' == $token) { - $this->parseArgument($token); - } elseif ($parseOptions && '--' == $token) { - return false; - } elseif ($parseOptions && str_starts_with($token, '--')) { - $this->parseLongOption($token); - } elseif ($parseOptions && '-' === $token[0] && '-' !== $token) { - $this->parseShortOption($token); - } else { - $this->parseArgument($token); - } - - return $parseOptions; - } - - /** - * Parses a short option. - */ - private function parseShortOption(string $token) - { - $name = substr($token, 1); - - if (\strlen($name) > 1) { - if ($this->definition->hasShortcut($name[0]) && $this->definition->getOptionForShortcut($name[0])->acceptValue()) { - // an option with a value (with no space) - $this->addShortOption($name[0], substr($name, 1)); - } else { - $this->parseShortOptionSet($name); - } - } else { - $this->addShortOption($name, null); - } - } - - /** - * Parses a short option set. - * - * @throws RuntimeException When option given doesn't exist - */ - private function parseShortOptionSet(string $name) - { - $len = \strlen($name); - for ($i = 0; $i < $len; ++$i) { - if (!$this->definition->hasShortcut($name[$i])) { - $encoding = mb_detect_encoding($name, null, true); - throw new RuntimeException(sprintf('The "-%s" option does not exist.', false === $encoding ? $name[$i] : mb_substr($name, $i, 1, $encoding))); - } - - $option = $this->definition->getOptionForShortcut($name[$i]); - if ($option->acceptValue()) { - $this->addLongOption($option->getName(), $i === $len - 1 ? null : substr($name, $i + 1)); - - break; - } else { - $this->addLongOption($option->getName(), null); - } - } - } - - /** - * Parses a long option. - */ - private function parseLongOption(string $token) - { - $name = substr($token, 2); - - if (false !== $pos = strpos($name, '=')) { - if ('' === $value = substr($name, $pos + 1)) { - array_unshift($this->parsed, $value); - } - $this->addLongOption(substr($name, 0, $pos), $value); - } else { - $this->addLongOption($name, null); - } - } - - /** - * Parses an argument. - * - * @throws RuntimeException When too many arguments are given - */ - private function parseArgument(string $token) - { - $c = \count($this->arguments); - - // if input is expecting another argument, add it - if ($this->definition->hasArgument($c)) { - $arg = $this->definition->getArgument($c); - $this->arguments[$arg->getName()] = $arg->isArray() ? [$token] : $token; - - // if last argument isArray(), append token to last argument - } elseif ($this->definition->hasArgument($c - 1) && $this->definition->getArgument($c - 1)->isArray()) { - $arg = $this->definition->getArgument($c - 1); - $this->arguments[$arg->getName()][] = $token; - - // unexpected argument - } else { - $all = $this->definition->getArguments(); - $symfonyCommandName = null; - if (($inputArgument = $all[$key = array_key_first($all)] ?? null) && 'command' === $inputArgument->getName()) { - $symfonyCommandName = $this->arguments['command'] ?? null; - unset($all[$key]); - } - - if (\count($all)) { - if ($symfonyCommandName) { - $message = sprintf('Too many arguments to "%s" command, expected arguments "%s".', $symfonyCommandName, implode('" "', array_keys($all))); - } else { - $message = sprintf('Too many arguments, expected arguments "%s".', implode('" "', array_keys($all))); - } - } elseif ($symfonyCommandName) { - $message = sprintf('No arguments expected for "%s" command, got "%s".', $symfonyCommandName, $token); - } else { - $message = sprintf('No arguments expected, got "%s".', $token); - } - - throw new RuntimeException($message); - } - } - - /** - * Adds a short option value. - * - * @throws RuntimeException When option given doesn't exist - */ - private function addShortOption(string $shortcut, mixed $value) - { - if (!$this->definition->hasShortcut($shortcut)) { - throw new RuntimeException(sprintf('The "-%s" option does not exist.', $shortcut)); - } - - $this->addLongOption($this->definition->getOptionForShortcut($shortcut)->getName(), $value); - } - - /** - * Adds a long option value. - * - * @throws RuntimeException When option given doesn't exist - */ - private function addLongOption(string $name, mixed $value) - { - if (!$this->definition->hasOption($name)) { - if (!$this->definition->hasNegation($name)) { - throw new RuntimeException(sprintf('The "--%s" option does not exist.', $name)); - } - - $optionName = $this->definition->negationToName($name); - if (null !== $value) { - throw new RuntimeException(sprintf('The "--%s" option does not accept a value.', $name)); - } - $this->options[$optionName] = false; - - return; - } - - $option = $this->definition->getOption($name); - - if (null !== $value && !$option->acceptValue()) { - throw new RuntimeException(sprintf('The "--%s" option does not accept a value.', $name)); - } - - if (\in_array($value, ['', null], true) && $option->acceptValue() && \count($this->parsed)) { - // if option accepts an optional or mandatory argument - // let's see if there is one provided - $next = array_shift($this->parsed); - if ((isset($next[0]) && '-' !== $next[0]) || \in_array($next, ['', null], true)) { - $value = $next; - } else { - array_unshift($this->parsed, $next); - } - } - - if (null === $value) { - if ($option->isValueRequired()) { - throw new RuntimeException(sprintf('The "--%s" option requires a value.', $name)); - } - - if (!$option->isArray() && !$option->isValueOptional()) { - $value = true; - } - } - - if ($option->isArray()) { - $this->options[$name][] = $value; - } else { - $this->options[$name] = $value; - } - } - - public function getFirstArgument(): ?string - { - $isOption = false; - foreach ($this->tokens as $i => $token) { - if ($token && '-' === $token[0]) { - if (str_contains($token, '=') || !isset($this->tokens[$i + 1])) { - continue; - } - - // If it's a long option, consider that everything after "--" is the option name. - // Otherwise, use the last char (if it's a short option set, only the last one can take a value with space separator) - $name = '-' === $token[1] ? substr($token, 2) : substr($token, -1); - if (!isset($this->options[$name]) && !$this->definition->hasShortcut($name)) { - // noop - } elseif ((isset($this->options[$name]) || isset($this->options[$name = $this->definition->shortcutToName($name)])) && $this->tokens[$i + 1] === $this->options[$name]) { - $isOption = true; - } - - continue; - } - - if ($isOption) { - $isOption = false; - continue; - } - - return $token; - } - - return null; - } - - public function hasParameterOption(string|array $values, bool $onlyParams = false): bool - { - $values = (array) $values; - - foreach ($this->tokens as $token) { - if ($onlyParams && '--' === $token) { - return false; - } - foreach ($values as $value) { - // Options with values: - // For long options, test for '--option=' at beginning - // For short options, test for '-o' at beginning - $leading = str_starts_with($value, '--') ? $value.'=' : $value; - if ($token === $value || '' !== $leading && str_starts_with($token, $leading)) { - return true; - } - } - } - - return false; - } - - public function getParameterOption(string|array $values, string|bool|int|float|array|null $default = false, bool $onlyParams = false): mixed - { - $values = (array) $values; - $tokens = $this->tokens; - - while (0 < \count($tokens)) { - $token = array_shift($tokens); - if ($onlyParams && '--' === $token) { - return $default; - } - - foreach ($values as $value) { - if ($token === $value) { - return array_shift($tokens); - } - // Options with values: - // For long options, test for '--option=' at beginning - // For short options, test for '-o' at beginning - $leading = str_starts_with($value, '--') ? $value.'=' : $value; - if ('' !== $leading && str_starts_with($token, $leading)) { - return substr($token, \strlen($leading)); - } - } - } - - return $default; - } - - /** - * Returns a stringified representation of the args passed to the command. - */ - public function __toString(): string - { - $tokens = array_map(function ($token) { - if (preg_match('{^(-[^=]+=)(.+)}', $token, $match)) { - return $match[1].$this->escapeToken($match[2]); - } - - if ($token && '-' !== $token[0]) { - return $this->escapeToken($token); - } - - return $token; - }, $this->tokens); - - return implode(' ', $tokens); - } -} diff --git a/vendor/symfony/console/Input/ArrayInput.php b/vendor/symfony/console/Input/ArrayInput.php deleted file mode 100644 index 02fb4e8e..00000000 --- a/vendor/symfony/console/Input/ArrayInput.php +++ /dev/null @@ -1,193 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\InvalidOptionException; - -/** - * ArrayInput represents an input provided as an array. - * - * Usage: - * - * $input = new ArrayInput(['command' => 'foo:bar', 'foo' => 'bar', '--bar' => 'foobar']); - * - * @author Fabien Potencier - */ -class ArrayInput extends Input -{ - private array $parameters; - - public function __construct(array $parameters, InputDefinition $definition = null) - { - $this->parameters = $parameters; - - parent::__construct($definition); - } - - public function getFirstArgument(): ?string - { - foreach ($this->parameters as $param => $value) { - if ($param && \is_string($param) && '-' === $param[0]) { - continue; - } - - return $value; - } - - return null; - } - - public function hasParameterOption(string|array $values, bool $onlyParams = false): bool - { - $values = (array) $values; - - foreach ($this->parameters as $k => $v) { - if (!\is_int($k)) { - $v = $k; - } - - if ($onlyParams && '--' === $v) { - return false; - } - - if (\in_array($v, $values)) { - return true; - } - } - - return false; - } - - public function getParameterOption(string|array $values, string|bool|int|float|array|null $default = false, bool $onlyParams = false): mixed - { - $values = (array) $values; - - foreach ($this->parameters as $k => $v) { - if ($onlyParams && ('--' === $k || (\is_int($k) && '--' === $v))) { - return $default; - } - - if (\is_int($k)) { - if (\in_array($v, $values)) { - return true; - } - } elseif (\in_array($k, $values)) { - return $v; - } - } - - return $default; - } - - /** - * Returns a stringified representation of the args passed to the command. - */ - public function __toString(): string - { - $params = []; - foreach ($this->parameters as $param => $val) { - if ($param && \is_string($param) && '-' === $param[0]) { - $glue = ('-' === $param[1]) ? '=' : ' '; - if (\is_array($val)) { - foreach ($val as $v) { - $params[] = $param.('' != $v ? $glue.$this->escapeToken($v) : ''); - } - } else { - $params[] = $param.('' != $val ? $glue.$this->escapeToken($val) : ''); - } - } else { - $params[] = \is_array($val) ? implode(' ', array_map($this->escapeToken(...), $val)) : $this->escapeToken($val); - } - } - - return implode(' ', $params); - } - - protected function parse() - { - foreach ($this->parameters as $key => $value) { - if ('--' === $key) { - return; - } - if (str_starts_with($key, '--')) { - $this->addLongOption(substr($key, 2), $value); - } elseif (str_starts_with($key, '-')) { - $this->addShortOption(substr($key, 1), $value); - } else { - $this->addArgument($key, $value); - } - } - } - - /** - * Adds a short option value. - * - * @throws InvalidOptionException When option given doesn't exist - */ - private function addShortOption(string $shortcut, mixed $value) - { - if (!$this->definition->hasShortcut($shortcut)) { - throw new InvalidOptionException(sprintf('The "-%s" option does not exist.', $shortcut)); - } - - $this->addLongOption($this->definition->getOptionForShortcut($shortcut)->getName(), $value); - } - - /** - * Adds a long option value. - * - * @throws InvalidOptionException When option given doesn't exist - * @throws InvalidOptionException When a required value is missing - */ - private function addLongOption(string $name, mixed $value) - { - if (!$this->definition->hasOption($name)) { - if (!$this->definition->hasNegation($name)) { - throw new InvalidOptionException(sprintf('The "--%s" option does not exist.', $name)); - } - - $optionName = $this->definition->negationToName($name); - $this->options[$optionName] = false; - - return; - } - - $option = $this->definition->getOption($name); - - if (null === $value) { - if ($option->isValueRequired()) { - throw new InvalidOptionException(sprintf('The "--%s" option requires a value.', $name)); - } - - if (!$option->isValueOptional()) { - $value = true; - } - } - - $this->options[$name] = $value; - } - - /** - * Adds an argument value. - * - * @throws InvalidArgumentException When argument given doesn't exist - */ - private function addArgument(string|int $name, mixed $value) - { - if (!$this->definition->hasArgument($name)) { - throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); - } - - $this->arguments[$name] = $value; - } -} diff --git a/vendor/symfony/console/Input/Input.php b/vendor/symfony/console/Input/Input.php deleted file mode 100644 index 7b90713c..00000000 --- a/vendor/symfony/console/Input/Input.php +++ /dev/null @@ -1,169 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\RuntimeException; - -/** - * Input is the base class for all concrete Input classes. - * - * Three concrete classes are provided by default: - * - * * `ArgvInput`: The input comes from the CLI arguments (argv) - * * `StringInput`: The input is provided as a string - * * `ArrayInput`: The input is provided as an array - * - * @author Fabien Potencier - */ -abstract class Input implements InputInterface, StreamableInputInterface -{ - protected $definition; - protected $stream; - protected $options = []; - protected $arguments = []; - protected $interactive = true; - - public function __construct(InputDefinition $definition = null) - { - if (null === $definition) { - $this->definition = new InputDefinition(); - } else { - $this->bind($definition); - $this->validate(); - } - } - - public function bind(InputDefinition $definition) - { - $this->arguments = []; - $this->options = []; - $this->definition = $definition; - - $this->parse(); - } - - /** - * Processes command line arguments. - */ - abstract protected function parse(); - - public function validate() - { - $definition = $this->definition; - $givenArguments = $this->arguments; - - $missingArguments = array_filter(array_keys($definition->getArguments()), function ($argument) use ($definition, $givenArguments) { - return !\array_key_exists($argument, $givenArguments) && $definition->getArgument($argument)->isRequired(); - }); - - if (\count($missingArguments) > 0) { - throw new RuntimeException(sprintf('Not enough arguments (missing: "%s").', implode(', ', $missingArguments))); - } - } - - public function isInteractive(): bool - { - return $this->interactive; - } - - public function setInteractive(bool $interactive) - { - $this->interactive = $interactive; - } - - public function getArguments(): array - { - return array_merge($this->definition->getArgumentDefaults(), $this->arguments); - } - - public function getArgument(string $name): mixed - { - if (!$this->definition->hasArgument($name)) { - throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); - } - - return $this->arguments[$name] ?? $this->definition->getArgument($name)->getDefault(); - } - - public function setArgument(string $name, mixed $value) - { - if (!$this->definition->hasArgument($name)) { - throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); - } - - $this->arguments[$name] = $value; - } - - public function hasArgument(string $name): bool - { - return $this->definition->hasArgument($name); - } - - public function getOptions(): array - { - return array_merge($this->definition->getOptionDefaults(), $this->options); - } - - public function getOption(string $name): mixed - { - if ($this->definition->hasNegation($name)) { - if (null === $value = $this->getOption($this->definition->negationToName($name))) { - return $value; - } - - return !$value; - } - - if (!$this->definition->hasOption($name)) { - throw new InvalidArgumentException(sprintf('The "%s" option does not exist.', $name)); - } - - return \array_key_exists($name, $this->options) ? $this->options[$name] : $this->definition->getOption($name)->getDefault(); - } - - public function setOption(string $name, mixed $value) - { - if ($this->definition->hasNegation($name)) { - $this->options[$this->definition->negationToName($name)] = !$value; - - return; - } elseif (!$this->definition->hasOption($name)) { - throw new InvalidArgumentException(sprintf('The "%s" option does not exist.', $name)); - } - - $this->options[$name] = $value; - } - - public function hasOption(string $name): bool - { - return $this->definition->hasOption($name) || $this->definition->hasNegation($name); - } - - /** - * Escapes a token through escapeshellarg if it contains unsafe chars. - */ - public function escapeToken(string $token): string - { - return preg_match('{^[\w-]+$}', $token) ? $token : escapeshellarg($token); - } - - public function setStream($stream) - { - $this->stream = $stream; - } - - public function getStream() - { - return $this->stream; - } -} diff --git a/vendor/symfony/console/Input/InputArgument.php b/vendor/symfony/console/Input/InputArgument.php deleted file mode 100644 index f0867193..00000000 --- a/vendor/symfony/console/Input/InputArgument.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\Console\Input; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Completion\Suggestion; -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\LogicException; - -/** - * Represents a command line argument. - * - * @author Fabien Potencier - */ -class InputArgument -{ - public const REQUIRED = 1; - public const OPTIONAL = 2; - public const IS_ARRAY = 4; - - private string $name; - private int $mode; - private string|int|bool|array|null|float $default; - private array|\Closure $suggestedValues; - private string $description; - - /** - * @param string $name The argument name - * @param int|null $mode The argument mode: self::REQUIRED or self::OPTIONAL - * @param string $description A description text - * @param string|bool|int|float|array|null $default The default value (for self::OPTIONAL mode only) - * @param array|\Closure(CompletionInput,CompletionSuggestions):list $suggestedValues The values used for input completion - * - * @throws InvalidArgumentException When argument mode is not valid - */ - public function __construct(string $name, int $mode = null, string $description = '', string|bool|int|float|array $default = null, \Closure|array $suggestedValues = []) - { - if (null === $mode) { - $mode = self::OPTIONAL; - } elseif ($mode > 7 || $mode < 1) { - throw new InvalidArgumentException(sprintf('Argument mode "%s" is not valid.', $mode)); - } - - $this->name = $name; - $this->mode = $mode; - $this->description = $description; - $this->suggestedValues = $suggestedValues; - - $this->setDefault($default); - } - - /** - * Returns the argument name. - */ - public function getName(): string - { - return $this->name; - } - - /** - * Returns true if the argument is required. - * - * @return bool true if parameter mode is self::REQUIRED, false otherwise - */ - public function isRequired(): bool - { - return self::REQUIRED === (self::REQUIRED & $this->mode); - } - - /** - * Returns true if the argument can take multiple values. - * - * @return bool true if mode is self::IS_ARRAY, false otherwise - */ - public function isArray(): bool - { - return self::IS_ARRAY === (self::IS_ARRAY & $this->mode); - } - - /** - * Sets the default value. - * - * @throws LogicException When incorrect default value is given - */ - public function setDefault(string|bool|int|float|array $default = null) - { - if (1 > \func_num_args()) { - trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); - } - if ($this->isRequired() && null !== $default) { - throw new LogicException('Cannot set a default value except for InputArgument::OPTIONAL mode.'); - } - - if ($this->isArray()) { - if (null === $default) { - $default = []; - } elseif (!\is_array($default)) { - throw new LogicException('A default value for an array argument must be an array.'); - } - } - - $this->default = $default; - } - - /** - * Returns the default value. - */ - public function getDefault(): string|bool|int|float|array|null - { - return $this->default; - } - - public function hasCompletion(): bool - { - return [] !== $this->suggestedValues; - } - - /** - * Adds suggestions to $suggestions for the current completion input. - * - * @see Command::complete() - */ - public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void - { - $values = $this->suggestedValues; - if ($values instanceof \Closure && !\is_array($values = $values($input))) { - throw new LogicException(sprintf('Closure for argument "%s" must return an array. Got "%s".', $this->name, get_debug_type($values))); - } - if ($values) { - $suggestions->suggestValues($values); - } - } - - /** - * Returns the description text. - */ - public function getDescription(): string - { - return $this->description; - } -} diff --git a/vendor/symfony/console/Input/InputAwareInterface.php b/vendor/symfony/console/Input/InputAwareInterface.php deleted file mode 100644 index 5a288de5..00000000 --- a/vendor/symfony/console/Input/InputAwareInterface.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\Console\Input; - -/** - * InputAwareInterface should be implemented by classes that depends on the - * Console Input. - * - * @author Wouter J - */ -interface InputAwareInterface -{ - /** - * Sets the Console Input. - */ - public function setInput(InputInterface $input); -} diff --git a/vendor/symfony/console/Input/InputDefinition.php b/vendor/symfony/console/Input/InputDefinition.php deleted file mode 100644 index f4b14a1c..00000000 --- a/vendor/symfony/console/Input/InputDefinition.php +++ /dev/null @@ -1,402 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\LogicException; - -/** - * A InputDefinition represents a set of valid command line arguments and options. - * - * Usage: - * - * $definition = new InputDefinition([ - * new InputArgument('name', InputArgument::REQUIRED), - * new InputOption('foo', 'f', InputOption::VALUE_REQUIRED), - * ]); - * - * @author Fabien Potencier - */ -class InputDefinition -{ - private array $arguments = []; - private int $requiredCount = 0; - private ?InputArgument $lastArrayArgument = null; - private ?InputArgument $lastOptionalArgument = null; - private array $options = []; - private array $negations = []; - private array $shortcuts = []; - - /** - * @param array $definition An array of InputArgument and InputOption instance - */ - public function __construct(array $definition = []) - { - $this->setDefinition($definition); - } - - /** - * Sets the definition of the input. - */ - public function setDefinition(array $definition) - { - $arguments = []; - $options = []; - foreach ($definition as $item) { - if ($item instanceof InputOption) { - $options[] = $item; - } else { - $arguments[] = $item; - } - } - - $this->setArguments($arguments); - $this->setOptions($options); - } - - /** - * Sets the InputArgument objects. - * - * @param InputArgument[] $arguments An array of InputArgument objects - */ - public function setArguments(array $arguments = []) - { - $this->arguments = []; - $this->requiredCount = 0; - $this->lastOptionalArgument = null; - $this->lastArrayArgument = null; - $this->addArguments($arguments); - } - - /** - * Adds an array of InputArgument objects. - * - * @param InputArgument[] $arguments An array of InputArgument objects - */ - public function addArguments(?array $arguments = []) - { - if (null !== $arguments) { - foreach ($arguments as $argument) { - $this->addArgument($argument); - } - } - } - - /** - * @throws LogicException When incorrect argument is given - */ - public function addArgument(InputArgument $argument) - { - if (isset($this->arguments[$argument->getName()])) { - throw new LogicException(sprintf('An argument with name "%s" already exists.', $argument->getName())); - } - - if (null !== $this->lastArrayArgument) { - throw new LogicException(sprintf('Cannot add a required argument "%s" after an array argument "%s".', $argument->getName(), $this->lastArrayArgument->getName())); - } - - if ($argument->isRequired() && null !== $this->lastOptionalArgument) { - throw new LogicException(sprintf('Cannot add a required argument "%s" after an optional one "%s".', $argument->getName(), $this->lastOptionalArgument->getName())); - } - - if ($argument->isArray()) { - $this->lastArrayArgument = $argument; - } - - if ($argument->isRequired()) { - ++$this->requiredCount; - } else { - $this->lastOptionalArgument = $argument; - } - - $this->arguments[$argument->getName()] = $argument; - } - - /** - * Returns an InputArgument by name or by position. - * - * @throws InvalidArgumentException When argument given doesn't exist - */ - public function getArgument(string|int $name): InputArgument - { - if (!$this->hasArgument($name)) { - throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); - } - - $arguments = \is_int($name) ? array_values($this->arguments) : $this->arguments; - - return $arguments[$name]; - } - - /** - * Returns true if an InputArgument object exists by name or position. - */ - public function hasArgument(string|int $name): bool - { - $arguments = \is_int($name) ? array_values($this->arguments) : $this->arguments; - - return isset($arguments[$name]); - } - - /** - * Gets the array of InputArgument objects. - * - * @return InputArgument[] - */ - public function getArguments(): array - { - return $this->arguments; - } - - /** - * Returns the number of InputArguments. - */ - public function getArgumentCount(): int - { - return null !== $this->lastArrayArgument ? \PHP_INT_MAX : \count($this->arguments); - } - - /** - * Returns the number of required InputArguments. - */ - public function getArgumentRequiredCount(): int - { - return $this->requiredCount; - } - - /** - * @return array - */ - public function getArgumentDefaults(): array - { - $values = []; - foreach ($this->arguments as $argument) { - $values[$argument->getName()] = $argument->getDefault(); - } - - return $values; - } - - /** - * Sets the InputOption objects. - * - * @param InputOption[] $options An array of InputOption objects - */ - public function setOptions(array $options = []) - { - $this->options = []; - $this->shortcuts = []; - $this->negations = []; - $this->addOptions($options); - } - - /** - * Adds an array of InputOption objects. - * - * @param InputOption[] $options An array of InputOption objects - */ - public function addOptions(array $options = []) - { - foreach ($options as $option) { - $this->addOption($option); - } - } - - /** - * @throws LogicException When option given already exist - */ - public function addOption(InputOption $option) - { - if (isset($this->options[$option->getName()]) && !$option->equals($this->options[$option->getName()])) { - throw new LogicException(sprintf('An option named "%s" already exists.', $option->getName())); - } - if (isset($this->negations[$option->getName()])) { - throw new LogicException(sprintf('An option named "%s" already exists.', $option->getName())); - } - - if ($option->getShortcut()) { - foreach (explode('|', $option->getShortcut()) as $shortcut) { - if (isset($this->shortcuts[$shortcut]) && !$option->equals($this->options[$this->shortcuts[$shortcut]])) { - throw new LogicException(sprintf('An option with shortcut "%s" already exists.', $shortcut)); - } - } - } - - $this->options[$option->getName()] = $option; - if ($option->getShortcut()) { - foreach (explode('|', $option->getShortcut()) as $shortcut) { - $this->shortcuts[$shortcut] = $option->getName(); - } - } - - if ($option->isNegatable()) { - $negatedName = 'no-'.$option->getName(); - if (isset($this->options[$negatedName])) { - throw new LogicException(sprintf('An option named "%s" already exists.', $negatedName)); - } - $this->negations[$negatedName] = $option->getName(); - } - } - - /** - * Returns an InputOption by name. - * - * @throws InvalidArgumentException When option given doesn't exist - */ - public function getOption(string $name): InputOption - { - if (!$this->hasOption($name)) { - throw new InvalidArgumentException(sprintf('The "--%s" option does not exist.', $name)); - } - - return $this->options[$name]; - } - - /** - * Returns true if an InputOption object exists by name. - * - * This method can't be used to check if the user included the option when - * executing the command (use getOption() instead). - */ - public function hasOption(string $name): bool - { - return isset($this->options[$name]); - } - - /** - * Gets the array of InputOption objects. - * - * @return InputOption[] - */ - public function getOptions(): array - { - return $this->options; - } - - /** - * Returns true if an InputOption object exists by shortcut. - */ - public function hasShortcut(string $name): bool - { - return isset($this->shortcuts[$name]); - } - - /** - * Returns true if an InputOption object exists by negated name. - */ - public function hasNegation(string $name): bool - { - return isset($this->negations[$name]); - } - - /** - * Gets an InputOption by shortcut. - */ - public function getOptionForShortcut(string $shortcut): InputOption - { - return $this->getOption($this->shortcutToName($shortcut)); - } - - /** - * @return array - */ - public function getOptionDefaults(): array - { - $values = []; - foreach ($this->options as $option) { - $values[$option->getName()] = $option->getDefault(); - } - - return $values; - } - - /** - * Returns the InputOption name given a shortcut. - * - * @throws InvalidArgumentException When option given does not exist - * - * @internal - */ - public function shortcutToName(string $shortcut): string - { - if (!isset($this->shortcuts[$shortcut])) { - throw new InvalidArgumentException(sprintf('The "-%s" option does not exist.', $shortcut)); - } - - return $this->shortcuts[$shortcut]; - } - - /** - * Returns the InputOption name given a negation. - * - * @throws InvalidArgumentException When option given does not exist - * - * @internal - */ - public function negationToName(string $negation): string - { - if (!isset($this->negations[$negation])) { - throw new InvalidArgumentException(sprintf('The "--%s" option does not exist.', $negation)); - } - - return $this->negations[$negation]; - } - - /** - * Gets the synopsis. - */ - public function getSynopsis(bool $short = false): string - { - $elements = []; - - if ($short && $this->getOptions()) { - $elements[] = '[options]'; - } elseif (!$short) { - foreach ($this->getOptions() as $option) { - $value = ''; - if ($option->acceptValue()) { - $value = sprintf( - ' %s%s%s', - $option->isValueOptional() ? '[' : '', - strtoupper($option->getName()), - $option->isValueOptional() ? ']' : '' - ); - } - - $shortcut = $option->getShortcut() ? sprintf('-%s|', $option->getShortcut()) : ''; - $negation = $option->isNegatable() ? sprintf('|--no-%s', $option->getName()) : ''; - $elements[] = sprintf('[%s--%s%s%s]', $shortcut, $option->getName(), $value, $negation); - } - } - - if (\count($elements) && $this->getArguments()) { - $elements[] = '[--]'; - } - - $tail = ''; - foreach ($this->getArguments() as $argument) { - $element = '<'.$argument->getName().'>'; - if ($argument->isArray()) { - $element .= '...'; - } - - if (!$argument->isRequired()) { - $element = '['.$element; - $tail .= ']'; - } - - $elements[] = $element; - } - - return implode(' ', $elements).$tail; - } -} diff --git a/vendor/symfony/console/Input/InputInterface.php b/vendor/symfony/console/Input/InputInterface.php deleted file mode 100644 index 3af991a7..00000000 --- a/vendor/symfony/console/Input/InputInterface.php +++ /dev/null @@ -1,140 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\RuntimeException; - -/** - * InputInterface is the interface implemented by all input classes. - * - * @author Fabien Potencier - * - * @method string __toString() Returns a stringified representation of the args passed to the command. - * InputArguments MUST be escaped as well as the InputOption values passed to the command. - */ -interface InputInterface -{ - /** - * Returns the first argument from the raw parameters (not parsed). - */ - public function getFirstArgument(): ?string; - - /** - * Returns true if the raw parameters (not parsed) contain a value. - * - * This method is to be used to introspect the input parameters - * before they have been validated. It must be used carefully. - * Does not necessarily return the correct result for short options - * when multiple flags are combined in the same option. - * - * @param string|array $values The values to look for in the raw parameters (can be an array) - * @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal - */ - public function hasParameterOption(string|array $values, bool $onlyParams = false): bool; - - /** - * Returns the value of a raw option (not parsed). - * - * This method is to be used to introspect the input parameters - * before they have been validated. It must be used carefully. - * Does not necessarily return the correct result for short options - * when multiple flags are combined in the same option. - * - * @param string|array $values The value(s) to look for in the raw parameters (can be an array) - * @param string|bool|int|float|array|null $default The default value to return if no result is found - * @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal - * - * @return mixed - */ - public function getParameterOption(string|array $values, string|bool|int|float|array|null $default = false, bool $onlyParams = false); - - /** - * Binds the current Input instance with the given arguments and options. - * - * @throws RuntimeException - */ - public function bind(InputDefinition $definition); - - /** - * Validates the input. - * - * @throws RuntimeException When not enough arguments are given - */ - public function validate(); - - /** - * Returns all the given arguments merged with the default values. - * - * @return array - */ - public function getArguments(): array; - - /** - * Returns the argument value for a given argument name. - * - * @return mixed - * - * @throws InvalidArgumentException When argument given doesn't exist - */ - public function getArgument(string $name); - - /** - * Sets an argument value by name. - * - * @throws InvalidArgumentException When argument given doesn't exist - */ - public function setArgument(string $name, mixed $value); - - /** - * Returns true if an InputArgument object exists by name or position. - */ - public function hasArgument(string $name): bool; - - /** - * Returns all the given options merged with the default values. - * - * @return array - */ - public function getOptions(): array; - - /** - * Returns the option value for a given option name. - * - * @return mixed - * - * @throws InvalidArgumentException When option given doesn't exist - */ - public function getOption(string $name); - - /** - * Sets an option value by name. - * - * @throws InvalidArgumentException When option given doesn't exist - */ - public function setOption(string $name, mixed $value); - - /** - * Returns true if an InputOption object exists by name. - */ - public function hasOption(string $name): bool; - - /** - * Is this input means interactive? - */ - public function isInteractive(): bool; - - /** - * Sets the input interactivity. - */ - public function setInteractive(bool $interactive); -} diff --git a/vendor/symfony/console/Input/InputOption.php b/vendor/symfony/console/Input/InputOption.php deleted file mode 100644 index 452c9f7f..00000000 --- a/vendor/symfony/console/Input/InputOption.php +++ /dev/null @@ -1,252 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Completion\Suggestion; -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\LogicException; - -/** - * Represents a command line option. - * - * @author Fabien Potencier - */ -class InputOption -{ - /** - * Do not accept input for the option (e.g. --yell). This is the default behavior of options. - */ - public const VALUE_NONE = 1; - - /** - * A value must be passed when the option is used (e.g. --iterations=5 or -i5). - */ - public const VALUE_REQUIRED = 2; - - /** - * The option may or may not have a value (e.g. --yell or --yell=loud). - */ - public const VALUE_OPTIONAL = 4; - - /** - * The option accepts multiple values (e.g. --dir=/foo --dir=/bar). - */ - public const VALUE_IS_ARRAY = 8; - - /** - * The option may have either positive or negative value (e.g. --ansi or --no-ansi). - */ - public const VALUE_NEGATABLE = 16; - - private string $name; - private string|array|null $shortcut; - private int $mode; - private string|int|bool|array|null|float $default; - private array|\Closure $suggestedValues; - private string $description; - - /** - * @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts - * @param int|null $mode The option mode: One of the VALUE_* constants - * @param string|bool|int|float|array|null $default The default value (must be null for self::VALUE_NONE) - * @param array|\Closure(CompletionInput,CompletionSuggestions):list $suggestedValues The values used for input completion - * - * @throws InvalidArgumentException If option mode is invalid or incompatible - */ - public function __construct(string $name, string|array $shortcut = null, int $mode = null, string $description = '', string|bool|int|float|array $default = null, array|\Closure $suggestedValues = []) - { - if (str_starts_with($name, '--')) { - $name = substr($name, 2); - } - - if (empty($name)) { - throw new InvalidArgumentException('An option name cannot be empty.'); - } - - if (empty($shortcut)) { - $shortcut = null; - } - - if (null !== $shortcut) { - if (\is_array($shortcut)) { - $shortcut = implode('|', $shortcut); - } - $shortcuts = preg_split('{(\|)-?}', ltrim($shortcut, '-')); - $shortcuts = array_filter($shortcuts); - $shortcut = implode('|', $shortcuts); - - if (empty($shortcut)) { - throw new InvalidArgumentException('An option shortcut cannot be empty.'); - } - } - - if (null === $mode) { - $mode = self::VALUE_NONE; - } elseif ($mode >= (self::VALUE_NEGATABLE << 1) || $mode < 1) { - throw new InvalidArgumentException(sprintf('Option mode "%s" is not valid.', $mode)); - } - - $this->name = $name; - $this->shortcut = $shortcut; - $this->mode = $mode; - $this->description = $description; - $this->suggestedValues = $suggestedValues; - - if ($suggestedValues && !$this->acceptValue()) { - throw new LogicException('Cannot set suggested values if the option does not accept a value.'); - } - if ($this->isArray() && !$this->acceptValue()) { - throw new InvalidArgumentException('Impossible to have an option mode VALUE_IS_ARRAY if the option does not accept a value.'); - } - if ($this->isNegatable() && $this->acceptValue()) { - throw new InvalidArgumentException('Impossible to have an option mode VALUE_NEGATABLE if the option also accepts a value.'); - } - - $this->setDefault($default); - } - - /** - * Returns the option shortcut. - */ - public function getShortcut(): ?string - { - return $this->shortcut; - } - - /** - * Returns the option name. - */ - public function getName(): string - { - return $this->name; - } - - /** - * Returns true if the option accepts a value. - * - * @return bool true if value mode is not self::VALUE_NONE, false otherwise - */ - public function acceptValue(): bool - { - return $this->isValueRequired() || $this->isValueOptional(); - } - - /** - * Returns true if the option requires a value. - * - * @return bool true if value mode is self::VALUE_REQUIRED, false otherwise - */ - public function isValueRequired(): bool - { - return self::VALUE_REQUIRED === (self::VALUE_REQUIRED & $this->mode); - } - - /** - * Returns true if the option takes an optional value. - * - * @return bool true if value mode is self::VALUE_OPTIONAL, false otherwise - */ - public function isValueOptional(): bool - { - return self::VALUE_OPTIONAL === (self::VALUE_OPTIONAL & $this->mode); - } - - /** - * Returns true if the option can take multiple values. - * - * @return bool true if mode is self::VALUE_IS_ARRAY, false otherwise - */ - public function isArray(): bool - { - return self::VALUE_IS_ARRAY === (self::VALUE_IS_ARRAY & $this->mode); - } - - public function isNegatable(): bool - { - return self::VALUE_NEGATABLE === (self::VALUE_NEGATABLE & $this->mode); - } - - public function setDefault(string|bool|int|float|array $default = null) - { - if (1 > \func_num_args()) { - trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); - } - if (self::VALUE_NONE === (self::VALUE_NONE & $this->mode) && null !== $default) { - throw new LogicException('Cannot set a default value when using InputOption::VALUE_NONE mode.'); - } - - if ($this->isArray()) { - if (null === $default) { - $default = []; - } elseif (!\is_array($default)) { - throw new LogicException('A default value for an array option must be an array.'); - } - } - - $this->default = $this->acceptValue() || $this->isNegatable() ? $default : false; - } - - /** - * Returns the default value. - */ - public function getDefault(): string|bool|int|float|array|null - { - return $this->default; - } - - /** - * Returns the description text. - */ - public function getDescription(): string - { - return $this->description; - } - - public function hasCompletion(): bool - { - return [] !== $this->suggestedValues; - } - - /** - * Adds suggestions to $suggestions for the current completion input. - * - * @see Command::complete() - */ - public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void - { - $values = $this->suggestedValues; - if ($values instanceof \Closure && !\is_array($values = $values($input))) { - throw new LogicException(sprintf('Closure for option "%s" must return an array. Got "%s".', $this->name, get_debug_type($values))); - } - if ($values) { - $suggestions->suggestValues($values); - } - } - - /** - * Checks whether the given option equals this one. - */ - public function equals(self $option): bool - { - return $option->getName() === $this->getName() - && $option->getShortcut() === $this->getShortcut() - && $option->getDefault() === $this->getDefault() - && $option->isNegatable() === $this->isNegatable() - && $option->isArray() === $this->isArray() - && $option->isValueRequired() === $this->isValueRequired() - && $option->isValueOptional() === $this->isValueOptional() - ; - } -} diff --git a/vendor/symfony/console/Input/StreamableInputInterface.php b/vendor/symfony/console/Input/StreamableInputInterface.php deleted file mode 100644 index d7e462f2..00000000 --- a/vendor/symfony/console/Input/StreamableInputInterface.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\Console\Input; - -/** - * StreamableInputInterface is the interface implemented by all input classes - * that have an input stream. - * - * @author Robin Chalas - */ -interface StreamableInputInterface extends InputInterface -{ - /** - * Sets the input stream to read from when interacting with the user. - * - * This is mainly useful for testing purpose. - * - * @param resource $stream The input stream - */ - public function setStream($stream); - - /** - * Returns the input stream. - * - * @return resource|null - */ - public function getStream(); -} diff --git a/vendor/symfony/console/Input/StringInput.php b/vendor/symfony/console/Input/StringInput.php deleted file mode 100644 index 82bd2144..00000000 --- a/vendor/symfony/console/Input/StringInput.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\Console\Input; - -use Symfony\Component\Console\Exception\InvalidArgumentException; - -/** - * StringInput represents an input provided as a string. - * - * Usage: - * - * $input = new StringInput('foo --bar="foobar"'); - * - * @author Fabien Potencier - */ -class StringInput extends ArgvInput -{ - /** - * @deprecated since Symfony 6.1 - */ - public const REGEX_STRING = '([^\s]+?)(?:\s|(?setTokens($this->tokenize($input)); - } - - /** - * Tokenizes a string. - * - * @throws InvalidArgumentException When unable to parse input (should never happen) - */ - private function tokenize(string $input): array - { - $tokens = []; - $length = \strlen($input); - $cursor = 0; - $token = null; - while ($cursor < $length) { - if ('\\' === $input[$cursor]) { - $token .= $input[++$cursor] ?? ''; - ++$cursor; - continue; - } - - if (preg_match('/\s+/A', $input, $match, 0, $cursor)) { - if (null !== $token) { - $tokens[] = $token; - $token = null; - } - } elseif (preg_match('/([^="\'\s]+?)(=?)('.self::REGEX_QUOTED_STRING.'+)/A', $input, $match, 0, $cursor)) { - $token .= $match[1].$match[2].stripcslashes(str_replace(['"\'', '\'"', '\'\'', '""'], '', substr($match[3], 1, -1))); - } elseif (preg_match('/'.self::REGEX_QUOTED_STRING.'/A', $input, $match, 0, $cursor)) { - $token .= stripcslashes(substr($match[0], 1, -1)); - } elseif (preg_match('/'.self::REGEX_UNQUOTED_STRING.'/A', $input, $match, 0, $cursor)) { - $token .= $match[1]; - } else { - // should never happen - throw new InvalidArgumentException(sprintf('Unable to parse input near "... %s ...".', substr($input, $cursor, 10))); - } - - $cursor += \strlen($match[0]); - } - - if (null !== $token) { - $tokens[] = $token; - } - - return $tokens; - } -} diff --git a/vendor/symfony/console/LICENSE b/vendor/symfony/console/LICENSE deleted file mode 100644 index 88bf75bb..00000000 --- a/vendor/symfony/console/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2022 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/console/Logger/ConsoleLogger.php b/vendor/symfony/console/Logger/ConsoleLogger.php deleted file mode 100644 index fddef50c..00000000 --- a/vendor/symfony/console/Logger/ConsoleLogger.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\Console\Logger; - -use Psr\Log\AbstractLogger; -use Psr\Log\InvalidArgumentException; -use Psr\Log\LogLevel; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * PSR-3 compliant console logger. - * - * @author Kévin Dunglas - * - * @see https://www.php-fig.org/psr/psr-3/ - */ -class ConsoleLogger extends AbstractLogger -{ - public const INFO = 'info'; - public const ERROR = 'error'; - - private OutputInterface $output; - private array $verbosityLevelMap = [ - LogLevel::EMERGENCY => OutputInterface::VERBOSITY_NORMAL, - LogLevel::ALERT => OutputInterface::VERBOSITY_NORMAL, - LogLevel::CRITICAL => OutputInterface::VERBOSITY_NORMAL, - LogLevel::ERROR => OutputInterface::VERBOSITY_NORMAL, - LogLevel::WARNING => OutputInterface::VERBOSITY_NORMAL, - LogLevel::NOTICE => OutputInterface::VERBOSITY_VERBOSE, - LogLevel::INFO => OutputInterface::VERBOSITY_VERY_VERBOSE, - LogLevel::DEBUG => OutputInterface::VERBOSITY_DEBUG, - ]; - private array $formatLevelMap = [ - LogLevel::EMERGENCY => self::ERROR, - LogLevel::ALERT => self::ERROR, - LogLevel::CRITICAL => self::ERROR, - LogLevel::ERROR => self::ERROR, - LogLevel::WARNING => self::INFO, - LogLevel::NOTICE => self::INFO, - LogLevel::INFO => self::INFO, - LogLevel::DEBUG => self::INFO, - ]; - private bool $errored = false; - - public function __construct(OutputInterface $output, array $verbosityLevelMap = [], array $formatLevelMap = []) - { - $this->output = $output; - $this->verbosityLevelMap = $verbosityLevelMap + $this->verbosityLevelMap; - $this->formatLevelMap = $formatLevelMap + $this->formatLevelMap; - } - - public function log($level, $message, array $context = []): void - { - if (!isset($this->verbosityLevelMap[$level])) { - throw new InvalidArgumentException(sprintf('The log level "%s" does not exist.', $level)); - } - - $output = $this->output; - - // Write to the error output if necessary and available - if (self::ERROR === $this->formatLevelMap[$level]) { - if ($this->output instanceof ConsoleOutputInterface) { - $output = $output->getErrorOutput(); - } - $this->errored = true; - } - - // the if condition check isn't necessary -- it's the same one that $output will do internally anyway. - // We only do it for efficiency here as the message formatting is relatively expensive. - if ($output->getVerbosity() >= $this->verbosityLevelMap[$level]) { - $output->writeln(sprintf('<%1$s>[%2$s] %3$s', $this->formatLevelMap[$level], $level, $this->interpolate($message, $context)), $this->verbosityLevelMap[$level]); - } - } - - /** - * Returns true when any messages have been logged at error levels. - */ - public function hasErrored(): bool - { - return $this->errored; - } - - /** - * Interpolates context values into the message placeholders. - * - * @author PHP Framework Interoperability Group - */ - private function interpolate(string $message, array $context): string - { - if (!str_contains($message, '{')) { - return $message; - } - - $replacements = []; - foreach ($context as $key => $val) { - if (null === $val || \is_scalar($val) || $val instanceof \Stringable) { - $replacements["{{$key}}"] = $val; - } elseif ($val instanceof \DateTimeInterface) { - $replacements["{{$key}}"] = $val->format(\DateTimeInterface::RFC3339); - } elseif (\is_object($val)) { - $replacements["{{$key}}"] = '[object '.$val::class.']'; - } else { - $replacements["{{$key}}"] = '['.\gettype($val).']'; - } - } - - return strtr($message, $replacements); - } -} diff --git a/vendor/symfony/console/Output/AnsiColorMode.php b/vendor/symfony/console/Output/AnsiColorMode.php deleted file mode 100644 index c6cc5c12..00000000 --- a/vendor/symfony/console/Output/AnsiColorMode.php +++ /dev/null @@ -1,124 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Exception\InvalidArgumentException; - -/** - * @author Fabien Potencier - * @author Julien Boudry - */ -enum AnsiColorMode -{ - /* - * Classical 4-bit Ansi colors, including 8 classical colors and 8 bright color. Output syntax is "ESC[${foreGroundColorcode};${backGroundColorcode}m" - * Must be compatible with all terminals and it's the minimal version supported. - */ - case Ansi4; - - /* - * 8-bit Ansi colors (240 differents colors + 16 duplicate color codes, ensuring backward compatibility). - * Output syntax is: "ESC[38;5;${foreGroundColorcode};48;5;${backGroundColorcode}m" - * Should be compatible with most terminals. - */ - case Ansi8; - - /* - * 24-bit Ansi colors (RGB). - * Output syntax is: "ESC[38;2;${foreGroundColorcodeRed};${foreGroundColorcodeGreen};${foreGroundColorcodeBlue};48;2;${backGroundColorcodeRed};${backGroundColorcodeGreen};${backGroundColorcodeBlue}m" - * May be compatible with many modern terminals. - */ - case Ansi24; - - /** - * Converts an RGB hexadecimal color to the corresponding Ansi code. - */ - public function convertFromHexToAnsiColorCode(string $hexColor): string - { - $hexColor = str_replace('#', '', $hexColor); - - if (3 === \strlen($hexColor)) { - $hexColor = $hexColor[0].$hexColor[0].$hexColor[1].$hexColor[1].$hexColor[2].$hexColor[2]; - } - - if (6 !== \strlen($hexColor)) { - throw new InvalidArgumentException(sprintf('Invalid "#%s" color.', $hexColor)); - } - - $color = hexdec($hexColor); - - $r = ($color >> 16) & 255; - $g = ($color >> 8) & 255; - $b = $color & 255; - - return match ($this) { - self::Ansi4 => (string) $this->convertFromRGB($r, $g, $b), - self::Ansi8 => '8;5;'.((string) $this->convertFromRGB($r, $g, $b)), - self::Ansi24 => sprintf('8;2;%d;%d;%d', $r, $g, $b) - }; - } - - private function convertFromRGB(int $r, int $g, int $b): int - { - return match ($this) { - self::Ansi4 => $this->degradeHexColorToAnsi4($r, $g, $b), - self::Ansi8 => $this->degradeHexColorToAnsi8($r, $g, $b), - default => throw new InvalidArgumentException("RGB cannot be converted to {$this->name}.") - }; - } - - private function degradeHexColorToAnsi4(int $r, int $g, int $b): int - { - if (0 === round($this->getSaturation($r, $g, $b) / 50)) { - return 0; - } - - return (int) ((round($b / 255) << 2) | (round($g / 255) << 1) | round($r / 255)); - } - - private function getSaturation(int $r, int $g, int $b): int - { - $r = $r / 255; - $g = $g / 255; - $b = $b / 255; - $v = max($r, $g, $b); - - if (0 === $diff = $v - min($r, $g, $b)) { - return 0; - } - - return (int) ((int) $diff * 100 / $v); - } - - /** - * Inspired from https://github.com/ajalt/colormath/blob/e464e0da1b014976736cf97250063248fc77b8e7/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/model/Ansi256.kt code (MIT license). - */ - private function degradeHexColorToAnsi8(int $r, int $g, int $b): int - { - if ($r === $g && $g === $b) { - if ($r < 8) { - return 16; - } - - if ($r > 248) { - return 231; - } - - return (int) round(($r - 8) / 247 * 24) + 232; - } else { - return 16 + - (36 * (int) round($r / 255 * 5)) + - (6 * (int) round($g / 255 * 5)) + - (int) round($b / 255 * 5); - } - } -} diff --git a/vendor/symfony/console/Output/BufferedOutput.php b/vendor/symfony/console/Output/BufferedOutput.php deleted file mode 100644 index 94d4e414..00000000 --- a/vendor/symfony/console/Output/BufferedOutput.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -/** - * @author Jean-François Simon - */ -class BufferedOutput extends Output -{ - private string $buffer = ''; - - /** - * Empties buffer and returns its content. - */ - public function fetch(): string - { - $content = $this->buffer; - $this->buffer = ''; - - return $content; - } - - protected function doWrite(string $message, bool $newline) - { - $this->buffer .= $message; - - if ($newline) { - $this->buffer .= \PHP_EOL; - } - } -} diff --git a/vendor/symfony/console/Output/ConsoleOutput.php b/vendor/symfony/console/Output/ConsoleOutput.php deleted file mode 100644 index e3aa92c7..00000000 --- a/vendor/symfony/console/Output/ConsoleOutput.php +++ /dev/null @@ -1,153 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Formatter\OutputFormatterInterface; - -/** - * ConsoleOutput is the default class for all CLI output. It uses STDOUT and STDERR. - * - * This class is a convenient wrapper around `StreamOutput` for both STDOUT and STDERR. - * - * $output = new ConsoleOutput(); - * - * This is equivalent to: - * - * $output = new StreamOutput(fopen('php://stdout', 'w')); - * $stdErr = new StreamOutput(fopen('php://stderr', 'w')); - * - * @author Fabien Potencier - */ -class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface -{ - private OutputInterface $stderr; - private array $consoleSectionOutputs = []; - - /** - * @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface) - * @param bool|null $decorated Whether to decorate messages (null for auto-guessing) - * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter) - */ - public function __construct(int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = null, OutputFormatterInterface $formatter = null) - { - parent::__construct($this->openOutputStream(), $verbosity, $decorated, $formatter); - - if (null === $formatter) { - // for BC reasons, stdErr has it own Formatter only when user don't inject a specific formatter. - $this->stderr = new StreamOutput($this->openErrorStream(), $verbosity, $decorated); - - return; - } - - $actualDecorated = $this->isDecorated(); - $this->stderr = new StreamOutput($this->openErrorStream(), $verbosity, $decorated, $this->getFormatter()); - - if (null === $decorated) { - $this->setDecorated($actualDecorated && $this->stderr->isDecorated()); - } - } - - /** - * Creates a new output section. - */ - public function section(): ConsoleSectionOutput - { - return new ConsoleSectionOutput($this->getStream(), $this->consoleSectionOutputs, $this->getVerbosity(), $this->isDecorated(), $this->getFormatter()); - } - - public function setDecorated(bool $decorated) - { - parent::setDecorated($decorated); - $this->stderr->setDecorated($decorated); - } - - public function setFormatter(OutputFormatterInterface $formatter) - { - parent::setFormatter($formatter); - $this->stderr->setFormatter($formatter); - } - - public function setVerbosity(int $level) - { - parent::setVerbosity($level); - $this->stderr->setVerbosity($level); - } - - public function getErrorOutput(): OutputInterface - { - return $this->stderr; - } - - public function setErrorOutput(OutputInterface $error) - { - $this->stderr = $error; - } - - /** - * Returns true if current environment supports writing console output to - * STDOUT. - */ - protected function hasStdoutSupport(): bool - { - return false === $this->isRunningOS400(); - } - - /** - * Returns true if current environment supports writing console output to - * STDERR. - */ - protected function hasStderrSupport(): bool - { - return false === $this->isRunningOS400(); - } - - /** - * Checks if current executing environment is IBM iSeries (OS400), which - * doesn't properly convert character-encodings between ASCII to EBCDIC. - */ - private function isRunningOS400(): bool - { - $checks = [ - \function_exists('php_uname') ? php_uname('s') : '', - getenv('OSTYPE'), - \PHP_OS, - ]; - - return false !== stripos(implode(';', $checks), 'OS400'); - } - - /** - * @return resource - */ - private function openOutputStream() - { - if (!$this->hasStdoutSupport()) { - return fopen('php://output', 'w'); - } - - // Use STDOUT when possible to prevent from opening too many file descriptors - return \defined('STDOUT') ? \STDOUT : (@fopen('php://stdout', 'w') ?: fopen('php://output', 'w')); - } - - /** - * @return resource - */ - private function openErrorStream() - { - if (!$this->hasStderrSupport()) { - return fopen('php://output', 'w'); - } - - // Use STDERR when possible to prevent from opening too many file descriptors - return \defined('STDERR') ? \STDERR : (@fopen('php://stderr', 'w') ?: fopen('php://output', 'w')); - } -} diff --git a/vendor/symfony/console/Output/ConsoleOutputInterface.php b/vendor/symfony/console/Output/ConsoleOutputInterface.php deleted file mode 100644 index 6b4babc6..00000000 --- a/vendor/symfony/console/Output/ConsoleOutputInterface.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\Console\Output; - -/** - * ConsoleOutputInterface is the interface implemented by ConsoleOutput class. - * This adds information about stderr and section output stream. - * - * @author Dariusz Górecki - */ -interface ConsoleOutputInterface extends OutputInterface -{ - /** - * Gets the OutputInterface for errors. - */ - public function getErrorOutput(): OutputInterface; - - public function setErrorOutput(OutputInterface $error); - - public function section(): ConsoleSectionOutput; -} diff --git a/vendor/symfony/console/Output/ConsoleSectionOutput.php b/vendor/symfony/console/Output/ConsoleSectionOutput.php deleted file mode 100644 index 7978a922..00000000 --- a/vendor/symfony/console/Output/ConsoleSectionOutput.php +++ /dev/null @@ -1,222 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Formatter\OutputFormatterInterface; -use Symfony\Component\Console\Helper\Helper; -use Symfony\Component\Console\Terminal; - -/** - * @author Pierre du Plessis - * @author Gabriel Ostrolucký - */ -class ConsoleSectionOutput extends StreamOutput -{ - private array $content = []; - private int $lines = 0; - private array $sections; - private Terminal $terminal; - private int $maxHeight = 0; - - /** - * @param resource $stream - * @param ConsoleSectionOutput[] $sections - */ - public function __construct($stream, array &$sections, int $verbosity, bool $decorated, OutputFormatterInterface $formatter) - { - parent::__construct($stream, $verbosity, $decorated, $formatter); - array_unshift($sections, $this); - $this->sections = &$sections; - $this->terminal = new Terminal(); - } - - /** - * Defines a maximum number of lines for this section. - * - * When more lines are added, the section will automatically scroll to the - * end (i.e. remove the first lines to comply with the max height). - */ - public function setMaxHeight(int $maxHeight): void - { - // when changing max height, clear output of current section and redraw again with the new height - $existingContent = $this->popStreamContentUntilCurrentSection($this->maxHeight ? min($this->maxHeight, $this->lines) : $this->lines); - - $this->maxHeight = $maxHeight; - - parent::doWrite($this->getVisibleContent(), false); - parent::doWrite($existingContent, false); - } - - /** - * Clears previous output for this section. - * - * @param int $lines Number of lines to clear. If null, then the entire output of this section is cleared - */ - public function clear(int $lines = null) - { - if (empty($this->content) || !$this->isDecorated()) { - return; - } - - if ($lines) { - array_splice($this->content, -$lines); - } else { - $lines = $this->lines; - $this->content = []; - } - - $this->lines -= $lines; - - parent::doWrite($this->popStreamContentUntilCurrentSection($this->maxHeight ? min($this->maxHeight, $lines) : $lines), false); - } - - /** - * Overwrites the previous output with a new message. - */ - public function overwrite(string|iterable $message) - { - $this->clear(); - $this->writeln($message); - } - - public function getContent(): string - { - return implode('', $this->content); - } - - public function getVisibleContent(): string - { - if (0 === $this->maxHeight) { - return $this->getContent(); - } - - return implode('', \array_slice($this->content, -$this->maxHeight)); - } - - /** - * @internal - */ - public function addContent(string $input, bool $newline = true): int - { - $width = $this->terminal->getWidth(); - $lines = explode(\PHP_EOL, $input); - $linesAdded = 0; - $count = \count($lines) - 1; - foreach ($lines as $i => $lineContent) { - // re-add the line break (that has been removed in the above `explode()` for - // - every line that is not the last line - // - if $newline is required, also add it to the last line - if ($i < $count || $newline) { - $lineContent .= \PHP_EOL; - } - - // skip line if there is no text (or newline for that matter) - if ('' === $lineContent) { - continue; - } - - // For the first line, check if the previous line (last entry of `$this->content`) - // needs to be continued (i.e. does not end with a line break). - if (0 === $i - && (false !== $lastLine = end($this->content)) - && !str_ends_with($lastLine, \PHP_EOL) - ) { - // deduct the line count of the previous line - $this->lines -= (int) ceil($this->getDisplayLength($lastLine) / $width) ?: 1; - // concatenate previous and new line - $lineContent = $lastLine.$lineContent; - // replace last entry of `$this->content` with the new expanded line - array_splice($this->content, -1, 1, $lineContent); - } else { - // otherwise just add the new content - $this->content[] = $lineContent; - } - - $linesAdded += (int) ceil($this->getDisplayLength($lineContent) / $width) ?: 1; - } - - $this->lines += $linesAdded; - - return $linesAdded; - } - - protected function doWrite(string $message, bool $newline) - { - if (!$this->isDecorated()) { - parent::doWrite($message, $newline); - - return; - } - - // Check if the previous line (last entry of `$this->content`) needs to be continued - // (i.e. does not end with a line break). In which case, it needs to be erased first. - $linesToClear = $deleteLastLine = ($lastLine = end($this->content) ?: '') && !str_ends_with($lastLine, \PHP_EOL) ? 1 : 0; - - $linesAdded = $this->addContent($message, $newline); - - if ($lineOverflow = $this->maxHeight > 0 && $this->lines > $this->maxHeight) { - // on overflow, clear the whole section and redraw again (to remove the first lines) - $linesToClear = $this->maxHeight; - } - - $erasedContent = $this->popStreamContentUntilCurrentSection($linesToClear); - - if ($lineOverflow) { - // redraw existing lines of the section - $previousLinesOfSection = \array_slice($this->content, $this->lines - $this->maxHeight, $this->maxHeight - $linesAdded); - parent::doWrite(implode('', $previousLinesOfSection), false); - } - - // if the last line was removed, re-print its content together with the new content. - // otherwise, just print the new content. - parent::doWrite($deleteLastLine ? $lastLine.$message : $message, true); - parent::doWrite($erasedContent, false); - } - - /** - * At initial stage, cursor is at the end of stream output. This method makes cursor crawl upwards until it hits - * current section. Then it erases content it crawled through. Optionally, it erases part of current section too. - */ - private function popStreamContentUntilCurrentSection(int $numberOfLinesToClearFromCurrentSection = 0): string - { - $numberOfLinesToClear = $numberOfLinesToClearFromCurrentSection; - $erasedContent = []; - - foreach ($this->sections as $section) { - if ($section === $this) { - break; - } - - $numberOfLinesToClear += $section->lines; - if ('' !== $sectionContent = $section->getVisibleContent()) { - if (!str_ends_with($sectionContent, \PHP_EOL)) { - $sectionContent .= \PHP_EOL; - } - $erasedContent[] = $sectionContent; - } - } - - if ($numberOfLinesToClear > 0) { - // move cursor up n lines - parent::doWrite(sprintf("\x1b[%dA", $numberOfLinesToClear), false); - // erase to end of screen - parent::doWrite("\x1b[0J", false); - } - - return implode('', array_reverse($erasedContent)); - } - - private function getDisplayLength(string $text): int - { - return Helper::width(Helper::removeDecoration($this->getFormatter(), str_replace("\t", ' ', $text))); - } -} diff --git a/vendor/symfony/console/Output/NullOutput.php b/vendor/symfony/console/Output/NullOutput.php deleted file mode 100644 index 4884cbad..00000000 --- a/vendor/symfony/console/Output/NullOutput.php +++ /dev/null @@ -1,89 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Formatter\NullOutputFormatter; -use Symfony\Component\Console\Formatter\OutputFormatterInterface; - -/** - * NullOutput suppresses all output. - * - * $output = new NullOutput(); - * - * @author Fabien Potencier - * @author Tobias Schultze - */ -class NullOutput implements OutputInterface -{ - private NullOutputFormatter $formatter; - - public function setFormatter(OutputFormatterInterface $formatter) - { - // do nothing - } - - public function getFormatter(): OutputFormatterInterface - { - // to comply with the interface we must return a OutputFormatterInterface - return $this->formatter ??= new NullOutputFormatter(); - } - - public function setDecorated(bool $decorated) - { - // do nothing - } - - public function isDecorated(): bool - { - return false; - } - - public function setVerbosity(int $level) - { - // do nothing - } - - public function getVerbosity(): int - { - return self::VERBOSITY_QUIET; - } - - public function isQuiet(): bool - { - return true; - } - - public function isVerbose(): bool - { - return false; - } - - public function isVeryVerbose(): bool - { - return false; - } - - public function isDebug(): bool - { - return false; - } - - public function writeln(string|iterable $messages, int $options = self::OUTPUT_NORMAL) - { - // do nothing - } - - public function write(string|iterable $messages, bool $newline = false, int $options = self::OUTPUT_NORMAL) - { - // do nothing - } -} diff --git a/vendor/symfony/console/Output/Output.php b/vendor/symfony/console/Output/Output.php deleted file mode 100644 index 4cb71acb..00000000 --- a/vendor/symfony/console/Output/Output.php +++ /dev/null @@ -1,138 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Formatter\OutputFormatterInterface; - -/** - * Base class for output classes. - * - * There are five levels of verbosity: - * - * * normal: no option passed (normal output) - * * verbose: -v (more output) - * * very verbose: -vv (highly extended output) - * * debug: -vvv (all debug output) - * * quiet: -q (no output) - * - * @author Fabien Potencier - */ -abstract class Output implements OutputInterface -{ - private int $verbosity; - private OutputFormatterInterface $formatter; - - /** - * @param int|null $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface) - * @param bool $decorated Whether to decorate messages - * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter) - */ - public function __construct(?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, OutputFormatterInterface $formatter = null) - { - $this->verbosity = $verbosity ?? self::VERBOSITY_NORMAL; - $this->formatter = $formatter ?? new OutputFormatter(); - $this->formatter->setDecorated($decorated); - } - - public function setFormatter(OutputFormatterInterface $formatter) - { - $this->formatter = $formatter; - } - - public function getFormatter(): OutputFormatterInterface - { - return $this->formatter; - } - - public function setDecorated(bool $decorated) - { - $this->formatter->setDecorated($decorated); - } - - public function isDecorated(): bool - { - return $this->formatter->isDecorated(); - } - - public function setVerbosity(int $level) - { - $this->verbosity = $level; - } - - public function getVerbosity(): int - { - return $this->verbosity; - } - - public function isQuiet(): bool - { - return self::VERBOSITY_QUIET === $this->verbosity; - } - - public function isVerbose(): bool - { - return self::VERBOSITY_VERBOSE <= $this->verbosity; - } - - public function isVeryVerbose(): bool - { - return self::VERBOSITY_VERY_VERBOSE <= $this->verbosity; - } - - public function isDebug(): bool - { - return self::VERBOSITY_DEBUG <= $this->verbosity; - } - - public function writeln(string|iterable $messages, int $options = self::OUTPUT_NORMAL) - { - $this->write($messages, true, $options); - } - - public function write(string|iterable $messages, bool $newline = false, int $options = self::OUTPUT_NORMAL) - { - if (!is_iterable($messages)) { - $messages = [$messages]; - } - - $types = self::OUTPUT_NORMAL | self::OUTPUT_RAW | self::OUTPUT_PLAIN; - $type = $types & $options ?: self::OUTPUT_NORMAL; - - $verbosities = self::VERBOSITY_QUIET | self::VERBOSITY_NORMAL | self::VERBOSITY_VERBOSE | self::VERBOSITY_VERY_VERBOSE | self::VERBOSITY_DEBUG; - $verbosity = $verbosities & $options ?: self::VERBOSITY_NORMAL; - - if ($verbosity > $this->getVerbosity()) { - return; - } - - foreach ($messages as $message) { - switch ($type) { - case OutputInterface::OUTPUT_NORMAL: - $message = $this->formatter->format($message); - break; - case OutputInterface::OUTPUT_RAW: - break; - case OutputInterface::OUTPUT_PLAIN: - $message = strip_tags($this->formatter->format($message)); - break; - } - - $this->doWrite($message ?? '', $newline); - } - } - - /** - * Writes a message to the output. - */ - abstract protected function doWrite(string $message, bool $newline); -} diff --git a/vendor/symfony/console/Output/OutputInterface.php b/vendor/symfony/console/Output/OutputInterface.php deleted file mode 100644 index bc927c51..00000000 --- a/vendor/symfony/console/Output/OutputInterface.php +++ /dev/null @@ -1,96 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Formatter\OutputFormatterInterface; - -/** - * OutputInterface is the interface implemented by all Output classes. - * - * @author Fabien Potencier - */ -interface OutputInterface -{ - public const VERBOSITY_QUIET = 16; - public const VERBOSITY_NORMAL = 32; - public const VERBOSITY_VERBOSE = 64; - public const VERBOSITY_VERY_VERBOSE = 128; - public const VERBOSITY_DEBUG = 256; - - public const OUTPUT_NORMAL = 1; - public const OUTPUT_RAW = 2; - public const OUTPUT_PLAIN = 4; - - /** - * Writes a message to the output. - * - * @param bool $newline Whether to add a newline - * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), - * 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL - */ - public function write(string|iterable $messages, bool $newline = false, int $options = 0); - - /** - * Writes a message to the output and adds a newline at the end. - * - * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), - * 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL - */ - public function writeln(string|iterable $messages, int $options = 0); - - /** - * Sets the verbosity of the output. - */ - public function setVerbosity(int $level); - - /** - * Gets the current verbosity of the output. - */ - public function getVerbosity(): int; - - /** - * Returns whether verbosity is quiet (-q). - */ - public function isQuiet(): bool; - - /** - * Returns whether verbosity is verbose (-v). - */ - public function isVerbose(): bool; - - /** - * Returns whether verbosity is very verbose (-vv). - */ - public function isVeryVerbose(): bool; - - /** - * Returns whether verbosity is debug (-vvv). - */ - public function isDebug(): bool; - - /** - * Sets the decorated flag. - */ - public function setDecorated(bool $decorated); - - /** - * Gets the decorated flag. - */ - public function isDecorated(): bool; - - public function setFormatter(OutputFormatterInterface $formatter); - - /** - * Returns current output formatter instance. - */ - public function getFormatter(): OutputFormatterInterface; -} diff --git a/vendor/symfony/console/Output/StreamOutput.php b/vendor/symfony/console/Output/StreamOutput.php deleted file mode 100644 index 9ec524e4..00000000 --- a/vendor/symfony/console/Output/StreamOutput.php +++ /dev/null @@ -1,110 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Formatter\OutputFormatterInterface; - -/** - * StreamOutput writes the output to a given stream. - * - * Usage: - * - * $output = new StreamOutput(fopen('php://stdout', 'w')); - * - * As `StreamOutput` can use any stream, you can also use a file: - * - * $output = new StreamOutput(fopen('/path/to/output.log', 'a', false)); - * - * @author Fabien Potencier - */ -class StreamOutput extends Output -{ - private $stream; - - /** - * @param resource $stream A stream resource - * @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface) - * @param bool|null $decorated Whether to decorate messages (null for auto-guessing) - * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter) - * - * @throws InvalidArgumentException When first argument is not a real stream - */ - public function __construct($stream, int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = null, OutputFormatterInterface $formatter = null) - { - if (!\is_resource($stream) || 'stream' !== get_resource_type($stream)) { - throw new InvalidArgumentException('The StreamOutput class needs a stream as its first argument.'); - } - - $this->stream = $stream; - - $decorated ??= $this->hasColorSupport(); - - parent::__construct($verbosity, $decorated, $formatter); - } - - /** - * Gets the stream attached to this StreamOutput instance. - * - * @return resource - */ - public function getStream() - { - return $this->stream; - } - - protected function doWrite(string $message, bool $newline) - { - if ($newline) { - $message .= \PHP_EOL; - } - - @fwrite($this->stream, $message); - - fflush($this->stream); - } - - /** - * Returns true if the stream supports colorization. - * - * Colorization is disabled if not supported by the stream: - * - * This is tricky on Windows, because Cygwin, Msys2 etc emulate pseudo - * terminals via named pipes, so we can only check the environment. - * - * Reference: Composer\XdebugHandler\Process::supportsColor - * https://github.com/composer/xdebug-handler - * - * @return bool true if the stream supports colorization, false otherwise - */ - protected function hasColorSupport(): bool - { - // 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($this->stream)) - || false !== getenv('ANSICON') - || 'ON' === getenv('ConEmuANSI') - || 'xterm' === getenv('TERM'); - } - - return stream_isatty($this->stream); - } -} diff --git a/vendor/symfony/console/Output/TrimmedBufferOutput.php b/vendor/symfony/console/Output/TrimmedBufferOutput.php deleted file mode 100644 index 1ca5a13e..00000000 --- a/vendor/symfony/console/Output/TrimmedBufferOutput.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Formatter\OutputFormatterInterface; - -/** - * A BufferedOutput that keeps only the last N chars. - * - * @author Jérémy Derussé - */ -class TrimmedBufferOutput extends Output -{ - private int $maxLength; - private string $buffer = ''; - - public function __construct(int $maxLength, ?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, OutputFormatterInterface $formatter = null) - { - if ($maxLength <= 0) { - throw new InvalidArgumentException(sprintf('"%s()" expects a strictly positive maxLength. Got %d.', __METHOD__, $maxLength)); - } - - parent::__construct($verbosity, $decorated, $formatter); - $this->maxLength = $maxLength; - } - - /** - * Empties buffer and returns its content. - */ - public function fetch(): string - { - $content = $this->buffer; - $this->buffer = ''; - - return $content; - } - - protected function doWrite(string $message, bool $newline) - { - $this->buffer .= $message; - - if ($newline) { - $this->buffer .= \PHP_EOL; - } - - $this->buffer = substr($this->buffer, 0 - $this->maxLength); - } -} diff --git a/vendor/symfony/console/Question/ChoiceQuestion.php b/vendor/symfony/console/Question/ChoiceQuestion.php deleted file mode 100644 index e449ff68..00000000 --- a/vendor/symfony/console/Question/ChoiceQuestion.php +++ /dev/null @@ -1,177 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Question; - -use Symfony\Component\Console\Exception\InvalidArgumentException; - -/** - * Represents a choice question. - * - * @author Fabien Potencier - */ -class ChoiceQuestion extends Question -{ - private array $choices; - private bool $multiselect = false; - private string $prompt = ' > '; - private string $errorMessage = 'Value "%s" is invalid'; - - /** - * @param string $question The question to ask to the user - * @param array $choices The list of available choices - * @param mixed $default The default answer to return - */ - public function __construct(string $question, array $choices, mixed $default = null) - { - if (!$choices) { - throw new \LogicException('Choice question must have at least 1 choice available.'); - } - - parent::__construct($question, $default); - - $this->choices = $choices; - $this->setValidator($this->getDefaultValidator()); - $this->setAutocompleterValues($choices); - } - - /** - * Returns available choices. - */ - public function getChoices(): array - { - return $this->choices; - } - - /** - * Sets multiselect option. - * - * When multiselect is set to true, multiple choices can be answered. - * - * @return $this - */ - public function setMultiselect(bool $multiselect): static - { - $this->multiselect = $multiselect; - $this->setValidator($this->getDefaultValidator()); - - return $this; - } - - /** - * Returns whether the choices are multiselect. - */ - public function isMultiselect(): bool - { - return $this->multiselect; - } - - /** - * Gets the prompt for choices. - */ - public function getPrompt(): string - { - return $this->prompt; - } - - /** - * Sets the prompt for choices. - * - * @return $this - */ - public function setPrompt(string $prompt): static - { - $this->prompt = $prompt; - - return $this; - } - - /** - * Sets the error message for invalid values. - * - * The error message has a string placeholder (%s) for the invalid value. - * - * @return $this - */ - public function setErrorMessage(string $errorMessage): static - { - $this->errorMessage = $errorMessage; - $this->setValidator($this->getDefaultValidator()); - - return $this; - } - - private function getDefaultValidator(): callable - { - $choices = $this->choices; - $errorMessage = $this->errorMessage; - $multiselect = $this->multiselect; - $isAssoc = $this->isAssoc($choices); - - return function ($selected) use ($choices, $errorMessage, $multiselect, $isAssoc) { - if ($multiselect) { - // Check for a separated comma values - if (!preg_match('/^[^,]+(?:,[^,]+)*$/', (string) $selected, $matches)) { - throw new InvalidArgumentException(sprintf($errorMessage, $selected)); - } - - $selectedChoices = explode(',', (string) $selected); - } else { - $selectedChoices = [$selected]; - } - - if ($this->isTrimmable()) { - foreach ($selectedChoices as $k => $v) { - $selectedChoices[$k] = trim((string) $v); - } - } - - $multiselectChoices = []; - foreach ($selectedChoices as $value) { - $results = []; - foreach ($choices as $key => $choice) { - if ($choice === $value) { - $results[] = $key; - } - } - - if (\count($results) > 1) { - throw new InvalidArgumentException(sprintf('The provided answer is ambiguous. Value should be one of "%s".', implode('" or "', $results))); - } - - $result = array_search($value, $choices); - - if (!$isAssoc) { - if (false !== $result) { - $result = $choices[$result]; - } elseif (isset($choices[$value])) { - $result = $choices[$value]; - } - } elseif (false === $result && isset($choices[$value])) { - $result = $value; - } - - if (false === $result) { - throw new InvalidArgumentException(sprintf($errorMessage, $value)); - } - - // For associative choices, consistently return the key as string: - $multiselectChoices[] = $isAssoc ? (string) $result : $result; - } - - if ($multiselect) { - return $multiselectChoices; - } - - return current($multiselectChoices); - }; - } -} diff --git a/vendor/symfony/console/Question/ConfirmationQuestion.php b/vendor/symfony/console/Question/ConfirmationQuestion.php deleted file mode 100644 index 40eab242..00000000 --- a/vendor/symfony/console/Question/ConfirmationQuestion.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. - */ - -namespace Symfony\Component\Console\Question; - -/** - * Represents a yes/no question. - * - * @author Fabien Potencier - */ -class ConfirmationQuestion extends Question -{ - private string $trueAnswerRegex; - - /** - * @param string $question The question to ask to the user - * @param bool $default The default answer to return, true or false - * @param string $trueAnswerRegex A regex to match the "yes" answer - */ - public function __construct(string $question, bool $default = true, string $trueAnswerRegex = '/^y/i') - { - parent::__construct($question, $default); - - $this->trueAnswerRegex = $trueAnswerRegex; - $this->setNormalizer($this->getDefaultNormalizer()); - } - - /** - * Returns the default answer normalizer. - */ - private function getDefaultNormalizer(): callable - { - $default = $this->getDefault(); - $regex = $this->trueAnswerRegex; - - return function ($answer) use ($default, $regex) { - if (\is_bool($answer)) { - return $answer; - } - - $answerIsTrue = (bool) preg_match($regex, $answer); - if (false === $default) { - return $answer && $answerIsTrue; - } - - return '' === $answer || $answerIsTrue; - }; - } -} diff --git a/vendor/symfony/console/Question/Question.php b/vendor/symfony/console/Question/Question.php deleted file mode 100644 index b06db945..00000000 --- a/vendor/symfony/console/Question/Question.php +++ /dev/null @@ -1,289 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Question; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\LogicException; - -/** - * Represents a Question. - * - * @author Fabien Potencier - */ -class Question -{ - private string $question; - private ?int $attempts = null; - private bool $hidden = false; - private bool $hiddenFallback = true; - private ?\Closure $autocompleterCallback = null; - private ?\Closure $validator = null; - private string|int|bool|null|float $default; - private ?\Closure $normalizer = null; - private bool $trimmable = true; - private bool $multiline = false; - - /** - * @param string $question The question to ask to the user - * @param string|bool|int|float|null $default The default answer to return if the user enters nothing - */ - public function __construct(string $question, string|bool|int|float $default = null) - { - $this->question = $question; - $this->default = $default; - } - - /** - * Returns the question. - */ - public function getQuestion(): string - { - return $this->question; - } - - /** - * Returns the default answer. - */ - public function getDefault(): string|bool|int|float|null - { - return $this->default; - } - - /** - * Returns whether the user response accepts newline characters. - */ - public function isMultiline(): bool - { - return $this->multiline; - } - - /** - * Sets whether the user response should accept newline characters. - * - * @return $this - */ - public function setMultiline(bool $multiline): static - { - $this->multiline = $multiline; - - return $this; - } - - /** - * Returns whether the user response must be hidden. - */ - public function isHidden(): bool - { - return $this->hidden; - } - - /** - * Sets whether the user response must be hidden or not. - * - * @return $this - * - * @throws LogicException In case the autocompleter is also used - */ - public function setHidden(bool $hidden): static - { - if ($this->autocompleterCallback) { - throw new LogicException('A hidden question cannot use the autocompleter.'); - } - - $this->hidden = $hidden; - - return $this; - } - - /** - * In case the response cannot be hidden, whether to fallback on non-hidden question or not. - */ - public function isHiddenFallback(): bool - { - return $this->hiddenFallback; - } - - /** - * Sets whether to fallback on non-hidden question if the response cannot be hidden. - * - * @return $this - */ - public function setHiddenFallback(bool $fallback): static - { - $this->hiddenFallback = $fallback; - - return $this; - } - - /** - * Gets values for the autocompleter. - */ - public function getAutocompleterValues(): ?iterable - { - $callback = $this->getAutocompleterCallback(); - - return $callback ? $callback('') : null; - } - - /** - * Sets values for the autocompleter. - * - * @return $this - * - * @throws LogicException - */ - public function setAutocompleterValues(?iterable $values): static - { - if (\is_array($values)) { - $values = $this->isAssoc($values) ? array_merge(array_keys($values), array_values($values)) : array_values($values); - - $callback = static function () use ($values) { - return $values; - }; - } elseif ($values instanceof \Traversable) { - $valueCache = null; - $callback = static function () use ($values, &$valueCache) { - return $valueCache ??= iterator_to_array($values, false); - }; - } else { - $callback = null; - } - - return $this->setAutocompleterCallback($callback); - } - - /** - * Gets the callback function used for the autocompleter. - */ - public function getAutocompleterCallback(): ?callable - { - return $this->autocompleterCallback; - } - - /** - * Sets the callback function used for the autocompleter. - * - * The callback is passed the user input as argument and should return an iterable of corresponding suggestions. - * - * @return $this - */ - public function setAutocompleterCallback(callable $callback = null): static - { - if (1 > \func_num_args()) { - trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); - } - if ($this->hidden && null !== $callback) { - throw new LogicException('A hidden question cannot use the autocompleter.'); - } - - $this->autocompleterCallback = null === $callback ? null : $callback(...); - - return $this; - } - - /** - * Sets a validator for the question. - * - * @return $this - */ - public function setValidator(callable $validator = null): static - { - if (1 > \func_num_args()) { - trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); - } - $this->validator = null === $validator ? null : $validator(...); - - return $this; - } - - /** - * Gets the validator for the question. - */ - public function getValidator(): ?callable - { - return $this->validator; - } - - /** - * Sets the maximum number of attempts. - * - * Null means an unlimited number of attempts. - * - * @return $this - * - * @throws InvalidArgumentException in case the number of attempts is invalid - */ - public function setMaxAttempts(?int $attempts): static - { - if (null !== $attempts && $attempts < 1) { - throw new InvalidArgumentException('Maximum number of attempts must be a positive value.'); - } - - $this->attempts = $attempts; - - return $this; - } - - /** - * Gets the maximum number of attempts. - * - * Null means an unlimited number of attempts. - */ - public function getMaxAttempts(): ?int - { - return $this->attempts; - } - - /** - * Sets a normalizer for the response. - * - * The normalizer can be a callable (a string), a closure or a class implementing __invoke. - * - * @return $this - */ - public function setNormalizer(callable $normalizer): static - { - $this->normalizer = $normalizer(...); - - return $this; - } - - /** - * Gets the normalizer for the response. - * - * The normalizer can ba a callable (a string), a closure or a class implementing __invoke. - */ - public function getNormalizer(): ?callable - { - return $this->normalizer; - } - - protected function isAssoc(array $array) - { - return (bool) \count(array_filter(array_keys($array), 'is_string')); - } - - public function isTrimmable(): bool - { - return $this->trimmable; - } - - /** - * @return $this - */ - public function setTrimmable(bool $trimmable): static - { - $this->trimmable = $trimmable; - - return $this; - } -} diff --git a/vendor/symfony/console/README.md b/vendor/symfony/console/README.md deleted file mode 100644 index c89b4a1a..00000000 --- a/vendor/symfony/console/README.md +++ /dev/null @@ -1,20 +0,0 @@ -Console Component -================= - -The Console component eases the creation of beautiful and testable command line -interfaces. - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/components/console.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) - -Credits -------- - -`Resources/bin/hiddeninput.exe` is a third party binary provided within this -component. Find sources and license at https://github.com/Seldaek/hidden-input. diff --git a/vendor/symfony/console/Resources/completion.bash b/vendor/symfony/console/Resources/completion.bash deleted file mode 100644 index ad69eab0..00000000 --- a/vendor/symfony/console/Resources/completion.bash +++ /dev/null @@ -1,84 +0,0 @@ -# This file is part of the Symfony package. -# -# (c) Fabien Potencier -# -# For the full copyright and license information, please view -# https://symfony.com/doc/current/contributing/code/license.html - -_sf_{{ COMMAND_NAME }}() { - # Use newline as only separator to allow space in completion values - IFS=$'\n' - local sf_cmd="${COMP_WORDS[0]}" - - # for an alias, get the real script behind it - sf_cmd_type=$(type -t $sf_cmd) - if [[ $sf_cmd_type == "alias" ]]; then - sf_cmd=$(alias $sf_cmd | sed -E "s/alias $sf_cmd='(.*)'/\1/") - elif [[ $sf_cmd_type == "file" ]]; then - sf_cmd=$(type -p $sf_cmd) - fi - - if [[ $sf_cmd_type != "function" && ! -x $sf_cmd ]]; then - return 1 - fi - - local cur prev words cword - _get_comp_words_by_ref -n := cur prev words cword - - local completecmd=("$sf_cmd" "_complete" "--no-interaction" "-sbash" "-c$cword" "-a{{ VERSION }}") - for w in ${words[@]}; do - w=$(printf -- '%b' "$w") - # remove quotes from typed values - quote="${w:0:1}" - if [ "$quote" == \' ]; then - w="${w%\'}" - w="${w#\'}" - elif [ "$quote" == \" ]; then - w="${w%\"}" - w="${w#\"}" - fi - # empty values are ignored - if [ ! -z "$w" ]; then - completecmd+=("-i$w") - fi - done - - local sfcomplete - if sfcomplete=$(${completecmd[@]} 2>&1); then - local quote suggestions - quote=${cur:0:1} - - # Use single quotes by default if suggestions contains backslash (FQCN) - if [ "$quote" == '' ] && [[ "$sfcomplete" =~ \\ ]]; then - quote=\' - fi - - if [ "$quote" == \' ]; then - # single quotes: no additional escaping (does not accept ' in values) - suggestions=$(for s in $sfcomplete; do printf $'%q%q%q\n' "$quote" "$s" "$quote"; done) - elif [ "$quote" == \" ]; then - # double quotes: double escaping for \ $ ` " - suggestions=$(for s in $sfcomplete; do - s=${s//\\/\\\\} - s=${s//\$/\\\$} - s=${s//\`/\\\`} - s=${s//\"/\\\"} - printf $'%q%q%q\n' "$quote" "$s" "$quote"; - done) - else - # no quotes: double escaping - suggestions=$(for s in $sfcomplete; do printf $'%q\n' $(printf '%q' "$s"); done) - fi - COMPREPLY=($(IFS=$'\n' compgen -W "$suggestions" -- $(printf -- "%q" "$cur"))) - __ltrim_colon_completions "$cur" - else - if [[ "$sfcomplete" != *"Command \"_complete\" is not defined."* ]]; then - >&2 echo - >&2 echo $sfcomplete - fi - - return 1 - fi -} - -complete -F _sf_{{ COMMAND_NAME }} {{ COMMAND_NAME }} diff --git a/vendor/symfony/console/Resources/completion.fish b/vendor/symfony/console/Resources/completion.fish deleted file mode 100644 index 1c34292a..00000000 --- a/vendor/symfony/console/Resources/completion.fish +++ /dev/null @@ -1,29 +0,0 @@ -# This file is part of the Symfony package. -# -# (c) Fabien Potencier -# -# For the full copyright and license information, please view -# https://symfony.com/doc/current/contributing/code/license.html - -function _sf_{{ COMMAND_NAME }} - set sf_cmd (commandline -o) - set c (count (commandline -oc)) - - set completecmd "$sf_cmd[1]" "_complete" "--no-interaction" "-sfish" "-a{{ VERSION }}" - - for i in $sf_cmd - if [ $i != "" ] - set completecmd $completecmd "-i$i" - end - end - - set completecmd $completecmd "-c$c" - - set sfcomplete ($completecmd) - - for i in $sfcomplete - echo $i - end -end - -complete -c '{{ COMMAND_NAME }}' -a '(_sf_{{ COMMAND_NAME }})' -f diff --git a/vendor/symfony/console/Resources/completion.zsh b/vendor/symfony/console/Resources/completion.zsh deleted file mode 100644 index 97a9e88c..00000000 --- a/vendor/symfony/console/Resources/completion.zsh +++ /dev/null @@ -1,80 +0,0 @@ -# This file is part of the Symfony package. -# -# (c) Fabien Potencier -# -# For the full copyright and license information, please view -# https://symfony.com/doc/current/contributing/code/license.html - -# -# zsh completions for {{ COMMAND_NAME }} -# -# References: -# - https://github.com/spf13/cobra/blob/master/zsh_completions.go -# - https://github.com/symfony/symfony/blob/5.4/src/Symfony/Component/Console/Resources/completion.bash -# -_sf_{{ COMMAND_NAME }}() { - local lastParam flagPrefix requestComp out comp - local -a completions - - # The user could have moved the cursor backwards on the command-line. - # We need to trigger completion from the $CURRENT location, so we need - # to truncate the command-line ($words) up to the $CURRENT location. - # (We cannot use $CURSOR as its value does not work when a command is an alias.) - words=("${=words[1,CURRENT]}") lastParam=${words[-1]} - - # For zsh, when completing a flag with an = (e.g., {{ COMMAND_NAME }} -n=) - # completions must be prefixed with the flag - setopt local_options BASH_REMATCH - if [[ "${lastParam}" =~ '-.*=' ]]; then - # We are dealing with a flag with an = - flagPrefix="-P ${BASH_REMATCH}" - fi - - # Prepare the command to obtain completions - requestComp="${words[0]} ${words[1]} _complete --no-interaction -szsh -a{{ VERSION }} -c$((CURRENT-1))" i="" - for w in ${words[@]}; do - w=$(printf -- '%b' "$w") - # remove quotes from typed values - quote="${w:0:1}" - if [ "$quote" = \' ]; then - w="${w%\'}" - w="${w#\'}" - elif [ "$quote" = \" ]; then - w="${w%\"}" - w="${w#\"}" - fi - # empty values are ignored - if [ ! -z "$w" ]; then - i="${i}-i${w} " - fi - done - - # Ensure at least 1 input - if [ "${i}" = "" ]; then - requestComp="${requestComp} -i\" \"" - else - requestComp="${requestComp} ${i}" - fi - - # Use eval to handle any environment variables and such - out=$(eval ${requestComp} 2>/dev/null) - - while IFS='\n' read -r comp; do - if [ -n "$comp" ]; then - # If requested, completions are returned with a description. - # The description is preceded by a TAB character. - # For zsh's _describe, we need to use a : instead of a TAB. - # We first need to escape any : as part of the completion itself. - comp=${comp//:/\\:} - local tab=$(printf '\t') - comp=${comp//$tab/:} - completions+=${comp} - fi - done < <(printf "%s\n" "${out[@]}") - - # Let inbuilt _describe handle completions - eval _describe "completions" completions $flagPrefix - return $? -} - -compdef _sf_{{ COMMAND_NAME }} {{ COMMAND_NAME }} diff --git a/vendor/symfony/console/SignalRegistry/SignalRegistry.php b/vendor/symfony/console/SignalRegistry/SignalRegistry.php deleted file mode 100644 index ef2e5f04..00000000 --- a/vendor/symfony/console/SignalRegistry/SignalRegistry.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. - */ - -namespace Symfony\Component\Console\SignalRegistry; - -final class SignalRegistry -{ - private array $signalHandlers = []; - - public function __construct() - { - if (\function_exists('pcntl_async_signals')) { - pcntl_async_signals(true); - } - } - - public function register(int $signal, callable $signalHandler): void - { - if (!isset($this->signalHandlers[$signal])) { - $previousCallback = pcntl_signal_get_handler($signal); - - if (\is_callable($previousCallback)) { - $this->signalHandlers[$signal][] = $previousCallback; - } - } - - $this->signalHandlers[$signal][] = $signalHandler; - - pcntl_signal($signal, $this->handle(...)); - } - - public static function isSupported(): bool - { - return \function_exists('pcntl_signal'); - } - - /** - * @internal - */ - public function handle(int $signal): void - { - $count = \count($this->signalHandlers[$signal]); - - foreach ($this->signalHandlers[$signal] as $i => $signalHandler) { - $hasNext = $i !== $count - 1; - $signalHandler($signal, $hasNext); - } - } -} diff --git a/vendor/symfony/console/SingleCommandApplication.php b/vendor/symfony/console/SingleCommandApplication.php deleted file mode 100644 index 4f0b5ba3..00000000 --- a/vendor/symfony/console/SingleCommandApplication.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Grégoire Pineau - */ -class SingleCommandApplication extends Command -{ - private string $version = 'UNKNOWN'; - private bool $autoExit = true; - private bool $running = false; - - /** - * @return $this - */ - public function setVersion(string $version): static - { - $this->version = $version; - - return $this; - } - - /** - * @final - * - * @return $this - */ - public function setAutoExit(bool $autoExit): static - { - $this->autoExit = $autoExit; - - return $this; - } - - public function run(InputInterface $input = null, OutputInterface $output = null): int - { - if ($this->running) { - return parent::run($input, $output); - } - - // We use the command name as the application name - $application = new Application($this->getName() ?: 'UNKNOWN', $this->version); - $application->setAutoExit($this->autoExit); - // Fix the usage of the command displayed with "--help" - $this->setName($_SERVER['argv'][0]); - $application->add($this); - $application->setDefaultCommand($this->getName(), true); - - $this->running = true; - try { - $ret = $application->run($input, $output); - } finally { - $this->running = false; - } - - return $ret ?? 1; - } -} diff --git a/vendor/symfony/console/Style/OutputStyle.php b/vendor/symfony/console/Style/OutputStyle.php deleted file mode 100644 index b694bb53..00000000 --- a/vendor/symfony/console/Style/OutputStyle.php +++ /dev/null @@ -1,111 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Style; - -use Symfony\Component\Console\Formatter\OutputFormatterInterface; -use Symfony\Component\Console\Helper\ProgressBar; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Decorates output to add console style guide helpers. - * - * @author Kevin Bond - */ -abstract class OutputStyle implements OutputInterface, StyleInterface -{ - private OutputInterface $output; - - public function __construct(OutputInterface $output) - { - $this->output = $output; - } - - public function newLine(int $count = 1) - { - $this->output->write(str_repeat(\PHP_EOL, $count)); - } - - public function createProgressBar(int $max = 0): ProgressBar - { - return new ProgressBar($this->output, $max); - } - - public function write(string|iterable $messages, bool $newline = false, int $type = self::OUTPUT_NORMAL) - { - $this->output->write($messages, $newline, $type); - } - - public function writeln(string|iterable $messages, int $type = self::OUTPUT_NORMAL) - { - $this->output->writeln($messages, $type); - } - - public function setVerbosity(int $level) - { - $this->output->setVerbosity($level); - } - - public function getVerbosity(): int - { - return $this->output->getVerbosity(); - } - - public function setDecorated(bool $decorated) - { - $this->output->setDecorated($decorated); - } - - public function isDecorated(): bool - { - return $this->output->isDecorated(); - } - - public function setFormatter(OutputFormatterInterface $formatter) - { - $this->output->setFormatter($formatter); - } - - public function getFormatter(): OutputFormatterInterface - { - return $this->output->getFormatter(); - } - - public function isQuiet(): bool - { - return $this->output->isQuiet(); - } - - public function isVerbose(): bool - { - return $this->output->isVerbose(); - } - - public function isVeryVerbose(): bool - { - return $this->output->isVeryVerbose(); - } - - public function isDebug(): bool - { - return $this->output->isDebug(); - } - - protected function getErrorOutput() - { - if (!$this->output instanceof ConsoleOutputInterface) { - return $this->output; - } - - return $this->output->getErrorOutput(); - } -} diff --git a/vendor/symfony/console/Style/StyleInterface.php b/vendor/symfony/console/Style/StyleInterface.php deleted file mode 100644 index 0bb12339..00000000 --- a/vendor/symfony/console/Style/StyleInterface.php +++ /dev/null @@ -1,110 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Style; - -/** - * Output style helpers. - * - * @author Kevin Bond - */ -interface StyleInterface -{ - /** - * Formats a command title. - */ - public function title(string $message); - - /** - * Formats a section title. - */ - public function section(string $message); - - /** - * Formats a list. - */ - public function listing(array $elements); - - /** - * Formats informational text. - */ - public function text(string|array $message); - - /** - * Formats a success result bar. - */ - public function success(string|array $message); - - /** - * Formats an error result bar. - */ - public function error(string|array $message); - - /** - * Formats an warning result bar. - */ - public function warning(string|array $message); - - /** - * Formats a note admonition. - */ - public function note(string|array $message); - - /** - * Formats a caution admonition. - */ - public function caution(string|array $message); - - /** - * Formats a table. - */ - public function table(array $headers, array $rows); - - /** - * Asks a question. - */ - public function ask(string $question, string $default = null, callable $validator = null): mixed; - - /** - * Asks a question with the user input hidden. - */ - public function askHidden(string $question, callable $validator = null): mixed; - - /** - * Asks for confirmation. - */ - public function confirm(string $question, bool $default = true): bool; - - /** - * Asks a choice question. - */ - public function choice(string $question, array $choices, mixed $default = null): mixed; - - /** - * Add newline(s). - */ - public function newLine(int $count = 1); - - /** - * Starts the progress output. - */ - public function progressStart(int $max = 0); - - /** - * Advances the progress output X steps. - */ - public function progressAdvance(int $step = 1); - - /** - * Finishes the progress output. - */ - public function progressFinish(); -} diff --git a/vendor/symfony/console/Style/SymfonyStyle.php b/vendor/symfony/console/Style/SymfonyStyle.php deleted file mode 100644 index 997f8627..00000000 --- a/vendor/symfony/console/Style/SymfonyStyle.php +++ /dev/null @@ -1,444 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Style; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\RuntimeException; -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Helper\Helper; -use Symfony\Component\Console\Helper\OutputWrapper; -use Symfony\Component\Console\Helper\ProgressBar; -use Symfony\Component\Console\Helper\SymfonyQuestionHelper; -use Symfony\Component\Console\Helper\Table; -use Symfony\Component\Console\Helper\TableCell; -use Symfony\Component\Console\Helper\TableSeparator; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\TrimmedBufferOutput; -use Symfony\Component\Console\Question\ChoiceQuestion; -use Symfony\Component\Console\Question\ConfirmationQuestion; -use Symfony\Component\Console\Question\Question; -use Symfony\Component\Console\Terminal; - -/** - * Output decorator helpers for the Symfony Style Guide. - * - * @author Kevin Bond - */ -class SymfonyStyle extends OutputStyle -{ - public const MAX_LINE_LENGTH = 120; - - private InputInterface $input; - private OutputInterface $output; - private SymfonyQuestionHelper $questionHelper; - private ProgressBar $progressBar; - private int $lineLength; - private TrimmedBufferOutput $bufferedOutput; - - public function __construct(InputInterface $input, OutputInterface $output) - { - $this->input = $input; - $this->bufferedOutput = new TrimmedBufferOutput(\DIRECTORY_SEPARATOR === '\\' ? 4 : 2, $output->getVerbosity(), false, clone $output->getFormatter()); - // Windows cmd wraps lines as soon as the terminal width is reached, whether there are following chars or not. - $width = (new Terminal())->getWidth() ?: self::MAX_LINE_LENGTH; - $this->lineLength = min($width - (int) (\DIRECTORY_SEPARATOR === '\\'), self::MAX_LINE_LENGTH); - - parent::__construct($this->output = $output); - } - - /** - * Formats a message as a block of text. - */ - public function block(string|array $messages, string $type = null, string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = true) - { - $messages = \is_array($messages) ? array_values($messages) : [$messages]; - - $this->autoPrependBlock(); - $this->writeln($this->createBlock($messages, $type, $style, $prefix, $padding, $escape)); - $this->newLine(); - } - - public function title(string $message) - { - $this->autoPrependBlock(); - $this->writeln([ - sprintf('%s', OutputFormatter::escapeTrailingBackslash($message)), - sprintf('%s', str_repeat('=', Helper::width(Helper::removeDecoration($this->getFormatter(), $message)))), - ]); - $this->newLine(); - } - - public function section(string $message) - { - $this->autoPrependBlock(); - $this->writeln([ - sprintf('%s', OutputFormatter::escapeTrailingBackslash($message)), - sprintf('%s', str_repeat('-', Helper::width(Helper::removeDecoration($this->getFormatter(), $message)))), - ]); - $this->newLine(); - } - - public function listing(array $elements) - { - $this->autoPrependText(); - $elements = array_map(function ($element) { - return sprintf(' * %s', $element); - }, $elements); - - $this->writeln($elements); - $this->newLine(); - } - - public function text(string|array $message) - { - $this->autoPrependText(); - - $messages = \is_array($message) ? array_values($message) : [$message]; - foreach ($messages as $message) { - $this->writeln(sprintf(' %s', $message)); - } - } - - /** - * Formats a command comment. - */ - public function comment(string|array $message) - { - $this->block($message, null, null, ' // ', false, false); - } - - public function success(string|array $message) - { - $this->block($message, 'OK', 'fg=black;bg=green', ' ', true); - } - - public function error(string|array $message) - { - $this->block($message, 'ERROR', 'fg=white;bg=red', ' ', true); - } - - public function warning(string|array $message) - { - $this->block($message, 'WARNING', 'fg=black;bg=yellow', ' ', true); - } - - public function note(string|array $message) - { - $this->block($message, 'NOTE', 'fg=yellow', ' ! '); - } - - /** - * Formats an info message. - */ - public function info(string|array $message) - { - $this->block($message, 'INFO', 'fg=green', ' ', true); - } - - public function caution(string|array $message) - { - $this->block($message, 'CAUTION', 'fg=white;bg=red', ' ! ', true); - } - - public function table(array $headers, array $rows) - { - $this->createTable() - ->setHeaders($headers) - ->setRows($rows) - ->render() - ; - - $this->newLine(); - } - - /** - * Formats a horizontal table. - */ - public function horizontalTable(array $headers, array $rows) - { - $this->createTable() - ->setHorizontal(true) - ->setHeaders($headers) - ->setRows($rows) - ->render() - ; - - $this->newLine(); - } - - /** - * Formats a list of key/value horizontally. - * - * Each row can be one of: - * * 'A title' - * * ['key' => 'value'] - * * new TableSeparator() - */ - public function definitionList(string|array|TableSeparator ...$list) - { - $headers = []; - $row = []; - foreach ($list as $value) { - if ($value instanceof TableSeparator) { - $headers[] = $value; - $row[] = $value; - continue; - } - if (\is_string($value)) { - $headers[] = new TableCell($value, ['colspan' => 2]); - $row[] = null; - continue; - } - if (!\is_array($value)) { - throw new InvalidArgumentException('Value should be an array, string, or an instance of TableSeparator.'); - } - $headers[] = key($value); - $row[] = current($value); - } - - $this->horizontalTable($headers, [$row]); - } - - public function ask(string $question, string $default = null, callable $validator = null): mixed - { - $question = new Question($question, $default); - $question->setValidator($validator); - - return $this->askQuestion($question); - } - - public function askHidden(string $question, callable $validator = null): mixed - { - $question = new Question($question); - - $question->setHidden(true); - $question->setValidator($validator); - - return $this->askQuestion($question); - } - - public function confirm(string $question, bool $default = true): bool - { - return $this->askQuestion(new ConfirmationQuestion($question, $default)); - } - - public function choice(string $question, array $choices, mixed $default = null, bool $multiSelect = false): mixed - { - if (null !== $default) { - $values = array_flip($choices); - $default = $values[$default] ?? $default; - } - - $questionChoice = new ChoiceQuestion($question, $choices, $default); - $questionChoice->setMultiselect($multiSelect); - - return $this->askQuestion($questionChoice); - } - - public function progressStart(int $max = 0) - { - $this->progressBar = $this->createProgressBar($max); - $this->progressBar->start(); - } - - public function progressAdvance(int $step = 1) - { - $this->getProgressBar()->advance($step); - } - - public function progressFinish() - { - $this->getProgressBar()->finish(); - $this->newLine(2); - unset($this->progressBar); - } - - public function createProgressBar(int $max = 0): ProgressBar - { - $progressBar = parent::createProgressBar($max); - - if ('\\' !== \DIRECTORY_SEPARATOR || 'Hyper' === getenv('TERM_PROGRAM')) { - $progressBar->setEmptyBarCharacter('░'); // light shade character \u2591 - $progressBar->setProgressCharacter(''); - $progressBar->setBarCharacter('▓'); // dark shade character \u2593 - } - - return $progressBar; - } - - /** - * @see ProgressBar::iterate() - */ - public function progressIterate(iterable $iterable, int $max = null): iterable - { - yield from $this->createProgressBar()->iterate($iterable, $max); - - $this->newLine(2); - } - - public function askQuestion(Question $question): mixed - { - if ($this->input->isInteractive()) { - $this->autoPrependBlock(); - } - - $this->questionHelper ??= new SymfonyQuestionHelper(); - - $answer = $this->questionHelper->ask($this->input, $this, $question); - - if ($this->input->isInteractive()) { - $this->newLine(); - $this->bufferedOutput->write("\n"); - } - - return $answer; - } - - public function writeln(string|iterable $messages, int $type = self::OUTPUT_NORMAL) - { - if (!is_iterable($messages)) { - $messages = [$messages]; - } - - foreach ($messages as $message) { - parent::writeln($message, $type); - $this->writeBuffer($message, true, $type); - } - } - - public function write(string|iterable $messages, bool $newline = false, int $type = self::OUTPUT_NORMAL) - { - if (!is_iterable($messages)) { - $messages = [$messages]; - } - - foreach ($messages as $message) { - parent::write($message, $newline, $type); - $this->writeBuffer($message, $newline, $type); - } - } - - public function newLine(int $count = 1) - { - parent::newLine($count); - $this->bufferedOutput->write(str_repeat("\n", $count)); - } - - /** - * Returns a new instance which makes use of stderr if available. - */ - public function getErrorStyle(): self - { - return new self($this->input, $this->getErrorOutput()); - } - - public function createTable(): Table - { - $output = $this->output instanceof ConsoleOutputInterface ? $this->output->section() : $this->output; - $style = clone Table::getStyleDefinition('symfony-style-guide'); - $style->setCellHeaderFormat('%s'); - - return (new Table($output))->setStyle($style); - } - - private function getProgressBar(): ProgressBar - { - return $this->progressBar - ?? throw new RuntimeException('The ProgressBar is not started.'); - } - - private function autoPrependBlock(): void - { - $chars = substr(str_replace(\PHP_EOL, "\n", $this->bufferedOutput->fetch()), -2); - - if (!isset($chars[0])) { - $this->newLine(); // empty history, so we should start with a new line. - - return; - } - // Prepend new line for each non LF chars (This means no blank line was output before) - $this->newLine(2 - substr_count($chars, "\n")); - } - - private function autoPrependText(): void - { - $fetched = $this->bufferedOutput->fetch(); - // Prepend new line if last char isn't EOL: - if (!str_ends_with($fetched, "\n")) { - $this->newLine(); - } - } - - private function writeBuffer(string $message, bool $newLine, int $type): void - { - // We need to know if the last chars are PHP_EOL - $this->bufferedOutput->write($message, $newLine, $type); - } - - private function createBlock(iterable $messages, string $type = null, string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = false): array - { - $indentLength = 0; - $prefixLength = Helper::width(Helper::removeDecoration($this->getFormatter(), $prefix)); - $lines = []; - - if (null !== $type) { - $type = sprintf('[%s] ', $type); - $indentLength = Helper::width($type); - $lineIndentation = str_repeat(' ', $indentLength); - } - - // wrap and add newlines for each element - $outputWrapper = new OutputWrapper(); - foreach ($messages as $key => $message) { - if ($escape) { - $message = OutputFormatter::escape($message); - } - - $lines = array_merge( - $lines, - explode(\PHP_EOL, $outputWrapper->wrap( - $message, - $this->lineLength - $prefixLength - $indentLength, - \PHP_EOL - )) - ); - - if (\count($messages) > 1 && $key < \count($messages) - 1) { - $lines[] = ''; - } - } - - $firstLineIndex = 0; - if ($padding && $this->isDecorated()) { - $firstLineIndex = 1; - array_unshift($lines, ''); - $lines[] = ''; - } - - foreach ($lines as $i => &$line) { - if (null !== $type) { - $line = $firstLineIndex === $i ? $type.$line : $lineIndentation.$line; - } - - $line = $prefix.$line; - $line .= str_repeat(' ', max($this->lineLength - Helper::width(Helper::removeDecoration($this->getFormatter(), $line)), 0)); - - if ($style) { - $line = sprintf('<%s>%s', $style, $line); - } - } - - return $lines; - } -} diff --git a/vendor/symfony/console/Terminal.php b/vendor/symfony/console/Terminal.php deleted file mode 100644 index 216c609f..00000000 --- a/vendor/symfony/console/Terminal.php +++ /dev/null @@ -1,231 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console; - -use Symfony\Component\Console\Output\AnsiColorMode; - -class Terminal -{ - public const DEFAULT_COLOR_MODE = AnsiColorMode::Ansi4; - - private static ?AnsiColorMode $colorMode = null; - private static ?int $width = null; - private static ?int $height = null; - private static ?bool $stty = null; - - /** - * About Ansi color types: https://en.wikipedia.org/wiki/ANSI_escape_code#Colors - * For more information about true color support with terminals https://github.com/termstandard/colors/. - */ - public static function getColorMode(): AnsiColorMode - { - // Use Cache from previous run (or user forced mode) - if (null !== self::$colorMode) { - return self::$colorMode; - } - - // Try with $COLORTERM first - if (\is_string($colorterm = getenv('COLORTERM'))) { - $colorterm = strtolower($colorterm); - - if (str_contains($colorterm, 'truecolor')) { - self::setColorMode(AnsiColorMode::Ansi24); - - return self::$colorMode; - } - - if (str_contains($colorterm, '256color')) { - self::setColorMode(AnsiColorMode::Ansi8); - - return self::$colorMode; - } - } - - // Try with $TERM - if (\is_string($term = getenv('TERM'))) { - $term = strtolower($term); - - if (str_contains($term, 'truecolor')) { - self::setColorMode(AnsiColorMode::Ansi24); - - return self::$colorMode; - } - - if (str_contains($term, '256color')) { - self::setColorMode(AnsiColorMode::Ansi8); - - return self::$colorMode; - } - } - - self::setColorMode(self::DEFAULT_COLOR_MODE); - - return self::$colorMode; - } - - /** - * Force a terminal color mode rendering. - */ - public static function setColorMode(?AnsiColorMode $colorMode): void - { - self::$colorMode = $colorMode; - } - - /** - * Gets the terminal width. - */ - public function getWidth(): int - { - $width = getenv('COLUMNS'); - if (false !== $width) { - return (int) trim($width); - } - - if (null === self::$width) { - self::initDimensions(); - } - - return self::$width ?: 80; - } - - /** - * Gets the terminal height. - */ - public function getHeight(): int - { - $height = getenv('LINES'); - if (false !== $height) { - return (int) trim($height); - } - - if (null === self::$height) { - self::initDimensions(); - } - - return self::$height ?: 50; - } - - /** - * @internal - */ - public static function hasSttyAvailable(): bool - { - if (null !== self::$stty) { - return self::$stty; - } - - // skip check if exec function is disabled - if (!\function_exists('exec')) { - return false; - } - - exec('stty 2>&1', $output, $exitcode); - - return self::$stty = 0 === $exitcode; - } - - private static function initDimensions() - { - if ('\\' === \DIRECTORY_SEPARATOR) { - if (preg_match('/^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$/', trim(getenv('ANSICON')), $matches)) { - // extract [w, H] from "wxh (WxH)" - // or [w, h] from "wxh" - self::$width = (int) $matches[1]; - self::$height = isset($matches[4]) ? (int) $matches[4] : (int) $matches[2]; - } elseif (!self::hasVt100Support() && self::hasSttyAvailable()) { - // only use stty on Windows if the terminal does not support vt100 (e.g. Windows 7 + git-bash) - // testing for stty in a Windows 10 vt100-enabled console will implicitly disable vt100 support on STDOUT - self::initDimensionsUsingStty(); - } elseif (null !== $dimensions = self::getConsoleMode()) { - // extract [w, h] from "wxh" - self::$width = (int) $dimensions[0]; - self::$height = (int) $dimensions[1]; - } - } else { - self::initDimensionsUsingStty(); - } - } - - /** - * Returns whether STDOUT has vt100 support (some Windows 10+ configurations). - */ - private static function hasVt100Support(): bool - { - return \function_exists('sapi_windows_vt100_support') && sapi_windows_vt100_support(fopen('php://stdout', 'w')); - } - - /** - * Initializes dimensions using the output of an stty columns line. - */ - private static function initDimensionsUsingStty() - { - if ($sttyString = self::getSttyColumns()) { - if (preg_match('/rows.(\d+);.columns.(\d+);/is', $sttyString, $matches)) { - // extract [w, h] from "rows h; columns w;" - self::$width = (int) $matches[2]; - self::$height = (int) $matches[1]; - } elseif (preg_match('/;.(\d+).rows;.(\d+).columns/is', $sttyString, $matches)) { - // extract [w, h] from "; h rows; w columns" - self::$width = (int) $matches[2]; - self::$height = (int) $matches[1]; - } - } - } - - /** - * Runs and parses mode CON if it's available, suppressing any error output. - * - * @return int[]|null An array composed of the width and the height or null if it could not be parsed - */ - private static function getConsoleMode(): ?array - { - $info = self::readFromProcess('mode CON'); - - if (null === $info || !preg_match('/--------+\r?\n.+?(\d+)\r?\n.+?(\d+)\r?\n/', $info, $matches)) { - return null; - } - - return [(int) $matches[2], (int) $matches[1]]; - } - - /** - * Runs and parses stty -a if it's available, suppressing any error output. - */ - private static function getSttyColumns(): ?string - { - return self::readFromProcess(['stty', '-a']); - } - - private static function readFromProcess(string|array $command): ?string - { - if (!\function_exists('proc_open')) { - return null; - } - - $descriptorspec = [ - 1 => ['pipe', 'w'], - 2 => ['pipe', 'w'], - ]; - - $process = proc_open($command, $descriptorspec, $pipes, null, null, ['suppress_errors' => true]); - if (!\is_resource($process)) { - return null; - } - - $info = stream_get_contents($pipes[1]); - fclose($pipes[1]); - fclose($pipes[2]); - proc_close($process); - - return $info; - } -} diff --git a/vendor/symfony/console/Tester/ApplicationTester.php b/vendor/symfony/console/Tester/ApplicationTester.php deleted file mode 100644 index 58aee54d..00000000 --- a/vendor/symfony/console/Tester/ApplicationTester.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tester; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Input\ArrayInput; - -/** - * Eases the testing of console applications. - * - * When testing an application, don't forget to disable the auto exit flag: - * - * $application = new Application(); - * $application->setAutoExit(false); - * - * @author Fabien Potencier - */ -class ApplicationTester -{ - use TesterTrait; - - private Application $application; - - public function __construct(Application $application) - { - $this->application = $application; - } - - /** - * Executes the application. - * - * Available options: - * - * * interactive: Sets the input interactive flag - * * decorated: Sets the output decorated flag - * * verbosity: Sets the output verbosity flag - * * capture_stderr_separately: Make output of stdOut and stdErr separately available - * - * @return int The command exit code - */ - public function run(array $input, array $options = []): int - { - $prevShellVerbosity = getenv('SHELL_VERBOSITY'); - - try { - $this->input = new ArrayInput($input); - if (isset($options['interactive'])) { - $this->input->setInteractive($options['interactive']); - } - - if ($this->inputs) { - $this->input->setStream(self::createStream($this->inputs)); - } - - $this->initOutput($options); - - return $this->statusCode = $this->application->run($this->input, $this->output); - } finally { - // SHELL_VERBOSITY is set by Application::configureIO so we need to unset/reset it - // to its previous value to avoid one test's verbosity to spread to the following tests - if (false === $prevShellVerbosity) { - if (\function_exists('putenv')) { - @putenv('SHELL_VERBOSITY'); - } - unset($_ENV['SHELL_VERBOSITY']); - unset($_SERVER['SHELL_VERBOSITY']); - } else { - if (\function_exists('putenv')) { - @putenv('SHELL_VERBOSITY='.$prevShellVerbosity); - } - $_ENV['SHELL_VERBOSITY'] = $prevShellVerbosity; - $_SERVER['SHELL_VERBOSITY'] = $prevShellVerbosity; - } - } - } -} diff --git a/vendor/symfony/console/Tester/CommandCompletionTester.php b/vendor/symfony/console/Tester/CommandCompletionTester.php deleted file mode 100644 index ade73275..00000000 --- a/vendor/symfony/console/Tester/CommandCompletionTester.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\Console\Tester; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; - -/** - * Eases the testing of command completion. - * - * @author Jérôme Tamarelle - */ -class CommandCompletionTester -{ - private $command; - - public function __construct(Command $command) - { - $this->command = $command; - } - - /** - * Create completion suggestions from input tokens. - */ - public function complete(array $input): array - { - $currentIndex = \count($input); - if ('' === end($input)) { - array_pop($input); - } - array_unshift($input, $this->command->getName()); - - $completionInput = CompletionInput::fromTokens($input, $currentIndex); - $completionInput->bind($this->command->getDefinition()); - $suggestions = new CompletionSuggestions(); - - $this->command->complete($completionInput, $suggestions); - - $options = []; - foreach ($suggestions->getOptionSuggestions() as $option) { - $options[] = '--'.$option->getName(); - } - - return array_map('strval', array_merge($options, $suggestions->getValueSuggestions())); - } -} diff --git a/vendor/symfony/console/Tester/CommandTester.php b/vendor/symfony/console/Tester/CommandTester.php deleted file mode 100644 index 2ff813b7..00000000 --- a/vendor/symfony/console/Tester/CommandTester.php +++ /dev/null @@ -1,76 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tester; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\ArrayInput; - -/** - * Eases the testing of console commands. - * - * @author Fabien Potencier - * @author Robin Chalas - */ -class CommandTester -{ - use TesterTrait; - - private Command $command; - - public function __construct(Command $command) - { - $this->command = $command; - } - - /** - * Executes the command. - * - * Available execution options: - * - * * interactive: Sets the input interactive flag - * * decorated: Sets the output decorated flag - * * verbosity: Sets the output verbosity flag - * * capture_stderr_separately: Make output of stdOut and stdErr separately available - * - * @param array $input An array of command arguments and options - * @param array $options An array of execution options - * - * @return int The command exit code - */ - public function execute(array $input, array $options = []): int - { - // set the command name automatically if the application requires - // this argument and no command name was passed - if (!isset($input['command']) - && (null !== $application = $this->command->getApplication()) - && $application->getDefinition()->hasArgument('command') - ) { - $input = array_merge(['command' => $this->command->getName()], $input); - } - - $this->input = new ArrayInput($input); - // Use an in-memory input stream even if no inputs are set so that QuestionHelper::ask() does not rely on the blocking STDIN. - $this->input->setStream(self::createStream($this->inputs)); - - if (isset($options['interactive'])) { - $this->input->setInteractive($options['interactive']); - } - - if (!isset($options['decorated'])) { - $options['decorated'] = false; - } - - $this->initOutput($options); - - return $this->statusCode = $this->command->run($this->input, $this->output); - } -} diff --git a/vendor/symfony/console/Tester/Constraint/CommandIsSuccessful.php b/vendor/symfony/console/Tester/Constraint/CommandIsSuccessful.php deleted file mode 100644 index 09c6194b..00000000 --- a/vendor/symfony/console/Tester/Constraint/CommandIsSuccessful.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\Console\Tester\Constraint; - -use PHPUnit\Framework\Constraint\Constraint; -use Symfony\Component\Console\Command\Command; - -final class CommandIsSuccessful extends Constraint -{ - public function toString(): string - { - return 'is successful'; - } - - protected function matches($other): bool - { - return Command::SUCCESS === $other; - } - - protected function failureDescription($other): string - { - return 'the command '.$this->toString(); - } - - protected function additionalFailureDescription($other): string - { - $mapping = [ - Command::FAILURE => 'Command failed.', - Command::INVALID => 'Command was invalid.', - ]; - - return $mapping[$other] ?? sprintf('Command returned exit status %d.', $other); - } -} diff --git a/vendor/symfony/console/Tester/TesterTrait.php b/vendor/symfony/console/Tester/TesterTrait.php deleted file mode 100644 index 9670a496..00000000 --- a/vendor/symfony/console/Tester/TesterTrait.php +++ /dev/null @@ -1,178 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tester; - -use PHPUnit\Framework\Assert; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\ConsoleOutput; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\StreamOutput; -use Symfony\Component\Console\Tester\Constraint\CommandIsSuccessful; - -/** - * @author Amrouche Hamza - */ -trait TesterTrait -{ - private StreamOutput $output; - private array $inputs = []; - private bool $captureStreamsIndependently = false; - private InputInterface $input; - private int $statusCode; - - /** - * Gets the display returned by the last execution of the command or application. - * - * @throws \RuntimeException If it's called before the execute method - */ - public function getDisplay(bool $normalize = false): string - { - if (!isset($this->output)) { - throw new \RuntimeException('Output not initialized, did you execute the command before requesting the display?'); - } - - rewind($this->output->getStream()); - - $display = stream_get_contents($this->output->getStream()); - - if ($normalize) { - $display = str_replace(\PHP_EOL, "\n", $display); - } - - return $display; - } - - /** - * Gets the output written to STDERR by the application. - * - * @param bool $normalize Whether to normalize end of lines to \n or not - */ - public function getErrorOutput(bool $normalize = false): string - { - if (!$this->captureStreamsIndependently) { - throw new \LogicException('The error output is not available when the tester is run without "capture_stderr_separately" option set.'); - } - - rewind($this->output->getErrorOutput()->getStream()); - - $display = stream_get_contents($this->output->getErrorOutput()->getStream()); - - if ($normalize) { - $display = str_replace(\PHP_EOL, "\n", $display); - } - - return $display; - } - - /** - * Gets the input instance used by the last execution of the command or application. - */ - public function getInput(): InputInterface - { - return $this->input; - } - - /** - * Gets the output instance used by the last execution of the command or application. - */ - public function getOutput(): OutputInterface - { - return $this->output; - } - - /** - * Gets the status code returned by the last execution of the command or application. - * - * @throws \RuntimeException If it's called before the execute method - */ - public function getStatusCode(): int - { - return $this->statusCode ?? throw new \RuntimeException('Status code not initialized, did you execute the command before requesting the status code?'); - } - - public function assertCommandIsSuccessful(string $message = ''): void - { - Assert::assertThat($this->statusCode, new CommandIsSuccessful(), $message); - } - - /** - * Sets the user inputs. - * - * @param array $inputs An array of strings representing each input - * passed to the command input stream - * - * @return $this - */ - public function setInputs(array $inputs): static - { - $this->inputs = $inputs; - - return $this; - } - - /** - * Initializes the output property. - * - * Available options: - * - * * decorated: Sets the output decorated flag - * * verbosity: Sets the output verbosity flag - * * capture_stderr_separately: Make output of stdOut and stdErr separately available - */ - private function initOutput(array $options) - { - $this->captureStreamsIndependently = \array_key_exists('capture_stderr_separately', $options) && $options['capture_stderr_separately']; - if (!$this->captureStreamsIndependently) { - $this->output = new StreamOutput(fopen('php://memory', 'w', false)); - if (isset($options['decorated'])) { - $this->output->setDecorated($options['decorated']); - } - if (isset($options['verbosity'])) { - $this->output->setVerbosity($options['verbosity']); - } - } else { - $this->output = new ConsoleOutput( - $options['verbosity'] ?? ConsoleOutput::VERBOSITY_NORMAL, - $options['decorated'] ?? null - ); - - $errorOutput = new StreamOutput(fopen('php://memory', 'w', false)); - $errorOutput->setFormatter($this->output->getFormatter()); - $errorOutput->setVerbosity($this->output->getVerbosity()); - $errorOutput->setDecorated($this->output->isDecorated()); - - $reflectedOutput = new \ReflectionObject($this->output); - $strErrProperty = $reflectedOutput->getProperty('stderr'); - $strErrProperty->setValue($this->output, $errorOutput); - - $reflectedParent = $reflectedOutput->getParentClass(); - $streamProperty = $reflectedParent->getProperty('stream'); - $streamProperty->setValue($this->output, fopen('php://memory', 'w', false)); - } - } - - /** - * @return resource - */ - private static function createStream(array $inputs) - { - $stream = fopen('php://memory', 'r+', false); - - foreach ($inputs as $input) { - fwrite($stream, $input.\PHP_EOL); - } - - rewind($stream); - - return $stream; - } -} diff --git a/vendor/symfony/console/composer.json b/vendor/symfony/console/composer.json deleted file mode 100644 index bafe5d16..00000000 --- a/vendor/symfony/console/composer.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "name": "symfony/console", - "type": "library", - "description": "Eases the creation of beautiful and testable command line interfaces", - "keywords": ["console", "cli", "command line", "terminal"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.4|^6.0" - }, - "require-dev": { - "symfony/config": "^5.4|^6.0", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/lock": "^5.4|^6.0", - "symfony/process": "^5.4|^6.0", - "symfony/var-dumper": "^5.4|^6.0", - "psr/log": "^1|^2|^3" - }, - "provide": { - "psr/log-implementation": "1.0|2.0|3.0" - }, - "suggest": { - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "", - "psr/log": "For using the console logger" - }, - "conflict": { - "symfony/dependency-injection": "<5.4", - "symfony/dotenv": "<5.4", - "symfony/event-dispatcher": "<5.4", - "symfony/lock": "<5.4", - "symfony/process": "<5.4" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\Console\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "minimum-stability": "dev" -} diff --git a/vendor/symfony/css-selector/CHANGELOG.md b/vendor/symfony/css-selector/CHANGELOG.md deleted file mode 100644 index de81fa2e..00000000 --- a/vendor/symfony/css-selector/CHANGELOG.md +++ /dev/null @@ -1,18 +0,0 @@ -CHANGELOG -========= - -4.4.0 ------ - - * Added support for `*:only-of-type` - -2.8.0 ------ - - * Added the `CssSelectorConverter` class as a non-static API for the component. - * Deprecated the `CssSelector` static API of the component. - -2.1.0 ------ - - * none diff --git a/vendor/symfony/css-selector/CssSelectorConverter.php b/vendor/symfony/css-selector/CssSelectorConverter.php deleted file mode 100644 index 7120a295..00000000 --- a/vendor/symfony/css-selector/CssSelectorConverter.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\CssSelector; - -use Symfony\Component\CssSelector\Parser\Shortcut\ClassParser; -use Symfony\Component\CssSelector\Parser\Shortcut\ElementParser; -use Symfony\Component\CssSelector\Parser\Shortcut\EmptyStringParser; -use Symfony\Component\CssSelector\Parser\Shortcut\HashParser; -use Symfony\Component\CssSelector\XPath\Extension\HtmlExtension; -use Symfony\Component\CssSelector\XPath\Translator; - -/** - * CssSelectorConverter is the main entry point of the component and can convert CSS - * selectors to XPath expressions. - * - * @author Christophe Coevoet - */ -class CssSelectorConverter -{ - private Translator $translator; - private array $cache; - - private static array $xmlCache = []; - private static array $htmlCache = []; - - /** - * @param bool $html Whether HTML support should be enabled. Disable it for XML documents - */ - public function __construct(bool $html = true) - { - $this->translator = new Translator(); - - if ($html) { - $this->translator->registerExtension(new HtmlExtension($this->translator)); - $this->cache = &self::$htmlCache; - } else { - $this->cache = &self::$xmlCache; - } - - $this->translator - ->registerParserShortcut(new EmptyStringParser()) - ->registerParserShortcut(new ElementParser()) - ->registerParserShortcut(new ClassParser()) - ->registerParserShortcut(new HashParser()) - ; - } - - /** - * Translates a CSS expression to its XPath equivalent. - * - * Optionally, a prefix can be added to the resulting XPath - * expression with the $prefix parameter. - */ - public function toXPath(string $cssExpr, string $prefix = 'descendant-or-self::'): string - { - return $this->cache[$prefix][$cssExpr] ??= $this->translator->cssToXPath($cssExpr, $prefix); - } -} diff --git a/vendor/symfony/css-selector/Exception/ExceptionInterface.php b/vendor/symfony/css-selector/Exception/ExceptionInterface.php deleted file mode 100644 index 9e259006..00000000 --- a/vendor/symfony/css-selector/Exception/ExceptionInterface.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\CssSelector\Exception; - -/** - * Interface for exceptions. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - */ -interface ExceptionInterface extends \Throwable -{ -} diff --git a/vendor/symfony/css-selector/Exception/ExpressionErrorException.php b/vendor/symfony/css-selector/Exception/ExpressionErrorException.php deleted file mode 100644 index fd5deeab..00000000 --- a/vendor/symfony/css-selector/Exception/ExpressionErrorException.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\CssSelector\Exception; - -/** - * ParseException is thrown when a CSS selector syntax is not valid. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - */ -class ExpressionErrorException extends ParseException -{ -} diff --git a/vendor/symfony/css-selector/Exception/InternalErrorException.php b/vendor/symfony/css-selector/Exception/InternalErrorException.php deleted file mode 100644 index e60e5ed0..00000000 --- a/vendor/symfony/css-selector/Exception/InternalErrorException.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\CssSelector\Exception; - -/** - * ParseException is thrown when a CSS selector syntax is not valid. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - */ -class InternalErrorException extends ParseException -{ -} diff --git a/vendor/symfony/css-selector/Exception/ParseException.php b/vendor/symfony/css-selector/Exception/ParseException.php deleted file mode 100644 index 3b0b0ee8..00000000 --- a/vendor/symfony/css-selector/Exception/ParseException.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\CssSelector\Exception; - -/** - * ParseException is thrown when a CSS selector syntax is not valid. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Fabien Potencier - */ -class ParseException extends \Exception implements ExceptionInterface -{ -} diff --git a/vendor/symfony/css-selector/Exception/SyntaxErrorException.php b/vendor/symfony/css-selector/Exception/SyntaxErrorException.php deleted file mode 100644 index f73860ce..00000000 --- a/vendor/symfony/css-selector/Exception/SyntaxErrorException.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Exception; - -use Symfony\Component\CssSelector\Parser\Token; - -/** - * ParseException is thrown when a CSS selector syntax is not valid. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - */ -class SyntaxErrorException extends ParseException -{ - public static function unexpectedToken(string $expectedValue, Token $foundToken): self - { - return new self(sprintf('Expected %s, but %s found.', $expectedValue, $foundToken)); - } - - public static function pseudoElementFound(string $pseudoElement, string $unexpectedLocation): self - { - return new self(sprintf('Unexpected pseudo-element "::%s" found %s.', $pseudoElement, $unexpectedLocation)); - } - - public static function unclosedString(int $position): self - { - return new self(sprintf('Unclosed/invalid string at %s.', $position)); - } - - public static function nestedNot(): self - { - return new self('Got nested ::not().'); - } - - public static function stringAsFunctionArgument(): self - { - return new self('String not allowed as function argument.'); - } -} diff --git a/vendor/symfony/css-selector/LICENSE b/vendor/symfony/css-selector/LICENSE deleted file mode 100644 index 88bf75bb..00000000 --- a/vendor/symfony/css-selector/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2022 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/css-selector/Node/AbstractNode.php b/vendor/symfony/css-selector/Node/AbstractNode.php deleted file mode 100644 index d99e80a8..00000000 --- a/vendor/symfony/css-selector/Node/AbstractNode.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\CssSelector\Node; - -/** - * Abstract base node class. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -abstract class AbstractNode implements NodeInterface -{ - private string $nodeName; - - public function getNodeName(): string - { - return $this->nodeName ??= preg_replace('~.*\\\\([^\\\\]+)Node$~', '$1', static::class); - } -} diff --git a/vendor/symfony/css-selector/Node/AttributeNode.php b/vendor/symfony/css-selector/Node/AttributeNode.php deleted file mode 100644 index ba4df310..00000000 --- a/vendor/symfony/css-selector/Node/AttributeNode.php +++ /dev/null @@ -1,79 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Node; - -/** - * Represents a "[| ]" node. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -class AttributeNode extends AbstractNode -{ - private NodeInterface $selector; - private ?string $namespace; - private string $attribute; - private string $operator; - private ?string $value; - - public function __construct(NodeInterface $selector, ?string $namespace, string $attribute, string $operator, ?string $value) - { - $this->selector = $selector; - $this->namespace = $namespace; - $this->attribute = $attribute; - $this->operator = $operator; - $this->value = $value; - } - - public function getSelector(): NodeInterface - { - return $this->selector; - } - - public function getNamespace(): ?string - { - return $this->namespace; - } - - public function getAttribute(): string - { - return $this->attribute; - } - - public function getOperator(): string - { - return $this->operator; - } - - public function getValue(): ?string - { - return $this->value; - } - - public function getSpecificity(): Specificity - { - return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0)); - } - - public function __toString(): string - { - $attribute = $this->namespace ? $this->namespace.'|'.$this->attribute : $this->attribute; - - return 'exists' === $this->operator - ? sprintf('%s[%s[%s]]', $this->getNodeName(), $this->selector, $attribute) - : sprintf("%s[%s[%s %s '%s']]", $this->getNodeName(), $this->selector, $attribute, $this->operator, $this->value); - } -} diff --git a/vendor/symfony/css-selector/Node/ClassNode.php b/vendor/symfony/css-selector/Node/ClassNode.php deleted file mode 100644 index 71744587..00000000 --- a/vendor/symfony/css-selector/Node/ClassNode.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Node; - -/** - * Represents a "." node. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -class ClassNode extends AbstractNode -{ - private NodeInterface $selector; - private string $name; - - public function __construct(NodeInterface $selector, string $name) - { - $this->selector = $selector; - $this->name = $name; - } - - public function getSelector(): NodeInterface - { - return $this->selector; - } - - public function getName(): string - { - return $this->name; - } - - public function getSpecificity(): Specificity - { - return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0)); - } - - public function __toString(): string - { - return sprintf('%s[%s.%s]', $this->getNodeName(), $this->selector, $this->name); - } -} diff --git a/vendor/symfony/css-selector/Node/CombinedSelectorNode.php b/vendor/symfony/css-selector/Node/CombinedSelectorNode.php deleted file mode 100644 index 19fecb70..00000000 --- a/vendor/symfony/css-selector/Node/CombinedSelectorNode.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\CssSelector\Node; - -/** - * Represents a combined node. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -class CombinedSelectorNode extends AbstractNode -{ - private NodeInterface $selector; - private string $combinator; - private NodeInterface $subSelector; - - public function __construct(NodeInterface $selector, string $combinator, NodeInterface $subSelector) - { - $this->selector = $selector; - $this->combinator = $combinator; - $this->subSelector = $subSelector; - } - - public function getSelector(): NodeInterface - { - return $this->selector; - } - - public function getCombinator(): string - { - return $this->combinator; - } - - public function getSubSelector(): NodeInterface - { - return $this->subSelector; - } - - public function getSpecificity(): Specificity - { - return $this->selector->getSpecificity()->plus($this->subSelector->getSpecificity()); - } - - public function __toString(): string - { - $combinator = ' ' === $this->combinator ? '' : $this->combinator; - - return sprintf('%s[%s %s %s]', $this->getNodeName(), $this->selector, $combinator, $this->subSelector); - } -} diff --git a/vendor/symfony/css-selector/Node/ElementNode.php b/vendor/symfony/css-selector/Node/ElementNode.php deleted file mode 100644 index 39f4d9cc..00000000 --- a/vendor/symfony/css-selector/Node/ElementNode.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\CssSelector\Node; - -/** - * Represents a "|" node. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -class ElementNode extends AbstractNode -{ - private ?string $namespace; - private ?string $element; - - public function __construct(string $namespace = null, string $element = null) - { - $this->namespace = $namespace; - $this->element = $element; - } - - public function getNamespace(): ?string - { - return $this->namespace; - } - - public function getElement(): ?string - { - return $this->element; - } - - public function getSpecificity(): Specificity - { - return new Specificity(0, 0, $this->element ? 1 : 0); - } - - public function __toString(): string - { - $element = $this->element ?: '*'; - - return sprintf('%s[%s]', $this->getNodeName(), $this->namespace ? $this->namespace.'|'.$element : $element); - } -} diff --git a/vendor/symfony/css-selector/Node/FunctionNode.php b/vendor/symfony/css-selector/Node/FunctionNode.php deleted file mode 100644 index 8428bacc..00000000 --- a/vendor/symfony/css-selector/Node/FunctionNode.php +++ /dev/null @@ -1,73 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Node; - -use Symfony\Component\CssSelector\Parser\Token; - -/** - * Represents a ":()" node. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -class FunctionNode extends AbstractNode -{ - private NodeInterface $selector; - private string $name; - private array $arguments; - - /** - * @param Token[] $arguments - */ - public function __construct(NodeInterface $selector, string $name, array $arguments = []) - { - $this->selector = $selector; - $this->name = strtolower($name); - $this->arguments = $arguments; - } - - public function getSelector(): NodeInterface - { - return $this->selector; - } - - public function getName(): string - { - return $this->name; - } - - /** - * @return Token[] - */ - public function getArguments(): array - { - return $this->arguments; - } - - public function getSpecificity(): Specificity - { - return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0)); - } - - public function __toString(): string - { - $arguments = implode(', ', array_map(function (Token $token) { - return "'".$token->getValue()."'"; - }, $this->arguments)); - - return sprintf('%s[%s:%s(%s)]', $this->getNodeName(), $this->selector, $this->name, $arguments ? '['.$arguments.']' : ''); - } -} diff --git a/vendor/symfony/css-selector/Node/HashNode.php b/vendor/symfony/css-selector/Node/HashNode.php deleted file mode 100644 index 3af8e847..00000000 --- a/vendor/symfony/css-selector/Node/HashNode.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Node; - -/** - * Represents a "#" node. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -class HashNode extends AbstractNode -{ - private NodeInterface $selector; - private string $id; - - public function __construct(NodeInterface $selector, string $id) - { - $this->selector = $selector; - $this->id = $id; - } - - public function getSelector(): NodeInterface - { - return $this->selector; - } - - public function getId(): string - { - return $this->id; - } - - public function getSpecificity(): Specificity - { - return $this->selector->getSpecificity()->plus(new Specificity(1, 0, 0)); - } - - public function __toString(): string - { - return sprintf('%s[%s#%s]', $this->getNodeName(), $this->selector, $this->id); - } -} diff --git a/vendor/symfony/css-selector/Node/NegationNode.php b/vendor/symfony/css-selector/Node/NegationNode.php deleted file mode 100644 index f8067583..00000000 --- a/vendor/symfony/css-selector/Node/NegationNode.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Node; - -/** - * Represents a ":not()" node. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -class NegationNode extends AbstractNode -{ - private NodeInterface $selector; - private NodeInterface $subSelector; - - public function __construct(NodeInterface $selector, NodeInterface $subSelector) - { - $this->selector = $selector; - $this->subSelector = $subSelector; - } - - public function getSelector(): NodeInterface - { - return $this->selector; - } - - public function getSubSelector(): NodeInterface - { - return $this->subSelector; - } - - public function getSpecificity(): Specificity - { - return $this->selector->getSpecificity()->plus($this->subSelector->getSpecificity()); - } - - public function __toString(): string - { - return sprintf('%s[%s:not(%s)]', $this->getNodeName(), $this->selector, $this->subSelector); - } -} diff --git a/vendor/symfony/css-selector/Node/NodeInterface.php b/vendor/symfony/css-selector/Node/NodeInterface.php deleted file mode 100644 index b078d26d..00000000 --- a/vendor/symfony/css-selector/Node/NodeInterface.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. - */ - -namespace Symfony\Component\CssSelector\Node; - -/** - * Interface for nodes. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -interface NodeInterface -{ - public function getNodeName(): string; - - public function getSpecificity(): Specificity; - - public function __toString(): string; -} diff --git a/vendor/symfony/css-selector/Node/PseudoNode.php b/vendor/symfony/css-selector/Node/PseudoNode.php deleted file mode 100644 index c21cd6e9..00000000 --- a/vendor/symfony/css-selector/Node/PseudoNode.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Node; - -/** - * Represents a ":" node. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -class PseudoNode extends AbstractNode -{ - private NodeInterface $selector; - private string $identifier; - - public function __construct(NodeInterface $selector, string $identifier) - { - $this->selector = $selector; - $this->identifier = strtolower($identifier); - } - - public function getSelector(): NodeInterface - { - return $this->selector; - } - - public function getIdentifier(): string - { - return $this->identifier; - } - - public function getSpecificity(): Specificity - { - return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0)); - } - - public function __toString(): string - { - return sprintf('%s[%s:%s]', $this->getNodeName(), $this->selector, $this->identifier); - } -} diff --git a/vendor/symfony/css-selector/Node/SelectorNode.php b/vendor/symfony/css-selector/Node/SelectorNode.php deleted file mode 100644 index 0b09ab5d..00000000 --- a/vendor/symfony/css-selector/Node/SelectorNode.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Node; - -/** - * Represents a "(::|:)" node. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -class SelectorNode extends AbstractNode -{ - private NodeInterface $tree; - private ?string $pseudoElement; - - public function __construct(NodeInterface $tree, string $pseudoElement = null) - { - $this->tree = $tree; - $this->pseudoElement = $pseudoElement ? strtolower($pseudoElement) : null; - } - - public function getTree(): NodeInterface - { - return $this->tree; - } - - public function getPseudoElement(): ?string - { - return $this->pseudoElement; - } - - public function getSpecificity(): Specificity - { - return $this->tree->getSpecificity()->plus(new Specificity(0, 0, $this->pseudoElement ? 1 : 0)); - } - - public function __toString(): string - { - return sprintf('%s[%s%s]', $this->getNodeName(), $this->tree, $this->pseudoElement ? '::'.$this->pseudoElement : ''); - } -} diff --git a/vendor/symfony/css-selector/Node/Specificity.php b/vendor/symfony/css-selector/Node/Specificity.php deleted file mode 100644 index bb8e5e34..00000000 --- a/vendor/symfony/css-selector/Node/Specificity.php +++ /dev/null @@ -1,73 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Node; - -/** - * Represents a node specificity. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @see http://www.w3.org/TR/selectors/#specificity - * - * @author Jean-François Simon - * - * @internal - */ -class Specificity -{ - public const A_FACTOR = 100; - public const B_FACTOR = 10; - public const C_FACTOR = 1; - - private int $a; - private int $b; - private int $c; - - public function __construct(int $a, int $b, int $c) - { - $this->a = $a; - $this->b = $b; - $this->c = $c; - } - - public function plus(self $specificity): self - { - return new self($this->a + $specificity->a, $this->b + $specificity->b, $this->c + $specificity->c); - } - - public function getValue(): int - { - return $this->a * self::A_FACTOR + $this->b * self::B_FACTOR + $this->c * self::C_FACTOR; - } - - /** - * Returns -1 if the object specificity is lower than the argument, - * 0 if they are equal, and 1 if the argument is lower. - */ - public function compareTo(self $specificity): int - { - if ($this->a !== $specificity->a) { - return $this->a > $specificity->a ? 1 : -1; - } - - if ($this->b !== $specificity->b) { - return $this->b > $specificity->b ? 1 : -1; - } - - if ($this->c !== $specificity->c) { - return $this->c > $specificity->c ? 1 : -1; - } - - return 0; - } -} diff --git a/vendor/symfony/css-selector/Parser/Handler/CommentHandler.php b/vendor/symfony/css-selector/Parser/Handler/CommentHandler.php deleted file mode 100644 index cc01d1e6..00000000 --- a/vendor/symfony/css-selector/Parser/Handler/CommentHandler.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Parser\Handler; - -use Symfony\Component\CssSelector\Parser\Reader; -use Symfony\Component\CssSelector\Parser\TokenStream; - -/** - * CSS selector comment handler. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -class CommentHandler implements HandlerInterface -{ - public function handle(Reader $reader, TokenStream $stream): bool - { - if ('/*' !== $reader->getSubstring(2)) { - return false; - } - - $offset = $reader->getOffset('*/'); - - if (false === $offset) { - $reader->moveToEnd(); - } else { - $reader->moveForward($offset + 2); - } - - return true; - } -} diff --git a/vendor/symfony/css-selector/Parser/Handler/HandlerInterface.php b/vendor/symfony/css-selector/Parser/Handler/HandlerInterface.php deleted file mode 100644 index 9ec714d5..00000000 --- a/vendor/symfony/css-selector/Parser/Handler/HandlerInterface.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\CssSelector\Parser\Handler; - -use Symfony\Component\CssSelector\Parser\Reader; -use Symfony\Component\CssSelector\Parser\TokenStream; - -/** - * CSS selector handler interface. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -interface HandlerInterface -{ - public function handle(Reader $reader, TokenStream $stream): bool; -} diff --git a/vendor/symfony/css-selector/Parser/Handler/HashHandler.php b/vendor/symfony/css-selector/Parser/Handler/HashHandler.php deleted file mode 100644 index b29042f5..00000000 --- a/vendor/symfony/css-selector/Parser/Handler/HashHandler.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Parser\Handler; - -use Symfony\Component\CssSelector\Parser\Reader; -use Symfony\Component\CssSelector\Parser\Token; -use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping; -use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns; -use Symfony\Component\CssSelector\Parser\TokenStream; - -/** - * CSS selector comment handler. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -class HashHandler implements HandlerInterface -{ - private TokenizerPatterns $patterns; - private TokenizerEscaping $escaping; - - public function __construct(TokenizerPatterns $patterns, TokenizerEscaping $escaping) - { - $this->patterns = $patterns; - $this->escaping = $escaping; - } - - public function handle(Reader $reader, TokenStream $stream): bool - { - $match = $reader->findPattern($this->patterns->getHashPattern()); - - if (!$match) { - return false; - } - - $value = $this->escaping->escapeUnicode($match[1]); - $stream->push(new Token(Token::TYPE_HASH, $value, $reader->getPosition())); - $reader->moveForward(\strlen($match[0])); - - return true; - } -} diff --git a/vendor/symfony/css-selector/Parser/Handler/IdentifierHandler.php b/vendor/symfony/css-selector/Parser/Handler/IdentifierHandler.php deleted file mode 100644 index 25c0761e..00000000 --- a/vendor/symfony/css-selector/Parser/Handler/IdentifierHandler.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Parser\Handler; - -use Symfony\Component\CssSelector\Parser\Reader; -use Symfony\Component\CssSelector\Parser\Token; -use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping; -use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns; -use Symfony\Component\CssSelector\Parser\TokenStream; - -/** - * CSS selector comment handler. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -class IdentifierHandler implements HandlerInterface -{ - private TokenizerPatterns $patterns; - private TokenizerEscaping $escaping; - - public function __construct(TokenizerPatterns $patterns, TokenizerEscaping $escaping) - { - $this->patterns = $patterns; - $this->escaping = $escaping; - } - - public function handle(Reader $reader, TokenStream $stream): bool - { - $match = $reader->findPattern($this->patterns->getIdentifierPattern()); - - if (!$match) { - return false; - } - - $value = $this->escaping->escapeUnicode($match[0]); - $stream->push(new Token(Token::TYPE_IDENTIFIER, $value, $reader->getPosition())); - $reader->moveForward(\strlen($match[0])); - - return true; - } -} diff --git a/vendor/symfony/css-selector/Parser/Handler/NumberHandler.php b/vendor/symfony/css-selector/Parser/Handler/NumberHandler.php deleted file mode 100644 index e3eb7afe..00000000 --- a/vendor/symfony/css-selector/Parser/Handler/NumberHandler.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\CssSelector\Parser\Handler; - -use Symfony\Component\CssSelector\Parser\Reader; -use Symfony\Component\CssSelector\Parser\Token; -use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns; -use Symfony\Component\CssSelector\Parser\TokenStream; - -/** - * CSS selector comment handler. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -class NumberHandler implements HandlerInterface -{ - private TokenizerPatterns $patterns; - - public function __construct(TokenizerPatterns $patterns) - { - $this->patterns = $patterns; - } - - public function handle(Reader $reader, TokenStream $stream): bool - { - $match = $reader->findPattern($this->patterns->getNumberPattern()); - - if (!$match) { - return false; - } - - $stream->push(new Token(Token::TYPE_NUMBER, $match[0], $reader->getPosition())); - $reader->moveForward(\strlen($match[0])); - - return true; - } -} diff --git a/vendor/symfony/css-selector/Parser/Handler/StringHandler.php b/vendor/symfony/css-selector/Parser/Handler/StringHandler.php deleted file mode 100644 index 5fd44df2..00000000 --- a/vendor/symfony/css-selector/Parser/Handler/StringHandler.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Parser\Handler; - -use Symfony\Component\CssSelector\Exception\InternalErrorException; -use Symfony\Component\CssSelector\Exception\SyntaxErrorException; -use Symfony\Component\CssSelector\Parser\Reader; -use Symfony\Component\CssSelector\Parser\Token; -use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping; -use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns; -use Symfony\Component\CssSelector\Parser\TokenStream; - -/** - * CSS selector comment handler. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -class StringHandler implements HandlerInterface -{ - private TokenizerPatterns $patterns; - private TokenizerEscaping $escaping; - - public function __construct(TokenizerPatterns $patterns, TokenizerEscaping $escaping) - { - $this->patterns = $patterns; - $this->escaping = $escaping; - } - - public function handle(Reader $reader, TokenStream $stream): bool - { - $quote = $reader->getSubstring(1); - - if (!\in_array($quote, ["'", '"'])) { - return false; - } - - $reader->moveForward(1); - $match = $reader->findPattern($this->patterns->getQuotedStringPattern($quote)); - - if (!$match) { - throw new InternalErrorException(sprintf('Should have found at least an empty match at %d.', $reader->getPosition())); - } - - // check unclosed strings - if (\strlen($match[0]) === $reader->getRemainingLength()) { - throw SyntaxErrorException::unclosedString($reader->getPosition() - 1); - } - - // check quotes pairs validity - if ($quote !== $reader->getSubstring(1, \strlen($match[0]))) { - throw SyntaxErrorException::unclosedString($reader->getPosition() - 1); - } - - $string = $this->escaping->escapeUnicodeAndNewLine($match[0]); - $stream->push(new Token(Token::TYPE_STRING, $string, $reader->getPosition())); - $reader->moveForward(\strlen($match[0]) + 1); - - return true; - } -} diff --git a/vendor/symfony/css-selector/Parser/Handler/WhitespaceHandler.php b/vendor/symfony/css-selector/Parser/Handler/WhitespaceHandler.php deleted file mode 100644 index eb41c3f7..00000000 --- a/vendor/symfony/css-selector/Parser/Handler/WhitespaceHandler.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\CssSelector\Parser\Handler; - -use Symfony\Component\CssSelector\Parser\Reader; -use Symfony\Component\CssSelector\Parser\Token; -use Symfony\Component\CssSelector\Parser\TokenStream; - -/** - * CSS selector whitespace handler. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -class WhitespaceHandler implements HandlerInterface -{ - public function handle(Reader $reader, TokenStream $stream): bool - { - $match = $reader->findPattern('~^[ \t\r\n\f]+~'); - - if (false === $match) { - return false; - } - - $stream->push(new Token(Token::TYPE_WHITESPACE, $match[0], $reader->getPosition())); - $reader->moveForward(\strlen($match[0])); - - return true; - } -} diff --git a/vendor/symfony/css-selector/Parser/Parser.php b/vendor/symfony/css-selector/Parser/Parser.php deleted file mode 100644 index d611efec..00000000 --- a/vendor/symfony/css-selector/Parser/Parser.php +++ /dev/null @@ -1,350 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Parser; - -use Symfony\Component\CssSelector\Exception\SyntaxErrorException; -use Symfony\Component\CssSelector\Node; -use Symfony\Component\CssSelector\Parser\Tokenizer\Tokenizer; - -/** - * CSS selector parser. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -class Parser implements ParserInterface -{ - private Tokenizer $tokenizer; - - public function __construct(Tokenizer $tokenizer = null) - { - $this->tokenizer = $tokenizer ?? new Tokenizer(); - } - - public function parse(string $source): array - { - $reader = new Reader($source); - $stream = $this->tokenizer->tokenize($reader); - - return $this->parseSelectorList($stream); - } - - /** - * Parses the arguments for ":nth-child()" and friends. - * - * @param Token[] $tokens - * - * @throws SyntaxErrorException - */ - public static function parseSeries(array $tokens): array - { - foreach ($tokens as $token) { - if ($token->isString()) { - throw SyntaxErrorException::stringAsFunctionArgument(); - } - } - - $joined = trim(implode('', array_map(function (Token $token) { - return $token->getValue(); - }, $tokens))); - - $int = function ($string) { - if (!is_numeric($string)) { - throw SyntaxErrorException::stringAsFunctionArgument(); - } - - return (int) $string; - }; - - switch (true) { - case 'odd' === $joined: - return [2, 1]; - case 'even' === $joined: - return [2, 0]; - case 'n' === $joined: - return [1, 0]; - case !str_contains($joined, 'n'): - return [0, $int($joined)]; - } - - $split = explode('n', $joined); - $first = $split[0] ?? null; - - return [ - $first ? ('-' === $first || '+' === $first ? $int($first.'1') : $int($first)) : 1, - isset($split[1]) && $split[1] ? $int($split[1]) : 0, - ]; - } - - private function parseSelectorList(TokenStream $stream): array - { - $stream->skipWhitespace(); - $selectors = []; - - while (true) { - $selectors[] = $this->parserSelectorNode($stream); - - if ($stream->getPeek()->isDelimiter([','])) { - $stream->getNext(); - $stream->skipWhitespace(); - } else { - break; - } - } - - return $selectors; - } - - private function parserSelectorNode(TokenStream $stream): Node\SelectorNode - { - [$result, $pseudoElement] = $this->parseSimpleSelector($stream); - - while (true) { - $stream->skipWhitespace(); - $peek = $stream->getPeek(); - - if ($peek->isFileEnd() || $peek->isDelimiter([','])) { - break; - } - - if (null !== $pseudoElement) { - throw SyntaxErrorException::pseudoElementFound($pseudoElement, 'not at the end of a selector'); - } - - if ($peek->isDelimiter(['+', '>', '~'])) { - $combinator = $stream->getNext()->getValue(); - $stream->skipWhitespace(); - } else { - $combinator = ' '; - } - - [$nextSelector, $pseudoElement] = $this->parseSimpleSelector($stream); - $result = new Node\CombinedSelectorNode($result, $combinator, $nextSelector); - } - - return new Node\SelectorNode($result, $pseudoElement); - } - - /** - * Parses next simple node (hash, class, pseudo, negation). - * - * @throws SyntaxErrorException - */ - private function parseSimpleSelector(TokenStream $stream, bool $insideNegation = false): array - { - $stream->skipWhitespace(); - - $selectorStart = \count($stream->getUsed()); - $result = $this->parseElementNode($stream); - $pseudoElement = null; - - while (true) { - $peek = $stream->getPeek(); - if ($peek->isWhitespace() - || $peek->isFileEnd() - || $peek->isDelimiter([',', '+', '>', '~']) - || ($insideNegation && $peek->isDelimiter([')'])) - ) { - break; - } - - if (null !== $pseudoElement) { - throw SyntaxErrorException::pseudoElementFound($pseudoElement, 'not at the end of a selector'); - } - - if ($peek->isHash()) { - $result = new Node\HashNode($result, $stream->getNext()->getValue()); - } elseif ($peek->isDelimiter(['.'])) { - $stream->getNext(); - $result = new Node\ClassNode($result, $stream->getNextIdentifier()); - } elseif ($peek->isDelimiter(['['])) { - $stream->getNext(); - $result = $this->parseAttributeNode($result, $stream); - } elseif ($peek->isDelimiter([':'])) { - $stream->getNext(); - - if ($stream->getPeek()->isDelimiter([':'])) { - $stream->getNext(); - $pseudoElement = $stream->getNextIdentifier(); - - continue; - } - - $identifier = $stream->getNextIdentifier(); - if (\in_array(strtolower($identifier), ['first-line', 'first-letter', 'before', 'after'])) { - // Special case: CSS 2.1 pseudo-elements can have a single ':'. - // Any new pseudo-element must have two. - $pseudoElement = $identifier; - - continue; - } - - if (!$stream->getPeek()->isDelimiter(['('])) { - $result = new Node\PseudoNode($result, $identifier); - - continue; - } - - $stream->getNext(); - $stream->skipWhitespace(); - - if ('not' === strtolower($identifier)) { - if ($insideNegation) { - throw SyntaxErrorException::nestedNot(); - } - - [$argument, $argumentPseudoElement] = $this->parseSimpleSelector($stream, true); - $next = $stream->getNext(); - - if (null !== $argumentPseudoElement) { - throw SyntaxErrorException::pseudoElementFound($argumentPseudoElement, 'inside ::not()'); - } - - if (!$next->isDelimiter([')'])) { - throw SyntaxErrorException::unexpectedToken('")"', $next); - } - - $result = new Node\NegationNode($result, $argument); - } else { - $arguments = []; - $next = null; - - while (true) { - $stream->skipWhitespace(); - $next = $stream->getNext(); - - if ($next->isIdentifier() - || $next->isString() - || $next->isNumber() - || $next->isDelimiter(['+', '-']) - ) { - $arguments[] = $next; - } elseif ($next->isDelimiter([')'])) { - break; - } else { - throw SyntaxErrorException::unexpectedToken('an argument', $next); - } - } - - if (!$arguments) { - throw SyntaxErrorException::unexpectedToken('at least one argument', $next); - } - - $result = new Node\FunctionNode($result, $identifier, $arguments); - } - } else { - throw SyntaxErrorException::unexpectedToken('selector', $peek); - } - } - - if (\count($stream->getUsed()) === $selectorStart) { - throw SyntaxErrorException::unexpectedToken('selector', $stream->getPeek()); - } - - return [$result, $pseudoElement]; - } - - private function parseElementNode(TokenStream $stream): Node\ElementNode - { - $peek = $stream->getPeek(); - - if ($peek->isIdentifier() || $peek->isDelimiter(['*'])) { - if ($peek->isIdentifier()) { - $namespace = $stream->getNext()->getValue(); - } else { - $stream->getNext(); - $namespace = null; - } - - if ($stream->getPeek()->isDelimiter(['|'])) { - $stream->getNext(); - $element = $stream->getNextIdentifierOrStar(); - } else { - $element = $namespace; - $namespace = null; - } - } else { - $element = $namespace = null; - } - - return new Node\ElementNode($namespace, $element); - } - - private function parseAttributeNode(Node\NodeInterface $selector, TokenStream $stream): Node\AttributeNode - { - $stream->skipWhitespace(); - $attribute = $stream->getNextIdentifierOrStar(); - - if (null === $attribute && !$stream->getPeek()->isDelimiter(['|'])) { - throw SyntaxErrorException::unexpectedToken('"|"', $stream->getPeek()); - } - - if ($stream->getPeek()->isDelimiter(['|'])) { - $stream->getNext(); - - if ($stream->getPeek()->isDelimiter(['='])) { - $namespace = null; - $stream->getNext(); - $operator = '|='; - } else { - $namespace = $attribute; - $attribute = $stream->getNextIdentifier(); - $operator = null; - } - } else { - $namespace = $operator = null; - } - - if (null === $operator) { - $stream->skipWhitespace(); - $next = $stream->getNext(); - - if ($next->isDelimiter([']'])) { - return new Node\AttributeNode($selector, $namespace, $attribute, 'exists', null); - } elseif ($next->isDelimiter(['='])) { - $operator = '='; - } elseif ($next->isDelimiter(['^', '$', '*', '~', '|', '!']) - && $stream->getPeek()->isDelimiter(['=']) - ) { - $operator = $next->getValue().'='; - $stream->getNext(); - } else { - throw SyntaxErrorException::unexpectedToken('operator', $next); - } - } - - $stream->skipWhitespace(); - $value = $stream->getNext(); - - if ($value->isNumber()) { - // if the value is a number, it's casted into a string - $value = new Token(Token::TYPE_STRING, (string) $value->getValue(), $value->getPosition()); - } - - if (!($value->isIdentifier() || $value->isString())) { - throw SyntaxErrorException::unexpectedToken('string or identifier', $value); - } - - $stream->skipWhitespace(); - $next = $stream->getNext(); - - if (!$next->isDelimiter([']'])) { - throw SyntaxErrorException::unexpectedToken('"]"', $next); - } - - return new Node\AttributeNode($selector, $namespace, $attribute, $operator, $value->getValue()); - } -} diff --git a/vendor/symfony/css-selector/Parser/ParserInterface.php b/vendor/symfony/css-selector/Parser/ParserInterface.php deleted file mode 100644 index 51c3d935..00000000 --- a/vendor/symfony/css-selector/Parser/ParserInterface.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Parser; - -use Symfony\Component\CssSelector\Node\SelectorNode; - -/** - * CSS selector parser interface. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -interface ParserInterface -{ - /** - * Parses given selector source into an array of tokens. - * - * @return SelectorNode[] - */ - public function parse(string $source): array; -} diff --git a/vendor/symfony/css-selector/Parser/Reader.php b/vendor/symfony/css-selector/Parser/Reader.php deleted file mode 100644 index c0b6923a..00000000 --- a/vendor/symfony/css-selector/Parser/Reader.php +++ /dev/null @@ -1,83 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Parser; - -/** - * CSS selector reader. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -class Reader -{ - private string $source; - private int $length; - private int $position = 0; - - public function __construct(string $source) - { - $this->source = $source; - $this->length = \strlen($source); - } - - public function isEOF(): bool - { - return $this->position >= $this->length; - } - - public function getPosition(): int - { - return $this->position; - } - - public function getRemainingLength(): int - { - return $this->length - $this->position; - } - - public function getSubstring(int $length, int $offset = 0): string - { - return substr($this->source, $this->position + $offset, $length); - } - - public function getOffset(string $string) - { - $position = strpos($this->source, $string, $this->position); - - return false === $position ? false : $position - $this->position; - } - - public function findPattern(string $pattern): array|false - { - $source = substr($this->source, $this->position); - - if (preg_match($pattern, $source, $matches)) { - return $matches; - } - - return false; - } - - public function moveForward(int $length) - { - $this->position += $length; - } - - public function moveToEnd() - { - $this->position = $this->length; - } -} diff --git a/vendor/symfony/css-selector/Parser/Shortcut/ClassParser.php b/vendor/symfony/css-selector/Parser/Shortcut/ClassParser.php deleted file mode 100644 index f0ce6118..00000000 --- a/vendor/symfony/css-selector/Parser/Shortcut/ClassParser.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Parser\Shortcut; - -use Symfony\Component\CssSelector\Node\ClassNode; -use Symfony\Component\CssSelector\Node\ElementNode; -use Symfony\Component\CssSelector\Node\SelectorNode; -use Symfony\Component\CssSelector\Parser\ParserInterface; - -/** - * CSS selector class parser shortcut. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -class ClassParser implements ParserInterface -{ - public function parse(string $source): array - { - // Matches an optional namespace, optional element, and required class - // $source = 'test|input.ab6bd_field'; - // $matches = array (size=4) - // 0 => string 'test|input.ab6bd_field' (length=22) - // 1 => string 'test' (length=4) - // 2 => string 'input' (length=5) - // 3 => string 'ab6bd_field' (length=11) - if (preg_match('/^(?:([a-z]++)\|)?+([\w-]++|\*)?+\.([\w-]++)$/i', trim($source), $matches)) { - return [ - new SelectorNode(new ClassNode(new ElementNode($matches[1] ?: null, $matches[2] ?: null), $matches[3])), - ]; - } - - return []; - } -} diff --git a/vendor/symfony/css-selector/Parser/Shortcut/ElementParser.php b/vendor/symfony/css-selector/Parser/Shortcut/ElementParser.php deleted file mode 100644 index a448e4a8..00000000 --- a/vendor/symfony/css-selector/Parser/Shortcut/ElementParser.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Parser\Shortcut; - -use Symfony\Component\CssSelector\Node\ElementNode; -use Symfony\Component\CssSelector\Node\SelectorNode; -use Symfony\Component\CssSelector\Parser\ParserInterface; - -/** - * CSS selector element parser shortcut. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -class ElementParser implements ParserInterface -{ - public function parse(string $source): array - { - // Matches an optional namespace, required element or `*` - // $source = 'testns|testel'; - // $matches = array (size=3) - // 0 => string 'testns|testel' (length=13) - // 1 => string 'testns' (length=6) - // 2 => string 'testel' (length=6) - if (preg_match('/^(?:([a-z]++)\|)?([\w-]++|\*)$/i', trim($source), $matches)) { - return [new SelectorNode(new ElementNode($matches[1] ?: null, $matches[2]))]; - } - - return []; - } -} diff --git a/vendor/symfony/css-selector/Parser/Shortcut/EmptyStringParser.php b/vendor/symfony/css-selector/Parser/Shortcut/EmptyStringParser.php deleted file mode 100644 index a6391912..00000000 --- a/vendor/symfony/css-selector/Parser/Shortcut/EmptyStringParser.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\CssSelector\Parser\Shortcut; - -use Symfony\Component\CssSelector\Node\ElementNode; -use Symfony\Component\CssSelector\Node\SelectorNode; -use Symfony\Component\CssSelector\Parser\ParserInterface; - -/** - * CSS selector class parser shortcut. - * - * This shortcut ensure compatibility with previous version. - * - The parser fails to parse an empty string. - * - In the previous version, an empty string matches each tags. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -class EmptyStringParser implements ParserInterface -{ - public function parse(string $source): array - { - // Matches an empty string - if ('' == $source) { - return [new SelectorNode(new ElementNode(null, '*'))]; - } - - return []; - } -} diff --git a/vendor/symfony/css-selector/Parser/Shortcut/HashParser.php b/vendor/symfony/css-selector/Parser/Shortcut/HashParser.php deleted file mode 100644 index 6683126a..00000000 --- a/vendor/symfony/css-selector/Parser/Shortcut/HashParser.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Parser\Shortcut; - -use Symfony\Component\CssSelector\Node\ElementNode; -use Symfony\Component\CssSelector\Node\HashNode; -use Symfony\Component\CssSelector\Node\SelectorNode; -use Symfony\Component\CssSelector\Parser\ParserInterface; - -/** - * CSS selector hash parser shortcut. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -class HashParser implements ParserInterface -{ - public function parse(string $source): array - { - // Matches an optional namespace, optional element, and required id - // $source = 'test|input#ab6bd_field'; - // $matches = array (size=4) - // 0 => string 'test|input#ab6bd_field' (length=22) - // 1 => string 'test' (length=4) - // 2 => string 'input' (length=5) - // 3 => string 'ab6bd_field' (length=11) - if (preg_match('/^(?:([a-z]++)\|)?+([\w-]++|\*)?+#([\w-]++)$/i', trim($source), $matches)) { - return [ - new SelectorNode(new HashNode(new ElementNode($matches[1] ?: null, $matches[2] ?: null), $matches[3])), - ]; - } - - return []; - } -} diff --git a/vendor/symfony/css-selector/Parser/Token.php b/vendor/symfony/css-selector/Parser/Token.php deleted file mode 100644 index b50441a8..00000000 --- a/vendor/symfony/css-selector/Parser/Token.php +++ /dev/null @@ -1,111 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Parser; - -/** - * CSS selector token. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -class Token -{ - public const TYPE_FILE_END = 'eof'; - public const TYPE_DELIMITER = 'delimiter'; - public const TYPE_WHITESPACE = 'whitespace'; - public const TYPE_IDENTIFIER = 'identifier'; - public const TYPE_HASH = 'hash'; - public const TYPE_NUMBER = 'number'; - public const TYPE_STRING = 'string'; - - private ?string $type; - private ?string $value; - private ?int $position; - - public function __construct(?string $type, ?string $value, ?int $position) - { - $this->type = $type; - $this->value = $value; - $this->position = $position; - } - - public function getType(): ?int - { - return $this->type; - } - - public function getValue(): ?string - { - return $this->value; - } - - public function getPosition(): ?int - { - return $this->position; - } - - public function isFileEnd(): bool - { - return self::TYPE_FILE_END === $this->type; - } - - public function isDelimiter(array $values = []): bool - { - if (self::TYPE_DELIMITER !== $this->type) { - return false; - } - - if (!$values) { - return true; - } - - return \in_array($this->value, $values); - } - - public function isWhitespace(): bool - { - return self::TYPE_WHITESPACE === $this->type; - } - - public function isIdentifier(): bool - { - return self::TYPE_IDENTIFIER === $this->type; - } - - public function isHash(): bool - { - return self::TYPE_HASH === $this->type; - } - - public function isNumber(): bool - { - return self::TYPE_NUMBER === $this->type; - } - - public function isString(): bool - { - return self::TYPE_STRING === $this->type; - } - - public function __toString(): string - { - if ($this->value) { - return sprintf('<%s "%s" at %s>', $this->type, $this->value, $this->position); - } - - return sprintf('<%s at %s>', $this->type, $this->position); - } -} diff --git a/vendor/symfony/css-selector/Parser/TokenStream.php b/vendor/symfony/css-selector/Parser/TokenStream.php deleted file mode 100644 index 69f77780..00000000 --- a/vendor/symfony/css-selector/Parser/TokenStream.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\CssSelector\Parser; - -use Symfony\Component\CssSelector\Exception\InternalErrorException; -use Symfony\Component\CssSelector\Exception\SyntaxErrorException; - -/** - * CSS selector token stream. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -class TokenStream -{ - /** - * @var Token[] - */ - private array $tokens = []; - - /** - * @var Token[] - */ - private array $used = []; - - private int $cursor = 0; - private ?Token $peeked; - private bool $peeking = false; - - /** - * Pushes a token. - * - * @return $this - */ - public function push(Token $token): static - { - $this->tokens[] = $token; - - return $this; - } - - /** - * Freezes stream. - * - * @return $this - */ - public function freeze(): static - { - return $this; - } - - /** - * Returns next token. - * - * @throws InternalErrorException If there is no more token - */ - public function getNext(): Token - { - if ($this->peeking) { - $this->peeking = false; - $this->used[] = $this->peeked; - - return $this->peeked; - } - - if (!isset($this->tokens[$this->cursor])) { - throw new InternalErrorException('Unexpected token stream end.'); - } - - return $this->tokens[$this->cursor++]; - } - - /** - * Returns peeked token. - */ - public function getPeek(): Token - { - if (!$this->peeking) { - $this->peeked = $this->getNext(); - $this->peeking = true; - } - - return $this->peeked; - } - - /** - * Returns used tokens. - * - * @return Token[] - */ - public function getUsed(): array - { - return $this->used; - } - - /** - * Returns next identifier token. - * - * @throws SyntaxErrorException If next token is not an identifier - */ - public function getNextIdentifier(): string - { - $next = $this->getNext(); - - if (!$next->isIdentifier()) { - throw SyntaxErrorException::unexpectedToken('identifier', $next); - } - - return $next->getValue(); - } - - /** - * Returns next identifier or null if star delimiter token is found. - * - * @throws SyntaxErrorException If next token is not an identifier or a star delimiter - */ - public function getNextIdentifierOrStar(): ?string - { - $next = $this->getNext(); - - if ($next->isIdentifier()) { - return $next->getValue(); - } - - if ($next->isDelimiter(['*'])) { - return null; - } - - throw SyntaxErrorException::unexpectedToken('identifier or "*"', $next); - } - - /** - * Skips next whitespace if any. - */ - public function skipWhitespace() - { - $peek = $this->getPeek(); - - if ($peek->isWhitespace()) { - $this->getNext(); - } - } -} diff --git a/vendor/symfony/css-selector/Parser/Tokenizer/Tokenizer.php b/vendor/symfony/css-selector/Parser/Tokenizer/Tokenizer.php deleted file mode 100644 index 35c96a48..00000000 --- a/vendor/symfony/css-selector/Parser/Tokenizer/Tokenizer.php +++ /dev/null @@ -1,73 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Parser\Tokenizer; - -use Symfony\Component\CssSelector\Parser\Handler; -use Symfony\Component\CssSelector\Parser\Reader; -use Symfony\Component\CssSelector\Parser\Token; -use Symfony\Component\CssSelector\Parser\TokenStream; - -/** - * CSS selector tokenizer. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -class Tokenizer -{ - /** - * @var Handler\HandlerInterface[] - */ - private array $handlers; - - public function __construct() - { - $patterns = new TokenizerPatterns(); - $escaping = new TokenizerEscaping($patterns); - - $this->handlers = [ - new Handler\WhitespaceHandler(), - new Handler\IdentifierHandler($patterns, $escaping), - new Handler\HashHandler($patterns, $escaping), - new Handler\StringHandler($patterns, $escaping), - new Handler\NumberHandler($patterns), - new Handler\CommentHandler(), - ]; - } - - /** - * Tokenize selector source code. - */ - public function tokenize(Reader $reader): TokenStream - { - $stream = new TokenStream(); - - while (!$reader->isEOF()) { - foreach ($this->handlers as $handler) { - if ($handler->handle($reader, $stream)) { - continue 2; - } - } - - $stream->push(new Token(Token::TYPE_DELIMITER, $reader->getSubstring(1), $reader->getPosition())); - $reader->moveForward(1); - } - - return $stream - ->push(new Token(Token::TYPE_FILE_END, null, $reader->getPosition())) - ->freeze(); - } -} diff --git a/vendor/symfony/css-selector/Parser/Tokenizer/TokenizerEscaping.php b/vendor/symfony/css-selector/Parser/Tokenizer/TokenizerEscaping.php deleted file mode 100644 index 8c4b9f74..00000000 --- a/vendor/symfony/css-selector/Parser/Tokenizer/TokenizerEscaping.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Parser\Tokenizer; - -/** - * CSS selector tokenizer escaping applier. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -class TokenizerEscaping -{ - private TokenizerPatterns $patterns; - - public function __construct(TokenizerPatterns $patterns) - { - $this->patterns = $patterns; - } - - public function escapeUnicode(string $value): string - { - $value = $this->replaceUnicodeSequences($value); - - return preg_replace($this->patterns->getSimpleEscapePattern(), '$1', $value); - } - - public function escapeUnicodeAndNewLine(string $value): string - { - $value = preg_replace($this->patterns->getNewLineEscapePattern(), '', $value); - - return $this->escapeUnicode($value); - } - - private function replaceUnicodeSequences(string $value): string - { - return preg_replace_callback($this->patterns->getUnicodeEscapePattern(), function ($match) { - $c = hexdec($match[1]); - - if (0x80 > $c %= 0x200000) { - return \chr($c); - } - if (0x800 > $c) { - return \chr(0xC0 | $c >> 6).\chr(0x80 | $c & 0x3F); - } - if (0x10000 > $c) { - return \chr(0xE0 | $c >> 12).\chr(0x80 | $c >> 6 & 0x3F).\chr(0x80 | $c & 0x3F); - } - - return ''; - }, $value); - } -} diff --git a/vendor/symfony/css-selector/Parser/Tokenizer/TokenizerPatterns.php b/vendor/symfony/css-selector/Parser/Tokenizer/TokenizerPatterns.php deleted file mode 100644 index 0b2767a8..00000000 --- a/vendor/symfony/css-selector/Parser/Tokenizer/TokenizerPatterns.php +++ /dev/null @@ -1,89 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Parser\Tokenizer; - -/** - * CSS selector tokenizer patterns builder. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -class TokenizerPatterns -{ - private string $unicodeEscapePattern; - private string $simpleEscapePattern; - private string $newLineEscapePattern; - private string $escapePattern; - private string $stringEscapePattern; - private string $nonAsciiPattern; - private string $nmCharPattern; - private string $nmStartPattern; - private string $identifierPattern; - private string $hashPattern; - private string $numberPattern; - private string $quotedStringPattern; - - public function __construct() - { - $this->unicodeEscapePattern = '\\\\([0-9a-f]{1,6})(?:\r\n|[ \n\r\t\f])?'; - $this->simpleEscapePattern = '\\\\(.)'; - $this->newLineEscapePattern = '\\\\(?:\n|\r\n|\r|\f)'; - $this->escapePattern = $this->unicodeEscapePattern.'|\\\\[^\n\r\f0-9a-f]'; - $this->stringEscapePattern = $this->newLineEscapePattern.'|'.$this->escapePattern; - $this->nonAsciiPattern = '[^\x00-\x7F]'; - $this->nmCharPattern = '[_a-z0-9-]|'.$this->escapePattern.'|'.$this->nonAsciiPattern; - $this->nmStartPattern = '[_a-z]|'.$this->escapePattern.'|'.$this->nonAsciiPattern; - $this->identifierPattern = '-?(?:'.$this->nmStartPattern.')(?:'.$this->nmCharPattern.')*'; - $this->hashPattern = '#((?:'.$this->nmCharPattern.')+)'; - $this->numberPattern = '[+-]?(?:[0-9]*\.[0-9]+|[0-9]+)'; - $this->quotedStringPattern = '([^\n\r\f%s]|'.$this->stringEscapePattern.')*'; - } - - public function getNewLineEscapePattern(): string - { - return '~^'.$this->newLineEscapePattern.'~'; - } - - public function getSimpleEscapePattern(): string - { - return '~^'.$this->simpleEscapePattern.'~'; - } - - public function getUnicodeEscapePattern(): string - { - return '~^'.$this->unicodeEscapePattern.'~i'; - } - - public function getIdentifierPattern(): string - { - return '~^'.$this->identifierPattern.'~i'; - } - - public function getHashPattern(): string - { - return '~^'.$this->hashPattern.'~i'; - } - - public function getNumberPattern(): string - { - return '~^'.$this->numberPattern.'~'; - } - - public function getQuotedStringPattern(string $quote): string - { - return '~^'.sprintf($this->quotedStringPattern, $quote).'~i'; - } -} diff --git a/vendor/symfony/css-selector/README.md b/vendor/symfony/css-selector/README.md deleted file mode 100644 index ede4a3ac..00000000 --- a/vendor/symfony/css-selector/README.md +++ /dev/null @@ -1,20 +0,0 @@ -CssSelector Component -===================== - -The CssSelector component converts CSS selectors to XPath expressions. - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/components/css_selector.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) - -Credits -------- - -This component is a port of the Python cssselect library -[v0.7.1](https://github.com/SimonSapin/cssselect/releases/tag/v0.7.1), -which is distributed under the BSD license. diff --git a/vendor/symfony/css-selector/XPath/Extension/AbstractExtension.php b/vendor/symfony/css-selector/XPath/Extension/AbstractExtension.php deleted file mode 100644 index 495f8829..00000000 --- a/vendor/symfony/css-selector/XPath/Extension/AbstractExtension.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\XPath\Extension; - -/** - * XPath expression translator abstract extension. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -abstract class AbstractExtension implements ExtensionInterface -{ - public function getNodeTranslators(): array - { - return []; - } - - public function getCombinationTranslators(): array - { - return []; - } - - public function getFunctionTranslators(): array - { - return []; - } - - public function getPseudoClassTranslators(): array - { - return []; - } - - public function getAttributeMatchingTranslators(): array - { - return []; - } -} diff --git a/vendor/symfony/css-selector/XPath/Extension/AttributeMatchingExtension.php b/vendor/symfony/css-selector/XPath/Extension/AttributeMatchingExtension.php deleted file mode 100644 index 3c785e97..00000000 --- a/vendor/symfony/css-selector/XPath/Extension/AttributeMatchingExtension.php +++ /dev/null @@ -1,113 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\XPath\Extension; - -use Symfony\Component\CssSelector\XPath\Translator; -use Symfony\Component\CssSelector\XPath\XPathExpr; - -/** - * XPath expression translator attribute extension. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -class AttributeMatchingExtension extends AbstractExtension -{ - public function getAttributeMatchingTranslators(): array - { - return [ - 'exists' => $this->translateExists(...), - '=' => $this->translateEquals(...), - '~=' => $this->translateIncludes(...), - '|=' => $this->translateDashMatch(...), - '^=' => $this->translatePrefixMatch(...), - '$=' => $this->translateSuffixMatch(...), - '*=' => $this->translateSubstringMatch(...), - '!=' => $this->translateDifferent(...), - ]; - } - - public function translateExists(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr - { - return $xpath->addCondition($attribute); - } - - public function translateEquals(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr - { - return $xpath->addCondition(sprintf('%s = %s', $attribute, Translator::getXpathLiteral($value))); - } - - public function translateIncludes(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr - { - return $xpath->addCondition($value ? sprintf( - '%1$s and contains(concat(\' \', normalize-space(%1$s), \' \'), %2$s)', - $attribute, - Translator::getXpathLiteral(' '.$value.' ') - ) : '0'); - } - - public function translateDashMatch(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr - { - return $xpath->addCondition(sprintf( - '%1$s and (%1$s = %2$s or starts-with(%1$s, %3$s))', - $attribute, - Translator::getXpathLiteral($value), - Translator::getXpathLiteral($value.'-') - )); - } - - public function translatePrefixMatch(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr - { - return $xpath->addCondition($value ? sprintf( - '%1$s and starts-with(%1$s, %2$s)', - $attribute, - Translator::getXpathLiteral($value) - ) : '0'); - } - - public function translateSuffixMatch(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr - { - return $xpath->addCondition($value ? sprintf( - '%1$s and substring(%1$s, string-length(%1$s)-%2$s) = %3$s', - $attribute, - \strlen($value) - 1, - Translator::getXpathLiteral($value) - ) : '0'); - } - - public function translateSubstringMatch(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr - { - return $xpath->addCondition($value ? sprintf( - '%1$s and contains(%1$s, %2$s)', - $attribute, - Translator::getXpathLiteral($value) - ) : '0'); - } - - public function translateDifferent(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr - { - return $xpath->addCondition(sprintf( - $value ? 'not(%1$s) or %1$s != %2$s' : '%s != %s', - $attribute, - Translator::getXpathLiteral($value) - )); - } - - public function getName(): string - { - return 'attribute-matching'; - } -} diff --git a/vendor/symfony/css-selector/XPath/Extension/CombinationExtension.php b/vendor/symfony/css-selector/XPath/Extension/CombinationExtension.php deleted file mode 100644 index f78d4888..00000000 --- a/vendor/symfony/css-selector/XPath/Extension/CombinationExtension.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\XPath\Extension; - -use Symfony\Component\CssSelector\XPath\XPathExpr; - -/** - * XPath expression translator combination extension. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -class CombinationExtension extends AbstractExtension -{ - public function getCombinationTranslators(): array - { - return [ - ' ' => $this->translateDescendant(...), - '>' => $this->translateChild(...), - '+' => $this->translateDirectAdjacent(...), - '~' => $this->translateIndirectAdjacent(...), - ]; - } - - public function translateDescendant(XPathExpr $xpath, XPathExpr $combinedXpath): XPathExpr - { - return $xpath->join('/descendant-or-self::*/', $combinedXpath); - } - - public function translateChild(XPathExpr $xpath, XPathExpr $combinedXpath): XPathExpr - { - return $xpath->join('/', $combinedXpath); - } - - public function translateDirectAdjacent(XPathExpr $xpath, XPathExpr $combinedXpath): XPathExpr - { - return $xpath - ->join('/following-sibling::', $combinedXpath) - ->addNameTest() - ->addCondition('position() = 1'); - } - - public function translateIndirectAdjacent(XPathExpr $xpath, XPathExpr $combinedXpath): XPathExpr - { - return $xpath->join('/following-sibling::', $combinedXpath); - } - - public function getName(): string - { - return 'combination'; - } -} diff --git a/vendor/symfony/css-selector/XPath/Extension/ExtensionInterface.php b/vendor/symfony/css-selector/XPath/Extension/ExtensionInterface.php deleted file mode 100644 index 1a74b90a..00000000 --- a/vendor/symfony/css-selector/XPath/Extension/ExtensionInterface.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\CssSelector\XPath\Extension; - -/** - * XPath expression translator extension interface. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -interface ExtensionInterface -{ - /** - * Returns node translators. - * - * These callables will receive the node as first argument and the translator as second argument. - * - * @return callable[] - */ - public function getNodeTranslators(): array; - - /** - * Returns combination translators. - * - * @return callable[] - */ - public function getCombinationTranslators(): array; - - /** - * Returns function translators. - * - * @return callable[] - */ - public function getFunctionTranslators(): array; - - /** - * Returns pseudo-class translators. - * - * @return callable[] - */ - public function getPseudoClassTranslators(): array; - - /** - * Returns attribute operation translators. - * - * @return callable[] - */ - public function getAttributeMatchingTranslators(): array; - - /** - * Returns extension name. - */ - public function getName(): string; -} diff --git a/vendor/symfony/css-selector/XPath/Extension/FunctionExtension.php b/vendor/symfony/css-selector/XPath/Extension/FunctionExtension.php deleted file mode 100644 index 4b9d7bc2..00000000 --- a/vendor/symfony/css-selector/XPath/Extension/FunctionExtension.php +++ /dev/null @@ -1,165 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\XPath\Extension; - -use Symfony\Component\CssSelector\Exception\ExpressionErrorException; -use Symfony\Component\CssSelector\Exception\SyntaxErrorException; -use Symfony\Component\CssSelector\Node\FunctionNode; -use Symfony\Component\CssSelector\Parser\Parser; -use Symfony\Component\CssSelector\XPath\Translator; -use Symfony\Component\CssSelector\XPath\XPathExpr; - -/** - * XPath expression translator function extension. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -class FunctionExtension extends AbstractExtension -{ - public function getFunctionTranslators(): array - { - return [ - 'nth-child' => $this->translateNthChild(...), - 'nth-last-child' => $this->translateNthLastChild(...), - 'nth-of-type' => $this->translateNthOfType(...), - 'nth-last-of-type' => $this->translateNthLastOfType(...), - 'contains' => $this->translateContains(...), - 'lang' => $this->translateLang(...), - ]; - } - - /** - * @throws ExpressionErrorException - */ - public function translateNthChild(XPathExpr $xpath, FunctionNode $function, bool $last = false, bool $addNameTest = true): XPathExpr - { - try { - [$a, $b] = Parser::parseSeries($function->getArguments()); - } catch (SyntaxErrorException $e) { - throw new ExpressionErrorException(sprintf('Invalid series: "%s".', implode('", "', $function->getArguments())), 0, $e); - } - - $xpath->addStarPrefix(); - if ($addNameTest) { - $xpath->addNameTest(); - } - - if (0 === $a) { - return $xpath->addCondition('position() = '.($last ? 'last() - '.($b - 1) : $b)); - } - - if ($a < 0) { - if ($b < 1) { - return $xpath->addCondition('false()'); - } - - $sign = '<='; - } else { - $sign = '>='; - } - - $expr = 'position()'; - - if ($last) { - $expr = 'last() - '.$expr; - --$b; - } - - if (0 !== $b) { - $expr .= ' - '.$b; - } - - $conditions = [sprintf('%s %s 0', $expr, $sign)]; - - if (1 !== $a && -1 !== $a) { - $conditions[] = sprintf('(%s) mod %d = 0', $expr, $a); - } - - return $xpath->addCondition(implode(' and ', $conditions)); - - // todo: handle an+b, odd, even - // an+b means every-a, plus b, e.g., 2n+1 means odd - // 0n+b means b - // n+0 means a=1, i.e., all elements - // an means every a elements, i.e., 2n means even - // -n means -1n - // -1n+6 means elements 6 and previous - } - - public function translateNthLastChild(XPathExpr $xpath, FunctionNode $function): XPathExpr - { - return $this->translateNthChild($xpath, $function, true); - } - - public function translateNthOfType(XPathExpr $xpath, FunctionNode $function): XPathExpr - { - return $this->translateNthChild($xpath, $function, false, false); - } - - /** - * @throws ExpressionErrorException - */ - public function translateNthLastOfType(XPathExpr $xpath, FunctionNode $function): XPathExpr - { - if ('*' === $xpath->getElement()) { - throw new ExpressionErrorException('"*:nth-of-type()" is not implemented.'); - } - - return $this->translateNthChild($xpath, $function, true, false); - } - - /** - * @throws ExpressionErrorException - */ - public function translateContains(XPathExpr $xpath, FunctionNode $function): XPathExpr - { - $arguments = $function->getArguments(); - foreach ($arguments as $token) { - if (!($token->isString() || $token->isIdentifier())) { - throw new ExpressionErrorException('Expected a single string or identifier for :contains(), got '.implode(', ', $arguments)); - } - } - - return $xpath->addCondition(sprintf( - 'contains(string(.), %s)', - Translator::getXpathLiteral($arguments[0]->getValue()) - )); - } - - /** - * @throws ExpressionErrorException - */ - public function translateLang(XPathExpr $xpath, FunctionNode $function): XPathExpr - { - $arguments = $function->getArguments(); - foreach ($arguments as $token) { - if (!($token->isString() || $token->isIdentifier())) { - throw new ExpressionErrorException('Expected a single string or identifier for :lang(), got '.implode(', ', $arguments)); - } - } - - return $xpath->addCondition(sprintf( - 'lang(%s)', - Translator::getXpathLiteral($arguments[0]->getValue()) - )); - } - - public function getName(): string - { - return 'function'; - } -} diff --git a/vendor/symfony/css-selector/XPath/Extension/HtmlExtension.php b/vendor/symfony/css-selector/XPath/Extension/HtmlExtension.php deleted file mode 100644 index 4653add5..00000000 --- a/vendor/symfony/css-selector/XPath/Extension/HtmlExtension.php +++ /dev/null @@ -1,178 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\XPath\Extension; - -use Symfony\Component\CssSelector\Exception\ExpressionErrorException; -use Symfony\Component\CssSelector\Node\FunctionNode; -use Symfony\Component\CssSelector\XPath\Translator; -use Symfony\Component\CssSelector\XPath\XPathExpr; - -/** - * XPath expression translator HTML extension. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -class HtmlExtension extends AbstractExtension -{ - public function __construct(Translator $translator) - { - $translator - ->getExtension('node') - ->setFlag(NodeExtension::ELEMENT_NAME_IN_LOWER_CASE, true) - ->setFlag(NodeExtension::ATTRIBUTE_NAME_IN_LOWER_CASE, true); - } - - public function getPseudoClassTranslators(): array - { - return [ - 'checked' => $this->translateChecked(...), - 'link' => $this->translateLink(...), - 'disabled' => $this->translateDisabled(...), - 'enabled' => $this->translateEnabled(...), - 'selected' => $this->translateSelected(...), - 'invalid' => $this->translateInvalid(...), - 'hover' => $this->translateHover(...), - 'visited' => $this->translateVisited(...), - ]; - } - - public function getFunctionTranslators(): array - { - return [ - 'lang' => $this->translateLang(...), - ]; - } - - public function translateChecked(XPathExpr $xpath): XPathExpr - { - return $xpath->addCondition( - '(@checked ' - ."and (name(.) = 'input' or name(.) = 'command')" - ."and (@type = 'checkbox' or @type = 'radio'))" - ); - } - - public function translateLink(XPathExpr $xpath): XPathExpr - { - return $xpath->addCondition("@href and (name(.) = 'a' or name(.) = 'link' or name(.) = 'area')"); - } - - public function translateDisabled(XPathExpr $xpath): XPathExpr - { - return $xpath->addCondition( - '(' - .'@disabled and' - .'(' - ."(name(.) = 'input' and @type != 'hidden')" - ." or name(.) = 'button'" - ." or name(.) = 'select'" - ." or name(.) = 'textarea'" - ." or name(.) = 'command'" - ." or name(.) = 'fieldset'" - ." or name(.) = 'optgroup'" - ." or name(.) = 'option'" - .')' - .') or (' - ."(name(.) = 'input' and @type != 'hidden')" - ." or name(.) = 'button'" - ." or name(.) = 'select'" - ." or name(.) = 'textarea'" - .')' - .' and ancestor::fieldset[@disabled]' - ); - // todo: in the second half, add "and is not a descendant of that fieldset element's first legend element child, if any." - } - - public function translateEnabled(XPathExpr $xpath): XPathExpr - { - return $xpath->addCondition( - '(' - .'@href and (' - ."name(.) = 'a'" - ." or name(.) = 'link'" - ." or name(.) = 'area'" - .')' - .') or (' - .'(' - ."name(.) = 'command'" - ." or name(.) = 'fieldset'" - ." or name(.) = 'optgroup'" - .')' - .' and not(@disabled)' - .') or (' - .'(' - ."(name(.) = 'input' and @type != 'hidden')" - ." or name(.) = 'button'" - ." or name(.) = 'select'" - ." or name(.) = 'textarea'" - ." or name(.) = 'keygen'" - .')' - .' and not (@disabled or ancestor::fieldset[@disabled])' - .') or (' - ."name(.) = 'option' and not(" - .'@disabled or ancestor::optgroup[@disabled]' - .')' - .')' - ); - } - - /** - * @throws ExpressionErrorException - */ - public function translateLang(XPathExpr $xpath, FunctionNode $function): XPathExpr - { - $arguments = $function->getArguments(); - foreach ($arguments as $token) { - if (!($token->isString() || $token->isIdentifier())) { - throw new ExpressionErrorException('Expected a single string or identifier for :lang(), got '.implode(', ', $arguments)); - } - } - - return $xpath->addCondition(sprintf( - 'ancestor-or-self::*[@lang][1][starts-with(concat(' - ."translate(@%s, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'), '-')" - .', %s)]', - 'lang', - Translator::getXpathLiteral(strtolower($arguments[0]->getValue()).'-') - )); - } - - public function translateSelected(XPathExpr $xpath): XPathExpr - { - return $xpath->addCondition("(@selected and name(.) = 'option')"); - } - - public function translateInvalid(XPathExpr $xpath): XPathExpr - { - return $xpath->addCondition('0'); - } - - public function translateHover(XPathExpr $xpath): XPathExpr - { - return $xpath->addCondition('0'); - } - - public function translateVisited(XPathExpr $xpath): XPathExpr - { - return $xpath->addCondition('0'); - } - - public function getName(): string - { - return 'html'; - } -} diff --git a/vendor/symfony/css-selector/XPath/Extension/NodeExtension.php b/vendor/symfony/css-selector/XPath/Extension/NodeExtension.php deleted file mode 100644 index 49e894ad..00000000 --- a/vendor/symfony/css-selector/XPath/Extension/NodeExtension.php +++ /dev/null @@ -1,191 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\XPath\Extension; - -use Symfony\Component\CssSelector\Node; -use Symfony\Component\CssSelector\XPath\Translator; -use Symfony\Component\CssSelector\XPath\XPathExpr; - -/** - * XPath expression translator node extension. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -class NodeExtension extends AbstractExtension -{ - public const ELEMENT_NAME_IN_LOWER_CASE = 1; - public const ATTRIBUTE_NAME_IN_LOWER_CASE = 2; - public const ATTRIBUTE_VALUE_IN_LOWER_CASE = 4; - - private int $flags; - - public function __construct(int $flags = 0) - { - $this->flags = $flags; - } - - /** - * @return $this - */ - public function setFlag(int $flag, bool $on): static - { - if ($on && !$this->hasFlag($flag)) { - $this->flags += $flag; - } - - if (!$on && $this->hasFlag($flag)) { - $this->flags -= $flag; - } - - return $this; - } - - public function hasFlag(int $flag): bool - { - return (bool) ($this->flags & $flag); - } - - public function getNodeTranslators(): array - { - return [ - 'Selector' => $this->translateSelector(...), - 'CombinedSelector' => $this->translateCombinedSelector(...), - 'Negation' => $this->translateNegation(...), - 'Function' => $this->translateFunction(...), - 'Pseudo' => $this->translatePseudo(...), - 'Attribute' => $this->translateAttribute(...), - 'Class' => $this->translateClass(...), - 'Hash' => $this->translateHash(...), - 'Element' => $this->translateElement(...), - ]; - } - - public function translateSelector(Node\SelectorNode $node, Translator $translator): XPathExpr - { - return $translator->nodeToXPath($node->getTree()); - } - - public function translateCombinedSelector(Node\CombinedSelectorNode $node, Translator $translator): XPathExpr - { - return $translator->addCombination($node->getCombinator(), $node->getSelector(), $node->getSubSelector()); - } - - public function translateNegation(Node\NegationNode $node, Translator $translator): XPathExpr - { - $xpath = $translator->nodeToXPath($node->getSelector()); - $subXpath = $translator->nodeToXPath($node->getSubSelector()); - $subXpath->addNameTest(); - - if ($subXpath->getCondition()) { - return $xpath->addCondition(sprintf('not(%s)', $subXpath->getCondition())); - } - - return $xpath->addCondition('0'); - } - - public function translateFunction(Node\FunctionNode $node, Translator $translator): XPathExpr - { - $xpath = $translator->nodeToXPath($node->getSelector()); - - return $translator->addFunction($xpath, $node); - } - - public function translatePseudo(Node\PseudoNode $node, Translator $translator): XPathExpr - { - $xpath = $translator->nodeToXPath($node->getSelector()); - - return $translator->addPseudoClass($xpath, $node->getIdentifier()); - } - - public function translateAttribute(Node\AttributeNode $node, Translator $translator): XPathExpr - { - $name = $node->getAttribute(); - $safe = $this->isSafeName($name); - - if ($this->hasFlag(self::ATTRIBUTE_NAME_IN_LOWER_CASE)) { - $name = strtolower($name); - } - - if ($node->getNamespace()) { - $name = sprintf('%s:%s', $node->getNamespace(), $name); - $safe = $safe && $this->isSafeName($node->getNamespace()); - } - - $attribute = $safe ? '@'.$name : sprintf('attribute::*[name() = %s]', Translator::getXpathLiteral($name)); - $value = $node->getValue(); - $xpath = $translator->nodeToXPath($node->getSelector()); - - if ($this->hasFlag(self::ATTRIBUTE_VALUE_IN_LOWER_CASE)) { - $value = strtolower($value); - } - - return $translator->addAttributeMatching($xpath, $node->getOperator(), $attribute, $value); - } - - public function translateClass(Node\ClassNode $node, Translator $translator): XPathExpr - { - $xpath = $translator->nodeToXPath($node->getSelector()); - - return $translator->addAttributeMatching($xpath, '~=', '@class', $node->getName()); - } - - public function translateHash(Node\HashNode $node, Translator $translator): XPathExpr - { - $xpath = $translator->nodeToXPath($node->getSelector()); - - return $translator->addAttributeMatching($xpath, '=', '@id', $node->getId()); - } - - public function translateElement(Node\ElementNode $node): XPathExpr - { - $element = $node->getElement(); - - if ($element && $this->hasFlag(self::ELEMENT_NAME_IN_LOWER_CASE)) { - $element = strtolower($element); - } - - if ($element) { - $safe = $this->isSafeName($element); - } else { - $element = '*'; - $safe = true; - } - - if ($node->getNamespace()) { - $element = sprintf('%s:%s', $node->getNamespace(), $element); - $safe = $safe && $this->isSafeName($node->getNamespace()); - } - - $xpath = new XPathExpr('', $element); - - if (!$safe) { - $xpath->addNameTest(); - } - - return $xpath; - } - - public function getName(): string - { - return 'node'; - } - - private function isSafeName(string $name): bool - { - return 0 < preg_match('~^[a-zA-Z_][a-zA-Z0-9_.-]*$~', $name); - } -} diff --git a/vendor/symfony/css-selector/XPath/Extension/PseudoClassExtension.php b/vendor/symfony/css-selector/XPath/Extension/PseudoClassExtension.php deleted file mode 100644 index 36ab582e..00000000 --- a/vendor/symfony/css-selector/XPath/Extension/PseudoClassExtension.php +++ /dev/null @@ -1,116 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\XPath\Extension; - -use Symfony\Component\CssSelector\Exception\ExpressionErrorException; -use Symfony\Component\CssSelector\XPath\XPathExpr; - -/** - * XPath expression translator pseudo-class extension. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -class PseudoClassExtension extends AbstractExtension -{ - public function getPseudoClassTranslators(): array - { - return [ - 'root' => $this->translateRoot(...), - 'first-child' => $this->translateFirstChild(...), - 'last-child' => $this->translateLastChild(...), - 'first-of-type' => $this->translateFirstOfType(...), - 'last-of-type' => $this->translateLastOfType(...), - 'only-child' => $this->translateOnlyChild(...), - 'only-of-type' => $this->translateOnlyOfType(...), - 'empty' => $this->translateEmpty(...), - ]; - } - - public function translateRoot(XPathExpr $xpath): XPathExpr - { - return $xpath->addCondition('not(parent::*)'); - } - - public function translateFirstChild(XPathExpr $xpath): XPathExpr - { - return $xpath - ->addStarPrefix() - ->addNameTest() - ->addCondition('position() = 1'); - } - - public function translateLastChild(XPathExpr $xpath): XPathExpr - { - return $xpath - ->addStarPrefix() - ->addNameTest() - ->addCondition('position() = last()'); - } - - /** - * @throws ExpressionErrorException - */ - public function translateFirstOfType(XPathExpr $xpath): XPathExpr - { - if ('*' === $xpath->getElement()) { - throw new ExpressionErrorException('"*:first-of-type" is not implemented.'); - } - - return $xpath - ->addStarPrefix() - ->addCondition('position() = 1'); - } - - /** - * @throws ExpressionErrorException - */ - public function translateLastOfType(XPathExpr $xpath): XPathExpr - { - if ('*' === $xpath->getElement()) { - throw new ExpressionErrorException('"*:last-of-type" is not implemented.'); - } - - return $xpath - ->addStarPrefix() - ->addCondition('position() = last()'); - } - - public function translateOnlyChild(XPathExpr $xpath): XPathExpr - { - return $xpath - ->addStarPrefix() - ->addNameTest() - ->addCondition('last() = 1'); - } - - public function translateOnlyOfType(XPathExpr $xpath): XPathExpr - { - $element = $xpath->getElement(); - - return $xpath->addCondition(sprintf('count(preceding-sibling::%s)=0 and count(following-sibling::%s)=0', $element, $element)); - } - - public function translateEmpty(XPathExpr $xpath): XPathExpr - { - return $xpath->addCondition('not(*) and not(string-length())'); - } - - public function getName(): string - { - return 'pseudo-class'; - } -} diff --git a/vendor/symfony/css-selector/XPath/Translator.php b/vendor/symfony/css-selector/XPath/Translator.php deleted file mode 100644 index 83e855b5..00000000 --- a/vendor/symfony/css-selector/XPath/Translator.php +++ /dev/null @@ -1,224 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\XPath; - -use Symfony\Component\CssSelector\Exception\ExpressionErrorException; -use Symfony\Component\CssSelector\Node\FunctionNode; -use Symfony\Component\CssSelector\Node\NodeInterface; -use Symfony\Component\CssSelector\Node\SelectorNode; -use Symfony\Component\CssSelector\Parser\Parser; -use Symfony\Component\CssSelector\Parser\ParserInterface; - -/** - * XPath expression translator interface. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -class Translator implements TranslatorInterface -{ - private ParserInterface $mainParser; - - /** - * @var ParserInterface[] - */ - private array $shortcutParsers = []; - - /** - * @var Extension\ExtensionInterface[] - */ - private array $extensions = []; - - private array $nodeTranslators = []; - private array $combinationTranslators = []; - private array $functionTranslators = []; - private array $pseudoClassTranslators = []; - private array $attributeMatchingTranslators = []; - - public function __construct(ParserInterface $parser = null) - { - $this->mainParser = $parser ?? new Parser(); - - $this - ->registerExtension(new Extension\NodeExtension()) - ->registerExtension(new Extension\CombinationExtension()) - ->registerExtension(new Extension\FunctionExtension()) - ->registerExtension(new Extension\PseudoClassExtension()) - ->registerExtension(new Extension\AttributeMatchingExtension()) - ; - } - - public static function getXpathLiteral(string $element): string - { - if (!str_contains($element, "'")) { - return "'".$element."'"; - } - - if (!str_contains($element, '"')) { - return '"'.$element.'"'; - } - - $string = $element; - $parts = []; - while (true) { - if (false !== $pos = strpos($string, "'")) { - $parts[] = sprintf("'%s'", substr($string, 0, $pos)); - $parts[] = "\"'\""; - $string = substr($string, $pos + 1); - } else { - $parts[] = "'$string'"; - break; - } - } - - return sprintf('concat(%s)', implode(', ', $parts)); - } - - public function cssToXPath(string $cssExpr, string $prefix = 'descendant-or-self::'): string - { - $selectors = $this->parseSelectors($cssExpr); - - /** @var SelectorNode $selector */ - foreach ($selectors as $index => $selector) { - if (null !== $selector->getPseudoElement()) { - throw new ExpressionErrorException('Pseudo-elements are not supported.'); - } - - $selectors[$index] = $this->selectorToXPath($selector, $prefix); - } - - return implode(' | ', $selectors); - } - - public function selectorToXPath(SelectorNode $selector, string $prefix = 'descendant-or-self::'): string - { - return ($prefix ?: '').$this->nodeToXPath($selector); - } - - /** - * @return $this - */ - public function registerExtension(Extension\ExtensionInterface $extension): static - { - $this->extensions[$extension->getName()] = $extension; - - $this->nodeTranslators = array_merge($this->nodeTranslators, $extension->getNodeTranslators()); - $this->combinationTranslators = array_merge($this->combinationTranslators, $extension->getCombinationTranslators()); - $this->functionTranslators = array_merge($this->functionTranslators, $extension->getFunctionTranslators()); - $this->pseudoClassTranslators = array_merge($this->pseudoClassTranslators, $extension->getPseudoClassTranslators()); - $this->attributeMatchingTranslators = array_merge($this->attributeMatchingTranslators, $extension->getAttributeMatchingTranslators()); - - return $this; - } - - /** - * @throws ExpressionErrorException - */ - public function getExtension(string $name): Extension\ExtensionInterface - { - if (!isset($this->extensions[$name])) { - throw new ExpressionErrorException(sprintf('Extension "%s" not registered.', $name)); - } - - return $this->extensions[$name]; - } - - /** - * @return $this - */ - public function registerParserShortcut(ParserInterface $shortcut): static - { - $this->shortcutParsers[] = $shortcut; - - return $this; - } - - /** - * @throws ExpressionErrorException - */ - public function nodeToXPath(NodeInterface $node): XPathExpr - { - if (!isset($this->nodeTranslators[$node->getNodeName()])) { - throw new ExpressionErrorException(sprintf('Node "%s" not supported.', $node->getNodeName())); - } - - return $this->nodeTranslators[$node->getNodeName()]($node, $this); - } - - /** - * @throws ExpressionErrorException - */ - public function addCombination(string $combiner, NodeInterface $xpath, NodeInterface $combinedXpath): XPathExpr - { - if (!isset($this->combinationTranslators[$combiner])) { - throw new ExpressionErrorException(sprintf('Combiner "%s" not supported.', $combiner)); - } - - return $this->combinationTranslators[$combiner]($this->nodeToXPath($xpath), $this->nodeToXPath($combinedXpath)); - } - - /** - * @throws ExpressionErrorException - */ - public function addFunction(XPathExpr $xpath, FunctionNode $function): XPathExpr - { - if (!isset($this->functionTranslators[$function->getName()])) { - throw new ExpressionErrorException(sprintf('Function "%s" not supported.', $function->getName())); - } - - return $this->functionTranslators[$function->getName()]($xpath, $function); - } - - /** - * @throws ExpressionErrorException - */ - public function addPseudoClass(XPathExpr $xpath, string $pseudoClass): XPathExpr - { - if (!isset($this->pseudoClassTranslators[$pseudoClass])) { - throw new ExpressionErrorException(sprintf('Pseudo-class "%s" not supported.', $pseudoClass)); - } - - return $this->pseudoClassTranslators[$pseudoClass]($xpath); - } - - /** - * @throws ExpressionErrorException - */ - public function addAttributeMatching(XPathExpr $xpath, string $operator, string $attribute, ?string $value): XPathExpr - { - if (!isset($this->attributeMatchingTranslators[$operator])) { - throw new ExpressionErrorException(sprintf('Attribute matcher operator "%s" not supported.', $operator)); - } - - return $this->attributeMatchingTranslators[$operator]($xpath, $attribute, $value); - } - - /** - * @return SelectorNode[] - */ - private function parseSelectors(string $css): array - { - foreach ($this->shortcutParsers as $shortcut) { - $tokens = $shortcut->parse($css); - - if ($tokens) { - return $tokens; - } - } - - return $this->mainParser->parse($css); - } -} diff --git a/vendor/symfony/css-selector/XPath/TranslatorInterface.php b/vendor/symfony/css-selector/XPath/TranslatorInterface.php deleted file mode 100644 index c19eefb9..00000000 --- a/vendor/symfony/css-selector/XPath/TranslatorInterface.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\CssSelector\XPath; - -use Symfony\Component\CssSelector\Node\SelectorNode; - -/** - * XPath expression translator interface. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -interface TranslatorInterface -{ - /** - * Translates a CSS selector to an XPath expression. - */ - public function cssToXPath(string $cssExpr, string $prefix = 'descendant-or-self::'): string; - - /** - * Translates a parsed selector node to an XPath expression. - */ - public function selectorToXPath(SelectorNode $selector, string $prefix = 'descendant-or-self::'): string; -} diff --git a/vendor/symfony/css-selector/XPath/XPathExpr.php b/vendor/symfony/css-selector/XPath/XPathExpr.php deleted file mode 100644 index a76e30be..00000000 --- a/vendor/symfony/css-selector/XPath/XPathExpr.php +++ /dev/null @@ -1,111 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\XPath; - -/** - * XPath expression translator interface. - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * @author Jean-François Simon - * - * @internal - */ -class XPathExpr -{ - private string $path; - private string $element; - private string $condition; - - public function __construct(string $path = '', string $element = '*', string $condition = '', bool $starPrefix = false) - { - $this->path = $path; - $this->element = $element; - $this->condition = $condition; - - if ($starPrefix) { - $this->addStarPrefix(); - } - } - - public function getElement(): string - { - return $this->element; - } - - /** - * @return $this - */ - public function addCondition(string $condition): static - { - $this->condition = $this->condition ? sprintf('(%s) and (%s)', $this->condition, $condition) : $condition; - - return $this; - } - - public function getCondition(): string - { - return $this->condition; - } - - /** - * @return $this - */ - public function addNameTest(): static - { - if ('*' !== $this->element) { - $this->addCondition('name() = '.Translator::getXpathLiteral($this->element)); - $this->element = '*'; - } - - return $this; - } - - /** - * @return $this - */ - public function addStarPrefix(): static - { - $this->path .= '*/'; - - return $this; - } - - /** - * Joins another XPathExpr with a combiner. - * - * @return $this - */ - public function join(string $combiner, self $expr): static - { - $path = $this->__toString().$combiner; - - if ('*/' !== $expr->path) { - $path .= $expr->path; - } - - $this->path = $path; - $this->element = $expr->element; - $this->condition = $expr->condition; - - return $this; - } - - public function __toString(): string - { - $path = $this->path.$this->element; - $condition = null === $this->condition || '' === $this->condition ? '' : '['.$this->condition.']'; - - return $path.$condition; - } -} diff --git a/vendor/symfony/css-selector/composer.json b/vendor/symfony/css-selector/composer.json deleted file mode 100644 index c08fdc2c..00000000 --- a/vendor/symfony/css-selector/composer.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "symfony/css-selector", - "type": "library", - "description": "Converts CSS selectors to XPath expressions", - "keywords": [], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Jean-François Simon", - "email": "jeanfrancois.simon@sensiolabs.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.1" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\CssSelector\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "minimum-stability": "dev" -} diff --git a/vendor/symfony/deprecation-contracts/CHANGELOG.md b/vendor/symfony/deprecation-contracts/CHANGELOG.md deleted file mode 100644 index 7932e261..00000000 --- a/vendor/symfony/deprecation-contracts/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -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/symfony/deprecation-contracts/LICENSE b/vendor/symfony/deprecation-contracts/LICENSE deleted file mode 100644 index 406242ff..00000000 --- a/vendor/symfony/deprecation-contracts/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020-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/deprecation-contracts/README.md b/vendor/symfony/deprecation-contracts/README.md deleted file mode 100644 index 4957933a..00000000 --- a/vendor/symfony/deprecation-contracts/README.md +++ /dev/null @@ -1,26 +0,0 @@ -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 necessarily recommended, the deprecation notices can be completely ignored by declaring an empty -`function trigger_deprecation() {}` in your application. diff --git a/vendor/symfony/deprecation-contracts/composer.json b/vendor/symfony/deprecation-contracts/composer.json deleted file mode 100644 index 774200fd..00000000 --- a/vendor/symfony/deprecation-contracts/composer.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "symfony/deprecation-contracts", - "type": "library", - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.1" - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "3.3-dev" - }, - "thanks": { - "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 deleted file mode 100644 index 2d56512b..00000000 --- a/vendor/symfony/deprecation-contracts/function.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. - */ - -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/error-handler/BufferingLogger.php b/vendor/symfony/error-handler/BufferingLogger.php deleted file mode 100644 index 95008243..00000000 --- a/vendor/symfony/error-handler/BufferingLogger.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\ErrorHandler; - -use Psr\Log\AbstractLogger; - -/** - * A buffering logger that stacks logs for later. - * - * @author Nicolas Grekas - */ -class BufferingLogger extends AbstractLogger -{ - private array $logs = []; - - public function log($level, $message, array $context = []): void - { - $this->logs[] = [$level, $message, $context]; - } - - public function cleanLogs(): array - { - $logs = $this->logs; - $this->logs = []; - - return $logs; - } - - public function __sleep(): array - { - throw new \BadMethodCallException('Cannot serialize '.__CLASS__); - } - - public function __wakeup() - { - throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); - } - - public function __destruct() - { - foreach ($this->logs as [$level, $message, $context]) { - if (str_contains($message, '{')) { - foreach ($context as $key => $val) { - if (null === $val || \is_scalar($val) || (\is_object($val) && \is_callable([$val, '__toString']))) { - $message = str_replace("{{$key}}", $val, $message); - } elseif ($val instanceof \DateTimeInterface) { - $message = str_replace("{{$key}}", $val->format(\DateTimeInterface::RFC3339), $message); - } elseif (\is_object($val)) { - $message = str_replace("{{$key}}", '[object '.get_debug_type($val).']', $message); - } else { - $message = str_replace("{{$key}}", '['.\gettype($val).']', $message); - } - } - } - - error_log(sprintf('%s [%s] %s', date(\DateTimeInterface::RFC3339), $level, $message)); - } - } -} diff --git a/vendor/symfony/error-handler/CHANGELOG.md b/vendor/symfony/error-handler/CHANGELOG.md deleted file mode 100644 index 9d2ee803..00000000 --- a/vendor/symfony/error-handler/CHANGELOG.md +++ /dev/null @@ -1,30 +0,0 @@ -CHANGELOG -========= - -6.1 ---- - - * Report overridden `@final` constants and properties - * Read environment variable `SYMFONY_IDE` to configure file link format - -5.4 ---- - - * Make `DebugClassLoader` trigger deprecation notices on missing return types - * Add `SYMFONY_PATCH_TYPE_DECLARATIONS='force=2'` mode to `DebugClassLoader` to turn annotations into native return types - -5.2.0 ------ - - * added the ability to set `HtmlErrorRenderer::$template` to a custom template to render when not in debug mode. - -5.1.0 ------ - - * The `HtmlErrorRenderer` and `SerializerErrorRenderer` add `X-Debug-Exception` and `X-Debug-Exception-File` headers in debug mode. - -4.4.0 ------ - - * added the component - * added `ErrorHandler::call()` method utility to turn any PHP error into `\ErrorException` diff --git a/vendor/symfony/error-handler/Debug.php b/vendor/symfony/error-handler/Debug.php deleted file mode 100644 index 8bb460d2..00000000 --- a/vendor/symfony/error-handler/Debug.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\ErrorHandler; - -/** - * Registers all the debug tools. - * - * @author Fabien Potencier - */ -class Debug -{ - public static function enable(): ErrorHandler - { - error_reporting(-1); - - if (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true)) { - ini_set('display_errors', 0); - } elseif (!filter_var(\ini_get('log_errors'), \FILTER_VALIDATE_BOOL) || \ini_get('error_log')) { - // CLI - display errors only if they're not already logged to STDERR - ini_set('display_errors', 1); - } - - @ini_set('zend.assertions', 1); - ini_set('assert.active', 1); - ini_set('assert.warning', 0); - ini_set('assert.exception', 1); - - DebugClassLoader::enable(); - - return ErrorHandler::register(new ErrorHandler(new BufferingLogger(), true)); - } -} diff --git a/vendor/symfony/error-handler/DebugClassLoader.php b/vendor/symfony/error-handler/DebugClassLoader.php deleted file mode 100644 index 69c28c11..00000000 --- a/vendor/symfony/error-handler/DebugClassLoader.php +++ /dev/null @@ -1,1260 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\ErrorHandler; - -use Composer\InstalledVersions; -use Doctrine\Common\Persistence\Proxy as LegacyProxy; -use Doctrine\Persistence\Proxy; -use Mockery\MockInterface; -use Phake\IMock; -use PHPUnit\Framework\MockObject\Matcher\StatelessInvocation; -use PHPUnit\Framework\MockObject\MockObject; -use Prophecy\Prophecy\ProphecySubjectInterface; -use ProxyManager\Proxy\ProxyInterface; -use Symfony\Component\ErrorHandler\Internal\TentativeTypes; -use Symfony\Component\VarExporter\LazyObjectInterface; - -/** - * Autoloader checking if the class is really defined in the file found. - * - * The ClassLoader will wrap all registered autoloaders - * and will throw an exception if a file is found but does - * not declare the class. - * - * It can also patch classes to turn docblocks into actual return types. - * This behavior is controlled by the SYMFONY_PATCH_TYPE_DECLARATIONS env var, - * which is a url-encoded array with the follow parameters: - * - "force": any value enables deprecation notices - can be any of: - * - "phpdoc" to patch only docblock annotations - * - "2" to add all possible return types - * - "1" to add return types but only to tests/final/internal/private methods - * - "php": the target version of PHP - e.g. "7.1" doesn't generate "object" types - * - "deprecations": "1" to trigger a deprecation notice when a child class misses a - * return type while the parent declares an "@return" annotation - * - * Note that patching doesn't care about any coding style so you'd better to run - * php-cs-fixer after, with rules "phpdoc_trim_consecutive_blank_line_separation" - * and "no_superfluous_phpdoc_tags" enabled typically. - * - * @author Fabien Potencier - * @author Christophe Coevoet - * @author Nicolas Grekas - * @author Guilhem Niot - */ -class DebugClassLoader -{ - private const SPECIAL_RETURN_TYPES = [ - 'void' => 'void', - 'null' => 'null', - 'resource' => 'resource', - 'boolean' => 'bool', - 'true' => 'true', - 'false' => 'false', - 'integer' => 'int', - 'array' => 'array', - 'bool' => 'bool', - 'callable' => 'callable', - 'float' => 'float', - 'int' => 'int', - 'iterable' => 'iterable', - 'object' => 'object', - 'string' => 'string', - 'self' => 'self', - 'parent' => 'parent', - 'mixed' => 'mixed', - 'static' => 'static', - '$this' => 'static', - 'list' => 'array', - 'class-string' => 'string', - 'never' => 'never', - ]; - - private const BUILTIN_RETURN_TYPES = [ - 'void' => true, - 'array' => true, - 'false' => true, - 'bool' => true, - 'callable' => true, - 'float' => true, - 'int' => true, - 'iterable' => true, - 'object' => true, - 'string' => true, - 'self' => true, - 'parent' => true, - 'mixed' => true, - 'static' => true, - 'null' => true, - 'true' => true, - 'never' => true, - ]; - - private const MAGIC_METHODS = [ - '__isset' => 'bool', - '__sleep' => 'array', - '__toString' => 'string', - '__debugInfo' => 'array', - '__serialize' => 'array', - ]; - - /** - * @var callable - */ - private $classLoader; - private bool $isFinder; - private array $loaded = []; - private array $patchTypes = []; - - private static int $caseCheck; - private static array $checkedClasses = []; - private static array $final = []; - private static array $finalMethods = []; - private static array $finalProperties = []; - private static array $finalConstants = []; - private static array $deprecated = []; - private static array $internal = []; - private static array $internalMethods = []; - private static array $annotatedParameters = []; - private static array $darwinCache = ['/' => ['/', []]]; - private static array $method = []; - private static array $returnTypes = []; - private static array $methodTraits = []; - private static array $fileOffsets = []; - - public function __construct(callable $classLoader) - { - $this->classLoader = $classLoader; - $this->isFinder = \is_array($classLoader) && method_exists($classLoader[0], 'findFile'); - parse_str(getenv('SYMFONY_PATCH_TYPE_DECLARATIONS') ?: '', $this->patchTypes); - $this->patchTypes += [ - 'force' => null, - 'php' => \PHP_MAJOR_VERSION.'.'.\PHP_MINOR_VERSION, - 'deprecations' => true, - ]; - - if ('phpdoc' === $this->patchTypes['force']) { - $this->patchTypes['force'] = 'docblock'; - } - - if (!isset(self::$caseCheck)) { - $file = is_file(__FILE__) ? __FILE__ : rtrim(realpath('.'), \DIRECTORY_SEPARATOR); - $i = strrpos($file, \DIRECTORY_SEPARATOR); - $dir = substr($file, 0, 1 + $i); - $file = substr($file, 1 + $i); - $test = strtoupper($file) === $file ? strtolower($file) : strtoupper($file); - $test = realpath($dir.$test); - - if (false === $test || false === $i) { - // filesystem is case sensitive - self::$caseCheck = 0; - } elseif (str_ends_with($test, $file)) { - // filesystem is case insensitive and realpath() normalizes the case of characters - self::$caseCheck = 1; - } elseif ('Darwin' === \PHP_OS_FAMILY) { - // on MacOSX, HFS+ is case insensitive but realpath() doesn't normalize the case of characters - self::$caseCheck = 2; - } else { - // filesystem case checks failed, fallback to disabling them - self::$caseCheck = 0; - } - } - } - - public function getClassLoader(): callable - { - return $this->classLoader; - } - - /** - * Wraps all autoloaders. - */ - public static function enable(): void - { - // Ensures we don't hit https://bugs.php.net/42098 - class_exists(\Symfony\Component\ErrorHandler\ErrorHandler::class); - class_exists(\Psr\Log\LogLevel::class); - - if (!\is_array($functions = spl_autoload_functions())) { - return; - } - - foreach ($functions as $function) { - spl_autoload_unregister($function); - } - - foreach ($functions as $function) { - if (!\is_array($function) || !$function[0] instanceof self) { - $function = [new static($function), 'loadClass']; - } - - spl_autoload_register($function); - } - } - - /** - * Disables the wrapping. - */ - public static function disable(): void - { - if (!\is_array($functions = spl_autoload_functions())) { - return; - } - - foreach ($functions as $function) { - spl_autoload_unregister($function); - } - - foreach ($functions as $function) { - if (\is_array($function) && $function[0] instanceof self) { - $function = $function[0]->getClassLoader(); - } - - spl_autoload_register($function); - } - } - - public static function checkClasses(): bool - { - if (!\is_array($functions = spl_autoload_functions())) { - return false; - } - - $loader = null; - - foreach ($functions as $function) { - if (\is_array($function) && $function[0] instanceof self) { - $loader = $function[0]; - break; - } - } - - if (null === $loader) { - return false; - } - - static $offsets = [ - 'get_declared_interfaces' => 0, - 'get_declared_traits' => 0, - 'get_declared_classes' => 0, - ]; - - foreach ($offsets as $getSymbols => $i) { - $symbols = $getSymbols(); - - for (; $i < \count($symbols); ++$i) { - if (!is_subclass_of($symbols[$i], MockObject::class) - && !is_subclass_of($symbols[$i], ProphecySubjectInterface::class) - && !is_subclass_of($symbols[$i], Proxy::class) - && !is_subclass_of($symbols[$i], ProxyInterface::class) - && !is_subclass_of($symbols[$i], LazyObjectInterface::class) - && !is_subclass_of($symbols[$i], LegacyProxy::class) - && !is_subclass_of($symbols[$i], MockInterface::class) - && !is_subclass_of($symbols[$i], IMock::class) - ) { - $loader->checkClass($symbols[$i]); - } - } - - $offsets[$getSymbols] = $i; - } - - return true; - } - - public function findFile(string $class): ?string - { - return $this->isFinder ? ($this->classLoader[0]->findFile($class) ?: null) : null; - } - - /** - * Loads the given class or interface. - * - * @throws \RuntimeException - */ - public function loadClass(string $class): void - { - $e = error_reporting(error_reporting() | \E_PARSE | \E_ERROR | \E_CORE_ERROR | \E_COMPILE_ERROR); - - try { - if ($this->isFinder && !isset($this->loaded[$class])) { - $this->loaded[$class] = true; - if (!$file = $this->classLoader[0]->findFile($class) ?: '') { - // no-op - } elseif (\function_exists('opcache_is_script_cached') && @opcache_is_script_cached($file)) { - include $file; - - return; - } elseif (false === include $file) { - return; - } - } else { - ($this->classLoader)($class); - $file = ''; - } - } finally { - error_reporting($e); - } - - $this->checkClass($class, $file); - } - - private function checkClass(string $class, string $file = null): void - { - $exists = null === $file || class_exists($class, false) || interface_exists($class, false) || trait_exists($class, false); - - if (null !== $file && $class && '\\' === $class[0]) { - $class = substr($class, 1); - } - - if ($exists) { - if (isset(self::$checkedClasses[$class])) { - return; - } - self::$checkedClasses[$class] = true; - - $refl = new \ReflectionClass($class); - if (null === $file && $refl->isInternal()) { - return; - } - $name = $refl->getName(); - - if ($name !== $class && 0 === strcasecmp($name, $class)) { - throw new \RuntimeException(sprintf('Case mismatch between loaded and declared class names: "%s" vs "%s".', $class, $name)); - } - - $deprecations = $this->checkAnnotations($refl, $name); - - foreach ($deprecations as $message) { - @trigger_error($message, \E_USER_DEPRECATED); - } - } - - if (!$file) { - return; - } - - if (!$exists) { - if (str_contains($class, '/')) { - throw new \RuntimeException(sprintf('Trying to autoload a class with an invalid name "%s". Be careful that the namespace separator is "\" in PHP, not "/".', $class)); - } - - throw new \RuntimeException(sprintf('The autoloader expected class "%s" to be defined in file "%s". The file was found but the class was not in it, the class name or namespace probably has a typo.', $class, $file)); - } - - if (self::$caseCheck && $message = $this->checkCase($refl, $file, $class)) { - throw new \RuntimeException(sprintf('Case mismatch between class and real file names: "%s" vs "%s" in "%s".', $message[0], $message[1], $message[2])); - } - } - - public function checkAnnotations(\ReflectionClass $refl, string $class): array - { - if ( - 'Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerForV7' === $class - || 'Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerForV6' === $class - ) { - return []; - } - $deprecations = []; - - $className = str_contains($class, "@anonymous\0") ? (get_parent_class($class) ?: key(class_implements($class)) ?: 'class').'@anonymous' : $class; - - // Don't trigger deprecations for classes in the same vendor - if ($class !== $className) { - $vendor = preg_match('/^namespace ([^;\\\\\s]++)[;\\\\]/m', @file_get_contents($refl->getFileName()), $vendor) ? $vendor[1].'\\' : ''; - $vendorLen = \strlen($vendor); - } elseif (2 > $vendorLen = 1 + (strpos($class, '\\') ?: strpos($class, '_'))) { - $vendorLen = 0; - $vendor = ''; - } else { - $vendor = str_replace('_', '\\', substr($class, 0, $vendorLen)); - } - - $parent = get_parent_class($class) ?: null; - self::$returnTypes[$class] = []; - $classIsTemplate = false; - - // Detect annotations on the class - if ($doc = $this->parsePhpDoc($refl)) { - $classIsTemplate = isset($doc['template']); - - foreach (['final', 'deprecated', 'internal'] as $annotation) { - if (null !== $description = $doc[$annotation][0] ?? null) { - self::${$annotation}[$class] = '' !== $description ? ' '.$description.(preg_match('/[.!]$/', $description) ? '' : '.') : '.'; - } - } - - if ($refl->isInterface() && isset($doc['method'])) { - foreach ($doc['method'] as $name => [$static, $returnType, $signature, $description]) { - self::$method[$class][] = [$class, $static, $returnType, $name.$signature, $description]; - - if ('' !== $returnType) { - $this->setReturnType($returnType, $refl->name, $name, $refl->getFileName(), $parent); - } - } - } - } - - $parentAndOwnInterfaces = $this->getOwnInterfaces($class, $parent); - if ($parent) { - $parentAndOwnInterfaces[$parent] = $parent; - - if (!isset(self::$checkedClasses[$parent])) { - $this->checkClass($parent); - } - - if (isset(self::$final[$parent])) { - $deprecations[] = sprintf('The "%s" class is considered final%s It may change without further notice as of its next major version. You should not extend it from "%s".', $parent, self::$final[$parent], $className); - } - } - - // Detect if the parent is annotated - foreach ($parentAndOwnInterfaces + class_uses($class, false) as $use) { - if (!isset(self::$checkedClasses[$use])) { - $this->checkClass($use); - } - if (isset(self::$deprecated[$use]) && strncmp($vendor, str_replace('_', '\\', $use), $vendorLen) && !isset(self::$deprecated[$class])) { - $type = class_exists($class, false) ? 'class' : (interface_exists($class, false) ? 'interface' : 'trait'); - $verb = class_exists($use, false) || interface_exists($class, false) ? 'extends' : (interface_exists($use, false) ? 'implements' : 'uses'); - - $deprecations[] = sprintf('The "%s" %s %s "%s" that is deprecated%s', $className, $type, $verb, $use, self::$deprecated[$use]); - } - if (isset(self::$internal[$use]) && strncmp($vendor, str_replace('_', '\\', $use), $vendorLen)) { - $deprecations[] = sprintf('The "%s" %s is considered internal%s It may change without further notice. You should not use it from "%s".', $use, class_exists($use, false) ? 'class' : (interface_exists($use, false) ? 'interface' : 'trait'), self::$internal[$use], $className); - } - if (isset(self::$method[$use])) { - if ($refl->isAbstract()) { - if (isset(self::$method[$class])) { - self::$method[$class] = array_merge(self::$method[$class], self::$method[$use]); - } else { - self::$method[$class] = self::$method[$use]; - } - } elseif (!$refl->isInterface()) { - if (!strncmp($vendor, str_replace('_', '\\', $use), $vendorLen) - && str_starts_with($className, 'Symfony\\') - && (!class_exists(InstalledVersions::class) - || 'symfony/symfony' !== InstalledVersions::getRootPackage()['name']) - ) { - // skip "same vendor" @method deprecations for Symfony\* classes unless symfony/symfony is being tested - continue; - } - $hasCall = $refl->hasMethod('__call'); - $hasStaticCall = $refl->hasMethod('__callStatic'); - foreach (self::$method[$use] as [$interface, $static, $returnType, $name, $description]) { - if ($static ? $hasStaticCall : $hasCall) { - continue; - } - $realName = substr($name, 0, strpos($name, '(')); - if (!$refl->hasMethod($realName) || !($methodRefl = $refl->getMethod($realName))->isPublic() || ($static && !$methodRefl->isStatic()) || (!$static && $methodRefl->isStatic())) { - $deprecations[] = sprintf('Class "%s" should implement method "%s::%s%s"%s', $className, ($static ? 'static ' : '').$interface, $name, $returnType ? ': '.$returnType : '', null === $description ? '.' : ': '.$description); - } - } - } - } - } - - if (trait_exists($class)) { - $file = $refl->getFileName(); - - foreach ($refl->getMethods() as $method) { - if ($method->getFileName() === $file) { - self::$methodTraits[$file][$method->getStartLine()] = $class; - } - } - - return $deprecations; - } - - // Inherit @final, @internal, @param and @return annotations for methods - self::$finalMethods[$class] = []; - self::$internalMethods[$class] = []; - self::$annotatedParameters[$class] = []; - self::$finalProperties[$class] = []; - self::$finalConstants[$class] = []; - foreach ($parentAndOwnInterfaces as $use) { - foreach (['finalMethods', 'internalMethods', 'annotatedParameters', 'returnTypes', 'finalProperties', 'finalConstants'] as $property) { - if (isset(self::${$property}[$use])) { - self::${$property}[$class] = self::${$property}[$class] ? self::${$property}[$use] + self::${$property}[$class] : self::${$property}[$use]; - } - } - - if (null !== (TentativeTypes::RETURN_TYPES[$use] ?? null)) { - foreach (TentativeTypes::RETURN_TYPES[$use] as $method => $returnType) { - $returnType = explode('|', $returnType); - foreach ($returnType as $i => $t) { - if ('?' !== $t && !isset(self::BUILTIN_RETURN_TYPES[$t])) { - $returnType[$i] = '\\'.$t; - } - } - $returnType = implode('|', $returnType); - - self::$returnTypes[$class] += [$method => [$returnType, str_starts_with($returnType, '?') ? substr($returnType, 1).'|null' : $returnType, $use, '']]; - } - } - } - - foreach ($refl->getMethods() as $method) { - if ($method->class !== $class) { - continue; - } - - if (null === $ns = self::$methodTraits[$method->getFileName()][$method->getStartLine()] ?? null) { - $ns = $vendor; - $len = $vendorLen; - } elseif (2 > $len = 1 + (strpos($ns, '\\') ?: strpos($ns, '_'))) { - $len = 0; - $ns = ''; - } else { - $ns = str_replace('_', '\\', substr($ns, 0, $len)); - } - - if ($parent && isset(self::$finalMethods[$parent][$method->name])) { - [$declaringClass, $message] = self::$finalMethods[$parent][$method->name]; - $deprecations[] = sprintf('The "%s::%s()" method is considered final%s It may change without further notice as of its next major version. You should not extend it from "%s".', $declaringClass, $method->name, $message, $className); - } - - if (isset(self::$internalMethods[$class][$method->name])) { - [$declaringClass, $message] = self::$internalMethods[$class][$method->name]; - if (strncmp($ns, $declaringClass, $len)) { - $deprecations[] = sprintf('The "%s::%s()" method is considered internal%s It may change without further notice. You should not extend it from "%s".', $declaringClass, $method->name, $message, $className); - } - } - - // To read method annotations - $doc = $this->parsePhpDoc($method); - - if (($classIsTemplate || isset($doc['template'])) && $method->hasReturnType()) { - unset($doc['return']); - } - - if (isset(self::$annotatedParameters[$class][$method->name])) { - $definedParameters = []; - foreach ($method->getParameters() as $parameter) { - $definedParameters[$parameter->name] = true; - } - - foreach (self::$annotatedParameters[$class][$method->name] as $parameterName => $deprecation) { - if (!isset($definedParameters[$parameterName]) && !isset($doc['param'][$parameterName])) { - $deprecations[] = sprintf($deprecation, $className); - } - } - } - - $forcePatchTypes = $this->patchTypes['force']; - - if ($canAddReturnType = null !== $forcePatchTypes && !str_contains($method->getFileName(), \DIRECTORY_SEPARATOR.'vendor'.\DIRECTORY_SEPARATOR)) { - if ('void' !== (self::MAGIC_METHODS[$method->name] ?? 'void')) { - $this->patchTypes['force'] = $forcePatchTypes ?: 'docblock'; - } - - $canAddReturnType = 2 === (int) $forcePatchTypes - || false !== stripos($method->getFileName(), \DIRECTORY_SEPARATOR.'Tests'.\DIRECTORY_SEPARATOR) - || $refl->isFinal() - || $method->isFinal() - || $method->isPrivate() - || ('.' === (self::$internal[$class] ?? null) && !$refl->isAbstract()) - || '.' === (self::$final[$class] ?? null) - || '' === ($doc['final'][0] ?? null) - || '' === ($doc['internal'][0] ?? null) - ; - } - - if (null !== ($returnType = self::$returnTypes[$class][$method->name] ?? null) && 'docblock' === $this->patchTypes['force'] && !$method->hasReturnType() && isset(TentativeTypes::RETURN_TYPES[$returnType[2]][$method->name])) { - $this->patchReturnTypeWillChange($method); - } - - if (null !== ($returnType ??= self::MAGIC_METHODS[$method->name] ?? null) && !$method->hasReturnType() && !isset($doc['return'])) { - [$normalizedType, $returnType, $declaringClass, $declaringFile] = \is_string($returnType) ? [$returnType, $returnType, '', ''] : $returnType; - - if ($canAddReturnType && 'docblock' !== $this->patchTypes['force']) { - $this->patchMethod($method, $returnType, $declaringFile, $normalizedType); - } - if (!isset($doc['deprecated']) && strncmp($ns, $declaringClass, $len)) { - if ('docblock' === $this->patchTypes['force']) { - $this->patchMethod($method, $returnType, $declaringFile, $normalizedType); - } elseif ('' !== $declaringClass && $this->patchTypes['deprecations']) { - $deprecations[] = sprintf('Method "%s::%s()" might add "%s" as a native return type declaration in the future. Do the same in %s "%s" now to avoid errors or add an explicit @return annotation to suppress this message.', $declaringClass, $method->name, $normalizedType, interface_exists($declaringClass) ? 'implementation' : 'child class', $className); - } - } - } - - if (!$doc) { - $this->patchTypes['force'] = $forcePatchTypes; - - continue; - } - - if (isset($doc['return']) || 'void' !== (self::MAGIC_METHODS[$method->name] ?? 'void')) { - $this->setReturnType($doc['return'] ?? self::MAGIC_METHODS[$method->name], $method->class, $method->name, $method->getFileName(), $parent, $method->getReturnType()); - - if (isset(self::$returnTypes[$class][$method->name][0]) && $canAddReturnType) { - $this->fixReturnStatements($method, self::$returnTypes[$class][$method->name][0]); - } - - if ($method->isPrivate()) { - unset(self::$returnTypes[$class][$method->name]); - } - } - - $this->patchTypes['force'] = $forcePatchTypes; - - if ($method->isPrivate()) { - continue; - } - - $finalOrInternal = false; - - foreach (['final', 'internal'] as $annotation) { - if (null !== $description = $doc[$annotation][0] ?? null) { - self::${$annotation.'Methods'}[$class][$method->name] = [$class, '' !== $description ? ' '.$description.(preg_match('/[[:punct:]]$/', $description) ? '' : '.') : '.']; - $finalOrInternal = true; - } - } - - if ($finalOrInternal || $method->isConstructor() || !isset($doc['param']) || StatelessInvocation::class === $class) { - continue; - } - if (!isset(self::$annotatedParameters[$class][$method->name])) { - $definedParameters = []; - foreach ($method->getParameters() as $parameter) { - $definedParameters[$parameter->name] = true; - } - } - foreach ($doc['param'] as $parameterName => $parameterType) { - if (!isset($definedParameters[$parameterName])) { - self::$annotatedParameters[$class][$method->name][$parameterName] = sprintf('The "%%s::%s()" method will require a new "%s$%s" argument in the next major version of its %s "%s", not defining it is deprecated.', $method->name, $parameterType ? $parameterType.' ' : '', $parameterName, interface_exists($className) ? 'interface' : 'parent class', $className); - } - } - } - - $finals = isset(self::$final[$class]) || $refl->isFinal() ? [] : [ - 'finalConstants' => $refl->getReflectionConstants(\ReflectionClassConstant::IS_PUBLIC | \ReflectionClassConstant::IS_PROTECTED), - 'finalProperties' => $refl->getProperties(\ReflectionProperty::IS_PUBLIC | \ReflectionProperty::IS_PROTECTED), - ]; - foreach ($finals as $type => $reflectors) { - foreach ($reflectors as $r) { - if ($r->class !== $class) { - continue; - } - - $doc = $this->parsePhpDoc($r); - - foreach ($parentAndOwnInterfaces as $use) { - if (isset(self::${$type}[$use][$r->name]) && !isset($doc['deprecated']) && ('finalConstants' === $type || substr($use, 0, strrpos($use, '\\')) !== substr($use, 0, strrpos($class, '\\')))) { - $msg = 'finalConstants' === $type ? '%s" constant' : '$%s" property'; - $deprecations[] = sprintf('The "%s::'.$msg.' is considered final. You should not override it in "%s".', self::${$type}[$use][$r->name], $r->name, $class); - } - } - - if (isset($doc['final']) || ('finalProperties' === $type && str_starts_with($class, 'Symfony\\') && !$r->hasType())) { - self::${$type}[$class][$r->name] = $class; - } - } - } - - return $deprecations; - } - - public function checkCase(\ReflectionClass $refl, string $file, string $class): ?array - { - $real = explode('\\', $class.strrchr($file, '.')); - $tail = explode(\DIRECTORY_SEPARATOR, str_replace('/', \DIRECTORY_SEPARATOR, $file)); - - $i = \count($tail) - 1; - $j = \count($real) - 1; - - while (isset($tail[$i], $real[$j]) && $tail[$i] === $real[$j]) { - --$i; - --$j; - } - - array_splice($tail, 0, $i + 1); - - if (!$tail) { - return null; - } - - $tail = \DIRECTORY_SEPARATOR.implode(\DIRECTORY_SEPARATOR, $tail); - $tailLen = \strlen($tail); - $real = $refl->getFileName(); - - if (2 === self::$caseCheck) { - $real = $this->darwinRealpath($real); - } - - if (0 === substr_compare($real, $tail, -$tailLen, $tailLen, true) - && 0 !== substr_compare($real, $tail, -$tailLen, $tailLen, false) - ) { - return [substr($tail, -$tailLen + 1), substr($real, -$tailLen + 1), substr($real, 0, -$tailLen + 1)]; - } - - return null; - } - - /** - * `realpath` on MacOSX doesn't normalize the case of characters. - */ - private function darwinRealpath(string $real): string - { - $i = 1 + strrpos($real, '/'); - $file = substr($real, $i); - $real = substr($real, 0, $i); - - if (isset(self::$darwinCache[$real])) { - $kDir = $real; - } else { - $kDir = strtolower($real); - - if (isset(self::$darwinCache[$kDir])) { - $real = self::$darwinCache[$kDir][0]; - } else { - $dir = getcwd(); - - if (!@chdir($real)) { - return $real.$file; - } - - $real = getcwd().'/'; - chdir($dir); - - $dir = $real; - $k = $kDir; - $i = \strlen($dir) - 1; - while (!isset(self::$darwinCache[$k])) { - self::$darwinCache[$k] = [$dir, []]; - self::$darwinCache[$dir] = &self::$darwinCache[$k]; - - while ('/' !== $dir[--$i]) { - } - $k = substr($k, 0, ++$i); - $dir = substr($dir, 0, $i--); - } - } - } - - $dirFiles = self::$darwinCache[$kDir][1]; - - if (!isset($dirFiles[$file]) && str_ends_with($file, ') : eval()\'d code')) { - // Get the file name from "file_name.php(123) : eval()'d code" - $file = substr($file, 0, strrpos($file, '(', -17)); - } - - if (isset($dirFiles[$file])) { - return $real.$dirFiles[$file]; - } - - $kFile = strtolower($file); - - if (!isset($dirFiles[$kFile])) { - foreach (scandir($real, 2) as $f) { - if ('.' !== $f[0]) { - $dirFiles[$f] = $f; - if ($f === $file) { - $kFile = $k = $file; - } elseif ($f !== $k = strtolower($f)) { - $dirFiles[$k] = $f; - } - } - } - self::$darwinCache[$kDir][1] = $dirFiles; - } - - return $real.$dirFiles[$kFile]; - } - - /** - * `class_implements` includes interfaces from the parents so we have to manually exclude them. - * - * @return string[] - */ - private function getOwnInterfaces(string $class, ?string $parent): array - { - $ownInterfaces = class_implements($class, false); - - if ($parent) { - foreach (class_implements($parent, false) as $interface) { - unset($ownInterfaces[$interface]); - } - } - - foreach ($ownInterfaces as $interface) { - foreach (class_implements($interface) as $interface) { - unset($ownInterfaces[$interface]); - } - } - - return $ownInterfaces; - } - - private function setReturnType(string $types, string $class, string $method, string $filename, ?string $parent, \ReflectionType $returnType = null): void - { - if ('__construct' === $method) { - return; - } - - if ('null' === $types) { - self::$returnTypes[$class][$method] = ['null', 'null', $class, $filename]; - - return; - } - - if ($nullable = str_starts_with($types, 'null|')) { - $types = substr($types, 5); - } elseif ($nullable = str_ends_with($types, '|null')) { - $types = substr($types, 0, -5); - } - $arrayType = ['array' => 'array']; - $typesMap = []; - $glue = str_contains($types, '&') ? '&' : '|'; - foreach (explode($glue, $types) as $t) { - $t = self::SPECIAL_RETURN_TYPES[strtolower($t)] ?? $t; - $typesMap[$this->normalizeType($t, $class, $parent, $returnType)][$t] = $t; - } - - if (isset($typesMap['array'])) { - if (isset($typesMap['Traversable']) || isset($typesMap['\Traversable'])) { - $typesMap['iterable'] = $arrayType !== $typesMap['array'] ? $typesMap['array'] : ['iterable']; - unset($typesMap['array'], $typesMap['Traversable'], $typesMap['\Traversable']); - } elseif ($arrayType !== $typesMap['array'] && isset(self::$returnTypes[$class][$method]) && !$returnType) { - return; - } - } - - if (isset($typesMap['array']) && isset($typesMap['iterable'])) { - if ($arrayType !== $typesMap['array']) { - $typesMap['iterable'] = $typesMap['array']; - } - unset($typesMap['array']); - } - - $iterable = $object = true; - foreach ($typesMap as $n => $t) { - if ('null' !== $n) { - $iterable = $iterable && (\in_array($n, ['array', 'iterable']) || str_contains($n, 'Iterator')); - $object = $object && (\in_array($n, ['callable', 'object', '$this', 'static']) || !isset(self::SPECIAL_RETURN_TYPES[$n])); - } - } - - $phpTypes = []; - $docTypes = []; - - foreach ($typesMap as $n => $t) { - if ('null' === $n) { - $nullable = true; - continue; - } - - $docTypes[] = $t; - - if ('mixed' === $n || 'void' === $n) { - $nullable = false; - $phpTypes = ['' => $n]; - continue; - } - - if ('resource' === $n) { - // there is no native type for "resource" - return; - } - - if (!preg_match('/^(?:\\\\?[a-zA-Z_\x80-\xff][a-zA-Z0-9_\x80-\xff]*)+$/', $n)) { - // exclude any invalid PHP class name (e.g. `Cookie::SAMESITE_*`) - continue; - } - - if (!isset($phpTypes[''])) { - $phpTypes[] = $n; - } - } - $docTypes = array_merge([], ...$docTypes); - - if (!$phpTypes) { - return; - } - - if (1 < \count($phpTypes)) { - if ($iterable && '8.0' > $this->patchTypes['php']) { - $phpTypes = $docTypes = ['iterable']; - } elseif ($object && 'object' === $this->patchTypes['force']) { - $phpTypes = $docTypes = ['object']; - } elseif ('8.0' > $this->patchTypes['php']) { - // ignore multi-types return declarations - return; - } - } - - $phpType = sprintf($nullable ? (1 < \count($phpTypes) ? '%s|null' : '?%s') : '%s', implode($glue, $phpTypes)); - $docType = sprintf($nullable ? '%s|null' : '%s', implode($glue, $docTypes)); - - self::$returnTypes[$class][$method] = [$phpType, $docType, $class, $filename]; - } - - private function normalizeType(string $type, string $class, ?string $parent, ?\ReflectionType $returnType): string - { - if (isset(self::SPECIAL_RETURN_TYPES[$lcType = strtolower($type)])) { - if ('parent' === $lcType = self::SPECIAL_RETURN_TYPES[$lcType]) { - $lcType = null !== $parent ? '\\'.$parent : 'parent'; - } elseif ('self' === $lcType) { - $lcType = '\\'.$class; - } - - return $lcType; - } - - // We could resolve "use" statements to return the FQDN - // but this would be too expensive for a runtime checker - - if (!str_ends_with($type, '[]')) { - return $type; - } - - if ($returnType instanceof \ReflectionNamedType) { - $type = $returnType->getName(); - - if ('mixed' !== $type) { - return isset(self::SPECIAL_RETURN_TYPES[$type]) ? $type : '\\'.$type; - } - } - - return 'array'; - } - - /** - * Utility method to add #[ReturnTypeWillChange] where php triggers deprecations. - */ - private function patchReturnTypeWillChange(\ReflectionMethod $method) - { - if (\count($method->getAttributes(\ReturnTypeWillChange::class))) { - return; - } - - if (!is_file($file = $method->getFileName())) { - return; - } - - $fileOffset = self::$fileOffsets[$file] ?? 0; - - $code = file($file); - - $startLine = $method->getStartLine() + $fileOffset - 2; - - if (false !== stripos($code[$startLine], 'ReturnTypeWillChange')) { - return; - } - - $code[$startLine] .= " #[\\ReturnTypeWillChange]\n"; - self::$fileOffsets[$file] = 1 + $fileOffset; - file_put_contents($file, $code); - } - - /** - * Utility method to add @return annotations to the Symfony code-base where it triggers self-deprecations. - */ - private function patchMethod(\ReflectionMethod $method, string $returnType, string $declaringFile, string $normalizedType) - { - static $patchedMethods = []; - static $useStatements = []; - - if (!is_file($file = $method->getFileName()) || isset($patchedMethods[$file][$startLine = $method->getStartLine()])) { - return; - } - - $patchedMethods[$file][$startLine] = true; - $fileOffset = self::$fileOffsets[$file] ?? 0; - $startLine += $fileOffset - 2; - if ($nullable = str_ends_with($returnType, '|null')) { - $returnType = substr($returnType, 0, -5); - } - $glue = str_contains($returnType, '&') ? '&' : '|'; - $returnType = explode($glue, $returnType); - $code = file($file); - - foreach ($returnType as $i => $type) { - if (preg_match('/((?:\[\])+)$/', $type, $m)) { - $type = substr($type, 0, -\strlen($m[1])); - $format = '%s'.$m[1]; - } else { - $format = null; - } - - if (isset(self::SPECIAL_RETURN_TYPES[$type]) || ('\\' === $type[0] && !$p = strrpos($type, '\\', 1))) { - continue; - } - - [$namespace, $useOffset, $useMap] = $useStatements[$file] ??= self::getUseStatements($file); - - if ('\\' !== $type[0]) { - [$declaringNamespace, , $declaringUseMap] = $useStatements[$declaringFile] ??= self::getUseStatements($declaringFile); - - $p = strpos($type, '\\', 1); - $alias = $p ? substr($type, 0, $p) : $type; - - if (isset($declaringUseMap[$alias])) { - $type = '\\'.$declaringUseMap[$alias].($p ? substr($type, $p) : ''); - } else { - $type = '\\'.$declaringNamespace.$type; - } - - $p = strrpos($type, '\\', 1); - } - - $alias = substr($type, 1 + $p); - $type = substr($type, 1); - - if (!isset($useMap[$alias]) && (class_exists($c = $namespace.$alias) || interface_exists($c) || trait_exists($c))) { - $useMap[$alias] = $c; - } - - if (!isset($useMap[$alias])) { - $useStatements[$file][2][$alias] = $type; - $code[$useOffset] = "use $type;\n".$code[$useOffset]; - ++$fileOffset; - } elseif ($useMap[$alias] !== $type) { - $alias .= 'FIXME'; - $useStatements[$file][2][$alias] = $type; - $code[$useOffset] = "use $type as $alias;\n".$code[$useOffset]; - ++$fileOffset; - } - - $returnType[$i] = null !== $format ? sprintf($format, $alias) : $alias; - } - - if ('docblock' === $this->patchTypes['force'] || ('object' === $normalizedType && '7.1' === $this->patchTypes['php'])) { - $returnType = implode($glue, $returnType).($nullable ? '|null' : ''); - - if (str_contains($code[$startLine], '#[')) { - --$startLine; - } - - if ($method->getDocComment()) { - $code[$startLine] = " * @return $returnType\n".$code[$startLine]; - } else { - $code[$startLine] .= <<fixReturnStatements($method, $normalizedType); - } - - private static function getUseStatements(string $file): array - { - $namespace = ''; - $useMap = []; - $useOffset = 0; - - if (!is_file($file)) { - return [$namespace, $useOffset, $useMap]; - } - - $file = file($file); - - for ($i = 0; $i < \count($file); ++$i) { - if (preg_match('/^(class|interface|trait|abstract) /', $file[$i])) { - break; - } - - if (str_starts_with($file[$i], 'namespace ')) { - $namespace = substr($file[$i], \strlen('namespace '), -2).'\\'; - $useOffset = $i + 2; - } - - if (str_starts_with($file[$i], 'use ')) { - $useOffset = $i; - - for (; str_starts_with($file[$i], 'use '); ++$i) { - $u = explode(' as ', substr($file[$i], 4, -2), 2); - - if (1 === \count($u)) { - $p = strrpos($u[0], '\\'); - $useMap[substr($u[0], false !== $p ? 1 + $p : 0)] = $u[0]; - } else { - $useMap[$u[1]] = $u[0]; - } - } - - break; - } - } - - return [$namespace, $useOffset, $useMap]; - } - - private function fixReturnStatements(\ReflectionMethod $method, string $returnType) - { - if ('docblock' !== $this->patchTypes['force']) { - if ('7.1' === $this->patchTypes['php'] && 'object' === ltrim($returnType, '?')) { - return; - } - - if ('7.4' > $this->patchTypes['php'] && $method->hasReturnType()) { - return; - } - - if ('8.0' > $this->patchTypes['php'] && (str_contains($returnType, '|') || \in_array($returnType, ['mixed', 'static'], true))) { - return; - } - - if ('8.1' > $this->patchTypes['php'] && str_contains($returnType, '&')) { - return; - } - } - - if (!is_file($file = $method->getFileName())) { - return; - } - - $fixedCode = $code = file($file); - $i = (self::$fileOffsets[$file] ?? 0) + $method->getStartLine(); - - if ('?' !== $returnType && 'docblock' !== $this->patchTypes['force']) { - $fixedCode[$i - 1] = preg_replace('/\)(?::[^;\n]++)?(;?\n)/', "): $returnType\\1", $code[$i - 1]); - } - - $end = $method->isGenerator() ? $i : $method->getEndLine(); - for (; $i < $end; ++$i) { - if ('void' === $returnType) { - $fixedCode[$i] = str_replace(' return null;', ' return;', $code[$i]); - } elseif ('mixed' === $returnType || '?' === $returnType[0]) { - $fixedCode[$i] = str_replace(' return;', ' return null;', $code[$i]); - } else { - $fixedCode[$i] = str_replace(' return;', " return $returnType!?;", $code[$i]); - } - } - - if ($fixedCode !== $code) { - file_put_contents($file, $fixedCode); - } - } - - /** - * @param \ReflectionClass|\ReflectionMethod|\ReflectionProperty $reflector - */ - private function parsePhpDoc(\Reflector $reflector): array - { - if (!$doc = $reflector->getDocComment()) { - return []; - } - - $tagName = ''; - $tagContent = ''; - - $tags = []; - - foreach (explode("\n", substr($doc, 3, -2)) as $line) { - $line = ltrim($line); - $line = ltrim($line, '*'); - - if ('' === $line = trim($line)) { - if ('' !== $tagName) { - $tags[$tagName][] = $tagContent; - } - $tagName = $tagContent = ''; - continue; - } - - if ('@' === $line[0]) { - if ('' !== $tagName) { - $tags[$tagName][] = $tagContent; - $tagContent = ''; - } - - if (preg_match('{^@([-a-zA-Z0-9_:]++)(\s|$)}', $line, $m)) { - $tagName = $m[1]; - $tagContent = str_replace("\t", ' ', ltrim(substr($line, 2 + \strlen($tagName)))); - } else { - $tagName = ''; - } - } elseif ('' !== $tagName) { - $tagContent .= ' '.str_replace("\t", ' ', $line); - } - } - - if ('' !== $tagName) { - $tags[$tagName][] = $tagContent; - } - - foreach ($tags['method'] ?? [] as $i => $method) { - unset($tags['method'][$i]); - - $parts = preg_split('{(\s++|\((?:[^()]*+|(?R))*\)(?: *: *[^ ]++)?|<(?:[^<>]*+|(?R))*>|\{(?:[^{}]*+|(?R))*\})}', $method, -1, \PREG_SPLIT_DELIM_CAPTURE); - $returnType = ''; - $static = 'static' === $parts[0]; - - for ($i = $static ? 2 : 0; null !== $p = $parts[$i] ?? null; $i += 2) { - if (\in_array($p, ['', '|', '&', 'callable'], true) || \in_array(substr($returnType, -1), ['|', '&'], true)) { - $returnType .= trim($parts[$i - 1] ?? '').$p; - continue; - } - - $signature = '(' === ($parts[$i + 1][0] ?? '(') ? $parts[$i + 1] ?? '()' : null; - - if (null === $signature && '' === $returnType) { - $returnType = $p; - continue; - } - - if ($static && 2 === $i) { - $static = false; - $returnType = 'static'; - } - - if (\in_array($description = trim(implode('', \array_slice($parts, 2 + $i))), ['', '.'], true)) { - $description = null; - } elseif (!preg_match('/[.!]$/', $description)) { - $description .= '.'; - } - - $tags['method'][$p] = [$static, $returnType, $signature ?? '()', $description]; - break; - } - } - - foreach ($tags['param'] ?? [] as $i => $param) { - unset($tags['param'][$i]); - - if (\strlen($param) !== strcspn($param, '<{(')) { - $param = preg_replace('{\(([^()]*+|(?R))*\)(?: *: *[^ ]++)?|<([^<>]*+|(?R))*>|\{([^{}]*+|(?R))*\}}', '', $param); - } - - if (false === $i = strpos($param, '$')) { - continue; - } - - $type = 0 === $i ? '' : rtrim(substr($param, 0, $i), ' &'); - $param = substr($param, 1 + $i, (strpos($param, ' ', $i) ?: (1 + $i + \strlen($param))) - $i - 1); - - $tags['param'][$param] = $type; - } - - foreach (['var', 'return'] as $k) { - if (null === $v = $tags[$k][0] ?? null) { - continue; - } - if (\strlen($v) !== strcspn($v, '<{(')) { - $v = preg_replace('{\(([^()]*+|(?R))*\)(?: *: *[^ ]++)?|<([^<>]*+|(?R))*>|\{([^{}]*+|(?R))*\}}', '', $v); - } - - $tags[$k] = substr($v, 0, strpos($v, ' ') ?: \strlen($v)) ?: null; - } - - return $tags; - } -} diff --git a/vendor/symfony/error-handler/Error/ClassNotFoundError.php b/vendor/symfony/error-handler/Error/ClassNotFoundError.php deleted file mode 100644 index 8a17745c..00000000 --- a/vendor/symfony/error-handler/Error/ClassNotFoundError.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\ErrorHandler\Error; - -class ClassNotFoundError extends \Error -{ - public function __construct(string $message, \Throwable $previous) - { - parent::__construct($message, $previous->getCode(), $previous->getPrevious()); - - foreach ([ - 'file' => $previous->getFile(), - 'line' => $previous->getLine(), - 'trace' => $previous->getTrace(), - ] as $property => $value) { - $refl = new \ReflectionProperty(\Error::class, $property); - $refl->setValue($this, $value); - } - } -} diff --git a/vendor/symfony/error-handler/Error/FatalError.php b/vendor/symfony/error-handler/Error/FatalError.php deleted file mode 100644 index a1fd5a99..00000000 --- a/vendor/symfony/error-handler/Error/FatalError.php +++ /dev/null @@ -1,83 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\ErrorHandler\Error; - -class FatalError extends \Error -{ - private array $error; - - /** - * @param array $error An array as returned by error_get_last() - */ - public function __construct(string $message, int $code, array $error, int $traceOffset = null, bool $traceArgs = true, array $trace = null) - { - parent::__construct($message, $code); - - $this->error = $error; - - if (null !== $trace) { - if (!$traceArgs) { - foreach ($trace as &$frame) { - unset($frame['args'], $frame['this'], $frame); - } - } - } elseif (null !== $traceOffset) { - if (\function_exists('xdebug_get_function_stack') && $trace = @xdebug_get_function_stack()) { - if (0 < $traceOffset) { - array_splice($trace, -$traceOffset); - } - - foreach ($trace as &$frame) { - if (!isset($frame['type'])) { - // XDebug pre 2.1.1 doesn't currently set the call type key http://bugs.xdebug.org/view.php?id=695 - if (isset($frame['class'])) { - $frame['type'] = '::'; - } - } elseif ('dynamic' === $frame['type']) { - $frame['type'] = '->'; - } elseif ('static' === $frame['type']) { - $frame['type'] = '::'; - } - - // XDebug also has a different name for the parameters array - if (!$traceArgs) { - unset($frame['params'], $frame['args']); - } elseif (isset($frame['params']) && !isset($frame['args'])) { - $frame['args'] = $frame['params']; - unset($frame['params']); - } - } - - unset($frame); - $trace = array_reverse($trace); - } else { - $trace = []; - } - } - - foreach ([ - 'file' => $error['file'], - 'line' => $error['line'], - 'trace' => $trace, - ] as $property => $value) { - if (null !== $value) { - $refl = new \ReflectionProperty(\Error::class, $property); - $refl->setValue($this, $value); - } - } - } - - public function getError(): array - { - return $this->error; - } -} diff --git a/vendor/symfony/error-handler/Error/OutOfMemoryError.php b/vendor/symfony/error-handler/Error/OutOfMemoryError.php deleted file mode 100644 index d685c3d3..00000000 --- a/vendor/symfony/error-handler/Error/OutOfMemoryError.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. - */ - -namespace Symfony\Component\ErrorHandler\Error; - -class OutOfMemoryError extends FatalError -{ -} diff --git a/vendor/symfony/error-handler/Error/UndefinedFunctionError.php b/vendor/symfony/error-handler/Error/UndefinedFunctionError.php deleted file mode 100644 index 5063b73d..00000000 --- a/vendor/symfony/error-handler/Error/UndefinedFunctionError.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\ErrorHandler\Error; - -class UndefinedFunctionError extends \Error -{ - public function __construct(string $message, \Throwable $previous) - { - parent::__construct($message, $previous->getCode(), $previous->getPrevious()); - - foreach ([ - 'file' => $previous->getFile(), - 'line' => $previous->getLine(), - 'trace' => $previous->getTrace(), - ] as $property => $value) { - $refl = new \ReflectionProperty(\Error::class, $property); - $refl->setValue($this, $value); - } - } -} diff --git a/vendor/symfony/error-handler/Error/UndefinedMethodError.php b/vendor/symfony/error-handler/Error/UndefinedMethodError.php deleted file mode 100644 index 35f15451..00000000 --- a/vendor/symfony/error-handler/Error/UndefinedMethodError.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\ErrorHandler\Error; - -class UndefinedMethodError extends \Error -{ - public function __construct(string $message, \Throwable $previous) - { - parent::__construct($message, $previous->getCode(), $previous->getPrevious()); - - foreach ([ - 'file' => $previous->getFile(), - 'line' => $previous->getLine(), - 'trace' => $previous->getTrace(), - ] as $property => $value) { - $refl = new \ReflectionProperty(\Error::class, $property); - $refl->setValue($this, $value); - } - } -} diff --git a/vendor/symfony/error-handler/ErrorEnhancer/ClassNotFoundErrorEnhancer.php b/vendor/symfony/error-handler/ErrorEnhancer/ClassNotFoundErrorEnhancer.php deleted file mode 100644 index 153819f2..00000000 --- a/vendor/symfony/error-handler/ErrorEnhancer/ClassNotFoundErrorEnhancer.php +++ /dev/null @@ -1,174 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\ErrorHandler\ErrorEnhancer; - -use Composer\Autoload\ClassLoader; -use Symfony\Component\ErrorHandler\DebugClassLoader; -use Symfony\Component\ErrorHandler\Error\ClassNotFoundError; -use Symfony\Component\ErrorHandler\Error\FatalError; - -/** - * @author Fabien Potencier - */ -class ClassNotFoundErrorEnhancer implements ErrorEnhancerInterface -{ - public function enhance(\Throwable $error): ?\Throwable - { - // Some specific versions of PHP produce a fatal error when extending a not found class. - $message = !$error instanceof FatalError ? $error->getMessage() : $error->getError()['message']; - if (!preg_match('/^(Class|Interface|Trait) [\'"]([^\'"]+)[\'"] not found$/', $message, $matches)) { - return null; - } - $typeName = strtolower($matches[1]); - $fullyQualifiedClassName = $matches[2]; - - if (false !== $namespaceSeparatorIndex = strrpos($fullyQualifiedClassName, '\\')) { - $className = substr($fullyQualifiedClassName, $namespaceSeparatorIndex + 1); - $namespacePrefix = substr($fullyQualifiedClassName, 0, $namespaceSeparatorIndex); - $message = sprintf('Attempted to load %s "%s" from namespace "%s".', $typeName, $className, $namespacePrefix); - $tail = ' for another namespace?'; - } else { - $className = $fullyQualifiedClassName; - $message = sprintf('Attempted to load %s "%s" from the global namespace.', $typeName, $className); - $tail = '?'; - } - - if ($candidates = $this->getClassCandidates($className)) { - $tail = array_pop($candidates).'"?'; - if ($candidates) { - $tail = ' for e.g. "'.implode('", "', $candidates).'" or "'.$tail; - } else { - $tail = ' for "'.$tail; - } - } - $message .= "\nDid you forget a \"use\" statement".$tail; - - return new ClassNotFoundError($message, $error); - } - - /** - * Tries to guess the full namespace for a given class name. - * - * By default, it looks for PSR-0 and PSR-4 classes registered via a Symfony or a Composer - * autoloader (that should cover all common cases). - * - * @param string $class A class name (without its namespace) - * - * Returns an array of possible fully qualified class names - */ - private function getClassCandidates(string $class): array - { - if (!\is_array($functions = spl_autoload_functions())) { - return []; - } - - // find Symfony and Composer autoloaders - $classes = []; - - foreach ($functions as $function) { - if (!\is_array($function)) { - continue; - } - // get class loaders wrapped by DebugClassLoader - if ($function[0] instanceof DebugClassLoader) { - $function = $function[0]->getClassLoader(); - - if (!\is_array($function)) { - continue; - } - } - - if ($function[0] instanceof ClassLoader) { - foreach ($function[0]->getPrefixes() as $prefix => $paths) { - foreach ($paths as $path) { - $classes[] = $this->findClassInPath($path, $class, $prefix); - } - } - - foreach ($function[0]->getPrefixesPsr4() as $prefix => $paths) { - foreach ($paths as $path) { - $classes[] = $this->findClassInPath($path, $class, $prefix); - } - } - } - } - - return array_unique(array_merge([], ...$classes)); - } - - private function findClassInPath(string $path, string $class, string $prefix): array - { - if (!$path = realpath($path.'/'.strtr($prefix, '\\_', '//')) ?: realpath($path.'/'.\dirname(strtr($prefix, '\\_', '//'))) ?: realpath($path)) { - return []; - } - - $classes = []; - $filename = $class.'.php'; - foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::LEAVES_ONLY) as $file) { - if ($filename == $file->getFileName() && $class = $this->convertFileToClass($path, $file->getPathName(), $prefix)) { - $classes[] = $class; - } - } - - return $classes; - } - - private function convertFileToClass(string $path, string $file, string $prefix): ?string - { - $candidates = [ - // namespaced class - $namespacedClass = str_replace([$path.\DIRECTORY_SEPARATOR, '.php', '/'], ['', '', '\\'], $file), - // namespaced class (with target dir) - $prefix.$namespacedClass, - // namespaced class (with target dir and separator) - $prefix.'\\'.$namespacedClass, - // PEAR class - str_replace('\\', '_', $namespacedClass), - // PEAR class (with target dir) - str_replace('\\', '_', $prefix.$namespacedClass), - // PEAR class (with target dir and separator) - str_replace('\\', '_', $prefix.'\\'.$namespacedClass), - ]; - - if ($prefix) { - $candidates = array_filter($candidates, function ($candidate) use ($prefix) { return str_starts_with($candidate, $prefix); }); - } - - // We cannot use the autoloader here as most of them use require; but if the class - // is not found, the new autoloader call will require the file again leading to a - // "cannot redeclare class" error. - foreach ($candidates as $candidate) { - if ($this->classExists($candidate)) { - return $candidate; - } - } - - try { - require_once $file; - } catch (\Throwable) { - return null; - } - - foreach ($candidates as $candidate) { - if ($this->classExists($candidate)) { - return $candidate; - } - } - - return null; - } - - private function classExists(string $class): bool - { - return class_exists($class, false) || interface_exists($class, false) || trait_exists($class, false); - } -} diff --git a/vendor/symfony/error-handler/ErrorEnhancer/ErrorEnhancerInterface.php b/vendor/symfony/error-handler/ErrorEnhancer/ErrorEnhancerInterface.php deleted file mode 100644 index 7c3f4ef9..00000000 --- a/vendor/symfony/error-handler/ErrorEnhancer/ErrorEnhancerInterface.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. - */ - -namespace Symfony\Component\ErrorHandler\ErrorEnhancer; - -interface ErrorEnhancerInterface -{ - /** - * Returns an \Throwable instance if the class is able to improve the error, null otherwise. - */ - public function enhance(\Throwable $error): ?\Throwable; -} diff --git a/vendor/symfony/error-handler/ErrorEnhancer/UndefinedFunctionErrorEnhancer.php b/vendor/symfony/error-handler/ErrorEnhancer/UndefinedFunctionErrorEnhancer.php deleted file mode 100644 index 0458c26a..00000000 --- a/vendor/symfony/error-handler/ErrorEnhancer/UndefinedFunctionErrorEnhancer.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\ErrorHandler\ErrorEnhancer; - -use Symfony\Component\ErrorHandler\Error\FatalError; -use Symfony\Component\ErrorHandler\Error\UndefinedFunctionError; - -/** - * @author Fabien Potencier - */ -class UndefinedFunctionErrorEnhancer implements ErrorEnhancerInterface -{ - public function enhance(\Throwable $error): ?\Throwable - { - if ($error instanceof FatalError) { - return null; - } - - $message = $error->getMessage(); - $messageLen = \strlen($message); - $notFoundSuffix = '()'; - $notFoundSuffixLen = \strlen($notFoundSuffix); - if ($notFoundSuffixLen > $messageLen) { - return null; - } - - if (0 !== substr_compare($message, $notFoundSuffix, -$notFoundSuffixLen)) { - return null; - } - - $prefix = 'Call to undefined function '; - $prefixLen = \strlen($prefix); - if (!str_starts_with($message, $prefix)) { - return null; - } - - $fullyQualifiedFunctionName = substr($message, $prefixLen, -$notFoundSuffixLen); - if (false !== $namespaceSeparatorIndex = strrpos($fullyQualifiedFunctionName, '\\')) { - $functionName = substr($fullyQualifiedFunctionName, $namespaceSeparatorIndex + 1); - $namespacePrefix = substr($fullyQualifiedFunctionName, 0, $namespaceSeparatorIndex); - $message = sprintf('Attempted to call function "%s" from namespace "%s".', $functionName, $namespacePrefix); - } else { - $functionName = $fullyQualifiedFunctionName; - $message = sprintf('Attempted to call function "%s" from the global namespace.', $functionName); - } - - $candidates = []; - foreach (get_defined_functions() as $type => $definedFunctionNames) { - foreach ($definedFunctionNames as $definedFunctionName) { - if (false !== $namespaceSeparatorIndex = strrpos($definedFunctionName, '\\')) { - $definedFunctionNameBasename = substr($definedFunctionName, $namespaceSeparatorIndex + 1); - } else { - $definedFunctionNameBasename = $definedFunctionName; - } - - if ($definedFunctionNameBasename === $functionName) { - $candidates[] = '\\'.$definedFunctionName; - } - } - } - - if ($candidates) { - sort($candidates); - $last = array_pop($candidates).'"?'; - if ($candidates) { - $candidates = 'e.g. "'.implode('", "', $candidates).'" or "'.$last; - } else { - $candidates = '"'.$last; - } - $message .= "\nDid you mean to call ".$candidates; - } - - return new UndefinedFunctionError($message, $error); - } -} diff --git a/vendor/symfony/error-handler/ErrorEnhancer/UndefinedMethodErrorEnhancer.php b/vendor/symfony/error-handler/ErrorEnhancer/UndefinedMethodErrorEnhancer.php deleted file mode 100644 index 80eaec9b..00000000 --- a/vendor/symfony/error-handler/ErrorEnhancer/UndefinedMethodErrorEnhancer.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\ErrorHandler\ErrorEnhancer; - -use Symfony\Component\ErrorHandler\Error\FatalError; -use Symfony\Component\ErrorHandler\Error\UndefinedMethodError; - -/** - * @author Grégoire Pineau - */ -class UndefinedMethodErrorEnhancer implements ErrorEnhancerInterface -{ - public function enhance(\Throwable $error): ?\Throwable - { - if ($error instanceof FatalError) { - return null; - } - - $message = $error->getMessage(); - preg_match('/^Call to undefined method (.*)::(.*)\(\)$/', $message, $matches); - if (!$matches) { - return null; - } - - $className = $matches[1]; - $methodName = $matches[2]; - - $message = sprintf('Attempted to call an undefined method named "%s" of class "%s".', $methodName, $className); - - if ('' === $methodName || !class_exists($className) || null === $methods = get_class_methods($className)) { - // failed to get the class or its methods on which an unknown method was called (for example on an anonymous class) - return new UndefinedMethodError($message, $error); - } - - $candidates = []; - foreach ($methods as $definedMethodName) { - $lev = levenshtein($methodName, $definedMethodName); - if ($lev <= \strlen($methodName) / 3 || str_contains($definedMethodName, $methodName)) { - $candidates[] = $definedMethodName; - } - } - - if ($candidates) { - sort($candidates); - $last = array_pop($candidates).'"?'; - if ($candidates) { - $candidates = 'e.g. "'.implode('", "', $candidates).'" or "'.$last; - } else { - $candidates = '"'.$last; - } - - $message .= "\nDid you mean to call ".$candidates; - } - - return new UndefinedMethodError($message, $error); - } -} diff --git a/vendor/symfony/error-handler/ErrorHandler.php b/vendor/symfony/error-handler/ErrorHandler.php deleted file mode 100644 index 0bf1ef6a..00000000 --- a/vendor/symfony/error-handler/ErrorHandler.php +++ /dev/null @@ -1,729 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\ErrorHandler; - -use Psr\Log\LoggerInterface; -use Psr\Log\LogLevel; -use Symfony\Component\ErrorHandler\Error\FatalError; -use Symfony\Component\ErrorHandler\Error\OutOfMemoryError; -use Symfony\Component\ErrorHandler\ErrorEnhancer\ClassNotFoundErrorEnhancer; -use Symfony\Component\ErrorHandler\ErrorEnhancer\ErrorEnhancerInterface; -use Symfony\Component\ErrorHandler\ErrorEnhancer\UndefinedFunctionErrorEnhancer; -use Symfony\Component\ErrorHandler\ErrorEnhancer\UndefinedMethodErrorEnhancer; -use Symfony\Component\ErrorHandler\ErrorRenderer\CliErrorRenderer; -use Symfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer; -use Symfony\Component\ErrorHandler\Exception\SilencedErrorContext; - -/** - * A generic ErrorHandler for the PHP engine. - * - * Provides five bit fields that control how errors are handled: - * - thrownErrors: errors thrown as \ErrorException - * - loggedErrors: logged errors, when not @-silenced - * - scopedErrors: errors thrown or logged with their local context - * - tracedErrors: errors logged with their stack trace - * - screamedErrors: never @-silenced errors - * - * Each error level can be logged by a dedicated PSR-3 logger object. - * Screaming only applies to logging. - * Throwing takes precedence over logging. - * Uncaught exceptions are logged as E_ERROR. - * E_DEPRECATED and E_USER_DEPRECATED levels never throw. - * E_RECOVERABLE_ERROR and E_USER_ERROR levels always throw. - * Non catchable errors that can be detected at shutdown time are logged when the scream bit field allows so. - * As errors have a performance cost, repeated errors are all logged, so that the developer - * can see them and weight them as more important to fix than others of the same level. - * - * @author Nicolas Grekas - * @author Grégoire Pineau - * - * @final - */ -class ErrorHandler -{ - private array $levels = [ - \E_DEPRECATED => 'Deprecated', - \E_USER_DEPRECATED => 'User Deprecated', - \E_NOTICE => 'Notice', - \E_USER_NOTICE => 'User Notice', - \E_STRICT => 'Runtime Notice', - \E_WARNING => 'Warning', - \E_USER_WARNING => 'User Warning', - \E_COMPILE_WARNING => 'Compile Warning', - \E_CORE_WARNING => 'Core Warning', - \E_USER_ERROR => 'User Error', - \E_RECOVERABLE_ERROR => 'Catchable Fatal Error', - \E_COMPILE_ERROR => 'Compile Error', - \E_PARSE => 'Parse Error', - \E_ERROR => 'Error', - \E_CORE_ERROR => 'Core Error', - ]; - - private array $loggers = [ - \E_DEPRECATED => [null, LogLevel::INFO], - \E_USER_DEPRECATED => [null, LogLevel::INFO], - \E_NOTICE => [null, LogLevel::WARNING], - \E_USER_NOTICE => [null, LogLevel::WARNING], - \E_STRICT => [null, LogLevel::WARNING], - \E_WARNING => [null, LogLevel::WARNING], - \E_USER_WARNING => [null, LogLevel::WARNING], - \E_COMPILE_WARNING => [null, LogLevel::WARNING], - \E_CORE_WARNING => [null, LogLevel::WARNING], - \E_USER_ERROR => [null, LogLevel::CRITICAL], - \E_RECOVERABLE_ERROR => [null, LogLevel::CRITICAL], - \E_COMPILE_ERROR => [null, LogLevel::CRITICAL], - \E_PARSE => [null, LogLevel::CRITICAL], - \E_ERROR => [null, LogLevel::CRITICAL], - \E_CORE_ERROR => [null, LogLevel::CRITICAL], - ]; - - private int $thrownErrors = 0x1FFF; // E_ALL - E_DEPRECATED - E_USER_DEPRECATED - private int $scopedErrors = 0x1FFF; // E_ALL - E_DEPRECATED - E_USER_DEPRECATED - private int $tracedErrors = 0x77FB; // E_ALL - E_STRICT - E_PARSE - private int $screamedErrors = 0x55; // E_ERROR + E_CORE_ERROR + E_COMPILE_ERROR + E_PARSE - private int $loggedErrors = 0; - private \Closure $configureException; - private bool $debug; - - private bool $isRecursive = false; - private bool $isRoot = false; - private $exceptionHandler; - private ?BufferingLogger $bootstrappingLogger = null; - - private static ?string $reservedMemory = null; - private static array $silencedErrorCache = []; - private static int $silencedErrorCount = 0; - private static int $exitCode = 0; - - /** - * Registers the error handler. - */ - public static function register(self $handler = null, bool $replace = true): self - { - if (null === self::$reservedMemory) { - self::$reservedMemory = str_repeat('x', 32768); - register_shutdown_function(__CLASS__.'::handleFatalError'); - } - - if ($handlerIsNew = null === $handler) { - $handler = new static(); - } - - if (null === $prev = set_error_handler([$handler, 'handleError'])) { - restore_error_handler(); - // Specifying the error types earlier would expose us to https://bugs.php.net/63206 - set_error_handler([$handler, 'handleError'], $handler->thrownErrors | $handler->loggedErrors); - $handler->isRoot = true; - } - - if ($handlerIsNew && \is_array($prev) && $prev[0] instanceof self) { - $handler = $prev[0]; - $replace = false; - } - if (!$replace && $prev) { - restore_error_handler(); - $handlerIsRegistered = \is_array($prev) && $handler === $prev[0]; - } else { - $handlerIsRegistered = true; - } - if (\is_array($prev = set_exception_handler([$handler, 'handleException'])) && $prev[0] instanceof self) { - restore_exception_handler(); - if (!$handlerIsRegistered) { - $handler = $prev[0]; - } elseif ($handler !== $prev[0] && $replace) { - set_exception_handler([$handler, 'handleException']); - $p = $prev[0]->setExceptionHandler(null); - $handler->setExceptionHandler($p); - $prev[0]->setExceptionHandler($p); - } - } else { - $handler->setExceptionHandler($prev ?? [$handler, 'renderException']); - } - - $handler->throwAt(\E_ALL & $handler->thrownErrors, true); - - return $handler; - } - - /** - * Calls a function and turns any PHP error into \ErrorException. - * - * @throws \ErrorException When $function(...$arguments) triggers a PHP error - */ - public static function call(callable $function, mixed ...$arguments): mixed - { - set_error_handler(static function (int $type, string $message, string $file, int $line) { - if (__FILE__ === $file) { - $trace = debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS, 3); - $file = $trace[2]['file'] ?? $file; - $line = $trace[2]['line'] ?? $line; - } - - throw new \ErrorException($message, 0, $type, $file, $line); - }); - - try { - return $function(...$arguments); - } finally { - restore_error_handler(); - } - } - - public function __construct(BufferingLogger $bootstrappingLogger = null, bool $debug = false) - { - if ($bootstrappingLogger) { - $this->bootstrappingLogger = $bootstrappingLogger; - $this->setDefaultLogger($bootstrappingLogger); - } - $traceReflector = new \ReflectionProperty(\Exception::class, 'trace'); - $this->configureException = \Closure::bind(static function ($e, $trace, $file = null, $line = null) use ($traceReflector) { - $traceReflector->setValue($e, $trace); - $e->file = $file ?? $e->file; - $e->line = $line ?? $e->line; - }, null, new class() extends \Exception { - }); - $this->debug = $debug; - } - - /** - * Sets a logger to non assigned errors levels. - * - * @param LoggerInterface $logger A PSR-3 logger to put as default for the given levels - * @param array|int|null $levels An array map of E_* to LogLevel::* or an integer bit field of E_* constants - * @param bool $replace Whether to replace or not any existing logger - */ - public function setDefaultLogger(LoggerInterface $logger, array|int|null $levels = \E_ALL, bool $replace = false): void - { - $loggers = []; - - if (\is_array($levels)) { - foreach ($levels as $type => $logLevel) { - if (empty($this->loggers[$type][0]) || $replace || $this->loggers[$type][0] === $this->bootstrappingLogger) { - $loggers[$type] = [$logger, $logLevel]; - } - } - } else { - $levels ??= \E_ALL; - foreach ($this->loggers as $type => $log) { - if (($type & $levels) && (empty($log[0]) || $replace || $log[0] === $this->bootstrappingLogger)) { - $log[0] = $logger; - $loggers[$type] = $log; - } - } - } - - $this->setLoggers($loggers); - } - - /** - * Sets a logger for each error level. - * - * @param array $loggers Error levels to [LoggerInterface|null, LogLevel::*] map - * - * @throws \InvalidArgumentException - */ - public function setLoggers(array $loggers): array - { - $prevLogged = $this->loggedErrors; - $prev = $this->loggers; - $flush = []; - - foreach ($loggers as $type => $log) { - if (!isset($prev[$type])) { - throw new \InvalidArgumentException('Unknown error type: '.$type); - } - if (!\is_array($log)) { - $log = [$log]; - } elseif (!\array_key_exists(0, $log)) { - throw new \InvalidArgumentException('No logger provided.'); - } - if (null === $log[0]) { - $this->loggedErrors &= ~$type; - } elseif ($log[0] instanceof LoggerInterface) { - $this->loggedErrors |= $type; - } else { - throw new \InvalidArgumentException('Invalid logger provided.'); - } - $this->loggers[$type] = $log + $prev[$type]; - - if ($this->bootstrappingLogger && $prev[$type][0] === $this->bootstrappingLogger) { - $flush[$type] = $type; - } - } - $this->reRegister($prevLogged | $this->thrownErrors); - - if ($flush) { - foreach ($this->bootstrappingLogger->cleanLogs() as $log) { - $type = ThrowableUtils::getSeverity($log[2]['exception']); - if (!isset($flush[$type])) { - $this->bootstrappingLogger->log($log[0], $log[1], $log[2]); - } elseif ($this->loggers[$type][0]) { - $this->loggers[$type][0]->log($this->loggers[$type][1], $log[1], $log[2]); - } - } - } - - return $prev; - } - - public function setExceptionHandler(?callable $handler): ?callable - { - $prev = $this->exceptionHandler; - $this->exceptionHandler = $handler; - - return $prev; - } - - /** - * Sets the PHP error levels that throw an exception when a PHP error occurs. - * - * @param int $levels A bit field of E_* constants for thrown errors - * @param bool $replace Replace or amend the previous value - */ - public function throwAt(int $levels, bool $replace = false): int - { - $prev = $this->thrownErrors; - $this->thrownErrors = ($levels | \E_RECOVERABLE_ERROR | \E_USER_ERROR) & ~\E_USER_DEPRECATED & ~\E_DEPRECATED; - if (!$replace) { - $this->thrownErrors |= $prev; - } - $this->reRegister($prev | $this->loggedErrors); - - return $prev; - } - - /** - * Sets the PHP error levels for which local variables are preserved. - * - * @param int $levels A bit field of E_* constants for scoped errors - * @param bool $replace Replace or amend the previous value - */ - public function scopeAt(int $levels, bool $replace = false): int - { - $prev = $this->scopedErrors; - $this->scopedErrors = $levels; - if (!$replace) { - $this->scopedErrors |= $prev; - } - - return $prev; - } - - /** - * Sets the PHP error levels for which the stack trace is preserved. - * - * @param int $levels A bit field of E_* constants for traced errors - * @param bool $replace Replace or amend the previous value - */ - public function traceAt(int $levels, bool $replace = false): int - { - $prev = $this->tracedErrors; - $this->tracedErrors = $levels; - if (!$replace) { - $this->tracedErrors |= $prev; - } - - return $prev; - } - - /** - * Sets the error levels where the @-operator is ignored. - * - * @param int $levels A bit field of E_* constants for screamed errors - * @param bool $replace Replace or amend the previous value - */ - public function screamAt(int $levels, bool $replace = false): int - { - $prev = $this->screamedErrors; - $this->screamedErrors = $levels; - if (!$replace) { - $this->screamedErrors |= $prev; - } - - return $prev; - } - - /** - * Re-registers as a PHP error handler if levels changed. - */ - private function reRegister(int $prev): void - { - if ($prev !== ($this->thrownErrors | $this->loggedErrors)) { - $handler = set_error_handler('is_int'); - $handler = \is_array($handler) ? $handler[0] : null; - restore_error_handler(); - if ($handler === $this) { - restore_error_handler(); - if ($this->isRoot) { - set_error_handler([$this, 'handleError'], $this->thrownErrors | $this->loggedErrors); - } else { - set_error_handler([$this, 'handleError']); - } - } - } - } - - /** - * Handles errors by filtering then logging them according to the configured bit fields. - * - * @return bool Returns false when no handling happens so that the PHP engine can handle the error itself - * - * @throws \ErrorException When $this->thrownErrors requests so - * - * @internal - */ - public function handleError(int $type, string $message, string $file, int $line): bool - { - if (\E_WARNING === $type && '"' === $message[0] && str_contains($message, '" targeting switch is equivalent to "break')) { - $type = \E_DEPRECATED; - } - - // Level is the current error reporting level to manage silent error. - $level = error_reporting(); - $silenced = 0 === ($level & $type); - // Strong errors are not authorized to be silenced. - $level |= \E_RECOVERABLE_ERROR | \E_USER_ERROR | \E_DEPRECATED | \E_USER_DEPRECATED; - $log = $this->loggedErrors & $type; - $throw = $this->thrownErrors & $type & $level; - $type &= $level | $this->screamedErrors; - - // Never throw on warnings triggered by assert() - if (\E_WARNING === $type && 'a' === $message[0] && 0 === strncmp($message, 'assert(): ', 10)) { - $throw = 0; - } - - if (!$type || (!$log && !$throw)) { - return false; - } - - $logMessage = $this->levels[$type].': '.$message; - - if (!$throw && !($type & $level)) { - if (!isset(self::$silencedErrorCache[$id = $file.':'.$line])) { - $lightTrace = $this->tracedErrors & $type ? $this->cleanTrace(debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS, 5), $type, $file, $line, false) : []; - $errorAsException = new SilencedErrorContext($type, $file, $line, isset($lightTrace[1]) ? [$lightTrace[0]] : $lightTrace); - } elseif (isset(self::$silencedErrorCache[$id][$message])) { - $lightTrace = null; - $errorAsException = self::$silencedErrorCache[$id][$message]; - ++$errorAsException->count; - } else { - $lightTrace = []; - $errorAsException = null; - } - - if (100 < ++self::$silencedErrorCount) { - self::$silencedErrorCache = $lightTrace = []; - self::$silencedErrorCount = 1; - } - if ($errorAsException) { - self::$silencedErrorCache[$id][$message] = $errorAsException; - } - if (null === $lightTrace) { - return true; - } - } else { - if (str_contains($message, '@anonymous')) { - $backtrace = debug_backtrace(false, 5); - - for ($i = 1; isset($backtrace[$i]); ++$i) { - if (isset($backtrace[$i]['function'], $backtrace[$i]['args'][0]) - && ('trigger_error' === $backtrace[$i]['function'] || 'user_error' === $backtrace[$i]['function']) - ) { - if ($backtrace[$i]['args'][0] !== $message) { - $message = $this->parseAnonymousClass($backtrace[$i]['args'][0]); - $logMessage = $this->levels[$type].': '.$message; - } - - break; - } - } - } - - $errorAsException = new \ErrorException($logMessage, 0, $type, $file, $line); - - if ($throw || $this->tracedErrors & $type) { - $backtrace = $errorAsException->getTrace(); - $lightTrace = $this->cleanTrace($backtrace, $type, $file, $line, $throw); - ($this->configureException)($errorAsException, $lightTrace, $file, $line); - } else { - ($this->configureException)($errorAsException, []); - $backtrace = []; - } - } - - if ($throw) { - throw $errorAsException; - } - - if ($this->isRecursive) { - $log = 0; - } else { - try { - $this->isRecursive = true; - $level = ($type & $level) ? $this->loggers[$type][1] : LogLevel::DEBUG; - $this->loggers[$type][0]->log($level, $logMessage, $errorAsException ? ['exception' => $errorAsException] : []); - } finally { - $this->isRecursive = false; - } - } - - return !$silenced && $type && $log; - } - - /** - * Handles an exception by logging then forwarding it to another handler. - * - * @internal - */ - public function handleException(\Throwable $exception) - { - $handlerException = null; - - if (!$exception instanceof FatalError) { - self::$exitCode = 255; - - $type = ThrowableUtils::getSeverity($exception); - } else { - $type = $exception->getError()['type']; - } - - if ($this->loggedErrors & $type) { - if (str_contains($message = $exception->getMessage(), "@anonymous\0")) { - $message = $this->parseAnonymousClass($message); - } - - if ($exception instanceof FatalError) { - $message = 'Fatal '.$message; - } elseif ($exception instanceof \Error) { - $message = 'Uncaught Error: '.$message; - } elseif ($exception instanceof \ErrorException) { - $message = 'Uncaught '.$message; - } else { - $message = 'Uncaught Exception: '.$message; - } - - try { - $this->loggers[$type][0]->log($this->loggers[$type][1], $message, ['exception' => $exception]); - } catch (\Throwable $handlerException) { - } - } - - if (!$exception instanceof OutOfMemoryError) { - foreach ($this->getErrorEnhancers() as $errorEnhancer) { - if ($e = $errorEnhancer->enhance($exception)) { - $exception = $e; - break; - } - } - } - - $exceptionHandler = $this->exceptionHandler; - $this->exceptionHandler = [$this, 'renderException']; - - if (null === $exceptionHandler || $exceptionHandler === $this->exceptionHandler) { - $this->exceptionHandler = null; - } - - try { - if (null !== $exceptionHandler) { - return $exceptionHandler($exception); - } - $handlerException ??= $exception; - } catch (\Throwable $handlerException) { - } - if ($exception === $handlerException && null === $this->exceptionHandler) { - self::$reservedMemory = null; // Disable the fatal error handler - throw $exception; // Give back $exception to the native handler - } - - $loggedErrors = $this->loggedErrors; - if ($exception === $handlerException) { - $this->loggedErrors &= ~$type; - } - - try { - $this->handleException($handlerException); - } finally { - $this->loggedErrors = $loggedErrors; - } - } - - /** - * Shutdown registered function for handling PHP fatal errors. - * - * @param array|null $error An array as returned by error_get_last() - * - * @internal - */ - public static function handleFatalError(array $error = null): void - { - if (null === self::$reservedMemory) { - return; - } - - $handler = self::$reservedMemory = null; - $handlers = []; - $previousHandler = null; - $sameHandlerLimit = 10; - - while (!\is_array($handler) || !$handler[0] instanceof self) { - $handler = set_exception_handler('is_int'); - restore_exception_handler(); - - if (!$handler) { - break; - } - restore_exception_handler(); - - if ($handler !== $previousHandler) { - array_unshift($handlers, $handler); - $previousHandler = $handler; - } elseif (0 === --$sameHandlerLimit) { - $handler = null; - break; - } - } - foreach ($handlers as $h) { - set_exception_handler($h); - } - if (!$handler) { - return; - } - if ($handler !== $h) { - $handler[0]->setExceptionHandler($h); - } - $handler = $handler[0]; - $handlers = []; - - if ($exit = null === $error) { - $error = error_get_last(); - } - - if ($error && $error['type'] &= \E_PARSE | \E_ERROR | \E_CORE_ERROR | \E_COMPILE_ERROR) { - // Let's not throw anymore but keep logging - $handler->throwAt(0, true); - $trace = $error['backtrace'] ?? null; - - if (str_starts_with($error['message'], 'Allowed memory') || str_starts_with($error['message'], 'Out of memory')) { - $fatalError = new OutOfMemoryError($handler->levels[$error['type']].': '.$error['message'], 0, $error, 2, false, $trace); - } else { - $fatalError = new FatalError($handler->levels[$error['type']].': '.$error['message'], 0, $error, 2, true, $trace); - } - } else { - $fatalError = null; - } - - try { - if (null !== $fatalError) { - self::$exitCode = 255; - $handler->handleException($fatalError); - } - } catch (FatalError) { - // Ignore this re-throw - } - - if ($exit && self::$exitCode) { - $exitCode = self::$exitCode; - register_shutdown_function('register_shutdown_function', function () use ($exitCode) { exit($exitCode); }); - } - } - - /** - * Renders the given exception. - * - * As this method is mainly called during boot where nothing is yet available, - * the output is always either HTML or CLI depending where PHP runs. - */ - private function renderException(\Throwable $exception): void - { - $renderer = \in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) ? new CliErrorRenderer() : new HtmlErrorRenderer($this->debug); - - $exception = $renderer->render($exception); - - if (!headers_sent()) { - http_response_code($exception->getStatusCode()); - - foreach ($exception->getHeaders() as $name => $value) { - header($name.': '.$value, false); - } - } - - echo $exception->getAsString(); - } - - /** - * Override this method if you want to define more error enhancers. - * - * @return ErrorEnhancerInterface[] - */ - protected function getErrorEnhancers(): iterable - { - return [ - new UndefinedFunctionErrorEnhancer(), - new UndefinedMethodErrorEnhancer(), - new ClassNotFoundErrorEnhancer(), - ]; - } - - /** - * Cleans the trace by removing function arguments and the frames added by the error handler and DebugClassLoader. - */ - private function cleanTrace(array $backtrace, int $type, string &$file, int &$line, bool $throw): array - { - $lightTrace = $backtrace; - - for ($i = 0; isset($backtrace[$i]); ++$i) { - if (isset($backtrace[$i]['file'], $backtrace[$i]['line']) && $backtrace[$i]['line'] === $line && $backtrace[$i]['file'] === $file) { - $lightTrace = \array_slice($lightTrace, 1 + $i); - break; - } - } - if (\E_USER_DEPRECATED === $type) { - for ($i = 0; isset($lightTrace[$i]); ++$i) { - if (!isset($lightTrace[$i]['file'], $lightTrace[$i]['line'], $lightTrace[$i]['function'])) { - continue; - } - if (!isset($lightTrace[$i]['class']) && 'trigger_deprecation' === $lightTrace[$i]['function']) { - $file = $lightTrace[$i]['file']; - $line = $lightTrace[$i]['line']; - $lightTrace = \array_slice($lightTrace, 1 + $i); - break; - } - } - } - if (class_exists(DebugClassLoader::class, false)) { - for ($i = \count($lightTrace) - 2; 0 < $i; --$i) { - if (DebugClassLoader::class === ($lightTrace[$i]['class'] ?? null)) { - array_splice($lightTrace, --$i, 2); - } - } - } - if (!($throw || $this->scopedErrors & $type)) { - for ($i = 0; isset($lightTrace[$i]); ++$i) { - unset($lightTrace[$i]['args'], $lightTrace[$i]['object']); - } - } - - return $lightTrace; - } - - /** - * Parse the error message by removing the anonymous class notation - * and using the parent class instead if possible. - */ - private function parseAnonymousClass(string $message): string - { - return preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', static function ($m) { - return class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0]; - }, $message); - } -} diff --git a/vendor/symfony/error-handler/ErrorRenderer/CliErrorRenderer.php b/vendor/symfony/error-handler/ErrorRenderer/CliErrorRenderer.php deleted file mode 100644 index 04b3edb1..00000000 --- a/vendor/symfony/error-handler/ErrorRenderer/CliErrorRenderer.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\ErrorHandler\ErrorRenderer; - -use Symfony\Component\ErrorHandler\Exception\FlattenException; -use Symfony\Component\VarDumper\Cloner\VarCloner; -use Symfony\Component\VarDumper\Dumper\CliDumper; - -// Help opcache.preload discover always-needed symbols -class_exists(CliDumper::class); - -/** - * @author Nicolas Grekas - */ -class CliErrorRenderer implements ErrorRendererInterface -{ - public function render(\Throwable $exception): FlattenException - { - $cloner = new VarCloner(); - $dumper = new class() extends CliDumper { - protected function supportsColors(): bool - { - $outputStream = $this->outputStream; - $this->outputStream = fopen('php://stdout', 'w'); - - try { - return parent::supportsColors(); - } finally { - $this->outputStream = $outputStream; - } - } - }; - - return FlattenException::createFromThrowable($exception) - ->setAsString($dumper->dump($cloner->cloneVar($exception), true)); - } -} diff --git a/vendor/symfony/error-handler/ErrorRenderer/ErrorRendererInterface.php b/vendor/symfony/error-handler/ErrorRenderer/ErrorRendererInterface.php deleted file mode 100644 index 2e289624..00000000 --- a/vendor/symfony/error-handler/ErrorRenderer/ErrorRendererInterface.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\ErrorHandler\ErrorRenderer; - -use Symfony\Component\ErrorHandler\Exception\FlattenException; - -/** - * Formats an exception to be used as response content. - * - * @author Yonel Ceruto - */ -interface ErrorRendererInterface -{ - public const IDE_LINK_FORMATS = [ - 'textmate' => 'txmt://open?url=file://%f&line=%l', - 'macvim' => 'mvim://open?url=file://%f&line=%l', - 'emacs' => 'emacs://open?url=file://%f&line=%l', - 'sublime' => 'subl://open?url=file://%f&line=%l', - 'phpstorm' => 'phpstorm://open?file=%f&line=%l', - 'atom' => 'atom://core/open/file?filename=%f&line=%l', - 'vscode' => 'vscode://file/%f:%l', - ]; - - /** - * Renders a Throwable as a FlattenException. - */ - public function render(\Throwable $exception): FlattenException; -} diff --git a/vendor/symfony/error-handler/ErrorRenderer/HtmlErrorRenderer.php b/vendor/symfony/error-handler/ErrorRenderer/HtmlErrorRenderer.php deleted file mode 100644 index 57f34d8f..00000000 --- a/vendor/symfony/error-handler/ErrorRenderer/HtmlErrorRenderer.php +++ /dev/null @@ -1,350 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\ErrorHandler\ErrorRenderer; - -use Psr\Log\LoggerInterface; -use Symfony\Component\ErrorHandler\Exception\FlattenException; -use Symfony\Component\HttpFoundation\RequestStack; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\Debug\FileLinkFormatter; -use Symfony\Component\HttpKernel\Log\DebugLoggerInterface; - -/** - * @author Yonel Ceruto - */ -class HtmlErrorRenderer implements ErrorRendererInterface -{ - private const GHOST_ADDONS = [ - '02-14' => self::GHOST_HEART, - '02-29' => self::GHOST_PLUS, - '10-18' => self::GHOST_GIFT, - ]; - - private const GHOST_GIFT = 'M124.00534057617188,5.3606138080358505 C124.40059661865234,4.644828304648399 125.1237564086914,3.712414965033531 123.88127899169922,3.487462028861046 C123.53517150878906,3.3097832053899765 123.18894958496094,2.9953975528478622 122.8432846069336,3.345616325736046 C122.07421112060547,3.649444565176964 121.40750122070312,4.074306473135948 122.2164306640625,4.869479164481163 C122.57514953613281,5.3830065578222275 122.90142822265625,6.503447040915489 123.3077621459961,6.626829609274864 C123.55027770996094,6.210384353995323 123.7774658203125,5.785196766257286 124.00534057617188,5.3606138080358505 zM122.30630493164062,7.336987480521202 C121.60028076171875,6.076864704489708 121.03211975097656,4.72498320043087 120.16796875,3.562500938773155 C119.11695098876953,2.44033907353878 117.04605865478516,2.940566048026085 116.57544708251953,4.387995228171349 C115.95028686523438,5.819030746817589 117.2991714477539,7.527640804648399 118.826171875,7.348545059561729 C119.98493194580078,7.367936596274376 121.15027618408203,7.420116886496544 122.30630493164062,7.336987480521202 zM128.1732177734375,7.379541382193565 C129.67486572265625,7.17823551595211 130.53842163085938,5.287807449698448 129.68344116210938,4.032590612769127 C128.92578125,2.693056806921959 126.74605560302734,2.6463639587163925 125.98509216308594,4.007616028189659 C125.32617950439453,5.108129009604454 124.75428009033203,6.258124336600304 124.14962768554688,7.388818249106407 C125.48638916015625,7.465229496359825 126.8357162475586,7.447416767477989 128.1732177734375,7.379541382193565 zM130.6601104736328,8.991325363516808 C131.17202758789062,8.540884003043175 133.1543731689453,8.009847149252892 131.65304565429688,7.582054600119591 C131.2811279296875,7.476506695151329 130.84751892089844,6.99234913289547 130.5132598876953,7.124847874045372 C129.78744506835938,8.02728746831417 128.67140197753906,8.55669592320919 127.50616455078125,8.501235947012901 C127.27806091308594,8.576229080557823 126.11459350585938,8.38720129430294 126.428955078125,8.601900085806847 C127.25099182128906,9.070617660880089 128.0523223876953,9.579657539725304 128.902587890625,9.995706543326378 C129.49813842773438,9.678531631827354 130.0761260986328,9.329126343131065 130.6601104736328,8.991325363516808 zM118.96446990966797,9.246344551444054 C119.4022445678711,8.991325363516808 119.84001922607422,8.736305221915245 120.27779388427734,8.481284126639366 C118.93965911865234,8.414779648184776 117.40827941894531,8.607666000723839 116.39698791503906,7.531384453177452 C116.11186981201172,7.212117180228233 115.83845520019531,6.846597656607628 115.44329071044922,7.248530372977257 C114.96995544433594,7.574637398123741 113.5140609741211,7.908811077475548 114.63501739501953,8.306883797049522 C115.61112976074219,8.883499130606651 116.58037567138672,9.474181160330772 117.58061218261719,10.008124336600304 C118.05723571777344,9.784612640738487 118.50651550292969,9.5052699893713 118.96446990966797,9.246344551444054 zM125.38018035888672,12.091858848929405 C125.9474868774414,11.636047348380089 127.32159423828125,11.201767906546593 127.36749267578125,10.712632164359093 C126.08487701416016,9.974547371268272 124.83960723876953,9.152772888541222 123.49772644042969,8.528907760977745 C123.03594207763672,8.353693947196007 122.66152954101562,8.623294815421104 122.28982543945312,8.857431396842003 C121.19065856933594,9.51122473180294 120.06505584716797,10.12446115911007 119.00167083740234,10.835315689444542 C120.39238739013672,11.69529627263546 121.79983520507812,12.529837593436241 123.22095489501953,13.338589653372765 C123.94580841064453,12.932025894522667 124.66128540039062,12.508862480521202 125.38018035888672,12.091858848929405 zM131.07164001464844,13.514615997672081 C131.66018676757812,13.143282875418663 132.2487335205078,12.771927818655968 132.8372802734375,12.400571808218956 C132.8324737548828,11.156818374991417 132.8523406982422,9.912529930472374 132.81829833984375,8.669195160269737 C131.63046264648438,9.332009300589561 130.45948791503906,10.027913078665733 129.30828857421875,10.752535805106163 C129.182373046875,12.035354599356651 129.24623107910156,13.33940313756466 129.27359008789062,14.628684982657433 C129.88104248046875,14.27079389989376 130.4737548828125,13.888019546866417 131.07164001464844,13.514640793204308 zM117.26847839355469,12.731024727225304 C117.32825469970703,11.67083452641964 117.45709991455078,10.46224020421505 116.17853546142578,10.148179039359093 C115.37110900878906,9.77159021794796 114.25194549560547,8.806716904044151 113.62991333007812,8.81639002263546 C113.61052703857422,10.0110072940588 113.62078857421875,11.20585821568966 113.61869049072266,12.400571808218956 C114.81139373779297,13.144886955618858 115.98292541503906,13.925040230154991 117.20137023925781,14.626662239432335 C117.31951141357422,14.010867103934288 117.24227905273438,13.35805033147335 117.26847839355469,12.731024727225304 zM125.80937957763672,16.836034759879112 C126.51483917236328,16.390663132071495 127.22030639648438,15.945291504263878 127.92576599121094,15.49991987645626 C127.92250061035156,14.215868934988976 127.97560119628906,12.929980263113976 127.91757202148438,11.647302612662315 C127.14225769042969,11.869626984000206 126.25550079345703,12.556857094168663 125.43866729736328,12.983742699027061 C124.82704162597656,13.342005714774132 124.21542358398438,13.700271591544151 123.60379028320312,14.05853746831417 C123.61585235595703,15.429577812552452 123.57081604003906,16.803131088614464 123.64839172363281,18.172149643301964 C124.37957000732422,17.744937881827354 125.09130859375,17.284801468253136 125.80937957763672,16.836034759879112 zM122.8521499633789,16.115344032645226 C122.8521499633789,15.429741844534874 122.8521499633789,14.744139656424522 122.8521499633789,14.05853746831417 C121.43595123291016,13.230924591422081 120.02428436279297,12.395455345511436 118.60256958007812,11.577354416251183 C118.52394104003906,12.888403877615929 118.56887817382812,14.204405769705772 118.55702209472656,15.517732605338097 C119.97289276123047,16.4041957706213 121.37410736083984,17.314891800284386 122.80789947509766,18.172149643301964 C122.86368560791016,17.488990768790245 122.84332275390625,16.800363525748253 122.8521499633789,16.115344032645226 zM131.10684204101562,18.871450409293175 C131.68399047851562,18.48711584508419 132.2611541748047,18.10278509557247 132.8383026123047,17.718475326895714 C132.81423950195312,16.499977096915245 132.89776611328125,15.264989838004112 132.77627563476562,14.05993078649044 C131.5760040283203,14.744719490408897 130.41763305664062,15.524359688162804 129.23875427246094,16.255397781729698 C129.26707458496094,17.516149505972862 129.18060302734375,18.791316971182823 129.3108367919922,20.041303619742393 C129.91973876953125,19.667551025748253 130.51010131835938,19.264152511954308 131.10684204101562,18.871450409293175 zM117.2557373046875,18.188333496451378 C117.25104522705078,17.549470886588097 117.24633026123047,16.91058538854122 117.24163055419922,16.271720871329308 C116.04924774169922,15.525708183646202 114.87187957763672,14.75476549565792 113.66158294677734,14.038097366690636 C113.5858383178711,15.262084946036339 113.62901306152344,16.49083898961544 113.61761474609375,17.717010483145714 C114.82051086425781,18.513254150748253 116.00987243652344,19.330610260367393 117.22888946533203,20.101993545889854 C117.27559661865234,19.466014847159386 117.25241088867188,18.825733169913292 117.2557373046875,18.188333496451378 zM125.8398666381836,22.38675306737423 C126.54049682617188,21.921453461050987 127.24110412597656,21.456151947379112 127.94172668457031,20.99083136022091 C127.94009399414062,19.693386062979698 127.96646118164062,18.395381912589073 127.93160247802734,17.098379120230675 C126.50540924072266,17.97775076329708 125.08877563476562,18.873308166861534 123.68258666992188,19.78428266942501 C123.52366638183594,21.03710363805294 123.626708984375,22.32878302037716 123.62647247314453,23.595300659537315 C124.06291198730469,23.86113165318966 125.1788101196289,22.68297766149044 125.8398666381836,22.38675306737423 zM122.8521499633789,21.83134649693966 C122.76741790771484,20.936696991324425 123.21651458740234,19.67745779454708 122.0794677734375,19.330633148550987 C120.93280029296875,18.604360565543175 119.7907485961914,17.870157226920128 118.62899780273438,17.16818617284298 C118.45966339111328,18.396427139639854 118.63676452636719,19.675991043448448 118.50668334960938,20.919256195425987 C119.89984130859375,21.92635916173458 121.32942199707031,22.88914106786251 122.78502655029297,23.803510650992393 C122.90177917480469,23.1627406924963 122.82917022705078,22.48402212560177 122.8521499633789,21.83134649693966 zM117.9798355102539,21.59483526647091 C116.28416442871094,20.46288488805294 114.58848571777344,19.330957397818565 112.892822265625,18.199007019400597 C112.89473724365234,14.705654129385948 112.84647369384766,11.211485847830772 112.90847778320312,7.718807205557823 C113.7575912475586,7.194885239005089 114.66117858886719,6.765397056937218 115.5350341796875,6.284702762961388 C114.97061157226562,4.668964847922325 115.78496551513672,2.7054970115423203 117.42159271240234,2.1007001250982285 C118.79354095458984,1.537783369421959 120.44731903076172,2.0457767099142075 121.32200622558594,3.23083733022213 C121.95732116699219,2.9050118774175644 122.59264373779297,2.5791852325201035 123.22796630859375,2.253336176276207 C123.86669921875,2.5821153968572617 124.50543975830078,2.9108948558568954 125.1441650390625,3.23967407643795 C126.05941009521484,2.154020771384239 127.62747192382812,1.5344576686620712 128.986328125,2.1429056972265244 C130.61741638183594,2.716217741370201 131.50650024414062,4.675290569663048 130.9215545654297,6.2884936183691025 C131.8018341064453,6.78548763692379 132.7589111328125,7.1738648265600204 133.5660400390625,7.780336365103722 C133.60182189941406,11.252970680594444 133.56637573242188,14.726140961050987 133.5631103515625,18.199007019400597 C130.18914794921875,20.431867584586143 126.86984252929688,22.74994657933712 123.44108581542969,24.897907242178917 C122.44406127929688,24.897628769278526 121.5834732055664,23.815067276358604 120.65831756591797,23.37616156041622 C119.76387023925781,22.784828171133995 118.87168884277344,22.19007681310177 117.9798355102539,21.59483526647091 z'; - private const GHOST_HEART = 'M125.91386369681868,8.305165958366445 C128.95033202169043,-0.40540639102854037 140.8469835342744,8.305165958366445 125.91386369681868,19.504526138305664 C110.98208663272044,8.305165958366445 122.87795231771452,-0.40540639102854037 125.91386369681868,8.305165958366445 z'; - private const GHOST_PLUS = 'M111.36824226379395,8.969108581542969 L118.69175148010254,8.969108581542969 L118.69175148010254,1.6455793380737305 L126.20429420471191,1.6455793380737305 L126.20429420471191,8.969108581542969 L133.52781105041504,8.969108581542969 L133.52781105041504,16.481630325317383 L126.20429420471191,16.481630325317383 L126.20429420471191,23.805158615112305 L118.69175148010254,23.805158615112305 L118.69175148010254,16.481630325317383 L111.36824226379395,16.481630325317383 z'; - - private bool|\Closure $debug; - private string $charset; - private string|array|FileLinkFormatter|false $fileLinkFormat; - private ?string $projectDir; - private string|\Closure $outputBuffer; - private ?LoggerInterface $logger; - - private static string $template = 'views/error.html.php'; - - /** - * @param bool|callable $debug The debugging mode as a boolean or a callable that should return it - * @param string|callable $outputBuffer The output buffer as a string or a callable that should return it - */ - public function __construct(bool|callable $debug = false, string $charset = null, string|FileLinkFormatter $fileLinkFormat = null, string $projectDir = null, string|callable $outputBuffer = '', LoggerInterface $logger = null) - { - $this->debug = \is_bool($debug) ? $debug : $debug(...); - $this->charset = $charset ?: (\ini_get('default_charset') ?: 'UTF-8'); - $fileLinkFormat ??= $_ENV['SYMFONY_IDE'] ?? $_SERVER['SYMFONY_IDE'] ?? null; - $this->fileLinkFormat = \is_string($fileLinkFormat) - ? (ErrorRendererInterface::IDE_LINK_FORMATS[$fileLinkFormat] ?? $fileLinkFormat ?: false) - : ($fileLinkFormat ?: \ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format') ?: false); - $this->projectDir = $projectDir; - $this->outputBuffer = \is_string($outputBuffer) ? $outputBuffer : $outputBuffer(...); - $this->logger = $logger; - } - - public function render(\Throwable $exception): FlattenException - { - $headers = ['Content-Type' => 'text/html; charset='.$this->charset]; - if (\is_bool($this->debug) ? $this->debug : ($this->debug)($exception)) { - $headers['X-Debug-Exception'] = rawurlencode($exception->getMessage()); - $headers['X-Debug-Exception-File'] = rawurlencode($exception->getFile()).':'.$exception->getLine(); - } - - $exception = FlattenException::createFromThrowable($exception, null, $headers); - - return $exception->setAsString($this->renderException($exception)); - } - - /** - * Gets the HTML content associated with the given exception. - */ - public function getBody(FlattenException $exception): string - { - return $this->renderException($exception, 'views/exception.html.php'); - } - - /** - * Gets the stylesheet associated with the given exception. - */ - public function getStylesheet(): string - { - if (!$this->debug) { - return $this->include('assets/css/error.css'); - } - - return $this->include('assets/css/exception.css'); - } - - public static function isDebug(RequestStack $requestStack, bool $debug): \Closure - { - return static function () use ($requestStack, $debug): bool { - if (!$request = $requestStack->getCurrentRequest()) { - return $debug; - } - - return $debug && $request->attributes->getBoolean('showException', true); - }; - } - - public static function getAndCleanOutputBuffer(RequestStack $requestStack): \Closure - { - return static function () use ($requestStack): string { - if (!$request = $requestStack->getCurrentRequest()) { - return ''; - } - - $startObLevel = $request->headers->get('X-Php-Ob-Level', -1); - - if (ob_get_level() <= $startObLevel) { - return ''; - } - - Response::closeOutputBuffers($startObLevel + 1, true); - - return ob_get_clean(); - }; - } - - private function renderException(FlattenException $exception, string $debugTemplate = 'views/exception_full.html.php'): string - { - $debug = \is_bool($this->debug) ? $this->debug : ($this->debug)($exception); - $statusText = $this->escape($exception->getStatusText()); - $statusCode = $this->escape($exception->getStatusCode()); - - if (!$debug) { - return $this->include(self::$template, [ - 'statusText' => $statusText, - 'statusCode' => $statusCode, - ]); - } - - $exceptionMessage = $this->escape($exception->getMessage()); - - return $this->include($debugTemplate, [ - 'exception' => $exception, - 'exceptionMessage' => $exceptionMessage, - 'statusText' => $statusText, - 'statusCode' => $statusCode, - 'logger' => $this->logger instanceof DebugLoggerInterface ? $this->logger : null, - 'currentContent' => \is_string($this->outputBuffer) ? $this->outputBuffer : ($this->outputBuffer)(), - ]); - } - - private function formatArgs(array $args): string - { - $result = []; - foreach ($args as $key => $item) { - if ('object' === $item[0]) { - $formattedValue = sprintf('object(%s)', $this->abbrClass($item[1])); - } elseif ('array' === $item[0]) { - $formattedValue = sprintf('array(%s)', \is_array($item[1]) ? $this->formatArgs($item[1]) : $item[1]); - } elseif ('null' === $item[0]) { - $formattedValue = 'null'; - } elseif ('boolean' === $item[0]) { - $formattedValue = ''.strtolower(var_export($item[1], true)).''; - } elseif ('resource' === $item[0]) { - $formattedValue = 'resource'; - } else { - $formattedValue = str_replace("\n", '', $this->escape(var_export($item[1], true))); - } - - $result[] = \is_int($key) ? $formattedValue : sprintf("'%s' => %s", $this->escape($key), $formattedValue); - } - - return implode(', ', $result); - } - - private function formatArgsAsText(array $args) - { - return strip_tags($this->formatArgs($args)); - } - - private function escape(string $string): string - { - return htmlspecialchars($string, \ENT_COMPAT | \ENT_SUBSTITUTE, $this->charset); - } - - private function abbrClass(string $class): string - { - $parts = explode('\\', $class); - $short = array_pop($parts); - - return sprintf('%s', $class, $short); - } - - private function getFileRelative(string $file): ?string - { - $file = str_replace('\\', '/', $file); - - if (null !== $this->projectDir && str_starts_with($file, $this->projectDir)) { - return ltrim(substr($file, \strlen($this->projectDir)), '/'); - } - - return null; - } - - private function getFileLink(string $file, int $line): string|false - { - if ($fmt = $this->fileLinkFormat) { - return \is_string($fmt) ? strtr($fmt, ['%f' => $file, '%l' => $line]) : $fmt->format($file, $line); - } - - return false; - } - - /** - * Formats a file path. - * - * @param string $file An absolute file path - * @param int $line The line number - * @param string $text Use this text for the link rather than the file path - */ - private function formatFile(string $file, int $line, string $text = null): string - { - $file = trim($file); - - if (null === $text) { - $text = $file; - if (null !== $rel = $this->getFileRelative($text)) { - $rel = explode('/', $rel, 2); - $text = sprintf('%s%s', $this->projectDir, $rel[0], '/'.($rel[1] ?? '')); - } - } - - if (0 < $line) { - $text .= ' at line '.$line; - } - - if (false !== $link = $this->getFileLink($file, $line)) { - return sprintf('%s', $this->escape($link), $text); - } - - return $text; - } - - /** - * Returns an excerpt of a code file around the given line number. - * - * @param string $file A file path - * @param int $line The selected line number - * @param int $srcContext The number of displayed lines around or -1 for the whole file - */ - private function fileExcerpt(string $file, int $line, int $srcContext = 3): string - { - if (is_file($file) && is_readable($file)) { - // highlight_file could throw warnings - // see https://bugs.php.net/25725 - $code = @highlight_file($file, true); - // remove main code/span tags - $code = preg_replace('#^\s*(.*)\s*#s', '\\1', $code); - // split multiline spans - $code = preg_replace_callback('#]++)>((?:[^<]*+
      )++[^<]*+)
      #', function ($m) { - return "".str_replace('
      ', "

      ", $m[2]).''; - }, $code); - $content = explode('
      ', $code); - - $lines = []; - if (0 > $srcContext) { - $srcContext = \count($content); - } - - for ($i = max($line - $srcContext, 1), $max = min($line + $srcContext, \count($content)); $i <= $max; ++$i) { - $lines[] = ''.$this->fixCodeMarkup($content[$i - 1]).''; - } - - return '
        '.implode("\n", $lines).'
      '; - } - - return ''; - } - - private function fixCodeMarkup(string $line) - { - // ending tag from previous line - $opening = strpos($line, ''); - if (false !== $closing && (false === $opening || $closing < $opening)) { - $line = substr_replace($line, '', $closing, 7); - } - - // missing tag at the end of line - $opening = strrpos($line, ''); - if (false !== $opening && (false === $closing || $closing < $opening)) { - $line .= ''; - } - - return trim($line); - } - - private function formatFileFromText(string $text) - { - return preg_replace_callback('/in ("|")?(.+?)\1(?: +(?:on|at))? +line (\d+)/s', function ($match) { - return 'in '.$this->formatFile($match[2], $match[3]); - }, $text); - } - - private function formatLogMessage(string $message, array $context) - { - if ($context && str_contains($message, '{')) { - $replacements = []; - foreach ($context as $key => $val) { - if (\is_scalar($val)) { - $replacements['{'.$key.'}'] = $val; - } - } - - if ($replacements) { - $message = strtr($message, $replacements); - } - } - - return $this->escape($message); - } - - private function addElementToGhost(): string - { - if (!isset(self::GHOST_ADDONS[date('m-d')])) { - return ''; - } - - return ''; - } - - private function include(string $name, array $context = []): string - { - extract($context, \EXTR_SKIP); - ob_start(); - - include is_file(\dirname(__DIR__).'/Resources/'.$name) ? \dirname(__DIR__).'/Resources/'.$name : $name; - - return trim(ob_get_clean()); - } - - /** - * Allows overriding the default non-debug template. - * - * @param string $template path to the custom template file to render - */ - public static function setTemplate(string $template): void - { - self::$template = $template; - } -} diff --git a/vendor/symfony/error-handler/ErrorRenderer/SerializerErrorRenderer.php b/vendor/symfony/error-handler/ErrorRenderer/SerializerErrorRenderer.php deleted file mode 100644 index 8130b2ee..00000000 --- a/vendor/symfony/error-handler/ErrorRenderer/SerializerErrorRenderer.php +++ /dev/null @@ -1,83 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\ErrorHandler\ErrorRenderer; - -use Symfony\Component\ErrorHandler\Exception\FlattenException; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\RequestStack; -use Symfony\Component\Serializer\Exception\NotEncodableValueException; -use Symfony\Component\Serializer\SerializerInterface; - -/** - * Formats an exception using Serializer for rendering. - * - * @author Nicolas Grekas - */ -class SerializerErrorRenderer implements ErrorRendererInterface -{ - private SerializerInterface $serializer; - private string|\Closure $format; - private ErrorRendererInterface $fallbackErrorRenderer; - private bool|\Closure $debug; - - /** - * @param string|callable(FlattenException) $format The format as a string or a callable that should return it - * formats not supported by Request::getMimeTypes() should be given as mime types - * @param bool|callable $debug The debugging mode as a boolean or a callable that should return it - */ - public function __construct(SerializerInterface $serializer, string|callable $format, ErrorRendererInterface $fallbackErrorRenderer = null, bool|callable $debug = false) - { - $this->serializer = $serializer; - $this->format = \is_string($format) ? $format : $format(...); - $this->fallbackErrorRenderer = $fallbackErrorRenderer ?? new HtmlErrorRenderer(); - $this->debug = \is_bool($debug) ? $debug : $debug(...); - } - - public function render(\Throwable $exception): FlattenException - { - $headers = []; - $debug = \is_bool($this->debug) ? $this->debug : ($this->debug)($exception); - if ($debug) { - $headers['X-Debug-Exception'] = rawurlencode($exception->getMessage()); - $headers['X-Debug-Exception-File'] = rawurlencode($exception->getFile()).':'.$exception->getLine(); - } - - $flattenException = FlattenException::createFromThrowable($exception, null, $headers); - - try { - $format = \is_string($this->format) ? $this->format : ($this->format)($flattenException); - $headers = [ - 'Content-Type' => Request::getMimeTypes($format)[0] ?? $format, - 'Vary' => 'Accept', - ]; - - return $flattenException->setAsString($this->serializer->serialize($flattenException, $format, [ - 'exception' => $exception, - 'debug' => $debug, - ])) - ->setHeaders($flattenException->getHeaders() + $headers); - } catch (NotEncodableValueException) { - return $this->fallbackErrorRenderer->render($exception); - } - } - - public static function getPreferredFormat(RequestStack $requestStack): \Closure - { - return static function () use ($requestStack) { - if (!$request = $requestStack->getCurrentRequest()) { - throw new NotEncodableValueException(); - } - - return $request->getPreferredFormat(); - }; - } -} diff --git a/vendor/symfony/error-handler/Exception/FlattenException.php b/vendor/symfony/error-handler/Exception/FlattenException.php deleted file mode 100644 index 19d69fee..00000000 --- a/vendor/symfony/error-handler/Exception/FlattenException.php +++ /dev/null @@ -1,394 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\ErrorHandler\Exception; - -use Symfony\Component\HttpFoundation\Exception\RequestExceptionInterface; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface; - -/** - * FlattenException wraps a PHP Error or Exception to be able to serialize it. - * - * Basically, this class removes all objects from the trace. - * - * @author Fabien Potencier - */ -class FlattenException -{ - private string $message; - private string|int $code; - private ?self $previous = null; - private array $trace; - private string $traceAsString; - private string $class; - private int $statusCode; - private string $statusText; - private array $headers; - private string $file; - private int $line; - private ?string $asString = null; - - public static function create(\Exception $exception, int $statusCode = null, array $headers = []): static - { - return static::createFromThrowable($exception, $statusCode, $headers); - } - - public static function createFromThrowable(\Throwable $exception, int $statusCode = null, array $headers = []): static - { - $e = new static(); - $e->setMessage($exception->getMessage()); - $e->setCode($exception->getCode()); - - if ($exception instanceof HttpExceptionInterface) { - $statusCode = $exception->getStatusCode(); - $headers = array_merge($headers, $exception->getHeaders()); - } elseif ($exception instanceof RequestExceptionInterface) { - $statusCode = 400; - } - - $statusCode ??= 500; - - if (class_exists(Response::class) && isset(Response::$statusTexts[$statusCode])) { - $statusText = Response::$statusTexts[$statusCode]; - } else { - $statusText = 'Whoops, looks like something went wrong.'; - } - - $e->setStatusText($statusText); - $e->setStatusCode($statusCode); - $e->setHeaders($headers); - $e->setTraceFromThrowable($exception); - $e->setClass(get_debug_type($exception)); - $e->setFile($exception->getFile()); - $e->setLine($exception->getLine()); - - $previous = $exception->getPrevious(); - - if ($previous instanceof \Throwable) { - $e->setPrevious(static::createFromThrowable($previous)); - } - - return $e; - } - - public function toArray(): array - { - $exceptions = []; - foreach (array_merge([$this], $this->getAllPrevious()) as $exception) { - $exceptions[] = [ - 'message' => $exception->getMessage(), - 'class' => $exception->getClass(), - 'trace' => $exception->getTrace(), - ]; - } - - return $exceptions; - } - - public function getStatusCode(): int - { - return $this->statusCode; - } - - /** - * @return $this - */ - public function setStatusCode(int $code): static - { - $this->statusCode = $code; - - return $this; - } - - public function getHeaders(): array - { - return $this->headers; - } - - /** - * @return $this - */ - public function setHeaders(array $headers): static - { - $this->headers = $headers; - - return $this; - } - - public function getClass(): string - { - return $this->class; - } - - /** - * @return $this - */ - public function setClass(string $class): static - { - $this->class = str_contains($class, "@anonymous\0") ? (get_parent_class($class) ?: key(class_implements($class)) ?: 'class').'@anonymous' : $class; - - return $this; - } - - public function getFile(): string - { - return $this->file; - } - - /** - * @return $this - */ - public function setFile(string $file): static - { - $this->file = $file; - - return $this; - } - - public function getLine(): int - { - return $this->line; - } - - /** - * @return $this - */ - public function setLine(int $line): static - { - $this->line = $line; - - return $this; - } - - public function getStatusText(): string - { - return $this->statusText; - } - - /** - * @return $this - */ - public function setStatusText(string $statusText): static - { - $this->statusText = $statusText; - - return $this; - } - - public function getMessage(): string - { - return $this->message; - } - - /** - * @return $this - */ - public function setMessage(string $message): static - { - if (str_contains($message, "@anonymous\0")) { - $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]; - }, $message); - } - - $this->message = $message; - - return $this; - } - - /** - * @return int|string int most of the time (might be a string with PDOException) - */ - public function getCode(): int|string - { - return $this->code; - } - - /** - * @return $this - */ - public function setCode(int|string $code): static - { - $this->code = $code; - - return $this; - } - - public function getPrevious(): ?self - { - return $this->previous; - } - - /** - * @return $this - */ - public function setPrevious(?self $previous): static - { - $this->previous = $previous; - - return $this; - } - - /** - * @return self[] - */ - public function getAllPrevious(): array - { - $exceptions = []; - $e = $this; - while ($e = $e->getPrevious()) { - $exceptions[] = $e; - } - - return $exceptions; - } - - public function getTrace(): array - { - return $this->trace; - } - - /** - * @return $this - */ - public function setTraceFromThrowable(\Throwable $throwable): static - { - $this->traceAsString = $throwable->getTraceAsString(); - - return $this->setTrace($throwable->getTrace(), $throwable->getFile(), $throwable->getLine()); - } - - /** - * @return $this - */ - public function setTrace(array $trace, ?string $file, ?int $line): static - { - $this->trace = []; - $this->trace[] = [ - 'namespace' => '', - 'short_class' => '', - 'class' => '', - 'type' => '', - 'function' => '', - 'file' => $file, - 'line' => $line, - 'args' => [], - ]; - foreach ($trace as $entry) { - $class = ''; - $namespace = ''; - if (isset($entry['class'])) { - $parts = explode('\\', $entry['class']); - $class = array_pop($parts); - $namespace = implode('\\', $parts); - } - - $this->trace[] = [ - 'namespace' => $namespace, - 'short_class' => $class, - 'class' => $entry['class'] ?? '', - 'type' => $entry['type'] ?? '', - 'function' => $entry['function'] ?? null, - 'file' => $entry['file'] ?? null, - 'line' => $entry['line'] ?? null, - 'args' => isset($entry['args']) ? $this->flattenArgs($entry['args']) : [], - ]; - } - - return $this; - } - - private function flattenArgs(array $args, int $level = 0, int &$count = 0): array - { - $result = []; - foreach ($args as $key => $value) { - if (++$count > 1e4) { - return ['array', '*SKIPPED over 10000 entries*']; - } - if ($value instanceof \__PHP_Incomplete_Class) { - $result[$key] = ['incomplete-object', $this->getClassNameFromIncomplete($value)]; - } elseif (\is_object($value)) { - $result[$key] = ['object', get_debug_type($value)]; - } elseif (\is_array($value)) { - if ($level > 10) { - $result[$key] = ['array', '*DEEP NESTED ARRAY*']; - } else { - $result[$key] = ['array', $this->flattenArgs($value, $level + 1, $count)]; - } - } elseif (null === $value) { - $result[$key] = ['null', null]; - } elseif (\is_bool($value)) { - $result[$key] = ['boolean', $value]; - } elseif (\is_int($value)) { - $result[$key] = ['integer', $value]; - } elseif (\is_float($value)) { - $result[$key] = ['float', $value]; - } elseif (\is_resource($value)) { - $result[$key] = ['resource', get_resource_type($value)]; - } else { - $result[$key] = ['string', (string) $value]; - } - } - - return $result; - } - - private function getClassNameFromIncomplete(\__PHP_Incomplete_Class $value): string - { - $array = new \ArrayObject($value); - - return $array['__PHP_Incomplete_Class_Name']; - } - - public function getTraceAsString(): string - { - return $this->traceAsString; - } - - /** - * @return $this - */ - public function setAsString(?string $asString): static - { - $this->asString = $asString; - - return $this; - } - - public function getAsString(): string - { - if (null !== $this->asString) { - return $this->asString; - } - - $message = ''; - $next = false; - - foreach (array_reverse(array_merge([$this], $this->getAllPrevious())) as $exception) { - if ($next) { - $message .= 'Next '; - } else { - $next = true; - } - $message .= $exception->getClass(); - - if ('' != $exception->getMessage()) { - $message .= ': '.$exception->getMessage(); - } - - $message .= ' in '.$exception->getFile().':'.$exception->getLine(). - "\nStack trace:\n".$exception->getTraceAsString()."\n\n"; - } - - return rtrim($message); - } -} diff --git a/vendor/symfony/error-handler/Exception/SilencedErrorContext.php b/vendor/symfony/error-handler/Exception/SilencedErrorContext.php deleted file mode 100644 index ac19e639..00000000 --- a/vendor/symfony/error-handler/Exception/SilencedErrorContext.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\ErrorHandler\Exception; - -/** - * Data Object that represents a Silenced Error. - * - * @author Grégoire Pineau - */ -class SilencedErrorContext implements \JsonSerializable -{ - public $count = 1; - - private int $severity; - private string $file; - private int $line; - private array $trace; - - public function __construct(int $severity, string $file, int $line, array $trace = [], int $count = 1) - { - $this->severity = $severity; - $this->file = $file; - $this->line = $line; - $this->trace = $trace; - $this->count = $count; - } - - public function getSeverity(): int - { - return $this->severity; - } - - public function getFile(): string - { - return $this->file; - } - - public function getLine(): int - { - return $this->line; - } - - public function getTrace(): array - { - return $this->trace; - } - - public function jsonSerialize(): array - { - return [ - 'severity' => $this->severity, - 'file' => $this->file, - 'line' => $this->line, - 'trace' => $this->trace, - 'count' => $this->count, - ]; - } -} diff --git a/vendor/symfony/error-handler/Internal/TentativeTypes.php b/vendor/symfony/error-handler/Internal/TentativeTypes.php deleted file mode 100644 index 1e8afe39..00000000 --- a/vendor/symfony/error-handler/Internal/TentativeTypes.php +++ /dev/null @@ -1,1643 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\ErrorHandler\Internal; - -/** - * This class has been generated by extract-tentative-return-types.php. - * - * @internal - */ -class TentativeTypes -{ - public const RETURN_TYPES = [ - 'CURLFile' => [ - 'getFilename' => 'string', - 'getMimeType' => 'string', - 'getPostFilename' => 'string', - 'setMimeType' => 'void', - 'setPostFilename' => 'void', - ], - 'DateTimeInterface' => [ - 'format' => 'string', - 'getTimezone' => 'DateTimeZone|false', - 'getOffset' => 'int', - 'getTimestamp' => 'int', - 'diff' => 'DateInterval', - '__wakeup' => 'void', - ], - 'DateTime' => [ - '__wakeup' => 'void', - '__set_state' => 'DateTime', - 'createFromImmutable' => 'static', - 'createFromFormat' => 'DateTime|false', - 'getLastErrors' => 'array|false', - 'format' => 'string', - 'modify' => 'DateTime|false', - 'add' => 'DateTime', - 'sub' => 'DateTime', - 'getTimezone' => 'DateTimeZone|false', - 'setTimezone' => 'DateTime', - 'getOffset' => 'int', - 'setTime' => 'DateTime', - 'setDate' => 'DateTime', - 'setISODate' => 'DateTime', - 'setTimestamp' => 'DateTime', - 'getTimestamp' => 'int', - 'diff' => 'DateInterval', - ], - 'DateTimeImmutable' => [ - '__wakeup' => 'void', - '__set_state' => 'DateTimeImmutable', - 'createFromFormat' => 'DateTimeImmutable|false', - 'getLastErrors' => 'array|false', - 'format' => 'string', - 'getTimezone' => 'DateTimeZone|false', - 'getOffset' => 'int', - 'getTimestamp' => 'int', - 'diff' => 'DateInterval', - 'modify' => 'DateTimeImmutable|false', - 'add' => 'DateTimeImmutable', - 'sub' => 'DateTimeImmutable', - 'setTimezone' => 'DateTimeImmutable', - 'setTime' => 'DateTimeImmutable', - 'setDate' => 'DateTimeImmutable', - 'setISODate' => 'DateTimeImmutable', - 'setTimestamp' => 'DateTimeImmutable', - 'createFromMutable' => 'static', - ], - 'DateTimeZone' => [ - 'getName' => 'string', - 'getOffset' => 'int', - 'getTransitions' => 'array|false', - 'getLocation' => 'array|false', - 'listAbbreviations' => 'array', - 'listIdentifiers' => 'array', - '__wakeup' => 'void', - '__set_state' => 'DateTimeZone', - ], - 'DateInterval' => [ - 'createFromDateString' => 'DateInterval|false', - 'format' => 'string', - '__wakeup' => 'void', - '__set_state' => 'DateInterval', - ], - 'DatePeriod' => [ - 'getStartDate' => 'DateTimeInterface', - 'getEndDate' => '?DateTimeInterface', - 'getDateInterval' => 'DateInterval', - 'getRecurrences' => '?int', - '__wakeup' => 'void', - '__set_state' => 'DatePeriod', - ], - 'DOMNode' => [ - 'C14N' => 'string|false', - 'C14NFile' => 'int|false', - 'getLineNo' => 'int', - 'getNodePath' => '?string', - 'hasAttributes' => 'bool', - 'hasChildNodes' => 'bool', - 'isDefaultNamespace' => 'bool', - 'isSameNode' => 'bool', - 'isSupported' => 'bool', - 'lookupNamespaceURI' => '?string', - 'lookupPrefix' => '?string', - 'normalize' => 'void', - ], - 'DOMImplementation' => [ - 'getFeature' => 'never', - 'hasFeature' => 'bool', - ], - 'DOMDocumentFragment' => [ - 'appendXML' => 'bool', - ], - 'DOMNodeList' => [ - 'count' => 'int', - ], - 'DOMCharacterData' => [ - 'appendData' => 'bool', - 'insertData' => 'bool', - 'deleteData' => 'bool', - 'replaceData' => 'bool', - ], - 'DOMAttr' => [ - 'isId' => 'bool', - ], - 'DOMElement' => [ - 'getAttribute' => 'string', - 'getAttributeNS' => 'string', - 'getElementsByTagName' => 'DOMNodeList', - 'getElementsByTagNameNS' => 'DOMNodeList', - 'hasAttribute' => 'bool', - 'hasAttributeNS' => 'bool', - 'removeAttribute' => 'bool', - 'removeAttributeNS' => 'void', - 'setAttributeNS' => 'void', - 'setIdAttribute' => 'void', - 'setIdAttributeNS' => 'void', - 'setIdAttributeNode' => 'void', - ], - 'DOMDocument' => [ - 'createComment' => 'DOMComment', - 'createDocumentFragment' => 'DOMDocumentFragment', - 'createTextNode' => 'DOMText', - 'getElementById' => '?DOMElement', - 'getElementsByTagName' => 'DOMNodeList', - 'getElementsByTagNameNS' => 'DOMNodeList', - 'normalizeDocument' => 'void', - 'registerNodeClass' => 'bool', - 'save' => 'int|false', - 'saveHTML' => 'string|false', - 'saveHTMLFile' => 'int|false', - 'saveXML' => 'string|false', - 'schemaValidate' => 'bool', - 'schemaValidateSource' => 'bool', - 'relaxNGValidate' => 'bool', - 'relaxNGValidateSource' => 'bool', - 'validate' => 'bool', - 'xinclude' => 'int|false', - ], - 'DOMText' => [ - 'isWhitespaceInElementContent' => 'bool', - 'isElementContentWhitespace' => 'bool', - ], - 'DOMNamedNodeMap' => [ - 'getNamedItem' => '?DOMNode', - 'getNamedItemNS' => '?DOMNode', - 'item' => '?DOMNode', - 'count' => 'int', - ], - 'DOMXPath' => [ - 'evaluate' => 'mixed', - 'query' => 'mixed', - 'registerNamespace' => 'bool', - 'registerPhpFunctions' => 'void', - ], - 'finfo' => [ - 'file' => 'string|false', - 'buffer' => 'string|false', - ], - 'IntlPartsIterator' => [ - 'getBreakIterator' => 'IntlBreakIterator', - 'getRuleStatus' => 'int', - ], - 'IntlBreakIterator' => [ - 'createCharacterInstance' => '?IntlBreakIterator', - 'createCodePointInstance' => 'IntlCodePointBreakIterator', - 'createLineInstance' => '?IntlBreakIterator', - 'createSentenceInstance' => '?IntlBreakIterator', - 'createTitleInstance' => '?IntlBreakIterator', - 'createWordInstance' => '?IntlBreakIterator', - 'current' => 'int', - 'first' => 'int', - 'following' => 'int', - 'getErrorCode' => 'int', - 'getErrorMessage' => 'string', - 'getLocale' => 'string|false', - 'getPartsIterator' => 'IntlPartsIterator', - 'getText' => '?string', - 'isBoundary' => 'bool', - 'last' => 'int', - 'next' => 'int', - 'preceding' => 'int', - 'previous' => 'int', - 'setText' => '?bool', - ], - 'IntlRuleBasedBreakIterator' => [ - 'getBinaryRules' => 'string|false', - 'getRules' => 'string|false', - 'getRuleStatus' => 'int', - 'getRuleStatusVec' => 'array|false', - ], - 'IntlCodePointBreakIterator' => [ - 'getLastCodePoint' => 'int', - ], - 'IntlCalendar' => [ - 'createInstance' => '?IntlCalendar', - 'equals' => 'bool', - 'fieldDifference' => 'int|false', - 'add' => 'bool', - 'after' => 'bool', - 'before' => 'bool', - 'fromDateTime' => '?IntlCalendar', - 'get' => 'int|false', - 'getActualMaximum' => 'int|false', - 'getActualMinimum' => 'int|false', - 'getAvailableLocales' => 'array', - 'getDayOfWeekType' => 'int|false', - 'getErrorCode' => 'int|false', - 'getErrorMessage' => 'string|false', - 'getFirstDayOfWeek' => 'int|false', - 'getGreatestMinimum' => 'int|false', - 'getKeywordValuesForLocale' => 'IntlIterator|false', - 'getLeastMaximum' => 'int|false', - 'getLocale' => 'string|false', - 'getMaximum' => 'int|false', - 'getMinimalDaysInFirstWeek' => 'int|false', - 'getMinimum' => 'int|false', - 'getNow' => 'float', - 'getRepeatedWallTimeOption' => 'int', - 'getSkippedWallTimeOption' => 'int', - 'getTime' => 'float|false', - 'getTimeZone' => 'IntlTimeZone|false', - 'getType' => 'string', - 'getWeekendTransition' => 'int|false', - 'inDaylightTime' => 'bool', - 'isEquivalentTo' => 'bool', - 'isLenient' => 'bool', - 'isWeekend' => 'bool', - 'roll' => 'bool', - 'isSet' => 'bool', - 'setTime' => 'bool', - 'setTimeZone' => 'bool', - 'toDateTime' => 'DateTime|false', - ], - 'IntlGregorianCalendar' => [ - 'setGregorianChange' => 'bool', - 'getGregorianChange' => 'float', - 'isLeapYear' => 'bool', - ], - 'Collator' => [ - 'create' => '?Collator', - 'compare' => 'int|false', - 'sort' => 'bool', - 'sortWithSortKeys' => 'bool', - 'asort' => 'bool', - 'getAttribute' => 'int|false', - 'setAttribute' => 'bool', - 'getStrength' => 'int', - 'getLocale' => 'string|false', - 'getErrorCode' => 'int|false', - 'getErrorMessage' => 'string|false', - 'getSortKey' => 'string|false', - ], - 'IntlIterator' => [ - 'current' => 'mixed', - 'key' => 'mixed', - 'next' => 'void', - 'rewind' => 'void', - 'valid' => 'bool', - ], - 'UConverter' => [ - 'convert' => 'string|false', - 'fromUCallback' => 'string|int|array|null', - 'getAliases' => 'array|false|null', - 'getAvailable' => 'array', - 'getDestinationEncoding' => 'string|false|null', - 'getDestinationType' => 'int|false|null', - 'getErrorCode' => 'int', - 'getErrorMessage' => '?string', - 'getSourceEncoding' => 'string|false|null', - 'getSourceType' => 'int|false|null', - 'getStandards' => '?array', - 'getSubstChars' => 'string|false|null', - 'reasonText' => 'string', - 'setDestinationEncoding' => 'bool', - 'setSourceEncoding' => 'bool', - 'setSubstChars' => 'bool', - 'toUCallback' => 'string|int|array|null', - 'transcode' => 'string|false', - ], - 'IntlDateFormatter' => [ - 'create' => '?IntlDateFormatter', - 'getDateType' => 'int|false', - 'getTimeType' => 'int|false', - 'getCalendar' => 'int|false', - 'setCalendar' => 'bool', - 'getTimeZoneId' => 'string|false', - 'getCalendarObject' => 'IntlCalendar|false|null', - 'getTimeZone' => 'IntlTimeZone|false', - 'setTimeZone' => '?bool', - 'setPattern' => 'bool', - 'getPattern' => 'string|false', - 'getLocale' => 'string|false', - 'setLenient' => 'void', - 'isLenient' => 'bool', - 'format' => 'string|false', - 'formatObject' => 'string|false', - 'parse' => 'int|float|false', - 'localtime' => 'array|false', - 'getErrorCode' => 'int', - 'getErrorMessage' => 'string', - ], - 'NumberFormatter' => [ - 'create' => '?NumberFormatter', - 'format' => 'string|false', - 'parse' => 'int|float|false', - 'formatCurrency' => 'string|false', - 'parseCurrency' => 'float|false', - 'setAttribute' => 'bool', - 'getAttribute' => 'int|float|false', - 'setTextAttribute' => 'bool', - 'getTextAttribute' => 'string|false', - 'setSymbol' => 'bool', - 'getSymbol' => 'string|false', - 'setPattern' => 'bool', - 'getPattern' => 'string|false', - 'getLocale' => 'string|false', - 'getErrorCode' => 'int', - 'getErrorMessage' => 'string', - ], - 'Locale' => [ - 'getDefault' => 'string', - 'getPrimaryLanguage' => '?string', - 'getScript' => '?string', - 'getRegion' => '?string', - 'getKeywords' => 'array|false|null', - 'getDisplayScript' => 'string|false', - 'getDisplayRegion' => 'string|false', - 'getDisplayName' => 'string|false', - 'getDisplayLanguage' => 'string|false', - 'getDisplayVariant' => 'string|false', - 'composeLocale' => 'string|false', - 'parseLocale' => '?array', - 'getAllVariants' => '?array', - 'filterMatches' => '?bool', - 'lookup' => '?string', - 'canonicalize' => '?string', - 'acceptFromHttp' => 'string|false', - ], - 'MessageFormatter' => [ - 'create' => '?MessageFormatter', - 'format' => 'string|false', - 'formatMessage' => 'string|false', - 'parse' => 'array|false', - 'parseMessage' => 'array|false', - 'setPattern' => 'bool', - 'getPattern' => 'string|false', - 'getLocale' => 'string', - 'getErrorCode' => 'int', - 'getErrorMessage' => 'string', - ], - 'Normalizer' => [ - 'normalize' => 'string|false', - 'isNormalized' => 'bool', - 'getRawDecomposition' => '?string', - ], - 'ResourceBundle' => [ - 'create' => '?ResourceBundle', - 'get' => 'mixed', - 'count' => 'int', - 'getLocales' => 'array|false', - 'getErrorCode' => 'int', - 'getErrorMessage' => 'string', - ], - 'Spoofchecker' => [ - 'isSuspicious' => 'bool', - 'areConfusable' => 'bool', - 'setAllowedLocales' => 'void', - 'setChecks' => 'void', - 'setRestrictionLevel' => 'void', - ], - 'IntlTimeZone' => [ - 'countEquivalentIDs' => 'int|false', - 'createDefault' => 'IntlTimeZone', - 'createEnumeration' => 'IntlIterator|false', - 'createTimeZone' => '?IntlTimeZone', - 'createTimeZoneIDEnumeration' => 'IntlIterator|false', - 'fromDateTimeZone' => '?IntlTimeZone', - 'getCanonicalID' => 'string|false', - 'getDisplayName' => 'string|false', - 'getDSTSavings' => 'int', - 'getEquivalentID' => 'string|false', - 'getErrorCode' => 'int|false', - 'getErrorMessage' => 'string|false', - 'getGMT' => 'IntlTimeZone', - 'getID' => 'string|false', - 'getOffset' => 'bool', - 'getRawOffset' => 'int', - 'getRegion' => 'string|false', - 'getTZDataVersion' => 'string|false', - 'getUnknown' => 'IntlTimeZone', - 'getWindowsID' => 'string|false', - 'getIDForWindowsID' => 'string|false', - 'hasSameRules' => 'bool', - 'toDateTimeZone' => 'DateTimeZone|false', - 'useDaylightTime' => 'bool', - ], - 'Transliterator' => [ - 'create' => '?Transliterator', - 'createFromRules' => '?Transliterator', - 'createInverse' => '?Transliterator', - 'listIDs' => 'array|false', - 'transliterate' => 'string|false', - 'getErrorCode' => 'int|false', - 'getErrorMessage' => 'string|false', - ], - 'IntlChar' => [ - 'hasBinaryProperty' => '?bool', - 'charAge' => '?array', - 'charDigitValue' => '?int', - 'charDirection' => '?int', - 'charFromName' => '?int', - 'charMirror' => 'int|string|null', - 'charName' => '?string', - 'charType' => '?int', - 'chr' => '?string', - 'digit' => 'int|false|null', - 'enumCharNames' => '?bool', - 'enumCharTypes' => 'void', - 'foldCase' => 'int|string|null', - 'forDigit' => 'int', - 'getBidiPairedBracket' => 'int|string|null', - 'getBlockCode' => '?int', - 'getCombiningClass' => '?int', - 'getFC_NFKC_Closure' => 'string|false|null', - 'getIntPropertyMaxValue' => 'int', - 'getIntPropertyMinValue' => 'int', - 'getIntPropertyValue' => '?int', - 'getNumericValue' => '?float', - 'getPropertyEnum' => 'int', - 'getPropertyName' => 'string|false', - 'getPropertyValueEnum' => 'int', - 'getPropertyValueName' => 'string|false', - 'getUnicodeVersion' => 'array', - 'isalnum' => '?bool', - 'isalpha' => '?bool', - 'isbase' => '?bool', - 'isblank' => '?bool', - 'iscntrl' => '?bool', - 'isdefined' => '?bool', - 'isdigit' => '?bool', - 'isgraph' => '?bool', - 'isIDIgnorable' => '?bool', - 'isIDPart' => '?bool', - 'isIDStart' => '?bool', - 'isISOControl' => '?bool', - 'isJavaIDPart' => '?bool', - 'isJavaIDStart' => '?bool', - 'isJavaSpaceChar' => '?bool', - 'islower' => '?bool', - 'isMirrored' => '?bool', - 'isprint' => '?bool', - 'ispunct' => '?bool', - 'isspace' => '?bool', - 'istitle' => '?bool', - 'isUAlphabetic' => '?bool', - 'isULowercase' => '?bool', - 'isupper' => '?bool', - 'isUUppercase' => '?bool', - 'isUWhiteSpace' => '?bool', - 'isWhitespace' => '?bool', - 'isxdigit' => '?bool', - 'ord' => '?int', - 'tolower' => 'int|string|null', - 'totitle' => 'int|string|null', - 'toupper' => 'int|string|null', - ], - 'JsonSerializable' => [ - 'jsonSerialize' => 'mixed', - ], - 'mysqli' => [ - 'autocommit' => 'bool', - 'begin_transaction' => 'bool', - 'change_user' => 'bool', - 'character_set_name' => 'string', - 'commit' => 'bool', - 'connect' => 'bool', - 'dump_debug_info' => 'bool', - 'get_charset' => '?object', - 'get_client_info' => 'string', - 'get_connection_stats' => 'array', - 'get_server_info' => 'string', - 'get_warnings' => 'mysqli_warning|false', - 'kill' => 'bool', - 'multi_query' => 'bool', - 'more_results' => 'bool', - 'next_result' => 'bool', - 'ping' => 'bool', - 'poll' => 'int|false', - 'prepare' => 'mysqli_stmt|false', - 'query' => 'mysqli_result|bool', - 'real_connect' => 'bool', - 'real_escape_string' => 'string', - 'reap_async_query' => 'mysqli_result|bool', - 'escape_string' => 'string', - 'real_query' => 'bool', - 'release_savepoint' => 'bool', - 'rollback' => 'bool', - 'savepoint' => 'bool', - 'select_db' => 'bool', - 'set_charset' => 'bool', - 'options' => 'bool', - 'set_opt' => 'bool', - 'stat' => 'string|false', - 'stmt_init' => 'mysqli_stmt|false', - 'store_result' => 'mysqli_result|false', - 'thread_safe' => 'bool', - 'use_result' => 'mysqli_result|false', - 'refresh' => 'bool', - ], - 'mysqli_result' => [ - 'close' => 'void', - 'free' => 'void', - 'data_seek' => 'bool', - 'fetch_field' => 'object|false', - 'fetch_fields' => 'array', - 'fetch_field_direct' => 'object|false', - 'fetch_all' => 'array', - 'fetch_array' => 'array|null|false', - 'fetch_assoc' => 'array|null|false', - 'fetch_object' => 'object|null|false', - 'fetch_row' => 'array|null|false', - 'field_seek' => 'bool', - 'free_result' => 'void', - ], - 'mysqli_stmt' => [ - 'attr_get' => 'int', - 'attr_set' => 'bool', - 'bind_param' => 'bool', - 'bind_result' => 'bool', - 'data_seek' => 'void', - 'execute' => 'bool', - 'fetch' => '?bool', - 'get_warnings' => 'mysqli_warning|false', - 'result_metadata' => 'mysqli_result|false', - 'more_results' => 'bool', - 'next_result' => 'bool', - 'num_rows' => 'int|string', - 'send_long_data' => 'bool', - 'free_result' => 'void', - 'reset' => 'bool', - 'prepare' => 'bool', - 'store_result' => 'bool', - 'get_result' => 'mysqli_result|false', - ], - 'OCILob' => [ - 'save' => 'bool', - 'import' => 'bool', - 'saveFile' => 'bool', - 'load' => 'string|false', - 'read' => 'string|false', - 'eof' => 'bool', - 'tell' => 'int|false', - 'rewind' => 'bool', - 'seek' => 'bool', - 'size' => 'int|false', - 'write' => 'int|false', - 'append' => 'bool', - 'truncate' => 'bool', - 'erase' => 'int|false', - 'flush' => 'bool', - 'setBuffering' => 'bool', - 'getBuffering' => 'bool', - 'writeToFile' => 'bool', - 'export' => 'bool', - 'writeTemporary' => 'bool', - 'close' => 'bool', - 'free' => 'bool', - ], - 'OCICollection' => [ - 'free' => 'bool', - 'append' => 'bool', - 'getElem' => 'string|float|null|false', - 'assign' => 'bool', - 'assignElem' => 'bool', - 'size' => 'int|false', - 'max' => 'int|false', - 'trim' => 'bool', - ], - 'PDO' => [ - 'beginTransaction' => 'bool', - 'commit' => 'bool', - 'errorCode' => '?string', - 'errorInfo' => 'array', - 'exec' => 'int|false', - 'getAttribute' => 'mixed', - 'getAvailableDrivers' => 'array', - 'inTransaction' => 'bool', - 'lastInsertId' => 'string|false', - 'prepare' => 'PDOStatement|false', - 'query' => 'PDOStatement|false', - 'quote' => 'string|false', - 'rollBack' => 'bool', - 'setAttribute' => 'bool', - ], - 'PDOStatement' => [ - 'bindColumn' => 'bool', - 'bindParam' => 'bool', - 'bindValue' => 'bool', - 'closeCursor' => 'bool', - 'columnCount' => 'int', - 'debugDumpParams' => '?bool', - 'errorCode' => '?string', - 'errorInfo' => 'array', - 'execute' => 'bool', - 'fetch' => 'mixed', - 'fetchAll' => 'array', - 'fetchColumn' => 'mixed', - 'fetchObject' => 'object|false', - 'getAttribute' => 'mixed', - 'getColumnMeta' => 'array|false', - 'nextRowset' => 'bool', - 'rowCount' => 'int', - 'setAttribute' => 'bool', - ], - 'PDO_PGSql_Ext' => [ - 'pgsqlCopyFromArray' => 'bool', - 'pgsqlCopyFromFile' => 'bool', - 'pgsqlCopyToArray' => 'array|false', - 'pgsqlCopyToFile' => 'bool', - 'pgsqlLOBCreate' => 'string|false', - 'pgsqlLOBUnlink' => 'bool', - 'pgsqlGetNotify' => 'array|false', - 'pgsqlGetPid' => 'int', - ], - 'PDO_SQLite_Ext' => [ - 'sqliteCreateFunction' => 'bool', - 'sqliteCreateAggregate' => 'bool', - 'sqliteCreateCollation' => 'bool', - ], - 'Phar' => [ - 'addEmptyDir' => 'void', - 'addFile' => 'void', - 'addFromString' => 'void', - 'buildFromDirectory' => 'array', - 'buildFromIterator' => 'array', - 'compressFiles' => 'void', - 'compress' => '?Phar', - 'decompress' => '?Phar', - 'convertToExecutable' => '?Phar', - 'convertToData' => '?PharData', - 'count' => 'int', - 'extractTo' => 'bool', - 'getAlias' => '?string', - 'getPath' => 'string', - 'getMetadata' => 'mixed', - 'getModified' => 'bool', - 'getSignature' => 'array|false', - 'getStub' => 'string', - 'getVersion' => 'string', - 'hasMetadata' => 'bool', - 'isBuffering' => 'bool', - 'isCompressed' => 'int|false', - 'isFileFormat' => 'bool', - 'isWritable' => 'bool', - 'offsetExists' => 'bool', - 'offsetGet' => 'SplFileInfo', - 'offsetSet' => 'void', - 'offsetUnset' => 'void', - 'setAlias' => 'bool', - 'setDefaultStub' => 'bool', - 'setMetadata' => 'void', - 'setSignatureAlgorithm' => 'void', - 'startBuffering' => 'void', - 'stopBuffering' => 'void', - ], - 'PharData' => [ - 'addEmptyDir' => 'void', - 'addFile' => 'void', - 'addFromString' => 'void', - 'buildFromDirectory' => 'array', - 'buildFromIterator' => 'array', - 'compressFiles' => 'void', - 'compress' => '?PharData', - 'decompress' => '?PharData', - 'convertToExecutable' => '?Phar', - 'convertToData' => '?PharData', - 'count' => 'int', - 'extractTo' => 'bool', - 'getAlias' => '?string', - 'getPath' => 'string', - 'getMetadata' => 'mixed', - 'getModified' => 'bool', - 'getSignature' => 'array|false', - 'getStub' => 'string', - 'getVersion' => 'string', - 'hasMetadata' => 'bool', - 'isBuffering' => 'bool', - 'isCompressed' => 'int|false', - 'isFileFormat' => 'bool', - 'isWritable' => 'bool', - 'offsetExists' => 'bool', - 'offsetGet' => 'SplFileInfo', - 'offsetSet' => 'void', - 'offsetUnset' => 'void', - 'setAlias' => 'bool', - 'setDefaultStub' => 'bool', - 'setMetadata' => 'void', - 'setSignatureAlgorithm' => 'void', - 'startBuffering' => 'void', - 'stopBuffering' => 'void', - ], - 'PharFileInfo' => [ - 'chmod' => 'void', - 'getCompressedSize' => 'int', - 'getCRC32' => 'int', - 'getContent' => 'string', - 'getMetadata' => 'mixed', - 'getPharFlags' => 'int', - 'hasMetadata' => 'bool', - 'isCompressed' => 'bool', - 'isCRCChecked' => 'bool', - 'setMetadata' => 'void', - ], - 'Reflection' => [ - 'getModifierNames' => 'array', - ], - 'ReflectionFunctionAbstract' => [ - 'inNamespace' => 'bool', - 'isClosure' => 'bool', - 'isDeprecated' => 'bool', - 'isInternal' => 'bool', - 'isUserDefined' => 'bool', - 'isGenerator' => 'bool', - 'isVariadic' => 'bool', - 'isStatic' => 'bool', - 'getClosureThis' => '?object', - 'getClosureCalledClass' => '?ReflectionClass', - 'getClosureScopeClass' => '?ReflectionClass', - 'getDocComment' => 'string|false', - 'getEndLine' => 'int|false', - 'getExtension' => '?ReflectionExtension', - 'getExtensionName' => 'string|false', - 'getFileName' => 'string|false', - 'getName' => 'string', - 'getNamespaceName' => 'string', - 'getNumberOfParameters' => 'int', - 'getNumberOfRequiredParameters' => 'int', - 'getParameters' => 'array', - 'getShortName' => 'string', - 'getStartLine' => 'int|false', - 'getStaticVariables' => 'array', - 'returnsReference' => 'bool', - 'hasReturnType' => 'bool', - 'getReturnType' => '?ReflectionType', - ], - 'ReflectionFunction' => [ - 'isDisabled' => 'bool', - 'invoke' => 'mixed', - 'invokeArgs' => 'mixed', - 'getClosure' => 'Closure', - 'getExecutingLine' => 'int', - 'getExecutingFile' => 'string', - 'getTrace' => 'array', - 'getFunction' => 'ReflectionFunctionAbstract', - 'getThis' => '?object', - 'getExecutingGenerator' => 'Generator', - ], - 'ReflectionMethod' => [ - 'isPublic' => 'bool', - 'isPrivate' => 'bool', - 'isProtected' => 'bool', - 'isAbstract' => 'bool', - 'isFinal' => 'bool', - 'isConstructor' => 'bool', - 'isDestructor' => 'bool', - 'getClosure' => 'Closure', - 'getModifiers' => 'int', - 'invoke' => 'mixed', - 'invokeArgs' => 'mixed', - 'getDeclaringClass' => 'ReflectionClass', - 'getPrototype' => 'ReflectionMethod', - 'setAccessible' => 'void', - ], - 'ReflectionClass' => [ - 'getName' => 'string', - 'isInternal' => 'bool', - 'isUserDefined' => 'bool', - 'isAnonymous' => 'bool', - 'isInstantiable' => 'bool', - 'isCloneable' => 'bool', - 'getFileName' => 'string|false', - 'getStartLine' => 'int|false', - 'getEndLine' => 'int|false', - 'getDocComment' => 'string|false', - 'getConstructor' => '?ReflectionMethod', - 'hasMethod' => 'bool', - 'getMethod' => 'ReflectionMethod', - 'getMethods' => 'array', - 'hasProperty' => 'bool', - 'getProperty' => 'ReflectionProperty', - 'getProperties' => 'array', - 'hasConstant' => 'bool', - 'getConstants' => 'array', - 'getReflectionConstants' => 'array', - 'getConstant' => 'mixed', - 'getReflectionConstant' => 'ReflectionClassConstant|false', - 'getInterfaces' => 'array', - 'getInterfaceNames' => 'array', - 'isInterface' => 'bool', - 'getTraits' => 'array', - 'getTraitNames' => 'array', - 'getTraitAliases' => 'array', - 'isTrait' => 'bool', - 'isAbstract' => 'bool', - 'isFinal' => 'bool', - 'getModifiers' => 'int', - 'isInstance' => 'bool', - 'newInstance' => 'object', - 'newInstanceWithoutConstructor' => 'object', - 'newInstanceArgs' => '?object', - 'getParentClass' => 'ReflectionClass|false', - 'isSubclassOf' => 'bool', - 'getStaticProperties' => '?array', - 'getStaticPropertyValue' => 'mixed', - 'setStaticPropertyValue' => 'void', - 'getDefaultProperties' => 'array', - 'isIterable' => 'bool', - 'isIterateable' => 'bool', - 'implementsInterface' => 'bool', - 'getExtension' => '?ReflectionExtension', - 'getExtensionName' => 'string|false', - 'inNamespace' => 'bool', - 'getNamespaceName' => 'string', - 'getShortName' => 'string', - ], - 'ReflectionProperty' => [ - 'getName' => 'string', - 'getValue' => 'mixed', - 'setValue' => 'void', - 'isInitialized' => 'bool', - 'isPublic' => 'bool', - 'isPrivate' => 'bool', - 'isProtected' => 'bool', - 'isStatic' => 'bool', - 'isDefault' => 'bool', - 'getModifiers' => 'int', - 'getDeclaringClass' => 'ReflectionClass', - 'getDocComment' => 'string|false', - 'setAccessible' => 'void', - 'getType' => '?ReflectionType', - 'hasType' => 'bool', - 'getDefaultValue' => 'mixed', - ], - 'ReflectionClassConstant' => [ - 'getName' => 'string', - 'getValue' => 'mixed', - 'isPublic' => 'bool', - 'isPrivate' => 'bool', - 'isProtected' => 'bool', - 'getModifiers' => 'int', - 'getDeclaringClass' => 'ReflectionClass', - 'getDocComment' => 'string|false', - ], - 'ReflectionParameter' => [ - 'getName' => 'string', - 'isPassedByReference' => 'bool', - 'canBePassedByValue' => 'bool', - 'getDeclaringFunction' => 'ReflectionFunctionAbstract', - 'getDeclaringClass' => '?ReflectionClass', - 'getClass' => '?ReflectionClass', - 'hasType' => 'bool', - 'getType' => '?ReflectionType', - 'isArray' => 'bool', - 'isCallable' => 'bool', - 'allowsNull' => 'bool', - 'getPosition' => 'int', - 'isOptional' => 'bool', - 'isDefaultValueAvailable' => 'bool', - 'getDefaultValue' => 'mixed', - 'isDefaultValueConstant' => 'bool', - 'getDefaultValueConstantName' => '?string', - 'isVariadic' => 'bool', - ], - 'ReflectionType' => [ - 'allowsNull' => 'bool', - ], - 'ReflectionNamedType' => [ - 'getName' => 'string', - 'isBuiltin' => 'bool', - ], - 'ReflectionExtension' => [ - 'getName' => 'string', - 'getVersion' => '?string', - 'getFunctions' => 'array', - 'getConstants' => 'array', - 'getINIEntries' => 'array', - 'getClasses' => 'array', - 'getClassNames' => 'array', - 'getDependencies' => 'array', - 'info' => 'void', - 'isPersistent' => 'bool', - 'isTemporary' => 'bool', - ], - 'ReflectionZendExtension' => [ - 'getName' => 'string', - 'getVersion' => 'string', - 'getAuthor' => 'string', - 'getURL' => 'string', - 'getCopyright' => 'string', - ], - 'SessionHandlerInterface' => [ - 'open' => 'bool', - 'close' => 'bool', - 'read' => 'string|false', - 'write' => 'bool', - 'destroy' => 'bool', - 'gc' => 'int|false', - ], - 'SessionIdInterface' => [ - 'create_sid' => 'string', - ], - 'SessionUpdateTimestampHandlerInterface' => [ - 'validateId' => 'bool', - 'updateTimestamp' => 'bool', - ], - 'SessionHandler' => [ - 'open' => 'bool', - 'close' => 'bool', - 'read' => 'string|false', - 'write' => 'bool', - 'destroy' => 'bool', - 'gc' => 'int|false', - 'create_sid' => 'string', - ], - 'SimpleXMLElement' => [ - 'xpath' => 'array|null|false', - 'registerXPathNamespace' => 'bool', - 'asXML' => 'string|bool', - 'saveXML' => 'string|bool', - 'getNamespaces' => 'array', - 'getDocNamespaces' => 'array|false', - 'children' => '?SimpleXMLElement', - 'attributes' => '?SimpleXMLElement', - 'addChild' => '?SimpleXMLElement', - 'addAttribute' => 'void', - 'getName' => 'string', - 'count' => 'int', - 'rewind' => 'void', - 'valid' => 'bool', - 'current' => 'SimpleXMLElement', - 'key' => 'string', - 'next' => 'void', - 'hasChildren' => 'bool', - 'getChildren' => '?SimpleXMLElement', - ], - 'SNMP' => [ - 'close' => 'bool', - 'setSecurity' => 'bool', - 'get' => 'mixed', - 'getnext' => 'mixed', - 'walk' => 'array|false', - 'set' => 'bool', - 'getErrno' => 'int', - 'getError' => 'string', - ], - 'SoapServer' => [ - 'fault' => 'void', - 'addSoapHeader' => 'void', - 'setPersistence' => 'void', - 'setClass' => 'void', - 'setObject' => 'void', - 'getFunctions' => 'array', - 'addFunction' => 'void', - 'handle' => 'void', - ], - 'SoapClient' => [ - '__call' => 'mixed', - '__soapCall' => 'mixed', - '__getFunctions' => '?array', - '__getTypes' => '?array', - '__getLastRequest' => '?string', - '__getLastResponse' => '?string', - '__getLastRequestHeaders' => '?string', - '__getLastResponseHeaders' => '?string', - '__doRequest' => '?string', - '__setCookie' => 'void', - '__getCookies' => 'array', - '__setSoapHeaders' => 'bool', - '__setLocation' => '?string', - ], - 'ArrayObject' => [ - 'offsetExists' => 'bool', - 'offsetGet' => 'mixed', - 'offsetSet' => 'void', - 'offsetUnset' => 'void', - 'append' => 'void', - 'getArrayCopy' => 'array', - 'count' => 'int', - 'getFlags' => 'int', - 'setFlags' => 'void', - 'asort' => 'bool', - 'ksort' => 'bool', - 'uasort' => 'bool', - 'uksort' => 'bool', - 'natsort' => 'bool', - 'natcasesort' => 'bool', - 'unserialize' => 'void', - 'serialize' => 'string', - '__serialize' => 'array', - '__unserialize' => 'void', - 'getIterator' => 'Iterator', - 'exchangeArray' => 'array', - 'setIteratorClass' => 'void', - 'getIteratorClass' => 'string', - '__debugInfo' => 'array', - ], - 'ArrayIterator' => [ - 'offsetExists' => 'bool', - 'offsetGet' => 'mixed', - 'offsetSet' => 'void', - 'offsetUnset' => 'void', - 'append' => 'void', - 'getArrayCopy' => 'array', - 'count' => 'int', - 'getFlags' => 'int', - 'setFlags' => 'void', - 'asort' => 'bool', - 'ksort' => 'bool', - 'uasort' => 'bool', - 'uksort' => 'bool', - 'natsort' => 'bool', - 'natcasesort' => 'bool', - 'unserialize' => 'void', - 'serialize' => 'string', - '__serialize' => 'array', - '__unserialize' => 'void', - 'rewind' => 'void', - 'current' => 'mixed', - 'key' => 'string|int|null', - 'next' => 'void', - 'valid' => 'bool', - 'seek' => 'void', - '__debugInfo' => 'array', - ], - 'RecursiveArrayIterator' => [ - 'hasChildren' => 'bool', - 'getChildren' => '?RecursiveArrayIterator', - ], - 'SplFileInfo' => [ - 'getPath' => 'string', - 'getFilename' => 'string', - 'getExtension' => 'string', - 'getBasename' => 'string', - 'getPathname' => 'string', - 'getPerms' => 'int|false', - 'getInode' => 'int|false', - 'getSize' => 'int|false', - 'getOwner' => 'int|false', - 'getGroup' => 'int|false', - 'getATime' => 'int|false', - 'getMTime' => 'int|false', - 'getCTime' => 'int|false', - 'getType' => 'string|false', - 'isWritable' => 'bool', - 'isReadable' => 'bool', - 'isExecutable' => 'bool', - 'isFile' => 'bool', - 'isDir' => 'bool', - 'isLink' => 'bool', - 'getLinkTarget' => 'string|false', - 'getRealPath' => 'string|false', - 'getFileInfo' => 'SplFileInfo', - 'getPathInfo' => '?SplFileInfo', - 'openFile' => 'SplFileObject', - 'setFileClass' => 'void', - 'setInfoClass' => 'void', - '__debugInfo' => 'array', - '_bad_state_ex' => 'void', - ], - 'DirectoryIterator' => [ - 'getFilename' => 'string', - 'getExtension' => 'string', - 'getBasename' => 'string', - 'isDot' => 'bool', - 'rewind' => 'void', - 'valid' => 'bool', - 'key' => 'mixed', - 'current' => 'mixed', - 'next' => 'void', - 'seek' => 'void', - ], - 'FilesystemIterator' => [ - 'rewind' => 'void', - 'key' => 'string', - 'current' => 'string|SplFileInfo|FilesystemIterator', - 'getFlags' => 'int', - 'setFlags' => 'void', - ], - 'RecursiveDirectoryIterator' => [ - 'hasChildren' => 'bool', - 'getChildren' => 'RecursiveDirectoryIterator', - 'getSubPath' => 'string', - 'getSubPathname' => 'string', - ], - 'GlobIterator' => [ - 'count' => 'int', - ], - 'SplFileObject' => [ - 'rewind' => 'void', - 'eof' => 'bool', - 'valid' => 'bool', - 'fgets' => 'string', - 'fread' => 'string|false', - 'fgetcsv' => 'array|false', - 'fputcsv' => 'int|false', - 'setCsvControl' => 'void', - 'getCsvControl' => 'array', - 'flock' => 'bool', - 'fflush' => 'bool', - 'ftell' => 'int|false', - 'fseek' => 'int', - 'fgetc' => 'string|false', - 'fpassthru' => 'int', - 'fscanf' => 'array|int|null', - 'fwrite' => 'int|false', - 'fstat' => 'array', - 'ftruncate' => 'bool', - 'current' => 'string|array|false', - 'key' => 'int', - 'next' => 'void', - 'setFlags' => 'void', - 'getFlags' => 'int', - 'setMaxLineLen' => 'void', - 'getMaxLineLen' => 'int', - 'hasChildren' => 'false', - 'getChildren' => 'null', - 'seek' => 'void', - 'getCurrentLine' => 'string', - ], - 'SplDoublyLinkedList' => [ - 'add' => 'void', - 'pop' => 'mixed', - 'shift' => 'mixed', - 'push' => 'void', - 'unshift' => 'void', - 'top' => 'mixed', - 'bottom' => 'mixed', - '__debugInfo' => 'array', - 'count' => 'int', - 'isEmpty' => 'bool', - 'setIteratorMode' => 'int', - 'getIteratorMode' => 'int', - 'offsetExists' => 'bool', - 'offsetGet' => 'mixed', - 'offsetSet' => 'void', - 'offsetUnset' => 'void', - 'rewind' => 'void', - 'current' => 'mixed', - 'key' => 'int', - 'prev' => 'void', - 'next' => 'void', - 'valid' => 'bool', - 'unserialize' => 'void', - 'serialize' => 'string', - '__serialize' => 'array', - '__unserialize' => 'void', - ], - 'SplQueue' => [ - 'enqueue' => 'void', - 'dequeue' => 'mixed', - ], - 'SplFixedArray' => [ - '__wakeup' => 'void', - 'count' => 'int', - 'toArray' => 'array', - 'fromArray' => 'SplFixedArray', - 'getSize' => 'int', - 'offsetExists' => 'bool', - 'offsetGet' => 'mixed', - 'offsetSet' => 'void', - 'offsetUnset' => 'void', - ], - 'SplPriorityQueue' => [ - 'compare' => 'int', - 'setExtractFlags' => 'int', - 'top' => 'mixed', - 'extract' => 'mixed', - 'count' => 'int', - 'isEmpty' => 'bool', - 'rewind' => 'void', - 'current' => 'mixed', - 'key' => 'int', - 'next' => 'void', - 'valid' => 'bool', - 'isCorrupted' => 'bool', - 'getExtractFlags' => 'int', - '__debugInfo' => 'array', - ], - 'SplHeap' => [ - 'extract' => 'mixed', - 'insert' => 'bool', - 'top' => 'mixed', - 'count' => 'int', - 'isEmpty' => 'bool', - 'rewind' => 'void', - 'current' => 'mixed', - 'key' => 'int', - 'next' => 'void', - 'valid' => 'bool', - 'recoverFromCorruption' => 'bool', - 'compare' => 'int', - 'isCorrupted' => 'bool', - '__debugInfo' => 'array', - ], - 'SplMinHeap' => [ - 'compare' => 'int', - ], - 'SplMaxHeap' => [ - 'compare' => 'int', - ], - 'EmptyIterator' => [ - 'current' => 'never', - 'next' => 'void', - 'key' => 'never', - 'valid' => 'false', - 'rewind' => 'void', - ], - 'CallbackFilterIterator' => [ - 'accept' => 'bool', - ], - 'RecursiveCallbackFilterIterator' => [ - 'hasChildren' => 'bool', - 'getChildren' => 'RecursiveCallbackFilterIterator', - ], - 'RecursiveIterator' => [ - 'hasChildren' => 'bool', - 'getChildren' => '?RecursiveIterator', - ], - 'RecursiveIteratorIterator' => [ - 'rewind' => 'void', - 'valid' => 'bool', - 'key' => 'mixed', - 'current' => 'mixed', - 'next' => 'void', - 'getDepth' => 'int', - 'getSubIterator' => '?RecursiveIterator', - 'getInnerIterator' => 'RecursiveIterator', - 'beginIteration' => 'void', - 'endIteration' => 'void', - 'callHasChildren' => 'bool', - 'callGetChildren' => '?RecursiveIterator', - 'beginChildren' => 'void', - 'endChildren' => 'void', - 'nextElement' => 'void', - 'setMaxDepth' => 'void', - 'getMaxDepth' => 'int|false', - ], - 'OuterIterator' => [ - 'getInnerIterator' => '?Iterator', - ], - 'IteratorIterator' => [ - 'getInnerIterator' => '?Iterator', - 'rewind' => 'void', - 'valid' => 'bool', - 'key' => 'mixed', - 'current' => 'mixed', - 'next' => 'void', - ], - 'FilterIterator' => [ - 'accept' => 'bool', - 'rewind' => 'void', - 'next' => 'void', - ], - 'RecursiveFilterIterator' => [ - 'hasChildren' => 'bool', - 'getChildren' => '?RecursiveFilterIterator', - ], - 'ParentIterator' => [ - 'accept' => 'bool', - ], - 'SeekableIterator' => [ - 'seek' => 'void', - ], - 'LimitIterator' => [ - 'rewind' => 'void', - 'valid' => 'bool', - 'next' => 'void', - 'seek' => 'int', - 'getPosition' => 'int', - ], - 'CachingIterator' => [ - 'rewind' => 'void', - 'valid' => 'bool', - 'next' => 'void', - 'hasNext' => 'bool', - 'getFlags' => 'int', - 'setFlags' => 'void', - 'offsetGet' => 'mixed', - 'offsetSet' => 'void', - 'offsetUnset' => 'void', - 'offsetExists' => 'bool', - 'getCache' => 'array', - 'count' => 'int', - ], - 'RecursiveCachingIterator' => [ - 'hasChildren' => 'bool', - 'getChildren' => '?RecursiveCachingIterator', - ], - 'NoRewindIterator' => [ - 'rewind' => 'void', - 'valid' => 'bool', - 'key' => 'mixed', - 'current' => 'mixed', - 'next' => 'void', - ], - 'AppendIterator' => [ - 'append' => 'void', - 'rewind' => 'void', - 'valid' => 'bool', - 'current' => 'mixed', - 'next' => 'void', - 'getIteratorIndex' => '?int', - 'getArrayIterator' => 'ArrayIterator', - ], - 'InfiniteIterator' => [ - 'next' => 'void', - ], - 'RegexIterator' => [ - 'accept' => 'bool', - 'getMode' => 'int', - 'setMode' => 'void', - 'getFlags' => 'int', - 'setFlags' => 'void', - 'getRegex' => 'string', - 'getPregFlags' => 'int', - 'setPregFlags' => 'void', - ], - 'RecursiveRegexIterator' => [ - 'accept' => 'bool', - 'hasChildren' => 'bool', - 'getChildren' => 'RecursiveRegexIterator', - ], - 'RecursiveTreeIterator' => [ - 'key' => 'mixed', - 'current' => 'mixed', - 'getPrefix' => 'string', - 'setPostfix' => 'void', - 'setPrefixPart' => 'void', - 'getEntry' => 'string', - 'getPostfix' => 'string', - ], - 'SplObserver' => [ - 'update' => 'void', - ], - 'SplSubject' => [ - 'attach' => 'void', - 'detach' => 'void', - 'notify' => 'void', - ], - 'SplObjectStorage' => [ - 'attach' => 'void', - 'detach' => 'void', - 'contains' => 'bool', - 'addAll' => 'int', - 'removeAll' => 'int', - 'removeAllExcept' => 'int', - 'getInfo' => 'mixed', - 'setInfo' => 'void', - 'count' => 'int', - 'rewind' => 'void', - 'valid' => 'bool', - 'key' => 'int', - 'current' => 'object', - 'next' => 'void', - 'unserialize' => 'void', - 'serialize' => 'string', - 'offsetExists' => 'bool', - 'offsetGet' => 'mixed', - 'offsetSet' => 'void', - 'offsetUnset' => 'void', - 'getHash' => 'string', - '__serialize' => 'array', - '__unserialize' => 'void', - '__debugInfo' => 'array', - ], - 'MultipleIterator' => [ - 'getFlags' => 'int', - 'setFlags' => 'void', - 'attachIterator' => 'void', - 'detachIterator' => 'void', - 'containsIterator' => 'bool', - 'countIterators' => 'int', - 'rewind' => 'void', - 'valid' => 'bool', - 'key' => 'array', - 'current' => 'array', - 'next' => 'void', - '__debugInfo' => 'array', - ], - 'SQLite3' => [ - 'open' => 'void', - 'version' => 'array', - 'lastInsertRowID' => 'int', - 'lastErrorCode' => 'int', - 'lastExtendedErrorCode' => 'int', - 'lastErrorMsg' => 'string', - 'changes' => 'int', - 'busyTimeout' => 'bool', - 'loadExtension' => 'bool', - 'backup' => 'bool', - 'escapeString' => 'string', - 'prepare' => 'SQLite3Stmt|false', - 'exec' => 'bool', - 'query' => 'SQLite3Result|false', - 'querySingle' => 'mixed', - 'createFunction' => 'bool', - 'createAggregate' => 'bool', - 'createCollation' => 'bool', - 'enableExceptions' => 'bool', - 'enableExtendedResultCodes' => 'bool', - 'setAuthorizer' => 'bool', - ], - 'SQLite3Stmt' => [ - 'bindParam' => 'bool', - 'bindValue' => 'bool', - 'clear' => 'bool', - 'close' => 'bool', - 'execute' => 'SQLite3Result|false', - 'getSQL' => 'string|false', - 'paramCount' => 'int', - 'readOnly' => 'bool', - 'reset' => 'bool', - ], - 'SQLite3Result' => [ - 'numColumns' => 'int', - 'columnName' => 'string|false', - 'columnType' => 'int|false', - 'fetchArray' => 'array|false', - 'reset' => 'bool', - ], - 'Directory' => [ - 'close' => 'void', - 'rewind' => 'void', - 'read' => 'string|false', - ], - 'php_user_filter' => [ - 'filter' => 'int', - 'onCreate' => 'bool', - 'onClose' => 'void', - ], - 'tidy' => [ - 'getOpt' => 'string|int|bool', - 'cleanRepair' => 'bool', - 'parseFile' => 'bool', - 'parseString' => 'bool', - 'repairString' => 'string|false', - 'repairFile' => 'string|false', - 'diagnose' => 'bool', - 'getRelease' => 'string', - 'getConfig' => 'array', - 'getStatus' => 'int', - 'getHtmlVer' => 'int', - 'getOptDoc' => 'string|false', - 'isXhtml' => 'bool', - 'isXml' => 'bool', - 'root' => '?tidyNode', - 'head' => '?tidyNode', - 'html' => '?tidyNode', - 'body' => '?tidyNode', - ], - 'XMLReader' => [ - 'getAttribute' => '?string', - 'getAttributeNo' => '?string', - 'getAttributeNs' => '?string', - 'getParserProperty' => 'bool', - 'isValid' => 'bool', - 'lookupNamespace' => '?string', - 'moveToAttribute' => 'bool', - 'moveToAttributeNo' => 'bool', - 'moveToAttributeNs' => 'bool', - 'moveToElement' => 'bool', - 'moveToFirstAttribute' => 'bool', - 'moveToNextAttribute' => 'bool', - 'read' => 'bool', - 'next' => 'bool', - 'readInnerXml' => 'string', - 'readOuterXml' => 'string', - 'readString' => 'string', - 'setSchema' => 'bool', - 'setParserProperty' => 'bool', - 'setRelaxNGSchema' => 'bool', - 'setRelaxNGSchemaSource' => 'bool', - 'expand' => 'DOMNode|false', - ], - 'XMLWriter' => [ - 'openUri' => 'bool', - 'openMemory' => 'bool', - 'setIndent' => 'bool', - 'setIndentString' => 'bool', - 'startComment' => 'bool', - 'endComment' => 'bool', - 'startAttribute' => 'bool', - 'endAttribute' => 'bool', - 'writeAttribute' => 'bool', - 'startAttributeNs' => 'bool', - 'writeAttributeNs' => 'bool', - 'startElement' => 'bool', - 'endElement' => 'bool', - 'fullEndElement' => 'bool', - 'startElementNs' => 'bool', - 'writeElement' => 'bool', - 'writeElementNs' => 'bool', - 'startPi' => 'bool', - 'endPi' => 'bool', - 'writePi' => 'bool', - 'startCdata' => 'bool', - 'endCdata' => 'bool', - 'writeCdata' => 'bool', - 'text' => 'bool', - 'writeRaw' => 'bool', - 'startDocument' => 'bool', - 'endDocument' => 'bool', - 'writeComment' => 'bool', - 'startDtd' => 'bool', - 'endDtd' => 'bool', - 'writeDtd' => 'bool', - 'startDtdElement' => 'bool', - 'endDtdElement' => 'bool', - 'writeDtdElement' => 'bool', - 'startDtdAttlist' => 'bool', - 'endDtdAttlist' => 'bool', - 'writeDtdAttlist' => 'bool', - 'startDtdEntity' => 'bool', - 'endDtdEntity' => 'bool', - 'writeDtdEntity' => 'bool', - 'outputMemory' => 'string', - 'flush' => 'string|int', - ], - 'XSLTProcessor' => [ - 'importStylesheet' => 'bool', - 'transformToDoc' => 'DOMDocument|false', - 'transformToUri' => 'int', - 'transformToXml' => 'string|null|false', - 'setParameter' => 'bool', - 'getParameter' => 'string|false', - 'removeParameter' => 'bool', - 'hasExsltSupport' => 'bool', - 'registerPHPFunctions' => 'void', - 'setSecurityPrefs' => 'int', - 'getSecurityPrefs' => 'int', - ], - 'ZipArchive' => [ - 'open' => 'bool|int', - 'setPassword' => 'bool', - 'close' => 'bool', - 'count' => 'int', - 'getStatusString' => 'string', - 'addEmptyDir' => 'bool', - 'addFromString' => 'bool', - 'addFile' => 'bool', - 'replaceFile' => 'bool', - 'addGlob' => 'array|false', - 'addPattern' => 'array|false', - 'renameIndex' => 'bool', - 'renameName' => 'bool', - 'setArchiveComment' => 'bool', - 'getArchiveComment' => 'string|false', - 'setCommentIndex' => 'bool', - 'setCommentName' => 'bool', - 'setMtimeIndex' => 'bool', - 'setMtimeName' => 'bool', - 'getCommentIndex' => 'string|false', - 'getCommentName' => 'string|false', - 'deleteIndex' => 'bool', - 'deleteName' => 'bool', - 'statName' => 'array|false', - 'statIndex' => 'array|false', - 'locateName' => 'int|false', - 'getNameIndex' => 'string|false', - 'unchangeArchive' => 'bool', - 'unchangeAll' => 'bool', - 'unchangeIndex' => 'bool', - 'unchangeName' => 'bool', - 'extractTo' => 'bool', - 'getFromName' => 'string|false', - 'getFromIndex' => 'string|false', - 'setExternalAttributesName' => 'bool', - 'setExternalAttributesIndex' => 'bool', - 'getExternalAttributesName' => 'bool', - 'getExternalAttributesIndex' => 'bool', - 'setCompressionName' => 'bool', - 'setCompressionIndex' => 'bool', - 'setEncryptionName' => 'bool', - 'setEncryptionIndex' => 'bool', - 'registerProgressCallback' => 'bool', - 'registerCancelCallback' => 'bool', - ], - 'Exception' => [ - '__wakeup' => 'void', - ], - 'Error' => [ - '__wakeup' => 'void', - ], - 'IteratorAggregate' => [ - 'getIterator' => 'Traversable', - ], - 'Iterator' => [ - 'current' => 'mixed', - 'next' => 'void', - 'key' => 'mixed', - 'valid' => 'bool', - 'rewind' => 'void', - ], - 'ArrayAccess' => [ - 'offsetExists' => 'bool', - 'offsetGet' => 'mixed', - 'offsetSet' => 'void', - 'offsetUnset' => 'void', - ], - 'Countable' => [ - 'count' => 'int', - ], - ]; -} diff --git a/vendor/symfony/error-handler/LICENSE b/vendor/symfony/error-handler/LICENSE deleted file mode 100644 index 9c907a46..00000000 --- a/vendor/symfony/error-handler/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2019-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/error-handler/README.md b/vendor/symfony/error-handler/README.md deleted file mode 100644 index 12c0bfa6..00000000 --- a/vendor/symfony/error-handler/README.md +++ /dev/null @@ -1,44 +0,0 @@ -ErrorHandler Component -====================== - -The ErrorHandler component provides tools to manage errors and ease debugging PHP code. - -Getting Started ---------------- - -``` -$ composer require symfony/error-handler -``` - -```php -use Symfony\Component\ErrorHandler\Debug; -use Symfony\Component\ErrorHandler\ErrorHandler; -use Symfony\Component\ErrorHandler\DebugClassLoader; - -Debug::enable(); - -// or enable only one feature -//ErrorHandler::register(); -//DebugClassLoader::enable(); - -// If you want a custom generic template when debug is not enabled -// HtmlErrorRenderer::setTemplate('/path/to/custom/error.html.php'); - -$data = ErrorHandler::call(static function () use ($filename, $datetimeFormat) { - // if any code executed inside this anonymous function fails, a PHP exception - // will be thrown, even if the code uses the '@' PHP silence operator - $data = json_decode(file_get_contents($filename), true); - $data['read_at'] = date($datetimeFormat); - file_put_contents($filename, json_encode($data)); - - return $data; -}); -``` - -Resources ---------- - - * [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/error-handler/Resources/assets/css/error.css b/vendor/symfony/error-handler/Resources/assets/css/error.css deleted file mode 100644 index 332d8187..00000000 --- a/vendor/symfony/error-handler/Resources/assets/css/error.css +++ /dev/null @@ -1,4 +0,0 @@ -body { background-color: #fff; color: #222; font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; margin: 0; } -.container { margin: 30px; max-width: 600px; } -h1 { color: #dc3545; font-size: 24px; } -h2 { font-size: 18px; } diff --git a/vendor/symfony/error-handler/Resources/assets/css/exception.css b/vendor/symfony/error-handler/Resources/assets/css/exception.css deleted file mode 100644 index 7cb3206d..00000000 --- a/vendor/symfony/error-handler/Resources/assets/css/exception.css +++ /dev/null @@ -1,252 +0,0 @@ -/* This file is based on WebProfilerBundle/Resources/views/Profiler/profiler.css.twig. - If you make any change in this file, verify the same change is needed in the other file. */ -:root { - --font-sans-serif: Helvetica, Arial, sans-serif; - --page-background: #f9f9f9; - --color-text: #222; - /* when updating any of these colors, do the same in toolbar.css.twig */ - --color-success: #4f805d; - --color-warning: #a46a1f; - --color-error: #b0413e; - --color-muted: #999; - --tab-background: #fff; - --tab-color: #444; - --tab-active-background: #666; - --tab-active-color: #fafafa; - --tab-disabled-background: #f5f5f5; - --tab-disabled-color: #999; - --metric-value-background: #fff; - --metric-value-color: inherit; - --metric-unit-color: #999; - --metric-label-background: #e0e0e0; - --metric-label-color: inherit; - --table-border: #e0e0e0; - --table-background: #fff; - --table-header: #e0e0e0; - --trace-selected-background: #F7E5A1; - --tree-active-background: #F7E5A1; - --exception-title-color: var(--base-2); - --shadow: 0px 0px 1px rgba(128, 128, 128, .2); - --border: 1px solid #e0e0e0; - --background-error: var(--color-error); - --highlight-comment: #969896; - --highlight-default: #222222; - --highlight-keyword: #a71d5d; - --highlight-string: #183691; - --base-0: #fff; - --base-1: #f5f5f5; - --base-2: #e0e0e0; - --base-3: #ccc; - --base-4: #666; - --base-5: #444; - --base-6: #222; -} - -.theme-dark { - --page-background: #36393e; - --color-text: #e0e0e0; - --color-muted: #777; - --color-error: #d43934; - --tab-background: #555; - --tab-color: #ccc; - --tab-active-background: #888; - --tab-active-color: #fafafa; - --tab-disabled-background: var(--page-background); - --tab-disabled-color: #777; - --metric-value-background: #555; - --metric-value-color: inherit; - --metric-unit-color: #999; - --metric-label-background: #777; - --metric-label-color: #e0e0e0; - --trace-selected-background: #71663acc; - --table-border: #444; - --table-background: #333; - --table-header: #555; - --info-background: rgba(79, 148, 195, 0.5); - --tree-active-background: var(--metric-label-background); - --exception-title-color: var(--base-2); - --shadow: 0px 0px 1px rgba(32, 32, 32, .2); - --border: 1px solid #666; - --background-error: #b0413e; - --highlight-comment: #dedede; - --highlight-default: var(--base-6); - --highlight-keyword: #ff413c; - --highlight-string: #70a6fd; - --base-0: #2e3136; - --base-1: #444; - --base-2: #666; - --base-3: #666; - --base-4: #666; - --base-5: #e0e0e0; - --base-6: #f5f5f5; - --card-label-background: var(--tab-active-background); - --card-label-color: var(--tab-active-color); -} - -html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}td,th{padding:0} - -html { - /* always display the vertical scrollbar to avoid jumps when toggling contents */ - overflow-y: scroll; -} -body { background-color: var(--page-background); color: var(--base-6); font: 14px/1.4 Helvetica, Arial, sans-serif; padding-bottom: 45px; } - -a { cursor: pointer; text-decoration: none; } -a:hover { text-decoration: underline; } -abbr[title] { border-bottom: none; cursor: help; text-decoration: none; } - -code, pre { font: 13px/1.5 Consolas, Monaco, Menlo, "Ubuntu Mono", "Liberation Mono", monospace; } - -table, tr, th, td { background: var(--base-0); border-collapse: collapse; vertical-align: top; } -table { background: var(--base-0); border: var(--border); box-shadow: 0px 0px 1px rgba(128, 128, 128, .2); margin: 1em 0; width: 100%; } -table th, table td { border: solid var(--base-2); border-width: 1px 0; padding: 8px 10px; } -table th { background-color: var(--base-2); font-weight: bold; text-align: left; } - -.m-t-5 { margin-top: 5px; } -.hidden-xs-down { display: none; } -.block { display: block; } -.full-width { width: 100%; } -.hidden { display: none; } -.prewrap { white-space: pre-wrap; } -.nowrap { white-space: nowrap; } -.newline { display: block; } -.break-long-words { word-wrap: break-word; overflow-wrap: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; min-width: 0; } -.text-small { font-size: 12px !important; } -.text-muted { color: #999; } -.text-bold { font-weight: bold; } -.empty { border: 4px dashed var(--base-2); color: #999; margin: 1em 0; padding: .5em 2em; } - -.status-success { background: rgba(94, 151, 110, 0.3); } -.status-warning { background: rgba(240, 181, 24, 0.3); } -.status-error { background: rgba(176, 65, 62, 0.2); } -.status-success td, .status-warning td, .status-error td { background: transparent; } -tr.status-error td, tr.status-warning td { border-bottom: 1px solid var(--base-2); border-top: 1px solid var(--base-2); } -.status-warning .colored { color: #A46A1F; } -.status-error .colored { color: var(--color-error); } - -.sf-toggle { cursor: pointer; position: relative; } -.sf-toggle-content { -moz-transition: display .25s ease; -webkit-transition: display .25s ease; transition: display .25s ease; } -.sf-toggle-content.sf-toggle-hidden { display: none; } -.sf-toggle-content.sf-toggle-visible { display: block; } -thead.sf-toggle-content.sf-toggle-visible, tbody.sf-toggle-content.sf-toggle-visible { display: table-row-group; } -.sf-toggle-off .icon-close, .sf-toggle-on .icon-open { display: none; } -.sf-toggle-off .icon-open, .sf-toggle-on .icon-close { display: block; } - -.tab-navigation { margin: 0 0 1em 0; padding: 0; } -.tab-navigation li { background: var(--tab-background); border: 1px solid var(--table-border); color: var(--tab-color); cursor: pointer; display: inline-block; font-size: 16px; margin: 0 0 0 -1px; padding: .5em .75em; z-index: 1; } -.tab-navigation li .badge { background-color: var(--base-1); color: var(--base-4); display: inline-block; font-size: 14px; font-weight: bold; margin-left: 8px; min-width: 10px; padding: 1px 6px; text-align: center; white-space: nowrap; } -.tab-navigation li.disabled { background: var(--tab-disabled-background); color: var(--tab-disabled-color); } -.tab-navigation li.active { background: var(--tab-active-background); color: var(--tab-active-color); z-index: 1100; } -.tab-navigation li.active .badge { background-color: var(--base-5); color: var(--base-2); } -.tab-content > *:first-child { margin-top: 0; } -.tab-navigation li .badge.status-warning { background: var(--color-warning); color: #FFF; } -.tab-navigation li .badge.status-error { background: var(--background-error); color: #FFF; } -.sf-tabs .tab:not(:first-child) { display: none; } - -[data-filters] { position: relative; } -[data-filtered] { cursor: pointer; } -[data-filtered]:after { content: '\00a0\25BE'; } -[data-filtered]:hover .filter-list li { display: inline-flex; } -[class*="filter-hidden-"] { display: none; } -.filter-list { position: absolute; border: var(--border); box-shadow: var(--shadow); margin: 0; padding: 0; display: flex; flex-direction: column; } -.filter-list :after { content: ''; } -.filter-list li { - background: var(--tab-disabled-background); - border-bottom: var(--border); - color: var(--tab-disabled-color); - display: none; - list-style: none; - margin: 0; - padding: 5px 10px; - text-align: left; - font-weight: normal; -} -.filter-list li.active { - background: var(--tab-background); - color: var(--tab-color); -} -.filter-list li.last-active { - background: var(--tab-active-background); - color: var(--tab-active-color); -} - -.filter-list-level li { cursor: s-resize; } -.filter-list-level li.active { cursor: n-resize; } -.filter-list-level li.last-active { cursor: default; } -.filter-list-level li.last-active:before { content: '\2714\00a0'; } -.filter-list-choice li:before { content: '\2714\00a0'; color: transparent; } -.filter-list-choice li.active:before { color: unset; } - -.container { max-width: 1024px; margin: 0 auto; padding: 0 15px; } -.container::after { content: ""; display: table; clear: both; } - -header { background-color: #222; color: rgba(255, 255, 255, 0.75); font-size: 13px; height: 33px; line-height: 33px; padding: 0; } -header .container { display: flex; justify-content: space-between; } -.logo { flex: 1; font-size: 13px; font-weight: normal; margin: 0; padding: 0; } -.logo svg { height: 18px; width: 18px; opacity: .8; vertical-align: -5px; } - -.help-link { margin-left: 15px; } -.help-link a { color: inherit; } -.help-link .icon svg { height: 15px; width: 15px; opacity: .7; vertical-align: -2px; } -.help-link a:hover { color: #EEE; text-decoration: none; } -.help-link a:hover svg { opacity: .9; } - -.exception-summary { background: var(--background-error); border-bottom: 2px solid rgba(0, 0, 0, 0.1); border-top: 1px solid rgba(0, 0, 0, .3); flex: 0 0 auto; margin-bottom: 15px; } -.exception-metadata { background: rgba(0, 0, 0, 0.1); padding: 7px 0; } -.exception-metadata .container { display: flex; flex-direction: row; justify-content: space-between; } -.exception-metadata h2, .exception-metadata h2 > a { color: rgba(255, 255, 255, 0.8); font-size: 13px; font-weight: 400; margin: 0; } -.exception-http small { font-size: 13px; opacity: .7; } -.exception-hierarchy { flex: 1; } -.exception-hierarchy .icon { margin: 0 3px; opacity: .7; } -.exception-hierarchy .icon svg { height: 13px; width: 13px; vertical-align: -2px; } - -.exception-without-message .exception-message-wrapper { display: none; } -.exception-message-wrapper .container { display: flex; align-items: flex-start; min-height: 70px; padding: 10px 15px 8px; } -.exception-message { flex-grow: 1; } -.exception-message, .exception-message a { color: #FFF; font-size: 21px; font-weight: 400; margin: 0; } -.exception-message.long { font-size: 18px; } -.exception-message a { border-bottom: 1px solid rgba(255, 255, 255, 0.5); font-size: inherit; text-decoration: none; } -.exception-message a:hover { border-bottom-color: #ffffff; } - -.exception-illustration { flex-basis: 111px; flex-shrink: 0; height: 66px; margin-left: 15px; opacity: .7; } - -.trace + .trace { margin-top: 30px; } -.trace-head { background-color: var(--base-2); padding: 10px; position: relative; } -.trace-head .trace-class { color: var(--base-6); font-size: 18px; font-weight: bold; line-height: 1.3; margin: 0; position: relative; } -.trace-head .trace-namespace { color: #999; display: block; font-size: 13px; } -.trace-head .icon { position: absolute; right: 0; top: 0; } -.trace-head .icon svg { fill: var(--base-5); height: 24px; width: 24px; } - -.trace-details { background: var(--base-0); border: var(--border); box-shadow: 0px 0px 1px rgba(128, 128, 128, .2); margin: 1em 0; table-layout: fixed; } - -.trace-message { font-size: 14px; font-weight: normal; margin: .5em 0 0; } - -.trace-line { position: relative; padding-top: 8px; padding-bottom: 8px; } -.trace-line + .trace-line { border-top: var(--border); } -.trace-line:hover { background: var(--base-1); } -.trace-line a { color: var(--base-6); } -.trace-line .icon { opacity: .4; position: absolute; left: 10px; } -.trace-line .icon svg { fill: var(--base-5); height: 16px; width: 16px; } -.trace-line .icon.icon-copy { left: auto; top: auto; padding-left: 5px; display: none } -.trace-line:hover .icon.icon-copy:not(.hidden) { display: inline-block } -.trace-line-header { padding-left: 36px; padding-right: 10px; } - -.trace-file-path, .trace-file-path a { color: var(--base-6); font-size: 13px; } -.trace-class { color: var(--color-error); } -.trace-type { padding: 0 2px; } -.trace-method { color: var(--color-error); font-weight: bold; } -.trace-arguments { color: #777; font-weight: normal; padding-left: 2px; } - -.trace-code { background: var(--base-0); font-size: 12px; margin: 10px 10px 2px 10px; padding: 10px; overflow-x: auto; white-space: nowrap; } -.trace-code ol { margin: 0; float: left; } -.trace-code li { color: #969896; margin: 0; padding-left: 10px; float: left; width: 100%; } -.trace-code li + li { margin-top: 5px; } -.trace-code li.selected { background: var(--trace-selected-background); margin-top: 2px; } -.trace-code li code { color: var(--base-6); white-space: nowrap; } - -.trace-as-text .stacktrace { line-height: 1.8; margin: 0 0 15px; white-space: pre-wrap; } - -@media (min-width: 575px) { - .hidden-xs-down { display: initial; } - .help-link { margin-left: 30px; } -} diff --git a/vendor/symfony/error-handler/Resources/assets/css/exception_full.css b/vendor/symfony/error-handler/Resources/assets/css/exception_full.css deleted file mode 100644 index fa77cb32..00000000 --- a/vendor/symfony/error-handler/Resources/assets/css/exception_full.css +++ /dev/null @@ -1,128 +0,0 @@ -.sf-reset .traces { - padding-bottom: 14px; -} -.sf-reset .traces li { - font-size: 12px; - color: #868686; - padding: 5px 4px; - list-style-type: decimal; - margin-left: 20px; -} -.sf-reset #logs .traces li.error { - font-style: normal; - color: #AA3333; - background: #f9ecec; -} -.sf-reset #logs .traces li.warning { - font-style: normal; - background: #ffcc00; -} -/* fix for Opera not liking empty
    • */ -.sf-reset .traces li:after { - content: "\00A0"; -} -.sf-reset .trace { - border: 1px solid #D3D3D3; - padding: 10px; - overflow: auto; - margin: 10px 0 20px; -} -.sf-reset .block-exception { - -moz-border-radius: 16px; - -webkit-border-radius: 16px; - border-radius: 16px; - margin-bottom: 20px; - background-color: #f6f6f6; - border: 1px solid #dfdfdf; - padding: 30px 28px; - word-wrap: break-word; - overflow: hidden; -} -.sf-reset .block-exception div { - color: #313131; - font-size: 10px; -} -.sf-reset .block-exception-detected .illustration-exception, -.sf-reset .block-exception-detected .text-exception { - float: left; -} -.sf-reset .block-exception-detected .illustration-exception { - width: 152px; -} -.sf-reset .block-exception-detected .text-exception { - width: 670px; - padding: 30px 44px 24px 46px; - position: relative; -} -.sf-reset .text-exception .open-quote, -.sf-reset .text-exception .close-quote { - font-family: Arial, Helvetica, sans-serif; - position: absolute; - color: #C9C9C9; - font-size: 8em; -} -.sf-reset .open-quote { - top: 0; - left: 0; -} -.sf-reset .close-quote { - bottom: -0.5em; - right: 50px; -} -.sf-reset .block-exception p { - font-family: Arial, Helvetica, sans-serif; -} -.sf-reset .block-exception p a, -.sf-reset .block-exception p a:hover { - color: #565656; -} -.sf-reset .logs h2 { - float: left; - width: 654px; -} -.sf-reset .error-count, .sf-reset .support { - float: right; - width: 170px; - text-align: right; -} -.sf-reset .error-count span { - display: inline-block; - background-color: #aacd4e; - -moz-border-radius: 6px; - -webkit-border-radius: 6px; - border-radius: 6px; - padding: 4px; - color: white; - margin-right: 2px; - font-size: 11px; - font-weight: bold; -} - -.sf-reset .support a { - display: inline-block; - -moz-border-radius: 6px; - -webkit-border-radius: 6px; - border-radius: 6px; - padding: 4px; - color: #000000; - margin-right: 2px; - font-size: 11px; - font-weight: bold; -} - -.sf-reset .toggle { - vertical-align: middle; -} -.sf-reset .linked ul, -.sf-reset .linked li { - display: inline; -} -.sf-reset #output-content { - color: #000; - font-size: 12px; -} -.sf-reset #traces-text pre { - white-space: pre; - font-size: 12px; - font-family: monospace; -} diff --git a/vendor/symfony/error-handler/Resources/assets/images/chevron-right.svg b/vendor/symfony/error-handler/Resources/assets/images/chevron-right.svg deleted file mode 100644 index 6837aff1..00000000 --- a/vendor/symfony/error-handler/Resources/assets/images/chevron-right.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/vendor/symfony/error-handler/Resources/assets/images/favicon.png.base64 b/vendor/symfony/error-handler/Resources/assets/images/favicon.png.base64 deleted file mode 100644 index fb076ed1..00000000 --- a/vendor/symfony/error-handler/Resources/assets/images/favicon.png.base64 +++ /dev/null @@ -1 +0,0 @@ -data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAgCAYAAAABtRhCAAADVUlEQVRIx82XX0jTURTHLYPyqZdefQx66CEo80+aYpoIkqzUikz6Z5klQoWUWYRIJYEUGpQ+lIr9U5dOTLdCtkmWZis3rbnC5fw/neYW002307mX/cZvP3/7o1PwwOdh95x7vnf39zvnd29AgBer2xO6DclAXiMqZAqxIiNIN/IYSUS2BPhjmGATchUxI+ADWiRhpWK7HKuHFVBFdmU5YvnI4grFGCaReF/EBH4KsZlGgj2JBTuCYBWRIYF8YoEOJ6wBt/gEs7mBbyOjQXruPLSdOgPCiEiPSUUHDoL8Ug5IUo9B/d5wrt+G7OAKNrODPuVdB6vRCIzN6SdBlpW9RIgk/1FeAXabzRlrUPVCS/JhbmwudztnGeeH9AyXBIwtmM3wLinZJZHifjHw2V+NBoRh+9ixQrbgbnaSIcl7cGea6hoXQbNe7za241oeO5Z0p42M4BV2EqP2D50wo+6HzvwC6C4sApNOR8cmOrtcnhtj2kYRyC9eBvXzKrBZrXSs72kFd1t3MoKVbMekQkEnSNKOO8fac3LpmK6l1TlGtsxmsdKFsecPYgwxst0cwROMYDXboSotg0WLBRqjY51jLYcENElXwW2XJKPydvoI2GN9T8rBtrAArYIUruBJXkFheCQYlCpQP6uk5dAQFQNaUROMSGVQFxLmkoQsxDJrhLbTZ+nvVsERME9MgPJRKV/58AsyomTSzE813WLFvWK++qI0xSfQl8k8Pg46sYRuv5t6dS+4RqxDwaa4BGjYH+NTQvKScIp9+YL/hoZh3jDtLRHtt2C3g6bmhX+CpsFBWg7ilDSPgj0lD2ncr5ev/BP8VvyAJhqVyZeUhPOrEhEFxgEtjft846Z/guQTNT89Q5P9flMLoth4F7808wKtWWKzAwNQHxrh/1vaid2F+XpYTSbQf1XA2McOmOpROnvpvMEA4tSjq1cW0sws2gCYxswY6TKkvzYnJq1NHZLnRU4BX+4U0uburvusu8Kv8iHY7qefkM4IFngJHEOUXmLEPgiGsI8YnlZILit3vSSLRTQe/MPIZva5pshNIEmyFQlCvruJKXPkCEfmePzkphXHdzZNQdoRI9KPlBAxlj/I8U97ERPS5bjGbWDFbEdqHVe5caTBeZZx2H/IMvzeN15yoQAAAABJRU5ErkJggg== diff --git a/vendor/symfony/error-handler/Resources/assets/images/icon-book.svg b/vendor/symfony/error-handler/Resources/assets/images/icon-book.svg deleted file mode 100644 index 498a74f4..00000000 --- a/vendor/symfony/error-handler/Resources/assets/images/icon-book.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/vendor/symfony/error-handler/Resources/assets/images/icon-copy.svg b/vendor/symfony/error-handler/Resources/assets/images/icon-copy.svg deleted file mode 100644 index 844a4f99..00000000 --- a/vendor/symfony/error-handler/Resources/assets/images/icon-copy.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/vendor/symfony/error-handler/Resources/assets/images/icon-minus-square-o.svg b/vendor/symfony/error-handler/Resources/assets/images/icon-minus-square-o.svg deleted file mode 100644 index be534ad4..00000000 --- a/vendor/symfony/error-handler/Resources/assets/images/icon-minus-square-o.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/vendor/symfony/error-handler/Resources/assets/images/icon-minus-square.svg b/vendor/symfony/error-handler/Resources/assets/images/icon-minus-square.svg deleted file mode 100644 index 471c2741..00000000 --- a/vendor/symfony/error-handler/Resources/assets/images/icon-minus-square.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/vendor/symfony/error-handler/Resources/assets/images/icon-plus-square-o.svg b/vendor/symfony/error-handler/Resources/assets/images/icon-plus-square-o.svg deleted file mode 100644 index b2593a9f..00000000 --- a/vendor/symfony/error-handler/Resources/assets/images/icon-plus-square-o.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/vendor/symfony/error-handler/Resources/assets/images/icon-plus-square.svg b/vendor/symfony/error-handler/Resources/assets/images/icon-plus-square.svg deleted file mode 100644 index 2f5c3b35..00000000 --- a/vendor/symfony/error-handler/Resources/assets/images/icon-plus-square.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/vendor/symfony/error-handler/Resources/assets/images/icon-support.svg b/vendor/symfony/error-handler/Resources/assets/images/icon-support.svg deleted file mode 100644 index 03fd8e76..00000000 --- a/vendor/symfony/error-handler/Resources/assets/images/icon-support.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/vendor/symfony/error-handler/Resources/assets/images/symfony-ghost.svg.php b/vendor/symfony/error-handler/Resources/assets/images/symfony-ghost.svg.php deleted file mode 100644 index 4b2f9c1b..00000000 --- a/vendor/symfony/error-handler/Resources/assets/images/symfony-ghost.svg.php +++ /dev/null @@ -1 +0,0 @@ -addElementToGhost(); ?> diff --git a/vendor/symfony/error-handler/Resources/assets/images/symfony-logo.svg b/vendor/symfony/error-handler/Resources/assets/images/symfony-logo.svg deleted file mode 100644 index f10824ae..00000000 --- a/vendor/symfony/error-handler/Resources/assets/images/symfony-logo.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/vendor/symfony/error-handler/Resources/assets/js/exception.js b/vendor/symfony/error-handler/Resources/assets/js/exception.js deleted file mode 100644 index a85409da..00000000 --- a/vendor/symfony/error-handler/Resources/assets/js/exception.js +++ /dev/null @@ -1,297 +0,0 @@ -/* This file is based on WebProfilerBundle/Resources/views/Profiler/base_js.html.twig. - If you make any change in this file, verify the same change is needed in the other file. */ -/* .tab'); - var tabNavigation = document.createElement('ul'); - tabNavigation.className = 'tab-navigation'; - - var selectedTabId = 'tab-' + i + '-0'; /* select the first tab by default */ - for (var j = 0; j < tabs.length; j++) { - var tabId = 'tab-' + i + '-' + j; - var tabTitle = tabs[j].querySelector('.tab-title').innerHTML; - - var tabNavigationItem = document.createElement('li'); - tabNavigationItem.setAttribute('data-tab-id', tabId); - if (hasClass(tabs[j], 'active')) { selectedTabId = tabId; } - if (hasClass(tabs[j], 'disabled')) { addClass(tabNavigationItem, 'disabled'); } - tabNavigationItem.innerHTML = tabTitle; - tabNavigation.appendChild(tabNavigationItem); - - var tabContent = tabs[j].querySelector('.tab-content'); - tabContent.parentElement.setAttribute('id', tabId); - } - - tabGroups[i].insertBefore(tabNavigation, tabGroups[i].firstChild); - addClass(document.querySelector('[data-tab-id="' + selectedTabId + '"]'), 'active'); - } - - /* display the active tab and add the 'click' event listeners */ - for (i = 0; i < tabGroups.length; i++) { - tabNavigation = tabGroups[i].querySelectorAll(':scope >.tab-navigation li'); - - for (j = 0; j < tabNavigation.length; j++) { - tabId = tabNavigation[j].getAttribute('data-tab-id'); - document.getElementById(tabId).querySelector('.tab-title').className = 'hidden'; - - if (hasClass(tabNavigation[j], 'active')) { - document.getElementById(tabId).className = 'block'; - } else { - document.getElementById(tabId).className = 'hidden'; - } - - tabNavigation[j].addEventListener('click', function(e) { - var activeTab = e.target || e.srcElement; - - /* needed because when the tab contains HTML contents, user can click */ - /* on any of those elements instead of their parent '
    • ' element */ - while (activeTab.tagName.toLowerCase() !== 'li') { - activeTab = activeTab.parentNode; - } - - /* get the full list of tabs through the parent of the active tab element */ - var tabNavigation = activeTab.parentNode.children; - for (var k = 0; k < tabNavigation.length; k++) { - var tabId = tabNavigation[k].getAttribute('data-tab-id'); - document.getElementById(tabId).className = 'hidden'; - removeClass(tabNavigation[k], 'active'); - } - - addClass(activeTab, 'active'); - var activeTabId = activeTab.getAttribute('data-tab-id'); - document.getElementById(activeTabId).className = 'block'; - }); - } - - tabGroups[i].setAttribute('data-processed', 'true'); - } - }, - - createToggles: function() { - var toggles = document.querySelectorAll('.sf-toggle:not([data-processed=true])'); - - for (var i = 0; i < toggles.length; i++) { - var elementSelector = toggles[i].getAttribute('data-toggle-selector'); - var element = document.querySelector(elementSelector); - - addClass(element, 'sf-toggle-content'); - - if (toggles[i].hasAttribute('data-toggle-initial') && toggles[i].getAttribute('data-toggle-initial') == 'display') { - addClass(toggles[i], 'sf-toggle-on'); - addClass(element, 'sf-toggle-visible'); - } else { - addClass(toggles[i], 'sf-toggle-off'); - addClass(element, 'sf-toggle-hidden'); - } - - addEventListener(toggles[i], 'click', function(e) { - e.preventDefault(); - - if ('' !== window.getSelection().toString()) { - /* Don't do anything on text selection */ - return; - } - - var toggle = e.target || e.srcElement; - - /* needed because when the toggle contains HTML contents, user can click */ - /* on any of those elements instead of their parent '.sf-toggle' element */ - while (!hasClass(toggle, 'sf-toggle')) { - toggle = toggle.parentNode; - } - - var element = document.querySelector(toggle.getAttribute('data-toggle-selector')); - - toggleClass(toggle, 'sf-toggle-on'); - toggleClass(toggle, 'sf-toggle-off'); - toggleClass(element, 'sf-toggle-hidden'); - toggleClass(element, 'sf-toggle-visible'); - - /* the toggle doesn't change its contents when clicking on it */ - if (!toggle.hasAttribute('data-toggle-alt-content')) { - return; - } - - if (!toggle.hasAttribute('data-toggle-original-content')) { - toggle.setAttribute('data-toggle-original-content', toggle.innerHTML); - } - - var currentContent = toggle.innerHTML; - var originalContent = toggle.getAttribute('data-toggle-original-content'); - var altContent = toggle.getAttribute('data-toggle-alt-content'); - toggle.innerHTML = currentContent !== altContent ? altContent : originalContent; - }); - - /* Prevents from disallowing clicks on links inside toggles */ - var toggleLinks = toggles[i].querySelectorAll('a'); - for (var j = 0; j < toggleLinks.length; j++) { - addEventListener(toggleLinks[j], 'click', function(e) { - e.stopPropagation(); - }); - } - - /* Prevents from disallowing clicks on "copy to clipboard" elements inside toggles */ - var copyToClipboardElements = toggles[i].querySelectorAll('span[data-clipboard-text]'); - for (var k = 0; k < copyToClipboardElements.length; k++) { - addEventListener(copyToClipboardElements[k], 'click', function(e) { - e.stopPropagation(); - }); - } - - toggles[i].setAttribute('data-processed', 'true'); - } - }, - - createFilters: function() { - document.querySelectorAll('[data-filters] [data-filter]').forEach(function (filter) { - var filters = filter.closest('[data-filters]'), - type = 'choice', - name = filter.dataset.filter, - ucName = name.charAt(0).toUpperCase()+name.slice(1), - list = document.createElement('ul'), - values = filters.dataset['filter'+ucName] || filters.querySelectorAll('[data-filter-'+name+']'), - labels = {}, - defaults = null, - indexed = {}, - processed = {}; - if (typeof values === 'string') { - type = 'level'; - labels = values.split(','); - values = values.toLowerCase().split(','); - defaults = values.length - 1; - } - addClass(list, 'filter-list'); - addClass(list, 'filter-list-'+type); - values.forEach(function (value, i) { - if (value instanceof HTMLElement) { - value = value.dataset['filter'+ucName]; - } - if (value in processed) { - return; - } - var option = document.createElement('li'), - label = i in labels ? labels[i] : value, - active = false, - matches; - if ('' === label) { - option.innerHTML = '(none)'; - } else { - option.innerText = label; - } - option.dataset.filter = value; - option.setAttribute('title', 1 === (matches = filters.querySelectorAll('[data-filter-'+name+'="'+value+'"]').length) ? 'Matches 1 row' : 'Matches '+matches+' rows'); - indexed[value] = i; - list.appendChild(option); - addEventListener(option, 'click', function () { - if ('choice' === type) { - filters.querySelectorAll('[data-filter-'+name+']').forEach(function (row) { - if (option.dataset.filter === row.dataset['filter'+ucName]) { - toggleClass(row, 'filter-hidden-'+name); - } - }); - toggleClass(option, 'active'); - } else if ('level' === type) { - if (i === this.parentNode.querySelectorAll('.active').length - 1) { - return; - } - this.parentNode.querySelectorAll('li').forEach(function (currentOption, j) { - if (j <= i) { - addClass(currentOption, 'active'); - if (i === j) { - addClass(currentOption, 'last-active'); - } else { - removeClass(currentOption, 'last-active'); - } - } else { - removeClass(currentOption, 'active'); - removeClass(currentOption, 'last-active'); - } - }); - filters.querySelectorAll('[data-filter-'+name+']').forEach(function (row) { - if (i < indexed[row.dataset['filter'+ucName]]) { - addClass(row, 'filter-hidden-'+name); - } else { - removeClass(row, 'filter-hidden-'+name); - } - }); - } - }); - if ('choice' === type) { - active = null === defaults || 0 <= defaults.indexOf(value); - } else if ('level' === type) { - active = i <= defaults; - if (active && i === defaults) { - addClass(option, 'last-active'); - } - } - if (active) { - addClass(option, 'active'); - } else { - filters.querySelectorAll('[data-filter-'+name+'="'+value+'"]').forEach(function (row) { - toggleClass(row, 'filter-hidden-'+name); - }); - } - processed[value] = true; - }); - - if (1 < list.childNodes.length) { - filter.appendChild(list); - filter.dataset.filtered = ''; - } - }); - } - }; - })(); - - Sfjs.addEventListener(document, 'DOMContentLoaded', function() { - Sfjs.createTabs(); - Sfjs.createToggles(); - Sfjs.createFilters(); - }); -} -/*]]>*/ diff --git a/vendor/symfony/error-handler/Resources/bin/extract-tentative-return-types.php b/vendor/symfony/error-handler/Resources/bin/extract-tentative-return-types.php deleted file mode 100755 index ae2c703e..00000000 --- a/vendor/symfony/error-handler/Resources/bin/extract-tentative-return-types.php +++ /dev/null @@ -1,84 +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.'); -} - -// Run from the root of the php-src repository, this script generates -// a table with all the methods that have a tentative return type. -// -// Usage: find -name *.stub.php | sort | /path/to/extract-tentative-return-types.php > /path/to/TentativeTypes.php - -echo << - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\ErrorHandler\Internal; - -/** - * This class has been generated by extract-tentative-return-types.php. - * - * @internal - */ -class TentativeTypes -{ - public const RETURN_TYPES = [ - -EOPHP; - -while (false !== $file = fgets(\STDIN)) { - $code = file_get_contents(substr($file, 0, -1)); - - if (!str_contains($code, '@tentative-return-type')) { - continue; - } - - $code = preg_split('{^\s*(?:(?:abstract )?class|interface|trait) ([^\s]++)}m', $code, -1, \PREG_SPLIT_DELIM_CAPTURE); - - if (1 === count($code)) { - continue; - } - - for ($i = 1; null !== $class = $code[$i] ?? null; $i += 2) { - $methods = $code[1 + $i]; - - if (!str_contains($methods, '@tentative-return-type')) { - continue; - } - - echo " '$class' => [\n"; - - preg_replace_callback('{@tentative-return-type.*?[\s]function ([^(]++)[^)]++\)\s*+:\s*+([^\n;\{]++)}s', function ($m) { - $m[2] = str_replace(' ', '', $m[2]); - echo " '$m[1]' => '$m[2]',\n"; - - return ''; - }, $methods); - - echo " ],\n"; - } -} - -echo << - * - * 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.'); -} - -if (\in_array('-h', $argv) || \in_array('--help', $argv)) { - echo implode(PHP_EOL, [ - ' Patches type declarations based on "@return" PHPDoc and triggers deprecations for', - ' incompatible method declarations.', - '', - ' This assists you to make your package compatible with Symfony 6, but it can be used', - ' for any class/package.', - '', - ' Available configuration via environment variables:', - ' SYMFONY_PATCH_TYPE_DECLARATIONS', - ' A url-encoded string to change the behavior of the script. Available parameters:', - ' - "force": any value enables deprecation notices - can be any of:', - ' - "phpdoc" to patch only docblock annotations', - ' - "2" to add all possible return types', - ' - "1" to add return types but only to tests/final/internal/private methods', - ' - "php": the target version of PHP - e.g. "7.1" doesn\'t generate "object" types', - ' - "deprecations": "1" to trigger a deprecation notice when a child class misses a', - ' return type while the parent declares an "@return" annotation', - '', - ' SYMFONY_PATCH_TYPE_EXCLUDE', - ' A regex matched against the full path to the class - any match will be excluded', - '', - ' Example: "SYMFONY_PATCH_TYPE_DECLARATIONS=php=7.4 ./patch-type-declarations"', - ]); - exit; -} - -if (false === getenv('SYMFONY_PATCH_TYPE_DECLARATIONS')) { - putenv('SYMFONY_PATCH_TYPE_DECLARATIONS=force=2'); - echo 'No SYMFONY_PATCH_TYPE_DECLARATIONS env var set, patching type declarations in all methods (run the command with "-h" for more information).'.PHP_EOL; -} - -if (is_file($autoload = __DIR__.'/../../../../autoload.php')) { - // noop -} elseif (is_file($autoload = __DIR__.'/../../../../../../../autoload.php')) { - // noop -} else { - echo PHP_EOL.' /!\ Cannot find the Composer autoloader, did you forget to run "composer install"?'.PHP_EOL; - exit(1); -} - -if (is_file($phpunitAutoload = dirname($autoload).'/bin/.phpunit/phpunit/vendor/autoload.php')) { - require $phpunitAutoload; -} - -$loader = require $autoload; - -Symfony\Component\ErrorHandler\DebugClassLoader::enable(); - -$deprecations = []; -set_error_handler(function ($type, $msg, $file, $line, $context = []) use (&$deprecations) { - if (\E_USER_DEPRECATED !== $type) { - return; - } - - [,,,,, $class,] = explode('"', $msg); - $deprecations[$class][] = $msg; -}); - -$exclude = getenv('SYMFONY_PATCH_TYPE_EXCLUDE') ?: null; -foreach ($loader->getClassMap() as $class => $file) { - if (str_contains($file = realpath($file), \DIRECTORY_SEPARATOR.'vendor'.\DIRECTORY_SEPARATOR)) { - continue; - } - - if ($exclude && preg_match($exclude, $file)) { - continue; - } - - class_exists($class); -} - -Symfony\Component\ErrorHandler\DebugClassLoader::checkClasses(); - -foreach ($deprecations as $class => $classDeprecations) { - echo $class.' ('.\count($classDeprecations).')'.PHP_EOL; - echo implode(PHP_EOL, $classDeprecations).PHP_EOL.PHP_EOL; -} - -if ($deprecations && str_contains(getenv('SYMFONY_PATCH_TYPE_DECLARATIONS') ?? '', 'force')) { - echo 'These deprecations might be fixed by the patch script, run this again to check for type deprecations.'.PHP_EOL; -} diff --git a/vendor/symfony/error-handler/Resources/views/error.html.php b/vendor/symfony/error-handler/Resources/views/error.html.php deleted file mode 100644 index fccbc088..00000000 --- a/vendor/symfony/error-handler/Resources/views/error.html.php +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - An Error Occurred: <?= $statusText; ?> - - - - -
      -

      Oops! An Error Occurred

      -

      The server returned a " ".

      - -

      - Something is broken. Please let us know what you were doing when this error occurred. - We will fix it as soon as possible. Sorry for any inconvenience caused. -

      -
      - - diff --git a/vendor/symfony/error-handler/Resources/views/exception.html.php b/vendor/symfony/error-handler/Resources/views/exception.html.php deleted file mode 100644 index 8468fa76..00000000 --- a/vendor/symfony/error-handler/Resources/views/exception.html.php +++ /dev/null @@ -1,116 +0,0 @@ -
      - - -
      -
      -

      formatFileFromText(nl2br($exceptionMessage)); ?>

      - -
      - include('assets/images/symfony-ghost.svg.php'); ?> -
      -
      -
      -
      - -
      -
      -
      - toArray(); - $exceptionWithUserCode = []; - $exceptionAsArrayCount = count($exceptionAsArray); - $last = $exceptionAsArrayCount - 1; - foreach ($exceptionAsArray as $i => $e) { - foreach ($e['trace'] as $trace) { - if ($trace['file'] && !str_contains($trace['file'], '/vendor/') && !str_contains($trace['file'], '/var/cache/') && $i < $last) { - $exceptionWithUserCode[] = $i; - } - } - } - ?> -

      - 1) { ?> - Exceptions - - Exception - -

      - -
      - $e) { - echo $this->include('views/traces.html.php', [ - 'exception' => $e, - 'index' => $i + 1, - 'expand' => in_array($i, $exceptionWithUserCode, true) || ([] === $exceptionWithUserCode && 0 === $i), - ]); - } - ?> -
      -
      - - -
      -

      - Logs - countErrors()) { ?>countErrors(); ?> -

      - -
      - getLogs()) { ?> - include('views/logs.html.php', ['logs' => $logger->getLogs()]); ?> - -
      -

      No log messages

      -
      - -
      -
      - - -
      -

      - 1) { ?> - Stack Traces - - Stack Trace - -

      - -
      - $e) { - echo $this->include('views/traces_text.html.php', [ - 'exception' => $e, - 'index' => $i + 1, - 'numExceptions' => $exceptionAsArrayCount, - ]); - } - ?> -
      -
      - - -
      -

      Output content

      - -
      - -
      -
      - -
      -
      diff --git a/vendor/symfony/error-handler/Resources/views/exception_full.html.php b/vendor/symfony/error-handler/Resources/views/exception_full.html.php deleted file mode 100644 index 04f0fd57..00000000 --- a/vendor/symfony/error-handler/Resources/views/exception_full.html.php +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - <?= $_message; ?> - - - - - - - - -
      -
      -

      include('assets/images/symfony-logo.svg'); ?> Symfony Exception

      - - -
      -
      - - - include('views/exception.html.php', $context); ?> - - - - - diff --git a/vendor/symfony/error-handler/Resources/views/logs.html.php b/vendor/symfony/error-handler/Resources/views/logs.html.php deleted file mode 100644 index ea6e727b..00000000 --- a/vendor/symfony/error-handler/Resources/views/logs.html.php +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - = 400) { - $status = 'error'; - } elseif ($log['priority'] >= 300) { - $status = 'warning'; - } else { - $severity = 0; - if (($exception = $log['context']['exception'] ?? null) instanceof \ErrorException || $exception instanceof \Symfony\Component\ErrorHandler\Exception\SilencedErrorContext) { - $severity = $exception->getSeverity(); - } - $status = \E_DEPRECATED === $severity || \E_USER_DEPRECATED === $severity ? 'warning' : 'normal'; - } ?> - data-filter-channel="escape($log['channel']); ?>"> - - - - - - - - -
      LevelChannelMessage
      - escape($log['priorityName']); ?> - - - escape($log['channel']); ?> - - formatLogMessage($log['message'], $log['context']); ?> - -
      escape(json_encode($log['context'], \JSON_PRETTY_PRINT | \JSON_UNESCAPED_UNICODE | \JSON_UNESCAPED_SLASHES)); ?>
      - -
      diff --git a/vendor/symfony/error-handler/Resources/views/trace.html.php b/vendor/symfony/error-handler/Resources/views/trace.html.php deleted file mode 100644 index 8dfdb4ec..00000000 --- a/vendor/symfony/error-handler/Resources/views/trace.html.php +++ /dev/null @@ -1,43 +0,0 @@ -
      - - include('assets/images/icon-minus-square.svg'); ?> - include('assets/images/icon-plus-square.svg'); ?> - - - - abbrClass($trace['class']); ?>(formatArgs($trace['args']); ?>) - - - - getFileLink($trace['file'], $lineNumber); - $filePath = strtr(strip_tags($this->formatFile($trace['file'], $lineNumber)), [' at line '.$lineNumber => '']); - $filePathParts = explode(\DIRECTORY_SEPARATOR, $filePath); - ?> - - in - - - - - - - - (line ) - - - -
      - -
      - fileExcerpt($trace['file'], $trace['line'], 5), [ - '#DD0000' => 'var(--highlight-string)', - '#007700' => 'var(--highlight-keyword)', - '#0000BB' => 'var(--highlight-default)', - '#FF8000' => 'var(--highlight-comment)', - ]); ?> -
      - diff --git a/vendor/symfony/error-handler/Resources/views/traces.html.php b/vendor/symfony/error-handler/Resources/views/traces.html.php deleted file mode 100644 index 38752bc1..00000000 --- a/vendor/symfony/error-handler/Resources/views/traces.html.php +++ /dev/null @@ -1,51 +0,0 @@ -
      -
      -
      -
      - include('assets/images/icon-minus-square-o.svg'); ?> - include('assets/images/icon-plus-square-o.svg'); ?> - - -
      - -

      - - - - -

      - - 1) { ?> -

      escape($exception['message']); ?>

      - -
      -
      - -
      - $trace) { - $isVendorTrace = $trace['file'] && (str_contains($trace['file'], '/vendor/') || str_contains($trace['file'], '/var/cache/')); - $displayCodeSnippet = $isFirstUserCode && !$isVendorTrace; - if ($displayCodeSnippet) { - $isFirstUserCode = false; - } ?> -
      - include('views/trace.html.php', [ - 'prefix' => $index, - 'i' => $i, - 'trace' => $trace, - 'style' => $isVendorTrace ? 'compact' : ($displayCodeSnippet ? 'expanded' : ''), - ]); ?> -
      - -
      -
      -
      diff --git a/vendor/symfony/error-handler/Resources/views/traces_text.html.php b/vendor/symfony/error-handler/Resources/views/traces_text.html.php deleted file mode 100644 index 6b478402..00000000 --- a/vendor/symfony/error-handler/Resources/views/traces_text.html.php +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - -
      -
      - 1) { ?> - [/] - - - include('assets/images/icon-minus-square-o.svg'); ?> - include('assets/images/icon-plus-square-o.svg'); ?> -
      -
      - -
      -escape($exception['class']).":\n";
      -                    if ($exception['message']) {
      -                        echo $this->escape($exception['message'])."\n";
      -                    }
      -
      -                    foreach ($exception['trace'] as $trace) {
      -                        echo "\n  ";
      -                        if ($trace['function']) {
      -                            echo $this->escape('at '.$trace['class'].$trace['type'].$trace['function']).'('.(isset($trace['args']) ? $this->formatArgsAsText($trace['args']) : '').')';
      -                        }
      -                        if ($trace['file'] && $trace['line']) {
      -                            echo($trace['function'] ? "\n     (" : 'at ').strtr(strip_tags($this->formatFile($trace['file'], $trace['line'])), [' at line '.$trace['line'] => '']).':'.$trace['line'].($trace['function'] ? ')' : '');
      -                        }
      -                    }
      -?>
      -                
      - -
      diff --git a/vendor/symfony/error-handler/ThrowableUtils.php b/vendor/symfony/error-handler/ThrowableUtils.php deleted file mode 100644 index f8a6a9d8..00000000 --- a/vendor/symfony/error-handler/ThrowableUtils.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\ErrorHandler; - -use Symfony\Component\ErrorHandler\Exception\SilencedErrorContext; - -/** - * @internal - */ -class ThrowableUtils -{ - public static function getSeverity(SilencedErrorContext|\Throwable $throwable): int - { - if ($throwable instanceof \ErrorException || $throwable instanceof SilencedErrorContext) { - return $throwable->getSeverity(); - } - - if ($throwable instanceof \ParseError) { - return \E_PARSE; - } - - if ($throwable instanceof \TypeError) { - return \E_RECOVERABLE_ERROR; - } - - return \E_ERROR; - } -} diff --git a/vendor/symfony/error-handler/composer.json b/vendor/symfony/error-handler/composer.json deleted file mode 100644 index 5331dd88..00000000 --- a/vendor/symfony/error-handler/composer.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "symfony/error-handler", - "type": "library", - "description": "Provides tools to manage errors and ease debugging PHP code", - "keywords": [], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.1", - "psr/log": "^1|^2|^3", - "symfony/var-dumper": "^5.4|^6.0" - }, - "require-dev": { - "symfony/http-kernel": "^5.4|^6.0", - "symfony/serializer": "^5.4|^6.0", - "symfony/deprecation-contracts": "^2.1|^3" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\ErrorHandler\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "bin": [ - "Resources/bin/patch-type-declarations" - ], - "minimum-stability": "dev" -} diff --git a/vendor/symfony/event-dispatcher-contracts/CHANGELOG.md b/vendor/symfony/event-dispatcher-contracts/CHANGELOG.md deleted file mode 100644 index 7932e261..00000000 --- a/vendor/symfony/event-dispatcher-contracts/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -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/symfony/event-dispatcher-contracts/Event.php b/vendor/symfony/event-dispatcher-contracts/Event.php deleted file mode 100644 index 2e7f9989..00000000 --- a/vendor/symfony/event-dispatcher-contracts/Event.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\Contracts\EventDispatcher; - -use Psr\EventDispatcher\StoppableEventInterface; - -/** - * Event is the base class for classes containing event data. - * - * This class contains no event data. It is used by events that do not pass - * state information to an event handler when an event is raised. - * - * You can call the method stopPropagation() to abort the execution of - * further listeners in your event listener. - * - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Bernhard Schussek - * @author Nicolas Grekas - */ -class Event implements StoppableEventInterface -{ - private bool $propagationStopped = false; - - public function isPropagationStopped(): bool - { - return $this->propagationStopped; - } - - /** - * Stops the propagation of the event to further event listeners. - * - * If multiple event listeners are connected to the same event, no - * further event listener will be triggered once any trigger calls - * stopPropagation(). - */ - public function stopPropagation(): void - { - $this->propagationStopped = true; - } -} diff --git a/vendor/symfony/event-dispatcher-contracts/EventDispatcherInterface.php b/vendor/symfony/event-dispatcher-contracts/EventDispatcherInterface.php deleted file mode 100644 index 610d6ac0..00000000 --- a/vendor/symfony/event-dispatcher-contracts/EventDispatcherInterface.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\Contracts\EventDispatcher; - -use Psr\EventDispatcher\EventDispatcherInterface as PsrEventDispatcherInterface; - -/** - * Allows providing hooks on domain-specific lifecycles by dispatching events. - */ -interface EventDispatcherInterface extends PsrEventDispatcherInterface -{ - /** - * Dispatches an event to all registered listeners. - * - * @template T of object - * - * @param T $event The event to pass to the event handlers/listeners - * @param string|null $eventName The name of the event to dispatch. If not supplied, - * the class of $event should be used instead. - * - * @return T The passed $event MUST be returned - */ - public function dispatch(object $event, string $eventName = null): object; -} diff --git a/vendor/symfony/event-dispatcher-contracts/LICENSE b/vendor/symfony/event-dispatcher-contracts/LICENSE deleted file mode 100644 index 74cdc2db..00000000 --- a/vendor/symfony/event-dispatcher-contracts/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2018-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/event-dispatcher-contracts/README.md b/vendor/symfony/event-dispatcher-contracts/README.md deleted file mode 100644 index b1ab4c00..00000000 --- a/vendor/symfony/event-dispatcher-contracts/README.md +++ /dev/null @@ -1,9 +0,0 @@ -Symfony EventDispatcher Contracts -================================= - -A set of abstractions extracted out of the Symfony components. - -Can be used to build on semantics that the Symfony components proved useful - and -that already have battle tested implementations. - -See https://github.com/symfony/contracts/blob/main/README.md for more information. diff --git a/vendor/symfony/event-dispatcher-contracts/composer.json b/vendor/symfony/event-dispatcher-contracts/composer.json deleted file mode 100644 index 89d7cec9..00000000 --- a/vendor/symfony/event-dispatcher-contracts/composer.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "symfony/event-dispatcher-contracts", - "type": "library", - "description": "Generic abstractions related to dispatching event", - "keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.1", - "psr/event-dispatcher": "^1" - }, - "suggest": { - "symfony/event-dispatcher-implementation": "" - }, - "autoload": { - "psr-4": { "Symfony\\Contracts\\EventDispatcher\\": "" } - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "3.3-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - } -} diff --git a/vendor/symfony/event-dispatcher/Attribute/AsEventListener.php b/vendor/symfony/event-dispatcher/Attribute/AsEventListener.php deleted file mode 100644 index bb931b82..00000000 --- a/vendor/symfony/event-dispatcher/Attribute/AsEventListener.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\EventDispatcher\Attribute; - -/** - * Service tag to autoconfigure event listeners. - * - * @author Alexander M. Turek - */ -#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] -class AsEventListener -{ - public function __construct( - public ?string $event = null, - public ?string $method = null, - public int $priority = 0, - public ?string $dispatcher = null, - ) { - } -} diff --git a/vendor/symfony/event-dispatcher/CHANGELOG.md b/vendor/symfony/event-dispatcher/CHANGELOG.md deleted file mode 100644 index 76b2eab6..00000000 --- a/vendor/symfony/event-dispatcher/CHANGELOG.md +++ /dev/null @@ -1,96 +0,0 @@ -CHANGELOG -========= - -6.0 ---- - - * Remove `LegacyEventDispatcherProxy` - -5.4 ---- - - * Allow `#[AsEventListener]` attribute on methods - -5.3 ---- - - * Add `#[AsEventListener]` attribute for declaring listeners on PHP 8 - -5.1.0 ------ - - * The `LegacyEventDispatcherProxy` class has been deprecated. - * Added an optional `dispatcher` attribute to the listener and subscriber tags in `RegisterListenerPass`. - -5.0.0 ------ - - * The signature of the `EventDispatcherInterface::dispatch()` method has been changed to `dispatch($event, string $eventName = null): object`. - * The `Event` class has been removed in favor of `Symfony\Contracts\EventDispatcher\Event`. - * The `TraceableEventDispatcherInterface` has been removed. - * The `WrappedListener` class is now final. - -4.4.0 ------ - - * `AddEventAliasesPass` has been added, allowing applications and bundles to extend the event alias mapping used by `RegisterListenersPass`. - * Made the `event` attribute of the `kernel.event_listener` tag optional for FQCN events. - -4.3.0 ------ - - * The signature of the `EventDispatcherInterface::dispatch()` method should be updated to `dispatch($event, string $eventName = null)`, not doing so is deprecated - * deprecated the `Event` class, use `Symfony\Contracts\EventDispatcher\Event` instead - -4.1.0 ------ - - * added support for invokable event listeners tagged with `kernel.event_listener` by default - * The `TraceableEventDispatcher::getOrphanedEvents()` method has been added. - * The `TraceableEventDispatcherInterface` has been deprecated. - -4.0.0 ------ - - * removed the `ContainerAwareEventDispatcher` class - * added the `reset()` method to the `TraceableEventDispatcherInterface` - -3.4.0 ------ - - * Implementing `TraceableEventDispatcherInterface` without the `reset()` method has been deprecated. - -3.3.0 ------ - - * The ContainerAwareEventDispatcher class has been deprecated. Use EventDispatcher with closure factories instead. - -3.0.0 ------ - - * The method `getListenerPriority($eventName, $listener)` has been added to the - `EventDispatcherInterface`. - * The methods `Event::setDispatcher()`, `Event::getDispatcher()`, `Event::setName()` - and `Event::getName()` have been removed. - The event dispatcher and the event name are passed to the listener call. - -2.5.0 ------ - - * added Debug\TraceableEventDispatcher (originally in HttpKernel) - * changed Debug\TraceableEventDispatcherInterface to extend EventDispatcherInterface - * added RegisterListenersPass (originally in HttpKernel) - -2.1.0 ------ - - * added TraceableEventDispatcherInterface - * added ContainerAwareEventDispatcher - * added a reference to the EventDispatcher on the Event - * added a reference to the Event name on the event - * added fluid interface to the dispatch() method which now returns the Event - object - * added GenericEvent event class - * added the possibility for subscribers to subscribe several times for the - same event - * added ImmutableEventDispatcher diff --git a/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php b/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php deleted file mode 100644 index d8213781..00000000 --- a/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php +++ /dev/null @@ -1,357 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\EventDispatcher\Debug; - -use Psr\EventDispatcher\StoppableEventInterface; -use Psr\Log\LoggerInterface; -use Symfony\Component\EventDispatcher\EventDispatcher; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\RequestStack; -use Symfony\Component\Stopwatch\Stopwatch; -use Symfony\Contracts\Service\ResetInterface; - -/** - * Collects some data about event listeners. - * - * This event dispatcher delegates the dispatching to another one. - * - * @author Fabien Potencier - */ -class TraceableEventDispatcher implements EventDispatcherInterface, ResetInterface -{ - protected $logger; - protected $stopwatch; - - /** - * @var \SplObjectStorage|null - */ - private ?\SplObjectStorage $callStack = null; - private EventDispatcherInterface $dispatcher; - private array $wrappedListeners = []; - private array $orphanedEvents = []; - private ?RequestStack $requestStack; - private string $currentRequestHash = ''; - - public function __construct(EventDispatcherInterface $dispatcher, Stopwatch $stopwatch, LoggerInterface $logger = null, RequestStack $requestStack = null) - { - $this->dispatcher = $dispatcher; - $this->stopwatch = $stopwatch; - $this->logger = $logger; - $this->requestStack = $requestStack; - } - - public function addListener(string $eventName, callable|array $listener, int $priority = 0) - { - $this->dispatcher->addListener($eventName, $listener, $priority); - } - - public function addSubscriber(EventSubscriberInterface $subscriber) - { - $this->dispatcher->addSubscriber($subscriber); - } - - public function removeListener(string $eventName, callable|array $listener) - { - if (isset($this->wrappedListeners[$eventName])) { - foreach ($this->wrappedListeners[$eventName] as $index => $wrappedListener) { - if ($wrappedListener->getWrappedListener() === $listener || ($listener instanceof \Closure && $wrappedListener->getWrappedListener() == $listener)) { - $listener = $wrappedListener; - unset($this->wrappedListeners[$eventName][$index]); - break; - } - } - } - - return $this->dispatcher->removeListener($eventName, $listener); - } - - public function removeSubscriber(EventSubscriberInterface $subscriber) - { - return $this->dispatcher->removeSubscriber($subscriber); - } - - public function getListeners(string $eventName = null): array - { - return $this->dispatcher->getListeners($eventName); - } - - public function getListenerPriority(string $eventName, callable|array $listener): ?int - { - // we might have wrapped listeners for the event (if called while dispatching) - // in that case get the priority by wrapper - if (isset($this->wrappedListeners[$eventName])) { - foreach ($this->wrappedListeners[$eventName] as $wrappedListener) { - if ($wrappedListener->getWrappedListener() === $listener || ($listener instanceof \Closure && $wrappedListener->getWrappedListener() == $listener)) { - return $this->dispatcher->getListenerPriority($eventName, $wrappedListener); - } - } - } - - return $this->dispatcher->getListenerPriority($eventName, $listener); - } - - public function hasListeners(string $eventName = null): bool - { - return $this->dispatcher->hasListeners($eventName); - } - - public function dispatch(object $event, string $eventName = null): object - { - $eventName ??= $event::class; - - $this->callStack ??= new \SplObjectStorage(); - - $currentRequestHash = $this->currentRequestHash = $this->requestStack && ($request = $this->requestStack->getCurrentRequest()) ? spl_object_hash($request) : ''; - - if (null !== $this->logger && $event instanceof StoppableEventInterface && $event->isPropagationStopped()) { - $this->logger->debug(sprintf('The "%s" event is already stopped. No listeners have been called.', $eventName)); - } - - $this->preProcess($eventName); - try { - $this->beforeDispatch($eventName, $event); - try { - $e = $this->stopwatch->start($eventName, 'section'); - try { - $this->dispatcher->dispatch($event, $eventName); - } finally { - if ($e->isStarted()) { - $e->stop(); - } - } - } finally { - $this->afterDispatch($eventName, $event); - } - } finally { - $this->currentRequestHash = $currentRequestHash; - $this->postProcess($eventName); - } - - return $event; - } - - public function getCalledListeners(Request $request = null): array - { - if (null === $this->callStack) { - return []; - } - - $hash = $request ? spl_object_hash($request) : null; - $called = []; - foreach ($this->callStack as $listener) { - [$eventName, $requestHash] = $this->callStack->getInfo(); - if (null === $hash || $hash === $requestHash) { - $called[] = $listener->getInfo($eventName); - } - } - - return $called; - } - - public function getNotCalledListeners(Request $request = null): array - { - try { - $allListeners = $this->dispatcher instanceof EventDispatcher ? $this->getListenersWithPriority() : $this->getListenersWithoutPriority(); - } catch (\Exception $e) { - $this->logger?->info('An exception was thrown while getting the uncalled listeners.', ['exception' => $e]); - - // unable to retrieve the uncalled listeners - return []; - } - - $hash = $request ? spl_object_hash($request) : null; - $calledListeners = []; - - if (null !== $this->callStack) { - foreach ($this->callStack as $calledListener) { - [, $requestHash] = $this->callStack->getInfo(); - - if (null === $hash || $hash === $requestHash) { - $calledListeners[] = $calledListener->getWrappedListener(); - } - } - } - - $notCalled = []; - - foreach ($allListeners as $eventName => $listeners) { - foreach ($listeners as [$listener, $priority]) { - if (!\in_array($listener, $calledListeners, true)) { - if (!$listener instanceof WrappedListener) { - $listener = new WrappedListener($listener, null, $this->stopwatch, $this, $priority); - } - $notCalled[] = $listener->getInfo($eventName); - } - } - } - - uasort($notCalled, $this->sortNotCalledListeners(...)); - - return $notCalled; - } - - public function getOrphanedEvents(Request $request = null): array - { - if ($request) { - return $this->orphanedEvents[spl_object_hash($request)] ?? []; - } - - if (!$this->orphanedEvents) { - return []; - } - - return array_merge(...array_values($this->orphanedEvents)); - } - - public function reset() - { - $this->callStack = null; - $this->orphanedEvents = []; - $this->currentRequestHash = ''; - } - - /** - * Proxies all method calls to the original event dispatcher. - * - * @param string $method The method name - * @param array $arguments The method arguments - */ - public function __call(string $method, array $arguments): mixed - { - return $this->dispatcher->{$method}(...$arguments); - } - - /** - * Called before dispatching the event. - */ - protected function beforeDispatch(string $eventName, object $event) - { - } - - /** - * Called after dispatching the event. - */ - protected function afterDispatch(string $eventName, object $event) - { - } - - private function preProcess(string $eventName): void - { - if (!$this->dispatcher->hasListeners($eventName)) { - $this->orphanedEvents[$this->currentRequestHash][] = $eventName; - - return; - } - - foreach ($this->dispatcher->getListeners($eventName) as $listener) { - $priority = $this->getListenerPriority($eventName, $listener); - $wrappedListener = new WrappedListener($listener instanceof WrappedListener ? $listener->getWrappedListener() : $listener, null, $this->stopwatch, $this); - $this->wrappedListeners[$eventName][] = $wrappedListener; - $this->dispatcher->removeListener($eventName, $listener); - $this->dispatcher->addListener($eventName, $wrappedListener, $priority); - $this->callStack->attach($wrappedListener, [$eventName, $this->currentRequestHash]); - } - } - - private function postProcess(string $eventName): void - { - unset($this->wrappedListeners[$eventName]); - $skipped = false; - foreach ($this->dispatcher->getListeners($eventName) as $listener) { - if (!$listener instanceof WrappedListener) { // #12845: a new listener was added during dispatch. - continue; - } - // Unwrap listener - $priority = $this->getListenerPriority($eventName, $listener); - $this->dispatcher->removeListener($eventName, $listener); - $this->dispatcher->addListener($eventName, $listener->getWrappedListener(), $priority); - - if (null !== $this->logger) { - $context = ['event' => $eventName, 'listener' => $listener->getPretty()]; - } - - if ($listener->wasCalled()) { - $this->logger?->debug('Notified event "{event}" to listener "{listener}".', $context); - } else { - $this->callStack->detach($listener); - } - - if (null !== $this->logger && $skipped) { - $this->logger->debug('Listener "{listener}" was not called for event "{event}".', $context); - } - - if ($listener->stoppedPropagation()) { - $this->logger?->debug('Listener "{listener}" stopped propagation of the event "{event}".', $context); - - $skipped = true; - } - } - } - - private function sortNotCalledListeners(array $a, array $b): int - { - if (0 !== $cmp = strcmp($a['event'], $b['event'])) { - return $cmp; - } - - if (\is_int($a['priority']) && !\is_int($b['priority'])) { - return 1; - } - - if (!\is_int($a['priority']) && \is_int($b['priority'])) { - return -1; - } - - if ($a['priority'] === $b['priority']) { - return 0; - } - - if ($a['priority'] > $b['priority']) { - return -1; - } - - return 1; - } - - private function getListenersWithPriority(): array - { - $result = []; - - $allListeners = new \ReflectionProperty(EventDispatcher::class, 'listeners'); - $allListeners->setAccessible(true); - - foreach ($allListeners->getValue($this->dispatcher) as $eventName => $listenersByPriority) { - foreach ($listenersByPriority as $priority => $listeners) { - foreach ($listeners as $listener) { - $result[$eventName][] = [$listener, $priority]; - } - } - } - - return $result; - } - - private function getListenersWithoutPriority(): array - { - $result = []; - - foreach ($this->getListeners() as $eventName => $listeners) { - foreach ($listeners as $listener) { - $result[$eventName][] = [$listener, null]; - } - } - - return $result; - } -} diff --git a/vendor/symfony/event-dispatcher/Debug/WrappedListener.php b/vendor/symfony/event-dispatcher/Debug/WrappedListener.php deleted file mode 100644 index af257fff..00000000 --- a/vendor/symfony/event-dispatcher/Debug/WrappedListener.php +++ /dev/null @@ -1,142 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\EventDispatcher\Debug; - -use Psr\EventDispatcher\StoppableEventInterface; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; -use Symfony\Component\Stopwatch\Stopwatch; -use Symfony\Component\VarDumper\Caster\ClassStub; - -/** - * @author Fabien Potencier - */ -final class WrappedListener -{ - private string|array|object $listener; - private ?\Closure $optimizedListener; - private string $name; - private bool $called = false; - private bool $stoppedPropagation = false; - private Stopwatch $stopwatch; - private ?EventDispatcherInterface $dispatcher; - private string $pretty; - private string $callableRef; - private ClassStub|string $stub; - private ?int $priority = null; - private static bool $hasClassStub; - - public function __construct(callable|array $listener, ?string $name, Stopwatch $stopwatch, EventDispatcherInterface $dispatcher = null, int $priority = null) - { - $this->listener = $listener; - $this->optimizedListener = $listener instanceof \Closure ? $listener : (\is_callable($listener) ? $listener(...) : null); - $this->stopwatch = $stopwatch; - $this->dispatcher = $dispatcher; - $this->priority = $priority; - - if (\is_array($listener)) { - [$this->name, $this->callableRef] = $this->parseListener($listener); - $this->pretty = $this->name.'::'.$listener[1]; - $this->callableRef .= '::'.$listener[1]; - } elseif ($listener instanceof \Closure) { - $r = new \ReflectionFunction($listener); - if (str_contains($r->name, '{closure}')) { - $this->pretty = $this->name = 'closure'; - } elseif ($class = \PHP_VERSION_ID >= 80111 ? $r->getClosureCalledClass() : $r->getClosureScopeClass()) { - $this->name = $class->name; - $this->pretty = $this->name.'::'.$r->name; - } else { - $this->pretty = $this->name = $r->name; - } - } elseif (\is_string($listener)) { - $this->pretty = $this->name = $listener; - } else { - $this->name = get_debug_type($listener); - $this->pretty = $this->name.'::__invoke'; - $this->callableRef = $listener::class.'::__invoke'; - } - - if (null !== $name) { - $this->name = $name; - } - - self::$hasClassStub ??= class_exists(ClassStub::class); - } - - public function getWrappedListener(): callable|array - { - return $this->listener; - } - - public function wasCalled(): bool - { - return $this->called; - } - - public function stoppedPropagation(): bool - { - return $this->stoppedPropagation; - } - - public function getPretty(): string - { - return $this->pretty; - } - - public function getInfo(string $eventName): array - { - $this->stub ??= self::$hasClassStub ? new ClassStub($this->pretty.'()', $this->callableRef ?? $this->listener) : $this->pretty.'()'; - - return [ - 'event' => $eventName, - 'priority' => $this->priority ??= $this->dispatcher?->getListenerPriority($eventName, $this->listener), - 'pretty' => $this->pretty, - 'stub' => $this->stub, - ]; - } - - public function __invoke(object $event, string $eventName, EventDispatcherInterface $dispatcher): void - { - $dispatcher = $this->dispatcher ?: $dispatcher; - - $this->called = true; - $this->priority ??= $dispatcher->getListenerPriority($eventName, $this->listener); - - $e = $this->stopwatch->start($this->name, 'event_listener'); - - ($this->optimizedListener ?? $this->listener)($event, $eventName, $dispatcher); - - if ($e->isStarted()) { - $e->stop(); - } - - if ($event instanceof StoppableEventInterface && $event->isPropagationStopped()) { - $this->stoppedPropagation = true; - } - } - - private function parseListener(array $listener): array - { - if ($listener[0] instanceof \Closure) { - foreach ((new \ReflectionFunction($listener[0]))->getAttributes(\Closure::class) as $attribute) { - if ($name = $attribute->getArguments()['name'] ?? false) { - return [$name, $attribute->getArguments()['class'] ?? $name]; - } - } - } - - if (\is_object($listener[0])) { - return [get_debug_type($listener[0]), \get_class($listener[0])]; - } - - return [$listener[0], $listener[0]]; - } -} diff --git a/vendor/symfony/event-dispatcher/DependencyInjection/AddEventAliasesPass.php b/vendor/symfony/event-dispatcher/DependencyInjection/AddEventAliasesPass.php deleted file mode 100644 index 13b4336a..00000000 --- a/vendor/symfony/event-dispatcher/DependencyInjection/AddEventAliasesPass.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\EventDispatcher\DependencyInjection; - -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -/** - * This pass allows bundles to extend the list of event aliases. - * - * @author Alexander M. Turek - */ -class AddEventAliasesPass implements CompilerPassInterface -{ - private array $eventAliases; - - public function __construct(array $eventAliases) - { - $this->eventAliases = $eventAliases; - } - - public function process(ContainerBuilder $container): void - { - $eventAliases = $container->hasParameter('event_dispatcher.event_aliases') ? $container->getParameter('event_dispatcher.event_aliases') : []; - - $container->setParameter( - 'event_dispatcher.event_aliases', - array_merge($eventAliases, $this->eventAliases) - ); - } -} diff --git a/vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php b/vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php deleted file mode 100644 index 51159d25..00000000 --- a/vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php +++ /dev/null @@ -1,209 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\EventDispatcher\DependencyInjection; - -use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\EventDispatcher\EventDispatcher; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Contracts\EventDispatcher\Event; - -/** - * Compiler pass to register tagged services for an event dispatcher. - */ -class RegisterListenersPass implements CompilerPassInterface -{ - private array $hotPathEvents = []; - private array $noPreloadEvents = []; - - /** - * @return $this - */ - public function setHotPathEvents(array $hotPathEvents): static - { - $this->hotPathEvents = array_flip($hotPathEvents); - - return $this; - } - - /** - * @return $this - */ - public function setNoPreloadEvents(array $noPreloadEvents): static - { - $this->noPreloadEvents = array_flip($noPreloadEvents); - - return $this; - } - - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('event_dispatcher') && !$container->hasAlias('event_dispatcher')) { - return; - } - - $aliases = []; - - if ($container->hasParameter('event_dispatcher.event_aliases')) { - $aliases = $container->getParameter('event_dispatcher.event_aliases'); - } - - $globalDispatcherDefinition = $container->findDefinition('event_dispatcher'); - - foreach ($container->findTaggedServiceIds('kernel.event_listener', true) as $id => $events) { - $noPreload = 0; - - foreach ($events as $event) { - $priority = $event['priority'] ?? 0; - - if (!isset($event['event'])) { - if ($container->getDefinition($id)->hasTag('kernel.event_subscriber')) { - continue; - } - - $event['method'] ??= '__invoke'; - $event['event'] = $this->getEventFromTypeDeclaration($container, $id, $event['method']); - } - - $event['event'] = $aliases[$event['event']] ?? $event['event']; - - if (!isset($event['method'])) { - $event['method'] = 'on'.preg_replace_callback([ - '/(?<=\b|_)[a-z]/i', - '/[^a-z0-9]/i', - ], function ($matches) { return strtoupper($matches[0]); }, $event['event']); - $event['method'] = preg_replace('/[^a-z0-9]/i', '', $event['method']); - - if (null !== ($class = $container->getDefinition($id)->getClass()) && ($r = $container->getReflectionClass($class, false)) && !$r->hasMethod($event['method']) && $r->hasMethod('__invoke')) { - $event['method'] = '__invoke'; - } - } - - $dispatcherDefinition = $globalDispatcherDefinition; - if (isset($event['dispatcher'])) { - $dispatcherDefinition = $container->getDefinition($event['dispatcher']); - } - - $dispatcherDefinition->addMethodCall('addListener', [$event['event'], [new ServiceClosureArgument(new Reference($id)), $event['method']], $priority]); - - if (isset($this->hotPathEvents[$event['event']])) { - $container->getDefinition($id)->addTag('container.hot_path'); - } elseif (isset($this->noPreloadEvents[$event['event']])) { - ++$noPreload; - } - } - - if ($noPreload && \count($events) === $noPreload) { - $container->getDefinition($id)->addTag('container.no_preload'); - } - } - - $extractingDispatcher = new ExtractingEventDispatcher(); - - foreach ($container->findTaggedServiceIds('kernel.event_subscriber', true) as $id => $tags) { - $def = $container->getDefinition($id); - - // We must assume that the class value has been correctly filled, even if the service is created by a factory - $class = $def->getClass(); - - if (!$r = $container->getReflectionClass($class)) { - throw new InvalidArgumentException(sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id)); - } - if (!$r->isSubclassOf(EventSubscriberInterface::class)) { - throw new InvalidArgumentException(sprintf('Service "%s" must implement interface "%s".', $id, EventSubscriberInterface::class)); - } - $class = $r->name; - - $dispatcherDefinitions = []; - foreach ($tags as $attributes) { - if (!isset($attributes['dispatcher']) || isset($dispatcherDefinitions[$attributes['dispatcher']])) { - continue; - } - - $dispatcherDefinitions[$attributes['dispatcher']] = $container->getDefinition($attributes['dispatcher']); - } - - if (!$dispatcherDefinitions) { - $dispatcherDefinitions = [$globalDispatcherDefinition]; - } - - $noPreload = 0; - ExtractingEventDispatcher::$aliases = $aliases; - ExtractingEventDispatcher::$subscriber = $class; - $extractingDispatcher->addSubscriber($extractingDispatcher); - foreach ($extractingDispatcher->listeners as $args) { - $args[1] = [new ServiceClosureArgument(new Reference($id)), $args[1]]; - foreach ($dispatcherDefinitions as $dispatcherDefinition) { - $dispatcherDefinition->addMethodCall('addListener', $args); - } - - if (isset($this->hotPathEvents[$args[0]])) { - $container->getDefinition($id)->addTag('container.hot_path'); - } elseif (isset($this->noPreloadEvents[$args[0]])) { - ++$noPreload; - } - } - if ($noPreload && \count($extractingDispatcher->listeners) === $noPreload) { - $container->getDefinition($id)->addTag('container.no_preload'); - } - $extractingDispatcher->listeners = []; - ExtractingEventDispatcher::$aliases = []; - } - } - - private function getEventFromTypeDeclaration(ContainerBuilder $container, string $id, string $method): string - { - if ( - null === ($class = $container->getDefinition($id)->getClass()) - || !($r = $container->getReflectionClass($class, false)) - || !$r->hasMethod($method) - || 1 > ($m = $r->getMethod($method))->getNumberOfParameters() - || !($type = $m->getParameters()[0]->getType()) instanceof \ReflectionNamedType - || $type->isBuiltin() - || Event::class === ($name = $type->getName()) - ) { - throw new InvalidArgumentException(sprintf('Service "%s" must define the "event" attribute on "kernel.event_listener" tags.', $id)); - } - - return $name; - } -} - -/** - * @internal - */ -class ExtractingEventDispatcher extends EventDispatcher implements EventSubscriberInterface -{ - public array $listeners = []; - - public static array $aliases = []; - public static string $subscriber; - - public function addListener(string $eventName, callable|array $listener, int $priority = 0) - { - $this->listeners[] = [$eventName, $listener[1], $priority]; - } - - public static function getSubscribedEvents(): array - { - $events = []; - - foreach ([self::$subscriber, 'getSubscribedEvents']() as $eventName => $params) { - $events[self::$aliases[$eventName] ?? $eventName] = $params; - } - - return $events; - } -} diff --git a/vendor/symfony/event-dispatcher/EventDispatcher.php b/vendor/symfony/event-dispatcher/EventDispatcher.php deleted file mode 100644 index 41f3f7ae..00000000 --- a/vendor/symfony/event-dispatcher/EventDispatcher.php +++ /dev/null @@ -1,256 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\EventDispatcher; - -use Psr\EventDispatcher\StoppableEventInterface; -use Symfony\Component\EventDispatcher\Debug\WrappedListener; - -/** - * The EventDispatcherInterface is the central point of Symfony's event listener system. - * - * Listeners are registered on the manager and events are dispatched through the - * manager. - * - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Bernhard Schussek - * @author Fabien Potencier - * @author Jordi Boggiano - * @author Jordan Alliot - * @author Nicolas Grekas - */ -class EventDispatcher implements EventDispatcherInterface -{ - private array $listeners = []; - private array $sorted = []; - private array $optimized; - - public function __construct() - { - if (__CLASS__ === static::class) { - $this->optimized = []; - } - } - - public function dispatch(object $event, string $eventName = null): object - { - $eventName ??= $event::class; - - if (isset($this->optimized)) { - $listeners = $this->optimized[$eventName] ?? (empty($this->listeners[$eventName]) ? [] : $this->optimizeListeners($eventName)); - } else { - $listeners = $this->getListeners($eventName); - } - - if ($listeners) { - $this->callListeners($listeners, $eventName, $event); - } - - return $event; - } - - public function getListeners(string $eventName = null): array - { - if (null !== $eventName) { - if (empty($this->listeners[$eventName])) { - return []; - } - - if (!isset($this->sorted[$eventName])) { - $this->sortListeners($eventName); - } - - return $this->sorted[$eventName]; - } - - foreach ($this->listeners as $eventName => $eventListeners) { - if (!isset($this->sorted[$eventName])) { - $this->sortListeners($eventName); - } - } - - return array_filter($this->sorted); - } - - public function getListenerPriority(string $eventName, callable|array $listener): ?int - { - if (empty($this->listeners[$eventName])) { - return null; - } - - if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure && 2 >= \count($listener)) { - $listener[0] = $listener[0](); - $listener[1] ??= '__invoke'; - } - - foreach ($this->listeners[$eventName] as $priority => &$listeners) { - foreach ($listeners as &$v) { - if ($v !== $listener && \is_array($v) && isset($v[0]) && $v[0] instanceof \Closure && 2 >= \count($v)) { - $v[0] = $v[0](); - $v[1] ??= '__invoke'; - } - if ($v === $listener || ($listener instanceof \Closure && $v == $listener)) { - return $priority; - } - } - } - - return null; - } - - public function hasListeners(string $eventName = null): bool - { - if (null !== $eventName) { - return !empty($this->listeners[$eventName]); - } - - foreach ($this->listeners as $eventListeners) { - if ($eventListeners) { - return true; - } - } - - return false; - } - - public function addListener(string $eventName, callable|array $listener, int $priority = 0) - { - $this->listeners[$eventName][$priority][] = $listener; - unset($this->sorted[$eventName], $this->optimized[$eventName]); - } - - public function removeListener(string $eventName, callable|array $listener) - { - if (empty($this->listeners[$eventName])) { - return; - } - - if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure && 2 >= \count($listener)) { - $listener[0] = $listener[0](); - $listener[1] ??= '__invoke'; - } - - foreach ($this->listeners[$eventName] as $priority => &$listeners) { - foreach ($listeners as $k => &$v) { - if ($v !== $listener && \is_array($v) && isset($v[0]) && $v[0] instanceof \Closure && 2 >= \count($v)) { - $v[0] = $v[0](); - $v[1] ??= '__invoke'; - } - if ($v === $listener || ($listener instanceof \Closure && $v == $listener)) { - unset($listeners[$k], $this->sorted[$eventName], $this->optimized[$eventName]); - } - } - - if (!$listeners) { - unset($this->listeners[$eventName][$priority]); - } - } - } - - public function addSubscriber(EventSubscriberInterface $subscriber) - { - foreach ($subscriber->getSubscribedEvents() as $eventName => $params) { - if (\is_string($params)) { - $this->addListener($eventName, [$subscriber, $params]); - } elseif (\is_string($params[0])) { - $this->addListener($eventName, [$subscriber, $params[0]], $params[1] ?? 0); - } else { - foreach ($params as $listener) { - $this->addListener($eventName, [$subscriber, $listener[0]], $listener[1] ?? 0); - } - } - } - } - - public function removeSubscriber(EventSubscriberInterface $subscriber) - { - foreach ($subscriber->getSubscribedEvents() as $eventName => $params) { - if (\is_array($params) && \is_array($params[0])) { - foreach ($params as $listener) { - $this->removeListener($eventName, [$subscriber, $listener[0]]); - } - } else { - $this->removeListener($eventName, [$subscriber, \is_string($params) ? $params : $params[0]]); - } - } - } - - /** - * Triggers the listeners of an event. - * - * This method can be overridden to add functionality that is executed - * for each listener. - * - * @param callable[] $listeners The event listeners - * @param string $eventName The name of the event to dispatch - * @param object $event The event object to pass to the event handlers/listeners - */ - protected function callListeners(iterable $listeners, string $eventName, object $event) - { - $stoppable = $event instanceof StoppableEventInterface; - - foreach ($listeners as $listener) { - if ($stoppable && $event->isPropagationStopped()) { - break; - } - $listener($event, $eventName, $this); - } - } - - /** - * Sorts the internal list of listeners for the given event by priority. - */ - private function sortListeners(string $eventName) - { - krsort($this->listeners[$eventName]); - $this->sorted[$eventName] = []; - - foreach ($this->listeners[$eventName] as &$listeners) { - foreach ($listeners as &$listener) { - if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure && 2 >= \count($listener)) { - $listener[0] = $listener[0](); - $listener[1] ??= '__invoke'; - } - $this->sorted[$eventName][] = $listener; - } - } - } - - /** - * Optimizes the internal list of listeners for the given event by priority. - */ - private function optimizeListeners(string $eventName): array - { - krsort($this->listeners[$eventName]); - $this->optimized[$eventName] = []; - - foreach ($this->listeners[$eventName] as &$listeners) { - foreach ($listeners as &$listener) { - $closure = &$this->optimized[$eventName][]; - if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure && 2 >= \count($listener)) { - $closure = static function (...$args) use (&$listener, &$closure) { - if ($listener[0] instanceof \Closure) { - $listener[0] = $listener[0](); - $listener[1] ??= '__invoke'; - } - ($closure = $listener(...))(...$args); - }; - } else { - $closure = $listener instanceof WrappedListener ? $listener : $listener(...); - } - } - } - - return $this->optimized[$eventName]; - } -} diff --git a/vendor/symfony/event-dispatcher/EventDispatcherInterface.php b/vendor/symfony/event-dispatcher/EventDispatcherInterface.php deleted file mode 100644 index 97a3017a..00000000 --- a/vendor/symfony/event-dispatcher/EventDispatcherInterface.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\EventDispatcher; - -use Symfony\Contracts\EventDispatcher\EventDispatcherInterface as ContractsEventDispatcherInterface; - -/** - * The EventDispatcherInterface is the central point of Symfony's event listener system. - * Listeners are registered on the manager and events are dispatched through the - * manager. - * - * @author Bernhard Schussek - */ -interface EventDispatcherInterface extends ContractsEventDispatcherInterface -{ - /** - * Adds an event listener that listens on the specified events. - * - * @param int $priority The higher this value, the earlier an event - * listener will be triggered in the chain (defaults to 0) - */ - public function addListener(string $eventName, callable $listener, int $priority = 0); - - /** - * Adds an event subscriber. - * - * The subscriber is asked for all the events it is - * interested in and added as a listener for these events. - */ - public function addSubscriber(EventSubscriberInterface $subscriber); - - /** - * Removes an event listener from the specified events. - */ - public function removeListener(string $eventName, callable $listener); - - public function removeSubscriber(EventSubscriberInterface $subscriber); - - /** - * Gets the listeners of a specific event or all listeners sorted by descending priority. - * - * @return array - */ - public function getListeners(string $eventName = null): array; - - /** - * Gets the listener priority for a specific event. - * - * Returns null if the event or the listener does not exist. - */ - public function getListenerPriority(string $eventName, callable $listener): ?int; - - /** - * Checks whether an event has any registered listeners. - */ - public function hasListeners(string $eventName = null): bool; -} diff --git a/vendor/symfony/event-dispatcher/EventSubscriberInterface.php b/vendor/symfony/event-dispatcher/EventSubscriberInterface.php deleted file mode 100644 index 2085e428..00000000 --- a/vendor/symfony/event-dispatcher/EventSubscriberInterface.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\EventDispatcher; - -/** - * An EventSubscriber knows itself what events it is interested in. - * If an EventSubscriber is added to an EventDispatcherInterface, the manager invokes - * {@link getSubscribedEvents} and registers the subscriber as a listener for all - * returned events. - * - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Bernhard Schussek - */ -interface EventSubscriberInterface -{ - /** - * Returns an array of event names this subscriber wants to listen to. - * - * The array keys are event names and the value can be: - * - * * The method name to call (priority defaults to 0) - * * An array composed of the method name to call and the priority - * * An array of arrays composed of the method names to call and respective - * priorities, or 0 if unset - * - * For instance: - * - * * ['eventName' => 'methodName'] - * * ['eventName' => ['methodName', $priority]] - * * ['eventName' => [['methodName1', $priority], ['methodName2']]] - * - * The code must not depend on runtime state as it will only be called at compile time. - * All logic depending on runtime state must be put into the individual methods handling the events. - * - * @return array> - */ - public static function getSubscribedEvents(); -} diff --git a/vendor/symfony/event-dispatcher/GenericEvent.php b/vendor/symfony/event-dispatcher/GenericEvent.php deleted file mode 100644 index 68a20306..00000000 --- a/vendor/symfony/event-dispatcher/GenericEvent.php +++ /dev/null @@ -1,158 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\EventDispatcher; - -use Symfony\Contracts\EventDispatcher\Event; - -/** - * Event encapsulation class. - * - * Encapsulates events thus decoupling the observer from the subject they encapsulate. - * - * @author Drak - * - * @implements \ArrayAccess - * @implements \IteratorAggregate - */ -class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate -{ - protected $subject; - protected $arguments; - - /** - * Encapsulate an event with $subject and $args. - * - * @param mixed $subject The subject of the event, usually an object or a callable - * @param array $arguments Arguments to store in the event - */ - public function __construct(mixed $subject = null, array $arguments = []) - { - $this->subject = $subject; - $this->arguments = $arguments; - } - - /** - * Getter for subject property. - */ - public function getSubject(): mixed - { - return $this->subject; - } - - /** - * Get argument by key. - * - * @throws \InvalidArgumentException if key is not found - */ - public function getArgument(string $key): mixed - { - if ($this->hasArgument($key)) { - return $this->arguments[$key]; - } - - throw new \InvalidArgumentException(sprintf('Argument "%s" not found.', $key)); - } - - /** - * Add argument to event. - * - * @return $this - */ - public function setArgument(string $key, mixed $value): static - { - $this->arguments[$key] = $value; - - return $this; - } - - /** - * Getter for all arguments. - */ - public function getArguments(): array - { - return $this->arguments; - } - - /** - * Set args property. - * - * @return $this - */ - public function setArguments(array $args = []): static - { - $this->arguments = $args; - - return $this; - } - - /** - * Has argument. - */ - public function hasArgument(string $key): bool - { - return \array_key_exists($key, $this->arguments); - } - - /** - * ArrayAccess for argument getter. - * - * @param string $key Array key - * - * @throws \InvalidArgumentException if key does not exist in $this->args - */ - public function offsetGet(mixed $key): mixed - { - return $this->getArgument($key); - } - - /** - * ArrayAccess for argument setter. - * - * @param string $key Array key to set - */ - public function offsetSet(mixed $key, mixed $value): void - { - $this->setArgument($key, $value); - } - - /** - * ArrayAccess for unset argument. - * - * @param string $key Array key - */ - public function offsetUnset(mixed $key): void - { - if ($this->hasArgument($key)) { - unset($this->arguments[$key]); - } - } - - /** - * ArrayAccess has argument. - * - * @param string $key Array key - */ - public function offsetExists(mixed $key): bool - { - return $this->hasArgument($key); - } - - /** - * IteratorAggregate for iterating over the object like an array. - * - * @return \ArrayIterator - */ - public function getIterator(): \ArrayIterator - { - return new \ArrayIterator($this->arguments); - } -} diff --git a/vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php b/vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php deleted file mode 100644 index 182ba080..00000000 --- a/vendor/symfony/event-dispatcher/ImmutableEventDispatcher.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\EventDispatcher; - -/** - * A read-only proxy for an event dispatcher. - * - * @author Bernhard Schussek - */ -class ImmutableEventDispatcher implements EventDispatcherInterface -{ - private EventDispatcherInterface $dispatcher; - - public function __construct(EventDispatcherInterface $dispatcher) - { - $this->dispatcher = $dispatcher; - } - - public function dispatch(object $event, string $eventName = null): object - { - return $this->dispatcher->dispatch($event, $eventName); - } - - public function addListener(string $eventName, callable|array $listener, int $priority = 0) - { - throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.'); - } - - public function addSubscriber(EventSubscriberInterface $subscriber) - { - throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.'); - } - - public function removeListener(string $eventName, callable|array $listener) - { - throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.'); - } - - public function removeSubscriber(EventSubscriberInterface $subscriber) - { - throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.'); - } - - public function getListeners(string $eventName = null): array - { - return $this->dispatcher->getListeners($eventName); - } - - public function getListenerPriority(string $eventName, callable|array $listener): ?int - { - return $this->dispatcher->getListenerPriority($eventName, $listener); - } - - public function hasListeners(string $eventName = null): bool - { - return $this->dispatcher->hasListeners($eventName); - } -} diff --git a/vendor/symfony/event-dispatcher/LICENSE b/vendor/symfony/event-dispatcher/LICENSE deleted file mode 100644 index 88bf75bb..00000000 --- a/vendor/symfony/event-dispatcher/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2022 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/event-dispatcher/README.md b/vendor/symfony/event-dispatcher/README.md deleted file mode 100644 index dcdb68d2..00000000 --- a/vendor/symfony/event-dispatcher/README.md +++ /dev/null @@ -1,15 +0,0 @@ -EventDispatcher Component -========================= - -The EventDispatcher component provides tools that allow your application -components to communicate with each other by dispatching events and listening to -them. - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/components/event_dispatcher.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/event-dispatcher/composer.json b/vendor/symfony/event-dispatcher/composer.json deleted file mode 100644 index c05373f3..00000000 --- a/vendor/symfony/event-dispatcher/composer.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "symfony/event-dispatcher", - "type": "library", - "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", - "keywords": [], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.1", - "symfony/event-dispatcher-contracts": "^2|^3" - }, - "require-dev": { - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/config": "^5.4|^6.0", - "symfony/error-handler": "^5.4|^6.0", - "symfony/http-foundation": "^5.4|^6.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/stopwatch": "^5.4|^6.0", - "psr/log": "^1|^2|^3" - }, - "conflict": { - "symfony/dependency-injection": "<5.4" - }, - "provide": { - "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "2.0|3.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\EventDispatcher\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "minimum-stability": "dev" -} diff --git a/vendor/symfony/finder/CHANGELOG.md b/vendor/symfony/finder/CHANGELOG.md deleted file mode 100644 index 1a12afe6..00000000 --- a/vendor/symfony/finder/CHANGELOG.md +++ /dev/null @@ -1,98 +0,0 @@ -CHANGELOG -========= - -6.2 ---- - - * Add `Finder::sortByExtension()` and `Finder::sortBySize()` - * Add `Finder::sortByCaseInsensitiveName()` to sort by name with case insensitive sorting methods - -6.0 ---- - - * Remove `Comparator::setTarget()` and `Comparator::setOperator()` - -5.4.0 ------ - - * Deprecate `Comparator::setTarget()` and `Comparator::setOperator()` - * Add a constructor to `Comparator` that allows setting target and operator - * Finder's iterator has now `Symfony\Component\Finder\SplFileInfo` inner type specified - * Add recursive .gitignore files support - -5.0.0 ------ - - * added `$useNaturalSort` argument to `Finder::sortByName()` - -4.3.0 ------ - - * added Finder::ignoreVCSIgnored() to ignore files based on rules listed in .gitignore - -4.2.0 ------ - - * added $useNaturalSort option to Finder::sortByName() method - * the `Finder::sortByName()` method will have a new `$useNaturalSort` - argument in version 5.0, not defining it is deprecated - * added `Finder::reverseSorting()` to reverse the sorting - -4.0.0 ------ - - * removed `ExceptionInterface` - * removed `Symfony\Component\Finder\Iterator\FilterIterator` - -3.4.0 ------ - - * deprecated `Symfony\Component\Finder\Iterator\FilterIterator` - * added Finder::hasResults() method to check if any results were found - -3.3.0 ------ - - * added double-star matching to Glob::toRegex() - -3.0.0 ------ - - * removed deprecated classes - -2.8.0 ------ - - * deprecated adapters and related classes - -2.5.0 ------ - * added support for GLOB_BRACE in the paths passed to Finder::in() - -2.3.0 ------ - - * added a way to ignore unreadable directories (via Finder::ignoreUnreadableDirs()) - * unified the way subfolders that are not executable are handled by always throwing an AccessDeniedException exception - -2.2.0 ------ - - * added Finder::path() and Finder::notPath() methods - * added finder adapters to improve performance on specific platforms - * added support for wildcard characters (glob patterns) in the paths passed - to Finder::in() - -2.1.0 ------ - - * added Finder::sortByAccessedTime(), Finder::sortByChangedTime(), and - Finder::sortByModifiedTime() - * added Countable to Finder - * added support for an array of directories as an argument to - Finder::exclude() - * added searching based on the file content via Finder::contains() and - Finder::notContains() - * added support for the != operator in the Comparator - * [BC BREAK] filter expressions (used for file name and content) are no more - considered as regexps but glob patterns when they are enclosed in '*' or '?' diff --git a/vendor/symfony/finder/Comparator/Comparator.php b/vendor/symfony/finder/Comparator/Comparator.php deleted file mode 100644 index bd685834..00000000 --- a/vendor/symfony/finder/Comparator/Comparator.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\Finder\Comparator; - -/** - * @author Fabien Potencier - */ -class Comparator -{ - private string $target; - private string $operator; - - public function __construct(string $target, string $operator = '==') - { - if (!\in_array($operator, ['>', '<', '>=', '<=', '==', '!='])) { - throw new \InvalidArgumentException(sprintf('Invalid operator "%s".', $operator)); - } - - $this->target = $target; - $this->operator = $operator; - } - - /** - * Gets the target value. - */ - public function getTarget(): string - { - return $this->target; - } - - /** - * Gets the comparison operator. - */ - public function getOperator(): string - { - return $this->operator; - } - - /** - * Tests against the target. - */ - public function test(mixed $test): bool - { - return match ($this->operator) { - '>' => $test > $this->target, - '>=' => $test >= $this->target, - '<' => $test < $this->target, - '<=' => $test <= $this->target, - '!=' => $test != $this->target, - default => $test == $this->target, - }; - } -} diff --git a/vendor/symfony/finder/Comparator/DateComparator.php b/vendor/symfony/finder/Comparator/DateComparator.php deleted file mode 100644 index e0c523d0..00000000 --- a/vendor/symfony/finder/Comparator/DateComparator.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Comparator; - -/** - * DateCompare compiles date comparisons. - * - * @author Fabien Potencier - */ -class DateComparator extends Comparator -{ - /** - * @param string $test A comparison string - * - * @throws \InvalidArgumentException If the test is not understood - */ - public function __construct(string $test) - { - if (!preg_match('#^\s*(==|!=|[<>]=?|after|since|before|until)?\s*(.+?)\s*$#i', $test, $matches)) { - throw new \InvalidArgumentException(sprintf('Don\'t understand "%s" as a date test.', $test)); - } - - try { - $date = new \DateTimeImmutable($matches[2]); - $target = $date->format('U'); - } catch (\Exception) { - throw new \InvalidArgumentException(sprintf('"%s" is not a valid date.', $matches[2])); - } - - $operator = $matches[1] ?? '=='; - if ('since' === $operator || 'after' === $operator) { - $operator = '>'; - } - - if ('until' === $operator || 'before' === $operator) { - $operator = '<'; - } - - parent::__construct($target, $operator); - } -} diff --git a/vendor/symfony/finder/Comparator/NumberComparator.php b/vendor/symfony/finder/Comparator/NumberComparator.php deleted file mode 100644 index ff85d967..00000000 --- a/vendor/symfony/finder/Comparator/NumberComparator.php +++ /dev/null @@ -1,78 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Comparator; - -/** - * NumberComparator compiles a simple comparison to an anonymous - * subroutine, which you can call with a value to be tested again. - * - * Now this would be very pointless, if NumberCompare didn't understand - * magnitudes. - * - * The target value may use magnitudes of kilobytes (k, ki), - * megabytes (m, mi), or gigabytes (g, gi). Those suffixed - * with an i use the appropriate 2**n version in accordance with the - * IEC standard: http://physics.nist.gov/cuu/Units/binary.html - * - * Based on the Perl Number::Compare module. - * - * @author Fabien Potencier PHP port - * @author Richard Clamp Perl version - * @copyright 2004-2005 Fabien Potencier - * @copyright 2002 Richard Clamp - * - * @see http://physics.nist.gov/cuu/Units/binary.html - */ -class NumberComparator extends Comparator -{ - /** - * @param string|int $test A comparison string or an integer - * - * @throws \InvalidArgumentException If the test is not understood - */ - public function __construct(?string $test) - { - if (null === $test || !preg_match('#^\s*(==|!=|[<>]=?)?\s*([0-9\.]+)\s*([kmg]i?)?\s*$#i', $test, $matches)) { - throw new \InvalidArgumentException(sprintf('Don\'t understand "%s" as a number test.', $test ?? 'null')); - } - - $target = $matches[2]; - if (!is_numeric($target)) { - throw new \InvalidArgumentException(sprintf('Invalid number "%s".', $target)); - } - if (isset($matches[3])) { - // magnitude - switch (strtolower($matches[3])) { - case 'k': - $target *= 1000; - break; - case 'ki': - $target *= 1024; - break; - case 'm': - $target *= 1000000; - break; - case 'mi': - $target *= 1024 * 1024; - break; - case 'g': - $target *= 1000000000; - break; - case 'gi': - $target *= 1024 * 1024 * 1024; - break; - } - } - - parent::__construct($target, $matches[1] ?: '=='); - } -} diff --git a/vendor/symfony/finder/Exception/AccessDeniedException.php b/vendor/symfony/finder/Exception/AccessDeniedException.php deleted file mode 100644 index ee195ea8..00000000 --- a/vendor/symfony/finder/Exception/AccessDeniedException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Exception; - -/** - * @author Jean-François Simon - */ -class AccessDeniedException extends \UnexpectedValueException -{ -} diff --git a/vendor/symfony/finder/Exception/DirectoryNotFoundException.php b/vendor/symfony/finder/Exception/DirectoryNotFoundException.php deleted file mode 100644 index c6cc0f27..00000000 --- a/vendor/symfony/finder/Exception/DirectoryNotFoundException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Exception; - -/** - * @author Andreas Erhard - */ -class DirectoryNotFoundException extends \InvalidArgumentException -{ -} diff --git a/vendor/symfony/finder/Finder.php b/vendor/symfony/finder/Finder.php deleted file mode 100644 index 7baecdf9..00000000 --- a/vendor/symfony/finder/Finder.php +++ /dev/null @@ -1,846 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder; - -use Symfony\Component\Finder\Comparator\DateComparator; -use Symfony\Component\Finder\Comparator\NumberComparator; -use Symfony\Component\Finder\Exception\DirectoryNotFoundException; -use Symfony\Component\Finder\Iterator\CustomFilterIterator; -use Symfony\Component\Finder\Iterator\DateRangeFilterIterator; -use Symfony\Component\Finder\Iterator\DepthRangeFilterIterator; -use Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator; -use Symfony\Component\Finder\Iterator\FilecontentFilterIterator; -use Symfony\Component\Finder\Iterator\FilenameFilterIterator; -use Symfony\Component\Finder\Iterator\LazyIterator; -use Symfony\Component\Finder\Iterator\SizeRangeFilterIterator; -use Symfony\Component\Finder\Iterator\SortableIterator; - -/** - * Finder allows to build rules to find files and directories. - * - * It is a thin wrapper around several specialized iterator classes. - * - * All rules may be invoked several times. - * - * All methods return the current Finder object to allow chaining: - * - * $finder = Finder::create()->files()->name('*.php')->in(__DIR__); - * - * @author Fabien Potencier - * - * @implements \IteratorAggregate - */ -class Finder implements \IteratorAggregate, \Countable -{ - public const IGNORE_VCS_FILES = 1; - public const IGNORE_DOT_FILES = 2; - public const IGNORE_VCS_IGNORED_FILES = 4; - - private int $mode = 0; - private array $names = []; - private array $notNames = []; - private array $exclude = []; - private array $filters = []; - private array $depths = []; - private array $sizes = []; - private bool $followLinks = false; - private bool $reverseSorting = false; - private \Closure|int|false $sort = false; - private int $ignore = 0; - private array $dirs = []; - private array $dates = []; - private array $iterators = []; - private array $contains = []; - private array $notContains = []; - private array $paths = []; - private array $notPaths = []; - private bool $ignoreUnreadableDirs = false; - - private static array $vcsPatterns = ['.svn', '_svn', 'CVS', '_darcs', '.arch-params', '.monotone', '.bzr', '.git', '.hg']; - - public function __construct() - { - $this->ignore = static::IGNORE_VCS_FILES | static::IGNORE_DOT_FILES; - } - - /** - * Creates a new Finder. - */ - public static function create(): static - { - return new static(); - } - - /** - * Restricts the matching to directories only. - * - * @return $this - */ - public function directories(): static - { - $this->mode = Iterator\FileTypeFilterIterator::ONLY_DIRECTORIES; - - return $this; - } - - /** - * Restricts the matching to files only. - * - * @return $this - */ - public function files(): static - { - $this->mode = Iterator\FileTypeFilterIterator::ONLY_FILES; - - return $this; - } - - /** - * Adds tests for the directory depth. - * - * Usage: - * - * $finder->depth('> 1') // the Finder will start matching at level 1. - * $finder->depth('< 3') // the Finder will descend at most 3 levels of directories below the starting point. - * $finder->depth(['>= 1', '< 3']) - * - * @param string|int|string[]|int[] $levels The depth level expression or an array of depth levels - * - * @return $this - * - * @see DepthRangeFilterIterator - * @see NumberComparator - */ - public function depth(string|int|array $levels): static - { - foreach ((array) $levels as $level) { - $this->depths[] = new Comparator\NumberComparator($level); - } - - return $this; - } - - /** - * Adds tests for file dates (last modified). - * - * The date must be something that strtotime() is able to parse: - * - * $finder->date('since yesterday'); - * $finder->date('until 2 days ago'); - * $finder->date('> now - 2 hours'); - * $finder->date('>= 2005-10-15'); - * $finder->date(['>= 2005-10-15', '<= 2006-05-27']); - * - * @param string|string[] $dates A date range string or an array of date ranges - * - * @return $this - * - * @see strtotime - * @see DateRangeFilterIterator - * @see DateComparator - */ - public function date(string|array $dates): static - { - foreach ((array) $dates as $date) { - $this->dates[] = new Comparator\DateComparator($date); - } - - return $this; - } - - /** - * Adds rules that files must match. - * - * You can use patterns (delimited with / sign), globs or simple strings. - * - * $finder->name('*.php') - * $finder->name('/\.php$/') // same as above - * $finder->name('test.php') - * $finder->name(['test.py', 'test.php']) - * - * @param string|string[] $patterns A pattern (a regexp, a glob, or a string) or an array of patterns - * - * @return $this - * - * @see FilenameFilterIterator - */ - public function name(string|array $patterns): static - { - $this->names = array_merge($this->names, (array) $patterns); - - return $this; - } - - /** - * Adds rules that files must not match. - * - * @param string|string[] $patterns A pattern (a regexp, a glob, or a string) or an array of patterns - * - * @return $this - * - * @see FilenameFilterIterator - */ - public function notName(string|array $patterns): static - { - $this->notNames = array_merge($this->notNames, (array) $patterns); - - return $this; - } - - /** - * Adds tests that file contents must match. - * - * Strings or PCRE patterns can be used: - * - * $finder->contains('Lorem ipsum') - * $finder->contains('/Lorem ipsum/i') - * $finder->contains(['dolor', '/ipsum/i']) - * - * @param string|string[] $patterns A pattern (string or regexp) or an array of patterns - * - * @return $this - * - * @see FilecontentFilterIterator - */ - public function contains(string|array $patterns): static - { - $this->contains = array_merge($this->contains, (array) $patterns); - - return $this; - } - - /** - * Adds tests that file contents must not match. - * - * Strings or PCRE patterns can be used: - * - * $finder->notContains('Lorem ipsum') - * $finder->notContains('/Lorem ipsum/i') - * $finder->notContains(['lorem', '/dolor/i']) - * - * @param string|string[] $patterns A pattern (string or regexp) or an array of patterns - * - * @return $this - * - * @see FilecontentFilterIterator - */ - public function notContains(string|array $patterns): static - { - $this->notContains = array_merge($this->notContains, (array) $patterns); - - return $this; - } - - /** - * Adds rules that filenames must match. - * - * You can use patterns (delimited with / sign) or simple strings. - * - * $finder->path('some/special/dir') - * $finder->path('/some\/special\/dir/') // same as above - * $finder->path(['some dir', 'another/dir']) - * - * Use only / as dirname separator. - * - * @param string|string[] $patterns A pattern (a regexp or a string) or an array of patterns - * - * @return $this - * - * @see FilenameFilterIterator - */ - public function path(string|array $patterns): static - { - $this->paths = array_merge($this->paths, (array) $patterns); - - return $this; - } - - /** - * Adds rules that filenames must not match. - * - * You can use patterns (delimited with / sign) or simple strings. - * - * $finder->notPath('some/special/dir') - * $finder->notPath('/some\/special\/dir/') // same as above - * $finder->notPath(['some/file.txt', 'another/file.log']) - * - * Use only / as dirname separator. - * - * @param string|string[] $patterns A pattern (a regexp or a string) or an array of patterns - * - * @return $this - * - * @see FilenameFilterIterator - */ - public function notPath(string|array $patterns): static - { - $this->notPaths = array_merge($this->notPaths, (array) $patterns); - - return $this; - } - - /** - * Adds tests for file sizes. - * - * $finder->size('> 10K'); - * $finder->size('<= 1Ki'); - * $finder->size(4); - * $finder->size(['> 10K', '< 20K']) - * - * @param string|int|string[]|int[] $sizes A size range string or an integer or an array of size ranges - * - * @return $this - * - * @see SizeRangeFilterIterator - * @see NumberComparator - */ - public function size(string|int|array $sizes): static - { - foreach ((array) $sizes as $size) { - $this->sizes[] = new Comparator\NumberComparator($size); - } - - return $this; - } - - /** - * Excludes directories. - * - * Directories passed as argument must be relative to the ones defined with the `in()` method. For example: - * - * $finder->in(__DIR__)->exclude('ruby'); - * - * @param string|array $dirs A directory path or an array of directories - * - * @return $this - * - * @see ExcludeDirectoryFilterIterator - */ - public function exclude(string|array $dirs): static - { - $this->exclude = array_merge($this->exclude, (array) $dirs); - - return $this; - } - - /** - * Excludes "hidden" directories and files (starting with a dot). - * - * This option is enabled by default. - * - * @return $this - * - * @see ExcludeDirectoryFilterIterator - */ - public function ignoreDotFiles(bool $ignoreDotFiles): static - { - if ($ignoreDotFiles) { - $this->ignore |= static::IGNORE_DOT_FILES; - } else { - $this->ignore &= ~static::IGNORE_DOT_FILES; - } - - return $this; - } - - /** - * Forces the finder to ignore version control directories. - * - * This option is enabled by default. - * - * @return $this - * - * @see ExcludeDirectoryFilterIterator - */ - public function ignoreVCS(bool $ignoreVCS): static - { - if ($ignoreVCS) { - $this->ignore |= static::IGNORE_VCS_FILES; - } else { - $this->ignore &= ~static::IGNORE_VCS_FILES; - } - - return $this; - } - - /** - * Forces Finder to obey .gitignore and ignore files based on rules listed there. - * - * This option is disabled by default. - * - * @return $this - */ - public function ignoreVCSIgnored(bool $ignoreVCSIgnored): static - { - if ($ignoreVCSIgnored) { - $this->ignore |= static::IGNORE_VCS_IGNORED_FILES; - } else { - $this->ignore &= ~static::IGNORE_VCS_IGNORED_FILES; - } - - return $this; - } - - /** - * Adds VCS patterns. - * - * @see ignoreVCS() - * - * @param string|string[] $pattern VCS patterns to ignore - */ - public static function addVCSPattern(string|array $pattern) - { - foreach ((array) $pattern as $p) { - self::$vcsPatterns[] = $p; - } - - self::$vcsPatterns = array_unique(self::$vcsPatterns); - } - - /** - * Sorts files and directories by an anonymous function. - * - * The anonymous function receives two \SplFileInfo instances to compare. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sort(\Closure $closure): static - { - $this->sort = $closure; - - return $this; - } - - /** - * Sorts files and directories by extension. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByExtension(): static - { - $this->sort = Iterator\SortableIterator::SORT_BY_EXTENSION; - - return $this; - } - - /** - * Sorts files and directories by name. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByName(bool $useNaturalSort = false): static - { - $this->sort = $useNaturalSort ? Iterator\SortableIterator::SORT_BY_NAME_NATURAL : Iterator\SortableIterator::SORT_BY_NAME; - - return $this; - } - - /** - * Sorts files and directories by name case insensitive. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByCaseInsensitiveName(bool $useNaturalSort = false): static - { - $this->sort = $useNaturalSort ? Iterator\SortableIterator::SORT_BY_NAME_NATURAL_CASE_INSENSITIVE : Iterator\SortableIterator::SORT_BY_NAME_CASE_INSENSITIVE; - - return $this; - } - - /** - * Sorts files and directories by size. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortBySize(): static - { - $this->sort = Iterator\SortableIterator::SORT_BY_SIZE; - - return $this; - } - - /** - * Sorts files and directories by type (directories before files), then by name. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByType(): static - { - $this->sort = Iterator\SortableIterator::SORT_BY_TYPE; - - return $this; - } - - /** - * Sorts files and directories by the last accessed time. - * - * This is the time that the file was last accessed, read or written to. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByAccessedTime(): static - { - $this->sort = Iterator\SortableIterator::SORT_BY_ACCESSED_TIME; - - return $this; - } - - /** - * Reverses the sorting. - * - * @return $this - */ - public function reverseSorting(): static - { - $this->reverseSorting = true; - - return $this; - } - - /** - * Sorts files and directories by the last inode changed time. - * - * This is the time that the inode information was last modified (permissions, owner, group or other metadata). - * - * On Windows, since inode is not available, changed time is actually the file creation time. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByChangedTime(): static - { - $this->sort = Iterator\SortableIterator::SORT_BY_CHANGED_TIME; - - return $this; - } - - /** - * Sorts files and directories by the last modified time. - * - * This is the last time the actual contents of the file were last modified. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByModifiedTime(): static - { - $this->sort = Iterator\SortableIterator::SORT_BY_MODIFIED_TIME; - - return $this; - } - - /** - * Filters the iterator with an anonymous function. - * - * The anonymous function receives a \SplFileInfo and must return false - * to remove files. - * - * @return $this - * - * @see CustomFilterIterator - */ - public function filter(\Closure $closure): static - { - $this->filters[] = $closure; - - return $this; - } - - /** - * Forces the following of symlinks. - * - * @return $this - */ - public function followLinks(): static - { - $this->followLinks = true; - - return $this; - } - - /** - * Tells finder to ignore unreadable directories. - * - * By default, scanning unreadable directories content throws an AccessDeniedException. - * - * @return $this - */ - public function ignoreUnreadableDirs(bool $ignore = true): static - { - $this->ignoreUnreadableDirs = $ignore; - - return $this; - } - - /** - * Searches files and directories which match defined rules. - * - * @param string|string[] $dirs A directory path or an array of directories - * - * @return $this - * - * @throws DirectoryNotFoundException if one of the directories does not exist - */ - public function in(string|array $dirs): static - { - $resolvedDirs = []; - - foreach ((array) $dirs as $dir) { - if (is_dir($dir)) { - $resolvedDirs[] = [$this->normalizeDir($dir)]; - } elseif ($glob = glob($dir, (\defined('GLOB_BRACE') ? \GLOB_BRACE : 0) | \GLOB_ONLYDIR | \GLOB_NOSORT)) { - sort($glob); - $resolvedDirs[] = array_map($this->normalizeDir(...), $glob); - } else { - throw new DirectoryNotFoundException(sprintf('The "%s" directory does not exist.', $dir)); - } - } - - $this->dirs = array_merge($this->dirs, ...$resolvedDirs); - - return $this; - } - - /** - * Returns an Iterator for the current Finder configuration. - * - * This method implements the IteratorAggregate interface. - * - * @return \Iterator - * - * @throws \LogicException if the in() method has not been called - */ - public function getIterator(): \Iterator - { - if (0 === \count($this->dirs) && 0 === \count($this->iterators)) { - throw new \LogicException('You must call one of in() or append() methods before iterating over a Finder.'); - } - - if (1 === \count($this->dirs) && 0 === \count($this->iterators)) { - $iterator = $this->searchInDirectory($this->dirs[0]); - - if ($this->sort || $this->reverseSorting) { - $iterator = (new Iterator\SortableIterator($iterator, $this->sort, $this->reverseSorting))->getIterator(); - } - - return $iterator; - } - - $iterator = new \AppendIterator(); - foreach ($this->dirs as $dir) { - $iterator->append(new \IteratorIterator(new LazyIterator(function () use ($dir) { - return $this->searchInDirectory($dir); - }))); - } - - foreach ($this->iterators as $it) { - $iterator->append($it); - } - - if ($this->sort || $this->reverseSorting) { - $iterator = (new Iterator\SortableIterator($iterator, $this->sort, $this->reverseSorting))->getIterator(); - } - - return $iterator; - } - - /** - * Appends an existing set of files/directories to the finder. - * - * The set can be another Finder, an Iterator, an IteratorAggregate, or even a plain array. - * - * @return $this - * - * @throws \InvalidArgumentException when the given argument is not iterable - */ - public function append(iterable $iterator): static - { - if ($iterator instanceof \IteratorAggregate) { - $this->iterators[] = $iterator->getIterator(); - } elseif ($iterator instanceof \Iterator) { - $this->iterators[] = $iterator; - } elseif (is_iterable($iterator)) { - $it = new \ArrayIterator(); - foreach ($iterator as $file) { - $file = $file instanceof \SplFileInfo ? $file : new \SplFileInfo($file); - $it[$file->getPathname()] = $file; - } - $this->iterators[] = $it; - } else { - throw new \InvalidArgumentException('Finder::append() method wrong argument type.'); - } - - return $this; - } - - /** - * Check if any results were found. - */ - public function hasResults(): bool - { - foreach ($this->getIterator() as $_) { - return true; - } - - return false; - } - - /** - * Counts all the results collected by the iterators. - */ - public function count(): int - { - return iterator_count($this->getIterator()); - } - - private function searchInDirectory(string $dir): \Iterator - { - $exclude = $this->exclude; - $notPaths = $this->notPaths; - - if (static::IGNORE_VCS_FILES === (static::IGNORE_VCS_FILES & $this->ignore)) { - $exclude = array_merge($exclude, self::$vcsPatterns); - } - - if (static::IGNORE_DOT_FILES === (static::IGNORE_DOT_FILES & $this->ignore)) { - $notPaths[] = '#(^|/)\..+(/|$)#'; - } - - $minDepth = 0; - $maxDepth = \PHP_INT_MAX; - - foreach ($this->depths as $comparator) { - switch ($comparator->getOperator()) { - case '>': - $minDepth = $comparator->getTarget() + 1; - break; - case '>=': - $minDepth = $comparator->getTarget(); - break; - case '<': - $maxDepth = $comparator->getTarget() - 1; - break; - case '<=': - $maxDepth = $comparator->getTarget(); - break; - default: - $minDepth = $maxDepth = $comparator->getTarget(); - } - } - - $flags = \RecursiveDirectoryIterator::SKIP_DOTS; - - if ($this->followLinks) { - $flags |= \RecursiveDirectoryIterator::FOLLOW_SYMLINKS; - } - - $iterator = new Iterator\RecursiveDirectoryIterator($dir, $flags, $this->ignoreUnreadableDirs); - - if ($exclude) { - $iterator = new Iterator\ExcludeDirectoryFilterIterator($iterator, $exclude); - } - - $iterator = new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIterator::SELF_FIRST); - - if ($minDepth > 0 || $maxDepth < \PHP_INT_MAX) { - $iterator = new Iterator\DepthRangeFilterIterator($iterator, $minDepth, $maxDepth); - } - - if ($this->mode) { - $iterator = new Iterator\FileTypeFilterIterator($iterator, $this->mode); - } - - if ($this->names || $this->notNames) { - $iterator = new Iterator\FilenameFilterIterator($iterator, $this->names, $this->notNames); - } - - if ($this->contains || $this->notContains) { - $iterator = new Iterator\FilecontentFilterIterator($iterator, $this->contains, $this->notContains); - } - - if ($this->sizes) { - $iterator = new Iterator\SizeRangeFilterIterator($iterator, $this->sizes); - } - - if ($this->dates) { - $iterator = new Iterator\DateRangeFilterIterator($iterator, $this->dates); - } - - if ($this->filters) { - $iterator = new Iterator\CustomFilterIterator($iterator, $this->filters); - } - - if ($this->paths || $notPaths) { - $iterator = new Iterator\PathFilterIterator($iterator, $this->paths, $notPaths); - } - - if (static::IGNORE_VCS_IGNORED_FILES === (static::IGNORE_VCS_IGNORED_FILES & $this->ignore)) { - $iterator = new Iterator\VcsIgnoredFilterIterator($iterator, $dir); - } - - return $iterator; - } - - /** - * Normalizes given directory names by removing trailing slashes. - * - * Excluding: (s)ftp:// or ssh2.(s)ftp:// wrapper - */ - private function normalizeDir(string $dir): string - { - if ('/' === $dir) { - return $dir; - } - - $dir = rtrim($dir, '/'.\DIRECTORY_SEPARATOR); - - if (preg_match('#^(ssh2\.)?s?ftp://#', $dir)) { - $dir .= '/'; - } - - return $dir; - } -} diff --git a/vendor/symfony/finder/Gitignore.php b/vendor/symfony/finder/Gitignore.php deleted file mode 100644 index 070074b3..00000000 --- a/vendor/symfony/finder/Gitignore.php +++ /dev/null @@ -1,93 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder; - -/** - * Gitignore matches against text. - * - * @author Michael Voříšek - * @author Ahmed Abdou - */ -class Gitignore -{ - /** - * Returns a regexp which is the equivalent of the gitignore pattern. - * - * Format specification: https://git-scm.com/docs/gitignore#_pattern_format - */ - public static function toRegex(string $gitignoreFileContent): string - { - return self::buildRegex($gitignoreFileContent, false); - } - - public static function toRegexMatchingNegatedPatterns(string $gitignoreFileContent): string - { - return self::buildRegex($gitignoreFileContent, true); - } - - private static function buildRegex(string $gitignoreFileContent, bool $inverted): string - { - $gitignoreFileContent = preg_replace('~(? - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder; - -/** - * Glob matches globbing patterns against text. - * - * if match_glob("foo.*", "foo.bar") echo "matched\n"; - * - * // prints foo.bar and foo.baz - * $regex = glob_to_regex("foo.*"); - * for (['foo.bar', 'foo.baz', 'foo', 'bar'] as $t) - * { - * if (/$regex/) echo "matched: $car\n"; - * } - * - * Glob implements glob(3) style matching that can be used to match - * against text, rather than fetching names from a filesystem. - * - * Based on the Perl Text::Glob module. - * - * @author Fabien Potencier PHP port - * @author Richard Clamp Perl version - * @copyright 2004-2005 Fabien Potencier - * @copyright 2002 Richard Clamp - */ -class Glob -{ - /** - * Returns a regexp which is the equivalent of the glob pattern. - */ - public static function toRegex(string $glob, bool $strictLeadingDot = true, bool $strictWildcardSlash = true, string $delimiter = '#'): string - { - $firstByte = true; - $escaping = false; - $inCurlies = 0; - $regex = ''; - $sizeGlob = \strlen($glob); - for ($i = 0; $i < $sizeGlob; ++$i) { - $car = $glob[$i]; - if ($firstByte && $strictLeadingDot && '.' !== $car) { - $regex .= '(?=[^\.])'; - } - - $firstByte = '/' === $car; - - if ($firstByte && $strictWildcardSlash && isset($glob[$i + 2]) && '**' === $glob[$i + 1].$glob[$i + 2] && (!isset($glob[$i + 3]) || '/' === $glob[$i + 3])) { - $car = '[^/]++/'; - if (!isset($glob[$i + 3])) { - $car .= '?'; - } - - if ($strictLeadingDot) { - $car = '(?=[^\.])'.$car; - } - - $car = '/(?:'.$car.')*'; - $i += 2 + isset($glob[$i + 3]); - - if ('/' === $delimiter) { - $car = str_replace('/', '\\/', $car); - } - } - - if ($delimiter === $car || '.' === $car || '(' === $car || ')' === $car || '|' === $car || '+' === $car || '^' === $car || '$' === $car) { - $regex .= "\\$car"; - } elseif ('*' === $car) { - $regex .= $escaping ? '\\*' : ($strictWildcardSlash ? '[^/]*' : '.*'); - } elseif ('?' === $car) { - $regex .= $escaping ? '\\?' : ($strictWildcardSlash ? '[^/]' : '.'); - } elseif ('{' === $car) { - $regex .= $escaping ? '\\{' : '('; - if (!$escaping) { - ++$inCurlies; - } - } elseif ('}' === $car && $inCurlies) { - $regex .= $escaping ? '}' : ')'; - if (!$escaping) { - --$inCurlies; - } - } elseif (',' === $car && $inCurlies) { - $regex .= $escaping ? ',' : '|'; - } elseif ('\\' === $car) { - if ($escaping) { - $regex .= '\\\\'; - $escaping = false; - } else { - $escaping = true; - } - - continue; - } else { - $regex .= $car; - } - $escaping = false; - } - - return $delimiter.'^'.$regex.'$'.$delimiter; - } -} diff --git a/vendor/symfony/finder/Iterator/CustomFilterIterator.php b/vendor/symfony/finder/Iterator/CustomFilterIterator.php deleted file mode 100644 index 82ee81d8..00000000 --- a/vendor/symfony/finder/Iterator/CustomFilterIterator.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * CustomFilterIterator filters files by applying anonymous functions. - * - * The anonymous function receives a \SplFileInfo and must return false - * to remove files. - * - * @author Fabien Potencier - * - * @extends \FilterIterator - */ -class CustomFilterIterator extends \FilterIterator -{ - private array $filters = []; - - /** - * @param \Iterator $iterator The Iterator to filter - * @param callable[] $filters An array of PHP callbacks - * - * @throws \InvalidArgumentException - */ - public function __construct(\Iterator $iterator, array $filters) - { - foreach ($filters as $filter) { - if (!\is_callable($filter)) { - throw new \InvalidArgumentException('Invalid PHP callback.'); - } - } - $this->filters = $filters; - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - */ - public function accept(): bool - { - $fileinfo = $this->current(); - - foreach ($this->filters as $filter) { - if (false === $filter($fileinfo)) { - return false; - } - } - - return true; - } -} diff --git a/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php b/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php deleted file mode 100644 index 718d42b1..00000000 --- a/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Comparator\DateComparator; - -/** - * DateRangeFilterIterator filters out files that are not in the given date range (last modified dates). - * - * @author Fabien Potencier - * - * @extends \FilterIterator - */ -class DateRangeFilterIterator extends \FilterIterator -{ - private array $comparators = []; - - /** - * @param \Iterator $iterator - * @param DateComparator[] $comparators - */ - public function __construct(\Iterator $iterator, array $comparators) - { - $this->comparators = $comparators; - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - */ - public function accept(): bool - { - $fileinfo = $this->current(); - - if (!file_exists($fileinfo->getPathname())) { - return false; - } - - $filedate = $fileinfo->getMTime(); - foreach ($this->comparators as $compare) { - if (!$compare->test($filedate)) { - return false; - } - } - - return true; - } -} diff --git a/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php b/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php deleted file mode 100644 index 1cddb5fa..00000000 --- a/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * DepthRangeFilterIterator limits the directory depth. - * - * @author Fabien Potencier - * - * @template-covariant TKey - * @template-covariant TValue - * - * @extends \FilterIterator - */ -class DepthRangeFilterIterator extends \FilterIterator -{ - private int $minDepth = 0; - - /** - * @param \RecursiveIteratorIterator<\RecursiveIterator> $iterator The Iterator to filter - * @param int $minDepth The min depth - * @param int $maxDepth The max depth - */ - public function __construct(\RecursiveIteratorIterator $iterator, int $minDepth = 0, int $maxDepth = \PHP_INT_MAX) - { - $this->minDepth = $minDepth; - $iterator->setMaxDepth(\PHP_INT_MAX === $maxDepth ? -1 : $maxDepth); - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - */ - public function accept(): bool - { - return $this->getInnerIterator()->getDepth() >= $this->minDepth; - } -} diff --git a/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php b/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php deleted file mode 100644 index efe9364f..00000000 --- a/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.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\Finder\Iterator; - -use Symfony\Component\Finder\SplFileInfo; - -/** - * ExcludeDirectoryFilterIterator filters out directories. - * - * @author Fabien Potencier - * - * @extends \FilterIterator - * @implements \RecursiveIterator - */ -class ExcludeDirectoryFilterIterator extends \FilterIterator implements \RecursiveIterator -{ - /** @var \Iterator */ - private \Iterator $iterator; - private bool $isRecursive; - private array $excludedDirs = []; - private ?string $excludedPattern = null; - - /** - * @param \Iterator $iterator The Iterator to filter - * @param string[] $directories An array of directories to exclude - */ - public function __construct(\Iterator $iterator, array $directories) - { - $this->iterator = $iterator; - $this->isRecursive = $iterator instanceof \RecursiveIterator; - $patterns = []; - foreach ($directories as $directory) { - $directory = rtrim($directory, '/'); - if (!$this->isRecursive || str_contains($directory, '/')) { - $patterns[] = preg_quote($directory, '#'); - } else { - $this->excludedDirs[$directory] = true; - } - } - if ($patterns) { - $this->excludedPattern = '#(?:^|/)(?:'.implode('|', $patterns).')(?:/|$)#'; - } - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - */ - public function accept(): bool - { - if ($this->isRecursive && isset($this->excludedDirs[$this->getFilename()]) && $this->isDir()) { - return false; - } - - if ($this->excludedPattern) { - $path = $this->isDir() ? $this->current()->getRelativePathname() : $this->current()->getRelativePath(); - $path = str_replace('\\', '/', $path); - - return !preg_match($this->excludedPattern, $path); - } - - return true; - } - - public function hasChildren(): bool - { - return $this->isRecursive && $this->iterator->hasChildren(); - } - - public function getChildren(): self - { - $children = new self($this->iterator->getChildren(), []); - $children->excludedDirs = $this->excludedDirs; - $children->excludedPattern = $this->excludedPattern; - - return $children; - } -} diff --git a/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php b/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php deleted file mode 100644 index 21303781..00000000 --- a/vendor/symfony/finder/Iterator/FileTypeFilterIterator.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\Finder\Iterator; - -/** - * FileTypeFilterIterator only keeps files, directories, or both. - * - * @author Fabien Potencier - * - * @extends \FilterIterator - */ -class FileTypeFilterIterator extends \FilterIterator -{ - public const ONLY_FILES = 1; - public const ONLY_DIRECTORIES = 2; - - private int $mode; - - /** - * @param \Iterator $iterator The Iterator to filter - * @param int $mode The mode (self::ONLY_FILES or self::ONLY_DIRECTORIES) - */ - public function __construct(\Iterator $iterator, int $mode) - { - $this->mode = $mode; - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - */ - public function accept(): bool - { - $fileinfo = $this->current(); - if (self::ONLY_DIRECTORIES === (self::ONLY_DIRECTORIES & $this->mode) && $fileinfo->isFile()) { - return false; - } elseif (self::ONLY_FILES === (self::ONLY_FILES & $this->mode) && $fileinfo->isDir()) { - return false; - } - - return true; - } -} diff --git a/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php b/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php deleted file mode 100644 index bdc71ffd..00000000 --- a/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\SplFileInfo; - -/** - * FilecontentFilterIterator filters files by their contents using patterns (regexps or strings). - * - * @author Fabien Potencier - * @author Włodzimierz Gajda - * - * @extends MultiplePcreFilterIterator - */ -class FilecontentFilterIterator extends MultiplePcreFilterIterator -{ - /** - * Filters the iterator values. - */ - public function accept(): bool - { - if (!$this->matchRegexps && !$this->noMatchRegexps) { - return true; - } - - $fileinfo = $this->current(); - - if ($fileinfo->isDir() || !$fileinfo->isReadable()) { - return false; - } - - $content = $fileinfo->getContents(); - if (!$content) { - return false; - } - - return $this->isAccepted($content); - } - - /** - * Converts string to regexp if necessary. - * - * @param string $str Pattern: string or regexp - */ - protected function toRegex(string $str): string - { - return $this->isRegex($str) ? $str : '/'.preg_quote($str, '/').'/'; - } -} diff --git a/vendor/symfony/finder/Iterator/FilenameFilterIterator.php b/vendor/symfony/finder/Iterator/FilenameFilterIterator.php deleted file mode 100644 index 05d95358..00000000 --- a/vendor/symfony/finder/Iterator/FilenameFilterIterator.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Glob; - -/** - * FilenameFilterIterator filters files by patterns (a regexp, a glob, or a string). - * - * @author Fabien Potencier - * - * @extends MultiplePcreFilterIterator - */ -class FilenameFilterIterator extends MultiplePcreFilterIterator -{ - /** - * Filters the iterator values. - */ - public function accept(): bool - { - return $this->isAccepted($this->current()->getFilename()); - } - - /** - * Converts glob to regexp. - * - * PCRE patterns are left unchanged. - * Glob strings are transformed with Glob::toRegex(). - * - * @param string $str Pattern: glob or regexp - */ - protected function toRegex(string $str): string - { - return $this->isRegex($str) ? $str : Glob::toRegex($str); - } -} diff --git a/vendor/symfony/finder/Iterator/LazyIterator.php b/vendor/symfony/finder/Iterator/LazyIterator.php deleted file mode 100644 index 5b5806be..00000000 --- a/vendor/symfony/finder/Iterator/LazyIterator.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\Finder\Iterator; - -/** - * @author Jérémy Derussé - * - * @internal - */ -class LazyIterator implements \IteratorAggregate -{ - private \Closure $iteratorFactory; - - public function __construct(callable $iteratorFactory) - { - $this->iteratorFactory = $iteratorFactory(...); - } - - public function getIterator(): \Traversable - { - yield from ($this->iteratorFactory)(); - } -} diff --git a/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php b/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php deleted file mode 100644 index 82a9df30..00000000 --- a/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php +++ /dev/null @@ -1,111 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * MultiplePcreFilterIterator filters files using patterns (regexps, globs or strings). - * - * @author Fabien Potencier - * - * @template-covariant TKey - * @template-covariant TValue - * - * @extends \FilterIterator - */ -abstract class MultiplePcreFilterIterator extends \FilterIterator -{ - protected $matchRegexps = []; - protected $noMatchRegexps = []; - - /** - * @param \Iterator $iterator The Iterator to filter - * @param string[] $matchPatterns An array of patterns that need to match - * @param string[] $noMatchPatterns An array of patterns that need to not match - */ - public function __construct(\Iterator $iterator, array $matchPatterns, array $noMatchPatterns) - { - foreach ($matchPatterns as $pattern) { - $this->matchRegexps[] = $this->toRegex($pattern); - } - - foreach ($noMatchPatterns as $pattern) { - $this->noMatchRegexps[] = $this->toRegex($pattern); - } - - parent::__construct($iterator); - } - - /** - * Checks whether the string is accepted by the regex filters. - * - * If there is no regexps defined in the class, this method will accept the string. - * Such case can be handled by child classes before calling the method if they want to - * apply a different behavior. - */ - protected function isAccepted(string $string): bool - { - // should at least not match one rule to exclude - foreach ($this->noMatchRegexps as $regex) { - if (preg_match($regex, $string)) { - return false; - } - } - - // should at least match one rule - if ($this->matchRegexps) { - foreach ($this->matchRegexps as $regex) { - if (preg_match($regex, $string)) { - return true; - } - } - - return false; - } - - // If there is no match rules, the file is accepted - return true; - } - - /** - * Checks whether the string is a regex. - */ - protected function isRegex(string $str): bool - { - $availableModifiers = 'imsxuADU'; - - if (\PHP_VERSION_ID >= 80200) { - $availableModifiers .= 'n'; - } - - if (preg_match('/^(.{3,}?)['.$availableModifiers.']*$/', $str, $m)) { - $start = substr($m[1], 0, 1); - $end = substr($m[1], -1); - - if ($start === $end) { - return !preg_match('/[*?[:alnum:] \\\\]/', $start); - } - - foreach ([['{', '}'], ['(', ')'], ['[', ']'], ['<', '>']] as $delimiters) { - if ($start === $delimiters[0] && $end === $delimiters[1]) { - return true; - } - } - } - - return false; - } - - /** - * Converts string into regexp. - */ - abstract protected function toRegex(string $str): string; -} diff --git a/vendor/symfony/finder/Iterator/PathFilterIterator.php b/vendor/symfony/finder/Iterator/PathFilterIterator.php deleted file mode 100644 index c6d58139..00000000 --- a/vendor/symfony/finder/Iterator/PathFilterIterator.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\Finder\Iterator; - -use Symfony\Component\Finder\SplFileInfo; - -/** - * PathFilterIterator filters files by path patterns (e.g. some/special/dir). - * - * @author Fabien Potencier - * @author Włodzimierz Gajda - * - * @extends MultiplePcreFilterIterator - */ -class PathFilterIterator extends MultiplePcreFilterIterator -{ - /** - * Filters the iterator values. - */ - public function accept(): bool - { - $filename = $this->current()->getRelativePathname(); - - if ('\\' === \DIRECTORY_SEPARATOR) { - $filename = str_replace('\\', '/', $filename); - } - - return $this->isAccepted($filename); - } - - /** - * Converts strings to regexp. - * - * PCRE patterns are left unchanged. - * - * Default conversion: - * 'lorem/ipsum/dolor' ==> 'lorem\/ipsum\/dolor/' - * - * Use only / as directory separator (on Windows also). - * - * @param string $str Pattern: regexp or dirname - */ - protected function toRegex(string $str): string - { - return $this->isRegex($str) ? $str : '/'.preg_quote($str, '/').'/'; - } -} diff --git a/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php b/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php deleted file mode 100644 index c321aee7..00000000 --- a/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php +++ /dev/null @@ -1,146 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Exception\AccessDeniedException; -use Symfony\Component\Finder\SplFileInfo; - -/** - * Extends the \RecursiveDirectoryIterator to support relative paths. - * - * @author Victor Berchet - * @extends \RecursiveDirectoryIterator - */ -class RecursiveDirectoryIterator extends \RecursiveDirectoryIterator -{ - private bool $ignoreUnreadableDirs; - private ?bool $rewindable = null; - - // these 3 properties take part of the performance optimization to avoid redoing the same work in all iterations - private string $rootPath; - private string $subPath; - private string $directorySeparator = '/'; - - /** - * @throws \RuntimeException - */ - public function __construct(string $path, int $flags, bool $ignoreUnreadableDirs = false) - { - if ($flags & (self::CURRENT_AS_PATHNAME | self::CURRENT_AS_SELF)) { - throw new \RuntimeException('This iterator only support returning current as fileinfo.'); - } - - parent::__construct($path, $flags); - $this->ignoreUnreadableDirs = $ignoreUnreadableDirs; - $this->rootPath = $path; - if ('/' !== \DIRECTORY_SEPARATOR && !($flags & self::UNIX_PATHS)) { - $this->directorySeparator = \DIRECTORY_SEPARATOR; - } - } - - /** - * Return an instance of SplFileInfo with support for relative paths. - */ - public function current(): SplFileInfo - { - // the logic here avoids redoing the same work in all iterations - - if (!isset($this->subPath)) { - $this->subPath = $this->getSubPath(); - } - $subPathname = $this->subPath; - if ('' !== $subPathname) { - $subPathname .= $this->directorySeparator; - } - $subPathname .= $this->getFilename(); - - if ('/' !== $basePath = $this->rootPath) { - $basePath .= $this->directorySeparator; - } - - return new SplFileInfo($basePath.$subPathname, $this->subPath, $subPathname); - } - - public function hasChildren(bool $allowLinks = false): bool - { - $hasChildren = parent::hasChildren($allowLinks); - - if (!$hasChildren || !$this->ignoreUnreadableDirs) { - return $hasChildren; - } - - try { - parent::getChildren(); - - return true; - } catch (\UnexpectedValueException) { - // If directory is unreadable and finder is set to ignore it, skip children - return false; - } - } - - /** - * @throws AccessDeniedException - */ - public function getChildren(): \RecursiveDirectoryIterator - { - try { - $children = parent::getChildren(); - - if ($children instanceof self) { - // parent method will call the constructor with default arguments, so unreadable dirs won't be ignored anymore - $children->ignoreUnreadableDirs = $this->ignoreUnreadableDirs; - - // performance optimization to avoid redoing the same work in all children - $children->rewindable = &$this->rewindable; - $children->rootPath = $this->rootPath; - } - - return $children; - } catch (\UnexpectedValueException $e) { - throw new AccessDeniedException($e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Do nothing for non rewindable stream. - */ - public function rewind(): void - { - if (false === $this->isRewindable()) { - return; - } - - parent::rewind(); - } - - /** - * Checks if the stream is rewindable. - */ - public function isRewindable(): bool - { - if (null !== $this->rewindable) { - return $this->rewindable; - } - - if (false !== $stream = @opendir($this->getPath())) { - $infos = stream_get_meta_data($stream); - closedir($stream); - - if ($infos['seekable']) { - return $this->rewindable = true; - } - } - - return $this->rewindable = false; - } -} diff --git a/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php b/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php deleted file mode 100644 index 925830a2..00000000 --- a/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.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. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Comparator\NumberComparator; - -/** - * SizeRangeFilterIterator filters out files that are not in the given size range. - * - * @author Fabien Potencier - * - * @extends \FilterIterator - */ -class SizeRangeFilterIterator extends \FilterIterator -{ - private array $comparators = []; - - /** - * @param \Iterator $iterator - * @param NumberComparator[] $comparators - */ - public function __construct(\Iterator $iterator, array $comparators) - { - $this->comparators = $comparators; - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - */ - public function accept(): bool - { - $fileinfo = $this->current(); - if (!$fileinfo->isFile()) { - return true; - } - - $filesize = $fileinfo->getSize(); - foreach ($this->comparators as $compare) { - if (!$compare->test($filesize)) { - return false; - } - } - - return true; - } -} diff --git a/vendor/symfony/finder/Iterator/SortableIterator.php b/vendor/symfony/finder/Iterator/SortableIterator.php deleted file mode 100644 index e8b55650..00000000 --- a/vendor/symfony/finder/Iterator/SortableIterator.php +++ /dev/null @@ -1,121 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * SortableIterator applies a sort on a given Iterator. - * - * @author Fabien Potencier - * - * @implements \IteratorAggregate - */ -class SortableIterator implements \IteratorAggregate -{ - public const SORT_BY_NONE = 0; - public const SORT_BY_NAME = 1; - public const SORT_BY_TYPE = 2; - public const SORT_BY_ACCESSED_TIME = 3; - public const SORT_BY_CHANGED_TIME = 4; - public const SORT_BY_MODIFIED_TIME = 5; - public const SORT_BY_NAME_NATURAL = 6; - public const SORT_BY_NAME_CASE_INSENSITIVE = 7; - public const SORT_BY_NAME_NATURAL_CASE_INSENSITIVE = 8; - public const SORT_BY_EXTENSION = 9; - public const SORT_BY_SIZE = 10; - - /** @var \Traversable */ - private \Traversable $iterator; - private \Closure|int $sort; - - /** - * @param \Traversable $iterator - * @param int|callable $sort The sort type (SORT_BY_NAME, SORT_BY_TYPE, or a PHP callback) - * - * @throws \InvalidArgumentException - */ - public function __construct(\Traversable $iterator, int|callable $sort, bool $reverseOrder = false) - { - $this->iterator = $iterator; - $order = $reverseOrder ? -1 : 1; - - if (self::SORT_BY_NAME === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * strcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); - }; - } elseif (self::SORT_BY_NAME_NATURAL === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * strnatcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); - }; - } elseif (self::SORT_BY_NAME_CASE_INSENSITIVE === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * strcasecmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); - }; - } elseif (self::SORT_BY_NAME_NATURAL_CASE_INSENSITIVE === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * strnatcasecmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); - }; - } elseif (self::SORT_BY_TYPE === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - if ($a->isDir() && $b->isFile()) { - return -$order; - } elseif ($a->isFile() && $b->isDir()) { - return $order; - } - - return $order * strcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); - }; - } elseif (self::SORT_BY_ACCESSED_TIME === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * ($a->getATime() - $b->getATime()); - }; - } elseif (self::SORT_BY_CHANGED_TIME === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * ($a->getCTime() - $b->getCTime()); - }; - } elseif (self::SORT_BY_MODIFIED_TIME === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * ($a->getMTime() - $b->getMTime()); - }; - } elseif (self::SORT_BY_EXTENSION === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * strnatcmp($a->getExtension(), $b->getExtension()); - }; - } elseif (self::SORT_BY_SIZE === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * ($a->getSize() - $b->getSize()); - }; - } elseif (self::SORT_BY_NONE === $sort) { - $this->sort = $order; - } elseif (\is_callable($sort)) { - $this->sort = $reverseOrder ? static function (\SplFileInfo $a, \SplFileInfo $b) use ($sort) { return -$sort($a, $b); } : $sort(...); - } else { - throw new \InvalidArgumentException('The SortableIterator takes a PHP callable or a valid built-in sort algorithm as an argument.'); - } - } - - public function getIterator(): \Traversable - { - if (1 === $this->sort) { - return $this->iterator; - } - - $array = iterator_to_array($this->iterator, true); - - if (-1 === $this->sort) { - $array = array_reverse($array); - } else { - uasort($array, $this->sort); - } - - return new \ArrayIterator($array); - } -} diff --git a/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php b/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php deleted file mode 100644 index 29fc2d99..00000000 --- a/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php +++ /dev/null @@ -1,178 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Gitignore; - -/** - * @extends \FilterIterator - */ -final class VcsIgnoredFilterIterator extends \FilterIterator -{ - /** - * @var string - */ - private $baseDir; - - /** - * @var array - */ - private $gitignoreFilesCache = []; - - /** - * @var array - */ - private $ignoredPathsCache = []; - - /** - * @param \Iterator $iterator - */ - public function __construct(\Iterator $iterator, string $baseDir) - { - $this->baseDir = $this->normalizePath($baseDir); - - foreach ($this->parentDirectoriesUpwards($this->baseDir) as $parentDirectory) { - if (@is_dir("{$parentDirectory}/.git")) { - $this->baseDir = $parentDirectory; - break; - } - } - - parent::__construct($iterator); - } - - public function accept(): bool - { - $file = $this->current(); - - $fileRealPath = $this->normalizePath($file->getRealPath()); - - return !$this->isIgnored($fileRealPath); - } - - private function isIgnored(string $fileRealPath): bool - { - if (is_dir($fileRealPath) && !str_ends_with($fileRealPath, '/')) { - $fileRealPath .= '/'; - } - - if (isset($this->ignoredPathsCache[$fileRealPath])) { - return $this->ignoredPathsCache[$fileRealPath]; - } - - $ignored = false; - - foreach ($this->parentDirectoriesDownwards($fileRealPath) as $parentDirectory) { - if ($this->isIgnored($parentDirectory)) { - // rules in ignored directories are ignored, no need to check further. - break; - } - - $fileRelativePath = substr($fileRealPath, \strlen($parentDirectory) + 1); - - if (null === $regexps = $this->readGitignoreFile("{$parentDirectory}/.gitignore")) { - continue; - } - - [$exclusionRegex, $inclusionRegex] = $regexps; - - if (preg_match($exclusionRegex, $fileRelativePath)) { - $ignored = true; - - continue; - } - - if (preg_match($inclusionRegex, $fileRelativePath)) { - $ignored = false; - } - } - - return $this->ignoredPathsCache[$fileRealPath] = $ignored; - } - - /** - * @return list - */ - private function parentDirectoriesUpwards(string $from): array - { - $parentDirectories = []; - - $parentDirectory = $from; - - while (true) { - $newParentDirectory = \dirname($parentDirectory); - - // dirname('/') = '/' - if ($newParentDirectory === $parentDirectory) { - break; - } - - $parentDirectories[] = $parentDirectory = $newParentDirectory; - } - - return $parentDirectories; - } - - private function parentDirectoriesUpTo(string $from, string $upTo): array - { - return array_filter( - $this->parentDirectoriesUpwards($from), - static function (string $directory) use ($upTo): bool { - return str_starts_with($directory, $upTo); - } - ); - } - - /** - * @return list - */ - private function parentDirectoriesDownwards(string $fileRealPath): array - { - return array_reverse( - $this->parentDirectoriesUpTo($fileRealPath, $this->baseDir) - ); - } - - /** - * @return array{0: string, 1: string}|null - */ - private function readGitignoreFile(string $path): ?array - { - if (\array_key_exists($path, $this->gitignoreFilesCache)) { - return $this->gitignoreFilesCache[$path]; - } - - if (!file_exists($path)) { - return $this->gitignoreFilesCache[$path] = null; - } - - if (!is_file($path) || !is_readable($path)) { - throw new \RuntimeException("The \"ignoreVCSIgnored\" option cannot be used by the Finder as the \"{$path}\" file is not readable."); - } - - $gitignoreFileContent = file_get_contents($path); - - return $this->gitignoreFilesCache[$path] = [ - Gitignore::toRegex($gitignoreFileContent), - Gitignore::toRegexMatchingNegatedPatterns($gitignoreFileContent), - ]; - } - - private function normalizePath(string $path): string - { - if ('\\' === \DIRECTORY_SEPARATOR) { - return str_replace('\\', '/', $path); - } - - return $path; - } -} diff --git a/vendor/symfony/finder/LICENSE b/vendor/symfony/finder/LICENSE deleted file mode 100644 index 88bf75bb..00000000 --- a/vendor/symfony/finder/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2022 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/finder/README.md b/vendor/symfony/finder/README.md deleted file mode 100644 index 22bdeb9b..00000000 --- a/vendor/symfony/finder/README.md +++ /dev/null @@ -1,14 +0,0 @@ -Finder Component -================ - -The Finder component finds files and directories via an intuitive fluent -interface. - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/components/finder.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/finder/SplFileInfo.php b/vendor/symfony/finder/SplFileInfo.php deleted file mode 100644 index 867e8e81..00000000 --- a/vendor/symfony/finder/SplFileInfo.php +++ /dev/null @@ -1,82 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder; - -/** - * Extends \SplFileInfo to support relative paths. - * - * @author Fabien Potencier - */ -class SplFileInfo extends \SplFileInfo -{ - private string $relativePath; - private string $relativePathname; - - /** - * @param string $file The file name - * @param string $relativePath The relative path - * @param string $relativePathname The relative path name - */ - public function __construct(string $file, string $relativePath, string $relativePathname) - { - parent::__construct($file); - $this->relativePath = $relativePath; - $this->relativePathname = $relativePathname; - } - - /** - * Returns the relative path. - * - * This path does not contain the file name. - */ - public function getRelativePath(): string - { - return $this->relativePath; - } - - /** - * Returns the relative path name. - * - * This path contains the file name. - */ - public function getRelativePathname(): string - { - return $this->relativePathname; - } - - public function getFilenameWithoutExtension(): string - { - $filename = $this->getFilename(); - - return pathinfo($filename, \PATHINFO_FILENAME); - } - - /** - * Returns the contents of the file. - * - * @throws \RuntimeException - */ - public function getContents(): string - { - set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; }); - try { - $content = file_get_contents($this->getPathname()); - } finally { - restore_error_handler(); - } - if (false === $content) { - throw new \RuntimeException($error); - } - - return $content; - } -} diff --git a/vendor/symfony/finder/composer.json b/vendor/symfony/finder/composer.json deleted file mode 100644 index 06d129c5..00000000 --- a/vendor/symfony/finder/composer.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "symfony/finder", - "type": "library", - "description": "Finds files and directories via an intuitive fluent interface", - "keywords": [], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.1" - }, - "require-dev": { - "symfony/filesystem": "^6.0" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\Finder\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "minimum-stability": "dev" -} diff --git a/vendor/symfony/http-foundation/AcceptHeader.php b/vendor/symfony/http-foundation/AcceptHeader.php deleted file mode 100644 index 180e9604..00000000 --- a/vendor/symfony/http-foundation/AcceptHeader.php +++ /dev/null @@ -1,153 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation; - -// Help opcache.preload discover always-needed symbols -class_exists(AcceptHeaderItem::class); - -/** - * Represents an Accept-* header. - * - * An accept header is compound with a list of items, - * sorted by descending quality. - * - * @author Jean-François Simon - */ -class AcceptHeader -{ - /** - * @var AcceptHeaderItem[] - */ - private array $items = []; - - private bool $sorted = true; - - /** - * @param AcceptHeaderItem[] $items - */ - public function __construct(array $items) - { - foreach ($items as $item) { - $this->add($item); - } - } - - /** - * Builds an AcceptHeader instance from a string. - */ - public static function fromString(?string $headerValue): self - { - $index = 0; - - $parts = HeaderUtils::split($headerValue ?? '', ',;='); - - return new self(array_map(function ($subParts) use (&$index) { - $part = array_shift($subParts); - $attributes = HeaderUtils::combine($subParts); - - $item = new AcceptHeaderItem($part[0], $attributes); - $item->setIndex($index++); - - return $item; - }, $parts)); - } - - /** - * Returns header value's string representation. - */ - public function __toString(): string - { - return implode(',', $this->items); - } - - /** - * Tests if header has given value. - */ - public function has(string $value): bool - { - return isset($this->items[$value]); - } - - /** - * Returns given value's item, if exists. - */ - public function get(string $value): ?AcceptHeaderItem - { - return $this->items[$value] ?? $this->items[explode('/', $value)[0].'/*'] ?? $this->items['*/*'] ?? $this->items['*'] ?? null; - } - - /** - * Adds an item. - * - * @return $this - */ - public function add(AcceptHeaderItem $item): static - { - $this->items[$item->getValue()] = $item; - $this->sorted = false; - - return $this; - } - - /** - * Returns all items. - * - * @return AcceptHeaderItem[] - */ - public function all(): array - { - $this->sort(); - - return $this->items; - } - - /** - * Filters items on their value using given regex. - */ - public function filter(string $pattern): self - { - return new self(array_filter($this->items, function (AcceptHeaderItem $item) use ($pattern) { - return preg_match($pattern, $item->getValue()); - })); - } - - /** - * Returns first item. - */ - public function first(): ?AcceptHeaderItem - { - $this->sort(); - - return $this->items ? reset($this->items) : null; - } - - /** - * Sorts items by descending quality. - */ - private function sort(): void - { - if (!$this->sorted) { - uasort($this->items, function (AcceptHeaderItem $a, AcceptHeaderItem $b) { - $qA = $a->getQuality(); - $qB = $b->getQuality(); - - if ($qA === $qB) { - return $a->getIndex() > $b->getIndex() ? 1 : -1; - } - - return $qA > $qB ? -1 : 1; - }); - - $this->sorted = true; - } - } -} diff --git a/vendor/symfony/http-foundation/AcceptHeaderItem.php b/vendor/symfony/http-foundation/AcceptHeaderItem.php deleted file mode 100644 index 35ecd4ea..00000000 --- a/vendor/symfony/http-foundation/AcceptHeaderItem.php +++ /dev/null @@ -1,159 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation; - -/** - * Represents an Accept-* header item. - * - * @author Jean-François Simon - */ -class AcceptHeaderItem -{ - private string $value; - private float $quality = 1.0; - private int $index = 0; - private array $attributes = []; - - public function __construct(string $value, array $attributes = []) - { - $this->value = $value; - foreach ($attributes as $name => $value) { - $this->setAttribute($name, $value); - } - } - - /** - * Builds an AcceptHeaderInstance instance from a string. - */ - public static function fromString(?string $itemValue): self - { - $parts = HeaderUtils::split($itemValue ?? '', ';='); - - $part = array_shift($parts); - $attributes = HeaderUtils::combine($parts); - - return new self($part[0], $attributes); - } - - /** - * Returns header value's string representation. - */ - public function __toString(): string - { - $string = $this->value.($this->quality < 1 ? ';q='.$this->quality : ''); - if (\count($this->attributes) > 0) { - $string .= '; '.HeaderUtils::toString($this->attributes, ';'); - } - - return $string; - } - - /** - * Set the item value. - * - * @return $this - */ - public function setValue(string $value): static - { - $this->value = $value; - - return $this; - } - - /** - * Returns the item value. - */ - public function getValue(): string - { - return $this->value; - } - - /** - * Set the item quality. - * - * @return $this - */ - public function setQuality(float $quality): static - { - $this->quality = $quality; - - return $this; - } - - /** - * Returns the item quality. - */ - public function getQuality(): float - { - return $this->quality; - } - - /** - * Set the item index. - * - * @return $this - */ - public function setIndex(int $index): static - { - $this->index = $index; - - return $this; - } - - /** - * Returns the item index. - */ - public function getIndex(): int - { - return $this->index; - } - - /** - * Tests if an attribute exists. - */ - public function hasAttribute(string $name): bool - { - return isset($this->attributes[$name]); - } - - /** - * Returns an attribute by its name. - */ - public function getAttribute(string $name, mixed $default = null): mixed - { - return $this->attributes[$name] ?? $default; - } - - /** - * Returns all attributes. - */ - public function getAttributes(): array - { - return $this->attributes; - } - - /** - * Set an attribute. - * - * @return $this - */ - public function setAttribute(string $name, string $value): static - { - if ('q' === $name) { - $this->quality = (float) $value; - } else { - $this->attributes[$name] = $value; - } - - return $this; - } -} diff --git a/vendor/symfony/http-foundation/BinaryFileResponse.php b/vendor/symfony/http-foundation/BinaryFileResponse.php deleted file mode 100644 index ad2cbda6..00000000 --- a/vendor/symfony/http-foundation/BinaryFileResponse.php +++ /dev/null @@ -1,372 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation; - -use Symfony\Component\HttpFoundation\File\Exception\FileException; -use Symfony\Component\HttpFoundation\File\File; - -/** - * BinaryFileResponse represents an HTTP response delivering a file. - * - * @author Niklas Fiekas - * @author stealth35 - * @author Igor Wiedler - * @author Jordan Alliot - * @author Sergey Linnik - */ -class BinaryFileResponse extends Response -{ - protected static $trustXSendfileTypeHeader = false; - - /** - * @var File - */ - protected $file; - protected $offset = 0; - protected $maxlen = -1; - protected $deleteFileAfterSend = false; - protected $chunkSize = 8 * 1024; - - /** - * @param \SplFileInfo|string $file The file to stream - * @param int $status The response status code (200 "OK" by default) - * @param array $headers An array of response headers - * @param bool $public Files are public by default - * @param string|null $contentDisposition The type of Content-Disposition to set automatically with the filename - * @param bool $autoEtag Whether the ETag header should be automatically set - * @param bool $autoLastModified Whether the Last-Modified header should be automatically set - */ - public function __construct(\SplFileInfo|string $file, int $status = 200, array $headers = [], bool $public = true, string $contentDisposition = null, bool $autoEtag = false, bool $autoLastModified = true) - { - parent::__construct(null, $status, $headers); - - $this->setFile($file, $contentDisposition, $autoEtag, $autoLastModified); - - if ($public) { - $this->setPublic(); - } - } - - /** - * Sets the file to stream. - * - * @return $this - * - * @throws FileException - */ - public function setFile(\SplFileInfo|string $file, string $contentDisposition = null, bool $autoEtag = false, bool $autoLastModified = true): static - { - if (!$file instanceof File) { - if ($file instanceof \SplFileInfo) { - $file = new File($file->getPathname()); - } else { - $file = new File((string) $file); - } - } - - if (!$file->isReadable()) { - throw new FileException('File must be readable.'); - } - - $this->file = $file; - - if ($autoEtag) { - $this->setAutoEtag(); - } - - if ($autoLastModified) { - $this->setAutoLastModified(); - } - - if ($contentDisposition) { - $this->setContentDisposition($contentDisposition); - } - - return $this; - } - - /** - * Gets the file. - */ - public function getFile(): File - { - return $this->file; - } - - /** - * Sets the response stream chunk size. - * - * @return $this - */ - public function setChunkSize(int $chunkSize): static - { - if ($chunkSize < 1 || $chunkSize > \PHP_INT_MAX) { - throw new \LogicException('The chunk size of a BinaryFileResponse cannot be less than 1 or greater than PHP_INT_MAX.'); - } - - $this->chunkSize = $chunkSize; - - return $this; - } - - /** - * Automatically sets the Last-Modified header according the file modification date. - * - * @return $this - */ - public function setAutoLastModified(): static - { - $this->setLastModified(\DateTime::createFromFormat('U', $this->file->getMTime())); - - return $this; - } - - /** - * Automatically sets the ETag header according to the checksum of the file. - * - * @return $this - */ - public function setAutoEtag(): static - { - $this->setEtag(base64_encode(hash_file('sha256', $this->file->getPathname(), true))); - - return $this; - } - - /** - * Sets the Content-Disposition header with the given filename. - * - * @param string $disposition ResponseHeaderBag::DISPOSITION_INLINE or ResponseHeaderBag::DISPOSITION_ATTACHMENT - * @param string $filename Optionally use this UTF-8 encoded filename instead of the real name of the file - * @param string $filenameFallback A fallback filename, containing only ASCII characters. Defaults to an automatically encoded filename - * - * @return $this - */ - public function setContentDisposition(string $disposition, string $filename = '', string $filenameFallback = ''): static - { - if ('' === $filename) { - $filename = $this->file->getFilename(); - } - - if ('' === $filenameFallback && (!preg_match('/^[\x20-\x7e]*$/', $filename) || str_contains($filename, '%'))) { - $encoding = mb_detect_encoding($filename, null, true) ?: '8bit'; - - for ($i = 0, $filenameLength = mb_strlen($filename, $encoding); $i < $filenameLength; ++$i) { - $char = mb_substr($filename, $i, 1, $encoding); - - if ('%' === $char || \ord($char) < 32 || \ord($char) > 126) { - $filenameFallback .= '_'; - } else { - $filenameFallback .= $char; - } - } - } - - $dispositionHeader = $this->headers->makeDisposition($disposition, $filename, $filenameFallback); - $this->headers->set('Content-Disposition', $dispositionHeader); - - return $this; - } - - public function prepare(Request $request): static - { - if ($this->isInformational() || $this->isEmpty()) { - parent::prepare($request); - - $this->maxlen = 0; - - return $this; - } - - if (!$this->headers->has('Content-Type')) { - $this->headers->set('Content-Type', $this->file->getMimeType() ?: 'application/octet-stream'); - } - - parent::prepare($request); - - $this->offset = 0; - $this->maxlen = -1; - - if (false === $fileSize = $this->file->getSize()) { - return $this; - } - $this->headers->remove('Transfer-Encoding'); - $this->headers->set('Content-Length', $fileSize); - - if (!$this->headers->has('Accept-Ranges')) { - // Only accept ranges on safe HTTP methods - $this->headers->set('Accept-Ranges', $request->isMethodSafe() ? 'bytes' : 'none'); - } - - if (self::$trustXSendfileTypeHeader && $request->headers->has('X-Sendfile-Type')) { - // Use X-Sendfile, do not send any content. - $type = $request->headers->get('X-Sendfile-Type'); - $path = $this->file->getRealPath(); - // Fall back to scheme://path for stream wrapped locations. - if (false === $path) { - $path = $this->file->getPathname(); - } - if ('x-accel-redirect' === strtolower($type)) { - // Do X-Accel-Mapping substitutions. - // @link https://www.nginx.com/resources/wiki/start/topics/examples/x-accel/#x-accel-redirect - $parts = HeaderUtils::split($request->headers->get('X-Accel-Mapping', ''), ',='); - foreach ($parts as $part) { - [$pathPrefix, $location] = $part; - if (str_starts_with($path, $pathPrefix)) { - $path = $location.substr($path, \strlen($pathPrefix)); - // Only set X-Accel-Redirect header if a valid URI can be produced - // as nginx does not serve arbitrary file paths. - $this->headers->set($type, $path); - $this->maxlen = 0; - break; - } - } - } else { - $this->headers->set($type, $path); - $this->maxlen = 0; - } - } elseif ($request->headers->has('Range') && $request->isMethod('GET')) { - // Process the range headers. - if (!$request->headers->has('If-Range') || $this->hasValidIfRangeHeader($request->headers->get('If-Range'))) { - $range = $request->headers->get('Range'); - - if (str_starts_with($range, 'bytes=')) { - [$start, $end] = explode('-', substr($range, 6), 2) + [0]; - - $end = ('' === $end) ? $fileSize - 1 : (int) $end; - - if ('' === $start) { - $start = $fileSize - $end; - $end = $fileSize - 1; - } else { - $start = (int) $start; - } - - if ($start <= $end) { - $end = min($end, $fileSize - 1); - if ($start < 0 || $start > $end) { - $this->setStatusCode(416); - $this->headers->set('Content-Range', sprintf('bytes */%s', $fileSize)); - } elseif ($end - $start < $fileSize - 1) { - $this->maxlen = $end < $fileSize ? $end - $start + 1 : -1; - $this->offset = $start; - - $this->setStatusCode(206); - $this->headers->set('Content-Range', sprintf('bytes %s-%s/%s', $start, $end, $fileSize)); - $this->headers->set('Content-Length', $end - $start + 1); - } - } - } - } - } - - if ($request->isMethod('HEAD')) { - $this->maxlen = 0; - } - - return $this; - } - - private function hasValidIfRangeHeader(?string $header): bool - { - if ($this->getEtag() === $header) { - return true; - } - - if (null === $lastModified = $this->getLastModified()) { - return false; - } - - return $lastModified->format('D, d M Y H:i:s').' GMT' === $header; - } - - public function sendContent(): static - { - try { - if (!$this->isSuccessful()) { - return parent::sendContent(); - } - - if (0 === $this->maxlen) { - return $this; - } - - $out = fopen('php://output', 'w'); - $file = fopen($this->file->getPathname(), 'r'); - - ignore_user_abort(true); - - if (0 !== $this->offset) { - fseek($file, $this->offset); - } - - $length = $this->maxlen; - while ($length && !feof($file)) { - $read = ($length > $this->chunkSize) ? $this->chunkSize : $length; - $length -= $read; - - stream_copy_to_stream($file, $out, $read); - - if (connection_aborted()) { - break; - } - } - - fclose($out); - fclose($file); - } finally { - if ($this->deleteFileAfterSend && is_file($this->file->getPathname())) { - unlink($this->file->getPathname()); - } - } - - return $this; - } - - /** - * @throws \LogicException when the content is not null - */ - public function setContent(?string $content): static - { - if (null !== $content) { - throw new \LogicException('The content cannot be set on a BinaryFileResponse instance.'); - } - - return $this; - } - - public function getContent(): string|false - { - return false; - } - - /** - * Trust X-Sendfile-Type header. - */ - public static function trustXSendfileTypeHeader() - { - self::$trustXSendfileTypeHeader = true; - } - - /** - * If this is set to true, the file will be unlinked after the request is sent - * Note: If the X-Sendfile header is used, the deleteFileAfterSend setting will not be used. - * - * @return $this - */ - public function deleteFileAfterSend(bool $shouldDelete = true): static - { - $this->deleteFileAfterSend = $shouldDelete; - - return $this; - } -} diff --git a/vendor/symfony/http-foundation/CHANGELOG.md b/vendor/symfony/http-foundation/CHANGELOG.md deleted file mode 100644 index fdea3d67..00000000 --- a/vendor/symfony/http-foundation/CHANGELOG.md +++ /dev/null @@ -1,330 +0,0 @@ -CHANGELOG -========= - -6.2 ---- - - * The HTTP cache store uses the `xxh128` algorithm - * Deprecate calling `JsonResponse::setCallback()`, `Response::setExpires/setLastModified/setEtag()`, `MockArraySessionStorage/NativeSessionStorage::setMetadataBag()`, `NativeSessionStorage::setSaveHandler()` without arguments - * Add request matchers under the `Symfony\Component\HttpFoundation\RequestMatcher` namespace - * Deprecate `RequestMatcher` in favor of `ChainRequestMatcher` - * Deprecate `Symfony\Component\HttpFoundation\ExpressionRequestMatcher` in favor of `Symfony\Component\HttpFoundation\RequestMatcher\ExpressionRequestMatcher` - -6.1 ---- - - * Add stale while revalidate and stale if error cache header - * Allow dynamic session "ttl" when using a remote storage - * Deprecate `Request::getContentType()`, use `Request::getContentTypeFormat()` instead - -6.0 ---- - - * Remove the `NamespacedAttributeBag` class - * Removed `Response::create()`, `JsonResponse::create()`, - `RedirectResponse::create()`, `StreamedResponse::create()` and - `BinaryFileResponse::create()` methods (use `__construct()` instead) - * Not passing a `Closure` together with `FILTER_CALLBACK` to `ParameterBag::filter()` throws an `\InvalidArgumentException`; wrap your filter in a closure instead - * Not passing a `Closure` together with `FILTER_CALLBACK` to `InputBag::filter()` throws an `\InvalidArgumentException`; wrap your filter in a closure instead - * Removed the `Request::HEADER_X_FORWARDED_ALL` constant, use either `Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO` or `Request::HEADER_X_FORWARDED_AWS_ELB` or `Request::HEADER_X_FORWARDED_TRAEFIK`constants instead - * Rename `RequestStack::getMasterRequest()` to `getMainRequest()` - * Not passing `FILTER_REQUIRE_ARRAY` or `FILTER_FORCE_ARRAY` flags to `InputBag::filter()` when filtering an array will throw `BadRequestException` - * Removed the `Request::HEADER_X_FORWARDED_ALL` constant - * Retrieving non-scalar values using `InputBag::get()` will throw `BadRequestException` (use `InputBad::all()` instead to retrieve an array) - * Passing non-scalar default value as the second argument `InputBag::get()` will throw `\InvalidArgumentException` - * Passing non-scalar, non-array value as the second argument `InputBag::set()` will throw `\InvalidArgumentException` - * Passing `null` as `$requestIp` to `IpUtils::__checkIp()`, `IpUtils::__checkIp4()` or `IpUtils::__checkIp6()` is not supported anymore. - -5.4 ---- - - * Deprecate passing `null` as `$requestIp` to `IpUtils::__checkIp()`, `IpUtils::__checkIp4()` or `IpUtils::__checkIp6()`, pass an empty string instead. - * Add the `litespeed_finish_request` method to work with Litespeed - * Deprecate `upload_progress.*` and `url_rewriter.tags` session options - * Allow setting session options via DSN - -5.3 ---- - - * Add the `SessionFactory`, `NativeSessionStorageFactory`, `PhpBridgeSessionStorageFactory` and `MockFileSessionStorageFactory` classes - * Calling `Request::getSession()` when there is no available session throws a `SessionNotFoundException` - * Add the `RequestStack::getSession` method - * Deprecate the `NamespacedAttributeBag` class - * Add `ResponseFormatSame` PHPUnit constraint - * Deprecate the `RequestStack::getMasterRequest()` method and add `getMainRequest()` as replacement - -5.2.0 ------ - - * added support for `X-Forwarded-Prefix` header - * added `HeaderUtils::parseQuery()`: it does the same as `parse_str()` but preserves dots in variable names - * added `File::getContent()` - * added ability to use comma separated ip addresses for `RequestMatcher::matchIps()` - * added `Request::toArray()` to parse a JSON request body to an array - * added `RateLimiter\RequestRateLimiterInterface` and `RateLimiter\AbstractRequestRateLimiter` - * deprecated not passing a `Closure` together with `FILTER_CALLBACK` to `ParameterBag::filter()`; wrap your filter in a closure instead. - * Deprecated the `Request::HEADER_X_FORWARDED_ALL` constant, use either `HEADER_X_FORWARDED_FOR | HEADER_X_FORWARDED_HOST | HEADER_X_FORWARDED_PORT | HEADER_X_FORWARDED_PROTO` or `HEADER_X_FORWARDED_AWS_ELB` or `HEADER_X_FORWARDED_TRAEFIK` constants instead. - * Deprecated `BinaryFileResponse::create()`, use `__construct()` instead - -5.1.0 ------ - - * added `Cookie::withValue`, `Cookie::withDomain`, `Cookie::withExpires`, - `Cookie::withPath`, `Cookie::withSecure`, `Cookie::withHttpOnly`, - `Cookie::withRaw`, `Cookie::withSameSite` - * Deprecate `Response::create()`, `JsonResponse::create()`, - `RedirectResponse::create()`, and `StreamedResponse::create()` methods (use - `__construct()` instead) - * added `Request::preferSafeContent()` and `Response::setContentSafe()` to handle "safe" HTTP preference - according to [RFC 8674](https://tools.ietf.org/html/rfc8674) - * made the Mime component an optional dependency - * added `MarshallingSessionHandler`, `IdentityMarshaller` - * made `Session` accept a callback to report when the session is being used - * Add support for all core cache control directives - * Added `Symfony\Component\HttpFoundation\InputBag` - * Deprecated retrieving non-string values using `InputBag::get()`, use `InputBag::all()` if you need access to the collection of values - -5.0.0 ------ - - * made `Cookie` auto-secure and lax by default - * removed classes in the `MimeType` namespace, use the Symfony Mime component instead - * removed method `UploadedFile::getClientSize()` and the related constructor argument - * made `Request::getSession()` throw if the session has not been set before - * removed `Response::HTTP_RESERVED_FOR_WEBDAV_ADVANCED_COLLECTIONS_EXPIRED_PROPOSAL` - * passing a null url when instantiating a `RedirectResponse` is not allowed - -4.4.0 ------ - - * passing arguments to `Request::isMethodSafe()` is deprecated. - * `ApacheRequest` is deprecated, use the `Request` class instead. - * passing a third argument to `HeaderBag::get()` is deprecated, use method `all()` instead - * [BC BREAK] `PdoSessionHandler` with MySQL changed the type of the lifetime column, - make sure to run `ALTER TABLE sessions MODIFY sess_lifetime INTEGER UNSIGNED NOT NULL` to - update your database. - * `PdoSessionHandler` now precalculates the expiry timestamp in the lifetime column, - make sure to run `CREATE INDEX expiry ON sessions (sess_lifetime)` to update your database - to speed up garbage collection of expired sessions. - * added `SessionHandlerFactory` to create session handlers with a DSN - * added `IpUtils::anonymize()` to help with GDPR compliance. - -4.3.0 ------ - - * added PHPUnit constraints: `RequestAttributeValueSame`, `ResponseCookieValueSame`, `ResponseHasCookie`, - `ResponseHasHeader`, `ResponseHeaderSame`, `ResponseIsRedirected`, `ResponseIsSuccessful`, and `ResponseStatusCodeSame` - * deprecated `MimeTypeGuesserInterface` and `ExtensionGuesserInterface` in favor of `Symfony\Component\Mime\MimeTypesInterface`. - * deprecated `MimeType` and `MimeTypeExtensionGuesser` in favor of `Symfony\Component\Mime\MimeTypes`. - * deprecated `FileBinaryMimeTypeGuesser` in favor of `Symfony\Component\Mime\FileBinaryMimeTypeGuesser`. - * deprecated `FileinfoMimeTypeGuesser` in favor of `Symfony\Component\Mime\FileinfoMimeTypeGuesser`. - * added `UrlHelper` that allows to get an absolute URL and a relative path for a given path - -4.2.0 ------ - - * the default value of the "$secure" and "$samesite" arguments of Cookie's constructor - will respectively change from "false" to "null" and from "null" to "lax" in Symfony - 5.0, you should define their values explicitly or use "Cookie::create()" instead. - * added `matchPort()` in RequestMatcher - -4.1.3 ------ - - * [BC BREAK] Support for the IIS-only `X_ORIGINAL_URL` and `X_REWRITE_URL` - HTTP headers has been dropped for security reasons. - -4.1.0 ------ - - * Query string normalization uses `parse_str()` instead of custom parsing logic. - * Passing the file size to the constructor of the `UploadedFile` class is deprecated. - * The `getClientSize()` method of the `UploadedFile` class is deprecated. Use `getSize()` instead. - * added `RedisSessionHandler` to use Redis as a session storage - * The `get()` method of the `AcceptHeader` class now takes into account the - `*` and `*/*` default values (if they are present in the Accept HTTP header) - when looking for items. - * deprecated `Request::getSession()` when no session has been set. Use `Request::hasSession()` instead. - * added `CannotWriteFileException`, `ExtensionFileException`, `FormSizeFileException`, - `IniSizeFileException`, `NoFileException`, `NoTmpDirFileException`, `PartialFileException` to - handle failed `UploadedFile`. - * added `MigratingSessionHandler` for migrating between two session handlers without losing sessions - * added `HeaderUtils`. - -4.0.0 ------ - - * the `Request::setTrustedHeaderName()` and `Request::getTrustedHeaderName()` - methods have been removed - * the `Request::HEADER_CLIENT_IP` constant has been removed, use - `Request::HEADER_X_FORWARDED_FOR` instead - * the `Request::HEADER_CLIENT_HOST` constant has been removed, use - `Request::HEADER_X_FORWARDED_HOST` instead - * the `Request::HEADER_CLIENT_PROTO` constant has been removed, use - `Request::HEADER_X_FORWARDED_PROTO` instead - * the `Request::HEADER_CLIENT_PORT` constant has been removed, use - `Request::HEADER_X_FORWARDED_PORT` instead - * checking for cacheable HTTP methods using the `Request::isMethodSafe()` - method (by not passing `false` as its argument) is not supported anymore and - throws a `\BadMethodCallException` - * the `WriteCheckSessionHandler`, `NativeSessionHandler` and `NativeProxy` classes have been removed - * setting session save handlers that do not implement `\SessionHandlerInterface` in - `NativeSessionStorage::setSaveHandler()` is not supported anymore and throws a - `\TypeError` - -3.4.0 ------ - - * implemented PHP 7.0's `SessionUpdateTimestampHandlerInterface` with a new - `AbstractSessionHandler` base class and a new `StrictSessionHandler` wrapper - * deprecated the `WriteCheckSessionHandler`, `NativeSessionHandler` and `NativeProxy` classes - * deprecated setting session save handlers that do not implement `\SessionHandlerInterface` in `NativeSessionStorage::setSaveHandler()` - * deprecated using `MongoDbSessionHandler` with the legacy mongo extension; use it with the mongodb/mongodb package and ext-mongodb instead - * deprecated `MemcacheSessionHandler`; use `MemcachedSessionHandler` instead - -3.3.0 ------ - - * the `Request::setTrustedProxies()` method takes a new `$trustedHeaderSet` argument, - see https://symfony.com/doc/current/deployment/proxies.html for more info, - * deprecated the `Request::setTrustedHeaderName()` and `Request::getTrustedHeaderName()` methods, - * added `File\Stream`, to be passed to `BinaryFileResponse` when the size of the served file is unknown, - disabling `Range` and `Content-Length` handling, switching to chunked encoding instead - * added the `Cookie::fromString()` method that allows to create a cookie from a - raw header string - -3.1.0 ------ - - * Added support for creating `JsonResponse` with a string of JSON data - -3.0.0 ------ - - * The precedence of parameters returned from `Request::get()` changed from "GET, PATH, BODY" to "PATH, GET, BODY" - -2.8.0 ------ - - * Finding deep items in `ParameterBag::get()` is deprecated since version 2.8 and - will be removed in 3.0. - -2.6.0 ------ - - * PdoSessionHandler changes - - implemented different session locking strategies to prevent loss of data by concurrent access to the same session - - [BC BREAK] save session data in a binary column without base64_encode - - [BC BREAK] added lifetime column to the session table which allows to have different lifetimes for each session - - implemented lazy connections that are only opened when a session is used by either passing a dsn string - explicitly or falling back to session.save_path ini setting - - added a createTable method that initializes a correctly defined table depending on the database vendor - -2.5.0 ------ - - * added `JsonResponse::setEncodingOptions()` & `JsonResponse::getEncodingOptions()` for easier manipulation - of the options used while encoding data to JSON format. - -2.4.0 ------ - - * added RequestStack - * added Request::getEncodings() - * added accessors methods to session handlers - -2.3.0 ------ - - * added support for ranges of IPs in trusted proxies - * `UploadedFile::isValid` now returns false if the file was not uploaded via HTTP (in a non-test mode) - * Improved error-handling of `\Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler` - to ensure the supplied PDO handler throws Exceptions on error (as the class expects). Added related test cases - to verify that Exceptions are properly thrown when the PDO queries fail. - -2.2.0 ------ - - * fixed the Request::create() precedence (URI information always take precedence now) - * added Request::getTrustedProxies() - * deprecated Request::isProxyTrusted() - * [BC BREAK] JsonResponse does not turn a top level empty array to an object anymore, use an ArrayObject to enforce objects - * added a IpUtils class to check if an IP belongs to a CIDR - * added Request::getRealMethod() to get the "real" HTTP method (getMethod() returns the "intended" HTTP method) - * disabled _method request parameter support by default (call Request::enableHttpMethodParameterOverride() to - enable it, and Request::getHttpMethodParameterOverride() to check if it is supported) - * Request::splitHttpAcceptHeader() method is deprecated and will be removed in 2.3 - * Deprecated Flashbag::count() and \Countable interface, will be removed in 2.3 - -2.1.0 ------ - - * added Request::getSchemeAndHttpHost() and Request::getUserInfo() - * added a fluent interface to the Response class - * added Request::isProxyTrusted() - * added JsonResponse - * added a getTargetUrl method to RedirectResponse - * added support for streamed responses - * made Response::prepare() method the place to enforce HTTP specification - * [BC BREAK] moved management of the locale from the Session class to the Request class - * added a generic access to the PHP built-in filter mechanism: ParameterBag::filter() - * made FileBinaryMimeTypeGuesser command configurable - * added Request::getUser() and Request::getPassword() - * added support for the PATCH method in Request - * removed the ContentTypeMimeTypeGuesser class as it is deprecated and never used on PHP 5.3 - * added ResponseHeaderBag::makeDisposition() (implements RFC 6266) - * made mimetype to extension conversion configurable - * [BC BREAK] Moved all session related classes and interfaces into own namespace, as - `Symfony\Component\HttpFoundation\Session` and renamed classes accordingly. - Session handlers are located in the subnamespace `Symfony\Component\HttpFoundation\Session\Handler`. - * SessionHandlers must implement `\SessionHandlerInterface` or extend from the - `Symfony\Component\HttpFoundation\Storage\Handler\NativeSessionHandler` base class. - * Added internal storage driver proxy mechanism for forward compatibility with - PHP 5.4 `\SessionHandler` class. - * Added session handlers for custom Memcache, Memcached and Null session save handlers. - * [BC BREAK] Removed `NativeSessionStorage` and replaced with `NativeFileSessionHandler`. - * [BC BREAK] `SessionStorageInterface` methods removed: `write()`, `read()` and - `remove()`. Added `getBag()`, `registerBag()`. The `NativeSessionStorage` class - is a mediator for the session storage internals including the session handlers - which do the real work of participating in the internal PHP session workflow. - * [BC BREAK] Introduced mock implementations of `SessionStorage` to enable unit - and functional testing without starting real PHP sessions. Removed - `ArraySessionStorage`, and replaced with `MockArraySessionStorage` for unit - tests; removed `FilesystemSessionStorage`, and replaced with`MockFileSessionStorage` - for functional tests. These do not interact with global session ini - configuration values, session functions or `$_SESSION` superglobal. This means - they can be configured directly allowing multiple instances to work without - conflicting in the same PHP process. - * [BC BREAK] Removed the `close()` method from the `Session` class, as this is - now redundant. - * Deprecated the following methods from the Session class: `setFlash()`, `setFlashes()` - `getFlash()`, `hasFlash()`, and `removeFlash()`. Use `getFlashBag()` instead - which returns a `FlashBagInterface`. - * `Session->clear()` now only clears session attributes as before it cleared - flash messages and attributes. `Session->getFlashBag()->all()` clears flashes now. - * Session data is now managed by `SessionBagInterface` to better encapsulate - session data. - * Refactored session attribute and flash messages system to their own - `SessionBagInterface` implementations. - * Added `FlashBag`. Flashes expire when retrieved by `get()` or `all()`. This - implementation is ESI compatible. - * Added `AutoExpireFlashBag` (default) to replicate Symfony 2.0.x auto expire - behavior of messages auto expiring after one page page load. Messages must - be retrieved by `get()` or `all()`. - * Added `Symfony\Component\HttpFoundation\Attribute\AttributeBag` to replicate - attributes storage behavior from 2.0.x (default). - * Added `Symfony\Component\HttpFoundation\Attribute\NamespacedAttributeBag` for - namespace session attributes. - * Flash API can stores messages in an array so there may be multiple messages - per flash type. The old `Session` class API remains without BC break as it - will allow single messages as before. - * Added basic session meta-data to the session to record session create time, - last updated time, and the lifetime of the session cookie that was provided - to the client. - * Request::getClientIp() method doesn't take a parameter anymore but bases - itself on the trustProxy parameter. - * Added isMethod() to Request object. - * [BC BREAK] The methods `getPathInfo()`, `getBaseUrl()` and `getBasePath()` of - a `Request` now all return a raw value (vs a urldecoded value before). Any call - to one of these methods must be checked and wrapped in a `rawurldecode()` if - needed. diff --git a/vendor/symfony/http-foundation/ChainRequestMatcher.php b/vendor/symfony/http-foundation/ChainRequestMatcher.php deleted file mode 100644 index 29486fc8..00000000 --- a/vendor/symfony/http-foundation/ChainRequestMatcher.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation; - -/** - * ChainRequestMatcher verifies that all checks match against a Request instance. - * - * @author Fabien Potencier - */ -class ChainRequestMatcher implements RequestMatcherInterface -{ - /** - * @param iterable $matchers - */ - public function __construct(private iterable $matchers) - { - } - - public function matches(Request $request): bool - { - foreach ($this->matchers as $matcher) { - if (!$matcher->matches($request)) { - return false; - } - } - - return true; - } -} diff --git a/vendor/symfony/http-foundation/Cookie.php b/vendor/symfony/http-foundation/Cookie.php deleted file mode 100644 index a68f745e..00000000 --- a/vendor/symfony/http-foundation/Cookie.php +++ /dev/null @@ -1,383 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation; - -/** - * Represents a cookie. - * - * @author Johannes M. Schmitt - */ -class Cookie -{ - public const SAMESITE_NONE = 'none'; - public const SAMESITE_LAX = 'lax'; - public const SAMESITE_STRICT = 'strict'; - - protected $name; - protected $value; - protected $domain; - protected $expire; - protected $path; - protected $secure; - protected $httpOnly; - - private bool $raw; - private ?string $sameSite = null; - private bool $secureDefault = false; - - private const RESERVED_CHARS_LIST = "=,; \t\r\n\v\f"; - private const RESERVED_CHARS_FROM = ['=', ',', ';', ' ', "\t", "\r", "\n", "\v", "\f"]; - private const RESERVED_CHARS_TO = ['%3D', '%2C', '%3B', '%20', '%09', '%0D', '%0A', '%0B', '%0C']; - - /** - * Creates cookie from raw header string. - */ - public static function fromString(string $cookie, bool $decode = false): static - { - $data = [ - 'expires' => 0, - 'path' => '/', - 'domain' => null, - 'secure' => false, - 'httponly' => false, - 'raw' => !$decode, - 'samesite' => null, - ]; - - $parts = HeaderUtils::split($cookie, ';='); - $part = array_shift($parts); - - $name = $decode ? urldecode($part[0]) : $part[0]; - $value = isset($part[1]) ? ($decode ? urldecode($part[1]) : $part[1]) : null; - - $data = HeaderUtils::combine($parts) + $data; - $data['expires'] = self::expiresTimestamp($data['expires']); - - if (isset($data['max-age']) && ($data['max-age'] > 0 || $data['expires'] > time())) { - $data['expires'] = time() + (int) $data['max-age']; - } - - return new static($name, $value, $data['expires'], $data['path'], $data['domain'], $data['secure'], $data['httponly'], $data['raw'], $data['samesite']); - } - - /** - * @see self::__construct - * - * @param self::SAMESITE_*|''|null $sameSite - */ - public static function create(string $name, string $value = null, int|string|\DateTimeInterface $expire = 0, ?string $path = '/', string $domain = null, bool $secure = null, bool $httpOnly = true, bool $raw = false, ?string $sameSite = self::SAMESITE_LAX): self - { - return new self($name, $value, $expire, $path, $domain, $secure, $httpOnly, $raw, $sameSite); - } - - /** - * @param string $name The name of the cookie - * @param string|null $value The value of the cookie - * @param int|string|\DateTimeInterface $expire The time the cookie expires - * @param string $path The path on the server in which the cookie will be available on - * @param string|null $domain The domain that the cookie is available to - * @param bool|null $secure Whether the client should send back the cookie only over HTTPS or null to auto-enable this when the request is already using HTTPS - * @param bool $httpOnly Whether the cookie will be made accessible only through the HTTP protocol - * @param bool $raw Whether the cookie value should be sent with no url encoding - * @param self::SAMESITE_*|''|null $sameSite Whether the cookie will be available for cross-site requests - * - * @throws \InvalidArgumentException - */ - public function __construct(string $name, string $value = null, int|string|\DateTimeInterface $expire = 0, ?string $path = '/', string $domain = null, bool $secure = null, bool $httpOnly = true, bool $raw = false, ?string $sameSite = self::SAMESITE_LAX) - { - // from PHP source code - if ($raw && false !== strpbrk($name, self::RESERVED_CHARS_LIST)) { - throw new \InvalidArgumentException(sprintf('The cookie name "%s" contains invalid characters.', $name)); - } - - if (empty($name)) { - throw new \InvalidArgumentException('The cookie name cannot be empty.'); - } - - $this->name = $name; - $this->value = $value; - $this->domain = $domain; - $this->expire = self::expiresTimestamp($expire); - $this->path = empty($path) ? '/' : $path; - $this->secure = $secure; - $this->httpOnly = $httpOnly; - $this->raw = $raw; - $this->sameSite = $this->withSameSite($sameSite)->sameSite; - } - - /** - * Creates a cookie copy with a new value. - */ - public function withValue(?string $value): static - { - $cookie = clone $this; - $cookie->value = $value; - - return $cookie; - } - - /** - * Creates a cookie copy with a new domain that the cookie is available to. - */ - public function withDomain(?string $domain): static - { - $cookie = clone $this; - $cookie->domain = $domain; - - return $cookie; - } - - /** - * Creates a cookie copy with a new time the cookie expires. - */ - public function withExpires(int|string|\DateTimeInterface $expire = 0): static - { - $cookie = clone $this; - $cookie->expire = self::expiresTimestamp($expire); - - return $cookie; - } - - /** - * Converts expires formats to a unix timestamp. - */ - private static function expiresTimestamp(int|string|\DateTimeInterface $expire = 0): int - { - // convert expiration time to a Unix timestamp - if ($expire instanceof \DateTimeInterface) { - $expire = $expire->format('U'); - } elseif (!is_numeric($expire)) { - $expire = strtotime($expire); - - if (false === $expire) { - throw new \InvalidArgumentException('The cookie expiration time is not valid.'); - } - } - - return 0 < $expire ? (int) $expire : 0; - } - - /** - * Creates a cookie copy with a new path on the server in which the cookie will be available on. - */ - public function withPath(string $path): static - { - $cookie = clone $this; - $cookie->path = '' === $path ? '/' : $path; - - return $cookie; - } - - /** - * Creates a cookie copy that only be transmitted over a secure HTTPS connection from the client. - */ - public function withSecure(bool $secure = true): static - { - $cookie = clone $this; - $cookie->secure = $secure; - - return $cookie; - } - - /** - * Creates a cookie copy that be accessible only through the HTTP protocol. - */ - public function withHttpOnly(bool $httpOnly = true): static - { - $cookie = clone $this; - $cookie->httpOnly = $httpOnly; - - return $cookie; - } - - /** - * Creates a cookie copy that uses no url encoding. - */ - public function withRaw(bool $raw = true): static - { - if ($raw && false !== strpbrk($this->name, self::RESERVED_CHARS_LIST)) { - throw new \InvalidArgumentException(sprintf('The cookie name "%s" contains invalid characters.', $this->name)); - } - - $cookie = clone $this; - $cookie->raw = $raw; - - return $cookie; - } - - /** - * Creates a cookie copy with SameSite attribute. - * - * @param self::SAMESITE_*|''|null $sameSite - */ - public function withSameSite(?string $sameSite): static - { - if ('' === $sameSite) { - $sameSite = null; - } elseif (null !== $sameSite) { - $sameSite = strtolower($sameSite); - } - - if (!\in_array($sameSite, [self::SAMESITE_LAX, self::SAMESITE_STRICT, self::SAMESITE_NONE, null], true)) { - throw new \InvalidArgumentException('The "sameSite" parameter value is not valid.'); - } - - $cookie = clone $this; - $cookie->sameSite = $sameSite; - - return $cookie; - } - - /** - * Returns the cookie as a string. - */ - public function __toString(): string - { - if ($this->isRaw()) { - $str = $this->getName(); - } else { - $str = str_replace(self::RESERVED_CHARS_FROM, self::RESERVED_CHARS_TO, $this->getName()); - } - - $str .= '='; - - if ('' === (string) $this->getValue()) { - $str .= 'deleted; expires='.gmdate('D, d M Y H:i:s T', time() - 31536001).'; Max-Age=0'; - } else { - $str .= $this->isRaw() ? $this->getValue() : rawurlencode($this->getValue()); - - if (0 !== $this->getExpiresTime()) { - $str .= '; expires='.gmdate('D, d M Y H:i:s T', $this->getExpiresTime()).'; Max-Age='.$this->getMaxAge(); - } - } - - if ($this->getPath()) { - $str .= '; path='.$this->getPath(); - } - - if ($this->getDomain()) { - $str .= '; domain='.$this->getDomain(); - } - - if (true === $this->isSecure()) { - $str .= '; secure'; - } - - if (true === $this->isHttpOnly()) { - $str .= '; httponly'; - } - - if (null !== $this->getSameSite()) { - $str .= '; samesite='.$this->getSameSite(); - } - - return $str; - } - - /** - * Gets the name of the cookie. - */ - public function getName(): string - { - return $this->name; - } - - /** - * Gets the value of the cookie. - */ - public function getValue(): ?string - { - return $this->value; - } - - /** - * Gets the domain that the cookie is available to. - */ - public function getDomain(): ?string - { - return $this->domain; - } - - /** - * Gets the time the cookie expires. - */ - public function getExpiresTime(): int - { - return $this->expire; - } - - /** - * Gets the max-age attribute. - */ - public function getMaxAge(): int - { - $maxAge = $this->expire - time(); - - return 0 >= $maxAge ? 0 : $maxAge; - } - - /** - * Gets the path on the server in which the cookie will be available on. - */ - public function getPath(): string - { - return $this->path; - } - - /** - * Checks whether the cookie should only be transmitted over a secure HTTPS connection from the client. - */ - public function isSecure(): bool - { - return $this->secure ?? $this->secureDefault; - } - - /** - * Checks whether the cookie will be made accessible only through the HTTP protocol. - */ - public function isHttpOnly(): bool - { - return $this->httpOnly; - } - - /** - * Whether this cookie is about to be cleared. - */ - public function isCleared(): bool - { - return 0 !== $this->expire && $this->expire < time(); - } - - /** - * Checks if the cookie value should be sent with no url encoding. - */ - public function isRaw(): bool - { - return $this->raw; - } - - /** - * @return self::SAMESITE_*|null - */ - public function getSameSite(): ?string - { - return $this->sameSite; - } - - /** - * @param bool $default The default value of the "secure" flag when it is set to null - */ - public function setSecureDefault(bool $default): void - { - $this->secureDefault = $default; - } -} diff --git a/vendor/symfony/http-foundation/Exception/BadRequestException.php b/vendor/symfony/http-foundation/Exception/BadRequestException.php deleted file mode 100644 index e4bb309c..00000000 --- a/vendor/symfony/http-foundation/Exception/BadRequestException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Exception; - -/** - * Raised when a user sends a malformed request. - */ -class BadRequestException extends \UnexpectedValueException implements RequestExceptionInterface -{ -} diff --git a/vendor/symfony/http-foundation/Exception/ConflictingHeadersException.php b/vendor/symfony/http-foundation/Exception/ConflictingHeadersException.php deleted file mode 100644 index 5fcf5b42..00000000 --- a/vendor/symfony/http-foundation/Exception/ConflictingHeadersException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Exception; - -/** - * The HTTP request contains headers with conflicting information. - * - * @author Magnus Nordlander - */ -class ConflictingHeadersException extends \UnexpectedValueException implements RequestExceptionInterface -{ -} diff --git a/vendor/symfony/http-foundation/Exception/JsonException.php b/vendor/symfony/http-foundation/Exception/JsonException.php deleted file mode 100644 index 5990e760..00000000 --- a/vendor/symfony/http-foundation/Exception/JsonException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Exception; - -/** - * Thrown by Request::toArray() when the content cannot be JSON-decoded. - * - * @author Tobias Nyholm - */ -final class JsonException extends \UnexpectedValueException implements RequestExceptionInterface -{ -} diff --git a/vendor/symfony/http-foundation/Exception/RequestExceptionInterface.php b/vendor/symfony/http-foundation/Exception/RequestExceptionInterface.php deleted file mode 100644 index 478d0dc7..00000000 --- a/vendor/symfony/http-foundation/Exception/RequestExceptionInterface.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Exception; - -/** - * Interface for Request exceptions. - * - * Exceptions implementing this interface should trigger an HTTP 400 response in the application code. - */ -interface RequestExceptionInterface -{ -} diff --git a/vendor/symfony/http-foundation/Exception/SessionNotFoundException.php b/vendor/symfony/http-foundation/Exception/SessionNotFoundException.php deleted file mode 100644 index 94b0cb69..00000000 --- a/vendor/symfony/http-foundation/Exception/SessionNotFoundException.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\HttpFoundation\Exception; - -/** - * Raised when a session does not exist. This happens in the following cases: - * - the session is not enabled - * - attempt to read a session outside a request context (ie. cli script). - * - * @author Jérémy Derussé - */ -class SessionNotFoundException extends \LogicException implements RequestExceptionInterface -{ - public function __construct(string $message = 'There is currently no session available.', int $code = 0, \Throwable $previous = null) - { - parent::__construct($message, $code, $previous); - } -} diff --git a/vendor/symfony/http-foundation/Exception/SuspiciousOperationException.php b/vendor/symfony/http-foundation/Exception/SuspiciousOperationException.php deleted file mode 100644 index ae7a5f13..00000000 --- a/vendor/symfony/http-foundation/Exception/SuspiciousOperationException.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. - */ - -namespace Symfony\Component\HttpFoundation\Exception; - -/** - * Raised when a user has performed an operation that should be considered - * suspicious from a security perspective. - */ -class SuspiciousOperationException extends \UnexpectedValueException implements RequestExceptionInterface -{ -} diff --git a/vendor/symfony/http-foundation/ExpressionRequestMatcher.php b/vendor/symfony/http-foundation/ExpressionRequestMatcher.php deleted file mode 100644 index 5628ea8b..00000000 --- a/vendor/symfony/http-foundation/ExpressionRequestMatcher.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\HttpFoundation; - -use Symfony\Component\ExpressionLanguage\Expression; -use Symfony\Component\ExpressionLanguage\ExpressionLanguage; -use Symfony\Component\HttpFoundation\RequestMatcher\ExpressionRequestMatcher as NewExpressionRequestMatcher; - -trigger_deprecation('symfony/http-foundation', '6.2', 'The "%s" class is deprecated, use "%s" instead.', ExpressionRequestMatcher::class, NewExpressionRequestMatcher::class); - -/** - * ExpressionRequestMatcher uses an expression to match a Request. - * - * @author Fabien Potencier - * - * @deprecated since Symfony 6.2, use "Symfony\Component\HttpFoundation\RequestMatcher\ExpressionRequestMatcher" instead - */ -class ExpressionRequestMatcher extends RequestMatcher -{ - private ExpressionLanguage $language; - private Expression|string $expression; - - public function setExpression(ExpressionLanguage $language, Expression|string $expression) - { - $this->language = $language; - $this->expression = $expression; - } - - public function matches(Request $request): bool - { - if (!isset($this->language)) { - throw new \LogicException('Unable to match the request as the expression language is not available.'); - } - - return $this->language->evaluate($this->expression, [ - 'request' => $request, - 'method' => $request->getMethod(), - 'path' => rawurldecode($request->getPathInfo()), - 'host' => $request->getHost(), - 'ip' => $request->getClientIp(), - 'attributes' => $request->attributes->all(), - ]) && parent::matches($request); - } -} diff --git a/vendor/symfony/http-foundation/File/Exception/AccessDeniedException.php b/vendor/symfony/http-foundation/File/Exception/AccessDeniedException.php deleted file mode 100644 index 136d2a9f..00000000 --- a/vendor/symfony/http-foundation/File/Exception/AccessDeniedException.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\HttpFoundation\File\Exception; - -/** - * Thrown when the access on a file was denied. - * - * @author Bernhard Schussek - */ -class AccessDeniedException extends FileException -{ - public function __construct(string $path) - { - parent::__construct(sprintf('The file %s could not be accessed', $path)); - } -} diff --git a/vendor/symfony/http-foundation/File/Exception/CannotWriteFileException.php b/vendor/symfony/http-foundation/File/Exception/CannotWriteFileException.php deleted file mode 100644 index c49f53a6..00000000 --- a/vendor/symfony/http-foundation/File/Exception/CannotWriteFileException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\File\Exception; - -/** - * Thrown when an UPLOAD_ERR_CANT_WRITE error occurred with UploadedFile. - * - * @author Florent Mata - */ -class CannotWriteFileException extends FileException -{ -} diff --git a/vendor/symfony/http-foundation/File/Exception/ExtensionFileException.php b/vendor/symfony/http-foundation/File/Exception/ExtensionFileException.php deleted file mode 100644 index ed83499c..00000000 --- a/vendor/symfony/http-foundation/File/Exception/ExtensionFileException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\File\Exception; - -/** - * Thrown when an UPLOAD_ERR_EXTENSION error occurred with UploadedFile. - * - * @author Florent Mata - */ -class ExtensionFileException extends FileException -{ -} diff --git a/vendor/symfony/http-foundation/File/Exception/FileException.php b/vendor/symfony/http-foundation/File/Exception/FileException.php deleted file mode 100644 index fad5133e..00000000 --- a/vendor/symfony/http-foundation/File/Exception/FileException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\File\Exception; - -/** - * Thrown when an error occurred in the component File. - * - * @author Bernhard Schussek - */ -class FileException extends \RuntimeException -{ -} diff --git a/vendor/symfony/http-foundation/File/Exception/FileNotFoundException.php b/vendor/symfony/http-foundation/File/Exception/FileNotFoundException.php deleted file mode 100644 index 31bdf68f..00000000 --- a/vendor/symfony/http-foundation/File/Exception/FileNotFoundException.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\HttpFoundation\File\Exception; - -/** - * Thrown when a file was not found. - * - * @author Bernhard Schussek - */ -class FileNotFoundException extends FileException -{ - public function __construct(string $path) - { - parent::__construct(sprintf('The file "%s" does not exist', $path)); - } -} diff --git a/vendor/symfony/http-foundation/File/Exception/FormSizeFileException.php b/vendor/symfony/http-foundation/File/Exception/FormSizeFileException.php deleted file mode 100644 index 8741be08..00000000 --- a/vendor/symfony/http-foundation/File/Exception/FormSizeFileException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\File\Exception; - -/** - * Thrown when an UPLOAD_ERR_FORM_SIZE error occurred with UploadedFile. - * - * @author Florent Mata - */ -class FormSizeFileException extends FileException -{ -} diff --git a/vendor/symfony/http-foundation/File/Exception/IniSizeFileException.php b/vendor/symfony/http-foundation/File/Exception/IniSizeFileException.php deleted file mode 100644 index c8fde610..00000000 --- a/vendor/symfony/http-foundation/File/Exception/IniSizeFileException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\File\Exception; - -/** - * Thrown when an UPLOAD_ERR_INI_SIZE error occurred with UploadedFile. - * - * @author Florent Mata - */ -class IniSizeFileException extends FileException -{ -} diff --git a/vendor/symfony/http-foundation/File/Exception/NoFileException.php b/vendor/symfony/http-foundation/File/Exception/NoFileException.php deleted file mode 100644 index 4b48cc77..00000000 --- a/vendor/symfony/http-foundation/File/Exception/NoFileException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\File\Exception; - -/** - * Thrown when an UPLOAD_ERR_NO_FILE error occurred with UploadedFile. - * - * @author Florent Mata - */ -class NoFileException extends FileException -{ -} diff --git a/vendor/symfony/http-foundation/File/Exception/NoTmpDirFileException.php b/vendor/symfony/http-foundation/File/Exception/NoTmpDirFileException.php deleted file mode 100644 index bdead2d9..00000000 --- a/vendor/symfony/http-foundation/File/Exception/NoTmpDirFileException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\File\Exception; - -/** - * Thrown when an UPLOAD_ERR_NO_TMP_DIR error occurred with UploadedFile. - * - * @author Florent Mata - */ -class NoTmpDirFileException extends FileException -{ -} diff --git a/vendor/symfony/http-foundation/File/Exception/PartialFileException.php b/vendor/symfony/http-foundation/File/Exception/PartialFileException.php deleted file mode 100644 index 4641efb5..00000000 --- a/vendor/symfony/http-foundation/File/Exception/PartialFileException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\File\Exception; - -/** - * Thrown when an UPLOAD_ERR_PARTIAL error occurred with UploadedFile. - * - * @author Florent Mata - */ -class PartialFileException extends FileException -{ -} diff --git a/vendor/symfony/http-foundation/File/Exception/UnexpectedTypeException.php b/vendor/symfony/http-foundation/File/Exception/UnexpectedTypeException.php deleted file mode 100644 index 905bd596..00000000 --- a/vendor/symfony/http-foundation/File/Exception/UnexpectedTypeException.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. - */ - -namespace Symfony\Component\HttpFoundation\File\Exception; - -class UnexpectedTypeException extends FileException -{ - public function __construct(mixed $value, string $expectedType) - { - parent::__construct(sprintf('Expected argument of type %s, %s given', $expectedType, get_debug_type($value))); - } -} diff --git a/vendor/symfony/http-foundation/File/Exception/UploadException.php b/vendor/symfony/http-foundation/File/Exception/UploadException.php deleted file mode 100644 index 7074e765..00000000 --- a/vendor/symfony/http-foundation/File/Exception/UploadException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\File\Exception; - -/** - * Thrown when an error occurred during file upload. - * - * @author Bernhard Schussek - */ -class UploadException extends FileException -{ -} diff --git a/vendor/symfony/http-foundation/File/File.php b/vendor/symfony/http-foundation/File/File.php deleted file mode 100644 index e8ce4bcf..00000000 --- a/vendor/symfony/http-foundation/File/File.php +++ /dev/null @@ -1,141 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\File; - -use Symfony\Component\HttpFoundation\File\Exception\FileException; -use Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException; -use Symfony\Component\Mime\MimeTypes; - -/** - * A file in the file system. - * - * @author Bernhard Schussek - */ -class File extends \SplFileInfo -{ - /** - * Constructs a new file from the given path. - * - * @param string $path The path to the file - * @param bool $checkPath Whether to check the path or not - * - * @throws FileNotFoundException If the given path is not a file - */ - public function __construct(string $path, bool $checkPath = true) - { - if ($checkPath && !is_file($path)) { - throw new FileNotFoundException($path); - } - - parent::__construct($path); - } - - /** - * Returns the extension based on the mime type. - * - * If the mime type is unknown, returns null. - * - * This method uses the mime type as guessed by getMimeType() - * to guess the file extension. - * - * @see MimeTypes - * @see getMimeType() - */ - public function guessExtension(): ?string - { - if (!class_exists(MimeTypes::class)) { - throw new \LogicException('You cannot guess the extension as the Mime component is not installed. Try running "composer require symfony/mime".'); - } - - return MimeTypes::getDefault()->getExtensions($this->getMimeType())[0] ?? null; - } - - /** - * Returns the mime type of the file. - * - * The mime type is guessed using a MimeTypeGuesserInterface instance, - * which uses finfo_file() then the "file" system binary, - * depending on which of those are available. - * - * @see MimeTypes - */ - public function getMimeType(): ?string - { - if (!class_exists(MimeTypes::class)) { - throw new \LogicException('You cannot guess the mime type as the Mime component is not installed. Try running "composer require symfony/mime".'); - } - - return MimeTypes::getDefault()->guessMimeType($this->getPathname()); - } - - /** - * Moves the file to a new location. - * - * @throws FileException if the target file could not be created - */ - public function move(string $directory, string $name = null): self - { - $target = $this->getTargetFile($directory, $name); - - set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; }); - try { - $renamed = rename($this->getPathname(), $target); - } finally { - restore_error_handler(); - } - if (!$renamed) { - throw new FileException(sprintf('Could not move the file "%s" to "%s" (%s).', $this->getPathname(), $target, strip_tags($error))); - } - - @chmod($target, 0666 & ~umask()); - - return $target; - } - - public function getContent(): string - { - $content = file_get_contents($this->getPathname()); - - if (false === $content) { - throw new FileException(sprintf('Could not get the content of the file "%s".', $this->getPathname())); - } - - return $content; - } - - protected function getTargetFile(string $directory, string $name = null): self - { - if (!is_dir($directory)) { - if (false === @mkdir($directory, 0777, true) && !is_dir($directory)) { - throw new FileException(sprintf('Unable to create the "%s" directory.', $directory)); - } - } elseif (!is_writable($directory)) { - throw new FileException(sprintf('Unable to write in the "%s" directory.', $directory)); - } - - $target = rtrim($directory, '/\\').\DIRECTORY_SEPARATOR.(null === $name ? $this->getBasename() : $this->getName($name)); - - return new self($target, false); - } - - /** - * Returns locale independent base name of the given path. - */ - protected function getName(string $name): string - { - $originalName = str_replace('\\', '/', $name); - $pos = strrpos($originalName, '/'); - $originalName = false === $pos ? $originalName : substr($originalName, $pos + 1); - - return $originalName; - } -} diff --git a/vendor/symfony/http-foundation/File/Stream.php b/vendor/symfony/http-foundation/File/Stream.php deleted file mode 100644 index 2c156b2e..00000000 --- a/vendor/symfony/http-foundation/File/Stream.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\HttpFoundation\File; - -/** - * A PHP stream of unknown size. - * - * @author Nicolas Grekas - */ -class Stream extends File -{ - public function getSize(): int|false - { - return false; - } -} diff --git a/vendor/symfony/http-foundation/File/UploadedFile.php b/vendor/symfony/http-foundation/File/UploadedFile.php deleted file mode 100644 index 5bf4cfe8..00000000 --- a/vendor/symfony/http-foundation/File/UploadedFile.php +++ /dev/null @@ -1,269 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\File; - -use Symfony\Component\HttpFoundation\File\Exception\CannotWriteFileException; -use Symfony\Component\HttpFoundation\File\Exception\ExtensionFileException; -use Symfony\Component\HttpFoundation\File\Exception\FileException; -use Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException; -use Symfony\Component\HttpFoundation\File\Exception\FormSizeFileException; -use Symfony\Component\HttpFoundation\File\Exception\IniSizeFileException; -use Symfony\Component\HttpFoundation\File\Exception\NoFileException; -use Symfony\Component\HttpFoundation\File\Exception\NoTmpDirFileException; -use Symfony\Component\HttpFoundation\File\Exception\PartialFileException; -use Symfony\Component\Mime\MimeTypes; - -/** - * A file uploaded through a form. - * - * @author Bernhard Schussek - * @author Florian Eckerstorfer - * @author Fabien Potencier - */ -class UploadedFile extends File -{ - private bool $test; - private string $originalName; - private string $mimeType; - private int $error; - - /** - * Accepts the information of the uploaded file as provided by the PHP global $_FILES. - * - * The file object is only created when the uploaded file is valid (i.e. when the - * isValid() method returns true). Otherwise the only methods that could be called - * on an UploadedFile instance are: - * - * * getClientOriginalName, - * * getClientMimeType, - * * isValid, - * * getError. - * - * Calling any other method on an non-valid instance will cause an unpredictable result. - * - * @param string $path The full temporary path to the file - * @param string $originalName The original file name of the uploaded file - * @param string|null $mimeType The type of the file as provided by PHP; null defaults to application/octet-stream - * @param int|null $error The error constant of the upload (one of PHP's UPLOAD_ERR_XXX constants); null defaults to UPLOAD_ERR_OK - * @param bool $test Whether the test mode is active - * Local files are used in test mode hence the code should not enforce HTTP uploads - * - * @throws FileException If file_uploads is disabled - * @throws FileNotFoundException If the file does not exist - */ - public function __construct(string $path, string $originalName, string $mimeType = null, int $error = null, bool $test = false) - { - $this->originalName = $this->getName($originalName); - $this->mimeType = $mimeType ?: 'application/octet-stream'; - $this->error = $error ?: \UPLOAD_ERR_OK; - $this->test = $test; - - parent::__construct($path, \UPLOAD_ERR_OK === $this->error); - } - - /** - * Returns the original file name. - * - * It is extracted from the request from which the file has been uploaded. - * Then it should not be considered as a safe value. - */ - public function getClientOriginalName(): string - { - return $this->originalName; - } - - /** - * Returns the original file extension. - * - * It is extracted from the original file name that was uploaded. - * Then it should not be considered as a safe value. - */ - public function getClientOriginalExtension(): string - { - return pathinfo($this->originalName, \PATHINFO_EXTENSION); - } - - /** - * Returns the file mime type. - * - * The client mime type is extracted from the request from which the file - * was uploaded, so it should not be considered as a safe value. - * - * For a trusted mime type, use getMimeType() instead (which guesses the mime - * type based on the file content). - * - * @see getMimeType() - */ - public function getClientMimeType(): string - { - return $this->mimeType; - } - - /** - * Returns the extension based on the client mime type. - * - * If the mime type is unknown, returns null. - * - * This method uses the mime type as guessed by getClientMimeType() - * to guess the file extension. As such, the extension returned - * by this method cannot be trusted. - * - * For a trusted extension, use guessExtension() instead (which guesses - * the extension based on the guessed mime type for the file). - * - * @see guessExtension() - * @see getClientMimeType() - */ - public function guessClientExtension(): ?string - { - if (!class_exists(MimeTypes::class)) { - throw new \LogicException('You cannot guess the extension as the Mime component is not installed. Try running "composer require symfony/mime".'); - } - - return MimeTypes::getDefault()->getExtensions($this->getClientMimeType())[0] ?? null; - } - - /** - * Returns the upload error. - * - * If the upload was successful, the constant UPLOAD_ERR_OK is returned. - * Otherwise one of the other UPLOAD_ERR_XXX constants is returned. - */ - public function getError(): int - { - return $this->error; - } - - /** - * Returns whether the file has been uploaded with HTTP and no error occurred. - */ - public function isValid(): bool - { - $isOk = \UPLOAD_ERR_OK === $this->error; - - return $this->test ? $isOk : $isOk && is_uploaded_file($this->getPathname()); - } - - /** - * Moves the file to a new location. - * - * @throws FileException if, for any reason, the file could not have been moved - */ - public function move(string $directory, string $name = null): File - { - if ($this->isValid()) { - if ($this->test) { - return parent::move($directory, $name); - } - - $target = $this->getTargetFile($directory, $name); - - set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; }); - try { - $moved = move_uploaded_file($this->getPathname(), $target); - } finally { - restore_error_handler(); - } - if (!$moved) { - throw new FileException(sprintf('Could not move the file "%s" to "%s" (%s).', $this->getPathname(), $target, strip_tags($error))); - } - - @chmod($target, 0666 & ~umask()); - - return $target; - } - - switch ($this->error) { - case \UPLOAD_ERR_INI_SIZE: - throw new IniSizeFileException($this->getErrorMessage()); - case \UPLOAD_ERR_FORM_SIZE: - throw new FormSizeFileException($this->getErrorMessage()); - case \UPLOAD_ERR_PARTIAL: - throw new PartialFileException($this->getErrorMessage()); - case \UPLOAD_ERR_NO_FILE: - throw new NoFileException($this->getErrorMessage()); - case \UPLOAD_ERR_CANT_WRITE: - throw new CannotWriteFileException($this->getErrorMessage()); - case \UPLOAD_ERR_NO_TMP_DIR: - throw new NoTmpDirFileException($this->getErrorMessage()); - case \UPLOAD_ERR_EXTENSION: - throw new ExtensionFileException($this->getErrorMessage()); - } - - throw new FileException($this->getErrorMessage()); - } - - /** - * Returns the maximum size of an uploaded file as configured in php.ini. - * - * @return int|float The maximum size of an uploaded file in bytes (returns float if size > PHP_INT_MAX) - */ - public static function getMaxFilesize(): int|float - { - $sizePostMax = self::parseFilesize(\ini_get('post_max_size')); - $sizeUploadMax = self::parseFilesize(\ini_get('upload_max_filesize')); - - return min($sizePostMax ?: \PHP_INT_MAX, $sizeUploadMax ?: \PHP_INT_MAX); - } - - private static function parseFilesize(string $size): int|float - { - if ('' === $size) { - return 0; - } - - $size = strtolower($size); - - $max = ltrim($size, '+'); - if (str_starts_with($max, '0x')) { - $max = \intval($max, 16); - } elseif (str_starts_with($max, '0')) { - $max = \intval($max, 8); - } else { - $max = (int) $max; - } - - switch (substr($size, -1)) { - case 't': $max *= 1024; - // no break - case 'g': $max *= 1024; - // no break - case 'm': $max *= 1024; - // no break - case 'k': $max *= 1024; - } - - return $max; - } - - /** - * Returns an informative upload error message. - */ - public function getErrorMessage(): string - { - static $errors = [ - \UPLOAD_ERR_INI_SIZE => 'The file "%s" exceeds your upload_max_filesize ini directive (limit is %d KiB).', - \UPLOAD_ERR_FORM_SIZE => 'The file "%s" exceeds the upload limit defined in your form.', - \UPLOAD_ERR_PARTIAL => 'The file "%s" was only partially uploaded.', - \UPLOAD_ERR_NO_FILE => 'No file was uploaded.', - \UPLOAD_ERR_CANT_WRITE => 'The file "%s" could not be written on disk.', - \UPLOAD_ERR_NO_TMP_DIR => 'File could not be uploaded: missing temporary directory.', - \UPLOAD_ERR_EXTENSION => 'File upload was stopped by a PHP extension.', - ]; - - $errorCode = $this->error; - $maxFilesize = \UPLOAD_ERR_INI_SIZE === $errorCode ? self::getMaxFilesize() / 1024 : 0; - $message = $errors[$errorCode] ?? 'The file "%s" was not uploaded due to an unknown error.'; - - return sprintf($message, $this->getClientOriginalName(), $maxFilesize); - } -} diff --git a/vendor/symfony/http-foundation/FileBag.php b/vendor/symfony/http-foundation/FileBag.php deleted file mode 100644 index 7ed39408..00000000 --- a/vendor/symfony/http-foundation/FileBag.php +++ /dev/null @@ -1,127 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation; - -use Symfony\Component\HttpFoundation\File\UploadedFile; - -/** - * FileBag is a container for uploaded files. - * - * @author Fabien Potencier - * @author Bulat Shakirzyanov - */ -class FileBag extends ParameterBag -{ - private const FILE_KEYS = ['error', 'name', 'size', 'tmp_name', 'type']; - - /** - * @param array|UploadedFile[] $parameters An array of HTTP files - */ - public function __construct(array $parameters = []) - { - $this->replace($parameters); - } - - public function replace(array $files = []) - { - $this->parameters = []; - $this->add($files); - } - - public function set(string $key, mixed $value) - { - if (!\is_array($value) && !$value instanceof UploadedFile) { - throw new \InvalidArgumentException('An uploaded file must be an array or an instance of UploadedFile.'); - } - - parent::set($key, $this->convertFileInformation($value)); - } - - public function add(array $files = []) - { - foreach ($files as $key => $file) { - $this->set($key, $file); - } - } - - /** - * Converts uploaded files to UploadedFile instances. - * - * @return UploadedFile[]|UploadedFile|null - */ - protected function convertFileInformation(array|UploadedFile $file): array|UploadedFile|null - { - if ($file instanceof UploadedFile) { - return $file; - } - - $file = $this->fixPhpFilesArray($file); - $keys = array_keys($file); - sort($keys); - - if (self::FILE_KEYS == $keys) { - if (\UPLOAD_ERR_NO_FILE == $file['error']) { - $file = null; - } else { - $file = new UploadedFile($file['tmp_name'], $file['name'], $file['type'], $file['error'], false); - } - } else { - $file = array_map(function ($v) { return $v instanceof UploadedFile || \is_array($v) ? $this->convertFileInformation($v) : $v; }, $file); - if (array_keys($keys) === $keys) { - $file = array_filter($file); - } - } - - return $file; - } - - /** - * Fixes a malformed PHP $_FILES array. - * - * PHP has a bug that the format of the $_FILES array differs, depending on - * whether the uploaded file fields had normal field names or array-like - * field names ("normal" vs. "parent[child]"). - * - * This method fixes the array to look like the "normal" $_FILES array. - * - * It's safe to pass an already converted array, in which case this method - * just returns the original array unmodified. - */ - protected function fixPhpFilesArray(array $data): array - { - // Remove extra key added by PHP 8.1. - unset($data['full_path']); - $keys = array_keys($data); - sort($keys); - - if (self::FILE_KEYS != $keys || !isset($data['name']) || !\is_array($data['name'])) { - return $data; - } - - $files = $data; - foreach (self::FILE_KEYS as $k) { - unset($files[$k]); - } - - foreach ($data['name'] as $key => $name) { - $files[$key] = $this->fixPhpFilesArray([ - 'error' => $data['error'][$key], - 'name' => $name, - 'type' => $data['type'][$key], - 'tmp_name' => $data['tmp_name'][$key], - 'size' => $data['size'][$key], - ]); - } - - return $files; - } -} diff --git a/vendor/symfony/http-foundation/HeaderBag.php b/vendor/symfony/http-foundation/HeaderBag.php deleted file mode 100644 index 0883024b..00000000 --- a/vendor/symfony/http-foundation/HeaderBag.php +++ /dev/null @@ -1,273 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation; - -/** - * HeaderBag is a container for HTTP headers. - * - * @author Fabien Potencier - * - * @implements \IteratorAggregate> - */ -class HeaderBag implements \IteratorAggregate, \Countable -{ - protected const UPPER = '_ABCDEFGHIJKLMNOPQRSTUVWXYZ'; - protected const LOWER = '-abcdefghijklmnopqrstuvwxyz'; - - /** - * @var array> - */ - protected $headers = []; - protected $cacheControl = []; - - public function __construct(array $headers = []) - { - foreach ($headers as $key => $values) { - $this->set($key, $values); - } - } - - /** - * Returns the headers as a string. - */ - public function __toString(): string - { - if (!$headers = $this->all()) { - return ''; - } - - ksort($headers); - $max = max(array_map('strlen', array_keys($headers))) + 1; - $content = ''; - foreach ($headers as $name => $values) { - $name = ucwords($name, '-'); - foreach ($values as $value) { - $content .= sprintf("%-{$max}s %s\r\n", $name.':', $value); - } - } - - return $content; - } - - /** - * Returns the headers. - * - * @param string|null $key The name of the headers to return or null to get them all - * - * @return array>|array - */ - public function all(string $key = null): array - { - if (null !== $key) { - return $this->headers[strtr($key, self::UPPER, self::LOWER)] ?? []; - } - - return $this->headers; - } - - /** - * Returns the parameter keys. - * - * @return string[] - */ - public function keys(): array - { - return array_keys($this->all()); - } - - /** - * Replaces the current HTTP headers by a new set. - */ - public function replace(array $headers = []) - { - $this->headers = []; - $this->add($headers); - } - - /** - * Adds new headers the current HTTP headers set. - */ - public function add(array $headers) - { - foreach ($headers as $key => $values) { - $this->set($key, $values); - } - } - - /** - * Returns the first header by name or the default one. - */ - public function get(string $key, string $default = null): ?string - { - $headers = $this->all($key); - - if (!$headers) { - return $default; - } - - if (null === $headers[0]) { - return null; - } - - return (string) $headers[0]; - } - - /** - * Sets a header by name. - * - * @param string|string[]|null $values The value or an array of values - * @param bool $replace Whether to replace the actual value or not (true by default) - */ - public function set(string $key, string|array|null $values, bool $replace = true) - { - $key = strtr($key, self::UPPER, self::LOWER); - - if (\is_array($values)) { - $values = array_values($values); - - if (true === $replace || !isset($this->headers[$key])) { - $this->headers[$key] = $values; - } else { - $this->headers[$key] = array_merge($this->headers[$key], $values); - } - } else { - if (true === $replace || !isset($this->headers[$key])) { - $this->headers[$key] = [$values]; - } else { - $this->headers[$key][] = $values; - } - } - - if ('cache-control' === $key) { - $this->cacheControl = $this->parseCacheControl(implode(', ', $this->headers[$key])); - } - } - - /** - * Returns true if the HTTP header is defined. - */ - public function has(string $key): bool - { - return \array_key_exists(strtr($key, self::UPPER, self::LOWER), $this->all()); - } - - /** - * Returns true if the given HTTP header contains the given value. - */ - public function contains(string $key, string $value): bool - { - return \in_array($value, $this->all($key)); - } - - /** - * Removes a header. - */ - public function remove(string $key) - { - $key = strtr($key, self::UPPER, self::LOWER); - - unset($this->headers[$key]); - - if ('cache-control' === $key) { - $this->cacheControl = []; - } - } - - /** - * Returns the HTTP header value converted to a date. - * - * @throws \RuntimeException When the HTTP header is not parseable - */ - public function getDate(string $key, \DateTime $default = null): ?\DateTimeInterface - { - if (null === $value = $this->get($key)) { - return $default; - } - - if (false === $date = \DateTime::createFromFormat(\DATE_RFC2822, $value)) { - throw new \RuntimeException(sprintf('The "%s" HTTP header is not parseable (%s).', $key, $value)); - } - - return $date; - } - - /** - * Adds a custom Cache-Control directive. - */ - public function addCacheControlDirective(string $key, bool|string $value = true) - { - $this->cacheControl[$key] = $value; - - $this->set('Cache-Control', $this->getCacheControlHeader()); - } - - /** - * Returns true if the Cache-Control directive is defined. - */ - public function hasCacheControlDirective(string $key): bool - { - return \array_key_exists($key, $this->cacheControl); - } - - /** - * Returns a Cache-Control directive value by name. - */ - public function getCacheControlDirective(string $key): bool|string|null - { - return $this->cacheControl[$key] ?? null; - } - - /** - * Removes a Cache-Control directive. - */ - public function removeCacheControlDirective(string $key) - { - unset($this->cacheControl[$key]); - - $this->set('Cache-Control', $this->getCacheControlHeader()); - } - - /** - * Returns an iterator for headers. - * - * @return \ArrayIterator> - */ - public function getIterator(): \ArrayIterator - { - return new \ArrayIterator($this->headers); - } - - /** - * Returns the number of headers. - */ - public function count(): int - { - return \count($this->headers); - } - - protected function getCacheControlHeader() - { - ksort($this->cacheControl); - - return HeaderUtils::toString($this->cacheControl, ','); - } - - /** - * Parses a Cache-Control HTTP header. - */ - protected function parseCacheControl(string $header): array - { - $parts = HeaderUtils::split($header, ',='); - - return HeaderUtils::combine($parts); - } -} diff --git a/vendor/symfony/http-foundation/HeaderUtils.php b/vendor/symfony/http-foundation/HeaderUtils.php deleted file mode 100644 index 1d56be08..00000000 --- a/vendor/symfony/http-foundation/HeaderUtils.php +++ /dev/null @@ -1,293 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation; - -/** - * HTTP header utility functions. - * - * @author Christian Schmidt - */ -class HeaderUtils -{ - public const DISPOSITION_ATTACHMENT = 'attachment'; - public const DISPOSITION_INLINE = 'inline'; - - /** - * This class should not be instantiated. - */ - private function __construct() - { - } - - /** - * Splits an HTTP header by one or more separators. - * - * Example: - * - * HeaderUtils::split("da, en-gb;q=0.8", ",;") - * // => ['da'], ['en-gb', 'q=0.8']] - * - * @param string $separators List of characters to split on, ordered by - * precedence, e.g. ",", ";=", or ",;=" - * - * @return array Nested array with as many levels as there are characters in - * $separators - */ - public static function split(string $header, string $separators): array - { - $quotedSeparators = preg_quote($separators, '/'); - - preg_match_all(' - / - (?!\s) - (?: - # quoted-string - "(?:[^"\\\\]|\\\\.)*(?:"|\\\\|$) - | - # token - [^"'.$quotedSeparators.']+ - )+ - (?['.$quotedSeparators.']) - \s* - /x', trim($header), $matches, \PREG_SET_ORDER); - - return self::groupParts($matches, $separators); - } - - /** - * Combines an array of arrays into one associative array. - * - * Each of the nested arrays should have one or two elements. The first - * value will be used as the keys in the associative array, and the second - * will be used as the values, or true if the nested array only contains one - * element. Array keys are lowercased. - * - * Example: - * - * HeaderUtils::combine([["foo", "abc"], ["bar"]]) - * // => ["foo" => "abc", "bar" => true] - */ - public static function combine(array $parts): array - { - $assoc = []; - foreach ($parts as $part) { - $name = strtolower($part[0]); - $value = $part[1] ?? true; - $assoc[$name] = $value; - } - - return $assoc; - } - - /** - * Joins an associative array into a string for use in an HTTP header. - * - * The key and value of each entry are joined with "=", and all entries - * are joined with the specified separator and an additional space (for - * readability). Values are quoted if necessary. - * - * Example: - * - * HeaderUtils::toString(["foo" => "abc", "bar" => true, "baz" => "a b c"], ",") - * // => 'foo=abc, bar, baz="a b c"' - */ - public static function toString(array $assoc, string $separator): string - { - $parts = []; - foreach ($assoc as $name => $value) { - if (true === $value) { - $parts[] = $name; - } else { - $parts[] = $name.'='.self::quote($value); - } - } - - return implode($separator.' ', $parts); - } - - /** - * Encodes a string as a quoted string, if necessary. - * - * If a string contains characters not allowed by the "token" construct in - * the HTTP specification, it is backslash-escaped and enclosed in quotes - * to match the "quoted-string" construct. - */ - public static function quote(string $s): string - { - if (preg_match('/^[a-z0-9!#$%&\'*.^_`|~-]+$/i', $s)) { - return $s; - } - - return '"'.addcslashes($s, '"\\"').'"'; - } - - /** - * Decodes a quoted string. - * - * If passed an unquoted string that matches the "token" construct (as - * defined in the HTTP specification), it is passed through verbatimly. - */ - public static function unquote(string $s): string - { - return preg_replace('/\\\\(.)|"/', '$1', $s); - } - - /** - * Generates an HTTP Content-Disposition field-value. - * - * @param string $disposition One of "inline" or "attachment" - * @param string $filename A unicode string - * @param string $filenameFallback A string containing only ASCII characters that - * is semantically equivalent to $filename. If the filename is already ASCII, - * it can be omitted, or just copied from $filename - * - * @throws \InvalidArgumentException - * - * @see RFC 6266 - */ - public static function makeDisposition(string $disposition, string $filename, string $filenameFallback = ''): string - { - if (!\in_array($disposition, [self::DISPOSITION_ATTACHMENT, self::DISPOSITION_INLINE])) { - throw new \InvalidArgumentException(sprintf('The disposition must be either "%s" or "%s".', self::DISPOSITION_ATTACHMENT, self::DISPOSITION_INLINE)); - } - - if ('' === $filenameFallback) { - $filenameFallback = $filename; - } - - // filenameFallback is not ASCII. - if (!preg_match('/^[\x20-\x7e]*$/', $filenameFallback)) { - throw new \InvalidArgumentException('The filename fallback must only contain ASCII characters.'); - } - - // percent characters aren't safe in fallback. - if (str_contains($filenameFallback, '%')) { - throw new \InvalidArgumentException('The filename fallback cannot contain the "%" character.'); - } - - // path separators aren't allowed in either. - if (str_contains($filename, '/') || str_contains($filename, '\\') || str_contains($filenameFallback, '/') || str_contains($filenameFallback, '\\')) { - throw new \InvalidArgumentException('The filename and the fallback cannot contain the "/" and "\\" characters.'); - } - - $params = ['filename' => $filenameFallback]; - if ($filename !== $filenameFallback) { - $params['filename*'] = "utf-8''".rawurlencode($filename); - } - - return $disposition.'; '.self::toString($params, ';'); - } - - /** - * Like parse_str(), but preserves dots in variable names. - */ - public static function parseQuery(string $query, bool $ignoreBrackets = false, string $separator = '&'): array - { - $q = []; - - foreach (explode($separator, $query) as $v) { - if (false !== $i = strpos($v, "\0")) { - $v = substr($v, 0, $i); - } - - if (false === $i = strpos($v, '=')) { - $k = urldecode($v); - $v = ''; - } else { - $k = urldecode(substr($v, 0, $i)); - $v = substr($v, $i); - } - - if (false !== $i = strpos($k, "\0")) { - $k = substr($k, 0, $i); - } - - $k = ltrim($k, ' '); - - if ($ignoreBrackets) { - $q[$k][] = urldecode(substr($v, 1)); - - continue; - } - - if (false === $i = strpos($k, '[')) { - $q[] = bin2hex($k).$v; - } else { - $q[] = bin2hex(substr($k, 0, $i)).rawurlencode(substr($k, $i)).$v; - } - } - - if ($ignoreBrackets) { - return $q; - } - - parse_str(implode('&', $q), $q); - - $query = []; - - foreach ($q as $k => $v) { - if (false !== $i = strpos($k, '_')) { - $query[substr_replace($k, hex2bin(substr($k, 0, $i)).'[', 0, 1 + $i)] = $v; - } else { - $query[hex2bin($k)] = $v; - } - } - - return $query; - } - - private static function groupParts(array $matches, string $separators, bool $first = true): array - { - $separator = $separators[0]; - $partSeparators = substr($separators, 1); - - $i = 0; - $partMatches = []; - $previousMatchWasSeparator = false; - foreach ($matches as $match) { - if (!$first && $previousMatchWasSeparator && isset($match['separator']) && $match['separator'] === $separator) { - $previousMatchWasSeparator = true; - $partMatches[$i][] = $match; - } elseif (isset($match['separator']) && $match['separator'] === $separator) { - $previousMatchWasSeparator = true; - ++$i; - } else { - $previousMatchWasSeparator = false; - $partMatches[$i][] = $match; - } - } - - $parts = []; - if ($partSeparators) { - foreach ($partMatches as $matches) { - $parts[] = self::groupParts($matches, $partSeparators, false); - } - } else { - foreach ($partMatches as $matches) { - $parts[] = self::unquote($matches[0][0]); - } - - if (!$first && 2 < \count($parts)) { - $parts = [ - $parts[0], - implode($separator, \array_slice($parts, 1)), - ]; - } - } - - return $parts; - } -} diff --git a/vendor/symfony/http-foundation/InputBag.php b/vendor/symfony/http-foundation/InputBag.php deleted file mode 100644 index 877ac60f..00000000 --- a/vendor/symfony/http-foundation/InputBag.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\HttpFoundation; - -use Symfony\Component\HttpFoundation\Exception\BadRequestException; - -/** - * InputBag is a container for user input values such as $_GET, $_POST, $_REQUEST, and $_COOKIE. - * - * @author Saif Eddin Gmati - */ -final class InputBag extends ParameterBag -{ - /** - * Returns a scalar input value by name. - * - * @param string|int|float|bool|null $default The default value if the input key does not exist - */ - public function get(string $key, mixed $default = null): string|int|float|bool|null - { - if (null !== $default && !\is_scalar($default) && !$default instanceof \Stringable) { - throw new \InvalidArgumentException(sprintf('Expected a scalar value as a 2nd argument to "%s()", "%s" given.', __METHOD__, get_debug_type($default))); - } - - $value = parent::get($key, $this); - - if (null !== $value && $this !== $value && !\is_scalar($value) && !$value instanceof \Stringable) { - throw new BadRequestException(sprintf('Input value "%s" contains a non-scalar value.', $key)); - } - - return $this === $value ? $default : $value; - } - - /** - * Replaces the current input values by a new set. - */ - public function replace(array $inputs = []) - { - $this->parameters = []; - $this->add($inputs); - } - - /** - * Adds input values. - */ - public function add(array $inputs = []) - { - foreach ($inputs as $input => $value) { - $this->set($input, $value); - } - } - - /** - * Sets an input by name. - * - * @param string|int|float|bool|array|null $value - */ - public function set(string $key, mixed $value) - { - if (null !== $value && !\is_scalar($value) && !\is_array($value) && !$value instanceof \Stringable) { - throw new \InvalidArgumentException(sprintf('Expected a scalar, or an array as a 2nd argument to "%s()", "%s" given.', __METHOD__, get_debug_type($value))); - } - - $this->parameters[$key] = $value; - } - - public function filter(string $key, mixed $default = null, int $filter = \FILTER_DEFAULT, mixed $options = []): mixed - { - $value = $this->has($key) ? $this->all()[$key] : $default; - - // Always turn $options into an array - this allows filter_var option shortcuts. - if (!\is_array($options) && $options) { - $options = ['flags' => $options]; - } - - if (\is_array($value) && !(($options['flags'] ?? 0) & (\FILTER_REQUIRE_ARRAY | \FILTER_FORCE_ARRAY))) { - throw new BadRequestException(sprintf('Input value "%s" contains an array, but "FILTER_REQUIRE_ARRAY" or "FILTER_FORCE_ARRAY" flags were not set.', $key)); - } - - if ((\FILTER_CALLBACK & $filter) && !(($options['options'] ?? null) instanceof \Closure)) { - throw new \InvalidArgumentException(sprintf('A Closure must be passed to "%s()" when FILTER_CALLBACK is used, "%s" given.', __METHOD__, get_debug_type($options['options'] ?? null))); - } - - return filter_var($value, $filter, $options); - } -} diff --git a/vendor/symfony/http-foundation/IpUtils.php b/vendor/symfony/http-foundation/IpUtils.php deleted file mode 100644 index 746720ea..00000000 --- a/vendor/symfony/http-foundation/IpUtils.php +++ /dev/null @@ -1,194 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation; - -/** - * Http utility functions. - * - * @author Fabien Potencier - */ -class IpUtils -{ - private static array $checkedIps = []; - - /** - * This class should not be instantiated. - */ - private function __construct() - { - } - - /** - * Checks if an IPv4 or IPv6 address is contained in the list of given IPs or subnets. - * - * @param string|array $ips List of IPs or subnets (can be a string if only a single one) - */ - public static function checkIp(string $requestIp, string|array $ips): bool - { - if (!\is_array($ips)) { - $ips = [$ips]; - } - - $method = substr_count($requestIp, ':') > 1 ? 'checkIp6' : 'checkIp4'; - - foreach ($ips as $ip) { - if (self::$method($requestIp, $ip)) { - return true; - } - } - - return false; - } - - /** - * Compares two IPv4 addresses. - * In case a subnet is given, it checks if it contains the request IP. - * - * @param string $ip IPv4 address or subnet in CIDR notation - * - * @return bool Whether the request IP matches the IP, or whether the request IP is within the CIDR subnet - */ - public static function checkIp4(string $requestIp, string $ip): bool - { - $cacheKey = $requestIp.'-'.$ip; - if (isset(self::$checkedIps[$cacheKey])) { - return self::$checkedIps[$cacheKey]; - } - - if (!filter_var($requestIp, \FILTER_VALIDATE_IP, \FILTER_FLAG_IPV4)) { - return self::$checkedIps[$cacheKey] = false; - } - - if (str_contains($ip, '/')) { - [$address, $netmask] = explode('/', $ip, 2); - - if ('0' === $netmask) { - return self::$checkedIps[$cacheKey] = filter_var($address, \FILTER_VALIDATE_IP, \FILTER_FLAG_IPV4); - } - - if ($netmask < 0 || $netmask > 32) { - return self::$checkedIps[$cacheKey] = false; - } - } else { - $address = $ip; - $netmask = 32; - } - - if (false === ip2long($address)) { - return self::$checkedIps[$cacheKey] = false; - } - - return self::$checkedIps[$cacheKey] = 0 === substr_compare(sprintf('%032b', ip2long($requestIp)), sprintf('%032b', ip2long($address)), 0, $netmask); - } - - /** - * Compares two IPv6 addresses. - * In case a subnet is given, it checks if it contains the request IP. - * - * @author David Soria Parra - * - * @see https://github.com/dsp/v6tools - * - * @param string $ip IPv6 address or subnet in CIDR notation - * - * @throws \RuntimeException When IPV6 support is not enabled - */ - public static function checkIp6(string $requestIp, string $ip): bool - { - $cacheKey = $requestIp.'-'.$ip; - if (isset(self::$checkedIps[$cacheKey])) { - return self::$checkedIps[$cacheKey]; - } - - if (!((\extension_loaded('sockets') && \defined('AF_INET6')) || @inet_pton('::1'))) { - throw new \RuntimeException('Unable to check Ipv6. Check that PHP was not compiled with option "disable-ipv6".'); - } - - // Check to see if we were given a IP4 $requestIp or $ip by mistake - if (!filter_var($requestIp, \FILTER_VALIDATE_IP, \FILTER_FLAG_IPV6)) { - return self::$checkedIps[$cacheKey] = false; - } - - if (str_contains($ip, '/')) { - [$address, $netmask] = explode('/', $ip, 2); - - if (!filter_var($address, \FILTER_VALIDATE_IP, \FILTER_FLAG_IPV6)) { - return self::$checkedIps[$cacheKey] = false; - } - - if ('0' === $netmask) { - return (bool) unpack('n*', @inet_pton($address)); - } - - if ($netmask < 1 || $netmask > 128) { - return self::$checkedIps[$cacheKey] = false; - } - } else { - if (!filter_var($ip, \FILTER_VALIDATE_IP, \FILTER_FLAG_IPV6)) { - return self::$checkedIps[$cacheKey] = false; - } - - $address = $ip; - $netmask = 128; - } - - $bytesAddr = unpack('n*', @inet_pton($address)); - $bytesTest = unpack('n*', @inet_pton($requestIp)); - - if (!$bytesAddr || !$bytesTest) { - return self::$checkedIps[$cacheKey] = false; - } - - for ($i = 1, $ceil = ceil($netmask / 16); $i <= $ceil; ++$i) { - $left = $netmask - 16 * ($i - 1); - $left = ($left <= 16) ? $left : 16; - $mask = ~(0xFFFF >> $left) & 0xFFFF; - if (($bytesAddr[$i] & $mask) != ($bytesTest[$i] & $mask)) { - return self::$checkedIps[$cacheKey] = false; - } - } - - return self::$checkedIps[$cacheKey] = true; - } - - /** - * Anonymizes an IP/IPv6. - * - * Removes the last byte for v4 and the last 8 bytes for v6 IPs - */ - public static function anonymize(string $ip): string - { - $wrappedIPv6 = false; - if (str_starts_with($ip, '[') && str_ends_with($ip, ']')) { - $wrappedIPv6 = true; - $ip = substr($ip, 1, -1); - } - - $packedAddress = inet_pton($ip); - if (4 === \strlen($packedAddress)) { - $mask = '255.255.255.0'; - } elseif ($ip === inet_ntop($packedAddress & inet_pton('::ffff:ffff:ffff'))) { - $mask = '::ffff:ffff:ff00'; - } elseif ($ip === inet_ntop($packedAddress & inet_pton('::ffff:ffff'))) { - $mask = '::ffff:ff00'; - } else { - $mask = 'ffff:ffff:ffff:ffff:0000:0000:0000:0000'; - } - $ip = inet_ntop($packedAddress & inet_pton($mask)); - - if ($wrappedIPv6) { - $ip = '['.$ip.']'; - } - - return $ip; - } -} diff --git a/vendor/symfony/http-foundation/JsonResponse.php b/vendor/symfony/http-foundation/JsonResponse.php deleted file mode 100644 index 8dd250a3..00000000 --- a/vendor/symfony/http-foundation/JsonResponse.php +++ /dev/null @@ -1,190 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation; - -/** - * Response represents an HTTP response in JSON format. - * - * Note that this class does not force the returned JSON content to be an - * object. It is however recommended that you do return an object as it - * protects yourself against XSSI and JSON-JavaScript Hijacking. - * - * @see https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/AJAX_Security_Cheat_Sheet.md#always-return-json-with-an-object-on-the-outside - * - * @author Igor Wiedler - */ -class JsonResponse extends Response -{ - protected $data; - protected $callback; - - // Encode <, >, ', &, and " characters in the JSON, making it also safe to be embedded into HTML. - // 15 === JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT - public const DEFAULT_ENCODING_OPTIONS = 15; - - protected $encodingOptions = self::DEFAULT_ENCODING_OPTIONS; - - /** - * @param bool $json If the data is already a JSON string - */ - public function __construct(mixed $data = null, int $status = 200, array $headers = [], bool $json = false) - { - parent::__construct('', $status, $headers); - - if ($json && !\is_string($data) && !is_numeric($data) && !\is_callable([$data, '__toString'])) { - throw new \TypeError(sprintf('"%s": If $json is set to true, argument $data must be a string or object implementing __toString(), "%s" given.', __METHOD__, get_debug_type($data))); - } - - $data ??= new \ArrayObject(); - - $json ? $this->setJson($data) : $this->setData($data); - } - - /** - * Factory method for chainability. - * - * Example: - * - * return JsonResponse::fromJsonString('{"key": "value"}') - * ->setSharedMaxAge(300); - * - * @param string $data The JSON response string - * @param int $status The response status code (200 "OK" by default) - * @param array $headers An array of response headers - */ - public static function fromJsonString(string $data, int $status = 200, array $headers = []): static - { - return new static($data, $status, $headers, true); - } - - /** - * Sets the JSONP callback. - * - * @param string|null $callback The JSONP callback or null to use none - * - * @return $this - * - * @throws \InvalidArgumentException When the callback name is not valid - */ - public function setCallback(string $callback = null): static - { - if (1 > \func_num_args()) { - trigger_deprecation('symfony/http-foundation', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); - } - if (null !== $callback) { - // partially taken from https://geekality.net/2011/08/03/valid-javascript-identifier/ - // partially taken from https://github.com/willdurand/JsonpCallbackValidator - // JsonpCallbackValidator is released under the MIT License. See https://github.com/willdurand/JsonpCallbackValidator/blob/v1.1.0/LICENSE for details. - // (c) William Durand - $pattern = '/^[$_\p{L}][$_\p{L}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*(?:\[(?:"(?:\\\.|[^"\\\])*"|\'(?:\\\.|[^\'\\\])*\'|\d+)\])*?$/u'; - $reserved = [ - 'break', 'do', 'instanceof', 'typeof', 'case', 'else', 'new', 'var', 'catch', 'finally', 'return', 'void', 'continue', 'for', 'switch', 'while', - 'debugger', 'function', 'this', 'with', 'default', 'if', 'throw', 'delete', 'in', 'try', 'class', 'enum', 'extends', 'super', 'const', 'export', - 'import', 'implements', 'let', 'private', 'public', 'yield', 'interface', 'package', 'protected', 'static', 'null', 'true', 'false', - ]; - $parts = explode('.', $callback); - foreach ($parts as $part) { - if (!preg_match($pattern, $part) || \in_array($part, $reserved, true)) { - throw new \InvalidArgumentException('The callback name is not valid.'); - } - } - } - - $this->callback = $callback; - - return $this->update(); - } - - /** - * Sets a raw string containing a JSON document to be sent. - * - * @return $this - */ - public function setJson(string $json): static - { - $this->data = $json; - - return $this->update(); - } - - /** - * Sets the data to be sent as JSON. - * - * @return $this - * - * @throws \InvalidArgumentException - */ - public function setData(mixed $data = []): static - { - try { - $data = json_encode($data, $this->encodingOptions); - } catch (\Exception $e) { - if ('Exception' === $e::class && str_starts_with($e->getMessage(), 'Failed calling ')) { - throw $e->getPrevious() ?: $e; - } - throw $e; - } - - if (\JSON_THROW_ON_ERROR & $this->encodingOptions) { - return $this->setJson($data); - } - - if (\JSON_ERROR_NONE !== json_last_error()) { - throw new \InvalidArgumentException(json_last_error_msg()); - } - - return $this->setJson($data); - } - - /** - * Returns options used while encoding data to JSON. - */ - public function getEncodingOptions(): int - { - return $this->encodingOptions; - } - - /** - * Sets options used while encoding data to JSON. - * - * @return $this - */ - public function setEncodingOptions(int $encodingOptions): static - { - $this->encodingOptions = $encodingOptions; - - return $this->setData(json_decode($this->data)); - } - - /** - * Updates the content and headers according to the JSON data and callback. - * - * @return $this - */ - protected function update(): static - { - if (null !== $this->callback) { - // Not using application/javascript for compatibility reasons with older browsers. - $this->headers->set('Content-Type', 'text/javascript'); - - return $this->setContent(sprintf('/**/%s(%s);', $this->callback, $this->data)); - } - - // Only set the header when there is none or when it equals 'text/javascript' (from a previous update with callback) - // in order to not overwrite a custom definition. - if (!$this->headers->has('Content-Type') || 'text/javascript' === $this->headers->get('Content-Type')) { - $this->headers->set('Content-Type', 'application/json'); - } - - return $this->setContent($this->data); - } -} diff --git a/vendor/symfony/http-foundation/LICENSE b/vendor/symfony/http-foundation/LICENSE deleted file mode 100644 index 88bf75bb..00000000 --- a/vendor/symfony/http-foundation/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2022 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/http-foundation/ParameterBag.php b/vendor/symfony/http-foundation/ParameterBag.php deleted file mode 100644 index 72c8f094..00000000 --- a/vendor/symfony/http-foundation/ParameterBag.php +++ /dev/null @@ -1,189 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation; - -use Symfony\Component\HttpFoundation\Exception\BadRequestException; - -/** - * ParameterBag is a container for key/value pairs. - * - * @author Fabien Potencier - * - * @implements \IteratorAggregate - */ -class ParameterBag implements \IteratorAggregate, \Countable -{ - /** - * Parameter storage. - */ - protected $parameters; - - public function __construct(array $parameters = []) - { - $this->parameters = $parameters; - } - - /** - * Returns the parameters. - * - * @param string|null $key The name of the parameter to return or null to get them all - */ - public function all(string $key = null): array - { - if (null === $key) { - return $this->parameters; - } - - if (!\is_array($value = $this->parameters[$key] ?? [])) { - throw new BadRequestException(sprintf('Unexpected value for parameter "%s": expecting "array", got "%s".', $key, get_debug_type($value))); - } - - return $value; - } - - /** - * Returns the parameter keys. - */ - public function keys(): array - { - return array_keys($this->parameters); - } - - /** - * Replaces the current parameters by a new set. - */ - public function replace(array $parameters = []) - { - $this->parameters = $parameters; - } - - /** - * Adds parameters. - */ - public function add(array $parameters = []) - { - $this->parameters = array_replace($this->parameters, $parameters); - } - - public function get(string $key, mixed $default = null): mixed - { - return \array_key_exists($key, $this->parameters) ? $this->parameters[$key] : $default; - } - - public function set(string $key, mixed $value) - { - $this->parameters[$key] = $value; - } - - /** - * Returns true if the parameter is defined. - */ - public function has(string $key): bool - { - return \array_key_exists($key, $this->parameters); - } - - /** - * Removes a parameter. - */ - public function remove(string $key) - { - unset($this->parameters[$key]); - } - - /** - * Returns the alphabetic characters of the parameter value. - */ - public function getAlpha(string $key, string $default = ''): string - { - return preg_replace('/[^[:alpha:]]/', '', $this->get($key, $default)); - } - - /** - * Returns the alphabetic characters and digits of the parameter value. - */ - public function getAlnum(string $key, string $default = ''): string - { - return preg_replace('/[^[:alnum:]]/', '', $this->get($key, $default)); - } - - /** - * Returns the digits of the parameter value. - */ - public function getDigits(string $key, string $default = ''): string - { - // we need to remove - and + because they're allowed in the filter - return str_replace(['-', '+'], '', $this->filter($key, $default, \FILTER_SANITIZE_NUMBER_INT)); - } - - /** - * Returns the parameter value converted to integer. - */ - public function getInt(string $key, int $default = 0): int - { - return (int) $this->get($key, $default); - } - - /** - * Returns the parameter value converted to boolean. - */ - public function getBoolean(string $key, bool $default = false): bool - { - return $this->filter($key, $default, \FILTER_VALIDATE_BOOL); - } - - /** - * Filter key. - * - * @param int $filter FILTER_* constant - * - * @see https://php.net/filter-var - */ - public function filter(string $key, mixed $default = null, int $filter = \FILTER_DEFAULT, mixed $options = []): mixed - { - $value = $this->get($key, $default); - - // Always turn $options into an array - this allows filter_var option shortcuts. - if (!\is_array($options) && $options) { - $options = ['flags' => $options]; - } - - // Add a convenience check for arrays. - if (\is_array($value) && !isset($options['flags'])) { - $options['flags'] = \FILTER_REQUIRE_ARRAY; - } - - if ((\FILTER_CALLBACK & $filter) && !(($options['options'] ?? null) instanceof \Closure)) { - throw new \InvalidArgumentException(sprintf('A Closure must be passed to "%s()" when FILTER_CALLBACK is used, "%s" given.', __METHOD__, get_debug_type($options['options'] ?? null))); - } - - return filter_var($value, $filter, $options); - } - - /** - * Returns an iterator for parameters. - * - * @return \ArrayIterator - */ - public function getIterator(): \ArrayIterator - { - return new \ArrayIterator($this->parameters); - } - - /** - * Returns the number of parameters. - */ - public function count(): int - { - return \count($this->parameters); - } -} diff --git a/vendor/symfony/http-foundation/README.md b/vendor/symfony/http-foundation/README.md deleted file mode 100644 index 5cf90074..00000000 --- a/vendor/symfony/http-foundation/README.md +++ /dev/null @@ -1,14 +0,0 @@ -HttpFoundation Component -======================== - -The HttpFoundation component defines an object-oriented layer for the HTTP -specification. - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/components/http_foundation.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/http-foundation/RateLimiter/AbstractRequestRateLimiter.php b/vendor/symfony/http-foundation/RateLimiter/AbstractRequestRateLimiter.php deleted file mode 100644 index 550090f9..00000000 --- a/vendor/symfony/http-foundation/RateLimiter/AbstractRequestRateLimiter.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\HttpFoundation\RateLimiter; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\RateLimiter\LimiterInterface; -use Symfony\Component\RateLimiter\Policy\NoLimiter; -use Symfony\Component\RateLimiter\RateLimit; - -/** - * An implementation of PeekableRequestRateLimiterInterface that - * fits most use-cases. - * - * @author Wouter de Jong - */ -abstract class AbstractRequestRateLimiter implements PeekableRequestRateLimiterInterface -{ - public function consume(Request $request): RateLimit - { - return $this->doConsume($request, 1); - } - - public function peek(Request $request): RateLimit - { - return $this->doConsume($request, 0); - } - - private function doConsume(Request $request, int $tokens): RateLimit - { - $limiters = $this->getLimiters($request); - if (0 === \count($limiters)) { - $limiters = [new NoLimiter()]; - } - - $minimalRateLimit = null; - foreach ($limiters as $limiter) { - $rateLimit = $limiter->consume($tokens); - - $minimalRateLimit = $minimalRateLimit ? self::getMinimalRateLimit($minimalRateLimit, $rateLimit) : $rateLimit; - } - - return $minimalRateLimit; - } - - public function reset(Request $request): void - { - foreach ($this->getLimiters($request) as $limiter) { - $limiter->reset(); - } - } - - /** - * @return LimiterInterface[] a set of limiters using keys extracted from the request - */ - abstract protected function getLimiters(Request $request): array; - - private static function getMinimalRateLimit(RateLimit $first, RateLimit $second): RateLimit - { - if ($first->isAccepted() !== $second->isAccepted()) { - return $first->isAccepted() ? $second : $first; - } - - $firstRemainingTokens = $first->getRemainingTokens(); - $secondRemainingTokens = $second->getRemainingTokens(); - - if ($firstRemainingTokens === $secondRemainingTokens) { - return $first->getRetryAfter() < $second->getRetryAfter() ? $second : $first; - } - - return $firstRemainingTokens > $secondRemainingTokens ? $second : $first; - } -} diff --git a/vendor/symfony/http-foundation/RateLimiter/PeekableRequestRateLimiterInterface.php b/vendor/symfony/http-foundation/RateLimiter/PeekableRequestRateLimiterInterface.php deleted file mode 100644 index 63471af2..00000000 --- a/vendor/symfony/http-foundation/RateLimiter/PeekableRequestRateLimiterInterface.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\RateLimiter; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\RateLimiter\RateLimit; - -/** - * A request limiter which allows peeking ahead. - * - * This is valuable to reduce the cache backend load in scenarios - * like a login when we only want to consume a token on login failure, - * and where the majority of requests will be successful and thus not - * need to consume a token. - * - * This way we can peek ahead before allowing the request through, and - * only consume if the request failed (1 backend op). This is compared - * to always consuming and then resetting the limit if the request - * is successful (2 backend ops). - * - * @author Jordi Boggiano - */ -interface PeekableRequestRateLimiterInterface extends RequestRateLimiterInterface -{ - public function peek(Request $request): RateLimit; -} diff --git a/vendor/symfony/http-foundation/RateLimiter/RequestRateLimiterInterface.php b/vendor/symfony/http-foundation/RateLimiter/RequestRateLimiterInterface.php deleted file mode 100644 index 4c87a40a..00000000 --- a/vendor/symfony/http-foundation/RateLimiter/RequestRateLimiterInterface.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\HttpFoundation\RateLimiter; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\RateLimiter\RateLimit; - -/** - * A special type of limiter that deals with requests. - * - * This allows to limit on different types of information - * from the requests. - * - * @author Wouter de Jong - */ -interface RequestRateLimiterInterface -{ - public function consume(Request $request): RateLimit; - - public function reset(Request $request): void; -} diff --git a/vendor/symfony/http-foundation/RedirectResponse.php b/vendor/symfony/http-foundation/RedirectResponse.php deleted file mode 100644 index a001df81..00000000 --- a/vendor/symfony/http-foundation/RedirectResponse.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\HttpFoundation; - -/** - * RedirectResponse represents an HTTP response doing a redirect. - * - * @author Fabien Potencier - */ -class RedirectResponse extends Response -{ - protected $targetUrl; - - /** - * Creates a redirect response so that it conforms to the rules defined for a redirect status code. - * - * @param string $url The URL to redirect to. The URL should be a full URL, with schema etc., - * but practically every browser redirects on paths only as well - * @param int $status The HTTP status code (302 "Found" by default) - * @param array $headers The headers (Location is always set to the given URL) - * - * @throws \InvalidArgumentException - * - * @see https://tools.ietf.org/html/rfc2616#section-10.3 - */ - public function __construct(string $url, int $status = 302, array $headers = []) - { - parent::__construct('', $status, $headers); - - $this->setTargetUrl($url); - - if (!$this->isRedirect()) { - throw new \InvalidArgumentException(sprintf('The HTTP status code is not a redirect ("%s" given).', $status)); - } - - if (301 == $status && !\array_key_exists('cache-control', array_change_key_case($headers, \CASE_LOWER))) { - $this->headers->remove('cache-control'); - } - } - - /** - * Returns the target URL. - */ - public function getTargetUrl(): string - { - return $this->targetUrl; - } - - /** - * Sets the redirect target of this response. - * - * @return $this - * - * @throws \InvalidArgumentException - */ - public function setTargetUrl(string $url): static - { - if ('' === $url) { - throw new \InvalidArgumentException('Cannot redirect to an empty URL.'); - } - - $this->targetUrl = $url; - - $this->setContent( - sprintf(' - - - - - - Redirecting to %1$s - - - Redirecting to %1$s. - -', htmlspecialchars($url, \ENT_QUOTES, 'UTF-8'))); - - $this->headers->set('Location', $url); - - return $this; - } -} diff --git a/vendor/symfony/http-foundation/Request.php b/vendor/symfony/http-foundation/Request.php deleted file mode 100644 index 3cf8a995..00000000 --- a/vendor/symfony/http-foundation/Request.php +++ /dev/null @@ -1,2029 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation; - -use Symfony\Component\HttpFoundation\Exception\ConflictingHeadersException; -use Symfony\Component\HttpFoundation\Exception\JsonException; -use Symfony\Component\HttpFoundation\Exception\SessionNotFoundException; -use Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException; -use Symfony\Component\HttpFoundation\Session\SessionInterface; - -// Help opcache.preload discover always-needed symbols -class_exists(AcceptHeader::class); -class_exists(FileBag::class); -class_exists(HeaderBag::class); -class_exists(HeaderUtils::class); -class_exists(InputBag::class); -class_exists(ParameterBag::class); -class_exists(ServerBag::class); - -/** - * Request represents an HTTP request. - * - * The methods dealing with URL accept / return a raw path (% encoded): - * * getBasePath - * * getBaseUrl - * * getPathInfo - * * getRequestUri - * * getUri - * * getUriForPath - * - * @author Fabien Potencier - */ -class Request -{ - public const HEADER_FORWARDED = 0b000001; // When using RFC 7239 - public const HEADER_X_FORWARDED_FOR = 0b000010; - public const HEADER_X_FORWARDED_HOST = 0b000100; - public const HEADER_X_FORWARDED_PROTO = 0b001000; - public const HEADER_X_FORWARDED_PORT = 0b010000; - public const HEADER_X_FORWARDED_PREFIX = 0b100000; - - public const HEADER_X_FORWARDED_AWS_ELB = 0b0011010; // AWS ELB doesn't send X-Forwarded-Host - public const HEADER_X_FORWARDED_TRAEFIK = 0b0111110; // All "X-Forwarded-*" headers sent by Traefik reverse proxy - - public const METHOD_HEAD = 'HEAD'; - public const METHOD_GET = 'GET'; - public const METHOD_POST = 'POST'; - public const METHOD_PUT = 'PUT'; - public const METHOD_PATCH = 'PATCH'; - public const METHOD_DELETE = 'DELETE'; - public const METHOD_PURGE = 'PURGE'; - public const METHOD_OPTIONS = 'OPTIONS'; - public const METHOD_TRACE = 'TRACE'; - public const METHOD_CONNECT = 'CONNECT'; - - /** - * @var string[] - */ - protected static $trustedProxies = []; - - /** - * @var string[] - */ - protected static $trustedHostPatterns = []; - - /** - * @var string[] - */ - protected static $trustedHosts = []; - - protected static $httpMethodParameterOverride = false; - - /** - * Custom parameters. - * - * @var ParameterBag - */ - public $attributes; - - /** - * Request body parameters ($_POST). - * - * @var InputBag - */ - public $request; - - /** - * Query string parameters ($_GET). - * - * @var InputBag - */ - public $query; - - /** - * Server and execution environment parameters ($_SERVER). - * - * @var ServerBag - */ - public $server; - - /** - * Uploaded files ($_FILES). - * - * @var FileBag - */ - public $files; - - /** - * Cookies ($_COOKIE). - * - * @var InputBag - */ - public $cookies; - - /** - * Headers (taken from the $_SERVER). - * - * @var HeaderBag - */ - public $headers; - - /** - * @var string|resource|false|null - */ - protected $content; - - /** - * @var string[] - */ - protected $languages; - - /** - * @var string[] - */ - protected $charsets; - - /** - * @var string[] - */ - protected $encodings; - - /** - * @var string[] - */ - protected $acceptableContentTypes; - - /** - * @var string - */ - protected $pathInfo; - - /** - * @var string - */ - protected $requestUri; - - /** - * @var string - */ - protected $baseUrl; - - /** - * @var string - */ - protected $basePath; - - /** - * @var string - */ - protected $method; - - /** - * @var string - */ - protected $format; - - /** - * @var SessionInterface|callable(): SessionInterface - */ - protected $session; - - /** - * @var string - */ - protected $locale; - - /** - * @var string - */ - protected $defaultLocale = 'en'; - - /** - * @var array - */ - protected static $formats; - - protected static $requestFactory; - - private ?string $preferredFormat = null; - private bool $isHostValid = true; - private bool $isForwardedValid = true; - private bool $isSafeContentPreferred; - - private static int $trustedHeaderSet = -1; - - private const FORWARDED_PARAMS = [ - self::HEADER_X_FORWARDED_FOR => 'for', - self::HEADER_X_FORWARDED_HOST => 'host', - self::HEADER_X_FORWARDED_PROTO => 'proto', - self::HEADER_X_FORWARDED_PORT => 'host', - ]; - - /** - * Names for headers that can be trusted when - * using trusted proxies. - * - * The FORWARDED header is the standard as of rfc7239. - * - * The other headers are non-standard, but widely used - * by popular reverse proxies (like Apache mod_proxy or Amazon EC2). - */ - private const TRUSTED_HEADERS = [ - self::HEADER_FORWARDED => 'FORWARDED', - self::HEADER_X_FORWARDED_FOR => 'X_FORWARDED_FOR', - self::HEADER_X_FORWARDED_HOST => 'X_FORWARDED_HOST', - self::HEADER_X_FORWARDED_PROTO => 'X_FORWARDED_PROTO', - self::HEADER_X_FORWARDED_PORT => 'X_FORWARDED_PORT', - self::HEADER_X_FORWARDED_PREFIX => 'X_FORWARDED_PREFIX', - ]; - - /** - * @param array $query The GET parameters - * @param array $request The POST parameters - * @param array $attributes The request attributes (parameters parsed from the PATH_INFO, ...) - * @param array $cookies The COOKIE parameters - * @param array $files The FILES parameters - * @param array $server The SERVER parameters - * @param string|resource|null $content The raw body data - */ - public function __construct(array $query = [], array $request = [], array $attributes = [], array $cookies = [], array $files = [], array $server = [], $content = null) - { - $this->initialize($query, $request, $attributes, $cookies, $files, $server, $content); - } - - /** - * Sets the parameters for this request. - * - * This method also re-initializes all properties. - * - * @param array $query The GET parameters - * @param array $request The POST parameters - * @param array $attributes The request attributes (parameters parsed from the PATH_INFO, ...) - * @param array $cookies The COOKIE parameters - * @param array $files The FILES parameters - * @param array $server The SERVER parameters - * @param string|resource|null $content The raw body data - */ - public function initialize(array $query = [], array $request = [], array $attributes = [], array $cookies = [], array $files = [], array $server = [], $content = null) - { - $this->request = new InputBag($request); - $this->query = new InputBag($query); - $this->attributes = new ParameterBag($attributes); - $this->cookies = new InputBag($cookies); - $this->files = new FileBag($files); - $this->server = new ServerBag($server); - $this->headers = new HeaderBag($this->server->getHeaders()); - - $this->content = $content; - $this->languages = null; - $this->charsets = null; - $this->encodings = null; - $this->acceptableContentTypes = null; - $this->pathInfo = null; - $this->requestUri = null; - $this->baseUrl = null; - $this->basePath = null; - $this->method = null; - $this->format = null; - } - - /** - * Creates a new request with values from PHP's super globals. - */ - public static function createFromGlobals(): static - { - $request = self::createRequestFromFactory($_GET, $_POST, [], $_COOKIE, $_FILES, $_SERVER); - - if (str_starts_with($request->headers->get('CONTENT_TYPE', ''), 'application/x-www-form-urlencoded') - && \in_array(strtoupper($request->server->get('REQUEST_METHOD', 'GET')), ['PUT', 'DELETE', 'PATCH']) - ) { - parse_str($request->getContent(), $data); - $request->request = new InputBag($data); - } - - return $request; - } - - /** - * Creates a Request based on a given URI and configuration. - * - * The information contained in the URI always take precedence - * over the other information (server and parameters). - * - * @param string $uri The URI - * @param string $method The HTTP method - * @param array $parameters The query (GET) or request (POST) parameters - * @param array $cookies The request cookies ($_COOKIE) - * @param array $files The request files ($_FILES) - * @param array $server The server parameters ($_SERVER) - * @param string|resource|null $content The raw body data - */ - public static function create(string $uri, string $method = 'GET', array $parameters = [], array $cookies = [], array $files = [], array $server = [], $content = null): static - { - $server = array_replace([ - 'SERVER_NAME' => 'localhost', - 'SERVER_PORT' => 80, - 'HTTP_HOST' => 'localhost', - 'HTTP_USER_AGENT' => 'Symfony', - 'HTTP_ACCEPT' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', - 'HTTP_ACCEPT_LANGUAGE' => 'en-us,en;q=0.5', - 'HTTP_ACCEPT_CHARSET' => 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', - 'REMOTE_ADDR' => '127.0.0.1', - 'SCRIPT_NAME' => '', - 'SCRIPT_FILENAME' => '', - 'SERVER_PROTOCOL' => 'HTTP/1.1', - 'REQUEST_TIME' => time(), - 'REQUEST_TIME_FLOAT' => microtime(true), - ], $server); - - $server['PATH_INFO'] = ''; - $server['REQUEST_METHOD'] = strtoupper($method); - - $components = parse_url($uri); - if (isset($components['host'])) { - $server['SERVER_NAME'] = $components['host']; - $server['HTTP_HOST'] = $components['host']; - } - - if (isset($components['scheme'])) { - if ('https' === $components['scheme']) { - $server['HTTPS'] = 'on'; - $server['SERVER_PORT'] = 443; - } else { - unset($server['HTTPS']); - $server['SERVER_PORT'] = 80; - } - } - - if (isset($components['port'])) { - $server['SERVER_PORT'] = $components['port']; - $server['HTTP_HOST'] .= ':'.$components['port']; - } - - if (isset($components['user'])) { - $server['PHP_AUTH_USER'] = $components['user']; - } - - if (isset($components['pass'])) { - $server['PHP_AUTH_PW'] = $components['pass']; - } - - if (!isset($components['path'])) { - $components['path'] = '/'; - } - - switch (strtoupper($method)) { - case 'POST': - case 'PUT': - case 'DELETE': - if (!isset($server['CONTENT_TYPE'])) { - $server['CONTENT_TYPE'] = 'application/x-www-form-urlencoded'; - } - // no break - case 'PATCH': - $request = $parameters; - $query = []; - break; - default: - $request = []; - $query = $parameters; - break; - } - - $queryString = ''; - if (isset($components['query'])) { - parse_str(html_entity_decode($components['query']), $qs); - - if ($query) { - $query = array_replace($qs, $query); - $queryString = http_build_query($query, '', '&'); - } else { - $query = $qs; - $queryString = $components['query']; - } - } elseif ($query) { - $queryString = http_build_query($query, '', '&'); - } - - $server['REQUEST_URI'] = $components['path'].('' !== $queryString ? '?'.$queryString : ''); - $server['QUERY_STRING'] = $queryString; - - return self::createRequestFromFactory($query, $request, [], $cookies, $files, $server, $content); - } - - /** - * Sets a callable able to create a Request instance. - * - * This is mainly useful when you need to override the Request class - * to keep BC with an existing system. It should not be used for any - * other purpose. - */ - public static function setFactory(?callable $callable) - { - self::$requestFactory = $callable; - } - - /** - * Clones a request and overrides some of its parameters. - * - * @param array $query The GET parameters - * @param array $request The POST parameters - * @param array $attributes The request attributes (parameters parsed from the PATH_INFO, ...) - * @param array $cookies The COOKIE parameters - * @param array $files The FILES parameters - * @param array $server The SERVER parameters - */ - public function duplicate(array $query = null, array $request = null, array $attributes = null, array $cookies = null, array $files = null, array $server = null): static - { - $dup = clone $this; - if (null !== $query) { - $dup->query = new InputBag($query); - } - if (null !== $request) { - $dup->request = new InputBag($request); - } - if (null !== $attributes) { - $dup->attributes = new ParameterBag($attributes); - } - if (null !== $cookies) { - $dup->cookies = new InputBag($cookies); - } - if (null !== $files) { - $dup->files = new FileBag($files); - } - if (null !== $server) { - $dup->server = new ServerBag($server); - $dup->headers = new HeaderBag($dup->server->getHeaders()); - } - $dup->languages = null; - $dup->charsets = null; - $dup->encodings = null; - $dup->acceptableContentTypes = null; - $dup->pathInfo = null; - $dup->requestUri = null; - $dup->baseUrl = null; - $dup->basePath = null; - $dup->method = null; - $dup->format = null; - - if (!$dup->get('_format') && $this->get('_format')) { - $dup->attributes->set('_format', $this->get('_format')); - } - - if (!$dup->getRequestFormat(null)) { - $dup->setRequestFormat($this->getRequestFormat(null)); - } - - return $dup; - } - - /** - * Clones the current request. - * - * Note that the session is not cloned as duplicated requests - * are most of the time sub-requests of the main one. - */ - public function __clone() - { - $this->query = clone $this->query; - $this->request = clone $this->request; - $this->attributes = clone $this->attributes; - $this->cookies = clone $this->cookies; - $this->files = clone $this->files; - $this->server = clone $this->server; - $this->headers = clone $this->headers; - } - - public function __toString(): string - { - $content = $this->getContent(); - - $cookieHeader = ''; - $cookies = []; - - foreach ($this->cookies as $k => $v) { - $cookies[] = \is_array($v) ? http_build_query([$k => $v], '', '; ', \PHP_QUERY_RFC3986) : "$k=$v"; - } - - if ($cookies) { - $cookieHeader = 'Cookie: '.implode('; ', $cookies)."\r\n"; - } - - return - sprintf('%s %s %s', $this->getMethod(), $this->getRequestUri(), $this->server->get('SERVER_PROTOCOL'))."\r\n". - $this->headers. - $cookieHeader."\r\n". - $content; - } - - /** - * Overrides the PHP global variables according to this request instance. - * - * It overrides $_GET, $_POST, $_REQUEST, $_SERVER, $_COOKIE. - * $_FILES is never overridden, see rfc1867 - */ - public function overrideGlobals() - { - $this->server->set('QUERY_STRING', static::normalizeQueryString(http_build_query($this->query->all(), '', '&'))); - - $_GET = $this->query->all(); - $_POST = $this->request->all(); - $_SERVER = $this->server->all(); - $_COOKIE = $this->cookies->all(); - - foreach ($this->headers->all() as $key => $value) { - $key = strtoupper(str_replace('-', '_', $key)); - if (\in_array($key, ['CONTENT_TYPE', 'CONTENT_LENGTH', 'CONTENT_MD5'], true)) { - $_SERVER[$key] = implode(', ', $value); - } else { - $_SERVER['HTTP_'.$key] = implode(', ', $value); - } - } - - $request = ['g' => $_GET, 'p' => $_POST, 'c' => $_COOKIE]; - - $requestOrder = \ini_get('request_order') ?: \ini_get('variables_order'); - $requestOrder = preg_replace('#[^cgp]#', '', strtolower($requestOrder)) ?: 'gp'; - - $_REQUEST = [[]]; - - foreach (str_split($requestOrder) as $order) { - $_REQUEST[] = $request[$order]; - } - - $_REQUEST = array_merge(...$_REQUEST); - } - - /** - * Sets a list of trusted proxies. - * - * You should only list the reverse proxies that you manage directly. - * - * @param array $proxies A list of trusted proxies, the string 'REMOTE_ADDR' will be replaced with $_SERVER['REMOTE_ADDR'] - * @param int $trustedHeaderSet A bit field of Request::HEADER_*, to set which headers to trust from your proxies - */ - public static function setTrustedProxies(array $proxies, int $trustedHeaderSet) - { - self::$trustedProxies = array_reduce($proxies, function ($proxies, $proxy) { - if ('REMOTE_ADDR' !== $proxy) { - $proxies[] = $proxy; - } elseif (isset($_SERVER['REMOTE_ADDR'])) { - $proxies[] = $_SERVER['REMOTE_ADDR']; - } - - return $proxies; - }, []); - self::$trustedHeaderSet = $trustedHeaderSet; - } - - /** - * Gets the list of trusted proxies. - * - * @return string[] - */ - public static function getTrustedProxies(): array - { - return self::$trustedProxies; - } - - /** - * Gets the set of trusted headers from trusted proxies. - * - * @return int A bit field of Request::HEADER_* that defines which headers are trusted from your proxies - */ - public static function getTrustedHeaderSet(): int - { - return self::$trustedHeaderSet; - } - - /** - * Sets a list of trusted host patterns. - * - * You should only list the hosts you manage using regexs. - * - * @param array $hostPatterns A list of trusted host patterns - */ - public static function setTrustedHosts(array $hostPatterns) - { - self::$trustedHostPatterns = array_map(function ($hostPattern) { - return sprintf('{%s}i', $hostPattern); - }, $hostPatterns); - // we need to reset trusted hosts on trusted host patterns change - self::$trustedHosts = []; - } - - /** - * Gets the list of trusted host patterns. - * - * @return string[] - */ - public static function getTrustedHosts(): array - { - return self::$trustedHostPatterns; - } - - /** - * Normalizes a query string. - * - * It builds a normalized query string, where keys/value pairs are alphabetized, - * have consistent escaping and unneeded delimiters are removed. - */ - public static function normalizeQueryString(?string $qs): string - { - if ('' === ($qs ?? '')) { - return ''; - } - - $qs = HeaderUtils::parseQuery($qs); - ksort($qs); - - return http_build_query($qs, '', '&', \PHP_QUERY_RFC3986); - } - - /** - * Enables support for the _method request parameter to determine the intended HTTP method. - * - * Be warned that enabling this feature might lead to CSRF issues in your code. - * Check that you are using CSRF tokens when required. - * If the HTTP method parameter override is enabled, an html-form with method "POST" can be altered - * and used to send a "PUT" or "DELETE" request via the _method request parameter. - * If these methods are not protected against CSRF, this presents a possible vulnerability. - * - * The HTTP method can only be overridden when the real HTTP method is POST. - */ - public static function enableHttpMethodParameterOverride() - { - self::$httpMethodParameterOverride = true; - } - - /** - * Checks whether support for the _method request parameter is enabled. - */ - public static function getHttpMethodParameterOverride(): bool - { - return self::$httpMethodParameterOverride; - } - - /** - * Gets a "parameter" value from any bag. - * - * This method is mainly useful for libraries that want to provide some flexibility. If you don't need the - * flexibility in controllers, it is better to explicitly get request parameters from the appropriate - * public property instead (attributes, query, request). - * - * Order of precedence: PATH (routing placeholders or custom attributes), GET, POST - * - * @internal use explicit input sources instead - */ - public function get(string $key, mixed $default = null): mixed - { - if ($this !== $result = $this->attributes->get($key, $this)) { - return $result; - } - - if ($this->query->has($key)) { - return $this->query->all()[$key]; - } - - if ($this->request->has($key)) { - return $this->request->all()[$key]; - } - - return $default; - } - - /** - * Gets the Session. - * - * @throws SessionNotFoundException When session is not set properly - */ - public function getSession(): SessionInterface - { - $session = $this->session; - if (!$session instanceof SessionInterface && null !== $session) { - $this->setSession($session = $session()); - } - - if (null === $session) { - throw new SessionNotFoundException('Session has not been set.'); - } - - return $session; - } - - /** - * Whether the request contains a Session which was started in one of the - * previous requests. - */ - public function hasPreviousSession(): bool - { - // the check for $this->session avoids malicious users trying to fake a session cookie with proper name - return $this->hasSession() && $this->cookies->has($this->getSession()->getName()); - } - - /** - * Whether the request contains a Session object. - * - * This method does not give any information about the state of the session object, - * like whether the session is started or not. It is just a way to check if this Request - * is associated with a Session instance. - * - * @param bool $skipIfUninitialized When true, ignores factories injected by `setSessionFactory` - */ - public function hasSession(bool $skipIfUninitialized = false): bool - { - return null !== $this->session && (!$skipIfUninitialized || $this->session instanceof SessionInterface); - } - - public function setSession(SessionInterface $session) - { - $this->session = $session; - } - - /** - * @internal - * - * @param callable(): SessionInterface $factory - */ - public function setSessionFactory(callable $factory) - { - $this->session = $factory; - } - - /** - * Returns the client IP addresses. - * - * In the returned array the most trusted IP address is first, and the - * least trusted one last. The "real" client IP address is the last one, - * but this is also the least trusted one. Trusted proxies are stripped. - * - * Use this method carefully; you should use getClientIp() instead. - * - * @see getClientIp() - */ - public function getClientIps(): array - { - $ip = $this->server->get('REMOTE_ADDR'); - - if (!$this->isFromTrustedProxy()) { - return [$ip]; - } - - return $this->getTrustedValues(self::HEADER_X_FORWARDED_FOR, $ip) ?: [$ip]; - } - - /** - * Returns the client IP address. - * - * This method can read the client IP address from the "X-Forwarded-For" header - * when trusted proxies were set via "setTrustedProxies()". The "X-Forwarded-For" - * header value is a comma+space separated list of IP addresses, the left-most - * being the original client, and each successive proxy that passed the request - * adding the IP address where it received the request from. - * - * If your reverse proxy uses a different header name than "X-Forwarded-For", - * ("Client-Ip" for instance), configure it via the $trustedHeaderSet - * argument of the Request::setTrustedProxies() method instead. - * - * @see getClientIps() - * @see https://wikipedia.org/wiki/X-Forwarded-For - */ - public function getClientIp(): ?string - { - $ipAddresses = $this->getClientIps(); - - return $ipAddresses[0]; - } - - /** - * Returns current script name. - */ - public function getScriptName(): string - { - return $this->server->get('SCRIPT_NAME', $this->server->get('ORIG_SCRIPT_NAME', '')); - } - - /** - * Returns the path being requested relative to the executed script. - * - * The path info always starts with a /. - * - * Suppose this request is instantiated from /mysite on localhost: - * - * * http://localhost/mysite returns an empty string - * * http://localhost/mysite/about returns '/about' - * * http://localhost/mysite/enco%20ded returns '/enco%20ded' - * * http://localhost/mysite/about?var=1 returns '/about' - * - * @return string The raw path (i.e. not urldecoded) - */ - public function getPathInfo(): string - { - return $this->pathInfo ??= $this->preparePathInfo(); - } - - /** - * Returns the root path from which this request is executed. - * - * Suppose that an index.php file instantiates this request object: - * - * * http://localhost/index.php returns an empty string - * * http://localhost/index.php/page returns an empty string - * * http://localhost/web/index.php returns '/web' - * * http://localhost/we%20b/index.php returns '/we%20b' - * - * @return string The raw path (i.e. not urldecoded) - */ - public function getBasePath(): string - { - return $this->basePath ??= $this->prepareBasePath(); - } - - /** - * Returns the root URL from which this request is executed. - * - * The base URL never ends with a /. - * - * This is similar to getBasePath(), except that it also includes the - * script filename (e.g. index.php) if one exists. - * - * @return string The raw URL (i.e. not urldecoded) - */ - public function getBaseUrl(): string - { - $trustedPrefix = ''; - - // the proxy prefix must be prepended to any prefix being needed at the webserver level - if ($this->isFromTrustedProxy() && $trustedPrefixValues = $this->getTrustedValues(self::HEADER_X_FORWARDED_PREFIX)) { - $trustedPrefix = rtrim($trustedPrefixValues[0], '/'); - } - - return $trustedPrefix.$this->getBaseUrlReal(); - } - - /** - * Returns the real base URL received by the webserver from which this request is executed. - * The URL does not include trusted reverse proxy prefix. - * - * @return string The raw URL (i.e. not urldecoded) - */ - private function getBaseUrlReal(): string - { - return $this->baseUrl ??= $this->prepareBaseUrl(); - } - - /** - * Gets the request's scheme. - */ - public function getScheme(): string - { - return $this->isSecure() ? 'https' : 'http'; - } - - /** - * Returns the port on which the request is made. - * - * This method can read the client port from the "X-Forwarded-Port" header - * when trusted proxies were set via "setTrustedProxies()". - * - * The "X-Forwarded-Port" header must contain the client port. - * - * @return int|string|null Can be a string if fetched from the server bag - */ - public function getPort(): int|string|null - { - if ($this->isFromTrustedProxy() && $host = $this->getTrustedValues(self::HEADER_X_FORWARDED_PORT)) { - $host = $host[0]; - } elseif ($this->isFromTrustedProxy() && $host = $this->getTrustedValues(self::HEADER_X_FORWARDED_HOST)) { - $host = $host[0]; - } elseif (!$host = $this->headers->get('HOST')) { - return $this->server->get('SERVER_PORT'); - } - - if ('[' === $host[0]) { - $pos = strpos($host, ':', strrpos($host, ']')); - } else { - $pos = strrpos($host, ':'); - } - - if (false !== $pos && $port = substr($host, $pos + 1)) { - return (int) $port; - } - - return 'https' === $this->getScheme() ? 443 : 80; - } - - /** - * Returns the user. - */ - public function getUser(): ?string - { - return $this->headers->get('PHP_AUTH_USER'); - } - - /** - * Returns the password. - */ - public function getPassword(): ?string - { - return $this->headers->get('PHP_AUTH_PW'); - } - - /** - * Gets the user info. - * - * @return string|null A user name if any and, optionally, scheme-specific information about how to gain authorization to access the server - */ - public function getUserInfo(): ?string - { - $userinfo = $this->getUser(); - - $pass = $this->getPassword(); - if ('' != $pass) { - $userinfo .= ":$pass"; - } - - return $userinfo; - } - - /** - * Returns the HTTP host being requested. - * - * The port name will be appended to the host if it's non-standard. - */ - public function getHttpHost(): string - { - $scheme = $this->getScheme(); - $port = $this->getPort(); - - if (('http' === $scheme && 80 == $port) || ('https' === $scheme && 443 == $port)) { - return $this->getHost(); - } - - return $this->getHost().':'.$port; - } - - /** - * Returns the requested URI (path and query string). - * - * @return string The raw URI (i.e. not URI decoded) - */ - public function getRequestUri(): string - { - return $this->requestUri ??= $this->prepareRequestUri(); - } - - /** - * Gets the scheme and HTTP host. - * - * If the URL was called with basic authentication, the user - * and the password are not added to the generated string. - */ - public function getSchemeAndHttpHost(): string - { - return $this->getScheme().'://'.$this->getHttpHost(); - } - - /** - * Generates a normalized URI (URL) for the Request. - * - * @see getQueryString() - */ - public function getUri(): string - { - if (null !== $qs = $this->getQueryString()) { - $qs = '?'.$qs; - } - - return $this->getSchemeAndHttpHost().$this->getBaseUrl().$this->getPathInfo().$qs; - } - - /** - * Generates a normalized URI for the given path. - * - * @param string $path A path to use instead of the current one - */ - public function getUriForPath(string $path): string - { - return $this->getSchemeAndHttpHost().$this->getBaseUrl().$path; - } - - /** - * Returns the path as relative reference from the current Request path. - * - * Only the URIs path component (no schema, host etc.) is relevant and must be given. - * Both paths must be absolute and not contain relative parts. - * Relative URLs from one resource to another are useful when generating self-contained downloadable document archives. - * Furthermore, they can be used to reduce the link size in documents. - * - * Example target paths, given a base path of "/a/b/c/d": - * - "/a/b/c/d" -> "" - * - "/a/b/c/" -> "./" - * - "/a/b/" -> "../" - * - "/a/b/c/other" -> "other" - * - "/a/x/y" -> "../../x/y" - */ - public function getRelativeUriForPath(string $path): string - { - // be sure that we are dealing with an absolute path - if (!isset($path[0]) || '/' !== $path[0]) { - return $path; - } - - if ($path === $basePath = $this->getPathInfo()) { - return ''; - } - - $sourceDirs = explode('/', isset($basePath[0]) && '/' === $basePath[0] ? substr($basePath, 1) : $basePath); - $targetDirs = explode('/', substr($path, 1)); - array_pop($sourceDirs); - $targetFile = array_pop($targetDirs); - - foreach ($sourceDirs as $i => $dir) { - if (isset($targetDirs[$i]) && $dir === $targetDirs[$i]) { - unset($sourceDirs[$i], $targetDirs[$i]); - } else { - break; - } - } - - $targetDirs[] = $targetFile; - $path = str_repeat('../', \count($sourceDirs)).implode('/', $targetDirs); - - // A reference to the same base directory or an empty subdirectory must be prefixed with "./". - // This also applies to a segment with a colon character (e.g., "file:colon") that cannot be used - // as the first segment of a relative-path reference, as it would be mistaken for a scheme name - // (see https://tools.ietf.org/html/rfc3986#section-4.2). - return !isset($path[0]) || '/' === $path[0] - || false !== ($colonPos = strpos($path, ':')) && ($colonPos < ($slashPos = strpos($path, '/')) || false === $slashPos) - ? "./$path" : $path; - } - - /** - * Generates the normalized query string for the Request. - * - * It builds a normalized query string, where keys/value pairs are alphabetized - * and have consistent escaping. - */ - public function getQueryString(): ?string - { - $qs = static::normalizeQueryString($this->server->get('QUERY_STRING')); - - return '' === $qs ? null : $qs; - } - - /** - * Checks whether the request is secure or not. - * - * This method can read the client protocol from the "X-Forwarded-Proto" header - * when trusted proxies were set via "setTrustedProxies()". - * - * The "X-Forwarded-Proto" header must contain the protocol: "https" or "http". - */ - public function isSecure(): bool - { - if ($this->isFromTrustedProxy() && $proto = $this->getTrustedValues(self::HEADER_X_FORWARDED_PROTO)) { - return \in_array(strtolower($proto[0]), ['https', 'on', 'ssl', '1'], true); - } - - $https = $this->server->get('HTTPS'); - - return !empty($https) && 'off' !== strtolower($https); - } - - /** - * Returns the host name. - * - * This method can read the client host name from the "X-Forwarded-Host" header - * when trusted proxies were set via "setTrustedProxies()". - * - * The "X-Forwarded-Host" header must contain the client host name. - * - * @throws SuspiciousOperationException when the host name is invalid or not trusted - */ - public function getHost(): string - { - if ($this->isFromTrustedProxy() && $host = $this->getTrustedValues(self::HEADER_X_FORWARDED_HOST)) { - $host = $host[0]; - } elseif (!$host = $this->headers->get('HOST')) { - if (!$host = $this->server->get('SERVER_NAME')) { - $host = $this->server->get('SERVER_ADDR', ''); - } - } - - // trim and remove port number from host - // host is lowercase as per RFC 952/2181 - $host = strtolower(preg_replace('/:\d+$/', '', trim($host))); - - // as the host can come from the user (HTTP_HOST and depending on the configuration, SERVER_NAME too can come from the user) - // check that it does not contain forbidden characters (see RFC 952 and RFC 2181) - // use preg_replace() instead of preg_match() to prevent DoS attacks with long host names - if ($host && '' !== preg_replace('/(?:^\[)?[a-zA-Z0-9-:\]_]+\.?/', '', $host)) { - if (!$this->isHostValid) { - return ''; - } - $this->isHostValid = false; - - throw new SuspiciousOperationException(sprintf('Invalid Host "%s".', $host)); - } - - if (\count(self::$trustedHostPatterns) > 0) { - // to avoid host header injection attacks, you should provide a list of trusted host patterns - - if (\in_array($host, self::$trustedHosts)) { - return $host; - } - - foreach (self::$trustedHostPatterns as $pattern) { - if (preg_match($pattern, $host)) { - self::$trustedHosts[] = $host; - - return $host; - } - } - - if (!$this->isHostValid) { - return ''; - } - $this->isHostValid = false; - - throw new SuspiciousOperationException(sprintf('Untrusted Host "%s".', $host)); - } - - return $host; - } - - /** - * Sets the request method. - */ - public function setMethod(string $method) - { - $this->method = null; - $this->server->set('REQUEST_METHOD', $method); - } - - /** - * Gets the request "intended" method. - * - * If the X-HTTP-Method-Override header is set, and if the method is a POST, - * then it is used to determine the "real" intended HTTP method. - * - * The _method request parameter can also be used to determine the HTTP method, - * but only if enableHttpMethodParameterOverride() has been called. - * - * The method is always an uppercased string. - * - * @see getRealMethod() - */ - public function getMethod(): string - { - if (null !== $this->method) { - return $this->method; - } - - $this->method = strtoupper($this->server->get('REQUEST_METHOD', 'GET')); - - if ('POST' !== $this->method) { - return $this->method; - } - - $method = $this->headers->get('X-HTTP-METHOD-OVERRIDE'); - - if (!$method && self::$httpMethodParameterOverride) { - $method = $this->request->get('_method', $this->query->get('_method', 'POST')); - } - - if (!\is_string($method)) { - return $this->method; - } - - $method = strtoupper($method); - - if (\in_array($method, ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'PATCH', 'PURGE', 'TRACE'], true)) { - return $this->method = $method; - } - - if (!preg_match('/^[A-Z]++$/D', $method)) { - throw new SuspiciousOperationException(sprintf('Invalid method override "%s".', $method)); - } - - return $this->method = $method; - } - - /** - * Gets the "real" request method. - * - * @see getMethod() - */ - public function getRealMethod(): string - { - return strtoupper($this->server->get('REQUEST_METHOD', 'GET')); - } - - /** - * Gets the mime type associated with the format. - */ - public function getMimeType(string $format): ?string - { - if (null === static::$formats) { - static::initializeFormats(); - } - - return isset(static::$formats[$format]) ? static::$formats[$format][0] : null; - } - - /** - * Gets the mime types associated with the format. - * - * @return string[] - */ - public static function getMimeTypes(string $format): array - { - if (null === static::$formats) { - static::initializeFormats(); - } - - return static::$formats[$format] ?? []; - } - - /** - * Gets the format associated with the mime type. - */ - public function getFormat(?string $mimeType): ?string - { - $canonicalMimeType = null; - if ($mimeType && false !== $pos = strpos($mimeType, ';')) { - $canonicalMimeType = trim(substr($mimeType, 0, $pos)); - } - - if (null === static::$formats) { - static::initializeFormats(); - } - - foreach (static::$formats as $format => $mimeTypes) { - if (\in_array($mimeType, (array) $mimeTypes)) { - return $format; - } - if (null !== $canonicalMimeType && \in_array($canonicalMimeType, (array) $mimeTypes)) { - return $format; - } - } - - return null; - } - - /** - * Associates a format with mime types. - * - * @param string|string[] $mimeTypes The associated mime types (the preferred one must be the first as it will be used as the content type) - */ - public function setFormat(?string $format, string|array $mimeTypes) - { - if (null === static::$formats) { - static::initializeFormats(); - } - - static::$formats[$format] = \is_array($mimeTypes) ? $mimeTypes : [$mimeTypes]; - } - - /** - * Gets the request format. - * - * Here is the process to determine the format: - * - * * format defined by the user (with setRequestFormat()) - * * _format request attribute - * * $default - * - * @see getPreferredFormat - */ - public function getRequestFormat(?string $default = 'html'): ?string - { - $this->format ??= $this->attributes->get('_format'); - - return $this->format ?? $default; - } - - /** - * Sets the request format. - */ - public function setRequestFormat(?string $format) - { - $this->format = $format; - } - - /** - * Gets the usual name of the format associated with the request's media type (provided in the Content-Type header). - * - * @deprecated since Symfony 6.2, use getContentTypeFormat() instead - */ - public function getContentType(): ?string - { - trigger_deprecation('symfony/http-foundation', '6.2', 'The "%s()" method is deprecated, use "getContentTypeFormat()" instead.', __METHOD__); - - return $this->getContentTypeFormat(); - } - - /** - * Gets the usual name of the format associated with the request's media type (provided in the Content-Type header). - * - * @see Request::$formats - */ - public function getContentTypeFormat(): ?string - { - return $this->getFormat($this->headers->get('CONTENT_TYPE', '')); - } - - /** - * Sets the default locale. - */ - public function setDefaultLocale(string $locale) - { - $this->defaultLocale = $locale; - - if (null === $this->locale) { - $this->setPhpDefaultLocale($locale); - } - } - - /** - * Get the default locale. - */ - public function getDefaultLocale(): string - { - return $this->defaultLocale; - } - - /** - * Sets the locale. - */ - public function setLocale(string $locale) - { - $this->setPhpDefaultLocale($this->locale = $locale); - } - - /** - * Get the locale. - */ - public function getLocale(): string - { - return null === $this->locale ? $this->defaultLocale : $this->locale; - } - - /** - * Checks if the request method is of specified type. - * - * @param string $method Uppercase request method (GET, POST etc) - */ - public function isMethod(string $method): bool - { - return $this->getMethod() === strtoupper($method); - } - - /** - * Checks whether or not the method is safe. - * - * @see https://tools.ietf.org/html/rfc7231#section-4.2.1 - */ - public function isMethodSafe(): bool - { - return \in_array($this->getMethod(), ['GET', 'HEAD', 'OPTIONS', 'TRACE']); - } - - /** - * Checks whether or not the method is idempotent. - */ - public function isMethodIdempotent(): bool - { - return \in_array($this->getMethod(), ['HEAD', 'GET', 'PUT', 'DELETE', 'TRACE', 'OPTIONS', 'PURGE']); - } - - /** - * Checks whether the method is cacheable or not. - * - * @see https://tools.ietf.org/html/rfc7231#section-4.2.3 - */ - public function isMethodCacheable(): bool - { - return \in_array($this->getMethod(), ['GET', 'HEAD']); - } - - /** - * Returns the protocol version. - * - * If the application is behind a proxy, the protocol version used in the - * requests between the client and the proxy and between the proxy and the - * server might be different. This returns the former (from the "Via" header) - * if the proxy is trusted (see "setTrustedProxies()"), otherwise it returns - * the latter (from the "SERVER_PROTOCOL" server parameter). - */ - public function getProtocolVersion(): ?string - { - if ($this->isFromTrustedProxy()) { - preg_match('~^(HTTP/)?([1-9]\.[0-9]) ~', $this->headers->get('Via') ?? '', $matches); - - if ($matches) { - return 'HTTP/'.$matches[2]; - } - } - - return $this->server->get('SERVER_PROTOCOL'); - } - - /** - * Returns the request body content. - * - * @param bool $asResource If true, a resource will be returned - * - * @return string|resource - * @psalm-return ($asResource is true ? resource : string) - */ - public function getContent(bool $asResource = false) - { - $currentContentIsResource = \is_resource($this->content); - - if (true === $asResource) { - if ($currentContentIsResource) { - rewind($this->content); - - return $this->content; - } - - // Content passed in parameter (test) - if (\is_string($this->content)) { - $resource = fopen('php://temp', 'r+'); - fwrite($resource, $this->content); - rewind($resource); - - return $resource; - } - - $this->content = false; - - return fopen('php://input', 'r'); - } - - if ($currentContentIsResource) { - rewind($this->content); - - return stream_get_contents($this->content); - } - - if (null === $this->content || false === $this->content) { - $this->content = file_get_contents('php://input'); - } - - return $this->content; - } - - /** - * Gets the request body decoded as array, typically from a JSON payload. - * - * @throws JsonException When the body cannot be decoded to an array - */ - public function toArray(): array - { - if ('' === $content = $this->getContent()) { - throw new JsonException('Request body is empty.'); - } - - try { - $content = json_decode($content, true, 512, \JSON_BIGINT_AS_STRING | \JSON_THROW_ON_ERROR); - } catch (\JsonException $e) { - throw new JsonException('Could not decode request body.', $e->getCode(), $e); - } - - if (!\is_array($content)) { - throw new JsonException(sprintf('JSON content was expected to decode to an array, "%s" returned.', get_debug_type($content))); - } - - return $content; - } - - /** - * Gets the Etags. - */ - public function getETags(): array - { - return preg_split('/\s*,\s*/', $this->headers->get('If-None-Match', ''), -1, \PREG_SPLIT_NO_EMPTY); - } - - public function isNoCache(): bool - { - return $this->headers->hasCacheControlDirective('no-cache') || 'no-cache' == $this->headers->get('Pragma'); - } - - /** - * Gets the preferred format for the response by inspecting, in the following order: - * * the request format set using setRequestFormat; - * * the values of the Accept HTTP header. - * - * Note that if you use this method, you should send the "Vary: Accept" header - * in the response to prevent any issues with intermediary HTTP caches. - */ - public function getPreferredFormat(?string $default = 'html'): ?string - { - if (null !== $this->preferredFormat || null !== $this->preferredFormat = $this->getRequestFormat(null)) { - return $this->preferredFormat; - } - - foreach ($this->getAcceptableContentTypes() as $mimeType) { - if ($this->preferredFormat = $this->getFormat($mimeType)) { - return $this->preferredFormat; - } - } - - return $default; - } - - /** - * Returns the preferred language. - * - * @param string[] $locales An array of ordered available locales - */ - public function getPreferredLanguage(array $locales = null): ?string - { - $preferredLanguages = $this->getLanguages(); - - if (empty($locales)) { - return $preferredLanguages[0] ?? null; - } - - if (!$preferredLanguages) { - return $locales[0]; - } - - $extendedPreferredLanguages = []; - foreach ($preferredLanguages as $language) { - $extendedPreferredLanguages[] = $language; - if (false !== $position = strpos($language, '_')) { - $superLanguage = substr($language, 0, $position); - if (!\in_array($superLanguage, $preferredLanguages)) { - $extendedPreferredLanguages[] = $superLanguage; - } - } - } - - $preferredLanguages = array_values(array_intersect($extendedPreferredLanguages, $locales)); - - return $preferredLanguages[0] ?? $locales[0]; - } - - /** - * Gets a list of languages acceptable by the client browser ordered in the user browser preferences. - * - * @return string[] - */ - public function getLanguages(): array - { - if (null !== $this->languages) { - return $this->languages; - } - - $languages = AcceptHeader::fromString($this->headers->get('Accept-Language'))->all(); - $this->languages = []; - foreach ($languages as $acceptHeaderItem) { - $lang = $acceptHeaderItem->getValue(); - if (str_contains($lang, '-')) { - $codes = explode('-', $lang); - if ('i' === $codes[0]) { - // Language not listed in ISO 639 that are not variants - // of any listed language, which can be registered with the - // i-prefix, such as i-cherokee - if (\count($codes) > 1) { - $lang = $codes[1]; - } - } else { - for ($i = 0, $max = \count($codes); $i < $max; ++$i) { - if (0 === $i) { - $lang = strtolower($codes[0]); - } else { - $lang .= '_'.strtoupper($codes[$i]); - } - } - } - } - - $this->languages[] = $lang; - } - - return $this->languages; - } - - /** - * Gets a list of charsets acceptable by the client browser in preferable order. - * - * @return string[] - */ - public function getCharsets(): array - { - if (null !== $this->charsets) { - return $this->charsets; - } - - return $this->charsets = array_map('strval', array_keys(AcceptHeader::fromString($this->headers->get('Accept-Charset'))->all())); - } - - /** - * Gets a list of encodings acceptable by the client browser in preferable order. - * - * @return string[] - */ - public function getEncodings(): array - { - if (null !== $this->encodings) { - return $this->encodings; - } - - return $this->encodings = array_map('strval', array_keys(AcceptHeader::fromString($this->headers->get('Accept-Encoding'))->all())); - } - - /** - * Gets a list of content types acceptable by the client browser in preferable order. - * - * @return string[] - */ - public function getAcceptableContentTypes(): array - { - if (null !== $this->acceptableContentTypes) { - return $this->acceptableContentTypes; - } - - return $this->acceptableContentTypes = array_map('strval', array_keys(AcceptHeader::fromString($this->headers->get('Accept'))->all())); - } - - /** - * Returns true if the request is an XMLHttpRequest. - * - * It works if your JavaScript library sets an X-Requested-With HTTP header. - * It is known to work with common JavaScript frameworks: - * - * @see https://wikipedia.org/wiki/List_of_Ajax_frameworks#JavaScript - */ - public function isXmlHttpRequest(): bool - { - return 'XMLHttpRequest' == $this->headers->get('X-Requested-With'); - } - - /** - * Checks whether the client browser prefers safe content or not according to RFC8674. - * - * @see https://tools.ietf.org/html/rfc8674 - */ - public function preferSafeContent(): bool - { - if (isset($this->isSafeContentPreferred)) { - return $this->isSafeContentPreferred; - } - - if (!$this->isSecure()) { - // see https://tools.ietf.org/html/rfc8674#section-3 - return $this->isSafeContentPreferred = false; - } - - return $this->isSafeContentPreferred = AcceptHeader::fromString($this->headers->get('Prefer'))->has('safe'); - } - - /* - * The following methods are derived from code of the Zend Framework (1.10dev - 2010-01-24) - * - * Code subject to the new BSD license (https://framework.zend.com/license). - * - * Copyright (c) 2005-2010 Zend Technologies USA Inc. (https://www.zend.com/) - */ - - protected function prepareRequestUri() - { - $requestUri = ''; - - if ('1' == $this->server->get('IIS_WasUrlRewritten') && '' != $this->server->get('UNENCODED_URL')) { - // IIS7 with URL Rewrite: make sure we get the unencoded URL (double slash problem) - $requestUri = $this->server->get('UNENCODED_URL'); - $this->server->remove('UNENCODED_URL'); - $this->server->remove('IIS_WasUrlRewritten'); - } elseif ($this->server->has('REQUEST_URI')) { - $requestUri = $this->server->get('REQUEST_URI'); - - if ('' !== $requestUri && '/' === $requestUri[0]) { - // To only use path and query remove the fragment. - if (false !== $pos = strpos($requestUri, '#')) { - $requestUri = substr($requestUri, 0, $pos); - } - } else { - // HTTP proxy reqs setup request URI with scheme and host [and port] + the URL path, - // only use URL path. - $uriComponents = parse_url($requestUri); - - if (isset($uriComponents['path'])) { - $requestUri = $uriComponents['path']; - } - - if (isset($uriComponents['query'])) { - $requestUri .= '?'.$uriComponents['query']; - } - } - } elseif ($this->server->has('ORIG_PATH_INFO')) { - // IIS 5.0, PHP as CGI - $requestUri = $this->server->get('ORIG_PATH_INFO'); - if ('' != $this->server->get('QUERY_STRING')) { - $requestUri .= '?'.$this->server->get('QUERY_STRING'); - } - $this->server->remove('ORIG_PATH_INFO'); - } - - // normalize the request URI to ease creating sub-requests from this request - $this->server->set('REQUEST_URI', $requestUri); - - return $requestUri; - } - - /** - * Prepares the base URL. - */ - protected function prepareBaseUrl(): string - { - $filename = basename($this->server->get('SCRIPT_FILENAME', '')); - - if (basename($this->server->get('SCRIPT_NAME', '')) === $filename) { - $baseUrl = $this->server->get('SCRIPT_NAME'); - } elseif (basename($this->server->get('PHP_SELF', '')) === $filename) { - $baseUrl = $this->server->get('PHP_SELF'); - } elseif (basename($this->server->get('ORIG_SCRIPT_NAME', '')) === $filename) { - $baseUrl = $this->server->get('ORIG_SCRIPT_NAME'); // 1and1 shared hosting compatibility - } else { - // Backtrack up the script_filename to find the portion matching - // php_self - $path = $this->server->get('PHP_SELF', ''); - $file = $this->server->get('SCRIPT_FILENAME', ''); - $segs = explode('/', trim($file, '/')); - $segs = array_reverse($segs); - $index = 0; - $last = \count($segs); - $baseUrl = ''; - do { - $seg = $segs[$index]; - $baseUrl = '/'.$seg.$baseUrl; - ++$index; - } while ($last > $index && (false !== $pos = strpos($path, $baseUrl)) && 0 != $pos); - } - - // Does the baseUrl have anything in common with the request_uri? - $requestUri = $this->getRequestUri(); - if ('' !== $requestUri && '/' !== $requestUri[0]) { - $requestUri = '/'.$requestUri; - } - - if ($baseUrl && null !== $prefix = $this->getUrlencodedPrefix($requestUri, $baseUrl)) { - // full $baseUrl matches - return $prefix; - } - - if ($baseUrl && null !== $prefix = $this->getUrlencodedPrefix($requestUri, rtrim(\dirname($baseUrl), '/'.\DIRECTORY_SEPARATOR).'/')) { - // directory portion of $baseUrl matches - return rtrim($prefix, '/'.\DIRECTORY_SEPARATOR); - } - - $truncatedRequestUri = $requestUri; - if (false !== $pos = strpos($requestUri, '?')) { - $truncatedRequestUri = substr($requestUri, 0, $pos); - } - - $basename = basename($baseUrl ?? ''); - if (empty($basename) || !strpos(rawurldecode($truncatedRequestUri), $basename)) { - // no match whatsoever; set it blank - return ''; - } - - // If using mod_rewrite or ISAPI_Rewrite strip the script filename - // out of baseUrl. $pos !== 0 makes sure it is not matching a value - // from PATH_INFO or QUERY_STRING - if (\strlen($requestUri) >= \strlen($baseUrl) && (false !== $pos = strpos($requestUri, $baseUrl)) && 0 !== $pos) { - $baseUrl = substr($requestUri, 0, $pos + \strlen($baseUrl)); - } - - return rtrim($baseUrl, '/'.\DIRECTORY_SEPARATOR); - } - - /** - * Prepares the base path. - */ - protected function prepareBasePath(): string - { - $baseUrl = $this->getBaseUrl(); - if (empty($baseUrl)) { - return ''; - } - - $filename = basename($this->server->get('SCRIPT_FILENAME')); - if (basename($baseUrl) === $filename) { - $basePath = \dirname($baseUrl); - } else { - $basePath = $baseUrl; - } - - if ('\\' === \DIRECTORY_SEPARATOR) { - $basePath = str_replace('\\', '/', $basePath); - } - - return rtrim($basePath, '/'); - } - - /** - * Prepares the path info. - */ - protected function preparePathInfo(): string - { - if (null === ($requestUri = $this->getRequestUri())) { - return '/'; - } - - // Remove the query string from REQUEST_URI - if (false !== $pos = strpos($requestUri, '?')) { - $requestUri = substr($requestUri, 0, $pos); - } - if ('' !== $requestUri && '/' !== $requestUri[0]) { - $requestUri = '/'.$requestUri; - } - - if (null === ($baseUrl = $this->getBaseUrlReal())) { - return $requestUri; - } - - $pathInfo = substr($requestUri, \strlen($baseUrl)); - if (false === $pathInfo || '' === $pathInfo) { - // If substr() returns false then PATH_INFO is set to an empty string - return '/'; - } - - return $pathInfo; - } - - /** - * Initializes HTTP request formats. - */ - protected static function initializeFormats() - { - static::$formats = [ - 'html' => ['text/html', 'application/xhtml+xml'], - 'txt' => ['text/plain'], - 'js' => ['application/javascript', 'application/x-javascript', 'text/javascript'], - 'css' => ['text/css'], - 'json' => ['application/json', 'application/x-json'], - 'jsonld' => ['application/ld+json'], - 'xml' => ['text/xml', 'application/xml', 'application/x-xml'], - 'rdf' => ['application/rdf+xml'], - 'atom' => ['application/atom+xml'], - 'rss' => ['application/rss+xml'], - 'form' => ['application/x-www-form-urlencoded', 'multipart/form-data'], - ]; - } - - private function setPhpDefaultLocale(string $locale): void - { - // if either the class Locale doesn't exist, or an exception is thrown when - // setting the default locale, the intl module is not installed, and - // the call can be ignored: - try { - if (class_exists(\Locale::class, false)) { - \Locale::setDefault($locale); - } - } catch (\Exception) { - } - } - - /** - * Returns the prefix as encoded in the string when the string starts with - * the given prefix, null otherwise. - */ - private function getUrlencodedPrefix(string $string, string $prefix): ?string - { - if (!str_starts_with(rawurldecode($string), $prefix)) { - return null; - } - - $len = \strlen($prefix); - - if (preg_match(sprintf('#^(%%[[:xdigit:]]{2}|.){%d}#', $len), $string, $match)) { - return $match[0]; - } - - return null; - } - - private static function createRequestFromFactory(array $query = [], array $request = [], array $attributes = [], array $cookies = [], array $files = [], array $server = [], $content = null): static - { - if (self::$requestFactory) { - $request = (self::$requestFactory)($query, $request, $attributes, $cookies, $files, $server, $content); - - if (!$request instanceof self) { - throw new \LogicException('The Request factory must return an instance of Symfony\Component\HttpFoundation\Request.'); - } - - return $request; - } - - return new static($query, $request, $attributes, $cookies, $files, $server, $content); - } - - /** - * Indicates whether this request originated from a trusted proxy. - * - * This can be useful to determine whether or not to trust the - * contents of a proxy-specific header. - */ - public function isFromTrustedProxy(): bool - { - return self::$trustedProxies && IpUtils::checkIp($this->server->get('REMOTE_ADDR', ''), self::$trustedProxies); - } - - private function getTrustedValues(int $type, string $ip = null): array - { - $clientValues = []; - $forwardedValues = []; - - if ((self::$trustedHeaderSet & $type) && $this->headers->has(self::TRUSTED_HEADERS[$type])) { - foreach (explode(',', $this->headers->get(self::TRUSTED_HEADERS[$type])) as $v) { - $clientValues[] = (self::HEADER_X_FORWARDED_PORT === $type ? '0.0.0.0:' : '').trim($v); - } - } - - if ((self::$trustedHeaderSet & self::HEADER_FORWARDED) && (isset(self::FORWARDED_PARAMS[$type])) && $this->headers->has(self::TRUSTED_HEADERS[self::HEADER_FORWARDED])) { - $forwarded = $this->headers->get(self::TRUSTED_HEADERS[self::HEADER_FORWARDED]); - $parts = HeaderUtils::split($forwarded, ',;='); - $forwardedValues = []; - $param = self::FORWARDED_PARAMS[$type]; - foreach ($parts as $subParts) { - if (null === $v = HeaderUtils::combine($subParts)[$param] ?? null) { - continue; - } - if (self::HEADER_X_FORWARDED_PORT === $type) { - if (str_ends_with($v, ']') || false === $v = strrchr($v, ':')) { - $v = $this->isSecure() ? ':443' : ':80'; - } - $v = '0.0.0.0'.$v; - } - $forwardedValues[] = $v; - } - } - - if (null !== $ip) { - $clientValues = $this->normalizeAndFilterClientIps($clientValues, $ip); - $forwardedValues = $this->normalizeAndFilterClientIps($forwardedValues, $ip); - } - - if ($forwardedValues === $clientValues || !$clientValues) { - return $forwardedValues; - } - - if (!$forwardedValues) { - return $clientValues; - } - - if (!$this->isForwardedValid) { - return null !== $ip ? ['0.0.0.0', $ip] : []; - } - $this->isForwardedValid = false; - - throw new ConflictingHeadersException(sprintf('The request has both a trusted "%s" header and a trusted "%s" header, conflicting with each other. You should either configure your proxy to remove one of them, or configure your project to distrust the offending one.', self::TRUSTED_HEADERS[self::HEADER_FORWARDED], self::TRUSTED_HEADERS[$type])); - } - - private function normalizeAndFilterClientIps(array $clientIps, string $ip): array - { - if (!$clientIps) { - return []; - } - $clientIps[] = $ip; // Complete the IP chain with the IP the request actually came from - $firstTrustedIp = null; - - foreach ($clientIps as $key => $clientIp) { - if (strpos($clientIp, '.')) { - // Strip :port from IPv4 addresses. This is allowed in Forwarded - // and may occur in X-Forwarded-For. - $i = strpos($clientIp, ':'); - if ($i) { - $clientIps[$key] = $clientIp = substr($clientIp, 0, $i); - } - } elseif (str_starts_with($clientIp, '[')) { - // Strip brackets and :port from IPv6 addresses. - $i = strpos($clientIp, ']', 1); - $clientIps[$key] = $clientIp = substr($clientIp, 1, $i - 1); - } - - if (!filter_var($clientIp, \FILTER_VALIDATE_IP)) { - unset($clientIps[$key]); - - continue; - } - - if (IpUtils::checkIp($clientIp, self::$trustedProxies)) { - unset($clientIps[$key]); - - // Fallback to this when the client IP falls into the range of trusted proxies - $firstTrustedIp ??= $clientIp; - } - } - - // Now the IP chain contains only untrusted proxies and the client IP - return $clientIps ? array_reverse($clientIps) : [$firstTrustedIp]; - } -} diff --git a/vendor/symfony/http-foundation/RequestMatcher.php b/vendor/symfony/http-foundation/RequestMatcher.php deleted file mode 100644 index c2addd36..00000000 --- a/vendor/symfony/http-foundation/RequestMatcher.php +++ /dev/null @@ -1,186 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation; - -trigger_deprecation('symfony/http-foundation', '6.2', 'The "%s" class is deprecated, use "%s" instead.', RequestMatcher::class, ChainRequestMatcher::class); - -/** - * RequestMatcher compares a pre-defined set of checks against a Request instance. - * - * @author Fabien Potencier - * - * @deprecated since Symfony 6.2, use ChainRequestMatcher instead - */ -class RequestMatcher implements RequestMatcherInterface -{ - private ?string $path = null; - private ?string $host = null; - private ?int $port = null; - - /** - * @var string[] - */ - private array $methods = []; - - /** - * @var string[] - */ - private array $ips = []; - - /** - * @var string[] - */ - private array $attributes = []; - - /** - * @var string[] - */ - private array $schemes = []; - - /** - * @param string|string[]|null $methods - * @param string|string[]|null $ips - * @param string|string[]|null $schemes - */ - public function __construct(string $path = null, string $host = null, string|array $methods = null, string|array $ips = null, array $attributes = [], string|array $schemes = null, int $port = null) - { - $this->matchPath($path); - $this->matchHost($host); - $this->matchMethod($methods); - $this->matchIps($ips); - $this->matchScheme($schemes); - $this->matchPort($port); - - foreach ($attributes as $k => $v) { - $this->matchAttribute($k, $v); - } - } - - /** - * Adds a check for the HTTP scheme. - * - * @param string|string[]|null $scheme An HTTP scheme or an array of HTTP schemes - */ - public function matchScheme(string|array|null $scheme) - { - $this->schemes = null !== $scheme ? array_map('strtolower', (array) $scheme) : []; - } - - /** - * Adds a check for the URL host name. - */ - public function matchHost(?string $regexp) - { - $this->host = $regexp; - } - - /** - * Adds a check for the the URL port. - * - * @param int|null $port The port number to connect to - */ - public function matchPort(?int $port) - { - $this->port = $port; - } - - /** - * Adds a check for the URL path info. - */ - public function matchPath(?string $regexp) - { - $this->path = $regexp; - } - - /** - * Adds a check for the client IP. - * - * @param string $ip A specific IP address or a range specified using IP/netmask like 192.168.1.0/24 - */ - public function matchIp(string $ip) - { - $this->matchIps($ip); - } - - /** - * Adds a check for the client IP. - * - * @param string|string[]|null $ips A specific IP address or a range specified using IP/netmask like 192.168.1.0/24 - */ - public function matchIps(string|array|null $ips) - { - $ips = null !== $ips ? (array) $ips : []; - - $this->ips = array_reduce($ips, static function (array $ips, string $ip) { - return array_merge($ips, preg_split('/\s*,\s*/', $ip)); - }, []); - } - - /** - * Adds a check for the HTTP method. - * - * @param string|string[]|null $method An HTTP method or an array of HTTP methods - */ - public function matchMethod(string|array|null $method) - { - $this->methods = null !== $method ? array_map('strtoupper', (array) $method) : []; - } - - /** - * Adds a check for request attribute. - */ - public function matchAttribute(string $key, string $regexp) - { - $this->attributes[$key] = $regexp; - } - - public function matches(Request $request): bool - { - if ($this->schemes && !\in_array($request->getScheme(), $this->schemes, true)) { - return false; - } - - if ($this->methods && !\in_array($request->getMethod(), $this->methods, true)) { - return false; - } - - foreach ($this->attributes as $key => $pattern) { - $requestAttribute = $request->attributes->get($key); - if (!\is_string($requestAttribute)) { - return false; - } - if (!preg_match('{'.$pattern.'}', $requestAttribute)) { - return false; - } - } - - if (null !== $this->path && !preg_match('{'.$this->path.'}', rawurldecode($request->getPathInfo()))) { - return false; - } - - if (null !== $this->host && !preg_match('{'.$this->host.'}i', $request->getHost())) { - return false; - } - - if (null !== $this->port && 0 < $this->port && $request->getPort() !== $this->port) { - return false; - } - - if (IpUtils::checkIp($request->getClientIp() ?? '', $this->ips)) { - return true; - } - - // Note to future implementors: add additional checks above the - // foreach above or else your check might not be run! - return 0 === \count($this->ips); - } -} diff --git a/vendor/symfony/http-foundation/RequestMatcher/AttributesRequestMatcher.php b/vendor/symfony/http-foundation/RequestMatcher/AttributesRequestMatcher.php deleted file mode 100644 index 09d6f49d..00000000 --- a/vendor/symfony/http-foundation/RequestMatcher/AttributesRequestMatcher.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\RequestMatcher; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\RequestMatcherInterface; - -/** - * Checks the Request attributes matches all regular expressions. - * - * @author Fabien Potencier - */ -class AttributesRequestMatcher implements RequestMatcherInterface -{ - /** - * @param array $regexps - */ - public function __construct(private array $regexps) - { - } - - public function matches(Request $request): bool - { - foreach ($this->regexps as $key => $regexp) { - $attribute = $request->attributes->get($key); - if (!\is_string($attribute)) { - return false; - } - if (!preg_match('{'.$regexp.'}', $attribute)) { - return false; - } - } - - return true; - } -} diff --git a/vendor/symfony/http-foundation/RequestMatcher/ExpressionRequestMatcher.php b/vendor/symfony/http-foundation/RequestMatcher/ExpressionRequestMatcher.php deleted file mode 100644 index 935853f1..00000000 --- a/vendor/symfony/http-foundation/RequestMatcher/ExpressionRequestMatcher.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\HttpFoundation\RequestMatcher; - -use Symfony\Component\ExpressionLanguage\Expression; -use Symfony\Component\ExpressionLanguage\ExpressionLanguage; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\RequestMatcherInterface; - -/** - * ExpressionRequestMatcher uses an expression to match a Request. - * - * @author Fabien Potencier - */ -class ExpressionRequestMatcher implements RequestMatcherInterface -{ - public function __construct( - private ExpressionLanguage $language, - private Expression|string $expression, - ) { - } - - public function matches(Request $request): bool - { - return $this->language->evaluate($this->expression, [ - 'request' => $request, - 'method' => $request->getMethod(), - 'path' => rawurldecode($request->getPathInfo()), - 'host' => $request->getHost(), - 'ip' => $request->getClientIp(), - 'attributes' => $request->attributes->all(), - ]); - } -} diff --git a/vendor/symfony/http-foundation/RequestMatcher/HostRequestMatcher.php b/vendor/symfony/http-foundation/RequestMatcher/HostRequestMatcher.php deleted file mode 100644 index 2836759c..00000000 --- a/vendor/symfony/http-foundation/RequestMatcher/HostRequestMatcher.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\HttpFoundation\RequestMatcher; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\RequestMatcherInterface; - -/** - * Checks the Request URL host name matches a regular expression. - * - * @author Fabien Potencier - */ -class HostRequestMatcher implements RequestMatcherInterface -{ - public function __construct(private string $regexp) - { - } - - public function matches(Request $request): bool - { - return preg_match('{'.$this->regexp.'}i', $request->getHost()); - } -} diff --git a/vendor/symfony/http-foundation/RequestMatcher/IpsRequestMatcher.php b/vendor/symfony/http-foundation/RequestMatcher/IpsRequestMatcher.php deleted file mode 100644 index 2ddff038..00000000 --- a/vendor/symfony/http-foundation/RequestMatcher/IpsRequestMatcher.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\RequestMatcher; - -use Symfony\Component\HttpFoundation\IpUtils; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\RequestMatcherInterface; - -/** - * Checks the client IP of a Request. - * - * @author Fabien Potencier - */ -class IpsRequestMatcher implements RequestMatcherInterface -{ - private array $ips; - - /** - * @param string[]|string $ips A specific IP address or a range specified using IP/netmask like 192.168.1.0/24 - * Strings can contain a comma-delimited list of IPs/ranges - */ - public function __construct(array|string $ips) - { - $this->ips = array_reduce((array) $ips, static function (array $ips, string $ip) { - return array_merge($ips, preg_split('/\s*,\s*/', $ip)); - }, []); - } - - public function matches(Request $request): bool - { - if (!$this->ips) { - return true; - } - - return IpUtils::checkIp($request->getClientIp() ?? '', $this->ips); - } -} diff --git a/vendor/symfony/http-foundation/RequestMatcher/IsJsonRequestMatcher.php b/vendor/symfony/http-foundation/RequestMatcher/IsJsonRequestMatcher.php deleted file mode 100644 index 5da46840..00000000 --- a/vendor/symfony/http-foundation/RequestMatcher/IsJsonRequestMatcher.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\RequestMatcher; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\RequestMatcherInterface; - -/** - * Checks the Request content is valid JSON. - * - * @author Fabien Potencier - */ -class IsJsonRequestMatcher implements RequestMatcherInterface -{ - public function matches(Request $request): bool - { - try { - json_decode($request->getContent(), true, 512, \JSON_BIGINT_AS_STRING | \JSON_THROW_ON_ERROR); - } catch (\JsonException) { - return false; - } - - return true; - } -} diff --git a/vendor/symfony/http-foundation/RequestMatcher/MethodRequestMatcher.php b/vendor/symfony/http-foundation/RequestMatcher/MethodRequestMatcher.php deleted file mode 100644 index c7a91598..00000000 --- a/vendor/symfony/http-foundation/RequestMatcher/MethodRequestMatcher.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\RequestMatcher; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\RequestMatcherInterface; - -/** - * Checks the HTTP method of a Request. - * - * @author Fabien Potencier - */ -class MethodRequestMatcher implements RequestMatcherInterface -{ - /** - * @var string[] - */ - private array $methods = []; - - /** - * @param string[]|string $methods An HTTP method or an array of HTTP methods - * Strings can contain a comma-delimited list of methods - */ - public function __construct(array|string $methods) - { - $this->methods = array_reduce(array_map('strtoupper', (array) $methods), static function (array $methods, string $method) { - return array_merge($methods, preg_split('/\s*,\s*/', $method)); - }, []); - } - - public function matches(Request $request): bool - { - if (!$this->methods) { - return true; - } - - return \in_array($request->getMethod(), $this->methods, true); - } -} diff --git a/vendor/symfony/http-foundation/RequestMatcher/PathRequestMatcher.php b/vendor/symfony/http-foundation/RequestMatcher/PathRequestMatcher.php deleted file mode 100644 index c7c7a02c..00000000 --- a/vendor/symfony/http-foundation/RequestMatcher/PathRequestMatcher.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\HttpFoundation\RequestMatcher; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\RequestMatcherInterface; - -/** - * Checks the Request URL path info matches a regular expression. - * - * @author Fabien Potencier - */ -class PathRequestMatcher implements RequestMatcherInterface -{ - public function __construct(private string $regexp) - { - } - - public function matches(Request $request): bool - { - return preg_match('{'.$this->regexp.'}', rawurldecode($request->getPathInfo())); - } -} diff --git a/vendor/symfony/http-foundation/RequestMatcher/PortRequestMatcher.php b/vendor/symfony/http-foundation/RequestMatcher/PortRequestMatcher.php deleted file mode 100644 index 5a01ce95..00000000 --- a/vendor/symfony/http-foundation/RequestMatcher/PortRequestMatcher.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\HttpFoundation\RequestMatcher; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\RequestMatcherInterface; - -/** - * Checks the HTTP port of a Request. - * - * @author Fabien Potencier - */ -class PortRequestMatcher implements RequestMatcherInterface -{ - public function __construct(private int $port) - { - } - - public function matches(Request $request): bool - { - return $request->getPort() === $this->port; - } -} diff --git a/vendor/symfony/http-foundation/RequestMatcher/SchemeRequestMatcher.php b/vendor/symfony/http-foundation/RequestMatcher/SchemeRequestMatcher.php deleted file mode 100644 index 4f5eabc2..00000000 --- a/vendor/symfony/http-foundation/RequestMatcher/SchemeRequestMatcher.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\RequestMatcher; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\RequestMatcherInterface; - -/** - * Checks the HTTP scheme of a Request. - * - * @author Fabien Potencier - */ -class SchemeRequestMatcher implements RequestMatcherInterface -{ - /** - * @var string[] - */ - private array $schemes; - - /** - * @param string[]|string $schemes A scheme or a list of schemes - * Strings can contain a comma-delimited list of schemes - */ - public function __construct(array|string $schemes) - { - $this->schemes = array_reduce(array_map('strtolower', (array) $schemes), static function (array $schemes, string $scheme) { - return array_merge($schemes, preg_split('/\s*,\s*/', $scheme)); - }, []); - } - - public function matches(Request $request): bool - { - if (!$this->schemes) { - return true; - } - - return \in_array($request->getScheme(), $this->schemes, true); - } -} diff --git a/vendor/symfony/http-foundation/RequestMatcherInterface.php b/vendor/symfony/http-foundation/RequestMatcherInterface.php deleted file mode 100644 index 6dcc3e0f..00000000 --- a/vendor/symfony/http-foundation/RequestMatcherInterface.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\HttpFoundation; - -/** - * RequestMatcherInterface is an interface for strategies to match a Request. - * - * @author Fabien Potencier - */ -interface RequestMatcherInterface -{ - /** - * Decides whether the rule(s) implemented by the strategy matches the supplied request. - */ - public function matches(Request $request): bool; -} diff --git a/vendor/symfony/http-foundation/RequestStack.php b/vendor/symfony/http-foundation/RequestStack.php deleted file mode 100644 index 6b13fa1e..00000000 --- a/vendor/symfony/http-foundation/RequestStack.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\HttpFoundation; - -use Symfony\Component\HttpFoundation\Exception\SessionNotFoundException; -use Symfony\Component\HttpFoundation\Session\SessionInterface; - -/** - * Request stack that controls the lifecycle of requests. - * - * @author Benjamin Eberlei - */ -class RequestStack -{ - /** - * @var Request[] - */ - private array $requests = []; - - /** - * Pushes a Request on the stack. - * - * This method should generally not be called directly as the stack - * management should be taken care of by the application itself. - */ - public function push(Request $request) - { - $this->requests[] = $request; - } - - /** - * Pops the current request from the stack. - * - * This operation lets the current request go out of scope. - * - * This method should generally not be called directly as the stack - * management should be taken care of by the application itself. - */ - public function pop(): ?Request - { - if (!$this->requests) { - return null; - } - - return array_pop($this->requests); - } - - public function getCurrentRequest(): ?Request - { - return end($this->requests) ?: null; - } - - /** - * Gets the main request. - * - * Be warned that making your code aware of the main request - * might make it un-compatible with other features of your framework - * like ESI support. - */ - public function getMainRequest(): ?Request - { - if (!$this->requests) { - return null; - } - - return $this->requests[0]; - } - - /** - * Returns the parent request of the current. - * - * Be warned that making your code aware of the parent request - * might make it un-compatible with other features of your framework - * like ESI support. - * - * If current Request is the main request, it returns null. - */ - public function getParentRequest(): ?Request - { - $pos = \count($this->requests) - 2; - - return $this->requests[$pos] ?? null; - } - - /** - * Gets the current session. - * - * @throws SessionNotFoundException - */ - public function getSession(): SessionInterface - { - if ((null !== $request = end($this->requests) ?: null) && $request->hasSession()) { - return $request->getSession(); - } - - throw new SessionNotFoundException(); - } -} diff --git a/vendor/symfony/http-foundation/Response.php b/vendor/symfony/http-foundation/Response.php deleted file mode 100644 index d5c7129a..00000000 --- a/vendor/symfony/http-foundation/Response.php +++ /dev/null @@ -1,1315 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation; - -// Help opcache.preload discover always-needed symbols -class_exists(ResponseHeaderBag::class); - -/** - * Response represents an HTTP response. - * - * @author Fabien Potencier - */ -class Response -{ - public const HTTP_CONTINUE = 100; - public const HTTP_SWITCHING_PROTOCOLS = 101; - public const HTTP_PROCESSING = 102; // RFC2518 - public const HTTP_EARLY_HINTS = 103; // RFC8297 - public const HTTP_OK = 200; - public const HTTP_CREATED = 201; - public const HTTP_ACCEPTED = 202; - public const HTTP_NON_AUTHORITATIVE_INFORMATION = 203; - public const HTTP_NO_CONTENT = 204; - public const HTTP_RESET_CONTENT = 205; - public const HTTP_PARTIAL_CONTENT = 206; - public const HTTP_MULTI_STATUS = 207; // RFC4918 - public const HTTP_ALREADY_REPORTED = 208; // RFC5842 - public const HTTP_IM_USED = 226; // RFC3229 - public const HTTP_MULTIPLE_CHOICES = 300; - public const HTTP_MOVED_PERMANENTLY = 301; - public const HTTP_FOUND = 302; - public const HTTP_SEE_OTHER = 303; - public const HTTP_NOT_MODIFIED = 304; - public const HTTP_USE_PROXY = 305; - public const HTTP_RESERVED = 306; - public const HTTP_TEMPORARY_REDIRECT = 307; - public const HTTP_PERMANENTLY_REDIRECT = 308; // RFC7238 - public const HTTP_BAD_REQUEST = 400; - public const HTTP_UNAUTHORIZED = 401; - public const HTTP_PAYMENT_REQUIRED = 402; - public const HTTP_FORBIDDEN = 403; - public const HTTP_NOT_FOUND = 404; - public const HTTP_METHOD_NOT_ALLOWED = 405; - public const HTTP_NOT_ACCEPTABLE = 406; - public const HTTP_PROXY_AUTHENTICATION_REQUIRED = 407; - public const HTTP_REQUEST_TIMEOUT = 408; - public const HTTP_CONFLICT = 409; - public const HTTP_GONE = 410; - public const HTTP_LENGTH_REQUIRED = 411; - public const HTTP_PRECONDITION_FAILED = 412; - public const HTTP_REQUEST_ENTITY_TOO_LARGE = 413; - public const HTTP_REQUEST_URI_TOO_LONG = 414; - public const HTTP_UNSUPPORTED_MEDIA_TYPE = 415; - public const HTTP_REQUESTED_RANGE_NOT_SATISFIABLE = 416; - public const HTTP_EXPECTATION_FAILED = 417; - public const HTTP_I_AM_A_TEAPOT = 418; // RFC2324 - public const HTTP_MISDIRECTED_REQUEST = 421; // RFC7540 - public const HTTP_UNPROCESSABLE_ENTITY = 422; // RFC4918 - public const HTTP_LOCKED = 423; // RFC4918 - public const HTTP_FAILED_DEPENDENCY = 424; // RFC4918 - public const HTTP_TOO_EARLY = 425; // RFC-ietf-httpbis-replay-04 - public const HTTP_UPGRADE_REQUIRED = 426; // RFC2817 - public const HTTP_PRECONDITION_REQUIRED = 428; // RFC6585 - public const HTTP_TOO_MANY_REQUESTS = 429; // RFC6585 - public const HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE = 431; // RFC6585 - public const HTTP_UNAVAILABLE_FOR_LEGAL_REASONS = 451; // RFC7725 - public const HTTP_INTERNAL_SERVER_ERROR = 500; - public const HTTP_NOT_IMPLEMENTED = 501; - public const HTTP_BAD_GATEWAY = 502; - public const HTTP_SERVICE_UNAVAILABLE = 503; - public const HTTP_GATEWAY_TIMEOUT = 504; - public const HTTP_VERSION_NOT_SUPPORTED = 505; - public const HTTP_VARIANT_ALSO_NEGOTIATES_EXPERIMENTAL = 506; // RFC2295 - public const HTTP_INSUFFICIENT_STORAGE = 507; // RFC4918 - public const HTTP_LOOP_DETECTED = 508; // RFC5842 - public const HTTP_NOT_EXTENDED = 510; // RFC2774 - public const HTTP_NETWORK_AUTHENTICATION_REQUIRED = 511; // RFC6585 - - /** - * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control - */ - private const HTTP_RESPONSE_CACHE_CONTROL_DIRECTIVES = [ - 'must_revalidate' => false, - 'no_cache' => false, - 'no_store' => false, - 'no_transform' => false, - 'public' => false, - 'private' => false, - 'proxy_revalidate' => false, - 'max_age' => true, - 's_maxage' => true, - 'stale_if_error' => true, // RFC5861 - 'stale_while_revalidate' => true, // RFC5861 - 'immutable' => false, - 'last_modified' => true, - 'etag' => true, - ]; - - /** - * @var ResponseHeaderBag - */ - public $headers; - - /** - * @var string - */ - protected $content; - - /** - * @var string - */ - protected $version; - - /** - * @var int - */ - protected $statusCode; - - /** - * @var string - */ - protected $statusText; - - /** - * @var string - */ - protected $charset; - - /** - * Status codes translation table. - * - * The list of codes is complete according to the - * {@link https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml Hypertext Transfer Protocol (HTTP) Status Code Registry} - * (last updated 2021-10-01). - * - * Unless otherwise noted, the status code is defined in RFC2616. - * - * @var array - */ - public static $statusTexts = [ - 100 => 'Continue', - 101 => 'Switching Protocols', - 102 => 'Processing', // RFC2518 - 103 => 'Early Hints', - 200 => 'OK', - 201 => 'Created', - 202 => 'Accepted', - 203 => 'Non-Authoritative Information', - 204 => 'No Content', - 205 => 'Reset Content', - 206 => 'Partial Content', - 207 => 'Multi-Status', // RFC4918 - 208 => 'Already Reported', // RFC5842 - 226 => 'IM Used', // RFC3229 - 300 => 'Multiple Choices', - 301 => 'Moved Permanently', - 302 => 'Found', - 303 => 'See Other', - 304 => 'Not Modified', - 305 => 'Use Proxy', - 307 => 'Temporary Redirect', - 308 => 'Permanent Redirect', // RFC7238 - 400 => 'Bad Request', - 401 => 'Unauthorized', - 402 => 'Payment Required', - 403 => 'Forbidden', - 404 => 'Not Found', - 405 => 'Method Not Allowed', - 406 => 'Not Acceptable', - 407 => 'Proxy Authentication Required', - 408 => 'Request Timeout', - 409 => 'Conflict', - 410 => 'Gone', - 411 => 'Length Required', - 412 => 'Precondition Failed', - 413 => 'Content Too Large', // RFC-ietf-httpbis-semantics - 414 => 'URI Too Long', - 415 => 'Unsupported Media Type', - 416 => 'Range Not Satisfiable', - 417 => 'Expectation Failed', - 418 => 'I\'m a teapot', // RFC2324 - 421 => 'Misdirected Request', // RFC7540 - 422 => 'Unprocessable Content', // RFC-ietf-httpbis-semantics - 423 => 'Locked', // RFC4918 - 424 => 'Failed Dependency', // RFC4918 - 425 => 'Too Early', // RFC-ietf-httpbis-replay-04 - 426 => 'Upgrade Required', // RFC2817 - 428 => 'Precondition Required', // RFC6585 - 429 => 'Too Many Requests', // RFC6585 - 431 => 'Request Header Fields Too Large', // RFC6585 - 451 => 'Unavailable For Legal Reasons', // RFC7725 - 500 => 'Internal Server Error', - 501 => 'Not Implemented', - 502 => 'Bad Gateway', - 503 => 'Service Unavailable', - 504 => 'Gateway Timeout', - 505 => 'HTTP Version Not Supported', - 506 => 'Variant Also Negotiates', // RFC2295 - 507 => 'Insufficient Storage', // RFC4918 - 508 => 'Loop Detected', // RFC5842 - 510 => 'Not Extended', // RFC2774 - 511 => 'Network Authentication Required', // RFC6585 - ]; - - /** - * @param int $status The HTTP status code (200 "OK" by default) - * - * @throws \InvalidArgumentException When the HTTP status code is not valid - */ - public function __construct(?string $content = '', int $status = 200, array $headers = []) - { - $this->headers = new ResponseHeaderBag($headers); - $this->setContent($content); - $this->setStatusCode($status); - $this->setProtocolVersion('1.0'); - } - - /** - * Returns the Response as an HTTP string. - * - * The string representation of the Response is the same as the - * one that will be sent to the client only if the prepare() method - * has been called before. - * - * @see prepare() - */ - public function __toString(): string - { - return - sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText)."\r\n". - $this->headers."\r\n". - $this->getContent(); - } - - /** - * Clones the current Response instance. - */ - public function __clone() - { - $this->headers = clone $this->headers; - } - - /** - * Prepares the Response before it is sent to the client. - * - * This method tweaks the Response to ensure that it is - * compliant with RFC 2616. Most of the changes are based on - * the Request that is "associated" with this Response. - * - * @return $this - */ - public function prepare(Request $request): static - { - $headers = $this->headers; - - if ($this->isInformational() || $this->isEmpty()) { - $this->setContent(null); - $headers->remove('Content-Type'); - $headers->remove('Content-Length'); - // prevent PHP from sending the Content-Type header based on default_mimetype - ini_set('default_mimetype', ''); - } else { - // Content-type based on the Request - if (!$headers->has('Content-Type')) { - $format = $request->getRequestFormat(null); - if (null !== $format && $mimeType = $request->getMimeType($format)) { - $headers->set('Content-Type', $mimeType); - } - } - - // Fix Content-Type - $charset = $this->charset ?: 'UTF-8'; - if (!$headers->has('Content-Type')) { - $headers->set('Content-Type', 'text/html; charset='.$charset); - } elseif (0 === stripos($headers->get('Content-Type'), 'text/') && false === stripos($headers->get('Content-Type'), 'charset')) { - // add the charset - $headers->set('Content-Type', $headers->get('Content-Type').'; charset='.$charset); - } - - // Fix Content-Length - if ($headers->has('Transfer-Encoding')) { - $headers->remove('Content-Length'); - } - - if ($request->isMethod('HEAD')) { - // cf. RFC2616 14.13 - $length = $headers->get('Content-Length'); - $this->setContent(null); - if ($length) { - $headers->set('Content-Length', $length); - } - } - } - - // Fix protocol - if ('HTTP/1.0' != $request->server->get('SERVER_PROTOCOL')) { - $this->setProtocolVersion('1.1'); - } - - // Check if we need to send extra expire info headers - if ('1.0' == $this->getProtocolVersion() && str_contains($headers->get('Cache-Control', ''), 'no-cache')) { - $headers->set('pragma', 'no-cache'); - $headers->set('expires', -1); - } - - $this->ensureIEOverSSLCompatibility($request); - - if ($request->isSecure()) { - foreach ($headers->getCookies() as $cookie) { - $cookie->setSecureDefault(true); - } - } - - return $this; - } - - /** - * Sends HTTP headers. - * - * @return $this - */ - public function sendHeaders(): static - { - // headers have already been sent by the developer - if (headers_sent()) { - return $this; - } - - // headers - foreach ($this->headers->allPreserveCaseWithoutCookies() as $name => $values) { - $replace = 0 === strcasecmp($name, 'Content-Type'); - foreach ($values as $value) { - header($name.': '.$value, $replace, $this->statusCode); - } - } - - // cookies - foreach ($this->headers->getCookies() as $cookie) { - header('Set-Cookie: '.$cookie, false, $this->statusCode); - } - - // status - header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText), true, $this->statusCode); - - return $this; - } - - /** - * Sends content for the current web response. - * - * @return $this - */ - public function sendContent(): static - { - echo $this->content; - - return $this; - } - - /** - * Sends HTTP headers and content. - * - * @return $this - */ - public function send(): static - { - $this->sendHeaders(); - $this->sendContent(); - - if (\function_exists('fastcgi_finish_request')) { - fastcgi_finish_request(); - } elseif (\function_exists('litespeed_finish_request')) { - litespeed_finish_request(); - } elseif (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true)) { - static::closeOutputBuffers(0, true); - flush(); - } - - return $this; - } - - /** - * Sets the response content. - * - * @return $this - */ - public function setContent(?string $content): static - { - $this->content = $content ?? ''; - - return $this; - } - - /** - * Gets the current response content. - */ - public function getContent(): string|false - { - return $this->content; - } - - /** - * Sets the HTTP protocol version (1.0 or 1.1). - * - * @return $this - * - * @final - */ - public function setProtocolVersion(string $version): static - { - $this->version = $version; - - return $this; - } - - /** - * Gets the HTTP protocol version. - * - * @final - */ - public function getProtocolVersion(): string - { - return $this->version; - } - - /** - * Sets the response status code. - * - * If the status text is null it will be automatically populated for the known - * status codes and left empty otherwise. - * - * @return $this - * - * @throws \InvalidArgumentException When the HTTP status code is not valid - * - * @final - */ - public function setStatusCode(int $code, string $text = null): static - { - $this->statusCode = $code; - if ($this->isInvalid()) { - throw new \InvalidArgumentException(sprintf('The HTTP status code "%s" is not valid.', $code)); - } - - if (null === $text) { - $this->statusText = self::$statusTexts[$code] ?? 'unknown status'; - - return $this; - } - - if (false === $text) { - $this->statusText = ''; - - return $this; - } - - $this->statusText = $text; - - return $this; - } - - /** - * Retrieves the status code for the current web response. - * - * @final - */ - public function getStatusCode(): int - { - return $this->statusCode; - } - - /** - * Sets the response charset. - * - * @return $this - * - * @final - */ - public function setCharset(string $charset): static - { - $this->charset = $charset; - - return $this; - } - - /** - * Retrieves the response charset. - * - * @final - */ - public function getCharset(): ?string - { - return $this->charset; - } - - /** - * Returns true if the response may safely be kept in a shared (surrogate) cache. - * - * Responses marked "private" with an explicit Cache-Control directive are - * considered uncacheable. - * - * Responses with neither a freshness lifetime (Expires, max-age) nor cache - * validator (Last-Modified, ETag) are considered uncacheable because there is - * no way to tell when or how to remove them from the cache. - * - * Note that RFC 7231 and RFC 7234 possibly allow for a more permissive implementation, - * for example "status codes that are defined as cacheable by default [...] - * can be reused by a cache with heuristic expiration unless otherwise indicated" - * (https://tools.ietf.org/html/rfc7231#section-6.1) - * - * @final - */ - public function isCacheable(): bool - { - if (!\in_array($this->statusCode, [200, 203, 300, 301, 302, 404, 410])) { - return false; - } - - if ($this->headers->hasCacheControlDirective('no-store') || $this->headers->getCacheControlDirective('private')) { - return false; - } - - return $this->isValidateable() || $this->isFresh(); - } - - /** - * Returns true if the response is "fresh". - * - * Fresh responses may be served from cache without any interaction with the - * origin. A response is considered fresh when it includes a Cache-Control/max-age - * indicator or Expires header and the calculated age is less than the freshness lifetime. - * - * @final - */ - public function isFresh(): bool - { - return $this->getTtl() > 0; - } - - /** - * Returns true if the response includes headers that can be used to validate - * the response with the origin server using a conditional GET request. - * - * @final - */ - public function isValidateable(): bool - { - return $this->headers->has('Last-Modified') || $this->headers->has('ETag'); - } - - /** - * Marks the response as "private". - * - * It makes the response ineligible for serving other clients. - * - * @return $this - * - * @final - */ - public function setPrivate(): static - { - $this->headers->removeCacheControlDirective('public'); - $this->headers->addCacheControlDirective('private'); - - return $this; - } - - /** - * Marks the response as "public". - * - * It makes the response eligible for serving other clients. - * - * @return $this - * - * @final - */ - public function setPublic(): static - { - $this->headers->addCacheControlDirective('public'); - $this->headers->removeCacheControlDirective('private'); - - return $this; - } - - /** - * Marks the response as "immutable". - * - * @return $this - * - * @final - */ - public function setImmutable(bool $immutable = true): static - { - if ($immutable) { - $this->headers->addCacheControlDirective('immutable'); - } else { - $this->headers->removeCacheControlDirective('immutable'); - } - - return $this; - } - - /** - * Returns true if the response is marked as "immutable". - * - * @final - */ - public function isImmutable(): bool - { - return $this->headers->hasCacheControlDirective('immutable'); - } - - /** - * Returns true if the response must be revalidated by shared caches once it has become stale. - * - * This method indicates that the response must not be served stale by a - * cache in any circumstance without first revalidating with the origin. - * When present, the TTL of the response should not be overridden to be - * greater than the value provided by the origin. - * - * @final - */ - public function mustRevalidate(): bool - { - return $this->headers->hasCacheControlDirective('must-revalidate') || $this->headers->hasCacheControlDirective('proxy-revalidate'); - } - - /** - * Returns the Date header as a DateTime instance. - * - * @throws \RuntimeException When the header is not parseable - * - * @final - */ - public function getDate(): ?\DateTimeInterface - { - return $this->headers->getDate('Date'); - } - - /** - * Sets the Date header. - * - * @return $this - * - * @final - */ - public function setDate(\DateTimeInterface $date): static - { - if ($date instanceof \DateTime) { - $date = \DateTimeImmutable::createFromMutable($date); - } - - $date = $date->setTimezone(new \DateTimeZone('UTC')); - $this->headers->set('Date', $date->format('D, d M Y H:i:s').' GMT'); - - return $this; - } - - /** - * Returns the age of the response in seconds. - * - * @final - */ - public function getAge(): int - { - if (null !== $age = $this->headers->get('Age')) { - return (int) $age; - } - - return max(time() - (int) $this->getDate()->format('U'), 0); - } - - /** - * Marks the response stale by setting the Age header to be equal to the maximum age of the response. - * - * @return $this - */ - public function expire(): static - { - if ($this->isFresh()) { - $this->headers->set('Age', $this->getMaxAge()); - $this->headers->remove('Expires'); - } - - return $this; - } - - /** - * Returns the value of the Expires header as a DateTime instance. - * - * @final - */ - public function getExpires(): ?\DateTimeInterface - { - try { - return $this->headers->getDate('Expires'); - } catch (\RuntimeException) { - // according to RFC 2616 invalid date formats (e.g. "0" and "-1") must be treated as in the past - return \DateTime::createFromFormat('U', time() - 172800); - } - } - - /** - * Sets the Expires HTTP header with a DateTime instance. - * - * Passing null as value will remove the header. - * - * @return $this - * - * @final - */ - public function setExpires(\DateTimeInterface $date = null): static - { - if (1 > \func_num_args()) { - trigger_deprecation('symfony/http-foundation', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); - } - if (null === $date) { - $this->headers->remove('Expires'); - - return $this; - } - - if ($date instanceof \DateTime) { - $date = \DateTimeImmutable::createFromMutable($date); - } - - $date = $date->setTimezone(new \DateTimeZone('UTC')); - $this->headers->set('Expires', $date->format('D, d M Y H:i:s').' GMT'); - - return $this; - } - - /** - * Returns the number of seconds after the time specified in the response's Date - * header when the response should no longer be considered fresh. - * - * First, it checks for a s-maxage directive, then a max-age directive, and then it falls - * back on an expires header. It returns null when no maximum age can be established. - * - * @final - */ - public function getMaxAge(): ?int - { - if ($this->headers->hasCacheControlDirective('s-maxage')) { - return (int) $this->headers->getCacheControlDirective('s-maxage'); - } - - if ($this->headers->hasCacheControlDirective('max-age')) { - return (int) $this->headers->getCacheControlDirective('max-age'); - } - - if (null !== $this->getExpires()) { - return (int) $this->getExpires()->format('U') - (int) $this->getDate()->format('U'); - } - - return null; - } - - /** - * Sets the number of seconds after which the response should no longer be considered fresh. - * - * This methods sets the Cache-Control max-age directive. - * - * @return $this - * - * @final - */ - public function setMaxAge(int $value): static - { - $this->headers->addCacheControlDirective('max-age', $value); - - return $this; - } - - /** - * Sets the number of seconds after which the response should no longer be returned by shared caches when backend is down. - * - * This method sets the Cache-Control stale-if-error directive. - * - * @return $this - * - * @final - */ - public function setStaleIfError(int $value): static - { - $this->headers->addCacheControlDirective('stale-if-error', $value); - - return $this; - } - - /** - * Sets the number of seconds after which the response should no longer return stale content by shared caches. - * - * This method sets the Cache-Control stale-while-revalidate directive. - * - * @return $this - * - * @final - */ - public function setStaleWhileRevalidate(int $value): static - { - $this->headers->addCacheControlDirective('stale-while-revalidate', $value); - - return $this; - } - - /** - * Sets the number of seconds after which the response should no longer be considered fresh by shared caches. - * - * This methods sets the Cache-Control s-maxage directive. - * - * @return $this - * - * @final - */ - public function setSharedMaxAge(int $value): static - { - $this->setPublic(); - $this->headers->addCacheControlDirective('s-maxage', $value); - - return $this; - } - - /** - * Returns the response's time-to-live in seconds. - * - * It returns null when no freshness information is present in the response. - * - * When the responses TTL is <= 0, the response may not be served from cache without first - * revalidating with the origin. - * - * @final - */ - public function getTtl(): ?int - { - $maxAge = $this->getMaxAge(); - - return null !== $maxAge ? $maxAge - $this->getAge() : null; - } - - /** - * Sets the response's time-to-live for shared caches in seconds. - * - * This method adjusts the Cache-Control/s-maxage directive. - * - * @return $this - * - * @final - */ - public function setTtl(int $seconds): static - { - $this->setSharedMaxAge($this->getAge() + $seconds); - - return $this; - } - - /** - * Sets the response's time-to-live for private/client caches in seconds. - * - * This method adjusts the Cache-Control/max-age directive. - * - * @return $this - * - * @final - */ - public function setClientTtl(int $seconds): static - { - $this->setMaxAge($this->getAge() + $seconds); - - return $this; - } - - /** - * Returns the Last-Modified HTTP header as a DateTime instance. - * - * @throws \RuntimeException When the HTTP header is not parseable - * - * @final - */ - public function getLastModified(): ?\DateTimeInterface - { - return $this->headers->getDate('Last-Modified'); - } - - /** - * Sets the Last-Modified HTTP header with a DateTime instance. - * - * Passing null as value will remove the header. - * - * @return $this - * - * @final - */ - public function setLastModified(\DateTimeInterface $date = null): static - { - if (1 > \func_num_args()) { - trigger_deprecation('symfony/http-foundation', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); - } - if (null === $date) { - $this->headers->remove('Last-Modified'); - - return $this; - } - - if ($date instanceof \DateTime) { - $date = \DateTimeImmutable::createFromMutable($date); - } - - $date = $date->setTimezone(new \DateTimeZone('UTC')); - $this->headers->set('Last-Modified', $date->format('D, d M Y H:i:s').' GMT'); - - return $this; - } - - /** - * Returns the literal value of the ETag HTTP header. - * - * @final - */ - public function getEtag(): ?string - { - return $this->headers->get('ETag'); - } - - /** - * Sets the ETag value. - * - * @param string|null $etag The ETag unique identifier or null to remove the header - * @param bool $weak Whether you want a weak ETag or not - * - * @return $this - * - * @final - */ - public function setEtag(string $etag = null, bool $weak = false): static - { - if (1 > \func_num_args()) { - trigger_deprecation('symfony/http-foundation', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); - } - if (null === $etag) { - $this->headers->remove('Etag'); - } else { - if (!str_starts_with($etag, '"')) { - $etag = '"'.$etag.'"'; - } - - $this->headers->set('ETag', (true === $weak ? 'W/' : '').$etag); - } - - return $this; - } - - /** - * Sets the response's cache headers (validation and/or expiration). - * - * Available options are: must_revalidate, no_cache, no_store, no_transform, public, private, proxy_revalidate, max_age, s_maxage, immutable, last_modified and etag. - * - * @return $this - * - * @throws \InvalidArgumentException - * - * @final - */ - public function setCache(array $options): static - { - if ($diff = array_diff(array_keys($options), array_keys(self::HTTP_RESPONSE_CACHE_CONTROL_DIRECTIVES))) { - throw new \InvalidArgumentException(sprintf('Response does not support the following options: "%s".', implode('", "', $diff))); - } - - if (isset($options['etag'])) { - $this->setEtag($options['etag']); - } - - if (isset($options['last_modified'])) { - $this->setLastModified($options['last_modified']); - } - - if (isset($options['max_age'])) { - $this->setMaxAge($options['max_age']); - } - - if (isset($options['s_maxage'])) { - $this->setSharedMaxAge($options['s_maxage']); - } - - if (isset($options['stale_while_revalidate'])) { - $this->setStaleWhileRevalidate($options['stale_while_revalidate']); - } - - if (isset($options['stale_if_error'])) { - $this->setStaleIfError($options['stale_if_error']); - } - - foreach (self::HTTP_RESPONSE_CACHE_CONTROL_DIRECTIVES as $directive => $hasValue) { - if (!$hasValue && isset($options[$directive])) { - if ($options[$directive]) { - $this->headers->addCacheControlDirective(str_replace('_', '-', $directive)); - } else { - $this->headers->removeCacheControlDirective(str_replace('_', '-', $directive)); - } - } - } - - if (isset($options['public'])) { - if ($options['public']) { - $this->setPublic(); - } else { - $this->setPrivate(); - } - } - - if (isset($options['private'])) { - if ($options['private']) { - $this->setPrivate(); - } else { - $this->setPublic(); - } - } - - return $this; - } - - /** - * Modifies the response so that it conforms to the rules defined for a 304 status code. - * - * This sets the status, removes the body, and discards any headers - * that MUST NOT be included in 304 responses. - * - * @return $this - * - * @see https://tools.ietf.org/html/rfc2616#section-10.3.5 - * - * @final - */ - public function setNotModified(): static - { - $this->setStatusCode(304); - $this->setContent(null); - - // remove headers that MUST NOT be included with 304 Not Modified responses - foreach (['Allow', 'Content-Encoding', 'Content-Language', 'Content-Length', 'Content-MD5', 'Content-Type', 'Last-Modified'] as $header) { - $this->headers->remove($header); - } - - return $this; - } - - /** - * Returns true if the response includes a Vary header. - * - * @final - */ - public function hasVary(): bool - { - return null !== $this->headers->get('Vary'); - } - - /** - * Returns an array of header names given in the Vary header. - * - * @final - */ - public function getVary(): array - { - if (!$vary = $this->headers->all('Vary')) { - return []; - } - - $ret = []; - foreach ($vary as $item) { - $ret[] = preg_split('/[\s,]+/', $item); - } - - return array_merge([], ...$ret); - } - - /** - * Sets the Vary header. - * - * @param bool $replace Whether to replace the actual value or not (true by default) - * - * @return $this - * - * @final - */ - public function setVary(string|array $headers, bool $replace = true): static - { - $this->headers->set('Vary', $headers, $replace); - - return $this; - } - - /** - * Determines if the Response validators (ETag, Last-Modified) match - * a conditional value specified in the Request. - * - * If the Response is not modified, it sets the status code to 304 and - * removes the actual content by calling the setNotModified() method. - * - * @final - */ - public function isNotModified(Request $request): bool - { - if (!$request->isMethodCacheable()) { - return false; - } - - $notModified = false; - $lastModified = $this->headers->get('Last-Modified'); - $modifiedSince = $request->headers->get('If-Modified-Since'); - - if (($ifNoneMatchEtags = $request->getETags()) && (null !== $etag = $this->getEtag())) { - if (0 == strncmp($etag, 'W/', 2)) { - $etag = substr($etag, 2); - } - - // Use weak comparison as per https://tools.ietf.org/html/rfc7232#section-3.2. - foreach ($ifNoneMatchEtags as $ifNoneMatchEtag) { - if (0 == strncmp($ifNoneMatchEtag, 'W/', 2)) { - $ifNoneMatchEtag = substr($ifNoneMatchEtag, 2); - } - - if ($ifNoneMatchEtag === $etag || '*' === $ifNoneMatchEtag) { - $notModified = true; - break; - } - } - } - // Only do If-Modified-Since date comparison when If-None-Match is not present as per https://tools.ietf.org/html/rfc7232#section-3.3. - elseif ($modifiedSince && $lastModified) { - $notModified = strtotime($modifiedSince) >= strtotime($lastModified); - } - - if ($notModified) { - $this->setNotModified(); - } - - return $notModified; - } - - /** - * Is response invalid? - * - * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html - * - * @final - */ - public function isInvalid(): bool - { - return $this->statusCode < 100 || $this->statusCode >= 600; - } - - /** - * Is response informative? - * - * @final - */ - public function isInformational(): bool - { - return $this->statusCode >= 100 && $this->statusCode < 200; - } - - /** - * Is response successful? - * - * @final - */ - public function isSuccessful(): bool - { - return $this->statusCode >= 200 && $this->statusCode < 300; - } - - /** - * Is the response a redirect? - * - * @final - */ - public function isRedirection(): bool - { - return $this->statusCode >= 300 && $this->statusCode < 400; - } - - /** - * Is there a client error? - * - * @final - */ - public function isClientError(): bool - { - return $this->statusCode >= 400 && $this->statusCode < 500; - } - - /** - * Was there a server side error? - * - * @final - */ - public function isServerError(): bool - { - return $this->statusCode >= 500 && $this->statusCode < 600; - } - - /** - * Is the response OK? - * - * @final - */ - public function isOk(): bool - { - return 200 === $this->statusCode; - } - - /** - * Is the response forbidden? - * - * @final - */ - public function isForbidden(): bool - { - return 403 === $this->statusCode; - } - - /** - * Is the response a not found error? - * - * @final - */ - public function isNotFound(): bool - { - return 404 === $this->statusCode; - } - - /** - * Is the response a redirect of some form? - * - * @final - */ - public function isRedirect(string $location = null): bool - { - return \in_array($this->statusCode, [201, 301, 302, 303, 307, 308]) && (null === $location ?: $location == $this->headers->get('Location')); - } - - /** - * Is the response empty? - * - * @final - */ - public function isEmpty(): bool - { - return \in_array($this->statusCode, [204, 304]); - } - - /** - * Cleans or flushes output buffers up to target level. - * - * Resulting level can be greater than target level if a non-removable buffer has been encountered. - * - * @final - */ - public static function closeOutputBuffers(int $targetLevel, bool $flush): void - { - $status = ob_get_status(true); - $level = \count($status); - $flags = \PHP_OUTPUT_HANDLER_REMOVABLE | ($flush ? \PHP_OUTPUT_HANDLER_FLUSHABLE : \PHP_OUTPUT_HANDLER_CLEANABLE); - - while ($level-- > $targetLevel && ($s = $status[$level]) && (!isset($s['del']) ? !isset($s['flags']) || ($s['flags'] & $flags) === $flags : $s['del'])) { - if ($flush) { - ob_end_flush(); - } else { - ob_end_clean(); - } - } - } - - /** - * Marks a response as safe according to RFC8674. - * - * @see https://tools.ietf.org/html/rfc8674 - */ - public function setContentSafe(bool $safe = true): void - { - if ($safe) { - $this->headers->set('Preference-Applied', 'safe'); - } elseif ('safe' === $this->headers->get('Preference-Applied')) { - $this->headers->remove('Preference-Applied'); - } - - $this->setVary('Prefer', false); - } - - /** - * Checks if we need to remove Cache-Control for SSL encrypted downloads when using IE < 9. - * - * @see http://support.microsoft.com/kb/323308 - * - * @final - */ - protected function ensureIEOverSSLCompatibility(Request $request): void - { - if (false !== stripos($this->headers->get('Content-Disposition') ?? '', 'attachment') && 1 == preg_match('/MSIE (.*?);/i', $request->server->get('HTTP_USER_AGENT') ?? '', $match) && true === $request->isSecure()) { - if ((int) preg_replace('/(MSIE )(.*?);/', '$2', $match[0]) < 9) { - $this->headers->remove('Cache-Control'); - } - } - } -} diff --git a/vendor/symfony/http-foundation/ResponseHeaderBag.php b/vendor/symfony/http-foundation/ResponseHeaderBag.php deleted file mode 100644 index 9e8c5793..00000000 --- a/vendor/symfony/http-foundation/ResponseHeaderBag.php +++ /dev/null @@ -1,267 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation; - -/** - * ResponseHeaderBag is a container for Response HTTP headers. - * - * @author Fabien Potencier - */ -class ResponseHeaderBag extends HeaderBag -{ - public const COOKIES_FLAT = 'flat'; - public const COOKIES_ARRAY = 'array'; - - public const DISPOSITION_ATTACHMENT = 'attachment'; - public const DISPOSITION_INLINE = 'inline'; - - protected $computedCacheControl = []; - protected $cookies = []; - protected $headerNames = []; - - public function __construct(array $headers = []) - { - parent::__construct($headers); - - if (!isset($this->headers['cache-control'])) { - $this->set('Cache-Control', ''); - } - - /* RFC2616 - 14.18 says all Responses need to have a Date */ - if (!isset($this->headers['date'])) { - $this->initDate(); - } - } - - /** - * Returns the headers, with original capitalizations. - */ - public function allPreserveCase(): array - { - $headers = []; - foreach ($this->all() as $name => $value) { - $headers[$this->headerNames[$name] ?? $name] = $value; - } - - return $headers; - } - - public function allPreserveCaseWithoutCookies() - { - $headers = $this->allPreserveCase(); - if (isset($this->headerNames['set-cookie'])) { - unset($headers[$this->headerNames['set-cookie']]); - } - - return $headers; - } - - public function replace(array $headers = []) - { - $this->headerNames = []; - - parent::replace($headers); - - if (!isset($this->headers['cache-control'])) { - $this->set('Cache-Control', ''); - } - - if (!isset($this->headers['date'])) { - $this->initDate(); - } - } - - public function all(string $key = null): array - { - $headers = parent::all(); - - if (null !== $key) { - $key = strtr($key, self::UPPER, self::LOWER); - - return 'set-cookie' !== $key ? $headers[$key] ?? [] : array_map('strval', $this->getCookies()); - } - - foreach ($this->getCookies() as $cookie) { - $headers['set-cookie'][] = (string) $cookie; - } - - return $headers; - } - - public function set(string $key, string|array|null $values, bool $replace = true) - { - $uniqueKey = strtr($key, self::UPPER, self::LOWER); - - if ('set-cookie' === $uniqueKey) { - if ($replace) { - $this->cookies = []; - } - foreach ((array) $values as $cookie) { - $this->setCookie(Cookie::fromString($cookie)); - } - $this->headerNames[$uniqueKey] = $key; - - return; - } - - $this->headerNames[$uniqueKey] = $key; - - parent::set($key, $values, $replace); - - // ensure the cache-control header has sensible defaults - if (\in_array($uniqueKey, ['cache-control', 'etag', 'last-modified', 'expires'], true) && '' !== $computed = $this->computeCacheControlValue()) { - $this->headers['cache-control'] = [$computed]; - $this->headerNames['cache-control'] = 'Cache-Control'; - $this->computedCacheControl = $this->parseCacheControl($computed); - } - } - - public function remove(string $key) - { - $uniqueKey = strtr($key, self::UPPER, self::LOWER); - unset($this->headerNames[$uniqueKey]); - - if ('set-cookie' === $uniqueKey) { - $this->cookies = []; - - return; - } - - parent::remove($key); - - if ('cache-control' === $uniqueKey) { - $this->computedCacheControl = []; - } - - if ('date' === $uniqueKey) { - $this->initDate(); - } - } - - public function hasCacheControlDirective(string $key): bool - { - return \array_key_exists($key, $this->computedCacheControl); - } - - public function getCacheControlDirective(string $key): bool|string|null - { - return $this->computedCacheControl[$key] ?? null; - } - - public function setCookie(Cookie $cookie) - { - $this->cookies[$cookie->getDomain()][$cookie->getPath()][$cookie->getName()] = $cookie; - $this->headerNames['set-cookie'] = 'Set-Cookie'; - } - - /** - * Removes a cookie from the array, but does not unset it in the browser. - */ - public function removeCookie(string $name, ?string $path = '/', string $domain = null) - { - $path ??= '/'; - - unset($this->cookies[$domain][$path][$name]); - - if (empty($this->cookies[$domain][$path])) { - unset($this->cookies[$domain][$path]); - - if (empty($this->cookies[$domain])) { - unset($this->cookies[$domain]); - } - } - - if (empty($this->cookies)) { - unset($this->headerNames['set-cookie']); - } - } - - /** - * Returns an array with all cookies. - * - * @return Cookie[] - * - * @throws \InvalidArgumentException When the $format is invalid - */ - public function getCookies(string $format = self::COOKIES_FLAT): array - { - if (!\in_array($format, [self::COOKIES_FLAT, self::COOKIES_ARRAY])) { - throw new \InvalidArgumentException(sprintf('Format "%s" invalid (%s).', $format, implode(', ', [self::COOKIES_FLAT, self::COOKIES_ARRAY]))); - } - - if (self::COOKIES_ARRAY === $format) { - return $this->cookies; - } - - $flattenedCookies = []; - foreach ($this->cookies as $path) { - foreach ($path as $cookies) { - foreach ($cookies as $cookie) { - $flattenedCookies[] = $cookie; - } - } - } - - return $flattenedCookies; - } - - /** - * Clears a cookie in the browser. - */ - public function clearCookie(string $name, ?string $path = '/', string $domain = null, bool $secure = false, bool $httpOnly = true, string $sameSite = null) - { - $this->setCookie(new Cookie($name, null, 1, $path, $domain, $secure, $httpOnly, false, $sameSite)); - } - - /** - * @see HeaderUtils::makeDisposition() - */ - public function makeDisposition(string $disposition, string $filename, string $filenameFallback = '') - { - return HeaderUtils::makeDisposition($disposition, $filename, $filenameFallback); - } - - /** - * Returns the calculated value of the cache-control header. - * - * This considers several other headers and calculates or modifies the - * cache-control header to a sensible, conservative value. - */ - protected function computeCacheControlValue(): string - { - if (!$this->cacheControl) { - if ($this->has('Last-Modified') || $this->has('Expires')) { - return 'private, must-revalidate'; // allows for heuristic expiration (RFC 7234 Section 4.2.2) in the case of "Last-Modified" - } - - // conservative by default - return 'no-cache, private'; - } - - $header = $this->getCacheControlHeader(); - if (isset($this->cacheControl['public']) || isset($this->cacheControl['private'])) { - return $header; - } - - // public if s-maxage is defined, private otherwise - if (!isset($this->cacheControl['s-maxage'])) { - return $header.', private'; - } - - return $header; - } - - private function initDate(): void - { - $this->set('Date', gmdate('D, d M Y H:i:s').' GMT'); - } -} diff --git a/vendor/symfony/http-foundation/ServerBag.php b/vendor/symfony/http-foundation/ServerBag.php deleted file mode 100644 index 5b0fc8ac..00000000 --- a/vendor/symfony/http-foundation/ServerBag.php +++ /dev/null @@ -1,97 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation; - -/** - * ServerBag is a container for HTTP headers from the $_SERVER variable. - * - * @author Fabien Potencier - * @author Bulat Shakirzyanov - * @author Robert Kiss - */ -class ServerBag extends ParameterBag -{ - /** - * Gets the HTTP headers. - */ - public function getHeaders(): array - { - $headers = []; - foreach ($this->parameters as $key => $value) { - if (str_starts_with($key, 'HTTP_')) { - $headers[substr($key, 5)] = $value; - } elseif (\in_array($key, ['CONTENT_TYPE', 'CONTENT_LENGTH', 'CONTENT_MD5'], true)) { - $headers[$key] = $value; - } - } - - if (isset($this->parameters['PHP_AUTH_USER'])) { - $headers['PHP_AUTH_USER'] = $this->parameters['PHP_AUTH_USER']; - $headers['PHP_AUTH_PW'] = $this->parameters['PHP_AUTH_PW'] ?? ''; - } else { - /* - * php-cgi under Apache does not pass HTTP Basic user/pass to PHP by default - * For this workaround to work, add these lines to your .htaccess file: - * RewriteCond %{HTTP:Authorization} .+ - * RewriteRule ^ - [E=HTTP_AUTHORIZATION:%0] - * - * A sample .htaccess file: - * RewriteEngine On - * RewriteCond %{HTTP:Authorization} .+ - * RewriteRule ^ - [E=HTTP_AUTHORIZATION:%0] - * RewriteCond %{REQUEST_FILENAME} !-f - * RewriteRule ^(.*)$ app.php [QSA,L] - */ - - $authorizationHeader = null; - if (isset($this->parameters['HTTP_AUTHORIZATION'])) { - $authorizationHeader = $this->parameters['HTTP_AUTHORIZATION']; - } elseif (isset($this->parameters['REDIRECT_HTTP_AUTHORIZATION'])) { - $authorizationHeader = $this->parameters['REDIRECT_HTTP_AUTHORIZATION']; - } - - if (null !== $authorizationHeader) { - if (0 === stripos($authorizationHeader, 'basic ')) { - // Decode AUTHORIZATION header into PHP_AUTH_USER and PHP_AUTH_PW when authorization header is basic - $exploded = explode(':', base64_decode(substr($authorizationHeader, 6)), 2); - if (2 == \count($exploded)) { - [$headers['PHP_AUTH_USER'], $headers['PHP_AUTH_PW']] = $exploded; - } - } elseif (empty($this->parameters['PHP_AUTH_DIGEST']) && (0 === stripos($authorizationHeader, 'digest '))) { - // In some circumstances PHP_AUTH_DIGEST needs to be set - $headers['PHP_AUTH_DIGEST'] = $authorizationHeader; - $this->parameters['PHP_AUTH_DIGEST'] = $authorizationHeader; - } elseif (0 === stripos($authorizationHeader, 'bearer ')) { - /* - * XXX: Since there is no PHP_AUTH_BEARER in PHP predefined variables, - * I'll just set $headers['AUTHORIZATION'] here. - * https://php.net/reserved.variables.server - */ - $headers['AUTHORIZATION'] = $authorizationHeader; - } - } - } - - if (isset($headers['AUTHORIZATION'])) { - return $headers; - } - - // PHP_AUTH_USER/PHP_AUTH_PW - if (isset($headers['PHP_AUTH_USER'])) { - $headers['AUTHORIZATION'] = 'Basic '.base64_encode($headers['PHP_AUTH_USER'].':'.($headers['PHP_AUTH_PW'] ?? '')); - } elseif (isset($headers['PHP_AUTH_DIGEST'])) { - $headers['AUTHORIZATION'] = $headers['PHP_AUTH_DIGEST']; - } - - return $headers; - } -} diff --git a/vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php b/vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php deleted file mode 100644 index 66596175..00000000 --- a/vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php +++ /dev/null @@ -1,118 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Session\Attribute; - -/** - * This class relates to session attribute storage. - * - * @implements \IteratorAggregate - */ -class AttributeBag implements AttributeBagInterface, \IteratorAggregate, \Countable -{ - private string $name = 'attributes'; - private string $storageKey; - - protected $attributes = []; - - /** - * @param string $storageKey The key used to store attributes in the session - */ - public function __construct(string $storageKey = '_sf2_attributes') - { - $this->storageKey = $storageKey; - } - - public function getName(): string - { - return $this->name; - } - - public function setName(string $name) - { - $this->name = $name; - } - - public function initialize(array &$attributes) - { - $this->attributes = &$attributes; - } - - public function getStorageKey(): string - { - return $this->storageKey; - } - - public function has(string $name): bool - { - return \array_key_exists($name, $this->attributes); - } - - public function get(string $name, mixed $default = null): mixed - { - return \array_key_exists($name, $this->attributes) ? $this->attributes[$name] : $default; - } - - public function set(string $name, mixed $value) - { - $this->attributes[$name] = $value; - } - - public function all(): array - { - return $this->attributes; - } - - public function replace(array $attributes) - { - $this->attributes = []; - foreach ($attributes as $key => $value) { - $this->set($key, $value); - } - } - - public function remove(string $name): mixed - { - $retval = null; - if (\array_key_exists($name, $this->attributes)) { - $retval = $this->attributes[$name]; - unset($this->attributes[$name]); - } - - return $retval; - } - - public function clear(): mixed - { - $return = $this->attributes; - $this->attributes = []; - - return $return; - } - - /** - * Returns an iterator for attributes. - * - * @return \ArrayIterator - */ - public function getIterator(): \ArrayIterator - { - return new \ArrayIterator($this->attributes); - } - - /** - * Returns the number of attributes. - */ - public function count(): int - { - return \count($this->attributes); - } -} diff --git a/vendor/symfony/http-foundation/Session/Attribute/AttributeBagInterface.php b/vendor/symfony/http-foundation/Session/Attribute/AttributeBagInterface.php deleted file mode 100644 index 31a94644..00000000 --- a/vendor/symfony/http-foundation/Session/Attribute/AttributeBagInterface.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\HttpFoundation\Session\Attribute; - -use Symfony\Component\HttpFoundation\Session\SessionBagInterface; - -/** - * Attributes store. - * - * @author Drak - */ -interface AttributeBagInterface extends SessionBagInterface -{ - /** - * Checks if an attribute is defined. - */ - public function has(string $name): bool; - - /** - * Returns an attribute. - */ - public function get(string $name, mixed $default = null): mixed; - - /** - * Sets an attribute. - */ - public function set(string $name, mixed $value); - - /** - * Returns attributes. - * - * @return array - */ - public function all(): array; - - public function replace(array $attributes); - - /** - * Removes an attribute. - * - * @return mixed The removed value or null when it does not exist - */ - public function remove(string $name): mixed; -} diff --git a/vendor/symfony/http-foundation/Session/Flash/AutoExpireFlashBag.php b/vendor/symfony/http-foundation/Session/Flash/AutoExpireFlashBag.php deleted file mode 100644 index 00b1ac94..00000000 --- a/vendor/symfony/http-foundation/Session/Flash/AutoExpireFlashBag.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\HttpFoundation\Session\Flash; - -/** - * AutoExpireFlashBag flash message container. - * - * @author Drak - */ -class AutoExpireFlashBag implements FlashBagInterface -{ - private string $name = 'flashes'; - private array $flashes = ['display' => [], 'new' => []]; - private string $storageKey; - - /** - * @param string $storageKey The key used to store flashes in the session - */ - public function __construct(string $storageKey = '_symfony_flashes') - { - $this->storageKey = $storageKey; - } - - public function getName(): string - { - return $this->name; - } - - public function setName(string $name) - { - $this->name = $name; - } - - public function initialize(array &$flashes) - { - $this->flashes = &$flashes; - - // The logic: messages from the last request will be stored in new, so we move them to previous - // This request we will show what is in 'display'. What is placed into 'new' this time round will - // be moved to display next time round. - $this->flashes['display'] = \array_key_exists('new', $this->flashes) ? $this->flashes['new'] : []; - $this->flashes['new'] = []; - } - - public function add(string $type, mixed $message) - { - $this->flashes['new'][$type][] = $message; - } - - public function peek(string $type, array $default = []): array - { - return $this->has($type) ? $this->flashes['display'][$type] : $default; - } - - public function peekAll(): array - { - return \array_key_exists('display', $this->flashes) ? $this->flashes['display'] : []; - } - - public function get(string $type, array $default = []): array - { - $return = $default; - - if (!$this->has($type)) { - return $return; - } - - if (isset($this->flashes['display'][$type])) { - $return = $this->flashes['display'][$type]; - unset($this->flashes['display'][$type]); - } - - return $return; - } - - public function all(): array - { - $return = $this->flashes['display']; - $this->flashes['display'] = []; - - return $return; - } - - public function setAll(array $messages) - { - $this->flashes['new'] = $messages; - } - - public function set(string $type, string|array $messages) - { - $this->flashes['new'][$type] = (array) $messages; - } - - public function has(string $type): bool - { - return \array_key_exists($type, $this->flashes['display']) && $this->flashes['display'][$type]; - } - - public function keys(): array - { - return array_keys($this->flashes['display']); - } - - public function getStorageKey(): string - { - return $this->storageKey; - } - - public function clear(): mixed - { - return $this->all(); - } -} diff --git a/vendor/symfony/http-foundation/Session/Flash/FlashBag.php b/vendor/symfony/http-foundation/Session/Flash/FlashBag.php deleted file mode 100644 index a30d9528..00000000 --- a/vendor/symfony/http-foundation/Session/Flash/FlashBag.php +++ /dev/null @@ -1,113 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Session\Flash; - -/** - * FlashBag flash message container. - * - * @author Drak - */ -class FlashBag implements FlashBagInterface -{ - private string $name = 'flashes'; - private array $flashes = []; - private string $storageKey; - - /** - * @param string $storageKey The key used to store flashes in the session - */ - public function __construct(string $storageKey = '_symfony_flashes') - { - $this->storageKey = $storageKey; - } - - public function getName(): string - { - return $this->name; - } - - public function setName(string $name) - { - $this->name = $name; - } - - public function initialize(array &$flashes) - { - $this->flashes = &$flashes; - } - - public function add(string $type, mixed $message) - { - $this->flashes[$type][] = $message; - } - - public function peek(string $type, array $default = []): array - { - return $this->has($type) ? $this->flashes[$type] : $default; - } - - public function peekAll(): array - { - return $this->flashes; - } - - public function get(string $type, array $default = []): array - { - if (!$this->has($type)) { - return $default; - } - - $return = $this->flashes[$type]; - - unset($this->flashes[$type]); - - return $return; - } - - public function all(): array - { - $return = $this->peekAll(); - $this->flashes = []; - - return $return; - } - - public function set(string $type, string|array $messages) - { - $this->flashes[$type] = (array) $messages; - } - - public function setAll(array $messages) - { - $this->flashes = $messages; - } - - public function has(string $type): bool - { - return \array_key_exists($type, $this->flashes) && $this->flashes[$type]; - } - - public function keys(): array - { - return array_keys($this->flashes); - } - - public function getStorageKey(): string - { - return $this->storageKey; - } - - public function clear(): mixed - { - return $this->all(); - } -} diff --git a/vendor/symfony/http-foundation/Session/Flash/FlashBagInterface.php b/vendor/symfony/http-foundation/Session/Flash/FlashBagInterface.php deleted file mode 100644 index cd10a23f..00000000 --- a/vendor/symfony/http-foundation/Session/Flash/FlashBagInterface.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Session\Flash; - -use Symfony\Component\HttpFoundation\Session\SessionBagInterface; - -/** - * FlashBagInterface. - * - * @author Drak - */ -interface FlashBagInterface extends SessionBagInterface -{ - /** - * Adds a flash message for the given type. - */ - public function add(string $type, mixed $message); - - /** - * Registers one or more messages for a given type. - */ - public function set(string $type, string|array $messages); - - /** - * Gets flash messages for a given type. - * - * @param string $type Message category type - * @param array $default Default value if $type does not exist - */ - public function peek(string $type, array $default = []): array; - - /** - * Gets all flash messages. - */ - public function peekAll(): array; - - /** - * Gets and clears flash from the stack. - * - * @param array $default Default value if $type does not exist - */ - public function get(string $type, array $default = []): array; - - /** - * Gets and clears flashes from the stack. - */ - public function all(): array; - - /** - * Sets all flash messages. - */ - public function setAll(array $messages); - - /** - * Has flash messages for a given type? - */ - public function has(string $type): bool; - - /** - * Returns a list of all defined types. - */ - public function keys(): array; -} diff --git a/vendor/symfony/http-foundation/Session/FlashBagAwareSessionInterface.php b/vendor/symfony/http-foundation/Session/FlashBagAwareSessionInterface.php deleted file mode 100644 index 90151d38..00000000 --- a/vendor/symfony/http-foundation/Session/FlashBagAwareSessionInterface.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Session; - -use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface; - -/** - * Interface for session with a flashbag. - */ -interface FlashBagAwareSessionInterface extends SessionInterface -{ - public function getFlashBag(): FlashBagInterface; -} diff --git a/vendor/symfony/http-foundation/Session/Session.php b/vendor/symfony/http-foundation/Session/Session.php deleted file mode 100644 index a55dde48..00000000 --- a/vendor/symfony/http-foundation/Session/Session.php +++ /dev/null @@ -1,223 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Session; - -use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag; -use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBagInterface; -use Symfony\Component\HttpFoundation\Session\Flash\FlashBag; -use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface; -use Symfony\Component\HttpFoundation\Session\Storage\MetadataBag; -use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage; -use Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface; - -// Help opcache.preload discover always-needed symbols -class_exists(AttributeBag::class); -class_exists(FlashBag::class); -class_exists(SessionBagProxy::class); - -/** - * @author Fabien Potencier - * @author Drak - * - * @implements \IteratorAggregate - */ -class Session implements FlashBagAwareSessionInterface, \IteratorAggregate, \Countable -{ - protected $storage; - - private string $flashName; - private string $attributeName; - private array $data = []; - private int $usageIndex = 0; - private ?\Closure $usageReporter; - - public function __construct(SessionStorageInterface $storage = null, AttributeBagInterface $attributes = null, FlashBagInterface $flashes = null, callable $usageReporter = null) - { - $this->storage = $storage ?? new NativeSessionStorage(); - $this->usageReporter = null === $usageReporter ? null : $usageReporter(...); - - $attributes ??= new AttributeBag(); - $this->attributeName = $attributes->getName(); - $this->registerBag($attributes); - - $flashes ??= new FlashBag(); - $this->flashName = $flashes->getName(); - $this->registerBag($flashes); - } - - public function start(): bool - { - return $this->storage->start(); - } - - public function has(string $name): bool - { - return $this->getAttributeBag()->has($name); - } - - public function get(string $name, mixed $default = null): mixed - { - return $this->getAttributeBag()->get($name, $default); - } - - public function set(string $name, mixed $value) - { - $this->getAttributeBag()->set($name, $value); - } - - public function all(): array - { - return $this->getAttributeBag()->all(); - } - - public function replace(array $attributes) - { - $this->getAttributeBag()->replace($attributes); - } - - public function remove(string $name): mixed - { - return $this->getAttributeBag()->remove($name); - } - - public function clear() - { - $this->getAttributeBag()->clear(); - } - - public function isStarted(): bool - { - return $this->storage->isStarted(); - } - - /** - * Returns an iterator for attributes. - * - * @return \ArrayIterator - */ - public function getIterator(): \ArrayIterator - { - return new \ArrayIterator($this->getAttributeBag()->all()); - } - - /** - * Returns the number of attributes. - */ - public function count(): int - { - return \count($this->getAttributeBag()->all()); - } - - public function &getUsageIndex(): int - { - return $this->usageIndex; - } - - /** - * @internal - */ - public function isEmpty(): bool - { - if ($this->isStarted()) { - ++$this->usageIndex; - if ($this->usageReporter && 0 <= $this->usageIndex) { - ($this->usageReporter)(); - } - } - foreach ($this->data as &$data) { - if (!empty($data)) { - return false; - } - } - - return true; - } - - public function invalidate(int $lifetime = null): bool - { - $this->storage->clear(); - - return $this->migrate(true, $lifetime); - } - - public function migrate(bool $destroy = false, int $lifetime = null): bool - { - return $this->storage->regenerate($destroy, $lifetime); - } - - public function save() - { - $this->storage->save(); - } - - public function getId(): string - { - return $this->storage->getId(); - } - - public function setId(string $id) - { - if ($this->storage->getId() !== $id) { - $this->storage->setId($id); - } - } - - public function getName(): string - { - return $this->storage->getName(); - } - - public function setName(string $name) - { - $this->storage->setName($name); - } - - public function getMetadataBag(): MetadataBag - { - ++$this->usageIndex; - if ($this->usageReporter && 0 <= $this->usageIndex) { - ($this->usageReporter)(); - } - - return $this->storage->getMetadataBag(); - } - - public function registerBag(SessionBagInterface $bag) - { - $this->storage->registerBag(new SessionBagProxy($bag, $this->data, $this->usageIndex, $this->usageReporter)); - } - - public function getBag(string $name): SessionBagInterface - { - $bag = $this->storage->getBag($name); - - return method_exists($bag, 'getBag') ? $bag->getBag() : $bag; - } - - /** - * Gets the flashbag interface. - */ - public function getFlashBag(): FlashBagInterface - { - return $this->getBag($this->flashName); - } - - /** - * Gets the attributebag interface. - * - * Note that this method was added to help with IDE autocompletion. - */ - private function getAttributeBag(): AttributeBagInterface - { - return $this->getBag($this->attributeName); - } -} diff --git a/vendor/symfony/http-foundation/Session/SessionBagInterface.php b/vendor/symfony/http-foundation/Session/SessionBagInterface.php deleted file mode 100644 index 821645d9..00000000 --- a/vendor/symfony/http-foundation/Session/SessionBagInterface.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. - */ - -namespace Symfony\Component\HttpFoundation\Session; - -/** - * Session Bag store. - * - * @author Drak - */ -interface SessionBagInterface -{ - /** - * Gets this bag's name. - */ - public function getName(): string; - - /** - * Initializes the Bag. - */ - public function initialize(array &$array); - - /** - * Gets the storage key for this bag. - */ - public function getStorageKey(): string; - - /** - * Clears out data from bag. - * - * @return mixed Whatever data was contained - */ - public function clear(): mixed; -} diff --git a/vendor/symfony/http-foundation/Session/SessionBagProxy.php b/vendor/symfony/http-foundation/Session/SessionBagProxy.php deleted file mode 100644 index e759d94d..00000000 --- a/vendor/symfony/http-foundation/Session/SessionBagProxy.php +++ /dev/null @@ -1,83 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Session; - -/** - * @author Nicolas Grekas - * - * @internal - */ -final class SessionBagProxy implements SessionBagInterface -{ - private SessionBagInterface $bag; - private array $data; - private ?int $usageIndex; - private ?\Closure $usageReporter; - - public function __construct(SessionBagInterface $bag, array &$data, ?int &$usageIndex, ?callable $usageReporter) - { - $this->bag = $bag; - $this->data = &$data; - $this->usageIndex = &$usageIndex; - $this->usageReporter = null === $usageReporter ? null : $usageReporter(...); - } - - public function getBag(): SessionBagInterface - { - ++$this->usageIndex; - if ($this->usageReporter && 0 <= $this->usageIndex) { - ($this->usageReporter)(); - } - - return $this->bag; - } - - public function isEmpty(): bool - { - if (!isset($this->data[$this->bag->getStorageKey()])) { - return true; - } - ++$this->usageIndex; - if ($this->usageReporter && 0 <= $this->usageIndex) { - ($this->usageReporter)(); - } - - return empty($this->data[$this->bag->getStorageKey()]); - } - - public function getName(): string - { - return $this->bag->getName(); - } - - public function initialize(array &$array): void - { - ++$this->usageIndex; - if ($this->usageReporter && 0 <= $this->usageIndex) { - ($this->usageReporter)(); - } - - $this->data[$this->bag->getStorageKey()] = &$array; - - $this->bag->initialize($array); - } - - public function getStorageKey(): string - { - return $this->bag->getStorageKey(); - } - - public function clear(): mixed - { - return $this->bag->clear(); - } -} diff --git a/vendor/symfony/http-foundation/Session/SessionFactory.php b/vendor/symfony/http-foundation/Session/SessionFactory.php deleted file mode 100644 index cdb6af51..00000000 --- a/vendor/symfony/http-foundation/Session/SessionFactory.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Session; - -use Symfony\Component\HttpFoundation\RequestStack; -use Symfony\Component\HttpFoundation\Session\Storage\SessionStorageFactoryInterface; - -// Help opcache.preload discover always-needed symbols -class_exists(Session::class); - -/** - * @author Jérémy Derussé - */ -class SessionFactory implements SessionFactoryInterface -{ - private RequestStack $requestStack; - private SessionStorageFactoryInterface $storageFactory; - private ?\Closure $usageReporter; - - public function __construct(RequestStack $requestStack, SessionStorageFactoryInterface $storageFactory, callable $usageReporter = null) - { - $this->requestStack = $requestStack; - $this->storageFactory = $storageFactory; - $this->usageReporter = null === $usageReporter ? null : $usageReporter(...); - } - - public function createSession(): SessionInterface - { - return new Session($this->storageFactory->createStorage($this->requestStack->getMainRequest()), null, null, $this->usageReporter); - } -} diff --git a/vendor/symfony/http-foundation/Session/SessionFactoryInterface.php b/vendor/symfony/http-foundation/Session/SessionFactoryInterface.php deleted file mode 100644 index b24fdc49..00000000 --- a/vendor/symfony/http-foundation/Session/SessionFactoryInterface.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. - */ - -namespace Symfony\Component\HttpFoundation\Session; - -/** - * @author Kevin Bond - */ -interface SessionFactoryInterface -{ - public function createSession(): SessionInterface; -} diff --git a/vendor/symfony/http-foundation/Session/SessionInterface.php b/vendor/symfony/http-foundation/Session/SessionInterface.php deleted file mode 100644 index ae0c9b7d..00000000 --- a/vendor/symfony/http-foundation/Session/SessionInterface.php +++ /dev/null @@ -1,140 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Session; - -use Symfony\Component\HttpFoundation\Session\Storage\MetadataBag; - -/** - * Interface for the session. - * - * @author Drak - */ -interface SessionInterface -{ - /** - * Starts the session storage. - * - * @throws \RuntimeException if session fails to start - */ - public function start(): bool; - - /** - * Returns the session ID. - */ - public function getId(): string; - - /** - * Sets the session ID. - */ - public function setId(string $id); - - /** - * Returns the session name. - */ - public function getName(): string; - - /** - * Sets the session name. - */ - public function setName(string $name); - - /** - * Invalidates the current session. - * - * Clears all session attributes and flashes and regenerates the - * session and deletes the old session from persistence. - * - * @param int $lifetime Sets the cookie lifetime for the session cookie. A null value - * will leave the system settings unchanged, 0 sets the cookie - * to expire with browser session. Time is in seconds, and is - * not a Unix timestamp. - */ - public function invalidate(int $lifetime = null): bool; - - /** - * Migrates the current session to a new session id while maintaining all - * session attributes. - * - * @param bool $destroy Whether to delete the old session or leave it to garbage collection - * @param int $lifetime Sets the cookie lifetime for the session cookie. A null value - * will leave the system settings unchanged, 0 sets the cookie - * to expire with browser session. Time is in seconds, and is - * not a Unix timestamp. - */ - public function migrate(bool $destroy = false, int $lifetime = null): bool; - - /** - * Force the session to be saved and closed. - * - * This method is generally not required for real sessions as - * the session will be automatically saved at the end of - * code execution. - */ - public function save(); - - /** - * Checks if an attribute is defined. - */ - public function has(string $name): bool; - - /** - * Returns an attribute. - */ - public function get(string $name, mixed $default = null): mixed; - - /** - * Sets an attribute. - */ - public function set(string $name, mixed $value); - - /** - * Returns attributes. - */ - public function all(): array; - - /** - * Sets attributes. - */ - public function replace(array $attributes); - - /** - * Removes an attribute. - * - * @return mixed The removed value or null when it does not exist - */ - public function remove(string $name): mixed; - - /** - * Clears all attributes. - */ - public function clear(); - - /** - * Checks if the session was started. - */ - public function isStarted(): bool; - - /** - * Registers a SessionBagInterface with the session. - */ - public function registerBag(SessionBagInterface $bag); - - /** - * Gets a bag instance by name. - */ - public function getBag(string $name): SessionBagInterface; - - /** - * Gets session meta. - */ - public function getMetadataBag(): MetadataBag; -} diff --git a/vendor/symfony/http-foundation/Session/SessionUtils.php b/vendor/symfony/http-foundation/Session/SessionUtils.php deleted file mode 100644 index b5bce4a8..00000000 --- a/vendor/symfony/http-foundation/Session/SessionUtils.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Session; - -/** - * Session utility functions. - * - * @author Nicolas Grekas - * @author Rémon van de Kamp - * - * @internal - */ -final class SessionUtils -{ - /** - * Finds the session header amongst the headers that are to be sent, removes it, and returns - * it so the caller can process it further. - */ - public static function popSessionCookie(string $sessionName, string $sessionId): ?string - { - $sessionCookie = null; - $sessionCookiePrefix = sprintf(' %s=', urlencode($sessionName)); - $sessionCookieWithId = sprintf('%s%s;', $sessionCookiePrefix, urlencode($sessionId)); - $otherCookies = []; - foreach (headers_list() as $h) { - if (0 !== stripos($h, 'Set-Cookie:')) { - continue; - } - if (11 === strpos($h, $sessionCookiePrefix, 11)) { - $sessionCookie = $h; - - if (11 !== strpos($h, $sessionCookieWithId, 11)) { - $otherCookies[] = $h; - } - } else { - $otherCookies[] = $h; - } - } - if (null === $sessionCookie) { - return null; - } - - header_remove('Set-Cookie'); - foreach ($otherCookies as $h) { - header($h, false); - } - - return $sessionCookie; - } -} diff --git a/vendor/symfony/http-foundation/Session/Storage/Handler/AbstractSessionHandler.php b/vendor/symfony/http-foundation/Session/Storage/Handler/AbstractSessionHandler.php deleted file mode 100644 index 88e513c5..00000000 --- a/vendor/symfony/http-foundation/Session/Storage/Handler/AbstractSessionHandler.php +++ /dev/null @@ -1,111 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; - -use Symfony\Component\HttpFoundation\Session\SessionUtils; - -/** - * This abstract session handler provides a generic implementation - * of the PHP 7.0 SessionUpdateTimestampHandlerInterface, - * enabling strict and lazy session handling. - * - * @author Nicolas Grekas - */ -abstract class AbstractSessionHandler implements \SessionHandlerInterface, \SessionUpdateTimestampHandlerInterface -{ - private string $sessionName; - private string $prefetchId; - private string $prefetchData; - private ?string $newSessionId = null; - private string $igbinaryEmptyData; - - public function open(string $savePath, string $sessionName): bool - { - $this->sessionName = $sessionName; - if (!headers_sent() && !\ini_get('session.cache_limiter') && '0' !== \ini_get('session.cache_limiter')) { - header(sprintf('Cache-Control: max-age=%d, private, must-revalidate', 60 * (int) \ini_get('session.cache_expire'))); - } - - return true; - } - - abstract protected function doRead(string $sessionId): string; - - abstract protected function doWrite(string $sessionId, string $data): bool; - - abstract protected function doDestroy(string $sessionId): bool; - - public function validateId(string $sessionId): bool - { - $this->prefetchData = $this->read($sessionId); - $this->prefetchId = $sessionId; - - return '' !== $this->prefetchData; - } - - public function read(string $sessionId): string - { - if (isset($this->prefetchId)) { - $prefetchId = $this->prefetchId; - $prefetchData = $this->prefetchData; - unset($this->prefetchId, $this->prefetchData); - - if ($prefetchId === $sessionId || '' === $prefetchData) { - $this->newSessionId = '' === $prefetchData ? $sessionId : null; - - return $prefetchData; - } - } - - $data = $this->doRead($sessionId); - $this->newSessionId = '' === $data ? $sessionId : null; - - return $data; - } - - public function write(string $sessionId, string $data): bool - { - // see https://github.com/igbinary/igbinary/issues/146 - $this->igbinaryEmptyData ??= \function_exists('igbinary_serialize') ? igbinary_serialize([]) : ''; - if ('' === $data || $this->igbinaryEmptyData === $data) { - return $this->destroy($sessionId); - } - $this->newSessionId = null; - - return $this->doWrite($sessionId, $data); - } - - public function destroy(string $sessionId): bool - { - if (!headers_sent() && filter_var(\ini_get('session.use_cookies'), \FILTER_VALIDATE_BOOL)) { - if (!isset($this->sessionName)) { - throw new \LogicException(sprintf('Session name cannot be empty, did you forget to call "parent::open()" in "%s"?.', static::class)); - } - $cookie = SessionUtils::popSessionCookie($this->sessionName, $sessionId); - - /* - * We send an invalidation Set-Cookie header (zero lifetime) - * when either the session was started or a cookie with - * the session name was sent by the client (in which case - * we know it's invalid as a valid session cookie would've - * started the session). - */ - if (null === $cookie || isset($_COOKIE[$this->sessionName])) { - $params = session_get_cookie_params(); - unset($params['lifetime']); - setcookie($this->sessionName, '', $params); - } - } - - return $this->newSessionId === $sessionId || $this->doDestroy($sessionId); - } -} diff --git a/vendor/symfony/http-foundation/Session/Storage/Handler/IdentityMarshaller.php b/vendor/symfony/http-foundation/Session/Storage/Handler/IdentityMarshaller.php deleted file mode 100644 index 411a8d1f..00000000 --- a/vendor/symfony/http-foundation/Session/Storage/Handler/IdentityMarshaller.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\HttpFoundation\Session\Storage\Handler; - -use Symfony\Component\Cache\Marshaller\MarshallerInterface; - -/** - * @author Ahmed TAILOULOUTE - */ -class IdentityMarshaller implements MarshallerInterface -{ - public function marshall(array $values, ?array &$failed): array - { - foreach ($values as $key => $value) { - if (!\is_string($value)) { - throw new \LogicException(sprintf('%s accepts only string as data.', __METHOD__)); - } - } - - return $values; - } - - public function unmarshall(string $value): string - { - return $value; - } -} diff --git a/vendor/symfony/http-foundation/Session/Storage/Handler/MarshallingSessionHandler.php b/vendor/symfony/http-foundation/Session/Storage/Handler/MarshallingSessionHandler.php deleted file mode 100644 index 9962fef3..00000000 --- a/vendor/symfony/http-foundation/Session/Storage/Handler/MarshallingSessionHandler.php +++ /dev/null @@ -1,76 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; - -use Symfony\Component\Cache\Marshaller\MarshallerInterface; - -/** - * @author Ahmed TAILOULOUTE - */ -class MarshallingSessionHandler implements \SessionHandlerInterface, \SessionUpdateTimestampHandlerInterface -{ - private AbstractSessionHandler $handler; - private MarshallerInterface $marshaller; - - public function __construct(AbstractSessionHandler $handler, MarshallerInterface $marshaller) - { - $this->handler = $handler; - $this->marshaller = $marshaller; - } - - public function open(string $savePath, string $name): bool - { - return $this->handler->open($savePath, $name); - } - - public function close(): bool - { - return $this->handler->close(); - } - - public function destroy(string $sessionId): bool - { - return $this->handler->destroy($sessionId); - } - - public function gc(int $maxlifetime): int|false - { - return $this->handler->gc($maxlifetime); - } - - public function read(string $sessionId): string - { - return $this->marshaller->unmarshall($this->handler->read($sessionId)); - } - - public function write(string $sessionId, string $data): bool - { - $failed = []; - $marshalledData = $this->marshaller->marshall(['data' => $data], $failed); - - if (isset($failed['data'])) { - return false; - } - - return $this->handler->write($sessionId, $marshalledData['data']); - } - - public function validateId(string $sessionId): bool - { - return $this->handler->validateId($sessionId); - } - - public function updateTimestamp(string $sessionId, string $data): bool - { - return $this->handler->updateTimestamp($sessionId, $data); - } -} diff --git a/vendor/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.php b/vendor/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.php deleted file mode 100644 index 2bc29b45..00000000 --- a/vendor/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.php +++ /dev/null @@ -1,112 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; - -/** - * Memcached based session storage handler based on the Memcached class - * provided by the PHP memcached extension. - * - * @see https://php.net/memcached - * - * @author Drak - */ -class MemcachedSessionHandler extends AbstractSessionHandler -{ - private \Memcached $memcached; - - /** - * Time to live in seconds. - */ - private int|\Closure|null $ttl; - - /** - * Key prefix for shared environments. - */ - private string $prefix; - - /** - * Constructor. - * - * List of available options: - * * prefix: The prefix to use for the memcached keys in order to avoid collision - * * ttl: The time to live in seconds. - * - * @throws \InvalidArgumentException When unsupported options are passed - */ - public function __construct(\Memcached $memcached, array $options = []) - { - $this->memcached = $memcached; - - if ($diff = array_diff(array_keys($options), ['prefix', 'expiretime', 'ttl'])) { - throw new \InvalidArgumentException(sprintf('The following options are not supported "%s".', implode(', ', $diff))); - } - - $this->ttl = $options['expiretime'] ?? $options['ttl'] ?? null; - $this->prefix = $options['prefix'] ?? 'sf2s'; - } - - public function close(): bool - { - return $this->memcached->quit(); - } - - protected function doRead(string $sessionId): string - { - return $this->memcached->get($this->prefix.$sessionId) ?: ''; - } - - public function updateTimestamp(string $sessionId, string $data): bool - { - $this->memcached->touch($this->prefix.$sessionId, $this->getCompatibleTtl()); - - return true; - } - - protected function doWrite(string $sessionId, string $data): bool - { - return $this->memcached->set($this->prefix.$sessionId, $data, $this->getCompatibleTtl()); - } - - private function getCompatibleTtl(): int - { - $ttl = ($this->ttl instanceof \Closure ? ($this->ttl)() : $this->ttl) ?? \ini_get('session.gc_maxlifetime'); - - // If the relative TTL that is used exceeds 30 days, memcached will treat the value as Unix time. - // We have to convert it to an absolute Unix time at this point, to make sure the TTL is correct. - if ($ttl > 60 * 60 * 24 * 30) { - $ttl += time(); - } - - return $ttl; - } - - protected function doDestroy(string $sessionId): bool - { - $result = $this->memcached->delete($this->prefix.$sessionId); - - return $result || \Memcached::RES_NOTFOUND == $this->memcached->getResultCode(); - } - - public function gc(int $maxlifetime): int|false - { - // not required here because memcached will auto expire the records anyhow. - return 0; - } - - /** - * Return a Memcached instance. - */ - protected function getMemcached(): \Memcached - { - return $this->memcached; - } -} diff --git a/vendor/symfony/http-foundation/Session/Storage/Handler/MigratingSessionHandler.php b/vendor/symfony/http-foundation/Session/Storage/Handler/MigratingSessionHandler.php deleted file mode 100644 index 1d425523..00000000 --- a/vendor/symfony/http-foundation/Session/Storage/Handler/MigratingSessionHandler.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\HttpFoundation\Session\Storage\Handler; - -/** - * Migrating session handler for migrating from one handler to another. It reads - * from the current handler and writes both the current and new ones. - * - * It ignores errors from the new handler. - * - * @author Ross Motley - * @author Oliver Radwell - */ -class MigratingSessionHandler implements \SessionHandlerInterface, \SessionUpdateTimestampHandlerInterface -{ - /** - * @var \SessionHandlerInterface&\SessionUpdateTimestampHandlerInterface - */ - private \SessionHandlerInterface $currentHandler; - - /** - * @var \SessionHandlerInterface&\SessionUpdateTimestampHandlerInterface - */ - private \SessionHandlerInterface $writeOnlyHandler; - - public function __construct(\SessionHandlerInterface $currentHandler, \SessionHandlerInterface $writeOnlyHandler) - { - if (!$currentHandler instanceof \SessionUpdateTimestampHandlerInterface) { - $currentHandler = new StrictSessionHandler($currentHandler); - } - if (!$writeOnlyHandler instanceof \SessionUpdateTimestampHandlerInterface) { - $writeOnlyHandler = new StrictSessionHandler($writeOnlyHandler); - } - - $this->currentHandler = $currentHandler; - $this->writeOnlyHandler = $writeOnlyHandler; - } - - public function close(): bool - { - $result = $this->currentHandler->close(); - $this->writeOnlyHandler->close(); - - return $result; - } - - public function destroy(string $sessionId): bool - { - $result = $this->currentHandler->destroy($sessionId); - $this->writeOnlyHandler->destroy($sessionId); - - return $result; - } - - public function gc(int $maxlifetime): int|false - { - $result = $this->currentHandler->gc($maxlifetime); - $this->writeOnlyHandler->gc($maxlifetime); - - return $result; - } - - public function open(string $savePath, string $sessionName): bool - { - $result = $this->currentHandler->open($savePath, $sessionName); - $this->writeOnlyHandler->open($savePath, $sessionName); - - return $result; - } - - public function read(string $sessionId): string - { - // No reading from new handler until switch-over - return $this->currentHandler->read($sessionId); - } - - public function write(string $sessionId, string $sessionData): bool - { - $result = $this->currentHandler->write($sessionId, $sessionData); - $this->writeOnlyHandler->write($sessionId, $sessionData); - - return $result; - } - - public function validateId(string $sessionId): bool - { - // No reading from new handler until switch-over - return $this->currentHandler->validateId($sessionId); - } - - public function updateTimestamp(string $sessionId, string $sessionData): bool - { - $result = $this->currentHandler->updateTimestamp($sessionId, $sessionData); - $this->writeOnlyHandler->updateTimestamp($sessionId, $sessionData); - - return $result; - } -} diff --git a/vendor/symfony/http-foundation/Session/Storage/Handler/MongoDbSessionHandler.php b/vendor/symfony/http-foundation/Session/Storage/Handler/MongoDbSessionHandler.php deleted file mode 100644 index 63c609ae..00000000 --- a/vendor/symfony/http-foundation/Session/Storage/Handler/MongoDbSessionHandler.php +++ /dev/null @@ -1,162 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; - -use MongoDB\BSON\Binary; -use MongoDB\BSON\UTCDateTime; -use MongoDB\Client; -use MongoDB\Collection; - -/** - * Session handler using the mongodb/mongodb package and MongoDB driver extension. - * - * @author Markus Bachmann - * - * @see https://packagist.org/packages/mongodb/mongodb - * @see https://php.net/mongodb - */ -class MongoDbSessionHandler extends AbstractSessionHandler -{ - private Client $mongo; - private Collection $collection; - private array $options; - private int|\Closure|null $ttl; - - /** - * Constructor. - * - * List of available options: - * * database: The name of the database [required] - * * collection: The name of the collection [required] - * * id_field: The field name for storing the session id [default: _id] - * * data_field: The field name for storing the session data [default: data] - * * time_field: The field name for storing the timestamp [default: time] - * * expiry_field: The field name for storing the expiry-timestamp [default: expires_at] - * * ttl: The time to live in seconds. - * - * It is strongly recommended to put an index on the `expiry_field` for - * garbage-collection. Alternatively it's possible to automatically expire - * the sessions in the database as described below: - * - * A TTL collections can be used on MongoDB 2.2+ to cleanup expired sessions - * automatically. Such an index can for example look like this: - * - * db..createIndex( - * { "": 1 }, - * { "expireAfterSeconds": 0 } - * ) - * - * More details on: https://docs.mongodb.org/manual/tutorial/expire-data/ - * - * If you use such an index, you can drop `gc_probability` to 0 since - * no garbage-collection is required. - * - * @throws \InvalidArgumentException When "database" or "collection" not provided - */ - public function __construct(Client $mongo, array $options) - { - if (!isset($options['database']) || !isset($options['collection'])) { - throw new \InvalidArgumentException('You must provide the "database" and "collection" option for MongoDBSessionHandler.'); - } - - $this->mongo = $mongo; - - $this->options = array_merge([ - 'id_field' => '_id', - 'data_field' => 'data', - 'time_field' => 'time', - 'expiry_field' => 'expires_at', - ], $options); - $this->ttl = $this->options['ttl'] ?? null; - } - - public function close(): bool - { - return true; - } - - protected function doDestroy(string $sessionId): bool - { - $this->getCollection()->deleteOne([ - $this->options['id_field'] => $sessionId, - ]); - - return true; - } - - public function gc(int $maxlifetime): int|false - { - return $this->getCollection()->deleteMany([ - $this->options['expiry_field'] => ['$lt' => new UTCDateTime()], - ])->getDeletedCount(); - } - - protected function doWrite(string $sessionId, string $data): bool - { - $ttl = ($this->ttl instanceof \Closure ? ($this->ttl)() : $this->ttl) ?? \ini_get('session.gc_maxlifetime'); - $expiry = new UTCDateTime((time() + (int) $ttl) * 1000); - - $fields = [ - $this->options['time_field'] => new UTCDateTime(), - $this->options['expiry_field'] => $expiry, - $this->options['data_field'] => new Binary($data, Binary::TYPE_OLD_BINARY), - ]; - - $this->getCollection()->updateOne( - [$this->options['id_field'] => $sessionId], - ['$set' => $fields], - ['upsert' => true] - ); - - return true; - } - - public function updateTimestamp(string $sessionId, string $data): bool - { - $ttl = ($this->ttl instanceof \Closure ? ($this->ttl)() : $this->ttl) ?? \ini_get('session.gc_maxlifetime'); - $expiry = new UTCDateTime((time() + (int) $ttl) * 1000); - - $this->getCollection()->updateOne( - [$this->options['id_field'] => $sessionId], - ['$set' => [ - $this->options['time_field'] => new UTCDateTime(), - $this->options['expiry_field'] => $expiry, - ]] - ); - - return true; - } - - protected function doRead(string $sessionId): string - { - $dbData = $this->getCollection()->findOne([ - $this->options['id_field'] => $sessionId, - $this->options['expiry_field'] => ['$gte' => new UTCDateTime()], - ]); - - if (null === $dbData) { - return ''; - } - - return $dbData[$this->options['data_field']]->getData(); - } - - private function getCollection(): Collection - { - return $this->collection ??= $this->mongo->selectCollection($this->options['database'], $this->options['collection']); - } - - protected function getMongo(): Client - { - return $this->mongo; - } -} diff --git a/vendor/symfony/http-foundation/Session/Storage/Handler/NativeFileSessionHandler.php b/vendor/symfony/http-foundation/Session/Storage/Handler/NativeFileSessionHandler.php deleted file mode 100644 index e13fcc17..00000000 --- a/vendor/symfony/http-foundation/Session/Storage/Handler/NativeFileSessionHandler.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\HttpFoundation\Session\Storage\Handler; - -/** - * Native session handler using PHP's built in file storage. - * - * @author Drak - */ -class NativeFileSessionHandler extends \SessionHandler -{ - /** - * @param string $savePath Path of directory to save session files - * Default null will leave setting as defined by PHP. - * '/path', 'N;/path', or 'N;octal-mode;/path - * - * @see https://php.net/session.configuration#ini.session.save-path for further details. - * - * @throws \InvalidArgumentException On invalid $savePath - * @throws \RuntimeException When failing to create the save directory - */ - public function __construct(string $savePath = null) - { - $baseDir = $savePath ??= \ini_get('session.save_path'); - - if ($count = substr_count($savePath, ';')) { - if ($count > 2) { - throw new \InvalidArgumentException(sprintf('Invalid argument $savePath \'%s\'.', $savePath)); - } - - // characters after last ';' are the path - $baseDir = ltrim(strrchr($savePath, ';'), ';'); - } - - if ($baseDir && !is_dir($baseDir) && !@mkdir($baseDir, 0777, true) && !is_dir($baseDir)) { - throw new \RuntimeException(sprintf('Session Storage was not able to create directory "%s".', $baseDir)); - } - - ini_set('session.save_path', $savePath); - ini_set('session.save_handler', 'files'); - } -} diff --git a/vendor/symfony/http-foundation/Session/Storage/Handler/NullSessionHandler.php b/vendor/symfony/http-foundation/Session/Storage/Handler/NullSessionHandler.php deleted file mode 100644 index 790ac2fe..00000000 --- a/vendor/symfony/http-foundation/Session/Storage/Handler/NullSessionHandler.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; - -/** - * Can be used in unit testing or in a situations where persisted sessions are not desired. - * - * @author Drak - */ -class NullSessionHandler extends AbstractSessionHandler -{ - public function close(): bool - { - return true; - } - - public function validateId(string $sessionId): bool - { - return true; - } - - protected function doRead(string $sessionId): string - { - return ''; - } - - public function updateTimestamp(string $sessionId, string $data): bool - { - return true; - } - - protected function doWrite(string $sessionId, string $data): bool - { - return true; - } - - protected function doDestroy(string $sessionId): bool - { - return true; - } - - public function gc(int $maxlifetime): int|false - { - return 0; - } -} diff --git a/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php b/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php deleted file mode 100644 index 30237262..00000000 --- a/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php +++ /dev/null @@ -1,846 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; - -/** - * Session handler using a PDO connection to read and write data. - * - * It works with MySQL, PostgreSQL, Oracle, SQL Server and SQLite and implements - * different locking strategies to handle concurrent access to the same session. - * Locking is necessary to prevent loss of data due to race conditions and to keep - * the session data consistent between read() and write(). With locking, requests - * for the same session will wait until the other one finished writing. For this - * reason it's best practice to close a session as early as possible to improve - * concurrency. PHPs internal files session handler also implements locking. - * - * Attention: Since SQLite does not support row level locks but locks the whole database, - * it means only one session can be accessed at a time. Even different sessions would wait - * for another to finish. So saving session in SQLite should only be considered for - * development or prototypes. - * - * Session data is a binary string that can contain non-printable characters like the null byte. - * For this reason it must be saved in a binary column in the database like BLOB in MySQL. - * Saving it in a character column could corrupt the data. You can use createTable() - * to initialize a correctly defined table. - * - * @see https://php.net/sessionhandlerinterface - * - * @author Fabien Potencier - * @author Michael Williams - * @author Tobias Schultze - */ -class PdoSessionHandler extends AbstractSessionHandler -{ - /** - * No locking is done. This means sessions are prone to loss of data due to - * race conditions of concurrent requests to the same session. The last session - * write will win in this case. It might be useful when you implement your own - * logic to deal with this like an optimistic approach. - */ - public const LOCK_NONE = 0; - - /** - * Creates an application-level lock on a session. The disadvantage is that the - * lock is not enforced by the database and thus other, unaware parts of the - * application could still concurrently modify the session. The advantage is it - * does not require a transaction. - * This mode is not available for SQLite and not yet implemented for oci and sqlsrv. - */ - public const LOCK_ADVISORY = 1; - - /** - * Issues a real row lock. Since it uses a transaction between opening and - * closing a session, you have to be careful when you use same database connection - * that you also use for your application logic. This mode is the default because - * it's the only reliable solution across DBMSs. - */ - public const LOCK_TRANSACTIONAL = 2; - - private \PDO $pdo; - - /** - * DSN string or null for session.save_path or false when lazy connection disabled. - */ - private string|false|null $dsn = false; - - private string $driver; - private string $table = 'sessions'; - private string $idCol = 'sess_id'; - private string $dataCol = 'sess_data'; - private string $lifetimeCol = 'sess_lifetime'; - private string $timeCol = 'sess_time'; - - /** - * Time to live in seconds. - */ - private int|\Closure|null $ttl; - - /** - * Username when lazy-connect. - */ - private string $username = ''; - - /** - * Password when lazy-connect. - */ - private string $password = ''; - - /** - * Connection options when lazy-connect. - */ - private array $connectionOptions = []; - - /** - * The strategy for locking, see constants. - */ - private int $lockMode = self::LOCK_TRANSACTIONAL; - - /** - * It's an array to support multiple reads before closing which is manual, non-standard usage. - * - * @var \PDOStatement[] An array of statements to release advisory locks - */ - private array $unlockStatements = []; - - /** - * True when the current session exists but expired according to session.gc_maxlifetime. - */ - private bool $sessionExpired = false; - - /** - * Whether a transaction is active. - */ - private bool $inTransaction = false; - - /** - * Whether gc() has been called. - */ - private bool $gcCalled = false; - - /** - * You can either pass an existing database connection as PDO instance or - * pass a DSN string that will be used to lazy-connect to the database - * when the session is actually used. Furthermore it's possible to pass null - * which will then use the session.save_path ini setting as PDO DSN parameter. - * - * List of available options: - * * db_table: The name of the table [default: sessions] - * * db_id_col: The column where to store the session id [default: sess_id] - * * db_data_col: The column where to store the session data [default: sess_data] - * * db_lifetime_col: The column where to store the lifetime [default: sess_lifetime] - * * db_time_col: The column where to store the timestamp [default: sess_time] - * * db_username: The username when lazy-connect [default: ''] - * * db_password: The password when lazy-connect [default: ''] - * * db_connection_options: An array of driver-specific connection options [default: []] - * * lock_mode: The strategy for locking, see constants [default: LOCK_TRANSACTIONAL] - * * ttl: The time to live in seconds. - * - * @param \PDO|string|null $pdoOrDsn A \PDO instance or DSN string or URL string or null - * - * @throws \InvalidArgumentException When PDO error mode is not PDO::ERRMODE_EXCEPTION - */ - public function __construct(\PDO|string $pdoOrDsn = null, array $options = []) - { - if ($pdoOrDsn instanceof \PDO) { - if (\PDO::ERRMODE_EXCEPTION !== $pdoOrDsn->getAttribute(\PDO::ATTR_ERRMODE)) { - throw new \InvalidArgumentException(sprintf('"%s" requires PDO error mode attribute be set to throw Exceptions (i.e. $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION)).', __CLASS__)); - } - - $this->pdo = $pdoOrDsn; - $this->driver = $this->pdo->getAttribute(\PDO::ATTR_DRIVER_NAME); - } elseif (\is_string($pdoOrDsn) && str_contains($pdoOrDsn, '://')) { - $this->dsn = $this->buildDsnFromUrl($pdoOrDsn); - } else { - $this->dsn = $pdoOrDsn; - } - - $this->table = $options['db_table'] ?? $this->table; - $this->idCol = $options['db_id_col'] ?? $this->idCol; - $this->dataCol = $options['db_data_col'] ?? $this->dataCol; - $this->lifetimeCol = $options['db_lifetime_col'] ?? $this->lifetimeCol; - $this->timeCol = $options['db_time_col'] ?? $this->timeCol; - $this->username = $options['db_username'] ?? $this->username; - $this->password = $options['db_password'] ?? $this->password; - $this->connectionOptions = $options['db_connection_options'] ?? $this->connectionOptions; - $this->lockMode = $options['lock_mode'] ?? $this->lockMode; - $this->ttl = $options['ttl'] ?? null; - } - - /** - * Creates the table to store sessions which can be called once for setup. - * - * Session ID is saved in a column of maximum length 128 because that is enough even - * for a 512 bit configured session.hash_function like Whirlpool. Session data is - * saved in a BLOB. One could also use a shorter inlined varbinary column - * if one was sure the data fits into it. - * - * @throws \PDOException When the table already exists - * @throws \DomainException When an unsupported PDO driver is used - */ - public function createTable() - { - // connect if we are not yet - $this->getConnection(); - - $sql = match ($this->driver) { - // We use varbinary for the ID column because it prevents unwanted conversions: - // - character set conversions between server and client - // - trailing space removal - // - case-insensitivity - // - language processing like é == e - 'mysql' => "CREATE TABLE $this->table ($this->idCol VARBINARY(128) NOT NULL PRIMARY KEY, $this->dataCol BLOB NOT NULL, $this->lifetimeCol INTEGER UNSIGNED NOT NULL, $this->timeCol INTEGER UNSIGNED NOT NULL) COLLATE utf8mb4_bin, ENGINE = InnoDB", - 'sqlite' => "CREATE TABLE $this->table ($this->idCol TEXT NOT NULL PRIMARY KEY, $this->dataCol BLOB NOT NULL, $this->lifetimeCol INTEGER NOT NULL, $this->timeCol INTEGER NOT NULL)", - 'pgsql' => "CREATE TABLE $this->table ($this->idCol VARCHAR(128) NOT NULL PRIMARY KEY, $this->dataCol BYTEA NOT NULL, $this->lifetimeCol INTEGER NOT NULL, $this->timeCol INTEGER NOT NULL)", - 'oci' => "CREATE TABLE $this->table ($this->idCol VARCHAR2(128) NOT NULL PRIMARY KEY, $this->dataCol BLOB NOT NULL, $this->lifetimeCol INTEGER NOT NULL, $this->timeCol INTEGER NOT NULL)", - 'sqlsrv' => "CREATE TABLE $this->table ($this->idCol VARCHAR(128) NOT NULL PRIMARY KEY, $this->dataCol VARBINARY(MAX) NOT NULL, $this->lifetimeCol INTEGER NOT NULL, $this->timeCol INTEGER NOT NULL)", - default => throw new \DomainException(sprintf('Creating the session table is currently not implemented for PDO driver "%s".', $this->driver)), - }; - - try { - $this->pdo->exec($sql); - $this->pdo->exec("CREATE INDEX expiry ON $this->table ($this->lifetimeCol)"); - } catch (\PDOException $e) { - $this->rollback(); - - throw $e; - } - } - - /** - * Returns true when the current session exists but expired according to session.gc_maxlifetime. - * - * Can be used to distinguish between a new session and one that expired due to inactivity. - */ - public function isSessionExpired(): bool - { - return $this->sessionExpired; - } - - public function open(string $savePath, string $sessionName): bool - { - $this->sessionExpired = false; - - if (!isset($this->pdo)) { - $this->connect($this->dsn ?: $savePath); - } - - return parent::open($savePath, $sessionName); - } - - public function read(string $sessionId): string - { - try { - return parent::read($sessionId); - } catch (\PDOException $e) { - $this->rollback(); - - throw $e; - } - } - - public function gc(int $maxlifetime): int|false - { - // We delay gc() to close() so that it is executed outside the transactional and blocking read-write process. - // This way, pruning expired sessions does not block them from being started while the current session is used. - $this->gcCalled = true; - - return 0; - } - - protected function doDestroy(string $sessionId): bool - { - // delete the record associated with this id - $sql = "DELETE FROM $this->table WHERE $this->idCol = :id"; - - try { - $stmt = $this->pdo->prepare($sql); - $stmt->bindParam(':id', $sessionId, \PDO::PARAM_STR); - $stmt->execute(); - } catch (\PDOException $e) { - $this->rollback(); - - throw $e; - } - - return true; - } - - protected function doWrite(string $sessionId, string $data): bool - { - $maxlifetime = (int) (($this->ttl instanceof \Closure ? ($this->ttl)() : $this->ttl) ?? \ini_get('session.gc_maxlifetime')); - - try { - // We use a single MERGE SQL query when supported by the database. - $mergeStmt = $this->getMergeStatement($sessionId, $data, $maxlifetime); - if (null !== $mergeStmt) { - $mergeStmt->execute(); - - return true; - } - - $updateStmt = $this->getUpdateStatement($sessionId, $data, $maxlifetime); - $updateStmt->execute(); - - // When MERGE is not supported, like in Postgres < 9.5, we have to use this approach that can result in - // duplicate key errors when the same session is written simultaneously (given the LOCK_NONE behavior). - // We can just catch such an error and re-execute the update. This is similar to a serializable - // transaction with retry logic on serialization failures but without the overhead and without possible - // false positives due to longer gap locking. - if (!$updateStmt->rowCount()) { - try { - $insertStmt = $this->getInsertStatement($sessionId, $data, $maxlifetime); - $insertStmt->execute(); - } catch (\PDOException $e) { - // Handle integrity violation SQLSTATE 23000 (or a subclass like 23505 in Postgres) for duplicate keys - if (str_starts_with($e->getCode(), '23')) { - $updateStmt->execute(); - } else { - throw $e; - } - } - } - } catch (\PDOException $e) { - $this->rollback(); - - throw $e; - } - - return true; - } - - public function updateTimestamp(string $sessionId, string $data): bool - { - $expiry = time() + (int) (($this->ttl instanceof \Closure ? ($this->ttl)() : $this->ttl) ?? \ini_get('session.gc_maxlifetime')); - - try { - $updateStmt = $this->pdo->prepare( - "UPDATE $this->table SET $this->lifetimeCol = :expiry, $this->timeCol = :time WHERE $this->idCol = :id" - ); - $updateStmt->bindParam(':id', $sessionId, \PDO::PARAM_STR); - $updateStmt->bindParam(':expiry', $expiry, \PDO::PARAM_INT); - $updateStmt->bindValue(':time', time(), \PDO::PARAM_INT); - $updateStmt->execute(); - } catch (\PDOException $e) { - $this->rollback(); - - throw $e; - } - - return true; - } - - public function close(): bool - { - $this->commit(); - - while ($unlockStmt = array_shift($this->unlockStatements)) { - $unlockStmt->execute(); - } - - if ($this->gcCalled) { - $this->gcCalled = false; - - // delete the session records that have expired - $sql = "DELETE FROM $this->table WHERE $this->lifetimeCol < :time"; - $stmt = $this->pdo->prepare($sql); - $stmt->bindValue(':time', time(), \PDO::PARAM_INT); - $stmt->execute(); - } - - if (false !== $this->dsn) { - unset($this->pdo, $this->driver); // only close lazy-connection - } - - return true; - } - - /** - * Lazy-connects to the database. - */ - private function connect(string $dsn): void - { - $this->pdo = new \PDO($dsn, $this->username, $this->password, $this->connectionOptions); - $this->pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); - $this->driver = $this->pdo->getAttribute(\PDO::ATTR_DRIVER_NAME); - } - - /** - * Builds a PDO DSN from a URL-like connection string. - * - * @todo implement missing support for oci DSN (which look totally different from other PDO ones) - */ - private function buildDsnFromUrl(string $dsnOrUrl): string - { - // (pdo_)?sqlite3?:///... => (pdo_)?sqlite3?://localhost/... or else the URL will be invalid - $url = preg_replace('#^((?:pdo_)?sqlite3?):///#', '$1://localhost/', $dsnOrUrl); - - $params = parse_url($url); - - if (false === $params) { - return $dsnOrUrl; // If the URL is not valid, let's assume it might be a DSN already. - } - - $params = array_map('rawurldecode', $params); - - // Override the default username and password. Values passed through options will still win over these in the constructor. - if (isset($params['user'])) { - $this->username = $params['user']; - } - - if (isset($params['pass'])) { - $this->password = $params['pass']; - } - - if (!isset($params['scheme'])) { - throw new \InvalidArgumentException('URLs without scheme are not supported to configure the PdoSessionHandler.'); - } - - $driverAliasMap = [ - 'mssql' => 'sqlsrv', - 'mysql2' => 'mysql', // Amazon RDS, for some weird reason - 'postgres' => 'pgsql', - 'postgresql' => 'pgsql', - 'sqlite3' => 'sqlite', - ]; - - $driver = $driverAliasMap[$params['scheme']] ?? $params['scheme']; - - // Doctrine DBAL supports passing its internal pdo_* driver names directly too (allowing both dashes and underscores). This allows supporting the same here. - if (str_starts_with($driver, 'pdo_') || str_starts_with($driver, 'pdo-')) { - $driver = substr($driver, 4); - } - - $dsn = null; - switch ($driver) { - case 'mysql': - $dsn = 'mysql:'; - if ('' !== ($params['query'] ?? '')) { - $queryParams = []; - parse_str($params['query'], $queryParams); - if ('' !== ($queryParams['charset'] ?? '')) { - $dsn .= 'charset='.$queryParams['charset'].';'; - } - - if ('' !== ($queryParams['unix_socket'] ?? '')) { - $dsn .= 'unix_socket='.$queryParams['unix_socket'].';'; - - if (isset($params['path'])) { - $dbName = substr($params['path'], 1); // Remove the leading slash - $dsn .= 'dbname='.$dbName.';'; - } - - return $dsn; - } - } - // If "unix_socket" is not in the query, we continue with the same process as pgsql - // no break - case 'pgsql': - $dsn ??= 'pgsql:'; - - if (isset($params['host']) && '' !== $params['host']) { - $dsn .= 'host='.$params['host'].';'; - } - - if (isset($params['port']) && '' !== $params['port']) { - $dsn .= 'port='.$params['port'].';'; - } - - if (isset($params['path'])) { - $dbName = substr($params['path'], 1); // Remove the leading slash - $dsn .= 'dbname='.$dbName.';'; - } - - return $dsn; - - case 'sqlite': - return 'sqlite:'.substr($params['path'], 1); - - case 'sqlsrv': - $dsn = 'sqlsrv:server='; - - if (isset($params['host'])) { - $dsn .= $params['host']; - } - - if (isset($params['port']) && '' !== $params['port']) { - $dsn .= ','.$params['port']; - } - - if (isset($params['path'])) { - $dbName = substr($params['path'], 1); // Remove the leading slash - $dsn .= ';Database='.$dbName; - } - - return $dsn; - - default: - throw new \InvalidArgumentException(sprintf('The scheme "%s" is not supported by the PdoSessionHandler URL configuration. Pass a PDO DSN directly.', $params['scheme'])); - } - } - - /** - * Helper method to begin a transaction. - * - * Since SQLite does not support row level locks, we have to acquire a reserved lock - * on the database immediately. Because of https://bugs.php.net/42766 we have to create - * such a transaction manually which also means we cannot use PDO::commit or - * PDO::rollback or PDO::inTransaction for SQLite. - * - * Also MySQLs default isolation, REPEATABLE READ, causes deadlock for different sessions - * due to https://percona.com/blog/2013/12/12/one-more-innodb-gap-lock-to-avoid/ . - * So we change it to READ COMMITTED. - */ - private function beginTransaction(): void - { - if (!$this->inTransaction) { - if ('sqlite' === $this->driver) { - $this->pdo->exec('BEGIN IMMEDIATE TRANSACTION'); - } else { - if ('mysql' === $this->driver) { - $this->pdo->exec('SET TRANSACTION ISOLATION LEVEL READ COMMITTED'); - } - $this->pdo->beginTransaction(); - } - $this->inTransaction = true; - } - } - - /** - * Helper method to commit a transaction. - */ - private function commit(): void - { - if ($this->inTransaction) { - try { - // commit read-write transaction which also releases the lock - if ('sqlite' === $this->driver) { - $this->pdo->exec('COMMIT'); - } else { - $this->pdo->commit(); - } - $this->inTransaction = false; - } catch (\PDOException $e) { - $this->rollback(); - - throw $e; - } - } - } - - /** - * Helper method to rollback a transaction. - */ - private function rollback(): void - { - // We only need to rollback if we are in a transaction. Otherwise the resulting - // error would hide the real problem why rollback was called. We might not be - // in a transaction when not using the transactional locking behavior or when - // two callbacks (e.g. destroy and write) are invoked that both fail. - if ($this->inTransaction) { - if ('sqlite' === $this->driver) { - $this->pdo->exec('ROLLBACK'); - } else { - $this->pdo->rollBack(); - } - $this->inTransaction = false; - } - } - - /** - * Reads the session data in respect to the different locking strategies. - * - * We need to make sure we do not return session data that is already considered garbage according - * to the session.gc_maxlifetime setting because gc() is called after read() and only sometimes. - */ - protected function doRead(string $sessionId): string - { - if (self::LOCK_ADVISORY === $this->lockMode) { - $this->unlockStatements[] = $this->doAdvisoryLock($sessionId); - } - - $selectSql = $this->getSelectSql(); - $selectStmt = $this->pdo->prepare($selectSql); - $selectStmt->bindParam(':id', $sessionId, \PDO::PARAM_STR); - $insertStmt = null; - - while (true) { - $selectStmt->execute(); - $sessionRows = $selectStmt->fetchAll(\PDO::FETCH_NUM); - - if ($sessionRows) { - $expiry = (int) $sessionRows[0][1]; - - if ($expiry < time()) { - $this->sessionExpired = true; - - return ''; - } - - return \is_resource($sessionRows[0][0]) ? stream_get_contents($sessionRows[0][0]) : $sessionRows[0][0]; - } - - if (null !== $insertStmt) { - $this->rollback(); - throw new \RuntimeException('Failed to read session: INSERT reported a duplicate id but next SELECT did not return any data.'); - } - - if (!filter_var(\ini_get('session.use_strict_mode'), \FILTER_VALIDATE_BOOL) && self::LOCK_TRANSACTIONAL === $this->lockMode && 'sqlite' !== $this->driver) { - // In strict mode, session fixation is not possible: new sessions always start with a unique - // random id, so that concurrency is not possible and this code path can be skipped. - // Exclusive-reading of non-existent rows does not block, so we need to do an insert to block - // until other connections to the session are committed. - try { - $insertStmt = $this->getInsertStatement($sessionId, '', 0); - $insertStmt->execute(); - } catch (\PDOException $e) { - // Catch duplicate key error because other connection created the session already. - // It would only not be the case when the other connection destroyed the session. - if (str_starts_with($e->getCode(), '23')) { - // Retrieve finished session data written by concurrent connection by restarting the loop. - // We have to start a new transaction as a failed query will mark the current transaction as - // aborted in PostgreSQL and disallow further queries within it. - $this->rollback(); - $this->beginTransaction(); - continue; - } - - throw $e; - } - } - - return ''; - } - } - - /** - * Executes an application-level lock on the database. - * - * @return \PDOStatement The statement that needs to be executed later to release the lock - * - * @throws \DomainException When an unsupported PDO driver is used - * - * @todo implement missing advisory locks - * - for oci using DBMS_LOCK.REQUEST - * - for sqlsrv using sp_getapplock with LockOwner = Session - */ - private function doAdvisoryLock(string $sessionId): \PDOStatement - { - switch ($this->driver) { - case 'mysql': - // MySQL 5.7.5 and later enforces a maximum length on lock names of 64 characters. Previously, no limit was enforced. - $lockId = substr($sessionId, 0, 64); - // should we handle the return value? 0 on timeout, null on error - // we use a timeout of 50 seconds which is also the default for innodb_lock_wait_timeout - $stmt = $this->pdo->prepare('SELECT GET_LOCK(:key, 50)'); - $stmt->bindValue(':key', $lockId, \PDO::PARAM_STR); - $stmt->execute(); - - $releaseStmt = $this->pdo->prepare('DO RELEASE_LOCK(:key)'); - $releaseStmt->bindValue(':key', $lockId, \PDO::PARAM_STR); - - return $releaseStmt; - case 'pgsql': - // Obtaining an exclusive session level advisory lock requires an integer key. - // When session.sid_bits_per_character > 4, the session id can contain non-hex-characters. - // So we cannot just use hexdec(). - if (4 === \PHP_INT_SIZE) { - $sessionInt1 = $this->convertStringToInt($sessionId); - $sessionInt2 = $this->convertStringToInt(substr($sessionId, 4, 4)); - - $stmt = $this->pdo->prepare('SELECT pg_advisory_lock(:key1, :key2)'); - $stmt->bindValue(':key1', $sessionInt1, \PDO::PARAM_INT); - $stmt->bindValue(':key2', $sessionInt2, \PDO::PARAM_INT); - $stmt->execute(); - - $releaseStmt = $this->pdo->prepare('SELECT pg_advisory_unlock(:key1, :key2)'); - $releaseStmt->bindValue(':key1', $sessionInt1, \PDO::PARAM_INT); - $releaseStmt->bindValue(':key2', $sessionInt2, \PDO::PARAM_INT); - } else { - $sessionBigInt = $this->convertStringToInt($sessionId); - - $stmt = $this->pdo->prepare('SELECT pg_advisory_lock(:key)'); - $stmt->bindValue(':key', $sessionBigInt, \PDO::PARAM_INT); - $stmt->execute(); - - $releaseStmt = $this->pdo->prepare('SELECT pg_advisory_unlock(:key)'); - $releaseStmt->bindValue(':key', $sessionBigInt, \PDO::PARAM_INT); - } - - return $releaseStmt; - case 'sqlite': - throw new \DomainException('SQLite does not support advisory locks.'); - default: - throw new \DomainException(sprintf('Advisory locks are currently not implemented for PDO driver "%s".', $this->driver)); - } - } - - /** - * Encodes the first 4 (when PHP_INT_SIZE == 4) or 8 characters of the string as an integer. - * - * Keep in mind, PHP integers are signed. - */ - private function convertStringToInt(string $string): int - { - if (4 === \PHP_INT_SIZE) { - return (\ord($string[3]) << 24) + (\ord($string[2]) << 16) + (\ord($string[1]) << 8) + \ord($string[0]); - } - - $int1 = (\ord($string[7]) << 24) + (\ord($string[6]) << 16) + (\ord($string[5]) << 8) + \ord($string[4]); - $int2 = (\ord($string[3]) << 24) + (\ord($string[2]) << 16) + (\ord($string[1]) << 8) + \ord($string[0]); - - return $int2 + ($int1 << 32); - } - - /** - * Return a locking or nonlocking SQL query to read session information. - * - * @throws \DomainException When an unsupported PDO driver is used - */ - private function getSelectSql(): string - { - if (self::LOCK_TRANSACTIONAL === $this->lockMode) { - $this->beginTransaction(); - - switch ($this->driver) { - case 'mysql': - case 'oci': - case 'pgsql': - return "SELECT $this->dataCol, $this->lifetimeCol FROM $this->table WHERE $this->idCol = :id FOR UPDATE"; - case 'sqlsrv': - return "SELECT $this->dataCol, $this->lifetimeCol FROM $this->table WITH (UPDLOCK, ROWLOCK) WHERE $this->idCol = :id"; - case 'sqlite': - // we already locked when starting transaction - break; - default: - throw new \DomainException(sprintf('Transactional locks are currently not implemented for PDO driver "%s".', $this->driver)); - } - } - - return "SELECT $this->dataCol, $this->lifetimeCol FROM $this->table WHERE $this->idCol = :id"; - } - - /** - * Returns an insert statement supported by the database for writing session data. - */ - private function getInsertStatement(string $sessionId, string $sessionData, int $maxlifetime): \PDOStatement - { - switch ($this->driver) { - case 'oci': - $data = fopen('php://memory', 'r+'); - fwrite($data, $sessionData); - rewind($data); - $sql = "INSERT INTO $this->table ($this->idCol, $this->dataCol, $this->lifetimeCol, $this->timeCol) VALUES (:id, EMPTY_BLOB(), :expiry, :time) RETURNING $this->dataCol into :data"; - break; - default: - $data = $sessionData; - $sql = "INSERT INTO $this->table ($this->idCol, $this->dataCol, $this->lifetimeCol, $this->timeCol) VALUES (:id, :data, :expiry, :time)"; - break; - } - - $stmt = $this->pdo->prepare($sql); - $stmt->bindParam(':id', $sessionId, \PDO::PARAM_STR); - $stmt->bindParam(':data', $data, \PDO::PARAM_LOB); - $stmt->bindValue(':expiry', time() + $maxlifetime, \PDO::PARAM_INT); - $stmt->bindValue(':time', time(), \PDO::PARAM_INT); - - return $stmt; - } - - /** - * Returns an update statement supported by the database for writing session data. - */ - private function getUpdateStatement(string $sessionId, string $sessionData, int $maxlifetime): \PDOStatement - { - switch ($this->driver) { - case 'oci': - $data = fopen('php://memory', 'r+'); - fwrite($data, $sessionData); - rewind($data); - $sql = "UPDATE $this->table SET $this->dataCol = EMPTY_BLOB(), $this->lifetimeCol = :expiry, $this->timeCol = :time WHERE $this->idCol = :id RETURNING $this->dataCol into :data"; - break; - default: - $data = $sessionData; - $sql = "UPDATE $this->table SET $this->dataCol = :data, $this->lifetimeCol = :expiry, $this->timeCol = :time WHERE $this->idCol = :id"; - break; - } - - $stmt = $this->pdo->prepare($sql); - $stmt->bindParam(':id', $sessionId, \PDO::PARAM_STR); - $stmt->bindParam(':data', $data, \PDO::PARAM_LOB); - $stmt->bindValue(':expiry', time() + $maxlifetime, \PDO::PARAM_INT); - $stmt->bindValue(':time', time(), \PDO::PARAM_INT); - - return $stmt; - } - - /** - * Returns a merge/upsert (i.e. insert or update) statement when supported by the database for writing session data. - */ - private function getMergeStatement(string $sessionId, string $data, int $maxlifetime): ?\PDOStatement - { - switch (true) { - case 'mysql' === $this->driver: - $mergeSql = "INSERT INTO $this->table ($this->idCol, $this->dataCol, $this->lifetimeCol, $this->timeCol) VALUES (:id, :data, :expiry, :time) ". - "ON DUPLICATE KEY UPDATE $this->dataCol = VALUES($this->dataCol), $this->lifetimeCol = VALUES($this->lifetimeCol), $this->timeCol = VALUES($this->timeCol)"; - break; - case 'sqlsrv' === $this->driver && version_compare($this->pdo->getAttribute(\PDO::ATTR_SERVER_VERSION), '10', '>='): - // MERGE is only available since SQL Server 2008 and must be terminated by semicolon - // It also requires HOLDLOCK according to https://weblogs.sqlteam.com/dang/2009/01/31/upsert-race-condition-with-merge/ - $mergeSql = "MERGE INTO $this->table WITH (HOLDLOCK) USING (SELECT 1 AS dummy) AS src ON ($this->idCol = ?) ". - "WHEN NOT MATCHED THEN INSERT ($this->idCol, $this->dataCol, $this->lifetimeCol, $this->timeCol) VALUES (?, ?, ?, ?) ". - "WHEN MATCHED THEN UPDATE SET $this->dataCol = ?, $this->lifetimeCol = ?, $this->timeCol = ?;"; - break; - case 'sqlite' === $this->driver: - $mergeSql = "INSERT OR REPLACE INTO $this->table ($this->idCol, $this->dataCol, $this->lifetimeCol, $this->timeCol) VALUES (:id, :data, :expiry, :time)"; - break; - case 'pgsql' === $this->driver && version_compare($this->pdo->getAttribute(\PDO::ATTR_SERVER_VERSION), '9.5', '>='): - $mergeSql = "INSERT INTO $this->table ($this->idCol, $this->dataCol, $this->lifetimeCol, $this->timeCol) VALUES (:id, :data, :expiry, :time) ". - "ON CONFLICT ($this->idCol) DO UPDATE SET ($this->dataCol, $this->lifetimeCol, $this->timeCol) = (EXCLUDED.$this->dataCol, EXCLUDED.$this->lifetimeCol, EXCLUDED.$this->timeCol)"; - break; - default: - // MERGE is not supported with LOBs: https://oracle.com/technetwork/articles/fuecks-lobs-095315.html - return null; - } - - $mergeStmt = $this->pdo->prepare($mergeSql); - - if ('sqlsrv' === $this->driver) { - $mergeStmt->bindParam(1, $sessionId, \PDO::PARAM_STR); - $mergeStmt->bindParam(2, $sessionId, \PDO::PARAM_STR); - $mergeStmt->bindParam(3, $data, \PDO::PARAM_LOB); - $mergeStmt->bindValue(4, time() + $maxlifetime, \PDO::PARAM_INT); - $mergeStmt->bindValue(5, time(), \PDO::PARAM_INT); - $mergeStmt->bindParam(6, $data, \PDO::PARAM_LOB); - $mergeStmt->bindValue(7, time() + $maxlifetime, \PDO::PARAM_INT); - $mergeStmt->bindValue(8, time(), \PDO::PARAM_INT); - } else { - $mergeStmt->bindParam(':id', $sessionId, \PDO::PARAM_STR); - $mergeStmt->bindParam(':data', $data, \PDO::PARAM_LOB); - $mergeStmt->bindValue(':expiry', time() + $maxlifetime, \PDO::PARAM_INT); - $mergeStmt->bindValue(':time', time(), \PDO::PARAM_INT); - } - - return $mergeStmt; - } - - /** - * Return a PDO instance. - */ - protected function getConnection(): \PDO - { - if (!isset($this->pdo)) { - $this->connect($this->dsn ?: \ini_get('session.save_path')); - } - - return $this->pdo; - } -} diff --git a/vendor/symfony/http-foundation/Session/Storage/Handler/RedisSessionHandler.php b/vendor/symfony/http-foundation/Session/Storage/Handler/RedisSessionHandler.php deleted file mode 100644 index 38f48864..00000000 --- a/vendor/symfony/http-foundation/Session/Storage/Handler/RedisSessionHandler.php +++ /dev/null @@ -1,102 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; - -use Predis\Response\ErrorInterface; - -/** - * Redis based session storage handler based on the Redis class - * provided by the PHP redis extension. - * - * @author Dalibor Karlović - */ -class RedisSessionHandler extends AbstractSessionHandler -{ - /** - * Key prefix for shared environments. - */ - private string $prefix; - - /** - * Time to live in seconds. - */ - private int|\Closure|null $ttl; - - /** - * List of available options: - * * prefix: The prefix to use for the keys in order to avoid collision on the Redis server - * * ttl: The time to live in seconds. - * - * @throws \InvalidArgumentException When unsupported client or options are passed - */ - public function __construct( - private \Redis|\RedisArray|\RedisCluster|\Predis\ClientInterface $redis, - array $options = [], - ) { - if ($diff = array_diff(array_keys($options), ['prefix', 'ttl'])) { - throw new \InvalidArgumentException(sprintf('The following options are not supported "%s".', implode(', ', $diff))); - } - - $this->prefix = $options['prefix'] ?? 'sf_s'; - $this->ttl = $options['ttl'] ?? null; - } - - protected function doRead(string $sessionId): string - { - return $this->redis->get($this->prefix.$sessionId) ?: ''; - } - - protected function doWrite(string $sessionId, string $data): bool - { - $ttl = ($this->ttl instanceof \Closure ? ($this->ttl)() : $this->ttl) ?? \ini_get('session.gc_maxlifetime'); - $result = $this->redis->setEx($this->prefix.$sessionId, (int) $ttl, $data); - - return $result && !$result instanceof ErrorInterface; - } - - protected function doDestroy(string $sessionId): bool - { - static $unlink = true; - - if ($unlink) { - try { - $unlink = false !== $this->redis->unlink($this->prefix.$sessionId); - } catch (\Throwable) { - $unlink = false; - } - } - - if (!$unlink) { - $this->redis->del($this->prefix.$sessionId); - } - - return true; - } - - #[\ReturnTypeWillChange] - public function close(): bool - { - return true; - } - - public function gc(int $maxlifetime): int|false - { - return 0; - } - - public function updateTimestamp(string $sessionId, string $data): bool - { - $ttl = ($this->ttl instanceof \Closure ? ($this->ttl)() : $this->ttl) ?? \ini_get('session.gc_maxlifetime'); - - return $this->redis->expire($this->prefix.$sessionId, (int) $ttl); - } -} diff --git a/vendor/symfony/http-foundation/Session/Storage/Handler/SessionHandlerFactory.php b/vendor/symfony/http-foundation/Session/Storage/Handler/SessionHandlerFactory.php deleted file mode 100644 index e390c8fe..00000000 --- a/vendor/symfony/http-foundation/Session/Storage/Handler/SessionHandlerFactory.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; - -use Doctrine\DBAL\DriverManager; -use Symfony\Component\Cache\Adapter\AbstractAdapter; - -/** - * @author Nicolas Grekas - */ -class SessionHandlerFactory -{ - public static function createHandler(object|string $connection, array $options = []): AbstractSessionHandler - { - if ($query = \is_string($connection) ? parse_url($connection) : false) { - parse_str($query['query'] ?? '', $query); - - if (($options['ttl'] ?? null) instanceof \Closure) { - $query['ttl'] = $options['ttl']; - } - } - $options = ($query ?: []) + $options; - - switch (true) { - case $connection instanceof \Redis: - case $connection instanceof \RedisArray: - case $connection instanceof \RedisCluster: - case $connection instanceof \Predis\ClientInterface: - return new RedisSessionHandler($connection); - - case $connection instanceof \Memcached: - return new MemcachedSessionHandler($connection); - - case $connection instanceof \PDO: - return new PdoSessionHandler($connection); - - case !\is_string($connection): - throw new \InvalidArgumentException(sprintf('Unsupported Connection: "%s".', get_debug_type($connection))); - case str_starts_with($connection, 'file://'): - $savePath = substr($connection, 7); - - return new StrictSessionHandler(new NativeFileSessionHandler('' === $savePath ? null : $savePath)); - - case str_starts_with($connection, 'redis:'): - case str_starts_with($connection, 'rediss:'): - case str_starts_with($connection, 'memcached:'): - if (!class_exists(AbstractAdapter::class)) { - throw new \InvalidArgumentException(sprintf('Unsupported DSN "%s". Try running "composer require symfony/cache".', $connection)); - } - $handlerClass = str_starts_with($connection, 'memcached:') ? MemcachedSessionHandler::class : RedisSessionHandler::class; - $connection = AbstractAdapter::createConnection($connection, ['lazy' => true]); - - return new $handlerClass($connection, array_intersect_key($options, ['prefix' => 1, 'ttl' => 1])); - - case str_starts_with($connection, 'pdo_oci://'): - if (!class_exists(DriverManager::class)) { - throw new \InvalidArgumentException(sprintf('Unsupported DSN "%s". Try running "composer require doctrine/dbal".', $connection)); - } - $connection = DriverManager::getConnection(['url' => $connection])->getWrappedConnection(); - // no break; - - case str_starts_with($connection, 'mssql://'): - case str_starts_with($connection, 'mysql://'): - case str_starts_with($connection, 'mysql2://'): - case str_starts_with($connection, 'pgsql://'): - case str_starts_with($connection, 'postgres://'): - case str_starts_with($connection, 'postgresql://'): - case str_starts_with($connection, 'sqlsrv://'): - case str_starts_with($connection, 'sqlite://'): - case str_starts_with($connection, 'sqlite3://'): - return new PdoSessionHandler($connection, $options); - } - - throw new \InvalidArgumentException(sprintf('Unsupported Connection: "%s".', $connection)); - } -} diff --git a/vendor/symfony/http-foundation/Session/Storage/Handler/StrictSessionHandler.php b/vendor/symfony/http-foundation/Session/Storage/Handler/StrictSessionHandler.php deleted file mode 100644 index 1a163648..00000000 --- a/vendor/symfony/http-foundation/Session/Storage/Handler/StrictSessionHandler.php +++ /dev/null @@ -1,89 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; - -/** - * Adds basic `SessionUpdateTimestampHandlerInterface` behaviors to another `SessionHandlerInterface`. - * - * @author Nicolas Grekas - */ -class StrictSessionHandler extends AbstractSessionHandler -{ - private \SessionHandlerInterface $handler; - private bool $doDestroy; - - public function __construct(\SessionHandlerInterface $handler) - { - if ($handler instanceof \SessionUpdateTimestampHandlerInterface) { - throw new \LogicException(sprintf('"%s" is already an instance of "SessionUpdateTimestampHandlerInterface", you cannot wrap it with "%s".', get_debug_type($handler), self::class)); - } - - $this->handler = $handler; - } - - /** - * Returns true if this handler wraps an internal PHP session save handler using \SessionHandler. - * - * @internal - */ - public function isWrapper(): bool - { - return $this->handler instanceof \SessionHandler; - } - - public function open(string $savePath, string $sessionName): bool - { - parent::open($savePath, $sessionName); - - return $this->handler->open($savePath, $sessionName); - } - - protected function doRead(string $sessionId): string - { - return $this->handler->read($sessionId); - } - - public function updateTimestamp(string $sessionId, string $data): bool - { - return $this->write($sessionId, $data); - } - - protected function doWrite(string $sessionId, string $data): bool - { - return $this->handler->write($sessionId, $data); - } - - public function destroy(string $sessionId): bool - { - $this->doDestroy = true; - $destroyed = parent::destroy($sessionId); - - return $this->doDestroy ? $this->doDestroy($sessionId) : $destroyed; - } - - protected function doDestroy(string $sessionId): bool - { - $this->doDestroy = false; - - return $this->handler->destroy($sessionId); - } - - public function close(): bool - { - return $this->handler->close(); - } - - public function gc(int $maxlifetime): int|false - { - return $this->handler->gc($maxlifetime); - } -} diff --git a/vendor/symfony/http-foundation/Session/Storage/MetadataBag.php b/vendor/symfony/http-foundation/Session/Storage/MetadataBag.php deleted file mode 100644 index f2be617c..00000000 --- a/vendor/symfony/http-foundation/Session/Storage/MetadataBag.php +++ /dev/null @@ -1,141 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Session\Storage; - -use Symfony\Component\HttpFoundation\Session\SessionBagInterface; - -/** - * Metadata container. - * - * Adds metadata to the session. - * - * @author Drak - */ -class MetadataBag implements SessionBagInterface -{ - public const CREATED = 'c'; - public const UPDATED = 'u'; - public const LIFETIME = 'l'; - - private string $name = '__metadata'; - private string $storageKey; - - /** - * @var array - */ - protected $meta = [self::CREATED => 0, self::UPDATED => 0, self::LIFETIME => 0]; - - /** - * Unix timestamp. - */ - private int $lastUsed; - - private int $updateThreshold; - - /** - * @param string $storageKey The key used to store bag in the session - * @param int $updateThreshold The time to wait between two UPDATED updates - */ - public function __construct(string $storageKey = '_sf2_meta', int $updateThreshold = 0) - { - $this->storageKey = $storageKey; - $this->updateThreshold = $updateThreshold; - } - - public function initialize(array &$array) - { - $this->meta = &$array; - - if (isset($array[self::CREATED])) { - $this->lastUsed = $this->meta[self::UPDATED]; - - $timeStamp = time(); - if ($timeStamp - $array[self::UPDATED] >= $this->updateThreshold) { - $this->meta[self::UPDATED] = $timeStamp; - } - } else { - $this->stampCreated(); - } - } - - /** - * Gets the lifetime that the session cookie was set with. - */ - public function getLifetime(): int - { - return $this->meta[self::LIFETIME]; - } - - /** - * Stamps a new session's metadata. - * - * @param int $lifetime Sets the cookie lifetime for the session cookie. A null value - * will leave the system settings unchanged, 0 sets the cookie - * to expire with browser session. Time is in seconds, and is - * not a Unix timestamp. - */ - public function stampNew(int $lifetime = null) - { - $this->stampCreated($lifetime); - } - - public function getStorageKey(): string - { - return $this->storageKey; - } - - /** - * Gets the created timestamp metadata. - * - * @return int Unix timestamp - */ - public function getCreated(): int - { - return $this->meta[self::CREATED]; - } - - /** - * Gets the last used metadata. - * - * @return int Unix timestamp - */ - public function getLastUsed(): int - { - return $this->lastUsed; - } - - public function clear(): mixed - { - // nothing to do - return null; - } - - public function getName(): string - { - return $this->name; - } - - /** - * Sets name. - */ - public function setName(string $name) - { - $this->name = $name; - } - - private function stampCreated(int $lifetime = null): void - { - $timeStamp = time(); - $this->meta[self::CREATED] = $this->meta[self::UPDATED] = $this->lastUsed = $timeStamp; - $this->meta[self::LIFETIME] = $lifetime ?? (int) \ini_get('session.cookie_lifetime'); - } -} diff --git a/vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php b/vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php deleted file mode 100644 index 67fa0f95..00000000 --- a/vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php +++ /dev/null @@ -1,214 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Session\Storage; - -use Symfony\Component\HttpFoundation\Session\SessionBagInterface; - -/** - * MockArraySessionStorage mocks the session for unit tests. - * - * No PHP session is actually started since a session can be initialized - * and shutdown only once per PHP execution cycle. - * - * When doing functional testing, you should use MockFileSessionStorage instead. - * - * @author Fabien Potencier - * @author Bulat Shakirzyanov - * @author Drak - */ -class MockArraySessionStorage implements SessionStorageInterface -{ - /** - * @var string - */ - protected $id = ''; - - /** - * @var string - */ - protected $name; - - /** - * @var bool - */ - protected $started = false; - - /** - * @var bool - */ - protected $closed = false; - - /** - * @var array - */ - protected $data = []; - - /** - * @var MetadataBag - */ - protected $metadataBag; - - /** - * @var array|SessionBagInterface[] - */ - protected $bags = []; - - public function __construct(string $name = 'MOCKSESSID', MetadataBag $metaBag = null) - { - $this->name = $name; - $this->setMetadataBag($metaBag); - } - - public function setSessionData(array $array) - { - $this->data = $array; - } - - public function start(): bool - { - if ($this->started) { - return true; - } - - if (empty($this->id)) { - $this->id = $this->generateId(); - } - - $this->loadSession(); - - return true; - } - - public function regenerate(bool $destroy = false, int $lifetime = null): bool - { - if (!$this->started) { - $this->start(); - } - - $this->metadataBag->stampNew($lifetime); - $this->id = $this->generateId(); - - return true; - } - - public function getId(): string - { - return $this->id; - } - - public function setId(string $id) - { - if ($this->started) { - throw new \LogicException('Cannot set session ID after the session has started.'); - } - - $this->id = $id; - } - - public function getName(): string - { - return $this->name; - } - - public function setName(string $name) - { - $this->name = $name; - } - - public function save() - { - if (!$this->started || $this->closed) { - throw new \RuntimeException('Trying to save a session that was not started yet or was already closed.'); - } - // nothing to do since we don't persist the session data - $this->closed = false; - $this->started = false; - } - - public function clear() - { - // clear out the bags - foreach ($this->bags as $bag) { - $bag->clear(); - } - - // clear out the session - $this->data = []; - - // reconnect the bags to the session - $this->loadSession(); - } - - public function registerBag(SessionBagInterface $bag) - { - $this->bags[$bag->getName()] = $bag; - } - - public function getBag(string $name): SessionBagInterface - { - if (!isset($this->bags[$name])) { - throw new \InvalidArgumentException(sprintf('The SessionBagInterface "%s" is not registered.', $name)); - } - - if (!$this->started) { - $this->start(); - } - - return $this->bags[$name]; - } - - public function isStarted(): bool - { - return $this->started; - } - - public function setMetadataBag(MetadataBag $bag = null) - { - if (1 > \func_num_args()) { - trigger_deprecation('symfony/http-foundation', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); - } - $this->metadataBag = $bag ?? new MetadataBag(); - } - - /** - * Gets the MetadataBag. - */ - public function getMetadataBag(): MetadataBag - { - return $this->metadataBag; - } - - /** - * Generates a session ID. - * - * This doesn't need to be particularly cryptographically secure since this is just - * a mock. - */ - protected function generateId(): string - { - return hash('sha256', uniqid('ss_mock_', true)); - } - - protected function loadSession() - { - $bags = array_merge($this->bags, [$this->metadataBag]); - - foreach ($bags as $bag) { - $key = $bag->getStorageKey(); - $this->data[$key] ??= []; - $bag->initialize($this->data[$key]); - } - - $this->started = true; - $this->closed = false; - } -} diff --git a/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorage.php b/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorage.php deleted file mode 100644 index 28771ad5..00000000 --- a/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorage.php +++ /dev/null @@ -1,149 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Session\Storage; - -/** - * MockFileSessionStorage is used to mock sessions for - * functional testing where you may need to persist session data - * across separate PHP processes. - * - * No PHP session is actually started since a session can be initialized - * and shutdown only once per PHP execution cycle and this class does - * not pollute any session related globals, including session_*() functions - * or session.* PHP ini directives. - * - * @author Drak - */ -class MockFileSessionStorage extends MockArraySessionStorage -{ - private string $savePath; - - /** - * @param string|null $savePath Path of directory to save session files - */ - public function __construct(string $savePath = null, string $name = 'MOCKSESSID', MetadataBag $metaBag = null) - { - $savePath ??= sys_get_temp_dir(); - - if (!is_dir($savePath) && !@mkdir($savePath, 0777, true) && !is_dir($savePath)) { - throw new \RuntimeException(sprintf('Session Storage was not able to create directory "%s".', $savePath)); - } - - $this->savePath = $savePath; - - parent::__construct($name, $metaBag); - } - - public function start(): bool - { - if ($this->started) { - return true; - } - - if (!$this->id) { - $this->id = $this->generateId(); - } - - $this->read(); - - $this->started = true; - - return true; - } - - public function regenerate(bool $destroy = false, int $lifetime = null): bool - { - if (!$this->started) { - $this->start(); - } - - if ($destroy) { - $this->destroy(); - } - - return parent::regenerate($destroy, $lifetime); - } - - public function save() - { - if (!$this->started) { - throw new \RuntimeException('Trying to save a session that was not started yet or was already closed.'); - } - - $data = $this->data; - - foreach ($this->bags as $bag) { - if (empty($data[$key = $bag->getStorageKey()])) { - unset($data[$key]); - } - } - if ([$key = $this->metadataBag->getStorageKey()] === array_keys($data)) { - unset($data[$key]); - } - - try { - if ($data) { - $path = $this->getFilePath(); - $tmp = $path.bin2hex(random_bytes(6)); - file_put_contents($tmp, serialize($data)); - rename($tmp, $path); - } else { - $this->destroy(); - } - } finally { - $this->data = $data; - } - - // this is needed when the session object is re-used across multiple requests - // in functional tests. - $this->started = false; - } - - /** - * Deletes a session from persistent storage. - * Deliberately leaves session data in memory intact. - */ - private function destroy(): void - { - set_error_handler(static function () {}); - try { - unlink($this->getFilePath()); - } finally { - restore_error_handler(); - } - } - - /** - * Calculate path to file. - */ - private function getFilePath(): string - { - return $this->savePath.'/'.$this->id.'.mocksess'; - } - - /** - * Reads session from storage and loads session. - */ - private function read(): void - { - set_error_handler(static function () {}); - try { - $data = file_get_contents($this->getFilePath()); - } finally { - restore_error_handler(); - } - - $this->data = $data ? unserialize($data) : []; - - $this->loadSession(); - } -} diff --git a/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorageFactory.php b/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorageFactory.php deleted file mode 100644 index 8ecf943d..00000000 --- a/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorageFactory.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. - */ - -namespace Symfony\Component\HttpFoundation\Session\Storage; - -use Symfony\Component\HttpFoundation\Request; - -// Help opcache.preload discover always-needed symbols -class_exists(MockFileSessionStorage::class); - -/** - * @author Jérémy Derussé - */ -class MockFileSessionStorageFactory implements SessionStorageFactoryInterface -{ - private ?string $savePath; - private string $name; - private ?MetadataBag $metaBag; - - /** - * @see MockFileSessionStorage constructor. - */ - public function __construct(string $savePath = null, string $name = 'MOCKSESSID', MetadataBag $metaBag = null) - { - $this->savePath = $savePath; - $this->name = $name; - $this->metaBag = $metaBag; - } - - public function createStorage(?Request $request): SessionStorageInterface - { - return new MockFileSessionStorage($this->savePath, $this->name, $this->metaBag); - } -} diff --git a/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php b/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php deleted file mode 100644 index 834a5ebd..00000000 --- a/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php +++ /dev/null @@ -1,426 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Session\Storage; - -use Symfony\Component\HttpFoundation\Session\SessionBagInterface; -use Symfony\Component\HttpFoundation\Session\Storage\Handler\StrictSessionHandler; -use Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy; -use Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy; - -// Help opcache.preload discover always-needed symbols -class_exists(MetadataBag::class); -class_exists(StrictSessionHandler::class); -class_exists(SessionHandlerProxy::class); - -/** - * This provides a base class for session attribute storage. - * - * @author Drak - */ -class NativeSessionStorage implements SessionStorageInterface -{ - /** - * @var SessionBagInterface[] - */ - protected $bags = []; - - /** - * @var bool - */ - protected $started = false; - - /** - * @var bool - */ - protected $closed = false; - - /** - * @var AbstractProxy|\SessionHandlerInterface - */ - protected $saveHandler; - - /** - * @var MetadataBag - */ - protected $metadataBag; - - /** - * Depending on how you want the storage driver to behave you probably - * want to override this constructor entirely. - * - * List of options for $options array with their defaults. - * - * @see https://php.net/session.configuration for options - * but we omit 'session.' from the beginning of the keys for convenience. - * - * ("auto_start", is not supported as it tells PHP to start a session before - * PHP starts to execute user-land code. Setting during runtime has no effect). - * - * cache_limiter, "" (use "0" to prevent headers from being sent entirely). - * cache_expire, "0" - * cookie_domain, "" - * cookie_httponly, "" - * cookie_lifetime, "0" - * cookie_path, "/" - * cookie_secure, "" - * cookie_samesite, null - * gc_divisor, "100" - * gc_maxlifetime, "1440" - * gc_probability, "1" - * lazy_write, "1" - * name, "PHPSESSID" - * referer_check, "" - * serialize_handler, "php" - * use_strict_mode, "1" - * use_cookies, "1" - * use_only_cookies, "1" - * use_trans_sid, "0" - * sid_length, "32" - * sid_bits_per_character, "5" - * trans_sid_hosts, $_SERVER['HTTP_HOST'] - * trans_sid_tags, "a=href,area=href,frame=src,form=" - */ - public function __construct(array $options = [], AbstractProxy|\SessionHandlerInterface $handler = null, MetadataBag $metaBag = null) - { - if (!\extension_loaded('session')) { - throw new \LogicException('PHP extension "session" is required.'); - } - - $options += [ - 'cache_limiter' => '', - 'cache_expire' => 0, - 'use_cookies' => 1, - 'lazy_write' => 1, - 'use_strict_mode' => 1, - ]; - - session_register_shutdown(); - - $this->setMetadataBag($metaBag); - $this->setOptions($options); - $this->setSaveHandler($handler); - } - - /** - * Gets the save handler instance. - */ - public function getSaveHandler(): AbstractProxy|\SessionHandlerInterface - { - return $this->saveHandler; - } - - public function start(): bool - { - if ($this->started) { - return true; - } - - if (\PHP_SESSION_ACTIVE === session_status()) { - throw new \RuntimeException('Failed to start the session: already started by PHP.'); - } - - if (filter_var(\ini_get('session.use_cookies'), \FILTER_VALIDATE_BOOL) && headers_sent($file, $line)) { - throw new \RuntimeException(sprintf('Failed to start the session because headers have already been sent by "%s" at line %d.', $file, $line)); - } - - $sessionId = $_COOKIE[session_name()] ?? null; - /* - * Explanation of the session ID regular expression: `/^[a-zA-Z0-9,-]{22,250}$/`. - * - * ---------- Part 1 - * - * The part `[a-zA-Z0-9,-]` is related to the PHP ini directive `session.sid_bits_per_character` defined as 6. - * See https://www.php.net/manual/en/session.configuration.php#ini.session.sid-bits-per-character. - * Allowed values are integers such as: - * - 4 for range `a-f0-9` - * - 5 for range `a-v0-9` - * - 6 for range `a-zA-Z0-9,-` - * - * ---------- Part 2 - * - * The part `{22,250}` is related to the PHP ini directive `session.sid_length`. - * See https://www.php.net/manual/en/session.configuration.php#ini.session.sid-length. - * Allowed values are integers between 22 and 256, but we use 250 for the max. - * - * Where does the 250 come from? - * - The length of Windows and Linux filenames is limited to 255 bytes. Then the max must not exceed 255. - * - The session filename prefix is `sess_`, a 5 bytes string. Then the max must not exceed 255 - 5 = 250. - * - * ---------- Conclusion - * - * The parts 1 and 2 prevent the warning below: - * `PHP Warning: SessionHandler::read(): Session ID is too long or contains illegal characters. Only the A-Z, a-z, 0-9, "-", and "," characters are allowed.` - * - * The part 2 prevents the warning below: - * `PHP Warning: SessionHandler::read(): open(filepath, O_RDWR) failed: No such file or directory (2).` - */ - if ($sessionId && $this->saveHandler instanceof AbstractProxy && 'files' === $this->saveHandler->getSaveHandlerName() && !preg_match('/^[a-zA-Z0-9,-]{22,250}$/', $sessionId)) { - // the session ID in the header is invalid, create a new one - session_id(session_create_id()); - } - - // ok to try and start the session - if (!session_start()) { - throw new \RuntimeException('Failed to start the session.'); - } - - $this->loadSession(); - - return true; - } - - public function getId(): string - { - return $this->saveHandler->getId(); - } - - public function setId(string $id) - { - $this->saveHandler->setId($id); - } - - public function getName(): string - { - return $this->saveHandler->getName(); - } - - public function setName(string $name) - { - $this->saveHandler->setName($name); - } - - public function regenerate(bool $destroy = false, int $lifetime = null): bool - { - // Cannot regenerate the session ID for non-active sessions. - if (\PHP_SESSION_ACTIVE !== session_status()) { - return false; - } - - if (headers_sent()) { - return false; - } - - if (null !== $lifetime && $lifetime != \ini_get('session.cookie_lifetime')) { - $this->save(); - ini_set('session.cookie_lifetime', $lifetime); - $this->start(); - } - - if ($destroy) { - $this->metadataBag->stampNew(); - } - - return session_regenerate_id($destroy); - } - - public function save() - { - // Store a copy so we can restore the bags in case the session was not left empty - $session = $_SESSION; - - foreach ($this->bags as $bag) { - if (empty($_SESSION[$key = $bag->getStorageKey()])) { - unset($_SESSION[$key]); - } - } - if ($_SESSION && [$key = $this->metadataBag->getStorageKey()] === array_keys($_SESSION)) { - unset($_SESSION[$key]); - } - - // Register error handler to add information about the current save handler - $previousHandler = set_error_handler(function ($type, $msg, $file, $line) use (&$previousHandler) { - if (\E_WARNING === $type && str_starts_with($msg, 'session_write_close():')) { - $handler = $this->saveHandler instanceof SessionHandlerProxy ? $this->saveHandler->getHandler() : $this->saveHandler; - $msg = sprintf('session_write_close(): Failed to write session data with "%s" handler', $handler::class); - } - - return $previousHandler ? $previousHandler($type, $msg, $file, $line) : false; - }); - - try { - session_write_close(); - } finally { - restore_error_handler(); - - // Restore only if not empty - if ($_SESSION) { - $_SESSION = $session; - } - } - - $this->closed = true; - $this->started = false; - } - - public function clear() - { - // clear out the bags - foreach ($this->bags as $bag) { - $bag->clear(); - } - - // clear out the session - $_SESSION = []; - - // reconnect the bags to the session - $this->loadSession(); - } - - public function registerBag(SessionBagInterface $bag) - { - if ($this->started) { - throw new \LogicException('Cannot register a bag when the session is already started.'); - } - - $this->bags[$bag->getName()] = $bag; - } - - public function getBag(string $name): SessionBagInterface - { - if (!isset($this->bags[$name])) { - throw new \InvalidArgumentException(sprintf('The SessionBagInterface "%s" is not registered.', $name)); - } - - if (!$this->started && $this->saveHandler->isActive()) { - $this->loadSession(); - } elseif (!$this->started) { - $this->start(); - } - - return $this->bags[$name]; - } - - public function setMetadataBag(MetadataBag $metaBag = null) - { - if (1 > \func_num_args()) { - trigger_deprecation('symfony/http-foundation', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); - } - $this->metadataBag = $metaBag ?? new MetadataBag(); - - } - - /** - * Gets the MetadataBag. - */ - public function getMetadataBag(): MetadataBag - { - return $this->metadataBag; - } - - public function isStarted(): bool - { - return $this->started; - } - - /** - * Sets session.* ini variables. - * - * For convenience we omit 'session.' from the beginning of the keys. - * Explicitly ignores other ini keys. - * - * @param array $options Session ini directives [key => value] - * - * @see https://php.net/session.configuration - */ - public function setOptions(array $options) - { - if (headers_sent() || \PHP_SESSION_ACTIVE === session_status()) { - return; - } - - $validOptions = array_flip([ - 'cache_expire', 'cache_limiter', 'cookie_domain', 'cookie_httponly', - 'cookie_lifetime', 'cookie_path', 'cookie_secure', 'cookie_samesite', - 'gc_divisor', 'gc_maxlifetime', 'gc_probability', - 'lazy_write', 'name', 'referer_check', - 'serialize_handler', 'use_strict_mode', 'use_cookies', - 'use_only_cookies', 'use_trans_sid', - 'sid_length', 'sid_bits_per_character', 'trans_sid_hosts', 'trans_sid_tags', - ]); - - foreach ($options as $key => $value) { - if (isset($validOptions[$key])) { - if ('cookie_secure' === $key && 'auto' === $value) { - continue; - } - ini_set('session.'.$key, $value); - } - } - } - - /** - * Registers session save handler as a PHP session handler. - * - * To use internal PHP session save handlers, override this method using ini_set with - * session.save_handler and session.save_path e.g. - * - * ini_set('session.save_handler', 'files'); - * ini_set('session.save_path', '/tmp'); - * - * or pass in a \SessionHandler instance which configures session.save_handler in the - * constructor, for a template see NativeFileSessionHandler. - * - * @see https://php.net/session-set-save-handler - * @see https://php.net/sessionhandlerinterface - * @see https://php.net/sessionhandler - * - * @throws \InvalidArgumentException - */ - public function setSaveHandler(AbstractProxy|\SessionHandlerInterface $saveHandler = null) - { - if (1 > \func_num_args()) { - trigger_deprecation('symfony/http-foundation', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); - } - - // Wrap $saveHandler in proxy and prevent double wrapping of proxy - if (!$saveHandler instanceof AbstractProxy && $saveHandler instanceof \SessionHandlerInterface) { - $saveHandler = new SessionHandlerProxy($saveHandler); - } elseif (!$saveHandler instanceof AbstractProxy) { - $saveHandler = new SessionHandlerProxy(new StrictSessionHandler(new \SessionHandler())); - } - $this->saveHandler = $saveHandler; - - if (headers_sent() || \PHP_SESSION_ACTIVE === session_status()) { - return; - } - - if ($this->saveHandler instanceof SessionHandlerProxy) { - session_set_save_handler($this->saveHandler, false); - } - } - - /** - * Load the session with attributes. - * - * After starting the session, PHP retrieves the session from whatever handlers - * are set to (either PHP's internal, or a custom save handler set with session_set_save_handler()). - * PHP takes the return value from the read() handler, unserializes it - * and populates $_SESSION with the result automatically. - */ - protected function loadSession(array &$session = null) - { - if (null === $session) { - $session = &$_SESSION; - } - - $bags = array_merge($this->bags, [$this->metadataBag]); - - foreach ($bags as $bag) { - $key = $bag->getStorageKey(); - $session[$key] = isset($session[$key]) && \is_array($session[$key]) ? $session[$key] : []; - $bag->initialize($session[$key]); - } - - $this->started = true; - $this->closed = false; - } -} diff --git a/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorageFactory.php b/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorageFactory.php deleted file mode 100644 index 08901284..00000000 --- a/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorageFactory.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Session\Storage; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy; - -// Help opcache.preload discover always-needed symbols -class_exists(NativeSessionStorage::class); - -/** - * @author Jérémy Derussé - */ -class NativeSessionStorageFactory implements SessionStorageFactoryInterface -{ - private array $options; - private AbstractProxy|\SessionHandlerInterface|null $handler; - private ?MetadataBag $metaBag; - private bool $secure; - - /** - * @see NativeSessionStorage constructor. - */ - public function __construct(array $options = [], AbstractProxy|\SessionHandlerInterface $handler = null, MetadataBag $metaBag = null, bool $secure = false) - { - $this->options = $options; - $this->handler = $handler; - $this->metaBag = $metaBag; - $this->secure = $secure; - } - - public function createStorage(?Request $request): SessionStorageInterface - { - $storage = new NativeSessionStorage($this->options, $this->handler, $this->metaBag); - if ($this->secure && $request?->isSecure()) { - $storage->setOptions(['cookie_secure' => true]); - } - - return $storage; - } -} diff --git a/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorage.php b/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorage.php deleted file mode 100644 index eed748f8..00000000 --- a/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorage.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Session\Storage; - -use Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy; - -/** - * Allows session to be started by PHP and managed by Symfony. - * - * @author Drak - */ -class PhpBridgeSessionStorage extends NativeSessionStorage -{ - public function __construct(AbstractProxy|\SessionHandlerInterface $handler = null, MetadataBag $metaBag = null) - { - if (!\extension_loaded('session')) { - throw new \LogicException('PHP extension "session" is required.'); - } - - $this->setMetadataBag($metaBag); - $this->setSaveHandler($handler); - } - - public function start(): bool - { - if ($this->started) { - return true; - } - - $this->loadSession(); - - return true; - } - - public function clear() - { - // clear out the bags and nothing else that may be set - // since the purpose of this driver is to share a handler - foreach ($this->bags as $bag) { - $bag->clear(); - } - - // reconnect the bags to the session - $this->loadSession(); - } -} diff --git a/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorageFactory.php b/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorageFactory.php deleted file mode 100644 index 5cc73802..00000000 --- a/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorageFactory.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Session\Storage; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy; - -// Help opcache.preload discover always-needed symbols -class_exists(PhpBridgeSessionStorage::class); - -/** - * @author Jérémy Derussé - */ -class PhpBridgeSessionStorageFactory implements SessionStorageFactoryInterface -{ - private AbstractProxy|\SessionHandlerInterface|null $handler; - private ?MetadataBag $metaBag; - private bool $secure; - - public function __construct(AbstractProxy|\SessionHandlerInterface $handler = null, MetadataBag $metaBag = null, bool $secure = false) - { - $this->handler = $handler; - $this->metaBag = $metaBag; - $this->secure = $secure; - } - - public function createStorage(?Request $request): SessionStorageInterface - { - $storage = new PhpBridgeSessionStorage($this->handler, $this->metaBag); - if ($this->secure && $request?->isSecure()) { - $storage->setOptions(['cookie_secure' => true]); - } - - return $storage; - } -} diff --git a/vendor/symfony/http-foundation/Session/Storage/Proxy/AbstractProxy.php b/vendor/symfony/http-foundation/Session/Storage/Proxy/AbstractProxy.php deleted file mode 100644 index 1845ee2c..00000000 --- a/vendor/symfony/http-foundation/Session/Storage/Proxy/AbstractProxy.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\HttpFoundation\Session\Storage\Proxy; - -/** - * @author Drak - */ -abstract class AbstractProxy -{ - /** - * Flag if handler wraps an internal PHP session handler (using \SessionHandler). - * - * @var bool - */ - protected $wrapper = false; - - /** - * @var string - */ - protected $saveHandlerName; - - /** - * Gets the session.save_handler name. - */ - public function getSaveHandlerName(): ?string - { - return $this->saveHandlerName; - } - - /** - * Is this proxy handler and instance of \SessionHandlerInterface. - */ - public function isSessionHandlerInterface(): bool - { - return $this instanceof \SessionHandlerInterface; - } - - /** - * Returns true if this handler wraps an internal PHP session save handler using \SessionHandler. - */ - public function isWrapper(): bool - { - return $this->wrapper; - } - - /** - * Has a session started? - */ - public function isActive(): bool - { - return \PHP_SESSION_ACTIVE === session_status(); - } - - /** - * Gets the session ID. - */ - public function getId(): string - { - return session_id(); - } - - /** - * Sets the session ID. - * - * @throws \LogicException - */ - public function setId(string $id) - { - if ($this->isActive()) { - throw new \LogicException('Cannot change the ID of an active session.'); - } - - session_id($id); - } - - /** - * Gets the session name. - */ - public function getName(): string - { - return session_name(); - } - - /** - * Sets the session name. - * - * @throws \LogicException - */ - public function setName(string $name) - { - if ($this->isActive()) { - throw new \LogicException('Cannot change the name of an active session.'); - } - - session_name($name); - } -} diff --git a/vendor/symfony/http-foundation/Session/Storage/Proxy/SessionHandlerProxy.php b/vendor/symfony/http-foundation/Session/Storage/Proxy/SessionHandlerProxy.php deleted file mode 100644 index c292e58f..00000000 --- a/vendor/symfony/http-foundation/Session/Storage/Proxy/SessionHandlerProxy.php +++ /dev/null @@ -1,76 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Session\Storage\Proxy; - -use Symfony\Component\HttpFoundation\Session\Storage\Handler\StrictSessionHandler; - -/** - * @author Drak - */ -class SessionHandlerProxy extends AbstractProxy implements \SessionHandlerInterface, \SessionUpdateTimestampHandlerInterface -{ - protected $handler; - - public function __construct(\SessionHandlerInterface $handler) - { - $this->handler = $handler; - $this->wrapper = $handler instanceof \SessionHandler; - $this->saveHandlerName = $this->wrapper || ($handler instanceof StrictSessionHandler && $handler->isWrapper()) ? \ini_get('session.save_handler') : 'user'; - } - - public function getHandler(): \SessionHandlerInterface - { - return $this->handler; - } - - // \SessionHandlerInterface - - public function open(string $savePath, string $sessionName): bool - { - return $this->handler->open($savePath, $sessionName); - } - - public function close(): bool - { - return $this->handler->close(); - } - - public function read(string $sessionId): string|false - { - return $this->handler->read($sessionId); - } - - public function write(string $sessionId, string $data): bool - { - return $this->handler->write($sessionId, $data); - } - - public function destroy(string $sessionId): bool - { - return $this->handler->destroy($sessionId); - } - - public function gc(int $maxlifetime): int|false - { - return $this->handler->gc($maxlifetime); - } - - public function validateId(string $sessionId): bool - { - return !$this->handler instanceof \SessionUpdateTimestampHandlerInterface || $this->handler->validateId($sessionId); - } - - public function updateTimestamp(string $sessionId, string $data): bool - { - return $this->handler instanceof \SessionUpdateTimestampHandlerInterface ? $this->handler->updateTimestamp($sessionId, $data) : $this->write($sessionId, $data); - } -} diff --git a/vendor/symfony/http-foundation/Session/Storage/SessionStorageFactoryInterface.php b/vendor/symfony/http-foundation/Session/Storage/SessionStorageFactoryInterface.php deleted file mode 100644 index d03f0da4..00000000 --- a/vendor/symfony/http-foundation/Session/Storage/SessionStorageFactoryInterface.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\HttpFoundation\Session\Storage; - -use Symfony\Component\HttpFoundation\Request; - -/** - * @author Jérémy Derussé - */ -interface SessionStorageFactoryInterface -{ - /** - * Creates a new instance of SessionStorageInterface. - */ - public function createStorage(?Request $request): SessionStorageInterface; -} diff --git a/vendor/symfony/http-foundation/Session/Storage/SessionStorageInterface.php b/vendor/symfony/http-foundation/Session/Storage/SessionStorageInterface.php deleted file mode 100644 index 36839e69..00000000 --- a/vendor/symfony/http-foundation/Session/Storage/SessionStorageInterface.php +++ /dev/null @@ -1,116 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Session\Storage; - -use Symfony\Component\HttpFoundation\Session\SessionBagInterface; - -/** - * StorageInterface. - * - * @author Fabien Potencier - * @author Drak - */ -interface SessionStorageInterface -{ - /** - * Starts the session. - * - * @throws \RuntimeException if something goes wrong starting the session - */ - public function start(): bool; - - /** - * Checks if the session is started. - */ - public function isStarted(): bool; - - /** - * Returns the session ID. - */ - public function getId(): string; - - /** - * Sets the session ID. - */ - public function setId(string $id); - - /** - * Returns the session name. - */ - public function getName(): string; - - /** - * Sets the session name. - */ - public function setName(string $name); - - /** - * Regenerates id that represents this storage. - * - * This method must invoke session_regenerate_id($destroy) unless - * this interface is used for a storage object designed for unit - * or functional testing where a real PHP session would interfere - * with testing. - * - * Note regenerate+destroy should not clear the session data in memory - * only delete the session data from persistent storage. - * - * Care: When regenerating the session ID no locking is involved in PHP's - * session design. See https://bugs.php.net/61470 for a discussion. - * So you must make sure the regenerated session is saved BEFORE sending the - * headers with the new ID. Symfony's HttpKernel offers a listener for this. - * See Symfony\Component\HttpKernel\EventListener\SaveSessionListener. - * Otherwise session data could get lost again for concurrent requests with the - * new ID. One result could be that you get logged out after just logging in. - * - * @param bool $destroy Destroy session when regenerating? - * @param int $lifetime Sets the cookie lifetime for the session cookie. A null value - * will leave the system settings unchanged, 0 sets the cookie - * to expire with browser session. Time is in seconds, and is - * not a Unix timestamp. - * - * @throws \RuntimeException If an error occurs while regenerating this storage - */ - public function regenerate(bool $destroy = false, int $lifetime = null): bool; - - /** - * Force the session to be saved and closed. - * - * This method must invoke session_write_close() unless this interface is - * used for a storage object design for unit or functional testing where - * a real PHP session would interfere with testing, in which case - * it should actually persist the session data if required. - * - * @throws \RuntimeException if the session is saved without being started, or if the session - * is already closed - */ - public function save(); - - /** - * Clear all session data in memory. - */ - public function clear(); - - /** - * Gets a SessionBagInterface by name. - * - * @throws \InvalidArgumentException If the bag does not exist - */ - public function getBag(string $name): SessionBagInterface; - - /** - * Registers a SessionBagInterface for use. - */ - public function registerBag(SessionBagInterface $bag); - - public function getMetadataBag(): MetadataBag; -} diff --git a/vendor/symfony/http-foundation/StreamedResponse.php b/vendor/symfony/http-foundation/StreamedResponse.php deleted file mode 100644 index 0bddcdc9..00000000 --- a/vendor/symfony/http-foundation/StreamedResponse.php +++ /dev/null @@ -1,117 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation; - -/** - * StreamedResponse represents a streamed HTTP response. - * - * A StreamedResponse uses a callback for its content. - * - * The callback should use the standard PHP functions like echo - * to stream the response back to the client. The flush() function - * can also be used if needed. - * - * @see flush() - * - * @author Fabien Potencier - */ -class StreamedResponse extends Response -{ - protected $callback; - protected $streamed; - private bool $headersSent; - - /** - * @param int $status The HTTP status code (200 "OK" by default) - */ - public function __construct(callable $callback = null, int $status = 200, array $headers = []) - { - parent::__construct(null, $status, $headers); - - if (null !== $callback) { - $this->setCallback($callback); - } - $this->streamed = false; - $this->headersSent = false; - } - - /** - * Sets the PHP callback associated with this Response. - * - * @return $this - */ - public function setCallback(callable $callback): static - { - $this->callback = $callback; - - return $this; - } - - /** - * This method only sends the headers once. - * - * @return $this - */ - public function sendHeaders(): static - { - if ($this->headersSent) { - return $this; - } - - $this->headersSent = true; - - return parent::sendHeaders(); - } - - /** - * This method only sends the content once. - * - * @return $this - */ - public function sendContent(): static - { - if ($this->streamed) { - return $this; - } - - $this->streamed = true; - - if (null === $this->callback) { - throw new \LogicException('The Response callback must not be null.'); - } - - ($this->callback)(); - - return $this; - } - - /** - * @return $this - * - * @throws \LogicException when the content is not null - */ - public function setContent(?string $content): static - { - if (null !== $content) { - throw new \LogicException('The content cannot be set on a StreamedResponse instance.'); - } - - $this->streamed = true; - - return $this; - } - - public function getContent(): string|false - { - return false; - } -} diff --git a/vendor/symfony/http-foundation/Test/Constraint/RequestAttributeValueSame.php b/vendor/symfony/http-foundation/Test/Constraint/RequestAttributeValueSame.php deleted file mode 100644 index 6e114268..00000000 --- a/vendor/symfony/http-foundation/Test/Constraint/RequestAttributeValueSame.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Test\Constraint; - -use PHPUnit\Framework\Constraint\Constraint; -use Symfony\Component\HttpFoundation\Request; - -final class RequestAttributeValueSame extends Constraint -{ - private string $name; - private string $value; - - public function __construct(string $name, string $value) - { - $this->name = $name; - $this->value = $value; - } - - public function toString(): string - { - return sprintf('has attribute "%s" with value "%s"', $this->name, $this->value); - } - - /** - * @param Request $request - */ - protected function matches($request): bool - { - return $this->value === $request->attributes->get($this->name); - } - - /** - * @param Request $request - */ - protected function failureDescription($request): string - { - return 'the Request '.$this->toString(); - } -} diff --git a/vendor/symfony/http-foundation/Test/Constraint/ResponseCookieValueSame.php b/vendor/symfony/http-foundation/Test/Constraint/ResponseCookieValueSame.php deleted file mode 100644 index b3d375e4..00000000 --- a/vendor/symfony/http-foundation/Test/Constraint/ResponseCookieValueSame.php +++ /dev/null @@ -1,78 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Test\Constraint; - -use PHPUnit\Framework\Constraint\Constraint; -use Symfony\Component\HttpFoundation\Cookie; -use Symfony\Component\HttpFoundation\Response; - -final class ResponseCookieValueSame extends Constraint -{ - private string $name; - private string $value; - private string $path; - private ?string $domain; - - public function __construct(string $name, string $value, string $path = '/', string $domain = null) - { - $this->name = $name; - $this->value = $value; - $this->path = $path; - $this->domain = $domain; - } - - public function toString(): string - { - $str = sprintf('has cookie "%s"', $this->name); - if ('/' !== $this->path) { - $str .= sprintf(' with path "%s"', $this->path); - } - if ($this->domain) { - $str .= sprintf(' for domain "%s"', $this->domain); - } - $str .= sprintf(' with value "%s"', $this->value); - - return $str; - } - - /** - * @param Response $response - */ - protected function matches($response): bool - { - $cookie = $this->getCookie($response); - if (!$cookie) { - return false; - } - - return $this->value === (string) $cookie->getValue(); - } - - /** - * @param Response $response - */ - protected function failureDescription($response): string - { - return 'the Response '.$this->toString(); - } - - protected function getCookie(Response $response): ?Cookie - { - $cookies = $response->headers->getCookies(); - - $filteredCookies = array_filter($cookies, function (Cookie $cookie) { - return $cookie->getName() === $this->name && $cookie->getPath() === $this->path && $cookie->getDomain() === $this->domain; - }); - - return reset($filteredCookies) ?: null; - } -} diff --git a/vendor/symfony/http-foundation/Test/Constraint/ResponseFormatSame.php b/vendor/symfony/http-foundation/Test/Constraint/ResponseFormatSame.php deleted file mode 100644 index b14dcee9..00000000 --- a/vendor/symfony/http-foundation/Test/Constraint/ResponseFormatSame.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\HttpFoundation\Test\Constraint; - -use PHPUnit\Framework\Constraint\Constraint; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; - -/** - * Asserts that the response is in the given format. - * - * @author Kévin Dunglas - */ -final class ResponseFormatSame extends Constraint -{ - private Request $request; - private ?string $format; - - public function __construct(Request $request, ?string $format) - { - $this->request = $request; - $this->format = $format; - } - - public function toString(): string - { - return 'format is '.($this->format ?? 'null'); - } - - /** - * @param Response $response - */ - protected function matches($response): bool - { - return $this->format === $this->request->getFormat($response->headers->get('Content-Type')); - } - - /** - * @param Response $response - */ - protected function failureDescription($response): string - { - return 'the Response '.$this->toString(); - } - - /** - * @param Response $response - */ - protected function additionalFailureDescription($response): string - { - return (string) $response; - } -} diff --git a/vendor/symfony/http-foundation/Test/Constraint/ResponseHasCookie.php b/vendor/symfony/http-foundation/Test/Constraint/ResponseHasCookie.php deleted file mode 100644 index 9b15aeae..00000000 --- a/vendor/symfony/http-foundation/Test/Constraint/ResponseHasCookie.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\HttpFoundation\Test\Constraint; - -use PHPUnit\Framework\Constraint\Constraint; -use Symfony\Component\HttpFoundation\Cookie; -use Symfony\Component\HttpFoundation\Response; - -final class ResponseHasCookie extends Constraint -{ - private string $name; - private string $path; - private ?string $domain; - - public function __construct(string $name, string $path = '/', string $domain = null) - { - $this->name = $name; - $this->path = $path; - $this->domain = $domain; - } - - public function toString(): string - { - $str = sprintf('has cookie "%s"', $this->name); - if ('/' !== $this->path) { - $str .= sprintf(' with path "%s"', $this->path); - } - if ($this->domain) { - $str .= sprintf(' for domain "%s"', $this->domain); - } - - return $str; - } - - /** - * @param Response $response - */ - protected function matches($response): bool - { - return null !== $this->getCookie($response); - } - - /** - * @param Response $response - */ - protected function failureDescription($response): string - { - return 'the Response '.$this->toString(); - } - - private function getCookie(Response $response): ?Cookie - { - $cookies = $response->headers->getCookies(); - - $filteredCookies = array_filter($cookies, function (Cookie $cookie) { - return $cookie->getName() === $this->name && $cookie->getPath() === $this->path && $cookie->getDomain() === $this->domain; - }); - - return reset($filteredCookies) ?: null; - } -} diff --git a/vendor/symfony/http-foundation/Test/Constraint/ResponseHasHeader.php b/vendor/symfony/http-foundation/Test/Constraint/ResponseHasHeader.php deleted file mode 100644 index 08522c89..00000000 --- a/vendor/symfony/http-foundation/Test/Constraint/ResponseHasHeader.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Test\Constraint; - -use PHPUnit\Framework\Constraint\Constraint; -use Symfony\Component\HttpFoundation\Response; - -final class ResponseHasHeader extends Constraint -{ - private string $headerName; - - public function __construct(string $headerName) - { - $this->headerName = $headerName; - } - - public function toString(): string - { - return sprintf('has header "%s"', $this->headerName); - } - - /** - * @param Response $response - */ - protected function matches($response): bool - { - return $response->headers->has($this->headerName); - } - - /** - * @param Response $response - */ - protected function failureDescription($response): string - { - return 'the Response '.$this->toString(); - } -} diff --git a/vendor/symfony/http-foundation/Test/Constraint/ResponseHeaderSame.php b/vendor/symfony/http-foundation/Test/Constraint/ResponseHeaderSame.php deleted file mode 100644 index 8141df97..00000000 --- a/vendor/symfony/http-foundation/Test/Constraint/ResponseHeaderSame.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Test\Constraint; - -use PHPUnit\Framework\Constraint\Constraint; -use Symfony\Component\HttpFoundation\Response; - -final class ResponseHeaderSame extends Constraint -{ - private string $headerName; - private string $expectedValue; - - public function __construct(string $headerName, string $expectedValue) - { - $this->headerName = $headerName; - $this->expectedValue = $expectedValue; - } - - public function toString(): string - { - return sprintf('has header "%s" with value "%s"', $this->headerName, $this->expectedValue); - } - - /** - * @param Response $response - */ - protected function matches($response): bool - { - return $this->expectedValue === $response->headers->get($this->headerName, null); - } - - /** - * @param Response $response - */ - protected function failureDescription($response): string - { - return 'the Response '.$this->toString(); - } -} diff --git a/vendor/symfony/http-foundation/Test/Constraint/ResponseIsRedirected.php b/vendor/symfony/http-foundation/Test/Constraint/ResponseIsRedirected.php deleted file mode 100644 index bb0e53d0..00000000 --- a/vendor/symfony/http-foundation/Test/Constraint/ResponseIsRedirected.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Test\Constraint; - -use PHPUnit\Framework\Constraint\Constraint; -use Symfony\Component\HttpFoundation\Response; - -final class ResponseIsRedirected extends Constraint -{ - public function toString(): string - { - return 'is redirected'; - } - - /** - * @param Response $response - */ - protected function matches($response): bool - { - return $response->isRedirect(); - } - - /** - * @param Response $response - */ - protected function failureDescription($response): string - { - return 'the Response '.$this->toString(); - } - - /** - * @param Response $response - */ - protected function additionalFailureDescription($response): string - { - return (string) $response; - } -} diff --git a/vendor/symfony/http-foundation/Test/Constraint/ResponseIsSuccessful.php b/vendor/symfony/http-foundation/Test/Constraint/ResponseIsSuccessful.php deleted file mode 100644 index 2c6b7680..00000000 --- a/vendor/symfony/http-foundation/Test/Constraint/ResponseIsSuccessful.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Test\Constraint; - -use PHPUnit\Framework\Constraint\Constraint; -use Symfony\Component\HttpFoundation\Response; - -final class ResponseIsSuccessful extends Constraint -{ - public function toString(): string - { - return 'is successful'; - } - - /** - * @param Response $response - */ - protected function matches($response): bool - { - return $response->isSuccessful(); - } - - /** - * @param Response $response - */ - protected function failureDescription($response): string - { - return 'the Response '.$this->toString(); - } - - /** - * @param Response $response - */ - protected function additionalFailureDescription($response): string - { - return (string) $response; - } -} diff --git a/vendor/symfony/http-foundation/Test/Constraint/ResponseIsUnprocessable.php b/vendor/symfony/http-foundation/Test/Constraint/ResponseIsUnprocessable.php deleted file mode 100644 index 52336a5b..00000000 --- a/vendor/symfony/http-foundation/Test/Constraint/ResponseIsUnprocessable.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Test\Constraint; - -use PHPUnit\Framework\Constraint\Constraint; -use Symfony\Component\HttpFoundation\Response; - -final class ResponseIsUnprocessable extends Constraint -{ - public function toString(): string - { - return 'is unprocessable'; - } - - /** - * @param Response $other - */ - protected function matches($other): bool - { - return Response::HTTP_UNPROCESSABLE_ENTITY === $other->getStatusCode(); - } - - /** - * @param Response $other - */ - protected function failureDescription($other): string - { - return 'the Response '.$this->toString(); - } - - /** - * @param Response $other - */ - protected function additionalFailureDescription($other): string - { - return (string) $other; - } -} diff --git a/vendor/symfony/http-foundation/Test/Constraint/ResponseStatusCodeSame.php b/vendor/symfony/http-foundation/Test/Constraint/ResponseStatusCodeSame.php deleted file mode 100644 index cd565ba9..00000000 --- a/vendor/symfony/http-foundation/Test/Constraint/ResponseStatusCodeSame.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation\Test\Constraint; - -use PHPUnit\Framework\Constraint\Constraint; -use Symfony\Component\HttpFoundation\Response; - -final class ResponseStatusCodeSame extends Constraint -{ - private int $statusCode; - - public function __construct(int $statusCode) - { - $this->statusCode = $statusCode; - } - - public function toString(): string - { - return 'status code is '.$this->statusCode; - } - - /** - * @param Response $response - */ - protected function matches($response): bool - { - return $this->statusCode === $response->getStatusCode(); - } - - /** - * @param Response $response - */ - protected function failureDescription($response): string - { - return 'the Response '.$this->toString(); - } - - /** - * @param Response $response - */ - protected function additionalFailureDescription($response): string - { - return (string) $response; - } -} diff --git a/vendor/symfony/http-foundation/UrlHelper.php b/vendor/symfony/http-foundation/UrlHelper.php deleted file mode 100644 index 42fcf045..00000000 --- a/vendor/symfony/http-foundation/UrlHelper.php +++ /dev/null @@ -1,102 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpFoundation; - -use Symfony\Component\Routing\RequestContext; - -/** - * A helper service for manipulating URLs within and outside the request scope. - * - * @author Valentin Udaltsov - */ -final class UrlHelper -{ - private RequestStack $requestStack; - private ?RequestContext $requestContext; - - public function __construct(RequestStack $requestStack, RequestContext $requestContext = null) - { - $this->requestStack = $requestStack; - $this->requestContext = $requestContext; - } - - public function getAbsoluteUrl(string $path): string - { - if (str_contains($path, '://') || str_starts_with($path, '//')) { - return $path; - } - - if (null === $request = $this->requestStack->getMainRequest()) { - return $this->getAbsoluteUrlFromContext($path); - } - - if ('#' === $path[0]) { - $path = $request->getRequestUri().$path; - } elseif ('?' === $path[0]) { - $path = $request->getPathInfo().$path; - } - - if (!$path || '/' !== $path[0]) { - $prefix = $request->getPathInfo(); - $last = \strlen($prefix) - 1; - if ($last !== $pos = strrpos($prefix, '/')) { - $prefix = substr($prefix, 0, $pos).'/'; - } - - return $request->getUriForPath($prefix.$path); - } - - return $request->getSchemeAndHttpHost().$path; - } - - public function getRelativePath(string $path): string - { - if (str_contains($path, '://') || str_starts_with($path, '//')) { - return $path; - } - - if (null === $request = $this->requestStack->getMainRequest()) { - return $path; - } - - return $request->getRelativeUriForPath($path); - } - - private function getAbsoluteUrlFromContext(string $path): string - { - if (null === $this->requestContext || '' === $host = $this->requestContext->getHost()) { - return $path; - } - - $scheme = $this->requestContext->getScheme(); - $port = ''; - - if ('http' === $scheme && 80 !== $this->requestContext->getHttpPort()) { - $port = ':'.$this->requestContext->getHttpPort(); - } elseif ('https' === $scheme && 443 !== $this->requestContext->getHttpsPort()) { - $port = ':'.$this->requestContext->getHttpsPort(); - } - - if ('#' === $path[0]) { - $queryString = $this->requestContext->getQueryString(); - $path = $this->requestContext->getPathInfo().($queryString ? '?'.$queryString : '').$path; - } elseif ('?' === $path[0]) { - $path = $this->requestContext->getPathInfo().$path; - } - - if ('/' !== $path[0]) { - $path = rtrim($this->requestContext->getBaseUrl(), '/').'/'.$path; - } - - return $scheme.'://'.$host.$port.$path; - } -} diff --git a/vendor/symfony/http-foundation/composer.json b/vendor/symfony/http-foundation/composer.json deleted file mode 100644 index e333a23b..00000000 --- a/vendor/symfony/http-foundation/composer.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "symfony/http-foundation", - "type": "library", - "description": "Defines an object-oriented layer for the HTTP specification", - "keywords": [], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-mbstring": "~1.1" - }, - "require-dev": { - "predis/predis": "~1.0", - "symfony/cache": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/http-kernel": "^5.4.12|^6.0.12|^6.1.4", - "symfony/mime": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/rate-limiter": "^5.2|^6.0" - }, - "conflict": { - "symfony/cache": "<6.2" - }, - "suggest" : { - "symfony/mime": "To use the file extension guesser" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\HttpFoundation\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "minimum-stability": "dev" -} diff --git a/vendor/symfony/http-kernel/Attribute/AsController.php b/vendor/symfony/http-kernel/Attribute/AsController.php deleted file mode 100644 index ef371045..00000000 --- a/vendor/symfony/http-kernel/Attribute/AsController.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\HttpKernel\Attribute; - -/** - * Service tag to autoconfigure controllers. - */ -#[\Attribute(\Attribute::TARGET_CLASS)] -class AsController -{ - public function __construct() - { - } -} diff --git a/vendor/symfony/http-kernel/Attribute/Cache.php b/vendor/symfony/http-kernel/Attribute/Cache.php deleted file mode 100644 index e51545fe..00000000 --- a/vendor/symfony/http-kernel/Attribute/Cache.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\HttpKernel\Attribute; - -/** - * Describes the default HTTP cache headers on controllers. - * - * @author Fabien Potencier - */ -#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::TARGET_FUNCTION)] -final class Cache -{ - public function __construct( - /** - * The expiration date as a valid date for the strtotime() function. - */ - public ?string $expires = null, - - /** - * The number of seconds that the response is considered fresh by a private - * cache like a web browser. - */ - public int|string|null $maxage = null, - - /** - * The number of seconds that the response is considered fresh by a public - * cache like a reverse proxy cache. - */ - public int|string|null $smaxage = null, - - /** - * Whether the response is public or not. - */ - public ?bool $public = null, - - /** - * Whether or not the response must be revalidated. - */ - public bool $mustRevalidate = false, - - /** - * Additional "Vary:"-headers. - */ - public array $vary = [], - - /** - * An expression to compute the Last-Modified HTTP header. - */ - public ?string $lastModified = null, - - /** - * An expression to compute the ETag HTTP header. - */ - public ?string $etag = null, - - /** - * max-stale Cache-Control header - * It can be expressed in seconds or with a relative time format (1 day, 2 weeks, ...). - */ - public int|string|null $maxStale = null, - - /** - * stale-while-revalidate Cache-Control header - * It can be expressed in seconds or with a relative time format (1 day, 2 weeks, ...). - */ - public int|string|null $staleWhileRevalidate = null, - - /** - * stale-if-error Cache-Control header - * It can be expressed in seconds or with a relative time format (1 day, 2 weeks, ...). - */ - public int|string|null $staleIfError = null, - ) { - } -} diff --git a/vendor/symfony/http-kernel/Attribute/MapDateTime.php b/vendor/symfony/http-kernel/Attribute/MapDateTime.php deleted file mode 100644 index ce9f8568..00000000 --- a/vendor/symfony/http-kernel/Attribute/MapDateTime.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\HttpKernel\Attribute; - -/** - * Controller parameter tag to configure DateTime arguments. - */ -#[\Attribute(\Attribute::TARGET_PARAMETER)] -class MapDateTime -{ - public function __construct( - public readonly ?string $format = null - ) { - } -} diff --git a/vendor/symfony/http-kernel/Bundle/AbstractBundle.php b/vendor/symfony/http-kernel/Bundle/AbstractBundle.php deleted file mode 100644 index d24a2bc7..00000000 --- a/vendor/symfony/http-kernel/Bundle/AbstractBundle.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Bundle; - -use Symfony\Component\Config\Definition\Configurator\DefinitionConfigurator; -use Symfony\Component\DependencyInjection\Container; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Extension\ConfigurableExtensionInterface; -use Symfony\Component\DependencyInjection\Extension\ExtensionInterface; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; - -/** - * A Bundle that provides configuration hooks. - * - * @author Yonel Ceruto - */ -abstract class AbstractBundle extends Bundle implements ConfigurableExtensionInterface -{ - protected string $extensionAlias = ''; - - public function configure(DefinitionConfigurator $definition): void - { - } - - public function prependExtension(ContainerConfigurator $container, ContainerBuilder $builder): void - { - } - - public function loadExtension(array $config, ContainerConfigurator $container, ContainerBuilder $builder): void - { - } - - public function getContainerExtension(): ?ExtensionInterface - { - if ('' === $this->extensionAlias) { - $this->extensionAlias = Container::underscore(preg_replace('/Bundle$/', '', $this->getName())); - } - - return $this->extension ??= new BundleExtension($this, $this->extensionAlias); - } - - public function getPath(): string - { - if (null === $this->path) { - $reflected = new \ReflectionObject($this); - // assume the modern directory structure by default - $this->path = \dirname($reflected->getFileName(), 2); - } - - return $this->path; - } -} diff --git a/vendor/symfony/http-kernel/Bundle/Bundle.php b/vendor/symfony/http-kernel/Bundle/Bundle.php deleted file mode 100644 index 4d17cf5d..00000000 --- a/vendor/symfony/http-kernel/Bundle/Bundle.php +++ /dev/null @@ -1,141 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Bundle; - -use Symfony\Component\Console\Application; -use Symfony\Component\DependencyInjection\Container; -use Symfony\Component\DependencyInjection\ContainerAwareTrait; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Extension\ExtensionInterface; - -/** - * An implementation of BundleInterface that adds a few conventions for DependencyInjection extensions. - * - * @author Fabien Potencier - */ -abstract class Bundle implements BundleInterface -{ - use ContainerAwareTrait; - - protected $name; - protected $extension; - protected $path; - private string $namespace; - - public function boot() - { - } - - public function shutdown() - { - } - - /** - * This method can be overridden to register compilation passes, - * other extensions, ... - */ - public function build(ContainerBuilder $container) - { - } - - /** - * Returns the bundle's container extension. - * - * @throws \LogicException - */ - public function getContainerExtension(): ?ExtensionInterface - { - if (null === $this->extension) { - $extension = $this->createContainerExtension(); - - if (null !== $extension) { - if (!$extension instanceof ExtensionInterface) { - throw new \LogicException(sprintf('Extension "%s" must implement Symfony\Component\DependencyInjection\Extension\ExtensionInterface.', get_debug_type($extension))); - } - - // check naming convention - $basename = preg_replace('/Bundle$/', '', $this->getName()); - $expectedAlias = Container::underscore($basename); - - if ($expectedAlias != $extension->getAlias()) { - throw new \LogicException(sprintf('Users will expect the alias of the default extension of a bundle to be the underscored version of the bundle name ("%s"). You can override "Bundle::getContainerExtension()" if you want to use "%s" or another alias.', $expectedAlias, $extension->getAlias())); - } - - $this->extension = $extension; - } else { - $this->extension = false; - } - } - - return $this->extension ?: null; - } - - public function getNamespace(): string - { - if (!isset($this->namespace)) { - $this->parseClassName(); - } - - return $this->namespace; - } - - public function getPath(): string - { - if (null === $this->path) { - $reflected = new \ReflectionObject($this); - $this->path = \dirname($reflected->getFileName()); - } - - return $this->path; - } - - /** - * Returns the bundle name (the class short name). - */ - final public function getName(): string - { - if (null === $this->name) { - $this->parseClassName(); - } - - return $this->name; - } - - public function registerCommands(Application $application) - { - } - - /** - * Returns the bundle's container extension class. - */ - protected function getContainerExtensionClass(): string - { - $basename = preg_replace('/Bundle$/', '', $this->getName()); - - return $this->getNamespace().'\\DependencyInjection\\'.$basename.'Extension'; - } - - /** - * Creates the bundle's container extension. - */ - protected function createContainerExtension(): ?ExtensionInterface - { - return class_exists($class = $this->getContainerExtensionClass()) ? new $class() : null; - } - - private function parseClassName() - { - $pos = strrpos(static::class, '\\'); - $this->namespace = false === $pos ? '' : substr(static::class, 0, $pos); - $this->name ??= false === $pos ? static::class : substr(static::class, $pos + 1); - } -} diff --git a/vendor/symfony/http-kernel/Bundle/BundleExtension.php b/vendor/symfony/http-kernel/Bundle/BundleExtension.php deleted file mode 100644 index b80bc21f..00000000 --- a/vendor/symfony/http-kernel/Bundle/BundleExtension.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\HttpKernel\Bundle; - -use Symfony\Component\Config\Definition\Configuration; -use Symfony\Component\Config\Definition\ConfigurationInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Extension\ConfigurableExtensionInterface; -use Symfony\Component\DependencyInjection\Extension\Extension; -use Symfony\Component\DependencyInjection\Extension\ExtensionTrait; -use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; - -/** - * @author Yonel Ceruto - * - * @internal - */ -class BundleExtension extends Extension implements PrependExtensionInterface -{ - use ExtensionTrait; - - public function __construct( - private ConfigurableExtensionInterface $subject, - private string $alias, - ) { - } - - public function getConfiguration(array $config, ContainerBuilder $container): ?ConfigurationInterface - { - return new Configuration($this->subject, $container, $this->getAlias()); - } - - public function getAlias(): string - { - return $this->alias; - } - - public function prepend(ContainerBuilder $container): void - { - $callback = function (ContainerConfigurator $configurator) use ($container) { - $this->subject->prependExtension($configurator, $container); - }; - - $this->executeConfiguratorCallback($container, $callback, $this->subject); - } - - public function load(array $configs, ContainerBuilder $container): void - { - $config = $this->processConfiguration($this->getConfiguration([], $container), $configs); - - $callback = function (ContainerConfigurator $configurator) use ($config, $container) { - $this->subject->loadExtension($config, $configurator, $container); - }; - - $this->executeConfiguratorCallback($container, $callback, $this->subject); - } -} diff --git a/vendor/symfony/http-kernel/Bundle/BundleInterface.php b/vendor/symfony/http-kernel/Bundle/BundleInterface.php deleted file mode 100644 index 54906325..00000000 --- a/vendor/symfony/http-kernel/Bundle/BundleInterface.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\HttpKernel\Bundle; - -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Extension\ExtensionInterface; - -/** - * BundleInterface. - * - * @author Fabien Potencier - */ -interface BundleInterface extends ContainerAwareInterface -{ - /** - * Boots the Bundle. - */ - public function boot(); - - /** - * Shutdowns the Bundle. - */ - public function shutdown(); - - /** - * Builds the bundle. - * - * It is only ever called once when the cache is empty. - */ - public function build(ContainerBuilder $container); - - /** - * Returns the container extension that should be implicitly loaded. - */ - public function getContainerExtension(): ?ExtensionInterface; - - /** - * Returns the bundle name (the class short name). - */ - public function getName(): string; - - /** - * Gets the Bundle namespace. - */ - public function getNamespace(): string; - - /** - * Gets the Bundle directory path. - * - * The path should always be returned as a Unix path (with /). - */ - public function getPath(): string; -} diff --git a/vendor/symfony/http-kernel/CHANGELOG.md b/vendor/symfony/http-kernel/CHANGELOG.md deleted file mode 100644 index 2a5aad62..00000000 --- a/vendor/symfony/http-kernel/CHANGELOG.md +++ /dev/null @@ -1,348 +0,0 @@ -CHANGELOG -========= - -6.2 ---- - - * Add constructor argument `bool $handleAllThrowable` to `HttpKernel` - * Add `ControllerEvent::getAttributes()` to handle attributes on controllers - * Add `#[Cache]` to describe the default HTTP cache headers on controllers - * Add `absolute_uri` option to surrogate fragment renderers - * Add `ValueResolverInterface` and deprecate `ArgumentValueResolverInterface` - * Add argument `$reflector` to `ArgumentResolverInterface` and `ArgumentMetadataFactoryInterface` - * Deprecate calling `ConfigDataCollector::setKernel()`, `RouterListener::setCurrentRequest()` without arguments - -6.1 ---- - - * Add `BackedEnumValueResolver` to resolve backed enum cases from request attributes in controller arguments - * Add `DateTimeValueResolver` to resolve request attributes into DateTime objects in controller arguments - * Deprecate StreamedResponseListener, it's not needed anymore - * Add `Profiler::isEnabled()` so collaborating collector services may elect to omit themselves - * Add the `UidValueResolver` argument value resolver - * Add `AbstractBundle` class for DI configuration/definition on a single file - * Update the path of a bundle placed in the `src/` directory to the parent directory when `AbstractBundle` is used - -6.0 ---- - - * Remove `ArgumentInterface` - * Remove `ArgumentMetadata::getAttribute()`, use `getAttributes()` instead - * Remove support for returning a `ContainerBuilder` from `KernelInterface::registerContainerConfiguration()` - * Remove `KernelEvent::isMasterRequest()`, use `isMainRequest()` instead - * Remove support for `service:action` syntax to reference controllers, use `serviceOrFqcn::method` instead - -5.4 ---- - - * Add the ability to enable the profiler using a request query parameter, body parameter or attribute - * Deprecate `AbstractTestSessionListener` and `TestSessionListener`, use `AbstractSessionListener` and `SessionListener` instead - * Deprecate the `fileLinkFormat` parameter of `DebugHandlersListener` - * Add support for configuring log level, and status code by exception class - * Allow ignoring "kernel.reset" methods that don't exist with "on_invalid" attribute - -5.3 ---- - - * Deprecate `ArgumentInterface` - * Add `ArgumentMetadata::getAttributes()` - * Deprecate `ArgumentMetadata::getAttribute()`, use `getAttributes()` instead - * Mark the class `Symfony\Component\HttpKernel\EventListener\DebugHandlersListener` as internal - * Deprecate returning a `ContainerBuilder` from `KernelInterface::registerContainerConfiguration()` - * Deprecate `HttpKernelInterface::MASTER_REQUEST` and add `HttpKernelInterface::MAIN_REQUEST` as replacement - * Deprecate `KernelEvent::isMasterRequest()` and add `isMainRequest()` as replacement - * Add `#[AsController]` attribute for declaring standalone controllers on PHP 8 - * Add `FragmentUriGeneratorInterface` and `FragmentUriGenerator` to generate the URI of a fragment - -5.2.0 ------ - - * added session usage - * made the public `http_cache` service handle requests when available - * allowed enabling trusted hosts and proxies using new `kernel.trusted_hosts`, - `kernel.trusted_proxies` and `kernel.trusted_headers` parameters - * content of request parameter `_password` is now also hidden - in the request profiler raw content section - * Allowed adding attributes on controller arguments that will be passed to argument resolvers. - * kernels implementing the `ExtensionInterface` will now be auto-registered to the container - * added parameter `kernel.runtime_environment`, defined as `%env(default:kernel.environment:APP_RUNTIME_ENV)%` - * do not set a default `Accept` HTTP header when using `HttpKernelBrowser` - -5.1.0 ------ - - * allowed to use a specific logger channel for deprecations - * made `WarmableInterface::warmUp()` return a list of classes or files to preload on PHP 7.4+; - not returning an array is deprecated - * made kernels implementing `WarmableInterface` be part of the cache warmup stage - * deprecated support for `service:action` syntax to reference controllers, use `serviceOrFqcn::method` instead - * allowed using public aliases to reference controllers - * added session usage reporting when the `_stateless` attribute of the request is set to `true` - * added `AbstractSessionListener::onSessionUsage()` to report when the session is used while a request is stateless - -5.0.0 ------ - - * removed support for getting the container from a non-booted kernel - * removed the first and second constructor argument of `ConfigDataCollector` - * removed `ConfigDataCollector::getApplicationName()` - * removed `ConfigDataCollector::getApplicationVersion()` - * removed support for `Symfony\Component\Templating\EngineInterface` in `HIncludeFragmentRenderer`, use a `Twig\Environment` only - * removed `TranslatorListener` in favor of `LocaleAwareListener` - * removed `getRootDir()` and `getName()` from `Kernel` and `KernelInterface` - * removed `FilterControllerArgumentsEvent`, use `ControllerArgumentsEvent` instead - * removed `FilterControllerEvent`, use `ControllerEvent` instead - * removed `FilterResponseEvent`, use `ResponseEvent` instead - * removed `GetResponseEvent`, use `RequestEvent` instead - * removed `GetResponseForControllerResultEvent`, use `ViewEvent` instead - * removed `GetResponseForExceptionEvent`, use `ExceptionEvent` instead - * removed `PostResponseEvent`, use `TerminateEvent` instead - * removed `SaveSessionListener` in favor of `AbstractSessionListener` - * removed `Client`, use `HttpKernelBrowser` instead - * added method `getProjectDir()` to `KernelInterface` - * removed methods `serialize` and `unserialize` from `DataCollector`, store the serialized state in the data property instead - * made `ProfilerStorageInterface` internal - * removed the second and third argument of `KernelInterface::locateResource` - * removed the second and third argument of `FileLocator::__construct` - * removed loading resources from `%kernel.root_dir%/Resources` and `%kernel.root_dir%` as - fallback directories. - * removed class `ExceptionListener`, use `ErrorListener` instead - -4.4.0 ------ - - * The `DebugHandlersListener` class has been marked as `final` - * Added new Bundle directory convention consistent with standard skeletons - * Deprecated the second and third argument of `KernelInterface::locateResource` - * Deprecated the second and third argument of `FileLocator::__construct` - * Deprecated loading resources from `%kernel.root_dir%/Resources` and `%kernel.root_dir%` as - fallback directories. Resources like service definitions are usually loaded relative to the - current directory or with a glob pattern. The fallback directories have never been advocated - so you likely do not use those in any app based on the SF Standard or Flex edition. - * Marked all dispatched event classes as `@final` - * Added `ErrorController` to enable the preview and error rendering mechanism - * Getting the container from a non-booted kernel is deprecated. - * Marked the `AjaxDataCollector`, `ConfigDataCollector`, `EventDataCollector`, - `ExceptionDataCollector`, `LoggerDataCollector`, `MemoryDataCollector`, - `RequestDataCollector` and `TimeDataCollector` classes as `@final`. - * Marked the `RouterDataCollector::collect()` method as `@final`. - * The `DataCollectorInterface::collect()` and `Profiler::collect()` methods third parameter signature - will be `\Throwable $exception = null` instead of `\Exception $exception = null` in Symfony 5.0. - * Deprecated methods `ExceptionEvent::get/setException()`, use `get/setThrowable()` instead - * Deprecated class `ExceptionListener`, use `ErrorListener` instead - -4.3.0 ------ - - * renamed `Client` to `HttpKernelBrowser` - * `KernelInterface` doesn't extend `Serializable` anymore - * deprecated the `Kernel::serialize()` and `unserialize()` methods - * increased the priority of `Symfony\Component\HttpKernel\EventListener\AddRequestFormatsListener` - * made `Symfony\Component\HttpKernel\EventListener\LocaleListener` set the default locale early - * deprecated `TranslatorListener` in favor of `LocaleAwareListener` - * added the registration of all `LocaleAwareInterface` implementations into the `LocaleAwareListener` - * made `FileLinkFormatter` final and not implement `Serializable` anymore - * the base `DataCollector` doesn't implement `Serializable` anymore, you should - store all the serialized state in the data property instead - * `DumpDataCollector` has been marked as `final` - * added an event listener to prevent search engines from indexing applications in debug mode. - * renamed `FilterControllerArgumentsEvent` to `ControllerArgumentsEvent` - * renamed `FilterControllerEvent` to `ControllerEvent` - * renamed `FilterResponseEvent` to `ResponseEvent` - * renamed `GetResponseEvent` to `RequestEvent` - * renamed `GetResponseForControllerResultEvent` to `ViewEvent` - * renamed `GetResponseForExceptionEvent` to `ExceptionEvent` - * renamed `PostResponseEvent` to `TerminateEvent` - * added `HttpClientKernel` for handling requests with an `HttpClientInterface` instance - * added `trace_header` and `trace_level` configuration options to `HttpCache` - -4.2.0 ------ - - * deprecated `KernelInterface::getRootDir()` and the `kernel.root_dir` parameter - * deprecated `KernelInterface::getName()` and the `kernel.name` parameter - * deprecated the first and second constructor argument of `ConfigDataCollector` - * deprecated `ConfigDataCollector::getApplicationName()` - * deprecated `ConfigDataCollector::getApplicationVersion()` - -4.1.0 ------ - - * added orphaned events support to `EventDataCollector` - * `ExceptionListener` now logs exceptions at priority `0` (previously logged at `-128`) - * Added support for using `service::method` to reference controllers, making it consistent with other cases. It is recommended over the `service:action` syntax with a single colon, which will be deprecated in the future. - * Added the ability to profile individual argument value resolvers via the - `Symfony\Component\HttpKernel\Controller\ArgumentResolver\TraceableValueResolver` - -4.0.0 ------ - - * removed the `DataCollector::varToString()` method, use `DataCollector::cloneVar()` - instead - * using the `DataCollector::cloneVar()` method requires the VarDumper component - * removed the `ValueExporter` class - * removed `ControllerResolverInterface::getArguments()` - * removed `TraceableControllerResolver::getArguments()` - * removed `ControllerResolver::getArguments()` and the ability to resolve arguments - * removed the `argument_resolver` service dependency from the `debug.controller_resolver` - * removed `LazyLoadingFragmentHandler::addRendererService()` - * removed `Psr6CacheClearer::addPool()` - * removed `Extension::addClassesToCompile()` and `Extension::getClassesToCompile()` - * removed `Kernel::loadClassCache()`, `Kernel::doLoadClassCache()`, `Kernel::setClassCache()`, - and `Kernel::getEnvParameters()` - * support for the `X-Status-Code` when handling exceptions in the `HttpKernel` - has been dropped, use the `HttpKernel::allowCustomResponseCode()` method - instead - * removed convention-based commands registration - * removed the `ChainCacheClearer::add()` method - * removed the `CacheaWarmerAggregate::add()` and `setWarmers()` methods - * made `CacheWarmerAggregate` and `ChainCacheClearer` classes final - -3.4.0 ------ - - * added a minimalist PSR-3 `Logger` class that writes in `stderr` - * made kernels implementing `CompilerPassInterface` able to process the container - * deprecated bundle inheritance - * added `RebootableInterface` and implemented it in `Kernel` - * deprecated commands auto registration - * deprecated `EnvParametersResource` - * added `Symfony\Component\HttpKernel\Client::catchExceptions()` - * deprecated the `ChainCacheClearer::add()` method - * deprecated the `CacheaWarmerAggregate::add()` and `setWarmers()` methods - * made `CacheWarmerAggregate` and `ChainCacheClearer` classes final - * added the possibility to reset the profiler to its initial state - * deprecated data collectors without a `reset()` method - * deprecated implementing `DebugLoggerInterface` without a `clear()` method - -3.3.0 ------ - - * added `kernel.project_dir` and `Kernel::getProjectDir()` - * deprecated `kernel.root_dir` and `Kernel::getRootDir()` - * deprecated `Kernel::getEnvParameters()` - * deprecated the special `SYMFONY__` environment variables - * added the possibility to change the query string parameter used by `UriSigner` - * deprecated `LazyLoadingFragmentHandler::addRendererService()` - * deprecated `Extension::addClassesToCompile()` and `Extension::getClassesToCompile()` - * deprecated `Psr6CacheClearer::addPool()` - -3.2.0 ------ - - * deprecated `DataCollector::varToString()`, use `cloneVar()` instead - * changed surrogate capability name in `AbstractSurrogate::addSurrogateCapability` to 'symfony' - * Added `ControllerArgumentValueResolverPass` - -3.1.0 ------ - * deprecated passing objects as URI attributes to the ESI and SSI renderers - * deprecated `ControllerResolver::getArguments()` - * added `Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface` - * added `Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface` as argument to `HttpKernel` - * added `Symfony\Component\HttpKernel\Controller\ArgumentResolver` - * added `Symfony\Component\HttpKernel\DataCollector\RequestDataCollector::getMethod()` - * added `Symfony\Component\HttpKernel\DataCollector\RequestDataCollector::getRedirect()` - * added the `kernel.controller_arguments` event, triggered after controller arguments have been resolved - -3.0.0 ------ - - * removed `Symfony\Component\HttpKernel\Kernel::init()` - * removed `Symfony\Component\HttpKernel\Kernel::isClassInActiveBundle()` and `Symfony\Component\HttpKernel\KernelInterface::isClassInActiveBundle()` - * removed `Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher::setProfiler()` - * removed `Symfony\Component\HttpKernel\EventListener\FragmentListener::getLocalIpAddresses()` - * removed `Symfony\Component\HttpKernel\EventListener\LocaleListener::setRequest()` - * removed `Symfony\Component\HttpKernel\EventListener\RouterListener::setRequest()` - * removed `Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelRequest()` - * removed `Symfony\Component\HttpKernel\Fragment\FragmentHandler::setRequest()` - * removed `Symfony\Component\HttpKernel\HttpCache\Esi::hasSurrogateEsiCapability()` - * removed `Symfony\Component\HttpKernel\HttpCache\Esi::addSurrogateEsiCapability()` - * removed `Symfony\Component\HttpKernel\HttpCache\Esi::needsEsiParsing()` - * removed `Symfony\Component\HttpKernel\HttpCache\HttpCache::getEsi()` - * removed `Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel` - * removed `Symfony\Component\HttpKernel\DependencyInjection\RegisterListenersPass` - * removed `Symfony\Component\HttpKernel\EventListener\ErrorsLoggerListener` - * removed `Symfony\Component\HttpKernel\EventListener\EsiListener` - * removed `Symfony\Component\HttpKernel\HttpCache\EsiResponseCacheStrategy` - * removed `Symfony\Component\HttpKernel\HttpCache\EsiResponseCacheStrategyInterface` - * removed `Symfony\Component\HttpKernel\Log\LoggerInterface` - * removed `Symfony\Component\HttpKernel\Log\NullLogger` - * removed `Symfony\Component\HttpKernel\Profiler::import()` - * removed `Symfony\Component\HttpKernel\Profiler::export()` - -2.8.0 ------ - - * deprecated `Profiler::import` and `Profiler::export` - -2.7.0 ------ - - * added the HTTP status code to profiles - -2.6.0 ------ - - * deprecated `Symfony\Component\HttpKernel\EventListener\ErrorsLoggerListener`, use `Symfony\Component\HttpKernel\EventListener\DebugHandlersListener` instead - * deprecated unused method `Symfony\Component\HttpKernel\Kernel::isClassInActiveBundle` and `Symfony\Component\HttpKernel\KernelInterface::isClassInActiveBundle` - -2.5.0 ------ - - * deprecated `Symfony\Component\HttpKernel\DependencyInjection\RegisterListenersPass`, use `Symfony\Component\EventDispatcher\DependencyInjection\RegisterListenersPass` instead - -2.4.0 ------ - - * added event listeners for the session - * added the KernelEvents::FINISH_REQUEST event - -2.3.0 ------ - - * [BC BREAK] renamed `Symfony\Component\HttpKernel\EventListener\DeprecationLoggerListener` to `Symfony\Component\HttpKernel\EventListener\ErrorsLoggerListener` and changed its constructor - * deprecated `Symfony\Component\HttpKernel\Debug\ErrorHandler`, `Symfony\Component\HttpKernel\Debug\ExceptionHandler`, - `Symfony\Component\HttpKernel\Exception\FatalErrorException` and `Symfony\Component\HttpKernel\Exception\FlattenException` - * deprecated `Symfony\Component\HttpKernel\Kernel::init()` - * added the possibility to specify an id an extra attributes to hinclude tags - * added the collect of data if a controller is a Closure in the Request collector - * pass exceptions from the ExceptionListener to the logger using the logging context to allow for more - detailed messages - -2.2.0 ------ - - * [BC BREAK] the path info for sub-request is now always _fragment (or whatever you configured instead of the default) - * added Symfony\Component\HttpKernel\EventListener\FragmentListener - * added Symfony\Component\HttpKernel\UriSigner - * added Symfony\Component\HttpKernel\FragmentRenderer and rendering strategies (in Symfony\Component\HttpKernel\Fragment\FragmentRendererInterface) - * added Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel - * added ControllerReference to create reference of Controllers (used in the FragmentRenderer class) - * [BC BREAK] renamed TimeDataCollector::getTotalTime() to - TimeDataCollector::getDuration() - * updated the MemoryDataCollector to include the memory used in the - kernel.terminate event listeners - * moved the Stopwatch classes to a new component - * added TraceableControllerResolver - * added TraceableEventDispatcher (removed ContainerAwareTraceableEventDispatcher) - * added support for WinCache opcode cache in ConfigDataCollector - -2.1.0 ------ - - * [BC BREAK] the charset is now configured via the Kernel::getCharset() method - * [BC BREAK] the current locale for the user is not stored anymore in the session - * added the HTTP method to the profiler storage - * updated all listeners to implement EventSubscriberInterface - * added TimeDataCollector - * added ContainerAwareTraceableEventDispatcher - * moved TraceableEventDispatcherInterface to the EventDispatcher component - * added RouterListener, LocaleListener, and StreamedResponseListener - * added CacheClearerInterface (and ChainCacheClearer) - * added a kernel.terminate event (via TerminableInterface and PostResponseEvent) - * added a Stopwatch class - * added WarmableInterface - * improved extensibility between bundles - * added profiler storages for Memcache(d), File-based, MongoDB, Redis - * moved Filesystem class to its own component diff --git a/vendor/symfony/http-kernel/CacheClearer/CacheClearerInterface.php b/vendor/symfony/http-kernel/CacheClearer/CacheClearerInterface.php deleted file mode 100644 index 270f690e..00000000 --- a/vendor/symfony/http-kernel/CacheClearer/CacheClearerInterface.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\HttpKernel\CacheClearer; - -/** - * CacheClearerInterface. - * - * @author Dustin Dobervich - */ -interface CacheClearerInterface -{ - /** - * Clears any caches necessary. - */ - public function clear(string $cacheDir); -} diff --git a/vendor/symfony/http-kernel/CacheClearer/ChainCacheClearer.php b/vendor/symfony/http-kernel/CacheClearer/ChainCacheClearer.php deleted file mode 100644 index 8ce77e2b..00000000 --- a/vendor/symfony/http-kernel/CacheClearer/ChainCacheClearer.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\CacheClearer; - -/** - * ChainCacheClearer. - * - * @author Dustin Dobervich - * - * @final - */ -class ChainCacheClearer implements CacheClearerInterface -{ - private iterable $clearers; - - /** - * @param iterable $clearers - */ - public function __construct(iterable $clearers = []) - { - $this->clearers = $clearers; - } - - public function clear(string $cacheDir) - { - foreach ($this->clearers as $clearer) { - $clearer->clear($cacheDir); - } - } -} diff --git a/vendor/symfony/http-kernel/CacheClearer/Psr6CacheClearer.php b/vendor/symfony/http-kernel/CacheClearer/Psr6CacheClearer.php deleted file mode 100644 index 054f77bc..00000000 --- a/vendor/symfony/http-kernel/CacheClearer/Psr6CacheClearer.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\HttpKernel\CacheClearer; - -use Psr\Cache\CacheItemPoolInterface; - -/** - * @author Nicolas Grekas - */ -class Psr6CacheClearer implements CacheClearerInterface -{ - private array $pools = []; - - /** - * @param array $pools - */ - public function __construct(array $pools = []) - { - $this->pools = $pools; - } - - public function hasPool(string $name): bool - { - return isset($this->pools[$name]); - } - - /** - * @throws \InvalidArgumentException If the cache pool with the given name does not exist - */ - public function getPool(string $name): CacheItemPoolInterface - { - if (!$this->hasPool($name)) { - throw new \InvalidArgumentException(sprintf('Cache pool not found: "%s".', $name)); - } - - return $this->pools[$name]; - } - - /** - * @throws \InvalidArgumentException If the cache pool with the given name does not exist - */ - public function clearPool(string $name): bool - { - if (!isset($this->pools[$name])) { - throw new \InvalidArgumentException(sprintf('Cache pool not found: "%s".', $name)); - } - - return $this->pools[$name]->clear(); - } - - public function clear(string $cacheDir) - { - foreach ($this->pools as $pool) { - $pool->clear(); - } - } -} diff --git a/vendor/symfony/http-kernel/CacheWarmer/CacheWarmer.php b/vendor/symfony/http-kernel/CacheWarmer/CacheWarmer.php deleted file mode 100644 index aef42d62..00000000 --- a/vendor/symfony/http-kernel/CacheWarmer/CacheWarmer.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\HttpKernel\CacheWarmer; - -/** - * Abstract cache warmer that knows how to write a file to the cache. - * - * @author Fabien Potencier - */ -abstract class CacheWarmer implements CacheWarmerInterface -{ - protected function writeCacheFile(string $file, $content) - { - $tmpFile = @tempnam(\dirname($file), basename($file)); - if (false !== @file_put_contents($tmpFile, $content) && @rename($tmpFile, $file)) { - @chmod($file, 0666 & ~umask()); - - return; - } - - throw new \RuntimeException(sprintf('Failed to write cache file "%s".', $file)); - } -} diff --git a/vendor/symfony/http-kernel/CacheWarmer/CacheWarmerAggregate.php b/vendor/symfony/http-kernel/CacheWarmer/CacheWarmerAggregate.php deleted file mode 100644 index af0a2d13..00000000 --- a/vendor/symfony/http-kernel/CacheWarmer/CacheWarmerAggregate.php +++ /dev/null @@ -1,120 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\CacheWarmer; - -/** - * Aggregates several cache warmers into a single one. - * - * @author Fabien Potencier - * - * @final - */ -class CacheWarmerAggregate implements CacheWarmerInterface -{ - private iterable $warmers; - private bool $debug; - private ?string $deprecationLogsFilepath; - private bool $optionalsEnabled = false; - private bool $onlyOptionalsEnabled = false; - - /** - * @param iterable $warmers - */ - public function __construct(iterable $warmers = [], bool $debug = false, string $deprecationLogsFilepath = null) - { - $this->warmers = $warmers; - $this->debug = $debug; - $this->deprecationLogsFilepath = $deprecationLogsFilepath; - } - - public function enableOptionalWarmers() - { - $this->optionalsEnabled = true; - } - - public function enableOnlyOptionalWarmers() - { - $this->onlyOptionalsEnabled = $this->optionalsEnabled = true; - } - - public function warmUp(string $cacheDir): array - { - if ($collectDeprecations = $this->debug && !\defined('PHPUNIT_COMPOSER_INSTALL')) { - $collectedLogs = []; - $previousHandler = set_error_handler(function ($type, $message, $file, $line) use (&$collectedLogs, &$previousHandler) { - if (\E_USER_DEPRECATED !== $type && \E_DEPRECATED !== $type) { - return $previousHandler ? $previousHandler($type, $message, $file, $line) : false; - } - - if (isset($collectedLogs[$message])) { - ++$collectedLogs[$message]['count']; - - return null; - } - - $backtrace = debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS, 3); - // Clean the trace by removing first frames added by the error handler itself. - for ($i = 0; isset($backtrace[$i]); ++$i) { - if (isset($backtrace[$i]['file'], $backtrace[$i]['line']) && $backtrace[$i]['line'] === $line && $backtrace[$i]['file'] === $file) { - $backtrace = \array_slice($backtrace, 1 + $i); - break; - } - } - - $collectedLogs[$message] = [ - 'type' => $type, - 'message' => $message, - 'file' => $file, - 'line' => $line, - 'trace' => $backtrace, - 'count' => 1, - ]; - - return null; - }); - } - - $preload = []; - try { - foreach ($this->warmers as $warmer) { - if (!$this->optionalsEnabled && $warmer->isOptional()) { - continue; - } - if ($this->onlyOptionalsEnabled && !$warmer->isOptional()) { - continue; - } - - $preload[] = array_values((array) $warmer->warmUp($cacheDir)); - } - } finally { - if ($collectDeprecations) { - restore_error_handler(); - - if (is_file($this->deprecationLogsFilepath)) { - $previousLogs = unserialize(file_get_contents($this->deprecationLogsFilepath)); - if (\is_array($previousLogs)) { - $collectedLogs = array_merge($previousLogs, $collectedLogs); - } - } - - file_put_contents($this->deprecationLogsFilepath, serialize(array_values($collectedLogs))); - } - } - - return array_values(array_unique(array_merge([], ...$preload))); - } - - public function isOptional(): bool - { - return false; - } -} diff --git a/vendor/symfony/http-kernel/CacheWarmer/CacheWarmerInterface.php b/vendor/symfony/http-kernel/CacheWarmer/CacheWarmerInterface.php deleted file mode 100644 index 1f1740b7..00000000 --- a/vendor/symfony/http-kernel/CacheWarmer/CacheWarmerInterface.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\HttpKernel\CacheWarmer; - -/** - * Interface for classes able to warm up the cache. - * - * @author Fabien Potencier - */ -interface CacheWarmerInterface extends WarmableInterface -{ - /** - * Checks whether this warmer is optional or not. - * - * Optional warmers can be ignored on certain conditions. - * - * A warmer should return true if the cache can be - * generated incrementally and on-demand. - * - * @return bool - */ - public function isOptional(); -} diff --git a/vendor/symfony/http-kernel/CacheWarmer/WarmableInterface.php b/vendor/symfony/http-kernel/CacheWarmer/WarmableInterface.php deleted file mode 100644 index 2f442cb5..00000000 --- a/vendor/symfony/http-kernel/CacheWarmer/WarmableInterface.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\HttpKernel\CacheWarmer; - -/** - * Interface for classes that support warming their cache. - * - * @author Fabien Potencier - */ -interface WarmableInterface -{ - /** - * Warms up the cache. - * - * @return string[] A list of classes or files to preload on PHP 7.4+ - */ - public function warmUp(string $cacheDir); -} diff --git a/vendor/symfony/http-kernel/Config/FileLocator.php b/vendor/symfony/http-kernel/Config/FileLocator.php deleted file mode 100644 index f81f9192..00000000 --- a/vendor/symfony/http-kernel/Config/FileLocator.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\HttpKernel\Config; - -use Symfony\Component\Config\FileLocator as BaseFileLocator; -use Symfony\Component\HttpKernel\KernelInterface; - -/** - * FileLocator uses the KernelInterface to locate resources in bundles. - * - * @author Fabien Potencier - */ -class FileLocator extends BaseFileLocator -{ - private KernelInterface $kernel; - - public function __construct(KernelInterface $kernel) - { - $this->kernel = $kernel; - - parent::__construct(); - } - - public function locate(string $file, string $currentPath = null, bool $first = true): string|array - { - if (isset($file[0]) && '@' === $file[0]) { - $resource = $this->kernel->locateResource($file); - - return $first ? $resource : [$resource]; - } - - return parent::locate($file, $currentPath, $first); - } -} diff --git a/vendor/symfony/http-kernel/Controller/ArgumentResolver.php b/vendor/symfony/http-kernel/Controller/ArgumentResolver.php deleted file mode 100644 index 52ac2421..00000000 --- a/vendor/symfony/http-kernel/Controller/ArgumentResolver.php +++ /dev/null @@ -1,100 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Controller; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpKernel\Controller\ArgumentResolver\DefaultValueResolver; -use Symfony\Component\HttpKernel\Controller\ArgumentResolver\RequestAttributeValueResolver; -use Symfony\Component\HttpKernel\Controller\ArgumentResolver\RequestValueResolver; -use Symfony\Component\HttpKernel\Controller\ArgumentResolver\SessionValueResolver; -use Symfony\Component\HttpKernel\Controller\ArgumentResolver\TraceableValueResolver; -use Symfony\Component\HttpKernel\Controller\ArgumentResolver\VariadicValueResolver; -use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadataFactory; -use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadataFactoryInterface; - -/** - * Responsible for resolving the arguments passed to an action. - * - * @author Iltar van der Berg - */ -final class ArgumentResolver implements ArgumentResolverInterface -{ - private ArgumentMetadataFactoryInterface $argumentMetadataFactory; - private iterable $argumentValueResolvers; - - /** - * @param iterable $argumentValueResolvers - */ - public function __construct(ArgumentMetadataFactoryInterface $argumentMetadataFactory = null, iterable $argumentValueResolvers = []) - { - $this->argumentMetadataFactory = $argumentMetadataFactory ?? new ArgumentMetadataFactory(); - $this->argumentValueResolvers = $argumentValueResolvers ?: self::getDefaultArgumentValueResolvers(); - } - - public function getArguments(Request $request, callable $controller, \ReflectionFunctionAbstract $reflector = null): array - { - $arguments = []; - - foreach ($this->argumentMetadataFactory->createArgumentMetadata($controller, $reflector) as $metadata) { - foreach ($this->argumentValueResolvers as $resolver) { - if ((!$resolver instanceof ValueResolverInterface || $resolver instanceof TraceableValueResolver) && !$resolver->supports($request, $metadata)) { - continue; - } - - $count = 0; - foreach ($resolver->resolve($request, $metadata) as $argument) { - ++$count; - $arguments[] = $argument; - } - - if (1 < $count && !$metadata->isVariadic()) { - throw new \InvalidArgumentException(sprintf('"%s::resolve()" must yield at most one value for non-variadic arguments.', get_debug_type($resolver))); - } - - if ($count) { - // continue to the next controller argument - continue 2; - } - - if (!$resolver instanceof ValueResolverInterface) { - throw new \InvalidArgumentException(sprintf('"%s::resolve()" must yield at least one value.', get_debug_type($resolver))); - } - } - - $representative = $controller; - - if (\is_array($representative)) { - $representative = sprintf('%s::%s()', \get_class($representative[0]), $representative[1]); - } elseif (\is_object($representative)) { - $representative = get_debug_type($representative); - } - - throw new \RuntimeException(sprintf('Controller "%s" requires that you provide a value for the "$%s" argument. Either the argument is nullable and no null value has been provided, no default value has been provided or because there is a non optional argument after this one.', $representative, $metadata->getName())); - } - - return $arguments; - } - - /** - * @return iterable - */ - public static function getDefaultArgumentValueResolvers(): iterable - { - return [ - new RequestAttributeValueResolver(), - new RequestValueResolver(), - new SessionValueResolver(), - new DefaultValueResolver(), - new VariadicValueResolver(), - ]; - } -} diff --git a/vendor/symfony/http-kernel/Controller/ArgumentResolver/BackedEnumValueResolver.php b/vendor/symfony/http-kernel/Controller/ArgumentResolver/BackedEnumValueResolver.php deleted file mode 100644 index 4f0ca76d..00000000 --- a/vendor/symfony/http-kernel/Controller/ArgumentResolver/BackedEnumValueResolver.php +++ /dev/null @@ -1,93 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Controller\ArgumentResolver; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpKernel\Controller\ArgumentValueResolverInterface; -use Symfony\Component\HttpKernel\Controller\ValueResolverInterface; -use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata; -use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; - -/** - * Attempt to resolve backed enum cases from request attributes, for a route path parameter, - * leading to a 404 Not Found if the attribute value isn't a valid backing value for the enum type. - * - * @author Maxime Steinhausser - * - * @final since Symfony 6.2 - */ -class BackedEnumValueResolver implements ArgumentValueResolverInterface, ValueResolverInterface -{ - /** - * @deprecated since Symfony 6.2, use resolve() instead - */ - public function supports(Request $request, ArgumentMetadata $argument): bool - { - @trigger_deprecation('symfony/http-kernel', '6.2', 'The "%s()" method is deprecated, use "resolve()" instead.', __METHOD__); - - if (!is_subclass_of($argument->getType(), \BackedEnum::class)) { - return false; - } - - if ($argument->isVariadic()) { - // only target route path parameters, which cannot be variadic. - return false; - } - - // do not support if no value can be resolved at all - // letting the \Symfony\Component\HttpKernel\Controller\ArgumentResolver\DefaultValueResolver be used - // or \Symfony\Component\HttpKernel\Controller\ArgumentResolver fail with a meaningful error. - return $request->attributes->has($argument->getName()); - } - - public function resolve(Request $request, ArgumentMetadata $argument): iterable - { - if (!is_subclass_of($argument->getType(), \BackedEnum::class)) { - return []; - } - - if ($argument->isVariadic()) { - // only target route path parameters, which cannot be variadic. - return []; - } - - // do not support if no value can be resolved at all - // letting the \Symfony\Component\HttpKernel\Controller\ArgumentResolver\DefaultValueResolver be used - // or \Symfony\Component\HttpKernel\Controller\ArgumentResolver fail with a meaningful error. - if (!$request->attributes->has($argument->getName())) { - return []; - } - - $value = $request->attributes->get($argument->getName()); - - if (null === $value) { - return [null]; - } - - if ($value instanceof \BackedEnum) { - return [$value]; - } - - if (!\is_int($value) && !\is_string($value)) { - throw new \LogicException(sprintf('Could not resolve the "%s $%s" controller argument: expecting an int or string, got "%s".', $argument->getType(), $argument->getName(), get_debug_type($value))); - } - - /** @var class-string<\BackedEnum> $enumType */ - $enumType = $argument->getType(); - - try { - return [$enumType::from($value)]; - } catch (\ValueError $e) { - throw new NotFoundHttpException(sprintf('Could not resolve the "%s $%s" controller argument: ', $argument->getType(), $argument->getName()).$e->getMessage(), $e); - } - } -} diff --git a/vendor/symfony/http-kernel/Controller/ArgumentResolver/DateTimeValueResolver.php b/vendor/symfony/http-kernel/Controller/ArgumentResolver/DateTimeValueResolver.php deleted file mode 100644 index 8fd7015a..00000000 --- a/vendor/symfony/http-kernel/Controller/ArgumentResolver/DateTimeValueResolver.php +++ /dev/null @@ -1,86 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Controller\ArgumentResolver; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpKernel\Attribute\MapDateTime; -use Symfony\Component\HttpKernel\Controller\ArgumentValueResolverInterface; -use Symfony\Component\HttpKernel\Controller\ValueResolverInterface; -use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata; -use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; - -/** - * Convert DateTime instances from request attribute variable. - * - * @author Benjamin Eberlei - * @author Tim Goudriaan - */ -final class DateTimeValueResolver implements ArgumentValueResolverInterface, ValueResolverInterface -{ - /** - * @deprecated since Symfony 6.2, use resolve() instead - */ - public function supports(Request $request, ArgumentMetadata $argument): bool - { - @trigger_deprecation('symfony/http-kernel', '6.2', 'The "%s()" method is deprecated, use "resolve()" instead.', __METHOD__); - - return is_a($argument->getType(), \DateTimeInterface::class, true) && $request->attributes->has($argument->getName()); - } - - public function resolve(Request $request, ArgumentMetadata $argument): array - { - if (!is_a($argument->getType(), \DateTimeInterface::class, true) || !$request->attributes->has($argument->getName())) { - return []; - } - - $value = $request->attributes->get($argument->getName()); - $class = \DateTimeInterface::class === $argument->getType() ? \DateTimeImmutable::class : $argument->getType(); - - if ($value instanceof \DateTimeInterface) { - return [$value instanceof $class ? $value : $class::createFromInterface($value)]; - } - - if ($argument->isNullable() && !$value) { - return [null]; - } - - $format = null; - - if ($attributes = $argument->getAttributes(MapDateTime::class, ArgumentMetadata::IS_INSTANCEOF)) { - $attribute = $attributes[0]; - $format = $attribute->format; - } - - if (null !== $format) { - $date = $class::createFromFormat($format, $value); - - if (($class::getLastErrors() ?: ['warning_count' => 0])['warning_count']) { - $date = false; - } - } else { - if (false !== filter_var($value, \FILTER_VALIDATE_INT, ['options' => ['min_range' => 0]])) { - $value = '@'.$value; - } - try { - $date = new $class($value ?? 'now'); - } catch (\Exception) { - $date = false; - } - } - - if (!$date) { - throw new NotFoundHttpException(sprintf('Invalid date given for parameter "%s".', $argument->getName())); - } - - return [$date]; - } -} diff --git a/vendor/symfony/http-kernel/Controller/ArgumentResolver/DefaultValueResolver.php b/vendor/symfony/http-kernel/Controller/ArgumentResolver/DefaultValueResolver.php deleted file mode 100644 index eb9769c0..00000000 --- a/vendor/symfony/http-kernel/Controller/ArgumentResolver/DefaultValueResolver.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Controller\ArgumentResolver; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpKernel\Controller\ArgumentValueResolverInterface; -use Symfony\Component\HttpKernel\Controller\ValueResolverInterface; -use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata; - -/** - * Yields the default value defined in the action signature when no value has been given. - * - * @author Iltar van der Berg - */ -final class DefaultValueResolver implements ArgumentValueResolverInterface, ValueResolverInterface -{ - /** - * @deprecated since Symfony 6.2, use resolve() instead - */ - public function supports(Request $request, ArgumentMetadata $argument): bool - { - @trigger_deprecation('symfony/http-kernel', '6.2', 'The "%s()" method is deprecated, use "resolve()" instead.', __METHOD__); - - return $argument->hasDefaultValue() || (null !== $argument->getType() && $argument->isNullable() && !$argument->isVariadic()); - } - - public function resolve(Request $request, ArgumentMetadata $argument): array - { - if ($argument->hasDefaultValue()) { - return [$argument->getDefaultValue()]; - } - - if (null !== $argument->getType() && $argument->isNullable() && !$argument->isVariadic()) { - return [null]; - } - - return []; - } -} diff --git a/vendor/symfony/http-kernel/Controller/ArgumentResolver/NotTaggedControllerValueResolver.php b/vendor/symfony/http-kernel/Controller/ArgumentResolver/NotTaggedControllerValueResolver.php deleted file mode 100644 index 26403612..00000000 --- a/vendor/symfony/http-kernel/Controller/ArgumentResolver/NotTaggedControllerValueResolver.php +++ /dev/null @@ -1,90 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Controller\ArgumentResolver; - -use Psr\Container\ContainerInterface; -use Symfony\Component\DependencyInjection\Exception\RuntimeException; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpKernel\Controller\ArgumentValueResolverInterface; -use Symfony\Component\HttpKernel\Controller\ValueResolverInterface; -use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata; - -/** - * Provides an intuitive error message when controller fails because it is not registered as a service. - * - * @author Simeon Kolev - */ -final class NotTaggedControllerValueResolver implements ArgumentValueResolverInterface, ValueResolverInterface -{ - private ContainerInterface $container; - - public function __construct(ContainerInterface $container) - { - $this->container = $container; - } - - /** - * @deprecated since Symfony 6.2, use resolve() instead - */ - public function supports(Request $request, ArgumentMetadata $argument): bool - { - @trigger_deprecation('symfony/http-kernel', '6.2', 'The "%s()" method is deprecated, use "resolve()" instead.', __METHOD__); - - $controller = $request->attributes->get('_controller'); - - if (\is_array($controller) && \is_callable($controller, true) && \is_string($controller[0])) { - $controller = $controller[0].'::'.$controller[1]; - } elseif (!\is_string($controller) || '' === $controller) { - return false; - } - - if ('\\' === $controller[0]) { - $controller = ltrim($controller, '\\'); - } - - if (!$this->container->has($controller) && false !== $i = strrpos($controller, ':')) { - $controller = substr($controller, 0, $i).strtolower(substr($controller, $i)); - } - - return false === $this->container->has($controller); - } - - public function resolve(Request $request, ArgumentMetadata $argument): array - { - $controller = $request->attributes->get('_controller'); - - if (\is_array($controller) && \is_callable($controller, true) && \is_string($controller[0])) { - $controller = $controller[0].'::'.$controller[1]; - } elseif (!\is_string($controller) || '' === $controller) { - return []; - } - - if ('\\' === $controller[0]) { - $controller = ltrim($controller, '\\'); - } - - if (!$this->container->has($controller)) { - $controller = (false !== $i = strrpos($controller, ':')) - ? substr($controller, 0, $i).strtolower(substr($controller, $i)) - : $controller.'::__invoke'; - } - - if ($this->container->has($controller)) { - return []; - } - - $what = sprintf('argument $%s of "%s()"', $argument->getName(), $controller); - $message = sprintf('Could not resolve %s, maybe you forgot to register the controller as a service or missed tagging it with the "controller.service_arguments"?', $what); - - throw new RuntimeException($message); - } -} diff --git a/vendor/symfony/http-kernel/Controller/ArgumentResolver/RequestAttributeValueResolver.php b/vendor/symfony/http-kernel/Controller/ArgumentResolver/RequestAttributeValueResolver.php deleted file mode 100644 index 370e4144..00000000 --- a/vendor/symfony/http-kernel/Controller/ArgumentResolver/RequestAttributeValueResolver.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Controller\ArgumentResolver; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpKernel\Controller\ArgumentValueResolverInterface; -use Symfony\Component\HttpKernel\Controller\ValueResolverInterface; -use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata; - -/** - * Yields a non-variadic argument's value from the request attributes. - * - * @author Iltar van der Berg - */ -final class RequestAttributeValueResolver implements ArgumentValueResolverInterface, ValueResolverInterface -{ - /** - * @deprecated since Symfony 6.2, use resolve() instead - */ - public function supports(Request $request, ArgumentMetadata $argument): bool - { - @trigger_deprecation('symfony/http-kernel', '6.2', 'The "%s()" method is deprecated, use "resolve()" instead.', __METHOD__); - - return !$argument->isVariadic() && $request->attributes->has($argument->getName()); - } - - public function resolve(Request $request, ArgumentMetadata $argument): array - { - return !$argument->isVariadic() && $request->attributes->has($argument->getName()) ? [$request->attributes->get($argument->getName())] : []; - } -} diff --git a/vendor/symfony/http-kernel/Controller/ArgumentResolver/RequestValueResolver.php b/vendor/symfony/http-kernel/Controller/ArgumentResolver/RequestValueResolver.php deleted file mode 100644 index 6347f701..00000000 --- a/vendor/symfony/http-kernel/Controller/ArgumentResolver/RequestValueResolver.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Controller\ArgumentResolver; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpKernel\Controller\ArgumentValueResolverInterface; -use Symfony\Component\HttpKernel\Controller\ValueResolverInterface; -use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata; - -/** - * Yields the same instance as the request object passed along. - * - * @author Iltar van der Berg - */ -final class RequestValueResolver implements ArgumentValueResolverInterface, ValueResolverInterface -{ - /** - * @deprecated since Symfony 6.2, use resolve() instead - */ - public function supports(Request $request, ArgumentMetadata $argument): bool - { - @trigger_deprecation('symfony/http-kernel', '6.2', 'The "%s()" method is deprecated, use "resolve()" instead.', __METHOD__); - - return Request::class === $argument->getType() || is_subclass_of($argument->getType(), Request::class); - } - - public function resolve(Request $request, ArgumentMetadata $argument): array - { - return Request::class === $argument->getType() || is_subclass_of($argument->getType(), Request::class) ? [$request] : []; - } -} diff --git a/vendor/symfony/http-kernel/Controller/ArgumentResolver/ServiceValueResolver.php b/vendor/symfony/http-kernel/Controller/ArgumentResolver/ServiceValueResolver.php deleted file mode 100644 index 96e0337d..00000000 --- a/vendor/symfony/http-kernel/Controller/ArgumentResolver/ServiceValueResolver.php +++ /dev/null @@ -1,99 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Controller\ArgumentResolver; - -use Psr\Container\ContainerInterface; -use Symfony\Component\DependencyInjection\Exception\RuntimeException; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpKernel\Controller\ArgumentValueResolverInterface; -use Symfony\Component\HttpKernel\Controller\ValueResolverInterface; -use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata; - -/** - * Yields a service keyed by _controller and argument name. - * - * @author Nicolas Grekas - */ -final class ServiceValueResolver implements ArgumentValueResolverInterface, ValueResolverInterface -{ - private ContainerInterface $container; - - public function __construct(ContainerInterface $container) - { - $this->container = $container; - } - - /** - * @deprecated since Symfony 6.2, use resolve() instead - */ - public function supports(Request $request, ArgumentMetadata $argument): bool - { - @trigger_deprecation('symfony/http-kernel', '6.2', 'The "%s()" method is deprecated, use "resolve()" instead.', __METHOD__); - - $controller = $request->attributes->get('_controller'); - - if (\is_array($controller) && \is_callable($controller, true) && \is_string($controller[0])) { - $controller = $controller[0].'::'.$controller[1]; - } elseif (!\is_string($controller) || '' === $controller) { - return false; - } - - if ('\\' === $controller[0]) { - $controller = ltrim($controller, '\\'); - } - - if (!$this->container->has($controller) && false !== $i = strrpos($controller, ':')) { - $controller = substr($controller, 0, $i).strtolower(substr($controller, $i)); - } - - return $this->container->has($controller) && $this->container->get($controller)->has($argument->getName()); - } - - public function resolve(Request $request, ArgumentMetadata $argument): array - { - $controller = $request->attributes->get('_controller'); - - if (\is_array($controller) && \is_callable($controller, true) && \is_string($controller[0])) { - $controller = $controller[0].'::'.$controller[1]; - } elseif (!\is_string($controller) || '' === $controller) { - return []; - } - - if ('\\' === $controller[0]) { - $controller = ltrim($controller, '\\'); - } - - if (!$this->container->has($controller) && false !== $i = strrpos($controller, ':')) { - $controller = substr($controller, 0, $i).strtolower(substr($controller, $i)); - } - - if (!$this->container->has($controller) || !$this->container->get($controller)->has($argument->getName())) { - return []; - } - - try { - return [$this->container->get($controller)->get($argument->getName())]; - } catch (RuntimeException $e) { - $what = sprintf('argument $%s of "%s()"', $argument->getName(), $controller); - $message = preg_replace('/service "\.service_locator\.[^"]++"/', $what, $e->getMessage()); - - if ($e->getMessage() === $message) { - $message = sprintf('Cannot resolve %s: %s', $what, $message); - } - - $r = new \ReflectionProperty($e, 'message'); - $r->setValue($e, $message); - - throw $e; - } - } -} diff --git a/vendor/symfony/http-kernel/Controller/ArgumentResolver/SessionValueResolver.php b/vendor/symfony/http-kernel/Controller/ArgumentResolver/SessionValueResolver.php deleted file mode 100644 index c8e7575d..00000000 --- a/vendor/symfony/http-kernel/Controller/ArgumentResolver/SessionValueResolver.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Controller\ArgumentResolver; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Session\SessionInterface; -use Symfony\Component\HttpKernel\Controller\ArgumentValueResolverInterface; -use Symfony\Component\HttpKernel\Controller\ValueResolverInterface; -use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata; - -/** - * Yields the Session. - * - * @author Iltar van der Berg - */ -final class SessionValueResolver implements ArgumentValueResolverInterface, ValueResolverInterface -{ - /** - * @deprecated since Symfony 6.2, use resolve() instead - */ - public function supports(Request $request, ArgumentMetadata $argument): bool - { - @trigger_deprecation('symfony/http-kernel', '6.2', 'The "%s()" method is deprecated, use "resolve()" instead.', __METHOD__); - - if (!$request->hasSession()) { - return false; - } - - $type = $argument->getType(); - if (SessionInterface::class !== $type && !is_subclass_of($type, SessionInterface::class)) { - return false; - } - - return $request->getSession() instanceof $type; - } - - public function resolve(Request $request, ArgumentMetadata $argument): array - { - if (!$request->hasSession()) { - return []; - } - - $type = $argument->getType(); - if (SessionInterface::class !== $type && !is_subclass_of($type, SessionInterface::class)) { - return []; - } - - return $request->getSession() instanceof $type ? [$request->getSession()] : []; - } -} diff --git a/vendor/symfony/http-kernel/Controller/ArgumentResolver/TraceableValueResolver.php b/vendor/symfony/http-kernel/Controller/ArgumentResolver/TraceableValueResolver.php deleted file mode 100644 index edc30e18..00000000 --- a/vendor/symfony/http-kernel/Controller/ArgumentResolver/TraceableValueResolver.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\HttpKernel\Controller\ArgumentResolver; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpKernel\Controller\ArgumentValueResolverInterface; -use Symfony\Component\HttpKernel\Controller\ValueResolverInterface; -use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata; -use Symfony\Component\Stopwatch\Stopwatch; - -/** - * Provides timing information via the stopwatch. - * - * @author Iltar van der Berg - */ -final class TraceableValueResolver implements ArgumentValueResolverInterface, ValueResolverInterface -{ - private ArgumentValueResolverInterface|ValueResolverInterface $inner; - private Stopwatch $stopwatch; - - public function __construct(ArgumentValueResolverInterface|ValueResolverInterface $inner, Stopwatch $stopwatch) - { - $this->inner = $inner; - $this->stopwatch = $stopwatch; - } - - /** - * @deprecated since Symfony 6.2, use resolve() instead - */ - public function supports(Request $request, ArgumentMetadata $argument): bool - { - if ($this->inner instanceof ValueResolverInterface) { - return true; - } - - $method = \get_class($this->inner).'::'.__FUNCTION__; - $this->stopwatch->start($method, 'controller.argument_value_resolver'); - - $return = $this->inner->supports($request, $argument); - - $this->stopwatch->stop($method); - - return $return; - } - - public function resolve(Request $request, ArgumentMetadata $argument): iterable - { - $method = \get_class($this->inner).'::'.__FUNCTION__; - $this->stopwatch->start($method, 'controller.argument_value_resolver'); - - yield from $this->inner->resolve($request, $argument); - - $this->stopwatch->stop($method); - } -} diff --git a/vendor/symfony/http-kernel/Controller/ArgumentResolver/UidValueResolver.php b/vendor/symfony/http-kernel/Controller/ArgumentResolver/UidValueResolver.php deleted file mode 100644 index 437b770a..00000000 --- a/vendor/symfony/http-kernel/Controller/ArgumentResolver/UidValueResolver.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\HttpKernel\Controller\ArgumentResolver; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpKernel\Controller\ArgumentValueResolverInterface; -use Symfony\Component\HttpKernel\Controller\ValueResolverInterface; -use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata; -use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; -use Symfony\Component\Uid\AbstractUid; - -final class UidValueResolver implements ArgumentValueResolverInterface, ValueResolverInterface -{ - /** - * @deprecated since Symfony 6.2, use resolve() instead - */ - public function supports(Request $request, ArgumentMetadata $argument): bool - { - @trigger_deprecation('symfony/http-kernel', '6.2', 'The "%s()" method is deprecated, use "resolve()" instead.', __METHOD__); - - return !$argument->isVariadic() - && \is_string($request->attributes->get($argument->getName())) - && null !== $argument->getType() - && is_subclass_of($argument->getType(), AbstractUid::class, true); - } - - public function resolve(Request $request, ArgumentMetadata $argument): array - { - if ($argument->isVariadic() - || !\is_string($value = $request->attributes->get($argument->getName())) - || null === ($uidClass = $argument->getType()) - || !is_subclass_of($argument->getType(), AbstractUid::class, true) - ) { - return []; - } - - /* @var class-string $uidClass */ - try { - return [$uidClass::fromString($value)]; - } catch (\InvalidArgumentException $e) { - throw new NotFoundHttpException(sprintf('The uid for the "%s" parameter is invalid.', $argument->getName()), $e); - } - } -} diff --git a/vendor/symfony/http-kernel/Controller/ArgumentResolver/VariadicValueResolver.php b/vendor/symfony/http-kernel/Controller/ArgumentResolver/VariadicValueResolver.php deleted file mode 100644 index 4f6cba72..00000000 --- a/vendor/symfony/http-kernel/Controller/ArgumentResolver/VariadicValueResolver.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Controller\ArgumentResolver; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpKernel\Controller\ArgumentValueResolverInterface; -use Symfony\Component\HttpKernel\Controller\ValueResolverInterface; -use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata; - -/** - * Yields a variadic argument's values from the request attributes. - * - * @author Iltar van der Berg - */ -final class VariadicValueResolver implements ArgumentValueResolverInterface, ValueResolverInterface -{ - /** - * @deprecated since Symfony 6.2, use resolve() instead - */ - public function supports(Request $request, ArgumentMetadata $argument): bool - { - @trigger_deprecation('symfony/http-kernel', '6.2', 'The "%s()" method is deprecated, use "resolve()" instead.', __METHOD__); - - return $argument->isVariadic() && $request->attributes->has($argument->getName()); - } - - public function resolve(Request $request, ArgumentMetadata $argument): array - { - if (!$argument->isVariadic() || !$request->attributes->has($argument->getName())) { - return []; - } - - $values = $request->attributes->get($argument->getName()); - - if (!\is_array($values)) { - throw new \InvalidArgumentException(sprintf('The action argument "...$%1$s" is required to be an array, the request attribute "%1$s" contains a type of "%2$s" instead.', $argument->getName(), get_debug_type($values))); - } - - return $values; - } -} diff --git a/vendor/symfony/http-kernel/Controller/ArgumentResolverInterface.php b/vendor/symfony/http-kernel/Controller/ArgumentResolverInterface.php deleted file mode 100644 index 33d3ce29..00000000 --- a/vendor/symfony/http-kernel/Controller/ArgumentResolverInterface.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\HttpKernel\Controller; - -use Symfony\Component\HttpFoundation\Request; - -/** - * An ArgumentResolverInterface instance knows how to determine the - * arguments for a specific action. - * - * @author Fabien Potencier - */ -interface ArgumentResolverInterface -{ - /** - * Returns the arguments to pass to the controller. - * - * @param \ReflectionFunctionAbstract|null $reflector - * - * @throws \RuntimeException When no value could be provided for a required argument - */ - public function getArguments(Request $request, callable $controller/* , \ReflectionFunctionAbstract $reflector = null */): array; -} diff --git a/vendor/symfony/http-kernel/Controller/ArgumentValueResolverInterface.php b/vendor/symfony/http-kernel/Controller/ArgumentValueResolverInterface.php deleted file mode 100644 index 9c3b1a01..00000000 --- a/vendor/symfony/http-kernel/Controller/ArgumentValueResolverInterface.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Controller; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata; - -/** - * Responsible for resolving the value of an argument based on its metadata. - * - * @author Iltar van der Berg - * - * @deprecated since Symfony 6.2, implement ValueResolverInterface instead - */ -interface ArgumentValueResolverInterface -{ - /** - * Whether this resolver can resolve the value for the given ArgumentMetadata. - */ - public function supports(Request $request, ArgumentMetadata $argument): bool; - - /** - * Returns the possible value(s). - */ - public function resolve(Request $request, ArgumentMetadata $argument): iterable; -} diff --git a/vendor/symfony/http-kernel/Controller/ContainerControllerResolver.php b/vendor/symfony/http-kernel/Controller/ContainerControllerResolver.php deleted file mode 100644 index 6930738a..00000000 --- a/vendor/symfony/http-kernel/Controller/ContainerControllerResolver.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\HttpKernel\Controller; - -use Psr\Container\ContainerInterface; -use Psr\Log\LoggerInterface; -use Symfony\Component\DependencyInjection\Container; - -/** - * A controller resolver searching for a controller in a psr-11 container when using the "service::method" notation. - * - * @author Fabien Potencier - * @author Maxime Steinhausser - */ -class ContainerControllerResolver extends ControllerResolver -{ - protected $container; - - public function __construct(ContainerInterface $container, LoggerInterface $logger = null) - { - $this->container = $container; - - parent::__construct($logger); - } - - protected function instantiateController(string $class): object - { - $class = ltrim($class, '\\'); - - if ($this->container->has($class)) { - return $this->container->get($class); - } - - try { - return parent::instantiateController($class); - } catch (\Error $e) { - } - - $this->throwExceptionIfControllerWasRemoved($class, $e); - - if ($e instanceof \ArgumentCountError) { - throw new \InvalidArgumentException(sprintf('Controller "%s" has required constructor arguments and does not exist in the container. Did you forget to define the controller as a service?', $class), 0, $e); - } - - throw new \InvalidArgumentException(sprintf('Controller "%s" does neither exist as service nor as class.', $class), 0, $e); - } - - private function throwExceptionIfControllerWasRemoved(string $controller, \Throwable $previous) - { - if ($this->container instanceof Container && isset($this->container->getRemovedIds()[$controller])) { - throw new \InvalidArgumentException(sprintf('Controller "%s" cannot be fetched from the container because it is private. Did you forget to tag the service with "controller.service_arguments"?', $controller), 0, $previous); - } - } -} diff --git a/vendor/symfony/http-kernel/Controller/ControllerReference.php b/vendor/symfony/http-kernel/Controller/ControllerReference.php deleted file mode 100644 index b4fdadd2..00000000 --- a/vendor/symfony/http-kernel/Controller/ControllerReference.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Controller; - -use Symfony\Component\HttpKernel\Fragment\FragmentRendererInterface; - -/** - * Acts as a marker and a data holder for a Controller. - * - * Some methods in Symfony accept both a URI (as a string) or a controller as - * an argument. In the latter case, instead of passing an array representing - * the controller, you can use an instance of this class. - * - * @author Fabien Potencier - * - * @see FragmentRendererInterface - */ -class ControllerReference -{ - public $controller; - public $attributes = []; - public $query = []; - - /** - * @param string $controller The controller name - * @param array $attributes An array of parameters to add to the Request attributes - * @param array $query An array of parameters to add to the Request query string - */ - public function __construct(string $controller, array $attributes = [], array $query = []) - { - $this->controller = $controller; - $this->attributes = $attributes; - $this->query = $query; - } -} diff --git a/vendor/symfony/http-kernel/Controller/ControllerResolver.php b/vendor/symfony/http-kernel/Controller/ControllerResolver.php deleted file mode 100644 index 4a08041f..00000000 --- a/vendor/symfony/http-kernel/Controller/ControllerResolver.php +++ /dev/null @@ -1,204 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Controller; - -use Psr\Log\LoggerInterface; -use Symfony\Component\HttpFoundation\Request; - -/** - * This implementation uses the '_controller' request attribute to determine - * the controller to execute. - * - * @author Fabien Potencier - * @author Tobias Schultze - */ -class ControllerResolver implements ControllerResolverInterface -{ - private ?LoggerInterface $logger; - - public function __construct(LoggerInterface $logger = null) - { - $this->logger = $logger; - } - - public function getController(Request $request): callable|false - { - if (!$controller = $request->attributes->get('_controller')) { - $this->logger?->warning('Unable to look for the controller as the "_controller" parameter is missing.'); - - return false; - } - - if (\is_array($controller)) { - if (isset($controller[0]) && \is_string($controller[0]) && isset($controller[1])) { - try { - $controller[0] = $this->instantiateController($controller[0]); - } catch (\Error|\LogicException $e) { - if (\is_callable($controller)) { - return $controller; - } - - throw $e; - } - } - - if (!\is_callable($controller)) { - throw new \InvalidArgumentException(sprintf('The controller for URI "%s" is not callable: ', $request->getPathInfo()).$this->getControllerError($controller)); - } - - return $controller; - } - - if (\is_object($controller)) { - if (!\is_callable($controller)) { - throw new \InvalidArgumentException(sprintf('The controller for URI "%s" is not callable: ', $request->getPathInfo()).$this->getControllerError($controller)); - } - - return $controller; - } - - if (\function_exists($controller)) { - return $controller; - } - - try { - $callable = $this->createController($controller); - } catch (\InvalidArgumentException $e) { - throw new \InvalidArgumentException(sprintf('The controller for URI "%s" is not callable: ', $request->getPathInfo()).$e->getMessage(), 0, $e); - } - - if (!\is_callable($callable)) { - throw new \InvalidArgumentException(sprintf('The controller for URI "%s" is not callable: ', $request->getPathInfo()).$this->getControllerError($callable)); - } - - return $callable; - } - - /** - * Returns a callable for the given controller. - * - * @throws \InvalidArgumentException When the controller cannot be created - */ - protected function createController(string $controller): callable - { - if (!str_contains($controller, '::')) { - $controller = $this->instantiateController($controller); - - if (!\is_callable($controller)) { - throw new \InvalidArgumentException($this->getControllerError($controller)); - } - - return $controller; - } - - [$class, $method] = explode('::', $controller, 2); - - try { - $controller = [$this->instantiateController($class), $method]; - } catch (\Error|\LogicException $e) { - try { - if ((new \ReflectionMethod($class, $method))->isStatic()) { - return $class.'::'.$method; - } - } catch (\ReflectionException) { - throw $e; - } - - throw $e; - } - - if (!\is_callable($controller)) { - throw new \InvalidArgumentException($this->getControllerError($controller)); - } - - return $controller; - } - - /** - * Returns an instantiated controller. - */ - protected function instantiateController(string $class): object - { - return new $class(); - } - - private function getControllerError(mixed $callable): string - { - if (\is_string($callable)) { - if (str_contains($callable, '::')) { - $callable = explode('::', $callable, 2); - } else { - return sprintf('Function "%s" does not exist.', $callable); - } - } - - if (\is_object($callable)) { - $availableMethods = $this->getClassMethodsWithoutMagicMethods($callable); - $alternativeMsg = $availableMethods ? sprintf(' or use one of the available methods: "%s"', implode('", "', $availableMethods)) : ''; - - return sprintf('Controller class "%s" cannot be called without a method name. You need to implement "__invoke"%s.', get_debug_type($callable), $alternativeMsg); - } - - if (!\is_array($callable)) { - return sprintf('Invalid type for controller given, expected string, array or object, got "%s".', get_debug_type($callable)); - } - - if (!isset($callable[0]) || !isset($callable[1]) || 2 !== \count($callable)) { - return 'Invalid array callable, expected [controller, method].'; - } - - [$controller, $method] = $callable; - - if (\is_string($controller) && !class_exists($controller)) { - return sprintf('Class "%s" does not exist.', $controller); - } - - $className = \is_object($controller) ? get_debug_type($controller) : $controller; - - if (method_exists($controller, $method)) { - return sprintf('Method "%s" on class "%s" should be public and non-abstract.', $method, $className); - } - - $collection = $this->getClassMethodsWithoutMagicMethods($controller); - - $alternatives = []; - - foreach ($collection as $item) { - $lev = levenshtein($method, $item); - - if ($lev <= \strlen($method) / 3 || str_contains($item, $method)) { - $alternatives[] = $item; - } - } - - asort($alternatives); - - $message = sprintf('Expected method "%s" on class "%s"', $method, $className); - - if (\count($alternatives) > 0) { - $message .= sprintf(', did you mean "%s"?', implode('", "', $alternatives)); - } else { - $message .= sprintf('. Available methods: "%s".', implode('", "', $collection)); - } - - return $message; - } - - private function getClassMethodsWithoutMagicMethods($classOrObject): array - { - $methods = get_class_methods($classOrObject); - - return array_filter($methods, function (string $method) { - return 0 !== strncmp($method, '__', 2); - }); - } -} diff --git a/vendor/symfony/http-kernel/Controller/ControllerResolverInterface.php b/vendor/symfony/http-kernel/Controller/ControllerResolverInterface.php deleted file mode 100644 index 6cfe6c35..00000000 --- a/vendor/symfony/http-kernel/Controller/ControllerResolverInterface.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Controller; - -use Symfony\Component\HttpFoundation\Request; - -/** - * A ControllerResolverInterface implementation knows how to determine the - * controller to execute based on a Request object. - * - * A Controller can be any valid PHP callable. - * - * @author Fabien Potencier - */ -interface ControllerResolverInterface -{ - /** - * Returns the Controller instance associated with a Request. - * - * As several resolvers can exist for a single application, a resolver must - * return false when it is not able to determine the controller. - * - * The resolver must only throw an exception when it should be able to load a - * controller but cannot because of some errors made by the developer. - * - * @return callable|false A PHP callable representing the Controller, - * or false if this resolver is not able to determine the controller - * - * @throws \LogicException If a controller was found based on the request but it is not callable - */ - public function getController(Request $request): callable|false; -} diff --git a/vendor/symfony/http-kernel/Controller/ErrorController.php b/vendor/symfony/http-kernel/Controller/ErrorController.php deleted file mode 100644 index 9dd21168..00000000 --- a/vendor/symfony/http-kernel/Controller/ErrorController.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\HttpKernel\Controller; - -use Symfony\Component\ErrorHandler\ErrorRenderer\ErrorRendererInterface; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\Exception\HttpException; -use Symfony\Component\HttpKernel\HttpKernelInterface; - -/** - * Renders error or exception pages from a given FlattenException. - * - * @author Yonel Ceruto - * @author Matthias Pigulla - */ -class ErrorController -{ - private HttpKernelInterface $kernel; - private string|object|array|null $controller; - private ErrorRendererInterface $errorRenderer; - - public function __construct(HttpKernelInterface $kernel, string|object|array|null $controller, ErrorRendererInterface $errorRenderer) - { - $this->kernel = $kernel; - $this->controller = $controller; - $this->errorRenderer = $errorRenderer; - } - - public function __invoke(\Throwable $exception): Response - { - $exception = $this->errorRenderer->render($exception); - - return new Response($exception->getAsString(), $exception->getStatusCode(), $exception->getHeaders()); - } - - public function preview(Request $request, int $code): Response - { - /* - * This Request mimics the parameters set by - * \Symfony\Component\HttpKernel\EventListener\ErrorListener::duplicateRequest, with - * the additional "showException" flag. - */ - $subRequest = $request->duplicate(null, null, [ - '_controller' => $this->controller, - 'exception' => new HttpException($code, 'This is a sample exception.'), - 'logger' => null, - 'showException' => false, - ]); - - return $this->kernel->handle($subRequest, HttpKernelInterface::SUB_REQUEST); - } -} diff --git a/vendor/symfony/http-kernel/Controller/TraceableArgumentResolver.php b/vendor/symfony/http-kernel/Controller/TraceableArgumentResolver.php deleted file mode 100644 index 63429e33..00000000 --- a/vendor/symfony/http-kernel/Controller/TraceableArgumentResolver.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Controller; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\Stopwatch\Stopwatch; - -/** - * @author Fabien Potencier - */ -class TraceableArgumentResolver implements ArgumentResolverInterface -{ - private ArgumentResolverInterface $resolver; - private Stopwatch $stopwatch; - - public function __construct(ArgumentResolverInterface $resolver, Stopwatch $stopwatch) - { - $this->resolver = $resolver; - $this->stopwatch = $stopwatch; - } - - /** - * @param \ReflectionFunctionAbstract|null $reflector - */ - public function getArguments(Request $request, callable $controller/* , \ReflectionFunctionAbstract $reflector = null */): array - { - $reflector = 2 < \func_num_args() ? func_get_arg(2) : null; - $e = $this->stopwatch->start('controller.get_arguments'); - - $ret = $this->resolver->getArguments($request, $controller, $reflector); - - $e->stop(); - - return $ret; - } -} diff --git a/vendor/symfony/http-kernel/Controller/TraceableControllerResolver.php b/vendor/symfony/http-kernel/Controller/TraceableControllerResolver.php deleted file mode 100644 index 9e985139..00000000 --- a/vendor/symfony/http-kernel/Controller/TraceableControllerResolver.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Controller; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\Stopwatch\Stopwatch; - -/** - * @author Fabien Potencier - */ -class TraceableControllerResolver implements ControllerResolverInterface -{ - private ControllerResolverInterface $resolver; - private Stopwatch $stopwatch; - - public function __construct(ControllerResolverInterface $resolver, Stopwatch $stopwatch) - { - $this->resolver = $resolver; - $this->stopwatch = $stopwatch; - } - - public function getController(Request $request): callable|false - { - $e = $this->stopwatch->start('controller.get_callable'); - - $ret = $this->resolver->getController($request); - - $e->stop(); - - return $ret; - } -} diff --git a/vendor/symfony/http-kernel/Controller/ValueResolverInterface.php b/vendor/symfony/http-kernel/Controller/ValueResolverInterface.php deleted file mode 100644 index a861705c..00000000 --- a/vendor/symfony/http-kernel/Controller/ValueResolverInterface.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\HttpKernel\Controller; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata; - -/** - * Responsible for resolving the value of an argument based on its metadata. - * - * @author Nicolas Grekas - */ -interface ValueResolverInterface -{ - /** - * Returns the possible value(s). - */ - public function resolve(Request $request, ArgumentMetadata $argument): iterable; -} diff --git a/vendor/symfony/http-kernel/ControllerMetadata/ArgumentMetadata.php b/vendor/symfony/http-kernel/ControllerMetadata/ArgumentMetadata.php deleted file mode 100644 index a352090e..00000000 --- a/vendor/symfony/http-kernel/ControllerMetadata/ArgumentMetadata.php +++ /dev/null @@ -1,145 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\ControllerMetadata; - -/** - * Responsible for storing metadata of an argument. - * - * @author Iltar van der Berg - */ -class ArgumentMetadata -{ - public const IS_INSTANCEOF = 2; - - private string $name; - private ?string $type; - private bool $isVariadic; - private bool $hasDefaultValue; - private mixed $defaultValue; - private bool $isNullable; - private array $attributes; - - /** - * @param object[] $attributes - */ - public function __construct(string $name, ?string $type, bool $isVariadic, bool $hasDefaultValue, mixed $defaultValue, bool $isNullable = false, array $attributes = []) - { - $this->name = $name; - $this->type = $type; - $this->isVariadic = $isVariadic; - $this->hasDefaultValue = $hasDefaultValue; - $this->defaultValue = $defaultValue; - $this->isNullable = $isNullable || null === $type || ($hasDefaultValue && null === $defaultValue); - $this->attributes = $attributes; - } - - /** - * Returns the name as given in PHP, $foo would yield "foo". - */ - public function getName(): string - { - return $this->name; - } - - /** - * Returns the type of the argument. - * - * The type is the PHP class in 5.5+ and additionally the basic type in PHP 7.0+. - */ - public function getType(): ?string - { - return $this->type; - } - - /** - * Returns whether the argument is defined as "...$variadic". - */ - public function isVariadic(): bool - { - return $this->isVariadic; - } - - /** - * Returns whether the argument has a default value. - * - * Implies whether an argument is optional. - */ - public function hasDefaultValue(): bool - { - return $this->hasDefaultValue; - } - - /** - * Returns whether the argument accepts null values. - */ - public function isNullable(): bool - { - return $this->isNullable; - } - - /** - * Returns the default value of the argument. - * - * @throws \LogicException if no default value is present; {@see self::hasDefaultValue()} - */ - public function getDefaultValue(): mixed - { - if (!$this->hasDefaultValue) { - throw new \LogicException(sprintf('Argument $%s does not have a default value. Use "%s::hasDefaultValue()" to avoid this exception.', $this->name, __CLASS__)); - } - - return $this->defaultValue; - } - - /** - * @param class-string $name - * @param self::IS_INSTANCEOF|0 $flags - * - * @return array - */ - public function getAttributes(string $name = null, int $flags = 0): array - { - if (!$name) { - return $this->attributes; - } - - return $this->getAttributesOfType($name, $flags); - } - - /** - * @template T of object - * - * @param class-string $name - * @param self::IS_INSTANCEOF|0 $flags - * - * @return array - */ - public function getAttributesOfType(string $name, int $flags = 0): array - { - $attributes = []; - if ($flags & self::IS_INSTANCEOF) { - foreach ($this->attributes as $attribute) { - if ($attribute instanceof $name) { - $attributes[] = $attribute; - } - } - } else { - foreach ($this->attributes as $attribute) { - if ($attribute::class === $name) { - $attributes[] = $attribute; - } - } - } - - return $attributes; - } -} diff --git a/vendor/symfony/http-kernel/ControllerMetadata/ArgumentMetadataFactory.php b/vendor/symfony/http-kernel/ControllerMetadata/ArgumentMetadataFactory.php deleted file mode 100644 index cb7f0a78..00000000 --- a/vendor/symfony/http-kernel/ControllerMetadata/ArgumentMetadataFactory.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\HttpKernel\ControllerMetadata; - -/** - * Builds {@see ArgumentMetadata} objects based on the given Controller. - * - * @author Iltar van der Berg - */ -final class ArgumentMetadataFactory implements ArgumentMetadataFactoryInterface -{ - public function createArgumentMetadata(string|object|array $controller, \ReflectionFunctionAbstract $reflector = null): array - { - $arguments = []; - $reflector ??= new \ReflectionFunction($controller(...)); - - foreach ($reflector->getParameters() as $param) { - $attributes = []; - foreach ($param->getAttributes() as $reflectionAttribute) { - if (class_exists($reflectionAttribute->getName())) { - $attributes[] = $reflectionAttribute->newInstance(); - } - } - - $arguments[] = new ArgumentMetadata($param->getName(), $this->getType($param), $param->isVariadic(), $param->isDefaultValueAvailable(), $param->isDefaultValueAvailable() ? $param->getDefaultValue() : null, $param->allowsNull(), $attributes); - } - - return $arguments; - } - - /** - * Returns an associated type to the given parameter if available. - */ - private function getType(\ReflectionParameter $parameter): ?string - { - if (!$type = $parameter->getType()) { - return null; - } - $name = $type instanceof \ReflectionNamedType ? $type->getName() : (string) $type; - - return match (strtolower($name)) { - 'self' => $parameter->getDeclaringClass()?->name, - 'parent' => get_parent_class($parameter->getDeclaringClass()?->name ?? '') ?: null, - default => $name, - }; - } -} diff --git a/vendor/symfony/http-kernel/ControllerMetadata/ArgumentMetadataFactoryInterface.php b/vendor/symfony/http-kernel/ControllerMetadata/ArgumentMetadataFactoryInterface.php deleted file mode 100644 index 954f901e..00000000 --- a/vendor/symfony/http-kernel/ControllerMetadata/ArgumentMetadataFactoryInterface.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\HttpKernel\ControllerMetadata; - -/** - * Builds method argument data. - * - * @author Iltar van der Berg - */ -interface ArgumentMetadataFactoryInterface -{ - /** - * @param \ReflectionFunctionAbstract|null $reflector - * - * @return ArgumentMetadata[] - */ - public function createArgumentMetadata(string|object|array $controller/* , \ReflectionFunctionAbstract $reflector = null */): array; -} diff --git a/vendor/symfony/http-kernel/DataCollector/AjaxDataCollector.php b/vendor/symfony/http-kernel/DataCollector/AjaxDataCollector.php deleted file mode 100644 index fda6a4ea..00000000 --- a/vendor/symfony/http-kernel/DataCollector/AjaxDataCollector.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\DataCollector; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; - -/** - * @author Bart van den Burg - * - * @final - */ -class AjaxDataCollector extends DataCollector -{ - public function collect(Request $request, Response $response, \Throwable $exception = null) - { - // all collecting is done client side - } - - public function reset() - { - // all collecting is done client side - } - - public function getName(): string - { - return 'ajax'; - } -} diff --git a/vendor/symfony/http-kernel/DataCollector/ConfigDataCollector.php b/vendor/symfony/http-kernel/DataCollector/ConfigDataCollector.php deleted file mode 100644 index d489b023..00000000 --- a/vendor/symfony/http-kernel/DataCollector/ConfigDataCollector.php +++ /dev/null @@ -1,263 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\DataCollector; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\Kernel; -use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\VarDumper\Caster\ClassStub; - -/** - * @author Fabien Potencier - * - * @final - */ -class ConfigDataCollector extends DataCollector implements LateDataCollectorInterface -{ - private KernelInterface $kernel; - - /** - * Sets the Kernel associated with this Request. - */ - public function setKernel(KernelInterface $kernel = null) - { - if (1 > \func_num_args()) { - trigger_deprecation('symfony/http-kernel', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); - } - - $this->kernel = $kernel; - } - - public function collect(Request $request, Response $response, \Throwable $exception = null) - { - $eom = \DateTimeImmutable::createFromFormat('d/m/Y', '01/'.Kernel::END_OF_MAINTENANCE); - $eol = \DateTimeImmutable::createFromFormat('d/m/Y', '01/'.Kernel::END_OF_LIFE); - - $this->data = [ - 'token' => $response->headers->get('X-Debug-Token'), - 'symfony_version' => Kernel::VERSION, - 'symfony_minor_version' => sprintf('%s.%s', Kernel::MAJOR_VERSION, Kernel::MINOR_VERSION), - 'symfony_lts' => 4 === Kernel::MINOR_VERSION, - 'symfony_state' => $this->determineSymfonyState(), - 'symfony_eom' => $eom->format('F Y'), - 'symfony_eol' => $eol->format('F Y'), - 'env' => isset($this->kernel) ? $this->kernel->getEnvironment() : 'n/a', - 'debug' => isset($this->kernel) ? $this->kernel->isDebug() : 'n/a', - 'php_version' => \PHP_VERSION, - 'php_architecture' => \PHP_INT_SIZE * 8, - 'php_intl_locale' => class_exists(\Locale::class, false) && \Locale::getDefault() ? \Locale::getDefault() : 'n/a', - 'php_timezone' => date_default_timezone_get(), - 'xdebug_enabled' => \extension_loaded('xdebug'), - 'apcu_enabled' => \extension_loaded('apcu') && filter_var(\ini_get('apc.enabled'), \FILTER_VALIDATE_BOOL), - 'zend_opcache_enabled' => \extension_loaded('Zend OPcache') && filter_var(\ini_get('opcache.enable'), \FILTER_VALIDATE_BOOL), - 'bundles' => [], - 'sapi_name' => \PHP_SAPI, - ]; - - if (isset($this->kernel)) { - foreach ($this->kernel->getBundles() as $name => $bundle) { - $this->data['bundles'][$name] = new ClassStub($bundle::class); - } - } - - if (preg_match('~^(\d+(?:\.\d+)*)(.+)?$~', $this->data['php_version'], $matches) && isset($matches[2])) { - $this->data['php_version'] = $matches[1]; - $this->data['php_version_extra'] = $matches[2]; - } - } - - public function reset() - { - $this->data = []; - } - - public function lateCollect() - { - $this->data = $this->cloneVar($this->data); - } - - /** - * Gets the token. - */ - public function getToken(): ?string - { - return $this->data['token']; - } - - /** - * Gets the Symfony version. - */ - public function getSymfonyVersion(): string - { - return $this->data['symfony_version']; - } - - /** - * Returns the state of the current Symfony release - * as one of: unknown, dev, stable, eom, eol. - */ - public function getSymfonyState(): string - { - return $this->data['symfony_state']; - } - - /** - * Returns the minor Symfony version used (without patch numbers of extra - * suffix like "RC", "beta", etc.). - */ - public function getSymfonyMinorVersion(): string - { - return $this->data['symfony_minor_version']; - } - - public function isSymfonyLts(): bool - { - return $this->data['symfony_lts']; - } - - /** - * Returns the human readable date when this Symfony version ends its - * maintenance period. - */ - public function getSymfonyEom(): string - { - return $this->data['symfony_eom']; - } - - /** - * Returns the human readable date when this Symfony version reaches its - * "end of life" and won't receive bugs or security fixes. - */ - public function getSymfonyEol(): string - { - return $this->data['symfony_eol']; - } - - /** - * Gets the PHP version. - */ - public function getPhpVersion(): string - { - return $this->data['php_version']; - } - - /** - * Gets the PHP version extra part. - */ - public function getPhpVersionExtra(): ?string - { - return $this->data['php_version_extra'] ?? null; - } - - public function getPhpArchitecture(): int - { - return $this->data['php_architecture']; - } - - public function getPhpIntlLocale(): string - { - return $this->data['php_intl_locale']; - } - - public function getPhpTimezone(): string - { - return $this->data['php_timezone']; - } - - /** - * Gets the environment. - */ - public function getEnv(): string - { - return $this->data['env']; - } - - /** - * Returns true if the debug is enabled. - * - * @return bool|string true if debug is enabled, false otherwise or a string if no kernel was set - */ - public function isDebug(): bool|string - { - return $this->data['debug']; - } - - /** - * Returns true if the Xdebug is enabled. - */ - public function hasXdebug(): bool - { - return $this->data['xdebug_enabled']; - } - - /** - * Returns true if the function xdebug_info is available. - */ - public function hasXdebugInfo(): bool - { - return \function_exists('xdebug_info'); - } - - /** - * Returns true if APCu is enabled. - */ - public function hasApcu(): bool - { - return $this->data['apcu_enabled']; - } - - /** - * Returns true if Zend OPcache is enabled. - */ - public function hasZendOpcache(): bool - { - return $this->data['zend_opcache_enabled']; - } - - public function getBundles() - { - return $this->data['bundles']; - } - - /** - * Gets the PHP SAPI name. - */ - public function getSapiName(): string - { - return $this->data['sapi_name']; - } - - public function getName(): string - { - return 'config'; - } - - private function determineSymfonyState(): string - { - $now = new \DateTimeImmutable(); - $eom = \DateTimeImmutable::createFromFormat('d/m/Y', '01/'.Kernel::END_OF_MAINTENANCE)->modify('last day of this month'); - $eol = \DateTimeImmutable::createFromFormat('d/m/Y', '01/'.Kernel::END_OF_LIFE)->modify('last day of this month'); - - if ($now > $eol) { - $versionState = 'eol'; - } elseif ($now > $eom) { - $versionState = 'eom'; - } elseif ('' !== Kernel::EXTRA_VERSION) { - $versionState = 'dev'; - } else { - $versionState = 'stable'; - } - - return $versionState; - } -} diff --git a/vendor/symfony/http-kernel/DataCollector/DataCollector.php b/vendor/symfony/http-kernel/DataCollector/DataCollector.php deleted file mode 100644 index 3a3be3af..00000000 --- a/vendor/symfony/http-kernel/DataCollector/DataCollector.php +++ /dev/null @@ -1,102 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\DataCollector; - -use Symfony\Component\VarDumper\Caster\CutStub; -use Symfony\Component\VarDumper\Caster\ReflectionCaster; -use Symfony\Component\VarDumper\Cloner\ClonerInterface; -use Symfony\Component\VarDumper\Cloner\Data; -use Symfony\Component\VarDumper\Cloner\Stub; -use Symfony\Component\VarDumper\Cloner\VarCloner; - -/** - * DataCollector. - * - * Children of this class must store the collected data in the data property. - * - * @author Fabien Potencier - * @author Bernhard Schussek - */ -abstract class DataCollector implements DataCollectorInterface -{ - /** - * @var array|Data - */ - protected $data = []; - - private ClonerInterface $cloner; - - /** - * Converts the variable into a serializable Data instance. - * - * This array can be displayed in the template using - * the VarDumper component. - */ - protected function cloneVar(mixed $var): Data - { - if ($var instanceof Data) { - return $var; - } - if (!isset($this->cloner)) { - $this->cloner = new VarCloner(); - $this->cloner->setMaxItems(-1); - $this->cloner->addCasters($this->getCasters()); - } - - return $this->cloner->cloneVar($var); - } - - /** - * @return callable[] The casters to add to the cloner - */ - protected function getCasters() - { - $casters = [ - '*' => function ($v, array $a, Stub $s, $isNested) { - if (!$v instanceof Stub) { - foreach ($a as $k => $v) { - if (\is_object($v) && !$v instanceof \DateTimeInterface && !$v instanceof Stub) { - $a[$k] = new CutStub($v); - } - } - } - - return $a; - }, - ] + ReflectionCaster::UNSET_CLOSURE_FILE_INFO; - - return $casters; - } - - public function __sleep(): array - { - return ['data']; - } - - public function __wakeup() - { - } - - /** - * @internal to prevent implementing \Serializable - */ - final protected function serialize() - { - } - - /** - * @internal to prevent implementing \Serializable - */ - final protected function unserialize(string $data) - { - } -} diff --git a/vendor/symfony/http-kernel/DataCollector/DataCollectorInterface.php b/vendor/symfony/http-kernel/DataCollector/DataCollectorInterface.php deleted file mode 100644 index 1cb865fd..00000000 --- a/vendor/symfony/http-kernel/DataCollector/DataCollectorInterface.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\HttpKernel\DataCollector; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Contracts\Service\ResetInterface; - -/** - * DataCollectorInterface. - * - * @author Fabien Potencier - */ -interface DataCollectorInterface extends ResetInterface -{ - /** - * Collects data for the given Request and Response. - */ - public function collect(Request $request, Response $response, \Throwable $exception = null); - - /** - * Returns the name of the collector. - * - * @return string - */ - public function getName(); -} diff --git a/vendor/symfony/http-kernel/DataCollector/DumpDataCollector.php b/vendor/symfony/http-kernel/DataCollector/DumpDataCollector.php deleted file mode 100644 index 48ad9acb..00000000 --- a/vendor/symfony/http-kernel/DataCollector/DumpDataCollector.php +++ /dev/null @@ -1,282 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\DataCollector; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\RequestStack; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\Debug\FileLinkFormatter; -use Symfony\Component\Stopwatch\Stopwatch; -use Symfony\Component\VarDumper\Cloner\Data; -use Symfony\Component\VarDumper\Cloner\VarCloner; -use Symfony\Component\VarDumper\Dumper\CliDumper; -use Symfony\Component\VarDumper\Dumper\ContextProvider\SourceContextProvider; -use Symfony\Component\VarDumper\Dumper\DataDumperInterface; -use Symfony\Component\VarDumper\Dumper\HtmlDumper; -use Symfony\Component\VarDumper\Server\Connection; - -/** - * @author Nicolas Grekas - * - * @final - */ -class DumpDataCollector extends DataCollector implements DataDumperInterface -{ - private ?Stopwatch $stopwatch = null; - private string|FileLinkFormatter|false $fileLinkFormat; - private int $dataCount = 0; - private bool $isCollected = true; - private int $clonesCount = 0; - private int $clonesIndex = 0; - private array $rootRefs; - private string $charset; - private ?RequestStack $requestStack; - private DataDumperInterface|Connection|null $dumper; - private mixed $sourceContextProvider; - - public function __construct(Stopwatch $stopwatch = null, string|FileLinkFormatter $fileLinkFormat = null, string $charset = null, RequestStack $requestStack = null, DataDumperInterface|Connection $dumper = null) - { - $fileLinkFormat = $fileLinkFormat ?: \ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format'); - $this->stopwatch = $stopwatch; - $this->fileLinkFormat = $fileLinkFormat instanceof FileLinkFormatter && false === $fileLinkFormat->format('', 0) ? false : $fileLinkFormat; - $this->charset = $charset ?: \ini_get('php.output_encoding') ?: \ini_get('default_charset') ?: 'UTF-8'; - $this->requestStack = $requestStack; - $this->dumper = $dumper; - - // All clones share these properties by reference: - $this->rootRefs = [ - &$this->data, - &$this->dataCount, - &$this->isCollected, - &$this->clonesCount, - ]; - - $this->sourceContextProvider = $dumper instanceof Connection && isset($dumper->getContextProviders()['source']) ? $dumper->getContextProviders()['source'] : new SourceContextProvider($this->charset); - } - - public function __clone() - { - $this->clonesIndex = ++$this->clonesCount; - } - - public function dump(Data $data) - { - $this->stopwatch?->start('dump'); - - ['name' => $name, 'file' => $file, 'line' => $line, 'file_excerpt' => $fileExcerpt] = $this->sourceContextProvider->getContext(); - - if ($this->dumper instanceof Connection) { - if (!$this->dumper->write($data)) { - $this->isCollected = false; - } - } elseif ($this->dumper) { - $this->doDump($this->dumper, $data, $name, $file, $line); - } else { - $this->isCollected = false; - } - - if (!$this->dataCount) { - $this->data = []; - } - $this->data[] = compact('data', 'name', 'file', 'line', 'fileExcerpt'); - ++$this->dataCount; - - $this->stopwatch?->stop('dump'); - } - - public function collect(Request $request, Response $response, \Throwable $exception = null) - { - if (!$this->dataCount) { - $this->data = []; - } - - // Sub-requests and programmatic calls stay in the collected profile. - if ($this->dumper || ($this->requestStack && $this->requestStack->getMainRequest() !== $request) || $request->isXmlHttpRequest() || $request->headers->has('Origin')) { - return; - } - - // In all other conditions that remove the web debug toolbar, dumps are written on the output. - if (!$this->requestStack - || !$response->headers->has('X-Debug-Token') - || $response->isRedirection() - || ($response->headers->has('Content-Type') && !str_contains($response->headers->get('Content-Type'), 'html')) - || 'html' !== $request->getRequestFormat() - || false === strripos($response->getContent(), '') - ) { - if ($response->headers->has('Content-Type') && str_contains($response->headers->get('Content-Type'), 'html')) { - $dumper = new HtmlDumper('php://output', $this->charset); - $dumper->setDisplayOptions(['fileLinkFormat' => $this->fileLinkFormat]); - } else { - $dumper = new CliDumper('php://output', $this->charset); - if (method_exists($dumper, 'setDisplayOptions')) { - $dumper->setDisplayOptions(['fileLinkFormat' => $this->fileLinkFormat]); - } - } - - foreach ($this->data as $dump) { - $this->doDump($dumper, $dump['data'], $dump['name'], $dump['file'], $dump['line']); - } - } - } - - public function reset() - { - $this->stopwatch?->reset(); - $this->data = []; - $this->dataCount = 0; - $this->isCollected = true; - $this->clonesCount = 0; - $this->clonesIndex = 0; - } - - /** - * @internal - */ - public function __sleep(): array - { - if (!$this->dataCount) { - $this->data = []; - } - - if ($this->clonesCount !== $this->clonesIndex) { - return []; - } - - $this->data[] = $this->fileLinkFormat; - $this->data[] = $this->charset; - $this->dataCount = 0; - $this->isCollected = true; - - return parent::__sleep(); - } - - /** - * @internal - */ - public function __wakeup() - { - parent::__wakeup(); - - $charset = array_pop($this->data); - $fileLinkFormat = array_pop($this->data); - $this->dataCount = \count($this->data); - foreach ($this->data as $dump) { - if (!\is_string($dump['name']) || !\is_string($dump['file']) || !\is_int($dump['line'])) { - throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); - } - } - - self::__construct($this->stopwatch, \is_string($fileLinkFormat) || $fileLinkFormat instanceof FileLinkFormatter ? $fileLinkFormat : null, \is_string($charset) ? $charset : null); - } - - public function getDumpsCount(): int - { - return $this->dataCount; - } - - public function getDumps(string $format, int $maxDepthLimit = -1, int $maxItemsPerDepth = -1): array - { - $data = fopen('php://memory', 'r+'); - - if ('html' === $format) { - $dumper = new HtmlDumper($data, $this->charset); - $dumper->setDisplayOptions(['fileLinkFormat' => $this->fileLinkFormat]); - } else { - throw new \InvalidArgumentException(sprintf('Invalid dump format: "%s".', $format)); - } - $dumps = []; - - if (!$this->dataCount) { - return $this->data = []; - } - - foreach ($this->data as $dump) { - $dumper->dump($dump['data']->withMaxDepth($maxDepthLimit)->withMaxItemsPerDepth($maxItemsPerDepth)); - $dump['data'] = stream_get_contents($data, -1, 0); - ftruncate($data, 0); - rewind($data); - $dumps[] = $dump; - } - - return $dumps; - } - - public function getName(): string - { - return 'dump'; - } - - public function __destruct() - { - if (0 === $this->clonesCount-- && !$this->isCollected && $this->dataCount) { - $this->clonesCount = 0; - $this->isCollected = true; - - $h = headers_list(); - $i = \count($h); - array_unshift($h, 'Content-Type: '.\ini_get('default_mimetype')); - while (0 !== stripos($h[$i], 'Content-Type:')) { - --$i; - } - - if (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) && stripos($h[$i], 'html')) { - $dumper = new HtmlDumper('php://output', $this->charset); - $dumper->setDisplayOptions(['fileLinkFormat' => $this->fileLinkFormat]); - } else { - $dumper = new CliDumper('php://output', $this->charset); - if (method_exists($dumper, 'setDisplayOptions')) { - $dumper->setDisplayOptions(['fileLinkFormat' => $this->fileLinkFormat]); - } - } - - foreach ($this->data as $i => $dump) { - $this->data[$i] = null; - $this->doDump($dumper, $dump['data'], $dump['name'], $dump['file'], $dump['line']); - } - - $this->data = []; - $this->dataCount = 0; - } - } - - private function doDump(DataDumperInterface $dumper, Data $data, string $name, string $file, int $line) - { - if ($dumper instanceof CliDumper) { - $contextDumper = function ($name, $file, $line, $fmt) { - if ($this instanceof HtmlDumper) { - if ($file) { - $s = $this->style('meta', '%s'); - $f = strip_tags($this->style('', $file)); - $name = strip_tags($this->style('', $name)); - if ($fmt && $link = \is_string($fmt) ? strtr($fmt, ['%f' => $file, '%l' => $line]) : $fmt->format($file, $line)) { - $name = sprintf(''.$s.'', strip_tags($this->style('', $link)), $f, $name); - } else { - $name = sprintf(''.$s.'', $f, $name); - } - } else { - $name = $this->style('meta', $name); - } - $this->line = $name.' on line '.$this->style('meta', $line).':'; - } else { - $this->line = $this->style('meta', $name).' on line '.$this->style('meta', $line).':'; - } - $this->dumpLine(0); - }; - $contextDumper = $contextDumper->bindTo($dumper, $dumper); - $contextDumper($name, $file, $line, $this->fileLinkFormat); - } else { - $cloner = new VarCloner(); - $dumper->dump($cloner->cloneVar($name.' on line '.$line.':')); - } - $dumper->dump($data); - } -} diff --git a/vendor/symfony/http-kernel/DataCollector/EventDataCollector.php b/vendor/symfony/http-kernel/DataCollector/EventDataCollector.php deleted file mode 100644 index 0c122e6c..00000000 --- a/vendor/symfony/http-kernel/DataCollector/EventDataCollector.php +++ /dev/null @@ -1,125 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\DataCollector; - -use Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\RequestStack; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\VarDumper\Cloner\Data; -use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; -use Symfony\Contracts\Service\ResetInterface; - -/** - * @author Fabien Potencier - * - * @see TraceableEventDispatcher - * - * @final - */ -class EventDataCollector extends DataCollector implements LateDataCollectorInterface -{ - private ?EventDispatcherInterface $dispatcher; - private ?RequestStack $requestStack; - private ?Request $currentRequest = null; - - public function __construct(EventDispatcherInterface $dispatcher = null, RequestStack $requestStack = null) - { - $this->dispatcher = $dispatcher; - $this->requestStack = $requestStack; - } - - public function collect(Request $request, Response $response, \Throwable $exception = null) - { - $this->currentRequest = $this->requestStack && $this->requestStack->getMainRequest() !== $request ? $request : null; - $this->data = [ - 'called_listeners' => [], - 'not_called_listeners' => [], - 'orphaned_events' => [], - ]; - } - - public function reset() - { - $this->data = []; - - if ($this->dispatcher instanceof ResetInterface) { - $this->dispatcher->reset(); - } - } - - public function lateCollect() - { - if ($this->dispatcher instanceof TraceableEventDispatcher) { - $this->setCalledListeners($this->dispatcher->getCalledListeners($this->currentRequest)); - $this->setNotCalledListeners($this->dispatcher->getNotCalledListeners($this->currentRequest)); - $this->setOrphanedEvents($this->dispatcher->getOrphanedEvents($this->currentRequest)); - } - - $this->data = $this->cloneVar($this->data); - } - - /** - * @see TraceableEventDispatcher - */ - public function setCalledListeners(array $listeners) - { - $this->data['called_listeners'] = $listeners; - } - - /** - * @see TraceableEventDispatcher - */ - public function getCalledListeners(): array|Data - { - return $this->data['called_listeners']; - } - - /** - * @see TraceableEventDispatcher - */ - public function setNotCalledListeners(array $listeners) - { - $this->data['not_called_listeners'] = $listeners; - } - - /** - * @see TraceableEventDispatcher - */ - public function getNotCalledListeners(): array|Data - { - return $this->data['not_called_listeners']; - } - - /** - * @param array $events An array of orphaned events - * - * @see TraceableEventDispatcher - */ - public function setOrphanedEvents(array $events) - { - $this->data['orphaned_events'] = $events; - } - - /** - * @see TraceableEventDispatcher - */ - public function getOrphanedEvents(): array|Data - { - return $this->data['orphaned_events']; - } - - public function getName(): string - { - return 'events'; - } -} diff --git a/vendor/symfony/http-kernel/DataCollector/ExceptionDataCollector.php b/vendor/symfony/http-kernel/DataCollector/ExceptionDataCollector.php deleted file mode 100644 index dbe24b41..00000000 --- a/vendor/symfony/http-kernel/DataCollector/ExceptionDataCollector.php +++ /dev/null @@ -1,73 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\DataCollector; - -use Symfony\Component\ErrorHandler\Exception\FlattenException; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; - -/** - * @author Fabien Potencier - * - * @final - */ -class ExceptionDataCollector extends DataCollector -{ - public function collect(Request $request, Response $response, \Throwable $exception = null) - { - if (null !== $exception) { - $this->data = [ - 'exception' => FlattenException::createFromThrowable($exception), - ]; - } - } - - public function reset() - { - $this->data = []; - } - - public function hasException(): bool - { - return isset($this->data['exception']); - } - - public function getException(): \Exception|FlattenException - { - return $this->data['exception']; - } - - public function getMessage(): string - { - return $this->data['exception']->getMessage(); - } - - public function getCode(): int - { - return $this->data['exception']->getCode(); - } - - public function getStatusCode(): int - { - return $this->data['exception']->getStatusCode(); - } - - public function getTrace(): array - { - return $this->data['exception']->getTrace(); - } - - public function getName(): string - { - return 'exception'; - } -} diff --git a/vendor/symfony/http-kernel/DataCollector/LateDataCollectorInterface.php b/vendor/symfony/http-kernel/DataCollector/LateDataCollectorInterface.php deleted file mode 100644 index 012332de..00000000 --- a/vendor/symfony/http-kernel/DataCollector/LateDataCollectorInterface.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\HttpKernel\DataCollector; - -/** - * LateDataCollectorInterface. - * - * @author Fabien Potencier - */ -interface LateDataCollectorInterface -{ - /** - * Collects data as late as possible. - */ - public function lateCollect(); -} diff --git a/vendor/symfony/http-kernel/DataCollector/LoggerDataCollector.php b/vendor/symfony/http-kernel/DataCollector/LoggerDataCollector.php deleted file mode 100644 index 661b84e0..00000000 --- a/vendor/symfony/http-kernel/DataCollector/LoggerDataCollector.php +++ /dev/null @@ -1,346 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\DataCollector; - -use Symfony\Component\ErrorHandler\Exception\SilencedErrorContext; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\RequestStack; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\Log\DebugLoggerInterface; - -/** - * @author Fabien Potencier - * - * @final - */ -class LoggerDataCollector extends DataCollector implements LateDataCollectorInterface -{ - private DebugLoggerInterface $logger; - private ?string $containerPathPrefix; - private ?Request $currentRequest = null; - private ?RequestStack $requestStack; - private ?array $processedLogs = null; - - public function __construct(object $logger = null, string $containerPathPrefix = null, RequestStack $requestStack = null) - { - if ($logger instanceof DebugLoggerInterface) { - $this->logger = $logger; - } - - $this->containerPathPrefix = $containerPathPrefix; - $this->requestStack = $requestStack; - } - - public function collect(Request $request, Response $response, \Throwable $exception = null) - { - $this->currentRequest = $this->requestStack && $this->requestStack->getMainRequest() !== $request ? $request : null; - } - - public function reset() - { - if (isset($this->logger)) { - $this->logger->clear(); - } - $this->data = []; - } - - public function lateCollect() - { - if (isset($this->logger)) { - $containerDeprecationLogs = $this->getContainerDeprecationLogs(); - $this->data = $this->computeErrorsCount($containerDeprecationLogs); - // get compiler logs later (only when they are needed) to improve performance - $this->data['compiler_logs'] = []; - $this->data['compiler_logs_filepath'] = $this->containerPathPrefix.'Compiler.log'; - $this->data['logs'] = $this->sanitizeLogs(array_merge($this->logger->getLogs($this->currentRequest), $containerDeprecationLogs)); - $this->data = $this->cloneVar($this->data); - } - $this->currentRequest = null; - } - - public function getLogs() - { - return $this->data['logs'] ?? []; - } - - public function getProcessedLogs() - { - if (null !== $this->processedLogs) { - return $this->processedLogs; - } - - $rawLogs = $this->getLogs(); - if ([] === $rawLogs) { - return $this->processedLogs = $rawLogs; - } - - $logs = []; - foreach ($this->getLogs()->getValue() as $rawLog) { - $rawLogData = $rawLog->getValue(); - - if ($rawLogData['priority']->getValue() > 300) { - $logType = 'error'; - } elseif (isset($rawLogData['scream']) && false === $rawLogData['scream']->getValue()) { - $logType = 'deprecation'; - } elseif (isset($rawLogData['scream']) && true === $rawLogData['scream']->getValue()) { - $logType = 'silenced'; - } else { - $logType = 'regular'; - } - - $logs[] = [ - 'type' => $logType, - 'errorCount' => $rawLog['errorCount'] ?? 1, - 'timestamp' => $rawLogData['timestamp_rfc3339']->getValue(), - 'priority' => $rawLogData['priority']->getValue(), - 'priorityName' => $rawLogData['priorityName']->getValue(), - 'channel' => $rawLogData['channel']->getValue(), - 'message' => $rawLogData['message'], - 'context' => $rawLogData['context'], - ]; - } - - // sort logs from oldest to newest - usort($logs, static function ($logA, $logB) { - return $logA['timestamp'] <=> $logB['timestamp']; - }); - - return $this->processedLogs = $logs; - } - - public function getFilters() - { - $filters = [ - 'channel' => [], - 'priority' => [ - 'Debug' => 100, - 'Info' => 200, - 'Notice' => 250, - 'Warning' => 300, - 'Error' => 400, - 'Critical' => 500, - 'Alert' => 550, - 'Emergency' => 600, - ], - ]; - - $allChannels = []; - foreach ($this->getProcessedLogs() as $log) { - if ('' === trim($log['channel'] ?? '')) { - continue; - } - - $allChannels[] = $log['channel']; - } - $channels = array_unique($allChannels); - sort($channels); - $filters['channel'] = $channels; - - return $filters; - } - - public function getPriorities() - { - return $this->data['priorities'] ?? []; - } - - public function countErrors() - { - return $this->data['error_count'] ?? 0; - } - - public function countDeprecations() - { - return $this->data['deprecation_count'] ?? 0; - } - - public function countWarnings() - { - return $this->data['warning_count'] ?? 0; - } - - public function countScreams() - { - return $this->data['scream_count'] ?? 0; - } - - public function getCompilerLogs() - { - return $this->cloneVar($this->getContainerCompilerLogs($this->data['compiler_logs_filepath'] ?? null)); - } - - public function getName(): string - { - return 'logger'; - } - - private function getContainerDeprecationLogs(): array - { - if (null === $this->containerPathPrefix || !is_file($file = $this->containerPathPrefix.'Deprecations.log')) { - return []; - } - - if ('' === $logContent = trim(file_get_contents($file))) { - return []; - } - - $bootTime = filemtime($file); - $logs = []; - foreach (unserialize($logContent) as $log) { - $log['context'] = ['exception' => new SilencedErrorContext($log['type'], $log['file'], $log['line'], $log['trace'], $log['count'])]; - $log['timestamp'] = $bootTime; - $log['timestamp_rfc3339'] = (new \DateTimeImmutable())->setTimestamp($bootTime)->format(\DateTimeInterface::RFC3339_EXTENDED); - $log['priority'] = 100; - $log['priorityName'] = 'DEBUG'; - $log['channel'] = null; - $log['scream'] = false; - unset($log['type'], $log['file'], $log['line'], $log['trace'], $log['trace'], $log['count']); - $logs[] = $log; - } - - return $logs; - } - - private function getContainerCompilerLogs(string $compilerLogsFilepath = null): array - { - if (!is_file($compilerLogsFilepath)) { - return []; - } - - $logs = []; - foreach (file($compilerLogsFilepath, \FILE_IGNORE_NEW_LINES) as $log) { - $log = explode(': ', $log, 2); - if (!isset($log[1]) || !preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+(?:\\\\[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+)++$/', $log[0])) { - $log = ['Unknown Compiler Pass', implode(': ', $log)]; - } - - $logs[$log[0]][] = ['message' => $log[1]]; - } - - return $logs; - } - - private function sanitizeLogs(array $logs) - { - $sanitizedLogs = []; - $silencedLogs = []; - - foreach ($logs as $log) { - if (!$this->isSilencedOrDeprecationErrorLog($log)) { - $sanitizedLogs[] = $log; - - continue; - } - - $message = '_'.$log['message']; - $exception = $log['context']['exception']; - - if ($exception instanceof SilencedErrorContext) { - if (isset($silencedLogs[$h = spl_object_hash($exception)])) { - continue; - } - $silencedLogs[$h] = true; - - if (!isset($sanitizedLogs[$message])) { - $sanitizedLogs[$message] = $log + [ - 'errorCount' => 0, - 'scream' => true, - ]; - } - $sanitizedLogs[$message]['errorCount'] += $exception->count; - - continue; - } - - $errorId = md5("{$exception->getSeverity()}/{$exception->getLine()}/{$exception->getFile()}\0{$message}", true); - - if (isset($sanitizedLogs[$errorId])) { - ++$sanitizedLogs[$errorId]['errorCount']; - } else { - $log += [ - 'errorCount' => 1, - 'scream' => false, - ]; - - $sanitizedLogs[$errorId] = $log; - } - } - - return array_values($sanitizedLogs); - } - - private function isSilencedOrDeprecationErrorLog(array $log): bool - { - if (!isset($log['context']['exception'])) { - return false; - } - - $exception = $log['context']['exception']; - - if ($exception instanceof SilencedErrorContext) { - return true; - } - - if ($exception instanceof \ErrorException && \in_array($exception->getSeverity(), [\E_DEPRECATED, \E_USER_DEPRECATED], true)) { - return true; - } - - return false; - } - - private function computeErrorsCount(array $containerDeprecationLogs): array - { - $silencedLogs = []; - $count = [ - 'error_count' => $this->logger->countErrors($this->currentRequest), - 'deprecation_count' => 0, - 'warning_count' => 0, - 'scream_count' => 0, - 'priorities' => [], - ]; - - foreach ($this->logger->getLogs($this->currentRequest) as $log) { - if (isset($count['priorities'][$log['priority']])) { - ++$count['priorities'][$log['priority']]['count']; - } else { - $count['priorities'][$log['priority']] = [ - 'count' => 1, - 'name' => $log['priorityName'], - ]; - } - if ('WARNING' === $log['priorityName']) { - ++$count['warning_count']; - } - - if ($this->isSilencedOrDeprecationErrorLog($log)) { - $exception = $log['context']['exception']; - if ($exception instanceof SilencedErrorContext) { - if (isset($silencedLogs[$h = spl_object_hash($exception)])) { - continue; - } - $silencedLogs[$h] = true; - $count['scream_count'] += $exception->count; - } else { - ++$count['deprecation_count']; - } - } - } - - foreach ($containerDeprecationLogs as $deprecationLog) { - $count['deprecation_count'] += $deprecationLog['context']['exception']->count; - } - - ksort($count['priorities']); - - return $count; - } -} diff --git a/vendor/symfony/http-kernel/DataCollector/MemoryDataCollector.php b/vendor/symfony/http-kernel/DataCollector/MemoryDataCollector.php deleted file mode 100644 index 474b5bf3..00000000 --- a/vendor/symfony/http-kernel/DataCollector/MemoryDataCollector.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\HttpKernel\DataCollector; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; - -/** - * @author Fabien Potencier - * - * @final - */ -class MemoryDataCollector extends DataCollector implements LateDataCollectorInterface -{ - public function __construct() - { - $this->reset(); - } - - public function collect(Request $request, Response $response, \Throwable $exception = null) - { - $this->updateMemoryUsage(); - } - - public function reset() - { - $this->data = [ - 'memory' => 0, - 'memory_limit' => $this->convertToBytes(\ini_get('memory_limit')), - ]; - } - - public function lateCollect() - { - $this->updateMemoryUsage(); - } - - public function getMemory(): int - { - return $this->data['memory']; - } - - public function getMemoryLimit(): int|float - { - return $this->data['memory_limit']; - } - - public function updateMemoryUsage() - { - $this->data['memory'] = memory_get_peak_usage(true); - } - - public function getName(): string - { - return 'memory'; - } - - private function convertToBytes(string $memoryLimit): int|float - { - if ('-1' === $memoryLimit) { - return -1; - } - - $memoryLimit = strtolower($memoryLimit); - $max = strtolower(ltrim($memoryLimit, '+')); - if (str_starts_with($max, '0x')) { - $max = \intval($max, 16); - } elseif (str_starts_with($max, '0')) { - $max = \intval($max, 8); - } else { - $max = (int) $max; - } - - switch (substr($memoryLimit, -1)) { - case 't': $max *= 1024; - // no break - case 'g': $max *= 1024; - // no break - case 'm': $max *= 1024; - // no break - case 'k': $max *= 1024; - } - - return $max; - } -} diff --git a/vendor/symfony/http-kernel/DataCollector/RequestDataCollector.php b/vendor/symfony/http-kernel/DataCollector/RequestDataCollector.php deleted file mode 100644 index aa505783..00000000 --- a/vendor/symfony/http-kernel/DataCollector/RequestDataCollector.php +++ /dev/null @@ -1,496 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\DataCollector; - -use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\HttpFoundation\Cookie; -use Symfony\Component\HttpFoundation\ParameterBag; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\RequestStack; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpFoundation\Session\SessionBagInterface; -use Symfony\Component\HttpFoundation\Session\SessionInterface; -use Symfony\Component\HttpKernel\Event\ControllerEvent; -use Symfony\Component\HttpKernel\Event\ResponseEvent; -use Symfony\Component\HttpKernel\KernelEvents; -use Symfony\Component\VarDumper\Cloner\Data; - -/** - * @author Fabien Potencier - * - * @final - */ -class RequestDataCollector extends DataCollector implements EventSubscriberInterface, LateDataCollectorInterface -{ - /** - * @var \SplObjectStorage - */ - private \SplObjectStorage $controllers; - private array $sessionUsages = []; - private ?RequestStack $requestStack; - - public function __construct(RequestStack $requestStack = null) - { - $this->controllers = new \SplObjectStorage(); - $this->requestStack = $requestStack; - } - - public function collect(Request $request, Response $response, \Throwable $exception = null) - { - // attributes are serialized and as they can be anything, they need to be converted to strings. - $attributes = []; - $route = ''; - foreach ($request->attributes->all() as $key => $value) { - if ('_route' === $key) { - $route = \is_object($value) ? $value->getPath() : $value; - $attributes[$key] = $route; - } else { - $attributes[$key] = $value; - } - } - - $content = $request->getContent(); - - $sessionMetadata = []; - $sessionAttributes = []; - $flashes = []; - if ($request->hasSession()) { - $session = $request->getSession(); - if ($session->isStarted()) { - $sessionMetadata['Created'] = date(\DATE_RFC822, $session->getMetadataBag()->getCreated()); - $sessionMetadata['Last used'] = date(\DATE_RFC822, $session->getMetadataBag()->getLastUsed()); - $sessionMetadata['Lifetime'] = $session->getMetadataBag()->getLifetime(); - $sessionAttributes = $session->all(); - $flashes = $session->getFlashBag()->peekAll(); - } - } - - $statusCode = $response->getStatusCode(); - - $responseCookies = []; - foreach ($response->headers->getCookies() as $cookie) { - $responseCookies[$cookie->getName()] = $cookie; - } - - $dotenvVars = []; - foreach (explode(',', $_SERVER['SYMFONY_DOTENV_VARS'] ?? $_ENV['SYMFONY_DOTENV_VARS'] ?? '') as $name) { - if ('' !== $name && isset($_ENV[$name])) { - $dotenvVars[$name] = $_ENV[$name]; - } - } - - $this->data = [ - 'method' => $request->getMethod(), - 'format' => $request->getRequestFormat(), - 'content_type' => $response->headers->get('Content-Type', 'text/html'), - 'status_text' => Response::$statusTexts[$statusCode] ?? '', - 'status_code' => $statusCode, - 'request_query' => $request->query->all(), - 'request_request' => $request->request->all(), - 'request_files' => $request->files->all(), - 'request_headers' => $request->headers->all(), - 'request_server' => $request->server->all(), - 'request_cookies' => $request->cookies->all(), - 'request_attributes' => $attributes, - 'route' => $route, - 'response_headers' => $response->headers->all(), - 'response_cookies' => $responseCookies, - 'session_metadata' => $sessionMetadata, - 'session_attributes' => $sessionAttributes, - 'session_usages' => array_values($this->sessionUsages), - 'stateless_check' => $this->requestStack?->getMainRequest()?->attributes->get('_stateless') ?? false, - 'flashes' => $flashes, - 'path_info' => $request->getPathInfo(), - 'controller' => 'n/a', - 'locale' => $request->getLocale(), - 'dotenv_vars' => $dotenvVars, - ]; - - if (isset($this->data['request_headers']['php-auth-pw'])) { - $this->data['request_headers']['php-auth-pw'] = '******'; - } - - if (isset($this->data['request_server']['PHP_AUTH_PW'])) { - $this->data['request_server']['PHP_AUTH_PW'] = '******'; - } - - if (isset($this->data['request_request']['_password'])) { - $encodedPassword = rawurlencode($this->data['request_request']['_password']); - $content = str_replace('_password='.$encodedPassword, '_password=******', $content); - $this->data['request_request']['_password'] = '******'; - } - - $this->data['content'] = $content; - - foreach ($this->data as $key => $value) { - if (!\is_array($value)) { - continue; - } - if ('request_headers' === $key || 'response_headers' === $key) { - $this->data[$key] = array_map(function ($v) { return isset($v[0]) && !isset($v[1]) ? $v[0] : $v; }, $value); - } - } - - if (isset($this->controllers[$request])) { - $this->data['controller'] = $this->parseController($this->controllers[$request]); - unset($this->controllers[$request]); - } - - if ($request->attributes->has('_redirected') && $redirectCookie = $request->cookies->get('sf_redirect')) { - $this->data['redirect'] = json_decode($redirectCookie, true); - - $response->headers->clearCookie('sf_redirect'); - } - - if ($response->isRedirect()) { - $response->headers->setCookie(new Cookie( - 'sf_redirect', - json_encode([ - 'token' => $response->headers->get('x-debug-token'), - 'route' => $request->attributes->get('_route', 'n/a'), - 'method' => $request->getMethod(), - 'controller' => $this->parseController($request->attributes->get('_controller')), - 'status_code' => $statusCode, - 'status_text' => Response::$statusTexts[$statusCode], - ]), - 0, '/', null, $request->isSecure(), true, false, 'lax' - )); - } - - $this->data['identifier'] = $this->data['route'] ?: (\is_array($this->data['controller']) ? $this->data['controller']['class'].'::'.$this->data['controller']['method'].'()' : $this->data['controller']); - - if ($response->headers->has('x-previous-debug-token')) { - $this->data['forward_token'] = $response->headers->get('x-previous-debug-token'); - } - } - - public function lateCollect() - { - $this->data = $this->cloneVar($this->data); - } - - public function reset() - { - $this->data = []; - $this->controllers = new \SplObjectStorage(); - $this->sessionUsages = []; - } - - public function getMethod() - { - return $this->data['method']; - } - - public function getPathInfo() - { - return $this->data['path_info']; - } - - public function getRequestRequest() - { - return new ParameterBag($this->data['request_request']->getValue()); - } - - public function getRequestQuery() - { - return new ParameterBag($this->data['request_query']->getValue()); - } - - public function getRequestFiles() - { - return new ParameterBag($this->data['request_files']->getValue()); - } - - public function getRequestHeaders() - { - return new ParameterBag($this->data['request_headers']->getValue()); - } - - public function getRequestServer(bool $raw = false) - { - return new ParameterBag($this->data['request_server']->getValue($raw)); - } - - public function getRequestCookies(bool $raw = false) - { - return new ParameterBag($this->data['request_cookies']->getValue($raw)); - } - - public function getRequestAttributes() - { - return new ParameterBag($this->data['request_attributes']->getValue()); - } - - public function getResponseHeaders() - { - return new ParameterBag($this->data['response_headers']->getValue()); - } - - public function getResponseCookies() - { - return new ParameterBag($this->data['response_cookies']->getValue()); - } - - public function getSessionMetadata() - { - return $this->data['session_metadata']->getValue(); - } - - public function getSessionAttributes() - { - return $this->data['session_attributes']->getValue(); - } - - public function getStatelessCheck() - { - return $this->data['stateless_check']; - } - - public function getSessionUsages() - { - return $this->data['session_usages']; - } - - public function getFlashes() - { - return $this->data['flashes']->getValue(); - } - - public function getContent() - { - return $this->data['content']; - } - - public function isJsonRequest() - { - return 1 === preg_match('{^application/(?:\w+\++)*json$}i', $this->data['request_headers']['content-type']); - } - - public function getPrettyJson() - { - $decoded = json_decode($this->getContent()); - - return \JSON_ERROR_NONE === json_last_error() ? json_encode($decoded, \JSON_PRETTY_PRINT) : null; - } - - public function getContentType() - { - return $this->data['content_type']; - } - - public function getStatusText() - { - return $this->data['status_text']; - } - - public function getStatusCode() - { - return $this->data['status_code']; - } - - public function getFormat() - { - return $this->data['format']; - } - - public function getLocale() - { - return $this->data['locale']; - } - - public function getDotenvVars() - { - return new ParameterBag($this->data['dotenv_vars']->getValue()); - } - - /** - * Gets the route name. - * - * The _route request attributes is automatically set by the Router Matcher. - */ - public function getRoute(): string - { - return $this->data['route']; - } - - public function getIdentifier() - { - return $this->data['identifier']; - } - - /** - * Gets the route parameters. - * - * The _route_params request attributes is automatically set by the RouterListener. - */ - public function getRouteParams(): array - { - return isset($this->data['request_attributes']['_route_params']) ? $this->data['request_attributes']['_route_params']->getValue() : []; - } - - /** - * Gets the parsed controller. - * - * @return array|string|Data The controller as a string or array of data - * with keys 'class', 'method', 'file' and 'line' - */ - public function getController(): array|string|Data - { - return $this->data['controller']; - } - - /** - * Gets the previous request attributes. - * - * @return array|Data|false A legacy array of data from the previous redirection response - * or false otherwise - */ - public function getRedirect(): array|Data|false - { - return $this->data['redirect'] ?? false; - } - - public function getForwardToken() - { - return $this->data['forward_token'] ?? null; - } - - public function onKernelController(ControllerEvent $event) - { - $this->controllers[$event->getRequest()] = $event->getController(); - } - - public function onKernelResponse(ResponseEvent $event) - { - if (!$event->isMainRequest()) { - return; - } - - if ($event->getRequest()->cookies->has('sf_redirect')) { - $event->getRequest()->attributes->set('_redirected', true); - } - } - - public static function getSubscribedEvents(): array - { - return [ - KernelEvents::CONTROLLER => 'onKernelController', - KernelEvents::RESPONSE => 'onKernelResponse', - ]; - } - - public function getName(): string - { - return 'request'; - } - - public function collectSessionUsage(): void - { - $trace = debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS); - - $traceEndIndex = \count($trace) - 1; - for ($i = $traceEndIndex; $i > 0; --$i) { - if (null !== ($class = $trace[$i]['class'] ?? null) && (is_subclass_of($class, SessionInterface::class) || is_subclass_of($class, SessionBagInterface::class))) { - $traceEndIndex = $i; - break; - } - } - - if ((\count($trace) - 1) === $traceEndIndex) { - return; - } - - // Remove part of the backtrace that belongs to session only - array_splice($trace, 0, $traceEndIndex); - - // Merge identical backtraces generated by internal call reports - $name = sprintf('%s:%s', $trace[1]['class'] ?? $trace[0]['file'], $trace[0]['line']); - if (!\array_key_exists($name, $this->sessionUsages)) { - $this->sessionUsages[$name] = [ - 'name' => $name, - 'file' => $trace[0]['file'], - 'line' => $trace[0]['line'], - 'trace' => $trace, - ]; - } - } - - /** - * @return array|string An array of controller data or a simple string - */ - private function parseController(array|object|string|null $controller): array|string - { - if (\is_string($controller) && str_contains($controller, '::')) { - $controller = explode('::', $controller); - } - - if (\is_array($controller)) { - try { - $r = new \ReflectionMethod($controller[0], $controller[1]); - - return [ - 'class' => \is_object($controller[0]) ? get_debug_type($controller[0]) : $controller[0], - 'method' => $controller[1], - 'file' => $r->getFileName(), - 'line' => $r->getStartLine(), - ]; - } catch (\ReflectionException) { - if (\is_callable($controller)) { - // using __call or __callStatic - return [ - 'class' => \is_object($controller[0]) ? get_debug_type($controller[0]) : $controller[0], - 'method' => $controller[1], - 'file' => 'n/a', - 'line' => 'n/a', - ]; - } - } - } - - if ($controller instanceof \Closure) { - $r = new \ReflectionFunction($controller); - - $controller = [ - 'class' => $r->getName(), - 'method' => null, - 'file' => $r->getFileName(), - 'line' => $r->getStartLine(), - ]; - - if (str_contains($r->name, '{closure}')) { - return $controller; - } - $controller['method'] = $r->name; - - if ($class = \PHP_VERSION_ID >= 80111 ? $r->getClosureCalledClass() : $r->getClosureScopeClass()) { - $controller['class'] = $class->name; - } else { - return $r->name; - } - - return $controller; - } - - if (\is_object($controller)) { - $r = new \ReflectionClass($controller); - - return [ - 'class' => $r->getName(), - 'method' => null, - 'file' => $r->getFileName(), - 'line' => $r->getStartLine(), - ]; - } - - return \is_string($controller) ? $controller : 'n/a'; - } -} diff --git a/vendor/symfony/http-kernel/DataCollector/RouterDataCollector.php b/vendor/symfony/http-kernel/DataCollector/RouterDataCollector.php deleted file mode 100644 index 3c9f2142..00000000 --- a/vendor/symfony/http-kernel/DataCollector/RouterDataCollector.php +++ /dev/null @@ -1,97 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\DataCollector; - -use Symfony\Component\HttpFoundation\RedirectResponse; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\Event\ControllerEvent; - -/** - * @author Fabien Potencier - */ -class RouterDataCollector extends DataCollector -{ - /** - * @var \SplObjectStorage - */ - protected $controllers; - - public function __construct() - { - $this->reset(); - } - - /** - * @final - */ - public function collect(Request $request, Response $response, \Throwable $exception = null) - { - if ($response instanceof RedirectResponse) { - $this->data['redirect'] = true; - $this->data['url'] = $response->getTargetUrl(); - - if ($this->controllers->contains($request)) { - $this->data['route'] = $this->guessRoute($request, $this->controllers[$request]); - } - } - - unset($this->controllers[$request]); - } - - public function reset() - { - $this->controllers = new \SplObjectStorage(); - - $this->data = [ - 'redirect' => false, - 'url' => null, - 'route' => null, - ]; - } - - protected function guessRoute(Request $request, string|object|array $controller) - { - return 'n/a'; - } - - /** - * Remembers the controller associated to each request. - */ - public function onKernelController(ControllerEvent $event) - { - $this->controllers[$event->getRequest()] = $event->getController(); - } - - /** - * @return bool Whether this request will result in a redirect - */ - public function getRedirect(): bool - { - return $this->data['redirect']; - } - - public function getTargetUrl(): ?string - { - return $this->data['url']; - } - - public function getTargetRoute(): ?string - { - return $this->data['route']; - } - - public function getName(): string - { - return 'router'; - } -} diff --git a/vendor/symfony/http-kernel/DataCollector/TimeDataCollector.php b/vendor/symfony/http-kernel/DataCollector/TimeDataCollector.php deleted file mode 100644 index 1a4169a6..00000000 --- a/vendor/symfony/http-kernel/DataCollector/TimeDataCollector.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\HttpKernel\DataCollector; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\Stopwatch\Stopwatch; -use Symfony\Component\Stopwatch\StopwatchEvent; - -/** - * @author Fabien Potencier - * - * @final - */ -class TimeDataCollector extends DataCollector implements LateDataCollectorInterface -{ - private ?KernelInterface $kernel; - private ?Stopwatch $stopwatch; - - public function __construct(KernelInterface $kernel = null, Stopwatch $stopwatch = null) - { - $this->kernel = $kernel; - $this->stopwatch = $stopwatch; - } - - public function collect(Request $request, Response $response, \Throwable $exception = null) - { - if (null !== $this->kernel) { - $startTime = $this->kernel->getStartTime(); - } else { - $startTime = $request->server->get('REQUEST_TIME_FLOAT'); - } - - $this->data = [ - 'token' => $request->attributes->get('_stopwatch_token'), - 'start_time' => $startTime * 1000, - 'events' => [], - 'stopwatch_installed' => class_exists(Stopwatch::class, false), - ]; - } - - public function reset() - { - $this->data = []; - - $this->stopwatch?->reset(); - } - - public function lateCollect() - { - if (null !== $this->stopwatch && isset($this->data['token'])) { - $this->setEvents($this->stopwatch->getSectionEvents($this->data['token'])); - } - unset($this->data['token']); - } - - /** - * @param StopwatchEvent[] $events The request events - */ - public function setEvents(array $events) - { - foreach ($events as $event) { - $event->ensureStopped(); - } - - $this->data['events'] = $events; - } - - /** - * @return StopwatchEvent[] - */ - public function getEvents(): array - { - return $this->data['events']; - } - - /** - * Gets the request elapsed time. - */ - public function getDuration(): float - { - if (!isset($this->data['events']['__section__'])) { - return 0; - } - - $lastEvent = $this->data['events']['__section__']; - - return $lastEvent->getOrigin() + $lastEvent->getDuration() - $this->getStartTime(); - } - - /** - * Gets the initialization time. - * - * This is the time spent until the beginning of the request handling. - */ - public function getInitTime(): float - { - if (!isset($this->data['events']['__section__'])) { - return 0; - } - - return $this->data['events']['__section__']->getOrigin() - $this->getStartTime(); - } - - public function getStartTime(): float - { - return $this->data['start_time']; - } - - public function isStopwatchInstalled(): bool - { - return $this->data['stopwatch_installed']; - } - - public function getName(): string - { - return 'time'; - } -} diff --git a/vendor/symfony/http-kernel/Debug/FileLinkFormatter.php b/vendor/symfony/http-kernel/Debug/FileLinkFormatter.php deleted file mode 100644 index 4eaeeb15..00000000 --- a/vendor/symfony/http-kernel/Debug/FileLinkFormatter.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\HttpKernel\Debug; - -use Symfony\Component\ErrorHandler\ErrorRenderer\ErrorRendererInterface; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\RequestStack; -use Symfony\Component\Routing\Generator\UrlGeneratorInterface; - -/** - * Formats debug file links. - * - * @author Jérémy Romey - * - * @final - */ -class FileLinkFormatter -{ - private array|false $fileLinkFormat; - private ?RequestStack $requestStack = null; - private ?string $baseDir = null; - private \Closure|string|null $urlFormat; - - /** - * @param string|\Closure $urlFormat the URL format, or a closure that returns it on-demand - */ - public function __construct(string|array $fileLinkFormat = null, RequestStack $requestStack = null, string $baseDir = null, string|\Closure $urlFormat = null) - { - $fileLinkFormat ??= $_ENV['SYMFONY_IDE'] ?? $_SERVER['SYMFONY_IDE'] ?? ''; - - if (!\is_array($fileLinkFormat) && $fileLinkFormat = (ErrorRendererInterface::IDE_LINK_FORMATS[$fileLinkFormat] ?? $fileLinkFormat) ?: \ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format') ?: false) { - $i = strpos($f = $fileLinkFormat, '&', max(strrpos($f, '%f'), strrpos($f, '%l'))) ?: \strlen($f); - $fileLinkFormat = [substr($f, 0, $i)] + preg_split('/&([^>]++)>/', substr($f, $i), -1, \PREG_SPLIT_DELIM_CAPTURE); - } - - $this->fileLinkFormat = $fileLinkFormat; - $this->requestStack = $requestStack; - $this->baseDir = $baseDir; - $this->urlFormat = $urlFormat; - } - - public function format(string $file, int $line) - { - if ($fmt = $this->getFileLinkFormat()) { - for ($i = 1; isset($fmt[$i]); ++$i) { - if (str_starts_with($file, $k = $fmt[$i++])) { - $file = substr_replace($file, $fmt[$i], 0, \strlen($k)); - break; - } - } - - return strtr($fmt[0], ['%f' => $file, '%l' => $line]); - } - - return false; - } - - /** - * @internal - */ - public function __sleep(): array - { - $this->fileLinkFormat = $this->getFileLinkFormat(); - - return ['fileLinkFormat']; - } - - /** - * @internal - */ - public static function generateUrlFormat(UrlGeneratorInterface $router, string $routeName, string $queryString): ?string - { - try { - return $router->generate($routeName).$queryString; - } catch (\Throwable) { - return null; - } - } - - private function getFileLinkFormat(): array|false - { - if ($this->fileLinkFormat) { - return $this->fileLinkFormat; - } - - if ($this->requestStack && $this->baseDir && $this->urlFormat) { - $request = $this->requestStack->getMainRequest(); - - if ($request instanceof Request && (!$this->urlFormat instanceof \Closure || $this->urlFormat = ($this->urlFormat)())) { - return [ - $request->getSchemeAndHttpHost().$this->urlFormat, - $this->baseDir.\DIRECTORY_SEPARATOR, '', - ]; - } - } - - return false; - } -} diff --git a/vendor/symfony/http-kernel/Debug/TraceableEventDispatcher.php b/vendor/symfony/http-kernel/Debug/TraceableEventDispatcher.php deleted file mode 100644 index dff3bc94..00000000 --- a/vendor/symfony/http-kernel/Debug/TraceableEventDispatcher.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Debug; - -use Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher as BaseTraceableEventDispatcher; -use Symfony\Component\HttpKernel\KernelEvents; - -/** - * Collects some data about event listeners. - * - * This event dispatcher delegates the dispatching to another one. - * - * @author Fabien Potencier - */ -class TraceableEventDispatcher extends BaseTraceableEventDispatcher -{ - protected function beforeDispatch(string $eventName, object $event) - { - switch ($eventName) { - case KernelEvents::REQUEST: - $event->getRequest()->attributes->set('_stopwatch_token', substr(hash('sha256', uniqid(mt_rand(), true)), 0, 6)); - $this->stopwatch->openSection(); - break; - case KernelEvents::VIEW: - case KernelEvents::RESPONSE: - // stop only if a controller has been executed - if ($this->stopwatch->isStarted('controller')) { - $this->stopwatch->stop('controller'); - } - break; - case KernelEvents::TERMINATE: - $sectionId = $event->getRequest()->attributes->get('_stopwatch_token'); - if (null === $sectionId) { - break; - } - // There is a very special case when using built-in AppCache class as kernel wrapper, in the case - // of an ESI request leading to a `stale` response [B] inside a `fresh` cached response [A]. - // In this case, `$token` contains the [B] debug token, but the open `stopwatch` section ID - // is equal to the [A] debug token. Trying to reopen section with the [B] token throws an exception - // which must be caught. - try { - $this->stopwatch->openSection($sectionId); - } catch (\LogicException) { - } - break; - } - } - - protected function afterDispatch(string $eventName, object $event) - { - switch ($eventName) { - case KernelEvents::CONTROLLER_ARGUMENTS: - $this->stopwatch->start('controller', 'section'); - break; - case KernelEvents::RESPONSE: - $sectionId = $event->getRequest()->attributes->get('_stopwatch_token'); - if (null === $sectionId) { - break; - } - $this->stopwatch->stopSection($sectionId); - break; - case KernelEvents::TERMINATE: - // In the special case described in the `preDispatch` method above, the `$token` section - // does not exist, then closing it throws an exception which must be caught. - $sectionId = $event->getRequest()->attributes->get('_stopwatch_token'); - if (null === $sectionId) { - break; - } - try { - $this->stopwatch->stopSection($sectionId); - } catch (\LogicException) { - } - break; - } - } -} diff --git a/vendor/symfony/http-kernel/DependencyInjection/AddAnnotatedClassesToCachePass.php b/vendor/symfony/http-kernel/DependencyInjection/AddAnnotatedClassesToCachePass.php deleted file mode 100644 index 9b691d26..00000000 --- a/vendor/symfony/http-kernel/DependencyInjection/AddAnnotatedClassesToCachePass.php +++ /dev/null @@ -1,142 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\DependencyInjection; - -use Composer\Autoload\ClassLoader; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\ErrorHandler\DebugClassLoader; -use Symfony\Component\HttpKernel\Kernel; - -/** - * Sets the classes to compile in the cache for the container. - * - * @author Fabien Potencier - */ -class AddAnnotatedClassesToCachePass implements CompilerPassInterface -{ - private Kernel $kernel; - - public function __construct(Kernel $kernel) - { - $this->kernel = $kernel; - } - - public function process(ContainerBuilder $container) - { - $annotatedClasses = []; - foreach ($container->getExtensions() as $extension) { - if ($extension instanceof Extension) { - $annotatedClasses[] = $extension->getAnnotatedClassesToCompile(); - } - } - - $annotatedClasses = array_merge($this->kernel->getAnnotatedClassesToCompile(), ...$annotatedClasses); - - $existingClasses = $this->getClassesInComposerClassMaps(); - - $annotatedClasses = $container->getParameterBag()->resolveValue($annotatedClasses); - $this->kernel->setAnnotatedClassCache($this->expandClasses($annotatedClasses, $existingClasses)); - } - - /** - * Expands the given class patterns using a list of existing classes. - * - * @param array $patterns The class patterns to expand - * @param array $classes The existing classes to match against the patterns - */ - private function expandClasses(array $patterns, array $classes): array - { - $expanded = []; - - // Explicit classes declared in the patterns are returned directly - foreach ($patterns as $key => $pattern) { - if (!str_ends_with($pattern, '\\') && !str_contains($pattern, '*')) { - unset($patterns[$key]); - $expanded[] = ltrim($pattern, '\\'); - } - } - - // Match patterns with the classes list - $regexps = $this->patternsToRegexps($patterns); - - foreach ($classes as $class) { - $class = ltrim($class, '\\'); - - if ($this->matchAnyRegexps($class, $regexps)) { - $expanded[] = $class; - } - } - - return array_unique($expanded); - } - - private function getClassesInComposerClassMaps(): array - { - $classes = []; - - foreach (spl_autoload_functions() as $function) { - if (!\is_array($function)) { - continue; - } - - if ($function[0] instanceof DebugClassLoader) { - $function = $function[0]->getClassLoader(); - } - - if (\is_array($function) && $function[0] instanceof ClassLoader) { - $classes += array_filter($function[0]->getClassMap()); - } - } - - return array_keys($classes); - } - - private function patternsToRegexps(array $patterns): array - { - $regexps = []; - - foreach ($patterns as $pattern) { - // Escape user input - $regex = preg_quote(ltrim($pattern, '\\')); - - // Wildcards * and ** - $regex = strtr($regex, ['\\*\\*' => '.*?', '\\*' => '[^\\\\]*?']); - - // If this class does not end by a slash, anchor the end - if (!str_ends_with($regex, '\\')) { - $regex .= '$'; - } - - $regexps[] = '{^\\\\'.$regex.'}'; - } - - return $regexps; - } - - private function matchAnyRegexps(string $class, array $regexps): bool - { - $isTest = str_contains($class, 'Test'); - - foreach ($regexps as $regex) { - if ($isTest && !str_contains($regex, 'Test')) { - continue; - } - - if (preg_match($regex, '\\'.$class)) { - return true; - } - } - - return false; - } -} diff --git a/vendor/symfony/http-kernel/DependencyInjection/ConfigurableExtension.php b/vendor/symfony/http-kernel/DependencyInjection/ConfigurableExtension.php deleted file mode 100644 index 8401dd4e..00000000 --- a/vendor/symfony/http-kernel/DependencyInjection/ConfigurableExtension.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\DependencyInjection; - -use Symfony\Component\DependencyInjection\ContainerBuilder; - -/** - * This extension sub-class provides first-class integration with the - * Config/Definition Component. - * - * You can use this as base class if - * - * a) you use the Config/Definition component for configuration, - * b) your configuration class is named "Configuration", and - * c) the configuration class resides in the DependencyInjection sub-folder. - * - * @author Johannes M. Schmitt - */ -abstract class ConfigurableExtension extends Extension -{ - final public function load(array $configs, ContainerBuilder $container) - { - $this->loadInternal($this->processConfiguration($this->getConfiguration($configs, $container), $configs), $container); - } - - /** - * Configures the passed container according to the merged configuration. - */ - abstract protected function loadInternal(array $mergedConfig, ContainerBuilder $container); -} diff --git a/vendor/symfony/http-kernel/DependencyInjection/ControllerArgumentValueResolverPass.php b/vendor/symfony/http-kernel/DependencyInjection/ControllerArgumentValueResolverPass.php deleted file mode 100644 index 281a7782..00000000 --- a/vendor/symfony/http-kernel/DependencyInjection/ControllerArgumentValueResolverPass.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\HttpKernel\DependencyInjection; - -use Symfony\Component\DependencyInjection\Argument\IteratorArgument; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\Compiler\PriorityTaggedServiceTrait; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\HttpKernel\Controller\ArgumentResolver\TraceableValueResolver; -use Symfony\Component\Stopwatch\Stopwatch; - -/** - * Gathers and configures the argument value resolvers. - * - * @author Iltar van der Berg - */ -class ControllerArgumentValueResolverPass implements CompilerPassInterface -{ - use PriorityTaggedServiceTrait; - - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('argument_resolver')) { - return; - } - - $resolvers = $this->findAndSortTaggedServices('controller.argument_value_resolver', $container); - - if ($container->getParameter('kernel.debug') && class_exists(Stopwatch::class) && $container->has('debug.stopwatch')) { - foreach ($resolvers as $resolverReference) { - $id = (string) $resolverReference; - $container->register("debug.$id", TraceableValueResolver::class) - ->setDecoratedService($id) - ->setArguments([new Reference("debug.$id.inner"), new Reference('debug.stopwatch')]); - } - } - - $container - ->getDefinition('argument_resolver') - ->replaceArgument(1, new IteratorArgument($resolvers)) - ; - } -} diff --git a/vendor/symfony/http-kernel/DependencyInjection/Extension.php b/vendor/symfony/http-kernel/DependencyInjection/Extension.php deleted file mode 100644 index c8d546e9..00000000 --- a/vendor/symfony/http-kernel/DependencyInjection/Extension.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. - */ - -namespace Symfony\Component\HttpKernel\DependencyInjection; - -use Symfony\Component\DependencyInjection\Extension\Extension as BaseExtension; - -/** - * Allow adding classes to the class cache. - * - * @author Fabien Potencier - */ -abstract class Extension extends BaseExtension -{ - private array $annotatedClasses = []; - - /** - * Gets the annotated classes to cache. - */ - public function getAnnotatedClassesToCompile(): array - { - return $this->annotatedClasses; - } - - /** - * Adds annotated classes to the class cache. - * - * @param array $annotatedClasses An array of class patterns - */ - public function addAnnotatedClassesToCompile(array $annotatedClasses) - { - $this->annotatedClasses = array_merge($this->annotatedClasses, $annotatedClasses); - } -} diff --git a/vendor/symfony/http-kernel/DependencyInjection/FragmentRendererPass.php b/vendor/symfony/http-kernel/DependencyInjection/FragmentRendererPass.php deleted file mode 100644 index ced62ae3..00000000 --- a/vendor/symfony/http-kernel/DependencyInjection/FragmentRendererPass.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\DependencyInjection; - -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\HttpKernel\Fragment\FragmentRendererInterface; - -/** - * Adds services tagged kernel.fragment_renderer as HTTP content rendering strategies. - * - * @author Fabien Potencier - */ -class FragmentRendererPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('fragment.handler')) { - return; - } - - $definition = $container->getDefinition('fragment.handler'); - $renderers = []; - foreach ($container->findTaggedServiceIds('kernel.fragment_renderer', true) as $id => $tags) { - $def = $container->getDefinition($id); - $class = $container->getParameterBag()->resolveValue($def->getClass()); - - if (!$r = $container->getReflectionClass($class)) { - throw new InvalidArgumentException(sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id)); - } - if (!$r->isSubclassOf(FragmentRendererInterface::class)) { - throw new InvalidArgumentException(sprintf('Service "%s" must implement interface "%s".', $id, FragmentRendererInterface::class)); - } - - foreach ($tags as $tag) { - $renderers[$tag['alias']] = new Reference($id); - } - } - - $definition->replaceArgument(0, ServiceLocatorTagPass::register($container, $renderers)); - } -} diff --git a/vendor/symfony/http-kernel/DependencyInjection/LazyLoadingFragmentHandler.php b/vendor/symfony/http-kernel/DependencyInjection/LazyLoadingFragmentHandler.php deleted file mode 100644 index 944b5d0b..00000000 --- a/vendor/symfony/http-kernel/DependencyInjection/LazyLoadingFragmentHandler.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\DependencyInjection; - -use Psr\Container\ContainerInterface; -use Symfony\Component\HttpFoundation\RequestStack; -use Symfony\Component\HttpKernel\Controller\ControllerReference; -use Symfony\Component\HttpKernel\Fragment\FragmentHandler; - -/** - * Lazily loads fragment renderers from the dependency injection container. - * - * @author Fabien Potencier - */ -class LazyLoadingFragmentHandler extends FragmentHandler -{ - private ContainerInterface $container; - - /** - * @var array - */ - private array $initialized = []; - - public function __construct(ContainerInterface $container, RequestStack $requestStack, bool $debug = false) - { - $this->container = $container; - - parent::__construct($requestStack, [], $debug); - } - - public function render(string|ControllerReference $uri, string $renderer = 'inline', array $options = []): ?string - { - if (!isset($this->initialized[$renderer]) && $this->container->has($renderer)) { - $this->addRenderer($this->container->get($renderer)); - $this->initialized[$renderer] = true; - } - - return parent::render($uri, $renderer, $options); - } -} diff --git a/vendor/symfony/http-kernel/DependencyInjection/LoggerPass.php b/vendor/symfony/http-kernel/DependencyInjection/LoggerPass.php deleted file mode 100644 index d780645f..00000000 --- a/vendor/symfony/http-kernel/DependencyInjection/LoggerPass.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\DependencyInjection; - -use Psr\Log\LoggerInterface; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\HttpFoundation\RequestStack; -use Symfony\Component\HttpKernel\Log\Logger; - -/** - * Registers the default logger if necessary. - * - * @author Kévin Dunglas - */ -class LoggerPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - $container->setAlias(LoggerInterface::class, 'logger') - ->setPublic(false); - - if ($container->has('logger')) { - return; - } - - $container->register('logger', Logger::class) - ->setArguments([null, null, null, new Reference(RequestStack::class)]) - ->setPublic(false); - } -} diff --git a/vendor/symfony/http-kernel/DependencyInjection/MergeExtensionConfigurationPass.php b/vendor/symfony/http-kernel/DependencyInjection/MergeExtensionConfigurationPass.php deleted file mode 100644 index c0bc6ecc..00000000 --- a/vendor/symfony/http-kernel/DependencyInjection/MergeExtensionConfigurationPass.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\DependencyInjection; - -use Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationPass as BaseMergeExtensionConfigurationPass; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -/** - * Ensures certain extensions are always loaded. - * - * @author Kris Wallsmith - */ -class MergeExtensionConfigurationPass extends BaseMergeExtensionConfigurationPass -{ - private array $extensions; - - /** - * @param string[] $extensions - */ - public function __construct(array $extensions) - { - $this->extensions = $extensions; - } - - public function process(ContainerBuilder $container) - { - foreach ($this->extensions as $extension) { - if (!\count($container->getExtensionConfig($extension))) { - $container->loadFromExtension($extension, []); - } - } - - parent::process($container); - } -} diff --git a/vendor/symfony/http-kernel/DependencyInjection/RegisterControllerArgumentLocatorsPass.php b/vendor/symfony/http-kernel/DependencyInjection/RegisterControllerArgumentLocatorsPass.php deleted file mode 100644 index c31fb35d..00000000 --- a/vendor/symfony/http-kernel/DependencyInjection/RegisterControllerArgumentLocatorsPass.php +++ /dev/null @@ -1,216 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\DependencyInjection; - -use Symfony\Component\DependencyInjection\Attribute\Autowire; -use Symfony\Component\DependencyInjection\Attribute\Target; -use Symfony\Component\DependencyInjection\ChildDefinition; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\TypedReference; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpFoundation\Session\SessionInterface; -use Symfony\Component\VarExporter\ProxyHelper; - -/** - * Creates the service-locators required by ServiceValueResolver. - * - * @author Nicolas Grekas - */ -class RegisterControllerArgumentLocatorsPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('argument_resolver.service') && !$container->hasDefinition('argument_resolver.not_tagged_controller')) { - return; - } - - $parameterBag = $container->getParameterBag(); - $controllers = []; - - $publicAliases = []; - foreach ($container->getAliases() as $id => $alias) { - if ($alias->isPublic() && !$alias->isPrivate()) { - $publicAliases[(string) $alias][] = $id; - } - } - - $emptyAutowireAttributes = class_exists(Autowire::class) ? null : []; - - foreach ($container->findTaggedServiceIds('controller.service_arguments', true) as $id => $tags) { - $def = $container->getDefinition($id); - $def->setPublic(true); - $class = $def->getClass(); - $autowire = $def->isAutowired(); - $bindings = $def->getBindings(); - - // resolve service class, taking parent definitions into account - while ($def instanceof ChildDefinition) { - $def = $container->findDefinition($def->getParent()); - $class = $class ?: $def->getClass(); - $bindings += $def->getBindings(); - } - $class = $parameterBag->resolveValue($class); - - if (!$r = $container->getReflectionClass($class)) { - throw new InvalidArgumentException(sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id)); - } - - // get regular public methods - $methods = []; - $arguments = []; - foreach ($r->getMethods(\ReflectionMethod::IS_PUBLIC) as $r) { - if ('setContainer' === $r->name) { - continue; - } - if (!$r->isConstructor() && !$r->isDestructor() && !$r->isAbstract()) { - $methods[strtolower($r->name)] = [$r, $r->getParameters()]; - } - } - - // validate and collect explicit per-actions and per-arguments service references - foreach ($tags as $attributes) { - if (!isset($attributes['action']) && !isset($attributes['argument']) && !isset($attributes['id'])) { - $autowire = true; - continue; - } - foreach (['action', 'argument', 'id'] as $k) { - if (!isset($attributes[$k][0])) { - throw new InvalidArgumentException(sprintf('Missing "%s" attribute on tag "controller.service_arguments" %s for service "%s".', $k, json_encode($attributes, \JSON_UNESCAPED_UNICODE), $id)); - } - } - if (!isset($methods[$action = strtolower($attributes['action'])])) { - throw new InvalidArgumentException(sprintf('Invalid "action" attribute on tag "controller.service_arguments" for service "%s": no public "%s()" method found on class "%s".', $id, $attributes['action'], $class)); - } - [$r, $parameters] = $methods[$action]; - $found = false; - - foreach ($parameters as $p) { - if ($attributes['argument'] === $p->name) { - if (!isset($arguments[$r->name][$p->name])) { - $arguments[$r->name][$p->name] = $attributes['id']; - } - $found = true; - break; - } - } - - if (!$found) { - throw new InvalidArgumentException(sprintf('Invalid "controller.service_arguments" tag for service "%s": method "%s()" has no "%s" argument on class "%s".', $id, $r->name, $attributes['argument'], $class)); - } - } - - foreach ($methods as [$r, $parameters]) { - /** @var \ReflectionMethod $r */ - - // create a per-method map of argument-names to service/type-references - $args = []; - foreach ($parameters as $p) { - /** @var \ReflectionParameter $p */ - $type = preg_replace('/(^|[(|&])\\\\/', '\1', $target = ltrim(ProxyHelper::exportType($p) ?? '', '?')); - $invalidBehavior = ContainerInterface::IGNORE_ON_INVALID_REFERENCE; - $autowireAttributes = $autowire ? $emptyAutowireAttributes : []; - - if (isset($arguments[$r->name][$p->name])) { - $target = $arguments[$r->name][$p->name]; - if ('?' !== $target[0]) { - $invalidBehavior = ContainerInterface::RUNTIME_EXCEPTION_ON_INVALID_REFERENCE; - } elseif ('' === $target = (string) substr($target, 1)) { - throw new InvalidArgumentException(sprintf('A "controller.service_arguments" tag must have non-empty "id" attributes for service "%s".', $id)); - } elseif ($p->allowsNull() && !$p->isOptional()) { - $invalidBehavior = ContainerInterface::NULL_ON_INVALID_REFERENCE; - } - } elseif (isset($bindings[$bindingName = $type.' $'.$name = Target::parseName($p)]) || isset($bindings[$bindingName = '$'.$name]) || isset($bindings[$bindingName = $type])) { - $binding = $bindings[$bindingName]; - - [$bindingValue, $bindingId, , $bindingType, $bindingFile] = $binding->getValues(); - $binding->setValues([$bindingValue, $bindingId, true, $bindingType, $bindingFile]); - - $args[$p->name] = $bindingValue; - - continue; - } elseif (!$autowire || (!($autowireAttributes ??= $p->getAttributes(Autowire::class)) && (!$type || '\\' !== $target[0]))) { - continue; - } elseif (is_subclass_of($type, \UnitEnum::class)) { - // do not attempt to register enum typed arguments if not already present in bindings - continue; - } elseif (!$p->allowsNull()) { - $invalidBehavior = ContainerInterface::RUNTIME_EXCEPTION_ON_INVALID_REFERENCE; - } - - if (Request::class === $type || SessionInterface::class === $type || Response::class === $type) { - continue; - } - - if ($autowireAttributes) { - $value = $autowireAttributes[0]->newInstance()->value; - - if ($value instanceof Reference) { - $args[$p->name] = $type ? new TypedReference($value, $type, $invalidBehavior, $p->name) : new Reference($value, $invalidBehavior); - } else { - $args[$p->name] = new Reference('.value.'.$container->hash($value)); - $container->register((string) $args[$p->name], 'mixed') - ->setFactory('current') - ->addArgument([$value]); - } - - continue; - } - - if ($type && !$p->isOptional() && !$p->allowsNull() && !class_exists($type) && !interface_exists($type, false)) { - $message = sprintf('Cannot determine controller argument for "%s::%s()": the $%s argument is type-hinted with the non-existent class or interface: "%s".', $class, $r->name, $p->name, $type); - - // see if the type-hint lives in the same namespace as the controller - if (0 === strncmp($type, $class, strrpos($class, '\\'))) { - $message .= ' Did you forget to add a use statement?'; - } - - $container->register($erroredId = '.errored.'.$container->hash($message), $type) - ->addError($message); - - $args[$p->name] = new Reference($erroredId, ContainerInterface::RUNTIME_EXCEPTION_ON_INVALID_REFERENCE); - } else { - $target = preg_replace('/(^|[(|&])\\\\/', '\1', $target); - $args[$p->name] = $type ? new TypedReference($target, $type, $invalidBehavior, Target::parseName($p)) : new Reference($target, $invalidBehavior); - } - } - // register the maps as a per-method service-locators - if ($args) { - $controllers[$id.'::'.$r->name] = ServiceLocatorTagPass::register($container, $args); - - foreach ($publicAliases[$id] ?? [] as $alias) { - $controllers[$alias.'::'.$r->name] = clone $controllers[$id.'::'.$r->name]; - } - } - } - } - - $controllerLocatorRef = ServiceLocatorTagPass::register($container, $controllers); - - if ($container->hasDefinition('argument_resolver.service')) { - $container->getDefinition('argument_resolver.service') - ->replaceArgument(0, $controllerLocatorRef); - } - - if ($container->hasDefinition('argument_resolver.not_tagged_controller')) { - $container->getDefinition('argument_resolver.not_tagged_controller') - ->replaceArgument(0, $controllerLocatorRef); - } - - $container->setAlias('argument_resolver.controller_locator', (string) $controllerLocatorRef); - } -} diff --git a/vendor/symfony/http-kernel/DependencyInjection/RegisterLocaleAwareServicesPass.php b/vendor/symfony/http-kernel/DependencyInjection/RegisterLocaleAwareServicesPass.php deleted file mode 100644 index 2141a510..00000000 --- a/vendor/symfony/http-kernel/DependencyInjection/RegisterLocaleAwareServicesPass.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\DependencyInjection; - -use Symfony\Component\DependencyInjection\Argument\IteratorArgument; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; - -/** - * Register all services that have the "kernel.locale_aware" tag into the listener. - * - * @author Pierre Bobiet - */ -class RegisterLocaleAwareServicesPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('locale_aware_listener')) { - return; - } - - $services = []; - - foreach ($container->findTaggedServiceIds('kernel.locale_aware') as $id => $tags) { - $services[] = new Reference($id); - } - - if (!$services) { - $container->removeDefinition('locale_aware_listener'); - - return; - } - - $container - ->getDefinition('locale_aware_listener') - ->setArgument(0, new IteratorArgument($services)) - ; - } -} diff --git a/vendor/symfony/http-kernel/DependencyInjection/RemoveEmptyControllerArgumentLocatorsPass.php b/vendor/symfony/http-kernel/DependencyInjection/RemoveEmptyControllerArgumentLocatorsPass.php deleted file mode 100644 index cbc92355..00000000 --- a/vendor/symfony/http-kernel/DependencyInjection/RemoveEmptyControllerArgumentLocatorsPass.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\DependencyInjection; - -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -/** - * Removes empty service-locators registered for ServiceValueResolver. - * - * @author Nicolas Grekas - */ -class RemoveEmptyControllerArgumentLocatorsPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - $controllerLocator = $container->findDefinition('argument_resolver.controller_locator'); - $controllers = $controllerLocator->getArgument(0); - - foreach ($controllers as $controller => $argumentRef) { - $argumentLocator = $container->getDefinition((string) $argumentRef->getValues()[0]); - - if (!$argumentLocator->getArgument(0)) { - // remove empty argument locators - $reason = sprintf('Removing service-argument resolver for controller "%s": no corresponding services exist for the referenced types.', $controller); - } else { - // any methods listed for call-at-instantiation cannot be actions - $reason = false; - [$id, $action] = explode('::', $controller); - - if ($container->hasAlias($id)) { - continue; - } - - $controllerDef = $container->getDefinition($id); - foreach ($controllerDef->getMethodCalls() as [$method]) { - if (0 === strcasecmp($action, $method)) { - $reason = sprintf('Removing method "%s" of service "%s" from controller candidates: the method is called at instantiation, thus cannot be an action.', $action, $id); - break; - } - } - if (!$reason) { - // see Symfony\Component\HttpKernel\Controller\ContainerControllerResolver - $controllers[$id.':'.$action] = $argumentRef; - - if ('__invoke' === $action) { - $controllers[$id] = $argumentRef; - } - continue; - } - } - - unset($controllers[$controller]); - $container->log($this, $reason); - } - - $controllerLocator->replaceArgument(0, $controllers); - } -} diff --git a/vendor/symfony/http-kernel/DependencyInjection/ResettableServicePass.php b/vendor/symfony/http-kernel/DependencyInjection/ResettableServicePass.php deleted file mode 100644 index 8418b4da..00000000 --- a/vendor/symfony/http-kernel/DependencyInjection/ResettableServicePass.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\DependencyInjection; - -use Symfony\Component\DependencyInjection\Argument\IteratorArgument; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\Exception\RuntimeException; -use Symfony\Component\DependencyInjection\Reference; - -/** - * @author Alexander M. Turek - */ -class ResettableServicePass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if (!$container->has('services_resetter')) { - return; - } - - $services = $methods = []; - - foreach ($container->findTaggedServiceIds('kernel.reset', true) as $id => $tags) { - $services[$id] = new Reference($id, ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE); - - foreach ($tags as $attributes) { - if (!isset($attributes['method'])) { - throw new RuntimeException(sprintf('Tag "kernel.reset" requires the "method" attribute to be set on service "%s".', $id)); - } - - if (!isset($methods[$id])) { - $methods[$id] = []; - } - - if ('ignore' === ($attributes['on_invalid'] ?? null)) { - $attributes['method'] = '?'.$attributes['method']; - } - - $methods[$id][] = $attributes['method']; - } - } - - if (!$services) { - $container->removeAlias('services_resetter'); - $container->removeDefinition('services_resetter'); - - return; - } - - $container->findDefinition('services_resetter') - ->setArgument(0, new IteratorArgument($services)) - ->setArgument(1, $methods); - } -} diff --git a/vendor/symfony/http-kernel/DependencyInjection/ServicesResetter.php b/vendor/symfony/http-kernel/DependencyInjection/ServicesResetter.php deleted file mode 100644 index e7be3b88..00000000 --- a/vendor/symfony/http-kernel/DependencyInjection/ServicesResetter.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\HttpKernel\DependencyInjection; - -use Symfony\Contracts\Service\ResetInterface; - -/** - * Resets provided services. - * - * @author Alexander M. Turek - * @author Nicolas Grekas - * - * @internal - */ -class ServicesResetter implements ResetInterface -{ - private \Traversable $resettableServices; - private array $resetMethods; - - /** - * @param \Traversable $resettableServices - * @param array $resetMethods - */ - public function __construct(\Traversable $resettableServices, array $resetMethods) - { - $this->resettableServices = $resettableServices; - $this->resetMethods = $resetMethods; - } - - public function reset() - { - foreach ($this->resettableServices as $id => $service) { - foreach ((array) $this->resetMethods[$id] as $resetMethod) { - if ('?' === $resetMethod[0] && !method_exists($service, $resetMethod = substr($resetMethod, 1))) { - continue; - } - - $service->$resetMethod(); - } - } - } -} diff --git a/vendor/symfony/http-kernel/Event/ControllerArgumentsEvent.php b/vendor/symfony/http-kernel/Event/ControllerArgumentsEvent.php deleted file mode 100644 index 0af39671..00000000 --- a/vendor/symfony/http-kernel/Event/ControllerArgumentsEvent.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\Component\HttpKernel\Event; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpKernel\HttpKernelInterface; - -/** - * Allows filtering of controller arguments. - * - * You can call getController() to retrieve the controller and getArguments - * to retrieve the current arguments. With setArguments() you can replace - * arguments that are used to call the controller. - * - * Arguments set in the event must be compatible with the signature of the - * controller. - * - * @author Christophe Coevoet - */ -final class ControllerArgumentsEvent extends KernelEvent -{ - private ControllerEvent $controllerEvent; - private array $arguments; - private array $namedArguments; - - public function __construct(HttpKernelInterface $kernel, callable|ControllerEvent $controller, array $arguments, Request $request, ?int $requestType) - { - parent::__construct($kernel, $request, $requestType); - - if (!$controller instanceof ControllerEvent) { - $controller = new ControllerEvent($kernel, $controller, $request, $requestType); - } - - $this->controllerEvent = $controller; - $this->arguments = $arguments; - } - - public function getController(): callable - { - return $this->controllerEvent->getController(); - } - - /** - * @param array>|null $attributes - */ - public function setController(callable $controller, array $attributes = null): void - { - $this->controllerEvent->setController($controller, $attributes); - unset($this->namedArguments); - } - - public function getArguments(): array - { - return $this->arguments; - } - - public function setArguments(array $arguments) - { - $this->arguments = $arguments; - unset($this->namedArguments); - } - - public function getNamedArguments(): array - { - if (isset($this->namedArguments)) { - return $this->namedArguments; - } - - $namedArguments = []; - $arguments = $this->arguments; - - foreach ($this->controllerEvent->getControllerReflector()->getParameters() as $i => $param) { - if ($param->isVariadic()) { - $namedArguments[$param->name] = \array_slice($arguments, $i); - break; - } - if (\array_key_exists($i, $arguments)) { - $namedArguments[$param->name] = $arguments[$i]; - } elseif ($param->isDefaultvalueAvailable()) { - $namedArguments[$param->name] = $param->getDefaultValue(); - } - } - - return $this->namedArguments = $namedArguments; - } - - /** - * @return array> - */ - public function getAttributes(): array - { - return $this->controllerEvent->getAttributes(); - } -} diff --git a/vendor/symfony/http-kernel/Event/ControllerEvent.php b/vendor/symfony/http-kernel/Event/ControllerEvent.php deleted file mode 100644 index b012263b..00000000 --- a/vendor/symfony/http-kernel/Event/ControllerEvent.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\HttpKernel\Event; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpKernel\HttpKernelInterface; - -/** - * Allows filtering of a controller callable. - * - * You can call getController() to retrieve the current controller. With - * setController() you can set a new controller that is used in the processing - * of the request. - * - * Controllers should be callables. - * - * @author Bernhard Schussek - */ -final class ControllerEvent extends KernelEvent -{ - private string|array|object $controller; - private \ReflectionFunctionAbstract $controllerReflector; - private array $attributes; - - public function __construct(HttpKernelInterface $kernel, callable $controller, Request $request, ?int $requestType) - { - parent::__construct($kernel, $request, $requestType); - - $this->setController($controller); - } - - public function getController(): callable - { - return $this->controller; - } - - public function getControllerReflector(): \ReflectionFunctionAbstract - { - return $this->controllerReflector; - } - - /** - * @param array>|null $attributes - */ - public function setController(callable $controller, array $attributes = null): void - { - if (null !== $attributes) { - $this->attributes = $attributes; - } - - if (isset($this->controller) && ($controller instanceof \Closure ? $controller == $this->controller : $controller === $this->controller)) { - $this->controller = $controller; - - return; - } - - if (null === $attributes) { - unset($this->attributes); - } - - if (\is_array($controller) && method_exists(...$controller)) { - $this->controllerReflector = new \ReflectionMethod(...$controller); - } elseif (\is_string($controller) && false !== $i = strpos($controller, '::')) { - $this->controllerReflector = new \ReflectionMethod($controller); - } else { - $this->controllerReflector = new \ReflectionFunction($controller(...)); - } - - $this->controller = $controller; - } - - /** - * @return array> - */ - public function getAttributes(): array - { - if (isset($this->attributes)) { - return $this->attributes; - } - - if (\is_array($this->controller) && method_exists(...$this->controller)) { - $class = new \ReflectionClass($this->controller[0]); - } elseif (\is_string($this->controller) && false !== $i = strpos($this->controller, '::')) { - $class = new \ReflectionClass(substr($this->controller, 0, $i)); - } else { - $class = str_contains($this->controllerReflector->name, '{closure}') ? null : (\PHP_VERSION_ID >= 80111 ? $this->controllerReflector->getClosureCalledClass() : $this->controllerReflector->getClosureScopeClass()); - } - $this->attributes = []; - - foreach (array_merge($class?->getAttributes() ?? [], $this->controllerReflector->getAttributes()) as $attribute) { - if (class_exists($attribute->getName())) { - $this->attributes[$attribute->getName()][] = $attribute->newInstance(); - } - } - - return $this->attributes; - } -} diff --git a/vendor/symfony/http-kernel/Event/ExceptionEvent.php b/vendor/symfony/http-kernel/Event/ExceptionEvent.php deleted file mode 100644 index 8bc25f9c..00000000 --- a/vendor/symfony/http-kernel/Event/ExceptionEvent.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Event; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpKernel\HttpKernelInterface; - -/** - * Allows to create a response for a thrown exception. - * - * Call setResponse() to set the response that will be returned for the - * current request. The propagation of this event is stopped as soon as a - * response is set. - * - * You can also call setThrowable() to replace the thrown exception. This - * exception will be thrown if no response is set during processing of this - * event. - * - * @author Bernhard Schussek - */ -final class ExceptionEvent extends RequestEvent -{ - private \Throwable $throwable; - private bool $allowCustomResponseCode = false; - - public function __construct(HttpKernelInterface $kernel, Request $request, int $requestType, \Throwable $e) - { - parent::__construct($kernel, $request, $requestType); - - $this->setThrowable($e); - } - - public function getThrowable(): \Throwable - { - return $this->throwable; - } - - /** - * Replaces the thrown exception. - * - * This exception will be thrown if no response is set in the event. - */ - public function setThrowable(\Throwable $exception): void - { - $this->throwable = $exception; - } - - /** - * Mark the event as allowing a custom response code. - */ - public function allowCustomResponseCode(): void - { - $this->allowCustomResponseCode = true; - } - - /** - * Returns true if the event allows a custom response code. - */ - public function isAllowingCustomResponseCode(): bool - { - return $this->allowCustomResponseCode; - } -} diff --git a/vendor/symfony/http-kernel/Event/FinishRequestEvent.php b/vendor/symfony/http-kernel/Event/FinishRequestEvent.php deleted file mode 100644 index 306a7ad1..00000000 --- a/vendor/symfony/http-kernel/Event/FinishRequestEvent.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Event; - -/** - * Triggered whenever a request is fully processed. - * - * @author Benjamin Eberlei - */ -final class FinishRequestEvent extends KernelEvent -{ -} diff --git a/vendor/symfony/http-kernel/Event/KernelEvent.php b/vendor/symfony/http-kernel/Event/KernelEvent.php deleted file mode 100644 index e64cc419..00000000 --- a/vendor/symfony/http-kernel/Event/KernelEvent.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Event; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpKernel\HttpKernelInterface; -use Symfony\Contracts\EventDispatcher\Event; - -/** - * Base class for events thrown in the HttpKernel component. - * - * @author Bernhard Schussek - */ -class KernelEvent extends Event -{ - private HttpKernelInterface $kernel; - private Request $request; - private ?int $requestType; - - /** - * @param int $requestType The request type the kernel is currently processing; one of - * HttpKernelInterface::MAIN_REQUEST or HttpKernelInterface::SUB_REQUEST - */ - public function __construct(HttpKernelInterface $kernel, Request $request, ?int $requestType) - { - $this->kernel = $kernel; - $this->request = $request; - $this->requestType = $requestType; - } - - /** - * Returns the kernel in which this event was thrown. - */ - public function getKernel(): HttpKernelInterface - { - return $this->kernel; - } - - /** - * Returns the request the kernel is currently processing. - */ - public function getRequest(): Request - { - return $this->request; - } - - /** - * Returns the request type the kernel is currently processing. - * - * @return int One of HttpKernelInterface::MAIN_REQUEST and - * HttpKernelInterface::SUB_REQUEST - */ - public function getRequestType(): int - { - return $this->requestType; - } - - /** - * Checks if this is the main request. - */ - public function isMainRequest(): bool - { - return HttpKernelInterface::MAIN_REQUEST === $this->requestType; - } -} diff --git a/vendor/symfony/http-kernel/Event/RequestEvent.php b/vendor/symfony/http-kernel/Event/RequestEvent.php deleted file mode 100644 index c7cfcc1e..00000000 --- a/vendor/symfony/http-kernel/Event/RequestEvent.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Event; - -use Symfony\Component\HttpFoundation\Response; - -/** - * Allows to create a response for a request. - * - * Call setResponse() to set the response that will be returned for the - * current request. The propagation of this event is stopped as soon as a - * response is set. - * - * @author Bernhard Schussek - */ -class RequestEvent extends KernelEvent -{ - private ?Response $response = null; - - /** - * Returns the response object. - */ - public function getResponse(): ?Response - { - return $this->response; - } - - /** - * Sets a response and stops event propagation. - */ - public function setResponse(Response $response) - { - $this->response = $response; - - $this->stopPropagation(); - } - - /** - * Returns whether a response was set. - */ - public function hasResponse(): bool - { - return null !== $this->response; - } -} diff --git a/vendor/symfony/http-kernel/Event/ResponseEvent.php b/vendor/symfony/http-kernel/Event/ResponseEvent.php deleted file mode 100644 index 4a57d989..00000000 --- a/vendor/symfony/http-kernel/Event/ResponseEvent.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Event; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\HttpKernelInterface; - -/** - * Allows to filter a Response object. - * - * You can call getResponse() to retrieve the current response. With - * setResponse() you can set a new response that will be returned to the - * browser. - * - * @author Bernhard Schussek - */ -final class ResponseEvent extends KernelEvent -{ - private Response $response; - - public function __construct(HttpKernelInterface $kernel, Request $request, int $requestType, Response $response) - { - parent::__construct($kernel, $request, $requestType); - - $this->setResponse($response); - } - - public function getResponse(): Response - { - return $this->response; - } - - public function setResponse(Response $response): void - { - $this->response = $response; - } -} diff --git a/vendor/symfony/http-kernel/Event/TerminateEvent.php b/vendor/symfony/http-kernel/Event/TerminateEvent.php deleted file mode 100644 index 0caefdf4..00000000 --- a/vendor/symfony/http-kernel/Event/TerminateEvent.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Event; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\HttpKernelInterface; - -/** - * Allows to execute logic after a response was sent. - * - * Since it's only triggered on main requests, the `getRequestType()` method - * will always return the value of `HttpKernelInterface::MAIN_REQUEST`. - * - * @author Jordi Boggiano - */ -final class TerminateEvent extends KernelEvent -{ - private Response $response; - - public function __construct(HttpKernelInterface $kernel, Request $request, Response $response) - { - parent::__construct($kernel, $request, HttpKernelInterface::MAIN_REQUEST); - - $this->response = $response; - } - - public function getResponse(): Response - { - return $this->response; - } -} diff --git a/vendor/symfony/http-kernel/Event/ViewEvent.php b/vendor/symfony/http-kernel/Event/ViewEvent.php deleted file mode 100644 index bf96985b..00000000 --- a/vendor/symfony/http-kernel/Event/ViewEvent.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Event; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpKernel\HttpKernelInterface; - -/** - * Allows to create a response for the return value of a controller. - * - * Call setResponse() to set the response that will be returned for the - * current request. The propagation of this event is stopped as soon as a - * response is set. - * - * @author Bernhard Schussek - */ -final class ViewEvent extends RequestEvent -{ - public readonly ?ControllerArgumentsEvent $controllerArgumentsEvent; - private mixed $controllerResult; - - public function __construct(HttpKernelInterface $kernel, Request $request, int $requestType, mixed $controllerResult, ControllerArgumentsEvent $controllerArgumentsEvent = null) - { - parent::__construct($kernel, $request, $requestType); - - $this->controllerResult = $controllerResult; - $this->controllerArgumentsEvent = $controllerArgumentsEvent; - } - - public function getControllerResult(): mixed - { - return $this->controllerResult; - } - - public function setControllerResult(mixed $controllerResult): void - { - $this->controllerResult = $controllerResult; - } -} diff --git a/vendor/symfony/http-kernel/EventListener/AbstractSessionListener.php b/vendor/symfony/http-kernel/EventListener/AbstractSessionListener.php deleted file mode 100644 index c41d6fbe..00000000 --- a/vendor/symfony/http-kernel/EventListener/AbstractSessionListener.php +++ /dev/null @@ -1,300 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\EventListener; - -use Psr\Container\ContainerInterface; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\HttpFoundation\Cookie; -use Symfony\Component\HttpFoundation\Session\Session; -use Symfony\Component\HttpFoundation\Session\SessionInterface; -use Symfony\Component\HttpFoundation\Session\SessionUtils; -use Symfony\Component\HttpKernel\Event\RequestEvent; -use Symfony\Component\HttpKernel\Event\ResponseEvent; -use Symfony\Component\HttpKernel\Exception\UnexpectedSessionUsageException; -use Symfony\Component\HttpKernel\KernelEvents; -use Symfony\Contracts\Service\ResetInterface; - -/** - * Sets the session onto the request on the "kernel.request" event and saves - * it on the "kernel.response" event. - * - * In addition, if the session has been started it overrides the Cache-Control - * header in such a way that all caching is disabled in that case. - * If you have a scenario where caching responses with session information in - * them makes sense, you can disable this behaviour by setting the header - * AbstractSessionListener::NO_AUTO_CACHE_CONTROL_HEADER on the response. - * - * @author Johannes M. Schmitt - * @author Tobias Schultze - * - * @internal - */ -abstract class AbstractSessionListener implements EventSubscriberInterface, ResetInterface -{ - public const NO_AUTO_CACHE_CONTROL_HEADER = 'Symfony-Session-NoAutoCacheControl'; - - protected $container; - private bool $debug; - - /** - * @var array - */ - private $sessionOptions; - - public function __construct(ContainerInterface $container = null, bool $debug = false, array $sessionOptions = []) - { - $this->container = $container; - $this->debug = $debug; - $this->sessionOptions = $sessionOptions; - } - - public function onKernelRequest(RequestEvent $event) - { - if (!$event->isMainRequest()) { - return; - } - - $request = $event->getRequest(); - if (!$request->hasSession()) { - // This variable prevents calling `$this->getSession()` twice in case the Request (and the below factory) is cloned - $sess = null; - $request->setSessionFactory(function () use (&$sess, $request) { - if (!$sess) { - $sess = $this->getSession(); - - /* - * For supporting sessions in php runtime with runners like roadrunner or swoole, the session - * cookie needs to be read from the cookie bag and set on the session storage. - * - * Do not set it when a native php session is active. - */ - if ($sess && !$sess->isStarted() && \PHP_SESSION_ACTIVE !== session_status()) { - $sessionId = $sess->getId() ?: $request->cookies->get($sess->getName(), ''); - $sess->setId($sessionId); - } - } - - return $sess; - }); - } - } - - public function onKernelResponse(ResponseEvent $event) - { - if (!$event->isMainRequest() || (!$this->container->has('initialized_session') && !$event->getRequest()->hasSession())) { - return; - } - - $response = $event->getResponse(); - $autoCacheControl = !$response->headers->has(self::NO_AUTO_CACHE_CONTROL_HEADER); - // Always remove the internal header if present - $response->headers->remove(self::NO_AUTO_CACHE_CONTROL_HEADER); - if (!$event->getRequest()->hasSession(true)) { - return; - } - $session = $event->getRequest()->getSession(); - - if ($session->isStarted()) { - /* - * Saves the session, in case it is still open, before sending the response/headers. - * - * This ensures several things in case the developer did not save the session explicitly: - * - * * If a session save handler without locking is used, it ensures the data is available - * on the next request, e.g. after a redirect. PHPs auto-save at script end via - * session_register_shutdown is executed after fastcgi_finish_request. So in this case - * the data could be missing the next request because it might not be saved the moment - * the new request is processed. - * * A locking save handler (e.g. the native 'files') circumvents concurrency problems like - * the one above. But by saving the session before long-running things in the terminate event, - * we ensure the session is not blocked longer than needed. - * * When regenerating the session ID no locking is involved in PHPs session design. See - * https://bugs.php.net/61470 for a discussion. So in this case, the session must - * be saved anyway before sending the headers with the new session ID. Otherwise session - * data could get lost again for concurrent requests with the new ID. One result could be - * that you get logged out after just logging in. - * - * This listener should be executed as one of the last listeners, so that previous listeners - * can still operate on the open session. This prevents the overhead of restarting it. - * Listeners after closing the session can still work with the session as usual because - * Symfonys session implementation starts the session on demand. So writing to it after - * it is saved will just restart it. - */ - $session->save(); - - /* - * For supporting sessions in php runtime with runners like roadrunner or swoole the session - * cookie need to be written on the response object and should not be written by PHP itself. - */ - $sessionName = $session->getName(); - $sessionId = $session->getId(); - $sessionOptions = $this->getSessionOptions($this->sessionOptions); - $sessionCookiePath = $sessionOptions['cookie_path'] ?? '/'; - $sessionCookieDomain = $sessionOptions['cookie_domain'] ?? null; - $sessionCookieSecure = $sessionOptions['cookie_secure'] ?? false; - $sessionCookieHttpOnly = $sessionOptions['cookie_httponly'] ?? true; - $sessionCookieSameSite = $sessionOptions['cookie_samesite'] ?? Cookie::SAMESITE_LAX; - $sessionUseCookies = $sessionOptions['use_cookies'] ?? true; - - SessionUtils::popSessionCookie($sessionName, $sessionId); - - if ($sessionUseCookies) { - $request = $event->getRequest(); - $requestSessionCookieId = $request->cookies->get($sessionName); - - $isSessionEmpty = ($session instanceof Session ? $session->isEmpty() : !$session->all()) && empty($_SESSION); // checking $_SESSION to keep compatibility with native sessions - if ($requestSessionCookieId && $isSessionEmpty) { - // PHP internally sets the session cookie value to "deleted" when setcookie() is called with empty string $value argument - // which happens in \Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler::destroy - // when the session gets invalidated (for example on logout) so we must handle this case here too - // otherwise we would send two Set-Cookie headers back with the response - SessionUtils::popSessionCookie($sessionName, 'deleted'); - $response->headers->clearCookie( - $sessionName, - $sessionCookiePath, - $sessionCookieDomain, - $sessionCookieSecure, - $sessionCookieHttpOnly, - $sessionCookieSameSite - ); - } elseif ($sessionId !== $requestSessionCookieId && !$isSessionEmpty) { - $expire = 0; - $lifetime = $sessionOptions['cookie_lifetime'] ?? null; - if ($lifetime) { - $expire = time() + $lifetime; - } - - $response->headers->setCookie( - Cookie::create( - $sessionName, - $sessionId, - $expire, - $sessionCookiePath, - $sessionCookieDomain, - $sessionCookieSecure, - $sessionCookieHttpOnly, - false, - $sessionCookieSameSite - ) - ); - } - } - } - - if ($session instanceof Session ? 0 === $session->getUsageIndex() : !$session->isStarted()) { - return; - } - - if ($autoCacheControl) { - $maxAge = $response->headers->hasCacheControlDirective('public') ? 0 : (int) $response->getMaxAge(); - $response - ->setExpires(new \DateTimeImmutable('+'.$maxAge.' seconds')) - ->setPrivate() - ->setMaxAge($maxAge) - ->headers->addCacheControlDirective('must-revalidate'); - } - - if (!$event->getRequest()->attributes->get('_stateless', false)) { - return; - } - - if ($this->debug) { - throw new UnexpectedSessionUsageException('Session was used while the request was declared stateless.'); - } - - if ($this->container->has('logger')) { - $this->container->get('logger')->warning('Session was used while the request was declared stateless.'); - } - } - - public function onSessionUsage(): void - { - if (!$this->debug) { - return; - } - - if ($this->container?->has('session_collector')) { - $this->container->get('session_collector')(); - } - - if (!$requestStack = $this->container?->has('request_stack') ? $this->container->get('request_stack') : null) { - return; - } - - $stateless = false; - $clonedRequestStack = clone $requestStack; - while (null !== ($request = $clonedRequestStack->pop()) && !$stateless) { - $stateless = $request->attributes->get('_stateless'); - } - - if (!$stateless) { - return; - } - - if (!$session = $requestStack->getCurrentRequest()->getSession()) { - return; - } - - if ($session->isStarted()) { - $session->save(); - } - - throw new UnexpectedSessionUsageException('Session was used while the request was declared stateless.'); - } - - public static function getSubscribedEvents(): array - { - return [ - KernelEvents::REQUEST => ['onKernelRequest', 128], - // low priority to come after regular response listeners - KernelEvents::RESPONSE => ['onKernelResponse', -1000], - ]; - } - - public function reset(): void - { - if (\PHP_SESSION_ACTIVE === session_status()) { - session_abort(); - } - - session_unset(); - $_SESSION = []; - - if (!headers_sent()) { // session id can only be reset when no headers were so we check for headers_sent first - session_id(''); - } - } - - /** - * Gets the session object. - */ - abstract protected function getSession(): ?SessionInterface; - - private function getSessionOptions(array $sessionOptions): array - { - $mergedSessionOptions = []; - - foreach (session_get_cookie_params() as $key => $value) { - $mergedSessionOptions['cookie_'.$key] = $value; - } - - foreach ($sessionOptions as $key => $value) { - // do the same logic as in the NativeSessionStorage - if ('cookie_secure' === $key && 'auto' === $value) { - continue; - } - $mergedSessionOptions[$key] = $value; - } - - return $mergedSessionOptions; - } -} diff --git a/vendor/symfony/http-kernel/EventListener/AddRequestFormatsListener.php b/vendor/symfony/http-kernel/EventListener/AddRequestFormatsListener.php deleted file mode 100644 index c3fc3fb6..00000000 --- a/vendor/symfony/http-kernel/EventListener/AddRequestFormatsListener.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\EventListener; - -use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\HttpKernel\Event\RequestEvent; -use Symfony\Component\HttpKernel\KernelEvents; - -/** - * Adds configured formats to each request. - * - * @author Gildas Quemener - * - * @final - */ -class AddRequestFormatsListener implements EventSubscriberInterface -{ - private array $formats; - - public function __construct(array $formats) - { - $this->formats = $formats; - } - - /** - * Adds request formats. - */ - public function onKernelRequest(RequestEvent $event) - { - $request = $event->getRequest(); - foreach ($this->formats as $format => $mimeTypes) { - $request->setFormat($format, $mimeTypes); - } - } - - public static function getSubscribedEvents(): array - { - return [KernelEvents::REQUEST => ['onKernelRequest', 100]]; - } -} diff --git a/vendor/symfony/http-kernel/EventListener/CacheAttributeListener.php b/vendor/symfony/http-kernel/EventListener/CacheAttributeListener.php deleted file mode 100644 index 2230b8f6..00000000 --- a/vendor/symfony/http-kernel/EventListener/CacheAttributeListener.php +++ /dev/null @@ -1,193 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\EventListener; - -use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\ExpressionLanguage\ExpressionLanguage; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\Attribute\Cache; -use Symfony\Component\HttpKernel\Event\ControllerArgumentsEvent; -use Symfony\Component\HttpKernel\Event\ResponseEvent; -use Symfony\Component\HttpKernel\KernelEvents; - -/** - * Handles HTTP cache headers configured via the Cache attribute. - * - * @author Fabien Potencier - */ -class CacheAttributeListener implements EventSubscriberInterface -{ - /** - * @var \SplObjectStorage - */ - private \SplObjectStorage $lastModified; - - /** - * @var \SplObjectStorage - */ - private \SplObjectStorage $etags; - - public function __construct( - private ?ExpressionLanguage $expressionLanguage = null, - ) { - $this->lastModified = new \SplObjectStorage(); - $this->etags = new \SplObjectStorage(); - } - - /** - * Handles HTTP validation headers. - */ - public function onKernelControllerArguments(ControllerArgumentsEvent $event) - { - $request = $event->getRequest(); - - if (!\is_array($attributes = $request->attributes->get('_cache') ?? $event->getAttributes()[Cache::class] ?? null)) { - return; - } - - $request->attributes->set('_cache', $attributes); - $response = null; - $lastModified = null; - $etag = null; - - /** @var Cache[] $attributes */ - foreach ($attributes as $cache) { - if (null !== $cache->lastModified) { - $lastModified = $this->getExpressionLanguage()->evaluate($cache->lastModified, array_merge($request->attributes->all(), $event->getNamedArguments())); - ($response ??= new Response())->setLastModified($lastModified); - } - - if (null !== $cache->etag) { - $etag = hash('sha256', $this->getExpressionLanguage()->evaluate($cache->etag, array_merge($request->attributes->all(), $event->getNamedArguments()))); - ($response ??= new Response())->setEtag($etag); - } - } - - if ($response?->isNotModified($request)) { - $event->setController(static fn () => $response); - $event->stopPropagation(); - - return; - } - - if (null !== $etag) { - $this->etags[$request] = $etag; - } - if (null !== $lastModified) { - $this->lastModified[$request] = $lastModified; - } - } - - /** - * Modifies the response to apply HTTP cache headers when needed. - */ - public function onKernelResponse(ResponseEvent $event) - { - $request = $event->getRequest(); - - /** @var Cache[] $attributes */ - if (!\is_array($attributes = $request->attributes->get('_cache'))) { - return; - } - $response = $event->getResponse(); - - // http://tools.ietf.org/html/draft-ietf-httpbis-p4-conditional-12#section-3.1 - if (!\in_array($response->getStatusCode(), [200, 203, 300, 301, 302, 304, 404, 410])) { - unset($this->lastModified[$request]); - unset($this->etags[$request]); - - return; - } - - if (isset($this->lastModified[$request]) && !$response->headers->has('Last-Modified')) { - $response->setLastModified($this->lastModified[$request]); - } - - if (isset($this->etags[$request]) && !$response->headers->has('Etag')) { - $response->setEtag($this->etags[$request]); - } - - unset($this->lastModified[$request]); - unset($this->etags[$request]); - $hasVary = $response->headers->has('Vary'); - - foreach (array_reverse($attributes) as $cache) { - if (null !== $cache->smaxage && !$response->headers->hasCacheControlDirective('s-maxage')) { - $response->setSharedMaxAge($this->toSeconds($cache->smaxage)); - } - - if ($cache->mustRevalidate) { - $response->headers->addCacheControlDirective('must-revalidate'); - } - - if (null !== $cache->maxage && !$response->headers->hasCacheControlDirective('max-age')) { - $response->setMaxAge($this->toSeconds($cache->maxage)); - } - - if (null !== $cache->maxStale && !$response->headers->hasCacheControlDirective('max-stale')) { - $response->headers->addCacheControlDirective('max-stale', $this->toSeconds($cache->maxStale)); - } - - if (null !== $cache->staleWhileRevalidate && !$response->headers->hasCacheControlDirective('stale-while-revalidate')) { - $response->headers->addCacheControlDirective('stale-while-revalidate', $this->toSeconds($cache->staleWhileRevalidate)); - } - - if (null !== $cache->staleIfError && !$response->headers->hasCacheControlDirective('stale-if-error')) { - $response->headers->addCacheControlDirective('stale-if-error', $this->toSeconds($cache->staleIfError)); - } - - if (null !== $cache->expires && !$response->headers->has('Expires')) { - $response->setExpires(new \DateTimeImmutable('@'.strtotime($cache->expires, time()))); - } - - if (!$hasVary && $cache->vary) { - $response->setVary($cache->vary, false); - } - } - - foreach ($attributes as $cache) { - if (true === $cache->public) { - $response->setPublic(); - } - - if (false === $cache->public) { - $response->setPrivate(); - } - } - } - - public static function getSubscribedEvents(): array - { - return [ - KernelEvents::CONTROLLER_ARGUMENTS => ['onKernelControllerArguments', 10], - KernelEvents::RESPONSE => ['onKernelResponse', -10], - ]; - } - - private function getExpressionLanguage(): ExpressionLanguage - { - return $this->expressionLanguage ??= class_exists(ExpressionLanguage::class) - ? new ExpressionLanguage() - : throw new \LogicException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed. Try running "composer require symfony/expression-language".'); - } - - private function toSeconds(int|string $time): int - { - if (!is_numeric($time)) { - $now = time(); - $time = strtotime($time, $now) - $now; - } - - return $time; - } -} diff --git a/vendor/symfony/http-kernel/EventListener/DebugHandlersListener.php b/vendor/symfony/http-kernel/EventListener/DebugHandlersListener.php deleted file mode 100644 index 4f9ceb73..00000000 --- a/vendor/symfony/http-kernel/EventListener/DebugHandlersListener.php +++ /dev/null @@ -1,184 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\EventListener; - -use Psr\Log\LoggerInterface; -use Symfony\Component\Console\ConsoleEvents; -use Symfony\Component\Console\Event\ConsoleEvent; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\ErrorHandler\ErrorHandler; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\HttpKernel\Event\KernelEvent; -use Symfony\Component\HttpKernel\KernelEvents; - -/** - * Configures errors and exceptions handlers. - * - * @author Nicolas Grekas - * - * @final - * - * @internal - */ -class DebugHandlersListener implements EventSubscriberInterface -{ - private string|object|null $earlyHandler; - private ?\Closure $exceptionHandler; - private ?LoggerInterface $logger; - private ?LoggerInterface $deprecationLogger; - private array|int|null $levels; - private ?int $throwAt; - private bool $scream; - private bool $scope; - private bool $firstCall = true; - private bool $hasTerminatedWithException = false; - - /** - * @param callable|null $exceptionHandler A handler that must support \Throwable instances that will be called on Exception - * @param array|int|null $levels An array map of E_* to LogLevel::* or an integer bit field of E_* constants - * @param int|null $throwAt Thrown errors in a bit field of E_* constants, or null to keep the current value - * @param bool $scream Enables/disables screaming mode, where even silenced errors are logged - * @param bool $scope Enables/disables scoping mode - */ - public function __construct(callable $exceptionHandler = null, LoggerInterface $logger = null, array|int|null $levels = \E_ALL, ?int $throwAt = \E_ALL, bool $scream = true, bool $scope = true, LoggerInterface $deprecationLogger = null) - { - $handler = set_exception_handler('is_int'); - $this->earlyHandler = \is_array($handler) ? $handler[0] : null; - restore_exception_handler(); - - $this->exceptionHandler = null === $exceptionHandler ? null : $exceptionHandler(...); - $this->logger = $logger; - $this->levels = $levels ?? \E_ALL; - $this->throwAt = \is_int($throwAt) ? $throwAt : (null === $throwAt ? null : ($throwAt ? \E_ALL : null)); - $this->scream = $scream; - $this->scope = $scope; - $this->deprecationLogger = $deprecationLogger; - } - - /** - * Configures the error handler. - */ - public function configure(object $event = null) - { - if ($event instanceof ConsoleEvent && !\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true)) { - return; - } - if (!$event instanceof KernelEvent ? !$this->firstCall : !$event->isMainRequest()) { - return; - } - $this->firstCall = $this->hasTerminatedWithException = false; - - $handler = set_exception_handler('is_int'); - $handler = \is_array($handler) ? $handler[0] : null; - restore_exception_handler(); - - if (!$handler instanceof ErrorHandler) { - $handler = $this->earlyHandler; - } - - if ($handler instanceof ErrorHandler) { - if ($this->logger || $this->deprecationLogger) { - $this->setDefaultLoggers($handler); - if (\is_array($this->levels)) { - $levels = 0; - foreach ($this->levels as $type => $log) { - $levels |= $type; - } - } else { - $levels = $this->levels; - } - - if ($this->scream) { - $handler->screamAt($levels); - } - if ($this->scope) { - $handler->scopeAt($levels & ~\E_USER_DEPRECATED & ~\E_DEPRECATED); - } else { - $handler->scopeAt(0, true); - } - $this->logger = $this->deprecationLogger = $this->levels = null; - } - if (null !== $this->throwAt) { - $handler->throwAt($this->throwAt, true); - } - } - if (!$this->exceptionHandler) { - if ($event instanceof KernelEvent) { - if (method_exists($kernel = $event->getKernel(), 'terminateWithException')) { - $request = $event->getRequest(); - $hasRun = &$this->hasTerminatedWithException; - $this->exceptionHandler = static function (\Throwable $e) use ($kernel, $request, &$hasRun) { - if ($hasRun) { - throw $e; - } - - $hasRun = true; - $kernel->terminateWithException($e, $request); - }; - } - } elseif ($event instanceof ConsoleEvent && $app = $event->getCommand()->getApplication()) { - $output = $event->getOutput(); - if ($output instanceof ConsoleOutputInterface) { - $output = $output->getErrorOutput(); - } - $this->exceptionHandler = static function (\Throwable $e) use ($app, $output) { - $app->renderThrowable($e, $output); - }; - } - } - if ($this->exceptionHandler) { - if ($handler instanceof ErrorHandler) { - $handler->setExceptionHandler($this->exceptionHandler); - } - $this->exceptionHandler = null; - } - } - - private function setDefaultLoggers(ErrorHandler $handler): void - { - if (\is_array($this->levels)) { - $levelsDeprecatedOnly = []; - $levelsWithoutDeprecated = []; - foreach ($this->levels as $type => $log) { - if (\E_DEPRECATED == $type || \E_USER_DEPRECATED == $type) { - $levelsDeprecatedOnly[$type] = $log; - } else { - $levelsWithoutDeprecated[$type] = $log; - } - } - } else { - $levelsDeprecatedOnly = $this->levels & (\E_DEPRECATED | \E_USER_DEPRECATED); - $levelsWithoutDeprecated = $this->levels & ~\E_DEPRECATED & ~\E_USER_DEPRECATED; - } - - $defaultLoggerLevels = $this->levels; - if ($this->deprecationLogger && $levelsDeprecatedOnly) { - $handler->setDefaultLogger($this->deprecationLogger, $levelsDeprecatedOnly); - $defaultLoggerLevels = $levelsWithoutDeprecated; - } - - if ($this->logger && $defaultLoggerLevels) { - $handler->setDefaultLogger($this->logger, $defaultLoggerLevels); - } - } - - public static function getSubscribedEvents(): array - { - $events = [KernelEvents::REQUEST => ['configure', 2048]]; - - if (\defined('Symfony\Component\Console\ConsoleEvents::COMMAND')) { - $events[ConsoleEvents::COMMAND] = ['configure', 2048]; - } - - return $events; - } -} diff --git a/vendor/symfony/http-kernel/EventListener/DisallowRobotsIndexingListener.php b/vendor/symfony/http-kernel/EventListener/DisallowRobotsIndexingListener.php deleted file mode 100644 index 9631096f..00000000 --- a/vendor/symfony/http-kernel/EventListener/DisallowRobotsIndexingListener.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\EventListener; - -use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\HttpKernel\Event\ResponseEvent; -use Symfony\Component\HttpKernel\KernelEvents; - -/** - * Ensures that the application is not indexed by search engines. - * - * @author Gary PEGEOT - */ -class DisallowRobotsIndexingListener implements EventSubscriberInterface -{ - private const HEADER_NAME = 'X-Robots-Tag'; - - public function onResponse(ResponseEvent $event): void - { - if (!$event->getResponse()->headers->has(static::HEADER_NAME)) { - $event->getResponse()->headers->set(static::HEADER_NAME, 'noindex'); - } - } - - public static function getSubscribedEvents(): array - { - return [ - KernelEvents::RESPONSE => ['onResponse', -255], - ]; - } -} diff --git a/vendor/symfony/http-kernel/EventListener/DumpListener.php b/vendor/symfony/http-kernel/EventListener/DumpListener.php deleted file mode 100644 index 151f96ea..00000000 --- a/vendor/symfony/http-kernel/EventListener/DumpListener.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\HttpKernel\EventListener; - -use Symfony\Component\Console\ConsoleEvents; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\VarDumper\Cloner\ClonerInterface; -use Symfony\Component\VarDumper\Dumper\DataDumperInterface; -use Symfony\Component\VarDumper\Server\Connection; -use Symfony\Component\VarDumper\VarDumper; - -/** - * Configures dump() handler. - * - * @author Nicolas Grekas - */ -class DumpListener implements EventSubscriberInterface -{ - private ClonerInterface $cloner; - private DataDumperInterface $dumper; - private ?Connection $connection; - - public function __construct(ClonerInterface $cloner, DataDumperInterface $dumper, Connection $connection = null) - { - $this->cloner = $cloner; - $this->dumper = $dumper; - $this->connection = $connection; - } - - public function configure() - { - $cloner = $this->cloner; - $dumper = $this->dumper; - $connection = $this->connection; - - VarDumper::setHandler(static function ($var) use ($cloner, $dumper, $connection) { - $data = $cloner->cloneVar($var); - - if (!$connection || !$connection->write($data)) { - $dumper->dump($data); - } - }); - } - - public static function getSubscribedEvents(): array - { - if (!class_exists(ConsoleEvents::class)) { - return []; - } - - // Register early to have a working dump() as early as possible - return [ConsoleEvents::COMMAND => ['configure', 1024]]; - } -} diff --git a/vendor/symfony/http-kernel/EventListener/ErrorListener.php b/vendor/symfony/http-kernel/EventListener/ErrorListener.php deleted file mode 100644 index dd610505..00000000 --- a/vendor/symfony/http-kernel/EventListener/ErrorListener.php +++ /dev/null @@ -1,184 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\EventListener; - -use Psr\Log\LoggerInterface; -use Symfony\Component\ErrorHandler\Exception\FlattenException; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpKernel\Event\ControllerArgumentsEvent; -use Symfony\Component\HttpKernel\Event\ExceptionEvent; -use Symfony\Component\HttpKernel\Event\ResponseEvent; -use Symfony\Component\HttpKernel\Exception\HttpException; -use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface; -use Symfony\Component\HttpKernel\HttpKernelInterface; -use Symfony\Component\HttpKernel\KernelEvents; -use Symfony\Component\HttpKernel\Log\DebugLoggerInterface; - -/** - * @author Fabien Potencier - */ -class ErrorListener implements EventSubscriberInterface -{ - protected $controller; - protected $logger; - protected $debug; - /** - * @var array|null}> - */ - protected $exceptionsMapping; - - /** - * @param array|null}> $exceptionsMapping - */ - public function __construct(string|object|array|null $controller, LoggerInterface $logger = null, bool $debug = false, array $exceptionsMapping = []) - { - $this->controller = $controller; - $this->logger = $logger; - $this->debug = $debug; - $this->exceptionsMapping = $exceptionsMapping; - } - - public function logKernelException(ExceptionEvent $event) - { - $throwable = $event->getThrowable(); - $logLevel = null; - - foreach ($this->exceptionsMapping as $class => $config) { - if ($throwable instanceof $class && $config['log_level']) { - $logLevel = $config['log_level']; - break; - } - } - - foreach ($this->exceptionsMapping as $class => $config) { - if (!$throwable instanceof $class || !$config['status_code']) { - continue; - } - if (!$throwable instanceof HttpExceptionInterface || $throwable->getStatusCode() !== $config['status_code']) { - $headers = $throwable instanceof HttpExceptionInterface ? $throwable->getHeaders() : []; - $throwable = new HttpException($config['status_code'], $throwable->getMessage(), $throwable, $headers); - $event->setThrowable($throwable); - } - break; - } - - $e = FlattenException::createFromThrowable($throwable); - - $this->logException($throwable, sprintf('Uncaught PHP Exception %s: "%s" at %s line %s', $e->getClass(), $e->getMessage(), $e->getFile(), $e->getLine()), $logLevel); - } - - public function onKernelException(ExceptionEvent $event) - { - if (null === $this->controller) { - return; - } - - $throwable = $event->getThrowable(); - $request = $this->duplicateRequest($throwable, $event->getRequest()); - - try { - $response = $event->getKernel()->handle($request, HttpKernelInterface::SUB_REQUEST, false); - } catch (\Exception $e) { - $f = FlattenException::createFromThrowable($e); - - $this->logException($e, sprintf('Exception thrown when handling an exception (%s: %s at %s line %s)', $f->getClass(), $f->getMessage(), $e->getFile(), $e->getLine())); - - $prev = $e; - do { - if ($throwable === $wrapper = $prev) { - throw $e; - } - } while ($prev = $wrapper->getPrevious()); - - $prev = new \ReflectionProperty($wrapper instanceof \Exception ? \Exception::class : \Error::class, 'previous'); - $prev->setValue($wrapper, $throwable); - - throw $e; - } - - $event->setResponse($response); - - if ($this->debug) { - $event->getRequest()->attributes->set('_remove_csp_headers', true); - } - } - - public function removeCspHeader(ResponseEvent $event): void - { - if ($this->debug && $event->getRequest()->attributes->get('_remove_csp_headers', false)) { - $event->getResponse()->headers->remove('Content-Security-Policy'); - } - } - - public function onControllerArguments(ControllerArgumentsEvent $event) - { - $e = $event->getRequest()->attributes->get('exception'); - - if (!$e instanceof \Throwable || false === $k = array_search($e, $event->getArguments(), true)) { - return; - } - - $r = new \ReflectionFunction($event->getController()(...)); - $r = $r->getParameters()[$k] ?? null; - - if ($r && (!($r = $r->getType()) instanceof \ReflectionNamedType || FlattenException::class === $r->getName())) { - $arguments = $event->getArguments(); - $arguments[$k] = FlattenException::createFromThrowable($e); - $event->setArguments($arguments); - } - } - - public static function getSubscribedEvents(): array - { - return [ - KernelEvents::CONTROLLER_ARGUMENTS => 'onControllerArguments', - KernelEvents::EXCEPTION => [ - ['logKernelException', 0], - ['onKernelException', -128], - ], - KernelEvents::RESPONSE => ['removeCspHeader', -128], - ]; - } - - /** - * Logs an exception. - */ - protected function logException(\Throwable $exception, string $message, string $logLevel = null): void - { - if (null !== $this->logger) { - if (null !== $logLevel) { - $this->logger->log($logLevel, $message, ['exception' => $exception]); - } elseif (!$exception instanceof HttpExceptionInterface || $exception->getStatusCode() >= 500) { - $this->logger->critical($message, ['exception' => $exception]); - } else { - $this->logger->error($message, ['exception' => $exception]); - } - } - } - - /** - * Clones the request for the exception. - */ - protected function duplicateRequest(\Throwable $exception, Request $request): Request - { - $attributes = [ - '_controller' => $this->controller, - 'exception' => $exception, - 'logger' => $this->logger instanceof DebugLoggerInterface ? $this->logger : null, - ]; - $request = $request->duplicate(null, null, $attributes); - $request->setMethod('GET'); - - return $request; - } -} diff --git a/vendor/symfony/http-kernel/EventListener/FragmentListener.php b/vendor/symfony/http-kernel/EventListener/FragmentListener.php deleted file mode 100644 index 5c2fb096..00000000 --- a/vendor/symfony/http-kernel/EventListener/FragmentListener.php +++ /dev/null @@ -1,99 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\EventListener; - -use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpKernel\Event\RequestEvent; -use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; -use Symfony\Component\HttpKernel\KernelEvents; -use Symfony\Component\HttpKernel\UriSigner; - -/** - * Handles content fragments represented by special URIs. - * - * All URL paths starting with /_fragment are handled as - * content fragments by this listener. - * - * Throws an AccessDeniedHttpException exception if the request - * is not signed or if it is not an internal sub-request. - * - * @author Fabien Potencier - * - * @final - */ -class FragmentListener implements EventSubscriberInterface -{ - private UriSigner $signer; - private string $fragmentPath; - - /** - * @param string $fragmentPath The path that triggers this listener - */ - public function __construct(UriSigner $signer, string $fragmentPath = '/_fragment') - { - $this->signer = $signer; - $this->fragmentPath = $fragmentPath; - } - - /** - * Fixes request attributes when the path is '/_fragment'. - * - * @throws AccessDeniedHttpException if the request does not come from a trusted IP - */ - public function onKernelRequest(RequestEvent $event) - { - $request = $event->getRequest(); - - if ($this->fragmentPath !== rawurldecode($request->getPathInfo())) { - return; - } - - if ($request->attributes->has('_controller')) { - // Is a sub-request: no need to parse _path but it should still be removed from query parameters as below. - $request->query->remove('_path'); - - return; - } - - if ($event->isMainRequest()) { - $this->validateRequest($request); - } - - parse_str($request->query->get('_path', ''), $attributes); - $request->attributes->add($attributes); - $request->attributes->set('_route_params', array_replace($request->attributes->get('_route_params', []), $attributes)); - $request->query->remove('_path'); - } - - protected function validateRequest(Request $request) - { - // is the Request safe? - if (!$request->isMethodSafe()) { - throw new AccessDeniedHttpException(); - } - - // is the Request signed? - if ($this->signer->checkRequest($request)) { - return; - } - - throw new AccessDeniedHttpException(); - } - - public static function getSubscribedEvents(): array - { - return [ - KernelEvents::REQUEST => [['onKernelRequest', 48]], - ]; - } -} diff --git a/vendor/symfony/http-kernel/EventListener/LocaleAwareListener.php b/vendor/symfony/http-kernel/EventListener/LocaleAwareListener.php deleted file mode 100644 index 83fbb4f8..00000000 --- a/vendor/symfony/http-kernel/EventListener/LocaleAwareListener.php +++ /dev/null @@ -1,77 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\EventListener; - -use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\HttpFoundation\RequestStack; -use Symfony\Component\HttpKernel\Event\FinishRequestEvent; -use Symfony\Component\HttpKernel\Event\RequestEvent; -use Symfony\Component\HttpKernel\KernelEvents; -use Symfony\Contracts\Translation\LocaleAwareInterface; - -/** - * Pass the current locale to the provided services. - * - * @author Pierre Bobiet - */ -class LocaleAwareListener implements EventSubscriberInterface -{ - private iterable $localeAwareServices; - private RequestStack $requestStack; - - /** - * @param iterable $localeAwareServices - */ - public function __construct(iterable $localeAwareServices, RequestStack $requestStack) - { - $this->localeAwareServices = $localeAwareServices; - $this->requestStack = $requestStack; - } - - public function onKernelRequest(RequestEvent $event): void - { - $this->setLocale($event->getRequest()->getLocale(), $event->getRequest()->getDefaultLocale()); - } - - public function onKernelFinishRequest(FinishRequestEvent $event): void - { - if (null === $parentRequest = $this->requestStack->getParentRequest()) { - foreach ($this->localeAwareServices as $service) { - $service->setLocale($event->getRequest()->getDefaultLocale()); - } - - return; - } - - $this->setLocale($parentRequest->getLocale(), $parentRequest->getDefaultLocale()); - } - - public static function getSubscribedEvents(): array - { - return [ - // must be registered after the Locale listener - KernelEvents::REQUEST => [['onKernelRequest', 15]], - KernelEvents::FINISH_REQUEST => [['onKernelFinishRequest', -15]], - ]; - } - - private function setLocale(string $locale, string $defaultLocale): void - { - foreach ($this->localeAwareServices as $service) { - try { - $service->setLocale($locale); - } catch (\InvalidArgumentException) { - $service->setLocale($defaultLocale); - } - } - } -} diff --git a/vendor/symfony/http-kernel/EventListener/LocaleListener.php b/vendor/symfony/http-kernel/EventListener/LocaleListener.php deleted file mode 100644 index 2502fa4b..00000000 --- a/vendor/symfony/http-kernel/EventListener/LocaleListener.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\HttpKernel\EventListener; - -use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\RequestStack; -use Symfony\Component\HttpKernel\Event\FinishRequestEvent; -use Symfony\Component\HttpKernel\Event\KernelEvent; -use Symfony\Component\HttpKernel\Event\RequestEvent; -use Symfony\Component\HttpKernel\KernelEvents; -use Symfony\Component\Routing\RequestContextAwareInterface; - -/** - * Initializes the locale based on the current request. - * - * @author Fabien Potencier - * - * @final - */ -class LocaleListener implements EventSubscriberInterface -{ - private ?RequestContextAwareInterface $router; - private string $defaultLocale; - private RequestStack $requestStack; - private bool $useAcceptLanguageHeader; - private array $enabledLocales; - - public function __construct(RequestStack $requestStack, string $defaultLocale = 'en', RequestContextAwareInterface $router = null, bool $useAcceptLanguageHeader = false, array $enabledLocales = []) - { - $this->defaultLocale = $defaultLocale; - $this->requestStack = $requestStack; - $this->router = $router; - $this->useAcceptLanguageHeader = $useAcceptLanguageHeader; - $this->enabledLocales = $enabledLocales; - } - - public function setDefaultLocale(KernelEvent $event) - { - $event->getRequest()->setDefaultLocale($this->defaultLocale); - } - - public function onKernelRequest(RequestEvent $event) - { - $request = $event->getRequest(); - - $this->setLocale($request); - $this->setRouterContext($request); - } - - public function onKernelFinishRequest(FinishRequestEvent $event) - { - if (null !== $parentRequest = $this->requestStack->getParentRequest()) { - $this->setRouterContext($parentRequest); - } - } - - private function setLocale(Request $request) - { - if ($locale = $request->attributes->get('_locale')) { - $request->setLocale($locale); - } elseif ($this->useAcceptLanguageHeader) { - if ($preferredLanguage = $request->getPreferredLanguage($this->enabledLocales)) { - $request->setLocale($preferredLanguage); - } - $request->attributes->set('_vary_by_language', true); - } - } - - private function setRouterContext(Request $request) - { - $this->router?->getContext()->setParameter('_locale', $request->getLocale()); - } - - public static function getSubscribedEvents(): array - { - return [ - KernelEvents::REQUEST => [ - ['setDefaultLocale', 100], - // must be registered after the Router to have access to the _locale - ['onKernelRequest', 16], - ], - KernelEvents::FINISH_REQUEST => [['onKernelFinishRequest', 0]], - ]; - } -} diff --git a/vendor/symfony/http-kernel/EventListener/ProfilerListener.php b/vendor/symfony/http-kernel/EventListener/ProfilerListener.php deleted file mode 100644 index d63c0493..00000000 --- a/vendor/symfony/http-kernel/EventListener/ProfilerListener.php +++ /dev/null @@ -1,150 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\EventListener; - -use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\RequestMatcherInterface; -use Symfony\Component\HttpFoundation\RequestStack; -use Symfony\Component\HttpFoundation\Session\Session; -use Symfony\Component\HttpKernel\Event\ExceptionEvent; -use Symfony\Component\HttpKernel\Event\ResponseEvent; -use Symfony\Component\HttpKernel\Event\TerminateEvent; -use Symfony\Component\HttpKernel\KernelEvents; -use Symfony\Component\HttpKernel\Profiler\Profile; -use Symfony\Component\HttpKernel\Profiler\Profiler; - -/** - * ProfilerListener collects data for the current request by listening to the kernel events. - * - * @author Fabien Potencier - * - * @final - */ -class ProfilerListener implements EventSubscriberInterface -{ - private Profiler $profiler; - private ?RequestMatcherInterface $matcher; - private bool $onlyException; - private bool $onlyMainRequests; - private ?\Throwable $exception = null; - /** @var \SplObjectStorage */ - private \SplObjectStorage $profiles; - private RequestStack $requestStack; - private ?string $collectParameter; - /** @var \SplObjectStorage */ - private \SplObjectStorage $parents; - - /** - * @param bool $onlyException True if the profiler only collects data when an exception occurs, false otherwise - * @param bool $onlyMainRequests True if the profiler only collects data when the request is the main request, false otherwise - */ - public function __construct(Profiler $profiler, RequestStack $requestStack, RequestMatcherInterface $matcher = null, bool $onlyException = false, bool $onlyMainRequests = false, string $collectParameter = null) - { - $this->profiler = $profiler; - $this->matcher = $matcher; - $this->onlyException = $onlyException; - $this->onlyMainRequests = $onlyMainRequests; - $this->profiles = new \SplObjectStorage(); - $this->parents = new \SplObjectStorage(); - $this->requestStack = $requestStack; - $this->collectParameter = $collectParameter; - } - - /** - * Handles the onKernelException event. - */ - public function onKernelException(ExceptionEvent $event) - { - if ($this->onlyMainRequests && !$event->isMainRequest()) { - return; - } - - $this->exception = $event->getThrowable(); - } - - /** - * Handles the onKernelResponse event. - */ - public function onKernelResponse(ResponseEvent $event) - { - if ($this->onlyMainRequests && !$event->isMainRequest()) { - return; - } - - if ($this->onlyException && null === $this->exception) { - return; - } - - $request = $event->getRequest(); - if (null !== $this->collectParameter && null !== $collectParameterValue = $request->get($this->collectParameter)) { - true === $collectParameterValue || filter_var($collectParameterValue, \FILTER_VALIDATE_BOOL) ? $this->profiler->enable() : $this->profiler->disable(); - } - - $exception = $this->exception; - $this->exception = null; - - if (null !== $this->matcher && !$this->matcher->matches($request)) { - return; - } - - $session = $request->hasPreviousSession() ? $request->getSession() : null; - - if ($session instanceof Session) { - $usageIndexValue = $usageIndexReference = &$session->getUsageIndex(); - $usageIndexReference = \PHP_INT_MIN; - } - - try { - if (!$profile = $this->profiler->collect($request, $event->getResponse(), $exception)) { - return; - } - } finally { - if ($session instanceof Session) { - $usageIndexReference = $usageIndexValue; - } - } - - $this->profiles[$request] = $profile; - - $this->parents[$request] = $this->requestStack->getParentRequest(); - } - - public function onKernelTerminate(TerminateEvent $event) - { - // attach children to parents - foreach ($this->profiles as $request) { - if (null !== $parentRequest = $this->parents[$request]) { - if (isset($this->profiles[$parentRequest])) { - $this->profiles[$parentRequest]->addChild($this->profiles[$request]); - } - } - } - - // save profiles - foreach ($this->profiles as $request) { - $this->profiler->saveProfile($this->profiles[$request]); - } - - $this->profiles = new \SplObjectStorage(); - $this->parents = new \SplObjectStorage(); - } - - public static function getSubscribedEvents(): array - { - return [ - KernelEvents::RESPONSE => ['onKernelResponse', -100], - KernelEvents::EXCEPTION => ['onKernelException', 0], - KernelEvents::TERMINATE => ['onKernelTerminate', -1024], - ]; - } -} diff --git a/vendor/symfony/http-kernel/EventListener/ResponseListener.php b/vendor/symfony/http-kernel/EventListener/ResponseListener.php deleted file mode 100644 index 435fd31d..00000000 --- a/vendor/symfony/http-kernel/EventListener/ResponseListener.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\EventListener; - -use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\HttpKernel\Event\ResponseEvent; -use Symfony\Component\HttpKernel\KernelEvents; - -/** - * ResponseListener fixes the Response headers based on the Request. - * - * @author Fabien Potencier - * - * @final - */ -class ResponseListener implements EventSubscriberInterface -{ - private string $charset; - private bool $addContentLanguageHeader; - - public function __construct(string $charset, bool $addContentLanguageHeader = false) - { - $this->charset = $charset; - $this->addContentLanguageHeader = $addContentLanguageHeader; - } - - /** - * Filters the Response. - */ - public function onKernelResponse(ResponseEvent $event) - { - if (!$event->isMainRequest()) { - return; - } - - $response = $event->getResponse(); - - if (null === $response->getCharset()) { - $response->setCharset($this->charset); - } - - if ($this->addContentLanguageHeader && !$response->isInformational() && !$response->isEmpty() && !$response->headers->has('Content-Language')) { - $response->headers->set('Content-Language', $event->getRequest()->getLocale()); - } - - if ($event->getRequest()->attributes->get('_vary_by_language')) { - $response->setVary('Accept-Language', false); - } - - $response->prepare($event->getRequest()); - } - - public static function getSubscribedEvents(): array - { - return [ - KernelEvents::RESPONSE => 'onKernelResponse', - ]; - } -} diff --git a/vendor/symfony/http-kernel/EventListener/RouterListener.php b/vendor/symfony/http-kernel/EventListener/RouterListener.php deleted file mode 100644 index ffdbb89c..00000000 --- a/vendor/symfony/http-kernel/EventListener/RouterListener.php +++ /dev/null @@ -1,167 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\EventListener; - -use Psr\Log\LoggerInterface; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\RequestStack; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\Event\ExceptionEvent; -use Symfony\Component\HttpKernel\Event\FinishRequestEvent; -use Symfony\Component\HttpKernel\Event\RequestEvent; -use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; -use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException; -use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; -use Symfony\Component\HttpKernel\Kernel; -use Symfony\Component\HttpKernel\KernelEvents; -use Symfony\Component\Routing\Exception\MethodNotAllowedException; -use Symfony\Component\Routing\Exception\NoConfigurationException; -use Symfony\Component\Routing\Exception\ResourceNotFoundException; -use Symfony\Component\Routing\Matcher\RequestMatcherInterface; -use Symfony\Component\Routing\Matcher\UrlMatcherInterface; -use Symfony\Component\Routing\RequestContext; -use Symfony\Component\Routing\RequestContextAwareInterface; - -/** - * Initializes the context from the request and sets request attributes based on a matching route. - * - * @author Fabien Potencier - * @author Yonel Ceruto - * - * @final - */ -class RouterListener implements EventSubscriberInterface -{ - private RequestMatcherInterface|UrlMatcherInterface $matcher; - private RequestContext $context; - private ?LoggerInterface $logger; - private RequestStack $requestStack; - private ?string $projectDir; - private bool $debug; - - /** - * @param RequestContext|null $context The RequestContext (can be null when $matcher implements RequestContextAwareInterface) - * - * @throws \InvalidArgumentException - */ - public function __construct(UrlMatcherInterface|RequestMatcherInterface $matcher, RequestStack $requestStack, RequestContext $context = null, LoggerInterface $logger = null, string $projectDir = null, bool $debug = true) - { - if (null === $context && !$matcher instanceof RequestContextAwareInterface) { - throw new \InvalidArgumentException('You must either pass a RequestContext or the matcher must implement RequestContextAwareInterface.'); - } - - $this->matcher = $matcher; - $this->context = $context ?? $matcher->getContext(); - $this->requestStack = $requestStack; - $this->logger = $logger; - $this->projectDir = $projectDir; - $this->debug = $debug; - } - - private function setCurrentRequest(?Request $request) - { - if (null !== $request) { - try { - $this->context->fromRequest($request); - } catch (\UnexpectedValueException $e) { - throw new BadRequestHttpException($e->getMessage(), $e, $e->getCode()); - } - } - } - - /** - * After a sub-request is done, we need to reset the routing context to the parent request so that the URL generator - * operates on the correct context again. - */ - public function onKernelFinishRequest() - { - $this->setCurrentRequest($this->requestStack->getParentRequest()); - } - - public function onKernelRequest(RequestEvent $event) - { - $request = $event->getRequest(); - - $this->setCurrentRequest($request); - - if ($request->attributes->has('_controller')) { - // routing is already done - return; - } - - // add attributes based on the request (routing) - try { - // matching a request is more powerful than matching a URL path + context, so try that first - if ($this->matcher instanceof RequestMatcherInterface) { - $parameters = $this->matcher->matchRequest($request); - } else { - $parameters = $this->matcher->match($request->getPathInfo()); - } - - $this->logger?->info('Matched route "{route}".', [ - 'route' => $parameters['_route'] ?? 'n/a', - 'route_parameters' => $parameters, - 'request_uri' => $request->getUri(), - 'method' => $request->getMethod(), - ]); - - $request->attributes->add($parameters); - unset($parameters['_route'], $parameters['_controller']); - $request->attributes->set('_route_params', $parameters); - } catch (ResourceNotFoundException $e) { - $message = sprintf('No route found for "%s %s"', $request->getMethod(), $request->getUriForPath($request->getPathInfo())); - - if ($referer = $request->headers->get('referer')) { - $message .= sprintf(' (from "%s")', $referer); - } - - throw new NotFoundHttpException($message, $e); - } catch (MethodNotAllowedException $e) { - $message = sprintf('No route found for "%s %s": Method Not Allowed (Allow: %s)', $request->getMethod(), $request->getUriForPath($request->getPathInfo()), implode(', ', $e->getAllowedMethods())); - - throw new MethodNotAllowedHttpException($e->getAllowedMethods(), $message, $e); - } - } - - public function onKernelException(ExceptionEvent $event) - { - if (!$this->debug || !($e = $event->getThrowable()) instanceof NotFoundHttpException) { - return; - } - - if ($e->getPrevious() instanceof NoConfigurationException) { - $event->setResponse($this->createWelcomeResponse()); - } - } - - public static function getSubscribedEvents(): array - { - return [ - KernelEvents::REQUEST => [['onKernelRequest', 32]], - KernelEvents::FINISH_REQUEST => [['onKernelFinishRequest', 0]], - KernelEvents::EXCEPTION => ['onKernelException', -64], - ]; - } - - private function createWelcomeResponse(): Response - { - $version = Kernel::VERSION; - $projectDir = realpath((string) $this->projectDir).\DIRECTORY_SEPARATOR; - $docVersion = substr(Kernel::VERSION, 0, 3); - - ob_start(); - include \dirname(__DIR__).'/Resources/welcome.html.php'; - - return new Response(ob_get_clean(), Response::HTTP_NOT_FOUND); - } -} diff --git a/vendor/symfony/http-kernel/EventListener/SessionListener.php b/vendor/symfony/http-kernel/EventListener/SessionListener.php deleted file mode 100644 index ec23a2e9..00000000 --- a/vendor/symfony/http-kernel/EventListener/SessionListener.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\HttpKernel\EventListener; - -use Symfony\Component\HttpFoundation\Session\SessionInterface; - -/** - * Sets the session in the request. - * - * @author Fabien Potencier - * - * @final - */ -class SessionListener extends AbstractSessionListener -{ - protected function getSession(): ?SessionInterface - { - if ($this->container->has('session_factory')) { - return $this->container->get('session_factory')->createSession(); - } - - return null; - } -} diff --git a/vendor/symfony/http-kernel/EventListener/StreamedResponseListener.php b/vendor/symfony/http-kernel/EventListener/StreamedResponseListener.php deleted file mode 100644 index c0b74fdf..00000000 --- a/vendor/symfony/http-kernel/EventListener/StreamedResponseListener.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\EventListener; - -use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\HttpFoundation\StreamedResponse; -use Symfony\Component\HttpKernel\Event\ResponseEvent; -use Symfony\Component\HttpKernel\KernelEvents; - -trigger_deprecation('symfony/http-kernel', '6.1', 'The "%s" class is deprecated.', StreamedResponseListener::class); - -/** - * StreamedResponseListener is responsible for sending the Response - * to the client. - * - * @author Fabien Potencier - * - * @final - * - * @deprecated since Symfony 6.1 - */ -class StreamedResponseListener implements EventSubscriberInterface -{ - /** - * Filters the Response. - */ - public function onKernelResponse(ResponseEvent $event) - { - if (!$event->isMainRequest()) { - return; - } - - $response = $event->getResponse(); - - if ($response instanceof StreamedResponse) { - $response->send(); - } - } - - public static function getSubscribedEvents(): array - { - return [ - KernelEvents::RESPONSE => ['onKernelResponse', -1024], - ]; - } -} diff --git a/vendor/symfony/http-kernel/EventListener/SurrogateListener.php b/vendor/symfony/http-kernel/EventListener/SurrogateListener.php deleted file mode 100644 index 3d1be0f2..00000000 --- a/vendor/symfony/http-kernel/EventListener/SurrogateListener.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\HttpKernel\EventListener; - -use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\HttpKernel\Event\ResponseEvent; -use Symfony\Component\HttpKernel\HttpCache\HttpCache; -use Symfony\Component\HttpKernel\HttpCache\SurrogateInterface; -use Symfony\Component\HttpKernel\KernelEvents; - -/** - * SurrogateListener adds a Surrogate-Control HTTP header when the Response needs to be parsed for Surrogates. - * - * @author Fabien Potencier - * - * @final - */ -class SurrogateListener implements EventSubscriberInterface -{ - private ?SurrogateInterface $surrogate; - - public function __construct(SurrogateInterface $surrogate = null) - { - $this->surrogate = $surrogate; - } - - /** - * Filters the Response. - */ - public function onKernelResponse(ResponseEvent $event) - { - if (!$event->isMainRequest()) { - return; - } - - $kernel = $event->getKernel(); - $surrogate = $this->surrogate; - if ($kernel instanceof HttpCache) { - $surrogate = $kernel->getSurrogate(); - if (null !== $this->surrogate && $this->surrogate->getName() !== $surrogate->getName()) { - $surrogate = $this->surrogate; - } - } - - if (null === $surrogate) { - return; - } - - $surrogate->addSurrogateControl($event->getResponse()); - } - - public static function getSubscribedEvents(): array - { - return [ - KernelEvents::RESPONSE => 'onKernelResponse', - ]; - } -} diff --git a/vendor/symfony/http-kernel/EventListener/ValidateRequestListener.php b/vendor/symfony/http-kernel/EventListener/ValidateRequestListener.php deleted file mode 100644 index e2501c57..00000000 --- a/vendor/symfony/http-kernel/EventListener/ValidateRequestListener.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\EventListener; - -use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\HttpKernel\Event\RequestEvent; -use Symfony\Component\HttpKernel\KernelEvents; - -/** - * Validates Requests. - * - * @author Magnus Nordlander - * - * @final - */ -class ValidateRequestListener implements EventSubscriberInterface -{ - /** - * Performs the validation. - */ - public function onKernelRequest(RequestEvent $event) - { - if (!$event->isMainRequest()) { - return; - } - $request = $event->getRequest(); - - if ($request::getTrustedProxies()) { - $request->getClientIps(); - } - - $request->getHost(); - } - - public static function getSubscribedEvents(): array - { - return [ - KernelEvents::REQUEST => [ - ['onKernelRequest', 256], - ], - ]; - } -} diff --git a/vendor/symfony/http-kernel/Exception/AccessDeniedHttpException.php b/vendor/symfony/http-kernel/Exception/AccessDeniedHttpException.php deleted file mode 100644 index 78e8fe37..00000000 --- a/vendor/symfony/http-kernel/Exception/AccessDeniedHttpException.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\HttpKernel\Exception; - -/** - * @author Fabien Potencier - * @author Christophe Coevoet - */ -class AccessDeniedHttpException extends HttpException -{ - public function __construct(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) - { - parent::__construct(403, $message, $previous, $headers, $code); - } -} diff --git a/vendor/symfony/http-kernel/Exception/BadRequestHttpException.php b/vendor/symfony/http-kernel/Exception/BadRequestHttpException.php deleted file mode 100644 index c920fbd0..00000000 --- a/vendor/symfony/http-kernel/Exception/BadRequestHttpException.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\HttpKernel\Exception; - -/** - * @author Ben Ramsey - */ -class BadRequestHttpException extends HttpException -{ - public function __construct(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) - { - parent::__construct(400, $message, $previous, $headers, $code); - } -} diff --git a/vendor/symfony/http-kernel/Exception/ConflictHttpException.php b/vendor/symfony/http-kernel/Exception/ConflictHttpException.php deleted file mode 100644 index a5a6f840..00000000 --- a/vendor/symfony/http-kernel/Exception/ConflictHttpException.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\HttpKernel\Exception; - -/** - * @author Ben Ramsey - */ -class ConflictHttpException extends HttpException -{ - public function __construct(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) - { - parent::__construct(409, $message, $previous, $headers, $code); - } -} diff --git a/vendor/symfony/http-kernel/Exception/ControllerDoesNotReturnResponseException.php b/vendor/symfony/http-kernel/Exception/ControllerDoesNotReturnResponseException.php deleted file mode 100644 index ecfc2f8f..00000000 --- a/vendor/symfony/http-kernel/Exception/ControllerDoesNotReturnResponseException.php +++ /dev/null @@ -1,83 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Exception; - -/** - * @author Grégoire Pineau - */ -class ControllerDoesNotReturnResponseException extends \LogicException -{ - public function __construct(string $message, callable $controller, string $file, int $line) - { - parent::__construct($message); - - if (!$controllerDefinition = $this->parseControllerDefinition($controller)) { - return; - } - - $this->file = $controllerDefinition['file']; - $this->line = $controllerDefinition['line']; - $r = new \ReflectionProperty(\Exception::class, 'trace'); - $r->setValue($this, array_merge([ - [ - 'line' => $line, - 'file' => $file, - ], - ], $this->getTrace())); - } - - private function parseControllerDefinition(callable $controller): ?array - { - if (\is_string($controller) && str_contains($controller, '::')) { - $controller = explode('::', $controller); - } - - if (\is_array($controller)) { - try { - $r = new \ReflectionMethod($controller[0], $controller[1]); - - return [ - 'file' => $r->getFileName(), - 'line' => $r->getEndLine(), - ]; - } catch (\ReflectionException) { - return null; - } - } - - if ($controller instanceof \Closure) { - $r = new \ReflectionFunction($controller); - - return [ - 'file' => $r->getFileName(), - 'line' => $r->getEndLine(), - ]; - } - - if (\is_object($controller)) { - $r = new \ReflectionClass($controller); - - try { - $line = $r->getMethod('__invoke')->getEndLine(); - } catch (\ReflectionException) { - $line = $r->getEndLine(); - } - - return [ - 'file' => $r->getFileName(), - 'line' => $line, - ]; - } - - return null; - } -} diff --git a/vendor/symfony/http-kernel/Exception/GoneHttpException.php b/vendor/symfony/http-kernel/Exception/GoneHttpException.php deleted file mode 100644 index 2893f05c..00000000 --- a/vendor/symfony/http-kernel/Exception/GoneHttpException.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\HttpKernel\Exception; - -/** - * @author Ben Ramsey - */ -class GoneHttpException extends HttpException -{ - public function __construct(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) - { - parent::__construct(410, $message, $previous, $headers, $code); - } -} diff --git a/vendor/symfony/http-kernel/Exception/HttpException.php b/vendor/symfony/http-kernel/Exception/HttpException.php deleted file mode 100644 index 41827106..00000000 --- a/vendor/symfony/http-kernel/Exception/HttpException.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Exception; - -/** - * HttpException. - * - * @author Kris Wallsmith - */ -class HttpException extends \RuntimeException implements HttpExceptionInterface -{ - private int $statusCode; - private array $headers; - - public function __construct(int $statusCode, string $message = '', \Throwable $previous = null, array $headers = [], int $code = 0) - { - $this->statusCode = $statusCode; - $this->headers = $headers; - - parent::__construct($message, $code, $previous); - } - - public function getStatusCode(): int - { - return $this->statusCode; - } - - public function getHeaders(): array - { - return $this->headers; - } - - public function setHeaders(array $headers) - { - $this->headers = $headers; - } -} diff --git a/vendor/symfony/http-kernel/Exception/HttpExceptionInterface.php b/vendor/symfony/http-kernel/Exception/HttpExceptionInterface.php deleted file mode 100644 index 7eb0cbda..00000000 --- a/vendor/symfony/http-kernel/Exception/HttpExceptionInterface.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\HttpKernel\Exception; - -/** - * Interface for HTTP error exceptions. - * - * @author Kris Wallsmith - */ -interface HttpExceptionInterface extends \Throwable -{ - /** - * Returns the status code. - */ - public function getStatusCode(): int; - - /** - * Returns response headers. - */ - public function getHeaders(): array; -} diff --git a/vendor/symfony/http-kernel/Exception/InvalidMetadataException.php b/vendor/symfony/http-kernel/Exception/InvalidMetadataException.php deleted file mode 100644 index 129267ab..00000000 --- a/vendor/symfony/http-kernel/Exception/InvalidMetadataException.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. - */ - -namespace Symfony\Component\HttpKernel\Exception; - -class InvalidMetadataException extends \LogicException -{ -} diff --git a/vendor/symfony/http-kernel/Exception/LengthRequiredHttpException.php b/vendor/symfony/http-kernel/Exception/LengthRequiredHttpException.php deleted file mode 100644 index a3dd8b3c..00000000 --- a/vendor/symfony/http-kernel/Exception/LengthRequiredHttpException.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\HttpKernel\Exception; - -/** - * @author Ben Ramsey - */ -class LengthRequiredHttpException extends HttpException -{ - public function __construct(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) - { - parent::__construct(411, $message, $previous, $headers, $code); - } -} diff --git a/vendor/symfony/http-kernel/Exception/LockedHttpException.php b/vendor/symfony/http-kernel/Exception/LockedHttpException.php deleted file mode 100644 index 069619bf..00000000 --- a/vendor/symfony/http-kernel/Exception/LockedHttpException.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\HttpKernel\Exception; - -/** - * @author Peter Dietrich - */ -class LockedHttpException extends HttpException -{ - public function __construct(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) - { - parent::__construct(423, $message, $previous, $headers, $code); - } -} diff --git a/vendor/symfony/http-kernel/Exception/MethodNotAllowedHttpException.php b/vendor/symfony/http-kernel/Exception/MethodNotAllowedHttpException.php deleted file mode 100644 index cfbaf5cb..00000000 --- a/vendor/symfony/http-kernel/Exception/MethodNotAllowedHttpException.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\HttpKernel\Exception; - -/** - * @author Kris Wallsmith - */ -class MethodNotAllowedHttpException extends HttpException -{ - /** - * @param string[] $allow An array of allowed methods - */ - public function __construct(array $allow, string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) - { - $headers['Allow'] = strtoupper(implode(', ', $allow)); - - parent::__construct(405, $message, $previous, $headers, $code); - } -} diff --git a/vendor/symfony/http-kernel/Exception/NotAcceptableHttpException.php b/vendor/symfony/http-kernel/Exception/NotAcceptableHttpException.php deleted file mode 100644 index ec2bb596..00000000 --- a/vendor/symfony/http-kernel/Exception/NotAcceptableHttpException.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\HttpKernel\Exception; - -/** - * @author Ben Ramsey - */ -class NotAcceptableHttpException extends HttpException -{ - public function __construct(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) - { - parent::__construct(406, $message, $previous, $headers, $code); - } -} diff --git a/vendor/symfony/http-kernel/Exception/NotFoundHttpException.php b/vendor/symfony/http-kernel/Exception/NotFoundHttpException.php deleted file mode 100644 index 0e78fcc1..00000000 --- a/vendor/symfony/http-kernel/Exception/NotFoundHttpException.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\HttpKernel\Exception; - -/** - * @author Fabien Potencier - */ -class NotFoundHttpException extends HttpException -{ - public function __construct(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) - { - parent::__construct(404, $message, $previous, $headers, $code); - } -} diff --git a/vendor/symfony/http-kernel/Exception/PreconditionFailedHttpException.php b/vendor/symfony/http-kernel/Exception/PreconditionFailedHttpException.php deleted file mode 100644 index 4431f89d..00000000 --- a/vendor/symfony/http-kernel/Exception/PreconditionFailedHttpException.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\HttpKernel\Exception; - -/** - * @author Ben Ramsey - */ -class PreconditionFailedHttpException extends HttpException -{ - public function __construct(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) - { - parent::__construct(412, $message, $previous, $headers, $code); - } -} diff --git a/vendor/symfony/http-kernel/Exception/PreconditionRequiredHttpException.php b/vendor/symfony/http-kernel/Exception/PreconditionRequiredHttpException.php deleted file mode 100644 index f75afd37..00000000 --- a/vendor/symfony/http-kernel/Exception/PreconditionRequiredHttpException.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\HttpKernel\Exception; - -/** - * @author Ben Ramsey - * - * @see http://tools.ietf.org/html/rfc6585 - */ -class PreconditionRequiredHttpException extends HttpException -{ - public function __construct(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) - { - parent::__construct(428, $message, $previous, $headers, $code); - } -} diff --git a/vendor/symfony/http-kernel/Exception/ServiceUnavailableHttpException.php b/vendor/symfony/http-kernel/Exception/ServiceUnavailableHttpException.php deleted file mode 100644 index d4862bd1..00000000 --- a/vendor/symfony/http-kernel/Exception/ServiceUnavailableHttpException.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\HttpKernel\Exception; - -/** - * @author Ben Ramsey - */ -class ServiceUnavailableHttpException extends HttpException -{ - /** - * @param int|string|null $retryAfter The number of seconds or HTTP-date after which the request may be retried - */ - public function __construct(int|string $retryAfter = null, string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) - { - if ($retryAfter) { - $headers['Retry-After'] = $retryAfter; - } - - parent::__construct(503, $message, $previous, $headers, $code); - } -} diff --git a/vendor/symfony/http-kernel/Exception/TooManyRequestsHttpException.php b/vendor/symfony/http-kernel/Exception/TooManyRequestsHttpException.php deleted file mode 100644 index b71fb250..00000000 --- a/vendor/symfony/http-kernel/Exception/TooManyRequestsHttpException.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\HttpKernel\Exception; - -/** - * @author Ben Ramsey - * - * @see http://tools.ietf.org/html/rfc6585 - */ -class TooManyRequestsHttpException extends HttpException -{ - /** - * @param int|string|null $retryAfter The number of seconds or HTTP-date after which the request may be retried - */ - public function __construct(int|string $retryAfter = null, string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) - { - if ($retryAfter) { - $headers['Retry-After'] = $retryAfter; - } - - parent::__construct(429, $message, $previous, $headers, $code); - } -} diff --git a/vendor/symfony/http-kernel/Exception/UnauthorizedHttpException.php b/vendor/symfony/http-kernel/Exception/UnauthorizedHttpException.php deleted file mode 100644 index c8668612..00000000 --- a/vendor/symfony/http-kernel/Exception/UnauthorizedHttpException.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\HttpKernel\Exception; - -/** - * @author Ben Ramsey - */ -class UnauthorizedHttpException extends HttpException -{ - /** - * @param string $challenge WWW-Authenticate challenge string - */ - public function __construct(string $challenge, string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) - { - $headers['WWW-Authenticate'] = $challenge; - - parent::__construct(401, $message, $previous, $headers, $code); - } -} diff --git a/vendor/symfony/http-kernel/Exception/UnexpectedSessionUsageException.php b/vendor/symfony/http-kernel/Exception/UnexpectedSessionUsageException.php deleted file mode 100644 index 0145b169..00000000 --- a/vendor/symfony/http-kernel/Exception/UnexpectedSessionUsageException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Exception; - -/** - * @author Mathias Arlaud - */ -class UnexpectedSessionUsageException extends \LogicException -{ -} diff --git a/vendor/symfony/http-kernel/Exception/UnprocessableEntityHttpException.php b/vendor/symfony/http-kernel/Exception/UnprocessableEntityHttpException.php deleted file mode 100644 index d58af6c2..00000000 --- a/vendor/symfony/http-kernel/Exception/UnprocessableEntityHttpException.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\HttpKernel\Exception; - -/** - * @author Steve Hutchins - */ -class UnprocessableEntityHttpException extends HttpException -{ - public function __construct(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) - { - parent::__construct(422, $message, $previous, $headers, $code); - } -} diff --git a/vendor/symfony/http-kernel/Exception/UnsupportedMediaTypeHttpException.php b/vendor/symfony/http-kernel/Exception/UnsupportedMediaTypeHttpException.php deleted file mode 100644 index 3060f1f9..00000000 --- a/vendor/symfony/http-kernel/Exception/UnsupportedMediaTypeHttpException.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\HttpKernel\Exception; - -/** - * @author Ben Ramsey - */ -class UnsupportedMediaTypeHttpException extends HttpException -{ - public function __construct(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) - { - parent::__construct(415, $message, $previous, $headers, $code); - } -} diff --git a/vendor/symfony/http-kernel/Fragment/AbstractSurrogateFragmentRenderer.php b/vendor/symfony/http-kernel/Fragment/AbstractSurrogateFragmentRenderer.php deleted file mode 100644 index 24c1b4e8..00000000 --- a/vendor/symfony/http-kernel/Fragment/AbstractSurrogateFragmentRenderer.php +++ /dev/null @@ -1,104 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Fragment; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\Controller\ControllerReference; -use Symfony\Component\HttpKernel\HttpCache\SurrogateInterface; -use Symfony\Component\HttpKernel\UriSigner; - -/** - * Implements Surrogate rendering strategy. - * - * @author Fabien Potencier - */ -abstract class AbstractSurrogateFragmentRenderer extends RoutableFragmentRenderer -{ - private ?SurrogateInterface $surrogate; - private FragmentRendererInterface $inlineStrategy; - private ?UriSigner $signer; - - /** - * The "fallback" strategy when surrogate is not available should always be an - * instance of InlineFragmentRenderer. - * - * @param FragmentRendererInterface $inlineStrategy The inline strategy to use when the surrogate is not supported - */ - public function __construct(SurrogateInterface $surrogate = null, FragmentRendererInterface $inlineStrategy, UriSigner $signer = null) - { - $this->surrogate = $surrogate; - $this->inlineStrategy = $inlineStrategy; - $this->signer = $signer; - } - - /** - * Note that if the current Request has no surrogate capability, this method - * falls back to use the inline rendering strategy. - * - * Additional available options: - * - * * alt: an alternative URI to render in case of an error - * * comment: a comment to add when returning the surrogate tag - * * absolute_uri: whether to generate an absolute URI or not. Default is false - * - * Note, that not all surrogate strategies support all options. For now - * 'alt' and 'comment' are only supported by ESI. - * - * @see Symfony\Component\HttpKernel\HttpCache\SurrogateInterface - */ - public function render(string|ControllerReference $uri, Request $request, array $options = []): Response - { - if (!$this->surrogate || !$this->surrogate->hasSurrogateCapability($request)) { - if ($uri instanceof ControllerReference && $this->containsNonScalars($uri->attributes)) { - throw new \InvalidArgumentException('Passing non-scalar values as part of URI attributes to the ESI and SSI rendering strategies is not supported. Use a different rendering strategy or pass scalar values.'); - } - - return $this->inlineStrategy->render($uri, $request, $options); - } - - $absolute = $options['absolute_uri'] ?? false; - - if ($uri instanceof ControllerReference) { - $uri = $this->generateSignedFragmentUri($uri, $request, $absolute); - } - - $alt = $options['alt'] ?? null; - if ($alt instanceof ControllerReference) { - $alt = $this->generateSignedFragmentUri($alt, $request, $absolute); - } - - $tag = $this->surrogate->renderIncludeTag($uri, $alt, $options['ignore_errors'] ?? false, $options['comment'] ?? ''); - - return new Response($tag); - } - - private function generateSignedFragmentUri(ControllerReference $uri, Request $request, bool $absolute): string - { - return (new FragmentUriGenerator($this->fragmentPath, $this->signer))->generate($uri, $request, $absolute); - } - - private function containsNonScalars(array $values): bool - { - foreach ($values as $value) { - if (\is_scalar($value) || null === $value) { - continue; - } - - if (!\is_array($value) || $this->containsNonScalars($value)) { - return true; - } - } - - return false; - } -} diff --git a/vendor/symfony/http-kernel/Fragment/EsiFragmentRenderer.php b/vendor/symfony/http-kernel/Fragment/EsiFragmentRenderer.php deleted file mode 100644 index da4c34ad..00000000 --- a/vendor/symfony/http-kernel/Fragment/EsiFragmentRenderer.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\HttpKernel\Fragment; - -/** - * Implements the ESI rendering strategy. - * - * @author Fabien Potencier - */ -class EsiFragmentRenderer extends AbstractSurrogateFragmentRenderer -{ - public function getName(): string - { - return 'esi'; - } -} diff --git a/vendor/symfony/http-kernel/Fragment/FragmentHandler.php b/vendor/symfony/http-kernel/Fragment/FragmentHandler.php deleted file mode 100644 index dfc03db4..00000000 --- a/vendor/symfony/http-kernel/Fragment/FragmentHandler.php +++ /dev/null @@ -1,109 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Fragment; - -use Symfony\Component\HttpFoundation\RequestStack; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpFoundation\StreamedResponse; -use Symfony\Component\HttpKernel\Controller\ControllerReference; -use Symfony\Component\HttpKernel\Exception\HttpException; - -/** - * Renders a URI that represents a resource fragment. - * - * This class handles the rendering of resource fragments that are included into - * a main resource. The handling of the rendering is managed by specialized renderers. - * - * @author Fabien Potencier - * - * @see FragmentRendererInterface - */ -class FragmentHandler -{ - private bool $debug; - private array $renderers = []; - private RequestStack $requestStack; - - /** - * @param FragmentRendererInterface[] $renderers An array of FragmentRendererInterface instances - * @param bool $debug Whether the debug mode is enabled or not - */ - public function __construct(RequestStack $requestStack, array $renderers = [], bool $debug = false) - { - $this->requestStack = $requestStack; - foreach ($renderers as $renderer) { - $this->addRenderer($renderer); - } - $this->debug = $debug; - } - - /** - * Adds a renderer. - */ - public function addRenderer(FragmentRendererInterface $renderer) - { - $this->renderers[$renderer->getName()] = $renderer; - } - - /** - * Renders a URI and returns the Response content. - * - * Available options: - * - * * ignore_errors: true to return an empty string in case of an error - * - * @throws \InvalidArgumentException when the renderer does not exist - * @throws \LogicException when no main request is being handled - */ - public function render(string|ControllerReference $uri, string $renderer = 'inline', array $options = []): ?string - { - if (!isset($options['ignore_errors'])) { - $options['ignore_errors'] = !$this->debug; - } - - if (!isset($this->renderers[$renderer])) { - throw new \InvalidArgumentException(sprintf('The "%s" renderer does not exist.', $renderer)); - } - - if (!$request = $this->requestStack->getCurrentRequest()) { - throw new \LogicException('Rendering a fragment can only be done when handling a Request.'); - } - - return $this->deliver($this->renderers[$renderer]->render($uri, $request, $options)); - } - - /** - * Delivers the Response as a string. - * - * When the Response is a StreamedResponse, the content is streamed immediately - * instead of being returned. - * - * @return string|null The Response content or null when the Response is streamed - * - * @throws \RuntimeException when the Response is not successful - */ - protected function deliver(Response $response): ?string - { - if (!$response->isSuccessful()) { - $responseStatusCode = $response->getStatusCode(); - throw new \RuntimeException(sprintf('Error when rendering "%s" (Status code is %d).', $this->requestStack->getCurrentRequest()->getUri(), $responseStatusCode), 0, new HttpException($responseStatusCode)); - } - - if (!$response instanceof StreamedResponse) { - return $response->getContent(); - } - - $response->sendContent(); - - return null; - } -} diff --git a/vendor/symfony/http-kernel/Fragment/FragmentRendererInterface.php b/vendor/symfony/http-kernel/Fragment/FragmentRendererInterface.php deleted file mode 100644 index a61f2e64..00000000 --- a/vendor/symfony/http-kernel/Fragment/FragmentRendererInterface.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Fragment; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\Controller\ControllerReference; - -/** - * Interface implemented by all rendering strategies. - * - * @author Fabien Potencier - */ -interface FragmentRendererInterface -{ - /** - * Renders a URI and returns the Response content. - */ - public function render(string|ControllerReference $uri, Request $request, array $options = []): Response; - - /** - * Gets the name of the strategy. - */ - public function getName(): string; -} diff --git a/vendor/symfony/http-kernel/Fragment/FragmentUriGenerator.php b/vendor/symfony/http-kernel/Fragment/FragmentUriGenerator.php deleted file mode 100644 index 6d9a1311..00000000 --- a/vendor/symfony/http-kernel/Fragment/FragmentUriGenerator.php +++ /dev/null @@ -1,90 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Fragment; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\RequestStack; -use Symfony\Component\HttpKernel\Controller\ControllerReference; -use Symfony\Component\HttpKernel\UriSigner; - -/** - * Generates a fragment URI. - * - * @author Kévin Dunglas - * @author Fabien Potencier - */ -final class FragmentUriGenerator implements FragmentUriGeneratorInterface -{ - private string $fragmentPath; - private ?UriSigner $signer; - private ?RequestStack $requestStack; - - public function __construct(string $fragmentPath, UriSigner $signer = null, RequestStack $requestStack = null) - { - $this->fragmentPath = $fragmentPath; - $this->signer = $signer; - $this->requestStack = $requestStack; - } - - public function generate(ControllerReference $controller, Request $request = null, bool $absolute = false, bool $strict = true, bool $sign = true): string - { - if (null === $request && (null === $this->requestStack || null === $request = $this->requestStack->getCurrentRequest())) { - throw new \LogicException('Generating a fragment URL can only be done when handling a Request.'); - } - - if ($sign && null === $this->signer) { - throw new \LogicException('You must use a URI when using the ESI rendering strategy or set a URL signer.'); - } - - if ($strict) { - $this->checkNonScalar($controller->attributes); - } - - // We need to forward the current _format and _locale values as we don't have - // a proper routing pattern to do the job for us. - // This makes things inconsistent if you switch from rendering a controller - // to rendering a route if the route pattern does not contain the special - // _format and _locale placeholders. - if (!isset($controller->attributes['_format'])) { - $controller->attributes['_format'] = $request->getRequestFormat(); - } - if (!isset($controller->attributes['_locale'])) { - $controller->attributes['_locale'] = $request->getLocale(); - } - - $controller->attributes['_controller'] = $controller->controller; - $controller->query['_path'] = http_build_query($controller->attributes, '', '&'); - $path = $this->fragmentPath.'?'.http_build_query($controller->query, '', '&'); - - // we need to sign the absolute URI, but want to return the path only. - $fragmentUri = $sign || $absolute ? $request->getUriForPath($path) : $request->getBaseUrl().$path; - - if (!$sign) { - return $fragmentUri; - } - - $fragmentUri = $this->signer->sign($fragmentUri); - - return $absolute ? $fragmentUri : substr($fragmentUri, \strlen($request->getSchemeAndHttpHost())); - } - - private function checkNonScalar(array $values): void - { - foreach ($values as $key => $value) { - if (\is_array($value)) { - $this->checkNonScalar($value); - } elseif (!\is_scalar($value) && null !== $value) { - throw new \LogicException(sprintf('Controller attributes cannot contain non-scalar/non-null values (value for key "%s" is not a scalar or null).', $key)); - } - } - } -} diff --git a/vendor/symfony/http-kernel/Fragment/FragmentUriGeneratorInterface.php b/vendor/symfony/http-kernel/Fragment/FragmentUriGeneratorInterface.php deleted file mode 100644 index 968c002b..00000000 --- a/vendor/symfony/http-kernel/Fragment/FragmentUriGeneratorInterface.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\HttpKernel\Fragment; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpKernel\Controller\ControllerReference; - -/** - * Interface implemented by rendering strategies able to generate a URL for a fragment. - * - * @author Kévin Dunglas - */ -interface FragmentUriGeneratorInterface -{ - /** - * Generates a fragment URI for a given controller. - * - * @param bool $absolute Whether to generate an absolute URL or not - * @param bool $strict Whether to allow non-scalar attributes or not - * @param bool $sign Whether to sign the URL or not - */ - public function generate(ControllerReference $controller, Request $request = null, bool $absolute = false, bool $strict = true, bool $sign = true): string; -} diff --git a/vendor/symfony/http-kernel/Fragment/HIncludeFragmentRenderer.php b/vendor/symfony/http-kernel/Fragment/HIncludeFragmentRenderer.php deleted file mode 100644 index ee99f859..00000000 --- a/vendor/symfony/http-kernel/Fragment/HIncludeFragmentRenderer.php +++ /dev/null @@ -1,97 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Fragment; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\Controller\ControllerReference; -use Symfony\Component\HttpKernel\UriSigner; -use Twig\Environment; - -/** - * Implements the Hinclude rendering strategy. - * - * @author Fabien Potencier - */ -class HIncludeFragmentRenderer extends RoutableFragmentRenderer -{ - private ?string $globalDefaultTemplate; - private ?UriSigner $signer; - private ?Environment $twig; - private string $charset; - - /** - * @param string $globalDefaultTemplate The global default content (it can be a template name or the content) - */ - public function __construct(Environment $twig = null, UriSigner $signer = null, string $globalDefaultTemplate = null, string $charset = 'utf-8') - { - $this->twig = $twig; - $this->globalDefaultTemplate = $globalDefaultTemplate; - $this->signer = $signer; - $this->charset = $charset; - } - - /** - * Checks if a templating engine has been set. - */ - public function hasTemplating(): bool - { - return null !== $this->twig; - } - - /** - * Additional available options: - * - * * default: The default content (it can be a template name or the content) - * * id: An optional hx:include tag id attribute - * * attributes: An optional array of hx:include tag attributes - */ - public function render(string|ControllerReference $uri, Request $request, array $options = []): Response - { - if ($uri instanceof ControllerReference) { - $uri = (new FragmentUriGenerator($this->fragmentPath, $this->signer))->generate($uri, $request); - } - - // We need to replace ampersands in the URI with the encoded form in order to return valid html/xml content. - $uri = str_replace('&', '&', $uri); - - $template = $options['default'] ?? $this->globalDefaultTemplate; - if (null !== $this->twig && $template && $this->twig->getLoader()->exists($template)) { - $content = $this->twig->render($template); - } else { - $content = $template; - } - - $attributes = isset($options['attributes']) && \is_array($options['attributes']) ? $options['attributes'] : []; - if (isset($options['id']) && $options['id']) { - $attributes['id'] = $options['id']; - } - $renderedAttributes = ''; - if (\count($attributes) > 0) { - $flags = \ENT_QUOTES | \ENT_SUBSTITUTE; - foreach ($attributes as $attribute => $value) { - $renderedAttributes .= sprintf( - ' %s="%s"', - htmlspecialchars($attribute, $flags, $this->charset, false), - htmlspecialchars($value, $flags, $this->charset, false) - ); - } - } - - return new Response(sprintf('%s', $uri, $renderedAttributes, $content)); - } - - public function getName(): string - { - return 'hinclude'; - } -} diff --git a/vendor/symfony/http-kernel/Fragment/InlineFragmentRenderer.php b/vendor/symfony/http-kernel/Fragment/InlineFragmentRenderer.php deleted file mode 100644 index 0e53768e..00000000 --- a/vendor/symfony/http-kernel/Fragment/InlineFragmentRenderer.php +++ /dev/null @@ -1,138 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Fragment; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\Controller\ControllerReference; -use Symfony\Component\HttpKernel\Event\ExceptionEvent; -use Symfony\Component\HttpKernel\HttpCache\SubRequestHandler; -use Symfony\Component\HttpKernel\HttpKernelInterface; -use Symfony\Component\HttpKernel\KernelEvents; -use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; - -/** - * Implements the inline rendering strategy where the Request is rendered by the current HTTP kernel. - * - * @author Fabien Potencier - */ -class InlineFragmentRenderer extends RoutableFragmentRenderer -{ - private HttpKernelInterface $kernel; - private ?EventDispatcherInterface $dispatcher; - - public function __construct(HttpKernelInterface $kernel, EventDispatcherInterface $dispatcher = null) - { - $this->kernel = $kernel; - $this->dispatcher = $dispatcher; - } - - /** - * Additional available options: - * - * * alt: an alternative URI to render in case of an error - */ - public function render(string|ControllerReference $uri, Request $request, array $options = []): Response - { - $reference = null; - if ($uri instanceof ControllerReference) { - $reference = $uri; - - // Remove attributes from the generated URI because if not, the Symfony - // routing system will use them to populate the Request attributes. We don't - // want that as we want to preserve objects (so we manually set Request attributes - // below instead) - $attributes = $reference->attributes; - $reference->attributes = []; - - // The request format and locale might have been overridden by the user - foreach (['_format', '_locale'] as $key) { - if (isset($attributes[$key])) { - $reference->attributes[$key] = $attributes[$key]; - } - } - - $uri = $this->generateFragmentUri($uri, $request, false, false); - - $reference->attributes = array_merge($attributes, $reference->attributes); - } - - $subRequest = $this->createSubRequest($uri, $request); - - // override Request attributes as they can be objects (which are not supported by the generated URI) - if (null !== $reference) { - $subRequest->attributes->add($reference->attributes); - } - - $level = ob_get_level(); - try { - return SubRequestHandler::handle($this->kernel, $subRequest, HttpKernelInterface::SUB_REQUEST, false); - } catch (\Exception $e) { - // we dispatch the exception event to trigger the logging - // the response that comes back is ignored - if (isset($options['ignore_errors']) && $options['ignore_errors'] && $this->dispatcher) { - $event = new ExceptionEvent($this->kernel, $request, HttpKernelInterface::SUB_REQUEST, $e); - - $this->dispatcher->dispatch($event, KernelEvents::EXCEPTION); - } - - // let's clean up the output buffers that were created by the sub-request - Response::closeOutputBuffers($level, false); - - if (isset($options['alt'])) { - $alt = $options['alt']; - unset($options['alt']); - - return $this->render($alt, $request, $options); - } - - if (!isset($options['ignore_errors']) || !$options['ignore_errors']) { - throw $e; - } - - return new Response(); - } - } - - protected function createSubRequest(string $uri, Request $request) - { - $cookies = $request->cookies->all(); - $server = $request->server->all(); - - unset($server['HTTP_IF_MODIFIED_SINCE']); - unset($server['HTTP_IF_NONE_MATCH']); - - $subRequest = Request::create($uri, 'get', [], $cookies, [], $server); - if ($request->headers->has('Surrogate-Capability')) { - $subRequest->headers->set('Surrogate-Capability', $request->headers->get('Surrogate-Capability')); - } - - static $setSession; - - $setSession ??= \Closure::bind(static function ($subRequest, $request) { $subRequest->session = $request->session; }, null, Request::class); - $setSession($subRequest, $request); - - if ($request->get('_format')) { - $subRequest->attributes->set('_format', $request->get('_format')); - } - if ($request->getDefaultLocale() !== $request->getLocale()) { - $subRequest->setLocale($request->getLocale()); - } - - return $subRequest; - } - - public function getName(): string - { - return 'inline'; - } -} diff --git a/vendor/symfony/http-kernel/Fragment/RoutableFragmentRenderer.php b/vendor/symfony/http-kernel/Fragment/RoutableFragmentRenderer.php deleted file mode 100644 index 416b6704..00000000 --- a/vendor/symfony/http-kernel/Fragment/RoutableFragmentRenderer.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Fragment; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpKernel\Controller\ControllerReference; -use Symfony\Component\HttpKernel\EventListener\FragmentListener; - -/** - * Adds the possibility to generate a fragment URI for a given Controller. - * - * @author Fabien Potencier - */ -abstract class RoutableFragmentRenderer implements FragmentRendererInterface -{ - /** - * @internal - */ - protected $fragmentPath = '/_fragment'; - - /** - * Sets the fragment path that triggers the fragment listener. - * - * @see FragmentListener - */ - public function setFragmentPath(string $path) - { - $this->fragmentPath = $path; - } - - /** - * Generates a fragment URI for a given controller. - * - * @param bool $absolute Whether to generate an absolute URL or not - * @param bool $strict Whether to allow non-scalar attributes or not - */ - protected function generateFragmentUri(ControllerReference $reference, Request $request, bool $absolute = false, bool $strict = true): string - { - return (new FragmentUriGenerator($this->fragmentPath))->generate($reference, $request, $absolute, $strict, false); - } -} diff --git a/vendor/symfony/http-kernel/Fragment/SsiFragmentRenderer.php b/vendor/symfony/http-kernel/Fragment/SsiFragmentRenderer.php deleted file mode 100644 index 6319bcd8..00000000 --- a/vendor/symfony/http-kernel/Fragment/SsiFragmentRenderer.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\HttpKernel\Fragment; - -/** - * Implements the SSI rendering strategy. - * - * @author Sebastian Krebs - */ -class SsiFragmentRenderer extends AbstractSurrogateFragmentRenderer -{ - public function getName(): string - { - return 'ssi'; - } -} diff --git a/vendor/symfony/http-kernel/HttpCache/AbstractSurrogate.php b/vendor/symfony/http-kernel/HttpCache/AbstractSurrogate.php deleted file mode 100644 index ca01a924..00000000 --- a/vendor/symfony/http-kernel/HttpCache/AbstractSurrogate.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\HttpKernel\HttpCache; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\HttpKernelInterface; - -/** - * Abstract class implementing Surrogate capabilities to Request and Response instances. - * - * @author Fabien Potencier - * @author Robin Chalas - */ -abstract class AbstractSurrogate implements SurrogateInterface -{ - protected $contentTypes; - protected $phpEscapeMap = [ - ['', '', '', ''], - ]; - - /** - * @param array $contentTypes An array of content-type that should be parsed for Surrogate information - * (default: text/html, text/xml, application/xhtml+xml, and application/xml) - */ - public function __construct(array $contentTypes = ['text/html', 'text/xml', 'application/xhtml+xml', 'application/xml']) - { - $this->contentTypes = $contentTypes; - } - - /** - * Returns a new cache strategy instance. - */ - public function createCacheStrategy(): ResponseCacheStrategyInterface - { - return new ResponseCacheStrategy(); - } - - public function hasSurrogateCapability(Request $request): bool - { - if (null === $value = $request->headers->get('Surrogate-Capability')) { - return false; - } - - return str_contains($value, sprintf('%s/1.0', strtoupper($this->getName()))); - } - - public function addSurrogateCapability(Request $request) - { - $current = $request->headers->get('Surrogate-Capability'); - $new = sprintf('symfony="%s/1.0"', strtoupper($this->getName())); - - $request->headers->set('Surrogate-Capability', $current ? $current.', '.$new : $new); - } - - public function needsParsing(Response $response): bool - { - if (!$control = $response->headers->get('Surrogate-Control')) { - return false; - } - - $pattern = sprintf('#content="[^"]*%s/1.0[^"]*"#', strtoupper($this->getName())); - - return (bool) preg_match($pattern, $control); - } - - public function handle(HttpCache $cache, string $uri, string $alt, bool $ignoreErrors): string - { - $subRequest = Request::create($uri, Request::METHOD_GET, [], $cache->getRequest()->cookies->all(), [], $cache->getRequest()->server->all()); - - try { - $response = $cache->handle($subRequest, HttpKernelInterface::SUB_REQUEST, true); - - if (!$response->isSuccessful() && Response::HTTP_NOT_MODIFIED !== $response->getStatusCode()) { - throw new \RuntimeException(sprintf('Error when rendering "%s" (Status code is %d).', $subRequest->getUri(), $response->getStatusCode())); - } - - return $response->getContent(); - } catch (\Exception $e) { - if ($alt) { - return $this->handle($cache, $alt, '', $ignoreErrors); - } - - if (!$ignoreErrors) { - throw $e; - } - } - - return ''; - } - - /** - * Remove the Surrogate from the Surrogate-Control header. - */ - protected function removeFromControl(Response $response) - { - if (!$response->headers->has('Surrogate-Control')) { - return; - } - - $value = $response->headers->get('Surrogate-Control'); - $upperName = strtoupper($this->getName()); - - if (sprintf('content="%s/1.0"', $upperName) == $value) { - $response->headers->remove('Surrogate-Control'); - } elseif (preg_match(sprintf('#,\s*content="%s/1.0"#', $upperName), $value)) { - $response->headers->set('Surrogate-Control', preg_replace(sprintf('#,\s*content="%s/1.0"#', $upperName), '', $value)); - } elseif (preg_match(sprintf('#content="%s/1.0",\s*#', $upperName), $value)) { - $response->headers->set('Surrogate-Control', preg_replace(sprintf('#content="%s/1.0",\s*#', $upperName), '', $value)); - } - } -} diff --git a/vendor/symfony/http-kernel/HttpCache/Esi.php b/vendor/symfony/http-kernel/HttpCache/Esi.php deleted file mode 100644 index 9e7c3f89..00000000 --- a/vendor/symfony/http-kernel/HttpCache/Esi.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\HttpKernel\HttpCache; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; - -/** - * Esi implements the ESI capabilities to Request and Response instances. - * - * For more information, read the following W3C notes: - * - * * ESI Language Specification 1.0 (http://www.w3.org/TR/esi-lang) - * - * * Edge Architecture Specification (http://www.w3.org/TR/edge-arch) - * - * @author Fabien Potencier - */ -class Esi extends AbstractSurrogate -{ - public function getName(): string - { - return 'esi'; - } - - public function addSurrogateControl(Response $response) - { - if (str_contains($response->getContent(), 'headers->set('Surrogate-Control', 'content="ESI/1.0"'); - } - } - - public function renderIncludeTag(string $uri, string $alt = null, bool $ignoreErrors = true, string $comment = ''): string - { - $html = sprintf('', - $uri, - $ignoreErrors ? ' onerror="continue"' : '', - $alt ? sprintf(' alt="%s"', $alt) : '' - ); - - if (!empty($comment)) { - return sprintf("\n%s", $comment, $html); - } - - return $html; - } - - public function process(Request $request, Response $response): Response - { - $type = $response->headers->get('Content-Type'); - if (empty($type)) { - $type = 'text/html'; - } - - $parts = explode(';', $type); - if (!\in_array($parts[0], $this->contentTypes)) { - return $response; - } - - // we don't use a proper XML parser here as we can have ESI tags in a plain text response - $content = $response->getContent(); - $content = preg_replace('#.*?#s', '', $content); - $content = preg_replace('#]+>#s', '', $content); - - $chunks = preg_split('##', $content, -1, \PREG_SPLIT_DELIM_CAPTURE); - $chunks[0] = str_replace($this->phpEscapeMap[0], $this->phpEscapeMap[1], $chunks[0]); - - $i = 1; - while (isset($chunks[$i])) { - $options = []; - preg_match_all('/(src|onerror|alt)="([^"]*?)"/', $chunks[$i], $matches, \PREG_SET_ORDER); - foreach ($matches as $set) { - $options[$set[1]] = $set[2]; - } - - if (!isset($options['src'])) { - throw new \RuntimeException('Unable to process an ESI tag without a "src" attribute.'); - } - - $chunks[$i] = sprintf('surrogate->handle($this, %s, %s, %s) ?>'."\n", - var_export($options['src'], true), - var_export($options['alt'] ?? '', true), - isset($options['onerror']) && 'continue' === $options['onerror'] ? 'true' : 'false' - ); - ++$i; - $chunks[$i] = str_replace($this->phpEscapeMap[0], $this->phpEscapeMap[1], $chunks[$i]); - ++$i; - } - $content = implode('', $chunks); - - $response->setContent($content); - $response->headers->set('X-Body-Eval', 'ESI'); - - // remove ESI/1.0 from the Surrogate-Control header - $this->removeFromControl($response); - - return $response; - } -} diff --git a/vendor/symfony/http-kernel/HttpCache/HttpCache.php b/vendor/symfony/http-kernel/HttpCache/HttpCache.php deleted file mode 100644 index bf2d6efb..00000000 --- a/vendor/symfony/http-kernel/HttpCache/HttpCache.php +++ /dev/null @@ -1,717 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * This code is partially based on the Rack-Cache library by Ryan Tomayko, - * which is released under the MIT license. - * (based on commit 02d2b48d75bcb63cf1c0c7149c077ad256542801) - */ - -namespace Symfony\Component\HttpKernel\HttpCache; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\HttpKernelInterface; -use Symfony\Component\HttpKernel\TerminableInterface; - -/** - * Cache provides HTTP caching. - * - * @author Fabien Potencier - */ -class HttpCache implements HttpKernelInterface, TerminableInterface -{ - private HttpKernelInterface $kernel; - private StoreInterface $store; - private Request $request; - private ?SurrogateInterface $surrogate; - private ?ResponseCacheStrategyInterface $surrogateCacheStrategy = null; - private array $options = []; - private array $traces = []; - - /** - * Constructor. - * - * The available options are: - * - * * debug If true, exceptions are thrown when things go wrong. Otherwise, the cache - * will try to carry on and deliver a meaningful response. - * - * * trace_level May be one of 'none', 'short' and 'full'. For 'short', a concise trace of the - * main request will be added as an HTTP header. 'full' will add traces for all - * requests (including ESI subrequests). (default: 'full' if in debug; 'none' otherwise) - * - * * trace_header Header name to use for traces. (default: X-Symfony-Cache) - * - * * default_ttl The number of seconds that a cache entry should be considered - * fresh when no explicit freshness information is provided in - * a response. Explicit Cache-Control or Expires headers - * override this value. (default: 0) - * - * * private_headers Set of request headers that trigger "private" cache-control behavior - * on responses that don't explicitly state whether the response is - * public or private via a Cache-Control directive. (default: Authorization and Cookie) - * - * * allow_reload Specifies whether the client can force a cache reload by including a - * Cache-Control "no-cache" directive in the request. Set it to ``true`` - * for compliance with RFC 2616. (default: false) - * - * * allow_revalidate Specifies whether the client can force a cache revalidate by including - * a Cache-Control "max-age=0" directive in the request. Set it to ``true`` - * for compliance with RFC 2616. (default: false) - * - * * stale_while_revalidate Specifies the default number of seconds (the granularity is the second as the - * Response TTL precision is a second) during which the cache can immediately return - * a stale response while it revalidates it in the background (default: 2). - * This setting is overridden by the stale-while-revalidate HTTP Cache-Control - * extension (see RFC 5861). - * - * * stale_if_error Specifies the default number of seconds (the granularity is the second) during which - * the cache can serve a stale response when an error is encountered (default: 60). - * This setting is overridden by the stale-if-error HTTP Cache-Control extension - * (see RFC 5861). - * - * * terminate_on_cache_hit Specifies if the kernel.terminate event should be dispatched even when the cache - * was hit (default: true). - * Unless your application needs to process events on cache hits, it is recommended - * to set this to false to avoid having to bootstrap the Symfony framework on a cache hit. - */ - public function __construct(HttpKernelInterface $kernel, StoreInterface $store, SurrogateInterface $surrogate = null, array $options = []) - { - $this->store = $store; - $this->kernel = $kernel; - $this->surrogate = $surrogate; - - // needed in case there is a fatal error because the backend is too slow to respond - register_shutdown_function($this->store->cleanup(...)); - - $this->options = array_merge([ - 'debug' => false, - 'default_ttl' => 0, - 'private_headers' => ['Authorization', 'Cookie'], - 'allow_reload' => false, - 'allow_revalidate' => false, - 'stale_while_revalidate' => 2, - 'stale_if_error' => 60, - 'trace_level' => 'none', - 'trace_header' => 'X-Symfony-Cache', - 'terminate_on_cache_hit' => true, - ], $options); - - if (!isset($options['trace_level'])) { - $this->options['trace_level'] = $this->options['debug'] ? 'full' : 'none'; - } - } - - /** - * Gets the current store. - */ - public function getStore(): StoreInterface - { - return $this->store; - } - - /** - * Returns an array of events that took place during processing of the last request. - */ - public function getTraces(): array - { - return $this->traces; - } - - private function addTraces(Response $response) - { - $traceString = null; - - if ('full' === $this->options['trace_level']) { - $traceString = $this->getLog(); - } - - if ('short' === $this->options['trace_level'] && $masterId = array_key_first($this->traces)) { - $traceString = implode('/', $this->traces[$masterId]); - } - - if (null !== $traceString) { - $response->headers->add([$this->options['trace_header'] => $traceString]); - } - } - - /** - * Returns a log message for the events of the last request processing. - */ - public function getLog(): string - { - $log = []; - foreach ($this->traces as $request => $traces) { - $log[] = sprintf('%s: %s', $request, implode(', ', $traces)); - } - - return implode('; ', $log); - } - - /** - * Gets the Request instance associated with the main request. - */ - public function getRequest(): Request - { - return $this->request; - } - - /** - * Gets the Kernel instance. - */ - public function getKernel(): HttpKernelInterface - { - return $this->kernel; - } - - /** - * Gets the Surrogate instance. - * - * @throws \LogicException - */ - public function getSurrogate(): SurrogateInterface - { - return $this->surrogate; - } - - public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true): Response - { - // FIXME: catch exceptions and implement a 500 error page here? -> in Varnish, there is a built-in error page mechanism - if (HttpKernelInterface::MAIN_REQUEST === $type) { - $this->traces = []; - // Keep a clone of the original request for surrogates so they can access it. - // We must clone here to get a separate instance because the application will modify the request during - // the application flow (we know it always does because we do ourselves by setting REMOTE_ADDR to 127.0.0.1 - // and adding the X-Forwarded-For header, see HttpCache::forward()). - $this->request = clone $request; - if (null !== $this->surrogate) { - $this->surrogateCacheStrategy = $this->surrogate->createCacheStrategy(); - } - } - - $this->traces[$this->getTraceKey($request)] = []; - - if (!$request->isMethodSafe()) { - $response = $this->invalidate($request, $catch); - } elseif ($request->headers->has('expect') || !$request->isMethodCacheable()) { - $response = $this->pass($request, $catch); - } elseif ($this->options['allow_reload'] && $request->isNoCache()) { - /* - If allow_reload is configured and the client requests "Cache-Control: no-cache", - reload the cache by fetching a fresh response and caching it (if possible). - */ - $this->record($request, 'reload'); - $response = $this->fetch($request, $catch); - } else { - $response = $this->lookup($request, $catch); - } - - $this->restoreResponseBody($request, $response); - - if (HttpKernelInterface::MAIN_REQUEST === $type) { - $this->addTraces($response); - } - - if (null !== $this->surrogate) { - if (HttpKernelInterface::MAIN_REQUEST === $type) { - $this->surrogateCacheStrategy->update($response); - } else { - $this->surrogateCacheStrategy->add($response); - } - } - - $response->prepare($request); - - $response->isNotModified($request); - - return $response; - } - - public function terminate(Request $request, Response $response) - { - // Do not call any listeners in case of a cache hit. - // This ensures identical behavior as if you had a separate - // reverse caching proxy such as Varnish and the like. - if ($this->options['terminate_on_cache_hit']) { - trigger_deprecation('symfony/http-kernel', '6.2', 'Setting "terminate_on_cache_hit" to "true" is deprecated and will be changed to "false" in Symfony 7.0.'); - } elseif (\in_array('fresh', $this->traces[$this->getTraceKey($request)] ?? [], true)) { - return; - } - - if ($this->getKernel() instanceof TerminableInterface) { - $this->getKernel()->terminate($request, $response); - } - } - - /** - * Forwards the Request to the backend without storing the Response in the cache. - * - * @param bool $catch Whether to process exceptions - */ - protected function pass(Request $request, bool $catch = false): Response - { - $this->record($request, 'pass'); - - return $this->forward($request, $catch); - } - - /** - * Invalidates non-safe methods (like POST, PUT, and DELETE). - * - * @param bool $catch Whether to process exceptions - * - * @throws \Exception - * - * @see RFC2616 13.10 - */ - protected function invalidate(Request $request, bool $catch = false): Response - { - $response = $this->pass($request, $catch); - - // invalidate only when the response is successful - if ($response->isSuccessful() || $response->isRedirect()) { - try { - $this->store->invalidate($request); - - // As per the RFC, invalidate Location and Content-Location URLs if present - foreach (['Location', 'Content-Location'] as $header) { - if ($uri = $response->headers->get($header)) { - $subRequest = Request::create($uri, 'get', [], [], [], $request->server->all()); - - $this->store->invalidate($subRequest); - } - } - - $this->record($request, 'invalidate'); - } catch (\Exception $e) { - $this->record($request, 'invalidate-failed'); - - if ($this->options['debug']) { - throw $e; - } - } - } - - return $response; - } - - /** - * Lookups a Response from the cache for the given Request. - * - * When a matching cache entry is found and is fresh, it uses it as the - * response without forwarding any request to the backend. When a matching - * cache entry is found but is stale, it attempts to "validate" the entry with - * the backend using conditional GET. When no matching cache entry is found, - * it triggers "miss" processing. - * - * @param bool $catch Whether to process exceptions - * - * @throws \Exception - */ - protected function lookup(Request $request, bool $catch = false): Response - { - try { - $entry = $this->store->lookup($request); - } catch (\Exception $e) { - $this->record($request, 'lookup-failed'); - - if ($this->options['debug']) { - throw $e; - } - - return $this->pass($request, $catch); - } - - if (null === $entry) { - $this->record($request, 'miss'); - - return $this->fetch($request, $catch); - } - - if (!$this->isFreshEnough($request, $entry)) { - $this->record($request, 'stale'); - - return $this->validate($request, $entry, $catch); - } - - if ($entry->headers->hasCacheControlDirective('no-cache')) { - return $this->validate($request, $entry, $catch); - } - - $this->record($request, 'fresh'); - - $entry->headers->set('Age', $entry->getAge()); - - return $entry; - } - - /** - * Validates that a cache entry is fresh. - * - * The original request is used as a template for a conditional - * GET request with the backend. - * - * @param bool $catch Whether to process exceptions - */ - protected function validate(Request $request, Response $entry, bool $catch = false): Response - { - $subRequest = clone $request; - - // send no head requests because we want content - if ('HEAD' === $request->getMethod()) { - $subRequest->setMethod('GET'); - } - - // add our cached last-modified validator - if ($entry->headers->has('Last-Modified')) { - $subRequest->headers->set('If-Modified-Since', $entry->headers->get('Last-Modified')); - } - - // Add our cached etag validator to the environment. - // We keep the etags from the client to handle the case when the client - // has a different private valid entry which is not cached here. - $cachedEtags = $entry->getEtag() ? [$entry->getEtag()] : []; - $requestEtags = $request->getETags(); - if ($etags = array_unique(array_merge($cachedEtags, $requestEtags))) { - $subRequest->headers->set('If-None-Match', implode(', ', $etags)); - } - - $response = $this->forward($subRequest, $catch, $entry); - - if (304 == $response->getStatusCode()) { - $this->record($request, 'valid'); - - // return the response and not the cache entry if the response is valid but not cached - $etag = $response->getEtag(); - if ($etag && \in_array($etag, $requestEtags) && !\in_array($etag, $cachedEtags)) { - return $response; - } - - $entry = clone $entry; - $entry->headers->remove('Date'); - - foreach (['Date', 'Expires', 'Cache-Control', 'ETag', 'Last-Modified'] as $name) { - if ($response->headers->has($name)) { - $entry->headers->set($name, $response->headers->get($name)); - } - } - - $response = $entry; - } else { - $this->record($request, 'invalid'); - } - - if ($response->isCacheable()) { - $this->store($request, $response); - } - - return $response; - } - - /** - * Unconditionally fetches a fresh response from the backend and - * stores it in the cache if is cacheable. - * - * @param bool $catch Whether to process exceptions - */ - protected function fetch(Request $request, bool $catch = false): Response - { - $subRequest = clone $request; - - // send no head requests because we want content - if ('HEAD' === $request->getMethod()) { - $subRequest->setMethod('GET'); - } - - // avoid that the backend sends no content - $subRequest->headers->remove('If-Modified-Since'); - $subRequest->headers->remove('If-None-Match'); - - $response = $this->forward($subRequest, $catch); - - if ($response->isCacheable()) { - $this->store($request, $response); - } - - return $response; - } - - /** - * Forwards the Request to the backend and returns the Response. - * - * All backend requests (cache passes, fetches, cache validations) - * run through this method. - * - * @param bool $catch Whether to catch exceptions or not - * @param Response|null $entry A Response instance (the stale entry if present, null otherwise) - * - * @return Response - */ - protected function forward(Request $request, bool $catch = false, Response $entry = null) - { - $this->surrogate?->addSurrogateCapability($request); - - // always a "master" request (as the real master request can be in cache) - $response = SubRequestHandler::handle($this->kernel, $request, HttpKernelInterface::MAIN_REQUEST, $catch); - - /* - * Support stale-if-error given on Responses or as a config option. - * RFC 7234 summarizes in Section 4.2.4 (but also mentions with the individual - * Cache-Control directives) that - * - * A cache MUST NOT generate a stale response if it is prohibited by an - * explicit in-protocol directive (e.g., by a "no-store" or "no-cache" - * cache directive, a "must-revalidate" cache-response-directive, or an - * applicable "s-maxage" or "proxy-revalidate" cache-response-directive; - * see Section 5.2.2). - * - * https://tools.ietf.org/html/rfc7234#section-4.2.4 - * - * We deviate from this in one detail, namely that we *do* serve entries in the - * stale-if-error case even if they have a `s-maxage` Cache-Control directive. - */ - if (null !== $entry - && \in_array($response->getStatusCode(), [500, 502, 503, 504]) - && !$entry->headers->hasCacheControlDirective('no-cache') - && !$entry->mustRevalidate() - ) { - if (null === $age = $entry->headers->getCacheControlDirective('stale-if-error')) { - $age = $this->options['stale_if_error']; - } - - /* - * stale-if-error gives the (extra) time that the Response may be used *after* it has become stale. - * So we compare the time the $entry has been sitting in the cache already with the - * time it was fresh plus the allowed grace period. - */ - if ($entry->getAge() <= $entry->getMaxAge() + $age) { - $this->record($request, 'stale-if-error'); - - return $entry; - } - } - - /* - RFC 7231 Sect. 7.1.1.2 says that a server that does not have a reasonably accurate - clock MUST NOT send a "Date" header, although it MUST send one in most other cases - except for 1xx or 5xx responses where it MAY do so. - - Anyway, a client that received a message without a "Date" header MUST add it. - */ - if (!$response->headers->has('Date')) { - $response->setDate(\DateTimeImmutable::createFromFormat('U', time())); - } - - $this->processResponseBody($request, $response); - - if ($this->isPrivateRequest($request) && !$response->headers->hasCacheControlDirective('public')) { - $response->setPrivate(); - } elseif ($this->options['default_ttl'] > 0 && null === $response->getTtl() && !$response->headers->getCacheControlDirective('must-revalidate')) { - $response->setTtl($this->options['default_ttl']); - } - - return $response; - } - - /** - * Checks whether the cache entry is "fresh enough" to satisfy the Request. - */ - protected function isFreshEnough(Request $request, Response $entry): bool - { - if (!$entry->isFresh()) { - return $this->lock($request, $entry); - } - - if ($this->options['allow_revalidate'] && null !== $maxAge = $request->headers->getCacheControlDirective('max-age')) { - return $maxAge > 0 && $maxAge >= $entry->getAge(); - } - - return true; - } - - /** - * Locks a Request during the call to the backend. - * - * @return bool true if the cache entry can be returned even if it is staled, false otherwise - */ - protected function lock(Request $request, Response $entry): bool - { - // try to acquire a lock to call the backend - $lock = $this->store->lock($request); - - if (true === $lock) { - // we have the lock, call the backend - return false; - } - - // there is already another process calling the backend - - // May we serve a stale response? - if ($this->mayServeStaleWhileRevalidate($entry)) { - $this->record($request, 'stale-while-revalidate'); - - return true; - } - - // wait for the lock to be released - if ($this->waitForLock($request)) { - // replace the current entry with the fresh one - $new = $this->lookup($request); - $entry->headers = $new->headers; - $entry->setContent($new->getContent()); - $entry->setStatusCode($new->getStatusCode()); - $entry->setProtocolVersion($new->getProtocolVersion()); - foreach ($new->headers->getCookies() as $cookie) { - $entry->headers->setCookie($cookie); - } - } else { - // backend is slow as hell, send a 503 response (to avoid the dog pile effect) - $entry->setStatusCode(503); - $entry->setContent('503 Service Unavailable'); - $entry->headers->set('Retry-After', 10); - } - - return true; - } - - /** - * Writes the Response to the cache. - * - * @throws \Exception - */ - protected function store(Request $request, Response $response) - { - try { - $this->store->write($request, $response); - - $this->record($request, 'store'); - - $response->headers->set('Age', $response->getAge()); - } catch (\Exception $e) { - $this->record($request, 'store-failed'); - - if ($this->options['debug']) { - throw $e; - } - } - - // now that the response is cached, release the lock - $this->store->unlock($request); - } - - /** - * Restores the Response body. - */ - private function restoreResponseBody(Request $request, Response $response) - { - if ($response->headers->has('X-Body-Eval')) { - ob_start(); - - if ($response->headers->has('X-Body-File')) { - include $response->headers->get('X-Body-File'); - } else { - eval('; ?>'.$response->getContent().'setContent(ob_get_clean()); - $response->headers->remove('X-Body-Eval'); - if (!$response->headers->has('Transfer-Encoding')) { - $response->headers->set('Content-Length', \strlen($response->getContent())); - } - } elseif ($response->headers->has('X-Body-File')) { - // Response does not include possibly dynamic content (ESI, SSI), so we need - // not handle the content for HEAD requests - if (!$request->isMethod('HEAD')) { - $response->setContent(file_get_contents($response->headers->get('X-Body-File'))); - } - } else { - return; - } - - $response->headers->remove('X-Body-File'); - } - - protected function processResponseBody(Request $request, Response $response) - { - if ($this->surrogate?->needsParsing($response)) { - $this->surrogate->process($request, $response); - } - } - - /** - * Checks if the Request includes authorization or other sensitive information - * that should cause the Response to be considered private by default. - */ - private function isPrivateRequest(Request $request): bool - { - foreach ($this->options['private_headers'] as $key) { - $key = strtolower(str_replace('HTTP_', '', $key)); - - if ('cookie' === $key) { - if (\count($request->cookies->all())) { - return true; - } - } elseif ($request->headers->has($key)) { - return true; - } - } - - return false; - } - - /** - * Records that an event took place. - */ - private function record(Request $request, string $event) - { - $this->traces[$this->getTraceKey($request)][] = $event; - } - - /** - * Calculates the key we use in the "trace" array for a given request. - */ - private function getTraceKey(Request $request): string - { - $path = $request->getPathInfo(); - if ($qs = $request->getQueryString()) { - $path .= '?'.$qs; - } - - return $request->getMethod().' '.$path; - } - - /** - * Checks whether the given (cached) response may be served as "stale" when a revalidation - * is currently in progress. - */ - private function mayServeStaleWhileRevalidate(Response $entry): bool - { - $timeout = $entry->headers->getCacheControlDirective('stale-while-revalidate'); - $timeout ??= $this->options['stale_while_revalidate']; - - return abs($entry->getTtl() ?? 0) < $timeout; - } - - /** - * Waits for the store to release a locked entry. - */ - private function waitForLock(Request $request): bool - { - $wait = 0; - while ($this->store->isLocked($request) && $wait < 100) { - usleep(50000); - ++$wait; - } - - return $wait < 100; - } -} diff --git a/vendor/symfony/http-kernel/HttpCache/ResponseCacheStrategy.php b/vendor/symfony/http-kernel/HttpCache/ResponseCacheStrategy.php deleted file mode 100644 index 0c9f1082..00000000 --- a/vendor/symfony/http-kernel/HttpCache/ResponseCacheStrategy.php +++ /dev/null @@ -1,232 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\HttpCache; - -use Symfony\Component\HttpFoundation\Response; - -/** - * ResponseCacheStrategy knows how to compute the Response cache HTTP header - * based on the different response cache headers. - * - * This implementation changes the main response TTL to the smallest TTL received - * or force validation if one of the surrogates has validation cache strategy. - * - * @author Fabien Potencier - */ -class ResponseCacheStrategy implements ResponseCacheStrategyInterface -{ - /** - * Cache-Control headers that are sent to the final response if they appear in ANY of the responses. - */ - private const OVERRIDE_DIRECTIVES = ['private', 'no-cache', 'no-store', 'no-transform', 'must-revalidate', 'proxy-revalidate']; - - /** - * Cache-Control headers that are sent to the final response if they appear in ALL of the responses. - */ - private const INHERIT_DIRECTIVES = ['public', 'immutable']; - - private int $embeddedResponses = 0; - private bool $isNotCacheableResponseEmbedded = false; - private int $age = 0; - private \DateTimeInterface|null|false $lastModified = null; - private array $flagDirectives = [ - 'no-cache' => null, - 'no-store' => null, - 'no-transform' => null, - 'must-revalidate' => null, - 'proxy-revalidate' => null, - 'public' => null, - 'private' => null, - 'immutable' => null, - ]; - private array $ageDirectives = [ - 'max-age' => null, - 's-maxage' => null, - 'expires' => null, - ]; - - public function add(Response $response) - { - ++$this->embeddedResponses; - - foreach (self::OVERRIDE_DIRECTIVES as $directive) { - if ($response->headers->hasCacheControlDirective($directive)) { - $this->flagDirectives[$directive] = true; - } - } - - foreach (self::INHERIT_DIRECTIVES as $directive) { - if (false !== $this->flagDirectives[$directive]) { - $this->flagDirectives[$directive] = $response->headers->hasCacheControlDirective($directive); - } - } - - $age = $response->getAge(); - $this->age = max($this->age, $age); - - if ($this->willMakeFinalResponseUncacheable($response)) { - $this->isNotCacheableResponseEmbedded = true; - - return; - } - - $isHeuristicallyCacheable = $response->headers->hasCacheControlDirective('public'); - $maxAge = $response->headers->hasCacheControlDirective('max-age') ? (int) $response->headers->getCacheControlDirective('max-age') : null; - $this->storeRelativeAgeDirective('max-age', $maxAge, $age, $isHeuristicallyCacheable); - $sharedMaxAge = $response->headers->hasCacheControlDirective('s-maxage') ? (int) $response->headers->getCacheControlDirective('s-maxage') : $maxAge; - $this->storeRelativeAgeDirective('s-maxage', $sharedMaxAge, $age, $isHeuristicallyCacheable); - - $expires = $response->getExpires(); - $expires = null !== $expires ? (int) $expires->format('U') - (int) $response->getDate()->format('U') : null; - $this->storeRelativeAgeDirective('expires', $expires >= 0 ? $expires : null, 0, $isHeuristicallyCacheable); - - if (false !== $this->lastModified) { - $lastModified = $response->getLastModified(); - $this->lastModified = $lastModified ? max($this->lastModified, $lastModified) : false; - } - } - - public function update(Response $response) - { - // if we have no embedded Response, do nothing - if (0 === $this->embeddedResponses) { - return; - } - - // Remove Etag since it cannot be merged from embedded responses. - $response->setEtag(null); - - $this->add($response); - - $response->headers->set('Age', $this->age); - - if ($this->isNotCacheableResponseEmbedded) { - $response->setLastModified(null); - - if ($this->flagDirectives['no-store']) { - $response->headers->set('Cache-Control', 'no-cache, no-store, must-revalidate'); - } else { - $response->headers->set('Cache-Control', 'no-cache, must-revalidate'); - } - - return; - } - - $response->setLastModified($this->lastModified ?: null); - - $flags = array_filter($this->flagDirectives); - - if (isset($flags['must-revalidate'])) { - $flags['no-cache'] = true; - } - - $response->headers->set('Cache-Control', implode(', ', array_keys($flags))); - - $maxAge = null; - - if (is_numeric($this->ageDirectives['max-age'])) { - $maxAge = $this->ageDirectives['max-age'] + $this->age; - $response->headers->addCacheControlDirective('max-age', $maxAge); - } - - if (is_numeric($this->ageDirectives['s-maxage'])) { - $sMaxage = $this->ageDirectives['s-maxage'] + $this->age; - - if ($maxAge !== $sMaxage) { - $response->headers->addCacheControlDirective('s-maxage', $sMaxage); - } - } - - if (is_numeric($this->ageDirectives['expires'])) { - $date = clone $response->getDate(); - $date->modify('+'.($this->ageDirectives['expires'] + $this->age).' seconds'); - $response->setExpires($date); - } - } - - /** - * RFC2616, Section 13.4. - * - * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.4 - */ - private function willMakeFinalResponseUncacheable(Response $response): bool - { - // RFC2616: A response received with a status code of 200, 203, 300, 301 or 410 - // MAY be stored by a cache […] unless a cache-control directive prohibits caching. - if ($response->headers->hasCacheControlDirective('no-cache') - || $response->headers->hasCacheControlDirective('no-store') - ) { - return true; - } - - // Etag headers cannot be merged, they render the response uncacheable - // by default (except if the response also has max-age etc.). - if (null === $response->getEtag() && \in_array($response->getStatusCode(), [200, 203, 300, 301, 410])) { - return false; - } - - // RFC2616: A response received with any other status code (e.g. status codes 302 and 307) - // MUST NOT be returned in a reply to a subsequent request unless there are - // cache-control directives or another header(s) that explicitly allow it. - $cacheControl = ['max-age', 's-maxage', 'must-revalidate', 'proxy-revalidate', 'public', 'private']; - foreach ($cacheControl as $key) { - if ($response->headers->hasCacheControlDirective($key)) { - return false; - } - } - - if ($response->headers->has('Expires')) { - return false; - } - - return true; - } - - /** - * Store lowest max-age/s-maxage/expires for the final response. - * - * The response might have been stored in cache a while ago. To keep things comparable, - * we have to subtract the age so that the value is normalized for an age of 0. - * - * If the value is lower than the currently stored value, we update the value, to keep a rolling - * minimal value of each instruction. - * - * If the value is NULL and the isHeuristicallyCacheable parameter is false, the directive will - * not be set on the final response. In this case, not all responses had the directive set and no - * value can be found that satisfies the requirements of all responses. The directive will be dropped - * from the final response. - * - * If the isHeuristicallyCacheable parameter is true, however, the current response has been marked - * as cacheable in a public (shared) cache, but did not provide an explicit lifetime that would serve - * as an upper bound. In this case, we can proceed and possibly keep the directive on the final response. - */ - private function storeRelativeAgeDirective(string $directive, ?int $value, int $age, bool $isHeuristicallyCacheable) - { - if (null === $value) { - if ($isHeuristicallyCacheable) { - /* - * See https://datatracker.ietf.org/doc/html/rfc7234#section-4.2.2 - * This particular response does not require maximum lifetime; heuristics might be applied. - * Other responses, however, might have more stringent requirements on maximum lifetime. - * So, return early here so that the final response can have the more limiting value set. - */ - return; - } - $this->ageDirectives[$directive] = false; - } - - if (false !== $this->ageDirectives[$directive]) { - $value -= $age; - $this->ageDirectives[$directive] = null !== $this->ageDirectives[$directive] ? min($this->ageDirectives[$directive], $value) : $value; - } - } -} diff --git a/vendor/symfony/http-kernel/HttpCache/ResponseCacheStrategyInterface.php b/vendor/symfony/http-kernel/HttpCache/ResponseCacheStrategyInterface.php deleted file mode 100644 index e282299a..00000000 --- a/vendor/symfony/http-kernel/HttpCache/ResponseCacheStrategyInterface.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * This code is partially based on the Rack-Cache library by Ryan Tomayko, - * which is released under the MIT license. - * (based on commit 02d2b48d75bcb63cf1c0c7149c077ad256542801) - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\HttpCache; - -use Symfony\Component\HttpFoundation\Response; - -/** - * ResponseCacheStrategyInterface implementations know how to compute the - * Response cache HTTP header based on the different response cache headers. - * - * @author Fabien Potencier - */ -interface ResponseCacheStrategyInterface -{ - /** - * Adds a Response. - */ - public function add(Response $response); - - /** - * Updates the Response HTTP headers based on the embedded Responses. - */ - public function update(Response $response); -} diff --git a/vendor/symfony/http-kernel/HttpCache/Ssi.php b/vendor/symfony/http-kernel/HttpCache/Ssi.php deleted file mode 100644 index 4bd1cef0..00000000 --- a/vendor/symfony/http-kernel/HttpCache/Ssi.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\HttpKernel\HttpCache; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; - -/** - * Ssi implements the SSI capabilities to Request and Response instances. - * - * @author Sebastian Krebs - */ -class Ssi extends AbstractSurrogate -{ - public function getName(): string - { - return 'ssi'; - } - - public function addSurrogateControl(Response $response) - { - if (str_contains($response->getContent(), '', $uri); - } - - public function process(Request $request, Response $response): Response - { - $type = $response->headers->get('Content-Type'); - if (empty($type)) { - $type = 'text/html'; - } - - $parts = explode(';', $type); - if (!\in_array($parts[0], $this->contentTypes)) { - return $response; - } - - // we don't use a proper XML parser here as we can have SSI tags in a plain text response - $content = $response->getContent(); - - $chunks = preg_split('##', $content, -1, \PREG_SPLIT_DELIM_CAPTURE); - $chunks[0] = str_replace($this->phpEscapeMap[0], $this->phpEscapeMap[1], $chunks[0]); - - $i = 1; - while (isset($chunks[$i])) { - $options = []; - preg_match_all('/(virtual)="([^"]*?)"/', $chunks[$i], $matches, \PREG_SET_ORDER); - foreach ($matches as $set) { - $options[$set[1]] = $set[2]; - } - - if (!isset($options['virtual'])) { - throw new \RuntimeException('Unable to process an SSI tag without a "virtual" attribute.'); - } - - $chunks[$i] = sprintf('surrogate->handle($this, %s, \'\', false) ?>'."\n", - var_export($options['virtual'], true) - ); - ++$i; - $chunks[$i] = str_replace($this->phpEscapeMap[0], $this->phpEscapeMap[1], $chunks[$i]); - ++$i; - } - $content = implode('', $chunks); - - $response->setContent($content); - $response->headers->set('X-Body-Eval', 'SSI'); - - // remove SSI/1.0 from the Surrogate-Control header - $this->removeFromControl($response); - - return $response; - } -} diff --git a/vendor/symfony/http-kernel/HttpCache/Store.php b/vendor/symfony/http-kernel/HttpCache/Store.php deleted file mode 100644 index 0309db21..00000000 --- a/vendor/symfony/http-kernel/HttpCache/Store.php +++ /dev/null @@ -1,466 +0,0 @@ - - * - * This code is partially based on the Rack-Cache library by Ryan Tomayko, - * which is released under the MIT license. - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\HttpCache; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; - -/** - * Store implements all the logic for storing cache metadata (Request and Response headers). - * - * @author Fabien Potencier - */ -class Store implements StoreInterface -{ - protected $root; - /** @var \SplObjectStorage */ - private \SplObjectStorage $keyCache; - /** @var array */ - private array $locks = []; - - /** - * @throws \RuntimeException - */ - public function __construct(string $root) - { - $this->root = $root; - if (!is_dir($this->root) && !@mkdir($this->root, 0777, true) && !is_dir($this->root)) { - throw new \RuntimeException(sprintf('Unable to create the store directory (%s).', $this->root)); - } - $this->keyCache = new \SplObjectStorage(); - } - - /** - * Cleanups storage. - */ - public function cleanup() - { - // unlock everything - foreach ($this->locks as $lock) { - flock($lock, \LOCK_UN); - fclose($lock); - } - - $this->locks = []; - } - - /** - * Tries to lock the cache for a given Request, without blocking. - * - * @return bool|string true if the lock is acquired, the path to the current lock otherwise - */ - public function lock(Request $request): bool|string - { - $key = $this->getCacheKey($request); - - if (!isset($this->locks[$key])) { - $path = $this->getPath($key); - if (!is_dir(\dirname($path)) && false === @mkdir(\dirname($path), 0777, true) && !is_dir(\dirname($path))) { - return $path; - } - $h = fopen($path, 'c'); - if (!flock($h, \LOCK_EX | \LOCK_NB)) { - fclose($h); - - return $path; - } - - $this->locks[$key] = $h; - } - - return true; - } - - /** - * Releases the lock for the given Request. - * - * @return bool False if the lock file does not exist or cannot be unlocked, true otherwise - */ - public function unlock(Request $request): bool - { - $key = $this->getCacheKey($request); - - if (isset($this->locks[$key])) { - flock($this->locks[$key], \LOCK_UN); - fclose($this->locks[$key]); - unset($this->locks[$key]); - - return true; - } - - return false; - } - - public function isLocked(Request $request): bool - { - $key = $this->getCacheKey($request); - - if (isset($this->locks[$key])) { - return true; // shortcut if lock held by this process - } - - if (!is_file($path = $this->getPath($key))) { - return false; - } - - $h = fopen($path, 'r'); - flock($h, \LOCK_EX | \LOCK_NB, $wouldBlock); - flock($h, \LOCK_UN); // release the lock we just acquired - fclose($h); - - return (bool) $wouldBlock; - } - - /** - * Locates a cached Response for the Request provided. - */ - public function lookup(Request $request): ?Response - { - $key = $this->getCacheKey($request); - - if (!$entries = $this->getMetadata($key)) { - return null; - } - - // find a cached entry that matches the request. - $match = null; - foreach ($entries as $entry) { - if ($this->requestsMatch(isset($entry[1]['vary'][0]) ? implode(', ', $entry[1]['vary']) : '', $request->headers->all(), $entry[0])) { - $match = $entry; - - break; - } - } - - if (null === $match) { - return null; - } - - $headers = $match[1]; - if (file_exists($path = $this->getPath($headers['x-content-digest'][0]))) { - return $this->restoreResponse($headers, $path); - } - - // TODO the metaStore referenced an entity that doesn't exist in - // the entityStore. We definitely want to return nil but we should - // also purge the entry from the meta-store when this is detected. - return null; - } - - /** - * Writes a cache entry to the store for the given Request and Response. - * - * Existing entries are read and any that match the response are removed. This - * method calls write with the new list of cache entries. - * - * @throws \RuntimeException - */ - public function write(Request $request, Response $response): string - { - $key = $this->getCacheKey($request); - $storedEnv = $this->persistRequest($request); - - if ($response->headers->has('X-Body-File')) { - // Assume the response came from disk, but at least perform some safeguard checks - if (!$response->headers->has('X-Content-Digest')) { - throw new \RuntimeException('A restored response must have the X-Content-Digest header.'); - } - - $digest = $response->headers->get('X-Content-Digest'); - if ($this->getPath($digest) !== $response->headers->get('X-Body-File')) { - throw new \RuntimeException('X-Body-File and X-Content-Digest do not match.'); - } - // Everything seems ok, omit writing content to disk - } else { - $digest = $this->generateContentDigest($response); - $response->headers->set('X-Content-Digest', $digest); - - if (!$this->save($digest, $response->getContent(), false)) { - throw new \RuntimeException('Unable to store the entity.'); - } - - if (!$response->headers->has('Transfer-Encoding')) { - $response->headers->set('Content-Length', \strlen($response->getContent())); - } - } - - // read existing cache entries, remove non-varying, and add this one to the list - $entries = []; - $vary = $response->headers->get('vary'); - foreach ($this->getMetadata($key) as $entry) { - if (!isset($entry[1]['vary'][0])) { - $entry[1]['vary'] = ['']; - } - - if ($entry[1]['vary'][0] != $vary || !$this->requestsMatch($vary ?? '', $entry[0], $storedEnv)) { - $entries[] = $entry; - } - } - - $headers = $this->persistResponse($response); - unset($headers['age']); - - array_unshift($entries, [$storedEnv, $headers]); - - if (!$this->save($key, serialize($entries))) { - throw new \RuntimeException('Unable to store the metadata.'); - } - - return $key; - } - - /** - * Returns content digest for $response. - */ - protected function generateContentDigest(Response $response): string - { - return 'en'.hash('xxh128', $response->getContent()); - } - - /** - * Invalidates all cache entries that match the request. - * - * @throws \RuntimeException - */ - public function invalidate(Request $request) - { - $modified = false; - $key = $this->getCacheKey($request); - - $entries = []; - foreach ($this->getMetadata($key) as $entry) { - $response = $this->restoreResponse($entry[1]); - if ($response->isFresh()) { - $response->expire(); - $modified = true; - $entries[] = [$entry[0], $this->persistResponse($response)]; - } else { - $entries[] = $entry; - } - } - - if ($modified && !$this->save($key, serialize($entries))) { - throw new \RuntimeException('Unable to store the metadata.'); - } - } - - /** - * Determines whether two Request HTTP header sets are non-varying based on - * the vary response header value provided. - * - * @param string|null $vary A Response vary header - * @param array $env1 A Request HTTP header array - * @param array $env2 A Request HTTP header array - */ - private function requestsMatch(?string $vary, array $env1, array $env2): bool - { - if (empty($vary)) { - return true; - } - - foreach (preg_split('/[\s,]+/', $vary) as $header) { - $key = str_replace('_', '-', strtolower($header)); - $v1 = $env1[$key] ?? null; - $v2 = $env2[$key] ?? null; - if ($v1 !== $v2) { - return false; - } - } - - return true; - } - - /** - * Gets all data associated with the given key. - * - * Use this method only if you know what you are doing. - */ - private function getMetadata(string $key): array - { - if (!$entries = $this->load($key)) { - return []; - } - - return unserialize($entries) ?: []; - } - - /** - * Purges data for the given URL. - * - * This method purges both the HTTP and the HTTPS version of the cache entry. - * - * @return bool true if the URL exists with either HTTP or HTTPS scheme and has been purged, false otherwise - */ - public function purge(string $url): bool - { - $http = preg_replace('#^https:#', 'http:', $url); - $https = preg_replace('#^http:#', 'https:', $url); - - $purgedHttp = $this->doPurge($http); - $purgedHttps = $this->doPurge($https); - - return $purgedHttp || $purgedHttps; - } - - /** - * Purges data for the given URL. - */ - private function doPurge(string $url): bool - { - $key = $this->getCacheKey(Request::create($url)); - if (isset($this->locks[$key])) { - flock($this->locks[$key], \LOCK_UN); - fclose($this->locks[$key]); - unset($this->locks[$key]); - } - - if (is_file($path = $this->getPath($key))) { - unlink($path); - - return true; - } - - return false; - } - - /** - * Loads data for the given key. - */ - private function load(string $key): ?string - { - $path = $this->getPath($key); - - return is_file($path) && false !== ($contents = @file_get_contents($path)) ? $contents : null; - } - - /** - * Save data for the given key. - */ - private function save(string $key, string $data, bool $overwrite = true): bool - { - $path = $this->getPath($key); - - if (!$overwrite && file_exists($path)) { - return true; - } - - if (isset($this->locks[$key])) { - $fp = $this->locks[$key]; - @ftruncate($fp, 0); - @fseek($fp, 0); - $len = @fwrite($fp, $data); - if (\strlen($data) !== $len) { - @ftruncate($fp, 0); - - return false; - } - } else { - if (!is_dir(\dirname($path)) && false === @mkdir(\dirname($path), 0777, true) && !is_dir(\dirname($path))) { - return false; - } - - $tmpFile = tempnam(\dirname($path), basename($path)); - if (false === $fp = @fopen($tmpFile, 'w')) { - @unlink($tmpFile); - - return false; - } - @fwrite($fp, $data); - @fclose($fp); - - if ($data != file_get_contents($tmpFile)) { - @unlink($tmpFile); - - return false; - } - - if (false === @rename($tmpFile, $path)) { - @unlink($tmpFile); - - return false; - } - } - - @chmod($path, 0666 & ~umask()); - - return true; - } - - public function getPath(string $key) - { - return $this->root.\DIRECTORY_SEPARATOR.substr($key, 0, 2).\DIRECTORY_SEPARATOR.substr($key, 2, 2).\DIRECTORY_SEPARATOR.substr($key, 4, 2).\DIRECTORY_SEPARATOR.substr($key, 6); - } - - /** - * Generates a cache key for the given Request. - * - * This method should return a key that must only depend on a - * normalized version of the request URI. - * - * If the same URI can have more than one representation, based on some - * headers, use a Vary header to indicate them, and each representation will - * be stored independently under the same cache key. - */ - protected function generateCacheKey(Request $request): string - { - return 'md'.hash('sha256', $request->getUri()); - } - - /** - * Returns a cache key for the given Request. - */ - private function getCacheKey(Request $request): string - { - if (isset($this->keyCache[$request])) { - return $this->keyCache[$request]; - } - - return $this->keyCache[$request] = $this->generateCacheKey($request); - } - - /** - * Persists the Request HTTP headers. - */ - private function persistRequest(Request $request): array - { - return $request->headers->all(); - } - - /** - * Persists the Response HTTP headers. - */ - private function persistResponse(Response $response): array - { - $headers = $response->headers->all(); - $headers['X-Status'] = [$response->getStatusCode()]; - - return $headers; - } - - /** - * Restores a Response from the HTTP headers and body. - */ - private function restoreResponse(array $headers, string $path = null): Response - { - $status = $headers['X-Status'][0]; - unset($headers['X-Status']); - - if (null !== $path) { - $headers['X-Body-File'] = [$path]; - } - - return new Response($path, $status, $headers); - } -} diff --git a/vendor/symfony/http-kernel/HttpCache/StoreInterface.php b/vendor/symfony/http-kernel/HttpCache/StoreInterface.php deleted file mode 100644 index 0cf8921c..00000000 --- a/vendor/symfony/http-kernel/HttpCache/StoreInterface.php +++ /dev/null @@ -1,79 +0,0 @@ - - * - * This code is partially based on the Rack-Cache library by Ryan Tomayko, - * which is released under the MIT license. - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\HttpCache; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; - -/** - * Interface implemented by HTTP cache stores. - * - * @author Fabien Potencier - */ -interface StoreInterface -{ - /** - * Locates a cached Response for the Request provided. - */ - public function lookup(Request $request): ?Response; - - /** - * Writes a cache entry to the store for the given Request and Response. - * - * Existing entries are read and any that match the response are removed. This - * method calls write with the new list of cache entries. - * - * @return string The key under which the response is stored - */ - public function write(Request $request, Response $response): string; - - /** - * Invalidates all cache entries that match the request. - */ - public function invalidate(Request $request); - - /** - * Locks the cache for a given Request. - * - * @return bool|string true if the lock is acquired, the path to the current lock otherwise - */ - public function lock(Request $request): bool|string; - - /** - * Releases the lock for the given Request. - * - * @return bool False if the lock file does not exist or cannot be unlocked, true otherwise - */ - public function unlock(Request $request): bool; - - /** - * Returns whether or not a lock exists. - * - * @return bool true if lock exists, false otherwise - */ - public function isLocked(Request $request): bool; - - /** - * Purges data for the given URL. - * - * @return bool true if the URL exists and has been purged, false otherwise - */ - public function purge(string $url): bool; - - /** - * Cleanups storage. - */ - public function cleanup(); -} diff --git a/vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php b/vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php deleted file mode 100644 index 253071f0..00000000 --- a/vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php +++ /dev/null @@ -1,92 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\HttpCache; - -use Symfony\Component\HttpFoundation\IpUtils; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\HttpKernelInterface; - -/** - * @author Nicolas Grekas - * - * @internal - */ -class SubRequestHandler -{ - public static function handle(HttpKernelInterface $kernel, Request $request, int $type, bool $catch): Response - { - // save global state related to trusted headers and proxies - $trustedProxies = Request::getTrustedProxies(); - $trustedHeaderSet = Request::getTrustedHeaderSet(); - - // remove untrusted values - $remoteAddr = $request->server->get('REMOTE_ADDR'); - if (!$remoteAddr || !IpUtils::checkIp($remoteAddr, $trustedProxies)) { - $trustedHeaders = [ - 'FORWARDED' => $trustedHeaderSet & Request::HEADER_FORWARDED, - 'X_FORWARDED_FOR' => $trustedHeaderSet & Request::HEADER_X_FORWARDED_FOR, - 'X_FORWARDED_HOST' => $trustedHeaderSet & Request::HEADER_X_FORWARDED_HOST, - 'X_FORWARDED_PROTO' => $trustedHeaderSet & Request::HEADER_X_FORWARDED_PROTO, - 'X_FORWARDED_PORT' => $trustedHeaderSet & Request::HEADER_X_FORWARDED_PORT, - 'X_FORWARDED_PREFIX' => $trustedHeaderSet & Request::HEADER_X_FORWARDED_PREFIX, - ]; - foreach (array_filter($trustedHeaders) as $name => $key) { - $request->headers->remove($name); - $request->server->remove('HTTP_'.$name); - } - } - - // compute trusted values, taking any trusted proxies into account - $trustedIps = []; - $trustedValues = []; - foreach (array_reverse($request->getClientIps()) as $ip) { - $trustedIps[] = $ip; - $trustedValues[] = sprintf('for="%s"', $ip); - } - if ($ip !== $remoteAddr) { - $trustedIps[] = $remoteAddr; - $trustedValues[] = sprintf('for="%s"', $remoteAddr); - } - - // set trusted values, reusing as much as possible the global trusted settings - if (Request::HEADER_FORWARDED & $trustedHeaderSet) { - $trustedValues[0] .= sprintf(';host="%s";proto=%s', $request->getHttpHost(), $request->getScheme()); - $request->headers->set('Forwarded', $v = implode(', ', $trustedValues)); - $request->server->set('HTTP_FORWARDED', $v); - } - if (Request::HEADER_X_FORWARDED_FOR & $trustedHeaderSet) { - $request->headers->set('X-Forwarded-For', $v = implode(', ', $trustedIps)); - $request->server->set('HTTP_X_FORWARDED_FOR', $v); - } elseif (!(Request::HEADER_FORWARDED & $trustedHeaderSet)) { - Request::setTrustedProxies($trustedProxies, $trustedHeaderSet | Request::HEADER_X_FORWARDED_FOR); - $request->headers->set('X-Forwarded-For', $v = implode(', ', $trustedIps)); - $request->server->set('HTTP_X_FORWARDED_FOR', $v); - } - - // fix the client IP address by setting it to 127.0.0.1, - // which is the core responsibility of this method - $request->server->set('REMOTE_ADDR', '127.0.0.1'); - - // ensure 127.0.0.1 is set as trusted proxy - if (!IpUtils::checkIp('127.0.0.1', $trustedProxies)) { - Request::setTrustedProxies(array_merge($trustedProxies, ['127.0.0.1']), Request::getTrustedHeaderSet()); - } - - try { - return $kernel->handle($request, $type, $catch); - } finally { - // restore global state - Request::setTrustedProxies($trustedProxies, $trustedHeaderSet); - } - } -} diff --git a/vendor/symfony/http-kernel/HttpCache/SurrogateInterface.php b/vendor/symfony/http-kernel/HttpCache/SurrogateInterface.php deleted file mode 100644 index f9b9930b..00000000 --- a/vendor/symfony/http-kernel/HttpCache/SurrogateInterface.php +++ /dev/null @@ -1,73 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\HttpCache; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; - -interface SurrogateInterface -{ - /** - * Returns surrogate name. - */ - public function getName(): string; - - /** - * Returns a new cache strategy instance. - */ - public function createCacheStrategy(): ResponseCacheStrategyInterface; - - /** - * Checks that at least one surrogate has Surrogate capability. - */ - public function hasSurrogateCapability(Request $request): bool; - - /** - * Adds Surrogate-capability to the given Request. - */ - public function addSurrogateCapability(Request $request); - - /** - * Adds HTTP headers to specify that the Response needs to be parsed for Surrogate. - * - * This method only adds an Surrogate HTTP header if the Response has some Surrogate tags. - */ - public function addSurrogateControl(Response $response); - - /** - * Checks that the Response needs to be parsed for Surrogate tags. - */ - public function needsParsing(Response $response): bool; - - /** - * Renders a Surrogate tag. - * - * @param string $alt An alternate URI - * @param string $comment A comment to add as an esi:include tag - */ - public function renderIncludeTag(string $uri, string $alt = null, bool $ignoreErrors = true, string $comment = ''): string; - - /** - * Replaces a Response Surrogate tags with the included resource content. - */ - public function process(Request $request, Response $response): Response; - - /** - * Handles a Surrogate from the cache. - * - * @param string $alt An alternative URI - * - * @throws \RuntimeException - * @throws \Exception - */ - public function handle(HttpCache $cache, string $uri, string $alt, bool $ignoreErrors): string; -} diff --git a/vendor/symfony/http-kernel/HttpClientKernel.php b/vendor/symfony/http-kernel/HttpClientKernel.php deleted file mode 100644 index 1d8c3027..00000000 --- a/vendor/symfony/http-kernel/HttpClientKernel.php +++ /dev/null @@ -1,112 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel; - -use Symfony\Component\HttpClient\HttpClient; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpFoundation\ResponseHeaderBag; -use Symfony\Component\Mime\Part\AbstractPart; -use Symfony\Component\Mime\Part\DataPart; -use Symfony\Component\Mime\Part\Multipart\FormDataPart; -use Symfony\Component\Mime\Part\TextPart; -use Symfony\Contracts\HttpClient\HttpClientInterface; - -// Help opcache.preload discover always-needed symbols -class_exists(ResponseHeaderBag::class); - -/** - * An implementation of a Symfony HTTP kernel using a "real" HTTP client. - * - * @author Fabien Potencier - */ -final class HttpClientKernel implements HttpKernelInterface -{ - private HttpClientInterface $client; - - public function __construct(HttpClientInterface $client = null) - { - if (null === $client && !class_exists(HttpClient::class)) { - throw new \LogicException(sprintf('You cannot use "%s" as the HttpClient component is not installed. Try running "composer require symfony/http-client".', __CLASS__)); - } - - $this->client = $client ?? HttpClient::create(); - } - - public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true): Response - { - $headers = $this->getHeaders($request); - $body = ''; - if (null !== $part = $this->getBody($request)) { - $headers = array_merge($headers, $part->getPreparedHeaders()->toArray()); - $body = $part->bodyToIterable(); - } - $response = $this->client->request($request->getMethod(), $request->getUri(), [ - 'headers' => $headers, - 'body' => $body, - ] + $request->attributes->get('http_client_options', [])); - - $response = new Response($response->getContent(!$catch), $response->getStatusCode(), $response->getHeaders(!$catch)); - - $response->headers->remove('X-Body-File'); - $response->headers->remove('X-Body-Eval'); - $response->headers->remove('X-Content-Digest'); - - $response->headers = new class($response->headers->all()) extends ResponseHeaderBag { - protected function computeCacheControlValue(): string - { - return $this->getCacheControlHeader(); // preserve the original value - } - }; - - return $response; - } - - private function getBody(Request $request): ?AbstractPart - { - if (\in_array($request->getMethod(), ['GET', 'HEAD'])) { - return null; - } - - if (!class_exists(AbstractPart::class)) { - throw new \LogicException('You cannot pass non-empty bodies as the Mime component is not installed. Try running "composer require symfony/mime".'); - } - - if ($content = $request->getContent()) { - return new TextPart($content, 'utf-8', 'plain', '8bit'); - } - - $fields = $request->request->all(); - foreach ($request->files->all() as $name => $file) { - $fields[$name] = DataPart::fromPath($file->getPathname(), $file->getClientOriginalName(), $file->getClientMimeType()); - } - - return new FormDataPart($fields); - } - - private function getHeaders(Request $request): array - { - $headers = []; - foreach ($request->headers as $key => $value) { - $headers[$key] = $value; - } - $cookies = []; - foreach ($request->cookies->all() as $name => $value) { - $cookies[] = $name.'='.$value; - } - if ($cookies) { - $headers['cookie'] = implode('; ', $cookies); - } - - return $headers; - } -} diff --git a/vendor/symfony/http-kernel/HttpKernel.php b/vendor/symfony/http-kernel/HttpKernel.php deleted file mode 100644 index 7f5c5925..00000000 --- a/vendor/symfony/http-kernel/HttpKernel.php +++ /dev/null @@ -1,301 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel; - -use Symfony\Component\HttpFoundation\Exception\RequestExceptionInterface; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\RequestStack; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\Controller\ArgumentResolver; -use Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface; -use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface; -use Symfony\Component\HttpKernel\Event\ControllerArgumentsEvent; -use Symfony\Component\HttpKernel\Event\ControllerEvent; -use Symfony\Component\HttpKernel\Event\ExceptionEvent; -use Symfony\Component\HttpKernel\Event\FinishRequestEvent; -use Symfony\Component\HttpKernel\Event\RequestEvent; -use Symfony\Component\HttpKernel\Event\ResponseEvent; -use Symfony\Component\HttpKernel\Event\TerminateEvent; -use Symfony\Component\HttpKernel\Event\ViewEvent; -use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; -use Symfony\Component\HttpKernel\Exception\ControllerDoesNotReturnResponseException; -use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface; -use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; -use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; - -// Help opcache.preload discover always-needed symbols -class_exists(ControllerArgumentsEvent::class); -class_exists(ControllerEvent::class); -class_exists(ExceptionEvent::class); -class_exists(FinishRequestEvent::class); -class_exists(RequestEvent::class); -class_exists(ResponseEvent::class); -class_exists(TerminateEvent::class); -class_exists(ViewEvent::class); -class_exists(KernelEvents::class); - -/** - * HttpKernel notifies events to convert a Request object to a Response one. - * - * @author Fabien Potencier - */ -class HttpKernel implements HttpKernelInterface, TerminableInterface -{ - protected $dispatcher; - protected $resolver; - protected $requestStack; - private ArgumentResolverInterface $argumentResolver; - private bool $handleAllThrowables; - - public function __construct(EventDispatcherInterface $dispatcher, ControllerResolverInterface $resolver, RequestStack $requestStack = null, ArgumentResolverInterface $argumentResolver = null, bool $handleAllThrowables = false) - { - $this->dispatcher = $dispatcher; - $this->resolver = $resolver; - $this->requestStack = $requestStack ?? new RequestStack(); - $this->argumentResolver = $argumentResolver ?? new ArgumentResolver(); - $this->handleAllThrowables = $handleAllThrowables; - } - - public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true): Response - { - $request->headers->set('X-Php-Ob-Level', (string) ob_get_level()); - - $this->requestStack->push($request); - try { - return $this->handleRaw($request, $type); - } catch (\Throwable $e) { - if ($e instanceof \Error && !$this->handleAllThrowables) { - throw $e; - } - - if ($e instanceof RequestExceptionInterface) { - $e = new BadRequestHttpException($e->getMessage(), $e); - } - if (false === $catch) { - $this->finishRequest($request, $type); - - throw $e; - } - - return $this->handleThrowable($e, $request, $type); - } finally { - $this->requestStack->pop(); - } - } - - public function terminate(Request $request, Response $response) - { - $this->dispatcher->dispatch(new TerminateEvent($this, $request, $response), KernelEvents::TERMINATE); - } - - /** - * @internal - */ - public function terminateWithException(\Throwable $exception, Request $request = null) - { - if (!$request ??= $this->requestStack->getMainRequest()) { - throw $exception; - } - - if ($pop = $request !== $this->requestStack->getMainRequest()) { - $this->requestStack->push($request); - } - - try { - $response = $this->handleThrowable($exception, $request, self::MAIN_REQUEST); - } finally { - if ($pop) { - $this->requestStack->pop(); - } - } - - $response->sendHeaders(); - $response->sendContent(); - - $this->terminate($request, $response); - } - - /** - * Handles a request to convert it to a response. - * - * Exceptions are not caught. - * - * @throws \LogicException If one of the listener does not behave as expected - * @throws NotFoundHttpException When controller cannot be found - */ - private function handleRaw(Request $request, int $type = self::MAIN_REQUEST): Response - { - // request - $event = new RequestEvent($this, $request, $type); - $this->dispatcher->dispatch($event, KernelEvents::REQUEST); - - if ($event->hasResponse()) { - return $this->filterResponse($event->getResponse(), $request, $type); - } - - // load controller - if (false === $controller = $this->resolver->getController($request)) { - throw new NotFoundHttpException(sprintf('Unable to find the controller for path "%s". The route is wrongly configured.', $request->getPathInfo())); - } - - $event = new ControllerEvent($this, $controller, $request, $type); - $this->dispatcher->dispatch($event, KernelEvents::CONTROLLER); - $controller = $event->getController(); - - // controller arguments - $arguments = $this->argumentResolver->getArguments($request, $controller, $event->getControllerReflector()); - - $event = new ControllerArgumentsEvent($this, $event, $arguments, $request, $type); - $this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS); - $controller = $event->getController(); - $arguments = $event->getArguments(); - - // call controller - $response = $controller(...$arguments); - - // view - if (!$response instanceof Response) { - $event = new ViewEvent($this, $request, $type, $response, $event); - $this->dispatcher->dispatch($event, KernelEvents::VIEW); - - if ($event->hasResponse()) { - $response = $event->getResponse(); - } else { - $msg = sprintf('The controller must return a "Symfony\Component\HttpFoundation\Response" object but it returned %s.', $this->varToString($response)); - - // the user may have forgotten to return something - if (null === $response) { - $msg .= ' Did you forget to add a return statement somewhere in your controller?'; - } - - throw new ControllerDoesNotReturnResponseException($msg, $controller, __FILE__, __LINE__ - 17); - } - } - - return $this->filterResponse($response, $request, $type); - } - - /** - * Filters a response object. - * - * @throws \RuntimeException if the passed object is not a Response instance - */ - private function filterResponse(Response $response, Request $request, int $type): Response - { - $event = new ResponseEvent($this, $request, $type, $response); - - $this->dispatcher->dispatch($event, KernelEvents::RESPONSE); - - $this->finishRequest($request, $type); - - return $event->getResponse(); - } - - /** - * Publishes the finish request event, then pop the request from the stack. - * - * Note that the order of the operations is important here, otherwise - * operations such as {@link RequestStack::getParentRequest()} can lead to - * weird results. - */ - private function finishRequest(Request $request, int $type) - { - $this->dispatcher->dispatch(new FinishRequestEvent($this, $request, $type), KernelEvents::FINISH_REQUEST); - } - - /** - * Handles a throwable by trying to convert it to a Response. - */ - private function handleThrowable(\Throwable $e, Request $request, int $type): Response - { - $event = new ExceptionEvent($this, $request, $type, $e); - $this->dispatcher->dispatch($event, KernelEvents::EXCEPTION); - - // a listener might have replaced the exception - $e = $event->getThrowable(); - - if (!$event->hasResponse()) { - $this->finishRequest($request, $type); - - throw $e; - } - - $response = $event->getResponse(); - - // the developer asked for a specific status code - if (!$event->isAllowingCustomResponseCode() && !$response->isClientError() && !$response->isServerError() && !$response->isRedirect()) { - // ensure that we actually have an error response - if ($e instanceof HttpExceptionInterface) { - // keep the HTTP status code and headers - $response->setStatusCode($e->getStatusCode()); - $response->headers->add($e->getHeaders()); - } else { - $response->setStatusCode(500); - } - } - - try { - return $this->filterResponse($response, $request, $type); - } catch (\Throwable $e) { - if ($e instanceof \Error && !$this->handleAllThrowables) { - throw $e; - } - - return $response; - } - } - - /** - * Returns a human-readable string for the specified variable. - */ - private function varToString(mixed $var): string - { - if (\is_object($var)) { - return sprintf('an object of type %s', $var::class); - } - - if (\is_array($var)) { - $a = []; - foreach ($var as $k => $v) { - $a[] = sprintf('%s => ...', $k); - } - - return sprintf('an array ([%s])', mb_substr(implode(', ', $a), 0, 255)); - } - - if (\is_resource($var)) { - return sprintf('a resource (%s)', get_resource_type($var)); - } - - if (null === $var) { - return 'null'; - } - - if (false === $var) { - return 'a boolean value (false)'; - } - - if (true === $var) { - return 'a boolean value (true)'; - } - - if (\is_string($var)) { - return sprintf('a string ("%s%s")', mb_substr($var, 0, 255), mb_strlen($var) > 255 ? '...' : ''); - } - - if (is_numeric($var)) { - return sprintf('a number (%s)', (string) $var); - } - - return (string) $var; - } -} diff --git a/vendor/symfony/http-kernel/HttpKernelBrowser.php b/vendor/symfony/http-kernel/HttpKernelBrowser.php deleted file mode 100644 index 09386171..00000000 --- a/vendor/symfony/http-kernel/HttpKernelBrowser.php +++ /dev/null @@ -1,193 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel; - -use Symfony\Component\BrowserKit\AbstractBrowser; -use Symfony\Component\BrowserKit\CookieJar; -use Symfony\Component\BrowserKit\History; -use Symfony\Component\BrowserKit\Request as DomRequest; -use Symfony\Component\BrowserKit\Response as DomResponse; -use Symfony\Component\HttpFoundation\File\UploadedFile; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; - -/** - * Simulates a browser and makes requests to an HttpKernel instance. - * - * @author Fabien Potencier - * - * @method Request getRequest() - * @method Response getResponse() - */ -class HttpKernelBrowser extends AbstractBrowser -{ - protected $kernel; - private bool $catchExceptions = true; - - /** - * @param array $server The server parameters (equivalent of $_SERVER) - */ - public function __construct(HttpKernelInterface $kernel, array $server = [], History $history = null, CookieJar $cookieJar = null) - { - // These class properties must be set before calling the parent constructor, as it may depend on it. - $this->kernel = $kernel; - $this->followRedirects = false; - - parent::__construct($server, $history, $cookieJar); - } - - /** - * Sets whether to catch exceptions when the kernel is handling a request. - */ - public function catchExceptions(bool $catchExceptions) - { - $this->catchExceptions = $catchExceptions; - } - - /** - * @param Request $request - * - * @return Response - */ - protected function doRequest(object $request) - { - $response = $this->kernel->handle($request, HttpKernelInterface::MAIN_REQUEST, $this->catchExceptions); - - if ($this->kernel instanceof TerminableInterface) { - $this->kernel->terminate($request, $response); - } - - return $response; - } - - /** - * @param Request $request - * - * @return string - */ - protected function getScript(object $request) - { - $kernel = var_export(serialize($this->kernel), true); - $request = var_export(serialize($request), true); - - $errorReporting = error_reporting(); - - $requires = ''; - foreach (get_declared_classes() as $class) { - if (str_starts_with($class, 'ComposerAutoloaderInit')) { - $r = new \ReflectionClass($class); - $file = \dirname($r->getFileName(), 2).'/autoload.php'; - if (file_exists($file)) { - $requires .= 'require_once '.var_export($file, true).";\n"; - } - } - } - - if (!$requires) { - throw new \RuntimeException('Composer autoloader not found.'); - } - - $code = <<getHandleScript(); - } - - protected function getHandleScript() - { - return <<<'EOF' -$response = $kernel->handle($request); - -if ($kernel instanceof Symfony\Component\HttpKernel\TerminableInterface) { - $kernel->terminate($request, $response); -} - -echo serialize($response); -EOF; - } - - protected function filterRequest(DomRequest $request): Request - { - $httpRequest = Request::create($request->getUri(), $request->getMethod(), $request->getParameters(), $request->getCookies(), $request->getFiles(), $server = $request->getServer(), $request->getContent()); - if (!isset($server['HTTP_ACCEPT'])) { - $httpRequest->headers->remove('Accept'); - } - - foreach ($this->filterFiles($httpRequest->files->all()) as $key => $value) { - $httpRequest->files->set($key, $value); - } - - return $httpRequest; - } - - /** - * Filters an array of files. - * - * This method created test instances of UploadedFile so that the move() - * method can be called on those instances. - * - * If the size of a file is greater than the allowed size (from php.ini) then - * an invalid UploadedFile is returned with an error set to UPLOAD_ERR_INI_SIZE. - * - * @see UploadedFile - */ - protected function filterFiles(array $files): array - { - $filtered = []; - foreach ($files as $key => $value) { - if (\is_array($value)) { - $filtered[$key] = $this->filterFiles($value); - } elseif ($value instanceof UploadedFile) { - if ($value->isValid() && $value->getSize() > UploadedFile::getMaxFilesize()) { - $filtered[$key] = new UploadedFile( - '', - $value->getClientOriginalName(), - $value->getClientMimeType(), - \UPLOAD_ERR_INI_SIZE, - true - ); - } else { - $filtered[$key] = new UploadedFile( - $value->getPathname(), - $value->getClientOriginalName(), - $value->getClientMimeType(), - $value->getError(), - true - ); - } - } - } - - return $filtered; - } - - /** - * @param Response $response - */ - protected function filterResponse(object $response): DomResponse - { - // this is needed to support StreamedResponse - ob_start(); - $response->sendContent(); - $content = ob_get_clean(); - - return new DomResponse($content, $response->getStatusCode(), $response->headers->all()); - } -} diff --git a/vendor/symfony/http-kernel/HttpKernelInterface.php b/vendor/symfony/http-kernel/HttpKernelInterface.php deleted file mode 100644 index f6c017a4..00000000 --- a/vendor/symfony/http-kernel/HttpKernelInterface.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; - -/** - * HttpKernelInterface handles a Request to convert it to a Response. - * - * @author Fabien Potencier - */ -interface HttpKernelInterface -{ - public const MAIN_REQUEST = 1; - public const SUB_REQUEST = 2; - - /** - * @deprecated since symfony/http-kernel 5.3, use MAIN_REQUEST instead. - * To ease the migration, this constant won't be removed until Symfony 7.0. - */ - public const MASTER_REQUEST = self::MAIN_REQUEST; - - /** - * Handles a Request to convert it to a Response. - * - * When $catch is true, the implementation must catch all exceptions - * and do its best to convert them to a Response instance. - * - * @param int $type The type of the request - * (one of HttpKernelInterface::MAIN_REQUEST or HttpKernelInterface::SUB_REQUEST) - * @param bool $catch Whether to catch exceptions or not - * - * @throws \Exception When an Exception occurs during processing - */ - public function handle(Request $request, int $type = self::MAIN_REQUEST, bool $catch = true): Response; -} diff --git a/vendor/symfony/http-kernel/Kernel.php b/vendor/symfony/http-kernel/Kernel.php deleted file mode 100644 index 358dab3a..00000000 --- a/vendor/symfony/http-kernel/Kernel.php +++ /dev/null @@ -1,798 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel; - -use Symfony\Component\Config\Builder\ConfigBuilderGenerator; -use Symfony\Component\Config\ConfigCache; -use Symfony\Component\Config\Loader\DelegatingLoader; -use Symfony\Component\Config\Loader\LoaderResolver; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\Compiler\PassConfig; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\Dumper\PhpDumper; -use Symfony\Component\DependencyInjection\Dumper\Preloader; -use Symfony\Component\DependencyInjection\Extension\ExtensionInterface; -use Symfony\Component\DependencyInjection\Loader\ClosureLoader; -use Symfony\Component\DependencyInjection\Loader\DirectoryLoader; -use Symfony\Component\DependencyInjection\Loader\GlobFileLoader; -use Symfony\Component\DependencyInjection\Loader\IniFileLoader; -use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; -use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; -use Symfony\Component\ErrorHandler\DebugClassLoader; -use Symfony\Component\Filesystem\Filesystem; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\Bundle\BundleInterface; -use Symfony\Component\HttpKernel\CacheWarmer\WarmableInterface; -use Symfony\Component\HttpKernel\Config\FileLocator; -use Symfony\Component\HttpKernel\DependencyInjection\AddAnnotatedClassesToCachePass; -use Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass; - -// Help opcache.preload discover always-needed symbols -class_exists(ConfigCache::class); - -/** - * The Kernel is the heart of the Symfony system. - * - * It manages an environment made of bundles. - * - * Environment names must always start with a letter and - * they must only contain letters and numbers. - * - * @author Fabien Potencier - */ -abstract class Kernel implements KernelInterface, RebootableInterface, TerminableInterface -{ - /** - * @var array - */ - protected $bundles = []; - - protected $container; - protected $environment; - protected $debug; - protected $booted = false; - protected $startTime; - - private string $projectDir; - private ?string $warmupDir = null; - private int $requestStackSize = 0; - private bool $resetServices = false; - - /** - * @var array - */ - private static array $freshCache = []; - - public const VERSION = '6.2.2'; - public const VERSION_ID = 60202; - public const MAJOR_VERSION = 6; - public const MINOR_VERSION = 2; - public const RELEASE_VERSION = 2; - public const EXTRA_VERSION = ''; - - public const END_OF_MAINTENANCE = '07/2023'; - public const END_OF_LIFE = '07/2023'; - - public function __construct(string $environment, bool $debug) - { - if (!$this->environment = $environment) { - throw new \InvalidArgumentException(sprintf('Invalid environment provided to "%s": the environment cannot be empty.', get_debug_type($this))); - } - - $this->debug = $debug; - } - - public function __clone() - { - $this->booted = false; - $this->container = null; - $this->requestStackSize = 0; - $this->resetServices = false; - } - - public function boot() - { - if (true === $this->booted) { - if (!$this->requestStackSize && $this->resetServices) { - if ($this->container->has('services_resetter')) { - $this->container->get('services_resetter')->reset(); - } - $this->resetServices = false; - if ($this->debug) { - $this->startTime = microtime(true); - } - } - - return; - } - - if (null === $this->container) { - $this->preBoot(); - } - - foreach ($this->getBundles() as $bundle) { - $bundle->setContainer($this->container); - $bundle->boot(); - } - - $this->booted = true; - } - - public function reboot(?string $warmupDir) - { - $this->shutdown(); - $this->warmupDir = $warmupDir; - $this->boot(); - } - - public function terminate(Request $request, Response $response) - { - if (false === $this->booted) { - return; - } - - if ($this->getHttpKernel() instanceof TerminableInterface) { - $this->getHttpKernel()->terminate($request, $response); - } - } - - public function shutdown() - { - if (false === $this->booted) { - return; - } - - $this->booted = false; - - foreach ($this->getBundles() as $bundle) { - $bundle->shutdown(); - $bundle->setContainer(null); - } - - $this->container = null; - $this->requestStackSize = 0; - $this->resetServices = false; - } - - public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true): Response - { - if (!$this->booted) { - $container = $this->container ?? $this->preBoot(); - - if ($container->has('http_cache')) { - return $container->get('http_cache')->handle($request, $type, $catch); - } - } - - $this->boot(); - ++$this->requestStackSize; - $this->resetServices = true; - - try { - return $this->getHttpKernel()->handle($request, $type, $catch); - } finally { - --$this->requestStackSize; - } - } - - /** - * Gets an HTTP kernel from the container. - */ - protected function getHttpKernel(): HttpKernelInterface - { - return $this->container->get('http_kernel'); - } - - public function getBundles(): array - { - return $this->bundles; - } - - public function getBundle(string $name): BundleInterface - { - if (!isset($this->bundles[$name])) { - throw new \InvalidArgumentException(sprintf('Bundle "%s" does not exist or it is not enabled. Maybe you forgot to add it in the "registerBundles()" method of your "%s.php" file?', $name, get_debug_type($this))); - } - - return $this->bundles[$name]; - } - - public function locateResource(string $name): string - { - if ('@' !== $name[0]) { - throw new \InvalidArgumentException(sprintf('A resource name must start with @ ("%s" given).', $name)); - } - - if (str_contains($name, '..')) { - throw new \RuntimeException(sprintf('File name "%s" contains invalid characters (..).', $name)); - } - - $bundleName = substr($name, 1); - $path = ''; - if (str_contains($bundleName, '/')) { - [$bundleName, $path] = explode('/', $bundleName, 2); - } - - $bundle = $this->getBundle($bundleName); - if (file_exists($file = $bundle->getPath().'/'.$path)) { - return $file; - } - - throw new \InvalidArgumentException(sprintf('Unable to find file "%s".', $name)); - } - - public function getEnvironment(): string - { - return $this->environment; - } - - public function isDebug(): bool - { - return $this->debug; - } - - /** - * Gets the application root dir (path of the project's composer file). - */ - public function getProjectDir(): string - { - if (!isset($this->projectDir)) { - $r = new \ReflectionObject($this); - - if (!is_file($dir = $r->getFileName())) { - throw new \LogicException(sprintf('Cannot auto-detect project dir for kernel of class "%s".', $r->name)); - } - - $dir = $rootDir = \dirname($dir); - while (!is_file($dir.'/composer.json')) { - if ($dir === \dirname($dir)) { - return $this->projectDir = $rootDir; - } - $dir = \dirname($dir); - } - $this->projectDir = $dir; - } - - return $this->projectDir; - } - - public function getContainer(): ContainerInterface - { - if (!$this->container) { - throw new \LogicException('Cannot retrieve the container from a non-booted kernel.'); - } - - return $this->container; - } - - /** - * @internal - */ - public function setAnnotatedClassCache(array $annotatedClasses) - { - file_put_contents(($this->warmupDir ?: $this->getBuildDir()).'/annotations.map', sprintf('debug && null !== $this->startTime ? $this->startTime : -\INF; - } - - public function getCacheDir(): string - { - return $this->getProjectDir().'/var/cache/'.$this->environment; - } - - public function getBuildDir(): string - { - // Returns $this->getCacheDir() for backward compatibility - return $this->getCacheDir(); - } - - public function getLogDir(): string - { - return $this->getProjectDir().'/var/log'; - } - - public function getCharset(): string - { - return 'UTF-8'; - } - - /** - * Gets the patterns defining the classes to parse and cache for annotations. - */ - public function getAnnotatedClassesToCompile(): array - { - return []; - } - - /** - * Initializes bundles. - * - * @throws \LogicException if two bundles share a common name - */ - protected function initializeBundles() - { - // init bundles - $this->bundles = []; - foreach ($this->registerBundles() as $bundle) { - $name = $bundle->getName(); - if (isset($this->bundles[$name])) { - throw new \LogicException(sprintf('Trying to register two bundles with the same name "%s".', $name)); - } - $this->bundles[$name] = $bundle; - } - } - - /** - * The extension point similar to the Bundle::build() method. - * - * Use this method to register compiler passes and manipulate the container during the building process. - */ - protected function build(ContainerBuilder $container) - { - } - - /** - * Gets the container class. - * - * @throws \InvalidArgumentException If the generated classname is invalid - */ - protected function getContainerClass(): string - { - $class = static::class; - $class = str_contains($class, "@anonymous\0") ? get_parent_class($class).str_replace('.', '_', ContainerBuilder::hash($class)) : $class; - $class = str_replace('\\', '_', $class).ucfirst($this->environment).($this->debug ? 'Debug' : '').'Container'; - - if (!preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $class)) { - throw new \InvalidArgumentException(sprintf('The environment "%s" contains invalid characters, it can only contain characters allowed in PHP class names.', $this->environment)); - } - - return $class; - } - - /** - * Gets the container's base class. - * - * All names except Container must be fully qualified. - */ - protected function getContainerBaseClass(): string - { - return 'Container'; - } - - /** - * Initializes the service container. - * - * The built version of the service container is used when fresh, otherwise the - * container is built. - */ - protected function initializeContainer() - { - $class = $this->getContainerClass(); - $buildDir = $this->warmupDir ?: $this->getBuildDir(); - $cache = new ConfigCache($buildDir.'/'.$class.'.php', $this->debug); - $cachePath = $cache->getPath(); - - // Silence E_WARNING to ignore "include" failures - don't use "@" to prevent silencing fatal errors - $errorLevel = error_reporting(\E_ALL ^ \E_WARNING); - - try { - if (is_file($cachePath) && \is_object($this->container = include $cachePath) - && (!$this->debug || (self::$freshCache[$cachePath] ?? $cache->isFresh())) - ) { - self::$freshCache[$cachePath] = true; - $this->container->set('kernel', $this); - error_reporting($errorLevel); - - return; - } - } catch (\Throwable $e) { - } - - $oldContainer = \is_object($this->container) ? new \ReflectionClass($this->container) : $this->container = null; - - try { - is_dir($buildDir) ?: mkdir($buildDir, 0777, true); - - if ($lock = fopen($cachePath.'.lock', 'w')) { - if (!flock($lock, \LOCK_EX | \LOCK_NB, $wouldBlock) && !flock($lock, $wouldBlock ? \LOCK_SH : \LOCK_EX)) { - fclose($lock); - $lock = null; - } elseif (!is_file($cachePath) || !\is_object($this->container = include $cachePath)) { - $this->container = null; - } elseif (!$oldContainer || \get_class($this->container) !== $oldContainer->name) { - flock($lock, \LOCK_UN); - fclose($lock); - $this->container->set('kernel', $this); - - return; - } - } - } catch (\Throwable $e) { - } finally { - error_reporting($errorLevel); - } - - if ($collectDeprecations = $this->debug && !\defined('PHPUNIT_COMPOSER_INSTALL')) { - $collectedLogs = []; - $previousHandler = set_error_handler(function ($type, $message, $file, $line) use (&$collectedLogs, &$previousHandler) { - if (\E_USER_DEPRECATED !== $type && \E_DEPRECATED !== $type) { - return $previousHandler ? $previousHandler($type, $message, $file, $line) : false; - } - - if (isset($collectedLogs[$message])) { - ++$collectedLogs[$message]['count']; - - return null; - } - - $backtrace = debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS, 5); - // Clean the trace by removing first frames added by the error handler itself. - for ($i = 0; isset($backtrace[$i]); ++$i) { - if (isset($backtrace[$i]['file'], $backtrace[$i]['line']) && $backtrace[$i]['line'] === $line && $backtrace[$i]['file'] === $file) { - $backtrace = \array_slice($backtrace, 1 + $i); - break; - } - } - for ($i = 0; isset($backtrace[$i]); ++$i) { - if (!isset($backtrace[$i]['file'], $backtrace[$i]['line'], $backtrace[$i]['function'])) { - continue; - } - if (!isset($backtrace[$i]['class']) && 'trigger_deprecation' === $backtrace[$i]['function']) { - $file = $backtrace[$i]['file']; - $line = $backtrace[$i]['line']; - $backtrace = \array_slice($backtrace, 1 + $i); - break; - } - } - - // Remove frames added by DebugClassLoader. - for ($i = \count($backtrace) - 2; 0 < $i; --$i) { - if (DebugClassLoader::class === ($backtrace[$i]['class'] ?? null)) { - $backtrace = [$backtrace[$i + 1]]; - break; - } - } - - $collectedLogs[$message] = [ - 'type' => $type, - 'message' => $message, - 'file' => $file, - 'line' => $line, - 'trace' => [$backtrace[0]], - 'count' => 1, - ]; - - return null; - }); - } - - try { - $container = null; - $container = $this->buildContainer(); - $container->compile(); - } finally { - if ($collectDeprecations) { - restore_error_handler(); - - @file_put_contents($buildDir.'/'.$class.'Deprecations.log', serialize(array_values($collectedLogs))); - @file_put_contents($buildDir.'/'.$class.'Compiler.log', null !== $container ? implode("\n", $container->getCompiler()->getLog()) : ''); - } - } - - $this->dumpContainer($cache, $container, $class, $this->getContainerBaseClass()); - - if ($lock) { - flock($lock, \LOCK_UN); - fclose($lock); - } - - $this->container = require $cachePath; - $this->container->set('kernel', $this); - - if ($oldContainer && \get_class($this->container) !== $oldContainer->name) { - // Because concurrent requests might still be using them, - // old container files are not removed immediately, - // but on a next dump of the container. - static $legacyContainers = []; - $oldContainerDir = \dirname($oldContainer->getFileName()); - $legacyContainers[$oldContainerDir.'.legacy'] = true; - foreach (glob(\dirname($oldContainerDir).\DIRECTORY_SEPARATOR.'*.legacy', \GLOB_NOSORT) as $legacyContainer) { - if (!isset($legacyContainers[$legacyContainer]) && @unlink($legacyContainer)) { - (new Filesystem())->remove(substr($legacyContainer, 0, -7)); - } - } - - touch($oldContainerDir.'.legacy'); - } - - $preload = $this instanceof WarmableInterface ? (array) $this->warmUp($this->container->getParameter('kernel.cache_dir')) : []; - - if ($this->container->has('cache_warmer')) { - $preload = array_merge($preload, (array) $this->container->get('cache_warmer')->warmUp($this->container->getParameter('kernel.cache_dir'))); - } - - if ($preload && method_exists(Preloader::class, 'append') && file_exists($preloadFile = $buildDir.'/'.$class.'.preload.php')) { - Preloader::append($preloadFile, $preload); - } - } - - /** - * Returns the kernel parameters. - */ - protected function getKernelParameters(): array - { - $bundles = []; - $bundlesMetadata = []; - - foreach ($this->bundles as $name => $bundle) { - $bundles[$name] = $bundle::class; - $bundlesMetadata[$name] = [ - 'path' => $bundle->getPath(), - 'namespace' => $bundle->getNamespace(), - ]; - } - - return [ - 'kernel.project_dir' => realpath($this->getProjectDir()) ?: $this->getProjectDir(), - 'kernel.environment' => $this->environment, - 'kernel.runtime_environment' => '%env(default:kernel.environment:APP_RUNTIME_ENV)%', - 'kernel.debug' => $this->debug, - 'kernel.build_dir' => realpath($buildDir = $this->warmupDir ?: $this->getBuildDir()) ?: $buildDir, - 'kernel.cache_dir' => realpath($cacheDir = ($this->getCacheDir() === $this->getBuildDir() ? ($this->warmupDir ?: $this->getCacheDir()) : $this->getCacheDir())) ?: $cacheDir, - 'kernel.logs_dir' => realpath($this->getLogDir()) ?: $this->getLogDir(), - 'kernel.bundles' => $bundles, - 'kernel.bundles_metadata' => $bundlesMetadata, - 'kernel.charset' => $this->getCharset(), - 'kernel.container_class' => $this->getContainerClass(), - ]; - } - - /** - * Builds the service container. - * - * @throws \RuntimeException - */ - protected function buildContainer(): ContainerBuilder - { - foreach (['cache' => $this->getCacheDir(), 'build' => $this->warmupDir ?: $this->getBuildDir(), 'logs' => $this->getLogDir()] as $name => $dir) { - if (!is_dir($dir)) { - if (false === @mkdir($dir, 0777, true) && !is_dir($dir)) { - throw new \RuntimeException(sprintf('Unable to create the "%s" directory (%s).', $name, $dir)); - } - } elseif (!is_writable($dir)) { - throw new \RuntimeException(sprintf('Unable to write in the "%s" directory (%s).', $name, $dir)); - } - } - - $container = $this->getContainerBuilder(); - $container->addObjectResource($this); - $this->prepareContainer($container); - $this->registerContainerConfiguration($this->getContainerLoader($container)); - - $container->addCompilerPass(new AddAnnotatedClassesToCachePass($this)); - - return $container; - } - - /** - * Prepares the ContainerBuilder before it is compiled. - */ - protected function prepareContainer(ContainerBuilder $container) - { - $extensions = []; - foreach ($this->bundles as $bundle) { - if ($extension = $bundle->getContainerExtension()) { - $container->registerExtension($extension); - } - - if ($this->debug) { - $container->addObjectResource($bundle); - } - } - - foreach ($this->bundles as $bundle) { - $bundle->build($container); - } - - $this->build($container); - - foreach ($container->getExtensions() as $extension) { - $extensions[] = $extension->getAlias(); - } - - // ensure these extensions are implicitly loaded - $container->getCompilerPassConfig()->setMergePass(new MergeExtensionConfigurationPass($extensions)); - } - - /** - * Gets a new ContainerBuilder instance used to build the service container. - */ - protected function getContainerBuilder(): ContainerBuilder - { - $container = new ContainerBuilder(); - $container->getParameterBag()->add($this->getKernelParameters()); - - if ($this instanceof ExtensionInterface) { - $container->registerExtension($this); - } - if ($this instanceof CompilerPassInterface) { - $container->addCompilerPass($this, PassConfig::TYPE_BEFORE_OPTIMIZATION, -10000); - } - - return $container; - } - - /** - * Dumps the service container to PHP code in the cache. - * - * @param string $class The name of the class to generate - * @param string $baseClass The name of the container's base class - */ - protected function dumpContainer(ConfigCache $cache, ContainerBuilder $container, string $class, string $baseClass) - { - // cache the container - $dumper = new PhpDumper($container); - - $content = $dumper->dump([ - 'class' => $class, - 'base_class' => $baseClass, - 'file' => $cache->getPath(), - 'as_files' => true, - 'debug' => $this->debug, - 'build_time' => $container->hasParameter('kernel.container_build_time') ? $container->getParameter('kernel.container_build_time') : time(), - 'preload_classes' => array_map('get_class', $this->bundles), - ]); - - $rootCode = array_pop($content); - $dir = \dirname($cache->getPath()).'/'; - $fs = new Filesystem(); - - foreach ($content as $file => $code) { - $fs->dumpFile($dir.$file, $code); - @chmod($dir.$file, 0666 & ~umask()); - } - $legacyFile = \dirname($dir.key($content)).'.legacy'; - if (is_file($legacyFile)) { - @unlink($legacyFile); - } - - $cache->write($rootCode, $container->getResources()); - } - - /** - * Returns a loader for the container. - */ - protected function getContainerLoader(ContainerInterface $container): DelegatingLoader - { - $env = $this->getEnvironment(); - $locator = new FileLocator($this); - $resolver = new LoaderResolver([ - new XmlFileLoader($container, $locator, $env), - new YamlFileLoader($container, $locator, $env), - new IniFileLoader($container, $locator, $env), - new PhpFileLoader($container, $locator, $env, class_exists(ConfigBuilderGenerator::class) ? new ConfigBuilderGenerator($this->getBuildDir()) : null), - new GlobFileLoader($container, $locator, $env), - new DirectoryLoader($container, $locator, $env), - new ClosureLoader($container, $env), - ]); - - return new DelegatingLoader($resolver); - } - - private function preBoot(): ContainerInterface - { - if ($this->debug) { - $this->startTime = microtime(true); - } - if ($this->debug && !isset($_ENV['SHELL_VERBOSITY']) && !isset($_SERVER['SHELL_VERBOSITY'])) { - putenv('SHELL_VERBOSITY=3'); - $_ENV['SHELL_VERBOSITY'] = 3; - $_SERVER['SHELL_VERBOSITY'] = 3; - } - - $this->initializeBundles(); - $this->initializeContainer(); - - $container = $this->container; - - if ($container->hasParameter('kernel.trusted_hosts') && $trustedHosts = $container->getParameter('kernel.trusted_hosts')) { - Request::setTrustedHosts($trustedHosts); - } - - if ($container->hasParameter('kernel.trusted_proxies') && $container->hasParameter('kernel.trusted_headers') && $trustedProxies = $container->getParameter('kernel.trusted_proxies')) { - Request::setTrustedProxies(\is_array($trustedProxies) ? $trustedProxies : array_map('trim', explode(',', $trustedProxies)), $container->getParameter('kernel.trusted_headers')); - } - - return $container; - } - - /** - * Removes comments from a PHP source string. - * - * We don't use the PHP php_strip_whitespace() function - * as we want the content to be readable and well-formatted. - */ - public static function stripComments(string $source): string - { - if (!\function_exists('token_get_all')) { - return $source; - } - - $rawChunk = ''; - $output = ''; - $tokens = token_get_all($source); - $ignoreSpace = false; - for ($i = 0; isset($tokens[$i]); ++$i) { - $token = $tokens[$i]; - if (!isset($token[1]) || 'b"' === $token) { - $rawChunk .= $token; - } elseif (\T_START_HEREDOC === $token[0]) { - $output .= $rawChunk.$token[1]; - do { - $token = $tokens[++$i]; - $output .= isset($token[1]) && 'b"' !== $token ? $token[1] : $token; - } while (\T_END_HEREDOC !== $token[0]); - $rawChunk = ''; - } elseif (\T_WHITESPACE === $token[0]) { - if ($ignoreSpace) { - $ignoreSpace = false; - - continue; - } - - // replace multiple new lines with a single newline - $rawChunk .= preg_replace(['/\n{2,}/S'], "\n", $token[1]); - } elseif (\in_array($token[0], [\T_COMMENT, \T_DOC_COMMENT])) { - if (!\in_array($rawChunk[\strlen($rawChunk) - 1], [' ', "\n", "\r", "\t"], true)) { - $rawChunk .= ' '; - } - $ignoreSpace = true; - } else { - $rawChunk .= $token[1]; - - // The PHP-open tag already has a new-line - if (\T_OPEN_TAG === $token[0]) { - $ignoreSpace = true; - } else { - $ignoreSpace = false; - } - } - } - - $output .= $rawChunk; - - unset($tokens, $rawChunk); - gc_mem_caches(); - - return $output; - } - - public function __sleep(): array - { - return ['environment', 'debug']; - } - - public function __wakeup() - { - if (\is_object($this->environment) || \is_object($this->debug)) { - throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); - } - - $this->__construct($this->environment, $this->debug); - } -} diff --git a/vendor/symfony/http-kernel/KernelEvents.php b/vendor/symfony/http-kernel/KernelEvents.php deleted file mode 100644 index 3d47f608..00000000 --- a/vendor/symfony/http-kernel/KernelEvents.php +++ /dev/null @@ -1,128 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel; - -use Symfony\Component\HttpKernel\Event\ControllerArgumentsEvent; -use Symfony\Component\HttpKernel\Event\ControllerEvent; -use Symfony\Component\HttpKernel\Event\ExceptionEvent; -use Symfony\Component\HttpKernel\Event\FinishRequestEvent; -use Symfony\Component\HttpKernel\Event\RequestEvent; -use Symfony\Component\HttpKernel\Event\ResponseEvent; -use Symfony\Component\HttpKernel\Event\TerminateEvent; -use Symfony\Component\HttpKernel\Event\ViewEvent; - -/** - * Contains all events thrown in the HttpKernel component. - * - * @author Bernhard Schussek - */ -final class KernelEvents -{ - /** - * The REQUEST event occurs at the very beginning of request - * dispatching. - * - * This event allows you to create a response for a request before any - * other code in the framework is executed. - * - * @Event("Symfony\Component\HttpKernel\Event\RequestEvent") - */ - public const REQUEST = 'kernel.request'; - - /** - * The EXCEPTION event occurs when an uncaught exception appears. - * - * This event allows you to create a response for a thrown exception or - * to modify the thrown exception. - * - * @Event("Symfony\Component\HttpKernel\Event\ExceptionEvent") - */ - public const EXCEPTION = 'kernel.exception'; - - /** - * The CONTROLLER event occurs once a controller was found for - * handling a request. - * - * This event allows you to change the controller that will handle the - * request. - * - * @Event("Symfony\Component\HttpKernel\Event\ControllerEvent") - */ - public const CONTROLLER = 'kernel.controller'; - - /** - * The CONTROLLER_ARGUMENTS event occurs once controller arguments have been resolved. - * - * This event allows you to change the arguments that will be passed to - * the controller. - * - * @Event("Symfony\Component\HttpKernel\Event\ControllerArgumentsEvent") - */ - public const CONTROLLER_ARGUMENTS = 'kernel.controller_arguments'; - - /** - * The VIEW event occurs when the return value of a controller - * is not a Response instance. - * - * This event allows you to create a response for the return value of the - * controller. - * - * @Event("Symfony\Component\HttpKernel\Event\ViewEvent") - */ - public const VIEW = 'kernel.view'; - - /** - * The RESPONSE event occurs once a response was created for - * replying to a request. - * - * This event allows you to modify or replace the response that will be - * replied. - * - * @Event("Symfony\Component\HttpKernel\Event\ResponseEvent") - */ - public const RESPONSE = 'kernel.response'; - - /** - * The FINISH_REQUEST event occurs when a response was generated for a request. - * - * This event allows you to reset the global and environmental state of - * the application, when it was changed during the request. - * - * @Event("Symfony\Component\HttpKernel\Event\FinishRequestEvent") - */ - public const FINISH_REQUEST = 'kernel.finish_request'; - - /** - * The TERMINATE event occurs once a response was sent. - * - * This event allows you to run expensive post-response jobs. - * - * @Event("Symfony\Component\HttpKernel\Event\TerminateEvent") - */ - public const TERMINATE = 'kernel.terminate'; - - /** - * Event aliases. - * - * These aliases can be consumed by RegisterListenersPass. - */ - public const ALIASES = [ - ControllerArgumentsEvent::class => self::CONTROLLER_ARGUMENTS, - ControllerEvent::class => self::CONTROLLER, - ResponseEvent::class => self::RESPONSE, - FinishRequestEvent::class => self::FINISH_REQUEST, - RequestEvent::class => self::REQUEST, - ViewEvent::class => self::VIEW, - ExceptionEvent::class => self::EXCEPTION, - TerminateEvent::class => self::TERMINATE, - ]; -} diff --git a/vendor/symfony/http-kernel/KernelInterface.php b/vendor/symfony/http-kernel/KernelInterface.php deleted file mode 100644 index 0959febf..00000000 --- a/vendor/symfony/http-kernel/KernelInterface.php +++ /dev/null @@ -1,133 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel; - -use Symfony\Component\Config\Loader\LoaderInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\HttpKernel\Bundle\BundleInterface; - -/** - * The Kernel is the heart of the Symfony system. - * - * It manages an environment made of application kernel and bundles. - * - * @author Fabien Potencier - */ -interface KernelInterface extends HttpKernelInterface -{ - /** - * Returns an array of bundles to register. - * - * @return iterable - */ - public function registerBundles(): iterable; - - /** - * Loads the container configuration. - */ - public function registerContainerConfiguration(LoaderInterface $loader); - - /** - * Boots the current kernel. - */ - public function boot(); - - /** - * Shutdowns the kernel. - * - * This method is mainly useful when doing functional testing. - */ - public function shutdown(); - - /** - * Gets the registered bundle instances. - * - * @return array - */ - public function getBundles(): array; - - /** - * Returns a bundle. - * - * @throws \InvalidArgumentException when the bundle is not enabled - */ - public function getBundle(string $name): BundleInterface; - - /** - * Returns the file path for a given bundle resource. - * - * A Resource can be a file or a directory. - * - * The resource name must follow the following pattern: - * - * "@BundleName/path/to/a/file.something" - * - * where BundleName is the name of the bundle - * and the remaining part is the relative path in the bundle. - * - * @throws \InvalidArgumentException if the file cannot be found or the name is not valid - * @throws \RuntimeException if the name contains invalid/unsafe characters - */ - public function locateResource(string $name): string; - - /** - * Gets the environment. - */ - public function getEnvironment(): string; - - /** - * Checks if debug mode is enabled. - */ - public function isDebug(): bool; - - /** - * Gets the project dir (path of the project's composer file). - */ - public function getProjectDir(): string; - - /** - * Gets the current container. - */ - public function getContainer(): ContainerInterface; - - /** - * Gets the request start time (not available if debug is disabled). - */ - public function getStartTime(): float; - - /** - * Gets the cache directory. - * - * Since Symfony 5.2, the cache directory should be used for caches that are written at runtime. - * For caches and artifacts that can be warmed at compile-time and deployed as read-only, - * use the new "build directory" returned by the {@see getBuildDir()} method. - */ - public function getCacheDir(): string; - - /** - * Returns the build directory. - * - * This directory should be used to store build artifacts, and can be read-only at runtime. - * Caches written at runtime should be stored in the "cache directory" ({@see KernelInterface::getCacheDir()}). - */ - public function getBuildDir(): string; - - /** - * Gets the log directory. - */ - public function getLogDir(): string; - - /** - * Gets the charset of the application. - */ - public function getCharset(): string; -} diff --git a/vendor/symfony/http-kernel/LICENSE b/vendor/symfony/http-kernel/LICENSE deleted file mode 100644 index 88bf75bb..00000000 --- a/vendor/symfony/http-kernel/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2022 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/http-kernel/Log/DebugLoggerInterface.php b/vendor/symfony/http-kernel/Log/DebugLoggerInterface.php deleted file mode 100644 index 84452ae7..00000000 --- a/vendor/symfony/http-kernel/Log/DebugLoggerInterface.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Log; - -use Symfony\Component\HttpFoundation\Request; - -/** - * DebugLoggerInterface. - * - * @author Fabien Potencier - */ -interface DebugLoggerInterface -{ - /** - * Returns an array of logs. - * - * @return array, - * message: string, - * priority: int, - * priorityName: string, - * timestamp: int, - * timestamp_rfc3339: string, - * }> - */ - public function getLogs(Request $request = null); - - /** - * Returns the number of errors. - * - * @return int - */ - public function countErrors(Request $request = null); - - /** - * Removes all log records. - */ - public function clear(); -} diff --git a/vendor/symfony/http-kernel/Log/Logger.php b/vendor/symfony/http-kernel/Log/Logger.php deleted file mode 100644 index 4d3c241a..00000000 --- a/vendor/symfony/http-kernel/Log/Logger.php +++ /dev/null @@ -1,189 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Log; - -use Psr\Log\AbstractLogger; -use Psr\Log\InvalidArgumentException; -use Psr\Log\LogLevel; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\RequestStack; - -/** - * Minimalist PSR-3 logger designed to write in stderr or any other stream. - * - * @author Kévin Dunglas - */ -class Logger extends AbstractLogger implements DebugLoggerInterface -{ - private const LEVELS = [ - LogLevel::DEBUG => 0, - LogLevel::INFO => 1, - LogLevel::NOTICE => 2, - LogLevel::WARNING => 3, - LogLevel::ERROR => 4, - LogLevel::CRITICAL => 5, - LogLevel::ALERT => 6, - LogLevel::EMERGENCY => 7, - ]; - private const PRIORITIES = [ - LogLevel::DEBUG => 100, - LogLevel::INFO => 200, - LogLevel::NOTICE => 250, - LogLevel::WARNING => 300, - LogLevel::ERROR => 400, - LogLevel::CRITICAL => 500, - LogLevel::ALERT => 550, - LogLevel::EMERGENCY => 600, - ]; - - private int $minLevelIndex; - private \Closure $formatter; - private bool $debug = false; - private array $logs = []; - private array $errorCount = []; - - /** @var resource|null */ - private $handle; - - /** - * @param string|resource|null $output - */ - public function __construct(string $minLevel = null, $output = null, callable $formatter = null, private readonly ?RequestStack $requestStack = null) - { - if (null === $minLevel) { - $minLevel = null === $output || 'php://stdout' === $output || 'php://stderr' === $output ? LogLevel::ERROR : LogLevel::WARNING; - - if (isset($_ENV['SHELL_VERBOSITY']) || isset($_SERVER['SHELL_VERBOSITY'])) { - $minLevel = match ((int) ($_ENV['SHELL_VERBOSITY'] ?? $_SERVER['SHELL_VERBOSITY'])) { - -1 => LogLevel::ERROR, - 1 => LogLevel::NOTICE, - 2 => LogLevel::INFO, - 3 => LogLevel::DEBUG, - default => $minLevel, - }; - } - } - - if (!isset(self::LEVELS[$minLevel])) { - throw new InvalidArgumentException(sprintf('The log level "%s" does not exist.', $minLevel)); - } - - $this->minLevelIndex = self::LEVELS[$minLevel]; - $this->formatter = null !== $formatter ? $formatter(...) : $this->format(...); - if ($output && false === $this->handle = \is_resource($output) ? $output : @fopen($output, 'a')) { - throw new InvalidArgumentException(sprintf('Unable to open "%s".', $output)); - } - } - - public function enableDebug(): void - { - $this->debug = true; - } - - public function log($level, $message, array $context = []): void - { - if (!isset(self::LEVELS[$level])) { - throw new InvalidArgumentException(sprintf('The log level "%s" does not exist.', $level)); - } - - if (self::LEVELS[$level] < $this->minLevelIndex) { - return; - } - - $formatter = $this->formatter; - if ($this->handle) { - @fwrite($this->handle, $formatter($level, $message, $context).\PHP_EOL); - } else { - error_log($formatter($level, $message, $context, false)); - } - - if ($this->debug && $this->requestStack) { - $this->record($level, $message, $context); - } - } - - public function getLogs(Request $request = null): array - { - if ($request) { - return $this->logs[spl_object_id($request)] ?? []; - } - - return array_merge(...array_values($this->logs)); - } - - public function countErrors(Request $request = null): int - { - if ($request) { - return $this->errorCount[spl_object_id($request)] ?? 0; - } - - return array_sum($this->errorCount); - } - - public function clear(): void - { - $this->logs = []; - $this->errorCount = []; - } - - private function format(string $level, string $message, array $context, bool $prefixDate = true): string - { - if (str_contains($message, '{')) { - $replacements = []; - foreach ($context as $key => $val) { - if (null === $val || \is_scalar($val) || $val instanceof \Stringable) { - $replacements["{{$key}}"] = $val; - } elseif ($val instanceof \DateTimeInterface) { - $replacements["{{$key}}"] = $val->format(\DateTimeInterface::RFC3339); - } elseif (\is_object($val)) { - $replacements["{{$key}}"] = '[object '.$val::class.']'; - } else { - $replacements["{{$key}}"] = '['.\gettype($val).']'; - } - } - - $message = strtr($message, $replacements); - } - - $log = sprintf('[%s] %s', $level, $message); - if ($prefixDate) { - $log = date(\DateTimeInterface::RFC3339).' '.$log; - } - - return $log; - } - - private function record($level, $message, array $context): void - { - $request = $this->requestStack->getCurrentRequest(); - $key = $request ? spl_object_id($request) : ''; - - $this->logs[$key][] = [ - 'channel' => null, - 'context' => $context, - 'message' => $message, - 'priority' => self::PRIORITIES[$level], - 'priorityName' => $level, - 'timestamp' => time(), - 'timestamp_rfc3339' => date(\DATE_RFC3339_EXTENDED), - ]; - - $this->errorCount[$key] ??= 0; - switch ($level) { - case LogLevel::ERROR: - case LogLevel::CRITICAL: - case LogLevel::ALERT: - case LogLevel::EMERGENCY: - ++$this->errorCount[$key]; - } - } -} diff --git a/vendor/symfony/http-kernel/Profiler/FileProfilerStorage.php b/vendor/symfony/http-kernel/Profiler/FileProfilerStorage.php deleted file mode 100644 index d3c801de..00000000 --- a/vendor/symfony/http-kernel/Profiler/FileProfilerStorage.php +++ /dev/null @@ -1,292 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Profiler; - -/** - * Storage for profiler using files. - * - * @author Alexandre Salomé - */ -class FileProfilerStorage implements ProfilerStorageInterface -{ - /** - * Folder where profiler data are stored. - */ - private string $folder; - - /** - * Constructs the file storage using a "dsn-like" path. - * - * Example : "file:/path/to/the/storage/folder" - * - * @throws \RuntimeException - */ - public function __construct(string $dsn) - { - if (!str_starts_with($dsn, 'file:')) { - throw new \RuntimeException(sprintf('Please check your configuration. You are trying to use FileStorage with an invalid dsn "%s". The expected format is "file:/path/to/the/storage/folder".', $dsn)); - } - $this->folder = substr($dsn, 5); - - if (!is_dir($this->folder) && false === @mkdir($this->folder, 0777, true) && !is_dir($this->folder)) { - throw new \RuntimeException(sprintf('Unable to create the storage directory (%s).', $this->folder)); - } - } - - public function find(?string $ip, ?string $url, ?int $limit, ?string $method, int $start = null, int $end = null, string $statusCode = null): array - { - $file = $this->getIndexFilename(); - - if (!file_exists($file)) { - return []; - } - - $file = fopen($file, 'r'); - fseek($file, 0, \SEEK_END); - - $result = []; - while (\count($result) < $limit && $line = $this->readLineFromFile($file)) { - $values = str_getcsv($line); - [$csvToken, $csvIp, $csvMethod, $csvUrl, $csvTime, $csvParent, $csvStatusCode] = $values; - $csvTime = (int) $csvTime; - - if ($ip && !str_contains($csvIp, $ip) || $url && !str_contains($csvUrl, $url) || $method && !str_contains($csvMethod, $method) || $statusCode && !str_contains($csvStatusCode, $statusCode)) { - continue; - } - - if (!empty($start) && $csvTime < $start) { - continue; - } - - if (!empty($end) && $csvTime > $end) { - continue; - } - - $result[$csvToken] = [ - 'token' => $csvToken, - 'ip' => $csvIp, - 'method' => $csvMethod, - 'url' => $csvUrl, - 'time' => $csvTime, - 'parent' => $csvParent, - 'status_code' => $csvStatusCode, - ]; - } - - fclose($file); - - return array_values($result); - } - - public function purge() - { - $flags = \FilesystemIterator::SKIP_DOTS; - $iterator = new \RecursiveDirectoryIterator($this->folder, $flags); - $iterator = new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIterator::CHILD_FIRST); - - foreach ($iterator as $file) { - if (is_file($file)) { - unlink($file); - } else { - rmdir($file); - } - } - } - - public function read(string $token): ?Profile - { - return $this->doRead($token); - } - - /** - * @throws \RuntimeException - */ - public function write(Profile $profile): bool - { - $file = $this->getFilename($profile->getToken()); - - $profileIndexed = is_file($file); - if (!$profileIndexed) { - // Create directory - $dir = \dirname($file); - if (!is_dir($dir) && false === @mkdir($dir, 0777, true) && !is_dir($dir)) { - throw new \RuntimeException(sprintf('Unable to create the storage directory (%s).', $dir)); - } - } - - $profileToken = $profile->getToken(); - // when there are errors in sub-requests, the parent and/or children tokens - // may equal the profile token, resulting in infinite loops - $parentToken = $profile->getParentToken() !== $profileToken ? $profile->getParentToken() : null; - $childrenToken = array_filter(array_map(function (Profile $p) use ($profileToken) { - return $profileToken !== $p->getToken() ? $p->getToken() : null; - }, $profile->getChildren())); - - // Store profile - $data = [ - 'token' => $profileToken, - 'parent' => $parentToken, - 'children' => $childrenToken, - 'data' => $profile->getCollectors(), - 'ip' => $profile->getIp(), - 'method' => $profile->getMethod(), - 'url' => $profile->getUrl(), - 'time' => $profile->getTime(), - 'status_code' => $profile->getStatusCode(), - ]; - - $data = serialize($data); - - if (\function_exists('gzencode')) { - $data = gzencode($data, 3); - } - - if (false === file_put_contents($file, $data, \LOCK_EX)) { - return false; - } - - if (!$profileIndexed) { - // Add to index - if (false === $file = fopen($this->getIndexFilename(), 'a')) { - return false; - } - - fputcsv($file, [ - $profile->getToken(), - $profile->getIp(), - $profile->getMethod(), - $profile->getUrl(), - $profile->getTime(), - $profile->getParentToken(), - $profile->getStatusCode(), - ]); - fclose($file); - } - - return true; - } - - /** - * Gets filename to store data, associated to the token. - */ - protected function getFilename(string $token): string - { - // Uses 4 last characters, because first are mostly the same. - $folderA = substr($token, -2, 2); - $folderB = substr($token, -4, 2); - - return $this->folder.'/'.$folderA.'/'.$folderB.'/'.$token; - } - - /** - * Gets the index filename. - */ - protected function getIndexFilename(): string - { - return $this->folder.'/index.csv'; - } - - /** - * Reads a line in the file, backward. - * - * This function automatically skips the empty lines and do not include the line return in result value. - * - * @param resource $file The file resource, with the pointer placed at the end of the line to read - */ - protected function readLineFromFile($file): mixed - { - $line = ''; - $position = ftell($file); - - if (0 === $position) { - return null; - } - - while (true) { - $chunkSize = min($position, 1024); - $position -= $chunkSize; - fseek($file, $position); - - if (0 === $chunkSize) { - // bof reached - break; - } - - $buffer = fread($file, $chunkSize); - - if (false === ($upTo = strrpos($buffer, "\n"))) { - $line = $buffer.$line; - continue; - } - - $position += $upTo; - $line = substr($buffer, $upTo + 1).$line; - fseek($file, max(0, $position), \SEEK_SET); - - if ('' !== $line) { - break; - } - } - - return '' === $line ? null : $line; - } - - protected function createProfileFromData(string $token, array $data, Profile $parent = null) - { - $profile = new Profile($token); - $profile->setIp($data['ip']); - $profile->setMethod($data['method']); - $profile->setUrl($data['url']); - $profile->setTime($data['time']); - $profile->setStatusCode($data['status_code']); - $profile->setCollectors($data['data']); - - if (!$parent && $data['parent']) { - $parent = $this->read($data['parent']); - } - - if ($parent) { - $profile->setParent($parent); - } - - foreach ($data['children'] as $token) { - if (null !== $childProfile = $this->doRead($token, $profile)) { - $profile->addChild($childProfile); - } - } - - return $profile; - } - - private function doRead($token, Profile $profile = null): ?Profile - { - if (!$token || !file_exists($file = $this->getFilename($token))) { - return null; - } - - $h = fopen($file, 'r'); - flock($h, \LOCK_SH); - $data = stream_get_contents($h); - flock($h, \LOCK_UN); - fclose($h); - - if (\function_exists('gzdecode')) { - $data = @gzdecode($data) ?: $data; - } - - if (!$data = unserialize($data)) { - return null; - } - - return $this->createProfileFromData($token, $data, $profile); - } -} diff --git a/vendor/symfony/http-kernel/Profiler/Profile.php b/vendor/symfony/http-kernel/Profiler/Profile.php deleted file mode 100644 index 5ca2d960..00000000 --- a/vendor/symfony/http-kernel/Profiler/Profile.php +++ /dev/null @@ -1,240 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Profiler; - -use Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface; - -/** - * Profile. - * - * @author Fabien Potencier - */ -class Profile -{ - private string $token; - - /** - * @var DataCollectorInterface[] - */ - private array $collectors = []; - - private ?string $ip = null; - private ?string $method = null; - private ?string $url = null; - private ?int $time = null; - private ?int $statusCode = null; - private ?self $parent = null; - - /** - * @var Profile[] - */ - private array $children = []; - - public function __construct(string $token) - { - $this->token = $token; - } - - public function setToken(string $token) - { - $this->token = $token; - } - - /** - * Gets the token. - */ - public function getToken(): string - { - return $this->token; - } - - /** - * Sets the parent token. - */ - public function setParent(self $parent) - { - $this->parent = $parent; - } - - /** - * Returns the parent profile. - */ - public function getParent(): ?self - { - return $this->parent; - } - - /** - * Returns the parent token. - */ - public function getParentToken(): ?string - { - return $this->parent?->getToken(); - } - - /** - * Returns the IP. - */ - public function getIp(): ?string - { - return $this->ip; - } - - public function setIp(?string $ip) - { - $this->ip = $ip; - } - - /** - * Returns the request method. - */ - public function getMethod(): ?string - { - return $this->method; - } - - public function setMethod(string $method) - { - $this->method = $method; - } - - /** - * Returns the URL. - */ - public function getUrl(): ?string - { - return $this->url; - } - - public function setUrl(?string $url) - { - $this->url = $url; - } - - public function getTime(): int - { - return $this->time ?? 0; - } - - public function setTime(int $time) - { - $this->time = $time; - } - - public function setStatusCode(int $statusCode) - { - $this->statusCode = $statusCode; - } - - public function getStatusCode(): ?int - { - return $this->statusCode; - } - - /** - * Finds children profilers. - * - * @return self[] - */ - public function getChildren(): array - { - return $this->children; - } - - /** - * Sets children profiler. - * - * @param Profile[] $children - */ - public function setChildren(array $children) - { - $this->children = []; - foreach ($children as $child) { - $this->addChild($child); - } - } - - /** - * Adds the child token. - */ - public function addChild(self $child) - { - $this->children[] = $child; - $child->setParent($this); - } - - public function getChildByToken(string $token): ?self - { - foreach ($this->children as $child) { - if ($token === $child->getToken()) { - return $child; - } - } - - return null; - } - - /** - * Gets a Collector by name. - * - * @throws \InvalidArgumentException if the collector does not exist - */ - public function getCollector(string $name): DataCollectorInterface - { - if (!isset($this->collectors[$name])) { - throw new \InvalidArgumentException(sprintf('Collector "%s" does not exist.', $name)); - } - - return $this->collectors[$name]; - } - - /** - * Gets the Collectors associated with this profile. - * - * @return DataCollectorInterface[] - */ - public function getCollectors(): array - { - return $this->collectors; - } - - /** - * Sets the Collectors associated with this profile. - * - * @param DataCollectorInterface[] $collectors - */ - public function setCollectors(array $collectors) - { - $this->collectors = []; - foreach ($collectors as $collector) { - $this->addCollector($collector); - } - } - - /** - * Adds a Collector. - */ - public function addCollector(DataCollectorInterface $collector) - { - $this->collectors[$collector->getName()] = $collector; - } - - public function hasCollector(string $name): bool - { - return isset($this->collectors[$name]); - } - - public function __sleep(): array - { - return ['token', 'parent', 'children', 'collectors', 'ip', 'method', 'url', 'time', 'statusCode']; - } -} diff --git a/vendor/symfony/http-kernel/Profiler/Profiler.php b/vendor/symfony/http-kernel/Profiler/Profiler.php deleted file mode 100644 index 8ee11e8e..00000000 --- a/vendor/symfony/http-kernel/Profiler/Profiler.php +++ /dev/null @@ -1,242 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Profiler; - -use Psr\Log\LoggerInterface; -use Symfony\Component\HttpFoundation\Exception\ConflictingHeadersException; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface; -use Symfony\Component\HttpKernel\DataCollector\LateDataCollectorInterface; -use Symfony\Contracts\Service\ResetInterface; - -/** - * Profiler. - * - * @author Fabien Potencier - */ -class Profiler implements ResetInterface -{ - private ProfilerStorageInterface $storage; - - /** - * @var DataCollectorInterface[] - */ - private array $collectors = []; - - private ?LoggerInterface $logger; - private bool $initiallyEnabled = true; - private bool $enabled = true; - - public function __construct(ProfilerStorageInterface $storage, LoggerInterface $logger = null, bool $enable = true) - { - $this->storage = $storage; - $this->logger = $logger; - $this->initiallyEnabled = $this->enabled = $enable; - } - - /** - * Disables the profiler. - */ - public function disable() - { - $this->enabled = false; - } - - /** - * Enables the profiler. - */ - public function enable() - { - $this->enabled = true; - } - - public function isEnabled(): bool - { - return $this->enabled; - } - - /** - * Loads the Profile for the given Response. - */ - public function loadProfileFromResponse(Response $response): ?Profile - { - if (!$token = $response->headers->get('X-Debug-Token')) { - return null; - } - - return $this->loadProfile($token); - } - - /** - * Loads the Profile for the given token. - */ - public function loadProfile(string $token): ?Profile - { - return $this->storage->read($token); - } - - /** - * Saves a Profile. - */ - public function saveProfile(Profile $profile): bool - { - // late collect - foreach ($profile->getCollectors() as $collector) { - if ($collector instanceof LateDataCollectorInterface) { - $collector->lateCollect(); - } - } - - if (!($ret = $this->storage->write($profile)) && null !== $this->logger) { - $this->logger->warning('Unable to store the profiler information.', ['configured_storage' => \get_class($this->storage)]); - } - - return $ret; - } - - /** - * Purges all data from the storage. - */ - public function purge() - { - $this->storage->purge(); - } - - /** - * Finds profiler tokens for the given criteria. - * - * @param string|null $limit The maximum number of tokens to return - * @param string|null $start The start date to search from - * @param string|null $end The end date to search to - * - * @see https://php.net/datetime.formats for the supported date/time formats - */ - public function find(?string $ip, ?string $url, ?string $limit, ?string $method, ?string $start, ?string $end, string $statusCode = null): array - { - return $this->storage->find($ip, $url, $limit, $method, $this->getTimestamp($start), $this->getTimestamp($end), $statusCode); - } - - /** - * Collects data for the given Response. - */ - public function collect(Request $request, Response $response, \Throwable $exception = null): ?Profile - { - if (false === $this->enabled) { - return null; - } - - $profile = new Profile(substr(hash('sha256', uniqid(mt_rand(), true)), 0, 6)); - $profile->setTime(time()); - $profile->setUrl($request->getUri()); - $profile->setMethod($request->getMethod()); - $profile->setStatusCode($response->getStatusCode()); - try { - $profile->setIp($request->getClientIp()); - } catch (ConflictingHeadersException) { - $profile->setIp('Unknown'); - } - - if ($prevToken = $response->headers->get('X-Debug-Token')) { - $response->headers->set('X-Previous-Debug-Token', $prevToken); - } - - $response->headers->set('X-Debug-Token', $profile->getToken()); - - foreach ($this->collectors as $collector) { - $collector->collect($request, $response, $exception); - - // we need to clone for sub-requests - $profile->addCollector(clone $collector); - } - - return $profile; - } - - public function reset() - { - foreach ($this->collectors as $collector) { - $collector->reset(); - } - $this->enabled = $this->initiallyEnabled; - } - - /** - * Gets the Collectors associated with this profiler. - */ - public function all(): array - { - return $this->collectors; - } - - /** - * Sets the Collectors associated with this profiler. - * - * @param DataCollectorInterface[] $collectors An array of collectors - */ - public function set(array $collectors = []) - { - $this->collectors = []; - foreach ($collectors as $collector) { - $this->add($collector); - } - } - - /** - * Adds a Collector. - */ - public function add(DataCollectorInterface $collector) - { - $this->collectors[$collector->getName()] = $collector; - } - - /** - * Returns true if a Collector for the given name exists. - * - * @param string $name A collector name - */ - public function has(string $name): bool - { - return isset($this->collectors[$name]); - } - - /** - * Gets a Collector by name. - * - * @param string $name A collector name - * - * @throws \InvalidArgumentException if the collector does not exist - */ - public function get(string $name): DataCollectorInterface - { - if (!isset($this->collectors[$name])) { - throw new \InvalidArgumentException(sprintf('Collector "%s" does not exist.', $name)); - } - - return $this->collectors[$name]; - } - - private function getTimestamp(?string $value): ?int - { - if (null === $value || '' === $value) { - return null; - } - - try { - $value = new \DateTimeImmutable(is_numeric($value) ? '@'.$value : $value); - } catch (\Exception) { - return null; - } - - return $value->getTimestamp(); - } -} diff --git a/vendor/symfony/http-kernel/Profiler/ProfilerStorageInterface.php b/vendor/symfony/http-kernel/Profiler/ProfilerStorageInterface.php deleted file mode 100644 index 95d72f46..00000000 --- a/vendor/symfony/http-kernel/Profiler/ProfilerStorageInterface.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Profiler; - -/** - * ProfilerStorageInterface. - * - * This interface exists for historical reasons. The only supported - * implementation is FileProfilerStorage. - * - * As the profiler must only be used on non-production servers, the file storage - * is more than enough and no other implementations will ever be supported. - * - * @internal - * - * @author Fabien Potencier - */ -interface ProfilerStorageInterface -{ - /** - * Finds profiler tokens for the given criteria. - * - * @param int|null $limit The maximum number of tokens to return - * @param int|null $start The start date to search from - * @param int|null $end The end date to search to - */ - public function find(?string $ip, ?string $url, ?int $limit, ?string $method, int $start = null, int $end = null): array; - - /** - * Reads data associated with the given token. - * - * The method returns false if the token does not exist in the storage. - */ - public function read(string $token): ?Profile; - - /** - * Saves a Profile. - */ - public function write(Profile $profile): bool; - - /** - * Purges all data from the database. - */ - public function purge(); -} diff --git a/vendor/symfony/http-kernel/README.md b/vendor/symfony/http-kernel/README.md deleted file mode 100644 index 18d15f5a..00000000 --- a/vendor/symfony/http-kernel/README.md +++ /dev/null @@ -1,15 +0,0 @@ -HttpKernel Component -==================== - -The HttpKernel component provides a structured process for converting a Request -into a Response by making use of the EventDispatcher component. It's flexible -enough to create full-stack frameworks, micro-frameworks or advanced CMS systems like Drupal. - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/components/http_kernel.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/http-kernel/RebootableInterface.php b/vendor/symfony/http-kernel/RebootableInterface.php deleted file mode 100644 index e257237d..00000000 --- a/vendor/symfony/http-kernel/RebootableInterface.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\HttpKernel; - -/** - * Allows the Kernel to be rebooted using a temporary cache directory. - * - * @author Nicolas Grekas - */ -interface RebootableInterface -{ - /** - * Reboots a kernel. - * - * The getBuildDir() method of a rebootable kernel should not be called - * while building the container. Use the %kernel.build_dir% parameter instead. - * - * @param string|null $warmupDir pass null to reboot in the regular build directory - */ - public function reboot(?string $warmupDir); -} diff --git a/vendor/symfony/http-kernel/Resources/welcome.html.php b/vendor/symfony/http-kernel/Resources/welcome.html.php deleted file mode 100644 index 44d962d5..00000000 --- a/vendor/symfony/http-kernel/Resources/welcome.html.php +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - Welcome to Symfony! - - - - -
      -
      - -

      - You're seeing this page because you haven't configured any homepage URL and debug mode is enabled. -

      -
      - -
      -
      - -

      Welcome to Symfony

      -
      - -
      - - - - - - -

      Your application is now ready and you can start working on it.

      -
      - - -
      - -
      - -
      -
      - - diff --git a/vendor/symfony/http-kernel/TerminableInterface.php b/vendor/symfony/http-kernel/TerminableInterface.php deleted file mode 100644 index 8aa33197..00000000 --- a/vendor/symfony/http-kernel/TerminableInterface.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\HttpKernel; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; - -/** - * Terminable extends the Kernel request/response cycle with dispatching a post - * response event after sending the response and before shutting down the kernel. - * - * @author Jordi Boggiano - * @author Pierre Minnieur - */ -interface TerminableInterface -{ - /** - * Terminates a request/response cycle. - * - * Should be called after sending the response and before shutting down the kernel. - */ - public function terminate(Request $request, Response $response); -} diff --git a/vendor/symfony/http-kernel/UriSigner.php b/vendor/symfony/http-kernel/UriSigner.php deleted file mode 100644 index dfc0a7d0..00000000 --- a/vendor/symfony/http-kernel/UriSigner.php +++ /dev/null @@ -1,109 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel; - -use Symfony\Component\HttpFoundation\Request; - -/** - * Signs URIs. - * - * @author Fabien Potencier - */ -class UriSigner -{ - private string $secret; - private string $parameter; - - /** - * @param string $secret A secret - * @param string $parameter Query string parameter to use - */ - public function __construct(#[\SensitiveParameter] string $secret, string $parameter = '_hash') - { - $this->secret = $secret; - $this->parameter = $parameter; - } - - /** - * Signs a URI. - * - * The given URI is signed by adding the query string parameter - * which value depends on the URI and the secret. - */ - public function sign(string $uri): string - { - $url = parse_url($uri); - $params = []; - - if (isset($url['query'])) { - parse_str($url['query'], $params); - } - - $uri = $this->buildUrl($url, $params); - $params[$this->parameter] = $this->computeHash($uri); - - return $this->buildUrl($url, $params); - } - - /** - * Checks that a URI contains the correct hash. - */ - public function check(string $uri): bool - { - $url = parse_url($uri); - $params = []; - - if (isset($url['query'])) { - parse_str($url['query'], $params); - } - - if (empty($params[$this->parameter])) { - return false; - } - - $hash = $params[$this->parameter]; - unset($params[$this->parameter]); - - return hash_equals($this->computeHash($this->buildUrl($url, $params)), $hash); - } - - public function checkRequest(Request $request): bool - { - $qs = ($qs = $request->server->get('QUERY_STRING')) ? '?'.$qs : ''; - - // we cannot use $request->getUri() here as we want to work with the original URI (no query string reordering) - return $this->check($request->getSchemeAndHttpHost().$request->getBaseUrl().$request->getPathInfo().$qs); - } - - private function computeHash(string $uri): string - { - return base64_encode(hash_hmac('sha256', $uri, $this->secret, true)); - } - - private function buildUrl(array $url, array $params = []): string - { - ksort($params, \SORT_STRING); - $url['query'] = http_build_query($params, '', '&'); - - $scheme = isset($url['scheme']) ? $url['scheme'].'://' : ''; - $host = $url['host'] ?? ''; - $port = isset($url['port']) ? ':'.$url['port'] : ''; - $user = $url['user'] ?? ''; - $pass = isset($url['pass']) ? ':'.$url['pass'] : ''; - $pass = ($user || $pass) ? "$pass@" : ''; - $path = $url['path'] ?? ''; - $query = $url['query'] ? '?'.$url['query'] : ''; - $fragment = isset($url['fragment']) ? '#'.$url['fragment'] : ''; - - return $scheme.$user.$pass.$host.$port.$path.$query.$fragment; - } -} diff --git a/vendor/symfony/http-kernel/composer.json b/vendor/symfony/http-kernel/composer.json deleted file mode 100644 index 2c92557c..00000000 --- a/vendor/symfony/http-kernel/composer.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "name": "symfony/http-kernel", - "type": "library", - "description": "Provides a structured process for converting a Request into a Response", - "keywords": [], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/error-handler": "^6.1", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/http-foundation": "^5.4|^6.0", - "symfony/polyfill-ctype": "^1.8", - "psr/log": "^1|^2|^3" - }, - "require-dev": { - "symfony/browser-kit": "^5.4|^6.0", - "symfony/config": "^6.1", - "symfony/console": "^5.4|^6.0", - "symfony/css-selector": "^5.4|^6.0", - "symfony/dependency-injection": "^6.2", - "symfony/dom-crawler": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/finder": "^5.4|^6.0", - "symfony/http-client-contracts": "^1.1|^2|^3", - "symfony/process": "^5.4|^6.0", - "symfony/routing": "^5.4|^6.0", - "symfony/stopwatch": "^5.4|^6.0", - "symfony/translation": "^5.4|^6.0", - "symfony/translation-contracts": "^1.1|^2|^3", - "symfony/uid": "^5.4|^6.0", - "psr/cache": "^1.0|^2.0|^3.0", - "twig/twig": "^2.13|^3.0.4" - }, - "provide": { - "psr/log-implementation": "1.0|2.0|3.0" - }, - "conflict": { - "symfony/browser-kit": "<5.4", - "symfony/cache": "<5.4", - "symfony/config": "<6.1", - "symfony/console": "<5.4", - "symfony/form": "<5.4", - "symfony/dependency-injection": "<6.2", - "symfony/doctrine-bridge": "<5.4", - "symfony/http-client": "<5.4", - "symfony/mailer": "<5.4", - "symfony/messenger": "<5.4", - "symfony/translation": "<5.4", - "symfony/twig-bridge": "<5.4", - "symfony/validator": "<5.4", - "twig/twig": "<2.13" - }, - "suggest": { - "symfony/browser-kit": "", - "symfony/config": "", - "symfony/console": "", - "symfony/dependency-injection": "" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\HttpKernel\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "minimum-stability": "dev" -} diff --git a/vendor/symfony/mailer/CHANGELOG.md b/vendor/symfony/mailer/CHANGELOG.md deleted file mode 100644 index 772f5071..00000000 --- a/vendor/symfony/mailer/CHANGELOG.md +++ /dev/null @@ -1,78 +0,0 @@ -CHANGELOG -========= - -6.2 ---- - - * Add a `mailer:test` command - * Add `SentMessageEvent` and `FailedMessageEvent` events - -6.1 ---- - - * Make `start()` and `stop()` methods public on `SmtpTransport` - * Improve extensibility of `EsmtpTransport` - -6.0 ---- - - * The `HttpTransportException` class takes a string at first argument - -5.4 ---- - - * Enable the mailer to operate on any PSR-14-compatible event dispatcher - -5.3 ---- - - * added the `mailer` monolog channel and set it on all transport definitions - -5.2.0 ------ - - * added `NativeTransportFactory` to configure a transport based on php.ini settings - * added `local_domain`, `restart_threshold`, `restart_threshold_sleep` and `ping_threshold` options for `smtp` - * added `command` option for `sendmail` - -4.4.0 ------ - - * [BC BREAK] changed the `NullTransport` DSN from `smtp://null` to `null://null` - * [BC BREAK] renamed `SmtpEnvelope` to `Envelope`, renamed `DelayedSmtpEnvelope` to - `DelayedEnvelope` - * [BC BREAK] changed the syntax for failover and roundrobin DSNs - - Before: - - dummy://a || dummy://b (for failover) - dummy://a && dummy://b (for roundrobin) - - After: - - failover(dummy://a dummy://b) - roundrobin(dummy://a dummy://b) - - * added support for multiple transports on a `Mailer` instance - * [BC BREAK] removed the `auth_mode` DSN option (it is now always determined automatically) - * STARTTLS cannot be enabled anymore (it is used automatically if TLS is disabled and the server supports STARTTLS) - * [BC BREAK] Removed the `encryption` DSN option (use `smtps` instead) - * Added support for the `smtps` protocol (does the same as using `smtp` and port `465`) - * Added PHPUnit constraints - * Added `MessageDataCollector` - * Added `MessageEvents` and `MessageLoggerListener` to allow collecting sent emails - * [BC BREAK] `TransportInterface` has a new `__toString()` method - * [BC BREAK] Classes `AbstractApiTransport` and `AbstractHttpTransport` moved under `Transport` sub-namespace. - * [BC BREAK] Transports depend on `Symfony\Contracts\EventDispatcher\EventDispatcherInterface` - instead of `Symfony\Component\EventDispatcher\EventDispatcherInterface`. - * Added possibility to register custom transport for dsn by implementing - `Symfony\Component\Mailer\Transport\TransportFactoryInterface` and tagging with `mailer.transport_factory` tag in DI. - * Added `Symfony\Component\Mailer\Test\TransportFactoryTestCase` to ease testing custom transport factories. - * Added `SentMessage::getDebug()` and `TransportExceptionInterface::getDebug` to help debugging - * Made `MessageEvent` final - * add DSN parameter `verify_peer` to disable TLS peer verification for SMTP transport - -4.3.0 ------ - - * Added the component. diff --git a/vendor/symfony/mailer/Command/MailerTestCommand.php b/vendor/symfony/mailer/Command/MailerTestCommand.php deleted file mode 100644 index 8bb19d73..00000000 --- a/vendor/symfony/mailer/Command/MailerTestCommand.php +++ /dev/null @@ -1,75 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\Command; - -use Symfony\Component\Console\Attribute\AsCommand; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Mailer\Transport\TransportInterface; -use Symfony\Component\Mime\Email; - -/** - * A console command to test Mailer transports. - */ -#[AsCommand(name: 'mailer:test', description: 'Test Mailer transports by sending an email')] -final class MailerTestCommand extends Command -{ - public function __construct(private TransportInterface $transport) - { - $this->transport = $transport; - - parent::__construct(); - } - - protected function configure() - { - $this - ->addArgument('to', InputArgument::REQUIRED, 'The recipient of the message') - ->addOption('from', null, InputOption::VALUE_OPTIONAL, 'The sender of the message', 'from@example.org') - ->addOption('subject', null, InputOption::VALUE_OPTIONAL, 'The subject of the message', 'Testing transport') - ->addOption('body', null, InputOption::VALUE_OPTIONAL, 'The body of the message', 'Testing body') - ->addOption('transport', null, InputOption::VALUE_OPTIONAL, 'The transport to be used') - ->setHelp(<<<'EOF' -The %command.name% command tests a Mailer transport by sending a simple email message: - -php %command.full_name% to@example.com - -You can also specify a specific transport: - - php %command.full_name% to@example.com --transport=transport_name - -Note that this command bypasses the Messenger bus if configured. - -EOF - ); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $message = (new Email()) - ->to($input->getArgument('to')) - ->from($input->getOption('from')) - ->subject($input->getOption('subject')) - ->text($input->getOption('body')) - ; - if ($transport = $input->getOption('transport')) { - $message->getHeaders()->addTextHeader('X-Transport', $transport); - } - - $this->transport->send($message); - - return 0; - } -} diff --git a/vendor/symfony/mailer/DataCollector/MessageDataCollector.php b/vendor/symfony/mailer/DataCollector/MessageDataCollector.php deleted file mode 100644 index ce8e59f1..00000000 --- a/vendor/symfony/mailer/DataCollector/MessageDataCollector.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\DataCollector; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\DataCollector\DataCollector; -use Symfony\Component\Mailer\Event\MessageEvents; -use Symfony\Component\Mailer\EventListener\MessageLoggerListener; - -/** - * @author Fabien Potencier - */ -final class MessageDataCollector extends DataCollector -{ - private MessageEvents $events; - - public function __construct(MessageLoggerListener $logger) - { - $this->events = $logger->getEvents(); - } - - public function collect(Request $request, Response $response, \Throwable $exception = null) - { - $this->data['events'] = $this->events; - } - - public function getEvents(): MessageEvents - { - return $this->data['events']; - } - - /** - * @internal - */ - public function base64Encode(string $data): string - { - return base64_encode($data); - } - - public function reset() - { - $this->data = []; - } - - public function getName(): string - { - return 'mailer'; - } -} diff --git a/vendor/symfony/mailer/DelayedEnvelope.php b/vendor/symfony/mailer/DelayedEnvelope.php deleted file mode 100644 index 7458db2f..00000000 --- a/vendor/symfony/mailer/DelayedEnvelope.php +++ /dev/null @@ -1,98 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer; - -use Symfony\Component\Mailer\Exception\LogicException; -use Symfony\Component\Mime\Address; -use Symfony\Component\Mime\Header\Headers; -use Symfony\Component\Mime\Message; - -/** - * @author Fabien Potencier - * - * @internal - */ -final class DelayedEnvelope extends Envelope -{ - private bool $senderSet = false; - private bool $recipientsSet = false; - private Message $message; - - public function __construct(Message $message) - { - $this->message = $message; - } - - public function setSender(Address $sender): void - { - parent::setSender($sender); - - $this->senderSet = true; - } - - public function getSender(): Address - { - if (!$this->senderSet) { - parent::setSender(self::getSenderFromHeaders($this->message->getHeaders())); - } - - return parent::getSender(); - } - - public function setRecipients(array $recipients): void - { - parent::setRecipients($recipients); - - $this->recipientsSet = (bool) parent::getRecipients(); - } - - /** - * @return Address[] - */ - public function getRecipients(): array - { - if ($this->recipientsSet) { - return parent::getRecipients(); - } - - return self::getRecipientsFromHeaders($this->message->getHeaders()); - } - - private static function getRecipientsFromHeaders(Headers $headers): array - { - $recipients = []; - foreach (['to', 'cc', 'bcc'] as $name) { - foreach ($headers->all($name) as $header) { - foreach ($header->getAddresses() as $address) { - $recipients[] = $address; - } - } - } - - return $recipients; - } - - private static function getSenderFromHeaders(Headers $headers): Address - { - if ($sender = $headers->get('Sender')) { - return $sender->getAddress(); - } - if ($return = $headers->get('Return-Path')) { - return $return->getAddress(); - } - if ($from = $headers->get('From')) { - return $from->getAddresses()[0]; - } - - throw new LogicException('Unable to determine the sender of the message.'); - } -} diff --git a/vendor/symfony/mailer/Envelope.php b/vendor/symfony/mailer/Envelope.php deleted file mode 100644 index 0a4af2ed..00000000 --- a/vendor/symfony/mailer/Envelope.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\Mailer; - -use Symfony\Component\Mailer\Exception\InvalidArgumentException; -use Symfony\Component\Mailer\Exception\LogicException; -use Symfony\Component\Mime\Address; -use Symfony\Component\Mime\RawMessage; - -/** - * @author Fabien Potencier - */ -class Envelope -{ - private Address $sender; - private array $recipients = []; - - /** - * @param Address[] $recipients - */ - public function __construct(Address $sender, array $recipients) - { - $this->setSender($sender); - $this->setRecipients($recipients); - } - - public static function create(RawMessage $message): self - { - if (RawMessage::class === $message::class) { - throw new LogicException('Cannot send a RawMessage instance without an explicit Envelope.'); - } - - return new DelayedEnvelope($message); - } - - public function setSender(Address $sender): void - { - // to ensure deliverability of bounce emails independent of UTF-8 capabilities of SMTP servers - if (!preg_match('/^[^@\x80-\xFF]++@/', $sender->getAddress())) { - throw new InvalidArgumentException(sprintf('Invalid sender "%s": non-ASCII characters not supported in local-part of email.', $sender->getAddress())); - } - $this->sender = $sender; - } - - /** - * @return Address Returns a "mailbox" as specified by RFC 2822 - * Must be converted to an "addr-spec" when used as a "MAIL FROM" value in SMTP (use getAddress()) - */ - public function getSender(): Address - { - return $this->sender; - } - - /** - * @param Address[] $recipients - */ - public function setRecipients(array $recipients): void - { - if (!$recipients) { - throw new InvalidArgumentException('An envelope must have at least one recipient.'); - } - - $this->recipients = []; - foreach ($recipients as $recipient) { - if (!$recipient instanceof Address) { - throw new InvalidArgumentException(sprintf('A recipient must be an instance of "%s" (got "%s").', Address::class, get_debug_type($recipient))); - } - $this->recipients[] = new Address($recipient->getAddress()); - } - } - - /** - * @return Address[] - */ - public function getRecipients(): array - { - return $this->recipients; - } -} diff --git a/vendor/symfony/mailer/Event/FailedMessageEvent.php b/vendor/symfony/mailer/Event/FailedMessageEvent.php deleted file mode 100644 index 4808c659..00000000 --- a/vendor/symfony/mailer/Event/FailedMessageEvent.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\Mailer\Event; - -use Symfony\Component\Mime\RawMessage; -use Symfony\Contracts\EventDispatcher\Event; - -/** - * @author Fabien Potencier - */ -final class FailedMessageEvent extends Event -{ - public function __construct( - private RawMessage $message, - private \Throwable $error, - ) { - } - - public function getMessage(): RawMessage - { - return $this->message; - } - - public function getError(): \Throwable - { - return $this->error; - } -} diff --git a/vendor/symfony/mailer/Event/MessageEvent.php b/vendor/symfony/mailer/Event/MessageEvent.php deleted file mode 100644 index 083b8f84..00000000 --- a/vendor/symfony/mailer/Event/MessageEvent.php +++ /dev/null @@ -1,93 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\Event; - -use Symfony\Component\Mailer\Envelope; -use Symfony\Component\Mailer\Exception\LogicException; -use Symfony\Component\Messenger\Stamp\StampInterface; -use Symfony\Component\Mime\RawMessage; -use Symfony\Contracts\EventDispatcher\Event; - -/** - * Allows the transformation of a Message and the Envelope before the email is sent. - * - * @author Fabien Potencier - */ -final class MessageEvent extends Event -{ - private RawMessage $message; - private Envelope $envelope; - private string $transport; - private bool $queued; - - /** @var StampInterface[] */ - private array $stamps = []; - - public function __construct(RawMessage $message, Envelope $envelope, string $transport, bool $queued = false) - { - $this->message = $message; - $this->envelope = $envelope; - $this->transport = $transport; - $this->queued = $queued; - } - - public function getMessage(): RawMessage - { - return $this->message; - } - - public function setMessage(RawMessage $message): void - { - $this->message = $message; - } - - public function getEnvelope(): Envelope - { - return $this->envelope; - } - - public function setEnvelope(Envelope $envelope): void - { - $this->envelope = $envelope; - } - - public function getTransport(): string - { - return $this->transport; - } - - public function isQueued(): bool - { - return $this->queued; - } - - public function addStamp(StampInterface $stamp): void - { - if (!$this->queued) { - throw new LogicException(sprintf('Cannot call "%s()" on a message that is not meant to be queued', __METHOD__)); - } - - $this->stamps[] = $stamp; - } - - /** - * @return StampInterface[] - */ - public function getStamps(): array - { - if (!$this->queued) { - throw new LogicException(sprintf('Cannot call "%s()" on a message that is not meant to be queued.', __METHOD__)); - } - - return $this->stamps; - } -} diff --git a/vendor/symfony/mailer/Event/MessageEvents.php b/vendor/symfony/mailer/Event/MessageEvents.php deleted file mode 100644 index df870f94..00000000 --- a/vendor/symfony/mailer/Event/MessageEvents.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\Event; - -use Symfony\Component\Mime\RawMessage; - -/** - * @author Fabien Potencier - */ -class MessageEvents -{ - /** - * @var MessageEvent[] - */ - private array $events = []; - - /** - * @var array - */ - private array $transports = []; - - public function add(MessageEvent $event): void - { - $this->events[] = $event; - $this->transports[$event->getTransport()] = true; - } - - public function getTransports(): array - { - return array_keys($this->transports); - } - - /** - * @return MessageEvent[] - */ - public function getEvents(string $name = null): array - { - if (null === $name) { - return $this->events; - } - - $events = []; - foreach ($this->events as $event) { - if ($name === $event->getTransport()) { - $events[] = $event; - } - } - - return $events; - } - - /** - * @return RawMessage[] - */ - public function getMessages(string $name = null): array - { - $events = $this->getEvents($name); - $messages = []; - foreach ($events as $event) { - $messages[] = $event->getMessage(); - } - - return $messages; - } -} diff --git a/vendor/symfony/mailer/Event/SentMessageEvent.php b/vendor/symfony/mailer/Event/SentMessageEvent.php deleted file mode 100644 index a412a9f4..00000000 --- a/vendor/symfony/mailer/Event/SentMessageEvent.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\Mailer\Event; - -use Symfony\Component\Mailer\SentMessage; -use Symfony\Contracts\EventDispatcher\Event; - -/** - * @author Fabien Potencier - */ -final class SentMessageEvent extends Event -{ - public function __construct(private SentMessage $message) - { - } - - public function getMessage(): SentMessage - { - return $this->message; - } -} diff --git a/vendor/symfony/mailer/EventListener/EnvelopeListener.php b/vendor/symfony/mailer/EventListener/EnvelopeListener.php deleted file mode 100644 index d47a688c..00000000 --- a/vendor/symfony/mailer/EventListener/EnvelopeListener.php +++ /dev/null @@ -1,71 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\EventListener; - -use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\Mailer\Event\MessageEvent; -use Symfony\Component\Mime\Address; -use Symfony\Component\Mime\Message; - -/** - * Manipulates the Envelope of a Message. - * - * @author Fabien Potencier - */ -class EnvelopeListener implements EventSubscriberInterface -{ - private ?Address $sender = null; - - /** - * @var Address[]|null - */ - private ?array $recipients = null; - - /** - * @param array $recipients - */ - public function __construct(Address|string $sender = null, array $recipients = null) - { - if (null !== $sender) { - $this->sender = Address::create($sender); - } - if (null !== $recipients) { - $this->recipients = Address::createArray($recipients); - } - } - - public function onMessage(MessageEvent $event): void - { - if ($this->sender) { - $event->getEnvelope()->setSender($this->sender); - - $message = $event->getMessage(); - if ($message instanceof Message) { - if (!$message->getHeaders()->has('Sender') && !$message->getHeaders()->has('From')) { - $message->getHeaders()->addMailboxHeader('Sender', $this->sender); - } - } - } - - if ($this->recipients) { - $event->getEnvelope()->setRecipients($this->recipients); - } - } - - public static function getSubscribedEvents(): array - { - return [ - // should be the last one to allow header changes by other listeners first - MessageEvent::class => ['onMessage', -255], - ]; - } -} diff --git a/vendor/symfony/mailer/EventListener/MessageListener.php b/vendor/symfony/mailer/EventListener/MessageListener.php deleted file mode 100644 index 951b5a4d..00000000 --- a/vendor/symfony/mailer/EventListener/MessageListener.php +++ /dev/null @@ -1,134 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\EventListener; - -use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\Mailer\Event\MessageEvent; -use Symfony\Component\Mailer\Exception\InvalidArgumentException; -use Symfony\Component\Mailer\Exception\RuntimeException; -use Symfony\Component\Mime\BodyRendererInterface; -use Symfony\Component\Mime\Header\Headers; -use Symfony\Component\Mime\Header\MailboxListHeader; -use Symfony\Component\Mime\Message; - -/** - * Manipulates the headers and the body of a Message. - * - * @author Fabien Potencier - */ -class MessageListener implements EventSubscriberInterface -{ - public const HEADER_SET_IF_EMPTY = 1; - public const HEADER_ADD = 2; - public const HEADER_REPLACE = 3; - public const DEFAULT_RULES = [ - 'from' => self::HEADER_SET_IF_EMPTY, - 'return-path' => self::HEADER_SET_IF_EMPTY, - 'reply-to' => self::HEADER_ADD, - 'to' => self::HEADER_SET_IF_EMPTY, - 'cc' => self::HEADER_ADD, - 'bcc' => self::HEADER_ADD, - ]; - - private ?Headers $headers; - private array $headerRules = []; - private ?BodyRendererInterface $renderer; - - public function __construct(Headers $headers = null, BodyRendererInterface $renderer = null, array $headerRules = self::DEFAULT_RULES) - { - $this->headers = $headers; - $this->renderer = $renderer; - foreach ($headerRules as $headerName => $rule) { - $this->addHeaderRule($headerName, $rule); - } - } - - public function addHeaderRule(string $headerName, int $rule): void - { - if ($rule < 1 || $rule > 3) { - throw new InvalidArgumentException(sprintf('The "%d" rule is not supported.', $rule)); - } - - $this->headerRules[strtolower($headerName)] = $rule; - } - - public function onMessage(MessageEvent $event): void - { - $message = $event->getMessage(); - if (!$message instanceof Message) { - return; - } - - $this->setHeaders($message); - $this->renderMessage($message); - } - - private function setHeaders(Message $message): void - { - if (!$this->headers) { - return; - } - - $headers = $message->getHeaders(); - foreach ($this->headers->all() as $name => $header) { - if (!$headers->has($name)) { - $headers->add($header); - - continue; - } - - switch ($this->headerRules[$name] ?? self::HEADER_SET_IF_EMPTY) { - case self::HEADER_SET_IF_EMPTY: - break; - - case self::HEADER_REPLACE: - $headers->remove($name); - $headers->add($header); - - break; - - case self::HEADER_ADD: - if (!Headers::isUniqueHeader($name)) { - $headers->add($header); - - break; - } - - $h = $headers->get($name); - if (!$h instanceof MailboxListHeader) { - throw new RuntimeException(sprintf('Unable to set header "%s".', $name)); - } - - Headers::checkHeaderClass($header); - foreach ($header->getAddresses() as $address) { - $h->addAddress($address); - } - } - } - } - - private function renderMessage(Message $message): void - { - if (!$this->renderer) { - return; - } - - $this->renderer->render($message); - } - - public static function getSubscribedEvents(): array - { - return [ - MessageEvent::class => 'onMessage', - ]; - } -} diff --git a/vendor/symfony/mailer/EventListener/MessageLoggerListener.php b/vendor/symfony/mailer/EventListener/MessageLoggerListener.php deleted file mode 100644 index 2446e75c..00000000 --- a/vendor/symfony/mailer/EventListener/MessageLoggerListener.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\EventListener; - -use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\Mailer\Event\MessageEvent; -use Symfony\Component\Mailer\Event\MessageEvents; -use Symfony\Contracts\Service\ResetInterface; - -/** - * Logs Messages. - * - * @author Fabien Potencier - */ -class MessageLoggerListener implements EventSubscriberInterface, ResetInterface -{ - private MessageEvents $events; - - public function __construct() - { - $this->events = new MessageEvents(); - } - - public function reset() - { - $this->events = new MessageEvents(); - } - - public function onMessage(MessageEvent $event): void - { - $this->events->add($event); - } - - public function getEvents(): MessageEvents - { - return $this->events; - } - - public static function getSubscribedEvents(): array - { - return [ - MessageEvent::class => ['onMessage', -255], - ]; - } -} diff --git a/vendor/symfony/mailer/EventListener/MessengerTransportListener.php b/vendor/symfony/mailer/EventListener/MessengerTransportListener.php deleted file mode 100644 index 8cf8cc80..00000000 --- a/vendor/symfony/mailer/EventListener/MessengerTransportListener.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\EventListener; - -use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\Mailer\Event\MessageEvent; -use Symfony\Component\Messenger\Stamp\TransportNamesStamp; -use Symfony\Component\Mime\Message; - -/** - * Allows messages to be sent to specific Messenger transports via the "X-Bus-Transport" MIME header. - * - * @author Fabien Potencier - */ -final class MessengerTransportListener implements EventSubscriberInterface -{ - public function onMessage(MessageEvent $event): void - { - if (!$event->isQueued()) { - return; - } - - $message = $event->getMessage(); - if (!$message instanceof Message || !$message->getHeaders()->has('X-Bus-Transport')) { - return; - } - - $names = $message->getHeaders()->get('X-Bus-Transport')->getBody(); - $names = array_map('trim', explode(',', $names)); - $event->addStamp(new TransportNamesStamp($names)); - $message->getHeaders()->remove('X-Bus-Transport'); - } - - public static function getSubscribedEvents(): array - { - return [ - MessageEvent::class => 'onMessage', - ]; - } -} diff --git a/vendor/symfony/mailer/Exception/ExceptionInterface.php b/vendor/symfony/mailer/Exception/ExceptionInterface.php deleted file mode 100644 index 2f0f3a6f..00000000 --- a/vendor/symfony/mailer/Exception/ExceptionInterface.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\Exception; - -/** - * Exception interface for all exceptions thrown by the component. - * - * @author Fabien Potencier - */ -interface ExceptionInterface extends \Throwable -{ -} diff --git a/vendor/symfony/mailer/Exception/HttpTransportException.php b/vendor/symfony/mailer/Exception/HttpTransportException.php deleted file mode 100644 index 4c97211d..00000000 --- a/vendor/symfony/mailer/Exception/HttpTransportException.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\Exception; - -use Symfony\Contracts\HttpClient\ResponseInterface; - -/** - * @author Fabien Potencier - */ -class HttpTransportException extends TransportException -{ - private ResponseInterface $response; - - public function __construct(string $message, ResponseInterface $response, int $code = 0, \Throwable $previous = null) - { - parent::__construct($message, $code, $previous); - - $this->response = $response; - } - - public function getResponse(): ResponseInterface - { - return $this->response; - } -} diff --git a/vendor/symfony/mailer/Exception/IncompleteDsnException.php b/vendor/symfony/mailer/Exception/IncompleteDsnException.php deleted file mode 100644 index f2618b65..00000000 --- a/vendor/symfony/mailer/Exception/IncompleteDsnException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\Exception; - -/** - * @author Konstantin Myakshin - */ -class IncompleteDsnException extends InvalidArgumentException -{ -} diff --git a/vendor/symfony/mailer/Exception/InvalidArgumentException.php b/vendor/symfony/mailer/Exception/InvalidArgumentException.php deleted file mode 100644 index ba533345..00000000 --- a/vendor/symfony/mailer/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\Exception; - -/** - * @author Fabien Potencier - */ -class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/mailer/Exception/LogicException.php b/vendor/symfony/mailer/Exception/LogicException.php deleted file mode 100644 index 487c0a34..00000000 --- a/vendor/symfony/mailer/Exception/LogicException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\Exception; - -/** - * @author Fabien Potencier - */ -class LogicException extends \LogicException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/mailer/Exception/RuntimeException.php b/vendor/symfony/mailer/Exception/RuntimeException.php deleted file mode 100644 index 44b79cc6..00000000 --- a/vendor/symfony/mailer/Exception/RuntimeException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\Exception; - -/** - * @author Fabien Potencier - */ -class RuntimeException extends \RuntimeException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/mailer/Exception/TransportException.php b/vendor/symfony/mailer/Exception/TransportException.php deleted file mode 100644 index ea538d6f..00000000 --- a/vendor/symfony/mailer/Exception/TransportException.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\Mailer\Exception; - -/** - * @author Fabien Potencier - */ -class TransportException extends RuntimeException implements TransportExceptionInterface -{ - private string $debug = ''; - - public function getDebug(): string - { - return $this->debug; - } - - public function appendDebug(string $debug): void - { - $this->debug .= $debug; - } -} diff --git a/vendor/symfony/mailer/Exception/TransportExceptionInterface.php b/vendor/symfony/mailer/Exception/TransportExceptionInterface.php deleted file mode 100644 index 4318f5ce..00000000 --- a/vendor/symfony/mailer/Exception/TransportExceptionInterface.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\Exception; - -/** - * @author Fabien Potencier - */ -interface TransportExceptionInterface extends ExceptionInterface -{ - public function getDebug(): string; - - public function appendDebug(string $debug): void; -} diff --git a/vendor/symfony/mailer/Exception/UnsupportedSchemeException.php b/vendor/symfony/mailer/Exception/UnsupportedSchemeException.php deleted file mode 100644 index 1a86a070..00000000 --- a/vendor/symfony/mailer/Exception/UnsupportedSchemeException.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\Exception; - -use Symfony\Component\Mailer\Bridge; -use Symfony\Component\Mailer\Transport\Dsn; - -/** - * @author Konstantin Myakshin - */ -class UnsupportedSchemeException extends LogicException -{ - private const SCHEME_TO_PACKAGE_MAP = [ - 'gmail' => [ - 'class' => Bridge\Google\Transport\GmailTransportFactory::class, - 'package' => 'symfony/google-mailer', - ], - 'infobip' => [ - 'class' => Bridge\Infobip\Transport\InfobipTransportFactory::class, - 'package' => 'symfony/infobip-mailer', - ], - 'mailgun' => [ - 'class' => Bridge\Mailgun\Transport\MailgunTransportFactory::class, - 'package' => 'symfony/mailgun-mailer', - ], - 'mailjet' => [ - 'class' => Bridge\Mailjet\Transport\MailjetTransportFactory::class, - 'package' => 'symfony/mailjet-mailer', - ], - 'mandrill' => [ - 'class' => Bridge\Mailchimp\Transport\MandrillTransportFactory::class, - 'package' => 'symfony/mailchimp-mailer', - ], - 'ohmysmtp' => [ - 'class' => Bridge\OhMySmtp\Transport\OhMySmtpTransportFactory::class, - 'package' => 'symfony/oh-my-smtp-mailer', - ], - 'postmark' => [ - 'class' => Bridge\Postmark\Transport\PostmarkTransportFactory::class, - 'package' => 'symfony/postmark-mailer', - ], - 'sendgrid' => [ - 'class' => Bridge\Sendgrid\Transport\SendgridTransportFactory::class, - 'package' => 'symfony/sendgrid-mailer', - ], - 'sendinblue' => [ - 'class' => Bridge\Sendinblue\Transport\SendinblueTransportFactory::class, - 'package' => 'symfony/sendinblue-mailer', - ], - 'ses' => [ - 'class' => Bridge\Amazon\Transport\SesTransportFactory::class, - 'package' => 'symfony/amazon-mailer', - ], - ]; - - public function __construct(Dsn $dsn, string $name = null, array $supported = []) - { - $provider = $dsn->getScheme(); - if (false !== $pos = strpos($provider, '+')) { - $provider = substr($provider, 0, $pos); - } - $package = self::SCHEME_TO_PACKAGE_MAP[$provider] ?? null; - if ($package && !class_exists($package['class'])) { - parent::__construct(sprintf('Unable to send emails via "%s" as the bridge is not installed; try running "composer require %s".', $provider, $package['package'])); - - return; - } - - $message = sprintf('The "%s" scheme is not supported', $dsn->getScheme()); - if ($name && $supported) { - $message .= sprintf('; supported schemes for mailer "%s" are: "%s"', $name, implode('", "', $supported)); - } - - parent::__construct($message.'.'); - } -} diff --git a/vendor/symfony/mailer/Header/MetadataHeader.php b/vendor/symfony/mailer/Header/MetadataHeader.php deleted file mode 100644 index d6ee5440..00000000 --- a/vendor/symfony/mailer/Header/MetadataHeader.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\Header; - -use Symfony\Component\Mime\Header\UnstructuredHeader; - -/** - * @author Kevin Bond - */ -final class MetadataHeader extends UnstructuredHeader -{ - private string $key; - - public function __construct(string $key, string $value) - { - $this->key = $key; - - parent::__construct('X-Metadata-'.$key, $value); - } - - public function getKey(): string - { - return $this->key; - } -} diff --git a/vendor/symfony/mailer/Header/TagHeader.php b/vendor/symfony/mailer/Header/TagHeader.php deleted file mode 100644 index 7115caeb..00000000 --- a/vendor/symfony/mailer/Header/TagHeader.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\Mailer\Header; - -use Symfony\Component\Mime\Header\UnstructuredHeader; - -/** - * @author Kevin Bond - */ -final class TagHeader extends UnstructuredHeader -{ - public function __construct(string $value) - { - parent::__construct('X-Tag', $value); - } -} diff --git a/vendor/symfony/mailer/LICENSE b/vendor/symfony/mailer/LICENSE deleted file mode 100644 index 9c907a46..00000000 --- a/vendor/symfony/mailer/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2019-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/mailer/Mailer.php b/vendor/symfony/mailer/Mailer.php deleted file mode 100644 index c9f8b15a..00000000 --- a/vendor/symfony/mailer/Mailer.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer; - -use Psr\EventDispatcher\EventDispatcherInterface; -use Symfony\Component\Mailer\Event\MessageEvent; -use Symfony\Component\Mailer\Exception\TransportExceptionInterface; -use Symfony\Component\Mailer\Messenger\SendEmailMessage; -use Symfony\Component\Mailer\Transport\TransportInterface; -use Symfony\Component\Messenger\Exception\HandlerFailedException; -use Symfony\Component\Messenger\MessageBusInterface; -use Symfony\Component\Mime\RawMessage; - -/** - * @author Fabien Potencier - */ -final class Mailer implements MailerInterface -{ - private TransportInterface $transport; - private ?MessageBusInterface $bus; - private ?EventDispatcherInterface $dispatcher; - - public function __construct(TransportInterface $transport, MessageBusInterface $bus = null, EventDispatcherInterface $dispatcher = null) - { - $this->transport = $transport; - $this->bus = $bus; - $this->dispatcher = $dispatcher; - } - - public function send(RawMessage $message, Envelope $envelope = null): void - { - if (null === $this->bus) { - $this->transport->send($message, $envelope); - - return; - } - - $stamps = []; - if (null !== $this->dispatcher) { - // The dispatched event here has `queued` set to `true`; the goal is NOT to render the message, but to let - // listeners do something before a message is sent to the queue. - // We are using a cloned message as we still want to dispatch the **original** message, not the one modified by listeners. - // That's because the listeners will run again when the email is sent via Messenger by the transport (see `AbstractTransport`). - // Listeners should act depending on the `$queued` argument of the `MessageEvent` instance. - $clonedMessage = clone $message; - $clonedEnvelope = null !== $envelope ? clone $envelope : Envelope::create($clonedMessage); - $event = new MessageEvent($clonedMessage, $clonedEnvelope, (string) $this->transport, true); - $this->dispatcher->dispatch($event); - $stamps = $event->getStamps(); - } - - try { - $this->bus->dispatch(new SendEmailMessage($message, $envelope), $stamps); - } catch (HandlerFailedException $e) { - foreach ($e->getNestedExceptions() as $nested) { - if ($nested instanceof TransportExceptionInterface) { - throw $nested; - } - } - throw $e; - } - } -} diff --git a/vendor/symfony/mailer/MailerInterface.php b/vendor/symfony/mailer/MailerInterface.php deleted file mode 100644 index eb44cf64..00000000 --- a/vendor/symfony/mailer/MailerInterface.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\Mailer; - -use Symfony\Component\Mailer\Exception\TransportExceptionInterface; -use Symfony\Component\Mime\RawMessage; - -/** - * Interface for mailers able to send emails synchronous and/or asynchronous. - * - * Implementations must support synchronous and asynchronous sending. - * - * @author Fabien Potencier - */ -interface MailerInterface -{ - /** - * @throws TransportExceptionInterface - */ - public function send(RawMessage $message, Envelope $envelope = null): void; -} diff --git a/vendor/symfony/mailer/Messenger/MessageHandler.php b/vendor/symfony/mailer/Messenger/MessageHandler.php deleted file mode 100644 index f8fb14fc..00000000 --- a/vendor/symfony/mailer/Messenger/MessageHandler.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\Mailer\Messenger; - -use Symfony\Component\Mailer\SentMessage; -use Symfony\Component\Mailer\Transport\TransportInterface; - -/** - * @author Fabien Potencier - */ -class MessageHandler -{ - private TransportInterface $transport; - - public function __construct(TransportInterface $transport) - { - $this->transport = $transport; - } - - public function __invoke(SendEmailMessage $message): ?SentMessage - { - return $this->transport->send($message->getMessage(), $message->getEnvelope()); - } -} diff --git a/vendor/symfony/mailer/Messenger/SendEmailMessage.php b/vendor/symfony/mailer/Messenger/SendEmailMessage.php deleted file mode 100644 index 1af5c7b3..00000000 --- a/vendor/symfony/mailer/Messenger/SendEmailMessage.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\Messenger; - -use Symfony\Component\Mailer\Envelope; -use Symfony\Component\Mime\RawMessage; - -/** - * @author Fabien Potencier - */ -class SendEmailMessage -{ - private RawMessage $message; - private ?Envelope $envelope; - - public function __construct(RawMessage $message, Envelope $envelope = null) - { - $this->message = $message; - $this->envelope = $envelope; - } - - public function getMessage(): RawMessage - { - return $this->message; - } - - public function getEnvelope(): ?Envelope - { - return $this->envelope; - } -} diff --git a/vendor/symfony/mailer/README.md b/vendor/symfony/mailer/README.md deleted file mode 100644 index 93a95858..00000000 --- a/vendor/symfony/mailer/README.md +++ /dev/null @@ -1,74 +0,0 @@ -Mailer Component -================ - -The Mailer component helps sending emails. - -Getting Started ---------------- - -``` -$ composer require symfony/mailer -``` - -```php -use Symfony\Component\Mailer\Transport; -use Symfony\Component\Mailer\Mailer; -use Symfony\Component\Mime\Email; - -$transport = Transport::fromDsn('smtp://localhost'); -$mailer = new Mailer($transport); - -$email = (new Email()) - ->from('hello@example.com') - ->to('you@example.com') - //->cc('cc@example.com') - //->bcc('bcc@example.com') - //->replyTo('fabien@example.com') - //->priority(Email::PRIORITY_HIGH) - ->subject('Time for Symfony Mailer!') - ->text('Sending emails is fun again!') - ->html('

      See Twig integration for better HTML integration!

      '); - -$mailer->send($email); -``` - -To enable the Twig integration of the Mailer, require `symfony/twig-bridge` and -set up the `BodyRenderer`: - -```php -use Symfony\Bridge\Twig\Mime\BodyRenderer; -use Symfony\Bridge\Twig\Mime\TemplatedEmail; -use Symfony\Component\EventDispatcher\EventDispatcher; -use Symfony\Component\Mailer\EventListener\MessageListener; -use Symfony\Component\Mailer\Mailer; -use Symfony\Component\Mailer\Transport; -use Twig\Environment as TwigEnvironment; - -$twig = new TwigEnvironment(...); -$messageListener = new MessageListener(null, new BodyRenderer($twig)); - -$eventDispatcher = new EventDispatcher(); -$eventDispatcher->addSubscriber($messageListener); - -$transport = Transport::fromDsn('smtp://localhost', $eventDispatcher); -$mailer = new Mailer($transport, null, $eventDispatcher); - -$email = (new TemplatedEmail()) - // ... - ->htmlTemplate('emails/signup.html.twig') - ->context([ - 'expiration_date' => new \DateTime('+7 days'), - 'username' => 'foo', - ]) -; -$mailer->send($email); -``` - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/mailer.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/mailer/SentMessage.php b/vendor/symfony/mailer/SentMessage.php deleted file mode 100644 index be847118..00000000 --- a/vendor/symfony/mailer/SentMessage.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\Mailer; - -use Symfony\Component\Mime\Message; -use Symfony\Component\Mime\RawMessage; - -/** - * @author Fabien Potencier - */ -class SentMessage -{ - private RawMessage $original; - private RawMessage $raw; - private Envelope $envelope; - private string $messageId; - private string $debug = ''; - - /** - * @internal - */ - public function __construct(RawMessage $message, Envelope $envelope) - { - $message->ensureValidity(); - - $this->original = $message; - $this->envelope = $envelope; - - if ($message instanceof Message) { - $message = clone $message; - $headers = $message->getHeaders(); - if (!$headers->has('Message-ID')) { - $headers->addIdHeader('Message-ID', $message->generateMessageId()); - } - $this->messageId = $headers->get('Message-ID')->getId(); - $this->raw = new RawMessage($message->toIterable()); - } else { - $this->raw = $message; - } - } - - public function getMessage(): RawMessage - { - return $this->raw; - } - - public function getOriginalMessage(): RawMessage - { - return $this->original; - } - - public function getEnvelope(): Envelope - { - return $this->envelope; - } - - public function setMessageId(string $id): void - { - $this->messageId = $id; - } - - public function getMessageId(): string - { - return $this->messageId; - } - - public function getDebug(): string - { - return $this->debug; - } - - public function appendDebug(string $debug): void - { - $this->debug .= $debug; - } - - public function toString(): string - { - return $this->raw->toString(); - } - - public function toIterable(): iterable - { - return $this->raw->toIterable(); - } -} diff --git a/vendor/symfony/mailer/Test/Constraint/EmailCount.php b/vendor/symfony/mailer/Test/Constraint/EmailCount.php deleted file mode 100644 index aaff8b88..00000000 --- a/vendor/symfony/mailer/Test/Constraint/EmailCount.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\Mailer\Test\Constraint; - -use PHPUnit\Framework\Constraint\Constraint; -use Symfony\Component\Mailer\Event\MessageEvents; - -final class EmailCount extends Constraint -{ - private int $expectedValue; - private ?string $transport; - private bool $queued; - - public function __construct(int $expectedValue, string $transport = null, bool $queued = false) - { - $this->expectedValue = $expectedValue; - $this->transport = $transport; - $this->queued = $queued; - } - - public function toString(): string - { - return sprintf('%shas %s "%d" emails', $this->transport ? $this->transport.' ' : '', $this->queued ? 'queued' : 'sent', $this->expectedValue); - } - - /** - * @param MessageEvents $events - */ - protected function matches($events): bool - { - return $this->expectedValue === $this->countEmails($events); - } - - /** - * @param MessageEvents $events - */ - protected function failureDescription($events): string - { - return sprintf('the Transport %s (%d %s)', $this->toString(), $this->countEmails($events), $this->queued ? 'queued' : 'sent'); - } - - private function countEmails(MessageEvents $events): int - { - $count = 0; - foreach ($events->getEvents($this->transport) as $event) { - if ( - ($this->queued && $event->isQueued()) - || - (!$this->queued && !$event->isQueued()) - ) { - ++$count; - } - } - - return $count; - } -} diff --git a/vendor/symfony/mailer/Test/Constraint/EmailIsQueued.php b/vendor/symfony/mailer/Test/Constraint/EmailIsQueued.php deleted file mode 100644 index 46436aa0..00000000 --- a/vendor/symfony/mailer/Test/Constraint/EmailIsQueued.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\Test\Constraint; - -use PHPUnit\Framework\Constraint\Constraint; -use Symfony\Component\Mailer\Event\MessageEvent; - -final class EmailIsQueued extends Constraint -{ - public function toString(): string - { - return 'is queued'; - } - - /** - * @param MessageEvent $event - */ - protected function matches($event): bool - { - return $event->isQueued(); - } - - /** - * @param MessageEvent $event - */ - protected function failureDescription($event): string - { - return 'the Email '.$this->toString(); - } -} diff --git a/vendor/symfony/mailer/Test/TransportFactoryTestCase.php b/vendor/symfony/mailer/Test/TransportFactoryTestCase.php deleted file mode 100644 index 1cf22e9b..00000000 --- a/vendor/symfony/mailer/Test/TransportFactoryTestCase.php +++ /dev/null @@ -1,117 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\Test; - -use PHPUnit\Framework\TestCase; -use Psr\Log\LoggerInterface; -use Symfony\Component\Mailer\Exception\IncompleteDsnException; -use Symfony\Component\Mailer\Exception\UnsupportedSchemeException; -use Symfony\Component\Mailer\Transport\Dsn; -use Symfony\Component\Mailer\Transport\TransportFactoryInterface; -use Symfony\Component\Mailer\Transport\TransportInterface; -use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; -use Symfony\Contracts\HttpClient\HttpClientInterface; - -/** - * A test case to ease testing Transport Factory. - * - * @author Konstantin Myakshin - */ -abstract class TransportFactoryTestCase extends TestCase -{ - protected const USER = 'u$er'; - protected const PASSWORD = 'pa$s'; - - protected $dispatcher; - protected $client; - protected $logger; - - abstract public function getFactory(): TransportFactoryInterface; - - abstract public function supportsProvider(): iterable; - - abstract public function createProvider(): iterable; - - public function unsupportedSchemeProvider(): iterable - { - return []; - } - - public function incompleteDsnProvider(): iterable - { - return []; - } - - /** - * @dataProvider supportsProvider - */ - public function testSupports(Dsn $dsn, bool $supports) - { - $factory = $this->getFactory(); - - $this->assertSame($supports, $factory->supports($dsn)); - } - - /** - * @dataProvider createProvider - */ - public function testCreate(Dsn $dsn, TransportInterface $transport) - { - $factory = $this->getFactory(); - - $this->assertEquals($transport, $factory->create($dsn)); - if (str_contains('smtp', $dsn->getScheme())) { - $this->assertStringMatchesFormat($dsn->getScheme().'://%S'.$dsn->getHost().'%S', (string) $transport); - } - } - - /** - * @dataProvider unsupportedSchemeProvider - */ - public function testUnsupportedSchemeException(Dsn $dsn, string $message = null) - { - $factory = $this->getFactory(); - - $this->expectException(UnsupportedSchemeException::class); - if (null !== $message) { - $this->expectExceptionMessage($message); - } - - $factory->create($dsn); - } - - /** - * @dataProvider incompleteDsnProvider - */ - public function testIncompleteDsnException(Dsn $dsn) - { - $factory = $this->getFactory(); - - $this->expectException(IncompleteDsnException::class); - $factory->create($dsn); - } - - protected function getDispatcher(): EventDispatcherInterface - { - return $this->dispatcher ??= $this->createMock(EventDispatcherInterface::class); - } - - protected function getClient(): HttpClientInterface - { - return $this->client ??= $this->createMock(HttpClientInterface::class); - } - - protected function getLogger(): LoggerInterface - { - return $this->logger ??= $this->createMock(LoggerInterface::class); - } -} diff --git a/vendor/symfony/mailer/Transport.php b/vendor/symfony/mailer/Transport.php deleted file mode 100644 index f1d7c1d7..00000000 --- a/vendor/symfony/mailer/Transport.php +++ /dev/null @@ -1,180 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer; - -use Psr\EventDispatcher\EventDispatcherInterface; -use Psr\Log\LoggerInterface; -use Symfony\Component\Mailer\Bridge\Amazon\Transport\SesTransportFactory; -use Symfony\Component\Mailer\Bridge\Google\Transport\GmailTransportFactory; -use Symfony\Component\Mailer\Bridge\Infobip\Transport\InfobipTransportFactory; -use Symfony\Component\Mailer\Bridge\Mailchimp\Transport\MandrillTransportFactory; -use Symfony\Component\Mailer\Bridge\Mailgun\Transport\MailgunTransportFactory; -use Symfony\Component\Mailer\Bridge\Mailjet\Transport\MailjetTransportFactory; -use Symfony\Component\Mailer\Bridge\OhMySmtp\Transport\OhMySmtpTransportFactory; -use Symfony\Component\Mailer\Bridge\Postmark\Transport\PostmarkTransportFactory; -use Symfony\Component\Mailer\Bridge\Sendgrid\Transport\SendgridTransportFactory; -use Symfony\Component\Mailer\Bridge\Sendinblue\Transport\SendinblueTransportFactory; -use Symfony\Component\Mailer\Exception\InvalidArgumentException; -use Symfony\Component\Mailer\Exception\UnsupportedSchemeException; -use Symfony\Component\Mailer\Transport\Dsn; -use Symfony\Component\Mailer\Transport\FailoverTransport; -use Symfony\Component\Mailer\Transport\NativeTransportFactory; -use Symfony\Component\Mailer\Transport\NullTransportFactory; -use Symfony\Component\Mailer\Transport\RoundRobinTransport; -use Symfony\Component\Mailer\Transport\SendmailTransportFactory; -use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransportFactory; -use Symfony\Component\Mailer\Transport\TransportFactoryInterface; -use Symfony\Component\Mailer\Transport\TransportInterface; -use Symfony\Component\Mailer\Transport\Transports; -use Symfony\Contracts\HttpClient\HttpClientInterface; - -/** - * @author Fabien Potencier - * @author Konstantin Myakshin - */ -final class Transport -{ - private const FACTORY_CLASSES = [ - GmailTransportFactory::class, - InfobipTransportFactory::class, - MailgunTransportFactory::class, - MailjetTransportFactory::class, - MandrillTransportFactory::class, - OhMySmtpTransportFactory::class, - PostmarkTransportFactory::class, - SendgridTransportFactory::class, - SendinblueTransportFactory::class, - SesTransportFactory::class, - ]; - - private iterable $factories; - - public static function fromDsn(string $dsn, EventDispatcherInterface $dispatcher = null, HttpClientInterface $client = null, LoggerInterface $logger = null): TransportInterface - { - $factory = new self(iterator_to_array(self::getDefaultFactories($dispatcher, $client, $logger))); - - return $factory->fromString($dsn); - } - - public static function fromDsns(array $dsns, EventDispatcherInterface $dispatcher = null, HttpClientInterface $client = null, LoggerInterface $logger = null): TransportInterface - { - $factory = new self(iterator_to_array(self::getDefaultFactories($dispatcher, $client, $logger))); - - return $factory->fromStrings($dsns); - } - - /** - * @param TransportFactoryInterface[] $factories - */ - public function __construct(iterable $factories) - { - $this->factories = $factories; - } - - public function fromStrings(array $dsns): Transports - { - $transports = []; - foreach ($dsns as $name => $dsn) { - $transports[$name] = $this->fromString($dsn); - } - - return new Transports($transports); - } - - public function fromString(string $dsn): TransportInterface - { - [$transport, $offset] = $this->parseDsn($dsn); - if ($offset !== \strlen($dsn)) { - throw new InvalidArgumentException(sprintf('The DSN has some garbage at the end: "%s".', substr($dsn, $offset))); - } - - return $transport; - } - - private function parseDsn(string $dsn, int $offset = 0): array - { - static $keywords = [ - 'failover' => FailoverTransport::class, - 'roundrobin' => RoundRobinTransport::class, - ]; - - while (true) { - foreach ($keywords as $name => $class) { - $name .= '('; - if ($name === substr($dsn, $offset, \strlen($name))) { - $offset += \strlen($name) - 1; - preg_match('{\(([^()]|(?R))*\)}A', $dsn, $matches, 0, $offset); - if (!isset($matches[0])) { - continue; - } - - ++$offset; - $args = []; - while (true) { - [$arg, $offset] = $this->parseDsn($dsn, $offset); - $args[] = $arg; - if (\strlen($dsn) === $offset) { - break; - } - ++$offset; - if (')' === $dsn[$offset - 1]) { - break; - } - } - - return [new $class($args), $offset]; - } - } - - if (preg_match('{(\w+)\(}A', $dsn, $matches, 0, $offset)) { - throw new InvalidArgumentException(sprintf('The "%s" keyword is not valid (valid ones are "%s"), ', $matches[1], implode('", "', array_keys($keywords)))); - } - - if ($pos = strcspn($dsn, ' )', $offset)) { - return [$this->fromDsnObject(Dsn::fromString(substr($dsn, $offset, $pos))), $offset + $pos]; - } - - return [$this->fromDsnObject(Dsn::fromString(substr($dsn, $offset))), \strlen($dsn)]; - } - } - - public function fromDsnObject(Dsn $dsn): TransportInterface - { - foreach ($this->factories as $factory) { - if ($factory->supports($dsn)) { - return $factory->create($dsn); - } - } - - throw new UnsupportedSchemeException($dsn); - } - - /** - * @return \Traversable - */ - public static function getDefaultFactories(EventDispatcherInterface $dispatcher = null, HttpClientInterface $client = null, LoggerInterface $logger = null): \Traversable - { - foreach (self::FACTORY_CLASSES as $factoryClass) { - if (class_exists($factoryClass)) { - yield new $factoryClass($dispatcher, $client, $logger); - } - } - - yield new NullTransportFactory($dispatcher, $client, $logger); - - yield new SendmailTransportFactory($dispatcher, $client, $logger); - - yield new EsmtpTransportFactory($dispatcher, $client, $logger); - - yield new NativeTransportFactory($dispatcher, $client, $logger); - } -} diff --git a/vendor/symfony/mailer/Transport/AbstractApiTransport.php b/vendor/symfony/mailer/Transport/AbstractApiTransport.php deleted file mode 100644 index 392484dd..00000000 --- a/vendor/symfony/mailer/Transport/AbstractApiTransport.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\Transport; - -use Symfony\Component\Mailer\Envelope; -use Symfony\Component\Mailer\Exception\RuntimeException; -use Symfony\Component\Mailer\SentMessage; -use Symfony\Component\Mime\Address; -use Symfony\Component\Mime\Email; -use Symfony\Component\Mime\MessageConverter; -use Symfony\Contracts\HttpClient\ResponseInterface; - -/** - * @author Fabien Potencier - */ -abstract class AbstractApiTransport extends AbstractHttpTransport -{ - abstract protected function doSendApi(SentMessage $sentMessage, Email $email, Envelope $envelope): ResponseInterface; - - protected function doSendHttp(SentMessage $message): ResponseInterface - { - try { - $email = MessageConverter::toEmail($message->getOriginalMessage()); - } catch (\Exception $e) { - throw new RuntimeException(sprintf('Unable to send message with the "%s" transport: ', __CLASS__).$e->getMessage(), 0, $e); - } - - return $this->doSendApi($message, $email, $message->getEnvelope()); - } - - protected function getRecipients(Email $email, Envelope $envelope): array - { - return array_filter($envelope->getRecipients(), function (Address $address) use ($email) { - return false === \in_array($address, array_merge($email->getCc(), $email->getBcc()), true); - }); - } -} diff --git a/vendor/symfony/mailer/Transport/AbstractHttpTransport.php b/vendor/symfony/mailer/Transport/AbstractHttpTransport.php deleted file mode 100644 index d671c05a..00000000 --- a/vendor/symfony/mailer/Transport/AbstractHttpTransport.php +++ /dev/null @@ -1,79 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\Transport; - -use Psr\EventDispatcher\EventDispatcherInterface; -use Psr\Log\LoggerInterface; -use Symfony\Component\HttpClient\HttpClient; -use Symfony\Component\Mailer\Exception\HttpTransportException; -use Symfony\Component\Mailer\SentMessage; -use Symfony\Contracts\HttpClient\HttpClientInterface; -use Symfony\Contracts\HttpClient\ResponseInterface; - -/** - * @author Victor Bocharsky - */ -abstract class AbstractHttpTransport extends AbstractTransport -{ - protected $host; - protected $port; - protected $client; - - public function __construct(HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null, LoggerInterface $logger = null) - { - $this->client = $client; - if (null === $client) { - if (!class_exists(HttpClient::class)) { - throw new \LogicException(sprintf('You cannot use "%s" as the HttpClient component is not installed. Try running "composer require symfony/http-client".', __CLASS__)); - } - - $this->client = HttpClient::create(); - } - - parent::__construct($dispatcher, $logger); - } - - /** - * @return $this - */ - public function setHost(?string $host): static - { - $this->host = $host; - - return $this; - } - - /** - * @return $this - */ - public function setPort(?int $port): static - { - $this->port = $port; - - return $this; - } - - abstract protected function doSendHttp(SentMessage $message): ResponseInterface; - - protected function doSend(SentMessage $message): void - { - $response = null; - try { - $response = $this->doSendHttp($message); - $message->appendDebug($response->getInfo('debug') ?? ''); - } catch (HttpTransportException $e) { - $e->appendDebug($e->getResponse()->getInfo('debug') ?? ''); - - throw $e; - } - } -} diff --git a/vendor/symfony/mailer/Transport/AbstractTransport.php b/vendor/symfony/mailer/Transport/AbstractTransport.php deleted file mode 100644 index a6710d00..00000000 --- a/vendor/symfony/mailer/Transport/AbstractTransport.php +++ /dev/null @@ -1,134 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\Transport; - -use Psr\EventDispatcher\EventDispatcherInterface; -use Psr\Log\LoggerInterface; -use Psr\Log\NullLogger; -use Symfony\Bridge\Twig\Mime\TemplatedEmail; -use Symfony\Component\Mailer\Envelope; -use Symfony\Component\Mailer\Event\FailedMessageEvent; -use Symfony\Component\Mailer\Event\MessageEvent; -use Symfony\Component\Mailer\Event\SentMessageEvent; -use Symfony\Component\Mailer\Exception\LogicException; -use Symfony\Component\Mailer\SentMessage; -use Symfony\Component\Mime\Address; -use Symfony\Component\Mime\BodyRendererInterface; -use Symfony\Component\Mime\RawMessage; - -/** - * @author Fabien Potencier - */ -abstract class AbstractTransport implements TransportInterface -{ - private ?EventDispatcherInterface $dispatcher; - private LoggerInterface $logger; - private float $rate = 0; - private float $lastSent = 0; - - public function __construct(EventDispatcherInterface $dispatcher = null, LoggerInterface $logger = null) - { - $this->dispatcher = $dispatcher; - $this->logger = $logger ?? new NullLogger(); - } - - /** - * Sets the maximum number of messages to send per second (0 to disable). - * - * @return $this - */ - public function setMaxPerSecond(float $rate): static - { - if (0 >= $rate) { - $rate = 0; - } - - $this->rate = $rate; - $this->lastSent = 0; - - return $this; - } - - public function send(RawMessage $message, Envelope $envelope = null): ?SentMessage - { - $message = clone $message; - $envelope = null !== $envelope ? clone $envelope : Envelope::create($message); - - try { - if (!$this->dispatcher) { - $sentMessage = new SentMessage($message, $envelope); - $this->doSend($sentMessage); - - return $sentMessage; - } - - $event = new MessageEvent($message, $envelope, (string) $this); - $this->dispatcher->dispatch($event); - $envelope = $event->getEnvelope(); - $message = $event->getMessage(); - - if ($message instanceof TemplatedEmail && !$message->isRendered()) { - throw new LogicException(sprintf('You must configure a "%s" when a "%s" instance has a text or HTML template set.', BodyRendererInterface::class, get_debug_type($message))); - } - - $sentMessage = new SentMessage($message, $envelope); - - try { - $this->doSend($sentMessage); - } catch (\Throwable $error) { - $this->dispatcher->dispatch(new FailedMessageEvent($message, $error)); - $this->checkThrottling(); - - throw $error; - } - - $this->dispatcher->dispatch(new SentMessageEvent($sentMessage)); - - return $sentMessage; - } finally { - $this->checkThrottling(); - } - } - - abstract protected function doSend(SentMessage $message): void; - - /** - * @param Address[] $addresses - * - * @return string[] - */ - protected function stringifyAddresses(array $addresses): array - { - return array_map(function (Address $a) { - return $a->toString(); - }, $addresses); - } - - protected function getLogger(): LoggerInterface - { - return $this->logger; - } - - private function checkThrottling() - { - if (0 == $this->rate) { - return; - } - - $sleep = (1 / $this->rate) - (microtime(true) - $this->lastSent); - if (0 < $sleep) { - $this->logger->debug(sprintf('Email transport "%s" sleeps for %.2f seconds', __CLASS__, $sleep)); - usleep($sleep * 1000000); - } - $this->lastSent = microtime(true); - } -} diff --git a/vendor/symfony/mailer/Transport/AbstractTransportFactory.php b/vendor/symfony/mailer/Transport/AbstractTransportFactory.php deleted file mode 100644 index e1617d27..00000000 --- a/vendor/symfony/mailer/Transport/AbstractTransportFactory.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\Transport; - -use Psr\EventDispatcher\EventDispatcherInterface; -use Psr\Log\LoggerInterface; -use Symfony\Component\Mailer\Exception\IncompleteDsnException; -use Symfony\Contracts\HttpClient\HttpClientInterface; - -/** - * @author Konstantin Myakshin - */ -abstract class AbstractTransportFactory implements TransportFactoryInterface -{ - protected $dispatcher; - protected $client; - protected $logger; - - public function __construct(EventDispatcherInterface $dispatcher = null, HttpClientInterface $client = null, LoggerInterface $logger = null) - { - $this->dispatcher = $dispatcher; - $this->client = $client; - $this->logger = $logger; - } - - public function supports(Dsn $dsn): bool - { - return \in_array($dsn->getScheme(), $this->getSupportedSchemes()); - } - - abstract protected function getSupportedSchemes(): array; - - protected function getUser(Dsn $dsn): string - { - $user = $dsn->getUser(); - if (null === $user) { - throw new IncompleteDsnException('User is not set.'); - } - - return $user; - } - - protected function getPassword(Dsn $dsn): string - { - $password = $dsn->getPassword(); - if (null === $password) { - throw new IncompleteDsnException('Password is not set.'); - } - - return $password; - } -} diff --git a/vendor/symfony/mailer/Transport/Dsn.php b/vendor/symfony/mailer/Transport/Dsn.php deleted file mode 100644 index 065be9a3..00000000 --- a/vendor/symfony/mailer/Transport/Dsn.php +++ /dev/null @@ -1,89 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\Transport; - -use Symfony\Component\Mailer\Exception\InvalidArgumentException; - -/** - * @author Konstantin Myakshin - */ -final class Dsn -{ - private string $scheme; - private string $host; - private ?string $user; - private ?string $password; - private ?int $port; - private array $options; - - public function __construct(string $scheme, string $host, string $user = null, #[\SensitiveParameter] string $password = null, int $port = null, array $options = []) - { - $this->scheme = $scheme; - $this->host = $host; - $this->user = $user; - $this->password = $password; - $this->port = $port; - $this->options = $options; - } - - public static function fromString(string $dsn): self - { - if (false === $parsedDsn = parse_url($dsn)) { - throw new InvalidArgumentException(sprintf('The "%s" mailer DSN is invalid.', $dsn)); - } - - if (!isset($parsedDsn['scheme'])) { - throw new InvalidArgumentException(sprintf('The "%s" mailer DSN must contain a scheme.', $dsn)); - } - - if (!isset($parsedDsn['host'])) { - throw new InvalidArgumentException(sprintf('The "%s" mailer DSN must contain a host (use "default" by default).', $dsn)); - } - - $user = '' !== ($parsedDsn['user'] ?? '') ? urldecode($parsedDsn['user']) : null; - $password = '' !== ($parsedDsn['pass'] ?? '') ? urldecode($parsedDsn['pass']) : null; - $port = $parsedDsn['port'] ?? null; - parse_str($parsedDsn['query'] ?? '', $query); - - return new self($parsedDsn['scheme'], $parsedDsn['host'], $user, $password, $port, $query); - } - - public function getScheme(): string - { - return $this->scheme; - } - - public function getHost(): string - { - return $this->host; - } - - public function getUser(): ?string - { - return $this->user; - } - - public function getPassword(): ?string - { - return $this->password; - } - - public function getPort(int $default = null): ?int - { - return $this->port ?? $default; - } - - public function getOption(string $key, mixed $default = null) - { - return $this->options[$key] ?? $default; - } -} diff --git a/vendor/symfony/mailer/Transport/FailoverTransport.php b/vendor/symfony/mailer/Transport/FailoverTransport.php deleted file mode 100644 index d6a74773..00000000 --- a/vendor/symfony/mailer/Transport/FailoverTransport.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\Transport; - -/** - * Uses several Transports using a failover algorithm. - * - * @author Fabien Potencier - */ -class FailoverTransport extends RoundRobinTransport -{ - private ?TransportInterface $currentTransport = null; - - protected function getNextTransport(): ?TransportInterface - { - if (null === $this->currentTransport || $this->isTransportDead($this->currentTransport)) { - $this->currentTransport = parent::getNextTransport(); - } - - return $this->currentTransport; - } - - protected function getInitialCursor(): int - { - return 0; - } - - protected function getNameSymbol(): string - { - return 'failover'; - } -} diff --git a/vendor/symfony/mailer/Transport/NativeTransportFactory.php b/vendor/symfony/mailer/Transport/NativeTransportFactory.php deleted file mode 100644 index 8afa53cc..00000000 --- a/vendor/symfony/mailer/Transport/NativeTransportFactory.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\Mailer\Transport; - -use Symfony\Component\Mailer\Exception\TransportException; -use Symfony\Component\Mailer\Exception\UnsupportedSchemeException; -use Symfony\Component\Mailer\Transport\Smtp\SmtpTransport; -use Symfony\Component\Mailer\Transport\Smtp\Stream\SocketStream; - -/** - * Factory that configures a transport (sendmail or SMTP) based on php.ini settings. - * - * @author Laurent VOULLEMIER - */ -final class NativeTransportFactory extends AbstractTransportFactory -{ - public function create(Dsn $dsn): TransportInterface - { - if (!\in_array($dsn->getScheme(), $this->getSupportedSchemes(), true)) { - throw new UnsupportedSchemeException($dsn, 'native', $this->getSupportedSchemes()); - } - - if ($sendMailPath = ini_get('sendmail_path')) { - return new SendmailTransport($sendMailPath, $this->dispatcher, $this->logger); - } - - if ('\\' !== \DIRECTORY_SEPARATOR) { - throw new TransportException('sendmail_path is not configured in php.ini.'); - } - - // Only for windows hosts; at this point non-windows - // host have already thrown an exception or returned a transport - $host = ini_get('SMTP'); - $port = (int) ini_get('smtp_port'); - - if (!$host || !$port) { - throw new TransportException('smtp or smtp_port is not configured in php.ini.'); - } - - $socketStream = new SocketStream(); - $socketStream->setHost($host); - $socketStream->setPort($port); - if (465 !== $port) { - $socketStream->disableTls(); - } - - return new SmtpTransport($socketStream, $this->dispatcher, $this->logger); - } - - protected function getSupportedSchemes(): array - { - return ['native']; - } -} diff --git a/vendor/symfony/mailer/Transport/NullTransport.php b/vendor/symfony/mailer/Transport/NullTransport.php deleted file mode 100644 index 92fb82a4..00000000 --- a/vendor/symfony/mailer/Transport/NullTransport.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. - */ - -namespace Symfony\Component\Mailer\Transport; - -use Symfony\Component\Mailer\SentMessage; - -/** - * Pretends messages have been sent, but just ignores them. - * - * @author Fabien Potencier - */ -final class NullTransport extends AbstractTransport -{ - protected function doSend(SentMessage $message): void - { - } - - public function __toString(): string - { - return 'null://'; - } -} diff --git a/vendor/symfony/mailer/Transport/NullTransportFactory.php b/vendor/symfony/mailer/Transport/NullTransportFactory.php deleted file mode 100644 index 4c45f39e..00000000 --- a/vendor/symfony/mailer/Transport/NullTransportFactory.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\Transport; - -use Symfony\Component\Mailer\Exception\UnsupportedSchemeException; - -/** - * @author Konstantin Myakshin - */ -final class NullTransportFactory extends AbstractTransportFactory -{ - public function create(Dsn $dsn): TransportInterface - { - if ('null' === $dsn->getScheme()) { - return new NullTransport($this->dispatcher, $this->logger); - } - - throw new UnsupportedSchemeException($dsn, 'null', $this->getSupportedSchemes()); - } - - protected function getSupportedSchemes(): array - { - return ['null']; - } -} diff --git a/vendor/symfony/mailer/Transport/RoundRobinTransport.php b/vendor/symfony/mailer/Transport/RoundRobinTransport.php deleted file mode 100644 index c5587bb2..00000000 --- a/vendor/symfony/mailer/Transport/RoundRobinTransport.php +++ /dev/null @@ -1,125 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\Transport; - -use Symfony\Component\Mailer\Envelope; -use Symfony\Component\Mailer\Exception\TransportException; -use Symfony\Component\Mailer\Exception\TransportExceptionInterface; -use Symfony\Component\Mailer\SentMessage; -use Symfony\Component\Mime\RawMessage; - -/** - * Uses several Transports using a round robin algorithm. - * - * @author Fabien Potencier - */ -class RoundRobinTransport implements TransportInterface -{ - /** - * @var \SplObjectStorage - */ - private \SplObjectStorage $deadTransports; - private array $transports = []; - private int $retryPeriod; - private int $cursor = -1; - - /** - * @param TransportInterface[] $transports - */ - public function __construct(array $transports, int $retryPeriod = 60) - { - if (!$transports) { - throw new TransportException(sprintf('"%s" must have at least one transport configured.', static::class)); - } - - $this->transports = $transports; - $this->deadTransports = new \SplObjectStorage(); - $this->retryPeriod = $retryPeriod; - } - - public function send(RawMessage $message, Envelope $envelope = null): ?SentMessage - { - $exception = null; - - while ($transport = $this->getNextTransport()) { - try { - return $transport->send($message, $envelope); - } catch (TransportExceptionInterface $e) { - $exception ??= new TransportException('All transports failed.'); - $exception->appendDebug(sprintf("Transport \"%s\": %s\n", $transport, $e->getDebug())); - $this->deadTransports[$transport] = microtime(true); - } - } - - throw $exception ?? new TransportException('No transports found.'); - } - - public function __toString(): string - { - return $this->getNameSymbol().'('.implode(' ', array_map('strval', $this->transports)).')'; - } - - /** - * Rotates the transport list around and returns the first instance. - */ - protected function getNextTransport(): ?TransportInterface - { - if (-1 === $this->cursor) { - $this->cursor = $this->getInitialCursor(); - } - - $cursor = $this->cursor; - while (true) { - $transport = $this->transports[$cursor]; - - if (!$this->isTransportDead($transport)) { - break; - } - - if ((microtime(true) - $this->deadTransports[$transport]) > $this->retryPeriod) { - $this->deadTransports->detach($transport); - - break; - } - - if ($this->cursor === $cursor = $this->moveCursor($cursor)) { - return null; - } - } - - $this->cursor = $this->moveCursor($cursor); - - return $transport; - } - - protected function isTransportDead(TransportInterface $transport): bool - { - return $this->deadTransports->contains($transport); - } - - protected function getInitialCursor(): int - { - // the cursor initial value is randomized so that - // when are not in a daemon, we are still rotating the transports - return mt_rand(0, \count($this->transports) - 1); - } - - protected function getNameSymbol(): string - { - return 'roundrobin'; - } - - private function moveCursor(int $cursor): int - { - return ++$cursor >= \count($this->transports) ? 0 : $cursor; - } -} diff --git a/vendor/symfony/mailer/Transport/SendmailTransport.php b/vendor/symfony/mailer/Transport/SendmailTransport.php deleted file mode 100644 index c5296339..00000000 --- a/vendor/symfony/mailer/Transport/SendmailTransport.php +++ /dev/null @@ -1,123 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\Transport; - -use Psr\EventDispatcher\EventDispatcherInterface; -use Psr\Log\LoggerInterface; -use Symfony\Component\Mailer\Envelope; -use Symfony\Component\Mailer\SentMessage; -use Symfony\Component\Mailer\Transport\Smtp\SmtpTransport; -use Symfony\Component\Mailer\Transport\Smtp\Stream\AbstractStream; -use Symfony\Component\Mailer\Transport\Smtp\Stream\ProcessStream; -use Symfony\Component\Mime\RawMessage; - -/** - * SendmailTransport for sending mail through a Sendmail/Postfix (etc..) binary. - * - * Transport can be instantiated through SendmailTransportFactory or NativeTransportFactory: - * - * - SendmailTransportFactory to use most common sendmail path and recommended options - * - NativeTransportFactory when configuration is set via php.ini - * - * @author Fabien Potencier - * @author Chris Corbyn - */ -class SendmailTransport extends AbstractTransport -{ - private string $command = '/usr/sbin/sendmail -bs'; - private ProcessStream $stream; - private ?SmtpTransport $transport = null; - - /** - * Constructor. - * - * Supported modes are -bs and -t, with any additional flags desired. - * - * The recommended mode is "-bs" since it is interactive and failure notifications are hence possible. - * Note that the -t mode does not support error reporting and does not support Bcc properly (the Bcc headers are not removed). - * - * If using -t mode, you are strongly advised to include -oi or -i in the flags (like /usr/sbin/sendmail -oi -t) - * - * -f flag will be appended automatically if one is not present. - */ - public function __construct(string $command = null, EventDispatcherInterface $dispatcher = null, LoggerInterface $logger = null) - { - parent::__construct($dispatcher, $logger); - - if (null !== $command) { - if (!str_contains($command, ' -bs') && !str_contains($command, ' -t')) { - throw new \InvalidArgumentException(sprintf('Unsupported sendmail command flags "%s"; must be one of "-bs" or "-t" but can include additional flags.', $command)); - } - - $this->command = $command; - } - - $this->stream = new ProcessStream(); - if (str_contains($this->command, ' -bs')) { - $this->stream->setCommand($this->command); - $this->transport = new SmtpTransport($this->stream, $dispatcher, $logger); - } - } - - public function send(RawMessage $message, Envelope $envelope = null): ?SentMessage - { - if ($this->transport) { - return $this->transport->send($message, $envelope); - } - - return parent::send($message, $envelope); - } - - public function __toString(): string - { - if ($this->transport) { - return (string) $this->transport; - } - - return 'smtp://sendmail'; - } - - protected function doSend(SentMessage $message): void - { - $this->getLogger()->debug(sprintf('Email transport "%s" starting', __CLASS__)); - - $command = $this->command; - - if ($recipients = $message->getEnvelope()->getRecipients()) { - $command = str_replace(' -t', '', $command); - } - - if (!str_contains($command, ' -f')) { - $command .= ' -f'.escapeshellarg($message->getEnvelope()->getSender()->getEncodedAddress()); - } - - $chunks = AbstractStream::replace("\r\n", "\n", $message->toIterable()); - - if (!str_contains($command, ' -i') && !str_contains($command, ' -oi')) { - $chunks = AbstractStream::replace("\n.", "\n..", $chunks); - } - - foreach ($recipients as $recipient) { - $command .= ' '.escapeshellarg($recipient->getEncodedAddress()); - } - - $this->stream->setCommand($command); - $this->stream->initialize(); - foreach ($chunks as $chunk) { - $this->stream->write($chunk); - } - $this->stream->flush(); - $this->stream->terminate(); - - $this->getLogger()->debug(sprintf('Email transport "%s" stopped', __CLASS__)); - } -} diff --git a/vendor/symfony/mailer/Transport/SendmailTransportFactory.php b/vendor/symfony/mailer/Transport/SendmailTransportFactory.php deleted file mode 100644 index 6d977e74..00000000 --- a/vendor/symfony/mailer/Transport/SendmailTransportFactory.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\Transport; - -use Symfony\Component\Mailer\Exception\UnsupportedSchemeException; - -/** - * @author Konstantin Myakshin - */ -final class SendmailTransportFactory extends AbstractTransportFactory -{ - public function create(Dsn $dsn): TransportInterface - { - if ('sendmail+smtp' === $dsn->getScheme() || 'sendmail' === $dsn->getScheme()) { - return new SendmailTransport($dsn->getOption('command'), $this->dispatcher, $this->logger); - } - - throw new UnsupportedSchemeException($dsn, 'sendmail', $this->getSupportedSchemes()); - } - - protected function getSupportedSchemes(): array - { - return ['sendmail', 'sendmail+smtp']; - } -} diff --git a/vendor/symfony/mailer/Transport/Smtp/Auth/AuthenticatorInterface.php b/vendor/symfony/mailer/Transport/Smtp/Auth/AuthenticatorInterface.php deleted file mode 100644 index 98ea2d44..00000000 --- a/vendor/symfony/mailer/Transport/Smtp/Auth/AuthenticatorInterface.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\Transport\Smtp\Auth; - -use Symfony\Component\Mailer\Exception\TransportExceptionInterface; -use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport; - -/** - * An Authentication mechanism. - * - * @author Chris Corbyn - */ -interface AuthenticatorInterface -{ - /** - * Tries to authenticate the user. - * - * @throws TransportExceptionInterface - */ - public function authenticate(EsmtpTransport $client): void; - - /** - * Gets the name of the AUTH mechanism this Authenticator handles. - */ - public function getAuthKeyword(): string; -} diff --git a/vendor/symfony/mailer/Transport/Smtp/Auth/CramMd5Authenticator.php b/vendor/symfony/mailer/Transport/Smtp/Auth/CramMd5Authenticator.php deleted file mode 100644 index aa2d2b7f..00000000 --- a/vendor/symfony/mailer/Transport/Smtp/Auth/CramMd5Authenticator.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\Transport\Smtp\Auth; - -use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport; - -/** - * Handles CRAM-MD5 authentication. - * - * @author Chris Corbyn - */ -class CramMd5Authenticator implements AuthenticatorInterface -{ - public function getAuthKeyword(): string - { - return 'CRAM-MD5'; - } - - /** - * @see https://www.ietf.org/rfc/rfc4954.txt - */ - public function authenticate(EsmtpTransport $client): void - { - $challenge = $client->executeCommand("AUTH CRAM-MD5\r\n", [334]); - $challenge = base64_decode(substr($challenge, 4)); - $message = base64_encode($client->getUsername().' '.$this->getResponse($client->getPassword(), $challenge)); - $client->executeCommand(sprintf("%s\r\n", $message), [235]); - } - - /** - * Generates a CRAM-MD5 response from a server challenge. - */ - private function getResponse(#[\SensitiveParameter] string $secret, string $challenge): string - { - if (\strlen($secret) > 64) { - $secret = pack('H32', md5($secret)); - } - - if (\strlen($secret) < 64) { - $secret = str_pad($secret, 64, \chr(0)); - } - - $kipad = substr($secret, 0, 64) ^ str_repeat(\chr(0x36), 64); - $kopad = substr($secret, 0, 64) ^ str_repeat(\chr(0x5C), 64); - - $inner = pack('H32', md5($kipad.$challenge)); - $digest = md5($kopad.$inner); - - return $digest; - } -} diff --git a/vendor/symfony/mailer/Transport/Smtp/Auth/LoginAuthenticator.php b/vendor/symfony/mailer/Transport/Smtp/Auth/LoginAuthenticator.php deleted file mode 100644 index e0b7d577..00000000 --- a/vendor/symfony/mailer/Transport/Smtp/Auth/LoginAuthenticator.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\Mailer\Transport\Smtp\Auth; - -use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport; - -/** - * Handles LOGIN authentication. - * - * @author Chris Corbyn - */ -class LoginAuthenticator implements AuthenticatorInterface -{ - public function getAuthKeyword(): string - { - return 'LOGIN'; - } - - /** - * @see https://www.ietf.org/rfc/rfc4954.txt - */ - public function authenticate(EsmtpTransport $client): void - { - $client->executeCommand("AUTH LOGIN\r\n", [334]); - $client->executeCommand(sprintf("%s\r\n", base64_encode($client->getUsername())), [334]); - $client->executeCommand(sprintf("%s\r\n", base64_encode($client->getPassword())), [235]); - } -} diff --git a/vendor/symfony/mailer/Transport/Smtp/Auth/PlainAuthenticator.php b/vendor/symfony/mailer/Transport/Smtp/Auth/PlainAuthenticator.php deleted file mode 100644 index 6b680b51..00000000 --- a/vendor/symfony/mailer/Transport/Smtp/Auth/PlainAuthenticator.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\Transport\Smtp\Auth; - -use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport; - -/** - * Handles PLAIN authentication. - * - * @author Chris Corbyn - */ -class PlainAuthenticator implements AuthenticatorInterface -{ - public function getAuthKeyword(): string - { - return 'PLAIN'; - } - - /** - * @see https://www.ietf.org/rfc/rfc4954.txt - */ - public function authenticate(EsmtpTransport $client): void - { - $client->executeCommand(sprintf("AUTH PLAIN %s\r\n", base64_encode($client->getUsername().\chr(0).$client->getUsername().\chr(0).$client->getPassword())), [235]); - } -} diff --git a/vendor/symfony/mailer/Transport/Smtp/Auth/XOAuth2Authenticator.php b/vendor/symfony/mailer/Transport/Smtp/Auth/XOAuth2Authenticator.php deleted file mode 100644 index c3aaa490..00000000 --- a/vendor/symfony/mailer/Transport/Smtp/Auth/XOAuth2Authenticator.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\Mailer\Transport\Smtp\Auth; - -use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport; - -/** - * Handles XOAUTH2 authentication. - * - * @author xu.li - * - * @see https://developers.google.com/google-apps/gmail/xoauth2_protocol - */ -class XOAuth2Authenticator implements AuthenticatorInterface -{ - public function getAuthKeyword(): string - { - return 'XOAUTH2'; - } - - /** - * @see https://developers.google.com/google-apps/gmail/xoauth2_protocol#the_sasl_xoauth2_mechanism - */ - public function authenticate(EsmtpTransport $client): void - { - $client->executeCommand('AUTH XOAUTH2 '.base64_encode('user='.$client->getUsername()."\1auth=Bearer ".$client->getPassword()."\1\1")."\r\n", [235]); - } -} diff --git a/vendor/symfony/mailer/Transport/Smtp/EsmtpTransport.php b/vendor/symfony/mailer/Transport/Smtp/EsmtpTransport.php deleted file mode 100644 index 0dfe9d19..00000000 --- a/vendor/symfony/mailer/Transport/Smtp/EsmtpTransport.php +++ /dev/null @@ -1,214 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\Transport\Smtp; - -use Psr\EventDispatcher\EventDispatcherInterface; -use Psr\Log\LoggerInterface; -use Symfony\Component\Mailer\Exception\TransportException; -use Symfony\Component\Mailer\Exception\TransportExceptionInterface; -use Symfony\Component\Mailer\Transport\Smtp\Auth\AuthenticatorInterface; -use Symfony\Component\Mailer\Transport\Smtp\Stream\AbstractStream; -use Symfony\Component\Mailer\Transport\Smtp\Stream\SocketStream; - -/** - * Sends Emails over SMTP with ESMTP support. - * - * @author Fabien Potencier - * @author Chris Corbyn - */ -class EsmtpTransport extends SmtpTransport -{ - private array $authenticators = []; - private string $username = ''; - private string $password = ''; - private array $capabilities; - - public function __construct(string $host = 'localhost', int $port = 0, bool $tls = null, EventDispatcherInterface $dispatcher = null, LoggerInterface $logger = null, AbstractStream $stream = null) - { - parent::__construct($stream, $dispatcher, $logger); - - // order is important here (roughly most secure and popular first) - $this->authenticators = [ - new Auth\CramMd5Authenticator(), - new Auth\LoginAuthenticator(), - new Auth\PlainAuthenticator(), - new Auth\XOAuth2Authenticator(), - ]; - - /** @var SocketStream $stream */ - $stream = $this->getStream(); - - if (null === $tls) { - if (465 === $port) { - $tls = true; - } else { - $tls = \defined('OPENSSL_VERSION_NUMBER') && 0 === $port && 'localhost' !== $host; - } - } - if (!$tls) { - $stream->disableTls(); - } - if (0 === $port) { - $port = $tls ? 465 : 25; - } - - $stream->setHost($host); - $stream->setPort($port); - } - - /** - * @return $this - */ - public function setUsername(string $username): static - { - $this->username = $username; - - return $this; - } - - public function getUsername(): string - { - return $this->username; - } - - /** - * @return $this - */ - public function setPassword(#[\SensitiveParameter] string $password): static - { - $this->password = $password; - - return $this; - } - - public function getPassword(): string - { - return $this->password; - } - - public function addAuthenticator(AuthenticatorInterface $authenticator): void - { - $this->authenticators[] = $authenticator; - } - - public function executeCommand(string $command, array $codes): string - { - return [250] === $codes && str_starts_with($command, 'HELO ') ? $this->doEhloCommand() : parent::executeCommand($command, $codes); - } - - final protected function getCapabilities(): array - { - return $this->capabilities; - } - - private function doEhloCommand(): string - { - try { - $response = $this->executeCommand(sprintf("EHLO %s\r\n", $this->getLocalDomain()), [250]); - } catch (TransportExceptionInterface $e) { - try { - return parent::executeCommand(sprintf("HELO %s\r\n", $this->getLocalDomain()), [250]); - } catch (TransportExceptionInterface $ex) { - if (!$ex->getCode()) { - throw $e; - } - - throw $ex; - } - } - - $this->capabilities = $this->parseCapabilities($response); - - /** @var SocketStream $stream */ - $stream = $this->getStream(); - // WARNING: !$stream->isTLS() is right, 100% sure :) - // if you think that the ! should be removed, read the code again - // if doing so "fixes" your issue then it probably means your SMTP server behaves incorrectly or is wrongly configured - if (!$stream->isTLS() && \defined('OPENSSL_VERSION_NUMBER') && \array_key_exists('STARTTLS', $this->capabilities)) { - $this->executeCommand("STARTTLS\r\n", [220]); - - if (!$stream->startTLS()) { - throw new TransportException('Unable to connect with STARTTLS.'); - } - - $response = $this->executeCommand(sprintf("EHLO %s\r\n", $this->getLocalDomain()), [250]); - $this->capabilities = $this->parseCapabilities($response); - } - - if (\array_key_exists('AUTH', $this->capabilities)) { - $this->handleAuth($this->capabilities['AUTH']); - } - - return $response; - } - - private function parseCapabilities(string $ehloResponse): array - { - $capabilities = []; - $lines = explode("\r\n", trim($ehloResponse)); - array_shift($lines); - foreach ($lines as $line) { - if (preg_match('/^[0-9]{3}[ -]([A-Z0-9-]+)((?:[ =].*)?)$/Di', $line, $matches)) { - $value = strtoupper(ltrim($matches[2], ' =')); - $capabilities[strtoupper($matches[1])] = $value ? explode(' ', $value) : []; - } - } - - return $capabilities; - } - - private function handleAuth(array $modes): void - { - if (!$this->username) { - return; - } - - $authNames = []; - $errors = []; - $modes = array_map('strtolower', $modes); - foreach ($this->authenticators as $authenticator) { - if (!\in_array(strtolower($authenticator->getAuthKeyword()), $modes, true)) { - continue; - } - - $code = null; - $authNames[] = $authenticator->getAuthKeyword(); - try { - $authenticator->authenticate($this); - - return; - } catch (TransportExceptionInterface $e) { - $code = $e->getCode(); - - try { - $this->executeCommand("RSET\r\n", [250]); - } catch (TransportExceptionInterface) { - // ignore this exception as it probably means that the server error was final - } - - // keep the error message, but tries the other authenticators - $errors[$authenticator->getAuthKeyword()] = $e->getMessage(); - } - } - - if (!$authNames) { - throw new TransportException(sprintf('Failed to find an authenticator supported by the SMTP server, which currently supports: "%s".', implode('", "', $modes)), $code ?: 504); - } - - $message = sprintf('Failed to authenticate on SMTP server with username "%s" using the following authenticators: "%s".', $this->username, implode('", "', $authNames)); - foreach ($errors as $name => $error) { - $message .= sprintf(' Authenticator "%s" returned "%s".', $name, $error); - } - - throw new TransportException($message, $code ?: 535); - } -} diff --git a/vendor/symfony/mailer/Transport/Smtp/EsmtpTransportFactory.php b/vendor/symfony/mailer/Transport/Smtp/EsmtpTransportFactory.php deleted file mode 100644 index 7dfa395f..00000000 --- a/vendor/symfony/mailer/Transport/Smtp/EsmtpTransportFactory.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\Transport\Smtp; - -use Symfony\Component\Mailer\Transport\AbstractTransportFactory; -use Symfony\Component\Mailer\Transport\Dsn; -use Symfony\Component\Mailer\Transport\Smtp\Stream\SocketStream; -use Symfony\Component\Mailer\Transport\TransportInterface; - -/** - * @author Konstantin Myakshin - */ -final class EsmtpTransportFactory extends AbstractTransportFactory -{ - public function create(Dsn $dsn): TransportInterface - { - $tls = 'smtps' === $dsn->getScheme() ? true : null; - $port = $dsn->getPort(0); - $host = $dsn->getHost(); - - $transport = new EsmtpTransport($host, $port, $tls, $this->dispatcher, $this->logger); - - if ('' !== $dsn->getOption('verify_peer') && !filter_var($dsn->getOption('verify_peer', true), \FILTER_VALIDATE_BOOL)) { - /** @var SocketStream $stream */ - $stream = $transport->getStream(); - $streamOptions = $stream->getStreamOptions(); - - $streamOptions['ssl']['verify_peer'] = false; - $streamOptions['ssl']['verify_peer_name'] = false; - - $stream->setStreamOptions($streamOptions); - } - - if ($user = $dsn->getUser()) { - $transport->setUsername($user); - } - - if ($password = $dsn->getPassword()) { - $transport->setPassword($password); - } - - if (null !== ($localDomain = $dsn->getOption('local_domain'))) { - $transport->setLocalDomain($localDomain); - } - - if (null !== ($maxPerSecond = $dsn->getOption('max_per_second'))) { - $transport->setMaxPerSecond((float) $maxPerSecond); - } - - if (null !== ($restartThreshold = $dsn->getOption('restart_threshold'))) { - $transport->setRestartThreshold((int) $restartThreshold, (int) $dsn->getOption('restart_threshold_sleep', 0)); - } - - if (null !== ($pingThreshold = $dsn->getOption('ping_threshold'))) { - $transport->setPingThreshold((int) $pingThreshold); - } - - return $transport; - } - - protected function getSupportedSchemes(): array - { - return ['smtp', 'smtps']; - } -} diff --git a/vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php b/vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php deleted file mode 100644 index 675528ce..00000000 --- a/vendor/symfony/mailer/Transport/Smtp/SmtpTransport.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\Mailer\Transport\Smtp; - -use Psr\EventDispatcher\EventDispatcherInterface; -use Psr\Log\LoggerInterface; -use Symfony\Component\Mailer\Envelope; -use Symfony\Component\Mailer\Exception\LogicException; -use Symfony\Component\Mailer\Exception\TransportException; -use Symfony\Component\Mailer\Exception\TransportExceptionInterface; -use Symfony\Component\Mailer\SentMessage; -use Symfony\Component\Mailer\Transport\AbstractTransport; -use Symfony\Component\Mailer\Transport\Smtp\Stream\AbstractStream; -use Symfony\Component\Mailer\Transport\Smtp\Stream\SocketStream; -use Symfony\Component\Mime\RawMessage; - -/** - * Sends emails over SMTP. - * - * @author Fabien Potencier - * @author Chris Corbyn - */ -class SmtpTransport extends AbstractTransport -{ - private bool $started = false; - private int $restartThreshold = 100; - private int $restartThresholdSleep = 0; - private int $restartCounter = 0; - private int $pingThreshold = 100; - private float $lastMessageTime = 0; - private AbstractStream $stream; - private string $mtaResult = ''; - private string $domain = '[127.0.0.1]'; - - public function __construct(AbstractStream $stream = null, EventDispatcherInterface $dispatcher = null, LoggerInterface $logger = null) - { - parent::__construct($dispatcher, $logger); - - $this->stream = $stream ?? new SocketStream(); - } - - public function getStream(): AbstractStream - { - return $this->stream; - } - - /** - * Sets the maximum number of messages to send before re-starting the transport. - * - * By default, the threshold is set to 100 (and no sleep at restart). - * - * @param int $threshold The maximum number of messages (0 to disable) - * @param int $sleep The number of seconds to sleep between stopping and re-starting the transport - * - * @return $this - */ - public function setRestartThreshold(int $threshold, int $sleep = 0): static - { - $this->restartThreshold = $threshold; - $this->restartThresholdSleep = $sleep; - - return $this; - } - - /** - * Sets the minimum number of seconds required between two messages, before the server is pinged. - * If the transport wants to send a message and the time since the last message exceeds the specified threshold, - * the transport will ping the server first (NOOP command) to check if the connection is still alive. - * Otherwise the message will be sent without pinging the server first. - * - * Do not set the threshold too low, as the SMTP server may drop the connection if there are too many - * non-mail commands (like pinging the server with NOOP). - * - * By default, the threshold is set to 100 seconds. - * - * @param int $seconds The minimum number of seconds between two messages required to ping the server - * - * @return $this - */ - public function setPingThreshold(int $seconds): static - { - $this->pingThreshold = $seconds; - - return $this; - } - - /** - * Sets the name of the local domain that will be used in HELO. - * - * This should be a fully-qualified domain name and should be truly the domain - * you're using. - * - * If your server does not have a domain name, use the IP address. This will - * automatically be wrapped in square brackets as described in RFC 5321, - * section 4.1.3. - * - * @return $this - */ - public function setLocalDomain(string $domain): static - { - if ('' !== $domain && '[' !== $domain[0]) { - if (filter_var($domain, \FILTER_VALIDATE_IP, \FILTER_FLAG_IPV4)) { - $domain = '['.$domain.']'; - } elseif (filter_var($domain, \FILTER_VALIDATE_IP, \FILTER_FLAG_IPV6)) { - $domain = '[IPv6:'.$domain.']'; - } - } - - $this->domain = $domain; - - return $this; - } - - /** - * Gets the name of the domain that will be used in HELO. - * - * If an IP address was specified, this will be returned wrapped in square - * brackets as described in RFC 5321, section 4.1.3. - */ - public function getLocalDomain(): string - { - return $this->domain; - } - - public function send(RawMessage $message, Envelope $envelope = null): ?SentMessage - { - try { - $message = parent::send($message, $envelope); - } catch (TransportExceptionInterface $e) { - if ($this->started) { - try { - $this->executeCommand("RSET\r\n", [250]); - } catch (TransportExceptionInterface) { - // ignore this exception as it probably means that the server error was final - } - } - - throw $e; - } - - if ($this->mtaResult && $messageId = $this->parseMessageId($this->mtaResult)) { - $message->setMessageId($messageId); - } - - $this->checkRestartThreshold(); - - return $message; - } - - protected function parseMessageId(string $mtaResult): string - { - $regexps = [ - '/250 Ok (?P[0-9a-f-]+)\r?$/mis', - '/250 Ok:? queued as (?P[A-Z0-9]+)\r?$/mis', - ]; - $matches = []; - foreach ($regexps as $regexp) { - if (preg_match($regexp, $mtaResult, $matches)) { - return $matches['id']; - } - } - - return ''; - } - - public function __toString(): string - { - if ($this->stream instanceof SocketStream) { - $name = sprintf('smtp%s://%s', ($tls = $this->stream->isTLS()) ? 's' : '', $this->stream->getHost()); - $port = $this->stream->getPort(); - if (!(25 === $port || ($tls && 465 === $port))) { - $name .= ':'.$port; - } - - return $name; - } - - return 'smtp://sendmail'; - } - - /** - * Runs a command against the stream, expecting the given response codes. - * - * @param int[] $codes - * - * @throws TransportException when an invalid response if received - */ - public function executeCommand(string $command, array $codes): string - { - $this->stream->write($command); - $response = $this->getFullResponse(); - $this->assertResponseCode($response, $codes); - - return $response; - } - - protected function doSend(SentMessage $message): void - { - if (microtime(true) - $this->lastMessageTime > $this->pingThreshold) { - $this->ping(); - } - - if (!$this->started) { - $this->start(); - } - - try { - $envelope = $message->getEnvelope(); - $this->doMailFromCommand($envelope->getSender()->getEncodedAddress()); - foreach ($envelope->getRecipients() as $recipient) { - $this->doRcptToCommand($recipient->getEncodedAddress()); - } - - $this->executeCommand("DATA\r\n", [354]); - try { - foreach (AbstractStream::replace("\r\n.", "\r\n..", $message->toIterable()) as $chunk) { - $this->stream->write($chunk, false); - } - $this->stream->flush(); - } catch (TransportExceptionInterface $e) { - throw $e; - } catch (\Exception $e) { - $this->stream->terminate(); - $this->started = false; - $this->getLogger()->debug(sprintf('Email transport "%s" stopped', __CLASS__)); - throw $e; - } - $this->mtaResult = $this->executeCommand("\r\n.\r\n", [250]); - $message->appendDebug($this->stream->getDebug()); - $this->lastMessageTime = microtime(true); - } catch (TransportExceptionInterface $e) { - $e->appendDebug($this->stream->getDebug()); - $this->lastMessageTime = 0; - throw $e; - } - } - - /** - * @internal since version 6.1, to be made private in 7.0 - * @final since version 6.1, to be made private in 7.0 - */ - protected function doHeloCommand(): void - { - $this->executeCommand(sprintf("HELO %s\r\n", $this->domain), [250]); - } - - private function doMailFromCommand(string $address): void - { - $this->executeCommand(sprintf("MAIL FROM:<%s>\r\n", $address), [250]); - } - - private function doRcptToCommand(string $address): void - { - $this->executeCommand(sprintf("RCPT TO:<%s>\r\n", $address), [250, 251, 252]); - } - - public function start(): void - { - if ($this->started) { - return; - } - - $this->getLogger()->debug(sprintf('Email transport "%s" starting', __CLASS__)); - - $this->stream->initialize(); - $this->assertResponseCode($this->getFullResponse(), [220]); - $this->doHeloCommand(); - $this->started = true; - $this->lastMessageTime = 0; - - $this->getLogger()->debug(sprintf('Email transport "%s" started', __CLASS__)); - } - - /** - * Manually disconnect from the SMTP server. - * - * In most cases this is not necessary since the disconnect happens automatically on termination. - * In cases of long-running scripts, this might however make sense to avoid keeping an open - * connection to the SMTP server in between sending emails. - */ - public function stop(): void - { - if (!$this->started) { - return; - } - - $this->getLogger()->debug(sprintf('Email transport "%s" stopping', __CLASS__)); - - try { - $this->executeCommand("QUIT\r\n", [221]); - } catch (TransportExceptionInterface) { - } finally { - $this->stream->terminate(); - $this->started = false; - $this->getLogger()->debug(sprintf('Email transport "%s" stopped', __CLASS__)); - } - } - - private function ping(): void - { - if (!$this->started) { - return; - } - - try { - $this->executeCommand("NOOP\r\n", [250]); - } catch (TransportExceptionInterface) { - $this->stop(); - } - } - - /** - * @throws TransportException if a response code is incorrect - */ - private function assertResponseCode(string $response, array $codes): void - { - if (!$codes) { - throw new LogicException('You must set the expected response code.'); - } - - [$code] = sscanf($response, '%3d'); - $valid = \in_array($code, $codes); - - if (!$valid || !$response) { - $codeStr = $code ? sprintf('code "%s"', $code) : 'empty code'; - $responseStr = $response ? sprintf(', with message "%s"', trim($response)) : ''; - - throw new TransportException(sprintf('Expected response code "%s" but got ', implode('/', $codes)).$codeStr.$responseStr.'.', $code ?: 0); - } - } - - private function getFullResponse(): string - { - $response = ''; - do { - $line = $this->stream->readLine(); - $response .= $line; - } while ($line && isset($line[3]) && ' ' !== $line[3]); - - return $response; - } - - private function checkRestartThreshold(): void - { - // when using sendmail via non-interactive mode, the transport is never "started" - if (!$this->started) { - return; - } - - ++$this->restartCounter; - if ($this->restartCounter < $this->restartThreshold) { - return; - } - - $this->stop(); - if (0 < $sleep = $this->restartThresholdSleep) { - $this->getLogger()->debug(sprintf('Email transport "%s" sleeps for %d seconds after stopping', __CLASS__, $sleep)); - - sleep($sleep); - } - $this->start(); - $this->restartCounter = 0; - } - - public function __sleep(): array - { - throw new \BadMethodCallException('Cannot serialize '.__CLASS__); - } - - public function __wakeup() - { - throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); - } - - public function __destruct() - { - $this->stop(); - } -} diff --git a/vendor/symfony/mailer/Transport/Smtp/Stream/AbstractStream.php b/vendor/symfony/mailer/Transport/Smtp/Stream/AbstractStream.php deleted file mode 100644 index ecfb2199..00000000 --- a/vendor/symfony/mailer/Transport/Smtp/Stream/AbstractStream.php +++ /dev/null @@ -1,138 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\Transport\Smtp\Stream; - -use Symfony\Component\Mailer\Exception\TransportException; - -/** - * A stream supporting remote sockets and local processes. - * - * @author Fabien Potencier - * @author Nicolas Grekas - * @author Chris Corbyn - * - * @internal - */ -abstract class AbstractStream -{ - protected $stream; - protected $in; - protected $out; - - private string $debug = ''; - - public function write(string $bytes, bool $debug = true): void - { - if ($debug) { - foreach (explode("\n", trim($bytes)) as $line) { - $this->debug .= sprintf("> %s\n", $line); - } - } - - $bytesToWrite = \strlen($bytes); - $totalBytesWritten = 0; - while ($totalBytesWritten < $bytesToWrite) { - $bytesWritten = @fwrite($this->in, substr($bytes, $totalBytesWritten)); - if (false === $bytesWritten || 0 === $bytesWritten) { - throw new TransportException('Unable to write bytes on the wire.'); - } - - $totalBytesWritten += $bytesWritten; - } - } - - /** - * Flushes the contents of the stream (empty it) and set the internal pointer to the beginning. - */ - public function flush(): void - { - fflush($this->in); - } - - /** - * Performs any initialization needed. - */ - abstract public function initialize(): void; - - public function terminate(): void - { - $this->stream = $this->out = $this->in = null; - } - - public function readLine(): string - { - if (feof($this->out)) { - return ''; - } - - $line = fgets($this->out); - if ('' === $line || false === $line) { - $metas = stream_get_meta_data($this->out); - if ($metas['timed_out']) { - throw new TransportException(sprintf('Connection to "%s" timed out.', $this->getReadConnectionDescription())); - } - if ($metas['eof']) { - throw new TransportException(sprintf('Connection to "%s" has been closed unexpectedly.', $this->getReadConnectionDescription())); - } - } - - $this->debug .= sprintf('< %s', $line); - - return $line; - } - - public function getDebug(): string - { - $debug = $this->debug; - $this->debug = ''; - - return $debug; - } - - public static function replace(string $from, string $to, iterable $chunks): \Generator - { - if ('' === $from) { - yield from $chunks; - - return; - } - - $carry = ''; - $fromLen = \strlen($from); - - foreach ($chunks as $chunk) { - if ('' === $chunk = $carry.$chunk) { - continue; - } - - if (str_contains($chunk, $from)) { - $chunk = explode($from, $chunk); - $carry = array_pop($chunk); - - yield implode($to, $chunk).$to; - } else { - $carry = $chunk; - } - - if (\strlen($carry) > $fromLen) { - yield substr($carry, 0, -$fromLen); - $carry = substr($carry, -$fromLen); - } - } - - if ('' !== $carry) { - yield $carry; - } - } - - abstract protected function getReadConnectionDescription(): string; -} diff --git a/vendor/symfony/mailer/Transport/Smtp/Stream/ProcessStream.php b/vendor/symfony/mailer/Transport/Smtp/Stream/ProcessStream.php deleted file mode 100644 index d178bc8b..00000000 --- a/vendor/symfony/mailer/Transport/Smtp/Stream/ProcessStream.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\Transport\Smtp\Stream; - -use Symfony\Component\Mailer\Exception\TransportException; - -/** - * A stream supporting local processes. - * - * @author Fabien Potencier - * @author Chris Corbyn - * - * @internal - */ -final class ProcessStream extends AbstractStream -{ - private string $command; - - public function setCommand(string $command) - { - $this->command = $command; - } - - public function initialize(): void - { - $descriptorSpec = [ - 0 => ['pipe', 'r'], - 1 => ['pipe', 'w'], - 2 => ['pipe', 'w'], - ]; - $pipes = []; - $this->stream = proc_open($this->command, $descriptorSpec, $pipes); - stream_set_blocking($pipes[2], false); - if ($err = stream_get_contents($pipes[2])) { - throw new TransportException('Process could not be started: '.$err); - } - $this->in = &$pipes[0]; - $this->out = &$pipes[1]; - } - - public function terminate(): void - { - if (null !== $this->stream) { - fclose($this->in); - fclose($this->out); - proc_close($this->stream); - } - - parent::terminate(); - } - - protected function getReadConnectionDescription(): string - { - return 'process '.$this->command; - } -} diff --git a/vendor/symfony/mailer/Transport/Smtp/Stream/SocketStream.php b/vendor/symfony/mailer/Transport/Smtp/Stream/SocketStream.php deleted file mode 100644 index 24267307..00000000 --- a/vendor/symfony/mailer/Transport/Smtp/Stream/SocketStream.php +++ /dev/null @@ -1,193 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\Transport\Smtp\Stream; - -use Symfony\Component\Mailer\Exception\TransportException; - -/** - * A stream supporting remote sockets. - * - * @author Fabien Potencier - * @author Chris Corbyn - * - * @internal - */ -final class SocketStream extends AbstractStream -{ - private string $url; - private string $host = 'localhost'; - private int $port = 465; - private float $timeout; - private bool $tls = true; - private ?string $sourceIp = null; - private array $streamContextOptions = []; - - /** - * @return $this - */ - public function setTimeout(float $timeout): static - { - $this->timeout = $timeout; - - return $this; - } - - public function getTimeout(): float - { - return $this->timeout ?? (float) \ini_get('default_socket_timeout'); - } - - /** - * Literal IPv6 addresses should be wrapped in square brackets. - * - * @return $this - */ - public function setHost(string $host): static - { - $this->host = $host; - - return $this; - } - - public function getHost(): string - { - return $this->host; - } - - /** - * @return $this - */ - public function setPort(int $port): static - { - $this->port = $port; - - return $this; - } - - public function getPort(): int - { - return $this->port; - } - - /** - * Sets the TLS/SSL on the socket (disables STARTTLS). - * - * @return $this - */ - public function disableTls(): static - { - $this->tls = false; - - return $this; - } - - public function isTLS(): bool - { - return $this->tls; - } - - /** - * @return $this - */ - public function setStreamOptions(array $options): static - { - $this->streamContextOptions = $options; - - return $this; - } - - public function getStreamOptions(): array - { - return $this->streamContextOptions; - } - - /** - * Sets the source IP. - * - * IPv6 addresses should be wrapped in square brackets. - * - * @return $this - */ - public function setSourceIp(string $ip): static - { - $this->sourceIp = $ip; - - return $this; - } - - /** - * Returns the IP used to connect to the destination. - */ - public function getSourceIp(): ?string - { - return $this->sourceIp; - } - - public function initialize(): void - { - $this->url = $this->host.':'.$this->port; - if ($this->tls) { - $this->url = 'ssl://'.$this->url; - } - $options = []; - if ($this->sourceIp) { - $options['socket']['bindto'] = $this->sourceIp.':0'; - } - if ($this->streamContextOptions) { - $options = array_merge($options, $this->streamContextOptions); - } - // do it unconditionnally as it will be used by STARTTLS as well if supported - $options['ssl']['crypto_method'] ??= \STREAM_CRYPTO_METHOD_TLS_CLIENT | \STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT | \STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT; - $streamContext = stream_context_create($options); - - $timeout = $this->getTimeout(); - set_error_handler(function ($type, $msg) { - throw new TransportException(sprintf('Connection could not be established with host "%s": ', $this->url).$msg); - }); - try { - $this->stream = stream_socket_client($this->url, $errno, $errstr, $timeout, \STREAM_CLIENT_CONNECT, $streamContext); - } finally { - restore_error_handler(); - } - - stream_set_blocking($this->stream, true); - stream_set_timeout($this->stream, $timeout); - $this->in = &$this->stream; - $this->out = &$this->stream; - } - - public function startTLS(): bool - { - set_error_handler(function ($type, $msg) { - throw new TransportException('Unable to connect with STARTTLS: '.$msg); - }); - try { - return stream_socket_enable_crypto($this->stream, true); - } finally { - restore_error_handler(); - } - } - - public function terminate(): void - { - if (null !== $this->stream) { - fclose($this->stream); - } - - parent::terminate(); - } - - protected function getReadConnectionDescription(): string - { - return $this->url; - } -} diff --git a/vendor/symfony/mailer/Transport/TransportFactoryInterface.php b/vendor/symfony/mailer/Transport/TransportFactoryInterface.php deleted file mode 100644 index 9785ae81..00000000 --- a/vendor/symfony/mailer/Transport/TransportFactoryInterface.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\Transport; - -use Symfony\Component\Mailer\Exception\IncompleteDsnException; -use Symfony\Component\Mailer\Exception\UnsupportedSchemeException; - -/** - * @author Konstantin Myakshin - */ -interface TransportFactoryInterface -{ - /** - * @throws UnsupportedSchemeException - * @throws IncompleteDsnException - */ - public function create(Dsn $dsn): TransportInterface; - - public function supports(Dsn $dsn): bool; -} diff --git a/vendor/symfony/mailer/Transport/TransportInterface.php b/vendor/symfony/mailer/Transport/TransportInterface.php deleted file mode 100644 index ed562cfe..00000000 --- a/vendor/symfony/mailer/Transport/TransportInterface.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\Transport; - -use Symfony\Component\Mailer\Envelope; -use Symfony\Component\Mailer\Exception\TransportExceptionInterface; -use Symfony\Component\Mailer\SentMessage; -use Symfony\Component\Mime\RawMessage; - -/** - * Interface for all mailer transports. - * - * When sending emails, you should prefer MailerInterface implementations - * as they allow asynchronous sending. - * - * @author Fabien Potencier - */ -interface TransportInterface -{ - /** - * @throws TransportExceptionInterface - */ - public function send(RawMessage $message, Envelope $envelope = null): ?SentMessage; - - public function __toString(): string; -} diff --git a/vendor/symfony/mailer/Transport/Transports.php b/vendor/symfony/mailer/Transport/Transports.php deleted file mode 100644 index 1beaa883..00000000 --- a/vendor/symfony/mailer/Transport/Transports.php +++ /dev/null @@ -1,75 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mailer\Transport; - -use Symfony\Component\Mailer\Envelope; -use Symfony\Component\Mailer\Exception\InvalidArgumentException; -use Symfony\Component\Mailer\Exception\LogicException; -use Symfony\Component\Mailer\SentMessage; -use Symfony\Component\Mime\Message; -use Symfony\Component\Mime\RawMessage; - -/** - * @author Fabien Potencier - */ -final class Transports implements TransportInterface -{ - /** - * @var array - */ - private array $transports = []; - private TransportInterface $default; - - /** - * @param iterable $transports - */ - public function __construct(iterable $transports) - { - foreach ($transports as $name => $transport) { - $this->default ??= $transport; - $this->transports[$name] = $transport; - } - - if (!$this->transports) { - throw new LogicException(sprintf('"%s" must have at least one transport configured.', __CLASS__)); - } - } - - public function send(RawMessage $message, Envelope $envelope = null): ?SentMessage - { - /** @var Message $message */ - if (RawMessage::class === $message::class || !$message->getHeaders()->has('X-Transport')) { - return $this->default->send($message, $envelope); - } - - $headers = $message->getHeaders(); - $transport = $headers->get('X-Transport')->getBody(); - $headers->remove('X-Transport'); - - if (!isset($this->transports[$transport])) { - throw new InvalidArgumentException(sprintf('The "%s" transport does not exist (available transports: "%s").', $transport, implode('", "', array_keys($this->transports)))); - } - - try { - return $this->transports[$transport]->send($message, $envelope); - } catch (\Throwable $e) { - $headers->addTextHeader('X-Transport', $transport); - - throw $e; - } - } - - public function __toString(): string - { - return '['.implode(',', array_keys($this->transports)).']'; - } -} diff --git a/vendor/symfony/mailer/composer.json b/vendor/symfony/mailer/composer.json deleted file mode 100644 index e83a4aad..00000000 --- a/vendor/symfony/mailer/composer.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "symfony/mailer", - "type": "library", - "description": "Helps sending emails", - "keywords": [], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.1", - "egulias/email-validator": "^2.1.10|^3", - "psr/event-dispatcher": "^1", - "psr/log": "^1|^2|^3", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/mime": "^6.2", - "symfony/service-contracts": "^1.1|^2|^3" - }, - "require-dev": { - "symfony/console": "^5.4|^6.0", - "symfony/http-client-contracts": "^1.1|^2|^3", - "symfony/messenger": "^6.2", - "symfony/twig-bridge": "^6.2" - }, - "conflict": { - "symfony/http-kernel": "<5.4", - "symfony/messenger": "<6.2", - "symfony/mime": "<6.2", - "symfony/twig-bridge": "<6.2.1" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\Mailer\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "minimum-stability": "dev" -} diff --git a/vendor/symfony/mime/Address.php b/vendor/symfony/mime/Address.php deleted file mode 100644 index dabdc3ee..00000000 --- a/vendor/symfony/mime/Address.php +++ /dev/null @@ -1,120 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime; - -use Egulias\EmailValidator\EmailValidator; -use Egulias\EmailValidator\Validation\MessageIDValidation; -use Egulias\EmailValidator\Validation\RFCValidation; -use Symfony\Component\Mime\Encoder\IdnAddressEncoder; -use Symfony\Component\Mime\Exception\InvalidArgumentException; -use Symfony\Component\Mime\Exception\LogicException; -use Symfony\Component\Mime\Exception\RfcComplianceException; - -/** - * @author Fabien Potencier - */ -final class Address -{ - /** - * A regex that matches a structure like 'Name '. - * It matches anything between the first < and last > as email address. - * This allows to use a single string to construct an Address, which can be convenient to use in - * config, and allows to have more readable config. - * This does not try to cover all edge cases for address. - */ - private const FROM_STRING_PATTERN = '~(?[^<]*)<(?.*)>[^>]*~'; - - private static EmailValidator $validator; - private static IdnAddressEncoder $encoder; - - private string $address; - private string $name; - - public function __construct(string $address, string $name = '') - { - if (!class_exists(EmailValidator::class)) { - throw new LogicException(sprintf('The "%s" class cannot be used as it needs "%s"; try running "composer require egulias/email-validator".', __CLASS__, EmailValidator::class)); - } - - self::$validator ??= new EmailValidator(); - - $this->address = trim($address); - $this->name = trim(str_replace(["\n", "\r"], '', $name)); - - if (!self::$validator->isValid($this->address, class_exists(MessageIDValidation::class) ? new MessageIDValidation() : new RFCValidation())) { - throw new RfcComplianceException(sprintf('Email "%s" does not comply with addr-spec of RFC 2822.', $address)); - } - } - - public function getAddress(): string - { - return $this->address; - } - - public function getName(): string - { - return $this->name; - } - - public function getEncodedAddress(): string - { - self::$encoder ??= new IdnAddressEncoder(); - - return self::$encoder->encodeString($this->address); - } - - public function toString(): string - { - return ($n = $this->getEncodedName()) ? $n.' <'.$this->getEncodedAddress().'>' : $this->getEncodedAddress(); - } - - public function getEncodedName(): string - { - if ('' === $this->getName()) { - return ''; - } - - return sprintf('"%s"', preg_replace('/"/u', '\"', $this->getName())); - } - - public static function create(self|string $address): self - { - if ($address instanceof self) { - return $address; - } - - if (!str_contains($address, '<')) { - return new self($address); - } - - if (!preg_match(self::FROM_STRING_PATTERN, $address, $matches)) { - throw new InvalidArgumentException(sprintf('Could not parse "%s" to a "%s" instance.', $address, self::class)); - } - - return new self($matches['addrSpec'], trim($matches['displayName'], ' \'"')); - } - - /** - * @param array $addresses - * - * @return Address[] - */ - public static function createArray(array $addresses): array - { - $addrs = []; - foreach ($addresses as $address) { - $addrs[] = self::create($address); - } - - return $addrs; - } -} diff --git a/vendor/symfony/mime/BodyRendererInterface.php b/vendor/symfony/mime/BodyRendererInterface.php deleted file mode 100644 index d6921726..00000000 --- a/vendor/symfony/mime/BodyRendererInterface.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. - */ - -namespace Symfony\Component\Mime; - -/** - * @author Fabien Potencier - */ -interface BodyRendererInterface -{ - public function render(Message $message): void; -} diff --git a/vendor/symfony/mime/CHANGELOG.md b/vendor/symfony/mime/CHANGELOG.md deleted file mode 100644 index 83214ee6..00000000 --- a/vendor/symfony/mime/CHANGELOG.md +++ /dev/null @@ -1,44 +0,0 @@ -CHANGELOG -========= - -6.2 ---- - - * Add `File` - * Deprecate `Email::attachPart()`, use `addPart()` instead - * Deprecate calling `Message::setBody()` without arguments - -6.1 ---- - - * Add `DataPart::getFilename()` and `DataPart::getContentType()` - -6.0 ---- - - * Remove `Address::fromString()`, use `Address::create()` instead - * Remove `Serializable` interface from `RawMessage` - -5.2.0 ------ - - * Add support for DKIM - * Deprecated `Address::fromString()`, use `Address::create()` instead - -4.4.0 ------ - - * [BC BREAK] Removed `NamedAddress` (`Address` now supports a name) - * Added PHPUnit constraints - * Added `AbstractPart::asDebugString()` - * Added `Address::fromString()` - -4.3.3 ------ - - * [BC BREAK] Renamed method `Headers::getAll()` to `Headers::all()`. - -4.3.0 ------ - - * Introduced the component as experimental diff --git a/vendor/symfony/mime/CharacterStream.php b/vendor/symfony/mime/CharacterStream.php deleted file mode 100644 index 21d7bc5f..00000000 --- a/vendor/symfony/mime/CharacterStream.php +++ /dev/null @@ -1,211 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime; - -/** - * @author Fabien Potencier - * @author Xavier De Cock - * - * @internal - */ -final class CharacterStream -{ - /** Pre-computed for optimization */ - private const UTF8_LENGTH_MAP = [ - "\x00" => 1, "\x01" => 1, "\x02" => 1, "\x03" => 1, "\x04" => 1, "\x05" => 1, "\x06" => 1, "\x07" => 1, - "\x08" => 1, "\x09" => 1, "\x0a" => 1, "\x0b" => 1, "\x0c" => 1, "\x0d" => 1, "\x0e" => 1, "\x0f" => 1, - "\x10" => 1, "\x11" => 1, "\x12" => 1, "\x13" => 1, "\x14" => 1, "\x15" => 1, "\x16" => 1, "\x17" => 1, - "\x18" => 1, "\x19" => 1, "\x1a" => 1, "\x1b" => 1, "\x1c" => 1, "\x1d" => 1, "\x1e" => 1, "\x1f" => 1, - "\x20" => 1, "\x21" => 1, "\x22" => 1, "\x23" => 1, "\x24" => 1, "\x25" => 1, "\x26" => 1, "\x27" => 1, - "\x28" => 1, "\x29" => 1, "\x2a" => 1, "\x2b" => 1, "\x2c" => 1, "\x2d" => 1, "\x2e" => 1, "\x2f" => 1, - "\x30" => 1, "\x31" => 1, "\x32" => 1, "\x33" => 1, "\x34" => 1, "\x35" => 1, "\x36" => 1, "\x37" => 1, - "\x38" => 1, "\x39" => 1, "\x3a" => 1, "\x3b" => 1, "\x3c" => 1, "\x3d" => 1, "\x3e" => 1, "\x3f" => 1, - "\x40" => 1, "\x41" => 1, "\x42" => 1, "\x43" => 1, "\x44" => 1, "\x45" => 1, "\x46" => 1, "\x47" => 1, - "\x48" => 1, "\x49" => 1, "\x4a" => 1, "\x4b" => 1, "\x4c" => 1, "\x4d" => 1, "\x4e" => 1, "\x4f" => 1, - "\x50" => 1, "\x51" => 1, "\x52" => 1, "\x53" => 1, "\x54" => 1, "\x55" => 1, "\x56" => 1, "\x57" => 1, - "\x58" => 1, "\x59" => 1, "\x5a" => 1, "\x5b" => 1, "\x5c" => 1, "\x5d" => 1, "\x5e" => 1, "\x5f" => 1, - "\x60" => 1, "\x61" => 1, "\x62" => 1, "\x63" => 1, "\x64" => 1, "\x65" => 1, "\x66" => 1, "\x67" => 1, - "\x68" => 1, "\x69" => 1, "\x6a" => 1, "\x6b" => 1, "\x6c" => 1, "\x6d" => 1, "\x6e" => 1, "\x6f" => 1, - "\x70" => 1, "\x71" => 1, "\x72" => 1, "\x73" => 1, "\x74" => 1, "\x75" => 1, "\x76" => 1, "\x77" => 1, - "\x78" => 1, "\x79" => 1, "\x7a" => 1, "\x7b" => 1, "\x7c" => 1, "\x7d" => 1, "\x7e" => 1, "\x7f" => 1, - "\x80" => 0, "\x81" => 0, "\x82" => 0, "\x83" => 0, "\x84" => 0, "\x85" => 0, "\x86" => 0, "\x87" => 0, - "\x88" => 0, "\x89" => 0, "\x8a" => 0, "\x8b" => 0, "\x8c" => 0, "\x8d" => 0, "\x8e" => 0, "\x8f" => 0, - "\x90" => 0, "\x91" => 0, "\x92" => 0, "\x93" => 0, "\x94" => 0, "\x95" => 0, "\x96" => 0, "\x97" => 0, - "\x98" => 0, "\x99" => 0, "\x9a" => 0, "\x9b" => 0, "\x9c" => 0, "\x9d" => 0, "\x9e" => 0, "\x9f" => 0, - "\xa0" => 0, "\xa1" => 0, "\xa2" => 0, "\xa3" => 0, "\xa4" => 0, "\xa5" => 0, "\xa6" => 0, "\xa7" => 0, - "\xa8" => 0, "\xa9" => 0, "\xaa" => 0, "\xab" => 0, "\xac" => 0, "\xad" => 0, "\xae" => 0, "\xaf" => 0, - "\xb0" => 0, "\xb1" => 0, "\xb2" => 0, "\xb3" => 0, "\xb4" => 0, "\xb5" => 0, "\xb6" => 0, "\xb7" => 0, - "\xb8" => 0, "\xb9" => 0, "\xba" => 0, "\xbb" => 0, "\xbc" => 0, "\xbd" => 0, "\xbe" => 0, "\xbf" => 0, - "\xc0" => 2, "\xc1" => 2, "\xc2" => 2, "\xc3" => 2, "\xc4" => 2, "\xc5" => 2, "\xc6" => 2, "\xc7" => 2, - "\xc8" => 2, "\xc9" => 2, "\xca" => 2, "\xcb" => 2, "\xcc" => 2, "\xcd" => 2, "\xce" => 2, "\xcf" => 2, - "\xd0" => 2, "\xd1" => 2, "\xd2" => 2, "\xd3" => 2, "\xd4" => 2, "\xd5" => 2, "\xd6" => 2, "\xd7" => 2, - "\xd8" => 2, "\xd9" => 2, "\xda" => 2, "\xdb" => 2, "\xdc" => 2, "\xdd" => 2, "\xde" => 2, "\xdf" => 2, - "\xe0" => 3, "\xe1" => 3, "\xe2" => 3, "\xe3" => 3, "\xe4" => 3, "\xe5" => 3, "\xe6" => 3, "\xe7" => 3, - "\xe8" => 3, "\xe9" => 3, "\xea" => 3, "\xeb" => 3, "\xec" => 3, "\xed" => 3, "\xee" => 3, "\xef" => 3, - "\xf0" => 4, "\xf1" => 4, "\xf2" => 4, "\xf3" => 4, "\xf4" => 4, "\xf5" => 4, "\xf6" => 4, "\xf7" => 4, - "\xf8" => 5, "\xf9" => 5, "\xfa" => 5, "\xfb" => 5, "\xfc" => 6, "\xfd" => 6, "\xfe" => 0, "\xff" => 0, - ]; - - private string $data = ''; - private int $dataSize = 0; - private array $map = []; - private int $charCount = 0; - private int $currentPos = 0; - private int $fixedWidth = 0; - - /** - * @param resource|string $input - */ - public function __construct($input, ?string $charset = 'utf-8') - { - $charset = strtolower(trim($charset)) ?: 'utf-8'; - if ('utf-8' === $charset || 'utf8' === $charset) { - $this->fixedWidth = 0; - $this->map = ['p' => [], 'i' => []]; - } else { - $this->fixedWidth = match ($charset) { - // 16 bits - 'ucs2', - 'ucs-2', - 'utf16', - 'utf-16' => 2, - // 32 bits - 'ucs4', - 'ucs-4', - 'utf32', - 'utf-32' => 4, - // 7-8 bit charsets: (us-)?ascii, (iso|iec)-?8859-?[0-9]+, windows-?125[0-9], cp-?[0-9]+, ansi, macintosh, - // koi-?7, koi-?8-?.+, mik, (cork|t1), v?iscii - // and fallback - default => 1, - }; - } - if (\is_resource($input)) { - $blocks = 16372; - while (false !== $read = fread($input, $blocks)) { - $this->write($read); - } - } else { - $this->write($input); - } - } - - public function read(int $length): ?string - { - if ($this->currentPos >= $this->charCount) { - return null; - } - $length = ($this->currentPos + $length > $this->charCount) ? $this->charCount - $this->currentPos : $length; - if ($this->fixedWidth > 0) { - $len = $length * $this->fixedWidth; - $ret = substr($this->data, $this->currentPos * $this->fixedWidth, $len); - $this->currentPos += $length; - } else { - $end = $this->currentPos + $length; - $end = $end > $this->charCount ? $this->charCount : $end; - $ret = ''; - $start = 0; - if ($this->currentPos > 0) { - $start = $this->map['p'][$this->currentPos - 1]; - } - $to = $start; - for (; $this->currentPos < $end; ++$this->currentPos) { - if (isset($this->map['i'][$this->currentPos])) { - $ret .= substr($this->data, $start, $to - $start).'?'; - $start = $this->map['p'][$this->currentPos]; - } else { - $to = $this->map['p'][$this->currentPos]; - } - } - $ret .= substr($this->data, $start, $to - $start); - } - - return $ret; - } - - public function readBytes(int $length): ?array - { - if (null !== $read = $this->read($length)) { - return array_map('ord', str_split($read, 1)); - } - - return null; - } - - public function setPointer(int $charOffset): void - { - if ($this->charCount < $charOffset) { - $charOffset = $this->charCount; - } - $this->currentPos = $charOffset; - } - - public function write(string $chars): void - { - $ignored = ''; - $this->data .= $chars; - if ($this->fixedWidth > 0) { - $strlen = \strlen($chars); - $ignoredL = $strlen % $this->fixedWidth; - $ignored = $ignoredL ? substr($chars, -$ignoredL) : ''; - $this->charCount += ($strlen - $ignoredL) / $this->fixedWidth; - } else { - $this->charCount += $this->getUtf8CharPositions($chars, $this->dataSize, $ignored); - } - $this->dataSize = \strlen($this->data) - \strlen($ignored); - } - - private function getUtf8CharPositions(string $string, int $startOffset, string &$ignoredChars): int - { - $strlen = \strlen($string); - $charPos = \count($this->map['p']); - $foundChars = 0; - $invalid = false; - for ($i = 0; $i < $strlen; ++$i) { - $char = $string[$i]; - $size = self::UTF8_LENGTH_MAP[$char]; - if (0 == $size) { - /* char is invalid, we must wait for a resync */ - $invalid = true; - continue; - } - - if ($invalid) { - /* We mark the chars as invalid and start a new char */ - $this->map['p'][$charPos + $foundChars] = $startOffset + $i; - $this->map['i'][$charPos + $foundChars] = true; - ++$foundChars; - $invalid = false; - } - if (($i + $size) > $strlen) { - $ignoredChars = substr($string, $i); - break; - } - for ($j = 1; $j < $size; ++$j) { - $char = $string[$i + $j]; - if ($char > "\x7F" && $char < "\xC0") { - // Valid - continue parsing - } else { - /* char is invalid, we must wait for a resync */ - $invalid = true; - continue 2; - } - } - /* Ok we got a complete char here */ - $this->map['p'][$charPos + $foundChars] = $startOffset + $i + $size; - $i += $j - 1; - ++$foundChars; - } - - return $foundChars; - } -} diff --git a/vendor/symfony/mime/Crypto/DkimOptions.php b/vendor/symfony/mime/Crypto/DkimOptions.php deleted file mode 100644 index cee4e7cb..00000000 --- a/vendor/symfony/mime/Crypto/DkimOptions.php +++ /dev/null @@ -1,97 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime\Crypto; - -/** - * A helper providing autocompletion for available DkimSigner options. - * - * @author Fabien Potencier - */ -final class DkimOptions -{ - private array $options = []; - - public function toArray(): array - { - return $this->options; - } - - /** - * @return $this - */ - public function algorithm(string $algo): static - { - $this->options['algorithm'] = $algo; - - return $this; - } - - /** - * @return $this - */ - public function signatureExpirationDelay(int $show): static - { - $this->options['signature_expiration_delay'] = $show; - - return $this; - } - - /** - * @return $this - */ - public function bodyMaxLength(int $max): static - { - $this->options['body_max_length'] = $max; - - return $this; - } - - /** - * @return $this - */ - public function bodyShowLength(bool $show): static - { - $this->options['body_show_length'] = $show; - - return $this; - } - - /** - * @return $this - */ - public function headerCanon(string $canon): static - { - $this->options['header_canon'] = $canon; - - return $this; - } - - /** - * @return $this - */ - public function bodyCanon(string $canon): static - { - $this->options['body_canon'] = $canon; - - return $this; - } - - /** - * @return $this - */ - public function headersToIgnore(array $headers): static - { - $this->options['headers_to_ignore'] = $headers; - - return $this; - } -} diff --git a/vendor/symfony/mime/Crypto/DkimSigner.php b/vendor/symfony/mime/Crypto/DkimSigner.php deleted file mode 100644 index 1d2005e5..00000000 --- a/vendor/symfony/mime/Crypto/DkimSigner.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\Component\Mime\Crypto; - -use Symfony\Component\Mime\Exception\InvalidArgumentException; -use Symfony\Component\Mime\Exception\RuntimeException; -use Symfony\Component\Mime\Header\UnstructuredHeader; -use Symfony\Component\Mime\Message; -use Symfony\Component\Mime\Part\AbstractPart; - -/** - * @author Fabien Potencier - * - * RFC 6376 and 8301 - */ -final class DkimSigner -{ - public const CANON_SIMPLE = 'simple'; - public const CANON_RELAXED = 'relaxed'; - - public const ALGO_SHA256 = 'rsa-sha256'; - public const ALGO_ED25519 = 'ed25519-sha256'; // RFC 8463 - - private \OpenSSLAsymmetricKey $key; - private string $domainName; - private string $selector; - private array $defaultOptions; - - /** - * @param string $pk The private key as a string or the path to the file containing the private key, should be prefixed with file:// (in PEM format) - * @param string $passphrase A passphrase of the private key (if any) - */ - public function __construct(string $pk, string $domainName, string $selector, array $defaultOptions = [], string $passphrase = '') - { - if (!\extension_loaded('openssl')) { - throw new \LogicException('PHP extension "openssl" is required to use DKIM.'); - } - $this->key = openssl_pkey_get_private($pk, $passphrase) ?: throw new InvalidArgumentException('Unable to load DKIM private key: '.openssl_error_string()); - $this->domainName = $domainName; - $this->selector = $selector; - $this->defaultOptions = $defaultOptions + [ - 'algorithm' => self::ALGO_SHA256, - 'signature_expiration_delay' => 0, - 'body_max_length' => \PHP_INT_MAX, - 'body_show_length' => false, - 'header_canon' => self::CANON_RELAXED, - 'body_canon' => self::CANON_RELAXED, - 'headers_to_ignore' => [], - ]; - } - - public function sign(Message $message, array $options = []): Message - { - $options += $this->defaultOptions; - if (!\in_array($options['algorithm'], [self::ALGO_SHA256, self::ALGO_ED25519], true)) { - throw new InvalidArgumentException(sprintf('Invalid DKIM signing algorithm "%s".', $options['algorithm'])); - } - $headersToIgnore['return-path'] = true; - $headersToIgnore['x-transport'] = true; - foreach ($options['headers_to_ignore'] as $name) { - $headersToIgnore[strtolower($name)] = true; - } - unset($headersToIgnore['from']); - $signedHeaderNames = []; - $headerCanonData = ''; - $headers = $message->getPreparedHeaders(); - foreach ($headers->getNames() as $name) { - foreach ($headers->all($name) as $header) { - if (isset($headersToIgnore[strtolower($header->getName())])) { - continue; - } - - if ('' !== $header->getBodyAsString()) { - $headerCanonData .= $this->canonicalizeHeader($header->toString(), $options['header_canon']); - $signedHeaderNames[] = $header->getName(); - } - } - } - - [$bodyHash, $bodyLength] = $this->hashBody($message->getBody(), $options['body_canon'], $options['body_max_length']); - - $params = [ - 'v' => '1', - 'q' => 'dns/txt', - 'a' => $options['algorithm'], - 'bh' => base64_encode($bodyHash), - 'd' => $this->domainName, - 'h' => implode(': ', $signedHeaderNames), - 'i' => '@'.$this->domainName, - 's' => $this->selector, - 't' => time(), - 'c' => $options['header_canon'].'/'.$options['body_canon'], - ]; - - if ($options['body_show_length']) { - $params['l'] = $bodyLength; - } - if ($options['signature_expiration_delay']) { - $params['x'] = $params['t'] + $options['signature_expiration_delay']; - } - $value = ''; - foreach ($params as $k => $v) { - $value .= $k.'='.$v.'; '; - } - $value = trim($value); - $header = new UnstructuredHeader('DKIM-Signature', $value); - $headerCanonData .= rtrim($this->canonicalizeHeader($header->toString()."\r\n b=", $options['header_canon'])); - if (self::ALGO_SHA256 === $options['algorithm']) { - if (!openssl_sign($headerCanonData, $signature, $this->key, \OPENSSL_ALGO_SHA256)) { - throw new RuntimeException('Unable to sign DKIM hash: '.openssl_error_string()); - } - } else { - throw new \RuntimeException(sprintf('The "%s" DKIM signing algorithm is not supported yet.', self::ALGO_ED25519)); - } - $header->setValue($value.' b='.trim(chunk_split(base64_encode($signature), 73, ' '))); - $headers->add($header); - - return new Message($headers, $message->getBody()); - } - - private function canonicalizeHeader(string $header, string $headerCanon): string - { - if (self::CANON_RELAXED !== $headerCanon) { - return $header."\r\n"; - } - - $exploded = explode(':', $header, 2); - $name = strtolower(trim($exploded[0])); - $value = str_replace("\r\n", '', $exploded[1]); - $value = trim(preg_replace("/[ \t][ \t]+/", ' ', $value)); - - return $name.':'.$value."\r\n"; - } - - private function hashBody(AbstractPart $body, string $bodyCanon, int $maxLength): array - { - $hash = hash_init('sha256'); - $relaxed = self::CANON_RELAXED === $bodyCanon; - $currentLine = ''; - $emptyCounter = 0; - $isSpaceSequence = false; - $length = 0; - foreach ($body->bodyToIterable() as $chunk) { - $canon = ''; - for ($i = 0, $len = \strlen($chunk); $i < $len; ++$i) { - switch ($chunk[$i]) { - case "\r": - break; - case "\n": - // previous char is always \r - if ($relaxed) { - $isSpaceSequence = false; - } - if ('' === $currentLine) { - ++$emptyCounter; - } else { - $currentLine = ''; - $canon .= "\r\n"; - } - break; - case ' ': - case "\t": - if ($relaxed) { - $isSpaceSequence = true; - break; - } - // no break - default: - if ($emptyCounter > 0) { - $canon .= str_repeat("\r\n", $emptyCounter); - $emptyCounter = 0; - } - if ($isSpaceSequence) { - $currentLine .= ' '; - $canon .= ' '; - $isSpaceSequence = false; - } - $currentLine .= $chunk[$i]; - $canon .= $chunk[$i]; - } - } - - if ($length + \strlen($canon) >= $maxLength) { - $canon = substr($canon, 0, $maxLength - $length); - $length += \strlen($canon); - hash_update($hash, $canon); - - break; - } - - $length += \strlen($canon); - hash_update($hash, $canon); - } - - // Add trailing Line return if last line is non empty - if ('' !== $currentLine) { - hash_update($hash, "\r\n"); - $length += \strlen("\r\n"); - } - - if (!$relaxed && 0 === $length) { - hash_update($hash, "\r\n"); - $length = 2; - } - - return [hash_final($hash, true), $length]; - } -} diff --git a/vendor/symfony/mime/Crypto/SMime.php b/vendor/symfony/mime/Crypto/SMime.php deleted file mode 100644 index cba95f21..00000000 --- a/vendor/symfony/mime/Crypto/SMime.php +++ /dev/null @@ -1,111 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime\Crypto; - -use Symfony\Component\Mime\Exception\RuntimeException; -use Symfony\Component\Mime\Part\SMimePart; - -/** - * @author Sebastiaan Stok - * - * @internal - */ -abstract class SMime -{ - protected function normalizeFilePath(string $path): string - { - if (!file_exists($path)) { - throw new RuntimeException(sprintf('File does not exist: "%s".', $path)); - } - - return 'file://'.str_replace('\\', '/', realpath($path)); - } - - protected function iteratorToFile(iterable $iterator, $stream): void - { - foreach ($iterator as $chunk) { - fwrite($stream, $chunk); - } - } - - protected function convertMessageToSMimePart($stream, string $type, string $subtype): SMimePart - { - rewind($stream); - - $headers = ''; - - while (!feof($stream)) { - $buffer = fread($stream, 78); - $headers .= $buffer; - - // Detect ending of header list - if (preg_match('/(\r\n\r\n|\n\n)/', $headers, $match)) { - $headersPosEnd = strpos($headers, $headerBodySeparator = $match[0]); - - break; - } - } - - $headers = $this->getMessageHeaders(trim(substr($headers, 0, $headersPosEnd))); - - fseek($stream, $headersPosEnd + \strlen($headerBodySeparator)); - - return new SMimePart($this->getStreamIterator($stream), $type, $subtype, $this->getParametersFromHeader($headers['content-type'])); - } - - protected function getStreamIterator($stream): iterable - { - while (!feof($stream)) { - yield str_replace("\n", "\r\n", str_replace("\r\n", "\n", fread($stream, 16372))); - } - } - - private function getMessageHeaders(string $headerData): array - { - $headers = []; - $headerLines = explode("\r\n", str_replace("\n", "\r\n", str_replace("\r\n", "\n", $headerData))); - $currentHeaderName = ''; - - // Transform header lines into an associative array - foreach ($headerLines as $headerLine) { - // Empty lines between headers indicate a new mime-entity - if ('' === $headerLine) { - break; - } - - // Handle headers that span multiple lines - if (!str_contains($headerLine, ':')) { - $headers[$currentHeaderName] .= ' '.trim($headerLine); - continue; - } - - $header = explode(':', $headerLine, 2); - $currentHeaderName = strtolower($header[0]); - $headers[$currentHeaderName] = trim($header[1]); - } - - return $headers; - } - - private function getParametersFromHeader(string $header): array - { - $params = []; - - preg_match_all('/(?P[a-z-0-9]+)=(?P"[^"]+"|(?:[^\s;]+|$))(?:\s+;)?/i', $header, $matches); - - foreach ($matches['value'] as $pos => $paramValue) { - $params[$matches['name'][$pos]] = trim($paramValue, '"'); - } - - return $params; - } -} diff --git a/vendor/symfony/mime/Crypto/SMimeEncrypter.php b/vendor/symfony/mime/Crypto/SMimeEncrypter.php deleted file mode 100644 index 7d5dfecd..00000000 --- a/vendor/symfony/mime/Crypto/SMimeEncrypter.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\Mime\Crypto; - -use Symfony\Component\Mime\Exception\RuntimeException; -use Symfony\Component\Mime\Message; - -/** - * @author Sebastiaan Stok - */ -final class SMimeEncrypter extends SMime -{ - private string|array $certs; - private int $cipher; - - /** - * @param string|string[] $certificate The path (or array of paths) of the file(s) containing the X.509 certificate(s) - * @param int|null $cipher A set of algorithms used to encrypt the message. Must be one of these PHP constants: https://www.php.net/manual/en/openssl.ciphers.php - */ - public function __construct(string|array $certificate, int $cipher = null) - { - if (!\extension_loaded('openssl')) { - throw new \LogicException('PHP extension "openssl" is required to use SMime.'); - } - - if (\is_array($certificate)) { - $this->certs = array_map($this->normalizeFilePath(...), $certificate); - } else { - $this->certs = $this->normalizeFilePath($certificate); - } - - $this->cipher = $cipher ?? \OPENSSL_CIPHER_AES_256_CBC; - } - - public function encrypt(Message $message): Message - { - $bufferFile = tmpfile(); - $outputFile = tmpfile(); - - $this->iteratorToFile($message->toIterable(), $bufferFile); - - if (!@openssl_pkcs7_encrypt(stream_get_meta_data($bufferFile)['uri'], stream_get_meta_data($outputFile)['uri'], $this->certs, [], 0, $this->cipher)) { - throw new RuntimeException(sprintf('Failed to encrypt S/Mime message. Error: "%s".', openssl_error_string())); - } - - $mimePart = $this->convertMessageToSMimePart($outputFile, 'application', 'pkcs7-mime'); - $mimePart->getHeaders() - ->addTextHeader('Content-Transfer-Encoding', 'base64') - ->addParameterizedHeader('Content-Disposition', 'attachment', ['name' => 'smime.p7m']) - ; - - return new Message($message->getHeaders(), $mimePart); - } -} diff --git a/vendor/symfony/mime/Crypto/SMimeSigner.php b/vendor/symfony/mime/Crypto/SMimeSigner.php deleted file mode 100644 index 79a61a27..00000000 --- a/vendor/symfony/mime/Crypto/SMimeSigner.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime\Crypto; - -use Symfony\Component\Mime\Exception\RuntimeException; -use Symfony\Component\Mime\Message; - -/** - * @author Sebastiaan Stok - */ -final class SMimeSigner extends SMime -{ - private string $signCertificate; - private string|array $signPrivateKey; - private int $signOptions; - private ?string $extraCerts; - - /** - * @param string $certificate The path of the file containing the signing certificate (in PEM format) - * @param string $privateKey The path of the file containing the private key (in PEM format) - * @param string|null $privateKeyPassphrase A passphrase of the private key (if any) - * @param string|null $extraCerts The path of the file containing intermediate certificates (in PEM format) needed by the signing certificate - * @param int|null $signOptions Bitwise operator options for openssl_pkcs7_sign() (@see https://secure.php.net/manual/en/openssl.pkcs7.flags.php) - */ - public function __construct(string $certificate, string $privateKey, string $privateKeyPassphrase = null, string $extraCerts = null, int $signOptions = null) - { - if (!\extension_loaded('openssl')) { - throw new \LogicException('PHP extension "openssl" is required to use SMime.'); - } - - $this->signCertificate = $this->normalizeFilePath($certificate); - - if (null !== $privateKeyPassphrase) { - $this->signPrivateKey = [$this->normalizeFilePath($privateKey), $privateKeyPassphrase]; - } else { - $this->signPrivateKey = $this->normalizeFilePath($privateKey); - } - - $this->signOptions = $signOptions ?? \PKCS7_DETACHED; - $this->extraCerts = $extraCerts ? realpath($extraCerts) : null; - } - - public function sign(Message $message): Message - { - $bufferFile = tmpfile(); - $outputFile = tmpfile(); - - $this->iteratorToFile($message->getBody()->toIterable(), $bufferFile); - - if (!@openssl_pkcs7_sign(stream_get_meta_data($bufferFile)['uri'], stream_get_meta_data($outputFile)['uri'], $this->signCertificate, $this->signPrivateKey, [], $this->signOptions, $this->extraCerts)) { - throw new RuntimeException(sprintf('Failed to sign S/Mime message. Error: "%s".', openssl_error_string())); - } - - return new Message($message->getHeaders(), $this->convertMessageToSMimePart($outputFile, 'multipart', 'signed')); - } -} diff --git a/vendor/symfony/mime/DependencyInjection/AddMimeTypeGuesserPass.php b/vendor/symfony/mime/DependencyInjection/AddMimeTypeGuesserPass.php deleted file mode 100644 index fd9a40f5..00000000 --- a/vendor/symfony/mime/DependencyInjection/AddMimeTypeGuesserPass.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime\DependencyInjection; - -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; - -/** - * Registers custom mime types guessers. - * - * @author Fabien Potencier - */ -class AddMimeTypeGuesserPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if ($container->has('mime_types')) { - $definition = $container->findDefinition('mime_types'); - foreach ($container->findTaggedServiceIds('mime.mime_type_guesser', true) as $id => $attributes) { - $definition->addMethodCall('registerGuesser', [new Reference($id)]); - } - } - } -} diff --git a/vendor/symfony/mime/DraftEmail.php b/vendor/symfony/mime/DraftEmail.php deleted file mode 100644 index a60fea17..00000000 --- a/vendor/symfony/mime/DraftEmail.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime; - -use Symfony\Component\Mime\Header\Headers; -use Symfony\Component\Mime\Part\AbstractPart; - -/** - * @author Kevin Bond - */ -class DraftEmail extends Email -{ - public function __construct(Headers $headers = null, AbstractPart $body = null) - { - parent::__construct($headers, $body); - - $this->getHeaders()->addTextHeader('X-Unsent', '1'); - } - - /** - * Override default behavior as draft emails do not require From/Sender/Date/Message-ID headers. - * These are added by the client that actually sends the email. - */ - public function getPreparedHeaders(): Headers - { - $headers = clone $this->getHeaders(); - - if (!$headers->has('MIME-Version')) { - $headers->addTextHeader('MIME-Version', '1.0'); - } - - $headers->remove('Bcc'); - - return $headers; - } -} diff --git a/vendor/symfony/mime/Email.php b/vendor/symfony/mime/Email.php deleted file mode 100644 index 9a60f421..00000000 --- a/vendor/symfony/mime/Email.php +++ /dev/null @@ -1,579 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime; - -use Symfony\Component\Mime\Exception\LogicException; -use Symfony\Component\Mime\Part\AbstractPart; -use Symfony\Component\Mime\Part\DataPart; -use Symfony\Component\Mime\Part\File; -use Symfony\Component\Mime\Part\Multipart\AlternativePart; -use Symfony\Component\Mime\Part\Multipart\MixedPart; -use Symfony\Component\Mime\Part\Multipart\RelatedPart; -use Symfony\Component\Mime\Part\TextPart; - -/** - * @author Fabien Potencier - */ -class Email extends Message -{ - public const PRIORITY_HIGHEST = 1; - public const PRIORITY_HIGH = 2; - public const PRIORITY_NORMAL = 3; - public const PRIORITY_LOW = 4; - public const PRIORITY_LOWEST = 5; - - private const PRIORITY_MAP = [ - self::PRIORITY_HIGHEST => 'Highest', - self::PRIORITY_HIGH => 'High', - self::PRIORITY_NORMAL => 'Normal', - self::PRIORITY_LOW => 'Low', - self::PRIORITY_LOWEST => 'Lowest', - ]; - - /** - * @var resource|string|null - */ - private $text; - - private ?string $textCharset = null; - - /** - * @var resource|string|null - */ - private $html; - - private ?string $htmlCharset = null; - private array $attachments = []; - private ?AbstractPart $cachedBody = null; // Used to avoid wrong body hash in DKIM signatures with multiple parts (e.g. HTML + TEXT) due to multiple boundaries. - - /** - * @return $this - */ - public function subject(string $subject): static - { - return $this->setHeaderBody('Text', 'Subject', $subject); - } - - public function getSubject(): ?string - { - return $this->getHeaders()->getHeaderBody('Subject'); - } - - /** - * @return $this - */ - public function date(\DateTimeInterface $dateTime): static - { - return $this->setHeaderBody('Date', 'Date', $dateTime); - } - - public function getDate(): ?\DateTimeImmutable - { - return $this->getHeaders()->getHeaderBody('Date'); - } - - /** - * @return $this - */ - public function returnPath(Address|string $address): static - { - return $this->setHeaderBody('Path', 'Return-Path', Address::create($address)); - } - - public function getReturnPath(): ?Address - { - return $this->getHeaders()->getHeaderBody('Return-Path'); - } - - /** - * @return $this - */ - public function sender(Address|string $address): static - { - return $this->setHeaderBody('Mailbox', 'Sender', Address::create($address)); - } - - public function getSender(): ?Address - { - return $this->getHeaders()->getHeaderBody('Sender'); - } - - /** - * @return $this - */ - public function addFrom(Address|string ...$addresses): static - { - return $this->addListAddressHeaderBody('From', $addresses); - } - - /** - * @return $this - */ - public function from(Address|string ...$addresses): static - { - return $this->setListAddressHeaderBody('From', $addresses); - } - - /** - * @return Address[] - */ - public function getFrom(): array - { - return $this->getHeaders()->getHeaderBody('From') ?: []; - } - - /** - * @return $this - */ - public function addReplyTo(Address|string ...$addresses): static - { - return $this->addListAddressHeaderBody('Reply-To', $addresses); - } - - /** - * @return $this - */ - public function replyTo(Address|string ...$addresses): static - { - return $this->setListAddressHeaderBody('Reply-To', $addresses); - } - - /** - * @return Address[] - */ - public function getReplyTo(): array - { - return $this->getHeaders()->getHeaderBody('Reply-To') ?: []; - } - - /** - * @return $this - */ - public function addTo(Address|string ...$addresses): static - { - return $this->addListAddressHeaderBody('To', $addresses); - } - - /** - * @return $this - */ - public function to(Address|string ...$addresses): static - { - return $this->setListAddressHeaderBody('To', $addresses); - } - - /** - * @return Address[] - */ - public function getTo(): array - { - return $this->getHeaders()->getHeaderBody('To') ?: []; - } - - /** - * @return $this - */ - public function addCc(Address|string ...$addresses): static - { - return $this->addListAddressHeaderBody('Cc', $addresses); - } - - /** - * @return $this - */ - public function cc(Address|string ...$addresses): static - { - return $this->setListAddressHeaderBody('Cc', $addresses); - } - - /** - * @return Address[] - */ - public function getCc(): array - { - return $this->getHeaders()->getHeaderBody('Cc') ?: []; - } - - /** - * @return $this - */ - public function addBcc(Address|string ...$addresses): static - { - return $this->addListAddressHeaderBody('Bcc', $addresses); - } - - /** - * @return $this - */ - public function bcc(Address|string ...$addresses): static - { - return $this->setListAddressHeaderBody('Bcc', $addresses); - } - - /** - * @return Address[] - */ - public function getBcc(): array - { - return $this->getHeaders()->getHeaderBody('Bcc') ?: []; - } - - /** - * Sets the priority of this message. - * - * The value is an integer where 1 is the highest priority and 5 is the lowest. - * - * @return $this - */ - public function priority(int $priority): static - { - if ($priority > 5) { - $priority = 5; - } elseif ($priority < 1) { - $priority = 1; - } - - return $this->setHeaderBody('Text', 'X-Priority', sprintf('%d (%s)', $priority, self::PRIORITY_MAP[$priority])); - } - - /** - * Get the priority of this message. - * - * The returned value is an integer where 1 is the highest priority and 5 - * is the lowest. - */ - public function getPriority(): int - { - [$priority] = sscanf($this->getHeaders()->getHeaderBody('X-Priority') ?? '', '%[1-5]'); - - return $priority ?? 3; - } - - /** - * @param resource|string|null $body - * - * @return $this - */ - public function text($body, string $charset = 'utf-8'): static - { - if (null !== $body && !\is_string($body) && !\is_resource($body)) { - throw new \TypeError(sprintf('The body must be a string, a resource or null (got "%s").', get_debug_type($body))); - } - - $this->cachedBody = null; - $this->text = $body; - $this->textCharset = $charset; - - return $this; - } - - /** - * @return resource|string|null - */ - public function getTextBody() - { - return $this->text; - } - - public function getTextCharset(): ?string - { - return $this->textCharset; - } - - /** - * @param resource|string|null $body - * - * @return $this - */ - public function html($body, string $charset = 'utf-8'): static - { - if (null !== $body && !\is_string($body) && !\is_resource($body)) { - throw new \TypeError(sprintf('The body must be a string, a resource or null (got "%s").', get_debug_type($body))); - } - - $this->cachedBody = null; - $this->html = $body; - $this->htmlCharset = $charset; - - return $this; - } - - /** - * @return resource|string|null - */ - public function getHtmlBody() - { - return $this->html; - } - - public function getHtmlCharset(): ?string - { - return $this->htmlCharset; - } - - /** - * @param resource|string $body - * - * @return $this - */ - public function attach($body, string $name = null, string $contentType = null): static - { - return $this->addPart(new DataPart($body, $name, $contentType)); - } - - /** - * @return $this - */ - public function attachFromPath(string $path, string $name = null, string $contentType = null): static - { - return $this->addPart(new DataPart(new File($path), $name, $contentType)); - } - - /** - * @param resource|string $body - * - * @return $this - */ - public function embed($body, string $name = null, string $contentType = null): static - { - return $this->addPart((new DataPart($body, $name, $contentType))->asInline()); - } - - /** - * @return $this - */ - public function embedFromPath(string $path, string $name = null, string $contentType = null): static - { - return $this->addPart((new DataPart(new File($path), $name, $contentType))->asInline()); - } - - /** - * @return $this - * - * @deprecated since Symfony 6.2, use addPart() instead - */ - public function attachPart(DataPart $part): static - { - @trigger_deprecation('symfony/mime', '6.2', 'The "%s()" method is deprecated, use "addPart()" instead.', __METHOD__); - - return $this->addPart($part); - } - - /** - * @return $this - */ - public function addPart(DataPart $part): static - { - $this->cachedBody = null; - $this->attachments[] = $part; - - return $this; - } - - /** - * @return DataPart[] - */ - public function getAttachments(): array - { - return $this->attachments; - } - - public function getBody(): AbstractPart - { - if (null !== $body = parent::getBody()) { - return $body; - } - - return $this->generateBody(); - } - - public function ensureValidity() - { - $this->ensureBodyValid(); - - if ('1' === $this->getHeaders()->getHeaderBody('X-Unsent')) { - throw new LogicException('Cannot send messages marked as "draft".'); - } - - parent::ensureValidity(); - } - - private function ensureBodyValid(): void - { - if (null === $this->text && null === $this->html && !$this->attachments) { - throw new LogicException('A message must have a text or an HTML part or attachments.'); - } - } - - /** - * Generates an AbstractPart based on the raw body of a message. - * - * The most "complex" part generated by this method is when there is text and HTML bodies - * with related images for the HTML part and some attachments: - * - * multipart/mixed - * | - * |------------> multipart/related - * | | - * | |------------> multipart/alternative - * | | | - * | | ------------> text/plain (with content) - * | | | - * | | ------------> text/html (with content) - * | | - * | ------------> image/png (with content) - * | - * ------------> application/pdf (with content) - */ - private function generateBody(): AbstractPart - { - if (null !== $this->cachedBody) { - return $this->cachedBody; - } - - $this->ensureBodyValid(); - - [$htmlPart, $otherParts, $relatedParts] = $this->prepareParts(); - - $part = null === $this->text ? null : new TextPart($this->text, $this->textCharset); - if (null !== $htmlPart) { - if (null !== $part) { - $part = new AlternativePart($part, $htmlPart); - } else { - $part = $htmlPart; - } - } - - if ($relatedParts) { - $part = new RelatedPart($part, ...$relatedParts); - } - - if ($otherParts) { - if ($part) { - $part = new MixedPart($part, ...$otherParts); - } else { - $part = new MixedPart(...$otherParts); - } - } - - return $this->cachedBody = $part; - } - - private function prepareParts(): ?array - { - $names = []; - $htmlPart = null; - $html = $this->html; - if (null !== $html) { - $htmlPart = new TextPart($html, $this->htmlCharset, 'html'); - $html = $htmlPart->getBody(); - - $regexes = [ - ']*src\s*=\s*(?:([\'"])cid:(.+?)\\1|cid:([^>\s]+))', - '<\w+\s+[^>]*background\s*=\s*(?:([\'"])cid:(.+?)\\1|cid:([^>\s]+))', - ]; - $tmpMatches = []; - foreach ($regexes as $regex) { - preg_match_all('/'.$regex.'/i', $html, $tmpMatches); - $names = array_merge($names, $tmpMatches[2], $tmpMatches[3]); - } - $names = array_filter(array_unique($names)); - } - - $otherParts = $relatedParts = []; - foreach ($this->attachments as $part) { - foreach ($names as $name) { - if ($name !== $part->getName()) { - continue; - } - if (isset($relatedParts[$name])) { - continue 2; - } - - $html = str_replace('cid:'.$name, 'cid:'.$part->getContentId(), $html, $count); - $relatedParts[$name] = $part; - $part->setName($part->getContentId())->asInline(); - - continue 2; - } - - $otherParts[] = $part; - } - if (null !== $htmlPart) { - $htmlPart = new TextPart($html, $this->htmlCharset, 'html'); - } - - return [$htmlPart, $otherParts, array_values($relatedParts)]; - } - - /** - * @return $this - */ - private function setHeaderBody(string $type, string $name, $body): static - { - $this->getHeaders()->setHeaderBody($type, $name, $body); - - return $this; - } - - private function addListAddressHeaderBody(string $name, array $addresses) - { - if (!$header = $this->getHeaders()->get($name)) { - return $this->setListAddressHeaderBody($name, $addresses); - } - $header->addAddresses(Address::createArray($addresses)); - - return $this; - } - - /** - * @return $this - */ - private function setListAddressHeaderBody(string $name, array $addresses): static - { - $addresses = Address::createArray($addresses); - $headers = $this->getHeaders(); - if ($header = $headers->get($name)) { - $header->setAddresses($addresses); - } else { - $headers->addMailboxListHeader($name, $addresses); - } - - return $this; - } - - /** - * @internal - */ - public function __serialize(): array - { - if (\is_resource($this->text)) { - $this->text = (new TextPart($this->text))->getBody(); - } - - if (\is_resource($this->html)) { - $this->html = (new TextPart($this->html))->getBody(); - } - - return [$this->text, $this->textCharset, $this->html, $this->htmlCharset, $this->attachments, parent::__serialize()]; - } - - /** - * @internal - */ - public function __unserialize(array $data): void - { - [$this->text, $this->textCharset, $this->html, $this->htmlCharset, $this->attachments, $parentData] = $data; - - parent::__unserialize($parentData); - } -} diff --git a/vendor/symfony/mime/Encoder/AddressEncoderInterface.php b/vendor/symfony/mime/Encoder/AddressEncoderInterface.php deleted file mode 100644 index de477d88..00000000 --- a/vendor/symfony/mime/Encoder/AddressEncoderInterface.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\Mime\Encoder; - -use Symfony\Component\Mime\Exception\AddressEncoderException; - -/** - * @author Christian Schmidt - */ -interface AddressEncoderInterface -{ - /** - * Encodes an email address. - * - * @throws AddressEncoderException if the email cannot be represented in - * the encoding implemented by this class - */ - public function encodeString(string $address): string; -} diff --git a/vendor/symfony/mime/Encoder/Base64ContentEncoder.php b/vendor/symfony/mime/Encoder/Base64ContentEncoder.php deleted file mode 100644 index 440868af..00000000 --- a/vendor/symfony/mime/Encoder/Base64ContentEncoder.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime\Encoder; - -use Symfony\Component\Mime\Exception\RuntimeException; - -/** - * @author Fabien Potencier - */ -final class Base64ContentEncoder extends Base64Encoder implements ContentEncoderInterface -{ - public function encodeByteStream($stream, int $maxLineLength = 0): iterable - { - if (!\is_resource($stream)) { - throw new \TypeError(sprintf('Method "%s" takes a stream as a first argument.', __METHOD__)); - } - - $filter = stream_filter_append($stream, 'convert.base64-encode', \STREAM_FILTER_READ, [ - 'line-length' => 0 >= $maxLineLength || 76 < $maxLineLength ? 76 : $maxLineLength, - 'line-break-chars' => "\r\n", - ]); - if (!\is_resource($filter)) { - throw new RuntimeException('Unable to set the base64 content encoder to the filter.'); - } - - while (!feof($stream)) { - yield fread($stream, 16372); - } - stream_filter_remove($filter); - } - - public function getName(): string - { - return 'base64'; - } -} diff --git a/vendor/symfony/mime/Encoder/Base64Encoder.php b/vendor/symfony/mime/Encoder/Base64Encoder.php deleted file mode 100644 index 71064785..00000000 --- a/vendor/symfony/mime/Encoder/Base64Encoder.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime\Encoder; - -/** - * @author Chris Corbyn - */ -class Base64Encoder implements EncoderInterface -{ - /** - * Takes an unencoded string and produces a Base64 encoded string from it. - * - * Base64 encoded strings have a maximum line length of 76 characters. - * If the first line needs to be shorter, indicate the difference with - * $firstLineOffset. - */ - public function encodeString(string $string, ?string $charset = 'utf-8', int $firstLineOffset = 0, int $maxLineLength = 0): string - { - if (0 >= $maxLineLength || 76 < $maxLineLength) { - $maxLineLength = 76; - } - - $encodedString = base64_encode($string); - $firstLine = ''; - if (0 !== $firstLineOffset) { - $firstLine = substr($encodedString, 0, $maxLineLength - $firstLineOffset)."\r\n"; - $encodedString = substr($encodedString, $maxLineLength - $firstLineOffset); - } - - return $firstLine.trim(chunk_split($encodedString, $maxLineLength, "\r\n")); - } -} diff --git a/vendor/symfony/mime/Encoder/Base64MimeHeaderEncoder.php b/vendor/symfony/mime/Encoder/Base64MimeHeaderEncoder.php deleted file mode 100644 index 5c06f6d9..00000000 --- a/vendor/symfony/mime/Encoder/Base64MimeHeaderEncoder.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\Mime\Encoder; - -/** - * @author Chris Corbyn - */ -final class Base64MimeHeaderEncoder extends Base64Encoder implements MimeHeaderEncoderInterface -{ - public function getName(): string - { - return 'B'; - } - - /** - * Takes an unencoded string and produces a Base64 encoded string from it. - * - * If the charset is iso-2022-jp, it uses mb_encode_mimeheader instead of - * default encodeString, otherwise pass to the parent method. - */ - public function encodeString(string $string, ?string $charset = 'utf-8', int $firstLineOffset = 0, int $maxLineLength = 0): string - { - if ('iso-2022-jp' === strtolower($charset)) { - $old = mb_internal_encoding(); - mb_internal_encoding('utf-8'); - $newstring = mb_encode_mimeheader($string, 'iso-2022-jp', $this->getName(), "\r\n"); - mb_internal_encoding($old); - - return $newstring; - } - - return parent::encodeString($string, $charset, $firstLineOffset, $maxLineLength); - } -} diff --git a/vendor/symfony/mime/Encoder/ContentEncoderInterface.php b/vendor/symfony/mime/Encoder/ContentEncoderInterface.php deleted file mode 100644 index a45ad04c..00000000 --- a/vendor/symfony/mime/Encoder/ContentEncoderInterface.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\Mime\Encoder; - -/** - * @author Chris Corbyn - */ -interface ContentEncoderInterface extends EncoderInterface -{ - /** - * Encodes the stream to a Generator. - * - * @param resource $stream - */ - public function encodeByteStream($stream, int $maxLineLength = 0): iterable; - - /** - * Gets the MIME name of this content encoding scheme. - */ - public function getName(): string; -} diff --git a/vendor/symfony/mime/Encoder/EightBitContentEncoder.php b/vendor/symfony/mime/Encoder/EightBitContentEncoder.php deleted file mode 100644 index 82831209..00000000 --- a/vendor/symfony/mime/Encoder/EightBitContentEncoder.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime\Encoder; - -/** - * @author Fabien Potencier - */ -final class EightBitContentEncoder implements ContentEncoderInterface -{ - public function encodeByteStream($stream, int $maxLineLength = 0): iterable - { - while (!feof($stream)) { - yield fread($stream, 16372); - } - } - - public function getName(): string - { - return '8bit'; - } - - public function encodeString(string $string, ?string $charset = 'utf-8', int $firstLineOffset = 0, int $maxLineLength = 0): string - { - return $string; - } -} diff --git a/vendor/symfony/mime/Encoder/EncoderInterface.php b/vendor/symfony/mime/Encoder/EncoderInterface.php deleted file mode 100644 index bbf6d488..00000000 --- a/vendor/symfony/mime/Encoder/EncoderInterface.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\Mime\Encoder; - -/** - * @author Chris Corbyn - */ -interface EncoderInterface -{ - /** - * Encode a given string to produce an encoded string. - * - * @param int $firstLineOffset if first line needs to be shorter - * @param int $maxLineLength - 0 indicates the default length for this encoding - */ - public function encodeString(string $string, ?string $charset = 'utf-8', int $firstLineOffset = 0, int $maxLineLength = 0): string; -} diff --git a/vendor/symfony/mime/Encoder/IdnAddressEncoder.php b/vendor/symfony/mime/Encoder/IdnAddressEncoder.php deleted file mode 100644 index b56e7e39..00000000 --- a/vendor/symfony/mime/Encoder/IdnAddressEncoder.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime\Encoder; - -/** - * An IDN email address encoder. - * - * Encodes the domain part of an address using IDN. This is compatible will all - * SMTP servers. - * - * Note: It leaves the local part as is. In case there are non-ASCII characters - * in the local part then it depends on the SMTP Server if this is supported. - * - * @author Christian Schmidt - */ -final class IdnAddressEncoder implements AddressEncoderInterface -{ - /** - * Encodes the domain part of an address using IDN. - */ - public function encodeString(string $address): string - { - $i = strrpos($address, '@'); - if (false !== $i) { - $local = substr($address, 0, $i); - $domain = substr($address, $i + 1); - - if (preg_match('/[^\x00-\x7F]/', $domain)) { - $address = sprintf('%s@%s', $local, idn_to_ascii($domain, \IDNA_DEFAULT | \IDNA_USE_STD3_RULES | \IDNA_CHECK_BIDI | \IDNA_CHECK_CONTEXTJ | \IDNA_NONTRANSITIONAL_TO_ASCII, \INTL_IDNA_VARIANT_UTS46)); - } - } - - return $address; - } -} diff --git a/vendor/symfony/mime/Encoder/MimeHeaderEncoderInterface.php b/vendor/symfony/mime/Encoder/MimeHeaderEncoderInterface.php deleted file mode 100644 index fff2c782..00000000 --- a/vendor/symfony/mime/Encoder/MimeHeaderEncoderInterface.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\Mime\Encoder; - -/** - * @author Chris Corbyn - */ -interface MimeHeaderEncoderInterface -{ - /** - * Get the MIME name of this content encoding scheme. - */ - public function getName(): string; -} diff --git a/vendor/symfony/mime/Encoder/QpContentEncoder.php b/vendor/symfony/mime/Encoder/QpContentEncoder.php deleted file mode 100644 index 6f420fff..00000000 --- a/vendor/symfony/mime/Encoder/QpContentEncoder.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime\Encoder; - -/** - * @author Lars Strojny - */ -final class QpContentEncoder implements ContentEncoderInterface -{ - public function encodeByteStream($stream, int $maxLineLength = 0): iterable - { - if (!\is_resource($stream)) { - throw new \TypeError(sprintf('Method "%s" takes a stream as a first argument.', __METHOD__)); - } - - // we don't use PHP stream filters here as the content should be small enough - yield $this->encodeString(stream_get_contents($stream), 'utf-8', 0, $maxLineLength); - } - - public function getName(): string - { - return 'quoted-printable'; - } - - public function encodeString(string $string, ?string $charset = 'utf-8', int $firstLineOffset = 0, int $maxLineLength = 0): string - { - return $this->standardize(quoted_printable_encode($string)); - } - - /** - * Make sure CRLF is correct and HT/SPACE are in valid places. - */ - private function standardize(string $string): string - { - // transform CR or LF to CRLF - $string = preg_replace('~=0D(?!=0A)|(? substr_replace($string, '=09', -1), - 0x20 => substr_replace($string, '=20', -1), - default => $string, - }; - } -} diff --git a/vendor/symfony/mime/Encoder/QpEncoder.php b/vendor/symfony/mime/Encoder/QpEncoder.php deleted file mode 100644 index 160dde32..00000000 --- a/vendor/symfony/mime/Encoder/QpEncoder.php +++ /dev/null @@ -1,192 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime\Encoder; - -use Symfony\Component\Mime\CharacterStream; - -/** - * @author Chris Corbyn - */ -class QpEncoder implements EncoderInterface -{ - /** - * Pre-computed QP for HUGE optimization. - */ - private const QP_MAP = [ - 0 => '=00', 1 => '=01', 2 => '=02', 3 => '=03', 4 => '=04', - 5 => '=05', 6 => '=06', 7 => '=07', 8 => '=08', 9 => '=09', - 10 => '=0A', 11 => '=0B', 12 => '=0C', 13 => '=0D', 14 => '=0E', - 15 => '=0F', 16 => '=10', 17 => '=11', 18 => '=12', 19 => '=13', - 20 => '=14', 21 => '=15', 22 => '=16', 23 => '=17', 24 => '=18', - 25 => '=19', 26 => '=1A', 27 => '=1B', 28 => '=1C', 29 => '=1D', - 30 => '=1E', 31 => '=1F', 32 => '=20', 33 => '=21', 34 => '=22', - 35 => '=23', 36 => '=24', 37 => '=25', 38 => '=26', 39 => '=27', - 40 => '=28', 41 => '=29', 42 => '=2A', 43 => '=2B', 44 => '=2C', - 45 => '=2D', 46 => '=2E', 47 => '=2F', 48 => '=30', 49 => '=31', - 50 => '=32', 51 => '=33', 52 => '=34', 53 => '=35', 54 => '=36', - 55 => '=37', 56 => '=38', 57 => '=39', 58 => '=3A', 59 => '=3B', - 60 => '=3C', 61 => '=3D', 62 => '=3E', 63 => '=3F', 64 => '=40', - 65 => '=41', 66 => '=42', 67 => '=43', 68 => '=44', 69 => '=45', - 70 => '=46', 71 => '=47', 72 => '=48', 73 => '=49', 74 => '=4A', - 75 => '=4B', 76 => '=4C', 77 => '=4D', 78 => '=4E', 79 => '=4F', - 80 => '=50', 81 => '=51', 82 => '=52', 83 => '=53', 84 => '=54', - 85 => '=55', 86 => '=56', 87 => '=57', 88 => '=58', 89 => '=59', - 90 => '=5A', 91 => '=5B', 92 => '=5C', 93 => '=5D', 94 => '=5E', - 95 => '=5F', 96 => '=60', 97 => '=61', 98 => '=62', 99 => '=63', - 100 => '=64', 101 => '=65', 102 => '=66', 103 => '=67', 104 => '=68', - 105 => '=69', 106 => '=6A', 107 => '=6B', 108 => '=6C', 109 => '=6D', - 110 => '=6E', 111 => '=6F', 112 => '=70', 113 => '=71', 114 => '=72', - 115 => '=73', 116 => '=74', 117 => '=75', 118 => '=76', 119 => '=77', - 120 => '=78', 121 => '=79', 122 => '=7A', 123 => '=7B', 124 => '=7C', - 125 => '=7D', 126 => '=7E', 127 => '=7F', 128 => '=80', 129 => '=81', - 130 => '=82', 131 => '=83', 132 => '=84', 133 => '=85', 134 => '=86', - 135 => '=87', 136 => '=88', 137 => '=89', 138 => '=8A', 139 => '=8B', - 140 => '=8C', 141 => '=8D', 142 => '=8E', 143 => '=8F', 144 => '=90', - 145 => '=91', 146 => '=92', 147 => '=93', 148 => '=94', 149 => '=95', - 150 => '=96', 151 => '=97', 152 => '=98', 153 => '=99', 154 => '=9A', - 155 => '=9B', 156 => '=9C', 157 => '=9D', 158 => '=9E', 159 => '=9F', - 160 => '=A0', 161 => '=A1', 162 => '=A2', 163 => '=A3', 164 => '=A4', - 165 => '=A5', 166 => '=A6', 167 => '=A7', 168 => '=A8', 169 => '=A9', - 170 => '=AA', 171 => '=AB', 172 => '=AC', 173 => '=AD', 174 => '=AE', - 175 => '=AF', 176 => '=B0', 177 => '=B1', 178 => '=B2', 179 => '=B3', - 180 => '=B4', 181 => '=B5', 182 => '=B6', 183 => '=B7', 184 => '=B8', - 185 => '=B9', 186 => '=BA', 187 => '=BB', 188 => '=BC', 189 => '=BD', - 190 => '=BE', 191 => '=BF', 192 => '=C0', 193 => '=C1', 194 => '=C2', - 195 => '=C3', 196 => '=C4', 197 => '=C5', 198 => '=C6', 199 => '=C7', - 200 => '=C8', 201 => '=C9', 202 => '=CA', 203 => '=CB', 204 => '=CC', - 205 => '=CD', 206 => '=CE', 207 => '=CF', 208 => '=D0', 209 => '=D1', - 210 => '=D2', 211 => '=D3', 212 => '=D4', 213 => '=D5', 214 => '=D6', - 215 => '=D7', 216 => '=D8', 217 => '=D9', 218 => '=DA', 219 => '=DB', - 220 => '=DC', 221 => '=DD', 222 => '=DE', 223 => '=DF', 224 => '=E0', - 225 => '=E1', 226 => '=E2', 227 => '=E3', 228 => '=E4', 229 => '=E5', - 230 => '=E6', 231 => '=E7', 232 => '=E8', 233 => '=E9', 234 => '=EA', - 235 => '=EB', 236 => '=EC', 237 => '=ED', 238 => '=EE', 239 => '=EF', - 240 => '=F0', 241 => '=F1', 242 => '=F2', 243 => '=F3', 244 => '=F4', - 245 => '=F5', 246 => '=F6', 247 => '=F7', 248 => '=F8', 249 => '=F9', - 250 => '=FA', 251 => '=FB', 252 => '=FC', 253 => '=FD', 254 => '=FE', - 255 => '=FF', - ]; - - private static array $safeMapShare = []; - - /** - * A map of non-encoded ascii characters. - * - * @var string[] - * - * @internal - */ - protected array $safeMap = []; - - public function __construct() - { - $id = static::class; - if (!isset(self::$safeMapShare[$id])) { - $this->initSafeMap(); - self::$safeMapShare[$id] = $this->safeMap; - } else { - $this->safeMap = self::$safeMapShare[$id]; - } - } - - protected function initSafeMap(): void - { - foreach (array_merge([0x09, 0x20], range(0x21, 0x3C), range(0x3E, 0x7E)) as $byte) { - $this->safeMap[$byte] = \chr($byte); - } - } - - /** - * Takes an unencoded string and produces a QP encoded string from it. - * - * QP encoded strings have a maximum line length of 76 characters. - * If the first line needs to be shorter, indicate the difference with - * $firstLineOffset. - */ - public function encodeString(string $string, ?string $charset = 'utf-8', int $firstLineOffset = 0, int $maxLineLength = 0): string - { - if ($maxLineLength > 76 || $maxLineLength <= 0) { - $maxLineLength = 76; - } - - $thisLineLength = $maxLineLength - $firstLineOffset; - - $lines = []; - $lNo = 0; - $lines[$lNo] = ''; - $currentLine = &$lines[$lNo++]; - $size = $lineLen = 0; - $charStream = new CharacterStream($string, $charset); - - // Fetching more than 4 chars at one is slower, as is fetching fewer bytes - // Conveniently 4 chars is the UTF-8 safe number since UTF-8 has up to 6 - // bytes per char and (6 * 4 * 3 = 72 chars per line) * =NN is 3 bytes - while (null !== $bytes = $charStream->readBytes(4)) { - $enc = $this->encodeByteSequence($bytes, $size); - - $i = strpos($enc, '=0D=0A'); - $newLineLength = $lineLen + (false === $i ? $size : $i); - - if ($currentLine && $newLineLength >= $thisLineLength) { - $lines[$lNo] = ''; - $currentLine = &$lines[$lNo++]; - $thisLineLength = $maxLineLength; - $lineLen = 0; - } - - $currentLine .= $enc; - - if (false === $i) { - $lineLen += $size; - } else { - // 6 is the length of '=0D=0A'. - $lineLen = $size - strrpos($enc, '=0D=0A') - 6; - } - } - - return $this->standardize(implode("=\r\n", $lines)); - } - - /** - * Encode the given byte array into a verbatim QP form. - */ - private function encodeByteSequence(array $bytes, int &$size): string - { - $ret = ''; - $size = 0; - foreach ($bytes as $b) { - if (isset($this->safeMap[$b])) { - $ret .= $this->safeMap[$b]; - ++$size; - } else { - $ret .= self::QP_MAP[$b]; - $size += 3; - } - } - - return $ret; - } - - /** - * Make sure CRLF is correct and HT/SPACE are in valid places. - */ - private function standardize(string $string): string - { - $string = str_replace(["\t=0D=0A", ' =0D=0A', '=0D=0A'], ["=09\r\n", "=20\r\n", "\r\n"], $string); - - return match ($end = \ord(substr($string, -1))) { - 0x09, - 0x20 => substr_replace($string, self::QP_MAP[$end], -1), - default => $string, - }; - } -} diff --git a/vendor/symfony/mime/Encoder/QpMimeHeaderEncoder.php b/vendor/symfony/mime/Encoder/QpMimeHeaderEncoder.php deleted file mode 100644 index d1d38375..00000000 --- a/vendor/symfony/mime/Encoder/QpMimeHeaderEncoder.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime\Encoder; - -/** - * @author Chris Corbyn - */ -final class QpMimeHeaderEncoder extends QpEncoder implements MimeHeaderEncoderInterface -{ - protected function initSafeMap(): void - { - foreach (array_merge( - range(0x61, 0x7A), range(0x41, 0x5A), - range(0x30, 0x39), [0x20, 0x21, 0x2A, 0x2B, 0x2D, 0x2F] - ) as $byte) { - $this->safeMap[$byte] = \chr($byte); - } - } - - public function getName(): string - { - return 'Q'; - } - - public function encodeString(string $string, ?string $charset = 'utf-8', int $firstLineOffset = 0, int $maxLineLength = 0): string - { - return str_replace([' ', '=20', "=\r\n"], ['_', '_', "\r\n"], - parent::encodeString($string, $charset, $firstLineOffset, $maxLineLength) - ); - } -} diff --git a/vendor/symfony/mime/Encoder/Rfc2231Encoder.php b/vendor/symfony/mime/Encoder/Rfc2231Encoder.php deleted file mode 100644 index 4d93dc64..00000000 --- a/vendor/symfony/mime/Encoder/Rfc2231Encoder.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime\Encoder; - -use Symfony\Component\Mime\CharacterStream; - -/** - * @author Chris Corbyn - */ -final class Rfc2231Encoder implements EncoderInterface -{ - /** - * Takes an unencoded string and produces a string encoded according to RFC 2231 from it. - */ - public function encodeString(string $string, ?string $charset = 'utf-8', int $firstLineOffset = 0, int $maxLineLength = 0): string - { - $lines = []; - $lineCount = 0; - $lines[] = ''; - $currentLine = &$lines[$lineCount++]; - - if (0 >= $maxLineLength) { - $maxLineLength = 75; - } - - $charStream = new CharacterStream($string, $charset); - $thisLineLength = $maxLineLength - $firstLineOffset; - - while (null !== $char = $charStream->read(4)) { - $encodedChar = rawurlencode($char); - if ('' !== $currentLine && \strlen($currentLine.$encodedChar) > $thisLineLength) { - $lines[] = ''; - $currentLine = &$lines[$lineCount++]; - $thisLineLength = $maxLineLength; - } - $currentLine .= $encodedChar; - } - - return implode("\r\n", $lines); - } -} diff --git a/vendor/symfony/mime/Exception/AddressEncoderException.php b/vendor/symfony/mime/Exception/AddressEncoderException.php deleted file mode 100644 index 51ee2e06..00000000 --- a/vendor/symfony/mime/Exception/AddressEncoderException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime\Exception; - -/** - * @author Fabien Potencier - */ -class AddressEncoderException extends RfcComplianceException -{ -} diff --git a/vendor/symfony/mime/Exception/ExceptionInterface.php b/vendor/symfony/mime/Exception/ExceptionInterface.php deleted file mode 100644 index 11933900..00000000 --- a/vendor/symfony/mime/Exception/ExceptionInterface.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime\Exception; - -/** - * @author Fabien Potencier - */ -interface ExceptionInterface extends \Throwable -{ -} diff --git a/vendor/symfony/mime/Exception/InvalidArgumentException.php b/vendor/symfony/mime/Exception/InvalidArgumentException.php deleted file mode 100644 index e89ebae2..00000000 --- a/vendor/symfony/mime/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime\Exception; - -/** - * @author Fabien Potencier - */ -class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/mime/Exception/LogicException.php b/vendor/symfony/mime/Exception/LogicException.php deleted file mode 100644 index 0508ee73..00000000 --- a/vendor/symfony/mime/Exception/LogicException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime\Exception; - -/** - * @author Fabien Potencier - */ -class LogicException extends \LogicException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/mime/Exception/RfcComplianceException.php b/vendor/symfony/mime/Exception/RfcComplianceException.php deleted file mode 100644 index 26e4a509..00000000 --- a/vendor/symfony/mime/Exception/RfcComplianceException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime\Exception; - -/** - * @author Fabien Potencier - */ -class RfcComplianceException extends \InvalidArgumentException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/mime/Exception/RuntimeException.php b/vendor/symfony/mime/Exception/RuntimeException.php deleted file mode 100644 index fb018b00..00000000 --- a/vendor/symfony/mime/Exception/RuntimeException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime\Exception; - -/** - * @author Fabien Potencier - */ -class RuntimeException extends \RuntimeException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/mime/FileBinaryMimeTypeGuesser.php b/vendor/symfony/mime/FileBinaryMimeTypeGuesser.php deleted file mode 100644 index 83e2950c..00000000 --- a/vendor/symfony/mime/FileBinaryMimeTypeGuesser.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\Mime; - -use Symfony\Component\Mime\Exception\InvalidArgumentException; -use Symfony\Component\Mime\Exception\LogicException; - -/** - * Guesses the MIME type with the binary "file" (only available on *nix). - * - * @author Bernhard Schussek - */ -class FileBinaryMimeTypeGuesser implements MimeTypeGuesserInterface -{ - private string $cmd; - - /** - * The $cmd pattern must contain a "%s" string that will be replaced - * with the file name to guess. - * - * The command output must start with the MIME type of the file. - * - * @param string $cmd The command to run to get the MIME type of a file - */ - public function __construct(string $cmd = 'file -b --mime -- %s 2>/dev/null') - { - $this->cmd = $cmd; - } - - public function isGuesserSupported(): bool - { - static $supported = null; - - if (null !== $supported) { - return $supported; - } - - if ('\\' === \DIRECTORY_SEPARATOR || !\function_exists('passthru') || !\function_exists('escapeshellarg')) { - return $supported = false; - } - - ob_start(); - passthru('command -v file', $exitStatus); - $binPath = trim(ob_get_clean()); - - return $supported = 0 === $exitStatus && '' !== $binPath; - } - - public function guessMimeType(string $path): ?string - { - if (!is_file($path) || !is_readable($path)) { - throw new InvalidArgumentException(sprintf('The "%s" file does not exist or is not readable.', $path)); - } - - if (!$this->isGuesserSupported()) { - throw new LogicException(sprintf('The "%s" guesser is not supported.', __CLASS__)); - } - - ob_start(); - - // need to use --mime instead of -i. see #6641 - passthru(sprintf($this->cmd, escapeshellarg((str_starts_with($path, '-') ? './' : '').$path)), $return); - if ($return > 0) { - ob_end_clean(); - - return null; - } - - $type = trim(ob_get_clean()); - - if (!preg_match('#^([a-z0-9\-]+/[a-z0-9\-\+\.]+)#i', $type, $match)) { - // it's not a type, but an error message - return null; - } - - return $match[1]; - } -} diff --git a/vendor/symfony/mime/FileinfoMimeTypeGuesser.php b/vendor/symfony/mime/FileinfoMimeTypeGuesser.php deleted file mode 100644 index 5e96b247..00000000 --- a/vendor/symfony/mime/FileinfoMimeTypeGuesser.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\Mime; - -use Symfony\Component\Mime\Exception\InvalidArgumentException; -use Symfony\Component\Mime\Exception\LogicException; - -/** - * Guesses the MIME type using the PECL extension FileInfo. - * - * @author Bernhard Schussek - */ -class FileinfoMimeTypeGuesser implements MimeTypeGuesserInterface -{ - private ?string $magicFile; - - /** - * @param string $magicFile A magic file to use with the finfo instance - * - * @see http://www.php.net/manual/en/function.finfo-open.php - */ - public function __construct(string $magicFile = null) - { - $this->magicFile = $magicFile; - } - - public function isGuesserSupported(): bool - { - return \function_exists('finfo_open'); - } - - public function guessMimeType(string $path): ?string - { - if (!is_file($path) || !is_readable($path)) { - throw new InvalidArgumentException(sprintf('The "%s" file does not exist or is not readable.', $path)); - } - - if (!$this->isGuesserSupported()) { - throw new LogicException(sprintf('The "%s" guesser is not supported.', __CLASS__)); - } - - if (false === $finfo = new \finfo(\FILEINFO_MIME_TYPE, $this->magicFile)) { - return null; - } - $mimeType = $finfo->file($path); - - if ($mimeType && 0 === (\strlen($mimeType) % 2)) { - $mimeStart = substr($mimeType, 0, \strlen($mimeType) >> 1); - $mimeType = $mimeStart.$mimeStart === $mimeType ? $mimeStart : $mimeType; - } - - return $mimeType; - } -} diff --git a/vendor/symfony/mime/Header/AbstractHeader.php b/vendor/symfony/mime/Header/AbstractHeader.php deleted file mode 100644 index 98245979..00000000 --- a/vendor/symfony/mime/Header/AbstractHeader.php +++ /dev/null @@ -1,280 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime\Header; - -use Symfony\Component\Mime\Encoder\QpMimeHeaderEncoder; - -/** - * An abstract base MIME Header. - * - * @author Chris Corbyn - */ -abstract class AbstractHeader implements HeaderInterface -{ - public const PHRASE_PATTERN = '(?:(?:(?:(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))*(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))|(?:(?:[ \t]*(?:\r\n))?[ \t])))?[a-zA-Z0-9!#\$%&\'\*\+\-\/=\?\^_`\{\}\|~]+(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))*(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))|(?:(?:[ \t]*(?:\r\n))?[ \t])))?)|(?:(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))*(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))|(?:(?:[ \t]*(?:\r\n))?[ \t])))?"((?:(?:[ \t]*(?:\r\n))?[ \t])?(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21\x23-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])))*(?:(?:[ \t]*(?:\r\n))?[ \t])?"(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))*(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))|(?:(?:[ \t]*(?:\r\n))?[ \t])))?))+?)'; - - private static QpMimeHeaderEncoder $encoder; - - private string $name; - private int $lineLength = 76; - private ?string $lang = null; - private string $charset = 'utf-8'; - - public function __construct(string $name) - { - $this->name = $name; - } - - public function setCharset(string $charset) - { - $this->charset = $charset; - } - - public function getCharset(): ?string - { - return $this->charset; - } - - /** - * Set the language used in this Header. - * - * For example, for US English, 'en-us'. - */ - public function setLanguage(string $lang) - { - $this->lang = $lang; - } - - public function getLanguage(): ?string - { - return $this->lang; - } - - public function getName(): string - { - return $this->name; - } - - public function setMaxLineLength(int $lineLength) - { - $this->lineLength = $lineLength; - } - - public function getMaxLineLength(): int - { - return $this->lineLength; - } - - public function toString(): string - { - return $this->tokensToString($this->toTokens()); - } - - /** - * Produces a compliant, formatted RFC 2822 'phrase' based on the string given. - * - * @param string $string as displayed - * @param bool $shorten the first line to make remove for header name - */ - protected function createPhrase(HeaderInterface $header, string $string, string $charset, bool $shorten = false): string - { - // Treat token as exactly what was given - $phraseStr = $string; - - // If it's not valid - if (!preg_match('/^'.self::PHRASE_PATTERN.'$/D', $phraseStr)) { - // .. but it is just ascii text, try escaping some characters - // and make it a quoted-string - if (preg_match('/^[\x00-\x08\x0B\x0C\x0E-\x7F]*$/D', $phraseStr)) { - foreach (['\\', '"'] as $char) { - $phraseStr = str_replace($char, '\\'.$char, $phraseStr); - } - $phraseStr = '"'.$phraseStr.'"'; - } else { - // ... otherwise it needs encoding - // Determine space remaining on line if first line - if ($shorten) { - $usedLength = \strlen($header->getName().': '); - } else { - $usedLength = 0; - } - $phraseStr = $this->encodeWords($header, $string, $usedLength); - } - } elseif (str_contains($phraseStr, '(')) { - foreach (['\\', '"'] as $char) { - $phraseStr = str_replace($char, '\\'.$char, $phraseStr); - } - $phraseStr = '"'.$phraseStr.'"'; - } - - return $phraseStr; - } - - /** - * Encode needed word tokens within a string of input. - */ - protected function encodeWords(HeaderInterface $header, string $input, int $usedLength = -1): string - { - $value = ''; - $tokens = $this->getEncodableWordTokens($input); - foreach ($tokens as $token) { - // See RFC 2822, Sect 2.2 (really 2.2 ??) - if ($this->tokenNeedsEncoding($token)) { - // Don't encode starting WSP - $firstChar = substr($token, 0, 1); - switch ($firstChar) { - case ' ': - case "\t": - $value .= $firstChar; - $token = substr($token, 1); - } - - if (-1 == $usedLength) { - $usedLength = \strlen($header->getName().': ') + \strlen($value); - } - $value .= $this->getTokenAsEncodedWord($token, $usedLength); - } else { - $value .= $token; - } - } - - return $value; - } - - protected function tokenNeedsEncoding(string $token): bool - { - return (bool) preg_match('~[\x00-\x08\x10-\x19\x7F-\xFF\r\n]~', $token); - } - - /** - * Splits a string into tokens in blocks of words which can be encoded quickly. - * - * @return string[] - */ - protected function getEncodableWordTokens(string $string): array - { - $tokens = []; - $encodedToken = ''; - // Split at all whitespace boundaries - foreach (preg_split('~(?=[\t ])~', $string) as $token) { - if ($this->tokenNeedsEncoding($token)) { - $encodedToken .= $token; - } else { - if ('' !== $encodedToken) { - $tokens[] = $encodedToken; - $encodedToken = ''; - } - $tokens[] = $token; - } - } - if ('' !== $encodedToken) { - $tokens[] = $encodedToken; - } - - return $tokens; - } - - /** - * Get a token as an encoded word for safe insertion into headers. - */ - protected function getTokenAsEncodedWord(string $token, int $firstLineOffset = 0): string - { - self::$encoder ??= new QpMimeHeaderEncoder(); - - // Adjust $firstLineOffset to account for space needed for syntax - $charsetDecl = $this->charset; - if (null !== $this->lang) { - $charsetDecl .= '*'.$this->lang; - } - $encodingWrapperLength = \strlen('=?'.$charsetDecl.'?'.self::$encoder->getName().'??='); - - if ($firstLineOffset >= 75) { - // Does this logic need to be here? - $firstLineOffset = 0; - } - - $encodedTextLines = explode("\r\n", - self::$encoder->encodeString($token, $this->charset, $firstLineOffset, 75 - $encodingWrapperLength) - ); - - if ('iso-2022-jp' !== strtolower($this->charset)) { - // special encoding for iso-2022-jp using mb_encode_mimeheader - foreach ($encodedTextLines as $lineNum => $line) { - $encodedTextLines[$lineNum] = '=?'.$charsetDecl.'?'.self::$encoder->getName().'?'.$line.'?='; - } - } - - return implode("\r\n ", $encodedTextLines); - } - - /** - * Generates tokens from the given string which include CRLF as individual tokens. - * - * @return string[] - */ - protected function generateTokenLines(string $token): array - { - return preg_split('~(\r\n)~', $token, -1, \PREG_SPLIT_DELIM_CAPTURE); - } - - /** - * Generate a list of all tokens in the final header. - */ - protected function toTokens(string $string = null): array - { - $string ??= $this->getBodyAsString(); - - $tokens = []; - // Generate atoms; split at all invisible boundaries followed by WSP - foreach (preg_split('~(?=[ \t])~', $string) as $token) { - $newTokens = $this->generateTokenLines($token); - foreach ($newTokens as $newToken) { - $tokens[] = $newToken; - } - } - - return $tokens; - } - - /** - * Takes an array of tokens which appear in the header and turns them into - * an RFC 2822 compliant string, adding FWSP where needed. - * - * @param string[] $tokens - */ - private function tokensToString(array $tokens): string - { - $lineCount = 0; - $headerLines = []; - $headerLines[] = $this->name.': '; - $currentLine = &$headerLines[$lineCount++]; - - // Build all tokens back into compliant header - foreach ($tokens as $i => $token) { - // Line longer than specified maximum or token was just a new line - if (("\r\n" === $token) || - ($i > 0 && \strlen($currentLine.$token) > $this->lineLength) - && '' !== $currentLine) { - $headerLines[] = ''; - $currentLine = &$headerLines[$lineCount++]; - } - - // Append token to the line - if ("\r\n" !== $token) { - $currentLine .= $token; - } - } - - // Implode with FWS (RFC 2822, 2.2.3) - return implode("\r\n", $headerLines); - } -} diff --git a/vendor/symfony/mime/Header/DateHeader.php b/vendor/symfony/mime/Header/DateHeader.php deleted file mode 100644 index b07dfede..00000000 --- a/vendor/symfony/mime/Header/DateHeader.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\Mime\Header; - -/** - * A Date MIME Header. - * - * @author Chris Corbyn - */ -final class DateHeader extends AbstractHeader -{ - private \DateTimeImmutable $dateTime; - - public function __construct(string $name, \DateTimeInterface $date) - { - parent::__construct($name); - - $this->setDateTime($date); - } - - /** - * @param \DateTimeInterface $body - */ - public function setBody(mixed $body) - { - $this->setDateTime($body); - } - - public function getBody(): \DateTimeImmutable - { - return $this->getDateTime(); - } - - public function getDateTime(): \DateTimeImmutable - { - return $this->dateTime; - } - - /** - * Set the date-time of the Date in this Header. - * - * If a DateTime instance is provided, it is converted to DateTimeImmutable. - */ - public function setDateTime(\DateTimeInterface $dateTime) - { - if ($dateTime instanceof \DateTime) { - $immutable = new \DateTimeImmutable('@'.$dateTime->getTimestamp()); - $dateTime = $immutable->setTimezone($dateTime->getTimezone()); - } - $this->dateTime = $dateTime; - } - - public function getBodyAsString(): string - { - return $this->dateTime->format(\DateTime::RFC2822); - } -} diff --git a/vendor/symfony/mime/Header/HeaderInterface.php b/vendor/symfony/mime/Header/HeaderInterface.php deleted file mode 100644 index 092fc238..00000000 --- a/vendor/symfony/mime/Header/HeaderInterface.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime\Header; - -/** - * A MIME Header. - * - * @author Chris Corbyn - */ -interface HeaderInterface -{ - /** - * Sets the body. - * - * The type depends on the Header concrete class. - */ - public function setBody(mixed $body); - - /** - * Gets the body. - * - * The return type depends on the Header concrete class. - */ - public function getBody(): mixed; - - public function setCharset(string $charset); - - public function getCharset(): ?string; - - public function setLanguage(string $lang); - - public function getLanguage(): ?string; - - public function getName(): string; - - public function setMaxLineLength(int $lineLength); - - public function getMaxLineLength(): int; - - /** - * Gets this Header rendered as a compliant string. - */ - public function toString(): string; - - /** - * Gets the header's body, prepared for folding into a final header value. - * - * This is not necessarily RFC 2822 compliant since folding white space is - * not added at this stage (see {@link toString()} for that). - */ - public function getBodyAsString(): string; -} diff --git a/vendor/symfony/mime/Header/Headers.php b/vendor/symfony/mime/Header/Headers.php deleted file mode 100644 index 335ebd48..00000000 --- a/vendor/symfony/mime/Header/Headers.php +++ /dev/null @@ -1,314 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime\Header; - -use Symfony\Component\Mime\Address; -use Symfony\Component\Mime\Exception\LogicException; - -/** - * A collection of headers. - * - * @author Fabien Potencier - */ -final class Headers -{ - private const UNIQUE_HEADERS = [ - 'date', 'from', 'sender', 'reply-to', 'to', 'cc', 'bcc', - 'message-id', 'in-reply-to', 'references', 'subject', - ]; - private const HEADER_CLASS_MAP = [ - 'date' => DateHeader::class, - 'from' => MailboxListHeader::class, - 'sender' => MailboxHeader::class, - 'reply-to' => MailboxListHeader::class, - 'to' => MailboxListHeader::class, - 'cc' => MailboxListHeader::class, - 'bcc' => MailboxListHeader::class, - 'message-id' => IdentificationHeader::class, - 'in-reply-to' => [UnstructuredHeader::class, IdentificationHeader::class], // `In-Reply-To` and `References` are less strict than RFC 2822 (3.6.4) to allow users entering the original email's ... - 'references' => [UnstructuredHeader::class, IdentificationHeader::class], // ... `Message-ID`, even if that is no valid `msg-id` - 'return-path' => PathHeader::class, - ]; - - /** - * @var HeaderInterface[][] - */ - private array $headers = []; - private int $lineLength = 76; - - public function __construct(HeaderInterface ...$headers) - { - foreach ($headers as $header) { - $this->add($header); - } - } - - public function __clone() - { - foreach ($this->headers as $name => $collection) { - foreach ($collection as $i => $header) { - $this->headers[$name][$i] = clone $header; - } - } - } - - public function setMaxLineLength(int $lineLength) - { - $this->lineLength = $lineLength; - foreach ($this->all() as $header) { - $header->setMaxLineLength($lineLength); - } - } - - public function getMaxLineLength(): int - { - return $this->lineLength; - } - - /** - * @param array $addresses - * - * @return $this - */ - public function addMailboxListHeader(string $name, array $addresses): static - { - return $this->add(new MailboxListHeader($name, Address::createArray($addresses))); - } - - /** - * @return $this - */ - public function addMailboxHeader(string $name, Address|string $address): static - { - return $this->add(new MailboxHeader($name, Address::create($address))); - } - - /** - * @return $this - */ - public function addIdHeader(string $name, string|array $ids): static - { - return $this->add(new IdentificationHeader($name, $ids)); - } - - /** - * @return $this - */ - public function addPathHeader(string $name, Address|string $path): static - { - return $this->add(new PathHeader($name, $path instanceof Address ? $path : new Address($path))); - } - - /** - * @return $this - */ - public function addDateHeader(string $name, \DateTimeInterface $dateTime): static - { - return $this->add(new DateHeader($name, $dateTime)); - } - - /** - * @return $this - */ - public function addTextHeader(string $name, string $value): static - { - return $this->add(new UnstructuredHeader($name, $value)); - } - - /** - * @return $this - */ - public function addParameterizedHeader(string $name, string $value, array $params = []): static - { - return $this->add(new ParameterizedHeader($name, $value, $params)); - } - - /** - * @return $this - */ - public function addHeader(string $name, mixed $argument, array $more = []): static - { - $headerClass = self::HEADER_CLASS_MAP[strtolower($name)] ?? UnstructuredHeader::class; - if (\is_array($headerClass)) { - $headerClass = $headerClass[0]; - } - $parts = explode('\\', $headerClass); - $method = 'add'.ucfirst(array_pop($parts)); - if ('addUnstructuredHeader' === $method) { - $method = 'addTextHeader'; - } elseif ('addIdentificationHeader' === $method) { - $method = 'addIdHeader'; - } - - return $this->$method($name, $argument, $more); - } - - public function has(string $name): bool - { - return isset($this->headers[strtolower($name)]); - } - - /** - * @return $this - */ - public function add(HeaderInterface $header): static - { - self::checkHeaderClass($header); - - $header->setMaxLineLength($this->lineLength); - $name = strtolower($header->getName()); - - if (\in_array($name, self::UNIQUE_HEADERS, true) && isset($this->headers[$name]) && \count($this->headers[$name]) > 0) { - throw new LogicException(sprintf('Impossible to set header "%s" as it\'s already defined and must be unique.', $header->getName())); - } - - $this->headers[$name][] = $header; - - return $this; - } - - public function get(string $name): ?HeaderInterface - { - $name = strtolower($name); - if (!isset($this->headers[$name])) { - return null; - } - - $values = array_values($this->headers[$name]); - - return array_shift($values); - } - - public function all(string $name = null): iterable - { - if (null === $name) { - foreach ($this->headers as $name => $collection) { - foreach ($collection as $header) { - yield $name => $header; - } - } - } elseif (isset($this->headers[strtolower($name)])) { - foreach ($this->headers[strtolower($name)] as $header) { - yield $header; - } - } - } - - public function getNames(): array - { - return array_keys($this->headers); - } - - public function remove(string $name): void - { - unset($this->headers[strtolower($name)]); - } - - public static function isUniqueHeader(string $name): bool - { - return \in_array(strtolower($name), self::UNIQUE_HEADERS, true); - } - - /** - * @throws LogicException if the header name and class are not compatible - */ - public static function checkHeaderClass(HeaderInterface $header): void - { - $name = strtolower($header->getName()); - $headerClasses = self::HEADER_CLASS_MAP[$name] ?? []; - if (!\is_array($headerClasses)) { - $headerClasses = [$headerClasses]; - } - - if (!$headerClasses) { - return; - } - - foreach ($headerClasses as $c) { - if ($header instanceof $c) { - return; - } - } - - throw new LogicException(sprintf('The "%s" header must be an instance of "%s" (got "%s").', $header->getName(), implode('" or "', $headerClasses), get_debug_type($header))); - } - - public function toString(): string - { - $string = ''; - foreach ($this->toArray() as $str) { - $string .= $str."\r\n"; - } - - return $string; - } - - public function toArray(): array - { - $arr = []; - foreach ($this->all() as $header) { - if ('' !== $header->getBodyAsString()) { - $arr[] = $header->toString(); - } - } - - return $arr; - } - - public function getHeaderBody(string $name) - { - return $this->has($name) ? $this->get($name)->getBody() : null; - } - - /** - * @internal - */ - public function setHeaderBody(string $type, string $name, mixed $body): void - { - if ($this->has($name)) { - $this->get($name)->setBody($body); - } else { - $this->{'add'.$type.'Header'}($name, $body); - } - } - - public function getHeaderParameter(string $name, string $parameter): ?string - { - if (!$this->has($name)) { - return null; - } - - $header = $this->get($name); - if (!$header instanceof ParameterizedHeader) { - throw new LogicException(sprintf('Unable to get parameter "%s" on header "%s" as the header is not of class "%s".', $parameter, $name, ParameterizedHeader::class)); - } - - return $header->getParameter($parameter); - } - - /** - * @internal - */ - public function setHeaderParameter(string $name, string $parameter, ?string $value): void - { - if (!$this->has($name)) { - throw new LogicException(sprintf('Unable to set parameter "%s" on header "%s" as the header is not defined.', $parameter, $name)); - } - - $header = $this->get($name); - if (!$header instanceof ParameterizedHeader) { - throw new LogicException(sprintf('Unable to set parameter "%s" on header "%s" as the header is not of class "%s".', $parameter, $name, ParameterizedHeader::class)); - } - - $header->setParameter($parameter, $value); - } -} diff --git a/vendor/symfony/mime/Header/IdentificationHeader.php b/vendor/symfony/mime/Header/IdentificationHeader.php deleted file mode 100644 index 40fd7c36..00000000 --- a/vendor/symfony/mime/Header/IdentificationHeader.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\Mime\Header; - -use Symfony\Component\Mime\Address; -use Symfony\Component\Mime\Exception\RfcComplianceException; - -/** - * An ID MIME Header for something like Message-ID or Content-ID (one or more addresses). - * - * @author Chris Corbyn - */ -final class IdentificationHeader extends AbstractHeader -{ - private array $ids = []; - private array $idsAsAddresses = []; - - public function __construct(string $name, string|array $ids) - { - parent::__construct($name); - - $this->setId($ids); - } - - /** - * @param string|string[] $body a string ID or an array of IDs - * - * @throws RfcComplianceException - */ - public function setBody(mixed $body) - { - $this->setId($body); - } - - public function getBody(): array - { - return $this->getIds(); - } - - /** - * Set the ID used in the value of this header. - * - * @param string|string[] $id - * - * @throws RfcComplianceException - */ - public function setId(string|array $id) - { - $this->setIds(\is_array($id) ? $id : [$id]); - } - - /** - * Get the ID used in the value of this Header. - * - * If multiple IDs are set only the first is returned. - */ - public function getId(): ?string - { - return $this->ids[0] ?? null; - } - - /** - * Set a collection of IDs to use in the value of this Header. - * - * @param string[] $ids - * - * @throws RfcComplianceException - */ - public function setIds(array $ids) - { - $this->ids = []; - $this->idsAsAddresses = []; - foreach ($ids as $id) { - $this->idsAsAddresses[] = new Address($id); - $this->ids[] = $id; - } - } - - /** - * Get the list of IDs used in this Header. - * - * @return string[] - */ - public function getIds(): array - { - return $this->ids; - } - - public function getBodyAsString(): string - { - $addrs = []; - foreach ($this->idsAsAddresses as $address) { - $addrs[] = '<'.$address->toString().'>'; - } - - return implode(' ', $addrs); - } -} diff --git a/vendor/symfony/mime/Header/MailboxHeader.php b/vendor/symfony/mime/Header/MailboxHeader.php deleted file mode 100644 index e79761a5..00000000 --- a/vendor/symfony/mime/Header/MailboxHeader.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime\Header; - -use Symfony\Component\Mime\Address; -use Symfony\Component\Mime\Exception\RfcComplianceException; - -/** - * A Mailbox MIME Header for something like Sender (one named address). - * - * @author Fabien Potencier - */ -final class MailboxHeader extends AbstractHeader -{ - private Address $address; - - public function __construct(string $name, Address $address) - { - parent::__construct($name); - - $this->setAddress($address); - } - - /** - * @param Address $body - * - * @throws RfcComplianceException - */ - public function setBody(mixed $body) - { - $this->setAddress($body); - } - - /** - * @throws RfcComplianceException - */ - public function getBody(): Address - { - return $this->getAddress(); - } - - /** - * @throws RfcComplianceException - */ - public function setAddress(Address $address) - { - $this->address = $address; - } - - public function getAddress(): Address - { - return $this->address; - } - - public function getBodyAsString(): string - { - $str = $this->address->getEncodedAddress(); - if ($name = $this->address->getName()) { - $str = $this->createPhrase($this, $name, $this->getCharset(), true).' <'.$str.'>'; - } - - return $str; - } - - /** - * Redefine the encoding requirements for an address. - * - * All "specials" must be encoded as the full header value will not be quoted - * - * @see RFC 2822 3.2.1 - */ - protected function tokenNeedsEncoding(string $token): bool - { - return preg_match('/[()<>\[\]:;@\,."]/', $token) || parent::tokenNeedsEncoding($token); - } -} diff --git a/vendor/symfony/mime/Header/MailboxListHeader.php b/vendor/symfony/mime/Header/MailboxListHeader.php deleted file mode 100644 index 76cf59f3..00000000 --- a/vendor/symfony/mime/Header/MailboxListHeader.php +++ /dev/null @@ -1,136 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime\Header; - -use Symfony\Component\Mime\Address; -use Symfony\Component\Mime\Exception\RfcComplianceException; - -/** - * A Mailbox list MIME Header for something like From, To, Cc, and Bcc (one or more named addresses). - * - * @author Chris Corbyn - */ -final class MailboxListHeader extends AbstractHeader -{ - private array $addresses = []; - - /** - * @param Address[] $addresses - */ - public function __construct(string $name, array $addresses) - { - parent::__construct($name); - - $this->setAddresses($addresses); - } - - /** - * @param Address[] $body - * - * @throws RfcComplianceException - */ - public function setBody(mixed $body) - { - $this->setAddresses($body); - } - - /** - * @return Address[] - * - * @throws RfcComplianceException - */ - public function getBody(): array - { - return $this->getAddresses(); - } - - /** - * Sets a list of addresses to be shown in this Header. - * - * @param Address[] $addresses - * - * @throws RfcComplianceException - */ - public function setAddresses(array $addresses) - { - $this->addresses = []; - $this->addAddresses($addresses); - } - - /** - * Sets a list of addresses to be shown in this Header. - * - * @param Address[] $addresses - * - * @throws RfcComplianceException - */ - public function addAddresses(array $addresses) - { - foreach ($addresses as $address) { - $this->addAddress($address); - } - } - - /** - * @throws RfcComplianceException - */ - public function addAddress(Address $address) - { - $this->addresses[] = $address; - } - - /** - * @return Address[] - */ - public function getAddresses(): array - { - return $this->addresses; - } - - /** - * Gets the full mailbox list of this Header as an array of valid RFC 2822 strings. - * - * @return string[] - * - * @throws RfcComplianceException - */ - public function getAddressStrings(): array - { - $strings = []; - foreach ($this->addresses as $address) { - $str = $address->getEncodedAddress(); - if ($name = $address->getName()) { - $str = $this->createPhrase($this, $name, $this->getCharset(), !$strings).' <'.$str.'>'; - } - $strings[] = $str; - } - - return $strings; - } - - public function getBodyAsString(): string - { - return implode(', ', $this->getAddressStrings()); - } - - /** - * Redefine the encoding requirements for addresses. - * - * All "specials" must be encoded as the full header value will not be quoted - * - * @see RFC 2822 3.2.1 - */ - protected function tokenNeedsEncoding(string $token): bool - { - return preg_match('/[()<>\[\]:;@\,."]/', $token) || parent::tokenNeedsEncoding($token); - } -} diff --git a/vendor/symfony/mime/Header/ParameterizedHeader.php b/vendor/symfony/mime/Header/ParameterizedHeader.php deleted file mode 100644 index ee2e1134..00000000 --- a/vendor/symfony/mime/Header/ParameterizedHeader.php +++ /dev/null @@ -1,191 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime\Header; - -use Symfony\Component\Mime\Encoder\Rfc2231Encoder; - -/** - * @author Chris Corbyn - */ -final class ParameterizedHeader extends UnstructuredHeader -{ - /** - * RFC 2231's definition of a token. - * - * @var string - */ - public const TOKEN_REGEX = '(?:[\x21\x23-\x27\x2A\x2B\x2D\x2E\x30-\x39\x41-\x5A\x5E-\x7E]+)'; - - private ?Rfc2231Encoder $encoder = null; - private array $parameters = []; - - public function __construct(string $name, string $value, array $parameters = []) - { - parent::__construct($name, $value); - - foreach ($parameters as $k => $v) { - $this->setParameter($k, $v); - } - - if ('content-type' !== strtolower($name)) { - $this->encoder = new Rfc2231Encoder(); - } - } - - public function setParameter(string $parameter, ?string $value) - { - $this->setParameters(array_merge($this->getParameters(), [$parameter => $value])); - } - - public function getParameter(string $parameter): string - { - return $this->getParameters()[$parameter] ?? ''; - } - - /** - * @param string[] $parameters - */ - public function setParameters(array $parameters) - { - $this->parameters = $parameters; - } - - /** - * @return string[] - */ - public function getParameters(): array - { - return $this->parameters; - } - - public function getBodyAsString(): string - { - $body = parent::getBodyAsString(); - foreach ($this->parameters as $name => $value) { - if (null !== $value) { - $body .= '; '.$this->createParameter($name, $value); - } - } - - return $body; - } - - /** - * Generate a list of all tokens in the final header. - * - * This doesn't need to be overridden in theory, but it is for implementation - * reasons to prevent potential breakage of attributes. - */ - protected function toTokens(string $string = null): array - { - $tokens = parent::toTokens(parent::getBodyAsString()); - - // Try creating any parameters - foreach ($this->parameters as $name => $value) { - if (null !== $value) { - // Add the semi-colon separator - $tokens[\count($tokens) - 1] .= ';'; - $tokens = array_merge($tokens, $this->generateTokenLines(' '.$this->createParameter($name, $value))); - } - } - - return $tokens; - } - - /** - * Render an RFC 2047 compliant header parameter from the $name and $value. - */ - private function createParameter(string $name, string $value): string - { - $origValue = $value; - - $encoded = false; - // Allow room for parameter name, indices, "=" and DQUOTEs - $maxValueLength = $this->getMaxLineLength() - \strlen($name.'=*N"";') - 1; - $firstLineOffset = 0; - - // If it's not already a valid parameter value... - if (!preg_match('/^'.self::TOKEN_REGEX.'$/D', $value)) { - // TODO: text, or something else?? - // ... and it's not ascii - if (!preg_match('/^[\x00-\x08\x0B\x0C\x0E-\x7F]*$/D', $value)) { - $encoded = true; - // Allow space for the indices, charset and language - $maxValueLength = $this->getMaxLineLength() - \strlen($name.'*N*="";') - 1; - $firstLineOffset = \strlen($this->getCharset()."'".$this->getLanguage()."'"); - } - - if (\in_array($name, ['name', 'filename'], true) && 'form-data' === $this->getValue() && 'content-disposition' === strtolower($this->getName()) && preg_match('//u', $value)) { - // WHATWG HTML living standard 4.10.21.8 2 specifies: - // For field names and filenames for file fields, the result of the - // encoding in the previous bullet point must be escaped by replacing - // any 0x0A (LF) bytes with the byte sequence `%0A`, 0x0D (CR) with `%0D` - // and 0x22 (") with `%22`. - // The user agent must not perform any other escapes. - $value = str_replace(['"', "\r", "\n"], ['%22', '%0D', '%0A'], $value); - - if (\strlen($value) <= $maxValueLength) { - return $name.'="'.$value.'"'; - } - - $value = $origValue; - } - } - - // Encode if we need to - if ($encoded || \strlen($value) > $maxValueLength) { - if (null !== $this->encoder) { - $value = $this->encoder->encodeString($origValue, $this->getCharset(), $firstLineOffset, $maxValueLength); - } else { - // We have to go against RFC 2183/2231 in some areas for interoperability - $value = $this->getTokenAsEncodedWord($origValue); - $encoded = false; - } - } - - $valueLines = $this->encoder ? explode("\r\n", $value) : [$value]; - - // Need to add indices - if (\count($valueLines) > 1) { - $paramLines = []; - foreach ($valueLines as $i => $line) { - $paramLines[] = $name.'*'.$i.$this->getEndOfParameterValue($line, true, 0 === $i); - } - - return implode(";\r\n ", $paramLines); - } else { - return $name.$this->getEndOfParameterValue($valueLines[0], $encoded, true); - } - } - - /** - * Returns the parameter value from the "=" and beyond. - * - * @param string $value to append - */ - private function getEndOfParameterValue(string $value, bool $encoded = false, bool $firstLine = false): string - { - $forceHttpQuoting = 'form-data' === $this->getValue() && 'content-disposition' === strtolower($this->getName()); - if ($forceHttpQuoting || !preg_match('/^'.self::TOKEN_REGEX.'$/D', $value)) { - $value = '"'.$value.'"'; - } - $prepend = '='; - if ($encoded) { - $prepend = '*='; - if ($firstLine) { - $prepend = '*='.$this->getCharset()."'".$this->getLanguage()."'"; - } - } - - return $prepend.$value; - } -} diff --git a/vendor/symfony/mime/Header/PathHeader.php b/vendor/symfony/mime/Header/PathHeader.php deleted file mode 100644 index 4c6e6908..00000000 --- a/vendor/symfony/mime/Header/PathHeader.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\Mime\Header; - -use Symfony\Component\Mime\Address; -use Symfony\Component\Mime\Exception\RfcComplianceException; - -/** - * A Path Header, such a Return-Path (one address). - * - * @author Chris Corbyn - */ -final class PathHeader extends AbstractHeader -{ - private Address $address; - - public function __construct(string $name, Address $address) - { - parent::__construct($name); - - $this->setAddress($address); - } - - /** - * @param Address $body - * - * @throws RfcComplianceException - */ - public function setBody(mixed $body) - { - $this->setAddress($body); - } - - public function getBody(): Address - { - return $this->getAddress(); - } - - public function setAddress(Address $address) - { - $this->address = $address; - } - - public function getAddress(): Address - { - return $this->address; - } - - public function getBodyAsString(): string - { - return '<'.$this->address->toString().'>'; - } -} diff --git a/vendor/symfony/mime/Header/UnstructuredHeader.php b/vendor/symfony/mime/Header/UnstructuredHeader.php deleted file mode 100644 index 668b0be7..00000000 --- a/vendor/symfony/mime/Header/UnstructuredHeader.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\Mime\Header; - -/** - * A Simple MIME Header. - * - * @author Chris Corbyn - */ -class UnstructuredHeader extends AbstractHeader -{ - private string $value; - - public function __construct(string $name, string $value) - { - parent::__construct($name); - - $this->setValue($value); - } - - /** - * @param string $body - */ - public function setBody(mixed $body) - { - $this->setValue($body); - } - - public function getBody(): string - { - return $this->getValue(); - } - - /** - * Get the (unencoded) value of this header. - */ - public function getValue(): string - { - return $this->value; - } - - /** - * Set the (unencoded) value of this header. - */ - public function setValue(string $value) - { - $this->value = $value; - } - - /** - * Get the value of this header prepared for rendering. - */ - public function getBodyAsString(): string - { - return $this->encodeWords($this, $this->value); - } -} diff --git a/vendor/symfony/mime/HtmlToTextConverter/DefaultHtmlToTextConverter.php b/vendor/symfony/mime/HtmlToTextConverter/DefaultHtmlToTextConverter.php deleted file mode 100644 index 2aaf8e6c..00000000 --- a/vendor/symfony/mime/HtmlToTextConverter/DefaultHtmlToTextConverter.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\Mime\HtmlToTextConverter; - -/** - * @author Fabien Potencier - */ -class DefaultHtmlToTextConverter implements HtmlToTextConverterInterface -{ - public function convert(string $html, string $charset): string - { - return strip_tags(preg_replace('{<(head|style)\b.*?}is', '', $html)); - } -} diff --git a/vendor/symfony/mime/HtmlToTextConverter/HtmlToTextConverterInterface.php b/vendor/symfony/mime/HtmlToTextConverter/HtmlToTextConverterInterface.php deleted file mode 100644 index 696f37cc..00000000 --- a/vendor/symfony/mime/HtmlToTextConverter/HtmlToTextConverterInterface.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\Mime\HtmlToTextConverter; - -/** - * @author Fabien Potencier - */ -interface HtmlToTextConverterInterface -{ - /** - * Converts an HTML representation of a Message to a text representation. - * - * The output must use the same charset as the HTML one. - */ - public function convert(string $html, string $charset): string; -} diff --git a/vendor/symfony/mime/HtmlToTextConverter/LeagueHtmlToMarkdownConverter.php b/vendor/symfony/mime/HtmlToTextConverter/LeagueHtmlToMarkdownConverter.php deleted file mode 100644 index 253a7b19..00000000 --- a/vendor/symfony/mime/HtmlToTextConverter/LeagueHtmlToMarkdownConverter.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime\HtmlToTextConverter; - -use League\HTMLToMarkdown\HtmlConverter; -use League\HTMLToMarkdown\HtmlConverterInterface; - -/** - * @author Fabien Potencier - */ -class LeagueHtmlToMarkdownConverter implements HtmlToTextConverterInterface -{ - public function __construct( - private HtmlConverterInterface $converter = new HtmlConverter([ - 'hard_break' => true, - 'strip_tags' => true, - 'remove_nodes' => 'head style', - ]), - ) { - } - - public function convert(string $html, string $charset): string - { - return $this->converter->convert($html); - } -} diff --git a/vendor/symfony/mime/LICENSE b/vendor/symfony/mime/LICENSE deleted file mode 100644 index 298be141..00000000 --- a/vendor/symfony/mime/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2010-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/mime/Message.php b/vendor/symfony/mime/Message.php deleted file mode 100644 index 55435d7d..00000000 --- a/vendor/symfony/mime/Message.php +++ /dev/null @@ -1,163 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime; - -use Symfony\Component\Mime\Exception\LogicException; -use Symfony\Component\Mime\Header\Headers; -use Symfony\Component\Mime\Part\AbstractPart; -use Symfony\Component\Mime\Part\TextPart; - -/** - * @author Fabien Potencier - */ -class Message extends RawMessage -{ - private Headers $headers; - private ?AbstractPart $body; - - public function __construct(Headers $headers = null, AbstractPart $body = null) - { - $this->headers = $headers ? clone $headers : new Headers(); - $this->body = $body; - } - - public function __clone() - { - $this->headers = clone $this->headers; - - if (null !== $this->body) { - $this->body = clone $this->body; - } - } - - /** - * @return $this - */ - public function setBody(AbstractPart $body = null): static - { - if (1 > \func_num_args()) { - trigger_deprecation('symfony/mime', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); - } - $this->body = $body; - - return $this; - } - - public function getBody(): ?AbstractPart - { - return $this->body; - } - - /** - * @return $this - */ - public function setHeaders(Headers $headers): static - { - $this->headers = $headers; - - return $this; - } - - public function getHeaders(): Headers - { - return $this->headers; - } - - public function getPreparedHeaders(): Headers - { - $headers = clone $this->headers; - - if (!$headers->has('From')) { - if (!$headers->has('Sender')) { - throw new LogicException('An email must have a "From" or a "Sender" header.'); - } - $headers->addMailboxListHeader('From', [$headers->get('Sender')->getAddress()]); - } - - if (!$headers->has('MIME-Version')) { - $headers->addTextHeader('MIME-Version', '1.0'); - } - - if (!$headers->has('Date')) { - $headers->addDateHeader('Date', new \DateTimeImmutable()); - } - - // determine the "real" sender - if (!$headers->has('Sender') && \count($froms = $headers->get('From')->getAddresses()) > 1) { - $headers->addMailboxHeader('Sender', $froms[0]); - } - - if (!$headers->has('Message-ID')) { - $headers->addIdHeader('Message-ID', $this->generateMessageId()); - } - - // remove the Bcc field which should NOT be part of the sent message - $headers->remove('Bcc'); - - return $headers; - } - - public function toString(): string - { - if (null === $body = $this->getBody()) { - $body = new TextPart(''); - } - - return $this->getPreparedHeaders()->toString().$body->toString(); - } - - public function toIterable(): iterable - { - if (null === $body = $this->getBody()) { - $body = new TextPart(''); - } - - yield $this->getPreparedHeaders()->toString(); - yield from $body->toIterable(); - } - - public function ensureValidity() - { - if (!$this->headers->has('To') && !$this->headers->has('Cc') && !$this->headers->has('Bcc')) { - throw new LogicException('An email must have a "To", "Cc", or "Bcc" header.'); - } - - if (!$this->headers->has('From') && !$this->headers->has('Sender')) { - throw new LogicException('An email must have a "From" or a "Sender" header.'); - } - - parent::ensureValidity(); - } - - public function generateMessageId(): string - { - if ($this->headers->has('Sender')) { - $sender = $this->headers->get('Sender')->getAddress(); - } elseif ($this->headers->has('From')) { - $sender = $this->headers->get('From')->getAddresses()[0]; - } else { - throw new LogicException('An email must have a "From" or a "Sender" header.'); - } - - return bin2hex(random_bytes(16)).strstr($sender->getAddress(), '@'); - } - - public function __serialize(): array - { - return [$this->headers, $this->body]; - } - - public function __unserialize(array $data): void - { - [$this->headers, $this->body] = $data; - } -} diff --git a/vendor/symfony/mime/MessageConverter.php b/vendor/symfony/mime/MessageConverter.php deleted file mode 100644 index 4d86afc3..00000000 --- a/vendor/symfony/mime/MessageConverter.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\Mime; - -use Symfony\Component\Mime\Exception\RuntimeException; -use Symfony\Component\Mime\Part\DataPart; -use Symfony\Component\Mime\Part\Multipart\AlternativePart; -use Symfony\Component\Mime\Part\Multipart\MixedPart; -use Symfony\Component\Mime\Part\Multipart\RelatedPart; -use Symfony\Component\Mime\Part\TextPart; - -/** - * @author Fabien Potencier - */ -final class MessageConverter -{ - /** - * @throws RuntimeException when unable to convert the message to an email - */ - public static function toEmail(Message $message): Email - { - if ($message instanceof Email) { - return $message; - } - - // try to convert to a "simple" Email instance - $body = $message->getBody(); - if ($body instanceof TextPart) { - return self::createEmailFromTextPart($message, $body); - } - - if ($body instanceof AlternativePart) { - return self::createEmailFromAlternativePart($message, $body); - } - - if ($body instanceof RelatedPart) { - return self::createEmailFromRelatedPart($message, $body); - } - - if ($body instanceof MixedPart) { - $parts = $body->getParts(); - if ($parts[0] instanceof RelatedPart) { - $email = self::createEmailFromRelatedPart($message, $parts[0]); - } elseif ($parts[0] instanceof AlternativePart) { - $email = self::createEmailFromAlternativePart($message, $parts[0]); - } elseif ($parts[0] instanceof TextPart) { - $email = self::createEmailFromTextPart($message, $parts[0]); - } else { - throw new RuntimeException(sprintf('Unable to create an Email from an instance of "%s" as the body is too complex.', get_debug_type($message))); - } - - return self::addParts($email, \array_slice($parts, 1)); - } - - throw new RuntimeException(sprintf('Unable to create an Email from an instance of "%s" as the body is too complex.', get_debug_type($message))); - } - - private static function createEmailFromTextPart(Message $message, TextPart $part): Email - { - if ('text' === $part->getMediaType() && 'plain' === $part->getMediaSubtype()) { - return (new Email(clone $message->getHeaders()))->text($part->getBody(), $part->getPreparedHeaders()->getHeaderParameter('Content-Type', 'charset') ?: 'utf-8'); - } - if ('text' === $part->getMediaType() && 'html' === $part->getMediaSubtype()) { - return (new Email(clone $message->getHeaders()))->html($part->getBody(), $part->getPreparedHeaders()->getHeaderParameter('Content-Type', 'charset') ?: 'utf-8'); - } - - throw new RuntimeException(sprintf('Unable to create an Email from an instance of "%s" as the body is too complex.', get_debug_type($message))); - } - - private static function createEmailFromAlternativePart(Message $message, AlternativePart $part): Email - { - $parts = $part->getParts(); - if ( - 2 === \count($parts) && - $parts[0] instanceof TextPart && 'text' === $parts[0]->getMediaType() && 'plain' === $parts[0]->getMediaSubtype() && - $parts[1] instanceof TextPart && 'text' === $parts[1]->getMediaType() && 'html' === $parts[1]->getMediaSubtype() - ) { - return (new Email(clone $message->getHeaders())) - ->text($parts[0]->getBody(), $parts[0]->getPreparedHeaders()->getHeaderParameter('Content-Type', 'charset') ?: 'utf-8') - ->html($parts[1]->getBody(), $parts[1]->getPreparedHeaders()->getHeaderParameter('Content-Type', 'charset') ?: 'utf-8') - ; - } - - throw new RuntimeException(sprintf('Unable to create an Email from an instance of "%s" as the body is too complex.', get_debug_type($message))); - } - - private static function createEmailFromRelatedPart(Message $message, RelatedPart $part): Email - { - $parts = $part->getParts(); - if ($parts[0] instanceof AlternativePart) { - $email = self::createEmailFromAlternativePart($message, $parts[0]); - } elseif ($parts[0] instanceof TextPart) { - $email = self::createEmailFromTextPart($message, $parts[0]); - } else { - throw new RuntimeException(sprintf('Unable to create an Email from an instance of "%s" as the body is too complex.', get_debug_type($message))); - } - - return self::addParts($email, \array_slice($parts, 1)); - } - - private static function addParts(Email $email, array $parts): Email - { - foreach ($parts as $part) { - if (!$part instanceof DataPart) { - throw new RuntimeException(sprintf('Unable to create an Email from an instance of "%s" as the body is too complex.', get_debug_type($email))); - } - - $email->addPart($part); - } - - return $email; - } -} diff --git a/vendor/symfony/mime/MimeTypeGuesserInterface.php b/vendor/symfony/mime/MimeTypeGuesserInterface.php deleted file mode 100644 index 30ee3b64..00000000 --- a/vendor/symfony/mime/MimeTypeGuesserInterface.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\Mime; - -/** - * Guesses the MIME type of a file. - * - * @author Fabien Potencier - */ -interface MimeTypeGuesserInterface -{ - /** - * Returns true if this guesser is supported. - */ - public function isGuesserSupported(): bool; - - /** - * Guesses the MIME type of the file with the given path. - * - * @throws \LogicException If the guesser is not supported - * @throws \InvalidArgumentException If the file does not exist or is not readable - */ - public function guessMimeType(string $path): ?string; -} diff --git a/vendor/symfony/mime/MimeTypes.php b/vendor/symfony/mime/MimeTypes.php deleted file mode 100644 index 0cbd5924..00000000 --- a/vendor/symfony/mime/MimeTypes.php +++ /dev/null @@ -1,3526 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime; - -use Symfony\Component\Mime\Exception\LogicException; - -/** - * Manages MIME types and file extensions. - * - * For MIME type guessing, you can register custom guessers - * by calling the registerGuesser() method. - * Custom guessers are always called before any default ones: - * - * $guesser = new MimeTypes(); - * $guesser->registerGuesser(new MyCustomMimeTypeGuesser()); - * - * If you want to change the order of the default guessers, just re-register your - * preferred one as a custom one. The last registered guesser is preferred over - * previously registered ones. - * - * Re-registering a built-in guesser also allows you to configure it: - * - * $guesser = new MimeTypes(); - * $guesser->registerGuesser(new FileinfoMimeTypeGuesser('/path/to/magic/file')); - * - * @author Fabien Potencier - */ -final class MimeTypes implements MimeTypesInterface -{ - private array $extensions = []; - private array $mimeTypes = []; - - /** - * @var MimeTypeGuesserInterface[] - */ - private array $guessers = []; - private static MimeTypes $default; - - public function __construct(array $map = []) - { - foreach ($map as $mimeType => $extensions) { - $this->extensions[$mimeType] = $extensions; - - foreach ($extensions as $extension) { - $this->mimeTypes[$extension][] = $mimeType; - } - } - $this->registerGuesser(new FileBinaryMimeTypeGuesser()); - $this->registerGuesser(new FileinfoMimeTypeGuesser()); - } - - public static function setDefault(self $default) - { - self::$default = $default; - } - - public static function getDefault(): self - { - return self::$default ??= new self(); - } - - /** - * Registers a MIME type guesser. - * - * The last registered guesser has precedence over the other ones. - */ - public function registerGuesser(MimeTypeGuesserInterface $guesser) - { - array_unshift($this->guessers, $guesser); - } - - public function getExtensions(string $mimeType): array - { - if ($this->extensions) { - $extensions = $this->extensions[$mimeType] ?? $this->extensions[$lcMimeType = strtolower($mimeType)] ?? null; - } - - return $extensions ?? self::MAP[$mimeType] ?? self::MAP[$lcMimeType ?? strtolower($mimeType)] ?? []; - } - - public function getMimeTypes(string $ext): array - { - if ($this->mimeTypes) { - $mimeTypes = $this->mimeTypes[$ext] ?? $this->mimeTypes[$lcExt = strtolower($ext)] ?? null; - } - - return $mimeTypes ?? self::REVERSE_MAP[$ext] ?? self::REVERSE_MAP[$lcExt ?? strtolower($ext)] ?? []; - } - - public function isGuesserSupported(): bool - { - foreach ($this->guessers as $guesser) { - if ($guesser->isGuesserSupported()) { - return true; - } - } - - return false; - } - - /** - * The file is passed to each registered MIME type guesser in reverse order - * of their registration (last registered is queried first). Once a guesser - * returns a value that is not null, this method terminates and returns the - * value. - */ - public function guessMimeType(string $path): ?string - { - foreach ($this->guessers as $guesser) { - if (!$guesser->isGuesserSupported()) { - continue; - } - - if (null !== $mimeType = $guesser->guessMimeType($path)) { - return $mimeType; - } - } - - if (!$this->isGuesserSupported()) { - throw new LogicException('Unable to guess the MIME type as no guessers are available (have you enabled the php_fileinfo extension?).'); - } - - return null; - } - - /** - * A map of MIME types and their default extensions. - * - * Updated from upstream on 2021-09-03 - * - * @see Resources/bin/update_mime_types.php - */ - private const MAP = [ - 'application/acrobat' => ['pdf'], - 'application/andrew-inset' => ['ez'], - 'application/annodex' => ['anx'], - 'application/applixware' => ['aw'], - 'application/atom+xml' => ['atom'], - 'application/atomcat+xml' => ['atomcat'], - 'application/atomdeleted+xml' => ['atomdeleted'], - 'application/atomsvc+xml' => ['atomsvc'], - 'application/atsc-dwd+xml' => ['dwd'], - 'application/atsc-held+xml' => ['held'], - 'application/atsc-rsat+xml' => ['rsat'], - 'application/bdoc' => ['bdoc'], - 'application/bzip2' => ['bz2', 'bz'], - 'application/calendar+xml' => ['xcs'], - 'application/ccxml+xml' => ['ccxml'], - 'application/cdfx+xml' => ['cdfx'], - 'application/cdmi-capability' => ['cdmia'], - 'application/cdmi-container' => ['cdmic'], - 'application/cdmi-domain' => ['cdmid'], - 'application/cdmi-object' => ['cdmio'], - 'application/cdmi-queue' => ['cdmiq'], - 'application/cdr' => ['cdr'], - 'application/coreldraw' => ['cdr'], - 'application/csv' => ['csv'], - 'application/cu-seeme' => ['cu'], - 'application/dash+xml' => ['mpd'], - 'application/davmount+xml' => ['davmount'], - 'application/dbase' => ['dbf'], - 'application/dbf' => ['dbf'], - 'application/dicom' => ['dcm'], - 'application/docbook+xml' => ['dbk', 'docbook'], - 'application/dssc+der' => ['dssc'], - 'application/dssc+xml' => ['xdssc'], - 'application/ecmascript' => ['ecma', 'es'], - 'application/emf' => ['emf'], - 'application/emma+xml' => ['emma'], - 'application/emotionml+xml' => ['emotionml'], - 'application/epub+zip' => ['epub'], - 'application/exi' => ['exi'], - 'application/fdt+xml' => ['fdt'], - 'application/font-tdpfr' => ['pfr'], - 'application/font-woff' => ['woff'], - 'application/futuresplash' => ['swf', 'spl'], - 'application/geo+json' => ['geojson', 'geo.json'], - 'application/gml+xml' => ['gml'], - 'application/gnunet-directory' => ['gnd'], - 'application/gpx' => ['gpx'], - 'application/gpx+xml' => ['gpx'], - 'application/gxf' => ['gxf'], - 'application/gzip' => ['gz'], - 'application/hjson' => ['hjson'], - 'application/hyperstudio' => ['stk'], - 'application/ico' => ['ico'], - 'application/ics' => ['vcs', 'ics'], - 'application/illustrator' => ['ai'], - 'application/inkml+xml' => ['ink', 'inkml'], - 'application/ipfix' => ['ipfix'], - 'application/its+xml' => ['its'], - 'application/java' => ['class'], - 'application/java-archive' => ['jar', 'war', 'ear'], - 'application/java-byte-code' => ['class'], - 'application/java-serialized-object' => ['ser'], - 'application/java-vm' => ['class'], - 'application/javascript' => ['js', 'mjs', 'jsm'], - 'application/jrd+json' => ['jrd'], - 'application/json' => ['json', 'map'], - 'application/json-patch+json' => ['json-patch'], - 'application/json5' => ['json5'], - 'application/jsonml+json' => ['jsonml'], - 'application/ld+json' => ['jsonld'], - 'application/lgr+xml' => ['lgr'], - 'application/lost+xml' => ['lostxml'], - 'application/lotus123' => ['123', 'wk1', 'wk3', 'wk4', 'wks'], - 'application/m3u' => ['m3u', 'm3u8', 'vlc'], - 'application/mac-binhex40' => ['hqx'], - 'application/mac-compactpro' => ['cpt'], - 'application/mads+xml' => ['mads'], - 'application/manifest+json' => ['webmanifest'], - 'application/marc' => ['mrc'], - 'application/marcxml+xml' => ['mrcx'], - 'application/mathematica' => ['ma', 'nb', 'mb'], - 'application/mathml+xml' => ['mathml', 'mml'], - 'application/mbox' => ['mbox'], - 'application/mdb' => ['mdb'], - 'application/mediaservercontrol+xml' => ['mscml'], - 'application/metalink+xml' => ['metalink'], - 'application/metalink4+xml' => ['meta4'], - 'application/mets+xml' => ['mets'], - 'application/mmt-aei+xml' => ['maei'], - 'application/mmt-usd+xml' => ['musd'], - 'application/mods+xml' => ['mods'], - 'application/mp21' => ['m21', 'mp21'], - 'application/mp4' => ['mp4s', 'm4p'], - 'application/mrb-consumer+xml' => ['xdf'], - 'application/mrb-publish+xml' => ['xdf'], - 'application/ms-tnef' => ['tnef', 'tnf'], - 'application/msaccess' => ['mdb'], - 'application/msexcel' => ['xls', 'xlc', 'xll', 'xlm', 'xlw', 'xla', 'xlt', 'xld'], - 'application/mspowerpoint' => ['ppz', 'ppt', 'pps', 'pot'], - 'application/msword' => ['doc', 'dot'], - 'application/msword-template' => ['dot'], - 'application/mxf' => ['mxf'], - 'application/n-quads' => ['nq'], - 'application/n-triples' => ['nt'], - 'application/nappdf' => ['pdf'], - 'application/node' => ['cjs'], - 'application/octet-stream' => ['bin', 'dms', 'lrf', 'mar', 'so', 'dist', 'distz', 'pkg', 'bpk', 'dump', 'elc', 'deploy', 'exe', 'dll', 'deb', 'dmg', 'iso', 'img', 'msi', 'msp', 'msm', 'buffer'], - 'application/oda' => ['oda'], - 'application/oebps-package+xml' => ['opf'], - 'application/ogg' => ['ogx'], - 'application/omdoc+xml' => ['omdoc'], - 'application/onenote' => ['onetoc', 'onetoc2', 'onetmp', 'onepkg'], - 'application/ovf' => ['ova'], - 'application/owl+xml' => ['owx'], - 'application/oxps' => ['oxps'], - 'application/p2p-overlay+xml' => ['relo'], - 'application/patch-ops-error+xml' => ['xer'], - 'application/pcap' => ['pcap', 'cap', 'dmp'], - 'application/pdf' => ['pdf'], - 'application/pgp' => ['pgp', 'gpg', 'asc'], - 'application/pgp-encrypted' => ['pgp', 'gpg', 'asc'], - 'application/pgp-keys' => ['skr', 'pkr', 'asc', 'pgp', 'gpg', 'key'], - 'application/pgp-signature' => ['asc', 'sig', 'pgp', 'gpg'], - 'application/photoshop' => ['psd'], - 'application/pics-rules' => ['prf'], - 'application/pkcs10' => ['p10'], - 'application/pkcs12' => ['p12', 'pfx'], - 'application/pkcs7-mime' => ['p7m', 'p7c'], - 'application/pkcs7-signature' => ['p7s'], - 'application/pkcs8' => ['p8'], - 'application/pkcs8-encrypted' => ['p8e'], - 'application/pkix-attr-cert' => ['ac'], - 'application/pkix-cert' => ['cer'], - 'application/pkix-crl' => ['crl'], - 'application/pkix-pkipath' => ['pkipath'], - 'application/pkixcmp' => ['pki'], - 'application/pls' => ['pls'], - 'application/pls+xml' => ['pls'], - 'application/postscript' => ['ai', 'eps', 'ps'], - 'application/powerpoint' => ['ppz', 'ppt', 'pps', 'pot'], - 'application/provenance+xml' => ['provx'], - 'application/prs.cww' => ['cww'], - 'application/pskc+xml' => ['pskcxml'], - 'application/ram' => ['ram'], - 'application/raml+yaml' => ['raml'], - 'application/rdf+xml' => ['rdf', 'owl', 'rdfs'], - 'application/reginfo+xml' => ['rif'], - 'application/relax-ng-compact-syntax' => ['rnc'], - 'application/resource-lists+xml' => ['rl'], - 'application/resource-lists-diff+xml' => ['rld'], - 'application/rls-services+xml' => ['rs'], - 'application/route-apd+xml' => ['rapd'], - 'application/route-s-tsid+xml' => ['sls'], - 'application/route-usd+xml' => ['rusd'], - 'application/rpki-ghostbusters' => ['gbr'], - 'application/rpki-manifest' => ['mft'], - 'application/rpki-roa' => ['roa'], - 'application/rsd+xml' => ['rsd'], - 'application/rss+xml' => ['rss'], - 'application/rtf' => ['rtf'], - 'application/sbml+xml' => ['sbml'], - 'application/schema+json' => ['json'], - 'application/scvp-cv-request' => ['scq'], - 'application/scvp-cv-response' => ['scs'], - 'application/scvp-vp-request' => ['spq'], - 'application/scvp-vp-response' => ['spp'], - 'application/sdp' => ['sdp'], - 'application/senml+xml' => ['senmlx'], - 'application/sensml+xml' => ['sensmlx'], - 'application/set-payment-initiation' => ['setpay'], - 'application/set-registration-initiation' => ['setreg'], - 'application/shf+xml' => ['shf'], - 'application/sieve' => ['siv', 'sieve'], - 'application/smil' => ['smil', 'smi', 'sml', 'kino'], - 'application/smil+xml' => ['smi', 'smil', 'sml', 'kino'], - 'application/sparql-query' => ['rq'], - 'application/sparql-results+xml' => ['srx'], - 'application/sql' => ['sql'], - 'application/srgs' => ['gram'], - 'application/srgs+xml' => ['grxml'], - 'application/sru+xml' => ['sru'], - 'application/ssdl+xml' => ['ssdl'], - 'application/ssml+xml' => ['ssml'], - 'application/stuffit' => ['sit', 'hqx'], - 'application/swid+xml' => ['swidtag'], - 'application/tei+xml' => ['tei', 'teicorpus'], - 'application/tga' => ['tga', 'icb', 'tpic', 'vda', 'vst'], - 'application/thraud+xml' => ['tfi'], - 'application/timestamped-data' => ['tsd'], - 'application/toml' => ['toml'], - 'application/trig' => ['trig'], - 'application/ttml+xml' => ['ttml'], - 'application/ubjson' => ['ubj'], - 'application/urc-ressheet+xml' => ['rsheet'], - 'application/urc-targetdesc+xml' => ['td'], - 'application/vnd.1000minds.decision-model+xml' => ['1km'], - 'application/vnd.3gpp.pic-bw-large' => ['plb'], - 'application/vnd.3gpp.pic-bw-small' => ['psb'], - 'application/vnd.3gpp.pic-bw-var' => ['pvb'], - 'application/vnd.3gpp2.tcap' => ['tcap'], - 'application/vnd.3m.post-it-notes' => ['pwn'], - 'application/vnd.accpac.simply.aso' => ['aso'], - 'application/vnd.accpac.simply.imp' => ['imp'], - 'application/vnd.acucobol' => ['acu'], - 'application/vnd.acucorp' => ['atc', 'acutc'], - 'application/vnd.adobe.air-application-installer-package+zip' => ['air'], - 'application/vnd.adobe.flash.movie' => ['swf', 'spl'], - 'application/vnd.adobe.formscentral.fcdt' => ['fcdt'], - 'application/vnd.adobe.fxp' => ['fxp', 'fxpl'], - 'application/vnd.adobe.illustrator' => ['ai'], - 'application/vnd.adobe.xdp+xml' => ['xdp'], - 'application/vnd.adobe.xfdf' => ['xfdf'], - 'application/vnd.ahead.space' => ['ahead'], - 'application/vnd.airzip.filesecure.azf' => ['azf'], - 'application/vnd.airzip.filesecure.azs' => ['azs'], - 'application/vnd.amazon.ebook' => ['azw'], - 'application/vnd.amazon.mobi8-ebook' => ['azw3', 'kfx'], - 'application/vnd.americandynamics.acc' => ['acc'], - 'application/vnd.amiga.ami' => ['ami'], - 'application/vnd.android.package-archive' => ['apk'], - 'application/vnd.anser-web-certificate-issue-initiation' => ['cii'], - 'application/vnd.anser-web-funds-transfer-initiation' => ['fti'], - 'application/vnd.antix.game-component' => ['atx'], - 'application/vnd.appimage' => ['appimage'], - 'application/vnd.apple.installer+xml' => ['mpkg'], - 'application/vnd.apple.keynote' => ['key', 'keynote'], - 'application/vnd.apple.mpegurl' => ['m3u8', 'm3u'], - 'application/vnd.apple.numbers' => ['numbers'], - 'application/vnd.apple.pages' => ['pages'], - 'application/vnd.apple.pkpass' => ['pkpass'], - 'application/vnd.aristanetworks.swi' => ['swi'], - 'application/vnd.astraea-software.iota' => ['iota'], - 'application/vnd.audiograph' => ['aep'], - 'application/vnd.balsamiq.bmml+xml' => ['bmml'], - 'application/vnd.blueice.multipass' => ['mpm'], - 'application/vnd.bmi' => ['bmi'], - 'application/vnd.businessobjects' => ['rep'], - 'application/vnd.chemdraw+xml' => ['cdxml'], - 'application/vnd.chess-pgn' => ['pgn'], - 'application/vnd.chipnuts.karaoke-mmd' => ['mmd'], - 'application/vnd.cinderella' => ['cdy'], - 'application/vnd.citationstyles.style+xml' => ['csl'], - 'application/vnd.claymore' => ['cla'], - 'application/vnd.cloanto.rp9' => ['rp9'], - 'application/vnd.clonk.c4group' => ['c4g', 'c4d', 'c4f', 'c4p', 'c4u'], - 'application/vnd.cluetrust.cartomobile-config' => ['c11amc'], - 'application/vnd.cluetrust.cartomobile-config-pkg' => ['c11amz'], - 'application/vnd.coffeescript' => ['coffee'], - 'application/vnd.comicbook+zip' => ['cbz'], - 'application/vnd.comicbook-rar' => ['cbr'], - 'application/vnd.commonspace' => ['csp'], - 'application/vnd.contact.cmsg' => ['cdbcmsg'], - 'application/vnd.corel-draw' => ['cdr'], - 'application/vnd.cosmocaller' => ['cmc'], - 'application/vnd.crick.clicker' => ['clkx'], - 'application/vnd.crick.clicker.keyboard' => ['clkk'], - 'application/vnd.crick.clicker.palette' => ['clkp'], - 'application/vnd.crick.clicker.template' => ['clkt'], - 'application/vnd.crick.clicker.wordbank' => ['clkw'], - 'application/vnd.criticaltools.wbs+xml' => ['wbs'], - 'application/vnd.ctc-posml' => ['pml'], - 'application/vnd.cups-ppd' => ['ppd'], - 'application/vnd.curl.car' => ['car'], - 'application/vnd.curl.pcurl' => ['pcurl'], - 'application/vnd.dart' => ['dart'], - 'application/vnd.data-vision.rdz' => ['rdz'], - 'application/vnd.dbf' => ['dbf'], - 'application/vnd.debian.binary-package' => ['deb', 'udeb'], - 'application/vnd.dece.data' => ['uvf', 'uvvf', 'uvd', 'uvvd'], - 'application/vnd.dece.ttml+xml' => ['uvt', 'uvvt'], - 'application/vnd.dece.unspecified' => ['uvx', 'uvvx'], - 'application/vnd.dece.zip' => ['uvz', 'uvvz'], - 'application/vnd.denovo.fcselayout-link' => ['fe_launch'], - 'application/vnd.dna' => ['dna'], - 'application/vnd.dolby.mlp' => ['mlp'], - 'application/vnd.dpgraph' => ['dpg'], - 'application/vnd.dreamfactory' => ['dfac'], - 'application/vnd.ds-keypoint' => ['kpxx'], - 'application/vnd.dvb.ait' => ['ait'], - 'application/vnd.dvb.service' => ['svc'], - 'application/vnd.dynageo' => ['geo'], - 'application/vnd.ecowin.chart' => ['mag'], - 'application/vnd.emusic-emusic_package' => ['emp'], - 'application/vnd.enliven' => ['nml'], - 'application/vnd.epson.esf' => ['esf'], - 'application/vnd.epson.msf' => ['msf'], - 'application/vnd.epson.quickanime' => ['qam'], - 'application/vnd.epson.salt' => ['slt'], - 'application/vnd.epson.ssf' => ['ssf'], - 'application/vnd.eszigno3+xml' => ['es3', 'et3'], - 'application/vnd.etsi.asic-e+zip' => ['asice'], - 'application/vnd.ezpix-album' => ['ez2'], - 'application/vnd.ezpix-package' => ['ez3'], - 'application/vnd.fdf' => ['fdf'], - 'application/vnd.fdsn.mseed' => ['mseed'], - 'application/vnd.fdsn.seed' => ['seed', 'dataless'], - 'application/vnd.flatpak' => ['flatpak', 'xdgapp'], - 'application/vnd.flatpak.ref' => ['flatpakref'], - 'application/vnd.flatpak.repo' => ['flatpakrepo'], - 'application/vnd.flographit' => ['gph'], - 'application/vnd.fluxtime.clip' => ['ftc'], - 'application/vnd.framemaker' => ['fm', 'frame', 'maker', 'book'], - 'application/vnd.frogans.fnc' => ['fnc'], - 'application/vnd.frogans.ltf' => ['ltf'], - 'application/vnd.fsc.weblaunch' => ['fsc'], - 'application/vnd.fujitsu.oasys' => ['oas'], - 'application/vnd.fujitsu.oasys2' => ['oa2'], - 'application/vnd.fujitsu.oasys3' => ['oa3'], - 'application/vnd.fujitsu.oasysgp' => ['fg5'], - 'application/vnd.fujitsu.oasysprs' => ['bh2'], - 'application/vnd.fujixerox.ddd' => ['ddd'], - 'application/vnd.fujixerox.docuworks' => ['xdw'], - 'application/vnd.fujixerox.docuworks.binder' => ['xbd'], - 'application/vnd.fuzzysheet' => ['fzs'], - 'application/vnd.genomatix.tuxedo' => ['txd'], - 'application/vnd.geo+json' => ['geojson', 'geo.json'], - 'application/vnd.geogebra.file' => ['ggb'], - 'application/vnd.geogebra.tool' => ['ggt'], - 'application/vnd.geometry-explorer' => ['gex', 'gre'], - 'application/vnd.geonext' => ['gxt'], - 'application/vnd.geoplan' => ['g2w'], - 'application/vnd.geospace' => ['g3w'], - 'application/vnd.gmx' => ['gmx'], - 'application/vnd.google-apps.document' => ['gdoc'], - 'application/vnd.google-apps.presentation' => ['gslides'], - 'application/vnd.google-apps.spreadsheet' => ['gsheet'], - 'application/vnd.google-earth.kml+xml' => ['kml'], - 'application/vnd.google-earth.kmz' => ['kmz'], - 'application/vnd.grafeq' => ['gqf', 'gqs'], - 'application/vnd.groove-account' => ['gac'], - 'application/vnd.groove-help' => ['ghf'], - 'application/vnd.groove-identity-message' => ['gim'], - 'application/vnd.groove-injector' => ['grv'], - 'application/vnd.groove-tool-message' => ['gtm'], - 'application/vnd.groove-tool-template' => ['tpl'], - 'application/vnd.groove-vcard' => ['vcg'], - 'application/vnd.haansoft-hwp' => ['hwp'], - 'application/vnd.haansoft-hwt' => ['hwt'], - 'application/vnd.hal+xml' => ['hal'], - 'application/vnd.handheld-entertainment+xml' => ['zmm'], - 'application/vnd.hbci' => ['hbci'], - 'application/vnd.hhe.lesson-player' => ['les'], - 'application/vnd.hp-hpgl' => ['hpgl'], - 'application/vnd.hp-hpid' => ['hpid'], - 'application/vnd.hp-hps' => ['hps'], - 'application/vnd.hp-jlyt' => ['jlt'], - 'application/vnd.hp-pcl' => ['pcl'], - 'application/vnd.hp-pclxl' => ['pclxl'], - 'application/vnd.hydrostatix.sof-data' => ['sfd-hdstx'], - 'application/vnd.ibm.minipay' => ['mpy'], - 'application/vnd.ibm.modcap' => ['afp', 'listafp', 'list3820'], - 'application/vnd.ibm.rights-management' => ['irm'], - 'application/vnd.ibm.secure-container' => ['sc'], - 'application/vnd.iccprofile' => ['icc', 'icm'], - 'application/vnd.igloader' => ['igl'], - 'application/vnd.immervision-ivp' => ['ivp'], - 'application/vnd.immervision-ivu' => ['ivu'], - 'application/vnd.insors.igm' => ['igm'], - 'application/vnd.intercon.formnet' => ['xpw', 'xpx'], - 'application/vnd.intergeo' => ['i2g'], - 'application/vnd.intu.qbo' => ['qbo'], - 'application/vnd.intu.qfx' => ['qfx'], - 'application/vnd.ipunplugged.rcprofile' => ['rcprofile'], - 'application/vnd.irepository.package+xml' => ['irp'], - 'application/vnd.is-xpr' => ['xpr'], - 'application/vnd.isac.fcs' => ['fcs'], - 'application/vnd.jam' => ['jam'], - 'application/vnd.jcp.javame.midlet-rms' => ['rms'], - 'application/vnd.jisp' => ['jisp'], - 'application/vnd.joost.joda-archive' => ['joda'], - 'application/vnd.kahootz' => ['ktz', 'ktr'], - 'application/vnd.kde.karbon' => ['karbon'], - 'application/vnd.kde.kchart' => ['chrt'], - 'application/vnd.kde.kformula' => ['kfo'], - 'application/vnd.kde.kivio' => ['flw'], - 'application/vnd.kde.kontour' => ['kon'], - 'application/vnd.kde.kpresenter' => ['kpr', 'kpt'], - 'application/vnd.kde.kspread' => ['ksp'], - 'application/vnd.kde.kword' => ['kwd', 'kwt'], - 'application/vnd.kenameaapp' => ['htke'], - 'application/vnd.kidspiration' => ['kia'], - 'application/vnd.kinar' => ['kne', 'knp'], - 'application/vnd.koan' => ['skp', 'skd', 'skt', 'skm'], - 'application/vnd.kodak-descriptor' => ['sse'], - 'application/vnd.las.las+xml' => ['lasxml'], - 'application/vnd.llamagraphics.life-balance.desktop' => ['lbd'], - 'application/vnd.llamagraphics.life-balance.exchange+xml' => ['lbe'], - 'application/vnd.lotus-1-2-3' => ['123', 'wk1', 'wk3', 'wk4', 'wks'], - 'application/vnd.lotus-approach' => ['apr'], - 'application/vnd.lotus-freelance' => ['pre'], - 'application/vnd.lotus-notes' => ['nsf'], - 'application/vnd.lotus-organizer' => ['org'], - 'application/vnd.lotus-screencam' => ['scm'], - 'application/vnd.lotus-wordpro' => ['lwp'], - 'application/vnd.macports.portpkg' => ['portpkg'], - 'application/vnd.mapbox-vector-tile' => ['mvt'], - 'application/vnd.mcd' => ['mcd'], - 'application/vnd.medcalcdata' => ['mc1'], - 'application/vnd.mediastation.cdkey' => ['cdkey'], - 'application/vnd.mfer' => ['mwf'], - 'application/vnd.mfmp' => ['mfm'], - 'application/vnd.micrografx.flo' => ['flo'], - 'application/vnd.micrografx.igx' => ['igx'], - 'application/vnd.mif' => ['mif'], - 'application/vnd.mobius.daf' => ['daf'], - 'application/vnd.mobius.dis' => ['dis'], - 'application/vnd.mobius.mbk' => ['mbk'], - 'application/vnd.mobius.mqy' => ['mqy'], - 'application/vnd.mobius.msl' => ['msl'], - 'application/vnd.mobius.plc' => ['plc'], - 'application/vnd.mobius.txf' => ['txf'], - 'application/vnd.mophun.application' => ['mpn'], - 'application/vnd.mophun.certificate' => ['mpc'], - 'application/vnd.mozilla.xul+xml' => ['xul'], - 'application/vnd.ms-access' => ['mdb'], - 'application/vnd.ms-artgalry' => ['cil'], - 'application/vnd.ms-asf' => ['asf'], - 'application/vnd.ms-cab-compressed' => ['cab'], - 'application/vnd.ms-excel' => ['xls', 'xlm', 'xla', 'xlc', 'xlt', 'xlw', 'xll', 'xld'], - 'application/vnd.ms-excel.addin.macroenabled.12' => ['xlam'], - 'application/vnd.ms-excel.sheet.binary.macroenabled.12' => ['xlsb'], - 'application/vnd.ms-excel.sheet.macroenabled.12' => ['xlsm'], - 'application/vnd.ms-excel.template.macroenabled.12' => ['xltm'], - 'application/vnd.ms-fontobject' => ['eot'], - 'application/vnd.ms-htmlhelp' => ['chm'], - 'application/vnd.ms-ims' => ['ims'], - 'application/vnd.ms-lrm' => ['lrm'], - 'application/vnd.ms-officetheme' => ['thmx'], - 'application/vnd.ms-outlook' => ['msg'], - 'application/vnd.ms-pki.seccat' => ['cat'], - 'application/vnd.ms-pki.stl' => ['stl'], - 'application/vnd.ms-powerpoint' => ['ppt', 'pps', 'pot', 'ppz'], - 'application/vnd.ms-powerpoint.addin.macroenabled.12' => ['ppam'], - 'application/vnd.ms-powerpoint.presentation.macroenabled.12' => ['pptm'], - 'application/vnd.ms-powerpoint.slide.macroenabled.12' => ['sldm'], - 'application/vnd.ms-powerpoint.slideshow.macroenabled.12' => ['ppsm'], - 'application/vnd.ms-powerpoint.template.macroenabled.12' => ['potm'], - 'application/vnd.ms-project' => ['mpp', 'mpt'], - 'application/vnd.ms-publisher' => ['pub'], - 'application/vnd.ms-tnef' => ['tnef', 'tnf'], - 'application/vnd.ms-visio.drawing.macroenabled.main+xml' => ['vsdm'], - 'application/vnd.ms-visio.drawing.main+xml' => ['vsdx'], - 'application/vnd.ms-visio.stencil.macroenabled.main+xml' => ['vssm'], - 'application/vnd.ms-visio.stencil.main+xml' => ['vssx'], - 'application/vnd.ms-visio.template.macroenabled.main+xml' => ['vstm'], - 'application/vnd.ms-visio.template.main+xml' => ['vstx'], - 'application/vnd.ms-word' => ['doc'], - 'application/vnd.ms-word.document.macroenabled.12' => ['docm'], - 'application/vnd.ms-word.template.macroenabled.12' => ['dotm'], - 'application/vnd.ms-works' => ['wps', 'wks', 'wcm', 'wdb', 'xlr'], - 'application/vnd.ms-wpl' => ['wpl'], - 'application/vnd.ms-xpsdocument' => ['xps'], - 'application/vnd.msaccess' => ['mdb'], - 'application/vnd.mseq' => ['mseq'], - 'application/vnd.musician' => ['mus'], - 'application/vnd.muvee.style' => ['msty'], - 'application/vnd.mynfc' => ['taglet'], - 'application/vnd.neurolanguage.nlu' => ['nlu'], - 'application/vnd.nintendo.snes.rom' => ['sfc', 'smc'], - 'application/vnd.nitf' => ['ntf', 'nitf'], - 'application/vnd.noblenet-directory' => ['nnd'], - 'application/vnd.noblenet-sealer' => ['nns'], - 'application/vnd.noblenet-web' => ['nnw'], - 'application/vnd.nokia.n-gage.ac+xml' => ['ac'], - 'application/vnd.nokia.n-gage.data' => ['ngdat'], - 'application/vnd.nokia.n-gage.symbian.install' => ['n-gage'], - 'application/vnd.nokia.radio-preset' => ['rpst'], - 'application/vnd.nokia.radio-presets' => ['rpss'], - 'application/vnd.novadigm.edm' => ['edm'], - 'application/vnd.novadigm.edx' => ['edx'], - 'application/vnd.novadigm.ext' => ['ext'], - 'application/vnd.oasis.docbook+xml' => ['dbk', 'docbook'], - 'application/vnd.oasis.opendocument.chart' => ['odc'], - 'application/vnd.oasis.opendocument.chart-template' => ['otc'], - 'application/vnd.oasis.opendocument.database' => ['odb'], - 'application/vnd.oasis.opendocument.formula' => ['odf'], - 'application/vnd.oasis.opendocument.formula-template' => ['odft', 'otf'], - 'application/vnd.oasis.opendocument.graphics' => ['odg'], - 'application/vnd.oasis.opendocument.graphics-flat-xml' => ['fodg'], - 'application/vnd.oasis.opendocument.graphics-template' => ['otg'], - 'application/vnd.oasis.opendocument.image' => ['odi'], - 'application/vnd.oasis.opendocument.image-template' => ['oti'], - 'application/vnd.oasis.opendocument.presentation' => ['odp'], - 'application/vnd.oasis.opendocument.presentation-flat-xml' => ['fodp'], - 'application/vnd.oasis.opendocument.presentation-template' => ['otp'], - 'application/vnd.oasis.opendocument.spreadsheet' => ['ods'], - 'application/vnd.oasis.opendocument.spreadsheet-flat-xml' => ['fods'], - 'application/vnd.oasis.opendocument.spreadsheet-template' => ['ots'], - 'application/vnd.oasis.opendocument.text' => ['odt'], - 'application/vnd.oasis.opendocument.text-flat-xml' => ['fodt'], - 'application/vnd.oasis.opendocument.text-master' => ['odm'], - 'application/vnd.oasis.opendocument.text-template' => ['ott'], - 'application/vnd.oasis.opendocument.text-web' => ['oth'], - 'application/vnd.olpc-sugar' => ['xo'], - 'application/vnd.oma.dd2+xml' => ['dd2'], - 'application/vnd.openblox.game+xml' => ['obgx'], - 'application/vnd.openofficeorg.extension' => ['oxt'], - 'application/vnd.openstreetmap.data+xml' => ['osm'], - 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => ['pptx'], - 'application/vnd.openxmlformats-officedocument.presentationml.slide' => ['sldx'], - 'application/vnd.openxmlformats-officedocument.presentationml.slideshow' => ['ppsx'], - 'application/vnd.openxmlformats-officedocument.presentationml.template' => ['potx'], - 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => ['xlsx'], - 'application/vnd.openxmlformats-officedocument.spreadsheetml.template' => ['xltx'], - 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => ['docx'], - 'application/vnd.openxmlformats-officedocument.wordprocessingml.template' => ['dotx'], - 'application/vnd.osgeo.mapguide.package' => ['mgp'], - 'application/vnd.osgi.dp' => ['dp'], - 'application/vnd.osgi.subsystem' => ['esa'], - 'application/vnd.palm' => ['pdb', 'pqa', 'oprc', 'prc'], - 'application/vnd.pawaafile' => ['paw'], - 'application/vnd.pg.format' => ['str'], - 'application/vnd.pg.osasli' => ['ei6'], - 'application/vnd.picsel' => ['efif'], - 'application/vnd.pmi.widget' => ['wg'], - 'application/vnd.pocketlearn' => ['plf'], - 'application/vnd.powerbuilder6' => ['pbd'], - 'application/vnd.previewsystems.box' => ['box'], - 'application/vnd.proteus.magazine' => ['mgz'], - 'application/vnd.publishare-delta-tree' => ['qps'], - 'application/vnd.pvi.ptid1' => ['ptid'], - 'application/vnd.quark.quarkxpress' => ['qxd', 'qxt', 'qwd', 'qwt', 'qxl', 'qxb'], - 'application/vnd.rar' => ['rar'], - 'application/vnd.realvnc.bed' => ['bed'], - 'application/vnd.recordare.musicxml' => ['mxl'], - 'application/vnd.recordare.musicxml+xml' => ['musicxml'], - 'application/vnd.rig.cryptonote' => ['cryptonote'], - 'application/vnd.rim.cod' => ['cod'], - 'application/vnd.rn-realmedia' => ['rm', 'rmj', 'rmm', 'rms', 'rmx', 'rmvb'], - 'application/vnd.rn-realmedia-vbr' => ['rmvb', 'rm', 'rmj', 'rmm', 'rms', 'rmx'], - 'application/vnd.route66.link66+xml' => ['link66'], - 'application/vnd.sailingtracker.track' => ['st'], - 'application/vnd.sdp' => ['sdp'], - 'application/vnd.seemail' => ['see'], - 'application/vnd.sema' => ['sema'], - 'application/vnd.semd' => ['semd'], - 'application/vnd.semf' => ['semf'], - 'application/vnd.shana.informed.formdata' => ['ifm'], - 'application/vnd.shana.informed.formtemplate' => ['itp'], - 'application/vnd.shana.informed.interchange' => ['iif'], - 'application/vnd.shana.informed.package' => ['ipk'], - 'application/vnd.simtech-mindmapper' => ['twd', 'twds'], - 'application/vnd.smaf' => ['mmf', 'smaf'], - 'application/vnd.smart.teacher' => ['teacher'], - 'application/vnd.snap' => ['snap'], - 'application/vnd.software602.filler.form+xml' => ['fo'], - 'application/vnd.solent.sdkm+xml' => ['sdkm', 'sdkd'], - 'application/vnd.spotfire.dxp' => ['dxp'], - 'application/vnd.spotfire.sfs' => ['sfs'], - 'application/vnd.sqlite3' => ['sqlite3'], - 'application/vnd.squashfs' => ['sqsh'], - 'application/vnd.stardivision.calc' => ['sdc'], - 'application/vnd.stardivision.chart' => ['sds'], - 'application/vnd.stardivision.draw' => ['sda'], - 'application/vnd.stardivision.impress' => ['sdd', 'sdp'], - 'application/vnd.stardivision.mail' => ['smd'], - 'application/vnd.stardivision.math' => ['smf'], - 'application/vnd.stardivision.writer' => ['sdw', 'vor', 'sgl'], - 'application/vnd.stardivision.writer-global' => ['sgl', 'sdw', 'vor'], - 'application/vnd.stepmania.package' => ['smzip'], - 'application/vnd.stepmania.stepchart' => ['sm'], - 'application/vnd.sun.wadl+xml' => ['wadl'], - 'application/vnd.sun.xml.base' => ['odb'], - 'application/vnd.sun.xml.calc' => ['sxc'], - 'application/vnd.sun.xml.calc.template' => ['stc'], - 'application/vnd.sun.xml.draw' => ['sxd'], - 'application/vnd.sun.xml.draw.template' => ['std'], - 'application/vnd.sun.xml.impress' => ['sxi'], - 'application/vnd.sun.xml.impress.template' => ['sti'], - 'application/vnd.sun.xml.math' => ['sxm'], - 'application/vnd.sun.xml.writer' => ['sxw'], - 'application/vnd.sun.xml.writer.global' => ['sxg'], - 'application/vnd.sun.xml.writer.template' => ['stw'], - 'application/vnd.sus-calendar' => ['sus', 'susp'], - 'application/vnd.svd' => ['svd'], - 'application/vnd.symbian.install' => ['sis', 'sisx'], - 'application/vnd.syncml+xml' => ['xsm'], - 'application/vnd.syncml.dm+wbxml' => ['bdm'], - 'application/vnd.syncml.dm+xml' => ['xdm'], - 'application/vnd.syncml.dmddf+xml' => ['ddf'], - 'application/vnd.tao.intent-module-archive' => ['tao'], - 'application/vnd.tcpdump.pcap' => ['pcap', 'cap', 'dmp'], - 'application/vnd.tmobile-livetv' => ['tmo'], - 'application/vnd.trid.tpt' => ['tpt'], - 'application/vnd.triscape.mxs' => ['mxs'], - 'application/vnd.trueapp' => ['tra'], - 'application/vnd.ufdl' => ['ufd', 'ufdl'], - 'application/vnd.uiq.theme' => ['utz'], - 'application/vnd.umajin' => ['umj'], - 'application/vnd.unity' => ['unityweb'], - 'application/vnd.uoml+xml' => ['uoml'], - 'application/vnd.vcx' => ['vcx'], - 'application/vnd.visio' => ['vsd', 'vst', 'vss', 'vsw'], - 'application/vnd.visionary' => ['vis'], - 'application/vnd.vsf' => ['vsf'], - 'application/vnd.wap.wbxml' => ['wbxml'], - 'application/vnd.wap.wmlc' => ['wmlc'], - 'application/vnd.wap.wmlscriptc' => ['wmlsc'], - 'application/vnd.webturbo' => ['wtb'], - 'application/vnd.wolfram.player' => ['nbp'], - 'application/vnd.wordperfect' => ['wpd', 'wp', 'wp4', 'wp5', 'wp6', 'wpp'], - 'application/vnd.wqd' => ['wqd'], - 'application/vnd.wt.stf' => ['stf'], - 'application/vnd.xara' => ['xar'], - 'application/vnd.xdgapp' => ['flatpak', 'xdgapp'], - 'application/vnd.xfdl' => ['xfdl'], - 'application/vnd.yamaha.hv-dic' => ['hvd'], - 'application/vnd.yamaha.hv-script' => ['hvs'], - 'application/vnd.yamaha.hv-voice' => ['hvp'], - 'application/vnd.yamaha.openscoreformat' => ['osf'], - 'application/vnd.yamaha.openscoreformat.osfpvg+xml' => ['osfpvg'], - 'application/vnd.yamaha.smaf-audio' => ['saf'], - 'application/vnd.yamaha.smaf-phrase' => ['spf'], - 'application/vnd.yellowriver-custom-menu' => ['cmp'], - 'application/vnd.youtube.yt' => ['yt'], - 'application/vnd.zul' => ['zir', 'zirz'], - 'application/vnd.zzazz.deck+xml' => ['zaz'], - 'application/voicexml+xml' => ['vxml'], - 'application/wasm' => ['wasm'], - 'application/widget' => ['wgt'], - 'application/winhlp' => ['hlp'], - 'application/wk1' => ['123', 'wk1', 'wk3', 'wk4', 'wks'], - 'application/wmf' => ['wmf'], - 'application/wordperfect' => ['wp', 'wp4', 'wp5', 'wp6', 'wpd', 'wpp'], - 'application/wsdl+xml' => ['wsdl'], - 'application/wspolicy+xml' => ['wspolicy'], - 'application/wwf' => ['wwf'], - 'application/x-123' => ['123', 'wk1', 'wk3', 'wk4', 'wks'], - 'application/x-7z-compressed' => ['7z', '7z.001'], - 'application/x-abiword' => ['abw', 'abw.CRASHED', 'abw.gz', 'zabw'], - 'application/x-ace' => ['ace'], - 'application/x-ace-compressed' => ['ace'], - 'application/x-alz' => ['alz'], - 'application/x-amiga-disk-format' => ['adf'], - 'application/x-amipro' => ['sam'], - 'application/x-annodex' => ['anx'], - 'application/x-aportisdoc' => ['pdb', 'pdc'], - 'application/x-apple-diskimage' => ['dmg'], - 'application/x-apple-systemprofiler+xml' => ['spx'], - 'application/x-appleworks-document' => ['cwk'], - 'application/x-applix-spreadsheet' => ['as'], - 'application/x-applix-word' => ['aw'], - 'application/x-archive' => ['a', 'ar'], - 'application/x-arj' => ['arj'], - 'application/x-asp' => ['asp'], - 'application/x-atari-2600-rom' => ['a26'], - 'application/x-atari-7800-rom' => ['a78'], - 'application/x-atari-lynx-rom' => ['lnx'], - 'application/x-authorware-bin' => ['aab', 'x32', 'u32', 'vox'], - 'application/x-authorware-map' => ['aam'], - 'application/x-authorware-seg' => ['aas'], - 'application/x-awk' => ['awk'], - 'application/x-bcpio' => ['bcpio'], - 'application/x-bdoc' => ['bdoc'], - 'application/x-bittorrent' => ['torrent'], - 'application/x-blender' => ['blender', 'blend', 'BLEND'], - 'application/x-blorb' => ['blb', 'blorb'], - 'application/x-bps-patch' => ['bps'], - 'application/x-bsdiff' => ['bsdiff'], - 'application/x-bz2' => ['bz2'], - 'application/x-bzdvi' => ['dvi.bz2'], - 'application/x-bzip' => ['bz', 'bz2'], - 'application/x-bzip-compressed-tar' => ['tar.bz2', 'tar.bz', 'tbz2', 'tbz', 'tb2'], - 'application/x-bzip2' => ['bz2', 'boz', 'bz'], - 'application/x-bzpdf' => ['pdf.bz2'], - 'application/x-bzpostscript' => ['ps.bz2'], - 'application/x-cb7' => ['cb7'], - 'application/x-cbr' => ['cbr', 'cba', 'cbt', 'cbz', 'cb7'], - 'application/x-cbt' => ['cbt'], - 'application/x-cbz' => ['cbz'], - 'application/x-ccmx' => ['ccmx'], - 'application/x-cd-image' => ['iso', 'iso9660'], - 'application/x-cdlink' => ['vcd'], - 'application/x-cdr' => ['cdr'], - 'application/x-cdrdao-toc' => ['toc'], - 'application/x-cfs-compressed' => ['cfs'], - 'application/x-chat' => ['chat'], - 'application/x-chess-pgn' => ['pgn'], - 'application/x-chm' => ['chm'], - 'application/x-chrome-extension' => ['crx'], - 'application/x-cisco-vpn-settings' => ['pcf'], - 'application/x-cocoa' => ['cco'], - 'application/x-compress' => ['Z'], - 'application/x-compressed-iso' => ['cso'], - 'application/x-compressed-tar' => ['tar.gz', 'tgz'], - 'application/x-conference' => ['nsc'], - 'application/x-coreldraw' => ['cdr'], - 'application/x-cpio' => ['cpio'], - 'application/x-cpio-compressed' => ['cpio.gz'], - 'application/x-csh' => ['csh'], - 'application/x-cue' => ['cue'], - 'application/x-dar' => ['dar'], - 'application/x-dbase' => ['dbf'], - 'application/x-dbf' => ['dbf'], - 'application/x-dc-rom' => ['dc'], - 'application/x-deb' => ['deb', 'udeb'], - 'application/x-debian-package' => ['deb', 'udeb'], - 'application/x-designer' => ['ui'], - 'application/x-desktop' => ['desktop', 'kdelnk'], - 'application/x-dgc-compressed' => ['dgc'], - 'application/x-dia-diagram' => ['dia'], - 'application/x-dia-shape' => ['shape'], - 'application/x-director' => ['dir', 'dcr', 'dxr', 'cst', 'cct', 'cxt', 'w3d', 'fgd', 'swa'], - 'application/x-discjuggler-cd-image' => ['cdi'], - 'application/x-docbook+xml' => ['dbk', 'docbook'], - 'application/x-doom' => ['wad'], - 'application/x-doom-wad' => ['wad'], - 'application/x-dreamcast-rom' => ['iso'], - 'application/x-dtbncx+xml' => ['ncx'], - 'application/x-dtbook+xml' => ['dtb'], - 'application/x-dtbresource+xml' => ['res'], - 'application/x-dvi' => ['dvi'], - 'application/x-e-theme' => ['etheme'], - 'application/x-egon' => ['egon'], - 'application/x-emf' => ['emf'], - 'application/x-envoy' => ['evy'], - 'application/x-eva' => ['eva'], - 'application/x-fd-file' => ['fd', 'qd'], - 'application/x-fds-disk' => ['fds'], - 'application/x-fictionbook' => ['fb2'], - 'application/x-fictionbook+xml' => ['fb2'], - 'application/x-flash-video' => ['flv'], - 'application/x-fluid' => ['fl'], - 'application/x-font-afm' => ['afm'], - 'application/x-font-bdf' => ['bdf'], - 'application/x-font-ghostscript' => ['gsf'], - 'application/x-font-linux-psf' => ['psf'], - 'application/x-font-otf' => ['otf'], - 'application/x-font-pcf' => ['pcf', 'pcf.Z', 'pcf.gz'], - 'application/x-font-snf' => ['snf'], - 'application/x-font-speedo' => ['spd'], - 'application/x-font-truetype' => ['ttf'], - 'application/x-font-ttf' => ['ttf'], - 'application/x-font-ttx' => ['ttx'], - 'application/x-font-type1' => ['pfa', 'pfb', 'pfm', 'afm', 'gsf'], - 'application/x-font-woff' => ['woff'], - 'application/x-frame' => ['fm'], - 'application/x-freearc' => ['arc'], - 'application/x-futuresplash' => ['spl'], - 'application/x-gameboy-color-rom' => ['gbc', 'cgb'], - 'application/x-gameboy-rom' => ['gb', 'sgb'], - 'application/x-gamecube-iso-image' => ['iso'], - 'application/x-gamecube-rom' => ['iso'], - 'application/x-gamegear-rom' => ['gg'], - 'application/x-gba-rom' => ['gba', 'agb'], - 'application/x-gca-compressed' => ['gca'], - 'application/x-gd-rom-cue' => ['gdi'], - 'application/x-gedcom' => ['ged', 'gedcom'], - 'application/x-genesis-32x-rom' => ['32x', 'mdx'], - 'application/x-genesis-rom' => ['gen', 'smd', 'sgd'], - 'application/x-gettext' => ['po'], - 'application/x-gettext-translation' => ['gmo', 'mo'], - 'application/x-glade' => ['glade'], - 'application/x-glulx' => ['ulx'], - 'application/x-gnome-app-info' => ['desktop', 'kdelnk'], - 'application/x-gnucash' => ['gnucash', 'gnc', 'xac'], - 'application/x-gnumeric' => ['gnumeric'], - 'application/x-gnuplot' => ['gp', 'gplt', 'gnuplot'], - 'application/x-go-sgf' => ['sgf'], - 'application/x-gpx' => ['gpx'], - 'application/x-gpx+xml' => ['gpx'], - 'application/x-gramps-xml' => ['gramps'], - 'application/x-graphite' => ['gra'], - 'application/x-gtar' => ['gtar', 'tar', 'gem'], - 'application/x-gtk-builder' => ['ui'], - 'application/x-gz-font-linux-psf' => ['psf.gz'], - 'application/x-gzdvi' => ['dvi.gz'], - 'application/x-gzip' => ['gz'], - 'application/x-gzpdf' => ['pdf.gz'], - 'application/x-gzpostscript' => ['ps.gz'], - 'application/x-hdf' => ['hdf', 'hdf4', 'h4', 'hdf5', 'h5'], - 'application/x-hfe-file' => ['hfe'], - 'application/x-hfe-floppy-image' => ['hfe'], - 'application/x-httpd-php' => ['php'], - 'application/x-hwp' => ['hwp'], - 'application/x-hwt' => ['hwt'], - 'application/x-ica' => ['ica'], - 'application/x-install-instructions' => ['install'], - 'application/x-ips-patch' => ['ips'], - 'application/x-ipynb+json' => ['ipynb'], - 'application/x-iso9660-appimage' => ['appimage'], - 'application/x-iso9660-image' => ['iso', 'iso9660'], - 'application/x-it87' => ['it87'], - 'application/x-iwork-keynote-sffkey' => ['key'], - 'application/x-iwork-numbers-sffnumbers' => ['numbers'], - 'application/x-iwork-pages-sffpages' => ['pages'], - 'application/x-jar' => ['jar'], - 'application/x-java' => ['class'], - 'application/x-java-archive' => ['jar'], - 'application/x-java-archive-diff' => ['jardiff'], - 'application/x-java-class' => ['class'], - 'application/x-java-jce-keystore' => ['jceks'], - 'application/x-java-jnlp-file' => ['jnlp'], - 'application/x-java-keystore' => ['jks', 'ks'], - 'application/x-java-pack200' => ['pack'], - 'application/x-java-vm' => ['class'], - 'application/x-javascript' => ['js', 'jsm', 'mjs'], - 'application/x-jbuilder-project' => ['jpr', 'jpx'], - 'application/x-karbon' => ['karbon'], - 'application/x-kchart' => ['chrt'], - 'application/x-keepass2' => ['kdbx'], - 'application/x-kexi-connectiondata' => ['kexic'], - 'application/x-kexiproject-shortcut' => ['kexis'], - 'application/x-kexiproject-sqlite' => ['kexi'], - 'application/x-kexiproject-sqlite2' => ['kexi'], - 'application/x-kexiproject-sqlite3' => ['kexi'], - 'application/x-kformula' => ['kfo'], - 'application/x-killustrator' => ['kil'], - 'application/x-kivio' => ['flw'], - 'application/x-kontour' => ['kon'], - 'application/x-kpovmodeler' => ['kpm'], - 'application/x-kpresenter' => ['kpr', 'kpt'], - 'application/x-krita' => ['kra', 'krz'], - 'application/x-kspread' => ['ksp'], - 'application/x-kugar' => ['kud'], - 'application/x-kword' => ['kwd', 'kwt'], - 'application/x-latex' => ['latex'], - 'application/x-lha' => ['lha', 'lzh'], - 'application/x-lhz' => ['lhz'], - 'application/x-linguist' => ['ts'], - 'application/x-lotus123' => ['123', 'wk1', 'wk3', 'wk4', 'wks'], - 'application/x-lrzip' => ['lrz'], - 'application/x-lrzip-compressed-tar' => ['tar.lrz', 'tlrz'], - 'application/x-lua-bytecode' => ['luac'], - 'application/x-lyx' => ['lyx'], - 'application/x-lz4' => ['lz4'], - 'application/x-lz4-compressed-tar' => ['tar.lz4'], - 'application/x-lzh-compressed' => ['lzh', 'lha'], - 'application/x-lzip' => ['lz'], - 'application/x-lzip-compressed-tar' => ['tar.lz'], - 'application/x-lzma' => ['lzma'], - 'application/x-lzma-compressed-tar' => ['tar.lzma', 'tlz'], - 'application/x-lzop' => ['lzo'], - 'application/x-lzpdf' => ['pdf.lz'], - 'application/x-m4' => ['m4'], - 'application/x-magicpoint' => ['mgp'], - 'application/x-makeself' => ['run'], - 'application/x-mame-chd' => ['chd'], - 'application/x-markaby' => ['mab'], - 'application/x-mathematica' => ['nb'], - 'application/x-mdb' => ['mdb'], - 'application/x-mie' => ['mie'], - 'application/x-mif' => ['mif'], - 'application/x-mimearchive' => ['mhtml', 'mht'], - 'application/x-mobi8-ebook' => ['azw3', 'kfx'], - 'application/x-mobipocket-ebook' => ['prc', 'mobi'], - 'application/x-ms-application' => ['application'], - 'application/x-ms-asx' => ['asx', 'wax', 'wvx', 'wmx'], - 'application/x-ms-dos-executable' => ['exe'], - 'application/x-ms-shortcut' => ['lnk'], - 'application/x-ms-wim' => ['wim', 'swm'], - 'application/x-ms-wmd' => ['wmd'], - 'application/x-ms-wmz' => ['wmz'], - 'application/x-ms-xbap' => ['xbap'], - 'application/x-msaccess' => ['mdb'], - 'application/x-msbinder' => ['obd'], - 'application/x-mscardfile' => ['crd'], - 'application/x-msclip' => ['clp'], - 'application/x-msdos-program' => ['exe'], - 'application/x-msdownload' => ['exe', 'dll', 'com', 'bat', 'msi'], - 'application/x-msexcel' => ['xls', 'xlc', 'xll', 'xlm', 'xlw', 'xla', 'xlt', 'xld'], - 'application/x-msi' => ['msi'], - 'application/x-msmediaview' => ['mvb', 'm13', 'm14'], - 'application/x-msmetafile' => ['wmf', 'wmz', 'emf', 'emz'], - 'application/x-msmoney' => ['mny'], - 'application/x-mspowerpoint' => ['ppz', 'ppt', 'pps', 'pot'], - 'application/x-mspublisher' => ['pub'], - 'application/x-msschedule' => ['scd'], - 'application/x-msterminal' => ['trm'], - 'application/x-mswinurl' => ['url'], - 'application/x-msword' => ['doc'], - 'application/x-mswrite' => ['wri'], - 'application/x-msx-rom' => ['msx'], - 'application/x-n64-rom' => ['n64', 'z64', 'v64'], - 'application/x-navi-animation' => ['ani'], - 'application/x-neo-geo-pocket-color-rom' => ['ngc'], - 'application/x-neo-geo-pocket-rom' => ['ngp'], - 'application/x-nes-rom' => ['nes', 'nez', 'unf', 'unif'], - 'application/x-netcdf' => ['nc', 'cdf'], - 'application/x-netshow-channel' => ['nsc'], - 'application/x-nintendo-3ds-executable' => ['3dsx'], - 'application/x-nintendo-3ds-rom' => ['3ds', 'cci'], - 'application/x-nintendo-ds-rom' => ['nds'], - 'application/x-ns-proxy-autoconfig' => ['pac'], - 'application/x-nzb' => ['nzb'], - 'application/x-object' => ['o', 'mod'], - 'application/x-ogg' => ['ogx'], - 'application/x-oleo' => ['oleo'], - 'application/x-pagemaker' => ['p65', 'pm', 'pm6', 'pmd'], - 'application/x-pak' => ['pak'], - 'application/x-palm-database' => ['prc', 'pdb', 'pqa', 'oprc'], - 'application/x-par2' => ['PAR2', 'par2'], - 'application/x-partial-download' => ['wkdownload', 'crdownload', 'part'], - 'application/x-pc-engine-rom' => ['pce'], - 'application/x-pcap' => ['pcap', 'cap', 'dmp'], - 'application/x-pdf' => ['pdf'], - 'application/x-perl' => ['pl', 'pm', 'PL', 'al', 'perl', 'pod', 't'], - 'application/x-photoshop' => ['psd'], - 'application/x-php' => ['php', 'php3', 'php4', 'php5', 'phps'], - 'application/x-pilot' => ['prc', 'pdb'], - 'application/x-pkcs12' => ['p12', 'pfx'], - 'application/x-pkcs7-certificates' => ['p7b', 'spc'], - 'application/x-pkcs7-certreqresp' => ['p7r'], - 'application/x-planperfect' => ['pln'], - 'application/x-pocket-word' => ['psw'], - 'application/x-pw' => ['pw'], - 'application/x-pyspread-bz-spreadsheet' => ['pys'], - 'application/x-pyspread-spreadsheet' => ['pysu'], - 'application/x-python-bytecode' => ['pyc', 'pyo'], - 'application/x-qed-disk' => ['qed'], - 'application/x-qemu-disk' => ['qcow2', 'qcow'], - 'application/x-qpress' => ['qp'], - 'application/x-qtiplot' => ['qti', 'qti.gz'], - 'application/x-quattropro' => ['wb1', 'wb2', 'wb3'], - 'application/x-quicktime-media-link' => ['qtl'], - 'application/x-quicktimeplayer' => ['qtl'], - 'application/x-qw' => ['qif'], - 'application/x-rar' => ['rar'], - 'application/x-rar-compressed' => ['rar'], - 'application/x-raw-disk-image' => ['raw-disk-image', 'img'], - 'application/x-raw-disk-image-xz-compressed' => ['raw-disk-image.xz', 'img.xz'], - 'application/x-raw-floppy-disk-image' => ['fd', 'qd'], - 'application/x-redhat-package-manager' => ['rpm'], - 'application/x-reject' => ['rej'], - 'application/x-research-info-systems' => ['ris'], - 'application/x-rnc' => ['rnc'], - 'application/x-rpm' => ['rpm'], - 'application/x-ruby' => ['rb'], - 'application/x-sami' => ['smi', 'sami'], - 'application/x-sap-file' => ['sap'], - 'application/x-saturn-rom' => ['iso'], - 'application/x-sdp' => ['sdp'], - 'application/x-sea' => ['sea'], - 'application/x-sega-cd-rom' => ['iso'], - 'application/x-sega-pico-rom' => ['iso'], - 'application/x-sg1000-rom' => ['sg'], - 'application/x-sh' => ['sh'], - 'application/x-shar' => ['shar'], - 'application/x-shared-library-la' => ['la'], - 'application/x-sharedlib' => ['so'], - 'application/x-shellscript' => ['sh'], - 'application/x-shockwave-flash' => ['swf', 'spl'], - 'application/x-shorten' => ['shn'], - 'application/x-siag' => ['siag'], - 'application/x-silverlight-app' => ['xap'], - 'application/x-sit' => ['sit'], - 'application/x-smaf' => ['mmf', 'smaf'], - 'application/x-sms-rom' => ['sms'], - 'application/x-snes-rom' => ['sfc', 'smc'], - 'application/x-source-rpm' => ['src.rpm', 'spm'], - 'application/x-spss-por' => ['por'], - 'application/x-spss-sav' => ['sav', 'zsav'], - 'application/x-spss-savefile' => ['sav', 'zsav'], - 'application/x-sql' => ['sql'], - 'application/x-sqlite2' => ['sqlite2'], - 'application/x-sqlite3' => ['sqlite3'], - 'application/x-srt' => ['srt'], - 'application/x-stuffit' => ['sit'], - 'application/x-stuffitx' => ['sitx'], - 'application/x-subrip' => ['srt'], - 'application/x-sv4cpio' => ['sv4cpio'], - 'application/x-sv4crc' => ['sv4crc'], - 'application/x-t3vm-image' => ['t3'], - 'application/x-t602' => ['602'], - 'application/x-tads' => ['gam'], - 'application/x-tar' => ['tar', 'gtar', 'gem'], - 'application/x-targa' => ['tga', 'icb', 'tpic', 'vda', 'vst'], - 'application/x-tarz' => ['tar.Z', 'taz'], - 'application/x-tcl' => ['tcl', 'tk'], - 'application/x-tex' => ['tex', 'ltx', 'sty', 'cls', 'dtx', 'ins', 'latex'], - 'application/x-tex-gf' => ['gf'], - 'application/x-tex-pk' => ['pk'], - 'application/x-tex-tfm' => ['tfm'], - 'application/x-texinfo' => ['texinfo', 'texi'], - 'application/x-tga' => ['tga', 'icb', 'tpic', 'vda', 'vst'], - 'application/x-tgif' => ['obj'], - 'application/x-theme' => ['theme'], - 'application/x-thomson-cartridge-memo7' => ['m7'], - 'application/x-thomson-cassette' => ['k7'], - 'application/x-thomson-sap-image' => ['sap'], - 'application/x-trash' => ['bak', 'old', 'sik'], - 'application/x-trig' => ['trig'], - 'application/x-troff' => ['tr', 'roff', 't'], - 'application/x-troff-man' => ['man'], - 'application/x-tzo' => ['tar.lzo', 'tzo'], - 'application/x-ufraw' => ['ufraw'], - 'application/x-ustar' => ['ustar'], - 'application/x-vdi-disk' => ['vdi'], - 'application/x-vhd-disk' => ['vhd', 'vpc'], - 'application/x-vhdx-disk' => ['vhdx'], - 'application/x-virtual-boy-rom' => ['vb'], - 'application/x-virtualbox-hdd' => ['hdd'], - 'application/x-virtualbox-ova' => ['ova'], - 'application/x-virtualbox-ovf' => ['ovf'], - 'application/x-virtualbox-vbox' => ['vbox'], - 'application/x-virtualbox-vbox-extpack' => ['vbox-extpack'], - 'application/x-virtualbox-vdi' => ['vdi'], - 'application/x-virtualbox-vhd' => ['vhd', 'vpc'], - 'application/x-virtualbox-vhdx' => ['vhdx'], - 'application/x-virtualbox-vmdk' => ['vmdk'], - 'application/x-vmdk-disk' => ['vmdk'], - 'application/x-vnd.kde.kexi' => ['kexi'], - 'application/x-wais-source' => ['src'], - 'application/x-wbfs' => ['iso'], - 'application/x-web-app-manifest+json' => ['webapp'], - 'application/x-wia' => ['iso'], - 'application/x-wii-iso-image' => ['iso'], - 'application/x-wii-rom' => ['iso'], - 'application/x-wii-wad' => ['wad'], - 'application/x-windows-themepack' => ['themepack'], - 'application/x-wmf' => ['wmf'], - 'application/x-wonderswan-color-rom' => ['wsc'], - 'application/x-wonderswan-rom' => ['ws'], - 'application/x-wordperfect' => ['wp', 'wp4', 'wp5', 'wp6', 'wpd', 'wpp'], - 'application/x-wpg' => ['wpg'], - 'application/x-wwf' => ['wwf'], - 'application/x-x509-ca-cert' => ['der', 'crt', 'pem', 'cert'], - 'application/x-xar' => ['xar', 'pkg'], - 'application/x-xbel' => ['xbel'], - 'application/x-xfig' => ['fig'], - 'application/x-xliff' => ['xlf', 'xliff'], - 'application/x-xliff+xml' => ['xlf'], - 'application/x-xpinstall' => ['xpi'], - 'application/x-xspf+xml' => ['xspf'], - 'application/x-xz' => ['xz'], - 'application/x-xz-compressed-tar' => ['tar.xz', 'txz'], - 'application/x-xzpdf' => ['pdf.xz'], - 'application/x-yaml' => ['yaml', 'yml'], - 'application/x-zip' => ['zip'], - 'application/x-zip-compressed' => ['zip'], - 'application/x-zip-compressed-fb2' => ['fb2.zip'], - 'application/x-zmachine' => ['z1', 'z2', 'z3', 'z4', 'z5', 'z6', 'z7', 'z8'], - 'application/x-zoo' => ['zoo'], - 'application/x-zstd-compressed-tar' => ['tar.zst', 'tzst'], - 'application/xaml+xml' => ['xaml'], - 'application/xcap-att+xml' => ['xav'], - 'application/xcap-caps+xml' => ['xca'], - 'application/xcap-diff+xml' => ['xdf'], - 'application/xcap-el+xml' => ['xel'], - 'application/xcap-error+xml' => ['xer'], - 'application/xcap-ns+xml' => ['xns'], - 'application/xenc+xml' => ['xenc'], - 'application/xhtml+xml' => ['xhtml', 'xht', 'html', 'htm'], - 'application/xliff+xml' => ['xlf', 'xliff'], - 'application/xml' => ['xml', 'xsl', 'xsd', 'rng', 'xbl'], - 'application/xml-dtd' => ['dtd'], - 'application/xml-external-parsed-entity' => ['ent'], - 'application/xop+xml' => ['xop'], - 'application/xproc+xml' => ['xpl'], - 'application/xps' => ['xps'], - 'application/xslt+xml' => ['xsl', 'xslt'], - 'application/xspf+xml' => ['xspf'], - 'application/xv+xml' => ['mxml', 'xhvml', 'xvml', 'xvm'], - 'application/yang' => ['yang'], - 'application/yin+xml' => ['yin'], - 'application/zip' => ['zip'], - 'application/zlib' => ['zz'], - 'application/zstd' => ['zst'], - 'audio/3gpp' => ['3gpp', '3gp', '3ga'], - 'audio/3gpp-encrypted' => ['3gp', '3gpp', '3ga'], - 'audio/3gpp2' => ['3g2', '3gp2', '3gpp2'], - 'audio/aac' => ['aac', 'adts', 'ass'], - 'audio/ac3' => ['ac3'], - 'audio/adpcm' => ['adp'], - 'audio/amr' => ['amr'], - 'audio/amr-encrypted' => ['amr'], - 'audio/amr-wb' => ['awb'], - 'audio/amr-wb-encrypted' => ['awb'], - 'audio/annodex' => ['axa'], - 'audio/basic' => ['au', 'snd'], - 'audio/flac' => ['flac'], - 'audio/imelody' => ['imy', 'ime'], - 'audio/m3u' => ['m3u', 'm3u8', 'vlc'], - 'audio/m4a' => ['m4a', 'f4a'], - 'audio/midi' => ['mid', 'midi', 'kar', 'rmi'], - 'audio/mobile-xmf' => ['mxmf', 'xmf'], - 'audio/mp2' => ['mp2'], - 'audio/mp3' => ['mp3', 'mpga'], - 'audio/mp4' => ['m4a', 'mp4a', 'f4a'], - 'audio/mpeg' => ['mp3', 'mpga', 'mp2', 'mp2a', 'm2a', 'm3a'], - 'audio/mpegurl' => ['m3u', 'm3u8', 'vlc'], - 'audio/ogg' => ['ogg', 'oga', 'spx', 'opus'], - 'audio/prs.sid' => ['sid', 'psid'], - 'audio/s3m' => ['s3m'], - 'audio/scpls' => ['pls'], - 'audio/silk' => ['sil'], - 'audio/tta' => ['tta'], - 'audio/usac' => ['loas', 'xhe'], - 'audio/vnd.audible' => ['aa', 'aax'], - 'audio/vnd.audible.aax' => ['aax'], - 'audio/vnd.dece.audio' => ['uva', 'uvva'], - 'audio/vnd.digital-winds' => ['eol'], - 'audio/vnd.dra' => ['dra'], - 'audio/vnd.dts' => ['dts'], - 'audio/vnd.dts.hd' => ['dtshd'], - 'audio/vnd.lucent.voice' => ['lvp'], - 'audio/vnd.m-realaudio' => ['ra', 'rax'], - 'audio/vnd.ms-playready.media.pya' => ['pya'], - 'audio/vnd.nuera.ecelp4800' => ['ecelp4800'], - 'audio/vnd.nuera.ecelp7470' => ['ecelp7470'], - 'audio/vnd.nuera.ecelp9600' => ['ecelp9600'], - 'audio/vnd.rip' => ['rip'], - 'audio/vnd.rn-realaudio' => ['ra', 'rax'], - 'audio/vnd.wave' => ['wav'], - 'audio/vorbis' => ['oga', 'ogg'], - 'audio/wav' => ['wav'], - 'audio/wave' => ['wav'], - 'audio/webm' => ['weba'], - 'audio/wma' => ['wma'], - 'audio/x-aac' => ['aac', 'adts', 'ass'], - 'audio/x-aifc' => ['aifc', 'aiffc'], - 'audio/x-aiff' => ['aif', 'aiff', 'aifc'], - 'audio/x-aiffc' => ['aifc', 'aiffc'], - 'audio/x-amzxml' => ['amz'], - 'audio/x-annodex' => ['axa'], - 'audio/x-ape' => ['ape'], - 'audio/x-caf' => ['caf'], - 'audio/x-dts' => ['dts'], - 'audio/x-dtshd' => ['dtshd'], - 'audio/x-flac' => ['flac'], - 'audio/x-flac+ogg' => ['oga', 'ogg'], - 'audio/x-gsm' => ['gsm'], - 'audio/x-hx-aac-adts' => ['aac', 'adts', 'ass'], - 'audio/x-imelody' => ['imy', 'ime'], - 'audio/x-iriver-pla' => ['pla'], - 'audio/x-it' => ['it'], - 'audio/x-m3u' => ['m3u', 'm3u8', 'vlc'], - 'audio/x-m4a' => ['m4a', 'f4a'], - 'audio/x-m4b' => ['m4b', 'f4b'], - 'audio/x-m4r' => ['m4r'], - 'audio/x-matroska' => ['mka'], - 'audio/x-midi' => ['mid', 'midi', 'kar'], - 'audio/x-minipsf' => ['minipsf'], - 'audio/x-mo3' => ['mo3'], - 'audio/x-mod' => ['mod', 'ult', 'uni', 'm15', 'mtm', '669', 'med'], - 'audio/x-mp2' => ['mp2'], - 'audio/x-mp3' => ['mp3', 'mpga'], - 'audio/x-mp3-playlist' => ['m3u', 'm3u8', 'vlc'], - 'audio/x-mpeg' => ['mp3', 'mpga'], - 'audio/x-mpegurl' => ['m3u', 'm3u8', 'vlc'], - 'audio/x-mpg' => ['mp3', 'mpga'], - 'audio/x-ms-asx' => ['asx', 'wax', 'wvx', 'wmx'], - 'audio/x-ms-wax' => ['wax'], - 'audio/x-ms-wma' => ['wma'], - 'audio/x-ms-wmv' => ['wmv'], - 'audio/x-musepack' => ['mpc', 'mpp', 'mp+'], - 'audio/x-ogg' => ['oga', 'ogg', 'opus'], - 'audio/x-oggflac' => ['oga', 'ogg'], - 'audio/x-opus+ogg' => ['opus'], - 'audio/x-pn-audibleaudio' => ['aa', 'aax'], - 'audio/x-pn-realaudio' => ['ram', 'ra', 'rax'], - 'audio/x-pn-realaudio-plugin' => ['rmp'], - 'audio/x-psf' => ['psf'], - 'audio/x-psflib' => ['psflib'], - 'audio/x-realaudio' => ['ra'], - 'audio/x-rn-3gpp-amr' => ['3gp', '3gpp', '3ga'], - 'audio/x-rn-3gpp-amr-encrypted' => ['3gp', '3gpp', '3ga'], - 'audio/x-rn-3gpp-amr-wb' => ['3gp', '3gpp', '3ga'], - 'audio/x-rn-3gpp-amr-wb-encrypted' => ['3gp', '3gpp', '3ga'], - 'audio/x-s3m' => ['s3m'], - 'audio/x-scpls' => ['pls'], - 'audio/x-shorten' => ['shn'], - 'audio/x-speex' => ['spx'], - 'audio/x-speex+ogg' => ['oga', 'ogg', 'spx'], - 'audio/x-stm' => ['stm'], - 'audio/x-tta' => ['tta'], - 'audio/x-voc' => ['voc'], - 'audio/x-vorbis' => ['oga', 'ogg'], - 'audio/x-vorbis+ogg' => ['oga', 'ogg'], - 'audio/x-wav' => ['wav'], - 'audio/x-wavpack' => ['wv', 'wvp'], - 'audio/x-wavpack-correction' => ['wvc'], - 'audio/x-xi' => ['xi'], - 'audio/x-xm' => ['xm'], - 'audio/x-xmf' => ['xmf'], - 'audio/xm' => ['xm'], - 'audio/xmf' => ['xmf'], - 'chemical/x-cdx' => ['cdx'], - 'chemical/x-cif' => ['cif'], - 'chemical/x-cmdf' => ['cmdf'], - 'chemical/x-cml' => ['cml'], - 'chemical/x-csml' => ['csml'], - 'chemical/x-xyz' => ['xyz'], - 'flv-application/octet-stream' => ['flv'], - 'font/collection' => ['ttc'], - 'font/otf' => ['otf'], - 'font/ttf' => ['ttf'], - 'font/woff' => ['woff'], - 'font/woff2' => ['woff2'], - 'image/aces' => ['exr'], - 'image/apng' => ['apng'], - 'image/astc' => ['astc'], - 'image/avif' => ['avif', 'avifs'], - 'image/avif-sequence' => ['avif', 'avifs'], - 'image/bmp' => ['bmp', 'dib'], - 'image/cdr' => ['cdr'], - 'image/cgm' => ['cgm'], - 'image/dicom-rle' => ['drle'], - 'image/emf' => ['emf'], - 'image/fax-g3' => ['g3'], - 'image/fits' => ['fits'], - 'image/g3fax' => ['g3'], - 'image/gif' => ['gif'], - 'image/heic' => ['heic', 'heif'], - 'image/heic-sequence' => ['heics', 'heic', 'heif'], - 'image/heif' => ['heif', 'heic'], - 'image/heif-sequence' => ['heifs', 'heic', 'heif'], - 'image/hej2k' => ['hej2'], - 'image/hsj2' => ['hsj2'], - 'image/ico' => ['ico'], - 'image/icon' => ['ico'], - 'image/ief' => ['ief'], - 'image/jls' => ['jls'], - 'image/jp2' => ['jp2', 'jpg2'], - 'image/jpeg' => ['jpg', 'jpeg', 'jpe'], - 'image/jpeg2000' => ['jp2', 'jpg2'], - 'image/jpeg2000-image' => ['jp2', 'jpg2'], - 'image/jph' => ['jph'], - 'image/jphc' => ['jhc'], - 'image/jpm' => ['jpm', 'jpgm'], - 'image/jpx' => ['jpx', 'jpf'], - 'image/jxl' => ['jxl'], - 'image/jxr' => ['jxr'], - 'image/jxra' => ['jxra'], - 'image/jxrs' => ['jxrs'], - 'image/jxs' => ['jxs'], - 'image/jxsc' => ['jxsc'], - 'image/jxsi' => ['jxsi'], - 'image/jxss' => ['jxss'], - 'image/ktx' => ['ktx'], - 'image/ktx2' => ['ktx2'], - 'image/openraster' => ['ora'], - 'image/pdf' => ['pdf'], - 'image/photoshop' => ['psd'], - 'image/pjpeg' => ['jpg', 'jpeg', 'jpe'], - 'image/png' => ['png'], - 'image/prs.btif' => ['btif'], - 'image/prs.pti' => ['pti'], - 'image/psd' => ['psd'], - 'image/rle' => ['rle'], - 'image/sgi' => ['sgi'], - 'image/svg' => ['svg'], - 'image/svg+xml' => ['svg', 'svgz'], - 'image/svg+xml-compressed' => ['svgz'], - 'image/t38' => ['t38'], - 'image/targa' => ['tga', 'icb', 'tpic', 'vda', 'vst'], - 'image/tga' => ['tga', 'icb', 'tpic', 'vda', 'vst'], - 'image/tiff' => ['tif', 'tiff'], - 'image/tiff-fx' => ['tfx'], - 'image/vnd.adobe.photoshop' => ['psd'], - 'image/vnd.airzip.accelerator.azv' => ['azv'], - 'image/vnd.dece.graphic' => ['uvi', 'uvvi', 'uvg', 'uvvg'], - 'image/vnd.djvu' => ['djvu', 'djv'], - 'image/vnd.djvu+multipage' => ['djvu', 'djv'], - 'image/vnd.dvb.subtitle' => ['sub'], - 'image/vnd.dwg' => ['dwg'], - 'image/vnd.dxf' => ['dxf'], - 'image/vnd.fastbidsheet' => ['fbs'], - 'image/vnd.fpx' => ['fpx'], - 'image/vnd.fst' => ['fst'], - 'image/vnd.fujixerox.edmics-mmr' => ['mmr'], - 'image/vnd.fujixerox.edmics-rlc' => ['rlc'], - 'image/vnd.microsoft.icon' => ['ico'], - 'image/vnd.ms-dds' => ['dds'], - 'image/vnd.ms-modi' => ['mdi'], - 'image/vnd.ms-photo' => ['wdp'], - 'image/vnd.net-fpx' => ['npx'], - 'image/vnd.pco.b16' => ['b16'], - 'image/vnd.rn-realpix' => ['rp'], - 'image/vnd.tencent.tap' => ['tap'], - 'image/vnd.valve.source.texture' => ['vtf'], - 'image/vnd.wap.wbmp' => ['wbmp'], - 'image/vnd.xiff' => ['xif'], - 'image/vnd.zbrush.pcx' => ['pcx'], - 'image/webp' => ['webp'], - 'image/wmf' => ['wmf'], - 'image/x-3ds' => ['3ds'], - 'image/x-adobe-dng' => ['dng'], - 'image/x-applix-graphics' => ['ag'], - 'image/x-bmp' => ['bmp', 'dib'], - 'image/x-bzeps' => ['eps.bz2', 'epsi.bz2', 'epsf.bz2'], - 'image/x-canon-cr2' => ['cr2'], - 'image/x-canon-cr3' => ['cr3'], - 'image/x-canon-crw' => ['crw'], - 'image/x-cdr' => ['cdr'], - 'image/x-cmu-raster' => ['ras'], - 'image/x-cmx' => ['cmx'], - 'image/x-compressed-xcf' => ['xcf.gz', 'xcf.bz2'], - 'image/x-dds' => ['dds'], - 'image/x-djvu' => ['djvu', 'djv'], - 'image/x-emf' => ['emf'], - 'image/x-eps' => ['eps', 'epsi', 'epsf'], - 'image/x-exr' => ['exr'], - 'image/x-fits' => ['fits'], - 'image/x-freehand' => ['fh', 'fhc', 'fh4', 'fh5', 'fh7'], - 'image/x-fuji-raf' => ['raf'], - 'image/x-gimp-gbr' => ['gbr'], - 'image/x-gimp-gih' => ['gih'], - 'image/x-gimp-pat' => ['pat'], - 'image/x-gzeps' => ['eps.gz', 'epsi.gz', 'epsf.gz'], - 'image/x-icb' => ['tga', 'icb', 'tpic', 'vda', 'vst'], - 'image/x-icns' => ['icns'], - 'image/x-ico' => ['ico'], - 'image/x-icon' => ['ico'], - 'image/x-iff' => ['iff', 'ilbm', 'lbm'], - 'image/x-ilbm' => ['iff', 'ilbm', 'lbm'], - 'image/x-jng' => ['jng'], - 'image/x-jp2-codestream' => ['j2c', 'j2k', 'jpc'], - 'image/x-jpeg2000-image' => ['jp2', 'jpg2'], - 'image/x-kodak-dcr' => ['dcr'], - 'image/x-kodak-k25' => ['k25'], - 'image/x-kodak-kdc' => ['kdc'], - 'image/x-lwo' => ['lwo', 'lwob'], - 'image/x-lws' => ['lws'], - 'image/x-macpaint' => ['pntg'], - 'image/x-minolta-mrw' => ['mrw'], - 'image/x-mrsid-image' => ['sid'], - 'image/x-ms-bmp' => ['bmp', 'dib'], - 'image/x-msod' => ['msod'], - 'image/x-nikon-nef' => ['nef'], - 'image/x-nikon-nrw' => ['nrw'], - 'image/x-olympus-orf' => ['orf'], - 'image/x-panasonic-raw' => ['raw'], - 'image/x-panasonic-raw2' => ['rw2'], - 'image/x-panasonic-rw' => ['raw'], - 'image/x-panasonic-rw2' => ['rw2'], - 'image/x-pcx' => ['pcx'], - 'image/x-pentax-pef' => ['pef'], - 'image/x-photo-cd' => ['pcd'], - 'image/x-photoshop' => ['psd'], - 'image/x-pict' => ['pic', 'pct', 'pict', 'pict1', 'pict2'], - 'image/x-portable-anymap' => ['pnm'], - 'image/x-portable-bitmap' => ['pbm'], - 'image/x-portable-graymap' => ['pgm'], - 'image/x-portable-pixmap' => ['ppm'], - 'image/x-psd' => ['psd'], - 'image/x-quicktime' => ['qtif', 'qif'], - 'image/x-rgb' => ['rgb'], - 'image/x-sgi' => ['sgi'], - 'image/x-sigma-x3f' => ['x3f'], - 'image/x-skencil' => ['sk', 'sk1'], - 'image/x-sony-arw' => ['arw'], - 'image/x-sony-sr2' => ['sr2'], - 'image/x-sony-srf' => ['srf'], - 'image/x-sun-raster' => ['sun'], - 'image/x-targa' => ['tga', 'icb', 'tpic', 'vda', 'vst'], - 'image/x-tga' => ['tga', 'icb', 'tpic', 'vda', 'vst'], - 'image/x-win-bitmap' => ['cur'], - 'image/x-win-metafile' => ['wmf'], - 'image/x-wmf' => ['wmf'], - 'image/x-xbitmap' => ['xbm'], - 'image/x-xcf' => ['xcf'], - 'image/x-xfig' => ['fig'], - 'image/x-xpixmap' => ['xpm'], - 'image/x-xpm' => ['xpm'], - 'image/x-xwindowdump' => ['xwd'], - 'image/x.djvu' => ['djvu', 'djv'], - 'message/disposition-notification' => ['disposition-notification'], - 'message/global' => ['u8msg'], - 'message/global-delivery-status' => ['u8dsn'], - 'message/global-disposition-notification' => ['u8mdn'], - 'message/global-headers' => ['u8hdr'], - 'message/rfc822' => ['eml', 'mime'], - 'message/vnd.wfa.wsc' => ['wsc'], - 'model/3mf' => ['3mf'], - 'model/gltf+json' => ['gltf'], - 'model/gltf-binary' => ['glb'], - 'model/iges' => ['igs', 'iges'], - 'model/mesh' => ['msh', 'mesh', 'silo'], - 'model/mtl' => ['mtl'], - 'model/obj' => ['obj'], - 'model/step+zip' => ['stpz'], - 'model/step-xml+zip' => ['stpxz'], - 'model/stl' => ['stl'], - 'model/vnd.collada+xml' => ['dae'], - 'model/vnd.dwf' => ['dwf'], - 'model/vnd.gdl' => ['gdl'], - 'model/vnd.gtw' => ['gtw'], - 'model/vnd.mts' => ['mts'], - 'model/vnd.opengex' => ['ogex'], - 'model/vnd.parasolid.transmit.binary' => ['x_b'], - 'model/vnd.parasolid.transmit.text' => ['x_t'], - 'model/vnd.sap.vds' => ['vds'], - 'model/vnd.usdz+zip' => ['usdz'], - 'model/vnd.valve.source.compiled-map' => ['bsp'], - 'model/vnd.vtu' => ['vtu'], - 'model/vrml' => ['wrl', 'vrml', 'vrm'], - 'model/x.stl-ascii' => ['stl'], - 'model/x.stl-binary' => ['stl'], - 'model/x3d+binary' => ['x3db', 'x3dbz'], - 'model/x3d+fastinfoset' => ['x3db'], - 'model/x3d+vrml' => ['x3dv', 'x3dvz'], - 'model/x3d+xml' => ['x3d', 'x3dz'], - 'model/x3d-vrml' => ['x3dv'], - 'text/cache-manifest' => ['appcache', 'manifest'], - 'text/calendar' => ['ics', 'ifb', 'vcs'], - 'text/coffeescript' => ['coffee', 'litcoffee'], - 'text/crystal' => ['cr'], - 'text/css' => ['css'], - 'text/csv' => ['csv'], - 'text/csv-schema' => ['csvs'], - 'text/directory' => ['vcard', 'vcf', 'vct', 'gcrd'], - 'text/ecmascript' => ['es'], - 'text/gedcom' => ['ged', 'gedcom'], - 'text/google-video-pointer' => ['gvp'], - 'text/html' => ['html', 'htm', 'shtml'], - 'text/ico' => ['ico'], - 'text/jade' => ['jade'], - 'text/javascript' => ['js', 'jsm', 'mjs'], - 'text/jsx' => ['jsx'], - 'text/less' => ['less'], - 'text/markdown' => ['md', 'markdown', 'mkd'], - 'text/mathml' => ['mml'], - 'text/mdx' => ['mdx'], - 'text/n3' => ['n3'], - 'text/org' => ['org'], - 'text/plain' => ['txt', 'text', 'conf', 'def', 'list', 'log', 'in', 'ini', 'asc'], - 'text/prs.lines.tag' => ['dsc'], - 'text/rdf' => ['rdf', 'rdfs', 'owl'], - 'text/richtext' => ['rtx'], - 'text/rss' => ['rss'], - 'text/rtf' => ['rtf'], - 'text/rust' => ['rs'], - 'text/sgml' => ['sgml', 'sgm'], - 'text/shex' => ['shex'], - 'text/slim' => ['slim', 'slm'], - 'text/spdx' => ['spdx'], - 'text/spreadsheet' => ['sylk', 'slk'], - 'text/stylus' => ['stylus', 'styl'], - 'text/tab-separated-values' => ['tsv'], - 'text/tcl' => ['tcl', 'tk'], - 'text/troff' => ['t', 'tr', 'roff', 'man', 'me', 'ms'], - 'text/turtle' => ['ttl'], - 'text/uri-list' => ['uri', 'uris', 'urls'], - 'text/vbs' => ['vbs'], - 'text/vbscript' => ['vbs'], - 'text/vcard' => ['vcard', 'vcf', 'vct', 'gcrd'], - 'text/vnd.curl' => ['curl'], - 'text/vnd.curl.dcurl' => ['dcurl'], - 'text/vnd.curl.mcurl' => ['mcurl'], - 'text/vnd.curl.scurl' => ['scurl'], - 'text/vnd.dvb.subtitle' => ['sub'], - 'text/vnd.fly' => ['fly'], - 'text/vnd.fmi.flexstor' => ['flx'], - 'text/vnd.graphviz' => ['gv', 'dot'], - 'text/vnd.in3d.3dml' => ['3dml'], - 'text/vnd.in3d.spot' => ['spot'], - 'text/vnd.qt.linguist' => ['ts'], - 'text/vnd.rn-realtext' => ['rt'], - 'text/vnd.senx.warpscript' => ['mc2'], - 'text/vnd.sun.j2me.app-descriptor' => ['jad'], - 'text/vnd.trolltech.linguist' => ['ts'], - 'text/vnd.wap.wml' => ['wml'], - 'text/vnd.wap.wmlscript' => ['wmls'], - 'text/vtt' => ['vtt'], - 'text/x-adasrc' => ['adb', 'ads'], - 'text/x-asm' => ['s', 'asm'], - 'text/x-bibtex' => ['bib'], - 'text/x-c' => ['c', 'cc', 'cxx', 'cpp', 'h', 'hh', 'dic'], - 'text/x-c++hdr' => ['hh', 'hp', 'hpp', 'h++', 'hxx'], - 'text/x-c++src' => ['cpp', 'cxx', 'cc', 'C', 'c++'], - 'text/x-chdr' => ['h'], - 'text/x-cmake' => ['cmake'], - 'text/x-cobol' => ['cbl', 'cob'], - 'text/x-comma-separated-values' => ['csv'], - 'text/x-common-lisp' => ['asd', 'fasl', 'lisp', 'ros'], - 'text/x-component' => ['htc'], - 'text/x-crystal' => ['cr'], - 'text/x-csharp' => ['cs'], - 'text/x-csrc' => ['c'], - 'text/x-csv' => ['csv'], - 'text/x-dart' => ['dart'], - 'text/x-dbus-service' => ['service'], - 'text/x-dcl' => ['dcl'], - 'text/x-diff' => ['diff', 'patch'], - 'text/x-dsl' => ['dsl'], - 'text/x-dsrc' => ['d', 'di'], - 'text/x-dtd' => ['dtd'], - 'text/x-eiffel' => ['e', 'eif'], - 'text/x-elixir' => ['ex', 'exs'], - 'text/x-emacs-lisp' => ['el'], - 'text/x-erlang' => ['erl'], - 'text/x-fortran' => ['f', 'for', 'f77', 'f90', 'f95'], - 'text/x-genie' => ['gs'], - 'text/x-gettext-translation' => ['po'], - 'text/x-gettext-translation-template' => ['pot'], - 'text/x-gherkin' => ['feature'], - 'text/x-go' => ['go'], - 'text/x-google-video-pointer' => ['gvp'], - 'text/x-gradle' => ['gradle'], - 'text/x-groovy' => ['groovy', 'gvy', 'gy', 'gsh'], - 'text/x-handlebars-template' => ['hbs'], - 'text/x-haskell' => ['hs'], - 'text/x-idl' => ['idl'], - 'text/x-imelody' => ['imy', 'ime'], - 'text/x-iptables' => ['iptables'], - 'text/x-java' => ['java'], - 'text/x-java-source' => ['java'], - 'text/x-kaitai-struct' => ['ksy'], - 'text/x-kotlin' => ['kt'], - 'text/x-ldif' => ['ldif'], - 'text/x-lilypond' => ['ly'], - 'text/x-literate-haskell' => ['lhs'], - 'text/x-log' => ['log'], - 'text/x-lua' => ['lua'], - 'text/x-lyx' => ['lyx'], - 'text/x-makefile' => ['mk', 'mak'], - 'text/x-markdown' => ['md', 'mkd', 'markdown'], - 'text/x-matlab' => ['m'], - 'text/x-microdvd' => ['sub'], - 'text/x-moc' => ['moc'], - 'text/x-modelica' => ['mo'], - 'text/x-mof' => ['mof'], - 'text/x-mpsub' => ['sub'], - 'text/x-mrml' => ['mrml', 'mrl'], - 'text/x-ms-regedit' => ['reg'], - 'text/x-mup' => ['mup', 'not'], - 'text/x-nfo' => ['nfo'], - 'text/x-objcsrc' => ['m'], - 'text/x-ocaml' => ['ml', 'mli'], - 'text/x-ocl' => ['ocl'], - 'text/x-octave' => ['m'], - 'text/x-ooc' => ['ooc'], - 'text/x-opencl-src' => ['cl'], - 'text/x-opml' => ['opml'], - 'text/x-opml+xml' => ['opml'], - 'text/x-org' => ['org'], - 'text/x-pascal' => ['p', 'pas'], - 'text/x-patch' => ['diff', 'patch'], - 'text/x-perl' => ['pl', 'PL', 'pm', 'al', 'perl', 'pod', 't'], - 'text/x-po' => ['po'], - 'text/x-pot' => ['pot'], - 'text/x-processing' => ['pde'], - 'text/x-python' => ['py', 'pyx', 'wsgi'], - 'text/x-python3' => ['py', 'py3', 'py3x', 'pyi'], - 'text/x-qml' => ['qml', 'qmltypes', 'qmlproject'], - 'text/x-reject' => ['rej'], - 'text/x-rpm-spec' => ['spec'], - 'text/x-rst' => ['rst'], - 'text/x-sagemath' => ['sage'], - 'text/x-sass' => ['sass'], - 'text/x-scala' => ['scala', 'sc'], - 'text/x-scheme' => ['scm', 'ss'], - 'text/x-scss' => ['scss'], - 'text/x-setext' => ['etx'], - 'text/x-sfv' => ['sfv'], - 'text/x-sh' => ['sh'], - 'text/x-sql' => ['sql'], - 'text/x-ssa' => ['ssa', 'ass'], - 'text/x-subviewer' => ['sub'], - 'text/x-suse-ymp' => ['ymp'], - 'text/x-svhdr' => ['svh'], - 'text/x-svsrc' => ['sv'], - 'text/x-systemd-unit' => ['automount', 'device', 'mount', 'path', 'scope', 'service', 'slice', 'socket', 'swap', 'target', 'timer'], - 'text/x-tcl' => ['tcl', 'tk'], - 'text/x-tex' => ['tex', 'ltx', 'sty', 'cls', 'dtx', 'ins', 'latex'], - 'text/x-texinfo' => ['texi', 'texinfo'], - 'text/x-troff' => ['tr', 'roff', 't'], - 'text/x-troff-me' => ['me'], - 'text/x-troff-mm' => ['mm'], - 'text/x-troff-ms' => ['ms'], - 'text/x-twig' => ['twig'], - 'text/x-txt2tags' => ['t2t'], - 'text/x-uil' => ['uil'], - 'text/x-uuencode' => ['uu', 'uue'], - 'text/x-vala' => ['vala', 'vapi'], - 'text/x-vcalendar' => ['vcs', 'ics'], - 'text/x-vcard' => ['vcf', 'vcard', 'vct', 'gcrd'], - 'text/x-verilog' => ['v'], - 'text/x-vhdl' => ['vhd', 'vhdl'], - 'text/x-xmi' => ['xmi'], - 'text/x-xslfo' => ['fo', 'xslfo'], - 'text/x-yaml' => ['yaml', 'yml'], - 'text/x.gcode' => ['gcode'], - 'text/xml' => ['xml', 'xbl', 'xsd', 'rng'], - 'text/xml-external-parsed-entity' => ['ent'], - 'text/yaml' => ['yaml', 'yml'], - 'video/3gp' => ['3gp', '3gpp', '3ga'], - 'video/3gpp' => ['3gp', '3gpp', '3ga'], - 'video/3gpp-encrypted' => ['3gp', '3gpp', '3ga'], - 'video/3gpp2' => ['3g2', '3gp2', '3gpp2'], - 'video/annodex' => ['axv'], - 'video/avi' => ['avi', 'avf', 'divx'], - 'video/divx' => ['avi', 'avf', 'divx'], - 'video/dv' => ['dv'], - 'video/fli' => ['fli', 'flc'], - 'video/flv' => ['flv'], - 'video/h261' => ['h261'], - 'video/h263' => ['h263'], - 'video/h264' => ['h264'], - 'video/iso.segment' => ['m4s'], - 'video/jpeg' => ['jpgv'], - 'video/jpm' => ['jpm', 'jpgm'], - 'video/mj2' => ['mj2', 'mjp2'], - 'video/mp2t' => ['ts', 'm2t', 'm2ts', 'mts', 'cpi', 'clpi', 'mpl', 'mpls', 'bdm', 'bdmv'], - 'video/mp4' => ['mp4', 'mp4v', 'mpg4', 'm4v', 'f4v', 'lrv'], - 'video/mp4v-es' => ['mp4', 'm4v', 'f4v', 'lrv'], - 'video/mpeg' => ['mpeg', 'mpg', 'mpe', 'm1v', 'm2v', 'mp2', 'vob'], - 'video/mpeg-system' => ['mpeg', 'mpg', 'mp2', 'mpe', 'vob'], - 'video/msvideo' => ['avi', 'avf', 'divx'], - 'video/ogg' => ['ogv', 'ogg'], - 'video/quicktime' => ['mov', 'qt', 'moov', 'qtvr'], - 'video/vivo' => ['viv', 'vivo'], - 'video/vnd.dece.hd' => ['uvh', 'uvvh'], - 'video/vnd.dece.mobile' => ['uvm', 'uvvm'], - 'video/vnd.dece.pd' => ['uvp', 'uvvp'], - 'video/vnd.dece.sd' => ['uvs', 'uvvs'], - 'video/vnd.dece.video' => ['uvv', 'uvvv'], - 'video/vnd.divx' => ['avi', 'avf', 'divx'], - 'video/vnd.dvb.file' => ['dvb'], - 'video/vnd.fvt' => ['fvt'], - 'video/vnd.mpegurl' => ['mxu', 'm4u', 'm1u'], - 'video/vnd.ms-playready.media.pyv' => ['pyv'], - 'video/vnd.radgamettools.bink' => ['bik', 'bk2'], - 'video/vnd.radgamettools.smacker' => ['smk'], - 'video/vnd.rn-realvideo' => ['rv', 'rvx'], - 'video/vnd.uvvu.mp4' => ['uvu', 'uvvu'], - 'video/vnd.vivo' => ['viv', 'vivo'], - 'video/webm' => ['webm'], - 'video/x-anim' => ['anim[1-9j]'], - 'video/x-annodex' => ['axv'], - 'video/x-avi' => ['avi', 'avf', 'divx'], - 'video/x-f4v' => ['f4v'], - 'video/x-fli' => ['fli', 'flc'], - 'video/x-flic' => ['fli', 'flc'], - 'video/x-flv' => ['flv'], - 'video/x-javafx' => ['fxm'], - 'video/x-m4v' => ['m4v', 'mp4', 'f4v', 'lrv'], - 'video/x-matroska' => ['mkv', 'mk3d', 'mks'], - 'video/x-matroska-3d' => ['mk3d'], - 'video/x-mjpeg' => ['mjpeg', 'mjpg'], - 'video/x-mng' => ['mng'], - 'video/x-mpeg' => ['mpeg', 'mpg', 'mp2', 'mpe', 'vob'], - 'video/x-mpeg-system' => ['mpeg', 'mpg', 'mp2', 'mpe', 'vob'], - 'video/x-mpeg2' => ['mpeg', 'mpg', 'mp2', 'mpe', 'vob'], - 'video/x-mpegurl' => ['m1u', 'm4u', 'mxu'], - 'video/x-ms-asf' => ['asf', 'asx'], - 'video/x-ms-asf-plugin' => ['asf'], - 'video/x-ms-vob' => ['vob'], - 'video/x-ms-wax' => ['asx', 'wax', 'wvx', 'wmx'], - 'video/x-ms-wm' => ['wm', 'asf'], - 'video/x-ms-wmv' => ['wmv'], - 'video/x-ms-wmx' => ['wmx', 'asx', 'wax', 'wvx'], - 'video/x-ms-wvx' => ['wvx', 'asx', 'wax', 'wmx'], - 'video/x-msvideo' => ['avi', 'avf', 'divx'], - 'video/x-nsv' => ['nsv'], - 'video/x-ogg' => ['ogv', 'ogg'], - 'video/x-ogm' => ['ogm'], - 'video/x-ogm+ogg' => ['ogm'], - 'video/x-real-video' => ['rv', 'rvx'], - 'video/x-sgi-movie' => ['movie'], - 'video/x-smv' => ['smv'], - 'video/x-theora' => ['ogg'], - 'video/x-theora+ogg' => ['ogg'], - 'x-conference/x-cooltalk' => ['ice'], - 'x-epoc/x-sisx-app' => ['sisx'], - 'zz-application/zz-winassoc-123' => ['123', 'wk1', 'wk3', 'wk4', 'wks'], - 'zz-application/zz-winassoc-cab' => ['cab'], - 'zz-application/zz-winassoc-cdr' => ['cdr'], - 'zz-application/zz-winassoc-doc' => ['doc'], - 'zz-application/zz-winassoc-hlp' => ['hlp'], - 'zz-application/zz-winassoc-mdb' => ['mdb'], - 'zz-application/zz-winassoc-uu' => ['uue'], - 'zz-application/zz-winassoc-xls' => ['xls', 'xlc', 'xll', 'xlm', 'xlw', 'xla', 'xlt', 'xld'], - ]; - - private const REVERSE_MAP = [ - '1km' => ['application/vnd.1000minds.decision-model+xml'], - '32x' => ['application/x-genesis-32x-rom'], - '3dml' => ['text/vnd.in3d.3dml'], - '3ds' => ['application/x-nintendo-3ds-rom', 'image/x-3ds'], - '3dsx' => ['application/x-nintendo-3ds-executable'], - '3g2' => ['audio/3gpp2', 'video/3gpp2'], - '3ga' => ['audio/3gpp', 'audio/3gpp-encrypted', 'audio/x-rn-3gpp-amr', 'audio/x-rn-3gpp-amr-encrypted', 'audio/x-rn-3gpp-amr-wb', 'audio/x-rn-3gpp-amr-wb-encrypted', 'video/3gp', 'video/3gpp', 'video/3gpp-encrypted'], - '3gp' => ['audio/3gpp', 'audio/3gpp-encrypted', 'audio/x-rn-3gpp-amr', 'audio/x-rn-3gpp-amr-encrypted', 'audio/x-rn-3gpp-amr-wb', 'audio/x-rn-3gpp-amr-wb-encrypted', 'video/3gp', 'video/3gpp', 'video/3gpp-encrypted'], - '3gp2' => ['audio/3gpp2', 'video/3gpp2'], - '3gpp' => ['audio/3gpp', 'audio/3gpp-encrypted', 'audio/x-rn-3gpp-amr', 'audio/x-rn-3gpp-amr-encrypted', 'audio/x-rn-3gpp-amr-wb', 'audio/x-rn-3gpp-amr-wb-encrypted', 'video/3gp', 'video/3gpp', 'video/3gpp-encrypted'], - '3gpp2' => ['audio/3gpp2', 'video/3gpp2'], - '3mf' => ['model/3mf'], - '7z' => ['application/x-7z-compressed'], - '7z.001' => ['application/x-7z-compressed'], - 'BLEND' => ['application/x-blender'], - 'C' => ['text/x-c++src'], - 'PAR2' => ['application/x-par2'], - 'PL' => ['application/x-perl', 'text/x-perl'], - 'Z' => ['application/x-compress'], - 'a' => ['application/x-archive'], - 'a26' => ['application/x-atari-2600-rom'], - 'a78' => ['application/x-atari-7800-rom'], - 'aa' => ['audio/vnd.audible', 'audio/x-pn-audibleaudio'], - 'aab' => ['application/x-authorware-bin'], - 'aac' => ['audio/aac', 'audio/x-aac', 'audio/x-hx-aac-adts'], - 'aam' => ['application/x-authorware-map'], - 'aas' => ['application/x-authorware-seg'], - 'aax' => ['audio/vnd.audible', 'audio/vnd.audible.aax', 'audio/x-pn-audibleaudio'], - 'abw' => ['application/x-abiword'], - 'abw.CRASHED' => ['application/x-abiword'], - 'abw.gz' => ['application/x-abiword'], - 'ac' => ['application/pkix-attr-cert', 'application/vnd.nokia.n-gage.ac+xml'], - 'ac3' => ['audio/ac3'], - 'acc' => ['application/vnd.americandynamics.acc'], - 'ace' => ['application/x-ace', 'application/x-ace-compressed'], - 'acu' => ['application/vnd.acucobol'], - 'acutc' => ['application/vnd.acucorp'], - 'adb' => ['text/x-adasrc'], - 'adf' => ['application/x-amiga-disk-format'], - 'adp' => ['audio/adpcm'], - 'ads' => ['text/x-adasrc'], - 'adts' => ['audio/aac', 'audio/x-aac', 'audio/x-hx-aac-adts'], - 'aep' => ['application/vnd.audiograph'], - 'afm' => ['application/x-font-afm', 'application/x-font-type1'], - 'afp' => ['application/vnd.ibm.modcap'], - 'ag' => ['image/x-applix-graphics'], - 'agb' => ['application/x-gba-rom'], - 'ahead' => ['application/vnd.ahead.space'], - 'ai' => ['application/illustrator', 'application/postscript', 'application/vnd.adobe.illustrator'], - 'aif' => ['audio/x-aiff'], - 'aifc' => ['audio/x-aifc', 'audio/x-aiff', 'audio/x-aiffc'], - 'aiff' => ['audio/x-aiff'], - 'aiffc' => ['audio/x-aifc', 'audio/x-aiffc'], - 'air' => ['application/vnd.adobe.air-application-installer-package+zip'], - 'ait' => ['application/vnd.dvb.ait'], - 'al' => ['application/x-perl', 'text/x-perl'], - 'alz' => ['application/x-alz'], - 'ami' => ['application/vnd.amiga.ami'], - 'amr' => ['audio/amr', 'audio/amr-encrypted'], - 'amz' => ['audio/x-amzxml'], - 'ani' => ['application/x-navi-animation'], - 'anim[1-9j]' => ['video/x-anim'], - 'anx' => ['application/annodex', 'application/x-annodex'], - 'ape' => ['audio/x-ape'], - 'apk' => ['application/vnd.android.package-archive'], - 'apng' => ['image/apng'], - 'appcache' => ['text/cache-manifest'], - 'appimage' => ['application/vnd.appimage', 'application/x-iso9660-appimage'], - 'application' => ['application/x-ms-application'], - 'apr' => ['application/vnd.lotus-approach'], - 'ar' => ['application/x-archive'], - 'arc' => ['application/x-freearc'], - 'arj' => ['application/x-arj'], - 'arw' => ['image/x-sony-arw'], - 'as' => ['application/x-applix-spreadsheet'], - 'asc' => ['application/pgp', 'application/pgp-encrypted', 'application/pgp-keys', 'application/pgp-signature', 'text/plain'], - 'asd' => ['text/x-common-lisp'], - 'asf' => ['application/vnd.ms-asf', 'video/x-ms-asf', 'video/x-ms-asf-plugin', 'video/x-ms-wm'], - 'asice' => ['application/vnd.etsi.asic-e+zip'], - 'asm' => ['text/x-asm'], - 'aso' => ['application/vnd.accpac.simply.aso'], - 'asp' => ['application/x-asp'], - 'ass' => ['audio/aac', 'audio/x-aac', 'audio/x-hx-aac-adts', 'text/x-ssa'], - 'astc' => ['image/astc'], - 'asx' => ['application/x-ms-asx', 'audio/x-ms-asx', 'video/x-ms-asf', 'video/x-ms-wax', 'video/x-ms-wmx', 'video/x-ms-wvx'], - '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/basic'], - 'automount' => ['text/x-systemd-unit'], - 'avf' => ['video/avi', 'video/divx', 'video/msvideo', 'video/vnd.divx', 'video/x-avi', 'video/x-msvideo'], - 'avi' => ['video/avi', 'video/divx', 'video/msvideo', 'video/vnd.divx', 'video/x-avi', 'video/x-msvideo'], - 'avif' => ['image/avif', 'image/avif-sequence'], - 'avifs' => ['image/avif', 'image/avif-sequence'], - 'aw' => ['application/applixware', 'application/x-applix-word'], - 'awb' => ['audio/amr-wb', 'audio/amr-wb-encrypted'], - 'awk' => ['application/x-awk'], - 'axa' => ['audio/annodex', 'audio/x-annodex'], - 'axv' => ['video/annodex', 'video/x-annodex'], - 'azf' => ['application/vnd.airzip.filesecure.azf'], - 'azs' => ['application/vnd.airzip.filesecure.azs'], - 'azv' => ['image/vnd.airzip.accelerator.azv'], - 'azw' => ['application/vnd.amazon.ebook'], - 'azw3' => ['application/vnd.amazon.mobi8-ebook', 'application/x-mobi8-ebook'], - 'b16' => ['image/vnd.pco.b16'], - 'bak' => ['application/x-trash'], - 'bat' => ['application/x-msdownload'], - 'bcpio' => ['application/x-bcpio'], - 'bdf' => ['application/x-font-bdf'], - 'bdm' => ['application/vnd.syncml.dm+wbxml', 'video/mp2t'], - 'bdmv' => ['video/mp2t'], - 'bdoc' => ['application/bdoc', 'application/x-bdoc'], - 'bed' => ['application/vnd.realvnc.bed'], - 'bh2' => ['application/vnd.fujitsu.oasysprs'], - 'bib' => ['text/x-bibtex'], - 'bik' => ['video/vnd.radgamettools.bink'], - 'bin' => ['application/octet-stream'], - 'bk2' => ['video/vnd.radgamettools.bink'], - 'blb' => ['application/x-blorb'], - 'blend' => ['application/x-blender'], - 'blender' => ['application/x-blender'], - 'blorb' => ['application/x-blorb'], - 'bmi' => ['application/vnd.bmi'], - 'bmml' => ['application/vnd.balsamiq.bmml+xml'], - 'bmp' => ['image/bmp', 'image/x-bmp', 'image/x-ms-bmp'], - 'book' => ['application/vnd.framemaker'], - 'box' => ['application/vnd.previewsystems.box'], - 'boz' => ['application/x-bzip2'], - 'bps' => ['application/x-bps-patch'], - 'bsdiff' => ['application/x-bsdiff'], - 'bsp' => ['model/vnd.valve.source.compiled-map'], - 'btif' => ['image/prs.btif'], - 'bz' => ['application/bzip2', 'application/x-bzip', 'application/x-bzip2'], - 'bz2' => ['application/x-bz2', 'application/bzip2', 'application/x-bzip', 'application/x-bzip2'], - 'c' => ['text/x-c', 'text/x-csrc'], - 'c++' => ['text/x-c++src'], - 'c11amc' => ['application/vnd.cluetrust.cartomobile-config'], - 'c11amz' => ['application/vnd.cluetrust.cartomobile-config-pkg'], - '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'], - 'cab' => ['application/vnd.ms-cab-compressed', 'zz-application/zz-winassoc-cab'], - 'caf' => ['audio/x-caf'], - 'cap' => ['application/pcap', 'application/vnd.tcpdump.pcap', 'application/x-pcap'], - 'car' => ['application/vnd.curl.car'], - 'cat' => ['application/vnd.ms-pki.seccat'], - 'cb7' => ['application/x-cb7', 'application/x-cbr'], - 'cba' => ['application/x-cbr'], - 'cbl' => ['text/x-cobol'], - 'cbr' => ['application/vnd.comicbook-rar', 'application/x-cbr'], - 'cbt' => ['application/x-cbr', 'application/x-cbt'], - 'cbz' => ['application/vnd.comicbook+zip', 'application/x-cbr', 'application/x-cbz'], - 'cc' => ['text/x-c', 'text/x-c++src'], - 'cci' => ['application/x-nintendo-3ds-rom'], - 'ccmx' => ['application/x-ccmx'], - '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'], - 'cdi' => ['application/x-discjuggler-cd-image'], - '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', 'application/coreldraw', 'application/vnd.corel-draw', 'application/x-cdr', 'application/x-coreldraw', 'image/cdr', 'image/x-cdr', 'zz-application/zz-winassoc-cdr'], - 'cdx' => ['chemical/x-cdx'], - 'cdxml' => ['application/vnd.chemdraw+xml'], - 'cdy' => ['application/vnd.cinderella'], - 'cer' => ['application/pkix-cert'], - 'cert' => ['application/x-x509-ca-cert'], - 'cfs' => ['application/x-cfs-compressed'], - 'cgb' => ['application/x-gameboy-color-rom'], - 'cgm' => ['image/cgm'], - 'chat' => ['application/x-chat'], - 'chd' => ['application/x-mame-chd'], - 'chm' => ['application/vnd.ms-htmlhelp', 'application/x-chm'], - 'chrt' => ['application/vnd.kde.kchart', 'application/x-kchart'], - 'cif' => ['chemical/x-cif'], - 'cii' => ['application/vnd.anser-web-certificate-issue-initiation'], - 'cil' => ['application/vnd.ms-artgalry'], - 'cjs' => ['application/node'], - 'cl' => ['text/x-opencl-src'], - 'cla' => ['application/vnd.claymore'], - 'class' => ['application/java', 'application/java-byte-code', 'application/java-vm', 'application/x-java', 'application/x-java-class', 'application/x-java-vm'], - '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'], - 'clpi' => ['video/mp2t'], - 'cls' => ['application/x-tex', 'text/x-tex'], - 'cmake' => ['text/x-cmake'], - 'cmc' => ['application/vnd.cosmocaller'], - 'cmdf' => ['chemical/x-cmdf'], - 'cml' => ['chemical/x-cml'], - 'cmp' => ['application/vnd.yellowriver-custom-menu'], - 'cmx' => ['image/x-cmx'], - 'cob' => ['text/x-cobol'], - 'cod' => ['application/vnd.rim.cod'], - 'coffee' => ['application/vnd.coffeescript', 'text/coffeescript'], - 'com' => ['application/x-msdownload'], - 'conf' => ['text/plain'], - 'cpi' => ['video/mp2t'], - 'cpio' => ['application/x-cpio'], - 'cpio.gz' => ['application/x-cpio-compressed'], - 'cpp' => ['text/x-c', 'text/x-c++src'], - 'cpt' => ['application/mac-compactpro'], - 'cr' => ['text/crystal', 'text/x-crystal'], - 'cr2' => ['image/x-canon-cr2'], - 'cr3' => ['image/x-canon-cr3'], - 'crd' => ['application/x-mscardfile'], - 'crdownload' => ['application/x-partial-download'], - 'crl' => ['application/pkix-crl'], - 'crt' => ['application/x-x509-ca-cert'], - 'crw' => ['image/x-canon-crw'], - 'crx' => ['application/x-chrome-extension'], - 'cryptonote' => ['application/vnd.rig.cryptonote'], - 'cs' => ['text/x-csharp'], - 'csh' => ['application/x-csh'], - 'csl' => ['application/vnd.citationstyles.style+xml'], - 'csml' => ['chemical/x-csml'], - 'cso' => ['application/x-compressed-iso'], - 'csp' => ['application/vnd.commonspace'], - 'css' => ['text/css'], - 'cst' => ['application/x-director'], - 'csv' => ['text/csv', 'application/csv', 'text/x-comma-separated-values', 'text/x-csv'], - 'csvs' => ['text/csv-schema'], - 'cu' => ['application/cu-seeme'], - 'cue' => ['application/x-cue'], - 'cur' => ['image/x-win-bitmap'], - 'curl' => ['text/vnd.curl'], - 'cwk' => ['application/x-appleworks-document'], - 'cww' => ['application/prs.cww'], - 'cxt' => ['application/x-director'], - 'cxx' => ['text/x-c', 'text/x-c++src'], - 'd' => ['text/x-dsrc'], - 'dae' => ['model/vnd.collada+xml'], - 'daf' => ['application/vnd.mobius.daf'], - 'dar' => ['application/x-dar'], - 'dart' => ['application/vnd.dart', 'text/x-dart'], - 'dataless' => ['application/vnd.fdsn.seed'], - 'davmount' => ['application/davmount+xml'], - 'dbf' => ['application/dbase', 'application/dbf', 'application/vnd.dbf', 'application/x-dbase', 'application/x-dbf'], - 'dbk' => ['application/docbook+xml', 'application/vnd.oasis.docbook+xml', 'application/x-docbook+xml'], - 'dc' => ['application/x-dc-rom'], - 'dcl' => ['text/x-dcl'], - 'dcm' => ['application/dicom'], - 'dcr' => ['application/x-director', 'image/x-kodak-dcr'], - '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', 'image/x-dds'], - 'deb' => ['application/vnd.debian.binary-package', 'application/x-deb', 'application/x-debian-package'], - 'def' => ['text/plain'], - 'der' => ['application/x-x509-ca-cert'], - 'desktop' => ['application/x-desktop', 'application/x-gnome-app-info'], - 'device' => ['text/x-systemd-unit'], - 'dfac' => ['application/vnd.dreamfactory'], - 'dgc' => ['application/x-dgc-compressed'], - 'di' => ['text/x-dsrc'], - 'dia' => ['application/x-dia-diagram'], - 'dib' => ['image/bmp', 'image/x-bmp', 'image/x-ms-bmp'], - 'dic' => ['text/x-c'], - 'diff' => ['text/x-diff', 'text/x-patch'], - 'dir' => ['application/x-director'], - 'dis' => ['application/vnd.mobius.dis'], - 'disposition-notification' => ['message/disposition-notification'], - 'divx' => ['video/avi', 'video/divx', 'video/msvideo', 'video/vnd.divx', 'video/x-avi', 'video/x-msvideo'], - 'djv' => ['image/vnd.djvu', 'image/vnd.djvu+multipage', 'image/x-djvu', 'image/x.djvu'], - 'djvu' => ['image/vnd.djvu', 'image/vnd.djvu+multipage', 'image/x-djvu', 'image/x.djvu'], - 'dll' => ['application/x-msdownload'], - 'dmg' => ['application/x-apple-diskimage'], - 'dmp' => ['application/pcap', 'application/vnd.tcpdump.pcap', 'application/x-pcap'], - 'dna' => ['application/vnd.dna'], - 'dng' => ['image/x-adobe-dng'], - 'doc' => ['application/msword', 'application/vnd.ms-word', 'application/x-msword', 'zz-application/zz-winassoc-doc'], - 'docbook' => ['application/docbook+xml', 'application/vnd.oasis.docbook+xml', 'application/x-docbook+xml'], - 'docm' => ['application/vnd.ms-word.document.macroenabled.12'], - 'docx' => ['application/vnd.openxmlformats-officedocument.wordprocessingml.document'], - 'dot' => ['application/msword', 'application/msword-template', 'text/vnd.graphviz'], - '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'], - 'dsl' => ['text/x-dsl'], - 'dssc' => ['application/dssc+der'], - 'dtb' => ['application/x-dtbook+xml'], - 'dtd' => ['application/xml-dtd', 'text/x-dtd'], - 'dts' => ['audio/vnd.dts', 'audio/x-dts'], - 'dtshd' => ['audio/vnd.dts.hd', 'audio/x-dtshd'], - 'dtx' => ['application/x-tex', 'text/x-tex'], - 'dv' => ['video/dv'], - 'dvb' => ['video/vnd.dvb.file'], - 'dvi' => ['application/x-dvi'], - 'dvi.bz2' => ['application/x-bzdvi'], - 'dvi.gz' => ['application/x-gzdvi'], - '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'], - 'e' => ['text/x-eiffel'], - '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'], - 'egon' => ['application/x-egon'], - 'ei6' => ['application/vnd.pg.osasli'], - 'eif' => ['text/x-eiffel'], - 'el' => ['text/x-emacs-lisp'], - 'emf' => ['application/emf', 'application/x-emf', 'application/x-msmetafile', 'image/emf', 'image/x-emf'], - 'eml' => ['message/rfc822'], - 'emma' => ['application/emma+xml'], - 'emotionml' => ['application/emotionml+xml'], - 'emp' => ['application/vnd.emusic-emusic_package'], - 'emz' => ['application/x-msmetafile'], - 'ent' => ['application/xml-external-parsed-entity', 'text/xml-external-parsed-entity'], - 'eol' => ['audio/vnd.digital-winds'], - 'eot' => ['application/vnd.ms-fontobject'], - 'eps' => ['application/postscript', 'image/x-eps'], - 'eps.bz2' => ['image/x-bzeps'], - 'eps.gz' => ['image/x-gzeps'], - 'epsf' => ['image/x-eps'], - 'epsf.bz2' => ['image/x-bzeps'], - 'epsf.gz' => ['image/x-gzeps'], - 'epsi' => ['image/x-eps'], - 'epsi.bz2' => ['image/x-bzeps'], - 'epsi.gz' => ['image/x-gzeps'], - 'epub' => ['application/epub+zip'], - 'erl' => ['text/x-erlang'], - 'es' => ['application/ecmascript', 'text/ecmascript'], - 'es3' => ['application/vnd.eszigno3+xml'], - 'esa' => ['application/vnd.osgi.subsystem'], - 'esf' => ['application/vnd.epson.esf'], - 'et3' => ['application/vnd.eszigno3+xml'], - 'etheme' => ['application/x-e-theme'], - 'etx' => ['text/x-setext'], - 'eva' => ['application/x-eva'], - 'evy' => ['application/x-envoy'], - 'ex' => ['text/x-elixir'], - 'exe' => ['application/x-ms-dos-executable', 'application/x-msdos-program', 'application/x-msdownload'], - 'exi' => ['application/exi'], - 'exr' => ['image/aces', 'image/x-exr'], - 'exs' => ['text/x-elixir'], - 'ext' => ['application/vnd.novadigm.ext'], - 'ez' => ['application/andrew-inset'], - 'ez2' => ['application/vnd.ezpix-album'], - 'ez3' => ['application/vnd.ezpix-package'], - 'f' => ['text/x-fortran'], - 'f4a' => ['audio/m4a', 'audio/mp4', 'audio/x-m4a'], - 'f4b' => ['audio/x-m4b'], - 'f4v' => ['video/mp4', 'video/mp4v-es', 'video/x-f4v', 'video/x-m4v'], - 'f77' => ['text/x-fortran'], - 'f90' => ['text/x-fortran'], - 'f95' => ['text/x-fortran'], - 'fasl' => ['text/x-common-lisp'], - 'fb2' => ['application/x-fictionbook', 'application/x-fictionbook+xml'], - 'fb2.zip' => ['application/x-zip-compressed-fb2'], - 'fbs' => ['image/vnd.fastbidsheet'], - 'fcdt' => ['application/vnd.adobe.formscentral.fcdt'], - 'fcs' => ['application/vnd.isac.fcs'], - 'fd' => ['application/x-fd-file', 'application/x-raw-floppy-disk-image'], - 'fdf' => ['application/vnd.fdf'], - 'fds' => ['application/x-fds-disk'], - 'fdt' => ['application/fdt+xml'], - 'fe_launch' => ['application/vnd.denovo.fcselayout-link'], - 'feature' => ['text/x-gherkin'], - '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', 'image/x-xfig'], - 'fits' => ['image/fits', 'image/x-fits'], - 'fl' => ['application/x-fluid'], - 'flac' => ['audio/flac', 'audio/x-flac'], - 'flatpak' => ['application/vnd.flatpak', 'application/vnd.xdgapp'], - 'flatpakref' => ['application/vnd.flatpak.ref'], - 'flatpakrepo' => ['application/vnd.flatpak.repo'], - 'flc' => ['video/fli', 'video/x-fli', 'video/x-flic'], - 'fli' => ['video/fli', 'video/x-fli', 'video/x-flic'], - 'flo' => ['application/vnd.micrografx.flo'], - 'flv' => ['video/x-flv', 'application/x-flash-video', 'flv-application/octet-stream', 'video/flv'], - 'flw' => ['application/vnd.kde.kivio', 'application/x-kivio'], - 'flx' => ['text/vnd.fmi.flexstor'], - 'fly' => ['text/vnd.fly'], - 'fm' => ['application/vnd.framemaker', 'application/x-frame'], - 'fnc' => ['application/vnd.frogans.fnc'], - 'fo' => ['application/vnd.software602.filler.form+xml', 'text/x-xslfo'], - 'fodg' => ['application/vnd.oasis.opendocument.graphics-flat-xml'], - 'fodp' => ['application/vnd.oasis.opendocument.presentation-flat-xml'], - 'fods' => ['application/vnd.oasis.opendocument.spreadsheet-flat-xml'], - 'fodt' => ['application/vnd.oasis.opendocument.text-flat-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'], - 'fxm' => ['video/x-javafx'], - 'fxp' => ['application/vnd.adobe.fxp'], - 'fxpl' => ['application/vnd.adobe.fxp'], - 'fzs' => ['application/vnd.fuzzysheet'], - 'g2w' => ['application/vnd.geoplan'], - 'g3' => ['image/fax-g3', 'image/g3fax'], - 'g3w' => ['application/vnd.geospace'], - 'gac' => ['application/vnd.groove-account'], - 'gam' => ['application/x-tads'], - 'gb' => ['application/x-gameboy-rom'], - 'gba' => ['application/x-gba-rom'], - 'gbc' => ['application/x-gameboy-color-rom'], - 'gbr' => ['application/rpki-ghostbusters', 'image/x-gimp-gbr'], - 'gca' => ['application/x-gca-compressed'], - 'gcode' => ['text/x.gcode'], - 'gcrd' => ['text/directory', 'text/vcard', 'text/x-vcard'], - 'gdi' => ['application/x-gd-rom-cue'], - 'gdl' => ['model/vnd.gdl'], - 'gdoc' => ['application/vnd.google-apps.document'], - 'ged' => ['application/x-gedcom', 'text/gedcom'], - 'gedcom' => ['application/x-gedcom', 'text/gedcom'], - 'gem' => ['application/x-gtar', 'application/x-tar'], - 'gen' => ['application/x-genesis-rom'], - 'geo' => ['application/vnd.dynageo'], - 'geo.json' => ['application/geo+json', 'application/vnd.geo+json'], - 'geojson' => ['application/geo+json', 'application/vnd.geo+json'], - 'gex' => ['application/vnd.geometry-explorer'], - 'gf' => ['application/x-tex-gf'], - 'gg' => ['application/x-gamegear-rom'], - 'ggb' => ['application/vnd.geogebra.file'], - 'ggt' => ['application/vnd.geogebra.tool'], - 'ghf' => ['application/vnd.groove-help'], - 'gif' => ['image/gif'], - 'gih' => ['image/x-gimp-gih'], - 'gim' => ['application/vnd.groove-identity-message'], - 'glade' => ['application/x-glade'], - 'glb' => ['model/gltf-binary'], - 'gltf' => ['model/gltf+json'], - 'gml' => ['application/gml+xml'], - 'gmo' => ['application/x-gettext-translation'], - 'gmx' => ['application/vnd.gmx'], - 'gnc' => ['application/x-gnucash'], - 'gnd' => ['application/gnunet-directory'], - 'gnucash' => ['application/x-gnucash'], - 'gnumeric' => ['application/x-gnumeric'], - 'gnuplot' => ['application/x-gnuplot'], - 'go' => ['text/x-go'], - 'gp' => ['application/x-gnuplot'], - 'gpg' => ['application/pgp', 'application/pgp-encrypted', 'application/pgp-keys', 'application/pgp-signature'], - 'gph' => ['application/vnd.flographit'], - 'gplt' => ['application/x-gnuplot'], - 'gpx' => ['application/gpx', 'application/gpx+xml', 'application/x-gpx', 'application/x-gpx+xml'], - 'gqf' => ['application/vnd.grafeq'], - 'gqs' => ['application/vnd.grafeq'], - 'gra' => ['application/x-graphite'], - 'gradle' => ['text/x-gradle'], - 'gram' => ['application/srgs'], - 'gramps' => ['application/x-gramps-xml'], - 'gre' => ['application/vnd.geometry-explorer'], - 'groovy' => ['text/x-groovy'], - 'grv' => ['application/vnd.groove-injector'], - 'grxml' => ['application/srgs+xml'], - 'gs' => ['text/x-genie'], - 'gsf' => ['application/x-font-ghostscript', 'application/x-font-type1'], - 'gsh' => ['text/x-groovy'], - 'gsheet' => ['application/vnd.google-apps.spreadsheet'], - 'gslides' => ['application/vnd.google-apps.presentation'], - 'gsm' => ['audio/x-gsm'], - 'gtar' => ['application/x-gtar', 'application/x-tar'], - 'gtm' => ['application/vnd.groove-tool-message'], - 'gtw' => ['model/vnd.gtw'], - 'gv' => ['text/vnd.graphviz'], - 'gvp' => ['text/google-video-pointer', 'text/x-google-video-pointer'], - 'gvy' => ['text/x-groovy'], - 'gxf' => ['application/gxf'], - 'gxt' => ['application/vnd.geonext'], - 'gy' => ['text/x-groovy'], - 'gz' => ['application/x-gzip', 'application/gzip'], - 'h' => ['text/x-c', 'text/x-chdr'], - 'h++' => ['text/x-c++hdr'], - 'h261' => ['video/h261'], - 'h263' => ['video/h263'], - 'h264' => ['video/h264'], - 'h4' => ['application/x-hdf'], - 'h5' => ['application/x-hdf'], - 'hal' => ['application/vnd.hal+xml'], - 'hbci' => ['application/vnd.hbci'], - 'hbs' => ['text/x-handlebars-template'], - 'hdd' => ['application/x-virtualbox-hdd'], - 'hdf' => ['application/x-hdf'], - 'hdf4' => ['application/x-hdf'], - 'hdf5' => ['application/x-hdf'], - 'heic' => ['image/heic', 'image/heic-sequence', 'image/heif', 'image/heif-sequence'], - 'heics' => ['image/heic-sequence'], - 'heif' => ['image/heic', 'image/heic-sequence', 'image/heif', 'image/heif-sequence'], - 'heifs' => ['image/heif-sequence'], - 'hej2' => ['image/hej2k'], - 'held' => ['application/atsc-held+xml'], - 'hfe' => ['application/x-hfe-file', 'application/x-hfe-floppy-image'], - 'hh' => ['text/x-c', 'text/x-c++hdr'], - 'hjson' => ['application/hjson'], - 'hlp' => ['application/winhlp', 'zz-application/zz-winassoc-hlp'], - 'hp' => ['text/x-c++hdr'], - 'hpgl' => ['application/vnd.hp-hpgl'], - 'hpid' => ['application/vnd.hp-hpid'], - 'hpp' => ['text/x-c++hdr'], - 'hps' => ['application/vnd.hp-hps'], - 'hqx' => ['application/stuffit', 'application/mac-binhex40'], - 'hs' => ['text/x-haskell'], - 'hsj2' => ['image/hsj2'], - 'htc' => ['text/x-component'], - 'htke' => ['application/vnd.kenameaapp'], - 'htm' => ['text/html', 'application/xhtml+xml'], - 'html' => ['text/html', 'application/xhtml+xml'], - 'hvd' => ['application/vnd.yamaha.hv-dic'], - 'hvp' => ['application/vnd.yamaha.hv-voice'], - 'hvs' => ['application/vnd.yamaha.hv-script'], - 'hwp' => ['application/vnd.haansoft-hwp', 'application/x-hwp'], - 'hwt' => ['application/vnd.haansoft-hwt', 'application/x-hwt'], - 'hxx' => ['text/x-c++hdr'], - 'i2g' => ['application/vnd.intergeo'], - 'ica' => ['application/x-ica'], - 'icb' => ['application/tga', 'application/x-targa', 'application/x-tga', 'image/targa', 'image/tga', 'image/x-icb', 'image/x-targa', 'image/x-tga'], - 'icc' => ['application/vnd.iccprofile'], - 'ice' => ['x-conference/x-cooltalk'], - 'icm' => ['application/vnd.iccprofile'], - 'icns' => ['image/x-icns'], - 'ico' => ['application/ico', 'image/ico', 'image/icon', 'image/vnd.microsoft.icon', 'image/x-ico', 'image/x-icon', 'text/ico'], - 'ics' => ['application/ics', 'text/calendar', 'text/x-vcalendar'], - 'idl' => ['text/x-idl'], - 'ief' => ['image/ief'], - 'ifb' => ['text/calendar'], - 'iff' => ['image/x-iff', 'image/x-ilbm'], - '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'], - 'ilbm' => ['image/x-iff', 'image/x-ilbm'], - 'ime' => ['audio/imelody', 'audio/x-imelody', 'text/x-imelody'], - 'img' => ['application/x-raw-disk-image'], - 'img.xz' => ['application/x-raw-disk-image-xz-compressed'], - 'imp' => ['application/vnd.accpac.simply.imp'], - 'ims' => ['application/vnd.ms-ims'], - 'imy' => ['audio/imelody', 'audio/x-imelody', 'text/x-imelody'], - 'in' => ['text/plain'], - 'ini' => ['text/plain'], - 'ink' => ['application/inkml+xml'], - 'inkml' => ['application/inkml+xml'], - 'ins' => ['application/x-tex', 'text/x-tex'], - 'install' => ['application/x-install-instructions'], - 'iota' => ['application/vnd.astraea-software.iota'], - 'ipfix' => ['application/ipfix'], - 'ipk' => ['application/vnd.shana.informed.package'], - 'ips' => ['application/x-ips-patch'], - 'iptables' => ['text/x-iptables'], - 'ipynb' => ['application/x-ipynb+json'], - 'irm' => ['application/vnd.ibm.rights-management'], - 'irp' => ['application/vnd.irepository.package+xml'], - 'iso' => ['application/x-cd-image', 'application/x-dreamcast-rom', 'application/x-gamecube-iso-image', 'application/x-gamecube-rom', 'application/x-iso9660-image', 'application/x-saturn-rom', 'application/x-sega-cd-rom', 'application/x-sega-pico-rom', 'application/x-wbfs', 'application/x-wia', 'application/x-wii-iso-image', 'application/x-wii-rom'], - 'iso9660' => ['application/x-cd-image', 'application/x-iso9660-image'], - 'it' => ['audio/x-it'], - 'it87' => ['application/x-it87'], - 'itp' => ['application/vnd.shana.informed.formtemplate'], - 'its' => ['application/its+xml'], - 'ivp' => ['application/vnd.immervision-ivp'], - 'ivu' => ['application/vnd.immervision-ivu'], - 'j2c' => ['image/x-jp2-codestream'], - 'j2k' => ['image/x-jp2-codestream'], - 'jad' => ['text/vnd.sun.j2me.app-descriptor'], - 'jade' => ['text/jade'], - 'jam' => ['application/vnd.jam'], - 'jar' => ['application/x-java-archive', 'application/java-archive', 'application/x-jar'], - 'jardiff' => ['application/x-java-archive-diff'], - 'java' => ['text/x-java', 'text/x-java-source'], - 'jceks' => ['application/x-java-jce-keystore'], - 'jhc' => ['image/jphc'], - 'jisp' => ['application/vnd.jisp'], - 'jks' => ['application/x-java-keystore'], - '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', 'image/jpeg2000', 'image/jpeg2000-image', 'image/x-jpeg2000-image'], - 'jpc' => ['image/x-jp2-codestream'], - 'jpe' => ['image/jpeg', 'image/pjpeg'], - 'jpeg' => ['image/jpeg', 'image/pjpeg'], - 'jpf' => ['image/jpx'], - 'jpg' => ['image/jpeg', 'image/pjpeg'], - 'jpg2' => ['image/jp2', 'image/jpeg2000', 'image/jpeg2000-image', 'image/x-jpeg2000-image'], - 'jpgm' => ['image/jpm', 'video/jpm'], - 'jpgv' => ['video/jpeg'], - 'jph' => ['image/jph'], - 'jpm' => ['image/jpm', 'video/jpm'], - 'jpr' => ['application/x-jbuilder-project'], - 'jpx' => ['application/x-jbuilder-project', 'image/jpx'], - 'jrd' => ['application/jrd+json'], - 'js' => ['text/javascript', 'application/javascript', 'application/x-javascript'], - 'jsm' => ['application/javascript', 'application/x-javascript', 'text/javascript'], - 'json' => ['application/json', 'application/schema+json'], - 'json-patch' => ['application/json-patch+json'], - 'json5' => ['application/json5'], - 'jsonld' => ['application/ld+json'], - 'jsonml' => ['application/jsonml+json'], - 'jsx' => ['text/jsx'], - 'jxl' => ['image/jxl'], - 'jxr' => ['image/jxr'], - 'jxra' => ['image/jxra'], - 'jxrs' => ['image/jxrs'], - 'jxs' => ['image/jxs'], - 'jxsc' => ['image/jxsc'], - 'jxsi' => ['image/jxsi'], - 'jxss' => ['image/jxss'], - 'k25' => ['image/x-kodak-k25'], - 'k7' => ['application/x-thomson-cassette'], - 'kar' => ['audio/midi', 'audio/x-midi'], - 'karbon' => ['application/vnd.kde.karbon', 'application/x-karbon'], - 'kdbx' => ['application/x-keepass2'], - 'kdc' => ['image/x-kodak-kdc'], - 'kdelnk' => ['application/x-desktop', 'application/x-gnome-app-info'], - 'kexi' => ['application/x-kexiproject-sqlite', 'application/x-kexiproject-sqlite2', 'application/x-kexiproject-sqlite3', 'application/x-vnd.kde.kexi'], - 'kexic' => ['application/x-kexi-connectiondata'], - 'kexis' => ['application/x-kexiproject-shortcut'], - 'key' => ['application/vnd.apple.keynote', 'application/pgp-keys', 'application/x-iwork-keynote-sffkey'], - 'keynote' => ['application/vnd.apple.keynote'], - 'kfo' => ['application/vnd.kde.kformula', 'application/x-kformula'], - 'kfx' => ['application/vnd.amazon.mobi8-ebook', 'application/x-mobi8-ebook'], - 'kia' => ['application/vnd.kidspiration'], - 'kil' => ['application/x-killustrator'], - 'kino' => ['application/smil', 'application/smil+xml'], - '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', 'application/x-kontour'], - 'kpm' => ['application/x-kpovmodeler'], - 'kpr' => ['application/vnd.kde.kpresenter', 'application/x-kpresenter'], - 'kpt' => ['application/vnd.kde.kpresenter', 'application/x-kpresenter'], - 'kpxx' => ['application/vnd.ds-keypoint'], - 'kra' => ['application/x-krita'], - 'krz' => ['application/x-krita'], - 'ks' => ['application/x-java-keystore'], - 'ksp' => ['application/vnd.kde.kspread', 'application/x-kspread'], - 'ksy' => ['text/x-kaitai-struct'], - 'kt' => ['text/x-kotlin'], - 'ktr' => ['application/vnd.kahootz'], - 'ktx' => ['image/ktx'], - 'ktx2' => ['image/ktx2'], - 'ktz' => ['application/vnd.kahootz'], - 'kud' => ['application/x-kugar'], - 'kwd' => ['application/vnd.kde.kword', 'application/x-kword'], - 'kwt' => ['application/vnd.kde.kword', 'application/x-kword'], - 'la' => ['application/x-shared-library-la'], - 'lasxml' => ['application/vnd.las.las+xml'], - 'latex' => ['application/x-latex', 'application/x-tex', 'text/x-tex'], - 'lbd' => ['application/vnd.llamagraphics.life-balance.desktop'], - 'lbe' => ['application/vnd.llamagraphics.life-balance.exchange+xml'], - 'lbm' => ['image/x-iff', 'image/x-ilbm'], - 'ldif' => ['text/x-ldif'], - 'les' => ['application/vnd.hhe.lesson-player'], - 'less' => ['text/less'], - 'lgr' => ['application/lgr+xml'], - 'lha' => ['application/x-lha', 'application/x-lzh-compressed'], - 'lhs' => ['text/x-literate-haskell'], - 'lhz' => ['application/x-lhz'], - 'link66' => ['application/vnd.route66.link66+xml'], - 'lisp' => ['text/x-common-lisp'], - 'list' => ['text/plain'], - 'list3820' => ['application/vnd.ibm.modcap'], - 'listafp' => ['application/vnd.ibm.modcap'], - 'litcoffee' => ['text/coffeescript'], - 'lnk' => ['application/x-ms-shortcut'], - 'lnx' => ['application/x-atari-lynx-rom'], - 'loas' => ['audio/usac'], - 'log' => ['text/plain', 'text/x-log'], - 'lostxml' => ['application/lost+xml'], - 'lrm' => ['application/vnd.ms-lrm'], - 'lrv' => ['video/mp4', 'video/mp4v-es', 'video/x-m4v'], - 'lrz' => ['application/x-lrzip'], - 'ltf' => ['application/vnd.frogans.ltf'], - 'ltx' => ['application/x-tex', 'text/x-tex'], - 'lua' => ['text/x-lua'], - 'luac' => ['application/x-lua-bytecode'], - 'lvp' => ['audio/vnd.lucent.voice'], - 'lwo' => ['image/x-lwo'], - 'lwob' => ['image/x-lwo'], - 'lwp' => ['application/vnd.lotus-wordpro'], - 'lws' => ['image/x-lws'], - 'ly' => ['text/x-lilypond'], - 'lyx' => ['application/x-lyx', 'text/x-lyx'], - 'lz' => ['application/x-lzip'], - 'lz4' => ['application/x-lz4'], - 'lzh' => ['application/x-lha', 'application/x-lzh-compressed'], - 'lzma' => ['application/x-lzma'], - 'lzo' => ['application/x-lzop'], - 'm' => ['text/x-matlab', 'text/x-objcsrc', 'text/x-octave'], - 'm13' => ['application/x-msmediaview'], - 'm14' => ['application/x-msmediaview'], - 'm15' => ['audio/x-mod'], - 'm1u' => ['video/vnd.mpegurl', 'video/x-mpegurl'], - 'm1v' => ['video/mpeg'], - 'm21' => ['application/mp21'], - 'm2a' => ['audio/mpeg'], - 'm2t' => ['video/mp2t'], - 'm2ts' => ['video/mp2t'], - 'm2v' => ['video/mpeg'], - 'm3a' => ['audio/mpeg'], - 'm3u' => ['audio/x-mpegurl', 'application/m3u', 'application/vnd.apple.mpegurl', 'audio/m3u', 'audio/mpegurl', 'audio/x-m3u', 'audio/x-mp3-playlist'], - 'm3u8' => ['application/m3u', 'application/vnd.apple.mpegurl', 'audio/m3u', 'audio/mpegurl', 'audio/x-m3u', 'audio/x-mp3-playlist', 'audio/x-mpegurl'], - 'm4' => ['application/x-m4'], - 'm4a' => ['audio/mp4', 'audio/m4a', 'audio/x-m4a'], - 'm4b' => ['audio/x-m4b'], - 'm4p' => ['application/mp4'], - 'm4r' => ['audio/x-m4r'], - 'm4s' => ['video/iso.segment'], - 'm4u' => ['video/vnd.mpegurl', 'video/x-mpegurl'], - 'm4v' => ['video/mp4', 'video/mp4v-es', 'video/x-m4v'], - 'm7' => ['application/x-thomson-cartridge-memo7'], - 'ma' => ['application/mathematica'], - 'mab' => ['application/x-markaby'], - 'mads' => ['application/mads+xml'], - 'maei' => ['application/mmt-aei+xml'], - 'mag' => ['application/vnd.ecowin.chart'], - 'mak' => ['text/x-makefile'], - 'maker' => ['application/vnd.framemaker'], - 'man' => ['application/x-troff-man', 'text/troff'], - 'manifest' => ['text/cache-manifest'], - 'map' => ['application/json'], - 'markdown' => ['text/markdown', 'text/x-markdown'], - 'mathml' => ['application/mathml+xml'], - 'mb' => ['application/mathematica'], - 'mbk' => ['application/vnd.mobius.mbk'], - 'mbox' => ['application/mbox'], - 'mc1' => ['application/vnd.medcalcdata'], - 'mc2' => ['text/vnd.senx.warpscript'], - 'mcd' => ['application/vnd.mcd'], - 'mcurl' => ['text/vnd.curl.mcurl'], - 'md' => ['text/markdown', 'text/x-markdown'], - 'mdb' => ['application/x-msaccess', 'application/mdb', 'application/msaccess', 'application/vnd.ms-access', 'application/vnd.msaccess', 'application/x-mdb', 'zz-application/zz-winassoc-mdb'], - 'mdi' => ['image/vnd.ms-modi'], - 'mdx' => ['application/x-genesis-32x-rom', 'text/mdx'], - 'me' => ['text/troff', 'text/x-troff-me'], - 'med' => ['audio/x-mod'], - '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', 'application/x-magicpoint'], - 'mgz' => ['application/vnd.proteus.magazine'], - 'mht' => ['application/x-mimearchive'], - 'mhtml' => ['application/x-mimearchive'], - 'mid' => ['audio/midi', 'audio/x-midi'], - 'midi' => ['audio/midi', 'audio/x-midi'], - 'mie' => ['application/x-mie'], - 'mif' => ['application/vnd.mif', 'application/x-mif'], - 'mime' => ['message/rfc822'], - 'minipsf' => ['audio/x-minipsf'], - 'mj2' => ['video/mj2'], - 'mjp2' => ['video/mj2'], - 'mjpeg' => ['video/x-mjpeg'], - 'mjpg' => ['video/x-mjpeg'], - 'mjs' => ['application/javascript', 'application/x-javascript', 'text/javascript'], - 'mk' => ['text/x-makefile'], - 'mk3d' => ['video/x-matroska', 'video/x-matroska-3d'], - 'mka' => ['audio/x-matroska'], - 'mkd' => ['text/markdown', 'text/x-markdown'], - 'mks' => ['video/x-matroska'], - 'mkv' => ['video/x-matroska'], - 'ml' => ['text/x-ocaml'], - 'mli' => ['text/x-ocaml'], - 'mlp' => ['application/vnd.dolby.mlp'], - 'mm' => ['text/x-troff-mm'], - 'mmd' => ['application/vnd.chipnuts.karaoke-mmd'], - 'mmf' => ['application/vnd.smaf', 'application/x-smaf'], - 'mml' => ['application/mathml+xml', 'text/mathml'], - 'mmr' => ['image/vnd.fujixerox.edmics-mmr'], - 'mng' => ['video/x-mng'], - 'mny' => ['application/x-msmoney'], - 'mo' => ['application/x-gettext-translation', 'text/x-modelica'], - 'mo3' => ['audio/x-mo3'], - 'mobi' => ['application/x-mobipocket-ebook'], - 'moc' => ['text/x-moc'], - 'mod' => ['application/x-object', 'audio/x-mod'], - 'mods' => ['application/mods+xml'], - 'mof' => ['text/x-mof'], - 'moov' => ['video/quicktime'], - 'mount' => ['text/x-systemd-unit'], - 'mov' => ['video/quicktime'], - 'movie' => ['video/x-sgi-movie'], - 'mp+' => ['audio/x-musepack'], - 'mp2' => ['audio/mp2', 'audio/mpeg', 'audio/x-mp2', 'video/mpeg', 'video/mpeg-system', 'video/x-mpeg', 'video/x-mpeg-system', 'video/x-mpeg2'], - 'mp21' => ['application/mp21'], - 'mp2a' => ['audio/mpeg'], - 'mp3' => ['audio/mpeg', 'audio/mp3', 'audio/x-mp3', 'audio/x-mpeg', 'audio/x-mpg'], - 'mp4' => ['video/mp4', 'video/mp4v-es', 'video/x-m4v'], - 'mp4a' => ['audio/mp4'], - 'mp4s' => ['application/mp4'], - 'mp4v' => ['video/mp4'], - 'mpc' => ['application/vnd.mophun.certificate', 'audio/x-musepack'], - 'mpd' => ['application/dash+xml'], - 'mpe' => ['video/mpeg', 'video/mpeg-system', 'video/x-mpeg', 'video/x-mpeg-system', 'video/x-mpeg2'], - 'mpeg' => ['video/mpeg', 'video/mpeg-system', 'video/x-mpeg', 'video/x-mpeg-system', 'video/x-mpeg2'], - 'mpg' => ['video/mpeg', 'video/mpeg-system', 'video/x-mpeg', 'video/x-mpeg-system', 'video/x-mpeg2'], - 'mpg4' => ['video/mp4'], - 'mpga' => ['audio/mp3', 'audio/mpeg', 'audio/x-mp3', 'audio/x-mpeg', 'audio/x-mpg'], - 'mpkg' => ['application/vnd.apple.installer+xml'], - 'mpl' => ['video/mp2t'], - 'mpls' => ['video/mp2t'], - 'mpm' => ['application/vnd.blueice.multipass'], - 'mpn' => ['application/vnd.mophun.application'], - 'mpp' => ['application/vnd.ms-project', 'audio/x-musepack'], - 'mpt' => ['application/vnd.ms-project'], - 'mpy' => ['application/vnd.ibm.minipay'], - 'mqy' => ['application/vnd.mobius.mqy'], - 'mrc' => ['application/marc'], - 'mrcx' => ['application/marcxml+xml'], - 'mrl' => ['text/x-mrml'], - 'mrml' => ['text/x-mrml'], - 'mrw' => ['image/x-minolta-mrw'], - 'ms' => ['text/troff', 'text/x-troff-ms'], - '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', 'application/x-msi'], - 'msl' => ['application/vnd.mobius.msl'], - 'msod' => ['image/x-msod'], - 'msty' => ['application/vnd.muvee.style'], - 'msx' => ['application/x-msx-rom'], - 'mtl' => ['model/mtl'], - 'mtm' => ['audio/x-mod'], - 'mts' => ['model/vnd.mts', 'video/mp2t'], - 'mup' => ['text/x-mup'], - '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', 'video/x-mpegurl'], - 'n-gage' => ['application/vnd.nokia.n-gage.symbian.install'], - 'n3' => ['text/n3'], - 'n64' => ['application/x-n64-rom'], - 'nb' => ['application/mathematica', 'application/x-mathematica'], - 'nbp' => ['application/vnd.wolfram.player'], - 'nc' => ['application/x-netcdf'], - 'ncx' => ['application/x-dtbncx+xml'], - 'nds' => ['application/x-nintendo-ds-rom'], - 'nef' => ['image/x-nikon-nef'], - 'nes' => ['application/x-nes-rom'], - 'nez' => ['application/x-nes-rom'], - 'nfo' => ['text/x-nfo'], - 'ngc' => ['application/x-neo-geo-pocket-color-rom'], - 'ngdat' => ['application/vnd.nokia.n-gage.data'], - 'ngp' => ['application/x-neo-geo-pocket-rom'], - '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'], - 'not' => ['text/x-mup'], - 'npx' => ['image/vnd.net-fpx'], - 'nq' => ['application/n-quads'], - 'nrw' => ['image/x-nikon-nrw'], - 'nsc' => ['application/x-conference', 'application/x-netshow-channel'], - 'nsf' => ['application/vnd.lotus-notes'], - 'nsv' => ['video/x-nsv'], - 'nt' => ['application/n-triples'], - 'ntf' => ['application/vnd.nitf'], - 'numbers' => ['application/vnd.apple.numbers', 'application/x-iwork-numbers-sffnumbers'], - 'nzb' => ['application/x-nzb'], - 'o' => ['application/x-object'], - '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' => ['application/x-tgif', 'model/obj'], - 'ocl' => ['text/x-ocl'], - 'oda' => ['application/oda'], - 'odb' => ['application/vnd.oasis.opendocument.database', 'application/vnd.sun.xml.base'], - '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', 'audio/vorbis', 'audio/x-flac+ogg', 'audio/x-ogg', 'audio/x-oggflac', 'audio/x-speex+ogg', 'audio/x-vorbis', 'audio/x-vorbis+ogg'], - 'ogex' => ['model/vnd.opengex'], - 'ogg' => ['audio/ogg', 'audio/vorbis', 'audio/x-flac+ogg', 'audio/x-ogg', 'audio/x-oggflac', 'audio/x-speex+ogg', 'audio/x-vorbis', 'audio/x-vorbis+ogg', 'video/ogg', 'video/x-ogg', 'video/x-theora', 'video/x-theora+ogg'], - 'ogm' => ['video/x-ogm', 'video/x-ogm+ogg'], - 'ogv' => ['video/ogg', 'video/x-ogg'], - 'ogx' => ['application/ogg', 'application/x-ogg'], - 'old' => ['application/x-trash'], - 'oleo' => ['application/x-oleo'], - 'omdoc' => ['application/omdoc+xml'], - 'onepkg' => ['application/onenote'], - 'onetmp' => ['application/onenote'], - 'onetoc' => ['application/onenote'], - 'onetoc2' => ['application/onenote'], - 'ooc' => ['text/x-ooc'], - 'opf' => ['application/oebps-package+xml'], - 'opml' => ['text/x-opml', 'text/x-opml+xml'], - 'oprc' => ['application/vnd.palm', 'application/x-palm-database'], - 'opus' => ['audio/ogg', 'audio/x-ogg', 'audio/x-opus+ogg'], - 'ora' => ['image/openraster'], - 'orf' => ['image/x-olympus-orf'], - 'org' => ['application/vnd.lotus-organizer', 'text/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' => ['application/vnd.oasis.opendocument.formula-template', 'application/x-font-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/ovf', 'application/x-virtualbox-ova'], - 'ovf' => ['application/x-virtualbox-ovf'], - 'owl' => ['application/rdf+xml', 'text/rdf'], - 'owx' => ['application/owl+xml'], - 'oxps' => ['application/oxps'], - 'oxt' => ['application/vnd.openofficeorg.extension'], - 'p' => ['text/x-pascal'], - 'p10' => ['application/pkcs10'], - 'p12' => ['application/pkcs12', 'application/x-pkcs12'], - 'p65' => ['application/x-pagemaker'], - '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'], - 'p8e' => ['application/pkcs8-encrypted'], - 'pac' => ['application/x-ns-proxy-autoconfig'], - 'pack' => ['application/x-java-pack200'], - 'pages' => ['application/vnd.apple.pages', 'application/x-iwork-pages-sffpages'], - 'pak' => ['application/x-pak'], - 'par2' => ['application/x-par2'], - 'part' => ['application/x-partial-download'], - 'pas' => ['text/x-pascal'], - 'pat' => ['image/x-gimp-pat'], - 'patch' => ['text/x-diff', 'text/x-patch'], - 'path' => ['text/x-systemd-unit'], - 'paw' => ['application/vnd.pawaafile'], - 'pbd' => ['application/vnd.powerbuilder6'], - 'pbm' => ['image/x-portable-bitmap'], - 'pcap' => ['application/pcap', 'application/vnd.tcpdump.pcap', 'application/x-pcap'], - 'pcd' => ['image/x-photo-cd'], - 'pce' => ['application/x-pc-engine-rom'], - 'pcf' => ['application/x-cisco-vpn-settings', 'application/x-font-pcf'], - 'pcf.Z' => ['application/x-font-pcf'], - 'pcf.gz' => ['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/vnd.zbrush.pcx', 'image/x-pcx'], - 'pdb' => ['application/vnd.palm', 'application/x-aportisdoc', 'application/x-palm-database', 'application/x-pilot'], - 'pdc' => ['application/x-aportisdoc'], - 'pde' => ['text/x-processing'], - 'pdf' => ['application/pdf', 'application/acrobat', 'application/nappdf', 'application/x-pdf', 'image/pdf'], - 'pdf.bz2' => ['application/x-bzpdf'], - 'pdf.gz' => ['application/x-gzpdf'], - 'pdf.lz' => ['application/x-lzpdf'], - 'pdf.xz' => ['application/x-xzpdf'], - 'pef' => ['image/x-pentax-pef'], - 'pem' => ['application/x-x509-ca-cert'], - 'perl' => ['application/x-perl', 'text/x-perl'], - 'pfa' => ['application/x-font-type1'], - 'pfb' => ['application/x-font-type1'], - 'pfm' => ['application/x-font-type1'], - 'pfr' => ['application/font-tdpfr'], - 'pfx' => ['application/pkcs12', 'application/x-pkcs12'], - 'pgm' => ['image/x-portable-graymap'], - 'pgn' => ['application/vnd.chess-pgn', 'application/x-chess-pgn'], - 'pgp' => ['application/pgp', 'application/pgp-encrypted', 'application/pgp-keys', 'application/pgp-signature'], - 'php' => ['application/x-php', 'application/x-httpd-php'], - 'php3' => ['application/x-php'], - 'php4' => ['application/x-php'], - 'php5' => ['application/x-php'], - 'phps' => ['application/x-php'], - 'pic' => ['image/x-pict'], - 'pict' => ['image/x-pict'], - 'pict1' => ['image/x-pict'], - 'pict2' => ['image/x-pict'], - 'pk' => ['application/x-tex-pk'], - 'pkg' => ['application/x-xar'], - 'pki' => ['application/pkixcmp'], - 'pkipath' => ['application/pkix-pkipath'], - 'pkpass' => ['application/vnd.apple.pkpass'], - 'pkr' => ['application/pgp-keys'], - 'pl' => ['application/x-perl', 'text/x-perl'], - 'pla' => ['audio/x-iriver-pla'], - 'plb' => ['application/vnd.3gpp.pic-bw-large'], - 'plc' => ['application/vnd.mobius.plc'], - 'plf' => ['application/vnd.pocketlearn'], - 'pln' => ['application/x-planperfect'], - 'pls' => ['application/pls', 'application/pls+xml', 'audio/scpls', 'audio/x-scpls'], - 'pm' => ['application/x-pagemaker', 'application/x-perl', 'text/x-perl'], - 'pm6' => ['application/x-pagemaker'], - 'pmd' => ['application/x-pagemaker'], - 'pml' => ['application/vnd.ctc-posml'], - 'png' => ['image/png'], - 'pnm' => ['image/x-portable-anymap'], - 'pntg' => ['image/x-macpaint'], - 'po' => ['application/x-gettext', 'text/x-gettext-translation', 'text/x-po'], - 'pod' => ['application/x-perl', 'text/x-perl'], - 'por' => ['application/x-spss-por'], - 'portpkg' => ['application/vnd.macports.portpkg'], - 'pot' => ['application/mspowerpoint', 'application/powerpoint', 'application/vnd.ms-powerpoint', 'application/x-mspowerpoint', 'text/x-gettext-translation-template', 'text/x-pot'], - 'potm' => ['application/vnd.ms-powerpoint.template.macroenabled.12'], - 'potx' => ['application/vnd.openxmlformats-officedocument.presentationml.template'], - 'ppam' => ['application/vnd.ms-powerpoint.addin.macroenabled.12'], - 'ppd' => ['application/vnd.cups-ppd'], - 'ppm' => ['image/x-portable-pixmap'], - 'pps' => ['application/mspowerpoint', 'application/powerpoint', 'application/vnd.ms-powerpoint', 'application/x-mspowerpoint'], - 'ppsm' => ['application/vnd.ms-powerpoint.slideshow.macroenabled.12'], - 'ppsx' => ['application/vnd.openxmlformats-officedocument.presentationml.slideshow'], - 'ppt' => ['application/vnd.ms-powerpoint', 'application/mspowerpoint', 'application/powerpoint', 'application/x-mspowerpoint'], - 'pptm' => ['application/vnd.ms-powerpoint.presentation.macroenabled.12'], - 'pptx' => ['application/vnd.openxmlformats-officedocument.presentationml.presentation'], - 'ppz' => ['application/mspowerpoint', 'application/powerpoint', 'application/vnd.ms-powerpoint', 'application/x-mspowerpoint'], - 'pqa' => ['application/vnd.palm', 'application/x-palm-database'], - 'prc' => ['application/vnd.palm', 'application/x-mobipocket-ebook', 'application/x-palm-database', 'application/x-pilot'], - 'pre' => ['application/vnd.lotus-freelance'], - 'prf' => ['application/pics-rules'], - 'provx' => ['application/provenance+xml'], - 'ps' => ['application/postscript'], - 'ps.bz2' => ['application/x-bzpostscript'], - 'ps.gz' => ['application/x-gzpostscript'], - 'psb' => ['application/vnd.3gpp.pic-bw-small'], - 'psd' => ['application/photoshop', 'application/x-photoshop', 'image/photoshop', 'image/psd', 'image/vnd.adobe.photoshop', 'image/x-photoshop', 'image/x-psd'], - 'psf' => ['application/x-font-linux-psf', 'audio/x-psf'], - 'psf.gz' => ['application/x-gz-font-linux-psf'], - 'psflib' => ['audio/x-psflib'], - 'psid' => ['audio/prs.sid'], - 'pskcxml' => ['application/pskc+xml'], - 'psw' => ['application/x-pocket-word'], - 'pti' => ['image/prs.pti'], - 'ptid' => ['application/vnd.pvi.ptid1'], - 'pub' => ['application/vnd.ms-publisher', 'application/x-mspublisher'], - 'pvb' => ['application/vnd.3gpp.pic-bw-var'], - 'pw' => ['application/x-pw'], - 'pwn' => ['application/vnd.3m.post-it-notes'], - 'py' => ['text/x-python', 'text/x-python3'], - 'py3' => ['text/x-python3'], - 'py3x' => ['text/x-python3'], - 'pya' => ['audio/vnd.ms-playready.media.pya'], - 'pyc' => ['application/x-python-bytecode'], - 'pyi' => ['text/x-python3'], - 'pyo' => ['application/x-python-bytecode'], - 'pys' => ['application/x-pyspread-bz-spreadsheet'], - 'pysu' => ['application/x-pyspread-spreadsheet'], - 'pyv' => ['video/vnd.ms-playready.media.pyv'], - 'pyx' => ['text/x-python'], - 'qam' => ['application/vnd.epson.quickanime'], - 'qbo' => ['application/vnd.intu.qbo'], - 'qcow' => ['application/x-qemu-disk'], - 'qcow2' => ['application/x-qemu-disk'], - 'qd' => ['application/x-fd-file', 'application/x-raw-floppy-disk-image'], - 'qed' => ['application/x-qed-disk'], - 'qfx' => ['application/vnd.intu.qfx'], - 'qif' => ['application/x-qw', 'image/x-quicktime'], - 'qml' => ['text/x-qml'], - 'qmlproject' => ['text/x-qml'], - 'qmltypes' => ['text/x-qml'], - 'qp' => ['application/x-qpress'], - 'qps' => ['application/vnd.publishare-delta-tree'], - 'qt' => ['video/quicktime'], - 'qti' => ['application/x-qtiplot'], - 'qti.gz' => ['application/x-qtiplot'], - 'qtif' => ['image/x-quicktime'], - 'qtl' => ['application/x-quicktime-media-link', 'application/x-quicktimeplayer'], - 'qtvr' => ['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/vnd.m-realaudio', 'audio/vnd.rn-realaudio', 'audio/x-pn-realaudio', 'audio/x-realaudio'], - 'raf' => ['image/x-fuji-raf'], - 'ram' => ['application/ram', 'audio/x-pn-realaudio'], - 'raml' => ['application/raml+yaml'], - 'rapd' => ['application/route-apd+xml'], - 'rar' => ['application/x-rar-compressed', 'application/vnd.rar', 'application/x-rar'], - 'ras' => ['image/x-cmu-raster'], - 'raw' => ['image/x-panasonic-raw', 'image/x-panasonic-rw'], - 'raw-disk-image' => ['application/x-raw-disk-image'], - 'raw-disk-image.xz' => ['application/x-raw-disk-image-xz-compressed'], - 'rax' => ['audio/vnd.m-realaudio', 'audio/vnd.rn-realaudio', 'audio/x-pn-realaudio'], - 'rb' => ['application/x-ruby'], - 'rcprofile' => ['application/vnd.ipunplugged.rcprofile'], - 'rdf' => ['application/rdf+xml', 'text/rdf'], - 'rdfs' => ['application/rdf+xml', 'text/rdf'], - 'rdz' => ['application/vnd.data-vision.rdz'], - 'reg' => ['text/x-ms-regedit'], - 'rej' => ['application/x-reject', 'text/x-reject'], - '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'], - 'rle' => ['image/rle'], - 'rm' => ['application/vnd.rn-realmedia', 'application/vnd.rn-realmedia-vbr'], - 'rmi' => ['audio/midi'], - 'rmj' => ['application/vnd.rn-realmedia', 'application/vnd.rn-realmedia-vbr'], - 'rmm' => ['application/vnd.rn-realmedia', 'application/vnd.rn-realmedia-vbr'], - 'rmp' => ['audio/x-pn-realaudio-plugin'], - 'rms' => ['application/vnd.jcp.javame.midlet-rms', 'application/vnd.rn-realmedia', 'application/vnd.rn-realmedia-vbr'], - 'rmvb' => ['application/vnd.rn-realmedia', 'application/vnd.rn-realmedia-vbr'], - 'rmx' => ['application/vnd.rn-realmedia', 'application/vnd.rn-realmedia-vbr'], - 'rnc' => ['application/relax-ng-compact-syntax', 'application/x-rnc'], - 'rng' => ['application/xml', 'text/xml'], - 'roa' => ['application/rpki-roa'], - 'roff' => ['application/x-troff', 'text/troff', 'text/x-troff'], - 'ros' => ['text/x-common-lisp'], - 'rp' => ['image/vnd.rn-realpix'], - 'rp9' => ['application/vnd.cloanto.rp9'], - 'rpm' => ['application/x-redhat-package-manager', 'application/x-rpm'], - 'rpss' => ['application/vnd.nokia.radio-presets'], - 'rpst' => ['application/vnd.nokia.radio-preset'], - 'rq' => ['application/sparql-query'], - 'rs' => ['application/rls-services+xml', 'text/rust'], - 'rsat' => ['application/atsc-rsat+xml'], - 'rsd' => ['application/rsd+xml'], - 'rsheet' => ['application/urc-ressheet+xml'], - 'rss' => ['application/rss+xml', 'text/rss'], - 'rst' => ['text/x-rst'], - 'rt' => ['text/vnd.rn-realtext'], - 'rtf' => ['application/rtf', 'text/rtf'], - 'rtx' => ['text/richtext'], - 'run' => ['application/x-makeself'], - 'rusd' => ['application/route-usd+xml'], - 'rv' => ['video/vnd.rn-realvideo', 'video/x-real-video'], - 'rvx' => ['video/vnd.rn-realvideo', 'video/x-real-video'], - 'rw2' => ['image/x-panasonic-raw2', 'image/x-panasonic-rw2'], - 's' => ['text/x-asm'], - 's3m' => ['audio/s3m', 'audio/x-s3m'], - 'saf' => ['application/vnd.yamaha.smaf-audio'], - 'sage' => ['text/x-sagemath'], - 'sam' => ['application/x-amipro'], - 'sami' => ['application/x-sami'], - 'sap' => ['application/x-sap-file', 'application/x-thomson-sap-image'], - 'sass' => ['text/x-sass'], - 'sav' => ['application/x-spss-sav', 'application/x-spss-savefile'], - 'sbml' => ['application/sbml+xml'], - 'sc' => ['application/vnd.ibm.secure-container', 'text/x-scala'], - 'scala' => ['text/x-scala'], - 'scd' => ['application/x-msschedule'], - 'scm' => ['application/vnd.lotus-screencam', 'text/x-scheme'], - 'scope' => ['text/x-systemd-unit'], - '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', 'application/vnd.sdp', 'application/vnd.stardivision.impress', 'application/x-sdp'], - 'sds' => ['application/vnd.stardivision.chart'], - 'sdw' => ['application/vnd.stardivision.writer', 'application/vnd.stardivision.writer-global'], - 'sea' => ['application/x-sea'], - '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'], - 'service' => ['text/x-dbus-service', 'text/x-systemd-unit'], - 'setpay' => ['application/set-payment-initiation'], - 'setreg' => ['application/set-registration-initiation'], - 'sfc' => ['application/vnd.nintendo.snes.rom', 'application/x-snes-rom'], - 'sfd-hdstx' => ['application/vnd.hydrostatix.sof-data'], - 'sfs' => ['application/vnd.spotfire.sfs'], - 'sfv' => ['text/x-sfv'], - 'sg' => ['application/x-sg1000-rom'], - 'sgb' => ['application/x-gameboy-rom'], - 'sgd' => ['application/x-genesis-rom'], - 'sgf' => ['application/x-go-sgf'], - 'sgi' => ['image/sgi', 'image/x-sgi'], - 'sgl' => ['application/vnd.stardivision.writer', 'application/vnd.stardivision.writer-global'], - 'sgm' => ['text/sgml'], - 'sgml' => ['text/sgml'], - 'sh' => ['application/x-sh', 'application/x-shellscript', 'text/x-sh'], - 'shape' => ['application/x-dia-shape'], - 'shar' => ['application/x-shar'], - 'shex' => ['text/shex'], - 'shf' => ['application/shf+xml'], - 'shn' => ['application/x-shorten', 'audio/x-shorten'], - 'shtml' => ['text/html'], - 'siag' => ['application/x-siag'], - 'sid' => ['audio/prs.sid', 'image/x-mrsid-image'], - 'sieve' => ['application/sieve'], - 'sig' => ['application/pgp-signature'], - 'sik' => ['application/x-trash'], - 'sil' => ['audio/silk'], - 'silo' => ['model/mesh'], - 'sis' => ['application/vnd.symbian.install'], - 'sisx' => ['application/vnd.symbian.install', 'x-epoc/x-sisx-app'], - 'sit' => ['application/x-stuffit', 'application/stuffit', 'application/x-sit'], - 'sitx' => ['application/x-stuffitx'], - 'siv' => ['application/sieve'], - 'sk' => ['image/x-skencil'], - 'sk1' => ['image/x-skencil'], - 'skd' => ['application/vnd.koan'], - 'skm' => ['application/vnd.koan'], - 'skp' => ['application/vnd.koan'], - 'skr' => ['application/pgp-keys'], - 'skt' => ['application/vnd.koan'], - 'sldm' => ['application/vnd.ms-powerpoint.slide.macroenabled.12'], - 'sldx' => ['application/vnd.openxmlformats-officedocument.presentationml.slide'], - 'slice' => ['text/x-systemd-unit'], - 'slim' => ['text/slim'], - 'slk' => ['text/spreadsheet'], - 'slm' => ['text/slim'], - 'sls' => ['application/route-s-tsid+xml'], - 'slt' => ['application/vnd.epson.salt'], - 'sm' => ['application/vnd.stepmania.stepchart'], - 'smaf' => ['application/vnd.smaf', 'application/x-smaf'], - 'smc' => ['application/vnd.nintendo.snes.rom', 'application/x-snes-rom'], - 'smd' => ['application/vnd.stardivision.mail', 'application/x-genesis-rom'], - 'smf' => ['application/vnd.stardivision.math'], - 'smi' => ['application/smil', 'application/smil+xml', 'application/x-sami'], - 'smil' => ['application/smil', 'application/smil+xml'], - 'smk' => ['video/vnd.radgamettools.smacker'], - 'sml' => ['application/smil', 'application/smil+xml'], - 'sms' => ['application/x-sms-rom'], - 'smv' => ['video/x-smv'], - 'smzip' => ['application/vnd.stepmania.package'], - 'snap' => ['application/vnd.snap'], - 'snd' => ['audio/basic'], - 'snf' => ['application/x-font-snf'], - 'so' => ['application/x-sharedlib'], - 'socket' => ['text/x-systemd-unit'], - 'spc' => ['application/x-pkcs7-certificates'], - 'spd' => ['application/x-font-speedo'], - 'spdx' => ['text/spdx'], - 'spec' => ['text/x-rpm-spec'], - 'spf' => ['application/vnd.yamaha.smaf-phrase'], - 'spl' => ['application/futuresplash', 'application/vnd.adobe.flash.movie', 'application/x-futuresplash', 'application/x-shockwave-flash'], - 'spm' => ['application/x-source-rpm'], - 'spot' => ['text/vnd.in3d.spot'], - 'spp' => ['application/scvp-vp-response'], - 'spq' => ['application/scvp-vp-request'], - 'spx' => ['application/x-apple-systemprofiler+xml', 'audio/ogg', 'audio/x-speex', 'audio/x-speex+ogg'], - 'sql' => ['application/sql', 'application/x-sql', 'text/x-sql'], - 'sqlite2' => ['application/x-sqlite2'], - 'sqlite3' => ['application/vnd.sqlite3', 'application/x-sqlite3'], - 'sqsh' => ['application/vnd.squashfs'], - 'sr2' => ['image/x-sony-sr2'], - 'src' => ['application/x-wais-source'], - 'src.rpm' => ['application/x-source-rpm'], - 'srf' => ['image/x-sony-srf'], - 'srt' => ['application/x-srt', 'application/x-subrip'], - 'sru' => ['application/sru+xml'], - 'srx' => ['application/sparql-results+xml'], - 'ss' => ['text/x-scheme'], - 'ssa' => ['text/x-ssa'], - 'ssdl' => ['application/ssdl+xml'], - 'sse' => ['application/vnd.kodak-descriptor'], - 'ssf' => ['application/vnd.epson.ssf'], - 'ssml' => ['application/ssml+xml'], - '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' => ['application/vnd.ms-pki.stl', 'model/stl', 'model/x.stl-ascii', 'model/x.stl-binary'], - 'stm' => ['audio/x-stm'], - 'stpxz' => ['model/step-xml+zip'], - 'stpz' => ['model/step+zip'], - 'str' => ['application/vnd.pg.format'], - 'stw' => ['application/vnd.sun.xml.writer.template'], - 'sty' => ['application/x-tex', 'text/x-tex'], - 'styl' => ['text/stylus'], - 'stylus' => ['text/stylus'], - 'sub' => ['image/vnd.dvb.subtitle', 'text/vnd.dvb.subtitle', 'text/x-microdvd', 'text/x-mpsub', 'text/x-subviewer'], - 'sun' => ['image/x-sun-raster'], - 'sus' => ['application/vnd.sus-calendar'], - 'susp' => ['application/vnd.sus-calendar'], - 'sv' => ['text/x-svsrc'], - 'sv4cpio' => ['application/x-sv4cpio'], - 'sv4crc' => ['application/x-sv4crc'], - 'svc' => ['application/vnd.dvb.service'], - 'svd' => ['application/vnd.svd'], - 'svg' => ['image/svg+xml', 'image/svg'], - 'svgz' => ['image/svg+xml', 'image/svg+xml-compressed'], - 'svh' => ['text/x-svhdr'], - 'swa' => ['application/x-director'], - 'swap' => ['text/x-systemd-unit'], - 'swf' => ['application/futuresplash', 'application/vnd.adobe.flash.movie', 'application/x-shockwave-flash'], - 'swi' => ['application/vnd.aristanetworks.swi'], - 'swidtag' => ['application/swid+xml'], - 'swm' => ['application/x-ms-wim'], - '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'], - 'sylk' => ['text/spreadsheet'], - 't' => ['application/x-perl', 'application/x-troff', 'text/troff', 'text/x-perl', 'text/x-troff'], - 't2t' => ['text/x-txt2tags'], - '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', 'application/x-gtar'], - 'tar.Z' => ['application/x-tarz'], - 'tar.bz' => ['application/x-bzip-compressed-tar'], - 'tar.bz2' => ['application/x-bzip-compressed-tar'], - 'tar.gz' => ['application/x-compressed-tar'], - 'tar.lrz' => ['application/x-lrzip-compressed-tar'], - 'tar.lz' => ['application/x-lzip-compressed-tar'], - 'tar.lz4' => ['application/x-lz4-compressed-tar'], - 'tar.lzma' => ['application/x-lzma-compressed-tar'], - 'tar.lzo' => ['application/x-tzo'], - 'tar.xz' => ['application/x-xz-compressed-tar'], - 'tar.zst' => ['application/x-zstd-compressed-tar'], - 'target' => ['text/x-systemd-unit'], - 'taz' => ['application/x-tarz'], - 'tb2' => ['application/x-bzip-compressed-tar'], - 'tbz' => ['application/x-bzip-compressed-tar'], - 'tbz2' => ['application/x-bzip-compressed-tar'], - 'tcap' => ['application/vnd.3gpp2.tcap'], - 'tcl' => ['application/x-tcl', 'text/tcl', 'text/x-tcl'], - 'td' => ['application/urc-targetdesc+xml'], - 'teacher' => ['application/vnd.smart.teacher'], - 'tei' => ['application/tei+xml'], - 'teicorpus' => ['application/tei+xml'], - 'tex' => ['application/x-tex', 'text/x-tex'], - 'texi' => ['application/x-texinfo', 'text/x-texinfo'], - 'texinfo' => ['application/x-texinfo', 'text/x-texinfo'], - 'text' => ['text/plain'], - 'tfi' => ['application/thraud+xml'], - 'tfm' => ['application/x-tex-tfm'], - 'tfx' => ['image/tiff-fx'], - 'tga' => ['application/tga', 'application/x-targa', 'application/x-tga', 'image/targa', 'image/tga', 'image/x-icb', 'image/x-targa', 'image/x-tga'], - 'tgz' => ['application/x-compressed-tar'], - 'theme' => ['application/x-theme'], - 'themepack' => ['application/x-windows-themepack'], - 'thmx' => ['application/vnd.ms-officetheme'], - 'tif' => ['image/tiff'], - 'tiff' => ['image/tiff'], - 'timer' => ['text/x-systemd-unit'], - 'tk' => ['application/x-tcl', 'text/tcl', 'text/x-tcl'], - 'tlrz' => ['application/x-lrzip-compressed-tar'], - 'tlz' => ['application/x-lzma-compressed-tar'], - 'tmo' => ['application/vnd.tmobile-livetv'], - 'tnef' => ['application/ms-tnef', 'application/vnd.ms-tnef'], - 'tnf' => ['application/ms-tnef', 'application/vnd.ms-tnef'], - 'toc' => ['application/x-cdrdao-toc'], - 'toml' => ['application/toml'], - 'torrent' => ['application/x-bittorrent'], - 'tpic' => ['application/tga', 'application/x-targa', 'application/x-tga', 'image/targa', 'image/tga', 'image/x-icb', 'image/x-targa', 'image/x-tga'], - 'tpl' => ['application/vnd.groove-tool-template'], - 'tpt' => ['application/vnd.trid.tpt'], - 'tr' => ['application/x-troff', 'text/troff', 'text/x-troff'], - 'tra' => ['application/vnd.trueapp'], - 'trig' => ['application/trig', 'application/x-trig'], - 'trm' => ['application/x-msterminal'], - 'ts' => ['application/x-linguist', 'text/vnd.qt.linguist', 'text/vnd.trolltech.linguist', 'video/mp2t'], - 'tsd' => ['application/timestamped-data'], - 'tsv' => ['text/tab-separated-values'], - 'tta' => ['audio/tta', 'audio/x-tta'], - 'ttc' => ['font/collection'], - 'ttf' => ['application/x-font-truetype', 'application/x-font-ttf', 'font/ttf'], - 'ttl' => ['text/turtle'], - 'ttml' => ['application/ttml+xml'], - 'ttx' => ['application/x-font-ttx'], - 'twd' => ['application/vnd.simtech-mindmapper'], - 'twds' => ['application/vnd.simtech-mindmapper'], - 'twig' => ['text/x-twig'], - 'txd' => ['application/vnd.genomatix.tuxedo'], - 'txf' => ['application/vnd.mobius.txf'], - 'txt' => ['text/plain'], - 'txz' => ['application/x-xz-compressed-tar'], - 'tzo' => ['application/x-tzo'], - 'tzst' => ['application/x-zstd-compressed-tar'], - 'u32' => ['application/x-authorware-bin'], - 'u8dsn' => ['message/global-delivery-status'], - 'u8hdr' => ['message/global-headers'], - 'u8mdn' => ['message/global-disposition-notification'], - 'u8msg' => ['message/global'], - 'ubj' => ['application/ubjson'], - 'udeb' => ['application/vnd.debian.binary-package', 'application/x-deb', 'application/x-debian-package'], - 'ufd' => ['application/vnd.ufdl'], - 'ufdl' => ['application/vnd.ufdl'], - 'ufraw' => ['application/x-ufraw'], - 'ui' => ['application/x-designer', 'application/x-gtk-builder'], - 'uil' => ['text/x-uil'], - 'ult' => ['audio/x-mod'], - 'ulx' => ['application/x-glulx'], - 'umj' => ['application/vnd.umajin'], - 'unf' => ['application/x-nes-rom'], - 'uni' => ['audio/x-mod'], - 'unif' => ['application/x-nes-rom'], - 'unityweb' => ['application/vnd.unity'], - 'uoml' => ['application/vnd.uoml+xml'], - 'uri' => ['text/uri-list'], - 'uris' => ['text/uri-list'], - 'url' => ['application/x-mswinurl'], - 'urls' => ['text/uri-list'], - 'usdz' => ['model/vnd.usdz+zip'], - 'ustar' => ['application/x-ustar'], - 'utz' => ['application/vnd.uiq.theme'], - 'uu' => ['text/x-uuencode'], - 'uue' => ['text/x-uuencode', 'zz-application/zz-winassoc-uu'], - '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'], - 'v' => ['text/x-verilog'], - 'v64' => ['application/x-n64-rom'], - 'vala' => ['text/x-vala'], - 'vapi' => ['text/x-vala'], - 'vb' => ['application/x-virtual-boy-rom'], - 'vbox' => ['application/x-virtualbox-vbox'], - 'vbox-extpack' => ['application/x-virtualbox-vbox-extpack'], - 'vbs' => ['text/vbs', 'text/vbscript'], - 'vcard' => ['text/directory', 'text/vcard', 'text/x-vcard'], - 'vcd' => ['application/x-cdlink'], - 'vcf' => ['text/x-vcard', 'text/directory', 'text/vcard'], - 'vcg' => ['application/vnd.groove-vcard'], - 'vcs' => ['application/ics', 'text/calendar', 'text/x-vcalendar'], - 'vct' => ['text/directory', 'text/vcard', 'text/x-vcard'], - 'vcx' => ['application/vnd.vcx'], - 'vda' => ['application/tga', 'application/x-targa', 'application/x-tga', 'image/targa', 'image/tga', 'image/x-icb', 'image/x-targa', 'image/x-tga'], - 'vdi' => ['application/x-vdi-disk', 'application/x-virtualbox-vdi'], - 'vds' => ['model/vnd.sap.vds'], - 'vhd' => ['application/x-vhd-disk', 'application/x-virtualbox-vhd', 'text/x-vhdl'], - 'vhdl' => ['text/x-vhdl'], - 'vhdx' => ['application/x-vhdx-disk', 'application/x-virtualbox-vhdx'], - 'vis' => ['application/vnd.visionary'], - 'viv' => ['video/vivo', 'video/vnd.vivo'], - 'vivo' => ['video/vivo', 'video/vnd.vivo'], - 'vlc' => ['application/m3u', 'audio/m3u', 'audio/mpegurl', 'audio/x-m3u', 'audio/x-mp3-playlist', 'audio/x-mpegurl'], - 'vmdk' => ['application/x-virtualbox-vmdk', 'application/x-vmdk-disk'], - 'vob' => ['video/mpeg', 'video/mpeg-system', 'video/x-mpeg', 'video/x-mpeg-system', 'video/x-mpeg2', 'video/x-ms-vob'], - 'voc' => ['audio/x-voc'], - 'vor' => ['application/vnd.stardivision.writer', 'application/vnd.stardivision.writer-global'], - 'vox' => ['application/x-authorware-bin'], - 'vpc' => ['application/x-vhd-disk', 'application/x-virtualbox-vhd'], - 'vrm' => ['model/vrml'], - 'vrml' => ['model/vrml'], - 'vsd' => ['application/vnd.visio'], - 'vsdm' => ['application/vnd.ms-visio.drawing.macroenabled.main+xml'], - 'vsdx' => ['application/vnd.ms-visio.drawing.main+xml'], - 'vsf' => ['application/vnd.vsf'], - 'vss' => ['application/vnd.visio'], - 'vssm' => ['application/vnd.ms-visio.stencil.macroenabled.main+xml'], - 'vssx' => ['application/vnd.ms-visio.stencil.main+xml'], - 'vst' => ['application/tga', 'application/vnd.visio', 'application/x-targa', 'application/x-tga', 'image/targa', 'image/tga', 'image/x-icb', 'image/x-targa', 'image/x-tga'], - 'vstm' => ['application/vnd.ms-visio.template.macroenabled.main+xml'], - 'vstx' => ['application/vnd.ms-visio.template.main+xml'], - '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', 'application/x-doom-wad', 'application/x-wii-wad'], - 'wadl' => ['application/vnd.sun.wadl+xml'], - 'war' => ['application/java-archive'], - 'wasm' => ['application/wasm'], - 'wav' => ['audio/wav', 'audio/vnd.wave', 'audio/wave', 'audio/x-wav'], - 'wax' => ['application/x-ms-asx', 'audio/x-ms-asx', 'audio/x-ms-wax', 'video/x-ms-wax', 'video/x-ms-wmx', 'video/x-ms-wvx'], - 'wb1' => ['application/x-quattropro'], - 'wb2' => ['application/x-quattropro'], - 'wb3' => ['application/x-quattropro'], - 'wbmp' => ['image/vnd.wap.wbmp'], - 'wbs' => ['application/vnd.criticaltools.wbs+xml'], - 'wbxml' => ['application/vnd.wap.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'], - 'wim' => ['application/x-ms-wim'], - 'wk1' => ['application/lotus123', 'application/vnd.lotus-1-2-3', 'application/wk1', 'application/x-123', 'application/x-lotus123', 'zz-application/zz-winassoc-123'], - 'wk3' => ['application/lotus123', 'application/vnd.lotus-1-2-3', 'application/wk1', 'application/x-123', 'application/x-lotus123', 'zz-application/zz-winassoc-123'], - 'wk4' => ['application/lotus123', 'application/vnd.lotus-1-2-3', 'application/wk1', 'application/x-123', 'application/x-lotus123', 'zz-application/zz-winassoc-123'], - 'wkdownload' => ['application/x-partial-download'], - 'wks' => ['application/lotus123', 'application/vnd.lotus-1-2-3', 'application/vnd.ms-works', 'application/wk1', 'application/x-123', 'application/x-lotus123', 'zz-application/zz-winassoc-123'], - 'wm' => ['video/x-ms-wm'], - 'wma' => ['audio/x-ms-wma', 'audio/wma'], - 'wmd' => ['application/x-ms-wmd'], - 'wmf' => ['application/wmf', 'application/x-msmetafile', 'application/x-wmf', 'image/wmf', 'image/x-win-metafile', 'image/x-wmf'], - 'wml' => ['text/vnd.wap.wml'], - 'wmlc' => ['application/vnd.wap.wmlc'], - 'wmls' => ['text/vnd.wap.wmlscript'], - 'wmlsc' => ['application/vnd.wap.wmlscriptc'], - 'wmv' => ['audio/x-ms-wmv', 'video/x-ms-wmv'], - 'wmx' => ['application/x-ms-asx', 'audio/x-ms-asx', 'video/x-ms-wax', 'video/x-ms-wmx', 'video/x-ms-wvx'], - 'wmz' => ['application/x-ms-wmz', 'application/x-msmetafile'], - 'woff' => ['application/font-woff', 'application/x-font-woff', 'font/woff'], - 'woff2' => ['font/woff2'], - 'wp' => ['application/vnd.wordperfect', 'application/wordperfect', 'application/x-wordperfect'], - 'wp4' => ['application/vnd.wordperfect', 'application/wordperfect', 'application/x-wordperfect'], - 'wp5' => ['application/vnd.wordperfect', 'application/wordperfect', 'application/x-wordperfect'], - 'wp6' => ['application/vnd.wordperfect', 'application/wordperfect', 'application/x-wordperfect'], - 'wpd' => ['application/vnd.wordperfect', 'application/wordperfect', 'application/x-wordperfect'], - 'wpg' => ['application/x-wpg'], - 'wpl' => ['application/vnd.ms-wpl'], - 'wpp' => ['application/vnd.wordperfect', 'application/wordperfect', 'application/x-wordperfect'], - 'wps' => ['application/vnd.ms-works'], - 'wqd' => ['application/vnd.wqd'], - 'wri' => ['application/x-mswrite'], - 'wrl' => ['model/vrml'], - 'ws' => ['application/x-wonderswan-rom'], - 'wsc' => ['application/x-wonderswan-color-rom', 'message/vnd.wfa.wsc'], - 'wsdl' => ['application/wsdl+xml'], - 'wsgi' => ['text/x-python'], - 'wspolicy' => ['application/wspolicy+xml'], - 'wtb' => ['application/vnd.webturbo'], - 'wv' => ['audio/x-wavpack'], - 'wvc' => ['audio/x-wavpack-correction'], - 'wvp' => ['audio/x-wavpack'], - 'wvx' => ['application/x-ms-asx', 'audio/x-ms-asx', 'video/x-ms-wax', 'video/x-ms-wmx', 'video/x-ms-wvx'], - 'wwf' => ['application/wwf', 'application/x-wwf'], - 'x32' => ['application/x-authorware-bin'], - 'x3d' => ['model/x3d+xml'], - 'x3db' => ['model/x3d+binary', 'model/x3d+fastinfoset'], - 'x3dbz' => ['model/x3d+binary'], - 'x3dv' => ['model/x3d+vrml', 'model/x3d-vrml'], - 'x3dvz' => ['model/x3d+vrml'], - 'x3dz' => ['model/x3d+xml'], - 'x3f' => ['image/x-sigma-x3f'], - 'x_b' => ['model/vnd.parasolid.transmit.binary'], - 'x_t' => ['model/vnd.parasolid.transmit.text'], - 'xac' => ['application/x-gnucash'], - 'xaml' => ['application/xaml+xml'], - 'xap' => ['application/x-silverlight-app'], - 'xar' => ['application/vnd.xara', 'application/x-xar'], - 'xav' => ['application/xcap-att+xml'], - 'xbap' => ['application/x-ms-xbap'], - 'xbd' => ['application/vnd.fujixerox.docuworks.binder'], - 'xbel' => ['application/x-xbel'], - 'xbl' => ['application/xml', 'text/xml'], - 'xbm' => ['image/x-xbitmap'], - 'xca' => ['application/xcap-caps+xml'], - 'xcf' => ['image/x-xcf'], - 'xcf.bz2' => ['image/x-compressed-xcf'], - 'xcf.gz' => ['image/x-compressed-xcf'], - 'xcs' => ['application/calendar+xml'], - 'xdf' => ['application/mrb-consumer+xml', 'application/mrb-publish+xml', 'application/xcap-diff+xml'], - 'xdgapp' => ['application/vnd.flatpak', 'application/vnd.xdgapp'], - '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', 'application/xcap-error+xml'], - 'xfdf' => ['application/vnd.adobe.xfdf'], - 'xfdl' => ['application/vnd.xfdl'], - 'xhe' => ['audio/usac'], - 'xht' => ['application/xhtml+xml'], - 'xhtml' => ['application/xhtml+xml'], - 'xhvml' => ['application/xv+xml'], - 'xi' => ['audio/x-xi'], - 'xif' => ['image/vnd.xiff'], - 'xla' => ['application/msexcel', 'application/vnd.ms-excel', 'application/x-msexcel', 'zz-application/zz-winassoc-xls'], - 'xlam' => ['application/vnd.ms-excel.addin.macroenabled.12'], - 'xlc' => ['application/msexcel', 'application/vnd.ms-excel', 'application/x-msexcel', 'zz-application/zz-winassoc-xls'], - 'xld' => ['application/msexcel', 'application/vnd.ms-excel', 'application/x-msexcel', 'zz-application/zz-winassoc-xls'], - 'xlf' => ['application/x-xliff', 'application/x-xliff+xml', 'application/xliff+xml'], - 'xliff' => ['application/x-xliff', 'application/xliff+xml'], - 'xll' => ['application/msexcel', 'application/vnd.ms-excel', 'application/x-msexcel', 'zz-application/zz-winassoc-xls'], - 'xlm' => ['application/msexcel', 'application/vnd.ms-excel', 'application/x-msexcel', 'zz-application/zz-winassoc-xls'], - 'xlr' => ['application/vnd.ms-works'], - 'xls' => ['application/vnd.ms-excel', 'application/msexcel', 'application/x-msexcel', 'zz-application/zz-winassoc-xls'], - '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/msexcel', 'application/vnd.ms-excel', 'application/x-msexcel', 'zz-application/zz-winassoc-xls'], - 'xltm' => ['application/vnd.ms-excel.template.macroenabled.12'], - 'xltx' => ['application/vnd.openxmlformats-officedocument.spreadsheetml.template'], - 'xlw' => ['application/msexcel', 'application/vnd.ms-excel', 'application/x-msexcel', 'zz-application/zz-winassoc-xls'], - 'xm' => ['audio/x-xm', 'audio/xm'], - 'xmf' => ['audio/mobile-xmf', 'audio/x-xmf', 'audio/xmf'], - 'xmi' => ['text/x-xmi'], - 'xml' => ['application/xml', 'text/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', 'image/x-xpm'], - 'xpr' => ['application/vnd.is-xpr'], - 'xps' => ['application/vnd.ms-xpsdocument', 'application/xps'], - 'xpw' => ['application/vnd.intercon.formnet'], - 'xpx' => ['application/vnd.intercon.formnet'], - 'xsd' => ['application/xml', 'text/xml'], - 'xsl' => ['application/xml', 'application/xslt+xml'], - 'xslfo' => ['text/x-xslfo'], - 'xslt' => ['application/xslt+xml'], - 'xsm' => ['application/vnd.syncml+xml'], - 'xspf' => ['application/x-xspf+xml', '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' => ['application/x-yaml', 'text/x-yaml', 'text/yaml'], - 'yang' => ['application/yang'], - 'yin' => ['application/yin+xml'], - 'yml' => ['application/x-yaml', 'text/x-yaml', 'text/yaml'], - 'ymp' => ['text/x-suse-ymp'], - 'yt' => ['application/vnd.youtube.yt'], - 'z1' => ['application/x-zmachine'], - 'z2' => ['application/x-zmachine'], - 'z3' => ['application/x-zmachine'], - 'z4' => ['application/x-zmachine'], - 'z5' => ['application/x-zmachine'], - 'z6' => ['application/x-zmachine'], - 'z64' => ['application/x-n64-rom'], - 'z7' => ['application/x-zmachine'], - 'z8' => ['application/x-zmachine'], - 'zabw' => ['application/x-abiword'], - 'zaz' => ['application/vnd.zzazz.deck+xml'], - 'zip' => ['application/zip', 'application/x-zip', 'application/x-zip-compressed'], - 'zir' => ['application/vnd.zul'], - 'zirz' => ['application/vnd.zul'], - 'zmm' => ['application/vnd.handheld-entertainment+xml'], - 'zoo' => ['application/x-zoo'], - 'zsav' => ['application/x-spss-sav', 'application/x-spss-savefile'], - 'zst' => ['application/zstd'], - 'zz' => ['application/zlib'], - '123' => ['application/lotus123', 'application/vnd.lotus-1-2-3', 'application/wk1', 'application/x-123', 'application/x-lotus123', 'zz-application/zz-winassoc-123'], - '602' => ['application/x-t602'], - '669' => ['audio/x-mod'], - ]; -} diff --git a/vendor/symfony/mime/MimeTypesInterface.php b/vendor/symfony/mime/MimeTypesInterface.php deleted file mode 100644 index 17d45ad2..00000000 --- a/vendor/symfony/mime/MimeTypesInterface.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\Mime; - -/** - * @author Fabien Potencier - */ -interface MimeTypesInterface extends MimeTypeGuesserInterface -{ - /** - * Gets the extensions for the given MIME type in decreasing order of preference. - * - * @return string[] - */ - public function getExtensions(string $mimeType): array; - - /** - * Gets the MIME types for the given extension in decreasing order of preference. - * - * @return string[] - */ - public function getMimeTypes(string $ext): array; -} diff --git a/vendor/symfony/mime/Part/AbstractMultipartPart.php b/vendor/symfony/mime/Part/AbstractMultipartPart.php deleted file mode 100644 index b7980ea0..00000000 --- a/vendor/symfony/mime/Part/AbstractMultipartPart.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\Mime\Part; - -use Symfony\Component\Mime\Header\Headers; - -/** - * @author Fabien Potencier - */ -abstract class AbstractMultipartPart extends AbstractPart -{ - private $boundary; - private $parts = []; - - public function __construct(AbstractPart ...$parts) - { - parent::__construct(); - - foreach ($parts as $part) { - $this->parts[] = $part; - } - } - - /** - * @return AbstractPart[] - */ - public function getParts(): array - { - return $this->parts; - } - - public function getMediaType(): string - { - return 'multipart'; - } - - public function getPreparedHeaders(): Headers - { - $headers = parent::getPreparedHeaders(); - $headers->setHeaderParameter('Content-Type', 'boundary', $this->getBoundary()); - - return $headers; - } - - public function bodyToString(): string - { - $parts = $this->getParts(); - $string = ''; - foreach ($parts as $part) { - $string .= '--'.$this->getBoundary()."\r\n".$part->toString()."\r\n"; - } - $string .= '--'.$this->getBoundary()."--\r\n"; - - return $string; - } - - public function bodyToIterable(): iterable - { - $parts = $this->getParts(); - foreach ($parts as $part) { - yield '--'.$this->getBoundary()."\r\n"; - yield from $part->toIterable(); - yield "\r\n"; - } - yield '--'.$this->getBoundary()."--\r\n"; - } - - public function asDebugString(): string - { - $str = parent::asDebugString(); - foreach ($this->getParts() as $part) { - $lines = explode("\n", $part->asDebugString()); - $str .= "\n └ ".array_shift($lines); - foreach ($lines as $line) { - $str .= "\n |".$line; - } - } - - return $str; - } - - private function getBoundary(): string - { - return $this->boundary ??= strtr(base64_encode(random_bytes(6)), '+/', '-_'); - } -} diff --git a/vendor/symfony/mime/Part/AbstractPart.php b/vendor/symfony/mime/Part/AbstractPart.php deleted file mode 100644 index 93892d9d..00000000 --- a/vendor/symfony/mime/Part/AbstractPart.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime\Part; - -use Symfony\Component\Mime\Header\Headers; - -/** - * @author Fabien Potencier - */ -abstract class AbstractPart -{ - private $headers; - - public function __construct() - { - $this->headers = new Headers(); - } - - public function getHeaders(): Headers - { - return $this->headers; - } - - public function getPreparedHeaders(): Headers - { - $headers = clone $this->headers; - $headers->setHeaderBody('Parameterized', 'Content-Type', $this->getMediaType().'/'.$this->getMediaSubtype()); - - return $headers; - } - - public function toString(): string - { - return $this->getPreparedHeaders()->toString()."\r\n".$this->bodyToString(); - } - - public function toIterable(): iterable - { - yield $this->getPreparedHeaders()->toString(); - yield "\r\n"; - yield from $this->bodyToIterable(); - } - - public function asDebugString(): string - { - return $this->getMediaType().'/'.$this->getMediaSubtype(); - } - - abstract public function bodyToString(): string; - - abstract public function bodyToIterable(): iterable; - - abstract public function getMediaType(): string; - - abstract public function getMediaSubtype(): string; -} diff --git a/vendor/symfony/mime/Part/DataPart.php b/vendor/symfony/mime/Part/DataPart.php deleted file mode 100644 index b42ecb4d..00000000 --- a/vendor/symfony/mime/Part/DataPart.php +++ /dev/null @@ -1,167 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime\Part; - -use Symfony\Component\Mime\Exception\InvalidArgumentException; -use Symfony\Component\Mime\Header\Headers; - -/** - * @author Fabien Potencier - */ -class DataPart extends TextPart -{ - /** @internal */ - protected $_parent; - - private $filename; - private $mediaType; - private $cid; - - /** - * @param resource|string|File $body Use a File instance to defer loading the file until rendering - */ - public function __construct($body, string $filename = null, string $contentType = null, string $encoding = null) - { - unset($this->_parent); - - if ($body instanceof File && !$filename) { - $filename = $body->getFilename(); - } - - $contentType ??= $body instanceof File ? $body->getContentType() : 'application/octet-stream'; - [$this->mediaType, $subtype] = explode('/', $contentType); - - parent::__construct($body, null, $subtype, $encoding); - - if (null !== $filename) { - $this->filename = $filename; - $this->setName($filename); - } - $this->setDisposition('attachment'); - } - - public static function fromPath(string $path, string $name = null, string $contentType = null): self - { - return new self(new File($path), $name, $contentType); - } - - /** - * @return $this - */ - public function asInline(): static - { - return $this->setDisposition('inline'); - } - - /** - * @return $this - */ - public function setContentId(string $cid): static - { - if (!str_contains($cid, '@')) { - throw new InvalidArgumentException(sprintf('Invalid cid "%s".', $cid)); - } - - $this->cid = $cid; - - return $this; - } - - public function getContentId(): string - { - return $this->cid ?: $this->cid = $this->generateContentId(); - } - - public function hasContentId(): bool - { - return null !== $this->cid; - } - - public function getMediaType(): string - { - return $this->mediaType; - } - - public function getPreparedHeaders(): Headers - { - $headers = parent::getPreparedHeaders(); - - if (null !== $this->cid) { - $headers->setHeaderBody('Id', 'Content-ID', $this->cid); - } - - if (null !== $this->filename) { - $headers->setHeaderParameter('Content-Disposition', 'filename', $this->filename); - } - - return $headers; - } - - public function asDebugString(): string - { - $str = parent::asDebugString(); - if (null !== $this->filename) { - $str .= ' filename: '.$this->filename; - } - - return $str; - } - - public function getFilename(): ?string - { - return $this->filename; - } - - public function getContentType(): string - { - return implode('/', [$this->getMediaType(), $this->getMediaSubtype()]); - } - - private function generateContentId(): string - { - return bin2hex(random_bytes(16)).'@symfony'; - } - - public function __sleep(): array - { - // converts the body to a string - parent::__sleep(); - - $this->_parent = []; - foreach (['body', 'charset', 'subtype', 'disposition', 'name', 'encoding'] as $name) { - $r = new \ReflectionProperty(TextPart::class, $name); - $this->_parent[$name] = $r->getValue($this); - } - $this->_headers = $this->getHeaders(); - - return ['_headers', '_parent', 'filename', 'mediaType']; - } - - public function __wakeup() - { - $r = new \ReflectionProperty(AbstractPart::class, 'headers'); - $r->setValue($this, $this->_headers); - unset($this->_headers); - - if (!\is_array($this->_parent)) { - throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); - } - foreach (['body', 'charset', 'subtype', 'disposition', 'name', 'encoding'] as $name) { - if (null !== $this->_parent[$name] && !\is_string($this->_parent[$name])) { - throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); - } - $r = new \ReflectionProperty(TextPart::class, $name); - $r->setValue($this, $this->_parent[$name]); - } - unset($this->_parent); - } -} diff --git a/vendor/symfony/mime/Part/File.php b/vendor/symfony/mime/Part/File.php deleted file mode 100644 index 0d75066e..00000000 --- a/vendor/symfony/mime/Part/File.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\Mime\Part; - -use Symfony\Component\Mime\MimeTypes; - -/** - * @author Fabien Potencier - */ -class File -{ - private static $mimeTypes; - - public function __construct( - private string $path, - private ?string $filename = null, - ) { - } - - public function getPath(): string - { - return $this->path; - } - - public function getContentType(): string - { - $ext = strtolower(pathinfo($this->path, \PATHINFO_EXTENSION)); - self::$mimeTypes ??= new MimeTypes(); - - return self::$mimeTypes->getMimeTypes($ext)[0] ?? 'application/octet-stream'; - } - - public function getSize(): int - { - return filesize($this->path); - } - - public function getFilename(): string - { - return $this->filename ??= basename($this->getPath()); - } -} diff --git a/vendor/symfony/mime/Part/MessagePart.php b/vendor/symfony/mime/Part/MessagePart.php deleted file mode 100644 index 270d57aa..00000000 --- a/vendor/symfony/mime/Part/MessagePart.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime\Part; - -use Symfony\Component\Mime\Message; -use Symfony\Component\Mime\RawMessage; - -/** - * @final - * - * @author Fabien Potencier - */ -class MessagePart extends DataPart -{ - private $message; - - public function __construct(RawMessage $message) - { - if ($message instanceof Message) { - $name = $message->getHeaders()->getHeaderBody('Subject').'.eml'; - } else { - $name = 'email.eml'; - } - parent::__construct('', $name); - - $this->message = $message; - } - - public function getMediaType(): string - { - return 'message'; - } - - public function getMediaSubtype(): string - { - return 'rfc822'; - } - - public function getBody(): string - { - return $this->message->toString(); - } - - public function bodyToString(): string - { - return $this->getBody(); - } - - public function bodyToIterable(): iterable - { - return $this->message->toIterable(); - } - - public function __sleep(): array - { - return ['message']; - } - - public function __wakeup() - { - $this->__construct($this->message); - } -} diff --git a/vendor/symfony/mime/Part/Multipart/AlternativePart.php b/vendor/symfony/mime/Part/Multipart/AlternativePart.php deleted file mode 100644 index fd754234..00000000 --- a/vendor/symfony/mime/Part/Multipart/AlternativePart.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\Mime\Part\Multipart; - -use Symfony\Component\Mime\Part\AbstractMultipartPart; - -/** - * @author Fabien Potencier - */ -final class AlternativePart extends AbstractMultipartPart -{ - public function getMediaSubtype(): string - { - return 'alternative'; - } -} diff --git a/vendor/symfony/mime/Part/Multipart/DigestPart.php b/vendor/symfony/mime/Part/Multipart/DigestPart.php deleted file mode 100644 index 27537f15..00000000 --- a/vendor/symfony/mime/Part/Multipart/DigestPart.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. - */ - -namespace Symfony\Component\Mime\Part\Multipart; - -use Symfony\Component\Mime\Part\AbstractMultipartPart; -use Symfony\Component\Mime\Part\MessagePart; - -/** - * @author Fabien Potencier - */ -final class DigestPart extends AbstractMultipartPart -{ - public function __construct(MessagePart ...$parts) - { - parent::__construct(...$parts); - } - - public function getMediaSubtype(): string - { - return 'digest'; - } -} diff --git a/vendor/symfony/mime/Part/Multipart/FormDataPart.php b/vendor/symfony/mime/Part/Multipart/FormDataPart.php deleted file mode 100644 index 54a7c76a..00000000 --- a/vendor/symfony/mime/Part/Multipart/FormDataPart.php +++ /dev/null @@ -1,109 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime\Part\Multipart; - -use Symfony\Component\Mime\Exception\InvalidArgumentException; -use Symfony\Component\Mime\Part\AbstractMultipartPart; -use Symfony\Component\Mime\Part\DataPart; -use Symfony\Component\Mime\Part\TextPart; - -/** - * Implements RFC 7578. - * - * @author Fabien Potencier - */ -final class FormDataPart extends AbstractMultipartPart -{ - private $fields = []; - - /** - * @param array $fields - */ - public function __construct(array $fields = []) - { - parent::__construct(); - - foreach ($fields as $name => $value) { - if (!\is_string($value) && !\is_array($value) && !$value instanceof TextPart) { - throw new InvalidArgumentException(sprintf('The value of the form field "%s" can only be a string, an array, or an instance of TextPart ("%s" given).', $name, get_debug_type($value))); - } - - $this->fields[$name] = $value; - } - // HTTP does not support \r\n in header values - $this->getHeaders()->setMaxLineLength(\PHP_INT_MAX); - } - - public function getMediaSubtype(): string - { - return 'form-data'; - } - - public function getParts(): array - { - return $this->prepareFields($this->fields); - } - - private function prepareFields(array $fields): array - { - $values = []; - - $prepare = function ($item, $key, $root = null) use (&$values, &$prepare) { - if (\is_int($key) && \is_array($item)) { - if (1 !== \count($item)) { - throw new InvalidArgumentException(sprintf('Form field values with integer keys can only have one array element, the key being the field name and the value being the field value, %d provided.', \count($item))); - } - - $key = key($item); - $item = $item[$key]; - } - - $fieldName = null !== $root ? sprintf('%s[%s]', $root, $key) : $key; - - if (\is_array($item)) { - array_walk($item, $prepare, $fieldName); - - return; - } - - $values[] = $this->preparePart($fieldName, $item); - }; - - array_walk($fields, $prepare); - - return $values; - } - - private function preparePart(string $name, string|TextPart $value): TextPart - { - if (\is_string($value)) { - return $this->configurePart($name, new TextPart($value, 'utf-8', 'plain', '8bit')); - } - - return $this->configurePart($name, $value); - } - - private function configurePart(string $name, TextPart $part): TextPart - { - static $r; - - $r ??= new \ReflectionProperty(TextPart::class, 'encoding'); - - $part->setDisposition('form-data'); - $part->setName($name); - // HTTP does not support \r\n in header values - $part->getHeaders()->setMaxLineLength(\PHP_INT_MAX); - $r->setValue($part, '8bit'); - - return $part; - } -} diff --git a/vendor/symfony/mime/Part/Multipart/MixedPart.php b/vendor/symfony/mime/Part/Multipart/MixedPart.php deleted file mode 100644 index c8d7028c..00000000 --- a/vendor/symfony/mime/Part/Multipart/MixedPart.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\Mime\Part\Multipart; - -use Symfony\Component\Mime\Part\AbstractMultipartPart; - -/** - * @author Fabien Potencier - */ -final class MixedPart extends AbstractMultipartPart -{ - public function getMediaSubtype(): string - { - return 'mixed'; - } -} diff --git a/vendor/symfony/mime/Part/Multipart/RelatedPart.php b/vendor/symfony/mime/Part/Multipart/RelatedPart.php deleted file mode 100644 index 08fdd5fa..00000000 --- a/vendor/symfony/mime/Part/Multipart/RelatedPart.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime\Part\Multipart; - -use Symfony\Component\Mime\Part\AbstractMultipartPart; -use Symfony\Component\Mime\Part\AbstractPart; - -/** - * @author Fabien Potencier - */ -final class RelatedPart extends AbstractMultipartPart -{ - private $mainPart; - - public function __construct(AbstractPart $mainPart, AbstractPart $part, AbstractPart ...$parts) - { - $this->mainPart = $mainPart; - $this->prepareParts($part, ...$parts); - - parent::__construct($part, ...$parts); - } - - public function getParts(): array - { - return array_merge([$this->mainPart], parent::getParts()); - } - - public function getMediaSubtype(): string - { - return 'related'; - } - - private function generateContentId(): string - { - return bin2hex(random_bytes(16)).'@symfony'; - } - - private function prepareParts(AbstractPart ...$parts): void - { - foreach ($parts as $part) { - if (!$part->getHeaders()->has('Content-ID')) { - $part->getHeaders()->setHeaderBody('Id', 'Content-ID', $this->generateContentId()); - } - } - } -} diff --git a/vendor/symfony/mime/Part/SMimePart.php b/vendor/symfony/mime/Part/SMimePart.php deleted file mode 100644 index 7021819f..00000000 --- a/vendor/symfony/mime/Part/SMimePart.php +++ /dev/null @@ -1,113 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime\Part; - -use Symfony\Component\Mime\Header\Headers; - -/** - * @author Sebastiaan Stok - */ -class SMimePart extends AbstractPart -{ - /** @internal */ - protected $_headers; - - private $body; - private $type; - private $subtype; - private $parameters; - - public function __construct(iterable|string $body, string $type, string $subtype, array $parameters) - { - unset($this->_headers); - - parent::__construct(); - - $this->body = $body; - $this->type = $type; - $this->subtype = $subtype; - $this->parameters = $parameters; - } - - public function getMediaType(): string - { - return $this->type; - } - - public function getMediaSubtype(): string - { - return $this->subtype; - } - - public function bodyToString(): string - { - if (\is_string($this->body)) { - return $this->body; - } - - $body = ''; - foreach ($this->body as $chunk) { - $body .= $chunk; - } - $this->body = $body; - - return $body; - } - - public function bodyToIterable(): iterable - { - if (\is_string($this->body)) { - yield $this->body; - - return; - } - - $body = ''; - foreach ($this->body as $chunk) { - $body .= $chunk; - yield $chunk; - } - $this->body = $body; - } - - public function getPreparedHeaders(): Headers - { - $headers = clone parent::getHeaders(); - - $headers->setHeaderBody('Parameterized', 'Content-Type', $this->getMediaType().'/'.$this->getMediaSubtype()); - - foreach ($this->parameters as $name => $value) { - $headers->setHeaderParameter('Content-Type', $name, $value); - } - - return $headers; - } - - public function __sleep(): array - { - // convert iterables to strings for serialization - if (is_iterable($this->body)) { - $this->body = $this->bodyToString(); - } - - $this->_headers = $this->getHeaders(); - - return ['_headers', 'body', 'type', 'subtype', 'parameters']; - } - - public function __wakeup(): void - { - $r = new \ReflectionProperty(AbstractPart::class, 'headers'); - $r->setValue($this, $this->_headers); - unset($this->_headers); - } -} diff --git a/vendor/symfony/mime/Part/TextPart.php b/vendor/symfony/mime/Part/TextPart.php deleted file mode 100644 index bddca0a2..00000000 --- a/vendor/symfony/mime/Part/TextPart.php +++ /dev/null @@ -1,237 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime\Part; - -use Symfony\Component\Mime\Encoder\Base64ContentEncoder; -use Symfony\Component\Mime\Encoder\ContentEncoderInterface; -use Symfony\Component\Mime\Encoder\EightBitContentEncoder; -use Symfony\Component\Mime\Encoder\QpContentEncoder; -use Symfony\Component\Mime\Exception\InvalidArgumentException; -use Symfony\Component\Mime\Header\Headers; - -/** - * @author Fabien Potencier - */ -class TextPart extends AbstractPart -{ - /** @internal */ - protected $_headers; - - private static $encoders = []; - - private $body; - private $charset; - private $subtype; - /** - * @var ?string - */ - private $disposition; - private $name; - private $encoding; - private $seekable; - - /** - * @param resource|string|File $body Use a File instance to defer loading the file until rendering - */ - public function __construct($body, ?string $charset = 'utf-8', string $subtype = 'plain', string $encoding = null) - { - unset($this->_headers); - - parent::__construct(); - - if (!\is_string($body) && !\is_resource($body) && !$body instanceof File) { - throw new \TypeError(sprintf('The body of "%s" must be a string, a resource, or an instance of "%s" (got "%s").', self::class, File::class, get_debug_type($body))); - } - - if ($body instanceof File) { - $path = $body->getPath(); - if ((is_file($path) && !is_readable($path)) || is_dir($path)) { - throw new InvalidArgumentException(sprintf('Path "%s" is not readable.', $path)); - } - } - - $this->body = $body; - $this->charset = $charset; - $this->subtype = $subtype; - $this->seekable = \is_resource($body) ? stream_get_meta_data($body)['seekable'] && 0 === fseek($body, 0, \SEEK_CUR) : null; - - if (null === $encoding) { - $this->encoding = $this->chooseEncoding(); - } else { - if ('quoted-printable' !== $encoding && 'base64' !== $encoding && '8bit' !== $encoding) { - throw new InvalidArgumentException(sprintf('The encoding must be one of "quoted-printable", "base64", or "8bit" ("%s" given).', $encoding)); - } - $this->encoding = $encoding; - } - } - - public function getMediaType(): string - { - return 'text'; - } - - public function getMediaSubtype(): string - { - return $this->subtype; - } - - /** - * @param string $disposition one of attachment, inline, or form-data - * - * @return $this - */ - public function setDisposition(string $disposition): static - { - $this->disposition = $disposition; - - return $this; - } - - /** - * Sets the name of the file (used by FormDataPart). - * - * @return $this - */ - public function setName(string $name): static - { - $this->name = $name; - - return $this; - } - - /** - * Gets the name of the file. - */ - public function getName(): ?string - { - return $this->name; - } - - public function getBody(): string - { - if ($this->body instanceof File) { - return file_get_contents($this->body->getPath()); - } - - if (null === $this->seekable) { - return $this->body; - } - - if ($this->seekable) { - rewind($this->body); - } - - return stream_get_contents($this->body) ?: ''; - } - - public function bodyToString(): string - { - return $this->getEncoder()->encodeString($this->getBody(), $this->charset); - } - - public function bodyToIterable(): iterable - { - if ($this->body instanceof File) { - $path = $this->body->getPath(); - if (false === $handle = @fopen($path, 'r', false)) { - throw new InvalidArgumentException(sprintf('Unable to open path "%s".', $path)); - } - - yield from $this->getEncoder()->encodeByteStream($handle); - } elseif (null !== $this->seekable) { - if ($this->seekable) { - rewind($this->body); - } - yield from $this->getEncoder()->encodeByteStream($this->body); - } else { - yield $this->getEncoder()->encodeString($this->body); - } - } - - public function getPreparedHeaders(): Headers - { - $headers = parent::getPreparedHeaders(); - - $headers->setHeaderBody('Parameterized', 'Content-Type', $this->getMediaType().'/'.$this->getMediaSubtype()); - if ($this->charset) { - $headers->setHeaderParameter('Content-Type', 'charset', $this->charset); - } - if ($this->name && 'form-data' !== $this->disposition) { - $headers->setHeaderParameter('Content-Type', 'name', $this->name); - } - $headers->setHeaderBody('Text', 'Content-Transfer-Encoding', $this->encoding); - - if (!$headers->has('Content-Disposition') && null !== $this->disposition) { - $headers->setHeaderBody('Parameterized', 'Content-Disposition', $this->disposition); - if ($this->name) { - $headers->setHeaderParameter('Content-Disposition', 'name', $this->name); - } - } - - return $headers; - } - - public function asDebugString(): string - { - $str = parent::asDebugString(); - if (null !== $this->charset) { - $str .= ' charset: '.$this->charset; - } - if (null !== $this->disposition) { - $str .= ' disposition: '.$this->disposition; - } - - return $str; - } - - private function getEncoder(): ContentEncoderInterface - { - if ('8bit' === $this->encoding) { - return self::$encoders[$this->encoding] ??= new EightBitContentEncoder(); - } - - if ('quoted-printable' === $this->encoding) { - return self::$encoders[$this->encoding] ??= new QpContentEncoder(); - } - - return self::$encoders[$this->encoding] ??= new Base64ContentEncoder(); - } - - private function chooseEncoding(): string - { - if (null === $this->charset) { - return 'base64'; - } - - return 'quoted-printable'; - } - - public function __sleep(): array - { - // convert resources to strings for serialization - if (null !== $this->seekable || $this->body instanceof File) { - $this->body = $this->getBody(); - $this->seekable = null; - } - - $this->_headers = $this->getHeaders(); - - return ['_headers', 'body', 'charset', 'subtype', 'disposition', 'name', 'encoding']; - } - - public function __wakeup() - { - $r = new \ReflectionProperty(AbstractPart::class, 'headers'); - $r->setValue($this, $this->_headers); - unset($this->_headers); - } -} diff --git a/vendor/symfony/mime/README.md b/vendor/symfony/mime/README.md deleted file mode 100644 index 8e4d5c77..00000000 --- a/vendor/symfony/mime/README.md +++ /dev/null @@ -1,13 +0,0 @@ -MIME Component -============== - -The MIME component allows manipulating MIME messages. - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/components/mime.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/mime/RawMessage.php b/vendor/symfony/mime/RawMessage.php deleted file mode 100644 index ed051aab..00000000 --- a/vendor/symfony/mime/RawMessage.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime; - -use Symfony\Component\Mime\Exception\LogicException; - -/** - * @author Fabien Potencier - */ -class RawMessage -{ - private $message; - - public function __construct(iterable|string $message) - { - $this->message = $message; - } - - public function toString(): string - { - if (\is_string($this->message)) { - return $this->message; - } - if ($this->message instanceof \Traversable) { - $this->message = iterator_to_array($this->message, false); - } - - return $this->message = implode('', $this->message); - } - - public function toIterable(): iterable - { - if (\is_string($this->message)) { - yield $this->message; - - return; - } - - $message = ''; - foreach ($this->message as $chunk) { - $message .= $chunk; - yield $chunk; - } - $this->message = $message; - } - - /** - * @throws LogicException if the message is not valid - */ - public function ensureValidity() - { - } - - public function __serialize(): array - { - return [$this->toString()]; - } - - public function __unserialize(array $data): void - { - [$this->message] = $data; - } -} diff --git a/vendor/symfony/mime/Resources/bin/update_mime_types.php b/vendor/symfony/mime/Resources/bin/update_mime_types.php deleted file mode 100644 index 5586f097..00000000 --- a/vendor/symfony/mime/Resources/bin/update_mime_types.php +++ /dev/null @@ -1,165 +0,0 @@ - - * - * 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.'); -} - -// load new map -$data = json_decode(file_get_contents('https://cdn.jsdelivr.net/gh/jshttp/mime-db@v1.49.0/db.json'), true); -$new = []; -foreach ($data as $mimeType => $mimeTypeInformation) { - if (!array_key_exists('extensions', $mimeTypeInformation)) { - continue; - } - $new[$mimeType] = $mimeTypeInformation['extensions']; -} - -$xml = simplexml_load_string(file_get_contents('https://gitlab.freedesktop.org/xdg/shared-mime-info/-/raw/master/data/freedesktop.org.xml.in')); -foreach ($xml as $node) { - $exts = []; - foreach ($node->glob as $glob) { - $pattern = (string) $glob['pattern']; - if ('*' != $pattern[0] || '.' != $pattern[1]) { - continue; - } - - $exts[] = substr($pattern, 2); - } - - if (!$exts) { - continue; - } - - $mt = strtolower((string) $node['type']); - $new[$mt] = array_merge($new[$mt] ?? [], $exts); - foreach ($node->alias as $alias) { - $mt = strtolower((string) $alias['type']); - $new[$mt] = array_merge($new[$mt] ?? [], $exts); - } -} - -// load current map -$data = file_get_contents($output = __DIR__.'/../../MimeTypes.php'); -$current = []; -$pre = ''; -$post = ''; -foreach (explode("\n", $data) as $line) { - if (!preg_match("{^ '([^']+/[^']+)' => \['(.+)'\],$}", $line, $matches)) { - if (!$current) { - $pre .= $line."\n"; - } else { - $post .= $line."\n"; - } - continue; - } - $current[$matches[1]] = explode("', '", $matches[2]); -} - -$data = $pre; - -// reverse map -// we prefill the extensions with some preferences for content-types -$exts = [ - 'asice' => ['application/vnd.etsi.asic-e+zip'], - 'bz2' => ['application/x-bz2'], - 'csv' => ['text/csv'], - 'ecma' => ['application/ecmascript'], - 'flv' => ['video/x-flv'], - 'gif' => ['image/gif'], - 'gz' => ['application/x-gzip'], - 'htm' => ['text/html'], - 'html' => ['text/html'], - 'jar' => ['application/x-java-archive'], - 'jpg' => ['image/jpeg'], - 'js' => ['text/javascript'], - 'keynote' => ['application/vnd.apple.keynote'], - 'key' => ['application/vnd.apple.keynote'], - 'm3u' => ['audio/x-mpegurl'], - 'm4a' => ['audio/mp4'], - 'md' => ['text/markdown', 'text/x-markdown'], - 'mdb' => ['application/x-msaccess'], - 'mid' => ['audio/midi'], - 'mov' => ['video/quicktime'], - 'mp3' => ['audio/mpeg'], - 'ogg' => ['audio/ogg'], - 'pdf' => ['application/pdf'], - 'php' => ['application/x-php'], - 'ppt' => ['application/vnd.ms-powerpoint'], - 'rar' => ['application/x-rar-compressed'], - 'hqx' => ['application/stuffit'], - 'sit' => ['application/x-stuffit', 'application/stuffit'], - 'svg' => ['image/svg+xml'], - 'tar' => ['application/x-tar'], - 'tif' => ['image/tiff'], - 'ttf' => ['application/x-font-truetype'], - 'vcf' => ['text/x-vcard'], - 'wav' => ['audio/wav'], - 'wma' => ['audio/x-ms-wma'], - 'wmv' => ['audio/x-ms-wmv'], - 'xls' => ['application/vnd.ms-excel'], - 'zip' => ['application/zip'], -]; - -// we merge the 2 maps (we never remove old mime types) -$map = array_replace_recursive($current, $new); - -foreach ($exts as $ext => $types) { - foreach ($types as $mt) { - if (!isset($map[$mt])) { - $map += [$mt => [$ext]]; - } - } -} -ksort($map); - -foreach ($map as $mimeType => $extensions) { - foreach ($exts as $ext => $types) { - if (in_array($mimeType, $types, true)) { - array_unshift($extensions, $ext); - } - } - $data .= sprintf(" '%s' => ['%s'],\n", $mimeType, implode("', '", array_unique($extensions))); -} -$data .= $post; - -foreach ($map as $mimeType => $extensions) { - foreach ($extensions as $extension) { - if ('application/octet-stream' === $mimeType && 'bin' !== $extension) { - continue; - } - - $exts[$extension][] = $mimeType; - } -} -ksort($exts); - -$updated = ''; -$state = 0; -foreach (explode("\n", $data) as $line) { - if (!preg_match("{^ '([^'/]+)' => \['(.+)'\],$}", $line, $matches)) { - if (1 === $state) { - $state = 2; - foreach ($exts as $ext => $mimeTypes) { - $updated .= sprintf(" '%s' => ['%s'],\n", $ext, implode("', '", array_unique($mimeTypes))); - } - } - $updated .= $line."\n"; - continue; - } - $state = 1; -} - -$updated = preg_replace('{Updated from upstream on .+?\.}', 'Updated from upstream on '.date('Y-m-d'), $updated, -1); - -file_put_contents($output, rtrim($updated, "\n")."\n"); - -echo "Done.\n"; diff --git a/vendor/symfony/mime/Test/Constraint/EmailAddressContains.php b/vendor/symfony/mime/Test/Constraint/EmailAddressContains.php deleted file mode 100644 index 6ca9cc05..00000000 --- a/vendor/symfony/mime/Test/Constraint/EmailAddressContains.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\Mime\Test\Constraint; - -use PHPUnit\Framework\Constraint\Constraint; -use Symfony\Component\Mime\Header\MailboxHeader; -use Symfony\Component\Mime\Header\MailboxListHeader; -use Symfony\Component\Mime\RawMessage; - -final class EmailAddressContains extends Constraint -{ - private string $headerName; - private string $expectedValue; - - public function __construct(string $headerName, string $expectedValue) - { - $this->headerName = $headerName; - $this->expectedValue = $expectedValue; - } - - public function toString(): string - { - return sprintf('contains address "%s" with value "%s"', $this->headerName, $this->expectedValue); - } - - /** - * @param RawMessage $message - */ - protected function matches($message): bool - { - if (RawMessage::class === $message::class) { - throw new \LogicException('Unable to test a message address on a RawMessage instance.'); - } - - $header = $message->getHeaders()->get($this->headerName); - if ($header instanceof MailboxHeader) { - return $this->expectedValue === $header->getAddress()->getAddress(); - } elseif ($header instanceof MailboxListHeader) { - foreach ($header->getAddresses() as $address) { - if ($this->expectedValue === $address->getAddress()) { - return true; - } - } - - return false; - } - - throw new \LogicException('Unable to test a message address on a non-address header.'); - } - - /** - * @param RawMessage $message - */ - protected function failureDescription($message): string - { - return sprintf('the Email %s (value is %s)', $this->toString(), $message->getHeaders()->get($this->headerName)->getBodyAsString()); - } -} diff --git a/vendor/symfony/mime/Test/Constraint/EmailAttachmentCount.php b/vendor/symfony/mime/Test/Constraint/EmailAttachmentCount.php deleted file mode 100644 index d5c8ae98..00000000 --- a/vendor/symfony/mime/Test/Constraint/EmailAttachmentCount.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\Mime\Test\Constraint; - -use PHPUnit\Framework\Constraint\Constraint; -use Symfony\Component\Mime\Message; -use Symfony\Component\Mime\RawMessage; - -final class EmailAttachmentCount extends Constraint -{ - private int $expectedValue; - private ?string $transport; - - public function __construct(int $expectedValue, string $transport = null) - { - $this->expectedValue = $expectedValue; - $this->transport = $transport; - } - - public function toString(): string - { - return sprintf('has sent "%d" attachment(s)', $this->expectedValue); - } - - /** - * @param RawMessage $message - */ - protected function matches($message): bool - { - if (RawMessage::class === $message::class || Message::class === $message::class) { - throw new \LogicException('Unable to test a message attachment on a RawMessage or Message instance.'); - } - - return $this->expectedValue === \count($message->getAttachments()); - } - - /** - * @param RawMessage $message - */ - protected function failureDescription($message): string - { - return 'the Email '.$this->toString(); - } -} diff --git a/vendor/symfony/mime/Test/Constraint/EmailHasHeader.php b/vendor/symfony/mime/Test/Constraint/EmailHasHeader.php deleted file mode 100644 index b7c5625b..00000000 --- a/vendor/symfony/mime/Test/Constraint/EmailHasHeader.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Mime\Test\Constraint; - -use PHPUnit\Framework\Constraint\Constraint; -use Symfony\Component\Mime\RawMessage; - -final class EmailHasHeader extends Constraint -{ - private string $headerName; - - public function __construct(string $headerName) - { - $this->headerName = $headerName; - } - - public function toString(): string - { - return sprintf('has header "%s"', $this->headerName); - } - - /** - * @param RawMessage $message - */ - protected function matches($message): bool - { - if (RawMessage::class === $message::class) { - throw new \LogicException('Unable to test a message header on a RawMessage instance.'); - } - - return $message->getHeaders()->has($this->headerName); - } - - /** - * @param RawMessage $message - */ - protected function failureDescription($message): string - { - return 'the Email '.$this->toString(); - } -} diff --git a/vendor/symfony/mime/Test/Constraint/EmailHeaderSame.php b/vendor/symfony/mime/Test/Constraint/EmailHeaderSame.php deleted file mode 100644 index edb6ab42..00000000 --- a/vendor/symfony/mime/Test/Constraint/EmailHeaderSame.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\Mime\Test\Constraint; - -use PHPUnit\Framework\Constraint\Constraint; -use Symfony\Component\Mime\Header\UnstructuredHeader; -use Symfony\Component\Mime\RawMessage; - -final class EmailHeaderSame extends Constraint -{ - private string $headerName; - private string $expectedValue; - - public function __construct(string $headerName, string $expectedValue) - { - $this->headerName = $headerName; - $this->expectedValue = $expectedValue; - } - - public function toString(): string - { - return sprintf('has header "%s" with value "%s"', $this->headerName, $this->expectedValue); - } - - /** - * @param RawMessage $message - */ - protected function matches($message): bool - { - if (RawMessage::class === $message::class) { - throw new \LogicException('Unable to test a message header on a RawMessage instance.'); - } - - return $this->expectedValue === $this->getHeaderValue($message); - } - - /** - * @param RawMessage $message - */ - protected function failureDescription($message): string - { - return sprintf('the Email %s (value is %s)', $this->toString(), $this->getHeaderValue($message) ?? 'null'); - } - - private function getHeaderValue($message): ?string - { - if (null === $header = $message->getHeaders()->get($this->headerName)) { - return null; - } - - return $header instanceof UnstructuredHeader ? $header->getValue() : $header->getBodyAsString(); - } -} diff --git a/vendor/symfony/mime/Test/Constraint/EmailHtmlBodyContains.php b/vendor/symfony/mime/Test/Constraint/EmailHtmlBodyContains.php deleted file mode 100644 index cbf303d1..00000000 --- a/vendor/symfony/mime/Test/Constraint/EmailHtmlBodyContains.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\Mime\Test\Constraint; - -use PHPUnit\Framework\Constraint\Constraint; -use Symfony\Component\Mime\Message; -use Symfony\Component\Mime\RawMessage; - -final class EmailHtmlBodyContains extends Constraint -{ - private string $expectedText; - - public function __construct(string $expectedText) - { - $this->expectedText = $expectedText; - } - - public function toString(): string - { - return sprintf('contains "%s"', $this->expectedText); - } - - /** - * @param RawMessage $message - */ - protected function matches($message): bool - { - if (RawMessage::class === $message::class || Message::class === $message::class) { - throw new \LogicException('Unable to test a message HTML body on a RawMessage or Message instance.'); - } - - return str_contains($message->getHtmlBody(), $this->expectedText); - } - - /** - * @param RawMessage $message - */ - protected function failureDescription($message): string - { - return 'the Email HTML body '.$this->toString(); - } -} diff --git a/vendor/symfony/mime/Test/Constraint/EmailTextBodyContains.php b/vendor/symfony/mime/Test/Constraint/EmailTextBodyContains.php deleted file mode 100644 index 592595cf..00000000 --- a/vendor/symfony/mime/Test/Constraint/EmailTextBodyContains.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\Mime\Test\Constraint; - -use PHPUnit\Framework\Constraint\Constraint; -use Symfony\Component\Mime\Message; -use Symfony\Component\Mime\RawMessage; - -final class EmailTextBodyContains extends Constraint -{ - private string $expectedText; - - public function __construct(string $expectedText) - { - $this->expectedText = $expectedText; - } - - public function toString(): string - { - return sprintf('contains "%s"', $this->expectedText); - } - - /** - * @param RawMessage $message - */ - protected function matches($message): bool - { - if (RawMessage::class === $message::class || Message::class === $message::class) { - throw new \LogicException('Unable to test a message text body on a RawMessage or Message instance.'); - } - - return str_contains($message->getTextBody(), $this->expectedText); - } - - /** - * @param RawMessage $message - */ - protected function failureDescription($message): string - { - return 'the Email text body '.$this->toString(); - } -} diff --git a/vendor/symfony/mime/composer.json b/vendor/symfony/mime/composer.json deleted file mode 100644 index 7c6719f3..00000000 --- a/vendor/symfony/mime/composer.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "symfony/mime", - "type": "library", - "description": "Allows manipulating MIME messages", - "keywords": ["mime", "mime-type"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.1", - "symfony/polyfill-intl-idn": "^1.10", - "symfony/polyfill-mbstring": "^1.0" - }, - "require-dev": { - "egulias/email-validator": "^2.1.10|^3.1", - "league/html-to-markdown": "^5.0", - "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/property-access": "^5.4|^6.0", - "symfony/property-info": "^5.4|^6.0", - "symfony/serializer": "^6.2" - }, - "conflict": { - "egulias/email-validator": "~3.0.0", - "phpdocumentor/reflection-docblock": "<3.2.2", - "phpdocumentor/type-resolver": "<1.4.0", - "symfony/mailer": "<5.4", - "symfony/serializer": "<6.2" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\Mime\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "minimum-stability": "dev" -} diff --git a/vendor/symfony/polyfill-ctype/Ctype.php b/vendor/symfony/polyfill-ctype/Ctype.php deleted file mode 100644 index ba75a2c9..00000000 --- a/vendor/symfony/polyfill-ctype/Ctype.php +++ /dev/null @@ -1,232 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Ctype; - -/** - * Ctype implementation through regex. - * - * @internal - * - * @author Gert de Pagter - */ -final class Ctype -{ - /** - * Returns TRUE if every character in text is either a letter or a digit, FALSE otherwise. - * - * @see https://php.net/ctype-alnum - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_alnum($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z0-9]/', $text); - } - - /** - * Returns TRUE if every character in text is a letter, FALSE otherwise. - * - * @see https://php.net/ctype-alpha - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_alpha($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z]/', $text); - } - - /** - * Returns TRUE if every character in text is a control character from the current locale, FALSE otherwise. - * - * @see https://php.net/ctype-cntrl - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_cntrl($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^\x00-\x1f\x7f]/', $text); - } - - /** - * Returns TRUE if every character in the string text is a decimal digit, FALSE otherwise. - * - * @see https://php.net/ctype-digit - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_digit($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^0-9]/', $text); - } - - /** - * Returns TRUE if every character in text is printable and actually creates visible output (no white space), FALSE otherwise. - * - * @see https://php.net/ctype-graph - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_graph($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^!-~]/', $text); - } - - /** - * Returns TRUE if every character in text is a lowercase letter. - * - * @see https://php.net/ctype-lower - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_lower($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^a-z]/', $text); - } - - /** - * Returns TRUE if every character in text will actually create output (including blanks). Returns FALSE if text contains control characters or characters that do not have any output or control function at all. - * - * @see https://php.net/ctype-print - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_print($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^ -~]/', $text); - } - - /** - * Returns TRUE if every character in text is printable, but neither letter, digit or blank, FALSE otherwise. - * - * @see https://php.net/ctype-punct - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_punct($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^!-\/\:-@\[-`\{-~]/', $text); - } - - /** - * Returns TRUE if every character in text creates some sort of white space, FALSE otherwise. Besides the blank character this also includes tab, vertical tab, line feed, carriage return and form feed characters. - * - * @see https://php.net/ctype-space - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_space($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^\s]/', $text); - } - - /** - * Returns TRUE if every character in text is an uppercase letter. - * - * @see https://php.net/ctype-upper - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_upper($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^A-Z]/', $text); - } - - /** - * Returns TRUE if every character in text is a hexadecimal 'digit', that is a decimal digit or a character from [A-Fa-f] , FALSE otherwise. - * - * @see https://php.net/ctype-xdigit - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_xdigit($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^A-Fa-f0-9]/', $text); - } - - /** - * Converts integers to their char versions according to normal ctype behaviour, if needed. - * - * If an integer between -128 and 255 inclusive is provided, - * it is interpreted as the ASCII value of a single character - * (negative values have 256 added in order to allow characters in the Extended ASCII range). - * Any other integer is interpreted as a string containing the decimal digits of the integer. - * - * @param mixed $int - * @param string $function - * - * @return mixed - */ - private static function convert_int_to_char_for_ctype($int, $function) - { - if (!\is_int($int)) { - return $int; - } - - if ($int < -128 || $int > 255) { - return (string) $int; - } - - if (\PHP_VERSION_ID >= 80100) { - @trigger_error($function.'(): Argument of type int will be interpreted as string in the future', \E_USER_DEPRECATED); - } - - if ($int < 0) { - $int += 256; - } - - return \chr($int); - } -} diff --git a/vendor/symfony/polyfill-ctype/LICENSE b/vendor/symfony/polyfill-ctype/LICENSE deleted file mode 100644 index 3f853aaf..00000000 --- a/vendor/symfony/polyfill-ctype/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2018-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-ctype/README.md b/vendor/symfony/polyfill-ctype/README.md deleted file mode 100644 index b144d03c..00000000 --- a/vendor/symfony/polyfill-ctype/README.md +++ /dev/null @@ -1,12 +0,0 @@ -Symfony Polyfill / Ctype -======================== - -This component provides `ctype_*` functions to users who run php versions without the ctype 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-ctype/bootstrap.php b/vendor/symfony/polyfill-ctype/bootstrap.php deleted file mode 100644 index d54524b3..00000000 --- a/vendor/symfony/polyfill-ctype/bootstrap.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Ctype as p; - -if (\PHP_VERSION_ID >= 80000) { - return require __DIR__.'/bootstrap80.php'; -} - -if (!function_exists('ctype_alnum')) { - function ctype_alnum($text) { return p\Ctype::ctype_alnum($text); } -} -if (!function_exists('ctype_alpha')) { - function ctype_alpha($text) { return p\Ctype::ctype_alpha($text); } -} -if (!function_exists('ctype_cntrl')) { - function ctype_cntrl($text) { return p\Ctype::ctype_cntrl($text); } -} -if (!function_exists('ctype_digit')) { - function ctype_digit($text) { return p\Ctype::ctype_digit($text); } -} -if (!function_exists('ctype_graph')) { - function ctype_graph($text) { return p\Ctype::ctype_graph($text); } -} -if (!function_exists('ctype_lower')) { - function ctype_lower($text) { return p\Ctype::ctype_lower($text); } -} -if (!function_exists('ctype_print')) { - function ctype_print($text) { return p\Ctype::ctype_print($text); } -} -if (!function_exists('ctype_punct')) { - function ctype_punct($text) { return p\Ctype::ctype_punct($text); } -} -if (!function_exists('ctype_space')) { - function ctype_space($text) { return p\Ctype::ctype_space($text); } -} -if (!function_exists('ctype_upper')) { - function ctype_upper($text) { return p\Ctype::ctype_upper($text); } -} -if (!function_exists('ctype_xdigit')) { - function ctype_xdigit($text) { return p\Ctype::ctype_xdigit($text); } -} diff --git a/vendor/symfony/polyfill-ctype/bootstrap80.php b/vendor/symfony/polyfill-ctype/bootstrap80.php deleted file mode 100644 index ab2f8611..00000000 --- a/vendor/symfony/polyfill-ctype/bootstrap80.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Ctype as p; - -if (!function_exists('ctype_alnum')) { - function ctype_alnum(mixed $text): bool { return p\Ctype::ctype_alnum($text); } -} -if (!function_exists('ctype_alpha')) { - function ctype_alpha(mixed $text): bool { return p\Ctype::ctype_alpha($text); } -} -if (!function_exists('ctype_cntrl')) { - function ctype_cntrl(mixed $text): bool { return p\Ctype::ctype_cntrl($text); } -} -if (!function_exists('ctype_digit')) { - function ctype_digit(mixed $text): bool { return p\Ctype::ctype_digit($text); } -} -if (!function_exists('ctype_graph')) { - function ctype_graph(mixed $text): bool { return p\Ctype::ctype_graph($text); } -} -if (!function_exists('ctype_lower')) { - function ctype_lower(mixed $text): bool { return p\Ctype::ctype_lower($text); } -} -if (!function_exists('ctype_print')) { - function ctype_print(mixed $text): bool { return p\Ctype::ctype_print($text); } -} -if (!function_exists('ctype_punct')) { - function ctype_punct(mixed $text): bool { return p\Ctype::ctype_punct($text); } -} -if (!function_exists('ctype_space')) { - function ctype_space(mixed $text): bool { return p\Ctype::ctype_space($text); } -} -if (!function_exists('ctype_upper')) { - function ctype_upper(mixed $text): bool { return p\Ctype::ctype_upper($text); } -} -if (!function_exists('ctype_xdigit')) { - function ctype_xdigit(mixed $text): bool { return p\Ctype::ctype_xdigit($text); } -} diff --git a/vendor/symfony/polyfill-ctype/composer.json b/vendor/symfony/polyfill-ctype/composer.json deleted file mode 100644 index 1b3efff5..00000000 --- a/vendor/symfony/polyfill-ctype/composer.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "symfony/polyfill-ctype", - "type": "library", - "description": "Symfony polyfill for ctype functions", - "keywords": ["polyfill", "compatibility", "portable", "ctype"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-ctype": "*" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Ctype\\": "" }, - "files": [ "bootstrap.php" ] - }, - "suggest": { - "ext-ctype": "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-iconv/Iconv.php b/vendor/symfony/polyfill-iconv/Iconv.php deleted file mode 100644 index c17a70dc..00000000 --- a/vendor/symfony/polyfill-iconv/Iconv.php +++ /dev/null @@ -1,744 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Iconv; - -/** - * iconv implementation in pure PHP, UTF-8 centric. - * - * Implemented: - * - iconv - Convert string to requested character encoding - * - iconv_mime_decode - Decodes a MIME header field - * - iconv_mime_decode_headers - Decodes multiple MIME header fields at once - * - iconv_get_encoding - Retrieve internal configuration variables of iconv extension - * - iconv_set_encoding - Set current setting for character encoding conversion - * - iconv_mime_encode - Composes a MIME header field - * - iconv_strlen - Returns the character count of string - * - iconv_strpos - Finds position of first occurrence of a needle within a haystack - * - iconv_strrpos - Finds the last occurrence of a needle within a haystack - * - iconv_substr - Cut out part of a string - * - * Charsets available for conversion are defined by files - * in the charset/ directory and by Iconv::$alias below. - * You're welcome to send back any addition you make. - * - * @author Nicolas Grekas - * - * @internal - */ -final class Iconv -{ - public const ERROR_ILLEGAL_CHARACTER = 'iconv(): Detected an illegal character in input string'; - public const ERROR_WRONG_CHARSET = 'iconv(): Wrong charset, conversion from `%s\' to `%s\' is not allowed'; - - public static $inputEncoding = 'utf-8'; - public static $outputEncoding = 'utf-8'; - public static $internalEncoding = 'utf-8'; - - private static $alias = [ - 'utf8' => 'utf-8', - 'ascii' => 'us-ascii', - 'tis-620' => 'iso-8859-11', - 'cp1250' => 'windows-1250', - 'cp1251' => 'windows-1251', - 'cp1252' => 'windows-1252', - 'cp1253' => 'windows-1253', - 'cp1254' => 'windows-1254', - 'cp1255' => 'windows-1255', - 'cp1256' => 'windows-1256', - 'cp1257' => 'windows-1257', - 'cp1258' => 'windows-1258', - 'shift-jis' => 'cp932', - 'shift_jis' => 'cp932', - 'latin1' => 'iso-8859-1', - 'latin2' => 'iso-8859-2', - 'latin3' => 'iso-8859-3', - 'latin4' => 'iso-8859-4', - 'latin5' => 'iso-8859-9', - 'latin6' => 'iso-8859-10', - 'latin7' => 'iso-8859-13', - 'latin8' => 'iso-8859-14', - 'latin9' => 'iso-8859-15', - 'latin10' => 'iso-8859-16', - 'iso8859-1' => 'iso-8859-1', - 'iso8859-2' => 'iso-8859-2', - 'iso8859-3' => 'iso-8859-3', - 'iso8859-4' => 'iso-8859-4', - 'iso8859-5' => 'iso-8859-5', - 'iso8859-6' => 'iso-8859-6', - 'iso8859-7' => 'iso-8859-7', - 'iso8859-8' => 'iso-8859-8', - 'iso8859-9' => 'iso-8859-9', - 'iso8859-10' => 'iso-8859-10', - 'iso8859-11' => 'iso-8859-11', - 'iso8859-12' => 'iso-8859-12', - 'iso8859-13' => 'iso-8859-13', - 'iso8859-14' => 'iso-8859-14', - 'iso8859-15' => 'iso-8859-15', - 'iso8859-16' => 'iso-8859-16', - 'iso_8859-1' => 'iso-8859-1', - 'iso_8859-2' => 'iso-8859-2', - 'iso_8859-3' => 'iso-8859-3', - 'iso_8859-4' => 'iso-8859-4', - 'iso_8859-5' => 'iso-8859-5', - 'iso_8859-6' => 'iso-8859-6', - 'iso_8859-7' => 'iso-8859-7', - 'iso_8859-8' => 'iso-8859-8', - 'iso_8859-9' => 'iso-8859-9', - 'iso_8859-10' => 'iso-8859-10', - 'iso_8859-11' => 'iso-8859-11', - 'iso_8859-12' => 'iso-8859-12', - 'iso_8859-13' => 'iso-8859-13', - 'iso_8859-14' => 'iso-8859-14', - 'iso_8859-15' => 'iso-8859-15', - 'iso_8859-16' => 'iso-8859-16', - 'iso88591' => 'iso-8859-1', - 'iso88592' => 'iso-8859-2', - 'iso88593' => 'iso-8859-3', - 'iso88594' => 'iso-8859-4', - 'iso88595' => 'iso-8859-5', - 'iso88596' => 'iso-8859-6', - 'iso88597' => 'iso-8859-7', - 'iso88598' => 'iso-8859-8', - 'iso88599' => 'iso-8859-9', - 'iso885910' => 'iso-8859-10', - 'iso885911' => 'iso-8859-11', - 'iso885912' => 'iso-8859-12', - 'iso885913' => 'iso-8859-13', - 'iso885914' => 'iso-8859-14', - 'iso885915' => 'iso-8859-15', - 'iso885916' => 'iso-8859-16', - ]; - private static $translitMap = []; - private static $convertMap = []; - private static $errorHandler; - private static $lastError; - - private static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; - private static $isValidUtf8; - - public static function iconv($inCharset, $outCharset, $str) - { - $str = (string) $str; - if ('' === $str) { - return ''; - } - - // Prepare for //IGNORE and //TRANSLIT - - $translit = $ignore = ''; - - $outCharset = strtolower($outCharset); - $inCharset = strtolower($inCharset); - - if ('' === $outCharset) { - $outCharset = 'iso-8859-1'; - } - if ('' === $inCharset) { - $inCharset = 'iso-8859-1'; - } - - do { - $loop = false; - - if ('//translit' === substr($outCharset, -10)) { - $loop = $translit = true; - $outCharset = substr($outCharset, 0, -10); - } - - if ('//ignore' === substr($outCharset, -8)) { - $loop = $ignore = true; - $outCharset = substr($outCharset, 0, -8); - } - } while ($loop); - - do { - $loop = false; - - if ('//translit' === substr($inCharset, -10)) { - $loop = true; - $inCharset = substr($inCharset, 0, -10); - } - - if ('//ignore' === substr($inCharset, -8)) { - $loop = true; - $inCharset = substr($inCharset, 0, -8); - } - } while ($loop); - - if (isset(self::$alias[$inCharset])) { - $inCharset = self::$alias[$inCharset]; - } - if (isset(self::$alias[$outCharset])) { - $outCharset = self::$alias[$outCharset]; - } - - // Load charset maps - - if (('utf-8' !== $inCharset && !self::loadMap('from.', $inCharset, $inMap)) - || ('utf-8' !== $outCharset && !self::loadMap('to.', $outCharset, $outMap))) { - trigger_error(sprintf(self::ERROR_WRONG_CHARSET, $inCharset, $outCharset)); - - return false; - } - - if ('utf-8' !== $inCharset) { - // Convert input to UTF-8 - $result = ''; - if (self::mapToUtf8($result, $inMap, $str, $ignore)) { - $str = $result; - } else { - $str = false; - } - self::$isValidUtf8 = true; - } else { - self::$isValidUtf8 = preg_match('//u', $str); - - if (!self::$isValidUtf8 && !$ignore) { - trigger_error(self::ERROR_ILLEGAL_CHARACTER); - - return false; - } - - if ('utf-8' === $outCharset) { - // UTF-8 validation - $str = self::utf8ToUtf8($str, $ignore); - } - } - - if ('utf-8' !== $outCharset && false !== $str) { - // Convert output to UTF-8 - $result = ''; - if (self::mapFromUtf8($result, $outMap, $str, $ignore, $translit)) { - return $result; - } - - return false; - } - - return $str; - } - - public static function iconv_mime_decode_headers($str, $mode = 0, $charset = null) - { - if (null === $charset) { - $charset = self::$internalEncoding; - } - - if (false !== strpos($str, "\r")) { - $str = strtr(str_replace("\r\n", "\n", $str), "\r", "\n"); - } - $str = explode("\n\n", $str, 2); - - $headers = []; - - $str = preg_split('/\n(?![ \t])/', $str[0]); - foreach ($str as $str) { - $str = self::iconv_mime_decode($str, $mode, $charset); - if (false === $str) { - return false; - } - $str = explode(':', $str, 2); - - if (2 === \count($str)) { - if (isset($headers[$str[0]])) { - if (!\is_array($headers[$str[0]])) { - $headers[$str[0]] = [$headers[$str[0]]]; - } - $headers[$str[0]][] = ltrim($str[1]); - } else { - $headers[$str[0]] = ltrim($str[1]); - } - } - } - - return $headers; - } - - public static function iconv_mime_decode($str, $mode = 0, $charset = null) - { - if (null === $charset) { - $charset = self::$internalEncoding; - } - if (\ICONV_MIME_DECODE_CONTINUE_ON_ERROR & $mode) { - $charset .= '//IGNORE'; - } - - if (false !== strpos($str, "\r")) { - $str = strtr(str_replace("\r\n", "\n", $str), "\r", "\n"); - } - $str = preg_split('/\n(?![ \t])/', rtrim($str), 2); - $str = preg_replace('/[ \t]*\n[ \t]+/', ' ', rtrim($str[0])); - $str = preg_split('/=\?([^?]+)\?([bqBQ])\?(.*?)\?=/', $str, -1, \PREG_SPLIT_DELIM_CAPTURE); - - $result = self::iconv('utf-8', $charset, $str[0]); - if (false === $result) { - return false; - } - - $i = 1; - $len = \count($str); - - while ($i < $len) { - $c = strtolower($str[$i]); - if ((\ICONV_MIME_DECODE_CONTINUE_ON_ERROR & $mode) - && 'utf-8' !== $c - && !isset(self::$alias[$c]) - && !self::loadMap('from.', $c, $d)) { - $d = false; - } elseif ('B' === strtoupper($str[$i + 1])) { - $d = base64_decode($str[$i + 2]); - } else { - $d = rawurldecode(strtr(str_replace('%', '%25', $str[$i + 2]), '=_', '% ')); - } - - if (false !== $d) { - if ('' !== $d) { - if ('' === $d = self::iconv($c, $charset, $d)) { - $str[$i + 3] = substr($str[$i + 3], 1); - } else { - $result .= $d; - } - } - $d = self::iconv('utf-8', $charset, $str[$i + 3]); - if ('' !== trim($d)) { - $result .= $d; - } - } elseif (\ICONV_MIME_DECODE_CONTINUE_ON_ERROR & $mode) { - $result .= "=?{$str[$i]}?{$str[$i + 1]}?{$str[$i + 2]}?={$str[$i + 3]}"; - } else { - $result = false; - break; - } - - $i += 4; - } - - return $result; - } - - public static function iconv_get_encoding($type = 'all') - { - switch ($type) { - case 'input_encoding': return self::$inputEncoding; - case 'output_encoding': return self::$outputEncoding; - case 'internal_encoding': return self::$internalEncoding; - } - - return [ - 'input_encoding' => self::$inputEncoding, - 'output_encoding' => self::$outputEncoding, - 'internal_encoding' => self::$internalEncoding, - ]; - } - - public static function iconv_set_encoding($type, $charset) - { - switch ($type) { - case 'input_encoding': self::$inputEncoding = $charset; break; - case 'output_encoding': self::$outputEncoding = $charset; break; - case 'internal_encoding': self::$internalEncoding = $charset; break; - default: return false; - } - - return true; - } - - public static function iconv_mime_encode($fieldName, $fieldValue, $pref = null) - { - if (!\is_array($pref)) { - $pref = []; - } - - $pref += [ - 'scheme' => 'B', - 'input-charset' => self::$internalEncoding, - 'output-charset' => self::$internalEncoding, - 'line-length' => 76, - 'line-break-chars' => "\r\n", - ]; - - if (preg_match('/[\x80-\xFF]/', $fieldName)) { - $fieldName = ''; - } - - $scheme = strtoupper(substr($pref['scheme'], 0, 1)); - $in = strtolower($pref['input-charset']); - $out = strtolower($pref['output-charset']); - - if ('utf-8' !== $in && false === $fieldValue = self::iconv($in, 'utf-8', $fieldValue)) { - return false; - } - - preg_match_all('/./us', $fieldValue, $chars); - - $chars = $chars[0] ?? []; - - $lineBreak = (int) $pref['line-length']; - $lineStart = "=?{$pref['output-charset']}?{$scheme}?"; - $lineLength = \strlen($fieldName) + 2 + \strlen($lineStart) + 2; - $lineOffset = \strlen($lineStart) + 3; - $lineData = ''; - - $fieldValue = []; - - $Q = 'Q' === $scheme; - - foreach ($chars as $c) { - if ('utf-8' !== $out && false === $c = self::iconv('utf-8', $out, $c)) { - return false; - } - - $o = $Q - ? $c = preg_replace_callback( - '/[=_\?\x00-\x1F\x80-\xFF]/', - [__CLASS__, 'qpByteCallback'], - $c - ) - : base64_encode($lineData.$c); - - if (isset($o[$lineBreak - $lineLength])) { - if (!$Q) { - $lineData = base64_encode($lineData); - } - $fieldValue[] = $lineStart.$lineData.'?='; - $lineLength = $lineOffset; - $lineData = ''; - } - - $lineData .= $c; - $Q && $lineLength += \strlen($c); - } - - if ('' !== $lineData) { - if (!$Q) { - $lineData = base64_encode($lineData); - } - $fieldValue[] = $lineStart.$lineData.'?='; - } - - return $fieldName.': '.implode($pref['line-break-chars'].' ', $fieldValue); - } - - public static function iconv_strlen($s, $encoding = null) - { - static $hasXml = null; - if (null === $hasXml) { - $hasXml = \extension_loaded('xml'); - } - - if ($hasXml) { - return self::strlen1($s, $encoding); - } - - return self::strlen2($s, $encoding); - } - - public static function strlen1($s, $encoding = null) - { - if (null === $encoding) { - $encoding = self::$internalEncoding; - } - if (0 !== stripos($encoding, 'utf-8') && false === $s = self::iconv($encoding, 'utf-8', $s)) { - return false; - } - - return \strlen(utf8_decode($s)); - } - - public static function strlen2($s, $encoding = null) - { - if (null === $encoding) { - $encoding = self::$internalEncoding; - } - if (0 !== stripos($encoding, 'utf-8') && false === $s = self::iconv($encoding, 'utf-8', $s)) { - return false; - } - - $ulenMask = self::$ulenMask; - - $i = 0; - $j = 0; - $len = \strlen($s); - - while ($i < $len) { - $u = $s[$i] & "\xF0"; - $i += $ulenMask[$u] ?? 1; - ++$j; - } - - return $j; - } - - public static function iconv_strpos($haystack, $needle, $offset = 0, $encoding = null) - { - if (null === $encoding) { - $encoding = self::$internalEncoding; - } - - if (0 !== stripos($encoding, 'utf-8')) { - if (false === $haystack = self::iconv($encoding, 'utf-8', $haystack)) { - return false; - } - if (false === $needle = self::iconv($encoding, 'utf-8', $needle)) { - return false; - } - } - - if ($offset = (int) $offset) { - $haystack = self::iconv_substr($haystack, $offset, 2147483647, 'utf-8'); - } - $pos = strpos($haystack, $needle); - - return false === $pos ? false : ($offset + ($pos ? self::iconv_strlen(substr($haystack, 0, $pos), 'utf-8') : 0)); - } - - public static function iconv_strrpos($haystack, $needle, $encoding = null) - { - if (null === $encoding) { - $encoding = self::$internalEncoding; - } - - if (0 !== stripos($encoding, 'utf-8')) { - if (false === $haystack = self::iconv($encoding, 'utf-8', $haystack)) { - return false; - } - if (false === $needle = self::iconv($encoding, 'utf-8', $needle)) { - return false; - } - } - - $pos = isset($needle[0]) ? strrpos($haystack, $needle) : false; - - return false === $pos ? false : self::iconv_strlen($pos ? substr($haystack, 0, $pos) : $haystack, 'utf-8'); - } - - public static function iconv_substr($s, $start, $length = 2147483647, $encoding = null) - { - if (null === $encoding) { - $encoding = self::$internalEncoding; - } - if (0 !== stripos($encoding, 'utf-8')) { - $encoding = null; - } elseif (false === $s = self::iconv($encoding, 'utf-8', $s)) { - return false; - } - - $s = (string) $s; - $slen = self::iconv_strlen($s, 'utf-8'); - $start = (int) $start; - - if (0 > $start) { - $start += $slen; - } - if (0 > $start) { - if (\PHP_VERSION_ID < 80000) { - return false; - } - - $start = 0; - } - if ($start >= $slen) { - return \PHP_VERSION_ID >= 80000 ? '' : false; - } - - $rx = $slen - $start; - - if (0 > $length) { - $length += $rx; - } - if (0 === $length) { - return ''; - } - if (0 > $length) { - return \PHP_VERSION_ID >= 80000 ? '' : false; - } - - if ($length > $rx) { - $length = $rx; - } - - $rx = '/^'.($start ? self::pregOffset($start) : '').'('.self::pregOffset($length).')/u'; - - $s = preg_match($rx, $s, $s) ? $s[1] : ''; - - if (null === $encoding) { - return $s; - } - - return self::iconv('utf-8', $encoding, $s); - } - - private static function loadMap($type, $charset, &$map) - { - if (!isset(self::$convertMap[$type.$charset])) { - if (false === $map = self::getData($type.$charset)) { - if ('to.' === $type && self::loadMap('from.', $charset, $map)) { - $map = array_flip($map); - } else { - return false; - } - } - - self::$convertMap[$type.$charset] = $map; - } else { - $map = self::$convertMap[$type.$charset]; - } - - return true; - } - - private static function utf8ToUtf8($str, $ignore) - { - $ulenMask = self::$ulenMask; - $valid = self::$isValidUtf8; - - $u = $str; - $i = $j = 0; - $len = \strlen($str); - - while ($i < $len) { - if ($str[$i] < "\x80") { - $u[$j++] = $str[$i++]; - } else { - $ulen = $str[$i] & "\xF0"; - $ulen = $ulenMask[$ulen] ?? 1; - $uchr = substr($str, $i, $ulen); - - if (1 === $ulen || !($valid || preg_match('/^.$/us', $uchr))) { - if ($ignore) { - ++$i; - continue; - } - - trigger_error(self::ERROR_ILLEGAL_CHARACTER); - - return false; - } - - $i += $ulen; - - $u[$j++] = $uchr[0]; - - isset($uchr[1]) && 0 !== ($u[$j++] = $uchr[1]) - && isset($uchr[2]) && 0 !== ($u[$j++] = $uchr[2]) - && isset($uchr[3]) && 0 !== ($u[$j++] = $uchr[3]); - } - } - - return substr($u, 0, $j); - } - - private static function mapToUtf8(&$result, array $map, $str, $ignore) - { - $len = \strlen($str); - for ($i = 0; $i < $len; ++$i) { - if (isset($str[$i + 1], $map[$str[$i].$str[$i + 1]])) { - $result .= $map[$str[$i].$str[++$i]]; - } elseif (isset($map[$str[$i]])) { - $result .= $map[$str[$i]]; - } elseif (!$ignore) { - trigger_error(self::ERROR_ILLEGAL_CHARACTER); - - return false; - } - } - - return true; - } - - private static function mapFromUtf8(&$result, array $map, $str, $ignore, $translit) - { - $ulenMask = self::$ulenMask; - $valid = self::$isValidUtf8; - - if ($translit && !self::$translitMap) { - self::$translitMap = self::getData('translit'); - } - - $i = 0; - $len = \strlen($str); - - while ($i < $len) { - if ($str[$i] < "\x80") { - $uchr = $str[$i++]; - } else { - $ulen = $str[$i] & "\xF0"; - $ulen = $ulenMask[$ulen] ?? 1; - $uchr = substr($str, $i, $ulen); - - if ($ignore && (1 === $ulen || !($valid || preg_match('/^.$/us', $uchr)))) { - ++$i; - continue; - } - - $i += $ulen; - } - - if (isset($map[$uchr])) { - $result .= $map[$uchr]; - } elseif ($translit) { - if (isset(self::$translitMap[$uchr])) { - $uchr = self::$translitMap[$uchr]; - } elseif ($uchr >= "\xC3\x80") { - $uchr = \Normalizer::normalize($uchr, \Normalizer::NFD); - - if ($uchr[0] < "\x80") { - $uchr = $uchr[0]; - } elseif ($ignore) { - continue; - } else { - return false; - } - } elseif ($ignore) { - continue; - } else { - return false; - } - - $str = $uchr.substr($str, $i); - $len = \strlen($str); - $i = 0; - } elseif (!$ignore) { - return false; - } - } - - return true; - } - - private static function qpByteCallback(array $m) - { - return '='.strtoupper(dechex(\ord($m[0]))); - } - - private static function pregOffset($offset) - { - $rx = []; - $offset = (int) $offset; - - while ($offset > 65535) { - $rx[] = '.{65535}'; - $offset -= 65535; - } - - return implode('', $rx).'.{'.$offset.'}'; - } - - private static function getData($file) - { - if (file_exists($file = __DIR__.'/Resources/charset/'.$file.'.php')) { - return require $file; - } - - return false; - } -} diff --git a/vendor/symfony/polyfill-iconv/LICENSE b/vendor/symfony/polyfill-iconv/LICENSE deleted file mode 100644 index 4cd8bdd3..00000000 --- a/vendor/symfony/polyfill-iconv/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-iconv/README.md b/vendor/symfony/polyfill-iconv/README.md deleted file mode 100644 index b089088b..00000000 --- a/vendor/symfony/polyfill-iconv/README.md +++ /dev/null @@ -1,14 +0,0 @@ -Symfony Polyfill / Iconv -======================== - -This component provides a native PHP implementation of the -[php.net/iconv](https://php.net/iconv) functions -(short of [`ob_iconv_handler`](https://php.net/ob-iconv-handler)). - -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-iconv/Resources/charset/from.big5.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.big5.php deleted file mode 100644 index b1198549..00000000 --- a/vendor/symfony/polyfill-iconv/Resources/charset/from.big5.php +++ /dev/null @@ -1,13719 +0,0 @@ - ' ', - 'A' => ',', - 'B' => '、', - 'C' => '。', - 'D' => '.', - 'E' => '•', - 'F' => ';', - 'G' => ':', - 'H' => '?', - 'I' => '!', - 'J' => '︰', - 'K' => '…', - 'L' => '‥', - 'M' => '﹐', - 'N' => '、', - 'O' => '﹒', - 'P' => '·', - 'Q' => '﹔', - 'R' => '﹕', - 'S' => '﹖', - 'T' => '﹗', - 'U' => '|', - 'V' => '–', - 'W' => '︱', - 'X' => '—', - 'Y' => '︳', - 'Z' => '�', - '[' => '︴', - '\\' => '﹏', - ']' => '(', - '^' => ')', - '_' => '︵', - '`' => '︶', - 'a' => '{', - 'b' => '}', - 'c' => '︷', - 'd' => '︸', - 'e' => '〔', - 'f' => '〕', - 'g' => '︹', - 'h' => '︺', - 'i' => '【', - 'j' => '】', - 'k' => '︻', - 'l' => '︼', - 'm' => '《', - 'n' => '》', - 'o' => '︽', - 'p' => '︾', - 'q' => '〈', - 'r' => '〉', - 's' => '︿', - 't' => '﹀', - 'u' => '「', - 'v' => '」', - 'w' => '﹁', - 'x' => '﹂', - 'y' => '『', - 'z' => '』', - '{' => '﹃', - '|' => '﹄', - '}' => '﹙', - '~' => '﹚', - '' => '﹛', - '' => '﹜', - '' => '﹝', - '' => '﹞', - '' => '‘', - '' => '’', - '' => '“', - '' => '”', - '' => '〝', - '' => '〞', - '' => '‵', - '' => '′', - '' => '#', - '' => '&', - '' => '*', - '' => '※', - '' => '§', - '' => '〃', - '' => '○', - '' => '●', - '' => '△', - '' => '▲', - '' => '◎', - '' => '☆', - '' => '★', - '' => '◇', - '' => '◆', - '' => '□', - '' => '■', - '' => '▽', - '' => '▼', - '' => '㊣', - '' => '℅', - '' => '‾', - '' => '�', - '' => '_', - '' => '�', - '' => '﹉', - '' => '﹊', - '' => '﹍', - '' => '﹎', - '' => '﹋', - '' => '﹌', - '' => '﹟', - '' => '﹠', - '' => '﹡', - '' => '+', - '' => '-', - '' => '×', - '' => '÷', - '' => '±', - '' => '√', - '' => '<', - '' => '>', - '' => '=', - '' => '≦', - '' => '≧', - '' => '≠', - '' => '∞', - '' => '≒', - '' => '≡', - '' => '﹢', - '' => '﹣', - '' => '﹤', - '' => '﹥', - '' => '﹦', - '' => '∼', - '' => '∩', - '' => '∪', - '' => '⊥', - '' => '∠', - '' => '∟', - '' => '⊿', - '' => '㏒', - '' => '㏑', - '' => '∫', - '' => '∮', - '' => '∵', - '' => '∴', - '' => '♀', - '' => '♂', - '' => '♁', - '' => '☉', - '' => '↑', - '' => '↓', - '' => '←', - '' => '→', - '' => '↖', - '' => '↗', - '' => '↙', - '' => '↘', - '' => '∥', - '' => '∣', - '' => '�', - '@' => '�', - 'A' => '/', - 'B' => '\', - 'C' => '$', - 'D' => '¥', - 'E' => '〒', - 'F' => '¢', - 'G' => '£', - 'H' => '%', - 'I' => '@', - 'J' => '℃', - 'K' => '℉', - 'L' => '﹩', - 'M' => '﹪', - 'N' => '﹫', - 'O' => '㏕', - 'P' => '㎜', - 'Q' => '㎝', - 'R' => '㎞', - 'S' => '㏎', - 'T' => '㎡', - 'U' => '㎎', - 'V' => '㎏', - 'W' => '㏄', - 'X' => '°', - 'Y' => '兙', - 'Z' => '兛', - '[' => '兞', - '\\' => '兝', - ']' => '兡', - '^' => '兣', - '_' => '嗧', - '`' => '瓩', - 'a' => '糎', - 'b' => '▁', - 'c' => '▂', - 'd' => '▃', - 'e' => '▄', - 'f' => '▅', - 'g' => '▆', - 'h' => '▇', - 'i' => '█', - 'j' => '▏', - 'k' => '▎', - 'l' => '▍', - 'm' => '▌', - 'n' => '▋', - 'o' => '▊', - 'p' => '▉', - 'q' => '┼', - 'r' => '┴', - 's' => '┬', - 't' => '┤', - 'u' => '├', - 'v' => '▔', - 'w' => '─', - 'x' => '│', - 'y' => '▕', - 'z' => '┌', - '{' => '┐', - '|' => '└', - '}' => '┘', - '~' => '╭', - '' => '╮', - '' => '╰', - '' => '╯', - '' => '═', - '' => '╞', - '' => '╪', - '' => '╡', - '' => '◢', - '' => '◣', - '' => '◥', - '' => '◤', - '' => '╱', - '' => '╲', - '' => '╳', - '' => '0', - '' => '1', - '' => '2', - '' => '3', - '' => '4', - '' => '5', - '' => '6', - '' => '7', - '' => '8', - '' => '9', - '' => 'Ⅰ', - '' => 'Ⅱ', - '' => 'Ⅲ', - '' => 'Ⅳ', - '' => 'Ⅴ', - '' => 'Ⅵ', - '' => 'Ⅶ', - '' => 'Ⅷ', - '' => 'Ⅸ', - '' => 'Ⅹ', - '' => '〡', - '' => '〢', - '' => '〣', - '' => '〤', - '' => '〥', - '' => '〦', - '' => '〧', - '' => '〨', - '' => '〩', - '' => '�', - '' => '卄', - '' => '�', - '' => 'A', - '' => 'B', - '' => 'C', - '' => 'D', - '' => 'E', - '' => 'F', - '' => 'G', - '' => 'H', - '' => 'I', - '' => 'J', - '' => 'K', - '' => 'L', - '' => 'M', - '' => 'N', - '' => 'O', - '' => 'P', - '' => 'Q', - '' => 'R', - '' => 'S', - '' => 'T', - '' => 'U', - '' => 'V', - '' => 'W', - '' => 'X', - '' => 'Y', - '' => 'Z', - '' => 'a', - '' => 'b', - '' => 'c', - '' => 'd', - '' => 'e', - '' => 'f', - '' => 'g', - '' => 'h', - '' => 'i', - '' => 'j', - '' => 'k', - '' => 'l', - '' => 'm', - '' => 'n', - '' => 'o', - '' => 'p', - '' => 'q', - '' => 'r', - '' => 's', - '' => 't', - '' => 'u', - '' => 'v', - '@' => 'w', - 'A' => 'x', - 'B' => 'y', - 'C' => 'z', - 'D' => 'Α', - 'E' => 'Β', - 'F' => 'Γ', - 'G' => 'Δ', - 'H' => 'Ε', - 'I' => 'Ζ', - 'J' => 'Η', - 'K' => 'Θ', - 'L' => 'Ι', - 'M' => 'Κ', - 'N' => 'Λ', - 'O' => 'Μ', - 'P' => 'Ν', - 'Q' => 'Ξ', - 'R' => 'Ο', - 'S' => 'Π', - 'T' => 'Ρ', - 'U' => 'Σ', - 'V' => 'Τ', - 'W' => 'Υ', - 'X' => 'Φ', - 'Y' => 'Χ', - 'Z' => 'Ψ', - '[' => 'Ω', - '\\' => 'α', - ']' => 'β', - '^' => 'γ', - '_' => 'δ', - '`' => 'ε', - 'a' => 'ζ', - 'b' => 'η', - 'c' => 'θ', - 'd' => 'ι', - 'e' => 'κ', - 'f' => 'λ', - 'g' => 'μ', - 'h' => 'ν', - 'i' => 'ξ', - 'j' => 'ο', - 'k' => 'π', - 'l' => 'ρ', - 'm' => 'σ', - 'n' => 'τ', - 'o' => 'υ', - 'p' => 'φ', - 'q' => 'χ', - 'r' => 'ψ', - 's' => 'ω', - 't' => 'ㄅ', - 'u' => 'ㄆ', - 'v' => 'ㄇ', - 'w' => 'ㄈ', - 'x' => 'ㄉ', - 'y' => 'ㄊ', - 'z' => 'ㄋ', - '{' => 'ㄌ', - '|' => 'ㄍ', - '}' => 'ㄎ', - '~' => 'ㄏ', - '' => 'ㄐ', - '' => 'ㄑ', - '' => 'ㄒ', - '' => 'ㄓ', - '' => 'ㄔ', - '' => 'ㄕ', - '' => 'ㄖ', - '' => 'ㄗ', - '' => 'ㄘ', - '' => 'ㄙ', - '' => 'ㄚ', - '' => 'ㄛ', - '' => 'ㄜ', - '' => 'ㄝ', - '' => 'ㄞ', - '' => 'ㄟ', - '' => 'ㄠ', - '' => 'ㄡ', - '' => 'ㄢ', - '' => 'ㄣ', - '' => 'ㄤ', - '' => 'ㄥ', - '' => 'ㄦ', - '' => 'ㄧ', - '' => 'ㄨ', - '' => 'ㄩ', - '' => '˙', - '' => 'ˉ', - '' => 'ˊ', - '' => 'ˇ', - '' => 'ˋ', - '@' => '一', - 'A' => '乙', - 'B' => '丁', - 'C' => '七', - 'D' => '乃', - 'E' => '九', - 'F' => '了', - 'G' => '二', - 'H' => '人', - 'I' => '儿', - 'J' => '入', - 'K' => '八', - 'L' => '几', - 'M' => '刀', - 'N' => '刁', - 'O' => '力', - 'P' => '匕', - 'Q' => '十', - 'R' => '卜', - 'S' => '又', - 'T' => '三', - 'U' => '下', - 'V' => '丈', - 'W' => '上', - 'X' => '丫', - 'Y' => '丸', - 'Z' => '凡', - '[' => '久', - '\\' => '么', - ']' => '也', - '^' => '乞', - '_' => '于', - '`' => '亡', - 'a' => '兀', - 'b' => '刃', - 'c' => '勺', - 'd' => '千', - 'e' => '叉', - 'f' => '口', - 'g' => '土', - 'h' => '士', - 'i' => '夕', - 'j' => '大', - 'k' => '女', - 'l' => '子', - 'm' => '孑', - 'n' => '孓', - 'o' => '寸', - 'p' => '小', - 'q' => '尢', - 'r' => '尸', - 's' => '山', - 't' => '川', - 'u' => '工', - 'v' => '己', - 'w' => '已', - 'x' => '巳', - 'y' => '巾', - 'z' => '干', - '{' => '廾', - '|' => '弋', - '}' => '弓', - '~' => '才', - '' => '丑', - '' => '丐', - '' => '不', - '' => '中', - '' => '丰', - '' => '丹', - '' => '之', - '' => '尹', - '' => '予', - '' => '云', - '' => '井', - '' => '互', - '' => '五', - '' => '亢', - '' => '仁', - '' => '什', - '' => '仃', - '' => '仆', - '' => '仇', - '' => '仍', - '' => '今', - '' => '介', - '' => '仄', - '' => '元', - '' => '允', - '' => '內', - '' => '六', - '' => '兮', - '' => '公', - '' => '冗', - '' => '凶', - '' => '分', - '' => '切', - '' => '刈', - '' => '勻', - '' => '勾', - '' => '勿', - '' => '化', - '' => '匹', - '' => '午', - '' => '升', - '' => '卅', - '' => '卞', - '' => '厄', - '' => '友', - '' => '及', - '' => '反', - '' => '壬', - '' => '天', - '' => '夫', - '' => '太', - '' => '夭', - '' => '孔', - '' => '少', - '' => '尤', - '' => '尺', - '' => '屯', - '' => '巴', - '' => '幻', - '' => '廿', - '' => '弔', - '' => '引', - '' => '心', - '' => '戈', - '' => '戶', - '' => '手', - '' => '扎', - '' => '支', - '' => '文', - '' => '斗', - '' => '斤', - '' => '方', - '' => '日', - '' => '曰', - '' => '月', - '' => '木', - '' => '欠', - '' => '止', - '' => '歹', - '' => '毋', - '' => '比', - '' => '毛', - '' => '氏', - '' => '水', - '' => '火', - '' => '爪', - '' => '父', - '' => '爻', - '' => '片', - '' => '牙', - '' => '牛', - '' => '犬', - '' => '王', - '' => '丙', - '@' => '世', - 'A' => '丕', - 'B' => '且', - 'C' => '丘', - 'D' => '主', - 'E' => '乍', - 'F' => '乏', - 'G' => '乎', - 'H' => '以', - 'I' => '付', - 'J' => '仔', - 'K' => '仕', - 'L' => '他', - 'M' => '仗', - 'N' => '代', - 'O' => '令', - 'P' => '仙', - 'Q' => '仞', - 'R' => '充', - 'S' => '兄', - 'T' => '冉', - 'U' => '冊', - 'V' => '冬', - 'W' => '凹', - 'X' => '出', - 'Y' => '凸', - 'Z' => '刊', - '[' => '加', - '\\' => '功', - ']' => '包', - '^' => '匆', - '_' => '北', - '`' => '匝', - 'a' => '仟', - 'b' => '半', - 'c' => '卉', - 'd' => '卡', - 'e' => '占', - 'f' => '卯', - 'g' => '卮', - 'h' => '去', - 'i' => '可', - 'j' => '古', - 'k' => '右', - 'l' => '召', - 'm' => '叮', - 'n' => '叩', - 'o' => '叨', - 'p' => '叼', - 'q' => '司', - 'r' => '叵', - 's' => '叫', - 't' => '另', - 'u' => '只', - 'v' => '史', - 'w' => '叱', - 'x' => '台', - 'y' => '句', - 'z' => '叭', - '{' => '叻', - '|' => '四', - '}' => '囚', - '~' => '外', - '' => '央', - '' => '失', - '' => '奴', - '' => '奶', - '' => '孕', - '' => '它', - '' => '尼', - '' => '巨', - '' => '巧', - '' => '左', - '' => '市', - '' => '布', - '' => '平', - '' => '幼', - '' => '弁', - '' => '弘', - '' => '弗', - '' => '必', - '' => '戊', - '' => '打', - '' => '扔', - '' => '扒', - '' => '扑', - '' => '斥', - '' => '旦', - '' => '朮', - '' => '本', - '' => '未', - '' => '末', - '' => '札', - '' => '正', - '' => '母', - '' => '民', - '' => '氐', - '' => '永', - '' => '汁', - '' => '汀', - '' => '氾', - '' => '犯', - '' => '玄', - '' => '玉', - '' => '瓜', - '' => '瓦', - '' => '甘', - '' => '生', - '' => '用', - '' => '甩', - '' => '田', - '' => '由', - '' => '甲', - '' => '申', - '' => '疋', - '' => '白', - '' => '皮', - '' => '皿', - '' => '目', - '' => '矛', - '' => '矢', - '' => '石', - '' => '示', - '' => '禾', - '' => '穴', - '' => '立', - '' => '丞', - '' => '丟', - '' => '乒', - '' => '乓', - '' => '乩', - '' => '亙', - '' => '交', - '' => '亦', - '' => '亥', - '' => '仿', - '' => '伉', - '' => '伙', - '' => '伊', - '' => '伕', - '' => '伍', - '' => '伐', - '' => '休', - '' => '伏', - '' => '仲', - '' => '件', - '' => '任', - '' => '仰', - '' => '仳', - '' => '份', - '' => '企', - '' => '伋', - '' => '光', - '' => '兇', - '' => '兆', - '' => '先', - '' => '全', - '@' => '共', - 'A' => '再', - 'B' => '冰', - 'C' => '列', - 'D' => '刑', - 'E' => '划', - 'F' => '刎', - 'G' => '刖', - 'H' => '劣', - 'I' => '匈', - 'J' => '匡', - 'K' => '匠', - 'L' => '印', - 'M' => '危', - 'N' => '吉', - 'O' => '吏', - 'P' => '同', - 'Q' => '吊', - 'R' => '吐', - 'S' => '吁', - 'T' => '吋', - 'U' => '各', - 'V' => '向', - 'W' => '名', - 'X' => '合', - 'Y' => '吃', - 'Z' => '后', - '[' => '吆', - '\\' => '吒', - ']' => '因', - '^' => '回', - '_' => '囝', - '`' => '圳', - 'a' => '地', - 'b' => '在', - 'c' => '圭', - 'd' => '圬', - 'e' => '圯', - 'f' => '圩', - 'g' => '夙', - 'h' => '多', - 'i' => '夷', - 'j' => '夸', - 'k' => '妄', - 'l' => '奸', - 'm' => '妃', - 'n' => '好', - 'o' => '她', - 'p' => '如', - 'q' => '妁', - 'r' => '字', - 's' => '存', - 't' => '宇', - 'u' => '守', - 'v' => '宅', - 'w' => '安', - 'x' => '寺', - 'y' => '尖', - 'z' => '屹', - '{' => '州', - '|' => '帆', - '}' => '并', - '~' => '年', - '' => '式', - '' => '弛', - '' => '忙', - '' => '忖', - '' => '戎', - '' => '戌', - '' => '戍', - '' => '成', - '' => '扣', - '' => '扛', - '' => '托', - '' => '收', - '' => '早', - '' => '旨', - '' => '旬', - '' => '旭', - '' => '曲', - '' => '曳', - '' => '有', - '' => '朽', - '' => '朴', - '' => '朱', - '' => '朵', - '' => '次', - '' => '此', - '' => '死', - '' => '氖', - '' => '汝', - '' => '汗', - '' => '汙', - '' => '江', - '' => '池', - '' => '汐', - '' => '汕', - '' => '污', - '' => '汛', - '' => '汍', - '' => '汎', - '' => '灰', - '' => '牟', - '' => '牝', - '' => '百', - '' => '竹', - '' => '米', - '' => '糸', - '' => '缶', - '' => '羊', - '' => '羽', - '' => '老', - '' => '考', - '' => '而', - '' => '耒', - '' => '耳', - '' => '聿', - '' => '肉', - '' => '肋', - '' => '肌', - '' => '臣', - '' => '自', - '' => '至', - '' => '臼', - '' => '舌', - '' => '舛', - '' => '舟', - '' => '艮', - '' => '色', - '' => '艾', - '' => '虫', - '' => '血', - '' => '行', - '' => '衣', - '' => '西', - '' => '阡', - '' => '串', - '' => '亨', - '' => '位', - '' => '住', - '' => '佇', - '' => '佗', - '' => '佞', - '' => '伴', - '' => '佛', - '' => '何', - '' => '估', - '' => '佐', - '' => '佑', - '' => '伽', - '' => '伺', - '' => '伸', - '' => '佃', - '' => '佔', - '' => '似', - '' => '但', - '' => '佣', - '@' => '作', - 'A' => '你', - 'B' => '伯', - 'C' => '低', - 'D' => '伶', - 'E' => '余', - 'F' => '佝', - 'G' => '佈', - 'H' => '佚', - 'I' => '兌', - 'J' => '克', - 'K' => '免', - 'L' => '兵', - 'M' => '冶', - 'N' => '冷', - 'O' => '別', - 'P' => '判', - 'Q' => '利', - 'R' => '刪', - 'S' => '刨', - 'T' => '劫', - 'U' => '助', - 'V' => '努', - 'W' => '劬', - 'X' => '匣', - 'Y' => '即', - 'Z' => '卵', - '[' => '吝', - '\\' => '吭', - ']' => '吞', - '^' => '吾', - '_' => '否', - '`' => '呎', - 'a' => '吧', - 'b' => '呆', - 'c' => '呃', - 'd' => '吳', - 'e' => '呈', - 'f' => '呂', - 'g' => '君', - 'h' => '吩', - 'i' => '告', - 'j' => '吹', - 'k' => '吻', - 'l' => '吸', - 'm' => '吮', - 'n' => '吵', - 'o' => '吶', - 'p' => '吠', - 'q' => '吼', - 'r' => '呀', - 's' => '吱', - 't' => '含', - 'u' => '吟', - 'v' => '听', - 'w' => '囪', - 'x' => '困', - 'y' => '囤', - 'z' => '囫', - '{' => '坊', - '|' => '坑', - '}' => '址', - '~' => '坍', - '' => '均', - '' => '坎', - '' => '圾', - '' => '坐', - '' => '坏', - '' => '圻', - '' => '壯', - '' => '夾', - '' => '妝', - '' => '妒', - '' => '妨', - '' => '妞', - '' => '妣', - '' => '妙', - '' => '妖', - '' => '妍', - '' => '妤', - '' => '妓', - '' => '妊', - '' => '妥', - '' => '孝', - '' => '孜', - '' => '孚', - '' => '孛', - '' => '完', - '' => '宋', - '' => '宏', - '' => '尬', - '' => '局', - '' => '屁', - '' => '尿', - '' => '尾', - '' => '岐', - '' => '岑', - '' => '岔', - '' => '岌', - '' => '巫', - '' => '希', - '' => '序', - '' => '庇', - '' => '床', - '' => '廷', - '' => '弄', - '' => '弟', - '' => '彤', - '' => '形', - '' => '彷', - '' => '役', - '' => '忘', - '' => '忌', - '' => '志', - '' => '忍', - '' => '忱', - '' => '快', - '' => '忸', - '' => '忪', - '' => '戒', - '' => '我', - '' => '抄', - '' => '抗', - '' => '抖', - '' => '技', - '' => '扶', - '' => '抉', - '' => '扭', - '' => '把', - '' => '扼', - '' => '找', - '' => '批', - '' => '扳', - '' => '抒', - '' => '扯', - '' => '折', - '' => '扮', - '' => '投', - '' => '抓', - '' => '抑', - '' => '抆', - '' => '改', - '' => '攻', - '' => '攸', - '' => '旱', - '' => '更', - '' => '束', - '' => '李', - '' => '杏', - '' => '材', - '' => '村', - '' => '杜', - '' => '杖', - '' => '杞', - '' => '杉', - '' => '杆', - '' => '杠', - '@' => '杓', - 'A' => '杗', - 'B' => '步', - 'C' => '每', - 'D' => '求', - 'E' => '汞', - 'F' => '沙', - 'G' => '沁', - 'H' => '沈', - 'I' => '沉', - 'J' => '沅', - 'K' => '沛', - 'L' => '汪', - 'M' => '決', - 'N' => '沐', - 'O' => '汰', - 'P' => '沌', - 'Q' => '汨', - 'R' => '沖', - 'S' => '沒', - 'T' => '汽', - 'U' => '沃', - 'V' => '汲', - 'W' => '汾', - 'X' => '汴', - 'Y' => '沆', - 'Z' => '汶', - '[' => '沍', - '\\' => '沔', - ']' => '沘', - '^' => '沂', - '_' => '灶', - '`' => '灼', - 'a' => '災', - 'b' => '灸', - 'c' => '牢', - 'd' => '牡', - 'e' => '牠', - 'f' => '狄', - 'g' => '狂', - 'h' => '玖', - 'i' => '甬', - 'j' => '甫', - 'k' => '男', - 'l' => '甸', - 'm' => '皂', - 'n' => '盯', - 'o' => '矣', - 'p' => '私', - 'q' => '秀', - 'r' => '禿', - 's' => '究', - 't' => '系', - 'u' => '罕', - 'v' => '肖', - 'w' => '肓', - 'x' => '肝', - 'y' => '肘', - 'z' => '肛', - '{' => '肚', - '|' => '育', - '}' => '良', - '~' => '芒', - '' => '芋', - '' => '芍', - '' => '見', - '' => '角', - '' => '言', - '' => '谷', - '' => '豆', - '' => '豕', - '' => '貝', - '' => '赤', - '' => '走', - '' => '足', - '' => '身', - '' => '車', - '' => '辛', - '' => '辰', - '' => '迂', - '' => '迆', - '' => '迅', - '' => '迄', - '' => '巡', - '' => '邑', - '' => '邢', - '' => '邪', - '' => '邦', - '' => '那', - '' => '酉', - '' => '釆', - '' => '里', - '' => '防', - '' => '阮', - '' => '阱', - '' => '阪', - '' => '阬', - '' => '並', - '' => '乖', - '' => '乳', - '' => '事', - '' => '些', - '' => '亞', - '' => '享', - '' => '京', - '' => '佯', - '' => '依', - '' => '侍', - '' => '佳', - '' => '使', - '' => '佬', - '' => '供', - '' => '例', - '' => '來', - '' => '侃', - '' => '佰', - '' => '併', - '' => '侈', - '' => '佩', - '' => '佻', - '' => '侖', - '' => '佾', - '' => '侏', - '' => '侑', - '' => '佺', - '' => '兔', - '' => '兒', - '' => '兕', - '' => '兩', - '' => '具', - '' => '其', - '' => '典', - '' => '冽', - '' => '函', - '' => '刻', - '' => '券', - '' => '刷', - '' => '刺', - '' => '到', - '' => '刮', - '' => '制', - '' => '剁', - '' => '劾', - '' => '劻', - '' => '卒', - '' => '協', - '' => '卓', - '' => '卑', - '' => '卦', - '' => '卷', - '' => '卸', - '' => '卹', - '' => '取', - '' => '叔', - '' => '受', - '' => '味', - '' => '呵', - '@' => '咖', - 'A' => '呸', - 'B' => '咕', - 'C' => '咀', - 'D' => '呻', - 'E' => '呷', - 'F' => '咄', - 'G' => '咒', - 'H' => '咆', - 'I' => '呼', - 'J' => '咐', - 'K' => '呱', - 'L' => '呶', - 'M' => '和', - 'N' => '咚', - 'O' => '呢', - 'P' => '周', - 'Q' => '咋', - 'R' => '命', - 'S' => '咎', - 'T' => '固', - 'U' => '垃', - 'V' => '坷', - 'W' => '坪', - 'X' => '坩', - 'Y' => '坡', - 'Z' => '坦', - '[' => '坤', - '\\' => '坼', - ']' => '夜', - '^' => '奉', - '_' => '奇', - '`' => '奈', - 'a' => '奄', - 'b' => '奔', - 'c' => '妾', - 'd' => '妻', - 'e' => '委', - 'f' => '妹', - 'g' => '妮', - 'h' => '姑', - 'i' => '姆', - 'j' => '姐', - 'k' => '姍', - 'l' => '始', - 'm' => '姓', - 'n' => '姊', - 'o' => '妯', - 'p' => '妳', - 'q' => '姒', - 'r' => '姅', - 's' => '孟', - 't' => '孤', - 'u' => '季', - 'v' => '宗', - 'w' => '定', - 'x' => '官', - 'y' => '宜', - 'z' => '宙', - '{' => '宛', - '|' => '尚', - '}' => '屈', - '~' => '居', - '' => '屆', - '' => '岷', - '' => '岡', - '' => '岸', - '' => '岩', - '' => '岫', - '' => '岱', - '' => '岳', - '' => '帘', - '' => '帚', - '' => '帖', - '' => '帕', - '' => '帛', - '' => '帑', - '' => '幸', - '' => '庚', - '' => '店', - '' => '府', - '' => '底', - '' => '庖', - '' => '延', - '' => '弦', - '' => '弧', - '' => '弩', - '' => '往', - '' => '征', - '' => '彿', - '' => '彼', - '' => '忝', - '' => '忠', - '' => '忽', - '' => '念', - '' => '忿', - '' => '怏', - '' => '怔', - '' => '怯', - '' => '怵', - '' => '怖', - '' => '怪', - '' => '怕', - '' => '怡', - '' => '性', - '' => '怩', - '' => '怫', - '' => '怛', - '' => '或', - '' => '戕', - '' => '房', - '' => '戾', - '' => '所', - '' => '承', - '' => '拉', - '' => '拌', - '' => '拄', - '' => '抿', - '' => '拂', - '' => '抹', - '' => '拒', - '' => '招', - '' => '披', - '' => '拓', - '' => '拔', - '' => '拋', - '' => '拈', - '' => '抨', - '' => '抽', - '' => '押', - '' => '拐', - '' => '拙', - '' => '拇', - '' => '拍', - '' => '抵', - '' => '拚', - '' => '抱', - '' => '拘', - '' => '拖', - '' => '拗', - '' => '拆', - '' => '抬', - '' => '拎', - '' => '放', - '' => '斧', - '' => '於', - '' => '旺', - '' => '昔', - '' => '易', - '' => '昌', - '' => '昆', - '' => '昂', - '' => '明', - '' => '昀', - '' => '昏', - '' => '昕', - '' => '昊', - '@' => '昇', - 'A' => '服', - 'B' => '朋', - 'C' => '杭', - 'D' => '枋', - 'E' => '枕', - 'F' => '東', - 'G' => '果', - 'H' => '杳', - 'I' => '杷', - 'J' => '枇', - 'K' => '枝', - 'L' => '林', - 'M' => '杯', - 'N' => '杰', - 'O' => '板', - 'P' => '枉', - 'Q' => '松', - 'R' => '析', - 'S' => '杵', - 'T' => '枚', - 'U' => '枓', - 'V' => '杼', - 'W' => '杪', - 'X' => '杲', - 'Y' => '欣', - 'Z' => '武', - '[' => '歧', - '\\' => '歿', - ']' => '氓', - '^' => '氛', - '_' => '泣', - '`' => '注', - 'a' => '泳', - 'b' => '沱', - 'c' => '泌', - 'd' => '泥', - 'e' => '河', - 'f' => '沽', - 'g' => '沾', - 'h' => '沼', - 'i' => '波', - 'j' => '沫', - 'k' => '法', - 'l' => '泓', - 'm' => '沸', - 'n' => '泄', - 'o' => '油', - 'p' => '況', - 'q' => '沮', - 'r' => '泗', - 's' => '泅', - 't' => '泱', - 'u' => '沿', - 'v' => '治', - 'w' => '泡', - 'x' => '泛', - 'y' => '泊', - 'z' => '沬', - '{' => '泯', - '|' => '泜', - '}' => '泖', - '~' => '泠', - '' => '炕', - '' => '炎', - '' => '炒', - '' => '炊', - '' => '炙', - '' => '爬', - '' => '爭', - '' => '爸', - '' => '版', - '' => '牧', - '' => '物', - '' => '狀', - '' => '狎', - '' => '狙', - '' => '狗', - '' => '狐', - '' => '玩', - '' => '玨', - '' => '玟', - '' => '玫', - '' => '玥', - '' => '甽', - '' => '疝', - '' => '疙', - '' => '疚', - '' => '的', - '' => '盂', - '' => '盲', - '' => '直', - '' => '知', - '' => '矽', - '' => '社', - '' => '祀', - '' => '祁', - '' => '秉', - '' => '秈', - '' => '空', - '' => '穹', - '' => '竺', - '' => '糾', - '' => '罔', - '' => '羌', - '' => '羋', - '' => '者', - '' => '肺', - '' => '肥', - '' => '肢', - '' => '肱', - '' => '股', - '' => '肫', - '' => '肩', - '' => '肴', - '' => '肪', - '' => '肯', - '' => '臥', - '' => '臾', - '' => '舍', - '' => '芳', - '' => '芝', - '' => '芙', - '' => '芭', - '' => '芽', - '' => '芟', - '' => '芹', - '' => '花', - '' => '芬', - '' => '芥', - '' => '芯', - '' => '芸', - '' => '芣', - '' => '芰', - '' => '芾', - '' => '芷', - '' => '虎', - '' => '虱', - '' => '初', - '' => '表', - '' => '軋', - '' => '迎', - '' => '返', - '' => '近', - '' => '邵', - '' => '邸', - '' => '邱', - '' => '邶', - '' => '采', - '' => '金', - '' => '長', - '' => '門', - '' => '阜', - '' => '陀', - '' => '阿', - '' => '阻', - '' => '附', - '@' => '陂', - 'A' => '隹', - 'B' => '雨', - 'C' => '青', - 'D' => '非', - 'E' => '亟', - 'F' => '亭', - 'G' => '亮', - 'H' => '信', - 'I' => '侵', - 'J' => '侯', - 'K' => '便', - 'L' => '俠', - 'M' => '俑', - 'N' => '俏', - 'O' => '保', - 'P' => '促', - 'Q' => '侶', - 'R' => '俘', - 'S' => '俟', - 'T' => '俊', - 'U' => '俗', - 'V' => '侮', - 'W' => '俐', - 'X' => '俄', - 'Y' => '係', - 'Z' => '俚', - '[' => '俎', - '\\' => '俞', - ']' => '侷', - '^' => '兗', - '_' => '冒', - '`' => '冑', - 'a' => '冠', - 'b' => '剎', - 'c' => '剃', - 'd' => '削', - 'e' => '前', - 'f' => '剌', - 'g' => '剋', - 'h' => '則', - 'i' => '勇', - 'j' => '勉', - 'k' => '勃', - 'l' => '勁', - 'm' => '匍', - 'n' => '南', - 'o' => '卻', - 'p' => '厚', - 'q' => '叛', - 'r' => '咬', - 's' => '哀', - 't' => '咨', - 'u' => '哎', - 'v' => '哉', - 'w' => '咸', - 'x' => '咦', - 'y' => '咳', - 'z' => '哇', - '{' => '哂', - '|' => '咽', - '}' => '咪', - '~' => '品', - '' => '哄', - '' => '哈', - '' => '咯', - '' => '咫', - '' => '咱', - '' => '咻', - '' => '咩', - '' => '咧', - '' => '咿', - '' => '囿', - '' => '垂', - '' => '型', - '' => '垠', - '' => '垣', - '' => '垢', - '' => '城', - '' => '垮', - '' => '垓', - '' => '奕', - '' => '契', - '' => '奏', - '' => '奎', - '' => '奐', - '' => '姜', - '' => '姘', - '' => '姿', - '' => '姣', - '' => '姨', - '' => '娃', - '' => '姥', - '' => '姪', - '' => '姚', - '' => '姦', - '' => '威', - '' => '姻', - '' => '孩', - '' => '宣', - '' => '宦', - '' => '室', - '' => '客', - '' => '宥', - '' => '封', - '' => '屎', - '' => '屏', - '' => '屍', - '' => '屋', - '' => '峙', - '' => '峒', - '' => '巷', - '' => '帝', - '' => '帥', - '' => '帟', - '' => '幽', - '' => '庠', - '' => '度', - '' => '建', - '' => '弈', - '' => '弭', - '' => '彥', - '' => '很', - '' => '待', - '' => '徊', - '' => '律', - '' => '徇', - '' => '後', - '' => '徉', - '' => '怒', - '' => '思', - '' => '怠', - '' => '急', - '' => '怎', - '' => '怨', - '' => '恍', - '' => '恰', - '' => '恨', - '' => '恢', - '' => '恆', - '' => '恃', - '' => '恬', - '' => '恫', - '' => '恪', - '' => '恤', - '' => '扁', - '' => '拜', - '' => '挖', - '' => '按', - '' => '拼', - '' => '拭', - '' => '持', - '' => '拮', - '' => '拽', - '' => '指', - '' => '拱', - '' => '拷', - '@' => '拯', - 'A' => '括', - 'B' => '拾', - 'C' => '拴', - 'D' => '挑', - 'E' => '挂', - 'F' => '政', - 'G' => '故', - 'H' => '斫', - 'I' => '施', - 'J' => '既', - 'K' => '春', - 'L' => '昭', - 'M' => '映', - 'N' => '昧', - 'O' => '是', - 'P' => '星', - 'Q' => '昨', - 'R' => '昱', - 'S' => '昤', - 'T' => '曷', - 'U' => '柿', - 'V' => '染', - 'W' => '柱', - 'X' => '柔', - 'Y' => '某', - 'Z' => '柬', - '[' => '架', - '\\' => '枯', - ']' => '柵', - '^' => '柩', - '_' => '柯', - '`' => '柄', - 'a' => '柑', - 'b' => '枴', - 'c' => '柚', - 'd' => '查', - 'e' => '枸', - 'f' => '柏', - 'g' => '柞', - 'h' => '柳', - 'i' => '枰', - 'j' => '柙', - 'k' => '柢', - 'l' => '柝', - 'm' => '柒', - 'n' => '歪', - 'o' => '殃', - 'p' => '殆', - 'q' => '段', - 'r' => '毒', - 's' => '毗', - 't' => '氟', - 'u' => '泉', - 'v' => '洋', - 'w' => '洲', - 'x' => '洪', - 'y' => '流', - 'z' => '津', - '{' => '洌', - '|' => '洱', - '}' => '洞', - '~' => '洗', - '' => '活', - '' => '洽', - '' => '派', - '' => '洶', - '' => '洛', - '' => '泵', - '' => '洹', - '' => '洧', - '' => '洸', - '' => '洩', - '' => '洮', - '' => '洵', - '' => '洎', - '' => '洫', - '' => '炫', - '' => '為', - '' => '炳', - '' => '炬', - '' => '炯', - '' => '炭', - '' => '炸', - '' => '炮', - '' => '炤', - '' => '爰', - '' => '牲', - '' => '牯', - '' => '牴', - '' => '狩', - '' => '狠', - '' => '狡', - '' => '玷', - '' => '珊', - '' => '玻', - '' => '玲', - '' => '珍', - '' => '珀', - '' => '玳', - '' => '甚', - '' => '甭', - '' => '畏', - '' => '界', - '' => '畎', - '' => '畋', - '' => '疫', - '' => '疤', - '' => '疥', - '' => '疢', - '' => '疣', - '' => '癸', - '' => '皆', - '' => '皇', - '' => '皈', - '' => '盈', - '' => '盆', - '' => '盃', - '' => '盅', - '' => '省', - '' => '盹', - '' => '相', - '' => '眉', - '' => '看', - '' => '盾', - '' => '盼', - '' => '眇', - '' => '矜', - '' => '砂', - '' => '研', - '' => '砌', - '' => '砍', - '' => '祆', - '' => '祉', - '' => '祈', - '' => '祇', - '' => '禹', - '' => '禺', - '' => '科', - '' => '秒', - '' => '秋', - '' => '穿', - '' => '突', - '' => '竿', - '' => '竽', - '' => '籽', - '' => '紂', - '' => '紅', - '' => '紀', - '' => '紉', - '' => '紇', - '' => '約', - '' => '紆', - '' => '缸', - '' => '美', - '' => '羿', - '' => '耄', - '@' => '耐', - 'A' => '耍', - 'B' => '耑', - 'C' => '耶', - 'D' => '胖', - 'E' => '胥', - 'F' => '胚', - 'G' => '胃', - 'H' => '胄', - 'I' => '背', - 'J' => '胡', - 'K' => '胛', - 'L' => '胎', - 'M' => '胞', - 'N' => '胤', - 'O' => '胝', - 'P' => '致', - 'Q' => '舢', - 'R' => '苧', - 'S' => '范', - 'T' => '茅', - 'U' => '苣', - 'V' => '苛', - 'W' => '苦', - 'X' => '茄', - 'Y' => '若', - 'Z' => '茂', - '[' => '茉', - '\\' => '苒', - ']' => '苗', - '^' => '英', - '_' => '茁', - '`' => '苜', - 'a' => '苔', - 'b' => '苑', - 'c' => '苞', - 'd' => '苓', - 'e' => '苟', - 'f' => '苯', - 'g' => '茆', - 'h' => '虐', - 'i' => '虹', - 'j' => '虻', - 'k' => '虺', - 'l' => '衍', - 'm' => '衫', - 'n' => '要', - 'o' => '觔', - 'p' => '計', - 'q' => '訂', - 'r' => '訃', - 's' => '貞', - 't' => '負', - 'u' => '赴', - 'v' => '赳', - 'w' => '趴', - 'x' => '軍', - 'y' => '軌', - 'z' => '述', - '{' => '迦', - '|' => '迢', - '}' => '迪', - '~' => '迥', - '' => '迭', - '' => '迫', - '' => '迤', - '' => '迨', - '' => '郊', - '' => '郎', - '' => '郁', - '' => '郃', - '' => '酋', - '' => '酊', - '' => '重', - '' => '閂', - '' => '限', - '' => '陋', - '' => '陌', - '' => '降', - '' => '面', - '' => '革', - '' => '韋', - '' => '韭', - '' => '音', - '' => '頁', - '' => '風', - '' => '飛', - '' => '食', - '' => '首', - '' => '香', - '' => '乘', - '' => '亳', - '' => '倌', - '' => '倍', - '' => '倣', - '' => '俯', - '' => '倦', - '' => '倥', - '' => '俸', - '' => '倩', - '' => '倖', - '' => '倆', - '' => '值', - '' => '借', - '' => '倚', - '' => '倒', - '' => '們', - '' => '俺', - '' => '倀', - '' => '倔', - '' => '倨', - '' => '俱', - '' => '倡', - '' => '個', - '' => '候', - '' => '倘', - '' => '俳', - '' => '修', - '' => '倭', - '' => '倪', - '' => '俾', - '' => '倫', - '' => '倉', - '' => '兼', - '' => '冤', - '' => '冥', - '' => '冢', - '' => '凍', - '' => '凌', - '' => '准', - '' => '凋', - '' => '剖', - '' => '剜', - '' => '剔', - '' => '剛', - '' => '剝', - '' => '匪', - '' => '卿', - '' => '原', - '' => '厝', - '' => '叟', - '' => '哨', - '' => '唐', - '' => '唁', - '' => '唷', - '' => '哼', - '' => '哥', - '' => '哲', - '' => '唆', - '' => '哺', - '' => '唔', - '' => '哩', - '' => '哭', - '' => '員', - '' => '唉', - '' => '哮', - '' => '哪', - '@' => '哦', - 'A' => '唧', - 'B' => '唇', - 'C' => '哽', - 'D' => '唏', - 'E' => '圃', - 'F' => '圄', - 'G' => '埂', - 'H' => '埔', - 'I' => '埋', - 'J' => '埃', - 'K' => '堉', - 'L' => '夏', - 'M' => '套', - 'N' => '奘', - 'O' => '奚', - 'P' => '娑', - 'Q' => '娘', - 'R' => '娜', - 'S' => '娟', - 'T' => '娛', - 'U' => '娓', - 'V' => '姬', - 'W' => '娠', - 'X' => '娣', - 'Y' => '娩', - 'Z' => '娥', - '[' => '娌', - '\\' => '娉', - ']' => '孫', - '^' => '屘', - '_' => '宰', - '`' => '害', - 'a' => '家', - 'b' => '宴', - 'c' => '宮', - 'd' => '宵', - 'e' => '容', - 'f' => '宸', - 'g' => '射', - 'h' => '屑', - 'i' => '展', - 'j' => '屐', - 'k' => '峭', - 'l' => '峽', - 'm' => '峻', - 'n' => '峪', - 'o' => '峨', - 'p' => '峰', - 'q' => '島', - 'r' => '崁', - 's' => '峴', - 't' => '差', - 'u' => '席', - 'v' => '師', - 'w' => '庫', - 'x' => '庭', - 'y' => '座', - 'z' => '弱', - '{' => '徒', - '|' => '徑', - '}' => '徐', - '~' => '恙', - '' => '恣', - '' => '恥', - '' => '恐', - '' => '恕', - '' => '恭', - '' => '恩', - '' => '息', - '' => '悄', - '' => '悟', - '' => '悚', - '' => '悍', - '' => '悔', - '' => '悌', - '' => '悅', - '' => '悖', - '' => '扇', - '' => '拳', - '' => '挈', - '' => '拿', - '' => '捎', - '' => '挾', - '' => '振', - '' => '捕', - '' => '捂', - '' => '捆', - '' => '捏', - '' => '捉', - '' => '挺', - '' => '捐', - '' => '挽', - '' => '挪', - '' => '挫', - '' => '挨', - '' => '捍', - '' => '捌', - '' => '效', - '' => '敉', - '' => '料', - '' => '旁', - '' => '旅', - '' => '時', - '' => '晉', - '' => '晏', - '' => '晃', - '' => '晒', - '' => '晌', - '' => '晅', - '' => '晁', - '' => '書', - '' => '朔', - '' => '朕', - '' => '朗', - '' => '校', - '' => '核', - '' => '案', - '' => '框', - '' => '桓', - '' => '根', - '' => '桂', - '' => '桔', - '' => '栩', - '' => '梳', - '' => '栗', - '' => '桌', - '' => '桑', - '' => '栽', - '' => '柴', - '' => '桐', - '' => '桀', - '' => '格', - '' => '桃', - '' => '株', - '' => '桅', - '' => '栓', - '' => '栘', - '' => '桁', - '' => '殊', - '' => '殉', - '' => '殷', - '' => '氣', - '' => '氧', - '' => '氨', - '' => '氦', - '' => '氤', - '' => '泰', - '' => '浪', - '' => '涕', - '' => '消', - '' => '涇', - '' => '浦', - '' => '浸', - '' => '海', - '' => '浙', - '' => '涓', - '@' => '浬', - 'A' => '涉', - 'B' => '浮', - 'C' => '浚', - 'D' => '浴', - 'E' => '浩', - 'F' => '涌', - 'G' => '涊', - 'H' => '浹', - 'I' => '涅', - 'J' => '浥', - 'K' => '涔', - 'L' => '烊', - 'M' => '烘', - 'N' => '烤', - 'O' => '烙', - 'P' => '烈', - 'Q' => '烏', - 'R' => '爹', - 'S' => '特', - 'T' => '狼', - 'U' => '狹', - 'V' => '狽', - 'W' => '狸', - 'X' => '狷', - 'Y' => '玆', - 'Z' => '班', - '[' => '琉', - '\\' => '珮', - ']' => '珠', - '^' => '珪', - '_' => '珞', - '`' => '畔', - 'a' => '畝', - 'b' => '畜', - 'c' => '畚', - 'd' => '留', - 'e' => '疾', - 'f' => '病', - 'g' => '症', - 'h' => '疲', - 'i' => '疳', - 'j' => '疽', - 'k' => '疼', - 'l' => '疹', - 'm' => '痂', - 'n' => '疸', - 'o' => '皋', - 'p' => '皰', - 'q' => '益', - 'r' => '盍', - 's' => '盎', - 't' => '眩', - 'u' => '真', - 'v' => '眠', - 'w' => '眨', - 'x' => '矩', - 'y' => '砰', - 'z' => '砧', - '{' => '砸', - '|' => '砝', - '}' => '破', - '~' => '砷', - '' => '砥', - '' => '砭', - '' => '砠', - '' => '砟', - '' => '砲', - '' => '祕', - '' => '祐', - '' => '祠', - '' => '祟', - '' => '祖', - '' => '神', - '' => '祝', - '' => '祗', - '' => '祚', - '' => '秤', - '' => '秣', - '' => '秧', - '' => '租', - '' => '秦', - '' => '秩', - '' => '秘', - '' => '窄', - '' => '窈', - '' => '站', - '' => '笆', - '' => '笑', - '' => '粉', - '' => '紡', - '' => '紗', - '' => '紋', - '' => '紊', - '' => '素', - '' => '索', - '' => '純', - '' => '紐', - '' => '紕', - '' => '級', - '' => '紜', - '' => '納', - '' => '紙', - '' => '紛', - '' => '缺', - '' => '罟', - '' => '羔', - '' => '翅', - '' => '翁', - '' => '耆', - '' => '耘', - '' => '耕', - '' => '耙', - '' => '耗', - '' => '耽', - '' => '耿', - '' => '胱', - '' => '脂', - '' => '胰', - '' => '脅', - '' => '胭', - '' => '胴', - '' => '脆', - '' => '胸', - '' => '胳', - '' => '脈', - '' => '能', - '' => '脊', - '' => '胼', - '' => '胯', - '' => '臭', - '' => '臬', - '' => '舀', - '' => '舐', - '' => '航', - '' => '舫', - '' => '舨', - '' => '般', - '' => '芻', - '' => '茫', - '' => '荒', - '' => '荔', - '' => '荊', - '' => '茸', - '' => '荐', - '' => '草', - '' => '茵', - '' => '茴', - '' => '荏', - '' => '茲', - '' => '茹', - '' => '茶', - '' => '茗', - '' => '荀', - '' => '茱', - '' => '茨', - '' => '荃', - '@' => '虔', - 'A' => '蚊', - 'B' => '蚪', - 'C' => '蚓', - 'D' => '蚤', - 'E' => '蚩', - 'F' => '蚌', - 'G' => '蚣', - 'H' => '蚜', - 'I' => '衰', - 'J' => '衷', - 'K' => '袁', - 'L' => '袂', - 'M' => '衽', - 'N' => '衹', - 'O' => '記', - 'P' => '訐', - 'Q' => '討', - 'R' => '訌', - 'S' => '訕', - 'T' => '訊', - 'U' => '託', - 'V' => '訓', - 'W' => '訖', - 'X' => '訏', - 'Y' => '訑', - 'Z' => '豈', - '[' => '豺', - '\\' => '豹', - ']' => '財', - '^' => '貢', - '_' => '起', - '`' => '躬', - 'a' => '軒', - 'b' => '軔', - 'c' => '軏', - 'd' => '辱', - 'e' => '送', - 'f' => '逆', - 'g' => '迷', - 'h' => '退', - 'i' => '迺', - 'j' => '迴', - 'k' => '逃', - 'l' => '追', - 'm' => '逅', - 'n' => '迸', - 'o' => '邕', - 'p' => '郡', - 'q' => '郝', - 'r' => '郢', - 's' => '酒', - 't' => '配', - 'u' => '酌', - 'v' => '釘', - 'w' => '針', - 'x' => '釗', - 'y' => '釜', - 'z' => '釙', - '{' => '閃', - '|' => '院', - '}' => '陣', - '~' => '陡', - '' => '陛', - '' => '陝', - '' => '除', - '' => '陘', - '' => '陞', - '' => '隻', - '' => '飢', - '' => '馬', - '' => '骨', - '' => '高', - '' => '鬥', - '' => '鬲', - '' => '鬼', - '' => '乾', - '' => '偺', - '' => '偽', - '' => '停', - '' => '假', - '' => '偃', - '' => '偌', - '' => '做', - '' => '偉', - '' => '健', - '' => '偶', - '' => '偎', - '' => '偕', - '' => '偵', - '' => '側', - '' => '偷', - '' => '偏', - '' => '倏', - '' => '偯', - '' => '偭', - '' => '兜', - '' => '冕', - '' => '凰', - '' => '剪', - '' => '副', - '' => '勒', - '' => '務', - '' => '勘', - '' => '動', - '' => '匐', - '' => '匏', - '' => '匙', - '' => '匿', - '' => '區', - '' => '匾', - '' => '參', - '' => '曼', - '' => '商', - '' => '啪', - '' => '啦', - '' => '啄', - '' => '啞', - '' => '啡', - '' => '啃', - '' => '啊', - '' => '唱', - '' => '啖', - '' => '問', - '' => '啕', - '' => '唯', - '' => '啤', - '' => '唸', - '' => '售', - '' => '啜', - '' => '唬', - '' => '啣', - '' => '唳', - '' => '啁', - '' => '啗', - '' => '圈', - '' => '國', - '' => '圉', - '' => '域', - '' => '堅', - '' => '堊', - '' => '堆', - '' => '埠', - '' => '埤', - '' => '基', - '' => '堂', - '' => '堵', - '' => '執', - '' => '培', - '' => '夠', - '' => '奢', - '' => '娶', - '' => '婁', - '' => '婉', - '' => '婦', - '' => '婪', - '' => '婀', - '@' => '娼', - 'A' => '婢', - 'B' => '婚', - 'C' => '婆', - 'D' => '婊', - 'E' => '孰', - 'F' => '寇', - 'G' => '寅', - 'H' => '寄', - 'I' => '寂', - 'J' => '宿', - 'K' => '密', - 'L' => '尉', - 'M' => '專', - 'N' => '將', - 'O' => '屠', - 'P' => '屜', - 'Q' => '屝', - 'R' => '崇', - 'S' => '崆', - 'T' => '崎', - 'U' => '崛', - 'V' => '崖', - 'W' => '崢', - 'X' => '崑', - 'Y' => '崩', - 'Z' => '崔', - '[' => '崙', - '\\' => '崤', - ']' => '崧', - '^' => '崗', - '_' => '巢', - '`' => '常', - 'a' => '帶', - 'b' => '帳', - 'c' => '帷', - 'd' => '康', - 'e' => '庸', - 'f' => '庶', - 'g' => '庵', - 'h' => '庾', - 'i' => '張', - 'j' => '強', - 'k' => '彗', - 'l' => '彬', - 'm' => '彩', - 'n' => '彫', - 'o' => '得', - 'p' => '徙', - 'q' => '從', - 'r' => '徘', - 's' => '御', - 't' => '徠', - 'u' => '徜', - 'v' => '恿', - 'w' => '患', - 'x' => '悉', - 'y' => '悠', - 'z' => '您', - '{' => '惋', - '|' => '悴', - '}' => '惦', - '~' => '悽', - '' => '情', - '' => '悻', - '' => '悵', - '' => '惜', - '' => '悼', - '' => '惘', - '' => '惕', - '' => '惆', - '' => '惟', - '' => '悸', - '' => '惚', - '' => '惇', - '' => '戚', - '' => '戛', - '' => '扈', - '' => '掠', - '' => '控', - '' => '捲', - '' => '掖', - '' => '探', - '' => '接', - '' => '捷', - '' => '捧', - '' => '掘', - '' => '措', - '' => '捱', - '' => '掩', - '' => '掉', - '' => '掃', - '' => '掛', - '' => '捫', - '' => '推', - '' => '掄', - '' => '授', - '' => '掙', - '' => '採', - '' => '掬', - '' => '排', - '' => '掏', - '' => '掀', - '' => '捻', - '' => '捩', - '' => '捨', - '' => '捺', - '' => '敝', - '' => '敖', - '' => '救', - '' => '教', - '' => '敗', - '' => '啟', - '' => '敏', - '' => '敘', - '' => '敕', - '' => '敔', - '' => '斜', - '' => '斛', - '' => '斬', - '' => '族', - '' => '旋', - '' => '旌', - '' => '旎', - '' => '晝', - '' => '晚', - '' => '晤', - '' => '晨', - '' => '晦', - '' => '晞', - '' => '曹', - '' => '勗', - '' => '望', - '' => '梁', - '' => '梯', - '' => '梢', - '' => '梓', - '' => '梵', - '' => '桿', - '' => '桶', - '' => '梱', - '' => '梧', - '' => '梗', - '' => '械', - '' => '梃', - '' => '棄', - '' => '梭', - '' => '梆', - '' => '梅', - '' => '梔', - '' => '條', - '' => '梨', - '' => '梟', - '' => '梡', - '' => '梂', - '' => '欲', - '' => '殺', - '@' => '毫', - 'A' => '毬', - 'B' => '氫', - 'C' => '涎', - 'D' => '涼', - 'E' => '淳', - 'F' => '淙', - 'G' => '液', - 'H' => '淡', - 'I' => '淌', - 'J' => '淤', - 'K' => '添', - 'L' => '淺', - 'M' => '清', - 'N' => '淇', - 'O' => '淋', - 'P' => '涯', - 'Q' => '淑', - 'R' => '涮', - 'S' => '淞', - 'T' => '淹', - 'U' => '涸', - 'V' => '混', - 'W' => '淵', - 'X' => '淅', - 'Y' => '淒', - 'Z' => '渚', - '[' => '涵', - '\\' => '淚', - ']' => '淫', - '^' => '淘', - '_' => '淪', - '`' => '深', - 'a' => '淮', - 'b' => '淨', - 'c' => '淆', - 'd' => '淄', - 'e' => '涪', - 'f' => '淬', - 'g' => '涿', - 'h' => '淦', - 'i' => '烹', - 'j' => '焉', - 'k' => '焊', - 'l' => '烽', - 'm' => '烯', - 'n' => '爽', - 'o' => '牽', - 'p' => '犁', - 'q' => '猜', - 'r' => '猛', - 's' => '猖', - 't' => '猓', - 'u' => '猙', - 'v' => '率', - 'w' => '琅', - 'x' => '琊', - 'y' => '球', - 'z' => '理', - '{' => '現', - '|' => '琍', - '}' => '瓠', - '~' => '瓶', - '' => '瓷', - '' => '甜', - '' => '產', - '' => '略', - '' => '畦', - '' => '畢', - '' => '異', - '' => '疏', - '' => '痔', - '' => '痕', - '' => '疵', - '' => '痊', - '' => '痍', - '' => '皎', - '' => '盔', - '' => '盒', - '' => '盛', - '' => '眷', - '' => '眾', - '' => '眼', - '' => '眶', - '' => '眸', - '' => '眺', - '' => '硫', - '' => '硃', - '' => '硎', - '' => '祥', - '' => '票', - '' => '祭', - '' => '移', - '' => '窒', - '' => '窕', - '' => '笠', - '' => '笨', - '' => '笛', - '' => '第', - '' => '符', - '' => '笙', - '' => '笞', - '' => '笮', - '' => '粒', - '' => '粗', - '' => '粕', - '' => '絆', - '' => '絃', - '' => '統', - '' => '紮', - '' => '紹', - '' => '紼', - '' => '絀', - '' => '細', - '' => '紳', - '' => '組', - '' => '累', - '' => '終', - '' => '紲', - '' => '紱', - '' => '缽', - '' => '羞', - '' => '羚', - '' => '翌', - '' => '翎', - '' => '習', - '' => '耜', - '' => '聊', - '' => '聆', - '' => '脯', - '' => '脖', - '' => '脣', - '' => '脫', - '' => '脩', - '' => '脰', - '' => '脤', - '' => '舂', - '' => '舵', - '' => '舷', - '' => '舶', - '' => '船', - '' => '莎', - '' => '莞', - '' => '莘', - '' => '荸', - '' => '莢', - '' => '莖', - '' => '莽', - '' => '莫', - '' => '莒', - '' => '莊', - '' => '莓', - '' => '莉', - '' => '莠', - '' => '荷', - '' => '荻', - '' => '荼', - '@' => '莆', - 'A' => '莧', - 'B' => '處', - 'C' => '彪', - 'D' => '蛇', - 'E' => '蛀', - 'F' => '蚶', - 'G' => '蛄', - 'H' => '蚵', - 'I' => '蛆', - 'J' => '蛋', - 'K' => '蚱', - 'L' => '蚯', - 'M' => '蛉', - 'N' => '術', - 'O' => '袞', - 'P' => '袈', - 'Q' => '被', - 'R' => '袒', - 'S' => '袖', - 'T' => '袍', - 'U' => '袋', - 'V' => '覓', - 'W' => '規', - 'X' => '訪', - 'Y' => '訝', - 'Z' => '訣', - '[' => '訥', - '\\' => '許', - ']' => '設', - '^' => '訟', - '_' => '訛', - '`' => '訢', - 'a' => '豉', - 'b' => '豚', - 'c' => '販', - 'd' => '責', - 'e' => '貫', - 'f' => '貨', - 'g' => '貪', - 'h' => '貧', - 'i' => '赧', - 'j' => '赦', - 'k' => '趾', - 'l' => '趺', - 'm' => '軛', - 'n' => '軟', - 'o' => '這', - 'p' => '逍', - 'q' => '通', - 'r' => '逗', - 's' => '連', - 't' => '速', - 'u' => '逝', - 'v' => '逐', - 'w' => '逕', - 'x' => '逞', - 'y' => '造', - 'z' => '透', - '{' => '逢', - '|' => '逖', - '}' => '逛', - '~' => '途', - '' => '部', - '' => '郭', - '' => '都', - '' => '酗', - '' => '野', - '' => '釵', - '' => '釦', - '' => '釣', - '' => '釧', - '' => '釭', - '' => '釩', - '' => '閉', - '' => '陪', - '' => '陵', - '' => '陳', - '' => '陸', - '' => '陰', - '' => '陴', - '' => '陶', - '' => '陷', - '' => '陬', - '' => '雀', - '' => '雪', - '' => '雩', - '' => '章', - '' => '竟', - '' => '頂', - '' => '頃', - '' => '魚', - '' => '鳥', - '' => '鹵', - '' => '鹿', - '' => '麥', - '' => '麻', - '' => '傢', - '' => '傍', - '' => '傅', - '' => '備', - '' => '傑', - '' => '傀', - '' => '傖', - '' => '傘', - '' => '傚', - '' => '最', - '' => '凱', - '' => '割', - '' => '剴', - '' => '創', - '' => '剩', - '' => '勞', - '' => '勝', - '' => '勛', - '' => '博', - '' => '厥', - '' => '啻', - '' => '喀', - '' => '喧', - '' => '啼', - '' => '喊', - '' => '喝', - '' => '喘', - '' => '喂', - '' => '喜', - '' => '喪', - '' => '喔', - '' => '喇', - '' => '喋', - '' => '喃', - '' => '喳', - '' => '單', - '' => '喟', - '' => '唾', - '' => '喲', - '' => '喚', - '' => '喻', - '' => '喬', - '' => '喱', - '' => '啾', - '' => '喉', - '' => '喫', - '' => '喙', - '' => '圍', - '' => '堯', - '' => '堪', - '' => '場', - '' => '堤', - '' => '堰', - '' => '報', - '' => '堡', - '' => '堝', - '' => '堠', - '' => '壹', - '' => '壺', - '' => '奠', - '@' => '婷', - 'A' => '媚', - 'B' => '婿', - 'C' => '媒', - 'D' => '媛', - 'E' => '媧', - 'F' => '孳', - 'G' => '孱', - 'H' => '寒', - 'I' => '富', - 'J' => '寓', - 'K' => '寐', - 'L' => '尊', - 'M' => '尋', - 'N' => '就', - 'O' => '嵌', - 'P' => '嵐', - 'Q' => '崴', - 'R' => '嵇', - 'S' => '巽', - 'T' => '幅', - 'U' => '帽', - 'V' => '幀', - 'W' => '幃', - 'X' => '幾', - 'Y' => '廊', - 'Z' => '廁', - '[' => '廂', - '\\' => '廄', - ']' => '弼', - '^' => '彭', - '_' => '復', - '`' => '循', - 'a' => '徨', - 'b' => '惑', - 'c' => '惡', - 'd' => '悲', - 'e' => '悶', - 'f' => '惠', - 'g' => '愜', - 'h' => '愣', - 'i' => '惺', - 'j' => '愕', - 'k' => '惰', - 'l' => '惻', - 'm' => '惴', - 'n' => '慨', - 'o' => '惱', - 'p' => '愎', - 'q' => '惶', - 'r' => '愉', - 's' => '愀', - 't' => '愒', - 'u' => '戟', - 'v' => '扉', - 'w' => '掣', - 'x' => '掌', - 'y' => '描', - 'z' => '揀', - '{' => '揩', - '|' => '揉', - '}' => '揆', - '~' => '揍', - '' => '插', - '' => '揣', - '' => '提', - '' => '握', - '' => '揖', - '' => '揭', - '' => '揮', - '' => '捶', - '' => '援', - '' => '揪', - '' => '換', - '' => '摒', - '' => '揚', - '' => '揹', - '' => '敞', - '' => '敦', - '' => '敢', - '' => '散', - '' => '斑', - '' => '斐', - '' => '斯', - '' => '普', - '' => '晰', - '' => '晴', - '' => '晶', - '' => '景', - '' => '暑', - '' => '智', - '' => '晾', - '' => '晷', - '' => '曾', - '' => '替', - '' => '期', - '' => '朝', - '' => '棺', - '' => '棕', - '' => '棠', - '' => '棘', - '' => '棗', - '' => '椅', - '' => '棟', - '' => '棵', - '' => '森', - '' => '棧', - '' => '棹', - '' => '棒', - '' => '棲', - '' => '棣', - '' => '棋', - '' => '棍', - '' => '植', - '' => '椒', - '' => '椎', - '' => '棉', - '' => '棚', - '' => '楮', - '' => '棻', - '' => '款', - '' => '欺', - '' => '欽', - '' => '殘', - '' => '殖', - '' => '殼', - '' => '毯', - '' => '氮', - '' => '氯', - '' => '氬', - '' => '港', - '' => '游', - '' => '湔', - '' => '渡', - '' => '渲', - '' => '湧', - '' => '湊', - '' => '渠', - '' => '渥', - '' => '渣', - '' => '減', - '' => '湛', - '' => '湘', - '' => '渤', - '' => '湖', - '' => '湮', - '' => '渭', - '' => '渦', - '' => '湯', - '' => '渴', - '' => '湍', - '' => '渺', - '' => '測', - '' => '湃', - '' => '渝', - '' => '渾', - '' => '滋', - '@' => '溉', - 'A' => '渙', - 'B' => '湎', - 'C' => '湣', - 'D' => '湄', - 'E' => '湲', - 'F' => '湩', - 'G' => '湟', - 'H' => '焙', - 'I' => '焚', - 'J' => '焦', - 'K' => '焰', - 'L' => '無', - 'M' => '然', - 'N' => '煮', - 'O' => '焜', - 'P' => '牌', - 'Q' => '犄', - 'R' => '犀', - 'S' => '猶', - 'T' => '猥', - 'U' => '猴', - 'V' => '猩', - 'W' => '琺', - 'X' => '琪', - 'Y' => '琳', - 'Z' => '琢', - '[' => '琥', - '\\' => '琵', - ']' => '琶', - '^' => '琴', - '_' => '琯', - '`' => '琛', - 'a' => '琦', - 'b' => '琨', - 'c' => '甥', - 'd' => '甦', - 'e' => '畫', - 'f' => '番', - 'g' => '痢', - 'h' => '痛', - 'i' => '痣', - 'j' => '痙', - 'k' => '痘', - 'l' => '痞', - 'm' => '痠', - 'n' => '登', - 'o' => '發', - 'p' => '皖', - 'q' => '皓', - 'r' => '皴', - 's' => '盜', - 't' => '睏', - 'u' => '短', - 'v' => '硝', - 'w' => '硬', - 'x' => '硯', - 'y' => '稍', - 'z' => '稈', - '{' => '程', - '|' => '稅', - '}' => '稀', - '~' => '窘', - '' => '窗', - '' => '窖', - '' => '童', - '' => '竣', - '' => '等', - '' => '策', - '' => '筆', - '' => '筐', - '' => '筒', - '' => '答', - '' => '筍', - '' => '筋', - '' => '筏', - '' => '筑', - '' => '粟', - '' => '粥', - '' => '絞', - '' => '結', - '' => '絨', - '' => '絕', - '' => '紫', - '' => '絮', - '' => '絲', - '' => '絡', - '' => '給', - '' => '絢', - '' => '絰', - '' => '絳', - '' => '善', - '' => '翔', - '' => '翕', - '' => '耋', - '' => '聒', - '' => '肅', - '' => '腕', - '' => '腔', - '' => '腋', - '' => '腑', - '' => '腎', - '' => '脹', - '' => '腆', - '' => '脾', - '' => '腌', - '' => '腓', - '' => '腴', - '' => '舒', - '' => '舜', - '' => '菩', - '' => '萃', - '' => '菸', - '' => '萍', - '' => '菠', - '' => '菅', - '' => '萋', - '' => '菁', - '' => '華', - '' => '菱', - '' => '菴', - '' => '著', - '' => '萊', - '' => '菰', - '' => '萌', - '' => '菌', - '' => '菽', - '' => '菲', - '' => '菊', - '' => '萸', - '' => '萎', - '' => '萄', - '' => '菜', - '' => '萇', - '' => '菔', - '' => '菟', - '' => '虛', - '' => '蛟', - '' => '蛙', - '' => '蛭', - '' => '蛔', - '' => '蛛', - '' => '蛤', - '' => '蛐', - '' => '蛞', - '' => '街', - '' => '裁', - '' => '裂', - '' => '袱', - '' => '覃', - '' => '視', - '' => '註', - '' => '詠', - '' => '評', - '' => '詞', - '' => '証', - '' => '詁', - '@' => '詔', - 'A' => '詛', - 'B' => '詐', - 'C' => '詆', - 'D' => '訴', - 'E' => '診', - 'F' => '訶', - 'G' => '詖', - 'H' => '象', - 'I' => '貂', - 'J' => '貯', - 'K' => '貼', - 'L' => '貳', - 'M' => '貽', - 'N' => '賁', - 'O' => '費', - 'P' => '賀', - 'Q' => '貴', - 'R' => '買', - 'S' => '貶', - 'T' => '貿', - 'U' => '貸', - 'V' => '越', - 'W' => '超', - 'X' => '趁', - 'Y' => '跎', - 'Z' => '距', - '[' => '跋', - '\\' => '跚', - ']' => '跑', - '^' => '跌', - '_' => '跛', - '`' => '跆', - 'a' => '軻', - 'b' => '軸', - 'c' => '軼', - 'd' => '辜', - 'e' => '逮', - 'f' => '逵', - 'g' => '週', - 'h' => '逸', - 'i' => '進', - 'j' => '逶', - 'k' => '鄂', - 'l' => '郵', - 'm' => '鄉', - 'n' => '郾', - 'o' => '酣', - 'p' => '酥', - 'q' => '量', - 'r' => '鈔', - 's' => '鈕', - 't' => '鈣', - 'u' => '鈉', - 'v' => '鈞', - 'w' => '鈍', - 'x' => '鈐', - 'y' => '鈇', - 'z' => '鈑', - '{' => '閔', - '|' => '閏', - '}' => '開', - '~' => '閑', - '' => '間', - '' => '閒', - '' => '閎', - '' => '隊', - '' => '階', - '' => '隋', - '' => '陽', - '' => '隅', - '' => '隆', - '' => '隍', - '' => '陲', - '' => '隄', - '' => '雁', - '' => '雅', - '' => '雄', - '' => '集', - '' => '雇', - '' => '雯', - '' => '雲', - '' => '韌', - '' => '項', - '' => '順', - '' => '須', - '' => '飧', - '' => '飪', - '' => '飯', - '' => '飩', - '' => '飲', - '' => '飭', - '' => '馮', - '' => '馭', - '' => '黃', - '' => '黍', - '' => '黑', - '' => '亂', - '' => '傭', - '' => '債', - '' => '傲', - '' => '傳', - '' => '僅', - '' => '傾', - '' => '催', - '' => '傷', - '' => '傻', - '' => '傯', - '' => '僇', - '' => '剿', - '' => '剷', - '' => '剽', - '' => '募', - '' => '勦', - '' => '勤', - '' => '勢', - '' => '勣', - '' => '匯', - '' => '嗟', - '' => '嗨', - '' => '嗓', - '' => '嗦', - '' => '嗎', - '' => '嗜', - '' => '嗇', - '' => '嗑', - '' => '嗣', - '' => '嗤', - '' => '嗯', - '' => '嗚', - '' => '嗡', - '' => '嗅', - '' => '嗆', - '' => '嗥', - '' => '嗉', - '' => '園', - '' => '圓', - '' => '塞', - '' => '塑', - '' => '塘', - '' => '塗', - '' => '塚', - '' => '塔', - '' => '填', - '' => '塌', - '' => '塭', - '' => '塊', - '' => '塢', - '' => '塒', - '' => '塋', - '' => '奧', - '' => '嫁', - '' => '嫉', - '' => '嫌', - '' => '媾', - '' => '媽', - '' => '媼', - '@' => '媳', - 'A' => '嫂', - 'B' => '媲', - 'C' => '嵩', - 'D' => '嵯', - 'E' => '幌', - 'F' => '幹', - 'G' => '廉', - 'H' => '廈', - 'I' => '弒', - 'J' => '彙', - 'K' => '徬', - 'L' => '微', - 'M' => '愚', - 'N' => '意', - 'O' => '慈', - 'P' => '感', - 'Q' => '想', - 'R' => '愛', - 'S' => '惹', - 'T' => '愁', - 'U' => '愈', - 'V' => '慎', - 'W' => '慌', - 'X' => '慄', - 'Y' => '慍', - 'Z' => '愾', - '[' => '愴', - '\\' => '愧', - ']' => '愍', - '^' => '愆', - '_' => '愷', - '`' => '戡', - 'a' => '戢', - 'b' => '搓', - 'c' => '搾', - 'd' => '搞', - 'e' => '搪', - 'f' => '搭', - 'g' => '搽', - 'h' => '搬', - 'i' => '搏', - 'j' => '搜', - 'k' => '搔', - 'l' => '損', - 'm' => '搶', - 'n' => '搖', - 'o' => '搗', - 'p' => '搆', - 'q' => '敬', - 'r' => '斟', - 's' => '新', - 't' => '暗', - 'u' => '暉', - 'v' => '暇', - 'w' => '暈', - 'x' => '暖', - 'y' => '暄', - 'z' => '暘', - '{' => '暍', - '|' => '會', - '}' => '榔', - '~' => '業', - '' => '楚', - '' => '楷', - '' => '楠', - '' => '楔', - '' => '極', - '' => '椰', - '' => '概', - '' => '楊', - '' => '楨', - '' => '楫', - '' => '楞', - '' => '楓', - '' => '楹', - '' => '榆', - '' => '楝', - '' => '楣', - '' => '楛', - '' => '歇', - '' => '歲', - '' => '毀', - '' => '殿', - '' => '毓', - '' => '毽', - '' => '溢', - '' => '溯', - '' => '滓', - '' => '溶', - '' => '滂', - '' => '源', - '' => '溝', - '' => '滇', - '' => '滅', - '' => '溥', - '' => '溘', - '' => '溼', - '' => '溺', - '' => '溫', - '' => '滑', - '' => '準', - '' => '溜', - '' => '滄', - '' => '滔', - '' => '溪', - '' => '溧', - '' => '溴', - '' => '煎', - '' => '煙', - '' => '煩', - '' => '煤', - '' => '煉', - '' => '照', - '' => '煜', - '' => '煬', - '' => '煦', - '' => '煌', - '' => '煥', - '' => '煞', - '' => '煆', - '' => '煨', - '' => '煖', - '' => '爺', - '' => '牒', - '' => '猷', - '' => '獅', - '' => '猿', - '' => '猾', - '' => '瑯', - '' => '瑚', - '' => '瑕', - '' => '瑟', - '' => '瑞', - '' => '瑁', - '' => '琿', - '' => '瑙', - '' => '瑛', - '' => '瑜', - '' => '當', - '' => '畸', - '' => '瘀', - '' => '痰', - '' => '瘁', - '' => '痲', - '' => '痱', - '' => '痺', - '' => '痿', - '' => '痴', - '' => '痳', - '' => '盞', - '' => '盟', - '' => '睛', - '' => '睫', - '' => '睦', - '' => '睞', - '' => '督', - '@' => '睹', - 'A' => '睪', - 'B' => '睬', - 'C' => '睜', - 'D' => '睥', - 'E' => '睨', - 'F' => '睢', - 'G' => '矮', - 'H' => '碎', - 'I' => '碰', - 'J' => '碗', - 'K' => '碘', - 'L' => '碌', - 'M' => '碉', - 'N' => '硼', - 'O' => '碑', - 'P' => '碓', - 'Q' => '硿', - 'R' => '祺', - 'S' => '祿', - 'T' => '禁', - 'U' => '萬', - 'V' => '禽', - 'W' => '稜', - 'X' => '稚', - 'Y' => '稠', - 'Z' => '稔', - '[' => '稟', - '\\' => '稞', - ']' => '窟', - '^' => '窠', - '_' => '筷', - '`' => '節', - 'a' => '筠', - 'b' => '筮', - 'c' => '筧', - 'd' => '粱', - 'e' => '粳', - 'f' => '粵', - 'g' => '經', - 'h' => '絹', - 'i' => '綑', - 'j' => '綁', - 'k' => '綏', - 'l' => '絛', - 'm' => '置', - 'n' => '罩', - 'o' => '罪', - 'p' => '署', - 'q' => '義', - 'r' => '羨', - 's' => '群', - 't' => '聖', - 'u' => '聘', - 'v' => '肆', - 'w' => '肄', - 'x' => '腱', - 'y' => '腰', - 'z' => '腸', - '{' => '腥', - '|' => '腮', - '}' => '腳', - '~' => '腫', - '' => '腹', - '' => '腺', - '' => '腦', - '' => '舅', - '' => '艇', - '' => '蒂', - '' => '葷', - '' => '落', - '' => '萱', - '' => '葵', - '' => '葦', - '' => '葫', - '' => '葉', - '' => '葬', - '' => '葛', - '' => '萼', - '' => '萵', - '' => '葡', - '' => '董', - '' => '葩', - '' => '葭', - '' => '葆', - '' => '虞', - '' => '虜', - '' => '號', - '' => '蛹', - '' => '蜓', - '' => '蜈', - '' => '蜇', - '' => '蜀', - '' => '蛾', - '' => '蛻', - '' => '蜂', - '' => '蜃', - '' => '蜆', - '' => '蜊', - '' => '衙', - '' => '裟', - '' => '裔', - '' => '裙', - '' => '補', - '' => '裘', - '' => '裝', - '' => '裡', - '' => '裊', - '' => '裕', - '' => '裒', - '' => '覜', - '' => '解', - '' => '詫', - '' => '該', - '' => '詳', - '' => '試', - '' => '詩', - '' => '詰', - '' => '誇', - '' => '詼', - '' => '詣', - '' => '誠', - '' => '話', - '' => '誅', - '' => '詭', - '' => '詢', - '' => '詮', - '' => '詬', - '' => '詹', - '' => '詻', - '' => '訾', - '' => '詨', - '' => '豢', - '' => '貊', - '' => '貉', - '' => '賊', - '' => '資', - '' => '賈', - '' => '賄', - '' => '貲', - '' => '賃', - '' => '賂', - '' => '賅', - '' => '跡', - '' => '跟', - '' => '跨', - '' => '路', - '' => '跳', - '' => '跺', - '' => '跪', - '' => '跤', - '' => '跦', - '' => '躲', - '' => '較', - '' => '載', - '' => '軾', - '' => '輊', - '@' => '辟', - 'A' => '農', - 'B' => '運', - 'C' => '遊', - 'D' => '道', - 'E' => '遂', - 'F' => '達', - 'G' => '逼', - 'H' => '違', - 'I' => '遐', - 'J' => '遇', - 'K' => '遏', - 'L' => '過', - 'M' => '遍', - 'N' => '遑', - 'O' => '逾', - 'P' => '遁', - 'Q' => '鄒', - 'R' => '鄗', - 'S' => '酬', - 'T' => '酪', - 'U' => '酩', - 'V' => '釉', - 'W' => '鈷', - 'X' => '鉗', - 'Y' => '鈸', - 'Z' => '鈽', - '[' => '鉀', - '\\' => '鈾', - ']' => '鉛', - '^' => '鉋', - '_' => '鉤', - '`' => '鉑', - 'a' => '鈴', - 'b' => '鉉', - 'c' => '鉍', - 'd' => '鉅', - 'e' => '鈹', - 'f' => '鈿', - 'g' => '鉚', - 'h' => '閘', - 'i' => '隘', - 'j' => '隔', - 'k' => '隕', - 'l' => '雍', - 'm' => '雋', - 'n' => '雉', - 'o' => '雊', - 'p' => '雷', - 'q' => '電', - 'r' => '雹', - 's' => '零', - 't' => '靖', - 'u' => '靴', - 'v' => '靶', - 'w' => '預', - 'x' => '頑', - 'y' => '頓', - 'z' => '頊', - '{' => '頒', - '|' => '頌', - '}' => '飼', - '~' => '飴', - '' => '飽', - '' => '飾', - '' => '馳', - '' => '馱', - '' => '馴', - '' => '髡', - '' => '鳩', - '' => '麂', - '' => '鼎', - '' => '鼓', - '' => '鼠', - '' => '僧', - '' => '僮', - '' => '僥', - '' => '僖', - '' => '僭', - '' => '僚', - '' => '僕', - '' => '像', - '' => '僑', - '' => '僱', - '' => '僎', - '' => '僩', - '' => '兢', - '' => '凳', - '' => '劃', - '' => '劂', - '' => '匱', - '' => '厭', - '' => '嗾', - '' => '嘀', - '' => '嘛', - '' => '嘗', - '' => '嗽', - '' => '嘔', - '' => '嘆', - '' => '嘉', - '' => '嘍', - '' => '嘎', - '' => '嗷', - '' => '嘖', - '' => '嘟', - '' => '嘈', - '' => '嘐', - '' => '嗶', - '' => '團', - '' => '圖', - '' => '塵', - '' => '塾', - '' => '境', - '' => '墓', - '' => '墊', - '' => '塹', - '' => '墅', - '' => '塽', - '' => '壽', - '' => '夥', - '' => '夢', - '' => '夤', - '' => '奪', - '' => '奩', - '' => '嫡', - '' => '嫦', - '' => '嫩', - '' => '嫗', - '' => '嫖', - '' => '嫘', - '' => '嫣', - '' => '孵', - '' => '寞', - '' => '寧', - '' => '寡', - '' => '寥', - '' => '實', - '' => '寨', - '' => '寢', - '' => '寤', - '' => '察', - '' => '對', - '' => '屢', - '' => '嶄', - '' => '嶇', - '' => '幛', - '' => '幣', - '' => '幕', - '' => '幗', - '' => '幔', - '' => '廓', - '' => '廖', - '' => '弊', - '' => '彆', - '' => '彰', - '' => '徹', - '' => '慇', - '@' => '愿', - 'A' => '態', - 'B' => '慷', - 'C' => '慢', - 'D' => '慣', - 'E' => '慟', - 'F' => '慚', - 'G' => '慘', - 'H' => '慵', - 'I' => '截', - 'J' => '撇', - 'K' => '摘', - 'L' => '摔', - 'M' => '撤', - 'N' => '摸', - 'O' => '摟', - 'P' => '摺', - 'Q' => '摑', - 'R' => '摧', - 'S' => '搴', - 'T' => '摭', - 'U' => '摻', - 'V' => '敲', - 'W' => '斡', - 'X' => '旗', - 'Y' => '旖', - 'Z' => '暢', - '[' => '暨', - '\\' => '暝', - ']' => '榜', - '^' => '榨', - '_' => '榕', - '`' => '槁', - 'a' => '榮', - 'b' => '槓', - 'c' => '構', - 'd' => '榛', - 'e' => '榷', - 'f' => '榻', - 'g' => '榫', - 'h' => '榴', - 'i' => '槐', - 'j' => '槍', - 'k' => '榭', - 'l' => '槌', - 'm' => '榦', - 'n' => '槃', - 'o' => '榣', - 'p' => '歉', - 'q' => '歌', - 'r' => '氳', - 's' => '漳', - 't' => '演', - 'u' => '滾', - 'v' => '漓', - 'w' => '滴', - 'x' => '漩', - 'y' => '漾', - 'z' => '漠', - '{' => '漬', - '|' => '漏', - '}' => '漂', - '~' => '漢', - '' => '滿', - '' => '滯', - '' => '漆', - '' => '漱', - '' => '漸', - '' => '漲', - '' => '漣', - '' => '漕', - '' => '漫', - '' => '漯', - '' => '澈', - '' => '漪', - '' => '滬', - '' => '漁', - '' => '滲', - '' => '滌', - '' => '滷', - '' => '熔', - '' => '熙', - '' => '煽', - '' => '熊', - '' => '熄', - '' => '熒', - '' => '爾', - '' => '犒', - '' => '犖', - '' => '獄', - '' => '獐', - '' => '瑤', - '' => '瑣', - '' => '瑪', - '' => '瑰', - '' => '瑭', - '' => '甄', - '' => '疑', - '' => '瘧', - '' => '瘍', - '' => '瘋', - '' => '瘉', - '' => '瘓', - '' => '盡', - '' => '監', - '' => '瞄', - '' => '睽', - '' => '睿', - '' => '睡', - '' => '磁', - '' => '碟', - '' => '碧', - '' => '碳', - '' => '碩', - '' => '碣', - '' => '禎', - '' => '福', - '' => '禍', - '' => '種', - '' => '稱', - '' => '窪', - '' => '窩', - '' => '竭', - '' => '端', - '' => '管', - '' => '箕', - '' => '箋', - '' => '筵', - '' => '算', - '' => '箝', - '' => '箔', - '' => '箏', - '' => '箸', - '' => '箇', - '' => '箄', - '' => '粹', - '' => '粽', - '' => '精', - '' => '綻', - '' => '綰', - '' => '綜', - '' => '綽', - '' => '綾', - '' => '綠', - '' => '緊', - '' => '綴', - '' => '網', - '' => '綱', - '' => '綺', - '' => '綢', - '' => '綿', - '' => '綵', - '' => '綸', - '' => '維', - '' => '緒', - '' => '緇', - '' => '綬', - '@' => '罰', - 'A' => '翠', - 'B' => '翡', - 'C' => '翟', - 'D' => '聞', - 'E' => '聚', - 'F' => '肇', - 'G' => '腐', - 'H' => '膀', - 'I' => '膏', - 'J' => '膈', - 'K' => '膊', - 'L' => '腿', - 'M' => '膂', - 'N' => '臧', - 'O' => '臺', - 'P' => '與', - 'Q' => '舔', - 'R' => '舞', - 'S' => '艋', - 'T' => '蓉', - 'U' => '蒿', - 'V' => '蓆', - 'W' => '蓄', - 'X' => '蒙', - 'Y' => '蒞', - 'Z' => '蒲', - '[' => '蒜', - '\\' => '蓋', - ']' => '蒸', - '^' => '蓀', - '_' => '蓓', - '`' => '蒐', - 'a' => '蒼', - 'b' => '蓑', - 'c' => '蓊', - 'd' => '蜿', - 'e' => '蜜', - 'f' => '蜻', - 'g' => '蜢', - 'h' => '蜥', - 'i' => '蜴', - 'j' => '蜘', - 'k' => '蝕', - 'l' => '蜷', - 'm' => '蜩', - 'n' => '裳', - 'o' => '褂', - 'p' => '裴', - 'q' => '裹', - 'r' => '裸', - 's' => '製', - 't' => '裨', - 'u' => '褚', - 'v' => '裯', - 'w' => '誦', - 'x' => '誌', - 'y' => '語', - 'z' => '誣', - '{' => '認', - '|' => '誡', - '}' => '誓', - '~' => '誤', - '' => '說', - '' => '誥', - '' => '誨', - '' => '誘', - '' => '誑', - '' => '誚', - '' => '誧', - '' => '豪', - '' => '貍', - '' => '貌', - '' => '賓', - '' => '賑', - '' => '賒', - '' => '赫', - '' => '趙', - '' => '趕', - '' => '跼', - '' => '輔', - '' => '輒', - '' => '輕', - '' => '輓', - '' => '辣', - '' => '遠', - '' => '遘', - '' => '遜', - '' => '遣', - '' => '遙', - '' => '遞', - '' => '遢', - '' => '遝', - '' => '遛', - '' => '鄙', - '' => '鄘', - '' => '鄞', - '' => '酵', - '' => '酸', - '' => '酷', - '' => '酴', - '' => '鉸', - '' => '銀', - '' => '銅', - '' => '銘', - '' => '銖', - '' => '鉻', - '' => '銓', - '' => '銜', - '' => '銨', - '' => '鉼', - '' => '銑', - '' => '閡', - '' => '閨', - '' => '閩', - '' => '閣', - '' => '閥', - '' => '閤', - '' => '隙', - '' => '障', - '' => '際', - '' => '雌', - '' => '雒', - '' => '需', - '' => '靼', - '' => '鞅', - '' => '韶', - '' => '頗', - '' => '領', - '' => '颯', - '' => '颱', - '' => '餃', - '' => '餅', - '' => '餌', - '' => '餉', - '' => '駁', - '' => '骯', - '' => '骰', - '' => '髦', - '' => '魁', - '' => '魂', - '' => '鳴', - '' => '鳶', - '' => '鳳', - '' => '麼', - '' => '鼻', - '' => '齊', - '' => '億', - '' => '儀', - '' => '僻', - '' => '僵', - '' => '價', - '' => '儂', - '' => '儈', - '' => '儉', - '' => '儅', - '' => '凜', - '@' => '劇', - 'A' => '劈', - 'B' => '劉', - 'C' => '劍', - 'D' => '劊', - 'E' => '勰', - 'F' => '厲', - 'G' => '嘮', - 'H' => '嘻', - 'I' => '嘹', - 'J' => '嘲', - 'K' => '嘿', - 'L' => '嘴', - 'M' => '嘩', - 'N' => '噓', - 'O' => '噎', - 'P' => '噗', - 'Q' => '噴', - 'R' => '嘶', - 'S' => '嘯', - 'T' => '嘰', - 'U' => '墀', - 'V' => '墟', - 'W' => '增', - 'X' => '墳', - 'Y' => '墜', - 'Z' => '墮', - '[' => '墩', - '\\' => '墦', - ']' => '奭', - '^' => '嬉', - '_' => '嫻', - '`' => '嬋', - 'a' => '嫵', - 'b' => '嬌', - 'c' => '嬈', - 'd' => '寮', - 'e' => '寬', - 'f' => '審', - 'g' => '寫', - 'h' => '層', - 'i' => '履', - 'j' => '嶝', - 'k' => '嶔', - 'l' => '幢', - 'm' => '幟', - 'n' => '幡', - 'o' => '廢', - 'p' => '廚', - 'q' => '廟', - 'r' => '廝', - 's' => '廣', - 't' => '廠', - 'u' => '彈', - 'v' => '影', - 'w' => '德', - 'x' => '徵', - 'y' => '慶', - 'z' => '慧', - '{' => '慮', - '|' => '慝', - '}' => '慕', - '~' => '憂', - '' => '慼', - '' => '慰', - '' => '慫', - '' => '慾', - '' => '憧', - '' => '憐', - '' => '憫', - '' => '憎', - '' => '憬', - '' => '憚', - '' => '憤', - '' => '憔', - '' => '憮', - '' => '戮', - '' => '摩', - '' => '摯', - '' => '摹', - '' => '撞', - '' => '撲', - '' => '撈', - '' => '撐', - '' => '撰', - '' => '撥', - '' => '撓', - '' => '撕', - '' => '撩', - '' => '撒', - '' => '撮', - '' => '播', - '' => '撫', - '' => '撚', - '' => '撬', - '' => '撙', - '' => '撢', - '' => '撳', - '' => '敵', - '' => '敷', - '' => '數', - '' => '暮', - '' => '暫', - '' => '暴', - '' => '暱', - '' => '樣', - '' => '樟', - '' => '槨', - '' => '樁', - '' => '樞', - '' => '標', - '' => '槽', - '' => '模', - '' => '樓', - '' => '樊', - '' => '槳', - '' => '樂', - '' => '樅', - '' => '槭', - '' => '樑', - '' => '歐', - '' => '歎', - '' => '殤', - '' => '毅', - '' => '毆', - '' => '漿', - '' => '潼', - '' => '澄', - '' => '潑', - '' => '潦', - '' => '潔', - '' => '澆', - '' => '潭', - '' => '潛', - '' => '潸', - '' => '潮', - '' => '澎', - '' => '潺', - '' => '潰', - '' => '潤', - '' => '澗', - '' => '潘', - '' => '滕', - '' => '潯', - '' => '潠', - '' => '潟', - '' => '熟', - '' => '熬', - '' => '熱', - '' => '熨', - '' => '牖', - '' => '犛', - '' => '獎', - '' => '獗', - '' => '瑩', - '' => '璋', - '' => '璃', - '@' => '瑾', - 'A' => '璀', - 'B' => '畿', - 'C' => '瘠', - 'D' => '瘩', - 'E' => '瘟', - 'F' => '瘤', - 'G' => '瘦', - 'H' => '瘡', - 'I' => '瘢', - 'J' => '皚', - 'K' => '皺', - 'L' => '盤', - 'M' => '瞎', - 'N' => '瞇', - 'O' => '瞌', - 'P' => '瞑', - 'Q' => '瞋', - 'R' => '磋', - 'S' => '磅', - 'T' => '確', - 'U' => '磊', - 'V' => '碾', - 'W' => '磕', - 'X' => '碼', - 'Y' => '磐', - 'Z' => '稿', - '[' => '稼', - '\\' => '穀', - ']' => '稽', - '^' => '稷', - '_' => '稻', - '`' => '窯', - 'a' => '窮', - 'b' => '箭', - 'c' => '箱', - 'd' => '範', - 'e' => '箴', - 'f' => '篆', - 'g' => '篇', - 'h' => '篁', - 'i' => '箠', - 'j' => '篌', - 'k' => '糊', - 'l' => '締', - 'm' => '練', - 'n' => '緯', - 'o' => '緻', - 'p' => '緘', - 'q' => '緬', - 'r' => '緝', - 's' => '編', - 't' => '緣', - 'u' => '線', - 'v' => '緞', - 'w' => '緩', - 'x' => '綞', - 'y' => '緙', - 'z' => '緲', - '{' => '緹', - '|' => '罵', - '}' => '罷', - '~' => '羯', - '' => '翩', - '' => '耦', - '' => '膛', - '' => '膜', - '' => '膝', - '' => '膠', - '' => '膚', - '' => '膘', - '' => '蔗', - '' => '蔽', - '' => '蔚', - '' => '蓮', - '' => '蔬', - '' => '蔭', - '' => '蔓', - '' => '蔑', - '' => '蔣', - '' => '蔡', - '' => '蔔', - '' => '蓬', - '' => '蔥', - '' => '蓿', - '' => '蔆', - '' => '螂', - '' => '蝴', - '' => '蝶', - '' => '蝠', - '' => '蝦', - '' => '蝸', - '' => '蝨', - '' => '蝙', - '' => '蝗', - '' => '蝌', - '' => '蝓', - '' => '衛', - '' => '衝', - '' => '褐', - '' => '複', - '' => '褒', - '' => '褓', - '' => '褕', - '' => '褊', - '' => '誼', - '' => '諒', - '' => '談', - '' => '諄', - '' => '誕', - '' => '請', - '' => '諸', - '' => '課', - '' => '諉', - '' => '諂', - '' => '調', - '' => '誰', - '' => '論', - '' => '諍', - '' => '誶', - '' => '誹', - '' => '諛', - '' => '豌', - '' => '豎', - '' => '豬', - '' => '賠', - '' => '賞', - '' => '賦', - '' => '賤', - '' => '賬', - '' => '賭', - '' => '賢', - '' => '賣', - '' => '賜', - '' => '質', - '' => '賡', - '' => '赭', - '' => '趟', - '' => '趣', - '' => '踫', - '' => '踐', - '' => '踝', - '' => '踢', - '' => '踏', - '' => '踩', - '' => '踟', - '' => '踡', - '' => '踞', - '' => '躺', - '' => '輝', - '' => '輛', - '' => '輟', - '' => '輩', - '' => '輦', - '' => '輪', - '' => '輜', - '' => '輞', - '@' => '輥', - 'A' => '適', - 'B' => '遮', - 'C' => '遨', - 'D' => '遭', - 'E' => '遷', - 'F' => '鄰', - 'G' => '鄭', - 'H' => '鄧', - 'I' => '鄱', - 'J' => '醇', - 'K' => '醉', - 'L' => '醋', - 'M' => '醃', - 'N' => '鋅', - 'O' => '銻', - 'P' => '銷', - 'Q' => '鋪', - 'R' => '銬', - 'S' => '鋤', - 'T' => '鋁', - 'U' => '銳', - 'V' => '銼', - 'W' => '鋒', - 'X' => '鋇', - 'Y' => '鋰', - 'Z' => '銲', - '[' => '閭', - '\\' => '閱', - ']' => '霄', - '^' => '霆', - '_' => '震', - '`' => '霉', - 'a' => '靠', - 'b' => '鞍', - 'c' => '鞋', - 'd' => '鞏', - 'e' => '頡', - 'f' => '頫', - 'g' => '頜', - 'h' => '颳', - 'i' => '養', - 'j' => '餓', - 'k' => '餒', - 'l' => '餘', - 'm' => '駝', - 'n' => '駐', - 'o' => '駟', - 'p' => '駛', - 'q' => '駑', - 'r' => '駕', - 's' => '駒', - 't' => '駙', - 'u' => '骷', - 'v' => '髮', - 'w' => '髯', - 'x' => '鬧', - 'y' => '魅', - 'z' => '魄', - '{' => '魷', - '|' => '魯', - '}' => '鴆', - '~' => '鴉', - '' => '鴃', - '' => '麩', - '' => '麾', - '' => '黎', - '' => '墨', - '' => '齒', - '' => '儒', - '' => '儘', - '' => '儔', - '' => '儐', - '' => '儕', - '' => '冀', - '' => '冪', - '' => '凝', - '' => '劑', - '' => '劓', - '' => '勳', - '' => '噙', - '' => '噫', - '' => '噹', - '' => '噩', - '' => '噤', - '' => '噸', - '' => '噪', - '' => '器', - '' => '噥', - '' => '噱', - '' => '噯', - '' => '噬', - '' => '噢', - '' => '噶', - '' => '壁', - '' => '墾', - '' => '壇', - '' => '壅', - '' => '奮', - '' => '嬝', - '' => '嬴', - '' => '學', - '' => '寰', - '' => '導', - '' => '彊', - '' => '憲', - '' => '憑', - '' => '憩', - '' => '憊', - '' => '懍', - '' => '憶', - '' => '憾', - '' => '懊', - '' => '懈', - '' => '戰', - '' => '擅', - '' => '擁', - '' => '擋', - '' => '撻', - '' => '撼', - '' => '據', - '' => '擄', - '' => '擇', - '' => '擂', - '' => '操', - '' => '撿', - '' => '擒', - '' => '擔', - '' => '撾', - '' => '整', - '' => '曆', - '' => '曉', - '' => '暹', - '' => '曄', - '' => '曇', - '' => '暸', - '' => '樽', - '' => '樸', - '' => '樺', - '' => '橙', - '' => '橫', - '' => '橘', - '' => '樹', - '' => '橄', - '' => '橢', - '' => '橡', - '' => '橋', - '' => '橇', - '' => '樵', - '' => '機', - '' => '橈', - '' => '歙', - '' => '歷', - '' => '氅', - '' => '濂', - '' => '澱', - '' => '澡', - '@' => '濃', - 'A' => '澤', - 'B' => '濁', - 'C' => '澧', - 'D' => '澳', - 'E' => '激', - 'F' => '澹', - 'G' => '澶', - 'H' => '澦', - 'I' => '澠', - 'J' => '澴', - 'K' => '熾', - 'L' => '燉', - 'M' => '燐', - 'N' => '燒', - 'O' => '燈', - 'P' => '燕', - 'Q' => '熹', - 'R' => '燎', - 'S' => '燙', - 'T' => '燜', - 'U' => '燃', - 'V' => '燄', - 'W' => '獨', - 'X' => '璜', - 'Y' => '璣', - 'Z' => '璘', - '[' => '璟', - '\\' => '璞', - ']' => '瓢', - '^' => '甌', - '_' => '甍', - '`' => '瘴', - 'a' => '瘸', - 'b' => '瘺', - 'c' => '盧', - 'd' => '盥', - 'e' => '瞠', - 'f' => '瞞', - 'g' => '瞟', - 'h' => '瞥', - 'i' => '磨', - 'j' => '磚', - 'k' => '磬', - 'l' => '磧', - 'm' => '禦', - 'n' => '積', - 'o' => '穎', - 'p' => '穆', - 'q' => '穌', - 'r' => '穋', - 's' => '窺', - 't' => '篙', - 'u' => '簑', - 'v' => '築', - 'w' => '篤', - 'x' => '篛', - 'y' => '篡', - 'z' => '篩', - '{' => '篦', - '|' => '糕', - '}' => '糖', - '~' => '縊', - '' => '縑', - '' => '縈', - '' => '縛', - '' => '縣', - '' => '縞', - '' => '縝', - '' => '縉', - '' => '縐', - '' => '罹', - '' => '羲', - '' => '翰', - '' => '翱', - '' => '翮', - '' => '耨', - '' => '膳', - '' => '膩', - '' => '膨', - '' => '臻', - '' => '興', - '' => '艘', - '' => '艙', - '' => '蕊', - '' => '蕙', - '' => '蕈', - '' => '蕨', - '' => '蕩', - '' => '蕃', - '' => '蕉', - '' => '蕭', - '' => '蕪', - '' => '蕞', - '' => '螃', - '' => '螟', - '' => '螞', - '' => '螢', - '' => '融', - '' => '衡', - '' => '褪', - '' => '褲', - '' => '褥', - '' => '褫', - '' => '褡', - '' => '親', - '' => '覦', - '' => '諦', - '' => '諺', - '' => '諫', - '' => '諱', - '' => '謀', - '' => '諜', - '' => '諧', - '' => '諮', - '' => '諾', - '' => '謁', - '' => '謂', - '' => '諷', - '' => '諭', - '' => '諳', - '' => '諶', - '' => '諼', - '' => '豫', - '' => '豭', - '' => '貓', - '' => '賴', - '' => '蹄', - '' => '踱', - '' => '踴', - '' => '蹂', - '' => '踹', - '' => '踵', - '' => '輻', - '' => '輯', - '' => '輸', - '' => '輳', - '' => '辨', - '' => '辦', - '' => '遵', - '' => '遴', - '' => '選', - '' => '遲', - '' => '遼', - '' => '遺', - '' => '鄴', - '' => '醒', - '' => '錠', - '' => '錶', - '' => '鋸', - '' => '錳', - '' => '錯', - '' => '錢', - '' => '鋼', - '' => '錫', - '' => '錄', - '' => '錚', - '@' => '錐', - 'A' => '錦', - 'B' => '錡', - 'C' => '錕', - 'D' => '錮', - 'E' => '錙', - 'F' => '閻', - 'G' => '隧', - 'H' => '隨', - 'I' => '險', - 'J' => '雕', - 'K' => '霎', - 'L' => '霑', - 'M' => '霖', - 'N' => '霍', - 'O' => '霓', - 'P' => '霏', - 'Q' => '靛', - 'R' => '靜', - 'S' => '靦', - 'T' => '鞘', - 'U' => '頰', - 'V' => '頸', - 'W' => '頻', - 'X' => '頷', - 'Y' => '頭', - 'Z' => '頹', - '[' => '頤', - '\\' => '餐', - ']' => '館', - '^' => '餞', - '_' => '餛', - '`' => '餡', - 'a' => '餚', - 'b' => '駭', - 'c' => '駢', - 'd' => '駱', - 'e' => '骸', - 'f' => '骼', - 'g' => '髻', - 'h' => '髭', - 'i' => '鬨', - 'j' => '鮑', - 'k' => '鴕', - 'l' => '鴣', - 'm' => '鴦', - 'n' => '鴨', - 'o' => '鴒', - 'p' => '鴛', - 'q' => '默', - 'r' => '黔', - 's' => '龍', - 't' => '龜', - 'u' => '優', - 'v' => '償', - 'w' => '儡', - 'x' => '儲', - 'y' => '勵', - 'z' => '嚎', - '{' => '嚀', - '|' => '嚐', - '}' => '嚅', - '~' => '嚇', - '' => '嚏', - '' => '壕', - '' => '壓', - '' => '壑', - '' => '壎', - '' => '嬰', - '' => '嬪', - '' => '嬤', - '' => '孺', - '' => '尷', - '' => '屨', - '' => '嶼', - '' => '嶺', - '' => '嶽', - '' => '嶸', - '' => '幫', - '' => '彌', - '' => '徽', - '' => '應', - '' => '懂', - '' => '懇', - '' => '懦', - '' => '懋', - '' => '戲', - '' => '戴', - '' => '擎', - '' => '擊', - '' => '擘', - '' => '擠', - '' => '擰', - '' => '擦', - '' => '擬', - '' => '擱', - '' => '擢', - '' => '擭', - '' => '斂', - '' => '斃', - '' => '曙', - '' => '曖', - '' => '檀', - '' => '檔', - '' => '檄', - '' => '檢', - '' => '檜', - '' => '櫛', - '' => '檣', - '' => '橾', - '' => '檗', - '' => '檐', - '' => '檠', - '' => '歜', - '' => '殮', - '' => '毚', - '' => '氈', - '' => '濘', - '' => '濱', - '' => '濟', - '' => '濠', - '' => '濛', - '' => '濤', - '' => '濫', - '' => '濯', - '' => '澀', - '' => '濬', - '' => '濡', - '' => '濩', - '' => '濕', - '' => '濮', - '' => '濰', - '' => '燧', - '' => '營', - '' => '燮', - '' => '燦', - '' => '燥', - '' => '燭', - '' => '燬', - '' => '燴', - '' => '燠', - '' => '爵', - '' => '牆', - '' => '獰', - '' => '獲', - '' => '璩', - '' => '環', - '' => '璦', - '' => '璨', - '' => '癆', - '' => '療', - '' => '癌', - '' => '盪', - '' => '瞳', - '' => '瞪', - '' => '瞰', - '' => '瞬', - '@' => '瞧', - 'A' => '瞭', - 'B' => '矯', - 'C' => '磷', - 'D' => '磺', - 'E' => '磴', - 'F' => '磯', - 'G' => '礁', - 'H' => '禧', - 'I' => '禪', - 'J' => '穗', - 'K' => '窿', - 'L' => '簇', - 'M' => '簍', - 'N' => '篾', - 'O' => '篷', - 'P' => '簌', - 'Q' => '篠', - 'R' => '糠', - 'S' => '糜', - 'T' => '糞', - 'U' => '糢', - 'V' => '糟', - 'W' => '糙', - 'X' => '糝', - 'Y' => '縮', - 'Z' => '績', - '[' => '繆', - '\\' => '縷', - ']' => '縲', - '^' => '繃', - '_' => '縫', - '`' => '總', - 'a' => '縱', - 'b' => '繅', - 'c' => '繁', - 'd' => '縴', - 'e' => '縹', - 'f' => '繈', - 'g' => '縵', - 'h' => '縿', - 'i' => '縯', - 'j' => '罄', - 'k' => '翳', - 'l' => '翼', - 'm' => '聱', - 'n' => '聲', - 'o' => '聰', - 'p' => '聯', - 'q' => '聳', - 'r' => '臆', - 's' => '臃', - 't' => '膺', - 'u' => '臂', - 'v' => '臀', - 'w' => '膿', - 'x' => '膽', - 'y' => '臉', - 'z' => '膾', - '{' => '臨', - '|' => '舉', - '}' => '艱', - '~' => '薪', - '' => '薄', - '' => '蕾', - '' => '薜', - '' => '薑', - '' => '薔', - '' => '薯', - '' => '薛', - '' => '薇', - '' => '薨', - '' => '薊', - '' => '虧', - '' => '蟀', - '' => '蟑', - '' => '螳', - '' => '蟒', - '' => '蟆', - '' => '螫', - '' => '螻', - '' => '螺', - '' => '蟈', - '' => '蟋', - '' => '褻', - '' => '褶', - '' => '襄', - '' => '褸', - '' => '褽', - '' => '覬', - '' => '謎', - '' => '謗', - '' => '謙', - '' => '講', - '' => '謊', - '' => '謠', - '' => '謝', - '' => '謄', - '' => '謐', - '' => '豁', - '' => '谿', - '' => '豳', - '' => '賺', - '' => '賽', - '' => '購', - '' => '賸', - '' => '賻', - '' => '趨', - '' => '蹉', - '' => '蹋', - '' => '蹈', - '' => '蹊', - '' => '轄', - '' => '輾', - '' => '轂', - '' => '轅', - '' => '輿', - '' => '避', - '' => '遽', - '' => '還', - '' => '邁', - '' => '邂', - '' => '邀', - '' => '鄹', - '' => '醣', - '' => '醞', - '' => '醜', - '' => '鍍', - '' => '鎂', - '' => '錨', - '' => '鍵', - '' => '鍊', - '' => '鍥', - '' => '鍋', - '' => '錘', - '' => '鍾', - '' => '鍬', - '' => '鍛', - '' => '鍰', - '' => '鍚', - '' => '鍔', - '' => '闊', - '' => '闋', - '' => '闌', - '' => '闈', - '' => '闆', - '' => '隱', - '' => '隸', - '' => '雖', - '' => '霜', - '' => '霞', - '' => '鞠', - '' => '韓', - '' => '顆', - '' => '颶', - '' => '餵', - '' => '騁', - '@' => '駿', - 'A' => '鮮', - 'B' => '鮫', - 'C' => '鮪', - 'D' => '鮭', - 'E' => '鴻', - 'F' => '鴿', - 'G' => '麋', - 'H' => '黏', - 'I' => '點', - 'J' => '黜', - 'K' => '黝', - 'L' => '黛', - 'M' => '鼾', - 'N' => '齋', - 'O' => '叢', - 'P' => '嚕', - 'Q' => '嚮', - 'R' => '壙', - 'S' => '壘', - 'T' => '嬸', - 'U' => '彝', - 'V' => '懣', - 'W' => '戳', - 'X' => '擴', - 'Y' => '擲', - 'Z' => '擾', - '[' => '攆', - '\\' => '擺', - ']' => '擻', - '^' => '擷', - '_' => '斷', - '`' => '曜', - 'a' => '朦', - 'b' => '檳', - 'c' => '檬', - 'd' => '櫃', - 'e' => '檻', - 'f' => '檸', - 'g' => '櫂', - 'h' => '檮', - 'i' => '檯', - 'j' => '歟', - 'k' => '歸', - 'l' => '殯', - 'm' => '瀉', - 'n' => '瀋', - 'o' => '濾', - 'p' => '瀆', - 'q' => '濺', - 'r' => '瀑', - 's' => '瀏', - 't' => '燻', - 'u' => '燼', - 'v' => '燾', - 'w' => '燸', - 'x' => '獷', - 'y' => '獵', - 'z' => '璧', - '{' => '璿', - '|' => '甕', - '}' => '癖', - '~' => '癘', - '¡' => '癒', - '¢' => '瞽', - '£' => '瞿', - '¤' => '瞻', - '¥' => '瞼', - '¦' => '礎', - '§' => '禮', - '¨' => '穡', - '©' => '穢', - 'ª' => '穠', - '«' => '竄', - '¬' => '竅', - '­' => '簫', - '®' => '簧', - '¯' => '簪', - '°' => '簞', - '±' => '簣', - '²' => '簡', - '³' => '糧', - '´' => '織', - 'µ' => '繕', - '¶' => '繞', - '·' => '繚', - '¸' => '繡', - '¹' => '繒', - 'º' => '繙', - '»' => '罈', - '¼' => '翹', - '½' => '翻', - '¾' => '職', - '¿' => '聶', - '' => '臍', - '' => '臏', - '' => '舊', - '' => '藏', - '' => '薩', - '' => '藍', - '' => '藐', - '' => '藉', - '' => '薰', - '' => '薺', - '' => '薹', - '' => '薦', - '' => '蟯', - '' => '蟬', - '' => '蟲', - '' => '蟠', - '' => '覆', - '' => '覲', - '' => '觴', - '' => '謨', - '' => '謹', - '' => '謬', - '' => '謫', - '' => '豐', - '' => '贅', - '' => '蹙', - '' => '蹣', - '' => '蹦', - '' => '蹤', - '' => '蹟', - '' => '蹕', - '' => '軀', - '' => '轉', - '' => '轍', - '' => '邇', - '' => '邃', - '' => '邈', - '' => '醫', - '' => '醬', - '' => '釐', - '' => '鎔', - '' => '鎊', - '' => '鎖', - '' => '鎢', - '' => '鎳', - '' => '鎮', - '' => '鎬', - '' => '鎰', - '' => '鎘', - '' => '鎚', - '' => '鎗', - '' => '闔', - '' => '闖', - '' => '闐', - '' => '闕', - '' => '離', - '' => '雜', - '' => '雙', - '' => '雛', - '' => '雞', - '' => '霤', - '' => '鞣', - '' => '鞦', - '@' => '鞭', - 'A' => '韹', - 'B' => '額', - 'C' => '顏', - 'D' => '題', - 'E' => '顎', - 'F' => '顓', - 'G' => '颺', - 'H' => '餾', - 'I' => '餿', - 'J' => '餽', - 'K' => '餮', - 'L' => '馥', - 'M' => '騎', - 'N' => '髁', - 'O' => '鬃', - 'P' => '鬆', - 'Q' => '魏', - 'R' => '魎', - 'S' => '魍', - 'T' => '鯊', - 'U' => '鯉', - 'V' => '鯽', - 'W' => '鯈', - 'X' => '鯀', - 'Y' => '鵑', - 'Z' => '鵝', - '[' => '鵠', - '\\' => '黠', - ']' => '鼕', - '^' => '鼬', - '_' => '儳', - '`' => '嚥', - 'a' => '壞', - 'b' => '壟', - 'c' => '壢', - 'd' => '寵', - 'e' => '龐', - 'f' => '廬', - 'g' => '懲', - 'h' => '懷', - 'i' => '懶', - 'j' => '懵', - 'k' => '攀', - 'l' => '攏', - 'm' => '曠', - 'n' => '曝', - 'o' => '櫥', - 'p' => '櫝', - 'q' => '櫚', - 'r' => '櫓', - 's' => '瀛', - 't' => '瀟', - 'u' => '瀨', - 'v' => '瀚', - 'w' => '瀝', - 'x' => '瀕', - 'y' => '瀘', - 'z' => '爆', - '{' => '爍', - '|' => '牘', - '}' => '犢', - '~' => '獸', - 'á' => '獺', - 'â' => '璽', - 'ã' => '瓊', - 'ä' => '瓣', - 'å' => '疇', - 'æ' => '疆', - 'ç' => '癟', - 'è' => '癡', - 'é' => '矇', - 'ê' => '礙', - 'ë' => '禱', - 'ì' => '穫', - 'í' => '穩', - 'î' => '簾', - 'ï' => '簿', - 'ð' => '簸', - 'ñ' => '簽', - 'ò' => '簷', - 'ó' => '籀', - 'ô' => '繫', - 'õ' => '繭', - 'ö' => '繹', - '÷' => '繩', - 'ø' => '繪', - 'ù' => '羅', - 'ú' => '繳', - 'û' => '羶', - 'ü' => '羹', - 'ý' => '羸', - 'þ' => '臘', - 'ÿ' => '藩', - '' => '藝', - '' => '藪', - '' => '藕', - '' => '藤', - '' => '藥', - '' => '藷', - '' => '蟻', - '' => '蠅', - '' => '蠍', - '' => '蟹', - '' => '蟾', - '' => '襠', - '' => '襟', - '' => '襖', - '' => '襞', - '' => '譁', - '' => '譜', - '' => '識', - '' => '證', - '' => '譚', - '' => '譎', - '' => '譏', - '' => '譆', - '' => '譙', - '' => '贈', - '' => '贊', - '' => '蹼', - '' => '蹲', - '' => '躇', - '' => '蹶', - '' => '蹬', - '' => '蹺', - '' => '蹴', - '' => '轔', - '' => '轎', - '' => '辭', - '' => '邊', - '' => '邋', - '' => '醱', - '' => '醮', - '' => '鏡', - '' => '鏑', - '' => '鏟', - '' => '鏃', - '' => '鏈', - '' => '鏜', - '' => '鏝', - '' => '鏖', - '' => '鏢', - '' => '鏍', - '' => '鏘', - '' => '鏤', - '' => '鏗', - '' => '鏨', - '' => '關', - '' => '隴', - '' => '難', - '' => '霪', - '' => '霧', - '' => '靡', - '' => '韜', - '' => '韻', - '' => '類', - '@' => '願', - 'A' => '顛', - 'B' => '颼', - 'C' => '饅', - 'D' => '饉', - 'E' => '騖', - 'F' => '騙', - 'G' => '鬍', - 'H' => '鯨', - 'I' => '鯧', - 'J' => '鯖', - 'K' => '鯛', - 'L' => '鶉', - 'M' => '鵡', - 'N' => '鵲', - 'O' => '鵪', - 'P' => '鵬', - 'Q' => '麒', - 'R' => '麗', - 'S' => '麓', - 'T' => '麴', - 'U' => '勸', - 'V' => '嚨', - 'W' => '嚷', - 'X' => '嚶', - 'Y' => '嚴', - 'Z' => '嚼', - '[' => '壤', - '\\' => '孀', - ']' => '孃', - '^' => '孽', - '_' => '寶', - '`' => '巉', - 'a' => '懸', - 'b' => '懺', - 'c' => '攘', - 'd' => '攔', - 'e' => '攙', - 'f' => '曦', - 'g' => '朧', - 'h' => '櫬', - 'i' => '瀾', - 'j' => '瀰', - 'k' => '瀲', - 'l' => '爐', - 'm' => '獻', - 'n' => '瓏', - 'o' => '癢', - 'p' => '癥', - 'q' => '礦', - 'r' => '礪', - 's' => '礬', - 't' => '礫', - 'u' => '竇', - 'v' => '競', - 'w' => '籌', - 'x' => '籃', - 'y' => '籍', - 'z' => '糯', - '{' => '糰', - '|' => '辮', - '}' => '繽', - '~' => '繼', - 'ġ' => '纂', - 'Ģ' => '罌', - 'ģ' => '耀', - 'Ĥ' => '臚', - 'ĥ' => '艦', - 'Ħ' => '藻', - 'ħ' => '藹', - 'Ĩ' => '蘑', - 'ĩ' => '藺', - 'Ī' => '蘆', - 'ī' => '蘋', - 'Ĭ' => '蘇', - 'ĭ' => '蘊', - 'Į' => '蠔', - 'į' => '蠕', - 'İ' => '襤', - 'ı' => '覺', - 'IJ' => '觸', - 'ij' => '議', - 'Ĵ' => '譬', - 'ĵ' => '警', - 'Ķ' => '譯', - 'ķ' => '譟', - 'ĸ' => '譫', - 'Ĺ' => '贏', - 'ĺ' => '贍', - 'Ļ' => '躉', - 'ļ' => '躁', - 'Ľ' => '躅', - 'ľ' => '躂', - 'Ŀ' => '醴', - '' => '釋', - '' => '鐘', - '' => '鐃', - '' => '鏽', - '' => '闡', - '' => '霰', - '' => '飄', - '' => '饒', - '' => '饑', - '' => '馨', - '' => '騫', - '' => '騰', - '' => '騷', - '' => '騵', - '' => '鰓', - '' => '鰍', - '' => '鹹', - '' => '麵', - '' => '黨', - '' => '鼯', - '' => '齟', - '' => '齣', - '' => '齡', - '' => '儷', - '' => '儸', - '' => '囁', - '' => '囀', - '' => '囂', - '' => '夔', - '' => '屬', - '' => '巍', - '' => '懼', - '' => '懾', - '' => '攝', - '' => '攜', - '' => '斕', - '' => '曩', - '' => '櫻', - '' => '欄', - '' => '櫺', - '' => '殲', - '' => '灌', - '' => '爛', - '' => '犧', - '' => '瓖', - '' => '瓔', - '' => '癩', - '' => '矓', - '' => '籐', - '' => '纏', - '' => '續', - '' => '羼', - '' => '蘗', - '' => '蘭', - '' => '蘚', - '' => '蠣', - '' => '蠢', - '' => '蠡', - '' => '蠟', - '' => '襪', - '' => '襬', - '' => '覽', - '' => '譴', - '@' => '護', - 'A' => '譽', - 'B' => '贓', - 'C' => '躊', - 'D' => '躍', - 'E' => '躋', - 'F' => '轟', - 'G' => '辯', - 'H' => '醺', - 'I' => '鐮', - 'J' => '鐳', - 'K' => '鐵', - 'L' => '鐺', - 'M' => '鐸', - 'N' => '鐲', - 'O' => '鐫', - 'P' => '闢', - 'Q' => '霸', - 'R' => '霹', - 'S' => '露', - 'T' => '響', - 'U' => '顧', - 'V' => '顥', - 'W' => '饗', - 'X' => '驅', - 'Y' => '驃', - 'Z' => '驀', - '[' => '騾', - '\\' => '髏', - ']' => '魔', - '^' => '魑', - '_' => '鰭', - '`' => '鰥', - 'a' => '鶯', - 'b' => '鶴', - 'c' => '鷂', - 'd' => '鶸', - 'e' => '麝', - 'f' => '黯', - 'g' => '鼙', - 'h' => '齜', - 'i' => '齦', - 'j' => '齧', - 'k' => '儼', - 'l' => '儻', - 'm' => '囈', - 'n' => '囊', - 'o' => '囉', - 'p' => '孿', - 'q' => '巔', - 'r' => '巒', - 's' => '彎', - 't' => '懿', - 'u' => '攤', - 'v' => '權', - 'w' => '歡', - 'x' => '灑', - 'y' => '灘', - 'z' => '玀', - '{' => '瓤', - '|' => '疊', - '}' => '癮', - '~' => '癬', - 'š' => '禳', - 'Ţ' => '籠', - 'ţ' => '籟', - 'Ť' => '聾', - 'ť' => '聽', - 'Ŧ' => '臟', - 'ŧ' => '襲', - 'Ũ' => '襯', - 'ũ' => '觼', - 'Ū' => '讀', - 'ū' => '贖', - 'Ŭ' => '贗', - 'ŭ' => '躑', - 'Ů' => '躓', - 'ů' => '轡', - 'Ű' => '酈', - 'ű' => '鑄', - 'Ų' => '鑑', - 'ų' => '鑒', - 'Ŵ' => '霽', - 'ŵ' => '霾', - 'Ŷ' => '韃', - 'ŷ' => '韁', - 'Ÿ' => '顫', - 'Ź' => '饕', - 'ź' => '驕', - 'Ż' => '驍', - 'ż' => '髒', - 'Ž' => '鬚', - 'ž' => '鱉', - 'ſ' => '鰱', - '' => '鰾', - '' => '鰻', - '' => '鷓', - '' => '鷗', - '' => '鼴', - '' => '齬', - '' => '齪', - '' => '龔', - '' => '囌', - '' => '巖', - '' => '戀', - '' => '攣', - '' => '攫', - '' => '攪', - '' => '曬', - '' => '欐', - '' => '瓚', - '' => '竊', - '' => '籤', - '' => '籣', - '' => '籥', - '' => '纓', - '' => '纖', - '' => '纔', - '' => '臢', - '' => '蘸', - '' => '蘿', - '' => '蠱', - '' => '變', - '' => '邐', - '' => '邏', - '' => '鑣', - '' => '鑠', - '' => '鑤', - '' => '靨', - '' => '顯', - '' => '饜', - '' => '驚', - '' => '驛', - '' => '驗', - '' => '髓', - '' => '體', - '' => '髑', - '' => '鱔', - '' => '鱗', - '' => '鱖', - '' => '鷥', - '' => '麟', - '' => '黴', - '' => '囑', - '' => '壩', - '' => '攬', - '' => '灞', - '' => '癱', - '' => '癲', - '' => '矗', - '' => '罐', - '' => '羈', - '' => '蠶', - '' => '蠹', - '' => '衢', - '' => '讓', - '' => '讒', - '@' => '讖', - 'A' => '艷', - 'B' => '贛', - 'C' => '釀', - 'D' => '鑪', - 'E' => '靂', - 'F' => '靈', - 'G' => '靄', - 'H' => '韆', - 'I' => '顰', - 'J' => '驟', - 'K' => '鬢', - 'L' => '魘', - 'M' => '鱟', - 'N' => '鷹', - 'O' => '鷺', - 'P' => '鹼', - 'Q' => '鹽', - 'R' => '鼇', - 'S' => '齷', - 'T' => '齲', - 'U' => '廳', - 'V' => '欖', - 'W' => '灣', - 'X' => '籬', - 'Y' => '籮', - 'Z' => '蠻', - '[' => '觀', - '\\' => '躡', - ']' => '釁', - '^' => '鑲', - '_' => '鑰', - '`' => '顱', - 'a' => '饞', - 'b' => '髖', - 'c' => '鬣', - 'd' => '黌', - 'e' => '灤', - 'f' => '矚', - 'g' => '讚', - 'h' => '鑷', - 'i' => '韉', - 'j' => '驢', - 'k' => '驥', - 'l' => '纜', - 'm' => '讜', - 'n' => '躪', - 'o' => '釅', - 'p' => '鑽', - 'q' => '鑾', - 'r' => '鑼', - 's' => '鱷', - 't' => '鱸', - 'u' => '黷', - 'v' => '豔', - 'w' => '鑿', - 'x' => '鸚', - 'y' => '爨', - 'z' => '驪', - '{' => '鬱', - '|' => '鸛', - '}' => '鸞', - '~' => '籲', - 'ơ' => 'ヾ', - 'Ƣ' => 'ゝ', - 'ƣ' => 'ゞ', - 'Ƥ' => '々', - 'ƥ' => 'ぁ', - 'Ʀ' => 'あ', - 'Ƨ' => 'ぃ', - 'ƨ' => 'い', - 'Ʃ' => 'ぅ', - 'ƪ' => 'う', - 'ƫ' => 'ぇ', - 'Ƭ' => 'え', - 'ƭ' => 'ぉ', - 'Ʈ' => 'お', - 'Ư' => 'か', - 'ư' => 'が', - 'Ʊ' => 'き', - 'Ʋ' => 'ぎ', - 'Ƴ' => 'く', - 'ƴ' => 'ぐ', - 'Ƶ' => 'け', - 'ƶ' => 'げ', - 'Ʒ' => 'こ', - 'Ƹ' => 'ご', - 'ƹ' => 'さ', - 'ƺ' => 'ざ', - 'ƻ' => 'し', - 'Ƽ' => 'じ', - 'ƽ' => 'す', - 'ƾ' => 'ず', - 'ƿ' => 'せ', - '' => 'ぜ', - '' => 'そ', - '' => 'ぞ', - '' => 'た', - '' => 'だ', - '' => 'ち', - '' => 'ぢ', - '' => 'っ', - '' => 'つ', - '' => 'づ', - '' => 'て', - '' => 'で', - '' => 'と', - '' => 'ど', - '' => 'な', - '' => 'に', - '' => 'ぬ', - '' => 'ね', - '' => 'の', - '' => 'は', - '' => 'ば', - '' => 'ぱ', - '' => 'ひ', - '' => 'び', - '' => 'ぴ', - '' => 'ふ', - '' => 'ぶ', - '' => 'ぷ', - '' => 'へ', - '' => 'べ', - '' => 'ぺ', - '' => 'ほ', - '' => 'ぼ', - '' => 'ぽ', - '' => 'ま', - '' => 'み', - '' => 'む', - '' => 'め', - '' => 'も', - '' => 'ゃ', - '' => 'や', - '' => 'ゅ', - '' => 'ゆ', - '' => 'ょ', - '' => 'よ', - '' => 'ら', - '' => 'り', - '' => 'る', - '' => 'れ', - '' => 'ろ', - '' => 'ゎ', - '' => 'わ', - '' => 'ゐ', - '' => 'ゑ', - '' => 'を', - '' => 'ん', - '' => 'ァ', - '' => 'ア', - '' => 'ィ', - '' => 'イ', - '' => 'ゥ', - '' => 'ウ', - '' => 'ェ', - '@' => 'エ', - 'A' => 'ォ', - 'B' => 'オ', - 'C' => 'カ', - 'D' => 'ガ', - 'E' => 'キ', - 'F' => 'ギ', - 'G' => 'ク', - 'H' => 'グ', - 'I' => 'ケ', - 'J' => 'ゲ', - 'K' => 'コ', - 'L' => 'ゴ', - 'M' => 'サ', - 'N' => 'ザ', - 'O' => 'シ', - 'P' => 'ジ', - 'Q' => 'ス', - 'R' => 'ズ', - 'S' => 'セ', - 'T' => 'ゼ', - 'U' => 'ソ', - 'V' => 'ゾ', - 'W' => 'タ', - 'X' => 'ダ', - 'Y' => 'チ', - 'Z' => 'ヂ', - '[' => 'ッ', - '\\' => 'ツ', - ']' => 'ヅ', - '^' => 'テ', - '_' => 'デ', - '`' => 'ト', - 'a' => 'ド', - 'b' => 'ナ', - 'c' => 'ニ', - 'd' => 'ヌ', - 'e' => 'ネ', - 'f' => 'ノ', - 'g' => 'ハ', - 'h' => 'バ', - 'i' => 'パ', - 'j' => 'ヒ', - 'k' => 'ビ', - 'l' => 'ピ', - 'm' => 'フ', - 'n' => 'ブ', - 'o' => 'プ', - 'p' => 'ヘ', - 'q' => 'ベ', - 'r' => 'ペ', - 's' => 'ホ', - 't' => 'ボ', - 'u' => 'ポ', - 'v' => 'マ', - 'w' => 'ミ', - 'x' => 'ム', - 'y' => 'メ', - 'z' => 'モ', - '{' => 'ャ', - '|' => 'ヤ', - '}' => 'ュ', - '~' => 'ユ', - 'ǡ' => 'ョ', - 'Ǣ' => 'ヨ', - 'ǣ' => 'ラ', - 'Ǥ' => 'リ', - 'ǥ' => 'ル', - 'Ǧ' => 'レ', - 'ǧ' => 'ロ', - 'Ǩ' => 'ヮ', - 'ǩ' => 'ワ', - 'Ǫ' => 'ヰ', - 'ǫ' => 'ヱ', - 'Ǭ' => 'ヲ', - 'ǭ' => 'ン', - 'Ǯ' => 'ヴ', - 'ǯ' => 'ヵ', - 'ǰ' => 'ヶ', - 'DZ' => 'Д', - 'Dz' => 'Е', - 'dz' => 'Ё', - 'Ǵ' => 'Ж', - 'ǵ' => 'З', - 'Ƕ' => 'И', - 'Ƿ' => 'Й', - 'Ǹ' => 'К', - 'ǹ' => 'Л', - 'Ǻ' => 'М', - 'ǻ' => 'У', - 'Ǽ' => 'Ф', - 'ǽ' => 'Х', - 'Ǿ' => 'Ц', - 'ǿ' => 'Ч', - '' => 'Ш', - '' => 'Щ', - '' => 'Ъ', - '' => 'Ы', - '' => 'Ь', - '' => 'Э', - '' => 'Ю', - '' => 'Я', - '' => 'а', - '' => 'б', - '' => 'в', - '' => 'г', - '' => 'д', - '' => 'е', - '' => 'ё', - '' => 'ж', - '' => 'з', - '' => 'и', - '' => 'й', - '' => 'к', - '' => 'л', - '' => 'м', - '' => 'н', - '' => 'о', - '' => 'п', - '' => 'р', - '' => 'с', - '' => 'т', - '' => 'у', - '' => 'ф', - '' => 'х', - '' => 'ц', - '' => 'ч', - '' => 'ш', - '' => 'щ', - '' => 'ъ', - '' => 'ы', - '' => 'ь', - '' => 'э', - '' => 'ю', - '' => 'я', - '' => '①', - '' => '②', - '' => '③', - '' => '④', - '' => '⑤', - '' => '⑥', - '' => '⑦', - '' => '⑧', - '' => '⑨', - '' => '⑩', - '' => '⑴', - '' => '⑵', - '' => '⑶', - '' => '⑷', - '' => '⑸', - '' => '⑹', - '' => '⑺', - '' => '⑻', - '' => '⑼', - '' => '⑽', - '@' => '乂', - 'A' => '乜', - 'B' => '凵', - 'C' => '匚', - 'D' => '厂', - 'E' => '万', - 'F' => '丌', - 'G' => '乇', - 'H' => '亍', - 'I' => '囗', - 'J' => '兀', - 'K' => '屮', - 'L' => '彳', - 'M' => '丏', - 'N' => '冇', - 'O' => '与', - 'P' => '丮', - 'Q' => '亓', - 'R' => '仂', - 'S' => '仉', - 'T' => '仈', - 'U' => '冘', - 'V' => '勼', - 'W' => '卬', - 'X' => '厹', - 'Y' => '圠', - 'Z' => '夃', - '[' => '夬', - '\\' => '尐', - ']' => '巿', - '^' => '旡', - '_' => '殳', - '`' => '毌', - 'a' => '气', - 'b' => '爿', - 'c' => '丱', - 'd' => '丼', - 'e' => '仨', - 'f' => '仜', - 'g' => '仩', - 'h' => '仡', - 'i' => '仝', - 'j' => '仚', - 'k' => '刌', - 'l' => '匜', - 'm' => '卌', - 'n' => '圢', - 'o' => '圣', - 'p' => '夗', - 'q' => '夯', - 'r' => '宁', - 's' => '宄', - 't' => '尒', - 'u' => '尻', - 'v' => '屴', - 'w' => '屳', - 'x' => '帄', - 'y' => '庀', - 'z' => '庂', - '{' => '忉', - '|' => '戉', - '}' => '扐', - '~' => '氕', - 'ɡ' => '氶', - 'ɢ' => '汃', - 'ɣ' => '氿', - 'ɤ' => '氻', - 'ɥ' => '犮', - 'ɦ' => '犰', - 'ɧ' => '玊', - 'ɨ' => '禸', - 'ɩ' => '肊', - 'ɪ' => '阞', - 'ɫ' => '伎', - 'ɬ' => '优', - 'ɭ' => '伬', - 'ɮ' => '仵', - 'ɯ' => '伔', - 'ɰ' => '仱', - 'ɱ' => '伀', - 'ɲ' => '价', - 'ɳ' => '伈', - 'ɴ' => '伝', - 'ɵ' => '伂', - 'ɶ' => '伅', - 'ɷ' => '伢', - 'ɸ' => '伓', - 'ɹ' => '伄', - 'ɺ' => '仴', - 'ɻ' => '伒', - 'ɼ' => '冱', - 'ɽ' => '刓', - 'ɾ' => '刉', - 'ɿ' => '刐', - '' => '劦', - '' => '匢', - '' => '匟', - '' => '卍', - '' => '厊', - '' => '吇', - '' => '囡', - '' => '囟', - '' => '圮', - '' => '圪', - '' => '圴', - '' => '夼', - '' => '妀', - '' => '奼', - '' => '妅', - '' => '奻', - '' => '奾', - '' => '奷', - '' => '奿', - '' => '孖', - '' => '尕', - '' => '尥', - '' => '屼', - '' => '屺', - '' => '屻', - '' => '屾', - '' => '巟', - '' => '幵', - '' => '庄', - '' => '异', - '' => '弚', - '' => '彴', - '' => '忕', - '' => '忔', - '' => '忏', - '' => '扜', - '' => '扞', - '' => '扤', - '' => '扡', - '' => '扦', - '' => '扢', - '' => '扙', - '' => '扠', - '' => '扚', - '' => '扥', - '' => '旯', - '' => '旮', - '' => '朾', - '' => '朹', - '' => '朸', - '' => '朻', - '' => '机', - '' => '朿', - '' => '朼', - '' => '朳', - '' => '氘', - '' => '汆', - '' => '汒', - '' => '汜', - '' => '汏', - '' => '汊', - '' => '汔', - '' => '汋', - '@' => '汌', - 'A' => '灱', - 'B' => '牞', - 'C' => '犴', - 'D' => '犵', - 'E' => '玎', - 'F' => '甪', - 'G' => '癿', - 'H' => '穵', - 'I' => '网', - 'J' => '艸', - 'K' => '艼', - 'L' => '芀', - 'M' => '艽', - 'N' => '艿', - 'O' => '虍', - 'P' => '襾', - 'Q' => '邙', - 'R' => '邗', - 'S' => '邘', - 'T' => '邛', - 'U' => '邔', - 'V' => '阢', - 'W' => '阤', - 'X' => '阠', - 'Y' => '阣', - 'Z' => '佖', - '[' => '伻', - '\\' => '佢', - ']' => '佉', - '^' => '体', - '_' => '佤', - '`' => '伾', - 'a' => '佧', - 'b' => '佒', - 'c' => '佟', - 'd' => '佁', - 'e' => '佘', - 'f' => '伭', - 'g' => '伳', - 'h' => '伿', - 'i' => '佡', - 'j' => '冏', - 'k' => '冹', - 'l' => '刜', - 'm' => '刞', - 'n' => '刡', - 'o' => '劭', - 'p' => '劮', - 'q' => '匉', - 'r' => '卣', - 's' => '卲', - 't' => '厎', - 'u' => '厏', - 'v' => '吰', - 'w' => '吷', - 'x' => '吪', - 'y' => '呔', - 'z' => '呅', - '{' => '吙', - '|' => '吜', - '}' => '吥', - '~' => '吘', - 'ʡ' => '吽', - 'ʢ' => '呏', - 'ʣ' => '呁', - 'ʤ' => '吨', - 'ʥ' => '吤', - 'ʦ' => '呇', - 'ʧ' => '囮', - 'ʨ' => '囧', - 'ʩ' => '囥', - 'ʪ' => '坁', - 'ʫ' => '坅', - 'ʬ' => '坌', - 'ʭ' => '坉', - 'ʮ' => '坋', - 'ʯ' => '坒', - 'ʰ' => '夆', - 'ʱ' => '奀', - 'ʲ' => '妦', - 'ʳ' => '妘', - 'ʴ' => '妠', - 'ʵ' => '妗', - 'ʶ' => '妎', - 'ʷ' => '妢', - 'ʸ' => '妐', - 'ʹ' => '妏', - 'ʺ' => '妧', - 'ʻ' => '妡', - 'ʼ' => '宎', - 'ʽ' => '宒', - 'ʾ' => '尨', - 'ʿ' => '尪', - '' => '岍', - '' => '岏', - '' => '岈', - '' => '岋', - '' => '岉', - '' => '岒', - '' => '岊', - '' => '岆', - '' => '岓', - '' => '岕', - '' => '巠', - '' => '帊', - '' => '帎', - '' => '庋', - '' => '庉', - '' => '庌', - '' => '庈', - '' => '庍', - '' => '弅', - '' => '弝', - '' => '彸', - '' => '彶', - '' => '忒', - '' => '忑', - '' => '忐', - '' => '忭', - '' => '忨', - '' => '忮', - '' => '忳', - '' => '忡', - '' => '忤', - '' => '忣', - '' => '忺', - '' => '忯', - '' => '忷', - '' => '忻', - '' => '怀', - '' => '忴', - '' => '戺', - '' => '抃', - '' => '抌', - '' => '抎', - '' => '抏', - '' => '抔', - '' => '抇', - '' => '扱', - '' => '扻', - '' => '扺', - '' => '扰', - '' => '抁', - '' => '抈', - '' => '扷', - '' => '扽', - '' => '扲', - '' => '扴', - '' => '攷', - '' => '旰', - '' => '旴', - '' => '旳', - '' => '旲', - '' => '旵', - '' => '杅', - '' => '杇', - '@' => '杙', - 'A' => '杕', - 'B' => '杌', - 'C' => '杈', - 'D' => '杝', - 'E' => '杍', - 'F' => '杚', - 'G' => '杋', - 'H' => '毐', - 'I' => '氙', - 'J' => '氚', - 'K' => '汸', - 'L' => '汧', - 'M' => '汫', - 'N' => '沄', - 'O' => '沋', - 'P' => '沏', - 'Q' => '汱', - 'R' => '汯', - 'S' => '汩', - 'T' => '沚', - 'U' => '汭', - 'V' => '沇', - 'W' => '沕', - 'X' => '沜', - 'Y' => '汦', - 'Z' => '汳', - '[' => '汥', - '\\' => '汻', - ']' => '沎', - '^' => '灴', - '_' => '灺', - '`' => '牣', - 'a' => '犿', - 'b' => '犽', - 'c' => '狃', - 'd' => '狆', - 'e' => '狁', - 'f' => '犺', - 'g' => '狅', - 'h' => '玕', - 'i' => '玗', - 'j' => '玓', - 'k' => '玔', - 'l' => '玒', - 'm' => '町', - 'n' => '甹', - 'o' => '疔', - 'p' => '疕', - 'q' => '皁', - 'r' => '礽', - 's' => '耴', - 't' => '肕', - 'u' => '肙', - 'v' => '肐', - 'w' => '肒', - 'x' => '肜', - 'y' => '芐', - 'z' => '芏', - '{' => '芅', - '|' => '芎', - '}' => '芑', - '~' => '芓', - 'ˡ' => '芊', - 'ˢ' => '芃', - 'ˣ' => '芄', - 'ˤ' => '豸', - '˥' => '迉', - '˦' => '辿', - '˧' => '邟', - '˨' => '邡', - '˩' => '邥', - '˪' => '邞', - '˫' => '邧', - 'ˬ' => '邠', - '˭' => '阰', - 'ˮ' => '阨', - '˯' => '阯', - '˰' => '阭', - '˱' => '丳', - '˲' => '侘', - '˳' => '佼', - '˴' => '侅', - '˵' => '佽', - '˶' => '侀', - '˷' => '侇', - '˸' => '佶', - '˹' => '佴', - '˺' => '侉', - '˻' => '侄', - '˼' => '佷', - '˽' => '佌', - '˾' => '侗', - '˿' => '佪', - '' => '侚', - '' => '佹', - '' => '侁', - '' => '佸', - '' => '侐', - '' => '侜', - '' => '侔', - '' => '侞', - '' => '侒', - '' => '侂', - '' => '侕', - '' => '佫', - '' => '佮', - '' => '冞', - '' => '冼', - '' => '冾', - '' => '刵', - '' => '刲', - '' => '刳', - '' => '剆', - '' => '刱', - '' => '劼', - '' => '匊', - '' => '匋', - '' => '匼', - '' => '厒', - '' => '厔', - '' => '咇', - '' => '呿', - '' => '咁', - '' => '咑', - '' => '咂', - '' => '咈', - '' => '呫', - '' => '呺', - '' => '呾', - '' => '呥', - '' => '呬', - '' => '呴', - '' => '呦', - '' => '咍', - '' => '呯', - '' => '呡', - '' => '呠', - '' => '咘', - '' => '呣', - '' => '呧', - '' => '呤', - '' => '囷', - '' => '囹', - '' => '坯', - '' => '坲', - '' => '坭', - '' => '坫', - '' => '坱', - '' => '坰', - '' => '坶', - '' => '垀', - '' => '坵', - '' => '坻', - '' => '坳', - '' => '坴', - '' => '坢', - '@' => '坨', - 'A' => '坽', - 'B' => '夌', - 'C' => '奅', - 'D' => '妵', - 'E' => '妺', - 'F' => '姏', - 'G' => '姎', - 'H' => '妲', - 'I' => '姌', - 'J' => '姁', - 'K' => '妶', - 'L' => '妼', - 'M' => '姃', - 'N' => '姖', - 'O' => '妱', - 'P' => '妽', - 'Q' => '姀', - 'R' => '姈', - 'S' => '妴', - 'T' => '姇', - 'U' => '孢', - 'V' => '孥', - 'W' => '宓', - 'X' => '宕', - 'Y' => '屄', - 'Z' => '屇', - '[' => '岮', - '\\' => '岤', - ']' => '岠', - '^' => '岵', - '_' => '岯', - '`' => '岨', - 'a' => '岬', - 'b' => '岟', - 'c' => '岣', - 'd' => '岭', - 'e' => '岢', - 'f' => '岪', - 'g' => '岧', - 'h' => '岝', - 'i' => '岥', - 'j' => '岶', - 'k' => '岰', - 'l' => '岦', - 'm' => '帗', - 'n' => '帔', - 'o' => '帙', - 'p' => '弨', - 'q' => '弢', - 'r' => '弣', - 's' => '弤', - 't' => '彔', - 'u' => '徂', - 'v' => '彾', - 'w' => '彽', - 'x' => '忞', - 'y' => '忥', - 'z' => '怭', - '{' => '怦', - '|' => '怙', - '}' => '怲', - '~' => '怋', - '̡' => '怴', - '̢' => '怊', - '̣' => '怗', - '̤' => '怳', - '̥' => '怚', - '̦' => '怞', - '̧' => '怬', - '̨' => '怢', - '̩' => '怍', - '̪' => '怐', - '̫' => '怮', - '̬' => '怓', - '̭' => '怑', - '̮' => '怌', - '̯' => '怉', - '̰' => '怜', - '̱' => '戔', - '̲' => '戽', - '̳' => '抭', - '̴' => '抴', - '̵' => '拑', - '̶' => '抾', - '̷' => '抪', - '̸' => '抶', - '̹' => '拊', - '̺' => '抮', - '̻' => '抳', - '̼' => '抯', - '̽' => '抻', - '̾' => '抩', - '̿' => '抰', - '' => '抸', - '' => '攽', - '' => '斨', - '' => '斻', - '' => '昉', - '' => '旼', - '' => '昄', - '' => '昒', - '' => '昈', - '' => '旻', - '' => '昃', - '' => '昋', - '' => '昍', - '' => '昅', - '' => '旽', - '' => '昑', - '' => '昐', - '' => '曶', - '' => '朊', - '' => '枅', - '' => '杬', - '' => '枎', - '' => '枒', - '' => '杶', - '' => '杻', - '' => '枘', - '' => '枆', - '' => '构', - '' => '杴', - '' => '枍', - '' => '枌', - '' => '杺', - '' => '枟', - '' => '枑', - '' => '枙', - '' => '枃', - '' => '杽', - '' => '极', - '' => '杸', - '' => '杹', - '' => '枔', - '' => '欥', - '' => '殀', - '' => '歾', - '' => '毞', - '' => '氝', - '' => '沓', - '' => '泬', - '' => '泫', - '' => '泮', - '' => '泙', - '' => '沶', - '' => '泔', - '' => '沭', - '' => '泧', - '' => '沷', - '' => '泐', - '' => '泂', - '' => '沺', - '' => '泃', - '' => '泆', - '' => '泭', - '' => '泲', - '@' => '泒', - 'A' => '泝', - 'B' => '沴', - 'C' => '沊', - 'D' => '沝', - 'E' => '沀', - 'F' => '泞', - 'G' => '泀', - 'H' => '洰', - 'I' => '泍', - 'J' => '泇', - 'K' => '沰', - 'L' => '泹', - 'M' => '泏', - 'N' => '泩', - 'O' => '泑', - 'P' => '炔', - 'Q' => '炘', - 'R' => '炅', - 'S' => '炓', - 'T' => '炆', - 'U' => '炄', - 'V' => '炑', - 'W' => '炖', - 'X' => '炂', - 'Y' => '炚', - 'Z' => '炃', - '[' => '牪', - '\\' => '狖', - ']' => '狋', - '^' => '狘', - '_' => '狉', - '`' => '狜', - 'a' => '狒', - 'b' => '狔', - 'c' => '狚', - 'd' => '狌', - 'e' => '狑', - 'f' => '玤', - 'g' => '玡', - 'h' => '玭', - 'i' => '玦', - 'j' => '玢', - 'k' => '玠', - 'l' => '玬', - 'm' => '玝', - 'n' => '瓝', - 'o' => '瓨', - 'p' => '甿', - 'q' => '畀', - 'r' => '甾', - 's' => '疌', - 't' => '疘', - 'u' => '皯', - 'v' => '盳', - 'w' => '盱', - 'x' => '盰', - 'y' => '盵', - 'z' => '矸', - '{' => '矼', - '|' => '矹', - '}' => '矻', - '~' => '矺', - '͡' => '矷', - '͢' => '祂', - 'ͣ' => '礿', - 'ͤ' => '秅', - 'ͥ' => '穸', - 'ͦ' => '穻', - 'ͧ' => '竻', - 'ͨ' => '籵', - 'ͩ' => '糽', - 'ͪ' => '耵', - 'ͫ' => '肏', - 'ͬ' => '肮', - 'ͭ' => '肣', - 'ͮ' => '肸', - 'ͯ' => '肵', - 'Ͱ' => '肭', - 'ͱ' => '舠', - 'Ͳ' => '芠', - 'ͳ' => '苀', - 'ʹ' => '芫', - '͵' => '芚', - 'Ͷ' => '芘', - 'ͷ' => '芛', - '͸' => '芵', - '͹' => '芧', - 'ͺ' => '芮', - 'ͻ' => '芼', - 'ͼ' => '芞', - 'ͽ' => '芺', - ';' => '芴', - 'Ϳ' => '芨', - '' => '芡', - '' => '芩', - '' => '苂', - '' => '芤', - '' => '苃', - '' => '芶', - '' => '芢', - '' => '虰', - '' => '虯', - '' => '虭', - '' => '虮', - '' => '豖', - '' => '迒', - '' => '迋', - '' => '迓', - '' => '迍', - '' => '迖', - '' => '迕', - '' => '迗', - '' => '邲', - '' => '邴', - '' => '邯', - '' => '邳', - '' => '邰', - '' => '阹', - '' => '阽', - '' => '阼', - '' => '阺', - '' => '陃', - '' => '俍', - '' => '俅', - '' => '俓', - '' => '侲', - '' => '俉', - '' => '俋', - '' => '俁', - '' => '俔', - '' => '俜', - '' => '俙', - '' => '侻', - '' => '侳', - '' => '俛', - '' => '俇', - '' => '俖', - '' => '侺', - '' => '俀', - '' => '侹', - '' => '俬', - '' => '剄', - '' => '剉', - '' => '勀', - '' => '勂', - '' => '匽', - '' => '卼', - '' => '厗', - '' => '厖', - '' => '厙', - '' => '厘', - '' => '咺', - '' => '咡', - '' => '咭', - '' => '咥', - '' => '哏', - '@' => '哃', - 'A' => '茍', - 'B' => '咷', - 'C' => '咮', - 'D' => '哖', - 'E' => '咶', - 'F' => '哅', - 'G' => '哆', - 'H' => '咠', - 'I' => '呰', - 'J' => '咼', - 'K' => '咢', - 'L' => '咾', - 'M' => '呲', - 'N' => '哞', - 'O' => '咰', - 'P' => '垵', - 'Q' => '垞', - 'R' => '垟', - 'S' => '垤', - 'T' => '垌', - 'U' => '垗', - 'V' => '垝', - 'W' => '垛', - 'X' => '垔', - 'Y' => '垘', - 'Z' => '垏', - '[' => '垙', - '\\' => '垥', - ']' => '垚', - '^' => '垕', - '_' => '壴', - '`' => '复', - 'a' => '奓', - 'b' => '姡', - 'c' => '姞', - 'd' => '姮', - 'e' => '娀', - 'f' => '姱', - 'g' => '姝', - 'h' => '姺', - 'i' => '姽', - 'j' => '姼', - 'k' => '姶', - 'l' => '姤', - 'm' => '姲', - 'n' => '姷', - 'o' => '姛', - 'p' => '姩', - 'q' => '姳', - 'r' => '姵', - 's' => '姠', - 't' => '姾', - 'u' => '姴', - 'v' => '姭', - 'w' => '宨', - 'x' => '屌', - 'y' => '峐', - 'z' => '峘', - '{' => '峌', - '|' => '峗', - '}' => '峋', - '~' => '峛', - 'Ρ' => '峞', - '΢' => '峚', - 'Σ' => '峉', - 'Τ' => '峇', - 'Υ' => '峊', - 'Φ' => '峖', - 'Χ' => '峓', - 'Ψ' => '峔', - 'Ω' => '峏', - 'Ϊ' => '峈', - 'Ϋ' => '峆', - 'ά' => '峎', - 'έ' => '峟', - 'ή' => '峸', - 'ί' => '巹', - 'ΰ' => '帡', - 'α' => '帢', - 'β' => '帣', - 'γ' => '帠', - 'δ' => '帤', - 'ε' => '庰', - 'ζ' => '庤', - 'η' => '庢', - 'θ' => '庛', - 'ι' => '庣', - 'κ' => '庥', - 'λ' => '弇', - 'μ' => '弮', - 'ν' => '彖', - 'ξ' => '徆', - 'ο' => '怷', - '' => '怹', - '' => '恔', - '' => '恲', - '' => '恞', - '' => '恅', - '' => '恓', - '' => '恇', - '' => '恉', - '' => '恛', - '' => '恌', - '' => '恀', - '' => '恂', - '' => '恟', - '' => '怤', - '' => '恄', - '' => '恘', - '' => '恦', - '' => '恮', - '' => '扂', - '' => '扃', - '' => '拏', - '' => '挍', - '' => '挋', - '' => '拵', - '' => '挎', - '' => '挃', - '' => '拫', - '' => '拹', - '' => '挏', - '' => '挌', - '' => '拸', - '' => '拶', - '' => '挀', - '' => '挓', - '' => '挔', - '' => '拺', - '' => '挕', - '' => '拻', - '' => '拰', - '' => '敁', - '' => '敃', - '' => '斪', - '' => '斿', - '' => '昶', - '' => '昡', - '' => '昲', - '' => '昵', - '' => '昜', - '' => '昦', - '' => '昢', - '' => '昳', - '' => '昫', - '' => '昺', - '' => '昝', - '' => '昴', - '' => '昹', - '' => '昮', - '' => '朏', - '' => '朐', - '' => '柁', - '' => '柲', - '' => '柈', - '' => '枺', - '@' => '柜', - 'A' => '枻', - 'B' => '柸', - 'C' => '柘', - 'D' => '柀', - 'E' => '枷', - 'F' => '柅', - 'G' => '柫', - 'H' => '柤', - 'I' => '柟', - 'J' => '枵', - 'K' => '柍', - 'L' => '枳', - 'M' => '柷', - 'N' => '柶', - 'O' => '柮', - 'P' => '柣', - 'Q' => '柂', - 'R' => '枹', - 'S' => '柎', - 'T' => '柧', - 'U' => '柰', - 'V' => '枲', - 'W' => '柼', - 'X' => '柆', - 'Y' => '柭', - 'Z' => '柌', - '[' => '枮', - '\\' => '柦', - ']' => '柛', - '^' => '柺', - '_' => '柉', - '`' => '柊', - 'a' => '柃', - 'b' => '柪', - 'c' => '柋', - 'd' => '欨', - 'e' => '殂', - 'f' => '殄', - 'g' => '殶', - 'h' => '毖', - 'i' => '毘', - 'j' => '毠', - 'k' => '氠', - 'l' => '氡', - 'm' => '洨', - 'n' => '洴', - 'o' => '洭', - 'p' => '洟', - 'q' => '洼', - 'r' => '洿', - 's' => '洒', - 't' => '洊', - 'u' => '泚', - 'v' => '洳', - 'w' => '洄', - 'x' => '洙', - 'y' => '洺', - 'z' => '洚', - '{' => '洑', - '|' => '洀', - '}' => '洝', - '~' => '浂', - 'ϡ' => '洁', - 'Ϣ' => '洘', - 'ϣ' => '洷', - 'Ϥ' => '洃', - 'ϥ' => '洏', - 'Ϧ' => '浀', - 'ϧ' => '洇', - 'Ϩ' => '洠', - 'ϩ' => '洬', - 'Ϫ' => '洈', - 'ϫ' => '洢', - 'Ϭ' => '洉', - 'ϭ' => '洐', - 'Ϯ' => '炷', - 'ϯ' => '炟', - 'ϰ' => '炾', - 'ϱ' => '炱', - 'ϲ' => '炰', - 'ϳ' => '炡', - 'ϴ' => '炴', - 'ϵ' => '炵', - '϶' => '炩', - 'Ϸ' => '牁', - 'ϸ' => '牉', - 'Ϲ' => '牊', - 'Ϻ' => '牬', - 'ϻ' => '牰', - 'ϼ' => '牳', - 'Ͻ' => '牮', - 'Ͼ' => '狊', - 'Ͽ' => '狤', - '' => '狨', - '' => '狫', - '' => '狟', - '' => '狪', - '' => '狦', - '' => '狣', - '' => '玅', - '' => '珌', - '' => '珂', - '' => '珈', - '' => '珅', - '' => '玹', - '' => '玶', - '' => '玵', - '' => '玴', - '' => '珫', - '' => '玿', - '' => '珇', - '' => '玾', - '' => '珃', - '' => '珆', - '' => '玸', - '' => '珋', - '' => '瓬', - '' => '瓮', - '' => '甮', - '' => '畇', - '' => '畈', - '' => '疧', - '' => '疪', - '' => '癹', - '' => '盄', - '' => '眈', - '' => '眃', - '' => '眄', - '' => '眅', - '' => '眊', - '' => '盷', - '' => '盻', - '' => '盺', - '' => '矧', - '' => '矨', - '' => '砆', - '' => '砑', - '' => '砒', - '' => '砅', - '' => '砐', - '' => '砏', - '' => '砎', - '' => '砉', - '' => '砃', - '' => '砓', - '' => '祊', - '' => '祌', - '' => '祋', - '' => '祅', - '' => '祄', - '' => '秕', - '' => '种', - '' => '秏', - '' => '秖', - '' => '秎', - '' => '窀', - '@' => '穾', - 'A' => '竑', - 'B' => '笀', - 'C' => '笁', - 'D' => '籺', - 'E' => '籸', - 'F' => '籹', - 'G' => '籿', - 'H' => '粀', - 'I' => '粁', - 'J' => '紃', - 'K' => '紈', - 'L' => '紁', - 'M' => '罘', - 'N' => '羑', - 'O' => '羍', - 'P' => '羾', - 'Q' => '耇', - 'R' => '耎', - 'S' => '耏', - 'T' => '耔', - 'U' => '耷', - 'V' => '胘', - 'W' => '胇', - 'X' => '胠', - 'Y' => '胑', - 'Z' => '胈', - '[' => '胂', - '\\' => '胐', - ']' => '胅', - '^' => '胣', - '_' => '胙', - '`' => '胜', - 'a' => '胊', - 'b' => '胕', - 'c' => '胉', - 'd' => '胏', - 'e' => '胗', - 'f' => '胦', - 'g' => '胍', - 'h' => '臿', - 'i' => '舡', - 'j' => '芔', - 'k' => '苙', - 'l' => '苾', - 'm' => '苹', - 'n' => '茇', - 'o' => '苨', - 'p' => '茀', - 'q' => '苕', - 'r' => '茺', - 's' => '苫', - 't' => '苖', - 'u' => '苴', - 'v' => '苬', - 'w' => '苡', - 'x' => '苲', - 'y' => '苵', - 'z' => '茌', - '{' => '苻', - '|' => '苶', - '}' => '苰', - '~' => '苪', - 'С' => '苤', - 'Т' => '苠', - 'У' => '苺', - 'Ф' => '苳', - 'Х' => '苭', - 'Ц' => '虷', - 'Ч' => '虴', - 'Ш' => '虼', - 'Щ' => '虳', - 'Ъ' => '衁', - 'Ы' => '衎', - 'Ь' => '衧', - 'Э' => '衪', - 'Ю' => '衩', - 'Я' => '觓', - 'а' => '訄', - 'б' => '訇', - 'в' => '赲', - 'г' => '迣', - 'д' => '迡', - 'е' => '迮', - 'ж' => '迠', - 'з' => '郱', - 'и' => '邽', - 'й' => '邿', - 'к' => '郕', - 'л' => '郅', - 'м' => '邾', - 'н' => '郇', - 'о' => '郋', - 'п' => '郈', - '' => '釔', - '' => '釓', - '' => '陔', - '' => '陏', - '' => '陑', - '' => '陓', - '' => '陊', - '' => '陎', - '' => '倞', - '' => '倅', - '' => '倇', - '' => '倓', - '' => '倢', - '' => '倰', - '' => '倛', - '' => '俵', - '' => '俴', - '' => '倳', - '' => '倷', - '' => '倬', - '' => '俶', - '' => '俷', - '' => '倗', - '' => '倜', - '' => '倠', - '' => '倧', - '' => '倵', - '' => '倯', - '' => '倱', - '' => '倎', - '' => '党', - '' => '冔', - '' => '冓', - '' => '凊', - '' => '凄', - '' => '凅', - '' => '凈', - '' => '凎', - '' => '剡', - '' => '剚', - '' => '剒', - '' => '剞', - '' => '剟', - '' => '剕', - '' => '剢', - '' => '勍', - '' => '匎', - '' => '厞', - '' => '唦', - '' => '哢', - '' => '唗', - '' => '唒', - '' => '哧', - '' => '哳', - '' => '哤', - '' => '唚', - '' => '哿', - '' => '唄', - '' => '唈', - '' => '哫', - '' => '唑', - '' => '唅', - '' => '哱', - '@' => '唊', - 'A' => '哻', - 'B' => '哷', - 'C' => '哸', - 'D' => '哠', - 'E' => '唎', - 'F' => '唃', - 'G' => '唋', - 'H' => '圁', - 'I' => '圂', - 'J' => '埌', - 'K' => '堲', - 'L' => '埕', - 'M' => '埒', - 'N' => '垺', - 'O' => '埆', - 'P' => '垽', - 'Q' => '垼', - 'R' => '垸', - 'S' => '垶', - 'T' => '垿', - 'U' => '埇', - 'V' => '埐', - 'W' => '垹', - 'X' => '埁', - 'Y' => '夎', - 'Z' => '奊', - '[' => '娙', - '\\' => '娖', - ']' => '娭', - '^' => '娮', - '_' => '娕', - '`' => '娏', - 'a' => '娗', - 'b' => '娊', - 'c' => '娞', - 'd' => '娳', - 'e' => '孬', - 'f' => '宧', - 'g' => '宭', - 'h' => '宬', - 'i' => '尃', - 'j' => '屖', - 'k' => '屔', - 'l' => '峬', - 'm' => '峿', - 'n' => '峮', - 'o' => '峱', - 'p' => '峷', - 'q' => '崀', - 'r' => '峹', - 's' => '帩', - 't' => '帨', - 'u' => '庨', - 'v' => '庮', - 'w' => '庪', - 'x' => '庬', - 'y' => '弳', - 'z' => '弰', - '{' => '彧', - '|' => '恝', - '}' => '恚', - '~' => '恧', - 'ѡ' => '恁', - 'Ѣ' => '悢', - 'ѣ' => '悈', - 'Ѥ' => '悀', - 'ѥ' => '悒', - 'Ѧ' => '悁', - 'ѧ' => '悝', - 'Ѩ' => '悃', - 'ѩ' => '悕', - 'Ѫ' => '悛', - 'ѫ' => '悗', - 'Ѭ' => '悇', - 'ѭ' => '悜', - 'Ѯ' => '悎', - 'ѯ' => '戙', - 'Ѱ' => '扆', - 'ѱ' => '拲', - 'Ѳ' => '挐', - 'ѳ' => '捖', - 'Ѵ' => '挬', - 'ѵ' => '捄', - 'Ѷ' => '捅', - 'ѷ' => '挶', - 'Ѹ' => '捃', - 'ѹ' => '揤', - 'Ѻ' => '挹', - 'ѻ' => '捋', - 'Ѽ' => '捊', - 'ѽ' => '挼', - 'Ѿ' => '挩', - 'ѿ' => '捁', - '' => '挴', - '' => '捘', - '' => '捔', - '' => '捙', - '' => '挭', - '' => '捇', - '' => '挳', - '' => '捚', - '' => '捑', - '' => '挸', - '' => '捗', - '' => '捀', - '' => '捈', - '' => '敊', - '' => '敆', - '' => '旆', - '' => '旃', - '' => '旄', - '' => '旂', - '' => '晊', - '' => '晟', - '' => '晇', - '' => '晑', - '' => '朒', - '' => '朓', - '' => '栟', - '' => '栚', - '' => '桉', - '' => '栲', - '' => '栳', - '' => '栻', - '' => '桋', - '' => '桏', - '' => '栖', - '' => '栱', - '' => '栜', - '' => '栵', - '' => '栫', - '' => '栭', - '' => '栯', - '' => '桎', - '' => '桄', - '' => '栴', - '' => '栝', - '' => '栒', - '' => '栔', - '' => '栦', - '' => '栨', - '' => '栮', - '' => '桍', - '' => '栺', - '' => '栥', - '' => '栠', - '' => '欬', - '' => '欯', - '' => '欭', - '' => '欱', - '' => '欴', - '' => '歭', - '' => '肂', - '' => '殈', - '' => '毦', - '' => '毤', - '@' => '毨', - 'A' => '毣', - 'B' => '毢', - 'C' => '毧', - 'D' => '氥', - 'E' => '浺', - 'F' => '浣', - 'G' => '浤', - 'H' => '浶', - 'I' => '洍', - 'J' => '浡', - 'K' => '涒', - 'L' => '浘', - 'M' => '浢', - 'N' => '浭', - 'O' => '浯', - 'P' => '涑', - 'Q' => '涍', - 'R' => '淯', - 'S' => '浿', - 'T' => '涆', - 'U' => '浞', - 'V' => '浧', - 'W' => '浠', - 'X' => '涗', - 'Y' => '浰', - 'Z' => '浼', - '[' => '浟', - '\\' => '涂', - ']' => '涘', - '^' => '洯', - '_' => '浨', - '`' => '涋', - 'a' => '浾', - 'b' => '涀', - 'c' => '涄', - 'd' => '洖', - 'e' => '涃', - 'f' => '浻', - 'g' => '浽', - 'h' => '浵', - 'i' => '涐', - 'j' => '烜', - 'k' => '烓', - 'l' => '烑', - 'm' => '烝', - 'n' => '烋', - 'o' => '缹', - 'p' => '烢', - 'q' => '烗', - 'r' => '烒', - 's' => '烞', - 't' => '烠', - 'u' => '烔', - 'v' => '烍', - 'w' => '烅', - 'x' => '烆', - 'y' => '烇', - 'z' => '烚', - '{' => '烎', - '|' => '烡', - '}' => '牂', - '~' => '牸', - 'ҡ' => '牷', - 'Ң' => '牶', - 'ң' => '猀', - 'Ҥ' => '狺', - 'ҥ' => '狴', - 'Ҧ' => '狾', - 'ҧ' => '狶', - 'Ҩ' => '狳', - 'ҩ' => '狻', - 'Ҫ' => '猁', - 'ҫ' => '珓', - 'Ҭ' => '珙', - 'ҭ' => '珥', - 'Ү' => '珖', - 'ү' => '玼', - 'Ұ' => '珧', - 'ұ' => '珣', - 'Ҳ' => '珩', - 'ҳ' => '珜', - 'Ҵ' => '珒', - 'ҵ' => '珛', - 'Ҷ' => '珔', - 'ҷ' => '珝', - 'Ҹ' => '珚', - 'ҹ' => '珗', - 'Һ' => '珘', - 'һ' => '珨', - 'Ҽ' => '瓞', - 'ҽ' => '瓟', - 'Ҿ' => '瓴', - 'ҿ' => '瓵', - '' => '甡', - '' => '畛', - '' => '畟', - '' => '疰', - '' => '痁', - '' => '疻', - '' => '痄', - '' => '痀', - '' => '疿', - '' => '疶', - '' => '疺', - '' => '皊', - '' => '盉', - '' => '眝', - '' => '眛', - '' => '眐', - '' => '眓', - '' => '眒', - '' => '眣', - '' => '眑', - '' => '眕', - '' => '眙', - '' => '眚', - '' => '眢', - '' => '眧', - '' => '砣', - '' => '砬', - '' => '砢', - '' => '砵', - '' => '砯', - '' => '砨', - '' => '砮', - '' => '砫', - '' => '砡', - '' => '砩', - '' => '砳', - '' => '砪', - '' => '砱', - '' => '祔', - '' => '祛', - '' => '祏', - '' => '祜', - '' => '祓', - '' => '祒', - '' => '祑', - '' => '秫', - '' => '秬', - '' => '秠', - '' => '秮', - '' => '秭', - '' => '秪', - '' => '秜', - '' => '秞', - '' => '秝', - '' => '窆', - '' => '窉', - '' => '窅', - '' => '窋', - '' => '窌', - '' => '窊', - '' => '窇', - '' => '竘', - '' => '笐', - '@' => '笄', - 'A' => '笓', - 'B' => '笅', - 'C' => '笏', - 'D' => '笈', - 'E' => '笊', - 'F' => '笎', - 'G' => '笉', - 'H' => '笒', - 'I' => '粄', - 'J' => '粑', - 'K' => '粊', - 'L' => '粌', - 'M' => '粈', - 'N' => '粍', - 'O' => '粅', - 'P' => '紞', - 'Q' => '紝', - 'R' => '紑', - 'S' => '紎', - 'T' => '紘', - 'U' => '紖', - 'V' => '紓', - 'W' => '紟', - 'X' => '紒', - 'Y' => '紏', - 'Z' => '紌', - '[' => '罜', - '\\' => '罡', - ']' => '罞', - '^' => '罠', - '_' => '罝', - '`' => '罛', - 'a' => '羖', - 'b' => '羒', - 'c' => '翃', - 'd' => '翂', - 'e' => '翀', - 'f' => '耖', - 'g' => '耾', - 'h' => '耹', - 'i' => '胺', - 'j' => '胲', - 'k' => '胹', - 'l' => '胵', - 'm' => '脁', - 'n' => '胻', - 'o' => '脀', - 'p' => '舁', - 'q' => '舯', - 'r' => '舥', - 's' => '茳', - 't' => '茭', - 'u' => '荄', - 'v' => '茙', - 'w' => '荑', - 'x' => '茥', - 'y' => '荖', - 'z' => '茿', - '{' => '荁', - '|' => '茦', - '}' => '茜', - '~' => '茢', - 'ӡ' => '荂', - 'Ӣ' => '荎', - 'ӣ' => '茛', - 'Ӥ' => '茪', - 'ӥ' => '茈', - 'Ӧ' => '茼', - 'ӧ' => '荍', - 'Ө' => '茖', - 'ө' => '茤', - 'Ӫ' => '茠', - 'ӫ' => '茷', - 'Ӭ' => '茯', - 'ӭ' => '茩', - 'Ӯ' => '荇', - 'ӯ' => '荅', - 'Ӱ' => '荌', - 'ӱ' => '荓', - 'Ӳ' => '茞', - 'ӳ' => '茬', - 'Ӵ' => '荋', - 'ӵ' => '茧', - 'Ӷ' => '荈', - 'ӷ' => '虓', - 'Ӹ' => '虒', - 'ӹ' => '蚢', - 'Ӻ' => '蚨', - 'ӻ' => '蚖', - 'Ӽ' => '蚍', - 'ӽ' => '蚑', - 'Ӿ' => '蚞', - 'ӿ' => '蚇', - '' => '蚗', - '' => '蚆', - '' => '蚋', - '' => '蚚', - '' => '蚅', - '' => '蚥', - '' => '蚙', - '' => '蚡', - '' => '蚧', - '' => '蚕', - '' => '蚘', - '' => '蚎', - '' => '蚝', - '' => '蚐', - '' => '蚔', - '' => '衃', - '' => '衄', - '' => '衭', - '' => '衵', - '' => '衶', - '' => '衲', - '' => '袀', - '' => '衱', - '' => '衿', - '' => '衯', - '' => '袃', - '' => '衾', - '' => '衴', - '' => '衼', - '' => '訒', - '' => '豇', - '' => '豗', - '' => '豻', - '' => '貤', - '' => '貣', - '' => '赶', - '' => '赸', - '' => '趵', - '' => '趷', - '' => '趶', - '' => '軑', - '' => '軓', - '' => '迾', - '' => '迵', - '' => '适', - '' => '迿', - '' => '迻', - '' => '逄', - '' => '迼', - '' => '迶', - '' => '郖', - '' => '郠', - '' => '郙', - '' => '郚', - '' => '郣', - '' => '郟', - '' => '郥', - '' => '郘', - '' => '郛', - '' => '郗', - '' => '郜', - '' => '郤', - '' => '酐', - '@' => '酎', - 'A' => '酏', - 'B' => '釕', - 'C' => '釢', - 'D' => '釚', - 'E' => '陜', - 'F' => '陟', - 'G' => '隼', - 'H' => '飣', - 'I' => '髟', - 'J' => '鬯', - 'K' => '乿', - 'L' => '偰', - 'M' => '偪', - 'N' => '偡', - 'O' => '偞', - 'P' => '偠', - 'Q' => '偓', - 'R' => '偋', - 'S' => '偝', - 'T' => '偲', - 'U' => '偈', - 'V' => '偍', - 'W' => '偁', - 'X' => '偛', - 'Y' => '偊', - 'Z' => '偢', - '[' => '倕', - '\\' => '偅', - ']' => '偟', - '^' => '偩', - '_' => '偫', - '`' => '偣', - 'a' => '偤', - 'b' => '偆', - 'c' => '偀', - 'd' => '偮', - 'e' => '偳', - 'f' => '偗', - 'g' => '偑', - 'h' => '凐', - 'i' => '剫', - 'j' => '剭', - 'k' => '剬', - 'l' => '剮', - 'm' => '勖', - 'n' => '勓', - 'o' => '匭', - 'p' => '厜', - 'q' => '啵', - 'r' => '啶', - 's' => '唼', - 't' => '啍', - 'u' => '啐', - 'v' => '唴', - 'w' => '唪', - 'x' => '啑', - 'y' => '啢', - 'z' => '唶', - '{' => '唵', - '|' => '唰', - '}' => '啒', - '~' => '啅', - 'ԡ' => '唌', - 'Ԣ' => '唲', - 'ԣ' => '啥', - 'Ԥ' => '啎', - 'ԥ' => '唹', - 'Ԧ' => '啈', - 'ԧ' => '唭', - 'Ԩ' => '唻', - 'ԩ' => '啀', - 'Ԫ' => '啋', - 'ԫ' => '圊', - 'Ԭ' => '圇', - 'ԭ' => '埻', - 'Ԯ' => '堔', - 'ԯ' => '埢', - '԰' => '埶', - 'Ա' => '埜', - 'Բ' => '埴', - 'Գ' => '堀', - 'Դ' => '埭', - 'Ե' => '埽', - 'Զ' => '堈', - 'Է' => '埸', - 'Ը' => '堋', - 'Թ' => '埳', - 'Ժ' => '埏', - 'Ի' => '堇', - 'Լ' => '埮', - 'Խ' => '埣', - 'Ծ' => '埲', - 'Կ' => '埥', - '' => '埬', - '' => '埡', - '' => '堎', - '' => '埼', - '' => '堐', - '' => '埧', - '' => '堁', - '' => '堌', - '' => '埱', - '' => '埩', - '' => '埰', - '' => '堍', - '' => '堄', - '' => '奜', - '' => '婠', - '' => '婘', - '' => '婕', - '' => '婧', - '' => '婞', - '' => '娸', - '' => '娵', - '' => '婭', - '' => '婐', - '' => '婟', - '' => '婥', - '' => '婬', - '' => '婓', - '' => '婤', - '' => '婗', - '' => '婃', - '' => '婝', - '' => '婒', - '' => '婄', - '' => '婛', - '' => '婈', - '' => '媎', - '' => '娾', - '' => '婍', - '' => '娹', - '' => '婌', - '' => '婰', - '' => '婩', - '' => '婇', - '' => '婑', - '' => '婖', - '' => '婂', - '' => '婜', - '' => '孲', - '' => '孮', - '' => '寁', - '' => '寀', - '' => '屙', - '' => '崞', - '' => '崋', - '' => '崝', - '' => '崚', - '' => '崠', - '' => '崌', - '' => '崨', - '' => '崍', - '' => '崦', - '' => '崥', - '' => '崏', - '@' => '崰', - 'A' => '崒', - 'B' => '崣', - 'C' => '崟', - 'D' => '崮', - 'E' => '帾', - 'F' => '帴', - 'G' => '庱', - 'H' => '庴', - 'I' => '庹', - 'J' => '庲', - 'K' => '庳', - 'L' => '弶', - 'M' => '弸', - 'N' => '徛', - 'O' => '徖', - 'P' => '徟', - 'Q' => '悊', - 'R' => '悐', - 'S' => '悆', - 'T' => '悾', - 'U' => '悰', - 'V' => '悺', - 'W' => '惓', - 'X' => '惔', - 'Y' => '惏', - 'Z' => '惤', - '[' => '惙', - '\\' => '惝', - ']' => '惈', - '^' => '悱', - '_' => '惛', - '`' => '悷', - 'a' => '惊', - 'b' => '悿', - 'c' => '惃', - 'd' => '惍', - 'e' => '惀', - 'f' => '挲', - 'g' => '捥', - 'h' => '掊', - 'i' => '掂', - 'j' => '捽', - 'k' => '掽', - 'l' => '掞', - 'm' => '掭', - 'n' => '掝', - 'o' => '掗', - 'p' => '掫', - 'q' => '掎', - 'r' => '捯', - 's' => '掇', - 't' => '掐', - 'u' => '据', - 'v' => '掯', - 'w' => '捵', - 'x' => '掜', - 'y' => '捭', - 'z' => '掮', - '{' => '捼', - '|' => '掤', - '}' => '挻', - '~' => '掟', - 'ա' => '捸', - 'բ' => '掅', - 'գ' => '掁', - 'դ' => '掑', - 'ե' => '掍', - 'զ' => '捰', - 'է' => '敓', - 'ը' => '旍', - 'թ' => '晥', - 'ժ' => '晡', - 'ի' => '晛', - 'լ' => '晙', - 'խ' => '晜', - 'ծ' => '晢', - 'կ' => '朘', - 'հ' => '桹', - 'ձ' => '梇', - 'ղ' => '梐', - 'ճ' => '梜', - 'մ' => '桭', - 'յ' => '桮', - 'ն' => '梮', - 'շ' => '梫', - 'ո' => '楖', - 'չ' => '桯', - 'պ' => '梣', - 'ջ' => '梬', - 'ռ' => '梩', - 'ս' => '桵', - 'վ' => '桴', - 'տ' => '梲', - '' => '梏', - '' => '桷', - '' => '梒', - '' => '桼', - '' => '桫', - '' => '桲', - '' => '梪', - '' => '梀', - '' => '桱', - '' => '桾', - '' => '梛', - '' => '梖', - '' => '梋', - '' => '梠', - '' => '梉', - '' => '梤', - '' => '桸', - '' => '桻', - '' => '梑', - '' => '梌', - '' => '梊', - '' => '桽', - '' => '欶', - '' => '欳', - '' => '欷', - '' => '欸', - '' => '殑', - '' => '殏', - '' => '殍', - '' => '殎', - '' => '殌', - '' => '氪', - '' => '淀', - '' => '涫', - '' => '涴', - '' => '涳', - '' => '湴', - '' => '涬', - '' => '淩', - '' => '淢', - '' => '涷', - '' => '淶', - '' => '淔', - '' => '渀', - '' => '淈', - '' => '淠', - '' => '淟', - '' => '淖', - '' => '涾', - '' => '淥', - '' => '淜', - '' => '淝', - '' => '淛', - '' => '淴', - '' => '淊', - '' => '涽', - '' => '淭', - '' => '淰', - '' => '涺', - '' => '淕', - '' => '淂', - '' => '淏', - '' => '淉', - '@' => '淐', - 'A' => '淲', - 'B' => '淓', - 'C' => '淽', - 'D' => '淗', - 'E' => '淍', - 'F' => '淣', - 'G' => '涻', - 'H' => '烺', - 'I' => '焍', - 'J' => '烷', - 'K' => '焗', - 'L' => '烴', - 'M' => '焌', - 'N' => '烰', - 'O' => '焄', - 'P' => '烳', - 'Q' => '焐', - 'R' => '烼', - 'S' => '烿', - 'T' => '焆', - 'U' => '焓', - 'V' => '焀', - 'W' => '烸', - 'X' => '烶', - 'Y' => '焋', - 'Z' => '焂', - '[' => '焎', - '\\' => '牾', - ']' => '牻', - '^' => '牼', - '_' => '牿', - '`' => '猝', - 'a' => '猗', - 'b' => '猇', - 'c' => '猑', - 'd' => '猘', - 'e' => '猊', - 'f' => '猈', - 'g' => '狿', - 'h' => '猏', - 'i' => '猞', - 'j' => '玈', - 'k' => '珶', - 'l' => '珸', - 'm' => '珵', - 'n' => '琄', - 'o' => '琁', - 'p' => '珽', - 'q' => '琇', - 'r' => '琀', - 's' => '珺', - 't' => '珼', - 'u' => '珿', - 'v' => '琌', - 'w' => '琋', - 'x' => '珴', - 'y' => '琈', - 'z' => '畤', - '{' => '畣', - '|' => '痎', - '}' => '痒', - '~' => '痏', - '֡' => '痋', - '֢' => '痌', - '֣' => '痑', - '֤' => '痐', - '֥' => '皏', - '֦' => '皉', - '֧' => '盓', - '֨' => '眹', - '֩' => '眯', - '֪' => '眭', - '֫' => '眱', - '֬' => '眲', - '֭' => '眴', - '֮' => '眳', - '֯' => '眽', - 'ְ' => '眥', - 'ֱ' => '眻', - 'ֲ' => '眵', - 'ֳ' => '硈', - 'ִ' => '硒', - 'ֵ' => '硉', - 'ֶ' => '硍', - 'ַ' => '硊', - 'ָ' => '硌', - 'ֹ' => '砦', - 'ֺ' => '硅', - 'ֻ' => '硐', - 'ּ' => '祤', - 'ֽ' => '祧', - '־' => '祩', - 'ֿ' => '祪', - '' => '祣', - '' => '祫', - '' => '祡', - '' => '离', - '' => '秺', - '' => '秸', - '' => '秶', - '' => '秷', - '' => '窏', - '' => '窔', - '' => '窐', - '' => '笵', - '' => '筇', - '' => '笴', - '' => '笥', - '' => '笰', - '' => '笢', - '' => '笤', - '' => '笳', - '' => '笘', - '' => '笪', - '' => '笝', - '' => '笱', - '' => '笫', - '' => '笭', - '' => '笯', - '' => '笲', - '' => '笸', - '' => '笚', - '' => '笣', - '' => '粔', - '' => '粘', - '' => '粖', - '' => '粣', - '' => '紵', - '' => '紽', - '' => '紸', - '' => '紶', - '' => '紺', - '' => '絅', - '' => '紬', - '' => '紩', - '' => '絁', - '' => '絇', - '' => '紾', - '' => '紿', - '' => '絊', - '' => '紻', - '' => '紨', - '' => '罣', - '' => '羕', - '' => '羜', - '' => '羝', - '' => '羛', - '' => '翊', - '' => '翋', - '' => '翍', - '' => '翐', - '' => '翑', - '' => '翇', - '' => '翏', - '' => '翉', - '' => '耟', - '@' => '耞', - 'A' => '耛', - 'B' => '聇', - 'C' => '聃', - 'D' => '聈', - 'E' => '脘', - 'F' => '脥', - 'G' => '脙', - 'H' => '脛', - 'I' => '脭', - 'J' => '脟', - 'K' => '脬', - 'L' => '脞', - 'M' => '脡', - 'N' => '脕', - 'O' => '脧', - 'P' => '脝', - 'Q' => '脢', - 'R' => '舑', - 'S' => '舸', - 'T' => '舳', - 'U' => '舺', - 'V' => '舴', - 'W' => '舲', - 'X' => '艴', - 'Y' => '莐', - 'Z' => '莣', - '[' => '莨', - '\\' => '莍', - ']' => '荺', - '^' => '荳', - '_' => '莤', - '`' => '荴', - 'a' => '莏', - 'b' => '莁', - 'c' => '莕', - 'd' => '莙', - 'e' => '荵', - 'f' => '莔', - 'g' => '莩', - 'h' => '荽', - 'i' => '莃', - 'j' => '莌', - 'k' => '莝', - 'l' => '莛', - 'm' => '莪', - 'n' => '莋', - 'o' => '荾', - 'p' => '莥', - 'q' => '莯', - 'r' => '莈', - 's' => '莗', - 't' => '莰', - 'u' => '荿', - 'v' => '莦', - 'w' => '莇', - 'x' => '莮', - 'y' => '荶', - 'z' => '莚', - '{' => '虙', - '|' => '虖', - '}' => '蚿', - '~' => '蚷', - 'ס' => '蛂', - 'ע' => '蛁', - 'ף' => '蛅', - 'פ' => '蚺', - 'ץ' => '蚰', - 'צ' => '蛈', - 'ק' => '蚹', - 'ר' => '蚳', - 'ש' => '蚸', - 'ת' => '蛌', - '׫' => '蚴', - '׬' => '蚻', - '׭' => '蚼', - '׮' => '蛃', - 'ׯ' => '蚽', - 'װ' => '蚾', - 'ױ' => '衒', - 'ײ' => '袉', - '׳' => '袕', - '״' => '袨', - '׵' => '袢', - '׶' => '袪', - '׷' => '袚', - '׸' => '袑', - '׹' => '袡', - '׺' => '袟', - '׻' => '袘', - '׼' => '袧', - '׽' => '袙', - '׾' => '袛', - '׿' => '袗', - '' => '袤', - '' => '袬', - '' => '袌', - '' => '袓', - '' => '袎', - '' => '覂', - '' => '觖', - '' => '觙', - '' => '觕', - '' => '訰', - '' => '訧', - '' => '訬', - '' => '訞', - '' => '谹', - '' => '谻', - '' => '豜', - '' => '豝', - '' => '豽', - '' => '貥', - '' => '赽', - '' => '赻', - '' => '赹', - '' => '趼', - '' => '跂', - '' => '趹', - '' => '趿', - '' => '跁', - '' => '軘', - '' => '軞', - '' => '軝', - '' => '軜', - '' => '軗', - '' => '軠', - '' => '軡', - '' => '逤', - '' => '逋', - '' => '逑', - '' => '逜', - '' => '逌', - '' => '逡', - '' => '郯', - '' => '郪', - '' => '郰', - '' => '郴', - '' => '郲', - '' => '郳', - '' => '郔', - '' => '郫', - '' => '郬', - '' => '郩', - '' => '酖', - '' => '酘', - '' => '酚', - '' => '酓', - '' => '酕', - '' => '釬', - '' => '釴', - '' => '釱', - '' => '釳', - '' => '釸', - '' => '釤', - '' => '釹', - '' => '釪', - '@' => '釫', - 'A' => '釷', - 'B' => '釨', - 'C' => '釮', - 'D' => '镺', - 'E' => '閆', - 'F' => '閈', - 'G' => '陼', - 'H' => '陭', - 'I' => '陫', - 'J' => '陱', - 'K' => '陯', - 'L' => '隿', - 'M' => '靪', - 'N' => '頄', - 'O' => '飥', - 'P' => '馗', - 'Q' => '傛', - 'R' => '傕', - 'S' => '傔', - 'T' => '傞', - 'U' => '傋', - 'V' => '傣', - 'W' => '傃', - 'X' => '傌', - 'Y' => '傎', - 'Z' => '傝', - '[' => '偨', - '\\' => '傜', - ']' => '傒', - '^' => '傂', - '_' => '傇', - '`' => '兟', - 'a' => '凔', - 'b' => '匒', - 'c' => '匑', - 'd' => '厤', - 'e' => '厧', - 'f' => '喑', - 'g' => '喨', - 'h' => '喥', - 'i' => '喭', - 'j' => '啷', - 'k' => '噅', - 'l' => '喢', - 'm' => '喓', - 'n' => '喈', - 'o' => '喏', - 'p' => '喵', - 'q' => '喁', - 'r' => '喣', - 's' => '喒', - 't' => '喤', - 'u' => '啽', - 'v' => '喌', - 'w' => '喦', - 'x' => '啿', - 'y' => '喕', - 'z' => '喡', - '{' => '喎', - '|' => '圌', - '}' => '堩', - '~' => '堷', - 'ء' => '堙', - 'آ' => '堞', - 'أ' => '堧', - 'ؤ' => '堣', - 'إ' => '堨', - 'ئ' => '埵', - 'ا' => '塈', - 'ب' => '堥', - 'ة' => '堜', - 'ت' => '堛', - 'ث' => '堳', - 'ج' => '堿', - 'ح' => '堶', - 'خ' => '堮', - 'د' => '堹', - 'ذ' => '堸', - 'ر' => '堭', - 'ز' => '堬', - 'س' => '堻', - 'ش' => '奡', - 'ص' => '媯', - 'ض' => '媔', - 'ط' => '媟', - 'ظ' => '婺', - 'ع' => '媢', - 'غ' => '媞', - 'ػ' => '婸', - 'ؼ' => '媦', - 'ؽ' => '婼', - 'ؾ' => '媥', - 'ؿ' => '媬', - '' => '媕', - '' => '媮', - '' => '娷', - '' => '媄', - '' => '媊', - '' => '媗', - '' => '媃', - '' => '媋', - '' => '媩', - '' => '婻', - '' => '婽', - '' => '媌', - '' => '媜', - '' => '媏', - '' => '媓', - '' => '媝', - '' => '寪', - '' => '寍', - '' => '寋', - '' => '寔', - '' => '寑', - '' => '寊', - '' => '寎', - '' => '尌', - '' => '尰', - '' => '崷', - '' => '嵃', - '' => '嵫', - '' => '嵁', - '' => '嵋', - '' => '崿', - '' => '崵', - '' => '嵑', - '' => '嵎', - '' => '嵕', - '' => '崳', - '' => '崺', - '' => '嵒', - '' => '崽', - '' => '崱', - '' => '嵙', - '' => '嵂', - '' => '崹', - '' => '嵉', - '' => '崸', - '' => '崼', - '' => '崲', - '' => '崶', - '' => '嵀', - '' => '嵅', - '' => '幄', - '' => '幁', - '' => '彘', - '' => '徦', - '' => '徥', - '' => '徫', - '' => '惉', - '' => '悹', - '' => '惌', - '' => '惢', - '' => '惎', - '' => '惄', - '' => '愔', - '@' => '惲', - 'A' => '愊', - 'B' => '愖', - 'C' => '愅', - 'D' => '惵', - 'E' => '愓', - 'F' => '惸', - 'G' => '惼', - 'H' => '惾', - 'I' => '惁', - 'J' => '愃', - 'K' => '愘', - 'L' => '愝', - 'M' => '愐', - 'N' => '惿', - 'O' => '愄', - 'P' => '愋', - 'Q' => '扊', - 'R' => '掔', - 'S' => '掱', - 'T' => '掰', - 'U' => '揎', - 'V' => '揥', - 'W' => '揨', - 'X' => '揯', - 'Y' => '揃', - 'Z' => '撝', - '[' => '揳', - '\\' => '揊', - ']' => '揠', - '^' => '揶', - '_' => '揕', - '`' => '揲', - 'a' => '揵', - 'b' => '摡', - 'c' => '揟', - 'd' => '掾', - 'e' => '揝', - 'f' => '揜', - 'g' => '揄', - 'h' => '揘', - 'i' => '揓', - 'j' => '揂', - 'k' => '揇', - 'l' => '揌', - 'm' => '揋', - 'n' => '揈', - 'o' => '揰', - 'p' => '揗', - 'q' => '揙', - 'r' => '攲', - 's' => '敧', - 't' => '敪', - 'u' => '敤', - 'v' => '敜', - 'w' => '敨', - 'x' => '敥', - 'y' => '斌', - 'z' => '斝', - '{' => '斞', - '|' => '斮', - '}' => '旐', - '~' => '旒', - '١' => '晼', - '٢' => '晬', - '٣' => '晻', - '٤' => '暀', - '٥' => '晱', - '٦' => '晹', - '٧' => '晪', - '٨' => '晲', - '٩' => '朁', - '٪' => '椌', - '٫' => '棓', - '٬' => '椄', - '٭' => '棜', - 'ٮ' => '椪', - 'ٯ' => '棬', - 'ٰ' => '棪', - 'ٱ' => '棱', - 'ٲ' => '椏', - 'ٳ' => '棖', - 'ٴ' => '棷', - 'ٵ' => '棫', - 'ٶ' => '棤', - 'ٷ' => '棶', - 'ٸ' => '椓', - 'ٹ' => '椐', - 'ٺ' => '棳', - 'ٻ' => '棡', - 'ټ' => '椇', - 'ٽ' => '棌', - 'پ' => '椈', - 'ٿ' => '楰', - '' => '梴', - '' => '椑', - '' => '棯', - '' => '棆', - '' => '椔', - '' => '棸', - '' => '棐', - '' => '棽', - '' => '棼', - '' => '棨', - '' => '椋', - '' => '椊', - '' => '椗', - '' => '棎', - '' => '棈', - '' => '棝', - '' => '棞', - '' => '棦', - '' => '棴', - '' => '棑', - '' => '椆', - '' => '棔', - '' => '棩', - '' => '椕', - '' => '椥', - '' => '棇', - '' => '欹', - '' => '欻', - '' => '欿', - '' => '欼', - '' => '殔', - '' => '殗', - '' => '殙', - '' => '殕', - '' => '殽', - '' => '毰', - '' => '毲', - '' => '毳', - '' => '氰', - '' => '淼', - '' => '湆', - '' => '湇', - '' => '渟', - '' => '湉', - '' => '溈', - '' => '渼', - '' => '渽', - '' => '湅', - '' => '湢', - '' => '渫', - '' => '渿', - '' => '湁', - '' => '湝', - '' => '湳', - '' => '渜', - '' => '渳', - '' => '湋', - '' => '湀', - '' => '湑', - '' => '渻', - '' => '渃', - '' => '渮', - '' => '湞', - '@' => '湨', - 'A' => '湜', - 'B' => '湡', - 'C' => '渱', - 'D' => '渨', - 'E' => '湠', - 'F' => '湱', - 'G' => '湫', - 'H' => '渹', - 'I' => '渢', - 'J' => '渰', - 'K' => '湓', - 'L' => '湥', - 'M' => '渧', - 'N' => '湸', - 'O' => '湤', - 'P' => '湷', - 'Q' => '湕', - 'R' => '湹', - 'S' => '湒', - 'T' => '湦', - 'U' => '渵', - 'V' => '渶', - 'W' => '湚', - 'X' => '焠', - 'Y' => '焞', - 'Z' => '焯', - '[' => '烻', - '\\' => '焮', - ']' => '焱', - '^' => '焣', - '_' => '焥', - '`' => '焢', - 'a' => '焲', - 'b' => '焟', - 'c' => '焨', - 'd' => '焺', - 'e' => '焛', - 'f' => '牋', - 'g' => '牚', - 'h' => '犈', - 'i' => '犉', - 'j' => '犆', - 'k' => '犅', - 'l' => '犋', - 'm' => '猒', - 'n' => '猋', - 'o' => '猰', - 'p' => '猢', - 'q' => '猱', - 'r' => '猳', - 's' => '猧', - 't' => '猲', - 'u' => '猭', - 'v' => '猦', - 'w' => '猣', - 'x' => '猵', - 'y' => '猌', - 'z' => '琮', - '{' => '琬', - '|' => '琰', - '}' => '琫', - '~' => '琖', - 'ڡ' => '琚', - 'ڢ' => '琡', - 'ڣ' => '琭', - 'ڤ' => '琱', - 'ڥ' => '琤', - 'ڦ' => '琣', - 'ڧ' => '琝', - 'ڨ' => '琩', - 'ک' => '琠', - 'ڪ' => '琲', - 'ګ' => '瓻', - 'ڬ' => '甯', - 'ڭ' => '畯', - 'ڮ' => '畬', - 'گ' => '痧', - 'ڰ' => '痚', - 'ڱ' => '痡', - 'ڲ' => '痦', - 'ڳ' => '痝', - 'ڴ' => '痟', - 'ڵ' => '痤', - 'ڶ' => '痗', - 'ڷ' => '皕', - 'ڸ' => '皒', - 'ڹ' => '盚', - 'ں' => '睆', - 'ڻ' => '睇', - 'ڼ' => '睄', - 'ڽ' => '睍', - 'ھ' => '睅', - 'ڿ' => '睊', - '' => '睎', - '' => '睋', - '' => '睌', - '' => '矞', - '' => '矬', - '' => '硠', - '' => '硤', - '' => '硥', - '' => '硜', - '' => '硭', - '' => '硱', - '' => '硪', - '' => '确', - '' => '硰', - '' => '硩', - '' => '硨', - '' => '硞', - '' => '硢', - '' => '祴', - '' => '祳', - '' => '祲', - '' => '祰', - '' => '稂', - '' => '稊', - '' => '稃', - '' => '稌', - '' => '稄', - '' => '窙', - '' => '竦', - '' => '竤', - '' => '筊', - '' => '笻', - '' => '筄', - '' => '筈', - '' => '筌', - '' => '筎', - '' => '筀', - '' => '筘', - '' => '筅', - '' => '粢', - '' => '粞', - '' => '粨', - '' => '粡', - '' => '絘', - '' => '絯', - '' => '絣', - '' => '絓', - '' => '絖', - '' => '絧', - '' => '絪', - '' => '絏', - '' => '絭', - '' => '絜', - '' => '絫', - '' => '絒', - '' => '絔', - '' => '絩', - '' => '絑', - '' => '絟', - '' => '絎', - '' => '缾', - '' => '缿', - '' => '罥', - '@' => '罦', - 'A' => '羢', - 'B' => '羠', - 'C' => '羡', - 'D' => '翗', - 'E' => '聑', - 'F' => '聏', - 'G' => '聐', - 'H' => '胾', - 'I' => '胔', - 'J' => '腃', - 'K' => '腊', - 'L' => '腒', - 'M' => '腏', - 'N' => '腇', - 'O' => '脽', - 'P' => '腍', - 'Q' => '脺', - 'R' => '臦', - 'S' => '臮', - 'T' => '臷', - 'U' => '臸', - 'V' => '臹', - 'W' => '舄', - 'X' => '舼', - 'Y' => '舽', - 'Z' => '舿', - '[' => '艵', - '\\' => '茻', - ']' => '菏', - '^' => '菹', - '_' => '萣', - '`' => '菀', - 'a' => '菨', - 'b' => '萒', - 'c' => '菧', - 'd' => '菤', - 'e' => '菼', - 'f' => '菶', - 'g' => '萐', - 'h' => '菆', - 'i' => '菈', - 'j' => '菫', - 'k' => '菣', - 'l' => '莿', - 'm' => '萁', - 'n' => '菝', - 'o' => '菥', - 'p' => '菘', - 'q' => '菿', - 'r' => '菡', - 's' => '菋', - 't' => '菎', - 'u' => '菖', - 'v' => '菵', - 'w' => '菉', - 'x' => '萉', - 'y' => '萏', - 'z' => '菞', - '{' => '萑', - '|' => '萆', - '}' => '菂', - '~' => '菳', - 'ۡ' => '菕', - 'ۢ' => '菺', - 'ۣ' => '菇', - 'ۤ' => '菑', - 'ۥ' => '菪', - 'ۦ' => '萓', - 'ۧ' => '菃', - 'ۨ' => '菬', - '۩' => '菮', - '۪' => '菄', - '۫' => '菻', - '۬' => '菗', - 'ۭ' => '菢', - 'ۮ' => '萛', - 'ۯ' => '菛', - '۰' => '菾', - '۱' => '蛘', - '۲' => '蛢', - '۳' => '蛦', - '۴' => '蛓', - '۵' => '蛣', - '۶' => '蛚', - '۷' => '蛪', - '۸' => '蛝', - '۹' => '蛫', - 'ۺ' => '蛜', - 'ۻ' => '蛬', - 'ۼ' => '蛩', - '۽' => '蛗', - '۾' => '蛨', - 'ۿ' => '蛑', - '' => '衈', - '' => '衖', - '' => '衕', - '' => '袺', - '' => '裗', - '' => '袹', - '' => '袸', - '' => '裀', - '' => '袾', - '' => '袶', - '' => '袼', - '' => '袷', - '' => '袽', - '' => '袲', - '' => '褁', - '' => '裉', - '' => '覕', - '' => '覘', - '' => '覗', - '' => '觝', - '' => '觚', - '' => '觛', - '' => '詎', - '' => '詍', - '' => '訹', - '' => '詙', - '' => '詀', - '' => '詗', - '' => '詘', - '' => '詄', - '' => '詅', - '' => '詒', - '' => '詈', - '' => '詑', - '' => '詊', - '' => '詌', - '' => '詏', - '' => '豟', - '' => '貁', - '' => '貀', - '' => '貺', - '' => '貾', - '' => '貰', - '' => '貹', - '' => '貵', - '' => '趄', - '' => '趀', - '' => '趉', - '' => '跘', - '' => '跓', - '' => '跍', - '' => '跇', - '' => '跖', - '' => '跜', - '' => '跏', - '' => '跕', - '' => '跙', - '' => '跈', - '' => '跗', - '' => '跅', - '' => '軯', - '' => '軷', - '' => '軺', - '@' => '軹', - 'A' => '軦', - 'B' => '軮', - 'C' => '軥', - 'D' => '軵', - 'E' => '軧', - 'F' => '軨', - 'G' => '軶', - 'H' => '軫', - 'I' => '軱', - 'J' => '軬', - 'K' => '軴', - 'L' => '軩', - 'M' => '逭', - 'N' => '逴', - 'O' => '逯', - 'P' => '鄆', - 'Q' => '鄬', - 'R' => '鄄', - 'S' => '郿', - 'T' => '郼', - 'U' => '鄈', - 'V' => '郹', - 'W' => '郻', - 'X' => '鄁', - 'Y' => '鄀', - 'Z' => '鄇', - '[' => '鄅', - '\\' => '鄃', - ']' => '酡', - '^' => '酤', - '_' => '酟', - '`' => '酢', - 'a' => '酠', - 'b' => '鈁', - 'c' => '鈊', - 'd' => '鈥', - 'e' => '鈃', - 'f' => '鈚', - 'g' => '鈦', - 'h' => '鈏', - 'i' => '鈌', - 'j' => '鈀', - 'k' => '鈒', - 'l' => '釿', - 'm' => '釽', - 'n' => '鈆', - 'o' => '鈄', - 'p' => '鈧', - 'q' => '鈂', - 'r' => '鈜', - 's' => '鈤', - 't' => '鈙', - 'u' => '鈗', - 'v' => '鈅', - 'w' => '鈖', - 'x' => '镻', - 'y' => '閍', - 'z' => '閌', - '{' => '閐', - '|' => '隇', - '}' => '陾', - '~' => '隈', - 'ܡ' => '隉', - 'ܢ' => '隃', - 'ܣ' => '隀', - 'ܤ' => '雂', - 'ܥ' => '雈', - 'ܦ' => '雃', - 'ܧ' => '雱', - 'ܨ' => '雰', - 'ܩ' => '靬', - 'ܪ' => '靰', - 'ܫ' => '靮', - 'ܬ' => '頇', - 'ܭ' => '颩', - 'ܮ' => '飫', - 'ܯ' => '鳦', - 'ܰ' => '黹', - 'ܱ' => '亃', - 'ܲ' => '亄', - 'ܳ' => '亶', - 'ܴ' => '傽', - 'ܵ' => '傿', - 'ܶ' => '僆', - 'ܷ' => '傮', - 'ܸ' => '僄', - 'ܹ' => '僊', - 'ܺ' => '傴', - 'ܻ' => '僈', - 'ܼ' => '僂', - 'ܽ' => '傰', - 'ܾ' => '僁', - 'ܿ' => '傺', - '' => '傱', - '' => '僋', - '' => '僉', - '' => '傶', - '' => '傸', - '' => '凗', - '' => '剺', - '' => '剸', - '' => '剻', - '' => '剼', - '' => '嗃', - '' => '嗛', - '' => '嗌', - '' => '嗐', - '' => '嗋', - '' => '嗊', - '' => '嗝', - '' => '嗀', - '' => '嗔', - '' => '嗄', - '' => '嗩', - '' => '喿', - '' => '嗒', - '' => '喍', - '' => '嗏', - '' => '嗕', - '' => '嗢', - '' => '嗖', - '' => '嗈', - '' => '嗲', - '' => '嗍', - '' => '嗙', - '' => '嗂', - '' => '圔', - '' => '塓', - '' => '塨', - '' => '塤', - '' => '塏', - '' => '塍', - '' => '塉', - '' => '塯', - '' => '塕', - '' => '塎', - '' => '塝', - '' => '塙', - '' => '塥', - '' => '塛', - '' => '堽', - '' => '塣', - '' => '塱', - '' => '壼', - '' => '嫇', - '' => '嫄', - '' => '嫋', - '' => '媺', - '' => '媸', - '' => '媱', - '' => '媵', - '' => '媰', - '' => '媿', - '' => '嫈', - '' => '媻', - '' => '嫆', - '@' => '媷', - 'A' => '嫀', - 'B' => '嫊', - 'C' => '媴', - 'D' => '媶', - 'E' => '嫍', - 'F' => '媹', - 'G' => '媐', - 'H' => '寖', - 'I' => '寘', - 'J' => '寙', - 'K' => '尟', - 'L' => '尳', - 'M' => '嵱', - 'N' => '嵣', - 'O' => '嵊', - 'P' => '嵥', - 'Q' => '嵲', - 'R' => '嵬', - 'S' => '嵞', - 'T' => '嵨', - 'U' => '嵧', - 'V' => '嵢', - 'W' => '巰', - 'X' => '幏', - 'Y' => '幎', - 'Z' => '幊', - '[' => '幍', - '\\' => '幋', - ']' => '廅', - '^' => '廌', - '_' => '廆', - '`' => '廋', - 'a' => '廇', - 'b' => '彀', - 'c' => '徯', - 'd' => '徭', - 'e' => '惷', - 'f' => '慉', - 'g' => '慊', - 'h' => '愫', - 'i' => '慅', - 'j' => '愶', - 'k' => '愲', - 'l' => '愮', - 'm' => '慆', - 'n' => '愯', - 'o' => '慏', - 'p' => '愩', - 'q' => '慀', - 'r' => '戠', - 's' => '酨', - 't' => '戣', - 'u' => '戥', - 'v' => '戤', - 'w' => '揅', - 'x' => '揱', - 'y' => '揫', - 'z' => '搐', - '{' => '搒', - '|' => '搉', - '}' => '搠', - '~' => '搤', - 'ݡ' => '搳', - 'ݢ' => '摃', - 'ݣ' => '搟', - 'ݤ' => '搕', - 'ݥ' => '搘', - 'ݦ' => '搹', - 'ݧ' => '搷', - 'ݨ' => '搢', - 'ݩ' => '搣', - 'ݪ' => '搌', - 'ݫ' => '搦', - 'ݬ' => '搰', - 'ݭ' => '搨', - 'ݮ' => '摁', - 'ݯ' => '搵', - 'ݰ' => '搯', - 'ݱ' => '搊', - 'ݲ' => '搚', - 'ݳ' => '摀', - 'ݴ' => '搥', - 'ݵ' => '搧', - 'ݶ' => '搋', - 'ݷ' => '揧', - 'ݸ' => '搛', - 'ݹ' => '搮', - 'ݺ' => '搡', - 'ݻ' => '搎', - 'ݼ' => '敯', - 'ݽ' => '斒', - 'ݾ' => '旓', - 'ݿ' => '暆', - '' => '暌', - '' => '暕', - '' => '暐', - '' => '暋', - '' => '暊', - '' => '暙', - '' => '暔', - '' => '晸', - '' => '朠', - '' => '楦', - '' => '楟', - '' => '椸', - '' => '楎', - '' => '楢', - '' => '楱', - '' => '椿', - '' => '楅', - '' => '楪', - '' => '椹', - '' => '楂', - '' => '楗', - '' => '楙', - '' => '楺', - '' => '楈', - '' => '楉', - '' => '椵', - '' => '楬', - '' => '椳', - '' => '椽', - '' => '楥', - '' => '棰', - '' => '楸', - '' => '椴', - '' => '楩', - '' => '楀', - '' => '楯', - '' => '楄', - '' => '楶', - '' => '楘', - '' => '楁', - '' => '楴', - '' => '楌', - '' => '椻', - '' => '楋', - '' => '椷', - '' => '楜', - '' => '楏', - '' => '楑', - '' => '椲', - '' => '楒', - '' => '椯', - '' => '楻', - '' => '椼', - '' => '歆', - '' => '歅', - '' => '歃', - '' => '歂', - '' => '歈', - '' => '歁', - '' => '殛', - '' => '嗀', - '' => '毻', - '' => '毼', - '@' => '毹', - 'A' => '毷', - 'B' => '毸', - 'C' => '溛', - 'D' => '滖', - 'E' => '滈', - 'F' => '溏', - 'G' => '滀', - 'H' => '溟', - 'I' => '溓', - 'J' => '溔', - 'K' => '溠', - 'L' => '溱', - 'M' => '溹', - 'N' => '滆', - 'O' => '滒', - 'P' => '溽', - 'Q' => '滁', - 'R' => '溞', - 'S' => '滉', - 'T' => '溷', - 'U' => '溰', - 'V' => '滍', - 'W' => '溦', - 'X' => '滏', - 'Y' => '溲', - 'Z' => '溾', - '[' => '滃', - '\\' => '滜', - ']' => '滘', - '^' => '溙', - '_' => '溒', - '`' => '溎', - 'a' => '溍', - 'b' => '溤', - 'c' => '溡', - 'd' => '溿', - 'e' => '溳', - 'f' => '滐', - 'g' => '滊', - 'h' => '溗', - 'i' => '溮', - 'j' => '溣', - 'k' => '煇', - 'l' => '煔', - 'm' => '煒', - 'n' => '煣', - 'o' => '煠', - 'p' => '煁', - 'q' => '煝', - 'r' => '煢', - 's' => '煲', - 't' => '煸', - 'u' => '煪', - 'v' => '煡', - 'w' => '煂', - 'x' => '煘', - 'y' => '煃', - 'z' => '煋', - '{' => '煰', - '|' => '煟', - '}' => '煐', - '~' => '煓', - 'ޡ' => '煄', - 'ޢ' => '煍', - 'ޣ' => '煚', - 'ޤ' => '牏', - 'ޥ' => '犍', - 'ަ' => '犌', - 'ާ' => '犑', - 'ި' => '犐', - 'ީ' => '犎', - 'ު' => '猼', - 'ޫ' => '獂', - 'ެ' => '猻', - 'ޭ' => '猺', - 'ޮ' => '獀', - 'ޯ' => '獊', - 'ް' => '獉', - 'ޱ' => '瑄', - '޲' => '瑊', - '޳' => '瑋', - '޴' => '瑒', - '޵' => '瑑', - '޶' => '瑗', - '޷' => '瑀', - '޸' => '瑏', - '޹' => '瑐', - '޺' => '瑎', - '޻' => '瑂', - '޼' => '瑆', - '޽' => '瑍', - '޾' => '瑔', - '޿' => '瓡', - '' => '瓿', - '' => '瓾', - '' => '瓽', - '' => '甝', - '' => '畹', - '' => '畷', - '' => '榃', - '' => '痯', - '' => '瘏', - '' => '瘃', - '' => '痷', - '' => '痾', - '' => '痼', - '' => '痹', - '' => '痸', - '' => '瘐', - '' => '痻', - '' => '痶', - '' => '痭', - '' => '痵', - '' => '痽', - '' => '皙', - '' => '皵', - '' => '盝', - '' => '睕', - '' => '睟', - '' => '睠', - '' => '睒', - '' => '睖', - '' => '睚', - '' => '睩', - '' => '睧', - '' => '睔', - '' => '睙', - '' => '睭', - '' => '矠', - '' => '碇', - '' => '碚', - '' => '碔', - '' => '碏', - '' => '碄', - '' => '碕', - '' => '碅', - '' => '碆', - '' => '碡', - '' => '碃', - '' => '硹', - '' => '碙', - '' => '碀', - '' => '碖', - '' => '硻', - '' => '祼', - '' => '禂', - '' => '祽', - '' => '祹', - '' => '稑', - '' => '稘', - '' => '稙', - '' => '稒', - '' => '稗', - '' => '稕', - '' => '稢', - '' => '稓', - '@' => '稛', - 'A' => '稐', - 'B' => '窣', - 'C' => '窢', - 'D' => '窞', - 'E' => '竫', - 'F' => '筦', - 'G' => '筤', - 'H' => '筭', - 'I' => '筴', - 'J' => '筩', - 'K' => '筲', - 'L' => '筥', - 'M' => '筳', - 'N' => '筱', - 'O' => '筰', - 'P' => '筡', - 'Q' => '筸', - 'R' => '筶', - 'S' => '筣', - 'T' => '粲', - 'U' => '粴', - 'V' => '粯', - 'W' => '綈', - 'X' => '綆', - 'Y' => '綀', - 'Z' => '綍', - '[' => '絿', - '\\' => '綅', - ']' => '絺', - '^' => '綎', - '_' => '絻', - '`' => '綃', - 'a' => '絼', - 'b' => '綌', - 'c' => '綔', - 'd' => '綄', - 'e' => '絽', - 'f' => '綒', - 'g' => '罭', - 'h' => '罫', - 'i' => '罧', - 'j' => '罨', - 'k' => '罬', - 'l' => '羦', - 'm' => '羥', - 'n' => '羧', - 'o' => '翛', - 'p' => '翜', - 'q' => '耡', - 'r' => '腤', - 's' => '腠', - 't' => '腷', - 'u' => '腜', - 'v' => '腩', - 'w' => '腛', - 'x' => '腢', - 'y' => '腲', - 'z' => '朡', - '{' => '腞', - '|' => '腶', - '}' => '腧', - '~' => '腯', - 'ߡ' => '腄', - 'ߢ' => '腡', - 'ߣ' => '舝', - 'ߤ' => '艉', - 'ߥ' => '艄', - 'ߦ' => '艀', - 'ߧ' => '艂', - 'ߨ' => '艅', - 'ߩ' => '蓱', - 'ߪ' => '萿', - '߫' => '葖', - '߬' => '葶', - '߭' => '葹', - '߮' => '蒏', - '߯' => '蒍', - '߰' => '葥', - '߱' => '葑', - '߲' => '葀', - '߳' => '蒆', - 'ߴ' => '葧', - 'ߵ' => '萰', - '߶' => '葍', - '߷' => '葽', - '߸' => '葚', - '߹' => '葙', - 'ߺ' => '葴', - '߻' => '葳', - '߼' => '葝', - '߽' => '蔇', - '߾' => '葞', - '߿' => '萷', - '' => '萺', - '' => '萴', - '' => '葺', - '' => '葃', - '' => '葸', - '' => '萲', - '' => '葅', - '' => '萩', - '' => '菙', - '' => '葋', - '' => '萯', - '' => '葂', - '' => '萭', - '' => '葟', - '' => '葰', - '' => '萹', - '' => '葎', - '' => '葌', - '' => '葒', - '' => '葯', - '' => '蓅', - '' => '蒎', - '' => '萻', - '' => '葇', - '' => '萶', - '' => '萳', - '' => '葨', - '' => '葾', - '' => '葄', - '' => '萫', - '' => '葠', - '' => '葔', - '' => '葮', - '' => '葐', - '' => '蜋', - '' => '蜄', - '' => '蛷', - '' => '蜌', - '' => '蛺', - '' => '蛖', - '' => '蛵', - '' => '蝍', - '' => '蛸', - '' => '蜎', - '' => '蜉', - '' => '蜁', - '' => '蛶', - '' => '蜍', - '' => '蜅', - '' => '裖', - '' => '裋', - '' => '裍', - '' => '裎', - '' => '裞', - '' => '裛', - '' => '裚', - '' => '裌', - '' => '裐', - '' => '覅', - '' => '覛', - '' => '觟', - '' => '觥', - '' => '觤', - '@' => '觡', - 'A' => '觠', - 'B' => '觢', - 'C' => '觜', - 'D' => '触', - 'E' => '詶', - 'F' => '誆', - 'G' => '詿', - 'H' => '詡', - 'I' => '訿', - 'J' => '詷', - 'K' => '誂', - 'L' => '誄', - 'M' => '詵', - 'N' => '誃', - 'O' => '誁', - 'P' => '詴', - 'Q' => '詺', - 'R' => '谼', - 'S' => '豋', - 'T' => '豊', - 'U' => '豥', - 'V' => '豤', - 'W' => '豦', - 'X' => '貆', - 'Y' => '貄', - 'Z' => '貅', - '[' => '賌', - '\\' => '赨', - ']' => '赩', - '^' => '趑', - '_' => '趌', - '`' => '趎', - 'a' => '趏', - 'b' => '趍', - 'c' => '趓', - 'd' => '趔', - 'e' => '趐', - 'f' => '趒', - 'g' => '跰', - 'h' => '跠', - 'i' => '跬', - 'j' => '跱', - 'k' => '跮', - 'l' => '跐', - 'm' => '跩', - 'n' => '跣', - 'o' => '跢', - 'p' => '跧', - 'q' => '跲', - 'r' => '跫', - 's' => '跴', - 't' => '輆', - 'u' => '軿', - 'v' => '輁', - 'w' => '輀', - 'x' => '輅', - 'y' => '輇', - 'z' => '輈', - '{' => '輂', - '|' => '輋', - '}' => '遒', - '~' => '逿', - '' => '遄', - '' => '遉', - '' => '逽', - '' => '鄐', - '' => '鄍', - '' => '鄏', - '' => '鄑', - '' => '鄖', - '' => '鄔', - '' => '鄋', - '' => '鄎', - '' => '酮', - '' => '酯', - '' => '鉈', - '' => '鉒', - '' => '鈰', - '' => '鈺', - '' => '鉦', - '' => '鈳', - '' => '鉥', - '' => '鉞', - '' => '銃', - '' => '鈮', - '' => '鉊', - '' => '鉆', - '' => '鉭', - '' => '鉬', - '' => '鉏', - '' => '鉠', - '' => '鉧', - '' => '鉯', - '' => '鈶', - '' => '鉡', - '' => '鉰', - '' => '鈱', - '' => '鉔', - '' => '鉣', - '' => '鉐', - '' => '鉲', - '' => '鉎', - '' => '鉓', - '' => '鉌', - '' => '鉖', - '' => '鈲', - '' => '閟', - '' => '閜', - '' => '閞', - '' => '閛', - '' => '隒', - '' => '隓', - '' => '隑', - '' => '隗', - '' => '雎', - '' => '雺', - '' => '雽', - '' => '雸', - '' => '雵', - '' => '靳', - '' => '靷', - '' => '靸', - '' => '靲', - '' => '頏', - '' => '頍', - '' => '頎', - '' => '颬', - '' => '飶', - '' => '飹', - '' => '馯', - '' => '馲', - '' => '馰', - '' => '馵', - '' => '骭', - '' => '骫', - '' => '魛', - '' => '鳪', - '' => '鳭', - '' => '鳧', - '' => '麀', - '' => '黽', - '' => '僦', - '' => '僔', - '' => '僗', - '' => '僨', - '' => '僳', - '' => '僛', - '' => '僪', - '' => '僝', - '' => '僤', - '' => '僓', - '' => '僬', - '' => '僰', - '' => '僯', - '' => '僣', - '' => '僠', - '@' => '凘', - 'A' => '劀', - 'B' => '劁', - 'C' => '勩', - 'D' => '勫', - 'E' => '匰', - 'F' => '厬', - 'G' => '嘧', - 'H' => '嘕', - 'I' => '嘌', - 'J' => '嘒', - 'K' => '嗼', - 'L' => '嘏', - 'M' => '嘜', - 'N' => '嘁', - 'O' => '嘓', - 'P' => '嘂', - 'Q' => '嗺', - 'R' => '嘝', - 'S' => '嘄', - 'T' => '嗿', - 'U' => '嗹', - 'V' => '墉', - 'W' => '塼', - 'X' => '墐', - 'Y' => '墘', - 'Z' => '墆', - '[' => '墁', - '\\' => '塿', - ']' => '塴', - '^' => '墋', - '_' => '塺', - '`' => '墇', - 'a' => '墑', - 'b' => '墎', - 'c' => '塶', - 'd' => '墂', - 'e' => '墈', - 'f' => '塻', - 'g' => '墔', - 'h' => '墏', - 'i' => '壾', - 'j' => '奫', - 'k' => '嫜', - 'l' => '嫮', - 'm' => '嫥', - 'n' => '嫕', - 'o' => '嫪', - 'p' => '嫚', - 'q' => '嫭', - 'r' => '嫫', - 's' => '嫳', - 't' => '嫢', - 'u' => '嫠', - 'v' => '嫛', - 'w' => '嫬', - 'x' => '嫞', - 'y' => '嫝', - 'z' => '嫙', - '{' => '嫨', - '|' => '嫟', - '}' => '孷', - '~' => '寠', - '' => '寣', - '' => '屣', - '' => '嶂', - '' => '嶀', - '' => '嵽', - '' => '嶆', - '' => '嵺', - '' => '嶁', - '' => '嵷', - '' => '嶊', - '' => '嶉', - '' => '嶈', - '' => '嵾', - '' => '嵼', - '' => '嶍', - '' => '嵹', - '' => '嵿', - '' => '幘', - '' => '幙', - '' => '幓', - '' => '廘', - '' => '廑', - '' => '廗', - '' => '廎', - '' => '廜', - '' => '廕', - '' => '廙', - '' => '廒', - '' => '廔', - '' => '彄', - '' => '彃', - '' => '彯', - '' => '徶', - '' => '愬', - '' => '愨', - '' => '慁', - '' => '慞', - '' => '慱', - '' => '慳', - '' => '慒', - '' => '慓', - '' => '慲', - '' => '慬', - '' => '憀', - '' => '慴', - '' => '慔', - '' => '慺', - '' => '慛', - '' => '慥', - '' => '愻', - '' => '慪', - '' => '慡', - '' => '慖', - '' => '戩', - '' => '戧', - '' => '戫', - '' => '搫', - '' => '摍', - '' => '摛', - '' => '摝', - '' => '摴', - '' => '摶', - '' => '摲', - '' => '摳', - '' => '摽', - '' => '摵', - '' => '摦', - '' => '撦', - '' => '摎', - '' => '撂', - '' => '摞', - '' => '摜', - '' => '摋', - '' => '摓', - '' => '摠', - '' => '摐', - '' => '摿', - '' => '搿', - '' => '摬', - '' => '摫', - '' => '摙', - '' => '摥', - '' => '摷', - '' => '敳', - '' => '斠', - '' => '暡', - '' => '暠', - '' => '暟', - '' => '朅', - '' => '朄', - '' => '朢', - '' => '榱', - '' => '榶', - '' => '槉', - '@' => '榠', - 'A' => '槎', - 'B' => '榖', - 'C' => '榰', - 'D' => '榬', - 'E' => '榼', - 'F' => '榑', - 'G' => '榙', - 'H' => '榎', - 'I' => '榧', - 'J' => '榍', - 'K' => '榩', - 'L' => '榾', - 'M' => '榯', - 'N' => '榿', - 'O' => '槄', - 'P' => '榽', - 'Q' => '榤', - 'R' => '槔', - 'S' => '榹', - 'T' => '槊', - 'U' => '榚', - 'V' => '槏', - 'W' => '榳', - 'X' => '榓', - 'Y' => '榪', - 'Z' => '榡', - '[' => '榞', - '\\' => '槙', - ']' => '榗', - '^' => '榐', - '_' => '槂', - '`' => '榵', - 'a' => '榥', - 'b' => '槆', - 'c' => '歊', - 'd' => '歍', - 'e' => '歋', - 'f' => '殞', - 'g' => '殟', - 'h' => '殠', - 'i' => '毃', - 'j' => '毄', - 'k' => '毾', - 'l' => '滎', - 'm' => '滵', - 'n' => '滱', - 'o' => '漃', - 'p' => '漥', - 'q' => '滸', - 'r' => '漷', - 's' => '滻', - 't' => '漮', - 'u' => '漉', - 'v' => '潎', - 'w' => '漙', - 'x' => '漚', - 'y' => '漧', - 'z' => '漘', - '{' => '漻', - '|' => '漒', - '}' => '滭', - '~' => '漊', - '' => '漶', - '' => '潳', - '' => '滹', - '' => '滮', - '' => '漭', - '' => '潀', - '' => '漰', - '' => '漼', - '' => '漵', - '' => '滫', - '' => '漇', - '' => '漎', - '' => '潃', - '' => '漅', - '' => '滽', - '' => '滶', - '' => '漹', - '' => '漜', - '' => '滼', - '' => '漺', - '' => '漟', - '' => '漍', - '' => '漞', - '' => '漈', - '' => '漡', - '' => '熇', - '' => '熐', - '' => '熉', - '' => '熀', - '' => '熅', - '' => '熂', - '' => '熏', - '' => '煻', - '' => '熆', - '' => '熁', - '' => '熗', - '' => '牄', - '' => '牓', - '' => '犗', - '' => '犕', - '' => '犓', - '' => '獃', - '' => '獍', - '' => '獑', - '' => '獌', - '' => '瑢', - '' => '瑳', - '' => '瑱', - '' => '瑵', - '' => '瑲', - '' => '瑧', - '' => '瑮', - '' => '甀', - '' => '甂', - '' => '甃', - '' => '畽', - '' => '疐', - '' => '瘖', - '' => '瘈', - '' => '瘌', - '' => '瘕', - '' => '瘑', - '' => '瘊', - '' => '瘔', - '' => '皸', - '' => '瞁', - '' => '睼', - '' => '瞅', - '' => '瞂', - '' => '睮', - '' => '瞀', - '' => '睯', - '' => '睾', - '' => '瞃', - '' => '碲', - '' => '碪', - '' => '碴', - '' => '碭', - '' => '碨', - '' => '硾', - '' => '碫', - '' => '碞', - '' => '碥', - '' => '碠', - '' => '碬', - '' => '碢', - '' => '碤', - '' => '禘', - '' => '禊', - '' => '禋', - '' => '禖', - '' => '禕', - '' => '禔', - '' => '禓', - '@' => '禗', - 'A' => '禈', - 'B' => '禒', - 'C' => '禐', - 'D' => '稫', - 'E' => '穊', - 'F' => '稰', - 'G' => '稯', - 'H' => '稨', - 'I' => '稦', - 'J' => '窨', - 'K' => '窫', - 'L' => '窬', - 'M' => '竮', - 'N' => '箈', - 'O' => '箜', - 'P' => '箊', - 'Q' => '箑', - 'R' => '箐', - 'S' => '箖', - 'T' => '箍', - 'U' => '箌', - 'V' => '箛', - 'W' => '箎', - 'X' => '箅', - 'Y' => '箘', - 'Z' => '劄', - '[' => '箙', - '\\' => '箤', - ']' => '箂', - '^' => '粻', - '_' => '粿', - '`' => '粼', - 'a' => '粺', - 'b' => '綧', - 'c' => '綷', - 'd' => '緂', - 'e' => '綣', - 'f' => '綪', - 'g' => '緁', - 'h' => '緀', - 'i' => '緅', - 'j' => '綝', - 'k' => '緎', - 'l' => '緄', - 'm' => '緆', - 'n' => '緋', - 'o' => '緌', - 'p' => '綯', - 'q' => '綹', - 'r' => '綖', - 's' => '綼', - 't' => '綟', - 'u' => '綦', - 'v' => '綮', - 'w' => '綩', - 'x' => '綡', - 'y' => '緉', - 'z' => '罳', - '{' => '翢', - '|' => '翣', - '}' => '翥', - '~' => '翞', - '' => '耤', - '' => '聝', - '' => '聜', - '' => '膉', - '' => '膆', - '' => '膃', - '' => '膇', - '' => '膍', - '' => '膌', - '' => '膋', - '' => '舕', - '' => '蒗', - '' => '蒤', - '' => '蒡', - '' => '蒟', - '' => '蒺', - '' => '蓎', - '' => '蓂', - '' => '蒬', - '' => '蒮', - '' => '蒫', - '' => '蒹', - '' => '蒴', - '' => '蓁', - '' => '蓍', - '' => '蒪', - '' => '蒚', - '' => '蒱', - '' => '蓐', - '' => '蒝', - '' => '蒧', - '' => '蒻', - '' => '蒢', - '' => '蒔', - '' => '蓇', - '' => '蓌', - '' => '蒛', - '' => '蒩', - '' => '蒯', - '' => '蒨', - '' => '蓖', - '' => '蒘', - '' => '蒶', - '' => '蓏', - '' => '蒠', - '' => '蓗', - '' => '蓔', - '' => '蓒', - '' => '蓛', - '' => '蒰', - '' => '蒑', - '' => '虡', - '' => '蜳', - '' => '蜣', - '' => '蜨', - '' => '蝫', - '' => '蝀', - '' => '蜮', - '' => '蜞', - '' => '蜡', - '' => '蜙', - '' => '蜛', - '' => '蝃', - '' => '蜬', - '' => '蝁', - '' => '蜾', - '' => '蝆', - '' => '蜠', - '' => '蜲', - '' => '蜪', - '' => '蜭', - '' => '蜼', - '' => '蜒', - '' => '蜺', - '' => '蜱', - '' => '蜵', - '' => '蝂', - '' => '蜦', - '' => '蜧', - '' => '蜸', - '' => '蜤', - '' => '蜚', - '' => '蜰', - '' => '蜑', - '' => '裷', - '' => '裧', - '' => '裱', - '' => '裲', - '' => '裺', - '' => '裾', - '' => '裮', - '' => '裼', - '' => '裶', - '' => '裻', - '@' => '裰', - 'A' => '裬', - 'B' => '裫', - 'C' => '覝', - 'D' => '覡', - 'E' => '覟', - 'F' => '覞', - 'G' => '觩', - 'H' => '觫', - 'I' => '觨', - 'J' => '誫', - 'K' => '誙', - 'L' => '誋', - 'M' => '誒', - 'N' => '誏', - 'O' => '誖', - 'P' => '谽', - 'Q' => '豨', - 'R' => '豩', - 'S' => '賕', - 'T' => '賏', - 'U' => '賗', - 'V' => '趖', - 'W' => '踉', - 'X' => '踂', - 'Y' => '跿', - 'Z' => '踍', - '[' => '跽', - '\\' => '踊', - ']' => '踃', - '^' => '踇', - '_' => '踆', - '`' => '踅', - 'a' => '跾', - 'b' => '踀', - 'c' => '踄', - 'd' => '輐', - 'e' => '輑', - 'f' => '輎', - 'g' => '輍', - 'h' => '鄣', - 'i' => '鄜', - 'j' => '鄠', - 'k' => '鄢', - 'l' => '鄟', - 'm' => '鄝', - 'n' => '鄚', - 'o' => '鄤', - 'p' => '鄡', - 'q' => '鄛', - 'r' => '酺', - 's' => '酲', - 't' => '酹', - 'u' => '酳', - 'v' => '銥', - 'w' => '銤', - 'x' => '鉶', - 'y' => '銛', - 'z' => '鉺', - '{' => '銠', - '|' => '銔', - '}' => '銪', - '~' => '銍', - '' => '銦', - '' => '銚', - '' => '銫', - '' => '鉹', - '' => '銗', - '' => '鉿', - '' => '銣', - '' => '鋮', - '' => '銎', - '' => '銂', - '' => '銕', - '' => '銢', - '' => '鉽', - '' => '銈', - '' => '銡', - '' => '銊', - '' => '銆', - '' => '銌', - '' => '銙', - '' => '銧', - '' => '鉾', - '' => '銇', - '' => '銩', - '' => '銝', - '' => '銋', - '' => '鈭', - '' => '隞', - '' => '隡', - '' => '雿', - '' => '靘', - '' => '靽', - '' => '靺', - '' => '靾', - '' => '鞃', - '' => '鞀', - '' => '鞂', - '' => '靻', - '' => '鞄', - '' => '鞁', - '' => '靿', - '' => '韎', - '' => '韍', - '' => '頖', - '' => '颭', - '' => '颮', - '' => '餂', - '' => '餀', - '' => '餇', - '' => '馝', - '' => '馜', - '' => '駃', - '' => '馹', - '' => '馻', - '' => '馺', - '' => '駂', - '' => '馽', - '' => '駇', - '' => '骱', - '' => '髣', - '' => '髧', - '' => '鬾', - '' => '鬿', - '' => '魠', - '' => '魡', - '' => '魟', - '' => '鳱', - '' => '鳲', - '' => '鳵', - '' => '麧', - '' => '僿', - '' => '儃', - '' => '儰', - '' => '僸', - '' => '儆', - '' => '儇', - '' => '僶', - '' => '僾', - '' => '儋', - '' => '儌', - '' => '僽', - '' => '儊', - '' => '劋', - '' => '劌', - '' => '勱', - '' => '勯', - '' => '噈', - '' => '噂', - '' => '噌', - '' => '嘵', - '' => '噁', - '' => '噊', - '' => '噉', - '' => '噆', - '' => '噘', - '@' => '噚', - 'A' => '噀', - 'B' => '嘳', - 'C' => '嘽', - 'D' => '嘬', - 'E' => '嘾', - 'F' => '嘸', - 'G' => '嘪', - 'H' => '嘺', - 'I' => '圚', - 'J' => '墫', - 'K' => '墝', - 'L' => '墱', - 'M' => '墠', - 'N' => '墣', - 'O' => '墯', - 'P' => '墬', - 'Q' => '墥', - 'R' => '墡', - 'S' => '壿', - 'T' => '嫿', - 'U' => '嫴', - 'V' => '嫽', - 'W' => '嫷', - 'X' => '嫶', - 'Y' => '嬃', - 'Z' => '嫸', - '[' => '嬂', - '\\' => '嫹', - ']' => '嬁', - '^' => '嬇', - '_' => '嬅', - '`' => '嬏', - 'a' => '屧', - 'b' => '嶙', - 'c' => '嶗', - 'd' => '嶟', - 'e' => '嶒', - 'f' => '嶢', - 'g' => '嶓', - 'h' => '嶕', - 'i' => '嶠', - 'j' => '嶜', - 'k' => '嶡', - 'l' => '嶚', - 'm' => '嶞', - 'n' => '幩', - 'o' => '幝', - 'p' => '幠', - 'q' => '幜', - 'r' => '緳', - 's' => '廛', - 't' => '廞', - 'u' => '廡', - 'v' => '彉', - 'w' => '徲', - 'x' => '憋', - 'y' => '憃', - 'z' => '慹', - '{' => '憱', - '|' => '憰', - '}' => '憢', - '~' => '憉', - '' => '憛', - '' => '憓', - '' => '憯', - '' => '憭', - '' => '憟', - '' => '憒', - '' => '憪', - '' => '憡', - '' => '憍', - '' => '慦', - '' => '憳', - '' => '戭', - '' => '摮', - '' => '摰', - '' => '撖', - '' => '撠', - '' => '撅', - '' => '撗', - '' => '撜', - '' => '撏', - '' => '撋', - '' => '撊', - '' => '撌', - '' => '撣', - '' => '撟', - '' => '摨', - '' => '撱', - '' => '撘', - '' => '敶', - '' => '敺', - '' => '敹', - '' => '敻', - '' => '斲', - '' => '斳', - '' => '暵', - '' => '暰', - '' => '暩', - '' => '暲', - '' => '暷', - '' => '暪', - '' => '暯', - '' => '樀', - '' => '樆', - '' => '樗', - '' => '槥', - '' => '槸', - '' => '樕', - '' => '槱', - '' => '槤', - '' => '樠', - '' => '槿', - '' => '槬', - '' => '槢', - '' => '樛', - '' => '樝', - '' => '槾', - '' => '樧', - '' => '槲', - '' => '槮', - '' => '樔', - '' => '槷', - '' => '槧', - '' => '橀', - '' => '樈', - '' => '槦', - '' => '槻', - '' => '樍', - '' => '槼', - '' => '槫', - '' => '樉', - '' => '樄', - '' => '樘', - '' => '樥', - '' => '樏', - '' => '槶', - '' => '樦', - '' => '樇', - '' => '槴', - '' => '樖', - '' => '歑', - '' => '殥', - '' => '殣', - '' => '殢', - '' => '殦', - '' => '氁', - '' => '氀', - '' => '毿', - '' => '氂', - '' => '潁', - '' => '漦', - '' => '潾', - '' => '澇', - '' => '濆', - '' => '澒', - '@' => '澍', - 'A' => '澉', - 'B' => '澌', - 'C' => '潢', - 'D' => '潏', - 'E' => '澅', - 'F' => '潚', - 'G' => '澖', - 'H' => '潶', - 'I' => '潬', - 'J' => '澂', - 'K' => '潕', - 'L' => '潲', - 'M' => '潒', - 'N' => '潐', - 'O' => '潗', - 'P' => '澔', - 'Q' => '澓', - 'R' => '潝', - 'S' => '漀', - 'T' => '潡', - 'U' => '潫', - 'V' => '潽', - 'W' => '潧', - 'X' => '澐', - 'Y' => '潓', - 'Z' => '澋', - '[' => '潩', - '\\' => '潿', - ']' => '澕', - '^' => '潣', - '_' => '潷', - '`' => '潪', - 'a' => '潻', - 'b' => '熲', - 'c' => '熯', - 'd' => '熛', - 'e' => '熰', - 'f' => '熠', - 'g' => '熚', - 'h' => '熩', - 'i' => '熵', - 'j' => '熝', - 'k' => '熥', - 'l' => '熞', - 'm' => '熤', - 'n' => '熡', - 'o' => '熪', - 'p' => '熜', - 'q' => '熧', - 'r' => '熳', - 's' => '犘', - 't' => '犚', - 'u' => '獘', - 'v' => '獒', - 'w' => '獞', - 'x' => '獟', - 'y' => '獠', - 'z' => '獝', - '{' => '獛', - '|' => '獡', - '}' => '獚', - '~' => '獙', - '' => '獢', - '' => '璇', - '' => '璉', - '' => '璊', - '' => '璆', - '' => '璁', - '' => '瑽', - '' => '璅', - '' => '璈', - '' => '瑼', - '' => '瑹', - '' => '甈', - '' => '甇', - '' => '畾', - '' => '瘥', - '' => '瘞', - '' => '瘙', - '' => '瘝', - '' => '瘜', - '' => '瘣', - '' => '瘚', - '' => '瘨', - '' => '瘛', - '' => '皜', - '' => '皝', - '' => '皞', - '' => '皛', - '' => '瞍', - '' => '瞏', - '' => '瞉', - '' => '瞈', - '' => '磍', - '' => '碻', - '' => '磏', - '' => '磌', - '' => '磑', - '' => '磎', - '' => '磔', - '' => '磈', - '' => '磃', - '' => '磄', - '' => '磉', - '' => '禚', - '' => '禡', - '' => '禠', - '' => '禜', - '' => '禢', - '' => '禛', - '' => '歶', - '' => '稹', - '' => '窲', - '' => '窴', - '' => '窳', - '' => '箷', - '' => '篋', - '' => '箾', - '' => '箬', - '' => '篎', - '' => '箯', - '' => '箹', - '' => '篊', - '' => '箵', - '' => '糅', - '' => '糈', - '' => '糌', - '' => '糋', - '' => '緷', - '' => '緛', - '' => '緪', - '' => '緧', - '' => '緗', - '' => '緡', - '' => '縃', - '' => '緺', - '' => '緦', - '' => '緶', - '' => '緱', - '' => '緰', - '' => '緮', - '' => '緟', - '' => '罶', - '' => '羬', - '' => '羰', - '' => '羭', - '' => '翭', - '' => '翫', - '' => '翪', - '' => '翬', - '' => '翦', - '' => '翨', - '' => '聤', - '' => '聧', - '' => '膣', - '' => '膟', - '@' => '膞', - 'A' => '膕', - 'B' => '膢', - 'C' => '膙', - 'D' => '膗', - 'E' => '舖', - 'F' => '艏', - 'G' => '艓', - 'H' => '艒', - 'I' => '艐', - 'J' => '艎', - 'K' => '艑', - 'L' => '蔤', - 'M' => '蔻', - 'N' => '蔏', - 'O' => '蔀', - 'P' => '蔩', - 'Q' => '蔎', - 'R' => '蔉', - 'S' => '蔍', - 'T' => '蔟', - 'U' => '蔊', - 'V' => '蔧', - 'W' => '蔜', - 'X' => '蓻', - 'Y' => '蔫', - 'Z' => '蓺', - '[' => '蔈', - '\\' => '蔌', - ']' => '蓴', - '^' => '蔪', - '_' => '蓲', - '`' => '蔕', - 'a' => '蓷', - 'b' => '蓫', - 'c' => '蓳', - 'd' => '蓼', - 'e' => '蔒', - 'f' => '蓪', - 'g' => '蓩', - 'h' => '蔖', - 'i' => '蓾', - 'j' => '蔨', - 'k' => '蔝', - 'l' => '蔮', - 'm' => '蔂', - 'n' => '蓽', - 'o' => '蔞', - 'p' => '蓶', - 'q' => '蔱', - 'r' => '蔦', - 's' => '蓧', - 't' => '蓨', - 'u' => '蓰', - 'v' => '蓯', - 'w' => '蓹', - 'x' => '蔘', - 'y' => '蔠', - 'z' => '蔰', - '{' => '蔋', - '|' => '蔙', - '}' => '蔯', - '~' => '虢', - '' => '蝖', - '' => '蝣', - '' => '蝤', - '' => '蝷', - '' => '蟡', - '' => '蝳', - '' => '蝘', - '' => '蝔', - '' => '蝛', - '' => '蝒', - '' => '蝡', - '' => '蝚', - '' => '蝑', - '' => '蝞', - '' => '蝭', - '' => '蝪', - '' => '蝐', - '' => '蝎', - '' => '蝟', - '' => '蝝', - '' => '蝯', - '' => '蝬', - '' => '蝺', - '' => '蝮', - '' => '蝜', - '' => '蝥', - '' => '蝏', - '' => '蝻', - '' => '蝵', - '' => '蝢', - '' => '蝧', - '' => '蝩', - '' => '衚', - '' => '褅', - '' => '褌', - '' => '褔', - '' => '褋', - '' => '褗', - '' => '褘', - '' => '褙', - '' => '褆', - '' => '褖', - '' => '褑', - '' => '褎', - '' => '褉', - '' => '覢', - '' => '覤', - '' => '覣', - '' => '觭', - '' => '觰', - '' => '觬', - '' => '諏', - '' => '諆', - '' => '誸', - '' => '諓', - '' => '諑', - '' => '諔', - '' => '諕', - '' => '誻', - '' => '諗', - '' => '誾', - '' => '諀', - '' => '諅', - '' => '諘', - '' => '諃', - '' => '誺', - '' => '誽', - '' => '諙', - '' => '谾', - '' => '豍', - '' => '貏', - '' => '賥', - '' => '賟', - '' => '賙', - '' => '賨', - '' => '賚', - '' => '賝', - '' => '賧', - '' => '趠', - '' => '趜', - '' => '趡', - '' => '趛', - '' => '踠', - '' => '踣', - '' => '踥', - '' => '踤', - '' => '踮', - '' => '踕', - '' => '踛', - '' => '踖', - '' => '踑', - '' => '踙', - '' => '踦', - '' => '踧', - '@' => '踔', - 'A' => '踒', - 'B' => '踘', - 'C' => '踓', - 'D' => '踜', - 'E' => '踗', - 'F' => '踚', - 'G' => '輬', - 'H' => '輤', - 'I' => '輘', - 'J' => '輚', - 'K' => '輠', - 'L' => '輣', - 'M' => '輖', - 'N' => '輗', - 'O' => '遳', - 'P' => '遰', - 'Q' => '遯', - 'R' => '遧', - 'S' => '遫', - 'T' => '鄯', - 'U' => '鄫', - 'V' => '鄩', - 'W' => '鄪', - 'X' => '鄲', - 'Y' => '鄦', - 'Z' => '鄮', - '[' => '醅', - '\\' => '醆', - ']' => '醊', - '^' => '醁', - '_' => '醂', - '`' => '醄', - 'a' => '醀', - 'b' => '鋐', - 'c' => '鋃', - 'd' => '鋄', - 'e' => '鋀', - 'f' => '鋙', - 'g' => '銶', - 'h' => '鋏', - 'i' => '鋱', - 'j' => '鋟', - 'k' => '鋘', - 'l' => '鋩', - 'm' => '鋗', - 'n' => '鋝', - 'o' => '鋌', - 'p' => '鋯', - 'q' => '鋂', - 'r' => '鋨', - 's' => '鋊', - 't' => '鋈', - 'u' => '鋎', - 'v' => '鋦', - 'w' => '鋍', - 'x' => '鋕', - 'y' => '鋉', - 'z' => '鋠', - '{' => '鋞', - '|' => '鋧', - '}' => '鋑', - '~' => '鋓', - '' => '銵', - '' => '鋡', - '' => '鋆', - '' => '銴', - '' => '镼', - '' => '閬', - '' => '閫', - '' => '閮', - '' => '閰', - '' => '隤', - '' => '隢', - '' => '雓', - '' => '霅', - '' => '霈', - '' => '霂', - '' => '靚', - '' => '鞊', - '' => '鞎', - '' => '鞈', - '' => '韐', - '' => '韏', - '' => '頞', - '' => '頝', - '' => '頦', - '' => '頩', - '' => '頨', - '' => '頠', - '' => '頛', - '' => '頧', - '' => '颲', - '' => '餈', - '' => '飺', - '' => '餑', - '' => '餔', - '' => '餖', - '' => '餗', - '' => '餕', - '' => '駜', - '' => '駍', - '' => '駏', - '' => '駓', - '' => '駔', - '' => '駎', - '' => '駉', - '' => '駖', - '' => '駘', - '' => '駋', - '' => '駗', - '' => '駌', - '' => '骳', - '' => '髬', - '' => '髫', - '' => '髳', - '' => '髲', - '' => '髱', - '' => '魆', - '' => '魃', - '' => '魧', - '' => '魴', - '' => '魱', - '' => '魦', - '' => '魶', - '' => '魵', - '' => '魰', - '' => '魨', - '' => '魤', - '' => '魬', - '' => '鳼', - '' => '鳺', - '' => '鳽', - '' => '鳿', - '' => '鳷', - '' => '鴇', - '' => '鴀', - '' => '鳹', - '' => '鳻', - '' => '鴈', - '' => '鴅', - '' => '鴄', - '' => '麃', - '' => '黓', - '' => '鼏', - '' => '鼐', - '' => '儜', - '' => '儓', - '' => '儗', - '' => '儚', - '' => '儑', - '' => '凞', - '' => '匴', - '' => '叡', - '' => '噰', - '' => '噠', - '' => '噮', - '@' => '噳', - 'A' => '噦', - 'B' => '噣', - 'C' => '噭', - 'D' => '噲', - 'E' => '噞', - 'F' => '噷', - 'G' => '圜', - 'H' => '圛', - 'I' => '壈', - 'J' => '墽', - 'K' => '壉', - 'L' => '墿', - 'M' => '墺', - 'N' => '壂', - 'O' => '墼', - 'P' => '壆', - 'Q' => '嬗', - 'R' => '嬙', - 'S' => '嬛', - 'T' => '嬡', - 'U' => '嬔', - 'V' => '嬓', - 'W' => '嬐', - 'X' => '嬖', - 'Y' => '嬨', - 'Z' => '嬚', - '[' => '嬠', - '\\' => '嬞', - ']' => '寯', - '^' => '嶬', - '_' => '嶱', - '`' => '嶩', - 'a' => '嶧', - 'b' => '嶵', - 'c' => '嶰', - 'd' => '嶮', - 'e' => '嶪', - 'f' => '嶨', - 'g' => '嶲', - 'h' => '嶭', - 'i' => '嶯', - 'j' => '嶴', - 'k' => '幧', - 'l' => '幨', - 'm' => '幦', - 'n' => '幯', - 'o' => '廩', - 'p' => '廧', - 'q' => '廦', - 'r' => '廨', - 's' => '廥', - 't' => '彋', - 'u' => '徼', - 'v' => '憝', - 'w' => '憨', - 'x' => '憖', - 'y' => '懅', - 'z' => '憴', - '{' => '懆', - '|' => '懁', - '}' => '懌', - '~' => '憺', - '' => '憿', - '' => '憸', - '' => '憌', - '' => '擗', - '' => '擖', - '' => '擐', - '' => '擏', - '' => '擉', - '' => '撽', - '' => '撉', - '' => '擃', - '' => '擛', - '' => '擳', - '' => '擙', - '' => '攳', - '' => '敿', - '' => '敼', - '' => '斢', - '' => '曈', - '' => '暾', - '' => '曀', - '' => '曊', - '' => '曋', - '' => '曏', - '' => '暽', - '' => '暻', - '' => '暺', - '' => '曌', - '' => '朣', - '' => '樴', - '' => '橦', - '' => '橉', - '' => '橧', - '' => '樲', - '' => '橨', - '' => '樾', - '' => '橝', - '' => '橭', - '' => '橶', - '' => '橛', - '' => '橑', - '' => '樨', - '' => '橚', - '' => '樻', - '' => '樿', - '' => '橁', - '' => '橪', - '' => '橤', - '' => '橐', - '' => '橏', - '' => '橔', - '' => '橯', - '' => '橩', - '' => '橠', - '' => '樼', - '' => '橞', - '' => '橖', - '' => '橕', - '' => '橍', - '' => '橎', - '' => '橆', - '' => '歕', - '' => '歔', - '' => '歖', - '' => '殧', - '' => '殪', - '' => '殫', - '' => '毈', - '' => '毇', - '' => '氄', - '' => '氃', - '' => '氆', - '' => '澭', - '' => '濋', - '' => '澣', - '' => '濇', - '' => '澼', - '' => '濎', - '' => '濈', - '' => '潞', - '' => '濄', - '' => '澽', - '' => '澞', - '' => '濊', - '' => '澨', - '' => '瀄', - '' => '澥', - '' => '澮', - '' => '澺', - '' => '澬', - '' => '澪', - '' => '濏', - '' => '澿', - '' => '澸', - '@' => '澢', - 'A' => '濉', - 'B' => '澫', - 'C' => '濍', - 'D' => '澯', - 'E' => '澲', - 'F' => '澰', - 'G' => '燅', - 'H' => '燂', - 'I' => '熿', - 'J' => '熸', - 'K' => '燖', - 'L' => '燀', - 'M' => '燁', - 'N' => '燋', - 'O' => '燔', - 'P' => '燊', - 'Q' => '燇', - 'R' => '燏', - 'S' => '熽', - 'T' => '燘', - 'U' => '熼', - 'V' => '燆', - 'W' => '燚', - 'X' => '燛', - 'Y' => '犝', - 'Z' => '犞', - '[' => '獩', - '\\' => '獦', - ']' => '獧', - '^' => '獬', - '_' => '獥', - '`' => '獫', - 'a' => '獪', - 'b' => '瑿', - 'c' => '璚', - 'd' => '璠', - 'e' => '璔', - 'f' => '璒', - 'g' => '璕', - 'h' => '璡', - 'i' => '甋', - 'j' => '疀', - 'k' => '瘯', - 'l' => '瘭', - 'm' => '瘱', - 'n' => '瘽', - 'o' => '瘳', - 'p' => '瘼', - 'q' => '瘵', - 'r' => '瘲', - 's' => '瘰', - 't' => '皻', - 'u' => '盦', - 'v' => '瞚', - 'w' => '瞝', - 'x' => '瞡', - 'y' => '瞜', - 'z' => '瞛', - '{' => '瞢', - '|' => '瞣', - '}' => '瞕', - '~' => '瞙', - '' => '瞗', - '' => '磝', - '' => '磩', - '' => '磥', - '' => '磪', - '' => '磞', - '' => '磣', - '' => '磛', - '' => '磡', - '' => '磢', - '' => '磭', - '' => '磟', - '' => '磠', - '' => '禤', - '' => '穄', - '' => '穈', - '' => '穇', - '' => '窶', - '' => '窸', - '' => '窵', - '' => '窱', - '' => '窷', - '' => '篞', - '' => '篣', - '' => '篧', - '' => '篝', - '' => '篕', - '' => '篥', - '' => '篚', - '' => '篨', - '' => '篹', - '' => '篔', - '' => '篪', - '' => '篢', - '' => '篜', - '' => '篫', - '' => '篘', - '' => '篟', - '' => '糒', - '' => '糔', - '' => '糗', - '' => '糐', - '' => '糑', - '' => '縒', - '' => '縡', - '' => '縗', - '' => '縌', - '' => '縟', - '' => '縠', - '' => '縓', - '' => '縎', - '' => '縜', - '' => '縕', - '' => '縚', - '' => '縢', - '' => '縋', - '' => '縏', - '' => '縖', - '' => '縍', - '' => '縔', - '' => '縥', - '' => '縤', - '' => '罃', - '' => '罻', - '' => '罼', - '' => '罺', - '' => '羱', - '' => '翯', - '' => '耪', - '' => '耩', - '' => '聬', - '' => '膱', - '' => '膦', - '' => '膮', - '' => '膹', - '' => '膵', - '' => '膫', - '' => '膰', - '' => '膬', - '' => '膴', - '' => '膲', - '' => '膷', - '' => '膧', - '' => '臲', - '' => '艕', - '' => '艖', - '' => '艗', - '' => '蕖', - '' => '蕅', - '' => '蕫', - '' => '蕍', - '' => '蕓', - '' => '蕡', - '' => '蕘', - '@' => '蕀', - 'A' => '蕆', - 'B' => '蕤', - 'C' => '蕁', - 'D' => '蕢', - 'E' => '蕄', - 'F' => '蕑', - 'G' => '蕇', - 'H' => '蕣', - 'I' => '蔾', - 'J' => '蕛', - 'K' => '蕱', - 'L' => '蕎', - 'M' => '蕮', - 'N' => '蕵', - 'O' => '蕕', - 'P' => '蕧', - 'Q' => '蕠', - 'R' => '薌', - 'S' => '蕦', - 'T' => '蕝', - 'U' => '蕔', - 'V' => '蕥', - 'W' => '蕬', - 'X' => '虣', - 'Y' => '虥', - 'Z' => '虤', - '[' => '螛', - '\\' => '螏', - ']' => '螗', - '^' => '螓', - '_' => '螒', - '`' => '螈', - 'a' => '螁', - 'b' => '螖', - 'c' => '螘', - 'd' => '蝹', - 'e' => '螇', - 'f' => '螣', - 'g' => '螅', - 'h' => '螐', - 'i' => '螑', - 'j' => '螝', - 'k' => '螄', - 'l' => '螔', - 'm' => '螜', - 'n' => '螚', - 'o' => '螉', - 'p' => '褞', - 'q' => '褦', - 'r' => '褰', - 's' => '褭', - 't' => '褮', - 'u' => '褧', - 'v' => '褱', - 'w' => '褢', - 'x' => '褩', - 'y' => '褣', - 'z' => '褯', - '{' => '褬', - '|' => '褟', - '}' => '觱', - '~' => '諠', - '' => '諢', - '' => '諲', - '' => '諴', - '' => '諵', - '' => '諝', - '' => '謔', - '' => '諤', - '' => '諟', - '' => '諰', - '' => '諈', - '' => '諞', - '' => '諡', - '' => '諨', - '' => '諿', - '' => '諯', - '' => '諻', - '' => '貑', - '' => '貒', - '' => '貐', - '' => '賵', - '' => '賮', - '' => '賱', - '' => '賰', - '' => '賳', - '' => '赬', - '' => '赮', - '' => '趥', - '' => '趧', - '' => '踳', - '' => '踾', - '' => '踸', - '' => '蹀', - '' => '蹅', - '' => '踶', - '' => '踼', - '' => '踽', - '' => '蹁', - '' => '踰', - '' => '踿', - '' => '躽', - '' => '輶', - '' => '輮', - '' => '輵', - '' => '輲', - '' => '輹', - '' => '輷', - '' => '輴', - '' => '遶', - '' => '遹', - '' => '遻', - '' => '邆', - '' => '郺', - '' => '鄳', - '' => '鄵', - '' => '鄶', - '' => '醓', - '' => '醐', - '' => '醑', - '' => '醍', - '' => '醏', - '' => '錧', - '' => '錞', - '' => '錈', - '' => '錟', - '' => '錆', - '' => '錏', - '' => '鍺', - '' => '錸', - '' => '錼', - '' => '錛', - '' => '錣', - '' => '錒', - '' => '錁', - '' => '鍆', - '' => '錭', - '' => '錎', - '' => '錍', - '' => '鋋', - '' => '錝', - '' => '鋺', - '' => '錥', - '' => '錓', - '' => '鋹', - '' => '鋷', - '' => '錴', - '' => '錂', - '' => '錤', - '' => '鋿', - '' => '錩', - '' => '錹', - '' => '錵', - '' => '錪', - '' => '錔', - '' => '錌', - '@' => '錋', - 'A' => '鋾', - 'B' => '錉', - 'C' => '錀', - 'D' => '鋻', - 'E' => '錖', - 'F' => '閼', - 'G' => '闍', - 'H' => '閾', - 'I' => '閹', - 'J' => '閺', - 'K' => '閶', - 'L' => '閿', - 'M' => '閵', - 'N' => '閽', - 'O' => '隩', - 'P' => '雔', - 'Q' => '霋', - 'R' => '霒', - 'S' => '霐', - 'T' => '鞙', - 'U' => '鞗', - 'V' => '鞔', - 'W' => '韰', - 'X' => '韸', - 'Y' => '頵', - 'Z' => '頯', - '[' => '頲', - '\\' => '餤', - ']' => '餟', - '^' => '餧', - '_' => '餩', - '`' => '馞', - 'a' => '駮', - 'b' => '駬', - 'c' => '駥', - 'd' => '駤', - 'e' => '駰', - 'f' => '駣', - 'g' => '駪', - 'h' => '駩', - 'i' => '駧', - 'j' => '骹', - 'k' => '骿', - 'l' => '骴', - 'm' => '骻', - 'n' => '髶', - 'o' => '髺', - 'p' => '髹', - 'q' => '髷', - 'r' => '鬳', - 's' => '鮀', - 't' => '鮅', - 'u' => '鮇', - 'v' => '魼', - 'w' => '魾', - 'x' => '魻', - 'y' => '鮂', - 'z' => '鮓', - '{' => '鮒', - '|' => '鮐', - '}' => '魺', - '~' => '鮕', - '' => '魽', - '' => '鮈', - '' => '鴥', - '' => '鴗', - '' => '鴠', - '' => '鴞', - '' => '鴔', - '' => '鴩', - '' => '鴝', - '' => '鴘', - '' => '鴢', - '' => '鴐', - '' => '鴙', - '' => '鴟', - '' => '麈', - '' => '麆', - '' => '麇', - '' => '麮', - '' => '麭', - '' => '黕', - '' => '黖', - '' => '黺', - '' => '鼒', - '' => '鼽', - '' => '儦', - '' => '儥', - '' => '儢', - '' => '儤', - '' => '儠', - '' => '儩', - '' => '勴', - '' => '嚓', - '' => '嚌', - '' => '嚍', - '' => '嚆', - '' => '嚄', - '' => '嚃', - '' => '噾', - '' => '嚂', - '' => '噿', - '' => '嚁', - '' => '壖', - '' => '壔', - '' => '壏', - '' => '壒', - '' => '嬭', - '' => '嬥', - '' => '嬲', - '' => '嬣', - '' => '嬬', - '' => '嬧', - '' => '嬦', - '' => '嬯', - '' => '嬮', - '' => '孻', - '' => '寱', - '' => '寲', - '' => '嶷', - '' => '幬', - '' => '幪', - '' => '徾', - '' => '徻', - '' => '懃', - '' => '憵', - '' => '憼', - '' => '懧', - '' => '懠', - '' => '懥', - '' => '懤', - '' => '懨', - '' => '懞', - '' => '擯', - '' => '擩', - '' => '擣', - '' => '擫', - '' => '擤', - '' => '擨', - '' => '斁', - '' => '斀', - '' => '斶', - '' => '旚', - '' => '曒', - '' => '檍', - '' => '檖', - '' => '檁', - '' => '檥', - '' => '檉', - '' => '檟', - '' => '檛', - '' => '檡', - '' => '檞', - '' => '檇', - '' => '檓', - '' => '檎', - '@' => '檕', - 'A' => '檃', - 'B' => '檨', - 'C' => '檤', - 'D' => '檑', - 'E' => '橿', - 'F' => '檦', - 'G' => '檚', - 'H' => '檅', - 'I' => '檌', - 'J' => '檒', - 'K' => '歛', - 'L' => '殭', - 'M' => '氉', - 'N' => '濌', - 'O' => '澩', - 'P' => '濴', - 'Q' => '濔', - 'R' => '濣', - 'S' => '濜', - 'T' => '濭', - 'U' => '濧', - 'V' => '濦', - 'W' => '濞', - 'X' => '濲', - 'Y' => '濝', - 'Z' => '濢', - '[' => '濨', - '\\' => '燡', - ']' => '燱', - '^' => '燨', - '_' => '燲', - '`' => '燤', - 'a' => '燰', - 'b' => '燢', - 'c' => '獳', - 'd' => '獮', - 'e' => '獯', - 'f' => '璗', - 'g' => '璲', - 'h' => '璫', - 'i' => '璐', - 'j' => '璪', - 'k' => '璭', - 'l' => '璱', - 'm' => '璥', - 'n' => '璯', - 'o' => '甐', - 'p' => '甑', - 'q' => '甒', - 'r' => '甏', - 's' => '疄', - 't' => '癃', - 'u' => '癈', - 'v' => '癉', - 'w' => '癇', - 'x' => '皤', - 'y' => '盩', - 'z' => '瞵', - '{' => '瞫', - '|' => '瞲', - '}' => '瞷', - '~' => '瞶', - '' => '瞴', - '' => '瞱', - '' => '瞨', - '' => '矰', - '' => '磳', - '' => '磽', - '' => '礂', - '' => '磻', - '' => '磼', - '' => '磲', - '' => '礅', - '' => '磹', - '' => '磾', - '' => '礄', - '' => '禫', - '' => '禨', - '' => '穜', - '' => '穛', - '' => '穖', - '' => '穘', - '' => '穔', - '' => '穚', - '' => '窾', - '' => '竀', - '' => '竁', - '' => '簅', - '' => '簏', - '' => '篲', - '' => '簀', - '' => '篿', - '' => '篻', - '' => '簎', - '' => '篴', - '' => '簋', - '' => '篳', - '' => '簂', - '' => '簉', - '' => '簃', - '' => '簁', - '' => '篸', - '' => '篽', - '' => '簆', - '' => '篰', - '' => '篱', - '' => '簐', - '' => '簊', - '' => '糨', - '' => '縭', - '' => '縼', - '' => '繂', - '' => '縳', - '' => '顈', - '' => '縸', - '' => '縪', - '' => '繉', - '' => '繀', - '' => '繇', - '' => '縩', - '' => '繌', - '' => '縰', - '' => '縻', - '' => '縶', - '' => '繄', - '' => '縺', - '' => '罅', - '' => '罿', - '' => '罾', - '' => '罽', - '' => '翴', - '' => '翲', - '' => '耬', - '' => '膻', - '' => '臄', - '' => '臌', - '' => '臊', - '' => '臅', - '' => '臇', - '' => '膼', - '' => '臩', - '' => '艛', - '' => '艚', - '' => '艜', - '' => '薃', - '' => '薀', - '' => '薏', - '' => '薧', - '' => '薕', - '' => '薠', - '' => '薋', - '' => '薣', - '' => '蕻', - '' => '薤', - '' => '薚', - '' => '薞', - '@' => '蕷', - 'A' => '蕼', - 'B' => '薉', - 'C' => '薡', - 'D' => '蕺', - 'E' => '蕸', - 'F' => '蕗', - 'G' => '薎', - 'H' => '薖', - 'I' => '薆', - 'J' => '薍', - 'K' => '薙', - 'L' => '薝', - 'M' => '薁', - 'N' => '薢', - 'O' => '薂', - 'P' => '薈', - 'Q' => '薅', - 'R' => '蕹', - 'S' => '蕶', - 'T' => '薘', - 'U' => '薐', - 'V' => '薟', - 'W' => '虨', - 'X' => '螾', - 'Y' => '螪', - 'Z' => '螭', - '[' => '蟅', - '\\' => '螰', - ']' => '螬', - '^' => '螹', - '_' => '螵', - '`' => '螼', - 'a' => '螮', - 'b' => '蟉', - 'c' => '蟃', - 'd' => '蟂', - 'e' => '蟌', - 'f' => '螷', - 'g' => '螯', - 'h' => '蟄', - 'i' => '蟊', - 'j' => '螴', - 'k' => '螶', - 'l' => '螿', - 'm' => '螸', - 'n' => '螽', - 'o' => '蟞', - 'p' => '螲', - 'q' => '褵', - 'r' => '褳', - 's' => '褼', - 't' => '褾', - 'u' => '襁', - 'v' => '襒', - 'w' => '褷', - 'x' => '襂', - 'y' => '覭', - 'z' => '覯', - '{' => '覮', - '|' => '觲', - '}' => '觳', - '~' => '謞', - '' => '謘', - '' => '謖', - '' => '謑', - '' => '謅', - '' => '謋', - '' => '謢', - '' => '謏', - '' => '謒', - '' => '謕', - '' => '謇', - '' => '謍', - '' => '謈', - '' => '謆', - '' => '謜', - '' => '謓', - '' => '謚', - '' => '豏', - '' => '豰', - '' => '豲', - '' => '豱', - '' => '豯', - '' => '貕', - '' => '貔', - '' => '賹', - '' => '赯', - '' => '蹎', - '' => '蹍', - '' => '蹓', - '' => '蹐', - '' => '蹌', - '' => '蹇', - '' => '轃', - '' => '轀', - '' => '邅', - '' => '遾', - '' => '鄸', - '' => '醚', - '' => '醢', - '' => '醛', - '' => '醙', - '' => '醟', - '' => '醡', - '' => '醝', - '' => '醠', - '' => '鎡', - '' => '鎃', - '' => '鎯', - '' => '鍤', - '' => '鍖', - '' => '鍇', - '' => '鍼', - '' => '鍘', - '' => '鍜', - '' => '鍶', - '' => '鍉', - '' => '鍐', - '' => '鍑', - '' => '鍠', - '' => '鍭', - '' => '鎏', - '' => '鍌', - '' => '鍪', - '' => '鍹', - '' => '鍗', - '' => '鍕', - '' => '鍒', - '' => '鍏', - '' => '鍱', - '' => '鍷', - '' => '鍻', - '' => '鍡', - '' => '鍞', - '' => '鍣', - '' => '鍧', - '' => '鎀', - '' => '鍎', - '' => '鍙', - '' => '闇', - '' => '闀', - '' => '闉', - '' => '闃', - '' => '闅', - '' => '閷', - '' => '隮', - '' => '隰', - '' => '隬', - '' => '霠', - '' => '霟', - '' => '霘', - '' => '霝', - '' => '霙', - '' => '鞚', - '' => '鞡', - '' => '鞜', - '@' => '鞞', - 'A' => '鞝', - 'B' => '韕', - 'C' => '韔', - 'D' => '韱', - 'E' => '顁', - 'F' => '顄', - 'G' => '顊', - 'H' => '顉', - 'I' => '顅', - 'J' => '顃', - 'K' => '餥', - 'L' => '餫', - 'M' => '餬', - 'N' => '餪', - 'O' => '餳', - 'P' => '餲', - 'Q' => '餯', - 'R' => '餭', - 'S' => '餱', - 'T' => '餰', - 'U' => '馘', - 'V' => '馣', - 'W' => '馡', - 'X' => '騂', - 'Y' => '駺', - 'Z' => '駴', - '[' => '駷', - '\\' => '駹', - ']' => '駸', - '^' => '駶', - '_' => '駻', - '`' => '駽', - 'a' => '駾', - 'b' => '駼', - 'c' => '騃', - 'd' => '骾', - 'e' => '髾', - 'f' => '髽', - 'g' => '鬁', - 'h' => '髼', - 'i' => '魈', - 'j' => '鮚', - 'k' => '鮨', - 'l' => '鮞', - 'm' => '鮛', - 'n' => '鮦', - 'o' => '鮡', - 'p' => '鮥', - 'q' => '鮤', - 'r' => '鮆', - 's' => '鮢', - 't' => '鮠', - 'u' => '鮯', - 'v' => '鴳', - 'w' => '鵁', - 'x' => '鵧', - 'y' => '鴶', - 'z' => '鴮', - '{' => '鴯', - '|' => '鴱', - '}' => '鴸', - '~' => '鴰', - '' => '鵅', - '' => '鵂', - '' => '鵃', - '' => '鴾', - '' => '鴷', - '' => '鵀', - '' => '鴽', - '' => '翵', - '' => '鴭', - '' => '麊', - '' => '麉', - '' => '麍', - '' => '麰', - '' => '黈', - '' => '黚', - '' => '黻', - '' => '黿', - '' => '鼤', - '' => '鼣', - '' => '鼢', - '' => '齔', - '' => '龠', - '' => '儱', - '' => '儭', - '' => '儮', - '' => '嚘', - '' => '嚜', - '' => '嚗', - '' => '嚚', - '' => '嚝', - '' => '嚙', - '' => '奰', - '' => '嬼', - '' => '屩', - '' => '屪', - '' => '巀', - '' => '幭', - '' => '幮', - '' => '懘', - '' => '懟', - '' => '懭', - '' => '懮', - '' => '懱', - '' => '懪', - '' => '懰', - '' => '懫', - '' => '懖', - '' => '懩', - '' => '擿', - '' => '攄', - '' => '擽', - '' => '擸', - '' => '攁', - '' => '攃', - '' => '擼', - '' => '斔', - '' => '旛', - '' => '曚', - '' => '曛', - '' => '曘', - '' => '櫅', - '' => '檹', - '' => '檽', - '' => '櫡', - '' => '櫆', - '' => '檺', - '' => '檶', - '' => '檷', - '' => '櫇', - '' => '檴', - '' => '檭', - '' => '歞', - '' => '毉', - '' => '氋', - '' => '瀇', - '' => '瀌', - '' => '瀍', - '' => '瀁', - '' => '瀅', - '' => '瀔', - '' => '瀎', - '' => '濿', - '' => '瀀', - '' => '濻', - '' => '瀦', - '' => '濼', - '' => '濷', - '' => '瀊', - '' => '爁', - '' => '燿', - '' => '燹', - '' => '爃', - '' => '燽', - '' => '獶', - '@' => '璸', - 'A' => '瓀', - 'B' => '璵', - 'C' => '瓁', - 'D' => '璾', - 'E' => '璶', - 'F' => '璻', - 'G' => '瓂', - 'H' => '甔', - 'I' => '甓', - 'J' => '癜', - 'K' => '癤', - 'L' => '癙', - 'M' => '癐', - 'N' => '癓', - 'O' => '癗', - 'P' => '癚', - 'Q' => '皦', - 'R' => '皽', - 'S' => '盬', - 'T' => '矂', - 'U' => '瞺', - 'V' => '磿', - 'W' => '礌', - 'X' => '礓', - 'Y' => '礔', - 'Z' => '礉', - '[' => '礐', - '\\' => '礒', - ']' => '礑', - '^' => '禭', - '_' => '禬', - '`' => '穟', - 'a' => '簜', - 'b' => '簩', - 'c' => '簙', - 'd' => '簠', - 'e' => '簟', - 'f' => '簭', - 'g' => '簝', - 'h' => '簦', - 'i' => '簨', - 'j' => '簢', - 'k' => '簥', - 'l' => '簰', - 'm' => '繜', - 'n' => '繐', - 'o' => '繖', - 'p' => '繣', - 'q' => '繘', - 'r' => '繢', - 's' => '繟', - 't' => '繑', - 'u' => '繠', - 'v' => '繗', - 'w' => '繓', - 'x' => '羵', - 'y' => '羳', - 'z' => '翷', - '{' => '翸', - '|' => '聵', - '}' => '臑', - '~' => '臒', - '' => '臐', - '' => '艟', - '' => '艞', - '' => '薴', - '' => '藆', - '' => '藀', - '' => '藃', - '' => '藂', - '' => '薳', - '' => '薵', - '' => '薽', - '' => '藇', - '' => '藄', - '' => '薿', - '' => '藋', - '' => '藎', - '' => '藈', - '' => '藅', - '' => '薱', - '' => '薶', - '' => '藒', - '' => '蘤', - '' => '薸', - '' => '薷', - '' => '薾', - '' => '虩', - '' => '蟧', - '' => '蟦', - '' => '蟢', - '' => '蟛', - '' => '蟫', - '' => '蟪', - '' => '蟥', - '' => '蟟', - '' => '蟳', - '' => '蟤', - '' => '蟔', - '' => '蟜', - '' => '蟓', - '' => '蟭', - '' => '蟘', - '' => '蟣', - '' => '螤', - '' => '蟗', - '' => '蟙', - '' => '蠁', - '' => '蟴', - '' => '蟨', - '' => '蟝', - '' => '襓', - '' => '襋', - '' => '襏', - '' => '襌', - '' => '襆', - '' => '襐', - '' => '襑', - '' => '襉', - '' => '謪', - '' => '謧', - '' => '謣', - '' => '謳', - '' => '謰', - '' => '謵', - '' => '譇', - '' => '謯', - '' => '謼', - '' => '謾', - '' => '謱', - '' => '謥', - '' => '謷', - '' => '謦', - '' => '謶', - '' => '謮', - '' => '謤', - '' => '謻', - '' => '謽', - '' => '謺', - '' => '豂', - '' => '豵', - '' => '貙', - '' => '貘', - '' => '貗', - '' => '賾', - '' => '贄', - '' => '贂', - '' => '贀', - '' => '蹜', - '' => '蹢', - '' => '蹠', - '' => '蹗', - '' => '蹖', - '' => '蹞', - '' => '蹥', - '' => '蹧', - '@' => '蹛', - 'A' => '蹚', - 'B' => '蹡', - 'C' => '蹝', - 'D' => '蹩', - 'E' => '蹔', - 'F' => '轆', - 'G' => '轇', - 'H' => '轈', - 'I' => '轋', - 'J' => '鄨', - 'K' => '鄺', - 'L' => '鄻', - 'M' => '鄾', - 'N' => '醨', - 'O' => '醥', - 'P' => '醧', - 'Q' => '醯', - 'R' => '醪', - 'S' => '鎵', - 'T' => '鎌', - 'U' => '鎒', - 'V' => '鎷', - 'W' => '鎛', - 'X' => '鎝', - 'Y' => '鎉', - 'Z' => '鎧', - '[' => '鎎', - '\\' => '鎪', - ']' => '鎞', - '^' => '鎦', - '_' => '鎕', - '`' => '鎈', - 'a' => '鎙', - 'b' => '鎟', - 'c' => '鎍', - 'd' => '鎱', - 'e' => '鎑', - 'f' => '鎲', - 'g' => '鎤', - 'h' => '鎨', - 'i' => '鎴', - 'j' => '鎣', - 'k' => '鎥', - 'l' => '闒', - 'm' => '闓', - 'n' => '闑', - 'o' => '隳', - 'p' => '雗', - 'q' => '雚', - 'r' => '巂', - 's' => '雟', - 't' => '雘', - 'u' => '雝', - 'v' => '霣', - 'w' => '霢', - 'x' => '霥', - 'y' => '鞬', - 'z' => '鞮', - '{' => '鞨', - '|' => '鞫', - '}' => '鞤', - '~' => '鞪', - '' => '鞢', - '' => '鞥', - '' => '韗', - '' => '韙', - '' => '韖', - '' => '韘', - '' => '韺', - '' => '顐', - '' => '顑', - '' => '顒', - '' => '颸', - '' => '饁', - '' => '餼', - '' => '餺', - '' => '騏', - '' => '騋', - '' => '騉', - '' => '騍', - '' => '騄', - '' => '騑', - '' => '騊', - '' => '騅', - '' => '騇', - '' => '騆', - '' => '髀', - '' => '髜', - '' => '鬈', - '' => '鬄', - '' => '鬅', - '' => '鬩', - '' => '鬵', - '' => '魊', - '' => '魌', - '' => '魋', - '' => '鯇', - '' => '鯆', - '' => '鯃', - '' => '鮿', - '' => '鯁', - '' => '鮵', - '' => '鮸', - '' => '鯓', - '' => '鮶', - '' => '鯄', - '' => '鮹', - '' => '鮽', - '' => '鵜', - '' => '鵓', - '' => '鵏', - '' => '鵊', - '' => '鵛', - '' => '鵋', - '' => '鵙', - '' => '鵖', - '' => '鵌', - '' => '鵗', - '' => '鵒', - '' => '鵔', - '' => '鵟', - '' => '鵘', - '' => '鵚', - '' => '麎', - '' => '麌', - '' => '黟', - '' => '鼁', - '' => '鼀', - '' => '鼖', - '' => '鼥', - '' => '鼫', - '' => '鼪', - '' => '鼩', - '' => '鼨', - '' => '齌', - '' => '齕', - '' => '儴', - '' => '儵', - '' => '劖', - '' => '勷', - '' => '厴', - '' => '嚫', - '' => '嚭', - '' => '嚦', - '' => '嚧', - '' => '嚪', - '' => '嚬', - '' => '壚', - '' => '壝', - '' => '壛', - '' => '夒', - '' => '嬽', - '' => '嬾', - '' => '嬿', - '' => '巃', - '' => '幰', - '@' => '徿', - 'A' => '懻', - 'B' => '攇', - 'C' => '攐', - 'D' => '攍', - 'E' => '攉', - 'F' => '攌', - 'G' => '攎', - 'H' => '斄', - 'I' => '旞', - 'J' => '旝', - 'K' => '曞', - 'L' => '櫧', - 'M' => '櫠', - 'N' => '櫌', - 'O' => '櫑', - 'P' => '櫙', - 'Q' => '櫋', - 'R' => '櫟', - 'S' => '櫜', - 'T' => '櫐', - 'U' => '櫫', - 'V' => '櫏', - 'W' => '櫍', - 'X' => '櫞', - 'Y' => '歠', - 'Z' => '殰', - '[' => '氌', - '\\' => '瀙', - ']' => '瀧', - '^' => '瀠', - '_' => '瀖', - '`' => '瀫', - 'a' => '瀡', - 'b' => '瀢', - 'c' => '瀣', - 'd' => '瀩', - 'e' => '瀗', - 'f' => '瀤', - 'g' => '瀜', - 'h' => '瀪', - 'i' => '爌', - 'j' => '爊', - 'k' => '爇', - 'l' => '爂', - 'm' => '爅', - 'n' => '犥', - 'o' => '犦', - 'p' => '犤', - 'q' => '犣', - 'r' => '犡', - 's' => '瓋', - 't' => '瓅', - 'u' => '璷', - 'v' => '瓃', - 'w' => '甖', - 'x' => '癠', - 'y' => '矉', - 'z' => '矊', - '{' => '矄', - '|' => '矱', - '}' => '礝', - '~' => '礛', - '' => '礡', - '' => '礜', - '' => '礗', - '' => '礞', - '' => '禰', - '' => '穧', - '' => '穨', - '' => '簳', - '' => '簼', - '' => '簹', - '' => '簬', - '' => '簻', - '' => '糬', - '' => '糪', - '' => '繶', - '' => '繵', - '' => '繸', - '' => '繰', - '' => '繷', - '' => '繯', - '' => '繺', - '' => '繲', - '' => '繴', - '' => '繨', - '' => '罋', - '' => '罊', - '' => '羃', - '' => '羆', - '' => '羷', - '' => '翽', - '' => '翾', - '' => '聸', - '' => '臗', - '' => '臕', - '' => '艤', - '' => '艡', - '' => '艣', - '' => '藫', - '' => '藱', - '' => '藭', - '' => '藙', - '' => '藡', - '' => '藨', - '' => '藚', - '' => '藗', - '' => '藬', - '' => '藲', - '' => '藸', - '' => '藘', - '' => '藟', - '' => '藣', - '' => '藜', - '' => '藑', - '' => '藰', - '' => '藦', - '' => '藯', - '' => '藞', - '' => '藢', - '' => '蠀', - '' => '蟺', - '' => '蠃', - '' => '蟶', - '' => '蟷', - '' => '蠉', - '' => '蠌', - '' => '蠋', - '' => '蠆', - '' => '蟼', - '' => '蠈', - '' => '蟿', - '' => '蠊', - '' => '蠂', - '' => '襢', - '' => '襚', - '' => '襛', - '' => '襗', - '' => '襡', - '' => '襜', - '' => '襘', - '' => '襝', - '' => '襙', - '' => '覈', - '' => '覷', - '' => '覶', - '' => '觶', - '' => '譐', - '' => '譈', - '' => '譊', - '' => '譀', - '' => '譓', - '' => '譖', - '' => '譔', - '' => '譋', - '' => '譕', - '@' => '譑', - 'A' => '譂', - 'B' => '譒', - 'C' => '譗', - 'D' => '豃', - 'E' => '豷', - 'F' => '豶', - 'G' => '貚', - 'H' => '贆', - 'I' => '贇', - 'J' => '贉', - 'K' => '趬', - 'L' => '趪', - 'M' => '趭', - 'N' => '趫', - 'O' => '蹭', - 'P' => '蹸', - 'Q' => '蹳', - 'R' => '蹪', - 'S' => '蹯', - 'T' => '蹻', - 'U' => '軂', - 'V' => '轒', - 'W' => '轑', - 'X' => '轏', - 'Y' => '轐', - 'Z' => '轓', - '[' => '辴', - '\\' => '酀', - ']' => '鄿', - '^' => '醰', - '_' => '醭', - '`' => '鏞', - 'a' => '鏇', - 'b' => '鏏', - 'c' => '鏂', - 'd' => '鏚', - 'e' => '鏐', - 'f' => '鏹', - 'g' => '鏬', - 'h' => '鏌', - 'i' => '鏙', - 'j' => '鎩', - 'k' => '鏦', - 'l' => '鏊', - 'm' => '鏔', - 'n' => '鏮', - 'o' => '鏣', - 'p' => '鏕', - 'q' => '鏄', - 'r' => '鏎', - 's' => '鏀', - 't' => '鏒', - 'u' => '鏧', - 'v' => '镽', - 'w' => '闚', - 'x' => '闛', - 'y' => '雡', - 'z' => '霩', - '{' => '霫', - '|' => '霬', - '}' => '霨', - '~' => '霦', - '' => '鞳', - '' => '鞷', - '' => '鞶', - '' => '韝', - '' => '韞', - '' => '韟', - '' => '顜', - '' => '顙', - '' => '顝', - '' => '顗', - '' => '颿', - '' => '颽', - '' => '颻', - '' => '颾', - '' => '饈', - '' => '饇', - '' => '饃', - '' => '馦', - '' => '馧', - '' => '騚', - '' => '騕', - '' => '騥', - '' => '騝', - '' => '騤', - '' => '騛', - '' => '騢', - '' => '騠', - '' => '騧', - '' => '騣', - '' => '騞', - '' => '騜', - '' => '騔', - '' => '髂', - '' => '鬋', - '' => '鬊', - '' => '鬎', - '' => '鬌', - '' => '鬷', - '' => '鯪', - '' => '鯫', - '' => '鯠', - '' => '鯞', - '' => '鯤', - '' => '鯦', - '' => '鯢', - '' => '鯰', - '' => '鯔', - '' => '鯗', - '' => '鯬', - '' => '鯜', - '' => '鯙', - '' => '鯥', - '' => '鯕', - '' => '鯡', - '' => '鯚', - '' => '鵷', - '' => '鶁', - '' => '鶊', - '' => '鶄', - '' => '鶈', - '' => '鵱', - '' => '鶀', - '' => '鵸', - '' => '鶆', - '' => '鶋', - '' => '鶌', - '' => '鵽', - '' => '鵫', - '' => '鵴', - '' => '鵵', - '' => '鵰', - '' => '鵩', - '' => '鶅', - '' => '鵳', - '' => '鵻', - '' => '鶂', - '' => '鵯', - '' => '鵹', - '' => '鵿', - '' => '鶇', - '' => '鵨', - '' => '麔', - '' => '麑', - '' => '黀', - '' => '黼', - '' => '鼭', - '' => '齀', - '' => '齁', - '' => '齍', - '' => '齖', - '' => '齗', - '' => '齘', - '' => '匷', - '' => '嚲', - '@' => '嚵', - 'A' => '嚳', - 'B' => '壣', - 'C' => '孅', - 'D' => '巆', - 'E' => '巇', - 'F' => '廮', - 'G' => '廯', - 'H' => '忀', - 'I' => '忁', - 'J' => '懹', - 'K' => '攗', - 'L' => '攖', - 'M' => '攕', - 'N' => '攓', - 'O' => '旟', - 'P' => '曨', - 'Q' => '曣', - 'R' => '曤', - 'S' => '櫳', - 'T' => '櫰', - 'U' => '櫪', - 'V' => '櫨', - 'W' => '櫹', - 'X' => '櫱', - 'Y' => '櫮', - 'Z' => '櫯', - '[' => '瀼', - '\\' => '瀵', - ']' => '瀯', - '^' => '瀷', - '_' => '瀴', - '`' => '瀱', - 'a' => '灂', - 'b' => '瀸', - 'c' => '瀿', - 'd' => '瀺', - 'e' => '瀹', - 'f' => '灀', - 'g' => '瀻', - 'h' => '瀳', - 'i' => '灁', - 'j' => '爓', - 'k' => '爔', - 'l' => '犨', - 'm' => '獽', - 'n' => '獼', - 'o' => '璺', - 'p' => '皫', - 'q' => '皪', - 'r' => '皾', - 's' => '盭', - 't' => '矌', - 'u' => '矎', - 'v' => '矏', - 'w' => '矍', - 'x' => '矲', - 'y' => '礥', - 'z' => '礣', - '{' => '礧', - '|' => '礨', - '}' => '礤', - '~' => '礩', - '' => '禲', - '' => '穮', - '' => '穬', - '' => '穭', - '' => '竷', - '' => '籉', - '' => '籈', - '' => '籊', - '' => '籇', - '' => '籅', - '' => '糮', - '' => '繻', - '' => '繾', - '' => '纁', - '' => '纀', - '' => '羺', - '' => '翿', - '' => '聹', - '' => '臛', - '' => '臙', - '' => '舋', - '' => '艨', - '' => '艩', - '' => '蘢', - '' => '藿', - '' => '蘁', - '' => '藾', - '' => '蘛', - '' => '蘀', - '' => '藶', - '' => '蘄', - '' => '蘉', - '' => '蘅', - '' => '蘌', - '' => '藽', - '' => '蠙', - '' => '蠐', - '' => '蠑', - '' => '蠗', - '' => '蠓', - '' => '蠖', - '' => '襣', - '' => '襦', - '' => '覹', - '' => '觷', - '' => '譠', - '' => '譪', - '' => '譝', - '' => '譨', - '' => '譣', - '' => '譥', - '' => '譧', - '' => '譭', - '' => '趮', - '' => '躆', - '' => '躈', - '' => '躄', - '' => '轙', - '' => '轖', - '' => '轗', - '' => '轕', - '' => '轘', - '' => '轚', - '' => '邍', - '' => '酃', - '' => '酁', - '' => '醷', - '' => '醵', - '' => '醲', - '' => '醳', - '' => '鐋', - '' => '鐓', - '' => '鏻', - '' => '鐠', - '' => '鐏', - '' => '鐔', - '' => '鏾', - '' => '鐕', - '' => '鐐', - '' => '鐨', - '' => '鐙', - '' => '鐍', - '' => '鏵', - '' => '鐀', - '' => '鏷', - '' => '鐇', - '' => '鐎', - '' => '鐖', - '' => '鐒', - '' => '鏺', - '' => '鐉', - '' => '鏸', - '' => '鐊', - '' => '鏿', - '@' => '鏼', - 'A' => '鐌', - 'B' => '鏶', - 'C' => '鐑', - 'D' => '鐆', - 'E' => '闞', - 'F' => '闠', - 'G' => '闟', - 'H' => '霮', - 'I' => '霯', - 'J' => '鞹', - 'K' => '鞻', - 'L' => '韽', - 'M' => '韾', - 'N' => '顠', - 'O' => '顢', - 'P' => '顣', - 'Q' => '顟', - 'R' => '飁', - 'S' => '飂', - 'T' => '饐', - 'U' => '饎', - 'V' => '饙', - 'W' => '饌', - 'X' => '饋', - 'Y' => '饓', - 'Z' => '騲', - '[' => '騴', - '\\' => '騱', - ']' => '騬', - '^' => '騪', - '_' => '騶', - '`' => '騩', - 'a' => '騮', - 'b' => '騸', - 'c' => '騭', - 'd' => '髇', - 'e' => '髊', - 'f' => '髆', - 'g' => '鬐', - 'h' => '鬒', - 'i' => '鬑', - 'j' => '鰋', - 'k' => '鰈', - 'l' => '鯷', - 'm' => '鰅', - 'n' => '鰒', - 'o' => '鯸', - 'p' => '鱀', - 'q' => '鰇', - 'r' => '鰎', - 's' => '鰆', - 't' => '鰗', - 'u' => '鰔', - 'v' => '鰉', - 'w' => '鶟', - 'x' => '鶙', - 'y' => '鶤', - 'z' => '鶝', - '{' => '鶒', - '|' => '鶘', - '}' => '鶐', - '~' => '鶛', - '' => '鶠', - '' => '鶔', - '' => '鶜', - '' => '鶪', - '' => '鶗', - '' => '鶡', - '' => '鶚', - '' => '鶢', - '' => '鶨', - '' => '鶞', - '' => '鶣', - '' => '鶿', - '' => '鶩', - '' => '鶖', - '' => '鶦', - '' => '鶧', - '' => '麙', - '' => '麛', - '' => '麚', - '' => '黥', - '' => '黤', - '' => '黧', - '' => '黦', - '' => '鼰', - '' => '鼮', - '' => '齛', - '' => '齠', - '' => '齞', - '' => '齝', - '' => '齙', - '' => '龑', - '' => '儺', - '' => '儹', - '' => '劘', - '' => '劗', - '' => '囃', - '' => '嚽', - '' => '嚾', - '' => '孈', - '' => '孇', - '' => '巋', - '' => '巏', - '' => '廱', - '' => '懽', - '' => '攛', - '' => '欂', - '' => '櫼', - '' => '欃', - '' => '櫸', - '' => '欀', - '' => '灃', - '' => '灄', - '' => '灊', - '' => '灈', - '' => '灉', - '' => '灅', - '' => '灆', - '' => '爝', - '' => '爚', - '' => '爙', - '' => '獾', - '' => '甗', - '' => '癪', - '' => '矐', - '' => '礭', - '' => '礱', - '' => '礯', - '' => '籔', - '' => '籓', - '' => '糲', - '' => '纊', - '' => '纇', - '' => '纈', - '' => '纋', - '' => '纆', - '' => '纍', - '' => '罍', - '' => '羻', - '' => '耰', - '' => '臝', - '' => '蘘', - '' => '蘪', - '' => '蘦', - '' => '蘟', - '' => '蘣', - '' => '蘜', - '' => '蘙', - '' => '蘧', - '' => '蘮', - '' => '蘡', - '' => '蘠', - '' => '蘩', - '' => '蘞', - '' => '蘥', - '@' => '蠩', - 'A' => '蠝', - 'B' => '蠛', - 'C' => '蠠', - 'D' => '蠤', - 'E' => '蠜', - 'F' => '蠫', - 'G' => '衊', - 'H' => '襭', - 'I' => '襩', - 'J' => '襮', - 'K' => '襫', - 'L' => '觺', - 'M' => '譹', - 'N' => '譸', - 'O' => '譅', - 'P' => '譺', - 'Q' => '譻', - 'R' => '贐', - 'S' => '贔', - 'T' => '趯', - 'U' => '躎', - 'V' => '躌', - 'W' => '轞', - 'X' => '轛', - 'Y' => '轝', - 'Z' => '酆', - '[' => '酄', - '\\' => '酅', - ']' => '醹', - '^' => '鐿', - '_' => '鐻', - '`' => '鐶', - 'a' => '鐩', - 'b' => '鐽', - 'c' => '鐼', - 'd' => '鐰', - 'e' => '鐹', - 'f' => '鐪', - 'g' => '鐷', - 'h' => '鐬', - 'i' => '鑀', - 'j' => '鐱', - 'k' => '闥', - 'l' => '闤', - 'm' => '闣', - 'n' => '霵', - 'o' => '霺', - 'p' => '鞿', - 'q' => '韡', - 'r' => '顤', - 's' => '飉', - 't' => '飆', - 'u' => '飀', - 'v' => '饘', - 'w' => '饖', - 'x' => '騹', - 'y' => '騽', - 'z' => '驆', - '{' => '驄', - '|' => '驂', - '}' => '驁', - '~' => '騺', - '' => '騿', - '' => '髍', - '' => '鬕', - '' => '鬗', - '' => '鬘', - '' => '鬖', - '' => '鬺', - '' => '魒', - '' => '鰫', - '' => '鰝', - '' => '鰜', - '' => '鰬', - '' => '鰣', - '' => '鰨', - '' => '鰩', - '' => '鰤', - '' => '鰡', - '' => '鶷', - '' => '鶶', - '' => '鶼', - '' => '鷁', - '' => '鷇', - '' => '鷊', - '' => '鷏', - '' => '鶾', - '' => '鷅', - '' => '鷃', - '' => '鶻', - '' => '鶵', - '' => '鷎', - '' => '鶹', - '' => '鶺', - '' => '鶬', - '' => '鷈', - '' => '鶱', - '' => '鶭', - '' => '鷌', - '' => '鶳', - '' => '鷍', - '' => '鶲', - '' => '鹺', - '' => '麜', - '' => '黫', - '' => '黮', - '' => '黭', - '' => '鼛', - '' => '鼘', - '' => '鼚', - '' => '鼱', - '' => '齎', - '' => '齥', - '' => '齤', - '' => '龒', - '' => '亹', - '' => '囆', - '' => '囅', - '' => '囋', - '' => '奱', - '' => '孋', - '' => '孌', - '' => '巕', - '' => '巑', - '' => '廲', - '' => '攡', - '' => '攠', - '' => '攦', - '' => '攢', - '' => '欋', - '' => '欈', - '' => '欉', - '' => '氍', - '' => '灕', - '' => '灖', - '' => '灗', - '' => '灒', - '' => '爞', - '' => '爟', - '' => '犩', - '' => '獿', - '' => '瓘', - '' => '瓕', - '' => '瓙', - '' => '瓗', - '' => '癭', - '' => '皭', - '' => '礵', - '' => '禴', - '' => '穰', - '' => '穱', - '' => '籗', - '' => '籜', - '' => '籙', - '' => '籛', - '' => '籚', - '@' => '糴', - 'A' => '糱', - 'B' => '纑', - 'C' => '罏', - 'D' => '羇', - 'E' => '臞', - 'F' => '艫', - 'G' => '蘴', - 'H' => '蘵', - 'I' => '蘳', - 'J' => '蘬', - 'K' => '蘲', - 'L' => '蘶', - 'M' => '蠬', - 'N' => '蠨', - 'O' => '蠦', - 'P' => '蠪', - 'Q' => '蠥', - 'R' => '襱', - 'S' => '覿', - 'T' => '覾', - 'U' => '觻', - 'V' => '譾', - 'W' => '讄', - 'X' => '讂', - 'Y' => '讆', - 'Z' => '讅', - '[' => '譿', - '\\' => '贕', - ']' => '躕', - '^' => '躔', - '_' => '躚', - '`' => '躒', - 'a' => '躐', - 'b' => '躖', - 'c' => '躗', - 'd' => '轠', - 'e' => '轢', - 'f' => '酇', - 'g' => '鑌', - 'h' => '鑐', - 'i' => '鑊', - 'j' => '鑋', - 'k' => '鑏', - 'l' => '鑇', - 'm' => '鑅', - 'n' => '鑈', - 'o' => '鑉', - 'p' => '鑆', - 'q' => '霿', - 'r' => '韣', - 's' => '顪', - 't' => '顩', - 'u' => '飋', - 'v' => '饔', - 'w' => '饛', - 'x' => '驎', - 'y' => '驓', - 'z' => '驔', - '{' => '驌', - '|' => '驏', - '}' => '驈', - '~' => '驊', - '' => '驉', - '' => '驒', - '' => '驐', - '' => '髐', - '' => '鬙', - '' => '鬫', - '' => '鬻', - '' => '魖', - '' => '魕', - '' => '鱆', - '' => '鱈', - '' => '鰿', - '' => '鱄', - '' => '鰹', - '' => '鰳', - '' => '鱁', - '' => '鰼', - '' => '鰷', - '' => '鰴', - '' => '鰲', - '' => '鰽', - '' => '鰶', - '' => '鷛', - '' => '鷒', - '' => '鷞', - '' => '鷚', - '' => '鷋', - '' => '鷐', - '' => '鷜', - '' => '鷑', - '' => '鷟', - '' => '鷩', - '' => '鷙', - '' => '鷘', - '' => '鷖', - '' => '鷵', - '' => '鷕', - '' => '鷝', - '' => '麶', - '' => '黰', - '' => '鼵', - '' => '鼳', - '' => '鼲', - '' => '齂', - '' => '齫', - '' => '龕', - '' => '龢', - '' => '儽', - '' => '劙', - '' => '壨', - '' => '壧', - '' => '奲', - '' => '孍', - '' => '巘', - '' => '蠯', - '' => '彏', - '' => '戁', - '' => '戃', - '' => '戄', - '' => '攩', - '' => '攥', - '' => '斖', - '' => '曫', - '' => '欑', - '' => '欒', - '' => '欏', - '' => '毊', - '' => '灛', - '' => '灚', - '' => '爢', - '' => '玂', - '' => '玁', - '' => '玃', - '' => '癰', - '' => '矔', - '' => '籧', - '' => '籦', - '' => '纕', - '' => '艬', - '' => '蘺', - '' => '虀', - '' => '蘹', - '' => '蘼', - '' => '蘱', - '' => '蘻', - '' => '蘾', - '' => '蠰', - '' => '蠲', - '' => '蠮', - '' => '蠳', - '' => '襶', - '' => '襴', - '' => '襳', - '' => '觾', - '@' => '讌', - 'A' => '讎', - 'B' => '讋', - 'C' => '讈', - 'D' => '豅', - 'E' => '贙', - 'F' => '躘', - 'G' => '轤', - 'H' => '轣', - 'I' => '醼', - 'J' => '鑢', - 'K' => '鑕', - 'L' => '鑝', - 'M' => '鑗', - 'N' => '鑞', - 'O' => '韄', - 'P' => '韅', - 'Q' => '頀', - 'R' => '驖', - 'S' => '驙', - 'T' => '鬞', - 'U' => '鬟', - 'V' => '鬠', - 'W' => '鱒', - 'X' => '鱘', - 'Y' => '鱐', - 'Z' => '鱊', - '[' => '鱍', - '\\' => '鱋', - ']' => '鱕', - '^' => '鱙', - '_' => '鱌', - '`' => '鱎', - 'a' => '鷻', - 'b' => '鷷', - 'c' => '鷯', - 'd' => '鷣', - 'e' => '鷫', - 'f' => '鷸', - 'g' => '鷤', - 'h' => '鷶', - 'i' => '鷡', - 'j' => '鷮', - 'k' => '鷦', - 'l' => '鷲', - 'm' => '鷰', - 'n' => '鷢', - 'o' => '鷬', - 'p' => '鷴', - 'q' => '鷳', - 'r' => '鷨', - 's' => '鷭', - 't' => '黂', - 'u' => '黐', - 'v' => '黲', - 'w' => '黳', - 'x' => '鼆', - 'y' => '鼜', - 'z' => '鼸', - '{' => '鼷', - '|' => '鼶', - '}' => '齃', - '~' => '齏', - '' => '齱', - '' => '齰', - '' => '齮', - '' => '齯', - '' => '囓', - '' => '囍', - '' => '孎', - '' => '屭', - '' => '攭', - '' => '曭', - '' => '曮', - '' => '欓', - '' => '灟', - '' => '灡', - '' => '灝', - '' => '灠', - '' => '爣', - '' => '瓛', - '' => '瓥', - '' => '矕', - '' => '礸', - '' => '禷', - '' => '禶', - '' => '籪', - '' => '纗', - '' => '羉', - '' => '艭', - '' => '虃', - '' => '蠸', - '' => '蠷', - '' => '蠵', - '' => '衋', - '' => '讔', - '' => '讕', - '' => '躞', - '' => '躟', - '' => '躠', - '' => '躝', - '' => '醾', - '' => '醽', - '' => '釂', - '' => '鑫', - '' => '鑨', - '' => '鑩', - '' => '雥', - '' => '靆', - '' => '靃', - '' => '靇', - '' => '韇', - '' => '韥', - '' => '驞', - '' => '髕', - '' => '魙', - '' => '鱣', - '' => '鱧', - '' => '鱦', - '' => '鱢', - '' => '鱞', - '' => '鱠', - '' => '鸂', - '' => '鷾', - '' => '鸇', - '' => '鸃', - '' => '鸆', - '' => '鸅', - '' => '鸀', - '' => '鸁', - '' => '鸉', - '' => '鷿', - '' => '鷽', - '' => '鸄', - '' => '麠', - '' => '鼞', - '' => '齆', - '' => '齴', - '' => '齵', - '' => '齶', - '' => '囔', - '' => '攮', - '' => '斸', - '' => '欘', - '' => '欙', - '' => '欗', - '' => '欚', - '' => '灢', - '' => '爦', - '' => '犪', - '' => '矘', - '' => '矙', - '' => '礹', - '' => '籩', - '' => '籫', - '' => '糶', - '' => '纚', - '@' => '纘', - 'A' => '纛', - 'B' => '纙', - 'C' => '臠', - 'D' => '臡', - 'E' => '虆', - 'F' => '虇', - 'G' => '虈', - 'H' => '襹', - 'I' => '襺', - 'J' => '襼', - 'K' => '襻', - 'L' => '觿', - 'M' => '讘', - 'N' => '讙', - 'O' => '躥', - 'P' => '躤', - 'Q' => '躣', - 'R' => '鑮', - 'S' => '鑭', - 'T' => '鑯', - 'U' => '鑱', - 'V' => '鑳', - 'W' => '靉', - 'X' => '顲', - 'Y' => '饟', - 'Z' => '鱨', - '[' => '鱮', - '\\' => '鱭', - ']' => '鸋', - '^' => '鸍', - '_' => '鸐', - '`' => '鸏', - 'a' => '鸒', - 'b' => '鸑', - 'c' => '麡', - 'd' => '黵', - 'e' => '鼉', - 'f' => '齇', - 'g' => '齸', - 'h' => '齻', - 'i' => '齺', - 'j' => '齹', - 'k' => '圞', - 'l' => '灦', - 'm' => '籯', - 'n' => '蠼', - 'o' => '趲', - 'p' => '躦', - 'q' => '釃', - 'r' => '鑴', - 's' => '鑸', - 't' => '鑶', - 'u' => '鑵', - 'v' => '驠', - 'w' => '鱴', - 'x' => '鱳', - 'y' => '鱱', - 'z' => '鱵', - '{' => '鸔', - '|' => '鸓', - '}' => '黶', - '~' => '鼊', - '' => '龤', - '' => '灨', - '' => '灥', - '' => '糷', - '' => '虪', - '' => '蠾', - '' => '蠽', - '' => '蠿', - '' => '讞', - '' => '貜', - '' => '躩', - '' => '軉', - '' => '靋', - '' => '顳', - '' => '顴', - '' => '飌', - '' => '饡', - '' => '馫', - '' => '驤', - '' => '驦', - '' => '驧', - '' => '鬤', - '' => '鸕', - '' => '鸗', - '' => '齈', - '' => '戇', - '' => '欞', - '' => '爧', - '' => '虌', - '' => '躨', - '' => '钂', - '' => '钀', - '' => '钁', - '' => '驩', - '' => '驨', - '' => '鬮', - '' => '鸙', - '' => '爩', - '' => '虋', - '' => '讟', - '' => '钃', - '' => '鱹', - '' => '麷', - '' => '癵', - '' => '驫', - '' => '鱺', - '' => '鸝', - '' => '灩', - '' => '灪', - '' => '麤', - '' => '齾', - '' => '齉', - '' => '龘', -); - -$result =& $data; -unset($data); - -return $result; diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp037.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp037.php deleted file mode 100644 index a014e4b4..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp037.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp1006.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp1006.php deleted file mode 100644 index 2b5e7beb..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp1006.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp1026.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp1026.php deleted file mode 100644 index aba455b5..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp1026.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp424.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp424.php deleted file mode 100644 index e8e23703..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp424.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp437.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp437.php deleted file mode 100644 index e3ebb45c..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp437.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp500.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp500.php deleted file mode 100644 index 3771c8f6..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp500.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp737.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp737.php deleted file mode 100644 index 2d67d33f..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp737.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp775.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp775.php deleted file mode 100644 index 1fbc4cdc..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp775.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp850.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp850.php deleted file mode 100644 index 0b314c80..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp850.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp852.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp852.php deleted file mode 100644 index f8c318ca..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp852.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp855.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp855.php deleted file mode 100644 index 48440ba1..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp855.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp856.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp856.php deleted file mode 100644 index c9cac0c3..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp856.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp857.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp857.php deleted file mode 100644 index 3e7770ad..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp857.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp860.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp860.php deleted file mode 100644 index 2a52d473..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp860.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp861.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp861.php deleted file mode 100644 index 4ba6573c..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp861.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp862.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp862.php deleted file mode 100644 index d2a29a22..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp862.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp863.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp863.php deleted file mode 100644 index 1f36b9a2..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp863.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp864.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp864.php deleted file mode 100644 index 953e4635..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp864.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp865.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp865.php deleted file mode 100644 index 2668bcc4..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp865.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp866.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp866.php deleted file mode 100644 index a7b47f8f..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp866.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp869.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp869.php deleted file mode 100644 index 0f040548..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp869.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp874.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp874.php deleted file mode 100644 index 47994569..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp874.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp875.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp875.php deleted file mode 100644 index 85616453..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp875.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp932.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp932.php deleted file mode 100644 index 0bf828ff..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp932.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp936.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp936.php deleted file mode 100644 index a593d05d..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp936.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp949.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp949.php deleted file mode 100644 index d4e99f1f..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp949.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp950.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp950.php deleted file mode 100644 index 267b1906..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp950.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-1.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-1.php deleted file mode 100644 index d7a217c9..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-1.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-10.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-10.php deleted file mode 100644 index d60f6473..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-10.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-11.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-11.php deleted file mode 100644 index d69220bf..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-11.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-13.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-13.php deleted file mode 100644 index 838783f1..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-13.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-14.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-14.php deleted file mode 100644 index 65a48ee3..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-14.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-15.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-15.php deleted file mode 100644 index 42e50e0f..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-15.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-16.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-16.php deleted file mode 100644 index 46758a6a..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-16.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-2.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-2.php deleted file mode 100644 index 5f23f515..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-2.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-3.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-3.php deleted file mode 100644 index b31bb83f..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-3.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-4.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-4.php deleted file mode 100644 index 9cbf9f37..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-4.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-5.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-5.php deleted file mode 100644 index fd038823..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-5.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-6.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-6.php deleted file mode 100644 index ed6f72f3..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-6.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-7.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-7.php deleted file mode 100644 index cf723ac6..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-7.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-8.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-8.php deleted file mode 100644 index c978731a..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-8.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-9.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-9.php deleted file mode 100644 index 2a3e36a4..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-9.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.koi8-r.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.koi8-r.php deleted file mode 100644 index d83c2125..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.koi8-r.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.koi8-u.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.koi8-u.php deleted file mode 100644 index dbbf96be..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.koi8-u.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.us-ascii.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.us-ascii.php deleted file mode 100644 index 94a93b28..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.us-ascii.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1250.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1250.php deleted file mode 100644 index d1d5e6f2..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1250.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1251.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1251.php deleted file mode 100644 index f422a71f..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1251.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1252.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1252.php deleted file mode 100644 index ba6d203d..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1252.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1253.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1253.php deleted file mode 100644 index c04dc8f0..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1253.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1254.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1254.php deleted file mode 100644 index 1cfadcf2..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1254.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1255.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1255.php deleted file mode 100644 index f73cbb6f..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1255.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1256.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1256.php deleted file mode 100644 index 953704f6..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1256.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1257.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1257.php deleted file mode 100644 index 78580ece..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1257.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1258.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1258.php deleted file mode 100644 index de1609d8..00000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1258.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/translit.php b/vendor/symfony/polyfill-iconv/Resources/charset/translit.php deleted file mode 100644 index f322ff0d..00000000 --- a/vendor/symfony/polyfill-iconv/Resources/charset/translit.php +++ /dev/null @@ -1,4106 +0,0 @@ - 'μ', - '¼' => ' 1⁄4 ', - '½' => ' 1⁄2 ', - '¾' => ' 3⁄4 ', - 'IJ' => 'IJ', - 'ij' => 'ij', - 'Ŀ' => 'L·', - 'ŀ' => 'l·', - 'ʼn' => 'ʼn', - 'ſ' => 's', - 'DŽ' => 'DŽ', - 'Dž' => 'Dž', - 'dž' => 'dž', - 'LJ' => 'LJ', - 'Lj' => 'Lj', - 'lj' => 'lj', - 'NJ' => 'NJ', - 'Nj' => 'Nj', - 'nj' => 'nj', - 'DZ' => 'DZ', - 'Dz' => 'Dz', - 'dz' => 'dz', - 'ϐ' => 'β', - 'ϑ' => 'θ', - 'ϒ' => 'Υ', - 'ϕ' => 'φ', - 'ϖ' => 'π', - 'ϰ' => 'κ', - 'ϱ' => 'ρ', - 'ϲ' => 'ς', - 'ϴ' => 'Θ', - 'ϵ' => 'ε', - 'Ϲ' => 'Σ', - 'և' => 'եւ', - 'ٵ' => 'اٴ', - 'ٶ' => 'وٴ', - 'ٷ' => 'ۇٴ', - 'ٸ' => 'يٴ', - 'ำ' => 'ํา', - 'ຳ' => 'ໍາ', - 'ໜ' => 'ຫນ', - 'ໝ' => 'ຫມ', - 'ཷ' => 'ྲཱྀ', - 'ཹ' => 'ླཱྀ', - 'ẚ' => 'aʾ', - '․' => '.', - '‥' => '..', - '…' => '...', - '″' => '′′', - '‴' => '′′′', - '‶' => '‵‵', - '‷' => '‵‵‵', - '‼' => '!!', - '⁇' => '??', - '⁈' => '?!', - '⁉' => '!?', - '⁗' => '′′′′', - '₨' => 'Rs', - '℀' => 'a/c', - '℁' => 'a/s', - 'ℂ' => 'C', - '℃' => '°C', - '℅' => 'c/o', - '℆' => 'c/u', - 'ℇ' => 'Ɛ', - '℉' => '°F', - 'ℊ' => 'g', - 'ℋ' => 'H', - 'ℌ' => 'H', - 'ℍ' => 'H', - 'ℎ' => 'h', - 'ℏ' => 'ħ', - 'ℐ' => 'I', - 'ℑ' => 'I', - 'ℒ' => 'L', - 'ℓ' => 'l', - 'ℕ' => 'N', - '№' => 'No', - 'ℙ' => 'P', - 'ℚ' => 'Q', - 'ℛ' => 'R', - 'ℜ' => 'R', - 'ℝ' => 'R', - '℡' => 'TEL', - 'ℤ' => 'Z', - 'ℨ' => 'Z', - 'ℬ' => 'B', - 'ℭ' => 'C', - 'ℯ' => 'e', - 'ℰ' => 'E', - 'ℱ' => 'F', - 'ℳ' => 'M', - 'ℴ' => 'o', - 'ℵ' => 'א', - 'ℶ' => 'ב', - 'ℷ' => 'ג', - 'ℸ' => 'ד', - 'ℹ' => 'i', - '℻' => 'FAX', - 'ℼ' => 'π', - 'ℽ' => 'γ', - 'ℾ' => 'Γ', - 'ℿ' => 'Π', - '⅀' => '∑', - 'ⅅ' => 'D', - 'ⅆ' => 'd', - 'ⅇ' => 'e', - 'ⅈ' => 'i', - 'ⅉ' => 'j', - '⅐' => ' 1⁄7 ', - '⅑' => ' 1⁄9 ', - '⅒' => ' 1⁄10 ', - '⅓' => ' 1⁄3 ', - '⅔' => ' 2⁄3 ', - '⅕' => ' 1⁄5 ', - '⅖' => ' 2⁄5 ', - '⅗' => ' 3⁄5 ', - '⅘' => ' 4⁄5 ', - '⅙' => ' 1⁄6 ', - '⅚' => ' 5⁄6 ', - '⅛' => ' 1⁄8 ', - '⅜' => ' 3⁄8 ', - '⅝' => ' 5⁄8 ', - '⅞' => ' 7⁄8 ', - '⅟' => ' 1⁄ ', - 'Ⅰ' => 'I', - 'Ⅱ' => 'II', - 'Ⅲ' => 'III', - 'Ⅳ' => 'IV', - 'Ⅴ' => 'V', - 'Ⅵ' => 'VI', - 'Ⅶ' => 'VII', - 'Ⅷ' => 'VIII', - 'Ⅸ' => 'IX', - 'Ⅹ' => 'X', - 'Ⅺ' => 'XI', - 'Ⅻ' => 'XII', - 'Ⅼ' => 'L', - 'Ⅽ' => 'C', - 'Ⅾ' => 'D', - 'Ⅿ' => 'M', - 'ⅰ' => 'i', - 'ⅱ' => 'ii', - 'ⅲ' => 'iii', - 'ⅳ' => 'iv', - 'ⅴ' => 'v', - 'ⅵ' => 'vi', - 'ⅶ' => 'vii', - 'ⅷ' => 'viii', - 'ⅸ' => 'ix', - 'ⅹ' => 'x', - 'ⅺ' => 'xi', - 'ⅻ' => 'xii', - 'ⅼ' => 'l', - 'ⅽ' => 'c', - 'ⅾ' => 'd', - 'ⅿ' => 'm', - '↉' => ' 0⁄3 ', - '∬' => '∫∫', - '∭' => '∫∫∫', - '∯' => '∮∮', - '∰' => '∮∮∮', - '①' => '(1)', - '②' => '(2)', - '③' => '(3)', - '④' => '(4)', - '⑤' => '(5)', - '⑥' => '(6)', - '⑦' => '(7)', - '⑧' => '(8)', - '⑨' => '(9)', - '⑩' => '(10)', - '⑪' => '(11)', - '⑫' => '(12)', - '⑬' => '(13)', - '⑭' => '(14)', - '⑮' => '(15)', - '⑯' => '(16)', - '⑰' => '(17)', - '⑱' => '(18)', - '⑲' => '(19)', - '⑳' => '(20)', - '⑴' => '(1)', - '⑵' => '(2)', - '⑶' => '(3)', - '⑷' => '(4)', - '⑸' => '(5)', - '⑹' => '(6)', - '⑺' => '(7)', - '⑻' => '(8)', - '⑼' => '(9)', - '⑽' => '(10)', - '⑾' => '(11)', - '⑿' => '(12)', - '⒀' => '(13)', - '⒁' => '(14)', - '⒂' => '(15)', - '⒃' => '(16)', - '⒄' => '(17)', - '⒅' => '(18)', - '⒆' => '(19)', - '⒇' => '(20)', - '⒈' => '1.', - '⒉' => '2.', - '⒊' => '3.', - '⒋' => '4.', - '⒌' => '5.', - '⒍' => '6.', - '⒎' => '7.', - '⒏' => '8.', - '⒐' => '9.', - '⒑' => '10.', - '⒒' => '11.', - '⒓' => '12.', - '⒔' => '13.', - '⒕' => '14.', - '⒖' => '15.', - '⒗' => '16.', - '⒘' => '17.', - '⒙' => '18.', - '⒚' => '19.', - '⒛' => '20.', - '⒜' => '(a)', - '⒝' => '(b)', - '⒞' => '(c)', - '⒟' => '(d)', - '⒠' => '(e)', - '⒡' => '(f)', - '⒢' => '(g)', - '⒣' => '(h)', - '⒤' => '(i)', - '⒥' => '(j)', - '⒦' => '(k)', - '⒧' => '(l)', - '⒨' => '(m)', - '⒩' => '(n)', - '⒪' => '(o)', - '⒫' => '(p)', - '⒬' => '(q)', - '⒭' => '(r)', - '⒮' => '(s)', - '⒯' => '(t)', - '⒰' => '(u)', - '⒱' => '(v)', - '⒲' => '(w)', - '⒳' => '(x)', - '⒴' => '(y)', - '⒵' => '(z)', - 'Ⓐ' => '(A)', - 'Ⓑ' => '(B)', - 'Ⓒ' => '(C)', - 'Ⓓ' => '(D)', - 'Ⓔ' => '(E)', - 'Ⓕ' => '(F)', - 'Ⓖ' => '(G)', - 'Ⓗ' => '(H)', - 'Ⓘ' => '(I)', - 'Ⓙ' => '(J)', - 'Ⓚ' => '(K)', - 'Ⓛ' => '(L)', - 'Ⓜ' => '(M)', - 'Ⓝ' => '(N)', - 'Ⓞ' => '(O)', - 'Ⓟ' => '(P)', - 'Ⓠ' => '(Q)', - 'Ⓡ' => '(R)', - 'Ⓢ' => '(S)', - 'Ⓣ' => '(T)', - 'Ⓤ' => '(U)', - 'Ⓥ' => '(V)', - 'Ⓦ' => '(W)', - 'Ⓧ' => '(X)', - 'Ⓨ' => '(Y)', - 'Ⓩ' => '(Z)', - 'ⓐ' => '(a)', - 'ⓑ' => '(b)', - 'ⓒ' => '(c)', - 'ⓓ' => '(d)', - 'ⓔ' => '(e)', - 'ⓕ' => '(f)', - 'ⓖ' => '(g)', - 'ⓗ' => '(h)', - 'ⓘ' => '(i)', - 'ⓙ' => '(j)', - 'ⓚ' => '(k)', - 'ⓛ' => '(l)', - 'ⓜ' => '(m)', - 'ⓝ' => '(n)', - 'ⓞ' => '(o)', - 'ⓟ' => '(p)', - 'ⓠ' => '(q)', - 'ⓡ' => '(r)', - 'ⓢ' => '(s)', - 'ⓣ' => '(t)', - 'ⓤ' => '(u)', - 'ⓥ' => '(v)', - 'ⓦ' => '(w)', - 'ⓧ' => '(x)', - 'ⓨ' => '(y)', - 'ⓩ' => '(z)', - '⓪' => '(0)', - '⨌' => '∫∫∫∫', - '⩴' => '::=', - '⩵' => '==', - '⩶' => '===', - '⺟' => '母', - '⻳' => '龟', - '⼀' => '一', - '⼁' => '丨', - '⼂' => '丶', - '⼃' => '丿', - '⼄' => '乙', - '⼅' => '亅', - '⼆' => '二', - '⼇' => '亠', - '⼈' => '人', - '⼉' => '儿', - '⼊' => '入', - '⼋' => '八', - '⼌' => '冂', - '⼍' => '冖', - '⼎' => '冫', - '⼏' => '几', - '⼐' => '凵', - '⼑' => '刀', - '⼒' => '力', - '⼓' => '勹', - '⼔' => '匕', - '⼕' => '匚', - '⼖' => '匸', - '⼗' => '十', - '⼘' => '卜', - '⼙' => '卩', - '⼚' => '厂', - '⼛' => '厶', - '⼜' => '又', - '⼝' => '口', - '⼞' => '囗', - '⼟' => '土', - '⼠' => '士', - '⼡' => '夂', - '⼢' => '夊', - '⼣' => '夕', - '⼤' => '大', - '⼥' => '女', - '⼦' => '子', - '⼧' => '宀', - '⼨' => '寸', - '⼩' => '小', - '⼪' => '尢', - '⼫' => '尸', - '⼬' => '屮', - '⼭' => '山', - '⼮' => '巛', - '⼯' => '工', - '⼰' => '己', - '⼱' => '巾', - '⼲' => '干', - '⼳' => '幺', - '⼴' => '广', - '⼵' => '廴', - '⼶' => '廾', - '⼷' => '弋', - '⼸' => '弓', - '⼹' => '彐', - '⼺' => '彡', - '⼻' => '彳', - '⼼' => '心', - '⼽' => '戈', - '⼾' => '戶', - '⼿' => '手', - '⽀' => '支', - '⽁' => '攴', - '⽂' => '文', - '⽃' => '斗', - '⽄' => '斤', - '⽅' => '方', - '⽆' => '无', - '⽇' => '日', - '⽈' => '曰', - '⽉' => '月', - '⽊' => '木', - '⽋' => '欠', - '⽌' => '止', - '⽍' => '歹', - '⽎' => '殳', - '⽏' => '毋', - '⽐' => '比', - '⽑' => '毛', - '⽒' => '氏', - '⽓' => '气', - '⽔' => '水', - '⽕' => '火', - '⽖' => '爪', - '⽗' => '父', - '⽘' => '爻', - '⽙' => '爿', - '⽚' => '片', - '⽛' => '牙', - '⽜' => '牛', - '⽝' => '犬', - '⽞' => '玄', - '⽟' => '玉', - '⽠' => '瓜', - '⽡' => '瓦', - '⽢' => '甘', - '⽣' => '生', - '⽤' => '用', - '⽥' => '田', - '⽦' => '疋', - '⽧' => '疒', - '⽨' => '癶', - '⽩' => '白', - '⽪' => '皮', - '⽫' => '皿', - '⽬' => '目', - '⽭' => '矛', - '⽮' => '矢', - '⽯' => '石', - '⽰' => '示', - '⽱' => '禸', - '⽲' => '禾', - '⽳' => '穴', - '⽴' => '立', - '⽵' => '竹', - '⽶' => '米', - '⽷' => '糸', - '⽸' => '缶', - '⽹' => '网', - '⽺' => '羊', - '⽻' => '羽', - '⽼' => '老', - '⽽' => '而', - '⽾' => '耒', - '⽿' => '耳', - '⾀' => '聿', - '⾁' => '肉', - '⾂' => '臣', - '⾃' => '自', - '⾄' => '至', - '⾅' => '臼', - '⾆' => '舌', - '⾇' => '舛', - '⾈' => '舟', - '⾉' => '艮', - '⾊' => '色', - '⾋' => '艸', - '⾌' => '虍', - '⾍' => '虫', - '⾎' => '血', - '⾏' => '行', - '⾐' => '衣', - '⾑' => '襾', - '⾒' => '見', - '⾓' => '角', - '⾔' => '言', - '⾕' => '谷', - '⾖' => '豆', - '⾗' => '豕', - '⾘' => '豸', - '⾙' => '貝', - '⾚' => '赤', - '⾛' => '走', - '⾜' => '足', - '⾝' => '身', - '⾞' => '車', - '⾟' => '辛', - '⾠' => '辰', - '⾡' => '辵', - '⾢' => '邑', - '⾣' => '酉', - '⾤' => '釆', - '⾥' => '里', - '⾦' => '金', - '⾧' => '長', - '⾨' => '門', - '⾩' => '阜', - '⾪' => '隶', - '⾫' => '隹', - '⾬' => '雨', - '⾭' => '靑', - '⾮' => '非', - '⾯' => '面', - '⾰' => '革', - '⾱' => '韋', - '⾲' => '韭', - '⾳' => '音', - '⾴' => '頁', - '⾵' => '風', - '⾶' => '飛', - '⾷' => '食', - '⾸' => '首', - '⾹' => '香', - '⾺' => '馬', - '⾻' => '骨', - '⾼' => '高', - '⾽' => '髟', - '⾾' => '鬥', - '⾿' => '鬯', - '⿀' => '鬲', - '⿁' => '鬼', - '⿂' => '魚', - '⿃' => '鳥', - '⿄' => '鹵', - '⿅' => '鹿', - '⿆' => '麥', - '⿇' => '麻', - '⿈' => '黃', - '⿉' => '黍', - '⿊' => '黑', - '⿋' => '黹', - '⿌' => '黽', - '⿍' => '鼎', - '⿎' => '鼓', - '⿏' => '鼠', - '⿐' => '鼻', - '⿑' => '齊', - '⿒' => '齒', - '⿓' => '龍', - '⿔' => '龜', - '⿕' => '龠', - ' ' => ' ', - '〶' => '〒', - '〸' => '十', - '〹' => '卄', - '〺' => '卅', - 'ㄱ' => 'ᄀ', - 'ㄲ' => 'ᄁ', - 'ㄳ' => 'ᆪ', - 'ㄴ' => 'ᄂ', - 'ㄵ' => 'ᆬ', - 'ㄶ' => 'ᆭ', - 'ㄷ' => 'ᄃ', - 'ㄸ' => 'ᄄ', - 'ㄹ' => 'ᄅ', - 'ㄺ' => 'ᆰ', - 'ㄻ' => 'ᆱ', - 'ㄼ' => 'ᆲ', - 'ㄽ' => 'ᆳ', - 'ㄾ' => 'ᆴ', - 'ㄿ' => 'ᆵ', - 'ㅀ' => 'ᄚ', - 'ㅁ' => 'ᄆ', - 'ㅂ' => 'ᄇ', - 'ㅃ' => 'ᄈ', - 'ㅄ' => 'ᄡ', - 'ㅅ' => 'ᄉ', - 'ㅆ' => 'ᄊ', - 'ㅇ' => 'ᄋ', - 'ㅈ' => 'ᄌ', - 'ㅉ' => 'ᄍ', - 'ㅊ' => 'ᄎ', - 'ㅋ' => 'ᄏ', - 'ㅌ' => 'ᄐ', - 'ㅍ' => 'ᄑ', - 'ㅎ' => 'ᄒ', - 'ㅏ' => 'ᅡ', - 'ㅐ' => 'ᅢ', - 'ㅑ' => 'ᅣ', - 'ㅒ' => 'ᅤ', - 'ㅓ' => 'ᅥ', - 'ㅔ' => 'ᅦ', - 'ㅕ' => 'ᅧ', - 'ㅖ' => 'ᅨ', - 'ㅗ' => 'ᅩ', - 'ㅘ' => 'ᅪ', - 'ㅙ' => 'ᅫ', - 'ㅚ' => 'ᅬ', - 'ㅛ' => 'ᅭ', - 'ㅜ' => 'ᅮ', - 'ㅝ' => 'ᅯ', - 'ㅞ' => 'ᅰ', - 'ㅟ' => 'ᅱ', - 'ㅠ' => 'ᅲ', - 'ㅡ' => 'ᅳ', - 'ㅢ' => 'ᅴ', - 'ㅣ' => 'ᅵ', - 'ㅤ' => 'ᅠ', - 'ㅥ' => 'ᄔ', - 'ㅦ' => 'ᄕ', - 'ㅧ' => 'ᇇ', - 'ㅨ' => 'ᇈ', - 'ㅩ' => 'ᇌ', - 'ㅪ' => 'ᇎ', - 'ㅫ' => 'ᇓ', - 'ㅬ' => 'ᇗ', - 'ㅭ' => 'ᇙ', - 'ㅮ' => 'ᄜ', - 'ㅯ' => 'ᇝ', - 'ㅰ' => 'ᇟ', - 'ㅱ' => 'ᄝ', - 'ㅲ' => 'ᄞ', - 'ㅳ' => 'ᄠ', - 'ㅴ' => 'ᄢ', - 'ㅵ' => 'ᄣ', - 'ㅶ' => 'ᄧ', - 'ㅷ' => 'ᄩ', - 'ㅸ' => 'ᄫ', - 'ㅹ' => 'ᄬ', - 'ㅺ' => 'ᄭ', - 'ㅻ' => 'ᄮ', - 'ㅼ' => 'ᄯ', - 'ㅽ' => 'ᄲ', - 'ㅾ' => 'ᄶ', - 'ㅿ' => 'ᅀ', - 'ㆀ' => 'ᅇ', - 'ㆁ' => 'ᅌ', - 'ㆂ' => 'ᇱ', - 'ㆃ' => 'ᇲ', - 'ㆄ' => 'ᅗ', - 'ㆅ' => 'ᅘ', - 'ㆆ' => 'ᅙ', - 'ㆇ' => 'ᆄ', - 'ㆈ' => 'ᆅ', - 'ㆉ' => 'ᆈ', - 'ㆊ' => 'ᆑ', - 'ㆋ' => 'ᆒ', - 'ㆌ' => 'ᆔ', - 'ㆍ' => 'ᆞ', - 'ㆎ' => 'ᆡ', - '㈀' => '(ᄀ)', - '㈁' => '(ᄂ)', - '㈂' => '(ᄃ)', - '㈃' => '(ᄅ)', - '㈄' => '(ᄆ)', - '㈅' => '(ᄇ)', - '㈆' => '(ᄉ)', - '㈇' => '(ᄋ)', - '㈈' => '(ᄌ)', - '㈉' => '(ᄎ)', - '㈊' => '(ᄏ)', - '㈋' => '(ᄐ)', - '㈌' => '(ᄑ)', - '㈍' => '(ᄒ)', - '㈎' => '(가)', - '㈏' => '(나)', - '㈐' => '(다)', - '㈑' => '(라)', - '㈒' => '(마)', - '㈓' => '(바)', - '㈔' => '(사)', - '㈕' => '(아)', - '㈖' => '(자)', - '㈗' => '(차)', - '㈘' => '(카)', - '㈙' => '(타)', - '㈚' => '(파)', - '㈛' => '(하)', - '㈜' => '(주)', - '㈝' => '(오전)', - '㈞' => '(오후)', - '㈠' => '(一)', - '㈡' => '(二)', - '㈢' => '(三)', - '㈣' => '(四)', - '㈤' => '(五)', - '㈥' => '(六)', - '㈦' => '(七)', - '㈧' => '(八)', - '㈨' => '(九)', - '㈩' => '(十)', - '㈪' => '(月)', - '㈫' => '(火)', - '㈬' => '(水)', - '㈭' => '(木)', - '㈮' => '(金)', - '㈯' => '(土)', - '㈰' => '(日)', - '㈱' => '(株)', - '㈲' => '(有)', - '㈳' => '(社)', - '㈴' => '(名)', - '㈵' => '(特)', - '㈶' => '(財)', - '㈷' => '(祝)', - '㈸' => '(労)', - '㈹' => '(代)', - '㈺' => '(呼)', - '㈻' => '(学)', - '㈼' => '(監)', - '㈽' => '(企)', - '㈾' => '(資)', - '㈿' => '(協)', - '㉀' => '(祭)', - '㉁' => '(休)', - '㉂' => '(自)', - '㉃' => '(至)', - '㉄' => '(問)', - '㉅' => '(幼)', - '㉆' => '(文)', - '㉇' => '(箏)', - '㉐' => 'PTE', - '㉑' => '(21)', - '㉒' => '(22)', - '㉓' => '(23)', - '㉔' => '(24)', - '㉕' => '(25)', - '㉖' => '(26)', - '㉗' => '(27)', - '㉘' => '(28)', - '㉙' => '(29)', - '㉚' => '(30)', - '㉛' => '(31)', - '㉜' => '(32)', - '㉝' => '(33)', - '㉞' => '(34)', - '㉟' => '(35)', - '㉠' => '(ᄀ)', - '㉡' => '(ᄂ)', - '㉢' => '(ᄃ)', - '㉣' => '(ᄅ)', - '㉤' => '(ᄆ)', - '㉥' => '(ᄇ)', - '㉦' => '(ᄉ)', - '㉧' => '(ᄋ)', - '㉨' => '(ᄌ)', - '㉩' => '(ᄎ)', - '㉪' => '(ᄏ)', - '㉫' => '(ᄐ)', - '㉬' => '(ᄑ)', - '㉭' => '(ᄒ)', - '㉮' => '(가)', - '㉯' => '(나)', - '㉰' => '(다)', - '㉱' => '(라)', - '㉲' => '(마)', - '㉳' => '(바)', - '㉴' => '(사)', - '㉵' => '(아)', - '㉶' => '(자)', - '㉷' => '(차)', - '㉸' => '(카)', - '㉹' => '(타)', - '㉺' => '(파)', - '㉻' => '(하)', - '㉼' => '(참고)', - '㉽' => '(주의)', - '㉾' => '(우)', - '㊀' => '(一)', - '㊁' => '(二)', - '㊂' => '(三)', - '㊃' => '(四)', - '㊄' => '(五)', - '㊅' => '(六)', - '㊆' => '(七)', - '㊇' => '(八)', - '㊈' => '(九)', - '㊉' => '(十)', - '㊊' => '(月)', - '㊋' => '(火)', - '㊌' => '(水)', - '㊍' => '(木)', - '㊎' => '(金)', - '㊏' => '(土)', - '㊐' => '(日)', - '㊑' => '(株)', - '㊒' => '(有)', - '㊓' => '(社)', - '㊔' => '(名)', - '㊕' => '(特)', - '㊖' => '(財)', - '㊗' => '(祝)', - '㊘' => '(労)', - '㊙' => '(秘)', - '㊚' => '(男)', - '㊛' => '(女)', - '㊜' => '(適)', - '㊝' => '(優)', - '㊞' => '(印)', - '㊟' => '(注)', - '㊠' => '(項)', - '㊡' => '(休)', - '㊢' => '(写)', - '㊣' => '(正)', - '㊤' => '(上)', - '㊥' => '(中)', - '㊦' => '(下)', - '㊧' => '(左)', - '㊨' => '(右)', - '㊩' => '(医)', - '㊪' => '(宗)', - '㊫' => '(学)', - '㊬' => '(監)', - '㊭' => '(企)', - '㊮' => '(資)', - '㊯' => '(協)', - '㊰' => '(夜)', - '㊱' => '(36)', - '㊲' => '(37)', - '㊳' => '(38)', - '㊴' => '(39)', - '㊵' => '(40)', - '㊶' => '(41)', - '㊷' => '(42)', - '㊸' => '(43)', - '㊹' => '(44)', - '㊺' => '(45)', - '㊻' => '(46)', - '㊼' => '(47)', - '㊽' => '(48)', - '㊾' => '(49)', - '㊿' => '(50)', - '㋀' => '1月', - '㋁' => '2月', - '㋂' => '3月', - '㋃' => '4月', - '㋄' => '5月', - '㋅' => '6月', - '㋆' => '7月', - '㋇' => '8月', - '㋈' => '9月', - '㋉' => '10月', - '㋊' => '11月', - '㋋' => '12月', - '㋌' => 'Hg', - '㋍' => 'erg', - '㋎' => 'eV', - '㋏' => 'LTD', - '㋐' => '(ア)', - '㋑' => '(イ)', - '㋒' => '(ウ)', - '㋓' => '(エ)', - '㋔' => '(オ)', - '㋕' => '(カ)', - '㋖' => '(キ)', - '㋗' => '(ク)', - '㋘' => '(ケ)', - '㋙' => '(コ)', - '㋚' => '(サ)', - '㋛' => '(シ)', - '㋜' => '(ス)', - '㋝' => '(セ)', - '㋞' => '(ソ)', - '㋟' => '(タ)', - '㋠' => '(チ)', - '㋡' => '(ツ)', - '㋢' => '(テ)', - '㋣' => '(ト)', - '㋤' => '(ナ)', - '㋥' => '(ニ)', - '㋦' => '(ヌ)', - '㋧' => '(ネ)', - '㋨' => '(ノ)', - '㋩' => '(ハ)', - '㋪' => '(ヒ)', - '㋫' => '(フ)', - '㋬' => '(ヘ)', - '㋭' => '(ホ)', - '㋮' => '(マ)', - '㋯' => '(ミ)', - '㋰' => '(ム)', - '㋱' => '(メ)', - '㋲' => '(モ)', - '㋳' => '(ヤ)', - '㋴' => '(ユ)', - '㋵' => '(ヨ)', - '㋶' => '(ラ)', - '㋷' => '(リ)', - '㋸' => '(ル)', - '㋹' => '(レ)', - '㋺' => '(ロ)', - '㋻' => '(ワ)', - '㋼' => '(ヰ)', - '㋽' => '(ヱ)', - '㋾' => '(ヲ)', - '㋿' => '令和', - '㌀' => 'アパート', - '㌁' => 'アルファ', - '㌂' => 'アンペア', - '㌃' => 'アール', - '㌄' => 'イニング', - '㌅' => 'インチ', - '㌆' => 'ウォン', - '㌇' => 'エスクード', - '㌈' => 'エーカー', - '㌉' => 'オンス', - '㌊' => 'オーム', - '㌋' => 'カイリ', - '㌌' => 'カラット', - '㌍' => 'カロリー', - '㌎' => 'ガロン', - '㌏' => 'ガンマ', - '㌐' => 'ギガ', - '㌑' => 'ギニー', - '㌒' => 'キュリー', - '㌓' => 'ギルダー', - '㌔' => 'キロ', - '㌕' => 'キログラム', - '㌖' => 'キロメートル', - '㌗' => 'キロワット', - '㌘' => 'グラム', - '㌙' => 'グラムトン', - '㌚' => 'クルゼイロ', - '㌛' => 'クローネ', - '㌜' => 'ケース', - '㌝' => 'コルナ', - '㌞' => 'コーポ', - '㌟' => 'サイクル', - '㌠' => 'サンチーム', - '㌡' => 'シリング', - '㌢' => 'センチ', - '㌣' => 'セント', - '㌤' => 'ダース', - '㌥' => 'デシ', - '㌦' => 'ドル', - '㌧' => 'トン', - '㌨' => 'ナノ', - '㌩' => 'ノット', - '㌪' => 'ハイツ', - '㌫' => 'パーセント', - '㌬' => 'パーツ', - '㌭' => 'バーレル', - '㌮' => 'ピアストル', - '㌯' => 'ピクル', - '㌰' => 'ピコ', - '㌱' => 'ビル', - '㌲' => 'ファラッド', - '㌳' => 'フィート', - '㌴' => 'ブッシェル', - '㌵' => 'フラン', - '㌶' => 'ヘクタール', - '㌷' => 'ペソ', - '㌸' => 'ペニヒ', - '㌹' => 'ヘルツ', - '㌺' => 'ペンス', - '㌻' => 'ページ', - '㌼' => 'ベータ', - '㌽' => 'ポイント', - '㌾' => 'ボルト', - '㌿' => 'ホン', - '㍀' => 'ポンド', - '㍁' => 'ホール', - '㍂' => 'ホーン', - '㍃' => 'マイクロ', - '㍄' => 'マイル', - '㍅' => 'マッハ', - '㍆' => 'マルク', - '㍇' => 'マンション', - '㍈' => 'ミクロン', - '㍉' => 'ミリ', - '㍊' => 'ミリバール', - '㍋' => 'メガ', - '㍌' => 'メガトン', - '㍍' => 'メートル', - '㍎' => 'ヤード', - '㍏' => 'ヤール', - '㍐' => 'ユアン', - '㍑' => 'リットル', - '㍒' => 'リラ', - '㍓' => 'ルピー', - '㍔' => 'ルーブル', - '㍕' => 'レム', - '㍖' => 'レントゲン', - '㍗' => 'ワット', - '㍘' => '0点', - '㍙' => '1点', - '㍚' => '2点', - '㍛' => '3点', - '㍜' => '4点', - '㍝' => '5点', - '㍞' => '6点', - '㍟' => '7点', - '㍠' => '8点', - '㍡' => '9点', - '㍢' => '10点', - '㍣' => '11点', - '㍤' => '12点', - '㍥' => '13点', - '㍦' => '14点', - '㍧' => '15点', - '㍨' => '16点', - '㍩' => '17点', - '㍪' => '18点', - '㍫' => '19点', - '㍬' => '20点', - '㍭' => '21点', - '㍮' => '22点', - '㍯' => '23点', - '㍰' => '24点', - '㍱' => 'hPa', - '㍲' => 'da', - '㍳' => 'AU', - '㍴' => 'bar', - '㍵' => 'oV', - '㍶' => 'pc', - '㍷' => 'dm', - '㍸' => 'dm²', - '㍹' => 'dm³', - '㍺' => 'IU', - '㍻' => '平成', - '㍼' => '昭和', - '㍽' => '大正', - '㍾' => '明治', - '㍿' => '株式会社', - '㎀' => 'pA', - '㎁' => 'nA', - '㎂' => 'μA', - '㎃' => 'mA', - '㎄' => 'kA', - '㎅' => 'KB', - '㎆' => 'MB', - '㎇' => 'GB', - '㎈' => 'cal', - '㎉' => 'kcal', - '㎊' => 'pF', - '㎋' => 'nF', - '㎌' => 'μF', - '㎍' => 'μg', - '㎎' => 'mg', - '㎏' => 'kg', - '㎐' => 'Hz', - '㎑' => 'kHz', - '㎒' => 'MHz', - '㎓' => 'GHz', - '㎔' => 'THz', - '㎕' => 'μℓ', - '㎖' => 'mℓ', - '㎗' => 'dℓ', - '㎘' => 'kℓ', - '㎙' => 'fm', - '㎚' => 'nm', - '㎛' => 'μm', - '㎜' => 'mm', - '㎝' => 'cm', - '㎞' => 'km', - '㎟' => 'mm²', - '㎠' => 'cm²', - '㎡' => 'm²', - '㎢' => 'km²', - '㎣' => 'mm³', - '㎤' => 'cm³', - '㎥' => 'm³', - '㎦' => 'km³', - '㎧' => 'm∕s', - '㎨' => 'm∕s²', - '㎩' => 'Pa', - '㎪' => 'kPa', - '㎫' => 'MPa', - '㎬' => 'GPa', - '㎭' => 'rad', - '㎮' => 'rad∕s', - '㎯' => 'rad∕s²', - '㎰' => 'ps', - '㎱' => 'ns', - '㎲' => 'μs', - '㎳' => 'ms', - '㎴' => 'pV', - '㎵' => 'nV', - '㎶' => 'μV', - '㎷' => 'mV', - '㎸' => 'kV', - '㎹' => 'MV', - '㎺' => 'pW', - '㎻' => 'nW', - '㎼' => 'μW', - '㎽' => 'mW', - '㎾' => 'kW', - '㎿' => 'MW', - '㏀' => 'kΩ', - '㏁' => 'MΩ', - '㏂' => 'a.m.', - '㏃' => 'Bq', - '㏄' => 'cc', - '㏅' => 'cd', - '㏆' => 'C∕kg', - '㏇' => 'Co.', - '㏈' => 'dB', - '㏉' => 'Gy', - '㏊' => 'ha', - '㏋' => 'HP', - '㏌' => 'in', - '㏍' => 'KK', - '㏎' => 'KM', - '㏏' => 'kt', - '㏐' => 'lm', - '㏑' => 'ln', - '㏒' => 'log', - '㏓' => 'lx', - '㏔' => 'mb', - '㏕' => 'mil', - '㏖' => 'mol', - '㏗' => 'PH', - '㏘' => 'p.m.', - '㏙' => 'PPM', - '㏚' => 'PR', - '㏛' => 'sr', - '㏜' => 'Sv', - '㏝' => 'Wb', - '㏞' => 'V∕m', - '㏟' => 'A∕m', - '㏠' => '1日', - '㏡' => '2日', - '㏢' => '3日', - '㏣' => '4日', - '㏤' => '5日', - '㏥' => '6日', - '㏦' => '7日', - '㏧' => '8日', - '㏨' => '9日', - '㏩' => '10日', - '㏪' => '11日', - '㏫' => '12日', - '㏬' => '13日', - '㏭' => '14日', - '㏮' => '15日', - '㏯' => '16日', - '㏰' => '17日', - '㏱' => '18日', - '㏲' => '19日', - '㏳' => '20日', - '㏴' => '21日', - '㏵' => '22日', - '㏶' => '23日', - '㏷' => '24日', - '㏸' => '25日', - '㏹' => '26日', - '㏺' => '27日', - '㏻' => '28日', - '㏼' => '29日', - '㏽' => '30日', - '㏾' => '31日', - '㏿' => 'gal', - '豈' => '豈', - '更' => '更', - '車' => '車', - '賈' => '賈', - '滑' => '滑', - '串' => '串', - '句' => '句', - '龜' => '龜', - '龜' => '龜', - '契' => '契', - '金' => '金', - '喇' => '喇', - '奈' => '奈', - '懶' => '懶', - '癩' => '癩', - '羅' => '羅', - '蘿' => '蘿', - '螺' => '螺', - '裸' => '裸', - '邏' => '邏', - '樂' => '樂', - '洛' => '洛', - '烙' => '烙', - '珞' => '珞', - '落' => '落', - '酪' => '酪', - '駱' => '駱', - '亂' => '亂', - '卵' => '卵', - '欄' => '欄', - '爛' => '爛', - '蘭' => '蘭', - '鸞' => '鸞', - '嵐' => '嵐', - '濫' => '濫', - '藍' => '藍', - '襤' => '襤', - '拉' => '拉', - '臘' => '臘', - '蠟' => '蠟', - '廊' => '廊', - '朗' => '朗', - '浪' => '浪', - '狼' => '狼', - '郎' => '郎', - '來' => '來', - '冷' => '冷', - '勞' => '勞', - '擄' => '擄', - '櫓' => '櫓', - '爐' => '爐', - '盧' => '盧', - '老' => '老', - '蘆' => '蘆', - '虜' => '虜', - '路' => '路', - '露' => '露', - '魯' => '魯', - '鷺' => '鷺', - '碌' => '碌', - '祿' => '祿', - '綠' => '綠', - '菉' => '菉', - '錄' => '錄', - '鹿' => '鹿', - '論' => '論', - '壟' => '壟', - '弄' => '弄', - '籠' => '籠', - '聾' => '聾', - '牢' => '牢', - '磊' => '磊', - '賂' => '賂', - '雷' => '雷', - '壘' => '壘', - '屢' => '屢', - '樓' => '樓', - '淚' => '淚', - '漏' => '漏', - '累' => '累', - '縷' => '縷', - '陋' => '陋', - '勒' => '勒', - '肋' => '肋', - '凜' => '凜', - '凌' => '凌', - '稜' => '稜', - '綾' => '綾', - '菱' => '菱', - '陵' => '陵', - '讀' => '讀', - '拏' => '拏', - '樂' => '樂', - '諾' => '諾', - '丹' => '丹', - '寧' => '寧', - '怒' => '怒', - '率' => '率', - '異' => '異', - '北' => '北', - '磻' => '磻', - '便' => '便', - '復' => '復', - '不' => '不', - '泌' => '泌', - '數' => '數', - '索' => '索', - '參' => '參', - '塞' => '塞', - '省' => '省', - '葉' => '葉', - '說' => '說', - '殺' => '殺', - '辰' => '辰', - '沈' => '沈', - '拾' => '拾', - '若' => '若', - '掠' => '掠', - '略' => '略', - '亮' => '亮', - '兩' => '兩', - '凉' => '凉', - '梁' => '梁', - '糧' => '糧', - '良' => '良', - '諒' => '諒', - '量' => '量', - '勵' => '勵', - '呂' => '呂', - '女' => '女', - '廬' => '廬', - '旅' => '旅', - '濾' => '濾', - '礪' => '礪', - '閭' => '閭', - '驪' => '驪', - '麗' => '麗', - '黎' => '黎', - '力' => '力', - '曆' => '曆', - '歷' => '歷', - '轢' => '轢', - '年' => '年', - '憐' => '憐', - '戀' => '戀', - '撚' => '撚', - '漣' => '漣', - '煉' => '煉', - '璉' => '璉', - '秊' => '秊', - '練' => '練', - '聯' => '聯', - '輦' => '輦', - '蓮' => '蓮', - '連' => '連', - '鍊' => '鍊', - '列' => '列', - '劣' => '劣', - '咽' => '咽', - '烈' => '烈', - '裂' => '裂', - '說' => '說', - '廉' => '廉', - '念' => '念', - '捻' => '捻', - '殮' => '殮', - '簾' => '簾', - '獵' => '獵', - '令' => '令', - '囹' => '囹', - '寧' => '寧', - '嶺' => '嶺', - '怜' => '怜', - '玲' => '玲', - '瑩' => '瑩', - '羚' => '羚', - '聆' => '聆', - '鈴' => '鈴', - '零' => '零', - '靈' => '靈', - '領' => '領', - '例' => '例', - '禮' => '禮', - '醴' => '醴', - '隸' => '隸', - '惡' => '惡', - '了' => '了', - '僚' => '僚', - '寮' => '寮', - '尿' => '尿', - '料' => '料', - '樂' => '樂', - '燎' => '燎', - '療' => '療', - '蓼' => '蓼', - '遼' => '遼', - '龍' => '龍', - '暈' => '暈', - '阮' => '阮', - '劉' => '劉', - '杻' => '杻', - '柳' => '柳', - '流' => '流', - '溜' => '溜', - '琉' => '琉', - '留' => '留', - '硫' => '硫', - '紐' => '紐', - '類' => '類', - '六' => '六', - '戮' => '戮', - '陸' => '陸', - '倫' => '倫', - '崙' => '崙', - '淪' => '淪', - '輪' => '輪', - '律' => '律', - '慄' => '慄', - '栗' => '栗', - '率' => '率', - '隆' => '隆', - '利' => '利', - '吏' => '吏', - '履' => '履', - '易' => '易', - '李' => '李', - '梨' => '梨', - '泥' => '泥', - '理' => '理', - '痢' => '痢', - '罹' => '罹', - '裏' => '裏', - '裡' => '裡', - '里' => '里', - '離' => '離', - '匿' => '匿', - '溺' => '溺', - '吝' => '吝', - '燐' => '燐', - '璘' => '璘', - '藺' => '藺', - '隣' => '隣', - '鱗' => '鱗', - '麟' => '麟', - '林' => '林', - '淋' => '淋', - '臨' => '臨', - '立' => '立', - '笠' => '笠', - '粒' => '粒', - '狀' => '狀', - '炙' => '炙', - '識' => '識', - '什' => '什', - '茶' => '茶', - '刺' => '刺', - '切' => '切', - '度' => '度', - '拓' => '拓', - '糖' => '糖', - '宅' => '宅', - '洞' => '洞', - '暴' => '暴', - '輻' => '輻', - '行' => '行', - '降' => '降', - '見' => '見', - '廓' => '廓', - '兀' => '兀', - '嗀' => '嗀', - '﨎' => '' . "\0" . '', - '﨏' => '' . "\0" . '', - '塚' => '塚', - '﨑' => '' . "\0" . '', - '晴' => '晴', - '﨓' => '' . "\0" . '', - '﨔' => '' . "\0" . '', - '凞' => '凞', - '猪' => '猪', - '益' => '益', - '礼' => '礼', - '神' => '神', - '祥' => '祥', - '福' => '福', - '靖' => '靖', - '精' => '精', - '羽' => '羽', - '﨟' => '' . "\0" . '', - '蘒' => '蘒', - '﨡' => '' . "\0" . '', - '諸' => '諸', - '﨣' => '' . "\0" . '', - '﨤' => '' . "\0" . '', - '逸' => '逸', - '都' => '都', - '﨧' => '' . "\0" . '', - '﨨' => '' . "\0" . '', - '﨩' => '' . "\0" . '', - '飯' => '飯', - '飼' => '飼', - '館' => '館', - '鶴' => '鶴', - '郞' => '郞', - '隷' => '隷', - '侮' => '侮', - '僧' => '僧', - '免' => '免', - '勉' => '勉', - '勤' => '勤', - '卑' => '卑', - '喝' => '喝', - '嘆' => '嘆', - '器' => '器', - '塀' => '塀', - '墨' => '墨', - '層' => '層', - '屮' => '屮', - '悔' => '悔', - '慨' => '慨', - '憎' => '憎', - '懲' => '懲', - '敏' => '敏', - '既' => '既', - '暑' => '暑', - '梅' => '梅', - '海' => '海', - '渚' => '渚', - '漢' => '漢', - '煮' => '煮', - '爫' => '爫', - '琢' => '琢', - '碑' => '碑', - '社' => '社', - '祉' => '祉', - '祈' => '祈', - '祐' => '祐', - '祖' => '祖', - '祝' => '祝', - '禍' => '禍', - '禎' => '禎', - '穀' => '穀', - '突' => '突', - '節' => '節', - '練' => '練', - '縉' => '縉', - '繁' => '繁', - '署' => '署', - '者' => '者', - '臭' => '臭', - '艹' => '艹', - '艹' => '艹', - '著' => '著', - '褐' => '褐', - '視' => '視', - '謁' => '謁', - '謹' => '謹', - '賓' => '賓', - '贈' => '贈', - '辶' => '辶', - '逸' => '逸', - '難' => '難', - '響' => '響', - '頻' => '頻', - '恵' => '恵', - '𤋮' => '𤋮', - '舘' => '舘', - '並' => '並', - '况' => '况', - '全' => '全', - '侀' => '侀', - '充' => '充', - '冀' => '冀', - '勇' => '勇', - '勺' => '勺', - '喝' => '喝', - '啕' => '啕', - '喙' => '喙', - '嗢' => '嗢', - '塚' => '塚', - '墳' => '墳', - '奄' => '奄', - '奔' => '奔', - '婢' => '婢', - '嬨' => '嬨', - '廒' => '廒', - '廙' => '廙', - '彩' => '彩', - '徭' => '徭', - '惘' => '惘', - '慎' => '慎', - '愈' => '愈', - '憎' => '憎', - '慠' => '慠', - '懲' => '懲', - '戴' => '戴', - '揄' => '揄', - '搜' => '搜', - '摒' => '摒', - '敖' => '敖', - '晴' => '晴', - '朗' => '朗', - '望' => '望', - '杖' => '杖', - '歹' => '歹', - '殺' => '殺', - '流' => '流', - '滛' => '滛', - '滋' => '滋', - '漢' => '漢', - '瀞' => '瀞', - '煮' => '煮', - '瞧' => '瞧', - '爵' => '爵', - '犯' => '犯', - '猪' => '猪', - '瑱' => '瑱', - '甆' => '甆', - '画' => '画', - '瘝' => '瘝', - '瘟' => '瘟', - '益' => '益', - '盛' => '盛', - '直' => '直', - '睊' => '睊', - '着' => '着', - '磌' => '磌', - '窱' => '窱', - '節' => '節', - '类' => '类', - '絛' => '絛', - '練' => '練', - '缾' => '缾', - '者' => '者', - '荒' => '荒', - '華' => '華', - '蝹' => '蝹', - '襁' => '襁', - '覆' => '覆', - '視' => '視', - '調' => '調', - '諸' => '諸', - '請' => '請', - '謁' => '謁', - '諾' => '諾', - '諭' => '諭', - '謹' => '謹', - '變' => '變', - '贈' => '贈', - '輸' => '輸', - '遲' => '遲', - '醙' => '醙', - '鉶' => '鉶', - '陼' => '陼', - '難' => '難', - '靖' => '靖', - '韛' => '韛', - '響' => '響', - '頋' => '頋', - '頻' => '頻', - '鬒' => '鬒', - '龜' => '龜', - '𢡊' => '𢡊', - '𢡄' => '𢡄', - '𣏕' => '𣏕', - '㮝' => '㮝', - '䀘' => '䀘', - '䀹' => '䀹', - '𥉉' => '𥉉', - '𥳐' => '𥳐', - '𧻓' => '𧻓', - '齃' => '齃', - '龎' => '龎', - 'ff' => 'ff', - 'fi' => 'fi', - 'fl' => 'fl', - 'ffi' => 'ffi', - 'ffl' => 'ffl', - 'ſt' => 'ſt', - 'st' => 'st', - 'ﬓ' => 'մն', - 'ﬔ' => 'մե', - 'ﬕ' => 'մի', - 'ﬖ' => 'վն', - 'ﬗ' => 'մխ', - 'ﬠ' => 'ע', - 'ﬡ' => 'א', - 'ﬢ' => 'ד', - 'ﬣ' => 'ה', - 'ﬤ' => 'כ', - 'ﬥ' => 'ל', - 'ﬦ' => 'ם', - 'ﬧ' => 'ר', - 'ﬨ' => 'ת', - '﬩' => '+', - 'ﭏ' => 'אל', - '﹉' => '‾', - '﹊' => '‾', - '﹋' => '‾', - '﹌' => '‾', - '﹍' => '_', - '﹎' => '_', - '﹏' => '_', - '﹐' => ',', - '﹑' => '、', - '﹒' => '.', - '﹔' => ';', - '﹕' => ':', - '﹖' => '?', - '﹗' => '!', - '﹘' => '—', - '﹙' => '(', - '﹚' => ')', - '﹛' => '{', - '﹜' => '}', - '﹝' => '〔', - '﹞' => '〕', - '﹟' => '#', - '﹠' => '&', - '﹡' => '*', - '﹢' => '+', - '﹣' => '-', - '﹤' => '<', - '﹥' => '>', - '﹦' => '=', - '﹨' => '\\', - '﹩' => '$', - '﹪' => '%', - '﹫' => '@', - '!' => '!', - '"' => '"', - '#' => '#', - '$' => '$', - '%' => '%', - '&' => '&', - ''' => '\'', - '(' => '(', - ')' => ')', - '*' => '*', - '+' => '+', - ',' => ',', - '-' => '-', - '.' => '.', - '/' => '/', - '0' => '0', - '1' => '1', - '2' => '2', - '3' => '3', - '4' => '4', - '5' => '5', - '6' => '6', - '7' => '7', - '8' => '8', - '9' => '9', - ':' => ':', - ';' => ';', - '<' => '<', - '=' => '=', - '>' => '>', - '?' => '?', - '@' => '@', - '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', - '[' => '[', - '\' => '\\', - ']' => ']', - '^' => '^', - '_' => '_', - '`' => '`', - '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', - '{' => '{', - '|' => '|', - '}' => '}', - '~' => '~', - '⦅' => '⦅', - '⦆' => '⦆', - '。' => '。', - '「' => '「', - '」' => '」', - '、' => '、', - '・' => '・', - 'ヲ' => 'ヲ', - 'ァ' => 'ァ', - 'ィ' => 'ィ', - 'ゥ' => 'ゥ', - 'ェ' => 'ェ', - 'ォ' => 'ォ', - 'ャ' => 'ャ', - 'ュ' => 'ュ', - 'ョ' => 'ョ', - 'ッ' => 'ッ', - 'ー' => 'ー', - 'ア' => 'ア', - 'イ' => 'イ', - 'ウ' => 'ウ', - 'エ' => 'エ', - 'オ' => 'オ', - 'カ' => 'カ', - 'キ' => 'キ', - 'ク' => 'ク', - 'ケ' => 'ケ', - 'コ' => 'コ', - 'サ' => 'サ', - 'シ' => 'シ', - 'ス' => 'ス', - 'セ' => 'セ', - 'ソ' => 'ソ', - 'タ' => 'タ', - 'チ' => 'チ', - 'ツ' => 'ツ', - 'テ' => 'テ', - 'ト' => 'ト', - 'ナ' => 'ナ', - 'ニ' => 'ニ', - 'ヌ' => 'ヌ', - 'ネ' => 'ネ', - 'ノ' => 'ノ', - 'ハ' => 'ハ', - 'ヒ' => 'ヒ', - 'フ' => 'フ', - 'ヘ' => 'ヘ', - 'ホ' => 'ホ', - 'マ' => 'マ', - 'ミ' => 'ミ', - 'ム' => 'ム', - 'メ' => 'メ', - 'モ' => 'モ', - 'ヤ' => 'ヤ', - 'ユ' => 'ユ', - 'ヨ' => 'ヨ', - 'ラ' => 'ラ', - 'リ' => 'リ', - 'ル' => 'ル', - 'レ' => 'レ', - 'ロ' => 'ロ', - 'ワ' => 'ワ', - 'ン' => 'ン', - '゙' => '゙', - '゚' => '゚', - 'ᅠ' => 'ㅤ', - 'ᄀ' => 'ㄱ', - 'ᄁ' => 'ㄲ', - 'ᆪ' => 'ㄳ', - 'ᄂ' => 'ㄴ', - 'ᆬ' => 'ㄵ', - 'ᆭ' => 'ㄶ', - 'ᄃ' => 'ㄷ', - 'ᄄ' => 'ㄸ', - 'ᄅ' => 'ㄹ', - 'ᆰ' => 'ㄺ', - 'ᆱ' => 'ㄻ', - 'ᆲ' => 'ㄼ', - 'ᆳ' => 'ㄽ', - 'ᆴ' => 'ㄾ', - 'ᆵ' => 'ㄿ', - 'ᄚ' => 'ㅀ', - 'ᄆ' => 'ㅁ', - 'ᄇ' => 'ㅂ', - 'ᄈ' => 'ㅃ', - 'ᄡ' => 'ㅄ', - 'ᄉ' => 'ㅅ', - 'ᄊ' => 'ㅆ', - 'ᄋ' => 'ㅇ', - 'ᄌ' => 'ㅈ', - 'ᄍ' => 'ㅉ', - 'ᄎ' => 'ㅊ', - 'ᄏ' => 'ㅋ', - 'ᄐ' => 'ㅌ', - 'ᄑ' => 'ㅍ', - 'ᄒ' => 'ㅎ', - 'ᅡ' => 'ㅏ', - 'ᅢ' => 'ㅐ', - 'ᅣ' => 'ㅑ', - 'ᅤ' => 'ㅒ', - 'ᅥ' => 'ㅓ', - 'ᅦ' => 'ㅔ', - 'ᅧ' => 'ㅕ', - 'ᅨ' => 'ㅖ', - 'ᅩ' => 'ㅗ', - 'ᅪ' => 'ㅘ', - 'ᅫ' => 'ㅙ', - 'ᅬ' => 'ㅚ', - 'ᅭ' => 'ㅛ', - 'ᅮ' => 'ㅜ', - 'ᅯ' => 'ㅝ', - 'ᅰ' => 'ㅞ', - 'ᅱ' => 'ㅟ', - 'ᅲ' => 'ㅠ', - 'ᅳ' => 'ㅡ', - 'ᅴ' => 'ㅢ', - 'ᅵ' => 'ㅣ', - '¢' => '¢', - '£' => '£', - '¬' => '¬', - ' ̄' => '¯', - '¦' => '¦', - '¥' => '¥', - '₩' => '₩', - '│' => '│', - '←' => '←', - '↑' => '↑', - '→' => '→', - '↓' => '↓', - '■' => '■', - '○' => '○', - '𝐀' => 'A', - '𝐁' => 'B', - '𝐂' => 'C', - '𝐃' => 'D', - '𝐄' => 'E', - '𝐅' => 'F', - '𝐆' => 'G', - '𝐇' => 'H', - '𝐈' => 'I', - '𝐉' => 'J', - '𝐊' => 'K', - '𝐋' => 'L', - '𝐌' => 'M', - '𝐍' => 'N', - '𝐎' => 'O', - '𝐏' => 'P', - '𝐐' => 'Q', - '𝐑' => 'R', - '𝐒' => 'S', - '𝐓' => 'T', - '𝐔' => 'U', - '𝐕' => 'V', - '𝐖' => 'W', - '𝐗' => 'X', - '𝐘' => 'Y', - '𝐙' => 'Z', - '𝐚' => 'a', - '𝐛' => 'b', - '𝐜' => 'c', - '𝐝' => 'd', - '𝐞' => 'e', - '𝐟' => 'f', - '𝐠' => 'g', - '𝐡' => 'h', - '𝐢' => 'i', - '𝐣' => 'j', - '𝐤' => 'k', - '𝐥' => 'l', - '𝐦' => 'm', - '𝐧' => 'n', - '𝐨' => 'o', - '𝐩' => 'p', - '𝐪' => 'q', - '𝐫' => 'r', - '𝐬' => 's', - '𝐭' => 't', - '𝐮' => 'u', - '𝐯' => 'v', - '𝐰' => 'w', - '𝐱' => 'x', - '𝐲' => 'y', - '𝐳' => 'z', - '𝐴' => 'A', - '𝐵' => 'B', - '𝐶' => 'C', - '𝐷' => 'D', - '𝐸' => 'E', - '𝐹' => 'F', - '𝐺' => 'G', - '𝐻' => 'H', - '𝐼' => 'I', - '𝐽' => 'J', - '𝐾' => 'K', - '𝐿' => 'L', - '𝑀' => 'M', - '𝑁' => 'N', - '𝑂' => 'O', - '𝑃' => 'P', - '𝑄' => 'Q', - '𝑅' => 'R', - '𝑆' => 'S', - '𝑇' => 'T', - '𝑈' => 'U', - '𝑉' => 'V', - '𝑊' => 'W', - '𝑋' => 'X', - '𝑌' => 'Y', - '𝑍' => 'Z', - '𝑎' => 'a', - '𝑏' => 'b', - '𝑐' => 'c', - '𝑑' => 'd', - '𝑒' => 'e', - '𝑓' => 'f', - '𝑔' => 'g', - '𝑖' => 'i', - '𝑗' => 'j', - '𝑘' => 'k', - '𝑙' => 'l', - '𝑚' => 'm', - '𝑛' => 'n', - '𝑜' => 'o', - '𝑝' => 'p', - '𝑞' => 'q', - '𝑟' => 'r', - '𝑠' => 's', - '𝑡' => 't', - '𝑢' => 'u', - '𝑣' => 'v', - '𝑤' => 'w', - '𝑥' => 'x', - '𝑦' => 'y', - '𝑧' => 'z', - '𝑨' => 'A', - '𝑩' => 'B', - '𝑪' => 'C', - '𝑫' => 'D', - '𝑬' => 'E', - '𝑭' => 'F', - '𝑮' => 'G', - '𝑯' => 'H', - '𝑰' => 'I', - '𝑱' => 'J', - '𝑲' => 'K', - '𝑳' => 'L', - '𝑴' => 'M', - '𝑵' => 'N', - '𝑶' => 'O', - '𝑷' => 'P', - '𝑸' => 'Q', - '𝑹' => 'R', - '𝑺' => 'S', - '𝑻' => 'T', - '𝑼' => 'U', - '𝑽' => 'V', - '𝑾' => 'W', - '𝑿' => 'X', - '𝒀' => 'Y', - '𝒁' => 'Z', - '𝒂' => 'a', - '𝒃' => 'b', - '𝒄' => 'c', - '𝒅' => 'd', - '𝒆' => 'e', - '𝒇' => 'f', - '𝒈' => 'g', - '𝒉' => 'h', - '𝒊' => 'i', - '𝒋' => 'j', - '𝒌' => 'k', - '𝒍' => 'l', - '𝒎' => 'm', - '𝒏' => 'n', - '𝒐' => 'o', - '𝒑' => 'p', - '𝒒' => 'q', - '𝒓' => 'r', - '𝒔' => 's', - '𝒕' => 't', - '𝒖' => 'u', - '𝒗' => 'v', - '𝒘' => 'w', - '𝒙' => 'x', - '𝒚' => 'y', - '𝒛' => 'z', - '𝒜' => 'A', - '𝒞' => 'C', - '𝒟' => 'D', - '𝒢' => 'G', - '𝒥' => 'J', - '𝒦' => 'K', - '𝒩' => 'N', - '𝒪' => 'O', - '𝒫' => 'P', - '𝒬' => 'Q', - '𝒮' => 'S', - '𝒯' => 'T', - '𝒰' => 'U', - '𝒱' => 'V', - '𝒲' => 'W', - '𝒳' => 'X', - '𝒴' => 'Y', - '𝒵' => 'Z', - '𝒶' => 'a', - '𝒷' => 'b', - '𝒸' => 'c', - '𝒹' => 'd', - '𝒻' => 'f', - '𝒽' => 'h', - '𝒾' => 'i', - '𝒿' => 'j', - '𝓀' => 'k', - '𝓁' => 'l', - '𝓂' => 'm', - '𝓃' => 'n', - '𝓅' => 'p', - '𝓆' => 'q', - '𝓇' => 'r', - '𝓈' => 's', - '𝓉' => 't', - '𝓊' => 'u', - '𝓋' => 'v', - '𝓌' => 'w', - '𝓍' => 'x', - '𝓎' => 'y', - '𝓏' => 'z', - '𝓐' => 'A', - '𝓑' => 'B', - '𝓒' => 'C', - '𝓓' => 'D', - '𝓔' => 'E', - '𝓕' => 'F', - '𝓖' => 'G', - '𝓗' => 'H', - '𝓘' => 'I', - '𝓙' => 'J', - '𝓚' => 'K', - '𝓛' => 'L', - '𝓜' => 'M', - '𝓝' => 'N', - '𝓞' => 'O', - '𝓟' => 'P', - '𝓠' => 'Q', - '𝓡' => 'R', - '𝓢' => 'S', - '𝓣' => 'T', - '𝓤' => 'U', - '𝓥' => 'V', - '𝓦' => 'W', - '𝓧' => 'X', - '𝓨' => 'Y', - '𝓩' => 'Z', - '𝓪' => 'a', - '𝓫' => 'b', - '𝓬' => 'c', - '𝓭' => 'd', - '𝓮' => 'e', - '𝓯' => 'f', - '𝓰' => 'g', - '𝓱' => 'h', - '𝓲' => 'i', - '𝓳' => 'j', - '𝓴' => 'k', - '𝓵' => 'l', - '𝓶' => 'm', - '𝓷' => 'n', - '𝓸' => 'o', - '𝓹' => 'p', - '𝓺' => 'q', - '𝓻' => 'r', - '𝓼' => 's', - '𝓽' => 't', - '𝓾' => 'u', - '𝓿' => 'v', - '𝔀' => 'w', - '𝔁' => 'x', - '𝔂' => 'y', - '𝔃' => 'z', - '𝔄' => 'A', - '𝔅' => 'B', - '𝔇' => 'D', - '𝔈' => 'E', - '𝔉' => 'F', - '𝔊' => 'G', - '𝔍' => 'J', - '𝔎' => 'K', - '𝔏' => 'L', - '𝔐' => 'M', - '𝔑' => 'N', - '𝔒' => 'O', - '𝔓' => 'P', - '𝔔' => 'Q', - '𝔖' => 'S', - '𝔗' => 'T', - '𝔘' => 'U', - '𝔙' => 'V', - '𝔚' => 'W', - '𝔛' => 'X', - '𝔜' => 'Y', - '𝔞' => 'a', - '𝔟' => 'b', - '𝔠' => 'c', - '𝔡' => 'd', - '𝔢' => 'e', - '𝔣' => 'f', - '𝔤' => 'g', - '𝔥' => 'h', - '𝔦' => 'i', - '𝔧' => 'j', - '𝔨' => 'k', - '𝔩' => 'l', - '𝔪' => 'm', - '𝔫' => 'n', - '𝔬' => 'o', - '𝔭' => 'p', - '𝔮' => 'q', - '𝔯' => 'r', - '𝔰' => 's', - '𝔱' => 't', - '𝔲' => 'u', - '𝔳' => 'v', - '𝔴' => 'w', - '𝔵' => 'x', - '𝔶' => 'y', - '𝔷' => 'z', - '𝔸' => 'A', - '𝔹' => 'B', - '𝔻' => 'D', - '𝔼' => 'E', - '𝔽' => 'F', - '𝔾' => 'G', - '𝕀' => 'I', - '𝕁' => 'J', - '𝕂' => 'K', - '𝕃' => 'L', - '𝕄' => 'M', - '𝕆' => 'O', - '𝕊' => 'S', - '𝕋' => 'T', - '𝕌' => 'U', - '𝕍' => 'V', - '𝕎' => 'W', - '𝕏' => 'X', - '𝕐' => 'Y', - '𝕒' => 'a', - '𝕓' => 'b', - '𝕔' => 'c', - '𝕕' => 'd', - '𝕖' => 'e', - '𝕗' => 'f', - '𝕘' => 'g', - '𝕙' => 'h', - '𝕚' => 'i', - '𝕛' => 'j', - '𝕜' => 'k', - '𝕝' => 'l', - '𝕞' => 'm', - '𝕟' => 'n', - '𝕠' => 'o', - '𝕡' => 'p', - '𝕢' => 'q', - '𝕣' => 'r', - '𝕤' => 's', - '𝕥' => 't', - '𝕦' => 'u', - '𝕧' => 'v', - '𝕨' => 'w', - '𝕩' => 'x', - '𝕪' => 'y', - '𝕫' => 'z', - '𝕬' => 'A', - '𝕭' => 'B', - '𝕮' => 'C', - '𝕯' => 'D', - '𝕰' => 'E', - '𝕱' => 'F', - '𝕲' => 'G', - '𝕳' => 'H', - '𝕴' => 'I', - '𝕵' => 'J', - '𝕶' => 'K', - '𝕷' => 'L', - '𝕸' => 'M', - '𝕹' => 'N', - '𝕺' => 'O', - '𝕻' => 'P', - '𝕼' => 'Q', - '𝕽' => 'R', - '𝕾' => 'S', - '𝕿' => 'T', - '𝖀' => 'U', - '𝖁' => 'V', - '𝖂' => 'W', - '𝖃' => 'X', - '𝖄' => 'Y', - '𝖅' => 'Z', - '𝖆' => 'a', - '𝖇' => 'b', - '𝖈' => 'c', - '𝖉' => 'd', - '𝖊' => 'e', - '𝖋' => 'f', - '𝖌' => 'g', - '𝖍' => 'h', - '𝖎' => 'i', - '𝖏' => 'j', - '𝖐' => 'k', - '𝖑' => 'l', - '𝖒' => 'm', - '𝖓' => 'n', - '𝖔' => 'o', - '𝖕' => 'p', - '𝖖' => 'q', - '𝖗' => 'r', - '𝖘' => 's', - '𝖙' => 't', - '𝖚' => 'u', - '𝖛' => 'v', - '𝖜' => 'w', - '𝖝' => 'x', - '𝖞' => 'y', - '𝖟' => 'z', - '𝖠' => 'A', - '𝖡' => 'B', - '𝖢' => 'C', - '𝖣' => 'D', - '𝖤' => 'E', - '𝖥' => 'F', - '𝖦' => 'G', - '𝖧' => 'H', - '𝖨' => 'I', - '𝖩' => 'J', - '𝖪' => 'K', - '𝖫' => 'L', - '𝖬' => 'M', - '𝖭' => 'N', - '𝖮' => 'O', - '𝖯' => 'P', - '𝖰' => 'Q', - '𝖱' => 'R', - '𝖲' => 'S', - '𝖳' => 'T', - '𝖴' => 'U', - '𝖵' => 'V', - '𝖶' => 'W', - '𝖷' => 'X', - '𝖸' => 'Y', - '𝖹' => 'Z', - '𝖺' => 'a', - '𝖻' => 'b', - '𝖼' => 'c', - '𝖽' => 'd', - '𝖾' => 'e', - '𝖿' => 'f', - '𝗀' => 'g', - '𝗁' => 'h', - '𝗂' => 'i', - '𝗃' => 'j', - '𝗄' => 'k', - '𝗅' => 'l', - '𝗆' => 'm', - '𝗇' => 'n', - '𝗈' => 'o', - '𝗉' => 'p', - '𝗊' => 'q', - '𝗋' => 'r', - '𝗌' => 's', - '𝗍' => 't', - '𝗎' => 'u', - '𝗏' => 'v', - '𝗐' => 'w', - '𝗑' => 'x', - '𝗒' => 'y', - '𝗓' => 'z', - '𝗔' => 'A', - '𝗕' => 'B', - '𝗖' => 'C', - '𝗗' => 'D', - '𝗘' => 'E', - '𝗙' => 'F', - '𝗚' => 'G', - '𝗛' => 'H', - '𝗜' => 'I', - '𝗝' => 'J', - '𝗞' => 'K', - '𝗟' => 'L', - '𝗠' => 'M', - '𝗡' => 'N', - '𝗢' => 'O', - '𝗣' => 'P', - '𝗤' => 'Q', - '𝗥' => 'R', - '𝗦' => 'S', - '𝗧' => 'T', - '𝗨' => 'U', - '𝗩' => 'V', - '𝗪' => 'W', - '𝗫' => 'X', - '𝗬' => 'Y', - '𝗭' => 'Z', - '𝗮' => 'a', - '𝗯' => 'b', - '𝗰' => 'c', - '𝗱' => 'd', - '𝗲' => 'e', - '𝗳' => 'f', - '𝗴' => 'g', - '𝗵' => 'h', - '𝗶' => 'i', - '𝗷' => 'j', - '𝗸' => 'k', - '𝗹' => 'l', - '𝗺' => 'm', - '𝗻' => 'n', - '𝗼' => 'o', - '𝗽' => 'p', - '𝗾' => 'q', - '𝗿' => 'r', - '𝘀' => 's', - '𝘁' => 't', - '𝘂' => 'u', - '𝘃' => 'v', - '𝘄' => 'w', - '𝘅' => 'x', - '𝘆' => 'y', - '𝘇' => 'z', - '𝘈' => 'A', - '𝘉' => 'B', - '𝘊' => 'C', - '𝘋' => 'D', - '𝘌' => 'E', - '𝘍' => 'F', - '𝘎' => 'G', - '𝘏' => 'H', - '𝘐' => 'I', - '𝘑' => 'J', - '𝘒' => 'K', - '𝘓' => 'L', - '𝘔' => 'M', - '𝘕' => 'N', - '𝘖' => 'O', - '𝘗' => 'P', - '𝘘' => 'Q', - '𝘙' => 'R', - '𝘚' => 'S', - '𝘛' => 'T', - '𝘜' => 'U', - '𝘝' => 'V', - '𝘞' => 'W', - '𝘟' => 'X', - '𝘠' => 'Y', - '𝘡' => 'Z', - '𝘢' => 'a', - '𝘣' => 'b', - '𝘤' => 'c', - '𝘥' => 'd', - '𝘦' => 'e', - '𝘧' => 'f', - '𝘨' => 'g', - '𝘩' => 'h', - '𝘪' => 'i', - '𝘫' => 'j', - '𝘬' => 'k', - '𝘭' => 'l', - '𝘮' => 'm', - '𝘯' => 'n', - '𝘰' => 'o', - '𝘱' => 'p', - '𝘲' => 'q', - '𝘳' => 'r', - '𝘴' => 's', - '𝘵' => 't', - '𝘶' => 'u', - '𝘷' => 'v', - '𝘸' => 'w', - '𝘹' => 'x', - '𝘺' => 'y', - '𝘻' => 'z', - '𝘼' => 'A', - '𝘽' => 'B', - '𝘾' => 'C', - '𝘿' => 'D', - '𝙀' => 'E', - '𝙁' => 'F', - '𝙂' => 'G', - '𝙃' => 'H', - '𝙄' => 'I', - '𝙅' => 'J', - '𝙆' => 'K', - '𝙇' => 'L', - '𝙈' => 'M', - '𝙉' => 'N', - '𝙊' => 'O', - '𝙋' => 'P', - '𝙌' => 'Q', - '𝙍' => 'R', - '𝙎' => 'S', - '𝙏' => 'T', - '𝙐' => 'U', - '𝙑' => 'V', - '𝙒' => 'W', - '𝙓' => 'X', - '𝙔' => 'Y', - '𝙕' => 'Z', - '𝙖' => 'a', - '𝙗' => 'b', - '𝙘' => 'c', - '𝙙' => 'd', - '𝙚' => 'e', - '𝙛' => 'f', - '𝙜' => 'g', - '𝙝' => 'h', - '𝙞' => 'i', - '𝙟' => 'j', - '𝙠' => 'k', - '𝙡' => 'l', - '𝙢' => 'm', - '𝙣' => 'n', - '𝙤' => 'o', - '𝙥' => 'p', - '𝙦' => 'q', - '𝙧' => 'r', - '𝙨' => 's', - '𝙩' => 't', - '𝙪' => 'u', - '𝙫' => 'v', - '𝙬' => 'w', - '𝙭' => 'x', - '𝙮' => 'y', - '𝙯' => 'z', - '𝙰' => 'A', - '𝙱' => 'B', - '𝙲' => 'C', - '𝙳' => 'D', - '𝙴' => 'E', - '𝙵' => 'F', - '𝙶' => 'G', - '𝙷' => 'H', - '𝙸' => 'I', - '𝙹' => 'J', - '𝙺' => 'K', - '𝙻' => 'L', - '𝙼' => 'M', - '𝙽' => 'N', - '𝙾' => 'O', - '𝙿' => 'P', - '𝚀' => 'Q', - '𝚁' => 'R', - '𝚂' => 'S', - '𝚃' => 'T', - '𝚄' => 'U', - '𝚅' => 'V', - '𝚆' => 'W', - '𝚇' => 'X', - '𝚈' => 'Y', - '𝚉' => 'Z', - '𝚊' => 'a', - '𝚋' => 'b', - '𝚌' => 'c', - '𝚍' => 'd', - '𝚎' => 'e', - '𝚏' => 'f', - '𝚐' => 'g', - '𝚑' => 'h', - '𝚒' => 'i', - '𝚓' => 'j', - '𝚔' => 'k', - '𝚕' => 'l', - '𝚖' => 'm', - '𝚗' => 'n', - '𝚘' => 'o', - '𝚙' => 'p', - '𝚚' => 'q', - '𝚛' => 'r', - '𝚜' => 's', - '𝚝' => 't', - '𝚞' => 'u', - '𝚟' => 'v', - '𝚠' => 'w', - '𝚡' => 'x', - '𝚢' => 'y', - '𝚣' => 'z', - '𝚤' => 'ı', - '𝚥' => 'ȷ', - '𝚨' => 'Α', - '𝚩' => 'Β', - '𝚪' => 'Γ', - '𝚫' => 'Δ', - '𝚬' => 'Ε', - '𝚭' => 'Ζ', - '𝚮' => 'Η', - '𝚯' => 'Θ', - '𝚰' => 'Ι', - '𝚱' => 'Κ', - '𝚲' => 'Λ', - '𝚳' => 'Μ', - '𝚴' => 'Ν', - '𝚵' => 'Ξ', - '𝚶' => 'Ο', - '𝚷' => 'Π', - '𝚸' => 'Ρ', - '𝚹' => 'ϴ', - '𝚺' => 'Σ', - '𝚻' => 'Τ', - '𝚼' => 'Υ', - '𝚽' => 'Φ', - '𝚾' => 'Χ', - '𝚿' => 'Ψ', - '𝛀' => 'Ω', - '𝛁' => '∇', - '𝛂' => 'α', - '𝛃' => 'β', - '𝛄' => 'γ', - '𝛅' => 'δ', - '𝛆' => 'ε', - '𝛇' => 'ζ', - '𝛈' => 'η', - '𝛉' => 'θ', - '𝛊' => 'ι', - '𝛋' => 'κ', - '𝛌' => 'λ', - '𝛍' => 'μ', - '𝛎' => 'ν', - '𝛏' => 'ξ', - '𝛐' => 'ο', - '𝛑' => 'π', - '𝛒' => 'ρ', - '𝛓' => 'ς', - '𝛔' => 'σ', - '𝛕' => 'τ', - '𝛖' => 'υ', - '𝛗' => 'φ', - '𝛘' => 'χ', - '𝛙' => 'ψ', - '𝛚' => 'ω', - '𝛛' => '∂', - '𝛜' => 'ϵ', - '𝛝' => 'ϑ', - '𝛞' => 'ϰ', - '𝛟' => 'ϕ', - '𝛠' => 'ϱ', - '𝛡' => 'ϖ', - '𝛢' => 'Α', - '𝛣' => 'Β', - '𝛤' => 'Γ', - '𝛥' => 'Δ', - '𝛦' => 'Ε', - '𝛧' => 'Ζ', - '𝛨' => 'Η', - '𝛩' => 'Θ', - '𝛪' => 'Ι', - '𝛫' => 'Κ', - '𝛬' => 'Λ', - '𝛭' => 'Μ', - '𝛮' => 'Ν', - '𝛯' => 'Ξ', - '𝛰' => 'Ο', - '𝛱' => 'Π', - '𝛲' => 'Ρ', - '𝛳' => 'ϴ', - '𝛴' => 'Σ', - '𝛵' => 'Τ', - '𝛶' => 'Υ', - '𝛷' => 'Φ', - '𝛸' => 'Χ', - '𝛹' => 'Ψ', - '𝛺' => 'Ω', - '𝛻' => '∇', - '𝛼' => 'α', - '𝛽' => 'β', - '𝛾' => 'γ', - '𝛿' => 'δ', - '𝜀' => 'ε', - '𝜁' => 'ζ', - '𝜂' => 'η', - '𝜃' => 'θ', - '𝜄' => 'ι', - '𝜅' => 'κ', - '𝜆' => 'λ', - '𝜇' => 'μ', - '𝜈' => 'ν', - '𝜉' => 'ξ', - '𝜊' => 'ο', - '𝜋' => 'π', - '𝜌' => 'ρ', - '𝜍' => 'ς', - '𝜎' => 'σ', - '𝜏' => 'τ', - '𝜐' => 'υ', - '𝜑' => 'φ', - '𝜒' => 'χ', - '𝜓' => 'ψ', - '𝜔' => 'ω', - '𝜕' => '∂', - '𝜖' => 'ϵ', - '𝜗' => 'ϑ', - '𝜘' => 'ϰ', - '𝜙' => 'ϕ', - '𝜚' => 'ϱ', - '𝜛' => 'ϖ', - '𝜜' => 'Α', - '𝜝' => 'Β', - '𝜞' => 'Γ', - '𝜟' => 'Δ', - '𝜠' => 'Ε', - '𝜡' => 'Ζ', - '𝜢' => 'Η', - '𝜣' => 'Θ', - '𝜤' => 'Ι', - '𝜥' => 'Κ', - '𝜦' => 'Λ', - '𝜧' => 'Μ', - '𝜨' => 'Ν', - '𝜩' => 'Ξ', - '𝜪' => 'Ο', - '𝜫' => 'Π', - '𝜬' => 'Ρ', - '𝜭' => 'ϴ', - '𝜮' => 'Σ', - '𝜯' => 'Τ', - '𝜰' => 'Υ', - '𝜱' => 'Φ', - '𝜲' => 'Χ', - '𝜳' => 'Ψ', - '𝜴' => 'Ω', - '𝜵' => '∇', - '𝜶' => 'α', - '𝜷' => 'β', - '𝜸' => 'γ', - '𝜹' => 'δ', - '𝜺' => 'ε', - '𝜻' => 'ζ', - '𝜼' => 'η', - '𝜽' => 'θ', - '𝜾' => 'ι', - '𝜿' => 'κ', - '𝝀' => 'λ', - '𝝁' => 'μ', - '𝝂' => 'ν', - '𝝃' => 'ξ', - '𝝄' => 'ο', - '𝝅' => 'π', - '𝝆' => 'ρ', - '𝝇' => 'ς', - '𝝈' => 'σ', - '𝝉' => 'τ', - '𝝊' => 'υ', - '𝝋' => 'φ', - '𝝌' => 'χ', - '𝝍' => 'ψ', - '𝝎' => 'ω', - '𝝏' => '∂', - '𝝐' => 'ϵ', - '𝝑' => 'ϑ', - '𝝒' => 'ϰ', - '𝝓' => 'ϕ', - '𝝔' => 'ϱ', - '𝝕' => 'ϖ', - '𝝖' => 'Α', - '𝝗' => 'Β', - '𝝘' => 'Γ', - '𝝙' => 'Δ', - '𝝚' => 'Ε', - '𝝛' => 'Ζ', - '𝝜' => 'Η', - '𝝝' => 'Θ', - '𝝞' => 'Ι', - '𝝟' => 'Κ', - '𝝠' => 'Λ', - '𝝡' => 'Μ', - '𝝢' => 'Ν', - '𝝣' => 'Ξ', - '𝝤' => 'Ο', - '𝝥' => 'Π', - '𝝦' => 'Ρ', - '𝝧' => 'ϴ', - '𝝨' => 'Σ', - '𝝩' => 'Τ', - '𝝪' => 'Υ', - '𝝫' => 'Φ', - '𝝬' => 'Χ', - '𝝭' => 'Ψ', - '𝝮' => 'Ω', - '𝝯' => '∇', - '𝝰' => 'α', - '𝝱' => 'β', - '𝝲' => 'γ', - '𝝳' => 'δ', - '𝝴' => 'ε', - '𝝵' => 'ζ', - '𝝶' => 'η', - '𝝷' => 'θ', - '𝝸' => 'ι', - '𝝹' => 'κ', - '𝝺' => 'λ', - '𝝻' => 'μ', - '𝝼' => 'ν', - '𝝽' => 'ξ', - '𝝾' => 'ο', - '𝝿' => 'π', - '𝞀' => 'ρ', - '𝞁' => 'ς', - '𝞂' => 'σ', - '𝞃' => 'τ', - '𝞄' => 'υ', - '𝞅' => 'φ', - '𝞆' => 'χ', - '𝞇' => 'ψ', - '𝞈' => 'ω', - '𝞉' => '∂', - '𝞊' => 'ϵ', - '𝞋' => 'ϑ', - '𝞌' => 'ϰ', - '𝞍' => 'ϕ', - '𝞎' => 'ϱ', - '𝞏' => 'ϖ', - '𝞐' => 'Α', - '𝞑' => 'Β', - '𝞒' => 'Γ', - '𝞓' => 'Δ', - '𝞔' => 'Ε', - '𝞕' => 'Ζ', - '𝞖' => 'Η', - '𝞗' => 'Θ', - '𝞘' => 'Ι', - '𝞙' => 'Κ', - '𝞚' => 'Λ', - '𝞛' => 'Μ', - '𝞜' => 'Ν', - '𝞝' => 'Ξ', - '𝞞' => 'Ο', - '𝞟' => 'Π', - '𝞠' => 'Ρ', - '𝞡' => 'ϴ', - '𝞢' => 'Σ', - '𝞣' => 'Τ', - '𝞤' => 'Υ', - '𝞥' => 'Φ', - '𝞦' => 'Χ', - '𝞧' => 'Ψ', - '𝞨' => 'Ω', - '𝞩' => '∇', - '𝞪' => 'α', - '𝞫' => 'β', - '𝞬' => 'γ', - '𝞭' => 'δ', - '𝞮' => 'ε', - '𝞯' => 'ζ', - '𝞰' => 'η', - '𝞱' => 'θ', - '𝞲' => 'ι', - '𝞳' => 'κ', - '𝞴' => 'λ', - '𝞵' => 'μ', - '𝞶' => 'ν', - '𝞷' => 'ξ', - '𝞸' => 'ο', - '𝞹' => 'π', - '𝞺' => 'ρ', - '𝞻' => 'ς', - '𝞼' => 'σ', - '𝞽' => 'τ', - '𝞾' => 'υ', - '𝞿' => 'φ', - '𝟀' => 'χ', - '𝟁' => 'ψ', - '𝟂' => 'ω', - '𝟃' => '∂', - '𝟄' => 'ϵ', - '𝟅' => 'ϑ', - '𝟆' => 'ϰ', - '𝟇' => 'ϕ', - '𝟈' => 'ϱ', - '𝟉' => 'ϖ', - '𝟊' => 'Ϝ', - '𝟋' => 'ϝ', - '𝟎' => '0', - '𝟏' => '1', - '𝟐' => '2', - '𝟑' => '3', - '𝟒' => '4', - '𝟓' => '5', - '𝟔' => '6', - '𝟕' => '7', - '𝟖' => '8', - '𝟗' => '9', - '𝟘' => '0', - '𝟙' => '1', - '𝟚' => '2', - '𝟛' => '3', - '𝟜' => '4', - '𝟝' => '5', - '𝟞' => '6', - '𝟟' => '7', - '𝟠' => '8', - '𝟡' => '9', - '𝟢' => '0', - '𝟣' => '1', - '𝟤' => '2', - '𝟥' => '3', - '𝟦' => '4', - '𝟧' => '5', - '𝟨' => '6', - '𝟩' => '7', - '𝟪' => '8', - '𝟫' => '9', - '𝟬' => '0', - '𝟭' => '1', - '𝟮' => '2', - '𝟯' => '3', - '𝟰' => '4', - '𝟱' => '5', - '𝟲' => '6', - '𝟳' => '7', - '𝟴' => '8', - '𝟵' => '9', - '𝟶' => '0', - '𝟷' => '1', - '𝟸' => '2', - '𝟹' => '3', - '𝟺' => '4', - '𝟻' => '5', - '𝟼' => '6', - '𝟽' => '7', - '𝟾' => '8', - '𝟿' => '9', - '𞸀' => 'ا', - '𞸁' => 'ب', - '𞸂' => 'ج', - '𞸃' => 'د', - '𞸅' => 'و', - '𞸆' => 'ز', - '𞸇' => 'ح', - '𞸈' => 'ط', - '𞸉' => 'ي', - '𞸊' => 'ك', - '𞸋' => 'ل', - '𞸌' => 'م', - '𞸍' => 'ن', - '𞸎' => 'س', - '𞸏' => 'ع', - '𞸐' => 'ف', - '𞸑' => 'ص', - '𞸒' => 'ق', - '𞸓' => 'ر', - '𞸔' => 'ش', - '𞸕' => 'ت', - '𞸖' => 'ث', - '𞸗' => 'خ', - '𞸘' => 'ذ', - '𞸙' => 'ض', - '𞸚' => 'ظ', - '𞸛' => 'غ', - '𞸜' => 'ٮ', - '𞸝' => 'ں', - '𞸞' => 'ڡ', - '𞸟' => 'ٯ', - '𞸡' => 'ب', - '𞸢' => 'ج', - '𞸤' => 'ه', - '𞸧' => 'ح', - '𞸩' => 'ي', - '𞸪' => 'ك', - '𞸫' => 'ل', - '𞸬' => 'م', - '𞸭' => 'ن', - '𞸮' => 'س', - '𞸯' => 'ع', - '𞸰' => 'ف', - '𞸱' => 'ص', - '𞸲' => 'ق', - '𞸴' => 'ش', - '𞸵' => 'ت', - '𞸶' => 'ث', - '𞸷' => 'خ', - '𞸹' => 'ض', - '𞸻' => 'غ', - '𞹂' => 'ج', - '𞹇' => 'ح', - '𞹉' => 'ي', - '𞹋' => 'ل', - '𞹍' => 'ن', - '𞹎' => 'س', - '𞹏' => 'ع', - '𞹑' => 'ص', - '𞹒' => 'ق', - '𞹔' => 'ش', - '𞹗' => 'خ', - '𞹙' => 'ض', - '𞹛' => 'غ', - '𞹝' => 'ں', - '𞹟' => 'ٯ', - '𞹡' => 'ب', - '𞹢' => 'ج', - '𞹤' => 'ه', - '𞹧' => 'ح', - '𞹨' => 'ط', - '𞹩' => 'ي', - '𞹪' => 'ك', - '𞹬' => 'م', - '𞹭' => 'ن', - '𞹮' => 'س', - '𞹯' => 'ع', - '𞹰' => 'ف', - '𞹱' => 'ص', - '𞹲' => 'ق', - '𞹴' => 'ش', - '𞹵' => 'ت', - '𞹶' => 'ث', - '𞹷' => 'خ', - '𞹹' => 'ض', - '𞹺' => 'ظ', - '𞹻' => 'غ', - '𞹼' => 'ٮ', - '𞹾' => 'ڡ', - '𞺀' => 'ا', - '𞺁' => 'ب', - '𞺂' => 'ج', - '𞺃' => 'د', - '𞺄' => 'ه', - '𞺅' => 'و', - '𞺆' => 'ز', - '𞺇' => 'ح', - '𞺈' => 'ط', - '𞺉' => 'ي', - '𞺋' => 'ل', - '𞺌' => 'م', - '𞺍' => 'ن', - '𞺎' => 'س', - '𞺏' => 'ع', - '𞺐' => 'ف', - '𞺑' => 'ص', - '𞺒' => 'ق', - '𞺓' => 'ر', - '𞺔' => 'ش', - '𞺕' => 'ت', - '𞺖' => 'ث', - '𞺗' => 'خ', - '𞺘' => 'ذ', - '𞺙' => 'ض', - '𞺚' => 'ظ', - '𞺛' => 'غ', - '𞺡' => 'ب', - '𞺢' => 'ج', - '𞺣' => 'د', - '𞺥' => 'و', - '𞺦' => 'ز', - '𞺧' => 'ح', - '𞺨' => 'ط', - '𞺩' => 'ي', - '𞺫' => 'ل', - '𞺬' => 'م', - '𞺭' => 'ن', - '𞺮' => 'س', - '𞺯' => 'ع', - '𞺰' => 'ف', - '𞺱' => 'ص', - '𞺲' => 'ق', - '𞺳' => 'ر', - '𞺴' => 'ش', - '𞺵' => 'ت', - '𞺶' => 'ث', - '𞺷' => 'خ', - '𞺸' => 'ذ', - '𞺹' => 'ض', - '𞺺' => 'ظ', - '𞺻' => 'غ', - '🄀' => '0.', - '🄁' => '0,', - '🄂' => '1,', - '🄃' => '2,', - '🄄' => '3,', - '🄅' => '4,', - '🄆' => '5,', - '🄇' => '6,', - '🄈' => '7,', - '🄉' => '8,', - '🄊' => '9,', - '🄐' => '(A)', - '🄑' => '(B)', - '🄒' => '(C)', - '🄓' => '(D)', - '🄔' => '(E)', - '🄕' => '(F)', - '🄖' => '(G)', - '🄗' => '(H)', - '🄘' => '(I)', - '🄙' => '(J)', - '🄚' => '(K)', - '🄛' => '(L)', - '🄜' => '(M)', - '🄝' => '(N)', - '🄞' => '(O)', - '🄟' => '(P)', - '🄠' => '(Q)', - '🄡' => '(R)', - '🄢' => '(S)', - '🄣' => '(T)', - '🄤' => '(U)', - '🄥' => '(V)', - '🄦' => '(W)', - '🄧' => '(X)', - '🄨' => '(Y)', - '🄩' => '(Z)', - '🄪' => '〔S〕', - '🄫' => '(C)', - '🄬' => '(R)', - '🄭' => '(CD)', - '🄮' => '(WZ)', - '🄰' => 'A', - '🄱' => 'B', - '🄲' => 'C', - '🄳' => 'D', - '🄴' => 'E', - '🄵' => 'F', - '🄶' => 'G', - '🄷' => 'H', - '🄸' => 'I', - '🄹' => 'J', - '🄺' => 'K', - '🄻' => 'L', - '🄼' => 'M', - '🄽' => 'N', - '🄾' => 'O', - '🄿' => 'P', - '🅀' => 'Q', - '🅁' => 'R', - '🅂' => 'S', - '🅃' => 'T', - '🅄' => 'U', - '🅅' => 'V', - '🅆' => 'W', - '🅇' => 'X', - '🅈' => 'Y', - '🅉' => 'Z', - '🅊' => 'HV', - '🅋' => 'MV', - '🅌' => 'SD', - '🅍' => 'SS', - '🅎' => 'PPV', - '🅏' => 'WC', - '🆐' => 'DJ', - '🈀' => 'ほか', - '🈁' => 'ココ', - '🈂' => 'サ', - '🈐' => '手', - '🈑' => '字', - '🈒' => '双', - '🈓' => 'デ', - '🈔' => '二', - '🈕' => '多', - '🈖' => '解', - '🈗' => '天', - '🈘' => '交', - '🈙' => '映', - '🈚' => '無', - '🈛' => '料', - '🈜' => '前', - '🈝' => '後', - '🈞' => '再', - '🈟' => '新', - '🈠' => '初', - '🈡' => '終', - '🈢' => '生', - '🈣' => '販', - '🈤' => '声', - '🈥' => '吹', - '🈦' => '演', - '🈧' => '投', - '🈨' => '捕', - '🈩' => '一', - '🈪' => '三', - '🈫' => '遊', - '🈬' => '左', - '🈭' => '中', - '🈮' => '右', - '🈯' => '指', - '🈰' => '走', - '🈱' => '打', - '🈲' => '禁', - '🈳' => '空', - '🈴' => '合', - '🈵' => '満', - '🈶' => '有', - '🈷' => '月', - '🈸' => '申', - '🈹' => '割', - '🈺' => '営', - '🈻' => '配', - '🉀' => '〔本〕', - '🉁' => '〔三〕', - '🉂' => '〔二〕', - '🉃' => '〔安〕', - '🉄' => '〔点〕', - '🉅' => '〔打〕', - '🉆' => '〔盗〕', - '🉇' => '〔勝〕', - '🉈' => '〔敗〕', - '🉐' => '(得)', - '🉑' => '(可)', - '🯰' => '0', - '🯱' => '1', - '🯲' => '2', - '🯳' => '3', - '🯴' => '4', - '🯵' => '5', - '🯶' => '6', - '🯷' => '7', - '🯸' => '8', - '🯹' => '9', - '丽' => '丽', - '丸' => '丸', - '乁' => '乁', - '𠄢' => '𠄢', - '你' => '你', - '侮' => '侮', - '侻' => '侻', - '倂' => '倂', - '偺' => '偺', - '備' => '備', - '僧' => '僧', - '像' => '像', - '㒞' => '㒞', - '𠘺' => '𠘺', - '免' => '免', - '兔' => '兔', - '兤' => '兤', - '具' => '具', - '𠔜' => '𠔜', - '㒹' => '㒹', - '內' => '內', - '再' => '再', - '𠕋' => '𠕋', - '冗' => '冗', - '冤' => '冤', - '仌' => '仌', - '冬' => '冬', - '况' => '况', - '𩇟' => '𩇟', - '凵' => '凵', - '刃' => '刃', - '㓟' => '㓟', - '刻' => '刻', - '剆' => '剆', - '割' => '割', - '剷' => '剷', - '㔕' => '㔕', - '勇' => '勇', - '勉' => '勉', - '勤' => '勤', - '勺' => '勺', - '包' => '包', - '匆' => '匆', - '北' => '北', - '卉' => '卉', - '卑' => '卑', - '博' => '博', - '即' => '即', - '卽' => '卽', - '卿' => '卿', - '卿' => '卿', - '卿' => '卿', - '𠨬' => '𠨬', - '灰' => '灰', - '及' => '及', - '叟' => '叟', - '𠭣' => '𠭣', - '叫' => '叫', - '叱' => '叱', - '吆' => '吆', - '咞' => '咞', - '吸' => '吸', - '呈' => '呈', - '周' => '周', - '咢' => '咢', - '哶' => '哶', - '唐' => '唐', - '啓' => '啓', - '啣' => '啣', - '善' => '善', - '善' => '善', - '喙' => '喙', - '喫' => '喫', - '喳' => '喳', - '嗂' => '嗂', - '圖' => '圖', - '嘆' => '嘆', - '圗' => '圗', - '噑' => '噑', - '噴' => '噴', - '切' => '切', - '壮' => '壮', - '城' => '城', - '埴' => '埴', - '堍' => '堍', - '型' => '型', - '堲' => '堲', - '報' => '報', - '墬' => '墬', - '𡓤' => '𡓤', - '売' => '売', - '壷' => '壷', - '夆' => '夆', - '多' => '多', - '夢' => '夢', - '奢' => '奢', - '𡚨' => '𡚨', - '𡛪' => '𡛪', - '姬' => '姬', - '娛' => '娛', - '娧' => '娧', - '姘' => '姘', - '婦' => '婦', - '㛮' => '㛮', - '㛼' => '㛼', - '嬈' => '嬈', - '嬾' => '嬾', - '嬾' => '嬾', - '𡧈' => '𡧈', - '寃' => '寃', - '寘' => '寘', - '寧' => '寧', - '寳' => '寳', - '𡬘' => '𡬘', - '寿' => '寿', - '将' => '将', - '当' => '当', - '尢' => '尢', - '㞁' => '㞁', - '屠' => '屠', - '屮' => '屮', - '峀' => '峀', - '岍' => '岍', - '𡷤' => '𡷤', - '嵃' => '嵃', - '𡷦' => '𡷦', - '嵮' => '嵮', - '嵫' => '嵫', - '嵼' => '嵼', - '巡' => '巡', - '巢' => '巢', - '㠯' => '㠯', - '巽' => '巽', - '帨' => '帨', - '帽' => '帽', - '幩' => '幩', - '㡢' => '㡢', - '𢆃' => '𢆃', - '㡼' => '㡼', - '庰' => '庰', - '庳' => '庳', - '庶' => '庶', - '廊' => '廊', - '𪎒' => '𪎒', - '廾' => '廾', - '𢌱' => '𢌱', - '𢌱' => '𢌱', - '舁' => '舁', - '弢' => '弢', - '弢' => '弢', - '㣇' => '㣇', - '𣊸' => '𣊸', - '𦇚' => '𦇚', - '形' => '形', - '彫' => '彫', - '㣣' => '㣣', - '徚' => '徚', - '忍' => '忍', - '志' => '志', - '忹' => '忹', - '悁' => '悁', - '㤺' => '㤺', - '㤜' => '㤜', - '悔' => '悔', - '𢛔' => '𢛔', - '惇' => '惇', - '慈' => '慈', - '慌' => '慌', - '慎' => '慎', - '慌' => '慌', - '慺' => '慺', - '憎' => '憎', - '憲' => '憲', - '憤' => '憤', - '憯' => '憯', - '懞' => '懞', - '懲' => '懲', - '懶' => '懶', - '成' => '成', - '戛' => '戛', - '扝' => '扝', - '抱' => '抱', - '拔' => '拔', - '捐' => '捐', - '𢬌' => '𢬌', - '挽' => '挽', - '拼' => '拼', - '捨' => '捨', - '掃' => '掃', - '揤' => '揤', - '𢯱' => '𢯱', - '搢' => '搢', - '揅' => '揅', - '掩' => '掩', - '㨮' => '㨮', - '摩' => '摩', - '摾' => '摾', - '撝' => '撝', - '摷' => '摷', - '㩬' => '㩬', - '敏' => '敏', - '敬' => '敬', - '𣀊' => '𣀊', - '旣' => '旣', - '書' => '書', - '晉' => '晉', - '㬙' => '㬙', - '暑' => '暑', - '㬈' => '㬈', - '㫤' => '㫤', - '冒' => '冒', - '冕' => '冕', - '最' => '最', - '暜' => '暜', - '肭' => '肭', - '䏙' => '䏙', - '朗' => '朗', - '望' => '望', - '朡' => '朡', - '杞' => '杞', - '杓' => '杓', - '𣏃' => '𣏃', - '㭉' => '㭉', - '柺' => '柺', - '枅' => '枅', - '桒' => '桒', - '梅' => '梅', - '𣑭' => '𣑭', - '梎' => '梎', - '栟' => '栟', - '椔' => '椔', - '㮝' => '㮝', - '楂' => '楂', - '榣' => '榣', - '槪' => '槪', - '檨' => '檨', - '𣚣' => '𣚣', - '櫛' => '櫛', - '㰘' => '㰘', - '次' => '次', - '𣢧' => '𣢧', - '歔' => '歔', - '㱎' => '㱎', - '歲' => '歲', - '殟' => '殟', - '殺' => '殺', - '殻' => '殻', - '𣪍' => '𣪍', - '𡴋' => '𡴋', - '𣫺' => '𣫺', - '汎' => '汎', - '𣲼' => '𣲼', - '沿' => '沿', - '泍' => '泍', - '汧' => '汧', - '洖' => '洖', - '派' => '派', - '海' => '海', - '流' => '流', - '浩' => '浩', - '浸' => '浸', - '涅' => '涅', - '𣴞' => '𣴞', - '洴' => '洴', - '港' => '港', - '湮' => '湮', - '㴳' => '㴳', - '滋' => '滋', - '滇' => '滇', - '𣻑' => '𣻑', - '淹' => '淹', - '潮' => '潮', - '𣽞' => '𣽞', - '𣾎' => '𣾎', - '濆' => '濆', - '瀹' => '瀹', - '瀞' => '瀞', - '瀛' => '瀛', - '㶖' => '㶖', - '灊' => '灊', - '災' => '災', - '灷' => '灷', - '炭' => '炭', - '𠔥' => '𠔥', - '煅' => '煅', - '𤉣' => '𤉣', - '熜' => '熜', - '𤎫' => '𤎫', - '爨' => '爨', - '爵' => '爵', - '牐' => '牐', - '𤘈' => '𤘈', - '犀' => '犀', - '犕' => '犕', - '𤜵' => '𤜵', - '𤠔' => '𤠔', - '獺' => '獺', - '王' => '王', - '㺬' => '㺬', - '玥' => '玥', - '㺸' => '㺸', - '㺸' => '㺸', - '瑇' => '瑇', - '瑜' => '瑜', - '瑱' => '瑱', - '璅' => '璅', - '瓊' => '瓊', - '㼛' => '㼛', - '甤' => '甤', - '𤰶' => '𤰶', - '甾' => '甾', - '𤲒' => '𤲒', - '異' => '異', - '𢆟' => '𢆟', - '瘐' => '瘐', - '𤾡' => '𤾡', - '𤾸' => '𤾸', - '𥁄' => '𥁄', - '㿼' => '㿼', - '䀈' => '䀈', - '直' => '直', - '𥃳' => '𥃳', - '𥃲' => '𥃲', - '𥄙' => '𥄙', - '𥄳' => '𥄳', - '眞' => '眞', - '真' => '真', - '真' => '真', - '睊' => '睊', - '䀹' => '䀹', - '瞋' => '瞋', - '䁆' => '䁆', - '䂖' => '䂖', - '𥐝' => '𥐝', - '硎' => '硎', - '碌' => '碌', - '磌' => '磌', - '䃣' => '䃣', - '𥘦' => '𥘦', - '祖' => '祖', - '𥚚' => '𥚚', - '𥛅' => '𥛅', - '福' => '福', - '秫' => '秫', - '䄯' => '䄯', - '穀' => '穀', - '穊' => '穊', - '穏' => '穏', - '𥥼' => '𥥼', - '𥪧' => '𥪧', - '𥪧' => '𥪧', - '竮' => '竮', - '䈂' => '䈂', - '𥮫' => '𥮫', - '篆' => '篆', - '築' => '築', - '䈧' => '䈧', - '𥲀' => '𥲀', - '糒' => '糒', - '䊠' => '䊠', - '糨' => '糨', - '糣' => '糣', - '紀' => '紀', - '𥾆' => '𥾆', - '絣' => '絣', - '䌁' => '䌁', - '緇' => '緇', - '縂' => '縂', - '繅' => '繅', - '䌴' => '䌴', - '𦈨' => '𦈨', - '𦉇' => '𦉇', - '䍙' => '䍙', - '𦋙' => '𦋙', - '罺' => '罺', - '𦌾' => '𦌾', - '羕' => '羕', - '翺' => '翺', - '者' => '者', - '𦓚' => '𦓚', - '𦔣' => '𦔣', - '聠' => '聠', - '𦖨' => '𦖨', - '聰' => '聰', - '𣍟' => '𣍟', - '䏕' => '䏕', - '育' => '育', - '脃' => '脃', - '䐋' => '䐋', - '脾' => '脾', - '媵' => '媵', - '𦞧' => '𦞧', - '𦞵' => '𦞵', - '𣎓' => '𣎓', - '𣎜' => '𣎜', - '舁' => '舁', - '舄' => '舄', - '辞' => '辞', - '䑫' => '䑫', - '芑' => '芑', - '芋' => '芋', - '芝' => '芝', - '劳' => '劳', - '花' => '花', - '芳' => '芳', - '芽' => '芽', - '苦' => '苦', - '𦬼' => '𦬼', - '若' => '若', - '茝' => '茝', - '荣' => '荣', - '莭' => '莭', - '茣' => '茣', - '莽' => '莽', - '菧' => '菧', - '著' => '著', - '荓' => '荓', - '菊' => '菊', - '菌' => '菌', - '菜' => '菜', - '𦰶' => '𦰶', - '𦵫' => '𦵫', - '𦳕' => '𦳕', - '䔫' => '䔫', - '蓱' => '蓱', - '蓳' => '蓳', - '蔖' => '蔖', - '𧏊' => '𧏊', - '蕤' => '蕤', - '𦼬' => '𦼬', - '䕝' => '䕝', - '䕡' => '䕡', - '𦾱' => '𦾱', - '𧃒' => '𧃒', - '䕫' => '䕫', - '虐' => '虐', - '虜' => '虜', - '虧' => '虧', - '虩' => '虩', - '蚩' => '蚩', - '蚈' => '蚈', - '蜎' => '蜎', - '蛢' => '蛢', - '蝹' => '蝹', - '蜨' => '蜨', - '蝫' => '蝫', - '螆' => '螆', - '䗗' => '䗗', - '蟡' => '蟡', - '蠁' => '蠁', - '䗹' => '䗹', - '衠' => '衠', - '衣' => '衣', - '𧙧' => '𧙧', - '裗' => '裗', - '裞' => '裞', - '䘵' => '䘵', - '裺' => '裺', - '㒻' => '㒻', - '𧢮' => '𧢮', - '𧥦' => '𧥦', - '䚾' => '䚾', - '䛇' => '䛇', - '誠' => '誠', - '諭' => '諭', - '變' => '變', - '豕' => '豕', - '𧲨' => '𧲨', - '貫' => '貫', - '賁' => '賁', - '贛' => '贛', - '起' => '起', - '𧼯' => '𧼯', - '𠠄' => '𠠄', - '跋' => '跋', - '趼' => '趼', - '跰' => '跰', - '𠣞' => '𠣞', - '軔' => '軔', - '輸' => '輸', - '𨗒' => '𨗒', - '𨗭' => '𨗭', - '邔' => '邔', - '郱' => '郱', - '鄑' => '鄑', - '𨜮' => '𨜮', - '鄛' => '鄛', - '鈸' => '鈸', - '鋗' => '鋗', - '鋘' => '鋘', - '鉼' => '鉼', - '鏹' => '鏹', - '鐕' => '鐕', - '𨯺' => '𨯺', - '開' => '開', - '䦕' => '䦕', - '閷' => '閷', - '𨵷' => '𨵷', - '䧦' => '䧦', - '雃' => '雃', - '嶲' => '嶲', - '霣' => '霣', - '𩅅' => '𩅅', - '𩈚' => '𩈚', - '䩮' => '䩮', - '䩶' => '䩶', - '韠' => '韠', - '𩐊' => '𩐊', - '䪲' => '䪲', - '𩒖' => '𩒖', - '頋' => '頋', - '頋' => '頋', - '頩' => '頩', - '𩖶' => '𩖶', - '飢' => '飢', - '䬳' => '䬳', - '餩' => '餩', - '馧' => '馧', - '駂' => '駂', - '駾' => '駾', - '䯎' => '䯎', - '𩬰' => '𩬰', - '鬒' => '鬒', - '鱀' => '鱀', - '鳽' => '鳽', - '䳎' => '䳎', - '䳭' => '䳭', - '鵧' => '鵧', - '𪃎' => '𪃎', - '䳸' => '䳸', - '𪄅' => '𪄅', - '𪈎' => '𪈎', - '𪊑' => '𪊑', - '麻' => '麻', - '䵖' => '䵖', - '黹' => '黹', - '黾' => '黾', - '鼅' => '鼅', - '鼏' => '鼏', - '鼖' => '鼖', - '鼻' => '鼻', - '𪘀' => '𪘀', - 'Æ' => 'AE', - 'Ð' => 'D', - 'Ø' => 'O', - 'Þ' => 'TH', - 'ß' => 'ss', - 'æ' => 'ae', - 'ð' => 'd', - 'ø' => 'o', - 'þ' => 'th', - 'Đ' => 'D', - 'đ' => 'd', - 'Ħ' => 'H', - 'ħ' => 'h', - 'ı' => 'i', - 'ĸ' => 'q', - 'Ł' => 'L', - 'ł' => 'l', - 'Ŋ' => 'N', - 'ŋ' => 'n', - 'Œ' => 'OE', - 'œ' => 'oe', - 'Ŧ' => 'T', - 'ŧ' => 't', - 'ƀ' => 'b', - 'Ɓ' => 'B', - 'Ƃ' => 'B', - 'ƃ' => 'b', - 'Ƈ' => 'C', - 'ƈ' => 'c', - 'Ɖ' => 'D', - 'Ɗ' => 'D', - 'Ƌ' => 'D', - 'ƌ' => 'd', - 'Ɛ' => 'E', - 'Ƒ' => 'F', - 'ƒ' => 'f', - 'Ɠ' => 'G', - 'ƕ' => 'hv', - 'Ɩ' => 'I', - 'Ɨ' => 'I', - 'Ƙ' => 'K', - 'ƙ' => 'k', - 'ƚ' => 'l', - 'Ɲ' => 'N', - 'ƞ' => 'n', - 'Ƣ' => 'OI', - 'ƣ' => 'oi', - 'Ƥ' => 'P', - 'ƥ' => 'p', - 'ƫ' => 't', - 'Ƭ' => 'T', - 'ƭ' => 't', - 'Ʈ' => 'T', - 'Ʋ' => 'V', - 'Ƴ' => 'Y', - 'ƴ' => 'y', - 'Ƶ' => 'Z', - 'ƶ' => 'z', - 'Ǥ' => 'G', - 'ǥ' => 'g', - 'ȡ' => 'd', - 'Ȥ' => 'Z', - 'ȥ' => 'z', - 'ȴ' => 'l', - 'ȵ' => 'n', - 'ȶ' => 't', - 'ȷ' => 'j', - 'ȸ' => 'db', - 'ȹ' => 'qp', - 'Ⱥ' => 'A', - 'Ȼ' => 'C', - 'ȼ' => 'c', - 'Ƚ' => 'L', - 'Ⱦ' => 'T', - 'ȿ' => 's', - 'ɀ' => 'z', - 'Ƀ' => 'B', - 'Ʉ' => 'U', - 'Ɇ' => 'E', - 'ɇ' => 'e', - 'Ɉ' => 'J', - 'ɉ' => 'j', - 'Ɍ' => 'R', - 'ɍ' => 'r', - 'Ɏ' => 'Y', - 'ɏ' => 'y', - 'ɓ' => 'b', - 'ɕ' => 'c', - 'ɖ' => 'd', - 'ɗ' => 'd', - 'ɛ' => 'e', - 'ɟ' => 'j', - 'ɠ' => 'g', - 'ɡ' => 'g', - 'ɢ' => 'G', - 'ɦ' => 'h', - 'ɧ' => 'h', - 'ɨ' => 'i', - 'ɪ' => 'I', - 'ɫ' => 'l', - 'ɬ' => 'l', - 'ɭ' => 'l', - 'ɱ' => 'm', - 'ɲ' => 'n', - 'ɳ' => 'n', - 'ɴ' => 'N', - 'ɶ' => 'OE', - 'ɼ' => 'r', - 'ɽ' => 'r', - 'ɾ' => 'r', - 'ʀ' => 'R', - 'ʂ' => 's', - 'ʈ' => 't', - 'ʉ' => 'u', - 'ʋ' => 'v', - 'ʏ' => 'Y', - 'ʐ' => 'z', - 'ʑ' => 'z', - 'ʙ' => 'B', - 'ʛ' => 'G', - 'ʜ' => 'H', - 'ʝ' => 'j', - 'ʟ' => 'L', - 'ʠ' => 'q', - 'ʣ' => 'dz', - 'ʥ' => 'dz', - 'ʦ' => 'ts', - 'ʪ' => 'ls', - 'ʫ' => 'lz', - 'ᴀ' => 'A', - 'ᴁ' => 'AE', - 'ᴃ' => 'B', - 'ᴄ' => 'C', - 'ᴅ' => 'D', - 'ᴆ' => 'D', - 'ᴇ' => 'E', - 'ᴊ' => 'J', - 'ᴋ' => 'K', - 'ᴌ' => 'L', - 'ᴍ' => 'M', - 'ᴏ' => 'O', - 'ᴘ' => 'P', - 'ᴛ' => 'T', - 'ᴜ' => 'U', - 'ᴠ' => 'V', - 'ᴡ' => 'W', - 'ᴢ' => 'Z', - 'ᵫ' => 'ue', - 'ᵬ' => 'b', - 'ᵭ' => 'd', - 'ᵮ' => 'f', - 'ᵯ' => 'm', - 'ᵰ' => 'n', - 'ᵱ' => 'p', - 'ᵲ' => 'r', - 'ᵳ' => 'r', - 'ᵴ' => 's', - 'ᵵ' => 't', - 'ᵶ' => 'z', - 'ᵺ' => 'th', - 'ᵻ' => 'I', - 'ᵽ' => 'p', - 'ᵾ' => 'U', - 'ᶀ' => 'b', - 'ᶁ' => 'd', - 'ᶂ' => 'f', - 'ᶃ' => 'g', - 'ᶄ' => 'k', - 'ᶅ' => 'l', - 'ᶆ' => 'm', - 'ᶇ' => 'n', - 'ᶈ' => 'p', - 'ᶉ' => 'r', - 'ᶊ' => 's', - 'ᶌ' => 'v', - 'ᶍ' => 'x', - 'ᶎ' => 'z', - 'ᶏ' => 'a', - 'ᶑ' => 'd', - 'ᶒ' => 'e', - 'ᶓ' => 'e', - 'ᶖ' => 'i', - 'ᶙ' => 'u', - 'ẜ' => 's', - 'ẝ' => 's', - 'ẞ' => 'SS', - 'Ỻ' => 'LL', - 'ỻ' => 'll', - 'Ỽ' => 'V', - 'ỽ' => 'v', - 'Ỿ' => 'Y', - 'ỿ' => 'y', - 'Ⱡ' => 'L', - 'ⱡ' => 'l', - 'Ɫ' => 'L', - 'Ᵽ' => 'P', - 'Ɽ' => 'R', - 'ⱥ' => 'a', - 'ⱦ' => 't', - 'Ⱨ' => 'H', - 'ⱨ' => 'h', - 'Ⱪ' => 'K', - 'ⱪ' => 'k', - 'Ⱬ' => 'Z', - 'ⱬ' => 'z', - 'Ɱ' => 'M', - 'ⱱ' => 'v', - 'Ⱳ' => 'W', - 'ⱳ' => 'w', - 'ⱴ' => 'v', - 'ⱸ' => 'e', - 'ⱺ' => 'o', - 'Ȿ' => 'S', - 'Ɀ' => 'Z', - 'ꜰ' => 'F', - 'ꜱ' => 'S', - 'Ꜳ' => 'AA', - 'ꜳ' => 'aa', - 'Ꜵ' => 'AO', - 'ꜵ' => 'ao', - 'Ꜷ' => 'AU', - 'ꜷ' => 'au', - 'Ꜹ' => 'AV', - 'ꜹ' => 'av', - 'Ꜻ' => 'AV', - 'ꜻ' => 'av', - 'Ꜽ' => 'AY', - 'ꜽ' => 'ay', - 'Ꝁ' => 'K', - 'ꝁ' => 'k', - 'Ꝃ' => 'K', - 'ꝃ' => 'k', - 'Ꝅ' => 'K', - 'ꝅ' => 'k', - 'Ꝇ' => 'L', - 'ꝇ' => 'l', - 'Ꝉ' => 'L', - 'ꝉ' => 'l', - 'Ꝋ' => 'O', - 'ꝋ' => 'o', - 'Ꝍ' => 'O', - 'ꝍ' => 'o', - 'Ꝏ' => 'OO', - 'ꝏ' => 'oo', - 'Ꝑ' => 'P', - 'ꝑ' => 'p', - 'Ꝓ' => 'P', - 'ꝓ' => 'p', - 'Ꝕ' => 'P', - 'ꝕ' => 'p', - 'Ꝗ' => 'Q', - 'ꝗ' => 'q', - 'Ꝙ' => 'Q', - 'ꝙ' => 'q', - 'Ꝟ' => 'V', - 'ꝟ' => 'v', - 'Ꝡ' => 'VY', - 'ꝡ' => 'vy', - 'Ꝥ' => 'TH', - 'ꝥ' => 'th', - 'Ꝧ' => 'TH', - 'ꝧ' => 'th', - 'ꝱ' => 'd', - 'ꝲ' => 'l', - 'ꝳ' => 'm', - 'ꝴ' => 'n', - 'ꝵ' => 'r', - 'ꝶ' => 'R', - 'ꝷ' => 't', - 'Ꝺ' => 'D', - 'ꝺ' => 'd', - 'Ꝼ' => 'F', - 'ꝼ' => 'f', - 'Ꞇ' => 'T', - 'ꞇ' => 't', - 'Ꞑ' => 'N', - 'ꞑ' => 'n', - 'Ꞓ' => 'C', - 'ꞓ' => 'c', - 'Ꞡ' => 'G', - 'ꞡ' => 'g', - 'Ꞣ' => 'K', - 'ꞣ' => 'k', - 'Ꞥ' => 'N', - 'ꞥ' => 'n', - 'Ꞧ' => 'R', - 'ꞧ' => 'r', - 'Ꞩ' => 'S', - 'ꞩ' => 's', - 'Ɦ' => 'H', - '©' => '(C)', - '®' => '(R)', - '₠' => 'CE', - '₢' => 'Cr', - '₣' => 'Fr.', - '₤' => 'L.', - '₧' => 'Pts', - '₹' => 'Rs', - '₺' => 'TL', - '℗' => '(P)', - '℘' => 'P', - '℞' => 'Rx', - '〇' => '0', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - 'ʹ' => '\'', - 'ʺ' => '"', - 'ʻ' => '\'', - 'ʼ' => '\'', - 'ʽ' => '\'', - 'ˈ' => '\'', - 'ˋ' => '`', - '‘' => '\'', - '’' => '\'', - '‚' => ',', - '‛' => '\'', - '“' => '"', - '”' => '"', - '„' => ',,', - '‟' => '"', - '′' => '\'', - '〝' => '"', - '〞' => '"', - '«' => '<<', - '»' => '>>', - '‹' => '<', - '›' => '>', - '­' => '-', - '‐' => '-', - '‑' => '-', - '‒' => '-', - '–' => '-', - '—' => '-', - '―' => '-', - '︱' => '-', - '︲' => '-', - '¡' => '!', - '¿' => '?', - '˂' => '<', - '˃' => '>', - '˄' => '^', - 'ˆ' => '^', - 'ː' => ':', - '˜' => '~', - '‖' => '||', - '⁄' => '/', - '⁅' => '[', - '⁆' => ']', - '⁎' => '*', - '、' => ',', - '。' => '.', - '〈' => '<', - '〉' => '>', - '《' => '<<', - '》' => '>>', - '〔' => '[', - '〕' => ']', - '〘' => '[', - '〙' => ']', - '〚' => '[', - '〛' => ']', - '︐' => ',', - '︑' => ',', - '︒' => '.', - '︓' => ':', - '︔' => ';', - '︕' => '!', - '︖' => '?', - '︙' => '...', - '︰' => '..', - '︵' => '(', - '︶' => ')', - '︷' => '{', - '︸' => '}', - '︹' => '[', - '︺' => ']', - '︽' => '<<', - '︾' => '>>', - '︿' => '<', - '﹀' => '>', - '﹇' => '[', - '﹈' => ']', - '±' => '+/-', - '×' => '*', - '÷' => '/', - '˖' => '+', - '˗' => '-', - '−' => '-', - '∕' => '/', - '∖' => '\\', - '∣' => '|', - '∥' => '||', - '≪' => '<<', - '≫' => '>>', - '⦅' => '((', - '⦆' => '))', -); diff --git a/vendor/symfony/polyfill-iconv/bootstrap.php b/vendor/symfony/polyfill-iconv/bootstrap.php deleted file mode 100644 index c11df3b3..00000000 --- a/vendor/symfony/polyfill-iconv/bootstrap.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. - */ - -use Symfony\Polyfill\Iconv as p; - -if (extension_loaded('iconv')) { - return; -} - -if (\PHP_VERSION_ID >= 80000) { - return require __DIR__.'/bootstrap80.php'; -} - -if (!defined('ICONV_IMPL')) { - define('ICONV_IMPL', 'Symfony'); -} -if (!defined('ICONV_VERSION')) { - define('ICONV_VERSION', '1.0'); -} -if (!defined('ICONV_MIME_DECODE_STRICT')) { - define('ICONV_MIME_DECODE_STRICT', 1); -} -if (!defined('ICONV_MIME_DECODE_CONTINUE_ON_ERROR')) { - define('ICONV_MIME_DECODE_CONTINUE_ON_ERROR', 2); -} - -if (!function_exists('iconv')) { - function iconv($from_encoding, $to_encoding, $string) { return p\Iconv::iconv($from_encoding, $to_encoding, $string); } -} -if (!function_exists('iconv_get_encoding')) { - function iconv_get_encoding($type = 'all') { return p\Iconv::iconv_get_encoding($type); } -} -if (!function_exists('iconv_set_encoding')) { - function iconv_set_encoding($type, $encoding) { return p\Iconv::iconv_set_encoding($type, $encoding); } -} -if (!function_exists('iconv_mime_encode')) { - function iconv_mime_encode($field_name, $field_value, $options = []) { return p\Iconv::iconv_mime_encode($field_name, $field_value, $options); } -} -if (!function_exists('iconv_mime_decode_headers')) { - function iconv_mime_decode_headers($headers, $mode = 0, $encoding = null) { return p\Iconv::iconv_mime_decode_headers($headers, $mode, $encoding); } -} - -if (extension_loaded('mbstring')) { - if (!function_exists('iconv_strlen')) { - function iconv_strlen($string, $encoding = null) { null === $encoding && $encoding = p\Iconv::$internalEncoding; return mb_strlen($string, $encoding); } - } - if (!function_exists('iconv_strpos')) { - function iconv_strpos($haystack, $needle, $offset = 0, $encoding = null) { null === $encoding && $encoding = p\Iconv::$internalEncoding; return mb_strpos($haystack, $needle, $offset, $encoding); } - } - if (!function_exists('iconv_strrpos')) { - function iconv_strrpos($haystack, $needle, $encoding = null) { null === $encoding && $encoding = p\Iconv::$internalEncoding; return mb_strrpos($haystack, $needle, 0, $encoding); } - } - if (!function_exists('iconv_substr')) { - function iconv_substr($string, $offset, $length = 2147483647, $encoding = null) { null === $encoding && $encoding = p\Iconv::$internalEncoding; return mb_substr($string, $offset, $length, $encoding); } - } - if (!function_exists('iconv_mime_decode')) { - function iconv_mime_decode($string, $mode = 0, $encoding = null) { $currentMbEncoding = mb_internal_encoding(); null === $encoding && $encoding = p\Iconv::$internalEncoding; mb_internal_encoding($encoding); $decoded = mb_decode_mimeheader($string); mb_internal_encoding($currentMbEncoding); return $decoded; } - } -} else { - if (!function_exists('iconv_strlen')) { - if (extension_loaded('xml')) { - function iconv_strlen($string, $encoding = null) { return p\Iconv::strlen1($string, $encoding); } - } else { - function iconv_strlen($string, $encoding = null) { return p\Iconv::strlen2($string, $encoding); } - } - } - - if (!function_exists('iconv_strpos')) { - function iconv_strpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Iconv::iconv_strpos($haystack, $needle, $offset, $encoding); } - } - if (!function_exists('iconv_strrpos')) { - function iconv_strrpos($haystack, $needle, $encoding = null) { return p\Iconv::iconv_strrpos($haystack, $needle, $encoding); } - } - if (!function_exists('iconv_substr')) { - function iconv_substr($string, $offset, $length = 2147483647, $encoding = null) { return p\Iconv::iconv_substr($string, $offset, $length, $encoding); } - } - if (!function_exists('iconv_mime_decode')) { - function iconv_mime_decode($string, $mode = 0, $encoding = null) { return p\Iconv::iconv_mime_decode($string, $mode, $encoding); } - } -} diff --git a/vendor/symfony/polyfill-iconv/bootstrap80.php b/vendor/symfony/polyfill-iconv/bootstrap80.php deleted file mode 100644 index 04b1473b..00000000 --- a/vendor/symfony/polyfill-iconv/bootstrap80.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. - */ - -use Symfony\Polyfill\Iconv as p; - -if (!defined('ICONV_IMPL')) { - define('ICONV_IMPL', 'Symfony'); -} -if (!defined('ICONV_VERSION')) { - define('ICONV_VERSION', '1.0'); -} -if (!defined('ICONV_MIME_DECODE_STRICT')) { - define('ICONV_MIME_DECODE_STRICT', 1); -} -if (!defined('ICONV_MIME_DECODE_CONTINUE_ON_ERROR')) { - define('ICONV_MIME_DECODE_CONTINUE_ON_ERROR', 2); -} - -if (!function_exists('iconv')) { - function iconv(?string $from_encoding, ?string $to_encoding, ?string $string): string|false { return p\Iconv::iconv((string) $from_encoding, (string) $to_encoding, (string) $string); } -} -if (!function_exists('iconv_get_encoding')) { - function iconv_get_encoding(?string $type = 'all'): array|string|false { return p\Iconv::iconv_get_encoding((string) $type); } -} -if (!function_exists('iconv_set_encoding')) { - function iconv_set_encoding(?string $type, ?string $encoding): bool { return p\Iconv::iconv_set_encoding((string) $type, (string) $encoding); } -} -if (!function_exists('iconv_mime_encode')) { - function iconv_mime_encode(?string $field_name, ?string $field_value, ?array $options = []): string|false { return p\Iconv::iconv_mime_encode((string) $field_name, (string) $field_value, (array) $options); } -} -if (!function_exists('iconv_mime_decode_headers')) { - function iconv_mime_decode_headers(?string $headers, ?int $mode = 0, ?string $encoding = null): array|false { return p\Iconv::iconv_mime_decode_headers((string) $headers, (int) $mode, $encoding); } -} - -if (extension_loaded('mbstring')) { - if (!function_exists('iconv_strlen')) { - function iconv_strlen(?string $string, ?string $encoding = null): int|false { null === $encoding && $encoding = p\Iconv::$internalEncoding; return mb_strlen((string) $string, $encoding); } - } - if (!function_exists('iconv_strpos')) { - function iconv_strpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { null === $encoding && $encoding = p\Iconv::$internalEncoding; return mb_strpos((string) $haystack, (string) $needle, (int) $offset, $encoding); } - } - if (!function_exists('iconv_strrpos')) { - function iconv_strrpos(?string $haystack, ?string $needle, ?string $encoding = null): int|false { null === $encoding && $encoding = p\Iconv::$internalEncoding; return mb_strrpos((string) $haystack, (string) $needle, 0, $encoding); } - } - if (!function_exists('iconv_substr')) { - function iconv_substr(?string $string, ?int $offset, ?int $length = null, ?string $encoding = null): string|false { null === $encoding && $encoding = p\Iconv::$internalEncoding; return mb_substr((string) $string, (int) $offset, $length, $encoding); } - } - if (!function_exists('iconv_mime_decode')) { - function iconv_mime_decode($string, $mode = 0, $encoding = null) { $currentMbEncoding = mb_internal_encoding(); null === $encoding && $encoding = p\Iconv::$internalEncoding; mb_internal_encoding($encoding); $decoded = mb_decode_mimeheader($string); mb_internal_encoding($currentMbEncoding); return $decoded; } - } -} else { - if (!function_exists('iconv_strlen')) { - if (extension_loaded('xml')) { - function iconv_strlen(?string $string, ?string $encoding = null): int|false { return p\Iconv::strlen1((string) $string, $encoding); } - } else { - function iconv_strlen(?string $string, ?string $encoding = null): int|false { return p\Iconv::strlen2((string) $string, $encoding); } - } - } - - if (!function_exists('iconv_strpos')) { - function iconv_strpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Iconv::iconv_strpos((string) $haystack, (string) $needle, (int) $offset, $encoding); } - } - if (!function_exists('iconv_strrpos')) { - function iconv_strrpos(?string $haystack, ?string $needle, ?string $encoding = null): int|false { return p\Iconv::iconv_strrpos((string) $haystack, (string) $needle, $encoding); } - } - if (!function_exists('iconv_substr')) { - function iconv_substr(?string $string, ?int $offset, ?int $length = null, ?string $encoding = null): string|false { return p\Iconv::iconv_substr((string) $string, (string) $offset, $length, $encoding); } - } - if (!function_exists('iconv_mime_decode')) { - function iconv_mime_decode(?string $string, ?int $mode = 0, ?string $encoding = null): string|false { return p\Iconv::iconv_mime_decode((string) $string, (int) $mode, $encoding); } - } -} diff --git a/vendor/symfony/polyfill-iconv/composer.json b/vendor/symfony/polyfill-iconv/composer.json deleted file mode 100644 index 361f5554..00000000 --- a/vendor/symfony/polyfill-iconv/composer.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "symfony/polyfill-iconv", - "type": "library", - "description": "Symfony polyfill for the Iconv extension", - "keywords": ["polyfill", "shim", "compatibility", "portable", "iconv"], - "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-iconv": "*" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Iconv\\": "" }, - "files": [ "bootstrap.php" ] - }, - "suggest": { - "ext-iconv": "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-intl-grapheme/Grapheme.php b/vendor/symfony/polyfill-intl-grapheme/Grapheme.php deleted file mode 100644 index 5373f168..00000000 --- a/vendor/symfony/polyfill-intl-grapheme/Grapheme.php +++ /dev/null @@ -1,247 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Intl\Grapheme; - -\define('SYMFONY_GRAPHEME_CLUSTER_RX', ((float) \PCRE_VERSION < 10 ? (float) \PCRE_VERSION >= 8.32 : (float) \PCRE_VERSION >= 10.39) ? '\X' : Grapheme::GRAPHEME_CLUSTER_RX); - -/** - * Partial intl implementation in pure PHP. - * - * Implemented: - * - grapheme_extract - Extract a sequence of grapheme clusters from a text buffer, which must be encoded in UTF-8 - * - grapheme_stripos - Find position (in grapheme units) of first occurrence of a case-insensitive string - * - grapheme_stristr - Returns part of haystack string from the first occurrence of case-insensitive needle to the end of haystack - * - grapheme_strlen - Get string length in grapheme units - * - grapheme_strpos - Find position (in grapheme units) of first occurrence of a string - * - grapheme_strripos - Find position (in grapheme units) of last occurrence of a case-insensitive string - * - grapheme_strrpos - Find position (in grapheme units) of last occurrence of a string - * - grapheme_strstr - Returns part of haystack string from the first occurrence of needle to the end of haystack - * - grapheme_substr - Return part of a string - * - * @author Nicolas Grekas - * - * @internal - */ -final class Grapheme -{ - // (CRLF|([ZWNJ-ZWJ]|T+|L*(LV?V+|LV|LVT)T*|L+|[^Control])[Extend]*|[Control]) - // This regular expression is a work around for http://bugs.exim.org/1279 - public const GRAPHEME_CLUSTER_RX = '(?:\r\n|(?:[ -~\x{200C}\x{200D}]|[ᆨ-ᇹ]+|[ᄀ-ᅟ]*(?:[가개갸걔거게겨계고과괘괴교구궈궤귀규그긔기까깨꺄꺠꺼께껴꼐꼬꽈꽤꾀꾜꾸꿔꿰뀌뀨끄끠끼나내냐냬너네녀녜노놔놰뇌뇨누눠눼뉘뉴느늬니다대댜댸더데뎌뎨도돠돼되됴두둬뒈뒤듀드듸디따때땨떄떠떼뗘뗴또똬뙈뙤뚀뚜뚸뛔뛰뜌뜨띄띠라래랴럐러레려례로롸뢔뢰료루뤄뤠뤼류르릐리마매먀먜머메며몌모뫄뫠뫼묘무뭐뭬뮈뮤므믜미바배뱌뱨버베벼볘보봐봬뵈뵤부붜붸뷔뷰브븨비빠빼뺘뺴뻐뻬뼈뼤뽀뽜뽸뾔뾰뿌뿨쀄쀠쀼쁘쁴삐사새샤섀서세셔셰소솨쇄쇠쇼수숴쉐쉬슈스싀시싸쌔쌰썌써쎄쎠쎼쏘쏴쐐쐬쑈쑤쒀쒜쒸쓔쓰씌씨아애야얘어에여예오와왜외요우워웨위유으의이자재쟈쟤저제져졔조좌좨죄죠주줘줴쥐쥬즈즤지짜째쨔쨰쩌쩨쪄쪠쪼쫘쫴쬐쬬쭈쭤쮀쮜쮸쯔쯰찌차채챠챼처체쳐쳬초촤쵀최쵸추춰췌취츄츠츼치카캐캬컈커케켜켸코콰쾌쾨쿄쿠쿼퀘퀴큐크킈키타태탸턔터테텨톄토톼퇘퇴툐투퉈퉤튀튜트틔티파패퍄퍠퍼페펴폐포퐈퐤푀표푸풔풰퓌퓨프픠피하해햐햬허헤혀혜호화홰회효후훠훼휘휴흐희히]?[ᅠ-ᆢ]+|[가-힣])[ᆨ-ᇹ]*|[ᄀ-ᅟ]+|[^\p{Cc}\p{Cf}\p{Zl}\p{Zp}])[\p{Mn}\p{Me}\x{09BE}\x{09D7}\x{0B3E}\x{0B57}\x{0BBE}\x{0BD7}\x{0CC2}\x{0CD5}\x{0CD6}\x{0D3E}\x{0D57}\x{0DCF}\x{0DDF}\x{200C}\x{200D}\x{1D165}\x{1D16E}-\x{1D172}]*|[\p{Cc}\p{Cf}\p{Zl}\p{Zp}])'; - - 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", 'ι'], - ]; - - public static function grapheme_extract($s, $size, $type = \GRAPHEME_EXTR_COUNT, $start = 0, &$next = 0) - { - if (0 > $start) { - $start = \strlen($s) + $start; - } - - if (!\is_scalar($s)) { - $hasError = false; - set_error_handler(function () use (&$hasError) { $hasError = true; }); - $next = substr($s, $start); - restore_error_handler(); - if ($hasError) { - substr($s, $start); - $s = ''; - } else { - $s = $next; - } - } else { - $s = substr($s, $start); - } - $size = (int) $size; - $type = (int) $type; - $start = (int) $start; - - if (\GRAPHEME_EXTR_COUNT !== $type && \GRAPHEME_EXTR_MAXBYTES !== $type && \GRAPHEME_EXTR_MAXCHARS !== $type) { - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError('grapheme_extract(): Argument #3 ($type) must be one of GRAPHEME_EXTR_COUNT, GRAPHEME_EXTR_MAXBYTES, or GRAPHEME_EXTR_MAXCHARS'); - } - - if (!isset($s[0]) || 0 > $size || 0 > $start) { - return false; - } - if (0 === $size) { - return ''; - } - - $next = $start; - - $s = preg_split('/('.SYMFONY_GRAPHEME_CLUSTER_RX.')/u', "\r\n".$s, $size + 1, \PREG_SPLIT_NO_EMPTY | \PREG_SPLIT_DELIM_CAPTURE); - - if (!isset($s[1])) { - return false; - } - - $i = 1; - $ret = ''; - - do { - if (\GRAPHEME_EXTR_COUNT === $type) { - --$size; - } elseif (\GRAPHEME_EXTR_MAXBYTES === $type) { - $size -= \strlen($s[$i]); - } else { - $size -= iconv_strlen($s[$i], 'UTF-8//IGNORE'); - } - - if ($size >= 0) { - $ret .= $s[$i]; - } - } while (isset($s[++$i]) && $size > 0); - - $next += \strlen($ret); - - return $ret; - } - - public static function grapheme_strlen($s) - { - preg_replace('/'.SYMFONY_GRAPHEME_CLUSTER_RX.'/u', '', $s, -1, $len); - - return 0 === $len && '' !== $s ? null : $len; - } - - public static function grapheme_substr($s, $start, $len = null) - { - if (null === $len) { - $len = 2147483647; - } - - preg_match_all('/'.SYMFONY_GRAPHEME_CLUSTER_RX.'/u', $s, $s); - - $slen = \count($s[0]); - $start = (int) $start; - - if (0 > $start) { - $start += $slen; - } - if (0 > $start) { - if (\PHP_VERSION_ID < 80000) { - return false; - } - - $start = 0; - } - if ($start >= $slen) { - return \PHP_VERSION_ID >= 80000 ? '' : false; - } - - $rem = $slen - $start; - - if (0 > $len) { - $len += $rem; - } - if (0 === $len) { - return ''; - } - if (0 > $len) { - return \PHP_VERSION_ID >= 80000 ? '' : false; - } - if ($len > $rem) { - $len = $rem; - } - - return implode('', \array_slice($s[0], $start, $len)); - } - - public static function grapheme_strpos($s, $needle, $offset = 0) - { - return self::grapheme_position($s, $needle, $offset, 0); - } - - public static function grapheme_stripos($s, $needle, $offset = 0) - { - return self::grapheme_position($s, $needle, $offset, 1); - } - - public static function grapheme_strrpos($s, $needle, $offset = 0) - { - return self::grapheme_position($s, $needle, $offset, 2); - } - - public static function grapheme_strripos($s, $needle, $offset = 0) - { - return self::grapheme_position($s, $needle, $offset, 3); - } - - public static function grapheme_stristr($s, $needle, $beforeNeedle = false) - { - return mb_stristr($s, $needle, $beforeNeedle, 'UTF-8'); - } - - public static function grapheme_strstr($s, $needle, $beforeNeedle = false) - { - return mb_strstr($s, $needle, $beforeNeedle, 'UTF-8'); - } - - private static function grapheme_position($s, $needle, $offset, $mode) - { - $needle = (string) $needle; - if (80000 > \PHP_VERSION_ID && !preg_match('/./us', $needle)) { - return false; - } - $s = (string) $s; - if (!preg_match('/./us', $s)) { - return false; - } - if ($offset > 0) { - $s = self::grapheme_substr($s, $offset); - } elseif ($offset < 0) { - if (2 > $mode) { - $offset += self::grapheme_strlen($s); - $s = self::grapheme_substr($s, $offset); - if (0 > $offset) { - $offset = 0; - } - } elseif (0 > $offset += self::grapheme_strlen($needle)) { - $s = self::grapheme_substr($s, 0, $offset); - $offset = 0; - } else { - $offset = 0; - } - } - - // As UTF-8 is self-synchronizing, and we have ensured the strings are valid UTF-8, - // we can use normal binary string functions here. For case-insensitive searches, - // case fold the strings first. - $caseInsensitive = $mode & 1; - $reverse = $mode & 2; - if ($caseInsensitive) { - // Use the same case folding mode as mbstring does for mb_stripos(). - // Stick to SIMPLE case folding to avoid changing the length of the string, which - // might result in offsets being shifted. - $mode = \defined('MB_CASE_FOLD_SIMPLE') ? \MB_CASE_FOLD_SIMPLE : \MB_CASE_LOWER; - $s = mb_convert_case($s, $mode, 'UTF-8'); - $needle = mb_convert_case($needle, $mode, 'UTF-8'); - - if (!\defined('MB_CASE_FOLD_SIMPLE')) { - $s = str_replace(self::CASE_FOLD[0], self::CASE_FOLD[1], $s); - $needle = str_replace(self::CASE_FOLD[0], self::CASE_FOLD[1], $needle); - } - } - if ($reverse) { - $needlePos = strrpos($s, $needle); - } else { - $needlePos = strpos($s, $needle); - } - - return false !== $needlePos ? self::grapheme_strlen(substr($s, 0, $needlePos)) + $offset : false; - } -} diff --git a/vendor/symfony/polyfill-intl-grapheme/LICENSE b/vendor/symfony/polyfill-intl-grapheme/LICENSE deleted file mode 100644 index 4cd8bdd3..00000000 --- a/vendor/symfony/polyfill-intl-grapheme/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-intl-grapheme/README.md b/vendor/symfony/polyfill-intl-grapheme/README.md deleted file mode 100644 index f55d92c5..00000000 --- a/vendor/symfony/polyfill-intl-grapheme/README.md +++ /dev/null @@ -1,31 +0,0 @@ -Symfony Polyfill / Intl: Grapheme -================================= - -This component provides a partial, native PHP implementation of the -[Grapheme functions](https://php.net/intl.grapheme) from the -[Intl](https://php.net/intl) extension. - -- [`grapheme_extract`](https://php.net/grapheme_extract): Extract a sequence of grapheme - clusters from a text buffer, which must be encoded in UTF-8 -- [`grapheme_stripos`](https://php.net/grapheme_stripos): Find position (in grapheme units) - of first occurrence of a case-insensitive string -- [`grapheme_stristr`](https://php.net/grapheme_stristr): Returns part of haystack string - from the first occurrence of case-insensitive needle to the end of haystack -- [`grapheme_strlen`](https://php.net/grapheme_strlen): Get string length in grapheme units -- [`grapheme_strpos`](https://php.net/grapheme_strpos): Find position (in grapheme units) - of first occurrence of a string -- [`grapheme_strripos`](https://php.net/grapheme_strripos): Find position (in grapheme units) - of last occurrence of a case-insensitive string -- [`grapheme_strrpos`](https://php.net/grapheme_strrpos): Find position (in grapheme units) - of last occurrence of a string -- [`grapheme_strstr`](https://php.net/grapheme_strstr): Returns part of haystack string from - the first occurrence of needle to the end of haystack -- [`grapheme_substr`](https://php.net/grapheme_substr): Return part of a string - -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-intl-grapheme/bootstrap.php b/vendor/symfony/polyfill-intl-grapheme/bootstrap.php deleted file mode 100644 index a9ea03c7..00000000 --- a/vendor/symfony/polyfill-intl-grapheme/bootstrap.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Intl\Grapheme as p; - -if (extension_loaded('intl')) { - return; -} - -if (\PHP_VERSION_ID >= 80000) { - return require __DIR__.'/bootstrap80.php'; -} - -if (!defined('GRAPHEME_EXTR_COUNT')) { - define('GRAPHEME_EXTR_COUNT', 0); -} -if (!defined('GRAPHEME_EXTR_MAXBYTES')) { - define('GRAPHEME_EXTR_MAXBYTES', 1); -} -if (!defined('GRAPHEME_EXTR_MAXCHARS')) { - define('GRAPHEME_EXTR_MAXCHARS', 2); -} - -if (!function_exists('grapheme_extract')) { - function grapheme_extract($haystack, $size, $type = 0, $start = 0, &$next = 0) { return p\Grapheme::grapheme_extract($haystack, $size, $type, $start, $next); } -} -if (!function_exists('grapheme_stripos')) { - function grapheme_stripos($haystack, $needle, $offset = 0) { return p\Grapheme::grapheme_stripos($haystack, $needle, $offset); } -} -if (!function_exists('grapheme_stristr')) { - function grapheme_stristr($haystack, $needle, $beforeNeedle = false) { return p\Grapheme::grapheme_stristr($haystack, $needle, $beforeNeedle); } -} -if (!function_exists('grapheme_strlen')) { - function grapheme_strlen($input) { return p\Grapheme::grapheme_strlen($input); } -} -if (!function_exists('grapheme_strpos')) { - function grapheme_strpos($haystack, $needle, $offset = 0) { return p\Grapheme::grapheme_strpos($haystack, $needle, $offset); } -} -if (!function_exists('grapheme_strripos')) { - function grapheme_strripos($haystack, $needle, $offset = 0) { return p\Grapheme::grapheme_strripos($haystack, $needle, $offset); } -} -if (!function_exists('grapheme_strrpos')) { - function grapheme_strrpos($haystack, $needle, $offset = 0) { return p\Grapheme::grapheme_strrpos($haystack, $needle, $offset); } -} -if (!function_exists('grapheme_strstr')) { - function grapheme_strstr($haystack, $needle, $beforeNeedle = false) { return p\Grapheme::grapheme_strstr($haystack, $needle, $beforeNeedle); } -} -if (!function_exists('grapheme_substr')) { - function grapheme_substr($string, $offset, $length = null) { return p\Grapheme::grapheme_substr($string, $offset, $length); } -} diff --git a/vendor/symfony/polyfill-intl-grapheme/bootstrap80.php b/vendor/symfony/polyfill-intl-grapheme/bootstrap80.php deleted file mode 100644 index b8c07867..00000000 --- a/vendor/symfony/polyfill-intl-grapheme/bootstrap80.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Intl\Grapheme as p; - -if (!defined('GRAPHEME_EXTR_COUNT')) { - define('GRAPHEME_EXTR_COUNT', 0); -} -if (!defined('GRAPHEME_EXTR_MAXBYTES')) { - define('GRAPHEME_EXTR_MAXBYTES', 1); -} -if (!defined('GRAPHEME_EXTR_MAXCHARS')) { - define('GRAPHEME_EXTR_MAXCHARS', 2); -} - -if (!function_exists('grapheme_extract')) { - function grapheme_extract(?string $haystack, ?int $size, ?int $type = GRAPHEME_EXTR_COUNT, ?int $offset = 0, &$next = null): string|false { return p\Grapheme::grapheme_extract((string) $haystack, (int) $size, (int) $type, (int) $offset, $next); } -} -if (!function_exists('grapheme_stripos')) { - function grapheme_stripos(?string $haystack, ?string $needle, ?int $offset = 0): int|false { return p\Grapheme::grapheme_stripos((string) $haystack, (string) $needle, (int) $offset); } -} -if (!function_exists('grapheme_stristr')) { - function grapheme_stristr(?string $haystack, ?string $needle, ?bool $beforeNeedle = false): string|false { return p\Grapheme::grapheme_stristr((string) $haystack, (string) $needle, (bool) $beforeNeedle); } -} -if (!function_exists('grapheme_strlen')) { - function grapheme_strlen(?string $string): int|false|null { return p\Grapheme::grapheme_strlen((string) $string); } -} -if (!function_exists('grapheme_strpos')) { - function grapheme_strpos(?string $haystack, ?string $needle, ?int $offset = 0): int|false { return p\Grapheme::grapheme_strpos((string) $haystack, (string) $needle, (int) $offset); } -} -if (!function_exists('grapheme_strripos')) { - function grapheme_strripos(?string $haystack, ?string $needle, ?int $offset = 0): int|false { return p\Grapheme::grapheme_strripos((string) $haystack, (string) $needle, (int) $offset); } -} -if (!function_exists('grapheme_strrpos')) { - function grapheme_strrpos(?string $haystack, ?string $needle, ?int $offset = 0): int|false { return p\Grapheme::grapheme_strrpos((string) $haystack, (string) $needle, (int) $offset); } -} -if (!function_exists('grapheme_strstr')) { - function grapheme_strstr(?string $haystack, ?string $needle, ?bool $beforeNeedle = false): string|false { return p\Grapheme::grapheme_strstr((string) $haystack, (string) $needle, (bool) $beforeNeedle); } -} -if (!function_exists('grapheme_substr')) { - function grapheme_substr(?string $string, ?int $offset, ?int $length = null): string|false { return p\Grapheme::grapheme_substr((string) $string, (int) $offset, $length); } -} diff --git a/vendor/symfony/polyfill-intl-grapheme/composer.json b/vendor/symfony/polyfill-intl-grapheme/composer.json deleted file mode 100644 index fde5537f..00000000 --- a/vendor/symfony/polyfill-intl-grapheme/composer.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "symfony/polyfill-intl-grapheme", - "type": "library", - "description": "Symfony polyfill for intl's grapheme_* functions", - "keywords": ["polyfill", "shim", "compatibility", "portable", "intl", "grapheme"], - "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" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Intl\\Grapheme\\": "" }, - "files": [ "bootstrap.php" ] - }, - "suggest": { - "ext-intl": "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-intl-idn/Idn.php b/vendor/symfony/polyfill-intl-idn/Idn.php deleted file mode 100644 index 86710b94..00000000 --- a/vendor/symfony/polyfill-intl-idn/Idn.php +++ /dev/null @@ -1,925 +0,0 @@ - and Trevor Rowbotham - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Intl\Idn; - -use Exception; -use Normalizer; -use Symfony\Polyfill\Intl\Idn\Resources\unidata\DisallowedRanges; -use Symfony\Polyfill\Intl\Idn\Resources\unidata\Regex; - -/** - * @see https://www.unicode.org/reports/tr46/ - * - * @internal - */ -final class Idn -{ - public const ERROR_EMPTY_LABEL = 1; - public const ERROR_LABEL_TOO_LONG = 2; - public const ERROR_DOMAIN_NAME_TOO_LONG = 4; - public const ERROR_LEADING_HYPHEN = 8; - public const ERROR_TRAILING_HYPHEN = 0x10; - public const ERROR_HYPHEN_3_4 = 0x20; - public const ERROR_LEADING_COMBINING_MARK = 0x40; - public const ERROR_DISALLOWED = 0x80; - public const ERROR_PUNYCODE = 0x100; - public const ERROR_LABEL_HAS_DOT = 0x200; - public const ERROR_INVALID_ACE_LABEL = 0x400; - public const ERROR_BIDI = 0x800; - public const ERROR_CONTEXTJ = 0x1000; - public const ERROR_CONTEXTO_PUNCTUATION = 0x2000; - public const ERROR_CONTEXTO_DIGITS = 0x4000; - - public const INTL_IDNA_VARIANT_2003 = 0; - public const INTL_IDNA_VARIANT_UTS46 = 1; - - public const IDNA_DEFAULT = 0; - public const IDNA_ALLOW_UNASSIGNED = 1; - public const IDNA_USE_STD3_RULES = 2; - public const IDNA_CHECK_BIDI = 4; - public const IDNA_CHECK_CONTEXTJ = 8; - public const IDNA_NONTRANSITIONAL_TO_ASCII = 16; - public const IDNA_NONTRANSITIONAL_TO_UNICODE = 32; - - public const MAX_DOMAIN_SIZE = 253; - public const MAX_LABEL_SIZE = 63; - - public const BASE = 36; - public const TMIN = 1; - public const TMAX = 26; - public const SKEW = 38; - public const DAMP = 700; - public const INITIAL_BIAS = 72; - public const INITIAL_N = 128; - public const DELIMITER = '-'; - public const MAX_INT = 2147483647; - - /** - * Contains the numeric value of a basic code point (for use in representing integers) in the - * range 0 to BASE-1, or -1 if b is does not represent a value. - * - * @var array - */ - private static $basicToDigit = [ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, -1, - - -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, - - -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, - - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - ]; - - /** - * @var array - */ - private static $virama; - - /** - * @var array - */ - private static $mapped; - - /** - * @var array - */ - private static $ignored; - - /** - * @var array - */ - private static $deviation; - - /** - * @var array - */ - private static $disallowed; - - /** - * @var array - */ - private static $disallowed_STD3_mapped; - - /** - * @var array - */ - private static $disallowed_STD3_valid; - - /** - * @var bool - */ - private static $mappingTableLoaded = false; - - /** - * @see https://www.unicode.org/reports/tr46/#ToASCII - * - * @param string $domainName - * @param int $options - * @param int $variant - * @param array $idna_info - * - * @return string|false - */ - public static function idn_to_ascii($domainName, $options = self::IDNA_DEFAULT, $variant = self::INTL_IDNA_VARIANT_UTS46, &$idna_info = []) - { - if (\PHP_VERSION_ID >= 70200 && self::INTL_IDNA_VARIANT_2003 === $variant) { - @trigger_error('idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated', \E_USER_DEPRECATED); - } - - $options = [ - 'CheckHyphens' => true, - 'CheckBidi' => self::INTL_IDNA_VARIANT_2003 === $variant || 0 !== ($options & self::IDNA_CHECK_BIDI), - 'CheckJoiners' => self::INTL_IDNA_VARIANT_UTS46 === $variant && 0 !== ($options & self::IDNA_CHECK_CONTEXTJ), - 'UseSTD3ASCIIRules' => 0 !== ($options & self::IDNA_USE_STD3_RULES), - 'Transitional_Processing' => self::INTL_IDNA_VARIANT_2003 === $variant || 0 === ($options & self::IDNA_NONTRANSITIONAL_TO_ASCII), - 'VerifyDnsLength' => true, - ]; - $info = new Info(); - $labels = self::process((string) $domainName, $options, $info); - - foreach ($labels as $i => $label) { - // Only convert labels to punycode that contain non-ASCII code points - if (1 === preg_match('/[^\x00-\x7F]/', $label)) { - try { - $label = 'xn--'.self::punycodeEncode($label); - } catch (Exception $e) { - $info->errors |= self::ERROR_PUNYCODE; - } - - $labels[$i] = $label; - } - } - - if ($options['VerifyDnsLength']) { - self::validateDomainAndLabelLength($labels, $info); - } - - $idna_info = [ - 'result' => implode('.', $labels), - 'isTransitionalDifferent' => $info->transitionalDifferent, - 'errors' => $info->errors, - ]; - - return 0 === $info->errors ? $idna_info['result'] : false; - } - - /** - * @see https://www.unicode.org/reports/tr46/#ToUnicode - * - * @param string $domainName - * @param int $options - * @param int $variant - * @param array $idna_info - * - * @return string|false - */ - public static function idn_to_utf8($domainName, $options = self::IDNA_DEFAULT, $variant = self::INTL_IDNA_VARIANT_UTS46, &$idna_info = []) - { - if (\PHP_VERSION_ID >= 70200 && self::INTL_IDNA_VARIANT_2003 === $variant) { - @trigger_error('idn_to_utf8(): INTL_IDNA_VARIANT_2003 is deprecated', \E_USER_DEPRECATED); - } - - $info = new Info(); - $labels = self::process((string) $domainName, [ - 'CheckHyphens' => true, - 'CheckBidi' => self::INTL_IDNA_VARIANT_2003 === $variant || 0 !== ($options & self::IDNA_CHECK_BIDI), - 'CheckJoiners' => self::INTL_IDNA_VARIANT_UTS46 === $variant && 0 !== ($options & self::IDNA_CHECK_CONTEXTJ), - 'UseSTD3ASCIIRules' => 0 !== ($options & self::IDNA_USE_STD3_RULES), - 'Transitional_Processing' => self::INTL_IDNA_VARIANT_2003 === $variant || 0 === ($options & self::IDNA_NONTRANSITIONAL_TO_UNICODE), - ], $info); - $idna_info = [ - 'result' => implode('.', $labels), - 'isTransitionalDifferent' => $info->transitionalDifferent, - 'errors' => $info->errors, - ]; - - return 0 === $info->errors ? $idna_info['result'] : false; - } - - /** - * @param string $label - * - * @return bool - */ - private static function isValidContextJ(array $codePoints, $label) - { - if (!isset(self::$virama)) { - self::$virama = require __DIR__.\DIRECTORY_SEPARATOR.'Resources'.\DIRECTORY_SEPARATOR.'unidata'.\DIRECTORY_SEPARATOR.'virama.php'; - } - - $offset = 0; - - foreach ($codePoints as $i => $codePoint) { - if (0x200C !== $codePoint && 0x200D !== $codePoint) { - continue; - } - - if (!isset($codePoints[$i - 1])) { - return false; - } - - // If Canonical_Combining_Class(Before(cp)) .eq. Virama Then True; - if (isset(self::$virama[$codePoints[$i - 1]])) { - continue; - } - - // If RegExpMatch((Joining_Type:{L,D})(Joining_Type:T)*\u200C(Joining_Type:T)*(Joining_Type:{R,D})) Then - // True; - // Generated RegExp = ([Joining_Type:{L,D}][Joining_Type:T]*\u200C[Joining_Type:T]*)[Joining_Type:{R,D}] - if (0x200C === $codePoint && 1 === preg_match(Regex::ZWNJ, $label, $matches, \PREG_OFFSET_CAPTURE, $offset)) { - $offset += \strlen($matches[1][0]); - - continue; - } - - return false; - } - - return true; - } - - /** - * @see https://www.unicode.org/reports/tr46/#ProcessingStepMap - * - * @param string $input - * @param array $options - * - * @return string - */ - private static function mapCodePoints($input, array $options, Info $info) - { - $str = ''; - $useSTD3ASCIIRules = $options['UseSTD3ASCIIRules']; - $transitional = $options['Transitional_Processing']; - - foreach (self::utf8Decode($input) as $codePoint) { - $data = self::lookupCodePointStatus($codePoint, $useSTD3ASCIIRules); - - switch ($data['status']) { - case 'disallowed': - $info->errors |= self::ERROR_DISALLOWED; - - // no break. - - case 'valid': - $str .= mb_chr($codePoint, 'utf-8'); - - break; - - case 'ignored': - // Do nothing. - break; - - case 'mapped': - $str .= $data['mapping']; - - break; - - case 'deviation': - $info->transitionalDifferent = true; - $str .= ($transitional ? $data['mapping'] : mb_chr($codePoint, 'utf-8')); - - break; - } - } - - return $str; - } - - /** - * @see https://www.unicode.org/reports/tr46/#Processing - * - * @param string $domain - * @param array $options - * - * @return array - */ - private static function process($domain, array $options, Info $info) - { - // If VerifyDnsLength is not set, we are doing ToUnicode otherwise we are doing ToASCII and - // we need to respect the VerifyDnsLength option. - $checkForEmptyLabels = !isset($options['VerifyDnsLength']) || $options['VerifyDnsLength']; - - if ($checkForEmptyLabels && '' === $domain) { - $info->errors |= self::ERROR_EMPTY_LABEL; - - return [$domain]; - } - - // Step 1. Map each code point in the domain name string - $domain = self::mapCodePoints($domain, $options, $info); - - // Step 2. Normalize the domain name string to Unicode Normalization Form C. - if (!Normalizer::isNormalized($domain, Normalizer::FORM_C)) { - $domain = Normalizer::normalize($domain, Normalizer::FORM_C); - } - - // Step 3. Break the string into labels at U+002E (.) FULL STOP. - $labels = explode('.', $domain); - $lastLabelIndex = \count($labels) - 1; - - // Step 4. Convert and validate each label in the domain name string. - foreach ($labels as $i => $label) { - $validationOptions = $options; - - if ('xn--' === substr($label, 0, 4)) { - try { - $label = self::punycodeDecode(substr($label, 4)); - } catch (Exception $e) { - $info->errors |= self::ERROR_PUNYCODE; - - continue; - } - - $validationOptions['Transitional_Processing'] = false; - $labels[$i] = $label; - } - - self::validateLabel($label, $info, $validationOptions, $i > 0 && $i === $lastLabelIndex); - } - - if ($info->bidiDomain && !$info->validBidiDomain) { - $info->errors |= self::ERROR_BIDI; - } - - // Any input domain name string that does not record an error has been successfully - // processed according to this specification. Conversely, if an input domain_name string - // causes an error, then the processing of the input domain_name string fails. Determining - // what to do with error input is up to the caller, and not in the scope of this document. - return $labels; - } - - /** - * @see https://tools.ietf.org/html/rfc5893#section-2 - * - * @param string $label - */ - private static function validateBidiLabel($label, Info $info) - { - if (1 === preg_match(Regex::RTL_LABEL, $label)) { - $info->bidiDomain = true; - - // Step 1. The first character must be a character with Bidi property L, R, or AL. - // If it has the R or AL property, it is an RTL label - if (1 !== preg_match(Regex::BIDI_STEP_1_RTL, $label)) { - $info->validBidiDomain = false; - - return; - } - - // Step 2. In an RTL label, only characters with the Bidi properties R, AL, AN, EN, ES, - // CS, ET, ON, BN, or NSM are allowed. - if (1 === preg_match(Regex::BIDI_STEP_2, $label)) { - $info->validBidiDomain = false; - - return; - } - - // Step 3. In an RTL label, the end of the label must be a character with Bidi property - // R, AL, EN, or AN, followed by zero or more characters with Bidi property NSM. - if (1 !== preg_match(Regex::BIDI_STEP_3, $label)) { - $info->validBidiDomain = false; - - return; - } - - // Step 4. In an RTL label, if an EN is present, no AN may be present, and vice versa. - if (1 === preg_match(Regex::BIDI_STEP_4_AN, $label) && 1 === preg_match(Regex::BIDI_STEP_4_EN, $label)) { - $info->validBidiDomain = false; - - return; - } - - return; - } - - // We are a LTR label - // Step 1. The first character must be a character with Bidi property L, R, or AL. - // If it has the L property, it is an LTR label. - if (1 !== preg_match(Regex::BIDI_STEP_1_LTR, $label)) { - $info->validBidiDomain = false; - - return; - } - - // Step 5. In an LTR label, only characters with the Bidi properties L, EN, - // ES, CS, ET, ON, BN, or NSM are allowed. - if (1 === preg_match(Regex::BIDI_STEP_5, $label)) { - $info->validBidiDomain = false; - - return; - } - - // Step 6.In an LTR label, the end of the label must be a character with Bidi property L or - // EN, followed by zero or more characters with Bidi property NSM. - if (1 !== preg_match(Regex::BIDI_STEP_6, $label)) { - $info->validBidiDomain = false; - - return; - } - } - - /** - * @param array $labels - */ - private static function validateDomainAndLabelLength(array $labels, Info $info) - { - $maxDomainSize = self::MAX_DOMAIN_SIZE; - $length = \count($labels); - - // Number of "." delimiters. - $domainLength = $length - 1; - - // If the last label is empty and it is not the first label, then it is the root label. - // Increase the max size by 1, making it 254, to account for the root label's "." - // delimiter. This also means we don't need to check the last label's length for being too - // long. - if ($length > 1 && '' === $labels[$length - 1]) { - ++$maxDomainSize; - --$length; - } - - for ($i = 0; $i < $length; ++$i) { - $bytes = \strlen($labels[$i]); - $domainLength += $bytes; - - if ($bytes > self::MAX_LABEL_SIZE) { - $info->errors |= self::ERROR_LABEL_TOO_LONG; - } - } - - if ($domainLength > $maxDomainSize) { - $info->errors |= self::ERROR_DOMAIN_NAME_TOO_LONG; - } - } - - /** - * @see https://www.unicode.org/reports/tr46/#Validity_Criteria - * - * @param string $label - * @param array $options - * @param bool $canBeEmpty - */ - private static function validateLabel($label, Info $info, array $options, $canBeEmpty) - { - if ('' === $label) { - if (!$canBeEmpty && (!isset($options['VerifyDnsLength']) || $options['VerifyDnsLength'])) { - $info->errors |= self::ERROR_EMPTY_LABEL; - } - - return; - } - - // Step 1. The label must be in Unicode Normalization Form C. - if (!Normalizer::isNormalized($label, Normalizer::FORM_C)) { - $info->errors |= self::ERROR_INVALID_ACE_LABEL; - } - - $codePoints = self::utf8Decode($label); - - if ($options['CheckHyphens']) { - // Step 2. If CheckHyphens, the label must not contain a U+002D HYPHEN-MINUS character - // in both the thrid and fourth positions. - if (isset($codePoints[2], $codePoints[3]) && 0x002D === $codePoints[2] && 0x002D === $codePoints[3]) { - $info->errors |= self::ERROR_HYPHEN_3_4; - } - - // Step 3. If CheckHyphens, the label must neither begin nor end with a U+002D - // HYPHEN-MINUS character. - if ('-' === substr($label, 0, 1)) { - $info->errors |= self::ERROR_LEADING_HYPHEN; - } - - if ('-' === substr($label, -1, 1)) { - $info->errors |= self::ERROR_TRAILING_HYPHEN; - } - } - - // Step 4. The label must not contain a U+002E (.) FULL STOP. - if (false !== strpos($label, '.')) { - $info->errors |= self::ERROR_LABEL_HAS_DOT; - } - - // Step 5. The label must not begin with a combining mark, that is: General_Category=Mark. - if (1 === preg_match(Regex::COMBINING_MARK, $label)) { - $info->errors |= self::ERROR_LEADING_COMBINING_MARK; - } - - // Step 6. Each code point in the label must only have certain status values according to - // Section 5, IDNA Mapping Table: - $transitional = $options['Transitional_Processing']; - $useSTD3ASCIIRules = $options['UseSTD3ASCIIRules']; - - foreach ($codePoints as $codePoint) { - $data = self::lookupCodePointStatus($codePoint, $useSTD3ASCIIRules); - $status = $data['status']; - - if ('valid' === $status || (!$transitional && 'deviation' === $status)) { - continue; - } - - $info->errors |= self::ERROR_DISALLOWED; - - break; - } - - // Step 7. If CheckJoiners, the label must satisify the ContextJ rules from Appendix A, in - // The Unicode Code Points and Internationalized Domain Names for Applications (IDNA) - // [IDNA2008]. - if ($options['CheckJoiners'] && !self::isValidContextJ($codePoints, $label)) { - $info->errors |= self::ERROR_CONTEXTJ; - } - - // Step 8. If CheckBidi, and if the domain name is a Bidi domain name, then the label must - // satisfy all six of the numbered conditions in [IDNA2008] RFC 5893, Section 2. - if ($options['CheckBidi'] && (!$info->bidiDomain || $info->validBidiDomain)) { - self::validateBidiLabel($label, $info); - } - } - - /** - * @see https://tools.ietf.org/html/rfc3492#section-6.2 - * - * @param string $input - * - * @return string - */ - private static function punycodeDecode($input) - { - $n = self::INITIAL_N; - $out = 0; - $i = 0; - $bias = self::INITIAL_BIAS; - $lastDelimIndex = strrpos($input, self::DELIMITER); - $b = false === $lastDelimIndex ? 0 : $lastDelimIndex; - $inputLength = \strlen($input); - $output = []; - $bytes = array_map('ord', str_split($input)); - - for ($j = 0; $j < $b; ++$j) { - if ($bytes[$j] > 0x7F) { - throw new Exception('Invalid input'); - } - - $output[$out++] = $input[$j]; - } - - if ($b > 0) { - ++$b; - } - - for ($in = $b; $in < $inputLength; ++$out) { - $oldi = $i; - $w = 1; - - for ($k = self::BASE; /* no condition */; $k += self::BASE) { - if ($in >= $inputLength) { - throw new Exception('Invalid input'); - } - - $digit = self::$basicToDigit[$bytes[$in++] & 0xFF]; - - if ($digit < 0) { - throw new Exception('Invalid input'); - } - - if ($digit > intdiv(self::MAX_INT - $i, $w)) { - throw new Exception('Integer overflow'); - } - - $i += $digit * $w; - - if ($k <= $bias) { - $t = self::TMIN; - } elseif ($k >= $bias + self::TMAX) { - $t = self::TMAX; - } else { - $t = $k - $bias; - } - - if ($digit < $t) { - break; - } - - $baseMinusT = self::BASE - $t; - - if ($w > intdiv(self::MAX_INT, $baseMinusT)) { - throw new Exception('Integer overflow'); - } - - $w *= $baseMinusT; - } - - $outPlusOne = $out + 1; - $bias = self::adaptBias($i - $oldi, $outPlusOne, 0 === $oldi); - - if (intdiv($i, $outPlusOne) > self::MAX_INT - $n) { - throw new Exception('Integer overflow'); - } - - $n += intdiv($i, $outPlusOne); - $i %= $outPlusOne; - array_splice($output, $i++, 0, [mb_chr($n, 'utf-8')]); - } - - return implode('', $output); - } - - /** - * @see https://tools.ietf.org/html/rfc3492#section-6.3 - * - * @param string $input - * - * @return string - */ - private static function punycodeEncode($input) - { - $n = self::INITIAL_N; - $delta = 0; - $out = 0; - $bias = self::INITIAL_BIAS; - $inputLength = 0; - $output = ''; - $iter = self::utf8Decode($input); - - foreach ($iter as $codePoint) { - ++$inputLength; - - if ($codePoint < 0x80) { - $output .= \chr($codePoint); - ++$out; - } - } - - $h = $out; - $b = $out; - - if ($b > 0) { - $output .= self::DELIMITER; - ++$out; - } - - while ($h < $inputLength) { - $m = self::MAX_INT; - - foreach ($iter as $codePoint) { - if ($codePoint >= $n && $codePoint < $m) { - $m = $codePoint; - } - } - - if ($m - $n > intdiv(self::MAX_INT - $delta, $h + 1)) { - throw new Exception('Integer overflow'); - } - - $delta += ($m - $n) * ($h + 1); - $n = $m; - - foreach ($iter as $codePoint) { - if ($codePoint < $n && 0 === ++$delta) { - throw new Exception('Integer overflow'); - } - - if ($codePoint === $n) { - $q = $delta; - - for ($k = self::BASE; /* no condition */; $k += self::BASE) { - if ($k <= $bias) { - $t = self::TMIN; - } elseif ($k >= $bias + self::TMAX) { - $t = self::TMAX; - } else { - $t = $k - $bias; - } - - if ($q < $t) { - break; - } - - $qMinusT = $q - $t; - $baseMinusT = self::BASE - $t; - $output .= self::encodeDigit($t + $qMinusT % $baseMinusT, false); - ++$out; - $q = intdiv($qMinusT, $baseMinusT); - } - - $output .= self::encodeDigit($q, false); - ++$out; - $bias = self::adaptBias($delta, $h + 1, $h === $b); - $delta = 0; - ++$h; - } - } - - ++$delta; - ++$n; - } - - return $output; - } - - /** - * @see https://tools.ietf.org/html/rfc3492#section-6.1 - * - * @param int $delta - * @param int $numPoints - * @param bool $firstTime - * - * @return int - */ - private static function adaptBias($delta, $numPoints, $firstTime) - { - // xxx >> 1 is a faster way of doing intdiv(xxx, 2) - $delta = $firstTime ? intdiv($delta, self::DAMP) : $delta >> 1; - $delta += intdiv($delta, $numPoints); - $k = 0; - - while ($delta > ((self::BASE - self::TMIN) * self::TMAX) >> 1) { - $delta = intdiv($delta, self::BASE - self::TMIN); - $k += self::BASE; - } - - return $k + intdiv((self::BASE - self::TMIN + 1) * $delta, $delta + self::SKEW); - } - - /** - * @param int $d - * @param bool $flag - * - * @return string - */ - private static function encodeDigit($d, $flag) - { - return \chr($d + 22 + 75 * ($d < 26 ? 1 : 0) - (($flag ? 1 : 0) << 5)); - } - - /** - * Takes a UTF-8 encoded string and converts it into a series of integer code points. Any - * invalid byte sequences will be replaced by a U+FFFD replacement code point. - * - * @see https://encoding.spec.whatwg.org/#utf-8-decoder - * - * @param string $input - * - * @return array - */ - private static function utf8Decode($input) - { - $bytesSeen = 0; - $bytesNeeded = 0; - $lowerBoundary = 0x80; - $upperBoundary = 0xBF; - $codePoint = 0; - $codePoints = []; - $length = \strlen($input); - - for ($i = 0; $i < $length; ++$i) { - $byte = \ord($input[$i]); - - if (0 === $bytesNeeded) { - if ($byte >= 0x00 && $byte <= 0x7F) { - $codePoints[] = $byte; - - continue; - } - - if ($byte >= 0xC2 && $byte <= 0xDF) { - $bytesNeeded = 1; - $codePoint = $byte & 0x1F; - } elseif ($byte >= 0xE0 && $byte <= 0xEF) { - if (0xE0 === $byte) { - $lowerBoundary = 0xA0; - } elseif (0xED === $byte) { - $upperBoundary = 0x9F; - } - - $bytesNeeded = 2; - $codePoint = $byte & 0xF; - } elseif ($byte >= 0xF0 && $byte <= 0xF4) { - if (0xF0 === $byte) { - $lowerBoundary = 0x90; - } elseif (0xF4 === $byte) { - $upperBoundary = 0x8F; - } - - $bytesNeeded = 3; - $codePoint = $byte & 0x7; - } else { - $codePoints[] = 0xFFFD; - } - - continue; - } - - if ($byte < $lowerBoundary || $byte > $upperBoundary) { - $codePoint = 0; - $bytesNeeded = 0; - $bytesSeen = 0; - $lowerBoundary = 0x80; - $upperBoundary = 0xBF; - --$i; - $codePoints[] = 0xFFFD; - - continue; - } - - $lowerBoundary = 0x80; - $upperBoundary = 0xBF; - $codePoint = ($codePoint << 6) | ($byte & 0x3F); - - if (++$bytesSeen !== $bytesNeeded) { - continue; - } - - $codePoints[] = $codePoint; - $codePoint = 0; - $bytesNeeded = 0; - $bytesSeen = 0; - } - - // String unexpectedly ended, so append a U+FFFD code point. - if (0 !== $bytesNeeded) { - $codePoints[] = 0xFFFD; - } - - return $codePoints; - } - - /** - * @param int $codePoint - * @param bool $useSTD3ASCIIRules - * - * @return array{status: string, mapping?: string} - */ - private static function lookupCodePointStatus($codePoint, $useSTD3ASCIIRules) - { - if (!self::$mappingTableLoaded) { - self::$mappingTableLoaded = true; - self::$mapped = require __DIR__.'/Resources/unidata/mapped.php'; - self::$ignored = require __DIR__.'/Resources/unidata/ignored.php'; - self::$deviation = require __DIR__.'/Resources/unidata/deviation.php'; - self::$disallowed = require __DIR__.'/Resources/unidata/disallowed.php'; - self::$disallowed_STD3_mapped = require __DIR__.'/Resources/unidata/disallowed_STD3_mapped.php'; - self::$disallowed_STD3_valid = require __DIR__.'/Resources/unidata/disallowed_STD3_valid.php'; - } - - if (isset(self::$mapped[$codePoint])) { - return ['status' => 'mapped', 'mapping' => self::$mapped[$codePoint]]; - } - - if (isset(self::$ignored[$codePoint])) { - return ['status' => 'ignored']; - } - - if (isset(self::$deviation[$codePoint])) { - return ['status' => 'deviation', 'mapping' => self::$deviation[$codePoint]]; - } - - if (isset(self::$disallowed[$codePoint]) || DisallowedRanges::inRange($codePoint)) { - return ['status' => 'disallowed']; - } - - $isDisallowedMapped = isset(self::$disallowed_STD3_mapped[$codePoint]); - - if ($isDisallowedMapped || isset(self::$disallowed_STD3_valid[$codePoint])) { - $status = 'disallowed'; - - if (!$useSTD3ASCIIRules) { - $status = $isDisallowedMapped ? 'mapped' : 'valid'; - } - - if ($isDisallowedMapped) { - return ['status' => $status, 'mapping' => self::$disallowed_STD3_mapped[$codePoint]]; - } - - return ['status' => $status]; - } - - return ['status' => 'valid']; - } -} diff --git a/vendor/symfony/polyfill-intl-idn/Info.php b/vendor/symfony/polyfill-intl-idn/Info.php deleted file mode 100644 index 25c3582b..00000000 --- a/vendor/symfony/polyfill-intl-idn/Info.php +++ /dev/null @@ -1,23 +0,0 @@ - and Trevor Rowbotham - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Intl\Idn; - -/** - * @internal - */ -class Info -{ - public $bidiDomain = false; - public $errors = 0; - public $validBidiDomain = true; - public $transitionalDifferent = false; -} diff --git a/vendor/symfony/polyfill-intl-idn/LICENSE b/vendor/symfony/polyfill-intl-idn/LICENSE deleted file mode 100644 index 03c5e257..00000000 --- a/vendor/symfony/polyfill-intl-idn/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2018-2019 Fabien Potencier and Trevor Rowbotham - -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-intl-idn/README.md b/vendor/symfony/polyfill-intl-idn/README.md deleted file mode 100644 index cae55170..00000000 --- a/vendor/symfony/polyfill-intl-idn/README.md +++ /dev/null @@ -1,12 +0,0 @@ -Symfony Polyfill / Intl: Idn -============================ - -This component provides [`idn_to_ascii`](https://php.net/idn-to-ascii) and [`idn_to_utf8`](https://php.net/idn-to-utf8) functions to users who run php versions without the [Intl](https://php.net/intl) 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-intl-idn/Resources/unidata/DisallowedRanges.php b/vendor/symfony/polyfill-intl-idn/Resources/unidata/DisallowedRanges.php deleted file mode 100644 index 5bb70e48..00000000 --- a/vendor/symfony/polyfill-intl-idn/Resources/unidata/DisallowedRanges.php +++ /dev/null @@ -1,375 +0,0 @@ -= 128 && $codePoint <= 159) { - return true; - } - - if ($codePoint >= 2155 && $codePoint <= 2207) { - return true; - } - - if ($codePoint >= 3676 && $codePoint <= 3712) { - return true; - } - - if ($codePoint >= 3808 && $codePoint <= 3839) { - return true; - } - - if ($codePoint >= 4059 && $codePoint <= 4095) { - return true; - } - - if ($codePoint >= 4256 && $codePoint <= 4293) { - return true; - } - - if ($codePoint >= 6849 && $codePoint <= 6911) { - return true; - } - - if ($codePoint >= 11859 && $codePoint <= 11903) { - return true; - } - - if ($codePoint >= 42955 && $codePoint <= 42996) { - return true; - } - - if ($codePoint >= 55296 && $codePoint <= 57343) { - return true; - } - - if ($codePoint >= 57344 && $codePoint <= 63743) { - return true; - } - - if ($codePoint >= 64218 && $codePoint <= 64255) { - return true; - } - - if ($codePoint >= 64976 && $codePoint <= 65007) { - return true; - } - - if ($codePoint >= 65630 && $codePoint <= 65663) { - return true; - } - - if ($codePoint >= 65953 && $codePoint <= 65999) { - return true; - } - - if ($codePoint >= 66046 && $codePoint <= 66175) { - return true; - } - - if ($codePoint >= 66518 && $codePoint <= 66559) { - return true; - } - - if ($codePoint >= 66928 && $codePoint <= 67071) { - return true; - } - - if ($codePoint >= 67432 && $codePoint <= 67583) { - return true; - } - - if ($codePoint >= 67760 && $codePoint <= 67807) { - return true; - } - - if ($codePoint >= 67904 && $codePoint <= 67967) { - return true; - } - - if ($codePoint >= 68256 && $codePoint <= 68287) { - return true; - } - - if ($codePoint >= 68528 && $codePoint <= 68607) { - return true; - } - - if ($codePoint >= 68681 && $codePoint <= 68735) { - return true; - } - - if ($codePoint >= 68922 && $codePoint <= 69215) { - return true; - } - - if ($codePoint >= 69298 && $codePoint <= 69375) { - return true; - } - - if ($codePoint >= 69466 && $codePoint <= 69551) { - return true; - } - - if ($codePoint >= 70207 && $codePoint <= 70271) { - return true; - } - - if ($codePoint >= 70517 && $codePoint <= 70655) { - return true; - } - - if ($codePoint >= 70874 && $codePoint <= 71039) { - return true; - } - - if ($codePoint >= 71134 && $codePoint <= 71167) { - return true; - } - - if ($codePoint >= 71370 && $codePoint <= 71423) { - return true; - } - - if ($codePoint >= 71488 && $codePoint <= 71679) { - return true; - } - - if ($codePoint >= 71740 && $codePoint <= 71839) { - return true; - } - - if ($codePoint >= 72026 && $codePoint <= 72095) { - return true; - } - - if ($codePoint >= 72441 && $codePoint <= 72703) { - return true; - } - - if ($codePoint >= 72887 && $codePoint <= 72959) { - return true; - } - - if ($codePoint >= 73130 && $codePoint <= 73439) { - return true; - } - - if ($codePoint >= 73465 && $codePoint <= 73647) { - return true; - } - - if ($codePoint >= 74650 && $codePoint <= 74751) { - return true; - } - - if ($codePoint >= 75076 && $codePoint <= 77823) { - return true; - } - - if ($codePoint >= 78905 && $codePoint <= 82943) { - return true; - } - - if ($codePoint >= 83527 && $codePoint <= 92159) { - return true; - } - - if ($codePoint >= 92784 && $codePoint <= 92879) { - return true; - } - - if ($codePoint >= 93072 && $codePoint <= 93759) { - return true; - } - - if ($codePoint >= 93851 && $codePoint <= 93951) { - return true; - } - - if ($codePoint >= 94112 && $codePoint <= 94175) { - return true; - } - - if ($codePoint >= 101590 && $codePoint <= 101631) { - return true; - } - - if ($codePoint >= 101641 && $codePoint <= 110591) { - return true; - } - - if ($codePoint >= 110879 && $codePoint <= 110927) { - return true; - } - - if ($codePoint >= 111356 && $codePoint <= 113663) { - return true; - } - - if ($codePoint >= 113828 && $codePoint <= 118783) { - return true; - } - - if ($codePoint >= 119366 && $codePoint <= 119519) { - return true; - } - - if ($codePoint >= 119673 && $codePoint <= 119807) { - return true; - } - - if ($codePoint >= 121520 && $codePoint <= 122879) { - return true; - } - - if ($codePoint >= 122923 && $codePoint <= 123135) { - return true; - } - - if ($codePoint >= 123216 && $codePoint <= 123583) { - return true; - } - - if ($codePoint >= 123648 && $codePoint <= 124927) { - return true; - } - - if ($codePoint >= 125143 && $codePoint <= 125183) { - return true; - } - - if ($codePoint >= 125280 && $codePoint <= 126064) { - return true; - } - - if ($codePoint >= 126133 && $codePoint <= 126208) { - return true; - } - - if ($codePoint >= 126270 && $codePoint <= 126463) { - return true; - } - - if ($codePoint >= 126652 && $codePoint <= 126703) { - return true; - } - - if ($codePoint >= 126706 && $codePoint <= 126975) { - return true; - } - - if ($codePoint >= 127406 && $codePoint <= 127461) { - return true; - } - - if ($codePoint >= 127590 && $codePoint <= 127743) { - return true; - } - - if ($codePoint >= 129202 && $codePoint <= 129279) { - return true; - } - - if ($codePoint >= 129751 && $codePoint <= 129791) { - return true; - } - - if ($codePoint >= 129995 && $codePoint <= 130031) { - return true; - } - - if ($codePoint >= 130042 && $codePoint <= 131069) { - return true; - } - - if ($codePoint >= 173790 && $codePoint <= 173823) { - return true; - } - - if ($codePoint >= 191457 && $codePoint <= 194559) { - return true; - } - - if ($codePoint >= 195102 && $codePoint <= 196605) { - return true; - } - - if ($codePoint >= 201547 && $codePoint <= 262141) { - return true; - } - - if ($codePoint >= 262144 && $codePoint <= 327677) { - return true; - } - - if ($codePoint >= 327680 && $codePoint <= 393213) { - return true; - } - - if ($codePoint >= 393216 && $codePoint <= 458749) { - return true; - } - - if ($codePoint >= 458752 && $codePoint <= 524285) { - return true; - } - - if ($codePoint >= 524288 && $codePoint <= 589821) { - return true; - } - - if ($codePoint >= 589824 && $codePoint <= 655357) { - return true; - } - - if ($codePoint >= 655360 && $codePoint <= 720893) { - return true; - } - - if ($codePoint >= 720896 && $codePoint <= 786429) { - return true; - } - - if ($codePoint >= 786432 && $codePoint <= 851965) { - return true; - } - - if ($codePoint >= 851968 && $codePoint <= 917501) { - return true; - } - - if ($codePoint >= 917536 && $codePoint <= 917631) { - return true; - } - - if ($codePoint >= 917632 && $codePoint <= 917759) { - return true; - } - - if ($codePoint >= 918000 && $codePoint <= 983037) { - return true; - } - - if ($codePoint >= 983040 && $codePoint <= 1048573) { - return true; - } - - if ($codePoint >= 1048576 && $codePoint <= 1114109) { - return true; - } - - return false; - } -} diff --git a/vendor/symfony/polyfill-intl-idn/Resources/unidata/Regex.php b/vendor/symfony/polyfill-intl-idn/Resources/unidata/Regex.php deleted file mode 100644 index 5c1c51dd..00000000 --- a/vendor/symfony/polyfill-intl-idn/Resources/unidata/Regex.php +++ /dev/null @@ -1,24 +0,0 @@ - 'ss', - 962 => 'σ', - 8204 => '', - 8205 => '', -); diff --git a/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed.php b/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed.php deleted file mode 100644 index 25a5f564..00000000 --- a/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed.php +++ /dev/null @@ -1,2638 +0,0 @@ - true, - 889 => true, - 896 => true, - 897 => true, - 898 => true, - 899 => true, - 907 => true, - 909 => true, - 930 => true, - 1216 => true, - 1328 => true, - 1367 => true, - 1368 => true, - 1419 => true, - 1420 => true, - 1424 => true, - 1480 => true, - 1481 => true, - 1482 => true, - 1483 => true, - 1484 => true, - 1485 => true, - 1486 => true, - 1487 => true, - 1515 => true, - 1516 => true, - 1517 => true, - 1518 => true, - 1525 => true, - 1526 => true, - 1527 => true, - 1528 => true, - 1529 => true, - 1530 => true, - 1531 => true, - 1532 => true, - 1533 => true, - 1534 => true, - 1535 => true, - 1536 => true, - 1537 => true, - 1538 => true, - 1539 => true, - 1540 => true, - 1541 => true, - 1564 => true, - 1565 => true, - 1757 => true, - 1806 => true, - 1807 => true, - 1867 => true, - 1868 => true, - 1970 => true, - 1971 => true, - 1972 => true, - 1973 => true, - 1974 => true, - 1975 => true, - 1976 => true, - 1977 => true, - 1978 => true, - 1979 => true, - 1980 => true, - 1981 => true, - 1982 => true, - 1983 => true, - 2043 => true, - 2044 => true, - 2094 => true, - 2095 => true, - 2111 => true, - 2140 => true, - 2141 => true, - 2143 => true, - 2229 => true, - 2248 => true, - 2249 => true, - 2250 => true, - 2251 => true, - 2252 => true, - 2253 => true, - 2254 => true, - 2255 => true, - 2256 => true, - 2257 => true, - 2258 => true, - 2274 => true, - 2436 => true, - 2445 => true, - 2446 => true, - 2449 => true, - 2450 => true, - 2473 => true, - 2481 => true, - 2483 => true, - 2484 => true, - 2485 => true, - 2490 => true, - 2491 => true, - 2501 => true, - 2502 => true, - 2505 => true, - 2506 => true, - 2511 => true, - 2512 => true, - 2513 => true, - 2514 => true, - 2515 => true, - 2516 => true, - 2517 => true, - 2518 => true, - 2520 => true, - 2521 => true, - 2522 => true, - 2523 => true, - 2526 => true, - 2532 => true, - 2533 => true, - 2559 => true, - 2560 => true, - 2564 => true, - 2571 => true, - 2572 => true, - 2573 => true, - 2574 => true, - 2577 => true, - 2578 => true, - 2601 => true, - 2609 => true, - 2612 => true, - 2615 => true, - 2618 => true, - 2619 => true, - 2621 => true, - 2627 => true, - 2628 => true, - 2629 => true, - 2630 => true, - 2633 => true, - 2634 => true, - 2638 => true, - 2639 => true, - 2640 => true, - 2642 => true, - 2643 => true, - 2644 => true, - 2645 => true, - 2646 => true, - 2647 => true, - 2648 => true, - 2653 => true, - 2655 => true, - 2656 => true, - 2657 => true, - 2658 => true, - 2659 => true, - 2660 => true, - 2661 => true, - 2679 => true, - 2680 => true, - 2681 => true, - 2682 => true, - 2683 => true, - 2684 => true, - 2685 => true, - 2686 => true, - 2687 => true, - 2688 => true, - 2692 => true, - 2702 => true, - 2706 => true, - 2729 => true, - 2737 => true, - 2740 => true, - 2746 => true, - 2747 => true, - 2758 => true, - 2762 => true, - 2766 => true, - 2767 => true, - 2769 => true, - 2770 => true, - 2771 => true, - 2772 => true, - 2773 => true, - 2774 => true, - 2775 => true, - 2776 => true, - 2777 => true, - 2778 => true, - 2779 => true, - 2780 => true, - 2781 => true, - 2782 => true, - 2783 => true, - 2788 => true, - 2789 => true, - 2802 => true, - 2803 => true, - 2804 => true, - 2805 => true, - 2806 => true, - 2807 => true, - 2808 => true, - 2816 => true, - 2820 => true, - 2829 => true, - 2830 => true, - 2833 => true, - 2834 => true, - 2857 => true, - 2865 => true, - 2868 => true, - 2874 => true, - 2875 => true, - 2885 => true, - 2886 => true, - 2889 => true, - 2890 => true, - 2894 => true, - 2895 => true, - 2896 => true, - 2897 => true, - 2898 => true, - 2899 => true, - 2900 => true, - 2904 => true, - 2905 => true, - 2906 => true, - 2907 => true, - 2910 => true, - 2916 => true, - 2917 => true, - 2936 => true, - 2937 => true, - 2938 => true, - 2939 => true, - 2940 => true, - 2941 => true, - 2942 => true, - 2943 => true, - 2944 => true, - 2945 => true, - 2948 => true, - 2955 => true, - 2956 => true, - 2957 => true, - 2961 => true, - 2966 => true, - 2967 => true, - 2968 => true, - 2971 => true, - 2973 => true, - 2976 => true, - 2977 => true, - 2978 => true, - 2981 => true, - 2982 => true, - 2983 => true, - 2987 => true, - 2988 => true, - 2989 => true, - 3002 => true, - 3003 => true, - 3004 => true, - 3005 => true, - 3011 => true, - 3012 => true, - 3013 => true, - 3017 => true, - 3022 => true, - 3023 => true, - 3025 => true, - 3026 => true, - 3027 => true, - 3028 => true, - 3029 => true, - 3030 => true, - 3032 => true, - 3033 => true, - 3034 => true, - 3035 => true, - 3036 => true, - 3037 => true, - 3038 => true, - 3039 => true, - 3040 => true, - 3041 => true, - 3042 => true, - 3043 => true, - 3044 => true, - 3045 => true, - 3067 => true, - 3068 => true, - 3069 => true, - 3070 => true, - 3071 => true, - 3085 => true, - 3089 => true, - 3113 => true, - 3130 => true, - 3131 => true, - 3132 => true, - 3141 => true, - 3145 => true, - 3150 => true, - 3151 => true, - 3152 => true, - 3153 => true, - 3154 => true, - 3155 => true, - 3156 => true, - 3159 => true, - 3163 => true, - 3164 => true, - 3165 => true, - 3166 => true, - 3167 => true, - 3172 => true, - 3173 => true, - 3184 => true, - 3185 => true, - 3186 => true, - 3187 => true, - 3188 => true, - 3189 => true, - 3190 => true, - 3213 => true, - 3217 => true, - 3241 => true, - 3252 => true, - 3258 => true, - 3259 => true, - 3269 => true, - 3273 => true, - 3278 => true, - 3279 => true, - 3280 => true, - 3281 => true, - 3282 => true, - 3283 => true, - 3284 => true, - 3287 => true, - 3288 => true, - 3289 => true, - 3290 => true, - 3291 => true, - 3292 => true, - 3293 => true, - 3295 => true, - 3300 => true, - 3301 => true, - 3312 => true, - 3315 => true, - 3316 => true, - 3317 => true, - 3318 => true, - 3319 => true, - 3320 => true, - 3321 => true, - 3322 => true, - 3323 => true, - 3324 => true, - 3325 => true, - 3326 => true, - 3327 => true, - 3341 => true, - 3345 => true, - 3397 => true, - 3401 => true, - 3408 => true, - 3409 => true, - 3410 => true, - 3411 => true, - 3428 => true, - 3429 => true, - 3456 => true, - 3460 => true, - 3479 => true, - 3480 => true, - 3481 => true, - 3506 => true, - 3516 => true, - 3518 => true, - 3519 => true, - 3527 => true, - 3528 => true, - 3529 => true, - 3531 => true, - 3532 => true, - 3533 => true, - 3534 => true, - 3541 => true, - 3543 => true, - 3552 => true, - 3553 => true, - 3554 => true, - 3555 => true, - 3556 => true, - 3557 => true, - 3568 => true, - 3569 => true, - 3573 => true, - 3574 => true, - 3575 => true, - 3576 => true, - 3577 => true, - 3578 => true, - 3579 => true, - 3580 => true, - 3581 => true, - 3582 => true, - 3583 => true, - 3584 => true, - 3643 => true, - 3644 => true, - 3645 => true, - 3646 => true, - 3715 => true, - 3717 => true, - 3723 => true, - 3748 => true, - 3750 => true, - 3774 => true, - 3775 => true, - 3781 => true, - 3783 => true, - 3790 => true, - 3791 => true, - 3802 => true, - 3803 => true, - 3912 => true, - 3949 => true, - 3950 => true, - 3951 => true, - 3952 => true, - 3992 => true, - 4029 => true, - 4045 => true, - 4294 => true, - 4296 => true, - 4297 => true, - 4298 => true, - 4299 => true, - 4300 => true, - 4302 => true, - 4303 => true, - 4447 => true, - 4448 => true, - 4681 => true, - 4686 => true, - 4687 => true, - 4695 => true, - 4697 => true, - 4702 => true, - 4703 => true, - 4745 => true, - 4750 => true, - 4751 => true, - 4785 => true, - 4790 => true, - 4791 => true, - 4799 => true, - 4801 => true, - 4806 => true, - 4807 => true, - 4823 => true, - 4881 => true, - 4886 => true, - 4887 => true, - 4955 => true, - 4956 => true, - 4989 => true, - 4990 => true, - 4991 => true, - 5018 => true, - 5019 => true, - 5020 => true, - 5021 => true, - 5022 => true, - 5023 => true, - 5110 => true, - 5111 => true, - 5118 => true, - 5119 => true, - 5760 => true, - 5789 => true, - 5790 => true, - 5791 => true, - 5881 => true, - 5882 => true, - 5883 => true, - 5884 => true, - 5885 => true, - 5886 => true, - 5887 => true, - 5901 => true, - 5909 => true, - 5910 => true, - 5911 => true, - 5912 => true, - 5913 => true, - 5914 => true, - 5915 => true, - 5916 => true, - 5917 => true, - 5918 => true, - 5919 => true, - 5943 => true, - 5944 => true, - 5945 => true, - 5946 => true, - 5947 => true, - 5948 => true, - 5949 => true, - 5950 => true, - 5951 => true, - 5972 => true, - 5973 => true, - 5974 => true, - 5975 => true, - 5976 => true, - 5977 => true, - 5978 => true, - 5979 => true, - 5980 => true, - 5981 => true, - 5982 => true, - 5983 => true, - 5997 => true, - 6001 => true, - 6004 => true, - 6005 => true, - 6006 => true, - 6007 => true, - 6008 => true, - 6009 => true, - 6010 => true, - 6011 => true, - 6012 => true, - 6013 => true, - 6014 => true, - 6015 => true, - 6068 => true, - 6069 => true, - 6110 => true, - 6111 => true, - 6122 => true, - 6123 => true, - 6124 => true, - 6125 => true, - 6126 => true, - 6127 => true, - 6138 => true, - 6139 => true, - 6140 => true, - 6141 => true, - 6142 => true, - 6143 => true, - 6150 => true, - 6158 => true, - 6159 => true, - 6170 => true, - 6171 => true, - 6172 => true, - 6173 => true, - 6174 => true, - 6175 => true, - 6265 => true, - 6266 => true, - 6267 => true, - 6268 => true, - 6269 => true, - 6270 => true, - 6271 => true, - 6315 => true, - 6316 => true, - 6317 => true, - 6318 => true, - 6319 => true, - 6390 => true, - 6391 => true, - 6392 => true, - 6393 => true, - 6394 => true, - 6395 => true, - 6396 => true, - 6397 => true, - 6398 => true, - 6399 => true, - 6431 => true, - 6444 => true, - 6445 => true, - 6446 => true, - 6447 => true, - 6460 => true, - 6461 => true, - 6462 => true, - 6463 => true, - 6465 => true, - 6466 => true, - 6467 => true, - 6510 => true, - 6511 => true, - 6517 => true, - 6518 => true, - 6519 => true, - 6520 => true, - 6521 => true, - 6522 => true, - 6523 => true, - 6524 => true, - 6525 => true, - 6526 => true, - 6527 => true, - 6572 => true, - 6573 => true, - 6574 => true, - 6575 => true, - 6602 => true, - 6603 => true, - 6604 => true, - 6605 => true, - 6606 => true, - 6607 => true, - 6619 => true, - 6620 => true, - 6621 => true, - 6684 => true, - 6685 => true, - 6751 => true, - 6781 => true, - 6782 => true, - 6794 => true, - 6795 => true, - 6796 => true, - 6797 => true, - 6798 => true, - 6799 => true, - 6810 => true, - 6811 => true, - 6812 => true, - 6813 => true, - 6814 => true, - 6815 => true, - 6830 => true, - 6831 => true, - 6988 => true, - 6989 => true, - 6990 => true, - 6991 => true, - 7037 => true, - 7038 => true, - 7039 => true, - 7156 => true, - 7157 => true, - 7158 => true, - 7159 => true, - 7160 => true, - 7161 => true, - 7162 => true, - 7163 => true, - 7224 => true, - 7225 => true, - 7226 => true, - 7242 => true, - 7243 => true, - 7244 => true, - 7305 => true, - 7306 => true, - 7307 => true, - 7308 => true, - 7309 => true, - 7310 => true, - 7311 => true, - 7355 => true, - 7356 => true, - 7368 => true, - 7369 => true, - 7370 => true, - 7371 => true, - 7372 => true, - 7373 => true, - 7374 => true, - 7375 => true, - 7419 => true, - 7420 => true, - 7421 => true, - 7422 => true, - 7423 => true, - 7674 => true, - 7958 => true, - 7959 => true, - 7966 => true, - 7967 => true, - 8006 => true, - 8007 => true, - 8014 => true, - 8015 => true, - 8024 => true, - 8026 => true, - 8028 => true, - 8030 => true, - 8062 => true, - 8063 => true, - 8117 => true, - 8133 => true, - 8148 => true, - 8149 => true, - 8156 => true, - 8176 => true, - 8177 => true, - 8181 => true, - 8191 => true, - 8206 => true, - 8207 => true, - 8228 => true, - 8229 => true, - 8230 => true, - 8232 => true, - 8233 => true, - 8234 => true, - 8235 => true, - 8236 => true, - 8237 => true, - 8238 => true, - 8289 => true, - 8290 => true, - 8291 => true, - 8293 => true, - 8294 => true, - 8295 => true, - 8296 => true, - 8297 => true, - 8298 => true, - 8299 => true, - 8300 => true, - 8301 => true, - 8302 => true, - 8303 => true, - 8306 => true, - 8307 => true, - 8335 => true, - 8349 => true, - 8350 => true, - 8351 => true, - 8384 => true, - 8385 => true, - 8386 => true, - 8387 => true, - 8388 => true, - 8389 => true, - 8390 => true, - 8391 => true, - 8392 => true, - 8393 => true, - 8394 => true, - 8395 => true, - 8396 => true, - 8397 => true, - 8398 => true, - 8399 => true, - 8433 => true, - 8434 => true, - 8435 => true, - 8436 => true, - 8437 => true, - 8438 => true, - 8439 => true, - 8440 => true, - 8441 => true, - 8442 => true, - 8443 => true, - 8444 => true, - 8445 => true, - 8446 => true, - 8447 => true, - 8498 => true, - 8579 => true, - 8588 => true, - 8589 => true, - 8590 => true, - 8591 => true, - 9255 => true, - 9256 => true, - 9257 => true, - 9258 => true, - 9259 => true, - 9260 => true, - 9261 => true, - 9262 => true, - 9263 => true, - 9264 => true, - 9265 => true, - 9266 => true, - 9267 => true, - 9268 => true, - 9269 => true, - 9270 => true, - 9271 => true, - 9272 => true, - 9273 => true, - 9274 => true, - 9275 => true, - 9276 => true, - 9277 => true, - 9278 => true, - 9279 => true, - 9291 => true, - 9292 => true, - 9293 => true, - 9294 => true, - 9295 => true, - 9296 => true, - 9297 => true, - 9298 => true, - 9299 => true, - 9300 => true, - 9301 => true, - 9302 => true, - 9303 => true, - 9304 => true, - 9305 => true, - 9306 => true, - 9307 => true, - 9308 => true, - 9309 => true, - 9310 => true, - 9311 => true, - 9352 => true, - 9353 => true, - 9354 => true, - 9355 => true, - 9356 => true, - 9357 => true, - 9358 => true, - 9359 => true, - 9360 => true, - 9361 => true, - 9362 => true, - 9363 => true, - 9364 => true, - 9365 => true, - 9366 => true, - 9367 => true, - 9368 => true, - 9369 => true, - 9370 => true, - 9371 => true, - 11124 => true, - 11125 => true, - 11158 => true, - 11311 => true, - 11359 => true, - 11508 => true, - 11509 => true, - 11510 => true, - 11511 => true, - 11512 => true, - 11558 => true, - 11560 => true, - 11561 => true, - 11562 => true, - 11563 => true, - 11564 => true, - 11566 => true, - 11567 => true, - 11624 => true, - 11625 => true, - 11626 => true, - 11627 => true, - 11628 => true, - 11629 => true, - 11630 => true, - 11633 => true, - 11634 => true, - 11635 => true, - 11636 => true, - 11637 => true, - 11638 => true, - 11639 => true, - 11640 => true, - 11641 => true, - 11642 => true, - 11643 => true, - 11644 => true, - 11645 => true, - 11646 => true, - 11671 => true, - 11672 => true, - 11673 => true, - 11674 => true, - 11675 => true, - 11676 => true, - 11677 => true, - 11678 => true, - 11679 => true, - 11687 => true, - 11695 => true, - 11703 => true, - 11711 => true, - 11719 => true, - 11727 => true, - 11735 => true, - 11743 => true, - 11930 => true, - 12020 => true, - 12021 => true, - 12022 => true, - 12023 => true, - 12024 => true, - 12025 => true, - 12026 => true, - 12027 => true, - 12028 => true, - 12029 => true, - 12030 => true, - 12031 => true, - 12246 => true, - 12247 => true, - 12248 => true, - 12249 => true, - 12250 => true, - 12251 => true, - 12252 => true, - 12253 => true, - 12254 => true, - 12255 => true, - 12256 => true, - 12257 => true, - 12258 => true, - 12259 => true, - 12260 => true, - 12261 => true, - 12262 => true, - 12263 => true, - 12264 => true, - 12265 => true, - 12266 => true, - 12267 => true, - 12268 => true, - 12269 => true, - 12270 => true, - 12271 => true, - 12272 => true, - 12273 => true, - 12274 => true, - 12275 => true, - 12276 => true, - 12277 => true, - 12278 => true, - 12279 => true, - 12280 => true, - 12281 => true, - 12282 => true, - 12283 => true, - 12284 => true, - 12285 => true, - 12286 => true, - 12287 => true, - 12352 => true, - 12439 => true, - 12440 => true, - 12544 => true, - 12545 => true, - 12546 => true, - 12547 => true, - 12548 => true, - 12592 => true, - 12644 => true, - 12687 => true, - 12772 => true, - 12773 => true, - 12774 => true, - 12775 => true, - 12776 => true, - 12777 => true, - 12778 => true, - 12779 => true, - 12780 => true, - 12781 => true, - 12782 => true, - 12783 => true, - 12831 => true, - 13250 => true, - 13255 => true, - 13272 => true, - 40957 => true, - 40958 => true, - 40959 => true, - 42125 => true, - 42126 => true, - 42127 => true, - 42183 => true, - 42184 => true, - 42185 => true, - 42186 => true, - 42187 => true, - 42188 => true, - 42189 => true, - 42190 => true, - 42191 => true, - 42540 => true, - 42541 => true, - 42542 => true, - 42543 => true, - 42544 => true, - 42545 => true, - 42546 => true, - 42547 => true, - 42548 => true, - 42549 => true, - 42550 => true, - 42551 => true, - 42552 => true, - 42553 => true, - 42554 => true, - 42555 => true, - 42556 => true, - 42557 => true, - 42558 => true, - 42559 => true, - 42744 => true, - 42745 => true, - 42746 => true, - 42747 => true, - 42748 => true, - 42749 => true, - 42750 => true, - 42751 => true, - 42944 => true, - 42945 => true, - 43053 => true, - 43054 => true, - 43055 => true, - 43066 => true, - 43067 => true, - 43068 => true, - 43069 => true, - 43070 => true, - 43071 => true, - 43128 => true, - 43129 => true, - 43130 => true, - 43131 => true, - 43132 => true, - 43133 => true, - 43134 => true, - 43135 => true, - 43206 => true, - 43207 => true, - 43208 => true, - 43209 => true, - 43210 => true, - 43211 => true, - 43212 => true, - 43213 => true, - 43226 => true, - 43227 => true, - 43228 => true, - 43229 => true, - 43230 => true, - 43231 => true, - 43348 => true, - 43349 => true, - 43350 => true, - 43351 => true, - 43352 => true, - 43353 => true, - 43354 => true, - 43355 => true, - 43356 => true, - 43357 => true, - 43358 => true, - 43389 => true, - 43390 => true, - 43391 => true, - 43470 => true, - 43482 => true, - 43483 => true, - 43484 => true, - 43485 => true, - 43519 => true, - 43575 => true, - 43576 => true, - 43577 => true, - 43578 => true, - 43579 => true, - 43580 => true, - 43581 => true, - 43582 => true, - 43583 => true, - 43598 => true, - 43599 => true, - 43610 => true, - 43611 => true, - 43715 => true, - 43716 => true, - 43717 => true, - 43718 => true, - 43719 => true, - 43720 => true, - 43721 => true, - 43722 => true, - 43723 => true, - 43724 => true, - 43725 => true, - 43726 => true, - 43727 => true, - 43728 => true, - 43729 => true, - 43730 => true, - 43731 => true, - 43732 => true, - 43733 => true, - 43734 => true, - 43735 => true, - 43736 => true, - 43737 => true, - 43738 => true, - 43767 => true, - 43768 => true, - 43769 => true, - 43770 => true, - 43771 => true, - 43772 => true, - 43773 => true, - 43774 => true, - 43775 => true, - 43776 => true, - 43783 => true, - 43784 => true, - 43791 => true, - 43792 => true, - 43799 => true, - 43800 => true, - 43801 => true, - 43802 => true, - 43803 => true, - 43804 => true, - 43805 => true, - 43806 => true, - 43807 => true, - 43815 => true, - 43823 => true, - 43884 => true, - 43885 => true, - 43886 => true, - 43887 => true, - 44014 => true, - 44015 => true, - 44026 => true, - 44027 => true, - 44028 => true, - 44029 => true, - 44030 => true, - 44031 => true, - 55204 => true, - 55205 => true, - 55206 => true, - 55207 => true, - 55208 => true, - 55209 => true, - 55210 => true, - 55211 => true, - 55212 => true, - 55213 => true, - 55214 => true, - 55215 => true, - 55239 => true, - 55240 => true, - 55241 => true, - 55242 => true, - 55292 => true, - 55293 => true, - 55294 => true, - 55295 => true, - 64110 => true, - 64111 => true, - 64263 => true, - 64264 => true, - 64265 => true, - 64266 => true, - 64267 => true, - 64268 => true, - 64269 => true, - 64270 => true, - 64271 => true, - 64272 => true, - 64273 => true, - 64274 => true, - 64280 => true, - 64281 => true, - 64282 => true, - 64283 => true, - 64284 => true, - 64311 => true, - 64317 => true, - 64319 => true, - 64322 => true, - 64325 => true, - 64450 => true, - 64451 => true, - 64452 => true, - 64453 => true, - 64454 => true, - 64455 => true, - 64456 => true, - 64457 => true, - 64458 => true, - 64459 => true, - 64460 => true, - 64461 => true, - 64462 => true, - 64463 => true, - 64464 => true, - 64465 => true, - 64466 => true, - 64832 => true, - 64833 => true, - 64834 => true, - 64835 => true, - 64836 => true, - 64837 => true, - 64838 => true, - 64839 => true, - 64840 => true, - 64841 => true, - 64842 => true, - 64843 => true, - 64844 => true, - 64845 => true, - 64846 => true, - 64847 => true, - 64912 => true, - 64913 => true, - 64968 => true, - 64969 => true, - 64970 => true, - 64971 => true, - 64972 => true, - 64973 => true, - 64974 => true, - 64975 => true, - 65022 => true, - 65023 => true, - 65042 => true, - 65049 => true, - 65050 => true, - 65051 => true, - 65052 => true, - 65053 => true, - 65054 => true, - 65055 => true, - 65072 => true, - 65106 => true, - 65107 => true, - 65127 => true, - 65132 => true, - 65133 => true, - 65134 => true, - 65135 => true, - 65141 => true, - 65277 => true, - 65278 => true, - 65280 => true, - 65440 => true, - 65471 => true, - 65472 => true, - 65473 => true, - 65480 => true, - 65481 => true, - 65488 => true, - 65489 => true, - 65496 => true, - 65497 => true, - 65501 => true, - 65502 => true, - 65503 => true, - 65511 => true, - 65519 => true, - 65520 => true, - 65521 => true, - 65522 => true, - 65523 => true, - 65524 => true, - 65525 => true, - 65526 => true, - 65527 => true, - 65528 => true, - 65529 => true, - 65530 => true, - 65531 => true, - 65532 => true, - 65533 => true, - 65534 => true, - 65535 => true, - 65548 => true, - 65575 => true, - 65595 => true, - 65598 => true, - 65614 => true, - 65615 => true, - 65787 => true, - 65788 => true, - 65789 => true, - 65790 => true, - 65791 => true, - 65795 => true, - 65796 => true, - 65797 => true, - 65798 => true, - 65844 => true, - 65845 => true, - 65846 => true, - 65935 => true, - 65949 => true, - 65950 => true, - 65951 => true, - 66205 => true, - 66206 => true, - 66207 => true, - 66257 => true, - 66258 => true, - 66259 => true, - 66260 => true, - 66261 => true, - 66262 => true, - 66263 => true, - 66264 => true, - 66265 => true, - 66266 => true, - 66267 => true, - 66268 => true, - 66269 => true, - 66270 => true, - 66271 => true, - 66300 => true, - 66301 => true, - 66302 => true, - 66303 => true, - 66340 => true, - 66341 => true, - 66342 => true, - 66343 => true, - 66344 => true, - 66345 => true, - 66346 => true, - 66347 => true, - 66348 => true, - 66379 => true, - 66380 => true, - 66381 => true, - 66382 => true, - 66383 => true, - 66427 => true, - 66428 => true, - 66429 => true, - 66430 => true, - 66431 => true, - 66462 => true, - 66500 => true, - 66501 => true, - 66502 => true, - 66503 => true, - 66718 => true, - 66719 => true, - 66730 => true, - 66731 => true, - 66732 => true, - 66733 => true, - 66734 => true, - 66735 => true, - 66772 => true, - 66773 => true, - 66774 => true, - 66775 => true, - 66812 => true, - 66813 => true, - 66814 => true, - 66815 => true, - 66856 => true, - 66857 => true, - 66858 => true, - 66859 => true, - 66860 => true, - 66861 => true, - 66862 => true, - 66863 => true, - 66916 => true, - 66917 => true, - 66918 => true, - 66919 => true, - 66920 => true, - 66921 => true, - 66922 => true, - 66923 => true, - 66924 => true, - 66925 => true, - 66926 => true, - 67383 => true, - 67384 => true, - 67385 => true, - 67386 => true, - 67387 => true, - 67388 => true, - 67389 => true, - 67390 => true, - 67391 => true, - 67414 => true, - 67415 => true, - 67416 => true, - 67417 => true, - 67418 => true, - 67419 => true, - 67420 => true, - 67421 => true, - 67422 => true, - 67423 => true, - 67590 => true, - 67591 => true, - 67593 => true, - 67638 => true, - 67641 => true, - 67642 => true, - 67643 => true, - 67645 => true, - 67646 => true, - 67670 => true, - 67743 => true, - 67744 => true, - 67745 => true, - 67746 => true, - 67747 => true, - 67748 => true, - 67749 => true, - 67750 => true, - 67827 => true, - 67830 => true, - 67831 => true, - 67832 => true, - 67833 => true, - 67834 => true, - 67868 => true, - 67869 => true, - 67870 => true, - 67898 => true, - 67899 => true, - 67900 => true, - 67901 => true, - 67902 => true, - 68024 => true, - 68025 => true, - 68026 => true, - 68027 => true, - 68048 => true, - 68049 => true, - 68100 => true, - 68103 => true, - 68104 => true, - 68105 => true, - 68106 => true, - 68107 => true, - 68116 => true, - 68120 => true, - 68150 => true, - 68151 => true, - 68155 => true, - 68156 => true, - 68157 => true, - 68158 => true, - 68169 => true, - 68170 => true, - 68171 => true, - 68172 => true, - 68173 => true, - 68174 => true, - 68175 => true, - 68185 => true, - 68186 => true, - 68187 => true, - 68188 => true, - 68189 => true, - 68190 => true, - 68191 => true, - 68327 => true, - 68328 => true, - 68329 => true, - 68330 => true, - 68343 => true, - 68344 => true, - 68345 => true, - 68346 => true, - 68347 => true, - 68348 => true, - 68349 => true, - 68350 => true, - 68351 => true, - 68406 => true, - 68407 => true, - 68408 => true, - 68438 => true, - 68439 => true, - 68467 => true, - 68468 => true, - 68469 => true, - 68470 => true, - 68471 => true, - 68498 => true, - 68499 => true, - 68500 => true, - 68501 => true, - 68502 => true, - 68503 => true, - 68504 => true, - 68509 => true, - 68510 => true, - 68511 => true, - 68512 => true, - 68513 => true, - 68514 => true, - 68515 => true, - 68516 => true, - 68517 => true, - 68518 => true, - 68519 => true, - 68520 => true, - 68787 => true, - 68788 => true, - 68789 => true, - 68790 => true, - 68791 => true, - 68792 => true, - 68793 => true, - 68794 => true, - 68795 => true, - 68796 => true, - 68797 => true, - 68798 => true, - 68799 => true, - 68851 => true, - 68852 => true, - 68853 => true, - 68854 => true, - 68855 => true, - 68856 => true, - 68857 => true, - 68904 => true, - 68905 => true, - 68906 => true, - 68907 => true, - 68908 => true, - 68909 => true, - 68910 => true, - 68911 => true, - 69247 => true, - 69290 => true, - 69294 => true, - 69295 => true, - 69416 => true, - 69417 => true, - 69418 => true, - 69419 => true, - 69420 => true, - 69421 => true, - 69422 => true, - 69423 => true, - 69580 => true, - 69581 => true, - 69582 => true, - 69583 => true, - 69584 => true, - 69585 => true, - 69586 => true, - 69587 => true, - 69588 => true, - 69589 => true, - 69590 => true, - 69591 => true, - 69592 => true, - 69593 => true, - 69594 => true, - 69595 => true, - 69596 => true, - 69597 => true, - 69598 => true, - 69599 => true, - 69623 => true, - 69624 => true, - 69625 => true, - 69626 => true, - 69627 => true, - 69628 => true, - 69629 => true, - 69630 => true, - 69631 => true, - 69710 => true, - 69711 => true, - 69712 => true, - 69713 => true, - 69744 => true, - 69745 => true, - 69746 => true, - 69747 => true, - 69748 => true, - 69749 => true, - 69750 => true, - 69751 => true, - 69752 => true, - 69753 => true, - 69754 => true, - 69755 => true, - 69756 => true, - 69757 => true, - 69758 => true, - 69821 => true, - 69826 => true, - 69827 => true, - 69828 => true, - 69829 => true, - 69830 => true, - 69831 => true, - 69832 => true, - 69833 => true, - 69834 => true, - 69835 => true, - 69836 => true, - 69837 => true, - 69838 => true, - 69839 => true, - 69865 => true, - 69866 => true, - 69867 => true, - 69868 => true, - 69869 => true, - 69870 => true, - 69871 => true, - 69882 => true, - 69883 => true, - 69884 => true, - 69885 => true, - 69886 => true, - 69887 => true, - 69941 => true, - 69960 => true, - 69961 => true, - 69962 => true, - 69963 => true, - 69964 => true, - 69965 => true, - 69966 => true, - 69967 => true, - 70007 => true, - 70008 => true, - 70009 => true, - 70010 => true, - 70011 => true, - 70012 => true, - 70013 => true, - 70014 => true, - 70015 => true, - 70112 => true, - 70133 => true, - 70134 => true, - 70135 => true, - 70136 => true, - 70137 => true, - 70138 => true, - 70139 => true, - 70140 => true, - 70141 => true, - 70142 => true, - 70143 => true, - 70162 => true, - 70279 => true, - 70281 => true, - 70286 => true, - 70302 => true, - 70314 => true, - 70315 => true, - 70316 => true, - 70317 => true, - 70318 => true, - 70319 => true, - 70379 => true, - 70380 => true, - 70381 => true, - 70382 => true, - 70383 => true, - 70394 => true, - 70395 => true, - 70396 => true, - 70397 => true, - 70398 => true, - 70399 => true, - 70404 => true, - 70413 => true, - 70414 => true, - 70417 => true, - 70418 => true, - 70441 => true, - 70449 => true, - 70452 => true, - 70458 => true, - 70469 => true, - 70470 => true, - 70473 => true, - 70474 => true, - 70478 => true, - 70479 => true, - 70481 => true, - 70482 => true, - 70483 => true, - 70484 => true, - 70485 => true, - 70486 => true, - 70488 => true, - 70489 => true, - 70490 => true, - 70491 => true, - 70492 => true, - 70500 => true, - 70501 => true, - 70509 => true, - 70510 => true, - 70511 => true, - 70748 => true, - 70754 => true, - 70755 => true, - 70756 => true, - 70757 => true, - 70758 => true, - 70759 => true, - 70760 => true, - 70761 => true, - 70762 => true, - 70763 => true, - 70764 => true, - 70765 => true, - 70766 => true, - 70767 => true, - 70768 => true, - 70769 => true, - 70770 => true, - 70771 => true, - 70772 => true, - 70773 => true, - 70774 => true, - 70775 => true, - 70776 => true, - 70777 => true, - 70778 => true, - 70779 => true, - 70780 => true, - 70781 => true, - 70782 => true, - 70783 => true, - 70856 => true, - 70857 => true, - 70858 => true, - 70859 => true, - 70860 => true, - 70861 => true, - 70862 => true, - 70863 => true, - 71094 => true, - 71095 => true, - 71237 => true, - 71238 => true, - 71239 => true, - 71240 => true, - 71241 => true, - 71242 => true, - 71243 => true, - 71244 => true, - 71245 => true, - 71246 => true, - 71247 => true, - 71258 => true, - 71259 => true, - 71260 => true, - 71261 => true, - 71262 => true, - 71263 => true, - 71277 => true, - 71278 => true, - 71279 => true, - 71280 => true, - 71281 => true, - 71282 => true, - 71283 => true, - 71284 => true, - 71285 => true, - 71286 => true, - 71287 => true, - 71288 => true, - 71289 => true, - 71290 => true, - 71291 => true, - 71292 => true, - 71293 => true, - 71294 => true, - 71295 => true, - 71353 => true, - 71354 => true, - 71355 => true, - 71356 => true, - 71357 => true, - 71358 => true, - 71359 => true, - 71451 => true, - 71452 => true, - 71468 => true, - 71469 => true, - 71470 => true, - 71471 => true, - 71923 => true, - 71924 => true, - 71925 => true, - 71926 => true, - 71927 => true, - 71928 => true, - 71929 => true, - 71930 => true, - 71931 => true, - 71932 => true, - 71933 => true, - 71934 => true, - 71943 => true, - 71944 => true, - 71946 => true, - 71947 => true, - 71956 => true, - 71959 => true, - 71990 => true, - 71993 => true, - 71994 => true, - 72007 => true, - 72008 => true, - 72009 => true, - 72010 => true, - 72011 => true, - 72012 => true, - 72013 => true, - 72014 => true, - 72015 => true, - 72104 => true, - 72105 => true, - 72152 => true, - 72153 => true, - 72165 => true, - 72166 => true, - 72167 => true, - 72168 => true, - 72169 => true, - 72170 => true, - 72171 => true, - 72172 => true, - 72173 => true, - 72174 => true, - 72175 => true, - 72176 => true, - 72177 => true, - 72178 => true, - 72179 => true, - 72180 => true, - 72181 => true, - 72182 => true, - 72183 => true, - 72184 => true, - 72185 => true, - 72186 => true, - 72187 => true, - 72188 => true, - 72189 => true, - 72190 => true, - 72191 => true, - 72264 => true, - 72265 => true, - 72266 => true, - 72267 => true, - 72268 => true, - 72269 => true, - 72270 => true, - 72271 => true, - 72355 => true, - 72356 => true, - 72357 => true, - 72358 => true, - 72359 => true, - 72360 => true, - 72361 => true, - 72362 => true, - 72363 => true, - 72364 => true, - 72365 => true, - 72366 => true, - 72367 => true, - 72368 => true, - 72369 => true, - 72370 => true, - 72371 => true, - 72372 => true, - 72373 => true, - 72374 => true, - 72375 => true, - 72376 => true, - 72377 => true, - 72378 => true, - 72379 => true, - 72380 => true, - 72381 => true, - 72382 => true, - 72383 => true, - 72713 => true, - 72759 => true, - 72774 => true, - 72775 => true, - 72776 => true, - 72777 => true, - 72778 => true, - 72779 => true, - 72780 => true, - 72781 => true, - 72782 => true, - 72783 => true, - 72813 => true, - 72814 => true, - 72815 => true, - 72848 => true, - 72849 => true, - 72872 => true, - 72967 => true, - 72970 => true, - 73015 => true, - 73016 => true, - 73017 => true, - 73019 => true, - 73022 => true, - 73032 => true, - 73033 => true, - 73034 => true, - 73035 => true, - 73036 => true, - 73037 => true, - 73038 => true, - 73039 => true, - 73050 => true, - 73051 => true, - 73052 => true, - 73053 => true, - 73054 => true, - 73055 => true, - 73062 => true, - 73065 => true, - 73103 => true, - 73106 => true, - 73113 => true, - 73114 => true, - 73115 => true, - 73116 => true, - 73117 => true, - 73118 => true, - 73119 => true, - 73649 => true, - 73650 => true, - 73651 => true, - 73652 => true, - 73653 => true, - 73654 => true, - 73655 => true, - 73656 => true, - 73657 => true, - 73658 => true, - 73659 => true, - 73660 => true, - 73661 => true, - 73662 => true, - 73663 => true, - 73714 => true, - 73715 => true, - 73716 => true, - 73717 => true, - 73718 => true, - 73719 => true, - 73720 => true, - 73721 => true, - 73722 => true, - 73723 => true, - 73724 => true, - 73725 => true, - 73726 => true, - 74863 => true, - 74869 => true, - 74870 => true, - 74871 => true, - 74872 => true, - 74873 => true, - 74874 => true, - 74875 => true, - 74876 => true, - 74877 => true, - 74878 => true, - 74879 => true, - 78895 => true, - 78896 => true, - 78897 => true, - 78898 => true, - 78899 => true, - 78900 => true, - 78901 => true, - 78902 => true, - 78903 => true, - 78904 => true, - 92729 => true, - 92730 => true, - 92731 => true, - 92732 => true, - 92733 => true, - 92734 => true, - 92735 => true, - 92767 => true, - 92778 => true, - 92779 => true, - 92780 => true, - 92781 => true, - 92910 => true, - 92911 => true, - 92918 => true, - 92919 => true, - 92920 => true, - 92921 => true, - 92922 => true, - 92923 => true, - 92924 => true, - 92925 => true, - 92926 => true, - 92927 => true, - 92998 => true, - 92999 => true, - 93000 => true, - 93001 => true, - 93002 => true, - 93003 => true, - 93004 => true, - 93005 => true, - 93006 => true, - 93007 => true, - 93018 => true, - 93026 => true, - 93048 => true, - 93049 => true, - 93050 => true, - 93051 => true, - 93052 => true, - 94027 => true, - 94028 => true, - 94029 => true, - 94030 => true, - 94088 => true, - 94089 => true, - 94090 => true, - 94091 => true, - 94092 => true, - 94093 => true, - 94094 => true, - 94181 => true, - 94182 => true, - 94183 => true, - 94184 => true, - 94185 => true, - 94186 => true, - 94187 => true, - 94188 => true, - 94189 => true, - 94190 => true, - 94191 => true, - 94194 => true, - 94195 => true, - 94196 => true, - 94197 => true, - 94198 => true, - 94199 => true, - 94200 => true, - 94201 => true, - 94202 => true, - 94203 => true, - 94204 => true, - 94205 => true, - 94206 => true, - 94207 => true, - 100344 => true, - 100345 => true, - 100346 => true, - 100347 => true, - 100348 => true, - 100349 => true, - 100350 => true, - 100351 => true, - 110931 => true, - 110932 => true, - 110933 => true, - 110934 => true, - 110935 => true, - 110936 => true, - 110937 => true, - 110938 => true, - 110939 => true, - 110940 => true, - 110941 => true, - 110942 => true, - 110943 => true, - 110944 => true, - 110945 => true, - 110946 => true, - 110947 => true, - 110952 => true, - 110953 => true, - 110954 => true, - 110955 => true, - 110956 => true, - 110957 => true, - 110958 => true, - 110959 => true, - 113771 => true, - 113772 => true, - 113773 => true, - 113774 => true, - 113775 => true, - 113789 => true, - 113790 => true, - 113791 => true, - 113801 => true, - 113802 => true, - 113803 => true, - 113804 => true, - 113805 => true, - 113806 => true, - 113807 => true, - 113818 => true, - 113819 => true, - 119030 => true, - 119031 => true, - 119032 => true, - 119033 => true, - 119034 => true, - 119035 => true, - 119036 => true, - 119037 => true, - 119038 => true, - 119039 => true, - 119079 => true, - 119080 => true, - 119155 => true, - 119156 => true, - 119157 => true, - 119158 => true, - 119159 => true, - 119160 => true, - 119161 => true, - 119162 => true, - 119273 => true, - 119274 => true, - 119275 => true, - 119276 => true, - 119277 => true, - 119278 => true, - 119279 => true, - 119280 => true, - 119281 => true, - 119282 => true, - 119283 => true, - 119284 => true, - 119285 => true, - 119286 => true, - 119287 => true, - 119288 => true, - 119289 => true, - 119290 => true, - 119291 => true, - 119292 => true, - 119293 => true, - 119294 => true, - 119295 => true, - 119540 => true, - 119541 => true, - 119542 => true, - 119543 => true, - 119544 => true, - 119545 => true, - 119546 => true, - 119547 => true, - 119548 => true, - 119549 => true, - 119550 => true, - 119551 => true, - 119639 => true, - 119640 => true, - 119641 => true, - 119642 => true, - 119643 => true, - 119644 => true, - 119645 => true, - 119646 => true, - 119647 => true, - 119893 => true, - 119965 => true, - 119968 => true, - 119969 => true, - 119971 => true, - 119972 => true, - 119975 => true, - 119976 => true, - 119981 => true, - 119994 => true, - 119996 => true, - 120004 => true, - 120070 => true, - 120075 => true, - 120076 => true, - 120085 => true, - 120093 => true, - 120122 => true, - 120127 => true, - 120133 => true, - 120135 => true, - 120136 => true, - 120137 => true, - 120145 => true, - 120486 => true, - 120487 => true, - 120780 => true, - 120781 => true, - 121484 => true, - 121485 => true, - 121486 => true, - 121487 => true, - 121488 => true, - 121489 => true, - 121490 => true, - 121491 => true, - 121492 => true, - 121493 => true, - 121494 => true, - 121495 => true, - 121496 => true, - 121497 => true, - 121498 => true, - 121504 => true, - 122887 => true, - 122905 => true, - 122906 => true, - 122914 => true, - 122917 => true, - 123181 => true, - 123182 => true, - 123183 => true, - 123198 => true, - 123199 => true, - 123210 => true, - 123211 => true, - 123212 => true, - 123213 => true, - 123642 => true, - 123643 => true, - 123644 => true, - 123645 => true, - 123646 => true, - 125125 => true, - 125126 => true, - 125260 => true, - 125261 => true, - 125262 => true, - 125263 => true, - 125274 => true, - 125275 => true, - 125276 => true, - 125277 => true, - 126468 => true, - 126496 => true, - 126499 => true, - 126501 => true, - 126502 => true, - 126504 => true, - 126515 => true, - 126520 => true, - 126522 => true, - 126524 => true, - 126525 => true, - 126526 => true, - 126527 => true, - 126528 => true, - 126529 => true, - 126531 => true, - 126532 => true, - 126533 => true, - 126534 => true, - 126536 => true, - 126538 => true, - 126540 => true, - 126544 => true, - 126547 => true, - 126549 => true, - 126550 => true, - 126552 => true, - 126554 => true, - 126556 => true, - 126558 => true, - 126560 => true, - 126563 => true, - 126565 => true, - 126566 => true, - 126571 => true, - 126579 => true, - 126584 => true, - 126589 => true, - 126591 => true, - 126602 => true, - 126620 => true, - 126621 => true, - 126622 => true, - 126623 => true, - 126624 => true, - 126628 => true, - 126634 => true, - 127020 => true, - 127021 => true, - 127022 => true, - 127023 => true, - 127124 => true, - 127125 => true, - 127126 => true, - 127127 => true, - 127128 => true, - 127129 => true, - 127130 => true, - 127131 => true, - 127132 => true, - 127133 => true, - 127134 => true, - 127135 => true, - 127151 => true, - 127152 => true, - 127168 => true, - 127184 => true, - 127222 => true, - 127223 => true, - 127224 => true, - 127225 => true, - 127226 => true, - 127227 => true, - 127228 => true, - 127229 => true, - 127230 => true, - 127231 => true, - 127232 => true, - 127491 => true, - 127492 => true, - 127493 => true, - 127494 => true, - 127495 => true, - 127496 => true, - 127497 => true, - 127498 => true, - 127499 => true, - 127500 => true, - 127501 => true, - 127502 => true, - 127503 => true, - 127548 => true, - 127549 => true, - 127550 => true, - 127551 => true, - 127561 => true, - 127562 => true, - 127563 => true, - 127564 => true, - 127565 => true, - 127566 => true, - 127567 => true, - 127570 => true, - 127571 => true, - 127572 => true, - 127573 => true, - 127574 => true, - 127575 => true, - 127576 => true, - 127577 => true, - 127578 => true, - 127579 => true, - 127580 => true, - 127581 => true, - 127582 => true, - 127583 => true, - 128728 => true, - 128729 => true, - 128730 => true, - 128731 => true, - 128732 => true, - 128733 => true, - 128734 => true, - 128735 => true, - 128749 => true, - 128750 => true, - 128751 => true, - 128765 => true, - 128766 => true, - 128767 => true, - 128884 => true, - 128885 => true, - 128886 => true, - 128887 => true, - 128888 => true, - 128889 => true, - 128890 => true, - 128891 => true, - 128892 => true, - 128893 => true, - 128894 => true, - 128895 => true, - 128985 => true, - 128986 => true, - 128987 => true, - 128988 => true, - 128989 => true, - 128990 => true, - 128991 => true, - 129004 => true, - 129005 => true, - 129006 => true, - 129007 => true, - 129008 => true, - 129009 => true, - 129010 => true, - 129011 => true, - 129012 => true, - 129013 => true, - 129014 => true, - 129015 => true, - 129016 => true, - 129017 => true, - 129018 => true, - 129019 => true, - 129020 => true, - 129021 => true, - 129022 => true, - 129023 => true, - 129036 => true, - 129037 => true, - 129038 => true, - 129039 => true, - 129096 => true, - 129097 => true, - 129098 => true, - 129099 => true, - 129100 => true, - 129101 => true, - 129102 => true, - 129103 => true, - 129114 => true, - 129115 => true, - 129116 => true, - 129117 => true, - 129118 => true, - 129119 => true, - 129160 => true, - 129161 => true, - 129162 => true, - 129163 => true, - 129164 => true, - 129165 => true, - 129166 => true, - 129167 => true, - 129198 => true, - 129199 => true, - 129401 => true, - 129484 => true, - 129620 => true, - 129621 => true, - 129622 => true, - 129623 => true, - 129624 => true, - 129625 => true, - 129626 => true, - 129627 => true, - 129628 => true, - 129629 => true, - 129630 => true, - 129631 => true, - 129646 => true, - 129647 => true, - 129653 => true, - 129654 => true, - 129655 => true, - 129659 => true, - 129660 => true, - 129661 => true, - 129662 => true, - 129663 => true, - 129671 => true, - 129672 => true, - 129673 => true, - 129674 => true, - 129675 => true, - 129676 => true, - 129677 => true, - 129678 => true, - 129679 => true, - 129705 => true, - 129706 => true, - 129707 => true, - 129708 => true, - 129709 => true, - 129710 => true, - 129711 => true, - 129719 => true, - 129720 => true, - 129721 => true, - 129722 => true, - 129723 => true, - 129724 => true, - 129725 => true, - 129726 => true, - 129727 => true, - 129731 => true, - 129732 => true, - 129733 => true, - 129734 => true, - 129735 => true, - 129736 => true, - 129737 => true, - 129738 => true, - 129739 => true, - 129740 => true, - 129741 => true, - 129742 => true, - 129743 => true, - 129939 => true, - 131070 => true, - 131071 => true, - 177973 => true, - 177974 => true, - 177975 => true, - 177976 => true, - 177977 => true, - 177978 => true, - 177979 => true, - 177980 => true, - 177981 => true, - 177982 => true, - 177983 => true, - 178206 => true, - 178207 => true, - 183970 => true, - 183971 => true, - 183972 => true, - 183973 => true, - 183974 => true, - 183975 => true, - 183976 => true, - 183977 => true, - 183978 => true, - 183979 => true, - 183980 => true, - 183981 => true, - 183982 => true, - 183983 => true, - 194664 => true, - 194676 => true, - 194847 => true, - 194911 => true, - 195007 => true, - 196606 => true, - 196607 => true, - 262142 => true, - 262143 => true, - 327678 => true, - 327679 => true, - 393214 => true, - 393215 => true, - 458750 => true, - 458751 => true, - 524286 => true, - 524287 => true, - 589822 => true, - 589823 => true, - 655358 => true, - 655359 => true, - 720894 => true, - 720895 => true, - 786430 => true, - 786431 => true, - 851966 => true, - 851967 => true, - 917502 => true, - 917503 => true, - 917504 => true, - 917505 => true, - 917506 => true, - 917507 => true, - 917508 => true, - 917509 => true, - 917510 => true, - 917511 => true, - 917512 => true, - 917513 => true, - 917514 => true, - 917515 => true, - 917516 => true, - 917517 => true, - 917518 => true, - 917519 => true, - 917520 => true, - 917521 => true, - 917522 => true, - 917523 => true, - 917524 => true, - 917525 => true, - 917526 => true, - 917527 => true, - 917528 => true, - 917529 => true, - 917530 => true, - 917531 => true, - 917532 => true, - 917533 => true, - 917534 => true, - 917535 => true, - 983038 => true, - 983039 => true, - 1048574 => true, - 1048575 => true, - 1114110 => true, - 1114111 => true, -); diff --git a/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_mapped.php b/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_mapped.php deleted file mode 100644 index 54f21cc0..00000000 --- a/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_mapped.php +++ /dev/null @@ -1,308 +0,0 @@ - ' ', - 168 => ' ̈', - 175 => ' ̄', - 180 => ' ́', - 184 => ' ̧', - 728 => ' ̆', - 729 => ' ̇', - 730 => ' ̊', - 731 => ' ̨', - 732 => ' ̃', - 733 => ' ̋', - 890 => ' ι', - 894 => ';', - 900 => ' ́', - 901 => ' ̈́', - 8125 => ' ̓', - 8127 => ' ̓', - 8128 => ' ͂', - 8129 => ' ̈͂', - 8141 => ' ̓̀', - 8142 => ' ̓́', - 8143 => ' ̓͂', - 8157 => ' ̔̀', - 8158 => ' ̔́', - 8159 => ' ̔͂', - 8173 => ' ̈̀', - 8174 => ' ̈́', - 8175 => '`', - 8189 => ' ́', - 8190 => ' ̔', - 8192 => ' ', - 8193 => ' ', - 8194 => ' ', - 8195 => ' ', - 8196 => ' ', - 8197 => ' ', - 8198 => ' ', - 8199 => ' ', - 8200 => ' ', - 8201 => ' ', - 8202 => ' ', - 8215 => ' ̳', - 8239 => ' ', - 8252 => '!!', - 8254 => ' ̅', - 8263 => '??', - 8264 => '?!', - 8265 => '!?', - 8287 => ' ', - 8314 => '+', - 8316 => '=', - 8317 => '(', - 8318 => ')', - 8330 => '+', - 8332 => '=', - 8333 => '(', - 8334 => ')', - 8448 => 'a/c', - 8449 => 'a/s', - 8453 => 'c/o', - 8454 => 'c/u', - 9332 => '(1)', - 9333 => '(2)', - 9334 => '(3)', - 9335 => '(4)', - 9336 => '(5)', - 9337 => '(6)', - 9338 => '(7)', - 9339 => '(8)', - 9340 => '(9)', - 9341 => '(10)', - 9342 => '(11)', - 9343 => '(12)', - 9344 => '(13)', - 9345 => '(14)', - 9346 => '(15)', - 9347 => '(16)', - 9348 => '(17)', - 9349 => '(18)', - 9350 => '(19)', - 9351 => '(20)', - 9372 => '(a)', - 9373 => '(b)', - 9374 => '(c)', - 9375 => '(d)', - 9376 => '(e)', - 9377 => '(f)', - 9378 => '(g)', - 9379 => '(h)', - 9380 => '(i)', - 9381 => '(j)', - 9382 => '(k)', - 9383 => '(l)', - 9384 => '(m)', - 9385 => '(n)', - 9386 => '(o)', - 9387 => '(p)', - 9388 => '(q)', - 9389 => '(r)', - 9390 => '(s)', - 9391 => '(t)', - 9392 => '(u)', - 9393 => '(v)', - 9394 => '(w)', - 9395 => '(x)', - 9396 => '(y)', - 9397 => '(z)', - 10868 => '::=', - 10869 => '==', - 10870 => '===', - 12288 => ' ', - 12443 => ' ゙', - 12444 => ' ゚', - 12800 => '(ᄀ)', - 12801 => '(ᄂ)', - 12802 => '(ᄃ)', - 12803 => '(ᄅ)', - 12804 => '(ᄆ)', - 12805 => '(ᄇ)', - 12806 => '(ᄉ)', - 12807 => '(ᄋ)', - 12808 => '(ᄌ)', - 12809 => '(ᄎ)', - 12810 => '(ᄏ)', - 12811 => '(ᄐ)', - 12812 => '(ᄑ)', - 12813 => '(ᄒ)', - 12814 => '(가)', - 12815 => '(나)', - 12816 => '(다)', - 12817 => '(라)', - 12818 => '(마)', - 12819 => '(바)', - 12820 => '(사)', - 12821 => '(아)', - 12822 => '(자)', - 12823 => '(차)', - 12824 => '(카)', - 12825 => '(타)', - 12826 => '(파)', - 12827 => '(하)', - 12828 => '(주)', - 12829 => '(오전)', - 12830 => '(오후)', - 12832 => '(一)', - 12833 => '(二)', - 12834 => '(三)', - 12835 => '(四)', - 12836 => '(五)', - 12837 => '(六)', - 12838 => '(七)', - 12839 => '(八)', - 12840 => '(九)', - 12841 => '(十)', - 12842 => '(月)', - 12843 => '(火)', - 12844 => '(水)', - 12845 => '(木)', - 12846 => '(金)', - 12847 => '(土)', - 12848 => '(日)', - 12849 => '(株)', - 12850 => '(有)', - 12851 => '(社)', - 12852 => '(名)', - 12853 => '(特)', - 12854 => '(財)', - 12855 => '(祝)', - 12856 => '(労)', - 12857 => '(代)', - 12858 => '(呼)', - 12859 => '(学)', - 12860 => '(監)', - 12861 => '(企)', - 12862 => '(資)', - 12863 => '(協)', - 12864 => '(祭)', - 12865 => '(休)', - 12866 => '(自)', - 12867 => '(至)', - 64297 => '+', - 64606 => ' ٌّ', - 64607 => ' ٍّ', - 64608 => ' َّ', - 64609 => ' ُّ', - 64610 => ' ِّ', - 64611 => ' ّٰ', - 65018 => 'صلى الله عليه وسلم', - 65019 => 'جل جلاله', - 65040 => ',', - 65043 => ':', - 65044 => ';', - 65045 => '!', - 65046 => '?', - 65075 => '_', - 65076 => '_', - 65077 => '(', - 65078 => ')', - 65079 => '{', - 65080 => '}', - 65095 => '[', - 65096 => ']', - 65097 => ' ̅', - 65098 => ' ̅', - 65099 => ' ̅', - 65100 => ' ̅', - 65101 => '_', - 65102 => '_', - 65103 => '_', - 65104 => ',', - 65108 => ';', - 65109 => ':', - 65110 => '?', - 65111 => '!', - 65113 => '(', - 65114 => ')', - 65115 => '{', - 65116 => '}', - 65119 => '#', - 65120 => '&', - 65121 => '*', - 65122 => '+', - 65124 => '<', - 65125 => '>', - 65126 => '=', - 65128 => '\\', - 65129 => '$', - 65130 => '%', - 65131 => '@', - 65136 => ' ً', - 65138 => ' ٌ', - 65140 => ' ٍ', - 65142 => ' َ', - 65144 => ' ُ', - 65146 => ' ِ', - 65148 => ' ّ', - 65150 => ' ْ', - 65281 => '!', - 65282 => '"', - 65283 => '#', - 65284 => '$', - 65285 => '%', - 65286 => '&', - 65287 => '\'', - 65288 => '(', - 65289 => ')', - 65290 => '*', - 65291 => '+', - 65292 => ',', - 65295 => '/', - 65306 => ':', - 65307 => ';', - 65308 => '<', - 65309 => '=', - 65310 => '>', - 65311 => '?', - 65312 => '@', - 65339 => '[', - 65340 => '\\', - 65341 => ']', - 65342 => '^', - 65343 => '_', - 65344 => '`', - 65371 => '{', - 65372 => '|', - 65373 => '}', - 65374 => '~', - 65507 => ' ̄', - 127233 => '0,', - 127234 => '1,', - 127235 => '2,', - 127236 => '3,', - 127237 => '4,', - 127238 => '5,', - 127239 => '6,', - 127240 => '7,', - 127241 => '8,', - 127242 => '9,', - 127248 => '(a)', - 127249 => '(b)', - 127250 => '(c)', - 127251 => '(d)', - 127252 => '(e)', - 127253 => '(f)', - 127254 => '(g)', - 127255 => '(h)', - 127256 => '(i)', - 127257 => '(j)', - 127258 => '(k)', - 127259 => '(l)', - 127260 => '(m)', - 127261 => '(n)', - 127262 => '(o)', - 127263 => '(p)', - 127264 => '(q)', - 127265 => '(r)', - 127266 => '(s)', - 127267 => '(t)', - 127268 => '(u)', - 127269 => '(v)', - 127270 => '(w)', - 127271 => '(x)', - 127272 => '(y)', - 127273 => '(z)', -); diff --git a/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_valid.php b/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_valid.php deleted file mode 100644 index 223396ec..00000000 --- a/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_valid.php +++ /dev/null @@ -1,71 +0,0 @@ - true, - 1 => true, - 2 => true, - 3 => true, - 4 => true, - 5 => true, - 6 => true, - 7 => true, - 8 => true, - 9 => true, - 10 => true, - 11 => true, - 12 => true, - 13 => true, - 14 => true, - 15 => true, - 16 => true, - 17 => true, - 18 => true, - 19 => true, - 20 => true, - 21 => true, - 22 => true, - 23 => true, - 24 => true, - 25 => true, - 26 => true, - 27 => true, - 28 => true, - 29 => true, - 30 => true, - 31 => true, - 32 => true, - 33 => true, - 34 => true, - 35 => true, - 36 => true, - 37 => true, - 38 => true, - 39 => true, - 40 => true, - 41 => true, - 42 => true, - 43 => true, - 44 => true, - 47 => true, - 58 => true, - 59 => true, - 60 => true, - 61 => true, - 62 => true, - 63 => true, - 64 => true, - 91 => true, - 92 => true, - 93 => true, - 94 => true, - 95 => true, - 96 => true, - 123 => true, - 124 => true, - 125 => true, - 126 => true, - 127 => true, - 8800 => true, - 8814 => true, - 8815 => true, -); diff --git a/vendor/symfony/polyfill-intl-idn/Resources/unidata/ignored.php b/vendor/symfony/polyfill-intl-idn/Resources/unidata/ignored.php deleted file mode 100644 index b3778441..00000000 --- a/vendor/symfony/polyfill-intl-idn/Resources/unidata/ignored.php +++ /dev/null @@ -1,273 +0,0 @@ - true, - 847 => true, - 6155 => true, - 6156 => true, - 6157 => true, - 8203 => true, - 8288 => true, - 8292 => true, - 65024 => true, - 65025 => true, - 65026 => true, - 65027 => true, - 65028 => true, - 65029 => true, - 65030 => true, - 65031 => true, - 65032 => true, - 65033 => true, - 65034 => true, - 65035 => true, - 65036 => true, - 65037 => true, - 65038 => true, - 65039 => true, - 65279 => true, - 113824 => true, - 113825 => true, - 113826 => true, - 113827 => true, - 917760 => true, - 917761 => true, - 917762 => true, - 917763 => true, - 917764 => true, - 917765 => true, - 917766 => true, - 917767 => true, - 917768 => true, - 917769 => true, - 917770 => true, - 917771 => true, - 917772 => true, - 917773 => true, - 917774 => true, - 917775 => true, - 917776 => true, - 917777 => true, - 917778 => true, - 917779 => true, - 917780 => true, - 917781 => true, - 917782 => true, - 917783 => true, - 917784 => true, - 917785 => true, - 917786 => true, - 917787 => true, - 917788 => true, - 917789 => true, - 917790 => true, - 917791 => true, - 917792 => true, - 917793 => true, - 917794 => true, - 917795 => true, - 917796 => true, - 917797 => true, - 917798 => true, - 917799 => true, - 917800 => true, - 917801 => true, - 917802 => true, - 917803 => true, - 917804 => true, - 917805 => true, - 917806 => true, - 917807 => true, - 917808 => true, - 917809 => true, - 917810 => true, - 917811 => true, - 917812 => true, - 917813 => true, - 917814 => true, - 917815 => true, - 917816 => true, - 917817 => true, - 917818 => true, - 917819 => true, - 917820 => true, - 917821 => true, - 917822 => true, - 917823 => true, - 917824 => true, - 917825 => true, - 917826 => true, - 917827 => true, - 917828 => true, - 917829 => true, - 917830 => true, - 917831 => true, - 917832 => true, - 917833 => true, - 917834 => true, - 917835 => true, - 917836 => true, - 917837 => true, - 917838 => true, - 917839 => true, - 917840 => true, - 917841 => true, - 917842 => true, - 917843 => true, - 917844 => true, - 917845 => true, - 917846 => true, - 917847 => true, - 917848 => true, - 917849 => true, - 917850 => true, - 917851 => true, - 917852 => true, - 917853 => true, - 917854 => true, - 917855 => true, - 917856 => true, - 917857 => true, - 917858 => true, - 917859 => true, - 917860 => true, - 917861 => true, - 917862 => true, - 917863 => true, - 917864 => true, - 917865 => true, - 917866 => true, - 917867 => true, - 917868 => true, - 917869 => true, - 917870 => true, - 917871 => true, - 917872 => true, - 917873 => true, - 917874 => true, - 917875 => true, - 917876 => true, - 917877 => true, - 917878 => true, - 917879 => true, - 917880 => true, - 917881 => true, - 917882 => true, - 917883 => true, - 917884 => true, - 917885 => true, - 917886 => true, - 917887 => true, - 917888 => true, - 917889 => true, - 917890 => true, - 917891 => true, - 917892 => true, - 917893 => true, - 917894 => true, - 917895 => true, - 917896 => true, - 917897 => true, - 917898 => true, - 917899 => true, - 917900 => true, - 917901 => true, - 917902 => true, - 917903 => true, - 917904 => true, - 917905 => true, - 917906 => true, - 917907 => true, - 917908 => true, - 917909 => true, - 917910 => true, - 917911 => true, - 917912 => true, - 917913 => true, - 917914 => true, - 917915 => true, - 917916 => true, - 917917 => true, - 917918 => true, - 917919 => true, - 917920 => true, - 917921 => true, - 917922 => true, - 917923 => true, - 917924 => true, - 917925 => true, - 917926 => true, - 917927 => true, - 917928 => true, - 917929 => true, - 917930 => true, - 917931 => true, - 917932 => true, - 917933 => true, - 917934 => true, - 917935 => true, - 917936 => true, - 917937 => true, - 917938 => true, - 917939 => true, - 917940 => true, - 917941 => true, - 917942 => true, - 917943 => true, - 917944 => true, - 917945 => true, - 917946 => true, - 917947 => true, - 917948 => true, - 917949 => true, - 917950 => true, - 917951 => true, - 917952 => true, - 917953 => true, - 917954 => true, - 917955 => true, - 917956 => true, - 917957 => true, - 917958 => true, - 917959 => true, - 917960 => true, - 917961 => true, - 917962 => true, - 917963 => true, - 917964 => true, - 917965 => true, - 917966 => true, - 917967 => true, - 917968 => true, - 917969 => true, - 917970 => true, - 917971 => true, - 917972 => true, - 917973 => true, - 917974 => true, - 917975 => true, - 917976 => true, - 917977 => true, - 917978 => true, - 917979 => true, - 917980 => true, - 917981 => true, - 917982 => true, - 917983 => true, - 917984 => true, - 917985 => true, - 917986 => true, - 917987 => true, - 917988 => true, - 917989 => true, - 917990 => true, - 917991 => true, - 917992 => true, - 917993 => true, - 917994 => true, - 917995 => true, - 917996 => true, - 917997 => true, - 917998 => true, - 917999 => true, -); diff --git a/vendor/symfony/polyfill-intl-idn/Resources/unidata/mapped.php b/vendor/symfony/polyfill-intl-idn/Resources/unidata/mapped.php deleted file mode 100644 index 9b85fe9d..00000000 --- a/vendor/symfony/polyfill-intl-idn/Resources/unidata/mapped.php +++ /dev/null @@ -1,5778 +0,0 @@ - 'a', - 66 => 'b', - 67 => 'c', - 68 => 'd', - 69 => 'e', - 70 => 'f', - 71 => 'g', - 72 => 'h', - 73 => 'i', - 74 => 'j', - 75 => 'k', - 76 => 'l', - 77 => 'm', - 78 => 'n', - 79 => 'o', - 80 => 'p', - 81 => 'q', - 82 => 'r', - 83 => 's', - 84 => 't', - 85 => 'u', - 86 => 'v', - 87 => 'w', - 88 => 'x', - 89 => 'y', - 90 => 'z', - 170 => 'a', - 178 => '2', - 179 => '3', - 181 => 'μ', - 185 => '1', - 186 => 'o', - 188 => '1⁄4', - 189 => '1⁄2', - 190 => '3⁄4', - 192 => 'à', - 193 => 'á', - 194 => 'â', - 195 => 'ã', - 196 => 'ä', - 197 => 'å', - 198 => 'æ', - 199 => 'ç', - 200 => 'è', - 201 => 'é', - 202 => 'ê', - 203 => 'ë', - 204 => 'ì', - 205 => 'í', - 206 => 'î', - 207 => 'ï', - 208 => 'ð', - 209 => 'ñ', - 210 => 'ò', - 211 => 'ó', - 212 => 'ô', - 213 => 'õ', - 214 => 'ö', - 216 => 'ø', - 217 => 'ù', - 218 => 'ú', - 219 => 'û', - 220 => 'ü', - 221 => 'ý', - 222 => 'þ', - 256 => 'ā', - 258 => 'ă', - 260 => 'ą', - 262 => 'ć', - 264 => 'ĉ', - 266 => 'ċ', - 268 => 'č', - 270 => 'ď', - 272 => 'đ', - 274 => 'ē', - 276 => 'ĕ', - 278 => 'ė', - 280 => 'ę', - 282 => 'ě', - 284 => 'ĝ', - 286 => 'ğ', - 288 => 'ġ', - 290 => 'ģ', - 292 => 'ĥ', - 294 => 'ħ', - 296 => 'ĩ', - 298 => 'ī', - 300 => 'ĭ', - 302 => 'į', - 304 => 'i̇', - 306 => 'ij', - 307 => 'ij', - 308 => 'ĵ', - 310 => 'ķ', - 313 => 'ĺ', - 315 => 'ļ', - 317 => 'ľ', - 319 => 'l·', - 320 => 'l·', - 321 => 'ł', - 323 => 'ń', - 325 => 'ņ', - 327 => 'ň', - 329 => 'ʼn', - 330 => 'ŋ', - 332 => 'ō', - 334 => 'ŏ', - 336 => 'ő', - 338 => 'œ', - 340 => 'ŕ', - 342 => 'ŗ', - 344 => 'ř', - 346 => 'ś', - 348 => 'ŝ', - 350 => 'ş', - 352 => 'š', - 354 => 'ţ', - 356 => 'ť', - 358 => 'ŧ', - 360 => 'ũ', - 362 => 'ū', - 364 => 'ŭ', - 366 => 'ů', - 368 => 'ű', - 370 => 'ų', - 372 => 'ŵ', - 374 => 'ŷ', - 376 => 'ÿ', - 377 => 'ź', - 379 => 'ż', - 381 => 'ž', - 383 => 's', - 385 => 'ɓ', - 386 => 'ƃ', - 388 => 'ƅ', - 390 => 'ɔ', - 391 => 'ƈ', - 393 => 'ɖ', - 394 => 'ɗ', - 395 => 'ƌ', - 398 => 'ǝ', - 399 => 'ə', - 400 => 'ɛ', - 401 => 'ƒ', - 403 => 'ɠ', - 404 => 'ɣ', - 406 => 'ɩ', - 407 => 'ɨ', - 408 => 'ƙ', - 412 => 'ɯ', - 413 => 'ɲ', - 415 => 'ɵ', - 416 => 'ơ', - 418 => 'ƣ', - 420 => 'ƥ', - 422 => 'ʀ', - 423 => 'ƨ', - 425 => 'ʃ', - 428 => 'ƭ', - 430 => 'ʈ', - 431 => 'ư', - 433 => 'ʊ', - 434 => 'ʋ', - 435 => 'ƴ', - 437 => 'ƶ', - 439 => 'ʒ', - 440 => 'ƹ', - 444 => 'ƽ', - 452 => 'dž', - 453 => 'dž', - 454 => 'dž', - 455 => 'lj', - 456 => 'lj', - 457 => 'lj', - 458 => 'nj', - 459 => 'nj', - 460 => 'nj', - 461 => 'ǎ', - 463 => 'ǐ', - 465 => 'ǒ', - 467 => 'ǔ', - 469 => 'ǖ', - 471 => 'ǘ', - 473 => 'ǚ', - 475 => 'ǜ', - 478 => 'ǟ', - 480 => 'ǡ', - 482 => 'ǣ', - 484 => 'ǥ', - 486 => 'ǧ', - 488 => 'ǩ', - 490 => 'ǫ', - 492 => 'ǭ', - 494 => 'ǯ', - 497 => 'dz', - 498 => 'dz', - 499 => 'dz', - 500 => 'ǵ', - 502 => 'ƕ', - 503 => 'ƿ', - 504 => 'ǹ', - 506 => 'ǻ', - 508 => 'ǽ', - 510 => 'ǿ', - 512 => 'ȁ', - 514 => 'ȃ', - 516 => 'ȅ', - 518 => 'ȇ', - 520 => 'ȉ', - 522 => 'ȋ', - 524 => 'ȍ', - 526 => 'ȏ', - 528 => 'ȑ', - 530 => 'ȓ', - 532 => 'ȕ', - 534 => 'ȗ', - 536 => 'ș', - 538 => 'ț', - 540 => 'ȝ', - 542 => 'ȟ', - 544 => 'ƞ', - 546 => 'ȣ', - 548 => 'ȥ', - 550 => 'ȧ', - 552 => 'ȩ', - 554 => 'ȫ', - 556 => 'ȭ', - 558 => 'ȯ', - 560 => 'ȱ', - 562 => 'ȳ', - 570 => 'ⱥ', - 571 => 'ȼ', - 573 => 'ƚ', - 574 => 'ⱦ', - 577 => 'ɂ', - 579 => 'ƀ', - 580 => 'ʉ', - 581 => 'ʌ', - 582 => 'ɇ', - 584 => 'ɉ', - 586 => 'ɋ', - 588 => 'ɍ', - 590 => 'ɏ', - 688 => 'h', - 689 => 'ɦ', - 690 => 'j', - 691 => 'r', - 692 => 'ɹ', - 693 => 'ɻ', - 694 => 'ʁ', - 695 => 'w', - 696 => 'y', - 736 => 'ɣ', - 737 => 'l', - 738 => 's', - 739 => 'x', - 740 => 'ʕ', - 832 => '̀', - 833 => '́', - 835 => '̓', - 836 => '̈́', - 837 => 'ι', - 880 => 'ͱ', - 882 => 'ͳ', - 884 => 'ʹ', - 886 => 'ͷ', - 895 => 'ϳ', - 902 => 'ά', - 903 => '·', - 904 => 'έ', - 905 => 'ή', - 906 => 'ί', - 908 => 'ό', - 910 => 'ύ', - 911 => 'ώ', - 913 => 'α', - 914 => 'β', - 915 => 'γ', - 916 => 'δ', - 917 => 'ε', - 918 => 'ζ', - 919 => 'η', - 920 => 'θ', - 921 => 'ι', - 922 => 'κ', - 923 => 'λ', - 924 => 'μ', - 925 => 'ν', - 926 => 'ξ', - 927 => 'ο', - 928 => 'π', - 929 => 'ρ', - 931 => 'σ', - 932 => 'τ', - 933 => 'υ', - 934 => 'φ', - 935 => 'χ', - 936 => 'ψ', - 937 => 'ω', - 938 => 'ϊ', - 939 => 'ϋ', - 975 => 'ϗ', - 976 => 'β', - 977 => 'θ', - 978 => 'υ', - 979 => 'ύ', - 980 => 'ϋ', - 981 => 'φ', - 982 => 'π', - 984 => 'ϙ', - 986 => 'ϛ', - 988 => 'ϝ', - 990 => 'ϟ', - 992 => 'ϡ', - 994 => 'ϣ', - 996 => 'ϥ', - 998 => 'ϧ', - 1000 => 'ϩ', - 1002 => 'ϫ', - 1004 => 'ϭ', - 1006 => 'ϯ', - 1008 => 'κ', - 1009 => 'ρ', - 1010 => 'σ', - 1012 => 'θ', - 1013 => 'ε', - 1015 => 'ϸ', - 1017 => 'σ', - 1018 => 'ϻ', - 1021 => 'ͻ', - 1022 => 'ͼ', - 1023 => 'ͽ', - 1024 => 'ѐ', - 1025 => 'ё', - 1026 => 'ђ', - 1027 => 'ѓ', - 1028 => 'є', - 1029 => 'ѕ', - 1030 => 'і', - 1031 => 'ї', - 1032 => 'ј', - 1033 => 'љ', - 1034 => 'њ', - 1035 => 'ћ', - 1036 => 'ќ', - 1037 => 'ѝ', - 1038 => 'ў', - 1039 => 'џ', - 1040 => 'а', - 1041 => 'б', - 1042 => 'в', - 1043 => 'г', - 1044 => 'д', - 1045 => 'е', - 1046 => 'ж', - 1047 => 'з', - 1048 => 'и', - 1049 => 'й', - 1050 => 'к', - 1051 => 'л', - 1052 => 'м', - 1053 => 'н', - 1054 => 'о', - 1055 => 'п', - 1056 => 'р', - 1057 => 'с', - 1058 => 'т', - 1059 => 'у', - 1060 => 'ф', - 1061 => 'х', - 1062 => 'ц', - 1063 => 'ч', - 1064 => 'ш', - 1065 => 'щ', - 1066 => 'ъ', - 1067 => 'ы', - 1068 => 'ь', - 1069 => 'э', - 1070 => 'ю', - 1071 => 'я', - 1120 => 'ѡ', - 1122 => 'ѣ', - 1124 => 'ѥ', - 1126 => 'ѧ', - 1128 => 'ѩ', - 1130 => 'ѫ', - 1132 => 'ѭ', - 1134 => 'ѯ', - 1136 => 'ѱ', - 1138 => 'ѳ', - 1140 => 'ѵ', - 1142 => 'ѷ', - 1144 => 'ѹ', - 1146 => 'ѻ', - 1148 => 'ѽ', - 1150 => 'ѿ', - 1152 => 'ҁ', - 1162 => 'ҋ', - 1164 => 'ҍ', - 1166 => 'ҏ', - 1168 => 'ґ', - 1170 => 'ғ', - 1172 => 'ҕ', - 1174 => 'җ', - 1176 => 'ҙ', - 1178 => 'қ', - 1180 => 'ҝ', - 1182 => 'ҟ', - 1184 => 'ҡ', - 1186 => 'ң', - 1188 => 'ҥ', - 1190 => 'ҧ', - 1192 => 'ҩ', - 1194 => 'ҫ', - 1196 => 'ҭ', - 1198 => 'ү', - 1200 => 'ұ', - 1202 => 'ҳ', - 1204 => 'ҵ', - 1206 => 'ҷ', - 1208 => 'ҹ', - 1210 => 'һ', - 1212 => 'ҽ', - 1214 => 'ҿ', - 1217 => 'ӂ', - 1219 => 'ӄ', - 1221 => 'ӆ', - 1223 => 'ӈ', - 1225 => 'ӊ', - 1227 => 'ӌ', - 1229 => 'ӎ', - 1232 => 'ӑ', - 1234 => 'ӓ', - 1236 => 'ӕ', - 1238 => 'ӗ', - 1240 => 'ә', - 1242 => 'ӛ', - 1244 => 'ӝ', - 1246 => 'ӟ', - 1248 => 'ӡ', - 1250 => 'ӣ', - 1252 => 'ӥ', - 1254 => 'ӧ', - 1256 => 'ө', - 1258 => 'ӫ', - 1260 => 'ӭ', - 1262 => 'ӯ', - 1264 => 'ӱ', - 1266 => 'ӳ', - 1268 => 'ӵ', - 1270 => 'ӷ', - 1272 => 'ӹ', - 1274 => 'ӻ', - 1276 => 'ӽ', - 1278 => 'ӿ', - 1280 => 'ԁ', - 1282 => 'ԃ', - 1284 => 'ԅ', - 1286 => 'ԇ', - 1288 => 'ԉ', - 1290 => 'ԋ', - 1292 => 'ԍ', - 1294 => 'ԏ', - 1296 => 'ԑ', - 1298 => 'ԓ', - 1300 => 'ԕ', - 1302 => 'ԗ', - 1304 => 'ԙ', - 1306 => 'ԛ', - 1308 => 'ԝ', - 1310 => 'ԟ', - 1312 => 'ԡ', - 1314 => 'ԣ', - 1316 => 'ԥ', - 1318 => 'ԧ', - 1320 => 'ԩ', - 1322 => 'ԫ', - 1324 => 'ԭ', - 1326 => 'ԯ', - 1329 => 'ա', - 1330 => 'բ', - 1331 => 'գ', - 1332 => 'դ', - 1333 => 'ե', - 1334 => 'զ', - 1335 => 'է', - 1336 => 'ը', - 1337 => 'թ', - 1338 => 'ժ', - 1339 => 'ի', - 1340 => 'լ', - 1341 => 'խ', - 1342 => 'ծ', - 1343 => 'կ', - 1344 => 'հ', - 1345 => 'ձ', - 1346 => 'ղ', - 1347 => 'ճ', - 1348 => 'մ', - 1349 => 'յ', - 1350 => 'ն', - 1351 => 'շ', - 1352 => 'ո', - 1353 => 'չ', - 1354 => 'պ', - 1355 => 'ջ', - 1356 => 'ռ', - 1357 => 'ս', - 1358 => 'վ', - 1359 => 'տ', - 1360 => 'ր', - 1361 => 'ց', - 1362 => 'ւ', - 1363 => 'փ', - 1364 => 'ք', - 1365 => 'օ', - 1366 => 'ֆ', - 1415 => 'եւ', - 1653 => 'اٴ', - 1654 => 'وٴ', - 1655 => 'ۇٴ', - 1656 => 'يٴ', - 2392 => 'क़', - 2393 => 'ख़', - 2394 => 'ग़', - 2395 => 'ज़', - 2396 => 'ड़', - 2397 => 'ढ़', - 2398 => 'फ़', - 2399 => 'य़', - 2524 => 'ড়', - 2525 => 'ঢ়', - 2527 => 'য়', - 2611 => 'ਲ਼', - 2614 => 'ਸ਼', - 2649 => 'ਖ਼', - 2650 => 'ਗ਼', - 2651 => 'ਜ਼', - 2654 => 'ਫ਼', - 2908 => 'ଡ଼', - 2909 => 'ଢ଼', - 3635 => 'ํา', - 3763 => 'ໍາ', - 3804 => 'ຫນ', - 3805 => 'ຫມ', - 3852 => '་', - 3907 => 'གྷ', - 3917 => 'ཌྷ', - 3922 => 'དྷ', - 3927 => 'བྷ', - 3932 => 'ཛྷ', - 3945 => 'ཀྵ', - 3955 => 'ཱི', - 3957 => 'ཱུ', - 3958 => 'ྲྀ', - 3959 => 'ྲཱྀ', - 3960 => 'ླྀ', - 3961 => 'ླཱྀ', - 3969 => 'ཱྀ', - 3987 => 'ྒྷ', - 3997 => 'ྜྷ', - 4002 => 'ྡྷ', - 4007 => 'ྦྷ', - 4012 => 'ྫྷ', - 4025 => 'ྐྵ', - 4295 => 'ⴧ', - 4301 => 'ⴭ', - 4348 => 'ნ', - 5112 => 'Ᏸ', - 5113 => 'Ᏹ', - 5114 => 'Ᏺ', - 5115 => 'Ᏻ', - 5116 => 'Ᏼ', - 5117 => 'Ᏽ', - 7296 => 'в', - 7297 => 'д', - 7298 => 'о', - 7299 => 'с', - 7300 => 'т', - 7301 => 'т', - 7302 => 'ъ', - 7303 => 'ѣ', - 7304 => 'ꙋ', - 7312 => 'ა', - 7313 => 'ბ', - 7314 => 'გ', - 7315 => 'დ', - 7316 => 'ე', - 7317 => 'ვ', - 7318 => 'ზ', - 7319 => 'თ', - 7320 => 'ი', - 7321 => 'კ', - 7322 => 'ლ', - 7323 => 'მ', - 7324 => 'ნ', - 7325 => 'ო', - 7326 => 'პ', - 7327 => 'ჟ', - 7328 => 'რ', - 7329 => 'ს', - 7330 => 'ტ', - 7331 => 'უ', - 7332 => 'ფ', - 7333 => 'ქ', - 7334 => 'ღ', - 7335 => 'ყ', - 7336 => 'შ', - 7337 => 'ჩ', - 7338 => 'ც', - 7339 => 'ძ', - 7340 => 'წ', - 7341 => 'ჭ', - 7342 => 'ხ', - 7343 => 'ჯ', - 7344 => 'ჰ', - 7345 => 'ჱ', - 7346 => 'ჲ', - 7347 => 'ჳ', - 7348 => 'ჴ', - 7349 => 'ჵ', - 7350 => 'ჶ', - 7351 => 'ჷ', - 7352 => 'ჸ', - 7353 => 'ჹ', - 7354 => 'ჺ', - 7357 => 'ჽ', - 7358 => 'ჾ', - 7359 => 'ჿ', - 7468 => 'a', - 7469 => 'æ', - 7470 => 'b', - 7472 => 'd', - 7473 => 'e', - 7474 => 'ǝ', - 7475 => 'g', - 7476 => 'h', - 7477 => 'i', - 7478 => 'j', - 7479 => 'k', - 7480 => 'l', - 7481 => 'm', - 7482 => 'n', - 7484 => 'o', - 7485 => 'ȣ', - 7486 => 'p', - 7487 => 'r', - 7488 => 't', - 7489 => 'u', - 7490 => 'w', - 7491 => 'a', - 7492 => 'ɐ', - 7493 => 'ɑ', - 7494 => 'ᴂ', - 7495 => 'b', - 7496 => 'd', - 7497 => 'e', - 7498 => 'ə', - 7499 => 'ɛ', - 7500 => 'ɜ', - 7501 => 'g', - 7503 => 'k', - 7504 => 'm', - 7505 => 'ŋ', - 7506 => 'o', - 7507 => 'ɔ', - 7508 => 'ᴖ', - 7509 => 'ᴗ', - 7510 => 'p', - 7511 => 't', - 7512 => 'u', - 7513 => 'ᴝ', - 7514 => 'ɯ', - 7515 => 'v', - 7516 => 'ᴥ', - 7517 => 'β', - 7518 => 'γ', - 7519 => 'δ', - 7520 => 'φ', - 7521 => 'χ', - 7522 => 'i', - 7523 => 'r', - 7524 => 'u', - 7525 => 'v', - 7526 => 'β', - 7527 => 'γ', - 7528 => 'ρ', - 7529 => 'φ', - 7530 => 'χ', - 7544 => 'н', - 7579 => 'ɒ', - 7580 => 'c', - 7581 => 'ɕ', - 7582 => 'ð', - 7583 => 'ɜ', - 7584 => 'f', - 7585 => 'ɟ', - 7586 => 'ɡ', - 7587 => 'ɥ', - 7588 => 'ɨ', - 7589 => 'ɩ', - 7590 => 'ɪ', - 7591 => 'ᵻ', - 7592 => 'ʝ', - 7593 => 'ɭ', - 7594 => 'ᶅ', - 7595 => 'ʟ', - 7596 => 'ɱ', - 7597 => 'ɰ', - 7598 => 'ɲ', - 7599 => 'ɳ', - 7600 => 'ɴ', - 7601 => 'ɵ', - 7602 => 'ɸ', - 7603 => 'ʂ', - 7604 => 'ʃ', - 7605 => 'ƫ', - 7606 => 'ʉ', - 7607 => 'ʊ', - 7608 => 'ᴜ', - 7609 => 'ʋ', - 7610 => 'ʌ', - 7611 => 'z', - 7612 => 'ʐ', - 7613 => 'ʑ', - 7614 => 'ʒ', - 7615 => 'θ', - 7680 => 'ḁ', - 7682 => 'ḃ', - 7684 => 'ḅ', - 7686 => 'ḇ', - 7688 => 'ḉ', - 7690 => 'ḋ', - 7692 => 'ḍ', - 7694 => 'ḏ', - 7696 => 'ḑ', - 7698 => 'ḓ', - 7700 => 'ḕ', - 7702 => 'ḗ', - 7704 => 'ḙ', - 7706 => 'ḛ', - 7708 => 'ḝ', - 7710 => 'ḟ', - 7712 => 'ḡ', - 7714 => 'ḣ', - 7716 => 'ḥ', - 7718 => 'ḧ', - 7720 => 'ḩ', - 7722 => 'ḫ', - 7724 => 'ḭ', - 7726 => 'ḯ', - 7728 => 'ḱ', - 7730 => 'ḳ', - 7732 => 'ḵ', - 7734 => 'ḷ', - 7736 => 'ḹ', - 7738 => 'ḻ', - 7740 => 'ḽ', - 7742 => 'ḿ', - 7744 => 'ṁ', - 7746 => 'ṃ', - 7748 => 'ṅ', - 7750 => 'ṇ', - 7752 => 'ṉ', - 7754 => 'ṋ', - 7756 => 'ṍ', - 7758 => 'ṏ', - 7760 => 'ṑ', - 7762 => 'ṓ', - 7764 => 'ṕ', - 7766 => 'ṗ', - 7768 => 'ṙ', - 7770 => 'ṛ', - 7772 => 'ṝ', - 7774 => 'ṟ', - 7776 => 'ṡ', - 7778 => 'ṣ', - 7780 => 'ṥ', - 7782 => 'ṧ', - 7784 => 'ṩ', - 7786 => 'ṫ', - 7788 => 'ṭ', - 7790 => 'ṯ', - 7792 => 'ṱ', - 7794 => 'ṳ', - 7796 => 'ṵ', - 7798 => 'ṷ', - 7800 => 'ṹ', - 7802 => 'ṻ', - 7804 => 'ṽ', - 7806 => 'ṿ', - 7808 => 'ẁ', - 7810 => 'ẃ', - 7812 => 'ẅ', - 7814 => 'ẇ', - 7816 => 'ẉ', - 7818 => 'ẋ', - 7820 => 'ẍ', - 7822 => 'ẏ', - 7824 => 'ẑ', - 7826 => 'ẓ', - 7828 => 'ẕ', - 7834 => 'aʾ', - 7835 => 'ṡ', - 7838 => 'ss', - 7840 => 'ạ', - 7842 => 'ả', - 7844 => 'ấ', - 7846 => 'ầ', - 7848 => 'ẩ', - 7850 => 'ẫ', - 7852 => 'ậ', - 7854 => 'ắ', - 7856 => 'ằ', - 7858 => 'ẳ', - 7860 => 'ẵ', - 7862 => 'ặ', - 7864 => 'ẹ', - 7866 => 'ẻ', - 7868 => 'ẽ', - 7870 => 'ế', - 7872 => 'ề', - 7874 => 'ể', - 7876 => 'ễ', - 7878 => 'ệ', - 7880 => 'ỉ', - 7882 => 'ị', - 7884 => 'ọ', - 7886 => 'ỏ', - 7888 => 'ố', - 7890 => 'ồ', - 7892 => 'ổ', - 7894 => 'ỗ', - 7896 => 'ộ', - 7898 => 'ớ', - 7900 => 'ờ', - 7902 => 'ở', - 7904 => 'ỡ', - 7906 => 'ợ', - 7908 => 'ụ', - 7910 => 'ủ', - 7912 => 'ứ', - 7914 => 'ừ', - 7916 => 'ử', - 7918 => 'ữ', - 7920 => 'ự', - 7922 => 'ỳ', - 7924 => 'ỵ', - 7926 => 'ỷ', - 7928 => 'ỹ', - 7930 => 'ỻ', - 7932 => 'ỽ', - 7934 => 'ỿ', - 7944 => 'ἀ', - 7945 => 'ἁ', - 7946 => 'ἂ', - 7947 => 'ἃ', - 7948 => 'ἄ', - 7949 => 'ἅ', - 7950 => 'ἆ', - 7951 => 'ἇ', - 7960 => 'ἐ', - 7961 => 'ἑ', - 7962 => 'ἒ', - 7963 => 'ἓ', - 7964 => 'ἔ', - 7965 => 'ἕ', - 7976 => 'ἠ', - 7977 => 'ἡ', - 7978 => 'ἢ', - 7979 => 'ἣ', - 7980 => 'ἤ', - 7981 => 'ἥ', - 7982 => 'ἦ', - 7983 => 'ἧ', - 7992 => 'ἰ', - 7993 => 'ἱ', - 7994 => 'ἲ', - 7995 => 'ἳ', - 7996 => 'ἴ', - 7997 => 'ἵ', - 7998 => 'ἶ', - 7999 => 'ἷ', - 8008 => 'ὀ', - 8009 => 'ὁ', - 8010 => 'ὂ', - 8011 => 'ὃ', - 8012 => 'ὄ', - 8013 => 'ὅ', - 8025 => 'ὑ', - 8027 => 'ὓ', - 8029 => 'ὕ', - 8031 => 'ὗ', - 8040 => 'ὠ', - 8041 => 'ὡ', - 8042 => 'ὢ', - 8043 => 'ὣ', - 8044 => 'ὤ', - 8045 => 'ὥ', - 8046 => 'ὦ', - 8047 => 'ὧ', - 8049 => 'ά', - 8051 => 'έ', - 8053 => 'ή', - 8055 => 'ί', - 8057 => 'ό', - 8059 => 'ύ', - 8061 => 'ώ', - 8064 => 'ἀι', - 8065 => 'ἁι', - 8066 => 'ἂι', - 8067 => 'ἃι', - 8068 => 'ἄι', - 8069 => 'ἅι', - 8070 => 'ἆι', - 8071 => 'ἇι', - 8072 => 'ἀι', - 8073 => 'ἁι', - 8074 => 'ἂι', - 8075 => 'ἃι', - 8076 => 'ἄι', - 8077 => 'ἅι', - 8078 => 'ἆι', - 8079 => 'ἇι', - 8080 => 'ἠι', - 8081 => 'ἡι', - 8082 => 'ἢι', - 8083 => 'ἣι', - 8084 => 'ἤι', - 8085 => 'ἥι', - 8086 => 'ἦι', - 8087 => 'ἧι', - 8088 => 'ἠι', - 8089 => 'ἡι', - 8090 => 'ἢι', - 8091 => 'ἣι', - 8092 => 'ἤι', - 8093 => 'ἥι', - 8094 => 'ἦι', - 8095 => 'ἧι', - 8096 => 'ὠι', - 8097 => 'ὡι', - 8098 => 'ὢι', - 8099 => 'ὣι', - 8100 => 'ὤι', - 8101 => 'ὥι', - 8102 => 'ὦι', - 8103 => 'ὧι', - 8104 => 'ὠι', - 8105 => 'ὡι', - 8106 => 'ὢι', - 8107 => 'ὣι', - 8108 => 'ὤι', - 8109 => 'ὥι', - 8110 => 'ὦι', - 8111 => 'ὧι', - 8114 => 'ὰι', - 8115 => 'αι', - 8116 => 'άι', - 8119 => 'ᾶι', - 8120 => 'ᾰ', - 8121 => 'ᾱ', - 8122 => 'ὰ', - 8123 => 'ά', - 8124 => 'αι', - 8126 => 'ι', - 8130 => 'ὴι', - 8131 => 'ηι', - 8132 => 'ήι', - 8135 => 'ῆι', - 8136 => 'ὲ', - 8137 => 'έ', - 8138 => 'ὴ', - 8139 => 'ή', - 8140 => 'ηι', - 8147 => 'ΐ', - 8152 => 'ῐ', - 8153 => 'ῑ', - 8154 => 'ὶ', - 8155 => 'ί', - 8163 => 'ΰ', - 8168 => 'ῠ', - 8169 => 'ῡ', - 8170 => 'ὺ', - 8171 => 'ύ', - 8172 => 'ῥ', - 8178 => 'ὼι', - 8179 => 'ωι', - 8180 => 'ώι', - 8183 => 'ῶι', - 8184 => 'ὸ', - 8185 => 'ό', - 8186 => 'ὼ', - 8187 => 'ώ', - 8188 => 'ωι', - 8209 => '‐', - 8243 => '′′', - 8244 => '′′′', - 8246 => '‵‵', - 8247 => '‵‵‵', - 8279 => '′′′′', - 8304 => '0', - 8305 => 'i', - 8308 => '4', - 8309 => '5', - 8310 => '6', - 8311 => '7', - 8312 => '8', - 8313 => '9', - 8315 => '−', - 8319 => 'n', - 8320 => '0', - 8321 => '1', - 8322 => '2', - 8323 => '3', - 8324 => '4', - 8325 => '5', - 8326 => '6', - 8327 => '7', - 8328 => '8', - 8329 => '9', - 8331 => '−', - 8336 => 'a', - 8337 => 'e', - 8338 => 'o', - 8339 => 'x', - 8340 => 'ə', - 8341 => 'h', - 8342 => 'k', - 8343 => 'l', - 8344 => 'm', - 8345 => 'n', - 8346 => 'p', - 8347 => 's', - 8348 => 't', - 8360 => 'rs', - 8450 => 'c', - 8451 => '°c', - 8455 => 'ɛ', - 8457 => '°f', - 8458 => 'g', - 8459 => 'h', - 8460 => 'h', - 8461 => 'h', - 8462 => 'h', - 8463 => 'ħ', - 8464 => 'i', - 8465 => 'i', - 8466 => 'l', - 8467 => 'l', - 8469 => 'n', - 8470 => 'no', - 8473 => 'p', - 8474 => 'q', - 8475 => 'r', - 8476 => 'r', - 8477 => 'r', - 8480 => 'sm', - 8481 => 'tel', - 8482 => 'tm', - 8484 => 'z', - 8486 => 'ω', - 8488 => 'z', - 8490 => 'k', - 8491 => 'å', - 8492 => 'b', - 8493 => 'c', - 8495 => 'e', - 8496 => 'e', - 8497 => 'f', - 8499 => 'm', - 8500 => 'o', - 8501 => 'א', - 8502 => 'ב', - 8503 => 'ג', - 8504 => 'ד', - 8505 => 'i', - 8507 => 'fax', - 8508 => 'π', - 8509 => 'γ', - 8510 => 'γ', - 8511 => 'π', - 8512 => '∑', - 8517 => 'd', - 8518 => 'd', - 8519 => 'e', - 8520 => 'i', - 8521 => 'j', - 8528 => '1⁄7', - 8529 => '1⁄9', - 8530 => '1⁄10', - 8531 => '1⁄3', - 8532 => '2⁄3', - 8533 => '1⁄5', - 8534 => '2⁄5', - 8535 => '3⁄5', - 8536 => '4⁄5', - 8537 => '1⁄6', - 8538 => '5⁄6', - 8539 => '1⁄8', - 8540 => '3⁄8', - 8541 => '5⁄8', - 8542 => '7⁄8', - 8543 => '1⁄', - 8544 => 'i', - 8545 => 'ii', - 8546 => 'iii', - 8547 => 'iv', - 8548 => 'v', - 8549 => 'vi', - 8550 => 'vii', - 8551 => 'viii', - 8552 => 'ix', - 8553 => 'x', - 8554 => 'xi', - 8555 => 'xii', - 8556 => 'l', - 8557 => 'c', - 8558 => 'd', - 8559 => 'm', - 8560 => 'i', - 8561 => 'ii', - 8562 => 'iii', - 8563 => 'iv', - 8564 => 'v', - 8565 => 'vi', - 8566 => 'vii', - 8567 => 'viii', - 8568 => 'ix', - 8569 => 'x', - 8570 => 'xi', - 8571 => 'xii', - 8572 => 'l', - 8573 => 'c', - 8574 => 'd', - 8575 => 'm', - 8585 => '0⁄3', - 8748 => '∫∫', - 8749 => '∫∫∫', - 8751 => '∮∮', - 8752 => '∮∮∮', - 9001 => '〈', - 9002 => '〉', - 9312 => '1', - 9313 => '2', - 9314 => '3', - 9315 => '4', - 9316 => '5', - 9317 => '6', - 9318 => '7', - 9319 => '8', - 9320 => '9', - 9321 => '10', - 9322 => '11', - 9323 => '12', - 9324 => '13', - 9325 => '14', - 9326 => '15', - 9327 => '16', - 9328 => '17', - 9329 => '18', - 9330 => '19', - 9331 => '20', - 9398 => 'a', - 9399 => 'b', - 9400 => 'c', - 9401 => 'd', - 9402 => 'e', - 9403 => 'f', - 9404 => 'g', - 9405 => 'h', - 9406 => 'i', - 9407 => 'j', - 9408 => 'k', - 9409 => 'l', - 9410 => 'm', - 9411 => 'n', - 9412 => 'o', - 9413 => 'p', - 9414 => 'q', - 9415 => 'r', - 9416 => 's', - 9417 => 't', - 9418 => 'u', - 9419 => 'v', - 9420 => 'w', - 9421 => 'x', - 9422 => 'y', - 9423 => 'z', - 9424 => 'a', - 9425 => 'b', - 9426 => 'c', - 9427 => 'd', - 9428 => 'e', - 9429 => 'f', - 9430 => 'g', - 9431 => 'h', - 9432 => 'i', - 9433 => 'j', - 9434 => 'k', - 9435 => 'l', - 9436 => 'm', - 9437 => 'n', - 9438 => 'o', - 9439 => 'p', - 9440 => 'q', - 9441 => 'r', - 9442 => 's', - 9443 => 't', - 9444 => 'u', - 9445 => 'v', - 9446 => 'w', - 9447 => 'x', - 9448 => 'y', - 9449 => 'z', - 9450 => '0', - 10764 => '∫∫∫∫', - 10972 => '⫝̸', - 11264 => 'ⰰ', - 11265 => 'ⰱ', - 11266 => 'ⰲ', - 11267 => 'ⰳ', - 11268 => 'ⰴ', - 11269 => 'ⰵ', - 11270 => 'ⰶ', - 11271 => 'ⰷ', - 11272 => 'ⰸ', - 11273 => 'ⰹ', - 11274 => 'ⰺ', - 11275 => 'ⰻ', - 11276 => 'ⰼ', - 11277 => 'ⰽ', - 11278 => 'ⰾ', - 11279 => 'ⰿ', - 11280 => 'ⱀ', - 11281 => 'ⱁ', - 11282 => 'ⱂ', - 11283 => 'ⱃ', - 11284 => 'ⱄ', - 11285 => 'ⱅ', - 11286 => 'ⱆ', - 11287 => 'ⱇ', - 11288 => 'ⱈ', - 11289 => 'ⱉ', - 11290 => 'ⱊ', - 11291 => 'ⱋ', - 11292 => 'ⱌ', - 11293 => 'ⱍ', - 11294 => 'ⱎ', - 11295 => 'ⱏ', - 11296 => 'ⱐ', - 11297 => 'ⱑ', - 11298 => 'ⱒ', - 11299 => 'ⱓ', - 11300 => 'ⱔ', - 11301 => 'ⱕ', - 11302 => 'ⱖ', - 11303 => 'ⱗ', - 11304 => 'ⱘ', - 11305 => 'ⱙ', - 11306 => 'ⱚ', - 11307 => 'ⱛ', - 11308 => 'ⱜ', - 11309 => 'ⱝ', - 11310 => 'ⱞ', - 11360 => 'ⱡ', - 11362 => 'ɫ', - 11363 => 'ᵽ', - 11364 => 'ɽ', - 11367 => 'ⱨ', - 11369 => 'ⱪ', - 11371 => 'ⱬ', - 11373 => 'ɑ', - 11374 => 'ɱ', - 11375 => 'ɐ', - 11376 => 'ɒ', - 11378 => 'ⱳ', - 11381 => 'ⱶ', - 11388 => 'j', - 11389 => 'v', - 11390 => 'ȿ', - 11391 => 'ɀ', - 11392 => 'ⲁ', - 11394 => 'ⲃ', - 11396 => 'ⲅ', - 11398 => 'ⲇ', - 11400 => 'ⲉ', - 11402 => 'ⲋ', - 11404 => 'ⲍ', - 11406 => 'ⲏ', - 11408 => 'ⲑ', - 11410 => 'ⲓ', - 11412 => 'ⲕ', - 11414 => 'ⲗ', - 11416 => 'ⲙ', - 11418 => 'ⲛ', - 11420 => 'ⲝ', - 11422 => 'ⲟ', - 11424 => 'ⲡ', - 11426 => 'ⲣ', - 11428 => 'ⲥ', - 11430 => 'ⲧ', - 11432 => 'ⲩ', - 11434 => 'ⲫ', - 11436 => 'ⲭ', - 11438 => 'ⲯ', - 11440 => 'ⲱ', - 11442 => 'ⲳ', - 11444 => 'ⲵ', - 11446 => 'ⲷ', - 11448 => 'ⲹ', - 11450 => 'ⲻ', - 11452 => 'ⲽ', - 11454 => 'ⲿ', - 11456 => 'ⳁ', - 11458 => 'ⳃ', - 11460 => 'ⳅ', - 11462 => 'ⳇ', - 11464 => 'ⳉ', - 11466 => 'ⳋ', - 11468 => 'ⳍ', - 11470 => 'ⳏ', - 11472 => 'ⳑ', - 11474 => 'ⳓ', - 11476 => 'ⳕ', - 11478 => 'ⳗ', - 11480 => 'ⳙ', - 11482 => 'ⳛ', - 11484 => 'ⳝ', - 11486 => 'ⳟ', - 11488 => 'ⳡ', - 11490 => 'ⳣ', - 11499 => 'ⳬ', - 11501 => 'ⳮ', - 11506 => 'ⳳ', - 11631 => 'ⵡ', - 11935 => '母', - 12019 => '龟', - 12032 => '一', - 12033 => '丨', - 12034 => '丶', - 12035 => '丿', - 12036 => '乙', - 12037 => '亅', - 12038 => '二', - 12039 => '亠', - 12040 => '人', - 12041 => '儿', - 12042 => '入', - 12043 => '八', - 12044 => '冂', - 12045 => '冖', - 12046 => '冫', - 12047 => '几', - 12048 => '凵', - 12049 => '刀', - 12050 => '力', - 12051 => '勹', - 12052 => '匕', - 12053 => '匚', - 12054 => '匸', - 12055 => '十', - 12056 => '卜', - 12057 => '卩', - 12058 => '厂', - 12059 => '厶', - 12060 => '又', - 12061 => '口', - 12062 => '囗', - 12063 => '土', - 12064 => '士', - 12065 => '夂', - 12066 => '夊', - 12067 => '夕', - 12068 => '大', - 12069 => '女', - 12070 => '子', - 12071 => '宀', - 12072 => '寸', - 12073 => '小', - 12074 => '尢', - 12075 => '尸', - 12076 => '屮', - 12077 => '山', - 12078 => '巛', - 12079 => '工', - 12080 => '己', - 12081 => '巾', - 12082 => '干', - 12083 => '幺', - 12084 => '广', - 12085 => '廴', - 12086 => '廾', - 12087 => '弋', - 12088 => '弓', - 12089 => '彐', - 12090 => '彡', - 12091 => '彳', - 12092 => '心', - 12093 => '戈', - 12094 => '戶', - 12095 => '手', - 12096 => '支', - 12097 => '攴', - 12098 => '文', - 12099 => '斗', - 12100 => '斤', - 12101 => '方', - 12102 => '无', - 12103 => '日', - 12104 => '曰', - 12105 => '月', - 12106 => '木', - 12107 => '欠', - 12108 => '止', - 12109 => '歹', - 12110 => '殳', - 12111 => '毋', - 12112 => '比', - 12113 => '毛', - 12114 => '氏', - 12115 => '气', - 12116 => '水', - 12117 => '火', - 12118 => '爪', - 12119 => '父', - 12120 => '爻', - 12121 => '爿', - 12122 => '片', - 12123 => '牙', - 12124 => '牛', - 12125 => '犬', - 12126 => '玄', - 12127 => '玉', - 12128 => '瓜', - 12129 => '瓦', - 12130 => '甘', - 12131 => '生', - 12132 => '用', - 12133 => '田', - 12134 => '疋', - 12135 => '疒', - 12136 => '癶', - 12137 => '白', - 12138 => '皮', - 12139 => '皿', - 12140 => '目', - 12141 => '矛', - 12142 => '矢', - 12143 => '石', - 12144 => '示', - 12145 => '禸', - 12146 => '禾', - 12147 => '穴', - 12148 => '立', - 12149 => '竹', - 12150 => '米', - 12151 => '糸', - 12152 => '缶', - 12153 => '网', - 12154 => '羊', - 12155 => '羽', - 12156 => '老', - 12157 => '而', - 12158 => '耒', - 12159 => '耳', - 12160 => '聿', - 12161 => '肉', - 12162 => '臣', - 12163 => '自', - 12164 => '至', - 12165 => '臼', - 12166 => '舌', - 12167 => '舛', - 12168 => '舟', - 12169 => '艮', - 12170 => '色', - 12171 => '艸', - 12172 => '虍', - 12173 => '虫', - 12174 => '血', - 12175 => '行', - 12176 => '衣', - 12177 => '襾', - 12178 => '見', - 12179 => '角', - 12180 => '言', - 12181 => '谷', - 12182 => '豆', - 12183 => '豕', - 12184 => '豸', - 12185 => '貝', - 12186 => '赤', - 12187 => '走', - 12188 => '足', - 12189 => '身', - 12190 => '車', - 12191 => '辛', - 12192 => '辰', - 12193 => '辵', - 12194 => '邑', - 12195 => '酉', - 12196 => '釆', - 12197 => '里', - 12198 => '金', - 12199 => '長', - 12200 => '門', - 12201 => '阜', - 12202 => '隶', - 12203 => '隹', - 12204 => '雨', - 12205 => '靑', - 12206 => '非', - 12207 => '面', - 12208 => '革', - 12209 => '韋', - 12210 => '韭', - 12211 => '音', - 12212 => '頁', - 12213 => '風', - 12214 => '飛', - 12215 => '食', - 12216 => '首', - 12217 => '香', - 12218 => '馬', - 12219 => '骨', - 12220 => '高', - 12221 => '髟', - 12222 => '鬥', - 12223 => '鬯', - 12224 => '鬲', - 12225 => '鬼', - 12226 => '魚', - 12227 => '鳥', - 12228 => '鹵', - 12229 => '鹿', - 12230 => '麥', - 12231 => '麻', - 12232 => '黃', - 12233 => '黍', - 12234 => '黑', - 12235 => '黹', - 12236 => '黽', - 12237 => '鼎', - 12238 => '鼓', - 12239 => '鼠', - 12240 => '鼻', - 12241 => '齊', - 12242 => '齒', - 12243 => '龍', - 12244 => '龜', - 12245 => '龠', - 12290 => '.', - 12342 => '〒', - 12344 => '十', - 12345 => '卄', - 12346 => '卅', - 12447 => 'より', - 12543 => 'コト', - 12593 => 'ᄀ', - 12594 => 'ᄁ', - 12595 => 'ᆪ', - 12596 => 'ᄂ', - 12597 => 'ᆬ', - 12598 => 'ᆭ', - 12599 => 'ᄃ', - 12600 => 'ᄄ', - 12601 => 'ᄅ', - 12602 => 'ᆰ', - 12603 => 'ᆱ', - 12604 => 'ᆲ', - 12605 => 'ᆳ', - 12606 => 'ᆴ', - 12607 => 'ᆵ', - 12608 => 'ᄚ', - 12609 => 'ᄆ', - 12610 => 'ᄇ', - 12611 => 'ᄈ', - 12612 => 'ᄡ', - 12613 => 'ᄉ', - 12614 => 'ᄊ', - 12615 => 'ᄋ', - 12616 => 'ᄌ', - 12617 => 'ᄍ', - 12618 => 'ᄎ', - 12619 => 'ᄏ', - 12620 => 'ᄐ', - 12621 => 'ᄑ', - 12622 => 'ᄒ', - 12623 => 'ᅡ', - 12624 => 'ᅢ', - 12625 => 'ᅣ', - 12626 => 'ᅤ', - 12627 => 'ᅥ', - 12628 => 'ᅦ', - 12629 => 'ᅧ', - 12630 => 'ᅨ', - 12631 => 'ᅩ', - 12632 => 'ᅪ', - 12633 => 'ᅫ', - 12634 => 'ᅬ', - 12635 => 'ᅭ', - 12636 => 'ᅮ', - 12637 => 'ᅯ', - 12638 => 'ᅰ', - 12639 => 'ᅱ', - 12640 => 'ᅲ', - 12641 => 'ᅳ', - 12642 => 'ᅴ', - 12643 => 'ᅵ', - 12645 => 'ᄔ', - 12646 => 'ᄕ', - 12647 => 'ᇇ', - 12648 => 'ᇈ', - 12649 => 'ᇌ', - 12650 => 'ᇎ', - 12651 => 'ᇓ', - 12652 => 'ᇗ', - 12653 => 'ᇙ', - 12654 => 'ᄜ', - 12655 => 'ᇝ', - 12656 => 'ᇟ', - 12657 => 'ᄝ', - 12658 => 'ᄞ', - 12659 => 'ᄠ', - 12660 => 'ᄢ', - 12661 => 'ᄣ', - 12662 => 'ᄧ', - 12663 => 'ᄩ', - 12664 => 'ᄫ', - 12665 => 'ᄬ', - 12666 => 'ᄭ', - 12667 => 'ᄮ', - 12668 => 'ᄯ', - 12669 => 'ᄲ', - 12670 => 'ᄶ', - 12671 => 'ᅀ', - 12672 => 'ᅇ', - 12673 => 'ᅌ', - 12674 => 'ᇱ', - 12675 => 'ᇲ', - 12676 => 'ᅗ', - 12677 => 'ᅘ', - 12678 => 'ᅙ', - 12679 => 'ᆄ', - 12680 => 'ᆅ', - 12681 => 'ᆈ', - 12682 => 'ᆑ', - 12683 => 'ᆒ', - 12684 => 'ᆔ', - 12685 => 'ᆞ', - 12686 => 'ᆡ', - 12690 => '一', - 12691 => '二', - 12692 => '三', - 12693 => '四', - 12694 => '上', - 12695 => '中', - 12696 => '下', - 12697 => '甲', - 12698 => '乙', - 12699 => '丙', - 12700 => '丁', - 12701 => '天', - 12702 => '地', - 12703 => '人', - 12868 => '問', - 12869 => '幼', - 12870 => '文', - 12871 => '箏', - 12880 => 'pte', - 12881 => '21', - 12882 => '22', - 12883 => '23', - 12884 => '24', - 12885 => '25', - 12886 => '26', - 12887 => '27', - 12888 => '28', - 12889 => '29', - 12890 => '30', - 12891 => '31', - 12892 => '32', - 12893 => '33', - 12894 => '34', - 12895 => '35', - 12896 => 'ᄀ', - 12897 => 'ᄂ', - 12898 => 'ᄃ', - 12899 => 'ᄅ', - 12900 => 'ᄆ', - 12901 => 'ᄇ', - 12902 => 'ᄉ', - 12903 => 'ᄋ', - 12904 => 'ᄌ', - 12905 => 'ᄎ', - 12906 => 'ᄏ', - 12907 => 'ᄐ', - 12908 => 'ᄑ', - 12909 => 'ᄒ', - 12910 => '가', - 12911 => '나', - 12912 => '다', - 12913 => '라', - 12914 => '마', - 12915 => '바', - 12916 => '사', - 12917 => '아', - 12918 => '자', - 12919 => '차', - 12920 => '카', - 12921 => '타', - 12922 => '파', - 12923 => '하', - 12924 => '참고', - 12925 => '주의', - 12926 => '우', - 12928 => '一', - 12929 => '二', - 12930 => '三', - 12931 => '四', - 12932 => '五', - 12933 => '六', - 12934 => '七', - 12935 => '八', - 12936 => '九', - 12937 => '十', - 12938 => '月', - 12939 => '火', - 12940 => '水', - 12941 => '木', - 12942 => '金', - 12943 => '土', - 12944 => '日', - 12945 => '株', - 12946 => '有', - 12947 => '社', - 12948 => '名', - 12949 => '特', - 12950 => '財', - 12951 => '祝', - 12952 => '労', - 12953 => '秘', - 12954 => '男', - 12955 => '女', - 12956 => '適', - 12957 => '優', - 12958 => '印', - 12959 => '注', - 12960 => '項', - 12961 => '休', - 12962 => '写', - 12963 => '正', - 12964 => '上', - 12965 => '中', - 12966 => '下', - 12967 => '左', - 12968 => '右', - 12969 => '医', - 12970 => '宗', - 12971 => '学', - 12972 => '監', - 12973 => '企', - 12974 => '資', - 12975 => '協', - 12976 => '夜', - 12977 => '36', - 12978 => '37', - 12979 => '38', - 12980 => '39', - 12981 => '40', - 12982 => '41', - 12983 => '42', - 12984 => '43', - 12985 => '44', - 12986 => '45', - 12987 => '46', - 12988 => '47', - 12989 => '48', - 12990 => '49', - 12991 => '50', - 12992 => '1月', - 12993 => '2月', - 12994 => '3月', - 12995 => '4月', - 12996 => '5月', - 12997 => '6月', - 12998 => '7月', - 12999 => '8月', - 13000 => '9月', - 13001 => '10月', - 13002 => '11月', - 13003 => '12月', - 13004 => 'hg', - 13005 => 'erg', - 13006 => 'ev', - 13007 => 'ltd', - 13008 => 'ア', - 13009 => 'イ', - 13010 => 'ウ', - 13011 => 'エ', - 13012 => 'オ', - 13013 => 'カ', - 13014 => 'キ', - 13015 => 'ク', - 13016 => 'ケ', - 13017 => 'コ', - 13018 => 'サ', - 13019 => 'シ', - 13020 => 'ス', - 13021 => 'セ', - 13022 => 'ソ', - 13023 => 'タ', - 13024 => 'チ', - 13025 => 'ツ', - 13026 => 'テ', - 13027 => 'ト', - 13028 => 'ナ', - 13029 => 'ニ', - 13030 => 'ヌ', - 13031 => 'ネ', - 13032 => 'ノ', - 13033 => 'ハ', - 13034 => 'ヒ', - 13035 => 'フ', - 13036 => 'ヘ', - 13037 => 'ホ', - 13038 => 'マ', - 13039 => 'ミ', - 13040 => 'ム', - 13041 => 'メ', - 13042 => 'モ', - 13043 => 'ヤ', - 13044 => 'ユ', - 13045 => 'ヨ', - 13046 => 'ラ', - 13047 => 'リ', - 13048 => 'ル', - 13049 => 'レ', - 13050 => 'ロ', - 13051 => 'ワ', - 13052 => 'ヰ', - 13053 => 'ヱ', - 13054 => 'ヲ', - 13055 => '令和', - 13056 => 'アパート', - 13057 => 'アルファ', - 13058 => 'アンペア', - 13059 => 'アール', - 13060 => 'イニング', - 13061 => 'インチ', - 13062 => 'ウォン', - 13063 => 'エスクード', - 13064 => 'エーカー', - 13065 => 'オンス', - 13066 => 'オーム', - 13067 => 'カイリ', - 13068 => 'カラット', - 13069 => 'カロリー', - 13070 => 'ガロン', - 13071 => 'ガンマ', - 13072 => 'ギガ', - 13073 => 'ギニー', - 13074 => 'キュリー', - 13075 => 'ギルダー', - 13076 => 'キロ', - 13077 => 'キログラム', - 13078 => 'キロメートル', - 13079 => 'キロワット', - 13080 => 'グラム', - 13081 => 'グラムトン', - 13082 => 'クルゼイロ', - 13083 => 'クローネ', - 13084 => 'ケース', - 13085 => 'コルナ', - 13086 => 'コーポ', - 13087 => 'サイクル', - 13088 => 'サンチーム', - 13089 => 'シリング', - 13090 => 'センチ', - 13091 => 'セント', - 13092 => 'ダース', - 13093 => 'デシ', - 13094 => 'ドル', - 13095 => 'トン', - 13096 => 'ナノ', - 13097 => 'ノット', - 13098 => 'ハイツ', - 13099 => 'パーセント', - 13100 => 'パーツ', - 13101 => 'バーレル', - 13102 => 'ピアストル', - 13103 => 'ピクル', - 13104 => 'ピコ', - 13105 => 'ビル', - 13106 => 'ファラッド', - 13107 => 'フィート', - 13108 => 'ブッシェル', - 13109 => 'フラン', - 13110 => 'ヘクタール', - 13111 => 'ペソ', - 13112 => 'ペニヒ', - 13113 => 'ヘルツ', - 13114 => 'ペンス', - 13115 => 'ページ', - 13116 => 'ベータ', - 13117 => 'ポイント', - 13118 => 'ボルト', - 13119 => 'ホン', - 13120 => 'ポンド', - 13121 => 'ホール', - 13122 => 'ホーン', - 13123 => 'マイクロ', - 13124 => 'マイル', - 13125 => 'マッハ', - 13126 => 'マルク', - 13127 => 'マンション', - 13128 => 'ミクロン', - 13129 => 'ミリ', - 13130 => 'ミリバール', - 13131 => 'メガ', - 13132 => 'メガトン', - 13133 => 'メートル', - 13134 => 'ヤード', - 13135 => 'ヤール', - 13136 => 'ユアン', - 13137 => 'リットル', - 13138 => 'リラ', - 13139 => 'ルピー', - 13140 => 'ルーブル', - 13141 => 'レム', - 13142 => 'レントゲン', - 13143 => 'ワット', - 13144 => '0点', - 13145 => '1点', - 13146 => '2点', - 13147 => '3点', - 13148 => '4点', - 13149 => '5点', - 13150 => '6点', - 13151 => '7点', - 13152 => '8点', - 13153 => '9点', - 13154 => '10点', - 13155 => '11点', - 13156 => '12点', - 13157 => '13点', - 13158 => '14点', - 13159 => '15点', - 13160 => '16点', - 13161 => '17点', - 13162 => '18点', - 13163 => '19点', - 13164 => '20点', - 13165 => '21点', - 13166 => '22点', - 13167 => '23点', - 13168 => '24点', - 13169 => 'hpa', - 13170 => 'da', - 13171 => 'au', - 13172 => 'bar', - 13173 => 'ov', - 13174 => 'pc', - 13175 => 'dm', - 13176 => 'dm2', - 13177 => 'dm3', - 13178 => 'iu', - 13179 => '平成', - 13180 => '昭和', - 13181 => '大正', - 13182 => '明治', - 13183 => '株式会社', - 13184 => 'pa', - 13185 => 'na', - 13186 => 'μa', - 13187 => 'ma', - 13188 => 'ka', - 13189 => 'kb', - 13190 => 'mb', - 13191 => 'gb', - 13192 => 'cal', - 13193 => 'kcal', - 13194 => 'pf', - 13195 => 'nf', - 13196 => 'μf', - 13197 => 'μg', - 13198 => 'mg', - 13199 => 'kg', - 13200 => 'hz', - 13201 => 'khz', - 13202 => 'mhz', - 13203 => 'ghz', - 13204 => 'thz', - 13205 => 'μl', - 13206 => 'ml', - 13207 => 'dl', - 13208 => 'kl', - 13209 => 'fm', - 13210 => 'nm', - 13211 => 'μm', - 13212 => 'mm', - 13213 => 'cm', - 13214 => 'km', - 13215 => 'mm2', - 13216 => 'cm2', - 13217 => 'm2', - 13218 => 'km2', - 13219 => 'mm3', - 13220 => 'cm3', - 13221 => 'm3', - 13222 => 'km3', - 13223 => 'm∕s', - 13224 => 'm∕s2', - 13225 => 'pa', - 13226 => 'kpa', - 13227 => 'mpa', - 13228 => 'gpa', - 13229 => 'rad', - 13230 => 'rad∕s', - 13231 => 'rad∕s2', - 13232 => 'ps', - 13233 => 'ns', - 13234 => 'μs', - 13235 => 'ms', - 13236 => 'pv', - 13237 => 'nv', - 13238 => 'μv', - 13239 => 'mv', - 13240 => 'kv', - 13241 => 'mv', - 13242 => 'pw', - 13243 => 'nw', - 13244 => 'μw', - 13245 => 'mw', - 13246 => 'kw', - 13247 => 'mw', - 13248 => 'kω', - 13249 => 'mω', - 13251 => 'bq', - 13252 => 'cc', - 13253 => 'cd', - 13254 => 'c∕kg', - 13256 => 'db', - 13257 => 'gy', - 13258 => 'ha', - 13259 => 'hp', - 13260 => 'in', - 13261 => 'kk', - 13262 => 'km', - 13263 => 'kt', - 13264 => 'lm', - 13265 => 'ln', - 13266 => 'log', - 13267 => 'lx', - 13268 => 'mb', - 13269 => 'mil', - 13270 => 'mol', - 13271 => 'ph', - 13273 => 'ppm', - 13274 => 'pr', - 13275 => 'sr', - 13276 => 'sv', - 13277 => 'wb', - 13278 => 'v∕m', - 13279 => 'a∕m', - 13280 => '1日', - 13281 => '2日', - 13282 => '3日', - 13283 => '4日', - 13284 => '5日', - 13285 => '6日', - 13286 => '7日', - 13287 => '8日', - 13288 => '9日', - 13289 => '10日', - 13290 => '11日', - 13291 => '12日', - 13292 => '13日', - 13293 => '14日', - 13294 => '15日', - 13295 => '16日', - 13296 => '17日', - 13297 => '18日', - 13298 => '19日', - 13299 => '20日', - 13300 => '21日', - 13301 => '22日', - 13302 => '23日', - 13303 => '24日', - 13304 => '25日', - 13305 => '26日', - 13306 => '27日', - 13307 => '28日', - 13308 => '29日', - 13309 => '30日', - 13310 => '31日', - 13311 => 'gal', - 42560 => 'ꙁ', - 42562 => 'ꙃ', - 42564 => 'ꙅ', - 42566 => 'ꙇ', - 42568 => 'ꙉ', - 42570 => 'ꙋ', - 42572 => 'ꙍ', - 42574 => 'ꙏ', - 42576 => 'ꙑ', - 42578 => 'ꙓ', - 42580 => 'ꙕ', - 42582 => 'ꙗ', - 42584 => 'ꙙ', - 42586 => 'ꙛ', - 42588 => 'ꙝ', - 42590 => 'ꙟ', - 42592 => 'ꙡ', - 42594 => 'ꙣ', - 42596 => 'ꙥ', - 42598 => 'ꙧ', - 42600 => 'ꙩ', - 42602 => 'ꙫ', - 42604 => 'ꙭ', - 42624 => 'ꚁ', - 42626 => 'ꚃ', - 42628 => 'ꚅ', - 42630 => 'ꚇ', - 42632 => 'ꚉ', - 42634 => 'ꚋ', - 42636 => 'ꚍ', - 42638 => 'ꚏ', - 42640 => 'ꚑ', - 42642 => 'ꚓ', - 42644 => 'ꚕ', - 42646 => 'ꚗ', - 42648 => 'ꚙ', - 42650 => 'ꚛ', - 42652 => 'ъ', - 42653 => 'ь', - 42786 => 'ꜣ', - 42788 => 'ꜥ', - 42790 => 'ꜧ', - 42792 => 'ꜩ', - 42794 => 'ꜫ', - 42796 => 'ꜭ', - 42798 => 'ꜯ', - 42802 => 'ꜳ', - 42804 => 'ꜵ', - 42806 => 'ꜷ', - 42808 => 'ꜹ', - 42810 => 'ꜻ', - 42812 => 'ꜽ', - 42814 => 'ꜿ', - 42816 => 'ꝁ', - 42818 => 'ꝃ', - 42820 => 'ꝅ', - 42822 => 'ꝇ', - 42824 => 'ꝉ', - 42826 => 'ꝋ', - 42828 => 'ꝍ', - 42830 => 'ꝏ', - 42832 => 'ꝑ', - 42834 => 'ꝓ', - 42836 => 'ꝕ', - 42838 => 'ꝗ', - 42840 => 'ꝙ', - 42842 => 'ꝛ', - 42844 => 'ꝝ', - 42846 => 'ꝟ', - 42848 => 'ꝡ', - 42850 => 'ꝣ', - 42852 => 'ꝥ', - 42854 => 'ꝧ', - 42856 => 'ꝩ', - 42858 => 'ꝫ', - 42860 => 'ꝭ', - 42862 => 'ꝯ', - 42864 => 'ꝯ', - 42873 => 'ꝺ', - 42875 => 'ꝼ', - 42877 => 'ᵹ', - 42878 => 'ꝿ', - 42880 => 'ꞁ', - 42882 => 'ꞃ', - 42884 => 'ꞅ', - 42886 => 'ꞇ', - 42891 => 'ꞌ', - 42893 => 'ɥ', - 42896 => 'ꞑ', - 42898 => 'ꞓ', - 42902 => 'ꞗ', - 42904 => 'ꞙ', - 42906 => 'ꞛ', - 42908 => 'ꞝ', - 42910 => 'ꞟ', - 42912 => 'ꞡ', - 42914 => 'ꞣ', - 42916 => 'ꞥ', - 42918 => 'ꞧ', - 42920 => 'ꞩ', - 42922 => 'ɦ', - 42923 => 'ɜ', - 42924 => 'ɡ', - 42925 => 'ɬ', - 42926 => 'ɪ', - 42928 => 'ʞ', - 42929 => 'ʇ', - 42930 => 'ʝ', - 42931 => 'ꭓ', - 42932 => 'ꞵ', - 42934 => 'ꞷ', - 42936 => 'ꞹ', - 42938 => 'ꞻ', - 42940 => 'ꞽ', - 42942 => 'ꞿ', - 42946 => 'ꟃ', - 42948 => 'ꞔ', - 42949 => 'ʂ', - 42950 => 'ᶎ', - 42951 => 'ꟈ', - 42953 => 'ꟊ', - 42997 => 'ꟶ', - 43000 => 'ħ', - 43001 => 'œ', - 43868 => 'ꜧ', - 43869 => 'ꬷ', - 43870 => 'ɫ', - 43871 => 'ꭒ', - 43881 => 'ʍ', - 43888 => 'Ꭰ', - 43889 => 'Ꭱ', - 43890 => 'Ꭲ', - 43891 => 'Ꭳ', - 43892 => 'Ꭴ', - 43893 => 'Ꭵ', - 43894 => 'Ꭶ', - 43895 => 'Ꭷ', - 43896 => 'Ꭸ', - 43897 => 'Ꭹ', - 43898 => 'Ꭺ', - 43899 => 'Ꭻ', - 43900 => 'Ꭼ', - 43901 => 'Ꭽ', - 43902 => 'Ꭾ', - 43903 => 'Ꭿ', - 43904 => 'Ꮀ', - 43905 => 'Ꮁ', - 43906 => 'Ꮂ', - 43907 => 'Ꮃ', - 43908 => 'Ꮄ', - 43909 => 'Ꮅ', - 43910 => 'Ꮆ', - 43911 => 'Ꮇ', - 43912 => 'Ꮈ', - 43913 => 'Ꮉ', - 43914 => 'Ꮊ', - 43915 => 'Ꮋ', - 43916 => 'Ꮌ', - 43917 => 'Ꮍ', - 43918 => 'Ꮎ', - 43919 => 'Ꮏ', - 43920 => 'Ꮐ', - 43921 => 'Ꮑ', - 43922 => 'Ꮒ', - 43923 => 'Ꮓ', - 43924 => 'Ꮔ', - 43925 => 'Ꮕ', - 43926 => 'Ꮖ', - 43927 => 'Ꮗ', - 43928 => 'Ꮘ', - 43929 => 'Ꮙ', - 43930 => 'Ꮚ', - 43931 => 'Ꮛ', - 43932 => 'Ꮜ', - 43933 => 'Ꮝ', - 43934 => 'Ꮞ', - 43935 => 'Ꮟ', - 43936 => 'Ꮠ', - 43937 => 'Ꮡ', - 43938 => 'Ꮢ', - 43939 => 'Ꮣ', - 43940 => 'Ꮤ', - 43941 => 'Ꮥ', - 43942 => 'Ꮦ', - 43943 => 'Ꮧ', - 43944 => 'Ꮨ', - 43945 => 'Ꮩ', - 43946 => 'Ꮪ', - 43947 => 'Ꮫ', - 43948 => 'Ꮬ', - 43949 => 'Ꮭ', - 43950 => 'Ꮮ', - 43951 => 'Ꮯ', - 43952 => 'Ꮰ', - 43953 => 'Ꮱ', - 43954 => 'Ꮲ', - 43955 => 'Ꮳ', - 43956 => 'Ꮴ', - 43957 => 'Ꮵ', - 43958 => 'Ꮶ', - 43959 => 'Ꮷ', - 43960 => 'Ꮸ', - 43961 => 'Ꮹ', - 43962 => 'Ꮺ', - 43963 => 'Ꮻ', - 43964 => 'Ꮼ', - 43965 => 'Ꮽ', - 43966 => 'Ꮾ', - 43967 => 'Ꮿ', - 63744 => '豈', - 63745 => '更', - 63746 => '車', - 63747 => '賈', - 63748 => '滑', - 63749 => '串', - 63750 => '句', - 63751 => '龜', - 63752 => '龜', - 63753 => '契', - 63754 => '金', - 63755 => '喇', - 63756 => '奈', - 63757 => '懶', - 63758 => '癩', - 63759 => '羅', - 63760 => '蘿', - 63761 => '螺', - 63762 => '裸', - 63763 => '邏', - 63764 => '樂', - 63765 => '洛', - 63766 => '烙', - 63767 => '珞', - 63768 => '落', - 63769 => '酪', - 63770 => '駱', - 63771 => '亂', - 63772 => '卵', - 63773 => '欄', - 63774 => '爛', - 63775 => '蘭', - 63776 => '鸞', - 63777 => '嵐', - 63778 => '濫', - 63779 => '藍', - 63780 => '襤', - 63781 => '拉', - 63782 => '臘', - 63783 => '蠟', - 63784 => '廊', - 63785 => '朗', - 63786 => '浪', - 63787 => '狼', - 63788 => '郎', - 63789 => '來', - 63790 => '冷', - 63791 => '勞', - 63792 => '擄', - 63793 => '櫓', - 63794 => '爐', - 63795 => '盧', - 63796 => '老', - 63797 => '蘆', - 63798 => '虜', - 63799 => '路', - 63800 => '露', - 63801 => '魯', - 63802 => '鷺', - 63803 => '碌', - 63804 => '祿', - 63805 => '綠', - 63806 => '菉', - 63807 => '錄', - 63808 => '鹿', - 63809 => '論', - 63810 => '壟', - 63811 => '弄', - 63812 => '籠', - 63813 => '聾', - 63814 => '牢', - 63815 => '磊', - 63816 => '賂', - 63817 => '雷', - 63818 => '壘', - 63819 => '屢', - 63820 => '樓', - 63821 => '淚', - 63822 => '漏', - 63823 => '累', - 63824 => '縷', - 63825 => '陋', - 63826 => '勒', - 63827 => '肋', - 63828 => '凜', - 63829 => '凌', - 63830 => '稜', - 63831 => '綾', - 63832 => '菱', - 63833 => '陵', - 63834 => '讀', - 63835 => '拏', - 63836 => '樂', - 63837 => '諾', - 63838 => '丹', - 63839 => '寧', - 63840 => '怒', - 63841 => '率', - 63842 => '異', - 63843 => '北', - 63844 => '磻', - 63845 => '便', - 63846 => '復', - 63847 => '不', - 63848 => '泌', - 63849 => '數', - 63850 => '索', - 63851 => '參', - 63852 => '塞', - 63853 => '省', - 63854 => '葉', - 63855 => '說', - 63856 => '殺', - 63857 => '辰', - 63858 => '沈', - 63859 => '拾', - 63860 => '若', - 63861 => '掠', - 63862 => '略', - 63863 => '亮', - 63864 => '兩', - 63865 => '凉', - 63866 => '梁', - 63867 => '糧', - 63868 => '良', - 63869 => '諒', - 63870 => '量', - 63871 => '勵', - 63872 => '呂', - 63873 => '女', - 63874 => '廬', - 63875 => '旅', - 63876 => '濾', - 63877 => '礪', - 63878 => '閭', - 63879 => '驪', - 63880 => '麗', - 63881 => '黎', - 63882 => '力', - 63883 => '曆', - 63884 => '歷', - 63885 => '轢', - 63886 => '年', - 63887 => '憐', - 63888 => '戀', - 63889 => '撚', - 63890 => '漣', - 63891 => '煉', - 63892 => '璉', - 63893 => '秊', - 63894 => '練', - 63895 => '聯', - 63896 => '輦', - 63897 => '蓮', - 63898 => '連', - 63899 => '鍊', - 63900 => '列', - 63901 => '劣', - 63902 => '咽', - 63903 => '烈', - 63904 => '裂', - 63905 => '說', - 63906 => '廉', - 63907 => '念', - 63908 => '捻', - 63909 => '殮', - 63910 => '簾', - 63911 => '獵', - 63912 => '令', - 63913 => '囹', - 63914 => '寧', - 63915 => '嶺', - 63916 => '怜', - 63917 => '玲', - 63918 => '瑩', - 63919 => '羚', - 63920 => '聆', - 63921 => '鈴', - 63922 => '零', - 63923 => '靈', - 63924 => '領', - 63925 => '例', - 63926 => '禮', - 63927 => '醴', - 63928 => '隸', - 63929 => '惡', - 63930 => '了', - 63931 => '僚', - 63932 => '寮', - 63933 => '尿', - 63934 => '料', - 63935 => '樂', - 63936 => '燎', - 63937 => '療', - 63938 => '蓼', - 63939 => '遼', - 63940 => '龍', - 63941 => '暈', - 63942 => '阮', - 63943 => '劉', - 63944 => '杻', - 63945 => '柳', - 63946 => '流', - 63947 => '溜', - 63948 => '琉', - 63949 => '留', - 63950 => '硫', - 63951 => '紐', - 63952 => '類', - 63953 => '六', - 63954 => '戮', - 63955 => '陸', - 63956 => '倫', - 63957 => '崙', - 63958 => '淪', - 63959 => '輪', - 63960 => '律', - 63961 => '慄', - 63962 => '栗', - 63963 => '率', - 63964 => '隆', - 63965 => '利', - 63966 => '吏', - 63967 => '履', - 63968 => '易', - 63969 => '李', - 63970 => '梨', - 63971 => '泥', - 63972 => '理', - 63973 => '痢', - 63974 => '罹', - 63975 => '裏', - 63976 => '裡', - 63977 => '里', - 63978 => '離', - 63979 => '匿', - 63980 => '溺', - 63981 => '吝', - 63982 => '燐', - 63983 => '璘', - 63984 => '藺', - 63985 => '隣', - 63986 => '鱗', - 63987 => '麟', - 63988 => '林', - 63989 => '淋', - 63990 => '臨', - 63991 => '立', - 63992 => '笠', - 63993 => '粒', - 63994 => '狀', - 63995 => '炙', - 63996 => '識', - 63997 => '什', - 63998 => '茶', - 63999 => '刺', - 64000 => '切', - 64001 => '度', - 64002 => '拓', - 64003 => '糖', - 64004 => '宅', - 64005 => '洞', - 64006 => '暴', - 64007 => '輻', - 64008 => '行', - 64009 => '降', - 64010 => '見', - 64011 => '廓', - 64012 => '兀', - 64013 => '嗀', - 64016 => '塚', - 64018 => '晴', - 64021 => '凞', - 64022 => '猪', - 64023 => '益', - 64024 => '礼', - 64025 => '神', - 64026 => '祥', - 64027 => '福', - 64028 => '靖', - 64029 => '精', - 64030 => '羽', - 64032 => '蘒', - 64034 => '諸', - 64037 => '逸', - 64038 => '都', - 64042 => '飯', - 64043 => '飼', - 64044 => '館', - 64045 => '鶴', - 64046 => '郞', - 64047 => '隷', - 64048 => '侮', - 64049 => '僧', - 64050 => '免', - 64051 => '勉', - 64052 => '勤', - 64053 => '卑', - 64054 => '喝', - 64055 => '嘆', - 64056 => '器', - 64057 => '塀', - 64058 => '墨', - 64059 => '層', - 64060 => '屮', - 64061 => '悔', - 64062 => '慨', - 64063 => '憎', - 64064 => '懲', - 64065 => '敏', - 64066 => '既', - 64067 => '暑', - 64068 => '梅', - 64069 => '海', - 64070 => '渚', - 64071 => '漢', - 64072 => '煮', - 64073 => '爫', - 64074 => '琢', - 64075 => '碑', - 64076 => '社', - 64077 => '祉', - 64078 => '祈', - 64079 => '祐', - 64080 => '祖', - 64081 => '祝', - 64082 => '禍', - 64083 => '禎', - 64084 => '穀', - 64085 => '突', - 64086 => '節', - 64087 => '練', - 64088 => '縉', - 64089 => '繁', - 64090 => '署', - 64091 => '者', - 64092 => '臭', - 64093 => '艹', - 64094 => '艹', - 64095 => '著', - 64096 => '褐', - 64097 => '視', - 64098 => '謁', - 64099 => '謹', - 64100 => '賓', - 64101 => '贈', - 64102 => '辶', - 64103 => '逸', - 64104 => '難', - 64105 => '響', - 64106 => '頻', - 64107 => '恵', - 64108 => '𤋮', - 64109 => '舘', - 64112 => '並', - 64113 => '况', - 64114 => '全', - 64115 => '侀', - 64116 => '充', - 64117 => '冀', - 64118 => '勇', - 64119 => '勺', - 64120 => '喝', - 64121 => '啕', - 64122 => '喙', - 64123 => '嗢', - 64124 => '塚', - 64125 => '墳', - 64126 => '奄', - 64127 => '奔', - 64128 => '婢', - 64129 => '嬨', - 64130 => '廒', - 64131 => '廙', - 64132 => '彩', - 64133 => '徭', - 64134 => '惘', - 64135 => '慎', - 64136 => '愈', - 64137 => '憎', - 64138 => '慠', - 64139 => '懲', - 64140 => '戴', - 64141 => '揄', - 64142 => '搜', - 64143 => '摒', - 64144 => '敖', - 64145 => '晴', - 64146 => '朗', - 64147 => '望', - 64148 => '杖', - 64149 => '歹', - 64150 => '殺', - 64151 => '流', - 64152 => '滛', - 64153 => '滋', - 64154 => '漢', - 64155 => '瀞', - 64156 => '煮', - 64157 => '瞧', - 64158 => '爵', - 64159 => '犯', - 64160 => '猪', - 64161 => '瑱', - 64162 => '甆', - 64163 => '画', - 64164 => '瘝', - 64165 => '瘟', - 64166 => '益', - 64167 => '盛', - 64168 => '直', - 64169 => '睊', - 64170 => '着', - 64171 => '磌', - 64172 => '窱', - 64173 => '節', - 64174 => '类', - 64175 => '絛', - 64176 => '練', - 64177 => '缾', - 64178 => '者', - 64179 => '荒', - 64180 => '華', - 64181 => '蝹', - 64182 => '襁', - 64183 => '覆', - 64184 => '視', - 64185 => '調', - 64186 => '諸', - 64187 => '請', - 64188 => '謁', - 64189 => '諾', - 64190 => '諭', - 64191 => '謹', - 64192 => '變', - 64193 => '贈', - 64194 => '輸', - 64195 => '遲', - 64196 => '醙', - 64197 => '鉶', - 64198 => '陼', - 64199 => '難', - 64200 => '靖', - 64201 => '韛', - 64202 => '響', - 64203 => '頋', - 64204 => '頻', - 64205 => '鬒', - 64206 => '龜', - 64207 => '𢡊', - 64208 => '𢡄', - 64209 => '𣏕', - 64210 => '㮝', - 64211 => '䀘', - 64212 => '䀹', - 64213 => '𥉉', - 64214 => '𥳐', - 64215 => '𧻓', - 64216 => '齃', - 64217 => '龎', - 64256 => 'ff', - 64257 => 'fi', - 64258 => 'fl', - 64259 => 'ffi', - 64260 => 'ffl', - 64261 => 'st', - 64262 => 'st', - 64275 => 'մն', - 64276 => 'մե', - 64277 => 'մի', - 64278 => 'վն', - 64279 => 'մխ', - 64285 => 'יִ', - 64287 => 'ײַ', - 64288 => 'ע', - 64289 => 'א', - 64290 => 'ד', - 64291 => 'ה', - 64292 => 'כ', - 64293 => 'ל', - 64294 => 'ם', - 64295 => 'ר', - 64296 => 'ת', - 64298 => 'שׁ', - 64299 => 'שׂ', - 64300 => 'שּׁ', - 64301 => 'שּׂ', - 64302 => 'אַ', - 64303 => 'אָ', - 64304 => 'אּ', - 64305 => 'בּ', - 64306 => 'גּ', - 64307 => 'דּ', - 64308 => 'הּ', - 64309 => 'וּ', - 64310 => 'זּ', - 64312 => 'טּ', - 64313 => 'יּ', - 64314 => 'ךּ', - 64315 => 'כּ', - 64316 => 'לּ', - 64318 => 'מּ', - 64320 => 'נּ', - 64321 => 'סּ', - 64323 => 'ףּ', - 64324 => 'פּ', - 64326 => 'צּ', - 64327 => 'קּ', - 64328 => 'רּ', - 64329 => 'שּ', - 64330 => 'תּ', - 64331 => 'וֹ', - 64332 => 'בֿ', - 64333 => 'כֿ', - 64334 => 'פֿ', - 64335 => 'אל', - 64336 => 'ٱ', - 64337 => 'ٱ', - 64338 => 'ٻ', - 64339 => 'ٻ', - 64340 => 'ٻ', - 64341 => 'ٻ', - 64342 => 'پ', - 64343 => 'پ', - 64344 => 'پ', - 64345 => 'پ', - 64346 => 'ڀ', - 64347 => 'ڀ', - 64348 => 'ڀ', - 64349 => 'ڀ', - 64350 => 'ٺ', - 64351 => 'ٺ', - 64352 => 'ٺ', - 64353 => 'ٺ', - 64354 => 'ٿ', - 64355 => 'ٿ', - 64356 => 'ٿ', - 64357 => 'ٿ', - 64358 => 'ٹ', - 64359 => 'ٹ', - 64360 => 'ٹ', - 64361 => 'ٹ', - 64362 => 'ڤ', - 64363 => 'ڤ', - 64364 => 'ڤ', - 64365 => 'ڤ', - 64366 => 'ڦ', - 64367 => 'ڦ', - 64368 => 'ڦ', - 64369 => 'ڦ', - 64370 => 'ڄ', - 64371 => 'ڄ', - 64372 => 'ڄ', - 64373 => 'ڄ', - 64374 => 'ڃ', - 64375 => 'ڃ', - 64376 => 'ڃ', - 64377 => 'ڃ', - 64378 => 'چ', - 64379 => 'چ', - 64380 => 'چ', - 64381 => 'چ', - 64382 => 'ڇ', - 64383 => 'ڇ', - 64384 => 'ڇ', - 64385 => 'ڇ', - 64386 => 'ڍ', - 64387 => 'ڍ', - 64388 => 'ڌ', - 64389 => 'ڌ', - 64390 => 'ڎ', - 64391 => 'ڎ', - 64392 => 'ڈ', - 64393 => 'ڈ', - 64394 => 'ژ', - 64395 => 'ژ', - 64396 => 'ڑ', - 64397 => 'ڑ', - 64398 => 'ک', - 64399 => 'ک', - 64400 => 'ک', - 64401 => 'ک', - 64402 => 'گ', - 64403 => 'گ', - 64404 => 'گ', - 64405 => 'گ', - 64406 => 'ڳ', - 64407 => 'ڳ', - 64408 => 'ڳ', - 64409 => 'ڳ', - 64410 => 'ڱ', - 64411 => 'ڱ', - 64412 => 'ڱ', - 64413 => 'ڱ', - 64414 => 'ں', - 64415 => 'ں', - 64416 => 'ڻ', - 64417 => 'ڻ', - 64418 => 'ڻ', - 64419 => 'ڻ', - 64420 => 'ۀ', - 64421 => 'ۀ', - 64422 => 'ہ', - 64423 => 'ہ', - 64424 => 'ہ', - 64425 => 'ہ', - 64426 => 'ھ', - 64427 => 'ھ', - 64428 => 'ھ', - 64429 => 'ھ', - 64430 => 'ے', - 64431 => 'ے', - 64432 => 'ۓ', - 64433 => 'ۓ', - 64467 => 'ڭ', - 64468 => 'ڭ', - 64469 => 'ڭ', - 64470 => 'ڭ', - 64471 => 'ۇ', - 64472 => 'ۇ', - 64473 => 'ۆ', - 64474 => 'ۆ', - 64475 => 'ۈ', - 64476 => 'ۈ', - 64477 => 'ۇٴ', - 64478 => 'ۋ', - 64479 => 'ۋ', - 64480 => 'ۅ', - 64481 => 'ۅ', - 64482 => 'ۉ', - 64483 => 'ۉ', - 64484 => 'ې', - 64485 => 'ې', - 64486 => 'ې', - 64487 => 'ې', - 64488 => 'ى', - 64489 => 'ى', - 64490 => 'ئا', - 64491 => 'ئا', - 64492 => 'ئە', - 64493 => 'ئە', - 64494 => 'ئو', - 64495 => 'ئو', - 64496 => 'ئۇ', - 64497 => 'ئۇ', - 64498 => 'ئۆ', - 64499 => 'ئۆ', - 64500 => 'ئۈ', - 64501 => 'ئۈ', - 64502 => 'ئې', - 64503 => 'ئې', - 64504 => 'ئې', - 64505 => 'ئى', - 64506 => 'ئى', - 64507 => 'ئى', - 64508 => 'ی', - 64509 => 'ی', - 64510 => 'ی', - 64511 => 'ی', - 64512 => 'ئج', - 64513 => 'ئح', - 64514 => 'ئم', - 64515 => 'ئى', - 64516 => 'ئي', - 64517 => 'بج', - 64518 => 'بح', - 64519 => 'بخ', - 64520 => 'بم', - 64521 => 'بى', - 64522 => 'بي', - 64523 => 'تج', - 64524 => 'تح', - 64525 => 'تخ', - 64526 => 'تم', - 64527 => 'تى', - 64528 => 'تي', - 64529 => 'ثج', - 64530 => 'ثم', - 64531 => 'ثى', - 64532 => 'ثي', - 64533 => 'جح', - 64534 => 'جم', - 64535 => 'حج', - 64536 => 'حم', - 64537 => 'خج', - 64538 => 'خح', - 64539 => 'خم', - 64540 => 'سج', - 64541 => 'سح', - 64542 => 'سخ', - 64543 => 'سم', - 64544 => 'صح', - 64545 => 'صم', - 64546 => 'ضج', - 64547 => 'ضح', - 64548 => 'ضخ', - 64549 => 'ضم', - 64550 => 'طح', - 64551 => 'طم', - 64552 => 'ظم', - 64553 => 'عج', - 64554 => 'عم', - 64555 => 'غج', - 64556 => 'غم', - 64557 => 'فج', - 64558 => 'فح', - 64559 => 'فخ', - 64560 => 'فم', - 64561 => 'فى', - 64562 => 'في', - 64563 => 'قح', - 64564 => 'قم', - 64565 => 'قى', - 64566 => 'قي', - 64567 => 'كا', - 64568 => 'كج', - 64569 => 'كح', - 64570 => 'كخ', - 64571 => 'كل', - 64572 => 'كم', - 64573 => 'كى', - 64574 => 'كي', - 64575 => 'لج', - 64576 => 'لح', - 64577 => 'لخ', - 64578 => 'لم', - 64579 => 'لى', - 64580 => 'لي', - 64581 => 'مج', - 64582 => 'مح', - 64583 => 'مخ', - 64584 => 'مم', - 64585 => 'مى', - 64586 => 'مي', - 64587 => 'نج', - 64588 => 'نح', - 64589 => 'نخ', - 64590 => 'نم', - 64591 => 'نى', - 64592 => 'ني', - 64593 => 'هج', - 64594 => 'هم', - 64595 => 'هى', - 64596 => 'هي', - 64597 => 'يج', - 64598 => 'يح', - 64599 => 'يخ', - 64600 => 'يم', - 64601 => 'يى', - 64602 => 'يي', - 64603 => 'ذٰ', - 64604 => 'رٰ', - 64605 => 'ىٰ', - 64612 => 'ئر', - 64613 => 'ئز', - 64614 => 'ئم', - 64615 => 'ئن', - 64616 => 'ئى', - 64617 => 'ئي', - 64618 => 'بر', - 64619 => 'بز', - 64620 => 'بم', - 64621 => 'بن', - 64622 => 'بى', - 64623 => 'بي', - 64624 => 'تر', - 64625 => 'تز', - 64626 => 'تم', - 64627 => 'تن', - 64628 => 'تى', - 64629 => 'تي', - 64630 => 'ثر', - 64631 => 'ثز', - 64632 => 'ثم', - 64633 => 'ثن', - 64634 => 'ثى', - 64635 => 'ثي', - 64636 => 'فى', - 64637 => 'في', - 64638 => 'قى', - 64639 => 'قي', - 64640 => 'كا', - 64641 => 'كل', - 64642 => 'كم', - 64643 => 'كى', - 64644 => 'كي', - 64645 => 'لم', - 64646 => 'لى', - 64647 => 'لي', - 64648 => 'ما', - 64649 => 'مم', - 64650 => 'نر', - 64651 => 'نز', - 64652 => 'نم', - 64653 => 'نن', - 64654 => 'نى', - 64655 => 'ني', - 64656 => 'ىٰ', - 64657 => 'ير', - 64658 => 'يز', - 64659 => 'يم', - 64660 => 'ين', - 64661 => 'يى', - 64662 => 'يي', - 64663 => 'ئج', - 64664 => 'ئح', - 64665 => 'ئخ', - 64666 => 'ئم', - 64667 => 'ئه', - 64668 => 'بج', - 64669 => 'بح', - 64670 => 'بخ', - 64671 => 'بم', - 64672 => 'به', - 64673 => 'تج', - 64674 => 'تح', - 64675 => 'تخ', - 64676 => 'تم', - 64677 => 'ته', - 64678 => 'ثم', - 64679 => 'جح', - 64680 => 'جم', - 64681 => 'حج', - 64682 => 'حم', - 64683 => 'خج', - 64684 => 'خم', - 64685 => 'سج', - 64686 => 'سح', - 64687 => 'سخ', - 64688 => 'سم', - 64689 => 'صح', - 64690 => 'صخ', - 64691 => 'صم', - 64692 => 'ضج', - 64693 => 'ضح', - 64694 => 'ضخ', - 64695 => 'ضم', - 64696 => 'طح', - 64697 => 'ظم', - 64698 => 'عج', - 64699 => 'عم', - 64700 => 'غج', - 64701 => 'غم', - 64702 => 'فج', - 64703 => 'فح', - 64704 => 'فخ', - 64705 => 'فم', - 64706 => 'قح', - 64707 => 'قم', - 64708 => 'كج', - 64709 => 'كح', - 64710 => 'كخ', - 64711 => 'كل', - 64712 => 'كم', - 64713 => 'لج', - 64714 => 'لح', - 64715 => 'لخ', - 64716 => 'لم', - 64717 => 'له', - 64718 => 'مج', - 64719 => 'مح', - 64720 => 'مخ', - 64721 => 'مم', - 64722 => 'نج', - 64723 => 'نح', - 64724 => 'نخ', - 64725 => 'نم', - 64726 => 'نه', - 64727 => 'هج', - 64728 => 'هم', - 64729 => 'هٰ', - 64730 => 'يج', - 64731 => 'يح', - 64732 => 'يخ', - 64733 => 'يم', - 64734 => 'يه', - 64735 => 'ئم', - 64736 => 'ئه', - 64737 => 'بم', - 64738 => 'به', - 64739 => 'تم', - 64740 => 'ته', - 64741 => 'ثم', - 64742 => 'ثه', - 64743 => 'سم', - 64744 => 'سه', - 64745 => 'شم', - 64746 => 'شه', - 64747 => 'كل', - 64748 => 'كم', - 64749 => 'لم', - 64750 => 'نم', - 64751 => 'نه', - 64752 => 'يم', - 64753 => 'يه', - 64754 => 'ـَّ', - 64755 => 'ـُّ', - 64756 => 'ـِّ', - 64757 => 'طى', - 64758 => 'طي', - 64759 => 'عى', - 64760 => 'عي', - 64761 => 'غى', - 64762 => 'غي', - 64763 => 'سى', - 64764 => 'سي', - 64765 => 'شى', - 64766 => 'شي', - 64767 => 'حى', - 64768 => 'حي', - 64769 => 'جى', - 64770 => 'جي', - 64771 => 'خى', - 64772 => 'خي', - 64773 => 'صى', - 64774 => 'صي', - 64775 => 'ضى', - 64776 => 'ضي', - 64777 => 'شج', - 64778 => 'شح', - 64779 => 'شخ', - 64780 => 'شم', - 64781 => 'شر', - 64782 => 'سر', - 64783 => 'صر', - 64784 => 'ضر', - 64785 => 'طى', - 64786 => 'طي', - 64787 => 'عى', - 64788 => 'عي', - 64789 => 'غى', - 64790 => 'غي', - 64791 => 'سى', - 64792 => 'سي', - 64793 => 'شى', - 64794 => 'شي', - 64795 => 'حى', - 64796 => 'حي', - 64797 => 'جى', - 64798 => 'جي', - 64799 => 'خى', - 64800 => 'خي', - 64801 => 'صى', - 64802 => 'صي', - 64803 => 'ضى', - 64804 => 'ضي', - 64805 => 'شج', - 64806 => 'شح', - 64807 => 'شخ', - 64808 => 'شم', - 64809 => 'شر', - 64810 => 'سر', - 64811 => 'صر', - 64812 => 'ضر', - 64813 => 'شج', - 64814 => 'شح', - 64815 => 'شخ', - 64816 => 'شم', - 64817 => 'سه', - 64818 => 'شه', - 64819 => 'طم', - 64820 => 'سج', - 64821 => 'سح', - 64822 => 'سخ', - 64823 => 'شج', - 64824 => 'شح', - 64825 => 'شخ', - 64826 => 'طم', - 64827 => 'ظم', - 64828 => 'اً', - 64829 => 'اً', - 64848 => 'تجم', - 64849 => 'تحج', - 64850 => 'تحج', - 64851 => 'تحم', - 64852 => 'تخم', - 64853 => 'تمج', - 64854 => 'تمح', - 64855 => 'تمخ', - 64856 => 'جمح', - 64857 => 'جمح', - 64858 => 'حمي', - 64859 => 'حمى', - 64860 => 'سحج', - 64861 => 'سجح', - 64862 => 'سجى', - 64863 => 'سمح', - 64864 => 'سمح', - 64865 => 'سمج', - 64866 => 'سمم', - 64867 => 'سمم', - 64868 => 'صحح', - 64869 => 'صحح', - 64870 => 'صمم', - 64871 => 'شحم', - 64872 => 'شحم', - 64873 => 'شجي', - 64874 => 'شمخ', - 64875 => 'شمخ', - 64876 => 'شمم', - 64877 => 'شمم', - 64878 => 'ضحى', - 64879 => 'ضخم', - 64880 => 'ضخم', - 64881 => 'طمح', - 64882 => 'طمح', - 64883 => 'طمم', - 64884 => 'طمي', - 64885 => 'عجم', - 64886 => 'عمم', - 64887 => 'عمم', - 64888 => 'عمى', - 64889 => 'غمم', - 64890 => 'غمي', - 64891 => 'غمى', - 64892 => 'فخم', - 64893 => 'فخم', - 64894 => 'قمح', - 64895 => 'قمم', - 64896 => 'لحم', - 64897 => 'لحي', - 64898 => 'لحى', - 64899 => 'لجج', - 64900 => 'لجج', - 64901 => 'لخم', - 64902 => 'لخم', - 64903 => 'لمح', - 64904 => 'لمح', - 64905 => 'محج', - 64906 => 'محم', - 64907 => 'محي', - 64908 => 'مجح', - 64909 => 'مجم', - 64910 => 'مخج', - 64911 => 'مخم', - 64914 => 'مجخ', - 64915 => 'همج', - 64916 => 'همم', - 64917 => 'نحم', - 64918 => 'نحى', - 64919 => 'نجم', - 64920 => 'نجم', - 64921 => 'نجى', - 64922 => 'نمي', - 64923 => 'نمى', - 64924 => 'يمم', - 64925 => 'يمم', - 64926 => 'بخي', - 64927 => 'تجي', - 64928 => 'تجى', - 64929 => 'تخي', - 64930 => 'تخى', - 64931 => 'تمي', - 64932 => 'تمى', - 64933 => 'جمي', - 64934 => 'جحى', - 64935 => 'جمى', - 64936 => 'سخى', - 64937 => 'صحي', - 64938 => 'شحي', - 64939 => 'ضحي', - 64940 => 'لجي', - 64941 => 'لمي', - 64942 => 'يحي', - 64943 => 'يجي', - 64944 => 'يمي', - 64945 => 'ممي', - 64946 => 'قمي', - 64947 => 'نحي', - 64948 => 'قمح', - 64949 => 'لحم', - 64950 => 'عمي', - 64951 => 'كمي', - 64952 => 'نجح', - 64953 => 'مخي', - 64954 => 'لجم', - 64955 => 'كمم', - 64956 => 'لجم', - 64957 => 'نجح', - 64958 => 'جحي', - 64959 => 'حجي', - 64960 => 'مجي', - 64961 => 'فمي', - 64962 => 'بحي', - 64963 => 'كمم', - 64964 => 'عجم', - 64965 => 'صمم', - 64966 => 'سخي', - 64967 => 'نجي', - 65008 => 'صلے', - 65009 => 'قلے', - 65010 => 'الله', - 65011 => 'اكبر', - 65012 => 'محمد', - 65013 => 'صلعم', - 65014 => 'رسول', - 65015 => 'عليه', - 65016 => 'وسلم', - 65017 => 'صلى', - 65020 => 'ریال', - 65041 => '、', - 65047 => '〖', - 65048 => '〗', - 65073 => '—', - 65074 => '–', - 65081 => '〔', - 65082 => '〕', - 65083 => '【', - 65084 => '】', - 65085 => '《', - 65086 => '》', - 65087 => '〈', - 65088 => '〉', - 65089 => '「', - 65090 => '」', - 65091 => '『', - 65092 => '』', - 65105 => '、', - 65112 => '—', - 65117 => '〔', - 65118 => '〕', - 65123 => '-', - 65137 => 'ـً', - 65143 => 'ـَ', - 65145 => 'ـُ', - 65147 => 'ـِ', - 65149 => 'ـّ', - 65151 => 'ـْ', - 65152 => 'ء', - 65153 => 'آ', - 65154 => 'آ', - 65155 => 'أ', - 65156 => 'أ', - 65157 => 'ؤ', - 65158 => 'ؤ', - 65159 => 'إ', - 65160 => 'إ', - 65161 => 'ئ', - 65162 => 'ئ', - 65163 => 'ئ', - 65164 => 'ئ', - 65165 => 'ا', - 65166 => 'ا', - 65167 => 'ب', - 65168 => 'ب', - 65169 => 'ب', - 65170 => 'ب', - 65171 => 'ة', - 65172 => 'ة', - 65173 => 'ت', - 65174 => 'ت', - 65175 => 'ت', - 65176 => 'ت', - 65177 => 'ث', - 65178 => 'ث', - 65179 => 'ث', - 65180 => 'ث', - 65181 => 'ج', - 65182 => 'ج', - 65183 => 'ج', - 65184 => 'ج', - 65185 => 'ح', - 65186 => 'ح', - 65187 => 'ح', - 65188 => 'ح', - 65189 => 'خ', - 65190 => 'خ', - 65191 => 'خ', - 65192 => 'خ', - 65193 => 'د', - 65194 => 'د', - 65195 => 'ذ', - 65196 => 'ذ', - 65197 => 'ر', - 65198 => 'ر', - 65199 => 'ز', - 65200 => 'ز', - 65201 => 'س', - 65202 => 'س', - 65203 => 'س', - 65204 => 'س', - 65205 => 'ش', - 65206 => 'ش', - 65207 => 'ش', - 65208 => 'ش', - 65209 => 'ص', - 65210 => 'ص', - 65211 => 'ص', - 65212 => 'ص', - 65213 => 'ض', - 65214 => 'ض', - 65215 => 'ض', - 65216 => 'ض', - 65217 => 'ط', - 65218 => 'ط', - 65219 => 'ط', - 65220 => 'ط', - 65221 => 'ظ', - 65222 => 'ظ', - 65223 => 'ظ', - 65224 => 'ظ', - 65225 => 'ع', - 65226 => 'ع', - 65227 => 'ع', - 65228 => 'ع', - 65229 => 'غ', - 65230 => 'غ', - 65231 => 'غ', - 65232 => 'غ', - 65233 => 'ف', - 65234 => 'ف', - 65235 => 'ف', - 65236 => 'ف', - 65237 => 'ق', - 65238 => 'ق', - 65239 => 'ق', - 65240 => 'ق', - 65241 => 'ك', - 65242 => 'ك', - 65243 => 'ك', - 65244 => 'ك', - 65245 => 'ل', - 65246 => 'ل', - 65247 => 'ل', - 65248 => 'ل', - 65249 => 'م', - 65250 => 'م', - 65251 => 'م', - 65252 => 'م', - 65253 => 'ن', - 65254 => 'ن', - 65255 => 'ن', - 65256 => 'ن', - 65257 => 'ه', - 65258 => 'ه', - 65259 => 'ه', - 65260 => 'ه', - 65261 => 'و', - 65262 => 'و', - 65263 => 'ى', - 65264 => 'ى', - 65265 => 'ي', - 65266 => 'ي', - 65267 => 'ي', - 65268 => 'ي', - 65269 => 'لآ', - 65270 => 'لآ', - 65271 => 'لأ', - 65272 => 'لأ', - 65273 => 'لإ', - 65274 => 'لإ', - 65275 => 'لا', - 65276 => 'لا', - 65293 => '-', - 65294 => '.', - 65296 => '0', - 65297 => '1', - 65298 => '2', - 65299 => '3', - 65300 => '4', - 65301 => '5', - 65302 => '6', - 65303 => '7', - 65304 => '8', - 65305 => '9', - 65313 => 'a', - 65314 => 'b', - 65315 => 'c', - 65316 => 'd', - 65317 => 'e', - 65318 => 'f', - 65319 => 'g', - 65320 => 'h', - 65321 => 'i', - 65322 => 'j', - 65323 => 'k', - 65324 => 'l', - 65325 => 'm', - 65326 => 'n', - 65327 => 'o', - 65328 => 'p', - 65329 => 'q', - 65330 => 'r', - 65331 => 's', - 65332 => 't', - 65333 => 'u', - 65334 => 'v', - 65335 => 'w', - 65336 => 'x', - 65337 => 'y', - 65338 => 'z', - 65345 => 'a', - 65346 => 'b', - 65347 => 'c', - 65348 => 'd', - 65349 => 'e', - 65350 => 'f', - 65351 => 'g', - 65352 => 'h', - 65353 => 'i', - 65354 => 'j', - 65355 => 'k', - 65356 => 'l', - 65357 => 'm', - 65358 => 'n', - 65359 => 'o', - 65360 => 'p', - 65361 => 'q', - 65362 => 'r', - 65363 => 's', - 65364 => 't', - 65365 => 'u', - 65366 => 'v', - 65367 => 'w', - 65368 => 'x', - 65369 => 'y', - 65370 => 'z', - 65375 => '⦅', - 65376 => '⦆', - 65377 => '.', - 65378 => '「', - 65379 => '」', - 65380 => '、', - 65381 => '・', - 65382 => 'ヲ', - 65383 => 'ァ', - 65384 => 'ィ', - 65385 => 'ゥ', - 65386 => 'ェ', - 65387 => 'ォ', - 65388 => 'ャ', - 65389 => 'ュ', - 65390 => 'ョ', - 65391 => 'ッ', - 65392 => 'ー', - 65393 => 'ア', - 65394 => 'イ', - 65395 => 'ウ', - 65396 => 'エ', - 65397 => 'オ', - 65398 => 'カ', - 65399 => 'キ', - 65400 => 'ク', - 65401 => 'ケ', - 65402 => 'コ', - 65403 => 'サ', - 65404 => 'シ', - 65405 => 'ス', - 65406 => 'セ', - 65407 => 'ソ', - 65408 => 'タ', - 65409 => 'チ', - 65410 => 'ツ', - 65411 => 'テ', - 65412 => 'ト', - 65413 => 'ナ', - 65414 => 'ニ', - 65415 => 'ヌ', - 65416 => 'ネ', - 65417 => 'ノ', - 65418 => 'ハ', - 65419 => 'ヒ', - 65420 => 'フ', - 65421 => 'ヘ', - 65422 => 'ホ', - 65423 => 'マ', - 65424 => 'ミ', - 65425 => 'ム', - 65426 => 'メ', - 65427 => 'モ', - 65428 => 'ヤ', - 65429 => 'ユ', - 65430 => 'ヨ', - 65431 => 'ラ', - 65432 => 'リ', - 65433 => 'ル', - 65434 => 'レ', - 65435 => 'ロ', - 65436 => 'ワ', - 65437 => 'ン', - 65438 => '゙', - 65439 => '゚', - 65441 => 'ᄀ', - 65442 => 'ᄁ', - 65443 => 'ᆪ', - 65444 => 'ᄂ', - 65445 => 'ᆬ', - 65446 => 'ᆭ', - 65447 => 'ᄃ', - 65448 => 'ᄄ', - 65449 => 'ᄅ', - 65450 => 'ᆰ', - 65451 => 'ᆱ', - 65452 => 'ᆲ', - 65453 => 'ᆳ', - 65454 => 'ᆴ', - 65455 => 'ᆵ', - 65456 => 'ᄚ', - 65457 => 'ᄆ', - 65458 => 'ᄇ', - 65459 => 'ᄈ', - 65460 => 'ᄡ', - 65461 => 'ᄉ', - 65462 => 'ᄊ', - 65463 => 'ᄋ', - 65464 => 'ᄌ', - 65465 => 'ᄍ', - 65466 => 'ᄎ', - 65467 => 'ᄏ', - 65468 => 'ᄐ', - 65469 => 'ᄑ', - 65470 => 'ᄒ', - 65474 => 'ᅡ', - 65475 => 'ᅢ', - 65476 => 'ᅣ', - 65477 => 'ᅤ', - 65478 => 'ᅥ', - 65479 => 'ᅦ', - 65482 => 'ᅧ', - 65483 => 'ᅨ', - 65484 => 'ᅩ', - 65485 => 'ᅪ', - 65486 => 'ᅫ', - 65487 => 'ᅬ', - 65490 => 'ᅭ', - 65491 => 'ᅮ', - 65492 => 'ᅯ', - 65493 => 'ᅰ', - 65494 => 'ᅱ', - 65495 => 'ᅲ', - 65498 => 'ᅳ', - 65499 => 'ᅴ', - 65500 => 'ᅵ', - 65504 => '¢', - 65505 => '£', - 65506 => '¬', - 65508 => '¦', - 65509 => '¥', - 65510 => '₩', - 65512 => '│', - 65513 => '←', - 65514 => '↑', - 65515 => '→', - 65516 => '↓', - 65517 => '■', - 65518 => '○', - 66560 => '𐐨', - 66561 => '𐐩', - 66562 => '𐐪', - 66563 => '𐐫', - 66564 => '𐐬', - 66565 => '𐐭', - 66566 => '𐐮', - 66567 => '𐐯', - 66568 => '𐐰', - 66569 => '𐐱', - 66570 => '𐐲', - 66571 => '𐐳', - 66572 => '𐐴', - 66573 => '𐐵', - 66574 => '𐐶', - 66575 => '𐐷', - 66576 => '𐐸', - 66577 => '𐐹', - 66578 => '𐐺', - 66579 => '𐐻', - 66580 => '𐐼', - 66581 => '𐐽', - 66582 => '𐐾', - 66583 => '𐐿', - 66584 => '𐑀', - 66585 => '𐑁', - 66586 => '𐑂', - 66587 => '𐑃', - 66588 => '𐑄', - 66589 => '𐑅', - 66590 => '𐑆', - 66591 => '𐑇', - 66592 => '𐑈', - 66593 => '𐑉', - 66594 => '𐑊', - 66595 => '𐑋', - 66596 => '𐑌', - 66597 => '𐑍', - 66598 => '𐑎', - 66599 => '𐑏', - 66736 => '𐓘', - 66737 => '𐓙', - 66738 => '𐓚', - 66739 => '𐓛', - 66740 => '𐓜', - 66741 => '𐓝', - 66742 => '𐓞', - 66743 => '𐓟', - 66744 => '𐓠', - 66745 => '𐓡', - 66746 => '𐓢', - 66747 => '𐓣', - 66748 => '𐓤', - 66749 => '𐓥', - 66750 => '𐓦', - 66751 => '𐓧', - 66752 => '𐓨', - 66753 => '𐓩', - 66754 => '𐓪', - 66755 => '𐓫', - 66756 => '𐓬', - 66757 => '𐓭', - 66758 => '𐓮', - 66759 => '𐓯', - 66760 => '𐓰', - 66761 => '𐓱', - 66762 => '𐓲', - 66763 => '𐓳', - 66764 => '𐓴', - 66765 => '𐓵', - 66766 => '𐓶', - 66767 => '𐓷', - 66768 => '𐓸', - 66769 => '𐓹', - 66770 => '𐓺', - 66771 => '𐓻', - 68736 => '𐳀', - 68737 => '𐳁', - 68738 => '𐳂', - 68739 => '𐳃', - 68740 => '𐳄', - 68741 => '𐳅', - 68742 => '𐳆', - 68743 => '𐳇', - 68744 => '𐳈', - 68745 => '𐳉', - 68746 => '𐳊', - 68747 => '𐳋', - 68748 => '𐳌', - 68749 => '𐳍', - 68750 => '𐳎', - 68751 => '𐳏', - 68752 => '𐳐', - 68753 => '𐳑', - 68754 => '𐳒', - 68755 => '𐳓', - 68756 => '𐳔', - 68757 => '𐳕', - 68758 => '𐳖', - 68759 => '𐳗', - 68760 => '𐳘', - 68761 => '𐳙', - 68762 => '𐳚', - 68763 => '𐳛', - 68764 => '𐳜', - 68765 => '𐳝', - 68766 => '𐳞', - 68767 => '𐳟', - 68768 => '𐳠', - 68769 => '𐳡', - 68770 => '𐳢', - 68771 => '𐳣', - 68772 => '𐳤', - 68773 => '𐳥', - 68774 => '𐳦', - 68775 => '𐳧', - 68776 => '𐳨', - 68777 => '𐳩', - 68778 => '𐳪', - 68779 => '𐳫', - 68780 => '𐳬', - 68781 => '𐳭', - 68782 => '𐳮', - 68783 => '𐳯', - 68784 => '𐳰', - 68785 => '𐳱', - 68786 => '𐳲', - 71840 => '𑣀', - 71841 => '𑣁', - 71842 => '𑣂', - 71843 => '𑣃', - 71844 => '𑣄', - 71845 => '𑣅', - 71846 => '𑣆', - 71847 => '𑣇', - 71848 => '𑣈', - 71849 => '𑣉', - 71850 => '𑣊', - 71851 => '𑣋', - 71852 => '𑣌', - 71853 => '𑣍', - 71854 => '𑣎', - 71855 => '𑣏', - 71856 => '𑣐', - 71857 => '𑣑', - 71858 => '𑣒', - 71859 => '𑣓', - 71860 => '𑣔', - 71861 => '𑣕', - 71862 => '𑣖', - 71863 => '𑣗', - 71864 => '𑣘', - 71865 => '𑣙', - 71866 => '𑣚', - 71867 => '𑣛', - 71868 => '𑣜', - 71869 => '𑣝', - 71870 => '𑣞', - 71871 => '𑣟', - 93760 => '𖹠', - 93761 => '𖹡', - 93762 => '𖹢', - 93763 => '𖹣', - 93764 => '𖹤', - 93765 => '𖹥', - 93766 => '𖹦', - 93767 => '𖹧', - 93768 => '𖹨', - 93769 => '𖹩', - 93770 => '𖹪', - 93771 => '𖹫', - 93772 => '𖹬', - 93773 => '𖹭', - 93774 => '𖹮', - 93775 => '𖹯', - 93776 => '𖹰', - 93777 => '𖹱', - 93778 => '𖹲', - 93779 => '𖹳', - 93780 => '𖹴', - 93781 => '𖹵', - 93782 => '𖹶', - 93783 => '𖹷', - 93784 => '𖹸', - 93785 => '𖹹', - 93786 => '𖹺', - 93787 => '𖹻', - 93788 => '𖹼', - 93789 => '𖹽', - 93790 => '𖹾', - 93791 => '𖹿', - 119134 => '𝅗𝅥', - 119135 => '𝅘𝅥', - 119136 => '𝅘𝅥𝅮', - 119137 => '𝅘𝅥𝅯', - 119138 => '𝅘𝅥𝅰', - 119139 => '𝅘𝅥𝅱', - 119140 => '𝅘𝅥𝅲', - 119227 => '𝆹𝅥', - 119228 => '𝆺𝅥', - 119229 => '𝆹𝅥𝅮', - 119230 => '𝆺𝅥𝅮', - 119231 => '𝆹𝅥𝅯', - 119232 => '𝆺𝅥𝅯', - 119808 => 'a', - 119809 => 'b', - 119810 => 'c', - 119811 => 'd', - 119812 => 'e', - 119813 => 'f', - 119814 => 'g', - 119815 => 'h', - 119816 => 'i', - 119817 => 'j', - 119818 => 'k', - 119819 => 'l', - 119820 => 'm', - 119821 => 'n', - 119822 => 'o', - 119823 => 'p', - 119824 => 'q', - 119825 => 'r', - 119826 => 's', - 119827 => 't', - 119828 => 'u', - 119829 => 'v', - 119830 => 'w', - 119831 => 'x', - 119832 => 'y', - 119833 => 'z', - 119834 => 'a', - 119835 => 'b', - 119836 => 'c', - 119837 => 'd', - 119838 => 'e', - 119839 => 'f', - 119840 => 'g', - 119841 => 'h', - 119842 => 'i', - 119843 => 'j', - 119844 => 'k', - 119845 => 'l', - 119846 => 'm', - 119847 => 'n', - 119848 => 'o', - 119849 => 'p', - 119850 => 'q', - 119851 => 'r', - 119852 => 's', - 119853 => 't', - 119854 => 'u', - 119855 => 'v', - 119856 => 'w', - 119857 => 'x', - 119858 => 'y', - 119859 => 'z', - 119860 => 'a', - 119861 => 'b', - 119862 => 'c', - 119863 => 'd', - 119864 => 'e', - 119865 => 'f', - 119866 => 'g', - 119867 => 'h', - 119868 => 'i', - 119869 => 'j', - 119870 => 'k', - 119871 => 'l', - 119872 => 'm', - 119873 => 'n', - 119874 => 'o', - 119875 => 'p', - 119876 => 'q', - 119877 => 'r', - 119878 => 's', - 119879 => 't', - 119880 => 'u', - 119881 => 'v', - 119882 => 'w', - 119883 => 'x', - 119884 => 'y', - 119885 => 'z', - 119886 => 'a', - 119887 => 'b', - 119888 => 'c', - 119889 => 'd', - 119890 => 'e', - 119891 => 'f', - 119892 => 'g', - 119894 => 'i', - 119895 => 'j', - 119896 => 'k', - 119897 => 'l', - 119898 => 'm', - 119899 => 'n', - 119900 => 'o', - 119901 => 'p', - 119902 => 'q', - 119903 => 'r', - 119904 => 's', - 119905 => 't', - 119906 => 'u', - 119907 => 'v', - 119908 => 'w', - 119909 => 'x', - 119910 => 'y', - 119911 => 'z', - 119912 => 'a', - 119913 => 'b', - 119914 => 'c', - 119915 => 'd', - 119916 => 'e', - 119917 => 'f', - 119918 => 'g', - 119919 => 'h', - 119920 => 'i', - 119921 => 'j', - 119922 => 'k', - 119923 => 'l', - 119924 => 'm', - 119925 => 'n', - 119926 => 'o', - 119927 => 'p', - 119928 => 'q', - 119929 => 'r', - 119930 => 's', - 119931 => 't', - 119932 => 'u', - 119933 => 'v', - 119934 => 'w', - 119935 => 'x', - 119936 => 'y', - 119937 => 'z', - 119938 => 'a', - 119939 => 'b', - 119940 => 'c', - 119941 => 'd', - 119942 => 'e', - 119943 => 'f', - 119944 => 'g', - 119945 => 'h', - 119946 => 'i', - 119947 => 'j', - 119948 => 'k', - 119949 => 'l', - 119950 => 'm', - 119951 => 'n', - 119952 => 'o', - 119953 => 'p', - 119954 => 'q', - 119955 => 'r', - 119956 => 's', - 119957 => 't', - 119958 => 'u', - 119959 => 'v', - 119960 => 'w', - 119961 => 'x', - 119962 => 'y', - 119963 => 'z', - 119964 => 'a', - 119966 => 'c', - 119967 => 'd', - 119970 => 'g', - 119973 => 'j', - 119974 => 'k', - 119977 => 'n', - 119978 => 'o', - 119979 => 'p', - 119980 => 'q', - 119982 => 's', - 119983 => 't', - 119984 => 'u', - 119985 => 'v', - 119986 => 'w', - 119987 => 'x', - 119988 => 'y', - 119989 => 'z', - 119990 => 'a', - 119991 => 'b', - 119992 => 'c', - 119993 => 'd', - 119995 => 'f', - 119997 => 'h', - 119998 => 'i', - 119999 => 'j', - 120000 => 'k', - 120001 => 'l', - 120002 => 'm', - 120003 => 'n', - 120005 => 'p', - 120006 => 'q', - 120007 => 'r', - 120008 => 's', - 120009 => 't', - 120010 => 'u', - 120011 => 'v', - 120012 => 'w', - 120013 => 'x', - 120014 => 'y', - 120015 => 'z', - 120016 => 'a', - 120017 => 'b', - 120018 => 'c', - 120019 => 'd', - 120020 => 'e', - 120021 => 'f', - 120022 => 'g', - 120023 => 'h', - 120024 => 'i', - 120025 => 'j', - 120026 => 'k', - 120027 => 'l', - 120028 => 'm', - 120029 => 'n', - 120030 => 'o', - 120031 => 'p', - 120032 => 'q', - 120033 => 'r', - 120034 => 's', - 120035 => 't', - 120036 => 'u', - 120037 => 'v', - 120038 => 'w', - 120039 => 'x', - 120040 => 'y', - 120041 => 'z', - 120042 => 'a', - 120043 => 'b', - 120044 => 'c', - 120045 => 'd', - 120046 => 'e', - 120047 => 'f', - 120048 => 'g', - 120049 => 'h', - 120050 => 'i', - 120051 => 'j', - 120052 => 'k', - 120053 => 'l', - 120054 => 'm', - 120055 => 'n', - 120056 => 'o', - 120057 => 'p', - 120058 => 'q', - 120059 => 'r', - 120060 => 's', - 120061 => 't', - 120062 => 'u', - 120063 => 'v', - 120064 => 'w', - 120065 => 'x', - 120066 => 'y', - 120067 => 'z', - 120068 => 'a', - 120069 => 'b', - 120071 => 'd', - 120072 => 'e', - 120073 => 'f', - 120074 => 'g', - 120077 => 'j', - 120078 => 'k', - 120079 => 'l', - 120080 => 'm', - 120081 => 'n', - 120082 => 'o', - 120083 => 'p', - 120084 => 'q', - 120086 => 's', - 120087 => 't', - 120088 => 'u', - 120089 => 'v', - 120090 => 'w', - 120091 => 'x', - 120092 => 'y', - 120094 => 'a', - 120095 => 'b', - 120096 => 'c', - 120097 => 'd', - 120098 => 'e', - 120099 => 'f', - 120100 => 'g', - 120101 => 'h', - 120102 => 'i', - 120103 => 'j', - 120104 => 'k', - 120105 => 'l', - 120106 => 'm', - 120107 => 'n', - 120108 => 'o', - 120109 => 'p', - 120110 => 'q', - 120111 => 'r', - 120112 => 's', - 120113 => 't', - 120114 => 'u', - 120115 => 'v', - 120116 => 'w', - 120117 => 'x', - 120118 => 'y', - 120119 => 'z', - 120120 => 'a', - 120121 => 'b', - 120123 => 'd', - 120124 => 'e', - 120125 => 'f', - 120126 => 'g', - 120128 => 'i', - 120129 => 'j', - 120130 => 'k', - 120131 => 'l', - 120132 => 'm', - 120134 => 'o', - 120138 => 's', - 120139 => 't', - 120140 => 'u', - 120141 => 'v', - 120142 => 'w', - 120143 => 'x', - 120144 => 'y', - 120146 => 'a', - 120147 => 'b', - 120148 => 'c', - 120149 => 'd', - 120150 => 'e', - 120151 => 'f', - 120152 => 'g', - 120153 => 'h', - 120154 => 'i', - 120155 => 'j', - 120156 => 'k', - 120157 => 'l', - 120158 => 'm', - 120159 => 'n', - 120160 => 'o', - 120161 => 'p', - 120162 => 'q', - 120163 => 'r', - 120164 => 's', - 120165 => 't', - 120166 => 'u', - 120167 => 'v', - 120168 => 'w', - 120169 => 'x', - 120170 => 'y', - 120171 => 'z', - 120172 => 'a', - 120173 => 'b', - 120174 => 'c', - 120175 => 'd', - 120176 => 'e', - 120177 => 'f', - 120178 => 'g', - 120179 => 'h', - 120180 => 'i', - 120181 => 'j', - 120182 => 'k', - 120183 => 'l', - 120184 => 'm', - 120185 => 'n', - 120186 => 'o', - 120187 => 'p', - 120188 => 'q', - 120189 => 'r', - 120190 => 's', - 120191 => 't', - 120192 => 'u', - 120193 => 'v', - 120194 => 'w', - 120195 => 'x', - 120196 => 'y', - 120197 => 'z', - 120198 => 'a', - 120199 => 'b', - 120200 => 'c', - 120201 => 'd', - 120202 => 'e', - 120203 => 'f', - 120204 => 'g', - 120205 => 'h', - 120206 => 'i', - 120207 => 'j', - 120208 => 'k', - 120209 => 'l', - 120210 => 'm', - 120211 => 'n', - 120212 => 'o', - 120213 => 'p', - 120214 => 'q', - 120215 => 'r', - 120216 => 's', - 120217 => 't', - 120218 => 'u', - 120219 => 'v', - 120220 => 'w', - 120221 => 'x', - 120222 => 'y', - 120223 => 'z', - 120224 => 'a', - 120225 => 'b', - 120226 => 'c', - 120227 => 'd', - 120228 => 'e', - 120229 => 'f', - 120230 => 'g', - 120231 => 'h', - 120232 => 'i', - 120233 => 'j', - 120234 => 'k', - 120235 => 'l', - 120236 => 'm', - 120237 => 'n', - 120238 => 'o', - 120239 => 'p', - 120240 => 'q', - 120241 => 'r', - 120242 => 's', - 120243 => 't', - 120244 => 'u', - 120245 => 'v', - 120246 => 'w', - 120247 => 'x', - 120248 => 'y', - 120249 => 'z', - 120250 => 'a', - 120251 => 'b', - 120252 => 'c', - 120253 => 'd', - 120254 => 'e', - 120255 => 'f', - 120256 => 'g', - 120257 => 'h', - 120258 => 'i', - 120259 => 'j', - 120260 => 'k', - 120261 => 'l', - 120262 => 'm', - 120263 => 'n', - 120264 => 'o', - 120265 => 'p', - 120266 => 'q', - 120267 => 'r', - 120268 => 's', - 120269 => 't', - 120270 => 'u', - 120271 => 'v', - 120272 => 'w', - 120273 => 'x', - 120274 => 'y', - 120275 => 'z', - 120276 => 'a', - 120277 => 'b', - 120278 => 'c', - 120279 => 'd', - 120280 => 'e', - 120281 => 'f', - 120282 => 'g', - 120283 => 'h', - 120284 => 'i', - 120285 => 'j', - 120286 => 'k', - 120287 => 'l', - 120288 => 'm', - 120289 => 'n', - 120290 => 'o', - 120291 => 'p', - 120292 => 'q', - 120293 => 'r', - 120294 => 's', - 120295 => 't', - 120296 => 'u', - 120297 => 'v', - 120298 => 'w', - 120299 => 'x', - 120300 => 'y', - 120301 => 'z', - 120302 => 'a', - 120303 => 'b', - 120304 => 'c', - 120305 => 'd', - 120306 => 'e', - 120307 => 'f', - 120308 => 'g', - 120309 => 'h', - 120310 => 'i', - 120311 => 'j', - 120312 => 'k', - 120313 => 'l', - 120314 => 'm', - 120315 => 'n', - 120316 => 'o', - 120317 => 'p', - 120318 => 'q', - 120319 => 'r', - 120320 => 's', - 120321 => 't', - 120322 => 'u', - 120323 => 'v', - 120324 => 'w', - 120325 => 'x', - 120326 => 'y', - 120327 => 'z', - 120328 => 'a', - 120329 => 'b', - 120330 => 'c', - 120331 => 'd', - 120332 => 'e', - 120333 => 'f', - 120334 => 'g', - 120335 => 'h', - 120336 => 'i', - 120337 => 'j', - 120338 => 'k', - 120339 => 'l', - 120340 => 'm', - 120341 => 'n', - 120342 => 'o', - 120343 => 'p', - 120344 => 'q', - 120345 => 'r', - 120346 => 's', - 120347 => 't', - 120348 => 'u', - 120349 => 'v', - 120350 => 'w', - 120351 => 'x', - 120352 => 'y', - 120353 => 'z', - 120354 => 'a', - 120355 => 'b', - 120356 => 'c', - 120357 => 'd', - 120358 => 'e', - 120359 => 'f', - 120360 => 'g', - 120361 => 'h', - 120362 => 'i', - 120363 => 'j', - 120364 => 'k', - 120365 => 'l', - 120366 => 'm', - 120367 => 'n', - 120368 => 'o', - 120369 => 'p', - 120370 => 'q', - 120371 => 'r', - 120372 => 's', - 120373 => 't', - 120374 => 'u', - 120375 => 'v', - 120376 => 'w', - 120377 => 'x', - 120378 => 'y', - 120379 => 'z', - 120380 => 'a', - 120381 => 'b', - 120382 => 'c', - 120383 => 'd', - 120384 => 'e', - 120385 => 'f', - 120386 => 'g', - 120387 => 'h', - 120388 => 'i', - 120389 => 'j', - 120390 => 'k', - 120391 => 'l', - 120392 => 'm', - 120393 => 'n', - 120394 => 'o', - 120395 => 'p', - 120396 => 'q', - 120397 => 'r', - 120398 => 's', - 120399 => 't', - 120400 => 'u', - 120401 => 'v', - 120402 => 'w', - 120403 => 'x', - 120404 => 'y', - 120405 => 'z', - 120406 => 'a', - 120407 => 'b', - 120408 => 'c', - 120409 => 'd', - 120410 => 'e', - 120411 => 'f', - 120412 => 'g', - 120413 => 'h', - 120414 => 'i', - 120415 => 'j', - 120416 => 'k', - 120417 => 'l', - 120418 => 'm', - 120419 => 'n', - 120420 => 'o', - 120421 => 'p', - 120422 => 'q', - 120423 => 'r', - 120424 => 's', - 120425 => 't', - 120426 => 'u', - 120427 => 'v', - 120428 => 'w', - 120429 => 'x', - 120430 => 'y', - 120431 => 'z', - 120432 => 'a', - 120433 => 'b', - 120434 => 'c', - 120435 => 'd', - 120436 => 'e', - 120437 => 'f', - 120438 => 'g', - 120439 => 'h', - 120440 => 'i', - 120441 => 'j', - 120442 => 'k', - 120443 => 'l', - 120444 => 'm', - 120445 => 'n', - 120446 => 'o', - 120447 => 'p', - 120448 => 'q', - 120449 => 'r', - 120450 => 's', - 120451 => 't', - 120452 => 'u', - 120453 => 'v', - 120454 => 'w', - 120455 => 'x', - 120456 => 'y', - 120457 => 'z', - 120458 => 'a', - 120459 => 'b', - 120460 => 'c', - 120461 => 'd', - 120462 => 'e', - 120463 => 'f', - 120464 => 'g', - 120465 => 'h', - 120466 => 'i', - 120467 => 'j', - 120468 => 'k', - 120469 => 'l', - 120470 => 'm', - 120471 => 'n', - 120472 => 'o', - 120473 => 'p', - 120474 => 'q', - 120475 => 'r', - 120476 => 's', - 120477 => 't', - 120478 => 'u', - 120479 => 'v', - 120480 => 'w', - 120481 => 'x', - 120482 => 'y', - 120483 => 'z', - 120484 => 'ı', - 120485 => 'ȷ', - 120488 => 'α', - 120489 => 'β', - 120490 => 'γ', - 120491 => 'δ', - 120492 => 'ε', - 120493 => 'ζ', - 120494 => 'η', - 120495 => 'θ', - 120496 => 'ι', - 120497 => 'κ', - 120498 => 'λ', - 120499 => 'μ', - 120500 => 'ν', - 120501 => 'ξ', - 120502 => 'ο', - 120503 => 'π', - 120504 => 'ρ', - 120505 => 'θ', - 120506 => 'σ', - 120507 => 'τ', - 120508 => 'υ', - 120509 => 'φ', - 120510 => 'χ', - 120511 => 'ψ', - 120512 => 'ω', - 120513 => '∇', - 120514 => 'α', - 120515 => 'β', - 120516 => 'γ', - 120517 => 'δ', - 120518 => 'ε', - 120519 => 'ζ', - 120520 => 'η', - 120521 => 'θ', - 120522 => 'ι', - 120523 => 'κ', - 120524 => 'λ', - 120525 => 'μ', - 120526 => 'ν', - 120527 => 'ξ', - 120528 => 'ο', - 120529 => 'π', - 120530 => 'ρ', - 120531 => 'σ', - 120532 => 'σ', - 120533 => 'τ', - 120534 => 'υ', - 120535 => 'φ', - 120536 => 'χ', - 120537 => 'ψ', - 120538 => 'ω', - 120539 => '∂', - 120540 => 'ε', - 120541 => 'θ', - 120542 => 'κ', - 120543 => 'φ', - 120544 => 'ρ', - 120545 => 'π', - 120546 => 'α', - 120547 => 'β', - 120548 => 'γ', - 120549 => 'δ', - 120550 => 'ε', - 120551 => 'ζ', - 120552 => 'η', - 120553 => 'θ', - 120554 => 'ι', - 120555 => 'κ', - 120556 => 'λ', - 120557 => 'μ', - 120558 => 'ν', - 120559 => 'ξ', - 120560 => 'ο', - 120561 => 'π', - 120562 => 'ρ', - 120563 => 'θ', - 120564 => 'σ', - 120565 => 'τ', - 120566 => 'υ', - 120567 => 'φ', - 120568 => 'χ', - 120569 => 'ψ', - 120570 => 'ω', - 120571 => '∇', - 120572 => 'α', - 120573 => 'β', - 120574 => 'γ', - 120575 => 'δ', - 120576 => 'ε', - 120577 => 'ζ', - 120578 => 'η', - 120579 => 'θ', - 120580 => 'ι', - 120581 => 'κ', - 120582 => 'λ', - 120583 => 'μ', - 120584 => 'ν', - 120585 => 'ξ', - 120586 => 'ο', - 120587 => 'π', - 120588 => 'ρ', - 120589 => 'σ', - 120590 => 'σ', - 120591 => 'τ', - 120592 => 'υ', - 120593 => 'φ', - 120594 => 'χ', - 120595 => 'ψ', - 120596 => 'ω', - 120597 => '∂', - 120598 => 'ε', - 120599 => 'θ', - 120600 => 'κ', - 120601 => 'φ', - 120602 => 'ρ', - 120603 => 'π', - 120604 => 'α', - 120605 => 'β', - 120606 => 'γ', - 120607 => 'δ', - 120608 => 'ε', - 120609 => 'ζ', - 120610 => 'η', - 120611 => 'θ', - 120612 => 'ι', - 120613 => 'κ', - 120614 => 'λ', - 120615 => 'μ', - 120616 => 'ν', - 120617 => 'ξ', - 120618 => 'ο', - 120619 => 'π', - 120620 => 'ρ', - 120621 => 'θ', - 120622 => 'σ', - 120623 => 'τ', - 120624 => 'υ', - 120625 => 'φ', - 120626 => 'χ', - 120627 => 'ψ', - 120628 => 'ω', - 120629 => '∇', - 120630 => 'α', - 120631 => 'β', - 120632 => 'γ', - 120633 => 'δ', - 120634 => 'ε', - 120635 => 'ζ', - 120636 => 'η', - 120637 => 'θ', - 120638 => 'ι', - 120639 => 'κ', - 120640 => 'λ', - 120641 => 'μ', - 120642 => 'ν', - 120643 => 'ξ', - 120644 => 'ο', - 120645 => 'π', - 120646 => 'ρ', - 120647 => 'σ', - 120648 => 'σ', - 120649 => 'τ', - 120650 => 'υ', - 120651 => 'φ', - 120652 => 'χ', - 120653 => 'ψ', - 120654 => 'ω', - 120655 => '∂', - 120656 => 'ε', - 120657 => 'θ', - 120658 => 'κ', - 120659 => 'φ', - 120660 => 'ρ', - 120661 => 'π', - 120662 => 'α', - 120663 => 'β', - 120664 => 'γ', - 120665 => 'δ', - 120666 => 'ε', - 120667 => 'ζ', - 120668 => 'η', - 120669 => 'θ', - 120670 => 'ι', - 120671 => 'κ', - 120672 => 'λ', - 120673 => 'μ', - 120674 => 'ν', - 120675 => 'ξ', - 120676 => 'ο', - 120677 => 'π', - 120678 => 'ρ', - 120679 => 'θ', - 120680 => 'σ', - 120681 => 'τ', - 120682 => 'υ', - 120683 => 'φ', - 120684 => 'χ', - 120685 => 'ψ', - 120686 => 'ω', - 120687 => '∇', - 120688 => 'α', - 120689 => 'β', - 120690 => 'γ', - 120691 => 'δ', - 120692 => 'ε', - 120693 => 'ζ', - 120694 => 'η', - 120695 => 'θ', - 120696 => 'ι', - 120697 => 'κ', - 120698 => 'λ', - 120699 => 'μ', - 120700 => 'ν', - 120701 => 'ξ', - 120702 => 'ο', - 120703 => 'π', - 120704 => 'ρ', - 120705 => 'σ', - 120706 => 'σ', - 120707 => 'τ', - 120708 => 'υ', - 120709 => 'φ', - 120710 => 'χ', - 120711 => 'ψ', - 120712 => 'ω', - 120713 => '∂', - 120714 => 'ε', - 120715 => 'θ', - 120716 => 'κ', - 120717 => 'φ', - 120718 => 'ρ', - 120719 => 'π', - 120720 => 'α', - 120721 => 'β', - 120722 => 'γ', - 120723 => 'δ', - 120724 => 'ε', - 120725 => 'ζ', - 120726 => 'η', - 120727 => 'θ', - 120728 => 'ι', - 120729 => 'κ', - 120730 => 'λ', - 120731 => 'μ', - 120732 => 'ν', - 120733 => 'ξ', - 120734 => 'ο', - 120735 => 'π', - 120736 => 'ρ', - 120737 => 'θ', - 120738 => 'σ', - 120739 => 'τ', - 120740 => 'υ', - 120741 => 'φ', - 120742 => 'χ', - 120743 => 'ψ', - 120744 => 'ω', - 120745 => '∇', - 120746 => 'α', - 120747 => 'β', - 120748 => 'γ', - 120749 => 'δ', - 120750 => 'ε', - 120751 => 'ζ', - 120752 => 'η', - 120753 => 'θ', - 120754 => 'ι', - 120755 => 'κ', - 120756 => 'λ', - 120757 => 'μ', - 120758 => 'ν', - 120759 => 'ξ', - 120760 => 'ο', - 120761 => 'π', - 120762 => 'ρ', - 120763 => 'σ', - 120764 => 'σ', - 120765 => 'τ', - 120766 => 'υ', - 120767 => 'φ', - 120768 => 'χ', - 120769 => 'ψ', - 120770 => 'ω', - 120771 => '∂', - 120772 => 'ε', - 120773 => 'θ', - 120774 => 'κ', - 120775 => 'φ', - 120776 => 'ρ', - 120777 => 'π', - 120778 => 'ϝ', - 120779 => 'ϝ', - 120782 => '0', - 120783 => '1', - 120784 => '2', - 120785 => '3', - 120786 => '4', - 120787 => '5', - 120788 => '6', - 120789 => '7', - 120790 => '8', - 120791 => '9', - 120792 => '0', - 120793 => '1', - 120794 => '2', - 120795 => '3', - 120796 => '4', - 120797 => '5', - 120798 => '6', - 120799 => '7', - 120800 => '8', - 120801 => '9', - 120802 => '0', - 120803 => '1', - 120804 => '2', - 120805 => '3', - 120806 => '4', - 120807 => '5', - 120808 => '6', - 120809 => '7', - 120810 => '8', - 120811 => '9', - 120812 => '0', - 120813 => '1', - 120814 => '2', - 120815 => '3', - 120816 => '4', - 120817 => '5', - 120818 => '6', - 120819 => '7', - 120820 => '8', - 120821 => '9', - 120822 => '0', - 120823 => '1', - 120824 => '2', - 120825 => '3', - 120826 => '4', - 120827 => '5', - 120828 => '6', - 120829 => '7', - 120830 => '8', - 120831 => '9', - 125184 => '𞤢', - 125185 => '𞤣', - 125186 => '𞤤', - 125187 => '𞤥', - 125188 => '𞤦', - 125189 => '𞤧', - 125190 => '𞤨', - 125191 => '𞤩', - 125192 => '𞤪', - 125193 => '𞤫', - 125194 => '𞤬', - 125195 => '𞤭', - 125196 => '𞤮', - 125197 => '𞤯', - 125198 => '𞤰', - 125199 => '𞤱', - 125200 => '𞤲', - 125201 => '𞤳', - 125202 => '𞤴', - 125203 => '𞤵', - 125204 => '𞤶', - 125205 => '𞤷', - 125206 => '𞤸', - 125207 => '𞤹', - 125208 => '𞤺', - 125209 => '𞤻', - 125210 => '𞤼', - 125211 => '𞤽', - 125212 => '𞤾', - 125213 => '𞤿', - 125214 => '𞥀', - 125215 => '𞥁', - 125216 => '𞥂', - 125217 => '𞥃', - 126464 => 'ا', - 126465 => 'ب', - 126466 => 'ج', - 126467 => 'د', - 126469 => 'و', - 126470 => 'ز', - 126471 => 'ح', - 126472 => 'ط', - 126473 => 'ي', - 126474 => 'ك', - 126475 => 'ل', - 126476 => 'م', - 126477 => 'ن', - 126478 => 'س', - 126479 => 'ع', - 126480 => 'ف', - 126481 => 'ص', - 126482 => 'ق', - 126483 => 'ر', - 126484 => 'ش', - 126485 => 'ت', - 126486 => 'ث', - 126487 => 'خ', - 126488 => 'ذ', - 126489 => 'ض', - 126490 => 'ظ', - 126491 => 'غ', - 126492 => 'ٮ', - 126493 => 'ں', - 126494 => 'ڡ', - 126495 => 'ٯ', - 126497 => 'ب', - 126498 => 'ج', - 126500 => 'ه', - 126503 => 'ح', - 126505 => 'ي', - 126506 => 'ك', - 126507 => 'ل', - 126508 => 'م', - 126509 => 'ن', - 126510 => 'س', - 126511 => 'ع', - 126512 => 'ف', - 126513 => 'ص', - 126514 => 'ق', - 126516 => 'ش', - 126517 => 'ت', - 126518 => 'ث', - 126519 => 'خ', - 126521 => 'ض', - 126523 => 'غ', - 126530 => 'ج', - 126535 => 'ح', - 126537 => 'ي', - 126539 => 'ل', - 126541 => 'ن', - 126542 => 'س', - 126543 => 'ع', - 126545 => 'ص', - 126546 => 'ق', - 126548 => 'ش', - 126551 => 'خ', - 126553 => 'ض', - 126555 => 'غ', - 126557 => 'ں', - 126559 => 'ٯ', - 126561 => 'ب', - 126562 => 'ج', - 126564 => 'ه', - 126567 => 'ح', - 126568 => 'ط', - 126569 => 'ي', - 126570 => 'ك', - 126572 => 'م', - 126573 => 'ن', - 126574 => 'س', - 126575 => 'ع', - 126576 => 'ف', - 126577 => 'ص', - 126578 => 'ق', - 126580 => 'ش', - 126581 => 'ت', - 126582 => 'ث', - 126583 => 'خ', - 126585 => 'ض', - 126586 => 'ظ', - 126587 => 'غ', - 126588 => 'ٮ', - 126590 => 'ڡ', - 126592 => 'ا', - 126593 => 'ب', - 126594 => 'ج', - 126595 => 'د', - 126596 => 'ه', - 126597 => 'و', - 126598 => 'ز', - 126599 => 'ح', - 126600 => 'ط', - 126601 => 'ي', - 126603 => 'ل', - 126604 => 'م', - 126605 => 'ن', - 126606 => 'س', - 126607 => 'ع', - 126608 => 'ف', - 126609 => 'ص', - 126610 => 'ق', - 126611 => 'ر', - 126612 => 'ش', - 126613 => 'ت', - 126614 => 'ث', - 126615 => 'خ', - 126616 => 'ذ', - 126617 => 'ض', - 126618 => 'ظ', - 126619 => 'غ', - 126625 => 'ب', - 126626 => 'ج', - 126627 => 'د', - 126629 => 'و', - 126630 => 'ز', - 126631 => 'ح', - 126632 => 'ط', - 126633 => 'ي', - 126635 => 'ل', - 126636 => 'م', - 126637 => 'ن', - 126638 => 'س', - 126639 => 'ع', - 126640 => 'ف', - 126641 => 'ص', - 126642 => 'ق', - 126643 => 'ر', - 126644 => 'ش', - 126645 => 'ت', - 126646 => 'ث', - 126647 => 'خ', - 126648 => 'ذ', - 126649 => 'ض', - 126650 => 'ظ', - 126651 => 'غ', - 127274 => '〔s〕', - 127275 => 'c', - 127276 => 'r', - 127277 => 'cd', - 127278 => 'wz', - 127280 => 'a', - 127281 => 'b', - 127282 => 'c', - 127283 => 'd', - 127284 => 'e', - 127285 => 'f', - 127286 => 'g', - 127287 => 'h', - 127288 => 'i', - 127289 => 'j', - 127290 => 'k', - 127291 => 'l', - 127292 => 'm', - 127293 => 'n', - 127294 => 'o', - 127295 => 'p', - 127296 => 'q', - 127297 => 'r', - 127298 => 's', - 127299 => 't', - 127300 => 'u', - 127301 => 'v', - 127302 => 'w', - 127303 => 'x', - 127304 => 'y', - 127305 => 'z', - 127306 => 'hv', - 127307 => 'mv', - 127308 => 'sd', - 127309 => 'ss', - 127310 => 'ppv', - 127311 => 'wc', - 127338 => 'mc', - 127339 => 'md', - 127340 => 'mr', - 127376 => 'dj', - 127488 => 'ほか', - 127489 => 'ココ', - 127490 => 'サ', - 127504 => '手', - 127505 => '字', - 127506 => '双', - 127507 => 'デ', - 127508 => '二', - 127509 => '多', - 127510 => '解', - 127511 => '天', - 127512 => '交', - 127513 => '映', - 127514 => '無', - 127515 => '料', - 127516 => '前', - 127517 => '後', - 127518 => '再', - 127519 => '新', - 127520 => '初', - 127521 => '終', - 127522 => '生', - 127523 => '販', - 127524 => '声', - 127525 => '吹', - 127526 => '演', - 127527 => '投', - 127528 => '捕', - 127529 => '一', - 127530 => '三', - 127531 => '遊', - 127532 => '左', - 127533 => '中', - 127534 => '右', - 127535 => '指', - 127536 => '走', - 127537 => '打', - 127538 => '禁', - 127539 => '空', - 127540 => '合', - 127541 => '満', - 127542 => '有', - 127543 => '月', - 127544 => '申', - 127545 => '割', - 127546 => '営', - 127547 => '配', - 127552 => '〔本〕', - 127553 => '〔三〕', - 127554 => '〔二〕', - 127555 => '〔安〕', - 127556 => '〔点〕', - 127557 => '〔打〕', - 127558 => '〔盗〕', - 127559 => '〔勝〕', - 127560 => '〔敗〕', - 127568 => '得', - 127569 => '可', - 130032 => '0', - 130033 => '1', - 130034 => '2', - 130035 => '3', - 130036 => '4', - 130037 => '5', - 130038 => '6', - 130039 => '7', - 130040 => '8', - 130041 => '9', - 194560 => '丽', - 194561 => '丸', - 194562 => '乁', - 194563 => '𠄢', - 194564 => '你', - 194565 => '侮', - 194566 => '侻', - 194567 => '倂', - 194568 => '偺', - 194569 => '備', - 194570 => '僧', - 194571 => '像', - 194572 => '㒞', - 194573 => '𠘺', - 194574 => '免', - 194575 => '兔', - 194576 => '兤', - 194577 => '具', - 194578 => '𠔜', - 194579 => '㒹', - 194580 => '內', - 194581 => '再', - 194582 => '𠕋', - 194583 => '冗', - 194584 => '冤', - 194585 => '仌', - 194586 => '冬', - 194587 => '况', - 194588 => '𩇟', - 194589 => '凵', - 194590 => '刃', - 194591 => '㓟', - 194592 => '刻', - 194593 => '剆', - 194594 => '割', - 194595 => '剷', - 194596 => '㔕', - 194597 => '勇', - 194598 => '勉', - 194599 => '勤', - 194600 => '勺', - 194601 => '包', - 194602 => '匆', - 194603 => '北', - 194604 => '卉', - 194605 => '卑', - 194606 => '博', - 194607 => '即', - 194608 => '卽', - 194609 => '卿', - 194610 => '卿', - 194611 => '卿', - 194612 => '𠨬', - 194613 => '灰', - 194614 => '及', - 194615 => '叟', - 194616 => '𠭣', - 194617 => '叫', - 194618 => '叱', - 194619 => '吆', - 194620 => '咞', - 194621 => '吸', - 194622 => '呈', - 194623 => '周', - 194624 => '咢', - 194625 => '哶', - 194626 => '唐', - 194627 => '啓', - 194628 => '啣', - 194629 => '善', - 194630 => '善', - 194631 => '喙', - 194632 => '喫', - 194633 => '喳', - 194634 => '嗂', - 194635 => '圖', - 194636 => '嘆', - 194637 => '圗', - 194638 => '噑', - 194639 => '噴', - 194640 => '切', - 194641 => '壮', - 194642 => '城', - 194643 => '埴', - 194644 => '堍', - 194645 => '型', - 194646 => '堲', - 194647 => '報', - 194648 => '墬', - 194649 => '𡓤', - 194650 => '売', - 194651 => '壷', - 194652 => '夆', - 194653 => '多', - 194654 => '夢', - 194655 => '奢', - 194656 => '𡚨', - 194657 => '𡛪', - 194658 => '姬', - 194659 => '娛', - 194660 => '娧', - 194661 => '姘', - 194662 => '婦', - 194663 => '㛮', - 194665 => '嬈', - 194666 => '嬾', - 194667 => '嬾', - 194668 => '𡧈', - 194669 => '寃', - 194670 => '寘', - 194671 => '寧', - 194672 => '寳', - 194673 => '𡬘', - 194674 => '寿', - 194675 => '将', - 194677 => '尢', - 194678 => '㞁', - 194679 => '屠', - 194680 => '屮', - 194681 => '峀', - 194682 => '岍', - 194683 => '𡷤', - 194684 => '嵃', - 194685 => '𡷦', - 194686 => '嵮', - 194687 => '嵫', - 194688 => '嵼', - 194689 => '巡', - 194690 => '巢', - 194691 => '㠯', - 194692 => '巽', - 194693 => '帨', - 194694 => '帽', - 194695 => '幩', - 194696 => '㡢', - 194697 => '𢆃', - 194698 => '㡼', - 194699 => '庰', - 194700 => '庳', - 194701 => '庶', - 194702 => '廊', - 194703 => '𪎒', - 194704 => '廾', - 194705 => '𢌱', - 194706 => '𢌱', - 194707 => '舁', - 194708 => '弢', - 194709 => '弢', - 194710 => '㣇', - 194711 => '𣊸', - 194712 => '𦇚', - 194713 => '形', - 194714 => '彫', - 194715 => '㣣', - 194716 => '徚', - 194717 => '忍', - 194718 => '志', - 194719 => '忹', - 194720 => '悁', - 194721 => '㤺', - 194722 => '㤜', - 194723 => '悔', - 194724 => '𢛔', - 194725 => '惇', - 194726 => '慈', - 194727 => '慌', - 194728 => '慎', - 194729 => '慌', - 194730 => '慺', - 194731 => '憎', - 194732 => '憲', - 194733 => '憤', - 194734 => '憯', - 194735 => '懞', - 194736 => '懲', - 194737 => '懶', - 194738 => '成', - 194739 => '戛', - 194740 => '扝', - 194741 => '抱', - 194742 => '拔', - 194743 => '捐', - 194744 => '𢬌', - 194745 => '挽', - 194746 => '拼', - 194747 => '捨', - 194748 => '掃', - 194749 => '揤', - 194750 => '𢯱', - 194751 => '搢', - 194752 => '揅', - 194753 => '掩', - 194754 => '㨮', - 194755 => '摩', - 194756 => '摾', - 194757 => '撝', - 194758 => '摷', - 194759 => '㩬', - 194760 => '敏', - 194761 => '敬', - 194762 => '𣀊', - 194763 => '旣', - 194764 => '書', - 194765 => '晉', - 194766 => '㬙', - 194767 => '暑', - 194768 => '㬈', - 194769 => '㫤', - 194770 => '冒', - 194771 => '冕', - 194772 => '最', - 194773 => '暜', - 194774 => '肭', - 194775 => '䏙', - 194776 => '朗', - 194777 => '望', - 194778 => '朡', - 194779 => '杞', - 194780 => '杓', - 194781 => '𣏃', - 194782 => '㭉', - 194783 => '柺', - 194784 => '枅', - 194785 => '桒', - 194786 => '梅', - 194787 => '𣑭', - 194788 => '梎', - 194789 => '栟', - 194790 => '椔', - 194791 => '㮝', - 194792 => '楂', - 194793 => '榣', - 194794 => '槪', - 194795 => '檨', - 194796 => '𣚣', - 194797 => '櫛', - 194798 => '㰘', - 194799 => '次', - 194800 => '𣢧', - 194801 => '歔', - 194802 => '㱎', - 194803 => '歲', - 194804 => '殟', - 194805 => '殺', - 194806 => '殻', - 194807 => '𣪍', - 194808 => '𡴋', - 194809 => '𣫺', - 194810 => '汎', - 194811 => '𣲼', - 194812 => '沿', - 194813 => '泍', - 194814 => '汧', - 194815 => '洖', - 194816 => '派', - 194817 => '海', - 194818 => '流', - 194819 => '浩', - 194820 => '浸', - 194821 => '涅', - 194822 => '𣴞', - 194823 => '洴', - 194824 => '港', - 194825 => '湮', - 194826 => '㴳', - 194827 => '滋', - 194828 => '滇', - 194829 => '𣻑', - 194830 => '淹', - 194831 => '潮', - 194832 => '𣽞', - 194833 => '𣾎', - 194834 => '濆', - 194835 => '瀹', - 194836 => '瀞', - 194837 => '瀛', - 194838 => '㶖', - 194839 => '灊', - 194840 => '災', - 194841 => '灷', - 194842 => '炭', - 194843 => '𠔥', - 194844 => '煅', - 194845 => '𤉣', - 194846 => '熜', - 194848 => '爨', - 194849 => '爵', - 194850 => '牐', - 194851 => '𤘈', - 194852 => '犀', - 194853 => '犕', - 194854 => '𤜵', - 194855 => '𤠔', - 194856 => '獺', - 194857 => '王', - 194858 => '㺬', - 194859 => '玥', - 194860 => '㺸', - 194861 => '㺸', - 194862 => '瑇', - 194863 => '瑜', - 194864 => '瑱', - 194865 => '璅', - 194866 => '瓊', - 194867 => '㼛', - 194868 => '甤', - 194869 => '𤰶', - 194870 => '甾', - 194871 => '𤲒', - 194872 => '異', - 194873 => '𢆟', - 194874 => '瘐', - 194875 => '𤾡', - 194876 => '𤾸', - 194877 => '𥁄', - 194878 => '㿼', - 194879 => '䀈', - 194880 => '直', - 194881 => '𥃳', - 194882 => '𥃲', - 194883 => '𥄙', - 194884 => '𥄳', - 194885 => '眞', - 194886 => '真', - 194887 => '真', - 194888 => '睊', - 194889 => '䀹', - 194890 => '瞋', - 194891 => '䁆', - 194892 => '䂖', - 194893 => '𥐝', - 194894 => '硎', - 194895 => '碌', - 194896 => '磌', - 194897 => '䃣', - 194898 => '𥘦', - 194899 => '祖', - 194900 => '𥚚', - 194901 => '𥛅', - 194902 => '福', - 194903 => '秫', - 194904 => '䄯', - 194905 => '穀', - 194906 => '穊', - 194907 => '穏', - 194908 => '𥥼', - 194909 => '𥪧', - 194910 => '𥪧', - 194912 => '䈂', - 194913 => '𥮫', - 194914 => '篆', - 194915 => '築', - 194916 => '䈧', - 194917 => '𥲀', - 194918 => '糒', - 194919 => '䊠', - 194920 => '糨', - 194921 => '糣', - 194922 => '紀', - 194923 => '𥾆', - 194924 => '絣', - 194925 => '䌁', - 194926 => '緇', - 194927 => '縂', - 194928 => '繅', - 194929 => '䌴', - 194930 => '𦈨', - 194931 => '𦉇', - 194932 => '䍙', - 194933 => '𦋙', - 194934 => '罺', - 194935 => '𦌾', - 194936 => '羕', - 194937 => '翺', - 194938 => '者', - 194939 => '𦓚', - 194940 => '𦔣', - 194941 => '聠', - 194942 => '𦖨', - 194943 => '聰', - 194944 => '𣍟', - 194945 => '䏕', - 194946 => '育', - 194947 => '脃', - 194948 => '䐋', - 194949 => '脾', - 194950 => '媵', - 194951 => '𦞧', - 194952 => '𦞵', - 194953 => '𣎓', - 194954 => '𣎜', - 194955 => '舁', - 194956 => '舄', - 194957 => '辞', - 194958 => '䑫', - 194959 => '芑', - 194960 => '芋', - 194961 => '芝', - 194962 => '劳', - 194963 => '花', - 194964 => '芳', - 194965 => '芽', - 194966 => '苦', - 194967 => '𦬼', - 194968 => '若', - 194969 => '茝', - 194970 => '荣', - 194971 => '莭', - 194972 => '茣', - 194973 => '莽', - 194974 => '菧', - 194975 => '著', - 194976 => '荓', - 194977 => '菊', - 194978 => '菌', - 194979 => '菜', - 194980 => '𦰶', - 194981 => '𦵫', - 194982 => '𦳕', - 194983 => '䔫', - 194984 => '蓱', - 194985 => '蓳', - 194986 => '蔖', - 194987 => '𧏊', - 194988 => '蕤', - 194989 => '𦼬', - 194990 => '䕝', - 194991 => '䕡', - 194992 => '𦾱', - 194993 => '𧃒', - 194994 => '䕫', - 194995 => '虐', - 194996 => '虜', - 194997 => '虧', - 194998 => '虩', - 194999 => '蚩', - 195000 => '蚈', - 195001 => '蜎', - 195002 => '蛢', - 195003 => '蝹', - 195004 => '蜨', - 195005 => '蝫', - 195006 => '螆', - 195008 => '蟡', - 195009 => '蠁', - 195010 => '䗹', - 195011 => '衠', - 195012 => '衣', - 195013 => '𧙧', - 195014 => '裗', - 195015 => '裞', - 195016 => '䘵', - 195017 => '裺', - 195018 => '㒻', - 195019 => '𧢮', - 195020 => '𧥦', - 195021 => '䚾', - 195022 => '䛇', - 195023 => '誠', - 195024 => '諭', - 195025 => '變', - 195026 => '豕', - 195027 => '𧲨', - 195028 => '貫', - 195029 => '賁', - 195030 => '贛', - 195031 => '起', - 195032 => '𧼯', - 195033 => '𠠄', - 195034 => '跋', - 195035 => '趼', - 195036 => '跰', - 195037 => '𠣞', - 195038 => '軔', - 195039 => '輸', - 195040 => '𨗒', - 195041 => '𨗭', - 195042 => '邔', - 195043 => '郱', - 195044 => '鄑', - 195045 => '𨜮', - 195046 => '鄛', - 195047 => '鈸', - 195048 => '鋗', - 195049 => '鋘', - 195050 => '鉼', - 195051 => '鏹', - 195052 => '鐕', - 195053 => '𨯺', - 195054 => '開', - 195055 => '䦕', - 195056 => '閷', - 195057 => '𨵷', - 195058 => '䧦', - 195059 => '雃', - 195060 => '嶲', - 195061 => '霣', - 195062 => '𩅅', - 195063 => '𩈚', - 195064 => '䩮', - 195065 => '䩶', - 195066 => '韠', - 195067 => '𩐊', - 195068 => '䪲', - 195069 => '𩒖', - 195070 => '頋', - 195071 => '頋', - 195072 => '頩', - 195073 => '𩖶', - 195074 => '飢', - 195075 => '䬳', - 195076 => '餩', - 195077 => '馧', - 195078 => '駂', - 195079 => '駾', - 195080 => '䯎', - 195081 => '𩬰', - 195082 => '鬒', - 195083 => '鱀', - 195084 => '鳽', - 195085 => '䳎', - 195086 => '䳭', - 195087 => '鵧', - 195088 => '𪃎', - 195089 => '䳸', - 195090 => '𪄅', - 195091 => '𪈎', - 195092 => '𪊑', - 195093 => '麻', - 195094 => '䵖', - 195095 => '黹', - 195096 => '黾', - 195097 => '鼅', - 195098 => '鼏', - 195099 => '鼖', - 195100 => '鼻', - 195101 => '𪘀', -); diff --git a/vendor/symfony/polyfill-intl-idn/Resources/unidata/virama.php b/vendor/symfony/polyfill-intl-idn/Resources/unidata/virama.php deleted file mode 100644 index 1958e37e..00000000 --- a/vendor/symfony/polyfill-intl-idn/Resources/unidata/virama.php +++ /dev/null @@ -1,65 +0,0 @@ - 9, - 2509 => 9, - 2637 => 9, - 2765 => 9, - 2893 => 9, - 3021 => 9, - 3149 => 9, - 3277 => 9, - 3387 => 9, - 3388 => 9, - 3405 => 9, - 3530 => 9, - 3642 => 9, - 3770 => 9, - 3972 => 9, - 4153 => 9, - 4154 => 9, - 5908 => 9, - 5940 => 9, - 6098 => 9, - 6752 => 9, - 6980 => 9, - 7082 => 9, - 7083 => 9, - 7154 => 9, - 7155 => 9, - 11647 => 9, - 43014 => 9, - 43052 => 9, - 43204 => 9, - 43347 => 9, - 43456 => 9, - 43766 => 9, - 44013 => 9, - 68159 => 9, - 69702 => 9, - 69759 => 9, - 69817 => 9, - 69939 => 9, - 69940 => 9, - 70080 => 9, - 70197 => 9, - 70378 => 9, - 70477 => 9, - 70722 => 9, - 70850 => 9, - 71103 => 9, - 71231 => 9, - 71350 => 9, - 71467 => 9, - 71737 => 9, - 71997 => 9, - 71998 => 9, - 72160 => 9, - 72244 => 9, - 72263 => 9, - 72345 => 9, - 72767 => 9, - 73028 => 9, - 73029 => 9, - 73111 => 9, -); diff --git a/vendor/symfony/polyfill-intl-idn/bootstrap.php b/vendor/symfony/polyfill-intl-idn/bootstrap.php deleted file mode 100644 index 57c78356..00000000 --- a/vendor/symfony/polyfill-intl-idn/bootstrap.php +++ /dev/null @@ -1,145 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Intl\Idn as p; - -if (extension_loaded('intl')) { - return; -} - -if (\PHP_VERSION_ID >= 80000) { - return require __DIR__.'/bootstrap80.php'; -} - -if (!defined('U_IDNA_PROHIBITED_ERROR')) { - define('U_IDNA_PROHIBITED_ERROR', 66560); -} -if (!defined('U_IDNA_ERROR_START')) { - define('U_IDNA_ERROR_START', 66560); -} -if (!defined('U_IDNA_UNASSIGNED_ERROR')) { - define('U_IDNA_UNASSIGNED_ERROR', 66561); -} -if (!defined('U_IDNA_CHECK_BIDI_ERROR')) { - define('U_IDNA_CHECK_BIDI_ERROR', 66562); -} -if (!defined('U_IDNA_STD3_ASCII_RULES_ERROR')) { - define('U_IDNA_STD3_ASCII_RULES_ERROR', 66563); -} -if (!defined('U_IDNA_ACE_PREFIX_ERROR')) { - define('U_IDNA_ACE_PREFIX_ERROR', 66564); -} -if (!defined('U_IDNA_VERIFICATION_ERROR')) { - define('U_IDNA_VERIFICATION_ERROR', 66565); -} -if (!defined('U_IDNA_LABEL_TOO_LONG_ERROR')) { - define('U_IDNA_LABEL_TOO_LONG_ERROR', 66566); -} -if (!defined('U_IDNA_ZERO_LENGTH_LABEL_ERROR')) { - define('U_IDNA_ZERO_LENGTH_LABEL_ERROR', 66567); -} -if (!defined('U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR')) { - define('U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR', 66568); -} -if (!defined('U_IDNA_ERROR_LIMIT')) { - define('U_IDNA_ERROR_LIMIT', 66569); -} -if (!defined('U_STRINGPREP_PROHIBITED_ERROR')) { - define('U_STRINGPREP_PROHIBITED_ERROR', 66560); -} -if (!defined('U_STRINGPREP_UNASSIGNED_ERROR')) { - define('U_STRINGPREP_UNASSIGNED_ERROR', 66561); -} -if (!defined('U_STRINGPREP_CHECK_BIDI_ERROR')) { - define('U_STRINGPREP_CHECK_BIDI_ERROR', 66562); -} -if (!defined('IDNA_DEFAULT')) { - define('IDNA_DEFAULT', 0); -} -if (!defined('IDNA_ALLOW_UNASSIGNED')) { - define('IDNA_ALLOW_UNASSIGNED', 1); -} -if (!defined('IDNA_USE_STD3_RULES')) { - define('IDNA_USE_STD3_RULES', 2); -} -if (!defined('IDNA_CHECK_BIDI')) { - define('IDNA_CHECK_BIDI', 4); -} -if (!defined('IDNA_CHECK_CONTEXTJ')) { - define('IDNA_CHECK_CONTEXTJ', 8); -} -if (!defined('IDNA_NONTRANSITIONAL_TO_ASCII')) { - define('IDNA_NONTRANSITIONAL_TO_ASCII', 16); -} -if (!defined('IDNA_NONTRANSITIONAL_TO_UNICODE')) { - define('IDNA_NONTRANSITIONAL_TO_UNICODE', 32); -} -if (!defined('INTL_IDNA_VARIANT_2003')) { - define('INTL_IDNA_VARIANT_2003', 0); -} -if (!defined('INTL_IDNA_VARIANT_UTS46')) { - define('INTL_IDNA_VARIANT_UTS46', 1); -} -if (!defined('IDNA_ERROR_EMPTY_LABEL')) { - define('IDNA_ERROR_EMPTY_LABEL', 1); -} -if (!defined('IDNA_ERROR_LABEL_TOO_LONG')) { - define('IDNA_ERROR_LABEL_TOO_LONG', 2); -} -if (!defined('IDNA_ERROR_DOMAIN_NAME_TOO_LONG')) { - define('IDNA_ERROR_DOMAIN_NAME_TOO_LONG', 4); -} -if (!defined('IDNA_ERROR_LEADING_HYPHEN')) { - define('IDNA_ERROR_LEADING_HYPHEN', 8); -} -if (!defined('IDNA_ERROR_TRAILING_HYPHEN')) { - define('IDNA_ERROR_TRAILING_HYPHEN', 16); -} -if (!defined('IDNA_ERROR_HYPHEN_3_4')) { - define('IDNA_ERROR_HYPHEN_3_4', 32); -} -if (!defined('IDNA_ERROR_LEADING_COMBINING_MARK')) { - define('IDNA_ERROR_LEADING_COMBINING_MARK', 64); -} -if (!defined('IDNA_ERROR_DISALLOWED')) { - define('IDNA_ERROR_DISALLOWED', 128); -} -if (!defined('IDNA_ERROR_PUNYCODE')) { - define('IDNA_ERROR_PUNYCODE', 256); -} -if (!defined('IDNA_ERROR_LABEL_HAS_DOT')) { - define('IDNA_ERROR_LABEL_HAS_DOT', 512); -} -if (!defined('IDNA_ERROR_INVALID_ACE_LABEL')) { - define('IDNA_ERROR_INVALID_ACE_LABEL', 1024); -} -if (!defined('IDNA_ERROR_BIDI')) { - define('IDNA_ERROR_BIDI', 2048); -} -if (!defined('IDNA_ERROR_CONTEXTJ')) { - define('IDNA_ERROR_CONTEXTJ', 4096); -} - -if (\PHP_VERSION_ID < 70400) { - if (!function_exists('idn_to_ascii')) { - function idn_to_ascii($domain, $flags = 0, $variant = \INTL_IDNA_VARIANT_2003, &$idna_info = null) { return p\Idn::idn_to_ascii($domain, $flags, $variant, $idna_info); } - } - if (!function_exists('idn_to_utf8')) { - function idn_to_utf8($domain, $flags = 0, $variant = \INTL_IDNA_VARIANT_2003, &$idna_info = null) { return p\Idn::idn_to_utf8($domain, $flags, $variant, $idna_info); } - } -} else { - if (!function_exists('idn_to_ascii')) { - function idn_to_ascii($domain, $flags = 0, $variant = \INTL_IDNA_VARIANT_UTS46, &$idna_info = null) { return p\Idn::idn_to_ascii($domain, $flags, $variant, $idna_info); } - } - if (!function_exists('idn_to_utf8')) { - function idn_to_utf8($domain, $flags = 0, $variant = \INTL_IDNA_VARIANT_UTS46, &$idna_info = null) { return p\Idn::idn_to_utf8($domain, $flags, $variant, $idna_info); } - } -} diff --git a/vendor/symfony/polyfill-intl-idn/bootstrap80.php b/vendor/symfony/polyfill-intl-idn/bootstrap80.php deleted file mode 100644 index a62c2d69..00000000 --- a/vendor/symfony/polyfill-intl-idn/bootstrap80.php +++ /dev/null @@ -1,125 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Intl\Idn as p; - -if (!defined('U_IDNA_PROHIBITED_ERROR')) { - define('U_IDNA_PROHIBITED_ERROR', 66560); -} -if (!defined('U_IDNA_ERROR_START')) { - define('U_IDNA_ERROR_START', 66560); -} -if (!defined('U_IDNA_UNASSIGNED_ERROR')) { - define('U_IDNA_UNASSIGNED_ERROR', 66561); -} -if (!defined('U_IDNA_CHECK_BIDI_ERROR')) { - define('U_IDNA_CHECK_BIDI_ERROR', 66562); -} -if (!defined('U_IDNA_STD3_ASCII_RULES_ERROR')) { - define('U_IDNA_STD3_ASCII_RULES_ERROR', 66563); -} -if (!defined('U_IDNA_ACE_PREFIX_ERROR')) { - define('U_IDNA_ACE_PREFIX_ERROR', 66564); -} -if (!defined('U_IDNA_VERIFICATION_ERROR')) { - define('U_IDNA_VERIFICATION_ERROR', 66565); -} -if (!defined('U_IDNA_LABEL_TOO_LONG_ERROR')) { - define('U_IDNA_LABEL_TOO_LONG_ERROR', 66566); -} -if (!defined('U_IDNA_ZERO_LENGTH_LABEL_ERROR')) { - define('U_IDNA_ZERO_LENGTH_LABEL_ERROR', 66567); -} -if (!defined('U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR')) { - define('U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR', 66568); -} -if (!defined('U_IDNA_ERROR_LIMIT')) { - define('U_IDNA_ERROR_LIMIT', 66569); -} -if (!defined('U_STRINGPREP_PROHIBITED_ERROR')) { - define('U_STRINGPREP_PROHIBITED_ERROR', 66560); -} -if (!defined('U_STRINGPREP_UNASSIGNED_ERROR')) { - define('U_STRINGPREP_UNASSIGNED_ERROR', 66561); -} -if (!defined('U_STRINGPREP_CHECK_BIDI_ERROR')) { - define('U_STRINGPREP_CHECK_BIDI_ERROR', 66562); -} -if (!defined('IDNA_DEFAULT')) { - define('IDNA_DEFAULT', 0); -} -if (!defined('IDNA_ALLOW_UNASSIGNED')) { - define('IDNA_ALLOW_UNASSIGNED', 1); -} -if (!defined('IDNA_USE_STD3_RULES')) { - define('IDNA_USE_STD3_RULES', 2); -} -if (!defined('IDNA_CHECK_BIDI')) { - define('IDNA_CHECK_BIDI', 4); -} -if (!defined('IDNA_CHECK_CONTEXTJ')) { - define('IDNA_CHECK_CONTEXTJ', 8); -} -if (!defined('IDNA_NONTRANSITIONAL_TO_ASCII')) { - define('IDNA_NONTRANSITIONAL_TO_ASCII', 16); -} -if (!defined('IDNA_NONTRANSITIONAL_TO_UNICODE')) { - define('IDNA_NONTRANSITIONAL_TO_UNICODE', 32); -} -if (!defined('INTL_IDNA_VARIANT_UTS46')) { - define('INTL_IDNA_VARIANT_UTS46', 1); -} -if (!defined('IDNA_ERROR_EMPTY_LABEL')) { - define('IDNA_ERROR_EMPTY_LABEL', 1); -} -if (!defined('IDNA_ERROR_LABEL_TOO_LONG')) { - define('IDNA_ERROR_LABEL_TOO_LONG', 2); -} -if (!defined('IDNA_ERROR_DOMAIN_NAME_TOO_LONG')) { - define('IDNA_ERROR_DOMAIN_NAME_TOO_LONG', 4); -} -if (!defined('IDNA_ERROR_LEADING_HYPHEN')) { - define('IDNA_ERROR_LEADING_HYPHEN', 8); -} -if (!defined('IDNA_ERROR_TRAILING_HYPHEN')) { - define('IDNA_ERROR_TRAILING_HYPHEN', 16); -} -if (!defined('IDNA_ERROR_HYPHEN_3_4')) { - define('IDNA_ERROR_HYPHEN_3_4', 32); -} -if (!defined('IDNA_ERROR_LEADING_COMBINING_MARK')) { - define('IDNA_ERROR_LEADING_COMBINING_MARK', 64); -} -if (!defined('IDNA_ERROR_DISALLOWED')) { - define('IDNA_ERROR_DISALLOWED', 128); -} -if (!defined('IDNA_ERROR_PUNYCODE')) { - define('IDNA_ERROR_PUNYCODE', 256); -} -if (!defined('IDNA_ERROR_LABEL_HAS_DOT')) { - define('IDNA_ERROR_LABEL_HAS_DOT', 512); -} -if (!defined('IDNA_ERROR_INVALID_ACE_LABEL')) { - define('IDNA_ERROR_INVALID_ACE_LABEL', 1024); -} -if (!defined('IDNA_ERROR_BIDI')) { - define('IDNA_ERROR_BIDI', 2048); -} -if (!defined('IDNA_ERROR_CONTEXTJ')) { - define('IDNA_ERROR_CONTEXTJ', 4096); -} - -if (!function_exists('idn_to_ascii')) { - function idn_to_ascii(?string $domain, ?int $flags = IDNA_DEFAULT, ?int $variant = INTL_IDNA_VARIANT_UTS46, &$idna_info = null): string|false { return p\Idn::idn_to_ascii((string) $domain, (int) $flags, (int) $variant, $idna_info); } -} -if (!function_exists('idn_to_utf8')) { - function idn_to_utf8(?string $domain, ?int $flags = IDNA_DEFAULT, ?int $variant = INTL_IDNA_VARIANT_UTS46, &$idna_info = null): string|false { return p\Idn::idn_to_utf8((string) $domain, (int) $flags, (int) $variant, $idna_info); } -} diff --git a/vendor/symfony/polyfill-intl-idn/composer.json b/vendor/symfony/polyfill-intl-idn/composer.json deleted file mode 100644 index 105e3d06..00000000 --- a/vendor/symfony/polyfill-intl-idn/composer.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "symfony/polyfill-intl-idn", - "type": "library", - "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", - "keywords": ["polyfill", "shim", "compatibility", "portable", "intl", "idn"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Laurent Bassin", - "email": "laurent@bassin.info" - }, - { - "name": "Trevor Rowbotham", - "email": "trevor.rowbotham@pm.me" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1", - "symfony/polyfill-intl-normalizer": "^1.10", - "symfony/polyfill-php72": "^1.10" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Intl\\Idn\\": "" }, - "files": [ "bootstrap.php" ] - }, - "suggest": { - "ext-intl": "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-intl-normalizer/LICENSE b/vendor/symfony/polyfill-intl-normalizer/LICENSE deleted file mode 100644 index 4cd8bdd3..00000000 --- a/vendor/symfony/polyfill-intl-normalizer/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-intl-normalizer/Normalizer.php b/vendor/symfony/polyfill-intl-normalizer/Normalizer.php deleted file mode 100644 index 81704ab3..00000000 --- a/vendor/symfony/polyfill-intl-normalizer/Normalizer.php +++ /dev/null @@ -1,310 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Intl\Normalizer; - -/** - * Normalizer is a PHP fallback implementation of the Normalizer class provided by the intl extension. - * - * It has been validated with Unicode 6.3 Normalization Conformance Test. - * See http://www.unicode.org/reports/tr15/ for detailed info about Unicode normalizations. - * - * @author Nicolas Grekas - * - * @internal - */ -class Normalizer -{ - public const FORM_D = \Normalizer::FORM_D; - public const FORM_KD = \Normalizer::FORM_KD; - public const FORM_C = \Normalizer::FORM_C; - public const FORM_KC = \Normalizer::FORM_KC; - public const NFD = \Normalizer::NFD; - public const NFKD = \Normalizer::NFKD; - public const NFC = \Normalizer::NFC; - public const NFKC = \Normalizer::NFKC; - - private static $C; - private static $D; - private static $KD; - private static $cC; - private static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; - private static $ASCII = "\x20\x65\x69\x61\x73\x6E\x74\x72\x6F\x6C\x75\x64\x5D\x5B\x63\x6D\x70\x27\x0A\x67\x7C\x68\x76\x2E\x66\x62\x2C\x3A\x3D\x2D\x71\x31\x30\x43\x32\x2A\x79\x78\x29\x28\x4C\x39\x41\x53\x2F\x50\x22\x45\x6A\x4D\x49\x6B\x33\x3E\x35\x54\x3C\x44\x34\x7D\x42\x7B\x38\x46\x77\x52\x36\x37\x55\x47\x4E\x3B\x4A\x7A\x56\x23\x48\x4F\x57\x5F\x26\x21\x4B\x3F\x58\x51\x25\x59\x5C\x09\x5A\x2B\x7E\x5E\x24\x40\x60\x7F\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"; - - public static function isNormalized(string $s, int $form = self::FORM_C) - { - if (!\in_array($form, [self::NFD, self::NFKD, self::NFC, self::NFKC])) { - return false; - } - if (!isset($s[strspn($s, self::$ASCII)])) { - return true; - } - if (self::NFC == $form && preg_match('//u', $s) && !preg_match('/[^\x00-\x{2FF}]/u', $s)) { - return true; - } - - return self::normalize($s, $form) === $s; - } - - public static function normalize(string $s, int $form = self::FORM_C) - { - if (!preg_match('//u', $s)) { - return false; - } - - switch ($form) { - case self::NFC: $C = true; $K = false; break; - case self::NFD: $C = false; $K = false; break; - case self::NFKC: $C = true; $K = true; break; - case self::NFKD: $C = false; $K = true; break; - default: - if (\defined('Normalizer::NONE') && \Normalizer::NONE == $form) { - return $s; - } - - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError('normalizer_normalize(): Argument #2 ($form) must be a a valid normalization form'); - } - - if ('' === $s) { - return ''; - } - - if ($K && null === self::$KD) { - self::$KD = self::getData('compatibilityDecomposition'); - } - - if (null === self::$D) { - self::$D = self::getData('canonicalDecomposition'); - self::$cC = self::getData('combiningClass'); - } - - if (null !== $mbEncoding = (2 /* MB_OVERLOAD_STRING */ & (int) \ini_get('mbstring.func_overload')) ? mb_internal_encoding() : null) { - mb_internal_encoding('8bit'); - } - - $r = self::decompose($s, $K); - - if ($C) { - if (null === self::$C) { - self::$C = self::getData('canonicalComposition'); - } - - $r = self::recompose($r); - } - if (null !== $mbEncoding) { - mb_internal_encoding($mbEncoding); - } - - return $r; - } - - private static function recompose($s) - { - $ASCII = self::$ASCII; - $compMap = self::$C; - $combClass = self::$cC; - $ulenMask = self::$ulenMask; - - $result = $tail = ''; - - $i = $s[0] < "\x80" ? 1 : $ulenMask[$s[0] & "\xF0"]; - $len = \strlen($s); - - $lastUchr = substr($s, 0, $i); - $lastUcls = isset($combClass[$lastUchr]) ? 256 : 0; - - while ($i < $len) { - if ($s[$i] < "\x80") { - // ASCII chars - - if ($tail) { - $lastUchr .= $tail; - $tail = ''; - } - - if ($j = strspn($s, $ASCII, $i + 1)) { - $lastUchr .= substr($s, $i, $j); - $i += $j; - } - - $result .= $lastUchr; - $lastUchr = $s[$i]; - $lastUcls = 0; - ++$i; - continue; - } - - $ulen = $ulenMask[$s[$i] & "\xF0"]; - $uchr = substr($s, $i, $ulen); - - if ($lastUchr < "\xE1\x84\x80" || "\xE1\x84\x92" < $lastUchr - || $uchr < "\xE1\x85\xA1" || "\xE1\x85\xB5" < $uchr - || $lastUcls) { - // Table lookup and combining chars composition - - $ucls = $combClass[$uchr] ?? 0; - - if (isset($compMap[$lastUchr.$uchr]) && (!$lastUcls || $lastUcls < $ucls)) { - $lastUchr = $compMap[$lastUchr.$uchr]; - } elseif ($lastUcls = $ucls) { - $tail .= $uchr; - } else { - if ($tail) { - $lastUchr .= $tail; - $tail = ''; - } - - $result .= $lastUchr; - $lastUchr = $uchr; - } - } else { - // Hangul chars - - $L = \ord($lastUchr[2]) - 0x80; - $V = \ord($uchr[2]) - 0xA1; - $T = 0; - - $uchr = substr($s, $i + $ulen, 3); - - if ("\xE1\x86\xA7" <= $uchr && $uchr <= "\xE1\x87\x82") { - $T = \ord($uchr[2]) - 0xA7; - 0 > $T && $T += 0x40; - $ulen += 3; - } - - $L = 0xAC00 + ($L * 21 + $V) * 28 + $T; - $lastUchr = \chr(0xE0 | $L >> 12).\chr(0x80 | $L >> 6 & 0x3F).\chr(0x80 | $L & 0x3F); - } - - $i += $ulen; - } - - return $result.$lastUchr.$tail; - } - - private static function decompose($s, $c) - { - $result = ''; - - $ASCII = self::$ASCII; - $decompMap = self::$D; - $combClass = self::$cC; - $ulenMask = self::$ulenMask; - if ($c) { - $compatMap = self::$KD; - } - - $c = []; - $i = 0; - $len = \strlen($s); - - while ($i < $len) { - if ($s[$i] < "\x80") { - // ASCII chars - - if ($c) { - ksort($c); - $result .= implode('', $c); - $c = []; - } - - $j = 1 + strspn($s, $ASCII, $i + 1); - $result .= substr($s, $i, $j); - $i += $j; - continue; - } - - $ulen = $ulenMask[$s[$i] & "\xF0"]; - $uchr = substr($s, $i, $ulen); - $i += $ulen; - - if ($uchr < "\xEA\xB0\x80" || "\xED\x9E\xA3" < $uchr) { - // Table lookup - - if ($uchr !== $j = $compatMap[$uchr] ?? ($decompMap[$uchr] ?? $uchr)) { - $uchr = $j; - - $j = \strlen($uchr); - $ulen = $uchr[0] < "\x80" ? 1 : $ulenMask[$uchr[0] & "\xF0"]; - - if ($ulen != $j) { - // Put trailing chars in $s - - $j -= $ulen; - $i -= $j; - - if (0 > $i) { - $s = str_repeat(' ', -$i).$s; - $len -= $i; - $i = 0; - } - - while ($j--) { - $s[$i + $j] = $uchr[$ulen + $j]; - } - - $uchr = substr($uchr, 0, $ulen); - } - } - if (isset($combClass[$uchr])) { - // Combining chars, for sorting - - if (!isset($c[$combClass[$uchr]])) { - $c[$combClass[$uchr]] = ''; - } - $c[$combClass[$uchr]] .= $uchr; - continue; - } - } else { - // Hangul chars - - $uchr = unpack('C*', $uchr); - $j = (($uchr[1] - 224) << 12) + (($uchr[2] - 128) << 6) + $uchr[3] - 0xAC80; - - $uchr = "\xE1\x84".\chr(0x80 + (int) ($j / 588)) - ."\xE1\x85".\chr(0xA1 + (int) (($j % 588) / 28)); - - if ($j %= 28) { - $uchr .= $j < 25 - ? ("\xE1\x86".\chr(0xA7 + $j)) - : ("\xE1\x87".\chr(0x67 + $j)); - } - } - if ($c) { - ksort($c); - $result .= implode('', $c); - $c = []; - } - - $result .= $uchr; - } - - if ($c) { - ksort($c); - $result .= implode('', $c); - } - - return $result; - } - - private static function getData($file) - { - if (file_exists($file = __DIR__.'/Resources/unidata/'.$file.'.php')) { - return require $file; - } - - return false; - } -} diff --git a/vendor/symfony/polyfill-intl-normalizer/README.md b/vendor/symfony/polyfill-intl-normalizer/README.md deleted file mode 100644 index b9b762e8..00000000 --- a/vendor/symfony/polyfill-intl-normalizer/README.md +++ /dev/null @@ -1,14 +0,0 @@ -Symfony Polyfill / Intl: Normalizer -=================================== - -This component provides a fallback implementation for the -[`Normalizer`](https://php.net/Normalizer) class provided -by the [Intl](https://php.net/intl) 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-intl-normalizer/Resources/stubs/Normalizer.php b/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php deleted file mode 100644 index 0fdfc890..00000000 --- a/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php +++ /dev/null @@ -1,17 +0,0 @@ - 'À', - 'Á' => 'Á', - 'Â' => 'Â', - 'Ã' => 'Ã', - 'Ä' => 'Ä', - 'Å' => 'Å', - 'Ç' => 'Ç', - 'È' => 'È', - 'É' => 'É', - 'Ê' => 'Ê', - 'Ë' => 'Ë', - 'Ì' => 'Ì', - 'Í' => 'Í', - 'Î' => 'Î', - 'Ï' => 'Ï', - 'Ñ' => 'Ñ', - 'Ò' => 'Ò', - 'Ó' => 'Ó', - 'Ô' => 'Ô', - 'Õ' => 'Õ', - 'Ö' => 'Ö', - 'Ù' => 'Ù', - 'Ú' => 'Ú', - 'Û' => 'Û', - 'Ü' => 'Ü', - 'Ý' => 'Ý', - 'à' => 'à', - 'á' => 'á', - 'â' => 'â', - 'ã' => 'ã', - 'ä' => 'ä', - 'å' => 'å', - 'ç' => 'ç', - 'è' => 'è', - 'é' => 'é', - 'ê' => 'ê', - 'ë' => 'ë', - 'ì' => 'ì', - 'í' => 'í', - 'î' => 'î', - 'ï' => 'ï', - 'ñ' => 'ñ', - 'ò' => 'ò', - 'ó' => 'ó', - 'ô' => 'ô', - 'õ' => 'õ', - 'ö' => 'ö', - 'ù' => 'ù', - 'ú' => 'ú', - 'û' => 'û', - 'ü' => 'ü', - 'ý' => 'ý', - 'ÿ' => 'ÿ', - 'Ā' => 'Ā', - 'ā' => 'ā', - 'Ă' => 'Ă', - 'ă' => 'ă', - 'Ą' => 'Ą', - 'ą' => 'ą', - 'Ć' => 'Ć', - 'ć' => 'ć', - 'Ĉ' => 'Ĉ', - 'ĉ' => 'ĉ', - 'Ċ' => 'Ċ', - 'ċ' => 'ċ', - 'Č' => 'Č', - 'č' => 'č', - 'Ď' => 'Ď', - 'ď' => 'ď', - 'Ē' => 'Ē', - 'ē' => 'ē', - 'Ĕ' => 'Ĕ', - 'ĕ' => 'ĕ', - 'Ė' => 'Ė', - 'ė' => 'ė', - 'Ę' => 'Ę', - 'ę' => 'ę', - 'Ě' => 'Ě', - 'ě' => 'ě', - 'Ĝ' => 'Ĝ', - 'ĝ' => 'ĝ', - 'Ğ' => 'Ğ', - 'ğ' => 'ğ', - 'Ġ' => 'Ġ', - 'ġ' => 'ġ', - 'Ģ' => 'Ģ', - 'ģ' => 'ģ', - 'Ĥ' => 'Ĥ', - 'ĥ' => 'ĥ', - 'Ĩ' => 'Ĩ', - 'ĩ' => 'ĩ', - 'Ī' => 'Ī', - 'ī' => 'ī', - 'Ĭ' => 'Ĭ', - 'ĭ' => 'ĭ', - 'Į' => 'Į', - 'į' => 'į', - 'İ' => 'İ', - 'Ĵ' => 'Ĵ', - 'ĵ' => 'ĵ', - 'Ķ' => 'Ķ', - 'ķ' => 'ķ', - 'Ĺ' => 'Ĺ', - 'ĺ' => 'ĺ', - 'Ļ' => 'Ļ', - 'ļ' => 'ļ', - 'Ľ' => 'Ľ', - 'ľ' => 'ľ', - 'Ń' => 'Ń', - 'ń' => 'ń', - 'Ņ' => 'Ņ', - 'ņ' => 'ņ', - 'Ň' => 'Ň', - 'ň' => 'ň', - 'Ō' => 'Ō', - 'ō' => 'ō', - 'Ŏ' => 'Ŏ', - 'ŏ' => 'ŏ', - 'Ő' => 'Ő', - 'ő' => 'ő', - 'Ŕ' => 'Ŕ', - 'ŕ' => 'ŕ', - 'Ŗ' => 'Ŗ', - 'ŗ' => 'ŗ', - 'Ř' => 'Ř', - 'ř' => 'ř', - 'Ś' => 'Ś', - 'ś' => 'ś', - 'Ŝ' => 'Ŝ', - 'ŝ' => 'ŝ', - 'Ş' => 'Ş', - 'ş' => 'ş', - 'Š' => 'Š', - 'š' => 'š', - 'Ţ' => 'Ţ', - 'ţ' => 'ţ', - 'Ť' => 'Ť', - 'ť' => 'ť', - 'Ũ' => 'Ũ', - 'ũ' => 'ũ', - 'Ū' => 'Ū', - 'ū' => 'ū', - 'Ŭ' => 'Ŭ', - 'ŭ' => 'ŭ', - 'Ů' => 'Ů', - 'ů' => 'ů', - 'Ű' => 'Ű', - 'ű' => 'ű', - 'Ų' => 'Ų', - 'ų' => 'ų', - 'Ŵ' => 'Ŵ', - 'ŵ' => 'ŵ', - 'Ŷ' => 'Ŷ', - 'ŷ' => 'ŷ', - 'Ÿ' => 'Ÿ', - 'Ź' => 'Ź', - 'ź' => 'ź', - 'Ż' => 'Ż', - 'ż' => 'ż', - 'Ž' => 'Ž', - 'ž' => 'ž', - 'Ơ' => 'Ơ', - 'ơ' => 'ơ', - 'Ư' => 'Ư', - 'ư' => 'ư', - 'Ǎ' => 'Ǎ', - 'ǎ' => 'ǎ', - 'Ǐ' => 'Ǐ', - 'ǐ' => 'ǐ', - 'Ǒ' => 'Ǒ', - 'ǒ' => 'ǒ', - 'Ǔ' => 'Ǔ', - 'ǔ' => 'ǔ', - 'Ǖ' => 'Ǖ', - 'ǖ' => 'ǖ', - 'Ǘ' => 'Ǘ', - 'ǘ' => 'ǘ', - 'Ǚ' => 'Ǚ', - 'ǚ' => 'ǚ', - 'Ǜ' => 'Ǜ', - 'ǜ' => 'ǜ', - 'Ǟ' => 'Ǟ', - 'ǟ' => 'ǟ', - 'Ǡ' => 'Ǡ', - 'ǡ' => 'ǡ', - 'Ǣ' => 'Ǣ', - 'ǣ' => 'ǣ', - 'Ǧ' => 'Ǧ', - 'ǧ' => 'ǧ', - 'Ǩ' => 'Ǩ', - 'ǩ' => 'ǩ', - 'Ǫ' => 'Ǫ', - 'ǫ' => 'ǫ', - 'Ǭ' => 'Ǭ', - 'ǭ' => 'ǭ', - 'Ǯ' => 'Ǯ', - 'ǯ' => 'ǯ', - 'ǰ' => 'ǰ', - 'Ǵ' => 'Ǵ', - 'ǵ' => 'ǵ', - 'Ǹ' => 'Ǹ', - 'ǹ' => 'ǹ', - 'Ǻ' => 'Ǻ', - 'ǻ' => 'ǻ', - 'Ǽ' => 'Ǽ', - 'ǽ' => 'ǽ', - 'Ǿ' => 'Ǿ', - 'ǿ' => 'ǿ', - 'Ȁ' => 'Ȁ', - 'ȁ' => 'ȁ', - 'Ȃ' => 'Ȃ', - 'ȃ' => 'ȃ', - 'Ȅ' => 'Ȅ', - 'ȅ' => 'ȅ', - 'Ȇ' => 'Ȇ', - 'ȇ' => 'ȇ', - 'Ȉ' => 'Ȉ', - 'ȉ' => 'ȉ', - 'Ȋ' => 'Ȋ', - 'ȋ' => 'ȋ', - 'Ȍ' => 'Ȍ', - 'ȍ' => 'ȍ', - 'Ȏ' => 'Ȏ', - 'ȏ' => 'ȏ', - 'Ȑ' => 'Ȑ', - 'ȑ' => 'ȑ', - 'Ȓ' => 'Ȓ', - 'ȓ' => 'ȓ', - 'Ȕ' => 'Ȕ', - 'ȕ' => 'ȕ', - 'Ȗ' => 'Ȗ', - 'ȗ' => 'ȗ', - 'Ș' => 'Ș', - 'ș' => 'ș', - 'Ț' => 'Ț', - 'ț' => 'ț', - 'Ȟ' => 'Ȟ', - 'ȟ' => 'ȟ', - 'Ȧ' => 'Ȧ', - 'ȧ' => 'ȧ', - 'Ȩ' => 'Ȩ', - 'ȩ' => 'ȩ', - 'Ȫ' => 'Ȫ', - 'ȫ' => 'ȫ', - 'Ȭ' => 'Ȭ', - 'ȭ' => 'ȭ', - 'Ȯ' => 'Ȯ', - 'ȯ' => 'ȯ', - 'Ȱ' => 'Ȱ', - 'ȱ' => 'ȱ', - 'Ȳ' => 'Ȳ', - 'ȳ' => 'ȳ', - '΅' => '΅', - 'Ά' => 'Ά', - 'Έ' => 'Έ', - 'Ή' => 'Ή', - 'Ί' => 'Ί', - 'Ό' => 'Ό', - 'Ύ' => 'Ύ', - 'Ώ' => 'Ώ', - 'ΐ' => 'ΐ', - 'Ϊ' => 'Ϊ', - 'Ϋ' => 'Ϋ', - 'ά' => 'ά', - 'έ' => 'έ', - 'ή' => 'ή', - 'ί' => 'ί', - 'ΰ' => 'ΰ', - 'ϊ' => 'ϊ', - 'ϋ' => 'ϋ', - 'ό' => 'ό', - 'ύ' => 'ύ', - 'ώ' => 'ώ', - 'ϓ' => 'ϓ', - 'ϔ' => 'ϔ', - 'Ѐ' => 'Ѐ', - 'Ё' => 'Ё', - 'Ѓ' => 'Ѓ', - 'Ї' => 'Ї', - 'Ќ' => 'Ќ', - 'Ѝ' => 'Ѝ', - 'Ў' => 'Ў', - 'Й' => 'Й', - 'й' => 'й', - 'ѐ' => 'ѐ', - 'ё' => 'ё', - 'ѓ' => 'ѓ', - 'ї' => 'ї', - 'ќ' => 'ќ', - 'ѝ' => 'ѝ', - 'ў' => 'ў', - 'Ѷ' => 'Ѷ', - 'ѷ' => 'ѷ', - 'Ӂ' => 'Ӂ', - 'ӂ' => 'ӂ', - 'Ӑ' => 'Ӑ', - 'ӑ' => 'ӑ', - 'Ӓ' => 'Ӓ', - 'ӓ' => 'ӓ', - 'Ӗ' => 'Ӗ', - 'ӗ' => 'ӗ', - 'Ӛ' => 'Ӛ', - 'ӛ' => 'ӛ', - 'Ӝ' => 'Ӝ', - 'ӝ' => 'ӝ', - 'Ӟ' => 'Ӟ', - 'ӟ' => 'ӟ', - 'Ӣ' => 'Ӣ', - 'ӣ' => 'ӣ', - 'Ӥ' => 'Ӥ', - 'ӥ' => 'ӥ', - 'Ӧ' => 'Ӧ', - 'ӧ' => 'ӧ', - 'Ӫ' => 'Ӫ', - 'ӫ' => 'ӫ', - 'Ӭ' => 'Ӭ', - 'ӭ' => 'ӭ', - 'Ӯ' => 'Ӯ', - 'ӯ' => 'ӯ', - 'Ӱ' => 'Ӱ', - 'ӱ' => 'ӱ', - 'Ӳ' => 'Ӳ', - 'ӳ' => 'ӳ', - 'Ӵ' => 'Ӵ', - 'ӵ' => 'ӵ', - 'Ӹ' => 'Ӹ', - 'ӹ' => 'ӹ', - 'آ' => 'آ', - 'أ' => 'أ', - 'ؤ' => 'ؤ', - 'إ' => 'إ', - 'ئ' => 'ئ', - 'ۀ' => 'ۀ', - 'ۂ' => 'ۂ', - 'ۓ' => 'ۓ', - 'ऩ' => 'ऩ', - 'ऱ' => 'ऱ', - 'ऴ' => 'ऴ', - 'ো' => 'ো', - 'ৌ' => 'ৌ', - 'ୈ' => 'ୈ', - 'ୋ' => 'ୋ', - 'ୌ' => 'ୌ', - 'ஔ' => 'ஔ', - 'ொ' => 'ொ', - 'ோ' => 'ோ', - 'ௌ' => 'ௌ', - 'ై' => 'ై', - 'ೀ' => 'ೀ', - 'ೇ' => 'ೇ', - 'ೈ' => 'ೈ', - 'ೊ' => 'ೊ', - 'ೋ' => 'ೋ', - 'ൊ' => 'ൊ', - 'ോ' => 'ോ', - 'ൌ' => 'ൌ', - 'ේ' => 'ේ', - 'ො' => 'ො', - 'ෝ' => 'ෝ', - 'ෞ' => 'ෞ', - 'ဦ' => 'ဦ', - 'ᬆ' => 'ᬆ', - 'ᬈ' => 'ᬈ', - 'ᬊ' => 'ᬊ', - 'ᬌ' => 'ᬌ', - 'ᬎ' => 'ᬎ', - 'ᬒ' => 'ᬒ', - 'ᬻ' => 'ᬻ', - 'ᬽ' => 'ᬽ', - 'ᭀ' => 'ᭀ', - 'ᭁ' => 'ᭁ', - 'ᭃ' => 'ᭃ', - 'Ḁ' => 'Ḁ', - 'ḁ' => 'ḁ', - 'Ḃ' => 'Ḃ', - 'ḃ' => 'ḃ', - 'Ḅ' => 'Ḅ', - 'ḅ' => 'ḅ', - 'Ḇ' => 'Ḇ', - 'ḇ' => 'ḇ', - 'Ḉ' => 'Ḉ', - 'ḉ' => 'ḉ', - 'Ḋ' => 'Ḋ', - 'ḋ' => 'ḋ', - 'Ḍ' => 'Ḍ', - 'ḍ' => 'ḍ', - 'Ḏ' => 'Ḏ', - 'ḏ' => 'ḏ', - 'Ḑ' => 'Ḑ', - 'ḑ' => 'ḑ', - 'Ḓ' => 'Ḓ', - 'ḓ' => 'ḓ', - 'Ḕ' => 'Ḕ', - 'ḕ' => 'ḕ', - 'Ḗ' => 'Ḗ', - 'ḗ' => 'ḗ', - 'Ḙ' => 'Ḙ', - 'ḙ' => 'ḙ', - 'Ḛ' => 'Ḛ', - 'ḛ' => 'ḛ', - 'Ḝ' => 'Ḝ', - 'ḝ' => 'ḝ', - 'Ḟ' => 'Ḟ', - 'ḟ' => 'ḟ', - 'Ḡ' => 'Ḡ', - 'ḡ' => 'ḡ', - 'Ḣ' => 'Ḣ', - 'ḣ' => 'ḣ', - 'Ḥ' => 'Ḥ', - 'ḥ' => 'ḥ', - 'Ḧ' => 'Ḧ', - 'ḧ' => 'ḧ', - 'Ḩ' => 'Ḩ', - 'ḩ' => 'ḩ', - 'Ḫ' => 'Ḫ', - 'ḫ' => 'ḫ', - 'Ḭ' => 'Ḭ', - 'ḭ' => 'ḭ', - 'Ḯ' => 'Ḯ', - 'ḯ' => 'ḯ', - 'Ḱ' => 'Ḱ', - 'ḱ' => 'ḱ', - 'Ḳ' => 'Ḳ', - 'ḳ' => 'ḳ', - 'Ḵ' => 'Ḵ', - 'ḵ' => 'ḵ', - 'Ḷ' => 'Ḷ', - 'ḷ' => 'ḷ', - 'Ḹ' => 'Ḹ', - 'ḹ' => 'ḹ', - 'Ḻ' => 'Ḻ', - 'ḻ' => 'ḻ', - 'Ḽ' => 'Ḽ', - 'ḽ' => 'ḽ', - 'Ḿ' => 'Ḿ', - 'ḿ' => 'ḿ', - 'Ṁ' => 'Ṁ', - 'ṁ' => 'ṁ', - 'Ṃ' => 'Ṃ', - 'ṃ' => 'ṃ', - 'Ṅ' => 'Ṅ', - 'ṅ' => 'ṅ', - 'Ṇ' => 'Ṇ', - 'ṇ' => 'ṇ', - 'Ṉ' => 'Ṉ', - 'ṉ' => 'ṉ', - 'Ṋ' => 'Ṋ', - 'ṋ' => 'ṋ', - 'Ṍ' => 'Ṍ', - 'ṍ' => 'ṍ', - 'Ṏ' => 'Ṏ', - 'ṏ' => 'ṏ', - 'Ṑ' => 'Ṑ', - 'ṑ' => 'ṑ', - 'Ṓ' => 'Ṓ', - 'ṓ' => 'ṓ', - 'Ṕ' => 'Ṕ', - 'ṕ' => 'ṕ', - 'Ṗ' => 'Ṗ', - 'ṗ' => 'ṗ', - 'Ṙ' => 'Ṙ', - 'ṙ' => 'ṙ', - 'Ṛ' => 'Ṛ', - 'ṛ' => 'ṛ', - 'Ṝ' => 'Ṝ', - 'ṝ' => 'ṝ', - 'Ṟ' => 'Ṟ', - 'ṟ' => 'ṟ', - 'Ṡ' => 'Ṡ', - 'ṡ' => 'ṡ', - 'Ṣ' => 'Ṣ', - 'ṣ' => 'ṣ', - 'Ṥ' => 'Ṥ', - 'ṥ' => 'ṥ', - 'Ṧ' => 'Ṧ', - 'ṧ' => 'ṧ', - 'Ṩ' => 'Ṩ', - 'ṩ' => 'ṩ', - 'Ṫ' => 'Ṫ', - 'ṫ' => 'ṫ', - 'Ṭ' => 'Ṭ', - 'ṭ' => 'ṭ', - 'Ṯ' => 'Ṯ', - 'ṯ' => 'ṯ', - 'Ṱ' => 'Ṱ', - 'ṱ' => 'ṱ', - 'Ṳ' => 'Ṳ', - 'ṳ' => 'ṳ', - 'Ṵ' => 'Ṵ', - 'ṵ' => 'ṵ', - 'Ṷ' => 'Ṷ', - 'ṷ' => 'ṷ', - 'Ṹ' => 'Ṹ', - 'ṹ' => 'ṹ', - 'Ṻ' => 'Ṻ', - 'ṻ' => 'ṻ', - 'Ṽ' => 'Ṽ', - 'ṽ' => 'ṽ', - 'Ṿ' => 'Ṿ', - 'ṿ' => 'ṿ', - 'Ẁ' => 'Ẁ', - 'ẁ' => 'ẁ', - 'Ẃ' => 'Ẃ', - 'ẃ' => 'ẃ', - 'Ẅ' => 'Ẅ', - 'ẅ' => 'ẅ', - 'Ẇ' => 'Ẇ', - 'ẇ' => 'ẇ', - 'Ẉ' => 'Ẉ', - 'ẉ' => 'ẉ', - 'Ẋ' => 'Ẋ', - 'ẋ' => 'ẋ', - 'Ẍ' => 'Ẍ', - 'ẍ' => 'ẍ', - 'Ẏ' => 'Ẏ', - 'ẏ' => 'ẏ', - 'Ẑ' => 'Ẑ', - 'ẑ' => 'ẑ', - 'Ẓ' => 'Ẓ', - 'ẓ' => 'ẓ', - 'Ẕ' => 'Ẕ', - 'ẕ' => 'ẕ', - 'ẖ' => 'ẖ', - 'ẗ' => 'ẗ', - 'ẘ' => 'ẘ', - 'ẙ' => 'ẙ', - 'ẛ' => 'ẛ', - 'Ạ' => 'Ạ', - 'ạ' => 'ạ', - 'Ả' => 'Ả', - 'ả' => 'ả', - 'Ấ' => 'Ấ', - 'ấ' => 'ấ', - 'Ầ' => 'Ầ', - 'ầ' => 'ầ', - 'Ẩ' => 'Ẩ', - 'ẩ' => 'ẩ', - 'Ẫ' => 'Ẫ', - 'ẫ' => 'ẫ', - 'Ậ' => 'Ậ', - 'ậ' => 'ậ', - 'Ắ' => 'Ắ', - 'ắ' => 'ắ', - 'Ằ' => 'Ằ', - 'ằ' => 'ằ', - 'Ẳ' => 'Ẳ', - 'ẳ' => 'ẳ', - 'Ẵ' => 'Ẵ', - 'ẵ' => 'ẵ', - 'Ặ' => 'Ặ', - 'ặ' => 'ặ', - 'Ẹ' => 'Ẹ', - 'ẹ' => 'ẹ', - 'Ẻ' => 'Ẻ', - 'ẻ' => 'ẻ', - 'Ẽ' => 'Ẽ', - 'ẽ' => 'ẽ', - 'Ế' => 'Ế', - 'ế' => 'ế', - 'Ề' => 'Ề', - 'ề' => 'ề', - 'Ể' => 'Ể', - 'ể' => 'ể', - 'Ễ' => 'Ễ', - 'ễ' => 'ễ', - 'Ệ' => 'Ệ', - 'ệ' => 'ệ', - 'Ỉ' => 'Ỉ', - 'ỉ' => 'ỉ', - 'Ị' => 'Ị', - 'ị' => 'ị', - 'Ọ' => 'Ọ', - 'ọ' => 'ọ', - 'Ỏ' => 'Ỏ', - 'ỏ' => 'ỏ', - 'Ố' => 'Ố', - 'ố' => 'ố', - 'Ồ' => 'Ồ', - 'ồ' => 'ồ', - 'Ổ' => 'Ổ', - 'ổ' => 'ổ', - 'Ỗ' => 'Ỗ', - 'ỗ' => 'ỗ', - 'Ộ' => 'Ộ', - 'ộ' => 'ộ', - 'Ớ' => 'Ớ', - 'ớ' => 'ớ', - 'Ờ' => 'Ờ', - 'ờ' => 'ờ', - 'Ở' => 'Ở', - 'ở' => 'ở', - 'Ỡ' => 'Ỡ', - 'ỡ' => 'ỡ', - 'Ợ' => 'Ợ', - 'ợ' => 'ợ', - 'Ụ' => 'Ụ', - 'ụ' => 'ụ', - 'Ủ' => 'Ủ', - 'ủ' => 'ủ', - 'Ứ' => 'Ứ', - 'ứ' => 'ứ', - 'Ừ' => 'Ừ', - 'ừ' => 'ừ', - 'Ử' => 'Ử', - 'ử' => 'ử', - 'Ữ' => 'Ữ', - 'ữ' => 'ữ', - 'Ự' => 'Ự', - 'ự' => 'ự', - 'Ỳ' => 'Ỳ', - 'ỳ' => 'ỳ', - 'Ỵ' => 'Ỵ', - 'ỵ' => 'ỵ', - 'Ỷ' => 'Ỷ', - 'ỷ' => 'ỷ', - 'Ỹ' => 'Ỹ', - 'ỹ' => 'ỹ', - 'ἀ' => 'ἀ', - 'ἁ' => 'ἁ', - 'ἂ' => 'ἂ', - 'ἃ' => 'ἃ', - 'ἄ' => 'ἄ', - 'ἅ' => 'ἅ', - 'ἆ' => 'ἆ', - 'ἇ' => 'ἇ', - 'Ἀ' => 'Ἀ', - 'Ἁ' => 'Ἁ', - 'Ἂ' => 'Ἂ', - 'Ἃ' => 'Ἃ', - 'Ἄ' => 'Ἄ', - 'Ἅ' => 'Ἅ', - 'Ἆ' => 'Ἆ', - 'Ἇ' => 'Ἇ', - 'ἐ' => 'ἐ', - 'ἑ' => 'ἑ', - 'ἒ' => 'ἒ', - 'ἓ' => 'ἓ', - 'ἔ' => 'ἔ', - 'ἕ' => 'ἕ', - 'Ἐ' => 'Ἐ', - 'Ἑ' => 'Ἑ', - 'Ἒ' => 'Ἒ', - 'Ἓ' => 'Ἓ', - 'Ἔ' => 'Ἔ', - 'Ἕ' => 'Ἕ', - 'ἠ' => 'ἠ', - 'ἡ' => 'ἡ', - 'ἢ' => 'ἢ', - 'ἣ' => 'ἣ', - 'ἤ' => 'ἤ', - 'ἥ' => 'ἥ', - 'ἦ' => 'ἦ', - 'ἧ' => 'ἧ', - 'Ἠ' => 'Ἠ', - 'Ἡ' => 'Ἡ', - 'Ἢ' => 'Ἢ', - 'Ἣ' => 'Ἣ', - 'Ἤ' => 'Ἤ', - 'Ἥ' => 'Ἥ', - 'Ἦ' => 'Ἦ', - 'Ἧ' => 'Ἧ', - 'ἰ' => 'ἰ', - 'ἱ' => 'ἱ', - 'ἲ' => 'ἲ', - 'ἳ' => 'ἳ', - 'ἴ' => 'ἴ', - 'ἵ' => 'ἵ', - 'ἶ' => 'ἶ', - 'ἷ' => 'ἷ', - 'Ἰ' => 'Ἰ', - 'Ἱ' => 'Ἱ', - 'Ἲ' => 'Ἲ', - 'Ἳ' => 'Ἳ', - 'Ἴ' => 'Ἴ', - 'Ἵ' => 'Ἵ', - 'Ἶ' => 'Ἶ', - 'Ἷ' => 'Ἷ', - 'ὀ' => 'ὀ', - 'ὁ' => 'ὁ', - 'ὂ' => 'ὂ', - 'ὃ' => 'ὃ', - 'ὄ' => 'ὄ', - 'ὅ' => 'ὅ', - 'Ὀ' => 'Ὀ', - 'Ὁ' => 'Ὁ', - 'Ὂ' => 'Ὂ', - 'Ὃ' => 'Ὃ', - 'Ὄ' => 'Ὄ', - 'Ὅ' => 'Ὅ', - 'ὐ' => 'ὐ', - 'ὑ' => 'ὑ', - 'ὒ' => 'ὒ', - 'ὓ' => 'ὓ', - 'ὔ' => 'ὔ', - 'ὕ' => 'ὕ', - 'ὖ' => 'ὖ', - 'ὗ' => 'ὗ', - 'Ὑ' => 'Ὑ', - 'Ὓ' => 'Ὓ', - 'Ὕ' => 'Ὕ', - 'Ὗ' => 'Ὗ', - 'ὠ' => 'ὠ', - 'ὡ' => 'ὡ', - 'ὢ' => 'ὢ', - 'ὣ' => 'ὣ', - 'ὤ' => 'ὤ', - 'ὥ' => 'ὥ', - 'ὦ' => 'ὦ', - 'ὧ' => 'ὧ', - 'Ὠ' => 'Ὠ', - 'Ὡ' => 'Ὡ', - 'Ὢ' => 'Ὢ', - 'Ὣ' => 'Ὣ', - 'Ὤ' => 'Ὤ', - 'Ὥ' => 'Ὥ', - 'Ὦ' => 'Ὦ', - 'Ὧ' => 'Ὧ', - 'ὰ' => 'ὰ', - 'ὲ' => 'ὲ', - 'ὴ' => 'ὴ', - 'ὶ' => 'ὶ', - 'ὸ' => 'ὸ', - 'ὺ' => 'ὺ', - 'ὼ' => 'ὼ', - 'ᾀ' => 'ᾀ', - 'ᾁ' => 'ᾁ', - 'ᾂ' => 'ᾂ', - 'ᾃ' => 'ᾃ', - 'ᾄ' => 'ᾄ', - 'ᾅ' => 'ᾅ', - 'ᾆ' => 'ᾆ', - 'ᾇ' => 'ᾇ', - 'ᾈ' => 'ᾈ', - 'ᾉ' => 'ᾉ', - 'ᾊ' => 'ᾊ', - 'ᾋ' => 'ᾋ', - 'ᾌ' => 'ᾌ', - 'ᾍ' => 'ᾍ', - 'ᾎ' => 'ᾎ', - 'ᾏ' => 'ᾏ', - 'ᾐ' => 'ᾐ', - 'ᾑ' => 'ᾑ', - 'ᾒ' => 'ᾒ', - 'ᾓ' => 'ᾓ', - 'ᾔ' => 'ᾔ', - 'ᾕ' => 'ᾕ', - 'ᾖ' => 'ᾖ', - 'ᾗ' => 'ᾗ', - 'ᾘ' => 'ᾘ', - 'ᾙ' => 'ᾙ', - 'ᾚ' => 'ᾚ', - 'ᾛ' => 'ᾛ', - 'ᾜ' => 'ᾜ', - 'ᾝ' => 'ᾝ', - 'ᾞ' => 'ᾞ', - 'ᾟ' => 'ᾟ', - 'ᾠ' => 'ᾠ', - 'ᾡ' => 'ᾡ', - 'ᾢ' => 'ᾢ', - 'ᾣ' => 'ᾣ', - 'ᾤ' => 'ᾤ', - 'ᾥ' => 'ᾥ', - 'ᾦ' => 'ᾦ', - 'ᾧ' => 'ᾧ', - 'ᾨ' => 'ᾨ', - 'ᾩ' => 'ᾩ', - 'ᾪ' => 'ᾪ', - 'ᾫ' => 'ᾫ', - 'ᾬ' => 'ᾬ', - 'ᾭ' => 'ᾭ', - 'ᾮ' => 'ᾮ', - 'ᾯ' => 'ᾯ', - 'ᾰ' => 'ᾰ', - 'ᾱ' => 'ᾱ', - 'ᾲ' => 'ᾲ', - 'ᾳ' => 'ᾳ', - 'ᾴ' => 'ᾴ', - 'ᾶ' => 'ᾶ', - 'ᾷ' => 'ᾷ', - 'Ᾰ' => 'Ᾰ', - 'Ᾱ' => 'Ᾱ', - 'Ὰ' => 'Ὰ', - 'ᾼ' => 'ᾼ', - '῁' => '῁', - 'ῂ' => 'ῂ', - 'ῃ' => 'ῃ', - 'ῄ' => 'ῄ', - 'ῆ' => 'ῆ', - 'ῇ' => 'ῇ', - 'Ὲ' => 'Ὲ', - 'Ὴ' => 'Ὴ', - 'ῌ' => 'ῌ', - '῍' => '῍', - '῎' => '῎', - '῏' => '῏', - 'ῐ' => 'ῐ', - 'ῑ' => 'ῑ', - 'ῒ' => 'ῒ', - 'ῖ' => 'ῖ', - 'ῗ' => 'ῗ', - 'Ῐ' => 'Ῐ', - 'Ῑ' => 'Ῑ', - 'Ὶ' => 'Ὶ', - '῝' => '῝', - '῞' => '῞', - '῟' => '῟', - 'ῠ' => 'ῠ', - 'ῡ' => 'ῡ', - 'ῢ' => 'ῢ', - 'ῤ' => 'ῤ', - 'ῥ' => 'ῥ', - 'ῦ' => 'ῦ', - 'ῧ' => 'ῧ', - 'Ῠ' => 'Ῠ', - 'Ῡ' => 'Ῡ', - 'Ὺ' => 'Ὺ', - 'Ῥ' => 'Ῥ', - '῭' => '῭', - 'ῲ' => 'ῲ', - 'ῳ' => 'ῳ', - 'ῴ' => 'ῴ', - 'ῶ' => 'ῶ', - 'ῷ' => 'ῷ', - 'Ὸ' => 'Ὸ', - 'Ὼ' => 'Ὼ', - 'ῼ' => 'ῼ', - '↚' => '↚', - '↛' => '↛', - '↮' => '↮', - '⇍' => '⇍', - '⇎' => '⇎', - '⇏' => '⇏', - '∄' => '∄', - '∉' => '∉', - '∌' => '∌', - '∤' => '∤', - '∦' => '∦', - '≁' => '≁', - '≄' => '≄', - '≇' => '≇', - '≉' => '≉', - '≠' => '≠', - '≢' => '≢', - '≭' => '≭', - '≮' => '≮', - '≯' => '≯', - '≰' => '≰', - '≱' => '≱', - '≴' => '≴', - '≵' => '≵', - '≸' => '≸', - '≹' => '≹', - '⊀' => '⊀', - '⊁' => '⊁', - '⊄' => '⊄', - '⊅' => '⊅', - '⊈' => '⊈', - '⊉' => '⊉', - '⊬' => '⊬', - '⊭' => '⊭', - '⊮' => '⊮', - '⊯' => '⊯', - '⋠' => '⋠', - '⋡' => '⋡', - '⋢' => '⋢', - '⋣' => '⋣', - '⋪' => '⋪', - '⋫' => '⋫', - '⋬' => '⋬', - '⋭' => '⋭', - 'が' => 'が', - 'ぎ' => 'ぎ', - 'ぐ' => 'ぐ', - 'げ' => 'げ', - 'ご' => 'ご', - 'ざ' => 'ざ', - 'じ' => 'じ', - 'ず' => 'ず', - 'ぜ' => 'ぜ', - 'ぞ' => 'ぞ', - 'だ' => 'だ', - 'ぢ' => 'ぢ', - 'づ' => 'づ', - 'で' => 'で', - 'ど' => 'ど', - 'ば' => 'ば', - 'ぱ' => 'ぱ', - 'び' => 'び', - 'ぴ' => 'ぴ', - 'ぶ' => 'ぶ', - 'ぷ' => 'ぷ', - 'べ' => 'べ', - 'ぺ' => 'ぺ', - 'ぼ' => 'ぼ', - 'ぽ' => 'ぽ', - 'ゔ' => 'ゔ', - 'ゞ' => 'ゞ', - 'ガ' => 'ガ', - 'ギ' => 'ギ', - 'グ' => 'グ', - 'ゲ' => 'ゲ', - 'ゴ' => 'ゴ', - 'ザ' => 'ザ', - 'ジ' => 'ジ', - 'ズ' => 'ズ', - 'ゼ' => 'ゼ', - 'ゾ' => 'ゾ', - 'ダ' => 'ダ', - 'ヂ' => 'ヂ', - 'ヅ' => 'ヅ', - 'デ' => 'デ', - 'ド' => 'ド', - 'バ' => 'バ', - 'パ' => 'パ', - 'ビ' => 'ビ', - 'ピ' => 'ピ', - 'ブ' => 'ブ', - 'プ' => 'プ', - 'ベ' => 'ベ', - 'ペ' => 'ペ', - 'ボ' => 'ボ', - 'ポ' => 'ポ', - 'ヴ' => 'ヴ', - 'ヷ' => 'ヷ', - 'ヸ' => 'ヸ', - 'ヹ' => 'ヹ', - 'ヺ' => 'ヺ', - 'ヾ' => 'ヾ', - '𑂚' => '𑂚', - '𑂜' => '𑂜', - '𑂫' => '𑂫', - '𑄮' => '𑄮', - '𑄯' => '𑄯', - '𑍋' => '𑍋', - '𑍌' => '𑍌', - '𑒻' => '𑒻', - '𑒼' => '𑒼', - '𑒾' => '𑒾', - '𑖺' => '𑖺', - '𑖻' => '𑖻', - '𑤸' => '𑤸', -); diff --git a/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php b/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php deleted file mode 100644 index 5a3e8e09..00000000 --- a/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php +++ /dev/null @@ -1,2065 +0,0 @@ - 'À', - 'Á' => 'Á', - 'Â' => 'Â', - 'Ã' => 'Ã', - 'Ä' => 'Ä', - 'Å' => 'Å', - 'Ç' => 'Ç', - 'È' => 'È', - 'É' => 'É', - 'Ê' => 'Ê', - 'Ë' => 'Ë', - 'Ì' => 'Ì', - 'Í' => 'Í', - 'Î' => 'Î', - 'Ï' => 'Ï', - 'Ñ' => 'Ñ', - 'Ò' => 'Ò', - 'Ó' => 'Ó', - 'Ô' => 'Ô', - 'Õ' => 'Õ', - 'Ö' => 'Ö', - 'Ù' => 'Ù', - 'Ú' => 'Ú', - 'Û' => 'Û', - 'Ü' => 'Ü', - 'Ý' => 'Ý', - 'à' => 'à', - 'á' => 'á', - 'â' => 'â', - 'ã' => 'ã', - 'ä' => 'ä', - 'å' => 'å', - 'ç' => 'ç', - 'è' => 'è', - 'é' => 'é', - 'ê' => 'ê', - 'ë' => 'ë', - 'ì' => 'ì', - 'í' => 'í', - 'î' => 'î', - 'ï' => 'ï', - 'ñ' => 'ñ', - 'ò' => 'ò', - 'ó' => 'ó', - 'ô' => 'ô', - 'õ' => 'õ', - 'ö' => 'ö', - 'ù' => 'ù', - 'ú' => 'ú', - 'û' => 'û', - 'ü' => 'ü', - 'ý' => 'ý', - 'ÿ' => 'ÿ', - 'Ā' => 'Ā', - 'ā' => 'ā', - 'Ă' => 'Ă', - 'ă' => 'ă', - 'Ą' => 'Ą', - 'ą' => 'ą', - 'Ć' => 'Ć', - 'ć' => 'ć', - 'Ĉ' => 'Ĉ', - 'ĉ' => 'ĉ', - 'Ċ' => 'Ċ', - 'ċ' => 'ċ', - 'Č' => 'Č', - 'č' => 'č', - 'Ď' => 'Ď', - 'ď' => 'ď', - 'Ē' => 'Ē', - 'ē' => 'ē', - 'Ĕ' => 'Ĕ', - 'ĕ' => 'ĕ', - 'Ė' => 'Ė', - 'ė' => 'ė', - 'Ę' => 'Ę', - 'ę' => 'ę', - 'Ě' => 'Ě', - 'ě' => 'ě', - 'Ĝ' => 'Ĝ', - 'ĝ' => 'ĝ', - 'Ğ' => 'Ğ', - 'ğ' => 'ğ', - 'Ġ' => 'Ġ', - 'ġ' => 'ġ', - 'Ģ' => 'Ģ', - 'ģ' => 'ģ', - 'Ĥ' => 'Ĥ', - 'ĥ' => 'ĥ', - 'Ĩ' => 'Ĩ', - 'ĩ' => 'ĩ', - 'Ī' => 'Ī', - 'ī' => 'ī', - 'Ĭ' => 'Ĭ', - 'ĭ' => 'ĭ', - 'Į' => 'Į', - 'į' => 'į', - 'İ' => 'İ', - 'Ĵ' => 'Ĵ', - 'ĵ' => 'ĵ', - 'Ķ' => 'Ķ', - 'ķ' => 'ķ', - 'Ĺ' => 'Ĺ', - 'ĺ' => 'ĺ', - 'Ļ' => 'Ļ', - 'ļ' => 'ļ', - 'Ľ' => 'Ľ', - 'ľ' => 'ľ', - 'Ń' => 'Ń', - 'ń' => 'ń', - 'Ņ' => 'Ņ', - 'ņ' => 'ņ', - 'Ň' => 'Ň', - 'ň' => 'ň', - 'Ō' => 'Ō', - 'ō' => 'ō', - 'Ŏ' => 'Ŏ', - 'ŏ' => 'ŏ', - 'Ő' => 'Ő', - 'ő' => 'ő', - 'Ŕ' => 'Ŕ', - 'ŕ' => 'ŕ', - 'Ŗ' => 'Ŗ', - 'ŗ' => 'ŗ', - 'Ř' => 'Ř', - 'ř' => 'ř', - 'Ś' => 'Ś', - 'ś' => 'ś', - 'Ŝ' => 'Ŝ', - 'ŝ' => 'ŝ', - 'Ş' => 'Ş', - 'ş' => 'ş', - 'Š' => 'Š', - 'š' => 'š', - 'Ţ' => 'Ţ', - 'ţ' => 'ţ', - 'Ť' => 'Ť', - 'ť' => 'ť', - 'Ũ' => 'Ũ', - 'ũ' => 'ũ', - 'Ū' => 'Ū', - 'ū' => 'ū', - 'Ŭ' => 'Ŭ', - 'ŭ' => 'ŭ', - 'Ů' => 'Ů', - 'ů' => 'ů', - 'Ű' => 'Ű', - 'ű' => 'ű', - 'Ų' => 'Ų', - 'ų' => 'ų', - 'Ŵ' => 'Ŵ', - 'ŵ' => 'ŵ', - 'Ŷ' => 'Ŷ', - 'ŷ' => 'ŷ', - 'Ÿ' => 'Ÿ', - 'Ź' => 'Ź', - 'ź' => 'ź', - 'Ż' => 'Ż', - 'ż' => 'ż', - 'Ž' => 'Ž', - 'ž' => 'ž', - 'Ơ' => 'Ơ', - 'ơ' => 'ơ', - 'Ư' => 'Ư', - 'ư' => 'ư', - 'Ǎ' => 'Ǎ', - 'ǎ' => 'ǎ', - 'Ǐ' => 'Ǐ', - 'ǐ' => 'ǐ', - 'Ǒ' => 'Ǒ', - 'ǒ' => 'ǒ', - 'Ǔ' => 'Ǔ', - 'ǔ' => 'ǔ', - 'Ǖ' => 'Ǖ', - 'ǖ' => 'ǖ', - 'Ǘ' => 'Ǘ', - 'ǘ' => 'ǘ', - 'Ǚ' => 'Ǚ', - 'ǚ' => 'ǚ', - 'Ǜ' => 'Ǜ', - 'ǜ' => 'ǜ', - 'Ǟ' => 'Ǟ', - 'ǟ' => 'ǟ', - 'Ǡ' => 'Ǡ', - 'ǡ' => 'ǡ', - 'Ǣ' => 'Ǣ', - 'ǣ' => 'ǣ', - 'Ǧ' => 'Ǧ', - 'ǧ' => 'ǧ', - 'Ǩ' => 'Ǩ', - 'ǩ' => 'ǩ', - 'Ǫ' => 'Ǫ', - 'ǫ' => 'ǫ', - 'Ǭ' => 'Ǭ', - 'ǭ' => 'ǭ', - 'Ǯ' => 'Ǯ', - 'ǯ' => 'ǯ', - 'ǰ' => 'ǰ', - 'Ǵ' => 'Ǵ', - 'ǵ' => 'ǵ', - 'Ǹ' => 'Ǹ', - 'ǹ' => 'ǹ', - 'Ǻ' => 'Ǻ', - 'ǻ' => 'ǻ', - 'Ǽ' => 'Ǽ', - 'ǽ' => 'ǽ', - 'Ǿ' => 'Ǿ', - 'ǿ' => 'ǿ', - 'Ȁ' => 'Ȁ', - 'ȁ' => 'ȁ', - 'Ȃ' => 'Ȃ', - 'ȃ' => 'ȃ', - 'Ȅ' => 'Ȅ', - 'ȅ' => 'ȅ', - 'Ȇ' => 'Ȇ', - 'ȇ' => 'ȇ', - 'Ȉ' => 'Ȉ', - 'ȉ' => 'ȉ', - 'Ȋ' => 'Ȋ', - 'ȋ' => 'ȋ', - 'Ȍ' => 'Ȍ', - 'ȍ' => 'ȍ', - 'Ȏ' => 'Ȏ', - 'ȏ' => 'ȏ', - 'Ȑ' => 'Ȑ', - 'ȑ' => 'ȑ', - 'Ȓ' => 'Ȓ', - 'ȓ' => 'ȓ', - 'Ȕ' => 'Ȕ', - 'ȕ' => 'ȕ', - 'Ȗ' => 'Ȗ', - 'ȗ' => 'ȗ', - 'Ș' => 'Ș', - 'ș' => 'ș', - 'Ț' => 'Ț', - 'ț' => 'ț', - 'Ȟ' => 'Ȟ', - 'ȟ' => 'ȟ', - 'Ȧ' => 'Ȧ', - 'ȧ' => 'ȧ', - 'Ȩ' => 'Ȩ', - 'ȩ' => 'ȩ', - 'Ȫ' => 'Ȫ', - 'ȫ' => 'ȫ', - 'Ȭ' => 'Ȭ', - 'ȭ' => 'ȭ', - 'Ȯ' => 'Ȯ', - 'ȯ' => 'ȯ', - 'Ȱ' => 'Ȱ', - 'ȱ' => 'ȱ', - 'Ȳ' => 'Ȳ', - 'ȳ' => 'ȳ', - '̀' => '̀', - '́' => '́', - '̓' => '̓', - '̈́' => '̈́', - 'ʹ' => 'ʹ', - ';' => ';', - '΅' => '΅', - 'Ά' => 'Ά', - '·' => '·', - 'Έ' => 'Έ', - 'Ή' => 'Ή', - 'Ί' => 'Ί', - 'Ό' => 'Ό', - 'Ύ' => 'Ύ', - 'Ώ' => 'Ώ', - 'ΐ' => 'ΐ', - 'Ϊ' => 'Ϊ', - 'Ϋ' => 'Ϋ', - 'ά' => 'ά', - 'έ' => 'έ', - 'ή' => 'ή', - 'ί' => 'ί', - 'ΰ' => 'ΰ', - 'ϊ' => 'ϊ', - 'ϋ' => 'ϋ', - 'ό' => 'ό', - 'ύ' => 'ύ', - 'ώ' => 'ώ', - 'ϓ' => 'ϓ', - 'ϔ' => 'ϔ', - 'Ѐ' => 'Ѐ', - 'Ё' => 'Ё', - 'Ѓ' => 'Ѓ', - 'Ї' => 'Ї', - 'Ќ' => 'Ќ', - 'Ѝ' => 'Ѝ', - 'Ў' => 'Ў', - 'Й' => 'Й', - 'й' => 'й', - 'ѐ' => 'ѐ', - 'ё' => 'ё', - 'ѓ' => 'ѓ', - 'ї' => 'ї', - 'ќ' => 'ќ', - 'ѝ' => 'ѝ', - 'ў' => 'ў', - 'Ѷ' => 'Ѷ', - 'ѷ' => 'ѷ', - 'Ӂ' => 'Ӂ', - 'ӂ' => 'ӂ', - 'Ӑ' => 'Ӑ', - 'ӑ' => 'ӑ', - 'Ӓ' => 'Ӓ', - 'ӓ' => 'ӓ', - 'Ӗ' => 'Ӗ', - 'ӗ' => 'ӗ', - 'Ӛ' => 'Ӛ', - 'ӛ' => 'ӛ', - 'Ӝ' => 'Ӝ', - 'ӝ' => 'ӝ', - 'Ӟ' => 'Ӟ', - 'ӟ' => 'ӟ', - 'Ӣ' => 'Ӣ', - 'ӣ' => 'ӣ', - 'Ӥ' => 'Ӥ', - 'ӥ' => 'ӥ', - 'Ӧ' => 'Ӧ', - 'ӧ' => 'ӧ', - 'Ӫ' => 'Ӫ', - 'ӫ' => 'ӫ', - 'Ӭ' => 'Ӭ', - 'ӭ' => 'ӭ', - 'Ӯ' => 'Ӯ', - 'ӯ' => 'ӯ', - 'Ӱ' => 'Ӱ', - 'ӱ' => 'ӱ', - 'Ӳ' => 'Ӳ', - 'ӳ' => 'ӳ', - 'Ӵ' => 'Ӵ', - 'ӵ' => 'ӵ', - 'Ӹ' => 'Ӹ', - 'ӹ' => 'ӹ', - 'آ' => 'آ', - 'أ' => 'أ', - 'ؤ' => 'ؤ', - 'إ' => 'إ', - 'ئ' => 'ئ', - 'ۀ' => 'ۀ', - 'ۂ' => 'ۂ', - 'ۓ' => 'ۓ', - 'ऩ' => 'ऩ', - 'ऱ' => 'ऱ', - 'ऴ' => 'ऴ', - 'क़' => 'क़', - 'ख़' => 'ख़', - 'ग़' => 'ग़', - 'ज़' => 'ज़', - 'ड़' => 'ड़', - 'ढ़' => 'ढ़', - 'फ़' => 'फ़', - 'य़' => 'य़', - 'ো' => 'ো', - 'ৌ' => 'ৌ', - 'ড়' => 'ড়', - 'ঢ়' => 'ঢ়', - 'য়' => 'য়', - 'ਲ਼' => 'ਲ਼', - 'ਸ਼' => 'ਸ਼', - 'ਖ਼' => 'ਖ਼', - 'ਗ਼' => 'ਗ਼', - 'ਜ਼' => 'ਜ਼', - 'ਫ਼' => 'ਫ਼', - 'ୈ' => 'ୈ', - 'ୋ' => 'ୋ', - 'ୌ' => 'ୌ', - 'ଡ଼' => 'ଡ଼', - 'ଢ଼' => 'ଢ଼', - 'ஔ' => 'ஔ', - 'ொ' => 'ொ', - 'ோ' => 'ோ', - 'ௌ' => 'ௌ', - 'ై' => 'ై', - 'ೀ' => 'ೀ', - 'ೇ' => 'ೇ', - 'ೈ' => 'ೈ', - 'ೊ' => 'ೊ', - 'ೋ' => 'ೋ', - 'ൊ' => 'ൊ', - 'ോ' => 'ോ', - 'ൌ' => 'ൌ', - 'ේ' => 'ේ', - 'ො' => 'ො', - 'ෝ' => 'ෝ', - 'ෞ' => 'ෞ', - 'གྷ' => 'གྷ', - 'ཌྷ' => 'ཌྷ', - 'དྷ' => 'དྷ', - 'བྷ' => 'བྷ', - 'ཛྷ' => 'ཛྷ', - 'ཀྵ' => 'ཀྵ', - 'ཱི' => 'ཱི', - 'ཱུ' => 'ཱུ', - 'ྲྀ' => 'ྲྀ', - 'ླྀ' => 'ླྀ', - 'ཱྀ' => 'ཱྀ', - 'ྒྷ' => 'ྒྷ', - 'ྜྷ' => 'ྜྷ', - 'ྡྷ' => 'ྡྷ', - 'ྦྷ' => 'ྦྷ', - 'ྫྷ' => 'ྫྷ', - 'ྐྵ' => 'ྐྵ', - 'ဦ' => 'ဦ', - 'ᬆ' => 'ᬆ', - 'ᬈ' => 'ᬈ', - 'ᬊ' => 'ᬊ', - 'ᬌ' => 'ᬌ', - 'ᬎ' => 'ᬎ', - 'ᬒ' => 'ᬒ', - 'ᬻ' => 'ᬻ', - 'ᬽ' => 'ᬽ', - 'ᭀ' => 'ᭀ', - 'ᭁ' => 'ᭁ', - 'ᭃ' => 'ᭃ', - 'Ḁ' => 'Ḁ', - 'ḁ' => 'ḁ', - 'Ḃ' => 'Ḃ', - 'ḃ' => 'ḃ', - 'Ḅ' => 'Ḅ', - 'ḅ' => 'ḅ', - 'Ḇ' => 'Ḇ', - 'ḇ' => 'ḇ', - 'Ḉ' => 'Ḉ', - 'ḉ' => 'ḉ', - 'Ḋ' => 'Ḋ', - 'ḋ' => 'ḋ', - 'Ḍ' => 'Ḍ', - 'ḍ' => 'ḍ', - 'Ḏ' => 'Ḏ', - 'ḏ' => 'ḏ', - 'Ḑ' => 'Ḑ', - 'ḑ' => 'ḑ', - 'Ḓ' => 'Ḓ', - 'ḓ' => 'ḓ', - 'Ḕ' => 'Ḕ', - 'ḕ' => 'ḕ', - 'Ḗ' => 'Ḗ', - 'ḗ' => 'ḗ', - 'Ḙ' => 'Ḙ', - 'ḙ' => 'ḙ', - 'Ḛ' => 'Ḛ', - 'ḛ' => 'ḛ', - 'Ḝ' => 'Ḝ', - 'ḝ' => 'ḝ', - 'Ḟ' => 'Ḟ', - 'ḟ' => 'ḟ', - 'Ḡ' => 'Ḡ', - 'ḡ' => 'ḡ', - 'Ḣ' => 'Ḣ', - 'ḣ' => 'ḣ', - 'Ḥ' => 'Ḥ', - 'ḥ' => 'ḥ', - 'Ḧ' => 'Ḧ', - 'ḧ' => 'ḧ', - 'Ḩ' => 'Ḩ', - 'ḩ' => 'ḩ', - 'Ḫ' => 'Ḫ', - 'ḫ' => 'ḫ', - 'Ḭ' => 'Ḭ', - 'ḭ' => 'ḭ', - 'Ḯ' => 'Ḯ', - 'ḯ' => 'ḯ', - 'Ḱ' => 'Ḱ', - 'ḱ' => 'ḱ', - 'Ḳ' => 'Ḳ', - 'ḳ' => 'ḳ', - 'Ḵ' => 'Ḵ', - 'ḵ' => 'ḵ', - 'Ḷ' => 'Ḷ', - 'ḷ' => 'ḷ', - 'Ḹ' => 'Ḹ', - 'ḹ' => 'ḹ', - 'Ḻ' => 'Ḻ', - 'ḻ' => 'ḻ', - 'Ḽ' => 'Ḽ', - 'ḽ' => 'ḽ', - 'Ḿ' => 'Ḿ', - 'ḿ' => 'ḿ', - 'Ṁ' => 'Ṁ', - 'ṁ' => 'ṁ', - 'Ṃ' => 'Ṃ', - 'ṃ' => 'ṃ', - 'Ṅ' => 'Ṅ', - 'ṅ' => 'ṅ', - 'Ṇ' => 'Ṇ', - 'ṇ' => 'ṇ', - 'Ṉ' => 'Ṉ', - 'ṉ' => 'ṉ', - 'Ṋ' => 'Ṋ', - 'ṋ' => 'ṋ', - 'Ṍ' => 'Ṍ', - 'ṍ' => 'ṍ', - 'Ṏ' => 'Ṏ', - 'ṏ' => 'ṏ', - 'Ṑ' => 'Ṑ', - 'ṑ' => 'ṑ', - 'Ṓ' => 'Ṓ', - 'ṓ' => 'ṓ', - 'Ṕ' => 'Ṕ', - 'ṕ' => 'ṕ', - 'Ṗ' => 'Ṗ', - 'ṗ' => 'ṗ', - 'Ṙ' => 'Ṙ', - 'ṙ' => 'ṙ', - 'Ṛ' => 'Ṛ', - 'ṛ' => 'ṛ', - 'Ṝ' => 'Ṝ', - 'ṝ' => 'ṝ', - 'Ṟ' => 'Ṟ', - 'ṟ' => 'ṟ', - 'Ṡ' => 'Ṡ', - 'ṡ' => 'ṡ', - 'Ṣ' => 'Ṣ', - 'ṣ' => 'ṣ', - 'Ṥ' => 'Ṥ', - 'ṥ' => 'ṥ', - 'Ṧ' => 'Ṧ', - 'ṧ' => 'ṧ', - 'Ṩ' => 'Ṩ', - 'ṩ' => 'ṩ', - 'Ṫ' => 'Ṫ', - 'ṫ' => 'ṫ', - 'Ṭ' => 'Ṭ', - 'ṭ' => 'ṭ', - 'Ṯ' => 'Ṯ', - 'ṯ' => 'ṯ', - 'Ṱ' => 'Ṱ', - 'ṱ' => 'ṱ', - 'Ṳ' => 'Ṳ', - 'ṳ' => 'ṳ', - 'Ṵ' => 'Ṵ', - 'ṵ' => 'ṵ', - 'Ṷ' => 'Ṷ', - 'ṷ' => 'ṷ', - 'Ṹ' => 'Ṹ', - 'ṹ' => 'ṹ', - 'Ṻ' => 'Ṻ', - 'ṻ' => 'ṻ', - 'Ṽ' => 'Ṽ', - 'ṽ' => 'ṽ', - 'Ṿ' => 'Ṿ', - 'ṿ' => 'ṿ', - 'Ẁ' => 'Ẁ', - 'ẁ' => 'ẁ', - 'Ẃ' => 'Ẃ', - 'ẃ' => 'ẃ', - 'Ẅ' => 'Ẅ', - 'ẅ' => 'ẅ', - 'Ẇ' => 'Ẇ', - 'ẇ' => 'ẇ', - 'Ẉ' => 'Ẉ', - 'ẉ' => 'ẉ', - 'Ẋ' => 'Ẋ', - 'ẋ' => 'ẋ', - 'Ẍ' => 'Ẍ', - 'ẍ' => 'ẍ', - 'Ẏ' => 'Ẏ', - 'ẏ' => 'ẏ', - 'Ẑ' => 'Ẑ', - 'ẑ' => 'ẑ', - 'Ẓ' => 'Ẓ', - 'ẓ' => 'ẓ', - 'Ẕ' => 'Ẕ', - 'ẕ' => 'ẕ', - 'ẖ' => 'ẖ', - 'ẗ' => 'ẗ', - 'ẘ' => 'ẘ', - 'ẙ' => 'ẙ', - 'ẛ' => 'ẛ', - 'Ạ' => 'Ạ', - 'ạ' => 'ạ', - 'Ả' => 'Ả', - 'ả' => 'ả', - 'Ấ' => 'Ấ', - 'ấ' => 'ấ', - 'Ầ' => 'Ầ', - 'ầ' => 'ầ', - 'Ẩ' => 'Ẩ', - 'ẩ' => 'ẩ', - 'Ẫ' => 'Ẫ', - 'ẫ' => 'ẫ', - 'Ậ' => 'Ậ', - 'ậ' => 'ậ', - 'Ắ' => 'Ắ', - 'ắ' => 'ắ', - 'Ằ' => 'Ằ', - 'ằ' => 'ằ', - 'Ẳ' => 'Ẳ', - 'ẳ' => 'ẳ', - 'Ẵ' => 'Ẵ', - 'ẵ' => 'ẵ', - 'Ặ' => 'Ặ', - 'ặ' => 'ặ', - 'Ẹ' => 'Ẹ', - 'ẹ' => 'ẹ', - 'Ẻ' => 'Ẻ', - 'ẻ' => 'ẻ', - 'Ẽ' => 'Ẽ', - 'ẽ' => 'ẽ', - 'Ế' => 'Ế', - 'ế' => 'ế', - 'Ề' => 'Ề', - 'ề' => 'ề', - 'Ể' => 'Ể', - 'ể' => 'ể', - 'Ễ' => 'Ễ', - 'ễ' => 'ễ', - 'Ệ' => 'Ệ', - 'ệ' => 'ệ', - 'Ỉ' => 'Ỉ', - 'ỉ' => 'ỉ', - 'Ị' => 'Ị', - 'ị' => 'ị', - 'Ọ' => 'Ọ', - 'ọ' => 'ọ', - 'Ỏ' => 'Ỏ', - 'ỏ' => 'ỏ', - 'Ố' => 'Ố', - 'ố' => 'ố', - 'Ồ' => 'Ồ', - 'ồ' => 'ồ', - 'Ổ' => 'Ổ', - 'ổ' => 'ổ', - 'Ỗ' => 'Ỗ', - 'ỗ' => 'ỗ', - 'Ộ' => 'Ộ', - 'ộ' => 'ộ', - 'Ớ' => 'Ớ', - 'ớ' => 'ớ', - 'Ờ' => 'Ờ', - 'ờ' => 'ờ', - 'Ở' => 'Ở', - 'ở' => 'ở', - 'Ỡ' => 'Ỡ', - 'ỡ' => 'ỡ', - 'Ợ' => 'Ợ', - 'ợ' => 'ợ', - 'Ụ' => 'Ụ', - 'ụ' => 'ụ', - 'Ủ' => 'Ủ', - 'ủ' => 'ủ', - 'Ứ' => 'Ứ', - 'ứ' => 'ứ', - 'Ừ' => 'Ừ', - 'ừ' => 'ừ', - 'Ử' => 'Ử', - 'ử' => 'ử', - 'Ữ' => 'Ữ', - 'ữ' => 'ữ', - 'Ự' => 'Ự', - 'ự' => 'ự', - 'Ỳ' => 'Ỳ', - 'ỳ' => 'ỳ', - 'Ỵ' => 'Ỵ', - 'ỵ' => 'ỵ', - 'Ỷ' => 'Ỷ', - 'ỷ' => 'ỷ', - 'Ỹ' => 'Ỹ', - 'ỹ' => 'ỹ', - 'ἀ' => 'ἀ', - 'ἁ' => 'ἁ', - 'ἂ' => 'ἂ', - 'ἃ' => 'ἃ', - 'ἄ' => 'ἄ', - 'ἅ' => 'ἅ', - 'ἆ' => 'ἆ', - 'ἇ' => 'ἇ', - 'Ἀ' => 'Ἀ', - 'Ἁ' => 'Ἁ', - 'Ἂ' => 'Ἂ', - 'Ἃ' => 'Ἃ', - 'Ἄ' => 'Ἄ', - 'Ἅ' => 'Ἅ', - 'Ἆ' => 'Ἆ', - 'Ἇ' => 'Ἇ', - 'ἐ' => 'ἐ', - 'ἑ' => 'ἑ', - 'ἒ' => 'ἒ', - 'ἓ' => 'ἓ', - 'ἔ' => 'ἔ', - 'ἕ' => 'ἕ', - 'Ἐ' => 'Ἐ', - 'Ἑ' => 'Ἑ', - 'Ἒ' => 'Ἒ', - 'Ἓ' => 'Ἓ', - 'Ἔ' => 'Ἔ', - 'Ἕ' => 'Ἕ', - 'ἠ' => 'ἠ', - 'ἡ' => 'ἡ', - 'ἢ' => 'ἢ', - 'ἣ' => 'ἣ', - 'ἤ' => 'ἤ', - 'ἥ' => 'ἥ', - 'ἦ' => 'ἦ', - 'ἧ' => 'ἧ', - 'Ἠ' => 'Ἠ', - 'Ἡ' => 'Ἡ', - 'Ἢ' => 'Ἢ', - 'Ἣ' => 'Ἣ', - 'Ἤ' => 'Ἤ', - 'Ἥ' => 'Ἥ', - 'Ἦ' => 'Ἦ', - 'Ἧ' => 'Ἧ', - 'ἰ' => 'ἰ', - 'ἱ' => 'ἱ', - 'ἲ' => 'ἲ', - 'ἳ' => 'ἳ', - 'ἴ' => 'ἴ', - 'ἵ' => 'ἵ', - 'ἶ' => 'ἶ', - 'ἷ' => 'ἷ', - 'Ἰ' => 'Ἰ', - 'Ἱ' => 'Ἱ', - 'Ἲ' => 'Ἲ', - 'Ἳ' => 'Ἳ', - 'Ἴ' => 'Ἴ', - 'Ἵ' => 'Ἵ', - 'Ἶ' => 'Ἶ', - 'Ἷ' => 'Ἷ', - 'ὀ' => 'ὀ', - 'ὁ' => 'ὁ', - 'ὂ' => 'ὂ', - 'ὃ' => 'ὃ', - 'ὄ' => 'ὄ', - 'ὅ' => 'ὅ', - 'Ὀ' => 'Ὀ', - 'Ὁ' => 'Ὁ', - 'Ὂ' => 'Ὂ', - 'Ὃ' => 'Ὃ', - 'Ὄ' => 'Ὄ', - 'Ὅ' => 'Ὅ', - 'ὐ' => 'ὐ', - 'ὑ' => 'ὑ', - 'ὒ' => 'ὒ', - 'ὓ' => 'ὓ', - 'ὔ' => 'ὔ', - 'ὕ' => 'ὕ', - 'ὖ' => 'ὖ', - 'ὗ' => 'ὗ', - 'Ὑ' => 'Ὑ', - 'Ὓ' => 'Ὓ', - 'Ὕ' => 'Ὕ', - 'Ὗ' => 'Ὗ', - 'ὠ' => 'ὠ', - 'ὡ' => 'ὡ', - 'ὢ' => 'ὢ', - 'ὣ' => 'ὣ', - 'ὤ' => 'ὤ', - 'ὥ' => 'ὥ', - 'ὦ' => 'ὦ', - 'ὧ' => 'ὧ', - 'Ὠ' => 'Ὠ', - 'Ὡ' => 'Ὡ', - 'Ὢ' => 'Ὢ', - 'Ὣ' => 'Ὣ', - 'Ὤ' => 'Ὤ', - 'Ὥ' => 'Ὥ', - 'Ὦ' => 'Ὦ', - 'Ὧ' => 'Ὧ', - 'ὰ' => 'ὰ', - 'ά' => 'ά', - 'ὲ' => 'ὲ', - 'έ' => 'έ', - 'ὴ' => 'ὴ', - 'ή' => 'ή', - 'ὶ' => 'ὶ', - 'ί' => 'ί', - 'ὸ' => 'ὸ', - 'ό' => 'ό', - 'ὺ' => 'ὺ', - 'ύ' => 'ύ', - 'ὼ' => 'ὼ', - 'ώ' => 'ώ', - 'ᾀ' => 'ᾀ', - 'ᾁ' => 'ᾁ', - 'ᾂ' => 'ᾂ', - 'ᾃ' => 'ᾃ', - 'ᾄ' => 'ᾄ', - 'ᾅ' => 'ᾅ', - 'ᾆ' => 'ᾆ', - 'ᾇ' => 'ᾇ', - 'ᾈ' => 'ᾈ', - 'ᾉ' => 'ᾉ', - 'ᾊ' => 'ᾊ', - 'ᾋ' => 'ᾋ', - 'ᾌ' => 'ᾌ', - 'ᾍ' => 'ᾍ', - 'ᾎ' => 'ᾎ', - 'ᾏ' => 'ᾏ', - 'ᾐ' => 'ᾐ', - 'ᾑ' => 'ᾑ', - 'ᾒ' => 'ᾒ', - 'ᾓ' => 'ᾓ', - 'ᾔ' => 'ᾔ', - 'ᾕ' => 'ᾕ', - 'ᾖ' => 'ᾖ', - 'ᾗ' => 'ᾗ', - 'ᾘ' => 'ᾘ', - 'ᾙ' => 'ᾙ', - 'ᾚ' => 'ᾚ', - 'ᾛ' => 'ᾛ', - 'ᾜ' => 'ᾜ', - 'ᾝ' => 'ᾝ', - 'ᾞ' => 'ᾞ', - 'ᾟ' => 'ᾟ', - 'ᾠ' => 'ᾠ', - 'ᾡ' => 'ᾡ', - 'ᾢ' => 'ᾢ', - 'ᾣ' => 'ᾣ', - 'ᾤ' => 'ᾤ', - 'ᾥ' => 'ᾥ', - 'ᾦ' => 'ᾦ', - 'ᾧ' => 'ᾧ', - 'ᾨ' => 'ᾨ', - 'ᾩ' => 'ᾩ', - 'ᾪ' => 'ᾪ', - 'ᾫ' => 'ᾫ', - 'ᾬ' => 'ᾬ', - 'ᾭ' => 'ᾭ', - 'ᾮ' => 'ᾮ', - 'ᾯ' => 'ᾯ', - 'ᾰ' => 'ᾰ', - 'ᾱ' => 'ᾱ', - 'ᾲ' => 'ᾲ', - 'ᾳ' => 'ᾳ', - 'ᾴ' => 'ᾴ', - 'ᾶ' => 'ᾶ', - 'ᾷ' => 'ᾷ', - 'Ᾰ' => 'Ᾰ', - 'Ᾱ' => 'Ᾱ', - 'Ὰ' => 'Ὰ', - 'Ά' => 'Ά', - 'ᾼ' => 'ᾼ', - 'ι' => 'ι', - '῁' => '῁', - 'ῂ' => 'ῂ', - 'ῃ' => 'ῃ', - 'ῄ' => 'ῄ', - 'ῆ' => 'ῆ', - 'ῇ' => 'ῇ', - 'Ὲ' => 'Ὲ', - 'Έ' => 'Έ', - 'Ὴ' => 'Ὴ', - 'Ή' => 'Ή', - 'ῌ' => 'ῌ', - '῍' => '῍', - '῎' => '῎', - '῏' => '῏', - 'ῐ' => 'ῐ', - 'ῑ' => 'ῑ', - 'ῒ' => 'ῒ', - 'ΐ' => 'ΐ', - 'ῖ' => 'ῖ', - 'ῗ' => 'ῗ', - 'Ῐ' => 'Ῐ', - 'Ῑ' => 'Ῑ', - 'Ὶ' => 'Ὶ', - 'Ί' => 'Ί', - '῝' => '῝', - '῞' => '῞', - '῟' => '῟', - 'ῠ' => 'ῠ', - 'ῡ' => 'ῡ', - 'ῢ' => 'ῢ', - 'ΰ' => 'ΰ', - 'ῤ' => 'ῤ', - 'ῥ' => 'ῥ', - 'ῦ' => 'ῦ', - 'ῧ' => 'ῧ', - 'Ῠ' => 'Ῠ', - 'Ῡ' => 'Ῡ', - 'Ὺ' => 'Ὺ', - 'Ύ' => 'Ύ', - 'Ῥ' => 'Ῥ', - '῭' => '῭', - '΅' => '΅', - '`' => '`', - 'ῲ' => 'ῲ', - 'ῳ' => 'ῳ', - 'ῴ' => 'ῴ', - 'ῶ' => 'ῶ', - 'ῷ' => 'ῷ', - 'Ὸ' => 'Ὸ', - 'Ό' => 'Ό', - 'Ὼ' => 'Ὼ', - 'Ώ' => 'Ώ', - 'ῼ' => 'ῼ', - '´' => '´', - ' ' => ' ', - ' ' => ' ', - 'Ω' => 'Ω', - 'K' => 'K', - 'Å' => 'Å', - '↚' => '↚', - '↛' => '↛', - '↮' => '↮', - '⇍' => '⇍', - '⇎' => '⇎', - '⇏' => '⇏', - '∄' => '∄', - '∉' => '∉', - '∌' => '∌', - '∤' => '∤', - '∦' => '∦', - '≁' => '≁', - '≄' => '≄', - '≇' => '≇', - '≉' => '≉', - '≠' => '≠', - '≢' => '≢', - '≭' => '≭', - '≮' => '≮', - '≯' => '≯', - '≰' => '≰', - '≱' => '≱', - '≴' => '≴', - '≵' => '≵', - '≸' => '≸', - '≹' => '≹', - '⊀' => '⊀', - '⊁' => '⊁', - '⊄' => '⊄', - '⊅' => '⊅', - '⊈' => '⊈', - '⊉' => '⊉', - '⊬' => '⊬', - '⊭' => '⊭', - '⊮' => '⊮', - '⊯' => '⊯', - '⋠' => '⋠', - '⋡' => '⋡', - '⋢' => '⋢', - '⋣' => '⋣', - '⋪' => '⋪', - '⋫' => '⋫', - '⋬' => '⋬', - '⋭' => '⋭', - '〈' => '〈', - '〉' => '〉', - '⫝̸' => '⫝̸', - 'が' => 'が', - 'ぎ' => 'ぎ', - 'ぐ' => 'ぐ', - 'げ' => 'げ', - 'ご' => 'ご', - 'ざ' => 'ざ', - 'じ' => 'じ', - 'ず' => 'ず', - 'ぜ' => 'ぜ', - 'ぞ' => 'ぞ', - 'だ' => 'だ', - 'ぢ' => 'ぢ', - 'づ' => 'づ', - 'で' => 'で', - 'ど' => 'ど', - 'ば' => 'ば', - 'ぱ' => 'ぱ', - 'び' => 'び', - 'ぴ' => 'ぴ', - 'ぶ' => 'ぶ', - 'ぷ' => 'ぷ', - 'べ' => 'べ', - 'ぺ' => 'ぺ', - 'ぼ' => 'ぼ', - 'ぽ' => 'ぽ', - 'ゔ' => 'ゔ', - 'ゞ' => 'ゞ', - 'ガ' => 'ガ', - 'ギ' => 'ギ', - 'グ' => 'グ', - 'ゲ' => 'ゲ', - 'ゴ' => 'ゴ', - 'ザ' => 'ザ', - 'ジ' => 'ジ', - 'ズ' => 'ズ', - 'ゼ' => 'ゼ', - 'ゾ' => 'ゾ', - 'ダ' => 'ダ', - 'ヂ' => 'ヂ', - 'ヅ' => 'ヅ', - 'デ' => 'デ', - 'ド' => 'ド', - 'バ' => 'バ', - 'パ' => 'パ', - 'ビ' => 'ビ', - 'ピ' => 'ピ', - 'ブ' => 'ブ', - 'プ' => 'プ', - 'ベ' => 'ベ', - 'ペ' => 'ペ', - 'ボ' => 'ボ', - 'ポ' => 'ポ', - 'ヴ' => 'ヴ', - 'ヷ' => 'ヷ', - 'ヸ' => 'ヸ', - 'ヹ' => 'ヹ', - 'ヺ' => 'ヺ', - 'ヾ' => 'ヾ', - '豈' => '豈', - '更' => '更', - '車' => '車', - '賈' => '賈', - '滑' => '滑', - '串' => '串', - '句' => '句', - '龜' => '龜', - '龜' => '龜', - '契' => '契', - '金' => '金', - '喇' => '喇', - '奈' => '奈', - '懶' => '懶', - '癩' => '癩', - '羅' => '羅', - '蘿' => '蘿', - '螺' => '螺', - '裸' => '裸', - '邏' => '邏', - '樂' => '樂', - '洛' => '洛', - '烙' => '烙', - '珞' => '珞', - '落' => '落', - '酪' => '酪', - '駱' => '駱', - '亂' => '亂', - '卵' => '卵', - '欄' => '欄', - '爛' => '爛', - '蘭' => '蘭', - '鸞' => '鸞', - '嵐' => '嵐', - '濫' => '濫', - '藍' => '藍', - '襤' => '襤', - '拉' => '拉', - '臘' => '臘', - '蠟' => '蠟', - '廊' => '廊', - '朗' => '朗', - '浪' => '浪', - '狼' => '狼', - '郎' => '郎', - '來' => '來', - '冷' => '冷', - '勞' => '勞', - '擄' => '擄', - '櫓' => '櫓', - '爐' => '爐', - '盧' => '盧', - '老' => '老', - '蘆' => '蘆', - '虜' => '虜', - '路' => '路', - '露' => '露', - '魯' => '魯', - '鷺' => '鷺', - '碌' => '碌', - '祿' => '祿', - '綠' => '綠', - '菉' => '菉', - '錄' => '錄', - '鹿' => '鹿', - '論' => '論', - '壟' => '壟', - '弄' => '弄', - '籠' => '籠', - '聾' => '聾', - '牢' => '牢', - '磊' => '磊', - '賂' => '賂', - '雷' => '雷', - '壘' => '壘', - '屢' => '屢', - '樓' => '樓', - '淚' => '淚', - '漏' => '漏', - '累' => '累', - '縷' => '縷', - '陋' => '陋', - '勒' => '勒', - '肋' => '肋', - '凜' => '凜', - '凌' => '凌', - '稜' => '稜', - '綾' => '綾', - '菱' => '菱', - '陵' => '陵', - '讀' => '讀', - '拏' => '拏', - '樂' => '樂', - '諾' => '諾', - '丹' => '丹', - '寧' => '寧', - '怒' => '怒', - '率' => '率', - '異' => '異', - '北' => '北', - '磻' => '磻', - '便' => '便', - '復' => '復', - '不' => '不', - '泌' => '泌', - '數' => '數', - '索' => '索', - '參' => '參', - '塞' => '塞', - '省' => '省', - '葉' => '葉', - '說' => '說', - '殺' => '殺', - '辰' => '辰', - '沈' => '沈', - '拾' => '拾', - '若' => '若', - '掠' => '掠', - '略' => '略', - '亮' => '亮', - '兩' => '兩', - '凉' => '凉', - '梁' => '梁', - '糧' => '糧', - '良' => '良', - '諒' => '諒', - '量' => '量', - '勵' => '勵', - '呂' => '呂', - '女' => '女', - '廬' => '廬', - '旅' => '旅', - '濾' => '濾', - '礪' => '礪', - '閭' => '閭', - '驪' => '驪', - '麗' => '麗', - '黎' => '黎', - '力' => '力', - '曆' => '曆', - '歷' => '歷', - '轢' => '轢', - '年' => '年', - '憐' => '憐', - '戀' => '戀', - '撚' => '撚', - '漣' => '漣', - '煉' => '煉', - '璉' => '璉', - '秊' => '秊', - '練' => '練', - '聯' => '聯', - '輦' => '輦', - '蓮' => '蓮', - '連' => '連', - '鍊' => '鍊', - '列' => '列', - '劣' => '劣', - '咽' => '咽', - '烈' => '烈', - '裂' => '裂', - '說' => '說', - '廉' => '廉', - '念' => '念', - '捻' => '捻', - '殮' => '殮', - '簾' => '簾', - '獵' => '獵', - '令' => '令', - '囹' => '囹', - '寧' => '寧', - '嶺' => '嶺', - '怜' => '怜', - '玲' => '玲', - '瑩' => '瑩', - '羚' => '羚', - '聆' => '聆', - '鈴' => '鈴', - '零' => '零', - '靈' => '靈', - '領' => '領', - '例' => '例', - '禮' => '禮', - '醴' => '醴', - '隸' => '隸', - '惡' => '惡', - '了' => '了', - '僚' => '僚', - '寮' => '寮', - '尿' => '尿', - '料' => '料', - '樂' => '樂', - '燎' => '燎', - '療' => '療', - '蓼' => '蓼', - '遼' => '遼', - '龍' => '龍', - '暈' => '暈', - '阮' => '阮', - '劉' => '劉', - '杻' => '杻', - '柳' => '柳', - '流' => '流', - '溜' => '溜', - '琉' => '琉', - '留' => '留', - '硫' => '硫', - '紐' => '紐', - '類' => '類', - '六' => '六', - '戮' => '戮', - '陸' => '陸', - '倫' => '倫', - '崙' => '崙', - '淪' => '淪', - '輪' => '輪', - '律' => '律', - '慄' => '慄', - '栗' => '栗', - '率' => '率', - '隆' => '隆', - '利' => '利', - '吏' => '吏', - '履' => '履', - '易' => '易', - '李' => '李', - '梨' => '梨', - '泥' => '泥', - '理' => '理', - '痢' => '痢', - '罹' => '罹', - '裏' => '裏', - '裡' => '裡', - '里' => '里', - '離' => '離', - '匿' => '匿', - '溺' => '溺', - '吝' => '吝', - '燐' => '燐', - '璘' => '璘', - '藺' => '藺', - '隣' => '隣', - '鱗' => '鱗', - '麟' => '麟', - '林' => '林', - '淋' => '淋', - '臨' => '臨', - '立' => '立', - '笠' => '笠', - '粒' => '粒', - '狀' => '狀', - '炙' => '炙', - '識' => '識', - '什' => '什', - '茶' => '茶', - '刺' => '刺', - '切' => '切', - '度' => '度', - '拓' => '拓', - '糖' => '糖', - '宅' => '宅', - '洞' => '洞', - '暴' => '暴', - '輻' => '輻', - '行' => '行', - '降' => '降', - '見' => '見', - '廓' => '廓', - '兀' => '兀', - '嗀' => '嗀', - '塚' => '塚', - '晴' => '晴', - '凞' => '凞', - '猪' => '猪', - '益' => '益', - '礼' => '礼', - '神' => '神', - '祥' => '祥', - '福' => '福', - '靖' => '靖', - '精' => '精', - '羽' => '羽', - '蘒' => '蘒', - '諸' => '諸', - '逸' => '逸', - '都' => '都', - '飯' => '飯', - '飼' => '飼', - '館' => '館', - '鶴' => '鶴', - '郞' => '郞', - '隷' => '隷', - '侮' => '侮', - '僧' => '僧', - '免' => '免', - '勉' => '勉', - '勤' => '勤', - '卑' => '卑', - '喝' => '喝', - '嘆' => '嘆', - '器' => '器', - '塀' => '塀', - '墨' => '墨', - '層' => '層', - '屮' => '屮', - '悔' => '悔', - '慨' => '慨', - '憎' => '憎', - '懲' => '懲', - '敏' => '敏', - '既' => '既', - '暑' => '暑', - '梅' => '梅', - '海' => '海', - '渚' => '渚', - '漢' => '漢', - '煮' => '煮', - '爫' => '爫', - '琢' => '琢', - '碑' => '碑', - '社' => '社', - '祉' => '祉', - '祈' => '祈', - '祐' => '祐', - '祖' => '祖', - '祝' => '祝', - '禍' => '禍', - '禎' => '禎', - '穀' => '穀', - '突' => '突', - '節' => '節', - '練' => '練', - '縉' => '縉', - '繁' => '繁', - '署' => '署', - '者' => '者', - '臭' => '臭', - '艹' => '艹', - '艹' => '艹', - '著' => '著', - '褐' => '褐', - '視' => '視', - '謁' => '謁', - '謹' => '謹', - '賓' => '賓', - '贈' => '贈', - '辶' => '辶', - '逸' => '逸', - '難' => '難', - '響' => '響', - '頻' => '頻', - '恵' => '恵', - '𤋮' => '𤋮', - '舘' => '舘', - '並' => '並', - '况' => '况', - '全' => '全', - '侀' => '侀', - '充' => '充', - '冀' => '冀', - '勇' => '勇', - '勺' => '勺', - '喝' => '喝', - '啕' => '啕', - '喙' => '喙', - '嗢' => '嗢', - '塚' => '塚', - '墳' => '墳', - '奄' => '奄', - '奔' => '奔', - '婢' => '婢', - '嬨' => '嬨', - '廒' => '廒', - '廙' => '廙', - '彩' => '彩', - '徭' => '徭', - '惘' => '惘', - '慎' => '慎', - '愈' => '愈', - '憎' => '憎', - '慠' => '慠', - '懲' => '懲', - '戴' => '戴', - '揄' => '揄', - '搜' => '搜', - '摒' => '摒', - '敖' => '敖', - '晴' => '晴', - '朗' => '朗', - '望' => '望', - '杖' => '杖', - '歹' => '歹', - '殺' => '殺', - '流' => '流', - '滛' => '滛', - '滋' => '滋', - '漢' => '漢', - '瀞' => '瀞', - '煮' => '煮', - '瞧' => '瞧', - '爵' => '爵', - '犯' => '犯', - '猪' => '猪', - '瑱' => '瑱', - '甆' => '甆', - '画' => '画', - '瘝' => '瘝', - '瘟' => '瘟', - '益' => '益', - '盛' => '盛', - '直' => '直', - '睊' => '睊', - '着' => '着', - '磌' => '磌', - '窱' => '窱', - '節' => '節', - '类' => '类', - '絛' => '絛', - '練' => '練', - '缾' => '缾', - '者' => '者', - '荒' => '荒', - '華' => '華', - '蝹' => '蝹', - '襁' => '襁', - '覆' => '覆', - '視' => '視', - '調' => '調', - '諸' => '諸', - '請' => '請', - '謁' => '謁', - '諾' => '諾', - '諭' => '諭', - '謹' => '謹', - '變' => '變', - '贈' => '贈', - '輸' => '輸', - '遲' => '遲', - '醙' => '醙', - '鉶' => '鉶', - '陼' => '陼', - '難' => '難', - '靖' => '靖', - '韛' => '韛', - '響' => '響', - '頋' => '頋', - '頻' => '頻', - '鬒' => '鬒', - '龜' => '龜', - '𢡊' => '𢡊', - '𢡄' => '𢡄', - '𣏕' => '𣏕', - '㮝' => '㮝', - '䀘' => '䀘', - '䀹' => '䀹', - '𥉉' => '𥉉', - '𥳐' => '𥳐', - '𧻓' => '𧻓', - '齃' => '齃', - '龎' => '龎', - 'יִ' => 'יִ', - 'ײַ' => 'ײַ', - 'שׁ' => 'שׁ', - 'שׂ' => 'שׂ', - 'שּׁ' => 'שּׁ', - 'שּׂ' => 'שּׂ', - 'אַ' => 'אַ', - 'אָ' => 'אָ', - 'אּ' => 'אּ', - 'בּ' => 'בּ', - 'גּ' => 'גּ', - 'דּ' => 'דּ', - 'הּ' => 'הּ', - 'וּ' => 'וּ', - 'זּ' => 'זּ', - 'טּ' => 'טּ', - 'יּ' => 'יּ', - 'ךּ' => 'ךּ', - 'כּ' => 'כּ', - 'לּ' => 'לּ', - 'מּ' => 'מּ', - 'נּ' => 'נּ', - 'סּ' => 'סּ', - 'ףּ' => 'ףּ', - 'פּ' => 'פּ', - 'צּ' => 'צּ', - 'קּ' => 'קּ', - 'רּ' => 'רּ', - 'שּ' => 'שּ', - 'תּ' => 'תּ', - 'וֹ' => 'וֹ', - 'בֿ' => 'בֿ', - 'כֿ' => 'כֿ', - 'פֿ' => 'פֿ', - '𑂚' => '𑂚', - '𑂜' => '𑂜', - '𑂫' => '𑂫', - '𑄮' => '𑄮', - '𑄯' => '𑄯', - '𑍋' => '𑍋', - '𑍌' => '𑍌', - '𑒻' => '𑒻', - '𑒼' => '𑒼', - '𑒾' => '𑒾', - '𑖺' => '𑖺', - '𑖻' => '𑖻', - '𑤸' => '𑤸', - '𝅗𝅥' => '𝅗𝅥', - '𝅘𝅥' => '𝅘𝅥', - '𝅘𝅥𝅮' => '𝅘𝅥𝅮', - '𝅘𝅥𝅯' => '𝅘𝅥𝅯', - '𝅘𝅥𝅰' => '𝅘𝅥𝅰', - '𝅘𝅥𝅱' => '𝅘𝅥𝅱', - '𝅘𝅥𝅲' => '𝅘𝅥𝅲', - '𝆹𝅥' => '𝆹𝅥', - '𝆺𝅥' => '𝆺𝅥', - '𝆹𝅥𝅮' => '𝆹𝅥𝅮', - '𝆺𝅥𝅮' => '𝆺𝅥𝅮', - '𝆹𝅥𝅯' => '𝆹𝅥𝅯', - '𝆺𝅥𝅯' => '𝆺𝅥𝅯', - '丽' => '丽', - '丸' => '丸', - '乁' => '乁', - '𠄢' => '𠄢', - '你' => '你', - '侮' => '侮', - '侻' => '侻', - '倂' => '倂', - '偺' => '偺', - '備' => '備', - '僧' => '僧', - '像' => '像', - '㒞' => '㒞', - '𠘺' => '𠘺', - '免' => '免', - '兔' => '兔', - '兤' => '兤', - '具' => '具', - '𠔜' => '𠔜', - '㒹' => '㒹', - '內' => '內', - '再' => '再', - '𠕋' => '𠕋', - '冗' => '冗', - '冤' => '冤', - '仌' => '仌', - '冬' => '冬', - '况' => '况', - '𩇟' => '𩇟', - '凵' => '凵', - '刃' => '刃', - '㓟' => '㓟', - '刻' => '刻', - '剆' => '剆', - '割' => '割', - '剷' => '剷', - '㔕' => '㔕', - '勇' => '勇', - '勉' => '勉', - '勤' => '勤', - '勺' => '勺', - '包' => '包', - '匆' => '匆', - '北' => '北', - '卉' => '卉', - '卑' => '卑', - '博' => '博', - '即' => '即', - '卽' => '卽', - '卿' => '卿', - '卿' => '卿', - '卿' => '卿', - '𠨬' => '𠨬', - '灰' => '灰', - '及' => '及', - '叟' => '叟', - '𠭣' => '𠭣', - '叫' => '叫', - '叱' => '叱', - '吆' => '吆', - '咞' => '咞', - '吸' => '吸', - '呈' => '呈', - '周' => '周', - '咢' => '咢', - '哶' => '哶', - '唐' => '唐', - '啓' => '啓', - '啣' => '啣', - '善' => '善', - '善' => '善', - '喙' => '喙', - '喫' => '喫', - '喳' => '喳', - '嗂' => '嗂', - '圖' => '圖', - '嘆' => '嘆', - '圗' => '圗', - '噑' => '噑', - '噴' => '噴', - '切' => '切', - '壮' => '壮', - '城' => '城', - '埴' => '埴', - '堍' => '堍', - '型' => '型', - '堲' => '堲', - '報' => '報', - '墬' => '墬', - '𡓤' => '𡓤', - '売' => '売', - '壷' => '壷', - '夆' => '夆', - '多' => '多', - '夢' => '夢', - '奢' => '奢', - '𡚨' => '𡚨', - '𡛪' => '𡛪', - '姬' => '姬', - '娛' => '娛', - '娧' => '娧', - '姘' => '姘', - '婦' => '婦', - '㛮' => '㛮', - '㛼' => '㛼', - '嬈' => '嬈', - '嬾' => '嬾', - '嬾' => '嬾', - '𡧈' => '𡧈', - '寃' => '寃', - '寘' => '寘', - '寧' => '寧', - '寳' => '寳', - '𡬘' => '𡬘', - '寿' => '寿', - '将' => '将', - '当' => '当', - '尢' => '尢', - '㞁' => '㞁', - '屠' => '屠', - '屮' => '屮', - '峀' => '峀', - '岍' => '岍', - '𡷤' => '𡷤', - '嵃' => '嵃', - '𡷦' => '𡷦', - '嵮' => '嵮', - '嵫' => '嵫', - '嵼' => '嵼', - '巡' => '巡', - '巢' => '巢', - '㠯' => '㠯', - '巽' => '巽', - '帨' => '帨', - '帽' => '帽', - '幩' => '幩', - '㡢' => '㡢', - '𢆃' => '𢆃', - '㡼' => '㡼', - '庰' => '庰', - '庳' => '庳', - '庶' => '庶', - '廊' => '廊', - '𪎒' => '𪎒', - '廾' => '廾', - '𢌱' => '𢌱', - '𢌱' => '𢌱', - '舁' => '舁', - '弢' => '弢', - '弢' => '弢', - '㣇' => '㣇', - '𣊸' => '𣊸', - '𦇚' => '𦇚', - '形' => '形', - '彫' => '彫', - '㣣' => '㣣', - '徚' => '徚', - '忍' => '忍', - '志' => '志', - '忹' => '忹', - '悁' => '悁', - '㤺' => '㤺', - '㤜' => '㤜', - '悔' => '悔', - '𢛔' => '𢛔', - '惇' => '惇', - '慈' => '慈', - '慌' => '慌', - '慎' => '慎', - '慌' => '慌', - '慺' => '慺', - '憎' => '憎', - '憲' => '憲', - '憤' => '憤', - '憯' => '憯', - '懞' => '懞', - '懲' => '懲', - '懶' => '懶', - '成' => '成', - '戛' => '戛', - '扝' => '扝', - '抱' => '抱', - '拔' => '拔', - '捐' => '捐', - '𢬌' => '𢬌', - '挽' => '挽', - '拼' => '拼', - '捨' => '捨', - '掃' => '掃', - '揤' => '揤', - '𢯱' => '𢯱', - '搢' => '搢', - '揅' => '揅', - '掩' => '掩', - '㨮' => '㨮', - '摩' => '摩', - '摾' => '摾', - '撝' => '撝', - '摷' => '摷', - '㩬' => '㩬', - '敏' => '敏', - '敬' => '敬', - '𣀊' => '𣀊', - '旣' => '旣', - '書' => '書', - '晉' => '晉', - '㬙' => '㬙', - '暑' => '暑', - '㬈' => '㬈', - '㫤' => '㫤', - '冒' => '冒', - '冕' => '冕', - '最' => '最', - '暜' => '暜', - '肭' => '肭', - '䏙' => '䏙', - '朗' => '朗', - '望' => '望', - '朡' => '朡', - '杞' => '杞', - '杓' => '杓', - '𣏃' => '𣏃', - '㭉' => '㭉', - '柺' => '柺', - '枅' => '枅', - '桒' => '桒', - '梅' => '梅', - '𣑭' => '𣑭', - '梎' => '梎', - '栟' => '栟', - '椔' => '椔', - '㮝' => '㮝', - '楂' => '楂', - '榣' => '榣', - '槪' => '槪', - '檨' => '檨', - '𣚣' => '𣚣', - '櫛' => '櫛', - '㰘' => '㰘', - '次' => '次', - '𣢧' => '𣢧', - '歔' => '歔', - '㱎' => '㱎', - '歲' => '歲', - '殟' => '殟', - '殺' => '殺', - '殻' => '殻', - '𣪍' => '𣪍', - '𡴋' => '𡴋', - '𣫺' => '𣫺', - '汎' => '汎', - '𣲼' => '𣲼', - '沿' => '沿', - '泍' => '泍', - '汧' => '汧', - '洖' => '洖', - '派' => '派', - '海' => '海', - '流' => '流', - '浩' => '浩', - '浸' => '浸', - '涅' => '涅', - '𣴞' => '𣴞', - '洴' => '洴', - '港' => '港', - '湮' => '湮', - '㴳' => '㴳', - '滋' => '滋', - '滇' => '滇', - '𣻑' => '𣻑', - '淹' => '淹', - '潮' => '潮', - '𣽞' => '𣽞', - '𣾎' => '𣾎', - '濆' => '濆', - '瀹' => '瀹', - '瀞' => '瀞', - '瀛' => '瀛', - '㶖' => '㶖', - '灊' => '灊', - '災' => '災', - '灷' => '灷', - '炭' => '炭', - '𠔥' => '𠔥', - '煅' => '煅', - '𤉣' => '𤉣', - '熜' => '熜', - '𤎫' => '𤎫', - '爨' => '爨', - '爵' => '爵', - '牐' => '牐', - '𤘈' => '𤘈', - '犀' => '犀', - '犕' => '犕', - '𤜵' => '𤜵', - '𤠔' => '𤠔', - '獺' => '獺', - '王' => '王', - '㺬' => '㺬', - '玥' => '玥', - '㺸' => '㺸', - '㺸' => '㺸', - '瑇' => '瑇', - '瑜' => '瑜', - '瑱' => '瑱', - '璅' => '璅', - '瓊' => '瓊', - '㼛' => '㼛', - '甤' => '甤', - '𤰶' => '𤰶', - '甾' => '甾', - '𤲒' => '𤲒', - '異' => '異', - '𢆟' => '𢆟', - '瘐' => '瘐', - '𤾡' => '𤾡', - '𤾸' => '𤾸', - '𥁄' => '𥁄', - '㿼' => '㿼', - '䀈' => '䀈', - '直' => '直', - '𥃳' => '𥃳', - '𥃲' => '𥃲', - '𥄙' => '𥄙', - '𥄳' => '𥄳', - '眞' => '眞', - '真' => '真', - '真' => '真', - '睊' => '睊', - '䀹' => '䀹', - '瞋' => '瞋', - '䁆' => '䁆', - '䂖' => '䂖', - '𥐝' => '𥐝', - '硎' => '硎', - '碌' => '碌', - '磌' => '磌', - '䃣' => '䃣', - '𥘦' => '𥘦', - '祖' => '祖', - '𥚚' => '𥚚', - '𥛅' => '𥛅', - '福' => '福', - '秫' => '秫', - '䄯' => '䄯', - '穀' => '穀', - '穊' => '穊', - '穏' => '穏', - '𥥼' => '𥥼', - '𥪧' => '𥪧', - '𥪧' => '𥪧', - '竮' => '竮', - '䈂' => '䈂', - '𥮫' => '𥮫', - '篆' => '篆', - '築' => '築', - '䈧' => '䈧', - '𥲀' => '𥲀', - '糒' => '糒', - '䊠' => '䊠', - '糨' => '糨', - '糣' => '糣', - '紀' => '紀', - '𥾆' => '𥾆', - '絣' => '絣', - '䌁' => '䌁', - '緇' => '緇', - '縂' => '縂', - '繅' => '繅', - '䌴' => '䌴', - '𦈨' => '𦈨', - '𦉇' => '𦉇', - '䍙' => '䍙', - '𦋙' => '𦋙', - '罺' => '罺', - '𦌾' => '𦌾', - '羕' => '羕', - '翺' => '翺', - '者' => '者', - '𦓚' => '𦓚', - '𦔣' => '𦔣', - '聠' => '聠', - '𦖨' => '𦖨', - '聰' => '聰', - '𣍟' => '𣍟', - '䏕' => '䏕', - '育' => '育', - '脃' => '脃', - '䐋' => '䐋', - '脾' => '脾', - '媵' => '媵', - '𦞧' => '𦞧', - '𦞵' => '𦞵', - '𣎓' => '𣎓', - '𣎜' => '𣎜', - '舁' => '舁', - '舄' => '舄', - '辞' => '辞', - '䑫' => '䑫', - '芑' => '芑', - '芋' => '芋', - '芝' => '芝', - '劳' => '劳', - '花' => '花', - '芳' => '芳', - '芽' => '芽', - '苦' => '苦', - '𦬼' => '𦬼', - '若' => '若', - '茝' => '茝', - '荣' => '荣', - '莭' => '莭', - '茣' => '茣', - '莽' => '莽', - '菧' => '菧', - '著' => '著', - '荓' => '荓', - '菊' => '菊', - '菌' => '菌', - '菜' => '菜', - '𦰶' => '𦰶', - '𦵫' => '𦵫', - '𦳕' => '𦳕', - '䔫' => '䔫', - '蓱' => '蓱', - '蓳' => '蓳', - '蔖' => '蔖', - '𧏊' => '𧏊', - '蕤' => '蕤', - '𦼬' => '𦼬', - '䕝' => '䕝', - '䕡' => '䕡', - '𦾱' => '𦾱', - '𧃒' => '𧃒', - '䕫' => '䕫', - '虐' => '虐', - '虜' => '虜', - '虧' => '虧', - '虩' => '虩', - '蚩' => '蚩', - '蚈' => '蚈', - '蜎' => '蜎', - '蛢' => '蛢', - '蝹' => '蝹', - '蜨' => '蜨', - '蝫' => '蝫', - '螆' => '螆', - '䗗' => '䗗', - '蟡' => '蟡', - '蠁' => '蠁', - '䗹' => '䗹', - '衠' => '衠', - '衣' => '衣', - '𧙧' => '𧙧', - '裗' => '裗', - '裞' => '裞', - '䘵' => '䘵', - '裺' => '裺', - '㒻' => '㒻', - '𧢮' => '𧢮', - '𧥦' => '𧥦', - '䚾' => '䚾', - '䛇' => '䛇', - '誠' => '誠', - '諭' => '諭', - '變' => '變', - '豕' => '豕', - '𧲨' => '𧲨', - '貫' => '貫', - '賁' => '賁', - '贛' => '贛', - '起' => '起', - '𧼯' => '𧼯', - '𠠄' => '𠠄', - '跋' => '跋', - '趼' => '趼', - '跰' => '跰', - '𠣞' => '𠣞', - '軔' => '軔', - '輸' => '輸', - '𨗒' => '𨗒', - '𨗭' => '𨗭', - '邔' => '邔', - '郱' => '郱', - '鄑' => '鄑', - '𨜮' => '𨜮', - '鄛' => '鄛', - '鈸' => '鈸', - '鋗' => '鋗', - '鋘' => '鋘', - '鉼' => '鉼', - '鏹' => '鏹', - '鐕' => '鐕', - '𨯺' => '𨯺', - '開' => '開', - '䦕' => '䦕', - '閷' => '閷', - '𨵷' => '𨵷', - '䧦' => '䧦', - '雃' => '雃', - '嶲' => '嶲', - '霣' => '霣', - '𩅅' => '𩅅', - '𩈚' => '𩈚', - '䩮' => '䩮', - '䩶' => '䩶', - '韠' => '韠', - '𩐊' => '𩐊', - '䪲' => '䪲', - '𩒖' => '𩒖', - '頋' => '頋', - '頋' => '頋', - '頩' => '頩', - '𩖶' => '𩖶', - '飢' => '飢', - '䬳' => '䬳', - '餩' => '餩', - '馧' => '馧', - '駂' => '駂', - '駾' => '駾', - '䯎' => '䯎', - '𩬰' => '𩬰', - '鬒' => '鬒', - '鱀' => '鱀', - '鳽' => '鳽', - '䳎' => '䳎', - '䳭' => '䳭', - '鵧' => '鵧', - '𪃎' => '𪃎', - '䳸' => '䳸', - '𪄅' => '𪄅', - '𪈎' => '𪈎', - '𪊑' => '𪊑', - '麻' => '麻', - '䵖' => '䵖', - '黹' => '黹', - '黾' => '黾', - '鼅' => '鼅', - '鼏' => '鼏', - '鼖' => '鼖', - '鼻' => '鼻', - '𪘀' => '𪘀', -); diff --git a/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php b/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php deleted file mode 100644 index ec90f36e..00000000 --- a/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php +++ /dev/null @@ -1,876 +0,0 @@ - 230, - '́' => 230, - '̂' => 230, - '̃' => 230, - '̄' => 230, - '̅' => 230, - '̆' => 230, - '̇' => 230, - '̈' => 230, - '̉' => 230, - '̊' => 230, - '̋' => 230, - '̌' => 230, - '̍' => 230, - '̎' => 230, - '̏' => 230, - '̐' => 230, - '̑' => 230, - '̒' => 230, - '̓' => 230, - '̔' => 230, - '̕' => 232, - '̖' => 220, - '̗' => 220, - '̘' => 220, - '̙' => 220, - '̚' => 232, - '̛' => 216, - '̜' => 220, - '̝' => 220, - '̞' => 220, - '̟' => 220, - '̠' => 220, - '̡' => 202, - '̢' => 202, - '̣' => 220, - '̤' => 220, - '̥' => 220, - '̦' => 220, - '̧' => 202, - '̨' => 202, - '̩' => 220, - '̪' => 220, - '̫' => 220, - '̬' => 220, - '̭' => 220, - '̮' => 220, - '̯' => 220, - '̰' => 220, - '̱' => 220, - '̲' => 220, - '̳' => 220, - '̴' => 1, - '̵' => 1, - '̶' => 1, - '̷' => 1, - '̸' => 1, - '̹' => 220, - '̺' => 220, - '̻' => 220, - '̼' => 220, - '̽' => 230, - '̾' => 230, - '̿' => 230, - '̀' => 230, - '́' => 230, - '͂' => 230, - '̓' => 230, - '̈́' => 230, - 'ͅ' => 240, - '͆' => 230, - '͇' => 220, - '͈' => 220, - '͉' => 220, - '͊' => 230, - '͋' => 230, - '͌' => 230, - '͍' => 220, - '͎' => 220, - '͐' => 230, - '͑' => 230, - '͒' => 230, - '͓' => 220, - '͔' => 220, - '͕' => 220, - '͖' => 220, - '͗' => 230, - '͘' => 232, - '͙' => 220, - '͚' => 220, - '͛' => 230, - '͜' => 233, - '͝' => 234, - '͞' => 234, - '͟' => 233, - '͠' => 234, - '͡' => 234, - '͢' => 233, - 'ͣ' => 230, - 'ͤ' => 230, - 'ͥ' => 230, - 'ͦ' => 230, - 'ͧ' => 230, - 'ͨ' => 230, - 'ͩ' => 230, - 'ͪ' => 230, - 'ͫ' => 230, - 'ͬ' => 230, - 'ͭ' => 230, - 'ͮ' => 230, - 'ͯ' => 230, - '҃' => 230, - '҄' => 230, - '҅' => 230, - '҆' => 230, - '҇' => 230, - '֑' => 220, - '֒' => 230, - '֓' => 230, - '֔' => 230, - '֕' => 230, - '֖' => 220, - '֗' => 230, - '֘' => 230, - '֙' => 230, - '֚' => 222, - '֛' => 220, - '֜' => 230, - '֝' => 230, - '֞' => 230, - '֟' => 230, - '֠' => 230, - '֡' => 230, - '֢' => 220, - '֣' => 220, - '֤' => 220, - '֥' => 220, - '֦' => 220, - '֧' => 220, - '֨' => 230, - '֩' => 230, - '֪' => 220, - '֫' => 230, - '֬' => 230, - '֭' => 222, - '֮' => 228, - '֯' => 230, - 'ְ' => 10, - 'ֱ' => 11, - 'ֲ' => 12, - 'ֳ' => 13, - 'ִ' => 14, - 'ֵ' => 15, - 'ֶ' => 16, - 'ַ' => 17, - 'ָ' => 18, - 'ֹ' => 19, - 'ֺ' => 19, - 'ֻ' => 20, - 'ּ' => 21, - 'ֽ' => 22, - 'ֿ' => 23, - 'ׁ' => 24, - 'ׂ' => 25, - 'ׄ' => 230, - 'ׅ' => 220, - 'ׇ' => 18, - 'ؐ' => 230, - 'ؑ' => 230, - 'ؒ' => 230, - 'ؓ' => 230, - 'ؔ' => 230, - 'ؕ' => 230, - 'ؖ' => 230, - 'ؗ' => 230, - 'ؘ' => 30, - 'ؙ' => 31, - 'ؚ' => 32, - 'ً' => 27, - 'ٌ' => 28, - 'ٍ' => 29, - 'َ' => 30, - 'ُ' => 31, - 'ِ' => 32, - 'ّ' => 33, - 'ْ' => 34, - 'ٓ' => 230, - 'ٔ' => 230, - 'ٕ' => 220, - 'ٖ' => 220, - 'ٗ' => 230, - '٘' => 230, - 'ٙ' => 230, - 'ٚ' => 230, - 'ٛ' => 230, - 'ٜ' => 220, - 'ٝ' => 230, - 'ٞ' => 230, - 'ٟ' => 220, - 'ٰ' => 35, - 'ۖ' => 230, - 'ۗ' => 230, - 'ۘ' => 230, - 'ۙ' => 230, - 'ۚ' => 230, - 'ۛ' => 230, - 'ۜ' => 230, - '۟' => 230, - '۠' => 230, - 'ۡ' => 230, - 'ۢ' => 230, - 'ۣ' => 220, - 'ۤ' => 230, - 'ۧ' => 230, - 'ۨ' => 230, - '۪' => 220, - '۫' => 230, - '۬' => 230, - 'ۭ' => 220, - 'ܑ' => 36, - 'ܰ' => 230, - 'ܱ' => 220, - 'ܲ' => 230, - 'ܳ' => 230, - 'ܴ' => 220, - 'ܵ' => 230, - 'ܶ' => 230, - 'ܷ' => 220, - 'ܸ' => 220, - 'ܹ' => 220, - 'ܺ' => 230, - 'ܻ' => 220, - 'ܼ' => 220, - 'ܽ' => 230, - 'ܾ' => 220, - 'ܿ' => 230, - '݀' => 230, - '݁' => 230, - '݂' => 220, - '݃' => 230, - '݄' => 220, - '݅' => 230, - '݆' => 220, - '݇' => 230, - '݈' => 220, - '݉' => 230, - '݊' => 230, - '߫' => 230, - '߬' => 230, - '߭' => 230, - '߮' => 230, - '߯' => 230, - '߰' => 230, - '߱' => 230, - '߲' => 220, - '߳' => 230, - '߽' => 220, - 'ࠖ' => 230, - 'ࠗ' => 230, - '࠘' => 230, - '࠙' => 230, - 'ࠛ' => 230, - 'ࠜ' => 230, - 'ࠝ' => 230, - 'ࠞ' => 230, - 'ࠟ' => 230, - 'ࠠ' => 230, - 'ࠡ' => 230, - 'ࠢ' => 230, - 'ࠣ' => 230, - 'ࠥ' => 230, - 'ࠦ' => 230, - 'ࠧ' => 230, - 'ࠩ' => 230, - 'ࠪ' => 230, - 'ࠫ' => 230, - 'ࠬ' => 230, - '࠭' => 230, - '࡙' => 220, - '࡚' => 220, - '࡛' => 220, - '࣓' => 220, - 'ࣔ' => 230, - 'ࣕ' => 230, - 'ࣖ' => 230, - 'ࣗ' => 230, - 'ࣘ' => 230, - 'ࣙ' => 230, - 'ࣚ' => 230, - 'ࣛ' => 230, - 'ࣜ' => 230, - 'ࣝ' => 230, - 'ࣞ' => 230, - 'ࣟ' => 230, - '࣠' => 230, - '࣡' => 230, - 'ࣣ' => 220, - 'ࣤ' => 230, - 'ࣥ' => 230, - 'ࣦ' => 220, - 'ࣧ' => 230, - 'ࣨ' => 230, - 'ࣩ' => 220, - '࣪' => 230, - '࣫' => 230, - '࣬' => 230, - '࣭' => 220, - '࣮' => 220, - '࣯' => 220, - 'ࣰ' => 27, - 'ࣱ' => 28, - 'ࣲ' => 29, - 'ࣳ' => 230, - 'ࣴ' => 230, - 'ࣵ' => 230, - 'ࣶ' => 220, - 'ࣷ' => 230, - 'ࣸ' => 230, - 'ࣹ' => 220, - 'ࣺ' => 220, - 'ࣻ' => 230, - 'ࣼ' => 230, - 'ࣽ' => 230, - 'ࣾ' => 230, - 'ࣿ' => 230, - '़' => 7, - '्' => 9, - '॑' => 230, - '॒' => 220, - '॓' => 230, - '॔' => 230, - '়' => 7, - '্' => 9, - '৾' => 230, - '਼' => 7, - '੍' => 9, - '઼' => 7, - '્' => 9, - '଼' => 7, - '୍' => 9, - '்' => 9, - '్' => 9, - 'ౕ' => 84, - 'ౖ' => 91, - '಼' => 7, - '್' => 9, - '഻' => 9, - '഼' => 9, - '്' => 9, - '්' => 9, - 'ุ' => 103, - 'ู' => 103, - 'ฺ' => 9, - '่' => 107, - '้' => 107, - '๊' => 107, - '๋' => 107, - 'ຸ' => 118, - 'ູ' => 118, - '຺' => 9, - '່' => 122, - '້' => 122, - '໊' => 122, - '໋' => 122, - '༘' => 220, - '༙' => 220, - '༵' => 220, - '༷' => 220, - '༹' => 216, - 'ཱ' => 129, - 'ི' => 130, - 'ུ' => 132, - 'ེ' => 130, - 'ཻ' => 130, - 'ོ' => 130, - 'ཽ' => 130, - 'ྀ' => 130, - 'ྂ' => 230, - 'ྃ' => 230, - '྄' => 9, - '྆' => 230, - '྇' => 230, - '࿆' => 220, - '့' => 7, - '္' => 9, - '်' => 9, - 'ႍ' => 220, - '፝' => 230, - '፞' => 230, - '፟' => 230, - '᜔' => 9, - '᜴' => 9, - '្' => 9, - '៝' => 230, - 'ᢩ' => 228, - '᤹' => 222, - '᤺' => 230, - '᤻' => 220, - 'ᨗ' => 230, - 'ᨘ' => 220, - '᩠' => 9, - '᩵' => 230, - '᩶' => 230, - '᩷' => 230, - '᩸' => 230, - '᩹' => 230, - '᩺' => 230, - '᩻' => 230, - '᩼' => 230, - '᩿' => 220, - '᪰' => 230, - '᪱' => 230, - '᪲' => 230, - '᪳' => 230, - '᪴' => 230, - '᪵' => 220, - '᪶' => 220, - '᪷' => 220, - '᪸' => 220, - '᪹' => 220, - '᪺' => 220, - '᪻' => 230, - '᪼' => 230, - '᪽' => 220, - 'ᪿ' => 220, - 'ᫀ' => 220, - '᬴' => 7, - '᭄' => 9, - '᭫' => 230, - '᭬' => 220, - '᭭' => 230, - '᭮' => 230, - '᭯' => 230, - '᭰' => 230, - '᭱' => 230, - '᭲' => 230, - '᭳' => 230, - '᮪' => 9, - '᮫' => 9, - '᯦' => 7, - '᯲' => 9, - '᯳' => 9, - '᰷' => 7, - '᳐' => 230, - '᳑' => 230, - '᳒' => 230, - '᳔' => 1, - '᳕' => 220, - '᳖' => 220, - '᳗' => 220, - '᳘' => 220, - '᳙' => 220, - '᳚' => 230, - '᳛' => 230, - '᳜' => 220, - '᳝' => 220, - '᳞' => 220, - '᳟' => 220, - '᳠' => 230, - '᳢' => 1, - '᳣' => 1, - '᳤' => 1, - '᳥' => 1, - '᳦' => 1, - '᳧' => 1, - '᳨' => 1, - '᳭' => 220, - '᳴' => 230, - '᳸' => 230, - '᳹' => 230, - '᷀' => 230, - '᷁' => 230, - '᷂' => 220, - '᷃' => 230, - '᷄' => 230, - '᷅' => 230, - '᷆' => 230, - '᷇' => 230, - '᷈' => 230, - '᷉' => 230, - '᷊' => 220, - '᷋' => 230, - '᷌' => 230, - '᷍' => 234, - '᷎' => 214, - '᷏' => 220, - '᷐' => 202, - '᷑' => 230, - '᷒' => 230, - 'ᷓ' => 230, - 'ᷔ' => 230, - 'ᷕ' => 230, - 'ᷖ' => 230, - 'ᷗ' => 230, - 'ᷘ' => 230, - 'ᷙ' => 230, - 'ᷚ' => 230, - 'ᷛ' => 230, - 'ᷜ' => 230, - 'ᷝ' => 230, - 'ᷞ' => 230, - 'ᷟ' => 230, - 'ᷠ' => 230, - 'ᷡ' => 230, - 'ᷢ' => 230, - 'ᷣ' => 230, - 'ᷤ' => 230, - 'ᷥ' => 230, - 'ᷦ' => 230, - 'ᷧ' => 230, - 'ᷨ' => 230, - 'ᷩ' => 230, - 'ᷪ' => 230, - 'ᷫ' => 230, - 'ᷬ' => 230, - 'ᷭ' => 230, - 'ᷮ' => 230, - 'ᷯ' => 230, - 'ᷰ' => 230, - 'ᷱ' => 230, - 'ᷲ' => 230, - 'ᷳ' => 230, - 'ᷴ' => 230, - '᷵' => 230, - '᷶' => 232, - '᷷' => 228, - '᷸' => 228, - '᷹' => 220, - '᷻' => 230, - '᷼' => 233, - '᷽' => 220, - '᷾' => 230, - '᷿' => 220, - '⃐' => 230, - '⃑' => 230, - '⃒' => 1, - '⃓' => 1, - '⃔' => 230, - '⃕' => 230, - '⃖' => 230, - '⃗' => 230, - '⃘' => 1, - '⃙' => 1, - '⃚' => 1, - '⃛' => 230, - '⃜' => 230, - '⃡' => 230, - '⃥' => 1, - '⃦' => 1, - '⃧' => 230, - '⃨' => 220, - '⃩' => 230, - '⃪' => 1, - '⃫' => 1, - '⃬' => 220, - '⃭' => 220, - '⃮' => 220, - '⃯' => 220, - '⃰' => 230, - '⳯' => 230, - '⳰' => 230, - '⳱' => 230, - '⵿' => 9, - 'ⷠ' => 230, - 'ⷡ' => 230, - 'ⷢ' => 230, - 'ⷣ' => 230, - 'ⷤ' => 230, - 'ⷥ' => 230, - 'ⷦ' => 230, - 'ⷧ' => 230, - 'ⷨ' => 230, - 'ⷩ' => 230, - 'ⷪ' => 230, - 'ⷫ' => 230, - 'ⷬ' => 230, - 'ⷭ' => 230, - 'ⷮ' => 230, - 'ⷯ' => 230, - 'ⷰ' => 230, - 'ⷱ' => 230, - 'ⷲ' => 230, - 'ⷳ' => 230, - 'ⷴ' => 230, - 'ⷵ' => 230, - 'ⷶ' => 230, - 'ⷷ' => 230, - 'ⷸ' => 230, - 'ⷹ' => 230, - 'ⷺ' => 230, - 'ⷻ' => 230, - 'ⷼ' => 230, - 'ⷽ' => 230, - 'ⷾ' => 230, - 'ⷿ' => 230, - '〪' => 218, - '〫' => 228, - '〬' => 232, - '〭' => 222, - '〮' => 224, - '〯' => 224, - '゙' => 8, - '゚' => 8, - '꙯' => 230, - 'ꙴ' => 230, - 'ꙵ' => 230, - 'ꙶ' => 230, - 'ꙷ' => 230, - 'ꙸ' => 230, - 'ꙹ' => 230, - 'ꙺ' => 230, - 'ꙻ' => 230, - '꙼' => 230, - '꙽' => 230, - 'ꚞ' => 230, - 'ꚟ' => 230, - '꛰' => 230, - '꛱' => 230, - '꠆' => 9, - '꠬' => 9, - '꣄' => 9, - '꣠' => 230, - '꣡' => 230, - '꣢' => 230, - '꣣' => 230, - '꣤' => 230, - '꣥' => 230, - '꣦' => 230, - '꣧' => 230, - '꣨' => 230, - '꣩' => 230, - '꣪' => 230, - '꣫' => 230, - '꣬' => 230, - '꣭' => 230, - '꣮' => 230, - '꣯' => 230, - '꣰' => 230, - '꣱' => 230, - '꤫' => 220, - '꤬' => 220, - '꤭' => 220, - '꥓' => 9, - '꦳' => 7, - '꧀' => 9, - 'ꪰ' => 230, - 'ꪲ' => 230, - 'ꪳ' => 230, - 'ꪴ' => 220, - 'ꪷ' => 230, - 'ꪸ' => 230, - 'ꪾ' => 230, - '꪿' => 230, - '꫁' => 230, - '꫶' => 9, - '꯭' => 9, - 'ﬞ' => 26, - '︠' => 230, - '︡' => 230, - '︢' => 230, - '︣' => 230, - '︤' => 230, - '︥' => 230, - '︦' => 230, - '︧' => 220, - '︨' => 220, - '︩' => 220, - '︪' => 220, - '︫' => 220, - '︬' => 220, - '︭' => 220, - '︮' => 230, - '︯' => 230, - '𐇽' => 220, - '𐋠' => 220, - '𐍶' => 230, - '𐍷' => 230, - '𐍸' => 230, - '𐍹' => 230, - '𐍺' => 230, - '𐨍' => 220, - '𐨏' => 230, - '𐨸' => 230, - '𐨹' => 1, - '𐨺' => 220, - '𐨿' => 9, - '𐫥' => 230, - '𐫦' => 220, - '𐴤' => 230, - '𐴥' => 230, - '𐴦' => 230, - '𐴧' => 230, - '𐺫' => 230, - '𐺬' => 230, - '𐽆' => 220, - '𐽇' => 220, - '𐽈' => 230, - '𐽉' => 230, - '𐽊' => 230, - '𐽋' => 220, - '𐽌' => 230, - '𐽍' => 220, - '𐽎' => 220, - '𐽏' => 220, - '𐽐' => 220, - '𑁆' => 9, - '𑁿' => 9, - '𑂹' => 9, - '𑂺' => 7, - '𑄀' => 230, - '𑄁' => 230, - '𑄂' => 230, - '𑄳' => 9, - '𑄴' => 9, - '𑅳' => 7, - '𑇀' => 9, - '𑇊' => 7, - '𑈵' => 9, - '𑈶' => 7, - '𑋩' => 7, - '𑋪' => 9, - '𑌻' => 7, - '𑌼' => 7, - '𑍍' => 9, - '𑍦' => 230, - '𑍧' => 230, - '𑍨' => 230, - '𑍩' => 230, - '𑍪' => 230, - '𑍫' => 230, - '𑍬' => 230, - '𑍰' => 230, - '𑍱' => 230, - '𑍲' => 230, - '𑍳' => 230, - '𑍴' => 230, - '𑑂' => 9, - '𑑆' => 7, - '𑑞' => 230, - '𑓂' => 9, - '𑓃' => 7, - '𑖿' => 9, - '𑗀' => 7, - '𑘿' => 9, - '𑚶' => 9, - '𑚷' => 7, - '𑜫' => 9, - '𑠹' => 9, - '𑠺' => 7, - '𑤽' => 9, - '𑤾' => 9, - '𑥃' => 7, - '𑧠' => 9, - '𑨴' => 9, - '𑩇' => 9, - '𑪙' => 9, - '𑰿' => 9, - '𑵂' => 7, - '𑵄' => 9, - '𑵅' => 9, - '𑶗' => 9, - '𖫰' => 1, - '𖫱' => 1, - '𖫲' => 1, - '𖫳' => 1, - '𖫴' => 1, - '𖬰' => 230, - '𖬱' => 230, - '𖬲' => 230, - '𖬳' => 230, - '𖬴' => 230, - '𖬵' => 230, - '𖬶' => 230, - '𖿰' => 6, - '𖿱' => 6, - '𛲞' => 1, - '𝅥' => 216, - '𝅦' => 216, - '𝅧' => 1, - '𝅨' => 1, - '𝅩' => 1, - '𝅭' => 226, - '𝅮' => 216, - '𝅯' => 216, - '𝅰' => 216, - '𝅱' => 216, - '𝅲' => 216, - '𝅻' => 220, - '𝅼' => 220, - '𝅽' => 220, - '𝅾' => 220, - '𝅿' => 220, - '𝆀' => 220, - '𝆁' => 220, - '𝆂' => 220, - '𝆅' => 230, - '𝆆' => 230, - '𝆇' => 230, - '𝆈' => 230, - '𝆉' => 230, - '𝆊' => 220, - '𝆋' => 220, - '𝆪' => 230, - '𝆫' => 230, - '𝆬' => 230, - '𝆭' => 230, - '𝉂' => 230, - '𝉃' => 230, - '𝉄' => 230, - '𞀀' => 230, - '𞀁' => 230, - '𞀂' => 230, - '𞀃' => 230, - '𞀄' => 230, - '𞀅' => 230, - '𞀆' => 230, - '𞀈' => 230, - '𞀉' => 230, - '𞀊' => 230, - '𞀋' => 230, - '𞀌' => 230, - '𞀍' => 230, - '𞀎' => 230, - '𞀏' => 230, - '𞀐' => 230, - '𞀑' => 230, - '𞀒' => 230, - '𞀓' => 230, - '𞀔' => 230, - '𞀕' => 230, - '𞀖' => 230, - '𞀗' => 230, - '𞀘' => 230, - '𞀛' => 230, - '𞀜' => 230, - '𞀝' => 230, - '𞀞' => 230, - '𞀟' => 230, - '𞀠' => 230, - '𞀡' => 230, - '𞀣' => 230, - '𞀤' => 230, - '𞀦' => 230, - '𞀧' => 230, - '𞀨' => 230, - '𞀩' => 230, - '𞀪' => 230, - '𞄰' => 230, - '𞄱' => 230, - '𞄲' => 230, - '𞄳' => 230, - '𞄴' => 230, - '𞄵' => 230, - '𞄶' => 230, - '𞋬' => 230, - '𞋭' => 230, - '𞋮' => 230, - '𞋯' => 230, - '𞣐' => 220, - '𞣑' => 220, - '𞣒' => 220, - '𞣓' => 220, - '𞣔' => 220, - '𞣕' => 220, - '𞣖' => 220, - '𞥄' => 230, - '𞥅' => 230, - '𞥆' => 230, - '𞥇' => 230, - '𞥈' => 230, - '𞥉' => 230, - '𞥊' => 7, -); diff --git a/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php b/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php deleted file mode 100644 index 15749028..00000000 --- a/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php +++ /dev/null @@ -1,3695 +0,0 @@ - ' ', - '¨' => ' ̈', - 'ª' => 'a', - '¯' => ' ̄', - '²' => '2', - '³' => '3', - '´' => ' ́', - 'µ' => 'μ', - '¸' => ' ̧', - '¹' => '1', - 'º' => 'o', - '¼' => '1⁄4', - '½' => '1⁄2', - '¾' => '3⁄4', - 'IJ' => 'IJ', - 'ij' => 'ij', - 'Ŀ' => 'L·', - 'ŀ' => 'l·', - 'ʼn' => 'ʼn', - 'ſ' => 's', - 'DŽ' => 'DŽ', - 'Dž' => 'Dž', - 'dž' => 'dž', - 'LJ' => 'LJ', - 'Lj' => 'Lj', - 'lj' => 'lj', - 'NJ' => 'NJ', - 'Nj' => 'Nj', - 'nj' => 'nj', - 'DZ' => 'DZ', - 'Dz' => 'Dz', - 'dz' => 'dz', - 'ʰ' => 'h', - 'ʱ' => 'ɦ', - 'ʲ' => 'j', - 'ʳ' => 'r', - 'ʴ' => 'ɹ', - 'ʵ' => 'ɻ', - 'ʶ' => 'ʁ', - 'ʷ' => 'w', - 'ʸ' => 'y', - '˘' => ' ̆', - '˙' => ' ̇', - '˚' => ' ̊', - '˛' => ' ̨', - '˜' => ' ̃', - '˝' => ' ̋', - 'ˠ' => 'ɣ', - 'ˡ' => 'l', - 'ˢ' => 's', - 'ˣ' => 'x', - 'ˤ' => 'ʕ', - 'ͺ' => ' ͅ', - '΄' => ' ́', - '΅' => ' ̈́', - 'ϐ' => 'β', - 'ϑ' => 'θ', - 'ϒ' => 'Υ', - 'ϓ' => 'Ύ', - 'ϔ' => 'Ϋ', - 'ϕ' => 'φ', - 'ϖ' => 'π', - 'ϰ' => 'κ', - 'ϱ' => 'ρ', - 'ϲ' => 'ς', - 'ϴ' => 'Θ', - 'ϵ' => 'ε', - 'Ϲ' => 'Σ', - 'և' => 'եւ', - 'ٵ' => 'اٴ', - 'ٶ' => 'وٴ', - 'ٷ' => 'ۇٴ', - 'ٸ' => 'يٴ', - 'ำ' => 'ํา', - 'ຳ' => 'ໍາ', - 'ໜ' => 'ຫນ', - 'ໝ' => 'ຫມ', - '༌' => '་', - 'ཷ' => 'ྲཱྀ', - 'ཹ' => 'ླཱྀ', - 'ჼ' => 'ნ', - 'ᴬ' => 'A', - 'ᴭ' => 'Æ', - 'ᴮ' => 'B', - 'ᴰ' => 'D', - 'ᴱ' => 'E', - 'ᴲ' => 'Ǝ', - 'ᴳ' => 'G', - 'ᴴ' => 'H', - 'ᴵ' => 'I', - 'ᴶ' => 'J', - 'ᴷ' => 'K', - 'ᴸ' => 'L', - 'ᴹ' => 'M', - 'ᴺ' => 'N', - 'ᴼ' => 'O', - 'ᴽ' => 'Ȣ', - 'ᴾ' => 'P', - 'ᴿ' => 'R', - 'ᵀ' => 'T', - 'ᵁ' => 'U', - 'ᵂ' => 'W', - 'ᵃ' => 'a', - 'ᵄ' => 'ɐ', - 'ᵅ' => 'ɑ', - 'ᵆ' => 'ᴂ', - 'ᵇ' => 'b', - 'ᵈ' => 'd', - 'ᵉ' => 'e', - 'ᵊ' => 'ə', - 'ᵋ' => 'ɛ', - 'ᵌ' => 'ɜ', - 'ᵍ' => 'g', - 'ᵏ' => 'k', - 'ᵐ' => 'm', - 'ᵑ' => 'ŋ', - 'ᵒ' => 'o', - 'ᵓ' => 'ɔ', - 'ᵔ' => 'ᴖ', - 'ᵕ' => 'ᴗ', - 'ᵖ' => 'p', - 'ᵗ' => 't', - 'ᵘ' => 'u', - 'ᵙ' => 'ᴝ', - 'ᵚ' => 'ɯ', - 'ᵛ' => 'v', - 'ᵜ' => 'ᴥ', - 'ᵝ' => 'β', - 'ᵞ' => 'γ', - 'ᵟ' => 'δ', - 'ᵠ' => 'φ', - 'ᵡ' => 'χ', - 'ᵢ' => 'i', - 'ᵣ' => 'r', - 'ᵤ' => 'u', - 'ᵥ' => 'v', - 'ᵦ' => 'β', - 'ᵧ' => 'γ', - 'ᵨ' => 'ρ', - 'ᵩ' => 'φ', - 'ᵪ' => 'χ', - 'ᵸ' => 'н', - 'ᶛ' => 'ɒ', - 'ᶜ' => 'c', - 'ᶝ' => 'ɕ', - 'ᶞ' => 'ð', - 'ᶟ' => 'ɜ', - 'ᶠ' => 'f', - 'ᶡ' => 'ɟ', - 'ᶢ' => 'ɡ', - 'ᶣ' => 'ɥ', - 'ᶤ' => 'ɨ', - 'ᶥ' => 'ɩ', - 'ᶦ' => 'ɪ', - 'ᶧ' => 'ᵻ', - 'ᶨ' => 'ʝ', - 'ᶩ' => 'ɭ', - 'ᶪ' => 'ᶅ', - 'ᶫ' => 'ʟ', - 'ᶬ' => 'ɱ', - 'ᶭ' => 'ɰ', - 'ᶮ' => 'ɲ', - 'ᶯ' => 'ɳ', - 'ᶰ' => 'ɴ', - 'ᶱ' => 'ɵ', - 'ᶲ' => 'ɸ', - 'ᶳ' => 'ʂ', - 'ᶴ' => 'ʃ', - 'ᶵ' => 'ƫ', - 'ᶶ' => 'ʉ', - 'ᶷ' => 'ʊ', - 'ᶸ' => 'ᴜ', - 'ᶹ' => 'ʋ', - 'ᶺ' => 'ʌ', - 'ᶻ' => 'z', - 'ᶼ' => 'ʐ', - 'ᶽ' => 'ʑ', - 'ᶾ' => 'ʒ', - 'ᶿ' => 'θ', - 'ẚ' => 'aʾ', - 'ẛ' => 'ṡ', - '᾽' => ' ̓', - '᾿' => ' ̓', - '῀' => ' ͂', - '῁' => ' ̈͂', - '῍' => ' ̓̀', - '῎' => ' ̓́', - '῏' => ' ̓͂', - '῝' => ' ̔̀', - '῞' => ' ̔́', - '῟' => ' ̔͂', - '῭' => ' ̈̀', - '΅' => ' ̈́', - '´' => ' ́', - '῾' => ' ̔', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - '‑' => '‐', - '‗' => ' ̳', - '․' => '.', - '‥' => '..', - '…' => '...', - ' ' => ' ', - '″' => '′′', - '‴' => '′′′', - '‶' => '‵‵', - '‷' => '‵‵‵', - '‼' => '!!', - '‾' => ' ̅', - '⁇' => '??', - '⁈' => '?!', - '⁉' => '!?', - '⁗' => '′′′′', - ' ' => ' ', - '⁰' => '0', - 'ⁱ' => 'i', - '⁴' => '4', - '⁵' => '5', - '⁶' => '6', - '⁷' => '7', - '⁸' => '8', - '⁹' => '9', - '⁺' => '+', - '⁻' => '−', - '⁼' => '=', - '⁽' => '(', - '⁾' => ')', - 'ⁿ' => 'n', - '₀' => '0', - '₁' => '1', - '₂' => '2', - '₃' => '3', - '₄' => '4', - '₅' => '5', - '₆' => '6', - '₇' => '7', - '₈' => '8', - '₉' => '9', - '₊' => '+', - '₋' => '−', - '₌' => '=', - '₍' => '(', - '₎' => ')', - 'ₐ' => 'a', - 'ₑ' => 'e', - 'ₒ' => 'o', - 'ₓ' => 'x', - 'ₔ' => 'ə', - 'ₕ' => 'h', - 'ₖ' => 'k', - 'ₗ' => 'l', - 'ₘ' => 'm', - 'ₙ' => 'n', - 'ₚ' => 'p', - 'ₛ' => 's', - 'ₜ' => 't', - '₨' => 'Rs', - '℀' => 'a/c', - '℁' => 'a/s', - 'ℂ' => 'C', - '℃' => '°C', - '℅' => 'c/o', - '℆' => 'c/u', - 'ℇ' => 'Ɛ', - '℉' => '°F', - 'ℊ' => 'g', - 'ℋ' => 'H', - 'ℌ' => 'H', - 'ℍ' => 'H', - 'ℎ' => 'h', - 'ℏ' => 'ħ', - 'ℐ' => 'I', - 'ℑ' => 'I', - 'ℒ' => 'L', - 'ℓ' => 'l', - 'ℕ' => 'N', - '№' => 'No', - 'ℙ' => 'P', - 'ℚ' => 'Q', - 'ℛ' => 'R', - 'ℜ' => 'R', - 'ℝ' => 'R', - '℠' => 'SM', - '℡' => 'TEL', - '™' => 'TM', - 'ℤ' => 'Z', - 'ℨ' => 'Z', - 'ℬ' => 'B', - 'ℭ' => 'C', - 'ℯ' => 'e', - 'ℰ' => 'E', - 'ℱ' => 'F', - 'ℳ' => 'M', - 'ℴ' => 'o', - 'ℵ' => 'א', - 'ℶ' => 'ב', - 'ℷ' => 'ג', - 'ℸ' => 'ד', - 'ℹ' => 'i', - '℻' => 'FAX', - 'ℼ' => 'π', - 'ℽ' => 'γ', - 'ℾ' => 'Γ', - 'ℿ' => 'Π', - '⅀' => '∑', - 'ⅅ' => 'D', - 'ⅆ' => 'd', - 'ⅇ' => 'e', - 'ⅈ' => 'i', - 'ⅉ' => 'j', - '⅐' => '1⁄7', - '⅑' => '1⁄9', - '⅒' => '1⁄10', - '⅓' => '1⁄3', - '⅔' => '2⁄3', - '⅕' => '1⁄5', - '⅖' => '2⁄5', - '⅗' => '3⁄5', - '⅘' => '4⁄5', - '⅙' => '1⁄6', - '⅚' => '5⁄6', - '⅛' => '1⁄8', - '⅜' => '3⁄8', - '⅝' => '5⁄8', - '⅞' => '7⁄8', - '⅟' => '1⁄', - 'Ⅰ' => 'I', - 'Ⅱ' => 'II', - 'Ⅲ' => 'III', - 'Ⅳ' => 'IV', - 'Ⅴ' => 'V', - 'Ⅵ' => 'VI', - 'Ⅶ' => 'VII', - 'Ⅷ' => 'VIII', - 'Ⅸ' => 'IX', - 'Ⅹ' => 'X', - 'Ⅺ' => 'XI', - 'Ⅻ' => 'XII', - 'Ⅼ' => 'L', - 'Ⅽ' => 'C', - 'Ⅾ' => 'D', - 'Ⅿ' => 'M', - 'ⅰ' => 'i', - 'ⅱ' => 'ii', - 'ⅲ' => 'iii', - 'ⅳ' => 'iv', - 'ⅴ' => 'v', - 'ⅵ' => 'vi', - 'ⅶ' => 'vii', - 'ⅷ' => 'viii', - 'ⅸ' => 'ix', - 'ⅹ' => 'x', - 'ⅺ' => 'xi', - 'ⅻ' => 'xii', - 'ⅼ' => 'l', - 'ⅽ' => 'c', - 'ⅾ' => 'd', - 'ⅿ' => 'm', - '↉' => '0⁄3', - '∬' => '∫∫', - '∭' => '∫∫∫', - '∯' => '∮∮', - '∰' => '∮∮∮', - '①' => '1', - '②' => '2', - '③' => '3', - '④' => '4', - '⑤' => '5', - '⑥' => '6', - '⑦' => '7', - '⑧' => '8', - '⑨' => '9', - '⑩' => '10', - '⑪' => '11', - '⑫' => '12', - '⑬' => '13', - '⑭' => '14', - '⑮' => '15', - '⑯' => '16', - '⑰' => '17', - '⑱' => '18', - '⑲' => '19', - '⑳' => '20', - '⑴' => '(1)', - '⑵' => '(2)', - '⑶' => '(3)', - '⑷' => '(4)', - '⑸' => '(5)', - '⑹' => '(6)', - '⑺' => '(7)', - '⑻' => '(8)', - '⑼' => '(9)', - '⑽' => '(10)', - '⑾' => '(11)', - '⑿' => '(12)', - '⒀' => '(13)', - '⒁' => '(14)', - '⒂' => '(15)', - '⒃' => '(16)', - '⒄' => '(17)', - '⒅' => '(18)', - '⒆' => '(19)', - '⒇' => '(20)', - '⒈' => '1.', - '⒉' => '2.', - '⒊' => '3.', - '⒋' => '4.', - '⒌' => '5.', - '⒍' => '6.', - '⒎' => '7.', - '⒏' => '8.', - '⒐' => '9.', - '⒑' => '10.', - '⒒' => '11.', - '⒓' => '12.', - '⒔' => '13.', - '⒕' => '14.', - '⒖' => '15.', - '⒗' => '16.', - '⒘' => '17.', - '⒙' => '18.', - '⒚' => '19.', - '⒛' => '20.', - '⒜' => '(a)', - '⒝' => '(b)', - '⒞' => '(c)', - '⒟' => '(d)', - '⒠' => '(e)', - '⒡' => '(f)', - '⒢' => '(g)', - '⒣' => '(h)', - '⒤' => '(i)', - '⒥' => '(j)', - '⒦' => '(k)', - '⒧' => '(l)', - '⒨' => '(m)', - '⒩' => '(n)', - '⒪' => '(o)', - '⒫' => '(p)', - '⒬' => '(q)', - '⒭' => '(r)', - '⒮' => '(s)', - '⒯' => '(t)', - '⒰' => '(u)', - '⒱' => '(v)', - '⒲' => '(w)', - '⒳' => '(x)', - '⒴' => '(y)', - '⒵' => '(z)', - 'Ⓐ' => 'A', - 'Ⓑ' => 'B', - 'Ⓒ' => 'C', - 'Ⓓ' => 'D', - 'Ⓔ' => 'E', - 'Ⓕ' => 'F', - 'Ⓖ' => 'G', - 'Ⓗ' => 'H', - 'Ⓘ' => 'I', - 'Ⓙ' => 'J', - 'Ⓚ' => 'K', - 'Ⓛ' => 'L', - 'Ⓜ' => 'M', - 'Ⓝ' => 'N', - 'Ⓞ' => 'O', - 'Ⓟ' => 'P', - 'Ⓠ' => 'Q', - 'Ⓡ' => 'R', - 'Ⓢ' => 'S', - 'Ⓣ' => 'T', - 'Ⓤ' => 'U', - 'Ⓥ' => 'V', - 'Ⓦ' => 'W', - 'Ⓧ' => 'X', - 'Ⓨ' => 'Y', - 'Ⓩ' => 'Z', - 'ⓐ' => 'a', - 'ⓑ' => 'b', - 'ⓒ' => 'c', - 'ⓓ' => 'd', - 'ⓔ' => 'e', - 'ⓕ' => 'f', - 'ⓖ' => 'g', - 'ⓗ' => 'h', - 'ⓘ' => 'i', - 'ⓙ' => 'j', - 'ⓚ' => 'k', - 'ⓛ' => 'l', - 'ⓜ' => 'm', - 'ⓝ' => 'n', - 'ⓞ' => 'o', - 'ⓟ' => 'p', - 'ⓠ' => 'q', - 'ⓡ' => 'r', - 'ⓢ' => 's', - 'ⓣ' => 't', - 'ⓤ' => 'u', - 'ⓥ' => 'v', - 'ⓦ' => 'w', - 'ⓧ' => 'x', - 'ⓨ' => 'y', - 'ⓩ' => 'z', - '⓪' => '0', - '⨌' => '∫∫∫∫', - '⩴' => '::=', - '⩵' => '==', - '⩶' => '===', - 'ⱼ' => 'j', - 'ⱽ' => 'V', - 'ⵯ' => 'ⵡ', - '⺟' => '母', - '⻳' => '龟', - '⼀' => '一', - '⼁' => '丨', - '⼂' => '丶', - '⼃' => '丿', - '⼄' => '乙', - '⼅' => '亅', - '⼆' => '二', - '⼇' => '亠', - '⼈' => '人', - '⼉' => '儿', - '⼊' => '入', - '⼋' => '八', - '⼌' => '冂', - '⼍' => '冖', - '⼎' => '冫', - '⼏' => '几', - '⼐' => '凵', - '⼑' => '刀', - '⼒' => '力', - '⼓' => '勹', - '⼔' => '匕', - '⼕' => '匚', - '⼖' => '匸', - '⼗' => '十', - '⼘' => '卜', - '⼙' => '卩', - '⼚' => '厂', - '⼛' => '厶', - '⼜' => '又', - '⼝' => '口', - '⼞' => '囗', - '⼟' => '土', - '⼠' => '士', - '⼡' => '夂', - '⼢' => '夊', - '⼣' => '夕', - '⼤' => '大', - '⼥' => '女', - '⼦' => '子', - '⼧' => '宀', - '⼨' => '寸', - '⼩' => '小', - '⼪' => '尢', - '⼫' => '尸', - '⼬' => '屮', - '⼭' => '山', - '⼮' => '巛', - '⼯' => '工', - '⼰' => '己', - '⼱' => '巾', - '⼲' => '干', - '⼳' => '幺', - '⼴' => '广', - '⼵' => '廴', - '⼶' => '廾', - '⼷' => '弋', - '⼸' => '弓', - '⼹' => '彐', - '⼺' => '彡', - '⼻' => '彳', - '⼼' => '心', - '⼽' => '戈', - '⼾' => '戶', - '⼿' => '手', - '⽀' => '支', - '⽁' => '攴', - '⽂' => '文', - '⽃' => '斗', - '⽄' => '斤', - '⽅' => '方', - '⽆' => '无', - '⽇' => '日', - '⽈' => '曰', - '⽉' => '月', - '⽊' => '木', - '⽋' => '欠', - '⽌' => '止', - '⽍' => '歹', - '⽎' => '殳', - '⽏' => '毋', - '⽐' => '比', - '⽑' => '毛', - '⽒' => '氏', - '⽓' => '气', - '⽔' => '水', - '⽕' => '火', - '⽖' => '爪', - '⽗' => '父', - '⽘' => '爻', - '⽙' => '爿', - '⽚' => '片', - '⽛' => '牙', - '⽜' => '牛', - '⽝' => '犬', - '⽞' => '玄', - '⽟' => '玉', - '⽠' => '瓜', - '⽡' => '瓦', - '⽢' => '甘', - '⽣' => '生', - '⽤' => '用', - '⽥' => '田', - '⽦' => '疋', - '⽧' => '疒', - '⽨' => '癶', - '⽩' => '白', - '⽪' => '皮', - '⽫' => '皿', - '⽬' => '目', - '⽭' => '矛', - '⽮' => '矢', - '⽯' => '石', - '⽰' => '示', - '⽱' => '禸', - '⽲' => '禾', - '⽳' => '穴', - '⽴' => '立', - '⽵' => '竹', - '⽶' => '米', - '⽷' => '糸', - '⽸' => '缶', - '⽹' => '网', - '⽺' => '羊', - '⽻' => '羽', - '⽼' => '老', - '⽽' => '而', - '⽾' => '耒', - '⽿' => '耳', - '⾀' => '聿', - '⾁' => '肉', - '⾂' => '臣', - '⾃' => '自', - '⾄' => '至', - '⾅' => '臼', - '⾆' => '舌', - '⾇' => '舛', - '⾈' => '舟', - '⾉' => '艮', - '⾊' => '色', - '⾋' => '艸', - '⾌' => '虍', - '⾍' => '虫', - '⾎' => '血', - '⾏' => '行', - '⾐' => '衣', - '⾑' => '襾', - '⾒' => '見', - '⾓' => '角', - '⾔' => '言', - '⾕' => '谷', - '⾖' => '豆', - '⾗' => '豕', - '⾘' => '豸', - '⾙' => '貝', - '⾚' => '赤', - '⾛' => '走', - '⾜' => '足', - '⾝' => '身', - '⾞' => '車', - '⾟' => '辛', - '⾠' => '辰', - '⾡' => '辵', - '⾢' => '邑', - '⾣' => '酉', - '⾤' => '釆', - '⾥' => '里', - '⾦' => '金', - '⾧' => '長', - '⾨' => '門', - '⾩' => '阜', - '⾪' => '隶', - '⾫' => '隹', - '⾬' => '雨', - '⾭' => '靑', - '⾮' => '非', - '⾯' => '面', - '⾰' => '革', - '⾱' => '韋', - '⾲' => '韭', - '⾳' => '音', - '⾴' => '頁', - '⾵' => '風', - '⾶' => '飛', - '⾷' => '食', - '⾸' => '首', - '⾹' => '香', - '⾺' => '馬', - '⾻' => '骨', - '⾼' => '高', - '⾽' => '髟', - '⾾' => '鬥', - '⾿' => '鬯', - '⿀' => '鬲', - '⿁' => '鬼', - '⿂' => '魚', - '⿃' => '鳥', - '⿄' => '鹵', - '⿅' => '鹿', - '⿆' => '麥', - '⿇' => '麻', - '⿈' => '黃', - '⿉' => '黍', - '⿊' => '黑', - '⿋' => '黹', - '⿌' => '黽', - '⿍' => '鼎', - '⿎' => '鼓', - '⿏' => '鼠', - '⿐' => '鼻', - '⿑' => '齊', - '⿒' => '齒', - '⿓' => '龍', - '⿔' => '龜', - '⿕' => '龠', - ' ' => ' ', - '〶' => '〒', - '〸' => '十', - '〹' => '卄', - '〺' => '卅', - '゛' => ' ゙', - '゜' => ' ゚', - 'ゟ' => 'より', - 'ヿ' => 'コト', - 'ㄱ' => 'ᄀ', - 'ㄲ' => 'ᄁ', - 'ㄳ' => 'ᆪ', - 'ㄴ' => 'ᄂ', - 'ㄵ' => 'ᆬ', - 'ㄶ' => 'ᆭ', - 'ㄷ' => 'ᄃ', - 'ㄸ' => 'ᄄ', - 'ㄹ' => 'ᄅ', - 'ㄺ' => 'ᆰ', - 'ㄻ' => 'ᆱ', - 'ㄼ' => 'ᆲ', - 'ㄽ' => 'ᆳ', - 'ㄾ' => 'ᆴ', - 'ㄿ' => 'ᆵ', - 'ㅀ' => 'ᄚ', - 'ㅁ' => 'ᄆ', - 'ㅂ' => 'ᄇ', - 'ㅃ' => 'ᄈ', - 'ㅄ' => 'ᄡ', - 'ㅅ' => 'ᄉ', - 'ㅆ' => 'ᄊ', - 'ㅇ' => 'ᄋ', - 'ㅈ' => 'ᄌ', - 'ㅉ' => 'ᄍ', - 'ㅊ' => 'ᄎ', - 'ㅋ' => 'ᄏ', - 'ㅌ' => 'ᄐ', - 'ㅍ' => 'ᄑ', - 'ㅎ' => 'ᄒ', - 'ㅏ' => 'ᅡ', - 'ㅐ' => 'ᅢ', - 'ㅑ' => 'ᅣ', - 'ㅒ' => 'ᅤ', - 'ㅓ' => 'ᅥ', - 'ㅔ' => 'ᅦ', - 'ㅕ' => 'ᅧ', - 'ㅖ' => 'ᅨ', - 'ㅗ' => 'ᅩ', - 'ㅘ' => 'ᅪ', - 'ㅙ' => 'ᅫ', - 'ㅚ' => 'ᅬ', - 'ㅛ' => 'ᅭ', - 'ㅜ' => 'ᅮ', - 'ㅝ' => 'ᅯ', - 'ㅞ' => 'ᅰ', - 'ㅟ' => 'ᅱ', - 'ㅠ' => 'ᅲ', - 'ㅡ' => 'ᅳ', - 'ㅢ' => 'ᅴ', - 'ㅣ' => 'ᅵ', - 'ㅤ' => 'ᅠ', - 'ㅥ' => 'ᄔ', - 'ㅦ' => 'ᄕ', - 'ㅧ' => 'ᇇ', - 'ㅨ' => 'ᇈ', - 'ㅩ' => 'ᇌ', - 'ㅪ' => 'ᇎ', - 'ㅫ' => 'ᇓ', - 'ㅬ' => 'ᇗ', - 'ㅭ' => 'ᇙ', - 'ㅮ' => 'ᄜ', - 'ㅯ' => 'ᇝ', - 'ㅰ' => 'ᇟ', - 'ㅱ' => 'ᄝ', - 'ㅲ' => 'ᄞ', - 'ㅳ' => 'ᄠ', - 'ㅴ' => 'ᄢ', - 'ㅵ' => 'ᄣ', - 'ㅶ' => 'ᄧ', - 'ㅷ' => 'ᄩ', - 'ㅸ' => 'ᄫ', - 'ㅹ' => 'ᄬ', - 'ㅺ' => 'ᄭ', - 'ㅻ' => 'ᄮ', - 'ㅼ' => 'ᄯ', - 'ㅽ' => 'ᄲ', - 'ㅾ' => 'ᄶ', - 'ㅿ' => 'ᅀ', - 'ㆀ' => 'ᅇ', - 'ㆁ' => 'ᅌ', - 'ㆂ' => 'ᇱ', - 'ㆃ' => 'ᇲ', - 'ㆄ' => 'ᅗ', - 'ㆅ' => 'ᅘ', - 'ㆆ' => 'ᅙ', - 'ㆇ' => 'ᆄ', - 'ㆈ' => 'ᆅ', - 'ㆉ' => 'ᆈ', - 'ㆊ' => 'ᆑ', - 'ㆋ' => 'ᆒ', - 'ㆌ' => 'ᆔ', - 'ㆍ' => 'ᆞ', - 'ㆎ' => 'ᆡ', - '㆒' => '一', - '㆓' => '二', - '㆔' => '三', - '㆕' => '四', - '㆖' => '上', - '㆗' => '中', - '㆘' => '下', - '㆙' => '甲', - '㆚' => '乙', - '㆛' => '丙', - '㆜' => '丁', - '㆝' => '天', - '㆞' => '地', - '㆟' => '人', - '㈀' => '(ᄀ)', - '㈁' => '(ᄂ)', - '㈂' => '(ᄃ)', - '㈃' => '(ᄅ)', - '㈄' => '(ᄆ)', - '㈅' => '(ᄇ)', - '㈆' => '(ᄉ)', - '㈇' => '(ᄋ)', - '㈈' => '(ᄌ)', - '㈉' => '(ᄎ)', - '㈊' => '(ᄏ)', - '㈋' => '(ᄐ)', - '㈌' => '(ᄑ)', - '㈍' => '(ᄒ)', - '㈎' => '(가)', - '㈏' => '(나)', - '㈐' => '(다)', - '㈑' => '(라)', - '㈒' => '(마)', - '㈓' => '(바)', - '㈔' => '(사)', - '㈕' => '(아)', - '㈖' => '(자)', - '㈗' => '(차)', - '㈘' => '(카)', - '㈙' => '(타)', - '㈚' => '(파)', - '㈛' => '(하)', - '㈜' => '(주)', - '㈝' => '(오전)', - '㈞' => '(오후)', - '㈠' => '(一)', - '㈡' => '(二)', - '㈢' => '(三)', - '㈣' => '(四)', - '㈤' => '(五)', - '㈥' => '(六)', - '㈦' => '(七)', - '㈧' => '(八)', - '㈨' => '(九)', - '㈩' => '(十)', - '㈪' => '(月)', - '㈫' => '(火)', - '㈬' => '(水)', - '㈭' => '(木)', - '㈮' => '(金)', - '㈯' => '(土)', - '㈰' => '(日)', - '㈱' => '(株)', - '㈲' => '(有)', - '㈳' => '(社)', - '㈴' => '(名)', - '㈵' => '(特)', - '㈶' => '(財)', - '㈷' => '(祝)', - '㈸' => '(労)', - '㈹' => '(代)', - '㈺' => '(呼)', - '㈻' => '(学)', - '㈼' => '(監)', - '㈽' => '(企)', - '㈾' => '(資)', - '㈿' => '(協)', - '㉀' => '(祭)', - '㉁' => '(休)', - '㉂' => '(自)', - '㉃' => '(至)', - '㉄' => '問', - '㉅' => '幼', - '㉆' => '文', - '㉇' => '箏', - '㉐' => 'PTE', - '㉑' => '21', - '㉒' => '22', - '㉓' => '23', - '㉔' => '24', - '㉕' => '25', - '㉖' => '26', - '㉗' => '27', - '㉘' => '28', - '㉙' => '29', - '㉚' => '30', - '㉛' => '31', - '㉜' => '32', - '㉝' => '33', - '㉞' => '34', - '㉟' => '35', - '㉠' => 'ᄀ', - '㉡' => 'ᄂ', - '㉢' => 'ᄃ', - '㉣' => 'ᄅ', - '㉤' => 'ᄆ', - '㉥' => 'ᄇ', - '㉦' => 'ᄉ', - '㉧' => 'ᄋ', - '㉨' => 'ᄌ', - '㉩' => 'ᄎ', - '㉪' => 'ᄏ', - '㉫' => 'ᄐ', - '㉬' => 'ᄑ', - '㉭' => 'ᄒ', - '㉮' => '가', - '㉯' => '나', - '㉰' => '다', - '㉱' => '라', - '㉲' => '마', - '㉳' => '바', - '㉴' => '사', - '㉵' => '아', - '㉶' => '자', - '㉷' => '차', - '㉸' => '카', - '㉹' => '타', - '㉺' => '파', - '㉻' => '하', - '㉼' => '참고', - '㉽' => '주의', - '㉾' => '우', - '㊀' => '一', - '㊁' => '二', - '㊂' => '三', - '㊃' => '四', - '㊄' => '五', - '㊅' => '六', - '㊆' => '七', - '㊇' => '八', - '㊈' => '九', - '㊉' => '十', - '㊊' => '月', - '㊋' => '火', - '㊌' => '水', - '㊍' => '木', - '㊎' => '金', - '㊏' => '土', - '㊐' => '日', - '㊑' => '株', - '㊒' => '有', - '㊓' => '社', - '㊔' => '名', - '㊕' => '特', - '㊖' => '財', - '㊗' => '祝', - '㊘' => '労', - '㊙' => '秘', - '㊚' => '男', - '㊛' => '女', - '㊜' => '適', - '㊝' => '優', - '㊞' => '印', - '㊟' => '注', - '㊠' => '項', - '㊡' => '休', - '㊢' => '写', - '㊣' => '正', - '㊤' => '上', - '㊥' => '中', - '㊦' => '下', - '㊧' => '左', - '㊨' => '右', - '㊩' => '医', - '㊪' => '宗', - '㊫' => '学', - '㊬' => '監', - '㊭' => '企', - '㊮' => '資', - '㊯' => '協', - '㊰' => '夜', - '㊱' => '36', - '㊲' => '37', - '㊳' => '38', - '㊴' => '39', - '㊵' => '40', - '㊶' => '41', - '㊷' => '42', - '㊸' => '43', - '㊹' => '44', - '㊺' => '45', - '㊻' => '46', - '㊼' => '47', - '㊽' => '48', - '㊾' => '49', - '㊿' => '50', - '㋀' => '1月', - '㋁' => '2月', - '㋂' => '3月', - '㋃' => '4月', - '㋄' => '5月', - '㋅' => '6月', - '㋆' => '7月', - '㋇' => '8月', - '㋈' => '9月', - '㋉' => '10月', - '㋊' => '11月', - '㋋' => '12月', - '㋌' => 'Hg', - '㋍' => 'erg', - '㋎' => 'eV', - '㋏' => 'LTD', - '㋐' => 'ア', - '㋑' => 'イ', - '㋒' => 'ウ', - '㋓' => 'エ', - '㋔' => 'オ', - '㋕' => 'カ', - '㋖' => 'キ', - '㋗' => 'ク', - '㋘' => 'ケ', - '㋙' => 'コ', - '㋚' => 'サ', - '㋛' => 'シ', - '㋜' => 'ス', - '㋝' => 'セ', - '㋞' => 'ソ', - '㋟' => 'タ', - '㋠' => 'チ', - '㋡' => 'ツ', - '㋢' => 'テ', - '㋣' => 'ト', - '㋤' => 'ナ', - '㋥' => 'ニ', - '㋦' => 'ヌ', - '㋧' => 'ネ', - '㋨' => 'ノ', - '㋩' => 'ハ', - '㋪' => 'ヒ', - '㋫' => 'フ', - '㋬' => 'ヘ', - '㋭' => 'ホ', - '㋮' => 'マ', - '㋯' => 'ミ', - '㋰' => 'ム', - '㋱' => 'メ', - '㋲' => 'モ', - '㋳' => 'ヤ', - '㋴' => 'ユ', - '㋵' => 'ヨ', - '㋶' => 'ラ', - '㋷' => 'リ', - '㋸' => 'ル', - '㋹' => 'レ', - '㋺' => 'ロ', - '㋻' => 'ワ', - '㋼' => 'ヰ', - '㋽' => 'ヱ', - '㋾' => 'ヲ', - '㋿' => '令和', - '㌀' => 'アパート', - '㌁' => 'アルファ', - '㌂' => 'アンペア', - '㌃' => 'アール', - '㌄' => 'イニング', - '㌅' => 'インチ', - '㌆' => 'ウォン', - '㌇' => 'エスクード', - '㌈' => 'エーカー', - '㌉' => 'オンス', - '㌊' => 'オーム', - '㌋' => 'カイリ', - '㌌' => 'カラット', - '㌍' => 'カロリー', - '㌎' => 'ガロン', - '㌏' => 'ガンマ', - '㌐' => 'ギガ', - '㌑' => 'ギニー', - '㌒' => 'キュリー', - '㌓' => 'ギルダー', - '㌔' => 'キロ', - '㌕' => 'キログラム', - '㌖' => 'キロメートル', - '㌗' => 'キロワット', - '㌘' => 'グラム', - '㌙' => 'グラムトン', - '㌚' => 'クルゼイロ', - '㌛' => 'クローネ', - '㌜' => 'ケース', - '㌝' => 'コルナ', - '㌞' => 'コーポ', - '㌟' => 'サイクル', - '㌠' => 'サンチーム', - '㌡' => 'シリング', - '㌢' => 'センチ', - '㌣' => 'セント', - '㌤' => 'ダース', - '㌥' => 'デシ', - '㌦' => 'ドル', - '㌧' => 'トン', - '㌨' => 'ナノ', - '㌩' => 'ノット', - '㌪' => 'ハイツ', - '㌫' => 'パーセント', - '㌬' => 'パーツ', - '㌭' => 'バーレル', - '㌮' => 'ピアストル', - '㌯' => 'ピクル', - '㌰' => 'ピコ', - '㌱' => 'ビル', - '㌲' => 'ファラッド', - '㌳' => 'フィート', - '㌴' => 'ブッシェル', - '㌵' => 'フラン', - '㌶' => 'ヘクタール', - '㌷' => 'ペソ', - '㌸' => 'ペニヒ', - '㌹' => 'ヘルツ', - '㌺' => 'ペンス', - '㌻' => 'ページ', - '㌼' => 'ベータ', - '㌽' => 'ポイント', - '㌾' => 'ボルト', - '㌿' => 'ホン', - '㍀' => 'ポンド', - '㍁' => 'ホール', - '㍂' => 'ホーン', - '㍃' => 'マイクロ', - '㍄' => 'マイル', - '㍅' => 'マッハ', - '㍆' => 'マルク', - '㍇' => 'マンション', - '㍈' => 'ミクロン', - '㍉' => 'ミリ', - '㍊' => 'ミリバール', - '㍋' => 'メガ', - '㍌' => 'メガトン', - '㍍' => 'メートル', - '㍎' => 'ヤード', - '㍏' => 'ヤール', - '㍐' => 'ユアン', - '㍑' => 'リットル', - '㍒' => 'リラ', - '㍓' => 'ルピー', - '㍔' => 'ルーブル', - '㍕' => 'レム', - '㍖' => 'レントゲン', - '㍗' => 'ワット', - '㍘' => '0点', - '㍙' => '1点', - '㍚' => '2点', - '㍛' => '3点', - '㍜' => '4点', - '㍝' => '5点', - '㍞' => '6点', - '㍟' => '7点', - '㍠' => '8点', - '㍡' => '9点', - '㍢' => '10点', - '㍣' => '11点', - '㍤' => '12点', - '㍥' => '13点', - '㍦' => '14点', - '㍧' => '15点', - '㍨' => '16点', - '㍩' => '17点', - '㍪' => '18点', - '㍫' => '19点', - '㍬' => '20点', - '㍭' => '21点', - '㍮' => '22点', - '㍯' => '23点', - '㍰' => '24点', - '㍱' => 'hPa', - '㍲' => 'da', - '㍳' => 'AU', - '㍴' => 'bar', - '㍵' => 'oV', - '㍶' => 'pc', - '㍷' => 'dm', - '㍸' => 'dm2', - '㍹' => 'dm3', - '㍺' => 'IU', - '㍻' => '平成', - '㍼' => '昭和', - '㍽' => '大正', - '㍾' => '明治', - '㍿' => '株式会社', - '㎀' => 'pA', - '㎁' => 'nA', - '㎂' => 'μA', - '㎃' => 'mA', - '㎄' => 'kA', - '㎅' => 'KB', - '㎆' => 'MB', - '㎇' => 'GB', - '㎈' => 'cal', - '㎉' => 'kcal', - '㎊' => 'pF', - '㎋' => 'nF', - '㎌' => 'μF', - '㎍' => 'μg', - '㎎' => 'mg', - '㎏' => 'kg', - '㎐' => 'Hz', - '㎑' => 'kHz', - '㎒' => 'MHz', - '㎓' => 'GHz', - '㎔' => 'THz', - '㎕' => 'μl', - '㎖' => 'ml', - '㎗' => 'dl', - '㎘' => 'kl', - '㎙' => 'fm', - '㎚' => 'nm', - '㎛' => 'μm', - '㎜' => 'mm', - '㎝' => 'cm', - '㎞' => 'km', - '㎟' => 'mm2', - '㎠' => 'cm2', - '㎡' => 'm2', - '㎢' => 'km2', - '㎣' => 'mm3', - '㎤' => 'cm3', - '㎥' => 'm3', - '㎦' => 'km3', - '㎧' => 'm∕s', - '㎨' => 'm∕s2', - '㎩' => 'Pa', - '㎪' => 'kPa', - '㎫' => 'MPa', - '㎬' => 'GPa', - '㎭' => 'rad', - '㎮' => 'rad∕s', - '㎯' => 'rad∕s2', - '㎰' => 'ps', - '㎱' => 'ns', - '㎲' => 'μs', - '㎳' => 'ms', - '㎴' => 'pV', - '㎵' => 'nV', - '㎶' => 'μV', - '㎷' => 'mV', - '㎸' => 'kV', - '㎹' => 'MV', - '㎺' => 'pW', - '㎻' => 'nW', - '㎼' => 'μW', - '㎽' => 'mW', - '㎾' => 'kW', - '㎿' => 'MW', - '㏀' => 'kΩ', - '㏁' => 'MΩ', - '㏂' => 'a.m.', - '㏃' => 'Bq', - '㏄' => 'cc', - '㏅' => 'cd', - '㏆' => 'C∕kg', - '㏇' => 'Co.', - '㏈' => 'dB', - '㏉' => 'Gy', - '㏊' => 'ha', - '㏋' => 'HP', - '㏌' => 'in', - '㏍' => 'KK', - '㏎' => 'KM', - '㏏' => 'kt', - '㏐' => 'lm', - '㏑' => 'ln', - '㏒' => 'log', - '㏓' => 'lx', - '㏔' => 'mb', - '㏕' => 'mil', - '㏖' => 'mol', - '㏗' => 'PH', - '㏘' => 'p.m.', - '㏙' => 'PPM', - '㏚' => 'PR', - '㏛' => 'sr', - '㏜' => 'Sv', - '㏝' => 'Wb', - '㏞' => 'V∕m', - '㏟' => 'A∕m', - '㏠' => '1日', - '㏡' => '2日', - '㏢' => '3日', - '㏣' => '4日', - '㏤' => '5日', - '㏥' => '6日', - '㏦' => '7日', - '㏧' => '8日', - '㏨' => '9日', - '㏩' => '10日', - '㏪' => '11日', - '㏫' => '12日', - '㏬' => '13日', - '㏭' => '14日', - '㏮' => '15日', - '㏯' => '16日', - '㏰' => '17日', - '㏱' => '18日', - '㏲' => '19日', - '㏳' => '20日', - '㏴' => '21日', - '㏵' => '22日', - '㏶' => '23日', - '㏷' => '24日', - '㏸' => '25日', - '㏹' => '26日', - '㏺' => '27日', - '㏻' => '28日', - '㏼' => '29日', - '㏽' => '30日', - '㏾' => '31日', - '㏿' => 'gal', - 'ꚜ' => 'ъ', - 'ꚝ' => 'ь', - 'ꝰ' => 'ꝯ', - 'ꟸ' => 'Ħ', - 'ꟹ' => 'œ', - 'ꭜ' => 'ꜧ', - 'ꭝ' => 'ꬷ', - 'ꭞ' => 'ɫ', - 'ꭟ' => 'ꭒ', - 'ꭩ' => 'ʍ', - 'ff' => 'ff', - 'fi' => 'fi', - 'fl' => 'fl', - 'ffi' => 'ffi', - 'ffl' => 'ffl', - 'ſt' => 'st', - 'st' => 'st', - 'ﬓ' => 'մն', - 'ﬔ' => 'մե', - 'ﬕ' => 'մի', - 'ﬖ' => 'վն', - 'ﬗ' => 'մխ', - 'ﬠ' => 'ע', - 'ﬡ' => 'א', - 'ﬢ' => 'ד', - 'ﬣ' => 'ה', - 'ﬤ' => 'כ', - 'ﬥ' => 'ל', - 'ﬦ' => 'ם', - 'ﬧ' => 'ר', - 'ﬨ' => 'ת', - '﬩' => '+', - 'ﭏ' => 'אל', - 'ﭐ' => 'ٱ', - 'ﭑ' => 'ٱ', - 'ﭒ' => 'ٻ', - 'ﭓ' => 'ٻ', - 'ﭔ' => 'ٻ', - 'ﭕ' => 'ٻ', - 'ﭖ' => 'پ', - 'ﭗ' => 'پ', - 'ﭘ' => 'پ', - 'ﭙ' => 'پ', - 'ﭚ' => 'ڀ', - 'ﭛ' => 'ڀ', - 'ﭜ' => 'ڀ', - 'ﭝ' => 'ڀ', - 'ﭞ' => 'ٺ', - 'ﭟ' => 'ٺ', - 'ﭠ' => 'ٺ', - 'ﭡ' => 'ٺ', - 'ﭢ' => 'ٿ', - 'ﭣ' => 'ٿ', - 'ﭤ' => 'ٿ', - 'ﭥ' => 'ٿ', - 'ﭦ' => 'ٹ', - 'ﭧ' => 'ٹ', - 'ﭨ' => 'ٹ', - 'ﭩ' => 'ٹ', - 'ﭪ' => 'ڤ', - 'ﭫ' => 'ڤ', - 'ﭬ' => 'ڤ', - 'ﭭ' => 'ڤ', - 'ﭮ' => 'ڦ', - 'ﭯ' => 'ڦ', - 'ﭰ' => 'ڦ', - 'ﭱ' => 'ڦ', - 'ﭲ' => 'ڄ', - 'ﭳ' => 'ڄ', - 'ﭴ' => 'ڄ', - 'ﭵ' => 'ڄ', - 'ﭶ' => 'ڃ', - 'ﭷ' => 'ڃ', - 'ﭸ' => 'ڃ', - 'ﭹ' => 'ڃ', - 'ﭺ' => 'چ', - 'ﭻ' => 'چ', - 'ﭼ' => 'چ', - 'ﭽ' => 'چ', - 'ﭾ' => 'ڇ', - 'ﭿ' => 'ڇ', - 'ﮀ' => 'ڇ', - 'ﮁ' => 'ڇ', - 'ﮂ' => 'ڍ', - 'ﮃ' => 'ڍ', - 'ﮄ' => 'ڌ', - 'ﮅ' => 'ڌ', - 'ﮆ' => 'ڎ', - 'ﮇ' => 'ڎ', - 'ﮈ' => 'ڈ', - 'ﮉ' => 'ڈ', - 'ﮊ' => 'ژ', - 'ﮋ' => 'ژ', - 'ﮌ' => 'ڑ', - 'ﮍ' => 'ڑ', - 'ﮎ' => 'ک', - 'ﮏ' => 'ک', - 'ﮐ' => 'ک', - 'ﮑ' => 'ک', - 'ﮒ' => 'گ', - 'ﮓ' => 'گ', - 'ﮔ' => 'گ', - 'ﮕ' => 'گ', - 'ﮖ' => 'ڳ', - 'ﮗ' => 'ڳ', - 'ﮘ' => 'ڳ', - 'ﮙ' => 'ڳ', - 'ﮚ' => 'ڱ', - 'ﮛ' => 'ڱ', - 'ﮜ' => 'ڱ', - 'ﮝ' => 'ڱ', - 'ﮞ' => 'ں', - 'ﮟ' => 'ں', - 'ﮠ' => 'ڻ', - 'ﮡ' => 'ڻ', - 'ﮢ' => 'ڻ', - 'ﮣ' => 'ڻ', - 'ﮤ' => 'ۀ', - 'ﮥ' => 'ۀ', - 'ﮦ' => 'ہ', - 'ﮧ' => 'ہ', - 'ﮨ' => 'ہ', - 'ﮩ' => 'ہ', - 'ﮪ' => 'ھ', - 'ﮫ' => 'ھ', - 'ﮬ' => 'ھ', - 'ﮭ' => 'ھ', - 'ﮮ' => 'ے', - 'ﮯ' => 'ے', - 'ﮰ' => 'ۓ', - 'ﮱ' => 'ۓ', - 'ﯓ' => 'ڭ', - 'ﯔ' => 'ڭ', - 'ﯕ' => 'ڭ', - 'ﯖ' => 'ڭ', - 'ﯗ' => 'ۇ', - 'ﯘ' => 'ۇ', - 'ﯙ' => 'ۆ', - 'ﯚ' => 'ۆ', - 'ﯛ' => 'ۈ', - 'ﯜ' => 'ۈ', - 'ﯝ' => 'ۇٴ', - 'ﯞ' => 'ۋ', - 'ﯟ' => 'ۋ', - 'ﯠ' => 'ۅ', - 'ﯡ' => 'ۅ', - 'ﯢ' => 'ۉ', - 'ﯣ' => 'ۉ', - 'ﯤ' => 'ې', - 'ﯥ' => 'ې', - 'ﯦ' => 'ې', - 'ﯧ' => 'ې', - 'ﯨ' => 'ى', - 'ﯩ' => 'ى', - 'ﯪ' => 'ئا', - 'ﯫ' => 'ئا', - 'ﯬ' => 'ئە', - 'ﯭ' => 'ئە', - 'ﯮ' => 'ئو', - 'ﯯ' => 'ئو', - 'ﯰ' => 'ئۇ', - 'ﯱ' => 'ئۇ', - 'ﯲ' => 'ئۆ', - 'ﯳ' => 'ئۆ', - 'ﯴ' => 'ئۈ', - 'ﯵ' => 'ئۈ', - 'ﯶ' => 'ئې', - 'ﯷ' => 'ئې', - 'ﯸ' => 'ئې', - 'ﯹ' => 'ئى', - 'ﯺ' => 'ئى', - 'ﯻ' => 'ئى', - 'ﯼ' => 'ی', - 'ﯽ' => 'ی', - 'ﯾ' => 'ی', - 'ﯿ' => 'ی', - 'ﰀ' => 'ئج', - 'ﰁ' => 'ئح', - 'ﰂ' => 'ئم', - 'ﰃ' => 'ئى', - 'ﰄ' => 'ئي', - 'ﰅ' => 'بج', - 'ﰆ' => 'بح', - 'ﰇ' => 'بخ', - 'ﰈ' => 'بم', - 'ﰉ' => 'بى', - 'ﰊ' => 'بي', - 'ﰋ' => 'تج', - 'ﰌ' => 'تح', - 'ﰍ' => 'تخ', - 'ﰎ' => 'تم', - 'ﰏ' => 'تى', - 'ﰐ' => 'تي', - 'ﰑ' => 'ثج', - 'ﰒ' => 'ثم', - 'ﰓ' => 'ثى', - 'ﰔ' => 'ثي', - 'ﰕ' => 'جح', - 'ﰖ' => 'جم', - 'ﰗ' => 'حج', - 'ﰘ' => 'حم', - 'ﰙ' => 'خج', - 'ﰚ' => 'خح', - 'ﰛ' => 'خم', - 'ﰜ' => 'سج', - 'ﰝ' => 'سح', - 'ﰞ' => 'سخ', - 'ﰟ' => 'سم', - 'ﰠ' => 'صح', - 'ﰡ' => 'صم', - 'ﰢ' => 'ضج', - 'ﰣ' => 'ضح', - 'ﰤ' => 'ضخ', - 'ﰥ' => 'ضم', - 'ﰦ' => 'طح', - 'ﰧ' => 'طم', - 'ﰨ' => 'ظم', - 'ﰩ' => 'عج', - 'ﰪ' => 'عم', - 'ﰫ' => 'غج', - 'ﰬ' => 'غم', - 'ﰭ' => 'فج', - 'ﰮ' => 'فح', - 'ﰯ' => 'فخ', - 'ﰰ' => 'فم', - 'ﰱ' => 'فى', - 'ﰲ' => 'في', - 'ﰳ' => 'قح', - 'ﰴ' => 'قم', - 'ﰵ' => 'قى', - 'ﰶ' => 'قي', - 'ﰷ' => 'كا', - 'ﰸ' => 'كج', - 'ﰹ' => 'كح', - 'ﰺ' => 'كخ', - 'ﰻ' => 'كل', - 'ﰼ' => 'كم', - 'ﰽ' => 'كى', - 'ﰾ' => 'كي', - 'ﰿ' => 'لج', - 'ﱀ' => 'لح', - 'ﱁ' => 'لخ', - 'ﱂ' => 'لم', - 'ﱃ' => 'لى', - 'ﱄ' => 'لي', - 'ﱅ' => 'مج', - 'ﱆ' => 'مح', - 'ﱇ' => 'مخ', - 'ﱈ' => 'مم', - 'ﱉ' => 'مى', - 'ﱊ' => 'مي', - 'ﱋ' => 'نج', - 'ﱌ' => 'نح', - 'ﱍ' => 'نخ', - 'ﱎ' => 'نم', - 'ﱏ' => 'نى', - 'ﱐ' => 'ني', - 'ﱑ' => 'هج', - 'ﱒ' => 'هم', - 'ﱓ' => 'هى', - 'ﱔ' => 'هي', - 'ﱕ' => 'يج', - 'ﱖ' => 'يح', - 'ﱗ' => 'يخ', - 'ﱘ' => 'يم', - 'ﱙ' => 'يى', - 'ﱚ' => 'يي', - 'ﱛ' => 'ذٰ', - 'ﱜ' => 'رٰ', - 'ﱝ' => 'ىٰ', - 'ﱞ' => ' ٌّ', - 'ﱟ' => ' ٍّ', - 'ﱠ' => ' َّ', - 'ﱡ' => ' ُّ', - 'ﱢ' => ' ِّ', - 'ﱣ' => ' ّٰ', - 'ﱤ' => 'ئر', - 'ﱥ' => 'ئز', - 'ﱦ' => 'ئم', - 'ﱧ' => 'ئن', - 'ﱨ' => 'ئى', - 'ﱩ' => 'ئي', - 'ﱪ' => 'بر', - 'ﱫ' => 'بز', - 'ﱬ' => 'بم', - 'ﱭ' => 'بن', - 'ﱮ' => 'بى', - 'ﱯ' => 'بي', - 'ﱰ' => 'تر', - 'ﱱ' => 'تز', - 'ﱲ' => 'تم', - 'ﱳ' => 'تن', - 'ﱴ' => 'تى', - 'ﱵ' => 'تي', - 'ﱶ' => 'ثر', - 'ﱷ' => 'ثز', - 'ﱸ' => 'ثم', - 'ﱹ' => 'ثن', - 'ﱺ' => 'ثى', - 'ﱻ' => 'ثي', - 'ﱼ' => 'فى', - 'ﱽ' => 'في', - 'ﱾ' => 'قى', - 'ﱿ' => 'قي', - 'ﲀ' => 'كا', - 'ﲁ' => 'كل', - 'ﲂ' => 'كم', - 'ﲃ' => 'كى', - 'ﲄ' => 'كي', - 'ﲅ' => 'لم', - 'ﲆ' => 'لى', - 'ﲇ' => 'لي', - 'ﲈ' => 'ما', - 'ﲉ' => 'مم', - 'ﲊ' => 'نر', - 'ﲋ' => 'نز', - 'ﲌ' => 'نم', - 'ﲍ' => 'نن', - 'ﲎ' => 'نى', - 'ﲏ' => 'ني', - 'ﲐ' => 'ىٰ', - 'ﲑ' => 'ير', - 'ﲒ' => 'يز', - 'ﲓ' => 'يم', - 'ﲔ' => 'ين', - 'ﲕ' => 'يى', - 'ﲖ' => 'يي', - 'ﲗ' => 'ئج', - 'ﲘ' => 'ئح', - 'ﲙ' => 'ئخ', - 'ﲚ' => 'ئم', - 'ﲛ' => 'ئه', - 'ﲜ' => 'بج', - 'ﲝ' => 'بح', - 'ﲞ' => 'بخ', - 'ﲟ' => 'بم', - 'ﲠ' => 'به', - 'ﲡ' => 'تج', - 'ﲢ' => 'تح', - 'ﲣ' => 'تخ', - 'ﲤ' => 'تم', - 'ﲥ' => 'ته', - 'ﲦ' => 'ثم', - 'ﲧ' => 'جح', - 'ﲨ' => 'جم', - 'ﲩ' => 'حج', - 'ﲪ' => 'حم', - 'ﲫ' => 'خج', - 'ﲬ' => 'خم', - 'ﲭ' => 'سج', - 'ﲮ' => 'سح', - 'ﲯ' => 'سخ', - 'ﲰ' => 'سم', - 'ﲱ' => 'صح', - 'ﲲ' => 'صخ', - 'ﲳ' => 'صم', - 'ﲴ' => 'ضج', - 'ﲵ' => 'ضح', - 'ﲶ' => 'ضخ', - 'ﲷ' => 'ضم', - 'ﲸ' => 'طح', - 'ﲹ' => 'ظم', - 'ﲺ' => 'عج', - 'ﲻ' => 'عم', - 'ﲼ' => 'غج', - 'ﲽ' => 'غم', - 'ﲾ' => 'فج', - 'ﲿ' => 'فح', - 'ﳀ' => 'فخ', - 'ﳁ' => 'فم', - 'ﳂ' => 'قح', - 'ﳃ' => 'قم', - 'ﳄ' => 'كج', - 'ﳅ' => 'كح', - 'ﳆ' => 'كخ', - 'ﳇ' => 'كل', - 'ﳈ' => 'كم', - 'ﳉ' => 'لج', - 'ﳊ' => 'لح', - 'ﳋ' => 'لخ', - 'ﳌ' => 'لم', - 'ﳍ' => 'له', - 'ﳎ' => 'مج', - 'ﳏ' => 'مح', - 'ﳐ' => 'مخ', - 'ﳑ' => 'مم', - 'ﳒ' => 'نج', - 'ﳓ' => 'نح', - 'ﳔ' => 'نخ', - 'ﳕ' => 'نم', - 'ﳖ' => 'نه', - 'ﳗ' => 'هج', - 'ﳘ' => 'هم', - 'ﳙ' => 'هٰ', - 'ﳚ' => 'يج', - 'ﳛ' => 'يح', - 'ﳜ' => 'يخ', - 'ﳝ' => 'يم', - 'ﳞ' => 'يه', - 'ﳟ' => 'ئم', - 'ﳠ' => 'ئه', - 'ﳡ' => 'بم', - 'ﳢ' => 'به', - 'ﳣ' => 'تم', - 'ﳤ' => 'ته', - 'ﳥ' => 'ثم', - 'ﳦ' => 'ثه', - 'ﳧ' => 'سم', - 'ﳨ' => 'سه', - 'ﳩ' => 'شم', - 'ﳪ' => 'شه', - 'ﳫ' => 'كل', - 'ﳬ' => 'كم', - 'ﳭ' => 'لم', - 'ﳮ' => 'نم', - 'ﳯ' => 'نه', - 'ﳰ' => 'يم', - 'ﳱ' => 'يه', - 'ﳲ' => 'ـَّ', - 'ﳳ' => 'ـُّ', - 'ﳴ' => 'ـِّ', - 'ﳵ' => 'طى', - 'ﳶ' => 'طي', - 'ﳷ' => 'عى', - 'ﳸ' => 'عي', - 'ﳹ' => 'غى', - 'ﳺ' => 'غي', - 'ﳻ' => 'سى', - 'ﳼ' => 'سي', - 'ﳽ' => 'شى', - 'ﳾ' => 'شي', - 'ﳿ' => 'حى', - 'ﴀ' => 'حي', - 'ﴁ' => 'جى', - 'ﴂ' => 'جي', - 'ﴃ' => 'خى', - 'ﴄ' => 'خي', - 'ﴅ' => 'صى', - 'ﴆ' => 'صي', - 'ﴇ' => 'ضى', - 'ﴈ' => 'ضي', - 'ﴉ' => 'شج', - 'ﴊ' => 'شح', - 'ﴋ' => 'شخ', - 'ﴌ' => 'شم', - 'ﴍ' => 'شر', - 'ﴎ' => 'سر', - 'ﴏ' => 'صر', - 'ﴐ' => 'ضر', - 'ﴑ' => 'طى', - 'ﴒ' => 'طي', - 'ﴓ' => 'عى', - 'ﴔ' => 'عي', - 'ﴕ' => 'غى', - 'ﴖ' => 'غي', - 'ﴗ' => 'سى', - 'ﴘ' => 'سي', - 'ﴙ' => 'شى', - 'ﴚ' => 'شي', - 'ﴛ' => 'حى', - 'ﴜ' => 'حي', - 'ﴝ' => 'جى', - 'ﴞ' => 'جي', - 'ﴟ' => 'خى', - 'ﴠ' => 'خي', - 'ﴡ' => 'صى', - 'ﴢ' => 'صي', - 'ﴣ' => 'ضى', - 'ﴤ' => 'ضي', - 'ﴥ' => 'شج', - 'ﴦ' => 'شح', - 'ﴧ' => 'شخ', - 'ﴨ' => 'شم', - 'ﴩ' => 'شر', - 'ﴪ' => 'سر', - 'ﴫ' => 'صر', - 'ﴬ' => 'ضر', - 'ﴭ' => 'شج', - 'ﴮ' => 'شح', - 'ﴯ' => 'شخ', - 'ﴰ' => 'شم', - 'ﴱ' => 'سه', - 'ﴲ' => 'شه', - 'ﴳ' => 'طم', - 'ﴴ' => 'سج', - 'ﴵ' => 'سح', - 'ﴶ' => 'سخ', - 'ﴷ' => 'شج', - 'ﴸ' => 'شح', - 'ﴹ' => 'شخ', - 'ﴺ' => 'طم', - 'ﴻ' => 'ظم', - 'ﴼ' => 'اً', - 'ﴽ' => 'اً', - 'ﵐ' => 'تجم', - 'ﵑ' => 'تحج', - 'ﵒ' => 'تحج', - 'ﵓ' => 'تحم', - 'ﵔ' => 'تخم', - 'ﵕ' => 'تمج', - 'ﵖ' => 'تمح', - 'ﵗ' => 'تمخ', - 'ﵘ' => 'جمح', - 'ﵙ' => 'جمح', - 'ﵚ' => 'حمي', - 'ﵛ' => 'حمى', - 'ﵜ' => 'سحج', - 'ﵝ' => 'سجح', - 'ﵞ' => 'سجى', - 'ﵟ' => 'سمح', - 'ﵠ' => 'سمح', - 'ﵡ' => 'سمج', - 'ﵢ' => 'سمم', - 'ﵣ' => 'سمم', - 'ﵤ' => 'صحح', - 'ﵥ' => 'صحح', - 'ﵦ' => 'صمم', - 'ﵧ' => 'شحم', - 'ﵨ' => 'شحم', - 'ﵩ' => 'شجي', - 'ﵪ' => 'شمخ', - 'ﵫ' => 'شمخ', - 'ﵬ' => 'شمم', - 'ﵭ' => 'شمم', - 'ﵮ' => 'ضحى', - 'ﵯ' => 'ضخم', - 'ﵰ' => 'ضخم', - 'ﵱ' => 'طمح', - 'ﵲ' => 'طمح', - 'ﵳ' => 'طمم', - 'ﵴ' => 'طمي', - 'ﵵ' => 'عجم', - 'ﵶ' => 'عمم', - 'ﵷ' => 'عمم', - 'ﵸ' => 'عمى', - 'ﵹ' => 'غمم', - 'ﵺ' => 'غمي', - 'ﵻ' => 'غمى', - 'ﵼ' => 'فخم', - 'ﵽ' => 'فخم', - 'ﵾ' => 'قمح', - 'ﵿ' => 'قمم', - 'ﶀ' => 'لحم', - 'ﶁ' => 'لحي', - 'ﶂ' => 'لحى', - 'ﶃ' => 'لجج', - 'ﶄ' => 'لجج', - 'ﶅ' => 'لخم', - 'ﶆ' => 'لخم', - 'ﶇ' => 'لمح', - 'ﶈ' => 'لمح', - 'ﶉ' => 'محج', - 'ﶊ' => 'محم', - 'ﶋ' => 'محي', - 'ﶌ' => 'مجح', - 'ﶍ' => 'مجم', - 'ﶎ' => 'مخج', - 'ﶏ' => 'مخم', - 'ﶒ' => 'مجخ', - 'ﶓ' => 'همج', - 'ﶔ' => 'همم', - 'ﶕ' => 'نحم', - 'ﶖ' => 'نحى', - 'ﶗ' => 'نجم', - 'ﶘ' => 'نجم', - 'ﶙ' => 'نجى', - 'ﶚ' => 'نمي', - 'ﶛ' => 'نمى', - 'ﶜ' => 'يمم', - 'ﶝ' => 'يمم', - 'ﶞ' => 'بخي', - 'ﶟ' => 'تجي', - 'ﶠ' => 'تجى', - 'ﶡ' => 'تخي', - 'ﶢ' => 'تخى', - 'ﶣ' => 'تمي', - 'ﶤ' => 'تمى', - 'ﶥ' => 'جمي', - 'ﶦ' => 'جحى', - 'ﶧ' => 'جمى', - 'ﶨ' => 'سخى', - 'ﶩ' => 'صحي', - 'ﶪ' => 'شحي', - 'ﶫ' => 'ضحي', - 'ﶬ' => 'لجي', - 'ﶭ' => 'لمي', - 'ﶮ' => 'يحي', - 'ﶯ' => 'يجي', - 'ﶰ' => 'يمي', - 'ﶱ' => 'ممي', - 'ﶲ' => 'قمي', - 'ﶳ' => 'نحي', - 'ﶴ' => 'قمح', - 'ﶵ' => 'لحم', - 'ﶶ' => 'عمي', - 'ﶷ' => 'كمي', - 'ﶸ' => 'نجح', - 'ﶹ' => 'مخي', - 'ﶺ' => 'لجم', - 'ﶻ' => 'كمم', - 'ﶼ' => 'لجم', - 'ﶽ' => 'نجح', - 'ﶾ' => 'جحي', - 'ﶿ' => 'حجي', - 'ﷀ' => 'مجي', - 'ﷁ' => 'فمي', - 'ﷂ' => 'بحي', - 'ﷃ' => 'كمم', - 'ﷄ' => 'عجم', - 'ﷅ' => 'صمم', - 'ﷆ' => 'سخي', - 'ﷇ' => 'نجي', - 'ﷰ' => 'صلے', - 'ﷱ' => 'قلے', - 'ﷲ' => 'الله', - 'ﷳ' => 'اكبر', - 'ﷴ' => 'محمد', - 'ﷵ' => 'صلعم', - 'ﷶ' => 'رسول', - 'ﷷ' => 'عليه', - 'ﷸ' => 'وسلم', - 'ﷹ' => 'صلى', - 'ﷺ' => 'صلى الله عليه وسلم', - 'ﷻ' => 'جل جلاله', - '﷼' => 'ریال', - '︐' => ',', - '︑' => '、', - '︒' => '。', - '︓' => ':', - '︔' => ';', - '︕' => '!', - '︖' => '?', - '︗' => '〖', - '︘' => '〗', - '︙' => '...', - '︰' => '..', - '︱' => '—', - '︲' => '–', - '︳' => '_', - '︴' => '_', - '︵' => '(', - '︶' => ')', - '︷' => '{', - '︸' => '}', - '︹' => '〔', - '︺' => '〕', - '︻' => '【', - '︼' => '】', - '︽' => '《', - '︾' => '》', - '︿' => '〈', - '﹀' => '〉', - '﹁' => '「', - '﹂' => '」', - '﹃' => '『', - '﹄' => '』', - '﹇' => '[', - '﹈' => ']', - '﹉' => ' ̅', - '﹊' => ' ̅', - '﹋' => ' ̅', - '﹌' => ' ̅', - '﹍' => '_', - '﹎' => '_', - '﹏' => '_', - '﹐' => ',', - '﹑' => '、', - '﹒' => '.', - '﹔' => ';', - '﹕' => ':', - '﹖' => '?', - '﹗' => '!', - '﹘' => '—', - '﹙' => '(', - '﹚' => ')', - '﹛' => '{', - '﹜' => '}', - '﹝' => '〔', - '﹞' => '〕', - '﹟' => '#', - '﹠' => '&', - '﹡' => '*', - '﹢' => '+', - '﹣' => '-', - '﹤' => '<', - '﹥' => '>', - '﹦' => '=', - '﹨' => '\\', - '﹩' => '$', - '﹪' => '%', - '﹫' => '@', - 'ﹰ' => ' ً', - 'ﹱ' => 'ـً', - 'ﹲ' => ' ٌ', - 'ﹴ' => ' ٍ', - 'ﹶ' => ' َ', - 'ﹷ' => 'ـَ', - 'ﹸ' => ' ُ', - 'ﹹ' => 'ـُ', - 'ﹺ' => ' ِ', - 'ﹻ' => 'ـِ', - 'ﹼ' => ' ّ', - 'ﹽ' => 'ـّ', - 'ﹾ' => ' ْ', - 'ﹿ' => 'ـْ', - 'ﺀ' => 'ء', - 'ﺁ' => 'آ', - 'ﺂ' => 'آ', - 'ﺃ' => 'أ', - 'ﺄ' => 'أ', - 'ﺅ' => 'ؤ', - 'ﺆ' => 'ؤ', - 'ﺇ' => 'إ', - 'ﺈ' => 'إ', - 'ﺉ' => 'ئ', - 'ﺊ' => 'ئ', - 'ﺋ' => 'ئ', - 'ﺌ' => 'ئ', - 'ﺍ' => 'ا', - 'ﺎ' => 'ا', - 'ﺏ' => 'ب', - 'ﺐ' => 'ب', - 'ﺑ' => 'ب', - 'ﺒ' => 'ب', - 'ﺓ' => 'ة', - 'ﺔ' => 'ة', - 'ﺕ' => 'ت', - 'ﺖ' => 'ت', - 'ﺗ' => 'ت', - 'ﺘ' => 'ت', - 'ﺙ' => 'ث', - 'ﺚ' => 'ث', - 'ﺛ' => 'ث', - 'ﺜ' => 'ث', - 'ﺝ' => 'ج', - 'ﺞ' => 'ج', - 'ﺟ' => 'ج', - 'ﺠ' => 'ج', - 'ﺡ' => 'ح', - 'ﺢ' => 'ح', - 'ﺣ' => 'ح', - 'ﺤ' => 'ح', - 'ﺥ' => 'خ', - 'ﺦ' => 'خ', - 'ﺧ' => 'خ', - 'ﺨ' => 'خ', - 'ﺩ' => 'د', - 'ﺪ' => 'د', - 'ﺫ' => 'ذ', - 'ﺬ' => 'ذ', - 'ﺭ' => 'ر', - 'ﺮ' => 'ر', - 'ﺯ' => 'ز', - 'ﺰ' => 'ز', - 'ﺱ' => 'س', - 'ﺲ' => 'س', - 'ﺳ' => 'س', - 'ﺴ' => 'س', - 'ﺵ' => 'ش', - 'ﺶ' => 'ش', - 'ﺷ' => 'ش', - 'ﺸ' => 'ش', - 'ﺹ' => 'ص', - 'ﺺ' => 'ص', - 'ﺻ' => 'ص', - 'ﺼ' => 'ص', - 'ﺽ' => 'ض', - 'ﺾ' => 'ض', - 'ﺿ' => 'ض', - 'ﻀ' => 'ض', - 'ﻁ' => 'ط', - 'ﻂ' => 'ط', - 'ﻃ' => 'ط', - 'ﻄ' => 'ط', - 'ﻅ' => 'ظ', - 'ﻆ' => 'ظ', - 'ﻇ' => 'ظ', - 'ﻈ' => 'ظ', - 'ﻉ' => 'ع', - 'ﻊ' => 'ع', - 'ﻋ' => 'ع', - 'ﻌ' => 'ع', - 'ﻍ' => 'غ', - 'ﻎ' => 'غ', - 'ﻏ' => 'غ', - 'ﻐ' => 'غ', - 'ﻑ' => 'ف', - 'ﻒ' => 'ف', - 'ﻓ' => 'ف', - 'ﻔ' => 'ف', - 'ﻕ' => 'ق', - 'ﻖ' => 'ق', - 'ﻗ' => 'ق', - 'ﻘ' => 'ق', - 'ﻙ' => 'ك', - 'ﻚ' => 'ك', - 'ﻛ' => 'ك', - 'ﻜ' => 'ك', - 'ﻝ' => 'ل', - 'ﻞ' => 'ل', - 'ﻟ' => 'ل', - 'ﻠ' => 'ل', - 'ﻡ' => 'م', - 'ﻢ' => 'م', - 'ﻣ' => 'م', - 'ﻤ' => 'م', - 'ﻥ' => 'ن', - 'ﻦ' => 'ن', - 'ﻧ' => 'ن', - 'ﻨ' => 'ن', - 'ﻩ' => 'ه', - 'ﻪ' => 'ه', - 'ﻫ' => 'ه', - 'ﻬ' => 'ه', - 'ﻭ' => 'و', - 'ﻮ' => 'و', - 'ﻯ' => 'ى', - 'ﻰ' => 'ى', - 'ﻱ' => 'ي', - 'ﻲ' => 'ي', - 'ﻳ' => 'ي', - 'ﻴ' => 'ي', - 'ﻵ' => 'لآ', - 'ﻶ' => 'لآ', - 'ﻷ' => 'لأ', - 'ﻸ' => 'لأ', - 'ﻹ' => 'لإ', - 'ﻺ' => 'لإ', - 'ﻻ' => 'لا', - 'ﻼ' => 'لا', - '!' => '!', - '"' => '"', - '#' => '#', - '$' => '$', - '%' => '%', - '&' => '&', - ''' => '\'', - '(' => '(', - ')' => ')', - '*' => '*', - '+' => '+', - ',' => ',', - '-' => '-', - '.' => '.', - '/' => '/', - '0' => '0', - '1' => '1', - '2' => '2', - '3' => '3', - '4' => '4', - '5' => '5', - '6' => '6', - '7' => '7', - '8' => '8', - '9' => '9', - ':' => ':', - ';' => ';', - '<' => '<', - '=' => '=', - '>' => '>', - '?' => '?', - '@' => '@', - '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', - '[' => '[', - '\' => '\\', - ']' => ']', - '^' => '^', - '_' => '_', - '`' => '`', - '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', - '{' => '{', - '|' => '|', - '}' => '}', - '~' => '~', - '⦅' => '⦅', - '⦆' => '⦆', - '。' => '。', - '「' => '「', - '」' => '」', - '、' => '、', - '・' => '・', - 'ヲ' => 'ヲ', - 'ァ' => 'ァ', - 'ィ' => 'ィ', - 'ゥ' => 'ゥ', - 'ェ' => 'ェ', - 'ォ' => 'ォ', - 'ャ' => 'ャ', - 'ュ' => 'ュ', - 'ョ' => 'ョ', - 'ッ' => 'ッ', - 'ー' => 'ー', - 'ア' => 'ア', - 'イ' => 'イ', - 'ウ' => 'ウ', - 'エ' => 'エ', - 'オ' => 'オ', - 'カ' => 'カ', - 'キ' => 'キ', - 'ク' => 'ク', - 'ケ' => 'ケ', - 'コ' => 'コ', - 'サ' => 'サ', - 'シ' => 'シ', - 'ス' => 'ス', - 'セ' => 'セ', - 'ソ' => 'ソ', - 'タ' => 'タ', - 'チ' => 'チ', - 'ツ' => 'ツ', - 'テ' => 'テ', - 'ト' => 'ト', - 'ナ' => 'ナ', - 'ニ' => 'ニ', - 'ヌ' => 'ヌ', - 'ネ' => 'ネ', - 'ノ' => 'ノ', - 'ハ' => 'ハ', - 'ヒ' => 'ヒ', - 'フ' => 'フ', - 'ヘ' => 'ヘ', - 'ホ' => 'ホ', - 'マ' => 'マ', - 'ミ' => 'ミ', - 'ム' => 'ム', - 'メ' => 'メ', - 'モ' => 'モ', - 'ヤ' => 'ヤ', - 'ユ' => 'ユ', - 'ヨ' => 'ヨ', - 'ラ' => 'ラ', - 'リ' => 'リ', - 'ル' => 'ル', - 'レ' => 'レ', - 'ロ' => 'ロ', - 'ワ' => 'ワ', - 'ン' => 'ン', - '゙' => '゙', - '゚' => '゚', - 'ᅠ' => 'ᅠ', - 'ᄀ' => 'ᄀ', - 'ᄁ' => 'ᄁ', - 'ᆪ' => 'ᆪ', - 'ᄂ' => 'ᄂ', - 'ᆬ' => 'ᆬ', - 'ᆭ' => 'ᆭ', - 'ᄃ' => 'ᄃ', - 'ᄄ' => 'ᄄ', - 'ᄅ' => 'ᄅ', - 'ᆰ' => 'ᆰ', - 'ᆱ' => 'ᆱ', - 'ᆲ' => 'ᆲ', - 'ᆳ' => 'ᆳ', - 'ᆴ' => 'ᆴ', - 'ᆵ' => 'ᆵ', - 'ᄚ' => 'ᄚ', - 'ᄆ' => 'ᄆ', - 'ᄇ' => 'ᄇ', - 'ᄈ' => 'ᄈ', - 'ᄡ' => 'ᄡ', - 'ᄉ' => 'ᄉ', - 'ᄊ' => 'ᄊ', - 'ᄋ' => 'ᄋ', - 'ᄌ' => 'ᄌ', - 'ᄍ' => 'ᄍ', - 'ᄎ' => 'ᄎ', - 'ᄏ' => 'ᄏ', - 'ᄐ' => 'ᄐ', - 'ᄑ' => 'ᄑ', - 'ᄒ' => 'ᄒ', - 'ᅡ' => 'ᅡ', - 'ᅢ' => 'ᅢ', - 'ᅣ' => 'ᅣ', - 'ᅤ' => 'ᅤ', - 'ᅥ' => 'ᅥ', - 'ᅦ' => 'ᅦ', - 'ᅧ' => 'ᅧ', - 'ᅨ' => 'ᅨ', - 'ᅩ' => 'ᅩ', - 'ᅪ' => 'ᅪ', - 'ᅫ' => 'ᅫ', - 'ᅬ' => 'ᅬ', - 'ᅭ' => 'ᅭ', - 'ᅮ' => 'ᅮ', - 'ᅯ' => 'ᅯ', - 'ᅰ' => 'ᅰ', - 'ᅱ' => 'ᅱ', - 'ᅲ' => 'ᅲ', - 'ᅳ' => 'ᅳ', - 'ᅴ' => 'ᅴ', - 'ᅵ' => 'ᅵ', - '¢' => '¢', - '£' => '£', - '¬' => '¬', - ' ̄' => ' ̄', - '¦' => '¦', - '¥' => '¥', - '₩' => '₩', - '│' => '│', - '←' => '←', - '↑' => '↑', - '→' => '→', - '↓' => '↓', - '■' => '■', - '○' => '○', - '𝐀' => 'A', - '𝐁' => 'B', - '𝐂' => 'C', - '𝐃' => 'D', - '𝐄' => 'E', - '𝐅' => 'F', - '𝐆' => 'G', - '𝐇' => 'H', - '𝐈' => 'I', - '𝐉' => 'J', - '𝐊' => 'K', - '𝐋' => 'L', - '𝐌' => 'M', - '𝐍' => 'N', - '𝐎' => 'O', - '𝐏' => 'P', - '𝐐' => 'Q', - '𝐑' => 'R', - '𝐒' => 'S', - '𝐓' => 'T', - '𝐔' => 'U', - '𝐕' => 'V', - '𝐖' => 'W', - '𝐗' => 'X', - '𝐘' => 'Y', - '𝐙' => 'Z', - '𝐚' => 'a', - '𝐛' => 'b', - '𝐜' => 'c', - '𝐝' => 'd', - '𝐞' => 'e', - '𝐟' => 'f', - '𝐠' => 'g', - '𝐡' => 'h', - '𝐢' => 'i', - '𝐣' => 'j', - '𝐤' => 'k', - '𝐥' => 'l', - '𝐦' => 'm', - '𝐧' => 'n', - '𝐨' => 'o', - '𝐩' => 'p', - '𝐪' => 'q', - '𝐫' => 'r', - '𝐬' => 's', - '𝐭' => 't', - '𝐮' => 'u', - '𝐯' => 'v', - '𝐰' => 'w', - '𝐱' => 'x', - '𝐲' => 'y', - '𝐳' => 'z', - '𝐴' => 'A', - '𝐵' => 'B', - '𝐶' => 'C', - '𝐷' => 'D', - '𝐸' => 'E', - '𝐹' => 'F', - '𝐺' => 'G', - '𝐻' => 'H', - '𝐼' => 'I', - '𝐽' => 'J', - '𝐾' => 'K', - '𝐿' => 'L', - '𝑀' => 'M', - '𝑁' => 'N', - '𝑂' => 'O', - '𝑃' => 'P', - '𝑄' => 'Q', - '𝑅' => 'R', - '𝑆' => 'S', - '𝑇' => 'T', - '𝑈' => 'U', - '𝑉' => 'V', - '𝑊' => 'W', - '𝑋' => 'X', - '𝑌' => 'Y', - '𝑍' => 'Z', - '𝑎' => 'a', - '𝑏' => 'b', - '𝑐' => 'c', - '𝑑' => 'd', - '𝑒' => 'e', - '𝑓' => 'f', - '𝑔' => 'g', - '𝑖' => 'i', - '𝑗' => 'j', - '𝑘' => 'k', - '𝑙' => 'l', - '𝑚' => 'm', - '𝑛' => 'n', - '𝑜' => 'o', - '𝑝' => 'p', - '𝑞' => 'q', - '𝑟' => 'r', - '𝑠' => 's', - '𝑡' => 't', - '𝑢' => 'u', - '𝑣' => 'v', - '𝑤' => 'w', - '𝑥' => 'x', - '𝑦' => 'y', - '𝑧' => 'z', - '𝑨' => 'A', - '𝑩' => 'B', - '𝑪' => 'C', - '𝑫' => 'D', - '𝑬' => 'E', - '𝑭' => 'F', - '𝑮' => 'G', - '𝑯' => 'H', - '𝑰' => 'I', - '𝑱' => 'J', - '𝑲' => 'K', - '𝑳' => 'L', - '𝑴' => 'M', - '𝑵' => 'N', - '𝑶' => 'O', - '𝑷' => 'P', - '𝑸' => 'Q', - '𝑹' => 'R', - '𝑺' => 'S', - '𝑻' => 'T', - '𝑼' => 'U', - '𝑽' => 'V', - '𝑾' => 'W', - '𝑿' => 'X', - '𝒀' => 'Y', - '𝒁' => 'Z', - '𝒂' => 'a', - '𝒃' => 'b', - '𝒄' => 'c', - '𝒅' => 'd', - '𝒆' => 'e', - '𝒇' => 'f', - '𝒈' => 'g', - '𝒉' => 'h', - '𝒊' => 'i', - '𝒋' => 'j', - '𝒌' => 'k', - '𝒍' => 'l', - '𝒎' => 'm', - '𝒏' => 'n', - '𝒐' => 'o', - '𝒑' => 'p', - '𝒒' => 'q', - '𝒓' => 'r', - '𝒔' => 's', - '𝒕' => 't', - '𝒖' => 'u', - '𝒗' => 'v', - '𝒘' => 'w', - '𝒙' => 'x', - '𝒚' => 'y', - '𝒛' => 'z', - '𝒜' => 'A', - '𝒞' => 'C', - '𝒟' => 'D', - '𝒢' => 'G', - '𝒥' => 'J', - '𝒦' => 'K', - '𝒩' => 'N', - '𝒪' => 'O', - '𝒫' => 'P', - '𝒬' => 'Q', - '𝒮' => 'S', - '𝒯' => 'T', - '𝒰' => 'U', - '𝒱' => 'V', - '𝒲' => 'W', - '𝒳' => 'X', - '𝒴' => 'Y', - '𝒵' => 'Z', - '𝒶' => 'a', - '𝒷' => 'b', - '𝒸' => 'c', - '𝒹' => 'd', - '𝒻' => 'f', - '𝒽' => 'h', - '𝒾' => 'i', - '𝒿' => 'j', - '𝓀' => 'k', - '𝓁' => 'l', - '𝓂' => 'm', - '𝓃' => 'n', - '𝓅' => 'p', - '𝓆' => 'q', - '𝓇' => 'r', - '𝓈' => 's', - '𝓉' => 't', - '𝓊' => 'u', - '𝓋' => 'v', - '𝓌' => 'w', - '𝓍' => 'x', - '𝓎' => 'y', - '𝓏' => 'z', - '𝓐' => 'A', - '𝓑' => 'B', - '𝓒' => 'C', - '𝓓' => 'D', - '𝓔' => 'E', - '𝓕' => 'F', - '𝓖' => 'G', - '𝓗' => 'H', - '𝓘' => 'I', - '𝓙' => 'J', - '𝓚' => 'K', - '𝓛' => 'L', - '𝓜' => 'M', - '𝓝' => 'N', - '𝓞' => 'O', - '𝓟' => 'P', - '𝓠' => 'Q', - '𝓡' => 'R', - '𝓢' => 'S', - '𝓣' => 'T', - '𝓤' => 'U', - '𝓥' => 'V', - '𝓦' => 'W', - '𝓧' => 'X', - '𝓨' => 'Y', - '𝓩' => 'Z', - '𝓪' => 'a', - '𝓫' => 'b', - '𝓬' => 'c', - '𝓭' => 'd', - '𝓮' => 'e', - '𝓯' => 'f', - '𝓰' => 'g', - '𝓱' => 'h', - '𝓲' => 'i', - '𝓳' => 'j', - '𝓴' => 'k', - '𝓵' => 'l', - '𝓶' => 'm', - '𝓷' => 'n', - '𝓸' => 'o', - '𝓹' => 'p', - '𝓺' => 'q', - '𝓻' => 'r', - '𝓼' => 's', - '𝓽' => 't', - '𝓾' => 'u', - '𝓿' => 'v', - '𝔀' => 'w', - '𝔁' => 'x', - '𝔂' => 'y', - '𝔃' => 'z', - '𝔄' => 'A', - '𝔅' => 'B', - '𝔇' => 'D', - '𝔈' => 'E', - '𝔉' => 'F', - '𝔊' => 'G', - '𝔍' => 'J', - '𝔎' => 'K', - '𝔏' => 'L', - '𝔐' => 'M', - '𝔑' => 'N', - '𝔒' => 'O', - '𝔓' => 'P', - '𝔔' => 'Q', - '𝔖' => 'S', - '𝔗' => 'T', - '𝔘' => 'U', - '𝔙' => 'V', - '𝔚' => 'W', - '𝔛' => 'X', - '𝔜' => 'Y', - '𝔞' => 'a', - '𝔟' => 'b', - '𝔠' => 'c', - '𝔡' => 'd', - '𝔢' => 'e', - '𝔣' => 'f', - '𝔤' => 'g', - '𝔥' => 'h', - '𝔦' => 'i', - '𝔧' => 'j', - '𝔨' => 'k', - '𝔩' => 'l', - '𝔪' => 'm', - '𝔫' => 'n', - '𝔬' => 'o', - '𝔭' => 'p', - '𝔮' => 'q', - '𝔯' => 'r', - '𝔰' => 's', - '𝔱' => 't', - '𝔲' => 'u', - '𝔳' => 'v', - '𝔴' => 'w', - '𝔵' => 'x', - '𝔶' => 'y', - '𝔷' => 'z', - '𝔸' => 'A', - '𝔹' => 'B', - '𝔻' => 'D', - '𝔼' => 'E', - '𝔽' => 'F', - '𝔾' => 'G', - '𝕀' => 'I', - '𝕁' => 'J', - '𝕂' => 'K', - '𝕃' => 'L', - '𝕄' => 'M', - '𝕆' => 'O', - '𝕊' => 'S', - '𝕋' => 'T', - '𝕌' => 'U', - '𝕍' => 'V', - '𝕎' => 'W', - '𝕏' => 'X', - '𝕐' => 'Y', - '𝕒' => 'a', - '𝕓' => 'b', - '𝕔' => 'c', - '𝕕' => 'd', - '𝕖' => 'e', - '𝕗' => 'f', - '𝕘' => 'g', - '𝕙' => 'h', - '𝕚' => 'i', - '𝕛' => 'j', - '𝕜' => 'k', - '𝕝' => 'l', - '𝕞' => 'm', - '𝕟' => 'n', - '𝕠' => 'o', - '𝕡' => 'p', - '𝕢' => 'q', - '𝕣' => 'r', - '𝕤' => 's', - '𝕥' => 't', - '𝕦' => 'u', - '𝕧' => 'v', - '𝕨' => 'w', - '𝕩' => 'x', - '𝕪' => 'y', - '𝕫' => 'z', - '𝕬' => 'A', - '𝕭' => 'B', - '𝕮' => 'C', - '𝕯' => 'D', - '𝕰' => 'E', - '𝕱' => 'F', - '𝕲' => 'G', - '𝕳' => 'H', - '𝕴' => 'I', - '𝕵' => 'J', - '𝕶' => 'K', - '𝕷' => 'L', - '𝕸' => 'M', - '𝕹' => 'N', - '𝕺' => 'O', - '𝕻' => 'P', - '𝕼' => 'Q', - '𝕽' => 'R', - '𝕾' => 'S', - '𝕿' => 'T', - '𝖀' => 'U', - '𝖁' => 'V', - '𝖂' => 'W', - '𝖃' => 'X', - '𝖄' => 'Y', - '𝖅' => 'Z', - '𝖆' => 'a', - '𝖇' => 'b', - '𝖈' => 'c', - '𝖉' => 'd', - '𝖊' => 'e', - '𝖋' => 'f', - '𝖌' => 'g', - '𝖍' => 'h', - '𝖎' => 'i', - '𝖏' => 'j', - '𝖐' => 'k', - '𝖑' => 'l', - '𝖒' => 'm', - '𝖓' => 'n', - '𝖔' => 'o', - '𝖕' => 'p', - '𝖖' => 'q', - '𝖗' => 'r', - '𝖘' => 's', - '𝖙' => 't', - '𝖚' => 'u', - '𝖛' => 'v', - '𝖜' => 'w', - '𝖝' => 'x', - '𝖞' => 'y', - '𝖟' => 'z', - '𝖠' => 'A', - '𝖡' => 'B', - '𝖢' => 'C', - '𝖣' => 'D', - '𝖤' => 'E', - '𝖥' => 'F', - '𝖦' => 'G', - '𝖧' => 'H', - '𝖨' => 'I', - '𝖩' => 'J', - '𝖪' => 'K', - '𝖫' => 'L', - '𝖬' => 'M', - '𝖭' => 'N', - '𝖮' => 'O', - '𝖯' => 'P', - '𝖰' => 'Q', - '𝖱' => 'R', - '𝖲' => 'S', - '𝖳' => 'T', - '𝖴' => 'U', - '𝖵' => 'V', - '𝖶' => 'W', - '𝖷' => 'X', - '𝖸' => 'Y', - '𝖹' => 'Z', - '𝖺' => 'a', - '𝖻' => 'b', - '𝖼' => 'c', - '𝖽' => 'd', - '𝖾' => 'e', - '𝖿' => 'f', - '𝗀' => 'g', - '𝗁' => 'h', - '𝗂' => 'i', - '𝗃' => 'j', - '𝗄' => 'k', - '𝗅' => 'l', - '𝗆' => 'm', - '𝗇' => 'n', - '𝗈' => 'o', - '𝗉' => 'p', - '𝗊' => 'q', - '𝗋' => 'r', - '𝗌' => 's', - '𝗍' => 't', - '𝗎' => 'u', - '𝗏' => 'v', - '𝗐' => 'w', - '𝗑' => 'x', - '𝗒' => 'y', - '𝗓' => 'z', - '𝗔' => 'A', - '𝗕' => 'B', - '𝗖' => 'C', - '𝗗' => 'D', - '𝗘' => 'E', - '𝗙' => 'F', - '𝗚' => 'G', - '𝗛' => 'H', - '𝗜' => 'I', - '𝗝' => 'J', - '𝗞' => 'K', - '𝗟' => 'L', - '𝗠' => 'M', - '𝗡' => 'N', - '𝗢' => 'O', - '𝗣' => 'P', - '𝗤' => 'Q', - '𝗥' => 'R', - '𝗦' => 'S', - '𝗧' => 'T', - '𝗨' => 'U', - '𝗩' => 'V', - '𝗪' => 'W', - '𝗫' => 'X', - '𝗬' => 'Y', - '𝗭' => 'Z', - '𝗮' => 'a', - '𝗯' => 'b', - '𝗰' => 'c', - '𝗱' => 'd', - '𝗲' => 'e', - '𝗳' => 'f', - '𝗴' => 'g', - '𝗵' => 'h', - '𝗶' => 'i', - '𝗷' => 'j', - '𝗸' => 'k', - '𝗹' => 'l', - '𝗺' => 'm', - '𝗻' => 'n', - '𝗼' => 'o', - '𝗽' => 'p', - '𝗾' => 'q', - '𝗿' => 'r', - '𝘀' => 's', - '𝘁' => 't', - '𝘂' => 'u', - '𝘃' => 'v', - '𝘄' => 'w', - '𝘅' => 'x', - '𝘆' => 'y', - '𝘇' => 'z', - '𝘈' => 'A', - '𝘉' => 'B', - '𝘊' => 'C', - '𝘋' => 'D', - '𝘌' => 'E', - '𝘍' => 'F', - '𝘎' => 'G', - '𝘏' => 'H', - '𝘐' => 'I', - '𝘑' => 'J', - '𝘒' => 'K', - '𝘓' => 'L', - '𝘔' => 'M', - '𝘕' => 'N', - '𝘖' => 'O', - '𝘗' => 'P', - '𝘘' => 'Q', - '𝘙' => 'R', - '𝘚' => 'S', - '𝘛' => 'T', - '𝘜' => 'U', - '𝘝' => 'V', - '𝘞' => 'W', - '𝘟' => 'X', - '𝘠' => 'Y', - '𝘡' => 'Z', - '𝘢' => 'a', - '𝘣' => 'b', - '𝘤' => 'c', - '𝘥' => 'd', - '𝘦' => 'e', - '𝘧' => 'f', - '𝘨' => 'g', - '𝘩' => 'h', - '𝘪' => 'i', - '𝘫' => 'j', - '𝘬' => 'k', - '𝘭' => 'l', - '𝘮' => 'm', - '𝘯' => 'n', - '𝘰' => 'o', - '𝘱' => 'p', - '𝘲' => 'q', - '𝘳' => 'r', - '𝘴' => 's', - '𝘵' => 't', - '𝘶' => 'u', - '𝘷' => 'v', - '𝘸' => 'w', - '𝘹' => 'x', - '𝘺' => 'y', - '𝘻' => 'z', - '𝘼' => 'A', - '𝘽' => 'B', - '𝘾' => 'C', - '𝘿' => 'D', - '𝙀' => 'E', - '𝙁' => 'F', - '𝙂' => 'G', - '𝙃' => 'H', - '𝙄' => 'I', - '𝙅' => 'J', - '𝙆' => 'K', - '𝙇' => 'L', - '𝙈' => 'M', - '𝙉' => 'N', - '𝙊' => 'O', - '𝙋' => 'P', - '𝙌' => 'Q', - '𝙍' => 'R', - '𝙎' => 'S', - '𝙏' => 'T', - '𝙐' => 'U', - '𝙑' => 'V', - '𝙒' => 'W', - '𝙓' => 'X', - '𝙔' => 'Y', - '𝙕' => 'Z', - '𝙖' => 'a', - '𝙗' => 'b', - '𝙘' => 'c', - '𝙙' => 'd', - '𝙚' => 'e', - '𝙛' => 'f', - '𝙜' => 'g', - '𝙝' => 'h', - '𝙞' => 'i', - '𝙟' => 'j', - '𝙠' => 'k', - '𝙡' => 'l', - '𝙢' => 'm', - '𝙣' => 'n', - '𝙤' => 'o', - '𝙥' => 'p', - '𝙦' => 'q', - '𝙧' => 'r', - '𝙨' => 's', - '𝙩' => 't', - '𝙪' => 'u', - '𝙫' => 'v', - '𝙬' => 'w', - '𝙭' => 'x', - '𝙮' => 'y', - '𝙯' => 'z', - '𝙰' => 'A', - '𝙱' => 'B', - '𝙲' => 'C', - '𝙳' => 'D', - '𝙴' => 'E', - '𝙵' => 'F', - '𝙶' => 'G', - '𝙷' => 'H', - '𝙸' => 'I', - '𝙹' => 'J', - '𝙺' => 'K', - '𝙻' => 'L', - '𝙼' => 'M', - '𝙽' => 'N', - '𝙾' => 'O', - '𝙿' => 'P', - '𝚀' => 'Q', - '𝚁' => 'R', - '𝚂' => 'S', - '𝚃' => 'T', - '𝚄' => 'U', - '𝚅' => 'V', - '𝚆' => 'W', - '𝚇' => 'X', - '𝚈' => 'Y', - '𝚉' => 'Z', - '𝚊' => 'a', - '𝚋' => 'b', - '𝚌' => 'c', - '𝚍' => 'd', - '𝚎' => 'e', - '𝚏' => 'f', - '𝚐' => 'g', - '𝚑' => 'h', - '𝚒' => 'i', - '𝚓' => 'j', - '𝚔' => 'k', - '𝚕' => 'l', - '𝚖' => 'm', - '𝚗' => 'n', - '𝚘' => 'o', - '𝚙' => 'p', - '𝚚' => 'q', - '𝚛' => 'r', - '𝚜' => 's', - '𝚝' => 't', - '𝚞' => 'u', - '𝚟' => 'v', - '𝚠' => 'w', - '𝚡' => 'x', - '𝚢' => 'y', - '𝚣' => 'z', - '𝚤' => 'ı', - '𝚥' => 'ȷ', - '𝚨' => 'Α', - '𝚩' => 'Β', - '𝚪' => 'Γ', - '𝚫' => 'Δ', - '𝚬' => 'Ε', - '𝚭' => 'Ζ', - '𝚮' => 'Η', - '𝚯' => 'Θ', - '𝚰' => 'Ι', - '𝚱' => 'Κ', - '𝚲' => 'Λ', - '𝚳' => 'Μ', - '𝚴' => 'Ν', - '𝚵' => 'Ξ', - '𝚶' => 'Ο', - '𝚷' => 'Π', - '𝚸' => 'Ρ', - '𝚹' => 'Θ', - '𝚺' => 'Σ', - '𝚻' => 'Τ', - '𝚼' => 'Υ', - '𝚽' => 'Φ', - '𝚾' => 'Χ', - '𝚿' => 'Ψ', - '𝛀' => 'Ω', - '𝛁' => '∇', - '𝛂' => 'α', - '𝛃' => 'β', - '𝛄' => 'γ', - '𝛅' => 'δ', - '𝛆' => 'ε', - '𝛇' => 'ζ', - '𝛈' => 'η', - '𝛉' => 'θ', - '𝛊' => 'ι', - '𝛋' => 'κ', - '𝛌' => 'λ', - '𝛍' => 'μ', - '𝛎' => 'ν', - '𝛏' => 'ξ', - '𝛐' => 'ο', - '𝛑' => 'π', - '𝛒' => 'ρ', - '𝛓' => 'ς', - '𝛔' => 'σ', - '𝛕' => 'τ', - '𝛖' => 'υ', - '𝛗' => 'φ', - '𝛘' => 'χ', - '𝛙' => 'ψ', - '𝛚' => 'ω', - '𝛛' => '∂', - '𝛜' => 'ε', - '𝛝' => 'θ', - '𝛞' => 'κ', - '𝛟' => 'φ', - '𝛠' => 'ρ', - '𝛡' => 'π', - '𝛢' => 'Α', - '𝛣' => 'Β', - '𝛤' => 'Γ', - '𝛥' => 'Δ', - '𝛦' => 'Ε', - '𝛧' => 'Ζ', - '𝛨' => 'Η', - '𝛩' => 'Θ', - '𝛪' => 'Ι', - '𝛫' => 'Κ', - '𝛬' => 'Λ', - '𝛭' => 'Μ', - '𝛮' => 'Ν', - '𝛯' => 'Ξ', - '𝛰' => 'Ο', - '𝛱' => 'Π', - '𝛲' => 'Ρ', - '𝛳' => 'Θ', - '𝛴' => 'Σ', - '𝛵' => 'Τ', - '𝛶' => 'Υ', - '𝛷' => 'Φ', - '𝛸' => 'Χ', - '𝛹' => 'Ψ', - '𝛺' => 'Ω', - '𝛻' => '∇', - '𝛼' => 'α', - '𝛽' => 'β', - '𝛾' => 'γ', - '𝛿' => 'δ', - '𝜀' => 'ε', - '𝜁' => 'ζ', - '𝜂' => 'η', - '𝜃' => 'θ', - '𝜄' => 'ι', - '𝜅' => 'κ', - '𝜆' => 'λ', - '𝜇' => 'μ', - '𝜈' => 'ν', - '𝜉' => 'ξ', - '𝜊' => 'ο', - '𝜋' => 'π', - '𝜌' => 'ρ', - '𝜍' => 'ς', - '𝜎' => 'σ', - '𝜏' => 'τ', - '𝜐' => 'υ', - '𝜑' => 'φ', - '𝜒' => 'χ', - '𝜓' => 'ψ', - '𝜔' => 'ω', - '𝜕' => '∂', - '𝜖' => 'ε', - '𝜗' => 'θ', - '𝜘' => 'κ', - '𝜙' => 'φ', - '𝜚' => 'ρ', - '𝜛' => 'π', - '𝜜' => 'Α', - '𝜝' => 'Β', - '𝜞' => 'Γ', - '𝜟' => 'Δ', - '𝜠' => 'Ε', - '𝜡' => 'Ζ', - '𝜢' => 'Η', - '𝜣' => 'Θ', - '𝜤' => 'Ι', - '𝜥' => 'Κ', - '𝜦' => 'Λ', - '𝜧' => 'Μ', - '𝜨' => 'Ν', - '𝜩' => 'Ξ', - '𝜪' => 'Ο', - '𝜫' => 'Π', - '𝜬' => 'Ρ', - '𝜭' => 'Θ', - '𝜮' => 'Σ', - '𝜯' => 'Τ', - '𝜰' => 'Υ', - '𝜱' => 'Φ', - '𝜲' => 'Χ', - '𝜳' => 'Ψ', - '𝜴' => 'Ω', - '𝜵' => '∇', - '𝜶' => 'α', - '𝜷' => 'β', - '𝜸' => 'γ', - '𝜹' => 'δ', - '𝜺' => 'ε', - '𝜻' => 'ζ', - '𝜼' => 'η', - '𝜽' => 'θ', - '𝜾' => 'ι', - '𝜿' => 'κ', - '𝝀' => 'λ', - '𝝁' => 'μ', - '𝝂' => 'ν', - '𝝃' => 'ξ', - '𝝄' => 'ο', - '𝝅' => 'π', - '𝝆' => 'ρ', - '𝝇' => 'ς', - '𝝈' => 'σ', - '𝝉' => 'τ', - '𝝊' => 'υ', - '𝝋' => 'φ', - '𝝌' => 'χ', - '𝝍' => 'ψ', - '𝝎' => 'ω', - '𝝏' => '∂', - '𝝐' => 'ε', - '𝝑' => 'θ', - '𝝒' => 'κ', - '𝝓' => 'φ', - '𝝔' => 'ρ', - '𝝕' => 'π', - '𝝖' => 'Α', - '𝝗' => 'Β', - '𝝘' => 'Γ', - '𝝙' => 'Δ', - '𝝚' => 'Ε', - '𝝛' => 'Ζ', - '𝝜' => 'Η', - '𝝝' => 'Θ', - '𝝞' => 'Ι', - '𝝟' => 'Κ', - '𝝠' => 'Λ', - '𝝡' => 'Μ', - '𝝢' => 'Ν', - '𝝣' => 'Ξ', - '𝝤' => 'Ο', - '𝝥' => 'Π', - '𝝦' => 'Ρ', - '𝝧' => 'Θ', - '𝝨' => 'Σ', - '𝝩' => 'Τ', - '𝝪' => 'Υ', - '𝝫' => 'Φ', - '𝝬' => 'Χ', - '𝝭' => 'Ψ', - '𝝮' => 'Ω', - '𝝯' => '∇', - '𝝰' => 'α', - '𝝱' => 'β', - '𝝲' => 'γ', - '𝝳' => 'δ', - '𝝴' => 'ε', - '𝝵' => 'ζ', - '𝝶' => 'η', - '𝝷' => 'θ', - '𝝸' => 'ι', - '𝝹' => 'κ', - '𝝺' => 'λ', - '𝝻' => 'μ', - '𝝼' => 'ν', - '𝝽' => 'ξ', - '𝝾' => 'ο', - '𝝿' => 'π', - '𝞀' => 'ρ', - '𝞁' => 'ς', - '𝞂' => 'σ', - '𝞃' => 'τ', - '𝞄' => 'υ', - '𝞅' => 'φ', - '𝞆' => 'χ', - '𝞇' => 'ψ', - '𝞈' => 'ω', - '𝞉' => '∂', - '𝞊' => 'ε', - '𝞋' => 'θ', - '𝞌' => 'κ', - '𝞍' => 'φ', - '𝞎' => 'ρ', - '𝞏' => 'π', - '𝞐' => 'Α', - '𝞑' => 'Β', - '𝞒' => 'Γ', - '𝞓' => 'Δ', - '𝞔' => 'Ε', - '𝞕' => 'Ζ', - '𝞖' => 'Η', - '𝞗' => 'Θ', - '𝞘' => 'Ι', - '𝞙' => 'Κ', - '𝞚' => 'Λ', - '𝞛' => 'Μ', - '𝞜' => 'Ν', - '𝞝' => 'Ξ', - '𝞞' => 'Ο', - '𝞟' => 'Π', - '𝞠' => 'Ρ', - '𝞡' => 'Θ', - '𝞢' => 'Σ', - '𝞣' => 'Τ', - '𝞤' => 'Υ', - '𝞥' => 'Φ', - '𝞦' => 'Χ', - '𝞧' => 'Ψ', - '𝞨' => 'Ω', - '𝞩' => '∇', - '𝞪' => 'α', - '𝞫' => 'β', - '𝞬' => 'γ', - '𝞭' => 'δ', - '𝞮' => 'ε', - '𝞯' => 'ζ', - '𝞰' => 'η', - '𝞱' => 'θ', - '𝞲' => 'ι', - '𝞳' => 'κ', - '𝞴' => 'λ', - '𝞵' => 'μ', - '𝞶' => 'ν', - '𝞷' => 'ξ', - '𝞸' => 'ο', - '𝞹' => 'π', - '𝞺' => 'ρ', - '𝞻' => 'ς', - '𝞼' => 'σ', - '𝞽' => 'τ', - '𝞾' => 'υ', - '𝞿' => 'φ', - '𝟀' => 'χ', - '𝟁' => 'ψ', - '𝟂' => 'ω', - '𝟃' => '∂', - '𝟄' => 'ε', - '𝟅' => 'θ', - '𝟆' => 'κ', - '𝟇' => 'φ', - '𝟈' => 'ρ', - '𝟉' => 'π', - '𝟊' => 'Ϝ', - '𝟋' => 'ϝ', - '𝟎' => '0', - '𝟏' => '1', - '𝟐' => '2', - '𝟑' => '3', - '𝟒' => '4', - '𝟓' => '5', - '𝟔' => '6', - '𝟕' => '7', - '𝟖' => '8', - '𝟗' => '9', - '𝟘' => '0', - '𝟙' => '1', - '𝟚' => '2', - '𝟛' => '3', - '𝟜' => '4', - '𝟝' => '5', - '𝟞' => '6', - '𝟟' => '7', - '𝟠' => '8', - '𝟡' => '9', - '𝟢' => '0', - '𝟣' => '1', - '𝟤' => '2', - '𝟥' => '3', - '𝟦' => '4', - '𝟧' => '5', - '𝟨' => '6', - '𝟩' => '7', - '𝟪' => '8', - '𝟫' => '9', - '𝟬' => '0', - '𝟭' => '1', - '𝟮' => '2', - '𝟯' => '3', - '𝟰' => '4', - '𝟱' => '5', - '𝟲' => '6', - '𝟳' => '7', - '𝟴' => '8', - '𝟵' => '9', - '𝟶' => '0', - '𝟷' => '1', - '𝟸' => '2', - '𝟹' => '3', - '𝟺' => '4', - '𝟻' => '5', - '𝟼' => '6', - '𝟽' => '7', - '𝟾' => '8', - '𝟿' => '9', - '𞸀' => 'ا', - '𞸁' => 'ب', - '𞸂' => 'ج', - '𞸃' => 'د', - '𞸅' => 'و', - '𞸆' => 'ز', - '𞸇' => 'ح', - '𞸈' => 'ط', - '𞸉' => 'ي', - '𞸊' => 'ك', - '𞸋' => 'ل', - '𞸌' => 'م', - '𞸍' => 'ن', - '𞸎' => 'س', - '𞸏' => 'ع', - '𞸐' => 'ف', - '𞸑' => 'ص', - '𞸒' => 'ق', - '𞸓' => 'ر', - '𞸔' => 'ش', - '𞸕' => 'ت', - '𞸖' => 'ث', - '𞸗' => 'خ', - '𞸘' => 'ذ', - '𞸙' => 'ض', - '𞸚' => 'ظ', - '𞸛' => 'غ', - '𞸜' => 'ٮ', - '𞸝' => 'ں', - '𞸞' => 'ڡ', - '𞸟' => 'ٯ', - '𞸡' => 'ب', - '𞸢' => 'ج', - '𞸤' => 'ه', - '𞸧' => 'ح', - '𞸩' => 'ي', - '𞸪' => 'ك', - '𞸫' => 'ل', - '𞸬' => 'م', - '𞸭' => 'ن', - '𞸮' => 'س', - '𞸯' => 'ع', - '𞸰' => 'ف', - '𞸱' => 'ص', - '𞸲' => 'ق', - '𞸴' => 'ش', - '𞸵' => 'ت', - '𞸶' => 'ث', - '𞸷' => 'خ', - '𞸹' => 'ض', - '𞸻' => 'غ', - '𞹂' => 'ج', - '𞹇' => 'ح', - '𞹉' => 'ي', - '𞹋' => 'ل', - '𞹍' => 'ن', - '𞹎' => 'س', - '𞹏' => 'ع', - '𞹑' => 'ص', - '𞹒' => 'ق', - '𞹔' => 'ش', - '𞹗' => 'خ', - '𞹙' => 'ض', - '𞹛' => 'غ', - '𞹝' => 'ں', - '𞹟' => 'ٯ', - '𞹡' => 'ب', - '𞹢' => 'ج', - '𞹤' => 'ه', - '𞹧' => 'ح', - '𞹨' => 'ط', - '𞹩' => 'ي', - '𞹪' => 'ك', - '𞹬' => 'م', - '𞹭' => 'ن', - '𞹮' => 'س', - '𞹯' => 'ع', - '𞹰' => 'ف', - '𞹱' => 'ص', - '𞹲' => 'ق', - '𞹴' => 'ش', - '𞹵' => 'ت', - '𞹶' => 'ث', - '𞹷' => 'خ', - '𞹹' => 'ض', - '𞹺' => 'ظ', - '𞹻' => 'غ', - '𞹼' => 'ٮ', - '𞹾' => 'ڡ', - '𞺀' => 'ا', - '𞺁' => 'ب', - '𞺂' => 'ج', - '𞺃' => 'د', - '𞺄' => 'ه', - '𞺅' => 'و', - '𞺆' => 'ز', - '𞺇' => 'ح', - '𞺈' => 'ط', - '𞺉' => 'ي', - '𞺋' => 'ل', - '𞺌' => 'م', - '𞺍' => 'ن', - '𞺎' => 'س', - '𞺏' => 'ع', - '𞺐' => 'ف', - '𞺑' => 'ص', - '𞺒' => 'ق', - '𞺓' => 'ر', - '𞺔' => 'ش', - '𞺕' => 'ت', - '𞺖' => 'ث', - '𞺗' => 'خ', - '𞺘' => 'ذ', - '𞺙' => 'ض', - '𞺚' => 'ظ', - '𞺛' => 'غ', - '𞺡' => 'ب', - '𞺢' => 'ج', - '𞺣' => 'د', - '𞺥' => 'و', - '𞺦' => 'ز', - '𞺧' => 'ح', - '𞺨' => 'ط', - '𞺩' => 'ي', - '𞺫' => 'ل', - '𞺬' => 'م', - '𞺭' => 'ن', - '𞺮' => 'س', - '𞺯' => 'ع', - '𞺰' => 'ف', - '𞺱' => 'ص', - '𞺲' => 'ق', - '𞺳' => 'ر', - '𞺴' => 'ش', - '𞺵' => 'ت', - '𞺶' => 'ث', - '𞺷' => 'خ', - '𞺸' => 'ذ', - '𞺹' => 'ض', - '𞺺' => 'ظ', - '𞺻' => 'غ', - '🄀' => '0.', - '🄁' => '0,', - '🄂' => '1,', - '🄃' => '2,', - '🄄' => '3,', - '🄅' => '4,', - '🄆' => '5,', - '🄇' => '6,', - '🄈' => '7,', - '🄉' => '8,', - '🄊' => '9,', - '🄐' => '(A)', - '🄑' => '(B)', - '🄒' => '(C)', - '🄓' => '(D)', - '🄔' => '(E)', - '🄕' => '(F)', - '🄖' => '(G)', - '🄗' => '(H)', - '🄘' => '(I)', - '🄙' => '(J)', - '🄚' => '(K)', - '🄛' => '(L)', - '🄜' => '(M)', - '🄝' => '(N)', - '🄞' => '(O)', - '🄟' => '(P)', - '🄠' => '(Q)', - '🄡' => '(R)', - '🄢' => '(S)', - '🄣' => '(T)', - '🄤' => '(U)', - '🄥' => '(V)', - '🄦' => '(W)', - '🄧' => '(X)', - '🄨' => '(Y)', - '🄩' => '(Z)', - '🄪' => '〔S〕', - '🄫' => 'C', - '🄬' => 'R', - '🄭' => 'CD', - '🄮' => 'WZ', - '🄰' => 'A', - '🄱' => 'B', - '🄲' => 'C', - '🄳' => 'D', - '🄴' => 'E', - '🄵' => 'F', - '🄶' => 'G', - '🄷' => 'H', - '🄸' => 'I', - '🄹' => 'J', - '🄺' => 'K', - '🄻' => 'L', - '🄼' => 'M', - '🄽' => 'N', - '🄾' => 'O', - '🄿' => 'P', - '🅀' => 'Q', - '🅁' => 'R', - '🅂' => 'S', - '🅃' => 'T', - '🅄' => 'U', - '🅅' => 'V', - '🅆' => 'W', - '🅇' => 'X', - '🅈' => 'Y', - '🅉' => 'Z', - '🅊' => 'HV', - '🅋' => 'MV', - '🅌' => 'SD', - '🅍' => 'SS', - '🅎' => 'PPV', - '🅏' => 'WC', - '🅪' => 'MC', - '🅫' => 'MD', - '🅬' => 'MR', - '🆐' => 'DJ', - '🈀' => 'ほか', - '🈁' => 'ココ', - '🈂' => 'サ', - '🈐' => '手', - '🈑' => '字', - '🈒' => '双', - '🈓' => 'デ', - '🈔' => '二', - '🈕' => '多', - '🈖' => '解', - '🈗' => '天', - '🈘' => '交', - '🈙' => '映', - '🈚' => '無', - '🈛' => '料', - '🈜' => '前', - '🈝' => '後', - '🈞' => '再', - '🈟' => '新', - '🈠' => '初', - '🈡' => '終', - '🈢' => '生', - '🈣' => '販', - '🈤' => '声', - '🈥' => '吹', - '🈦' => '演', - '🈧' => '投', - '🈨' => '捕', - '🈩' => '一', - '🈪' => '三', - '🈫' => '遊', - '🈬' => '左', - '🈭' => '中', - '🈮' => '右', - '🈯' => '指', - '🈰' => '走', - '🈱' => '打', - '🈲' => '禁', - '🈳' => '空', - '🈴' => '合', - '🈵' => '満', - '🈶' => '有', - '🈷' => '月', - '🈸' => '申', - '🈹' => '割', - '🈺' => '営', - '🈻' => '配', - '🉀' => '〔本〕', - '🉁' => '〔三〕', - '🉂' => '〔二〕', - '🉃' => '〔安〕', - '🉄' => '〔点〕', - '🉅' => '〔打〕', - '🉆' => '〔盗〕', - '🉇' => '〔勝〕', - '🉈' => '〔敗〕', - '🉐' => '得', - '🉑' => '可', - '🯰' => '0', - '🯱' => '1', - '🯲' => '2', - '🯳' => '3', - '🯴' => '4', - '🯵' => '5', - '🯶' => '6', - '🯷' => '7', - '🯸' => '8', - '🯹' => '9', -); diff --git a/vendor/symfony/polyfill-intl-normalizer/bootstrap.php b/vendor/symfony/polyfill-intl-normalizer/bootstrap.php deleted file mode 100644 index 3608e5c0..00000000 --- a/vendor/symfony/polyfill-intl-normalizer/bootstrap.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. - */ - -use Symfony\Polyfill\Intl\Normalizer as p; - -if (\PHP_VERSION_ID >= 80000) { - return require __DIR__.'/bootstrap80.php'; -} - -if (!function_exists('normalizer_is_normalized')) { - function normalizer_is_normalized($string, $form = p\Normalizer::FORM_C) { return p\Normalizer::isNormalized($string, $form); } -} -if (!function_exists('normalizer_normalize')) { - function normalizer_normalize($string, $form = p\Normalizer::FORM_C) { return p\Normalizer::normalize($string, $form); } -} diff --git a/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php b/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php deleted file mode 100644 index e36d1a94..00000000 --- a/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Intl\Normalizer as p; - -if (!function_exists('normalizer_is_normalized')) { - function normalizer_is_normalized(?string $string, ?int $form = p\Normalizer::FORM_C): bool { return p\Normalizer::isNormalized((string) $string, (int) $form); } -} -if (!function_exists('normalizer_normalize')) { - function normalizer_normalize(?string $string, ?int $form = p\Normalizer::FORM_C): string|false { return p\Normalizer::normalize((string) $string, (int) $form); } -} diff --git a/vendor/symfony/polyfill-intl-normalizer/composer.json b/vendor/symfony/polyfill-intl-normalizer/composer.json deleted file mode 100644 index 65f72d64..00000000 --- a/vendor/symfony/polyfill-intl-normalizer/composer.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "symfony/polyfill-intl-normalizer", - "type": "library", - "description": "Symfony polyfill for intl's Normalizer class and related functions", - "keywords": ["polyfill", "shim", "compatibility", "portable", "intl", "normalizer"], - "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" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Intl\\Normalizer\\": "" }, - "files": [ "bootstrap.php" ], - "classmap": [ "Resources/stubs" ] - }, - "suggest": { - "ext-intl": "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-mbstring/LICENSE b/vendor/symfony/polyfill-mbstring/LICENSE deleted file mode 100644 index 4cd8bdd3..00000000 --- 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 bce5c4a8..00000000 --- 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%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 478b40da..00000000 --- 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 fac60b08..00000000 --- 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 2a8f6e73..00000000 --- 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 1fedd1f7..00000000 --- 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 82f5ac4d..00000000 --- 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 44895536..00000000 --- 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 4cd8bdd3..00000000 --- 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 7bf96c99..00000000 --- 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 ed190505..00000000 --- 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 b5c92d4c..00000000 --- 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-php72/composer.json b/vendor/symfony/polyfill-php72/composer.json deleted file mode 100644 index 5f17af34..00000000 --- a/vendor/symfony/polyfill-php72/composer.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "symfony/polyfill-php72", - "type": "library", - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", - "keywords": ["polyfill", "shim", "compatibility", "portable"], - "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" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Php72\\": "" }, - "files": [ "bootstrap.php" ] - }, - "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-php80/LICENSE b/vendor/symfony/polyfill-php80/LICENSE deleted file mode 100644 index 5593b1d8..00000000 --- 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 362dd1a9..00000000 --- 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 fe6e6910..00000000 --- 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 3816c559..00000000 --- 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 2b955423..00000000 --- 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 bd1212f6..00000000 --- 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 7c62d750..00000000 --- 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/UnhandledMatchError.php b/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php deleted file mode 100644 index 01c6c6c8..00000000 --- a/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.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 UnhandledMatchError extends Error - { - } -} 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 783dbc28..00000000 --- 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 e5f7dbc1..00000000 --- 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 bd9a3262..00000000 --- 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/polyfill-php81/LICENSE b/vendor/symfony/polyfill-php81/LICENSE deleted file mode 100644 index efb17f98..00000000 --- a/vendor/symfony/polyfill-php81/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2021 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/polyfill-php81/Php81.php b/vendor/symfony/polyfill-php81/Php81.php deleted file mode 100644 index f0507b76..00000000 --- a/vendor/symfony/polyfill-php81/Php81.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\Polyfill\Php81; - -/** - * @author Nicolas Grekas - * - * @internal - */ -final class Php81 -{ - public static function array_is_list(array $array): bool - { - if ([] === $array || $array === array_values($array)) { - return true; - } - - $nextKey = -1; - - foreach ($array as $k => $v) { - if ($k !== ++$nextKey) { - return false; - } - } - - return true; - } -} diff --git a/vendor/symfony/polyfill-php81/README.md b/vendor/symfony/polyfill-php81/README.md deleted file mode 100644 index 7d8dd190..00000000 --- a/vendor/symfony/polyfill-php81/README.md +++ /dev/null @@ -1,17 +0,0 @@ -Symfony Polyfill / Php81 -======================== - -This component provides features added to PHP 8.1 core: - -- [`array_is_list`](https://php.net/array_is_list) -- [`enum_exists`](https://php.net/enum-exists) -- [`MYSQLI_REFRESH_REPLICA`](https://php.net/mysqli.constants#constantmysqli-refresh-replica) constant -- [`ReturnTypeWillChange`](https://wiki.php.net/rfc/internal_method_return_types) - -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-php81/Resources/stubs/ReturnTypeWillChange.php b/vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php deleted file mode 100644 index cb7720a8..00000000 --- a/vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.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 < 80100) { - #[Attribute(Attribute::TARGET_METHOD)] - final class ReturnTypeWillChange - { - public function __construct() - { - } - } -} diff --git a/vendor/symfony/polyfill-php81/bootstrap.php b/vendor/symfony/polyfill-php81/bootstrap.php deleted file mode 100644 index 9f872e02..00000000 --- a/vendor/symfony/polyfill-php81/bootstrap.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. - */ - -use Symfony\Polyfill\Php81 as p; - -if (\PHP_VERSION_ID >= 80100) { - return; -} - -if (defined('MYSQLI_REFRESH_SLAVE') && !defined('MYSQLI_REFRESH_REPLICA')) { - define('MYSQLI_REFRESH_REPLICA', 64); -} - -if (!function_exists('array_is_list')) { - function array_is_list(array $array): bool { return p\Php81::array_is_list($array); } -} - -if (!function_exists('enum_exists')) { - function enum_exists(string $enum, bool $autoload = true): bool { return $autoload && class_exists($enum) && false; } -} diff --git a/vendor/symfony/polyfill-php81/composer.json b/vendor/symfony/polyfill-php81/composer.json deleted file mode 100644 index 149b5982..00000000 --- a/vendor/symfony/polyfill-php81/composer.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "symfony/polyfill-php81", - "type": "library", - "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", - "keywords": ["polyfill", "shim", "compatibility", "portable"], - "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" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Php81\\": "" }, - "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/polyfill-uuid/LICENSE b/vendor/symfony/polyfill-uuid/LICENSE deleted file mode 100644 index 3f853aaf..00000000 --- a/vendor/symfony/polyfill-uuid/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2018-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-uuid/README.md b/vendor/symfony/polyfill-uuid/README.md deleted file mode 100644 index df21585a..00000000 --- a/vendor/symfony/polyfill-uuid/README.md +++ /dev/null @@ -1,12 +0,0 @@ -Symfony Polyfill / Uuid -======================== - -This component provides `uuid_*` functions to users who run PHP versions without the uuid 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-uuid/Uuid.php b/vendor/symfony/polyfill-uuid/Uuid.php deleted file mode 100644 index 584095b1..00000000 --- a/vendor/symfony/polyfill-uuid/Uuid.php +++ /dev/null @@ -1,531 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Uuid; - -/** - * @internal - * - * @author Grégoire Pineau - */ -final class Uuid -{ - public const UUID_VARIANT_NCS = 0; - public const UUID_VARIANT_DCE = 1; - public const UUID_VARIANT_MICROSOFT = 2; - public const UUID_VARIANT_OTHER = 3; - public const UUID_TYPE_DEFAULT = 0; - public const UUID_TYPE_TIME = 1; - public const UUID_TYPE_MD5 = 3; - public const UUID_TYPE_DCE = 4; // Deprecated alias - public const UUID_TYPE_NAME = 1; // Deprecated alias - public const UUID_TYPE_RANDOM = 4; - public const UUID_TYPE_SHA1 = 5; - public const UUID_TYPE_NULL = -1; - public const UUID_TYPE_INVALID = -42; - - // https://tools.ietf.org/html/rfc4122#section-4.1.4 - // 0x01b21dd213814000 is the number of 100-ns intervals between the - // UUID epoch 1582-10-15 00:00:00 and the Unix epoch 1970-01-01 00:00:00. - public const TIME_OFFSET_INT = 0x01B21DD213814000; - public const TIME_OFFSET_BIN = "\x01\xb2\x1d\xd2\x13\x81\x40\x00"; - public const TIME_OFFSET_COM = "\xfe\x4d\xe2\x2d\xec\x7e\xc0\x00"; - - public static function uuid_create($uuid_type = \UUID_TYPE_DEFAULT) - { - if (!is_numeric($uuid_type) && null !== $uuid_type) { - trigger_error(sprintf('uuid_create() expects parameter 1 to be int, %s given', \gettype($uuid_type)), \E_USER_WARNING); - - return null; - } - - switch ((int) $uuid_type) { - case self::UUID_TYPE_NAME: - case self::UUID_TYPE_TIME: - return self::uuid_generate_time(); - case self::UUID_TYPE_DCE: - case self::UUID_TYPE_RANDOM: - case self::UUID_TYPE_DEFAULT: - return self::uuid_generate_random(); - default: - trigger_error(sprintf("Unknown/invalid UUID type '%d' requested, using default type instead", $uuid_type), \E_USER_WARNING); - - return self::uuid_generate_random(); - } - } - - public static function uuid_generate_md5($uuid_ns, $name) - { - if (!\is_string($uuid_ns = self::toString($uuid_ns))) { - trigger_error(sprintf('uuid_generate_md5() expects parameter 1 to be string, %s given', \gettype($uuid_ns)), \E_USER_WARNING); - - return null; - } - - if (!\is_string($name = self::toString($name))) { - trigger_error(sprintf('uuid_generate_md5() expects parameter 2 to be string, %s given', \gettype($name)), \E_USER_WARNING); - - return null; - } - - if (!self::isValid($uuid_ns)) { - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError('uuid_generate_md5(): Argument #1 ($uuid_ns) UUID expected'); - } - - $hash = md5(hex2bin(str_replace('-', '', $uuid_ns)).$name); - - return sprintf('%08s-%04s-3%03s-%04x-%012s', - // 32 bits for "time_low" - substr($hash, 0, 8), - // 16 bits for "time_mid" - substr($hash, 8, 4), - // 16 bits for "time_hi_and_version", - // four most significant bits holds version number 3 - substr($hash, 13, 3), - // 16 bits: - // * 8 bits for "clk_seq_hi_res", - // * 8 bits for "clk_seq_low", - hexdec(substr($hash, 16, 4)) & 0x3FFF | 0x8000, - // 48 bits for "node" - substr($hash, 20, 12) - ); - } - - public static function uuid_generate_sha1($uuid_ns, $name) - { - if (!\is_string($uuid_ns = self::toString($uuid_ns))) { - trigger_error(sprintf('uuid_generate_sha1() expects parameter 1 to be string, %s given', \gettype($uuid_ns)), \E_USER_WARNING); - - return null; - } - - if (!\is_string($name = self::toString($name))) { - trigger_error(sprintf('uuid_generate_sha1() expects parameter 2 to be string, %s given', \gettype($name)), \E_USER_WARNING); - - return null; - } - - if (!self::isValid($uuid_ns)) { - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError('uuid_generate_sha1(): Argument #1 ($uuid_ns) UUID expected'); - } - - $hash = sha1(hex2bin(str_replace('-', '', $uuid_ns)).$name); - - return sprintf('%08s-%04s-5%03s-%04x-%012s', - // 32 bits for "time_low" - substr($hash, 0, 8), - // 16 bits for "time_mid" - substr($hash, 8, 4), - // 16 bits for "time_hi_and_version", - // four most significant bits holds version number 5 - substr($hash, 13, 3), - // 16 bits: - // * 8 bits for "clk_seq_hi_res", - // * 8 bits for "clk_seq_low", - // WARNING: On old libuuid version, there is a bug. 0x0fff is used instead of 0x3fff - // See https://github.com/karelzak/util-linux/commit/d6ddf07d31dfdc894eb8e7e6842aa856342c526e - hexdec(substr($hash, 16, 4)) & 0x3FFF | 0x8000, - // 48 bits for "node" - substr($hash, 20, 12) - ); - } - - public static function uuid_is_valid($uuid) - { - if (!\is_string($uuid = self::toString($uuid))) { - trigger_error(sprintf('uuid_is_valid() expects parameter 1 to be string, %s given', \gettype($uuid)), \E_USER_WARNING); - - return null; - } - - return self::isValid($uuid); - } - - public static function uuid_compare($uuid1, $uuid2) - { - if (!\is_string($uuid1 = self::toString($uuid1))) { - trigger_error(sprintf('uuid_compare() expects parameter 1 to be string, %s given', \gettype($uuid1)), \E_USER_WARNING); - - return null; - } - - if (!\is_string($uuid2 = self::toString($uuid2))) { - trigger_error(sprintf('uuid_compare() expects parameter 2 to be string, %s given', \gettype($uuid2)), \E_USER_WARNING); - - return null; - } - - if (!self::isValid($uuid1)) { - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError('uuid_compare(): Argument #1 ($uuid1) UUID expected'); - } - - if (!self::isValid($uuid2)) { - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError('uuid_compare(): Argument #2 ($uuid2) UUID expected'); - } - - return strcasecmp($uuid1, $uuid2); - } - - public static function uuid_is_null($uuid) - { - if (!\is_string($uuid = self::toString($uuid))) { - trigger_error(sprintf('uuid_is_null() expects parameter 1 to be string, %s given', \gettype($uuid)), \E_USER_WARNING); - - return null; - } - if (80000 <= \PHP_VERSION_ID && !self::isValid($uuid)) { - throw new \ValueError('uuid_is_null(): Argument #1 ($uuid) UUID expected'); - } - - return '00000000-0000-0000-0000-000000000000' === $uuid; - } - - public static function uuid_type($uuid) - { - if (!\is_string($uuid = self::toString($uuid))) { - trigger_error(sprintf('uuid_type() expects parameter 1 to be string, %s given', \gettype($uuid)), \E_USER_WARNING); - - return null; - } - - if ('00000000-0000-0000-0000-000000000000' === $uuid) { - return self::UUID_TYPE_NULL; - } - - if (null === $parsed = self::parse($uuid)) { - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError('uuid_type(): Argument #1 ($uuid) UUID expected'); - } - - return $parsed['version']; - } - - public static function uuid_variant($uuid) - { - if (!\is_string($uuid = self::toString($uuid))) { - trigger_error(sprintf('uuid_variant() expects parameter 1 to be string, %s given', \gettype($uuid)), \E_USER_WARNING); - - return null; - } - - if ('00000000-0000-0000-0000-000000000000' === $uuid) { - return self::UUID_TYPE_NULL; - } - - if (null === $parsed = self::parse($uuid)) { - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError('uuid_variant(): Argument #1 ($uuid) UUID expected'); - } - - if (($parsed['clock_seq'] & 0x8000) === 0) { - return self::UUID_VARIANT_NCS; - } - if (($parsed['clock_seq'] & 0x4000) === 0) { - return self::UUID_VARIANT_DCE; - } - if (($parsed['clock_seq'] & 0x2000) === 0) { - return self::UUID_VARIANT_MICROSOFT; - } - - return self::UUID_VARIANT_OTHER; - } - - public static function uuid_time($uuid) - { - if (!\is_string($uuid = self::toString($uuid))) { - trigger_error(sprintf('uuid_time() expects parameter 1 to be string, %s given', \gettype($uuid)), \E_USER_WARNING); - - return null; - } - - $parsed = self::parse($uuid); - - if (self::UUID_TYPE_TIME !== ($parsed['version'] ?? null)) { - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError('uuid_time(): Argument #1 ($uuid) UUID DCE TIME expected'); - } - - if (\PHP_INT_SIZE >= 8) { - return intdiv(hexdec($parsed['time']) - self::TIME_OFFSET_INT, 10000000); - } - - $time = str_pad(hex2bin($parsed['time']), 8, "\0", \STR_PAD_LEFT); - $time = self::binaryAdd($time, self::TIME_OFFSET_COM); - $time[0] = $time[0] & "\x7F"; - - return (int) substr(self::toDecimal($time), 0, -7); - } - - public static function uuid_mac($uuid) - { - if (!\is_string($uuid = self::toString($uuid))) { - trigger_error(sprintf('uuid_mac() expects parameter 1 to be string, %s given', \gettype($uuid)), \E_USER_WARNING); - - return null; - } - - $parsed = self::parse($uuid); - - if (self::UUID_TYPE_TIME !== ($parsed['version'] ?? null)) { - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError('uuid_mac(): Argument #1 ($uuid) UUID DCE TIME expected'); - } - - return strtr($parsed['node'], 'ABCDEF', 'abcdef'); - } - - public static function uuid_parse($uuid) - { - if (!\is_string($uuid = self::toString($uuid))) { - trigger_error(sprintf('uuid_parse() expects parameter 1 to be string, %s given', \gettype($uuid)), \E_USER_WARNING); - - return null; - } - - if (!self::isValid($uuid)) { - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError('uuid_parse(): Argument #1 ($uuid) UUID expected'); - } - - return hex2bin(str_replace('-', '', $uuid)); - } - - public static function uuid_unparse($bytes) - { - if (!\is_string($bytes = self::toString($bytes))) { - trigger_error(sprintf('uuid_unparse() expects parameter 1 to be string, %s given', \gettype($bytes)), \E_USER_WARNING); - - return null; - } - - if (16 !== \strlen($bytes)) { - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError('uuid_unparse(): Argument #1 ($uuid) UUID expected'); - } - - $uuid = bin2hex($bytes); - $uuid = substr_replace($uuid, '-', 8, 0); - $uuid = substr_replace($uuid, '-', 13, 0); - $uuid = substr_replace($uuid, '-', 18, 0); - - return substr_replace($uuid, '-', 23, 0); - } - - private static function uuid_generate_random() - { - $uuid = bin2hex(random_bytes(16)); - - return sprintf('%08s-%04s-4%03s-%04x-%012s', - // 32 bits for "time_low" - substr($uuid, 0, 8), - // 16 bits for "time_mid" - substr($uuid, 8, 4), - // 16 bits for "time_hi_and_version", - // four most significant bits holds version number 4 - substr($uuid, 13, 3), - // 16 bits: - // * 8 bits for "clk_seq_hi_res", - // * 8 bits for "clk_seq_low", - // two most significant bits holds zero and one for variant DCE1.1 - hexdec(substr($uuid, 16, 4)) & 0x3FFF | 0x8000, - // 48 bits for "node" - substr($uuid, 20, 12) - ); - } - - /** - * @see http://tools.ietf.org/html/rfc4122#section-4.2.2 - */ - private static function uuid_generate_time() - { - $time = microtime(false); - $time = substr($time, 11).substr($time, 2, 7); - - if (\PHP_INT_SIZE >= 8) { - $time = str_pad(dechex($time + self::TIME_OFFSET_INT), 16, '0', \STR_PAD_LEFT); - } else { - $time = str_pad(self::toBinary($time), 8, "\0", \STR_PAD_LEFT); - $time = self::binaryAdd($time, self::TIME_OFFSET_BIN); - $time = bin2hex($time); - } - - // https://tools.ietf.org/html/rfc4122#section-4.1.5 - // We are using a random data for the sake of simplicity: since we are - // not able to get a super precise timeOfDay as a unique sequence - $clockSeq = random_int(0, 0x3FFF); - - static $node; - if (null === $node) { - if (\function_exists('apcu_fetch')) { - $node = apcu_fetch('__symfony_uuid_node'); - if (false === $node) { - $node = sprintf('%06x%06x', - random_int(0, 0xFFFFFF) | 0x010000, - random_int(0, 0xFFFFFF) - ); - apcu_store('__symfony_uuid_node', $node); - } - } else { - $node = sprintf('%06x%06x', - random_int(0, 0xFFFFFF) | 0x010000, - random_int(0, 0xFFFFFF) - ); - } - } - - return sprintf('%08s-%04s-1%03s-%04x-%012s', - // 32 bits for "time_low" - substr($time, -8), - - // 16 bits for "time_mid" - substr($time, -12, 4), - - // 16 bits for "time_hi_and_version", - // four most significant bits holds version number 1 - substr($time, -15, 3), - - // 16 bits: - // * 8 bits for "clk_seq_hi_res", - // * 8 bits for "clk_seq_low", - // two most significant bits holds zero and one for variant DCE1.1 - $clockSeq | 0x8000, - - // 48 bits for "node" - $node - ); - } - - private static function isValid($uuid) - { - return (bool) preg_match('{^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$}Di', $uuid); - } - - private static function parse($uuid) - { - if (!preg_match('{^(?[0-9a-f]{8})-(?[0-9a-f]{4})-(?[0-9a-f])(?[0-9a-f]{3})-(?[0-9a-f]{4})-(?[0-9a-f]{12})$}Di', $uuid, $matches)) { - return null; - } - - return [ - 'time' => '0'.$matches['time_hi'].$matches['time_mid'].$matches['time_low'], - 'version' => hexdec($matches['version']), - 'clock_seq' => hexdec($matches['clock_seq']), - 'node' => $matches['node'], - ]; - } - - private static function toString($v) - { - if (\is_string($v) || null === $v || (\is_object($v) ? method_exists($v, '__toString') : \is_scalar($v))) { - return (string) $v; - } - - return $v; - } - - private static function toBinary($digits) - { - $bytes = ''; - $count = \strlen($digits); - - while ($count) { - $quotient = []; - $remainder = 0; - - for ($i = 0; $i !== $count; ++$i) { - $carry = $digits[$i] + $remainder * 10; - $digit = $carry >> 8; - $remainder = $carry & 0xFF; - - if ($digit || $quotient) { - $quotient[] = $digit; - } - } - - $bytes = \chr($remainder).$bytes; - $count = \count($digits = $quotient); - } - - return $bytes; - } - - private static function toDecimal($bytes) - { - $digits = ''; - $bytes = array_values(unpack('C*', $bytes)); - - while ($count = \count($bytes)) { - $quotient = []; - $remainder = 0; - - for ($i = 0; $i !== $count; ++$i) { - $carry = $bytes[$i] + ($remainder << 8); - $digit = (int) ($carry / 10); - $remainder = $carry % 10; - - if ($digit || $quotient) { - $quotient[] = $digit; - } - } - - $digits = $remainder.$digits; - $bytes = $quotient; - } - - return $digits; - } - - private static function binaryAdd($a, $b) - { - $sum = 0; - for ($i = 7; 0 <= $i; --$i) { - $sum += \ord($a[$i]) + \ord($b[$i]); - $a[$i] = \chr($sum & 0xFF); - $sum >>= 8; - } - - return $a; - } -} diff --git a/vendor/symfony/polyfill-uuid/bootstrap.php b/vendor/symfony/polyfill-uuid/bootstrap.php deleted file mode 100644 index 6d8545b3..00000000 --- a/vendor/symfony/polyfill-uuid/bootstrap.php +++ /dev/null @@ -1,97 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Uuid as p; - -if (extension_loaded('uuid')) { - return; -} - -if (\PHP_VERSION_ID >= 80000) { - return require __DIR__.'/bootstrap80.php'; -} - -if (!defined('UUID_VARIANT_NCS')) { - define('UUID_VARIANT_NCS', 0); -} -if (!defined('UUID_VARIANT_DCE')) { - define('UUID_VARIANT_DCE', 1); -} -if (!defined('UUID_VARIANT_MICROSOFT')) { - define('UUID_VARIANT_MICROSOFT', 2); -} -if (!defined('UUID_VARIANT_OTHER')) { - define('UUID_VARIANT_OTHER', 3); -} -if (!defined('UUID_TYPE_DEFAULT')) { - define('UUID_TYPE_DEFAULT', 0); -} -if (!defined('UUID_TYPE_TIME')) { - define('UUID_TYPE_TIME', 1); -} -if (!defined('UUID_TYPE_MD5')) { - define('UUID_TYPE_MD5', 3); -} -if (!defined('UUID_TYPE_DCE')) { - define('UUID_TYPE_DCE', 4); // Deprecated alias -} -if (!defined('UUID_TYPE_NAME')) { - define('UUID_TYPE_NAME', 1); // Deprecated alias -} -if (!defined('UUID_TYPE_RANDOM')) { - define('UUID_TYPE_RANDOM', 4); -} -if (!defined('UUID_TYPE_SHA1')) { - define('UUID_TYPE_SHA1', 5); -} -if (!defined('UUID_TYPE_NULL')) { - define('UUID_TYPE_NULL', -1); -} -if (!defined('UUID_TYPE_INVALID')) { - define('UUID_TYPE_INVALID', -42); -} - -if (!function_exists('uuid_create')) { - function uuid_create($uuid_type = \UUID_TYPE_DEFAULT) { return p\Uuid::uuid_create($uuid_type); } -} -if (!function_exists('uuid_generate_md5')) { - function uuid_generate_md5($uuid_ns, $name) { return p\Uuid::uuid_generate_md5($uuid_ns, $name); } -} -if (!function_exists('uuid_generate_sha1')) { - function uuid_generate_sha1($uuid_ns, $name) { return p\Uuid::uuid_generate_sha1($uuid_ns, $name); } -} -if (!function_exists('uuid_is_valid')) { - function uuid_is_valid($uuid) { return p\Uuid::uuid_is_valid($uuid); } -} -if (!function_exists('uuid_compare')) { - function uuid_compare($uuid1, $uuid2) { return p\Uuid::uuid_compare($uuid1, $uuid2); } -} -if (!function_exists('uuid_is_null')) { - function uuid_is_null($uuid) { return p\Uuid::uuid_is_null($uuid); } -} -if (!function_exists('uuid_type')) { - function uuid_type($uuid) { return p\Uuid::uuid_type($uuid); } -} -if (!function_exists('uuid_variant')) { - function uuid_variant($uuid) { return p\Uuid::uuid_variant($uuid); } -} -if (!function_exists('uuid_time')) { - function uuid_time($uuid) { return p\Uuid::uuid_time($uuid); } -} -if (!function_exists('uuid_mac')) { - function uuid_mac($uuid) { return p\Uuid::uuid_mac($uuid); } -} -if (!function_exists('uuid_parse')) { - function uuid_parse($uuid) { return p\Uuid::uuid_parse($uuid); } -} -if (!function_exists('uuid_unparse')) { - function uuid_unparse($uuid) { return p\Uuid::uuid_unparse($uuid); } -} diff --git a/vendor/symfony/polyfill-uuid/bootstrap80.php b/vendor/symfony/polyfill-uuid/bootstrap80.php deleted file mode 100644 index d6c592fe..00000000 --- a/vendor/symfony/polyfill-uuid/bootstrap80.php +++ /dev/null @@ -1,89 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Uuid as p; - -if (!defined('UUID_VARIANT_NCS')) { - define('UUID_VARIANT_NCS', 0); -} -if (!defined('UUID_VARIANT_DCE')) { - define('UUID_VARIANT_DCE', 1); -} -if (!defined('UUID_VARIANT_MICROSOFT')) { - define('UUID_VARIANT_MICROSOFT', 2); -} -if (!defined('UUID_VARIANT_OTHER')) { - define('UUID_VARIANT_OTHER', 3); -} -if (!defined('UUID_TYPE_DEFAULT')) { - define('UUID_TYPE_DEFAULT', 0); -} -if (!defined('UUID_TYPE_TIME')) { - define('UUID_TYPE_TIME', 1); -} -if (!defined('UUID_TYPE_MD5')) { - define('UUID_TYPE_MD5', 3); -} -if (!defined('UUID_TYPE_DCE')) { - define('UUID_TYPE_DCE', 4); // Deprecated alias -} -if (!defined('UUID_TYPE_NAME')) { - define('UUID_TYPE_NAME', 1); // Deprecated alias -} -if (!defined('UUID_TYPE_RANDOM')) { - define('UUID_TYPE_RANDOM', 4); -} -if (!defined('UUID_TYPE_SHA1')) { - define('UUID_TYPE_SHA1', 5); -} -if (!defined('UUID_TYPE_NULL')) { - define('UUID_TYPE_NULL', -1); -} -if (!defined('UUID_TYPE_INVALID')) { - define('UUID_TYPE_INVALID', -42); -} - -if (!function_exists('uuid_create')) { - function uuid_create(?int $uuid_type = \UUID_TYPE_DEFAULT): string { return p\Uuid::uuid_create((int) $uuid_type); } -} -if (!function_exists('uuid_generate_md5')) { - function uuid_generate_md5(?string $uuid_ns, ?string $name): string { return p\Uuid::uuid_generate_md5((string) $uuid_ns, (string) $name); } -} -if (!function_exists('uuid_generate_sha1')) { - function uuid_generate_sha1(?string $uuid_ns, ?string $name): string { return p\Uuid::uuid_generate_sha1((string) $uuid_ns, (string) $name); } -} -if (!function_exists('uuid_is_valid')) { - function uuid_is_valid(?string $uuid): bool { return p\Uuid::uuid_is_valid((string) $uuid); } -} -if (!function_exists('uuid_compare')) { - function uuid_compare(?string $uuid1, ?string $uuid2): int { return p\Uuid::uuid_compare((string) $uuid1, (string) $uuid2); } -} -if (!function_exists('uuid_is_null')) { - function uuid_is_null(?string $uuid): bool { return p\Uuid::uuid_is_null((string) $uuid); } -} -if (!function_exists('uuid_type')) { - function uuid_type(?string $uuid): int { return p\Uuid::uuid_type((string) $uuid); } -} -if (!function_exists('uuid_variant')) { - function uuid_variant(?string $uuid): int { return p\Uuid::uuid_variant((string) $uuid); } -} -if (!function_exists('uuid_time')) { - function uuid_time(?string $uuid): int { return p\Uuid::uuid_time((string) $uuid); } -} -if (!function_exists('uuid_mac')) { - function uuid_mac(?string $uuid): string { return p\Uuid::uuid_mac((string) $uuid); } -} -if (!function_exists('uuid_parse')) { - function uuid_parse(?string $uuid): string { return p\Uuid::uuid_parse((string) $uuid); } -} -if (!function_exists('uuid_unparse')) { - function uuid_unparse(?string $uuid): string { return p\Uuid::uuid_unparse((string) $uuid); } -} diff --git a/vendor/symfony/polyfill-uuid/composer.json b/vendor/symfony/polyfill-uuid/composer.json deleted file mode 100644 index bb346911..00000000 --- a/vendor/symfony/polyfill-uuid/composer.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "symfony/polyfill-uuid", - "type": "library", - "description": "Symfony polyfill for uuid functions", - "keywords": ["polyfill", "compatibility", "portable", "uuid"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Grégoire Pineau", - "email": "lyrixx@lyrixx.info" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-uuid": "*" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Uuid\\": "" }, - "files": [ "bootstrap.php" ] - }, - "suggest": { - "ext-uuid": "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/process/CHANGELOG.md b/vendor/symfony/process/CHANGELOG.md deleted file mode 100644 index 31b9ee6a..00000000 --- a/vendor/symfony/process/CHANGELOG.md +++ /dev/null @@ -1,116 +0,0 @@ -CHANGELOG -========= - -5.2.0 ------ - - * added `Process::setOptions()` to set `Process` specific options - * added option `create_new_console` to allow a subprocess to continue - to run after the main script exited, both on Linux and on Windows - -5.1.0 ------ - - * added `Process::getStartTime()` to retrieve the start time of the process as float - -5.0.0 ------ - - * removed `Process::inheritEnvironmentVariables()` - * removed `PhpProcess::setPhpBinary()` - * `Process` must be instantiated with a command array, use `Process::fromShellCommandline()` when the command should be parsed by the shell - * removed `Process::setCommandLine()` - -4.4.0 ------ - - * deprecated `Process::inheritEnvironmentVariables()`: env variables are always inherited. - * added `Process::getLastOutputTime()` method - -4.2.0 ------ - - * added the `Process::fromShellCommandline()` to run commands in a shell wrapper - * deprecated passing a command as string when creating a `Process` instance - * deprecated the `Process::setCommandline()` and the `PhpProcess::setPhpBinary()` methods - * added the `Process::waitUntil()` method to wait for the process only for a - specific output, then continue the normal execution of your application - -4.1.0 ------ - - * added the `Process::isTtySupported()` method that allows to check for TTY support - * made `PhpExecutableFinder` look for the `PHP_BINARY` env var when searching the php binary - * added the `ProcessSignaledException` class to properly catch signaled process errors - -4.0.0 ------ - - * environment variables will always be inherited - * added a second `array $env = []` argument to the `start()`, `run()`, - `mustRun()`, and `restart()` methods of the `Process` class - * added a second `array $env = []` argument to the `start()` method of the - `PhpProcess` class - * the `ProcessUtils::escapeArgument()` method has been removed - * the `areEnvironmentVariablesInherited()`, `getOptions()`, and `setOptions()` - methods of the `Process` class have been removed - * support for passing `proc_open()` options has been removed - * removed the `ProcessBuilder` class, use the `Process` class instead - * removed the `getEnhanceWindowsCompatibility()` and `setEnhanceWindowsCompatibility()` methods of the `Process` class - * passing a not existing working directory to the constructor of the `Symfony\Component\Process\Process` class is not - supported anymore - -3.4.0 ------ - - * deprecated the ProcessBuilder class - * deprecated calling `Process::start()` without setting a valid working directory beforehand (via `setWorkingDirectory()` or constructor) - -3.3.0 ------ - - * added command line arrays in the `Process` class - * added `$env` argument to `Process::start()`, `run()`, `mustRun()` and `restart()` methods - * deprecated the `ProcessUtils::escapeArgument()` method - * deprecated not inheriting environment variables - * deprecated configuring `proc_open()` options - * deprecated configuring enhanced Windows compatibility - * deprecated configuring enhanced sigchild compatibility - -2.5.0 ------ - - * added support for PTY mode - * added the convenience method "mustRun" - * deprecation: Process::setStdin() is deprecated in favor of Process::setInput() - * deprecation: Process::getStdin() is deprecated in favor of Process::getInput() - * deprecation: Process::setInput() and ProcessBuilder::setInput() do not accept non-scalar types - -2.4.0 ------ - - * added the ability to define an idle timeout - -2.3.0 ------ - - * added ProcessUtils::escapeArgument() to fix the bug in escapeshellarg() function on Windows - * added Process::signal() - * added Process::getPid() - * added support for a TTY mode - -2.2.0 ------ - - * added ProcessBuilder::setArguments() to reset the arguments on a builder - * added a way to retrieve the standard and error output incrementally - * added Process:restart() - -2.1.0 ------ - - * added support for non-blocking processes (start(), wait(), isRunning(), stop()) - * enhanced Windows compatibility - * added Process::getExitCodeText() that returns a string representation for - the exit code returned by the process - * added ProcessBuilder diff --git a/vendor/symfony/process/Exception/ExceptionInterface.php b/vendor/symfony/process/Exception/ExceptionInterface.php deleted file mode 100644 index bd4a6040..00000000 --- a/vendor/symfony/process/Exception/ExceptionInterface.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Exception; - -/** - * Marker Interface for the Process Component. - * - * @author Johannes M. Schmitt - */ -interface ExceptionInterface extends \Throwable -{ -} diff --git a/vendor/symfony/process/Exception/InvalidArgumentException.php b/vendor/symfony/process/Exception/InvalidArgumentException.php deleted file mode 100644 index 926ee211..00000000 --- a/vendor/symfony/process/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Exception; - -/** - * InvalidArgumentException for the Process Component. - * - * @author Romain Neutron - */ -class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/process/Exception/LogicException.php b/vendor/symfony/process/Exception/LogicException.php deleted file mode 100644 index be3d490d..00000000 --- a/vendor/symfony/process/Exception/LogicException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Exception; - -/** - * LogicException for the Process Component. - * - * @author Romain Neutron - */ -class LogicException extends \LogicException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/process/Exception/ProcessFailedException.php b/vendor/symfony/process/Exception/ProcessFailedException.php deleted file mode 100644 index 328acfde..00000000 --- a/vendor/symfony/process/Exception/ProcessFailedException.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Exception; - -use Symfony\Component\Process\Process; - -/** - * Exception for failed processes. - * - * @author Johannes M. Schmitt - */ -class ProcessFailedException extends RuntimeException -{ - private $process; - - public function __construct(Process $process) - { - if ($process->isSuccessful()) { - throw new InvalidArgumentException('Expected a failed process, but the given process was successful.'); - } - - $error = sprintf('The command "%s" failed.'."\n\nExit Code: %s(%s)\n\nWorking directory: %s", - $process->getCommandLine(), - $process->getExitCode(), - $process->getExitCodeText(), - $process->getWorkingDirectory() - ); - - if (!$process->isOutputDisabled()) { - $error .= sprintf("\n\nOutput:\n================\n%s\n\nError Output:\n================\n%s", - $process->getOutput(), - $process->getErrorOutput() - ); - } - - parent::__construct($error); - - $this->process = $process; - } - - public function getProcess() - { - return $this->process; - } -} diff --git a/vendor/symfony/process/Exception/ProcessSignaledException.php b/vendor/symfony/process/Exception/ProcessSignaledException.php deleted file mode 100644 index d4d32275..00000000 --- a/vendor/symfony/process/Exception/ProcessSignaledException.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Exception; - -use Symfony\Component\Process\Process; - -/** - * Exception that is thrown when a process has been signaled. - * - * @author Sullivan Senechal - */ -final class ProcessSignaledException extends RuntimeException -{ - private $process; - - public function __construct(Process $process) - { - $this->process = $process; - - parent::__construct(sprintf('The process has been signaled with signal "%s".', $process->getTermSignal())); - } - - public function getProcess(): Process - { - return $this->process; - } - - public function getSignal(): int - { - return $this->getProcess()->getTermSignal(); - } -} diff --git a/vendor/symfony/process/Exception/ProcessTimedOutException.php b/vendor/symfony/process/Exception/ProcessTimedOutException.php deleted file mode 100644 index b052d72c..00000000 --- a/vendor/symfony/process/Exception/ProcessTimedOutException.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\Process\Exception; - -use Symfony\Component\Process\Process; - -/** - * Exception that is thrown when a process times out. - * - * @author Johannes M. Schmitt - */ -class ProcessTimedOutException extends RuntimeException -{ - public const TYPE_GENERAL = 1; - public const TYPE_IDLE = 2; - - private $process; - private $timeoutType; - - public function __construct(Process $process, int $timeoutType) - { - $this->process = $process; - $this->timeoutType = $timeoutType; - - parent::__construct(sprintf( - 'The process "%s" exceeded the timeout of %s seconds.', - $process->getCommandLine(), - $this->getExceededTimeout() - )); - } - - public function getProcess() - { - return $this->process; - } - - public function isGeneralTimeout() - { - return self::TYPE_GENERAL === $this->timeoutType; - } - - public function isIdleTimeout() - { - return self::TYPE_IDLE === $this->timeoutType; - } - - public function getExceededTimeout() - { - return match ($this->timeoutType) { - self::TYPE_GENERAL => $this->process->getTimeout(), - self::TYPE_IDLE => $this->process->getIdleTimeout(), - default => throw new \LogicException(sprintf('Unknown timeout type "%d".', $this->timeoutType)), - }; - } -} diff --git a/vendor/symfony/process/Exception/RuntimeException.php b/vendor/symfony/process/Exception/RuntimeException.php deleted file mode 100644 index adead253..00000000 --- a/vendor/symfony/process/Exception/RuntimeException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Exception; - -/** - * RuntimeException for the Process Component. - * - * @author Johannes M. Schmitt - */ -class RuntimeException extends \RuntimeException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/process/ExecutableFinder.php b/vendor/symfony/process/ExecutableFinder.php deleted file mode 100644 index d9d11102..00000000 --- a/vendor/symfony/process/ExecutableFinder.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\Process; - -/** - * Generic executable finder. - * - * @author Fabien Potencier - * @author Johannes M. Schmitt - */ -class ExecutableFinder -{ - private $suffixes = ['.exe', '.bat', '.cmd', '.com']; - - /** - * Replaces default suffixes of executable. - */ - public function setSuffixes(array $suffixes) - { - $this->suffixes = $suffixes; - } - - /** - * Adds new possible suffix to check for executable. - */ - public function addSuffix(string $suffix) - { - $this->suffixes[] = $suffix; - } - - /** - * Finds an executable by name. - * - * @param string $name The executable name (without the extension) - * @param string|null $default The default to return if no executable is found - * @param array $extraDirs Additional dirs to check into - */ - public function find(string $name, string $default = null, array $extraDirs = []): ?string - { - if (\ini_get('open_basedir')) { - $searchPath = array_merge(explode(\PATH_SEPARATOR, \ini_get('open_basedir')), $extraDirs); - $dirs = []; - foreach ($searchPath as $path) { - // Silencing against https://bugs.php.net/69240 - if (@is_dir($path)) { - $dirs[] = $path; - } else { - if (basename($path) == $name && @is_executable($path)) { - return $path; - } - } - } - } else { - $dirs = array_merge( - explode(\PATH_SEPARATOR, getenv('PATH') ?: getenv('Path')), - $extraDirs - ); - } - - $suffixes = ['']; - if ('\\' === \DIRECTORY_SEPARATOR) { - $pathExt = getenv('PATHEXT'); - $suffixes = array_merge($pathExt ? explode(\PATH_SEPARATOR, $pathExt) : $this->suffixes, $suffixes); - } - foreach ($suffixes as $suffix) { - foreach ($dirs as $dir) { - if (@is_file($file = $dir.\DIRECTORY_SEPARATOR.$name.$suffix) && ('\\' === \DIRECTORY_SEPARATOR || @is_executable($file))) { - return $file; - } - } - } - - return $default; - } -} diff --git a/vendor/symfony/process/InputStream.php b/vendor/symfony/process/InputStream.php deleted file mode 100644 index b8682bae..00000000 --- a/vendor/symfony/process/InputStream.php +++ /dev/null @@ -1,92 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process; - -use Symfony\Component\Process\Exception\RuntimeException; - -/** - * Provides a way to continuously write to the input of a Process until the InputStream is closed. - * - * @author Nicolas Grekas - * - * @implements \IteratorAggregate - */ -class InputStream implements \IteratorAggregate -{ - /** @var callable|null */ - private $onEmpty = null; - private $input = []; - private $open = true; - - /** - * Sets a callback that is called when the write buffer becomes empty. - */ - public function onEmpty(callable $onEmpty = null) - { - $this->onEmpty = $onEmpty; - } - - /** - * Appends an input to the write buffer. - * - * @param resource|string|int|float|bool|\Traversable|null $input The input to append as scalar, - * stream resource or \Traversable - */ - public function write(mixed $input) - { - if (null === $input) { - return; - } - if ($this->isClosed()) { - throw new RuntimeException(sprintf('"%s" is closed.', static::class)); - } - $this->input[] = ProcessUtils::validateInput(__METHOD__, $input); - } - - /** - * Closes the write buffer. - */ - public function close() - { - $this->open = false; - } - - /** - * Tells whether the write buffer is closed or not. - */ - public function isClosed() - { - return !$this->open; - } - - public function getIterator(): \Traversable - { - $this->open = true; - - while ($this->open || $this->input) { - if (!$this->input) { - yield ''; - continue; - } - $current = array_shift($this->input); - - if ($current instanceof \Iterator) { - yield from $current; - } else { - yield $current; - } - if (!$this->input && $this->open && null !== $onEmpty = $this->onEmpty) { - $this->write($onEmpty($this)); - } - } - } -} diff --git a/vendor/symfony/process/LICENSE b/vendor/symfony/process/LICENSE deleted file mode 100644 index 88bf75bb..00000000 --- a/vendor/symfony/process/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2022 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/process/PhpExecutableFinder.php b/vendor/symfony/process/PhpExecutableFinder.php deleted file mode 100644 index 3fab03e3..00000000 --- a/vendor/symfony/process/PhpExecutableFinder.php +++ /dev/null @@ -1,99 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process; - -/** - * An executable finder specifically designed for the PHP executable. - * - * @author Fabien Potencier - * @author Johannes M. Schmitt - */ -class PhpExecutableFinder -{ - private $executableFinder; - - public function __construct() - { - $this->executableFinder = new ExecutableFinder(); - } - - /** - * Finds The PHP executable. - */ - public function find(bool $includeArgs = true): string|false - { - if ($php = getenv('PHP_BINARY')) { - if (!is_executable($php)) { - $command = '\\' === \DIRECTORY_SEPARATOR ? 'where' : 'command -v'; - if ($php = strtok(exec($command.' '.escapeshellarg($php)), \PHP_EOL)) { - if (!is_executable($php)) { - return false; - } - } else { - return false; - } - } - - if (@is_dir($php)) { - return false; - } - - return $php; - } - - $args = $this->findArguments(); - $args = $includeArgs && $args ? ' '.implode(' ', $args) : ''; - - // PHP_BINARY return the current sapi executable - if (\PHP_BINARY && \in_array(\PHP_SAPI, ['cgi-fcgi', 'cli', 'cli-server', 'phpdbg'], true)) { - return \PHP_BINARY.$args; - } - - if ($php = getenv('PHP_PATH')) { - if (!@is_executable($php) || @is_dir($php)) { - return false; - } - - return $php; - } - - if ($php = getenv('PHP_PEAR_PHP_BIN')) { - if (@is_executable($php) && !@is_dir($php)) { - return $php; - } - } - - if (@is_executable($php = \PHP_BINDIR.('\\' === \DIRECTORY_SEPARATOR ? '\\php.exe' : '/php')) && !@is_dir($php)) { - return $php; - } - - $dirs = [\PHP_BINDIR]; - if ('\\' === \DIRECTORY_SEPARATOR) { - $dirs[] = 'C:\xampp\php\\'; - } - - return $this->executableFinder->find('php', false, $dirs); - } - - /** - * Finds the PHP executable arguments. - */ - public function findArguments(): array - { - $arguments = []; - if ('phpdbg' === \PHP_SAPI) { - $arguments[] = '-qrr'; - } - - return $arguments; - } -} diff --git a/vendor/symfony/process/PhpProcess.php b/vendor/symfony/process/PhpProcess.php deleted file mode 100644 index 486bc1da..00000000 --- a/vendor/symfony/process/PhpProcess.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\Process; - -use Symfony\Component\Process\Exception\LogicException; -use Symfony\Component\Process\Exception\RuntimeException; - -/** - * PhpProcess runs a PHP script in an independent process. - * - * $p = new PhpProcess(''); - * $p->run(); - * print $p->getOutput()."\n"; - * - * @author Fabien Potencier - */ -class PhpProcess extends Process -{ - /** - * @param string $script The PHP script to run (as a string) - * @param string|null $cwd The working directory or null to use the working dir of the current PHP process - * @param array|null $env The environment variables or null to use the same environment as the current PHP process - * @param int $timeout The timeout in seconds - * @param array|null $php Path to the PHP binary to use with any additional arguments - */ - public function __construct(string $script, string $cwd = null, array $env = null, int $timeout = 60, array $php = null) - { - if (null === $php) { - $executableFinder = new PhpExecutableFinder(); - $php = $executableFinder->find(false); - $php = false === $php ? null : array_merge([$php], $executableFinder->findArguments()); - } - if ('phpdbg' === \PHP_SAPI) { - $file = tempnam(sys_get_temp_dir(), 'dbg'); - file_put_contents($file, $script); - register_shutdown_function('unlink', $file); - $php[] = $file; - $script = null; - } - - parent::__construct($php, $cwd, $env, $script, $timeout); - } - - public static function fromShellCommandline(string $command, string $cwd = null, array $env = null, mixed $input = null, ?float $timeout = 60): static - { - throw new LogicException(sprintf('The "%s()" method cannot be called when using "%s".', __METHOD__, self::class)); - } - - public function start(callable $callback = null, array $env = []) - { - if (null === $this->getCommandLine()) { - throw new RuntimeException('Unable to find the PHP executable.'); - } - - parent::start($callback, $env); - } -} diff --git a/vendor/symfony/process/Pipes/AbstractPipes.php b/vendor/symfony/process/Pipes/AbstractPipes.php deleted file mode 100644 index 51d3af0b..00000000 --- a/vendor/symfony/process/Pipes/AbstractPipes.php +++ /dev/null @@ -1,177 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Pipes; - -use Symfony\Component\Process\Exception\InvalidArgumentException; - -/** - * @author Romain Neutron - * - * @internal - */ -abstract class AbstractPipes implements PipesInterface -{ - public array $pipes = []; - - private $inputBuffer = ''; - private $input; - private $blocked = true; - private $lastError; - - /** - * @param resource|string|int|float|bool|\Iterator|null $input - */ - public function __construct(mixed $input) - { - if (\is_resource($input) || $input instanceof \Iterator) { - $this->input = $input; - } elseif (\is_string($input)) { - $this->inputBuffer = $input; - } else { - $this->inputBuffer = (string) $input; - } - } - - public function close() - { - foreach ($this->pipes as $pipe) { - if (\is_resource($pipe)) { - fclose($pipe); - } - } - $this->pipes = []; - } - - /** - * Returns true if a system call has been interrupted. - */ - protected function hasSystemCallBeenInterrupted(): bool - { - $lastError = $this->lastError; - $this->lastError = null; - - // stream_select returns false when the `select` system call is interrupted by an incoming signal - return null !== $lastError && false !== stripos($lastError, 'interrupted system call'); - } - - /** - * Unblocks streams. - */ - protected function unblock() - { - if (!$this->blocked) { - return; - } - - foreach ($this->pipes as $pipe) { - stream_set_blocking($pipe, 0); - } - if (\is_resource($this->input)) { - stream_set_blocking($this->input, 0); - } - - $this->blocked = false; - } - - /** - * Writes input to stdin. - * - * @throws InvalidArgumentException When an input iterator yields a non supported value - */ - protected function write(): ?array - { - if (!isset($this->pipes[0])) { - return null; - } - $input = $this->input; - - if ($input instanceof \Iterator) { - if (!$input->valid()) { - $input = null; - } elseif (\is_resource($input = $input->current())) { - stream_set_blocking($input, 0); - } elseif (!isset($this->inputBuffer[0])) { - if (!\is_string($input)) { - if (!\is_scalar($input)) { - throw new InvalidArgumentException(sprintf('"%s" yielded a value of type "%s", but only scalars and stream resources are supported.', get_debug_type($this->input), get_debug_type($input))); - } - $input = (string) $input; - } - $this->inputBuffer = $input; - $this->input->next(); - $input = null; - } else { - $input = null; - } - } - - $r = $e = []; - $w = [$this->pipes[0]]; - - // let's have a look if something changed in streams - if (false === @stream_select($r, $w, $e, 0, 0)) { - return null; - } - - foreach ($w as $stdin) { - if (isset($this->inputBuffer[0])) { - $written = fwrite($stdin, $this->inputBuffer); - $this->inputBuffer = substr($this->inputBuffer, $written); - if (isset($this->inputBuffer[0])) { - return [$this->pipes[0]]; - } - } - - if ($input) { - while (true) { - $data = fread($input, self::CHUNK_SIZE); - if (!isset($data[0])) { - break; - } - $written = fwrite($stdin, $data); - $data = substr($data, $written); - if (isset($data[0])) { - $this->inputBuffer = $data; - - return [$this->pipes[0]]; - } - } - if (feof($input)) { - if ($this->input instanceof \Iterator) { - $this->input->next(); - } else { - $this->input = null; - } - } - } - } - - // no input to read on resource, buffer is empty - if (!isset($this->inputBuffer[0]) && !($this->input instanceof \Iterator ? $this->input->valid() : $this->input)) { - $this->input = null; - fclose($this->pipes[0]); - unset($this->pipes[0]); - } elseif (!$w) { - return [$this->pipes[0]]; - } - - return null; - } - - /** - * @internal - */ - public function handleError(int $type, string $msg) - { - $this->lastError = $msg; - } -} diff --git a/vendor/symfony/process/Pipes/PipesInterface.php b/vendor/symfony/process/Pipes/PipesInterface.php deleted file mode 100644 index 50eb5c47..00000000 --- a/vendor/symfony/process/Pipes/PipesInterface.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Pipes; - -/** - * PipesInterface manages descriptors and pipes for the use of proc_open. - * - * @author Romain Neutron - * - * @internal - */ -interface PipesInterface -{ - public const CHUNK_SIZE = 16384; - - /** - * Returns an array of descriptors for the use of proc_open. - */ - public function getDescriptors(): array; - - /** - * Returns an array of filenames indexed by their related stream in case these pipes use temporary files. - * - * @return string[] - */ - public function getFiles(): array; - - /** - * Reads data in file handles and pipes. - * - * @param bool $blocking Whether to use blocking calls or not - * @param bool $close Whether to close pipes if they've reached EOF - * - * @return string[] An array of read data indexed by their fd - */ - public function readAndWrite(bool $blocking, bool $close = false): array; - - /** - * Returns if the current state has open file handles or pipes. - */ - public function areOpen(): bool; - - /** - * Returns if pipes are able to read output. - */ - public function haveReadSupport(): bool; - - /** - * Closes file handles and pipes. - */ - public function close(); -} diff --git a/vendor/symfony/process/Pipes/UnixPipes.php b/vendor/symfony/process/Pipes/UnixPipes.php deleted file mode 100644 index aba0efce..00000000 --- a/vendor/symfony/process/Pipes/UnixPipes.php +++ /dev/null @@ -1,148 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Pipes; - -use Symfony\Component\Process\Process; - -/** - * UnixPipes implementation uses unix pipes as handles. - * - * @author Romain Neutron - * - * @internal - */ -class UnixPipes extends AbstractPipes -{ - private $ttyMode; - private $ptyMode; - private $haveReadSupport; - - public function __construct(?bool $ttyMode, bool $ptyMode, mixed $input, bool $haveReadSupport) - { - $this->ttyMode = $ttyMode; - $this->ptyMode = $ptyMode; - $this->haveReadSupport = $haveReadSupport; - - parent::__construct($input); - } - - public function __sleep(): array - { - throw new \BadMethodCallException('Cannot serialize '.__CLASS__); - } - - public function __wakeup() - { - throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); - } - - public function __destruct() - { - $this->close(); - } - - public function getDescriptors(): array - { - if (!$this->haveReadSupport) { - $nullstream = fopen('/dev/null', 'c'); - - return [ - ['pipe', 'r'], - $nullstream, - $nullstream, - ]; - } - - if ($this->ttyMode) { - return [ - ['file', '/dev/tty', 'r'], - ['file', '/dev/tty', 'w'], - ['file', '/dev/tty', 'w'], - ]; - } - - if ($this->ptyMode && Process::isPtySupported()) { - return [ - ['pty'], - ['pty'], - ['pty'], - ]; - } - - return [ - ['pipe', 'r'], - ['pipe', 'w'], // stdout - ['pipe', 'w'], // stderr - ]; - } - - public function getFiles(): array - { - return []; - } - - public function readAndWrite(bool $blocking, bool $close = false): array - { - $this->unblock(); - $w = $this->write(); - - $read = $e = []; - $r = $this->pipes; - unset($r[0]); - - // let's have a look if something changed in streams - set_error_handler($this->handleError(...)); - if (($r || $w) && false === stream_select($r, $w, $e, 0, $blocking ? Process::TIMEOUT_PRECISION * 1E6 : 0)) { - restore_error_handler(); - // if a system call has been interrupted, forget about it, let's try again - // otherwise, an error occurred, let's reset pipes - if (!$this->hasSystemCallBeenInterrupted()) { - $this->pipes = []; - } - - return $read; - } - restore_error_handler(); - - foreach ($r as $pipe) { - // prior PHP 5.4 the array passed to stream_select is modified and - // lose key association, we have to find back the key - $read[$type = array_search($pipe, $this->pipes, true)] = ''; - - do { - $data = @fread($pipe, self::CHUNK_SIZE); - $read[$type] .= $data; - } while (isset($data[0]) && ($close || isset($data[self::CHUNK_SIZE - 1]))); - - if (!isset($read[$type][0])) { - unset($read[$type]); - } - - if ($close && feof($pipe)) { - fclose($pipe); - unset($this->pipes[$type]); - } - } - - return $read; - } - - public function haveReadSupport(): bool - { - return $this->haveReadSupport; - } - - public function areOpen(): bool - { - return (bool) $this->pipes; - } -} diff --git a/vendor/symfony/process/Pipes/WindowsPipes.php b/vendor/symfony/process/Pipes/WindowsPipes.php deleted file mode 100644 index 9f4dedb2..00000000 --- a/vendor/symfony/process/Pipes/WindowsPipes.php +++ /dev/null @@ -1,186 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Pipes; - -use Symfony\Component\Process\Exception\RuntimeException; -use Symfony\Component\Process\Process; - -/** - * WindowsPipes implementation uses temporary files as handles. - * - * @see https://bugs.php.net/51800 - * @see https://bugs.php.net/65650 - * - * @author Romain Neutron - * - * @internal - */ -class WindowsPipes extends AbstractPipes -{ - private $files = []; - private $fileHandles = []; - private $lockHandles = []; - private $readBytes = [ - Process::STDOUT => 0, - Process::STDERR => 0, - ]; - private $haveReadSupport; - - public function __construct(mixed $input, bool $haveReadSupport) - { - $this->haveReadSupport = $haveReadSupport; - - if ($this->haveReadSupport) { - // Fix for PHP bug #51800: reading from STDOUT pipe hangs forever on Windows if the output is too big. - // Workaround for this problem is to use temporary files instead of pipes on Windows platform. - // - // @see https://bugs.php.net/51800 - $pipes = [ - Process::STDOUT => Process::OUT, - Process::STDERR => Process::ERR, - ]; - $tmpDir = sys_get_temp_dir(); - $lastError = 'unknown reason'; - set_error_handler(function ($type, $msg) use (&$lastError) { $lastError = $msg; }); - for ($i = 0;; ++$i) { - foreach ($pipes as $pipe => $name) { - $file = sprintf('%s\\sf_proc_%02X.%s', $tmpDir, $i, $name); - - if (!$h = fopen($file.'.lock', 'w')) { - if (file_exists($file.'.lock')) { - continue 2; - } - restore_error_handler(); - throw new RuntimeException('A temporary file could not be opened to write the process output: '.$lastError); - } - if (!flock($h, \LOCK_EX | \LOCK_NB)) { - continue 2; - } - if (isset($this->lockHandles[$pipe])) { - flock($this->lockHandles[$pipe], \LOCK_UN); - fclose($this->lockHandles[$pipe]); - } - $this->lockHandles[$pipe] = $h; - - if (!($h = fopen($file, 'w')) || !fclose($h) || !$h = fopen($file, 'r')) { - flock($this->lockHandles[$pipe], \LOCK_UN); - fclose($this->lockHandles[$pipe]); - unset($this->lockHandles[$pipe]); - continue 2; - } - $this->fileHandles[$pipe] = $h; - $this->files[$pipe] = $file; - } - break; - } - restore_error_handler(); - } - - parent::__construct($input); - } - - public function __sleep(): array - { - throw new \BadMethodCallException('Cannot serialize '.__CLASS__); - } - - public function __wakeup() - { - throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); - } - - public function __destruct() - { - $this->close(); - } - - public function getDescriptors(): array - { - if (!$this->haveReadSupport) { - $nullstream = fopen('NUL', 'c'); - - return [ - ['pipe', 'r'], - $nullstream, - $nullstream, - ]; - } - - // We're not using pipe on Windows platform as it hangs (https://bugs.php.net/51800) - // We're not using file handles as it can produce corrupted output https://bugs.php.net/65650 - // So we redirect output within the commandline and pass the nul device to the process - return [ - ['pipe', 'r'], - ['file', 'NUL', 'w'], - ['file', 'NUL', 'w'], - ]; - } - - public function getFiles(): array - { - return $this->files; - } - - public function readAndWrite(bool $blocking, bool $close = false): array - { - $this->unblock(); - $w = $this->write(); - $read = $r = $e = []; - - if ($blocking) { - if ($w) { - @stream_select($r, $w, $e, 0, Process::TIMEOUT_PRECISION * 1E6); - } elseif ($this->fileHandles) { - usleep(Process::TIMEOUT_PRECISION * 1E6); - } - } - foreach ($this->fileHandles as $type => $fileHandle) { - $data = stream_get_contents($fileHandle, -1, $this->readBytes[$type]); - - if (isset($data[0])) { - $this->readBytes[$type] += \strlen($data); - $read[$type] = $data; - } - if ($close) { - ftruncate($fileHandle, 0); - fclose($fileHandle); - flock($this->lockHandles[$type], \LOCK_UN); - fclose($this->lockHandles[$type]); - unset($this->fileHandles[$type], $this->lockHandles[$type]); - } - } - - return $read; - } - - public function haveReadSupport(): bool - { - return $this->haveReadSupport; - } - - public function areOpen(): bool - { - return $this->pipes && $this->fileHandles; - } - - public function close() - { - parent::close(); - foreach ($this->fileHandles as $type => $handle) { - ftruncate($handle, 0); - fclose($handle); - flock($this->lockHandles[$type], \LOCK_UN); - fclose($this->lockHandles[$type]); - } - $this->fileHandles = $this->lockHandles = []; - } -} diff --git a/vendor/symfony/process/Process.php b/vendor/symfony/process/Process.php deleted file mode 100644 index bdeab7e7..00000000 --- a/vendor/symfony/process/Process.php +++ /dev/null @@ -1,1590 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process; - -use Symfony\Component\Process\Exception\InvalidArgumentException; -use Symfony\Component\Process\Exception\LogicException; -use Symfony\Component\Process\Exception\ProcessFailedException; -use Symfony\Component\Process\Exception\ProcessSignaledException; -use Symfony\Component\Process\Exception\ProcessTimedOutException; -use Symfony\Component\Process\Exception\RuntimeException; -use Symfony\Component\Process\Pipes\PipesInterface; -use Symfony\Component\Process\Pipes\UnixPipes; -use Symfony\Component\Process\Pipes\WindowsPipes; - -/** - * Process is a thin wrapper around proc_* functions to easily - * start independent PHP processes. - * - * @author Fabien Potencier - * @author Romain Neutron - * - * @implements \IteratorAggregate - */ -class Process implements \IteratorAggregate -{ - public const ERR = 'err'; - public const OUT = 'out'; - - public const STATUS_READY = 'ready'; - public const STATUS_STARTED = 'started'; - public const STATUS_TERMINATED = 'terminated'; - - public const STDIN = 0; - public const STDOUT = 1; - public const STDERR = 2; - - // Timeout Precision in seconds. - public const TIMEOUT_PRECISION = 0.2; - - public const ITER_NON_BLOCKING = 1; // By default, iterating over outputs is a blocking call, use this flag to make it non-blocking - public const ITER_KEEP_OUTPUT = 2; // By default, outputs are cleared while iterating, use this flag to keep them in memory - public const ITER_SKIP_OUT = 4; // Use this flag to skip STDOUT while iterating - public const ITER_SKIP_ERR = 8; // Use this flag to skip STDERR while iterating - - private $callback; - private $hasCallback = false; - private $commandline; - private $cwd; - private $env = []; - private $input; - private $starttime; - private $lastOutputTime; - private $timeout; - private $idleTimeout; - private $exitcode; - private $fallbackStatus = []; - private $processInformation; - private $outputDisabled = false; - private $stdout; - private $stderr; - private $process; - private $status = self::STATUS_READY; - private $incrementalOutputOffset = 0; - private $incrementalErrorOutputOffset = 0; - private $tty = false; - private $pty; - private $options = ['suppress_errors' => true, 'bypass_shell' => true]; - - private $useFileHandles = false; - /** @var PipesInterface */ - private $processPipes; - - private $latestSignal; - - private static $sigchild; - - /** - * Exit codes translation table. - * - * User-defined errors must use exit codes in the 64-113 range. - */ - public static $exitCodes = [ - 0 => 'OK', - 1 => 'General error', - 2 => 'Misuse of shell builtins', - - 126 => 'Invoked command cannot execute', - 127 => 'Command not found', - 128 => 'Invalid exit argument', - - // signals - 129 => 'Hangup', - 130 => 'Interrupt', - 131 => 'Quit and dump core', - 132 => 'Illegal instruction', - 133 => 'Trace/breakpoint trap', - 134 => 'Process aborted', - 135 => 'Bus error: "access to undefined portion of memory object"', - 136 => 'Floating point exception: "erroneous arithmetic operation"', - 137 => 'Kill (terminate immediately)', - 138 => 'User-defined 1', - 139 => 'Segmentation violation', - 140 => 'User-defined 2', - 141 => 'Write to pipe with no one reading', - 142 => 'Signal raised by alarm', - 143 => 'Termination (request to terminate)', - // 144 - not defined - 145 => 'Child process terminated, stopped (or continued*)', - 146 => 'Continue if stopped', - 147 => 'Stop executing temporarily', - 148 => 'Terminal stop signal', - 149 => 'Background process attempting to read from tty ("in")', - 150 => 'Background process attempting to write to tty ("out")', - 151 => 'Urgent data available on socket', - 152 => 'CPU time limit exceeded', - 153 => 'File size limit exceeded', - 154 => 'Signal raised by timer counting virtual time: "virtual timer expired"', - 155 => 'Profiling timer expired', - // 156 - not defined - 157 => 'Pollable event', - // 158 - not defined - 159 => 'Bad syscall', - ]; - - /** - * @param array $command The command to run and its arguments listed as separate entries - * @param string|null $cwd The working directory or null to use the working dir of the current PHP process - * @param array|null $env The environment variables or null to use the same environment as the current PHP process - * @param mixed $input The input as stream resource, scalar or \Traversable, or null for no input - * @param int|float|null $timeout The timeout in seconds or null to disable - * - * @throws LogicException When proc_open is not installed - */ - public function __construct(array $command, string $cwd = null, array $env = null, mixed $input = null, ?float $timeout = 60) - { - if (!\function_exists('proc_open')) { - throw new LogicException('The Process class relies on proc_open, which is not available on your PHP installation.'); - } - - $this->commandline = $command; - $this->cwd = $cwd; - - // on Windows, if the cwd changed via chdir(), proc_open defaults to the dir where PHP was started - // on Gnu/Linux, PHP builds with --enable-maintainer-zts are also affected - // @see : https://bugs.php.net/51800 - // @see : https://bugs.php.net/50524 - if (null === $this->cwd && (\defined('ZEND_THREAD_SAFE') || '\\' === \DIRECTORY_SEPARATOR)) { - $this->cwd = getcwd(); - } - if (null !== $env) { - $this->setEnv($env); - } - - $this->setInput($input); - $this->setTimeout($timeout); - $this->useFileHandles = '\\' === \DIRECTORY_SEPARATOR; - $this->pty = false; - } - - /** - * Creates a Process instance as a command-line to be run in a shell wrapper. - * - * Command-lines are parsed by the shell of your OS (/bin/sh on Unix-like, cmd.exe on Windows.) - * This allows using e.g. pipes or conditional execution. In this mode, signals are sent to the - * shell wrapper and not to your commands. - * - * In order to inject dynamic values into command-lines, we strongly recommend using placeholders. - * This will save escaping values, which is not portable nor secure anyway: - * - * $process = Process::fromShellCommandline('my_command "${:MY_VAR}"'); - * $process->run(null, ['MY_VAR' => $theValue]); - * - * @param string $command The command line to pass to the shell of the OS - * @param string|null $cwd The working directory or null to use the working dir of the current PHP process - * @param array|null $env The environment variables or null to use the same environment as the current PHP process - * @param mixed $input The input as stream resource, scalar or \Traversable, or null for no input - * @param int|float|null $timeout The timeout in seconds or null to disable - * - * @throws LogicException When proc_open is not installed - */ - public static function fromShellCommandline(string $command, string $cwd = null, array $env = null, mixed $input = null, ?float $timeout = 60): static - { - $process = new static([], $cwd, $env, $input, $timeout); - $process->commandline = $command; - - return $process; - } - - public function __sleep(): array - { - throw new \BadMethodCallException('Cannot serialize '.__CLASS__); - } - - public function __wakeup() - { - throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); - } - - public function __destruct() - { - if ($this->options['create_new_console'] ?? false) { - $this->processPipes->close(); - } else { - $this->stop(0); - } - } - - public function __clone() - { - $this->resetProcessData(); - } - - /** - * Runs the process. - * - * The callback receives the type of output (out or err) and - * some bytes from the output in real-time. It allows to have feedback - * from the independent process during execution. - * - * The STDOUT and STDERR are also available after the process is finished - * via the getOutput() and getErrorOutput() methods. - * - * @param callable|null $callback A PHP callback to run whenever there is some - * output available on STDOUT or STDERR - * - * @return int The exit status code - * - * @throws RuntimeException When process can't be launched - * @throws RuntimeException When process is already running - * @throws ProcessTimedOutException When process timed out - * @throws ProcessSignaledException When process stopped after receiving signal - * @throws LogicException In case a callback is provided and output has been disabled - * - * @final - */ - public function run(callable $callback = null, array $env = []): int - { - $this->start($callback, $env); - - return $this->wait(); - } - - /** - * Runs the process. - * - * This is identical to run() except that an exception is thrown if the process - * exits with a non-zero exit code. - * - * @return $this - * - * @throws ProcessFailedException if the process didn't terminate successfully - * - * @final - */ - public function mustRun(callable $callback = null, array $env = []): static - { - if (0 !== $this->run($callback, $env)) { - throw new ProcessFailedException($this); - } - - return $this; - } - - /** - * Starts the process and returns after writing the input to STDIN. - * - * This method blocks until all STDIN data is sent to the process then it - * returns while the process runs in the background. - * - * The termination of the process can be awaited with wait(). - * - * The callback receives the type of output (out or err) and some bytes from - * the output in real-time while writing the standard input to the process. - * It allows to have feedback from the independent process during execution. - * - * @param callable|null $callback A PHP callback to run whenever there is some - * output available on STDOUT or STDERR - * - * @throws RuntimeException When process can't be launched - * @throws RuntimeException When process is already running - * @throws LogicException In case a callback is provided and output has been disabled - */ - public function start(callable $callback = null, array $env = []) - { - if ($this->isRunning()) { - throw new RuntimeException('Process is already running.'); - } - - $this->resetProcessData(); - $this->starttime = $this->lastOutputTime = microtime(true); - $this->callback = $this->buildCallback($callback); - $this->hasCallback = null !== $callback; - $descriptors = $this->getDescriptors(); - - if ($this->env) { - $env += '\\' === \DIRECTORY_SEPARATOR ? array_diff_ukey($this->env, $env, 'strcasecmp') : $this->env; - } - - $env += '\\' === \DIRECTORY_SEPARATOR ? array_diff_ukey($this->getDefaultEnv(), $env, 'strcasecmp') : $this->getDefaultEnv(); - - if (\is_array($commandline = $this->commandline)) { - $commandline = implode(' ', array_map($this->escapeArgument(...), $commandline)); - - if ('\\' !== \DIRECTORY_SEPARATOR) { - // exec is mandatory to deal with sending a signal to the process - $commandline = 'exec '.$commandline; - } - } else { - $commandline = $this->replacePlaceholders($commandline, $env); - } - - if ('\\' === \DIRECTORY_SEPARATOR) { - $commandline = $this->prepareWindowsCommandLine($commandline, $env); - } elseif (!$this->useFileHandles && $this->isSigchildEnabled()) { - // last exit code is output on the fourth pipe and caught to work around --enable-sigchild - $descriptors[3] = ['pipe', 'w']; - - // See https://unix.stackexchange.com/questions/71205/background-process-pipe-input - $commandline = '{ ('.$commandline.') <&3 3<&- 3>/dev/null & } 3<&0;'; - $commandline .= 'pid=$!; echo $pid >&3; wait $pid; code=$?; echo $code >&3; exit $code'; - - // Workaround for the bug, when PTS functionality is enabled. - // @see : https://bugs.php.net/69442 - $ptsWorkaround = fopen(__FILE__, 'r'); - } - - $envPairs = []; - foreach ($env as $k => $v) { - if (false !== $v && false === \in_array($k, ['argc', 'argv', 'ARGC', 'ARGV'], true)) { - $envPairs[] = $k.'='.$v; - } - } - - if (!is_dir($this->cwd)) { - throw new RuntimeException(sprintf('The provided cwd "%s" does not exist.', $this->cwd)); - } - - $this->process = @proc_open($commandline, $descriptors, $this->processPipes->pipes, $this->cwd, $envPairs, $this->options); - - if (!\is_resource($this->process)) { - throw new RuntimeException('Unable to launch a new process.'); - } - $this->status = self::STATUS_STARTED; - - if (isset($descriptors[3])) { - $this->fallbackStatus['pid'] = (int) fgets($this->processPipes->pipes[3]); - } - - if ($this->tty) { - return; - } - - $this->updateStatus(false); - $this->checkTimeout(); - } - - /** - * Restarts the process. - * - * Be warned that the process is cloned before being started. - * - * @param callable|null $callback A PHP callback to run whenever there is some - * output available on STDOUT or STDERR - * - * @throws RuntimeException When process can't be launched - * @throws RuntimeException When process is already running - * - * @see start() - * - * @final - */ - public function restart(callable $callback = null, array $env = []): static - { - if ($this->isRunning()) { - throw new RuntimeException('Process is already running.'); - } - - $process = clone $this; - $process->start($callback, $env); - - return $process; - } - - /** - * Waits for the process to terminate. - * - * The callback receives the type of output (out or err) and some bytes - * from the output in real-time while writing the standard input to the process. - * It allows to have feedback from the independent process during execution. - * - * @param callable|null $callback A valid PHP callback - * - * @return int The exitcode of the process - * - * @throws ProcessTimedOutException When process timed out - * @throws ProcessSignaledException When process stopped after receiving signal - * @throws LogicException When process is not yet started - */ - public function wait(callable $callback = null): int - { - $this->requireProcessIsStarted(__FUNCTION__); - - $this->updateStatus(false); - - if (null !== $callback) { - if (!$this->processPipes->haveReadSupport()) { - $this->stop(0); - throw new LogicException('Pass the callback to the "Process::start" method or call enableOutput to use a callback with "Process::wait".'); - } - $this->callback = $this->buildCallback($callback); - } - - do { - $this->checkTimeout(); - $running = '\\' === \DIRECTORY_SEPARATOR ? $this->isRunning() : $this->processPipes->areOpen(); - $this->readPipes($running, '\\' !== \DIRECTORY_SEPARATOR || !$running); - } while ($running); - - while ($this->isRunning()) { - $this->checkTimeout(); - usleep(1000); - } - - if ($this->processInformation['signaled'] && $this->processInformation['termsig'] !== $this->latestSignal) { - throw new ProcessSignaledException($this); - } - - return $this->exitcode; - } - - /** - * Waits until the callback returns true. - * - * The callback receives the type of output (out or err) and some bytes - * from the output in real-time while writing the standard input to the process. - * It allows to have feedback from the independent process during execution. - * - * @throws RuntimeException When process timed out - * @throws LogicException When process is not yet started - * @throws ProcessTimedOutException In case the timeout was reached - */ - public function waitUntil(callable $callback): bool - { - $this->requireProcessIsStarted(__FUNCTION__); - $this->updateStatus(false); - - if (!$this->processPipes->haveReadSupport()) { - $this->stop(0); - throw new LogicException('Pass the callback to the "Process::start" method or call enableOutput to use a callback with "Process::waitUntil".'); - } - $callback = $this->buildCallback($callback); - - $ready = false; - while (true) { - $this->checkTimeout(); - $running = '\\' === \DIRECTORY_SEPARATOR ? $this->isRunning() : $this->processPipes->areOpen(); - $output = $this->processPipes->readAndWrite($running, '\\' !== \DIRECTORY_SEPARATOR || !$running); - - foreach ($output as $type => $data) { - if (3 !== $type) { - $ready = $callback(self::STDOUT === $type ? self::OUT : self::ERR, $data) || $ready; - } elseif (!isset($this->fallbackStatus['signaled'])) { - $this->fallbackStatus['exitcode'] = (int) $data; - } - } - if ($ready) { - return true; - } - if (!$running) { - return false; - } - - usleep(1000); - } - } - - /** - * Returns the Pid (process identifier), if applicable. - * - * @return int|null The process id if running, null otherwise - */ - public function getPid(): ?int - { - return $this->isRunning() ? $this->processInformation['pid'] : null; - } - - /** - * Sends a POSIX signal to the process. - * - * @param int $signal A valid POSIX signal (see https://php.net/pcntl.constants) - * - * @return $this - * - * @throws LogicException In case the process is not running - * @throws RuntimeException In case --enable-sigchild is activated and the process can't be killed - * @throws RuntimeException In case of failure - */ - public function signal(int $signal): static - { - $this->doSignal($signal, true); - - return $this; - } - - /** - * Disables fetching output and error output from the underlying process. - * - * @return $this - * - * @throws RuntimeException In case the process is already running - * @throws LogicException if an idle timeout is set - */ - public function disableOutput(): static - { - if ($this->isRunning()) { - throw new RuntimeException('Disabling output while the process is running is not possible.'); - } - if (null !== $this->idleTimeout) { - throw new LogicException('Output cannot be disabled while an idle timeout is set.'); - } - - $this->outputDisabled = true; - - return $this; - } - - /** - * Enables fetching output and error output from the underlying process. - * - * @return $this - * - * @throws RuntimeException In case the process is already running - */ - public function enableOutput(): static - { - if ($this->isRunning()) { - throw new RuntimeException('Enabling output while the process is running is not possible.'); - } - - $this->outputDisabled = false; - - return $this; - } - - /** - * Returns true in case the output is disabled, false otherwise. - */ - public function isOutputDisabled(): bool - { - return $this->outputDisabled; - } - - /** - * Returns the current output of the process (STDOUT). - * - * @throws LogicException in case the output has been disabled - * @throws LogicException In case the process is not started - */ - public function getOutput(): string - { - $this->readPipesForOutput(__FUNCTION__); - - if (false === $ret = stream_get_contents($this->stdout, -1, 0)) { - return ''; - } - - return $ret; - } - - /** - * Returns the output incrementally. - * - * In comparison with the getOutput method which always return the whole - * output, this one returns the new output since the last call. - * - * @throws LogicException in case the output has been disabled - * @throws LogicException In case the process is not started - */ - public function getIncrementalOutput(): string - { - $this->readPipesForOutput(__FUNCTION__); - - $latest = stream_get_contents($this->stdout, -1, $this->incrementalOutputOffset); - $this->incrementalOutputOffset = ftell($this->stdout); - - if (false === $latest) { - return ''; - } - - return $latest; - } - - /** - * Returns an iterator to the output of the process, with the output type as keys (Process::OUT/ERR). - * - * @param int $flags A bit field of Process::ITER_* flags - * - * @throws LogicException in case the output has been disabled - * @throws LogicException In case the process is not started - */ - public function getIterator(int $flags = 0): \Generator - { - $this->readPipesForOutput(__FUNCTION__, false); - - $clearOutput = !(self::ITER_KEEP_OUTPUT & $flags); - $blocking = !(self::ITER_NON_BLOCKING & $flags); - $yieldOut = !(self::ITER_SKIP_OUT & $flags); - $yieldErr = !(self::ITER_SKIP_ERR & $flags); - - while (null !== $this->callback || ($yieldOut && !feof($this->stdout)) || ($yieldErr && !feof($this->stderr))) { - if ($yieldOut) { - $out = stream_get_contents($this->stdout, -1, $this->incrementalOutputOffset); - - if (isset($out[0])) { - if ($clearOutput) { - $this->clearOutput(); - } else { - $this->incrementalOutputOffset = ftell($this->stdout); - } - - yield self::OUT => $out; - } - } - - if ($yieldErr) { - $err = stream_get_contents($this->stderr, -1, $this->incrementalErrorOutputOffset); - - if (isset($err[0])) { - if ($clearOutput) { - $this->clearErrorOutput(); - } else { - $this->incrementalErrorOutputOffset = ftell($this->stderr); - } - - yield self::ERR => $err; - } - } - - if (!$blocking && !isset($out[0]) && !isset($err[0])) { - yield self::OUT => ''; - } - - $this->checkTimeout(); - $this->readPipesForOutput(__FUNCTION__, $blocking); - } - } - - /** - * Clears the process output. - * - * @return $this - */ - public function clearOutput(): static - { - ftruncate($this->stdout, 0); - fseek($this->stdout, 0); - $this->incrementalOutputOffset = 0; - - return $this; - } - - /** - * Returns the current error output of the process (STDERR). - * - * @throws LogicException in case the output has been disabled - * @throws LogicException In case the process is not started - */ - public function getErrorOutput(): string - { - $this->readPipesForOutput(__FUNCTION__); - - if (false === $ret = stream_get_contents($this->stderr, -1, 0)) { - return ''; - } - - return $ret; - } - - /** - * Returns the errorOutput incrementally. - * - * In comparison with the getErrorOutput method which always return the - * whole error output, this one returns the new error output since the last - * call. - * - * @throws LogicException in case the output has been disabled - * @throws LogicException In case the process is not started - */ - public function getIncrementalErrorOutput(): string - { - $this->readPipesForOutput(__FUNCTION__); - - $latest = stream_get_contents($this->stderr, -1, $this->incrementalErrorOutputOffset); - $this->incrementalErrorOutputOffset = ftell($this->stderr); - - if (false === $latest) { - return ''; - } - - return $latest; - } - - /** - * Clears the process output. - * - * @return $this - */ - public function clearErrorOutput(): static - { - ftruncate($this->stderr, 0); - fseek($this->stderr, 0); - $this->incrementalErrorOutputOffset = 0; - - return $this; - } - - /** - * Returns the exit code returned by the process. - * - * @return int|null The exit status code, null if the Process is not terminated - */ - public function getExitCode(): ?int - { - $this->updateStatus(false); - - return $this->exitcode; - } - - /** - * Returns a string representation for the exit code returned by the process. - * - * This method relies on the Unix exit code status standardization - * and might not be relevant for other operating systems. - * - * @return string|null A string representation for the exit status code, null if the Process is not terminated - * - * @see http://tldp.org/LDP/abs/html/exitcodes.html - * @see http://en.wikipedia.org/wiki/Unix_signal - */ - public function getExitCodeText(): ?string - { - if (null === $exitcode = $this->getExitCode()) { - return null; - } - - return self::$exitCodes[$exitcode] ?? 'Unknown error'; - } - - /** - * Checks if the process ended successfully. - */ - public function isSuccessful(): bool - { - return 0 === $this->getExitCode(); - } - - /** - * Returns true if the child process has been terminated by an uncaught signal. - * - * It always returns false on Windows. - * - * @throws LogicException In case the process is not terminated - */ - public function hasBeenSignaled(): bool - { - $this->requireProcessIsTerminated(__FUNCTION__); - - return $this->processInformation['signaled']; - } - - /** - * Returns the number of the signal that caused the child process to terminate its execution. - * - * It is only meaningful if hasBeenSignaled() returns true. - * - * @throws RuntimeException In case --enable-sigchild is activated - * @throws LogicException In case the process is not terminated - */ - public function getTermSignal(): int - { - $this->requireProcessIsTerminated(__FUNCTION__); - - if ($this->isSigchildEnabled() && -1 === $this->processInformation['termsig']) { - throw new RuntimeException('This PHP has been compiled with --enable-sigchild. Term signal cannot be retrieved.'); - } - - return $this->processInformation['termsig']; - } - - /** - * Returns true if the child process has been stopped by a signal. - * - * It always returns false on Windows. - * - * @throws LogicException In case the process is not terminated - */ - public function hasBeenStopped(): bool - { - $this->requireProcessIsTerminated(__FUNCTION__); - - return $this->processInformation['stopped']; - } - - /** - * Returns the number of the signal that caused the child process to stop its execution. - * - * It is only meaningful if hasBeenStopped() returns true. - * - * @throws LogicException In case the process is not terminated - */ - public function getStopSignal(): int - { - $this->requireProcessIsTerminated(__FUNCTION__); - - return $this->processInformation['stopsig']; - } - - /** - * Checks if the process is currently running. - */ - public function isRunning(): bool - { - if (self::STATUS_STARTED !== $this->status) { - return false; - } - - $this->updateStatus(false); - - return $this->processInformation['running']; - } - - /** - * Checks if the process has been started with no regard to the current state. - */ - public function isStarted(): bool - { - return self::STATUS_READY != $this->status; - } - - /** - * Checks if the process is terminated. - */ - public function isTerminated(): bool - { - $this->updateStatus(false); - - return self::STATUS_TERMINATED == $this->status; - } - - /** - * Gets the process status. - * - * The status is one of: ready, started, terminated. - */ - public function getStatus(): string - { - $this->updateStatus(false); - - return $this->status; - } - - /** - * Stops the process. - * - * @param int|float $timeout The timeout in seconds - * @param int $signal A POSIX signal to send in case the process has not stop at timeout, default is SIGKILL (9) - * - * @return int|null The exit-code of the process or null if it's not running - */ - public function stop(float $timeout = 10, int $signal = null): ?int - { - $timeoutMicro = microtime(true) + $timeout; - if ($this->isRunning()) { - // given SIGTERM may not be defined and that "proc_terminate" uses the constant value and not the constant itself, we use the same here - $this->doSignal(15, false); - do { - usleep(1000); - } while ($this->isRunning() && microtime(true) < $timeoutMicro); - - if ($this->isRunning()) { - // Avoid exception here: process is supposed to be running, but it might have stopped just - // after this line. In any case, let's silently discard the error, we cannot do anything. - $this->doSignal($signal ?: 9, false); - } - } - - if ($this->isRunning()) { - if (isset($this->fallbackStatus['pid'])) { - unset($this->fallbackStatus['pid']); - - return $this->stop(0, $signal); - } - $this->close(); - } - - return $this->exitcode; - } - - /** - * Adds a line to the STDOUT stream. - * - * @internal - */ - public function addOutput(string $line) - { - $this->lastOutputTime = microtime(true); - - fseek($this->stdout, 0, \SEEK_END); - fwrite($this->stdout, $line); - fseek($this->stdout, $this->incrementalOutputOffset); - } - - /** - * Adds a line to the STDERR stream. - * - * @internal - */ - public function addErrorOutput(string $line) - { - $this->lastOutputTime = microtime(true); - - fseek($this->stderr, 0, \SEEK_END); - fwrite($this->stderr, $line); - fseek($this->stderr, $this->incrementalErrorOutputOffset); - } - - /** - * Gets the last output time in seconds. - */ - public function getLastOutputTime(): ?float - { - return $this->lastOutputTime; - } - - /** - * Gets the command line to be executed. - */ - public function getCommandLine(): string - { - return \is_array($this->commandline) ? implode(' ', array_map($this->escapeArgument(...), $this->commandline)) : $this->commandline; - } - - /** - * Gets the process timeout in seconds (max. runtime). - */ - public function getTimeout(): ?float - { - return $this->timeout; - } - - /** - * Gets the process idle timeout in seconds (max. time since last output). - */ - public function getIdleTimeout(): ?float - { - return $this->idleTimeout; - } - - /** - * Sets the process timeout (max. runtime) in seconds. - * - * To disable the timeout, set this value to null. - * - * @return $this - * - * @throws InvalidArgumentException if the timeout is negative - */ - public function setTimeout(?float $timeout): static - { - $this->timeout = $this->validateTimeout($timeout); - - return $this; - } - - /** - * Sets the process idle timeout (max. time since last output) in seconds. - * - * To disable the timeout, set this value to null. - * - * @return $this - * - * @throws LogicException if the output is disabled - * @throws InvalidArgumentException if the timeout is negative - */ - public function setIdleTimeout(?float $timeout): static - { - if (null !== $timeout && $this->outputDisabled) { - throw new LogicException('Idle timeout cannot be set while the output is disabled.'); - } - - $this->idleTimeout = $this->validateTimeout($timeout); - - return $this; - } - - /** - * Enables or disables the TTY mode. - * - * @return $this - * - * @throws RuntimeException In case the TTY mode is not supported - */ - public function setTty(bool $tty): static - { - if ('\\' === \DIRECTORY_SEPARATOR && $tty) { - throw new RuntimeException('TTY mode is not supported on Windows platform.'); - } - - if ($tty && !self::isTtySupported()) { - throw new RuntimeException('TTY mode requires /dev/tty to be read/writable.'); - } - - $this->tty = $tty; - - return $this; - } - - /** - * Checks if the TTY mode is enabled. - */ - public function isTty(): bool - { - return $this->tty; - } - - /** - * Sets PTY mode. - * - * @return $this - */ - public function setPty(bool $bool): static - { - $this->pty = $bool; - - return $this; - } - - /** - * Returns PTY state. - */ - public function isPty(): bool - { - return $this->pty; - } - - /** - * Gets the working directory. - */ - public function getWorkingDirectory(): ?string - { - if (null === $this->cwd) { - // getcwd() will return false if any one of the parent directories does not have - // the readable or search mode set, even if the current directory does - return getcwd() ?: null; - } - - return $this->cwd; - } - - /** - * Sets the current working directory. - * - * @return $this - */ - public function setWorkingDirectory(string $cwd): static - { - $this->cwd = $cwd; - - return $this; - } - - /** - * Gets the environment variables. - */ - public function getEnv(): array - { - return $this->env; - } - - /** - * Sets the environment variables. - * - * @param array $env The new environment variables - * - * @return $this - */ - public function setEnv(array $env): static - { - $this->env = $env; - - return $this; - } - - /** - * Gets the Process input. - * - * @return resource|string|\Iterator|null - */ - public function getInput() - { - return $this->input; - } - - /** - * Sets the input. - * - * This content will be passed to the underlying process standard input. - * - * @param string|int|float|bool|resource|\Traversable|null $input The content - * - * @return $this - * - * @throws LogicException In case the process is running - */ - public function setInput(mixed $input): static - { - if ($this->isRunning()) { - throw new LogicException('Input cannot be set while the process is running.'); - } - - $this->input = ProcessUtils::validateInput(__METHOD__, $input); - - return $this; - } - - /** - * Performs a check between the timeout definition and the time the process started. - * - * In case you run a background process (with the start method), you should - * trigger this method regularly to ensure the process timeout - * - * @throws ProcessTimedOutException In case the timeout was reached - */ - public function checkTimeout() - { - if (self::STATUS_STARTED !== $this->status) { - return; - } - - if (null !== $this->timeout && $this->timeout < microtime(true) - $this->starttime) { - $this->stop(0); - - throw new ProcessTimedOutException($this, ProcessTimedOutException::TYPE_GENERAL); - } - - if (null !== $this->idleTimeout && $this->idleTimeout < microtime(true) - $this->lastOutputTime) { - $this->stop(0); - - throw new ProcessTimedOutException($this, ProcessTimedOutException::TYPE_IDLE); - } - } - - /** - * @throws LogicException in case process is not started - */ - public function getStartTime(): float - { - if (!$this->isStarted()) { - throw new LogicException('Start time is only available after process start.'); - } - - return $this->starttime; - } - - /** - * Defines options to pass to the underlying proc_open(). - * - * @see https://php.net/proc_open for the options supported by PHP. - * - * Enabling the "create_new_console" option allows a subprocess to continue - * to run after the main process exited, on both Windows and *nix - */ - public function setOptions(array $options) - { - if ($this->isRunning()) { - throw new RuntimeException('Setting options while the process is running is not possible.'); - } - - $defaultOptions = $this->options; - $existingOptions = ['blocking_pipes', 'create_process_group', 'create_new_console']; - - foreach ($options as $key => $value) { - if (!\in_array($key, $existingOptions)) { - $this->options = $defaultOptions; - throw new LogicException(sprintf('Invalid option "%s" passed to "%s()". Supported options are "%s".', $key, __METHOD__, implode('", "', $existingOptions))); - } - $this->options[$key] = $value; - } - } - - /** - * Returns whether TTY is supported on the current operating system. - */ - public static function isTtySupported(): bool - { - static $isTtySupported; - - return $isTtySupported ??= ('/' === \DIRECTORY_SEPARATOR && stream_isatty(\STDOUT)); - } - - /** - * Returns whether PTY is supported on the current operating system. - */ - public static function isPtySupported(): bool - { - static $result; - - if (null !== $result) { - return $result; - } - - if ('\\' === \DIRECTORY_SEPARATOR) { - return $result = false; - } - - return $result = (bool) @proc_open('echo 1 >/dev/null', [['pty'], ['pty'], ['pty']], $pipes); - } - - /** - * Creates the descriptors needed by the proc_open. - */ - private function getDescriptors(): array - { - if ($this->input instanceof \Iterator) { - $this->input->rewind(); - } - if ('\\' === \DIRECTORY_SEPARATOR) { - $this->processPipes = new WindowsPipes($this->input, !$this->outputDisabled || $this->hasCallback); - } else { - $this->processPipes = new UnixPipes($this->isTty(), $this->isPty(), $this->input, !$this->outputDisabled || $this->hasCallback); - } - - return $this->processPipes->getDescriptors(); - } - - /** - * Builds up the callback used by wait(). - * - * The callbacks adds all occurred output to the specific buffer and calls - * the user callback (if present) with the received output. - * - * @param callable|null $callback The user defined PHP callback - */ - protected function buildCallback(callable $callback = null): \Closure - { - if ($this->outputDisabled) { - return function ($type, $data) use ($callback): bool { - return null !== $callback && $callback($type, $data); - }; - } - - $out = self::OUT; - - return function ($type, $data) use ($callback, $out): bool { - if ($out == $type) { - $this->addOutput($data); - } else { - $this->addErrorOutput($data); - } - - return null !== $callback && $callback($type, $data); - }; - } - - /** - * Updates the status of the process, reads pipes. - * - * @param bool $blocking Whether to use a blocking read call - */ - protected function updateStatus(bool $blocking) - { - if (self::STATUS_STARTED !== $this->status) { - return; - } - - $this->processInformation = proc_get_status($this->process); - $running = $this->processInformation['running']; - - $this->readPipes($running && $blocking, '\\' !== \DIRECTORY_SEPARATOR || !$running); - - if ($this->fallbackStatus && $this->isSigchildEnabled()) { - $this->processInformation = $this->fallbackStatus + $this->processInformation; - } - - if (!$running) { - $this->close(); - } - } - - /** - * Returns whether PHP has been compiled with the '--enable-sigchild' option or not. - */ - protected function isSigchildEnabled(): bool - { - if (null !== self::$sigchild) { - return self::$sigchild; - } - - if (!\function_exists('phpinfo')) { - return self::$sigchild = false; - } - - ob_start(); - phpinfo(\INFO_GENERAL); - - return self::$sigchild = str_contains(ob_get_clean(), '--enable-sigchild'); - } - - /** - * Reads pipes for the freshest output. - * - * @param string $caller The name of the method that needs fresh outputs - * @param bool $blocking Whether to use blocking calls or not - * - * @throws LogicException in case output has been disabled or process is not started - */ - private function readPipesForOutput(string $caller, bool $blocking = false) - { - if ($this->outputDisabled) { - throw new LogicException('Output has been disabled.'); - } - - $this->requireProcessIsStarted($caller); - - $this->updateStatus($blocking); - } - - /** - * Validates and returns the filtered timeout. - * - * @throws InvalidArgumentException if the given timeout is a negative number - */ - private function validateTimeout(?float $timeout): ?float - { - $timeout = (float) $timeout; - - if (0.0 === $timeout) { - $timeout = null; - } elseif ($timeout < 0) { - throw new InvalidArgumentException('The timeout value must be a valid positive integer or float number.'); - } - - return $timeout; - } - - /** - * Reads pipes, executes callback. - * - * @param bool $blocking Whether to use blocking calls or not - * @param bool $close Whether to close file handles or not - */ - private function readPipes(bool $blocking, bool $close) - { - $result = $this->processPipes->readAndWrite($blocking, $close); - - $callback = $this->callback; - foreach ($result as $type => $data) { - if (3 !== $type) { - $callback(self::STDOUT === $type ? self::OUT : self::ERR, $data); - } elseif (!isset($this->fallbackStatus['signaled'])) { - $this->fallbackStatus['exitcode'] = (int) $data; - } - } - } - - /** - * Closes process resource, closes file handles, sets the exitcode. - * - * @return int The exitcode - */ - private function close(): int - { - $this->processPipes->close(); - if (\is_resource($this->process)) { - proc_close($this->process); - } - $this->exitcode = $this->processInformation['exitcode']; - $this->status = self::STATUS_TERMINATED; - - if (-1 === $this->exitcode) { - if ($this->processInformation['signaled'] && 0 < $this->processInformation['termsig']) { - // if process has been signaled, no exitcode but a valid termsig, apply Unix convention - $this->exitcode = 128 + $this->processInformation['termsig']; - } elseif ($this->isSigchildEnabled()) { - $this->processInformation['signaled'] = true; - $this->processInformation['termsig'] = -1; - } - } - - // Free memory from self-reference callback created by buildCallback - // Doing so in other contexts like __destruct or by garbage collector is ineffective - // Now pipes are closed, so the callback is no longer necessary - $this->callback = null; - - return $this->exitcode; - } - - /** - * Resets data related to the latest run of the process. - */ - private function resetProcessData() - { - $this->starttime = null; - $this->callback = null; - $this->exitcode = null; - $this->fallbackStatus = []; - $this->processInformation = null; - $this->stdout = fopen('php://temp/maxmemory:'.(1024 * 1024), 'w+'); - $this->stderr = fopen('php://temp/maxmemory:'.(1024 * 1024), 'w+'); - $this->process = null; - $this->latestSignal = null; - $this->status = self::STATUS_READY; - $this->incrementalOutputOffset = 0; - $this->incrementalErrorOutputOffset = 0; - } - - /** - * Sends a POSIX signal to the process. - * - * @param int $signal A valid POSIX signal (see https://php.net/pcntl.constants) - * @param bool $throwException Whether to throw exception in case signal failed - * - * @throws LogicException In case the process is not running - * @throws RuntimeException In case --enable-sigchild is activated and the process can't be killed - * @throws RuntimeException In case of failure - */ - private function doSignal(int $signal, bool $throwException): bool - { - if (null === $pid = $this->getPid()) { - if ($throwException) { - throw new LogicException('Cannot send signal on a non running process.'); - } - - return false; - } - - if ('\\' === \DIRECTORY_SEPARATOR) { - exec(sprintf('taskkill /F /T /PID %d 2>&1', $pid), $output, $exitCode); - if ($exitCode && $this->isRunning()) { - if ($throwException) { - throw new RuntimeException(sprintf('Unable to kill the process (%s).', implode(' ', $output))); - } - - return false; - } - } else { - if (!$this->isSigchildEnabled()) { - $ok = @proc_terminate($this->process, $signal); - } elseif (\function_exists('posix_kill')) { - $ok = @posix_kill($pid, $signal); - } elseif ($ok = proc_open(sprintf('kill -%d %d', $signal, $pid), [2 => ['pipe', 'w']], $pipes)) { - $ok = false === fgets($pipes[2]); - } - if (!$ok) { - if ($throwException) { - throw new RuntimeException(sprintf('Error while sending signal "%s".', $signal)); - } - - return false; - } - } - - $this->latestSignal = $signal; - $this->fallbackStatus['signaled'] = true; - $this->fallbackStatus['exitcode'] = -1; - $this->fallbackStatus['termsig'] = $this->latestSignal; - - return true; - } - - private function prepareWindowsCommandLine(string $cmd, array &$env): string - { - $uid = uniqid('', true); - $varCount = 0; - $varCache = []; - $cmd = preg_replace_callback( - '/"(?:( - [^"%!^]*+ - (?: - (?: !LF! | "(?:\^[%!^])?+" ) - [^"%!^]*+ - )++ - ) | [^"]*+ )"/x', - function ($m) use (&$env, &$varCache, &$varCount, $uid) { - if (!isset($m[1])) { - return $m[0]; - } - if (isset($varCache[$m[0]])) { - return $varCache[$m[0]]; - } - if (str_contains($value = $m[1], "\0")) { - $value = str_replace("\0", '?', $value); - } - if (false === strpbrk($value, "\"%!\n")) { - return '"'.$value.'"'; - } - - $value = str_replace(['!LF!', '"^!"', '"^%"', '"^^"', '""'], ["\n", '!', '%', '^', '"'], $value); - $value = '"'.preg_replace('/(\\\\*)"/', '$1$1\\"', $value).'"'; - $var = $uid.++$varCount; - - $env[$var] = $value; - - return $varCache[$m[0]] = '!'.$var.'!'; - }, - $cmd - ); - - $cmd = 'cmd /V:ON /E:ON /D /C ('.str_replace("\n", ' ', $cmd).')'; - foreach ($this->processPipes->getFiles() as $offset => $filename) { - $cmd .= ' '.$offset.'>"'.$filename.'"'; - } - - return $cmd; - } - - /** - * Ensures the process is running or terminated, throws a LogicException if the process has a not started. - * - * @throws LogicException if the process has not run - */ - private function requireProcessIsStarted(string $functionName) - { - if (!$this->isStarted()) { - throw new LogicException(sprintf('Process must be started before calling "%s()".', $functionName)); - } - } - - /** - * Ensures the process is terminated, throws a LogicException if the process has a status different than "terminated". - * - * @throws LogicException if the process is not yet terminated - */ - private function requireProcessIsTerminated(string $functionName) - { - if (!$this->isTerminated()) { - throw new LogicException(sprintf('Process must be terminated before calling "%s()".', $functionName)); - } - } - - /** - * Escapes a string to be used as a shell argument. - */ - private function escapeArgument(?string $argument): string - { - if ('' === $argument || null === $argument) { - return '""'; - } - if ('\\' !== \DIRECTORY_SEPARATOR) { - return "'".str_replace("'", "'\\''", $argument)."'"; - } - if (str_contains($argument, "\0")) { - $argument = str_replace("\0", '?', $argument); - } - if (!preg_match('/[\/()%!^"<>&|\s]/', $argument)) { - return $argument; - } - $argument = preg_replace('/(\\\\+)$/', '$1$1', $argument); - - return '"'.str_replace(['"', '^', '%', '!', "\n"], ['""', '"^^"', '"^%"', '"^!"', '!LF!'], $argument).'"'; - } - - private function replacePlaceholders(string $commandline, array $env) - { - return preg_replace_callback('/"\$\{:([_a-zA-Z]++[_a-zA-Z0-9]*+)\}"/', function ($matches) use ($commandline, $env) { - if (!isset($env[$matches[1]]) || false === $env[$matches[1]]) { - throw new InvalidArgumentException(sprintf('Command line is missing a value for parameter "%s": ', $matches[1]).$commandline); - } - - return $this->escapeArgument($env[$matches[1]]); - }, $commandline); - } - - private function getDefaultEnv(): array - { - $env = getenv(); - $env = ('\\' === \DIRECTORY_SEPARATOR ? array_intersect_ukey($env, $_SERVER, 'strcasecmp') : array_intersect_key($env, $_SERVER)) ?: $env; - - return $_ENV + ('\\' === \DIRECTORY_SEPARATOR ? array_diff_ukey($env, $_ENV, 'strcasecmp') : $env); - } -} diff --git a/vendor/symfony/process/ProcessUtils.php b/vendor/symfony/process/ProcessUtils.php deleted file mode 100644 index 744399d9..00000000 --- a/vendor/symfony/process/ProcessUtils.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\Process; - -use Symfony\Component\Process\Exception\InvalidArgumentException; - -/** - * ProcessUtils is a bunch of utility methods. - * - * This class contains static methods only and is not meant to be instantiated. - * - * @author Martin Hasoň - */ -class ProcessUtils -{ - /** - * This class should not be instantiated. - */ - private function __construct() - { - } - - /** - * Validates and normalizes a Process input. - * - * @param string $caller The name of method call that validates the input - * @param mixed $input The input to validate - * - * @throws InvalidArgumentException In case the input is not valid - */ - public static function validateInput(string $caller, mixed $input): mixed - { - if (null !== $input) { - if (\is_resource($input)) { - return $input; - } - if (\is_string($input)) { - return $input; - } - if (\is_scalar($input)) { - return (string) $input; - } - if ($input instanceof Process) { - return $input->getIterator($input::ITER_SKIP_ERR); - } - if ($input instanceof \Iterator) { - return $input; - } - if ($input instanceof \Traversable) { - return new \IteratorIterator($input); - } - - throw new InvalidArgumentException(sprintf('"%s" only accepts strings, Traversable objects or stream resources.', $caller)); - } - - return $input; - } -} diff --git a/vendor/symfony/process/README.md b/vendor/symfony/process/README.md deleted file mode 100644 index a371d286..00000000 --- a/vendor/symfony/process/README.md +++ /dev/null @@ -1,28 +0,0 @@ -Process Component -================= - -The Process component executes commands in sub-processes. - -Sponsor -------- - -The Process component for Symfony 6.1 is [backed][1] by [SensioLabs][2]. - -As the creator of Symfony, SensioLabs supports companies using Symfony, with an -offering encompassing consultancy, expertise, services, training, and technical -assistance to ensure the success of web application development projects. - -Help Symfony by [sponsoring][3] its development! - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/components/process.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) - -[1]: https://symfony.com/backers -[2]: https://sensiolabs.com -[3]: https://symfony.com/sponsor diff --git a/vendor/symfony/process/composer.json b/vendor/symfony/process/composer.json deleted file mode 100644 index 317c07e7..00000000 --- a/vendor/symfony/process/composer.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "symfony/process", - "type": "library", - "description": "Executes commands in sub-processes", - "keywords": [], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.1" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\Process\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "minimum-stability": "dev" -} diff --git a/vendor/symfony/routing/Alias.php b/vendor/symfony/routing/Alias.php deleted file mode 100644 index 7627f12c..00000000 --- a/vendor/symfony/routing/Alias.php +++ /dev/null @@ -1,93 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing; - -use Symfony\Component\Routing\Exception\InvalidArgumentException; - -class Alias -{ - private string $id; - private array $deprecation = []; - - public function __construct(string $id) - { - $this->id = $id; - } - - public function withId(string $id): static - { - $new = clone $this; - - $new->id = $id; - - return $new; - } - - /** - * Returns the target name of this alias. - * - * @return string The target name - */ - public function getId(): string - { - return $this->id; - } - - /** - * Whether this alias is deprecated, that means it should not be referenced anymore. - * - * @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 deprecation message to use - * - * @return $this - * - * @throws InvalidArgumentException when the message template is invalid - */ - public function setDeprecated(string $package, string $version, string $message): static - { - if ('' !== $message) { - if (preg_match('#[\r\n]|\*/#', $message)) { - throw new InvalidArgumentException('Invalid characters found in deprecation template.'); - } - - if (!str_contains($message, '%alias_id%')) { - throw new InvalidArgumentException('The deprecation template must contain the "%alias_id%" placeholder.'); - } - } - - $this->deprecation = [ - 'package' => $package, - 'version' => $version, - 'message' => $message ?: 'The "%alias_id%" route alias is deprecated. You should stop using it, as it will be removed in the future.', - ]; - - return $this; - } - - public function isDeprecated(): bool - { - return (bool) $this->deprecation; - } - - /** - * @param string $name Route name relying on this alias - */ - public function getDeprecation(string $name): array - { - return [ - 'package' => $this->deprecation['package'], - 'version' => $this->deprecation['version'], - 'message' => str_replace('%alias_id%', $name, $this->deprecation['message']), - ]; - } -} diff --git a/vendor/symfony/routing/Annotation/Route.php b/vendor/symfony/routing/Annotation/Route.php deleted file mode 100644 index a9ab5f3c..00000000 --- a/vendor/symfony/routing/Annotation/Route.php +++ /dev/null @@ -1,198 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing\Annotation; - -/** - * Annotation class for @Route(). - * - * @Annotation - * @NamedArgumentConstructor - * @Target({"CLASS", "METHOD"}) - * - * @author Fabien Potencier - * @author Alexander M. Turek - */ -#[\Attribute(\Attribute::IS_REPEATABLE | \Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD)] -class Route -{ - private ?string $path = null; - private array $localizedPaths = []; - private array $methods; - private array $schemes; - - /** - * @param array $requirements - * @param string[]|string $methods - * @param string[]|string $schemes - */ - public function __construct( - string|array $path = null, - private ?string $name = null, - private array $requirements = [], - private array $options = [], - private array $defaults = [], - private ?string $host = null, - array|string $methods = [], - array|string $schemes = [], - private ?string $condition = null, - private ?int $priority = null, - string $locale = null, - string $format = null, - bool $utf8 = null, - bool $stateless = null, - private ?string $env = null - ) { - if (\is_array($path)) { - $this->localizedPaths = $path; - } else { - $this->path = $path; - } - $this->setMethods($methods); - $this->setSchemes($schemes); - - if (null !== $locale) { - $this->defaults['_locale'] = $locale; - } - - if (null !== $format) { - $this->defaults['_format'] = $format; - } - - if (null !== $utf8) { - $this->options['utf8'] = $utf8; - } - - if (null !== $stateless) { - $this->defaults['_stateless'] = $stateless; - } - } - - public function setPath(string $path) - { - $this->path = $path; - } - - public function getPath() - { - return $this->path; - } - - public function setLocalizedPaths(array $localizedPaths) - { - $this->localizedPaths = $localizedPaths; - } - - public function getLocalizedPaths(): array - { - return $this->localizedPaths; - } - - public function setHost(string $pattern) - { - $this->host = $pattern; - } - - public function getHost() - { - return $this->host; - } - - public function setName(string $name) - { - $this->name = $name; - } - - public function getName() - { - return $this->name; - } - - public function setRequirements(array $requirements) - { - $this->requirements = $requirements; - } - - public function getRequirements() - { - return $this->requirements; - } - - public function setOptions(array $options) - { - $this->options = $options; - } - - public function getOptions() - { - return $this->options; - } - - public function setDefaults(array $defaults) - { - $this->defaults = $defaults; - } - - public function getDefaults() - { - return $this->defaults; - } - - public function setSchemes(array|string $schemes) - { - $this->schemes = (array) $schemes; - } - - public function getSchemes() - { - return $this->schemes; - } - - public function setMethods(array|string $methods) - { - $this->methods = (array) $methods; - } - - public function getMethods() - { - return $this->methods; - } - - public function setCondition(?string $condition) - { - $this->condition = $condition; - } - - public function getCondition() - { - return $this->condition; - } - - public function setPriority(int $priority): void - { - $this->priority = $priority; - } - - public function getPriority(): ?int - { - return $this->priority; - } - - public function setEnv(?string $env): void - { - $this->env = $env; - } - - public function getEnv(): ?string - { - return $this->env; - } -} diff --git a/vendor/symfony/routing/CHANGELOG.md b/vendor/symfony/routing/CHANGELOG.md deleted file mode 100644 index fac41b5e..00000000 --- a/vendor/symfony/routing/CHANGELOG.md +++ /dev/null @@ -1,313 +0,0 @@ -CHANGELOG -========= - -6.2 ---- - - * Add `Requirement::POSITIVE_INT` for common ids and pagination - -6.1 ---- - - * Add `getMissingParameters` and `getRouteName` methods on `MissingMandatoryParametersException` - * Allow using UTF-8 parameter names - * Support the `attribute` type (alias of `annotation`) in annotation loaders - * Already encoded slashes are not decoded nor double-encoded anymore when generating URLs (query parameters) - * Add `EnumRequirement` to help generate route requirements from a `\BackedEnum` - * Add `Requirement`, a collection of universal regular-expression constants to use as route parameter requirements - * Add `params` variable to condition expression - * Deprecate not passing route parameters as the fourth argument to `UrlMatcher::handleRouteRequirements()` - -5.3 ---- - - * Already encoded slashes are not decoded nor double-encoded anymore when generating URLs - * Add support for per-env configuration in XML and Yaml loaders - * Deprecate creating instances of the `Route` annotation class by passing an array of parameters - * Add `RoutingConfigurator::env()` to get the current environment - -5.2.0 ------ - - * Added support for inline definition of requirements and defaults for host - * Added support for `\A` and `\z` as regex start and end for route requirement - * Added support for `#[Route]` attributes - -5.1.0 ------ - - * added the protected method `PhpFileLoader::callConfigurator()` as extension point to ease custom routing configuration - * deprecated `RouteCollectionBuilder` in favor of `RoutingConfigurator`. - * added "priority" option to annotated routes - * added argument `$priority` to `RouteCollection::add()` - * deprecated the `RouteCompiler::REGEX_DELIMITER` constant - * added `ExpressionLanguageProvider` to expose extra functions to route conditions - * added support for a `stateless` keyword for configuring route stateless in PHP, YAML and XML configurations. - * added the "hosts" option to be able to configure the host per locale. - * added `RequestContext::fromUri()` to ease building the default context - -5.0.0 ------ - - * removed `PhpGeneratorDumper` and `PhpMatcherDumper` - * removed `generator_base_class`, `generator_cache_class`, `matcher_base_class` and `matcher_cache_class` router options - * `Serializable` implementing methods for `Route` and `CompiledRoute` are final - * removed referencing service route loaders with a single colon - * Removed `ServiceRouterLoader` and `ObjectRouteLoader`. - -4.4.0 ------ - - * Deprecated `ServiceRouterLoader` in favor of `ContainerLoader`. - * Deprecated `ObjectRouteLoader` in favor of `ObjectLoader`. - * Added a way to exclude patterns of resources from being imported by the `import()` method - -4.3.0 ------ - - * added `CompiledUrlMatcher` and `CompiledUrlMatcherDumper` - * added `CompiledUrlGenerator` and `CompiledUrlGeneratorDumper` - * deprecated `PhpGeneratorDumper` and `PhpMatcherDumper` - * deprecated `generator_base_class`, `generator_cache_class`, `matcher_base_class` and `matcher_cache_class` router options - * `Serializable` implementing methods for `Route` and `CompiledRoute` are marked as `@internal` and `@final`. - Instead of overwriting them, use `__serialize` and `__unserialize` as extension points which are forward compatible - with the new serialization methods in PHP 7.4. - * exposed `utf8` Route option, defaults "locale" and "format" in configuration loaders and configurators - * added support for invokable service route loaders - -4.2.0 ------ - - * added fallback to cultureless locale for internationalized routes - -4.0.0 ------ - - * dropped support for using UTF-8 route patterns without using the `utf8` option - * dropped support for using UTF-8 route requirements without using the `utf8` option - -3.4.0 ------ - - * Added `NoConfigurationException`. - * Added the possibility to define a prefix for all routes of a controller via @Route(name="prefix_") - * Added support for prioritized routing loaders. - * Add matched and default parameters to redirect responses - * Added support for a `controller` keyword for configuring route controllers in YAML and XML configurations. - -3.3.0 ------ - - * [DEPRECATION] Class parameters have been deprecated and will be removed in 4.0. - * router.options.generator_class - * router.options.generator_base_class - * router.options.generator_dumper_class - * router.options.matcher_class - * router.options.matcher_base_class - * router.options.matcher_dumper_class - * router.options.matcher.cache_class - * router.options.generator.cache_class - -3.2.0 ------ - - * Added support for `bool`, `int`, `float`, `string`, `list` and `map` defaults in XML configurations. - * Added support for UTF-8 requirements - -2.8.0 ------ - - * allowed specifying a directory to recursively load all routing configuration files it contains - * Added ObjectRouteLoader and ServiceRouteLoader that allow routes to be loaded - by calling a method on an object/service. - * [DEPRECATION] Deprecated the hardcoded value for the `$referenceType` argument of the `UrlGeneratorInterface::generate` method. - Use the constants defined in the `UrlGeneratorInterface` instead. - - Before: - - ```php - $router->generate('blog_show', ['slug' => 'my-blog-post'], true); - ``` - - After: - - ```php - use Symfony\Component\Routing\Generator\UrlGeneratorInterface; - - $router->generate('blog_show', ['slug' => 'my-blog-post'], UrlGeneratorInterface::ABSOLUTE_URL); - ``` - -2.5.0 ------ - - * [DEPRECATION] The `ApacheMatcherDumper` and `ApacheUrlMatcher` were deprecated and - will be removed in Symfony 3.0, since the performance gains were minimal and - it's hard to replicate the behavior of PHP implementation. - -2.3.0 ------ - - * added RequestContext::getQueryString() - -2.2.0 ------ - - * [DEPRECATION] Several route settings have been renamed (the old ones will be removed in 3.0): - - * The `pattern` setting for a route has been deprecated in favor of `path` - * The `_scheme` and `_method` requirements have been moved to the `schemes` and `methods` settings - - Before: - - ```yaml - article_edit: - pattern: /article/{id} - requirements: { '_method': 'POST|PUT', '_scheme': 'https', 'id': '\d+' } - ``` - - ```xml - - POST|PUT - https - \d+ - - ``` - - ```php - $route = new Route(); - $route->setPattern('/article/{id}'); - $route->setRequirement('_method', 'POST|PUT'); - $route->setRequirement('_scheme', 'https'); - ``` - - After: - - ```yaml - article_edit: - path: /article/{id} - methods: [POST, PUT] - schemes: https - requirements: { 'id': '\d+' } - ``` - - ```xml - - \d+ - - ``` - - ```php - $route = new Route(); - $route->setPath('/article/{id}'); - $route->setMethods(['POST', 'PUT']); - $route->setSchemes('https'); - ``` - - * [BC BREAK] RouteCollection does not behave like a tree structure anymore but as - a flat array of Routes. So when using PHP to build the RouteCollection, you must - make sure to add routes to the sub-collection before adding it to the parent - collection (this is not relevant when using YAML or XML for Route definitions). - - Before: - - ```php - $rootCollection = new RouteCollection(); - $subCollection = new RouteCollection(); - $rootCollection->addCollection($subCollection); - $subCollection->add('foo', new Route('/foo')); - ``` - - After: - - ```php - $rootCollection = new RouteCollection(); - $subCollection = new RouteCollection(); - $subCollection->add('foo', new Route('/foo')); - $rootCollection->addCollection($subCollection); - ``` - - Also one must call `addCollection` from the bottom to the top hierarchy. - So the correct sequence is the following (and not the reverse): - - ```php - $childCollection->addCollection($grandchildCollection); - $rootCollection->addCollection($childCollection); - ``` - - * [DEPRECATION] The methods `RouteCollection::getParent()` and `RouteCollection::getRoot()` - have been deprecated and will be removed in Symfony 2.3. - * [BC BREAK] Misusing the `RouteCollection::addPrefix` method to add defaults, requirements - or options without adding a prefix is not supported anymore. So if you called `addPrefix` - with an empty prefix or `/` only (both have no relevance), like - `addPrefix('', $defaultsArray, $requirementsArray, $optionsArray)` - you need to use the new dedicated methods `addDefaults($defaultsArray)`, - `addRequirements($requirementsArray)` or `addOptions($optionsArray)` instead. - * [DEPRECATION] The `$options` parameter to `RouteCollection::addPrefix()` has been deprecated - because adding options has nothing to do with adding a path prefix. If you want to add options - to all child routes of a RouteCollection, you can use `addOptions()`. - * [DEPRECATION] The method `RouteCollection::getPrefix()` has been deprecated - because it suggested that all routes in the collection would have this prefix, which is - not necessarily true. On top of that, since there is no tree structure anymore, this method - is also useless. Don't worry about performance, prefix optimization for matching is still done - in the dumper, which was also improved in 2.2.0 to find even more grouping possibilities. - * [DEPRECATION] `RouteCollection::addCollection(RouteCollection $collection)` should now only be - used with a single parameter. The other params `$prefix`, `$default`, `$requirements` and `$options` - will still work, but have been deprecated. The `addPrefix` method should be used for this - use-case instead. - Before: `$parentCollection->addCollection($collection, '/prefix', [...], [...])` - After: - ```php - $collection->addPrefix('/prefix', [...], [...]); - $parentCollection->addCollection($collection); - ``` - * added support for the method default argument values when defining a @Route - * Adjacent placeholders without separator work now, e.g. `/{x}{y}{z}.{_format}`. - * Characters that function as separator between placeholders are now whitelisted - to fix routes with normal text around a variable, e.g. `/prefix{var}suffix`. - * [BC BREAK] The default requirement of a variable has been changed slightly. - Previously it disallowed the previous and the next char around a variable. Now - it disallows the slash (`/`) and the next char. Using the previous char added - no value and was problematic because the route `/index.{_format}` would be - matched by `/index.ht/ml`. - * The default requirement now uses possessive quantifiers when possible which - improves matching performance by up to 20% because it prevents backtracking - when it's not needed. - * The ConfigurableRequirementsInterface can now also be used to disable the requirements - check on URL generation completely by calling `setStrictRequirements(null)`. It - improves performance in production environment as you should know that params always - pass the requirements (otherwise it would break your link anyway). - * There is no restriction on the route name anymore. So non-alphanumeric characters - are now also allowed. - * [BC BREAK] `RouteCompilerInterface::compile(Route $route)` was made static - (only relevant if you implemented your own RouteCompiler). - * Added possibility to generate relative paths and network paths in the UrlGenerator, e.g. - "../parent-file" and "//example.com/dir/file". The third parameter in - `UrlGeneratorInterface::generate($name, $parameters = [], $referenceType = self::ABSOLUTE_PATH)` - now accepts more values and you should use the constants defined in `UrlGeneratorInterface` for - claritiy. The old method calls with a Boolean parameter will continue to work because they - equal the signature using the constants. - -2.1.0 ------ - - * added RequestMatcherInterface - * added RequestContext::fromRequest() - * the UrlMatcher does not throw a \LogicException anymore when the required - scheme is not the current one - * added TraceableUrlMatcher - * added the possibility to define options, default values and requirements - for placeholders in prefix, including imported routes - * added RouterInterface::getRouteCollection - * [BC BREAK] the UrlMatcher urldecodes the route parameters only once, they - were decoded twice before. Note that the `urldecode()` calls have been - changed for a single `rawurldecode()` in order to support `+` for input - paths. - * added RouteCollection::getRoot method to retrieve the root of a - RouteCollection tree - * [BC BREAK] made RouteCollection::setParent private which could not have - been used anyway without creating inconsistencies - * [BC BREAK] RouteCollection::remove also removes a route from parent - collections (not only from its children) - * added ConfigurableRequirementsInterface that allows to disable exceptions - (and generate empty URLs instead) when generating a route with an invalid - parameter value diff --git a/vendor/symfony/routing/CompiledRoute.php b/vendor/symfony/routing/CompiledRoute.php deleted file mode 100644 index 745120a6..00000000 --- a/vendor/symfony/routing/CompiledRoute.php +++ /dev/null @@ -1,157 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing; - -/** - * CompiledRoutes are returned by the RouteCompiler class. - * - * @author Fabien Potencier - */ -class CompiledRoute implements \Serializable -{ - private array $variables; - private array $tokens; - private string $staticPrefix; - private string $regex; - private array $pathVariables; - private array $hostVariables; - private ?string $hostRegex; - private array $hostTokens; - - /** - * @param string $staticPrefix The static prefix of the compiled route - * @param string $regex The regular expression to use to match this route - * @param array $tokens An array of tokens to use to generate URL for this route - * @param array $pathVariables An array of path variables - * @param string|null $hostRegex Host regex - * @param array $hostTokens Host tokens - * @param array $hostVariables An array of host variables - * @param array $variables An array of variables (variables defined in the path and in the host patterns) - */ - public function __construct(string $staticPrefix, string $regex, array $tokens, array $pathVariables, string $hostRegex = null, array $hostTokens = [], array $hostVariables = [], array $variables = []) - { - $this->staticPrefix = $staticPrefix; - $this->regex = $regex; - $this->tokens = $tokens; - $this->pathVariables = $pathVariables; - $this->hostRegex = $hostRegex; - $this->hostTokens = $hostTokens; - $this->hostVariables = $hostVariables; - $this->variables = $variables; - } - - public function __serialize(): array - { - return [ - 'vars' => $this->variables, - 'path_prefix' => $this->staticPrefix, - 'path_regex' => $this->regex, - 'path_tokens' => $this->tokens, - 'path_vars' => $this->pathVariables, - 'host_regex' => $this->hostRegex, - 'host_tokens' => $this->hostTokens, - 'host_vars' => $this->hostVariables, - ]; - } - - /** - * @internal - */ - final public function serialize(): string - { - throw new \BadMethodCallException('Cannot serialize '.__CLASS__); - } - - public function __unserialize(array $data): void - { - $this->variables = $data['vars']; - $this->staticPrefix = $data['path_prefix']; - $this->regex = $data['path_regex']; - $this->tokens = $data['path_tokens']; - $this->pathVariables = $data['path_vars']; - $this->hostRegex = $data['host_regex']; - $this->hostTokens = $data['host_tokens']; - $this->hostVariables = $data['host_vars']; - } - - /** - * @internal - */ - final public function unserialize(string $serialized) - { - $this->__unserialize(unserialize($serialized, ['allowed_classes' => false])); - } - - /** - * Returns the static prefix. - */ - public function getStaticPrefix(): string - { - return $this->staticPrefix; - } - - /** - * Returns the regex. - */ - public function getRegex(): string - { - return $this->regex; - } - - /** - * Returns the host regex. - */ - public function getHostRegex(): ?string - { - return $this->hostRegex; - } - - /** - * Returns the tokens. - */ - public function getTokens(): array - { - return $this->tokens; - } - - /** - * Returns the host tokens. - */ - public function getHostTokens(): array - { - return $this->hostTokens; - } - - /** - * Returns the variables. - */ - public function getVariables(): array - { - return $this->variables; - } - - /** - * Returns the path variables. - */ - public function getPathVariables(): array - { - return $this->pathVariables; - } - - /** - * Returns the host variables. - */ - public function getHostVariables(): array - { - return $this->hostVariables; - } -} diff --git a/vendor/symfony/routing/DependencyInjection/RoutingResolverPass.php b/vendor/symfony/routing/DependencyInjection/RoutingResolverPass.php deleted file mode 100644 index a538d839..00000000 --- a/vendor/symfony/routing/DependencyInjection/RoutingResolverPass.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing\DependencyInjection; - -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\Compiler\PriorityTaggedServiceTrait; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; - -/** - * Adds tagged routing.loader services to routing.resolver service. - * - * @author Fabien Potencier - */ -class RoutingResolverPass implements CompilerPassInterface -{ - use PriorityTaggedServiceTrait; - - public function process(ContainerBuilder $container) - { - if (false === $container->hasDefinition('routing.resolver')) { - return; - } - - $definition = $container->getDefinition('routing.resolver'); - - foreach ($this->findAndSortTaggedServices('routing.loader', $container) as $id) { - $definition->addMethodCall('addLoader', [new Reference($id)]); - } - } -} diff --git a/vendor/symfony/routing/Exception/ExceptionInterface.php b/vendor/symfony/routing/Exception/ExceptionInterface.php deleted file mode 100644 index 22e72b16..00000000 --- a/vendor/symfony/routing/Exception/ExceptionInterface.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing\Exception; - -/** - * ExceptionInterface. - * - * @author Alexandre Salomé - */ -interface ExceptionInterface extends \Throwable -{ -} diff --git a/vendor/symfony/routing/Exception/InvalidArgumentException.php b/vendor/symfony/routing/Exception/InvalidArgumentException.php deleted file mode 100644 index 950b9b15..00000000 --- a/vendor/symfony/routing/Exception/InvalidArgumentException.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. - */ - -namespace Symfony\Component\Routing\Exception; - -class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/routing/Exception/InvalidParameterException.php b/vendor/symfony/routing/Exception/InvalidParameterException.php deleted file mode 100644 index 94d841f4..00000000 --- a/vendor/symfony/routing/Exception/InvalidParameterException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing\Exception; - -/** - * Exception thrown when a parameter is not valid. - * - * @author Alexandre Salomé - */ -class InvalidParameterException extends \InvalidArgumentException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/routing/Exception/MethodNotAllowedException.php b/vendor/symfony/routing/Exception/MethodNotAllowedException.php deleted file mode 100644 index 0e4381bb..00000000 --- a/vendor/symfony/routing/Exception/MethodNotAllowedException.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing\Exception; - -/** - * The resource was found but the request method is not allowed. - * - * This exception should trigger an HTTP 405 response in your application code. - * - * @author Kris Wallsmith - */ -class MethodNotAllowedException extends \RuntimeException implements ExceptionInterface -{ - protected $allowedMethods = []; - - /** - * @param string[] $allowedMethods - */ - public function __construct(array $allowedMethods, string $message = '', int $code = 0, \Throwable $previous = null) - { - $this->allowedMethods = array_map('strtoupper', $allowedMethods); - - parent::__construct($message, $code, $previous); - } - - /** - * Gets the allowed HTTP methods. - * - * @return string[] - */ - public function getAllowedMethods(): array - { - return $this->allowedMethods; - } -} diff --git a/vendor/symfony/routing/Exception/MissingMandatoryParametersException.php b/vendor/symfony/routing/Exception/MissingMandatoryParametersException.php deleted file mode 100644 index e5b83af6..00000000 --- a/vendor/symfony/routing/Exception/MissingMandatoryParametersException.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. - */ - -namespace Symfony\Component\Routing\Exception; - -/** - * Exception thrown when a route cannot be generated because of missing - * mandatory parameters. - * - * @author Alexandre Salomé - */ -class MissingMandatoryParametersException extends \InvalidArgumentException implements ExceptionInterface -{ - private string $routeName = ''; - private array $missingParameters = []; - - /** - * @param string[] $missingParameters - * @param int $code - */ - public function __construct(string $routeName = '', $missingParameters = null, $code = 0, \Throwable $previous = null) - { - if (\is_array($missingParameters)) { - $this->routeName = $routeName; - $this->missingParameters = $missingParameters; - $message = sprintf('Some mandatory parameters are missing ("%s") to generate a URL for route "%s".', implode('", "', $missingParameters), $routeName); - } else { - trigger_deprecation('symfony/routing', '6.1', 'Construction of "%s" with an exception message is deprecated, provide the route name and an array of missing parameters instead.', __CLASS__); - $message = $routeName; - $previous = $code instanceof \Throwable ? $code : null; - $code = (int) $missingParameters; - } - - parent::__construct($message, $code, $previous); - } - - /** - * @return string[] - */ - public function getMissingParameters(): array - { - return $this->missingParameters; - } - - public function getRouteName(): string - { - return $this->routeName; - } -} diff --git a/vendor/symfony/routing/Exception/NoConfigurationException.php b/vendor/symfony/routing/Exception/NoConfigurationException.php deleted file mode 100644 index 333bc743..00000000 --- a/vendor/symfony/routing/Exception/NoConfigurationException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing\Exception; - -/** - * Exception thrown when no routes are configured. - * - * @author Yonel Ceruto - */ -class NoConfigurationException extends ResourceNotFoundException -{ -} diff --git a/vendor/symfony/routing/Exception/ResourceNotFoundException.php b/vendor/symfony/routing/Exception/ResourceNotFoundException.php deleted file mode 100644 index ccbca152..00000000 --- a/vendor/symfony/routing/Exception/ResourceNotFoundException.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\Routing\Exception; - -/** - * The resource was not found. - * - * This exception should trigger an HTTP 404 response in your application code. - * - * @author Kris Wallsmith - */ -class ResourceNotFoundException extends \RuntimeException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/routing/Exception/RouteCircularReferenceException.php b/vendor/symfony/routing/Exception/RouteCircularReferenceException.php deleted file mode 100644 index 841e3598..00000000 --- a/vendor/symfony/routing/Exception/RouteCircularReferenceException.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. - */ - -namespace Symfony\Component\Routing\Exception; - -class RouteCircularReferenceException extends RuntimeException -{ - public function __construct(string $routeId, array $path) - { - parent::__construct(sprintf('Circular reference detected for route "%s", path: "%s".', $routeId, implode(' -> ', $path))); - } -} diff --git a/vendor/symfony/routing/Exception/RouteNotFoundException.php b/vendor/symfony/routing/Exception/RouteNotFoundException.php deleted file mode 100644 index 24ab0b44..00000000 --- a/vendor/symfony/routing/Exception/RouteNotFoundException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing\Exception; - -/** - * Exception thrown when a route does not exist. - * - * @author Alexandre Salomé - */ -class RouteNotFoundException extends \InvalidArgumentException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/routing/Exception/RuntimeException.php b/vendor/symfony/routing/Exception/RuntimeException.php deleted file mode 100644 index 48da62ec..00000000 --- a/vendor/symfony/routing/Exception/RuntimeException.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. - */ - -namespace Symfony\Component\Routing\Exception; - -class RuntimeException extends \RuntimeException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/routing/Generator/CompiledUrlGenerator.php b/vendor/symfony/routing/Generator/CompiledUrlGenerator.php deleted file mode 100644 index 2a3d5fd2..00000000 --- a/vendor/symfony/routing/Generator/CompiledUrlGenerator.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\Routing\Generator; - -use Psr\Log\LoggerInterface; -use Symfony\Component\Routing\Exception\RouteNotFoundException; -use Symfony\Component\Routing\RequestContext; - -/** - * Generates URLs based on rules dumped by CompiledUrlGeneratorDumper. - */ -class CompiledUrlGenerator extends UrlGenerator -{ - private array $compiledRoutes = []; - private ?string $defaultLocale; - - public function __construct(array $compiledRoutes, RequestContext $context, LoggerInterface $logger = null, string $defaultLocale = null) - { - $this->compiledRoutes = $compiledRoutes; - $this->context = $context; - $this->logger = $logger; - $this->defaultLocale = $defaultLocale; - } - - public function generate(string $name, array $parameters = [], int $referenceType = self::ABSOLUTE_PATH): string - { - $locale = $parameters['_locale'] - ?? $this->context->getParameter('_locale') - ?: $this->defaultLocale; - - if (null !== $locale) { - do { - if (($this->compiledRoutes[$name.'.'.$locale][1]['_canonical_route'] ?? null) === $name) { - $name .= '.'.$locale; - break; - } - } while (false !== $locale = strstr($locale, '_', true)); - } - - if (!isset($this->compiledRoutes[$name])) { - throw new RouteNotFoundException(sprintf('Unable to generate a URL for the named route "%s" as such route does not exist.', $name)); - } - - [$variables, $defaults, $requirements, $tokens, $hostTokens, $requiredSchemes, $deprecations] = $this->compiledRoutes[$name] + [6 => []]; - - foreach ($deprecations as $deprecation) { - trigger_deprecation($deprecation['package'], $deprecation['version'], $deprecation['message']); - } - - if (isset($defaults['_canonical_route']) && isset($defaults['_locale'])) { - if (!\in_array('_locale', $variables, true)) { - unset($parameters['_locale']); - } elseif (!isset($parameters['_locale'])) { - $parameters['_locale'] = $defaults['_locale']; - } - } - - return $this->doGenerate($variables, $defaults, $requirements, $tokens, $parameters, $name, $referenceType, $hostTokens, $requiredSchemes); - } -} diff --git a/vendor/symfony/routing/Generator/ConfigurableRequirementsInterface.php b/vendor/symfony/routing/Generator/ConfigurableRequirementsInterface.php deleted file mode 100644 index 2c99c913..00000000 --- a/vendor/symfony/routing/Generator/ConfigurableRequirementsInterface.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\Routing\Generator; - -/** - * ConfigurableRequirementsInterface must be implemented by URL generators that - * can be configured whether an exception should be generated when the parameters - * do not match the requirements. It is also possible to disable the requirements - * check for URL generation completely. - * - * The possible configurations and use-cases: - * - setStrictRequirements(true): Throw an exception for mismatching requirements. This - * is mostly useful in development environment. - * - setStrictRequirements(false): Don't throw an exception but return an empty string as URL for - * mismatching requirements and log the problem. Useful when you cannot control all - * params because they come from third party libs but don't want to have a 404 in - * production environment. It should log the mismatch so one can review it. - * - setStrictRequirements(null): Return the URL with the given parameters without - * checking the requirements at all. When generating a URL you should either trust - * your params or you validated them beforehand because otherwise it would break your - * link anyway. So in production environment you should know that params always pass - * the requirements. Thus this option allows to disable the check on URL generation for - * performance reasons (saving a preg_match for each requirement every time a URL is - * generated). - * - * @author Fabien Potencier - * @author Tobias Schultze - */ -interface ConfigurableRequirementsInterface -{ - /** - * Enables or disables the exception on incorrect parameters. - * Passing null will deactivate the requirements check completely. - */ - public function setStrictRequirements(?bool $enabled); - - /** - * Returns whether to throw an exception on incorrect parameters. - * Null means the requirements check is deactivated completely. - */ - public function isStrictRequirements(): ?bool; -} diff --git a/vendor/symfony/routing/Generator/Dumper/CompiledUrlGeneratorDumper.php b/vendor/symfony/routing/Generator/Dumper/CompiledUrlGeneratorDumper.php deleted file mode 100644 index 1144fed5..00000000 --- a/vendor/symfony/routing/Generator/Dumper/CompiledUrlGeneratorDumper.php +++ /dev/null @@ -1,121 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing\Generator\Dumper; - -use Symfony\Component\Routing\Exception\RouteCircularReferenceException; -use Symfony\Component\Routing\Exception\RouteNotFoundException; -use Symfony\Component\Routing\Matcher\Dumper\CompiledUrlMatcherDumper; - -/** - * CompiledUrlGeneratorDumper creates a PHP array to be used with CompiledUrlGenerator. - * - * @author Fabien Potencier - * @author Tobias Schultze - * @author Nicolas Grekas - */ -class CompiledUrlGeneratorDumper extends GeneratorDumper -{ - public function getCompiledRoutes(): array - { - $compiledRoutes = []; - foreach ($this->getRoutes()->all() as $name => $route) { - $compiledRoute = $route->compile(); - - $compiledRoutes[$name] = [ - $compiledRoute->getVariables(), - $route->getDefaults(), - $route->getRequirements(), - $compiledRoute->getTokens(), - $compiledRoute->getHostTokens(), - $route->getSchemes(), - [], - ]; - } - - return $compiledRoutes; - } - - public function getCompiledAliases(): array - { - $routes = $this->getRoutes(); - $compiledAliases = []; - foreach ($routes->getAliases() as $name => $alias) { - $deprecations = $alias->isDeprecated() ? [$alias->getDeprecation($name)] : []; - $currentId = $alias->getId(); - $visited = []; - while (null !== $alias = $routes->getAlias($currentId) ?? null) { - if (false !== $searchKey = array_search($currentId, $visited)) { - $visited[] = $currentId; - - throw new RouteCircularReferenceException($currentId, \array_slice($visited, $searchKey)); - } - - if ($alias->isDeprecated()) { - $deprecations[] = $deprecation = $alias->getDeprecation($currentId); - trigger_deprecation($deprecation['package'], $deprecation['version'], $deprecation['message']); - } - - $visited[] = $currentId; - $currentId = $alias->getId(); - } - - if (null === $target = $routes->get($currentId)) { - throw new RouteNotFoundException(sprintf('Target route "%s" for alias "%s" does not exist.', $currentId, $name)); - } - - $compiledTarget = $target->compile(); - - $compiledAliases[$name] = [ - $compiledTarget->getVariables(), - $target->getDefaults(), - $target->getRequirements(), - $compiledTarget->getTokens(), - $compiledTarget->getHostTokens(), - $target->getSchemes(), - $deprecations, - ]; - } - - return $compiledAliases; - } - - public function dump(array $options = []): string - { - return <<generateDeclaredRoutes()} -]; - -EOF; - } - - /** - * Generates PHP code representing an array of defined routes - * together with the routes properties (e.g. requirements). - */ - private function generateDeclaredRoutes(): string - { - $routes = ''; - foreach ($this->getCompiledRoutes() as $name => $properties) { - $routes .= sprintf("\n '%s' => %s,", $name, CompiledUrlMatcherDumper::export($properties)); - } - - foreach ($this->getCompiledAliases() as $alias => $properties) { - $routes .= sprintf("\n '%s' => %s,", $alias, CompiledUrlMatcherDumper::export($properties)); - } - - return $routes; - } -} diff --git a/vendor/symfony/routing/Generator/Dumper/GeneratorDumper.php b/vendor/symfony/routing/Generator/Dumper/GeneratorDumper.php deleted file mode 100644 index b82ff97b..00000000 --- a/vendor/symfony/routing/Generator/Dumper/GeneratorDumper.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing\Generator\Dumper; - -use Symfony\Component\Routing\RouteCollection; - -/** - * GeneratorDumper is the base class for all built-in generator dumpers. - * - * @author Fabien Potencier - */ -abstract class GeneratorDumper implements GeneratorDumperInterface -{ - private RouteCollection $routes; - - public function __construct(RouteCollection $routes) - { - $this->routes = $routes; - } - - public function getRoutes(): RouteCollection - { - return $this->routes; - } -} diff --git a/vendor/symfony/routing/Generator/Dumper/GeneratorDumperInterface.php b/vendor/symfony/routing/Generator/Dumper/GeneratorDumperInterface.php deleted file mode 100644 index d3294ce2..00000000 --- a/vendor/symfony/routing/Generator/Dumper/GeneratorDumperInterface.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\Routing\Generator\Dumper; - -use Symfony\Component\Routing\RouteCollection; - -/** - * GeneratorDumperInterface is the interface that all generator dumper classes must implement. - * - * @author Fabien Potencier - */ -interface GeneratorDumperInterface -{ - /** - * Dumps a set of routes to a string representation of executable code - * that can then be used to generate a URL of such a route. - */ - public function dump(array $options = []): string; - - /** - * Gets the routes to dump. - */ - public function getRoutes(): RouteCollection; -} diff --git a/vendor/symfony/routing/Generator/UrlGenerator.php b/vendor/symfony/routing/Generator/UrlGenerator.php deleted file mode 100644 index 7b27dcc7..00000000 --- a/vendor/symfony/routing/Generator/UrlGenerator.php +++ /dev/null @@ -1,354 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing\Generator; - -use Psr\Log\LoggerInterface; -use Symfony\Component\Routing\Exception\InvalidParameterException; -use Symfony\Component\Routing\Exception\MissingMandatoryParametersException; -use Symfony\Component\Routing\Exception\RouteNotFoundException; -use Symfony\Component\Routing\RequestContext; -use Symfony\Component\Routing\RouteCollection; - -/** - * UrlGenerator can generate a URL or a path for any route in the RouteCollection - * based on the passed parameters. - * - * @author Fabien Potencier - * @author Tobias Schultze - */ -class UrlGenerator implements UrlGeneratorInterface, ConfigurableRequirementsInterface -{ - private const QUERY_FRAGMENT_DECODED = [ - // RFC 3986 explicitly allows those in the query/fragment to reference other URIs unencoded - '%2F' => '/', - '%252F' => '%2F', - '%3F' => '?', - // reserved chars that have no special meaning for HTTP URIs in a query or fragment - // this excludes esp. "&", "=" and also "+" because PHP would treat it as a space (form-encoded) - '%40' => '@', - '%3A' => ':', - '%21' => '!', - '%3B' => ';', - '%2C' => ',', - '%2A' => '*', - ]; - - protected $routes; - protected $context; - - /** - * @var bool|null - */ - protected $strictRequirements = true; - - protected $logger; - - private ?string $defaultLocale; - - /** - * This array defines the characters (besides alphanumeric ones) that will not be percent-encoded in the path segment of the generated URL. - * - * PHP's rawurlencode() encodes all chars except "a-zA-Z0-9-._~" according to RFC 3986. But we want to allow some chars - * to be used in their literal form (reasons below). Other chars inside the path must of course be encoded, e.g. - * "?" and "#" (would be interpreted wrongly as query and fragment identifier), - * "'" and """ (are used as delimiters in HTML). - */ - protected $decodedChars = [ - // the slash can be used to designate a hierarchical structure and we want allow using it with this meaning - // some webservers don't allow the slash in encoded form in the path for security reasons anyway - // see http://stackoverflow.com/questions/4069002/http-400-if-2f-part-of-get-url-in-jboss - '%2F' => '/', - '%252F' => '%2F', - // the following chars are general delimiters in the URI specification but have only special meaning in the authority component - // so they can safely be used in the path in unencoded form - '%40' => '@', - '%3A' => ':', - // these chars are only sub-delimiters that have no predefined meaning and can therefore be used literally - // so URI producing applications can use these chars to delimit subcomponents in a path segment without being encoded for better readability - '%3B' => ';', - '%2C' => ',', - '%3D' => '=', - '%2B' => '+', - '%21' => '!', - '%2A' => '*', - '%7C' => '|', - ]; - - public function __construct(RouteCollection $routes, RequestContext $context, LoggerInterface $logger = null, string $defaultLocale = null) - { - $this->routes = $routes; - $this->context = $context; - $this->logger = $logger; - $this->defaultLocale = $defaultLocale; - } - - public function setContext(RequestContext $context) - { - $this->context = $context; - } - - public function getContext(): RequestContext - { - return $this->context; - } - - public function setStrictRequirements(?bool $enabled) - { - $this->strictRequirements = $enabled; - } - - public function isStrictRequirements(): ?bool - { - return $this->strictRequirements; - } - - public function generate(string $name, array $parameters = [], int $referenceType = self::ABSOLUTE_PATH): string - { - $route = null; - $locale = $parameters['_locale'] ?? $this->context->getParameter('_locale') ?: $this->defaultLocale; - - if (null !== $locale) { - do { - if (null !== ($route = $this->routes->get($name.'.'.$locale)) && $route->getDefault('_canonical_route') === $name) { - break; - } - } while (false !== $locale = strstr($locale, '_', true)); - } - - if (null === $route ??= $this->routes->get($name)) { - throw new RouteNotFoundException(sprintf('Unable to generate a URL for the named route "%s" as such route does not exist.', $name)); - } - - // the Route has a cache of its own and is not recompiled as long as it does not get modified - $compiledRoute = $route->compile(); - - $defaults = $route->getDefaults(); - $variables = $compiledRoute->getVariables(); - - if (isset($defaults['_canonical_route']) && isset($defaults['_locale'])) { - if (!\in_array('_locale', $variables, true)) { - unset($parameters['_locale']); - } elseif (!isset($parameters['_locale'])) { - $parameters['_locale'] = $defaults['_locale']; - } - } - - return $this->doGenerate($variables, $defaults, $route->getRequirements(), $compiledRoute->getTokens(), $parameters, $name, $referenceType, $compiledRoute->getHostTokens(), $route->getSchemes()); - } - - /** - * @throws MissingMandatoryParametersException When some parameters are missing that are mandatory for the route - * @throws InvalidParameterException When a parameter value for a placeholder is not correct because - * it does not match the requirement - */ - protected function doGenerate(array $variables, array $defaults, array $requirements, array $tokens, array $parameters, string $name, int $referenceType, array $hostTokens, array $requiredSchemes = []): string - { - $variables = array_flip($variables); - $mergedParams = array_replace($defaults, $this->context->getParameters(), $parameters); - - // all params must be given - if ($diff = array_diff_key($variables, $mergedParams)) { - throw new MissingMandatoryParametersException($name, array_keys($diff)); - } - - $url = ''; - $optional = true; - $message = 'Parameter "{parameter}" for route "{route}" must match "{expected}" ("{given}" given) to generate a corresponding URL.'; - foreach ($tokens as $token) { - if ('variable' === $token[0]) { - $varName = $token[3]; - // variable is not important by default - $important = $token[5] ?? false; - - if (!$optional || $important || !\array_key_exists($varName, $defaults) || (null !== $mergedParams[$varName] && (string) $mergedParams[$varName] !== (string) $defaults[$varName])) { - // check requirement (while ignoring look-around patterns) - if (null !== $this->strictRequirements && !preg_match('#^'.preg_replace('/\(\?(?:=|<=|!|strictRequirements) { - throw new InvalidParameterException(strtr($message, ['{parameter}' => $varName, '{route}' => $name, '{expected}' => $token[2], '{given}' => $mergedParams[$varName]])); - } - - $this->logger?->error($message, ['parameter' => $varName, 'route' => $name, 'expected' => $token[2], 'given' => $mergedParams[$varName]]); - - return ''; - } - - $url = $token[1].$mergedParams[$varName].$url; - $optional = false; - } - } else { - // static text - $url = $token[1].$url; - $optional = false; - } - } - - if ('' === $url) { - $url = '/'; - } - - // the contexts base URL is already encoded (see Symfony\Component\HttpFoundation\Request) - $url = strtr(rawurlencode($url), $this->decodedChars); - - // the path segments "." and ".." are interpreted as relative reference when resolving a URI; see http://tools.ietf.org/html/rfc3986#section-3.3 - // so we need to encode them as they are not used for this purpose here - // otherwise we would generate a URI that, when followed by a user agent (e.g. browser), does not match this route - $url = strtr($url, ['/../' => '/%2E%2E/', '/./' => '/%2E/']); - if (str_ends_with($url, '/..')) { - $url = substr($url, 0, -2).'%2E%2E'; - } elseif (str_ends_with($url, '/.')) { - $url = substr($url, 0, -1).'%2E'; - } - - $schemeAuthority = ''; - $host = $this->context->getHost(); - $scheme = $this->context->getScheme(); - - if ($requiredSchemes) { - if (!\in_array($scheme, $requiredSchemes, true)) { - $referenceType = self::ABSOLUTE_URL; - $scheme = current($requiredSchemes); - } - } - - if ($hostTokens) { - $routeHost = ''; - foreach ($hostTokens as $token) { - if ('variable' === $token[0]) { - // check requirement (while ignoring look-around patterns) - if (null !== $this->strictRequirements && !preg_match('#^'.preg_replace('/\(\?(?:=|<=|!|strictRequirements) { - throw new InvalidParameterException(strtr($message, ['{parameter}' => $token[3], '{route}' => $name, '{expected}' => $token[2], '{given}' => $mergedParams[$token[3]]])); - } - - $this->logger?->error($message, ['parameter' => $token[3], 'route' => $name, 'expected' => $token[2], 'given' => $mergedParams[$token[3]]]); - - return ''; - } - - $routeHost = $token[1].$mergedParams[$token[3]].$routeHost; - } else { - $routeHost = $token[1].$routeHost; - } - } - - if ($routeHost !== $host) { - $host = $routeHost; - if (self::ABSOLUTE_URL !== $referenceType) { - $referenceType = self::NETWORK_PATH; - } - } - } - - if (self::ABSOLUTE_URL === $referenceType || self::NETWORK_PATH === $referenceType) { - if ('' !== $host || ('' !== $scheme && 'http' !== $scheme && 'https' !== $scheme)) { - $port = ''; - if ('http' === $scheme && 80 !== $this->context->getHttpPort()) { - $port = ':'.$this->context->getHttpPort(); - } elseif ('https' === $scheme && 443 !== $this->context->getHttpsPort()) { - $port = ':'.$this->context->getHttpsPort(); - } - - $schemeAuthority = self::NETWORK_PATH === $referenceType || '' === $scheme ? '//' : "$scheme://"; - $schemeAuthority .= $host.$port; - } - } - - if (self::RELATIVE_PATH === $referenceType) { - $url = self::getRelativePath($this->context->getPathInfo(), $url); - } else { - $url = $schemeAuthority.$this->context->getBaseUrl().$url; - } - - // add a query string if needed - $extra = array_udiff_assoc(array_diff_key($parameters, $variables), $defaults, function ($a, $b) { - return $a == $b ? 0 : 1; - }); - - array_walk_recursive($extra, $caster = static function (&$v) use (&$caster) { - if (\is_object($v)) { - if ($vars = get_object_vars($v)) { - array_walk_recursive($vars, $caster); - $v = $vars; - } elseif (method_exists($v, '__toString')) { - $v = (string) $v; - } - } - }); - - // extract fragment - $fragment = $defaults['_fragment'] ?? ''; - - if (isset($extra['_fragment'])) { - $fragment = $extra['_fragment']; - unset($extra['_fragment']); - } - - if ($extra && $query = http_build_query($extra, '', '&', \PHP_QUERY_RFC3986)) { - $url .= '?'.strtr($query, self::QUERY_FRAGMENT_DECODED); - } - - if ('' !== $fragment) { - $url .= '#'.strtr(rawurlencode($fragment), self::QUERY_FRAGMENT_DECODED); - } - - return $url; - } - - /** - * Returns the target path as relative reference from the base path. - * - * Only the URIs path component (no schema, host etc.) is relevant and must be given, starting with a slash. - * Both paths must be absolute and not contain relative parts. - * Relative URLs from one resource to another are useful when generating self-contained downloadable document archives. - * Furthermore, they can be used to reduce the link size in documents. - * - * Example target paths, given a base path of "/a/b/c/d": - * - "/a/b/c/d" -> "" - * - "/a/b/c/" -> "./" - * - "/a/b/" -> "../" - * - "/a/b/c/other" -> "other" - * - "/a/x/y" -> "../../x/y" - * - * @param string $basePath The base path - * @param string $targetPath The target path - */ - public static function getRelativePath(string $basePath, string $targetPath): string - { - if ($basePath === $targetPath) { - return ''; - } - - $sourceDirs = explode('/', isset($basePath[0]) && '/' === $basePath[0] ? substr($basePath, 1) : $basePath); - $targetDirs = explode('/', isset($targetPath[0]) && '/' === $targetPath[0] ? substr($targetPath, 1) : $targetPath); - array_pop($sourceDirs); - $targetFile = array_pop($targetDirs); - - foreach ($sourceDirs as $i => $dir) { - if (isset($targetDirs[$i]) && $dir === $targetDirs[$i]) { - unset($sourceDirs[$i], $targetDirs[$i]); - } else { - break; - } - } - - $targetDirs[] = $targetFile; - $path = str_repeat('../', \count($sourceDirs)).implode('/', $targetDirs); - - // A reference to the same base directory or an empty subdirectory must be prefixed with "./". - // This also applies to a segment with a colon character (e.g., "file:colon") that cannot be used - // as the first segment of a relative-path reference, as it would be mistaken for a scheme name - // (see http://tools.ietf.org/html/rfc3986#section-4.2). - return '' === $path || '/' === $path[0] - || false !== ($colonPos = strpos($path, ':')) && ($colonPos < ($slashPos = strpos($path, '/')) || false === $slashPos) - ? "./$path" : $path; - } -} diff --git a/vendor/symfony/routing/Generator/UrlGeneratorInterface.php b/vendor/symfony/routing/Generator/UrlGeneratorInterface.php deleted file mode 100644 index 51210b4b..00000000 --- a/vendor/symfony/routing/Generator/UrlGeneratorInterface.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\Routing\Generator; - -use Symfony\Component\Routing\Exception\InvalidParameterException; -use Symfony\Component\Routing\Exception\MissingMandatoryParametersException; -use Symfony\Component\Routing\Exception\RouteNotFoundException; -use Symfony\Component\Routing\RequestContextAwareInterface; - -/** - * UrlGeneratorInterface is the interface that all URL generator classes must implement. - * - * The constants in this interface define the different types of resource references that - * are declared in RFC 3986: http://tools.ietf.org/html/rfc3986 - * We are using the term "URL" instead of "URI" as this is more common in web applications - * and we do not need to distinguish them as the difference is mostly semantical and - * less technical. Generating URIs, i.e. representation-independent resource identifiers, - * is also possible. - * - * @author Fabien Potencier - * @author Tobias Schultze - */ -interface UrlGeneratorInterface extends RequestContextAwareInterface -{ - /** - * Generates an absolute URL, e.g. "http://example.com/dir/file". - */ - public const ABSOLUTE_URL = 0; - - /** - * Generates an absolute path, e.g. "/dir/file". - */ - public const ABSOLUTE_PATH = 1; - - /** - * Generates a relative path based on the current request path, e.g. "../parent-file". - * - * @see UrlGenerator::getRelativePath() - */ - public const RELATIVE_PATH = 2; - - /** - * Generates a network path, e.g. "//example.com/dir/file". - * Such reference reuses the current scheme but specifies the host. - */ - public const NETWORK_PATH = 3; - - /** - * Generates a URL or path for a specific route based on the given parameters. - * - * Parameters that reference placeholders in the route pattern will substitute them in the - * path or host. Extra params are added as query string to the URL. - * - * When the passed reference type cannot be generated for the route because it requires a different - * host or scheme than the current one, the method will return a more comprehensive reference - * that includes the required params. For example, when you call this method with $referenceType = ABSOLUTE_PATH - * but the route requires the https scheme whereas the current scheme is http, it will instead return an - * ABSOLUTE_URL with the https scheme and the current host. This makes sure the generated URL matches - * the route in any case. - * - * If there is no route with the given name, the generator must throw the RouteNotFoundException. - * - * The special parameter _fragment will be used as the document fragment suffixed to the final URL. - * - * @throws RouteNotFoundException If the named route doesn't exist - * @throws MissingMandatoryParametersException When some parameters are missing that are mandatory for the route - * @throws InvalidParameterException When a parameter value for a placeholder is not correct because - * it does not match the requirement - */ - public function generate(string $name, array $parameters = [], int $referenceType = self::ABSOLUTE_PATH): string; -} diff --git a/vendor/symfony/routing/LICENSE b/vendor/symfony/routing/LICENSE deleted file mode 100644 index 88bf75bb..00000000 --- a/vendor/symfony/routing/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2022 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/routing/Loader/AnnotationClassLoader.php b/vendor/symfony/routing/Loader/AnnotationClassLoader.php deleted file mode 100644 index b63dc5c8..00000000 --- a/vendor/symfony/routing/Loader/AnnotationClassLoader.php +++ /dev/null @@ -1,372 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing\Loader; - -use Doctrine\Common\Annotations\Reader; -use Symfony\Component\Config\Loader\LoaderInterface; -use Symfony\Component\Config\Loader\LoaderResolverInterface; -use Symfony\Component\Config\Resource\FileResource; -use Symfony\Component\Routing\Annotation\Route as RouteAnnotation; -use Symfony\Component\Routing\Route; -use Symfony\Component\Routing\RouteCollection; - -/** - * AnnotationClassLoader loads routing information from a PHP class and its methods. - * - * You need to define an implementation for the configureRoute() method. Most of the - * time, this method should define some PHP callable to be called for the route - * (a controller in MVC speak). - * - * The @Route annotation can be set on the class (for global parameters), - * and on each method. - * - * The @Route annotation main value is the route path. The annotation also - * recognizes several parameters: requirements, options, defaults, schemes, - * methods, host, and name. The name parameter is mandatory. - * Here is an example of how you should be able to use it: - * /** - * * @Route("/Blog") - * * / - * class Blog - * { - * /** - * * @Route("/", name="blog_index") - * * / - * public function index() - * { - * } - * /** - * * @Route("/{id}", name="blog_post", requirements = {"id" = "\d+"}) - * * / - * public function show() - * { - * } - * } - * - * On PHP 8, the annotation class can be used as an attribute as well: - * #[Route('/Blog')] - * class Blog - * { - * #[Route('/', name: 'blog_index')] - * public function index() - * { - * } - * #[Route('/{id}', name: 'blog_post', requirements: ["id" => '\d+'])] - * public function show() - * { - * } - * } - - * - * @author Fabien Potencier - * @author Alexander M. Turek - */ -abstract class AnnotationClassLoader implements LoaderInterface -{ - protected $reader; - protected $env; - - /** - * @var string - */ - protected $routeAnnotationClass = RouteAnnotation::class; - - /** - * @var int - */ - protected $defaultRouteIndex = 0; - - public function __construct(Reader $reader = null, string $env = null) - { - $this->reader = $reader; - $this->env = $env; - } - - /** - * Sets the annotation class to read route properties from. - */ - public function setRouteAnnotationClass(string $class) - { - $this->routeAnnotationClass = $class; - } - - /** - * Loads from annotations from a class. - * - * @throws \InvalidArgumentException When route can't be parsed - */ - public function load(mixed $class, string $type = null): RouteCollection - { - if (!class_exists($class)) { - throw new \InvalidArgumentException(sprintf('Class "%s" does not exist.', $class)); - } - - $class = new \ReflectionClass($class); - if ($class->isAbstract()) { - throw new \InvalidArgumentException(sprintf('Annotations from class "%s" cannot be read as it is abstract.', $class->getName())); - } - - $globals = $this->getGlobals($class); - - $collection = new RouteCollection(); - $collection->addResource(new FileResource($class->getFileName())); - - if ($globals['env'] && $this->env !== $globals['env']) { - return $collection; - } - - foreach ($class->getMethods() as $method) { - $this->defaultRouteIndex = 0; - foreach ($this->getAnnotations($method) as $annot) { - $this->addRoute($collection, $annot, $globals, $class, $method); - } - } - - if (0 === $collection->count() && $class->hasMethod('__invoke')) { - $globals = $this->resetGlobals(); - foreach ($this->getAnnotations($class) as $annot) { - $this->addRoute($collection, $annot, $globals, $class, $class->getMethod('__invoke')); - } - } - - return $collection; - } - - /** - * @param RouteAnnotation $annot or an object that exposes a similar interface - */ - protected function addRoute(RouteCollection $collection, object $annot, array $globals, \ReflectionClass $class, \ReflectionMethod $method) - { - if ($annot->getEnv() && $annot->getEnv() !== $this->env) { - return; - } - - $name = $annot->getName() ?? $this->getDefaultRouteName($class, $method); - $name = $globals['name'].$name; - - $requirements = $annot->getRequirements(); - - foreach ($requirements as $placeholder => $requirement) { - if (\is_int($placeholder)) { - throw new \InvalidArgumentException(sprintf('A placeholder name must be a string (%d given). Did you forget to specify the placeholder key for the requirement "%s" of route "%s" in "%s::%s()"?', $placeholder, $requirement, $name, $class->getName(), $method->getName())); - } - } - - $defaults = array_replace($globals['defaults'], $annot->getDefaults()); - $requirements = array_replace($globals['requirements'], $requirements); - $options = array_replace($globals['options'], $annot->getOptions()); - $schemes = array_merge($globals['schemes'], $annot->getSchemes()); - $methods = array_merge($globals['methods'], $annot->getMethods()); - - $host = $annot->getHost() ?? $globals['host']; - $condition = $annot->getCondition() ?? $globals['condition']; - $priority = $annot->getPriority() ?? $globals['priority']; - - $path = $annot->getLocalizedPaths() ?: $annot->getPath(); - $prefix = $globals['localized_paths'] ?: $globals['path']; - $paths = []; - - if (\is_array($path)) { - if (!\is_array($prefix)) { - foreach ($path as $locale => $localePath) { - $paths[$locale] = $prefix.$localePath; - } - } elseif ($missing = array_diff_key($prefix, $path)) { - throw new \LogicException(sprintf('Route to "%s" is missing paths for locale(s) "%s".', $class->name.'::'.$method->name, implode('", "', array_keys($missing)))); - } else { - foreach ($path as $locale => $localePath) { - if (!isset($prefix[$locale])) { - throw new \LogicException(sprintf('Route to "%s" with locale "%s" is missing a corresponding prefix in class "%s".', $method->name, $locale, $class->name)); - } - - $paths[$locale] = $prefix[$locale].$localePath; - } - } - } elseif (\is_array($prefix)) { - foreach ($prefix as $locale => $localePrefix) { - $paths[$locale] = $localePrefix.$path; - } - } else { - $paths[] = $prefix.$path; - } - - foreach ($method->getParameters() as $param) { - if (isset($defaults[$param->name]) || !$param->isDefaultValueAvailable()) { - continue; - } - foreach ($paths as $locale => $path) { - if (preg_match(sprintf('/\{%s(?:<.*?>)?\}/', preg_quote($param->name)), $path)) { - $defaults[$param->name] = $param->getDefaultValue(); - break; - } - } - } - - foreach ($paths as $locale => $path) { - $route = $this->createRoute($path, $defaults, $requirements, $options, $host, $schemes, $methods, $condition); - $this->configureRoute($route, $class, $method, $annot); - if (0 !== $locale) { - $route->setDefault('_locale', $locale); - $route->setRequirement('_locale', preg_quote($locale)); - $route->setDefault('_canonical_route', $name); - $collection->add($name.'.'.$locale, $route, $priority); - } else { - $collection->add($name, $route, $priority); - } - } - } - - public function supports(mixed $resource, string $type = null): bool - { - return \is_string($resource) && preg_match('/^(?:\\\\?[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)+$/', $resource) && (!$type || \in_array($type, ['annotation', 'attribute'], true)); - } - - public function setResolver(LoaderResolverInterface $resolver) - { - } - - public function getResolver(): LoaderResolverInterface - { - } - - /** - * Gets the default route name for a class method. - * - * @return string - */ - protected function getDefaultRouteName(\ReflectionClass $class, \ReflectionMethod $method) - { - $name = str_replace('\\', '_', $class->name).'_'.$method->name; - $name = \function_exists('mb_strtolower') && preg_match('//u', $name) ? mb_strtolower($name, 'UTF-8') : strtolower($name); - if ($this->defaultRouteIndex > 0) { - $name .= '_'.$this->defaultRouteIndex; - } - ++$this->defaultRouteIndex; - - return $name; - } - - protected function getGlobals(\ReflectionClass $class) - { - $globals = $this->resetGlobals(); - - $annot = null; - if ($attribute = $class->getAttributes($this->routeAnnotationClass, \ReflectionAttribute::IS_INSTANCEOF)[0] ?? null) { - $annot = $attribute->newInstance(); - } - if (!$annot && $this->reader) { - $annot = $this->reader->getClassAnnotation($class, $this->routeAnnotationClass); - } - - if ($annot) { - if (null !== $annot->getName()) { - $globals['name'] = $annot->getName(); - } - - if (null !== $annot->getPath()) { - $globals['path'] = $annot->getPath(); - } - - $globals['localized_paths'] = $annot->getLocalizedPaths(); - - if (null !== $annot->getRequirements()) { - $globals['requirements'] = $annot->getRequirements(); - } - - if (null !== $annot->getOptions()) { - $globals['options'] = $annot->getOptions(); - } - - if (null !== $annot->getDefaults()) { - $globals['defaults'] = $annot->getDefaults(); - } - - if (null !== $annot->getSchemes()) { - $globals['schemes'] = $annot->getSchemes(); - } - - if (null !== $annot->getMethods()) { - $globals['methods'] = $annot->getMethods(); - } - - if (null !== $annot->getHost()) { - $globals['host'] = $annot->getHost(); - } - - if (null !== $annot->getCondition()) { - $globals['condition'] = $annot->getCondition(); - } - - $globals['priority'] = $annot->getPriority() ?? 0; - $globals['env'] = $annot->getEnv(); - - foreach ($globals['requirements'] as $placeholder => $requirement) { - if (\is_int($placeholder)) { - throw new \InvalidArgumentException(sprintf('A placeholder name must be a string (%d given). Did you forget to specify the placeholder key for the requirement "%s" in "%s"?', $placeholder, $requirement, $class->getName())); - } - } - } - - return $globals; - } - - private function resetGlobals(): array - { - return [ - 'path' => null, - 'localized_paths' => [], - 'requirements' => [], - 'options' => [], - 'defaults' => [], - 'schemes' => [], - 'methods' => [], - 'host' => '', - 'condition' => '', - 'name' => '', - 'priority' => 0, - 'env' => null, - ]; - } - - protected function createRoute(string $path, array $defaults, array $requirements, array $options, ?string $host, array $schemes, array $methods, ?string $condition) - { - return new Route($path, $defaults, $requirements, $options, $host, $schemes, $methods, $condition); - } - - abstract protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, object $annot); - - /** - * @param \ReflectionClass|\ReflectionMethod $reflection - * - * @return iterable - */ - private function getAnnotations(object $reflection): iterable - { - foreach ($reflection->getAttributes($this->routeAnnotationClass, \ReflectionAttribute::IS_INSTANCEOF) as $attribute) { - yield $attribute->newInstance(); - } - - if (!$this->reader) { - return; - } - - $annotations = $reflection instanceof \ReflectionClass - ? $this->reader->getClassAnnotations($reflection) - : $this->reader->getMethodAnnotations($reflection); - - foreach ($annotations as $annotation) { - if ($annotation instanceof $this->routeAnnotationClass) { - yield $annotation; - } - } - } -} diff --git a/vendor/symfony/routing/Loader/AnnotationDirectoryLoader.php b/vendor/symfony/routing/Loader/AnnotationDirectoryLoader.php deleted file mode 100644 index 25867359..00000000 --- a/vendor/symfony/routing/Loader/AnnotationDirectoryLoader.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\Routing\Loader; - -use Symfony\Component\Config\Resource\DirectoryResource; -use Symfony\Component\Routing\RouteCollection; - -/** - * AnnotationDirectoryLoader loads routing information from annotations set - * on PHP classes and methods. - * - * @author Fabien Potencier - */ -class AnnotationDirectoryLoader extends AnnotationFileLoader -{ - /** - * @throws \InvalidArgumentException When the directory does not exist or its routes cannot be parsed - */ - public function load(mixed $path, string $type = null): ?RouteCollection - { - if (!is_dir($dir = $this->locator->locate($path))) { - return parent::supports($path, $type) ? parent::load($path, $type) : new RouteCollection(); - } - - $collection = new RouteCollection(); - $collection->addResource(new DirectoryResource($dir, '/\.php$/')); - $files = iterator_to_array(new \RecursiveIteratorIterator( - new \RecursiveCallbackFilterIterator( - new \RecursiveDirectoryIterator($dir, \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS), - function (\SplFileInfo $current) { - return !str_starts_with($current->getBasename(), '.'); - } - ), - \RecursiveIteratorIterator::LEAVES_ONLY - )); - usort($files, function (\SplFileInfo $a, \SplFileInfo $b) { - return (string) $a > (string) $b ? 1 : -1; - }); - - foreach ($files as $file) { - if (!$file->isFile() || !str_ends_with($file->getFilename(), '.php')) { - continue; - } - - if ($class = $this->findClass($file)) { - $refl = new \ReflectionClass($class); - if ($refl->isAbstract()) { - continue; - } - - $collection->addCollection($this->loader->load($class, $type)); - } - } - - return $collection; - } - - public function supports(mixed $resource, string $type = null): bool - { - if (!\is_string($resource)) { - return false; - } - - if (\in_array($type, ['annotation', 'attribute'], true)) { - return true; - } - - if ($type) { - return false; - } - - try { - return is_dir($this->locator->locate($resource)); - } catch (\Exception) { - return false; - } - } -} diff --git a/vendor/symfony/routing/Loader/AnnotationFileLoader.php b/vendor/symfony/routing/Loader/AnnotationFileLoader.php deleted file mode 100644 index 5699824d..00000000 --- a/vendor/symfony/routing/Loader/AnnotationFileLoader.php +++ /dev/null @@ -1,136 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing\Loader; - -use Symfony\Component\Config\FileLocatorInterface; -use Symfony\Component\Config\Loader\FileLoader; -use Symfony\Component\Config\Resource\FileResource; -use Symfony\Component\Routing\RouteCollection; - -/** - * AnnotationFileLoader loads routing information from annotations set - * on a PHP class and its methods. - * - * @author Fabien Potencier - */ -class AnnotationFileLoader extends FileLoader -{ - protected $loader; - - public function __construct(FileLocatorInterface $locator, AnnotationClassLoader $loader) - { - if (!\function_exists('token_get_all')) { - throw new \LogicException('The Tokenizer extension is required for the routing annotation loaders.'); - } - - parent::__construct($locator); - - $this->loader = $loader; - } - - /** - * Loads from annotations from a file. - * - * @throws \InvalidArgumentException When the file does not exist or its routes cannot be parsed - */ - public function load(mixed $file, string $type = null): ?RouteCollection - { - $path = $this->locator->locate($file); - - $collection = new RouteCollection(); - if ($class = $this->findClass($path)) { - $refl = new \ReflectionClass($class); - if ($refl->isAbstract()) { - return null; - } - - $collection->addResource(new FileResource($path)); - $collection->addCollection($this->loader->load($class, $type)); - } - - gc_mem_caches(); - - return $collection; - } - - public function supports(mixed $resource, string $type = null): bool - { - return \is_string($resource) && 'php' === pathinfo($resource, \PATHINFO_EXTENSION) && (!$type || \in_array($type, ['annotation', 'attribute'], true)); - } - - /** - * Returns the full class name for the first class in the file. - */ - protected function findClass(string $file): string|false - { - $class = false; - $namespace = false; - $tokens = token_get_all(file_get_contents($file)); - - if (1 === \count($tokens) && \T_INLINE_HTML === $tokens[0][0]) { - throw new \InvalidArgumentException(sprintf('The file "%s" does not contain PHP code. Did you forgot to add the " true, \T_STRING => true]; - if (\defined('T_NAME_QUALIFIED')) { - $nsTokens[\T_NAME_QUALIFIED] = true; - } - for ($i = 0; isset($tokens[$i]); ++$i) { - $token = $tokens[$i]; - if (!isset($token[1])) { - continue; - } - - if (true === $class && \T_STRING === $token[0]) { - return $namespace.'\\'.$token[1]; - } - - if (true === $namespace && isset($nsTokens[$token[0]])) { - $namespace = $token[1]; - while (isset($tokens[++$i][1], $nsTokens[$tokens[$i][0]])) { - $namespace .= $tokens[$i][1]; - } - $token = $tokens[$i]; - } - - if (\T_CLASS === $token[0]) { - // Skip usage of ::class constant and anonymous classes - $skipClassToken = false; - for ($j = $i - 1; $j > 0; --$j) { - if (!isset($tokens[$j][1])) { - if ('(' === $tokens[$j] || ',' === $tokens[$j]) { - $skipClassToken = true; - } - break; - } - - if (\T_DOUBLE_COLON === $tokens[$j][0] || \T_NEW === $tokens[$j][0]) { - $skipClassToken = true; - break; - } elseif (!\in_array($tokens[$j][0], [\T_WHITESPACE, \T_DOC_COMMENT, \T_COMMENT])) { - break; - } - } - - if (!$skipClassToken) { - $class = true; - } - } - - if (\T_NAMESPACE === $token[0]) { - $namespace = true; - } - } - - return false; - } -} diff --git a/vendor/symfony/routing/Loader/ClosureLoader.php b/vendor/symfony/routing/Loader/ClosureLoader.php deleted file mode 100644 index e079e78c..00000000 --- a/vendor/symfony/routing/Loader/ClosureLoader.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing\Loader; - -use Symfony\Component\Config\Loader\Loader; -use Symfony\Component\Routing\RouteCollection; - -/** - * ClosureLoader loads routes from a PHP closure. - * - * The Closure must return a RouteCollection instance. - * - * @author Fabien Potencier - */ -class ClosureLoader extends Loader -{ - /** - * Loads a Closure. - */ - public function load(mixed $closure, string $type = null): RouteCollection - { - return $closure($this->env); - } - - public function supports(mixed $resource, string $type = null): bool - { - return $resource instanceof \Closure && (!$type || 'closure' === $type); - } -} diff --git a/vendor/symfony/routing/Loader/Configurator/AliasConfigurator.php b/vendor/symfony/routing/Loader/Configurator/AliasConfigurator.php deleted file mode 100644 index c908456e..00000000 --- a/vendor/symfony/routing/Loader/Configurator/AliasConfigurator.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\Routing\Loader\Configurator; - -use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; -use Symfony\Component\Routing\Alias; - -class AliasConfigurator -{ - private Alias $alias; - - public function __construct(Alias $alias) - { - $this->alias = $alias; - } - - /** - * Whether this alias is deprecated, that means it should not be called anymore. - * - * @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 deprecation message to use - * - * @return $this - * - * @throws InvalidArgumentException when the message template is invalid - */ - public function deprecate(string $package, string $version, string $message): static - { - $this->alias->setDeprecated($package, $version, $message); - - return $this; - } -} diff --git a/vendor/symfony/routing/Loader/Configurator/CollectionConfigurator.php b/vendor/symfony/routing/Loader/Configurator/CollectionConfigurator.php deleted file mode 100644 index e29dcb2b..00000000 --- a/vendor/symfony/routing/Loader/Configurator/CollectionConfigurator.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\Routing\Loader\Configurator; - -use Symfony\Component\Routing\Route; -use Symfony\Component\Routing\RouteCollection; - -/** - * @author Nicolas Grekas - */ -class CollectionConfigurator -{ - use Traits\AddTrait; - use Traits\HostTrait; - use Traits\RouteTrait; - - private RouteCollection $parent; - private ?CollectionConfigurator $parentConfigurator; - private ?array $parentPrefixes; - private string|array|null $host = null; - - public function __construct(RouteCollection $parent, string $name, self $parentConfigurator = null, array $parentPrefixes = null) - { - $this->parent = $parent; - $this->name = $name; - $this->collection = new RouteCollection(); - $this->route = new Route(''); - $this->parentConfigurator = $parentConfigurator; // for GC control - $this->parentPrefixes = $parentPrefixes; - } - - public function __sleep(): array - { - throw new \BadMethodCallException('Cannot serialize '.__CLASS__); - } - - public function __wakeup() - { - throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); - } - - public function __destruct() - { - if (null === $this->prefixes) { - $this->collection->addPrefix($this->route->getPath()); - } - if (null !== $this->host) { - $this->addHost($this->collection, $this->host); - } - - $this->parent->addCollection($this->collection); - } - - /** - * Creates a sub-collection. - */ - final public function collection(string $name = ''): self - { - return new self($this->collection, $this->name.$name, $this, $this->prefixes); - } - - /** - * Sets the prefix to add to the path of all child routes. - * - * @param string|array $prefix the prefix, or the localized prefixes - * - * @return $this - */ - final public function prefix(string|array $prefix): static - { - if (\is_array($prefix)) { - if (null === $this->parentPrefixes) { - // no-op - } elseif ($missing = array_diff_key($this->parentPrefixes, $prefix)) { - throw new \LogicException(sprintf('Collection "%s" is missing prefixes for locale(s) "%s".', $this->name, implode('", "', array_keys($missing)))); - } else { - foreach ($prefix as $locale => $localePrefix) { - if (!isset($this->parentPrefixes[$locale])) { - throw new \LogicException(sprintf('Collection "%s" with locale "%s" is missing a corresponding prefix in its parent collection.', $this->name, $locale)); - } - - $prefix[$locale] = $this->parentPrefixes[$locale].$localePrefix; - } - } - $this->prefixes = $prefix; - $this->route->setPath('/'); - } else { - $this->prefixes = null; - $this->route->setPath($prefix); - } - - return $this; - } - - /** - * Sets the host to use for all child routes. - * - * @param string|array $host the host, or the localized hosts - * - * @return $this - */ - final public function host(string|array $host): static - { - $this->host = $host; - - return $this; - } - - private function createRoute(string $path): Route - { - return (clone $this->route)->setPath($path); - } -} diff --git a/vendor/symfony/routing/Loader/Configurator/ImportConfigurator.php b/vendor/symfony/routing/Loader/Configurator/ImportConfigurator.php deleted file mode 100644 index c1c7d77f..00000000 --- a/vendor/symfony/routing/Loader/Configurator/ImportConfigurator.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\Routing\Loader\Configurator; - -use Symfony\Component\Routing\RouteCollection; - -/** - * @author Nicolas Grekas - */ -class ImportConfigurator -{ - use Traits\HostTrait; - use Traits\PrefixTrait; - use Traits\RouteTrait; - - private RouteCollection $parent; - - public function __construct(RouteCollection $parent, RouteCollection $route) - { - $this->parent = $parent; - $this->route = $route; - } - - public function __sleep(): array - { - throw new \BadMethodCallException('Cannot serialize '.__CLASS__); - } - - public function __wakeup() - { - throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); - } - - public function __destruct() - { - $this->parent->addCollection($this->route); - } - - /** - * Sets the prefix to add to the path of all child routes. - * - * @param string|array $prefix the prefix, or the localized prefixes - * - * @return $this - */ - final public function prefix(string|array $prefix, bool $trailingSlashOnRoot = true): static - { - $this->addPrefix($this->route, $prefix, $trailingSlashOnRoot); - - return $this; - } - - /** - * Sets the prefix to add to the name of all child routes. - * - * @return $this - */ - final public function namePrefix(string $namePrefix): static - { - $this->route->addNamePrefix($namePrefix); - - return $this; - } - - /** - * Sets the host to use for all child routes. - * - * @param string|array $host the host, or the localized hosts - * - * @return $this - */ - final public function host(string|array $host): static - { - $this->addHost($this->route, $host); - - return $this; - } -} diff --git a/vendor/symfony/routing/Loader/Configurator/RouteConfigurator.php b/vendor/symfony/routing/Loader/Configurator/RouteConfigurator.php deleted file mode 100644 index 9407cc8e..00000000 --- a/vendor/symfony/routing/Loader/Configurator/RouteConfigurator.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing\Loader\Configurator; - -use Symfony\Component\Routing\RouteCollection; - -/** - * @author Nicolas Grekas - */ -class RouteConfigurator -{ - use Traits\AddTrait; - use Traits\HostTrait; - use Traits\RouteTrait; - - protected $parentConfigurator; - - public function __construct(RouteCollection $collection, RouteCollection $route, string $name = '', CollectionConfigurator $parentConfigurator = null, array $prefixes = null) - { - $this->collection = $collection; - $this->route = $route; - $this->name = $name; - $this->parentConfigurator = $parentConfigurator; // for GC control - $this->prefixes = $prefixes; - } - - /** - * Sets the host to use for all child routes. - * - * @param string|array $host the host, or the localized hosts - * - * @return $this - */ - final public function host(string|array $host): static - { - $this->addHost($this->route, $host); - - return $this; - } -} diff --git a/vendor/symfony/routing/Loader/Configurator/RoutingConfigurator.php b/vendor/symfony/routing/Loader/Configurator/RoutingConfigurator.php deleted file mode 100644 index 80f9330d..00000000 --- a/vendor/symfony/routing/Loader/Configurator/RoutingConfigurator.php +++ /dev/null @@ -1,78 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing\Loader\Configurator; - -use Symfony\Component\Routing\Loader\PhpFileLoader; -use Symfony\Component\Routing\RouteCollection; - -/** - * @author Nicolas Grekas - */ -class RoutingConfigurator -{ - use Traits\AddTrait; - - private PhpFileLoader $loader; - private string $path; - private string $file; - private ?string $env; - - public function __construct(RouteCollection $collection, PhpFileLoader $loader, string $path, string $file, string $env = null) - { - $this->collection = $collection; - $this->loader = $loader; - $this->path = $path; - $this->file = $file; - $this->env = $env; - } - - /** - * @param string|string[]|null $exclude Glob patterns to exclude from the import - */ - final public function import(string|array $resource, string $type = null, bool $ignoreErrors = false, string|array $exclude = null): ImportConfigurator - { - $this->loader->setCurrentDir(\dirname($this->path)); - - $imported = $this->loader->import($resource, $type, $ignoreErrors, $this->file, $exclude) ?: []; - if (!\is_array($imported)) { - return new ImportConfigurator($this->collection, $imported); - } - - $mergedCollection = new RouteCollection(); - foreach ($imported as $subCollection) { - $mergedCollection->addCollection($subCollection); - } - - return new ImportConfigurator($this->collection, $mergedCollection); - } - - final public function collection(string $name = ''): CollectionConfigurator - { - return new CollectionConfigurator($this->collection, $name); - } - - /** - * Get the current environment to be able to write conditional configuration. - */ - final public function env(): ?string - { - return $this->env; - } - - final public function withPath(string $path): static - { - $clone = clone $this; - $clone->path = $clone->file = $path; - - return $clone; - } -} diff --git a/vendor/symfony/routing/Loader/Configurator/Traits/AddTrait.php b/vendor/symfony/routing/Loader/Configurator/Traits/AddTrait.php deleted file mode 100644 index 5698df5d..00000000 --- a/vendor/symfony/routing/Loader/Configurator/Traits/AddTrait.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing\Loader\Configurator\Traits; - -use Symfony\Component\Routing\Loader\Configurator\AliasConfigurator; -use Symfony\Component\Routing\Loader\Configurator\CollectionConfigurator; -use Symfony\Component\Routing\Loader\Configurator\RouteConfigurator; -use Symfony\Component\Routing\RouteCollection; - -/** - * @author Nicolas Grekas - */ -trait AddTrait -{ - use LocalizedRouteTrait; - - /** - * @var RouteCollection - */ - protected $collection; - protected $name = ''; - protected $prefixes; - - /** - * Adds a route. - * - * @param string|array $path the path, or the localized paths of the route - */ - public function add(string $name, string|array $path): RouteConfigurator - { - $parentConfigurator = $this instanceof CollectionConfigurator ? $this : ($this instanceof RouteConfigurator ? $this->parentConfigurator : null); - $route = $this->createLocalizedRoute($this->collection, $name, $path, $this->name, $this->prefixes); - - return new RouteConfigurator($this->collection, $route, $this->name, $parentConfigurator, $this->prefixes); - } - - public function alias(string $name, string $alias): AliasConfigurator - { - return new AliasConfigurator($this->collection->addAlias($name, $alias)); - } - - /** - * Adds a route. - * - * @param string|array $path the path, or the localized paths of the route - */ - public function __invoke(string $name, string|array $path): RouteConfigurator - { - return $this->add($name, $path); - } -} diff --git a/vendor/symfony/routing/Loader/Configurator/Traits/HostTrait.php b/vendor/symfony/routing/Loader/Configurator/Traits/HostTrait.php deleted file mode 100644 index edf53d3c..00000000 --- a/vendor/symfony/routing/Loader/Configurator/Traits/HostTrait.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing\Loader\Configurator\Traits; - -use Symfony\Component\Routing\RouteCollection; - -/** - * @internal - */ -trait HostTrait -{ - final protected function addHost(RouteCollection $routes, string|array $hosts) - { - if (!$hosts || !\is_array($hosts)) { - $routes->setHost($hosts ?: ''); - - return; - } - - foreach ($routes->all() as $name => $route) { - if (null === $locale = $route->getDefault('_locale')) { - $routes->remove($name); - foreach ($hosts as $locale => $host) { - $localizedRoute = clone $route; - $localizedRoute->setDefault('_locale', $locale); - $localizedRoute->setRequirement('_locale', preg_quote($locale)); - $localizedRoute->setDefault('_canonical_route', $name); - $localizedRoute->setHost($host); - $routes->add($name.'.'.$locale, $localizedRoute); - } - } elseif (!isset($hosts[$locale])) { - throw new \InvalidArgumentException(sprintf('Route "%s" with locale "%s" is missing a corresponding host in its parent collection.', $name, $locale)); - } else { - $route->setHost($hosts[$locale]); - $route->setRequirement('_locale', preg_quote($locale)); - $routes->add($name, $route); - } - } - } -} diff --git a/vendor/symfony/routing/Loader/Configurator/Traits/LocalizedRouteTrait.php b/vendor/symfony/routing/Loader/Configurator/Traits/LocalizedRouteTrait.php deleted file mode 100644 index c7c40e98..00000000 --- a/vendor/symfony/routing/Loader/Configurator/Traits/LocalizedRouteTrait.php +++ /dev/null @@ -1,76 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing\Loader\Configurator\Traits; - -use Symfony\Component\Routing\Route; -use Symfony\Component\Routing\RouteCollection; - -/** - * @internal - * - * @author Nicolas Grekas - * @author Jules Pietri - */ -trait LocalizedRouteTrait -{ - /** - * Creates one or many routes. - * - * @param string|array $path the path, or the localized paths of the route - */ - final protected function createLocalizedRoute(RouteCollection $collection, string $name, string|array $path, string $namePrefix = '', array $prefixes = null): RouteCollection - { - $paths = []; - - $routes = new RouteCollection(); - - if (\is_array($path)) { - if (null === $prefixes) { - $paths = $path; - } elseif ($missing = array_diff_key($prefixes, $path)) { - throw new \LogicException(sprintf('Route "%s" is missing routes for locale(s) "%s".', $name, implode('", "', array_keys($missing)))); - } else { - foreach ($path as $locale => $localePath) { - if (!isset($prefixes[$locale])) { - throw new \LogicException(sprintf('Route "%s" with locale "%s" is missing a corresponding prefix in its parent collection.', $name, $locale)); - } - - $paths[$locale] = $prefixes[$locale].$localePath; - } - } - } elseif (null !== $prefixes) { - foreach ($prefixes as $locale => $prefix) { - $paths[$locale] = $prefix.$path; - } - } else { - $routes->add($namePrefix.$name, $route = $this->createRoute($path)); - $collection->add($namePrefix.$name, $route); - - return $routes; - } - - foreach ($paths as $locale => $path) { - $routes->add($name.'.'.$locale, $route = $this->createRoute($path)); - $collection->add($namePrefix.$name.'.'.$locale, $route); - $route->setDefault('_locale', $locale); - $route->setRequirement('_locale', preg_quote($locale)); - $route->setDefault('_canonical_route', $namePrefix.$name); - } - - return $routes; - } - - private function createRoute(string $path): Route - { - return new Route($path); - } -} diff --git a/vendor/symfony/routing/Loader/Configurator/Traits/PrefixTrait.php b/vendor/symfony/routing/Loader/Configurator/Traits/PrefixTrait.php deleted file mode 100644 index b95dbdd4..00000000 --- a/vendor/symfony/routing/Loader/Configurator/Traits/PrefixTrait.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\Routing\Loader\Configurator\Traits; - -use Symfony\Component\Routing\Route; -use Symfony\Component\Routing\RouteCollection; - -/** - * @internal - * - * @author Nicolas Grekas - */ -trait PrefixTrait -{ - final protected function addPrefix(RouteCollection $routes, string|array $prefix, bool $trailingSlashOnRoot) - { - if (\is_array($prefix)) { - foreach ($prefix as $locale => $localePrefix) { - $prefix[$locale] = trim(trim($localePrefix), '/'); - } - foreach ($routes->all() as $name => $route) { - if (null === $locale = $route->getDefault('_locale')) { - $routes->remove($name); - foreach ($prefix as $locale => $localePrefix) { - $localizedRoute = clone $route; - $localizedRoute->setDefault('_locale', $locale); - $localizedRoute->setRequirement('_locale', preg_quote($locale)); - $localizedRoute->setDefault('_canonical_route', $name); - $localizedRoute->setPath($localePrefix.(!$trailingSlashOnRoot && '/' === $route->getPath() ? '' : $route->getPath())); - $routes->add($name.'.'.$locale, $localizedRoute); - } - } elseif (!isset($prefix[$locale])) { - throw new \InvalidArgumentException(sprintf('Route "%s" with locale "%s" is missing a corresponding prefix in its parent collection.', $name, $locale)); - } else { - $route->setPath($prefix[$locale].(!$trailingSlashOnRoot && '/' === $route->getPath() ? '' : $route->getPath())); - $routes->add($name, $route); - } - } - - return; - } - - $routes->addPrefix($prefix); - if (!$trailingSlashOnRoot) { - $rootPath = (new Route(trim(trim($prefix), '/').'/'))->getPath(); - foreach ($routes->all() as $route) { - if ($route->getPath() === $rootPath) { - $route->setPath(rtrim($rootPath, '/')); - } - } - } - } -} diff --git a/vendor/symfony/routing/Loader/Configurator/Traits/RouteTrait.php b/vendor/symfony/routing/Loader/Configurator/Traits/RouteTrait.php deleted file mode 100644 index 16dc43d0..00000000 --- a/vendor/symfony/routing/Loader/Configurator/Traits/RouteTrait.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\Routing\Loader\Configurator\Traits; - -use Symfony\Component\Routing\Route; -use Symfony\Component\Routing\RouteCollection; - -trait RouteTrait -{ - /** - * @var RouteCollection|Route - */ - protected $route; - - /** - * Adds defaults. - * - * @return $this - */ - final public function defaults(array $defaults): static - { - $this->route->addDefaults($defaults); - - return $this; - } - - /** - * Adds requirements. - * - * @return $this - */ - final public function requirements(array $requirements): static - { - $this->route->addRequirements($requirements); - - return $this; - } - - /** - * Adds options. - * - * @return $this - */ - final public function options(array $options): static - { - $this->route->addOptions($options); - - return $this; - } - - /** - * Whether paths should accept utf8 encoding. - * - * @return $this - */ - final public function utf8(bool $utf8 = true): static - { - $this->route->addOptions(['utf8' => $utf8]); - - return $this; - } - - /** - * Sets the condition. - * - * @return $this - */ - final public function condition(string $condition): static - { - $this->route->setCondition($condition); - - return $this; - } - - /** - * Sets the pattern for the host. - * - * @return $this - */ - final public function host(string $pattern): static - { - $this->route->setHost($pattern); - - return $this; - } - - /** - * Sets the schemes (e.g. 'https') this route is restricted to. - * So an empty array means that any scheme is allowed. - * - * @param string[] $schemes - * - * @return $this - */ - final public function schemes(array $schemes): static - { - $this->route->setSchemes($schemes); - - return $this; - } - - /** - * Sets the HTTP methods (e.g. 'POST') this route is restricted to. - * So an empty array means that any method is allowed. - * - * @param string[] $methods - * - * @return $this - */ - final public function methods(array $methods): static - { - $this->route->setMethods($methods); - - return $this; - } - - /** - * Adds the "_controller" entry to defaults. - * - * @param callable|string|array $controller a callable or parseable pseudo-callable - * - * @return $this - */ - final public function controller(callable|string|array $controller): static - { - $this->route->addDefaults(['_controller' => $controller]); - - return $this; - } - - /** - * Adds the "_locale" entry to defaults. - * - * @return $this - */ - final public function locale(string $locale): static - { - $this->route->addDefaults(['_locale' => $locale]); - - return $this; - } - - /** - * Adds the "_format" entry to defaults. - * - * @return $this - */ - final public function format(string $format): static - { - $this->route->addDefaults(['_format' => $format]); - - return $this; - } - - /** - * Adds the "_stateless" entry to defaults. - * - * @return $this - */ - final public function stateless(bool $stateless = true): static - { - $this->route->addDefaults(['_stateless' => $stateless]); - - return $this; - } -} diff --git a/vendor/symfony/routing/Loader/ContainerLoader.php b/vendor/symfony/routing/Loader/ContainerLoader.php deleted file mode 100644 index 716ec499..00000000 --- a/vendor/symfony/routing/Loader/ContainerLoader.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing\Loader; - -use Psr\Container\ContainerInterface; - -/** - * A route loader that executes a service from a PSR-11 container to load the routes. - * - * @author Ryan Weaver - */ -class ContainerLoader extends ObjectLoader -{ - private ContainerInterface $container; - - public function __construct(ContainerInterface $container, string $env = null) - { - $this->container = $container; - parent::__construct($env); - } - - public function supports(mixed $resource, string $type = null): bool - { - return 'service' === $type && \is_string($resource); - } - - protected function getObject(string $id): object - { - return $this->container->get($id); - } -} diff --git a/vendor/symfony/routing/Loader/DirectoryLoader.php b/vendor/symfony/routing/Loader/DirectoryLoader.php deleted file mode 100644 index 5f241bff..00000000 --- a/vendor/symfony/routing/Loader/DirectoryLoader.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing\Loader; - -use Symfony\Component\Config\Loader\FileLoader; -use Symfony\Component\Config\Resource\DirectoryResource; -use Symfony\Component\Routing\RouteCollection; - -class DirectoryLoader extends FileLoader -{ - public function load(mixed $file, string $type = null): mixed - { - $path = $this->locator->locate($file); - - $collection = new RouteCollection(); - $collection->addResource(new DirectoryResource($path)); - - foreach (scandir($path) as $dir) { - if ('.' !== $dir[0]) { - $this->setCurrentDir($path); - $subPath = $path.'/'.$dir; - $subType = null; - - if (is_dir($subPath)) { - $subPath .= '/'; - $subType = 'directory'; - } - - $subCollection = $this->import($subPath, $subType, false, $path); - $collection->addCollection($subCollection); - } - } - - return $collection; - } - - public function supports(mixed $resource, string $type = null): bool - { - // only when type is forced to directory, not to conflict with AnnotationLoader - - return 'directory' === $type; - } -} diff --git a/vendor/symfony/routing/Loader/GlobFileLoader.php b/vendor/symfony/routing/Loader/GlobFileLoader.php deleted file mode 100644 index d3974fc7..00000000 --- a/vendor/symfony/routing/Loader/GlobFileLoader.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing\Loader; - -use Symfony\Component\Config\Loader\FileLoader; -use Symfony\Component\Routing\RouteCollection; - -/** - * GlobFileLoader loads files from a glob pattern. - * - * @author Nicolas Grekas - */ -class GlobFileLoader extends FileLoader -{ - public function load(mixed $resource, string $type = null): mixed - { - $collection = new RouteCollection(); - - foreach ($this->glob($resource, false, $globResource) as $path => $info) { - $collection->addCollection($this->import($path)); - } - - $collection->addResource($globResource); - - return $collection; - } - - public function supports(mixed $resource, string $type = null): bool - { - return 'glob' === $type; - } -} diff --git a/vendor/symfony/routing/Loader/ObjectLoader.php b/vendor/symfony/routing/Loader/ObjectLoader.php deleted file mode 100644 index 4132f209..00000000 --- a/vendor/symfony/routing/Loader/ObjectLoader.php +++ /dev/null @@ -1,77 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing\Loader; - -use Symfony\Component\Config\Loader\Loader; -use Symfony\Component\Config\Resource\FileResource; -use Symfony\Component\Routing\RouteCollection; - -/** - * A route loader that calls a method on an object to load the routes. - * - * @author Ryan Weaver - */ -abstract class ObjectLoader extends Loader -{ - /** - * Returns the object that the method will be called on to load routes. - * - * For example, if your application uses a service container, - * the $id may be a service id. - */ - abstract protected function getObject(string $id): object; - - /** - * Calls the object method that will load the routes. - */ - public function load(mixed $resource, string $type = null): RouteCollection - { - if (!preg_match('/^[^\:]+(?:::(?:[^\:]+))?$/', $resource)) { - throw new \InvalidArgumentException(sprintf('Invalid resource "%s" passed to the %s route loader: use the format "object_id::method" or "object_id" if your object class has an "__invoke" method.', $resource, \is_string($type) ? '"'.$type.'"' : 'object')); - } - - $parts = explode('::', $resource); - $method = $parts[1] ?? '__invoke'; - - $loaderObject = $this->getObject($parts[0]); - - if (!\is_object($loaderObject)) { - throw new \TypeError(sprintf('"%s:getObject()" must return an object: "%s" returned.', static::class, get_debug_type($loaderObject))); - } - - if (!\is_callable([$loaderObject, $method])) { - throw new \BadMethodCallException(sprintf('Method "%s" not found on "%s" when importing routing resource "%s".', $method, get_debug_type($loaderObject), $resource)); - } - - $routeCollection = $loaderObject->$method($this, $this->env); - - if (!$routeCollection instanceof RouteCollection) { - $type = get_debug_type($routeCollection); - - throw new \LogicException(sprintf('The "%s::%s()" method must return a RouteCollection: "%s" returned.', get_debug_type($loaderObject), $method, $type)); - } - - // make the object file tracked so that if it changes, the cache rebuilds - $this->addClassResource(new \ReflectionClass($loaderObject), $routeCollection); - - return $routeCollection; - } - - private function addClassResource(\ReflectionClass $class, RouteCollection $collection) - { - do { - if (is_file($class->getFileName())) { - $collection->addResource(new FileResource($class->getFileName())); - } - } while ($class = $class->getParentClass()); - } -} diff --git a/vendor/symfony/routing/Loader/PhpFileLoader.php b/vendor/symfony/routing/Loader/PhpFileLoader.php deleted file mode 100644 index 6abee2e8..00000000 --- a/vendor/symfony/routing/Loader/PhpFileLoader.php +++ /dev/null @@ -1,77 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing\Loader; - -use Symfony\Component\Config\Loader\FileLoader; -use Symfony\Component\Config\Resource\FileResource; -use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator; -use Symfony\Component\Routing\RouteCollection; - -/** - * PhpFileLoader loads routes from a PHP file. - * - * The file must return a RouteCollection instance. - * - * @author Fabien Potencier - * @author Nicolas grekas - * @author Jules Pietri - */ -class PhpFileLoader extends FileLoader -{ - /** - * Loads a PHP file. - */ - public function load(mixed $file, string $type = null): RouteCollection - { - $path = $this->locator->locate($file); - $this->setCurrentDir(\dirname($path)); - - // the closure forbids access to the private scope in the included file - $loader = $this; - $load = \Closure::bind(static function ($file) use ($loader) { - return include $file; - }, null, ProtectedPhpFileLoader::class); - - $result = $load($path); - - if (\is_object($result) && \is_callable($result)) { - $collection = $this->callConfigurator($result, $path, $file); - } else { - $collection = $result; - } - - $collection->addResource(new FileResource($path)); - - return $collection; - } - - public function supports(mixed $resource, string $type = null): bool - { - return \is_string($resource) && 'php' === pathinfo($resource, \PATHINFO_EXTENSION) && (!$type || 'php' === $type); - } - - protected function callConfigurator(callable $result, string $path, string $file): RouteCollection - { - $collection = new RouteCollection(); - - $result(new RoutingConfigurator($collection, $this, $path, $file, $this->env)); - - return $collection; - } -} - -/** - * @internal - */ -final class ProtectedPhpFileLoader extends PhpFileLoader -{ -} diff --git a/vendor/symfony/routing/Loader/Psr4DirectoryLoader.php b/vendor/symfony/routing/Loader/Psr4DirectoryLoader.php deleted file mode 100644 index e4b84806..00000000 --- a/vendor/symfony/routing/Loader/Psr4DirectoryLoader.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\Routing\Loader; - -use Symfony\Component\Config\FileLocatorInterface; -use Symfony\Component\Config\Loader\DirectoryAwareLoaderInterface; -use Symfony\Component\Config\Loader\Loader; -use Symfony\Component\Config\Resource\DirectoryResource; -use Symfony\Component\Routing\RouteCollection; - -/** - * A loader that discovers controller classes in a directory that follows PSR-4. - * - * @author Alexander M. Turek - */ -final class Psr4DirectoryLoader extends Loader implements DirectoryAwareLoaderInterface -{ - private ?string $currentDirectory = null; - - public function __construct( - private readonly FileLocatorInterface $locator, - ) { - // PSR-4 directory loader has no env-aware logic, so we drop the $env constructor parameter. - parent::__construct(); - } - - /** - * @param array{path: string, namespace: string} $resource - */ - public function load(mixed $resource, string $type = null): ?RouteCollection - { - $path = $this->locator->locate($resource['path'], $this->currentDirectory); - if (!is_dir($path)) { - return new RouteCollection(); - } - - return $this->loadFromDirectory($path, trim($resource['namespace'], '\\')); - } - - public function supports(mixed $resource, string $type = null): bool - { - return ('attribute' === $type || 'annotation' === $type) && \is_array($resource) && isset($resource['path'], $resource['namespace']); - } - - public function forDirectory(string $currentDirectory): static - { - $loader = clone $this; - $loader->currentDirectory = $currentDirectory; - - return $loader; - } - - private function loadFromDirectory(string $directory, string $psr4Prefix): RouteCollection - { - $collection = new RouteCollection(); - $collection->addResource(new DirectoryResource($directory, '/\.php$/')); - $files = iterator_to_array(new \RecursiveIteratorIterator( - new \RecursiveCallbackFilterIterator( - new \RecursiveDirectoryIterator($directory, \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS), - function (\SplFileInfo $current) { - return !str_starts_with($current->getBasename(), '.'); - } - ), - \RecursiveIteratorIterator::SELF_FIRST - )); - usort($files, function (\SplFileInfo $a, \SplFileInfo $b) { - return (string) $a > (string) $b ? 1 : -1; - }); - - /** @var \SplFileInfo $file */ - foreach ($files as $file) { - if ($file->isDir()) { - $collection->addCollection($this->loadFromDirectory($file->getPathname(), $psr4Prefix.'\\'.$file->getFilename())); - - continue; - } - if ('php' !== $file->getExtension() || !class_exists($className = $psr4Prefix.'\\'.$file->getBasename('.php')) || (new \ReflectionClass($className))->isAbstract()) { - continue; - } - - $collection->addCollection($this->import($className, 'attribute')); - } - - return $collection; - } -} diff --git a/vendor/symfony/routing/Loader/XmlFileLoader.php b/vendor/symfony/routing/Loader/XmlFileLoader.php deleted file mode 100644 index 93c37ebb..00000000 --- a/vendor/symfony/routing/Loader/XmlFileLoader.php +++ /dev/null @@ -1,464 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing\Loader; - -use Symfony\Component\Config\Loader\FileLoader; -use Symfony\Component\Config\Resource\FileResource; -use Symfony\Component\Config\Util\XmlUtils; -use Symfony\Component\Routing\Loader\Configurator\Traits\HostTrait; -use Symfony\Component\Routing\Loader\Configurator\Traits\LocalizedRouteTrait; -use Symfony\Component\Routing\Loader\Configurator\Traits\PrefixTrait; -use Symfony\Component\Routing\RouteCollection; - -/** - * XmlFileLoader loads XML routing files. - * - * @author Fabien Potencier - * @author Tobias Schultze - */ -class XmlFileLoader extends FileLoader -{ - use HostTrait; - use LocalizedRouteTrait; - use PrefixTrait; - - public const NAMESPACE_URI = 'http://symfony.com/schema/routing'; - public const SCHEME_PATH = '/schema/routing/routing-1.0.xsd'; - - /** - * @throws \InvalidArgumentException when the file cannot be loaded or when the XML cannot be - * parsed because it does not validate against the scheme - */ - public function load(mixed $file, string $type = null): RouteCollection - { - $path = $this->locator->locate($file); - - $xml = $this->loadFile($path); - - $collection = new RouteCollection(); - $collection->addResource(new FileResource($path)); - - // process routes and imports - foreach ($xml->documentElement->childNodes as $node) { - if (!$node instanceof \DOMElement) { - continue; - } - - $this->parseNode($collection, $node, $path, $file); - } - - return $collection; - } - - /** - * Parses a node from a loaded XML file. - * - * @throws \InvalidArgumentException When the XML is invalid - */ - protected function parseNode(RouteCollection $collection, \DOMElement $node, string $path, string $file) - { - if (self::NAMESPACE_URI !== $node->namespaceURI) { - return; - } - - switch ($node->localName) { - case 'route': - $this->parseRoute($collection, $node, $path); - break; - case 'import': - $this->parseImport($collection, $node, $path, $file); - break; - case 'when': - if (!$this->env || $node->getAttribute('env') !== $this->env) { - break; - } - foreach ($node->childNodes as $node) { - if ($node instanceof \DOMElement) { - $this->parseNode($collection, $node, $path, $file); - } - } - break; - default: - throw new \InvalidArgumentException(sprintf('Unknown tag "%s" used in file "%s". Expected "route" or "import".', $node->localName, $path)); - } - } - - public function supports(mixed $resource, string $type = null): bool - { - return \is_string($resource) && 'xml' === pathinfo($resource, \PATHINFO_EXTENSION) && (!$type || 'xml' === $type); - } - - /** - * Parses a route and adds it to the RouteCollection. - * - * @throws \InvalidArgumentException When the XML is invalid - */ - protected function parseRoute(RouteCollection $collection, \DOMElement $node, string $path) - { - if ('' === $id = $node->getAttribute('id')) { - throw new \InvalidArgumentException(sprintf('The element in file "%s" must have an "id" attribute.', $path)); - } - - if ('' !== $alias = $node->getAttribute('alias')) { - $alias = $collection->addAlias($id, $alias); - - if ($deprecationInfo = $this->parseDeprecation($node, $path)) { - $alias->setDeprecated($deprecationInfo['package'], $deprecationInfo['version'], $deprecationInfo['message']); - } - - return; - } - - $schemes = preg_split('/[\s,\|]++/', $node->getAttribute('schemes'), -1, \PREG_SPLIT_NO_EMPTY); - $methods = preg_split('/[\s,\|]++/', $node->getAttribute('methods'), -1, \PREG_SPLIT_NO_EMPTY); - - [$defaults, $requirements, $options, $condition, $paths, /* $prefixes */, $hosts] = $this->parseConfigs($node, $path); - - if (!$paths && '' === $node->getAttribute('path')) { - throw new \InvalidArgumentException(sprintf('The element in file "%s" must have a "path" attribute or child nodes.', $path)); - } - - if ($paths && '' !== $node->getAttribute('path')) { - throw new \InvalidArgumentException(sprintf('The element in file "%s" must not have both a "path" attribute and child nodes.', $path)); - } - - $routes = $this->createLocalizedRoute($collection, $id, $paths ?: $node->getAttribute('path')); - $routes->addDefaults($defaults); - $routes->addRequirements($requirements); - $routes->addOptions($options); - $routes->setSchemes($schemes); - $routes->setMethods($methods); - $routes->setCondition($condition); - - if (null !== $hosts) { - $this->addHost($routes, $hosts); - } - } - - /** - * Parses an import and adds the routes in the resource to the RouteCollection. - * - * @throws \InvalidArgumentException When the XML is invalid - */ - protected function parseImport(RouteCollection $collection, \DOMElement $node, string $path, string $file) - { - /** @var \DOMElement $resourceElement */ - if (!($resource = $node->getAttribute('resource') ?: null) && $resourceElement = $node->getElementsByTagName('resource')[0] ?? null) { - $resource = []; - /** @var \DOMAttr $attribute */ - foreach ($resourceElement->attributes as $attribute) { - $resource[$attribute->name] = $attribute->value; - } - } - - if (!$resource) { - throw new \InvalidArgumentException(sprintf('The element in file "%s" must have a "resource" attribute or element.', $path)); - } - - $type = $node->getAttribute('type'); - $prefix = $node->getAttribute('prefix'); - $schemes = $node->hasAttribute('schemes') ? preg_split('/[\s,\|]++/', $node->getAttribute('schemes'), -1, \PREG_SPLIT_NO_EMPTY) : null; - $methods = $node->hasAttribute('methods') ? preg_split('/[\s,\|]++/', $node->getAttribute('methods'), -1, \PREG_SPLIT_NO_EMPTY) : null; - $trailingSlashOnRoot = $node->hasAttribute('trailing-slash-on-root') ? XmlUtils::phpize($node->getAttribute('trailing-slash-on-root')) : true; - $namePrefix = $node->getAttribute('name-prefix') ?: null; - - [$defaults, $requirements, $options, $condition, /* $paths */, $prefixes, $hosts] = $this->parseConfigs($node, $path); - - if ('' !== $prefix && $prefixes) { - throw new \InvalidArgumentException(sprintf('The element in file "%s" must not have both a "prefix" attribute and child nodes.', $path)); - } - - $exclude = []; - foreach ($node->childNodes as $child) { - if ($child instanceof \DOMElement && $child->localName === $exclude && self::NAMESPACE_URI === $child->namespaceURI) { - $exclude[] = $child->nodeValue; - } - } - - if ($node->hasAttribute('exclude')) { - if ($exclude) { - throw new \InvalidArgumentException('You cannot use both the attribute "exclude" and tags at the same time.'); - } - $exclude = [$node->getAttribute('exclude')]; - } - - $this->setCurrentDir(\dirname($path)); - - /** @var RouteCollection[] $imported */ - $imported = $this->import($resource, '' !== $type ? $type : null, false, $file, $exclude) ?: []; - - if (!\is_array($imported)) { - $imported = [$imported]; - } - - foreach ($imported as $subCollection) { - $this->addPrefix($subCollection, $prefixes ?: $prefix, $trailingSlashOnRoot); - - if (null !== $hosts) { - $this->addHost($subCollection, $hosts); - } - - if (null !== $condition) { - $subCollection->setCondition($condition); - } - if (null !== $schemes) { - $subCollection->setSchemes($schemes); - } - if (null !== $methods) { - $subCollection->setMethods($methods); - } - if (null !== $namePrefix) { - $subCollection->addNamePrefix($namePrefix); - } - $subCollection->addDefaults($defaults); - $subCollection->addRequirements($requirements); - $subCollection->addOptions($options); - - $collection->addCollection($subCollection); - } - } - - /** - * @throws \InvalidArgumentException When loading of XML file fails because of syntax errors - * or when the XML structure is not as expected by the scheme - - * see validate() - */ - protected function loadFile(string $file): \DOMDocument - { - return XmlUtils::loadFile($file, __DIR__.static::SCHEME_PATH); - } - - /** - * Parses the config elements (default, requirement, option). - * - * @throws \InvalidArgumentException When the XML is invalid - */ - private function parseConfigs(\DOMElement $node, string $path): array - { - $defaults = []; - $requirements = []; - $options = []; - $condition = null; - $prefixes = []; - $paths = []; - $hosts = []; - - /** @var \DOMElement $n */ - foreach ($node->getElementsByTagNameNS(self::NAMESPACE_URI, '*') as $n) { - if ($node !== $n->parentNode) { - continue; - } - - switch ($n->localName) { - case 'path': - $paths[$n->getAttribute('locale')] = trim($n->textContent); - break; - case 'host': - $hosts[$n->getAttribute('locale')] = trim($n->textContent); - break; - case 'prefix': - $prefixes[$n->getAttribute('locale')] = trim($n->textContent); - break; - case 'default': - if ($this->isElementValueNull($n)) { - $defaults[$n->getAttribute('key')] = null; - } else { - $defaults[$n->getAttribute('key')] = $this->parseDefaultsConfig($n, $path); - } - - break; - case 'requirement': - $requirements[$n->getAttribute('key')] = trim($n->textContent); - break; - case 'option': - $options[$n->getAttribute('key')] = XmlUtils::phpize(trim($n->textContent)); - break; - case 'condition': - $condition = trim($n->textContent); - break; - case 'resource': - break; - default: - throw new \InvalidArgumentException(sprintf('Unknown tag "%s" used in file "%s". Expected "default", "requirement", "option" or "condition".', $n->localName, $path)); - } - } - - if ($controller = $node->getAttribute('controller')) { - if (isset($defaults['_controller'])) { - $name = $node->hasAttribute('id') ? sprintf('"%s".', $node->getAttribute('id')) : sprintf('the "%s" tag.', $node->tagName); - - throw new \InvalidArgumentException(sprintf('The routing file "%s" must not specify both the "controller" attribute and the defaults key "_controller" for ', $path).$name); - } - - $defaults['_controller'] = $controller; - } - if ($node->hasAttribute('locale')) { - $defaults['_locale'] = $node->getAttribute('locale'); - } - if ($node->hasAttribute('format')) { - $defaults['_format'] = $node->getAttribute('format'); - } - if ($node->hasAttribute('utf8')) { - $options['utf8'] = XmlUtils::phpize($node->getAttribute('utf8')); - } - if ($stateless = $node->getAttribute('stateless')) { - if (isset($defaults['_stateless'])) { - $name = $node->hasAttribute('id') ? sprintf('"%s".', $node->getAttribute('id')) : sprintf('the "%s" tag.', $node->tagName); - - throw new \InvalidArgumentException(sprintf('The routing file "%s" must not specify both the "stateless" attribute and the defaults key "_stateless" for ', $path).$name); - } - - $defaults['_stateless'] = XmlUtils::phpize($stateless); - } - - if (!$hosts) { - $hosts = $node->hasAttribute('host') ? $node->getAttribute('host') : null; - } - - return [$defaults, $requirements, $options, $condition, $paths, $prefixes, $hosts]; - } - - /** - * Parses the "default" elements. - */ - private function parseDefaultsConfig(\DOMElement $element, string $path): array|bool|float|int|string|null - { - if ($this->isElementValueNull($element)) { - return null; - } - - // Check for existing element nodes in the default element. There can - // only be a single element inside a default element. So this element - // (if one was found) can safely be returned. - foreach ($element->childNodes as $child) { - if (!$child instanceof \DOMElement) { - continue; - } - - if (self::NAMESPACE_URI !== $child->namespaceURI) { - continue; - } - - return $this->parseDefaultNode($child, $path); - } - - // If the default element doesn't contain a nested "bool", "int", "float", - // "string", "list", or "map" element, the element contents will be treated - // as the string value of the associated default option. - return trim($element->textContent); - } - - /** - * Recursively parses the value of a "default" element. - * - * @throws \InvalidArgumentException when the XML is invalid - */ - private function parseDefaultNode(\DOMElement $node, string $path): array|bool|float|int|string|null - { - if ($this->isElementValueNull($node)) { - return null; - } - - switch ($node->localName) { - case 'bool': - return 'true' === trim($node->nodeValue) || '1' === trim($node->nodeValue); - case 'int': - return (int) trim($node->nodeValue); - case 'float': - return (float) trim($node->nodeValue); - case 'string': - return trim($node->nodeValue); - case 'list': - $list = []; - - foreach ($node->childNodes as $element) { - if (!$element instanceof \DOMElement) { - continue; - } - - if (self::NAMESPACE_URI !== $element->namespaceURI) { - continue; - } - - $list[] = $this->parseDefaultNode($element, $path); - } - - return $list; - case 'map': - $map = []; - - foreach ($node->childNodes as $element) { - if (!$element instanceof \DOMElement) { - continue; - } - - if (self::NAMESPACE_URI !== $element->namespaceURI) { - continue; - } - - $map[$element->getAttribute('key')] = $this->parseDefaultNode($element, $path); - } - - return $map; - default: - throw new \InvalidArgumentException(sprintf('Unknown tag "%s" used in file "%s". Expected "bool", "int", "float", "string", "list", or "map".', $node->localName, $path)); - } - } - - private function isElementValueNull(\DOMElement $element): bool - { - $namespaceUri = 'http://www.w3.org/2001/XMLSchema-instance'; - - if (!$element->hasAttributeNS($namespaceUri, 'nil')) { - return false; - } - - return 'true' === $element->getAttributeNS($namespaceUri, 'nil') || '1' === $element->getAttributeNS($namespaceUri, 'nil'); - } - - /** - * Parses the deprecation elements. - * - * @throws \InvalidArgumentException When the XML is invalid - */ - private function parseDeprecation(\DOMElement $node, string $path): array - { - $deprecatedNode = null; - foreach ($node->childNodes as $child) { - if (!$child instanceof \DOMElement || self::NAMESPACE_URI !== $child->namespaceURI) { - continue; - } - if ('deprecated' !== $child->localName) { - throw new \InvalidArgumentException(sprintf('Invalid child element "%s" defined for alias "%s" in "%s".', $child->localName, $node->getAttribute('id'), $path)); - } - - $deprecatedNode = $child; - } - - if (null === $deprecatedNode) { - return []; - } - - if (!$deprecatedNode->hasAttribute('package')) { - throw new \InvalidArgumentException(sprintf('The element in file "%s" must have a "package" attribute.', $path)); - } - if (!$deprecatedNode->hasAttribute('version')) { - throw new \InvalidArgumentException(sprintf('The element in file "%s" must have a "version" attribute.', $path)); - } - - return [ - 'package' => $deprecatedNode->getAttribute('package'), - 'version' => $deprecatedNode->getAttribute('version'), - 'message' => trim($deprecatedNode->nodeValue), - ]; - } -} diff --git a/vendor/symfony/routing/Loader/YamlFileLoader.php b/vendor/symfony/routing/Loader/YamlFileLoader.php deleted file mode 100644 index c30adf1e..00000000 --- a/vendor/symfony/routing/Loader/YamlFileLoader.php +++ /dev/null @@ -1,296 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing\Loader; - -use Symfony\Component\Config\Loader\FileLoader; -use Symfony\Component\Config\Resource\FileResource; -use Symfony\Component\Routing\Loader\Configurator\Traits\HostTrait; -use Symfony\Component\Routing\Loader\Configurator\Traits\LocalizedRouteTrait; -use Symfony\Component\Routing\Loader\Configurator\Traits\PrefixTrait; -use Symfony\Component\Routing\RouteCollection; -use Symfony\Component\Yaml\Exception\ParseException; -use Symfony\Component\Yaml\Parser as YamlParser; -use Symfony\Component\Yaml\Yaml; - -/** - * YamlFileLoader loads Yaml routing files. - * - * @author Fabien Potencier - * @author Tobias Schultze - */ -class YamlFileLoader extends FileLoader -{ - use HostTrait; - use LocalizedRouteTrait; - use PrefixTrait; - - private const AVAILABLE_KEYS = [ - 'resource', 'type', 'prefix', 'path', 'host', 'schemes', 'methods', 'defaults', 'requirements', 'options', 'condition', 'controller', 'name_prefix', 'trailing_slash_on_root', 'locale', 'format', 'utf8', 'exclude', 'stateless', - ]; - private YamlParser $yamlParser; - - /** - * @throws \InvalidArgumentException When a route can't be parsed because YAML is invalid - */ - public function load(mixed $file, string $type = null): RouteCollection - { - $path = $this->locator->locate($file); - - if (!stream_is_local($path)) { - throw new \InvalidArgumentException(sprintf('This is not a local file "%s".', $path)); - } - - if (!file_exists($path)) { - throw new \InvalidArgumentException(sprintf('File "%s" not found.', $path)); - } - - $this->yamlParser ??= new YamlParser(); - - try { - $parsedConfig = $this->yamlParser->parseFile($path, Yaml::PARSE_CONSTANT); - } catch (ParseException $e) { - throw new \InvalidArgumentException(sprintf('The file "%s" does not contain valid YAML: ', $path).$e->getMessage(), 0, $e); - } - - $collection = new RouteCollection(); - $collection->addResource(new FileResource($path)); - - // empty file - if (null === $parsedConfig) { - return $collection; - } - - // not an array - if (!\is_array($parsedConfig)) { - throw new \InvalidArgumentException(sprintf('The file "%s" must contain a YAML array.', $path)); - } - - foreach ($parsedConfig as $name => $config) { - if (str_starts_with($name, 'when@')) { - if (!$this->env || 'when@'.$this->env !== $name) { - continue; - } - - foreach ($config as $name => $config) { - $this->validate($config, $name.'" when "@'.$this->env, $path); - - if (isset($config['resource'])) { - $this->parseImport($collection, $config, $path, $file); - } else { - $this->parseRoute($collection, $name, $config, $path); - } - } - - continue; - } - - $this->validate($config, $name, $path); - - if (isset($config['resource'])) { - $this->parseImport($collection, $config, $path, $file); - } else { - $this->parseRoute($collection, $name, $config, $path); - } - } - - return $collection; - } - - public function supports(mixed $resource, string $type = null): bool - { - return \is_string($resource) && \in_array(pathinfo($resource, \PATHINFO_EXTENSION), ['yml', 'yaml'], true) && (!$type || 'yaml' === $type); - } - - /** - * Parses a route and adds it to the RouteCollection. - */ - protected function parseRoute(RouteCollection $collection, string $name, array $config, string $path) - { - if (isset($config['alias'])) { - $alias = $collection->addAlias($name, $config['alias']); - $deprecation = $config['deprecated'] ?? null; - if (null !== $deprecation) { - $alias->setDeprecated( - $deprecation['package'], - $deprecation['version'], - $deprecation['message'] ?? '' - ); - } - - return; - } - - $defaults = $config['defaults'] ?? []; - $requirements = $config['requirements'] ?? []; - $options = $config['options'] ?? []; - - foreach ($requirements as $placeholder => $requirement) { - if (\is_int($placeholder)) { - throw new \InvalidArgumentException(sprintf('A placeholder name must be a string (%d given). Did you forget to specify the placeholder key for the requirement "%s" of route "%s" in "%s"?', $placeholder, $requirement, $name, $path)); - } - } - - if (isset($config['controller'])) { - $defaults['_controller'] = $config['controller']; - } - if (isset($config['locale'])) { - $defaults['_locale'] = $config['locale']; - } - if (isset($config['format'])) { - $defaults['_format'] = $config['format']; - } - if (isset($config['utf8'])) { - $options['utf8'] = $config['utf8']; - } - if (isset($config['stateless'])) { - $defaults['_stateless'] = $config['stateless']; - } - - $routes = $this->createLocalizedRoute($collection, $name, $config['path']); - $routes->addDefaults($defaults); - $routes->addRequirements($requirements); - $routes->addOptions($options); - $routes->setSchemes($config['schemes'] ?? []); - $routes->setMethods($config['methods'] ?? []); - $routes->setCondition($config['condition'] ?? null); - - if (isset($config['host'])) { - $this->addHost($routes, $config['host']); - } - } - - /** - * Parses an import and adds the routes in the resource to the RouteCollection. - */ - protected function parseImport(RouteCollection $collection, array $config, string $path, string $file) - { - $type = $config['type'] ?? null; - $prefix = $config['prefix'] ?? ''; - $defaults = $config['defaults'] ?? []; - $requirements = $config['requirements'] ?? []; - $options = $config['options'] ?? []; - $host = $config['host'] ?? null; - $condition = $config['condition'] ?? null; - $schemes = $config['schemes'] ?? null; - $methods = $config['methods'] ?? null; - $trailingSlashOnRoot = $config['trailing_slash_on_root'] ?? true; - $namePrefix = $config['name_prefix'] ?? null; - $exclude = $config['exclude'] ?? null; - - if (isset($config['controller'])) { - $defaults['_controller'] = $config['controller']; - } - if (isset($config['locale'])) { - $defaults['_locale'] = $config['locale']; - } - if (isset($config['format'])) { - $defaults['_format'] = $config['format']; - } - if (isset($config['utf8'])) { - $options['utf8'] = $config['utf8']; - } - if (isset($config['stateless'])) { - $defaults['_stateless'] = $config['stateless']; - } - - $this->setCurrentDir(\dirname($path)); - - /** @var RouteCollection[] $imported */ - $imported = $this->import($config['resource'], $type, false, $file, $exclude) ?: []; - - if (!\is_array($imported)) { - $imported = [$imported]; - } - - foreach ($imported as $subCollection) { - $this->addPrefix($subCollection, $prefix, $trailingSlashOnRoot); - - if (null !== $host) { - $this->addHost($subCollection, $host); - } - if (null !== $condition) { - $subCollection->setCondition($condition); - } - if (null !== $schemes) { - $subCollection->setSchemes($schemes); - } - if (null !== $methods) { - $subCollection->setMethods($methods); - } - if (null !== $namePrefix) { - $subCollection->addNamePrefix($namePrefix); - } - $subCollection->addDefaults($defaults); - $subCollection->addRequirements($requirements); - $subCollection->addOptions($options); - - $collection->addCollection($subCollection); - } - } - - /** - * @throws \InvalidArgumentException If one of the provided config keys is not supported, - * something is missing or the combination is nonsense - */ - protected function validate(mixed $config, string $name, string $path) - { - if (!\is_array($config)) { - throw new \InvalidArgumentException(sprintf('The definition of "%s" in "%s" must be a YAML array.', $name, $path)); - } - if (isset($config['alias'])) { - $this->validateAlias($config, $name, $path); - - return; - } - if ($extraKeys = array_diff(array_keys($config), self::AVAILABLE_KEYS)) { - throw new \InvalidArgumentException(sprintf('The routing file "%s" contains unsupported keys for "%s": "%s". Expected one of: "%s".', $path, $name, implode('", "', $extraKeys), implode('", "', self::AVAILABLE_KEYS))); - } - if (isset($config['resource']) && isset($config['path'])) { - throw new \InvalidArgumentException(sprintf('The routing file "%s" must not specify both the "resource" key and the "path" key for "%s". Choose between an import and a route definition.', $path, $name)); - } - if (!isset($config['resource']) && isset($config['type'])) { - throw new \InvalidArgumentException(sprintf('The "type" key for the route definition "%s" in "%s" is unsupported. It is only available for imports in combination with the "resource" key.', $name, $path)); - } - if (!isset($config['resource']) && !isset($config['path'])) { - throw new \InvalidArgumentException(sprintf('You must define a "path" for the route "%s" in file "%s".', $name, $path)); - } - if (isset($config['controller']) && isset($config['defaults']['_controller'])) { - throw new \InvalidArgumentException(sprintf('The routing file "%s" must not specify both the "controller" key and the defaults key "_controller" for "%s".', $path, $name)); - } - if (isset($config['stateless']) && isset($config['defaults']['_stateless'])) { - throw new \InvalidArgumentException(sprintf('The routing file "%s" must not specify both the "stateless" key and the defaults key "_stateless" for "%s".', $path, $name)); - } - } - - /** - * @throws \InvalidArgumentException If one of the provided config keys is not supported, - * something is missing or the combination is nonsense - */ - private function validateAlias(array $config, string $name, string $path): void - { - foreach ($config as $key => $value) { - if (!\in_array($key, ['alias', 'deprecated'], true)) { - throw new \InvalidArgumentException(sprintf('The routing file "%s" must not specify other keys than "alias" and "deprecated" for "%s".', $path, $name)); - } - - if ('deprecated' === $key) { - if (!isset($value['package'])) { - throw new \InvalidArgumentException(sprintf('The routing file "%s" must specify the attribute "package" of the "deprecated" option for "%s".', $path, $name)); - } - - if (!isset($value['version'])) { - throw new \InvalidArgumentException(sprintf('The routing file "%s" must specify the attribute "version" of the "deprecated" option for "%s".', $path, $name)); - } - } - } - } -} diff --git a/vendor/symfony/routing/Loader/schema/routing/routing-1.0.xsd b/vendor/symfony/routing/Loader/schema/routing/routing-1.0.xsd deleted file mode 100644 index 1b24dfdc..00000000 --- a/vendor/symfony/routing/Loader/schema/routing/routing-1.0.xsd +++ /dev/null @@ -1,201 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/symfony/routing/Matcher/CompiledUrlMatcher.php b/vendor/symfony/routing/Matcher/CompiledUrlMatcher.php deleted file mode 100644 index ae13fd70..00000000 --- a/vendor/symfony/routing/Matcher/CompiledUrlMatcher.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. - */ - -namespace Symfony\Component\Routing\Matcher; - -use Symfony\Component\Routing\Matcher\Dumper\CompiledUrlMatcherTrait; -use Symfony\Component\Routing\RequestContext; - -/** - * Matches URLs based on rules dumped by CompiledUrlMatcherDumper. - * - * @author Nicolas Grekas - */ -class CompiledUrlMatcher extends UrlMatcher -{ - use CompiledUrlMatcherTrait; - - public function __construct(array $compiledRoutes, RequestContext $context) - { - $this->context = $context; - [$this->matchHost, $this->staticRoutes, $this->regexpList, $this->dynamicRoutes, $this->checkCondition] = $compiledRoutes; - } -} diff --git a/vendor/symfony/routing/Matcher/Dumper/CompiledUrlMatcherDumper.php b/vendor/symfony/routing/Matcher/Dumper/CompiledUrlMatcherDumper.php deleted file mode 100644 index 980aa8e5..00000000 --- a/vendor/symfony/routing/Matcher/Dumper/CompiledUrlMatcherDumper.php +++ /dev/null @@ -1,498 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing\Matcher\Dumper; - -use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface; -use Symfony\Component\ExpressionLanguage\ExpressionLanguage; -use Symfony\Component\Routing\Route; -use Symfony\Component\Routing\RouteCollection; - -/** - * CompiledUrlMatcherDumper creates PHP arrays to be used with CompiledUrlMatcher. - * - * @author Fabien Potencier - * @author Tobias Schultze - * @author Arnaud Le Blanc - * @author Nicolas Grekas - */ -class CompiledUrlMatcherDumper extends MatcherDumper -{ - private ExpressionLanguage $expressionLanguage; - private ?\Exception $signalingException = null; - - /** - * @var ExpressionFunctionProviderInterface[] - */ - private array $expressionLanguageProviders = []; - - public function dump(array $options = []): string - { - return <<generateCompiledRoutes()}]; - -EOF; - } - - public function addExpressionLanguageProvider(ExpressionFunctionProviderInterface $provider) - { - $this->expressionLanguageProviders[] = $provider; - } - - /** - * Generates the arrays for CompiledUrlMatcher's constructor. - */ - public function getCompiledRoutes(bool $forDump = false): array - { - // Group hosts by same-suffix, re-order when possible - $matchHost = false; - $routes = new StaticPrefixCollection(); - foreach ($this->getRoutes()->all() as $name => $route) { - if ($host = $route->getHost()) { - $matchHost = true; - $host = '/'.strtr(strrev($host), '}.{', '(/)'); - } - - $routes->addRoute($host ?: '/(.*)', [$name, $route]); - } - - if ($matchHost) { - $compiledRoutes = [true]; - $routes = $routes->populateCollection(new RouteCollection()); - } else { - $compiledRoutes = [false]; - $routes = $this->getRoutes(); - } - - [$staticRoutes, $dynamicRoutes] = $this->groupStaticRoutes($routes); - - $conditions = [null]; - $compiledRoutes[] = $this->compileStaticRoutes($staticRoutes, $conditions); - $chunkLimit = \count($dynamicRoutes); - - while (true) { - try { - $this->signalingException = new \RuntimeException('Compilation failed: regular expression is too large'); - $compiledRoutes = array_merge($compiledRoutes, $this->compileDynamicRoutes($dynamicRoutes, $matchHost, $chunkLimit, $conditions)); - - break; - } catch (\Exception $e) { - if (1 < $chunkLimit && $this->signalingException === $e) { - $chunkLimit = 1 + ($chunkLimit >> 1); - continue; - } - throw $e; - } - } - - if ($forDump) { - $compiledRoutes[2] = $compiledRoutes[4]; - } - unset($conditions[0]); - - if ($conditions) { - foreach ($conditions as $expression => $condition) { - $conditions[$expression] = "case {$condition}: return {$expression};"; - } - - $checkConditionCode = <<indent(implode("\n", $conditions), 3)} - } - } -EOF; - $compiledRoutes[4] = $forDump ? $checkConditionCode.",\n" : eval('return '.$checkConditionCode.';'); - } else { - $compiledRoutes[4] = $forDump ? " null, // \$checkCondition\n" : null; - } - - return $compiledRoutes; - } - - private function generateCompiledRoutes(): string - { - [$matchHost, $staticRoutes, $regexpCode, $dynamicRoutes, $checkConditionCode] = $this->getCompiledRoutes(true); - - $code = self::export($matchHost).', // $matchHost'."\n"; - - $code .= '[ // $staticRoutes'."\n"; - foreach ($staticRoutes as $path => $routes) { - $code .= sprintf(" %s => [\n", self::export($path)); - foreach ($routes as $route) { - $code .= sprintf(" [%s, %s, %s, %s, %s, %s, %s],\n", ...array_map([__CLASS__, 'export'], $route)); - } - $code .= " ],\n"; - } - $code .= "],\n"; - - $code .= sprintf("[ // \$regexpList%s\n],\n", $regexpCode); - - $code .= '[ // $dynamicRoutes'."\n"; - foreach ($dynamicRoutes as $path => $routes) { - $code .= sprintf(" %s => [\n", self::export($path)); - foreach ($routes as $route) { - $code .= sprintf(" [%s, %s, %s, %s, %s, %s, %s],\n", ...array_map([__CLASS__, 'export'], $route)); - } - $code .= " ],\n"; - } - $code .= "],\n"; - $code = preg_replace('/ => \[\n (\[.+?),\n \],/', ' => [$1],', $code); - - return $this->indent($code, 1).$checkConditionCode; - } - - /** - * Splits static routes from dynamic routes, so that they can be matched first, using a simple switch. - */ - private function groupStaticRoutes(RouteCollection $collection): array - { - $staticRoutes = $dynamicRegex = []; - $dynamicRoutes = new RouteCollection(); - - foreach ($collection->all() as $name => $route) { - $compiledRoute = $route->compile(); - $staticPrefix = rtrim($compiledRoute->getStaticPrefix(), '/'); - $hostRegex = $compiledRoute->getHostRegex(); - $regex = $compiledRoute->getRegex(); - if ($hasTrailingSlash = '/' !== $route->getPath()) { - $pos = strrpos($regex, '$'); - $hasTrailingSlash = '/' === $regex[$pos - 1]; - $regex = substr_replace($regex, '/?$', $pos - $hasTrailingSlash, 1 + $hasTrailingSlash); - } - - if (!$compiledRoute->getPathVariables()) { - $host = !$compiledRoute->getHostVariables() ? $route->getHost() : ''; - $url = $route->getPath(); - if ($hasTrailingSlash) { - $url = substr($url, 0, -1); - } - foreach ($dynamicRegex as [$hostRx, $rx, $prefix]) { - if (('' === $prefix || str_starts_with($url, $prefix)) && (preg_match($rx, $url) || preg_match($rx, $url.'/')) && (!$host || !$hostRx || preg_match($hostRx, $host))) { - $dynamicRegex[] = [$hostRegex, $regex, $staticPrefix]; - $dynamicRoutes->add($name, $route); - continue 2; - } - } - - $staticRoutes[$url][$name] = [$route, $hasTrailingSlash]; - } else { - $dynamicRegex[] = [$hostRegex, $regex, $staticPrefix]; - $dynamicRoutes->add($name, $route); - } - } - - return [$staticRoutes, $dynamicRoutes]; - } - - /** - * Compiles static routes in a switch statement. - * - * Condition-less paths are put in a static array in the switch's default, with generic matching logic. - * Paths that can match two or more routes, or have user-specified conditions are put in separate switch's cases. - * - * @throws \LogicException - */ - private function compileStaticRoutes(array $staticRoutes, array &$conditions): array - { - if (!$staticRoutes) { - return []; - } - $compiledRoutes = []; - - foreach ($staticRoutes as $url => $routes) { - $compiledRoutes[$url] = []; - foreach ($routes as $name => [$route, $hasTrailingSlash]) { - $compiledRoutes[$url][] = $this->compileRoute($route, $name, (!$route->compile()->getHostVariables() ? $route->getHost() : $route->compile()->getHostRegex()) ?: null, $hasTrailingSlash, false, $conditions); - } - } - - return $compiledRoutes; - } - - /** - * Compiles a regular expression followed by a switch statement to match dynamic routes. - * - * The regular expression matches both the host and the pathinfo at the same time. For stellar performance, - * it is built as a tree of patterns, with re-ordering logic to group same-prefix routes together when possible. - * - * Patterns are named so that we know which one matched (https://pcre.org/current/doc/html/pcre2syntax.html#SEC23). - * This name is used to "switch" to the additional logic required to match the final route. - * - * Condition-less paths are put in a static array in the switch's default, with generic matching logic. - * Paths that can match two or more routes, or have user-specified conditions are put in separate switch's cases. - * - * Last but not least: - * - Because it is not possible to mix unicode/non-unicode patterns in a single regexp, several of them can be generated. - * - The same regexp can be used several times when the logic in the switch rejects the match. When this happens, the - * matching-but-failing subpattern is excluded by replacing its name by "(*F)", which forces a failure-to-match. - * To ease this backlisting operation, the name of subpatterns is also the string offset where the replacement should occur. - */ - private function compileDynamicRoutes(RouteCollection $collection, bool $matchHost, int $chunkLimit, array &$conditions): array - { - if (!$collection->all()) { - return [[], [], '']; - } - $regexpList = []; - $code = ''; - $state = (object) [ - 'regexMark' => 0, - 'regex' => [], - 'routes' => [], - 'mark' => 0, - 'markTail' => 0, - 'hostVars' => [], - 'vars' => [], - ]; - $state->getVars = static function ($m) use ($state) { - if ('_route' === $m[1]) { - return '?:'; - } - - $state->vars[] = $m[1]; - - return ''; - }; - - $chunkSize = 0; - $prev = null; - $perModifiers = []; - foreach ($collection->all() as $name => $route) { - preg_match('#[a-zA-Z]*$#', $route->compile()->getRegex(), $rx); - if ($chunkLimit < ++$chunkSize || $prev !== $rx[0] && $route->compile()->getPathVariables()) { - $chunkSize = 1; - $routes = new RouteCollection(); - $perModifiers[] = [$rx[0], $routes]; - $prev = $rx[0]; - } - $routes->add($name, $route); - } - - foreach ($perModifiers as [$modifiers, $routes]) { - $prev = false; - $perHost = []; - foreach ($routes->all() as $name => $route) { - $regex = $route->compile()->getHostRegex(); - if ($prev !== $regex) { - $routes = new RouteCollection(); - $perHost[] = [$regex, $routes]; - $prev = $regex; - } - $routes->add($name, $route); - } - $prev = false; - $rx = '{^(?'; - $code .= "\n {$state->mark} => ".self::export($rx); - $startingMark = $state->mark; - $state->mark += \strlen($rx); - $state->regex = $rx; - - foreach ($perHost as [$hostRegex, $routes]) { - if ($matchHost) { - if ($hostRegex) { - preg_match('#^.\^(.*)\$.[a-zA-Z]*$#', $hostRegex, $rx); - $state->vars = []; - $hostRegex = '(?i:'.preg_replace_callback('#\?P<([^>]++)>#', $state->getVars, $rx[1]).')\.'; - $state->hostVars = $state->vars; - } else { - $hostRegex = '(?:(?:[^./]*+\.)++)'; - $state->hostVars = []; - } - $state->mark += \strlen($rx = ($prev ? ')' : '')."|{$hostRegex}(?"); - $code .= "\n .".self::export($rx); - $state->regex .= $rx; - $prev = true; - } - - $tree = new StaticPrefixCollection(); - foreach ($routes->all() as $name => $route) { - preg_match('#^.\^(.*)\$.[a-zA-Z]*$#', $route->compile()->getRegex(), $rx); - - $state->vars = []; - $regex = preg_replace_callback('#\?P<([^>]++)>#', $state->getVars, $rx[1]); - if ($hasTrailingSlash = '/' !== $regex && '/' === $regex[-1]) { - $regex = substr($regex, 0, -1); - } - $hasTrailingVar = (bool) preg_match('#\{[\w\x80-\xFF]+\}/?$#', $route->getPath()); - - $tree->addRoute($regex, [$name, $regex, $state->vars, $route, $hasTrailingSlash, $hasTrailingVar]); - } - - $code .= $this->compileStaticPrefixCollection($tree, $state, 0, $conditions); - } - if ($matchHost) { - $code .= "\n .')'"; - $state->regex .= ')'; - } - $rx = ")/?$}{$modifiers}"; - $code .= "\n .'{$rx}',"; - $state->regex .= $rx; - $state->markTail = 0; - - // if the regex is too large, throw a signaling exception to recompute with smaller chunk size - set_error_handler(function ($type, $message) { throw str_contains($message, $this->signalingException->getMessage()) ? $this->signalingException : new \ErrorException($message); }); - try { - preg_match($state->regex, ''); - } finally { - restore_error_handler(); - } - - $regexpList[$startingMark] = $state->regex; - } - - $state->routes[$state->mark][] = [null, null, null, null, false, false, 0]; - unset($state->getVars); - - return [$regexpList, $state->routes, $code]; - } - - /** - * Compiles a regexp tree of subpatterns that matches nested same-prefix routes. - * - * @param \stdClass $state A simple state object that keeps track of the progress of the compilation, - * and gathers the generated switch's "case" and "default" statements - */ - private function compileStaticPrefixCollection(StaticPrefixCollection $tree, \stdClass $state, int $prefixLen, array &$conditions): string - { - $code = ''; - $prevRegex = null; - $routes = $tree->getRoutes(); - - foreach ($routes as $i => $route) { - if ($route instanceof StaticPrefixCollection) { - $prevRegex = null; - $prefix = substr($route->getPrefix(), $prefixLen); - $state->mark += \strlen($rx = "|{$prefix}(?"); - $code .= "\n .".self::export($rx); - $state->regex .= $rx; - $code .= $this->indent($this->compileStaticPrefixCollection($route, $state, $prefixLen + \strlen($prefix), $conditions)); - $code .= "\n .')'"; - $state->regex .= ')'; - ++$state->markTail; - continue; - } - - [$name, $regex, $vars, $route, $hasTrailingSlash, $hasTrailingVar] = $route; - $compiledRoute = $route->compile(); - $vars = array_merge($state->hostVars, $vars); - - if ($compiledRoute->getRegex() === $prevRegex) { - $state->routes[$state->mark][] = $this->compileRoute($route, $name, $vars, $hasTrailingSlash, $hasTrailingVar, $conditions); - continue; - } - - $state->mark += 3 + $state->markTail + \strlen($regex) - $prefixLen; - $state->markTail = 2 + \strlen($state->mark); - $rx = sprintf('|%s(*:%s)', substr($regex, $prefixLen), $state->mark); - $code .= "\n .".self::export($rx); - $state->regex .= $rx; - - $prevRegex = $compiledRoute->getRegex(); - $state->routes[$state->mark] = [$this->compileRoute($route, $name, $vars, $hasTrailingSlash, $hasTrailingVar, $conditions)]; - } - - return $code; - } - - /** - * Compiles a single Route to PHP code used to match it against the path info. - */ - private function compileRoute(Route $route, string $name, string|array|null $vars, bool $hasTrailingSlash, bool $hasTrailingVar, array &$conditions): array - { - $defaults = $route->getDefaults(); - - if (isset($defaults['_canonical_route'])) { - $name = $defaults['_canonical_route']; - unset($defaults['_canonical_route']); - } - - if ($condition = $route->getCondition()) { - $condition = $this->getExpressionLanguage()->compile($condition, ['context', 'request', 'params']); - $condition = $conditions[$condition] ??= (str_contains($condition, '$request') ? 1 : -1) * \count($conditions); - } else { - $condition = null; - } - - return [ - ['_route' => $name] + $defaults, - $vars, - array_flip($route->getMethods()) ?: null, - array_flip($route->getSchemes()) ?: null, - $hasTrailingSlash, - $hasTrailingVar, - $condition, - ]; - } - - private function getExpressionLanguage(): ExpressionLanguage - { - if (!isset($this->expressionLanguage)) { - if (!class_exists(ExpressionLanguage::class)) { - throw new \LogicException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed.'); - } - $this->expressionLanguage = new ExpressionLanguage(null, $this->expressionLanguageProviders); - } - - return $this->expressionLanguage; - } - - private function indent(string $code, int $level = 1): string - { - return preg_replace('/^./m', str_repeat(' ', $level).'$0', $code); - } - - /** - * @internal - */ - public static function export(mixed $value): string - { - if (null === $value) { - return 'null'; - } - if (!\is_array($value)) { - if (\is_object($value)) { - throw new \InvalidArgumentException('Symfony\Component\Routing\Route cannot contain objects.'); - } - - return str_replace("\n", '\'."\n".\'', var_export($value, true)); - } - if (!$value) { - return '[]'; - } - - $i = 0; - $export = '['; - - foreach ($value as $k => $v) { - if ($i === $k) { - ++$i; - } else { - $export .= self::export($k).' => '; - - if (\is_int($k) && $i < $k) { - $i = 1 + $k; - } - } - - $export .= self::export($v).', '; - } - - return substr_replace($export, ']', -2); - } -} diff --git a/vendor/symfony/routing/Matcher/Dumper/CompiledUrlMatcherTrait.php b/vendor/symfony/routing/Matcher/Dumper/CompiledUrlMatcherTrait.php deleted file mode 100644 index 207d054f..00000000 --- a/vendor/symfony/routing/Matcher/Dumper/CompiledUrlMatcherTrait.php +++ /dev/null @@ -1,190 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing\Matcher\Dumper; - -use Symfony\Component\Routing\Exception\MethodNotAllowedException; -use Symfony\Component\Routing\Exception\NoConfigurationException; -use Symfony\Component\Routing\Exception\ResourceNotFoundException; -use Symfony\Component\Routing\Matcher\RedirectableUrlMatcherInterface; -use Symfony\Component\Routing\RequestContext; - -/** - * @author Nicolas Grekas - * - * @internal - * - * @property RequestContext $context - */ -trait CompiledUrlMatcherTrait -{ - private bool $matchHost = false; - private array $staticRoutes = []; - private array $regexpList = []; - private array $dynamicRoutes = []; - - /** - * @var callable|null - */ - private $checkCondition; - - public function match(string $pathinfo): array - { - $allow = $allowSchemes = []; - if ($ret = $this->doMatch($pathinfo, $allow, $allowSchemes)) { - return $ret; - } - if ($allow) { - throw new MethodNotAllowedException(array_keys($allow)); - } - if (!$this instanceof RedirectableUrlMatcherInterface) { - throw new ResourceNotFoundException(sprintf('No routes found for "%s".', $pathinfo)); - } - if (!\in_array($this->context->getMethod(), ['HEAD', 'GET'], true)) { - // no-op - } elseif ($allowSchemes) { - redirect_scheme: - $scheme = $this->context->getScheme(); - $this->context->setScheme(key($allowSchemes)); - try { - if ($ret = $this->doMatch($pathinfo)) { - return $this->redirect($pathinfo, $ret['_route'], $this->context->getScheme()) + $ret; - } - } finally { - $this->context->setScheme($scheme); - } - } elseif ('/' !== $trimmedPathinfo = rtrim($pathinfo, '/') ?: '/') { - $pathinfo = $trimmedPathinfo === $pathinfo ? $pathinfo.'/' : $trimmedPathinfo; - if ($ret = $this->doMatch($pathinfo, $allow, $allowSchemes)) { - return $this->redirect($pathinfo, $ret['_route']) + $ret; - } - if ($allowSchemes) { - goto redirect_scheme; - } - } - - throw new ResourceNotFoundException(sprintf('No routes found for "%s".', $pathinfo)); - } - - private function doMatch(string $pathinfo, array &$allow = [], array &$allowSchemes = []): array - { - $allow = $allowSchemes = []; - $pathinfo = rawurldecode($pathinfo) ?: '/'; - $trimmedPathinfo = rtrim($pathinfo, '/') ?: '/'; - $context = $this->context; - $requestMethod = $canonicalMethod = $context->getMethod(); - - if ($this->matchHost) { - $host = strtolower($context->getHost()); - } - - if ('HEAD' === $requestMethod) { - $canonicalMethod = 'GET'; - } - $supportsRedirections = 'GET' === $canonicalMethod && $this instanceof RedirectableUrlMatcherInterface; - - foreach ($this->staticRoutes[$trimmedPathinfo] ?? [] as [$ret, $requiredHost, $requiredMethods, $requiredSchemes, $hasTrailingSlash, , $condition]) { - if ($requiredHost) { - if ('{' !== $requiredHost[0] ? $requiredHost !== $host : !preg_match($requiredHost, $host, $hostMatches)) { - continue; - } - if ('{' === $requiredHost[0] && $hostMatches) { - $hostMatches['_route'] = $ret['_route']; - $ret = $this->mergeDefaults($hostMatches, $ret); - } - } - - if ($condition && !($this->checkCondition)($condition, $context, 0 < $condition ? $request ??= $this->request ?: $this->createRequest($pathinfo) : null, $ret)) { - continue; - } - - if ('/' !== $pathinfo && $hasTrailingSlash === ($trimmedPathinfo === $pathinfo)) { - if ($supportsRedirections && (!$requiredMethods || isset($requiredMethods['GET']))) { - return $allow = $allowSchemes = []; - } - continue; - } - - $hasRequiredScheme = !$requiredSchemes || isset($requiredSchemes[$context->getScheme()]); - if ($hasRequiredScheme && $requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) { - $allow += $requiredMethods; - continue; - } - - if (!$hasRequiredScheme) { - $allowSchemes += $requiredSchemes; - continue; - } - - return $ret; - } - - $matchedPathinfo = $this->matchHost ? $host.'.'.$pathinfo : $pathinfo; - - foreach ($this->regexpList as $offset => $regex) { - while (preg_match($regex, $matchedPathinfo, $matches)) { - foreach ($this->dynamicRoutes[$m = (int) $matches['MARK']] as [$ret, $vars, $requiredMethods, $requiredSchemes, $hasTrailingSlash, $hasTrailingVar, $condition]) { - if (0 === $condition) { // marks the last route in the regexp - continue 3; - } - - $hasTrailingVar = $trimmedPathinfo !== $pathinfo && $hasTrailingVar; - - if ($hasTrailingVar && ($hasTrailingSlash || (null === $n = $matches[\count($vars)] ?? null) || '/' !== ($n[-1] ?? '/')) && preg_match($regex, $this->matchHost ? $host.'.'.$trimmedPathinfo : $trimmedPathinfo, $n) && $m === (int) $n['MARK']) { - if ($hasTrailingSlash) { - $matches = $n; - } else { - $hasTrailingVar = false; - } - } - - foreach ($vars as $i => $v) { - if (isset($matches[1 + $i])) { - $ret[$v] = $matches[1 + $i]; - } - } - - if ($condition && !($this->checkCondition)($condition, $context, 0 < $condition ? $request ??= $this->request ?: $this->createRequest($pathinfo) : null, $ret)) { - continue; - } - - if ('/' !== $pathinfo && !$hasTrailingVar && $hasTrailingSlash === ($trimmedPathinfo === $pathinfo)) { - if ($supportsRedirections && (!$requiredMethods || isset($requiredMethods['GET']))) { - return $allow = $allowSchemes = []; - } - continue; - } - - if ($requiredSchemes && !isset($requiredSchemes[$context->getScheme()])) { - $allowSchemes += $requiredSchemes; - continue; - } - - if ($requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) { - $allow += $requiredMethods; - continue; - } - - return $ret; - } - - $regex = substr_replace($regex, 'F', $m - $offset, 1 + \strlen($m)); - $offset += \strlen($m); - } - } - - if ('/' === $pathinfo && !$allow && !$allowSchemes) { - throw new NoConfigurationException(); - } - - return []; - } -} diff --git a/vendor/symfony/routing/Matcher/Dumper/MatcherDumper.php b/vendor/symfony/routing/Matcher/Dumper/MatcherDumper.php deleted file mode 100644 index 085f3ba3..00000000 --- a/vendor/symfony/routing/Matcher/Dumper/MatcherDumper.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing\Matcher\Dumper; - -use Symfony\Component\Routing\RouteCollection; - -/** - * MatcherDumper is the abstract class for all built-in matcher dumpers. - * - * @author Fabien Potencier - */ -abstract class MatcherDumper implements MatcherDumperInterface -{ - private RouteCollection $routes; - - public function __construct(RouteCollection $routes) - { - $this->routes = $routes; - } - - public function getRoutes(): RouteCollection - { - return $this->routes; - } -} diff --git a/vendor/symfony/routing/Matcher/Dumper/MatcherDumperInterface.php b/vendor/symfony/routing/Matcher/Dumper/MatcherDumperInterface.php deleted file mode 100644 index 92cc4db2..00000000 --- a/vendor/symfony/routing/Matcher/Dumper/MatcherDumperInterface.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\Routing\Matcher\Dumper; - -use Symfony\Component\Routing\RouteCollection; - -/** - * MatcherDumperInterface is the interface that all matcher dumper classes must implement. - * - * @author Fabien Potencier - */ -interface MatcherDumperInterface -{ - /** - * Dumps a set of routes to a string representation of executable code - * that can then be used to match a request against these routes. - */ - public function dump(array $options = []): string; - - /** - * Gets the routes to dump. - */ - public function getRoutes(): RouteCollection; -} diff --git a/vendor/symfony/routing/Matcher/Dumper/StaticPrefixCollection.php b/vendor/symfony/routing/Matcher/Dumper/StaticPrefixCollection.php deleted file mode 100644 index ab357baf..00000000 --- a/vendor/symfony/routing/Matcher/Dumper/StaticPrefixCollection.php +++ /dev/null @@ -1,203 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing\Matcher\Dumper; - -use Symfony\Component\Routing\RouteCollection; - -/** - * Prefix tree of routes preserving routes order. - * - * @author Frank de Jonge - * @author Nicolas Grekas - * - * @internal - */ -class StaticPrefixCollection -{ - private string $prefix; - - /** - * @var string[] - */ - private array $staticPrefixes = []; - - /** - * @var string[] - */ - private array $prefixes = []; - - /** - * @var array[]|self[] - */ - private array $items = []; - - public function __construct(string $prefix = '/') - { - $this->prefix = $prefix; - } - - public function getPrefix(): string - { - return $this->prefix; - } - - /** - * @return array[]|self[] - */ - public function getRoutes(): array - { - return $this->items; - } - - /** - * Adds a route to a group. - */ - public function addRoute(string $prefix, array|StaticPrefixCollection $route) - { - [$prefix, $staticPrefix] = $this->getCommonPrefix($prefix, $prefix); - - for ($i = \count($this->items) - 1; 0 <= $i; --$i) { - $item = $this->items[$i]; - - [$commonPrefix, $commonStaticPrefix] = $this->getCommonPrefix($prefix, $this->prefixes[$i]); - - if ($this->prefix === $commonPrefix) { - // the new route and a previous one have no common prefix, let's see if they are exclusive to each others - - if ($this->prefix !== $staticPrefix && $this->prefix !== $this->staticPrefixes[$i]) { - // the new route and the previous one have exclusive static prefixes - continue; - } - - if ($this->prefix === $staticPrefix && $this->prefix === $this->staticPrefixes[$i]) { - // the new route and the previous one have no static prefix - break; - } - - if ($this->prefixes[$i] !== $this->staticPrefixes[$i] && $this->prefix === $this->staticPrefixes[$i]) { - // the previous route is non-static and has no static prefix - break; - } - - if ($prefix !== $staticPrefix && $this->prefix === $staticPrefix) { - // the new route is non-static and has no static prefix - break; - } - - continue; - } - - if ($item instanceof self && $this->prefixes[$i] === $commonPrefix) { - // the new route is a child of a previous one, let's nest it - $item->addRoute($prefix, $route); - } else { - // the new route and a previous one have a common prefix, let's merge them - $child = new self($commonPrefix); - [$child->prefixes[0], $child->staticPrefixes[0]] = $child->getCommonPrefix($this->prefixes[$i], $this->prefixes[$i]); - [$child->prefixes[1], $child->staticPrefixes[1]] = $child->getCommonPrefix($prefix, $prefix); - $child->items = [$this->items[$i], $route]; - - $this->staticPrefixes[$i] = $commonStaticPrefix; - $this->prefixes[$i] = $commonPrefix; - $this->items[$i] = $child; - } - - return; - } - - // No optimised case was found, in this case we simple add the route for possible - // grouping when new routes are added. - $this->staticPrefixes[] = $staticPrefix; - $this->prefixes[] = $prefix; - $this->items[] = $route; - } - - /** - * Linearizes back a set of nested routes into a collection. - */ - public function populateCollection(RouteCollection $routes): RouteCollection - { - foreach ($this->items as $route) { - if ($route instanceof self) { - $route->populateCollection($routes); - } else { - $routes->add(...$route); - } - } - - return $routes; - } - - /** - * Gets the full and static common prefixes between two route patterns. - * - * The static prefix stops at last at the first opening bracket. - */ - private function getCommonPrefix(string $prefix, string $anotherPrefix): array - { - $baseLength = \strlen($this->prefix); - $end = min(\strlen($prefix), \strlen($anotherPrefix)); - $staticLength = null; - set_error_handler([__CLASS__, 'handleError']); - - try { - for ($i = $baseLength; $i < $end && $prefix[$i] === $anotherPrefix[$i]; ++$i) { - if ('(' === $prefix[$i]) { - $staticLength ??= $i; - for ($j = 1 + $i, $n = 1; $j < $end && 0 < $n; ++$j) { - if ($prefix[$j] !== $anotherPrefix[$j]) { - break 2; - } - if ('(' === $prefix[$j]) { - ++$n; - } elseif (')' === $prefix[$j]) { - --$n; - } elseif ('\\' === $prefix[$j] && (++$j === $end || $prefix[$j] !== $anotherPrefix[$j])) { - --$j; - break; - } - } - if (0 < $n) { - break; - } - if (('?' === ($prefix[$j] ?? '') || '?' === ($anotherPrefix[$j] ?? '')) && ($prefix[$j] ?? '') !== ($anotherPrefix[$j] ?? '')) { - break; - } - $subPattern = substr($prefix, $i, $j - $i); - if ($prefix !== $anotherPrefix && !preg_match('/^\(\[[^\]]++\]\+\+\)$/', $subPattern) && !preg_match('{(?> 6) && preg_match('//u', $prefix.' '.$anotherPrefix)) { - do { - // Prevent cutting in the middle of an UTF-8 characters - --$i; - } while (0b10 === (\ord($prefix[$i]) >> 6)); - } - - return [substr($prefix, 0, $i), substr($prefix, 0, $staticLength ?? $i)]; - } - - public static function handleError(int $type, string $msg) - { - return str_contains($msg, 'Compilation failed: lookbehind assertion is not fixed length'); - } -} diff --git a/vendor/symfony/routing/Matcher/ExpressionLanguageProvider.php b/vendor/symfony/routing/Matcher/ExpressionLanguageProvider.php deleted file mode 100644 index 303798d6..00000000 --- a/vendor/symfony/routing/Matcher/ExpressionLanguageProvider.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing\Matcher; - -use Symfony\Component\ExpressionLanguage\ExpressionFunction; -use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface; -use Symfony\Contracts\Service\ServiceProviderInterface; - -/** - * Exposes functions defined in the request context to route conditions. - * - * @author Ahmed TAILOULOUTE - */ -class ExpressionLanguageProvider implements ExpressionFunctionProviderInterface -{ - private ServiceProviderInterface $functions; - - public function __construct(ServiceProviderInterface $functions) - { - $this->functions = $functions; - } - - public function getFunctions(): array - { - $functions = []; - - foreach ($this->functions->getProvidedServices() as $function => $type) { - $functions[] = new ExpressionFunction( - $function, - static function (...$args) use ($function) { - return sprintf('($context->getParameter(\'_functions\')->get(%s)(%s))', var_export($function, true), implode(', ', $args)); - }, - function ($values, ...$args) use ($function) { - return $values['context']->getParameter('_functions')->get($function)(...$args); - } - ); - } - - return $functions; - } - - public function get(string $function): callable - { - return $this->functions->get($function); - } -} diff --git a/vendor/symfony/routing/Matcher/RedirectableUrlMatcher.php b/vendor/symfony/routing/Matcher/RedirectableUrlMatcher.php deleted file mode 100644 index 8d1ad4f9..00000000 --- a/vendor/symfony/routing/Matcher/RedirectableUrlMatcher.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing\Matcher; - -use Symfony\Component\Routing\Exception\ExceptionInterface; -use Symfony\Component\Routing\Exception\ResourceNotFoundException; - -/** - * @author Fabien Potencier - */ -abstract class RedirectableUrlMatcher extends UrlMatcher implements RedirectableUrlMatcherInterface -{ - public function match(string $pathinfo): array - { - try { - return parent::match($pathinfo); - } catch (ResourceNotFoundException $e) { - if (!\in_array($this->context->getMethod(), ['HEAD', 'GET'], true)) { - throw $e; - } - - if ($this->allowSchemes) { - redirect_scheme: - $scheme = $this->context->getScheme(); - $this->context->setScheme(current($this->allowSchemes)); - try { - $ret = parent::match($pathinfo); - - return $this->redirect($pathinfo, $ret['_route'] ?? null, $this->context->getScheme()) + $ret; - } catch (ExceptionInterface) { - throw $e; - } finally { - $this->context->setScheme($scheme); - } - } elseif ('/' === $trimmedPathinfo = rtrim($pathinfo, '/') ?: '/') { - throw $e; - } else { - try { - $pathinfo = $trimmedPathinfo === $pathinfo ? $pathinfo.'/' : $trimmedPathinfo; - $ret = parent::match($pathinfo); - - return $this->redirect($pathinfo, $ret['_route'] ?? null) + $ret; - } catch (ExceptionInterface) { - if ($this->allowSchemes) { - goto redirect_scheme; - } - throw $e; - } - } - } - } -} diff --git a/vendor/symfony/routing/Matcher/RedirectableUrlMatcherInterface.php b/vendor/symfony/routing/Matcher/RedirectableUrlMatcherInterface.php deleted file mode 100644 index cd7e8c2c..00000000 --- a/vendor/symfony/routing/Matcher/RedirectableUrlMatcherInterface.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing\Matcher; - -/** - * RedirectableUrlMatcherInterface knows how to redirect the user. - * - * @author Fabien Potencier - */ -interface RedirectableUrlMatcherInterface -{ - /** - * Redirects the user to another URL and returns the parameters for the redirection. - * - * @param string $path The path info to redirect to - * @param string $route The route name that matched - * @param string|null $scheme The URL scheme (null to keep the current one) - */ - public function redirect(string $path, string $route, string $scheme = null): array; -} diff --git a/vendor/symfony/routing/Matcher/RequestMatcherInterface.php b/vendor/symfony/routing/Matcher/RequestMatcherInterface.php deleted file mode 100644 index febba95b..00000000 --- a/vendor/symfony/routing/Matcher/RequestMatcherInterface.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\Routing\Matcher; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\Routing\Exception\MethodNotAllowedException; -use Symfony\Component\Routing\Exception\NoConfigurationException; -use Symfony\Component\Routing\Exception\ResourceNotFoundException; - -/** - * RequestMatcherInterface is the interface that all request matcher classes must implement. - * - * @author Fabien Potencier - */ -interface RequestMatcherInterface -{ - /** - * Tries to match a request with a set of routes. - * - * If the matcher cannot find information, it must throw one of the exceptions documented - * below. - * - * @throws NoConfigurationException If no routing configuration could be found - * @throws ResourceNotFoundException If no matching resource could be found - * @throws MethodNotAllowedException If a matching resource was found but the request method is not allowed - */ - public function matchRequest(Request $request): array; -} diff --git a/vendor/symfony/routing/Matcher/TraceableUrlMatcher.php b/vendor/symfony/routing/Matcher/TraceableUrlMatcher.php deleted file mode 100644 index 0f0cb3fd..00000000 --- a/vendor/symfony/routing/Matcher/TraceableUrlMatcher.php +++ /dev/null @@ -1,166 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing\Matcher; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\Routing\Exception\ExceptionInterface; -use Symfony\Component\Routing\Route; -use Symfony\Component\Routing\RouteCollection; - -/** - * TraceableUrlMatcher helps debug path info matching by tracing the match. - * - * @author Fabien Potencier - */ -class TraceableUrlMatcher extends UrlMatcher -{ - public const ROUTE_DOES_NOT_MATCH = 0; - public const ROUTE_ALMOST_MATCHES = 1; - public const ROUTE_MATCHES = 2; - - protected $traces; - - public function getTraces(string $pathinfo) - { - $this->traces = []; - - try { - $this->match($pathinfo); - } catch (ExceptionInterface) { - } - - return $this->traces; - } - - public function getTracesForRequest(Request $request) - { - $this->request = $request; - $traces = $this->getTraces($request->getPathInfo()); - $this->request = null; - - return $traces; - } - - protected function matchCollection(string $pathinfo, RouteCollection $routes): array - { - // HEAD and GET are equivalent as per RFC - if ('HEAD' === $method = $this->context->getMethod()) { - $method = 'GET'; - } - $supportsTrailingSlash = 'GET' === $method && $this instanceof RedirectableUrlMatcherInterface; - $trimmedPathinfo = rtrim($pathinfo, '/') ?: '/'; - - foreach ($routes as $name => $route) { - $compiledRoute = $route->compile(); - $staticPrefix = rtrim($compiledRoute->getStaticPrefix(), '/'); - $requiredMethods = $route->getMethods(); - - // check the static prefix of the URL first. Only use the more expensive preg_match when it matches - if ('' !== $staticPrefix && !str_starts_with($trimmedPathinfo, $staticPrefix)) { - $this->addTrace(sprintf('Path "%s" does not match', $route->getPath()), self::ROUTE_DOES_NOT_MATCH, $name, $route); - continue; - } - $regex = $compiledRoute->getRegex(); - - $pos = strrpos($regex, '$'); - $hasTrailingSlash = '/' === $regex[$pos - 1]; - $regex = substr_replace($regex, '/?$', $pos - $hasTrailingSlash, 1 + $hasTrailingSlash); - - if (!preg_match($regex, $pathinfo, $matches)) { - // does it match without any requirements? - $r = new Route($route->getPath(), $route->getDefaults(), [], $route->getOptions()); - $cr = $r->compile(); - if (!preg_match($cr->getRegex(), $pathinfo)) { - $this->addTrace(sprintf('Path "%s" does not match', $route->getPath()), self::ROUTE_DOES_NOT_MATCH, $name, $route); - - continue; - } - - foreach ($route->getRequirements() as $n => $regex) { - $r = new Route($route->getPath(), $route->getDefaults(), [$n => $regex], $route->getOptions()); - $cr = $r->compile(); - - if (\in_array($n, $cr->getVariables()) && !preg_match($cr->getRegex(), $pathinfo)) { - $this->addTrace(sprintf('Requirement for "%s" does not match (%s)', $n, $regex), self::ROUTE_ALMOST_MATCHES, $name, $route); - - continue 2; - } - } - - continue; - } - - $hasTrailingVar = $trimmedPathinfo !== $pathinfo && preg_match('#\{[\w\x80-\xFF]+\}/?$#', $route->getPath()); - - if ($hasTrailingVar && ($hasTrailingSlash || (null === $m = $matches[\count($compiledRoute->getPathVariables())] ?? null) || '/' !== ($m[-1] ?? '/')) && preg_match($regex, $trimmedPathinfo, $m)) { - if ($hasTrailingSlash) { - $matches = $m; - } else { - $hasTrailingVar = false; - } - } - - $hostMatches = []; - if ($compiledRoute->getHostRegex() && !preg_match($compiledRoute->getHostRegex(), $this->context->getHost(), $hostMatches)) { - $this->addTrace(sprintf('Host "%s" does not match the requirement ("%s")', $this->context->getHost(), $route->getHost()), self::ROUTE_ALMOST_MATCHES, $name, $route); - continue; - } - - $attributes = $this->getAttributes($route, $name, array_replace($matches, $hostMatches)); - - $status = $this->handleRouteRequirements($pathinfo, $name, $route, $attributes); - - if (self::REQUIREMENT_MISMATCH === $status[0]) { - $this->addTrace(sprintf('Condition "%s" does not evaluate to "true"', $route->getCondition()), self::ROUTE_ALMOST_MATCHES, $name, $route); - continue; - } - - if ('/' !== $pathinfo && !$hasTrailingVar && $hasTrailingSlash === ($trimmedPathinfo === $pathinfo)) { - if ($supportsTrailingSlash && (!$requiredMethods || \in_array('GET', $requiredMethods))) { - $this->addTrace('Route matches!', self::ROUTE_MATCHES, $name, $route); - - return $this->allow = $this->allowSchemes = []; - } - $this->addTrace(sprintf('Path "%s" does not match', $route->getPath()), self::ROUTE_DOES_NOT_MATCH, $name, $route); - continue; - } - - if ($route->getSchemes() && !$route->hasScheme($this->context->getScheme())) { - $this->allowSchemes = array_merge($this->allowSchemes, $route->getSchemes()); - $this->addTrace(sprintf('Scheme "%s" does not match any of the required schemes (%s)', $this->context->getScheme(), implode(', ', $route->getSchemes())), self::ROUTE_ALMOST_MATCHES, $name, $route); - continue; - } - - if ($requiredMethods && !\in_array($method, $requiredMethods)) { - $this->allow = array_merge($this->allow, $requiredMethods); - $this->addTrace(sprintf('Method "%s" does not match any of the required methods (%s)', $this->context->getMethod(), implode(', ', $requiredMethods)), self::ROUTE_ALMOST_MATCHES, $name, $route); - continue; - } - - $this->addTrace('Route matches!', self::ROUTE_MATCHES, $name, $route); - - return array_replace($attributes, $status[1] ?? []); - } - - return []; - } - - private function addTrace(string $log, int $level = self::ROUTE_DOES_NOT_MATCH, string $name = null, Route $route = null) - { - $this->traces[] = [ - 'log' => $log, - 'name' => $name, - 'level' => $level, - 'path' => $route?->getPath(), - ]; - } -} diff --git a/vendor/symfony/routing/Matcher/UrlMatcher.php b/vendor/symfony/routing/Matcher/UrlMatcher.php deleted file mode 100644 index 68fb25db..00000000 --- a/vendor/symfony/routing/Matcher/UrlMatcher.php +++ /dev/null @@ -1,278 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing\Matcher; - -use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface; -use Symfony\Component\ExpressionLanguage\ExpressionLanguage; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\Routing\Exception\MethodNotAllowedException; -use Symfony\Component\Routing\Exception\NoConfigurationException; -use Symfony\Component\Routing\Exception\ResourceNotFoundException; -use Symfony\Component\Routing\RequestContext; -use Symfony\Component\Routing\Route; -use Symfony\Component\Routing\RouteCollection; - -/** - * UrlMatcher matches URL based on a set of routes. - * - * @author Fabien Potencier - */ -class UrlMatcher implements UrlMatcherInterface, RequestMatcherInterface -{ - public const REQUIREMENT_MATCH = 0; - public const REQUIREMENT_MISMATCH = 1; - public const ROUTE_MATCH = 2; - - /** @var RequestContext */ - protected $context; - - /** - * Collects HTTP methods that would be allowed for the request. - */ - protected $allow = []; - - /** - * Collects URI schemes that would be allowed for the request. - * - * @internal - */ - protected array $allowSchemes = []; - - protected $routes; - protected $request; - protected $expressionLanguage; - - /** - * @var ExpressionFunctionProviderInterface[] - */ - protected $expressionLanguageProviders = []; - - public function __construct(RouteCollection $routes, RequestContext $context) - { - $this->routes = $routes; - $this->context = $context; - } - - public function setContext(RequestContext $context) - { - $this->context = $context; - } - - public function getContext(): RequestContext - { - return $this->context; - } - - public function match(string $pathinfo): array - { - $this->allow = $this->allowSchemes = []; - - if ($ret = $this->matchCollection(rawurldecode($pathinfo) ?: '/', $this->routes)) { - return $ret; - } - - if ('/' === $pathinfo && !$this->allow && !$this->allowSchemes) { - throw new NoConfigurationException(); - } - - throw 0 < \count($this->allow) ? new MethodNotAllowedException(array_unique($this->allow)) : new ResourceNotFoundException(sprintf('No routes found for "%s".', $pathinfo)); - } - - public function matchRequest(Request $request): array - { - $this->request = $request; - - $ret = $this->match($request->getPathInfo()); - - $this->request = null; - - return $ret; - } - - public function addExpressionLanguageProvider(ExpressionFunctionProviderInterface $provider) - { - $this->expressionLanguageProviders[] = $provider; - } - - /** - * Tries to match a URL with a set of routes. - * - * @param string $pathinfo The path info to be parsed - * - * @throws NoConfigurationException If no routing configuration could be found - * @throws ResourceNotFoundException If the resource could not be found - * @throws MethodNotAllowedException If the resource was found but the request method is not allowed - */ - protected function matchCollection(string $pathinfo, RouteCollection $routes): array - { - // HEAD and GET are equivalent as per RFC - if ('HEAD' === $method = $this->context->getMethod()) { - $method = 'GET'; - } - $supportsTrailingSlash = 'GET' === $method && $this instanceof RedirectableUrlMatcherInterface; - $trimmedPathinfo = rtrim($pathinfo, '/') ?: '/'; - - foreach ($routes as $name => $route) { - $compiledRoute = $route->compile(); - $staticPrefix = rtrim($compiledRoute->getStaticPrefix(), '/'); - $requiredMethods = $route->getMethods(); - - // check the static prefix of the URL first. Only use the more expensive preg_match when it matches - if ('' !== $staticPrefix && !str_starts_with($trimmedPathinfo, $staticPrefix)) { - continue; - } - $regex = $compiledRoute->getRegex(); - - $pos = strrpos($regex, '$'); - $hasTrailingSlash = '/' === $regex[$pos - 1]; - $regex = substr_replace($regex, '/?$', $pos - $hasTrailingSlash, 1 + $hasTrailingSlash); - - if (!preg_match($regex, $pathinfo, $matches)) { - continue; - } - - $hasTrailingVar = $trimmedPathinfo !== $pathinfo && preg_match('#\{[\w\x80-\xFF]+\}/?$#', $route->getPath()); - - if ($hasTrailingVar && ($hasTrailingSlash || (null === $m = $matches[\count($compiledRoute->getPathVariables())] ?? null) || '/' !== ($m[-1] ?? '/')) && preg_match($regex, $trimmedPathinfo, $m)) { - if ($hasTrailingSlash) { - $matches = $m; - } else { - $hasTrailingVar = false; - } - } - - $hostMatches = []; - if ($compiledRoute->getHostRegex() && !preg_match($compiledRoute->getHostRegex(), $this->context->getHost(), $hostMatches)) { - continue; - } - - $attributes = $this->getAttributes($route, $name, array_replace($matches, $hostMatches)); - - $status = $this->handleRouteRequirements($pathinfo, $name, $route, $attributes); - - if (self::REQUIREMENT_MISMATCH === $status[0]) { - continue; - } - - if ('/' !== $pathinfo && !$hasTrailingVar && $hasTrailingSlash === ($trimmedPathinfo === $pathinfo)) { - if ($supportsTrailingSlash && (!$requiredMethods || \in_array('GET', $requiredMethods))) { - return $this->allow = $this->allowSchemes = []; - } - continue; - } - - if ($route->getSchemes() && !$route->hasScheme($this->context->getScheme())) { - $this->allowSchemes = array_merge($this->allowSchemes, $route->getSchemes()); - continue; - } - - if ($requiredMethods && !\in_array($method, $requiredMethods)) { - $this->allow = array_merge($this->allow, $requiredMethods); - continue; - } - - return array_replace($attributes, $status[1] ?? []); - } - - return []; - } - - /** - * Returns an array of values to use as request attributes. - * - * As this method requires the Route object, it is not available - * in matchers that do not have access to the matched Route instance - * (like the PHP and Apache matcher dumpers). - */ - protected function getAttributes(Route $route, string $name, array $attributes): array - { - $defaults = $route->getDefaults(); - if (isset($defaults['_canonical_route'])) { - $name = $defaults['_canonical_route']; - unset($defaults['_canonical_route']); - } - $attributes['_route'] = $name; - - return $this->mergeDefaults($attributes, $defaults); - } - - /** - * Handles specific route requirements. - * - * @return array The first element represents the status, the second contains additional information - */ - protected function handleRouteRequirements(string $pathinfo, string $name, Route $route/* , array $routeParameters */): array - { - if (\func_num_args() < 4) { - trigger_deprecation('symfony/routing', '6.1', 'The "%s()" method will have a new "array $routeParameters" argument in version 7.0, not defining it is deprecated.', __METHOD__); - $routeParameters = []; - } else { - $routeParameters = func_get_arg(3); - - if (!\is_array($routeParameters)) { - throw new \TypeError(sprintf('"%s": Argument $routeParameters is expected to be an array, got "%s".', __METHOD__, get_debug_type($routeParameters))); - } - } - - // expression condition - if ($route->getCondition() && !$this->getExpressionLanguage()->evaluate($route->getCondition(), [ - 'context' => $this->context, - 'request' => $this->request ?: $this->createRequest($pathinfo), - 'params' => $routeParameters, - ])) { - return [self::REQUIREMENT_MISMATCH, null]; - } - - return [self::REQUIREMENT_MATCH, null]; - } - - /** - * Get merged default parameters. - */ - protected function mergeDefaults(array $params, array $defaults): array - { - foreach ($params as $key => $value) { - if (!\is_int($key) && null !== $value) { - $defaults[$key] = $value; - } - } - - return $defaults; - } - - protected function getExpressionLanguage() - { - if (null === $this->expressionLanguage) { - if (!class_exists(ExpressionLanguage::class)) { - throw new \LogicException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed.'); - } - $this->expressionLanguage = new ExpressionLanguage(null, $this->expressionLanguageProviders); - } - - return $this->expressionLanguage; - } - - /** - * @internal - */ - protected function createRequest(string $pathinfo): ?Request - { - if (!class_exists(Request::class)) { - return null; - } - - return Request::create($this->context->getScheme().'://'.$this->context->getHost().$this->context->getBaseUrl().$pathinfo, $this->context->getMethod(), $this->context->getParameters(), [], [], [ - 'SCRIPT_FILENAME' => $this->context->getBaseUrl(), - 'SCRIPT_NAME' => $this->context->getBaseUrl(), - ]); - } -} diff --git a/vendor/symfony/routing/Matcher/UrlMatcherInterface.php b/vendor/symfony/routing/Matcher/UrlMatcherInterface.php deleted file mode 100644 index 68a3737f..00000000 --- a/vendor/symfony/routing/Matcher/UrlMatcherInterface.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing\Matcher; - -use Symfony\Component\Routing\Exception\MethodNotAllowedException; -use Symfony\Component\Routing\Exception\NoConfigurationException; -use Symfony\Component\Routing\Exception\ResourceNotFoundException; -use Symfony\Component\Routing\RequestContextAwareInterface; - -/** - * UrlMatcherInterface is the interface that all URL matcher classes must implement. - * - * @author Fabien Potencier - */ -interface UrlMatcherInterface extends RequestContextAwareInterface -{ - /** - * Tries to match a URL path with a set of routes. - * - * If the matcher cannot find information, it must throw one of the exceptions documented - * below. - * - * @param string $pathinfo The path info to be parsed (raw format, i.e. not urldecoded) - * - * @throws NoConfigurationException If no routing configuration could be found - * @throws ResourceNotFoundException If the resource could not be found - * @throws MethodNotAllowedException If the resource was found but the request method is not allowed - */ - public function match(string $pathinfo): array; -} diff --git a/vendor/symfony/routing/README.md b/vendor/symfony/routing/README.md deleted file mode 100644 index ae8284f5..00000000 --- a/vendor/symfony/routing/README.md +++ /dev/null @@ -1,51 +0,0 @@ -Routing Component -================= - -The Routing component maps an HTTP request to a set of configuration variables. - -Getting Started ---------------- - -``` -$ composer require symfony/routing -``` - -```php -use App\Controller\BlogController; -use Symfony\Component\Routing\Generator\UrlGenerator; -use Symfony\Component\Routing\Matcher\UrlMatcher; -use Symfony\Component\Routing\RequestContext; -use Symfony\Component\Routing\Route; -use Symfony\Component\Routing\RouteCollection; - -$route = new Route('/blog/{slug}', ['_controller' => BlogController::class]); -$routes = new RouteCollection(); -$routes->add('blog_show', $route); - -$context = new RequestContext(); - -// Routing can match routes with incoming requests -$matcher = new UrlMatcher($routes, $context); -$parameters = $matcher->match('/blog/lorem-ipsum'); -// $parameters = [ -// '_controller' => 'App\Controller\BlogController', -// 'slug' => 'lorem-ipsum', -// '_route' => 'blog_show' -// ] - -// Routing can also generate URLs for a given route -$generator = new UrlGenerator($routes, $context); -$url = $generator->generate('blog_show', [ - 'slug' => 'my-blog-post', -]); -// $url = '/blog/my-blog-post' -``` - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/routing.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/routing/RequestContext.php b/vendor/symfony/routing/RequestContext.php deleted file mode 100644 index e3f4831b..00000000 --- a/vendor/symfony/routing/RequestContext.php +++ /dev/null @@ -1,303 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing; - -use Symfony\Component\HttpFoundation\Request; - -/** - * Holds information about the current request. - * - * This class implements a fluent interface. - * - * @author Fabien Potencier - * @author Tobias Schultze - */ -class RequestContext -{ - private string $baseUrl; - private string $pathInfo; - private string $method; - private string $host; - private string $scheme; - private int $httpPort; - private int $httpsPort; - private string $queryString; - private array $parameters = []; - - public function __construct(string $baseUrl = '', string $method = 'GET', string $host = 'localhost', string $scheme = 'http', int $httpPort = 80, int $httpsPort = 443, string $path = '/', string $queryString = '') - { - $this->setBaseUrl($baseUrl); - $this->setMethod($method); - $this->setHost($host); - $this->setScheme($scheme); - $this->setHttpPort($httpPort); - $this->setHttpsPort($httpsPort); - $this->setPathInfo($path); - $this->setQueryString($queryString); - } - - public static function fromUri(string $uri, string $host = 'localhost', string $scheme = 'http', int $httpPort = 80, int $httpsPort = 443): self - { - $uri = parse_url($uri); - $scheme = $uri['scheme'] ?? $scheme; - $host = $uri['host'] ?? $host; - - if (isset($uri['port'])) { - if ('http' === $scheme) { - $httpPort = $uri['port']; - } elseif ('https' === $scheme) { - $httpsPort = $uri['port']; - } - } - - return new self($uri['path'] ?? '', 'GET', $host, $scheme, $httpPort, $httpsPort); - } - - /** - * Updates the RequestContext information based on a HttpFoundation Request. - * - * @return $this - */ - public function fromRequest(Request $request): static - { - $this->setBaseUrl($request->getBaseUrl()); - $this->setPathInfo($request->getPathInfo()); - $this->setMethod($request->getMethod()); - $this->setHost($request->getHost()); - $this->setScheme($request->getScheme()); - $this->setHttpPort($request->isSecure() || null === $request->getPort() ? $this->httpPort : $request->getPort()); - $this->setHttpsPort($request->isSecure() && null !== $request->getPort() ? $request->getPort() : $this->httpsPort); - $this->setQueryString($request->server->get('QUERY_STRING', '')); - - return $this; - } - - /** - * Gets the base URL. - */ - public function getBaseUrl(): string - { - return $this->baseUrl; - } - - /** - * Sets the base URL. - * - * @return $this - */ - public function setBaseUrl(string $baseUrl): static - { - $this->baseUrl = rtrim($baseUrl, '/'); - - return $this; - } - - /** - * Gets the path info. - */ - public function getPathInfo(): string - { - return $this->pathInfo; - } - - /** - * Sets the path info. - * - * @return $this - */ - public function setPathInfo(string $pathInfo): static - { - $this->pathInfo = $pathInfo; - - return $this; - } - - /** - * Gets the HTTP method. - * - * The method is always an uppercased string. - */ - public function getMethod(): string - { - return $this->method; - } - - /** - * Sets the HTTP method. - * - * @return $this - */ - public function setMethod(string $method): static - { - $this->method = strtoupper($method); - - return $this; - } - - /** - * Gets the HTTP host. - * - * The host is always lowercased because it must be treated case-insensitive. - */ - public function getHost(): string - { - return $this->host; - } - - /** - * Sets the HTTP host. - * - * @return $this - */ - public function setHost(string $host): static - { - $this->host = strtolower($host); - - return $this; - } - - /** - * Gets the HTTP scheme. - */ - public function getScheme(): string - { - return $this->scheme; - } - - /** - * Sets the HTTP scheme. - * - * @return $this - */ - public function setScheme(string $scheme): static - { - $this->scheme = strtolower($scheme); - - return $this; - } - - /** - * Gets the HTTP port. - */ - public function getHttpPort(): int - { - return $this->httpPort; - } - - /** - * Sets the HTTP port. - * - * @return $this - */ - public function setHttpPort(int $httpPort): static - { - $this->httpPort = $httpPort; - - return $this; - } - - /** - * Gets the HTTPS port. - */ - public function getHttpsPort(): int - { - return $this->httpsPort; - } - - /** - * Sets the HTTPS port. - * - * @return $this - */ - public function setHttpsPort(int $httpsPort): static - { - $this->httpsPort = $httpsPort; - - return $this; - } - - /** - * Gets the query string without the "?". - */ - public function getQueryString(): string - { - return $this->queryString; - } - - /** - * Sets the query string. - * - * @return $this - */ - public function setQueryString(?string $queryString): static - { - // string cast to be fault-tolerant, accepting null - $this->queryString = (string) $queryString; - - return $this; - } - - /** - * Returns the parameters. - */ - public function getParameters(): array - { - return $this->parameters; - } - - /** - * Sets the parameters. - * - * @param array $parameters The parameters - * - * @return $this - */ - public function setParameters(array $parameters): static - { - $this->parameters = $parameters; - - return $this; - } - - /** - * Gets a parameter value. - */ - public function getParameter(string $name): mixed - { - return $this->parameters[$name] ?? null; - } - - /** - * Checks if a parameter value is set for the given parameter. - */ - public function hasParameter(string $name): bool - { - return \array_key_exists($name, $this->parameters); - } - - /** - * Sets a parameter value. - * - * @return $this - */ - public function setParameter(string $name, mixed $parameter): static - { - $this->parameters[$name] = $parameter; - - return $this; - } - - public function isSecure(): bool - { - return 'https' === $this->scheme; - } -} diff --git a/vendor/symfony/routing/RequestContextAwareInterface.php b/vendor/symfony/routing/RequestContextAwareInterface.php deleted file mode 100644 index 9ab31f6d..00000000 --- a/vendor/symfony/routing/RequestContextAwareInterface.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\Routing; - -interface RequestContextAwareInterface -{ - /** - * Sets the request context. - */ - public function setContext(RequestContext $context); - - /** - * Gets the request context. - */ - public function getContext(): RequestContext; -} diff --git a/vendor/symfony/routing/Requirement/EnumRequirement.php b/vendor/symfony/routing/Requirement/EnumRequirement.php deleted file mode 100644 index 3ab2ed33..00000000 --- a/vendor/symfony/routing/Requirement/EnumRequirement.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\Routing\Requirement; - -use Symfony\Component\Routing\Exception\InvalidArgumentException; - -final class EnumRequirement implements \Stringable -{ - private string $requirement; - - /** - * @template T of \BackedEnum - * - * @param class-string|list $cases - */ - public function __construct(string|array $cases = []) - { - if (\is_string($cases)) { - if (!is_subclass_of($cases, \BackedEnum::class, true)) { - throw new InvalidArgumentException(sprintf('"%s" is not a "BackedEnum" class.', $cases)); - } - - $cases = $cases::cases(); - } else { - $class = null; - - foreach ($cases as $case) { - if (!$case instanceof \BackedEnum) { - throw new InvalidArgumentException(sprintf('Case must be a "BackedEnum" instance, "%s" given.', get_debug_type($case))); - } - - $class ??= $case::class; - - if (!$case instanceof $class) { - throw new InvalidArgumentException(sprintf('"%s::%s" is not a case of "%s".', get_debug_type($case), $case->name, $class)); - } - } - } - - $this->requirement = implode('|', array_map(static fn ($e) => preg_quote($e->value), $cases)); - } - - public function __toString(): string - { - return $this->requirement; - } -} diff --git a/vendor/symfony/routing/Requirement/Requirement.php b/vendor/symfony/routing/Requirement/Requirement.php deleted file mode 100644 index 54ad86b6..00000000 --- a/vendor/symfony/routing/Requirement/Requirement.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\Routing\Requirement; - -/* - * A collection of universal regular-expression constants to use as route parameter requirements. - */ -enum Requirement -{ - public const ASCII_SLUG = '[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*'; // symfony/string AsciiSlugger default implementation - public const CATCH_ALL = '.+'; - public const DATE_YMD = '[0-9]{4}-(?:0[1-9]|1[012])-(?:0[1-9]|[12][0-9]|(? - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing; - -/** - * A Route describes a route and its parameters. - * - * @author Fabien Potencier - * @author Tobias Schultze - */ -class Route implements \Serializable -{ - private string $path = '/'; - private string $host = ''; - private array $schemes = []; - private array $methods = []; - private array $defaults = []; - private array $requirements = []; - private array $options = []; - private string $condition = ''; - private ?CompiledRoute $compiled = null; - - /** - * Constructor. - * - * Available options: - * - * * compiler_class: A class name able to compile this route instance (RouteCompiler by default) - * * utf8: Whether UTF-8 matching is enforced ot not - * - * @param string $path The path pattern to match - * @param array $defaults An array of default parameter values - * @param array $requirements An array of requirements for parameters (regexes) - * @param array $options An array of options - * @param string|null $host The host pattern to match - * @param string|string[] $schemes A required URI scheme or an array of restricted schemes - * @param string|string[] $methods A required HTTP method or an array of restricted methods - * @param string|null $condition A condition that should evaluate to true for the route to match - */ - public function __construct(string $path, array $defaults = [], array $requirements = [], array $options = [], ?string $host = '', string|array $schemes = [], string|array $methods = [], ?string $condition = '') - { - $this->setPath($path); - $this->addDefaults($defaults); - $this->addRequirements($requirements); - $this->setOptions($options); - $this->setHost($host); - $this->setSchemes($schemes); - $this->setMethods($methods); - $this->setCondition($condition); - } - - public function __serialize(): array - { - return [ - 'path' => $this->path, - 'host' => $this->host, - 'defaults' => $this->defaults, - 'requirements' => $this->requirements, - 'options' => $this->options, - 'schemes' => $this->schemes, - 'methods' => $this->methods, - 'condition' => $this->condition, - 'compiled' => $this->compiled, - ]; - } - - /** - * @internal - */ - final public function serialize(): string - { - throw new \BadMethodCallException('Cannot serialize '.__CLASS__); - } - - public function __unserialize(array $data): void - { - $this->path = $data['path']; - $this->host = $data['host']; - $this->defaults = $data['defaults']; - $this->requirements = $data['requirements']; - $this->options = $data['options']; - $this->schemes = $data['schemes']; - $this->methods = $data['methods']; - - if (isset($data['condition'])) { - $this->condition = $data['condition']; - } - if (isset($data['compiled'])) { - $this->compiled = $data['compiled']; - } - } - - /** - * @internal - */ - final public function unserialize(string $serialized) - { - $this->__unserialize(unserialize($serialized)); - } - - public function getPath(): string - { - return $this->path; - } - - /** - * @return $this - */ - public function setPath(string $pattern): static - { - $pattern = $this->extractInlineDefaultsAndRequirements($pattern); - - // A pattern must start with a slash and must not have multiple slashes at the beginning because the - // generated path for this route would be confused with a network path, e.g. '//domain.com/path'. - $this->path = '/'.ltrim(trim($pattern), '/'); - $this->compiled = null; - - return $this; - } - - public function getHost(): string - { - return $this->host; - } - - /** - * @return $this - */ - public function setHost(?string $pattern): static - { - $this->host = $this->extractInlineDefaultsAndRequirements((string) $pattern); - $this->compiled = null; - - return $this; - } - - /** - * Returns the lowercased schemes this route is restricted to. - * So an empty array means that any scheme is allowed. - * - * @return string[] - */ - public function getSchemes(): array - { - return $this->schemes; - } - - /** - * Sets the schemes (e.g. 'https') this route is restricted to. - * So an empty array means that any scheme is allowed. - * - * @param string|string[] $schemes The scheme or an array of schemes - * - * @return $this - */ - public function setSchemes(string|array $schemes): static - { - $this->schemes = array_map('strtolower', (array) $schemes); - $this->compiled = null; - - return $this; - } - - /** - * Checks if a scheme requirement has been set. - */ - public function hasScheme(string $scheme): bool - { - return \in_array(strtolower($scheme), $this->schemes, true); - } - - /** - * Returns the uppercased HTTP methods this route is restricted to. - * So an empty array means that any method is allowed. - * - * @return string[] - */ - public function getMethods(): array - { - return $this->methods; - } - - /** - * Sets the HTTP methods (e.g. 'POST') this route is restricted to. - * So an empty array means that any method is allowed. - * - * @param string|string[] $methods The method or an array of methods - * - * @return $this - */ - public function setMethods(string|array $methods): static - { - $this->methods = array_map('strtoupper', (array) $methods); - $this->compiled = null; - - return $this; - } - - public function getOptions(): array - { - return $this->options; - } - - /** - * @return $this - */ - public function setOptions(array $options): static - { - $this->options = [ - 'compiler_class' => RouteCompiler::class, - ]; - - return $this->addOptions($options); - } - - /** - * @return $this - */ - public function addOptions(array $options): static - { - foreach ($options as $name => $option) { - $this->options[$name] = $option; - } - $this->compiled = null; - - return $this; - } - - /** - * Sets an option value. - * - * @return $this - */ - public function setOption(string $name, mixed $value): static - { - $this->options[$name] = $value; - $this->compiled = null; - - return $this; - } - - /** - * Returns the option value or null when not found. - */ - public function getOption(string $name): mixed - { - return $this->options[$name] ?? null; - } - - public function hasOption(string $name): bool - { - return \array_key_exists($name, $this->options); - } - - public function getDefaults(): array - { - return $this->defaults; - } - - /** - * @return $this - */ - public function setDefaults(array $defaults): static - { - $this->defaults = []; - - return $this->addDefaults($defaults); - } - - /** - * @return $this - */ - public function addDefaults(array $defaults): static - { - if (isset($defaults['_locale']) && $this->isLocalized()) { - unset($defaults['_locale']); - } - - foreach ($defaults as $name => $default) { - $this->defaults[$name] = $default; - } - $this->compiled = null; - - return $this; - } - - public function getDefault(string $name): mixed - { - return $this->defaults[$name] ?? null; - } - - public function hasDefault(string $name): bool - { - return \array_key_exists($name, $this->defaults); - } - - /** - * @return $this - */ - public function setDefault(string $name, mixed $default): static - { - if ('_locale' === $name && $this->isLocalized()) { - return $this; - } - - $this->defaults[$name] = $default; - $this->compiled = null; - - return $this; - } - - public function getRequirements(): array - { - return $this->requirements; - } - - /** - * @return $this - */ - public function setRequirements(array $requirements): static - { - $this->requirements = []; - - return $this->addRequirements($requirements); - } - - /** - * @return $this - */ - public function addRequirements(array $requirements): static - { - if (isset($requirements['_locale']) && $this->isLocalized()) { - unset($requirements['_locale']); - } - - foreach ($requirements as $key => $regex) { - $this->requirements[$key] = $this->sanitizeRequirement($key, $regex); - } - $this->compiled = null; - - return $this; - } - - public function getRequirement(string $key): ?string - { - return $this->requirements[$key] ?? null; - } - - public function hasRequirement(string $key): bool - { - return \array_key_exists($key, $this->requirements); - } - - /** - * @return $this - */ - public function setRequirement(string $key, string $regex): static - { - if ('_locale' === $key && $this->isLocalized()) { - return $this; - } - - $this->requirements[$key] = $this->sanitizeRequirement($key, $regex); - $this->compiled = null; - - return $this; - } - - public function getCondition(): string - { - return $this->condition; - } - - /** - * @return $this - */ - public function setCondition(?string $condition): static - { - $this->condition = (string) $condition; - $this->compiled = null; - - return $this; - } - - /** - * Compiles the route. - * - * @throws \LogicException If the Route cannot be compiled because the - * path or host pattern is invalid - * - * @see RouteCompiler which is responsible for the compilation process - */ - public function compile(): CompiledRoute - { - if (null !== $this->compiled) { - return $this->compiled; - } - - $class = $this->getOption('compiler_class'); - - return $this->compiled = $class::compile($this); - } - - private function extractInlineDefaultsAndRequirements(string $pattern): string - { - if (false === strpbrk($pattern, '?<')) { - return $pattern; - } - - return preg_replace_callback('#\{(!?)([\w\x80-\xFF]++)(<.*?>)?(\?[^\}]*+)?\}#', function ($m) { - if (isset($m[4][0])) { - $this->setDefault($m[2], '?' !== $m[4] ? substr($m[4], 1) : null); - } - if (isset($m[3][0])) { - $this->setRequirement($m[2], substr($m[3], 1, -1)); - } - - return '{'.$m[1].$m[2].'}'; - }, $pattern); - } - - private function sanitizeRequirement(string $key, string $regex) - { - if ('' !== $regex) { - if ('^' === $regex[0]) { - $regex = substr($regex, 1); - } elseif (str_starts_with($regex, '\\A')) { - $regex = substr($regex, 2); - } - } - - if (str_ends_with($regex, '$')) { - $regex = substr($regex, 0, -1); - } elseif (\strlen($regex) - 2 === strpos($regex, '\\z')) { - $regex = substr($regex, 0, -2); - } - - if ('' === $regex) { - throw new \InvalidArgumentException(sprintf('Routing requirement for "%s" cannot be empty.', $key)); - } - - return $regex; - } - - private function isLocalized(): bool - { - return isset($this->defaults['_locale']) && isset($this->defaults['_canonical_route']) && ($this->requirements['_locale'] ?? null) === preg_quote($this->defaults['_locale']); - } -} diff --git a/vendor/symfony/routing/RouteCollection.php b/vendor/symfony/routing/RouteCollection.php deleted file mode 100644 index c452aa06..00000000 --- a/vendor/symfony/routing/RouteCollection.php +++ /dev/null @@ -1,370 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing; - -use Symfony\Component\Config\Resource\ResourceInterface; -use Symfony\Component\Routing\Exception\InvalidArgumentException; -use Symfony\Component\Routing\Exception\RouteCircularReferenceException; - -/** - * A RouteCollection represents a set of Route instances. - * - * When adding a route at the end of the collection, an existing route - * with the same name is removed first. So there can only be one route - * with a given name. - * - * @author Fabien Potencier - * @author Tobias Schultze - * - * @implements \IteratorAggregate - */ -class RouteCollection implements \IteratorAggregate, \Countable -{ - /** - * @var array - */ - private array $routes = []; - - /** - * @var array - */ - private $aliases = []; - - /** - * @var array - */ - private array $resources = []; - - /** - * @var array - */ - private array $priorities = []; - - public function __clone() - { - foreach ($this->routes as $name => $route) { - $this->routes[$name] = clone $route; - } - - foreach ($this->aliases as $name => $alias) { - $this->aliases[$name] = clone $alias; - } - } - - /** - * Gets the current RouteCollection as an Iterator that includes all routes. - * - * It implements \IteratorAggregate. - * - * @see all() - * - * @return \ArrayIterator - */ - public function getIterator(): \ArrayIterator - { - return new \ArrayIterator($this->all()); - } - - /** - * Gets the number of Routes in this collection. - */ - public function count(): int - { - return \count($this->routes); - } - - public function add(string $name, Route $route, int $priority = 0) - { - unset($this->routes[$name], $this->priorities[$name], $this->aliases[$name]); - - $this->routes[$name] = $route; - - if ($priority) { - $this->priorities[$name] = $priority; - } - } - - /** - * Returns all routes in this collection. - * - * @return array - */ - public function all(): array - { - if ($this->priorities) { - $priorities = $this->priorities; - $keysOrder = array_flip(array_keys($this->routes)); - uksort($this->routes, static function ($n1, $n2) use ($priorities, $keysOrder) { - return (($priorities[$n2] ?? 0) <=> ($priorities[$n1] ?? 0)) ?: ($keysOrder[$n1] <=> $keysOrder[$n2]); - }); - } - - return $this->routes; - } - - /** - * Gets a route by name. - */ - public function get(string $name): ?Route - { - $visited = []; - while (null !== $alias = $this->aliases[$name] ?? null) { - if (false !== $searchKey = array_search($name, $visited)) { - $visited[] = $name; - - throw new RouteCircularReferenceException($name, \array_slice($visited, $searchKey)); - } - - if ($alias->isDeprecated()) { - $deprecation = $alias->getDeprecation($name); - - trigger_deprecation($deprecation['package'], $deprecation['version'], $deprecation['message']); - } - - $visited[] = $name; - $name = $alias->getId(); - } - - return $this->routes[$name] ?? null; - } - - /** - * Removes a route or an array of routes by name from the collection. - * - * @param string|string[] $name The route name or an array of route names - */ - public function remove(string|array $name) - { - foreach ((array) $name as $n) { - unset($this->routes[$n], $this->priorities[$n], $this->aliases[$n]); - } - } - - /** - * Adds a route collection at the end of the current set by appending all - * routes of the added collection. - */ - public function addCollection(self $collection) - { - // we need to remove all routes with the same names first because just replacing them - // would not place the new route at the end of the merged array - foreach ($collection->all() as $name => $route) { - unset($this->routes[$name], $this->priorities[$name], $this->aliases[$name]); - $this->routes[$name] = $route; - - if (isset($collection->priorities[$name])) { - $this->priorities[$name] = $collection->priorities[$name]; - } - } - - foreach ($collection->getAliases() as $name => $alias) { - unset($this->routes[$name], $this->priorities[$name], $this->aliases[$name]); - - $this->aliases[$name] = $alias; - } - - foreach ($collection->getResources() as $resource) { - $this->addResource($resource); - } - } - - /** - * Adds a prefix to the path of all child routes. - */ - public function addPrefix(string $prefix, array $defaults = [], array $requirements = []) - { - $prefix = trim(trim($prefix), '/'); - - if ('' === $prefix) { - return; - } - - foreach ($this->routes as $route) { - $route->setPath('/'.$prefix.$route->getPath()); - $route->addDefaults($defaults); - $route->addRequirements($requirements); - } - } - - /** - * Adds a prefix to the name of all the routes within in the collection. - */ - public function addNamePrefix(string $prefix) - { - $prefixedRoutes = []; - $prefixedPriorities = []; - $prefixedAliases = []; - - foreach ($this->routes as $name => $route) { - $prefixedRoutes[$prefix.$name] = $route; - if (null !== $canonicalName = $route->getDefault('_canonical_route')) { - $route->setDefault('_canonical_route', $prefix.$canonicalName); - } - if (isset($this->priorities[$name])) { - $prefixedPriorities[$prefix.$name] = $this->priorities[$name]; - } - } - - foreach ($this->aliases as $name => $alias) { - $prefixedAliases[$prefix.$name] = $alias->withId($prefix.$alias->getId()); - } - - $this->routes = $prefixedRoutes; - $this->priorities = $prefixedPriorities; - $this->aliases = $prefixedAliases; - } - - /** - * Sets the host pattern on all routes. - */ - public function setHost(?string $pattern, array $defaults = [], array $requirements = []) - { - foreach ($this->routes as $route) { - $route->setHost($pattern); - $route->addDefaults($defaults); - $route->addRequirements($requirements); - } - } - - /** - * Sets a condition on all routes. - * - * Existing conditions will be overridden. - */ - public function setCondition(?string $condition) - { - foreach ($this->routes as $route) { - $route->setCondition($condition); - } - } - - /** - * Adds defaults to all routes. - * - * An existing default value under the same name in a route will be overridden. - */ - public function addDefaults(array $defaults) - { - if ($defaults) { - foreach ($this->routes as $route) { - $route->addDefaults($defaults); - } - } - } - - /** - * Adds requirements to all routes. - * - * An existing requirement under the same name in a route will be overridden. - */ - public function addRequirements(array $requirements) - { - if ($requirements) { - foreach ($this->routes as $route) { - $route->addRequirements($requirements); - } - } - } - - /** - * Adds options to all routes. - * - * An existing option value under the same name in a route will be overridden. - */ - public function addOptions(array $options) - { - if ($options) { - foreach ($this->routes as $route) { - $route->addOptions($options); - } - } - } - - /** - * Sets the schemes (e.g. 'https') all child routes are restricted to. - * - * @param string|string[] $schemes The scheme or an array of schemes - */ - public function setSchemes(string|array $schemes) - { - foreach ($this->routes as $route) { - $route->setSchemes($schemes); - } - } - - /** - * Sets the HTTP methods (e.g. 'POST') all child routes are restricted to. - * - * @param string|string[] $methods The method or an array of methods - */ - public function setMethods(string|array $methods) - { - foreach ($this->routes as $route) { - $route->setMethods($methods); - } - } - - /** - * Returns an array of resources loaded to build this collection. - * - * @return ResourceInterface[] - */ - public function getResources(): array - { - return array_values($this->resources); - } - - /** - * Adds a resource for this collection. If the resource already exists - * it is not added. - */ - public function addResource(ResourceInterface $resource) - { - $key = (string) $resource; - - if (!isset($this->resources[$key])) { - $this->resources[$key] = $resource; - } - } - - /** - * Sets an alias for an existing route. - * - * @param string $name The alias to create - * @param string $alias The route to alias - * - * @throws InvalidArgumentException if the alias is for itself - */ - public function addAlias(string $name, string $alias): Alias - { - if ($name === $alias) { - throw new InvalidArgumentException(sprintf('Route alias "%s" can not reference itself.', $name)); - } - - unset($this->routes[$name], $this->priorities[$name]); - - return $this->aliases[$name] = new Alias($alias); - } - - /** - * @return array - */ - public function getAliases(): array - { - return $this->aliases; - } - - public function getAlias(string $name): ?Alias - { - return $this->aliases[$name] ?? null; - } -} diff --git a/vendor/symfony/routing/RouteCompiler.php b/vendor/symfony/routing/RouteCompiler.php deleted file mode 100644 index 330639f4..00000000 --- a/vendor/symfony/routing/RouteCompiler.php +++ /dev/null @@ -1,339 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing; - -/** - * RouteCompiler compiles Route instances to CompiledRoute instances. - * - * @author Fabien Potencier - * @author Tobias Schultze - */ -class RouteCompiler implements RouteCompilerInterface -{ - /** - * This string defines the characters that are automatically considered separators in front of - * optional placeholders (with default and no static text following). Such a single separator - * can be left out together with the optional placeholder from matching and generating URLs. - */ - public const SEPARATORS = '/,;.:-_~+*=@|'; - - /** - * The maximum supported length of a PCRE subpattern name - * http://pcre.org/current/doc/html/pcre2pattern.html#SEC16. - * - * @internal - */ - public const VARIABLE_MAXIMUM_LENGTH = 32; - - /** - * @throws \InvalidArgumentException if a path variable is named _fragment - * @throws \LogicException if a variable is referenced more than once - * @throws \DomainException if a variable name starts with a digit or if it is too long to be successfully used as - * a PCRE subpattern - */ - public static function compile(Route $route): CompiledRoute - { - $hostVariables = []; - $variables = []; - $hostRegex = null; - $hostTokens = []; - - if ('' !== $host = $route->getHost()) { - $result = self::compilePattern($route, $host, true); - - $hostVariables = $result['variables']; - $variables = $hostVariables; - - $hostTokens = $result['tokens']; - $hostRegex = $result['regex']; - } - - $locale = $route->getDefault('_locale'); - if (null !== $locale && null !== $route->getDefault('_canonical_route') && preg_quote($locale) === $route->getRequirement('_locale')) { - $requirements = $route->getRequirements(); - unset($requirements['_locale']); - $route->setRequirements($requirements); - $route->setPath(str_replace('{_locale}', $locale, $route->getPath())); - } - - $path = $route->getPath(); - - $result = self::compilePattern($route, $path, false); - - $staticPrefix = $result['staticPrefix']; - - $pathVariables = $result['variables']; - - foreach ($pathVariables as $pathParam) { - if ('_fragment' === $pathParam) { - throw new \InvalidArgumentException(sprintf('Route pattern "%s" cannot contain "_fragment" as a path parameter.', $route->getPath())); - } - } - - $variables = array_merge($variables, $pathVariables); - - $tokens = $result['tokens']; - $regex = $result['regex']; - - return new CompiledRoute( - $staticPrefix, - $regex, - $tokens, - $pathVariables, - $hostRegex, - $hostTokens, - $hostVariables, - array_unique($variables) - ); - } - - private static function compilePattern(Route $route, string $pattern, bool $isHost): array - { - $tokens = []; - $variables = []; - $matches = []; - $pos = 0; - $defaultSeparator = $isHost ? '.' : '/'; - $useUtf8 = preg_match('//u', $pattern); - $needsUtf8 = $route->getOption('utf8'); - - if (!$needsUtf8 && $useUtf8 && preg_match('/[\x80-\xFF]/', $pattern)) { - throw new \LogicException(sprintf('Cannot use UTF-8 route patterns without setting the "utf8" option for route "%s".', $route->getPath())); - } - if (!$useUtf8 && $needsUtf8) { - throw new \LogicException(sprintf('Cannot mix UTF-8 requirements with non-UTF-8 pattern "%s".', $pattern)); - } - - // Match all variables enclosed in "{}" and iterate over them. But we only want to match the innermost variable - // in case of nested "{}", e.g. {foo{bar}}. This in ensured because \w does not match "{" or "}" itself. - preg_match_all('#\{(!)?([\w\x80-\xFF]+)\}#', $pattern, $matches, \PREG_OFFSET_CAPTURE | \PREG_SET_ORDER); - foreach ($matches as $match) { - $important = $match[1][1] >= 0; - $varName = $match[2][0]; - // get all static text preceding the current variable - $precedingText = substr($pattern, $pos, $match[0][1] - $pos); - $pos = $match[0][1] + \strlen($match[0][0]); - - if (!\strlen($precedingText)) { - $precedingChar = ''; - } elseif ($useUtf8) { - preg_match('/.$/u', $precedingText, $precedingChar); - $precedingChar = $precedingChar[0]; - } else { - $precedingChar = substr($precedingText, -1); - } - $isSeparator = '' !== $precedingChar && str_contains(static::SEPARATORS, $precedingChar); - - // A PCRE subpattern name must start with a non-digit. Also a PHP variable cannot start with a digit so the - // variable would not be usable as a Controller action argument. - if (preg_match('/^\d/', $varName)) { - throw new \DomainException(sprintf('Variable name "%s" cannot start with a digit in route pattern "%s". Please use a different name.', $varName, $pattern)); - } - if (\in_array($varName, $variables)) { - throw new \LogicException(sprintf('Route pattern "%s" cannot reference variable name "%s" more than once.', $pattern, $varName)); - } - - if (\strlen($varName) > self::VARIABLE_MAXIMUM_LENGTH) { - throw new \DomainException(sprintf('Variable name "%s" cannot be longer than %d characters in route pattern "%s". Please use a shorter name.', $varName, self::VARIABLE_MAXIMUM_LENGTH, $pattern)); - } - - if ($isSeparator && $precedingText !== $precedingChar) { - $tokens[] = ['text', substr($precedingText, 0, -\strlen($precedingChar))]; - } elseif (!$isSeparator && '' !== $precedingText) { - $tokens[] = ['text', $precedingText]; - } - - $regexp = $route->getRequirement($varName); - if (null === $regexp) { - $followingPattern = (string) substr($pattern, $pos); - // Find the next static character after the variable that functions as a separator. By default, this separator and '/' - // are disallowed for the variable. This default requirement makes sure that optional variables can be matched at all - // and that the generating-matching-combination of URLs unambiguous, i.e. the params used for generating the URL are - // the same that will be matched. Example: new Route('/{page}.{_format}', ['_format' => 'html']) - // If {page} would also match the separating dot, {_format} would never match as {page} will eagerly consume everything. - // Also even if {_format} was not optional the requirement prevents that {page} matches something that was originally - // part of {_format} when generating the URL, e.g. _format = 'mobile.html'. - $nextSeparator = self::findNextSeparator($followingPattern, $useUtf8); - $regexp = sprintf( - '[^%s%s]+', - preg_quote($defaultSeparator), - $defaultSeparator !== $nextSeparator && '' !== $nextSeparator ? preg_quote($nextSeparator) : '' - ); - if (('' !== $nextSeparator && !preg_match('#^\{[\w\x80-\xFF]+\}#', $followingPattern)) || '' === $followingPattern) { - // When we have a separator, which is disallowed for the variable, we can optimize the regex with a possessive - // quantifier. This prevents useless backtracking of PCRE and improves performance by 20% for matching those patterns. - // Given the above example, there is no point in backtracking into {page} (that forbids the dot) when a dot must follow - // after it. This optimization cannot be applied when the next char is no real separator or when the next variable is - // directly adjacent, e.g. '/{x}{y}'. - $regexp .= '+'; - } - } else { - if (!preg_match('//u', $regexp)) { - $useUtf8 = false; - } elseif (!$needsUtf8 && preg_match('/[\x80-\xFF]|(?= 0; --$i) { - $token = $tokens[$i]; - // variable is optional when it is not important and has a default value - if ('variable' === $token[0] && !($token[5] ?? false) && $route->hasDefault($token[3])) { - $firstOptional = $i; - } else { - break; - } - } - } - - // compute the matching regexp - $regexp = ''; - for ($i = 0, $nbToken = \count($tokens); $i < $nbToken; ++$i) { - $regexp .= self::computeRegexp($tokens, $i, $firstOptional); - } - $regexp = '{^'.$regexp.'$}sD'.($isHost ? 'i' : ''); - - // enable Utf8 matching if really required - if ($needsUtf8) { - $regexp .= 'u'; - for ($i = 0, $nbToken = \count($tokens); $i < $nbToken; ++$i) { - if ('variable' === $tokens[$i][0]) { - $tokens[$i][4] = true; - } - } - } - - return [ - 'staticPrefix' => self::determineStaticPrefix($route, $tokens), - 'regex' => $regexp, - 'tokens' => array_reverse($tokens), - 'variables' => $variables, - ]; - } - - /** - * Determines the longest static prefix possible for a route. - */ - private static function determineStaticPrefix(Route $route, array $tokens): string - { - if ('text' !== $tokens[0][0]) { - return ($route->hasDefault($tokens[0][3]) || '/' === $tokens[0][1]) ? '' : $tokens[0][1]; - } - - $prefix = $tokens[0][1]; - - if (isset($tokens[1][1]) && '/' !== $tokens[1][1] && false === $route->hasDefault($tokens[1][3])) { - $prefix .= $tokens[1][1]; - } - - return $prefix; - } - - /** - * Returns the next static character in the Route pattern that will serve as a separator (or the empty string when none available). - */ - private static function findNextSeparator(string $pattern, bool $useUtf8): string - { - if ('' == $pattern) { - // return empty string if pattern is empty or false (false which can be returned by substr) - return ''; - } - // first remove all placeholders from the pattern so we can find the next real static character - if ('' === $pattern = preg_replace('#\{[\w\x80-\xFF]+\}#', '', $pattern)) { - return ''; - } - if ($useUtf8) { - preg_match('/^./u', $pattern, $pattern); - } - - return str_contains(static::SEPARATORS, $pattern[0]) ? $pattern[0] : ''; - } - - /** - * Computes the regexp used to match a specific token. It can be static text or a subpattern. - * - * @param array $tokens The route tokens - * @param int $index The index of the current token - * @param int $firstOptional The index of the first optional token - */ - private static function computeRegexp(array $tokens, int $index, int $firstOptional): string - { - $token = $tokens[$index]; - if ('text' === $token[0]) { - // Text tokens - return preg_quote($token[1]); - } else { - // Variable tokens - if (0 === $index && 0 === $firstOptional) { - // When the only token is an optional variable token, the separator is required - return sprintf('%s(?P<%s>%s)?', preg_quote($token[1]), $token[3], $token[2]); - } else { - $regexp = sprintf('%s(?P<%s>%s)', preg_quote($token[1]), $token[3], $token[2]); - if ($index >= $firstOptional) { - // Enclose each optional token in a subpattern to make it optional. - // "?:" means it is non-capturing, i.e. the portion of the subject string that - // matched the optional subpattern is not passed back. - $regexp = "(?:$regexp"; - $nbTokens = \count($tokens); - if ($nbTokens - 1 == $index) { - // Close the optional subpatterns - $regexp .= str_repeat(')?', $nbTokens - $firstOptional - (0 === $firstOptional ? 1 : 0)); - } - } - - return $regexp; - } - } - } - - private static function transformCapturingGroupsToNonCapturings(string $regexp): string - { - for ($i = 0; $i < \strlen($regexp); ++$i) { - if ('\\' === $regexp[$i]) { - ++$i; - continue; - } - if ('(' !== $regexp[$i] || !isset($regexp[$i + 2])) { - continue; - } - if ('*' === $regexp[++$i] || '?' === $regexp[$i]) { - ++$i; - continue; - } - $regexp = substr_replace($regexp, '?:', $i, 0); - ++$i; - } - - return $regexp; - } -} diff --git a/vendor/symfony/routing/RouteCompilerInterface.php b/vendor/symfony/routing/RouteCompilerInterface.php deleted file mode 100644 index 62156117..00000000 --- a/vendor/symfony/routing/RouteCompilerInterface.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\Routing; - -/** - * RouteCompilerInterface is the interface that all RouteCompiler classes must implement. - * - * @author Fabien Potencier - */ -interface RouteCompilerInterface -{ - /** - * Compiles the current route instance. - * - * @throws \LogicException If the Route cannot be compiled because the - * path or host pattern is invalid - */ - public static function compile(Route $route): CompiledRoute; -} diff --git a/vendor/symfony/routing/Router.php b/vendor/symfony/routing/Router.php deleted file mode 100644 index f7f24540..00000000 --- a/vendor/symfony/routing/Router.php +++ /dev/null @@ -1,341 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing; - -use Psr\Log\LoggerInterface; -use Symfony\Component\Config\ConfigCacheFactory; -use Symfony\Component\Config\ConfigCacheFactoryInterface; -use Symfony\Component\Config\ConfigCacheInterface; -use Symfony\Component\Config\Loader\LoaderInterface; -use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\Routing\Generator\CompiledUrlGenerator; -use Symfony\Component\Routing\Generator\ConfigurableRequirementsInterface; -use Symfony\Component\Routing\Generator\Dumper\CompiledUrlGeneratorDumper; -use Symfony\Component\Routing\Generator\Dumper\GeneratorDumperInterface; -use Symfony\Component\Routing\Generator\UrlGeneratorInterface; -use Symfony\Component\Routing\Matcher\CompiledUrlMatcher; -use Symfony\Component\Routing\Matcher\Dumper\CompiledUrlMatcherDumper; -use Symfony\Component\Routing\Matcher\Dumper\MatcherDumperInterface; -use Symfony\Component\Routing\Matcher\RequestMatcherInterface; -use Symfony\Component\Routing\Matcher\UrlMatcherInterface; - -/** - * The Router class is an example of the integration of all pieces of the - * routing system for easier use. - * - * @author Fabien Potencier - */ -class Router implements RouterInterface, RequestMatcherInterface -{ - /** - * @var UrlMatcherInterface|null - */ - protected $matcher; - - /** - * @var UrlGeneratorInterface|null - */ - protected $generator; - - /** - * @var RequestContext - */ - protected $context; - - /** - * @var LoaderInterface - */ - protected $loader; - - /** - * @var RouteCollection|null - */ - protected $collection; - - /** - * @var mixed - */ - protected $resource; - - /** - * @var array - */ - protected $options = []; - - /** - * @var LoggerInterface|null - */ - protected $logger; - - /** - * @var string|null - */ - protected $defaultLocale; - - private ConfigCacheFactoryInterface $configCacheFactory; - - /** - * @var ExpressionFunctionProviderInterface[] - */ - private array $expressionLanguageProviders = []; - - private static ?array $cache = []; - - public function __construct(LoaderInterface $loader, mixed $resource, array $options = [], RequestContext $context = null, LoggerInterface $logger = null, string $defaultLocale = null) - { - $this->loader = $loader; - $this->resource = $resource; - $this->logger = $logger; - $this->context = $context ?? new RequestContext(); - $this->setOptions($options); - $this->defaultLocale = $defaultLocale; - } - - /** - * Sets options. - * - * Available options: - * - * * cache_dir: The cache directory (or null to disable caching) - * * debug: Whether to enable debugging or not (false by default) - * * generator_class: The name of a UrlGeneratorInterface implementation - * * generator_dumper_class: The name of a GeneratorDumperInterface implementation - * * matcher_class: The name of a UrlMatcherInterface implementation - * * matcher_dumper_class: The name of a MatcherDumperInterface implementation - * * resource_type: Type hint for the main resource (optional) - * * strict_requirements: Configure strict requirement checking for generators - * implementing ConfigurableRequirementsInterface (default is true) - * - * @throws \InvalidArgumentException When unsupported option is provided - */ - public function setOptions(array $options) - { - $this->options = [ - 'cache_dir' => null, - 'debug' => false, - 'generator_class' => CompiledUrlGenerator::class, - 'generator_dumper_class' => CompiledUrlGeneratorDumper::class, - 'matcher_class' => CompiledUrlMatcher::class, - 'matcher_dumper_class' => CompiledUrlMatcherDumper::class, - 'resource_type' => null, - 'strict_requirements' => true, - ]; - - // check option names and live merge, if errors are encountered Exception will be thrown - $invalid = []; - foreach ($options as $key => $value) { - if (\array_key_exists($key, $this->options)) { - $this->options[$key] = $value; - } else { - $invalid[] = $key; - } - } - - if ($invalid) { - throw new \InvalidArgumentException(sprintf('The Router does not support the following options: "%s".', implode('", "', $invalid))); - } - } - - /** - * Sets an option. - * - * @throws \InvalidArgumentException - */ - public function setOption(string $key, mixed $value) - { - if (!\array_key_exists($key, $this->options)) { - throw new \InvalidArgumentException(sprintf('The Router does not support the "%s" option.', $key)); - } - - $this->options[$key] = $value; - } - - /** - * Gets an option value. - * - * @throws \InvalidArgumentException - */ - public function getOption(string $key): mixed - { - if (!\array_key_exists($key, $this->options)) { - throw new \InvalidArgumentException(sprintf('The Router does not support the "%s" option.', $key)); - } - - return $this->options[$key]; - } - - public function getRouteCollection() - { - return $this->collection ??= $this->loader->load($this->resource, $this->options['resource_type']); - } - - public function setContext(RequestContext $context) - { - $this->context = $context; - - if (null !== $this->matcher) { - $this->getMatcher()->setContext($context); - } - if (null !== $this->generator) { - $this->getGenerator()->setContext($context); - } - } - - public function getContext(): RequestContext - { - return $this->context; - } - - /** - * Sets the ConfigCache factory to use. - */ - public function setConfigCacheFactory(ConfigCacheFactoryInterface $configCacheFactory) - { - $this->configCacheFactory = $configCacheFactory; - } - - public function generate(string $name, array $parameters = [], int $referenceType = self::ABSOLUTE_PATH): string - { - return $this->getGenerator()->generate($name, $parameters, $referenceType); - } - - public function match(string $pathinfo): array - { - return $this->getMatcher()->match($pathinfo); - } - - public function matchRequest(Request $request): array - { - $matcher = $this->getMatcher(); - if (!$matcher instanceof RequestMatcherInterface) { - // fallback to the default UrlMatcherInterface - return $matcher->match($request->getPathInfo()); - } - - return $matcher->matchRequest($request); - } - - /** - * Gets the UrlMatcher or RequestMatcher instance associated with this Router. - */ - public function getMatcher(): UrlMatcherInterface|RequestMatcherInterface - { - if (null !== $this->matcher) { - return $this->matcher; - } - - if (null === $this->options['cache_dir']) { - $routes = $this->getRouteCollection(); - $compiled = is_a($this->options['matcher_class'], CompiledUrlMatcher::class, true); - if ($compiled) { - $routes = (new CompiledUrlMatcherDumper($routes))->getCompiledRoutes(); - } - $this->matcher = new $this->options['matcher_class']($routes, $this->context); - if (method_exists($this->matcher, 'addExpressionLanguageProvider')) { - foreach ($this->expressionLanguageProviders as $provider) { - $this->matcher->addExpressionLanguageProvider($provider); - } - } - - return $this->matcher; - } - - $cache = $this->getConfigCacheFactory()->cache($this->options['cache_dir'].'/url_matching_routes.php', - function (ConfigCacheInterface $cache) { - $dumper = $this->getMatcherDumperInstance(); - if (method_exists($dumper, 'addExpressionLanguageProvider')) { - foreach ($this->expressionLanguageProviders as $provider) { - $dumper->addExpressionLanguageProvider($provider); - } - } - - $cache->write($dumper->dump(), $this->getRouteCollection()->getResources()); - } - ); - - return $this->matcher = new $this->options['matcher_class'](self::getCompiledRoutes($cache->getPath()), $this->context); - } - - /** - * Gets the UrlGenerator instance associated with this Router. - */ - public function getGenerator(): UrlGeneratorInterface - { - if (null !== $this->generator) { - return $this->generator; - } - - if (null === $this->options['cache_dir']) { - $routes = $this->getRouteCollection(); - $compiled = is_a($this->options['generator_class'], CompiledUrlGenerator::class, true); - if ($compiled) { - $generatorDumper = new CompiledUrlGeneratorDumper($routes); - $routes = array_merge($generatorDumper->getCompiledRoutes(), $generatorDumper->getCompiledAliases()); - } - $this->generator = new $this->options['generator_class']($routes, $this->context, $this->logger, $this->defaultLocale); - } else { - $cache = $this->getConfigCacheFactory()->cache($this->options['cache_dir'].'/url_generating_routes.php', - function (ConfigCacheInterface $cache) { - $dumper = $this->getGeneratorDumperInstance(); - - $cache->write($dumper->dump(), $this->getRouteCollection()->getResources()); - } - ); - - $this->generator = new $this->options['generator_class'](self::getCompiledRoutes($cache->getPath()), $this->context, $this->logger, $this->defaultLocale); - } - - if ($this->generator instanceof ConfigurableRequirementsInterface) { - $this->generator->setStrictRequirements($this->options['strict_requirements']); - } - - return $this->generator; - } - - public function addExpressionLanguageProvider(ExpressionFunctionProviderInterface $provider) - { - $this->expressionLanguageProviders[] = $provider; - } - - protected function getGeneratorDumperInstance(): GeneratorDumperInterface - { - return new $this->options['generator_dumper_class']($this->getRouteCollection()); - } - - protected function getMatcherDumperInstance(): MatcherDumperInterface - { - return new $this->options['matcher_dumper_class']($this->getRouteCollection()); - } - - /** - * Provides the ConfigCache factory implementation, falling back to a - * default implementation if necessary. - */ - private function getConfigCacheFactory(): ConfigCacheFactoryInterface - { - return $this->configCacheFactory ??= new ConfigCacheFactory($this->options['debug']); - } - - private static function getCompiledRoutes(string $path): array - { - if ([] === self::$cache && \function_exists('opcache_invalidate') && filter_var(\ini_get('opcache.enable'), \FILTER_VALIDATE_BOOL) && (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) || filter_var(\ini_get('opcache.enable_cli'), \FILTER_VALIDATE_BOOL))) { - self::$cache = null; - } - - if (null === self::$cache) { - return require $path; - } - - return self::$cache[$path] ??= require $path; - } -} diff --git a/vendor/symfony/routing/RouterInterface.php b/vendor/symfony/routing/RouterInterface.php deleted file mode 100644 index 6912f8a1..00000000 --- a/vendor/symfony/routing/RouterInterface.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing; - -use Symfony\Component\Routing\Generator\UrlGeneratorInterface; -use Symfony\Component\Routing\Matcher\UrlMatcherInterface; - -/** - * RouterInterface is the interface that all Router classes must implement. - * - * This interface is the concatenation of UrlMatcherInterface and UrlGeneratorInterface. - * - * @author Fabien Potencier - */ -interface RouterInterface extends UrlMatcherInterface, UrlGeneratorInterface -{ - /** - * Gets the RouteCollection instance associated with this Router. - * - * WARNING: This method should never be used at runtime as it is SLOW. - * You might use it in a cache warmer though. - * - * @return RouteCollection - */ - public function getRouteCollection(); -} diff --git a/vendor/symfony/routing/composer.json b/vendor/symfony/routing/composer.json deleted file mode 100644 index be4bce3e..00000000 --- a/vendor/symfony/routing/composer.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "symfony/routing", - "type": "library", - "description": "Maps an HTTP request to a set of configuration variables", - "keywords": ["routing", "router", "URL", "URI"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.1" - }, - "require-dev": { - "symfony/config": "^6.2", - "symfony/http-foundation": "^5.4|^6.0", - "symfony/yaml": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "doctrine/annotations": "^1.12", - "psr/log": "^1|^2|^3" - }, - "conflict": { - "doctrine/annotations": "<1.12", - "symfony/config": "<6.2", - "symfony/dependency-injection": "<5.4", - "symfony/yaml": "<5.4" - }, - "suggest": { - "symfony/http-foundation": "For using a Symfony Request object", - "symfony/config": "For using the all-in-one router or any loader", - "symfony/yaml": "For using the YAML loader", - "symfony/expression-language": "For using expression matching" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\Routing\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "minimum-stability": "dev" -} diff --git a/vendor/symfony/service-contracts/Attribute/Required.php b/vendor/symfony/service-contracts/Attribute/Required.php deleted file mode 100644 index 9df85118..00000000 --- a/vendor/symfony/service-contracts/Attribute/Required.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\Contracts\Service\Attribute; - -/** - * A required dependency. - * - * This attribute indicates that a property holds a required dependency. The annotated property or method should be - * considered during the instantiation process of the containing class. - * - * @author Alexander M. Turek - */ -#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY)] -final class Required -{ -} diff --git a/vendor/symfony/service-contracts/Attribute/SubscribedService.php b/vendor/symfony/service-contracts/Attribute/SubscribedService.php deleted file mode 100644 index d98e1dfd..00000000 --- a/vendor/symfony/service-contracts/Attribute/SubscribedService.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service\Attribute; - -use Symfony\Contracts\Service\ServiceSubscriberInterface; -use Symfony\Contracts\Service\ServiceSubscriberTrait; - -/** - * For use as the return value for {@see ServiceSubscriberInterface}. - * - * @example new SubscribedService('http_client', HttpClientInterface::class, false, new Target('githubApi')) - * - * Use with {@see ServiceSubscriberTrait} to mark a method's return type - * as a subscribed service. - * - * @author Kevin Bond - */ -#[\Attribute(\Attribute::TARGET_METHOD)] -final class SubscribedService -{ - /** @var object[] */ - public array $attributes; - - /** - * @param string|null $key The key to use for the service - * @param class-string|null $type The service class - * @param bool $nullable Whether the service is optional - * @param object|object[] $attributes One or more dependency injection attributes to use - */ - public function __construct( - public ?string $key = null, - public ?string $type = null, - public bool $nullable = false, - array|object $attributes = [], - ) { - $this->attributes = \is_array($attributes) ? $attributes : [$attributes]; - } -} diff --git a/vendor/symfony/service-contracts/CHANGELOG.md b/vendor/symfony/service-contracts/CHANGELOG.md deleted file mode 100644 index 7932e261..00000000 --- a/vendor/symfony/service-contracts/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -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/symfony/service-contracts/LICENSE b/vendor/symfony/service-contracts/LICENSE deleted file mode 100644 index 74cdc2db..00000000 --- a/vendor/symfony/service-contracts/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2018-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/service-contracts/README.md b/vendor/symfony/service-contracts/README.md deleted file mode 100644 index 41e054a1..00000000 --- a/vendor/symfony/service-contracts/README.md +++ /dev/null @@ -1,9 +0,0 @@ -Symfony Service Contracts -========================= - -A set of abstractions extracted out of the Symfony components. - -Can be used to build on semantics that the Symfony components proved useful - and -that already have battle tested implementations. - -See https://github.com/symfony/contracts/blob/main/README.md for more information. diff --git a/vendor/symfony/service-contracts/ResetInterface.php b/vendor/symfony/service-contracts/ResetInterface.php deleted file mode 100644 index 1af1075e..00000000 --- a/vendor/symfony/service-contracts/ResetInterface.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\Contracts\Service; - -/** - * Provides a way to reset an object to its initial state. - * - * When calling the "reset()" method on an object, it should be put back to its - * initial state. This usually means clearing any internal buffers and forwarding - * the call to internal dependencies. All properties of the object should be put - * back to the same state it had when it was first ready to use. - * - * This method could be called, for example, to recycle objects that are used as - * services, so that they can be used to handle several requests in the same - * process loop (note that we advise making your services stateless instead of - * implementing this interface when possible.) - */ -interface ResetInterface -{ - public function reset(); -} diff --git a/vendor/symfony/service-contracts/ServiceLocatorTrait.php b/vendor/symfony/service-contracts/ServiceLocatorTrait.php deleted file mode 100644 index 45c8d910..00000000 --- a/vendor/symfony/service-contracts/ServiceLocatorTrait.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\Contracts\Service; - -use Psr\Container\ContainerExceptionInterface; -use Psr\Container\NotFoundExceptionInterface; - -// Help opcache.preload discover always-needed symbols -class_exists(ContainerExceptionInterface::class); -class_exists(NotFoundExceptionInterface::class); - -/** - * A trait to help implement ServiceProviderInterface. - * - * @author Robin Chalas - * @author Nicolas Grekas - */ -trait ServiceLocatorTrait -{ - private array $factories; - private array $loading = []; - private array $providedTypes; - - /** - * @param callable[] $factories - */ - public function __construct(array $factories) - { - $this->factories = $factories; - } - - public function has(string $id): bool - { - return isset($this->factories[$id]); - } - - public function get(string $id): mixed - { - if (!isset($this->factories[$id])) { - throw $this->createNotFoundException($id); - } - - if (isset($this->loading[$id])) { - $ids = array_values($this->loading); - $ids = \array_slice($this->loading, array_search($id, $ids)); - $ids[] = $id; - - throw $this->createCircularReferenceException($id, $ids); - } - - $this->loading[$id] = $id; - try { - return $this->factories[$id]($this); - } finally { - unset($this->loading[$id]); - } - } - - public function getProvidedServices(): array - { - if (!isset($this->providedTypes)) { - $this->providedTypes = []; - - foreach ($this->factories as $name => $factory) { - if (!\is_callable($factory)) { - $this->providedTypes[$name] = '?'; - } else { - $type = (new \ReflectionFunction($factory))->getReturnType(); - - $this->providedTypes[$name] = $type ? ($type->allowsNull() ? '?' : '').($type instanceof \ReflectionNamedType ? $type->getName() : $type) : '?'; - } - } - } - - return $this->providedTypes; - } - - private function createNotFoundException(string $id): NotFoundExceptionInterface - { - if (!$alternatives = array_keys($this->factories)) { - $message = 'is empty...'; - } else { - $last = array_pop($alternatives); - if ($alternatives) { - $message = sprintf('only knows about the "%s" and "%s" services.', implode('", "', $alternatives), $last); - } else { - $message = sprintf('only knows about the "%s" service.', $last); - } - } - - if ($this->loading) { - $message = sprintf('The service "%s" has a dependency on a non-existent service "%s". This locator %s', end($this->loading), $id, $message); - } else { - $message = sprintf('Service "%s" not found: the current service locator %s', $id, $message); - } - - return new class($message) extends \InvalidArgumentException implements NotFoundExceptionInterface { - }; - } - - private function createCircularReferenceException(string $id, array $path): ContainerExceptionInterface - { - return new class(sprintf('Circular reference detected for service "%s", path: "%s".', $id, implode(' -> ', $path))) extends \RuntimeException implements ContainerExceptionInterface { - }; - } -} diff --git a/vendor/symfony/service-contracts/ServiceProviderInterface.php b/vendor/symfony/service-contracts/ServiceProviderInterface.php deleted file mode 100644 index a28fd82e..00000000 --- a/vendor/symfony/service-contracts/ServiceProviderInterface.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service; - -use Psr\Container\ContainerInterface; - -/** - * A ServiceProviderInterface exposes the identifiers and the types of services provided by a container. - * - * @author Nicolas Grekas - * @author Mateusz Sip - * - * @template T of mixed - */ -interface ServiceProviderInterface extends ContainerInterface -{ - /** - * @return T - */ - public function get(string $id): mixed; - - public function has(string $id): bool; - - /** - * Returns an associative array of service types keyed by the identifiers provided by the current container. - * - * Examples: - * - * * ['logger' => 'Psr\Log\LoggerInterface'] means the object provides a service named "logger" that implements Psr\Log\LoggerInterface - * * ['foo' => '?'] means the container provides service name "foo" of unspecified type - * * ['bar' => '?Bar\Baz'] means the container provides a service "bar" of type Bar\Baz|null - * - * @return string[] The provided service types, keyed by service names - */ - public function getProvidedServices(): array; -} diff --git a/vendor/symfony/service-contracts/ServiceSubscriberInterface.php b/vendor/symfony/service-contracts/ServiceSubscriberInterface.php deleted file mode 100644 index 3da19169..00000000 --- a/vendor/symfony/service-contracts/ServiceSubscriberInterface.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\Contracts\Service; - -use Symfony\Contracts\Service\Attribute\SubscribedService; - -/** - * A ServiceSubscriber exposes its dependencies via the static {@link getSubscribedServices} method. - * - * The getSubscribedServices method returns an array of service types required by such instances, - * optionally keyed by the service names used internally. Service types that start with an interrogation - * mark "?" are optional, while the other ones are mandatory service dependencies. - * - * The injected service locators SHOULD NOT allow access to any other services not specified by the method. - * - * It is expected that ServiceSubscriber instances consume PSR-11-based service locators internally. - * This interface does not dictate any injection method for these service locators, although constructor - * injection is recommended. - * - * @author Nicolas Grekas - */ -interface ServiceSubscriberInterface -{ - /** - * Returns an array of service types (or {@see SubscribedService} objects) required - * by such instances, optionally keyed by the service names used internally. - * - * For mandatory dependencies: - * - * * ['logger' => 'Psr\Log\LoggerInterface'] means the objects use the "logger" name - * internally to fetch a service which must implement Psr\Log\LoggerInterface. - * * ['loggers' => 'Psr\Log\LoggerInterface[]'] means the objects use the "loggers" name - * internally to fetch an iterable of Psr\Log\LoggerInterface instances. - * * ['Psr\Log\LoggerInterface'] is a shortcut for - * * ['Psr\Log\LoggerInterface' => 'Psr\Log\LoggerInterface'] - * - * otherwise: - * - * * ['logger' => '?Psr\Log\LoggerInterface'] denotes an optional dependency - * * ['loggers' => '?Psr\Log\LoggerInterface[]'] denotes an optional iterable dependency - * * ['?Psr\Log\LoggerInterface'] is a shortcut for - * * ['Psr\Log\LoggerInterface' => '?Psr\Log\LoggerInterface'] - * - * additionally, an array of {@see SubscribedService}'s can be returned: - * - * * [new SubscribedService('logger', Psr\Log\LoggerInterface::class)] - * * [new SubscribedService(type: Psr\Log\LoggerInterface::class, nullable: true)] - * * [new SubscribedService('http_client', HttpClientInterface::class, attributes: new Target('githubApi'))] - * - * @return string[]|SubscribedService[] The required service types, optionally keyed by service names - */ - public static function getSubscribedServices(): array; -} diff --git a/vendor/symfony/service-contracts/ServiceSubscriberTrait.php b/vendor/symfony/service-contracts/ServiceSubscriberTrait.php deleted file mode 100644 index f7cd3a94..00000000 --- a/vendor/symfony/service-contracts/ServiceSubscriberTrait.php +++ /dev/null @@ -1,77 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service; - -use Psr\Container\ContainerInterface; -use Symfony\Contracts\Service\Attribute\Required; -use Symfony\Contracts\Service\Attribute\SubscribedService; - -/** - * Implementation of ServiceSubscriberInterface that determines subscribed services from - * method return types. Service ids are available as "ClassName::methodName". - * - * @author Kevin Bond - */ -trait ServiceSubscriberTrait -{ - /** @var ContainerInterface */ - protected $container; - - public static function getSubscribedServices(): array - { - $services = method_exists(get_parent_class(self::class) ?: '', __FUNCTION__) ? parent::getSubscribedServices() : []; - - foreach ((new \ReflectionClass(self::class))->getMethods() as $method) { - if (self::class !== $method->getDeclaringClass()->name) { - continue; - } - - if (!$attribute = $method->getAttributes(SubscribedService::class)[0] ?? null) { - continue; - } - - if ($method->isStatic() || $method->isAbstract() || $method->isGenerator() || $method->isInternal() || $method->getNumberOfRequiredParameters()) { - throw new \LogicException(sprintf('Cannot use "%s" on method "%s::%s()" (can only be used on non-static, non-abstract methods with no parameters).', SubscribedService::class, self::class, $method->name)); - } - - if (!$returnType = $method->getReturnType()) { - throw new \LogicException(sprintf('Cannot use "%s" on methods without a return type in "%s::%s()".', SubscribedService::class, $method->name, self::class)); - } - - /* @var SubscribedService $attribute */ - $attribute = $attribute->newInstance(); - $attribute->key ??= self::class.'::'.$method->name; - $attribute->type ??= $returnType instanceof \ReflectionNamedType ? $returnType->getName() : (string) $returnType; - $attribute->nullable = $returnType->allowsNull(); - - if ($attribute->attributes) { - $services[] = $attribute; - } else { - $services[$attribute->key] = ($attribute->nullable ? '?' : '').$attribute->type; - } - } - - return $services; - } - - #[Required] - public function setContainer(ContainerInterface $container): ?ContainerInterface - { - $this->container = $container; - - if (method_exists(get_parent_class(self::class) ?: '', __FUNCTION__)) { - return parent::setContainer($container); - } - - return null; - } -} diff --git a/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php b/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php deleted file mode 100644 index 88f6a068..00000000 --- a/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php +++ /dev/null @@ -1,92 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service\Test; - -use PHPUnit\Framework\TestCase; -use Psr\Container\ContainerInterface; -use Symfony\Contracts\Service\ServiceLocatorTrait; - -abstract class ServiceLocatorTest extends TestCase -{ - protected function getServiceLocator(array $factories): ContainerInterface - { - return new class($factories) implements ContainerInterface { - use ServiceLocatorTrait; - }; - } - - public function testHas() - { - $locator = $this->getServiceLocator([ - 'foo' => function () { return 'bar'; }, - 'bar' => function () { return 'baz'; }, - function () { return 'dummy'; }, - ]); - - $this->assertTrue($locator->has('foo')); - $this->assertTrue($locator->has('bar')); - $this->assertFalse($locator->has('dummy')); - } - - public function testGet() - { - $locator = $this->getServiceLocator([ - 'foo' => function () { return 'bar'; }, - 'bar' => function () { return 'baz'; }, - ]); - - $this->assertSame('bar', $locator->get('foo')); - $this->assertSame('baz', $locator->get('bar')); - } - - public function testGetDoesNotMemoize() - { - $i = 0; - $locator = $this->getServiceLocator([ - 'foo' => function () use (&$i) { - ++$i; - - return 'bar'; - }, - ]); - - $this->assertSame('bar', $locator->get('foo')); - $this->assertSame('bar', $locator->get('foo')); - $this->assertSame(2, $i); - } - - public function testThrowsOnUndefinedInternalService() - { - if (!$this->getExpectedException()) { - $this->expectException(\Psr\Container\NotFoundExceptionInterface::class); - $this->expectExceptionMessage('The service "foo" has a dependency on a non-existent service "bar". This locator only knows about the "foo" service.'); - } - $locator = $this->getServiceLocator([ - 'foo' => function () use (&$locator) { return $locator->get('bar'); }, - ]); - - $locator->get('foo'); - } - - public function testThrowsOnCircularReference() - { - $this->expectException(\Psr\Container\ContainerExceptionInterface::class); - $this->expectExceptionMessage('Circular reference detected for service "bar", path: "bar -> baz -> bar".'); - $locator = $this->getServiceLocator([ - 'foo' => function () use (&$locator) { return $locator->get('bar'); }, - 'bar' => function () use (&$locator) { return $locator->get('baz'); }, - 'baz' => function () use (&$locator) { return $locator->get('bar'); }, - ]); - - $locator->get('foo'); - } -} diff --git a/vendor/symfony/service-contracts/composer.json b/vendor/symfony/service-contracts/composer.json deleted file mode 100644 index 36b0d95e..00000000 --- a/vendor/symfony/service-contracts/composer.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "symfony/service-contracts", - "type": "library", - "description": "Generic abstractions related to writing services", - "keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.1", - "psr/container": "^2.0" - }, - "conflict": { - "ext-psr": "<1.1|>=2" - }, - "suggest": { - "symfony/service-implementation": "" - }, - "autoload": { - "psr-4": { "Symfony\\Contracts\\Service\\": "" }, - "exclude-from-classmap": [ - "/Test/" - ] - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "3.3-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - } -} diff --git a/vendor/symfony/stopwatch/CHANGELOG.md b/vendor/symfony/stopwatch/CHANGELOG.md deleted file mode 100644 index f2fd7d0f..00000000 --- a/vendor/symfony/stopwatch/CHANGELOG.md +++ /dev/null @@ -1,24 +0,0 @@ -CHANGELOG -========= - -5.2 ---- - - * Add `name` argument to the `StopWatchEvent` constructor, accessible via a new `StopwatchEvent::getName()` - -5.0.0 ------ - - * Removed support for passing `null` as 1st (`$id`) argument of `Section::get()` method, pass a valid child section identifier instead. - -4.4.0 ------ - - * Deprecated passing `null` as 1st (`$id`) argument of `Section::get()` method, pass a valid child section identifier instead. - -3.4.0 ------ - - * added the `Stopwatch::reset()` method - * allowed to measure sub-millisecond times by introducing an argument to the - constructor of `Stopwatch` diff --git a/vendor/symfony/stopwatch/LICENSE b/vendor/symfony/stopwatch/LICENSE deleted file mode 100644 index 88bf75bb..00000000 --- a/vendor/symfony/stopwatch/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2022 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/stopwatch/README.md b/vendor/symfony/stopwatch/README.md deleted file mode 100644 index 13a9dfa5..00000000 --- a/vendor/symfony/stopwatch/README.md +++ /dev/null @@ -1,42 +0,0 @@ -Stopwatch Component -=================== - -The Stopwatch component provides a way to profile code. - -Getting Started ---------------- - -``` -$ composer require symfony/stopwatch -``` - -```php -use Symfony\Component\Stopwatch\Stopwatch; - -$stopwatch = new Stopwatch(); - -// optionally group events into sections (e.g. phases of the execution) -$stopwatch->openSection(); - -// starts event named 'eventName' -$stopwatch->start('eventName'); - -// ... run your code here - -// optionally, start a new "lap" time -$stopwatch->lap('foo'); - -// ... run your code here - -$event = $stopwatch->stop('eventName'); - -$stopwatch->stopSection('phase_1'); -``` - -Resources ---------- - - * [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/stopwatch/Section.php b/vendor/symfony/stopwatch/Section.php deleted file mode 100644 index 28003673..00000000 --- a/vendor/symfony/stopwatch/Section.php +++ /dev/null @@ -1,157 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Stopwatch; - -/** - * Stopwatch section. - * - * @author Fabien Potencier - */ -class Section -{ - /** - * @var StopwatchEvent[] - */ - private array $events = []; - - private ?float $origin; - private bool $morePrecision; - private ?string $id = null; - - /** - * @var Section[] - */ - private array $children = []; - - /** - * @param float|null $origin Set the origin of the events in this section, use null to set their origin to their start time - * @param bool $morePrecision If true, time is stored as float to keep the original microsecond precision - */ - public function __construct(float $origin = null, bool $morePrecision = false) - { - $this->origin = $origin; - $this->morePrecision = $morePrecision; - } - - /** - * Returns the child section. - */ - public function get(string $id): ?self - { - foreach ($this->children as $child) { - if ($id === $child->getId()) { - return $child; - } - } - - return null; - } - - /** - * Creates or re-opens a child section. - * - * @param string|null $id Null to create a new section, the identifier to re-open an existing one - */ - public function open(?string $id): self - { - if (null === $id || null === $session = $this->get($id)) { - $session = $this->children[] = new self(microtime(true) * 1000, $this->morePrecision); - } - - return $session; - } - - public function getId(): ?string - { - return $this->id; - } - - /** - * Sets the session identifier. - * - * @return $this - */ - public function setId(string $id): static - { - $this->id = $id; - - return $this; - } - - /** - * Starts an event. - */ - public function startEvent(string $name, ?string $category): StopwatchEvent - { - if (!isset($this->events[$name])) { - $this->events[$name] = new StopwatchEvent($this->origin ?: microtime(true) * 1000, $category, $this->morePrecision, $name); - } - - return $this->events[$name]->start(); - } - - /** - * Checks if the event was started. - */ - public function isEventStarted(string $name): bool - { - return isset($this->events[$name]) && $this->events[$name]->isStarted(); - } - - /** - * Stops an event. - * - * @throws \LogicException When the event has not been started - */ - public function stopEvent(string $name): StopwatchEvent - { - if (!isset($this->events[$name])) { - throw new \LogicException(sprintf('Event "%s" is not started.', $name)); - } - - return $this->events[$name]->stop(); - } - - /** - * Stops then restarts an event. - * - * @throws \LogicException When the event has not been started - */ - public function lap(string $name): StopwatchEvent - { - return $this->stopEvent($name)->start(); - } - - /** - * Returns a specific event by name. - * - * @throws \LogicException When the event is not known - */ - public function getEvent(string $name): StopwatchEvent - { - if (!isset($this->events[$name])) { - throw new \LogicException(sprintf('Event "%s" is not known.', $name)); - } - - return $this->events[$name]; - } - - /** - * Returns the events from this section. - * - * @return StopwatchEvent[] - */ - public function getEvents(): array - { - return $this->events; - } -} diff --git a/vendor/symfony/stopwatch/Stopwatch.php b/vendor/symfony/stopwatch/Stopwatch.php deleted file mode 100644 index 3d6c976b..00000000 --- a/vendor/symfony/stopwatch/Stopwatch.php +++ /dev/null @@ -1,153 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Stopwatch; - -use Symfony\Contracts\Service\ResetInterface; - -// Help opcache.preload discover always-needed symbols -class_exists(Section::class); - -/** - * Stopwatch provides a way to profile code. - * - * @author Fabien Potencier - */ -class Stopwatch implements ResetInterface -{ - private bool $morePrecision; - - /** - * @var Section[] - */ - private array $sections; - - /** - * @var Section[] - */ - private array $activeSections; - - /** - * @param bool $morePrecision If true, time is stored as float to keep the original microsecond precision - */ - public function __construct(bool $morePrecision = false) - { - $this->morePrecision = $morePrecision; - $this->reset(); - } - - /** - * @return Section[] - */ - public function getSections(): array - { - return $this->sections; - } - - /** - * Creates a new section or re-opens an existing section. - * - * @param string|null $id The id of the session to re-open, null to create a new one - * - * @throws \LogicException When the section to re-open is not reachable - */ - public function openSection(string $id = null) - { - $current = end($this->activeSections); - - if (null !== $id && null === $current->get($id)) { - throw new \LogicException(sprintf('The section "%s" has been started at an other level and cannot be opened.', $id)); - } - - $this->start('__section__.child', 'section'); - $this->activeSections[] = $current->open($id); - $this->start('__section__'); - } - - /** - * Stops the last started section. - * - * The id parameter is used to retrieve the events from this section. - * - * @see getSectionEvents() - * - * @throws \LogicException When there's no started section to be stopped - */ - public function stopSection(string $id) - { - $this->stop('__section__'); - - if (1 == \count($this->activeSections)) { - throw new \LogicException('There is no started section to stop.'); - } - - $this->sections[$id] = array_pop($this->activeSections)->setId($id); - $this->stop('__section__.child'); - } - - /** - * Starts an event. - */ - public function start(string $name, string $category = null): StopwatchEvent - { - return end($this->activeSections)->startEvent($name, $category); - } - - /** - * Checks if the event was started. - */ - public function isStarted(string $name): bool - { - return end($this->activeSections)->isEventStarted($name); - } - - /** - * Stops an event. - */ - public function stop(string $name): StopwatchEvent - { - return end($this->activeSections)->stopEvent($name); - } - - /** - * Stops then restarts an event. - */ - public function lap(string $name): StopwatchEvent - { - return end($this->activeSections)->stopEvent($name)->start(); - } - - /** - * Returns a specific event by name. - */ - public function getEvent(string $name): StopwatchEvent - { - return end($this->activeSections)->getEvent($name); - } - - /** - * Gets all events for a given section. - * - * @return StopwatchEvent[] - */ - public function getSectionEvents(string $id): array - { - return isset($this->sections[$id]) ? $this->sections[$id]->getEvents() : []; - } - - /** - * Resets the stopwatch to its original state. - */ - public function reset() - { - $this->sections = $this->activeSections = ['__root__' => new Section(null, $this->morePrecision)]; - } -} diff --git a/vendor/symfony/stopwatch/StopwatchEvent.php b/vendor/symfony/stopwatch/StopwatchEvent.php deleted file mode 100644 index 518937d0..00000000 --- a/vendor/symfony/stopwatch/StopwatchEvent.php +++ /dev/null @@ -1,228 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Stopwatch; - -/** - * Represents an Event managed by Stopwatch. - * - * @author Fabien Potencier - */ -class StopwatchEvent -{ - /** - * @var StopwatchPeriod[] - */ - private array $periods = []; - - private float $origin; - private string $category; - private bool $morePrecision; - - /** - * @var float[] - */ - private array $started = []; - - private string $name; - - /** - * @param float $origin The origin time in milliseconds - * @param string|null $category The event category or null to use the default - * @param bool $morePrecision If true, time is stored as float to keep the original microsecond precision - * @param string|null $name The event name or null to define the name as default - * - * @throws \InvalidArgumentException When the raw time is not valid - */ - public function __construct(float $origin, string $category = null, bool $morePrecision = false, string $name = null) - { - $this->origin = $this->formatTime($origin); - $this->category = \is_string($category) ? $category : 'default'; - $this->morePrecision = $morePrecision; - $this->name = $name ?? 'default'; - } - - /** - * Gets the category. - */ - public function getCategory(): string - { - return $this->category; - } - - /** - * Gets the origin in milliseconds. - */ - public function getOrigin(): float - { - return $this->origin; - } - - /** - * Starts a new event period. - * - * @return $this - */ - public function start(): static - { - $this->started[] = $this->getNow(); - - return $this; - } - - /** - * Stops the last started event period. - * - * @return $this - * - * @throws \LogicException When stop() is called without a matching call to start() - */ - public function stop(): static - { - if (!\count($this->started)) { - throw new \LogicException('stop() called but start() has not been called before.'); - } - - $this->periods[] = new StopwatchPeriod(array_pop($this->started), $this->getNow(), $this->morePrecision); - - return $this; - } - - /** - * Checks if the event was started. - */ - public function isStarted(): bool - { - return !empty($this->started); - } - - /** - * Stops the current period and then starts a new one. - * - * @return $this - */ - public function lap(): static - { - return $this->stop()->start(); - } - - /** - * Stops all non already stopped periods. - */ - public function ensureStopped() - { - while (\count($this->started)) { - $this->stop(); - } - } - - /** - * Gets all event periods. - * - * @return StopwatchPeriod[] - */ - public function getPeriods(): array - { - return $this->periods; - } - - /** - * Gets the relative time of the start of the first period in milliseconds. - */ - public function getStartTime(): int|float - { - if (isset($this->periods[0])) { - return $this->periods[0]->getStartTime(); - } - - if ($this->started) { - return $this->started[0]; - } - - return 0; - } - - /** - * Gets the relative time of the end of the last period in milliseconds. - */ - public function getEndTime(): int|float - { - $count = \count($this->periods); - - return $count ? $this->periods[$count - 1]->getEndTime() : 0; - } - - /** - * Gets the duration of the events in milliseconds (including all periods). - */ - public function getDuration(): int|float - { - $periods = $this->periods; - $left = \count($this->started); - - for ($i = $left - 1; $i >= 0; --$i) { - $periods[] = new StopwatchPeriod($this->started[$i], $this->getNow(), $this->morePrecision); - } - - $total = 0; - foreach ($periods as $period) { - $total += $period->getDuration(); - } - - return $total; - } - - /** - * Gets the max memory usage of all periods in bytes. - */ - public function getMemory(): int - { - $memory = 0; - foreach ($this->periods as $period) { - if ($period->getMemory() > $memory) { - $memory = $period->getMemory(); - } - } - - return $memory; - } - - /** - * Return the current time relative to origin in milliseconds. - */ - protected function getNow(): float - { - return $this->formatTime(microtime(true) * 1000 - $this->origin); - } - - /** - * Formats a time. - * - * @throws \InvalidArgumentException When the raw time is not valid - */ - private function formatTime(float $time): float - { - return round($time, 1); - } - - /** - * Gets the event name. - */ - public function getName(): string - { - return $this->name; - } - - public function __toString(): string - { - return sprintf('%s/%s: %.2F MiB - %d ms', $this->getCategory(), $this->getName(), $this->getMemory() / 1024 / 1024, $this->getDuration()); - } -} diff --git a/vendor/symfony/stopwatch/StopwatchPeriod.php b/vendor/symfony/stopwatch/StopwatchPeriod.php deleted file mode 100644 index 41e8dccb..00000000 --- a/vendor/symfony/stopwatch/StopwatchPeriod.php +++ /dev/null @@ -1,73 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Stopwatch; - -/** - * Represents an Period for an Event. - * - * @author Fabien Potencier - */ -class StopwatchPeriod -{ - private int|float $start; - private int|float $end; - private int $memory; - - /** - * @param int|float $start The relative time of the start of the period (in milliseconds) - * @param int|float $end The relative time of the end of the period (in milliseconds) - * @param bool $morePrecision If true, time is stored as float to keep the original microsecond precision - */ - public function __construct(int|float $start, int|float $end, bool $morePrecision = false) - { - $this->start = $morePrecision ? (float) $start : (int) $start; - $this->end = $morePrecision ? (float) $end : (int) $end; - $this->memory = memory_get_usage(true); - } - - /** - * Gets the relative time of the start of the period in milliseconds. - */ - public function getStartTime(): int|float - { - return $this->start; - } - - /** - * Gets the relative time of the end of the period in milliseconds. - */ - public function getEndTime(): int|float - { - return $this->end; - } - - /** - * Gets the time spent in this period in milliseconds. - */ - public function getDuration(): int|float - { - return $this->end - $this->start; - } - - /** - * Gets the memory usage in bytes. - */ - public function getMemory(): int - { - return $this->memory; - } - - public function __toString(): string - { - return sprintf('%.2F MiB - %d ms', $this->getMemory() / 1024 / 1024, $this->getDuration()); - } -} diff --git a/vendor/symfony/stopwatch/composer.json b/vendor/symfony/stopwatch/composer.json deleted file mode 100644 index da4c3d2e..00000000 --- a/vendor/symfony/stopwatch/composer.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "symfony/stopwatch", - "type": "library", - "description": "Provides a way to profile code", - "keywords": [], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.1", - "symfony/service-contracts": "^1|^2|^3" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\Stopwatch\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "minimum-stability": "dev" -} diff --git a/vendor/symfony/string/AbstractString.php b/vendor/symfony/string/AbstractString.php deleted file mode 100644 index bf491f88..00000000 --- a/vendor/symfony/string/AbstractString.php +++ /dev/null @@ -1,708 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String; - -use Symfony\Component\String\Exception\ExceptionInterface; -use Symfony\Component\String\Exception\InvalidArgumentException; -use Symfony\Component\String\Exception\RuntimeException; - -/** - * Represents a string of abstract characters. - * - * Unicode defines 3 types of "characters" (bytes, code points and grapheme clusters). - * This class is the abstract type to use as a type-hint when the logic you want to - * implement doesn't care about the exact variant it deals with. - * - * @author Nicolas Grekas - * @author Hugo Hamon - * - * @throws ExceptionInterface - */ -abstract class AbstractString implements \Stringable, \JsonSerializable -{ - public const PREG_PATTERN_ORDER = \PREG_PATTERN_ORDER; - public const PREG_SET_ORDER = \PREG_SET_ORDER; - public const PREG_OFFSET_CAPTURE = \PREG_OFFSET_CAPTURE; - public const PREG_UNMATCHED_AS_NULL = \PREG_UNMATCHED_AS_NULL; - - public const PREG_SPLIT = 0; - public const PREG_SPLIT_NO_EMPTY = \PREG_SPLIT_NO_EMPTY; - public const PREG_SPLIT_DELIM_CAPTURE = \PREG_SPLIT_DELIM_CAPTURE; - public const PREG_SPLIT_OFFSET_CAPTURE = \PREG_SPLIT_OFFSET_CAPTURE; - - protected $string = ''; - protected $ignoreCase = false; - - abstract public function __construct(string $string = ''); - - /** - * Unwraps instances of AbstractString back to strings. - * - * @return string[]|array - */ - public static function unwrap(array $values): array - { - foreach ($values as $k => $v) { - if ($v instanceof self) { - $values[$k] = $v->__toString(); - } elseif (\is_array($v) && $values[$k] !== $v = static::unwrap($v)) { - $values[$k] = $v; - } - } - - return $values; - } - - /** - * Wraps (and normalizes) strings in instances of AbstractString. - * - * @return static[]|array - */ - public static function wrap(array $values): array - { - $i = 0; - $keys = null; - - foreach ($values as $k => $v) { - if (\is_string($k) && '' !== $k && $k !== $j = (string) new static($k)) { - $keys ??= array_keys($values); - $keys[$i] = $j; - } - - if (\is_string($v)) { - $values[$k] = new static($v); - } elseif (\is_array($v) && $values[$k] !== $v = static::wrap($v)) { - $values[$k] = $v; - } - - ++$i; - } - - return null !== $keys ? array_combine($keys, $values) : $values; - } - - /** - * @param string|string[] $needle - */ - public function after(string|iterable $needle, bool $includeNeedle = false, int $offset = 0): static - { - $str = clone $this; - $i = \PHP_INT_MAX; - - if (\is_string($needle)) { - $needle = [$needle]; - } - - foreach ($needle as $n) { - $n = (string) $n; - $j = $this->indexOf($n, $offset); - - if (null !== $j && $j < $i) { - $i = $j; - $str->string = $n; - } - } - - if (\PHP_INT_MAX === $i) { - return $str; - } - - if (!$includeNeedle) { - $i += $str->length(); - } - - return $this->slice($i); - } - - /** - * @param string|string[] $needle - */ - public function afterLast(string|iterable $needle, bool $includeNeedle = false, int $offset = 0): static - { - $str = clone $this; - $i = null; - - if (\is_string($needle)) { - $needle = [$needle]; - } - - foreach ($needle as $n) { - $n = (string) $n; - $j = $this->indexOfLast($n, $offset); - - if (null !== $j && $j >= $i) { - $i = $offset = $j; - $str->string = $n; - } - } - - if (null === $i) { - return $str; - } - - if (!$includeNeedle) { - $i += $str->length(); - } - - return $this->slice($i); - } - - abstract public function append(string ...$suffix): static; - - /** - * @param string|string[] $needle - */ - public function before(string|iterable $needle, bool $includeNeedle = false, int $offset = 0): static - { - $str = clone $this; - $i = \PHP_INT_MAX; - - if (\is_string($needle)) { - $needle = [$needle]; - } - - foreach ($needle as $n) { - $n = (string) $n; - $j = $this->indexOf($n, $offset); - - if (null !== $j && $j < $i) { - $i = $j; - $str->string = $n; - } - } - - if (\PHP_INT_MAX === $i) { - return $str; - } - - if ($includeNeedle) { - $i += $str->length(); - } - - return $this->slice(0, $i); - } - - /** - * @param string|string[] $needle - */ - public function beforeLast(string|iterable $needle, bool $includeNeedle = false, int $offset = 0): static - { - $str = clone $this; - $i = null; - - if (\is_string($needle)) { - $needle = [$needle]; - } - - foreach ($needle as $n) { - $n = (string) $n; - $j = $this->indexOfLast($n, $offset); - - if (null !== $j && $j >= $i) { - $i = $offset = $j; - $str->string = $n; - } - } - - if (null === $i) { - return $str; - } - - if ($includeNeedle) { - $i += $str->length(); - } - - return $this->slice(0, $i); - } - - /** - * @return int[] - */ - public function bytesAt(int $offset): array - { - $str = $this->slice($offset, 1); - - return '' === $str->string ? [] : array_values(unpack('C*', $str->string)); - } - - abstract public function camel(): static; - - /** - * @return static[] - */ - abstract public function chunk(int $length = 1): array; - - public function collapseWhitespace(): static - { - $str = clone $this; - $str->string = trim(preg_replace("/(?:[ \n\r\t\x0C]{2,}+|[\n\r\t\x0C])/", ' ', $str->string), " \n\r\t\x0C"); - - return $str; - } - - /** - * @param string|string[] $needle - */ - public function containsAny(string|iterable $needle): bool - { - return null !== $this->indexOf($needle); - } - - /** - * @param string|string[] $suffix - */ - public function endsWith(string|iterable $suffix): bool - { - if (\is_string($suffix)) { - throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); - } - - foreach ($suffix as $s) { - if ($this->endsWith((string) $s)) { - return true; - } - } - - return false; - } - - public function ensureEnd(string $suffix): static - { - if (!$this->endsWith($suffix)) { - return $this->append($suffix); - } - - $suffix = preg_quote($suffix); - $regex = '{('.$suffix.')(?:'.$suffix.')++$}D'; - - return $this->replaceMatches($regex.($this->ignoreCase ? 'i' : ''), '$1'); - } - - public function ensureStart(string $prefix): static - { - $prefix = new static($prefix); - - if (!$this->startsWith($prefix)) { - return $this->prepend($prefix); - } - - $str = clone $this; - $i = $prefixLen = $prefix->length(); - - while ($this->indexOf($prefix, $i) === $i) { - $str = $str->slice($prefixLen); - $i += $prefixLen; - } - - return $str; - } - - /** - * @param string|string[] $string - */ - public function equalsTo(string|iterable $string): bool - { - if (\is_string($string)) { - throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); - } - - foreach ($string as $s) { - if ($this->equalsTo((string) $s)) { - return true; - } - } - - return false; - } - - abstract public function folded(): static; - - public function ignoreCase(): static - { - $str = clone $this; - $str->ignoreCase = true; - - return $str; - } - - /** - * @param string|string[] $needle - */ - public function indexOf(string|iterable $needle, int $offset = 0): ?int - { - if (\is_string($needle)) { - throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); - } - - $i = \PHP_INT_MAX; - - foreach ($needle as $n) { - $j = $this->indexOf((string) $n, $offset); - - if (null !== $j && $j < $i) { - $i = $j; - } - } - - return \PHP_INT_MAX === $i ? null : $i; - } - - /** - * @param string|string[] $needle - */ - public function indexOfLast(string|iterable $needle, int $offset = 0): ?int - { - if (\is_string($needle)) { - throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); - } - - $i = null; - - foreach ($needle as $n) { - $j = $this->indexOfLast((string) $n, $offset); - - if (null !== $j && $j >= $i) { - $i = $offset = $j; - } - } - - return $i; - } - - public function isEmpty(): bool - { - return '' === $this->string; - } - - abstract public function join(array $strings, string $lastGlue = null): static; - - public function jsonSerialize(): string - { - return $this->string; - } - - abstract public function length(): int; - - abstract public function lower(): static; - - /** - * Matches the string using a regular expression. - * - * Pass PREG_PATTERN_ORDER or PREG_SET_ORDER as $flags to get all occurrences matching the regular expression. - * - * @return array All matches in a multi-dimensional array ordered according to flags - */ - abstract public function match(string $regexp, int $flags = 0, int $offset = 0): array; - - abstract public function padBoth(int $length, string $padStr = ' '): static; - - abstract public function padEnd(int $length, string $padStr = ' '): static; - - abstract public function padStart(int $length, string $padStr = ' '): static; - - abstract public function prepend(string ...$prefix): static; - - public function repeat(int $multiplier): static - { - if (0 > $multiplier) { - throw new InvalidArgumentException(sprintf('Multiplier must be positive, %d given.', $multiplier)); - } - - $str = clone $this; - $str->string = str_repeat($str->string, $multiplier); - - return $str; - } - - abstract public function replace(string $from, string $to): static; - - abstract public function replaceMatches(string $fromRegexp, string|callable $to): static; - - abstract public function reverse(): static; - - abstract public function slice(int $start = 0, int $length = null): static; - - abstract public function snake(): static; - - abstract public function splice(string $replacement, int $start = 0, int $length = null): static; - - /** - * @return static[] - */ - public function split(string $delimiter, int $limit = null, int $flags = null): array - { - if (null === $flags) { - throw new \TypeError('Split behavior when $flags is null must be implemented by child classes.'); - } - - if ($this->ignoreCase) { - $delimiter .= 'i'; - } - - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); - - try { - if (false === $chunks = preg_split($delimiter, $this->string, $limit, $flags)) { - throw new RuntimeException('Splitting failed with error: '.preg_last_error_msg()); - } - } finally { - restore_error_handler(); - } - - $str = clone $this; - - if (self::PREG_SPLIT_OFFSET_CAPTURE & $flags) { - foreach ($chunks as &$chunk) { - $str->string = $chunk[0]; - $chunk[0] = clone $str; - } - } else { - foreach ($chunks as &$chunk) { - $str->string = $chunk; - $chunk = clone $str; - } - } - - return $chunks; - } - - /** - * @param string|string[] $prefix - */ - public function startsWith(string|iterable $prefix): bool - { - if (\is_string($prefix)) { - throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); - } - - foreach ($prefix as $prefix) { - if ($this->startsWith((string) $prefix)) { - return true; - } - } - - return false; - } - - abstract public function title(bool $allWords = false): static; - - public function toByteString(string $toEncoding = null): ByteString - { - $b = new ByteString(); - - $toEncoding = \in_array($toEncoding, ['utf8', 'utf-8', 'UTF8'], true) ? 'UTF-8' : $toEncoding; - - if (null === $toEncoding || $toEncoding === $fromEncoding = $this instanceof AbstractUnicodeString || preg_match('//u', $b->string) ? 'UTF-8' : 'Windows-1252') { - $b->string = $this->string; - - return $b; - } - - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); - - try { - try { - $b->string = mb_convert_encoding($this->string, $toEncoding, 'UTF-8'); - } catch (InvalidArgumentException $e) { - if (!\function_exists('iconv')) { - throw $e; - } - - $b->string = iconv('UTF-8', $toEncoding, $this->string); - } - } finally { - restore_error_handler(); - } - - return $b; - } - - public function toCodePointString(): CodePointString - { - return new CodePointString($this->string); - } - - public function toString(): string - { - return $this->string; - } - - public function toUnicodeString(): UnicodeString - { - return new UnicodeString($this->string); - } - - abstract public function trim(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static; - - abstract public function trimEnd(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static; - - /** - * @param string|string[] $prefix - */ - public function trimPrefix($prefix): static - { - if (\is_array($prefix) || $prefix instanceof \Traversable) { // don't use is_iterable(), it's slow - foreach ($prefix as $s) { - $t = $this->trimPrefix($s); - - if ($t->string !== $this->string) { - return $t; - } - } - - return clone $this; - } - - $str = clone $this; - - if ($prefix instanceof self) { - $prefix = $prefix->string; - } else { - $prefix = (string) $prefix; - } - - if ('' !== $prefix && \strlen($this->string) >= \strlen($prefix) && 0 === substr_compare($this->string, $prefix, 0, \strlen($prefix), $this->ignoreCase)) { - $str->string = substr($this->string, \strlen($prefix)); - } - - return $str; - } - - abstract public function trimStart(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static; - - /** - * @param string|string[] $suffix - */ - public function trimSuffix($suffix): static - { - if (\is_array($suffix) || $suffix instanceof \Traversable) { // don't use is_iterable(), it's slow - foreach ($suffix as $s) { - $t = $this->trimSuffix($s); - - if ($t->string !== $this->string) { - return $t; - } - } - - return clone $this; - } - - $str = clone $this; - - if ($suffix instanceof self) { - $suffix = $suffix->string; - } else { - $suffix = (string) $suffix; - } - - if ('' !== $suffix && \strlen($this->string) >= \strlen($suffix) && 0 === substr_compare($this->string, $suffix, -\strlen($suffix), null, $this->ignoreCase)) { - $str->string = substr($this->string, 0, -\strlen($suffix)); - } - - return $str; - } - - public function truncate(int $length, string $ellipsis = '', bool $cut = true): static - { - $stringLength = $this->length(); - - if ($stringLength <= $length) { - return clone $this; - } - - $ellipsisLength = '' !== $ellipsis ? (new static($ellipsis))->length() : 0; - - if ($length < $ellipsisLength) { - $ellipsisLength = 0; - } - - if (!$cut) { - if (null === $length = $this->indexOf([' ', "\r", "\n", "\t"], ($length ?: 1) - 1)) { - return clone $this; - } - - $length += $ellipsisLength; - } - - $str = $this->slice(0, $length - $ellipsisLength); - - return $ellipsisLength ? $str->trimEnd()->append($ellipsis) : $str; - } - - abstract public function upper(): static; - - /** - * Returns the printable length on a terminal. - */ - abstract public function width(bool $ignoreAnsiDecoration = true): int; - - public function wordwrap(int $width = 75, string $break = "\n", bool $cut = false): static - { - $lines = '' !== $break ? $this->split($break) : [clone $this]; - $chars = []; - $mask = ''; - - if (1 === \count($lines) && '' === $lines[0]->string) { - return $lines[0]; - } - - foreach ($lines as $i => $line) { - if ($i) { - $chars[] = $break; - $mask .= '#'; - } - - foreach ($line->chunk() as $char) { - $chars[] = $char->string; - $mask .= ' ' === $char->string ? ' ' : '?'; - } - } - - $string = ''; - $j = 0; - $b = $i = -1; - $mask = wordwrap($mask, $width, '#', $cut); - - while (false !== $b = strpos($mask, '#', $b + 1)) { - for (++$i; $i < $b; ++$i) { - $string .= $chars[$j]; - unset($chars[$j++]); - } - - if ($break === $chars[$j] || ' ' === $chars[$j]) { - unset($chars[$j++]); - } - - $string .= $break; - } - - $str = clone $this; - $str->string = $string.implode('', $chars); - - return $str; - } - - public function __sleep(): array - { - return ['string']; - } - - public function __clone() - { - $this->ignoreCase = false; - } - - public function __toString(): string - { - return $this->string; - } -} diff --git a/vendor/symfony/string/AbstractUnicodeString.php b/vendor/symfony/string/AbstractUnicodeString.php deleted file mode 100644 index 52912276..00000000 --- a/vendor/symfony/string/AbstractUnicodeString.php +++ /dev/null @@ -1,594 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String; - -use Symfony\Component\String\Exception\ExceptionInterface; -use Symfony\Component\String\Exception\InvalidArgumentException; -use Symfony\Component\String\Exception\RuntimeException; - -/** - * Represents a string of abstract Unicode characters. - * - * Unicode defines 3 types of "characters" (bytes, code points and grapheme clusters). - * This class is the abstract type to use as a type-hint when the logic you want to - * implement is Unicode-aware but doesn't care about code points vs grapheme clusters. - * - * @author Nicolas Grekas - * - * @throws ExceptionInterface - */ -abstract class AbstractUnicodeString extends AbstractString -{ - public const NFC = \Normalizer::NFC; - public const NFD = \Normalizer::NFD; - public const NFKC = \Normalizer::NFKC; - public const NFKD = \Normalizer::NFKD; - - // all ASCII letters sorted by typical frequency of occurrence - private const ASCII = "\x20\x65\x69\x61\x73\x6E\x74\x72\x6F\x6C\x75\x64\x5D\x5B\x63\x6D\x70\x27\x0A\x67\x7C\x68\x76\x2E\x66\x62\x2C\x3A\x3D\x2D\x71\x31\x30\x43\x32\x2A\x79\x78\x29\x28\x4C\x39\x41\x53\x2F\x50\x22\x45\x6A\x4D\x49\x6B\x33\x3E\x35\x54\x3C\x44\x34\x7D\x42\x7B\x38\x46\x77\x52\x36\x37\x55\x47\x4E\x3B\x4A\x7A\x56\x23\x48\x4F\x57\x5F\x26\x21\x4B\x3F\x58\x51\x25\x59\x5C\x09\x5A\x2B\x7E\x5E\x24\x40\x60\x7F\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"; - - // the subset of folded case mappings that is not in lower case mappings - private const FOLD_FROM = ['İ', 'µ', 'ſ', "\xCD\x85", 'ς', 'ϐ', 'ϑ', 'ϕ', 'ϖ', 'ϰ', 'ϱ', 'ϵ', 'ẛ', "\xE1\xBE\xBE", 'ß', 'İ', 'ʼn', 'ǰ', 'ΐ', 'ΰ', 'և', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'ẚ', 'ẞ', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ᾀ', 'ᾁ', 'ᾂ', 'ᾃ', 'ᾄ', 'ᾅ', 'ᾆ', 'ᾇ', 'ᾈ', 'ᾉ', 'ᾊ', 'ᾋ', 'ᾌ', 'ᾍ', 'ᾎ', 'ᾏ', 'ᾐ', 'ᾑ', 'ᾒ', 'ᾓ', 'ᾔ', 'ᾕ', 'ᾖ', 'ᾗ', 'ᾘ', 'ᾙ', 'ᾚ', 'ᾛ', 'ᾜ', 'ᾝ', 'ᾞ', 'ᾟ', 'ᾠ', 'ᾡ', 'ᾢ', 'ᾣ', 'ᾤ', 'ᾥ', 'ᾦ', 'ᾧ', 'ᾨ', 'ᾩ', 'ᾪ', 'ᾫ', 'ᾬ', 'ᾭ', 'ᾮ', 'ᾯ', 'ᾲ', 'ᾳ', 'ᾴ', 'ᾶ', 'ᾷ', 'ᾼ', 'ῂ', 'ῃ', 'ῄ', 'ῆ', 'ῇ', 'ῌ', 'ῒ', 'ΐ', 'ῖ', 'ῗ', 'ῢ', 'ΰ', 'ῤ', 'ῦ', 'ῧ', 'ῲ', 'ῳ', 'ῴ', 'ῶ', 'ῷ', 'ῼ', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'ſt', 'st', 'ﬓ', 'ﬔ', 'ﬕ', 'ﬖ', 'ﬗ']; - private const FOLD_TO = ['i̇', 'μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', 'ṡ', 'ι', 'ss', 'i̇', 'ʼn', 'ǰ', 'ΐ', 'ΰ', 'եւ', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'aʾ', 'ss', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ἀι', 'ἁι', 'ἂι', 'ἃι', 'ἄι', 'ἅι', 'ἆι', 'ἇι', 'ἀι', 'ἁι', 'ἂι', 'ἃι', 'ἄι', 'ἅι', 'ἆι', 'ἇι', 'ἠι', 'ἡι', 'ἢι', 'ἣι', 'ἤι', 'ἥι', 'ἦι', 'ἧι', 'ἠι', 'ἡι', 'ἢι', 'ἣι', 'ἤι', 'ἥι', 'ἦι', 'ἧι', 'ὠι', 'ὡι', 'ὢι', 'ὣι', 'ὤι', 'ὥι', 'ὦι', 'ὧι', 'ὠι', 'ὡι', 'ὢι', 'ὣι', 'ὤι', 'ὥι', 'ὦι', 'ὧι', 'ὰι', 'αι', 'άι', 'ᾶ', 'ᾶι', 'αι', 'ὴι', 'ηι', 'ήι', 'ῆ', 'ῆι', 'ηι', 'ῒ', 'ΐ', 'ῖ', 'ῗ', 'ῢ', 'ΰ', 'ῤ', 'ῦ', 'ῧ', 'ὼι', 'ωι', 'ώι', 'ῶ', 'ῶι', 'ωι', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'st', 'st', 'մն', 'մե', 'մի', 'վն', 'մխ']; - - // the subset of upper case mappings that map one code point to many code points - private const UPPER_FROM = ['ß', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'ſt', 'st', 'և', 'ﬓ', 'ﬔ', 'ﬕ', 'ﬖ', 'ﬗ', 'ʼn', 'ΐ', 'ΰ', 'ǰ', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'ẚ', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ᾶ', 'ῆ', 'ῒ', 'ΐ', 'ῖ', 'ῗ', 'ῢ', 'ΰ', 'ῤ', 'ῦ', 'ῧ', 'ῶ']; - private const UPPER_TO = ['SS', 'FF', 'FI', 'FL', 'FFI', 'FFL', 'ST', 'ST', 'ԵՒ', 'ՄՆ', 'ՄԵ', 'ՄԻ', 'ՎՆ', 'ՄԽ', 'ʼN', 'Ϊ́', 'Ϋ́', 'J̌', 'H̱', 'T̈', 'W̊', 'Y̊', 'Aʾ', 'Υ̓', 'Υ̓̀', 'Υ̓́', 'Υ̓͂', 'Α͂', 'Η͂', 'Ϊ̀', 'Ϊ́', 'Ι͂', 'Ϊ͂', 'Ϋ̀', 'Ϋ́', 'Ρ̓', 'Υ͂', 'Ϋ͂', 'Ω͂']; - - // the subset of https://github.com/unicode-org/cldr/blob/master/common/transforms/Latin-ASCII.xml that is not in NFKD - private const TRANSLIT_FROM = ['Æ', 'Ð', 'Ø', 'Þ', 'ß', 'æ', 'ð', 'ø', 'þ', 'Đ', 'đ', 'Ħ', 'ħ', 'ı', 'ĸ', 'Ŀ', 'ŀ', 'Ł', 'ł', 'ʼn', 'Ŋ', 'ŋ', 'Œ', 'œ', 'Ŧ', 'ŧ', 'ƀ', 'Ɓ', 'Ƃ', 'ƃ', 'Ƈ', 'ƈ', 'Ɖ', 'Ɗ', 'Ƌ', 'ƌ', 'Ɛ', 'Ƒ', 'ƒ', 'Ɠ', 'ƕ', 'Ɩ', 'Ɨ', 'Ƙ', 'ƙ', 'ƚ', 'Ɲ', 'ƞ', 'Ƣ', 'ƣ', 'Ƥ', 'ƥ', 'ƫ', 'Ƭ', 'ƭ', 'Ʈ', 'Ʋ', 'Ƴ', 'ƴ', 'Ƶ', 'ƶ', 'DŽ', 'Dž', 'dž', 'Ǥ', 'ǥ', 'ȡ', 'Ȥ', 'ȥ', 'ȴ', 'ȵ', 'ȶ', 'ȷ', 'ȸ', 'ȹ', 'Ⱥ', 'Ȼ', 'ȼ', 'Ƚ', 'Ⱦ', 'ȿ', 'ɀ', 'Ƀ', 'Ʉ', 'Ɇ', 'ɇ', 'Ɉ', 'ɉ', 'Ɍ', 'ɍ', 'Ɏ', 'ɏ', 'ɓ', 'ɕ', 'ɖ', 'ɗ', 'ɛ', 'ɟ', 'ɠ', 'ɡ', 'ɢ', 'ɦ', 'ɧ', 'ɨ', 'ɪ', 'ɫ', 'ɬ', 'ɭ', 'ɱ', 'ɲ', 'ɳ', 'ɴ', 'ɶ', 'ɼ', 'ɽ', 'ɾ', 'ʀ', 'ʂ', 'ʈ', 'ʉ', 'ʋ', 'ʏ', 'ʐ', 'ʑ', 'ʙ', 'ʛ', 'ʜ', 'ʝ', 'ʟ', 'ʠ', 'ʣ', 'ʥ', 'ʦ', 'ʪ', 'ʫ', 'ᴀ', 'ᴁ', 'ᴃ', 'ᴄ', 'ᴅ', 'ᴆ', 'ᴇ', 'ᴊ', 'ᴋ', 'ᴌ', 'ᴍ', 'ᴏ', 'ᴘ', 'ᴛ', 'ᴜ', 'ᴠ', 'ᴡ', 'ᴢ', 'ᵫ', 'ᵬ', 'ᵭ', 'ᵮ', 'ᵯ', 'ᵰ', 'ᵱ', 'ᵲ', 'ᵳ', 'ᵴ', 'ᵵ', 'ᵶ', 'ᵺ', 'ᵻ', 'ᵽ', 'ᵾ', 'ᶀ', 'ᶁ', 'ᶂ', 'ᶃ', 'ᶄ', 'ᶅ', 'ᶆ', 'ᶇ', 'ᶈ', 'ᶉ', 'ᶊ', 'ᶌ', 'ᶍ', 'ᶎ', 'ᶏ', 'ᶑ', 'ᶒ', 'ᶓ', 'ᶖ', 'ᶙ', 'ẚ', 'ẜ', 'ẝ', 'ẞ', 'Ỻ', 'ỻ', 'Ỽ', 'ỽ', 'Ỿ', 'ỿ', '©', '®', '₠', '₢', '₣', '₤', '₧', '₺', '₹', 'ℌ', '℞', '㎧', '㎮', '㏆', '㏗', '㏞', '㏟', '¼', '½', '¾', '⅓', '⅔', '⅕', '⅖', '⅗', '⅘', '⅙', '⅚', '⅛', '⅜', '⅝', '⅞', '⅟', '〇', '‘', '’', '‚', '‛', '“', '”', '„', '‟', '′', '″', '〝', '〞', '«', '»', '‹', '›', '‐', '‑', '‒', '–', '—', '―', '︱', '︲', '﹘', '‖', '⁄', '⁅', '⁆', '⁎', '、', '。', '〈', '〉', '《', '》', '〔', '〕', '〘', '〙', '〚', '〛', '︑', '︒', '︹', '︺', '︽', '︾', '︿', '﹀', '﹑', '﹝', '﹞', '⦅', '⦆', '。', '、', '×', '÷', '−', '∕', '∖', '∣', '∥', '≪', '≫', '⦅', '⦆']; - private const TRANSLIT_TO = ['AE', 'D', 'O', 'TH', 'ss', 'ae', 'd', 'o', 'th', 'D', 'd', 'H', 'h', 'i', 'q', 'L', 'l', 'L', 'l', '\'n', 'N', 'n', 'OE', 'oe', 'T', 't', 'b', 'B', 'B', 'b', 'C', 'c', 'D', 'D', 'D', 'd', 'E', 'F', 'f', 'G', 'hv', 'I', 'I', 'K', 'k', 'l', 'N', 'n', 'OI', 'oi', 'P', 'p', 't', 'T', 't', 'T', 'V', 'Y', 'y', 'Z', 'z', 'DZ', 'Dz', 'dz', 'G', 'g', 'd', 'Z', 'z', 'l', 'n', 't', 'j', 'db', 'qp', 'A', 'C', 'c', 'L', 'T', 's', 'z', 'B', 'U', 'E', 'e', 'J', 'j', 'R', 'r', 'Y', 'y', 'b', 'c', 'd', 'd', 'e', 'j', 'g', 'g', 'G', 'h', 'h', 'i', 'I', 'l', 'l', 'l', 'm', 'n', 'n', 'N', 'OE', 'r', 'r', 'r', 'R', 's', 't', 'u', 'v', 'Y', 'z', 'z', 'B', 'G', 'H', 'j', 'L', 'q', 'dz', 'dz', 'ts', 'ls', 'lz', 'A', 'AE', 'B', 'C', 'D', 'D', 'E', 'J', 'K', 'L', 'M', 'O', 'P', 'T', 'U', 'V', 'W', 'Z', 'ue', 'b', 'd', 'f', 'm', 'n', 'p', 'r', 'r', 's', 't', 'z', 'th', 'I', 'p', 'U', 'b', 'd', 'f', 'g', 'k', 'l', 'm', 'n', 'p', 'r', 's', 'v', 'x', 'z', 'a', 'd', 'e', 'e', 'i', 'u', 'a', 's', 's', 'SS', 'LL', 'll', 'V', 'v', 'Y', 'y', '(C)', '(R)', 'CE', 'Cr', 'Fr.', 'L.', 'Pts', 'TL', 'Rs', 'x', 'Rx', 'm/s', 'rad/s', 'C/kg', 'pH', 'V/m', 'A/m', ' 1/4', ' 1/2', ' 3/4', ' 1/3', ' 2/3', ' 1/5', ' 2/5', ' 3/5', ' 4/5', ' 1/6', ' 5/6', ' 1/8', ' 3/8', ' 5/8', ' 7/8', ' 1/', '0', '\'', '\'', ',', '\'', '"', '"', ',,', '"', '\'', '"', '"', '"', '<<', '>>', '<', '>', '-', '-', '-', '-', '-', '-', '-', '-', '-', '||', '/', '[', ']', '*', ',', '.', '<', '>', '<<', '>>', '[', ']', '[', ']', '[', ']', ',', '.', '[', ']', '<<', '>>', '<', '>', ',', '[', ']', '((', '))', '.', ',', '*', '/', '-', '/', '\\', '|', '||', '<<', '>>', '((', '))']; - - private static $transliterators = []; - private static $tableZero; - private static $tableWide; - - public static function fromCodePoints(int ...$codes): static - { - $string = ''; - - foreach ($codes as $code) { - if (0x80 > $code %= 0x200000) { - $string .= \chr($code); - } elseif (0x800 > $code) { - $string .= \chr(0xC0 | $code >> 6).\chr(0x80 | $code & 0x3F); - } elseif (0x10000 > $code) { - $string .= \chr(0xE0 | $code >> 12).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); - } else { - $string .= \chr(0xF0 | $code >> 18).\chr(0x80 | $code >> 12 & 0x3F).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); - } - } - - return new static($string); - } - - /** - * Generic UTF-8 to ASCII transliteration. - * - * Install the intl extension for best results. - * - * @param string[]|\Transliterator[]|\Closure[] $rules See "*-Latin" rules from Transliterator::listIDs() - */ - public function ascii(array $rules = []): self - { - $str = clone $this; - $s = $str->string; - $str->string = ''; - - array_unshift($rules, 'nfd'); - $rules[] = 'latin-ascii'; - - if (\function_exists('transliterator_transliterate')) { - $rules[] = 'any-latin/bgn'; - } - - $rules[] = 'nfkd'; - $rules[] = '[:nonspacing mark:] remove'; - - while (\strlen($s) - 1 > $i = strspn($s, self::ASCII)) { - if (0 < --$i) { - $str->string .= substr($s, 0, $i); - $s = substr($s, $i); - } - - if (!$rule = array_shift($rules)) { - $rules = []; // An empty rule interrupts the next ones - } - - if ($rule instanceof \Transliterator) { - $s = $rule->transliterate($s); - } elseif ($rule instanceof \Closure) { - $s = $rule($s); - } elseif ($rule) { - if ('nfd' === $rule = strtolower($rule)) { - normalizer_is_normalized($s, self::NFD) ?: $s = normalizer_normalize($s, self::NFD); - } elseif ('nfkd' === $rule) { - normalizer_is_normalized($s, self::NFKD) ?: $s = normalizer_normalize($s, self::NFKD); - } elseif ('[:nonspacing mark:] remove' === $rule) { - $s = preg_replace('/\p{Mn}++/u', '', $s); - } elseif ('latin-ascii' === $rule) { - $s = str_replace(self::TRANSLIT_FROM, self::TRANSLIT_TO, $s); - } elseif ('de-ascii' === $rule) { - $s = preg_replace("/([AUO])\u{0308}(?=\p{Ll})/u", '$1e', $s); - $s = str_replace(["a\u{0308}", "o\u{0308}", "u\u{0308}", "A\u{0308}", "O\u{0308}", "U\u{0308}"], ['ae', 'oe', 'ue', 'AE', 'OE', 'UE'], $s); - } elseif (\function_exists('transliterator_transliterate')) { - if (null === $transliterator = self::$transliterators[$rule] ??= \Transliterator::create($rule)) { - if ('any-latin/bgn' === $rule) { - $rule = 'any-latin'; - $transliterator = self::$transliterators[$rule] ??= \Transliterator::create($rule); - } - - if (null === $transliterator) { - throw new InvalidArgumentException(sprintf('Unknown transliteration rule "%s".', $rule)); - } - - self::$transliterators['any-latin/bgn'] = $transliterator; - } - - $s = $transliterator->transliterate($s); - } - } elseif (!\function_exists('iconv')) { - $s = preg_replace('/[^\x00-\x7F]/u', '?', $s); - } else { - $s = @preg_replace_callback('/[^\x00-\x7F]/u', static function ($c) { - $c = (string) iconv('UTF-8', 'ASCII//TRANSLIT', $c[0]); - - if ('' === $c && '' === iconv('UTF-8', 'ASCII//TRANSLIT', '²')) { - throw new \LogicException(sprintf('"%s" requires a translit-able iconv implementation, try installing "gnu-libiconv" if you\'re using Alpine Linux.', static::class)); - } - - return 1 < \strlen($c) ? ltrim($c, '\'`"^~') : ('' !== $c ? $c : '?'); - }, $s); - } - } - - $str->string .= $s; - - return $str; - } - - public function camel(): static - { - $str = clone $this; - $str->string = str_replace(' ', '', preg_replace_callback('/\b.(?![A-Z]{2,})/u', static function ($m) use (&$i) { - return 1 === ++$i ? ('İ' === $m[0] ? 'i̇' : mb_strtolower($m[0], 'UTF-8')) : mb_convert_case($m[0], \MB_CASE_TITLE, 'UTF-8'); - }, preg_replace('/[^\pL0-9]++/u', ' ', $this->string))); - - return $str; - } - - /** - * @return int[] - */ - public function codePointsAt(int $offset): array - { - $str = $this->slice($offset, 1); - - if ('' === $str->string) { - return []; - } - - $codePoints = []; - - foreach (preg_split('//u', $str->string, -1, \PREG_SPLIT_NO_EMPTY) as $c) { - $codePoints[] = mb_ord($c, 'UTF-8'); - } - - return $codePoints; - } - - public function folded(bool $compat = true): static - { - $str = clone $this; - - if (!$compat || !\defined('Normalizer::NFKC_CF')) { - $str->string = normalizer_normalize($str->string, $compat ? \Normalizer::NFKC : \Normalizer::NFC); - $str->string = mb_strtolower(str_replace(self::FOLD_FROM, self::FOLD_TO, $this->string), 'UTF-8'); - } else { - $str->string = normalizer_normalize($str->string, \Normalizer::NFKC_CF); - } - - return $str; - } - - public function join(array $strings, string $lastGlue = null): static - { - $str = clone $this; - - $tail = null !== $lastGlue && 1 < \count($strings) ? $lastGlue.array_pop($strings) : ''; - $str->string = implode($this->string, $strings).$tail; - - if (!preg_match('//u', $str->string)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - return $str; - } - - public function lower(): static - { - $str = clone $this; - $str->string = mb_strtolower(str_replace('İ', 'i̇', $str->string), 'UTF-8'); - - return $str; - } - - public function match(string $regexp, int $flags = 0, int $offset = 0): array - { - $match = ((\PREG_PATTERN_ORDER | \PREG_SET_ORDER) & $flags) ? 'preg_match_all' : 'preg_match'; - - if ($this->ignoreCase) { - $regexp .= 'i'; - } - - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); - - try { - if (false === $match($regexp.'u', $this->string, $matches, $flags | \PREG_UNMATCHED_AS_NULL, $offset)) { - throw new RuntimeException('Matching failed with error: '.preg_last_error_msg()); - } - } finally { - restore_error_handler(); - } - - return $matches; - } - - public function normalize(int $form = self::NFC): static - { - if (!\in_array($form, [self::NFC, self::NFD, self::NFKC, self::NFKD])) { - throw new InvalidArgumentException('Unsupported normalization form.'); - } - - $str = clone $this; - normalizer_is_normalized($str->string, $form) ?: $str->string = normalizer_normalize($str->string, $form); - - return $str; - } - - public function padBoth(int $length, string $padStr = ' '): static - { - if ('' === $padStr || !preg_match('//u', $padStr)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - $pad = clone $this; - $pad->string = $padStr; - - return $this->pad($length, $pad, \STR_PAD_BOTH); - } - - public function padEnd(int $length, string $padStr = ' '): static - { - if ('' === $padStr || !preg_match('//u', $padStr)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - $pad = clone $this; - $pad->string = $padStr; - - return $this->pad($length, $pad, \STR_PAD_RIGHT); - } - - public function padStart(int $length, string $padStr = ' '): static - { - if ('' === $padStr || !preg_match('//u', $padStr)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - $pad = clone $this; - $pad->string = $padStr; - - return $this->pad($length, $pad, \STR_PAD_LEFT); - } - - public function replaceMatches(string $fromRegexp, string|callable $to): static - { - if ($this->ignoreCase) { - $fromRegexp .= 'i'; - } - - if (\is_array($to) || $to instanceof \Closure) { - $replace = 'preg_replace_callback'; - $to = static function (array $m) use ($to): string { - $to = $to($m); - - if ('' !== $to && (!\is_string($to) || !preg_match('//u', $to))) { - throw new InvalidArgumentException('Replace callback must return a valid UTF-8 string.'); - } - - return $to; - }; - } elseif ('' !== $to && !preg_match('//u', $to)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } else { - $replace = 'preg_replace'; - } - - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); - - try { - if (null === $string = $replace($fromRegexp.'u', $to, $this->string)) { - $lastError = preg_last_error(); - - foreach (get_defined_constants(true)['pcre'] as $k => $v) { - if ($lastError === $v && str_ends_with($k, '_ERROR')) { - throw new RuntimeException('Matching failed with '.$k.'.'); - } - } - - throw new RuntimeException('Matching failed with unknown error code.'); - } - } finally { - restore_error_handler(); - } - - $str = clone $this; - $str->string = $string; - - return $str; - } - - public function reverse(): static - { - $str = clone $this; - $str->string = implode('', array_reverse(preg_split('/(\X)/u', $str->string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY))); - - return $str; - } - - public function snake(): static - { - $str = $this->camel(); - $str->string = mb_strtolower(preg_replace(['/(\p{Lu}+)(\p{Lu}\p{Ll})/u', '/([\p{Ll}0-9])(\p{Lu})/u'], '\1_\2', $str->string), 'UTF-8'); - - return $str; - } - - public function title(bool $allWords = false): static - { - $str = clone $this; - - $limit = $allWords ? -1 : 1; - - $str->string = preg_replace_callback('/\b./u', static function (array $m): string { - return mb_convert_case($m[0], \MB_CASE_TITLE, 'UTF-8'); - }, $str->string, $limit); - - return $str; - } - - public function trim(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static - { - if (" \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}" !== $chars && !preg_match('//u', $chars)) { - throw new InvalidArgumentException('Invalid UTF-8 chars.'); - } - $chars = preg_quote($chars); - - $str = clone $this; - $str->string = preg_replace("{^[$chars]++|[$chars]++$}uD", '', $str->string); - - return $str; - } - - public function trimEnd(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static - { - if (" \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}" !== $chars && !preg_match('//u', $chars)) { - throw new InvalidArgumentException('Invalid UTF-8 chars.'); - } - $chars = preg_quote($chars); - - $str = clone $this; - $str->string = preg_replace("{[$chars]++$}uD", '', $str->string); - - return $str; - } - - public function trimPrefix($prefix): static - { - if (!$this->ignoreCase) { - return parent::trimPrefix($prefix); - } - - $str = clone $this; - - if ($prefix instanceof \Traversable) { - $prefix = iterator_to_array($prefix, false); - } elseif ($prefix instanceof parent) { - $prefix = $prefix->string; - } - - $prefix = implode('|', array_map('preg_quote', (array) $prefix)); - $str->string = preg_replace("{^(?:$prefix)}iuD", '', $this->string); - - return $str; - } - - public function trimStart(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static - { - if (" \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}" !== $chars && !preg_match('//u', $chars)) { - throw new InvalidArgumentException('Invalid UTF-8 chars.'); - } - $chars = preg_quote($chars); - - $str = clone $this; - $str->string = preg_replace("{^[$chars]++}uD", '', $str->string); - - return $str; - } - - public function trimSuffix($suffix): static - { - if (!$this->ignoreCase) { - return parent::trimSuffix($suffix); - } - - $str = clone $this; - - if ($suffix instanceof \Traversable) { - $suffix = iterator_to_array($suffix, false); - } elseif ($suffix instanceof parent) { - $suffix = $suffix->string; - } - - $suffix = implode('|', array_map('preg_quote', (array) $suffix)); - $str->string = preg_replace("{(?:$suffix)$}iuD", '', $this->string); - - return $str; - } - - public function upper(): static - { - $str = clone $this; - $str->string = mb_strtoupper($str->string, 'UTF-8'); - - return $str; - } - - public function width(bool $ignoreAnsiDecoration = true): int - { - $width = 0; - $s = str_replace(["\x00", "\x05", "\x07"], '', $this->string); - - if (str_contains($s, "\r")) { - $s = str_replace(["\r\n", "\r"], "\n", $s); - } - - if (!$ignoreAnsiDecoration) { - $s = preg_replace('/[\p{Cc}\x7F]++/u', '', $s); - } - - foreach (explode("\n", $s) as $s) { - if ($ignoreAnsiDecoration) { - $s = preg_replace('/(?:\x1B(?: - \[ [\x30-\x3F]*+ [\x20-\x2F]*+ [\x40-\x7E] - | [P\]X^_] .*? \x1B\\\\ - | [\x41-\x7E] - )|[\p{Cc}\x7F]++)/xu', '', $s); - } - - $lineWidth = $this->wcswidth($s); - - if ($lineWidth > $width) { - $width = $lineWidth; - } - } - - return $width; - } - - private function pad(int $len, self $pad, int $type): static - { - $sLen = $this->length(); - - if ($len <= $sLen) { - return clone $this; - } - - $padLen = $pad->length(); - $freeLen = $len - $sLen; - $len = $freeLen % $padLen; - - switch ($type) { - case \STR_PAD_RIGHT: - return $this->append(str_repeat($pad->string, intdiv($freeLen, $padLen)).($len ? $pad->slice(0, $len) : '')); - - case \STR_PAD_LEFT: - return $this->prepend(str_repeat($pad->string, intdiv($freeLen, $padLen)).($len ? $pad->slice(0, $len) : '')); - - case \STR_PAD_BOTH: - $freeLen /= 2; - - $rightLen = ceil($freeLen); - $len = $rightLen % $padLen; - $str = $this->append(str_repeat($pad->string, intdiv($rightLen, $padLen)).($len ? $pad->slice(0, $len) : '')); - - $leftLen = floor($freeLen); - $len = $leftLen % $padLen; - - return $str->prepend(str_repeat($pad->string, intdiv($leftLen, $padLen)).($len ? $pad->slice(0, $len) : '')); - - default: - throw new InvalidArgumentException('Invalid padding type.'); - } - } - - /** - * Based on https://github.com/jquast/wcwidth, a Python implementation of https://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c. - */ - private function wcswidth(string $string): int - { - $width = 0; - - foreach (preg_split('//u', $string, -1, \PREG_SPLIT_NO_EMPTY) as $c) { - $codePoint = mb_ord($c, 'UTF-8'); - - if (0 === $codePoint // NULL - || 0x034F === $codePoint // COMBINING GRAPHEME JOINER - || (0x200B <= $codePoint && 0x200F >= $codePoint) // ZERO WIDTH SPACE to RIGHT-TO-LEFT MARK - || 0x2028 === $codePoint // LINE SEPARATOR - || 0x2029 === $codePoint // PARAGRAPH SEPARATOR - || (0x202A <= $codePoint && 0x202E >= $codePoint) // LEFT-TO-RIGHT EMBEDDING to RIGHT-TO-LEFT OVERRIDE - || (0x2060 <= $codePoint && 0x2063 >= $codePoint) // WORD JOINER to INVISIBLE SEPARATOR - ) { - continue; - } - - // Non printable characters - if (32 > $codePoint // C0 control characters - || (0x07F <= $codePoint && 0x0A0 > $codePoint) // C1 control characters and DEL - ) { - return -1; - } - - self::$tableZero ??= require __DIR__.'/Resources/data/wcswidth_table_zero.php'; - - if ($codePoint >= self::$tableZero[0][0] && $codePoint <= self::$tableZero[$ubound = \count(self::$tableZero) - 1][1]) { - $lbound = 0; - while ($ubound >= $lbound) { - $mid = floor(($lbound + $ubound) / 2); - - if ($codePoint > self::$tableZero[$mid][1]) { - $lbound = $mid + 1; - } elseif ($codePoint < self::$tableZero[$mid][0]) { - $ubound = $mid - 1; - } else { - continue 2; - } - } - } - - self::$tableWide ??= require __DIR__.'/Resources/data/wcswidth_table_wide.php'; - - if ($codePoint >= self::$tableWide[0][0] && $codePoint <= self::$tableWide[$ubound = \count(self::$tableWide) - 1][1]) { - $lbound = 0; - while ($ubound >= $lbound) { - $mid = floor(($lbound + $ubound) / 2); - - if ($codePoint > self::$tableWide[$mid][1]) { - $lbound = $mid + 1; - } elseif ($codePoint < self::$tableWide[$mid][0]) { - $ubound = $mid - 1; - } else { - $width += 2; - - continue 2; - } - } - } - - ++$width; - } - - return $width; - } -} diff --git a/vendor/symfony/string/ByteString.php b/vendor/symfony/string/ByteString.php deleted file mode 100644 index 212290fe..00000000 --- a/vendor/symfony/string/ByteString.php +++ /dev/null @@ -1,485 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String; - -use Symfony\Component\String\Exception\ExceptionInterface; -use Symfony\Component\String\Exception\InvalidArgumentException; -use Symfony\Component\String\Exception\RuntimeException; - -/** - * Represents a binary-safe string of bytes. - * - * @author Nicolas Grekas - * @author Hugo Hamon - * - * @throws ExceptionInterface - */ -class ByteString extends AbstractString -{ - private const ALPHABET_ALPHANUMERIC = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'; - - public function __construct(string $string = '') - { - $this->string = $string; - } - - /* - * The following method was derived from code of the Hack Standard Library (v4.40 - 2020-05-03) - * - * https://github.com/hhvm/hsl/blob/80a42c02f036f72a42f0415e80d6b847f4bf62d5/src/random/private.php#L16 - * - * Code subject to the MIT license (https://github.com/hhvm/hsl/blob/master/LICENSE). - * - * Copyright (c) 2004-2020, Facebook, Inc. (https://www.facebook.com/) - */ - - public static function fromRandom(int $length = 16, string $alphabet = null): self - { - if ($length <= 0) { - throw new InvalidArgumentException(sprintf('A strictly positive length is expected, "%d" given.', $length)); - } - - $alphabet ??= self::ALPHABET_ALPHANUMERIC; - $alphabetSize = \strlen($alphabet); - $bits = (int) ceil(log($alphabetSize, 2.0)); - if ($bits <= 0 || $bits > 56) { - throw new InvalidArgumentException('The length of the alphabet must in the [2^1, 2^56] range.'); - } - - $ret = ''; - while ($length > 0) { - $urandomLength = (int) ceil(2 * $length * $bits / 8.0); - $data = random_bytes($urandomLength); - $unpackedData = 0; - $unpackedBits = 0; - for ($i = 0; $i < $urandomLength && $length > 0; ++$i) { - // Unpack 8 bits - $unpackedData = ($unpackedData << 8) | \ord($data[$i]); - $unpackedBits += 8; - - // While we have enough bits to select a character from the alphabet, keep - // consuming the random data - for (; $unpackedBits >= $bits && $length > 0; $unpackedBits -= $bits) { - $index = ($unpackedData & ((1 << $bits) - 1)); - $unpackedData >>= $bits; - // Unfortunately, the alphabet size is not necessarily a power of two. - // Worst case, it is 2^k + 1, which means we need (k+1) bits and we - // have around a 50% chance of missing as k gets larger - if ($index < $alphabetSize) { - $ret .= $alphabet[$index]; - --$length; - } - } - } - } - - return new static($ret); - } - - public function bytesAt(int $offset): array - { - $str = $this->string[$offset] ?? ''; - - return '' === $str ? [] : [\ord($str)]; - } - - public function append(string ...$suffix): static - { - $str = clone $this; - $str->string .= 1 >= \count($suffix) ? ($suffix[0] ?? '') : implode('', $suffix); - - return $str; - } - - public function camel(): static - { - $str = clone $this; - - $parts = explode(' ', trim(ucwords(preg_replace('/[^a-zA-Z0-9\x7f-\xff]++/', ' ', $this->string)))); - $parts[0] = 1 !== \strlen($parts[0]) && ctype_upper($parts[0]) ? $parts[0] : lcfirst($parts[0]); - $str->string = implode('', $parts); - - return $str; - } - - public function chunk(int $length = 1): array - { - if (1 > $length) { - throw new InvalidArgumentException('The chunk length must be greater than zero.'); - } - - if ('' === $this->string) { - return []; - } - - $str = clone $this; - $chunks = []; - - foreach (str_split($this->string, $length) as $chunk) { - $str->string = $chunk; - $chunks[] = clone $str; - } - - return $chunks; - } - - public function endsWith(string|iterable|AbstractString $suffix): bool - { - if ($suffix instanceof AbstractString) { - $suffix = $suffix->string; - } elseif (!\is_string($suffix)) { - return parent::endsWith($suffix); - } - - return '' !== $suffix && \strlen($this->string) >= \strlen($suffix) && 0 === substr_compare($this->string, $suffix, -\strlen($suffix), null, $this->ignoreCase); - } - - public function equalsTo(string|iterable|AbstractString $string): bool - { - if ($string instanceof AbstractString) { - $string = $string->string; - } elseif (!\is_string($string)) { - return parent::equalsTo($string); - } - - if ('' !== $string && $this->ignoreCase) { - return 0 === strcasecmp($string, $this->string); - } - - return $string === $this->string; - } - - public function folded(): static - { - $str = clone $this; - $str->string = strtolower($str->string); - - return $str; - } - - public function indexOf(string|iterable|AbstractString $needle, int $offset = 0): ?int - { - if ($needle instanceof AbstractString) { - $needle = $needle->string; - } elseif (!\is_string($needle)) { - return parent::indexOf($needle, $offset); - } - - if ('' === $needle) { - return null; - } - - $i = $this->ignoreCase ? stripos($this->string, $needle, $offset) : strpos($this->string, $needle, $offset); - - return false === $i ? null : $i; - } - - public function indexOfLast(string|iterable|AbstractString $needle, int $offset = 0): ?int - { - if ($needle instanceof AbstractString) { - $needle = $needle->string; - } elseif (!\is_string($needle)) { - return parent::indexOfLast($needle, $offset); - } - - if ('' === $needle) { - return null; - } - - $i = $this->ignoreCase ? strripos($this->string, $needle, $offset) : strrpos($this->string, $needle, $offset); - - return false === $i ? null : $i; - } - - public function isUtf8(): bool - { - return '' === $this->string || preg_match('//u', $this->string); - } - - public function join(array $strings, string $lastGlue = null): static - { - $str = clone $this; - - $tail = null !== $lastGlue && 1 < \count($strings) ? $lastGlue.array_pop($strings) : ''; - $str->string = implode($this->string, $strings).$tail; - - return $str; - } - - public function length(): int - { - return \strlen($this->string); - } - - public function lower(): static - { - $str = clone $this; - $str->string = strtolower($str->string); - - return $str; - } - - public function match(string $regexp, int $flags = 0, int $offset = 0): array - { - $match = ((\PREG_PATTERN_ORDER | \PREG_SET_ORDER) & $flags) ? 'preg_match_all' : 'preg_match'; - - if ($this->ignoreCase) { - $regexp .= 'i'; - } - - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); - - try { - if (false === $match($regexp, $this->string, $matches, $flags | \PREG_UNMATCHED_AS_NULL, $offset)) { - throw new RuntimeException('Matching failed with error: '.preg_last_error_msg()); - } - } finally { - restore_error_handler(); - } - - return $matches; - } - - public function padBoth(int $length, string $padStr = ' '): static - { - $str = clone $this; - $str->string = str_pad($this->string, $length, $padStr, \STR_PAD_BOTH); - - return $str; - } - - public function padEnd(int $length, string $padStr = ' '): static - { - $str = clone $this; - $str->string = str_pad($this->string, $length, $padStr, \STR_PAD_RIGHT); - - return $str; - } - - public function padStart(int $length, string $padStr = ' '): static - { - $str = clone $this; - $str->string = str_pad($this->string, $length, $padStr, \STR_PAD_LEFT); - - return $str; - } - - public function prepend(string ...$prefix): static - { - $str = clone $this; - $str->string = (1 >= \count($prefix) ? ($prefix[0] ?? '') : implode('', $prefix)).$str->string; - - return $str; - } - - public function replace(string $from, string $to): static - { - $str = clone $this; - - if ('' !== $from) { - $str->string = $this->ignoreCase ? str_ireplace($from, $to, $this->string) : str_replace($from, $to, $this->string); - } - - return $str; - } - - public function replaceMatches(string $fromRegexp, string|callable $to): static - { - if ($this->ignoreCase) { - $fromRegexp .= 'i'; - } - - $replace = \is_array($to) || $to instanceof \Closure ? 'preg_replace_callback' : 'preg_replace'; - - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); - - try { - if (null === $string = $replace($fromRegexp, $to, $this->string)) { - $lastError = preg_last_error(); - - foreach (get_defined_constants(true)['pcre'] as $k => $v) { - if ($lastError === $v && str_ends_with($k, '_ERROR')) { - throw new RuntimeException('Matching failed with '.$k.'.'); - } - } - - throw new RuntimeException('Matching failed with unknown error code.'); - } - } finally { - restore_error_handler(); - } - - $str = clone $this; - $str->string = $string; - - return $str; - } - - public function reverse(): static - { - $str = clone $this; - $str->string = strrev($str->string); - - return $str; - } - - public function slice(int $start = 0, int $length = null): static - { - $str = clone $this; - $str->string = (string) substr($this->string, $start, $length ?? \PHP_INT_MAX); - - return $str; - } - - public function snake(): static - { - $str = $this->camel(); - $str->string = strtolower(preg_replace(['/([A-Z]+)([A-Z][a-z])/', '/([a-z\d])([A-Z])/'], '\1_\2', $str->string)); - - return $str; - } - - public function splice(string $replacement, int $start = 0, int $length = null): static - { - $str = clone $this; - $str->string = substr_replace($this->string, $replacement, $start, $length ?? \PHP_INT_MAX); - - return $str; - } - - public function split(string $delimiter, int $limit = null, int $flags = null): array - { - if (1 > $limit ??= \PHP_INT_MAX) { - throw new InvalidArgumentException('Split limit must be a positive integer.'); - } - - if ('' === $delimiter) { - throw new InvalidArgumentException('Split delimiter is empty.'); - } - - if (null !== $flags) { - return parent::split($delimiter, $limit, $flags); - } - - $str = clone $this; - $chunks = $this->ignoreCase - ? preg_split('{'.preg_quote($delimiter).'}iD', $this->string, $limit) - : explode($delimiter, $this->string, $limit); - - foreach ($chunks as &$chunk) { - $str->string = $chunk; - $chunk = clone $str; - } - - return $chunks; - } - - public function startsWith(string|iterable|AbstractString $prefix): bool - { - if ($prefix instanceof AbstractString) { - $prefix = $prefix->string; - } elseif (!\is_string($prefix)) { - return parent::startsWith($prefix); - } - - return '' !== $prefix && 0 === ($this->ignoreCase ? strncasecmp($this->string, $prefix, \strlen($prefix)) : strncmp($this->string, $prefix, \strlen($prefix))); - } - - public function title(bool $allWords = false): static - { - $str = clone $this; - $str->string = $allWords ? ucwords($str->string) : ucfirst($str->string); - - return $str; - } - - public function toUnicodeString(string $fromEncoding = null): UnicodeString - { - return new UnicodeString($this->toCodePointString($fromEncoding)->string); - } - - public function toCodePointString(string $fromEncoding = null): CodePointString - { - $u = new CodePointString(); - - if (\in_array($fromEncoding, [null, 'utf8', 'utf-8', 'UTF8', 'UTF-8'], true) && preg_match('//u', $this->string)) { - $u->string = $this->string; - - return $u; - } - - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); - - try { - try { - $validEncoding = false !== mb_detect_encoding($this->string, $fromEncoding ?? 'Windows-1252', true); - } catch (InvalidArgumentException $e) { - if (!\function_exists('iconv')) { - throw $e; - } - - $u->string = iconv($fromEncoding ?? 'Windows-1252', 'UTF-8', $this->string); - - return $u; - } - } finally { - restore_error_handler(); - } - - if (!$validEncoding) { - throw new InvalidArgumentException(sprintf('Invalid "%s" string.', $fromEncoding ?? 'Windows-1252')); - } - - $u->string = mb_convert_encoding($this->string, 'UTF-8', $fromEncoding ?? 'Windows-1252'); - - return $u; - } - - public function trim(string $chars = " \t\n\r\0\x0B\x0C"): static - { - $str = clone $this; - $str->string = trim($str->string, $chars); - - return $str; - } - - public function trimEnd(string $chars = " \t\n\r\0\x0B\x0C"): static - { - $str = clone $this; - $str->string = rtrim($str->string, $chars); - - return $str; - } - - public function trimStart(string $chars = " \t\n\r\0\x0B\x0C"): static - { - $str = clone $this; - $str->string = ltrim($str->string, $chars); - - return $str; - } - - public function upper(): static - { - $str = clone $this; - $str->string = strtoupper($str->string); - - return $str; - } - - public function width(bool $ignoreAnsiDecoration = true): int - { - $string = preg_match('//u', $this->string) ? $this->string : preg_replace('/[\x80-\xFF]/', '?', $this->string); - - return (new CodePointString($string))->width($ignoreAnsiDecoration); - } -} diff --git a/vendor/symfony/string/CHANGELOG.md b/vendor/symfony/string/CHANGELOG.md deleted file mode 100644 index 31a3b54d..00000000 --- a/vendor/symfony/string/CHANGELOG.md +++ /dev/null @@ -1,40 +0,0 @@ -CHANGELOG -========= - -6.2 ---- - - * Add support for emoji in `AsciiSlugger` - -5.4 ---- - - * Add `trimSuffix()` and `trimPrefix()` methods - -5.3 ---- - - * Made `AsciiSlugger` fallback to parent locale's symbolsMap - -5.2.0 ------ - - * added a `FrenchInflector` class - -5.1.0 ------ - - * added the `AbstractString::reverse()` method - * made `AbstractString::width()` follow POSIX.1-2001 - * added `LazyString` which provides memoizing stringable objects - * The component is not marked as `@experimental` anymore - * added the `s()` helper method to get either an `UnicodeString` or `ByteString` instance, - depending of the input string UTF-8 compliancy - * added `$cut` parameter to `Symfony\Component\String\AbstractString::truncate()` - * added `AbstractString::containsAny()` - * allow passing a string of custom characters to `ByteString::fromRandom()` - -5.0.0 ------ - - * added the component as experimental diff --git a/vendor/symfony/string/CodePointString.php b/vendor/symfony/string/CodePointString.php deleted file mode 100644 index f5c900fb..00000000 --- a/vendor/symfony/string/CodePointString.php +++ /dev/null @@ -1,260 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String; - -use Symfony\Component\String\Exception\ExceptionInterface; -use Symfony\Component\String\Exception\InvalidArgumentException; - -/** - * Represents a string of Unicode code points encoded as UTF-8. - * - * @author Nicolas Grekas - * @author Hugo Hamon - * - * @throws ExceptionInterface - */ -class CodePointString extends AbstractUnicodeString -{ - public function __construct(string $string = '') - { - if ('' !== $string && !preg_match('//u', $string)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - $this->string = $string; - } - - public function append(string ...$suffix): static - { - $str = clone $this; - $str->string .= 1 >= \count($suffix) ? ($suffix[0] ?? '') : implode('', $suffix); - - if (!preg_match('//u', $str->string)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - return $str; - } - - public function chunk(int $length = 1): array - { - if (1 > $length) { - throw new InvalidArgumentException('The chunk length must be greater than zero.'); - } - - if ('' === $this->string) { - return []; - } - - $rx = '/('; - while (65535 < $length) { - $rx .= '.{65535}'; - $length -= 65535; - } - $rx .= '.{'.$length.'})/us'; - - $str = clone $this; - $chunks = []; - - foreach (preg_split($rx, $this->string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY) as $chunk) { - $str->string = $chunk; - $chunks[] = clone $str; - } - - return $chunks; - } - - public function codePointsAt(int $offset): array - { - $str = $offset ? $this->slice($offset, 1) : $this; - - return '' === $str->string ? [] : [mb_ord($str->string, 'UTF-8')]; - } - - public function endsWith(string|iterable|AbstractString $suffix): bool - { - if ($suffix instanceof AbstractString) { - $suffix = $suffix->string; - } elseif (!\is_string($suffix)) { - return parent::endsWith($suffix); - } - - if ('' === $suffix || !preg_match('//u', $suffix)) { - return false; - } - - if ($this->ignoreCase) { - return preg_match('{'.preg_quote($suffix).'$}iuD', $this->string); - } - - return \strlen($this->string) >= \strlen($suffix) && 0 === substr_compare($this->string, $suffix, -\strlen($suffix)); - } - - public function equalsTo(string|iterable|AbstractString $string): bool - { - if ($string instanceof AbstractString) { - $string = $string->string; - } elseif (!\is_string($string)) { - return parent::equalsTo($string); - } - - if ('' !== $string && $this->ignoreCase) { - return \strlen($string) === \strlen($this->string) && 0 === mb_stripos($this->string, $string, 0, 'UTF-8'); - } - - return $string === $this->string; - } - - public function indexOf(string|iterable|AbstractString $needle, int $offset = 0): ?int - { - if ($needle instanceof AbstractString) { - $needle = $needle->string; - } elseif (!\is_string($needle)) { - return parent::indexOf($needle, $offset); - } - - if ('' === $needle) { - return null; - } - - $i = $this->ignoreCase ? mb_stripos($this->string, $needle, $offset, 'UTF-8') : mb_strpos($this->string, $needle, $offset, 'UTF-8'); - - return false === $i ? null : $i; - } - - public function indexOfLast(string|iterable|AbstractString $needle, int $offset = 0): ?int - { - if ($needle instanceof AbstractString) { - $needle = $needle->string; - } elseif (!\is_string($needle)) { - return parent::indexOfLast($needle, $offset); - } - - if ('' === $needle) { - return null; - } - - $i = $this->ignoreCase ? mb_strripos($this->string, $needle, $offset, 'UTF-8') : mb_strrpos($this->string, $needle, $offset, 'UTF-8'); - - return false === $i ? null : $i; - } - - public function length(): int - { - return mb_strlen($this->string, 'UTF-8'); - } - - public function prepend(string ...$prefix): static - { - $str = clone $this; - $str->string = (1 >= \count($prefix) ? ($prefix[0] ?? '') : implode('', $prefix)).$this->string; - - if (!preg_match('//u', $str->string)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - return $str; - } - - public function replace(string $from, string $to): static - { - $str = clone $this; - - if ('' === $from || !preg_match('//u', $from)) { - return $str; - } - - if ('' !== $to && !preg_match('//u', $to)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - if ($this->ignoreCase) { - $str->string = implode($to, preg_split('{'.preg_quote($from).'}iuD', $this->string)); - } else { - $str->string = str_replace($from, $to, $this->string); - } - - return $str; - } - - public function slice(int $start = 0, int $length = null): static - { - $str = clone $this; - $str->string = mb_substr($this->string, $start, $length, 'UTF-8'); - - return $str; - } - - public function splice(string $replacement, int $start = 0, int $length = null): static - { - if (!preg_match('//u', $replacement)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - $str = clone $this; - $start = $start ? \strlen(mb_substr($this->string, 0, $start, 'UTF-8')) : 0; - $length = $length ? \strlen(mb_substr($this->string, $start, $length, 'UTF-8')) : $length; - $str->string = substr_replace($this->string, $replacement, $start, $length ?? \PHP_INT_MAX); - - return $str; - } - - public function split(string $delimiter, int $limit = null, int $flags = null): array - { - if (1 > $limit ??= \PHP_INT_MAX) { - throw new InvalidArgumentException('Split limit must be a positive integer.'); - } - - if ('' === $delimiter) { - throw new InvalidArgumentException('Split delimiter is empty.'); - } - - if (null !== $flags) { - return parent::split($delimiter.'u', $limit, $flags); - } - - if (!preg_match('//u', $delimiter)) { - throw new InvalidArgumentException('Split delimiter is not a valid UTF-8 string.'); - } - - $str = clone $this; - $chunks = $this->ignoreCase - ? preg_split('{'.preg_quote($delimiter).'}iuD', $this->string, $limit) - : explode($delimiter, $this->string, $limit); - - foreach ($chunks as &$chunk) { - $str->string = $chunk; - $chunk = clone $str; - } - - return $chunks; - } - - public function startsWith(string|iterable|AbstractString $prefix): bool - { - if ($prefix instanceof AbstractString) { - $prefix = $prefix->string; - } elseif (!\is_string($prefix)) { - return parent::startsWith($prefix); - } - - if ('' === $prefix || !preg_match('//u', $prefix)) { - return false; - } - - if ($this->ignoreCase) { - return 0 === mb_stripos($this->string, $prefix, 0, 'UTF-8'); - } - - return 0 === strncmp($this->string, $prefix, \strlen($prefix)); - } -} diff --git a/vendor/symfony/string/Exception/ExceptionInterface.php b/vendor/symfony/string/Exception/ExceptionInterface.php deleted file mode 100644 index 36197865..00000000 --- a/vendor/symfony/string/Exception/ExceptionInterface.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. - */ - -namespace Symfony\Component\String\Exception; - -interface ExceptionInterface extends \Throwable -{ -} diff --git a/vendor/symfony/string/Exception/InvalidArgumentException.php b/vendor/symfony/string/Exception/InvalidArgumentException.php deleted file mode 100644 index 6aa586bc..00000000 --- a/vendor/symfony/string/Exception/InvalidArgumentException.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. - */ - -namespace Symfony\Component\String\Exception; - -class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/string/Exception/RuntimeException.php b/vendor/symfony/string/Exception/RuntimeException.php deleted file mode 100644 index 77cb091f..00000000 --- a/vendor/symfony/string/Exception/RuntimeException.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. - */ - -namespace Symfony\Component\String\Exception; - -class RuntimeException extends \RuntimeException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/string/Inflector/EnglishInflector.php b/vendor/symfony/string/Inflector/EnglishInflector.php deleted file mode 100644 index 4474736a..00000000 --- a/vendor/symfony/string/Inflector/EnglishInflector.php +++ /dev/null @@ -1,505 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String\Inflector; - -final class EnglishInflector implements InflectorInterface -{ - /** - * Map English plural to singular suffixes. - * - * @see http://english-zone.com/spelling/plurals.html - */ - private const PLURAL_MAP = [ - // First entry: plural suffix, reversed - // Second entry: length of plural suffix - // Third entry: Whether the suffix may succeed a vocal - // Fourth entry: Whether the suffix may succeed a consonant - // Fifth entry: singular suffix, normal - - // bacteria (bacterium), criteria (criterion), phenomena (phenomenon) - ['a', 1, true, true, ['on', 'um']], - - // nebulae (nebula) - ['ea', 2, true, true, 'a'], - - // services (service) - ['secivres', 8, true, true, 'service'], - - // mice (mouse), lice (louse) - ['eci', 3, false, true, 'ouse'], - - // geese (goose) - ['esee', 4, false, true, 'oose'], - - // fungi (fungus), alumni (alumnus), syllabi (syllabus), radii (radius) - ['i', 1, true, true, 'us'], - - // men (man), women (woman) - ['nem', 3, true, true, 'man'], - - // children (child) - ['nerdlihc', 8, true, true, 'child'], - - // oxen (ox) - ['nexo', 4, false, false, 'ox'], - - // indices (index), appendices (appendix), prices (price) - ['seci', 4, false, true, ['ex', 'ix', 'ice']], - - // selfies (selfie) - ['seifles', 7, true, true, 'selfie'], - - // zombies (zombie) - ['seibmoz', 7, true, true, 'zombie'], - - // movies (movie) - ['seivom', 6, true, true, 'movie'], - - // conspectuses (conspectus), prospectuses (prospectus) - ['sesutcep', 8, true, true, 'pectus'], - - // feet (foot) - ['teef', 4, true, true, 'foot'], - - // geese (goose) - ['eseeg', 5, true, true, 'goose'], - - // teeth (tooth) - ['hteet', 5, true, true, 'tooth'], - - // news (news) - ['swen', 4, true, true, 'news'], - - // series (series) - ['seires', 6, true, true, 'series'], - - // babies (baby) - ['sei', 3, false, true, 'y'], - - // accesses (access), addresses (address), kisses (kiss) - ['sess', 4, true, false, 'ss'], - - // analyses (analysis), ellipses (ellipsis), fungi (fungus), - // neuroses (neurosis), theses (thesis), emphases (emphasis), - // oases (oasis), crises (crisis), houses (house), bases (base), - // atlases (atlas) - ['ses', 3, true, true, ['s', 'se', 'sis']], - - // objectives (objective), alternative (alternatives) - ['sevit', 5, true, true, 'tive'], - - // drives (drive) - ['sevird', 6, false, true, 'drive'], - - // lives (life), wives (wife) - ['sevi', 4, false, true, 'ife'], - - // moves (move) - ['sevom', 5, true, true, 'move'], - - // hooves (hoof), dwarves (dwarf), elves (elf), leaves (leaf), caves (cave), staves (staff) - ['sev', 3, true, true, ['f', 've', 'ff']], - - // axes (axis), axes (ax), axes (axe) - ['sexa', 4, false, false, ['ax', 'axe', 'axis']], - - // indexes (index), matrixes (matrix) - ['sex', 3, true, false, 'x'], - - // quizzes (quiz) - ['sezz', 4, true, false, 'z'], - - // bureaus (bureau) - ['suae', 4, false, true, 'eau'], - - // fees (fee), trees (tree), employees (employee) - ['see', 3, true, true, 'ee'], - - // edges (edge) - ['segd', 4, true, true, 'dge'], - - // roses (rose), garages (garage), cassettes (cassette), - // waltzes (waltz), heroes (hero), bushes (bush), arches (arch), - // shoes (shoe) - ['se', 2, true, true, ['', 'e']], - - // tags (tag) - ['s', 1, true, true, ''], - - // chateaux (chateau) - ['xuae', 4, false, true, 'eau'], - - // people (person) - ['elpoep', 6, true, true, 'person'], - ]; - - /** - * Map English singular to plural suffixes. - * - * @see http://english-zone.com/spelling/plurals.html - */ - private const SINGULAR_MAP = [ - // First entry: singular suffix, reversed - // Second entry: length of singular suffix - // Third entry: Whether the suffix may succeed a vocal - // Fourth entry: Whether the suffix may succeed a consonant - // Fifth entry: plural suffix, normal - - // criterion (criteria) - ['airetirc', 8, false, false, 'criterion'], - - // nebulae (nebula) - ['aluben', 6, false, false, 'nebulae'], - - // children (child) - ['dlihc', 5, true, true, 'children'], - - // prices (price) - ['eci', 3, false, true, 'ices'], - - // services (service) - ['ecivres', 7, true, true, 'services'], - - // lives (life), wives (wife) - ['efi', 3, false, true, 'ives'], - - // selfies (selfie) - ['eifles', 6, true, true, 'selfies'], - - // movies (movie) - ['eivom', 5, true, true, 'movies'], - - // lice (louse) - ['esuol', 5, false, true, 'lice'], - - // mice (mouse) - ['esuom', 5, false, true, 'mice'], - - // geese (goose) - ['esoo', 4, false, true, 'eese'], - - // houses (house), bases (base) - ['es', 2, true, true, 'ses'], - - // geese (goose) - ['esoog', 5, true, true, 'geese'], - - // caves (cave) - ['ev', 2, true, true, 'ves'], - - // drives (drive) - ['evird', 5, false, true, 'drives'], - - // objectives (objective), alternative (alternatives) - ['evit', 4, true, true, 'tives'], - - // moves (move) - ['evom', 4, true, true, 'moves'], - - // staves (staff) - ['ffats', 5, true, true, 'staves'], - - // hooves (hoof), dwarves (dwarf), elves (elf), leaves (leaf) - ['ff', 2, true, true, 'ffs'], - - // hooves (hoof), dwarves (dwarf), elves (elf), leaves (leaf) - ['f', 1, true, true, ['fs', 'ves']], - - // arches (arch) - ['hc', 2, true, true, 'ches'], - - // bushes (bush) - ['hs', 2, true, true, 'shes'], - - // teeth (tooth) - ['htoot', 5, true, true, 'teeth'], - - // bacteria (bacterium), criteria (criterion), phenomena (phenomenon) - ['mu', 2, true, true, 'a'], - - // men (man), women (woman) - ['nam', 3, true, true, 'men'], - - // people (person) - ['nosrep', 6, true, true, ['persons', 'people']], - - // bacteria (bacterium), criteria (criterion), phenomena (phenomenon) - ['noi', 3, true, true, 'ions'], - - // coupon (coupons) - ['nop', 3, true, true, 'pons'], - - // seasons (season), treasons (treason), poisons (poison), lessons (lesson) - ['nos', 3, true, true, 'sons'], - - // bacteria (bacterium), criteria (criterion), phenomena (phenomenon) - ['no', 2, true, true, 'a'], - - // echoes (echo) - ['ohce', 4, true, true, 'echoes'], - - // heroes (hero) - ['oreh', 4, true, true, 'heroes'], - - // atlases (atlas) - ['salta', 5, true, true, 'atlases'], - - // irises (iris) - ['siri', 4, true, true, 'irises'], - - // analyses (analysis), ellipses (ellipsis), neuroses (neurosis) - // theses (thesis), emphases (emphasis), oases (oasis), - // crises (crisis) - ['sis', 3, true, true, 'ses'], - - // accesses (access), addresses (address), kisses (kiss) - ['ss', 2, true, false, 'sses'], - - // syllabi (syllabus) - ['suballys', 8, true, true, 'syllabi'], - - // buses (bus) - ['sub', 3, true, true, 'buses'], - - // circuses (circus) - ['suc', 3, true, true, 'cuses'], - - // conspectuses (conspectus), prospectuses (prospectus) - ['sutcep', 6, true, true, 'pectuses'], - - // fungi (fungus), alumni (alumnus), syllabi (syllabus), radii (radius) - ['su', 2, true, true, 'i'], - - // news (news) - ['swen', 4, true, true, 'news'], - - // feet (foot) - ['toof', 4, true, true, 'feet'], - - // chateaux (chateau), bureaus (bureau) - ['uae', 3, false, true, ['eaus', 'eaux']], - - // oxen (ox) - ['xo', 2, false, false, 'oxen'], - - // hoaxes (hoax) - ['xaoh', 4, true, false, 'hoaxes'], - - // indices (index) - ['xedni', 5, false, true, ['indicies', 'indexes']], - - // boxes (box) - ['xo', 2, false, true, 'oxes'], - - // indexes (index), matrixes (matrix) - ['x', 1, true, false, ['cies', 'xes']], - - // appendices (appendix) - ['xi', 2, false, true, 'ices'], - - // babies (baby) - ['y', 1, false, true, 'ies'], - - // quizzes (quiz) - ['ziuq', 4, true, false, 'quizzes'], - - // waltzes (waltz) - ['z', 1, true, true, 'zes'], - ]; - - /** - * A list of words which should not be inflected, reversed. - */ - private const UNINFLECTED = [ - '', - - // data - 'atad', - - // deer - 'reed', - - // feedback - 'kcabdeef', - - // fish - 'hsif', - - // info - 'ofni', - - // moose - 'esoom', - - // series - 'seires', - - // sheep - 'peehs', - - // species - 'seiceps', - ]; - - public function singularize(string $plural): array - { - $pluralRev = strrev($plural); - $lowerPluralRev = strtolower($pluralRev); - $pluralLength = \strlen($lowerPluralRev); - - // Check if the word is one which is not inflected, return early if so - if (\in_array($lowerPluralRev, self::UNINFLECTED, true)) { - return [$plural]; - } - - // The outer loop iterates over the entries of the plural table - // The inner loop $j iterates over the characters of the plural suffix - // in the plural table to compare them with the characters of the actual - // given plural suffix - foreach (self::PLURAL_MAP as $map) { - $suffix = $map[0]; - $suffixLength = $map[1]; - $j = 0; - - // Compare characters in the plural table and of the suffix of the - // given plural one by one - while ($suffix[$j] === $lowerPluralRev[$j]) { - // Let $j point to the next character - ++$j; - - // Successfully compared the last character - // Add an entry with the singular suffix to the singular array - if ($j === $suffixLength) { - // Is there any character preceding the suffix in the plural string? - if ($j < $pluralLength) { - $nextIsVocal = str_contains('aeiou', $lowerPluralRev[$j]); - - if (!$map[2] && $nextIsVocal) { - // suffix may not succeed a vocal but next char is one - break; - } - - if (!$map[3] && !$nextIsVocal) { - // suffix may not succeed a consonant but next char is one - break; - } - } - - $newBase = substr($plural, 0, $pluralLength - $suffixLength); - $newSuffix = $map[4]; - - // Check whether the first character in the plural suffix - // is uppercased. If yes, uppercase the first character in - // the singular suffix too - $firstUpper = ctype_upper($pluralRev[$j - 1]); - - if (\is_array($newSuffix)) { - $singulars = []; - - foreach ($newSuffix as $newSuffixEntry) { - $singulars[] = $newBase.($firstUpper ? ucfirst($newSuffixEntry) : $newSuffixEntry); - } - - return $singulars; - } - - return [$newBase.($firstUpper ? ucfirst($newSuffix) : $newSuffix)]; - } - - // Suffix is longer than word - if ($j === $pluralLength) { - break; - } - } - } - - // Assume that plural and singular is identical - return [$plural]; - } - - public function pluralize(string $singular): array - { - $singularRev = strrev($singular); - $lowerSingularRev = strtolower($singularRev); - $singularLength = \strlen($lowerSingularRev); - - // Check if the word is one which is not inflected, return early if so - if (\in_array($lowerSingularRev, self::UNINFLECTED, true)) { - return [$singular]; - } - - // The outer loop iterates over the entries of the singular table - // The inner loop $j iterates over the characters of the singular suffix - // in the singular table to compare them with the characters of the actual - // given singular suffix - foreach (self::SINGULAR_MAP as $map) { - $suffix = $map[0]; - $suffixLength = $map[1]; - $j = 0; - - // Compare characters in the singular table and of the suffix of the - // given plural one by one - - while ($suffix[$j] === $lowerSingularRev[$j]) { - // Let $j point to the next character - ++$j; - - // Successfully compared the last character - // Add an entry with the plural suffix to the plural array - if ($j === $suffixLength) { - // Is there any character preceding the suffix in the plural string? - if ($j < $singularLength) { - $nextIsVocal = str_contains('aeiou', $lowerSingularRev[$j]); - - if (!$map[2] && $nextIsVocal) { - // suffix may not succeed a vocal but next char is one - break; - } - - if (!$map[3] && !$nextIsVocal) { - // suffix may not succeed a consonant but next char is one - break; - } - } - - $newBase = substr($singular, 0, $singularLength - $suffixLength); - $newSuffix = $map[4]; - - // Check whether the first character in the singular suffix - // is uppercased. If yes, uppercase the first character in - // the singular suffix too - $firstUpper = ctype_upper($singularRev[$j - 1]); - - if (\is_array($newSuffix)) { - $plurals = []; - - foreach ($newSuffix as $newSuffixEntry) { - $plurals[] = $newBase.($firstUpper ? ucfirst($newSuffixEntry) : $newSuffixEntry); - } - - return $plurals; - } - - return [$newBase.($firstUpper ? ucfirst($newSuffix) : $newSuffix)]; - } - - // Suffix is longer than word - if ($j === $singularLength) { - break; - } - } - } - - // Assume that plural is singular with a trailing `s` - return [$singular.'s']; - } -} diff --git a/vendor/symfony/string/Inflector/FrenchInflector.php b/vendor/symfony/string/Inflector/FrenchInflector.php deleted file mode 100644 index 955abbf4..00000000 --- a/vendor/symfony/string/Inflector/FrenchInflector.php +++ /dev/null @@ -1,151 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String\Inflector; - -/** - * French inflector. - * - * This class does only inflect nouns; not adjectives nor composed words like "soixante-dix". - */ -final class FrenchInflector implements InflectorInterface -{ - /** - * A list of all rules for pluralise. - * - * @see https://la-conjugaison.nouvelobs.com/regles/grammaire/le-pluriel-des-noms-121.php - */ - private const PLURALIZE_REGEXP = [ - // First entry: regexp - // Second entry: replacement - - // Words finishing with "s", "x" or "z" are invariables - // Les mots finissant par "s", "x" ou "z" sont invariables - ['/(s|x|z)$/i', '\1'], - - // Words finishing with "eau" are pluralized with a "x" - // Les mots finissant par "eau" prennent tous un "x" au pluriel - ['/(eau)$/i', '\1x'], - - // Words finishing with "au" are pluralized with a "x" excepted "landau" - // Les mots finissant par "au" prennent un "x" au pluriel sauf "landau" - ['/^(landau)$/i', '\1s'], - ['/(au)$/i', '\1x'], - - // Words finishing with "eu" are pluralized with a "x" excepted "pneu", "bleu", "émeu" - // Les mots finissant en "eu" prennent un "x" au pluriel sauf "pneu", "bleu", "émeu" - ['/^(pneu|bleu|émeu)$/i', '\1s'], - ['/(eu)$/i', '\1x'], - - // Words finishing with "al" are pluralized with a "aux" excepted - // Les mots finissant en "al" se terminent en "aux" sauf - ['/^(bal|carnaval|caracal|chacal|choral|corral|étal|festival|récital|val)$/i', '\1s'], - ['/al$/i', '\1aux'], - - // Aspirail, bail, corail, émail, fermail, soupirail, travail, vantail et vitrail font leur pluriel en -aux - ['/^(aspir|b|cor|ém|ferm|soupir|trav|vant|vitr)ail$/i', '\1aux'], - - // Bijou, caillou, chou, genou, hibou, joujou et pou qui prennent un x au pluriel - ['/^(bij|caill|ch|gen|hib|jouj|p)ou$/i', '\1oux'], - - // Invariable words - ['/^(cinquante|soixante|mille)$/i', '\1'], - - // French titles - ['/^(mon|ma)(sieur|dame|demoiselle|seigneur)$/', 'mes\2s'], - ['/^(Mon|Ma)(sieur|dame|demoiselle|seigneur)$/', 'Mes\2s'], - ]; - - /** - * A list of all rules for singularize. - */ - private const SINGULARIZE_REGEXP = [ - // First entry: regexp - // Second entry: replacement - - // Aspirail, bail, corail, émail, fermail, soupirail, travail, vantail et vitrail font leur pluriel en -aux - ['/((aspir|b|cor|ém|ferm|soupir|trav|vant|vitr))aux$/i', '\1ail'], - - // Words finishing with "eau" are pluralized with a "x" - // Les mots finissant par "eau" prennent tous un "x" au pluriel - ['/(eau)x$/i', '\1'], - - // Words finishing with "al" are pluralized with a "aux" expected - // Les mots finissant en "al" se terminent en "aux" sauf - ['/(amir|anim|arsen|boc|can|capit|capor|chev|crist|génér|hopit|hôpit|idé|journ|littor|loc|m|mét|minér|princip|radic|termin)aux$/i', '\1al'], - - // Words finishing with "au" are pluralized with a "x" excepted "landau" - // Les mots finissant par "au" prennent un "x" au pluriel sauf "landau" - ['/(au)x$/i', '\1'], - - // Words finishing with "eu" are pluralized with a "x" excepted "pneu", "bleu", "émeu" - // Les mots finissant en "eu" prennent un "x" au pluriel sauf "pneu", "bleu", "émeu" - ['/(eu)x$/i', '\1'], - - // Words finishing with "ou" are pluralized with a "s" excepted bijou, caillou, chou, genou, hibou, joujou, pou - // Les mots finissant par "ou" prennent un "s" sauf bijou, caillou, chou, genou, hibou, joujou, pou - ['/(bij|caill|ch|gen|hib|jouj|p)oux$/i', '\1ou'], - - // French titles - ['/^mes(dame|demoiselle)s$/', 'ma\1'], - ['/^Mes(dame|demoiselle)s$/', 'Ma\1'], - ['/^mes(sieur|seigneur)s$/', 'mon\1'], - ['/^Mes(sieur|seigneur)s$/', 'Mon\1'], - - // Default rule - ['/s$/i', ''], - ]; - - /** - * A list of words which should not be inflected. - * This list is only used by singularize. - */ - private const UNINFLECTED = '/^(abcès|accès|abus|albatros|anchois|anglais|autobus|bois|brebis|carquois|cas|chas|colis|concours|corps|cours|cyprès|décès|devis|discours|dos|embarras|engrais|entrelacs|excès|fils|fois|gâchis|gars|glas|héros|intrus|jars|jus|kermès|lacis|legs|lilas|marais|mars|matelas|mépris|mets|mois|mors|obus|os|palais|paradis|parcours|pardessus|pays|plusieurs|poids|pois|pouls|printemps|processus|progrès|puits|pus|rabais|radis|recors|recours|refus|relais|remords|remous|rictus|rhinocéros|repas|rubis|sans|sas|secours|sens|souris|succès|talus|tapis|tas|taudis|temps|tiers|univers|velours|verglas|vernis|virus)$/i'; - - public function singularize(string $plural): array - { - if ($this->isInflectedWord($plural)) { - return [$plural]; - } - - foreach (self::SINGULARIZE_REGEXP as $rule) { - [$regexp, $replace] = $rule; - - if (1 === preg_match($regexp, $plural)) { - return [preg_replace($regexp, $replace, $plural)]; - } - } - - return [$plural]; - } - - public function pluralize(string $singular): array - { - if ($this->isInflectedWord($singular)) { - return [$singular]; - } - - foreach (self::PLURALIZE_REGEXP as $rule) { - [$regexp, $replace] = $rule; - - if (1 === preg_match($regexp, $singular)) { - return [preg_replace($regexp, $replace, $singular)]; - } - } - - return [$singular.'s']; - } - - private function isInflectedWord(string $word): bool - { - return 1 === preg_match(self::UNINFLECTED, $word); - } -} diff --git a/vendor/symfony/string/Inflector/InflectorInterface.php b/vendor/symfony/string/Inflector/InflectorInterface.php deleted file mode 100644 index 67f28340..00000000 --- a/vendor/symfony/string/Inflector/InflectorInterface.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\String\Inflector; - -interface InflectorInterface -{ - /** - * Returns the singular forms of a string. - * - * If the method can't determine the form with certainty, several possible singulars are returned. - * - * @return string[] - */ - public function singularize(string $plural): array; - - /** - * Returns the plural forms of a string. - * - * If the method can't determine the form with certainty, several possible plurals are returned. - * - * @return string[] - */ - public function pluralize(string $singular): array; -} diff --git a/vendor/symfony/string/LICENSE b/vendor/symfony/string/LICENSE deleted file mode 100644 index 9c907a46..00000000 --- a/vendor/symfony/string/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2019-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/string/LazyString.php b/vendor/symfony/string/LazyString.php deleted file mode 100644 index 9523b8cd..00000000 --- a/vendor/symfony/string/LazyString.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. - */ - -namespace Symfony\Component\String; - -/** - * A string whose value is computed lazily by a callback. - * - * @author Nicolas Grekas - */ -class LazyString implements \Stringable, \JsonSerializable -{ - private \Closure|string $value; - - /** - * @param callable|array $callback A callable or a [Closure, method] lazy-callable - */ - public static function fromCallable(callable|array $callback, mixed ...$arguments): static - { - if (\is_array($callback) && !\is_callable($callback) && !(($callback[0] ?? null) instanceof \Closure || 2 < \count($callback))) { - throw new \TypeError(sprintf('Argument 1 passed to "%s()" must be a callable or a [Closure, method] lazy-callable, "%s" given.', __METHOD__, '['.implode(', ', array_map('get_debug_type', $callback)).']')); - } - - $lazyString = new static(); - $lazyString->value = static function () use (&$callback, &$arguments, &$value): string { - if (null !== $arguments) { - if (!\is_callable($callback)) { - $callback[0] = $callback[0](); - $callback[1] ??= '__invoke'; - } - $value = $callback(...$arguments); - $callback = self::getPrettyName($callback); - $arguments = null; - } - - return $value ?? ''; - }; - - return $lazyString; - } - - public static function fromStringable(string|int|float|bool|\Stringable $value): static - { - if (\is_object($value)) { - return static::fromCallable($value->__toString(...)); - } - - $lazyString = new static(); - $lazyString->value = (string) $value; - - return $lazyString; - } - - /** - * Tells whether the provided value can be cast to string. - */ - final public static function isStringable(mixed $value): bool - { - return \is_string($value) || $value instanceof \Stringable || \is_scalar($value); - } - - /** - * Casts scalars and stringable objects to strings. - * - * @throws \TypeError When the provided value is not stringable - */ - final public static function resolve(\Stringable|string|int|float|bool $value): string - { - return $value; - } - - public function __toString(): string - { - if (\is_string($this->value)) { - return $this->value; - } - - try { - return $this->value = ($this->value)(); - } catch (\Throwable $e) { - if (\TypeError::class === $e::class && __FILE__ === $e->getFile()) { - $type = explode(', ', $e->getMessage()); - $type = substr(array_pop($type), 0, -\strlen(' returned')); - $r = new \ReflectionFunction($this->value); - $callback = $r->getStaticVariables()['callback']; - - $e = new \TypeError(sprintf('Return value of %s() passed to %s::fromCallable() must be of the type string, %s returned.', $callback, static::class, $type)); - } - - throw $e; - } - } - - public function __sleep(): array - { - $this->__toString(); - - return ['value']; - } - - public function jsonSerialize(): string - { - return $this->__toString(); - } - - private function __construct() - { - } - - private static function getPrettyName(callable $callback): string - { - if (\is_string($callback)) { - return $callback; - } - - if (\is_array($callback)) { - $class = \is_object($callback[0]) ? get_debug_type($callback[0]) : $callback[0]; - $method = $callback[1]; - } elseif ($callback instanceof \Closure) { - $r = new \ReflectionFunction($callback); - - if (str_contains($r->name, '{closure}') || !$class = \PHP_VERSION_ID >= 80111 ? $r->getClosureCalledClass() : $r->getClosureScopeClass()) { - return $r->name; - } - - $class = $class->name; - $method = $r->name; - } else { - $class = get_debug_type($callback); - $method = '__invoke'; - } - - return $class.'::'.$method; - } -} diff --git a/vendor/symfony/string/README.md b/vendor/symfony/string/README.md deleted file mode 100644 index 9c7e1e19..00000000 --- a/vendor/symfony/string/README.md +++ /dev/null @@ -1,14 +0,0 @@ -String Component -================ - -The String component provides an object-oriented API to strings and deals -with bytes, UTF-8 code points and grapheme clusters in a unified way. - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/components/string.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/string/Resources/data/wcswidth_table_wide.php b/vendor/symfony/string/Resources/data/wcswidth_table_wide.php deleted file mode 100644 index 5a647e67..00000000 --- a/vendor/symfony/string/Resources/data/wcswidth_table_wide.php +++ /dev/null @@ -1,1143 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String; - -if (!\function_exists(u::class)) { - function u(?string $string = ''): UnicodeString - { - return new UnicodeString($string ?? ''); - } -} - -if (!\function_exists(b::class)) { - function b(?string $string = ''): ByteString - { - return new ByteString($string ?? ''); - } -} - -if (!\function_exists(s::class)) { - /** - * @return UnicodeString|ByteString - */ - function s(?string $string = ''): AbstractString - { - $string ??= ''; - - return preg_match('//u', $string) ? new UnicodeString($string) : new ByteString($string); - } -} diff --git a/vendor/symfony/string/Slugger/AsciiSlugger.php b/vendor/symfony/string/Slugger/AsciiSlugger.php deleted file mode 100644 index 826d07ca..00000000 --- a/vendor/symfony/string/Slugger/AsciiSlugger.php +++ /dev/null @@ -1,209 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String\Slugger; - -use Symfony\Component\Intl\Transliterator\EmojiTransliterator; -use Symfony\Component\String\AbstractUnicodeString; -use Symfony\Component\String\UnicodeString; -use Symfony\Contracts\Translation\LocaleAwareInterface; - -if (!interface_exists(LocaleAwareInterface::class)) { - throw new \LogicException('You cannot use the "Symfony\Component\String\Slugger\AsciiSlugger" as the "symfony/translation-contracts" package is not installed. Try running "composer require symfony/translation-contracts".'); -} - -/** - * @author Titouan Galopin - */ -class AsciiSlugger implements SluggerInterface, LocaleAwareInterface -{ - private const LOCALE_TO_TRANSLITERATOR_ID = [ - 'am' => 'Amharic-Latin', - 'ar' => 'Arabic-Latin', - 'az' => 'Azerbaijani-Latin', - 'be' => 'Belarusian-Latin', - 'bg' => 'Bulgarian-Latin', - 'bn' => 'Bengali-Latin', - 'de' => 'de-ASCII', - 'el' => 'Greek-Latin', - 'fa' => 'Persian-Latin', - 'he' => 'Hebrew-Latin', - 'hy' => 'Armenian-Latin', - 'ka' => 'Georgian-Latin', - 'kk' => 'Kazakh-Latin', - 'ky' => 'Kirghiz-Latin', - 'ko' => 'Korean-Latin', - 'mk' => 'Macedonian-Latin', - 'mn' => 'Mongolian-Latin', - 'or' => 'Oriya-Latin', - 'ps' => 'Pashto-Latin', - 'ru' => 'Russian-Latin', - 'sr' => 'Serbian-Latin', - 'sr_Cyrl' => 'Serbian-Latin', - 'th' => 'Thai-Latin', - 'tk' => 'Turkmen-Latin', - 'uk' => 'Ukrainian-Latin', - 'uz' => 'Uzbek-Latin', - 'zh' => 'Han-Latin', - ]; - - private ?string $defaultLocale; - private \Closure|array $symbolsMap = [ - 'en' => ['@' => 'at', '&' => 'and'], - ]; - private bool|string $emoji = false; - - /** - * Cache of transliterators per locale. - * - * @var \Transliterator[] - */ - private array $transliterators = []; - - public function __construct(string $defaultLocale = null, array|\Closure $symbolsMap = null) - { - $this->defaultLocale = $defaultLocale; - $this->symbolsMap = $symbolsMap ?? $this->symbolsMap; - } - - public function setLocale(string $locale) - { - $this->defaultLocale = $locale; - } - - public function getLocale(): string - { - return $this->defaultLocale; - } - - /** - * @param bool|string $emoji true will use the same locale, - * false will disable emoji, - * and a string to use a specific locale - */ - public function withEmoji(bool|string $emoji = true): static - { - if (false !== $emoji && !class_exists(EmojiTransliterator::class)) { - throw new \LogicException(sprintf('You cannot use the "%s()" method as the "symfony/intl" package is not installed. Try running "composer require symfony/intl".', __METHOD__)); - } - - $new = clone $this; - $new->emoji = $emoji; - - return $new; - } - - public function slug(string $string, string $separator = '-', string $locale = null): AbstractUnicodeString - { - $locale ??= $this->defaultLocale; - - $transliterator = []; - if ($locale && ('de' === $locale || str_starts_with($locale, 'de_'))) { - // Use the shortcut for German in UnicodeString::ascii() if possible (faster and no requirement on intl) - $transliterator = ['de-ASCII']; - } elseif (\function_exists('transliterator_transliterate') && $locale) { - $transliterator = (array) $this->createTransliterator($locale); - } - - if ($emojiTransliterator = $this->createEmojiTransliterator($locale)) { - $transliterator[] = $emojiTransliterator; - } - - if ($this->symbolsMap instanceof \Closure) { - // If the symbols map is passed as a closure, there is no need to fallback to the parent locale - // as the closure can just provide substitutions for all locales of interest. - $symbolsMap = $this->symbolsMap; - array_unshift($transliterator, static function ($s) use ($symbolsMap, $locale) { - return $symbolsMap($s, $locale); - }); - } - - $unicodeString = (new UnicodeString($string))->ascii($transliterator); - - if (\is_array($this->symbolsMap)) { - $map = null; - if (isset($this->symbolsMap[$locale])) { - $map = $this->symbolsMap[$locale]; - } else { - $parent = self::getParentLocale($locale); - if ($parent && isset($this->symbolsMap[$parent])) { - $map = $this->symbolsMap[$parent]; - } - } - if ($map) { - foreach ($map as $char => $replace) { - $unicodeString = $unicodeString->replace($char, ' '.$replace.' '); - } - } - } - - return $unicodeString - ->replaceMatches('/[^A-Za-z0-9]++/', $separator) - ->trim($separator) - ; - } - - private function createTransliterator(string $locale): ?\Transliterator - { - if (\array_key_exists($locale, $this->transliterators)) { - return $this->transliterators[$locale]; - } - - // Exact locale supported, cache and return - if ($id = self::LOCALE_TO_TRANSLITERATOR_ID[$locale] ?? null) { - return $this->transliterators[$locale] = \Transliterator::create($id.'/BGN') ?? \Transliterator::create($id); - } - - // Locale not supported and no parent, fallback to any-latin - if (!$parent = self::getParentLocale($locale)) { - return $this->transliterators[$locale] = null; - } - - // Try to use the parent locale (ie. try "de" for "de_AT") and cache both locales - if ($id = self::LOCALE_TO_TRANSLITERATOR_ID[$parent] ?? null) { - $transliterator = \Transliterator::create($id.'/BGN') ?? \Transliterator::create($id); - } - - return $this->transliterators[$locale] = $this->transliterators[$parent] = $transliterator ?? null; - } - - private function createEmojiTransliterator(?string $locale): ?EmojiTransliterator - { - if (\is_string($this->emoji)) { - $locale = $this->emoji; - } elseif (!$this->emoji) { - return null; - } - - while (null !== $locale) { - try { - return EmojiTransliterator::create("emoji-$locale"); - } catch (\IntlException) { - $locale = self::getParentLocale($locale); - } - } - - return null; - } - - private static function getParentLocale(?string $locale): ?string - { - if (!$locale) { - return null; - } - if (false === $str = strrchr($locale, '_')) { - // no parent locale - return null; - } - - return substr($locale, 0, -\strlen($str)); - } -} diff --git a/vendor/symfony/string/Slugger/SluggerInterface.php b/vendor/symfony/string/Slugger/SluggerInterface.php deleted file mode 100644 index c679ed93..00000000 --- a/vendor/symfony/string/Slugger/SluggerInterface.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\String\Slugger; - -use Symfony\Component\String\AbstractUnicodeString; - -/** - * Creates a URL-friendly slug from a given string. - * - * @author Titouan Galopin - */ -interface SluggerInterface -{ - /** - * Creates a slug for the given string and locale, using appropriate transliteration when needed. - */ - public function slug(string $string, string $separator = '-', string $locale = null): AbstractUnicodeString; -} diff --git a/vendor/symfony/string/UnicodeString.php b/vendor/symfony/string/UnicodeString.php deleted file mode 100644 index a64c6a9d..00000000 --- a/vendor/symfony/string/UnicodeString.php +++ /dev/null @@ -1,358 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String; - -use Symfony\Component\String\Exception\ExceptionInterface; -use Symfony\Component\String\Exception\InvalidArgumentException; - -/** - * Represents a string of Unicode grapheme clusters encoded as UTF-8. - * - * A letter followed by combining characters (accents typically) form what Unicode defines - * as a grapheme cluster: a character as humans mean it in written texts. This class knows - * about the concept and won't split a letter apart from its combining accents. It also - * ensures all string comparisons happen on their canonically-composed representation, - * ignoring e.g. the order in which accents are listed when a letter has many of them. - * - * @see https://unicode.org/reports/tr15/ - * - * @author Nicolas Grekas - * @author Hugo Hamon - * - * @throws ExceptionInterface - */ -class UnicodeString extends AbstractUnicodeString -{ - public function __construct(string $string = '') - { - $this->string = normalizer_is_normalized($string) ? $string : normalizer_normalize($string); - - if (false === $this->string) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - } - - public function append(string ...$suffix): static - { - $str = clone $this; - $str->string = $this->string.(1 >= \count($suffix) ? ($suffix[0] ?? '') : implode('', $suffix)); - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - - if (false === $str->string) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - return $str; - } - - public function chunk(int $length = 1): array - { - if (1 > $length) { - throw new InvalidArgumentException('The chunk length must be greater than zero.'); - } - - if ('' === $this->string) { - return []; - } - - $rx = '/('; - while (65535 < $length) { - $rx .= '\X{65535}'; - $length -= 65535; - } - $rx .= '\X{'.$length.'})/u'; - - $str = clone $this; - $chunks = []; - - foreach (preg_split($rx, $this->string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY) as $chunk) { - $str->string = $chunk; - $chunks[] = clone $str; - } - - return $chunks; - } - - public function endsWith(string|iterable|AbstractString $suffix): bool - { - if ($suffix instanceof AbstractString) { - $suffix = $suffix->string; - } elseif (!\is_string($suffix)) { - return parent::endsWith($suffix); - } - - $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC; - normalizer_is_normalized($suffix, $form) ?: $suffix = normalizer_normalize($suffix, $form); - - if ('' === $suffix || false === $suffix) { - return false; - } - - if ($this->ignoreCase) { - return 0 === mb_stripos(grapheme_extract($this->string, \strlen($suffix), \GRAPHEME_EXTR_MAXBYTES, \strlen($this->string) - \strlen($suffix)), $suffix, 0, 'UTF-8'); - } - - return $suffix === grapheme_extract($this->string, \strlen($suffix), \GRAPHEME_EXTR_MAXBYTES, \strlen($this->string) - \strlen($suffix)); - } - - public function equalsTo(string|iterable|AbstractString $string): bool - { - if ($string instanceof AbstractString) { - $string = $string->string; - } elseif (!\is_string($string)) { - return parent::equalsTo($string); - } - - $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC; - normalizer_is_normalized($string, $form) ?: $string = normalizer_normalize($string, $form); - - if ('' !== $string && false !== $string && $this->ignoreCase) { - return \strlen($string) === \strlen($this->string) && 0 === mb_stripos($this->string, $string, 0, 'UTF-8'); - } - - return $string === $this->string; - } - - public function indexOf(string|iterable|AbstractString $needle, int $offset = 0): ?int - { - if ($needle instanceof AbstractString) { - $needle = $needle->string; - } elseif (!\is_string($needle)) { - return parent::indexOf($needle, $offset); - } - - $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC; - normalizer_is_normalized($needle, $form) ?: $needle = normalizer_normalize($needle, $form); - - if ('' === $needle || false === $needle) { - return null; - } - - try { - $i = $this->ignoreCase ? grapheme_stripos($this->string, $needle, $offset) : grapheme_strpos($this->string, $needle, $offset); - } catch (\ValueError) { - return null; - } - - return false === $i ? null : $i; - } - - public function indexOfLast(string|iterable|AbstractString $needle, int $offset = 0): ?int - { - if ($needle instanceof AbstractString) { - $needle = $needle->string; - } elseif (!\is_string($needle)) { - return parent::indexOfLast($needle, $offset); - } - - $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC; - normalizer_is_normalized($needle, $form) ?: $needle = normalizer_normalize($needle, $form); - - if ('' === $needle || false === $needle) { - return null; - } - - $string = $this->string; - - if (0 > $offset) { - // workaround https://bugs.php.net/74264 - if (0 > $offset += grapheme_strlen($needle)) { - $string = grapheme_substr($string, 0, $offset); - } - $offset = 0; - } - - $i = $this->ignoreCase ? grapheme_strripos($string, $needle, $offset) : grapheme_strrpos($string, $needle, $offset); - - return false === $i ? null : $i; - } - - public function join(array $strings, string $lastGlue = null): static - { - $str = parent::join($strings, $lastGlue); - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - - return $str; - } - - public function length(): int - { - return grapheme_strlen($this->string); - } - - public function normalize(int $form = self::NFC): static - { - $str = clone $this; - - if (\in_array($form, [self::NFC, self::NFKC], true)) { - normalizer_is_normalized($str->string, $form) ?: $str->string = normalizer_normalize($str->string, $form); - } elseif (!\in_array($form, [self::NFD, self::NFKD], true)) { - throw new InvalidArgumentException('Unsupported normalization form.'); - } elseif (!normalizer_is_normalized($str->string, $form)) { - $str->string = normalizer_normalize($str->string, $form); - $str->ignoreCase = null; - } - - return $str; - } - - public function prepend(string ...$prefix): static - { - $str = clone $this; - $str->string = (1 >= \count($prefix) ? ($prefix[0] ?? '') : implode('', $prefix)).$this->string; - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - - if (false === $str->string) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - return $str; - } - - public function replace(string $from, string $to): static - { - $str = clone $this; - normalizer_is_normalized($from) ?: $from = normalizer_normalize($from); - - if ('' !== $from && false !== $from) { - $tail = $str->string; - $result = ''; - $indexOf = $this->ignoreCase ? 'grapheme_stripos' : 'grapheme_strpos'; - - while ('' !== $tail && false !== $i = $indexOf($tail, $from)) { - $slice = grapheme_substr($tail, 0, $i); - $result .= $slice.$to; - $tail = substr($tail, \strlen($slice) + \strlen($from)); - } - - $str->string = $result.$tail; - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - - if (false === $str->string) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - } - - return $str; - } - - public function replaceMatches(string $fromRegexp, string|callable $to): static - { - $str = parent::replaceMatches($fromRegexp, $to); - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - - return $str; - } - - public function slice(int $start = 0, int $length = null): static - { - $str = clone $this; - - $str->string = (string) grapheme_substr($this->string, $start, $length ?? 2147483647); - - return $str; - } - - public function splice(string $replacement, int $start = 0, int $length = null): static - { - $str = clone $this; - - $start = $start ? \strlen(grapheme_substr($this->string, 0, $start)) : 0; - $length = $length ? \strlen(grapheme_substr($this->string, $start, $length ?? 2147483647)) : $length; - $str->string = substr_replace($this->string, $replacement, $start, $length ?? 2147483647); - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - - if (false === $str->string) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - return $str; - } - - public function split(string $delimiter, int $limit = null, int $flags = null): array - { - if (1 > $limit ??= 2147483647) { - throw new InvalidArgumentException('Split limit must be a positive integer.'); - } - - if ('' === $delimiter) { - throw new InvalidArgumentException('Split delimiter is empty.'); - } - - if (null !== $flags) { - return parent::split($delimiter.'u', $limit, $flags); - } - - normalizer_is_normalized($delimiter) ?: $delimiter = normalizer_normalize($delimiter); - - if (false === $delimiter) { - throw new InvalidArgumentException('Split delimiter is not a valid UTF-8 string.'); - } - - $str = clone $this; - $tail = $this->string; - $chunks = []; - $indexOf = $this->ignoreCase ? 'grapheme_stripos' : 'grapheme_strpos'; - - while (1 < $limit && false !== $i = $indexOf($tail, $delimiter)) { - $str->string = grapheme_substr($tail, 0, $i); - $chunks[] = clone $str; - $tail = substr($tail, \strlen($str->string) + \strlen($delimiter)); - --$limit; - } - - $str->string = $tail; - $chunks[] = clone $str; - - return $chunks; - } - - public function startsWith(string|iterable|AbstractString $prefix): bool - { - if ($prefix instanceof AbstractString) { - $prefix = $prefix->string; - } elseif (!\is_string($prefix)) { - return parent::startsWith($prefix); - } - - $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC; - normalizer_is_normalized($prefix, $form) ?: $prefix = normalizer_normalize($prefix, $form); - - if ('' === $prefix || false === $prefix) { - return false; - } - - if ($this->ignoreCase) { - return 0 === mb_stripos(grapheme_extract($this->string, \strlen($prefix), \GRAPHEME_EXTR_MAXBYTES), $prefix, 0, 'UTF-8'); - } - - return $prefix === grapheme_extract($this->string, \strlen($prefix), \GRAPHEME_EXTR_MAXBYTES); - } - - public function __wakeup() - { - if (!\is_string($this->string)) { - throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); - } - - normalizer_is_normalized($this->string) ?: $this->string = normalizer_normalize($this->string); - } - - public function __clone() - { - if (null === $this->ignoreCase) { - normalizer_is_normalized($this->string) ?: $this->string = normalizer_normalize($this->string); - } - - $this->ignoreCase = false; - } -} diff --git a/vendor/symfony/string/composer.json b/vendor/symfony/string/composer.json deleted file mode 100644 index 44a809d5..00000000 --- a/vendor/symfony/string/composer.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "symfony/string", - "type": "library", - "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", - "keywords": ["string", "utf8", "utf-8", "grapheme", "i18n", "unicode"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.1", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.0", - "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0" - }, - "require-dev": { - "symfony/error-handler": "^5.4|^6.0", - "symfony/intl": "^6.2", - "symfony/http-client": "^5.4|^6.0", - "symfony/translation-contracts": "^2.0|^3.0", - "symfony/var-exporter": "^5.4|^6.0" - }, - "conflict": { - "symfony/translation-contracts": "<2.0" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\String\\": "" }, - "files": [ "Resources/functions.php" ], - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "minimum-stability": "dev" -} diff --git a/vendor/symfony/translation-contracts/CHANGELOG.md b/vendor/symfony/translation-contracts/CHANGELOG.md deleted file mode 100644 index 7932e261..00000000 --- a/vendor/symfony/translation-contracts/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -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/symfony/translation-contracts/LICENSE b/vendor/symfony/translation-contracts/LICENSE deleted file mode 100644 index 74cdc2db..00000000 --- a/vendor/symfony/translation-contracts/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2018-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/translation-contracts/LocaleAwareInterface.php b/vendor/symfony/translation-contracts/LocaleAwareInterface.php deleted file mode 100644 index 6923b977..00000000 --- a/vendor/symfony/translation-contracts/LocaleAwareInterface.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\Contracts\Translation; - -interface LocaleAwareInterface -{ - /** - * Sets the current locale. - * - * @throws \InvalidArgumentException If the locale contains invalid characters - */ - public function setLocale(string $locale); - - /** - * Returns the current locale. - */ - public function getLocale(): string; -} diff --git a/vendor/symfony/translation-contracts/README.md b/vendor/symfony/translation-contracts/README.md deleted file mode 100644 index 42e5c517..00000000 --- a/vendor/symfony/translation-contracts/README.md +++ /dev/null @@ -1,9 +0,0 @@ -Symfony Translation Contracts -============================= - -A set of abstractions extracted out of the Symfony components. - -Can be used to build on semantics that the Symfony components proved useful - and -that already have battle tested implementations. - -See https://github.com/symfony/contracts/blob/main/README.md for more information. diff --git a/vendor/symfony/translation-contracts/Test/TranslatorTest.php b/vendor/symfony/translation-contracts/Test/TranslatorTest.php deleted file mode 100644 index fbfa1619..00000000 --- a/vendor/symfony/translation-contracts/Test/TranslatorTest.php +++ /dev/null @@ -1,384 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Translation\Test; - -use PHPUnit\Framework\TestCase; -use Symfony\Contracts\Translation\TranslatorInterface; -use Symfony\Contracts\Translation\TranslatorTrait; - -/** - * Test should cover all languages mentioned on http://translate.sourceforge.net/wiki/l10n/pluralforms - * and Plural forms mentioned on http://www.gnu.org/software/gettext/manual/gettext.html#Plural-forms. - * - * See also https://developer.mozilla.org/en/Localization_and_Plurals which mentions 15 rules having a maximum of 6 forms. - * The mozilla code is also interesting to check for. - * - * As mentioned by chx http://drupal.org/node/1273968 we can cover all by testing number from 0 to 199 - * - * The goal to cover all languages is to far fetched so this test case is smaller. - * - * @author Clemens Tolboom clemens@build2be.nl - */ -class TranslatorTest extends TestCase -{ - private $defaultLocale; - - protected function setUp(): void - { - $this->defaultLocale = \Locale::getDefault(); - \Locale::setDefault('en'); - } - - protected function tearDown(): void - { - \Locale::setDefault($this->defaultLocale); - } - - public function getTranslator(): TranslatorInterface - { - return new class() implements TranslatorInterface { - use TranslatorTrait; - }; - } - - /** - * @dataProvider getTransTests - */ - public function testTrans($expected, $id, $parameters) - { - $translator = $this->getTranslator(); - - $this->assertEquals($expected, $translator->trans($id, $parameters)); - } - - /** - * @dataProvider getTransChoiceTests - */ - public function testTransChoiceWithExplicitLocale($expected, $id, $number) - { - $translator = $this->getTranslator(); - - $this->assertEquals($expected, $translator->trans($id, ['%count%' => $number])); - } - - /** - * @requires extension intl - * - * @dataProvider getTransChoiceTests - */ - public function testTransChoiceWithDefaultLocale($expected, $id, $number) - { - $translator = $this->getTranslator(); - - $this->assertEquals($expected, $translator->trans($id, ['%count%' => $number])); - } - - /** - * @dataProvider getTransChoiceTests - */ - public function testTransChoiceWithEnUsPosix($expected, $id, $number) - { - $translator = $this->getTranslator(); - $translator->setLocale('en_US_POSIX'); - - $this->assertEquals($expected, $translator->trans($id, ['%count%' => $number])); - } - - public function testGetSetLocale() - { - $translator = $this->getTranslator(); - - $this->assertEquals('en', $translator->getLocale()); - } - - /** - * @requires extension intl - */ - public function testGetLocaleReturnsDefaultLocaleIfNotSet() - { - $translator = $this->getTranslator(); - - \Locale::setDefault('pt_BR'); - $this->assertEquals('pt_BR', $translator->getLocale()); - - \Locale::setDefault('en'); - $this->assertEquals('en', $translator->getLocale()); - } - - public function getTransTests() - { - return [ - ['Symfony is great!', 'Symfony is great!', []], - ['Symfony is awesome!', 'Symfony is %what%!', ['%what%' => 'awesome']], - ]; - } - - public function getTransChoiceTests() - { - return [ - ['There are no apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 0], - ['There is one apple', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 1], - ['There are 10 apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 10], - ['There are 0 apples', 'There is 1 apple|There are %count% apples', 0], - ['There is 1 apple', 'There is 1 apple|There are %count% apples', 1], - ['There are 10 apples', 'There is 1 apple|There are %count% apples', 10], - // custom validation messages may be coded with a fixed value - ['There are 2 apples', 'There are 2 apples', 2], - ]; - } - - /** - * @dataProvider getInternal - */ - public function testInterval($expected, $number, $interval) - { - $translator = $this->getTranslator(); - - $this->assertEquals($expected, $translator->trans($interval.' foo|[1,Inf[ bar', ['%count%' => $number])); - } - - public function getInternal() - { - return [ - ['foo', 3, '{1,2, 3 ,4}'], - ['bar', 10, '{1,2, 3 ,4}'], - ['bar', 3, '[1,2]'], - ['foo', 1, '[1,2]'], - ['foo', 2, '[1,2]'], - ['bar', 1, ']1,2['], - ['bar', 2, ']1,2['], - ['foo', log(0), '[-Inf,2['], - ['foo', -log(0), '[-2,+Inf]'], - ]; - } - - /** - * @dataProvider getChooseTests - */ - public function testChoose($expected, $id, $number, $locale = null) - { - $translator = $this->getTranslator(); - - $this->assertEquals($expected, $translator->trans($id, ['%count%' => $number], null, $locale)); - } - - public function testReturnMessageIfExactlyOneStandardRuleIsGiven() - { - $translator = $this->getTranslator(); - - $this->assertEquals('There are two apples', $translator->trans('There are two apples', ['%count%' => 2])); - } - - /** - * @dataProvider getNonMatchingMessages - */ - public function testThrowExceptionIfMatchingMessageCannotBeFound($id, $number) - { - $this->expectException(\InvalidArgumentException::class); - $translator = $this->getTranslator(); - - $translator->trans($id, ['%count%' => $number]); - } - - public function getNonMatchingMessages() - { - return [ - ['{0} There are no apples|{1} There is one apple', 2], - ['{1} There is one apple|]1,Inf] There are %count% apples', 0], - ['{1} There is one apple|]2,Inf] There are %count% apples', 2], - ['{0} There are no apples|There is one apple', 2], - ]; - } - - public function getChooseTests() - { - return [ - ['There are no apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 0], - ['There are no apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 0], - ['There are no apples', '{0}There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 0], - - ['There is one apple', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 1], - - ['There are 10 apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 10], - ['There are 10 apples', '{0} There are no apples|{1} There is one apple|]1,Inf]There are %count% apples', 10], - ['There are 10 apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 10], - - ['There are 0 apples', 'There is one apple|There are %count% apples', 0], - ['There is one apple', 'There is one apple|There are %count% apples', 1], - ['There are 10 apples', 'There is one apple|There are %count% apples', 10], - - ['There are 0 apples', 'one: There is one apple|more: There are %count% apples', 0], - ['There is one apple', 'one: There is one apple|more: There are %count% apples', 1], - ['There are 10 apples', 'one: There is one apple|more: There are %count% apples', 10], - - ['There are no apples', '{0} There are no apples|one: There is one apple|more: There are %count% apples', 0], - ['There is one apple', '{0} There are no apples|one: There is one apple|more: There are %count% apples', 1], - ['There are 10 apples', '{0} There are no apples|one: There is one apple|more: There are %count% apples', 10], - - ['', '{0}|{1} There is one apple|]1,Inf] There are %count% apples', 0], - ['', '{0} There are no apples|{1}|]1,Inf] There are %count% apples', 1], - - // Indexed only tests which are Gettext PoFile* compatible strings. - ['There are 0 apples', 'There is one apple|There are %count% apples', 0], - ['There is one apple', 'There is one apple|There are %count% apples', 1], - ['There are 2 apples', 'There is one apple|There are %count% apples', 2], - - // Tests for float numbers - ['There is almost one apple', '{0} There are no apples|]0,1[ There is almost one apple|{1} There is one apple|[1,Inf] There is more than one apple', 0.7], - ['There is one apple', '{0} There are no apples|]0,1[There are %count% apples|{1} There is one apple|[1,Inf] There is more than one apple', 1], - ['There is more than one apple', '{0} There are no apples|]0,1[There are %count% apples|{1} There is one apple|[1,Inf] There is more than one apple', 1.7], - ['There are no apples', '{0} There are no apples|]0,1[There are %count% apples|{1} There is one apple|[1,Inf] There is more than one apple', 0], - ['There are no apples', '{0} There are no apples|]0,1[There are %count% apples|{1} There is one apple|[1,Inf] There is more than one apple', 0.0], - ['There are no apples', '{0.0} There are no apples|]0,1[There are %count% apples|{1} There is one apple|[1,Inf] There is more than one apple', 0], - - // Test texts with new-lines - // with double-quotes and \n in id & double-quotes and actual newlines in text - ["This is a text with a\n new-line in it. Selector = 0.", '{0}This is a text with a - new-line in it. Selector = 0.|{1}This is a text with a - new-line in it. Selector = 1.|[1,Inf]This is a text with a - new-line in it. Selector > 1.', 0], - // with double-quotes and \n in id and single-quotes and actual newlines in text - ["This is a text with a\n new-line in it. Selector = 1.", '{0}This is a text with a - new-line in it. Selector = 0.|{1}This is a text with a - new-line in it. Selector = 1.|[1,Inf]This is a text with a - new-line in it. Selector > 1.', 1], - ["This is a text with a\n new-line in it. Selector > 1.", '{0}This is a text with a - new-line in it. Selector = 0.|{1}This is a text with a - new-line in it. Selector = 1.|[1,Inf]This is a text with a - new-line in it. Selector > 1.', 5], - // with double-quotes and id split accros lines - ['This is a text with a - new-line in it. Selector = 1.', '{0}This is a text with a - new-line in it. Selector = 0.|{1}This is a text with a - new-line in it. Selector = 1.|[1,Inf]This is a text with a - new-line in it. Selector > 1.', 1], - // with single-quotes and id split accros lines - ['This is a text with a - new-line in it. Selector > 1.', '{0}This is a text with a - new-line in it. Selector = 0.|{1}This is a text with a - new-line in it. Selector = 1.|[1,Inf]This is a text with a - new-line in it. Selector > 1.', 5], - // with single-quotes and \n in text - ['This is a text with a\nnew-line in it. Selector = 0.', '{0}This is a text with a\nnew-line in it. Selector = 0.|{1}This is a text with a\nnew-line in it. Selector = 1.|[1,Inf]This is a text with a\nnew-line in it. Selector > 1.', 0], - // with double-quotes and id split accros lines - ["This is a text with a\nnew-line in it. Selector = 1.", "{0}This is a text with a\nnew-line in it. Selector = 0.|{1}This is a text with a\nnew-line in it. Selector = 1.|[1,Inf]This is a text with a\nnew-line in it. Selector > 1.", 1], - // escape pipe - ['This is a text with | in it. Selector = 0.', '{0}This is a text with || in it. Selector = 0.|{1}This is a text with || in it. Selector = 1.', 0], - // Empty plural set (2 plural forms) from a .PO file - ['', '|', 1], - // Empty plural set (3 plural forms) from a .PO file - ['', '||', 1], - - // Floating values - ['1.5 liters', '%count% liter|%count% liters', 1.5], - ['1.5 litre', '%count% litre|%count% litres', 1.5, 'fr'], - - // Negative values - ['-1 degree', '%count% degree|%count% degrees', -1], - ['-1 degré', '%count% degré|%count% degrés', -1], - ['-1.5 degrees', '%count% degree|%count% degrees', -1.5], - ['-1.5 degré', '%count% degré|%count% degrés', -1.5, 'fr'], - ['-2 degrees', '%count% degree|%count% degrees', -2], - ['-2 degrés', '%count% degré|%count% degrés', -2], - ]; - } - - /** - * @dataProvider failingLangcodes - */ - public function testFailedLangcodes($nplural, $langCodes) - { - $matrix = $this->generateTestData($langCodes); - $this->validateMatrix($nplural, $matrix, false); - } - - /** - * @dataProvider successLangcodes - */ - public function testLangcodes($nplural, $langCodes) - { - $matrix = $this->generateTestData($langCodes); - $this->validateMatrix($nplural, $matrix); - } - - /** - * This array should contain all currently known langcodes. - * - * As it is impossible to have this ever complete we should try as hard as possible to have it almost complete. - */ - public function successLangcodes(): array - { - return [ - ['1', ['ay', 'bo', 'cgg', 'dz', 'id', 'ja', 'jbo', 'ka', 'kk', 'km', 'ko', 'ky']], - ['2', ['nl', 'fr', 'en', 'de', 'de_GE', 'hy', 'hy_AM', 'en_US_POSIX']], - ['3', ['be', 'bs', 'cs', 'hr']], - ['4', ['cy', 'mt', 'sl']], - ['6', ['ar']], - ]; - } - - /** - * This array should be at least empty within the near future. - * - * This both depends on a complete list trying to add above as understanding - * the plural rules of the current failing languages. - * - * @return array with nplural together with langcodes - */ - public function failingLangcodes(): array - { - return [ - ['1', ['fa']], - ['2', ['jbo']], - ['3', ['cbs']], - ['4', ['gd', 'kw']], - ['5', ['ga']], - ]; - } - - /** - * We validate only on the plural coverage. Thus the real rules is not tested. - * - * @param string $nplural Plural expected - * @param array $matrix Containing langcodes and their plural index values - */ - protected function validateMatrix(string $nplural, array $matrix, bool $expectSuccess = true) - { - foreach ($matrix as $langCode => $data) { - $indexes = array_flip($data); - if ($expectSuccess) { - $this->assertCount($nplural, $indexes, "Langcode '$langCode' has '$nplural' plural forms."); - } else { - $this->assertNotEquals((int) $nplural, \count($indexes), "Langcode '$langCode' has '$nplural' plural forms."); - } - } - } - - protected function generateTestData($langCodes) - { - $translator = new class() { - use TranslatorTrait { - getPluralizationRule as public; - } - }; - - $matrix = []; - foreach ($langCodes as $langCode) { - for ($count = 0; $count < 200; ++$count) { - $plural = $translator->getPluralizationRule($count, $langCode); - $matrix[$langCode][$count] = $plural; - } - } - - return $matrix; - } -} diff --git a/vendor/symfony/translation-contracts/TranslatableInterface.php b/vendor/symfony/translation-contracts/TranslatableInterface.php deleted file mode 100644 index 47fd6fa0..00000000 --- a/vendor/symfony/translation-contracts/TranslatableInterface.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. - */ - -namespace Symfony\Contracts\Translation; - -/** - * @author Nicolas Grekas - */ -interface TranslatableInterface -{ - public function trans(TranslatorInterface $translator, string $locale = null): string; -} diff --git a/vendor/symfony/translation-contracts/TranslatorInterface.php b/vendor/symfony/translation-contracts/TranslatorInterface.php deleted file mode 100644 index 018db07e..00000000 --- a/vendor/symfony/translation-contracts/TranslatorInterface.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Translation; - -/** - * @author Fabien Potencier - */ -interface TranslatorInterface -{ - /** - * Translates the given message. - * - * When a number is provided as a parameter named "%count%", the message is parsed for plural - * forms and a translation is chosen according to this number using the following rules: - * - * Given a message with different plural translations separated by a - * pipe (|), this method returns the correct portion of the message based - * on the given number, locale and the pluralization rules in the message - * itself. - * - * The message supports two different types of pluralization rules: - * - * interval: {0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples - * indexed: There is one apple|There are %count% apples - * - * The indexed solution can also contain labels (e.g. one: There is one apple). - * This is purely for making the translations more clear - it does not - * affect the functionality. - * - * The two methods can also be mixed: - * {0} There are no apples|one: There is one apple|more: There are %count% apples - * - * An interval can represent a finite set of numbers: - * {1,2,3,4} - * - * An interval can represent numbers between two numbers: - * [1, +Inf] - * ]-1,2[ - * - * The left delimiter can be [ (inclusive) or ] (exclusive). - * The right delimiter can be [ (exclusive) or ] (inclusive). - * Beside numbers, you can use -Inf and +Inf for the infinite. - * - * @see https://en.wikipedia.org/wiki/ISO_31-11 - * - * @param string $id The message id (may also be an object that can be cast to string) - * @param array $parameters An array of parameters for the message - * @param string|null $domain The domain for the message or null to use the default - * @param string|null $locale The locale or null to use the default - * - * @throws \InvalidArgumentException If the locale contains invalid characters - */ - public function trans(string $id, array $parameters = [], string $domain = null, string $locale = null): string; - - /** - * Returns the default locale. - */ - public function getLocale(): string; -} diff --git a/vendor/symfony/translation-contracts/TranslatorTrait.php b/vendor/symfony/translation-contracts/TranslatorTrait.php deleted file mode 100644 index 46e91707..00000000 --- a/vendor/symfony/translation-contracts/TranslatorTrait.php +++ /dev/null @@ -1,222 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Translation; - -use Symfony\Component\Translation\Exception\InvalidArgumentException; - -/** - * A trait to help implement TranslatorInterface and LocaleAwareInterface. - * - * @author Fabien Potencier - */ -trait TranslatorTrait -{ - private ?string $locale = null; - - public function setLocale(string $locale) - { - $this->locale = $locale; - } - - public function getLocale(): string - { - return $this->locale ?: (class_exists(\Locale::class) ? \Locale::getDefault() : 'en'); - } - - public function trans(?string $id, array $parameters = [], string $domain = null, string $locale = null): string - { - if (null === $id || '' === $id) { - return ''; - } - - if (!isset($parameters['%count%']) || !is_numeric($parameters['%count%'])) { - return strtr($id, $parameters); - } - - $number = (float) $parameters['%count%']; - $locale = $locale ?: $this->getLocale(); - - $parts = []; - if (preg_match('/^\|++$/', $id)) { - $parts = explode('|', $id); - } elseif (preg_match_all('/(?:\|\||[^\|])++/', $id, $matches)) { - $parts = $matches[0]; - } - - $intervalRegexp = <<<'EOF' -/^(?P - ({\s* - (\-?\d+(\.\d+)?[\s*,\s*\-?\d+(\.\d+)?]*) - \s*}) - - | - - (?P[\[\]]) - \s* - (?P-Inf|\-?\d+(\.\d+)?) - \s*,\s* - (?P\+?Inf|\-?\d+(\.\d+)?) - \s* - (?P[\[\]]) -)\s*(?P.*?)$/xs -EOF; - - $standardRules = []; - foreach ($parts as $part) { - $part = trim(str_replace('||', '|', $part)); - - // try to match an explicit rule, then fallback to the standard ones - if (preg_match($intervalRegexp, $part, $matches)) { - if ($matches[2]) { - foreach (explode(',', $matches[3]) as $n) { - if ($number == $n) { - return strtr($matches['message'], $parameters); - } - } - } else { - $leftNumber = '-Inf' === $matches['left'] ? -\INF : (float) $matches['left']; - $rightNumber = is_numeric($matches['right']) ? (float) $matches['right'] : \INF; - - if (('[' === $matches['left_delimiter'] ? $number >= $leftNumber : $number > $leftNumber) - && (']' === $matches['right_delimiter'] ? $number <= $rightNumber : $number < $rightNumber) - ) { - return strtr($matches['message'], $parameters); - } - } - } elseif (preg_match('/^\w+\:\s*(.*?)$/', $part, $matches)) { - $standardRules[] = $matches[1]; - } else { - $standardRules[] = $part; - } - } - - $position = $this->getPluralizationRule($number, $locale); - - if (!isset($standardRules[$position])) { - // when there's exactly one rule given, and that rule is a standard - // rule, use this rule - if (1 === \count($parts) && isset($standardRules[0])) { - return strtr($standardRules[0], $parameters); - } - - $message = sprintf('Unable to choose a translation for "%s" with locale "%s" for value "%d". Double check that this translation has the correct plural options (e.g. "There is one apple|There are %%count%% apples").', $id, $locale, $number); - - if (class_exists(InvalidArgumentException::class)) { - throw new InvalidArgumentException($message); - } - - throw new \InvalidArgumentException($message); - } - - return strtr($standardRules[$position], $parameters); - } - - /** - * Returns the plural position to use for the given locale and number. - * - * The plural rules are derived from code of the Zend Framework (2010-09-25), - * which is subject to the new BSD license (http://framework.zend.com/license/new-bsd). - * Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) - */ - private function getPluralizationRule(float $number, string $locale): int - { - $number = abs($number); - - return match ('pt_BR' !== $locale && 'en_US_POSIX' !== $locale && \strlen($locale) > 3 ? substr($locale, 0, strrpos($locale, '_')) : $locale) { - 'af', - 'bn', - 'bg', - 'ca', - 'da', - 'de', - 'el', - 'en', - 'en_US_POSIX', - 'eo', - 'es', - 'et', - 'eu', - 'fa', - 'fi', - 'fo', - 'fur', - 'fy', - 'gl', - 'gu', - 'ha', - 'he', - 'hu', - 'is', - 'it', - 'ku', - 'lb', - 'ml', - 'mn', - 'mr', - 'nah', - 'nb', - 'ne', - 'nl', - 'nn', - 'no', - 'oc', - 'om', - 'or', - 'pa', - 'pap', - 'ps', - 'pt', - 'so', - 'sq', - 'sv', - 'sw', - 'ta', - 'te', - 'tk', - 'ur', - 'zu' => (1 == $number) ? 0 : 1, - 'am', - 'bh', - 'fil', - 'fr', - 'gun', - 'hi', - 'hy', - 'ln', - 'mg', - 'nso', - 'pt_BR', - 'ti', - 'wa' => ($number < 2) ? 0 : 1, - 'be', - 'bs', - 'hr', - 'ru', - 'sh', - 'sr', - 'uk' => ((1 == $number % 10) && (11 != $number % 100)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2), - 'cs', - 'sk' => (1 == $number) ? 0 : ((($number >= 2) && ($number <= 4)) ? 1 : 2), - 'ga' => (1 == $number) ? 0 : ((2 == $number) ? 1 : 2), - 'lt' => ((1 == $number % 10) && (11 != $number % 100)) ? 0 : ((($number % 10 >= 2) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2), - 'sl' => (1 == $number % 100) ? 0 : ((2 == $number % 100) ? 1 : (((3 == $number % 100) || (4 == $number % 100)) ? 2 : 3)), - 'mk' => (1 == $number % 10) ? 0 : 1, - 'mt' => (1 == $number) ? 0 : (((0 == $number) || (($number % 100 > 1) && ($number % 100 < 11))) ? 1 : ((($number % 100 > 10) && ($number % 100 < 20)) ? 2 : 3)), - 'lv' => (0 == $number) ? 0 : (((1 == $number % 10) && (11 != $number % 100)) ? 1 : 2), - 'pl' => (1 == $number) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 12) || ($number % 100 > 14))) ? 1 : 2), - 'cy' => (1 == $number) ? 0 : ((2 == $number) ? 1 : (((8 == $number) || (11 == $number)) ? 2 : 3)), - 'ro' => (1 == $number) ? 0 : (((0 == $number) || (($number % 100 > 0) && ($number % 100 < 20))) ? 1 : 2), - 'ar' => (0 == $number) ? 0 : ((1 == $number) ? 1 : ((2 == $number) ? 2 : ((($number % 100 >= 3) && ($number % 100 <= 10)) ? 3 : ((($number % 100 >= 11) && ($number % 100 <= 99)) ? 4 : 5)))), - default => 0, - }; - } -} diff --git a/vendor/symfony/translation-contracts/composer.json b/vendor/symfony/translation-contracts/composer.json deleted file mode 100644 index 3454800a..00000000 --- a/vendor/symfony/translation-contracts/composer.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "symfony/translation-contracts", - "type": "library", - "description": "Generic abstractions related to translation", - "keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.1" - }, - "suggest": { - "symfony/translation-implementation": "" - }, - "autoload": { - "psr-4": { "Symfony\\Contracts\\Translation\\": "" }, - "exclude-from-classmap": [ - "/Test/" - ] - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "3.3-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - } -} diff --git a/vendor/symfony/translation/CHANGELOG.md b/vendor/symfony/translation/CHANGELOG.md deleted file mode 100644 index b755fec1..00000000 --- a/vendor/symfony/translation/CHANGELOG.md +++ /dev/null @@ -1,189 +0,0 @@ -CHANGELOG -========= - -6.2 ---- - - * Deprecate `PhpStringTokenParser` - * Deprecate `PhpExtractor` in favor of `PhpAstExtractor` - * Add `PhpAstExtractor` (requires [nikic/php-parser](https://github.com/nikic/php-parser) to be installed) - -6.1 ---- - - * Parameters implementing `TranslatableInterface` are processed - * Add the file extension to the `XliffFileDumper` constructor - -5.4 ---- - - * Add `github` format & autodetection to render errors as annotations when - running the XLIFF linter command in a Github Actions environment. - * Translation providers are not experimental anymore - -5.3 ---- - - * Add `translation:pull` and `translation:push` commands to manage translations with third-party providers - * Add `TranslatorBagInterface::getCatalogues` method - * Add support to load XLIFF string in `XliffFileLoader` - -5.2.0 ------ - - * added support for calling `trans` with ICU formatted messages - * added `PseudoLocalizationTranslator` - * added `TranslatableMessage` objects that represent a message that can be translated - * added the `t()` function to easily create `TranslatableMessage` objects - * Added support for extracting messages from `TranslatableMessage` objects - -5.1.0 ------ - - * added support for `name` attribute on `unit` element from xliff2 to be used as a translation key instead of always the `source` element - -5.0.0 ------ - - * removed support for using `null` as the locale in `Translator` - * removed `TranslatorInterface` - * removed `MessageSelector` - * removed `ChoiceMessageFormatterInterface` - * removed `PluralizationRule` - * removed `Interval` - * removed `transChoice()` methods, use the trans() method instead with a %count% parameter - * removed `FileDumper::setBackup()` and `TranslationWriter::disableBackup()` - * removed `MessageFormatter::choiceFormat()` - * added argument `$filename` to `PhpExtractor::parseTokens()` - * removed support for implicit STDIN usage in the `lint:xliff` command, use `lint:xliff -` (append a dash) instead to make it explicit. - -4.4.0 ------ - - * deprecated support for using `null` as the locale in `Translator` - * deprecated accepting STDIN implicitly when using the `lint:xliff` command, use `lint:xliff -` (append a dash) instead to make it explicit. - * Marked the `TranslationDataCollector` class as `@final`. - -4.3.0 ------ - - * Improved Xliff 1.2 loader to load the original file's metadata - * Added `TranslatorPathsPass` - -4.2.0 ------ - - * Started using ICU parent locales as fallback locales. - * allow using the ICU message format using domains with the "+intl-icu" suffix - * deprecated `Translator::transChoice()` in favor of using `Translator::trans()` with a `%count%` parameter - * deprecated `TranslatorInterface` in favor of `Symfony\Contracts\Translation\TranslatorInterface` - * deprecated `MessageSelector`, `Interval` and `PluralizationRules`; use `IdentityTranslator` instead - * Added `IntlFormatter` and `IntlFormatterInterface` - * added support for multiple files and directories in `XliffLintCommand` - * Marked `Translator::getFallbackLocales()` and `TranslationDataCollector::getFallbackLocales()` as internal - -4.1.0 ------ - - * The `FileDumper::setBackup()` method is deprecated. - * The `TranslationWriter::disableBackup()` method is deprecated. - * The `XliffFileDumper` will write "name" on the "unit" node when dumping XLIFF 2.0. - -4.0.0 ------ - - * removed the backup feature of the `FileDumper` class - * removed `TranslationWriter::writeTranslations()` method - * removed support for passing `MessageSelector` instances to the constructor of the `Translator` class - -3.4.0 ------ - - * Added `TranslationDumperPass` - * Added `TranslationExtractorPass` - * Added `TranslatorPass` - * Added `TranslationReader` and `TranslationReaderInterface` - * Added `` section to the Xliff 2.0 dumper. - * Improved Xliff 2.0 loader to load `` section. - * Added `TranslationWriterInterface` - * Deprecated `TranslationWriter::writeTranslations` in favor of `TranslationWriter::write` - * added support for adding custom message formatter and decoupling the default one. - * Added `PhpExtractor` - * Added `PhpStringTokenParser` - -3.2.0 ------ - - * Added support for escaping `|` in plural translations with double pipe. - -3.1.0 ------ - - * Deprecated the backup feature of the file dumper classes. - -3.0.0 ------ - - * removed `FileDumper::format()` method. - * Changed the visibility of the locale property in `Translator` from protected to private. - -2.8.0 ------ - - * deprecated FileDumper::format(), overwrite FileDumper::formatCatalogue() instead. - * deprecated Translator::getMessages(), rely on TranslatorBagInterface::getCatalogue() instead. - * added `FileDumper::formatCatalogue` which allows format the catalogue without dumping it into file. - * added option `json_encoding` to JsonFileDumper - * added options `as_tree`, `inline` to YamlFileDumper - * added support for XLIFF 2.0. - * added support for XLIFF target and tool attributes. - * added message parameters to DataCollectorTranslator. - * [DEPRECATION] The `DiffOperation` class has been deprecated and - will be removed in Symfony 3.0, since its operation has nothing to do with 'diff', - so the class name is misleading. The `TargetOperation` class should be used for - this use-case instead. - -2.7.0 ------ - - * added DataCollectorTranslator for collecting the translated messages. - -2.6.0 ------ - - * added possibility to cache catalogues - * added TranslatorBagInterface - * added LoggingTranslator - * added Translator::getMessages() for retrieving the message catalogue as an array - -2.5.0 ------ - - * added relative file path template to the file dumpers - * added optional backup to the file dumpers - * changed IcuResFileDumper to extend FileDumper - -2.3.0 ------ - - * added classes to make operations on catalogues (like making a diff or a merge on 2 catalogues) - * added Translator::getFallbackLocales() - * deprecated Translator::setFallbackLocale() in favor of the new Translator::setFallbackLocales() method - -2.2.0 ------ - - * QtTranslationsLoader class renamed to QtFileLoader. QtTranslationsLoader is deprecated and will be removed in 2.3. - * [BC BREAK] uniformized the exception thrown by the load() method when an error occurs. The load() method now - throws Symfony\Component\Translation\Exception\NotFoundResourceException when a resource cannot be found - and Symfony\Component\Translation\Exception\InvalidResourceException when a resource is invalid. - * changed the exception class thrown by some load() methods from \RuntimeException to \InvalidArgumentException - (IcuDatFileLoader, IcuResFileLoader and QtFileLoader) - -2.1.0 ------ - - * added support for more than one fallback locale - * added support for extracting translation messages from templates (Twig and PHP) - * added dumpers for translation catalogs - * added support for QT, gettext, and ResourceBundles diff --git a/vendor/symfony/translation/Catalogue/AbstractOperation.php b/vendor/symfony/translation/Catalogue/AbstractOperation.php deleted file mode 100644 index 419ba95e..00000000 --- a/vendor/symfony/translation/Catalogue/AbstractOperation.php +++ /dev/null @@ -1,188 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Catalogue; - -use Symfony\Component\Translation\Exception\InvalidArgumentException; -use Symfony\Component\Translation\Exception\LogicException; -use Symfony\Component\Translation\MessageCatalogue; -use Symfony\Component\Translation\MessageCatalogueInterface; - -/** - * Base catalogues binary operation class. - * - * A catalogue binary operation performs operation on - * source (the left argument) and target (the right argument) catalogues. - * - * @author Jean-François Simon - */ -abstract class AbstractOperation implements OperationInterface -{ - public const OBSOLETE_BATCH = 'obsolete'; - public const NEW_BATCH = 'new'; - public const ALL_BATCH = 'all'; - - protected $source; - protected $target; - protected $result; - - /** - * @var array|null The domains affected by this operation - */ - private $domains; - - /** - * This array stores 'all', 'new' and 'obsolete' messages for all valid domains. - * - * The data structure of this array is as follows: - * - * [ - * 'domain 1' => [ - * 'all' => [...], - * 'new' => [...], - * 'obsolete' => [...] - * ], - * 'domain 2' => [ - * 'all' => [...], - * 'new' => [...], - * 'obsolete' => [...] - * ], - * ... - * ] - * - * @var array The array that stores 'all', 'new' and 'obsolete' messages - */ - protected $messages; - - /** - * @throws LogicException - */ - public function __construct(MessageCatalogueInterface $source, MessageCatalogueInterface $target) - { - if ($source->getLocale() !== $target->getLocale()) { - throw new LogicException('Operated catalogues must belong to the same locale.'); - } - - $this->source = $source; - $this->target = $target; - $this->result = new MessageCatalogue($source->getLocale()); - $this->messages = []; - } - - public function getDomains(): array - { - if (null === $this->domains) { - $domains = []; - foreach ([$this->source, $this->target] as $catalogue) { - foreach ($catalogue->getDomains() as $domain) { - $domains[$domain] = $domain; - - if ($catalogue->all($domainIcu = $domain.MessageCatalogueInterface::INTL_DOMAIN_SUFFIX)) { - $domains[$domainIcu] = $domainIcu; - } - } - } - - $this->domains = array_values($domains); - } - - return $this->domains; - } - - public function getMessages(string $domain): array - { - if (!\in_array($domain, $this->getDomains())) { - throw new InvalidArgumentException(sprintf('Invalid domain: "%s".', $domain)); - } - - if (!isset($this->messages[$domain][self::ALL_BATCH])) { - $this->processDomain($domain); - } - - return $this->messages[$domain][self::ALL_BATCH]; - } - - public function getNewMessages(string $domain): array - { - if (!\in_array($domain, $this->getDomains())) { - throw new InvalidArgumentException(sprintf('Invalid domain: "%s".', $domain)); - } - - if (!isset($this->messages[$domain][self::NEW_BATCH])) { - $this->processDomain($domain); - } - - return $this->messages[$domain][self::NEW_BATCH]; - } - - public function getObsoleteMessages(string $domain): array - { - if (!\in_array($domain, $this->getDomains())) { - throw new InvalidArgumentException(sprintf('Invalid domain: "%s".', $domain)); - } - - if (!isset($this->messages[$domain][self::OBSOLETE_BATCH])) { - $this->processDomain($domain); - } - - return $this->messages[$domain][self::OBSOLETE_BATCH]; - } - - public function getResult(): MessageCatalogueInterface - { - foreach ($this->getDomains() as $domain) { - if (!isset($this->messages[$domain])) { - $this->processDomain($domain); - } - } - - return $this->result; - } - - /** - * @param self::*_BATCH $batch - */ - public function moveMessagesToIntlDomainsIfPossible(string $batch = self::ALL_BATCH): void - { - // If MessageFormatter class does not exists, intl domains are not supported. - if (!class_exists(\MessageFormatter::class)) { - return; - } - - foreach ($this->getDomains() as $domain) { - $intlDomain = $domain.MessageCatalogueInterface::INTL_DOMAIN_SUFFIX; - $messages = match ($batch) { - self::OBSOLETE_BATCH => $this->getObsoleteMessages($domain), - self::NEW_BATCH => $this->getNewMessages($domain), - self::ALL_BATCH => $this->getMessages($domain), - default => throw new \InvalidArgumentException(sprintf('$batch argument must be one of ["%s", "%s", "%s"].', self::ALL_BATCH, self::NEW_BATCH, self::OBSOLETE_BATCH)), - }; - - if (!$messages || (!$this->source->all($intlDomain) && $this->source->all($domain))) { - continue; - } - - $result = $this->getResult(); - $allIntlMessages = $result->all($intlDomain); - $currentMessages = array_diff_key($messages, $result->all($domain)); - $result->replace($currentMessages, $domain); - $result->replace($allIntlMessages + $messages, $intlDomain); - } - } - - /** - * Performs operation on source and target catalogues for the given domain and - * stores the results. - * - * @param string $domain The domain which the operation will be performed for - */ - abstract protected function processDomain(string $domain); -} diff --git a/vendor/symfony/translation/Catalogue/MergeOperation.php b/vendor/symfony/translation/Catalogue/MergeOperation.php deleted file mode 100644 index 7a0ce234..00000000 --- a/vendor/symfony/translation/Catalogue/MergeOperation.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\Translation\Catalogue; - -use Symfony\Component\Translation\MessageCatalogueInterface; - -/** - * Merge operation between two catalogues as follows: - * all = source ∪ target = {x: x ∈ source ∨ x ∈ target} - * new = all ∖ source = {x: x ∈ target ∧ x ∉ source} - * obsolete = source ∖ all = {x: x ∈ source ∧ x ∉ source ∧ x ∉ target} = ∅ - * Basically, the result contains messages from both catalogues. - * - * @author Jean-François Simon - */ -class MergeOperation extends AbstractOperation -{ - protected function processDomain(string $domain) - { - $this->messages[$domain] = [ - 'all' => [], - 'new' => [], - 'obsolete' => [], - ]; - $intlDomain = $domain.MessageCatalogueInterface::INTL_DOMAIN_SUFFIX; - - foreach ($this->target->getCatalogueMetadata('', $domain) ?? [] as $key => $value) { - if (null === $this->result->getCatalogueMetadata($key, $domain)) { - $this->result->setCatalogueMetadata($key, $value, $domain); - } - } - - foreach ($this->target->getCatalogueMetadata('', $intlDomain) ?? [] as $key => $value) { - if (null === $this->result->getCatalogueMetadata($key, $intlDomain)) { - $this->result->setCatalogueMetadata($key, $value, $intlDomain); - } - } - - foreach ($this->source->all($domain) as $id => $message) { - $this->messages[$domain]['all'][$id] = $message; - $d = $this->source->defines($id, $intlDomain) ? $intlDomain : $domain; - $this->result->add([$id => $message], $d); - if (null !== $keyMetadata = $this->source->getMetadata($id, $d)) { - $this->result->setMetadata($id, $keyMetadata, $d); - } - } - - foreach ($this->target->all($domain) as $id => $message) { - if (!$this->source->has($id, $domain)) { - $this->messages[$domain]['all'][$id] = $message; - $this->messages[$domain]['new'][$id] = $message; - $d = $this->target->defines($id, $intlDomain) ? $intlDomain : $domain; - $this->result->add([$id => $message], $d); - if (null !== $keyMetadata = $this->target->getMetadata($id, $d)) { - $this->result->setMetadata($id, $keyMetadata, $d); - } - } - } - } -} diff --git a/vendor/symfony/translation/Catalogue/OperationInterface.php b/vendor/symfony/translation/Catalogue/OperationInterface.php deleted file mode 100644 index 1fe9534e..00000000 --- a/vendor/symfony/translation/Catalogue/OperationInterface.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Catalogue; - -use Symfony\Component\Translation\MessageCatalogueInterface; - -/** - * Represents an operation on catalogue(s). - * - * An instance of this interface performs an operation on one or more catalogues and - * stores intermediate and final results of the operation. - * - * The first catalogue in its argument(s) is called the 'source catalogue' or 'source' and - * the following results are stored: - * - * Messages: also called 'all', are valid messages for the given domain after the operation is performed. - * - * New Messages: also called 'new' (new = all ∖ source = {x: x ∈ all ∧ x ∉ source}). - * - * Obsolete Messages: also called 'obsolete' (obsolete = source ∖ all = {x: x ∈ source ∧ x ∉ all}). - * - * Result: also called 'result', is the resulting catalogue for the given domain that holds the same messages as 'all'. - * - * @author Jean-François Simon - */ -interface OperationInterface -{ - /** - * Returns domains affected by operation. - */ - public function getDomains(): array; - - /** - * Returns all valid messages ('all') after operation. - */ - public function getMessages(string $domain): array; - - /** - * Returns new messages ('new') after operation. - */ - public function getNewMessages(string $domain): array; - - /** - * Returns obsolete messages ('obsolete') after operation. - */ - public function getObsoleteMessages(string $domain): array; - - /** - * Returns resulting catalogue ('result'). - */ - public function getResult(): MessageCatalogueInterface; -} diff --git a/vendor/symfony/translation/Catalogue/TargetOperation.php b/vendor/symfony/translation/Catalogue/TargetOperation.php deleted file mode 100644 index 6ab60c33..00000000 --- a/vendor/symfony/translation/Catalogue/TargetOperation.php +++ /dev/null @@ -1,83 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Catalogue; - -use Symfony\Component\Translation\MessageCatalogueInterface; - -/** - * Target operation between two catalogues: - * intersection = source ∩ target = {x: x ∈ source ∧ x ∈ target} - * all = intersection ∪ (target ∖ intersection) = target - * new = all ∖ source = {x: x ∈ target ∧ x ∉ source} - * obsolete = source ∖ all = source ∖ target = {x: x ∈ source ∧ x ∉ target} - * Basically, the result contains messages from the target catalogue. - * - * @author Michael Lee - */ -class TargetOperation extends AbstractOperation -{ - protected function processDomain(string $domain) - { - $this->messages[$domain] = [ - 'all' => [], - 'new' => [], - 'obsolete' => [], - ]; - $intlDomain = $domain.MessageCatalogueInterface::INTL_DOMAIN_SUFFIX; - - foreach ($this->target->getCatalogueMetadata('', $domain) ?? [] as $key => $value) { - if (null === $this->result->getCatalogueMetadata($key, $domain)) { - $this->result->setCatalogueMetadata($key, $value, $domain); - } - } - - foreach ($this->target->getCatalogueMetadata('', $intlDomain) ?? [] as $key => $value) { - if (null === $this->result->getCatalogueMetadata($key, $intlDomain)) { - $this->result->setCatalogueMetadata($key, $value, $intlDomain); - } - } - - // For 'all' messages, the code can't be simplified as ``$this->messages[$domain]['all'] = $target->all($domain);``, - // because doing so will drop messages like {x: x ∈ source ∧ x ∉ target.all ∧ x ∈ target.fallback} - // - // For 'new' messages, the code can't be simplified as ``array_diff_assoc($this->target->all($domain), $this->source->all($domain));`` - // because doing so will not exclude messages like {x: x ∈ target ∧ x ∉ source.all ∧ x ∈ source.fallback} - // - // For 'obsolete' messages, the code can't be simplified as ``array_diff_assoc($this->source->all($domain), $this->target->all($domain))`` - // because doing so will not exclude messages like {x: x ∈ source ∧ x ∉ target.all ∧ x ∈ target.fallback} - - foreach ($this->source->all($domain) as $id => $message) { - if ($this->target->has($id, $domain)) { - $this->messages[$domain]['all'][$id] = $message; - $d = $this->source->defines($id, $intlDomain) ? $intlDomain : $domain; - $this->result->add([$id => $message], $d); - if (null !== $keyMetadata = $this->source->getMetadata($id, $d)) { - $this->result->setMetadata($id, $keyMetadata, $d); - } - } else { - $this->messages[$domain]['obsolete'][$id] = $message; - } - } - - foreach ($this->target->all($domain) as $id => $message) { - if (!$this->source->has($id, $domain)) { - $this->messages[$domain]['all'][$id] = $message; - $this->messages[$domain]['new'][$id] = $message; - $d = $this->target->defines($id, $intlDomain) ? $intlDomain : $domain; - $this->result->add([$id => $message], $d); - if (null !== $keyMetadata = $this->target->getMetadata($id, $d)) { - $this->result->setMetadata($id, $keyMetadata, $d); - } - } - } - } -} diff --git a/vendor/symfony/translation/CatalogueMetadataAwareInterface.php b/vendor/symfony/translation/CatalogueMetadataAwareInterface.php deleted file mode 100644 index 7e76857d..00000000 --- a/vendor/symfony/translation/CatalogueMetadataAwareInterface.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation; - -/** - * This interface is used to get, set, and delete metadata about the Catalogue. - * - * @author Hugo Alliaume - */ -interface CatalogueMetadataAwareInterface -{ - /** - * Gets catalogue metadata for the given domain and key. - * - * Passing an empty domain will return an array with all catalogue metadata indexed by - * domain and then by key. Passing an empty key will return an array with all - * catalogue metadata for the given domain. - * - * @return mixed The value that was set or an array with the domains/keys or null - */ - public function getCatalogueMetadata(string $key = '', string $domain = 'messages'): mixed; - - /** - * Adds catalogue metadata to a message domain. - */ - public function setCatalogueMetadata(string $key, mixed $value, string $domain = 'messages'); - - /** - * Deletes catalogue metadata for the given key and domain. - * - * Passing an empty domain will delete all catalogue metadata. Passing an empty key will - * delete all metadata for the given domain. - */ - public function deleteCatalogueMetadata(string $key = '', string $domain = 'messages'); -} diff --git a/vendor/symfony/translation/Command/TranslationPullCommand.php b/vendor/symfony/translation/Command/TranslationPullCommand.php deleted file mode 100644 index 225deba9..00000000 --- a/vendor/symfony/translation/Command/TranslationPullCommand.php +++ /dev/null @@ -1,180 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Command; - -use Symfony\Component\Console\Attribute\AsCommand; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Input\InputArgument; -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\Translation\Catalogue\TargetOperation; -use Symfony\Component\Translation\MessageCatalogue; -use Symfony\Component\Translation\Provider\TranslationProviderCollection; -use Symfony\Component\Translation\Reader\TranslationReaderInterface; -use Symfony\Component\Translation\Writer\TranslationWriterInterface; - -/** - * @author Mathieu Santostefano - */ -#[AsCommand(name: 'translation:pull', description: 'Pull translations from a given provider.')] -final class TranslationPullCommand extends Command -{ - use TranslationTrait; - - private TranslationProviderCollection $providerCollection; - private TranslationWriterInterface $writer; - private TranslationReaderInterface $reader; - private string $defaultLocale; - private array $transPaths; - private array $enabledLocales; - - public function __construct(TranslationProviderCollection $providerCollection, TranslationWriterInterface $writer, TranslationReaderInterface $reader, string $defaultLocale, array $transPaths = [], array $enabledLocales = []) - { - $this->providerCollection = $providerCollection; - $this->writer = $writer; - $this->reader = $reader; - $this->defaultLocale = $defaultLocale; - $this->transPaths = $transPaths; - $this->enabledLocales = $enabledLocales; - - parent::__construct(); - } - - public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void - { - if ($input->mustSuggestArgumentValuesFor('provider')) { - $suggestions->suggestValues($this->providerCollection->keys()); - - return; - } - - if ($input->mustSuggestOptionValuesFor('domains')) { - $provider = $this->providerCollection->get($input->getArgument('provider')); - - if (method_exists($provider, 'getDomains')) { - $suggestions->suggestValues($provider->getDomains()); - } - - return; - } - - if ($input->mustSuggestOptionValuesFor('locales')) { - $suggestions->suggestValues($this->enabledLocales); - - return; - } - - if ($input->mustSuggestOptionValuesFor('format')) { - $suggestions->suggestValues(['php', 'xlf', 'xlf12', 'xlf20', 'po', 'mo', 'yml', 'yaml', 'ts', 'csv', 'json', 'ini', 'res']); - } - } - - protected function configure() - { - $keys = $this->providerCollection->keys(); - $defaultProvider = 1 === \count($keys) ? $keys[0] : null; - - $this - ->setDefinition([ - new InputArgument('provider', null !== $defaultProvider ? InputArgument::OPTIONAL : InputArgument::REQUIRED, 'The provider to pull translations from.', $defaultProvider), - new InputOption('force', null, InputOption::VALUE_NONE, 'Override existing translations with provider ones (it will delete not synchronized messages).'), - new InputOption('intl-icu', null, InputOption::VALUE_NONE, 'Associated to --force option, it will write messages in "%domain%+intl-icu.%locale%.xlf" files.'), - new InputOption('domains', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'Specify the domains to pull.'), - new InputOption('locales', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'Specify the locales to pull.'), - new InputOption('format', null, InputOption::VALUE_OPTIONAL, 'Override the default output format.', 'xlf12'), - ]) - ->setHelp(<<<'EOF' -The %command.name% command pulls translations from the given provider. Only -new translations are pulled, existing ones are not overwritten. - -You can overwrite existing translations (and remove the missing ones on local side) by using the --force flag: - - php %command.full_name% --force provider - -Full example: - - php %command.full_name% provider --force --domains=messages --domains=validators --locales=en - -This command pulls all translations associated with the messages and validators domains for the en locale. -Local translations for the specified domains and locale are deleted if they're not present on the provider and overwritten if it's the case. -Local translations for others domains and locales are ignored. -EOF - ) - ; - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $io = new SymfonyStyle($input, $output); - - $provider = $this->providerCollection->get($input->getArgument('provider')); - $force = $input->getOption('force'); - $intlIcu = $input->getOption('intl-icu'); - $locales = $input->getOption('locales') ?: $this->enabledLocales; - $domains = $input->getOption('domains'); - $format = $input->getOption('format'); - $xliffVersion = '1.2'; - - if ($intlIcu && !$force) { - $io->note('--intl-icu option only has an effect when used with --force. Here, it will be ignored.'); - } - - switch ($format) { - case 'xlf20': $xliffVersion = '2.0'; - // no break - case 'xlf12': $format = 'xlf'; - } - - $writeOptions = [ - 'path' => end($this->transPaths), - 'xliff_version' => $xliffVersion, - 'default_locale' => $this->defaultLocale, - ]; - - if (!$domains) { - $domains = $provider->getDomains(); - } - - $providerTranslations = $provider->read($domains, $locales); - - if ($force) { - foreach ($providerTranslations->getCatalogues() as $catalogue) { - $operation = new TargetOperation(new MessageCatalogue($catalogue->getLocale()), $catalogue); - if ($intlIcu) { - $operation->moveMessagesToIntlDomainsIfPossible(); - } - $this->writer->write($operation->getResult(), $format, $writeOptions); - } - - $io->success(sprintf('Local translations has been updated from "%s" (for "%s" locale(s), and "%s" domain(s)).', parse_url($provider, \PHP_URL_SCHEME), implode(', ', $locales), implode(', ', $domains))); - - return 0; - } - - $localTranslations = $this->readLocalTranslations($locales, $domains, $this->transPaths); - - // Append pulled translations to local ones. - $localTranslations->addBag($providerTranslations->diff($localTranslations)); - - foreach ($localTranslations->getCatalogues() as $catalogue) { - $this->writer->write($catalogue, $format, $writeOptions); - } - - $io->success(sprintf('New translations from "%s" has been written locally (for "%s" locale(s), and "%s" domain(s)).', parse_url($provider, \PHP_URL_SCHEME), implode(', ', $locales), implode(', ', $domains))); - - return 0; - } -} diff --git a/vendor/symfony/translation/Command/TranslationPushCommand.php b/vendor/symfony/translation/Command/TranslationPushCommand.php deleted file mode 100644 index 42799e00..00000000 --- a/vendor/symfony/translation/Command/TranslationPushCommand.php +++ /dev/null @@ -1,182 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Command; - -use Symfony\Component\Console\Attribute\AsCommand; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Input\InputArgument; -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\Translation\Provider\FilteringProvider; -use Symfony\Component\Translation\Provider\TranslationProviderCollection; -use Symfony\Component\Translation\Reader\TranslationReaderInterface; -use Symfony\Component\Translation\TranslatorBag; - -/** - * @author Mathieu Santostefano - */ -#[AsCommand(name: 'translation:push', description: 'Push translations to a given provider.')] -final class TranslationPushCommand extends Command -{ - use TranslationTrait; - - private TranslationProviderCollection $providers; - private TranslationReaderInterface $reader; - private array $transPaths; - private array $enabledLocales; - - public function __construct(TranslationProviderCollection $providers, TranslationReaderInterface $reader, array $transPaths = [], array $enabledLocales = []) - { - $this->providers = $providers; - $this->reader = $reader; - $this->transPaths = $transPaths; - $this->enabledLocales = $enabledLocales; - - parent::__construct(); - } - - public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void - { - if ($input->mustSuggestArgumentValuesFor('provider')) { - $suggestions->suggestValues($this->providers->keys()); - - return; - } - - if ($input->mustSuggestOptionValuesFor('domains')) { - $provider = $this->providers->get($input->getArgument('provider')); - - if ($provider && method_exists($provider, 'getDomains')) { - $domains = $provider->getDomains(); - $suggestions->suggestValues($domains); - } - - return; - } - - if ($input->mustSuggestOptionValuesFor('locales')) { - $suggestions->suggestValues($this->enabledLocales); - } - } - - protected function configure() - { - $keys = $this->providers->keys(); - $defaultProvider = 1 === \count($keys) ? $keys[0] : null; - - $this - ->setDefinition([ - new InputArgument('provider', null !== $defaultProvider ? InputArgument::OPTIONAL : InputArgument::REQUIRED, 'The provider to push translations to.', $defaultProvider), - new InputOption('force', null, InputOption::VALUE_NONE, 'Override existing translations with local ones (it will delete not synchronized messages).'), - new InputOption('delete-missing', null, InputOption::VALUE_NONE, 'Delete translations available on provider but not locally.'), - new InputOption('domains', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'Specify the domains to push.'), - new InputOption('locales', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'Specify the locales to push.', $this->enabledLocales), - ]) - ->setHelp(<<<'EOF' -The %command.name% command pushes translations to the given provider. Only new -translations are pushed, existing ones are not overwritten. - -You can overwrite existing translations by using the --force flag: - - php %command.full_name% --force provider - -You can delete provider translations which are not present locally by using the --delete-missing flag: - - php %command.full_name% --delete-missing provider - -Full example: - - php %command.full_name% provider --force --delete-missing --domains=messages --domains=validators --locales=en - -This command pushes all translations associated with the messages and validators domains for the en locale. -Provider translations for the specified domains and locale are deleted if they're not present locally and overwritten if it's the case. -Provider translations for others domains and locales are ignored. -EOF - ) - ; - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $provider = $this->providers->get($input->getArgument('provider')); - - if (!$this->enabledLocales) { - throw new InvalidArgumentException(sprintf('You must define "framework.translator.enabled_locales" or "framework.translator.providers.%s.locales" config key in order to work with translation providers.', parse_url($provider, \PHP_URL_SCHEME))); - } - - $io = new SymfonyStyle($input, $output); - $domains = $input->getOption('domains'); - $locales = $input->getOption('locales'); - $force = $input->getOption('force'); - $deleteMissing = $input->getOption('delete-missing'); - - if (!$domains && $provider instanceof FilteringProvider) { - $domains = $provider->getDomains(); - } - - // Reading local translations must be done after retrieving the domains from the provider - // in order to manage only translations from configured domains - $localTranslations = $this->readLocalTranslations($locales, $domains, $this->transPaths); - - if (!$domains) { - $domains = $this->getDomainsFromTranslatorBag($localTranslations); - } - - if (!$deleteMissing && $force) { - $provider->write($localTranslations); - - $io->success(sprintf('All local translations has been sent to "%s" (for "%s" locale(s), and "%s" domain(s)).', parse_url($provider, \PHP_URL_SCHEME), implode(', ', $locales), implode(', ', $domains))); - - return 0; - } - - $providerTranslations = $provider->read($domains, $locales); - - if ($deleteMissing) { - $provider->delete($providerTranslations->diff($localTranslations)); - - $io->success(sprintf('Missing translations on "%s" has been deleted (for "%s" locale(s), and "%s" domain(s)).', parse_url($provider, \PHP_URL_SCHEME), implode(', ', $locales), implode(', ', $domains))); - - // Read provider translations again, after missing translations deletion, - // to avoid push freshly deleted translations. - $providerTranslations = $provider->read($domains, $locales); - } - - $translationsToWrite = $localTranslations->diff($providerTranslations); - - if ($force) { - $translationsToWrite->addBag($localTranslations->intersect($providerTranslations)); - } - - $provider->write($translationsToWrite); - - $io->success(sprintf('%s local translations has been sent to "%s" (for "%s" locale(s), and "%s" domain(s)).', $force ? 'All' : 'New', parse_url($provider, \PHP_URL_SCHEME), implode(', ', $locales), implode(', ', $domains))); - - return 0; - } - - private function getDomainsFromTranslatorBag(TranslatorBag $translatorBag): array - { - $domains = []; - - foreach ($translatorBag->getCatalogues() as $catalogue) { - $domains += $catalogue->getDomains(); - } - - return array_unique($domains); - } -} diff --git a/vendor/symfony/translation/Command/TranslationTrait.php b/vendor/symfony/translation/Command/TranslationTrait.php deleted file mode 100644 index eafaffd3..00000000 --- a/vendor/symfony/translation/Command/TranslationTrait.php +++ /dev/null @@ -1,77 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Command; - -use Symfony\Component\Translation\MessageCatalogue; -use Symfony\Component\Translation\MessageCatalogueInterface; -use Symfony\Component\Translation\TranslatorBag; - -/** - * @internal - */ -trait TranslationTrait -{ - private function readLocalTranslations(array $locales, array $domains, array $transPaths): TranslatorBag - { - $bag = new TranslatorBag(); - - foreach ($locales as $locale) { - $catalogue = new MessageCatalogue($locale); - foreach ($transPaths as $path) { - $this->reader->read($path, $catalogue); - } - - if ($domains) { - foreach ($domains as $domain) { - $bag->addCatalogue($this->filterCatalogue($catalogue, $domain)); - } - } else { - $bag->addCatalogue($catalogue); - } - } - - return $bag; - } - - private function filterCatalogue(MessageCatalogue $catalogue, string $domain): MessageCatalogue - { - $filteredCatalogue = new MessageCatalogue($catalogue->getLocale()); - - // extract intl-icu messages only - $intlDomain = $domain.MessageCatalogueInterface::INTL_DOMAIN_SUFFIX; - if ($intlMessages = $catalogue->all($intlDomain)) { - $filteredCatalogue->add($intlMessages, $intlDomain); - } - - // extract all messages and subtract intl-icu messages - if ($messages = array_diff($catalogue->all($domain), $intlMessages)) { - $filteredCatalogue->add($messages, $domain); - } - foreach ($catalogue->getResources() as $resource) { - $filteredCatalogue->addResource($resource); - } - - if ($metadata = $catalogue->getMetadata('', $intlDomain)) { - foreach ($metadata as $k => $v) { - $filteredCatalogue->setMetadata($k, $v, $intlDomain); - } - } - - if ($metadata = $catalogue->getMetadata('', $domain)) { - foreach ($metadata as $k => $v) { - $filteredCatalogue->setMetadata($k, $v, $domain); - } - } - - return $filteredCatalogue; - } -} diff --git a/vendor/symfony/translation/Command/XliffLintCommand.php b/vendor/symfony/translation/Command/XliffLintCommand.php deleted file mode 100644 index 1e5f26c6..00000000 --- a/vendor/symfony/translation/Command/XliffLintCommand.php +++ /dev/null @@ -1,275 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Command; - -use Symfony\Component\Console\Attribute\AsCommand; -use Symfony\Component\Console\CI\GithubActionReporter; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Exception\RuntimeException; -use Symfony\Component\Console\Input\InputArgument; -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\Translation\Exception\InvalidArgumentException; -use Symfony\Component\Translation\Util\XliffUtils; - -/** - * Validates XLIFF files syntax and outputs encountered errors. - * - * @author Grégoire Pineau - * @author Robin Chalas - * @author Javier Eguiluz - */ -#[AsCommand(name: 'lint:xliff', description: 'Lint an XLIFF file and outputs encountered errors')] -class XliffLintCommand extends Command -{ - private string $format; - private bool $displayCorrectFiles; - private ?\Closure $directoryIteratorProvider; - private ?\Closure $isReadableProvider; - private bool $requireStrictFileNames; - - public function __construct(string $name = null, callable $directoryIteratorProvider = null, callable $isReadableProvider = null, bool $requireStrictFileNames = true) - { - parent::__construct($name); - - $this->directoryIteratorProvider = null === $directoryIteratorProvider ? null : $directoryIteratorProvider(...); - $this->isReadableProvider = null === $isReadableProvider ? null : $isReadableProvider(...); - $this->requireStrictFileNames = $requireStrictFileNames; - } - - protected function configure() - { - $this - ->addArgument('filename', InputArgument::IS_ARRAY, 'A file, a directory or "-" for reading from STDIN') - ->addOption('format', null, InputOption::VALUE_REQUIRED, 'The output format') - ->setHelp(<<%command.name% command lints an XLIFF file and outputs to STDOUT -the first encountered syntax error. - -You can validates XLIFF contents passed from STDIN: - - cat filename | php %command.full_name% - - -You can also validate the syntax of a file: - - php %command.full_name% filename - -Or of a whole directory: - - php %command.full_name% dirname - php %command.full_name% dirname --format=json - -EOF - ) - ; - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $io = new SymfonyStyle($input, $output); - $filenames = (array) $input->getArgument('filename'); - $this->format = $input->getOption('format') ?? (GithubActionReporter::isGithubActionEnvironment() ? 'github' : 'txt'); - $this->displayCorrectFiles = $output->isVerbose(); - - if (['-'] === $filenames) { - return $this->display($io, [$this->validate(file_get_contents('php://stdin'))]); - } - - if (!$filenames) { - throw new RuntimeException('Please provide a filename or pipe file content to STDIN.'); - } - - $filesInfo = []; - foreach ($filenames as $filename) { - if (!$this->isReadable($filename)) { - throw new RuntimeException(sprintf('File or directory "%s" is not readable.', $filename)); - } - - foreach ($this->getFiles($filename) as $file) { - $filesInfo[] = $this->validate(file_get_contents($file), $file); - } - } - - return $this->display($io, $filesInfo); - } - - private function validate(string $content, string $file = null): array - { - $errors = []; - - // Avoid: Warning DOMDocument::loadXML(): Empty string supplied as input - if ('' === trim($content)) { - return ['file' => $file, 'valid' => true]; - } - - $internal = libxml_use_internal_errors(true); - - $document = new \DOMDocument(); - $document->loadXML($content); - - if (null !== $targetLanguage = $this->getTargetLanguageFromFile($document)) { - $normalizedLocalePattern = sprintf('(%s|%s)', preg_quote($targetLanguage, '/'), preg_quote(str_replace('-', '_', $targetLanguage), '/')); - // strict file names require translation files to be named '____.locale.xlf' - // otherwise, both '____.locale.xlf' and 'locale.____.xlf' are allowed - // also, the regexp matching must be case-insensitive, as defined for 'target-language' values - // http://docs.oasis-open.org/xliff/v1.2/os/xliff-core.html#target-language - $expectedFilenamePattern = $this->requireStrictFileNames ? sprintf('/^.*\.(?i:%s)\.(?:xlf|xliff)/', $normalizedLocalePattern) : sprintf('/^(?:.*\.(?i:%s)|(?i:%s)\..*)\.(?:xlf|xliff)/', $normalizedLocalePattern, $normalizedLocalePattern); - - if (0 === preg_match($expectedFilenamePattern, basename($file))) { - $errors[] = [ - 'line' => -1, - 'column' => -1, - 'message' => sprintf('There is a mismatch between the language included in the file name ("%s") and the "%s" value used in the "target-language" attribute of the file.', basename($file), $targetLanguage), - ]; - } - } - - foreach (XliffUtils::validateSchema($document) as $xmlError) { - $errors[] = [ - 'line' => $xmlError['line'], - 'column' => $xmlError['column'], - 'message' => $xmlError['message'], - ]; - } - - libxml_clear_errors(); - libxml_use_internal_errors($internal); - - return ['file' => $file, 'valid' => 0 === \count($errors), 'messages' => $errors]; - } - - private function display(SymfonyStyle $io, array $files) - { - return match ($this->format) { - 'txt' => $this->displayTxt($io, $files), - 'json' => $this->displayJson($io, $files), - 'github' => $this->displayTxt($io, $files, true), - default => throw new InvalidArgumentException(sprintf('The format "%s" is not supported.', $this->format)), - }; - } - - private function displayTxt(SymfonyStyle $io, array $filesInfo, bool $errorAsGithubAnnotations = false) - { - $countFiles = \count($filesInfo); - $erroredFiles = 0; - $githubReporter = $errorAsGithubAnnotations ? new GithubActionReporter($io) : null; - - foreach ($filesInfo as $info) { - if ($info['valid'] && $this->displayCorrectFiles) { - $io->comment('OK'.($info['file'] ? sprintf(' in %s', $info['file']) : '')); - } elseif (!$info['valid']) { - ++$erroredFiles; - $io->text(' ERROR '.($info['file'] ? sprintf(' in %s', $info['file']) : '')); - $io->listing(array_map(function ($error) use ($info, $githubReporter) { - // general document errors have a '-1' line number - $line = -1 === $error['line'] ? null : $error['line']; - - $githubReporter?->error($error['message'], $info['file'], $line, null !== $line ? $error['column'] : null); - - return null === $line ? $error['message'] : sprintf('Line %d, Column %d: %s', $line, $error['column'], $error['message']); - }, $info['messages'])); - } - } - - if (0 === $erroredFiles) { - $io->success(sprintf('All %d XLIFF files contain valid syntax.', $countFiles)); - } else { - $io->warning(sprintf('%d XLIFF files have valid syntax and %d contain errors.', $countFiles - $erroredFiles, $erroredFiles)); - } - - return min($erroredFiles, 1); - } - - private function displayJson(SymfonyStyle $io, array $filesInfo) - { - $errors = 0; - - array_walk($filesInfo, function (&$v) use (&$errors) { - $v['file'] = (string) $v['file']; - if (!$v['valid']) { - ++$errors; - } - }); - - $io->writeln(json_encode($filesInfo, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES)); - - return min($errors, 1); - } - - private function getFiles(string $fileOrDirectory) - { - if (is_file($fileOrDirectory)) { - yield new \SplFileInfo($fileOrDirectory); - - return; - } - - foreach ($this->getDirectoryIterator($fileOrDirectory) as $file) { - if (!\in_array($file->getExtension(), ['xlf', 'xliff'])) { - continue; - } - - yield $file; - } - } - - private function getDirectoryIterator(string $directory) - { - $default = function ($directory) { - return new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($directory, \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS), - \RecursiveIteratorIterator::LEAVES_ONLY - ); - }; - - if (null !== $this->directoryIteratorProvider) { - return ($this->directoryIteratorProvider)($directory, $default); - } - - return $default($directory); - } - - private function isReadable(string $fileOrDirectory) - { - $default = function ($fileOrDirectory) { - return is_readable($fileOrDirectory); - }; - - if (null !== $this->isReadableProvider) { - return ($this->isReadableProvider)($fileOrDirectory, $default); - } - - return $default($fileOrDirectory); - } - - private function getTargetLanguageFromFile(\DOMDocument $xliffContents): ?string - { - foreach ($xliffContents->getElementsByTagName('file')[0]->attributes ?? [] as $attribute) { - if ('target-language' === $attribute->nodeName) { - return $attribute->nodeValue; - } - } - - return null; - } - - public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void - { - if ($input->mustSuggestOptionValuesFor('format')) { - $suggestions->suggestValues(['txt', 'json', 'github']); - } - } -} diff --git a/vendor/symfony/translation/DataCollector/TranslationDataCollector.php b/vendor/symfony/translation/DataCollector/TranslationDataCollector.php deleted file mode 100644 index 064140a6..00000000 --- a/vendor/symfony/translation/DataCollector/TranslationDataCollector.php +++ /dev/null @@ -1,148 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\DataCollector; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\DataCollector\DataCollector; -use Symfony\Component\HttpKernel\DataCollector\LateDataCollectorInterface; -use Symfony\Component\Translation\DataCollectorTranslator; -use Symfony\Component\VarDumper\Cloner\Data; - -/** - * @author Abdellatif Ait boudad - * - * @final - */ -class TranslationDataCollector extends DataCollector implements LateDataCollectorInterface -{ - private DataCollectorTranslator $translator; - - public function __construct(DataCollectorTranslator $translator) - { - $this->translator = $translator; - } - - public function lateCollect() - { - $messages = $this->sanitizeCollectedMessages($this->translator->getCollectedMessages()); - - $this->data += $this->computeCount($messages); - $this->data['messages'] = $messages; - - $this->data = $this->cloneVar($this->data); - } - - public function collect(Request $request, Response $response, \Throwable $exception = null) - { - $this->data['locale'] = $this->translator->getLocale(); - $this->data['fallback_locales'] = $this->translator->getFallbackLocales(); - } - - public function reset() - { - $this->data = []; - } - - public function getMessages(): array|Data - { - return $this->data['messages'] ?? []; - } - - public function getCountMissings(): int - { - return $this->data[DataCollectorTranslator::MESSAGE_MISSING] ?? 0; - } - - public function getCountFallbacks(): int - { - return $this->data[DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK] ?? 0; - } - - public function getCountDefines(): int - { - return $this->data[DataCollectorTranslator::MESSAGE_DEFINED] ?? 0; - } - - public function getLocale() - { - return !empty($this->data['locale']) ? $this->data['locale'] : null; - } - - /** - * @internal - */ - public function getFallbackLocales() - { - return (isset($this->data['fallback_locales']) && \count($this->data['fallback_locales']) > 0) ? $this->data['fallback_locales'] : []; - } - - public function getName(): string - { - return 'translation'; - } - - private function sanitizeCollectedMessages(array $messages) - { - $result = []; - foreach ($messages as $key => $message) { - $messageId = $message['locale'].$message['domain'].$message['id']; - - if (!isset($result[$messageId])) { - $message['count'] = 1; - $message['parameters'] = !empty($message['parameters']) ? [$message['parameters']] : []; - $messages[$key]['translation'] = $this->sanitizeString($message['translation']); - $result[$messageId] = $message; - } else { - if (!empty($message['parameters'])) { - $result[$messageId]['parameters'][] = $message['parameters']; - } - - ++$result[$messageId]['count']; - } - - unset($messages[$key]); - } - - return $result; - } - - private function computeCount(array $messages) - { - $count = [ - DataCollectorTranslator::MESSAGE_DEFINED => 0, - DataCollectorTranslator::MESSAGE_MISSING => 0, - DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK => 0, - ]; - - foreach ($messages as $message) { - ++$count[$message['state']]; - } - - return $count; - } - - private function sanitizeString(string $string, int $length = 80) - { - $string = trim(preg_replace('/\s+/', ' ', $string)); - - if (false !== $encoding = mb_detect_encoding($string, null, true)) { - if (mb_strlen($string, $encoding) > $length) { - return mb_substr($string, 0, $length - 3, $encoding).'...'; - } - } elseif (\strlen($string) > $length) { - return substr($string, 0, $length - 3).'...'; - } - - return $string; - } -} diff --git a/vendor/symfony/translation/DataCollectorTranslator.php b/vendor/symfony/translation/DataCollectorTranslator.php deleted file mode 100644 index c360c9e2..00000000 --- a/vendor/symfony/translation/DataCollectorTranslator.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. - */ - -namespace Symfony\Component\Translation; - -use Symfony\Component\HttpKernel\CacheWarmer\WarmableInterface; -use Symfony\Component\Translation\Exception\InvalidArgumentException; -use Symfony\Contracts\Translation\LocaleAwareInterface; -use Symfony\Contracts\Translation\TranslatorInterface; - -/** - * @author Abdellatif Ait boudad - */ -class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInterface, LocaleAwareInterface, WarmableInterface -{ - public const MESSAGE_DEFINED = 0; - public const MESSAGE_MISSING = 1; - public const MESSAGE_EQUALS_FALLBACK = 2; - - private TranslatorInterface $translator; - private array $messages = []; - - /** - * @param TranslatorInterface&TranslatorBagInterface&LocaleAwareInterface $translator - */ - public function __construct(TranslatorInterface $translator) - { - if (!$translator instanceof TranslatorBagInterface || !$translator instanceof LocaleAwareInterface) { - throw new InvalidArgumentException(sprintf('The Translator "%s" must implement TranslatorInterface, TranslatorBagInterface and LocaleAwareInterface.', get_debug_type($translator))); - } - - $this->translator = $translator; - } - - public function trans(?string $id, array $parameters = [], string $domain = null, string $locale = null): string - { - $trans = $this->translator->trans($id = (string) $id, $parameters, $domain, $locale); - $this->collectMessage($locale, $domain, $id, $trans, $parameters); - - return $trans; - } - - public function setLocale(string $locale) - { - $this->translator->setLocale($locale); - } - - public function getLocale(): string - { - return $this->translator->getLocale(); - } - - public function getCatalogue(string $locale = null): MessageCatalogueInterface - { - return $this->translator->getCatalogue($locale); - } - - public function getCatalogues(): array - { - return $this->translator->getCatalogues(); - } - - /** - * @return string[] - */ - public function warmUp(string $cacheDir): array - { - if ($this->translator instanceof WarmableInterface) { - return (array) $this->translator->warmUp($cacheDir); - } - - return []; - } - - /** - * Gets the fallback locales. - */ - public function getFallbackLocales(): array - { - if ($this->translator instanceof Translator || method_exists($this->translator, 'getFallbackLocales')) { - return $this->translator->getFallbackLocales(); - } - - return []; - } - - /** - * Passes through all unknown calls onto the translator object. - */ - public function __call(string $method, array $args) - { - return $this->translator->{$method}(...$args); - } - - public function getCollectedMessages(): array - { - return $this->messages; - } - - private function collectMessage(?string $locale, ?string $domain, string $id, string $translation, ?array $parameters = []) - { - $domain ??= 'messages'; - - $catalogue = $this->translator->getCatalogue($locale); - $locale = $catalogue->getLocale(); - $fallbackLocale = null; - if ($catalogue->defines($id, $domain)) { - $state = self::MESSAGE_DEFINED; - } elseif ($catalogue->has($id, $domain)) { - $state = self::MESSAGE_EQUALS_FALLBACK; - - $fallbackCatalogue = $catalogue->getFallbackCatalogue(); - while ($fallbackCatalogue) { - if ($fallbackCatalogue->defines($id, $domain)) { - $fallbackLocale = $fallbackCatalogue->getLocale(); - break; - } - $fallbackCatalogue = $fallbackCatalogue->getFallbackCatalogue(); - } - } else { - $state = self::MESSAGE_MISSING; - } - - $this->messages[] = [ - 'locale' => $locale, - 'fallbackLocale' => $fallbackLocale, - 'domain' => $domain, - 'id' => $id, - 'translation' => $translation, - 'parameters' => $parameters, - 'state' => $state, - 'transChoiceNumber' => isset($parameters['%count%']) && is_numeric($parameters['%count%']) ? $parameters['%count%'] : null, - ]; - } -} diff --git a/vendor/symfony/translation/DependencyInjection/TranslationDumperPass.php b/vendor/symfony/translation/DependencyInjection/TranslationDumperPass.php deleted file mode 100644 index 4020a078..00000000 --- a/vendor/symfony/translation/DependencyInjection/TranslationDumperPass.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\DependencyInjection; - -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; - -/** - * Adds tagged translation.formatter services to translation writer. - */ -class TranslationDumperPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('translation.writer')) { - return; - } - - $definition = $container->getDefinition('translation.writer'); - - foreach ($container->findTaggedServiceIds('translation.dumper', true) as $id => $attributes) { - $definition->addMethodCall('addDumper', [$attributes[0]['alias'], new Reference($id)]); - } - } -} diff --git a/vendor/symfony/translation/DependencyInjection/TranslationExtractorPass.php b/vendor/symfony/translation/DependencyInjection/TranslationExtractorPass.php deleted file mode 100644 index ee7c47ae..00000000 --- a/vendor/symfony/translation/DependencyInjection/TranslationExtractorPass.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\DependencyInjection; - -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Exception\RuntimeException; -use Symfony\Component\DependencyInjection\Reference; - -/** - * Adds tagged translation.extractor services to translation extractor. - */ -class TranslationExtractorPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('translation.extractor')) { - return; - } - - $definition = $container->getDefinition('translation.extractor'); - - foreach ($container->findTaggedServiceIds('translation.extractor', true) as $id => $attributes) { - if (!isset($attributes[0]['alias'])) { - throw new RuntimeException(sprintf('The alias for the tag "translation.extractor" of service "%s" must be set.', $id)); - } - - $definition->addMethodCall('addExtractor', [$attributes[0]['alias'], new Reference($id)]); - } - } -} diff --git a/vendor/symfony/translation/DependencyInjection/TranslatorPass.php b/vendor/symfony/translation/DependencyInjection/TranslatorPass.php deleted file mode 100644 index 4b50958e..00000000 --- a/vendor/symfony/translation/DependencyInjection/TranslatorPass.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\Translation\DependencyInjection; - -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; - -class TranslatorPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('translator.default')) { - return; - } - - $loaders = []; - $loaderRefs = []; - foreach ($container->findTaggedServiceIds('translation.loader', true) as $id => $attributes) { - $loaderRefs[$id] = new Reference($id); - $loaders[$id][] = $attributes[0]['alias']; - if (isset($attributes[0]['legacy-alias'])) { - $loaders[$id][] = $attributes[0]['legacy-alias']; - } - } - - if ($container->hasDefinition('translation.reader')) { - $definition = $container->getDefinition('translation.reader'); - foreach ($loaders as $id => $formats) { - foreach ($formats as $format) { - $definition->addMethodCall('addLoader', [$format, $loaderRefs[$id]]); - } - } - } - - $container - ->findDefinition('translator.default') - ->replaceArgument(0, ServiceLocatorTagPass::register($container, $loaderRefs)) - ->replaceArgument(3, $loaders) - ; - - if ($container->hasDefinition('validator') && $container->hasDefinition('translation.extractor.visitor.constraint')) { - $constraintVisitorDefinition = $container->getDefinition('translation.extractor.visitor.constraint'); - $constraintClassNames = []; - - foreach ($container->findTaggedServiceIds('validator.constraint_validator', true) as $id => $attributes) { - $serviceDefinition = $container->getDefinition($id); - // Extraction of the constraint class name from the Constraint Validator FQCN - $constraintClassNames[] = str_replace('Validator', '', substr(strrchr($serviceDefinition->getClass(), '\\'), 1)); - } - - $constraintVisitorDefinition->setArgument(0, $constraintClassNames); - } - - if (!$container->hasParameter('twig.default_path')) { - return; - } - - $paths = array_keys($container->getDefinition('twig.template_iterator')->getArgument(1)); - if ($container->hasDefinition('console.command.translation_debug')) { - $definition = $container->getDefinition('console.command.translation_debug'); - $definition->replaceArgument(4, $container->getParameter('twig.default_path')); - - if (\count($definition->getArguments()) > 6) { - $definition->replaceArgument(6, $paths); - } - } - if ($container->hasDefinition('console.command.translation_extract')) { - $definition = $container->getDefinition('console.command.translation_extract'); - $definition->replaceArgument(5, $container->getParameter('twig.default_path')); - - if (\count($definition->getArguments()) > 7) { - $definition->replaceArgument(7, $paths); - } - } - } -} diff --git a/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.php b/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.php deleted file mode 100644 index b85c0662..00000000 --- a/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.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. - */ - -namespace Symfony\Component\Translation\DependencyInjection; - -use Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ServiceLocator; - -/** - * @author Yonel Ceruto - */ -class TranslatorPathsPass extends AbstractRecursivePass -{ - private int $level = 0; - - /** - * @var array - */ - private array $paths = []; - - /** - * @var array - */ - private array $definitions = []; - - /** - * @var array> - */ - private array $controllers = []; - - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition('translator')) { - return; - } - - foreach ($this->findControllerArguments($container) as $controller => $argument) { - $id = substr($controller, 0, strpos($controller, ':') ?: \strlen($controller)); - if ($container->hasDefinition($id)) { - [$locatorRef] = $argument->getValues(); - $this->controllers[(string) $locatorRef][$container->getDefinition($id)->getClass()] = true; - } - } - - try { - parent::process($container); - - $paths = []; - foreach ($this->paths as $class => $_) { - if (($r = $container->getReflectionClass($class)) && !$r->isInterface()) { - $paths[] = $r->getFileName(); - foreach ($r->getTraits() as $trait) { - $paths[] = $trait->getFileName(); - } - } - } - if ($paths) { - if ($container->hasDefinition('console.command.translation_debug')) { - $definition = $container->getDefinition('console.command.translation_debug'); - $definition->replaceArgument(6, array_merge($definition->getArgument(6), $paths)); - } - if ($container->hasDefinition('console.command.translation_extract')) { - $definition = $container->getDefinition('console.command.translation_extract'); - $definition->replaceArgument(7, array_merge($definition->getArgument(7), $paths)); - } - } - } finally { - $this->level = 0; - $this->paths = []; - $this->definitions = []; - } - } - - protected function processValue(mixed $value, bool $isRoot = false): mixed - { - if ($value instanceof Reference) { - if ('translator' === (string) $value) { - for ($i = $this->level - 1; $i >= 0; --$i) { - $class = $this->definitions[$i]->getClass(); - - if (ServiceLocator::class === $class) { - if (!isset($this->controllers[$this->currentId])) { - continue; - } - foreach ($this->controllers[$this->currentId] as $class => $_) { - $this->paths[$class] = true; - } - } else { - $this->paths[$class] = true; - } - - break; - } - } - - return $value; - } - - if ($value instanceof Definition) { - $this->definitions[$this->level++] = $value; - $value = parent::processValue($value, $isRoot); - unset($this->definitions[--$this->level]); - - return $value; - } - - return parent::processValue($value, $isRoot); - } - - private function findControllerArguments(ContainerBuilder $container): array - { - if ($container->hasDefinition('argument_resolver.service')) { - $argument = $container->getDefinition('argument_resolver.service')->getArgument(0); - if ($argument instanceof Reference) { - $argument = $container->getDefinition($argument); - } - - return $argument->getArgument(0); - } - - if ($container->hasDefinition('debug.'.'argument_resolver.service')) { - $argument = $container->getDefinition('debug.'.'argument_resolver.service')->getArgument(0); - if ($argument instanceof Reference) { - $argument = $container->getDefinition($argument); - } - $argument = $argument->getArgument(0); - if ($argument instanceof Reference) { - $argument = $container->getDefinition($argument); - } - - return $argument->getArgument(0); - } - - return []; - } -} diff --git a/vendor/symfony/translation/Dumper/CsvFileDumper.php b/vendor/symfony/translation/Dumper/CsvFileDumper.php deleted file mode 100644 index df2c2a8b..00000000 --- a/vendor/symfony/translation/Dumper/CsvFileDumper.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Dumper; - -use Symfony\Component\Translation\MessageCatalogue; - -/** - * CsvFileDumper generates a csv formatted string representation of a message catalogue. - * - * @author Stealth35 - */ -class CsvFileDumper extends FileDumper -{ - private string $delimiter = ';'; - private string $enclosure = '"'; - - public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string - { - $handle = fopen('php://memory', 'r+'); - - foreach ($messages->all($domain) as $source => $target) { - fputcsv($handle, [$source, $target], $this->delimiter, $this->enclosure); - } - - rewind($handle); - $output = stream_get_contents($handle); - fclose($handle); - - return $output; - } - - /** - * Sets the delimiter and escape character for CSV. - */ - public function setCsvControl(string $delimiter = ';', string $enclosure = '"') - { - $this->delimiter = $delimiter; - $this->enclosure = $enclosure; - } - - protected function getExtension(): string - { - return 'csv'; - } -} diff --git a/vendor/symfony/translation/Dumper/DumperInterface.php b/vendor/symfony/translation/Dumper/DumperInterface.php deleted file mode 100644 index 7cdaef51..00000000 --- a/vendor/symfony/translation/Dumper/DumperInterface.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\Translation\Dumper; - -use Symfony\Component\Translation\MessageCatalogue; - -/** - * DumperInterface is the interface implemented by all translation dumpers. - * There is no common option. - * - * @author Michel Salib - */ -interface DumperInterface -{ - /** - * Dumps the message catalogue. - * - * @param array $options Options that are used by the dumper - */ - public function dump(MessageCatalogue $messages, array $options = []); -} diff --git a/vendor/symfony/translation/Dumper/FileDumper.php b/vendor/symfony/translation/Dumper/FileDumper.php deleted file mode 100644 index b2db0f30..00000000 --- a/vendor/symfony/translation/Dumper/FileDumper.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\Translation\Dumper; - -use Symfony\Component\Translation\Exception\InvalidArgumentException; -use Symfony\Component\Translation\Exception\RuntimeException; -use Symfony\Component\Translation\MessageCatalogue; - -/** - * FileDumper is an implementation of DumperInterface that dump a message catalogue to file(s). - * - * Options: - * - path (mandatory): the directory where the files should be saved - * - * @author Michel Salib - */ -abstract class FileDumper implements DumperInterface -{ - /** - * A template for the relative paths to files. - * - * @var string - */ - protected $relativePathTemplate = '%domain%.%locale%.%extension%'; - - /** - * Sets the template for the relative paths to files. - * - * @param string $relativePathTemplate A template for the relative paths to files - */ - public function setRelativePathTemplate(string $relativePathTemplate) - { - $this->relativePathTemplate = $relativePathTemplate; - } - - public function dump(MessageCatalogue $messages, array $options = []) - { - if (!\array_key_exists('path', $options)) { - throw new InvalidArgumentException('The file dumper needs a path option.'); - } - - // save a file for each domain - foreach ($messages->getDomains() as $domain) { - $fullpath = $options['path'].'/'.$this->getRelativePath($domain, $messages->getLocale()); - if (!file_exists($fullpath)) { - $directory = \dirname($fullpath); - if (!file_exists($directory) && !@mkdir($directory, 0777, true)) { - throw new RuntimeException(sprintf('Unable to create directory "%s".', $directory)); - } - } - - $intlDomain = $domain.MessageCatalogue::INTL_DOMAIN_SUFFIX; - $intlMessages = $messages->all($intlDomain); - - if ($intlMessages) { - $intlPath = $options['path'].'/'.$this->getRelativePath($intlDomain, $messages->getLocale()); - file_put_contents($intlPath, $this->formatCatalogue($messages, $intlDomain, $options)); - - $messages->replace([], $intlDomain); - - try { - if ($messages->all($domain)) { - file_put_contents($fullpath, $this->formatCatalogue($messages, $domain, $options)); - } - continue; - } finally { - $messages->replace($intlMessages, $intlDomain); - } - } - - file_put_contents($fullpath, $this->formatCatalogue($messages, $domain, $options)); - } - } - - /** - * Transforms a domain of a message catalogue to its string representation. - */ - abstract public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string; - - /** - * Gets the file extension of the dumper. - */ - abstract protected function getExtension(): string; - - /** - * Gets the relative file path using the template. - */ - private function getRelativePath(string $domain, string $locale): string - { - return strtr($this->relativePathTemplate, [ - '%domain%' => $domain, - '%locale%' => $locale, - '%extension%' => $this->getExtension(), - ]); - } -} diff --git a/vendor/symfony/translation/Dumper/IcuResFileDumper.php b/vendor/symfony/translation/Dumper/IcuResFileDumper.php deleted file mode 100644 index 50ef82d0..00000000 --- a/vendor/symfony/translation/Dumper/IcuResFileDumper.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\Translation\Dumper; - -use Symfony\Component\Translation\MessageCatalogue; - -/** - * IcuResDumper generates an ICU ResourceBundle formatted string representation of a message catalogue. - * - * @author Stealth35 - */ -class IcuResFileDumper extends FileDumper -{ - protected $relativePathTemplate = '%domain%/%locale%.%extension%'; - - public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string - { - $data = $indexes = $resources = ''; - - foreach ($messages->all($domain) as $source => $target) { - $indexes .= pack('v', \strlen($data) + 28); - $data .= $source."\0"; - } - - $data .= $this->writePadding($data); - - $keyTop = $this->getPosition($data); - - foreach ($messages->all($domain) as $source => $target) { - $resources .= pack('V', $this->getPosition($data)); - - $data .= pack('V', \strlen($target)) - .mb_convert_encoding($target."\0", 'UTF-16LE', 'UTF-8') - .$this->writePadding($data) - ; - } - - $resOffset = $this->getPosition($data); - - $data .= pack('v', \count($messages->all($domain))) - .$indexes - .$this->writePadding($data) - .$resources - ; - - $bundleTop = $this->getPosition($data); - - $root = pack('V7', - $resOffset + (2 << 28), // Resource Offset + Resource Type - 6, // Index length - $keyTop, // Index keys top - $bundleTop, // Index resources top - $bundleTop, // Index bundle top - \count($messages->all($domain)), // Index max table length - 0 // Index attributes - ); - - $header = pack('vC2v4C12@32', - 32, // Header size - 0xDA, 0x27, // Magic number 1 and 2 - 20, 0, 0, 2, // Rest of the header, ..., Size of a char - 0x52, 0x65, 0x73, 0x42, // Data format identifier - 1, 2, 0, 0, // Data version - 1, 4, 0, 0 // Unicode version - ); - - return $header.$root.$data; - } - - private function writePadding(string $data): ?string - { - $padding = \strlen($data) % 4; - - return $padding ? str_repeat("\xAA", 4 - $padding) : null; - } - - private function getPosition(string $data) - { - return (\strlen($data) + 28) / 4; - } - - protected function getExtension(): string - { - return 'res'; - } -} diff --git a/vendor/symfony/translation/Dumper/IniFileDumper.php b/vendor/symfony/translation/Dumper/IniFileDumper.php deleted file mode 100644 index 6cbdef60..00000000 --- a/vendor/symfony/translation/Dumper/IniFileDumper.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Dumper; - -use Symfony\Component\Translation\MessageCatalogue; - -/** - * IniFileDumper generates an ini formatted string representation of a message catalogue. - * - * @author Stealth35 - */ -class IniFileDumper extends FileDumper -{ - public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string - { - $output = ''; - - foreach ($messages->all($domain) as $source => $target) { - $escapeTarget = str_replace('"', '\"', $target); - $output .= $source.'="'.$escapeTarget."\"\n"; - } - - return $output; - } - - protected function getExtension(): string - { - return 'ini'; - } -} diff --git a/vendor/symfony/translation/Dumper/JsonFileDumper.php b/vendor/symfony/translation/Dumper/JsonFileDumper.php deleted file mode 100644 index e5035397..00000000 --- a/vendor/symfony/translation/Dumper/JsonFileDumper.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Dumper; - -use Symfony\Component\Translation\MessageCatalogue; - -/** - * JsonFileDumper generates an json formatted string representation of a message catalogue. - * - * @author singles - */ -class JsonFileDumper extends FileDumper -{ - public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string - { - $flags = $options['json_encoding'] ?? \JSON_PRETTY_PRINT; - - return json_encode($messages->all($domain), $flags); - } - - protected function getExtension(): string - { - return 'json'; - } -} diff --git a/vendor/symfony/translation/Dumper/MoFileDumper.php b/vendor/symfony/translation/Dumper/MoFileDumper.php deleted file mode 100644 index 9ded5f4e..00000000 --- a/vendor/symfony/translation/Dumper/MoFileDumper.php +++ /dev/null @@ -1,76 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Dumper; - -use Symfony\Component\Translation\Loader\MoFileLoader; -use Symfony\Component\Translation\MessageCatalogue; - -/** - * MoFileDumper generates a gettext formatted string representation of a message catalogue. - * - * @author Stealth35 - */ -class MoFileDumper extends FileDumper -{ - public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string - { - $sources = $targets = $sourceOffsets = $targetOffsets = ''; - $offsets = []; - $size = 0; - - foreach ($messages->all($domain) as $source => $target) { - $offsets[] = array_map('strlen', [$sources, $source, $targets, $target]); - $sources .= "\0".$source; - $targets .= "\0".$target; - ++$size; - } - - $header = [ - 'magicNumber' => MoFileLoader::MO_LITTLE_ENDIAN_MAGIC, - 'formatRevision' => 0, - 'count' => $size, - 'offsetId' => MoFileLoader::MO_HEADER_SIZE, - 'offsetTranslated' => MoFileLoader::MO_HEADER_SIZE + (8 * $size), - 'sizeHashes' => 0, - 'offsetHashes' => MoFileLoader::MO_HEADER_SIZE + (16 * $size), - ]; - - $sourcesSize = \strlen($sources); - $sourcesStart = $header['offsetHashes'] + 1; - - foreach ($offsets as $offset) { - $sourceOffsets .= $this->writeLong($offset[1]) - .$this->writeLong($offset[0] + $sourcesStart); - $targetOffsets .= $this->writeLong($offset[3]) - .$this->writeLong($offset[2] + $sourcesStart + $sourcesSize); - } - - $output = implode('', array_map($this->writeLong(...), $header)) - .$sourceOffsets - .$targetOffsets - .$sources - .$targets - ; - - return $output; - } - - protected function getExtension(): string - { - return 'mo'; - } - - private function writeLong(mixed $str): string - { - return pack('V*', $str); - } -} diff --git a/vendor/symfony/translation/Dumper/PhpFileDumper.php b/vendor/symfony/translation/Dumper/PhpFileDumper.php deleted file mode 100644 index 51e90665..00000000 --- a/vendor/symfony/translation/Dumper/PhpFileDumper.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\Translation\Dumper; - -use Symfony\Component\Translation\MessageCatalogue; - -/** - * PhpFileDumper generates PHP files from a message catalogue. - * - * @author Michel Salib - */ -class PhpFileDumper extends FileDumper -{ - public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string - { - return "all($domain), true).";\n"; - } - - protected function getExtension(): string - { - return 'php'; - } -} diff --git a/vendor/symfony/translation/Dumper/PoFileDumper.php b/vendor/symfony/translation/Dumper/PoFileDumper.php deleted file mode 100644 index c026672d..00000000 --- a/vendor/symfony/translation/Dumper/PoFileDumper.php +++ /dev/null @@ -1,131 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Dumper; - -use Symfony\Component\Translation\MessageCatalogue; - -/** - * PoFileDumper generates a gettext formatted string representation of a message catalogue. - * - * @author Stealth35 - */ -class PoFileDumper extends FileDumper -{ - public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string - { - $output = 'msgid ""'."\n"; - $output .= 'msgstr ""'."\n"; - $output .= '"Content-Type: text/plain; charset=UTF-8\n"'."\n"; - $output .= '"Content-Transfer-Encoding: 8bit\n"'."\n"; - $output .= '"Language: '.$messages->getLocale().'\n"'."\n"; - $output .= "\n"; - - $newLine = false; - foreach ($messages->all($domain) as $source => $target) { - if ($newLine) { - $output .= "\n"; - } else { - $newLine = true; - } - $metadata = $messages->getMetadata($source, $domain); - - if (isset($metadata['comments'])) { - $output .= $this->formatComments($metadata['comments']); - } - if (isset($metadata['flags'])) { - $output .= $this->formatComments(implode(',', (array) $metadata['flags']), ','); - } - if (isset($metadata['sources'])) { - $output .= $this->formatComments(implode(' ', (array) $metadata['sources']), ':'); - } - - $sourceRules = $this->getStandardRules($source); - $targetRules = $this->getStandardRules($target); - if (2 == \count($sourceRules) && [] !== $targetRules) { - $output .= sprintf('msgid "%s"'."\n", $this->escape($sourceRules[0])); - $output .= sprintf('msgid_plural "%s"'."\n", $this->escape($sourceRules[1])); - foreach ($targetRules as $i => $targetRule) { - $output .= sprintf('msgstr[%d] "%s"'."\n", $i, $this->escape($targetRule)); - } - } else { - $output .= sprintf('msgid "%s"'."\n", $this->escape($source)); - $output .= sprintf('msgstr "%s"'."\n", $this->escape($target)); - } - } - - return $output; - } - - private function getStandardRules(string $id) - { - // Partly copied from TranslatorTrait::trans. - $parts = []; - if (preg_match('/^\|++$/', $id)) { - $parts = explode('|', $id); - } elseif (preg_match_all('/(?:\|\||[^\|])++/', $id, $matches)) { - $parts = $matches[0]; - } - - $intervalRegexp = <<<'EOF' -/^(?P - ({\s* - (\-?\d+(\.\d+)?[\s*,\s*\-?\d+(\.\d+)?]*) - \s*}) - - | - - (?P[\[\]]) - \s* - (?P-Inf|\-?\d+(\.\d+)?) - \s*,\s* - (?P\+?Inf|\-?\d+(\.\d+)?) - \s* - (?P[\[\]]) -)\s*(?P.*?)$/xs -EOF; - - $standardRules = []; - foreach ($parts as $part) { - $part = trim(str_replace('||', '|', $part)); - - if (preg_match($intervalRegexp, $part)) { - // Explicit rule is not a standard rule. - return []; - } else { - $standardRules[] = $part; - } - } - - return $standardRules; - } - - protected function getExtension(): string - { - return 'po'; - } - - private function escape(string $str): string - { - return addcslashes($str, "\0..\37\42\134"); - } - - private function formatComments(string|array $comments, string $prefix = ''): ?string - { - $output = null; - - foreach ((array) $comments as $comment) { - $output .= sprintf('#%s %s'."\n", $prefix, $comment); - } - - return $output; - } -} diff --git a/vendor/symfony/translation/Dumper/QtFileDumper.php b/vendor/symfony/translation/Dumper/QtFileDumper.php deleted file mode 100644 index 0373e9c1..00000000 --- a/vendor/symfony/translation/Dumper/QtFileDumper.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Dumper; - -use Symfony\Component\Translation\MessageCatalogue; - -/** - * QtFileDumper generates ts files from a message catalogue. - * - * @author Benjamin Eberlei - */ -class QtFileDumper extends FileDumper -{ - public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string - { - $dom = new \DOMDocument('1.0', 'utf-8'); - $dom->formatOutput = true; - $ts = $dom->appendChild($dom->createElement('TS')); - $context = $ts->appendChild($dom->createElement('context')); - $context->appendChild($dom->createElement('name', $domain)); - - foreach ($messages->all($domain) as $source => $target) { - $message = $context->appendChild($dom->createElement('message')); - $metadata = $messages->getMetadata($source, $domain); - if (isset($metadata['sources'])) { - foreach ((array) $metadata['sources'] as $location) { - $loc = explode(':', $location, 2); - $location = $message->appendChild($dom->createElement('location')); - $location->setAttribute('filename', $loc[0]); - if (isset($loc[1])) { - $location->setAttribute('line', $loc[1]); - } - } - } - $message->appendChild($dom->createElement('source', $source)); - $message->appendChild($dom->createElement('translation', $target)); - } - - return $dom->saveXML(); - } - - protected function getExtension(): string - { - return 'ts'; - } -} diff --git a/vendor/symfony/translation/Dumper/XliffFileDumper.php b/vendor/symfony/translation/Dumper/XliffFileDumper.php deleted file mode 100644 index 53847193..00000000 --- a/vendor/symfony/translation/Dumper/XliffFileDumper.php +++ /dev/null @@ -1,221 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Dumper; - -use Symfony\Component\Translation\Exception\InvalidArgumentException; -use Symfony\Component\Translation\MessageCatalogue; - -/** - * XliffFileDumper generates xliff files from a message catalogue. - * - * @author Michel Salib - */ -class XliffFileDumper extends FileDumper -{ - public function __construct( - private string $extension = 'xlf', - ) { - } - - public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string - { - $xliffVersion = '1.2'; - if (\array_key_exists('xliff_version', $options)) { - $xliffVersion = $options['xliff_version']; - } - - if (\array_key_exists('default_locale', $options)) { - $defaultLocale = $options['default_locale']; - } else { - $defaultLocale = \Locale::getDefault(); - } - - if ('1.2' === $xliffVersion) { - return $this->dumpXliff1($defaultLocale, $messages, $domain, $options); - } - if ('2.0' === $xliffVersion) { - return $this->dumpXliff2($defaultLocale, $messages, $domain); - } - - throw new InvalidArgumentException(sprintf('No support implemented for dumping XLIFF version "%s".', $xliffVersion)); - } - - protected function getExtension(): string - { - return $this->extension; - } - - private function dumpXliff1(string $defaultLocale, MessageCatalogue $messages, ?string $domain, array $options = []) - { - $toolInfo = ['tool-id' => 'symfony', 'tool-name' => 'Symfony']; - if (\array_key_exists('tool_info', $options)) { - $toolInfo = array_merge($toolInfo, $options['tool_info']); - } - - $dom = new \DOMDocument('1.0', 'utf-8'); - $dom->formatOutput = true; - - $xliff = $dom->appendChild($dom->createElement('xliff')); - $xliff->setAttribute('version', '1.2'); - $xliff->setAttribute('xmlns', 'urn:oasis:names:tc:xliff:document:1.2'); - - $xliffFile = $xliff->appendChild($dom->createElement('file')); - $xliffFile->setAttribute('source-language', str_replace('_', '-', $defaultLocale)); - $xliffFile->setAttribute('target-language', str_replace('_', '-', $messages->getLocale())); - $xliffFile->setAttribute('datatype', 'plaintext'); - $xliffFile->setAttribute('original', 'file.ext'); - - $xliffHead = $xliffFile->appendChild($dom->createElement('header')); - $xliffTool = $xliffHead->appendChild($dom->createElement('tool')); - foreach ($toolInfo as $id => $value) { - $xliffTool->setAttribute($id, $value); - } - - if ($catalogueMetadata = $messages->getCatalogueMetadata('', $domain) ?? []) { - $xliffPropGroup = $xliffHead->appendChild($dom->createElement('prop-group')); - foreach ($catalogueMetadata as $key => $value) { - $xliffProp = $xliffPropGroup->appendChild($dom->createElement('prop')); - $xliffProp->setAttribute('prop-type', $key); - $xliffProp->appendChild($dom->createTextNode($value)); - } - } - - $xliffBody = $xliffFile->appendChild($dom->createElement('body')); - foreach ($messages->all($domain) as $source => $target) { - $translation = $dom->createElement('trans-unit'); - - $translation->setAttribute('id', strtr(substr(base64_encode(hash('sha256', $source, true)), 0, 7), '/+', '._')); - $translation->setAttribute('resname', $source); - - $s = $translation->appendChild($dom->createElement('source')); - $s->appendChild($dom->createTextNode($source)); - - // Does the target contain characters requiring a CDATA section? - $text = 1 === preg_match('/[&<>]/', $target) ? $dom->createCDATASection($target) : $dom->createTextNode($target); - - $targetElement = $dom->createElement('target'); - $metadata = $messages->getMetadata($source, $domain); - if ($this->hasMetadataArrayInfo('target-attributes', $metadata)) { - foreach ($metadata['target-attributes'] as $name => $value) { - $targetElement->setAttribute($name, $value); - } - } - $t = $translation->appendChild($targetElement); - $t->appendChild($text); - - if ($this->hasMetadataArrayInfo('notes', $metadata)) { - foreach ($metadata['notes'] as $note) { - if (!isset($note['content'])) { - continue; - } - - $n = $translation->appendChild($dom->createElement('note')); - $n->appendChild($dom->createTextNode($note['content'])); - - if (isset($note['priority'])) { - $n->setAttribute('priority', $note['priority']); - } - - if (isset($note['from'])) { - $n->setAttribute('from', $note['from']); - } - } - } - - $xliffBody->appendChild($translation); - } - - return $dom->saveXML(); - } - - private function dumpXliff2(string $defaultLocale, MessageCatalogue $messages, ?string $domain) - { - $dom = new \DOMDocument('1.0', 'utf-8'); - $dom->formatOutput = true; - - $xliff = $dom->appendChild($dom->createElement('xliff')); - $xliff->setAttribute('xmlns', 'urn:oasis:names:tc:xliff:document:2.0'); - $xliff->setAttribute('version', '2.0'); - $xliff->setAttribute('srcLang', str_replace('_', '-', $defaultLocale)); - $xliff->setAttribute('trgLang', str_replace('_', '-', $messages->getLocale())); - - $xliffFile = $xliff->appendChild($dom->createElement('file')); - if (str_ends_with($domain, MessageCatalogue::INTL_DOMAIN_SUFFIX)) { - $xliffFile->setAttribute('id', substr($domain, 0, -\strlen(MessageCatalogue::INTL_DOMAIN_SUFFIX)).'.'.$messages->getLocale()); - } else { - $xliffFile->setAttribute('id', $domain.'.'.$messages->getLocale()); - } - - if ($catalogueMetadata = $messages->getCatalogueMetadata('', $domain) ?? []) { - $xliff->setAttribute('xmlns:m', 'urn:oasis:names:tc:xliff:metadata:2.0'); - $xliffMetadata = $xliffFile->appendChild($dom->createElement('m:metadata')); - foreach ($catalogueMetadata as $key => $value) { - $xliffMeta = $xliffMetadata->appendChild($dom->createElement('prop')); - $xliffMeta->setAttribute('type', $key); - $xliffMeta->appendChild($dom->createTextNode($value)); - } - } - - foreach ($messages->all($domain) as $source => $target) { - $translation = $dom->createElement('unit'); - $translation->setAttribute('id', strtr(substr(base64_encode(hash('sha256', $source, true)), 0, 7), '/+', '._')); - - if (\strlen($source) <= 80) { - $translation->setAttribute('name', $source); - } - - $metadata = $messages->getMetadata($source, $domain); - - // Add notes section - if ($this->hasMetadataArrayInfo('notes', $metadata)) { - $notesElement = $dom->createElement('notes'); - foreach ($metadata['notes'] as $note) { - $n = $dom->createElement('note'); - $n->appendChild($dom->createTextNode($note['content'] ?? '')); - unset($note['content']); - - foreach ($note as $name => $value) { - $n->setAttribute($name, $value); - } - $notesElement->appendChild($n); - } - $translation->appendChild($notesElement); - } - - $segment = $translation->appendChild($dom->createElement('segment')); - - $s = $segment->appendChild($dom->createElement('source')); - $s->appendChild($dom->createTextNode($source)); - - // Does the target contain characters requiring a CDATA section? - $text = 1 === preg_match('/[&<>]/', $target) ? $dom->createCDATASection($target) : $dom->createTextNode($target); - - $targetElement = $dom->createElement('target'); - if ($this->hasMetadataArrayInfo('target-attributes', $metadata)) { - foreach ($metadata['target-attributes'] as $name => $value) { - $targetElement->setAttribute($name, $value); - } - } - $t = $segment->appendChild($targetElement); - $t->appendChild($text); - - $xliffFile->appendChild($translation); - } - - return $dom->saveXML(); - } - - private function hasMetadataArrayInfo(string $key, array $metadata = null): bool - { - return is_iterable($metadata[$key] ?? null); - } -} diff --git a/vendor/symfony/translation/Dumper/YamlFileDumper.php b/vendor/symfony/translation/Dumper/YamlFileDumper.php deleted file mode 100644 index d2670331..00000000 --- a/vendor/symfony/translation/Dumper/YamlFileDumper.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\Translation\Dumper; - -use Symfony\Component\Translation\Exception\LogicException; -use Symfony\Component\Translation\MessageCatalogue; -use Symfony\Component\Translation\Util\ArrayConverter; -use Symfony\Component\Yaml\Yaml; - -/** - * YamlFileDumper generates yaml files from a message catalogue. - * - * @author Michel Salib - */ -class YamlFileDumper extends FileDumper -{ - private string $extension; - - public function __construct(string $extension = 'yml') - { - $this->extension = $extension; - } - - public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string - { - if (!class_exists(Yaml::class)) { - throw new LogicException('Dumping translations in the YAML format requires the Symfony Yaml component.'); - } - - $data = $messages->all($domain); - - if (isset($options['as_tree']) && $options['as_tree']) { - $data = ArrayConverter::expandToTree($data); - } - - if (isset($options['inline']) && ($inline = (int) $options['inline']) > 0) { - return Yaml::dump($data, $inline); - } - - return Yaml::dump($data); - } - - protected function getExtension(): string - { - return $this->extension; - } -} diff --git a/vendor/symfony/translation/Exception/ExceptionInterface.php b/vendor/symfony/translation/Exception/ExceptionInterface.php deleted file mode 100644 index 8f9c54ef..00000000 --- a/vendor/symfony/translation/Exception/ExceptionInterface.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Exception; - -/** - * Exception interface for all exceptions thrown by the component. - * - * @author Fabien Potencier - */ -interface ExceptionInterface extends \Throwable -{ -} diff --git a/vendor/symfony/translation/Exception/IncompleteDsnException.php b/vendor/symfony/translation/Exception/IncompleteDsnException.php deleted file mode 100644 index cb0ce027..00000000 --- a/vendor/symfony/translation/Exception/IncompleteDsnException.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\Translation\Exception; - -class IncompleteDsnException extends InvalidArgumentException -{ - public function __construct(string $message, string $dsn = null, \Throwable $previous = null) - { - if ($dsn) { - $message = sprintf('Invalid "%s" provider DSN: ', $dsn).$message; - } - - parent::__construct($message, 0, $previous); - } -} diff --git a/vendor/symfony/translation/Exception/InvalidArgumentException.php b/vendor/symfony/translation/Exception/InvalidArgumentException.php deleted file mode 100644 index 90d06690..00000000 --- a/vendor/symfony/translation/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Exception; - -/** - * Base InvalidArgumentException for the Translation component. - * - * @author Abdellatif Ait boudad - */ -class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/translation/Exception/InvalidResourceException.php b/vendor/symfony/translation/Exception/InvalidResourceException.php deleted file mode 100644 index cf079432..00000000 --- a/vendor/symfony/translation/Exception/InvalidResourceException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Exception; - -/** - * Thrown when a resource cannot be loaded. - * - * @author Fabien Potencier - */ -class InvalidResourceException extends \InvalidArgumentException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/translation/Exception/LogicException.php b/vendor/symfony/translation/Exception/LogicException.php deleted file mode 100644 index 9019c7e7..00000000 --- a/vendor/symfony/translation/Exception/LogicException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Exception; - -/** - * Base LogicException for Translation component. - * - * @author Abdellatif Ait boudad - */ -class LogicException extends \LogicException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/translation/Exception/MissingRequiredOptionException.php b/vendor/symfony/translation/Exception/MissingRequiredOptionException.php deleted file mode 100644 index 2b5f8080..00000000 --- a/vendor/symfony/translation/Exception/MissingRequiredOptionException.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\Translation\Exception; - -/** - * @author Oskar Stark - */ -class MissingRequiredOptionException extends IncompleteDsnException -{ - public function __construct(string $option, string $dsn = null, \Throwable $previous = null) - { - $message = sprintf('The option "%s" is required but missing.', $option); - - parent::__construct($message, $dsn, $previous); - } -} diff --git a/vendor/symfony/translation/Exception/NotFoundResourceException.php b/vendor/symfony/translation/Exception/NotFoundResourceException.php deleted file mode 100644 index cff73ae3..00000000 --- a/vendor/symfony/translation/Exception/NotFoundResourceException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Exception; - -/** - * Thrown when a resource does not exist. - * - * @author Fabien Potencier - */ -class NotFoundResourceException extends \InvalidArgumentException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/translation/Exception/ProviderException.php b/vendor/symfony/translation/Exception/ProviderException.php deleted file mode 100644 index 65883f85..00000000 --- a/vendor/symfony/translation/Exception/ProviderException.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Exception; - -use Symfony\Contracts\HttpClient\ResponseInterface; - -/** - * @author Fabien Potencier - */ -class ProviderException extends RuntimeException implements ProviderExceptionInterface -{ - private ResponseInterface $response; - private string $debug; - - public function __construct(string $message, ResponseInterface $response, int $code = 0, \Exception $previous = null) - { - $this->response = $response; - $this->debug = $response->getInfo('debug') ?? ''; - - parent::__construct($message, $code, $previous); - } - - public function getResponse(): ResponseInterface - { - return $this->response; - } - - public function getDebug(): string - { - return $this->debug; - } -} diff --git a/vendor/symfony/translation/Exception/ProviderExceptionInterface.php b/vendor/symfony/translation/Exception/ProviderExceptionInterface.php deleted file mode 100644 index 922e8272..00000000 --- a/vendor/symfony/translation/Exception/ProviderExceptionInterface.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\Translation\Exception; - -/** - * @author Fabien Potencier - */ -interface ProviderExceptionInterface extends ExceptionInterface -{ - /* - * Returns debug info coming from the Symfony\Contracts\HttpClient\ResponseInterface - */ - public function getDebug(): string; -} diff --git a/vendor/symfony/translation/Exception/RuntimeException.php b/vendor/symfony/translation/Exception/RuntimeException.php deleted file mode 100644 index dcd79408..00000000 --- a/vendor/symfony/translation/Exception/RuntimeException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Exception; - -/** - * Base RuntimeException for the Translation component. - * - * @author Abdellatif Ait boudad - */ -class RuntimeException extends \RuntimeException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/translation/Exception/UnsupportedSchemeException.php b/vendor/symfony/translation/Exception/UnsupportedSchemeException.php deleted file mode 100644 index 7fbaa8f0..00000000 --- a/vendor/symfony/translation/Exception/UnsupportedSchemeException.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Exception; - -use Symfony\Component\Translation\Bridge; -use Symfony\Component\Translation\Provider\Dsn; - -class UnsupportedSchemeException extends LogicException -{ - private const SCHEME_TO_PACKAGE_MAP = [ - 'crowdin' => [ - 'class' => Bridge\Crowdin\CrowdinProviderFactory::class, - 'package' => 'symfony/crowdin-translation-provider', - ], - 'loco' => [ - 'class' => Bridge\Loco\LocoProviderFactory::class, - 'package' => 'symfony/loco-translation-provider', - ], - 'lokalise' => [ - 'class' => Bridge\Lokalise\LokaliseProviderFactory::class, - 'package' => 'symfony/lokalise-translation-provider', - ], - ]; - - public function __construct(Dsn $dsn, string $name = null, array $supported = []) - { - $provider = $dsn->getScheme(); - if (false !== $pos = strpos($provider, '+')) { - $provider = substr($provider, 0, $pos); - } - $package = self::SCHEME_TO_PACKAGE_MAP[$provider] ?? null; - if ($package && !class_exists($package['class'])) { - parent::__construct(sprintf('Unable to synchronize translations via "%s" as the provider is not installed; try running "composer require %s".', $provider, $package['package'])); - - return; - } - - $message = sprintf('The "%s" scheme is not supported', $dsn->getScheme()); - if ($name && $supported) { - $message .= sprintf('; supported schemes for translation provider "%s" are: "%s"', $name, implode('", "', $supported)); - } - - parent::__construct($message.'.'); - } -} diff --git a/vendor/symfony/translation/Extractor/AbstractFileExtractor.php b/vendor/symfony/translation/Extractor/AbstractFileExtractor.php deleted file mode 100644 index 4c088b94..00000000 --- a/vendor/symfony/translation/Extractor/AbstractFileExtractor.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\Translation\Extractor; - -use Symfony\Component\Translation\Exception\InvalidArgumentException; - -/** - * Base class used by classes that extract translation messages from files. - * - * @author Marcos D. Sánchez - */ -abstract class AbstractFileExtractor -{ - protected function extractFiles(string|iterable $resource): iterable - { - if (is_iterable($resource)) { - $files = []; - foreach ($resource as $file) { - if ($this->canBeExtracted($file)) { - $files[] = $this->toSplFileInfo($file); - } - } - } elseif (is_file($resource)) { - $files = $this->canBeExtracted($resource) ? [$this->toSplFileInfo($resource)] : []; - } else { - $files = $this->extractFromDirectory($resource); - } - - return $files; - } - - private function toSplFileInfo(string $file): \SplFileInfo - { - return new \SplFileInfo($file); - } - - /** - * @throws InvalidArgumentException - */ - protected function isFile(string $file): bool - { - if (!is_file($file)) { - throw new InvalidArgumentException(sprintf('The "%s" file does not exist.', $file)); - } - - return true; - } - - /** - * @return bool - */ - abstract protected function canBeExtracted(string $file); - - /** - * @return iterable - */ - abstract protected function extractFromDirectory(string|array $resource); -} diff --git a/vendor/symfony/translation/Extractor/ChainExtractor.php b/vendor/symfony/translation/Extractor/ChainExtractor.php deleted file mode 100644 index 0d2132f7..00000000 --- a/vendor/symfony/translation/Extractor/ChainExtractor.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\Translation\Extractor; - -use Symfony\Component\Translation\MessageCatalogue; - -/** - * ChainExtractor extracts translation messages from template files. - * - * @author Michel Salib - */ -class ChainExtractor implements ExtractorInterface -{ - /** - * The extractors. - * - * @var ExtractorInterface[] - */ - private array $extractors = []; - - /** - * Adds a loader to the translation extractor. - */ - public function addExtractor(string $format, ExtractorInterface $extractor) - { - $this->extractors[$format] = $extractor; - } - - public function setPrefix(string $prefix) - { - foreach ($this->extractors as $extractor) { - $extractor->setPrefix($prefix); - } - } - - public function extract(string|iterable $directory, MessageCatalogue $catalogue) - { - foreach ($this->extractors as $extractor) { - $extractor->extract($directory, $catalogue); - } - } -} diff --git a/vendor/symfony/translation/Extractor/ExtractorInterface.php b/vendor/symfony/translation/Extractor/ExtractorInterface.php deleted file mode 100644 index b76a7f20..00000000 --- a/vendor/symfony/translation/Extractor/ExtractorInterface.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Extractor; - -use Symfony\Component\Translation\MessageCatalogue; - -/** - * Extracts translation messages from a directory or files to the catalogue. - * New found messages are injected to the catalogue using the prefix. - * - * @author Michel Salib - */ -interface ExtractorInterface -{ - /** - * Extracts translation messages from files, a file or a directory to the catalogue. - * - * @param string|iterable $resource Files, a file or a directory - */ - public function extract(string|iterable $resource, MessageCatalogue $catalogue); - - /** - * Sets the prefix that should be used for new found messages. - */ - public function setPrefix(string $prefix); -} diff --git a/vendor/symfony/translation/Extractor/PhpAstExtractor.php b/vendor/symfony/translation/Extractor/PhpAstExtractor.php deleted file mode 100644 index d0bbf0e0..00000000 --- a/vendor/symfony/translation/Extractor/PhpAstExtractor.php +++ /dev/null @@ -1,78 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Extractor; - -use PhpParser\NodeTraverser; -use PhpParser\NodeVisitor; -use PhpParser\Parser; -use PhpParser\ParserFactory; -use Symfony\Component\Finder\Finder; -use Symfony\Component\Translation\Extractor\Visitor\AbstractVisitor; -use Symfony\Component\Translation\MessageCatalogue; - -/** - * PhpAstExtractor extracts translation messages from a PHP AST. - * - * @author Mathieu Santostefano - */ -final class PhpAstExtractor extends AbstractFileExtractor implements ExtractorInterface -{ - private Parser $parser; - - public function __construct( - /** - * @param iterable $visitors - */ - private readonly iterable $visitors, - private string $prefix = '', - ) { - if (!class_exists(ParserFactory::class)) { - throw new \LogicException(sprintf('You cannot use "%s" as the "nikic/php-parser" package is not installed. Try running "composer require nikic/php-parser".', static::class)); - } - - $this->parser = (new ParserFactory())->create(ParserFactory::PREFER_PHP7); - } - - public function extract(iterable|string $resource, MessageCatalogue $catalogue): void - { - foreach ($this->extractFiles($resource) as $file) { - $traverser = new NodeTraverser(); - /** @var AbstractVisitor&NodeVisitor $visitor */ - foreach ($this->visitors as $visitor) { - $visitor->initialize($catalogue, $file, $this->prefix); - $traverser->addVisitor($visitor); - } - - $nodes = $this->parser->parse(file_get_contents($file)); - $traverser->traverse($nodes); - } - } - - public function setPrefix(string $prefix): void - { - $this->prefix = $prefix; - } - - protected function canBeExtracted(string $file): bool - { - return 'php' === pathinfo($file, \PATHINFO_EXTENSION) && $this->isFile($file); - } - - protected function extractFromDirectory(array|string $resource): iterable|Finder - { - if (!class_exists(Finder::class)) { - throw new \LogicException(sprintf('You cannot use "%s" as the "symfony/finder" package is not installed. Try running "composer require symfony/finder".', static::class)); - } - - return (new Finder())->files()->name('*.php')->in($resource); - } -} diff --git a/vendor/symfony/translation/Extractor/PhpExtractor.php b/vendor/symfony/translation/Extractor/PhpExtractor.php deleted file mode 100644 index 329d6192..00000000 --- a/vendor/symfony/translation/Extractor/PhpExtractor.php +++ /dev/null @@ -1,325 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Extractor; - -trigger_deprecation('symfony/translation', '6.2', '"%s" is deprecated, use "%s" instead.', PhpExtractor::class, PhpAstExtractor::class); - -use Symfony\Component\Finder\Finder; -use Symfony\Component\Translation\MessageCatalogue; - -/** - * PhpExtractor extracts translation messages from a PHP template. - * - * @author Michel Salib - * - * @deprecated since Symfony 6.2, use the PhpAstExtractor instead - */ -class PhpExtractor extends AbstractFileExtractor implements ExtractorInterface -{ - public const MESSAGE_TOKEN = 300; - public const METHOD_ARGUMENTS_TOKEN = 1000; - public const DOMAIN_TOKEN = 1001; - - /** - * Prefix for new found message. - */ - private string $prefix = ''; - - /** - * The sequence that captures translation messages. - */ - protected $sequences = [ - [ - '->', - 'trans', - '(', - self::MESSAGE_TOKEN, - ',', - self::METHOD_ARGUMENTS_TOKEN, - ',', - self::DOMAIN_TOKEN, - ], - [ - '->', - 'trans', - '(', - self::MESSAGE_TOKEN, - ], - [ - 'new', - 'TranslatableMessage', - '(', - self::MESSAGE_TOKEN, - ',', - self::METHOD_ARGUMENTS_TOKEN, - ',', - self::DOMAIN_TOKEN, - ], - [ - 'new', - 'TranslatableMessage', - '(', - self::MESSAGE_TOKEN, - ], - [ - 'new', - '\\', - 'Symfony', - '\\', - 'Component', - '\\', - 'Translation', - '\\', - 'TranslatableMessage', - '(', - self::MESSAGE_TOKEN, - ',', - self::METHOD_ARGUMENTS_TOKEN, - ',', - self::DOMAIN_TOKEN, - ], - [ - 'new', - '\Symfony\Component\Translation\TranslatableMessage', - '(', - self::MESSAGE_TOKEN, - ',', - self::METHOD_ARGUMENTS_TOKEN, - ',', - self::DOMAIN_TOKEN, - ], - [ - 'new', - '\\', - 'Symfony', - '\\', - 'Component', - '\\', - 'Translation', - '\\', - 'TranslatableMessage', - '(', - self::MESSAGE_TOKEN, - ], - [ - 'new', - '\Symfony\Component\Translation\TranslatableMessage', - '(', - self::MESSAGE_TOKEN, - ], - [ - 't', - '(', - self::MESSAGE_TOKEN, - ',', - self::METHOD_ARGUMENTS_TOKEN, - ',', - self::DOMAIN_TOKEN, - ], - [ - 't', - '(', - self::MESSAGE_TOKEN, - ], - ]; - - public function extract(string|iterable $resource, MessageCatalogue $catalog) - { - $files = $this->extractFiles($resource); - foreach ($files as $file) { - $this->parseTokens(token_get_all(file_get_contents($file)), $catalog, $file); - - gc_mem_caches(); - } - } - - public function setPrefix(string $prefix) - { - $this->prefix = $prefix; - } - - /** - * Normalizes a token. - */ - protected function normalizeToken(mixed $token): ?string - { - if (isset($token[1]) && 'b"' !== $token) { - return $token[1]; - } - - return $token; - } - - /** - * Seeks to a non-whitespace token. - */ - private function seekToNextRelevantToken(\Iterator $tokenIterator) - { - for (; $tokenIterator->valid(); $tokenIterator->next()) { - $t = $tokenIterator->current(); - if (\T_WHITESPACE !== $t[0]) { - break; - } - } - } - - private function skipMethodArgument(\Iterator $tokenIterator) - { - $openBraces = 0; - - for (; $tokenIterator->valid(); $tokenIterator->next()) { - $t = $tokenIterator->current(); - - if ('[' === $t[0] || '(' === $t[0]) { - ++$openBraces; - } - - if (']' === $t[0] || ')' === $t[0]) { - --$openBraces; - } - - if ((0 === $openBraces && ',' === $t[0]) || (-1 === $openBraces && ')' === $t[0])) { - break; - } - } - } - - /** - * Extracts the message from the iterator while the tokens - * match allowed message tokens. - */ - private function getValue(\Iterator $tokenIterator) - { - $message = ''; - $docToken = ''; - $docPart = ''; - - for (; $tokenIterator->valid(); $tokenIterator->next()) { - $t = $tokenIterator->current(); - if ('.' === $t) { - // Concatenate with next token - continue; - } - if (!isset($t[1])) { - break; - } - - switch ($t[0]) { - case \T_START_HEREDOC: - $docToken = $t[1]; - break; - case \T_ENCAPSED_AND_WHITESPACE: - case \T_CONSTANT_ENCAPSED_STRING: - if ('' === $docToken) { - $message .= PhpStringTokenParser::parse($t[1]); - } else { - $docPart = $t[1]; - } - break; - case \T_END_HEREDOC: - if ($indentation = strspn($t[1], ' ')) { - $docPartWithLineBreaks = $docPart; - $docPart = ''; - - foreach (preg_split('~(\r\n|\n|\r)~', $docPartWithLineBreaks, -1, \PREG_SPLIT_DELIM_CAPTURE) as $str) { - if (\in_array($str, ["\r\n", "\n", "\r"], true)) { - $docPart .= $str; - } else { - $docPart .= substr($str, $indentation); - } - } - } - - $message .= PhpStringTokenParser::parseDocString($docToken, $docPart); - $docToken = ''; - $docPart = ''; - break; - case \T_WHITESPACE: - break; - default: - break 2; - } - } - - return $message; - } - - /** - * Extracts trans message from PHP tokens. - */ - protected function parseTokens(array $tokens, MessageCatalogue $catalog, string $filename) - { - $tokenIterator = new \ArrayIterator($tokens); - - for ($key = 0; $key < $tokenIterator->count(); ++$key) { - foreach ($this->sequences as $sequence) { - $message = ''; - $domain = 'messages'; - $tokenIterator->seek($key); - - foreach ($sequence as $sequenceKey => $item) { - $this->seekToNextRelevantToken($tokenIterator); - - if ($this->normalizeToken($tokenIterator->current()) === $item) { - $tokenIterator->next(); - continue; - } elseif (self::MESSAGE_TOKEN === $item) { - $message = $this->getValue($tokenIterator); - - if (\count($sequence) === ($sequenceKey + 1)) { - break; - } - } elseif (self::METHOD_ARGUMENTS_TOKEN === $item) { - $this->skipMethodArgument($tokenIterator); - } elseif (self::DOMAIN_TOKEN === $item) { - $domainToken = $this->getValue($tokenIterator); - if ('' !== $domainToken) { - $domain = $domainToken; - } - - break; - } else { - break; - } - } - - if ($message) { - $catalog->set($message, $this->prefix.$message, $domain); - $metadata = $catalog->getMetadata($message, $domain) ?? []; - $normalizedFilename = preg_replace('{[\\\\/]+}', '/', $filename); - $metadata['sources'][] = $normalizedFilename.':'.$tokens[$key][2]; - $catalog->setMetadata($message, $metadata, $domain); - break; - } - } - } - } - - /** - * @throws \InvalidArgumentException - */ - protected function canBeExtracted(string $file): bool - { - return $this->isFile($file) && 'php' === pathinfo($file, \PATHINFO_EXTENSION); - } - - protected function extractFromDirectory(string|array $directory): iterable - { - if (!class_exists(Finder::class)) { - throw new \LogicException(sprintf('You cannot use "%s" as the "symfony/finder" package is not installed. Try running "composer require symfony/finder".', static::class)); - } - - $finder = new Finder(); - - return $finder->files()->name('*.php')->in($directory); - } -} diff --git a/vendor/symfony/translation/Extractor/PhpStringTokenParser.php b/vendor/symfony/translation/Extractor/PhpStringTokenParser.php deleted file mode 100644 index 3b854ce7..00000000 --- a/vendor/symfony/translation/Extractor/PhpStringTokenParser.php +++ /dev/null @@ -1,141 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Extractor; - -trigger_deprecation('symfony/translation', '6.2', '"%s" is deprecated.', PhpStringTokenParser::class); - -/* - * The following is derived from code at http://github.com/nikic/PHP-Parser - * - * Copyright (c) 2011 by Nikita Popov - * - * Some 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. - * - * * The names of the contributors may not 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. - */ - -/** - * @deprecated since Symfony 6.2 - */ -class PhpStringTokenParser -{ - protected static $replacements = [ - '\\' => '\\', - '$' => '$', - 'n' => "\n", - 'r' => "\r", - 't' => "\t", - 'f' => "\f", - 'v' => "\v", - 'e' => "\x1B", - ]; - - /** - * Parses a string token. - * - * @param string $str String token content - */ - public static function parse(string $str): string - { - $bLength = 0; - if ('b' === $str[0]) { - $bLength = 1; - } - - if ('\'' === $str[$bLength]) { - return str_replace( - ['\\\\', '\\\''], - ['\\', '\''], - substr($str, $bLength + 1, -1) - ); - } else { - return self::parseEscapeSequences(substr($str, $bLength + 1, -1), '"'); - } - } - - /** - * Parses escape sequences in strings (all string types apart from single quoted). - * - * @param string $str String without quotes - * @param string|null $quote Quote type - */ - public static function parseEscapeSequences(string $str, string $quote = null): string - { - if (null !== $quote) { - $str = str_replace('\\'.$quote, $quote, $str); - } - - return preg_replace_callback( - '~\\\\([\\\\$nrtfve]|[xX][0-9a-fA-F]{1,2}|[0-7]{1,3})~', - [__CLASS__, 'parseCallback'], - $str - ); - } - - private static function parseCallback(array $matches): string - { - $str = $matches[1]; - - if (isset(self::$replacements[$str])) { - return self::$replacements[$str]; - } elseif ('x' === $str[0] || 'X' === $str[0]) { - return \chr(hexdec($str)); - } else { - return \chr(octdec($str)); - } - } - - /** - * Parses a constant doc string. - * - * @param string $startToken Doc string start token content (<< - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Extractor\Visitor; - -use PhpParser\Node; -use Symfony\Component\Translation\MessageCatalogue; - -/** - * @author Mathieu Santostefano - */ -abstract class AbstractVisitor -{ - private MessageCatalogue $catalogue; - private \SplFileInfo $file; - private string $messagePrefix; - - public function initialize(MessageCatalogue $catalogue, \SplFileInfo $file, string $messagePrefix): void - { - $this->catalogue = $catalogue; - $this->file = $file; - $this->messagePrefix = $messagePrefix; - } - - protected function addMessageToCatalogue(string $message, ?string $domain, int $line): void - { - $domain ??= 'messages'; - $this->catalogue->set($message, $this->messagePrefix.$message, $domain); - $metadata = $this->catalogue->getMetadata($message, $domain) ?? []; - $normalizedFilename = preg_replace('{[\\\\/]+}', '/', $this->file); - $metadata['sources'][] = $normalizedFilename.':'.$line; - $this->catalogue->setMetadata($message, $metadata, $domain); - } - - protected function getStringArguments(Node\Expr\CallLike|Node\Attribute|Node\Expr\New_ $node, int|string $index, bool $indexIsRegex = false): array - { - if (\is_string($index)) { - return $this->getStringNamedArguments($node, $index, $indexIsRegex); - } - - $args = $node instanceof Node\Expr\CallLike ? $node->getRawArgs() : $node->args; - - if (!($arg = $args[$index] ?? null) instanceof Node\Arg) { - return []; - } - - return (array) $this->getStringValue($arg->value); - } - - protected function hasNodeNamedArguments(Node\Expr\CallLike|Node\Attribute|Node\Expr\New_ $node): bool - { - $args = $node instanceof Node\Expr\CallLike ? $node->getRawArgs() : $node->args; - - foreach ($args as $arg) { - if ($arg instanceof Node\Arg && null !== $arg->name) { - return true; - } - } - - return false; - } - - private function getStringNamedArguments(Node\Expr\CallLike|Node\Attribute $node, string $argumentName = null, bool $isArgumentNamePattern = false): array - { - $args = $node instanceof Node\Expr\CallLike ? $node->getArgs() : $node->args; - $argumentValues = []; - - foreach ($args as $arg) { - if (!$isArgumentNamePattern && $arg->name?->toString() === $argumentName) { - $argumentValues[] = $this->getStringValue($arg->value); - } elseif ($isArgumentNamePattern && preg_match($argumentName, $arg->name?->toString() ?? '') > 0) { - $argumentValues[] = $this->getStringValue($arg->value); - } - } - - return array_filter($argumentValues); - } - - private function getStringValue(Node $node): ?string - { - if ($node instanceof Node\Scalar\String_) { - return $node->value; - } - - if ($node instanceof Node\Expr\BinaryOp\Concat) { - if (null === $left = $this->getStringValue($node->left)) { - return null; - } - - if (null === $right = $this->getStringValue($node->right)) { - return null; - } - - return $left.$right; - } - - if ($node instanceof Node\Expr\Assign && $node->expr instanceof Node\Scalar\String_) { - return $node->expr->value; - } - - return null; - } -} diff --git a/vendor/symfony/translation/Extractor/Visitor/ConstraintVisitor.php b/vendor/symfony/translation/Extractor/Visitor/ConstraintVisitor.php deleted file mode 100644 index 6552a66d..00000000 --- a/vendor/symfony/translation/Extractor/Visitor/ConstraintVisitor.php +++ /dev/null @@ -1,113 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Extractor\Visitor; - -use PhpParser\Node; -use PhpParser\NodeVisitor; - -/** - * @author Mathieu Santostefano - * - * Code mostly comes from https://github.com/php-translation/extractor/blob/master/src/Visitor/Php/Symfony/Constraint.php - */ -final class ConstraintVisitor extends AbstractVisitor implements NodeVisitor -{ - private const CONSTRAINT_VALIDATION_MESSAGE_PATTERN = '/[a-zA-Z]*message/i'; - - public function __construct( - private readonly array $constraintClassNames = [] - ) { - } - - public function beforeTraverse(array $nodes): ?Node - { - return null; - } - - public function enterNode(Node $node): ?Node - { - if (!$node instanceof Node\Expr\New_ && !$node instanceof Node\Attribute) { - return null; - } - - $className = $node instanceof Node\Attribute ? $node->name : $node->class; - if (!$className instanceof Node\Name) { - return null; - } - - $parts = $className->parts; - $isConstraintClass = false; - - foreach ($parts as $part) { - if (\in_array($part, $this->constraintClassNames, true)) { - $isConstraintClass = true; - - break; - } - } - - if (!$isConstraintClass) { - return null; - } - - $arg = $node->args[0] ?? null; - if (!$arg instanceof Node\Arg) { - return null; - } - - if ($this->hasNodeNamedArguments($node)) { - $messages = $this->getStringArguments($node, self::CONSTRAINT_VALIDATION_MESSAGE_PATTERN, true); - } else { - if (!$arg->value instanceof Node\Expr\Array_) { - // There is no way to guess which argument is a message to be translated. - return null; - } - - $options = $arg->value; - - /** @var Node\Expr\ArrayItem $item */ - foreach ($options->items as $item) { - if (!$item->key instanceof Node\Scalar\String_) { - continue; - } - - if (!preg_match(self::CONSTRAINT_VALIDATION_MESSAGE_PATTERN, $item->key->value ?? '')) { - continue; - } - - if (!$item->value instanceof Node\Scalar\String_) { - continue; - } - - $messages[] = $item->value->value; - - break; - } - } - - foreach ($messages as $message) { - $this->addMessageToCatalogue($message, 'validators', $node->getStartLine()); - } - - return null; - } - - public function leaveNode(Node $node): ?Node - { - return null; - } - - public function afterTraverse(array $nodes): ?Node - { - return null; - } -} diff --git a/vendor/symfony/translation/Extractor/Visitor/TransMethodVisitor.php b/vendor/symfony/translation/Extractor/Visitor/TransMethodVisitor.php deleted file mode 100644 index 2c616594..00000000 --- a/vendor/symfony/translation/Extractor/Visitor/TransMethodVisitor.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\Translation\Extractor\Visitor; - -use PhpParser\Node; -use PhpParser\NodeVisitor; - -/** - * @author Mathieu Santostefano - */ -final class TransMethodVisitor extends AbstractVisitor implements NodeVisitor -{ - public function beforeTraverse(array $nodes): ?Node - { - return null; - } - - public function enterNode(Node $node): ?Node - { - if (!$node instanceof Node\Expr\MethodCall && !$node instanceof Node\Expr\FuncCall) { - return null; - } - - if (!\is_string($node->name) && !$node->name instanceof Node\Identifier && !$node->name instanceof Node\Name) { - return null; - } - - $name = (string) $node->name; - - if ('trans' === $name || 't' === $name) { - $nodeHasNamedArguments = $this->hasNodeNamedArguments($node); - if (!$messages = $this->getStringArguments($node, $nodeHasNamedArguments ? 'message' : 0)) { - return null; - } - - $domain = $this->getStringArguments($node, $nodeHasNamedArguments ? 'domain' : 2)[0] ?? null; - - foreach ($messages as $message) { - $this->addMessageToCatalogue($message, $domain, $node->getStartLine()); - } - } - - return null; - } - - public function leaveNode(Node $node): ?Node - { - return null; - } - - public function afterTraverse(array $nodes): ?Node - { - return null; - } -} diff --git a/vendor/symfony/translation/Extractor/Visitor/TranslatableMessageVisitor.php b/vendor/symfony/translation/Extractor/Visitor/TranslatableMessageVisitor.php deleted file mode 100644 index 423982c8..00000000 --- a/vendor/symfony/translation/Extractor/Visitor/TranslatableMessageVisitor.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Extractor\Visitor; - -use PhpParser\Node; -use PhpParser\NodeVisitor; - -/** - * @author Mathieu Santostefano - */ -final class TranslatableMessageVisitor extends AbstractVisitor implements NodeVisitor -{ - public function beforeTraverse(array $nodes): ?Node - { - return null; - } - - public function enterNode(Node $node): ?Node - { - if (!$node instanceof Node\Expr\New_) { - return null; - } - - if (!($className = $node->class) instanceof Node\Name) { - return null; - } - - if (!\in_array('TranslatableMessage', $className->parts, true)) { - return null; - } - - $nodeHasNamedArguments = $this->hasNodeNamedArguments($node); - - if (!$messages = $this->getStringArguments($node, $nodeHasNamedArguments ? 'message' : 0)) { - return null; - } - - $domain = $this->getStringArguments($node, $nodeHasNamedArguments ? 'domain' : 2)[0] ?? null; - - foreach ($messages as $message) { - $this->addMessageToCatalogue($message, $domain, $node->getStartLine()); - } - - return null; - } - - public function leaveNode(Node $node): ?Node - { - return null; - } - - public function afterTraverse(array $nodes): ?Node - { - return null; - } -} diff --git a/vendor/symfony/translation/Formatter/IntlFormatter.php b/vendor/symfony/translation/Formatter/IntlFormatter.php deleted file mode 100644 index 30873cc5..00000000 --- a/vendor/symfony/translation/Formatter/IntlFormatter.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. - */ - -namespace Symfony\Component\Translation\Formatter; - -use Symfony\Component\Translation\Exception\InvalidArgumentException; -use Symfony\Component\Translation\Exception\LogicException; - -/** - * @author Guilherme Blanco - * @author Abdellatif Ait boudad - */ -class IntlFormatter implements IntlFormatterInterface -{ - private $hasMessageFormatter; - private $cache = []; - - public function formatIntl(string $message, string $locale, array $parameters = []): string - { - // MessageFormatter constructor throws an exception if the message is empty - if ('' === $message) { - return ''; - } - - if (!$formatter = $this->cache[$locale][$message] ?? null) { - if (!$this->hasMessageFormatter ??= class_exists(\MessageFormatter::class)) { - throw new LogicException('Cannot parse message translation: please install the "intl" PHP extension or the "symfony/polyfill-intl-messageformatter" package.'); - } - try { - $this->cache[$locale][$message] = $formatter = new \MessageFormatter($locale, $message); - } catch (\IntlException $e) { - throw new InvalidArgumentException(sprintf('Invalid message format (error #%d): ', intl_get_error_code()).intl_get_error_message(), 0, $e); - } - } - - foreach ($parameters as $key => $value) { - if (\in_array($key[0] ?? null, ['%', '{'], true)) { - unset($parameters[$key]); - $parameters[trim($key, '%{ }')] = $value; - } - } - - if (false === $message = $formatter->format($parameters)) { - throw new InvalidArgumentException(sprintf('Unable to format message (error #%s): ', $formatter->getErrorCode()).$formatter->getErrorMessage()); - } - - return $message; - } -} diff --git a/vendor/symfony/translation/Formatter/IntlFormatterInterface.php b/vendor/symfony/translation/Formatter/IntlFormatterInterface.php deleted file mode 100644 index 02fc6acb..00000000 --- a/vendor/symfony/translation/Formatter/IntlFormatterInterface.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\Translation\Formatter; - -/** - * Formats ICU message patterns. - * - * @author Nicolas Grekas - */ -interface IntlFormatterInterface -{ - /** - * Formats a localized message using rules defined by ICU MessageFormat. - * - * @see http://icu-project.org/apiref/icu4c/classMessageFormat.html#details - */ - public function formatIntl(string $message, string $locale, array $parameters = []): string; -} diff --git a/vendor/symfony/translation/Formatter/MessageFormatter.php b/vendor/symfony/translation/Formatter/MessageFormatter.php deleted file mode 100644 index 29ad574e..00000000 --- a/vendor/symfony/translation/Formatter/MessageFormatter.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Formatter; - -use Symfony\Component\Translation\IdentityTranslator; -use Symfony\Contracts\Translation\TranslatorInterface; - -// Help opcache.preload discover always-needed symbols -class_exists(IntlFormatter::class); - -/** - * @author Abdellatif Ait boudad - */ -class MessageFormatter implements MessageFormatterInterface, IntlFormatterInterface -{ - private TranslatorInterface $translator; - private IntlFormatterInterface $intlFormatter; - - /** - * @param TranslatorInterface|null $translator An identity translator to use as selector for pluralization - */ - public function __construct(TranslatorInterface $translator = null, IntlFormatterInterface $intlFormatter = null) - { - $this->translator = $translator ?? new IdentityTranslator(); - $this->intlFormatter = $intlFormatter ?? new IntlFormatter(); - } - - public function format(string $message, string $locale, array $parameters = []): string - { - if ($this->translator instanceof TranslatorInterface) { - return $this->translator->trans($message, $parameters, null, $locale); - } - - return strtr($message, $parameters); - } - - public function formatIntl(string $message, string $locale, array $parameters = []): string - { - return $this->intlFormatter->formatIntl($message, $locale, $parameters); - } -} diff --git a/vendor/symfony/translation/Formatter/MessageFormatterInterface.php b/vendor/symfony/translation/Formatter/MessageFormatterInterface.php deleted file mode 100644 index d5c41c19..00000000 --- a/vendor/symfony/translation/Formatter/MessageFormatterInterface.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\Translation\Formatter; - -/** - * @author Guilherme Blanco - * @author Abdellatif Ait boudad - */ -interface MessageFormatterInterface -{ - /** - * Formats a localized message pattern with given arguments. - * - * @param string $message The message (may also be an object that can be cast to string) - * @param string $locale The message locale - * @param array $parameters An array of parameters for the message - */ - public function format(string $message, string $locale, array $parameters = []): string; -} diff --git a/vendor/symfony/translation/IdentityTranslator.php b/vendor/symfony/translation/IdentityTranslator.php deleted file mode 100644 index 46875edf..00000000 --- a/vendor/symfony/translation/IdentityTranslator.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\Translation; - -use Symfony\Contracts\Translation\LocaleAwareInterface; -use Symfony\Contracts\Translation\TranslatorInterface; -use Symfony\Contracts\Translation\TranslatorTrait; - -/** - * IdentityTranslator does not translate anything. - * - * @author Fabien Potencier - */ -class IdentityTranslator implements TranslatorInterface, LocaleAwareInterface -{ - use TranslatorTrait; -} diff --git a/vendor/symfony/translation/LICENSE b/vendor/symfony/translation/LICENSE deleted file mode 100644 index 88bf75bb..00000000 --- a/vendor/symfony/translation/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2022 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/translation/Loader/ArrayLoader.php b/vendor/symfony/translation/Loader/ArrayLoader.php deleted file mode 100644 index e2404939..00000000 --- a/vendor/symfony/translation/Loader/ArrayLoader.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Loader; - -use Symfony\Component\Translation\MessageCatalogue; - -/** - * ArrayLoader loads translations from a PHP array. - * - * @author Fabien Potencier - */ -class ArrayLoader implements LoaderInterface -{ - public function load(mixed $resource, string $locale, string $domain = 'messages'): MessageCatalogue - { - $resource = $this->flatten($resource); - $catalogue = new MessageCatalogue($locale); - $catalogue->add($resource, $domain); - - return $catalogue; - } - - /** - * Flattens an nested array of translations. - * - * The scheme used is: - * 'key' => ['key2' => ['key3' => 'value']] - * Becomes: - * 'key.key2.key3' => 'value' - */ - private function flatten(array $messages): array - { - $result = []; - foreach ($messages as $key => $value) { - if (\is_array($value)) { - foreach ($this->flatten($value) as $k => $v) { - $result[$key.'.'.$k] = $v; - } - } else { - $result[$key] = $value; - } - } - - return $result; - } -} diff --git a/vendor/symfony/translation/Loader/CsvFileLoader.php b/vendor/symfony/translation/Loader/CsvFileLoader.php deleted file mode 100644 index 7620b72d..00000000 --- a/vendor/symfony/translation/Loader/CsvFileLoader.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\Translation\Loader; - -use Symfony\Component\Translation\Exception\NotFoundResourceException; - -/** - * CsvFileLoader loads translations from CSV files. - * - * @author Saša Stamenković - */ -class CsvFileLoader extends FileLoader -{ - private string $delimiter = ';'; - private string $enclosure = '"'; - private string $escape = '\\'; - - protected function loadResource(string $resource): array - { - $messages = []; - - try { - $file = new \SplFileObject($resource, 'rb'); - } catch (\RuntimeException $e) { - throw new NotFoundResourceException(sprintf('Error opening file "%s".', $resource), 0, $e); - } - - $file->setFlags(\SplFileObject::READ_CSV | \SplFileObject::SKIP_EMPTY); - $file->setCsvControl($this->delimiter, $this->enclosure, $this->escape); - - foreach ($file as $data) { - if (false === $data) { - continue; - } - - if (!str_starts_with($data[0], '#') && isset($data[1]) && 2 === \count($data)) { - $messages[$data[0]] = $data[1]; - } - } - - return $messages; - } - - /** - * Sets the delimiter, enclosure, and escape character for CSV. - */ - public function setCsvControl(string $delimiter = ';', string $enclosure = '"', string $escape = '\\') - { - $this->delimiter = $delimiter; - $this->enclosure = $enclosure; - $this->escape = $escape; - } -} diff --git a/vendor/symfony/translation/Loader/FileLoader.php b/vendor/symfony/translation/Loader/FileLoader.php deleted file mode 100644 index 877c3bbc..00000000 --- a/vendor/symfony/translation/Loader/FileLoader.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. - */ - -namespace Symfony\Component\Translation\Loader; - -use Symfony\Component\Config\Resource\FileResource; -use Symfony\Component\Translation\Exception\InvalidResourceException; -use Symfony\Component\Translation\Exception\NotFoundResourceException; -use Symfony\Component\Translation\MessageCatalogue; - -/** - * @author Abdellatif Ait boudad - */ -abstract class FileLoader extends ArrayLoader -{ - public function load(mixed $resource, string $locale, string $domain = 'messages'): MessageCatalogue - { - if (!stream_is_local($resource)) { - throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource)); - } - - if (!file_exists($resource)) { - throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource)); - } - - $messages = $this->loadResource($resource); - - // empty resource - $messages ??= []; - - // not an array - if (!\is_array($messages)) { - throw new InvalidResourceException(sprintf('Unable to load file "%s".', $resource)); - } - - $catalogue = parent::load($messages, $locale, $domain); - - if (class_exists(FileResource::class)) { - $catalogue->addResource(new FileResource($resource)); - } - - return $catalogue; - } - - /** - * @throws InvalidResourceException if stream content has an invalid format - */ - abstract protected function loadResource(string $resource): array; -} diff --git a/vendor/symfony/translation/Loader/IcuDatFileLoader.php b/vendor/symfony/translation/Loader/IcuDatFileLoader.php deleted file mode 100644 index 76e4e7f0..00000000 --- a/vendor/symfony/translation/Loader/IcuDatFileLoader.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Loader; - -use Symfony\Component\Config\Resource\FileResource; -use Symfony\Component\Translation\Exception\InvalidResourceException; -use Symfony\Component\Translation\Exception\NotFoundResourceException; -use Symfony\Component\Translation\MessageCatalogue; - -/** - * IcuResFileLoader loads translations from a resource bundle. - * - * @author stealth35 - */ -class IcuDatFileLoader extends IcuResFileLoader -{ - public function load(mixed $resource, string $locale, string $domain = 'messages'): MessageCatalogue - { - if (!stream_is_local($resource.'.dat')) { - throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource)); - } - - if (!file_exists($resource.'.dat')) { - throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource)); - } - - try { - $rb = new \ResourceBundle($locale, $resource); - } catch (\Exception) { - $rb = null; - } - - if (!$rb) { - throw new InvalidResourceException(sprintf('Cannot load resource "%s".', $resource)); - } elseif (intl_is_failure($rb->getErrorCode())) { - throw new InvalidResourceException($rb->getErrorMessage(), $rb->getErrorCode()); - } - - $messages = $this->flatten($rb); - $catalogue = new MessageCatalogue($locale); - $catalogue->add($messages, $domain); - - if (class_exists(FileResource::class)) { - $catalogue->addResource(new FileResource($resource.'.dat')); - } - - return $catalogue; - } -} diff --git a/vendor/symfony/translation/Loader/IcuResFileLoader.php b/vendor/symfony/translation/Loader/IcuResFileLoader.php deleted file mode 100644 index a5fa4fb4..00000000 --- a/vendor/symfony/translation/Loader/IcuResFileLoader.php +++ /dev/null @@ -1,86 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Loader; - -use Symfony\Component\Config\Resource\DirectoryResource; -use Symfony\Component\Translation\Exception\InvalidResourceException; -use Symfony\Component\Translation\Exception\NotFoundResourceException; -use Symfony\Component\Translation\MessageCatalogue; - -/** - * IcuResFileLoader loads translations from a resource bundle. - * - * @author stealth35 - */ -class IcuResFileLoader implements LoaderInterface -{ - public function load(mixed $resource, string $locale, string $domain = 'messages'): MessageCatalogue - { - if (!stream_is_local($resource)) { - throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource)); - } - - if (!is_dir($resource)) { - throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource)); - } - - try { - $rb = new \ResourceBundle($locale, $resource); - } catch (\Exception) { - $rb = null; - } - - if (!$rb) { - throw new InvalidResourceException(sprintf('Cannot load resource "%s".', $resource)); - } elseif (intl_is_failure($rb->getErrorCode())) { - throw new InvalidResourceException($rb->getErrorMessage(), $rb->getErrorCode()); - } - - $messages = $this->flatten($rb); - $catalogue = new MessageCatalogue($locale); - $catalogue->add($messages, $domain); - - if (class_exists(DirectoryResource::class)) { - $catalogue->addResource(new DirectoryResource($resource)); - } - - return $catalogue; - } - - /** - * Flattens an ResourceBundle. - * - * The scheme used is: - * key { key2 { key3 { "value" } } } - * Becomes: - * 'key.key2.key3' => 'value' - * - * This function takes an array by reference and will modify it - * - * @param \ResourceBundle $rb The ResourceBundle that will be flattened - * @param array $messages Used internally for recursive calls - * @param string $path Current path being parsed, used internally for recursive calls - */ - protected function flatten(\ResourceBundle $rb, array &$messages = [], string $path = null): array - { - foreach ($rb as $key => $value) { - $nodePath = $path ? $path.'.'.$key : $key; - if ($value instanceof \ResourceBundle) { - $this->flatten($value, $messages, $nodePath); - } else { - $messages[$nodePath] = $value; - } - } - - return $messages; - } -} diff --git a/vendor/symfony/translation/Loader/IniFileLoader.php b/vendor/symfony/translation/Loader/IniFileLoader.php deleted file mode 100644 index 3126896c..00000000 --- a/vendor/symfony/translation/Loader/IniFileLoader.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\Translation\Loader; - -/** - * IniFileLoader loads translations from an ini file. - * - * @author stealth35 - */ -class IniFileLoader extends FileLoader -{ - protected function loadResource(string $resource): array - { - return parse_ini_file($resource, true); - } -} diff --git a/vendor/symfony/translation/Loader/JsonFileLoader.php b/vendor/symfony/translation/Loader/JsonFileLoader.php deleted file mode 100644 index 385553ef..00000000 --- a/vendor/symfony/translation/Loader/JsonFileLoader.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\Translation\Loader; - -use Symfony\Component\Translation\Exception\InvalidResourceException; - -/** - * JsonFileLoader loads translations from an json file. - * - * @author singles - */ -class JsonFileLoader extends FileLoader -{ - protected function loadResource(string $resource): array - { - $messages = []; - if ($data = file_get_contents($resource)) { - $messages = json_decode($data, true); - - if (0 < $errorCode = json_last_error()) { - throw new InvalidResourceException('Error parsing JSON: '.$this->getJSONErrorMessage($errorCode)); - } - } - - return $messages; - } - - /** - * Translates JSON_ERROR_* constant into meaningful message. - */ - private function getJSONErrorMessage(int $errorCode): string - { - return match ($errorCode) { - \JSON_ERROR_DEPTH => 'Maximum stack depth exceeded', - \JSON_ERROR_STATE_MISMATCH => 'Underflow or the modes mismatch', - \JSON_ERROR_CTRL_CHAR => 'Unexpected control character found', - \JSON_ERROR_SYNTAX => 'Syntax error, malformed JSON', - \JSON_ERROR_UTF8 => 'Malformed UTF-8 characters, possibly incorrectly encoded', - default => 'Unknown error', - }; - } -} diff --git a/vendor/symfony/translation/Loader/LoaderInterface.php b/vendor/symfony/translation/Loader/LoaderInterface.php deleted file mode 100644 index 29d5560d..00000000 --- a/vendor/symfony/translation/Loader/LoaderInterface.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\Translation\Loader; - -use Symfony\Component\Translation\Exception\InvalidResourceException; -use Symfony\Component\Translation\Exception\NotFoundResourceException; -use Symfony\Component\Translation\MessageCatalogue; - -/** - * LoaderInterface is the interface implemented by all translation loaders. - * - * @author Fabien Potencier - */ -interface LoaderInterface -{ - /** - * Loads a locale. - * - * @throws NotFoundResourceException when the resource cannot be found - * @throws InvalidResourceException when the resource cannot be loaded - */ - public function load(mixed $resource, string $locale, string $domain = 'messages'): MessageCatalogue; -} diff --git a/vendor/symfony/translation/Loader/MoFileLoader.php b/vendor/symfony/translation/Loader/MoFileLoader.php deleted file mode 100644 index 8427c393..00000000 --- a/vendor/symfony/translation/Loader/MoFileLoader.php +++ /dev/null @@ -1,138 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Loader; - -use Symfony\Component\Translation\Exception\InvalidResourceException; - -/** - * @copyright Copyright (c) 2010, Union of RAD http://union-of-rad.org (http://lithify.me/) - */ -class MoFileLoader extends FileLoader -{ - /** - * Magic used for validating the format of an MO file as well as - * detecting if the machine used to create that file was little endian. - */ - public const MO_LITTLE_ENDIAN_MAGIC = 0x950412DE; - - /** - * Magic used for validating the format of an MO file as well as - * detecting if the machine used to create that file was big endian. - */ - public const MO_BIG_ENDIAN_MAGIC = 0xDE120495; - - /** - * The size of the header of an MO file in bytes. - */ - public const MO_HEADER_SIZE = 28; - - /** - * Parses machine object (MO) format, independent of the machine's endian it - * was created on. Both 32bit and 64bit systems are supported. - */ - protected function loadResource(string $resource): array - { - $stream = fopen($resource, 'r'); - - $stat = fstat($stream); - - if ($stat['size'] < self::MO_HEADER_SIZE) { - throw new InvalidResourceException('MO stream content has an invalid format.'); - } - $magic = unpack('V1', fread($stream, 4)); - $magic = hexdec(substr(dechex(current($magic)), -8)); - - if (self::MO_LITTLE_ENDIAN_MAGIC == $magic) { - $isBigEndian = false; - } elseif (self::MO_BIG_ENDIAN_MAGIC == $magic) { - $isBigEndian = true; - } else { - throw new InvalidResourceException('MO stream content has an invalid format.'); - } - - // formatRevision - $this->readLong($stream, $isBigEndian); - $count = $this->readLong($stream, $isBigEndian); - $offsetId = $this->readLong($stream, $isBigEndian); - $offsetTranslated = $this->readLong($stream, $isBigEndian); - // sizeHashes - $this->readLong($stream, $isBigEndian); - // offsetHashes - $this->readLong($stream, $isBigEndian); - - $messages = []; - - for ($i = 0; $i < $count; ++$i) { - $pluralId = null; - $translated = null; - - fseek($stream, $offsetId + $i * 8); - - $length = $this->readLong($stream, $isBigEndian); - $offset = $this->readLong($stream, $isBigEndian); - - if ($length < 1) { - continue; - } - - fseek($stream, $offset); - $singularId = fread($stream, $length); - - if (str_contains($singularId, "\000")) { - [$singularId, $pluralId] = explode("\000", $singularId); - } - - fseek($stream, $offsetTranslated + $i * 8); - $length = $this->readLong($stream, $isBigEndian); - $offset = $this->readLong($stream, $isBigEndian); - - if ($length < 1) { - continue; - } - - fseek($stream, $offset); - $translated = fread($stream, $length); - - if (str_contains($translated, "\000")) { - $translated = explode("\000", $translated); - } - - $ids = ['singular' => $singularId, 'plural' => $pluralId]; - $item = compact('ids', 'translated'); - - if (!empty($item['ids']['singular'])) { - $id = $item['ids']['singular']; - if (isset($item['ids']['plural'])) { - $id .= '|'.$item['ids']['plural']; - } - $messages[$id] = stripcslashes(implode('|', (array) $item['translated'])); - } - } - - fclose($stream); - - return array_filter($messages); - } - - /** - * Reads an unsigned long from stream respecting endianness. - * - * @param resource $stream - */ - private function readLong($stream, bool $isBigEndian): int - { - $result = unpack($isBigEndian ? 'N1' : 'V1', fread($stream, 4)); - $result = current($result); - - return (int) substr($result, -8); - } -} diff --git a/vendor/symfony/translation/Loader/PhpFileLoader.php b/vendor/symfony/translation/Loader/PhpFileLoader.php deleted file mode 100644 index 93f23cd9..00000000 --- a/vendor/symfony/translation/Loader/PhpFileLoader.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Loader; - -/** - * PhpFileLoader loads translations from PHP files returning an array of translations. - * - * @author Fabien Potencier - */ -class PhpFileLoader extends FileLoader -{ - private static ?array $cache = []; - - protected function loadResource(string $resource): array - { - if ([] === self::$cache && \function_exists('opcache_invalidate') && filter_var(\ini_get('opcache.enable'), \FILTER_VALIDATE_BOOL) && (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) || filter_var(\ini_get('opcache.enable_cli'), \FILTER_VALIDATE_BOOL))) { - self::$cache = null; - } - - if (null === self::$cache) { - return require $resource; - } - - return self::$cache[$resource] ??= require $resource; - } -} diff --git a/vendor/symfony/translation/Loader/PoFileLoader.php b/vendor/symfony/translation/Loader/PoFileLoader.php deleted file mode 100644 index 9f7f125d..00000000 --- a/vendor/symfony/translation/Loader/PoFileLoader.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. - */ - -namespace Symfony\Component\Translation\Loader; - -/** - * @copyright Copyright (c) 2010, Union of RAD https://github.com/UnionOfRAD/lithium - * @copyright Copyright (c) 2012, Clemens Tolboom - */ -class PoFileLoader extends FileLoader -{ - /** - * Parses portable object (PO) format. - * - * From https://www.gnu.org/software/gettext/manual/gettext.html#PO-Files - * we should be able to parse files having: - * - * white-space - * # translator-comments - * #. extracted-comments - * #: reference... - * #, flag... - * #| msgid previous-untranslated-string - * msgid untranslated-string - * msgstr translated-string - * - * extra or different lines are: - * - * #| msgctxt previous-context - * #| msgid previous-untranslated-string - * msgctxt context - * - * #| msgid previous-untranslated-string-singular - * #| msgid_plural previous-untranslated-string-plural - * msgid untranslated-string-singular - * msgid_plural untranslated-string-plural - * msgstr[0] translated-string-case-0 - * ... - * msgstr[N] translated-string-case-n - * - * The definition states: - * - white-space and comments are optional. - * - msgid "" that an empty singleline defines a header. - * - * This parser sacrifices some features of the reference implementation the - * differences to that implementation are as follows. - * - No support for comments spanning multiple lines. - * - Translator and extracted comments are treated as being the same type. - * - Message IDs are allowed to have other encodings as just US-ASCII. - * - * Items with an empty id are ignored. - */ - protected function loadResource(string $resource): array - { - $stream = fopen($resource, 'r'); - - $defaults = [ - 'ids' => [], - 'translated' => null, - ]; - - $messages = []; - $item = $defaults; - $flags = []; - - while ($line = fgets($stream)) { - $line = trim($line); - - if ('' === $line) { - // Whitespace indicated current item is done - if (!\in_array('fuzzy', $flags)) { - $this->addMessage($messages, $item); - } - $item = $defaults; - $flags = []; - } elseif (str_starts_with($line, '#,')) { - $flags = array_map('trim', explode(',', substr($line, 2))); - } elseif (str_starts_with($line, 'msgid "')) { - // We start a new msg so save previous - // TODO: this fails when comments or contexts are added - $this->addMessage($messages, $item); - $item = $defaults; - $item['ids']['singular'] = substr($line, 7, -1); - } elseif (str_starts_with($line, 'msgstr "')) { - $item['translated'] = substr($line, 8, -1); - } elseif ('"' === $line[0]) { - $continues = isset($item['translated']) ? 'translated' : 'ids'; - - if (\is_array($item[$continues])) { - end($item[$continues]); - $item[$continues][key($item[$continues])] .= substr($line, 1, -1); - } else { - $item[$continues] .= substr($line, 1, -1); - } - } elseif (str_starts_with($line, 'msgid_plural "')) { - $item['ids']['plural'] = substr($line, 14, -1); - } elseif (str_starts_with($line, 'msgstr[')) { - $size = strpos($line, ']'); - $item['translated'][(int) substr($line, 7, 1)] = substr($line, $size + 3, -1); - } - } - // save last item - if (!\in_array('fuzzy', $flags)) { - $this->addMessage($messages, $item); - } - fclose($stream); - - return $messages; - } - - /** - * Save a translation item to the messages. - * - * A .po file could contain by error missing plural indexes. We need to - * fix these before saving them. - */ - private function addMessage(array &$messages, array $item) - { - if (!empty($item['ids']['singular'])) { - $id = stripcslashes($item['ids']['singular']); - if (isset($item['ids']['plural'])) { - $id .= '|'.stripcslashes($item['ids']['plural']); - } - - $translated = (array) $item['translated']; - // PO are by definition indexed so sort by index. - ksort($translated); - // Make sure every index is filled. - end($translated); - $count = key($translated); - // Fill missing spots with '-'. - $empties = array_fill(0, $count + 1, '-'); - $translated += $empties; - ksort($translated); - - $messages[$id] = stripcslashes(implode('|', $translated)); - } - } -} diff --git a/vendor/symfony/translation/Loader/QtFileLoader.php b/vendor/symfony/translation/Loader/QtFileLoader.php deleted file mode 100644 index d91e0a1f..00000000 --- a/vendor/symfony/translation/Loader/QtFileLoader.php +++ /dev/null @@ -1,79 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Loader; - -use Symfony\Component\Config\Resource\FileResource; -use Symfony\Component\Config\Util\XmlUtils; -use Symfony\Component\Translation\Exception\InvalidResourceException; -use Symfony\Component\Translation\Exception\NotFoundResourceException; -use Symfony\Component\Translation\Exception\RuntimeException; -use Symfony\Component\Translation\MessageCatalogue; - -/** - * QtFileLoader loads translations from QT Translations XML files. - * - * @author Benjamin Eberlei - */ -class QtFileLoader implements LoaderInterface -{ - public function load(mixed $resource, string $locale, string $domain = 'messages'): MessageCatalogue - { - if (!class_exists(XmlUtils::class)) { - throw new RuntimeException('Loading translations from the QT format requires the Symfony Config component.'); - } - - if (!stream_is_local($resource)) { - throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource)); - } - - if (!file_exists($resource)) { - throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource)); - } - - try { - $dom = XmlUtils::loadFile($resource); - } catch (\InvalidArgumentException $e) { - throw new InvalidResourceException(sprintf('Unable to load "%s".', $resource), $e->getCode(), $e); - } - - $internalErrors = libxml_use_internal_errors(true); - libxml_clear_errors(); - - $xpath = new \DOMXPath($dom); - $nodes = $xpath->evaluate('//TS/context/name[text()="'.$domain.'"]'); - - $catalogue = new MessageCatalogue($locale); - if (1 == $nodes->length) { - $translations = $nodes->item(0)->nextSibling->parentNode->parentNode->getElementsByTagName('message'); - foreach ($translations as $translation) { - $translationValue = (string) $translation->getElementsByTagName('translation')->item(0)->nodeValue; - - if (!empty($translationValue)) { - $catalogue->set( - (string) $translation->getElementsByTagName('source')->item(0)->nodeValue, - $translationValue, - $domain - ); - } - $translation = $translation->nextSibling; - } - - if (class_exists(FileResource::class)) { - $catalogue->addResource(new FileResource($resource)); - } - } - - libxml_use_internal_errors($internalErrors); - - return $catalogue; - } -} diff --git a/vendor/symfony/translation/Loader/XliffFileLoader.php b/vendor/symfony/translation/Loader/XliffFileLoader.php deleted file mode 100644 index 0ce3af53..00000000 --- a/vendor/symfony/translation/Loader/XliffFileLoader.php +++ /dev/null @@ -1,233 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Loader; - -use Symfony\Component\Config\Resource\FileResource; -use Symfony\Component\Config\Util\Exception\InvalidXmlException; -use Symfony\Component\Config\Util\Exception\XmlParsingException; -use Symfony\Component\Config\Util\XmlUtils; -use Symfony\Component\Translation\Exception\InvalidResourceException; -use Symfony\Component\Translation\Exception\NotFoundResourceException; -use Symfony\Component\Translation\Exception\RuntimeException; -use Symfony\Component\Translation\MessageCatalogue; -use Symfony\Component\Translation\Util\XliffUtils; - -/** - * XliffFileLoader loads translations from XLIFF files. - * - * @author Fabien Potencier - */ -class XliffFileLoader implements LoaderInterface -{ - public function load(mixed $resource, string $locale, string $domain = 'messages'): MessageCatalogue - { - if (!class_exists(XmlUtils::class)) { - throw new RuntimeException('Loading translations from the Xliff format requires the Symfony Config component.'); - } - - if (!$this->isXmlString($resource)) { - if (!stream_is_local($resource)) { - throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource)); - } - - if (!file_exists($resource)) { - throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource)); - } - - if (!is_file($resource)) { - throw new InvalidResourceException(sprintf('This is neither a file nor an XLIFF string "%s".', $resource)); - } - } - - try { - if ($this->isXmlString($resource)) { - $dom = XmlUtils::parse($resource); - } else { - $dom = XmlUtils::loadFile($resource); - } - } catch (\InvalidArgumentException|XmlParsingException|InvalidXmlException $e) { - throw new InvalidResourceException(sprintf('Unable to load "%s": ', $resource).$e->getMessage(), $e->getCode(), $e); - } - - if ($errors = XliffUtils::validateSchema($dom)) { - throw new InvalidResourceException(sprintf('Invalid resource provided: "%s"; Errors: ', $resource).XliffUtils::getErrorsAsString($errors)); - } - - $catalogue = new MessageCatalogue($locale); - $this->extract($dom, $catalogue, $domain); - - if (is_file($resource) && class_exists(FileResource::class)) { - $catalogue->addResource(new FileResource($resource)); - } - - return $catalogue; - } - - private function extract(\DOMDocument $dom, MessageCatalogue $catalogue, string $domain) - { - $xliffVersion = XliffUtils::getVersionNumber($dom); - - if ('1.2' === $xliffVersion) { - $this->extractXliff1($dom, $catalogue, $domain); - } - - if ('2.0' === $xliffVersion) { - $this->extractXliff2($dom, $catalogue, $domain); - } - } - - /** - * Extract messages and metadata from DOMDocument into a MessageCatalogue. - */ - private function extractXliff1(\DOMDocument $dom, MessageCatalogue $catalogue, string $domain) - { - $xml = simplexml_import_dom($dom); - $encoding = $dom->encoding ? strtoupper($dom->encoding) : null; - - $namespace = 'urn:oasis:names:tc:xliff:document:1.2'; - $xml->registerXPathNamespace('xliff', $namespace); - - foreach ($xml->xpath('//xliff:file') as $file) { - $fileAttributes = $file->attributes(); - - $file->registerXPathNamespace('xliff', $namespace); - - foreach ($file->xpath('.//xliff:prop') as $prop) { - $catalogue->setCatalogueMetadata($prop->attributes()['prop-type'], (string) $prop, $domain); - } - - foreach ($file->xpath('.//xliff:trans-unit') as $translation) { - $attributes = $translation->attributes(); - - if (!(isset($attributes['resname']) || isset($translation->source))) { - continue; - } - - $source = isset($attributes['resname']) && $attributes['resname'] ? $attributes['resname'] : $translation->source; - // If the xlf file has another encoding specified, try to convert it because - // simple_xml will always return utf-8 encoded values - $target = $this->utf8ToCharset((string) ($translation->target ?? $translation->source), $encoding); - - $catalogue->set((string) $source, $target, $domain); - - $metadata = [ - 'source' => (string) $translation->source, - 'file' => [ - 'original' => (string) $fileAttributes['original'], - ], - ]; - if ($notes = $this->parseNotesMetadata($translation->note, $encoding)) { - $metadata['notes'] = $notes; - } - - if (isset($translation->target) && $translation->target->attributes()) { - $metadata['target-attributes'] = []; - foreach ($translation->target->attributes() as $key => $value) { - $metadata['target-attributes'][$key] = (string) $value; - } - } - - if (isset($attributes['id'])) { - $metadata['id'] = (string) $attributes['id']; - } - - $catalogue->setMetadata((string) $source, $metadata, $domain); - } - } - } - - private function extractXliff2(\DOMDocument $dom, MessageCatalogue $catalogue, string $domain) - { - $xml = simplexml_import_dom($dom); - $encoding = $dom->encoding ? strtoupper($dom->encoding) : null; - - $xml->registerXPathNamespace('xliff', 'urn:oasis:names:tc:xliff:document:2.0'); - - foreach ($xml->xpath('//xliff:unit') as $unit) { - foreach ($unit->segment as $segment) { - $attributes = $unit->attributes(); - $source = $attributes['name'] ?? $segment->source; - - // If the xlf file has another encoding specified, try to convert it because - // simple_xml will always return utf-8 encoded values - $target = $this->utf8ToCharset((string) ($segment->target ?? $segment->source), $encoding); - - $catalogue->set((string) $source, $target, $domain); - - $metadata = []; - if (isset($segment->target) && $segment->target->attributes()) { - $metadata['target-attributes'] = []; - foreach ($segment->target->attributes() as $key => $value) { - $metadata['target-attributes'][$key] = (string) $value; - } - } - - if (isset($unit->notes)) { - $metadata['notes'] = []; - foreach ($unit->notes->note as $noteNode) { - $note = []; - foreach ($noteNode->attributes() as $key => $value) { - $note[$key] = (string) $value; - } - $note['content'] = (string) $noteNode; - $metadata['notes'][] = $note; - } - } - - $catalogue->setMetadata((string) $source, $metadata, $domain); - } - } - } - - /** - * Convert a UTF8 string to the specified encoding. - */ - private function utf8ToCharset(string $content, string $encoding = null): string - { - if ('UTF-8' !== $encoding && !empty($encoding)) { - return mb_convert_encoding($content, $encoding, 'UTF-8'); - } - - return $content; - } - - private function parseNotesMetadata(\SimpleXMLElement $noteElement = null, string $encoding = null): array - { - $notes = []; - - if (null === $noteElement) { - return $notes; - } - - /** @var \SimpleXMLElement $xmlNote */ - foreach ($noteElement as $xmlNote) { - $noteAttributes = $xmlNote->attributes(); - $note = ['content' => $this->utf8ToCharset((string) $xmlNote, $encoding)]; - if (isset($noteAttributes['priority'])) { - $note['priority'] = (int) $noteAttributes['priority']; - } - - if (isset($noteAttributes['from'])) { - $note['from'] = (string) $noteAttributes['from']; - } - - $notes[] = $note; - } - - return $notes; - } - - private function isXmlString(string $resource): bool - { - return str_starts_with($resource, ' - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Loader; - -use Symfony\Component\Translation\Exception\InvalidResourceException; -use Symfony\Component\Translation\Exception\LogicException; -use Symfony\Component\Yaml\Exception\ParseException; -use Symfony\Component\Yaml\Parser as YamlParser; -use Symfony\Component\Yaml\Yaml; - -/** - * YamlFileLoader loads translations from Yaml files. - * - * @author Fabien Potencier - */ -class YamlFileLoader extends FileLoader -{ - private $yamlParser; - - protected function loadResource(string $resource): array - { - if (null === $this->yamlParser) { - if (!class_exists(\Symfony\Component\Yaml\Parser::class)) { - throw new LogicException('Loading translations from the YAML format requires the Symfony Yaml component.'); - } - - $this->yamlParser = new YamlParser(); - } - - try { - $messages = $this->yamlParser->parseFile($resource, Yaml::PARSE_CONSTANT); - } catch (ParseException $e) { - throw new InvalidResourceException(sprintf('The file "%s" does not contain valid YAML: ', $resource).$e->getMessage(), 0, $e); - } - - if (null !== $messages && !\is_array($messages)) { - throw new InvalidResourceException(sprintf('Unable to load file "%s".', $resource)); - } - - return $messages ?: []; - } -} diff --git a/vendor/symfony/translation/LocaleSwitcher.php b/vendor/symfony/translation/LocaleSwitcher.php deleted file mode 100644 index 0fc56e33..00000000 --- a/vendor/symfony/translation/LocaleSwitcher.php +++ /dev/null @@ -1,75 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation; - -use Symfony\Component\Routing\RequestContext; -use Symfony\Contracts\Translation\LocaleAwareInterface; - -/** - * @author Kevin Bond - */ -class LocaleSwitcher implements LocaleAwareInterface -{ - private string $defaultLocale; - - /** - * @param LocaleAwareInterface[] $localeAwareServices - */ - public function __construct( - private string $locale, - private iterable $localeAwareServices, - private ?RequestContext $requestContext = null, - ) { - $this->defaultLocale = $locale; - } - - public function setLocale(string $locale): void - { - \Locale::setDefault($this->locale = $locale); - $this->requestContext?->setParameter('_locale', $locale); - - foreach ($this->localeAwareServices as $service) { - $service->setLocale($locale); - } - } - - public function getLocale(): string - { - return $this->locale; - } - - /** - * Switch to a new locale, execute a callback, then switch back to the original. - * - * @template T - * - * @param callable():T $callback - * - * @return T - */ - public function runWithLocale(string $locale, callable $callback): mixed - { - $original = $this->getLocale(); - $this->setLocale($locale); - - try { - return $callback(); - } finally { - $this->setLocale($original); - } - } - - public function reset(): void - { - $this->setLocale($this->defaultLocale); - } -} diff --git a/vendor/symfony/translation/LoggingTranslator.php b/vendor/symfony/translation/LoggingTranslator.php deleted file mode 100644 index 8a81e1f8..00000000 --- a/vendor/symfony/translation/LoggingTranslator.php +++ /dev/null @@ -1,112 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation; - -use Psr\Log\LoggerInterface; -use Symfony\Component\Translation\Exception\InvalidArgumentException; -use Symfony\Contracts\Translation\LocaleAwareInterface; -use Symfony\Contracts\Translation\TranslatorInterface; - -/** - * @author Abdellatif Ait boudad - */ -class LoggingTranslator implements TranslatorInterface, TranslatorBagInterface, LocaleAwareInterface -{ - private TranslatorInterface $translator; - private LoggerInterface $logger; - - /** - * @param TranslatorInterface&TranslatorBagInterface&LocaleAwareInterface $translator The translator must implement TranslatorBagInterface - */ - public function __construct(TranslatorInterface $translator, LoggerInterface $logger) - { - if (!$translator instanceof TranslatorBagInterface || !$translator instanceof LocaleAwareInterface) { - throw new InvalidArgumentException(sprintf('The Translator "%s" must implement TranslatorInterface, TranslatorBagInterface and LocaleAwareInterface.', get_debug_type($translator))); - } - - $this->translator = $translator; - $this->logger = $logger; - } - - public function trans(?string $id, array $parameters = [], string $domain = null, string $locale = null): string - { - $trans = $this->translator->trans($id = (string) $id, $parameters, $domain, $locale); - $this->log($id, $domain, $locale); - - return $trans; - } - - public function setLocale(string $locale) - { - $prev = $this->translator->getLocale(); - $this->translator->setLocale($locale); - if ($prev === $locale) { - return; - } - - $this->logger->debug(sprintf('The locale of the translator has changed from "%s" to "%s".', $prev, $locale)); - } - - public function getLocale(): string - { - return $this->translator->getLocale(); - } - - public function getCatalogue(string $locale = null): MessageCatalogueInterface - { - return $this->translator->getCatalogue($locale); - } - - public function getCatalogues(): array - { - return $this->translator->getCatalogues(); - } - - /** - * Gets the fallback locales. - */ - public function getFallbackLocales(): array - { - if ($this->translator instanceof Translator || method_exists($this->translator, 'getFallbackLocales')) { - return $this->translator->getFallbackLocales(); - } - - return []; - } - - /** - * Passes through all unknown calls onto the translator object. - */ - public function __call(string $method, array $args) - { - return $this->translator->{$method}(...$args); - } - - /** - * Logs for missing translations. - */ - private function log(string $id, ?string $domain, ?string $locale) - { - $domain ??= 'messages'; - - $catalogue = $this->translator->getCatalogue($locale); - if ($catalogue->defines($id, $domain)) { - return; - } - - if ($catalogue->has($id, $domain)) { - $this->logger->debug('Translation use fallback catalogue.', ['id' => $id, 'domain' => $domain, 'locale' => $catalogue->getLocale()]); - } else { - $this->logger->warning('Translation not found.', ['id' => $id, 'domain' => $domain, 'locale' => $catalogue->getLocale()]); - } - } -} diff --git a/vendor/symfony/translation/MessageCatalogue.php b/vendor/symfony/translation/MessageCatalogue.php deleted file mode 100644 index 605f2817..00000000 --- a/vendor/symfony/translation/MessageCatalogue.php +++ /dev/null @@ -1,308 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation; - -use Symfony\Component\Config\Resource\ResourceInterface; -use Symfony\Component\Translation\Exception\LogicException; - -/** - * @author Fabien Potencier - */ -class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterface, CatalogueMetadataAwareInterface -{ - private array $messages = []; - private array $metadata = []; - private array $catalogueMetadata = []; - private array $resources = []; - private string $locale; - private ?MessageCatalogueInterface $fallbackCatalogue = null; - private ?self $parent = null; - - /** - * @param array $messages An array of messages classified by domain - */ - public function __construct(string $locale, array $messages = []) - { - $this->locale = $locale; - $this->messages = $messages; - } - - public function getLocale(): string - { - return $this->locale; - } - - public function getDomains(): array - { - $domains = []; - - foreach ($this->messages as $domain => $messages) { - if (str_ends_with($domain, self::INTL_DOMAIN_SUFFIX)) { - $domain = substr($domain, 0, -\strlen(self::INTL_DOMAIN_SUFFIX)); - } - $domains[$domain] = $domain; - } - - return array_values($domains); - } - - public function all(string $domain = null): array - { - if (null !== $domain) { - // skip messages merge if intl-icu requested explicitly - if (str_ends_with($domain, self::INTL_DOMAIN_SUFFIX)) { - return $this->messages[$domain] ?? []; - } - - return ($this->messages[$domain.self::INTL_DOMAIN_SUFFIX] ?? []) + ($this->messages[$domain] ?? []); - } - - $allMessages = []; - - foreach ($this->messages as $domain => $messages) { - if (str_ends_with($domain, self::INTL_DOMAIN_SUFFIX)) { - $domain = substr($domain, 0, -\strlen(self::INTL_DOMAIN_SUFFIX)); - $allMessages[$domain] = $messages + ($allMessages[$domain] ?? []); - } else { - $allMessages[$domain] = ($allMessages[$domain] ?? []) + $messages; - } - } - - return $allMessages; - } - - public function set(string $id, string $translation, string $domain = 'messages') - { - $this->add([$id => $translation], $domain); - } - - public function has(string $id, string $domain = 'messages'): bool - { - if (isset($this->messages[$domain][$id]) || isset($this->messages[$domain.self::INTL_DOMAIN_SUFFIX][$id])) { - return true; - } - - if (null !== $this->fallbackCatalogue) { - return $this->fallbackCatalogue->has($id, $domain); - } - - return false; - } - - public function defines(string $id, string $domain = 'messages'): bool - { - return isset($this->messages[$domain][$id]) || isset($this->messages[$domain.self::INTL_DOMAIN_SUFFIX][$id]); - } - - public function get(string $id, string $domain = 'messages'): string - { - if (isset($this->messages[$domain.self::INTL_DOMAIN_SUFFIX][$id])) { - return $this->messages[$domain.self::INTL_DOMAIN_SUFFIX][$id]; - } - - if (isset($this->messages[$domain][$id])) { - return $this->messages[$domain][$id]; - } - - if (null !== $this->fallbackCatalogue) { - return $this->fallbackCatalogue->get($id, $domain); - } - - return $id; - } - - public function replace(array $messages, string $domain = 'messages') - { - unset($this->messages[$domain], $this->messages[$domain.self::INTL_DOMAIN_SUFFIX]); - - $this->add($messages, $domain); - } - - public function add(array $messages, string $domain = 'messages') - { - $altDomain = str_ends_with($domain, self::INTL_DOMAIN_SUFFIX) ? substr($domain, 0, -\strlen(self::INTL_DOMAIN_SUFFIX)) : $domain.self::INTL_DOMAIN_SUFFIX; - foreach ($messages as $id => $message) { - unset($this->messages[$altDomain][$id]); - $this->messages[$domain][$id] = $message; - } - - if ([] === ($this->messages[$altDomain] ?? null)) { - unset($this->messages[$altDomain]); - } - } - - public function addCatalogue(MessageCatalogueInterface $catalogue) - { - if ($catalogue->getLocale() !== $this->locale) { - throw new LogicException(sprintf('Cannot add a catalogue for locale "%s" as the current locale for this catalogue is "%s".', $catalogue->getLocale(), $this->locale)); - } - - foreach ($catalogue->all() as $domain => $messages) { - if ($intlMessages = $catalogue->all($domain.self::INTL_DOMAIN_SUFFIX)) { - $this->add($intlMessages, $domain.self::INTL_DOMAIN_SUFFIX); - $messages = array_diff_key($messages, $intlMessages); - } - $this->add($messages, $domain); - } - - foreach ($catalogue->getResources() as $resource) { - $this->addResource($resource); - } - - if ($catalogue instanceof MetadataAwareInterface) { - $metadata = $catalogue->getMetadata('', ''); - $this->addMetadata($metadata); - } - - if ($catalogue instanceof CatalogueMetadataAwareInterface) { - $catalogueMetadata = $catalogue->getCatalogueMetadata('', ''); - $this->addCatalogueMetadata($catalogueMetadata); - } - } - - public function addFallbackCatalogue(MessageCatalogueInterface $catalogue) - { - // detect circular references - $c = $catalogue; - while ($c = $c->getFallbackCatalogue()) { - if ($c->getLocale() === $this->getLocale()) { - throw new LogicException(sprintf('Circular reference detected when adding a fallback catalogue for locale "%s".', $catalogue->getLocale())); - } - } - - $c = $this; - do { - if ($c->getLocale() === $catalogue->getLocale()) { - throw new LogicException(sprintf('Circular reference detected when adding a fallback catalogue for locale "%s".', $catalogue->getLocale())); - } - - foreach ($catalogue->getResources() as $resource) { - $c->addResource($resource); - } - } while ($c = $c->parent); - - $catalogue->parent = $this; - $this->fallbackCatalogue = $catalogue; - - foreach ($catalogue->getResources() as $resource) { - $this->addResource($resource); - } - } - - public function getFallbackCatalogue(): ?MessageCatalogueInterface - { - return $this->fallbackCatalogue; - } - - public function getResources(): array - { - return array_values($this->resources); - } - - public function addResource(ResourceInterface $resource) - { - $this->resources[$resource->__toString()] = $resource; - } - - public function getMetadata(string $key = '', string $domain = 'messages'): mixed - { - if ('' == $domain) { - return $this->metadata; - } - - if (isset($this->metadata[$domain])) { - if ('' == $key) { - return $this->metadata[$domain]; - } - - if (isset($this->metadata[$domain][$key])) { - return $this->metadata[$domain][$key]; - } - } - - return null; - } - - public function setMetadata(string $key, mixed $value, string $domain = 'messages') - { - $this->metadata[$domain][$key] = $value; - } - - public function deleteMetadata(string $key = '', string $domain = 'messages') - { - if ('' == $domain) { - $this->metadata = []; - } elseif ('' == $key) { - unset($this->metadata[$domain]); - } else { - unset($this->metadata[$domain][$key]); - } - } - - public function getCatalogueMetadata(string $key = '', string $domain = 'messages'): mixed - { - if (!$domain) { - return $this->catalogueMetadata; - } - - if (isset($this->catalogueMetadata[$domain])) { - if (!$key) { - return $this->catalogueMetadata[$domain]; - } - - if (isset($this->catalogueMetadata[$domain][$key])) { - return $this->catalogueMetadata[$domain][$key]; - } - } - - return null; - } - - public function setCatalogueMetadata(string $key, mixed $value, string $domain = 'messages') - { - $this->catalogueMetadata[$domain][$key] = $value; - } - - public function deleteCatalogueMetadata(string $key = '', string $domain = 'messages') - { - if (!$domain) { - $this->catalogueMetadata = []; - } elseif (!$key) { - unset($this->catalogueMetadata[$domain]); - } else { - unset($this->catalogueMetadata[$domain][$key]); - } - } - - /** - * Adds current values with the new values. - * - * @param array $values Values to add - */ - private function addMetadata(array $values) - { - foreach ($values as $domain => $keys) { - foreach ($keys as $key => $value) { - $this->setMetadata($key, $value, $domain); - } - } - } - - private function addCatalogueMetadata(array $values) - { - foreach ($values as $domain => $keys) { - foreach ($keys as $key => $value) { - $this->setCatalogueMetadata($key, $value, $domain); - } - } - } -} diff --git a/vendor/symfony/translation/MessageCatalogueInterface.php b/vendor/symfony/translation/MessageCatalogueInterface.php deleted file mode 100644 index 75e3a2fa..00000000 --- a/vendor/symfony/translation/MessageCatalogueInterface.php +++ /dev/null @@ -1,124 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation; - -use Symfony\Component\Config\Resource\ResourceInterface; - -/** - * MessageCatalogueInterface. - * - * @author Fabien Potencier - */ -interface MessageCatalogueInterface -{ - public const INTL_DOMAIN_SUFFIX = '+intl-icu'; - - /** - * Gets the catalogue locale. - */ - public function getLocale(): string; - - /** - * Gets the domains. - */ - public function getDomains(): array; - - /** - * Gets the messages within a given domain. - * - * If $domain is null, it returns all messages. - * - * @param string $domain The domain name - */ - public function all(string $domain = null): array; - - /** - * Sets a message translation. - * - * @param string $id The message id - * @param string $translation The messages translation - * @param string $domain The domain name - */ - public function set(string $id, string $translation, string $domain = 'messages'); - - /** - * Checks if a message has a translation. - * - * @param string $id The message id - * @param string $domain The domain name - */ - public function has(string $id, string $domain = 'messages'): bool; - - /** - * Checks if a message has a translation (it does not take into account the fallback mechanism). - * - * @param string $id The message id - * @param string $domain The domain name - */ - public function defines(string $id, string $domain = 'messages'): bool; - - /** - * Gets a message translation. - * - * @param string $id The message id - * @param string $domain The domain name - */ - public function get(string $id, string $domain = 'messages'): string; - - /** - * Sets translations for a given domain. - * - * @param array $messages An array of translations - * @param string $domain The domain name - */ - public function replace(array $messages, string $domain = 'messages'); - - /** - * Adds translations for a given domain. - * - * @param array $messages An array of translations - * @param string $domain The domain name - */ - public function add(array $messages, string $domain = 'messages'); - - /** - * Merges translations from the given Catalogue into the current one. - * - * The two catalogues must have the same locale. - */ - public function addCatalogue(self $catalogue); - - /** - * Merges translations from the given Catalogue into the current one - * only when the translation does not exist. - * - * This is used to provide default translations when they do not exist for the current locale. - */ - public function addFallbackCatalogue(self $catalogue); - - /** - * Gets the fallback catalogue. - */ - public function getFallbackCatalogue(): ?self; - - /** - * Returns an array of resources loaded to build this collection. - * - * @return ResourceInterface[] - */ - public function getResources(): array; - - /** - * Adds a resource for this collection. - */ - public function addResource(ResourceInterface $resource); -} diff --git a/vendor/symfony/translation/MetadataAwareInterface.php b/vendor/symfony/translation/MetadataAwareInterface.php deleted file mode 100644 index 5753b817..00000000 --- a/vendor/symfony/translation/MetadataAwareInterface.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation; - -/** - * This interface is used to get, set, and delete metadata about the translation messages. - * - * @author Fabien Potencier - */ -interface MetadataAwareInterface -{ - /** - * Gets metadata for the given domain and key. - * - * Passing an empty domain will return an array with all metadata indexed by - * domain and then by key. Passing an empty key will return an array with all - * metadata for the given domain. - * - * @return mixed The value that was set or an array with the domains/keys or null - */ - public function getMetadata(string $key = '', string $domain = 'messages'): mixed; - - /** - * Adds metadata to a message domain. - */ - public function setMetadata(string $key, mixed $value, string $domain = 'messages'); - - /** - * Deletes metadata for the given key and domain. - * - * Passing an empty domain will delete all metadata. Passing an empty key will - * delete all metadata for the given domain. - */ - public function deleteMetadata(string $key = '', string $domain = 'messages'); -} diff --git a/vendor/symfony/translation/Provider/AbstractProviderFactory.php b/vendor/symfony/translation/Provider/AbstractProviderFactory.php deleted file mode 100644 index 17442fde..00000000 --- a/vendor/symfony/translation/Provider/AbstractProviderFactory.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Provider; - -use Symfony\Component\Translation\Exception\IncompleteDsnException; - -abstract class AbstractProviderFactory implements ProviderFactoryInterface -{ - public function supports(Dsn $dsn): bool - { - return \in_array($dsn->getScheme(), $this->getSupportedSchemes(), true); - } - - /** - * @return string[] - */ - abstract protected function getSupportedSchemes(): array; - - protected function getUser(Dsn $dsn): string - { - if (null === $user = $dsn->getUser()) { - throw new IncompleteDsnException('User is not set.', $dsn->getOriginalDsn()); - } - - return $user; - } - - protected function getPassword(Dsn $dsn): string - { - if (null === $password = $dsn->getPassword()) { - throw new IncompleteDsnException('Password is not set.', $dsn->getOriginalDsn()); - } - - return $password; - } -} diff --git a/vendor/symfony/translation/Provider/Dsn.php b/vendor/symfony/translation/Provider/Dsn.php deleted file mode 100644 index 0f74d17f..00000000 --- a/vendor/symfony/translation/Provider/Dsn.php +++ /dev/null @@ -1,110 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Provider; - -use Symfony\Component\Translation\Exception\InvalidArgumentException; -use Symfony\Component\Translation\Exception\MissingRequiredOptionException; - -/** - * @author Fabien Potencier - * @author Oskar Stark - */ -final class Dsn -{ - private ?string $scheme; - private ?string $host; - private ?string $user; - private ?string $password; - private ?int $port; - private ?string $path; - private array $options = []; - private string $originalDsn; - - public function __construct(string $dsn) - { - $this->originalDsn = $dsn; - - if (false === $parsedDsn = parse_url($dsn)) { - throw new InvalidArgumentException(sprintf('The "%s" translation provider DSN is invalid.', $dsn)); - } - - if (!isset($parsedDsn['scheme'])) { - throw new InvalidArgumentException(sprintf('The "%s" translation provider DSN must contain a scheme.', $dsn)); - } - $this->scheme = $parsedDsn['scheme']; - - if (!isset($parsedDsn['host'])) { - throw new InvalidArgumentException(sprintf('The "%s" translation provider DSN must contain a host (use "default" by default).', $dsn)); - } - $this->host = $parsedDsn['host']; - - $this->user = '' !== ($parsedDsn['user'] ?? '') ? urldecode($parsedDsn['user']) : null; - $this->password = '' !== ($parsedDsn['pass'] ?? '') ? urldecode($parsedDsn['pass']) : null; - $this->port = $parsedDsn['port'] ?? null; - $this->path = $parsedDsn['path'] ?? null; - parse_str($parsedDsn['query'] ?? '', $this->options); - } - - public function getScheme(): string - { - return $this->scheme; - } - - public function getHost(): string - { - return $this->host; - } - - public function getUser(): ?string - { - return $this->user; - } - - public function getPassword(): ?string - { - return $this->password; - } - - public function getPort(int $default = null): ?int - { - return $this->port ?? $default; - } - - public function getOption(string $key, mixed $default = null) - { - return $this->options[$key] ?? $default; - } - - public function getRequiredOption(string $key) - { - if (!\array_key_exists($key, $this->options) || '' === trim($this->options[$key])) { - throw new MissingRequiredOptionException($key); - } - - return $this->options[$key]; - } - - public function getOptions(): array - { - return $this->options; - } - - public function getPath(): ?string - { - return $this->path; - } - - public function getOriginalDsn(): string - { - return $this->originalDsn; - } -} diff --git a/vendor/symfony/translation/Provider/FilteringProvider.php b/vendor/symfony/translation/Provider/FilteringProvider.php deleted file mode 100644 index d4465b9f..00000000 --- a/vendor/symfony/translation/Provider/FilteringProvider.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\Translation\Provider; - -use Symfony\Component\Translation\TranslatorBag; -use Symfony\Component\Translation\TranslatorBagInterface; - -/** - * Filters domains and locales between the Translator config values and those specific to each provider. - * - * @author Mathieu Santostefano - */ -class FilteringProvider implements ProviderInterface -{ - private ProviderInterface $provider; - private array $locales; - private array $domains; - - public function __construct(ProviderInterface $provider, array $locales, array $domains = []) - { - $this->provider = $provider; - $this->locales = $locales; - $this->domains = $domains; - } - - public function __toString(): string - { - return (string) $this->provider; - } - - public function write(TranslatorBagInterface $translatorBag): void - { - $this->provider->write($translatorBag); - } - - public function read(array $domains, array $locales): TranslatorBag - { - $domains = !$this->domains ? $domains : array_intersect($this->domains, $domains); - $locales = array_intersect($this->locales, $locales); - - return $this->provider->read($domains, $locales); - } - - public function delete(TranslatorBagInterface $translatorBag): void - { - $this->provider->delete($translatorBag); - } - - public function getDomains(): array - { - return $this->domains; - } -} diff --git a/vendor/symfony/translation/Provider/NullProvider.php b/vendor/symfony/translation/Provider/NullProvider.php deleted file mode 100644 index f00392ea..00000000 --- a/vendor/symfony/translation/Provider/NullProvider.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Provider; - -use Symfony\Component\Translation\TranslatorBag; -use Symfony\Component\Translation\TranslatorBagInterface; - -/** - * @author Mathieu Santostefano - */ -class NullProvider implements ProviderInterface -{ - public function __toString(): string - { - return 'null'; - } - - public function write(TranslatorBagInterface $translatorBag, bool $override = false): void - { - } - - public function read(array $domains, array $locales): TranslatorBag - { - return new TranslatorBag(); - } - - public function delete(TranslatorBagInterface $translatorBag): void - { - } -} diff --git a/vendor/symfony/translation/Provider/NullProviderFactory.php b/vendor/symfony/translation/Provider/NullProviderFactory.php deleted file mode 100644 index f350f160..00000000 --- a/vendor/symfony/translation/Provider/NullProviderFactory.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Provider; - -use Symfony\Component\Translation\Exception\UnsupportedSchemeException; - -/** - * @author Mathieu Santostefano - */ -final class NullProviderFactory extends AbstractProviderFactory -{ - public function create(Dsn $dsn): ProviderInterface - { - if ('null' === $dsn->getScheme()) { - return new NullProvider(); - } - - throw new UnsupportedSchemeException($dsn, 'null', $this->getSupportedSchemes()); - } - - protected function getSupportedSchemes(): array - { - return ['null']; - } -} diff --git a/vendor/symfony/translation/Provider/ProviderFactoryInterface.php b/vendor/symfony/translation/Provider/ProviderFactoryInterface.php deleted file mode 100644 index 3fd4494b..00000000 --- a/vendor/symfony/translation/Provider/ProviderFactoryInterface.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\Translation\Provider; - -use Symfony\Component\Translation\Exception\IncompleteDsnException; -use Symfony\Component\Translation\Exception\UnsupportedSchemeException; - -interface ProviderFactoryInterface -{ - /** - * @throws UnsupportedSchemeException - * @throws IncompleteDsnException - */ - public function create(Dsn $dsn): ProviderInterface; - - public function supports(Dsn $dsn): bool; -} diff --git a/vendor/symfony/translation/Provider/ProviderInterface.php b/vendor/symfony/translation/Provider/ProviderInterface.php deleted file mode 100644 index a32193f2..00000000 --- a/vendor/symfony/translation/Provider/ProviderInterface.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\Translation\Provider; - -use Symfony\Component\Translation\TranslatorBag; -use Symfony\Component\Translation\TranslatorBagInterface; - -interface ProviderInterface -{ - public function __toString(): string; - - /** - * Translations available in the TranslatorBag only must be created. - * Translations available in both the TranslatorBag and on the provider - * must be overwritten. - * Translations available on the provider only must be kept. - */ - public function write(TranslatorBagInterface $translatorBag): void; - - public function read(array $domains, array $locales): TranslatorBag; - - public function delete(TranslatorBagInterface $translatorBag): void; -} diff --git a/vendor/symfony/translation/Provider/TranslationProviderCollection.php b/vendor/symfony/translation/Provider/TranslationProviderCollection.php deleted file mode 100644 index 61ac641c..00000000 --- a/vendor/symfony/translation/Provider/TranslationProviderCollection.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. - */ - -namespace Symfony\Component\Translation\Provider; - -use Symfony\Component\Translation\Exception\InvalidArgumentException; - -/** - * @author Mathieu Santostefano - */ -final class TranslationProviderCollection -{ - /** - * @var array - */ - private $providers; - - /** - * @param array $providers - */ - public function __construct(iterable $providers) - { - $this->providers = \is_array($providers) ? $providers : iterator_to_array($providers); - } - - public function __toString(): string - { - return '['.implode(',', array_keys($this->providers)).']'; - } - - public function has(string $name): bool - { - return isset($this->providers[$name]); - } - - public function get(string $name): ProviderInterface - { - if (!$this->has($name)) { - throw new InvalidArgumentException(sprintf('Provider "%s" not found. Available: "%s".', $name, (string) $this)); - } - - return $this->providers[$name]; - } - - public function keys(): array - { - return array_keys($this->providers); - } -} diff --git a/vendor/symfony/translation/Provider/TranslationProviderCollectionFactory.php b/vendor/symfony/translation/Provider/TranslationProviderCollectionFactory.php deleted file mode 100644 index 6300c875..00000000 --- a/vendor/symfony/translation/Provider/TranslationProviderCollectionFactory.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. - */ - -namespace Symfony\Component\Translation\Provider; - -use Symfony\Component\Translation\Exception\UnsupportedSchemeException; - -/** - * @author Mathieu Santostefano - */ -class TranslationProviderCollectionFactory -{ - private iterable $factories; - private array $enabledLocales; - - /** - * @param iterable $factories - */ - public function __construct(iterable $factories, array $enabledLocales) - { - $this->factories = $factories; - $this->enabledLocales = $enabledLocales; - } - - public function fromConfig(array $config): TranslationProviderCollection - { - $providers = []; - foreach ($config as $name => $currentConfig) { - $providers[$name] = $this->fromDsnObject( - new Dsn($currentConfig['dsn']), - !$currentConfig['locales'] ? $this->enabledLocales : $currentConfig['locales'], - !$currentConfig['domains'] ? [] : $currentConfig['domains'] - ); - } - - return new TranslationProviderCollection($providers); - } - - public function fromDsnObject(Dsn $dsn, array $locales, array $domains = []): ProviderInterface - { - foreach ($this->factories as $factory) { - if ($factory->supports($dsn)) { - return new FilteringProvider($factory->create($dsn), $locales, $domains); - } - } - - throw new UnsupportedSchemeException($dsn); - } -} diff --git a/vendor/symfony/translation/PseudoLocalizationTranslator.php b/vendor/symfony/translation/PseudoLocalizationTranslator.php deleted file mode 100644 index 0207e999..00000000 --- a/vendor/symfony/translation/PseudoLocalizationTranslator.php +++ /dev/null @@ -1,365 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation; - -use Symfony\Contracts\Translation\TranslatorInterface; - -/** - * This translator should only be used in a development environment. - */ -final class PseudoLocalizationTranslator implements TranslatorInterface -{ - private const EXPANSION_CHARACTER = '~'; - - private TranslatorInterface $translator; - private bool $accents; - private float $expansionFactor; - private bool $brackets; - private bool $parseHTML; - - /** - * @var string[] - */ - private array $localizableHTMLAttributes; - - /** - * Available options: - * * accents: - * type: boolean - * default: true - * description: replace ASCII characters of the translated string with accented versions or similar characters - * example: if true, "foo" => "ƒöö". - * - * * expansion_factor: - * type: float - * default: 1 - * validation: it must be greater than or equal to 1 - * description: expand the translated string by the given factor with spaces and tildes - * example: if 2, "foo" => "~foo ~" - * - * * brackets: - * type: boolean - * default: true - * description: wrap the translated string with brackets - * example: if true, "foo" => "[foo]" - * - * * parse_html: - * type: boolean - * default: false - * description: parse the translated string as HTML - looking for HTML tags has a performance impact but allows to preserve them from alterations - it also allows to compute the visible translated string length which is useful to correctly expand ot when it contains HTML - * warning: unclosed tags are unsupported, they will be fixed (closed) by the parser - eg, "foo
      bar" => "foo
      bar
      " - * - * * localizable_html_attributes: - * type: string[] - * default: [] - * description: the list of HTML attributes whose values can be altered - it is only useful when the "parse_html" option is set to true - * example: if ["title"], and with the "accents" option set to true, "Profile" => "Þŕöƒîļé" - if "title" was not in the "localizable_html_attributes" list, the title attribute data would be left unchanged. - */ - public function __construct(TranslatorInterface $translator, array $options = []) - { - $this->translator = $translator; - $this->accents = $options['accents'] ?? true; - - if (1.0 > ($this->expansionFactor = $options['expansion_factor'] ?? 1.0)) { - throw new \InvalidArgumentException('The expansion factor must be greater than or equal to 1.'); - } - - $this->brackets = $options['brackets'] ?? true; - - $this->parseHTML = $options['parse_html'] ?? false; - if ($this->parseHTML && !$this->accents && 1.0 === $this->expansionFactor) { - $this->parseHTML = false; - } - - $this->localizableHTMLAttributes = $options['localizable_html_attributes'] ?? []; - } - - public function trans(string $id, array $parameters = [], string $domain = null, string $locale = null): string - { - $trans = ''; - $visibleText = ''; - - foreach ($this->getParts($this->translator->trans($id, $parameters, $domain, $locale)) as [$visible, $localizable, $text]) { - if ($visible) { - $visibleText .= $text; - } - - if (!$localizable) { - $trans .= $text; - - continue; - } - - $this->addAccents($trans, $text); - } - - $this->expand($trans, $visibleText); - - $this->addBrackets($trans); - - return $trans; - } - - public function getLocale(): string - { - return $this->translator->getLocale(); - } - - private function getParts(string $originalTrans): array - { - if (!$this->parseHTML) { - return [[true, true, $originalTrans]]; - } - - $html = mb_encode_numericentity($originalTrans, [0x80, 0xFFFF, 0, 0xFFFF], mb_detect_encoding($originalTrans, null, true) ?: 'UTF-8'); - - $useInternalErrors = libxml_use_internal_errors(true); - - $dom = new \DOMDocument(); - $dom->loadHTML(''.$html.''); - - libxml_clear_errors(); - libxml_use_internal_errors($useInternalErrors); - - return $this->parseNode($dom->childNodes->item(1)->childNodes->item(0)->childNodes->item(0)); - } - - private function parseNode(\DOMNode $node): array - { - $parts = []; - - foreach ($node->childNodes as $childNode) { - if (!$childNode instanceof \DOMElement) { - $parts[] = [true, true, $childNode->nodeValue]; - - continue; - } - - $parts[] = [false, false, '<'.$childNode->tagName]; - - /** @var \DOMAttr $attribute */ - foreach ($childNode->attributes as $attribute) { - $parts[] = [false, false, ' '.$attribute->nodeName.'="']; - - $localizableAttribute = \in_array($attribute->nodeName, $this->localizableHTMLAttributes, true); - foreach (preg_split('/(&(?:amp|quot|#039|lt|gt);+)/', htmlspecialchars($attribute->nodeValue, \ENT_QUOTES, 'UTF-8'), -1, \PREG_SPLIT_DELIM_CAPTURE) as $i => $match) { - if ('' === $match) { - continue; - } - - $parts[] = [false, $localizableAttribute && 0 === $i % 2, $match]; - } - - $parts[] = [false, false, '"']; - } - - $parts[] = [false, false, '>']; - - $parts = array_merge($parts, $this->parseNode($childNode, $parts)); - - $parts[] = [false, false, 'tagName.'>']; - } - - return $parts; - } - - private function addAccents(string &$trans, string $text): void - { - $trans .= $this->accents ? strtr($text, [ - ' ' => ' ', - '!' => '¡', - '"' => '″', - '#' => '♯', - '$' => '€', - '%' => '‰', - '&' => '⅋', - '\'' => '´', - '(' => '{', - ')' => '}', - '*' => '⁎', - '+' => '⁺', - ',' => '،', - '-' => '‐', - '.' => '·', - '/' => '⁄', - '0' => '⓪', - '1' => '①', - '2' => '②', - '3' => '③', - '4' => '④', - '5' => '⑤', - '6' => '⑥', - '7' => '⑦', - '8' => '⑧', - '9' => '⑨', - ':' => '∶', - ';' => '⁏', - '<' => '≤', - '=' => '≂', - '>' => '≥', - '?' => '¿', - '@' => '՞', - 'A' => 'Å', - 'B' => 'Ɓ', - 'C' => 'Ç', - 'D' => 'Ð', - 'E' => 'É', - 'F' => 'Ƒ', - 'G' => 'Ĝ', - 'H' => 'Ĥ', - 'I' => 'Î', - 'J' => 'Ĵ', - 'K' => 'Ķ', - 'L' => 'Ļ', - 'M' => 'Ṁ', - 'N' => 'Ñ', - 'O' => 'Ö', - 'P' => 'Þ', - 'Q' => 'Ǫ', - 'R' => 'Ŕ', - 'S' => 'Š', - 'T' => 'Ţ', - 'U' => 'Û', - 'V' => 'Ṽ', - 'W' => 'Ŵ', - 'X' => 'Ẋ', - 'Y' => 'Ý', - 'Z' => 'Ž', - '[' => '⁅', - '\\' => '∖', - ']' => '⁆', - '^' => '˄', - '_' => '‿', - '`' => '‵', - 'a' => 'å', - 'b' => 'ƀ', - 'c' => 'ç', - 'd' => 'ð', - 'e' => 'é', - 'f' => 'ƒ', - 'g' => 'ĝ', - 'h' => 'ĥ', - 'i' => 'î', - 'j' => 'ĵ', - 'k' => 'ķ', - 'l' => 'ļ', - 'm' => 'ɱ', - 'n' => 'ñ', - 'o' => 'ö', - 'p' => 'þ', - 'q' => 'ǫ', - 'r' => 'ŕ', - 's' => 'š', - 't' => 'ţ', - 'u' => 'û', - 'v' => 'ṽ', - 'w' => 'ŵ', - 'x' => 'ẋ', - 'y' => 'ý', - 'z' => 'ž', - '{' => '(', - '|' => '¦', - '}' => ')', - '~' => '˞', - ]) : $text; - } - - private function expand(string &$trans, string $visibleText): void - { - if (1.0 >= $this->expansionFactor) { - return; - } - - $visibleLength = $this->strlen($visibleText); - $missingLength = (int) ceil($visibleLength * $this->expansionFactor) - $visibleLength; - if ($this->brackets) { - $missingLength -= 2; - } - - if (0 >= $missingLength) { - return; - } - - $words = []; - $wordsCount = 0; - foreach (preg_split('/ +/', $visibleText, -1, \PREG_SPLIT_NO_EMPTY) as $word) { - $wordLength = $this->strlen($word); - - if ($wordLength >= $missingLength) { - continue; - } - - if (!isset($words[$wordLength])) { - $words[$wordLength] = 0; - } - - ++$words[$wordLength]; - ++$wordsCount; - } - - if (!$words) { - $trans .= 1 === $missingLength ? self::EXPANSION_CHARACTER : ' '.str_repeat(self::EXPANSION_CHARACTER, $missingLength - 1); - - return; - } - - arsort($words, \SORT_NUMERIC); - - $longestWordLength = max(array_keys($words)); - - while (true) { - $r = mt_rand(1, $wordsCount); - - foreach ($words as $length => $count) { - $r -= $count; - if ($r <= 0) { - break; - } - } - - $trans .= ' '.str_repeat(self::EXPANSION_CHARACTER, $length); - - $missingLength -= $length + 1; - - if (0 === $missingLength) { - return; - } - - while ($longestWordLength >= $missingLength) { - $wordsCount -= $words[$longestWordLength]; - unset($words[$longestWordLength]); - - if (!$words) { - $trans .= 1 === $missingLength ? self::EXPANSION_CHARACTER : ' '.str_repeat(self::EXPANSION_CHARACTER, $missingLength - 1); - - return; - } - - $longestWordLength = max(array_keys($words)); - } - } - } - - private function addBrackets(string &$trans): void - { - if (!$this->brackets) { - return; - } - - $trans = '['.$trans.']'; - } - - private function strlen(string $s): int - { - return false === ($encoding = mb_detect_encoding($s, null, true)) ? \strlen($s) : mb_strlen($s, $encoding); - } -} diff --git a/vendor/symfony/translation/README.md b/vendor/symfony/translation/README.md deleted file mode 100644 index 4fedd6a2..00000000 --- a/vendor/symfony/translation/README.md +++ /dev/null @@ -1,46 +0,0 @@ -Translation Component -===================== - -The Translation component provides tools to internationalize your application. - -Getting Started ---------------- - -``` -$ composer require symfony/translation -``` - -```php -use Symfony\Component\Translation\Translator; -use Symfony\Component\Translation\Loader\ArrayLoader; - -$translator = new Translator('fr_FR'); -$translator->addLoader('array', new ArrayLoader()); -$translator->addResource('array', [ - 'Hello World!' => 'Bonjour !', -], 'fr_FR'); - -echo $translator->trans('Hello World!'); // outputs « Bonjour ! » -``` - -Sponsor -------- - -The Translation component for Symfony 6.1 is [backed][1] by: - - * [Crowdin][2], a cloud-based localization management software helping teams to go global and stay agile. - -Help Symfony by [sponsoring][3] its development! - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/translation.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) - -[1]: https://symfony.com/backers -[2]: https://crowdin.com -[3]: https://symfony.com/sponsor diff --git a/vendor/symfony/translation/Reader/TranslationReader.php b/vendor/symfony/translation/Reader/TranslationReader.php deleted file mode 100644 index fd2ee669..00000000 --- a/vendor/symfony/translation/Reader/TranslationReader.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Reader; - -use Symfony\Component\Finder\Finder; -use Symfony\Component\Translation\Loader\LoaderInterface; -use Symfony\Component\Translation\MessageCatalogue; - -/** - * TranslationReader reads translation messages from translation files. - * - * @author Michel Salib - */ -class TranslationReader implements TranslationReaderInterface -{ - /** - * Loaders used for import. - * - * @var array - */ - private array $loaders = []; - - /** - * Adds a loader to the translation extractor. - * - * @param string $format The format of the loader - */ - public function addLoader(string $format, LoaderInterface $loader) - { - $this->loaders[$format] = $loader; - } - - public function read(string $directory, MessageCatalogue $catalogue) - { - if (!is_dir($directory)) { - return; - } - - foreach ($this->loaders as $format => $loader) { - // load any existing translation files - $finder = new Finder(); - $extension = $catalogue->getLocale().'.'.$format; - $files = $finder->files()->name('*.'.$extension)->in($directory); - foreach ($files as $file) { - $domain = substr($file->getFilename(), 0, -1 * \strlen($extension) - 1); - $catalogue->addCatalogue($loader->load($file->getPathname(), $catalogue->getLocale(), $domain)); - } - } - } -} diff --git a/vendor/symfony/translation/Reader/TranslationReaderInterface.php b/vendor/symfony/translation/Reader/TranslationReaderInterface.php deleted file mode 100644 index bc37204f..00000000 --- a/vendor/symfony/translation/Reader/TranslationReaderInterface.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\Translation\Reader; - -use Symfony\Component\Translation\MessageCatalogue; - -/** - * TranslationReader reads translation messages from translation files. - * - * @author Tobias Nyholm - */ -interface TranslationReaderInterface -{ - /** - * Reads translation messages from a directory to the catalogue. - */ - public function read(string $directory, MessageCatalogue $catalogue); -} diff --git a/vendor/symfony/translation/Resources/bin/translation-status.php b/vendor/symfony/translation/Resources/bin/translation-status.php deleted file mode 100644 index 4fe814cf..00000000 --- a/vendor/symfony/translation/Resources/bin/translation-status.php +++ /dev/null @@ -1,278 +0,0 @@ - - * - * 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.'); -} - -$usageInstructions = << false, - // NULL = analyze all locales - 'locale_to_analyze' => null, - // append --incomplete to only show incomplete languages - 'include_completed_languages' => true, - // the reference files all the other translations are compared to - 'original_files' => [ - 'src/Symfony/Component/Form/Resources/translations/validators.en.xlf', - 'src/Symfony/Component/Security/Core/Resources/translations/security.en.xlf', - 'src/Symfony/Component/Validator/Resources/translations/validators.en.xlf', - ], -]; - -$argc = $_SERVER['argc']; -$argv = $_SERVER['argv']; - -if ($argc > 4) { - echo str_replace('translation-status.php', $argv[0], $usageInstructions); - exit(1); -} - -foreach (array_slice($argv, 1) as $argumentOrOption) { - if ('--incomplete' === $argumentOrOption) { - $config['include_completed_languages'] = false; - continue; - } - - if (str_starts_with($argumentOrOption, '-')) { - $config['verbose_output'] = true; - } else { - $config['locale_to_analyze'] = $argumentOrOption; - } -} - -foreach ($config['original_files'] as $originalFilePath) { - if (!file_exists($originalFilePath)) { - echo sprintf('The following file does not exist. Make sure that you execute this command at the root dir of the Symfony code repository.%s %s', \PHP_EOL, $originalFilePath); - exit(1); - } -} - -$totalMissingTranslations = 0; -$totalTranslationMismatches = 0; - -foreach ($config['original_files'] as $originalFilePath) { - $translationFilePaths = findTranslationFiles($originalFilePath, $config['locale_to_analyze']); - $translationStatus = calculateTranslationStatus($originalFilePath, $translationFilePaths); - - $totalMissingTranslations += array_sum(array_map(function ($translation) { - return count($translation['missingKeys']); - }, array_values($translationStatus))); - $totalTranslationMismatches += array_sum(array_map(function ($translation) { - return count($translation['mismatches']); - }, array_values($translationStatus))); - - printTranslationStatus($originalFilePath, $translationStatus, $config['verbose_output'], $config['include_completed_languages']); -} - -exit($totalTranslationMismatches > 0 ? 1 : 0); - -function findTranslationFiles($originalFilePath, $localeToAnalyze) -{ - $translations = []; - - $translationsDir = dirname($originalFilePath); - $originalFileName = basename($originalFilePath); - $translationFileNamePattern = str_replace('.en.', '.*.', $originalFileName); - - $translationFiles = glob($translationsDir.'/'.$translationFileNamePattern, \GLOB_NOSORT); - sort($translationFiles); - foreach ($translationFiles as $filePath) { - $locale = extractLocaleFromFilePath($filePath); - - if (null !== $localeToAnalyze && $locale !== $localeToAnalyze) { - continue; - } - - $translations[$locale] = $filePath; - } - - return $translations; -} - -function calculateTranslationStatus($originalFilePath, $translationFilePaths) -{ - $translationStatus = []; - $allTranslationKeys = extractTranslationKeys($originalFilePath); - - foreach ($translationFilePaths as $locale => $translationPath) { - $translatedKeys = extractTranslationKeys($translationPath); - $missingKeys = array_diff_key($allTranslationKeys, $translatedKeys); - $mismatches = findTransUnitMismatches($allTranslationKeys, $translatedKeys); - - $translationStatus[$locale] = [ - 'total' => count($allTranslationKeys), - 'translated' => count($translatedKeys), - 'missingKeys' => $missingKeys, - 'mismatches' => $mismatches, - ]; - $translationStatus[$locale]['is_completed'] = isTranslationCompleted($translationStatus[$locale]); - } - - return $translationStatus; -} - -function isTranslationCompleted(array $translationStatus): bool -{ - return $translationStatus['total'] === $translationStatus['translated'] && 0 === count($translationStatus['mismatches']); -} - -function printTranslationStatus($originalFilePath, $translationStatus, $verboseOutput, $includeCompletedLanguages) -{ - printTitle($originalFilePath); - printTable($translationStatus, $verboseOutput, $includeCompletedLanguages); - echo \PHP_EOL.\PHP_EOL; -} - -function extractLocaleFromFilePath($filePath) -{ - $parts = explode('.', $filePath); - - return $parts[count($parts) - 2]; -} - -function extractTranslationKeys($filePath) -{ - $translationKeys = []; - $contents = new \SimpleXMLElement(file_get_contents($filePath)); - - foreach ($contents->file->body->{'trans-unit'} as $translationKey) { - $translationId = (string) $translationKey['id']; - $translationKey = (string) $translationKey->source; - - $translationKeys[$translationId] = $translationKey; - } - - return $translationKeys; -} - -/** - * Check whether the trans-unit id and source match with the base translation. - */ -function findTransUnitMismatches(array $baseTranslationKeys, array $translatedKeys): array -{ - $mismatches = []; - - foreach ($baseTranslationKeys as $translationId => $translationKey) { - if (!isset($translatedKeys[$translationId])) { - continue; - } - if ($translatedKeys[$translationId] !== $translationKey) { - $mismatches[$translationId] = [ - 'found' => $translatedKeys[$translationId], - 'expected' => $translationKey, - ]; - } - } - - return $mismatches; -} - -function printTitle($title) -{ - echo $title.\PHP_EOL; - echo str_repeat('=', strlen($title)).\PHP_EOL.\PHP_EOL; -} - -function printTable($translations, $verboseOutput, bool $includeCompletedLanguages) -{ - if (0 === count($translations)) { - echo 'No translations found'; - - return; - } - $longestLocaleNameLength = max(array_map('strlen', array_keys($translations))); - - foreach ($translations as $locale => $translation) { - if (!$includeCompletedLanguages && $translation['is_completed']) { - continue; - } - - if ($translation['translated'] > $translation['total']) { - textColorRed(); - } elseif (count($translation['mismatches']) > 0) { - textColorRed(); - } elseif ($translation['is_completed']) { - textColorGreen(); - } - - echo sprintf( - '| Locale: %-'.$longestLocaleNameLength.'s | Translated: %2d/%2d | Mismatches: %d |', - $locale, - $translation['translated'], - $translation['total'], - count($translation['mismatches']) - ).\PHP_EOL; - - textColorNormal(); - - $shouldBeClosed = false; - if (true === $verboseOutput && count($translation['missingKeys']) > 0) { - echo '| Missing Translations:'.\PHP_EOL; - - foreach ($translation['missingKeys'] as $id => $content) { - echo sprintf('| (id=%s) %s', $id, $content).\PHP_EOL; - } - $shouldBeClosed = true; - } - if (true === $verboseOutput && count($translation['mismatches']) > 0) { - echo '| Mismatches between trans-unit id and source:'.\PHP_EOL; - - foreach ($translation['mismatches'] as $id => $content) { - echo sprintf('| (id=%s) Expected: %s', $id, $content['expected']).\PHP_EOL; - echo sprintf('| Found: %s', $content['found']).\PHP_EOL; - } - $shouldBeClosed = true; - } - if ($shouldBeClosed) { - echo str_repeat('-', 80).\PHP_EOL; - } - } -} - -function textColorGreen() -{ - echo "\033[32m"; -} - -function textColorRed() -{ - echo "\033[31m"; -} - -function textColorNormal() -{ - echo "\033[0m"; -} diff --git a/vendor/symfony/translation/Resources/data/parents.json b/vendor/symfony/translation/Resources/data/parents.json deleted file mode 100644 index 32a33cda..00000000 --- a/vendor/symfony/translation/Resources/data/parents.json +++ /dev/null @@ -1,141 +0,0 @@ -{ - "az_Cyrl": "root", - "bs_Cyrl": "root", - "en_150": "en_001", - "en_AG": "en_001", - "en_AI": "en_001", - "en_AT": "en_150", - "en_AU": "en_001", - "en_BB": "en_001", - "en_BE": "en_150", - "en_BM": "en_001", - "en_BS": "en_001", - "en_BW": "en_001", - "en_BZ": "en_001", - "en_CC": "en_001", - "en_CH": "en_150", - "en_CK": "en_001", - "en_CM": "en_001", - "en_CX": "en_001", - "en_CY": "en_001", - "en_DE": "en_150", - "en_DG": "en_001", - "en_DK": "en_150", - "en_DM": "en_001", - "en_ER": "en_001", - "en_FI": "en_150", - "en_FJ": "en_001", - "en_FK": "en_001", - "en_FM": "en_001", - "en_GB": "en_001", - "en_GD": "en_001", - "en_GG": "en_001", - "en_GH": "en_001", - "en_GI": "en_001", - "en_GM": "en_001", - "en_GY": "en_001", - "en_HK": "en_001", - "en_IE": "en_001", - "en_IL": "en_001", - "en_IM": "en_001", - "en_IN": "en_001", - "en_IO": "en_001", - "en_JE": "en_001", - "en_JM": "en_001", - "en_KE": "en_001", - "en_KI": "en_001", - "en_KN": "en_001", - "en_KY": "en_001", - "en_LC": "en_001", - "en_LR": "en_001", - "en_LS": "en_001", - "en_MG": "en_001", - "en_MO": "en_001", - "en_MS": "en_001", - "en_MT": "en_001", - "en_MU": "en_001", - "en_MV": "en_001", - "en_MW": "en_001", - "en_MY": "en_001", - "en_NA": "en_001", - "en_NF": "en_001", - "en_NG": "en_001", - "en_NL": "en_150", - "en_NR": "en_001", - "en_NU": "en_001", - "en_NZ": "en_001", - "en_PG": "en_001", - "en_PK": "en_001", - "en_PN": "en_001", - "en_PW": "en_001", - "en_RW": "en_001", - "en_SB": "en_001", - "en_SC": "en_001", - "en_SD": "en_001", - "en_SE": "en_150", - "en_SG": "en_001", - "en_SH": "en_001", - "en_SI": "en_150", - "en_SL": "en_001", - "en_SS": "en_001", - "en_SX": "en_001", - "en_SZ": "en_001", - "en_TC": "en_001", - "en_TK": "en_001", - "en_TO": "en_001", - "en_TT": "en_001", - "en_TV": "en_001", - "en_TZ": "en_001", - "en_UG": "en_001", - "en_VC": "en_001", - "en_VG": "en_001", - "en_VU": "en_001", - "en_WS": "en_001", - "en_ZA": "en_001", - "en_ZM": "en_001", - "en_ZW": "en_001", - "es_AR": "es_419", - "es_BO": "es_419", - "es_BR": "es_419", - "es_BZ": "es_419", - "es_CL": "es_419", - "es_CO": "es_419", - "es_CR": "es_419", - "es_CU": "es_419", - "es_DO": "es_419", - "es_EC": "es_419", - "es_GT": "es_419", - "es_HN": "es_419", - "es_MX": "es_419", - "es_NI": "es_419", - "es_PA": "es_419", - "es_PE": "es_419", - "es_PR": "es_419", - "es_PY": "es_419", - "es_SV": "es_419", - "es_US": "es_419", - "es_UY": "es_419", - "es_VE": "es_419", - "ff_Adlm": "root", - "hi_Latn": "en_IN", - "ks_Deva": "root", - "nb": "no", - "nn": "no", - "pa_Arab": "root", - "pt_AO": "pt_PT", - "pt_CH": "pt_PT", - "pt_CV": "pt_PT", - "pt_GQ": "pt_PT", - "pt_GW": "pt_PT", - "pt_LU": "pt_PT", - "pt_MO": "pt_PT", - "pt_MZ": "pt_PT", - "pt_ST": "pt_PT", - "pt_TL": "pt_PT", - "sd_Deva": "root", - "sr_Latn": "root", - "uz_Arab": "root", - "uz_Cyrl": "root", - "zh_Hant": "root", - "zh_Hant_MO": "zh_Hant_HK" -} diff --git a/vendor/symfony/translation/Resources/functions.php b/vendor/symfony/translation/Resources/functions.php deleted file mode 100644 index 901d2f87..00000000 --- a/vendor/symfony/translation/Resources/functions.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation; - -if (!\function_exists(t::class)) { - /** - * @author Nate Wiebe - */ - function t(string $message, array $parameters = [], string $domain = null): TranslatableMessage - { - return new TranslatableMessage($message, $parameters, $domain); - } -} diff --git a/vendor/symfony/translation/Resources/schemas/xliff-core-1.2-transitional.xsd b/vendor/symfony/translation/Resources/schemas/xliff-core-1.2-transitional.xsd deleted file mode 100644 index 1f38de72..00000000 --- a/vendor/symfony/translation/Resources/schemas/xliff-core-1.2-transitional.xsd +++ /dev/null @@ -1,2261 +0,0 @@ - - - - - - - - - - - - - - Values for the attribute 'context-type'. - - - - - Indicates a database content. - - - - - Indicates the content of an element within an XML document. - - - - - Indicates the name of an element within an XML document. - - - - - Indicates the line number from the sourcefile (see context-type="sourcefile") where the <source> is found. - - - - - Indicates a the number of parameters contained within the <source>. - - - - - Indicates notes pertaining to the parameters in the <source>. - - - - - Indicates the content of a record within a database. - - - - - Indicates the name of a record within a database. - - - - - Indicates the original source file in the case that multiple files are merged to form the original file from which the XLIFF file is created. This differs from the original <file> attribute in that this sourcefile is one of many that make up that file. - - - - - - - Values for the attribute 'count-type'. - - - - - Indicates the count units are items that are used X times in a certain context; example: this is a reusable text unit which is used 42 times in other texts. - - - - - Indicates the count units are translation units existing already in the same document. - - - - - Indicates a total count. - - - - - - - Values for the attribute 'ctype' when used other elements than <ph> or <x>. - - - - - Indicates a run of bolded text. - - - - - Indicates a run of text in italics. - - - - - Indicates a run of underlined text. - - - - - Indicates a run of hyper-text. - - - - - - - Values for the attribute 'ctype' when used with <ph> or <x>. - - - - - Indicates a inline image. - - - - - Indicates a page break. - - - - - Indicates a line break. - - - - - - - - - - - - Values for the attribute 'datatype'. - - - - - Indicates Active Server Page data. - - - - - Indicates C source file data. - - - - - Indicates Channel Definition Format (CDF) data. - - - - - Indicates ColdFusion data. - - - - - Indicates C++ source file data. - - - - - Indicates C-Sharp data. - - - - - Indicates strings from C, ASM, and driver files data. - - - - - Indicates comma-separated values data. - - - - - Indicates database data. - - - - - Indicates portions of document that follows data and contains metadata. - - - - - Indicates portions of document that precedes data and contains metadata. - - - - - Indicates data from standard UI file operations dialogs (e.g., Open, Save, Save As, Export, Import). - - - - - Indicates standard user input screen data. - - - - - Indicates HyperText Markup Language (HTML) data - document instance. - - - - - Indicates content within an HTML document’s <body> element. - - - - - Indicates Windows INI file data. - - - - - Indicates Interleaf data. - - - - - Indicates Java source file data (extension '.java'). - - - - - Indicates Java property resource bundle data. - - - - - Indicates Java list resource bundle data. - - - - - Indicates JavaScript source file data. - - - - - Indicates JScript source file data. - - - - - Indicates information relating to formatting. - - - - - Indicates LISP source file data. - - - - - Indicates information relating to margin formats. - - - - - Indicates a file containing menu. - - - - - Indicates numerically identified string table. - - - - - Indicates Maker Interchange Format (MIF) data. - - - - - Indicates that the datatype attribute value is a MIME Type value and is defined in the mime-type attribute. - - - - - Indicates GNU Machine Object data. - - - - - Indicates Message Librarian strings created by Novell's Message Librarian Tool. - - - - - Indicates information to be displayed at the bottom of each page of a document. - - - - - Indicates information to be displayed at the top of each page of a document. - - - - - Indicates a list of property values (e.g., settings within INI files or preferences dialog). - - - - - Indicates Pascal source file data. - - - - - Indicates Hypertext Preprocessor data. - - - - - Indicates plain text file (no formatting other than, possibly, wrapping). - - - - - Indicates GNU Portable Object file. - - - - - Indicates dynamically generated user defined document. e.g. Oracle Report, Crystal Report, etc. - - - - - Indicates Windows .NET binary resources. - - - - - Indicates Windows .NET Resources. - - - - - Indicates Rich Text Format (RTF) data. - - - - - Indicates Standard Generalized Markup Language (SGML) data - document instance. - - - - - Indicates Standard Generalized Markup Language (SGML) data - Document Type Definition (DTD). - - - - - Indicates Scalable Vector Graphic (SVG) data. - - - - - Indicates VisualBasic Script source file. - - - - - Indicates warning message. - - - - - Indicates Windows (Win32) resources (i.e. resources extracted from an RC script, a message file, or a compiled file). - - - - - Indicates Extensible HyperText Markup Language (XHTML) data - document instance. - - - - - Indicates Extensible Markup Language (XML) data - document instance. - - - - - Indicates Extensible Markup Language (XML) data - Document Type Definition (DTD). - - - - - Indicates Extensible Stylesheet Language (XSL) data. - - - - - Indicates XUL elements. - - - - - - - Values for the attribute 'mtype'. - - - - - Indicates the marked text is an abbreviation. - - - - - ISO-12620 2.1.8: A term resulting from the omission of any part of the full term while designating the same concept. - - - - - ISO-12620 2.1.8.1: An abbreviated form of a simple term resulting from the omission of some of its letters (e.g. 'adj.' for 'adjective'). - - - - - ISO-12620 2.1.8.4: An abbreviated form of a term made up of letters from the full form of a multiword term strung together into a sequence pronounced only syllabically (e.g. 'radar' for 'radio detecting and ranging'). - - - - - ISO-12620: A proper-name term, such as the name of an agency or other proper entity. - - - - - ISO-12620 2.1.18.1: A recurrent word combination characterized by cohesion in that the components of the collocation must co-occur within an utterance or series of utterances, even though they do not necessarily have to maintain immediate proximity to one another. - - - - - ISO-12620 2.1.5: A synonym for an international scientific term that is used in general discourse in a given language. - - - - - Indicates the marked text is a date and/or time. - - - - - ISO-12620 2.1.15: An expression used to represent a concept based on a statement that two mathematical expressions are, for instance, equal as identified by the equal sign (=), or assigned to one another by a similar sign. - - - - - ISO-12620 2.1.7: The complete representation of a term for which there is an abbreviated form. - - - - - ISO-12620 2.1.14: Figures, symbols or the like used to express a concept briefly, such as a mathematical or chemical formula. - - - - - ISO-12620 2.1.1: The concept designation that has been chosen to head a terminological record. - - - - - ISO-12620 2.1.8.3: An abbreviated form of a term consisting of some of the initial letters of the words making up a multiword term or the term elements making up a compound term when these letters are pronounced individually (e.g. 'BSE' for 'bovine spongiform encephalopathy'). - - - - - ISO-12620 2.1.4: A term that is part of an international scientific nomenclature as adopted by an appropriate scientific body. - - - - - ISO-12620 2.1.6: A term that has the same or nearly identical orthographic or phonemic form in many languages. - - - - - ISO-12620 2.1.16: An expression used to represent a concept based on mathematical or logical relations, such as statements of inequality, set relationships, Boolean operations, and the like. - - - - - ISO-12620 2.1.17: A unit to track object. - - - - - Indicates the marked text is a name. - - - - - ISO-12620 2.1.3: A term that represents the same or a very similar concept as another term in the same language, but for which interchangeability is limited to some contexts and inapplicable in others. - - - - - ISO-12620 2.1.17.2: A unique alphanumeric designation assigned to an object in a manufacturing system. - - - - - Indicates the marked text is a phrase. - - - - - ISO-12620 2.1.18: Any group of two or more words that form a unit, the meaning of which frequently cannot be deduced based on the combined sense of the words making up the phrase. - - - - - Indicates the marked text should not be translated. - - - - - ISO-12620 2.1.12: A form of a term resulting from an operation whereby non-Latin writing systems are converted to the Latin alphabet. - - - - - Indicates that the marked text represents a segment. - - - - - ISO-12620 2.1.18.2: A fixed, lexicalized phrase. - - - - - ISO-12620 2.1.8.2: A variant of a multiword term that includes fewer words than the full form of the term (e.g. 'Group of Twenty-four' for 'Intergovernmental Group of Twenty-four on International Monetary Affairs'). - - - - - ISO-12620 2.1.17.1: Stock keeping unit, an inventory item identified by a unique alphanumeric designation assigned to an object in an inventory control system. - - - - - ISO-12620 2.1.19: A fixed chunk of recurring text. - - - - - ISO-12620 2.1.13: A designation of a concept by letters, numerals, pictograms or any combination thereof. - - - - - ISO-12620 2.1.2: Any term that represents the same or a very similar concept as the main entry term in a term entry. - - - - - ISO-12620 2.1.18.3: Phraseological unit in a language that expresses the same semantic content as another phrase in that same language. - - - - - Indicates the marked text is a term. - - - - - ISO-12620 2.1.11: A form of a term resulting from an operation whereby the characters of one writing system are represented by characters from another writing system, taking into account the pronunciation of the characters converted. - - - - - ISO-12620 2.1.10: A form of a term resulting from an operation whereby the characters of an alphabetic writing system are represented by characters from another alphabetic writing system. - - - - - ISO-12620 2.1.8.5: An abbreviated form of a term resulting from the omission of one or more term elements or syllables (e.g. 'flu' for 'influenza'). - - - - - ISO-12620 2.1.9: One of the alternate forms of a term. - - - - - - - Values for the attribute 'restype'. - - - - - Indicates a Windows RC AUTO3STATE control. - - - - - Indicates a Windows RC AUTOCHECKBOX control. - - - - - Indicates a Windows RC AUTORADIOBUTTON control. - - - - - Indicates a Windows RC BEDIT control. - - - - - Indicates a bitmap, for example a BITMAP resource in Windows. - - - - - Indicates a button object, for example a BUTTON control Windows. - - - - - Indicates a caption, such as the caption of a dialog box. - - - - - Indicates the cell in a table, for example the content of the <td> element in HTML. - - - - - Indicates check box object, for example a CHECKBOX control in Windows. - - - - - Indicates a menu item with an associated checkbox. - - - - - Indicates a list box, but with a check-box for each item. - - - - - Indicates a color selection dialog. - - - - - Indicates a combination of edit box and listbox object, for example a COMBOBOX control in Windows. - - - - - Indicates an initialization entry of an extended combobox DLGINIT resource block. (code 0x1234). - - - - - Indicates an initialization entry of a combobox DLGINIT resource block (code 0x0403). - - - - - Indicates a UI base class element that cannot be represented by any other element. - - - - - Indicates a context menu. - - - - - Indicates a Windows RC CTEXT control. - - - - - Indicates a cursor, for example a CURSOR resource in Windows. - - - - - Indicates a date/time picker. - - - - - Indicates a Windows RC DEFPUSHBUTTON control. - - - - - Indicates a dialog box. - - - - - Indicates a Windows RC DLGINIT resource block. - - - - - Indicates an edit box object, for example an EDIT control in Windows. - - - - - Indicates a filename. - - - - - Indicates a file dialog. - - - - - Indicates a footnote. - - - - - Indicates a font name. - - - - - Indicates a footer. - - - - - Indicates a frame object. - - - - - Indicates a XUL grid element. - - - - - Indicates a groupbox object, for example a GROUPBOX control in Windows. - - - - - Indicates a header item. - - - - - Indicates a heading, such has the content of <h1>, <h2>, etc. in HTML. - - - - - Indicates a Windows RC HEDIT control. - - - - - Indicates a horizontal scrollbar. - - - - - Indicates an icon, for example an ICON resource in Windows. - - - - - Indicates a Windows RC IEDIT control. - - - - - Indicates keyword list, such as the content of the Keywords meta-data in HTML, or a K footnote in WinHelp RTF. - - - - - Indicates a label object. - - - - - Indicates a label that is also a HTML link (not necessarily a URL). - - - - - Indicates a list (a group of list-items, for example an <ol> or <ul> element in HTML). - - - - - Indicates a listbox object, for example an LISTBOX control in Windows. - - - - - Indicates an list item (an entry in a list). - - - - - Indicates a Windows RC LTEXT control. - - - - - Indicates a menu (a group of menu-items). - - - - - Indicates a toolbar containing one or more tope level menus. - - - - - Indicates a menu item (an entry in a menu). - - - - - Indicates a XUL menuseparator element. - - - - - Indicates a message, for example an entry in a MESSAGETABLE resource in Windows. - - - - - Indicates a calendar control. - - - - - Indicates an edit box beside a spin control. - - - - - Indicates a catch all for rectangular areas. - - - - - Indicates a standalone menu not necessarily associated with a menubar. - - - - - Indicates a pushbox object, for example a PUSHBOX control in Windows. - - - - - Indicates a Windows RC PUSHBUTTON control. - - - - - Indicates a radio button object. - - - - - Indicates a menuitem with associated radio button. - - - - - Indicates raw data resources for an application. - - - - - Indicates a row in a table. - - - - - Indicates a Windows RC RTEXT control. - - - - - Indicates a user navigable container used to show a portion of a document. - - - - - Indicates a generic divider object (e.g. menu group separator). - - - - - Windows accelerators, shortcuts in resource or property files. - - - - - Indicates a UI control to indicate process activity but not progress. - - - - - Indicates a splitter bar. - - - - - Indicates a Windows RC STATE3 control. - - - - - Indicates a window for providing feedback to the users, like 'read-only', etc. - - - - - Indicates a string, for example an entry in a STRINGTABLE resource in Windows. - - - - - Indicates a layers of controls with a tab to select layers. - - - - - Indicates a display and edits regular two-dimensional tables of cells. - - - - - Indicates a XUL textbox element. - - - - - Indicates a UI button that can be toggled to on or off state. - - - - - Indicates an array of controls, usually buttons. - - - - - Indicates a pop up tool tip text. - - - - - Indicates a bar with a pointer indicating a position within a certain range. - - - - - Indicates a control that displays a set of hierarchical data. - - - - - Indicates a URI (URN or URL). - - - - - Indicates a Windows RC USERBUTTON control. - - - - - Indicates a user-defined control like CONTROL control in Windows. - - - - - Indicates the text of a variable. - - - - - Indicates version information about a resource like VERSIONINFO in Windows. - - - - - Indicates a vertical scrollbar. - - - - - Indicates a graphical window. - - - - - - - Values for the attribute 'size-unit'. - - - - - Indicates a size in 8-bit bytes. - - - - - Indicates a size in Unicode characters. - - - - - Indicates a size in columns. Used for HTML text area. - - - - - Indicates a size in centimeters. - - - - - Indicates a size in dialog units, as defined in Windows resources. - - - - - Indicates a size in 'font-size' units (as defined in CSS). - - - - - Indicates a size in 'x-height' units (as defined in CSS). - - - - - Indicates a size in glyphs. A glyph is considered to be one or more combined Unicode characters that represent a single displayable text character. Sometimes referred to as a 'grapheme cluster' - - - - - Indicates a size in inches. - - - - - Indicates a size in millimeters. - - - - - Indicates a size in percentage. - - - - - Indicates a size in pixels. - - - - - Indicates a size in point. - - - - - Indicates a size in rows. Used for HTML text area. - - - - - - - Values for the attribute 'state'. - - - - - Indicates the terminating state. - - - - - Indicates only non-textual information needs adaptation. - - - - - Indicates both text and non-textual information needs adaptation. - - - - - Indicates only non-textual information needs review. - - - - - Indicates both text and non-textual information needs review. - - - - - Indicates that only the text of the item needs to be reviewed. - - - - - Indicates that the item needs to be translated. - - - - - Indicates that the item is new. For example, translation units that were not in a previous version of the document. - - - - - Indicates that changes are reviewed and approved. - - - - - Indicates that the item has been translated. - - - - - - - Values for the attribute 'state-qualifier'. - - - - - Indicates an exact match. An exact match occurs when a source text of a segment is exactly the same as the source text of a segment that was translated previously. - - - - - Indicates a fuzzy match. A fuzzy match occurs when a source text of a segment is very similar to the source text of a segment that was translated previously (e.g. when the difference is casing, a few changed words, white-space discripancy, etc.). - - - - - Indicates a match based on matching IDs (in addition to matching text). - - - - - Indicates a translation derived from a glossary. - - - - - Indicates a translation derived from existing translation. - - - - - Indicates a translation derived from machine translation. - - - - - Indicates a translation derived from a translation repository. - - - - - Indicates a translation derived from a translation memory. - - - - - Indicates the translation is suggested by machine translation. - - - - - Indicates that the item has been rejected because of incorrect grammar. - - - - - Indicates that the item has been rejected because it is incorrect. - - - - - Indicates that the item has been rejected because it is too long or too short. - - - - - Indicates that the item has been rejected because of incorrect spelling. - - - - - Indicates the translation is suggested by translation memory. - - - - - - - Values for the attribute 'unit'. - - - - - Refers to words. - - - - - Refers to pages. - - - - - Refers to <trans-unit> elements. - - - - - Refers to <bin-unit> elements. - - - - - Refers to glyphs. - - - - - Refers to <trans-unit> and/or <bin-unit> elements. - - - - - Refers to the occurrences of instances defined by the count-type value. - - - - - Refers to characters. - - - - - Refers to lines. - - - - - Refers to sentences. - - - - - Refers to paragraphs. - - - - - Refers to segments. - - - - - Refers to placeables (inline elements). - - - - - - - Values for the attribute 'priority'. - - - - - Highest priority. - - - - - High priority. - - - - - High priority, but not as important as 2. - - - - - High priority, but not as important as 3. - - - - - Medium priority, but more important than 6. - - - - - Medium priority, but less important than 5. - - - - - Low priority, but more important than 8. - - - - - Low priority, but more important than 9. - - - - - Low priority. - - - - - Lowest priority. - - - - - - - - - This value indicates that all properties can be reformatted. This value must be used alone. - - - - - This value indicates that no properties should be reformatted. This value must be used alone. - - - - - - - - - - - - - This value indicates that all information in the coord attribute can be modified. - - - - - This value indicates that the x information in the coord attribute can be modified. - - - - - This value indicates that the y information in the coord attribute can be modified. - - - - - This value indicates that the cx information in the coord attribute can be modified. - - - - - This value indicates that the cy information in the coord attribute can be modified. - - - - - This value indicates that all the information in the font attribute can be modified. - - - - - This value indicates that the name information in the font attribute can be modified. - - - - - This value indicates that the size information in the font attribute can be modified. - - - - - This value indicates that the weight information in the font attribute can be modified. - - - - - This value indicates that the information in the css-style attribute can be modified. - - - - - This value indicates that the information in the style attribute can be modified. - - - - - This value indicates that the information in the exstyle attribute can be modified. - - - - - - - - - - - - - Indicates that the context is informational in nature, specifying for example, how a term should be translated. Thus, should be displayed to anyone editing the XLIFF document. - - - - - Indicates that the context-group is used to specify where the term was found in the translatable source. Thus, it is not displayed. - - - - - Indicates that the context information should be used during translation memory lookups. Thus, it is not displayed. - - - - - - - - - Represents a translation proposal from a translation memory or other resource. - - - - - Represents a previous version of the target element. - - - - - Represents a rejected version of the target element. - - - - - Represents a translation to be used for reference purposes only, for example from a related product or a different language. - - - - - Represents a proposed translation that was used for the translation of the trans-unit, possibly modified. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Values for the attribute 'coord'. - - - - - - - - Version values: 1.0 and 1.1 are allowed for backward compatibility. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/symfony/translation/Resources/schemas/xliff-core-2.0.xsd b/vendor/symfony/translation/Resources/schemas/xliff-core-2.0.xsd deleted file mode 100644 index 963232f9..00000000 --- a/vendor/symfony/translation/Resources/schemas/xliff-core-2.0.xsd +++ /dev/null @@ -1,411 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/symfony/translation/Resources/schemas/xml.xsd b/vendor/symfony/translation/Resources/schemas/xml.xsd deleted file mode 100644 index a46162a7..00000000 --- a/vendor/symfony/translation/Resources/schemas/xml.xsd +++ /dev/null @@ -1,309 +0,0 @@ - - - - - - -
      -

      About the XML namespace

      - -
      -

      - - This schema document describes the XML namespace, in a form - suitable for import by other schema documents. -

      -

      - See - http://www.w3.org/XML/1998/namespace.html and - - http://www.w3.org/TR/REC-xml for information - about this namespace. -

      - -

      - Note that local names in this namespace are intended to be - defined only by the World Wide Web Consortium or its subgroups. - The names currently defined in this namespace are listed below. - They should not be used with conflicting semantics by any Working - Group, specification, or document instance. -

      -

      - See further below in this document for more information about how to refer to this schema document from your own - XSD schema documents and about the - namespace-versioning policy governing this schema document. -

      -
      -
      - -
      -
      - - - - -
      - -

      lang (as an attribute name)

      -

      - - denotes an attribute whose value - is a language code for the natural language of the content of - any element; its value is inherited. This name is reserved - by virtue of its definition in the XML specification.

      - -
      -
      -

      Notes

      -

      - Attempting to install the relevant ISO 2- and 3-letter - codes as the enumerated possible values is probably never - going to be a realistic possibility. -

      -

      - - See BCP 47 at - http://www.rfc-editor.org/rfc/bcp/bcp47.txt - and the IANA language subtag registry at - - http://www.iana.org/assignments/language-subtag-registry - for further information. -

      -

      - - The union allows for the 'un-declaration' of xml:lang with - the empty string. -

      -
      -
      -
      - - - - - - - - - - -
      - - - - - -
      - -

      space (as an attribute name)

      -

      - denotes an attribute whose - value is a keyword indicating what whitespace processing - discipline is intended for the content of the element; its - value is inherited. This name is reserved by virtue of its - definition in the XML specification.

      - -
      -
      -
      - - - - - - - -
      - - - - -
      - -

      base (as an attribute name)

      -

      - denotes an attribute whose value - provides a URI to be used as the base for interpreting any - relative URIs in the scope of the element on which it - appears; its value is inherited. This name is reserved - by virtue of its definition in the XML Base specification.

      - -

      - See http://www.w3.org/TR/xmlbase/ - for information about this attribute. -

      - -
      -
      -
      -
      - - - - -
      - -

      id (as an attribute name)

      -

      - - denotes an attribute whose value - should be interpreted as if declared to be of type ID. - This name is reserved by virtue of its definition in the - xml:id specification.

      - -

      - See http://www.w3.org/TR/xml-id/ - for information about this attribute. -

      -
      -
      -
      - -
      - - - - - - - - - - - -
      - -

      Father (in any context at all)

      - -
      -

      - denotes Jon Bosak, the chair of - the original XML Working Group. This name is reserved by - the following decision of the W3C XML Plenary and - XML Coordination groups: -

      -
      -

      - - In appreciation for his vision, leadership and - dedication the W3C XML Plenary on this 10th day of - February, 2000, reserves for Jon Bosak in perpetuity - the XML name "xml:Father". -

      -
      -
      -
      -
      -
      - - - - -
      -

      About this schema document

      - -
      -

      - This schema defines attributes and an attribute group suitable - for use by schemas wishing to allow xml:base, - xml:lang, xml:space or - xml:id attributes on elements they define. -

      - -

      - To enable this, such a schema must import this schema for - the XML namespace, e.g. as follows: -

      -
      -          <schema.. .>
      -          .. .
      -           <import namespace="http://www.w3.org/XML/1998/namespace"
      -                      schemaLocation="http://www.w3.org/2001/xml.xsd"/>
      -     
      -

      - or -

      -
      -
      -           <import namespace="http://www.w3.org/XML/1998/namespace"
      -                      schemaLocation="http://www.w3.org/2009/01/xml.xsd"/>
      -     
      -

      - Subsequently, qualified reference to any of the attributes or the - group defined below will have the desired effect, e.g. -

      -
      -          <type.. .>
      -          .. .
      -           <attributeGroup ref="xml:specialAttrs"/>
      -     
      -

      - will define a type which will schema-validate an instance element - with any of those attributes. -

      - -
      -
      -
      -
      - - - -
      -

      Versioning policy for this schema document

      - -
      -

      - In keeping with the XML Schema WG's standard versioning - policy, this schema document will persist at - - http://www.w3.org/2009/01/xml.xsd. -

      -

      - At the date of issue it can also be found at - - http://www.w3.org/2001/xml.xsd. -

      - -

      - The schema document at that URI may however change in the future, - in order to remain compatible with the latest version of XML - Schema itself, or with the XML namespace itself. In other words, - if the XML Schema or XML namespaces change, the version of this - document at - http://www.w3.org/2001/xml.xsd - - will change accordingly; the version at - - http://www.w3.org/2009/01/xml.xsd - - will not change. -

      -

      - - Previous dated (and unchanging) versions of this schema - document are at: -

      - -
      -
      -
      -
      - -
      diff --git a/vendor/symfony/translation/Test/ProviderFactoryTestCase.php b/vendor/symfony/translation/Test/ProviderFactoryTestCase.php deleted file mode 100644 index d1259c7e..00000000 --- a/vendor/symfony/translation/Test/ProviderFactoryTestCase.php +++ /dev/null @@ -1,155 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Test; - -use PHPUnit\Framework\MockObject\MockObject; -use PHPUnit\Framework\TestCase; -use Psr\Log\LoggerInterface; -use Symfony\Component\HttpClient\MockHttpClient; -use Symfony\Component\Translation\Dumper\XliffFileDumper; -use Symfony\Component\Translation\Exception\IncompleteDsnException; -use Symfony\Component\Translation\Exception\UnsupportedSchemeException; -use Symfony\Component\Translation\Loader\LoaderInterface; -use Symfony\Component\Translation\Provider\Dsn; -use Symfony\Component\Translation\Provider\ProviderFactoryInterface; -use Symfony\Component\Translation\TranslatorBagInterface; -use Symfony\Contracts\HttpClient\HttpClientInterface; - -/** - * A test case to ease testing a translation provider factory. - * - * @author Mathieu Santostefano - * - * @internal - */ -abstract class ProviderFactoryTestCase extends TestCase -{ - protected HttpClientInterface $client; - protected LoggerInterface|MockObject $logger; - protected string $defaultLocale; - protected LoaderInterface|MockObject $loader; - protected XliffFileDumper|MockObject $xliffFileDumper; - protected TranslatorBagInterface|MockObject $translatorBag; - - abstract public function createFactory(): ProviderFactoryInterface; - - /** - * @return iterable - */ - abstract public function supportsProvider(): iterable; - - /** - * @return iterable - */ - abstract public function createProvider(): iterable; - - /** - * @return iterable - */ - public function unsupportedSchemeProvider(): iterable - { - return []; - } - - /** - * @return iterable - */ - public function incompleteDsnProvider(): iterable - { - return []; - } - - /** - * @dataProvider supportsProvider - */ - public function testSupports(bool $expected, string $dsn) - { - $factory = $this->createFactory(); - - $this->assertSame($expected, $factory->supports(new Dsn($dsn))); - } - - /** - * @dataProvider createProvider - */ - public function testCreate(string $expected, string $dsn) - { - $factory = $this->createFactory(); - $provider = $factory->create(new Dsn($dsn)); - - $this->assertSame($expected, (string) $provider); - } - - /** - * @dataProvider unsupportedSchemeProvider - */ - public function testUnsupportedSchemeException(string $dsn, string $message = null) - { - $factory = $this->createFactory(); - - $dsn = new Dsn($dsn); - - $this->expectException(UnsupportedSchemeException::class); - if (null !== $message) { - $this->expectExceptionMessage($message); - } - - $factory->create($dsn); - } - - /** - * @dataProvider incompleteDsnProvider - */ - public function testIncompleteDsnException(string $dsn, string $message = null) - { - $factory = $this->createFactory(); - - $dsn = new Dsn($dsn); - - $this->expectException(IncompleteDsnException::class); - if (null !== $message) { - $this->expectExceptionMessage($message); - } - - $factory->create($dsn); - } - - protected function getClient(): HttpClientInterface - { - return $this->client ??= new MockHttpClient(); - } - - protected function getLogger(): LoggerInterface - { - return $this->logger ??= $this->createMock(LoggerInterface::class); - } - - protected function getDefaultLocale(): string - { - return $this->defaultLocale ??= 'en'; - } - - protected function getLoader(): LoaderInterface - { - return $this->loader ??= $this->createMock(LoaderInterface::class); - } - - protected function getXliffFileDumper(): XliffFileDumper - { - return $this->xliffFileDumper ??= $this->createMock(XliffFileDumper::class); - } - - protected function getTranslatorBag(): TranslatorBagInterface - { - return $this->translatorBag ??= $this->createMock(TranslatorBagInterface::class); - } -} diff --git a/vendor/symfony/translation/Test/ProviderTestCase.php b/vendor/symfony/translation/Test/ProviderTestCase.php deleted file mode 100644 index 6de24ac3..00000000 --- a/vendor/symfony/translation/Test/ProviderTestCase.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\Translation\Test; - -use PHPUnit\Framework\MockObject\MockObject; -use PHPUnit\Framework\TestCase; -use Psr\Log\LoggerInterface; -use Symfony\Component\HttpClient\MockHttpClient; -use Symfony\Component\Translation\Dumper\XliffFileDumper; -use Symfony\Component\Translation\Loader\LoaderInterface; -use Symfony\Component\Translation\Provider\ProviderInterface; -use Symfony\Component\Translation\TranslatorBagInterface; -use Symfony\Contracts\HttpClient\HttpClientInterface; - -/** - * A test case to ease testing a translation provider. - * - * @author Mathieu Santostefano - * - * @internal - */ -abstract class ProviderTestCase extends TestCase -{ - protected HttpClientInterface $client; - protected LoggerInterface|MockObject $logger; - protected string $defaultLocale; - protected LoaderInterface|MockObject $loader; - protected XliffFileDumper|MockObject $xliffFileDumper; - protected TranslatorBagInterface|MockObject $translatorBag; - - abstract public function createProvider(HttpClientInterface $client, LoaderInterface $loader, LoggerInterface $logger, string $defaultLocale, string $endpoint): ProviderInterface; - - /** - * @return iterable - */ - abstract public function toStringProvider(): iterable; - - /** - * @dataProvider toStringProvider - */ - public function testToString(ProviderInterface $provider, string $expected) - { - $this->assertSame($expected, (string) $provider); - } - - protected function getClient(): MockHttpClient - { - return $this->client ??= new MockHttpClient(); - } - - protected function getLoader(): LoaderInterface - { - return $this->loader ??= $this->createMock(LoaderInterface::class); - } - - protected function getLogger(): LoggerInterface - { - return $this->logger ??= $this->createMock(LoggerInterface::class); - } - - protected function getDefaultLocale(): string - { - return $this->defaultLocale ??= 'en'; - } - - protected function getXliffFileDumper(): XliffFileDumper - { - return $this->xliffFileDumper ??= $this->createMock(XliffFileDumper::class); - } - - protected function getTranslatorBag(): TranslatorBagInterface - { - return $this->translatorBag ??= $this->createMock(TranslatorBagInterface::class); - } -} diff --git a/vendor/symfony/translation/TranslatableMessage.php b/vendor/symfony/translation/TranslatableMessage.php deleted file mode 100644 index b1a3b6b1..00000000 --- a/vendor/symfony/translation/TranslatableMessage.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\Translation; - -use Symfony\Contracts\Translation\TranslatableInterface; -use Symfony\Contracts\Translation\TranslatorInterface; - -/** - * @author Nate Wiebe - */ -class TranslatableMessage implements TranslatableInterface -{ - private string $message; - private array $parameters; - private ?string $domain; - - public function __construct(string $message, array $parameters = [], string $domain = null) - { - $this->message = $message; - $this->parameters = $parameters; - $this->domain = $domain; - } - - public function __toString(): string - { - return $this->getMessage(); - } - - public function getMessage(): string - { - return $this->message; - } - - public function getParameters(): array - { - return $this->parameters; - } - - public function getDomain(): ?string - { - return $this->domain; - } - - public function trans(TranslatorInterface $translator, string $locale = null): string - { - return $translator->trans($this->getMessage(), array_map( - static function ($parameter) use ($translator, $locale) { - return $parameter instanceof TranslatableInterface ? $parameter->trans($translator, $locale) : $parameter; - }, - $this->getParameters() - ), $this->getDomain(), $locale); - } -} diff --git a/vendor/symfony/translation/Translator.php b/vendor/symfony/translation/Translator.php deleted file mode 100644 index a9344ddd..00000000 --- a/vendor/symfony/translation/Translator.php +++ /dev/null @@ -1,451 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation; - -use Symfony\Component\Config\ConfigCacheFactory; -use Symfony\Component\Config\ConfigCacheFactoryInterface; -use Symfony\Component\Config\ConfigCacheInterface; -use Symfony\Component\Translation\Exception\InvalidArgumentException; -use Symfony\Component\Translation\Exception\NotFoundResourceException; -use Symfony\Component\Translation\Exception\RuntimeException; -use Symfony\Component\Translation\Formatter\IntlFormatterInterface; -use Symfony\Component\Translation\Formatter\MessageFormatter; -use Symfony\Component\Translation\Formatter\MessageFormatterInterface; -use Symfony\Component\Translation\Loader\LoaderInterface; -use Symfony\Contracts\Translation\LocaleAwareInterface; -use Symfony\Contracts\Translation\TranslatableInterface; -use Symfony\Contracts\Translation\TranslatorInterface; - -// Help opcache.preload discover always-needed symbols -class_exists(MessageCatalogue::class); - -/** - * @author Fabien Potencier - */ -class Translator implements TranslatorInterface, TranslatorBagInterface, LocaleAwareInterface -{ - /** - * @var MessageCatalogueInterface[] - */ - protected $catalogues = []; - - private string $locale; - - /** - * @var string[] - */ - private array $fallbackLocales = []; - - /** - * @var LoaderInterface[] - */ - private array $loaders = []; - - private array $resources = []; - - private MessageFormatterInterface $formatter; - - private ?string $cacheDir; - - private bool $debug; - - private array $cacheVary; - - private ?ConfigCacheFactoryInterface $configCacheFactory; - - private array $parentLocales; - - private bool $hasIntlFormatter; - - /** - * @throws InvalidArgumentException If a locale contains invalid characters - */ - public function __construct(string $locale, MessageFormatterInterface $formatter = null, string $cacheDir = null, bool $debug = false, array $cacheVary = []) - { - $this->setLocale($locale); - - $this->formatter = $formatter ??= new MessageFormatter(); - $this->cacheDir = $cacheDir; - $this->debug = $debug; - $this->cacheVary = $cacheVary; - $this->hasIntlFormatter = $formatter instanceof IntlFormatterInterface; - } - - public function setConfigCacheFactory(ConfigCacheFactoryInterface $configCacheFactory) - { - $this->configCacheFactory = $configCacheFactory; - } - - /** - * Adds a Loader. - * - * @param string $format The name of the loader (@see addResource()) - */ - public function addLoader(string $format, LoaderInterface $loader) - { - $this->loaders[$format] = $loader; - } - - /** - * Adds a Resource. - * - * @param string $format The name of the loader (@see addLoader()) - * @param mixed $resource The resource name - * - * @throws InvalidArgumentException If the locale contains invalid characters - */ - public function addResource(string $format, mixed $resource, string $locale, string $domain = null) - { - $domain ??= 'messages'; - - $this->assertValidLocale($locale); - $locale ?: $locale = class_exists(\Locale::class) ? \Locale::getDefault() : 'en'; - - $this->resources[$locale][] = [$format, $resource, $domain]; - - if (\in_array($locale, $this->fallbackLocales)) { - $this->catalogues = []; - } else { - unset($this->catalogues[$locale]); - } - } - - public function setLocale(string $locale) - { - $this->assertValidLocale($locale); - $this->locale = $locale; - } - - public function getLocale(): string - { - return $this->locale ?: (class_exists(\Locale::class) ? \Locale::getDefault() : 'en'); - } - - /** - * Sets the fallback locales. - * - * @param string[] $locales - * - * @throws InvalidArgumentException If a locale contains invalid characters - */ - public function setFallbackLocales(array $locales) - { - // needed as the fallback locales are linked to the already loaded catalogues - $this->catalogues = []; - - foreach ($locales as $locale) { - $this->assertValidLocale($locale); - } - - $this->fallbackLocales = $this->cacheVary['fallback_locales'] = $locales; - } - - /** - * Gets the fallback locales. - * - * @internal - */ - public function getFallbackLocales(): array - { - return $this->fallbackLocales; - } - - public function trans(?string $id, array $parameters = [], string $domain = null, string $locale = null): string - { - if (null === $id || '' === $id) { - return ''; - } - - $domain ??= 'messages'; - - $catalogue = $this->getCatalogue($locale); - $locale = $catalogue->getLocale(); - while (!$catalogue->defines($id, $domain)) { - if ($cat = $catalogue->getFallbackCatalogue()) { - $catalogue = $cat; - $locale = $catalogue->getLocale(); - } else { - break; - } - } - - $parameters = array_map(function ($parameter) use ($locale) { - return $parameter instanceof TranslatableInterface ? $parameter->trans($this, $locale) : $parameter; - }, $parameters); - - $len = \strlen(MessageCatalogue::INTL_DOMAIN_SUFFIX); - if ($this->hasIntlFormatter - && ($catalogue->defines($id, $domain.MessageCatalogue::INTL_DOMAIN_SUFFIX) - || (\strlen($domain) > $len && 0 === substr_compare($domain, MessageCatalogue::INTL_DOMAIN_SUFFIX, -$len, $len))) - ) { - return $this->formatter->formatIntl($catalogue->get($id, $domain), $locale, $parameters); - } - - return $this->formatter->format($catalogue->get($id, $domain), $locale, $parameters); - } - - public function getCatalogue(string $locale = null): MessageCatalogueInterface - { - if (!$locale) { - $locale = $this->getLocale(); - } else { - $this->assertValidLocale($locale); - } - - if (!isset($this->catalogues[$locale])) { - $this->loadCatalogue($locale); - } - - return $this->catalogues[$locale]; - } - - public function getCatalogues(): array - { - return array_values($this->catalogues); - } - - /** - * Gets the loaders. - * - * @return LoaderInterface[] - */ - protected function getLoaders(): array - { - return $this->loaders; - } - - protected function loadCatalogue(string $locale) - { - if (null === $this->cacheDir) { - $this->initializeCatalogue($locale); - } else { - $this->initializeCacheCatalogue($locale); - } - } - - protected function initializeCatalogue(string $locale) - { - $this->assertValidLocale($locale); - - try { - $this->doLoadCatalogue($locale); - } catch (NotFoundResourceException $e) { - if (!$this->computeFallbackLocales($locale)) { - throw $e; - } - } - $this->loadFallbackCatalogues($locale); - } - - private function initializeCacheCatalogue(string $locale): void - { - if (isset($this->catalogues[$locale])) { - /* Catalogue already initialized. */ - return; - } - - $this->assertValidLocale($locale); - $cache = $this->getConfigCacheFactory()->cache($this->getCatalogueCachePath($locale), - function (ConfigCacheInterface $cache) use ($locale) { - $this->dumpCatalogue($locale, $cache); - } - ); - - if (isset($this->catalogues[$locale])) { - /* Catalogue has been initialized as it was written out to cache. */ - return; - } - - /* Read catalogue from cache. */ - $this->catalogues[$locale] = include $cache->getPath(); - } - - private function dumpCatalogue(string $locale, ConfigCacheInterface $cache): void - { - $this->initializeCatalogue($locale); - $fallbackContent = $this->getFallbackContent($this->catalogues[$locale]); - - $content = sprintf(<<getAllMessages($this->catalogues[$locale]), true), - $fallbackContent - ); - - $cache->write($content, $this->catalogues[$locale]->getResources()); - } - - private function getFallbackContent(MessageCatalogue $catalogue): string - { - $fallbackContent = ''; - $current = ''; - $replacementPattern = '/[^a-z0-9_]/i'; - $fallbackCatalogue = $catalogue->getFallbackCatalogue(); - while ($fallbackCatalogue) { - $fallback = $fallbackCatalogue->getLocale(); - $fallbackSuffix = ucfirst(preg_replace($replacementPattern, '_', $fallback)); - $currentSuffix = ucfirst(preg_replace($replacementPattern, '_', $current)); - - $fallbackContent .= sprintf(<<<'EOF' -$catalogue%s = new MessageCatalogue('%s', %s); -$catalogue%s->addFallbackCatalogue($catalogue%s); - -EOF - , - $fallbackSuffix, - $fallback, - var_export($this->getAllMessages($fallbackCatalogue), true), - $currentSuffix, - $fallbackSuffix - ); - $current = $fallbackCatalogue->getLocale(); - $fallbackCatalogue = $fallbackCatalogue->getFallbackCatalogue(); - } - - return $fallbackContent; - } - - private function getCatalogueCachePath(string $locale): string - { - return $this->cacheDir.'/catalogue.'.$locale.'.'.strtr(substr(base64_encode(hash('sha256', serialize($this->cacheVary), true)), 0, 7), '/', '_').'.php'; - } - - /** - * @internal - */ - protected function doLoadCatalogue(string $locale): void - { - $this->catalogues[$locale] = new MessageCatalogue($locale); - - if (isset($this->resources[$locale])) { - foreach ($this->resources[$locale] as $resource) { - if (!isset($this->loaders[$resource[0]])) { - if (\is_string($resource[1])) { - throw new RuntimeException(sprintf('No loader is registered for the "%s" format when loading the "%s" resource.', $resource[0], $resource[1])); - } - - throw new RuntimeException(sprintf('No loader is registered for the "%s" format.', $resource[0])); - } - $this->catalogues[$locale]->addCatalogue($this->loaders[$resource[0]]->load($resource[1], $locale, $resource[2])); - } - } - } - - private function loadFallbackCatalogues(string $locale): void - { - $current = $this->catalogues[$locale]; - - foreach ($this->computeFallbackLocales($locale) as $fallback) { - if (!isset($this->catalogues[$fallback])) { - $this->initializeCatalogue($fallback); - } - - $fallbackCatalogue = new MessageCatalogue($fallback, $this->getAllMessages($this->catalogues[$fallback])); - foreach ($this->catalogues[$fallback]->getResources() as $resource) { - $fallbackCatalogue->addResource($resource); - } - $current->addFallbackCatalogue($fallbackCatalogue); - $current = $fallbackCatalogue; - } - } - - protected function computeFallbackLocales(string $locale) - { - $this->parentLocales ??= json_decode(file_get_contents(__DIR__.'/Resources/data/parents.json'), true); - - $originLocale = $locale; - $locales = []; - - while ($locale) { - $parent = $this->parentLocales[$locale] ?? null; - - if ($parent) { - $locale = 'root' !== $parent ? $parent : null; - } elseif (\function_exists('locale_parse')) { - $localeSubTags = locale_parse($locale); - $locale = null; - if (1 < \count($localeSubTags)) { - array_pop($localeSubTags); - $locale = locale_compose($localeSubTags) ?: null; - } - } elseif ($i = strrpos($locale, '_') ?: strrpos($locale, '-')) { - $locale = substr($locale, 0, $i); - } else { - $locale = null; - } - - if (null !== $locale) { - $locales[] = $locale; - } - } - - foreach ($this->fallbackLocales as $fallback) { - if ($fallback === $originLocale) { - continue; - } - - $locales[] = $fallback; - } - - return array_unique($locales); - } - - /** - * Asserts that the locale is valid, throws an Exception if not. - * - * @throws InvalidArgumentException If the locale contains invalid characters - */ - protected function assertValidLocale(string $locale) - { - if (!preg_match('/^[a-z0-9@_\\.\\-]*$/i', $locale)) { - throw new InvalidArgumentException(sprintf('Invalid "%s" locale.', $locale)); - } - } - - /** - * Provides the ConfigCache factory implementation, falling back to a - * default implementation if necessary. - */ - private function getConfigCacheFactory(): ConfigCacheFactoryInterface - { - $this->configCacheFactory ??= new ConfigCacheFactory($this->debug); - - return $this->configCacheFactory; - } - - private function getAllMessages(MessageCatalogueInterface $catalogue): array - { - $allMessages = []; - - foreach ($catalogue->all() as $domain => $messages) { - if ($intlMessages = $catalogue->all($domain.MessageCatalogue::INTL_DOMAIN_SUFFIX)) { - $allMessages[$domain.MessageCatalogue::INTL_DOMAIN_SUFFIX] = $intlMessages; - $messages = array_diff_key($messages, $intlMessages); - } - if ($messages) { - $allMessages[$domain] = $messages; - } - } - - return $allMessages; - } -} diff --git a/vendor/symfony/translation/TranslatorBag.php b/vendor/symfony/translation/TranslatorBag.php deleted file mode 100644 index fb8ede87..00000000 --- a/vendor/symfony/translation/TranslatorBag.php +++ /dev/null @@ -1,102 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation; - -use Symfony\Component\Translation\Catalogue\AbstractOperation; -use Symfony\Component\Translation\Catalogue\TargetOperation; - -final class TranslatorBag implements TranslatorBagInterface -{ - /** @var MessageCatalogue[] */ - private array $catalogues = []; - - public function addCatalogue(MessageCatalogue $catalogue): void - { - if (null !== $existingCatalogue = $this->getCatalogue($catalogue->getLocale())) { - $catalogue->addCatalogue($existingCatalogue); - } - - $this->catalogues[$catalogue->getLocale()] = $catalogue; - } - - public function addBag(TranslatorBagInterface $bag): void - { - foreach ($bag->getCatalogues() as $catalogue) { - $this->addCatalogue($catalogue); - } - } - - public function getCatalogue(string $locale = null): MessageCatalogueInterface - { - if (null === $locale || !isset($this->catalogues[$locale])) { - $this->catalogues[$locale] = new MessageCatalogue($locale); - } - - return $this->catalogues[$locale]; - } - - public function getCatalogues(): array - { - return array_values($this->catalogues); - } - - public function diff(TranslatorBagInterface $diffBag): self - { - $diff = new self(); - - foreach ($this->catalogues as $locale => $catalogue) { - if (null === $diffCatalogue = $diffBag->getCatalogue($locale)) { - $diff->addCatalogue($catalogue); - - continue; - } - - $operation = new TargetOperation($diffCatalogue, $catalogue); - $operation->moveMessagesToIntlDomainsIfPossible(AbstractOperation::NEW_BATCH); - $newCatalogue = new MessageCatalogue($locale); - - foreach ($operation->getDomains() as $domain) { - $newCatalogue->add($operation->getNewMessages($domain), $domain); - } - - $diff->addCatalogue($newCatalogue); - } - - return $diff; - } - - public function intersect(TranslatorBagInterface $intersectBag): self - { - $diff = new self(); - - foreach ($this->catalogues as $locale => $catalogue) { - if (null === $intersectCatalogue = $intersectBag->getCatalogue($locale)) { - continue; - } - - $operation = new TargetOperation($catalogue, $intersectCatalogue); - $operation->moveMessagesToIntlDomainsIfPossible(AbstractOperation::OBSOLETE_BATCH); - $obsoleteCatalogue = new MessageCatalogue($locale); - - foreach ($operation->getDomains() as $domain) { - $obsoleteCatalogue->add( - array_diff($operation->getMessages($domain), $operation->getNewMessages($domain)), - $domain - ); - } - - $diff->addCatalogue($obsoleteCatalogue); - } - - return $diff; - } -} diff --git a/vendor/symfony/translation/TranslatorBagInterface.php b/vendor/symfony/translation/TranslatorBagInterface.php deleted file mode 100644 index a787acf1..00000000 --- a/vendor/symfony/translation/TranslatorBagInterface.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\Translation; - -use Symfony\Component\Translation\Exception\InvalidArgumentException; - -/** - * @author Abdellatif Ait boudad - */ -interface TranslatorBagInterface -{ - /** - * Gets the catalogue by locale. - * - * @param string|null $locale The locale or null to use the default - * - * @throws InvalidArgumentException If the locale contains invalid characters - */ - public function getCatalogue(string $locale = null): MessageCatalogueInterface; - - /** - * Returns all catalogues of the instance. - * - * @return MessageCatalogueInterface[] - */ - public function getCatalogues(): array; -} diff --git a/vendor/symfony/translation/Util/ArrayConverter.php b/vendor/symfony/translation/Util/ArrayConverter.php deleted file mode 100644 index 60b8be6e..00000000 --- a/vendor/symfony/translation/Util/ArrayConverter.php +++ /dev/null @@ -1,97 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Util; - -/** - * ArrayConverter generates tree like structure from a message catalogue. - * e.g. this - * 'foo.bar1' => 'test1', - * 'foo.bar2' => 'test2' - * converts to follows: - * foo: - * bar1: test1 - * bar2: test2. - * - * @author Gennady Telegin - */ -class ArrayConverter -{ - /** - * Converts linear messages array to tree-like array. - * For example this array('foo.bar' => 'value') will be converted to ['foo' => ['bar' => 'value']]. - * - * @param array $messages Linear messages array - */ - public static function expandToTree(array $messages): array - { - $tree = []; - - foreach ($messages as $id => $value) { - $referenceToElement = &self::getElementByPath($tree, explode('.', $id)); - - $referenceToElement = $value; - - unset($referenceToElement); - } - - return $tree; - } - - private static function &getElementByPath(array &$tree, array $parts) - { - $elem = &$tree; - $parentOfElem = null; - - foreach ($parts as $i => $part) { - if (isset($elem[$part]) && \is_string($elem[$part])) { - /* Process next case: - * 'foo': 'test1', - * 'foo.bar': 'test2' - * - * $tree['foo'] was string before we found array {bar: test2}. - * Treat new element as string too, e.g. add $tree['foo.bar'] = 'test2'; - */ - $elem = &$elem[implode('.', \array_slice($parts, $i))]; - break; - } - $parentOfElem = &$elem; - $elem = &$elem[$part]; - } - - if ($elem && \is_array($elem) && $parentOfElem) { - /* Process next case: - * 'foo.bar': 'test1' - * 'foo': 'test2' - * - * $tree['foo'] was array = {bar: 'test1'} before we found string constant `foo`. - * Cancel treating $tree['foo'] as array and cancel back it expansion, - * e.g. make it $tree['foo.bar'] = 'test1' again. - */ - self::cancelExpand($parentOfElem, $part, $elem); - } - - return $elem; - } - - private static function cancelExpand(array &$tree, string $prefix, array $node) - { - $prefix .= '.'; - - foreach ($node as $id => $value) { - if (\is_string($value)) { - $tree[$prefix.$id] = $value; - } else { - self::cancelExpand($tree, $prefix.$id, $value); - } - } - } -} diff --git a/vendor/symfony/translation/Util/XliffUtils.php b/vendor/symfony/translation/Util/XliffUtils.php deleted file mode 100644 index 335c34be..00000000 --- a/vendor/symfony/translation/Util/XliffUtils.php +++ /dev/null @@ -1,191 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Util; - -use Symfony\Component\Translation\Exception\InvalidArgumentException; -use Symfony\Component\Translation\Exception\InvalidResourceException; - -/** - * Provides some utility methods for XLIFF translation files, such as validating - * their contents according to the XSD schema. - * - * @author Fabien Potencier - */ -class XliffUtils -{ - /** - * Gets xliff file version based on the root "version" attribute. - * - * Defaults to 1.2 for backwards compatibility. - * - * @throws InvalidArgumentException - */ - public static function getVersionNumber(\DOMDocument $dom): string - { - /** @var \DOMNode $xliff */ - foreach ($dom->getElementsByTagName('xliff') as $xliff) { - $version = $xliff->attributes->getNamedItem('version'); - if ($version) { - return $version->nodeValue; - } - - $namespace = $xliff->attributes->getNamedItem('xmlns'); - if ($namespace) { - if (0 !== substr_compare('urn:oasis:names:tc:xliff:document:', $namespace->nodeValue, 0, 34)) { - throw new InvalidArgumentException(sprintf('Not a valid XLIFF namespace "%s".', $namespace)); - } - - return substr($namespace, 34); - } - } - - // Falls back to v1.2 - return '1.2'; - } - - /** - * Validates and parses the given file into a DOMDocument. - * - * @throws InvalidResourceException - */ - public static function validateSchema(\DOMDocument $dom): array - { - $xliffVersion = static::getVersionNumber($dom); - $internalErrors = libxml_use_internal_errors(true); - if ($shouldEnable = self::shouldEnableEntityLoader()) { - $disableEntities = libxml_disable_entity_loader(false); - } - try { - $isValid = @$dom->schemaValidateSource(self::getSchema($xliffVersion)); - if (!$isValid) { - return self::getXmlErrors($internalErrors); - } - } finally { - if ($shouldEnable) { - libxml_disable_entity_loader($disableEntities); - } - } - - $dom->normalizeDocument(); - - libxml_clear_errors(); - libxml_use_internal_errors($internalErrors); - - return []; - } - - private static function shouldEnableEntityLoader(): bool - { - static $dom, $schema; - if (null === $dom) { - $dom = new \DOMDocument(); - $dom->loadXML(''); - - $tmpfile = tempnam(sys_get_temp_dir(), 'symfony'); - register_shutdown_function(static function () use ($tmpfile) { - @unlink($tmpfile); - }); - $schema = ' - - -'; - file_put_contents($tmpfile, ' - - - -'); - } - - return !@$dom->schemaValidateSource($schema); - } - - public static function getErrorsAsString(array $xmlErrors): string - { - $errorsAsString = ''; - - foreach ($xmlErrors as $error) { - $errorsAsString .= sprintf("[%s %s] %s (in %s - line %d, column %d)\n", - \LIBXML_ERR_WARNING === $error['level'] ? 'WARNING' : 'ERROR', - $error['code'], - $error['message'], - $error['file'], - $error['line'], - $error['column'] - ); - } - - return $errorsAsString; - } - - private static function getSchema(string $xliffVersion): string - { - if ('1.2' === $xliffVersion) { - $schemaSource = file_get_contents(__DIR__.'/../Resources/schemas/xliff-core-1.2-transitional.xsd'); - $xmlUri = 'http://www.w3.org/2001/xml.xsd'; - } elseif ('2.0' === $xliffVersion) { - $schemaSource = file_get_contents(__DIR__.'/../Resources/schemas/xliff-core-2.0.xsd'); - $xmlUri = 'informativeCopiesOf3rdPartySchemas/w3c/xml.xsd'; - } else { - throw new InvalidArgumentException(sprintf('No support implemented for loading XLIFF version "%s".', $xliffVersion)); - } - - return self::fixXmlLocation($schemaSource, $xmlUri); - } - - /** - * Internally changes the URI of a dependent xsd to be loaded locally. - */ - private static function fixXmlLocation(string $schemaSource, string $xmlUri): string - { - $newPath = str_replace('\\', '/', __DIR__).'/../Resources/schemas/xml.xsd'; - $parts = explode('/', $newPath); - $locationstart = 'file:///'; - if (0 === stripos($newPath, 'phar://')) { - $tmpfile = tempnam(sys_get_temp_dir(), 'symfony'); - if ($tmpfile) { - copy($newPath, $tmpfile); - $parts = explode('/', str_replace('\\', '/', $tmpfile)); - } else { - array_shift($parts); - $locationstart = 'phar:///'; - } - } - - $drive = '\\' === \DIRECTORY_SEPARATOR ? array_shift($parts).'/' : ''; - $newPath = $locationstart.$drive.implode('/', array_map('rawurlencode', $parts)); - - return str_replace($xmlUri, $newPath, $schemaSource); - } - - /** - * Returns the XML errors of the internal XML parser. - */ - private static function getXmlErrors(bool $internalErrors): array - { - $errors = []; - foreach (libxml_get_errors() as $error) { - $errors[] = [ - 'level' => \LIBXML_ERR_WARNING == $error->level ? 'WARNING' : 'ERROR', - 'code' => $error->code, - 'message' => trim($error->message), - 'file' => $error->file ?: 'n/a', - 'line' => $error->line, - 'column' => $error->column, - ]; - } - - libxml_clear_errors(); - libxml_use_internal_errors($internalErrors); - - return $errors; - } -} diff --git a/vendor/symfony/translation/Writer/TranslationWriter.php b/vendor/symfony/translation/Writer/TranslationWriter.php deleted file mode 100644 index 5dd3a5c4..00000000 --- a/vendor/symfony/translation/Writer/TranslationWriter.php +++ /dev/null @@ -1,71 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Writer; - -use Symfony\Component\Translation\Dumper\DumperInterface; -use Symfony\Component\Translation\Exception\InvalidArgumentException; -use Symfony\Component\Translation\Exception\RuntimeException; -use Symfony\Component\Translation\MessageCatalogue; - -/** - * TranslationWriter writes translation messages. - * - * @author Michel Salib - */ -class TranslationWriter implements TranslationWriterInterface -{ - /** - * @var array - */ - private array $dumpers = []; - - /** - * Adds a dumper to the writer. - */ - public function addDumper(string $format, DumperInterface $dumper) - { - $this->dumpers[$format] = $dumper; - } - - /** - * Obtains the list of supported formats. - */ - public function getFormats(): array - { - return array_keys($this->dumpers); - } - - /** - * Writes translation from the catalogue according to the selected format. - * - * @param string $format The format to use to dump the messages - * @param array $options Options that are passed to the dumper - * - * @throws InvalidArgumentException - */ - public function write(MessageCatalogue $catalogue, string $format, array $options = []) - { - if (!isset($this->dumpers[$format])) { - throw new InvalidArgumentException(sprintf('There is no dumper associated with format "%s".', $format)); - } - - // get the right dumper - $dumper = $this->dumpers[$format]; - - if (isset($options['path']) && !is_dir($options['path']) && !@mkdir($options['path'], 0777, true) && !is_dir($options['path'])) { - throw new RuntimeException(sprintf('Translation Writer was not able to create directory "%s".', $options['path'])); - } - - // save - $dumper->dump($catalogue, $options); - } -} diff --git a/vendor/symfony/translation/Writer/TranslationWriterInterface.php b/vendor/symfony/translation/Writer/TranslationWriterInterface.php deleted file mode 100644 index 43213097..00000000 --- a/vendor/symfony/translation/Writer/TranslationWriterInterface.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\Translation\Writer; - -use Symfony\Component\Translation\Exception\InvalidArgumentException; -use Symfony\Component\Translation\MessageCatalogue; - -/** - * TranslationWriter writes translation messages. - * - * @author Michel Salib - */ -interface TranslationWriterInterface -{ - /** - * Writes translation from the catalogue according to the selected format. - * - * @param string $format The format to use to dump the messages - * @param array $options Options that are passed to the dumper - * - * @throws InvalidArgumentException - */ - public function write(MessageCatalogue $catalogue, string $format, array $options = []); -} diff --git a/vendor/symfony/translation/composer.json b/vendor/symfony/translation/composer.json deleted file mode 100644 index d75df651..00000000 --- a/vendor/symfony/translation/composer.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "symfony/translation", - "type": "library", - "description": "Provides tools to internationalize your application", - "keywords": [], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.1", - "symfony/polyfill-mbstring": "~1.0", - "symfony/translation-contracts": "^2.3|^3.0" - }, - "require-dev": { - "nikic/php-parser": "^4.13", - "symfony/config": "^5.4|^6.0", - "symfony/console": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/http-client-contracts": "^1.1|^2.0|^3.0", - "symfony/http-kernel": "^5.4|^6.0", - "symfony/intl": "^5.4|^6.0", - "symfony/polyfill-intl-icu": "^1.21", - "symfony/routing": "^5.4|^6.0", - "symfony/service-contracts": "^1.1.2|^2|^3", - "symfony/yaml": "^5.4|^6.0", - "symfony/finder": "^5.4|^6.0", - "psr/log": "^1|^2|^3" - }, - "conflict": { - "symfony/config": "<5.4", - "symfony/dependency-injection": "<5.4", - "symfony/http-kernel": "<5.4", - "symfony/twig-bundle": "<5.4", - "symfony/yaml": "<5.4", - "symfony/console": "<5.4" - }, - "provide": { - "symfony/translation-implementation": "2.3|3.0" - }, - "suggest": { - "nikic/php-parser": "To use PhpAstExtractor", - "symfony/config": "", - "symfony/yaml": "", - "psr/log-implementation": "To use logging capability in translator" - }, - "autoload": { - "files": [ "Resources/functions.php" ], - "psr-4": { "Symfony\\Component\\Translation\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "minimum-stability": "dev" -} diff --git a/vendor/symfony/uid/AbstractUid.php b/vendor/symfony/uid/AbstractUid.php deleted file mode 100644 index 54d2b13b..00000000 --- a/vendor/symfony/uid/AbstractUid.php +++ /dev/null @@ -1,164 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Uid; - -/** - * @author Nicolas Grekas - */ -abstract class AbstractUid implements \JsonSerializable -{ - /** - * The identifier in its canonic representation. - */ - protected $uid; - - /** - * Whether the passed value is valid for the constructor of the current class. - */ - abstract public static function isValid(string $uid): bool; - - /** - * Creates an AbstractUid from an identifier represented in any of the supported formats. - * - * @throws \InvalidArgumentException When the passed value is not valid - */ - abstract public static function fromString(string $uid): static; - - /** - * @throws \InvalidArgumentException When the passed value is not valid - */ - public static function fromBinary(string $uid): static - { - if (16 !== \strlen($uid)) { - throw new \InvalidArgumentException('Invalid binary uid provided.'); - } - - return static::fromString($uid); - } - - /** - * @throws \InvalidArgumentException When the passed value is not valid - */ - public static function fromBase58(string $uid): static - { - if (22 !== \strlen($uid)) { - throw new \InvalidArgumentException('Invalid base-58 uid provided.'); - } - - return static::fromString($uid); - } - - /** - * @throws \InvalidArgumentException When the passed value is not valid - */ - public static function fromBase32(string $uid): static - { - if (26 !== \strlen($uid)) { - throw new \InvalidArgumentException('Invalid base-32 uid provided.'); - } - - return static::fromString($uid); - } - - /** - * @throws \InvalidArgumentException When the passed value is not valid - */ - public static function fromRfc4122(string $uid): static - { - if (36 !== \strlen($uid)) { - throw new \InvalidArgumentException('Invalid RFC4122 uid provided.'); - } - - return static::fromString($uid); - } - - /** - * Returns the identifier as a raw binary string. - */ - abstract public function toBinary(): string; - - /** - * Returns the identifier as a base58 case sensitive string. - */ - public function toBase58(): string - { - return strtr(sprintf('%022s', BinaryUtil::toBase($this->toBinary(), BinaryUtil::BASE58)), '0', '1'); - } - - /** - * Returns the identifier as a base32 case insensitive string. - */ - public function toBase32(): string - { - $uid = bin2hex($this->toBinary()); - $uid = sprintf('%02s%04s%04s%04s%04s%04s%04s', - base_convert(substr($uid, 0, 2), 16, 32), - base_convert(substr($uid, 2, 5), 16, 32), - base_convert(substr($uid, 7, 5), 16, 32), - base_convert(substr($uid, 12, 5), 16, 32), - base_convert(substr($uid, 17, 5), 16, 32), - base_convert(substr($uid, 22, 5), 16, 32), - base_convert(substr($uid, 27, 5), 16, 32) - ); - - return strtr($uid, 'abcdefghijklmnopqrstuv', 'ABCDEFGHJKMNPQRSTVWXYZ'); - } - - /** - * Returns the identifier as a RFC4122 case insensitive string. - */ - public function toRfc4122(): string - { - // don't use uuid_unparse(), it's slower - $uuid = bin2hex($this->toBinary()); - $uuid = substr_replace($uuid, '-', 8, 0); - $uuid = substr_replace($uuid, '-', 13, 0); - $uuid = substr_replace($uuid, '-', 18, 0); - - return substr_replace($uuid, '-', 23, 0); - } - - /** - * Returns the identifier as a prefixed hexadecimal case insensitive string. - */ - public function toHex(): string - { - return '0x'.bin2hex($this->toBinary()); - } - - /** - * Returns whether the argument is an AbstractUid and contains the same value as the current instance. - */ - public function equals(mixed $other): bool - { - if (!$other instanceof self) { - return false; - } - - return $this->uid === $other->uid; - } - - public function compare(self $other): int - { - return (\strlen($this->uid) - \strlen($other->uid)) ?: ($this->uid <=> $other->uid); - } - - public function __toString(): string - { - return $this->uid; - } - - public function jsonSerialize(): string - { - return $this->uid; - } -} diff --git a/vendor/symfony/uid/BinaryUtil.php b/vendor/symfony/uid/BinaryUtil.php deleted file mode 100644 index 8fd19d86..00000000 --- a/vendor/symfony/uid/BinaryUtil.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\Uid; - -/** - * @internal - * - * @author Nicolas Grekas - */ -class BinaryUtil -{ - public const BASE10 = [ - '' => '0123456789', - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, - ]; - - public const BASE58 = [ - '' => '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz', - 1 => 0, 1, 2, 3, 4, 5, 6, 7, 8, 'A' => 9, - 'B' => 10, 'C' => 11, 'D' => 12, 'E' => 13, 'F' => 14, 'G' => 15, - 'H' => 16, 'J' => 17, 'K' => 18, 'L' => 19, 'M' => 20, 'N' => 21, - 'P' => 22, 'Q' => 23, 'R' => 24, 'S' => 25, 'T' => 26, 'U' => 27, - 'V' => 28, 'W' => 29, 'X' => 30, 'Y' => 31, 'Z' => 32, 'a' => 33, - 'b' => 34, 'c' => 35, 'd' => 36, 'e' => 37, 'f' => 38, 'g' => 39, - 'h' => 40, 'i' => 41, 'j' => 42, 'k' => 43, 'm' => 44, 'n' => 45, - 'o' => 46, 'p' => 47, 'q' => 48, 'r' => 49, 's' => 50, 't' => 51, - 'u' => 52, 'v' => 53, 'w' => 54, 'x' => 55, 'y' => 56, 'z' => 57, - ]; - - // https://tools.ietf.org/html/rfc4122#section-4.1.4 - // 0x01b21dd213814000 is the number of 100-ns intervals between the - // UUID epoch 1582-10-15 00:00:00 and the Unix epoch 1970-01-01 00:00:00. - private const TIME_OFFSET_INT = 0x01B21DD213814000; - private const TIME_OFFSET_BIN = "\x01\xb2\x1d\xd2\x13\x81\x40\x00"; - private const TIME_OFFSET_COM1 = "\xfe\x4d\xe2\x2d\xec\x7e\xbf\xff"; - private const TIME_OFFSET_COM2 = "\xfe\x4d\xe2\x2d\xec\x7e\xc0\x00"; - - public static function toBase(string $bytes, array $map): string - { - $base = \strlen($alphabet = $map['']); - $bytes = array_values(unpack(\PHP_INT_SIZE >= 8 ? 'n*' : 'C*', $bytes)); - $digits = ''; - - while ($count = \count($bytes)) { - $quotient = []; - $remainder = 0; - - for ($i = 0; $i !== $count; ++$i) { - $carry = $bytes[$i] + ($remainder << (\PHP_INT_SIZE >= 8 ? 16 : 8)); - $digit = intdiv($carry, $base); - $remainder = $carry % $base; - - if ($digit || $quotient) { - $quotient[] = $digit; - } - } - - $digits = $alphabet[$remainder].$digits; - $bytes = $quotient; - } - - return $digits; - } - - public static function fromBase(string $digits, array $map): string - { - $base = \strlen($map['']); - $count = \strlen($digits); - $bytes = []; - - while ($count) { - $quotient = []; - $remainder = 0; - - for ($i = 0; $i !== $count; ++$i) { - $carry = ($bytes ? $digits[$i] : $map[$digits[$i]]) + $remainder * $base; - - if (\PHP_INT_SIZE >= 8) { - $digit = $carry >> 16; - $remainder = $carry & 0xFFFF; - } else { - $digit = $carry >> 8; - $remainder = $carry & 0xFF; - } - - if ($digit || $quotient) { - $quotient[] = $digit; - } - } - - $bytes[] = $remainder; - $count = \count($digits = $quotient); - } - - return pack(\PHP_INT_SIZE >= 8 ? 'n*' : 'C*', ...array_reverse($bytes)); - } - - public static function add(string $a, string $b): string - { - $carry = 0; - for ($i = 7; 0 <= $i; --$i) { - $carry += \ord($a[$i]) + \ord($b[$i]); - $a[$i] = \chr($carry & 0xFF); - $carry >>= 8; - } - - return $a; - } - - /** - * @param string $time Count of 100-nanosecond intervals since the UUID epoch 1582-10-15 00:00:00 in hexadecimal - */ - public static function hexToDateTime(string $time): \DateTimeImmutable - { - if (\PHP_INT_SIZE >= 8) { - $time = (string) (hexdec($time) - self::TIME_OFFSET_INT); - } else { - $time = str_pad(hex2bin($time), 8, "\0", \STR_PAD_LEFT); - - if (self::TIME_OFFSET_BIN <= $time) { - $time = self::add($time, self::TIME_OFFSET_COM2); - $time[0] = $time[0] & "\x7F"; - $time = self::toBase($time, self::BASE10); - } else { - $time = self::add($time, self::TIME_OFFSET_COM1); - $time = '-'.self::toBase($time ^ "\xff\xff\xff\xff\xff\xff\xff\xff", self::BASE10); - } - } - - if (9 > \strlen($time)) { - $time = '-' === $time[0] ? '-'.str_pad(substr($time, 1), 8, '0', \STR_PAD_LEFT) : str_pad($time, 8, '0', \STR_PAD_LEFT); - } - - return \DateTimeImmutable::createFromFormat('U.u?', substr_replace($time, '.', -7, 0)); - } - - /** - * @return string Count of 100-nanosecond intervals since the UUID epoch 1582-10-15 00:00:00 in hexadecimal - */ - public static function dateTimeToHex(\DateTimeInterface $time): string - { - if (\PHP_INT_SIZE >= 8) { - if (-self::TIME_OFFSET_INT > $time = (int) $time->format('Uu0')) { - throw new \InvalidArgumentException('The given UUID date cannot be earlier than 1582-10-15.'); - } - - return str_pad(dechex(self::TIME_OFFSET_INT + $time), 16, '0', \STR_PAD_LEFT); - } - - $time = $time->format('Uu0'); - $negative = '-' === $time[0]; - if ($negative && self::TIME_OFFSET_INT < $time = substr($time, 1)) { - throw new \InvalidArgumentException('The given UUID date cannot be earlier than 1582-10-15.'); - } - $time = self::fromBase($time, self::BASE10); - $time = str_pad($time, 8, "\0", \STR_PAD_LEFT); - - if ($negative) { - $time = self::add($time, self::TIME_OFFSET_COM1) ^ "\xff\xff\xff\xff\xff\xff\xff\xff"; - } else { - $time = self::add($time, self::TIME_OFFSET_BIN); - } - - return bin2hex($time); - } -} diff --git a/vendor/symfony/uid/CHANGELOG.md b/vendor/symfony/uid/CHANGELOG.md deleted file mode 100644 index b8213375..00000000 --- a/vendor/symfony/uid/CHANGELOG.md +++ /dev/null @@ -1,36 +0,0 @@ -CHANGELOG -========= - -6.2 ---- - - * Add `UuidV7` and `UuidV8` - * Add `TimeBasedUidInterface` to describe UIDs that embed a timestamp - * Add `MaxUuid` and `MaxUlid` - -5.4 ---- - - * Add `NilUlid` - -5.3 ---- - - * The component is not marked as `@experimental` anymore - * Add `AbstractUid::fromBinary()`, `AbstractUid::fromBase58()`, `AbstractUid::fromBase32()` and `AbstractUid::fromRfc4122()` - * [BC BREAK] Replace `UuidV1::getTime()`, `UuidV6::getTime()` and `Ulid::getTime()` by `UuidV1::getDateTime()`, `UuidV6::getDateTime()` and `Ulid::getDateTime()` - * Add `Uuid::NAMESPACE_*` constants from RFC4122 - * Add `UlidFactory`, `UuidFactory`, `RandomBasedUuidFactory`, `TimeBasedUuidFactory` and `NameBasedUuidFactory` - * Add commands to generate and inspect UUIDs and ULIDs - -5.2.0 ------ - - * made UUIDv6 always return truly random node fields to prevent leaking the MAC of the host - -5.1.0 ------ - - * added support for UUID - * added support for ULID - * added the component diff --git a/vendor/symfony/uid/Command/GenerateUlidCommand.php b/vendor/symfony/uid/Command/GenerateUlidCommand.php deleted file mode 100644 index 9930b639..00000000 --- a/vendor/symfony/uid/Command/GenerateUlidCommand.php +++ /dev/null @@ -1,116 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Uid\Command; - -use Symfony\Component\Console\Attribute\AsCommand; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Style\SymfonyStyle; -use Symfony\Component\Uid\Factory\UlidFactory; - -#[AsCommand(name: 'ulid:generate', description: 'Generate a ULID')] -class GenerateUlidCommand extends Command -{ - private const FORMAT_OPTIONS = [ - 'base32', - 'base58', - 'rfc4122', - ]; - - private UlidFactory $factory; - - public function __construct(UlidFactory $factory = null) - { - $this->factory = $factory ?? new UlidFactory(); - - parent::__construct(); - } - - protected function configure(): void - { - $this - ->setDefinition([ - new InputOption('time', null, InputOption::VALUE_REQUIRED, 'The ULID timestamp: a parsable date/time string'), - new InputOption('count', 'c', InputOption::VALUE_REQUIRED, 'The number of ULID to generate', 1), - new InputOption('format', 'f', InputOption::VALUE_REQUIRED, 'The ULID output format: base32, base58 or rfc4122', 'base32'), - ]) - ->setHelp(<<<'EOF' -The %command.name% command generates a ULID. - - php %command.full_name% - -To specify the timestamp: - - php %command.full_name% --time="2021-02-16 14:09:08" - -To generate several ULIDs: - - php %command.full_name% --count=10 - -To output a specific format: - - php %command.full_name% --format=rfc4122 -EOF - ) - ; - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $io = new SymfonyStyle($input, $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output); - - if (null !== $time = $input->getOption('time')) { - try { - $time = new \DateTimeImmutable($time); - } catch (\Exception $e) { - $io->error(sprintf('Invalid timestamp "%s": %s', $time, str_replace('DateTimeImmutable::__construct(): ', '', $e->getMessage()))); - - return 1; - } - } - - $formatOption = $input->getOption('format'); - - if (\in_array($formatOption, self::FORMAT_OPTIONS)) { - $format = 'to'.ucfirst($formatOption); - } else { - $io->error(sprintf('Invalid format "%s", did you mean "base32", "base58" or "rfc4122"?', $input->getOption('format'))); - - return 1; - } - - $count = (int) $input->getOption('count'); - try { - for ($i = 0; $i < $count; ++$i) { - $output->writeln($this->factory->create($time)->$format()); - } - } catch (\Exception $e) { - $io->error($e->getMessage()); - - return 1; - } - - return 0; - } - - public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void - { - if ($input->mustSuggestOptionValuesFor('format')) { - $suggestions->suggestValues(self::FORMAT_OPTIONS); - } - } -} diff --git a/vendor/symfony/uid/Command/GenerateUuidCommand.php b/vendor/symfony/uid/Command/GenerateUuidCommand.php deleted file mode 100644 index eed0e510..00000000 --- a/vendor/symfony/uid/Command/GenerateUuidCommand.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\Uid\Command; - -use Symfony\Component\Console\Attribute\AsCommand; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Style\SymfonyStyle; -use Symfony\Component\Uid\Factory\UuidFactory; -use Symfony\Component\Uid\Uuid; - -#[AsCommand(name: 'uuid:generate', description: 'Generate a UUID')] -class GenerateUuidCommand extends Command -{ - private UuidFactory $factory; - - public function __construct(UuidFactory $factory = null) - { - $this->factory = $factory ?? new UuidFactory(); - - parent::__construct(); - } - - protected function configure(): void - { - $this - ->setDefinition([ - new InputOption('time-based', null, InputOption::VALUE_REQUIRED, 'The timestamp, to generate a time-based UUID: a parsable date/time string'), - new InputOption('node', null, InputOption::VALUE_REQUIRED, 'The UUID whose node part should be used as the node of the generated UUID'), - new InputOption('name-based', null, InputOption::VALUE_REQUIRED, 'The name, to generate a name-based UUID'), - new InputOption('namespace', null, InputOption::VALUE_REQUIRED, 'The UUID to use at the namespace for named-based UUIDs, predefined namespaces keywords "dns", "url", "oid" and "x500" are accepted'), - new InputOption('random-based', null, InputOption::VALUE_NONE, 'To generate a random-based UUID'), - new InputOption('count', 'c', InputOption::VALUE_REQUIRED, 'The number of UUID to generate', 1), - new InputOption('format', 'f', InputOption::VALUE_REQUIRED, 'The UUID output format: rfc4122, base58 or base32', 'rfc4122'), - ]) - ->setHelp(<<<'EOF' -The %command.name% generates a UUID. - - php %command.full_name% - -To generate a time-based UUID: - - php %command.full_name% --time-based=now - -To specify a time-based UUID's node: - - php %command.full_name% --time-based=@1613480254 --node=fb3502dc-137e-4849-8886-ac90d07f64a7 - -To generate a name-based UUID: - - php %command.full_name% --name-based=foo - -To specify a name-based UUID's namespace: - - php %command.full_name% --name-based=bar --namespace=fb3502dc-137e-4849-8886-ac90d07f64a7 - -To generate a random-based UUID: - - php %command.full_name% --random-based - -To generate several UUIDs: - - php %command.full_name% --count=10 - -To output a specific format: - - php %command.full_name% --format=base58 -EOF - ) - ; - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $io = new SymfonyStyle($input, $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output); - - $time = $input->getOption('time-based'); - $node = $input->getOption('node'); - $name = $input->getOption('name-based'); - $namespace = $input->getOption('namespace'); - $random = $input->getOption('random-based'); - - if (false !== ($time ?? $name ?? $random) && 1 < ((null !== $time) + (null !== $name) + $random)) { - $io->error('Only one of "--time-based", "--name-based" or "--random-based" can be provided at a time.'); - - return 1; - } - - if (null === $time && null !== $node) { - $io->error('Option "--node" can only be used with "--time-based".'); - - return 1; - } - - if (null === $name && null !== $namespace) { - $io->error('Option "--namespace" can only be used with "--name-based".'); - - return 1; - } - - switch (true) { - case null !== $time: - if (null !== $node) { - try { - $node = Uuid::fromString($node); - } catch (\InvalidArgumentException $e) { - $io->error(sprintf('Invalid node "%s": %s', $node, $e->getMessage())); - - return 1; - } - } - - try { - new \DateTimeImmutable($time); - } catch (\Exception $e) { - $io->error(sprintf('Invalid timestamp "%s": %s', $time, str_replace('DateTimeImmutable::__construct(): ', '', $e->getMessage()))); - - return 1; - } - - $create = function () use ($node, $time): Uuid { - return $this->factory->timeBased($node)->create(new \DateTimeImmutable($time)); - }; - break; - - case null !== $name: - if ($namespace && !\in_array($namespace, ['dns', 'url', 'oid', 'x500'], true)) { - try { - $namespace = Uuid::fromString($namespace); - } catch (\InvalidArgumentException $e) { - $io->error(sprintf('Invalid namespace "%s": %s', $namespace, $e->getMessage())); - - return 1; - } - } - - $create = function () use ($namespace, $name): Uuid { - try { - $factory = $this->factory->nameBased($namespace); - } catch (\LogicException) { - throw new \InvalidArgumentException('Missing namespace: use the "--namespace" option or configure a default namespace in the underlying factory.'); - } - - return $factory->create($name); - }; - break; - - case $random: - $create = $this->factory->randomBased()->create(...); - break; - - default: - $create = $this->factory->create(...); - break; - } - - $formatOption = $input->getOption('format'); - - if (\in_array($formatOption, $this->getAvailableFormatOptions())) { - $format = 'to'.ucfirst($formatOption); - } else { - $io->error(sprintf('Invalid format "%s", did you mean "base32", "base58" or "rfc4122"?', $formatOption)); - - return 1; - } - - $count = (int) $input->getOption('count'); - try { - for ($i = 0; $i < $count; ++$i) { - $output->writeln($create()->$format()); - } - } catch (\Exception $e) { - $io->error($e->getMessage()); - - return 1; - } - - return 0; - } - - public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void - { - if ($input->mustSuggestOptionValuesFor('format')) { - $suggestions->suggestValues($this->getAvailableFormatOptions()); - } - } - - private function getAvailableFormatOptions(): array - { - return [ - 'base32', - 'base58', - 'rfc4122', - ]; - } -} diff --git a/vendor/symfony/uid/Command/InspectUlidCommand.php b/vendor/symfony/uid/Command/InspectUlidCommand.php deleted file mode 100644 index b3a1b024..00000000 --- a/vendor/symfony/uid/Command/InspectUlidCommand.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\Uid\Command; - -use Symfony\Component\Console\Attribute\AsCommand; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Helper\TableSeparator; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Style\SymfonyStyle; -use Symfony\Component\Uid\Ulid; - -#[AsCommand(name: 'ulid:inspect', description: 'Inspect a ULID')] -class InspectUlidCommand extends Command -{ - protected function configure(): void - { - $this - ->setDefinition([ - new InputArgument('ulid', InputArgument::REQUIRED, 'The ULID to inspect'), - ]) - ->setHelp(<<<'EOF' -The %command.name% displays information about a ULID. - - php %command.full_name% 01EWAKBCMWQ2C94EXNN60ZBS0Q - php %command.full_name% 1BVdfLn3ERmbjYBLCdaaLW - php %command.full_name% 01771535-b29c-b898-923b-b5a981f5e417 -EOF - ) - ; - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $io = new SymfonyStyle($input, $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output); - - try { - $ulid = Ulid::fromString($input->getArgument('ulid')); - } catch (\InvalidArgumentException $e) { - $io->error($e->getMessage()); - - return 1; - } - - $io->table(['Label', 'Value'], [ - ['toBase32 (canonical)', (string) $ulid], - ['toBase58', $ulid->toBase58()], - ['toRfc4122', $ulid->toRfc4122()], - ['toHex', $ulid->toHex()], - new TableSeparator(), - ['Time', $ulid->getDateTime()->format('Y-m-d H:i:s.v \U\T\C')], - ]); - - return 0; - } -} diff --git a/vendor/symfony/uid/Command/InspectUuidCommand.php b/vendor/symfony/uid/Command/InspectUuidCommand.php deleted file mode 100644 index cc830bc3..00000000 --- a/vendor/symfony/uid/Command/InspectUuidCommand.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Uid\Command; - -use Symfony\Component\Console\Attribute\AsCommand; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Helper\TableSeparator; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Style\SymfonyStyle; -use Symfony\Component\Uid\MaxUuid; -use Symfony\Component\Uid\NilUuid; -use Symfony\Component\Uid\TimeBasedUidInterface; -use Symfony\Component\Uid\Uuid; - -#[AsCommand(name: 'uuid:inspect', description: 'Inspect a UUID')] -class InspectUuidCommand extends Command -{ - protected function configure(): void - { - $this - ->setDefinition([ - new InputArgument('uuid', InputArgument::REQUIRED, 'The UUID to inspect'), - ]) - ->setHelp(<<<'EOF' -The %command.name% displays information about a UUID. - - php %command.full_name% a7613e0a-5986-11eb-a861-2bf05af69e52 - php %command.full_name% MfnmaUvvQ1h8B14vTwt6dX - php %command.full_name% 57C4Z0MPC627NTGR9BY1DFD7JJ -EOF - ) - ; - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $io = new SymfonyStyle($input, $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output); - - try { - /** @var Uuid $uuid */ - $uuid = Uuid::fromString($input->getArgument('uuid')); - } catch (\InvalidArgumentException $e) { - $io->error($e->getMessage()); - - return 1; - } - - if (new NilUuid() == $uuid) { - $version = 'nil'; - } elseif (new MaxUuid() == $uuid) { - $version = 'max'; - } else { - $version = uuid_type($uuid); - } - - $rows = [ - ['Version', $version], - ['toRfc4122 (canonical)', (string) $uuid], - ['toBase58', $uuid->toBase58()], - ['toBase32', $uuid->toBase32()], - ['toHex', $uuid->toHex()], - ]; - - if ($uuid instanceof TimeBasedUidInterface) { - $rows[] = new TableSeparator(); - $rows[] = ['Time', $uuid->getDateTime()->format('Y-m-d H:i:s.u \U\T\C')]; - } - - $io->table(['Label', 'Value'], $rows); - - return 0; - } -} diff --git a/vendor/symfony/uid/Factory/NameBasedUuidFactory.php b/vendor/symfony/uid/Factory/NameBasedUuidFactory.php deleted file mode 100644 index c8cf3666..00000000 --- a/vendor/symfony/uid/Factory/NameBasedUuidFactory.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Uid\Factory; - -use Symfony\Component\Uid\Uuid; -use Symfony\Component\Uid\UuidV3; -use Symfony\Component\Uid\UuidV5; - -class NameBasedUuidFactory -{ - private string $class; - private Uuid $namespace; - - public function __construct(string $class, Uuid $namespace) - { - $this->class = $class; - $this->namespace = $namespace; - } - - public function create(string $name): UuidV5|UuidV3 - { - switch ($class = $this->class) { - case UuidV5::class: return Uuid::v5($this->namespace, $name); - case UuidV3::class: return Uuid::v3($this->namespace, $name); - } - - if (is_subclass_of($class, UuidV5::class)) { - $uuid = Uuid::v5($this->namespace, $name); - } else { - $uuid = Uuid::v3($this->namespace, $name); - } - - return new $class($uuid); - } -} diff --git a/vendor/symfony/uid/Factory/RandomBasedUuidFactory.php b/vendor/symfony/uid/Factory/RandomBasedUuidFactory.php deleted file mode 100644 index 67b14760..00000000 --- a/vendor/symfony/uid/Factory/RandomBasedUuidFactory.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. - */ - -namespace Symfony\Component\Uid\Factory; - -use Symfony\Component\Uid\UuidV4; - -class RandomBasedUuidFactory -{ - private string $class; - - public function __construct(string $class) - { - $this->class = $class; - } - - public function create(): UuidV4 - { - $class = $this->class; - - return new $class(); - } -} diff --git a/vendor/symfony/uid/Factory/TimeBasedUuidFactory.php b/vendor/symfony/uid/Factory/TimeBasedUuidFactory.php deleted file mode 100644 index 157b4dca..00000000 --- a/vendor/symfony/uid/Factory/TimeBasedUuidFactory.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Uid\Factory; - -use Symfony\Component\Uid\TimeBasedUidInterface; -use Symfony\Component\Uid\Uuid; - -class TimeBasedUuidFactory -{ - private string $class; - private ?Uuid $node; - - public function __construct(string $class, Uuid $node = null) - { - $this->class = $class; - $this->node = $node; - } - - public function create(\DateTimeInterface $time = null): Uuid&TimeBasedUidInterface - { - $class = $this->class; - - if (null === $time && null === $this->node) { - return new $class(); - } - - return new $class($class::generate($time, $this->node)); - } -} diff --git a/vendor/symfony/uid/Factory/UlidFactory.php b/vendor/symfony/uid/Factory/UlidFactory.php deleted file mode 100644 index 40cb7837..00000000 --- a/vendor/symfony/uid/Factory/UlidFactory.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Uid\Factory; - -use Symfony\Component\Uid\Ulid; - -class UlidFactory -{ - public function create(\DateTimeInterface $time = null): Ulid - { - return new Ulid(null === $time ? null : Ulid::generate($time)); - } -} diff --git a/vendor/symfony/uid/Factory/UuidFactory.php b/vendor/symfony/uid/Factory/UuidFactory.php deleted file mode 100644 index 0255d51b..00000000 --- a/vendor/symfony/uid/Factory/UuidFactory.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\Uid\Factory; - -use Symfony\Component\Uid\Uuid; -use Symfony\Component\Uid\UuidV1; -use Symfony\Component\Uid\UuidV4; -use Symfony\Component\Uid\UuidV5; -use Symfony\Component\Uid\UuidV6; - -class UuidFactory -{ - private string $defaultClass; - private string $timeBasedClass; - private string $nameBasedClass; - private string $randomBasedClass; - private ?Uuid $timeBasedNode; - private ?Uuid $nameBasedNamespace; - - public function __construct(string|int $defaultClass = UuidV6::class, string|int $timeBasedClass = UuidV6::class, string|int $nameBasedClass = UuidV5::class, string|int $randomBasedClass = UuidV4::class, Uuid|string $timeBasedNode = null, Uuid|string $nameBasedNamespace = null) - { - if (null !== $timeBasedNode && !$timeBasedNode instanceof Uuid) { - $timeBasedNode = Uuid::fromString($timeBasedNode); - } - - if (null !== $nameBasedNamespace) { - $nameBasedNamespace = $this->getNamespace($nameBasedNamespace); - } - - $this->defaultClass = is_numeric($defaultClass) ? Uuid::class.'V'.$defaultClass : $defaultClass; - $this->timeBasedClass = is_numeric($timeBasedClass) ? Uuid::class.'V'.$timeBasedClass : $timeBasedClass; - $this->nameBasedClass = is_numeric($nameBasedClass) ? Uuid::class.'V'.$nameBasedClass : $nameBasedClass; - $this->randomBasedClass = is_numeric($randomBasedClass) ? Uuid::class.'V'.$randomBasedClass : $randomBasedClass; - $this->timeBasedNode = $timeBasedNode; - $this->nameBasedNamespace = $nameBasedNamespace; - } - - public function create(): Uuid - { - $class = $this->defaultClass; - - return new $class(); - } - - public function randomBased(): RandomBasedUuidFactory - { - return new RandomBasedUuidFactory($this->randomBasedClass); - } - - public function timeBased(Uuid|string $node = null): TimeBasedUuidFactory - { - $node ??= $this->timeBasedNode; - - if (null !== $node && !$node instanceof Uuid) { - $node = Uuid::fromString($node); - } - - return new TimeBasedUuidFactory($this->timeBasedClass, $node); - } - - public function nameBased(Uuid|string $namespace = null): NameBasedUuidFactory - { - $namespace ??= $this->nameBasedNamespace; - - if (null === $namespace) { - throw new \LogicException(sprintf('A namespace should be defined when using "%s()".', __METHOD__)); - } - - return new NameBasedUuidFactory($this->nameBasedClass, $this->getNamespace($namespace)); - } - - private function getNamespace(Uuid|string $namespace): Uuid - { - if ($namespace instanceof Uuid) { - return $namespace; - } - - return match ($namespace) { - 'dns' => new UuidV1(Uuid::NAMESPACE_DNS), - 'url' => new UuidV1(Uuid::NAMESPACE_URL), - 'oid' => new UuidV1(Uuid::NAMESPACE_OID), - 'x500' => new UuidV1(Uuid::NAMESPACE_X500), - default => Uuid::fromString($namespace), - }; - } -} diff --git a/vendor/symfony/uid/LICENSE b/vendor/symfony/uid/LICENSE deleted file mode 100644 index 406242ff..00000000 --- a/vendor/symfony/uid/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020-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/uid/MaxUlid.php b/vendor/symfony/uid/MaxUlid.php deleted file mode 100644 index 9cc34576..00000000 --- a/vendor/symfony/uid/MaxUlid.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. - */ - -namespace Symfony\Component\Uid; - -class MaxUlid extends Ulid -{ - public function __construct() - { - $this->uid = parent::MAX; - } -} diff --git a/vendor/symfony/uid/MaxUuid.php b/vendor/symfony/uid/MaxUuid.php deleted file mode 100644 index 48eb656e..00000000 --- a/vendor/symfony/uid/MaxUuid.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Uid; - -class MaxUuid extends Uuid -{ - protected const TYPE = -1; - - public function __construct() - { - $this->uid = parent::MAX; - } -} diff --git a/vendor/symfony/uid/NilUlid.php b/vendor/symfony/uid/NilUlid.php deleted file mode 100644 index 56f6f199..00000000 --- a/vendor/symfony/uid/NilUlid.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. - */ - -namespace Symfony\Component\Uid; - -class NilUlid extends Ulid -{ - public function __construct() - { - $this->uid = parent::NIL; - } -} diff --git a/vendor/symfony/uid/NilUuid.php b/vendor/symfony/uid/NilUuid.php deleted file mode 100644 index 9d9746bb..00000000 --- a/vendor/symfony/uid/NilUuid.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\Uid; - -/** - * @author Grégoire Pineau - */ -class NilUuid extends Uuid -{ - protected const TYPE = -1; - - public function __construct() - { - $this->uid = parent::NIL; - } -} diff --git a/vendor/symfony/uid/README.md b/vendor/symfony/uid/README.md deleted file mode 100644 index acea6c75..00000000 --- a/vendor/symfony/uid/README.md +++ /dev/null @@ -1,16 +0,0 @@ -Uid Component -============= - -The UID component provides an object-oriented API to generate and represent UIDs. - -It provides implementations that work on 32-bit and 64-bit CPUs -for ULIDs and for UUIDs version 1 and versions 3 to 8. - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/components/uid.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/uid/TimeBasedUidInterface.php b/vendor/symfony/uid/TimeBasedUidInterface.php deleted file mode 100644 index f296aefb..00000000 --- a/vendor/symfony/uid/TimeBasedUidInterface.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Uid; - -/** - * Interface to describe UIDs that contain a DateTimeImmutable as part of their behaviour. - * - * @author Barney Hanlon - */ -interface TimeBasedUidInterface -{ - public function getDateTime(): \DateTimeImmutable; -} diff --git a/vendor/symfony/uid/Ulid.php b/vendor/symfony/uid/Ulid.php deleted file mode 100644 index 81610a00..00000000 --- a/vendor/symfony/uid/Ulid.php +++ /dev/null @@ -1,201 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Uid; - -/** - * A ULID is lexicographically sortable and contains a 48-bit timestamp and 80-bit of crypto-random entropy. - * - * @see https://github.com/ulid/spec - * - * @author Nicolas Grekas - */ -class Ulid extends AbstractUid implements TimeBasedUidInterface -{ - protected const NIL = '00000000000000000000000000'; - protected const MAX = '7ZZZZZZZZZZZZZZZZZZZZZZZZZ'; - - private static string $time = ''; - private static array $rand = []; - - public function __construct(string $ulid = null) - { - if (null === $ulid) { - $this->uid = static::generate(); - } elseif (self::NIL === $ulid) { - $this->uid = $ulid; - } elseif (self::MAX === strtr($ulid, 'z', 'Z')) { - $this->uid = $ulid; - } else { - if (!self::isValid($ulid)) { - throw new \InvalidArgumentException(sprintf('Invalid ULID: "%s".', $ulid)); - } - - $this->uid = strtoupper($ulid); - } - } - - public static function isValid(string $ulid): bool - { - if (26 !== \strlen($ulid)) { - return false; - } - - if (26 !== strspn($ulid, '0123456789ABCDEFGHJKMNPQRSTVWXYZabcdefghjkmnpqrstvwxyz')) { - return false; - } - - return $ulid[0] <= '7'; - } - - public static function fromString(string $ulid): static - { - if (36 === \strlen($ulid) && preg_match('{^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$}Di', $ulid)) { - $ulid = uuid_parse($ulid); - } elseif (22 === \strlen($ulid) && 22 === strspn($ulid, BinaryUtil::BASE58[''])) { - $ulid = str_pad(BinaryUtil::fromBase($ulid, BinaryUtil::BASE58), 16, "\0", \STR_PAD_LEFT); - } - - if (16 !== \strlen($ulid)) { - return match (strtr($ulid, 'z', 'Z')) { - self::NIL => new NilUlid(), - self::MAX => new MaxUlid(), - default => new static($ulid), - }; - } - - $ulid = bin2hex($ulid); - $ulid = sprintf('%02s%04s%04s%04s%04s%04s%04s', - base_convert(substr($ulid, 0, 2), 16, 32), - base_convert(substr($ulid, 2, 5), 16, 32), - base_convert(substr($ulid, 7, 5), 16, 32), - base_convert(substr($ulid, 12, 5), 16, 32), - base_convert(substr($ulid, 17, 5), 16, 32), - base_convert(substr($ulid, 22, 5), 16, 32), - base_convert(substr($ulid, 27, 5), 16, 32) - ); - - if (self::NIL === $ulid) { - return new NilUlid(); - } - - if (self::MAX === $ulid = strtr($ulid, 'abcdefghijklmnopqrstuv', 'ABCDEFGHJKMNPQRSTVWXYZ')) { - return new MaxUlid(); - } - - $u = new static(self::NIL); - $u->uid = $ulid; - - return $u; - } - - public function toBinary(): string - { - $ulid = strtr($this->uid, 'ABCDEFGHJKMNPQRSTVWXYZ', 'abcdefghijklmnopqrstuv'); - - $ulid = sprintf('%02s%05s%05s%05s%05s%05s%05s', - base_convert(substr($ulid, 0, 2), 32, 16), - base_convert(substr($ulid, 2, 4), 32, 16), - base_convert(substr($ulid, 6, 4), 32, 16), - base_convert(substr($ulid, 10, 4), 32, 16), - base_convert(substr($ulid, 14, 4), 32, 16), - base_convert(substr($ulid, 18, 4), 32, 16), - base_convert(substr($ulid, 22, 4), 32, 16) - ); - - return hex2bin($ulid); - } - - public function toBase32(): string - { - return $this->uid; - } - - public function getDateTime(): \DateTimeImmutable - { - $time = strtr(substr($this->uid, 0, 10), 'ABCDEFGHJKMNPQRSTVWXYZ', 'abcdefghijklmnopqrstuv'); - - if (\PHP_INT_SIZE >= 8) { - $time = (string) hexdec(base_convert($time, 32, 16)); - } else { - $time = sprintf('%02s%05s%05s', - base_convert(substr($time, 0, 2), 32, 16), - base_convert(substr($time, 2, 4), 32, 16), - base_convert(substr($time, 6, 4), 32, 16) - ); - $time = BinaryUtil::toBase(hex2bin($time), BinaryUtil::BASE10); - } - - if (4 > \strlen($time)) { - $time = '000'.$time; - } - - return \DateTimeImmutable::createFromFormat('U.u', substr_replace($time, '.', -3, 0)); - } - - public static function generate(\DateTimeInterface $time = null): string - { - if (null === $mtime = $time) { - $time = microtime(false); - $time = substr($time, 11).substr($time, 2, 3); - } elseif (0 > $time = $time->format('Uv')) { - throw new \InvalidArgumentException('The timestamp must be positive.'); - } - - if ($time > self::$time || (null !== $mtime && $time !== self::$time)) { - randomize: - $r = unpack('n*', random_bytes(10)); - $r[1] |= ($r[5] <<= 4) & 0xF0000; - $r[2] |= ($r[5] <<= 4) & 0xF0000; - $r[3] |= ($r[5] <<= 4) & 0xF0000; - $r[4] |= ($r[5] <<= 4) & 0xF0000; - unset($r[5]); - self::$rand = $r; - self::$time = $time; - } elseif ([1 => 0xFFFFF, 0xFFFFF, 0xFFFFF, 0xFFFFF] === self::$rand) { - if (\PHP_INT_SIZE >= 8 || 10 > \strlen($time = self::$time)) { - $time = (string) (1 + $time); - } elseif ('999999999' === $mtime = substr($time, -9)) { - $time = (1 + substr($time, 0, -9)).'000000000'; - } else { - $time = substr_replace($time, str_pad(++$mtime, 9, '0', \STR_PAD_LEFT), -9); - } - - goto randomize; - } else { - for ($i = 4; $i > 0 && 0xFFFFF === self::$rand[$i]; --$i) { - self::$rand[$i] = 0; - } - - ++self::$rand[$i]; - $time = self::$time; - } - - if (\PHP_INT_SIZE >= 8) { - $time = base_convert($time, 10, 32); - } else { - $time = str_pad(bin2hex(BinaryUtil::fromBase($time, BinaryUtil::BASE10)), 12, '0', \STR_PAD_LEFT); - $time = sprintf('%s%04s%04s', - base_convert(substr($time, 0, 2), 16, 32), - base_convert(substr($time, 2, 5), 16, 32), - base_convert(substr($time, 7, 5), 16, 32) - ); - } - - return strtr(sprintf('%010s%04s%04s%04s%04s', - $time, - base_convert(self::$rand[1], 10, 32), - base_convert(self::$rand[2], 10, 32), - base_convert(self::$rand[3], 10, 32), - base_convert(self::$rand[4], 10, 32) - ), 'abcdefghijklmnopqrstuv', 'ABCDEFGHJKMNPQRSTVWXYZ'); - } -} diff --git a/vendor/symfony/uid/Uuid.php b/vendor/symfony/uid/Uuid.php deleted file mode 100644 index da0bfcb3..00000000 --- a/vendor/symfony/uid/Uuid.php +++ /dev/null @@ -1,170 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Uid; - -/** - * @author Grégoire Pineau - * - * @see https://tools.ietf.org/html/rfc4122#appendix-C for details about namespaces - */ -class Uuid extends AbstractUid -{ - public const NAMESPACE_DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; - public const NAMESPACE_URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; - public const NAMESPACE_OID = '6ba7b812-9dad-11d1-80b4-00c04fd430c8'; - public const NAMESPACE_X500 = '6ba7b814-9dad-11d1-80b4-00c04fd430c8'; - - protected const TYPE = 0; - protected const NIL = '00000000-0000-0000-0000-000000000000'; - protected const MAX = 'ffffffff-ffff-ffff-ffff-ffffffffffff'; - - public function __construct(string $uuid, bool $checkVariant = false) - { - $type = preg_match('{^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$}Di', $uuid) ? (int) $uuid[14] : false; - - if (false === $type || (static::TYPE ?: $type) !== $type) { - throw new \InvalidArgumentException(sprintf('Invalid UUID%s: "%s".', static::TYPE ? 'v'.static::TYPE : '', $uuid)); - } - - $this->uid = strtolower($uuid); - - if ($checkVariant && !\in_array($this->uid[19], ['8', '9', 'a', 'b'], true)) { - throw new \InvalidArgumentException(sprintf('Invalid UUID%s: "%s".', static::TYPE ? 'v'.static::TYPE : '', $uuid)); - } - } - - public static function fromString(string $uuid): static - { - if (22 === \strlen($uuid) && 22 === strspn($uuid, BinaryUtil::BASE58[''])) { - $uuid = str_pad(BinaryUtil::fromBase($uuid, BinaryUtil::BASE58), 16, "\0", \STR_PAD_LEFT); - } - - if (16 === \strlen($uuid)) { - // don't use uuid_unparse(), it's slower - $uuid = bin2hex($uuid); - $uuid = substr_replace($uuid, '-', 8, 0); - $uuid = substr_replace($uuid, '-', 13, 0); - $uuid = substr_replace($uuid, '-', 18, 0); - $uuid = substr_replace($uuid, '-', 23, 0); - } elseif (26 === \strlen($uuid) && Ulid::isValid($uuid)) { - $ulid = new Ulid('00000000000000000000000000'); - $ulid->uid = strtoupper($uuid); - $uuid = $ulid->toRfc4122(); - } - - if (__CLASS__ !== static::class || 36 !== \strlen($uuid)) { - return new static($uuid); - } - - if (self::NIL === $uuid) { - return new NilUuid(); - } - - if (self::MAX === $uuid = strtr($uuid, 'F', 'f')) { - return new MaxUuid(); - } - - if (!\in_array($uuid[19], ['8', '9', 'a', 'b', 'A', 'B'], true)) { - return new self($uuid); - } - - return match ((int) $uuid[14]) { - UuidV1::TYPE => new UuidV1($uuid), - UuidV3::TYPE => new UuidV3($uuid), - UuidV4::TYPE => new UuidV4($uuid), - UuidV5::TYPE => new UuidV5($uuid), - UuidV6::TYPE => new UuidV6($uuid), - UuidV7::TYPE => new UuidV7($uuid), - UuidV8::TYPE => new UuidV8($uuid), - default => new self($uuid), - }; - } - - final public static function v1(): UuidV1 - { - return new UuidV1(); - } - - final public static function v3(self $namespace, string $name): UuidV3 - { - // don't use uuid_generate_md5(), some versions are buggy - $uuid = md5(hex2bin(str_replace('-', '', $namespace->uid)).$name, true); - - return new UuidV3(self::format($uuid, '-3')); - } - - final public static function v4(): UuidV4 - { - return new UuidV4(); - } - - final public static function v5(self $namespace, string $name): UuidV5 - { - // don't use uuid_generate_sha1(), some versions are buggy - $uuid = substr(sha1(hex2bin(str_replace('-', '', $namespace->uid)).$name, true), 0, 16); - - return new UuidV5(self::format($uuid, '-5')); - } - - final public static function v6(): UuidV6 - { - return new UuidV6(); - } - - final public static function v7(): UuidV7 - { - return new UuidV7(); - } - - final public static function v8(string $uuid): UuidV8 - { - return new UuidV8($uuid); - } - - public static function isValid(string $uuid): bool - { - if (!preg_match('{^[0-9a-f]{8}(?:-[0-9a-f]{4}){2}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$}Di', $uuid)) { - return false; - } - - return __CLASS__ === static::class || static::TYPE === (int) $uuid[14]; - } - - public function toBinary(): string - { - return uuid_parse($this->uid); - } - - public function toRfc4122(): string - { - return $this->uid; - } - - public function compare(AbstractUid $other): int - { - if (false !== $cmp = uuid_compare($this->uid, $other->uid)) { - return $cmp; - } - - return parent::compare($other); - } - - private static function format(string $uuid, string $version): string - { - $uuid[8] = $uuid[8] & "\x3F" | "\x80"; - $uuid = substr_replace(bin2hex($uuid), '-', 8, 0); - $uuid = substr_replace($uuid, $version, 13, 1); - $uuid = substr_replace($uuid, '-', 18, 0); - - return substr_replace($uuid, '-', 23, 0); - } -} diff --git a/vendor/symfony/uid/UuidV1.php b/vendor/symfony/uid/UuidV1.php deleted file mode 100644 index 8c037921..00000000 --- a/vendor/symfony/uid/UuidV1.php +++ /dev/null @@ -1,73 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Uid; - -/** - * A v1 UUID contains a 60-bit timestamp and 62 extra unique bits. - * - * @author Grégoire Pineau - */ -class UuidV1 extends Uuid implements TimeBasedUidInterface -{ - protected const TYPE = 1; - - private static string $clockSeq; - - public function __construct(string $uuid = null) - { - if (null === $uuid) { - $this->uid = uuid_create(static::TYPE); - } else { - parent::__construct($uuid, true); - } - } - - public function getDateTime(): \DateTimeImmutable - { - return BinaryUtil::hexToDateTime('0'.substr($this->uid, 15, 3).substr($this->uid, 9, 4).substr($this->uid, 0, 8)); - } - - public function getNode(): string - { - return uuid_mac($this->uid); - } - - public static function generate(\DateTimeInterface $time = null, Uuid $node = null): string - { - $uuid = !$time || !$node ? uuid_create(static::TYPE) : parent::NIL; - - if ($time) { - if ($node) { - // use clock_seq from the node - $seq = substr($node->uid, 19, 4); - } elseif (!$seq = self::$clockSeq ?? '') { - // generate a static random clock_seq to prevent any collisions with the real one - $seq = substr($uuid, 19, 4); - - do { - self::$clockSeq = sprintf('%04x', random_int(0, 0x3FFF) | 0x8000); - } while ($seq === self::$clockSeq); - - $seq = self::$clockSeq; - } - - $time = BinaryUtil::dateTimeToHex($time); - $uuid = substr($time, 8).'-'.substr($time, 4, 4).'-1'.substr($time, 1, 3).'-'.$seq.substr($uuid, 23); - } - - if ($node) { - $uuid = substr($uuid, 0, 24).substr($node->uid, 24); - } - - return $uuid; - } -} diff --git a/vendor/symfony/uid/UuidV3.php b/vendor/symfony/uid/UuidV3.php deleted file mode 100644 index cc9f016b..00000000 --- a/vendor/symfony/uid/UuidV3.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Uid; - -/** - * A v3 UUID contains an MD5 hash of another UUID and a name. - * - * Use Uuid::v3() to compute one. - * - * @author Grégoire Pineau - */ -class UuidV3 extends Uuid -{ - protected const TYPE = 3; - - public function __construct(string $uuid) - { - parent::__construct($uuid, true); - } -} diff --git a/vendor/symfony/uid/UuidV4.php b/vendor/symfony/uid/UuidV4.php deleted file mode 100644 index 9724b67d..00000000 --- a/vendor/symfony/uid/UuidV4.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\Uid; - -/** - * A v4 UUID contains a 122-bit random number. - * - * @author Grégoire Pineau - */ -class UuidV4 extends Uuid -{ - protected const TYPE = 4; - - public function __construct(string $uuid = null) - { - if (null === $uuid) { - $uuid = random_bytes(16); - $uuid[6] = $uuid[6] & "\x0F" | "\x40"; - $uuid[8] = $uuid[8] & "\x3F" | "\x80"; - $uuid = bin2hex($uuid); - - $this->uid = substr($uuid, 0, 8).'-'.substr($uuid, 8, 4).'-'.substr($uuid, 12, 4).'-'.substr($uuid, 16, 4).'-'.substr($uuid, 20, 12); - } else { - parent::__construct($uuid, true); - } - } -} diff --git a/vendor/symfony/uid/UuidV5.php b/vendor/symfony/uid/UuidV5.php deleted file mode 100644 index 74ab133a..00000000 --- a/vendor/symfony/uid/UuidV5.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Uid; - -/** - * A v5 UUID contains a SHA1 hash of another UUID and a name. - * - * Use Uuid::v5() to compute one. - * - * @author Grégoire Pineau - */ -class UuidV5 extends Uuid -{ - protected const TYPE = 5; - - public function __construct(string $uuid) - { - parent::__construct($uuid, true); - } -} diff --git a/vendor/symfony/uid/UuidV6.php b/vendor/symfony/uid/UuidV6.php deleted file mode 100644 index 1cecf408..00000000 --- a/vendor/symfony/uid/UuidV6.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\Uid; - -/** - * A v6 UUID is lexicographically sortable and contains a 60-bit timestamp and 62 extra unique bits. - * - * Unlike UUIDv1, this implementation of UUIDv6 doesn't leak the MAC address of the host. - * - * @author Nicolas Grekas - */ -class UuidV6 extends Uuid implements TimeBasedUidInterface -{ - protected const TYPE = 6; - - private static string $node; - - public function __construct(string $uuid = null) - { - if (null === $uuid) { - $this->uid = static::generate(); - } else { - parent::__construct($uuid, true); - } - } - - public function getDateTime(): \DateTimeImmutable - { - return BinaryUtil::hexToDateTime('0'.substr($this->uid, 0, 8).substr($this->uid, 9, 4).substr($this->uid, 15, 3)); - } - - public function getNode(): string - { - return substr($this->uid, 24); - } - - public static function generate(\DateTimeInterface $time = null, Uuid $node = null): string - { - $uuidV1 = UuidV1::generate($time, $node); - $uuid = substr($uuidV1, 15, 3).substr($uuidV1, 9, 4).$uuidV1[0].'-'.substr($uuidV1, 1, 4).'-6'.substr($uuidV1, 5, 3).substr($uuidV1, 18, 6); - - if ($node) { - return $uuid.substr($uuidV1, 24); - } - - // uuid_create() returns a stable "node" that can leak the MAC of the host, but - // UUIDv6 prefers a truly random number here, let's XOR both to preserve the entropy - - if (!isset(self::$node)) { - $seed = [random_int(0, 0xFFFFFF), random_int(0, 0xFFFFFF)]; - $node = unpack('N2', hex2bin('00'.substr($uuidV1, 24, 6)).hex2bin('00'.substr($uuidV1, 30))); - self::$node = sprintf('%06x%06x', ($seed[0] ^ $node[1]) | 0x010000, $seed[1] ^ $node[2]); - } - - return $uuid.self::$node; - } -} diff --git a/vendor/symfony/uid/UuidV7.php b/vendor/symfony/uid/UuidV7.php deleted file mode 100644 index 5e9c0801..00000000 --- a/vendor/symfony/uid/UuidV7.php +++ /dev/null @@ -1,114 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Uid; - -/** - * A v7 UUID is lexicographically sortable and contains a 48-bit timestamp and 74 extra unique bits. - * - * Within the same millisecond, monotonicity is ensured by incrementing the random part by a random increment. - * - * @author Nicolas Grekas - */ -class UuidV7 extends Uuid implements TimeBasedUidInterface -{ - protected const TYPE = 7; - - private static string $time = ''; - private static array $rand = []; - private static string $seed; - private static array $seedParts; - private static int $seedIndex = 0; - - public function __construct(string $uuid = null) - { - if (null === $uuid) { - $this->uid = static::generate(); - } else { - parent::__construct($uuid, true); - } - } - - public function getDateTime(): \DateTimeImmutable - { - $time = substr($this->uid, 0, 8).substr($this->uid, 9, 4); - $time = \PHP_INT_SIZE >= 8 ? (string) hexdec($time) : BinaryUtil::toBase(hex2bin($time), BinaryUtil::BASE10); - - if (4 > \strlen($time)) { - $time = '000'.$time; - } - - return \DateTimeImmutable::createFromFormat('U.v', substr_replace($time, '.', -3, 0)); - } - - public static function generate(\DateTimeInterface $time = null): string - { - if (null === $mtime = $time) { - $time = microtime(false); - $time = substr($time, 11).substr($time, 2, 3); - } elseif (0 > $time = $time->format('Uv')) { - throw new \InvalidArgumentException('The timestamp must be positive.'); - } - - if ($time > self::$time || (null !== $mtime && $time !== self::$time)) { - randomize: - self::$rand = unpack('n*', isset(self::$seed) ? random_bytes(10) : self::$seed = random_bytes(16)); - self::$rand[1] &= 0x03FF; - self::$time = $time; - } else { - if (!self::$seedIndex) { - $s = unpack('l*', self::$seed = hash('sha512', self::$seed, true)); - $s[] = ($s[1] >> 8 & 0xFF0000) | ($s[2] >> 16 & 0xFF00) | ($s[3] >> 24 & 0xFF); - $s[] = ($s[4] >> 8 & 0xFF0000) | ($s[5] >> 16 & 0xFF00) | ($s[6] >> 24 & 0xFF); - $s[] = ($s[7] >> 8 & 0xFF0000) | ($s[8] >> 16 & 0xFF00) | ($s[9] >> 24 & 0xFF); - $s[] = ($s[10] >> 8 & 0xFF0000) | ($s[11] >> 16 & 0xFF00) | ($s[12] >> 24 & 0xFF); - $s[] = ($s[13] >> 8 & 0xFF0000) | ($s[14] >> 16 & 0xFF00) | ($s[15] >> 24 & 0xFF); - self::$seedParts = $s; - self::$seedIndex = 21; - } - - self::$rand[5] = 0xFFFF & $carry = self::$rand[5] + (self::$seedParts[self::$seedIndex--] & 0xFFFFFF); - self::$rand[4] = 0xFFFF & $carry = self::$rand[4] + ($carry >> 16); - self::$rand[3] = 0xFFFF & $carry = self::$rand[3] + ($carry >> 16); - self::$rand[2] = 0xFFFF & $carry = self::$rand[2] + ($carry >> 16); - self::$rand[1] += $carry >> 16; - - if (0xFC00 & self::$rand[1]) { - if (\PHP_INT_SIZE >= 8 || 10 > \strlen($time = self::$time)) { - $time = (string) (1 + $time); - } elseif ('999999999' === $mtime = substr($time, -9)) { - $time = (1 + substr($time, 0, -9)).'000000000'; - } else { - $time = substr_replace($time, str_pad(++$mtime, 9, '0', \STR_PAD_LEFT), -9); - } - - goto randomize; - } - - $time = self::$time; - } - - if (\PHP_INT_SIZE >= 8) { - $time = dechex($time); - } else { - $time = bin2hex(BinaryUtil::fromBase($time, BinaryUtil::BASE10)); - } - - return substr_replace(sprintf('%012s-%04x-%04x-%04x%04x%04x', - $time, - 0x7000 | (self::$rand[1] << 2) | (self::$rand[2] >> 14), - 0x8000 | (self::$rand[2] & 0x3FFF), - self::$rand[3], - self::$rand[4], - self::$rand[5], - ), '-', 8, 0); - } -} diff --git a/vendor/symfony/uid/UuidV8.php b/vendor/symfony/uid/UuidV8.php deleted file mode 100644 index c194a6f6..00000000 --- a/vendor/symfony/uid/UuidV8.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\Uid; - -/** - * A v8 UUID has no explicit requirements except embedding its version + variant bits. - * - * @author Nicolas Grekas - */ -class UuidV8 extends Uuid -{ - protected const TYPE = 8; - - public function __construct(string $uuid) - { - parent::__construct($uuid, true); - } -} diff --git a/vendor/symfony/uid/composer.json b/vendor/symfony/uid/composer.json deleted file mode 100644 index d3168006..00000000 --- a/vendor/symfony/uid/composer.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "symfony/uid", - "type": "library", - "description": "Provides an object-oriented API to generate and represent UIDs", - "keywords": ["uid", "uuid", "ulid"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Grégoire Pineau", - "email": "lyrixx@lyrixx.info" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.1", - "symfony/polyfill-uuid": "^1.15" - }, - "require-dev": { - "symfony/console": "^5.4|^6.0" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\Uid\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "minimum-stability": "dev" -} diff --git a/vendor/symfony/var-dumper/CHANGELOG.md b/vendor/symfony/var-dumper/CHANGELOG.md deleted file mode 100644 index ffa4daf2..00000000 --- a/vendor/symfony/var-dumper/CHANGELOG.md +++ /dev/null @@ -1,78 +0,0 @@ -CHANGELOG -========= - -6.2 ---- - - * Add support for `FFI\CData` and `FFI\CType` - * Deprecate calling `VarDumper::setHandler()` without arguments - -5.4 ---- - - * Add ability to style integer and double values independently - * Add casters for Symfony's UUIDs and ULIDs - * Add support for `Fiber` - -5.2.0 ------ - - * added support for PHPUnit `--colors` option - * added `VAR_DUMPER_FORMAT=server` env var value support - * prevent replacing the handler when the `VAR_DUMPER_FORMAT` env var is set - -5.1.0 ------ - - * added `RdKafka` support - -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 dc3b6219..00000000 --- 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 - */ -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, bool $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, bool $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, bool $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, bool $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, bool $isNested, int $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 9dc24c1b..00000000 --- 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 array $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) { - 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 cd9b35f7..00000000 --- a/vendor/symfony/var-dumper/Caster/Caster.php +++ /dev/null @@ -1,170 +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 bool $hasDebugInfo Whether the __debugInfo method exists on $obj or not - */ - public static function castObject(object $obj, string $class, bool $hasDebugInfo = false, string $debugClass = null): array - { - if ($hasDebugInfo) { - try { - $debugInfo = $obj->__debugInfo(); - } catch (\Throwable) { - // ignore failing __debugInfo() - $hasDebugInfo = false; - } - } - - $a = $obj instanceof \Closure ? [] : (array) $obj; - - if ($obj instanceof \__PHP_Incomplete_Class) { - return $a; - } - - if ($a) { - static $publicProperties = []; - $debugClass ??= get_debug_type($obj); - - $i = 0; - $prefixedKeys = []; - foreach ($a as $k => $v) { - if ("\0" !== ($k[0] ?? '')) { - 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 - */ - 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 fb8377a0..00000000 --- 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|array|string $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) { - $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) { - 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(mixed $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 d7d1812b..00000000 --- a/vendor/symfony/var-dumper/Caster/ConstStub.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; - -/** - * Represents a PHP constant and its value. - * - * @author Nicolas Grekas - */ -class ConstStub extends Stub -{ - public function __construct(string $name, string|int|float $value = null) - { - $this->class = $name; - $this->value = 1 < \func_num_args() ? $value : $name; - } - - public function __toString(): string - { - 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 0e4fb363..00000000 --- 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 772399ef..00000000 --- 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(mixed $value) - { - $this->value = $value; - - switch (\gettype($value)) { - case 'object': - $this->type = self::TYPE_OBJECT; - $this->class = $value::class; - - 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 8b770b8a..00000000 --- a/vendor/symfony/var-dumper/Caster/DOMCaster.php +++ /dev/null @@ -1,267 +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 - */ -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, bool $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, bool $isNested) - { - $a += [ - 'length' => $dom->length, - ]; - - return $a; - } - - public static function castImplementation(\DOMImplementation $dom, array $a, Stub $stub, bool $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, bool $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, bool $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, bool $isNested, int $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, bool $isNested) - { - $a += [ - 'data' => $dom->data, - 'length' => $dom->length, - ]; - - return $a; - } - - public static function castAttr(\DOMAttr $dom, array $a, Stub $stub, bool $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, bool $isNested) - { - $a += [ - 'tagName' => $dom->tagName, - 'schemaTypeInfo' => $dom->schemaTypeInfo, - ]; - - return $a; - } - - public static function castText(\DOMText $dom, array $a, Stub $stub, bool $isNested) - { - $a += [ - 'wholeText' => $dom->wholeText, - ]; - - return $a; - } - - public static function castDocumentType(\DOMDocumentType $dom, array $a, Stub $stub, bool $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, bool $isNested) - { - $a += [ - 'publicId' => $dom->publicId, - 'systemId' => $dom->systemId, - ]; - - return $a; - } - - public static function castEntity(\DOMEntity $dom, array $a, Stub $stub, bool $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, bool $isNested) - { - $a += [ - 'target' => $dom->target, - 'data' => $dom->data, - ]; - - return $a; - } - - public static function castXPath(\DOMXPath $dom, array $a, Stub $stub, bool $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 07e8c5ea..00000000 --- a/vendor/symfony/var-dumper/Caster/DateCaster.php +++ /dev/null @@ -1,127 +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 - */ -class DateCaster -{ - private const PERIOD_LIMIT = 3; - - public static function castDateTime(\DateTimeInterface $d, array $a, Stub $stub, bool $isNested, int $filter) - { - $prefix = Caster::PREFIX_VIRTUAL; - $location = $d->getTimezone()->getLocation(); - $fromNow = (new \DateTimeImmutable())->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, bool $isNested, int $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, bool $isNested, int $filter) - { - $location = $timeZone->getLocation(); - $formatted = (new \DateTimeImmutable('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, bool $isNested, int $filter) - { - $dates = []; - 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 129b2cb4..00000000 --- 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 - */ -class DoctrineCaster -{ - public static function castCommonProxy(CommonProxy $proxy, array $a, Stub $stub, bool $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, bool $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, bool $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 b34b6700..00000000 --- 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 - */ -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 22112af9..00000000 --- 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(string|int $key, mixed $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 7a4e98a2..00000000 --- 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 14caf71f..00000000 --- a/vendor/symfony/var-dumper/Caster/ExceptionCaster.php +++ /dev/null @@ -1,386 +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 - */ -class ExceptionCaster -{ - public static int $srcContext = 1; - public static bool $traceArgs = true; - public static array $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 array $framesCache = []; - - public static function castError(\Error $e, array $a, Stub $stub, bool $isNested, int $filter = 0) - { - return self::filterExceptionArray($stub->class, $a, "\0Error\0", $filter); - } - - public static function castException(\Exception $e, array $a, Stub $stub, bool $isNested, int $filter = 0) - { - return self::filterExceptionArray($stub->class, $a, "\0Exception\0", $filter); - } - - public static function castErrorException(\ErrorException $e, array $a, Stub $stub, bool $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, bool $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, bool $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, bool $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, bool $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 (is_file($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') || !is_file($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) { - // 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) { - $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/FFICaster.php b/vendor/symfony/var-dumper/Caster/FFICaster.php deleted file mode 100644 index 7d90e7b5..00000000 --- a/vendor/symfony/var-dumper/Caster/FFICaster.php +++ /dev/null @@ -1,161 +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 FFI\CData; -use FFI\CType; -use Symfony\Component\VarDumper\Cloner\Stub; - -/** - * Casts FFI extension classes to array representation. - * - * @author Nesmeyanov Kirill - */ -final class FFICaster -{ - /** - * In case of "char*" contains a string, the length of which depends on - * some other parameter, then during the generation of the string it is - * possible to go beyond the allowable memory area. - * - * This restriction serves to ensure that processing does not take - * up the entire allowable PHP memory limit. - */ - private const MAX_STRING_LENGTH = 255; - - public static function castCTypeOrCData(CData|CType $data, array $args, Stub $stub): array - { - if ($data instanceof CType) { - $type = $data; - $data = null; - } else { - $type = \FFI::typeof($data); - } - - $stub->class = sprintf('%s<%s> size %d align %d', ($data ?? $type)::class, $type->getName(), $type->getSize(), $type->getAlignment()); - - return match ($type->getKind()) { - CType::TYPE_FLOAT, - CType::TYPE_DOUBLE, - \defined('\FFI\CType::TYPE_LONGDOUBLE') ? CType::TYPE_LONGDOUBLE : -1, - CType::TYPE_UINT8, - CType::TYPE_SINT8, - CType::TYPE_UINT16, - CType::TYPE_SINT16, - CType::TYPE_UINT32, - CType::TYPE_SINT32, - CType::TYPE_UINT64, - CType::TYPE_SINT64, - CType::TYPE_BOOL, - CType::TYPE_CHAR, - CType::TYPE_ENUM => null !== $data ? [Caster::PREFIX_VIRTUAL.'cdata' => $data->cdata] : [], - CType::TYPE_POINTER => self::castFFIPointer($stub, $type, $data), - CType::TYPE_STRUCT => self::castFFIStructLike($type, $data), - CType::TYPE_FUNC => self::castFFIFunction($stub, $type), - default => $args, - }; - } - - private static function castFFIFunction(Stub $stub, CType $type): array - { - $arguments = []; - - for ($i = 0, $count = $type->getFuncParameterCount(); $i < $count; ++$i) { - $param = $type->getFuncParameterType($i); - - $arguments[] = $param->getName(); - } - - $abi = match ($type->getFuncABI()) { - CType::ABI_DEFAULT, - CType::ABI_CDECL => '[cdecl]', - CType::ABI_FASTCALL => '[fastcall]', - CType::ABI_THISCALL => '[thiscall]', - CType::ABI_STDCALL => '[stdcall]', - CType::ABI_PASCAL => '[pascal]', - CType::ABI_REGISTER => '[register]', - CType::ABI_MS => '[ms]', - CType::ABI_SYSV => '[sysv]', - CType::ABI_VECTORCALL => '[vectorcall]', - default => '[unknown abi]' - }; - - $returnType = $type->getFuncReturnType(); - - $stub->class = $abi.' callable('.implode(', ', $arguments).'): ' - .$returnType->getName(); - - return [Caster::PREFIX_VIRTUAL.'returnType' => $returnType]; - } - - private static function castFFIPointer(Stub $stub, CType $type, CData $data = null): array - { - $ptr = $type->getPointerType(); - - if (null === $data) { - return [Caster::PREFIX_VIRTUAL.'0' => $ptr]; - } - - return match ($ptr->getKind()) { - CType::TYPE_CHAR => [Caster::PREFIX_VIRTUAL.'cdata' => self::castFFIStringValue($data)], - CType::TYPE_FUNC => self::castFFIFunction($stub, $ptr), - default => [Caster::PREFIX_VIRTUAL.'cdata' => $data[0]], - }; - } - - private static function castFFIStringValue(CData $data): string|CutStub - { - $result = []; - - for ($i = 0; $i < self::MAX_STRING_LENGTH; ++$i) { - $result[$i] = $data[$i]; - - if ("\0" === $result[$i]) { - return implode('', $result); - } - } - - $string = implode('', $result); - $stub = new CutStub($string); - $stub->cut = -1; - $stub->value = $string; - - return $stub; - } - - private static function castFFIStructLike(CType $type, CData $data = null): array - { - $isUnion = ($type->getAttributes() & CType::ATTR_UNION) === CType::ATTR_UNION; - - $result = []; - - foreach ($type->getStructFieldNames() as $name) { - $field = $type->getStructFieldType($name); - - // Retrieving the value of a field from a union containing - // a pointer is not a safe operation, because may contain - // incorrect data. - $isUnsafe = $isUnion && CType::TYPE_POINTER === $field->getKind(); - - if ($isUnsafe) { - $result[Caster::PREFIX_VIRTUAL.$name.'?'] = $field; - } elseif (null === $data) { - $result[Caster::PREFIX_VIRTUAL.$name] = $field; - } else { - $fieldName = $data->{$name} instanceof CData ? '' : $field->getName().' '; - $result[Caster::PREFIX_VIRTUAL.$fieldName.$name] = $data->{$name}; - } - } - - return $result; - } -} diff --git a/vendor/symfony/var-dumper/Caster/FiberCaster.php b/vendor/symfony/var-dumper/Caster/FiberCaster.php deleted file mode 100644 index c74a9e59..00000000 --- a/vendor/symfony/var-dumper/Caster/FiberCaster.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\Caster; - -use Symfony\Component\VarDumper\Cloner\Stub; - -/** - * Casts Fiber related classes to array representation. - * - * @author Grégoire Pineau - */ -final class FiberCaster -{ - public static function castFiber(\Fiber $fiber, array $a, Stub $stub, bool $isNested, int $filter = 0) - { - $prefix = Caster::PREFIX_VIRTUAL; - - if ($fiber->isTerminated()) { - $status = 'terminated'; - } elseif ($fiber->isRunning()) { - $status = 'running'; - } elseif ($fiber->isSuspended()) { - $status = 'suspended'; - } elseif ($fiber->isStarted()) { - $status = 'started'; - } else { - $status = 'not started'; - } - - $a[$prefix.'status'] = $status; - - return $a; - } -} diff --git a/vendor/symfony/var-dumper/Caster/FrameStub.php b/vendor/symfony/var-dumper/Caster/FrameStub.php deleted file mode 100644 index 87867552..00000000 --- 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 b018cc7f..00000000 --- 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 - */ -class GmpCaster -{ - public static function castGmp(\GMP $gmp, array $a, Stub $stub, bool $isNested, int $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 d1289da3..00000000 --- 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 a16681f7..00000000 --- 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 1ed91d4d..00000000 --- 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 - */ -class IntlCaster -{ - public static function castMessageFormatter(\MessageFormatter $c, array $a, Stub $stub, bool $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, bool $isNested, int $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, bool $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, bool $isNested, int $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, bool $isNested, int $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(object $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 4113e3a2..00000000 --- a/vendor/symfony/var-dumper/Caster/LinkStub.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; - -/** - * Represents a file or a URL. - * - * @author Nicolas Grekas - */ -class LinkStub extends ConstStub -{ - public $inVendor = false; - - private static array $vendorRoots; - private static array $composerRoots = []; - - public function __construct(string $label, int $line = 0, string $href = null) - { - $this->value = $label; - - if (!\is_string($href ??= $label)) { - 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 (!is_file($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 (!isset(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 (is_file($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 (!@is_file($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 bc1fd63f..00000000 --- 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 - */ -class MemcachedCaster -{ - private static array $optionConstants; - private static array $defaultOptions; - - public static function castMemcached(\Memcached $c, array $a, Stub $stub, bool $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::discoverDefaultOptions(); - 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::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 bfe6f082..00000000 --- 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 0372a630..00000000 --- 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 - */ -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, bool $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) { - } - } - 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, bool $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 d8e5b525..00000000 --- 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 - */ -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, bool $isNested) - { - $a['seek position'] = pg_lo_tell($lo); - - return $a; - } - - public static function castLink($link, array $a, Stub $stub, bool $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, bool $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 e7120191..00000000 --- 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 - */ -class ProxyManagerCaster -{ - public static function castProxy(ProxyInterface $c, array $a, Stub $stub, bool $isNested) - { - if ($parent = get_parent_class($c)) { - $stub->class .= ' - '.$parent; - } - $stub->class .= '@proxy'; - - return $a; - } -} diff --git a/vendor/symfony/var-dumper/Caster/RdKafkaCaster.php b/vendor/symfony/var-dumper/Caster/RdKafkaCaster.php deleted file mode 100644 index 82b8c8af..00000000 --- a/vendor/symfony/var-dumper/Caster/RdKafkaCaster.php +++ /dev/null @@ -1,186 +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 RdKafka\Conf; -use RdKafka\Exception as RdKafkaException; -use RdKafka\KafkaConsumer; -use RdKafka\Message; -use RdKafka\Metadata\Broker as BrokerMetadata; -use RdKafka\Metadata\Collection as CollectionMetadata; -use RdKafka\Metadata\Partition as PartitionMetadata; -use RdKafka\Metadata\Topic as TopicMetadata; -use RdKafka\Topic; -use RdKafka\TopicConf; -use RdKafka\TopicPartition; -use Symfony\Component\VarDumper\Cloner\Stub; - -/** - * Casts RdKafka related classes to array representation. - * - * @author Romain Neutron - */ -class RdKafkaCaster -{ - public static function castKafkaConsumer(KafkaConsumer $c, array $a, Stub $stub, bool $isNested) - { - $prefix = Caster::PREFIX_VIRTUAL; - - try { - $assignment = $c->getAssignment(); - } catch (RdKafkaException) { - $assignment = []; - } - - $a += [ - $prefix.'subscription' => $c->getSubscription(), - $prefix.'assignment' => $assignment, - ]; - - $a += self::extractMetadata($c); - - return $a; - } - - public static function castTopic(Topic $c, array $a, Stub $stub, bool $isNested) - { - $prefix = Caster::PREFIX_VIRTUAL; - - $a += [ - $prefix.'name' => $c->getName(), - ]; - - return $a; - } - - public static function castTopicPartition(TopicPartition $c, array $a) - { - $prefix = Caster::PREFIX_VIRTUAL; - - $a += [ - $prefix.'offset' => $c->getOffset(), - $prefix.'partition' => $c->getPartition(), - $prefix.'topic' => $c->getTopic(), - ]; - - return $a; - } - - public static function castMessage(Message $c, array $a, Stub $stub, bool $isNested) - { - $prefix = Caster::PREFIX_VIRTUAL; - - $a += [ - $prefix.'errstr' => $c->errstr(), - ]; - - return $a; - } - - public static function castConf(Conf $c, array $a, Stub $stub, bool $isNested) - { - $prefix = Caster::PREFIX_VIRTUAL; - - foreach ($c->dump() as $key => $value) { - $a[$prefix.$key] = $value; - } - - return $a; - } - - public static function castTopicConf(TopicConf $c, array $a, Stub $stub, bool $isNested) - { - $prefix = Caster::PREFIX_VIRTUAL; - - foreach ($c->dump() as $key => $value) { - $a[$prefix.$key] = $value; - } - - return $a; - } - - public static function castRdKafka(\RdKafka $c, array $a, Stub $stub, bool $isNested) - { - $prefix = Caster::PREFIX_VIRTUAL; - - $a += [ - $prefix.'out_q_len' => $c->getOutQLen(), - ]; - - $a += self::extractMetadata($c); - - return $a; - } - - public static function castCollectionMetadata(CollectionMetadata $c, array $a, Stub $stub, bool $isNested) - { - $a += iterator_to_array($c); - - return $a; - } - - public static function castTopicMetadata(TopicMetadata $c, array $a, Stub $stub, bool $isNested) - { - $prefix = Caster::PREFIX_VIRTUAL; - - $a += [ - $prefix.'name' => $c->getTopic(), - $prefix.'partitions' => $c->getPartitions(), - ]; - - return $a; - } - - public static function castPartitionMetadata(PartitionMetadata $c, array $a, Stub $stub, bool $isNested) - { - $prefix = Caster::PREFIX_VIRTUAL; - - $a += [ - $prefix.'id' => $c->getId(), - $prefix.'err' => $c->getErr(), - $prefix.'leader' => $c->getLeader(), - ]; - - return $a; - } - - public static function castBrokerMetadata(BrokerMetadata $c, array $a, Stub $stub, bool $isNested) - { - $prefix = Caster::PREFIX_VIRTUAL; - - $a += [ - $prefix.'id' => $c->getId(), - $prefix.'host' => $c->getHost(), - $prefix.'port' => $c->getPort(), - ]; - - return $a; - } - - private static function extractMetadata(KafkaConsumer|\RdKafka $c) - { - $prefix = Caster::PREFIX_VIRTUAL; - - try { - $m = $c->getMetadata(true, null, 500); - } catch (RdKafkaException) { - return []; - } - - return [ - $prefix.'orig_broker_id' => $m->getOrigBrokerId(), - $prefix.'orig_broker_name' => $m->getOrigBrokerName(), - $prefix.'brokers' => $m->getBrokers(), - $prefix.'topics' => $m->getTopics(), - ]; - } -} diff --git a/vendor/symfony/var-dumper/Caster/RedisCaster.php b/vendor/symfony/var-dumper/Caster/RedisCaster.php deleted file mode 100644 index eac25a12..00000000 --- a/vendor/symfony/var-dumper/Caster/RedisCaster.php +++ /dev/null @@ -1,149 +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 - */ -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, bool $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, bool $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, bool $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; - } - - private static function getRedisOptions(\Redis|\RedisArray|\RedisCluster $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 f6c8c741..00000000 --- a/vendor/symfony/var-dumper/Caster/ReflectionCaster.php +++ /dev/null @@ -1,440 +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 - */ -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, bool $isNested, int $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, bool $isNested) - { - // Cannot create ReflectionGenerator based on a terminated Generator - try { - $reflectionGenerator = new \ReflectionGenerator($c); - } catch (\Exception) { - $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, bool $isNested) - { - $prefix = Caster::PREFIX_VIRTUAL; - - if ($c instanceof \ReflectionNamedType) { - $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 castAttribute(\ReflectionAttribute $c, array $a, Stub $stub, bool $isNested) - { - self::addMap($a, $c, [ - 'name' => 'getName', - 'arguments' => 'getArguments', - ]); - - return $a; - } - - public static function castReflectionGenerator(\ReflectionGenerator $c, array $a, Stub $stub, bool $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(), - ]); - $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, bool $isNested, int $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' => 'getReflectionConstants', - ]); - - foreach ($c->getProperties() as $n) { - $a[$prefix.'properties'][$n->name] = $n; - } - - foreach ($c->getMethods() as $n) { - $a[$prefix.'methods'][$n->name] = $n; - } - - self::addAttributes($a, $c, $prefix); - - if (!($filter & Caster::EXCLUDE_VERBOSE) && !$isNested) { - self::addExtra($a, $c); - } - - return $a; - } - - public static function castFunctionAbstract(\ReflectionFunctionAbstract $c, array $a, Stub $stub, bool $isNested, int $filter = 0) - { - $prefix = Caster::PREFIX_VIRTUAL; - - self::addMap($a, $c, [ - 'returnsReference' => 'returnsReference', - 'returnType' => 'getReturnType', - 'class' => \PHP_VERSION_ID >= 80111 ? 'getClosureCalledClass' : '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']); - } - - self::addAttributes($a, $c, $prefix); - - 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 castClassConstant(\ReflectionClassConstant $c, array $a, Stub $stub, bool $isNested) - { - $a[Caster::PREFIX_VIRTUAL.'modifiers'] = implode(' ', \Reflection::getModifierNames($c->getModifiers())); - $a[Caster::PREFIX_VIRTUAL.'value'] = $c->getValue(); - - self::addAttributes($a, $c); - - return $a; - } - - public static function castMethod(\ReflectionMethod $c, array $a, Stub $stub, bool $isNested) - { - $a[Caster::PREFIX_VIRTUAL.'modifiers'] = implode(' ', \Reflection::getModifierNames($c->getModifiers())); - - return $a; - } - - public static function castParameter(\ReflectionParameter $c, array $a, Stub $stub, bool $isNested) - { - $prefix = Caster::PREFIX_VIRTUAL; - - self::addMap($a, $c, [ - 'position' => 'getPosition', - 'isVariadic' => 'isVariadic', - 'byReference' => 'isPassedByReference', - 'allowsNull' => 'allowsNull', - ]); - - self::addAttributes($a, $c, $prefix); - - 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) { - } - } - - return $a; - } - - public static function castProperty(\ReflectionProperty $c, array $a, Stub $stub, bool $isNested) - { - $a[Caster::PREFIX_VIRTUAL.'modifiers'] = implode(' ', \Reflection::getModifierNames($c->getModifiers())); - - self::addAttributes($a, $c); - self::addExtra($a, $c); - - return $a; - } - - public static function castReference(\ReflectionReference $c, array $a, Stub $stub, bool $isNested) - { - $a[Caster::PREFIX_VIRTUAL.'id'] = $c->getId(); - - return $a; - } - - public static function castExtension(\ReflectionExtension $c, array $a, Stub $stub, bool $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, bool $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, object $c, array $map, string $prefix = Caster::PREFIX_VIRTUAL) - { - foreach ($map as $k => $m) { - if ('isDisabled' === $k) { - continue; - } - - if (method_exists($c, $m) && false !== ($m = $c->$m()) && null !== $m) { - $a[$prefix.$k] = $m instanceof \Reflector ? $m->name : $m; - } - } - } - - private static function addAttributes(array &$a, \Reflector $c, string $prefix = Caster::PREFIX_VIRTUAL): void - { - foreach ($c->getAttributes() as $n) { - $a[$prefix.'attributes'][] = $n; - } - } -} diff --git a/vendor/symfony/var-dumper/Caster/ResourceCaster.php b/vendor/symfony/var-dumper/Caster/ResourceCaster.php deleted file mode 100644 index 6db234e8..00000000 --- a/vendor/symfony/var-dumper/Caster/ResourceCaster.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 common resource types to array representation. - * - * @author Nicolas Grekas - * - * @final - */ -class ResourceCaster -{ - public static function castCurl(\CurlHandle $h, array $a, Stub $stub, bool $isNested): array - { - return curl_getinfo($h); - } - - public static function castDba($dba, array $a, Stub $stub, bool $isNested) - { - $list = dba_list(); - $a['file'] = $list[(int) $dba]; - - return $a; - } - - public static function castProcess($process, array $a, Stub $stub, bool $isNested) - { - return proc_get_status($process); - } - - public static function castStream($stream, array $a, Stub $stub, bool $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, bool $isNested) - { - return @stream_context_get_params($stream) ?: $a; - } - - public static function castGd($gd, array $a, Stub $stub, bool $isNested) - { - $a['size'] = imagesx($gd).'x'.imagesy($gd); - $a['trueColor'] = imageistruecolor($gd); - - return $a; - } - - public static function castOpensslX509($h, array $a, Stub $stub, bool $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(\DateTimeInterface::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 448afbad..00000000 --- a/vendor/symfony/var-dumper/Caster/SplCaster.php +++ /dev/null @@ -1,234 +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 - */ -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, bool $isNested) - { - return self::castSplArray($c, $a, $stub, $isNested); - } - - public static function castArrayIterator(\ArrayIterator $c, array $a, Stub $stub, bool $isNested) - { - return self::castSplArray($c, $a, $stub, $isNested); - } - - public static function castHeap(\Iterator $c, array $a, Stub $stub, bool $isNested) - { - $a += [ - Caster::PREFIX_VIRTUAL.'heap' => iterator_to_array(clone $c), - ]; - - return $a; - } - - public static function castDoublyLinkedList(\SplDoublyLinkedList $c, array $a, Stub $stub, bool $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, bool $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"]); - - 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) { - } - } - - 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, bool $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) { - } - } - - 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, bool $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, bool $isNested) - { - $a[Caster::PREFIX_VIRTUAL.'innerIterator'] = $c->getInnerIterator(); - - return $a; - } - - public static function castWeakReference(\WeakReference $c, array $a, Stub $stub, bool $isNested) - { - $a[Caster::PREFIX_VIRTUAL.'object'] = $c->get(); - - return $a; - } - - private static function castSplArray(\ArrayObject|\ArrayIterator $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, $c::class, method_exists($c, '__debugInfo'), $stub->class); - $c->setFlags($flags); - } - $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 32ead7c2..00000000 --- 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 - */ -class StubCaster -{ - public static function castStub(Stub $c, array $a, Stub $stub, bool $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, bool $isNested) - { - return $isNested ? $c->preservedSubset : $a; - } - - public static function cutInternals($obj, array $a, Stub $stub, bool $isNested) - { - if ($isNested) { - $stub->cut += \count($a); - - return []; - } - - return $a; - } - - public static function castEnum(EnumStub $c, array $a, Stub $stub, bool $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 f2ee0d62..00000000 --- a/vendor/symfony/var-dumper/Caster/SymfonyCaster.php +++ /dev/null @@ -1,112 +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\Uid\Ulid; -use Symfony\Component\Uid\Uuid; -use Symfony\Component\VarDumper\Cloner\Stub; -use Symfony\Component\VarExporter\Internal\LazyObjectState; - -/** - * @final - */ -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, bool $isNested) - { - $clone = null; - - foreach (self::REQUEST_GETTERS as $prop => $getter) { - $key = Caster::PREFIX_PROTECTED.$prop; - if (\array_key_exists($key, $a) && null === $a[$key]) { - $clone ??= clone $request; - $a[Caster::PREFIX_VIRTUAL.$prop] = $clone->{$getter}(); - } - } - - return $a; - } - - public static function castHttpClient($client, array $a, Stub $stub, bool $isNested) - { - $multiKey = sprintf("\0%s\0multi", $client::class); - if (isset($a[$multiKey])) { - $a[$multiKey] = new CutStub($a[$multiKey]); - } - - return $a; - } - - public static function castHttpClientResponse($response, array $a, Stub $stub, bool $isNested) - { - $stub->cut += \count($a); - $a = []; - - foreach ($response->getInfo() as $k => $v) { - $a[Caster::PREFIX_VIRTUAL.$k] = $v; - } - - return $a; - } - - public static function castLazyObjectState($state, array $a, Stub $stub, bool $isNested) - { - if (!$isNested) { - return $a; - } - - $stub->cut += \count($a) - 1; - - return ['status' => new ConstStub(match ($a['status']) { - LazyObjectState::STATUS_INITIALIZED_FULL => 'INITIALIZED_FULL', - LazyObjectState::STATUS_INITIALIZED_PARTIAL => 'INITIALIZED_PARTIAL', - LazyObjectState::STATUS_UNINITIALIZED_FULL => 'UNINITIALIZED_FULL', - LazyObjectState::STATUS_UNINITIALIZED_PARTIAL => 'UNINITIALIZED_PARTIAL', - }, $a['status'])]; - } - - public static function castUuid(Uuid $uuid, array $a, Stub $stub, bool $isNested) - { - $a[Caster::PREFIX_VIRTUAL.'toBase58'] = $uuid->toBase58(); - $a[Caster::PREFIX_VIRTUAL.'toBase32'] = $uuid->toBase32(); - - // symfony/uid >= 5.3 - if (method_exists($uuid, 'getDateTime')) { - $a[Caster::PREFIX_VIRTUAL.'time'] = $uuid->getDateTime()->format('Y-m-d H:i:s.u \U\T\C'); - } - - return $a; - } - - public static function castUlid(Ulid $ulid, array $a, Stub $stub, bool $isNested) - { - $a[Caster::PREFIX_VIRTUAL.'toBase58'] = $ulid->toBase58(); - $a[Caster::PREFIX_VIRTUAL.'toRfc4122'] = $ulid->toRfc4122(); - - // symfony/uid >= 5.3 - if (method_exists($ulid, 'getDateTime')) { - $a[Caster::PREFIX_VIRTUAL.'time'] = $ulid->getDateTime()->format('Y-m-d H:i:s.v \U\T\C'); - } - - 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 5eea1c87..00000000 --- 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 b1027745..00000000 --- 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 506746b4..00000000 --- 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 - */ -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, bool $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) { - $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 ba55fced..00000000 --- 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 - */ -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, bool $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 6c3efdeb..00000000 --- a/vendor/symfony/var-dumper/Cloner/AbstractCloner.php +++ /dev/null @@ -1,385 +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'], - - 'Fiber' => ['Symfony\Component\VarDumper\Caster\FiberCaster', 'castFiber'], - - 'Closure' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castClosure'], - 'Generator' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castGenerator'], - 'ReflectionType' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castType'], - 'ReflectionAttribute' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castAttribute'], - 'ReflectionGenerator' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castReflectionGenerator'], - 'ReflectionClass' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castClass'], - 'ReflectionClassConstant' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castClassConstant'], - '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'], - '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\Bridge\Monolog\Logger' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'], - 'Symfony\Component\DependencyInjection\ContainerInterface' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'], - 'Symfony\Component\EventDispatcher\EventDispatcherInterface' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'], - 'Symfony\Component\HttpClient\AmpHttpClient' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castHttpClient'], - 'Symfony\Component\HttpClient\CurlHttpClient' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castHttpClient'], - 'Symfony\Component\HttpClient\NativeHttpClient' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castHttpClient'], - 'Symfony\Component\HttpClient\Response\AmpResponse' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castHttpClientResponse'], - '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\Uid\Ulid' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castUlid'], - 'Symfony\Component\Uid\Uuid' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castUuid'], - 'Symfony\Component\VarExporter\Internal\LazyObjectState' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castLazyObjectState'], - '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'], - - ':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'], - - ':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'], - - 'RdKafka' => ['Symfony\Component\VarDumper\Caster\RdKafkaCaster', 'castRdKafka'], - 'RdKafka\Conf' => ['Symfony\Component\VarDumper\Caster\RdKafkaCaster', 'castConf'], - 'RdKafka\KafkaConsumer' => ['Symfony\Component\VarDumper\Caster\RdKafkaCaster', 'castKafkaConsumer'], - 'RdKafka\Metadata\Broker' => ['Symfony\Component\VarDumper\Caster\RdKafkaCaster', 'castBrokerMetadata'], - 'RdKafka\Metadata\Collection' => ['Symfony\Component\VarDumper\Caster\RdKafkaCaster', 'castCollectionMetadata'], - 'RdKafka\Metadata\Partition' => ['Symfony\Component\VarDumper\Caster\RdKafkaCaster', 'castPartitionMetadata'], - 'RdKafka\Metadata\Topic' => ['Symfony\Component\VarDumper\Caster\RdKafkaCaster', 'castTopicMetadata'], - 'RdKafka\Message' => ['Symfony\Component\VarDumper\Caster\RdKafkaCaster', 'castMessage'], - 'RdKafka\Topic' => ['Symfony\Component\VarDumper\Caster\RdKafkaCaster', 'castTopic'], - 'RdKafka\TopicPartition' => ['Symfony\Component\VarDumper\Caster\RdKafkaCaster', 'castTopicPartition'], - 'RdKafka\TopicConf' => ['Symfony\Component\VarDumper\Caster\RdKafkaCaster', 'castTopicConf'], - - 'FFI\CData' => ['Symfony\Component\VarDumper\Caster\FFICaster', 'castCTypeOrCData'], - 'FFI\CType' => ['Symfony\Component\VarDumper\Caster\FFICaster', 'castCTypeOrCData'], - ]; - - protected $maxItems = 2500; - protected $maxString = -1; - protected $minDepth = 1; - - /** - * @var array> - */ - private array $casters = []; - - /** - * @var callable|null - */ - private $prevErrorHandler; - - private array $classInfo = []; - private int $filter = 0; - - /** - * @param callable[]|null $casters A map of casters - * - * @see addCasters - */ - public function __construct(array $casters = null) - { - $this->addCasters($casters ?? static::$defaultCasters); - } - - /** - * 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. - */ - public function setMaxItems(int $maxItems) - { - $this->maxItems = $maxItems; - } - - /** - * Sets the maximum cloned length for strings. - */ - public function setMaxString(int $maxString) - { - $this->maxString = $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. - */ - public function setMinDepth(int $minDepth) - { - $this->minDepth = $minDepth; - } - - /** - * Clones a PHP variable. - * - * @param int $filter A bit field of Caster::EXCLUDE_* constants - */ - public function cloneVar(mixed $var, int $filter = 0): Data - { - $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. - */ - abstract protected function doClone(mixed $var): array; - - /** - * Casts an object to an array representation. - * - * @param bool $isNested True if the object is nested in the dumped structure - */ - protected function castObject(Stub $stub, bool $isNested): array - { - $obj = $stub->value; - $class = $stub->class; - - if (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 - */ - protected function castResource(Stub $stub, bool $isNested): array - { - $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 5a8e2e4c..00000000 --- a/vendor/symfony/var-dumper/Cloner/ClonerInterface.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\Cloner; - -/** - * @author Nicolas Grekas - */ -interface ClonerInterface -{ - /** - * Clones a PHP variable. - */ - public function cloneVar(mixed $var): Data; -} diff --git a/vendor/symfony/var-dumper/Cloner/Cursor.php b/vendor/symfony/var-dumper/Cloner/Cursor.php deleted file mode 100644 index 1fd796d6..00000000 --- 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 6ecb883e..00000000 --- a/vendor/symfony/var-dumper/Cloner/Data.php +++ /dev/null @@ -1,422 +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 array $data; - private int $position = 0; - private int|string $key = 0; - private int $maxDepth = 20; - private int $maxItemsPerDepth = -1; - private int $useRefHandles = -1; - private array $context = []; - - /** - * @param array $data An array as returned by ClonerInterface::cloneVar() - */ - public function __construct(array $data) - { - $this->data = $data; - } - - public function getType(): ?string - { - $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; - } - - /** - * Returns a native representation of the original value. - * - * @param array|bool $recursive Whether values should be resolved recursively or not - * - * @return string|int|float|bool|array|Data[]|null - */ - public function getValue(array|bool $recursive = false): string|int|float|bool|array|null - { - $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; - } - - public function count(): int - { - return \count($this->getValue()); - } - - public function getIterator(): \Traversable - { - if (!\is_array($value = $this->getValue())) { - throw new \LogicException(sprintf('"%s" object holds non-iterable type "%s".', self::class, get_debug_type($value))); - } - - yield from $value; - } - - public function __get(string $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; - } - - public function __isset(string $key): bool - { - return null !== $this->seek($key); - } - - public function offsetExists(mixed $key): bool - { - return $this->__isset($key); - } - - public function offsetGet(mixed $key): mixed - { - return $this->__get($key); - } - - public function offsetSet(mixed $key, mixed $value): void - { - throw new \BadMethodCallException(self::class.' objects are immutable.'); - } - - public function offsetUnset(mixed $key): void - { - throw new \BadMethodCallException(self::class.' objects are immutable.'); - } - - public function __toString(): string - { - $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. - */ - public function withMaxDepth(int $maxDepth): static - { - $data = clone $this; - $data->maxDepth = $maxDepth; - - return $data; - } - - /** - * Limits the number of elements per depth level. - */ - public function withMaxItemsPerDepth(int $maxItemsPerDepth): static - { - $data = clone $this; - $data->maxItemsPerDepth = $maxItemsPerDepth; - - return $data; - } - - /** - * Enables/disables objects' identifiers tracking. - * - * @param bool $useRefHandles False to hide global ref. handles - */ - public function withRefHandles(bool $useRefHandles): static - { - $data = clone $this; - $data->useRefHandles = $useRefHandles ? -1 : 0; - - return $data; - } - - public function withContext(array $context): static - { - $data = clone $this; - $data->context = $context; - - return $data; - } - - /** - * Seeks to a specific key in nested data structures. - */ - public function seek(string|int $key): ?static - { - $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, mixed $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(mixed $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 61d02d24..00000000 --- a/vendor/symfony/var-dumper/Cloner/DumperInterface.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\Cloner; - -/** - * DumperInterface used by Data objects. - * - * @author Nicolas Grekas - */ -interface DumperInterface -{ - /** - * Dumps a scalar value. - */ - public function dumpScalar(Cursor $cursor, string $type, string|int|float|bool|null $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, string $str, bool $bin, int $cut); - - /** - * Dumps while entering an hash. - * - * @param int $type A Cursor::HASH_* const for the type of hash - * @param string|int|null $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, int $type, string|int|null $class, bool $hasChild); - - /** - * Dumps while leaving an hash. - * - * @param int $type A Cursor::HASH_* const for the type of hash - * @param string|int|null $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, int $type, string|int|null $class, bool $hasChild, int $cut); -} diff --git a/vendor/symfony/var-dumper/Cloner/Stub.php b/vendor/symfony/var-dumper/Cloner/Stub.php deleted file mode 100644 index 1c5b8871..00000000 --- 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 array $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 4068c7c3..00000000 --- a/vendor/symfony/var-dumper/Cloner/VarCloner.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\Cloner; - -/** - * @author Nicolas Grekas - */ -class VarCloner extends AbstractCloner -{ - private static string $gid; - private static array $arrayCache = []; - - protected function doClone(mixed $var): array - { - $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 - $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 - - $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]; - foreach ($vals as $k => $v) { - // $v is the original value or a stub object in case of hard references - - $zvalRef = ($r = \ReflectionReference::fromArrayElement($vals, $k)) ? $r->getId() : null; - - if ($zvalRef) { - $vals[$k] = &$stub; // Break hard references to make $queue completely - unset($stub); // independent from the original structure - if (null !== $vals[$k] = $hardRefs[$zvalRef] ?? null) { - $v = $vals[$k]; - 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; - $hardRefs[$zvalRef] = $vals[$k]; - } - // Create $stub when the original value $v cannot 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 = array_is_list($v) ? Stub::ARRAY_INDEXED : Stub::ARRAY_ASSOC; - $a = $v; - break; - - case \is_object($v): - if (empty($objRefs[$h = spl_object_id($v)])) { - $stub = new Stub(); - $stub->type = Stub::TYPE_OBJECT; - $stub->class = $v::class; - $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; - } else { - $hardRefs[$zvalRef]->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 4450fe98..00000000 --- a/vendor/symfony/var-dumper/Command/Descriptor/CliDescriptor.php +++ /dev/null @@ -1,79 +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\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 CliDumper $dumper; - private mixed $lastIdentifier = null; - - public function __construct(CliDumper $dumper) - { - $this->dumper = $dumper; - } - - 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']); - if ($fileLink = $source['file_link'] ?? null) { - $sourceInfo = sprintf('%s', $fileLink, $sourceInfo); - } - $rows[] = ['source', $sourceInfo]; - $file = $source['file_relative'] ?? $source['file']; - $rows[] = ['file', $file]; - } - - $io->table([], $rows); - - $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 267d27bf..00000000 --- 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 98f150a5..00000000 --- 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 HtmlDumper $dumper; - private bool $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(<< -
      -
      -

      $title

      - -
      - {$this->renderTags($tags)} -
      -
      -

      - $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 << -
        - $renderedTags -
      -
      -HTML; - } -} diff --git a/vendor/symfony/var-dumper/Command/ServerDumpCommand.php b/vendor/symfony/var-dumper/Command/ServerDumpCommand.php deleted file mode 100644 index 1b06e694..00000000 --- a/vendor/symfony/var-dumper/Command/ServerDumpCommand.php +++ /dev/null @@ -1,112 +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\Attribute\AsCommand; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; -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 - */ -#[AsCommand(name: 'server:dump', description: 'Start a dump server that collects and displays dumps in a single place')] -class ServerDumpCommand extends Command -{ - private DumpServer $server; - - /** @var DumpDescriptorInterface[] */ - private array $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() - { - $this - ->addOption('format', null, InputOption::VALUE_REQUIRED, sprintf('The output format (%s)', implode(', ', $this->getAvailableFormats())), 'cli') - ->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; - } - - public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void - { - if ($input->mustSuggestOptionValuesFor('format')) { - $suggestions->suggestValues($this->getAvailableFormats()); - } - } - - private function getAvailableFormats(): array - { - return array_keys($this->descriptors); - } -} diff --git a/vendor/symfony/var-dumper/Dumper/AbstractDumper.php b/vendor/symfony/var-dumper/Dumper/AbstractDumper.php deleted file mode 100644 index 2740b879..00000000 --- a/vendor/symfony/var-dumper/Dumper/AbstractDumper.php +++ /dev/null @@ -1,197 +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 = '.'; - protected $indentPad = ' '; - protected $flags; - - private string $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->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. - * - * @return string The previous charset - */ - public function setCharset(string $charset): string - { - $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(string $pad): string - { - $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): ?string - { - 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(int $depth) - { - ($this->lineDumper)($this->line, $depth, $this->indentPad); - $this->line = ''; - } - - /** - * Generic line dumper callback. - */ - protected function echoLine(string $line, int $depth, string $indentPad) - { - if (-1 !== $depth) { - fwrite($this->outputStream, str_repeat($indentPad, $depth).$line."\n"); - } - } - - /** - * Converts a non-UTF-8 string to UTF-8. - */ - protected function utf8Encode(?string $s): ?string - { - 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 c52ac4db..00000000 --- a/vendor/symfony/var-dumper/Dumper/CliDumper.php +++ /dev/null @@ -1,616 +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 array $displayOptions = [ - 'fileLinkFormat' => null, - ]; - - private bool $handlesHrefGracefully; - - 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. - */ - public function setColors(bool $colors) - { - $this->colors = $colors; - } - - /** - * Sets the maximum number of characters per line for dumped strings. - */ - public function setMaxStringWidth(int $maxStringWidth) - { - $this->maxStringWidth = $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; - } - - public function dumpScalar(Cursor $cursor, string $type, string|int|float|bool|null $value) - { - $this->dumpKey($cursor); - - $style = 'const'; - $attr = $cursor->attr; - - switch ($type) { - case 'default': - $style = 'default'; - break; - - case 'integer': - $style = 'num'; - - if (isset($this->styles['integer'])) { - $style = 'integer'; - } - - break; - - case 'double': - $style = 'num'; - - if (isset($this->styles['float'])) { - $style = 'float'; - } - - $value = match (true) { - \INF === $value => 'INF', - -\INF === $value => '-INF', - is_nan($value) => 'NAN', - default => !str_contains($value = (string) $value, $this->decimalPoint) ? $value .= $this->decimalPoint.'0' : $value, - }; - 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); - } - - public function dumpString(Cursor $cursor, string $str, bool $bin, int $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 = $bin && str_contains($str, "\0") ? [$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); - } - } - } - } - - public function enterHash(Cursor $cursor, int $type, string|int|null $class, bool $hasChild) - { - $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); - } - } - - public function leaveHash(Cursor $cursor, int $type, string|int|null $class, bool $hasChild, int $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, bool $hasChild, int $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 - */ - protected function style(string $style, string $value, array $attr = []): string - { - $this->colors ??= $this->supportsColors(); - - $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; - } - - protected function supportsColors(): bool - { - 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': - case '--colors=always': - return static::$defaultColors = true; - - case '--no-ansi': - case '--color=no': - case '--color=none': - case '--color=never': - case '--colors=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); - } - - protected function dumpLine(int $depth, bool $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 - */ - private function hasColorSupport(mixed $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'); - } - - return stream_isatty($stream); - } - - /** - * 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) { - $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 38f87897..00000000 --- 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 532aa0f9..00000000 --- a/vendor/symfony/var-dumper/Dumper/ContextProvider/ContextProviderInterface.php +++ /dev/null @@ -1,22 +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 -{ - 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 69dff067..00000000 --- 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 $requestStack; - private VarCloner $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 d36e8bcf..00000000 --- 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 int $limit; - private ?string $charset; - private ?string $projectDir; - private ?FileLinkFormatter $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 1ba803d8..00000000 --- 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 DataDumperInterface $wrappedDumper; - private array $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[$contextProvider::class] = $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 b173bccf..00000000 --- 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 843df10d..00000000 --- a/vendor/symfony/var-dumper/Dumper/HtmlDumper.php +++ /dev/null @@ -1,962 +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 array $displayOptions = [ - 'maxDepth' => 1, - 'maxStringLength' => 160, - 'fileLinkFormat' => null, - ]; - private array $extraDisplayOptions = []; - - 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']; - } - - 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. - */ - public function setDumpHeader(?string $header) - { - $this->dumpHeader = $header; - } - - /** - * Sets an HTML prefix and suffix that will encapse every single dump. - */ - public function setDumpBoundaries(string $prefix, string $suffix) - { - $this->dumpPrefix = $prefix; - $this->dumpSuffix = $suffix; - } - - public function dump(Data $data, $output = null, array $extraDisplayOptions = []): ?string - { - $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; - } - - public function dumpString(Cursor $cursor, string $str, bool $bin, int $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->line .= $cursor->depth >= $this->displayOptions['maxDepth'] ? ' ' : ' '; - $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); - } - } - - public function enterHash(Cursor $cursor, int $type, string|int|null $class, bool $hasChild) - { - if (Cursor::HASH_OBJECT === $type) { - $cursor->attr['depth'] = $cursor->depth; - } - parent::enterHash($cursor, $type, $class, false); - - if ($cursor->skipChildren || $cursor->depth >= $this->displayOptions['maxDepth']) { - $cursor->skipChildren = false; - $eol = ' class=sf-dump-compact>'; - } else { - $this->expandNextHash = false; - $eol = ' class=sf-dump-expanded>'; - } - - if ($hasChild) { - $this->line .= 'dumpId, $r); - } - $this->line .= $eol; - $this->dumpLine($cursor->depth); - } - } - - public function leaveHash(Cursor $cursor, int $type, string|int|null $class, bool $hasChild, int $cut) - { - $this->dumpEllipsis($cursor, $hasChild, $cut); - if ($hasChild) { - $this->line .= ''; - } - parent::leaveHash($cursor, $type, $class, $hasChild, 0); - } - - protected function style(string $style, string $value, array $attr = []): string - { - 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; - } - - protected function dumpLine(int $depth, bool $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 f2c891b6..00000000 --- a/vendor/symfony/var-dumper/Dumper/ServerDumper.php +++ /dev/null @@ -1,50 +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 $connection; - private ?DataDumperInterface $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(); - } - - 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 fd8eca9f..00000000 --- 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 '.$prev::class.' 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 a843ec12..00000000 --- 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 a0da8c9a..00000000 --- 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 100755 index f398fcef..00000000 --- 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 8f706d64..00000000 --- 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 6221a4d1..00000000 --- a/vendor/symfony/var-dumper/Resources/functions/dump.php +++ /dev/null @@ -1,50 +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(mixed $var, mixed ...$moreVars): mixed - { - 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')) { - /** - * @return never - */ - function dd(...$vars): void - { - if (!in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) && !headers_sent()) { - header('HTTP/1.1 500 Internal Server Error'); - } - - 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 63101e57..00000000 --- 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 97b5b94f..00000000 --- a/vendor/symfony/var-dumper/Server/Connection.php +++ /dev/null @@ -1,99 +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 string $host; - private array $contextProviders; - - /** - * @var resource|null - */ - 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 8df05a15..00000000 --- a/vendor/symfony/var-dumper/Server/DumpServer.php +++ /dev/null @@ -1,109 +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 string $host; - private ?LoggerInterface $logger; - - /** - * @var resource|null - */ - private $socket; - - 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) { - $this->logger?->info('Received a payload from client {clientId}', ['clientId' => $clientId]); - - $payload = @unserialize(base64_decode($message), ['allowed_classes' => [Data::class, Stub::class]]); - - // Impossible to decode the message, give up. - if (false === $payload) { - $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])) { - $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 a202185e..00000000 --- a/vendor/symfony/var-dumper/Test/VarDumperTestTrait.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\Test; - -use Symfony\Component\VarDumper\Cloner\VarCloner; -use Symfony\Component\VarDumper\Dumper\CliDumper; - -/** - * @author Nicolas Grekas - */ -trait VarDumperTestTrait -{ - /** - * @internal - */ - private array $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(mixed $expected, mixed $data, int $filter = 0, string $message = '') - { - $this->assertSame($this->prepareExpectation($expected, $filter), $this->getDump($data, null, $filter), $message); - } - - public function assertDumpMatchesFormat(mixed $expected, mixed $data, int $filter = 0, string $message = '') - { - $this->assertStringMatchesFormat($this->prepareExpectation($expected, $filter), $this->getDump($data, null, $filter), $message); - } - - protected function getDump(mixed $data, string|int $key = null, int $filter = 0): ?string - { - 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(mixed $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 840bfd64..00000000 --- a/vendor/symfony/var-dumper/VarDumper.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\Component\VarDumper; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\RequestStack; -use Symfony\Component\HttpKernel\Debug\FileLinkFormatter; -use Symfony\Component\VarDumper\Caster\ReflectionCaster; -use Symfony\Component\VarDumper\Cloner\VarCloner; -use Symfony\Component\VarDumper\Dumper\CliDumper; -use Symfony\Component\VarDumper\Dumper\ContextProvider\CliContextProvider; -use Symfony\Component\VarDumper\Dumper\ContextProvider\RequestContextProvider; -use Symfony\Component\VarDumper\Dumper\ContextProvider\SourceContextProvider; -use Symfony\Component\VarDumper\Dumper\ContextualizedDumper; -use Symfony\Component\VarDumper\Dumper\HtmlDumper; -use Symfony\Component\VarDumper\Dumper\ServerDumper; - -// Load the global dump() function -require_once __DIR__.'/Resources/functions/dump.php'; - -/** - * @author Nicolas Grekas - */ -class VarDumper -{ - /** - * @var callable|null - */ - private static $handler; - - public static function dump(mixed $var) - { - if (null === self::$handler) { - self::register(); - } - - return (self::$handler)($var); - } - - public static function setHandler(callable $callable = null): ?callable - { - if (1 > \func_num_args()) { - trigger_deprecation('symfony/var-dumper', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); - } - $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; - } - - private static function register(): void - { - $cloner = new VarCloner(); - $cloner->addCasters(ReflectionCaster::UNSET_CLOSURE_FILE_INFO); - - $format = $_SERVER['VAR_DUMPER_FORMAT'] ?? null; - switch (true) { - case 'html' === $format: - $dumper = new HtmlDumper(); - break; - case 'cli' === $format: - $dumper = new CliDumper(); - break; - case 'server' === $format: - case $format && 'tcp' === parse_url($format, \PHP_URL_SCHEME): - $host = 'server' === $format ? $_SERVER['VAR_DUMPER_SERVER'] ?? '127.0.0.1:9912' : $format; - $dumper = \in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) ? new CliDumper() : new HtmlDumper(); - $dumper = new ServerDumper($host, $dumper, self::getDefaultContextProviders()); - break; - default: - $dumper = \in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) ? new CliDumper() : new HtmlDumper(); - } - - if (!$dumper instanceof ServerDumper) { - $dumper = new ContextualizedDumper($dumper, [new SourceContextProvider()]); - } - - self::$handler = function ($var) use ($cloner, $dumper) { - $dumper->dump($cloner->cloneVar($var)); - }; - } - - private static function getDefaultContextProviders(): array - { - $contextProviders = []; - - if (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) && class_exists(Request::class)) { - $requestStack = new RequestStack(); - $requestStack->push(Request::createFromGlobals()); - $contextProviders['request'] = new RequestContextProvider($requestStack); - } - - $fileLinkFormatter = class_exists(FileLinkFormatter::class) ? new FileLinkFormatter(null, $requestStack ?? null) : null; - - return $contextProviders + [ - 'cli' => new CliContextProvider(), - 'source' => new SourceContextProvider(null, null, $fileLinkFormatter), - ]; - } -} diff --git a/vendor/symfony/var-dumper/composer.json b/vendor/symfony/var-dumper/composer.json deleted file mode 100644 index 71ec64c0..00000000 --- a/vendor/symfony/var-dumper/composer.json +++ /dev/null @@ -1,49 +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": ">=8.1", - "symfony/polyfill-mbstring": "~1.0" - }, - "require-dev": { - "ext-iconv": "*", - "symfony/console": "^5.4|^6.0", - "symfony/process": "^5.4|^6.0", - "symfony/uid": "^5.4|^6.0", - "twig/twig": "^2.13|^3.0.4" - }, - "conflict": { - "phpunit/phpunit": "<5.4.3", - "symfony/console": "<5.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/yaml/CHANGELOG.md b/vendor/symfony/yaml/CHANGELOG.md deleted file mode 100644 index 50852cb1..00000000 --- a/vendor/symfony/yaml/CHANGELOG.md +++ /dev/null @@ -1,248 +0,0 @@ -CHANGELOG -========= - -6.2 ---- - - * Add support for `!php/enum` and `!php/enum *->value` - * Deprecate the `!php/const:` tag in key which will be replaced by the `!php/const` tag (without the colon) since 3.4 - -6.1 ---- - - * In cases where it will likely improve readability, strings containing single quotes will be double-quoted - -5.4 ---- - - * Add new `lint:yaml dirname --exclude=/dirname/foo.yaml --exclude=/dirname/bar.yaml` - option to exclude one or more specific files from multiple file list - * Allow negatable for the parse tags option with `--no-parse-tags` - -5.3 ---- - - * Added `github` format support & autodetection to render errors as annotations - when running the YAML linter command in a Github Action environment. - -5.1.0 ------ - - * Added support for parsing numbers prefixed with `0o` as octal numbers. - * Deprecated support for parsing numbers starting with `0` as octal numbers. They will be parsed as strings as of Symfony 6.0. Prefix numbers with `0o` - so that they are parsed as octal numbers. - - Before: - - ```yaml - Yaml::parse('072'); - ``` - - After: - - ```yaml - Yaml::parse('0o72'); - ``` - - * Added `yaml-lint` binary. - * Deprecated using the `!php/object` and `!php/const` tags without a value. - -5.0.0 ------ - - * Removed support for mappings inside multi-line strings. - * removed support for implicit STDIN usage in the `lint:yaml` command, use `lint:yaml -` (append a dash) instead to make it explicit. - -4.4.0 ------ - - * Added support for parsing the inline notation spanning multiple lines. - * Added support to dump `null` as `~` by using the `Yaml::DUMP_NULL_AS_TILDE` flag. - * deprecated accepting STDIN implicitly when using the `lint:yaml` command, use `lint:yaml -` (append a dash) instead to make it explicit. - -4.3.0 ------ - - * Using a mapping inside a multi-line string is deprecated and will throw a `ParseException` in 5.0. - -4.2.0 ------ - - * added support for multiple files or directories in `LintCommand` - -4.0.0 ------ - - * The behavior of the non-specific tag `!` is changed and now forces - non-evaluating your values. - * complex mappings will throw a `ParseException` - * support for the comma as a group separator for floats has been dropped, use - the underscore instead - * support for the `!!php/object` tag has been dropped, use the `!php/object` - tag instead - * duplicate mapping keys throw a `ParseException` - * non-string mapping keys throw a `ParseException`, use the `Yaml::PARSE_KEYS_AS_STRINGS` - flag to cast them to strings - * `%` at the beginning of an unquoted string throw a `ParseException` - * mappings with a colon (`:`) that is not followed by a whitespace throw a - `ParseException` - * the `Dumper::setIndentation()` method has been removed - * being able to pass boolean options to the `Yaml::parse()`, `Yaml::dump()`, - `Parser::parse()`, and `Dumper::dump()` methods to configure the behavior of - the parser and dumper is no longer supported, pass bitmask flags instead - * the constructor arguments of the `Parser` class have been removed - * the `Inline` class is internal and no longer part of the BC promise - * removed support for the `!str` tag, use the `!!str` tag instead - * added support for tagged scalars. - - ```yml - Yaml::parse('!foo bar', Yaml::PARSE_CUSTOM_TAGS); - // returns TaggedValue('foo', 'bar'); - ``` - -3.4.0 ------ - - * added support for parsing YAML files using the `Yaml::parseFile()` or `Parser::parseFile()` method - - * the `Dumper`, `Parser`, and `Yaml` classes are marked as final - - * Deprecated the `!php/object:` tag which will be replaced by the - `!php/object` tag (without the colon) in 4.0. - - * Deprecated the `!php/const:` tag which will be replaced by the - `!php/const` tag (without the colon) in 4.0. - - * Support for the `!str` tag is deprecated, use the `!!str` tag instead. - - * Deprecated using the non-specific tag `!` as its behavior will change in 4.0. - It will force non-evaluating your values in 4.0. Use plain integers or `!!float` instead. - -3.3.0 ------ - - * Starting an unquoted string with a question mark followed by a space is - deprecated and will throw a `ParseException` in Symfony 4.0. - - * Deprecated support for implicitly parsing non-string mapping keys as strings. - Mapping keys that are no strings will lead to a `ParseException` in Symfony - 4.0. Use quotes to opt-in for keys to be parsed as strings. - - Before: - - ```php - $yaml = << new A(), 'bar' => 1], 0, 0, Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE | Yaml::DUMP_OBJECT); - ``` - -3.0.0 ------ - - * Yaml::parse() now throws an exception when a blackslash is not escaped - in double-quoted strings - -2.8.0 ------ - - * Deprecated usage of a colon in an unquoted mapping value - * Deprecated usage of @, \`, | and > at the beginning of an unquoted string - * When surrounding strings with double-quotes, you must now escape `\` characters. Not - escaping those characters (when surrounded by double-quotes) is deprecated. - - Before: - - ```yml - class: "Foo\Var" - ``` - - After: - - ```yml - class: "Foo\\Var" - ``` - -2.1.0 ------ - - * Yaml::parse() does not evaluate loaded files as PHP files by default - anymore (call Yaml::enablePhpParsing() to get back the old behavior) diff --git a/vendor/symfony/yaml/Command/LintCommand.php b/vendor/symfony/yaml/Command/LintCommand.php deleted file mode 100644 index 19a0af08..00000000 --- a/vendor/symfony/yaml/Command/LintCommand.php +++ /dev/null @@ -1,276 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Yaml\Command; - -use Symfony\Component\Console\Attribute\AsCommand; -use Symfony\Component\Console\CI\GithubActionReporter; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\RuntimeException; -use Symfony\Component\Console\Input\InputArgument; -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\Yaml\Exception\ParseException; -use Symfony\Component\Yaml\Parser; -use Symfony\Component\Yaml\Yaml; - -/** - * Validates YAML files syntax and outputs encountered errors. - * - * @author Grégoire Pineau - * @author Robin Chalas - */ -#[AsCommand(name: 'lint:yaml', description: 'Lint a YAML file and outputs encountered errors')] -class LintCommand extends Command -{ - private Parser $parser; - private ?string $format = null; - private bool $displayCorrectFiles; - private ?\Closure $directoryIteratorProvider; - private ?\Closure $isReadableProvider; - - public function __construct(string $name = null, callable $directoryIteratorProvider = null, callable $isReadableProvider = null) - { - parent::__construct($name); - - $this->directoryIteratorProvider = null === $directoryIteratorProvider ? null : $directoryIteratorProvider(...); - $this->isReadableProvider = null === $isReadableProvider ? null : $isReadableProvider(...); - } - - protected function configure() - { - $this - ->addArgument('filename', InputArgument::IS_ARRAY, 'A file, a directory or "-" for reading from STDIN') - ->addOption('format', null, InputOption::VALUE_REQUIRED, 'The output format') - ->addOption('exclude', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Path(s) to exclude') - ->addOption('parse-tags', null, InputOption::VALUE_NEGATABLE, 'Parse custom tags', null) - ->setHelp(<<%command.name%
      command lints a YAML file and outputs to STDOUT -the first encountered syntax error. - -You can validates YAML contents passed from STDIN: - - cat filename | php %command.full_name% - - -You can also validate the syntax of a file: - - php %command.full_name% filename - -Or of a whole directory: - - php %command.full_name% dirname - php %command.full_name% dirname --format=json - -You can also exclude one or more specific files: - - php %command.full_name% dirname --exclude="dirname/foo.yaml" --exclude="dirname/bar.yaml" - -EOF - ) - ; - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $io = new SymfonyStyle($input, $output); - $filenames = (array) $input->getArgument('filename'); - $excludes = $input->getOption('exclude'); - $this->format = $input->getOption('format'); - $flags = $input->getOption('parse-tags'); - - if ('github' === $this->format && !class_exists(GithubActionReporter::class)) { - throw new \InvalidArgumentException('The "github" format is only available since "symfony/console" >= 5.3.'); - } - - if (null === $this->format) { - // Autodetect format according to CI environment - $this->format = class_exists(GithubActionReporter::class) && GithubActionReporter::isGithubActionEnvironment() ? 'github' : 'txt'; - } - - $flags = $flags ? Yaml::PARSE_CUSTOM_TAGS : 0; - - $this->displayCorrectFiles = $output->isVerbose(); - - if (['-'] === $filenames) { - return $this->display($io, [$this->validate(file_get_contents('php://stdin'), $flags)]); - } - - if (!$filenames) { - throw new RuntimeException('Please provide a filename or pipe file content to STDIN.'); - } - - $filesInfo = []; - foreach ($filenames as $filename) { - if (!$this->isReadable($filename)) { - throw new RuntimeException(sprintf('File or directory "%s" is not readable.', $filename)); - } - - foreach ($this->getFiles($filename) as $file) { - if (!\in_array($file->getPathname(), $excludes, true)) { - $filesInfo[] = $this->validate(file_get_contents($file), $flags, $file); - } - } - } - - return $this->display($io, $filesInfo); - } - - private function validate(string $content, int $flags, string $file = null) - { - $prevErrorHandler = set_error_handler(function ($level, $message, $file, $line) use (&$prevErrorHandler) { - if (\E_USER_DEPRECATED === $level) { - throw new ParseException($message, $this->getParser()->getRealCurrentLineNb() + 1); - } - - return $prevErrorHandler ? $prevErrorHandler($level, $message, $file, $line) : false; - }); - - try { - $this->getParser()->parse($content, Yaml::PARSE_CONSTANT | $flags); - } catch (ParseException $e) { - return ['file' => $file, 'line' => $e->getParsedLine(), 'valid' => false, 'message' => $e->getMessage()]; - } finally { - restore_error_handler(); - } - - return ['file' => $file, 'valid' => true]; - } - - private function display(SymfonyStyle $io, array $files): int - { - return match ($this->format) { - 'txt' => $this->displayTxt($io, $files), - 'json' => $this->displayJson($io, $files), - 'github' => $this->displayTxt($io, $files, true), - default => throw new InvalidArgumentException(sprintf('The format "%s" is not supported.', $this->format)), - }; - } - - private function displayTxt(SymfonyStyle $io, array $filesInfo, bool $errorAsGithubAnnotations = false): int - { - $countFiles = \count($filesInfo); - $erroredFiles = 0; - $suggestTagOption = false; - - if ($errorAsGithubAnnotations) { - $githubReporter = new GithubActionReporter($io); - } - - foreach ($filesInfo as $info) { - if ($info['valid'] && $this->displayCorrectFiles) { - $io->comment('OK'.($info['file'] ? sprintf(' in %s', $info['file']) : '')); - } elseif (!$info['valid']) { - ++$erroredFiles; - $io->text(' ERROR '.($info['file'] ? sprintf(' in %s', $info['file']) : '')); - $io->text(sprintf(' >> %s', $info['message'])); - - if (str_contains($info['message'], 'PARSE_CUSTOM_TAGS')) { - $suggestTagOption = true; - } - - if ($errorAsGithubAnnotations) { - $githubReporter->error($info['message'], $info['file'] ?? 'php://stdin', $info['line']); - } - } - } - - if (0 === $erroredFiles) { - $io->success(sprintf('All %d YAML files contain valid syntax.', $countFiles)); - } else { - $io->warning(sprintf('%d YAML files have valid syntax and %d contain errors.%s', $countFiles - $erroredFiles, $erroredFiles, $suggestTagOption ? ' Use the --parse-tags option if you want parse custom tags.' : '')); - } - - return min($erroredFiles, 1); - } - - private function displayJson(SymfonyStyle $io, array $filesInfo): int - { - $errors = 0; - - array_walk($filesInfo, function (&$v) use (&$errors) { - $v['file'] = (string) $v['file']; - if (!$v['valid']) { - ++$errors; - } - - if (isset($v['message']) && str_contains($v['message'], 'PARSE_CUSTOM_TAGS')) { - $v['message'] .= ' Use the --parse-tags option if you want parse custom tags.'; - } - }); - - $io->writeln(json_encode($filesInfo, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES)); - - return min($errors, 1); - } - - private function getFiles(string $fileOrDirectory): iterable - { - if (is_file($fileOrDirectory)) { - yield new \SplFileInfo($fileOrDirectory); - - return; - } - - foreach ($this->getDirectoryIterator($fileOrDirectory) as $file) { - if (!\in_array($file->getExtension(), ['yml', 'yaml'])) { - continue; - } - - yield $file; - } - } - - private function getParser(): Parser - { - return $this->parser ??= new Parser(); - } - - private function getDirectoryIterator(string $directory): iterable - { - $default = function ($directory) { - return new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($directory, \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS), - \RecursiveIteratorIterator::LEAVES_ONLY - ); - }; - - if (null !== $this->directoryIteratorProvider) { - return ($this->directoryIteratorProvider)($directory, $default); - } - - return $default($directory); - } - - private function isReadable(string $fileOrDirectory): bool - { - $default = function ($fileOrDirectory) { - return is_readable($fileOrDirectory); - }; - - if (null !== $this->isReadableProvider) { - return ($this->isReadableProvider)($fileOrDirectory, $default); - } - - return $default($fileOrDirectory); - } - - public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void - { - if ($input->mustSuggestOptionValuesFor('format')) { - $suggestions->suggestValues(['txt', 'json', 'github']); - } - } -} diff --git a/vendor/symfony/yaml/Dumper.php b/vendor/symfony/yaml/Dumper.php deleted file mode 100644 index 205da6fd..00000000 --- a/vendor/symfony/yaml/Dumper.php +++ /dev/null @@ -1,164 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Yaml; - -use Symfony\Component\Yaml\Tag\TaggedValue; - -/** - * Dumper dumps PHP variables to YAML strings. - * - * @author Fabien Potencier - * - * @final - */ -class Dumper -{ - /** - * The amount of spaces to use for indentation of nested nodes. - */ - private int $indentation; - - public function __construct(int $indentation = 4) - { - if ($indentation < 1) { - throw new \InvalidArgumentException('The indentation must be greater than zero.'); - } - - $this->indentation = $indentation; - } - - /** - * Dumps a PHP value to YAML. - * - * @param mixed $input The PHP value - * @param int $inline The level where you switch to inline YAML - * @param int $indent The level of indentation (used internally) - * @param int $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string - */ - public function dump(mixed $input, int $inline = 0, int $indent = 0, int $flags = 0): string - { - $output = ''; - $prefix = $indent ? str_repeat(' ', $indent) : ''; - $dumpObjectAsInlineMap = true; - - if (Yaml::DUMP_OBJECT_AS_MAP & $flags && ($input instanceof \ArrayObject || $input instanceof \stdClass)) { - $dumpObjectAsInlineMap = empty((array) $input); - } - - if ($inline <= 0 || (!\is_array($input) && !$input instanceof TaggedValue && $dumpObjectAsInlineMap) || empty($input)) { - $output .= $prefix.Inline::dump($input, $flags); - } elseif ($input instanceof TaggedValue) { - $output .= $this->dumpTaggedValue($input, $inline, $indent, $flags, $prefix); - } else { - $dumpAsMap = Inline::isHash($input); - - foreach ($input as $key => $value) { - if ('' !== $output && "\n" !== $output[-1]) { - $output .= "\n"; - } - - if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value) && str_contains($value, "\n") && !str_contains($value, "\r")) { - // If the first line starts with a space character, the spec requires a blockIndicationIndicator - // http://www.yaml.org/spec/1.2/spec.html#id2793979 - $blockIndentationIndicator = str_starts_with($value, ' ') ? (string) $this->indentation : ''; - - if (isset($value[-2]) && "\n" === $value[-2] && "\n" === $value[-1]) { - $blockChompingIndicator = '+'; - } elseif ("\n" === $value[-1]) { - $blockChompingIndicator = ''; - } else { - $blockChompingIndicator = '-'; - } - - $output .= sprintf('%s%s%s |%s%s', $prefix, $dumpAsMap ? Inline::dump($key, $flags).':' : '-', '', $blockIndentationIndicator, $blockChompingIndicator); - - foreach (explode("\n", $value) as $row) { - if ('' === $row) { - $output .= "\n"; - } else { - $output .= sprintf("\n%s%s%s", $prefix, str_repeat(' ', $this->indentation), $row); - } - } - - continue; - } - - if ($value instanceof TaggedValue) { - $output .= sprintf('%s%s !%s', $prefix, $dumpAsMap ? Inline::dump($key, $flags).':' : '-', $value->getTag()); - - if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value->getValue()) && str_contains($value->getValue(), "\n") && !str_contains($value->getValue(), "\r\n")) { - // If the first line starts with a space character, the spec requires a blockIndicationIndicator - // http://www.yaml.org/spec/1.2/spec.html#id2793979 - $blockIndentationIndicator = str_starts_with($value->getValue(), ' ') ? (string) $this->indentation : ''; - $output .= sprintf(' |%s', $blockIndentationIndicator); - - foreach (explode("\n", $value->getValue()) as $row) { - $output .= sprintf("\n%s%s%s", $prefix, str_repeat(' ', $this->indentation), $row); - } - - continue; - } - - if ($inline - 1 <= 0 || null === $value->getValue() || \is_scalar($value->getValue())) { - $output .= ' '.$this->dump($value->getValue(), $inline - 1, 0, $flags)."\n"; - } else { - $output .= "\n"; - $output .= $this->dump($value->getValue(), $inline - 1, $dumpAsMap ? $indent + $this->indentation : $indent + 2, $flags); - } - - continue; - } - - $dumpObjectAsInlineMap = true; - - if (Yaml::DUMP_OBJECT_AS_MAP & $flags && ($value instanceof \ArrayObject || $value instanceof \stdClass)) { - $dumpObjectAsInlineMap = empty((array) $value); - } - - $willBeInlined = $inline - 1 <= 0 || !\is_array($value) && $dumpObjectAsInlineMap || empty($value); - - $output .= sprintf('%s%s%s%s', - $prefix, - $dumpAsMap ? Inline::dump($key, $flags).':' : '-', - $willBeInlined ? ' ' : "\n", - $this->dump($value, $inline - 1, $willBeInlined ? 0 : $indent + $this->indentation, $flags) - ).($willBeInlined ? "\n" : ''); - } - } - - return $output; - } - - private function dumpTaggedValue(TaggedValue $value, int $inline, int $indent, int $flags, string $prefix): string - { - $output = sprintf('%s!%s', $prefix ? $prefix.' ' : '', $value->getTag()); - - if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value->getValue()) && false !== strpos($value->getValue(), "\n") && false === strpos($value->getValue(), "\r\n")) { - // If the first line starts with a space character, the spec requires a blockIndicationIndicator - // http://www.yaml.org/spec/1.2/spec.html#id2793979 - $blockIndentationIndicator = (' ' === substr($value->getValue(), 0, 1)) ? (string) $this->indentation : ''; - $output .= sprintf(' |%s', $blockIndentationIndicator); - - foreach (explode("\n", $value->getValue()) as $row) { - $output .= sprintf("\n%s%s%s", $prefix, str_repeat(' ', $this->indentation), $row); - } - - return $output; - } - - if ($inline - 1 <= 0 || null === $value->getValue() || \is_scalar($value->getValue())) { - return $output.' '.$this->dump($value->getValue(), $inline - 1, 0, $flags)."\n"; - } - - return $output."\n".$this->dump($value->getValue(), $inline - 1, $indent, $flags); - } -} diff --git a/vendor/symfony/yaml/Escaper.php b/vendor/symfony/yaml/Escaper.php deleted file mode 100644 index e8090d8c..00000000 --- a/vendor/symfony/yaml/Escaper.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\Yaml; - -/** - * Escaper encapsulates escaping rules for single and double-quoted - * YAML strings. - * - * @author Matthew Lewinski - * - * @internal - */ -class Escaper -{ - // Characters that would cause a dumped string to require double quoting. - public const REGEX_CHARACTER_TO_ESCAPE = "[\\x00-\\x1f]|\x7f|\xc2\x85|\xc2\xa0|\xe2\x80\xa8|\xe2\x80\xa9"; - - // Mapping arrays for escaping a double quoted string. The backslash is - // first to ensure proper escaping because str_replace operates iteratively - // on the input arrays. This ordering of the characters avoids the use of strtr, - // which performs more slowly. - private const ESCAPEES = ['\\', '\\\\', '\\"', '"', - "\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", - "\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f", - "\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", - "\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f", - "\x7f", - "\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9", - ]; - private const ESCAPED = ['\\\\', '\\"', '\\\\', '\\"', - '\\0', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\a', - '\\b', '\\t', '\\n', '\\v', '\\f', '\\r', '\\x0e', '\\x0f', - '\\x10', '\\x11', '\\x12', '\\x13', '\\x14', '\\x15', '\\x16', '\\x17', - '\\x18', '\\x19', '\\x1a', '\\e', '\\x1c', '\\x1d', '\\x1e', '\\x1f', - '\\x7f', - '\\N', '\\_', '\\L', '\\P', - ]; - - /** - * Determines if a PHP value would require double quoting in YAML. - * - * @param string $value A PHP value - */ - public static function requiresDoubleQuoting(string $value): bool - { - return 0 < preg_match('/'.self::REGEX_CHARACTER_TO_ESCAPE.'/u', $value); - } - - /** - * Escapes and surrounds a PHP value with double quotes. - * - * @param string $value A PHP value - */ - public static function escapeWithDoubleQuotes(string $value): string - { - return sprintf('"%s"', str_replace(self::ESCAPEES, self::ESCAPED, $value)); - } - - /** - * Determines if a PHP value would require single quoting in YAML. - * - * @param string $value A PHP value - */ - public static function requiresSingleQuoting(string $value): bool - { - // Determines if a PHP value is entirely composed of a value that would - // require single quoting in YAML. - if (\in_array(strtolower($value), ['null', '~', 'true', 'false', 'y', 'n', 'yes', 'no', 'on', 'off'])) { - return true; - } - - // Determines if the PHP value contains any single characters that would - // cause it to require single quoting in YAML. - return 0 < preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \# \?] | \A[ \- ? | < > = ! % @ ` \p{Zs}]/xu', $value); - } - - /** - * Escapes and surrounds a PHP value with single quotes. - * - * @param string $value A PHP value - */ - public static function escapeWithSingleQuotes(string $value): string - { - return sprintf("'%s'", str_replace('\'', '\'\'', $value)); - } -} diff --git a/vendor/symfony/yaml/Exception/DumpException.php b/vendor/symfony/yaml/Exception/DumpException.php deleted file mode 100644 index cce972f2..00000000 --- a/vendor/symfony/yaml/Exception/DumpException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Yaml\Exception; - -/** - * Exception class thrown when an error occurs during dumping. - * - * @author Fabien Potencier - */ -class DumpException extends RuntimeException -{ -} diff --git a/vendor/symfony/yaml/Exception/ExceptionInterface.php b/vendor/symfony/yaml/Exception/ExceptionInterface.php deleted file mode 100644 index 90913168..00000000 --- a/vendor/symfony/yaml/Exception/ExceptionInterface.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Yaml\Exception; - -/** - * Exception interface for all exceptions thrown by the component. - * - * @author Fabien Potencier - */ -interface ExceptionInterface extends \Throwable -{ -} diff --git a/vendor/symfony/yaml/Exception/ParseException.php b/vendor/symfony/yaml/Exception/ParseException.php deleted file mode 100644 index 07c59b96..00000000 --- a/vendor/symfony/yaml/Exception/ParseException.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\Yaml\Exception; - -/** - * Exception class thrown when an error occurs during parsing. - * - * @author Fabien Potencier - */ -class ParseException extends RuntimeException -{ - private ?string $parsedFile; - private int $parsedLine; - private ?string $snippet; - private string $rawMessage; - - /** - * @param string $message The error message - * @param int $parsedLine The line where the error occurred - * @param string|null $snippet The snippet of code near the problem - * @param string|null $parsedFile The file name where the error occurred - */ - public function __construct(string $message, int $parsedLine = -1, string $snippet = null, string $parsedFile = null, \Throwable $previous = null) - { - $this->parsedFile = $parsedFile; - $this->parsedLine = $parsedLine; - $this->snippet = $snippet; - $this->rawMessage = $message; - - $this->updateRepr(); - - parent::__construct($this->message, 0, $previous); - } - - /** - * Gets the snippet of code near the error. - */ - public function getSnippet(): string - { - return $this->snippet; - } - - /** - * Sets the snippet of code near the error. - */ - public function setSnippet(string $snippet) - { - $this->snippet = $snippet; - - $this->updateRepr(); - } - - /** - * Gets the filename where the error occurred. - * - * This method returns null if a string is parsed. - */ - public function getParsedFile(): string - { - return $this->parsedFile; - } - - /** - * Sets the filename where the error occurred. - */ - public function setParsedFile(string $parsedFile) - { - $this->parsedFile = $parsedFile; - - $this->updateRepr(); - } - - /** - * Gets the line where the error occurred. - */ - public function getParsedLine(): int - { - return $this->parsedLine; - } - - /** - * Sets the line where the error occurred. - */ - public function setParsedLine(int $parsedLine) - { - $this->parsedLine = $parsedLine; - - $this->updateRepr(); - } - - private function updateRepr() - { - $this->message = $this->rawMessage; - - $dot = false; - if (str_ends_with($this->message, '.')) { - $this->message = substr($this->message, 0, -1); - $dot = true; - } - - if (null !== $this->parsedFile) { - $this->message .= sprintf(' in %s', json_encode($this->parsedFile, \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE)); - } - - if ($this->parsedLine >= 0) { - $this->message .= sprintf(' at line %d', $this->parsedLine); - } - - if ($this->snippet) { - $this->message .= sprintf(' (near "%s")', $this->snippet); - } - - if ($dot) { - $this->message .= '.'; - } - } -} diff --git a/vendor/symfony/yaml/Exception/RuntimeException.php b/vendor/symfony/yaml/Exception/RuntimeException.php deleted file mode 100644 index 3f36b73b..00000000 --- a/vendor/symfony/yaml/Exception/RuntimeException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Yaml\Exception; - -/** - * Exception class thrown when an error occurs during parsing. - * - * @author Romain Neutron - */ -class RuntimeException extends \RuntimeException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/yaml/Inline.php b/vendor/symfony/yaml/Inline.php deleted file mode 100644 index 02cbe8c9..00000000 --- a/vendor/symfony/yaml/Inline.php +++ /dev/null @@ -1,816 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Yaml; - -use Symfony\Component\Yaml\Exception\DumpException; -use Symfony\Component\Yaml\Exception\ParseException; -use Symfony\Component\Yaml\Tag\TaggedValue; - -/** - * Inline implements a YAML parser/dumper for the YAML inline syntax. - * - * @author Fabien Potencier - * - * @internal - */ -class Inline -{ - public const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*+(?:\\\\.[^"\\\\]*+)*+)"|\'([^\']*+(?:\'\'[^\']*+)*+)\')'; - - public static int $parsedLineNumber = -1; - public static ?string $parsedFilename = null; - - private static bool $exceptionOnInvalidType = false; - private static bool $objectSupport = false; - private static bool $objectForMap = false; - private static bool $constantSupport = false; - - public static function initialize(int $flags, int $parsedLineNumber = null, string $parsedFilename = null) - { - self::$exceptionOnInvalidType = (bool) (Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE & $flags); - self::$objectSupport = (bool) (Yaml::PARSE_OBJECT & $flags); - self::$objectForMap = (bool) (Yaml::PARSE_OBJECT_FOR_MAP & $flags); - self::$constantSupport = (bool) (Yaml::PARSE_CONSTANT & $flags); - self::$parsedFilename = $parsedFilename; - - if (null !== $parsedLineNumber) { - self::$parsedLineNumber = $parsedLineNumber; - } - } - - /** - * Converts a YAML string to a PHP value. - * - * @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior - * @param array $references Mapping of variable names to values - * - * @throws ParseException - */ - public static function parse(string $value = null, int $flags = 0, array &$references = []): mixed - { - self::initialize($flags); - - $value = trim($value); - - if ('' === $value) { - return ''; - } - - $i = 0; - $tag = self::parseTag($value, $i, $flags); - switch ($value[$i]) { - case '[': - $result = self::parseSequence($value, $flags, $i, $references); - ++$i; - break; - case '{': - $result = self::parseMapping($value, $flags, $i, $references); - ++$i; - break; - default: - $result = self::parseScalar($value, $flags, null, $i, true, $references); - } - - // some comments are allowed at the end - if (preg_replace('/\s*#.*$/A', '', substr($value, $i))) { - throw new ParseException(sprintf('Unexpected characters near "%s".', substr($value, $i)), self::$parsedLineNumber + 1, $value, self::$parsedFilename); - } - - if (null !== $tag && '' !== $tag) { - return new TaggedValue($tag, $result); - } - - return $result; - } - - /** - * Dumps a given PHP variable to a YAML string. - * - * @param mixed $value The PHP variable to convert - * @param int $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string - * - * @throws DumpException When trying to dump PHP resource - */ - public static function dump(mixed $value, int $flags = 0): string - { - switch (true) { - case \is_resource($value): - if (Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE & $flags) { - throw new DumpException(sprintf('Unable to dump PHP resources in a YAML file ("%s").', get_resource_type($value))); - } - - return self::dumpNull($flags); - case $value instanceof \DateTimeInterface: - return $value->format('c'); - case $value instanceof \UnitEnum: - return sprintf('!php/const %s::%s', $value::class, $value->name); - case \is_object($value): - if ($value instanceof TaggedValue) { - return '!'.$value->getTag().' '.self::dump($value->getValue(), $flags); - } - - if (Yaml::DUMP_OBJECT & $flags) { - return '!php/object '.self::dump(serialize($value)); - } - - if (Yaml::DUMP_OBJECT_AS_MAP & $flags && ($value instanceof \stdClass || $value instanceof \ArrayObject)) { - return self::dumpHashArray($value, $flags); - } - - if (Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE & $flags) { - throw new DumpException('Object support when dumping a YAML file has been disabled.'); - } - - return self::dumpNull($flags); - case \is_array($value): - return self::dumpArray($value, $flags); - case null === $value: - return self::dumpNull($flags); - case true === $value: - return 'true'; - case false === $value: - return 'false'; - case \is_int($value): - return $value; - case is_numeric($value) && false === strpbrk($value, "\f\n\r\t\v"): - $locale = setlocale(\LC_NUMERIC, 0); - if (false !== $locale) { - setlocale(\LC_NUMERIC, 'C'); - } - if (\is_float($value)) { - $repr = (string) $value; - if (is_infinite($value)) { - $repr = str_ireplace('INF', '.Inf', $repr); - } elseif (floor($value) == $value && $repr == $value) { - // Preserve float data type since storing a whole number will result in integer value. - if (!str_contains($repr, 'E')) { - $repr = $repr.'.0'; - } - } - } else { - $repr = \is_string($value) ? "'$value'" : (string) $value; - } - if (false !== $locale) { - setlocale(\LC_NUMERIC, $locale); - } - - return $repr; - case '' == $value: - return "''"; - case self::isBinaryString($value): - return '!!binary '.base64_encode($value); - case Escaper::requiresDoubleQuoting($value): - return Escaper::escapeWithDoubleQuotes($value); - case Escaper::requiresSingleQuoting($value): - $singleQuoted = Escaper::escapeWithSingleQuotes($value); - if (!str_contains($value, "'")) { - return $singleQuoted; - } - // Attempt double-quoting the string instead to see if it's more efficient. - $doubleQuoted = Escaper::escapeWithDoubleQuotes($value); - - return \strlen($doubleQuoted) < \strlen($singleQuoted) ? $doubleQuoted : $singleQuoted; - case Parser::preg_match('{^[0-9]+[_0-9]*$}', $value): - case Parser::preg_match(self::getHexRegex(), $value): - case Parser::preg_match(self::getTimestampRegex(), $value): - return Escaper::escapeWithSingleQuotes($value); - default: - return $value; - } - } - - /** - * Check if given array is hash or just normal indexed array. - */ - public static function isHash(array|\ArrayObject|\stdClass $value): bool - { - if ($value instanceof \stdClass || $value instanceof \ArrayObject) { - return true; - } - - $expectedKey = 0; - - foreach ($value as $key => $val) { - if ($key !== $expectedKey++) { - return true; - } - } - - return false; - } - - /** - * Dumps a PHP array to a YAML string. - * - * @param array $value The PHP array to dump - * @param int $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string - */ - private static function dumpArray(array $value, int $flags): string - { - // array - if (($value || Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE & $flags) && !self::isHash($value)) { - $output = []; - foreach ($value as $val) { - $output[] = self::dump($val, $flags); - } - - return sprintf('[%s]', implode(', ', $output)); - } - - return self::dumpHashArray($value, $flags); - } - - /** - * Dumps hash array to a YAML string. - * - * @param array|\ArrayObject|\stdClass $value The hash array to dump - * @param int $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string - */ - private static function dumpHashArray(array|\ArrayObject|\stdClass $value, int $flags): string - { - $output = []; - foreach ($value as $key => $val) { - $output[] = sprintf('%s: %s', self::dump($key, $flags), self::dump($val, $flags)); - } - - return sprintf('{ %s }', implode(', ', $output)); - } - - private static function dumpNull(int $flags): string - { - if (Yaml::DUMP_NULL_AS_TILDE & $flags) { - return '~'; - } - - return 'null'; - } - - /** - * Parses a YAML scalar. - * - * @throws ParseException When malformed inline YAML string is parsed - */ - public static function parseScalar(string $scalar, int $flags = 0, array $delimiters = null, int &$i = 0, bool $evaluate = true, array &$references = [], bool &$isQuoted = null): mixed - { - if (\in_array($scalar[$i], ['"', "'"], true)) { - // quoted scalar - $isQuoted = true; - $output = self::parseQuotedScalar($scalar, $i); - - if (null !== $delimiters) { - $tmp = ltrim(substr($scalar, $i), " \n"); - if ('' === $tmp) { - throw new ParseException(sprintf('Unexpected end of line, expected one of "%s".', implode('', $delimiters)), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); - } - if (!\in_array($tmp[0], $delimiters)) { - throw new ParseException(sprintf('Unexpected characters (%s).', substr($scalar, $i)), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); - } - } - } else { - // "normal" string - $isQuoted = false; - - if (!$delimiters) { - $output = substr($scalar, $i); - $i += \strlen($output); - - // remove comments - if (Parser::preg_match('/[ \t]+#/', $output, $match, \PREG_OFFSET_CAPTURE)) { - $output = substr($output, 0, $match[0][1]); - } - } elseif (Parser::preg_match('/^(.*?)('.implode('|', $delimiters).')/', substr($scalar, $i), $match)) { - $output = $match[1]; - $i += \strlen($output); - $output = trim($output); - } else { - throw new ParseException(sprintf('Malformed inline YAML string: "%s".', $scalar), self::$parsedLineNumber + 1, null, self::$parsedFilename); - } - - // a non-quoted string cannot start with @ or ` (reserved) nor with a scalar indicator (| or >) - if ($output && ('@' === $output[0] || '`' === $output[0] || '|' === $output[0] || '>' === $output[0] || '%' === $output[0])) { - throw new ParseException(sprintf('The reserved indicator "%s" cannot start a plain scalar; you need to quote the scalar.', $output[0]), self::$parsedLineNumber + 1, $output, self::$parsedFilename); - } - - if ($evaluate) { - $output = self::evaluateScalar($output, $flags, $references, $isQuoted); - } - } - - return $output; - } - - /** - * Parses a YAML quoted scalar. - * - * @throws ParseException When malformed inline YAML string is parsed - */ - private static function parseQuotedScalar(string $scalar, int &$i = 0): string - { - if (!Parser::preg_match('/'.self::REGEX_QUOTED_STRING.'/Au', substr($scalar, $i), $match)) { - throw new ParseException(sprintf('Malformed inline YAML string: "%s".', substr($scalar, $i)), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); - } - - $output = substr($match[0], 1, -1); - - $unescaper = new Unescaper(); - if ('"' == $scalar[$i]) { - $output = $unescaper->unescapeDoubleQuotedString($output); - } else { - $output = $unescaper->unescapeSingleQuotedString($output); - } - - $i += \strlen($match[0]); - - return $output; - } - - /** - * Parses a YAML sequence. - * - * @throws ParseException When malformed inline YAML string is parsed - */ - private static function parseSequence(string $sequence, int $flags, int &$i = 0, array &$references = []): array - { - $output = []; - $len = \strlen($sequence); - ++$i; - - // [foo, bar, ...] - while ($i < $len) { - if (']' === $sequence[$i]) { - return $output; - } - if (',' === $sequence[$i] || ' ' === $sequence[$i]) { - ++$i; - - continue; - } - - $tag = self::parseTag($sequence, $i, $flags); - switch ($sequence[$i]) { - case '[': - // nested sequence - $value = self::parseSequence($sequence, $flags, $i, $references); - break; - case '{': - // nested mapping - $value = self::parseMapping($sequence, $flags, $i, $references); - break; - default: - $value = self::parseScalar($sequence, $flags, [',', ']'], $i, null === $tag, $references, $isQuoted); - - // the value can be an array if a reference has been resolved to an array var - if (\is_string($value) && !$isQuoted && str_contains($value, ': ')) { - // embedded mapping? - try { - $pos = 0; - $value = self::parseMapping('{'.$value.'}', $flags, $pos, $references); - } catch (\InvalidArgumentException) { - // no, it's not - } - } - - if (!$isQuoted && \is_string($value) && '' !== $value && '&' === $value[0] && Parser::preg_match(Parser::REFERENCE_PATTERN, $value, $matches)) { - $references[$matches['ref']] = $matches['value']; - $value = $matches['value']; - } - - --$i; - } - - if (null !== $tag && '' !== $tag) { - $value = new TaggedValue($tag, $value); - } - - $output[] = $value; - - ++$i; - } - - throw new ParseException(sprintf('Malformed inline YAML string: "%s".', $sequence), self::$parsedLineNumber + 1, null, self::$parsedFilename); - } - - /** - * Parses a YAML mapping. - * - * @throws ParseException When malformed inline YAML string is parsed - */ - private static function parseMapping(string $mapping, int $flags, int &$i = 0, array &$references = []): array|\stdClass - { - $output = []; - $len = \strlen($mapping); - ++$i; - $allowOverwrite = false; - - // {foo: bar, bar:foo, ...} - while ($i < $len) { - switch ($mapping[$i]) { - case ' ': - case ',': - case "\n": - ++$i; - continue 2; - case '}': - if (self::$objectForMap) { - return (object) $output; - } - - return $output; - } - - // key - $offsetBeforeKeyParsing = $i; - $isKeyQuoted = \in_array($mapping[$i], ['"', "'"], true); - $key = self::parseScalar($mapping, $flags, [':', ' '], $i, false); - - if ($offsetBeforeKeyParsing === $i) { - throw new ParseException('Missing mapping key.', self::$parsedLineNumber + 1, $mapping); - } - - if ('!php/const' === $key || '!php/enum' === $key) { - $key .= ' '.self::parseScalar($mapping, $flags, [':'], $i, false); - $key = self::evaluateScalar($key, $flags); - } - - if (false === $i = strpos($mapping, ':', $i)) { - break; - } - - if (!$isKeyQuoted) { - $evaluatedKey = self::evaluateScalar($key, $flags, $references); - - if ('' !== $key && $evaluatedKey !== $key && !\is_string($evaluatedKey) && !\is_int($evaluatedKey)) { - throw new ParseException('Implicit casting of incompatible mapping keys to strings is not supported. Quote your evaluable mapping keys instead.', self::$parsedLineNumber + 1, $mapping); - } - } - - if (!$isKeyQuoted && (!isset($mapping[$i + 1]) || !\in_array($mapping[$i + 1], [' ', ',', '[', ']', '{', '}', "\n"], true))) { - throw new ParseException('Colons must be followed by a space or an indication character (i.e. " ", ",", "[", "]", "{", "}").', self::$parsedLineNumber + 1, $mapping); - } - - if ('<<' === $key) { - $allowOverwrite = true; - } - - while ($i < $len) { - if (':' === $mapping[$i] || ' ' === $mapping[$i] || "\n" === $mapping[$i]) { - ++$i; - - continue; - } - - $tag = self::parseTag($mapping, $i, $flags); - switch ($mapping[$i]) { - case '[': - // nested sequence - $value = self::parseSequence($mapping, $flags, $i, $references); - // Spec: Keys MUST be unique; first one wins. - // Parser cannot abort this mapping earlier, since lines - // are processed sequentially. - // But overwriting is allowed when a merge node is used in current block. - if ('<<' === $key) { - foreach ($value as $parsedValue) { - $output += $parsedValue; - } - } elseif ($allowOverwrite || !isset($output[$key])) { - if (null !== $tag) { - $output[$key] = new TaggedValue($tag, $value); - } else { - $output[$key] = $value; - } - } elseif (isset($output[$key])) { - throw new ParseException(sprintf('Duplicate key "%s" detected.', $key), self::$parsedLineNumber + 1, $mapping); - } - break; - case '{': - // nested mapping - $value = self::parseMapping($mapping, $flags, $i, $references); - // Spec: Keys MUST be unique; first one wins. - // Parser cannot abort this mapping earlier, since lines - // are processed sequentially. - // But overwriting is allowed when a merge node is used in current block. - if ('<<' === $key) { - $output += $value; - } elseif ($allowOverwrite || !isset($output[$key])) { - if (null !== $tag) { - $output[$key] = new TaggedValue($tag, $value); - } else { - $output[$key] = $value; - } - } elseif (isset($output[$key])) { - throw new ParseException(sprintf('Duplicate key "%s" detected.', $key), self::$parsedLineNumber + 1, $mapping); - } - break; - default: - $value = self::parseScalar($mapping, $flags, [',', '}', "\n"], $i, null === $tag, $references, $isValueQuoted); - // Spec: Keys MUST be unique; first one wins. - // Parser cannot abort this mapping earlier, since lines - // are processed sequentially. - // But overwriting is allowed when a merge node is used in current block. - if ('<<' === $key) { - $output += $value; - } elseif ($allowOverwrite || !isset($output[$key])) { - if (!$isValueQuoted && \is_string($value) && '' !== $value && '&' === $value[0] && Parser::preg_match(Parser::REFERENCE_PATTERN, $value, $matches)) { - $references[$matches['ref']] = $matches['value']; - $value = $matches['value']; - } - - if (null !== $tag) { - $output[$key] = new TaggedValue($tag, $value); - } else { - $output[$key] = $value; - } - } elseif (isset($output[$key])) { - throw new ParseException(sprintf('Duplicate key "%s" detected.', $key), self::$parsedLineNumber + 1, $mapping); - } - --$i; - } - ++$i; - - continue 2; - } - } - - throw new ParseException(sprintf('Malformed inline YAML string: "%s".', $mapping), self::$parsedLineNumber + 1, null, self::$parsedFilename); - } - - /** - * Evaluates scalars and replaces magic values. - * - * @throws ParseException when object parsing support was disabled and the parser detected a PHP object or when a reference could not be resolved - */ - private static function evaluateScalar(string $scalar, int $flags, array &$references = [], bool &$isQuotedString = null): mixed - { - $isQuotedString = false; - $scalar = trim($scalar); - - if (str_starts_with($scalar, '*')) { - if (false !== $pos = strpos($scalar, '#')) { - $value = substr($scalar, 1, $pos - 2); - } else { - $value = substr($scalar, 1); - } - - // an unquoted * - if (false === $value || '' === $value) { - throw new ParseException('A reference must contain at least one character.', self::$parsedLineNumber + 1, $value, self::$parsedFilename); - } - - if (!\array_key_exists($value, $references)) { - throw new ParseException(sprintf('Reference "%s" does not exist.', $value), self::$parsedLineNumber + 1, $value, self::$parsedFilename); - } - - return $references[$value]; - } - - $scalarLower = strtolower($scalar); - - switch (true) { - case 'null' === $scalarLower: - case '' === $scalar: - case '~' === $scalar: - return null; - case 'true' === $scalarLower: - return true; - case 'false' === $scalarLower: - return false; - case '!' === $scalar[0]: - switch (true) { - case str_starts_with($scalar, '!!str '): - $s = (string) substr($scalar, 6); - - if (\in_array($s[0] ?? '', ['"', "'"], true)) { - $isQuotedString = true; - $s = self::parseQuotedScalar($s); - } - - return $s; - case str_starts_with($scalar, '! '): - return substr($scalar, 2); - case str_starts_with($scalar, '!php/object'): - if (self::$objectSupport) { - if (!isset($scalar[12])) { - throw new ParseException('Missing value for tag "!php/object".', self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); - } - - return unserialize(self::parseScalar(substr($scalar, 12))); - } - - if (self::$exceptionOnInvalidType) { - throw new ParseException('Object support when parsing a YAML file has been disabled.', self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); - } - - return null; - case str_starts_with($scalar, '!php/const'): - if (self::$constantSupport) { - if (!isset($scalar[11])) { - throw new ParseException('Missing value for tag "!php/const".', self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); - } - - $i = 0; - if (\defined($const = self::parseScalar(substr($scalar, 11), 0, null, $i, false))) { - return \constant($const); - } - - throw new ParseException(sprintf('The constant "%s" is not defined.', $const), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); - } - if (self::$exceptionOnInvalidType) { - throw new ParseException(sprintf('The string "%s" could not be parsed as a constant. Did you forget to pass the "Yaml::PARSE_CONSTANT" flag to the parser?', $scalar), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); - } - - return null; - case str_starts_with($scalar, '!php/enum'): - if (self::$constantSupport) { - if (!isset($scalar[11])) { - throw new ParseException('Missing value for tag "!php/enum".', self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); - } - - $i = 0; - $enum = self::parseScalar(substr($scalar, 10), 0, null, $i, false); - if ($useValue = str_ends_with($enum, '->value')) { - $enum = substr($enum, 0, -7); - } - if (!\defined($enum)) { - throw new ParseException(sprintf('The enum "%s" is not defined.', $enum), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); - } - - $value = \constant($enum); - - if (!$value instanceof \UnitEnum) { - throw new ParseException(sprintf('The string "%s" is not the name of a valid enum.', $enum), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); - } - if (!$useValue) { - return $value; - } - if (!$value instanceof \BackedEnum) { - throw new ParseException(sprintf('The enum "%s" defines no value next to its name.', $enum), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); - } - - return $value->value; - } - if (self::$exceptionOnInvalidType) { - throw new ParseException(sprintf('The string "%s" could not be parsed as an enum. Did you forget to pass the "Yaml::PARSE_CONSTANT" flag to the parser?', $scalar), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); - } - - return null; - case str_starts_with($scalar, '!!float '): - return (float) substr($scalar, 8); - case str_starts_with($scalar, '!!binary '): - return self::evaluateBinaryScalar(substr($scalar, 9)); - } - - throw new ParseException(sprintf('The string "%s" could not be parsed as it uses an unsupported built-in tag.', $scalar), self::$parsedLineNumber, $scalar, self::$parsedFilename); - case preg_match('/^(?:\+|-)?0o(?P[0-7_]++)$/', $scalar, $matches): - $value = str_replace('_', '', $matches['value']); - - if ('-' === $scalar[0]) { - return -octdec($value); - } - - return octdec($value); - case \in_array($scalar[0], ['+', '-', '.'], true) || is_numeric($scalar[0]): - if (Parser::preg_match('{^[+-]?[0-9][0-9_]*$}', $scalar)) { - $scalar = str_replace('_', '', $scalar); - } - - switch (true) { - case ctype_digit($scalar): - case '-' === $scalar[0] && ctype_digit(substr($scalar, 1)): - $cast = (int) $scalar; - - return ($scalar === (string) $cast) ? $cast : $scalar; - case is_numeric($scalar): - case Parser::preg_match(self::getHexRegex(), $scalar): - $scalar = str_replace('_', '', $scalar); - - return '0x' === $scalar[0].$scalar[1] ? hexdec($scalar) : (float) $scalar; - case '.inf' === $scalarLower: - case '.nan' === $scalarLower: - return -log(0); - case '-.inf' === $scalarLower: - return log(0); - case Parser::preg_match('/^(-|\+)?[0-9][0-9_]*(\.[0-9_]+)?$/', $scalar): - return (float) str_replace('_', '', $scalar); - case Parser::preg_match(self::getTimestampRegex(), $scalar): - // When no timezone is provided in the parsed date, YAML spec says we must assume UTC. - $time = new \DateTimeImmutable($scalar, new \DateTimeZone('UTC')); - - if (Yaml::PARSE_DATETIME & $flags) { - return $time; - } - - try { - if (false !== $scalar = $time->getTimestamp()) { - return $scalar; - } - } catch (\ValueError) { - // no-op - } - - return $time->format('U'); - } - } - - return (string) $scalar; - } - - private static function parseTag(string $value, int &$i, int $flags): ?string - { - if ('!' !== $value[$i]) { - return null; - } - - $tagLength = strcspn($value, " \t\n[]{},", $i + 1); - $tag = substr($value, $i + 1, $tagLength); - - $nextOffset = $i + $tagLength + 1; - $nextOffset += strspn($value, ' ', $nextOffset); - - if ('' === $tag && (!isset($value[$nextOffset]) || \in_array($value[$nextOffset], [']', '}', ','], true))) { - throw new ParseException('Using the unquoted scalar value "!" is not supported. You must quote it.', self::$parsedLineNumber + 1, $value, self::$parsedFilename); - } - - // Is followed by a scalar and is a built-in tag - if ('' !== $tag && (!isset($value[$nextOffset]) || !\in_array($value[$nextOffset], ['[', '{'], true)) && ('!' === $tag[0] || \in_array($tag, ['str', 'php/const', 'php/enum', 'php/object'], true))) { - // Manage in {@link self::evaluateScalar()} - return null; - } - - $i = $nextOffset; - - // Built-in tags - if ('' !== $tag && '!' === $tag[0]) { - throw new ParseException(sprintf('The built-in tag "!%s" is not implemented.', $tag), self::$parsedLineNumber + 1, $value, self::$parsedFilename); - } - - if ('' !== $tag && !isset($value[$i])) { - throw new ParseException(sprintf('Missing value for tag "%s".', $tag), self::$parsedLineNumber + 1, $value, self::$parsedFilename); - } - - if ('' === $tag || Yaml::PARSE_CUSTOM_TAGS & $flags) { - return $tag; - } - - throw new ParseException(sprintf('Tags support is not enabled. Enable the "Yaml::PARSE_CUSTOM_TAGS" flag to use "!%s".', $tag), self::$parsedLineNumber + 1, $value, self::$parsedFilename); - } - - public static function evaluateBinaryScalar(string $scalar): string - { - $parsedBinaryData = self::parseScalar(preg_replace('/\s/', '', $scalar)); - - if (0 !== (\strlen($parsedBinaryData) % 4)) { - throw new ParseException(sprintf('The normalized base64 encoded data (data without whitespace characters) length must be a multiple of four (%d bytes given).', \strlen($parsedBinaryData)), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); - } - - if (!Parser::preg_match('#^[A-Z0-9+/]+={0,2}$#i', $parsedBinaryData)) { - throw new ParseException(sprintf('The base64 encoded data (%s) contains invalid characters.', $parsedBinaryData), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); - } - - return base64_decode($parsedBinaryData, true); - } - - private static function isBinaryString(string $value): bool - { - return !preg_match('//u', $value) || preg_match('/[^\x00\x07-\x0d\x1B\x20-\xff]/', $value); - } - - /** - * Gets a regex that matches a YAML date. - * - * @see http://www.yaml.org/spec/1.2/spec.html#id2761573 - */ - private static function getTimestampRegex(): string - { - return <<[0-9][0-9][0-9][0-9]) - -(?P[0-9][0-9]?) - -(?P[0-9][0-9]?) - (?:(?:[Tt]|[ \t]+) - (?P[0-9][0-9]?) - :(?P[0-9][0-9]) - :(?P[0-9][0-9]) - (?:\.(?P[0-9]*))? - (?:[ \t]*(?PZ|(?P[-+])(?P[0-9][0-9]?) - (?::(?P[0-9][0-9]))?))?)? - $~x -EOF; - } - - /** - * Gets a regex that matches a YAML number in hexadecimal notation. - */ - private static function getHexRegex(): string - { - return '~^0x[0-9a-f_]++$~i'; - } -} diff --git a/vendor/symfony/yaml/LICENSE b/vendor/symfony/yaml/LICENSE deleted file mode 100644 index 88bf75bb..00000000 --- a/vendor/symfony/yaml/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2022 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/yaml/Parser.php b/vendor/symfony/yaml/Parser.php deleted file mode 100644 index 146a6455..00000000 --- a/vendor/symfony/yaml/Parser.php +++ /dev/null @@ -1,1246 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Yaml; - -use Symfony\Component\Yaml\Exception\ParseException; -use Symfony\Component\Yaml\Tag\TaggedValue; - -/** - * Parser parses YAML strings to convert them to PHP arrays. - * - * @author Fabien Potencier - * - * @final - */ -class Parser -{ - public const TAG_PATTERN = '(?P![\w!.\/:-]+)'; - public const BLOCK_SCALAR_HEADER_PATTERN = '(?P\||>)(?P\+|\-|\d+|\+\d+|\-\d+|\d+\+|\d+\-)?(?P +#.*)?'; - public const REFERENCE_PATTERN = '#^&(?P[^ ]++) *+(?P.*)#u'; - - private ?string $filename = null; - private int $offset = 0; - private int $numberOfParsedLines = 0; - private ?int $totalNumberOfLines = null; - private array $lines = []; - private int $currentLineNb = -1; - private string $currentLine = ''; - private array $refs = []; - private array $skippedLineNumbers = []; - private array $locallySkippedLineNumbers = []; - private array $refsBeingParsed = []; - - /** - * Parses a YAML file into a PHP value. - * - * @param string $filename The path to the YAML file to be parsed - * @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior - * - * @throws ParseException If the file could not be read or the YAML is not valid - */ - public function parseFile(string $filename, int $flags = 0): mixed - { - if (!is_file($filename)) { - throw new ParseException(sprintf('File "%s" does not exist.', $filename)); - } - - if (!is_readable($filename)) { - throw new ParseException(sprintf('File "%s" cannot be read.', $filename)); - } - - $this->filename = $filename; - - try { - return $this->parse(file_get_contents($filename), $flags); - } finally { - $this->filename = null; - } - } - - /** - * Parses a YAML string to a PHP value. - * - * @param string $value A YAML string - * @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior - * - * @throws ParseException If the YAML is not valid - */ - public function parse(string $value, int $flags = 0): mixed - { - if (false === preg_match('//u', $value)) { - throw new ParseException('The YAML value does not appear to be valid UTF-8.', -1, null, $this->filename); - } - - $this->refs = []; - - try { - $data = $this->doParse($value, $flags); - } finally { - $this->refsBeingParsed = []; - $this->offset = 0; - $this->lines = []; - $this->currentLine = ''; - $this->numberOfParsedLines = 0; - $this->refs = []; - $this->skippedLineNumbers = []; - $this->locallySkippedLineNumbers = []; - $this->totalNumberOfLines = null; - } - - return $data; - } - - private function doParse(string $value, int $flags) - { - $this->currentLineNb = -1; - $this->currentLine = ''; - $value = $this->cleanup($value); - $this->lines = explode("\n", $value); - $this->numberOfParsedLines = \count($this->lines); - $this->locallySkippedLineNumbers = []; - $this->totalNumberOfLines ??= $this->numberOfParsedLines; - - if (!$this->moveToNextLine()) { - return null; - } - - $data = []; - $context = null; - $allowOverwrite = false; - - while ($this->isCurrentLineEmpty()) { - if (!$this->moveToNextLine()) { - return null; - } - } - - // Resolves the tag and returns if end of the document - if (null !== ($tag = $this->getLineTag($this->currentLine, $flags, false)) && !$this->moveToNextLine()) { - return new TaggedValue($tag, ''); - } - - do { - if ($this->isCurrentLineEmpty()) { - continue; - } - - // tab? - if ("\t" === $this->currentLine[0]) { - throw new ParseException('A YAML file cannot contain tabs as indentation.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - - Inline::initialize($flags, $this->getRealCurrentLineNb(), $this->filename); - - $isRef = $mergeNode = false; - if ('-' === $this->currentLine[0] && self::preg_match('#^\-((?P\s+)(?P.+))?$#u', rtrim($this->currentLine), $values)) { - if ($context && 'mapping' == $context) { - throw new ParseException('You cannot define a sequence item when in a mapping.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - $context = 'sequence'; - - if (isset($values['value']) && '&' === $values['value'][0] && self::preg_match(self::REFERENCE_PATTERN, $values['value'], $matches)) { - $isRef = $matches['ref']; - $this->refsBeingParsed[] = $isRef; - $values['value'] = $matches['value']; - } - - if (isset($values['value'][1]) && '?' === $values['value'][0] && ' ' === $values['value'][1]) { - throw new ParseException('Complex mappings are not supported.', $this->getRealCurrentLineNb() + 1, $this->currentLine); - } - - // array - if (isset($values['value']) && str_starts_with(ltrim($values['value'], ' '), '-')) { - // Inline first child - $currentLineNumber = $this->getRealCurrentLineNb(); - - $sequenceIndentation = \strlen($values['leadspaces']) + 1; - $sequenceYaml = substr($this->currentLine, $sequenceIndentation); - $sequenceYaml .= "\n".$this->getNextEmbedBlock($sequenceIndentation, true); - - $data[] = $this->parseBlock($currentLineNumber, rtrim($sequenceYaml), $flags); - } elseif (!isset($values['value']) || '' == trim($values['value'], ' ') || str_starts_with(ltrim($values['value'], ' '), '#')) { - $data[] = $this->parseBlock($this->getRealCurrentLineNb() + 1, $this->getNextEmbedBlock(null, true) ?? '', $flags); - } elseif (null !== $subTag = $this->getLineTag(ltrim($values['value'], ' '), $flags)) { - $data[] = new TaggedValue( - $subTag, - $this->parseBlock($this->getRealCurrentLineNb() + 1, $this->getNextEmbedBlock(null, true), $flags) - ); - } else { - if ( - isset($values['leadspaces']) - && ( - '!' === $values['value'][0] - || self::preg_match('#^(?P'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\{\[].*?) *\:(\s+(?P.+?))?\s*$#u', $this->trimTag($values['value']), $matches) - ) - ) { - // this is a compact notation element, add to next block and parse - $block = $values['value']; - if ($this->isNextLineIndented()) { - $block .= "\n".$this->getNextEmbedBlock($this->getCurrentLineIndentation() + \strlen($values['leadspaces']) + 1); - } - - $data[] = $this->parseBlock($this->getRealCurrentLineNb(), $block, $flags); - } else { - $data[] = $this->parseValue($values['value'], $flags, $context); - } - } - if ($isRef) { - $this->refs[$isRef] = end($data); - array_pop($this->refsBeingParsed); - } - } elseif ( - // @todo in 7.0 remove legacy "(?:!?!php/const:)?" - self::preg_match('#^(?P(?:![^\s]++\s++)?(?:'.Inline::REGEX_QUOTED_STRING.'|(?:!?!php/const:)?[^ \'"\[\{!].*?)) *\:(( |\t)++(?P.+))?$#u', rtrim($this->currentLine), $values) - && (!str_contains($values['key'], ' #') || \in_array($values['key'][0], ['"', "'"])) - ) { - if (str_starts_with($values['key'], '!php/const:')) { - trigger_deprecation('symfony/yaml', '6.2', 'YAML syntax for key "%s" is deprecated and replaced by "!php/const %s".', $values['key'], substr($values['key'], 11)); - } - - if ($context && 'sequence' == $context) { - throw new ParseException('You cannot define a mapping item when in a sequence.', $this->currentLineNb + 1, $this->currentLine, $this->filename); - } - $context = 'mapping'; - - try { - $key = Inline::parseScalar($values['key']); - } catch (ParseException $e) { - $e->setParsedLine($this->getRealCurrentLineNb() + 1); - $e->setSnippet($this->currentLine); - - throw $e; - } - - if (!\is_string($key) && !\is_int($key)) { - throw new ParseException((is_numeric($key) ? 'Numeric' : 'Non-string').' keys are not supported. Quote your evaluable mapping keys instead.', $this->getRealCurrentLineNb() + 1, $this->currentLine); - } - - // Convert float keys to strings, to avoid being converted to integers by PHP - if (\is_float($key)) { - $key = (string) $key; - } - - if ('<<' === $key && (!isset($values['value']) || '&' !== $values['value'][0] || !self::preg_match('#^&(?P[^ ]+)#u', $values['value'], $refMatches))) { - $mergeNode = true; - $allowOverwrite = true; - if (isset($values['value'][0]) && '*' === $values['value'][0]) { - $refName = substr(rtrim($values['value']), 1); - if (!\array_key_exists($refName, $this->refs)) { - if (false !== $pos = array_search($refName, $this->refsBeingParsed, true)) { - throw new ParseException(sprintf('Circular reference [%s] detected for reference "%s".', implode(', ', array_merge(\array_slice($this->refsBeingParsed, $pos), [$refName])), $refName), $this->currentLineNb + 1, $this->currentLine, $this->filename); - } - - throw new ParseException(sprintf('Reference "%s" does not exist.', $refName), $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - - $refValue = $this->refs[$refName]; - - if (Yaml::PARSE_OBJECT_FOR_MAP & $flags && $refValue instanceof \stdClass) { - $refValue = (array) $refValue; - } - - if (!\is_array($refValue)) { - throw new ParseException('YAML merge keys used with a scalar value instead of an array.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - - $data += $refValue; // array union - } else { - if (isset($values['value']) && '' !== $values['value']) { - $value = $values['value']; - } else { - $value = $this->getNextEmbedBlock(); - } - $parsed = $this->parseBlock($this->getRealCurrentLineNb() + 1, $value, $flags); - - if (Yaml::PARSE_OBJECT_FOR_MAP & $flags && $parsed instanceof \stdClass) { - $parsed = (array) $parsed; - } - - if (!\is_array($parsed)) { - throw new ParseException('YAML merge keys used with a scalar value instead of an array.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - - if (isset($parsed[0])) { - // If the value associated with the merge key is a sequence, then this sequence is expected to contain mapping nodes - // and each of these nodes is merged in turn according to its order in the sequence. Keys in mapping nodes earlier - // in the sequence override keys specified in later mapping nodes. - foreach ($parsed as $parsedItem) { - if (Yaml::PARSE_OBJECT_FOR_MAP & $flags && $parsedItem instanceof \stdClass) { - $parsedItem = (array) $parsedItem; - } - - if (!\is_array($parsedItem)) { - throw new ParseException('Merge items must be arrays.', $this->getRealCurrentLineNb() + 1, $parsedItem, $this->filename); - } - - $data += $parsedItem; // array union - } - } else { - // If the value associated with the key is a single mapping node, each of its key/value pairs is inserted into the - // current mapping, unless the key already exists in it. - $data += $parsed; // array union - } - } - } elseif ('<<' !== $key && isset($values['value']) && '&' === $values['value'][0] && self::preg_match(self::REFERENCE_PATTERN, $values['value'], $matches)) { - $isRef = $matches['ref']; - $this->refsBeingParsed[] = $isRef; - $values['value'] = $matches['value']; - } - - $subTag = null; - if ($mergeNode) { - // Merge keys - } elseif (!isset($values['value']) || '' === $values['value'] || str_starts_with($values['value'], '#') || (null !== $subTag = $this->getLineTag($values['value'], $flags)) || '<<' === $key) { - // hash - // if next line is less indented or equal, then it means that the current value is null - if (!$this->isNextLineIndented() && !$this->isNextLineUnIndentedCollection()) { - // Spec: Keys MUST be unique; first one wins. - // But overwriting is allowed when a merge node is used in current block. - if ($allowOverwrite || !isset($data[$key])) { - if (null !== $subTag) { - $data[$key] = new TaggedValue($subTag, ''); - } else { - $data[$key] = null; - } - } else { - throw new ParseException(sprintf('Duplicate key "%s" detected.', $key), $this->getRealCurrentLineNb() + 1, $this->currentLine); - } - } else { - // remember the parsed line number here in case we need it to provide some contexts in error messages below - $realCurrentLineNbKey = $this->getRealCurrentLineNb(); - $value = $this->parseBlock($this->getRealCurrentLineNb() + 1, $this->getNextEmbedBlock(), $flags); - if ('<<' === $key) { - $this->refs[$refMatches['ref']] = $value; - - if (Yaml::PARSE_OBJECT_FOR_MAP & $flags && $value instanceof \stdClass) { - $value = (array) $value; - } - - $data += $value; - } elseif ($allowOverwrite || !isset($data[$key])) { - // Spec: Keys MUST be unique; first one wins. - // But overwriting is allowed when a merge node is used in current block. - if (null !== $subTag) { - $data[$key] = new TaggedValue($subTag, $value); - } else { - $data[$key] = $value; - } - } else { - throw new ParseException(sprintf('Duplicate key "%s" detected.', $key), $realCurrentLineNbKey + 1, $this->currentLine); - } - } - } else { - $value = $this->parseValue(rtrim($values['value']), $flags, $context); - // Spec: Keys MUST be unique; first one wins. - // But overwriting is allowed when a merge node is used in current block. - if ($allowOverwrite || !isset($data[$key])) { - $data[$key] = $value; - } else { - throw new ParseException(sprintf('Duplicate key "%s" detected.', $key), $this->getRealCurrentLineNb() + 1, $this->currentLine); - } - } - if ($isRef) { - $this->refs[$isRef] = $data[$key]; - array_pop($this->refsBeingParsed); - } - } elseif ('"' === $this->currentLine[0] || "'" === $this->currentLine[0]) { - if (null !== $context) { - throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - - try { - return Inline::parse($this->lexInlineQuotedString(), $flags, $this->refs); - } catch (ParseException $e) { - $e->setParsedLine($this->getRealCurrentLineNb() + 1); - $e->setSnippet($this->currentLine); - - throw $e; - } - } elseif ('{' === $this->currentLine[0]) { - if (null !== $context) { - throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - - try { - $parsedMapping = Inline::parse($this->lexInlineMapping(), $flags, $this->refs); - - while ($this->moveToNextLine()) { - if (!$this->isCurrentLineEmpty()) { - throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - } - - return $parsedMapping; - } catch (ParseException $e) { - $e->setParsedLine($this->getRealCurrentLineNb() + 1); - $e->setSnippet($this->currentLine); - - throw $e; - } - } elseif ('[' === $this->currentLine[0]) { - if (null !== $context) { - throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - - try { - $parsedSequence = Inline::parse($this->lexInlineSequence(), $flags, $this->refs); - - while ($this->moveToNextLine()) { - if (!$this->isCurrentLineEmpty()) { - throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - } - - return $parsedSequence; - } catch (ParseException $e) { - $e->setParsedLine($this->getRealCurrentLineNb() + 1); - $e->setSnippet($this->currentLine); - - throw $e; - } - } else { - // multiple documents are not supported - if ('---' === $this->currentLine) { - throw new ParseException('Multiple documents are not supported.', $this->currentLineNb + 1, $this->currentLine, $this->filename); - } - - if ($deprecatedUsage = (isset($this->currentLine[1]) && '?' === $this->currentLine[0] && ' ' === $this->currentLine[1])) { - throw new ParseException('Complex mappings are not supported.', $this->getRealCurrentLineNb() + 1, $this->currentLine); - } - - // 1-liner optionally followed by newline(s) - if (\is_string($value) && $this->lines[0] === trim($value)) { - try { - $value = Inline::parse($this->lines[0], $flags, $this->refs); - } catch (ParseException $e) { - $e->setParsedLine($this->getRealCurrentLineNb() + 1); - $e->setSnippet($this->currentLine); - - throw $e; - } - - return $value; - } - - // try to parse the value as a multi-line string as a last resort - if (0 === $this->currentLineNb) { - $previousLineWasNewline = false; - $previousLineWasTerminatedWithBackslash = false; - $value = ''; - - foreach ($this->lines as $line) { - $trimmedLine = trim($line); - if ('#' === ($trimmedLine[0] ?? '')) { - continue; - } - // If the indentation is not consistent at offset 0, it is to be considered as a ParseError - if (0 === $this->offset && !$deprecatedUsage && isset($line[0]) && ' ' === $line[0]) { - throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - - if (str_contains($line, ': ')) { - throw new ParseException('Mapping values are not allowed in multi-line blocks.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - - if ('' === $trimmedLine) { - $value .= "\n"; - } elseif (!$previousLineWasNewline && !$previousLineWasTerminatedWithBackslash) { - $value .= ' '; - } - - if ('' !== $trimmedLine && str_ends_with($line, '\\')) { - $value .= ltrim(substr($line, 0, -1)); - } elseif ('' !== $trimmedLine) { - $value .= $trimmedLine; - } - - if ('' === $trimmedLine) { - $previousLineWasNewline = true; - $previousLineWasTerminatedWithBackslash = false; - } elseif (str_ends_with($line, '\\')) { - $previousLineWasNewline = false; - $previousLineWasTerminatedWithBackslash = true; - } else { - $previousLineWasNewline = false; - $previousLineWasTerminatedWithBackslash = false; - } - } - - try { - return Inline::parse(trim($value)); - } catch (ParseException) { - // fall-through to the ParseException thrown below - } - } - - throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - } while ($this->moveToNextLine()); - - if (null !== $tag) { - $data = new TaggedValue($tag, $data); - } - - if (Yaml::PARSE_OBJECT_FOR_MAP & $flags && 'mapping' === $context && !\is_object($data)) { - $object = new \stdClass(); - - foreach ($data as $key => $value) { - $object->$key = $value; - } - - $data = $object; - } - - return empty($data) ? null : $data; - } - - private function parseBlock(int $offset, string $yaml, int $flags) - { - $skippedLineNumbers = $this->skippedLineNumbers; - - foreach ($this->locallySkippedLineNumbers as $lineNumber) { - if ($lineNumber < $offset) { - continue; - } - - $skippedLineNumbers[] = $lineNumber; - } - - $parser = new self(); - $parser->offset = $offset; - $parser->totalNumberOfLines = $this->totalNumberOfLines; - $parser->skippedLineNumbers = $skippedLineNumbers; - $parser->refs = &$this->refs; - $parser->refsBeingParsed = $this->refsBeingParsed; - - return $parser->doParse($yaml, $flags); - } - - /** - * Returns the current line number (takes the offset into account). - * - * @internal - */ - public function getRealCurrentLineNb(): int - { - $realCurrentLineNumber = $this->currentLineNb + $this->offset; - - foreach ($this->skippedLineNumbers as $skippedLineNumber) { - if ($skippedLineNumber > $realCurrentLineNumber) { - break; - } - - ++$realCurrentLineNumber; - } - - return $realCurrentLineNumber; - } - - private function getCurrentLineIndentation(): int - { - if (' ' !== ($this->currentLine[0] ?? '')) { - return 0; - } - - return \strlen($this->currentLine) - \strlen(ltrim($this->currentLine, ' ')); - } - - /** - * Returns the next embed block of YAML. - * - * @param int|null $indentation The indent level at which the block is to be read, or null for default - * @param bool $inSequence True if the enclosing data structure is a sequence - * - * @throws ParseException When indentation problem are detected - */ - private function getNextEmbedBlock(int $indentation = null, bool $inSequence = false): string - { - $oldLineIndentation = $this->getCurrentLineIndentation(); - - if (!$this->moveToNextLine()) { - return ''; - } - - if (null === $indentation) { - $newIndent = null; - $movements = 0; - - do { - $EOF = false; - - // empty and comment-like lines do not influence the indentation depth - if ($this->isCurrentLineEmpty() || $this->isCurrentLineComment()) { - $EOF = !$this->moveToNextLine(); - - if (!$EOF) { - ++$movements; - } - } else { - $newIndent = $this->getCurrentLineIndentation(); - } - } while (!$EOF && null === $newIndent); - - for ($i = 0; $i < $movements; ++$i) { - $this->moveToPreviousLine(); - } - - $unindentedEmbedBlock = $this->isStringUnIndentedCollectionItem(); - - if (!$this->isCurrentLineEmpty() && 0 === $newIndent && !$unindentedEmbedBlock) { - throw new ParseException('Indentation problem.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - } else { - $newIndent = $indentation; - } - - $data = []; - - if ($this->getCurrentLineIndentation() >= $newIndent) { - $data[] = substr($this->currentLine, $newIndent ?? 0); - } elseif ($this->isCurrentLineEmpty() || $this->isCurrentLineComment()) { - $data[] = $this->currentLine; - } else { - $this->moveToPreviousLine(); - - return ''; - } - - if ($inSequence && $oldLineIndentation === $newIndent && isset($data[0][0]) && '-' === $data[0][0]) { - // the previous line contained a dash but no item content, this line is a sequence item with the same indentation - // and therefore no nested list or mapping - $this->moveToPreviousLine(); - - return ''; - } - - $isItUnindentedCollection = $this->isStringUnIndentedCollectionItem(); - $isItComment = $this->isCurrentLineComment(); - - while ($this->moveToNextLine()) { - if ($isItComment && !$isItUnindentedCollection) { - $isItUnindentedCollection = $this->isStringUnIndentedCollectionItem(); - $isItComment = $this->isCurrentLineComment(); - } - - $indent = $this->getCurrentLineIndentation(); - - if ($isItUnindentedCollection && !$this->isCurrentLineEmpty() && !$this->isStringUnIndentedCollectionItem() && $newIndent === $indent) { - $this->moveToPreviousLine(); - break; - } - - if ($this->isCurrentLineBlank()) { - $data[] = substr($this->currentLine, $newIndent); - continue; - } - - if ($indent >= $newIndent) { - $data[] = substr($this->currentLine, $newIndent); - } elseif ($this->isCurrentLineComment()) { - $data[] = $this->currentLine; - } elseif (0 == $indent) { - $this->moveToPreviousLine(); - - break; - } else { - throw new ParseException('Indentation problem.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - } - - return implode("\n", $data); - } - - private function hasMoreLines(): bool - { - return (\count($this->lines) - 1) > $this->currentLineNb; - } - - /** - * Moves the parser to the next line. - */ - private function moveToNextLine(): bool - { - if ($this->currentLineNb >= $this->numberOfParsedLines - 1) { - return false; - } - - $this->currentLine = $this->lines[++$this->currentLineNb]; - - return true; - } - - /** - * Moves the parser to the previous line. - */ - private function moveToPreviousLine(): bool - { - if ($this->currentLineNb < 1) { - return false; - } - - $this->currentLine = $this->lines[--$this->currentLineNb]; - - return true; - } - - /** - * Parses a YAML value. - * - * @param string $value A YAML value - * @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior - * @param string $context The parser context (either sequence or mapping) - * - * @throws ParseException When reference does not exist - */ - private function parseValue(string $value, int $flags, string $context): mixed - { - if (str_starts_with($value, '*')) { - if (false !== $pos = strpos($value, '#')) { - $value = substr($value, 1, $pos - 2); - } else { - $value = substr($value, 1); - } - - if (!\array_key_exists($value, $this->refs)) { - if (false !== $pos = array_search($value, $this->refsBeingParsed, true)) { - throw new ParseException(sprintf('Circular reference [%s] detected for reference "%s".', implode(', ', array_merge(\array_slice($this->refsBeingParsed, $pos), [$value])), $value), $this->currentLineNb + 1, $this->currentLine, $this->filename); - } - - throw new ParseException(sprintf('Reference "%s" does not exist.', $value), $this->currentLineNb + 1, $this->currentLine, $this->filename); - } - - return $this->refs[$value]; - } - - if (\in_array($value[0], ['!', '|', '>'], true) && self::preg_match('/^(?:'.self::TAG_PATTERN.' +)?'.self::BLOCK_SCALAR_HEADER_PATTERN.'$/', $value, $matches)) { - $modifiers = $matches['modifiers'] ?? ''; - - $data = $this->parseBlockScalar($matches['separator'], preg_replace('#\d+#', '', $modifiers), abs((int) $modifiers)); - - if ('' !== $matches['tag'] && '!' !== $matches['tag']) { - if ('!!binary' === $matches['tag']) { - return Inline::evaluateBinaryScalar($data); - } - - return new TaggedValue(substr($matches['tag'], 1), $data); - } - - return $data; - } - - try { - if ('' !== $value && '{' === $value[0]) { - $cursor = \strlen(rtrim($this->currentLine)) - \strlen(rtrim($value)); - - return Inline::parse($this->lexInlineMapping($cursor), $flags, $this->refs); - } elseif ('' !== $value && '[' === $value[0]) { - $cursor = \strlen(rtrim($this->currentLine)) - \strlen(rtrim($value)); - - return Inline::parse($this->lexInlineSequence($cursor), $flags, $this->refs); - } - - switch ($value[0] ?? '') { - case '"': - case "'": - $cursor = \strlen(rtrim($this->currentLine)) - \strlen(rtrim($value)); - $parsedValue = Inline::parse($this->lexInlineQuotedString($cursor), $flags, $this->refs); - - if (isset($this->currentLine[$cursor]) && preg_replace('/\s*(#.*)?$/A', '', substr($this->currentLine, $cursor))) { - throw new ParseException(sprintf('Unexpected characters near "%s".', substr($this->currentLine, $cursor))); - } - - return $parsedValue; - default: - $lines = []; - - while ($this->moveToNextLine()) { - // unquoted strings end before the first unindented line - if (0 === $this->getCurrentLineIndentation()) { - $this->moveToPreviousLine(); - - break; - } - - $lines[] = trim($this->currentLine); - } - - for ($i = 0, $linesCount = \count($lines), $previousLineBlank = false; $i < $linesCount; ++$i) { - if ('' === $lines[$i]) { - $value .= "\n"; - $previousLineBlank = true; - } elseif ($previousLineBlank) { - $value .= $lines[$i]; - $previousLineBlank = false; - } else { - $value .= ' '.$lines[$i]; - $previousLineBlank = false; - } - } - - Inline::$parsedLineNumber = $this->getRealCurrentLineNb(); - - $parsedValue = Inline::parse($value, $flags, $this->refs); - - if ('mapping' === $context && \is_string($parsedValue) && '"' !== $value[0] && "'" !== $value[0] && '[' !== $value[0] && '{' !== $value[0] && '!' !== $value[0] && str_contains($parsedValue, ': ')) { - throw new ParseException('A colon cannot be used in an unquoted mapping value.', $this->getRealCurrentLineNb() + 1, $value, $this->filename); - } - - return $parsedValue; - } - } catch (ParseException $e) { - $e->setParsedLine($this->getRealCurrentLineNb() + 1); - $e->setSnippet($this->currentLine); - - throw $e; - } - } - - /** - * Parses a block scalar. - * - * @param string $style The style indicator that was used to begin this block scalar (| or >) - * @param string $chomping The chomping indicator that was used to begin this block scalar (+ or -) - * @param int $indentation The indentation indicator that was used to begin this block scalar - */ - private function parseBlockScalar(string $style, string $chomping = '', int $indentation = 0): string - { - $notEOF = $this->moveToNextLine(); - if (!$notEOF) { - return ''; - } - - $isCurrentLineBlank = $this->isCurrentLineBlank(); - $blockLines = []; - - // leading blank lines are consumed before determining indentation - while ($notEOF && $isCurrentLineBlank) { - // newline only if not EOF - if ($notEOF = $this->moveToNextLine()) { - $blockLines[] = ''; - $isCurrentLineBlank = $this->isCurrentLineBlank(); - } - } - - // determine indentation if not specified - if (0 === $indentation) { - $currentLineLength = \strlen($this->currentLine); - - for ($i = 0; $i < $currentLineLength && ' ' === $this->currentLine[$i]; ++$i) { - ++$indentation; - } - } - - if ($indentation > 0) { - $pattern = sprintf('/^ {%d}(.*)$/', $indentation); - - while ( - $notEOF && ( - $isCurrentLineBlank || - self::preg_match($pattern, $this->currentLine, $matches) - ) - ) { - if ($isCurrentLineBlank && \strlen($this->currentLine) > $indentation) { - $blockLines[] = substr($this->currentLine, $indentation); - } elseif ($isCurrentLineBlank) { - $blockLines[] = ''; - } else { - $blockLines[] = $matches[1]; - } - - // newline only if not EOF - if ($notEOF = $this->moveToNextLine()) { - $isCurrentLineBlank = $this->isCurrentLineBlank(); - } - } - } elseif ($notEOF) { - $blockLines[] = ''; - } - - if ($notEOF) { - $blockLines[] = ''; - $this->moveToPreviousLine(); - } elseif (!$notEOF && !$this->isCurrentLineLastLineInDocument()) { - $blockLines[] = ''; - } - - // folded style - if ('>' === $style) { - $text = ''; - $previousLineIndented = false; - $previousLineBlank = false; - - for ($i = 0, $blockLinesCount = \count($blockLines); $i < $blockLinesCount; ++$i) { - if ('' === $blockLines[$i]) { - $text .= "\n"; - $previousLineIndented = false; - $previousLineBlank = true; - } elseif (' ' === $blockLines[$i][0]) { - $text .= "\n".$blockLines[$i]; - $previousLineIndented = true; - $previousLineBlank = false; - } elseif ($previousLineIndented) { - $text .= "\n".$blockLines[$i]; - $previousLineIndented = false; - $previousLineBlank = false; - } elseif ($previousLineBlank || 0 === $i) { - $text .= $blockLines[$i]; - $previousLineIndented = false; - $previousLineBlank = false; - } else { - $text .= ' '.$blockLines[$i]; - $previousLineIndented = false; - $previousLineBlank = false; - } - } - } else { - $text = implode("\n", $blockLines); - } - - // deal with trailing newlines - if ('' === $chomping) { - $text = preg_replace('/\n+$/', "\n", $text); - } elseif ('-' === $chomping) { - $text = preg_replace('/\n+$/', '', $text); - } - - return $text; - } - - /** - * Returns true if the next line is indented. - */ - private function isNextLineIndented(): bool - { - $currentIndentation = $this->getCurrentLineIndentation(); - $movements = 0; - - do { - $EOF = !$this->moveToNextLine(); - - if (!$EOF) { - ++$movements; - } - } while (!$EOF && ($this->isCurrentLineEmpty() || $this->isCurrentLineComment())); - - if ($EOF) { - return false; - } - - $ret = $this->getCurrentLineIndentation() > $currentIndentation; - - for ($i = 0; $i < $movements; ++$i) { - $this->moveToPreviousLine(); - } - - return $ret; - } - - private function isCurrentLineEmpty(): bool - { - return $this->isCurrentLineBlank() || $this->isCurrentLineComment(); - } - - private function isCurrentLineBlank(): bool - { - return '' === $this->currentLine || '' === trim($this->currentLine, ' '); - } - - private function isCurrentLineComment(): bool - { - // checking explicitly the first char of the trim is faster than loops or strpos - $ltrimmedLine = '' !== $this->currentLine && ' ' === $this->currentLine[0] ? ltrim($this->currentLine, ' ') : $this->currentLine; - - return '' !== $ltrimmedLine && '#' === $ltrimmedLine[0]; - } - - private function isCurrentLineLastLineInDocument(): bool - { - return ($this->offset + $this->currentLineNb) >= ($this->totalNumberOfLines - 1); - } - - private function cleanup(string $value): string - { - $value = str_replace(["\r\n", "\r"], "\n", $value); - - // strip YAML header - $count = 0; - $value = preg_replace('#^\%YAML[: ][\d\.]+.*\n#u', '', $value, -1, $count); - $this->offset += $count; - - // remove leading comments - $trimmedValue = preg_replace('#^(\#.*?\n)+#s', '', $value, -1, $count); - if (1 === $count) { - // items have been removed, update the offset - $this->offset += substr_count($value, "\n") - substr_count($trimmedValue, "\n"); - $value = $trimmedValue; - } - - // remove start of the document marker (---) - $trimmedValue = preg_replace('#^\-\-\-.*?\n#s', '', $value, -1, $count); - if (1 === $count) { - // items have been removed, update the offset - $this->offset += substr_count($value, "\n") - substr_count($trimmedValue, "\n"); - $value = $trimmedValue; - - // remove end of the document marker (...) - $value = preg_replace('#\.\.\.\s*$#', '', $value); - } - - return $value; - } - - private function isNextLineUnIndentedCollection(): bool - { - $currentIndentation = $this->getCurrentLineIndentation(); - $movements = 0; - - do { - $EOF = !$this->moveToNextLine(); - - if (!$EOF) { - ++$movements; - } - } while (!$EOF && ($this->isCurrentLineEmpty() || $this->isCurrentLineComment())); - - if ($EOF) { - return false; - } - - $ret = $this->getCurrentLineIndentation() === $currentIndentation && $this->isStringUnIndentedCollectionItem(); - - for ($i = 0; $i < $movements; ++$i) { - $this->moveToPreviousLine(); - } - - return $ret; - } - - private function isStringUnIndentedCollectionItem(): bool - { - return '-' === rtrim($this->currentLine) || str_starts_with($this->currentLine, '- '); - } - - /** - * A local wrapper for "preg_match" which will throw a ParseException if there - * is an internal error in the PCRE engine. - * - * This avoids us needing to check for "false" every time PCRE is used - * in the YAML engine - * - * @throws ParseException on a PCRE internal error - * - * @internal - */ - public static function preg_match(string $pattern, string $subject, array &$matches = null, int $flags = 0, int $offset = 0): int - { - if (false === $ret = preg_match($pattern, $subject, $matches, $flags, $offset)) { - throw new ParseException(preg_last_error_msg()); - } - - return $ret; - } - - /** - * Trim the tag on top of the value. - * - * Prevent values such as "!foo {quz: bar}" to be considered as - * a mapping block. - */ - private function trimTag(string $value): string - { - if ('!' === $value[0]) { - return ltrim(substr($value, 1, strcspn($value, " \r\n", 1)), ' '); - } - - return $value; - } - - private function getLineTag(string $value, int $flags, bool $nextLineCheck = true): ?string - { - if ('' === $value || '!' !== $value[0] || 1 !== self::preg_match('/^'.self::TAG_PATTERN.' *( +#.*)?$/', $value, $matches)) { - return null; - } - - if ($nextLineCheck && !$this->isNextLineIndented()) { - return null; - } - - $tag = substr($matches['tag'], 1); - - // Built-in tags - if ($tag && '!' === $tag[0]) { - throw new ParseException(sprintf('The built-in tag "!%s" is not implemented.', $tag), $this->getRealCurrentLineNb() + 1, $value, $this->filename); - } - - if (Yaml::PARSE_CUSTOM_TAGS & $flags) { - return $tag; - } - - throw new ParseException(sprintf('Tags support is not enabled. You must use the flag "Yaml::PARSE_CUSTOM_TAGS" to use "%s".', $matches['tag']), $this->getRealCurrentLineNb() + 1, $value, $this->filename); - } - - private function lexInlineQuotedString(int &$cursor = 0): string - { - $quotation = $this->currentLine[$cursor]; - $value = $quotation; - ++$cursor; - - $previousLineWasNewline = true; - $previousLineWasTerminatedWithBackslash = false; - $lineNumber = 0; - - do { - if (++$lineNumber > 1) { - $cursor += strspn($this->currentLine, ' ', $cursor); - } - - if ($this->isCurrentLineBlank()) { - $value .= "\n"; - } elseif (!$previousLineWasNewline && !$previousLineWasTerminatedWithBackslash) { - $value .= ' '; - } - - for (; \strlen($this->currentLine) > $cursor; ++$cursor) { - switch ($this->currentLine[$cursor]) { - case '\\': - if ("'" === $quotation) { - $value .= '\\'; - } elseif (isset($this->currentLine[++$cursor])) { - $value .= '\\'.$this->currentLine[$cursor]; - } - - break; - case $quotation: - ++$cursor; - - if ("'" === $quotation && isset($this->currentLine[$cursor]) && "'" === $this->currentLine[$cursor]) { - $value .= "''"; - break; - } - - return $value.$quotation; - default: - $value .= $this->currentLine[$cursor]; - } - } - - if ($this->isCurrentLineBlank()) { - $previousLineWasNewline = true; - $previousLineWasTerminatedWithBackslash = false; - } elseif ('\\' === $this->currentLine[-1]) { - $previousLineWasNewline = false; - $previousLineWasTerminatedWithBackslash = true; - } else { - $previousLineWasNewline = false; - $previousLineWasTerminatedWithBackslash = false; - } - - if ($this->hasMoreLines()) { - $cursor = 0; - } - } while ($this->moveToNextLine()); - - throw new ParseException('Malformed inline YAML string.'); - } - - private function lexUnquotedString(int &$cursor): string - { - $offset = $cursor; - $cursor += strcspn($this->currentLine, '[]{},: ', $cursor); - - if ($cursor === $offset) { - throw new ParseException('Malformed unquoted YAML string.'); - } - - return substr($this->currentLine, $offset, $cursor - $offset); - } - - private function lexInlineMapping(int &$cursor = 0): string - { - return $this->lexInlineStructure($cursor, '}'); - } - - private function lexInlineSequence(int &$cursor = 0): string - { - return $this->lexInlineStructure($cursor, ']'); - } - - private function lexInlineStructure(int &$cursor, string $closingTag): string - { - $value = $this->currentLine[$cursor]; - ++$cursor; - - do { - $this->consumeWhitespaces($cursor); - - while (isset($this->currentLine[$cursor])) { - switch ($this->currentLine[$cursor]) { - case '"': - case "'": - $value .= $this->lexInlineQuotedString($cursor); - break; - case ':': - case ',': - $value .= $this->currentLine[$cursor]; - ++$cursor; - break; - case '{': - $value .= $this->lexInlineMapping($cursor); - break; - case '[': - $value .= $this->lexInlineSequence($cursor); - break; - case $closingTag: - $value .= $this->currentLine[$cursor]; - ++$cursor; - - return $value; - case '#': - break 2; - default: - $value .= $this->lexUnquotedString($cursor); - } - - if ($this->consumeWhitespaces($cursor)) { - $value .= ' '; - } - } - - if ($this->hasMoreLines()) { - $cursor = 0; - } - } while ($this->moveToNextLine()); - - throw new ParseException('Malformed inline YAML string.'); - } - - private function consumeWhitespaces(int &$cursor): bool - { - $whitespacesConsumed = 0; - - do { - $whitespaceOnlyTokenLength = strspn($this->currentLine, ' ', $cursor); - $whitespacesConsumed += $whitespaceOnlyTokenLength; - $cursor += $whitespaceOnlyTokenLength; - - if (isset($this->currentLine[$cursor])) { - return 0 < $whitespacesConsumed; - } - - if ($this->hasMoreLines()) { - $cursor = 0; - } - } while ($this->moveToNextLine()); - - return 0 < $whitespacesConsumed; - } -} diff --git a/vendor/symfony/yaml/README.md b/vendor/symfony/yaml/README.md deleted file mode 100644 index ac25024b..00000000 --- a/vendor/symfony/yaml/README.md +++ /dev/null @@ -1,13 +0,0 @@ -Yaml Component -============== - -The Yaml component loads and dumps YAML files. - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/components/yaml.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/yaml/Resources/bin/yaml-lint b/vendor/symfony/yaml/Resources/bin/yaml-lint deleted file mode 100755 index 143869e0..00000000 --- a/vendor/symfony/yaml/Resources/bin/yaml-lint +++ /dev/null @@ -1,49 +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.'); -} - -/** - * Runs the Yaml lint command. - * - * @author Jan Schädlich - */ - -use Symfony\Component\Console\Application; -use Symfony\Component\Yaml\Command\LintCommand; - -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 Yaml linter.'.PHP_EOL); - exit(1); -} - -(new Application())->add($command = new LintCommand()) - ->getApplication() - ->setDefaultCommand($command->getName(), true) - ->run() -; diff --git a/vendor/symfony/yaml/Tag/TaggedValue.php b/vendor/symfony/yaml/Tag/TaggedValue.php deleted file mode 100644 index c7946c27..00000000 --- a/vendor/symfony/yaml/Tag/TaggedValue.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Yaml\Tag; - -/** - * @author Nicolas Grekas - * @author Guilhem N. - */ -final class TaggedValue -{ - private string $tag; - private mixed $value; - - public function __construct(string $tag, mixed $value) - { - $this->tag = $tag; - $this->value = $value; - } - - public function getTag(): string - { - return $this->tag; - } - - public function getValue() - { - return $this->value; - } -} diff --git a/vendor/symfony/yaml/Unescaper.php b/vendor/symfony/yaml/Unescaper.php deleted file mode 100644 index 2238210d..00000000 --- a/vendor/symfony/yaml/Unescaper.php +++ /dev/null @@ -1,110 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Yaml; - -use Symfony\Component\Yaml\Exception\ParseException; - -/** - * Unescaper encapsulates unescaping rules for single and double-quoted - * YAML strings. - * - * @author Matthew Lewinski - * - * @internal - */ -class Unescaper -{ - /** - * Regex fragment that matches an escaped character in a double quoted string. - */ - public const REGEX_ESCAPED_CHARACTER = '\\\\(x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8}|.)'; - - /** - * Unescapes a single quoted string. - * - * @param string $value A single quoted string - */ - public function unescapeSingleQuotedString(string $value): string - { - return str_replace('\'\'', '\'', $value); - } - - /** - * Unescapes a double quoted string. - * - * @param string $value A double quoted string - */ - public function unescapeDoubleQuotedString(string $value): string - { - $callback = function ($match) { - return $this->unescapeCharacter($match[0]); - }; - - // evaluate the string - return preg_replace_callback('/'.self::REGEX_ESCAPED_CHARACTER.'/u', $callback, $value); - } - - /** - * Unescapes a character that was found in a double-quoted string. - * - * @param string $value An escaped character - */ - private function unescapeCharacter(string $value): string - { - return match ($value[1]) { - '0' => "\x0", - 'a' => "\x7", - 'b' => "\x8", - 't' => "\t", - "\t" => "\t", - 'n' => "\n", - 'v' => "\xB", - 'f' => "\xC", - 'r' => "\r", - 'e' => "\x1B", - ' ' => ' ', - '"' => '"', - '/' => '/', - '\\' => '\\', - // U+0085 NEXT LINE - 'N' => "\xC2\x85", - // U+00A0 NO-BREAK SPACE - '_' => "\xC2\xA0", - // U+2028 LINE SEPARATOR - 'L' => "\xE2\x80\xA8", - // U+2029 PARAGRAPH SEPARATOR - 'P' => "\xE2\x80\xA9", - 'x' => self::utf8chr(hexdec(substr($value, 2, 2))), - 'u' => self::utf8chr(hexdec(substr($value, 2, 4))), - 'U' => self::utf8chr(hexdec(substr($value, 2, 8))), - default => throw new ParseException(sprintf('Found unknown escape character "%s".', $value)), - }; - } - - /** - * Get the UTF-8 character for the given code point. - */ - private static function utf8chr(int $c): string - { - if (0x80 > $c %= 0x200000) { - return \chr($c); - } - if (0x800 > $c) { - return \chr(0xC0 | $c >> 6).\chr(0x80 | $c & 0x3F); - } - if (0x10000 > $c) { - return \chr(0xE0 | $c >> 12).\chr(0x80 | $c >> 6 & 0x3F).\chr(0x80 | $c & 0x3F); - } - - return \chr(0xF0 | $c >> 18).\chr(0x80 | $c >> 12 & 0x3F).\chr(0x80 | $c >> 6 & 0x3F).\chr(0x80 | $c & 0x3F); - } -} diff --git a/vendor/symfony/yaml/Yaml.php b/vendor/symfony/yaml/Yaml.php deleted file mode 100644 index 49784216..00000000 --- a/vendor/symfony/yaml/Yaml.php +++ /dev/null @@ -1,96 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Yaml; - -use Symfony\Component\Yaml\Exception\ParseException; - -/** - * Yaml offers convenience methods to load and dump YAML. - * - * @author Fabien Potencier - * - * @final - */ -class Yaml -{ - public const DUMP_OBJECT = 1; - public const PARSE_EXCEPTION_ON_INVALID_TYPE = 2; - public const PARSE_OBJECT = 4; - public const PARSE_OBJECT_FOR_MAP = 8; - public const DUMP_EXCEPTION_ON_INVALID_TYPE = 16; - public const PARSE_DATETIME = 32; - public const DUMP_OBJECT_AS_MAP = 64; - public const DUMP_MULTI_LINE_LITERAL_BLOCK = 128; - public const PARSE_CONSTANT = 256; - public const PARSE_CUSTOM_TAGS = 512; - public const DUMP_EMPTY_ARRAY_AS_SEQUENCE = 1024; - public const DUMP_NULL_AS_TILDE = 2048; - - /** - * Parses a YAML file into a PHP value. - * - * Usage: - * - * $array = Yaml::parseFile('config.yml'); - * print_r($array); - * - * @param string $filename The path to the YAML file to be parsed - * @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior - * - * @throws ParseException If the file could not be read or the YAML is not valid - */ - public static function parseFile(string $filename, int $flags = 0): mixed - { - $yaml = new Parser(); - - return $yaml->parseFile($filename, $flags); - } - - /** - * Parses YAML into a PHP value. - * - * Usage: - * - * $array = Yaml::parse(file_get_contents('config.yml')); - * print_r($array); - * - * - * @param string $input A string containing YAML - * @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior - * - * @throws ParseException If the YAML is not valid - */ - public static function parse(string $input, int $flags = 0): mixed - { - $yaml = new Parser(); - - return $yaml->parse($input, $flags); - } - - /** - * Dumps a PHP value to a YAML string. - * - * The dump method, when supplied with an array, will do its best - * to convert the array into friendly YAML. - * - * @param mixed $input The PHP value - * @param int $inline The level where you switch to inline YAML - * @param int $indent The amount of spaces to use for indentation of nested nodes - * @param int $flags A bit field of DUMP_* constants to customize the dumped YAML string - */ - public static function dump(mixed $input, int $inline = 2, int $indent = 4, int $flags = 0): string - { - $yaml = new Dumper($indent); - - return $yaml->dump($input, $inline, 0, $flags); - } -} diff --git a/vendor/symfony/yaml/composer.json b/vendor/symfony/yaml/composer.json deleted file mode 100644 index 839314bf..00000000 --- a/vendor/symfony/yaml/composer.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "symfony/yaml", - "type": "library", - "description": "Loads and dumps YAML files", - "keywords": [], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.1", - "symfony/polyfill-ctype": "^1.8" - }, - "require-dev": { - "symfony/console": "^5.4|^6.0" - }, - "conflict": { - "symfony/console": "<5.4" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\Yaml\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "bin": [ - "Resources/bin/yaml-lint" - ], - "minimum-stability": "dev" -} diff --git a/vendor/theseer/tokenizer/.php_cs.dist b/vendor/theseer/tokenizer/.php_cs.dist deleted file mode 100644 index 8ac26d09..00000000 --- a/vendor/theseer/tokenizer/.php_cs.dist +++ /dev/null @@ -1,213 +0,0 @@ -registerCustomFixers([ - new \PharIo\CSFixer\PhpdocSingleLineVarFixer() - ]) - ->setRiskyAllowed(true) - ->setRules( - [ - 'PharIo/phpdoc_single_line_var_fixer' => true, - - 'align_multiline_comment' => true, - 'array_indentation' => true, - 'array_syntax' => ['syntax' => 'short'], - 'binary_operator_spaces' => [ - 'operators' => [ - '=' => 'align_single_space_minimal', - '=>' => 'align', - ], - ], - 'blank_line_after_namespace' => true, - 'blank_line_after_opening_tag' => false, - 'blank_line_before_statement' => [ - 'statements' => [ - 'break', - 'continue', - 'declare', - 'do', - 'for', - 'foreach', - 'if', - 'include', - 'include_once', - 'require', - 'require_once', - 'return', - 'switch', - 'throw', - 'try', - 'while', - 'yield', - ], - ], - 'braces' => [ - 'allow_single_line_closure' => false, - 'position_after_anonymous_constructs' => 'same', - 'position_after_control_structures' => 'same', - 'position_after_functions_and_oop_constructs' => 'same' - ], - 'cast_spaces' => ['space' => 'none'], - - // This fixer removes the blank line at class start, no way to disable that, so we disable the fixer :( - //'class_attributes_separation' => ['elements' => ['const', 'method', 'property']], - - 'combine_consecutive_issets' => true, - 'combine_consecutive_unsets' => true, - 'compact_nullable_typehint' => true, - 'concat_space' => ['spacing' => 'one'], - 'date_time_immutable' => true, - 'declare_equal_normalize' => ['space' => 'single'], - 'declare_strict_types' => true, - 'dir_constant' => true, - 'elseif' => true, - 'encoding' => true, - 'full_opening_tag' => true, - 'fully_qualified_strict_types' => true, - 'function_declaration' => [ - 'closure_function_spacing' => 'one' - ], - 'header_comment' => false, - 'indentation_type' => true, - 'is_null' => true, - 'line_ending' => true, - 'list_syntax' => ['syntax' => 'short'], - 'logical_operators' => true, - 'lowercase_cast' => true, - 'lowercase_constants' => true, - 'lowercase_keywords' => true, - 'lowercase_static_reference' => true, - 'magic_constant_casing' => true, - 'method_argument_space' => ['ensure_fully_multiline' => true], - 'modernize_types_casting' => true, - 'multiline_comment_opening_closing' => true, - 'multiline_whitespace_before_semicolons' => true, - 'native_constant_invocation' => true, - 'native_function_casing' => true, - 'native_function_invocation' => true, - 'new_with_braces' => false, - 'no_alias_functions' => true, - 'no_alternative_syntax' => true, - 'no_blank_lines_after_class_opening' => false, - 'no_blank_lines_after_phpdoc' => true, - 'no_blank_lines_before_namespace' => true, - 'no_closing_tag' => true, - 'no_empty_comment' => true, - 'no_empty_phpdoc' => true, - 'no_empty_statement' => true, - 'no_extra_blank_lines' => true, - 'no_homoglyph_names' => true, - 'no_leading_import_slash' => true, - 'no_leading_namespace_whitespace' => true, - 'no_mixed_echo_print' => ['use' => 'print'], - 'no_multiline_whitespace_around_double_arrow' => true, - 'no_null_property_initialization' => true, - 'no_php4_constructor' => true, - 'no_short_bool_cast' => true, - 'no_short_echo_tag' => true, - 'no_singleline_whitespace_before_semicolons' => true, - 'no_spaces_after_function_name' => true, - 'no_spaces_inside_parenthesis' => true, - 'no_superfluous_elseif' => true, - 'no_superfluous_phpdoc_tags' => true, - 'no_trailing_comma_in_list_call' => true, - 'no_trailing_comma_in_singleline_array' => true, - 'no_trailing_whitespace' => true, - 'no_trailing_whitespace_in_comment' => true, - 'no_unneeded_control_parentheses' => false, - 'no_unneeded_curly_braces' => false, - 'no_unneeded_final_method' => true, - 'no_unreachable_default_argument_value' => true, - 'no_unset_on_property' => true, - 'no_unused_imports' => true, - 'no_useless_else' => true, - 'no_useless_return' => true, - 'no_whitespace_before_comma_in_array' => true, - 'no_whitespace_in_blank_line' => true, - 'non_printable_character' => true, - 'normalize_index_brace' => true, - 'object_operator_without_whitespace' => true, - 'ordered_class_elements' => [ - 'order' => [ - 'use_trait', - 'constant_public', - 'constant_protected', - 'constant_private', - 'property_public_static', - 'property_protected_static', - 'property_private_static', - 'property_public', - 'property_protected', - 'property_private', - 'method_public_static', - 'construct', - 'destruct', - 'magic', - 'phpunit', - 'method_public', - 'method_protected', - 'method_private', - 'method_protected_static', - 'method_private_static', - ], - ], - 'ordered_imports' => true, - 'phpdoc_add_missing_param_annotation' => true, - 'phpdoc_align' => true, - 'phpdoc_annotation_without_dot' => true, - 'phpdoc_indent' => true, - 'phpdoc_no_access' => true, - 'phpdoc_no_empty_return' => true, - 'phpdoc_no_package' => true, - 'phpdoc_order' => true, - 'phpdoc_return_self_reference' => true, - 'phpdoc_scalar' => true, - 'phpdoc_separation' => true, - 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_to_comment' => false, - 'phpdoc_trim' => true, - 'phpdoc_trim_consecutive_blank_line_separation' => true, - 'phpdoc_types' => ['groups' => ['simple', 'meta']], - 'phpdoc_types_order' => true, - 'phpdoc_to_return_type' => true, - 'phpdoc_var_without_name' => true, - 'pow_to_exponentiation' => true, - 'protected_to_private' => true, - 'return_assignment' => true, - 'return_type_declaration' => ['space_before' => 'none'], - 'self_accessor' => false, - 'semicolon_after_instruction' => true, - 'set_type_to_cast' => true, - 'short_scalar_cast' => true, - 'simplified_null_return' => true, - 'single_blank_line_at_eof' => true, - 'single_import_per_statement' => true, - 'single_line_after_imports' => true, - 'single_quote' => true, - 'standardize_not_equals' => true, - 'ternary_to_null_coalescing' => true, - 'trailing_comma_in_multiline_array' => false, - 'trim_array_spaces' => true, - 'unary_operator_spaces' => true, - 'visibility_required' => [ - 'elements' => [ - 'const', - 'method', - 'property', - ], - ], - 'void_return' => true, - 'whitespace_after_comma_in_array' => true, - 'yoda_style' => false - ] - ) - ->setFinder( - PhpCsFixer\Finder::create() - ->files() - ->in(__DIR__ . '/src') - ->in(__DIR__ . '/tests') - ->notName('*.phpt') - ->notName('autoload.php') - ); diff --git a/vendor/theseer/tokenizer/CHANGELOG.md b/vendor/theseer/tokenizer/CHANGELOG.md deleted file mode 100644 index 1eff3830..00000000 --- a/vendor/theseer/tokenizer/CHANGELOG.md +++ /dev/null @@ -1,71 +0,0 @@ -# Changelog - -All notable changes to Tokenizer are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. - - -## [1.2.1] - 2021-07-28 - -### Fixed - -* [#13](https://github.com/theseer/tokenizer/issues/13): Fatal error when tokenizing files that contain only a single empty line - - -## [1.2.0] - 2020-07-13 - -This release is now PHP 8.0 compliant. - -### Fixed - -* Whitespace handling in general (only noticable in the intermediate `TokenCollection`) is now consitent - -### Changed - -* Updated `Tokenizer` to deal with changed whitespace handling in PHP 8.0 - The XMLSerializer was unaffected. - - -## [1.1.3] - 2019-06-14 - -### Changed - -* Ensure XMLSerializer can deal with empty token collections - -### Fixed - -* [#2](https://github.com/theseer/tokenizer/issues/2): Fatal error in infection / phpunit - - -## [1.1.2] - 2019-04-04 - -### Changed - -* Reverted PHPUnit 8 test update to stay PHP 7.0 compliant - - -## [1.1.1] - 2019-04-03 - -### Fixed - -* [#1](https://github.com/theseer/tokenizer/issues/1): Empty file causes invalid array read - -### Changed - -* Tests should now be PHPUnit 8 compliant - - -## [1.1.0] - 2017-04-07 - -### Added - -* Allow use of custom namespace for XML serialization - - -## [1.0.0] - 2017-04-05 - -Initial Release - -[1.1.3]: https://github.com/theseer/tokenizer/compare/1.1.2...1.1.3 -[1.1.2]: https://github.com/theseer/tokenizer/compare/1.1.1...1.1.2 -[1.1.1]: https://github.com/theseer/tokenizer/compare/1.1.0...1.1.1 -[1.1.0]: https://github.com/theseer/tokenizer/compare/1.0.0...1.1.0 -[1.0.0]: https://github.com/theseer/tokenizer/compare/b2493e57de80c1b7414219b28503fa5c6b4d0a98...1.0.0 diff --git a/vendor/theseer/tokenizer/LICENSE b/vendor/theseer/tokenizer/LICENSE deleted file mode 100644 index e9694ad6..00000000 --- a/vendor/theseer/tokenizer/LICENSE +++ /dev/null @@ -1,30 +0,0 @@ -Tokenizer - -Copyright (c) 2017 Arne Blankerts and contributors -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 Arne Blankerts nor the names of 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 HOLDER 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/theseer/tokenizer/README.md b/vendor/theseer/tokenizer/README.md deleted file mode 100644 index e91ed891..00000000 --- a/vendor/theseer/tokenizer/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# Tokenizer - -A small library for converting tokenized PHP source code into XML. - -[![Test](https://github.com/theseer/tokenizer/actions/workflows/ci.yml/badge.svg)](https://github.com/theseer/tokenizer/actions/workflows/ci.yml) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/theseer/tokenizer/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/theseer/tokenizer/?branch=master) -[![Code Coverage](https://scrutinizer-ci.com/g/theseer/tokenizer/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/theseer/tokenizer/?branch=master) -[![Build Status](https://scrutinizer-ci.com/g/theseer/tokenizer/badges/build.png?b=master)](https://scrutinizer-ci.com/g/theseer/tokenizer/build-status/master) - -## Installation - -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): - - composer require theseer/tokenizer - -If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency: - - composer require --dev theseer/tokenizer - -## Usage examples - -```php -$tokenizer = new TheSeer\Tokenizer\Tokenizer(); -$tokens = $tokenizer->parse(file_get_contents(__DIR__ . '/src/XMLSerializer.php')); - -$serializer = new TheSeer\Tokenizer\XMLSerializer(); -$xml = $serializer->toXML($tokens); - -echo $xml; -``` - -The generated XML structure looks something like this: - -```xml - - - - <?php - declare - ( - strict_types - - = - - 1 - ) - ; - - -``` diff --git a/vendor/theseer/tokenizer/composer.json b/vendor/theseer/tokenizer/composer.json deleted file mode 100644 index 3f452a9f..00000000 --- a/vendor/theseer/tokenizer/composer.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "theseer/tokenizer", - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - } - ], - "support": { - "issues": "https://github.com/theseer/tokenizer/issues" - }, - "require": { - "php": "^7.2 || ^8.0", - "ext-xmlwriter": "*", - "ext-dom": "*", - "ext-tokenizer": "*" - }, - "autoload": { - "classmap": [ - "src/" - ] - } -} - diff --git a/vendor/theseer/tokenizer/composer.lock b/vendor/theseer/tokenizer/composer.lock deleted file mode 100644 index 07fba9b5..00000000 --- a/vendor/theseer/tokenizer/composer.lock +++ /dev/null @@ -1,22 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "b010f1b3d9d47d431ee1cb54ac1de755", - "packages": [], - "packages-dev": [], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": "^7.2 || ^8.0", - "ext-xmlwriter": "*", - "ext-dom": "*", - "ext-tokenizer": "*" - }, - "platform-dev": [] -} diff --git a/vendor/theseer/tokenizer/src/Exception.php b/vendor/theseer/tokenizer/src/Exception.php deleted file mode 100644 index 71fc117a..00000000 --- a/vendor/theseer/tokenizer/src/Exception.php +++ /dev/null @@ -1,5 +0,0 @@ -ensureValidUri($value); - $this->value = $value; - } - - public function asString(): string { - return $this->value; - } - - private function ensureValidUri($value): void { - if (\strpos($value, ':') === false) { - throw new NamespaceUriException( - \sprintf("Namespace URI '%s' must contain at least one colon", $value) - ); - } - } -} diff --git a/vendor/theseer/tokenizer/src/NamespaceUriException.php b/vendor/theseer/tokenizer/src/NamespaceUriException.php deleted file mode 100644 index ab1c48d2..00000000 --- a/vendor/theseer/tokenizer/src/NamespaceUriException.php +++ /dev/null @@ -1,5 +0,0 @@ -line = $line; - $this->name = $name; - $this->value = $value; - } - - public function getLine(): int { - return $this->line; - } - - public function getName(): string { - return $this->name; - } - - public function getValue(): string { - return $this->value; - } -} diff --git a/vendor/theseer/tokenizer/src/TokenCollection.php b/vendor/theseer/tokenizer/src/TokenCollection.php deleted file mode 100644 index e5e6e401..00000000 --- a/vendor/theseer/tokenizer/src/TokenCollection.php +++ /dev/null @@ -1,93 +0,0 @@ -tokens[] = $token; - } - - public function current(): Token { - return \current($this->tokens); - } - - public function key(): int { - return \key($this->tokens); - } - - public function next(): void { - \next($this->tokens); - $this->pos++; - } - - public function valid(): bool { - return $this->count() > $this->pos; - } - - public function rewind(): void { - \reset($this->tokens); - $this->pos = 0; - } - - public function count(): int { - return \count($this->tokens); - } - - public function offsetExists($offset): bool { - return isset($this->tokens[$offset]); - } - - /** - * @throws TokenCollectionException - */ - public function offsetGet($offset): Token { - if (!$this->offsetExists($offset)) { - throw new TokenCollectionException( - \sprintf('No Token at offest %s', $offset) - ); - } - - return $this->tokens[$offset]; - } - - /** - * @param Token $value - * - * @throws TokenCollectionException - */ - public function offsetSet($offset, $value): void { - if (!\is_int($offset)) { - $type = \gettype($offset); - - throw new TokenCollectionException( - \sprintf( - 'Offset must be of type integer, %s given', - $type === 'object' ? \get_class($value) : $type - ) - ); - } - - if (!$value instanceof Token) { - $type = \gettype($value); - - throw new TokenCollectionException( - \sprintf( - 'Value must be of type %s, %s given', - Token::class, - $type === 'object' ? \get_class($value) : $type - ) - ); - } - $this->tokens[$offset] = $value; - } - - public function offsetUnset($offset): void { - unset($this->tokens[$offset]); - } -} diff --git a/vendor/theseer/tokenizer/src/TokenCollectionException.php b/vendor/theseer/tokenizer/src/TokenCollectionException.php deleted file mode 100644 index 4291ce0c..00000000 --- a/vendor/theseer/tokenizer/src/TokenCollectionException.php +++ /dev/null @@ -1,5 +0,0 @@ - 'T_OPEN_BRACKET', - ')' => 'T_CLOSE_BRACKET', - '[' => 'T_OPEN_SQUARE', - ']' => 'T_CLOSE_SQUARE', - '{' => 'T_OPEN_CURLY', - '}' => 'T_CLOSE_CURLY', - ';' => 'T_SEMICOLON', - '.' => 'T_DOT', - ',' => 'T_COMMA', - '=' => 'T_EQUAL', - '<' => 'T_LT', - '>' => 'T_GT', - '+' => 'T_PLUS', - '-' => 'T_MINUS', - '*' => 'T_MULT', - '/' => 'T_DIV', - '?' => 'T_QUESTION_MARK', - '!' => 'T_EXCLAMATION_MARK', - ':' => 'T_COLON', - '"' => 'T_DOUBLE_QUOTES', - '@' => 'T_AT', - '&' => 'T_AMPERSAND', - '%' => 'T_PERCENT', - '|' => 'T_PIPE', - '$' => 'T_DOLLAR', - '^' => 'T_CARET', - '~' => 'T_TILDE', - '`' => 'T_BACKTICK' - ]; - - public function parse(string $source): TokenCollection { - $result = new TokenCollection(); - - if ($source === '') { - return $result; - } - - $tokens = \token_get_all($source); - - $lastToken = new Token( - $tokens[0][2], - 'Placeholder', - '' - ); - - foreach ($tokens as $pos => $tok) { - if (\is_string($tok)) { - $token = new Token( - $lastToken->getLine(), - $this->map[$tok], - $tok - ); - $result->addToken($token); - $lastToken = $token; - - continue; - } - - $line = $tok[2]; - $values = \preg_split('/\R+/Uu', $tok[1]); - - foreach ($values as $v) { - $token = new Token( - $line, - \token_name($tok[0]), - $v - ); - $lastToken = $token; - $line++; - - if ($v === '') { - continue; - } - - $result->addToken($token); - } - } - - return $this->fillBlanks($result, $lastToken->getLine()); - } - - private function fillBlanks(TokenCollection $tokens, int $maxLine): TokenCollection { - $prev = new Token( - 0, - 'Placeholder', - '' - ); - - $final = new TokenCollection(); - - foreach ($tokens as $token) { - if ($prev === null) { - $final->addToken($token); - $prev = $token; - - continue; - } - - $gap = $token->getLine() - $prev->getLine(); - - while ($gap > 1) { - $linebreak = new Token( - $prev->getLine() + 1, - 'T_WHITESPACE', - '' - ); - $final->addToken($linebreak); - $prev = $linebreak; - $gap--; - } - - $final->addToken($token); - $prev = $token; - } - - $gap = $maxLine - $prev->getLine(); - - while ($gap > 0) { - $linebreak = new Token( - $prev->getLine() + 1, - 'T_WHITESPACE', - '' - ); - $final->addToken($linebreak); - $prev = $linebreak; - $gap--; - } - - return $final; - } -} diff --git a/vendor/theseer/tokenizer/src/XMLSerializer.php b/vendor/theseer/tokenizer/src/XMLSerializer.php deleted file mode 100644 index e67a7fe8..00000000 --- a/vendor/theseer/tokenizer/src/XMLSerializer.php +++ /dev/null @@ -1,79 +0,0 @@ -xmlns = $xmlns; - } - - public function toDom(TokenCollection $tokens): DOMDocument { - $dom = new DOMDocument(); - $dom->preserveWhiteSpace = false; - $dom->loadXML($this->toXML($tokens)); - - return $dom; - } - - public function toXML(TokenCollection $tokens): string { - $this->writer = new \XMLWriter(); - $this->writer->openMemory(); - $this->writer->setIndent(true); - $this->writer->startDocument(); - $this->writer->startElement('source'); - $this->writer->writeAttribute('xmlns', $this->xmlns->asString()); - - if (\count($tokens) > 0) { - $this->writer->startElement('line'); - $this->writer->writeAttribute('no', '1'); - - $this->previousToken = $tokens[0]; - - foreach ($tokens as $token) { - $this->addToken($token); - } - } - - $this->writer->endElement(); - $this->writer->endElement(); - $this->writer->endDocument(); - - return $this->writer->outputMemory(); - } - - private function addToken(Token $token): void { - if ($this->previousToken->getLine() < $token->getLine()) { - $this->writer->endElement(); - - $this->writer->startElement('line'); - $this->writer->writeAttribute('no', (string)$token->getLine()); - $this->previousToken = $token; - } - - if ($token->getValue() !== '') { - $this->writer->startElement('token'); - $this->writer->writeAttribute('name', $token->getName()); - $this->writer->writeRaw(\htmlspecialchars($token->getValue(), \ENT_NOQUOTES | \ENT_DISALLOWED | \ENT_XML1)); - $this->writer->endElement(); - } - } -} diff --git a/vendor/tijsverkoyen/css-to-inline-styles/LICENSE.md b/vendor/tijsverkoyen/css-to-inline-styles/LICENSE.md deleted file mode 100644 index 5f40959f..00000000 --- a/vendor/tijsverkoyen/css-to-inline-styles/LICENSE.md +++ /dev/null @@ -1,23 +0,0 @@ -Copyright (c) Tijs Verkoyen. 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. -3. Neither the name of the copyright holder nor the names of its 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 HOLDER 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/tijsverkoyen/css-to-inline-styles/composer.json b/vendor/tijsverkoyen/css-to-inline-styles/composer.json deleted file mode 100644 index 828f0c4a..00000000 --- a/vendor/tijsverkoyen/css-to-inline-styles/composer.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "tijsverkoyen/css-to-inline-styles", - "type": "library", - "description": "CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.", - "homepage": "https://github.com/tijsverkoyen/CssToInlineStyles", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Tijs Verkoyen", - "email": "css_to_inline_styles@verkoyen.eu", - "role": "Developer" - } - ], - "require": { - "php": "^5.5 || ^7.0 || ^8.0", - "ext-dom": "*", - "ext-libxml": "*", - "symfony/css-selector": "^2.7 || ^3.0 || ^4.0 || ^5.0 || ^6.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0 || ^7.5 || ^8.5.21 || ^9.5.10" - }, - "autoload": { - "psr-4": { - "TijsVerkoyen\\CssToInlineStyles\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "TijsVerkoyen\\CssToInlineStyles\\Tests\\": "tests" - } - }, - "extra": { - "branch-alias": { - "dev-master": "2.2.x-dev" - } - } -} diff --git a/vendor/tijsverkoyen/css-to-inline-styles/src/Css/Processor.php b/vendor/tijsverkoyen/css-to-inline-styles/src/Css/Processor.php deleted file mode 100644 index 0c5ceb16..00000000 --- a/vendor/tijsverkoyen/css-to-inline-styles/src/Css/Processor.php +++ /dev/null @@ -1,71 +0,0 @@ -doCleanup($css); - $rulesProcessor = new RuleProcessor(); - $rules = $rulesProcessor->splitIntoSeparateRules($css); - - return $rulesProcessor->convertArrayToObjects($rules, $existingRules); - } - - /** - * Get the CSS from the style-tags in the given HTML-string - * - * @param string $html - * - * @return string - */ - public function getCssFromStyleTags($html) - { - $css = ''; - $matches = array(); - $htmlNoComments = preg_replace('||s', '', $html); - preg_match_all('|(.*)|isU', $htmlNoComments, $matches); - - if (!empty($matches[1])) { - foreach ($matches[1] as $match) { - $css .= trim($match) . "\n"; - } - } - - return $css; - } - - /** - * @param string $css - * - * @return string - */ - private function doCleanup($css) - { - // remove charset - $css = preg_replace('/@charset "[^"]++";/', '', $css); - // remove media queries - $css = preg_replace('/@media [^{]*+{([^{}]++|{[^{}]*+})*+}/', '', $css); - - $css = str_replace(array("\r", "\n"), '', $css); - $css = str_replace(array("\t"), ' ', $css); - $css = str_replace('"', '\'', $css); - $css = preg_replace('|/\*.*?\*/|', '', $css); - $css = preg_replace('/\s\s++/', ' ', $css); - $css = trim($css); - - return $css; - } -} diff --git a/vendor/tijsverkoyen/css-to-inline-styles/src/Css/Property/Processor.php b/vendor/tijsverkoyen/css-to-inline-styles/src/Css/Property/Processor.php deleted file mode 100644 index 3b01861d..00000000 --- a/vendor/tijsverkoyen/css-to-inline-styles/src/Css/Property/Processor.php +++ /dev/null @@ -1,127 +0,0 @@ -cleanup($propertiesString); - - $properties = (array) explode(';', $propertiesString); - $keysToRemove = array(); - $numberOfProperties = count($properties); - - for ($i = 0; $i < $numberOfProperties; $i++) { - $properties[$i] = trim($properties[$i]); - - // if the new property begins with base64 it is part of the current property - if (isset($properties[$i + 1]) && strpos(trim($properties[$i + 1]), 'base64,') === 0) { - $properties[$i] .= ';' . trim($properties[$i + 1]); - $keysToRemove[] = $i + 1; - } - } - - if (!empty($keysToRemove)) { - foreach ($keysToRemove as $key) { - unset($properties[$key]); - } - } - - return array_values($properties); - } - - /** - * @param string $string - * - * @return string - */ - private function cleanup($string) - { - $string = str_replace(array("\r", "\n"), '', $string); - $string = str_replace(array("\t"), ' ', $string); - $string = str_replace('"', '\'', $string); - $string = preg_replace('|/\*.*?\*/|', '', $string); - $string = preg_replace('/\s\s+/', ' ', $string); - - $string = trim($string); - $string = rtrim($string, ';'); - - return $string; - } - - /** - * Converts a property-string into an object - * - * @param string $property - * - * @return Property|null - */ - public function convertToObject($property, Specificity $specificity = null) - { - if (strpos($property, ':') === false) { - return null; - } - - list($name, $value) = explode(':', $property, 2); - - $name = trim($name); - $value = trim($value); - - if ($value === '') { - return null; - } - - return new Property($name, $value, $specificity); - } - - /** - * Converts an array of property-strings into objects - * - * @param string[] $properties - * - * @return Property[] - */ - public function convertArrayToObjects(array $properties, Specificity $specificity = null) - { - $objects = array(); - - foreach ($properties as $property) { - $object = $this->convertToObject($property, $specificity); - if ($object === null) { - continue; - } - - $objects[] = $object; - } - - return $objects; - } - - /** - * Build the property-string for multiple properties - * - * @param Property[] $properties - * - * @return string - */ - public function buildPropertiesString(array $properties) - { - $chunks = array(); - - foreach ($properties as $property) { - $chunks[] = $property->toString(); - } - - return implode(' ', $chunks); - } -} diff --git a/vendor/tijsverkoyen/css-to-inline-styles/src/Css/Property/Property.php b/vendor/tijsverkoyen/css-to-inline-styles/src/Css/Property/Property.php deleted file mode 100644 index c8970cf4..00000000 --- a/vendor/tijsverkoyen/css-to-inline-styles/src/Css/Property/Property.php +++ /dev/null @@ -1,90 +0,0 @@ -name = $name; - $this->value = $value; - $this->originalSpecificity = $specificity; - } - - /** - * Get name - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Get value - * - * @return string - */ - public function getValue() - { - return $this->value; - } - - /** - * Get originalSpecificity - * - * @return Specificity - */ - public function getOriginalSpecificity() - { - return $this->originalSpecificity; - } - - /** - * Is this property important? - * - * @return bool - */ - public function isImportant() - { - return (stripos($this->value, '!important') !== false); - } - - /** - * Get the textual representation of the property - * - * @return string - */ - public function toString() - { - return sprintf( - '%1$s: %2$s;', - $this->name, - $this->value - ); - } -} diff --git a/vendor/tijsverkoyen/css-to-inline-styles/src/Css/Rule/Processor.php b/vendor/tijsverkoyen/css-to-inline-styles/src/Css/Rule/Processor.php deleted file mode 100644 index d183262f..00000000 --- a/vendor/tijsverkoyen/css-to-inline-styles/src/Css/Rule/Processor.php +++ /dev/null @@ -1,163 +0,0 @@ -cleanup($rulesString); - - return (array) explode('}', $rulesString); - } - - /** - * @param string $string - * - * @return string - */ - private function cleanup($string) - { - $string = str_replace(array("\r", "\n"), '', $string); - $string = str_replace(array("\t"), ' ', $string); - $string = str_replace('"', '\'', $string); - $string = preg_replace('|/\*.*?\*/|', '', $string); - $string = preg_replace('/\s\s+/', ' ', $string); - - $string = trim($string); - $string = rtrim($string, '}'); - - return $string; - } - - /** - * Converts a rule-string into an object - * - * @param string $rule - * @param int $originalOrder - * - * @return Rule[] - */ - public function convertToObjects($rule, $originalOrder) - { - $rule = $this->cleanup($rule); - - $chunks = explode('{', $rule); - if (!isset($chunks[1])) { - return array(); - } - $propertiesProcessor = new PropertyProcessor(); - $rules = array(); - $selectors = (array) explode(',', trim($chunks[0])); - $properties = $propertiesProcessor->splitIntoSeparateProperties($chunks[1]); - - foreach ($selectors as $selector) { - $selector = trim($selector); - $specificity = $this->calculateSpecificityBasedOnASelector($selector); - - $rules[] = new Rule( - $selector, - $propertiesProcessor->convertArrayToObjects($properties, $specificity), - $specificity, - $originalOrder - ); - } - - return $rules; - } - - /** - * Calculates the specificity based on a CSS Selector string, - * Based on the patterns from premailer/css_parser by Alex Dunae - * - * @see https://github.com/premailer/css_parser/blob/master/lib/css_parser/regexps.rb - * - * @param string $selector - * - * @return Specificity - */ - public function calculateSpecificityBasedOnASelector($selector) - { - $idSelectorsPattern = " \#"; - $classAttributesPseudoClassesSelectorsPattern = " (\.[\w]+) # classes - | - \[(\w+) # attributes - | - (\:( # pseudo classes - link|visited|active - |hover|focus - |lang - |target - |enabled|disabled|checked|indeterminate - |root - |nth-child|nth-last-child|nth-of-type|nth-last-of-type - |first-child|last-child|first-of-type|last-of-type - |only-child|only-of-type - |empty|contains - ))"; - - $typePseudoElementsSelectorPattern = " ((^|[\s\+\>\~]+)[\w]+ # elements - | - \:{1,2}( # pseudo-elements - after|before - |first-letter|first-line - |selection - ) - )"; - - return new Specificity( - preg_match_all("/{$idSelectorsPattern}/ix", $selector, $matches), - preg_match_all("/{$classAttributesPseudoClassesSelectorsPattern}/ix", $selector, $matches), - preg_match_all("/{$typePseudoElementsSelectorPattern}/ix", $selector, $matches) - ); - } - - /** - * @param string[] $rules - * @param Rule[] $objects - * - * @return Rule[] - */ - public function convertArrayToObjects(array $rules, array $objects = array()) - { - $order = 1; - foreach ($rules as $rule) { - $objects = array_merge($objects, $this->convertToObjects($rule, $order)); - $order++; - } - - return $objects; - } - - /** - * Sorts an array on the specificity element in an ascending way - * Lower specificity will be sorted to the beginning of the array - * - * @param Rule $e1 The first element. - * @param Rule $e2 The second element. - * - * @return int - */ - public static function sortOnSpecificity(Rule $e1, Rule $e2) - { - $e1Specificity = $e1->getSpecificity(); - $value = $e1Specificity->compareTo($e2->getSpecificity()); - - // if the specificity is the same, use the order in which the element appeared - if ($value === 0) { - $value = $e1->getOrder() - $e2->getOrder(); - } - - return $value; - } -} diff --git a/vendor/tijsverkoyen/css-to-inline-styles/src/Css/Rule/Rule.php b/vendor/tijsverkoyen/css-to-inline-styles/src/Css/Rule/Rule.php deleted file mode 100644 index 563889e5..00000000 --- a/vendor/tijsverkoyen/css-to-inline-styles/src/Css/Rule/Rule.php +++ /dev/null @@ -1,85 +0,0 @@ -selector = $selector; - $this->properties = $properties; - $this->specificity = $specificity; - $this->order = $order; - } - - /** - * Get selector - * - * @return string - */ - public function getSelector() - { - return $this->selector; - } - - /** - * Get properties - * - * @return Property[] - */ - public function getProperties() - { - return $this->properties; - } - - /** - * Get specificity - * - * @return Specificity - */ - public function getSpecificity() - { - return $this->specificity; - } - - /** - * Get order - * - * @return int - */ - public function getOrder() - { - return $this->order; - } -} diff --git a/vendor/tijsverkoyen/css-to-inline-styles/src/CssToInlineStyles.php b/vendor/tijsverkoyen/css-to-inline-styles/src/CssToInlineStyles.php deleted file mode 100644 index 6efc06f3..00000000 --- a/vendor/tijsverkoyen/css-to-inline-styles/src/CssToInlineStyles.php +++ /dev/null @@ -1,240 +0,0 @@ -cssConverter = new CssSelectorConverter(); - } - } - - /** - * Will inline the $css into the given $html - * - * Remark: if the html contains